diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json
new file mode 100644
index 0000000..0dbf157
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":0,"numberOfSamples":1000,"samples":[-0.002403025022753476,-2.5083047211757836e-5,-1.721638967214743e-8,-0.002402558217007106,-2.5020003017226545e-5,-1.7146589882925253e-8,-0.002402152743739069,-2.4908815008776256e-5,-1.7018183343380784e-8,-0.0024018177616850914,-2.4779340864272868e-5,-1.686693112266686e-8,-0.0024015512294922256,-2.4661265859267777e-5,-1.672851429567895e-8,-0.0024013415089134365,-2.4580601237402673e-5,-1.6634308307010567e-8,-0.0024011692853140917,-2.4557354638250633e-5,-1.660856911234815e-8,-0.0024010094083213077,-2.460379520847823e-5,-1.666634004388421e-8,-0.002400832781870665,-2.472274606391698e-5,-1.681138635859172e-8,-0.0024006088674261195,-2.490565851910724e-5,-1.7033840158805374e-8,-0.0024003096414815053,-2.513083477542098e-5,-1.7307985763326293e-8,-0.002399915678730765,-2.5363106308028472e-5,-1.759177707540246e-8,-0.0023994239684226163,-2.5557205638682287e-5,-1.7830822072448312e-8,-0.0023988549431304905,-2.566700881355288e-5,-1.7969488578482e-8,-0.0023982538707374547,-2.5660422954022525e-5,-1.7968844164137065e-8,-0.002397681821948537,-2.553480284678542e-5,-1.7825226886235993e-8,-0.0023971964165357008,-2.53237668313255e-5,-1.7578462540315414e-8,-0.002396830441918346,-2.50885777844268e-5,-1.7301586465142487e-8,-0.0023965800106651434,-2.4896546614298096e-5,-1.7075078798371497e-8,-0.0023964084361551537,-2.4797687943490375e-5,-1.695902560230991e-8,-0.002396262002993096,-2.481096708533641e-5,-1.6976666372280337e-8,-0.0023960882393536166,-2.4923817586803518e-5,-1.7113670694608337e-8,-0.002395849219877066,-2.5101106375207836e-5,-1.732863106912266e-8,-0.002395527525579831,-2.5297461255455714e-5,-1.756761197379987e-8,-0.0023951260596151974,-2.546854998291281e-5,-1.7777564319951067e-8,-0.0023946640036132836,-2.5579325396643004e-5,-1.7916241394922998e-8,-0.0023941708783994835,-2.5608875350224024e-5,-1.7958135357141878e-8,-0.0023936800199459637,-2.5552141704174967e-5,-1.7896681829365477e-8,-0.00239322243029576,-2.5418865388500117e-5,-1.774311016303839e-8,-0.0023928218677541743,-2.5230314934074022e-5,-1.7522587181791123e-8,-0.0023924917832175113,-2.5014690159013176e-5,-1.7268730448048223e-8,-0.0023922342643846748,-2.480218762163173e-5,-1.7017686942652696e-8,-0.0023920407464684762,-2.4620565317509125e-5,-1.6802798466007283e-8,-0.0023918939307276768,-2.4491771693316273e-5,-1.6650542584010726e-8,-0.0023917702332855676,-2.442975015807349e-5,-1.6577888357278284e-8,-0.002391642329452238,-2.443909807420655e-5,-1.6590679729922046e-8,-0.002391481763245852,-2.4514179502452957e-5,-1.6682551340715887e-8,-0.0023912619080620466,-2.4638499724969643e-5,-1.6834129065335303e-8,-0.002390961805205984,-2.478455800610903e-5,-1.701276797456279e-8,-0.00239057134744484,-2.4915132198915024e-5,-1.717399678816932e-8,-0.0023900974268101054,-2.4987729973603072e-5,-1.7266795508165544e-8,-0.0023895689055318833,-2.496391501976109e-5,-1.7244787681999786e-8,-0.002389036165074365,-2.4823284691699932e-5,-1.7083063873624844e-8,-0.002388560578292379,-2.4577378315217863e-5,-1.6794918110509053e-8,-0.0023881937570601162,-2.4274142413621198e-5,-1.643724545979219e-8,-0.0023879553394346147,-2.3985163329236852e-5,-1.6095335313882396e-8,-0.002387823242597225,-2.3778727505381422e-5,-1.5850778179207802e-8,-0.002387743703083488,-2.3693514905278695e-5,-1.575012576846581e-8,-0.002387654469699301,-2.3727803248252375e-5,-1.57919573836453e-8,-0.0023875068224310926,-2.384701163322787e-5,-1.5935693828749185e-8,-0.0023872766838733636,-2.4000872036063545e-5,-1.6121849968027748e-8,-0.0023869645383715133,-2.4139837531397063e-5,-1.6291451853276617e-8,-0.0023865890688437295,-2.4225578577636494e-5,-1.6398545934918142e-8,-0.002386179207668243,-2.4235415814278647e-5,-1.641560182566368e-8,-0.0023857671367677994,-2.4162608465253676e-5,-1.633403013000638e-8,-0.00238538293231372,-2.4014446579879058e-5,-1.6162059832962554e-8,-0.002385050648932289,-2.3809267842749758e-5,-1.5921265822080736e-8,-0.0023847856192039767,-2.357281279621325e-5,-1.564223465313254e-8,-0.002384592973846085,-2.333418942320294e-5,-1.5359717819261274e-8,-0.0023844674152753756,-2.3121781930974167e-5,-1.5107704928910368e-8,-0.0023843942234786524,-2.2959461734624766e-5,-1.491486592392592e-8,-0.002384351361188566,-2.2863520256191973e-5,-1.4800873864748202e-8,-0.0023843123252193354,-2.28406536006252e-5,-1.4773996666932113e-8,-0.0023842493365599203,-2.2887020091128393e-5,-1.4829969279080835e-8,-0.0023841366567967904,-2.2988230871289267e-5,-1.4951960812478233e-8,-0.0023839539952364617,-2.312021069380629e-5,-1.5111546301631272e-8,-0.00238369008534005,-2.3251022890859802e-5,-1.527079819049034e-8,-0.0023833464925758774,-2.3344139544444378e-5,-1.5386101234343148e-8,-0.002382941139623567,-2.336411463944466e-5,-1.5414884137776942e-8,-0.002382509826925251,-2.328539769468119e-5,-1.532618136616557e-8,-0.0023821027927208825,-2.3103440347943915e-5,-1.5114003628255345e-8,-0.002381773349088804,-2.284408291453904e-5,-1.4808671898883374e-8,-0.0023815590512039917,-2.2563826220574735e-5,-1.4477243667166011e-8,-0.002381463086871345,-2.233471929550198e-5,-1.4205559558666824e-8,-0.0023814485095478804,-2.221697578834785e-5,-1.4065641166745777e-8,-0.002381452228381859,-2.2233998994991225e-5,-1.4085907881538568e-8,-0.002381411455037569,-2.2365307161191684e-5,-1.424262147988882e-8,-0.0023812864408547367,-2.2559894107652725e-5,-1.447559680357265e-8,-0.002381068549780454,-2.2758766135733266e-5,-1.4714854003566721e-8,-0.0023807747559344136,-2.291337561706086e-5,-1.4902487127724783e-8,-0.002380436370789755,-2.2994297064707167e-5,-1.5003052078078702e-8,-0.0023800885646524635,-2.299177707261808e-5,-1.5004382649226507e-8,-0.00237976327801646,-2.291211671228343e-5,-1.4913466509235396e-8,-0.0023794853741548514,-2.277298527889861e-5,-1.4750994633350504e-8,-0.0023792708581126575,-2.2599122259547465e-5,-1.4546281765613793e-8,-0.0023791261518308006,-2.241861685502684e-5,-1.4332799297124966e-8,-0.002379048025038435,-2.2259517123002332e-5,-1.4144070736454437e-8,-0.002379024159088545,-2.214660348294054e-5,-1.4009774292460906e-8,-0.0023790344674725033,-2.209831973031592e-5,-1.395206580492697e-8,-0.0023790533562057336,-2.2124111902023713e-5,-1.3982415286808531e-8,-0.002379052917494198,-2.222265873839312e-5,-1.4099513692685225e-8,-0.0023790067355613062,-2.238139064397462e-5,-1.428869841454831e-8,-0.002378893869389061,-2.257747476862916e-5,-1.4523091866730754e-8,-0.002378702581053121,-2.2780337278386994e-5,-1.476653436627111e-8,-0.002378433361551305,-2.2955662245878917e-5,-1.4978254730954575e-8,-0.002378100828725866,-2.3070719458652143e-5,-1.511914018072533e-8,-0.0023777339193535064,-2.310095367991105e-5,-1.515956714522654e-8,-0.0023773732909614727,-2.303748192499462e-5,-1.5088399696609955e-8,-0.0023770645160716658,-2.2893966475516838e-5,-1.492131520640025e-8,-0.002376846389675512,-2.2709585344523315e-5,-1.4704506770614907e-8,-0.0023767362857042957,-2.2543662682762967e-5,-1.4508420483594385e-8,-0.0023767187552697256,-2.2459283627088534e-5,-1.4408307234147157e-8,-0.0023767459611238515,-2.2499820209175073e-5,-1.445625065299755e-8,-0.0023767538670920077,-2.2670163085399482e-5,-1.4658709621930782e-8,-0.0023766872411040843,-2.2934727415897178e-5,-1.4973964372283597e-8,-0.0023765193201164465,-2.323369224805631e-5,-1.5331258141108677e-8,-0.0023762563410213845,-2.350669143427009e-5,-1.5658866089500266e-8,-0.002375928430938125,-2.371079089789632e-5,-1.5905466616878e-8,-0.0023755754730009244,-2.382701217823089e-5,-1.6047996748580552e-8,-0.0023752354105984904,-2.3857755177899014e-5,-1.6088754695381856e-8,-0.002374937643938984,-2.3820288416794153e-5,-1.6047823960984603e-8,-0.002374700710601401,-2.3740166302795695e-5,-1.5955340321399732e-8,-0.0023745323579410426,-2.364615831678585e-5,-1.584546360315411e-8,-0.002374430478790293,-2.356666639934087e-5,-1.575205426032653e-8,-0.002374384221762089,-2.352701024171114e-5,-1.57053729084508e-8,-0.0023743752258978223,-2.3547031862098734e-5,-1.572919102890182e-8,-0.0023743792463522813,-2.3638741087943782e-5,-1.5837991897107692e-8,-0.002374368580960303,-2.380412406762251e-5,-1.60343866710735e-8,-0.002374315566041234,-2.403369636554169e-5,-1.6307405665562255e-8,-0.0023741969508027684,-2.4306554286211768E-05,-1.663253558578559e-8,-0.0023739984897390765,-2.4592488041431972e-5,-1.6974166769903272e-8,-0.0023737187937815855,-2.485635257581502e-5,-1.729069822860392e-8,-0.0023733713634909127,-2.506433547134887e-5,-1.75419012861819e-8,-0.002372983923689407,-2.5191127286277645e-5,-1.769739737193478e-8,-0.002372594652471399,-2.5226659292504724e-5,-1.774469317666995e-8,-0.0023722453489884105,-2.518097690876975e-5,-1.7695084665231785e-8,-0.0023719720500917853,-2.508558541252764e-5,-1.758542950683843e-8,-0.0023717945137316262,-2.4989429346639012e-5,-1.7473550411127092e-8,-0.002371707467356645,-2.494832237534192e-5,-1.7425795584798645e-8,-0.002371677894372136,-2.5008867215187453e-5,-1.7497939205762146e-8,-0.0023716521953735695,-2.519167607485704e-5,-1.7715125311405072e-8,-0.002371573067713854,-2.548183725590846e-5,-1.8060341886620035e-8,-0.0023713996123746663,-2.5833052724984733e-5,-1.8479137373701417e-8,-0.002371120733790304,-2.6184543627960917e-5,-1.8899572452170946e-8,-0.002370755545988175,-2.6481976563885553e-5,-1.925703522704526e-8,-0.0023703426289241364,-2.6692240399045317e-5,-1.951183288718046e-8,-0.002369925545652223,-2.6807480392539526e-5,-1.9654094044252732e-8,-0.0023695414256623836,-2.6840554567015164e-5,-1.969852847864199e-8,-0.0023692152111846727,-2.681698378371743e-5,-1.9675010651785046e-8,-0.0023689586030738027,-2.676742403134865e-5,-1.961971546979294e-8,-0.002368771517557994,-2.672230169153053e-5,-1.9568738474777108e-8,-0.0023686442754798733,-2.6708491821190418e-5,-1.9554090992955217e-8,-0.0023685596467347297,-2.6747237733667733e-5,-1.960116950419851e-8,-0.0023684946354959537,-2.68525198499682e-5,-1.97267938434712e-8,-0.002368422377939945,-2.7029396546161804e-5,-1.9937245693158044e-8,-0.002368314731930507,-2.7272358283705946e-5,-2.0226327583010683e-8,-0.002368145999280894,-2.7564325967266348e-5,-2.0574158419038293e-8,-0.0023678977178564387,-2.7877297359742607e-5,-2.0947880438817348e-8,-0.002367563716932125,-2.8175607003251493e-5,-2.13054362009557e-8,-0.0023671538835179904,-2.842219417818171e-5,-2.1602912348808545e-8,-0.0023666947656918185,-2.8587099112517685e-5,-2.1804557557978034e-8,-0.002366225711058261,-2.865603679897383e-5,-2.1892948933762033e-8,-0.0023657906850576426,-2.8636207775475263e-5,-2.1875955583981355e-8,-0.0023654275601418958,-2.855700316341736e-5,-2.178772414823076e-8,-0.0023651577407058874,-2.8464659629023123e-5,-2.168254086275059e-8,-0.002364979157822262,-2.8411626526095733e-5,-2.162241058543541e-8,-0.0023648650418965824,-2.8442979454826838e-5,-2.166103733977592e-8,-0.0023647696710966484,-2.858341235909699e-5,-2.182833892955203e-8,-0.0023646404647817425,-2.8828964162584613e-5,-2.2120438590644107e-8,-0.002364433315624853,-2.9147094222646294e-5,-2.2499504905555506e-8,-0.0023641258489594833,-2.9486173871872614e-5,-2.2904806040155516e-8,-0.0023637232753826293,-2.979130710829397e-5,-2.3271375506734424e-8,-0.0023632546433513643,-3.0020135017275484e-5,-2.3548762139194928e-8,-0.002362761919778162,-3.0152532930312014e-5,-2.371261331000258e-8,-0.002362287259213515,-3.019176737033716e-5,-2.3766181246292998e-8,-0.002361863354709199,-3.015895406508579e-5,-2.3733906423839642e-8,-0.0023615089325091636,-3.0084812691876054e-5,-2.3651770841389847e-8,-0.00236122863993826,-3.0002168291456246e-5,-2.355846990290136e-8,-0.002361015342081342,-2.9940748794497447e-5,-2.3489231721847384e-8,-0.002360853090462664,-2.99242064708113e-5,-2.347223119682423e-8,-0.0023607198261957722,-2.9968579872684983e-5,-2.352671480071416e-8,-0.0023605896206938806,-3.008134175253829e-5,-2.3661849584525067e-8,-0.002360434817332799,-3.0260449420114613e-5,-2.3875596082544623e-8,-0.002360228724551759,-3.049336232044938e-5,-2.4153533560309604e-8,-0.002359949398259028,-3.0756647438100245e-5,-2.4468344706144205e-8,-0.0023595845450922696,-3.1017291850921676e-5,-2.4781284325725616e-8,-0.0023591366902662777,-3.1236974924948935e-5,-2.5047141991886597e-8,-0.0023586265980894577,-3.1379935910133564e-5,-2.5223485405296768e-8,-0.0023580922330621156,-3.1423318194842274e-5,-2.5282880705071384e-8,-0.002357581446433621,-3.136654245445751e-5,-2.5224014627911062e-8,-0.0023571393504713037,-3.123511772789739e-5,-2.507629936540768e-8,-0.0023567945569627356,-3.107585378526121e-5,-2.4894381030997065e-8,-0.002356549808293787,-3.094425143746427e-5,-2.474345004782824e-8,-0.0023563808398743354,-3.088856588907149e-5,-2.468058353057825e-8,-0.002356243673347264,-3.093631165990455e-5,-2.473883210055294e-8,-0.0023560873309623623,-3.108742146766624e-5,-2.491898425872327e-8,-0.002355867681615853,-3.131543790559243e-5,-2.5190695953120915e-8,-0.0023555585115042363,-3.157564626292947e-5,-2.5501820575724358e-8,-0.0023551570793018816,-3.1817414987353845e-5,-2.5792819079502532e-8,-0.0023546830395721335,-3.199708556138092e-5,-2.601196397786125e-8,-0.0023541715928763573,-3.2087761735616844e-5,-2.612699814404651e-8,-0.0023536634728575476,-3.208356074308803e-5,-2.6130313106072467e-8,-0.002353195112875602,-3.199796079202877e-5,-2.6037164980856268e-8,-0.0023527917127598285,-3.185788963483199e-5,-2.5878832104811108e-8,-0.0023524643421163408,-3.1696231806253835e-5,-2.569384848742031e-8,-0.002352210558042157,-3.15451429795799e-5,-2.5520122001298037e-8,-0.002352017095867703,-3.1431404225224024e-5,-2.5389404645823923e-8,-0.0023518632011028735,-3.137387309610943e-5,-2.532421829510982e-8,-0.0023517237164243985,-3.138241693585632e-5,-2.5336544634470662e-8,-0.0023515716747720653,-3.1457557889187125e-5,-2.542738407693742e-8,-0.002351380666688492,-3.159026777706401e-5,-2.5586503563180176e-8,-0.002351127544409854,-3.1761819323126654e-5,-2.5792232842799336e-8,-0.002350795997438297,-3.194420346482523e-5,-2.601189004377488e-8,-0.00235038109753939,-3.210218902073709e-5,-2.620411988036901e-8,-0.0023498939766626002,-3.2198362784118887e-5,-2.6324761207664516e-8,-0.002349364441336059,-3.2201906185988056e-5,-2.6337171516754927e-8,-0.002348838300113838,-3.2099820884316304e-5,-2.622549250364978e-8,-0.002348367104865175,-3.1906193387378433E-05,-2.6005638953133388e-8,-0.002347991928908947,-3.16632964565759e-5,-2.572670334096174e-8,-0.0023477278385863123,-3.1430895046698076e-5,-2.5458524871709287e-8,-0.0023475573302447783,-3.1266834683295797e-5,-2.526903432937616e-8,-0.0023474365947856223,-3.1207840834265524e-5,-2.5201788974958383e-8,-0.0023473111312674834,-3.125926073193481e-5,-2.5263855985966862e-8,-0.0023471329217680113,-3.139668630853095e-5,-2.5427484190962568e-8,-0.0023468725828316842,-3.157629805487812e-5,-2.564195034641037e-8,-0.00234652400711633,-3.174838223286182e-5,-2.5849203831761563e-8,-0.0023461023891960834,-3.1869477830964374e-5,-2.5998061315297644e-8,-0.0023456379459007243,-3.191071358278629e-5,-2.6054089874945166e-8,-0.002345167714297938,-3.1861618822297345e-5,-2.6004274687434745e-8,-0.0023447273964050676,-3.1729710102991125e-5,-2.5856743363241975e-8,-0.0023443447623778383,-3.15367263237694e-5,-2.5636504725218675e-8,-0.002344035611415732,-3.1312828941514695e-5,-2.5378716588854288e-8,-0.0023438025868741026,-3.1090321324122036e-5,-2.5121307043493483e-8,-0.002343636419494298,-3.0898215687290654e-5,-2.4898533605619872e-8,-0.0023435187346924568,-3.075840762917019e-5,-2.473640851696107e-8,-0.002343425470101371,-3.06836209512552e-5,-2.4650217468068794e-8,-0.002343330156203922,-3.067678824239108e-5,-2.46437581014699e-8,-0.0023432067557343844,-3.0731268964403044e-5,-2.4709591242115973e-8,-0.002343032205144756,-3.083142896996042e-5,-2.482971769728214e-8,-0.0023427890317182145,-3.09534849684997e-5,-2.4976536733214626e-8,-0.002342468429998982,-3.1066960867543575e-5,-2.5114480866863458e-8,-0.0023420738829506476,-3.113759753821509e-5,-2.520334251191813e-8,-0.0023416245655075696,-3.113286617338482e-5,-2.5204692814982757e-8,-0.002341156456037676,-3.1030702451985074e-5,-2.5092155875587517e-8,-0.0023407180452088712,-3.083007768640861e-5,-2.4863906224778936e-8,-0.0023403583393829482,-3.055874873840108e-5,-2.4551880478986413e-8,-0.002340109110049135,-3.027131810595971e-5,-2.421961909495806e-8,-0.0023399695530012623,-3.0033690127916367e-5,-2.394416454197952e-8,-0.0023399035996637175,-2.9898874983898596e-5,-2.378781857784365e-8,-0.0023398534173924984,-2.9886919236503446e-5,-2.3774659522504135e-8,-0.002339761711113448,-2.9979953784273124e-5,-2.388461211409085e-8,-0.0023395905205925225,-3.0132912884441697e-5,-2.4065731184666787e-8,-0.002339328969507674,-3.0291463113513845e-5,-2.4254908440399182e-8,-0.0023389905263682936,-3.0407909014329455e-5,-2.439632805788379e-8,-0.002338604647812188,-3.0450610353352113e-5,-2.4452510933726005e-8,-0.002338207386718835,-3.0406942615971795e-5,-2.4407957962391716e-8,-0.002337833512955816,-3.0281802581374335e-5,-2.4267646192649814e-8,-0.002337510916804099,-3.009374007485284e-5,-2.405271127085375e-8,-0.00233725717872705,-2.9870050109659613e-5,-2.379481298482102e-8,-0.0023370780896862574,-2.96415499392353e-5,-2.3530020163429226e-8,-0.0023369679571642664,-2.943765111817507e-5,-2.3292964938693384e-8,-0.002336911380731853,-2.928228272071026e-5,-2.311196745938867e-8,-0.0023368860519105425,-2.9191004014698512e-5,-2.3005572673000774e-8,-0.0023368660995786595,-2.9169474421886248e-5,-2.2980719814710166e-8,-0.002336825467155114,-2.921325593941368e-5,-2.3032512896595408e-8,-0.0023367409423963475,-2.9308629309781252e-5,-2.3145193486284356e-8,-0.002336594789812839,-2.94340434461076e-5,-2.329383537317645e-8,-0.002336377141683103,-2.9562078747041886e-5,-2.3446595994696407e-8,-0.0023360882937399465,-2.9662099579462933e-5,-2.3567732219797592e-8,-0.0023357408585416017,-2.9704065354320472e-5,-2.36219691020052e-8,-0.0023353611169372288,-2.9664178807460198e-5,-2.3581074777115405e-8,-0.002334987901996926,-2.953256184083392e-5,-2.3432902238347995e-8,-0.002334666656879615,-2.9321444023828176e-5,-2.3191111499019182e-8,-0.002334437144125591,-2.906967526378198e-5,-2.2900614292587276e-8,-0.0023343170286952335,-2.8837540628692366e-5,-2.263164135915559e-8,-0.002334289377364724,-2.868863915936848e-5,-2.245863079739621e-8,-0.0023343042731189534,-2.8664576401788524e-5,-2.243065985991554e-8,-0.002334297427240077,-2.8766728884431434e-5,-2.2550060161150142e-8,-0.00233421602436304,-2.8956937999179782e-5,-2.277304822604038e-8,-0.0023340366493231914,-2.9175695277364925e-5,-2.3030723691705274e-8,-0.0023337675567428337,-2.9365148437702835e-5,-2.325572494540632e-8,-0.002333439019167699,-2.948499872544599e-5,-2.3400714149062195e-8,-0.002333090235900311,-2.9517803647735512e-5,-2.3444668908795366e-8,-0.002332758701346869,-2.9466638538369463e-5,-2.3390385484474364e-8,-0.0023324738052357035,-2.934937562502968e-5,-2.3258055105401835e-8,-0.0023322540424882687,-2.919255582833955e-5,-2.3078281732160556e-8,-0.0023321064600515273,-2.902614663617285e-5,-2.2885999487207492e-8,-0.002332027286009202,-2.8879263050207602e-5,-2.271540058262342e-8,-0.0023320033619865835,-2.877662704188809e-5,-2.259567613496163e-8,-0.002332014289946477,-2.873576097567269e-5,-2.2547631244607782e-8,-0.002332035177135321,-2.8765014379972653e-5,-2.2581326280258576e-8,-0.0023320398449503863,-2.8862571973660708e-5,-2.2694919143851268e-8,-0.0023320042471653172,-2.9016654866027363e-5,-2.287492871831799e-8,-0.0023319096779583115,-2.9206946607571382e-5,-2.3097917898279694e-8,-0.002331745434296553,-2.940702053860624e-5,-2.333330260051453e-8,-0.0023315107913132412,-2.9587554741398894e-5,-2.354703004535643e-8,-0.002331216183994399,-2.9720241445388588e-5,-2.370604059396504e-8,-0.0023308833968589734,-2.9782371874826208e-5,-2.378354402409868e-8,-0.0023305442821816677,-2.976211745161164e-5,-2.376519028712881e-8,-0.002330237019842478,-2.9664138028036154e-5,-2.3655730605611676e-8,-0.002329998741183291,-2.9513937315933643e-5,-2.3484296706424633e-8,-0.0023298543227104943,-2.935776247905231e-5,-2.3304483190610554e-8,-0.0023298039688696283,-2.9254146272590037e-5,-2.3184600111912306e-8,-0.0023298161627486316,-2.9255771124284795e-5,-2.3186513526067538e-8,-0.002329833717182933,-2.9387407680729007e-5,-2.3339799540173714e-8,-0.00232979429485865,-2.963251445919433e-5,-2.3625939095795707e-8,-0.0023296555485235837,-2.993876684354111e-5,-2.3984573422930422e-8,-0.002329410031430962,-3.0240089226068864e-5,-2.433902191722381e-8,-0.002329082684861528,-3.048133910260082e-5,-2.4624941076546366e-8,-0.002328716252266335,-3.063272313348873e-5,-2.4807118980201846e-8,-0.0023283552432151315,-3.0691090518933916e-5,-2.4881121231374615e-8,-0.002328035235814446,-3.067316204035687e-5,-2.486564617259907e-8,-0.002327778453652459,-3.060672619689269e-5,-2.4792504271784795e-8,-0.0023275936390781573,-3.052324005011218e-5,-2.4698123022970693e-8,-0.002327477917828302,-3.0452785078251434e-5,-2.461765146651857e-8,-0.002327419112590265,-3.0420884134364205E-05,-2.458113394257909e-8,-0.0023273980040969685,-3.0446326357327403e-5,-2.4610839446448034e-8,-0.002327390669521878,-3.0539531096370326e-5,-2.4719266183936192e-8,-0.0023273711094918687,-3.070139397965835e-5,-2.4907774784639605e-8,-0.002327314298389271,-3.0922803788878494e-5,-2.5166047977091938e-8,-0.002327199604182002,-3.118523180180453e-5,-2.5472802828543438e-8,-0.0023270141555905726,-3.146275582275373e-5,-2.579813850369303e-8,-0.002326755507257778,-3.1725524753218145e-5,-2.6107509797618743e-8,-0.002326433025242352,-3.194433915074523e-5,-2.636696380227279e-8,-0.00232606757107646,-3.2095816875852493E-05,-2.6549064620552972e-8,-0.0023256892347763903,-3.216744119251998e-5,-2.663874128588696e-8,-0.0023253330548705857,-3.216173673953351e-5,-2.6638224765391106e-8,-0.002325032753407156,-3.209873777588853e-5,-2.6570101510359574e-8,-0.0023248127299698297,-3.201549252585091e-5,-2.6476970450584947e-8,-0.002324679419257254,-3.1960909325668365e-5,-2.641563798078472e-8,-0.002324614738368727,-3.198471760129885e-5,-2.6444333423830437e-8,-0.0023245759518624605,-3.2121629871326e-5,-2.6604171937243653e-8,-0.002324505785473568,-3.237602913514e-5,-2.6901108196581215e-8,-0.0023243518127423596,-3.271591879496891e-5,-2.7298653087985366e-8,-0.00232408675837698,-3.308237216229446e-5,-2.772870037338478e-8,-0.0023237183421038277,-3.341134600686158e-5,-2.8116827565107905e-8,-0.0023232834120907914,-3.365603424276712e-5,-2.8408283829963784e-8,-0.0023228315250686865,-3.379852594585868e-5,-2.8581601521190148e-8,-0.0023224081917482394,-3.384823308876176e-5,-2.8646918820079517e-8,-0.0023220447513682056,-3.3832392487888304e-5,-2.8635163154902712e-8,-0.0023217556857669294,-3.378539642682306e-5,-2.8585851446400122e-8,-0.0023215406467797794,-3.374081042009061e-5,-2.8537897313167375e-8,-0.002321388188291431,-3.3726795999537757e-5,-2.8524238705810844e-8,-0.002321279357326137,-3.376398701175925e-5,-2.8569237172436706e-8,-0.002321190580067218,-3.3864561252015965e-5,-2.8687469509032147e-8,-0.0023210960815719848,-3.403170234189584e-5,-2.8883032294239802e-8,-0.0023209703112198727,-3.425921865422195e-5,-2.9149091545929388e-8,-0.0023207907692627456,-3.453153525414017e-5,-2.9467892708359517e-8,-0.002320541348280485,-3.4824632907782434e-5,-2.9811852888919886e-8,-0.002320215787982576,-3.510859047522046e-5,-3.014647119465895e-8,-0.002319820326628823,-3.5352020534393274e-5,-3.0435397604764066e-8,-0.002319374429235887,-3.5528027890910064e-5,-3.064726176518535e-8,-0.0023189086929537852,-3.562058707993201e-5,-3.0763027321289934e-8,-0.0023184596969337903,-3.562967431567573e-5,-3.078198150000386e-8,-0.0023180625159862473,-3.557348082881343e-5,-3.072444153370548e-8,-0.0023177424037032486,-3.548664144440317e-5,-3.062992075551395e-8,-0.0023175074984734543,-3.5414226963611394e-5,-3.0550393228261676e-8,-0.0023173444808164832,-3.5402047537825155e-5,-3.053919267474974e-8,-0.002317219043515323,-3.548478675955916e-5,-3.063722510387765e-8,-0.0023170825452282313,-3.567474791693208e-5,-3.085971138660794e-8,-0.0023168847150472982,-3.595522696647335e-5,-3.118819869005432e-8,-0.0023165894160324624,-3.628263070896687e-5,-3.157275232013399e-8,-0.0023161874027681608,-3.659879209134966e-5,-3.194610912976707e-8,-0.002315699674318987,-3.6849589557777495e-5,-3.224527727736699e-8,-0.002315169322935829,-3.7001624225642415e-5,-3.2430960432418255e-8,-0.002314646199700832,-3.704960690848625e-5,-3.249625130896201e-8,-0.0023141720768090047,-3.701289220350198e-5,-3.246278529929417e-8,-0.0023137719944856,-3.692533958583261e-5,-3.2369181497699095e-8,-0.002313452787336121,-3.682436937453514e-5,-3.225850415814049e-8,-0.002313206349815514,-3.674303927821273e-5,-3.216911319350878e-8,-0.002313014513893187,-3.6705975238209506e-5,-3.21298653443614e-8,-0.002312853494672486,-3.6728114464930174e-5,-3.215852030546475e-8,-0.0023126972338266515,-3.681481612065799e-5,-3.226175333094992e-8,-0.0023125198655322456,-3.696232465768661e-5,-3.24356389814037e-8,-0.002312297893017724,-3.7158178604489365e-5,-3.266612338087536e-8,-0.0023120126639769563,-3.7381726521067834e-5,-3.292962936131338e-8,-0.002311653424383115,-3.760539504033395e-5,-3.319450237088803e-8,-0.0023112206387045776,-3.7797568417562995e-5,-3.3424282093674193e-8,-0.002310728536788081,-3.7927679776685745e-5,-3.3583518129125895e-8,-0.0023102052694704335,-3.7973269632081315e-5,-3.3645883688399196e-8,-0.002309689114953737,-3.792741024238655e-5,-3.3602769741033175e-8,-0.002309220367796046,-3.780365018678395e-5,-3.34690861984953e-8,-0.0023088306454635615,-3.763560952953059e-5,-3.328295822689161e-8,-0.0023085331437765486,-3.7470095324169245e-5,-3.30979876994702e-8,-0.0023083175552887736,-3.7355299923970754e-5,-3.296981668241202e-8,-0.0023081517291295645,-3.732774019023125e-5,-3.2941121239366296e-8,-0.0023079897002703125,-3.740204716129852e-5,-3.302971182509186e-8,-0.0023077837234663535,-3.7566599907923365e-5,-3.322321468544985e-8,-0.0023074969972720206,-3.778618699150824e-5,-3.348181192736664e-8,-0.002307113642460123,-3.801111136025596e-5,-3.374850764245679e-8,-0.002306642967714749,-3.819047303514916e-5,-3.3964389987148476e-8,-0.0023061164179579287,-3.8285780849737995e-5,-3.40844388236443e-8,-0.0023055780533455137,-3.828042081343265e-5,-3.408864550347391e-8,-0.0023050720265702773,-3.818189606197478e-5,-3.3984813393723e-8,-0.0023046316398957264,-3.801683262139339e-5,-3.3802987367837267e-8,-0.00230427334288954,-3.7821682524135505e-5,-3.358486019035794e-8,-0.0023039963644423222,-3.7633111972824855e-5,-3.337272686138091e-8,-0.002303786336992908,-3.748100255910153e-5,-3.320135317605305e-8,-0.0023036204437704402,-3.738497046118624e-5,-3.3093833427999516e-8,-0.002303472191629436,-3.735370107695463e-5,-3.306068870435814e-8,-0.002303315004370737,-3.738581151208172e-5,-3.310077586295026e-8,-0.0023031247168510474,-3.7471158388023855e-5,-3.32027746012847e-8,-0.002302881512812013,-3.759204402485969e-5,-3.334659244660564e-8,-0.002302571933303701,-3.772437161974421e-5,-3.3504698526810776e-8,-0.0023021913377570913,-3.7839318120416736e-5,-3.364401288936653e-8,-0.0023017466592312736,-3.790639624397905e-5,-3.3729365113627754e-8,-0.002301258499438132,-3.789868982799408e-5,-3.3729469251606456e-8,-0.0023007607416336475,-3.780025860121621e-5,-3.362545368835861e-8,-0.0023002955727393715,-3.761398422436507e-5,-3.341996763976326e-8,-0.002299903135206751,-3.7366095073082776e-5,-3.314251715734096e-8,-0.002299608241321281,-3.7103131944292765e-5,-3.284613208267745e-8,-0.002299409859179875,-3.687991824381861e-5,-3.259369265324991e-8,-0.002299279285932504,-3.674229260682073e-5,-3.243819215569253e-8,-0.002299168823546775,-3.6712133551511284e-5,-3.240551750739637e-8,-0.002299027108588892,-3.678121604662647e-5,-3.248721326687466e-8,-0.0022988143521173038,-3.6915489318077446e-5,-3.2645093229978927e-8,-0.0022985121434507642,-3.706652291671608e-5,-3.282408232012828e-8,-0.0022981259731840605,-3.718510344513982e-5,-3.296765596479805e-8,-0.002297681444338649,-3.723291069296564e-5,-3.3031266622567177e-8,-0.0022972163826716816,-3.7189964304819385e-5,-3.299108395567988e-8,-0.002296771289655474,-3.705699893642229e-5,-3.284699771750507e-8,-0.0022963804162048507,-3.685301926143306e-5,-3.2620069474865724e-8,-0.0022960653412444033,-3.66092080660818e-5,-3.234570517089325e-8,-0.0022958321994601843,-3.6361104881873565e-5,-3.206471491834107e-8,-0.002295672602594345,-3.6141216362085723e-5,-3.181475278986125e-8,-0.002295567237924504,-3.5973699239903435e-5,-3.1624065630400416e-8,-0.0022954906243840873,-3.5871742882865936e-5,-3.150833328403298e-8,-0.002295415668514197,-3.583734289021038e-5,-3.1470303577740756e-8,-0.002295317231199662,-3.5862619387422194e-5,-3.15012747362056e-8,-0.002295174587684972,-3.593175025312556e-5,-3.158334026307848e-8,-0.0022949731503511582,-3.6022919077861825e-5,-3.169165951737354e-8,-0.0022947059593891967,-3.6110200777476796e-5,-3.1796616976641045e-8,-0.0022943752972072132,-3.616576445549112e-5,-3.186629056886203e-8,-0.002293994395917849,-3.616308491839482e-5,-3.1870055583428156e-8,-0.0022935884913046806,-3.608188698839053e-5,-3.1784218012190775e-8,-0.002293193570220022,-3.591490428985524e-5,-3.159981966187581e-8,-0.002292850700555697,-3.567488665407547e-5,-3.1330816136700846e-8,-0.0022925949121289655,-3.539799888834784e-5,-3.101814903088958e-8,-0.002292441079759657,-3.5138654460845667e-5,-3.072396888884776e-8,-0.0022923737482313526,-3.495377210004042e-5,-3.051367324612897e-8,-0.0022923487357085484,-3.4881645478195986e-5,-3.043169702193616e-8,-0.0022923082878944408,-3.492651926994169e-5,-3.048374540670587e-8,-0.0022922023645509603,-3.5057777584302726e-5,-3.063565736187704e-8,-0.002292004823110608,-3.522321745129158e-5,-3.0828335408719365e-8,-0.002291718031987991,-3.536782916311345e-5,-3.099901295008251e-8,-0.0022913672330241424,-3.544908418763723e-5,-3.109866179650461e-8,-0.002290990059070643,-3.544468044302114e-5,-3.1100956371175926e-8,-0.0022906260283061795,-3.535334262818601e-5,-3.1003445892457103e-8,-0.0022903084934227853,-3.5191150650947184e-5,-3.082366001102285e-8,-0.002290059645962504,-3.4985740590012e-5,-3.059271116004469e-8,-0.002289888308889336,-3.476990829758171e-5,-3.034806608016834e-8,-0.002289790112933232,-3.457553303386381e-5,-3.0126527996035566e-8,-0.0022897496397346197,-3.442855427528838e-5,-2.995832382862933e-8,-0.002289743927638933,-3.434557978525591e-5,-2.986303752963534e-8,-0.002289746588173612,-3.433235628935457e-5,-2.984772570762622e-8,-0.002289731806192985,-3.438399705495003e-5,-2.9907130752155833e-8,-0.0022896776371395563,-3.448658144544781e-5,-3.0025539997263514e-8,-0.002289568333240068,-3.4619516180843974e-5,-3.0179546880832127e-8,-0.002289395830989697,-3.47581192864351e-5,-3.034104020878307e-8,-0.0022891606980330746,-3.487624615385044e-5,-3.048017863245395e-8,-0.0022888727561433233,-3.494909690242651e-5,-3.0568516096956604e-8,-0.0022885513883073552,-3.4956571873741554e-5,-3.058275352336701e-8,-0.002288225022291335,-3.4887629910986334e-5,-3.050971134872694e-8,-0.0022879285346280604,-3.474558680788467e-5,-3.0352495822772635e-8,-0.002287697014005668,-3.4552914595581084e-5,-3.013619110840197e-8,-0.002287555258528512,-3.4352264826514714e-5,-2.990924381258495e-8,-0.002287505296293813,-3.419939650252042e-5,-2.9735499630763315e-8,-0.0022875185392014596,-3.414608973943245e-5,-2.9674650423240414e-8,-0.002287540654767576,-3.421841512072958e-5,-2.975725826269698e-8,-0.0022875109191809696,-3.44028369555647e-5,-2.9968681291149824e-8,-0.0022873866431173677,-3.4650463730046105e-5,-3.025373403994287e-8,-0.002287158332342123,-3.489747604808045e-5,-3.05398504214709e-8,-0.0022868484445149025,-3.5088852879194874e-5,-3.076405861695239e-8,-0.0022864982748903593,-3.519317267669936e-5,-3.0889870385194194e-8,-0.002286152562989151,-3.520525313625685e-5,-3.091044534452543e-8,-0.002285848351995372,-3.514064936767193e-5,-3.084259232463975e-8,-0.0022856095545583004,-3.5027359972136336e-5,-3.071759518882632e-8,-0.0022854458582351883,-3.4898128170332654e-5,-3.057260162184731e-8,-0.00228535406658743,-3.4784542000901826e-5,-3.0443888195242704e-8,-0.0022853205545476122,-3.471284955278595e-5,-3.0361936066289834e-8,-0.0022853242782383083,-3.4701131164836125e-5,-3.034799776992067e-8,-0.0022853401172956323,-3.475768108400181e-5,-3.0412079618106474e-8,-0.0022853423369857883,-3.488055943683937e-5,-3.055234935450222e-8,-0.0022853079331452636,-3.505829657473036e-5,-3.075595068991225e-8,-0.002285219540357508,-3.5271714452898415e-5,-3.1001145596984345e-8,-0.0022850675526555806,-3.5496617417606936e-5,-3.12604400979373e-8,-0.0022848513167228906,-3.5706935033342264e-5,-3.150417106161792e-8,-0.0022845794630886704,-3.587803665272236e-5,-3.170422273669897e-8,-0.0022842694256383967,-3.599011192601114e-5,-3.183778648177624e-8,-0.00228394612191299,-3.6031573527607656e-5,-3.1891182357691236e-8,-0.002283639559272516,-3.6002497987339216e-5,-3.1863829412209876e-8,-0.0022833807000028155,-3.591781523569677e-5,-3.17720571397393e-8,-0.002283194835117489,-3.580895633737797e-5,-3.1651234007313374e-8,-0.0022830926687873554,-3.572151453512309e-5,-3.155331255203707e-8,-0.0022830615120185546,-3.57062013456485e-5,-3.1536574359696766e-8,-0.002283061910144253,-3.5802515052971905e-5,-3.1646865496677e-8,-0.0022830358716624693,-3.602024681505544e-5,-3.1896238479571526e-8,-0.002282927452508825,-3.6329876875859376e-5,-3.2251745516056244e-8,-0.0022827062816265977,-3.667107036558002e-5,-3.264498114105585e-8,-0.0022823796709535715,-3.697658131461953e-5,-3.299928501542816e-8,-0.0022819864232603475,-3.719735460090399e-5,-3.325834215160285e-8,-0.0022815785791103415,-3.731532145924846e-5,-3.340080377913226e-8,-0.0022812032084957965,-3.734128205682896e-5,-3.3438034270071183e-8,-0.002280891871937716,-3.7304369843453694e-5,-3.3402379181189025e-8,-0.00228065814223643,-3.724061603780327e-5,-3.333439792808469e-8,-0.0022805000038872204,-3.718451764462349e-5,-3.327337443004344e-8,-0.0022804039844390635,-3.7164175330215406e-5,-3.325171023981485e-8,-0.002280349211641098,-3.7198996010101034e-5,-3.3292116454290506e-8,-0.0022803108906574855,-3.729879835377055e-5,-3.3406389414515064e-8,-0.002280263357184188,-3.746369139111816e-5,-3.359514042205903e-8,-0.0022801829142725643,-3.76845561343038e-5,-3.3848312986735143e-8,-0.0022800505440541212,-3.794419075362827e-5,-3.4146529008746734e-8,-0.002279854394613768,-3.821932509749697e-5,-3.446344080378021e-8,-0.002279591667380771,-3.8483592197162534e-5,-3.4769134737453335e-8,-0.0022792694769532365,-3.8711202674219674e-5,-3.503427192200282e-8,-0.002278904453787725,-3.888090559245803e-5,-3.523451107453436e-8,-0.002278520994022731,-3.897981593858639e-5,-3.5354790439935546e-8,-0.0022781481387727765,-3.900661067575245e-5,-3.539296714173588e-8,-0.002277815196272408,-3.897358681368924e-5,-3.536228182941742e-8,-0.0022775462453310945,-3.8907078916294634e-5,-3.5292063500544346e-8,-0.0022773537578315915,-3.88453723888866e-5,-3.5225611058902015e-8,-0.0022772323066882973,-3.88328268780596e-5,-3.5213664861948535e-8,-0.002277154719218136,-3.89093864059176e-5,-3.5302432695555914e-8,-0.0022770743013513575,-3.909671606337604e-5,-3.551757119061668e-8,-0.0022769361938568297,-3.93858582620144e-5,-3.584980135264396e-8,-0.0022766965332619883,-3.9734321357865546e-5,-3.625133407898208e-8,-0.002276341115211891,-4.007817531691193e-5,-3.664954907985626e-8,-0.0022758922917568173,-4.035551223226274e-5,-3.697373201351628e-8,-0.0022753992488523085,-4.0528709716748785e-5,-3.7180470529775404e-8,-0.0022749180581077707,-4.059371095721217e-5,-3.726429156698758e-8,-0.0022744933359550488,-4.057442247318822e-5,-3.7251455930854735e-8,-0.0022741491150162865,-4.0509294110553696e-5,-3.718495011122612e-8,-0.0022738888817427747,-4.043836498717976e-5,-3.7109976390399145e-8,-0.0022737006122365193,-4.0394935220934196e-5,-3.706454561541384e-8,-0.0022735628534328385,-4.0401953921682715e-5,-3.7075254422409025e-8,-0.0022734497848497666,-4.047142453162688e-5,-3.7156399239620105e-8,-0.0022733348583905645,-4.060512607912676e-5,-3.731060746631049e-8,-0.0022731934580261463,-4.0795705115488924e-5,-3.752998308750005e-8,-0.00227300512552994,-4.102789765037355e-5,-3.7797496246937914e-8,-0.0022727556876095496,-4.128004247365327e-5,-3.808875005360056e-8,-0.002272439315133133,-4.152626986166031e-5,-3.837450044928072e-8,-0.0022720601389120266,-4.173970137526162e-5,-3.862427282168575e-8,-0.0022716327599983676,-4.1896595491755895e-5,-3.8811002059216745e-8,-0.0022711810539608945,-4.1980908267824755e-5,-3.8916135263443654e-8,-0.00227073496835204,-4.1988409487146426e-5,-3.8934279948754235e-8,-0.002270325441507122,-4.192927899551331e-5,-3.8876227340469446e-8,-0.002269978122215947,-4.1828177158028644e-5,-3.8769219119330844e-8,-0.00226970702629286,-4.172123601459589e-5,-3.865378498185866e-8,-0.0022695094556672577,-4.1649926366732944e-5,-3.857700174244831e-8,-0.002269363629343624,-4.165219466353312e-5,-3.858250738357373e-8,-0.0022692306298698933,-4.175204263636338e-5,-3.869853604806306e-8,-0.0022690619905320303,-4.195007217268219e-5,-3.892687238355782e-8,-0.0022688127656313537,-4.22189359377569e-5,-3.923733305382498e-8,-0.0022684568851602466,-4.2507766167857475e-5,-3.9572560430991624e-8,-0.002267998326091102,-4.275672312180571e-5,-3.986449700076138e-8,-0.0022674714734245843,-4.291695195769548e-5,-4.005713795935709e-8,-0.0022669291597497737,-4.296662160132691e-5,-4.012487438155247e-8,-0.0022664242564903914,-4.2915295188340505e-5,-4.007760659904807e-8,-0.0022659940652150863,-4.279611123618072e-5,-3.995206908990567e-8,-0.002265653503930502,-4.265191244855833e-5,-3.979631362883339e-8,-0.0022653969340296893,-4.252261313043785e-5,-3.965552378432056e-8,-0.0022652046236925952,-4.243769493960012e-5,-3.95634861733223e-8,-0.002265049794477369,-4.241380155046763e-5,-3.9539697044729416e-8,-0.0022649041082798216,-4.245547864330964e-5,-3.9589986428501323e-8,-0.00226474124918325,-4.255711975844435e-5,-3.970856627954339e-8,-0.0022645391613217362,-4.270500455743162e-5,-3.988028806109427e-8,-0.0022642816799547678,-4.287910780361013e-5,-4.008272167427198e-8,-0.002263960087918555,-4.3054900809357125e-5,-4.028824466566982e-8,-0.002263574719130994,-4.320567695985923e-5,-4.0466687322319195e-8,-0.0022631362204558894,-4.330590165289405e-5,-4.058908270551296e-8,-0.0022626656639188536,-4.3335670173572484e-5,-4.063264302083518e-8,-0.0022621925719040524,-4.328569846595285e-5,-4.0586363627982455e-8,-0.0022617502460647106,-4.316153538197371e-5,-4.045582192050501e-8,-0.0022613686905826485,-4.298517863381172e-5,-4.02651379123331e-8,-0.002261066659628733,-4.279254577136207e-5,-4.0054328367112326e-8,-0.002260845254738966,-4.2626492298289355e-5,-3.9871642378719045e-8,-0.002260685452234943,-4.252671070386968e-5,-3.976228848354713e-8,-0.0022605509404802003,-4.251909481418603e-5,-3.9756384567982686e-8,-0.002260396131472639,-4.260760900980759e-5,-3.985954021720435e-8,-0.002260177694963087,-4.277131989594658e-5,-4.004914789052283e-8,-0.002259866766101412,-4.2968166060102e-5,-4.027830918497738e-8,-0.002259458210637815,-4.3145372744970057e-5,-4.048742944540769e-8,-0.0022589733613924707,-4.3254145791464096e-5,-4.062085419440258e-8,-0.002258454294531585,-4.326392054614321e-5,-4.064315339359069e-8,-0.0022579511436190353,-4.3170655978861896e-5,-4.0548734377790825e-8,-0.0022575073922757242,-4.2995916330466316e-5,-4.036104128218041e-8,-0.0022571489718927946,-4.2777865460527206e-5,-4.012258232791228e-8,-0.0022568805697357453,-4.255884861731508e-5,-3.988102778980891e-8,-0.0022566887016491335,-4.2374725671374876e-5,-3.967716426716014e-8,-0.002256548444902981,-4.2248875604791526e-5,-3.953799287615894e-8,-0.002256430457477919,-4.2190877177150564e-5,-3.9475031093020603e-8,-0.0022563063262742698,-4.219814048656945e-5,-3.9485967035225393e-8,-0.0022561518892659908,-4.225864272457631e-5,-3.9557654446514965e-8,-0.0022559490620141626,-4.235363463796422e-5,-3.9669178707093105e-8,-0.0022556869196150115,-4.245992921932744e-5,-3.9794503964805914e-8,-0.002255362650026142,-4.2551960746738174e-5,-3.990484416493067e-8,-0.00225498259128279,-4.260418776905965e-5,-3.9971363026047316e-8,-0.0022545629951551973,-4.259443556510106e-5,-3.996888136177645e-8,-0.002254129647814144,-4.2508371758274345e-5,-3.988086135327218e-8,-0.0022537151993712646,-4.234455193159232e-5,-3.970509132900266e-8,-0.00225335330209883,-4.2118407480589275e-5,-3.9458268320626675e-8,-0.0022530698916637996,-4.186263655252896e-5,-3.917660732834667e-8,-0.0022528740190121094,-4.162180095563857e-5,-3.8909958155369906e-8,-0.002252752217450626,-4.1441201489894646e-5,-3.870944411348118e-8,-0.0022526698614514173,-4.1353325375690816e-5,-3.861225482382609e-8,-0.0022525801000990234,-4.136713774543938e-5,-3.862947201208333e-8,-0.0022524373733573866,-4.146464933767827e-5,-3.8741929345072135e-8,-0.002252210525373519,-4.1605994325611274e-5,-3.89055852814104e-8,-0.0022518911377591767,-4.1740803405337114e-5,-3.906405012373955e-8,-0.0022514949999607,-4.182182996698903e-5,-3.9163825942864726e-8,-0.0022510569958787445,-4.181681135790668e-5,-3.916776403591502e-8,-0.002250621342141275,-4.171557236139564e-5,-3.906331946104076e-8,-0.0022502301294550285,-4.15308425955026e-5,-3.886378396708598e-8,-0.002249913449319389,-4.129306958437996e-5,-3.860271679338941e-8,-0.002249683726453224,-4.104130530740587e-5,-3.832383998911728e-8,-0.002249535283975047,-4.0813295369522146e-5,-3.8069884935159855e-8,-0.0022494483048860476,-4.0637702512655366e-5,-3.787370255806774e-8,-0.002249395075586441,-4.053008747505458e-5,-3.775352485809548e-8,-0.002249346228387429,-4.049258564563083e-5,-3.771239510768213e-8,-0.0022492755010270257,-4.0516052192387256e-5,-3.774046242612261e-8,-0.0022491626277783426,-4.058321264511812e-5,-3.7818520580070174e-8,-0.0022489947436900195,-4.0671780343274614e-5,-3.7921589641568395e-8,-0.002248766957445944,-4.075711343877572e-5,-3.8021986797907276e-8,-0.0022484826632076446,-4.081452585563666e-5,-3.8091951714669235e-8,-0.002248153838048646,-4.0821728247974105e-5,-3.8106341905870566e-8,-0.002247801079960905,-4.076195151424849e-5,-3.804605949402225e-8,-0.002247452593148405,-4.0628012018448585e-5,-3.790257146744856e-8,-0.0022471409301629466,-4.042682459236734e-5,-3.768302732502345e-8,-0.00224689646765886,-4.018263561138499e-5,-3.7414039313886286e-8,-0.0022467379334867687,-3.993603737751534e-5,-3.71407722402369e-8,-0.0022466629330224067,-3.973603731085064e-5,-3.6918205817805125e-8,-0.0022466437937668942,-3.962548372148706e-5,-3.679484541297912e-8,-0.0022466332626418345,-3.962510713746668e-5,-3.679475135912498e-8,-0.0022465795112438054,-3.972433968955547e-5,-3.690704831574807e-8,-0.002246443844399572,-3.988431149987231e-5,-3.7089012125681974e-8,-0.0022462127331009103,-4.005144641550452e-5,-3.728104124941213e-8,-0.002245899726127667,-4.017461828870116e-5,-3.742571513024981e-8,-0.0022455385610210964,-4.021870065905526e-5,-3.7482979092119534e-8,-0.002245171991501091,-4.017101257208119e-5,-3.743755699529912e-8,-0.0022448406857828573,-4.0040872064166135e-5,-3.729877117661851e-8,-0.002244574842630709,-3.985434389103751e-5,-3.709499167218068e-8,-0.00224438953153147,-3.964658315948225e-5,-3.6865281132306804e-8,-0.002244283739282433,-3.9453769098646514e-5,-3.6650395806950313e-8,-0.0022442425786291715,-3.9306138580895836e-5,-3.648483998275852e-8,-0.0022442417262513318,-3.9223235736532204e-5,-3.639130046745756e-8,-0.002244252825270072,-3.921193238763609e-5,-3.637818766334322e-8,-0.002244248580715095,-3.926701981343953e-5,-3.6440147045714485e-8,-0.002244206665010873,-3.9373614587264704e-5,-3.656072898333406e-8,-0.0022441120851505714,-3.9510449394149734e-5,-3.671615220159067e-8,-0.002243958158082218,-3.9653224799783987e-5,-3.687916687487293e-8,-0.002243746569982561,-3.977754481038861e-5,-3.702240992509356e-8,-0.0022434870012997396,-3.986143852984975e-5,-3.7121211995940224e-8,-0.002243196539261886,-3.9887788360821346e-5,-3.715623183345602e-8,-0.002242898748955786,-3.984704324325663e-5,-3.711640914072695e-8,-0.0022426218280860106,-3.974042123909537e-5,-3.7002547544910815e-8,-0.0022423948446182447,-3.9583186860967147e-5,-3.683110598566761e-8,-0.002242241179018976,-3.940641160112801e-5,-3.663638469156625e-8,-0.00224216956598242,-3.925442123747653e-5,-3.646787712775838e-8,-0.002242165743912653,-3.917522022806908e-5,-3.63796461283401e-8,-0.0022421904430927637,-3.92042809462743e-5,-3.641210968875951e-8,-0.0022421888363345576,-3.934800163595166e-5,-3.657333079382851e-8,-0.0022421101287026773,-3.957707112540881e-5,-3.683135600408295e-8,-0.0022419276065207064,-3.983591431005777e-5,-3.712457446970693e-8,-0.0022416477393448642,-4.0063753426798325e-5,-3.73851192566621e-8,-0.0022413045475564155,-4.0215340963561835e-5,-3.7561970560884604e-8,-0.0022409449338205603,-4.0271819274777205e-5,-3.7633148529958066e-8,-0.0022406136872176463,-4.0240309319839884e-5,-3.7605480019251675e-8,-0.002240343470877864,-4.0146522531138636e-5,-3.750668536605433e-8,-0.002240150677565745,-4.002533269708593e-5,-3.7375157741474976e-8,-0.002240035711440105,-3.991240818250783e-5,-3.725076167766338e-8,-0.002239985804253139,-3.9838071993125945e-5,-3.7167903625866e-8,-0.0022399789880449567,-3.9823368021104823e-5,-3.715090319780558e-8,-0.0022399885175577506,-3.9878050065343086e-5,-3.721146830451135e-8,-0.002239987272940578,-4.000036042511323e-5,-3.734824122526935e-8,-0.0022399516443405575,-4.017838712946535e-5,-3.7548239619326853e-8,-0.002239864499431365,-4.0392596449678075e-5,-3.778973496167977e-8,-0.0022397169957782525,-4.061908331716644e-5,-3.804599535317224e-8,-0.002239509163109704,-4.083302738834809e-5,-3.828923970936112e-8,-0.00223924945058436,-4.101186342286681e-5,-3.8494196874711744e-8,-0.002238953599371396,-4.113797301515876e-5,-3.8641048926455915e-8,-0.0022386430618668383,-4.120100796303263e-5,-3.871793082545036e-8,-0.002238342944066297,-4.1200001151770064e-5,-3.872324181388282e-8,-0.0022380791839847307,-4.114530686782865e-5,-3.866788607866194e-8,-0.002237874380510262,-4.1060002066053976e-5,-3.857703907310176e-8,-0.00223774180926945,-4.097948394853225e-5,-3.848995354296783e-8,-0.00223767825635013,-4.094712480839855e-5,-3.845528558322179e-8,-0.002237658399419641,-4.1004061797862145e-5,-3.851967858482813e-8,-0.0022376356888406273,-4.11738325963669e-5,-3.8710382858211906e-8,-0.0022375542283195344,-4.144791944811161e-5,-3.9018797372337954e-8,-0.002237369976256706,-4.178239537910177e-5,-3.939648342269923e-8,-0.0022370705865857117,-4.211192540677199e-5,-3.97707040733493e-8,-0.002236681021205403,-4.237528136520402e-5,-4.0072894403993155e-8,-0.0022362515136581293,-4.2537390808246587e-5,-4.026326754963274e-8,-0.0022358368811051695,-4.2596592517748946e-5,-4.033897314519272e-8,-0.002235479455892738,-4.257760540665977e-5,-4.032647668471118e-8,-0.0022352014732815342,-4.251839568376904e-5,-4.026725325138652e-8,-0.0022350055128588357,-4.245824814262653e-5,-4.0204769494537755e-8,-0.002234879072292001,-4.2429981973685345e-5,-4.017588031994506e-8,-0.002234800143287794,-4.245617891594765e-5,-4.020647152992803e-8,-0.0022347421748675988,-4.254810062132713e-5,-4.030997076660549e-8,-0.002234678089860464,-4.2706022024608e-5,-4.04874490318804e-8,-0.002234583596800719,-4.292040013149177e-5,-4.072877100486095e-8,-0.0022344399196055193,-4.3173776366831664e-5,-4.101470592062815e-8,-0.002234235865992565,-4.344333894544913e-5,-4.13198704377615e-8,-0.002233969089473579,-4.370403283753067e-5,-4.1616299339581775e-8,-0.0022336463289874286,-4.393200590097062e-5,-4.1877337327494744e-8,-0.002233282501130823,-4.410796757286399e-5,-4.2081351239347404e-8,-0.0022328987863395795,-4.422003807868895e-5,-4.2214822045642e-8,-0.0022325199496675764,-4.426587777665794e-5,-4.227465236873269e-8,-0.0022321710530385326,-4.4253972215963034e-5,-4.226962591744968e-8,-0.0022318736432929433,-4.420392191805795e-5,-4.2220888713159193e-8,-0.0022316414113256896,-4.414545555348796e-5,-4.216110347774086e-8,-0.0022314754270215662,-4.4115440270257426e-5,-4.213136166132721e-8,-0.002231359823442391,-4.415175418461966e-5,-4.217445054382591e-8,-0.0022312601532689185,-4.4283382554984865e-5,-4.232367827957026e-8,-0.002231127767120565,-4.4518168017474204e-5,-4.258888372588604e-8,-0.0022309127621388284,-4.483326721123653e-5,-4.2945429863533486e-8,-0.0022305832777618443,-4.5176107345948044e-5,-4.33350641470657e-8,-0.0022301417812274774,-4.548042189951665e-5,-4.3683804639003184e-8,-0.00222962696006888,-4.5691654474732635e-5,-4.3930355472978606e-8,-0.0022290982784922498,-4.578732224176004e-5,-4.404886114752745e-8,-0.0022286126995498105,-4.578096414425489e-5,-4.405337631430236e-8,-0.002228207126679372,-4.571064953482692e-5,-4.39852734699268e-8,-0.002227893056699919,-4.562206961243283e-5,-4.38947320909112e-8,-0.002227660846567752,-4.555526540573994e-5,-4.382620421038141e-8,-0.002227487702103169,-4.55379758899719e-5,-4.381102028222137e-8,-0.0022273451775774154,-4.558426004228901e-5,-4.386564409422788e-8,-0.0022272045720067527,-4.569590592468164e-5,-4.39929402649985e-8,-0.002227040330898362,-4.586469098944103e-5,-4.418444952301841e-8,-0.0022268322499077128,-4.607464729273845e-5,-4.4422813065954085e-8,-0.0022265671012077232,-4.6304319138032545e-5,-4.46843227290974e-8,-0.002226239866699384,-4.65292374402582e-5,-4.4941773047288794e-8,-0.002225854484890745,-4.6724799757426735e-5,-4.51677431041688e-8,-0.0022254237956320375,-4.6869601410910074e-5,-4.5338309138385286e-8,-0.002224968272659459,-4.694890763075256e-5,-4.543684582222292e-8,-0.002224513374267207,-4.695764552052053e-5,-4.545727907051517e-8,-0.0022240857042466885,-4.690227807341315e-5,-4.5406156340506795e-8,-0.0022237084214524207,-4.680103654287797e-5,-4.530300679993751e-8,-0.002223396530534961,-4.668216756519775e-5,-4.517860947561035e-8,-0.002223152787249789,-4.658014304122351e-5,-4.507104168252101e-8,-0.002222964935742375,-4.652995213290346e-5,-4.501951893274435e-8,-0.002222805166025817,-4.655966574712351e-5,-4.505611999008108e-8,-0.0022226330833182246,-4.6682000764129616e-5,-4.519616588800026e-8,-0.002222403496610867,-4.6886909508180545e-5,-4.542958762812166e-8,-0.002222079087811143,-4.7138819175493126e-5,-4.571749442657403e-8,-0.0022216449448798823,-4.738267384694757e-5,-4.59987335824701e-8,-0.002221118171827722,-4.7560111136303446e-5,-4.620795613858712e-8,-0.002220545312392466,-4.763048075773373e-5,-4.629917145710085e-8,-0.002219986393474025,-4.758588464850228e-5,-4.626262271116031e-8,-0.002219493466999461,-4.745169161788492e-5,-4.612549476134362e-8,-0.0022190950899372997,-4.727349057060608e-5,-4.5937616176018814e-8,-0.0022187928437108866,-4.709946526084481e-5,-4.575211981967887e-8,-0.0022185676608473866,-4.6967148258508964e-5,-4.561086581454774e-8,-0.0022183897340214403,-4.6897877865561347e-5,-4.5538205382200175e-8,-0.002218227112864587,-4.689730372738356e-5,-4.55412865670691e-8,-0.0022180511931498754,-4.6958726789225835e-5,-4.5613476972552826e-8,-0.002217839478448058,-4.706684563405332e-5,-4.573834204511953e-8,-0.002217576767892167,-4.720088385532349e-5,-4.5893088802846886e-8,-0.0022172557391592737,-4.7337099909682e-5,-4.605143273264397e-8,-0.0022168773700565656,-4.74510906017821e-5,-4.6186255635813826e-8,-0.0022164511799183666,-4.752034046529439e-5,-4.627248139736567e-8,-0.002215994899699834,-4.7527295848164124e-5,-4.629045712510837e-8,-0.002215532947978386,-4.746279506796771e-5,-4.622968509992351e-8,-0.0022150932151455763,-4.732912349998839e-5,-4.60921625117704e-8,-0.0022147021652644183,-4.714160221841957e-5,-4.589418230010463e-8,-0.002214378969883185,-4.692762570971198e-5,-4.566542228593394e-8,-0.0022141300645164186,-4.672255695780222e-5,-4.544463178449744e-8,-0.0022139458137362612,-4.6562850713633075e-5,-4.52722393117001e-8,-0.00221380060967952,-4.64777591528412e-5,-4.518126383051442e-8,-0.0022136569173281237,-4.648149783906708e-5,-4.518852648490155e-8,-0.0022134729343128413,-4.65678409922886e-5,-4.5288350736913463e-8,-0.002213212730213477,-4.670898079689068e-5,-4.545089717714251e-8,-0.002212856797894262,-4.686004182357243e-5,-4.562684735817594e-8,-0.0022124099074522273,-4.6969555866714336e-5,-4.575890861717408e-8,-0.0022119026018825377,-4.699407898397332e-5,-4.579813949784263e-8,-0.0022113839010346006,-4.691226389953383e-5,-4.5719800103478644e-8,-0.0022109065487812933,-4.673212611187127e-5,-4.553166994833471e-8,-0.0022105106421530336,-4.6487513953655795e-5,-4.52703652159344e-8,-0.002210212924897253,-4.622545023671105e-5,-4.498750033432147e-8,-0.0022100056515220326,-4.599082657138239e-5,-4.4732842639896e-8,-0.0022098634270506174,-4.58151562763414e-5,-4.454182124988341e-8,-0.002209753114187779,-4.5712337116466916e-5,-4.4430643000829475e-8,-0.0022096423610802776,-4.568024895658921e-5,-4.439779129857697e-8,-0.0022095048224221024,-4.570516696428774e-5,-4.4428692789315846e-8,-0.0022093223580628898,-4.576643434562114e-5,-4.45008081941231e-8,-0.0022090854104389146,-4.5840198863217866e-5,-4.458782308690369e-8,-0.002208792684048753,-4.590211841998753e-5,-4.4662757683266604e-8,-0.002208450773065764,-4.592949249699432e-5,-4.470041059236587e-8,-0.0022080738356743857,-4.590342965342051e-5,-4.467976024450722e-8,-0.0022076829208446235,-4.581149511652582e-5,-4.45868263584567e-8,-0.0022073042325302127,-4.565081152181556e-5,-4.441802397944935e-8,-0.002206965605216999,-4.5430915166275075e-5,-4.418331181075295e-8,-0.0022066909305378285,-4.51749843519472e-5,-4.390764665471133e-8,-0.0022064933389565914,-4.49177448738443e-5,-4.3628860219709356e-8,-0.0022063692939843756,-4.469903269899099e-5,-4.339076928750656e-8,-0.002206296459441618,-4.455384182826084e-5,-4.323234070924075e-8,-0.002206237344690818,-4.450182876565845e-5,-4.317610450389361e-8,-0.002206148437110928,-4.454022855258338e-5,-4.322014158498983e-8,-0.0022059920678573607,-4.464314996140854e-5,-4.333696738013364e-8,-0.002205747078655037,-4.47677698551155e-5,-4.3480006469238615e-8,-0.0022054149560458707,-4.4865453971987394e-5,-4.359562672668298e-8,-0.0022050197778874484,-4.4894469310904836e-5,-4.363714563703815e-8,-0.002204602080350687,-4.483081733338681e-5,-4.357698088947024e-8,-0.0022042082496701748,-4.4674256976108435e-5,-4.34136267011671e-8,-0.002203878355963061,-4.444767502332483e-5,-4.317130450908105e-8,-0.002203636131830214,-4.418988337579432e-5,-4.289227455216706e-8,-0.0022034842767954172,-4.3944313012475434e-5,-4.2624468807672645e-8,-0.0022034062225738905,-4.374765150444576e-5,-4.240888990786396e-8,-0.0022033728732570334,-4.362214656382595e-5,-4.22709113039624e-8,-0.0022033511472193176,-4.357325021474196e-5,-4.2217405326860426e-8,-0.002203311259278957,-4.359184072021775e-5,-4.2238963148967383e-8,-0.002203231161403219,-4.365884984553331e-5,-4.2314893940482235e-8,-0.0022030981896355236,-4.37501815219e-5,-4.241868804084055e-8,-0.0022029088590102435,-4.3840715442687394e-5,-4.252255845087228e-8,-0.002202667855443351,-4.390713159132299e-5,-4.2600676139939876e-8,-0.0022023869397814195,-4.392991328620103e-5,-4.263141972686281e-8,-0.002202083971331653,-4.389514078579005e-5,-4.259929970541784e-8,-0.0022017817509400405,-4.3796571313615305e-5,-4.2497155377534966e-8,-0.002201506019114991,-4.363807773550661e-5,-4.232878802184368e-8,-0.002201281829056389,-4.3435865519477696e-5,-4.211145676298463e-8,-0.0022011278651603286,-4.321905966755535e-5,-4.187668985882363e-8,-0.002201049428771376,-4.3026635343832115e-5,-4.166711799444936e-8,-0.0022010326564595945,-4.2899212226683795e-5,-4.1527605488542144e-8,-0.0022010438605880736,-4.2866701401245325e-5,-4.149168981230639e-8,-0.002201036815050561,-4.2936311524374124e-5,-4.156826007306663e-8,-0.0022009668005209242,-4.3087189621691026e-5,-4.1735408849570453e-8,-0.002200805687849186,-4.3275540935940235e-5,-4.194576010041846e-8,-0.0022005511147673534,-4.344845205145683e-5,-4.214141087930924e-8,-0.0022002261579351164,-4.356010243054483e-5,-4.2271627325288035e-8,-0.0021998709471877614,-4.3583870411128616e-5,-4.230621553318354e-8,-0.0021995306329296136,-4.351713167905666e-5,-4.2241049980976345e-8,-0.002199244012936336,-4.337907539302264e-5,-4.209604395428574e-8,-0.0021990354974688524,-4.3203716761038325e-5,-4.190782352683438e-8,-0.0021989114882803953,-4.303068697336216e-5,-4.1719808660383815e-8,-0.0021988611198272934,-4.2896143039547516e-5,-4.157220587465444e-8,-0.002198860529686386,-4.28256834219112e-5,-4.149400848221767e-8,-0.0021988792290551736,-4.283052362484336e-5,-4.149848437908441e-8,-0.0021988868020958604,-4.290728558961128e-5,-4.158266825085552e-8,-0.002198858332636107,-4.30407374421635e-5,-4.1730227888167276e-8,-0.0021987776559889718,-4.320815607531913e-5,-4.191627227789234e-8,-0.0021986383828306827,-4.338394252488224e-5,-4.211255171468341e-8,-0.0021984432617016725,-4.354352417484422e-5,-4.229189520363366e-8,-0.0021982026851288055,-4.366616419637895e-5,-4.243138177200893e-8,-0.002197932987833362,-4.373685585806035e-5,-4.2514400830429825e-8,-0.0021976547873646343,-4.374776948947891e-5,-4.2532145447490745e-8,-0.0021973912163822202,-4.3699666494011446e-5,-4.248507449934088e-8,-0.002197165565964018,-4.360339553726757e-5,-4.238455982416569e-8,-0.0021969976661542537,-4.348102472191013e-5,-4.2254266098886135e-8,-0.0021968986060033643,-4.3365344851824027e-5,-4.212983081364773e-8,-0.002196864488916266,-4.329582521635688e-5,-4.205462845468875e-8,-0.00219687177106506,-4.330950164594914e-5,-4.206983298743024e-8,-0.0021968783763478264,-4.342774012978813e-5,-4.219976819299261e-8,-0.002196833942465688,-4.364410781791684e-5,-4.2438344229764724e-8,-0.0021966974953614438,-4.392134829558463e-5,-4.274547229078794e-8,-0.0021964542822063117,-4.420215324008212e-5,-4.305868573313644e-8,-0.002196122004749595,-4.4429633911088055e-5,-4.3315482134634745e-8,-0.002195743141195934,-4.456667055575025e-5,-4.3474511881865136e-8,-0.0021953688213683063,-4.460502832877005e-5,-4.352567029416044e-8,-0.0021950430896256865,-4.456276883725236e-5,-4.34875261233581e-8,-0.00219479325103675,-4.447456387533459e-5,-4.339707996174946e-8,-0.0021946271302473947,-4.4380500039176534e-5,-4.329781770575668e-8,-0.0021945353071144784,-4.43168589575551e-5,-4.322972528487527e-8,-0.0021944959560133495,-4.4310062852754164e-5,-4.322252177775724e-8,-0.002194480563537203,-4.4373660852183527e-5,-4.32920524953864e-8,-0.0021944595227321863,-4.450786864707432e-5,-4.343945466521452e-8,-0.0021944069506842096,-4.4701191951449525e-5,-4.36527150890374e-8,-0.0021943042180325003,-4.49335617950116e-5,-4.391005375463803e-8,-0.002194141906377647,-4.518027077748843e-5,-4.4184332052663467e-8,-0.0021939201779301136,-4.5416019876788224e-5,-4.444764386522221e-8,-0.002193647790767406,-4.561847347713716e-5,-4.4675332295713537e-8,-0.0021933402416158846,-4.5770915859345256e-5,-4.484892453692752e-8,-0.00219301755709073,-4.586399243241319e-5,-4.495797173896476e-8,-0.0021927019881854267,-4.589680376520009e-5,-4.50011490514789e-8,-0.002192415581968075,-4.587758677189852e-5,-4.498696354861374e-8,-0.002192177416627541,-4.582404354917942e-5,-4.493420418458068e-8,-0.0021920001056428633,-4.576302032079154e-5,-4.487180284605771e-8,-0.0021918853630141493,-4.5728554041258204e-5,-4.483694086387648e-8,-0.0021918193971149852,-4.575678790110061e-5,-4.486962210563871e-8,-0.0021917704552939657,-4.5876737000029106e-5,-4.500249145208053e-8,-0.0021916921793231213,-4.609805171784536e-5,-4.524715951212536e-8,-0.002191535722030832,-4.640085504307758e-5,-4.558273256144663e-8,-0.002191268622527711,-4.673572239421093e-5,-4.5955562378608346e-8,-0.0021908911531643392,-4.703860588774864e-5,-4.6295536372601254e-8,-0.0021904389342049485,-4.725525462149562e-5,-4.654284579454351e-8,-0.0021899688757674282,-4.7361335435271427e-5,-4.667003748796585e-8,-0.002189537217572945,-4.736738240175443e-5,-4.66875152635767e-8,-0.002189182178099598,-4.730905371796731e-5,-4.6633131046491385e-8,-0.0021889175315774733,-4.723144495265606e-5,-4.655539679656418e-8,-0.0021887354256682617,-4.717574835041439e-5,-4.6499184056199204e-8,-0.0021886135162408732,-4.717157179860376e-5,-4.649736314449432e-8,-0.0021885224957076004,-4.723435333698451e-5,-4.656775348526145e-8,-0.002188432196672109,-4.736596568910569e-5,-4.671343301511786e-8,-0.0021883159915355365,-4.755688007918747e-5,-4.69247944722332e-8,-0.002188153797184117,-4.7789060056815985e-5,-4.7182558125506696e-8,-0.0021879339216937933,-4.8039252490120275e-5,-4.7461392605544466e-8,-0.0021876538472704776,-4.828243590852618e-5,-4.773381750934838e-8,-0.002187319992989988,-4.849521912185547e-5,-4.7974061450627616e-8,-0.0021869464613131022,-4.865894024085986e-5,-4.816152081756237e-8,-0.0021865528992877276,-4.87620998684626e-5,-4.828339410490294e-8,-0.0021861618199906937,-4.8801891534619e-5,-4.833627312095251e-8,-0.0021857956854069802,-4.878486309271509e-5,-4.832680892763946e-8,-0.0021854738600616984,-4.8726762987137e-5,-4.8271587194920043e-8,-0.0021852094900030724,-4.86515128943926e-5,-4.8196176656966384e-8,-0.002185006334014698,-4.858914285791343e-5,-4.8133122371377696e-8,-0.0021848556724831675,-4.8572182159752406e-5,-4.8118210423692764e-8,-0.0021847340908449993,-4.862969584851901e-5,-4.818398533821574e-8,-0.0021846040333787834,-4.8778729210677626e-5,-4.835019658202303e-8,-0.0021844197065521583,-4.901477659668526e-5,-4.861300583671992e-8,-0.002184139908137586,-4.9305740268685153e-5,-4.89380239589084e-8,-0.002183745208710712,-4.959578164277363e-5,-4.926436436193073e-8,-0.0021832508778272947,-4.9822400093252296e-5,-4.9523381452495355e-8,-0.0021827054179990426,-4.9940812964766306e-5,-4.9665452368679164e-8,-0.002182172657790118,-4.9941786271621964e-5,-4.967953305482646e-8,-0.0021817074157041024,-4.985220421423567e-5,-4.959386599256073e-8,-0.002181338673865619,-4.9720142395811015e-5,-4.945991919619401e-8,-0.0021810666706533364,-4.9595568980319e-5,-4.933166537295909e-8,-0.0021808703783844,-4.951657478515571e-5,-4.92507832762818e-8,-0.0021807181941960203,-4.950399504420421e-5,-4.924073730655143e-8,-0.0021805769182982548,-4.956218364039945e-5,-4.9307324380953e-8,-0.0021804174795038798,-4.968259370492711e-5,-4.9442212976376634e-8,-0.0021802179110294567,-4.9847836933814006e-5,-4.9627109424267564e-8,-0.002179964670767143,-5.003531159657192e-5,-4.983764252872737e-8,-0.0021796530724134083,-5.0220385609024966e-5,-5.004692161411961e-8,-0.002179287108625143,-5.0379309817940806e-5,-5.0228863268068284e-8,-0.0021788786984716967,-5.049197671212808e-5,-5.0361312329529946e-8,-0.0021784462256297563,-5.054452595703909e-5,-5.04289060225776e-8,-0.0021780122025803136,-5.053151803276535e-5,-5.042538797210063e-8,-0.002177600157916581,-5.045722929573454e-5,-5.035495070136917e-8,-0.0021772310966522526,-5.0335776567875636e-5,-5.023237210708531e-8,-0.002176919902460922,-5.0189932859938544e-5,-5.0081843179902245e-8,-0.00217667207082299,-5.004853269807545e-5,-4.993436120974221e-8,-0.0021764812441906808,-4.994249777622941e-5,-4.982363597059191e-8,-0.0021763280507105863,-4.98996114264398e-5,-4.978052270196503e-8,-0.0021761809437515654,-4.9938185981473035e-5,-4.982603516805561e-8,-0.002176000149806595,-5.006025793450334e-5,-4.9963621703133264e-8,-0.002175745817326205,-5.024622884164902e-5,-5.0172910484799115e-8,-0.002175390157594791,-5.0454365055776456e-5,-5.0408841281164365e-8,-0.002174930337153652,-5.06288459355e-5,-5.061036106903455e-8,-0.002174395353711165,-5.071699644838109e-5,-5.0719362989473973e-8,-0.0021738401034926535,-5.0689679713245726e-5,-5.0703131233504954e-8,-0.0021733265233010663,-5.055363671187018e-5,-5.056794205359903e-8,-0.0021729011128648096,-5.034775070284775e-5,-5.035513085813307e-8,-0.0021725811078602674,-5.012585939427826e-5,-5.012259516349527e-8,-0.0021723547388293137,-4.993700515060601e-5,-4.992354472562844e-8,-0.0021721915116131806,-4.9812811310871116e-5,-4.979285902848771e-8,-0.0021720546749986677,-4.976445626435847e-5,-4.9743630077680485e-8,-0.002171910550591354,-4.978612573658363e-5,-4.977057674929707e-8,-0.0021717334408312126,-4.986073223887547e-5,-4.985593590639394e-8,-0.0021715072056702122,-4.9965197761627746e-5,-4.997503848354697e-8,-0.002171225123681876,-5.007442062639999e-5,-5.010064735726323e-8,-0.0021708891541935235,-5.0164162613396194e-5,-5.020624123144993e-8,-0.002170509011565236,-5.021337352113505e-5,-5.026869269970753e-8,-0.0021701010201165194,-5.020633834079381e-5,-5.027067408474085e-8,-0.002169686481978018,-5.013479660142251e-5,-5.02029350445516e-8,-0.0021692892001323122,-4.999980622314807e-5,-5.006625128102955e-8,-0.002168932022375522,-4.9812758371010945e-5,-4.9872480658075486e-8,-0.002168632724515974,-4.95948957641629e-5,-4.96440934171442e-8,-0.0021683999304833723,-4.9374905475583854e-5,-4.94117279890712e-8,-0.0021682299884622017,-4.9184517024424835e-5,-4.9209644023520306e-8,-0.0021681057683319905,-4.905256550499114e-5,-4.906946354132325e-8,-0.0021679981084059274,-4.899850303697785e-5,-4.901315398366616e-8,-0.0021678702118165865,-4.902660625417457e-5,-4.904654790153962e-8,-0.002167684855459021,-4.912228342329066e-5,-4.915496722137846e-8,-0.002167413675346147,-4.9252117611135175e-5,-4.930287422769272e-8,-0.0021670467328493287,-4.9369236645834006e-5,-4.9439453319941026e-8,-0.0021665991445428225,-4.942457392269512e-5,-4.951084310411176e-8,-0.0021661107109958544,-4.9382031214902844e-5,-4.9476821013151695e-8,-0.0021656359860024264,-4.923205966050717e-5,-4.932584479686643e-8,-0.0021652269664645565,-4.8996524294130615e-5,-4.908058662160895e-8,-0.0021649159058167063,-4.872105249104496e-5,-4.878982557957179e-8,-0.002164706655984438,-4.8458301673946887e-5,-4.8510450968611894e-8,-0.0021645777385677746,-4.825084661063017e-5,-4.8288973195301046e-8,-0.0021644934054848965,-4.812122783466715e-5,-4.81506379139743e-8,-0.0021644159176900527,-4.8071024900689184e-5,-4.809815557247862e-8,-0.0021643141929952214,-4.808594061576428e-5,-4.81168922637752e-8,-0.002164167674411756,-4.814266053659258e-5,-4.818208341414474e-8,-0.0021639667146355628,-4.8214709519840826e-5,-4.8265144796799985e-8,-0.0021637113015193915,-4.8276471408607926e-5,-4.833815104674628e-8,-0.0021634093935051597,-4.8305717497990586e-5,-4.8376751136334334e-8,-0.0021630753860666465,-4.8285336142651836e-5,-4.836216222000512e-8,-0.0021627286667312874,-4.8204863846761885e-5,-4.828283802361071e-8,-0.002162391861482956,-4.8062097732630306e-5,-4.813613888210156e-8,-0.0021620882679398825,-4.786457221389886e-5,-4.792984469758117e-8,-0.0021618381966684985,-4.763020148052184e-5,-4.768283959318655e-8,-0.0021616544721947527,-4.738615688544101e-5,-4.74240049864915e-8,-0.0021615380479013072,-4.716519867376527e-5,-4.718845234479752e-8,-0.002161475302072799,-4.699937039553237e-5,-4.701091284755469e-8,-0.0021614386393250546,-4.6912154688658707e-5,-4.691736184216948e-8,-0.002161391201800069,-4.6911292679655636e-5,-4.691717630397373e-8,-0.002161295075484384,-4.698475296081406e-5,-4.6998506562417824e-8,-0.002161121034202,-4.710162372082691e-5,-4.712886694957854e-8,-0.002160857131367918,-4.7218339997966116e-5,-4.726153824963162e-8,-0.0021605135166616594,-4.728911357216719e-5,-4.734669635449493e-8,-0.002160121614640899,-4.727811102218645e-5,-4.7344670899897986e-8,-0.002159727070259186,-4.71700332472349e-5,-4.72376676723403e-8,-0.002159377681774251,-4.697546153405605e-5,-4.703590761080976e-8,-0.0021591097858532486,-4.672829423936533e-5,-4.677517141941328e-8,-0.002158938074167603,-4.6475408602648845e-5,-4.650582202815821e-8,-0.002158852916009944,-4.626235480050213e-5,-4.627738514230599e-8,-0.002158825801635166,-4.612087538018337e-5,-4.612493766194266e-8,-0.002158819709787541,-4.606270599802699e-5,-4.606214934513943e-8,-0.002158799607308813,-4.608051665422589e-5,-4.6081993496327766e-8,-0.0021587395273344563,-4.615361327504223e-5,-4.616267371658823e-8,-0.002158625286072611,-4.625494118904886e-5,-4.627511694149892e-8,-0.002158453953359905,-4.635691120285143e-5,-4.638936013416345e-8,-0.002158231790057722,-4.643523375110354e-5,-4.647887273854775e-8,-0.002157971911670394,-4.647108233605865e-5,-4.652305041561149e-8,-0.0021576922476335206,-4.6452294121769896e-5,-4.650856384345036e-8,-0.0021574138014324212,-4.637428430326153e-5,-4.6430286990051256e-8,-0.0021571587957101316,-4.624105015071745e-5,-4.629227406134107e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json
new file mode 100644
index 0000000..b4be241
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":1000,"numberOfSamples":1000,"samples":[-0.002156948117797158,-4.6066106188504274e-5,-4.610870837852341e-8,-0.0021567976844821175,-4.587262928957953e-5,-4.590411215695837e-8,-0.002156713908245568,-4.569170874283684e-5,-4.5711626484184725e-8,-0.0021566893595621928,-4.555761003533914e-5,-4.5568113732113295e-8,-0.002156700743371349,-4.549983445555494e-5,-4.5505741530892555e-8,-0.0021567115663395065,-4.5533671389188886e-5,-4.5541790676334716e-8,-0.0021566804178876843,-4.5652915406612466e-5,-4.5670622833809834e-8,-0.002156572912636481,-4.582870678241587e-5,-4.58621255953264e-8,-0.0021563728566239655,-4.601620142754535e-5,-4.6068577295811786e-8,-0.0021560880133587525,-4.616711622705171e-5,-4.623794070121091e-8,-0.002155748222189647,-4.62434863816923e-5,-4.6328641438483505e-8,-0.002155396920669294,-4.622782396424562e-5,-4.632067580425877e-8,-0.00215507933393081,-4.612686483113469e-5,-4.621997607570151e-8,-0.0021548310204559523,-4.596856314722607e-5,-4.605556460572259e-8,-0.0021546697448800787,-4.579380803487395e-5,-4.5870948767990285e-8,-0.0021545925009090403,-4.564545026639773e-5,-4.571243253541094e-8,-0.00215457808447119,-4.555777214888923e-5,-4.561767662258407e-8,-0.002154594019620961,-4.554927142265337e-5,-4.560764640929833e-8,-0.002154605368940617,-4.562040509803385e-5,-4.568383677005805e-8,-0.002154582628502511,-4.575613804937631e-5,-4.583074108471704e-8,-0.0021545067042819666,-4.593156748733217e-5,-4.602179515117175e-8,-0.0021543704349080905,-4.6118291920214145e-5,-4.6226298143065905e-8,-0.002154177429419203,-4.628970757896518e-5,-4.64152905393417e-8,-0.0021539395320203554,-4.642448039496704e-5,-4.656547403677698e-8,-0.0021536740325304696,-4.6508347419083976e-5,-4.6661248300741016e-8,-0.002153401212638439,-4.6534852085000904e-5,-4.669548060691322e-8,-0.0021531422886805827,-4.650565883599465e-5,-4.666974436961425e-8,-0.0021529174221249937,-4.6430830311047396e-5,-4.6594529114611347e-8,-0.002152743281384537,-4.632899782380846e-5,-4.648943285318694e-8,-0.0021526297364554913,-4.622682327908873e-5,-4.6382720029024235e-8,-0.0021525757781952213,-4.615665217809799e-5,-4.6309007987320986e-8,-0.0021525657635618595,-4.615111791560906e-5,-4.630363581540198e-8,-0.0021525683606683156,-4.623433111379003e-5,-4.639321479077921e-8,-0.0021525411131787307,-4.641162808298889e-5,-4.658444896551646e-8,-0.00215244181360915,-4.6662730585749126e-5,-4.685650807739798e-8,-0.002152243559761613,-4.69438336830974e-5,-4.716299443903288e-8,-0.0021519463173773905,-4.720028130623982e-5,-4.744536946490242e-8,-0.0021515783140552483,-4.738487646555355e-5,-4.7652539659263205e-8,-0.0021511863195340735,-4.7473012892754915e-5,-4.775714558013054e-8,-0.002150820158632104,-4.74681988823182e-5,-4.7761682951372046e-8,-0.0021505186509381763,-4.739759003524929e-5,-4.769404722497823e-8,-0.002150301454146949,-4.7301602034095665e-5,-4.75967746928141e-8,-0.002150167504080223,-4.722237577724007e-5,-4.751493736774092e-8,-0.0021500984653760494,-4.7194327180898005e-5,-4.7486029043007825e-8,-0.002150065007643072,-4.7238211715320985e-5,-4.753336591146179e-8,-0.002150034011848315,-4.735890504159874e-5,-4.7663329284699034e-8,-0.0021499752813515308,-4.754650144645341e-5,-4.7866189097583804e-8,-0.0021498666614940885,-4.777999559892799e-5,-4.811985529955003e-8,-0.002149696844734374,-4.8032435641353954e-5,-4.8395408706038154e-8,-0.0021494657462589853,-4.8276239272205825e-5,-4.866295866283441e-8,-0.0021491829316347584,-4.848761715432387e-5,-4.8896590036391526e-8,-0.002148864888882999,-4.864954755615883e-5,-4.9077698538029214e-8,-0.002148531969661492,-4.875324012053347e-5,-4.9196590948451486e-8,-0.00214820559302335,-4.879845385417849e-5,-4.925275811633043e-8,-0.0021479058723801398,-4.8793211725869386e-5,-4.9254476683867235e-8,-0.0021476494691693242,-4.875326148772683e-5,-4.921820529983365e-8,-0.0021474473356039884,-4.8701280224926454e-5,-4.916782927985692e-8,-0.002147302025734625,-4.8665427348109735e-5,-4.913330991550414e-8,-0.0021472046146883317,-4.867636961659977e-5,-4.914769826441347e-8,-0.0021471322071707254,-4.8761685544412094e-5,-4.924121019381598e-8,-0.0021470482597085038,-4.893732048233069e-5,-4.943192954490526e-8,-0.002146908584499707,-4.91979967179343e-5,-4.97152190263401E-08,-0.002146674363316176,-4.9511646656850674e-5,-5.0057427768996096e-8,-0.002146328667920062,-4.982422622000098e-5,-5.0400872447169334e-8,-0.0021458875359486144,-5.007688042712524e-5,-5.0682229364308553e-8,-0.002145397011314185,-5.0228379818507437e-5,-5.0856638807463407e-8,-0.0021449161791735768,-5.0270217445764416e-5,-5.091394422090286e-8,-0.002144495917953705,-5.0226434247242504e-5,-5.087865414824122e-8,-0.002144164522903363,-5.01408709895491e-5,-5.079660476566392e-8,-0.002143924532470479,-5.0060878640441164e-5,-5.0717902245852795e-8,-0.002143757959315198,-5.002483607513269e-5,-5.068379162791456e-8,-0.002143634896737234,-5.005585115815337e-5,-5.071984838493151e-8,-0.002143521842854634,-5.0160650756850324e-5,-5.083446444779818e-8,-0.002143388120717485,-5.0331651201626866e-5,-5.102064773664288e-8,-0.002143210184954386,-5.055054311417113e-5,-5.125954074459971e-8,-0.002142974117514982,-5.079251129394976e-5,-5.152482507010141e-8,-0.0021426765074378826,-5.103064468172294e-5,-5.178753018681961e-8,-0.0021423238391256607,-5.124006797853224e-5,-5.202065134245872e-8,-0.002141930651324379,-5.140134181465216e-5,-5.220297342970296e-8,-0.0021415168281439588,-5.150282446702924e-5,-5.2321688446799315e-8,-0.0021411044645297406,-5.154180999406271e-5,-5.237359158139016e-8,-0.0021407148054202576,-5.152449499997826e-5,-5.236496558245039e-8,-0.0021403655678020684,-5.146510002939213e-5,-5.231059043138093e-8,-0.002140068652238457,-5.138444270295482e-5,-5.2232268635753575e-8,-0.002139828133292629,-5.1308028225241545e-5,-5.2156950212399334e-8,-0.002139638422673149,-5.126350568803761e-5,-5.2114230564000163e-8,-0.00213948268691379,-5.1277018333799685e-5,-5.213259191254482e-8,-0.002139332290822501,-5.1367795817320406e-5,-5.223357239670482e-8,-0.0021391489883805194,-5.154098912009453e-5,-5.242383088390882e-8,-0.002138891970010422,-5.1780522562900146e-5,-5.268710604455327e-8,-0.0021385305995390066,-5.20462253084977e-5,-5.2980835455315765e-8,-0.002138059594008942,-5.2280784568316565e-5,-5.324353111816718e-8,-0.002137508049281609,-5.242840674319948e-5,-5.341489927661907e-8,-0.0021369333564798328,-5.245794992558174e-5,-5.3460757754233854e-8,-0.0021364000567887635,-5.237659280739311e-5,-5.338772944526506e-8,-0.0021359554177806913,-5.222499524366457e-5,-5.323816602452792e-8,-0.0021356157132549174,-5.205829004263862e-5,-5.307010206523827e-8,-0.002135367798385966,-5.1925718630202697e-5,-5.293584770307225e-8,-0.0021351802309842655,-5.185853393324863e-5,-5.2869237987871783e-8,-0.002135015709675917,-5.186747116928778e-5,-5.288277568269625e-8,-0.0021348401734937695,-5.194616985504687e-5,-5.2970891829753475e-8,-0.002134627758060293,-5.2076667370690687e-5,-5.311539888620349e-8,-0.002134362664862016,-5.22346501846903e-5,-5.329085053332862e-8,-0.0021340393185033547,-5.2393733389077045e-5,-5.3469096840437146e-8,-0.002133661644592146,-5.252894430972528e-5,-5.362316413179043e-8,-0.0021332416919183183,-5.2619642849676823e-5,-5.373058405670703e-8,-0.002132797639105352,-5.265187989316952e-5,-5.377605953151373e-8,-0.00213235123299873,-5.262008658853691e-5,-5.3753301407695094e-8,-0.0021319247547086106,-5.252787431710746e-5,-5.366582385721862e-8,-0.002131537812166341,-5.2387711692295135e-5,-5.3526527141880856e-8,-0.002131204386649835,-5.221948578729788e-5,-5.335616249926751e-8,-0.002130930436840616,-5.204813499564776e-5,-5.3180922715721016e-8,-0.0021307122475242276,-5.190051666082856e-5,-5.3029303636494595e-8,-0.002130535691096194,-5.1801663288743484e-5,-5.2928303953712826e-8,-0.002130376577415983,-5.1770519389418736e-5,-5.289893815879023e-8,-0.0021302025383327134,-5.1815158911048855e-5,-5.2950976313991277e-8,-0.002129977378036466,-5.192792796725971e-5,-5.3077407334747964E-08,-0.0021296688087945386,-5.208214555192072e-5,-5.325050928388623e-8,-0.0021292592998348823,-5.2233329336141494e-5,-5.342289782969275e-8,-0.002128757014872047,-5.2328224363975537e-5,-5.353718707965699e-8,-0.0021282003685288873,-5.232211388239153e-5,-5.354471701182651e-8,-0.0021276495587692528,-5.219820202071707e-5,-5.342650421322242e-8,-0.002127165444777017,-5.1977374748586926e-5,-5.32037987462269e-8,-0.002126786408919701,-5.1710339300552144e-5,-5.292980367635397e-8,-0.0021265166937946525,-5.145633618560855e-5,-5.2667177244896215e-8,-0.00212633105580082,-5.126167160748416e-5,-5.246538067689548e-8,-0.002126189328271234,-5.114869660600918e-5,-5.234897812409529e-8,-0.0021260510373621883,-5.111638783278097e-5,-5.231801132895357e-8,-0.002125884513579751,-5.114733030685652e-5,-5.235503053809026e-8,-0.0021256702248682435,-5.121572331910457e-5,-5.243327665430199e-8,-0.002125400455812279,-5.1293642979333694e-5,-5.252321996716058e-8,-0.0021250775059338096,-5.1355096043385815e-5,-5.259696904862907e-8,-0.0021247116610059085,-5.1378537621995244e-5,-5.2631164024147827e-8,-0.0021243192352671083,-5.134861185069034e-5,-5.2609026267915535e-8,-0.002123920533294502,-5.125749504161394e-5,-5.252187717870801e-8,-0.002123537513917045,-5.1105899487825944e-5,-5.237017732952232e-8,-0.0021231909824004935,-5.0903510148269925e-5,-5.21639052525058e-8,-0.002122897386272381,-5.066840160744641e-5,-5.192188374186477e-8,-0.0021226656718111524,-5.042508933637542e-5,-5.166975788992617e-8,-0.002122494839571998,-5.0201204525872756e-5,-5.143662126873064e-8,-0.0021223728064571974,-5.002307532138799e-5,-5.125052539179263e-8,-0.002122277063662247,-4.9910792187481684e-5,-5.1133373559448276e-8,-0.002122177350465051,-4.9873571668336e-5,-5.1095958839310544e-8,-0.002122040271899325,-4.990621895883855e-5,-5.113395766297128e-8,-0.002121835670220407,-4.998749569171908e-5,-5.122580454826739e-8,-0.002121544289358671,-5.008151805352115e-5,-5.133380683137773e-8,-0.0021211653940700756,-5.0143498952941705e-5,-5.141007127166793e-8,-0.0021207216447338448,-5.0130441492102875e-5,-5.1407976149345016e-8,-0.002120257496141451,-5.001520456175847e-5,-5.1297441102601807e-8,-0.002119828397979043,-4.9798850489622e-5,-5.107840402680578e-8,-0.0021194826754195456,-4.9513892869127156e-5,-5.078451782729881e-8,-0.002119244086201465,-4.921409445932999e-5,-5.0472444375840066e-8,-0.0021191046402436534,-4.8954748273117716e-5,-5.0200988226733736e-8,-0.002119031138708923,-4.8773978554723135e-5,-5.001124485406591e-8,-0.002118980101862301,-4.8684026206295004e-5,-4.991720030835334e-8,-0.00211891220827597,-4.867379334879302e-5,-4.990812813538284e-8,-0.0021188006530865576,-4.8717674424215837e-5,-4.9957631878584515e-8,-0.0021186330805224884,-4.878489183979079e-5,-5.003335885442783e-8,-0.002118409606923484,-4.8846210672363946e-5,-5.010414572430475e-8,-0.0021181395569648243,-4.887764161794287e-5,-5.0144131459874775e-8,-0.002117838428140765,-4.8862089859800686e-5,-5.013472762586503e-8,-0.0021175254797301053,-4.87900395563563e-5,-5.006548391793509e-8,-0.0021172217039225403,-4.865995177280172e-5,-4.9934517707598465e-8,-0.0021169477453683006,-4.8478584561881674e-5,-4.9748766630150475e-8,-0.002116721392799632,-4.8261007717598124e-5,-4.952391111144196e-8,-0.00211655455107997,-4.802973321358578e-5,-4.928344153787555e-8,-0.002116450096966629,-4.781233066898358e-5,-4.9056238260434893e-8,-0.0021163995074253497,-4.763723300556185e-5,-4.88723175000772e-8,-0.00211638238176434,-4.752806896211847e-5,-4.8757005535652654e-8,-0.0021163687749273766,-4.749765415455074e-5,-4.872463016284184e-8,-0.0021163245129189124,-4.75433801208055e-5,-4.8773504423959966e-8,-0.0021162186131261293,-4.7645689733550204e-5,-4.888400543678275e-8,-0.0021160311239636605,-4.7770598620135224e-5,-4.902087037517744e-8,-0.0021157594156345004,-4.787624496808221e-5,-4.913984622203423e-8,-0.0021154210653734945,-4.792249771712643e-5,-4.919779498322852e-8,-0.0021150518661444766,-4.788171611098116e-5,-4.916427157162084e-8,-0.0021146983037815758,-4.774784549571525e-5,-4.903151581702451e-8,-0.0021144054214774677,-4.754043449876239e-5,-4.881909664190108e-8,-0.002114203335655032,-4.730071511555959e-5,-4.857004998709531e-8,-0.0021140976257717674,-4.7079605315396366e-5,-4.8338297363515245e-8,-0.002114068243449401,-4.6921741162987395e-5,-4.817168920274723e-8,-0.0021140776517754515,-4.685238849929127e-5,-4.8097948508555413e-8,-0.002114084019446718,-4.6872596236596724e-5,-4.81192411375788e-8,-0.002114053227237637,-4.6963141965845496e-5,-4.821604606694751e-8,-0.002113965448400426,-4.7093502898033734e-5,-4.8356449951288814e-8,-0.0021138158726727416,-4.7231060835115885e-5,-4.8505867927921634e-8,-0.0021136117434029157,-4.73475915439524e-5,-4.863405741638106e-8,-0.002113368243224607,-4.742253450655109e-5,-4.8718797175518944e-8,-0.0021131048107557887,-4.7443958322278066e-5,-4.874708212682086e-8,-0.002112842390293642,-4.740840058984932e-5,-4.87150037508711e-8,-0.002112601402461571,-4.732044050097083e-5,-4.8627229494421786e-8,-0.002112399898104981,-4.71923458598116e-5,-4.84965171325286e-8,-0.0021122513870208202,-4.7043586695278016e-5,-4.834314259144425e-8,-0.002112162155506463,-4.689959768605062e-5,-4.8193650389836864e-8,-0.0021121284044120486,-4.678902511400128e-5,-4.807810872069021e-8,-0.002112134192586928,-4.6738909755118304e-5,-4.802520783954363e-8,-0.002112151736011111,-4.676805674809973e-5,-4.8055358790222776e-8,-0.0021121455008559073,-4.68802207502431e-5,-4.8173435647070684e-8,-0.002112080244306887,-4.705993268071947e-5,-4.8364140938563196e-8,-0.0021119310664213338,-4.727368018370931e-5,-4.8592931302070324e-8,-0.002111691895111901,-4.747730114612249e-5,-4.881352739322071e-8,-0.0021113788749667064,-4.7627699607907756e-5,-4.898012188224292e-8,-0.00211102704677318,-4.7694954771803144e-5,-4.9060201272908396e-8,-0.002110681352249585,-4.767075494556609e-5,-4.90436883734857e-8,-0.002110384874318121,-4.7570663804349934e-5,-4.894570849816082e-8,-0.0021101677401916797,-4.7429813825341904e-5,-4.8802430880724736e-8,-0.002110039696581039,-4.729335730533683e-5,-4.866125590022362e-8,-0.0021099884072854364,-4.7204358850854926e-5,-4.8568084600913465e-8,-0.002109983945387274,-4.7192708949043166e-5,-4.855543459993911e-8,-0.0021099879117350232,-4.726846620998511e-5,-4.863507382826351e-8,-0.0021099639576379094,-4.7421428985429237e-5,-4.879720662545984e-8,-0.0021098861854816123,-4.7626298326830003e-5,-4.901567331796005e-8,-0.002109743186109511,-4.7850789510772105e-5,-4.9256450069474826e-8,-0.002109537586825893,-4.8063526347891254e-5,-4.948609768053289e-8,-0.002109282655958739,-4.8239580975826655e-5,-4.967782243823404e-8,-0.0021089979409871034,-4.8363148343395243e-5,-4.981449771751667e-8,-0.002108705341277884,-4.8427999229028034e-5,-4.988923858233261e-8,-0.002108426170116319,-4.843672757019664e-5,-4.990457813568429e-8,-0.0021081790939703336,-4.8399655340769195e-5,-4.987120855545762e-8,-0.002107978462340765,-4.8333815691984267e-5,-4.98068240380907e-8,-0.0021078325085235445,-4.8261883157006745e-5,-4.973500790876879e-8,-0.002107741182028866,-4.8210487087105704e-5,-4.968358842430621e-8,-0.0021076938773007476,-4.820714020935879e-5,-4.9681591379790985e-8,-0.0021076680383246907,-4.827513281127266e-5,-4.975399170959863e-8,-0.002107630376401887,-4.842654419791798e-5,-4.991432609044488e-8,-0.0021075425159545343,-4.865523284848443e-5,-5.015711147352186e-8,-0.0021073713272879244,-4.893349928726431e-5,-5.045403692151433e-8,-0.002107101054149504,-4.921621165090497e-5,-5.075804312180078e-8,-0.00210674158544731,-4.9453141274911964e-5,-5.1016160495136004e-8,-0.0021063277292051657,-4.960526660686225e-5,-5.1186657637328415e-8,-0.0021059088236712936,-4.965767137535703e-5,-5.1252729209342855e-8,-0.002105533355710234,-4.962333434846008e-5,-5.122672710022117e-8,-0.002105235298687669,-4.953725574759237e-5,-5.114433301511661e-8,-0.0021050267301768173,-4.9444765358431426e-5,-5.105262008384059e-8,-0.0021048975954977385,-4.938895653500951e-5,-5.099704564916817e-8,-0.0021048209457205044,-4.940083264676395e-5,-5.1011036159970786e-8,-0.0021047611320736954,-4.9493878141675046e-5,-5.110997819652719e-8,-0.0021046825545899023,-4.9663315734863536e-5,-5.1290024568352304e-8,-0.002104557033149279,-4.98893453161492e-5,-5.1531150434198844e-8,-0.0021043684802190066,-5.0143026698940785e-5,-5.1803180748147716e-8,-0.002104114312419352,-5.0393089164750924e-5,-5.2073008844431506e-8,-0.0021038039107087792,-5.0611974369170696e-5,-5.2311154609061635e-8,-0.002103455142864527,-5.077997300985246e-5,-5.249634587215205e-8,-0.0021030901973043527,-5.088713159052434e-5,-5.261767665298347e-8,-0.002102731754757487,-5.093327497583167e-5,-5.2674658453290784e-8,-0.002102400038249737,-5.0926853473763044e-5,-5.267593710089334e-8,-0.002102110741705476,-5.088333895282607e-5,-5.2637516149960456e-8,-0.002101873489403106,-5.08235740242651e-5,-5.2580999673824274e-8,-0.0021016904381226816,-5.07720385838116e-5,-5.2531862498246874e-8,-0.0021015548084289933,-5.0754644122074386e-5,-5.2517309070279127e-8,-0.002101449525764805,-5.079541727592946e-5,-5.256294807274047e-8,-0.002101346863688587,-5.091147619245311e-5,-5.268753767417356e-8,-0.0021012107625705593,-5.110647842638639e-5,-5.2895930277749896e-8,-0.0021010036231113496,-5.1364431323432054e-5,-5.317225671965255e-8,-0.0021006978474307205,-5.164780092740599e-5,-5.347763770609452e-8,-0.0021002887607210427,-5.1904283966139336e-5,-5.3757151991875933e-8,-0.0020998017811831972,-5.2082983385010847e-5,-5.3956856249473105e-8,-0.002099287305051419,-5.2153786677272464e-5,-5.404424493360183e-8,-0.002098803714303415,-5.211938886395136e-5,-5.402099729340937e-8,-0.0020983970909576486,-5.201310176200273e-5,-5.392087032373497e-8,-0.0020980879471518285,-5.1884788106360025e-5,-5.379525398388802e-8,-0.0020978694594535633,-5.178355560077695e-5,-5.3695353664609535e-8,-0.0020977146033212875,-5.1744897802943776e-5,-5.3658858151211176e-8,-0.0020975867206337855,-5.17850538647107e-5,-5.370387698001164e-8,-0.002097449252174256,-5.1901448471996434e-5,-5.382901325735156e-8,-0.0020972727165282454,-5.2076755488728516e-5,-5.4017187239652266e-8,-0.002097038679265766,-5.228448053746355e-5,-5.424119501315798e-8,-0.002096741115512614,-5.2494770950254756e-5,-5.446974146690214e-8,-0.0020963856479537316,-5.267968073580639e-5,-5.467310941300608e-8,-0.0020959871806476727,-5.281730553664611e-5,-5.482773870037851e-8,-0.002095566547851664,-5.2894425618154075e-5,-5.49192091763326e-8,-0.0020951467983804607,-5.2907580747666326e-5,-5.494346629557186e-8,-0.0020947496865052926,-5.2862703551995284e-5,-5.490641407062349e-8,-0.00209439283463895,-5.277366064911636e-5,-5.482230500560337e-8,-0.002094087719578533,-5.266022168051224e-5,-5.471156076175677e-8,-0.0020938383034884785,-5.2545818362760925e-5,-5.459846822588298e-8,-0.00209364009071615,-5.245512424241938e-5,-5.4508786421523974e-8,-0.002093479524987209,-5.241128303972207e-5,-5.4467015989831044e-8,-0.002093333866675805,-5.243244496307399e-5,-5.449285675295966e-8,-0.002093172238328941,-5.25272454837531e-5,-5.459637339444828e-8,-0.002092959192295158,-5.2689536740216397e-5,-5.47721861308031e-8,-0.002092662162437497,-5.289419192472436e-5,-5.4994709404817255e-8,-0.002092262731012093,-5.3097515495686634e-5,-5.5218327291160634e-8,-0.0020917682925749906,-5.3246152076680836e-5,-5.5386719323868286e-8,-0.0020912168729252238,-5.32948950916572e-5,-5.5451705931345774e-8,-0.00209066831104737,-5.322638039161152e-5,-5.539407826225248e-8,-0.002090182976448214,-5.306061034027742e-5,-5.523368866112795e-8,-0.0020897991792229852,-5.2847036022818596e-5,-5.502129784760488e-8,-0.0020895220312050072,-5.264403046194828e-5,-5.481735951820511e-8,-0.002089327651578887,-5.2498344531242285e-5,-5.4670817165440435e-8,-0.002089176601984936,-5.243402752975581e-5,-5.46075905285881e-8,-0.002089027832962104,-5.2451886161662154e-5,-5.462976227025945e-8,-0.002088848145979607,-5.253524957931374e-5,-5.4721159636310425e-8,-0.002088616519163286,-5.265749417095675e-5,-5.485481113266398e-8,-0.0020883247601802828,-5.278870213189013e-5,-5.499971074275159e-8,-0.0020879761659435914,-5.290068935685728e-5,-5.512613172786507e-8,-0.002087583221816599,-5.297058683962383e-5,-5.520959628157752e-8,-0.002087164777385674,-5.29832296796577e-5,-5.5233626895864976e-8,-0.002086742950109644,-5.2932455223265686e-5,-5.519126877302781e-8,-0.002086339956581604,-5.282138748957507e-5,-5.508542075950947e-8,-0.0020859750527439137,-5.266171847400609e-5,-5.492801945295256e-8,-0.0020856618891764334,-5.247200185689632e-5,-5.4738177469182e-8,-0.0020854066000901466,-5.227520696881749e-5,-5.453962120190033e-8,-0.0020852067040709943,-5.209587655834655e-5,-5.4357819901512334e-8,-0.002085050761531667,-5.19570440334916e-5,-5.421693100956444e-8,-0.0020849188250382576,-5.187695475340274e-5,-5.4136513752244604e-8,-0.0020847838283227895,-5.1865633386018315e-5,-5.4127943797766366e-8,-0.002084614302700284,-5.192134366393279e-5,-5.4190517439071605e-8,-0.002084379177216386,-5.202743147570318e-5,-5.4307801867957737e-8,-0.0020840552632532838,-5.2151132764179095e-5,-5.444603412637725e-8,-0.0020836367229090016,-5.2246983387897786e-5,-5.4557508305702125e-8,-0.0020831432642481086,-5.226727446908682e-5,-5.45915998704627e-8,-0.00208262110484632,-5.217892051956154e-5,-5.451267651801983e-8,-0.0020821314693878165,-5.1979995231158984e-5,-5.4317639028435655e-8,-0.002081728580818981,-5.170500269403149e-5,-5.404156653193917e-8,-0.0020814384597434145,-5.1412711832119855e-5,-5.374512512192592e-8,-0.0020812512548079114,-5.1162601970100065e-5,-5.349017232141276e-8,-0.0020811301739922143,-5.0993981576040526e-5,-5.331814200443522e-8,-0.0020810288964036128,-5.091778800135395e-5,-5.324144113486929e-8,-0.0020809068797548306,-5.0920708246115815e-5,-5.324742058440525e-8,-0.002080737412895719,-5.0975044648063965e-5,-5.330822538299496e-8,-0.0020805090765344805,-5.104836915559959e-5,-5.339054776415609e-8,-0.0020802235105041346,-5.111032019083676e-5,-5.3462654102947513e-8,-0.0020798920087048986,-5.113645247824958e-5,-5.349856905196274e-8,-0.0020795322310856322,-5.111013067736273e-5,-5.3480319452971573e-8,-0.002079165270330489,-5.102337145825212e-5,-5.339903379738613e-8,-0.002078812929807196,-5.0877027322918444e-5,-5.325522084868336e-8,-0.0020784951021789507,-5.0680399754512935e-5,-5.3058323468374344e-8,-0.0020782272019827155,-5.0450194248135284e-5,-5.2825530483115977E-08,-0.002078017796904138,-5.020860124030872e-5,-5.257971627504764e-8,-0.002077866846658982,-4.998045829403398e-5,-5.234652763334412e-8,-0.002077764949227266,-4.9789769777337244e-5,-5.215090293742938e-8,-0.002077693796213007,-4.96559598259346e-5,-5.201333928555749e-8,-0.002077627945643406,-4.959024266445353e-5,-5.1946199184189877e-8,-0.0020775379573369774,-4.959258117963107e-5,-5.1950458272378425e-8,-0.002077394847759163,-4.964972754567608e-5,-5.20133946027985e-8,-0.0020771757956997636,-4.973494898228385e-5,-5.2107934240242226e-8,-0.0020768707597667575,-4.981047198397003e-5,-5.21948928946358e-8,-0.002076488719453658,-4.9833950263944744e-5,-5.222962698296795e-8,-0.0020760607752435137,-4.976947981592237e-5,-5.217368787144459e-8,-0.0020756363255762,-4.960119521007246e-5,-5.2009327355383566e-8,-0.0020752699804712604,-4.934370262592132e-5,-5.175068444401802e-8,-0.002075002258206543,-4.904167747827994e-5,-5.144355599514386e-8,-0.002074843505137487,-4.875527236421879e-5,-5.115030112001243e-8,-0.002074770885112081,-4.85375576824606e-5,-5.092642497342114e-8,-0.0020747400769557814,-4.841647775431193e-5,-5.080178737543361e-8,-0.00207470360549399,-4.839002227744564e-5,-5.077538800998163e-8,-0.0020746254988324455,-4.843356303392952e-5,-5.082265162308837e-8,-0.002074487411936633,-4.8512066229528486e-5,-5.090778965666528e-8,-0.002074287589063454,-4.8590652566310444e-5,-5.099462507142112e-8,-0.0020740364229402913,-4.864094211986411e-5,-5.105327235216716e-8,-0.0020737516117730406,-4.864364377231825e-5,-5.1063071939584795e-8,-0.0020734542779023923,-4.858893563414716e-5,-5.101324060777878e-8,-0.0020731661303226793,-4.847596434842968e-5,-5.090249495797251e-8,-0.0020729072209830705,-4.831209437291138e-5,-5.073826475982897e-8,-0.002072693884949742,-4.81119863715466e-5,-5.053563043378728e-8,-0.0020725366574624164,-4.789627336170478e-5,-5.031584456326077e-8,-0.002072438244777095,-4.76894406001386e-5,-5.0104114550785046e-8,-0.0020723920062757552,-4.751664405123388e-5,-4.992640119935618e-8,-0.002072381620741844,-4.7399626029792626e-5,-4.980535122260885e-8,-0.002072382493146707,-4.735231857382114e-5,-4.975587690759763e-8,-0.002072365126038206,-4.737703392101369e-5,-4.9781211913094104e-8,-0.0020723002115636837,-4.746229500170882e-5,-4.987048608611002e-8,-0.002072164686144449,-4.758318793891755e-5,-4.9998772052492005e-8,-0.0020719476479477516,-4.7704672733856255e-5,-5.0130175273880784e-8,-0.0020716548762382742,-4.778785681354576e-5,-5.0224127220180263E-08,-0.002071310506859259,-4.779875995902617e-5,-5.0244500497020163e-8,-0.0020709542977483263,-4.7718213318121765e-5,-5.017014103512715e-8,-0.002070633392768585,-4.755018007788747e-5,-5.0003890279004845e-8,-0.0020703892518739446,-4.7324560969728754e-5,-4.9775852540256276e-8,-0.002070243556064142,-4.709095642120351e-5,-4.953713265926498e-8,-0.002070189582318923,-4.690347790577672e-5,-4.93441179578025e-8,-0.002070194443298303,-4.6802416516879245e-5,-4.9239360290252976e-8,-0.002070211781957937,-4.680166452708117e-5,-4.923831183218621e-8,-0.0020701982102484394,-4.688757653287808e-5,-4.9327848095478144e-8,-0.0020701254502533,-4.702784331254064e-5,-4.947517696147768e-8,-0.002069984310820259,-4.718405080239909e-5,-4.9640685225447364e-8,-0.002069781881963152,-4.732196406548829e-5,-4.978861540585559e-8,-0.002069535727065262,-4.741708010271714e-5,-4.989300757237092e-8,-0.0020692682062174064,-4.7456088345065395e-5,-4.993946266170168e-8,-0.0020690022999483347,-4.743604483466135e-5,-4.9924473337753236e-8,-0.0020687589325963695,-4.736278778201662e-5,-4.9853830021207306e-8,-0.0020685552095647745,-4.724938104372905e-5,-4.9740931313843226e-8,-0.0020684029471759965,-4.7114721697835956e-5,-4.9605222607596616e-8,-0.002068307113632894,-4.698198596032385e-5,-4.9470525465095644e-8,-0.002068264210735056,-4.6876359384872586e-5,-4.936274057243991e-8,-0.0020682611085878133,-4.682161851644506e-5,-4.930645763105391e-8,-0.002068275207205279,-4.683559588593652e-5,-4.932042167102954e-8,-0.002068276840995726,-4.692525626768796e-5,-4.941250393336782e-8,-0.0020682343681795467,-4.708286526062035e-5,-4.9575641749325084e-8,-0.002068121336074826,-4.728509807584928e-5,-4.9786665145860586e-8,-0.002067923897843404,-4.7496385865671217e-5,-5.0009436305109905e-8,-0.0020676460373650566,-4.7676378285878495e-5,-5.0202301586995866e-8,-0.0020673105644500745,-4.77898332491647e-5,-5.032822287464823e-8,-0.002066955050994269,-4.781625324925658e-5,-5.036486940750825e-8,-0.0020666233471462645,-4.7756464778773514e-5,-5.0311739548860085e-8,-0.002066354580310086,-4.763398187934115e-5,-5.0191974764700023E-08,-0.0020661724200392493,-4.7490128745401975e-5,-5.004766473653001e-8,-0.0020660778693884388,-4.737345115377653e-5,-4.9929071504630356e-8,-0.002066048524221078,-4.732603099287772e-5,-4.9880421809209325e-8,-0.0020660453797246812,-4.737129330364156e-5,-4.992704483799921e-8,-0.0020660250285791494,-4.7508085193365105e-5,-5.006889477610717e-8,-0.0020659523841825966,-4.7713206060515434e-5,-5.028283650859611e-8,-0.0020658090029066624,-4.795053885650078e-5,-5.053188956294247e-8,-0.002065594771846483,-4.818222569886375e-5,-5.0776768516938594e-8,-0.002065324117375244,-4.837752105633615e-5,-5.0985184294608874e-8,-0.002065019767433622,-4.851728875182688e-5,-5.1136723525022014e-8,-0.0020647068446275245,-4.8594594783670716e-5,-5.1223668798557995e-8,-0.0020644086381638085,-4.861304972472082e-5,-5.124938607964203e-8,-0.002064144097864555,-4.8584434676873395e-5,-5.122584536957933e-8,-0.002063926468637026,-4.852647936788248e-5,-5.1171225339119544e-8,-0.0020637623786124806,-4.846100605905334e-5,-5.11079143446867e-8,-0.0020636508879348973,-4.841213269692522e-5,-5.106066445180714e-8,-0.002063582435238546,-4.8403934845334516e-5,-5.1054290024565175e-8,-0.002063538168965467,-4.8457018960260466e-5,-5.1110281108115146e-8,-0.002063490642966396,-4.858388401565267e-5,-5.12421042751145e-8,-0.002063407082221286,-4.8783799285689586e-5,-5.144985988199522e-8,-0.0020632559577338995,-4.9039126710606216e-5,-5.1716281192541857e-8,-0.0020630160427410785,-4.931581340272001e-5,-5.200696102828744e-8,-0.002062684941410063,-4.95699691789468e-5,-5.2276889335559116e-8,-0.0020622829172062315,-4.9759696099219955e-5,-5.2482526161209284e-8,-0.0020618491854511264,-4.9858113731482825e-5,-5.259526114699326e-8,-0.0020614313126430684,-4.98622055714111e-5,-5.261072103110058e-8,-0.0020610717124268244,-4.979388598943105e-5,-5.255018976438976e-8,-0.00206079622917913,-4.9693307260769264e-5,-5.2454091838812215e-8,-0.002060608259750969,-4.960738794563041e-5,-5.2370482519734586e-8,-0.0020604893759882652,-4.957747244117635e-5,-5.234243575739418e-8,-0.0020604054583355405,-4.962944279368117e-5,-5.239769021503708e-8,-0.00206031622426224,-4.976850689463904e-5,-5.254290844467591e-8,-0.0020601854537221713,-4.997959938080869e-5,-5.276367005121703e-8,-0.002059989171420568,-5.0232827495872717e-5,-5.3029781808228276e-8,-0.0020597197607184654,-5.049196909900188e-5,-5.330394627200139e-8,-0.002059385412596773,-5.0723251719086136e-5,-5.35509256812709e-8,-0.002059005920337264,-5.0901931837912855e-5,-5.374455696877302e-8,-0.0020586068325025636,-5.1015438910330984e-5,-5.387122879648511e-8,-0.0020582139353274493,-5.106332394108202e-5,-5.3929977985066915e-8,-0.0020578492211639973,-5.105516573900859e-5,-5.3930358175955645e-8,-0.002057528552028513,-5.100771436745336e-5,-5.388943054436595e-8,-0.0020572605931187234,-5.094215881551009e-5,-5.382886471043966e-8,-0.0020570463828137086,-5.088182315066045e-5,-5.3772543032440546e-8,-0.0020568790450358394,-5.0850080664488783e-5,-5.3744486331419684e-8,-0.0020567435004348058,-5.086799254343324e-5,-5.376655829843546e-8,-0.0020566165172875277,-5.0951144908211624e-5,-5.38553140117008e-8,-0.002056468009873697,-5.1105440079060466e-5,-5.40176449522486e-8,-0.002056264887091375,-5.13224346701609e-5,-5.4245796040435814e-8,-0.0020559784072281106,-5.157623756835036e-5,-5.451389058844007e-8,-0.0020555942713637253,-5.1825209665744814e-5,-5.4779432398487804e-8,-0.0020551217432332926,-5.202108670480498e-5,-5.4992587084446835e-8,-0.002054595971680873,-5.212442299521637e-5,-5.511211091620739e-8,-0.002054069540827032,-5.212000715115373e-5,-5.51213256728815e-8,-0.0020535954582683582,-5.202381128623128e-5,-5.503543356010499e-8,-0.002053209667556904,-5.187728707364314e-5,-5.48959111155173e-8,-0.002052921320923942,-5.1732422490422854e-5,-5.4755490408141264e-8,-0.0020527136286440546,-5.163540619096735e-5,-5.466165472016251e-8,-0.002052552370246584,-5.16152962902263e-5,-5.464504010682952e-8,-0.002052397089200715,-5.167979779085585e-5,-5.471483931427527e-8,-0.0020522111175157827,-5.1817015362214554e-5,-5.4860156203498216e-8,-0.002051968552414977,-5.200091488002448e-5,-5.505518884494557e-8,-0.002051657757119859,-5.219838699551085e-5,-5.5266251947721564e-8,-0.0020512816489339715,-5.237636228823249e-5,-5.5459107581815276e-8,-0.0020508553095427784,-5.2507832957142995e-5,-5.5605365688318714e-8,-0.0020504017421625635,-5.2575890404729004e-5,-5.568690921630114e-8,-0.002049946887543557,-5.257533993074332e-5,-5.5697769382127575e-8,-0.002049514984834118,-5.251207506856239e-5,-5.5643570315387093e-8,-0.0020491250330573053,-5.240083953067565e-5,-5.553919797775131e-8,-0.0020487886736325817,-5.226219084775036e-5,-5.540559549606092e-8,-0.002048509350314085,-5.211942672300324e-5,-5.526655233827838e-8,-0.0020482822912756475,-5.1995876311308334e-5,-5.514595440180733e-8,-0.0020480948969156336,-5.191250486751777e-5,-5.506543751527602e-8,-0.0020479273660762303,-5.188554270222557e-5,-5.5042078174011434e-8,-0.002047753716271682,-5.19237834715236e-5,-5.5085654827554707e-8,-0.002047543853386551,-5.202532476066097e-5,-5.5195172880639046e-8,-0.0020472677925593256,-5.2174216124140644e-5,-5.535514660858792e-8,-0.002046902870774027,-5.2338771760351975e-5,-5.553355877045675e-8,-0.0020464432837271392,-5.247451873274851e-5,-5.568470840459575e-8,-0.0020459084093877532,-5.253449204712567e-5,-5.575981860047395e-8,-0.002045343640214381,-5.2486027294355265e-5,-5.5724461720487053e-8,-0.002044808785656605,-5.2326853813685626e-5,-5.557525555895152e-8,-0.002044356731611969,-5.208986005362827e-5,-5.534487592771635e-8,-0.002044013525552351,-5.183141847200364e-5,-5.5090255370018856e-8,-0.002043771226817781,-5.160953417781544e-5,-5.48704621303244e-8,-0.0020435956589243583,-5.1464429347744986e-5,-5.472704260792385e-8,-0.0020434418674889353,-5.1410036594933055e-5,-5.4675282541850294e-8,-0.0020432684427998627,-5.14362548539681e-5,-5.470618039648655e-8,-0.0020430462096218717,-5.1516940304592496e-5,-5.4794150517663037e-8,-0.0020427612302023604,-5.161886518563504e-5,-5.490581755587025e-8,-0.002042413976632722,-5.170911019925943e-5,-5.50074620408479e-8,-0.0020420165420526716,-5.1760253982835196e-5,-5.5070471238764245e-8,-0.0020415890123641396,-5.1753638794210315e-5,-5.507496856439569e-8,-0.002041155494939975,-5.168102371657047e-5,-5.501178570621877e-8,-0.0020407401651533347,-5.154474405169965e-5,-5.488278817879703e-8,-0.0020403637204026146,-5.135653343018677e-5,-5.4699684377973364e-8,-0.002040040576882192,-5.113526412477106e-5,-5.448162890443747e-8,-0.002039777091455139,-5.09039490226065e-5,-5.425206240270826e-8,-0.0020395709362431877,-5.068649756636404e-5,-5.4035371776647424e-8,-0.002039411459954195,-5.050467571637247e-5,-5.385385724355181e-8,-0.002039280756574348,-5.037542727193322e-5,-5.372512326084712e-8,-0.0020391552857087123,-5.030852534711591e-5,-5.365977061904039e-8,-0.0020390080427771986,-5.030447590753775e-5,-5.365921376204627e-8,-0.002038811568452725,-5.0352607930303213e-5,-5.3713516384989046e-8,-0.0020385424324039243,-5.042973944197244e-5,-5.379970190700536e-8,-0.0020381875739485158,-5.050077044952324e-5,-5.388206675784495e-8,-0.0020377516616928775,-5.052330199125621e-5,-5.391680200972993e-8,-0.0020372625651711995,-5.045802416725423e-5,-5.386277190055731e-8,-0.0020367698775526524,-5.028392416035833e-5,-5.3697376840582164e-8,-0.0020363321435952564,-5.001196000452072e-5,-5.34308014077663e-8,-0.0020359951521852593,-4.968703486004547e-5,-5.310816086035136e-8,-0.0020357726478473404,-4.937288418461528e-5,-5.279414480895378e-8,-0.0020356419556401216,-4.9126855995544544e-5,-5.2547399322285394e-8,-0.002035556684070434,-4.897959533240644e-5,-5.2399885499866514e-8,-0.0020354668174017705,-4.892970414356411e-5,-5.2351307750795756e-8,-0.0020353344578759418,-4.8951698867931034e-5,-5.237686688565701e-8,-0.0020351402813209166,-4.900893595997211e-5,-5.2440021527677685e-8,-0.0020348825479860966,-4.906468718670452e-5,-5.250353037457378e-8,-0.0020345726105927375,-4.908894182699448e-5,-5.253641005057569e-8,-0.002034229863541913,-4.906144649731033e-5,-5.251727392128725e-8,-0.002033877432711455,-4.897243922319491e-5,-5.2435389666249733e-8,-0.002033538711092817,-4.882223756648143e-5,-5.2290488844127926e-8,-0.002033234470164266,-4.8620156756388854e-5,-5.2091736421230884e-8,-0.0020329804185158853,-4.838285072517303e-5,-5.185597492180308e-8,-0.0020327852353072594,-4.813206614562613e-5,-5.160531630998899e-8,-0.002032649254192641,-4.789178910703803e-5,-5.136415864036497e-8,-0.00203256409568354,-4.7684964149517676e-5,-5.115586867184493e-8,-0.002032513412831578,-4.7530207576543425e-5,-5.099954932398015e-8,-0.0020324746777436327,-4.743890663944881e-5,-5.0907215491822745e-8,-0.002032421864725609,-4.741298395352246e-5,-5.088156196373777e-8,-0.002032328861343699,-4.744359026821503e-5,-5.091451930689139e-8,-0.002032173443614939,-4.7510913626487626e-5,-5.098678990055797e-8,-0.002031941783002499,-4.75853718193778e-5,-5.106873150905396e-8,-0.0020316332829377146,-4.763092567556373e-5,-5.112349305662727e-8,-0.002031264678451989,-4.7611506845454626e-5,-5.111354889776993e-8,-0.0020308711459007655,-4.7500835256465015e-5,-5.101094070015697e-8,-0.002030501384939176,-4.7293891553481265e-5,-5.0809346057054425e-8,-0.0020302046550841244,-4.7015069114082157e-5,-5.053271389164446e-8,-0.002030012417735536,-4.6715860633814e-5,-5.023306514824246e-8,-0.0020299237206302333,-4.645858056483108e-5,-4.997393446583235e-8,-0.002029904534219609,-4.629246101907128e-5,-4.980599835191041e-8,-0.0020299027081861383,-4.6235733219535855e-5,-4.974874457112798e-8,-0.0020298691085456756,-4.6273355836021885e-5,-4.9787942532947575e-8,-0.002029772836986357,-4.6368492929145236e-5,-4.9886997870461254e-8,-0.0020296053518841788,-4.6478270704142267e-5,-5.0002696473796485e-8,-0.0020293762284797076,-4.6565779984025805e-5,-5.009732090515303e-8,-0.0020291058975264805,-4.660586503998099e-5,-5.0144678766039385e-8,-0.0020288190745721122,-4.658611551409667e-5,-5.013139050785385e-8,-0.0020285401833065263,-4.650544482721242e-5,-5.0055709880198454e-8,-0.0020282905163081324,-4.637198758862261e-5,-4.9925521941264115e-8,-0.0020280863812595215,-4.6201017541421475e-5,-4.975620376898143e-8,-0.002027937697407739,-4.6012910954525015e-5,-4.95684364968778e-8,-0.0020278468548150497,-4.5830932166805734e-5,-4.938584335030445e-8,-0.0020278079352926354,-4.5678563130217145e-5,-4.923225233991149e-8,-0.0020278066732735607,-4.5576287146234076e-5,-4.9128512005390405e-8,-0.0020278216052989797,-4.553814792964579e-5,-4.908913495339701e-8,-0.0020278266184087235,-4.5568694544187735e-5,-4.91192941943901e-8,-0.0020277947861438816,-4.566099727855335e-5,-4.921277950752152e-8,-0.0020277030598136164,-4.579640243999685e-5,-4.9351559556919325e-8,-0.0020275370670149273,-4.5946459644631754e-5,-4.950743825762933e-8,-0.0020272951641109476,-4.6077038467505365e-5,-4.964594133297112e-8,-0.0020269909380996286,-4.615441491887575e-5,-4.9732349917762104e-8,-0.002026653192492816,-4.615293081887066e-5,-4.973956903588067e-8,-0.002026322209052732,-4.606314805429271e-5,-4.965671815932576e-8,-0.0020260414134917063,-4.5898197313257225e-5,-4.949598467985722e-8,-0.002025845064816443,-4.569487890022771e-5,-4.929407616837752e-8,-0.0020257453978966516,-4.550622741121225e-5,-4.9104815330766504e-8,-0.0020257254701901042,-4.538541867435896e-5,-4.898274157296879e-8,-0.0020257433889951937,-4.536680350718691e-5,-4.89636608578841e-8,-0.0020257476215753702,-4.5453789008186565e-5,-4.905208248604179e-8,-0.002025695654193513,-4.562012774480506e-5,-4.922225373647776e-8,-0.0020255663701208917,-4.582262170758979e-5,-4.943082479997011e-8,-0.0020253618227586557,-4.6016984020625265e-5,-4.963283638283841e-8,-0.00202510099803616,-4.6169328034816214e-5,-4.979343944742674e-8,-0.002024811017417274,-4.626077683867761e-5,-4.989278000082901e-8,-0.002024519795827304,-4.6286832571634604e-5,-4.992561400738215e-8,-0.0020242514862415977,-4.625433913083903e-5,-4.989840752411386e-8,-0.002024024252686185,-4.617810969109077e-5,-4.982595556164917e-8,-0.0020238493406938953,-4.607808430854788e-5,-4.972841725462505e-8,-0.0020237306112493255,-4.597702408116703e-5,-4.96288581956967e-8,-0.002023664162763472,-4.589834984431947e-5,-4.955099750636145e-8,-0.0020236381094273855,-4.586365827157764e-5,-4.951673189348936e-8,-0.0020236329502209293,-4.5889656355000434e-5,-4.954314934249165e-8,-0.002023623153744319,-4.5984715081919234e-5,-4.963915423232379e-8,-0.0020235804546441657,-4.6145777376813115e-5,-4.980235686787022e-8,-0.002023478863220688,-4.635676148666589e-5,-5.0017332271608656e-8,-0.0020233006158513526,-4.658965624449702e-5,-5.025648223081647e-8,-0.002023041531229927,-4.6808945440860525e-5,-5.048423155390615e-8,-0.0020227139642913913,-4.6978896318268104e-5,-5.066420578545552e-8,-0.002022346013528821,-4.7072161309276584e-5,-5.0767917079637096e-8,-0.002021976583923614,-4.7077557162162256e-5,-5.0782829172766134e-8,-0.002021646938817805,-4.700482993717928e-5,-5.071753209060727e-8,-0.0020213903373314294,-4.688457071627136e-5,-5.060204845365824e-8,-0.00202122225761361,-4.676225438165741e-5,-5.048208770780828e-8,-0.002021134399579563,-4.668682793085823e-5,-5.040757499631068e-8,-0.0020210955157597492,-4.66964938733245e-5,-5.041810897949245e-8,-0.002021060207166187,-4.680660727557303e-5,-5.053039604591645e-8,-0.0020209831787395298,-4.700501284627893e-5,-5.073317426465869e-8,-0.0020208331782008877,-4.7257207541469374e-5,-5.0992163914768974e-8,-0.002020600749527367,-4.751873684499668e-5,-5.126249359928724e-8,-0.002020297495132843,-4.7748817668834114e-5,-5.150253416122725e-8,-0.002019949045350994,-4.791973032907616e-5,-5.168357842505219e-8,-0.002019586148214338,-4.801998291591459e-5,-5.1793273968425187e-8,-0.0020192374342056386,-4.8052601996660434e-5,-5.183409256541799e-8,-0.002018925159106304,-4.8031175323490096e-5,-5.181942050354247e-8,-0.0020186634942643855,-4.797571811880198e-5,-5.1769350061628944e-8,-0.002018458307559683,-4.7909321720409155e-5,-5.17071934570522e-8,-0.0020183074793059634,-4.7855657746552463e-5,-5.1656878184229704e-8,-0.0020182012242393878,-4.783688725574289e-5,-5.164083264519561e-8,-0.0020181224346406887,-4.7871384574551e-5,-5.167777089044754e-8,-0.002018047515893418,-4.797092449356852e-5,-5.177995991815182e-8,-0.0020179484270965854,-4.813745696818201e-5,-5.1950004632217014e-8,-0.0020177966111187182,-4.836022705575067e-5,-5.217785319666721e-8,-0.0020175689778127058,-4.861471743161788e-5,-5.243952149084699e-8,-0.0020172549083493363,-4.886518940475764e-5,-5.2699404555608824e-8,-0.0020168618491771245,-4.9071739379400246e-5,-5.291720278700551e-8,-0.0020164165457899337,-4.920074189090056e-5,-5.305839885690176e-8,-0.0020159601254947663,-4.923537724905972e-5,-5.310497994930823e-8,-0.0020155377782343923,-4.9182101111894395e-5,-5.3062208619770655e-8,-0.0020151863264922898,-4.9070186505180795e-5,-5.2958496549887175e-8,-0.0020149239683831454,-4.894424255995497e-5,-5.28381974040878e-8,-0.002014745466484543,-4.8852234007670655e-5,-5.2749744360003565e-8,-0.002014623980385843,-4.8832737442584404e-5,-5.2732795661562925E-08,-0.0020145187675945538,-4.8905033515197663e-5,-5.2807996323674024e-8,-0.002014386463354211,-4.9064737170752646e-5,-5.297217537397421e-8,-0.0020141926071653754,-4.928613889269881e-5,-5.3200321420099145e-8,-0.002013919923050992,-4.953032530867741e-5,-5.3453543629696204e-8,-0.002013571006866503,-4.975617191211685e-5,-5.369014468097558e-8,-0.0020131652167542056,-4.993046123284049e-5,-5.3875992139383384e-8,-0.002012731692604997,-5.0034158097124634e-5,-5.399109718532883e-8,-0.0020123014742402913,-5.0063845602625036e-5,-5.403129483295887e-8,-0.00201190121087524,-5.002933955111049e-5,-5.4005977959494064e-8,-0.002011549521326985,-4.994945558883987e-5,-5.393385164637899e-8,-0.002011255743455944,-4.984764678639762e-5,-5.383846809376056e-8,-0.0020110201985696686,-4.974843179222414e-5,-5.374453985485008e-8,-0.002010835083772604,-4.9674777295965575e-5,-5.367526613695328e-8,-0.0020106854277154628,-4.964606496865315e-5,-5.365032901804489e-8,-0.0020105500400673802,-4.9676073962541255e-5,-5.3683953076972764e-8,-0.0020104028617102853,-4.9770593190928885e-5,-5.3782559234610896e-8,-0.0020102154280196164,-4.992472116898015e-5,-5.39419945769669e-8,-0.002009961203093299,-5.01205774324166e-5,-5.4145045648848874e-8,-0.0020096220475094026,-5.032702956215601e-5,-5.436091558231032e-8,-0.0020091956873586328,-5.0503577918817376e-5,-5.454893403638213e-8,-0.0020087010935627442,-5.060963041617747e-5,-5.466782814365228e-8,-0.0020081776870822868,-5.06175125618987e-5,-5.468889528583259e-8,-0.0020076760813480246,-5.052404157729019e-5,-5.4607820427235687e-8,-0.0020072426309083852,-5.03543523152836e-5,-5.444874990717472e-8,-0.0020069043511348767,-5.015493124700536e-5,-5.42575575233768e-8,-0.0020066610667815107,-4.997871174697851e-5,-5.40871357697118e-8,-0.0020064875013838,-4.98690470565664e-5,-5.3981449732444325e-8,-0.0020063429428621477,-4.9848723760962696e-5,-5.396442162152271e-8,-0.0020061836818402717,-4.991653940438004e-5,-5.40361687618578e-8,-0.0020059740082301832,-5.005060728795719e-5,-5.4175883241144576e-8,-0.0020056933781890086,-5.021595398427699e-5,-5.434910207886136e-8,-0.0020053390005447076,-5.037374382076034e-5,-5.4516829286568113e-8,-0.0020049242019915922,-5.048986269802197e-5,-5.464425732666e-8,-0.0020044736538592134,-5.054119841472836e-5,-5.470733410760349e-8,-0.0020040170112563204,-5.0518666909647305e-5,-5.469609132681992e-8,-0.002003582651521957,-5.0426916644760484e-5,-5.461455429534083e-8,-0.002003192848389794,-5.028151267800684e-5,-5.4477987905210974e-8,-0.0020028610069787686,-5.010484787898947e-5,-5.430874706071043e-8,-0.0020025908720933084,-4.992194480586509e-5,-5.413196542421391e-8,-0.0020023771463984017,-4.9756918400443195e-5,-5.3971933421660555e-8,-0.002002206808863418,-4.963034306888264e-5,-5.384945799572805e-8,-0.0020020606277349035,-4.955729195151486e-5,-5.3779965287491494e-8,-0.002001914752160842,-4.9545629165052306e-5,-5.377186303277142e-8,-0.0020017426370449094,-4.959424701946217e-5,-5.382477021649585e-8,-0.0020015178700865826,-4.9691252782268014e-5,-5.392756337052816e-8,-0.002001218597218113,-4.981272984636775e-5,-5.4056892268100934e-8,-0.0020008337756181305,-4.9923598500677135e-5,-5.417780009747694e-8,-0.002000370096206164,-4.998267559890689e-5,-5.4248682766537245e-8,-0.0019998563334538166,-4.995319905600739e-5,-5.423191853970226e-8,-0.0019993405058199324,-4.981692900508882e-5,-5.4108211202206056e-8,-0.0019988771595501596,-4.958544642961348e-5,-5.388813032255459e-8,-0.001998508235516319,-4.930060305686856e-5,-5.361273486836377e-8,-0.0019982470792282445,-4.902112276864653e-5,-5.3340329163181614e-8,-0.001998074636703137,-4.880149849864028e-5,-5.31255233957502e-8,-0.0019979490776461596,-4.867431780069525e-5,-5.300163018068865e-8,-0.001997822100817167,-4.864355803151583e-5,-5.2973805172126e-8,-0.0019976535169998273,-4.8688691267618395e-5,-5.3022777123200866e-8,-0.001997419552504148,-4.8774601604832057e-5,-5.311433704727912e-8,-0.001997114744774493,-4.8862226688571974e-5,-5.320970261330998e-8,-0.0019967494607951706,-4.891701856579829e-5,-5.3273961127601174e-8,-0.0019963452028423133,-4.8914377496388965e-5,-5.328171644965104e-8,-0.0019959291743273603,-4.884227819040176e-5,-5.3220032150562435e-8,-0.0019955289872912786,-4.870151669163586e-5,-5.3088954045228216e-8,-0.001995168161878916,-4.850401085939419e-5,-5.289994962557313e-8,-0.0019948628903654394,-4.8269744288963775e-5,-5.267284224427861e-8,-0.0019946202670904343,-4.8023026531601735e-5,-5.2431967802807096e-8,-0.0019944379707342885,-4.7788675113880514e-5,-5.220224766362233e-8,-0.0019943051797844005,-4.7588659781935926e-5,-5.200579146376313e-8,-0.0019942042706509,-4.743954711749449e-5,-5.1859386167826104e-8,-0.001994112859914415,-4.735069680607469e-5,-5.1772781475901097e-8,-0.001994006037341234,-4.732295848864623e-5,-5.1747440313270875e-8,-0.001993858894812306,-4.7347710668200726e-5,-5.177551950964653e-8,-0.0019936496579878314,-4.740627635058635e-5,-5.18390919640976e-8,-0.001993363861819001,-4.7470190253398286e-5,-5.1910146838977426e-8,-0.0019929996205191062,-4.7503541595903896e-5,-5.195272017060764e-8,-0.0019925728195238626,-4.746902878186876e-5,-5.1928915188607375e-8,-0.001992119310680294,-4.7338527946317814e-5,-5.1809644671995214e-8,-0.001991689987214206,-4.710613654808492e-5,-5.1587956392584026e-8,-0.0019913363447532006,-4.6797293437381455e-5,-5.128838764343941e-8,-0.0019910904742861894,-4.6465669201456026e-5,-5.096398901617266e-8,-0.001990950368197197,-4.617513909028325e-5,-5.067840830528089e-8,-0.0019908806466250022,-4.5975167125504204e-5,-5.048140368418561e-8,-0.0019908285309041696,-4.5883747649525306e-5,-5.039181646697579e-8,-0.0019907446103717484,-4.588605349155747e-5,-5.039601315964357e-8,-0.0019905972795608703,-4.59456274268961e-5,-5.045866854053545e-8,-0.0019903769307380295,-4.601920467643337e-5,-5.053718566759492e-8,-0.001990092573971516,-4.60683822052351e-5,-5.059317403618827e-8,-0.0019897653271612717,-4.6066023946311286e-5,-5.059894157366422e-8,-0.0019894219047486518,-4.5998288524238066e-5,-5.0539804388693425e-8,-0.001989089388356069,-4.5864029542767294e-5,-5.041380553085208e-8,-0.001988791342582684,-4.5672889943786124e-5,-5.023002279694939e-8,-0.0019885450270769787,-4.544267119758317e-5,-5.000598811628438e-8,-0.001988359611822744,-4.519623780012269e-5,-4.9764511439258186e-8,-0.001988235373861473,-4.4958196634044265e-5,-4.9530237154278555e-8,-0.001988163874878257,-4.475155292368226e-5,-4.932622435749737e-8,-0.0019881291494703197,-4.4594624487372946e-5,-4.917088069716583e-8,-0.0019881097672433527,-4.449860634103792e-5,-4.907562319610449e-8,-0.0019880814361664893,-4.446599676205845e-5,-4.9043404078743095e-8,-0.001988019896370336,-4.448984902371915e-5,-4.90679788963876e-8,-0.0019879040251158317,-4.455382789815783e-5,-4.9133842968146527e-8,-0.001987719144006088,-4.463316087772778e-5,-4.921694042093964e-8,-0.001987460558236463,-4.46967620556441e-5,-4.9286514917244204e-8,-0.0019871370966062707,-4.471122399257981e-5,-4.9308929889939364e-8,-0.0019867735413332,-4.464753053386993e-5,-4.925440944020967e-8,-0.0019864096922321078,-4.449046879624519e-5,-4.910667619111871e-8,-0.001986093293887148,-4.424847454638656e-5,-4.887310764941467e-8,-0.0019858657165408035,-4.395851101024967e-5,-4.858986252843164e-8,-0.0019857444502105696,-4.36793761172567e-5,-4.831531748591886e-8,-0.0019857123157436644,-4.3471892985409506e-5,-4.811032585031551e-8,-0.001985722442942424,-4.3374678707536145e-5,-4.801403302963816e-8,-0.001985717837909519,-4.3389861516746215e-5,-4.802953349265059e-8,-0.0019856536347009303,-4.348657983914437e-5,-4.812711300883761e-8,-0.001985509793314366,-4.3617293200771854e-5,-4.826016677840372e-8,-0.001985291041141802,-4.373551017512467e-5,-4.8382599589213666e-8,-0.001985018982825112,-4.380710889702349e-5,-4.8460059289153266e-8,-0.00198472269519155,-4.381413163467009e-5,-4.8473904889146595e-8,-0.0019844313817317153,-4.3753602107519224e-5,-4.8420335013601454e-8,-0.0019841698777690116,-4.3634265418978614e-5,-4.830740886578302e-8,-0.00198395631013117,-4.347308097731399e-5,-4.815167459106861e-8,-0.00198380093609794,-4.32920529085931e-5,-4.7974972464015794e-8,-0.0019837056325942176,-4.311530044265703e-5,-4.7801388949448075e-8,-0.0019836639326078916,-4.2966205027643966e-5,-4.765430103584804e-8,-0.0019836616788419274,-4.2864560277764126e-5,-4.755351001687462e-8,-0.0019836784835310212,-4.2823816969524074e-5,-4.75125667742844e-8,-0.0019836901334029686,-4.284880913635948e-5,-4.753661876885519e-8,-0.0019836717844280323,-4.293443985340406e-5,-4.7621167559884083e-8,-0.001983601577361672,-4.306561983656408e-5,-4.775195443764006e-8,-0.00198346427639853,-4.321860830029743e-5,-4.79061064744248e-8,-0.001983254503428399,-4.3363817575379086e-5,-4.805466061004061e-8,-0.001982979128261479,-4.3470011868281195e-5,-4.8166508580713625e-8,-0.0019826583317162807,-4.350982227820718e-5,-4.8213806615591725e-8,-0.0019823245270563744,-4.346642997860529e-5,-4.817876549475533e-8,-0.0019820179079688013,-4.334055689306835e-5,-4.806092503305833e-8,-0.0019817776241884424,-4.315546627647395e-5,-4.788249609663614e-8,-0.001981629243341138,-4.295622121243347e-5,-4.768788218876515e-8,-0.00198157253207564,-4.279964969343516e-5,-4.753376447678903e-8,-0.0019815768110193243,-4.273555993575656e-5,-4.747031671641675e-8,-0.0019815896914275643,-4.2786939561310826e-5,-4.752132323658576e-8,-0.001981556964728314,-4.294065163758243e-5,-4.767470277125102e-8,-0.001981442898715948,-4.315455768342111e-5,-4.788935301045354e-8,-0.001981239994932547,-4.337586664281439e-5,-4.811318043326988e-8,-0.001980965615592369,-4.3559380683812036e-5,-4.830112897720887e-8,-0.001980651104271411,-4.3677669740602314e-5,-4.842535724700544e-8,-0.001980330622165264,-4.37224614567855e-5,-4.8476842035870866e-8,-0.001980033601616317,-4.370082309922366e-5,-4.846185712372692e-8,-0.001979781186553916,-4.362987461869388e-5,-4.8396913373778846e-8,-0.0019795853426471683,-4.35321462310607e-5,-4.8304189751421825e-8,-0.001979449164923876,-4.343211096476673e-5,-4.8208004801788516e-8,-0.001979367516891493,-4.335355049589747e-5,-4.81320762404166e-8,-0.0019793277939190233,-4.331724667908914e-5,-4.8097157631997425e-8,-0.0019793109779484602,-4.333865671006025e-5,-4.811875302716466e-8,-0.00197929334115372,-4.342552864224307e-5,-4.8204839307820454e-8,-0.0019792491585166726,-4.3575840607934675e-5,-4.835390191602501e-8,-0.0019791544719827683,-4.377676979296662e-5,-4.855390559455163e-8,-0.0019789914659854206,-4.400538864917376e-5,-4.878285284376596e-8,-0.001978752618067997,-4.423151487384888e-5,-4.9011380729146134e-8,-0.001978443571552841,-4.442266642057841e-5,-4.920743293376487e-8,-0.0019780837559768326,-4.455044155192306e-5,-4.93424419569069e-8,-0.001977704189216635,-4.459716325964112e-5,-4.9397956177720134e-8,-0.0019773423735596264,-4.4561466986321577e-5,-4.937141684655841e-8,-0.001977034607825835,-4.446140319979623e-5,-4.927959934097138e-8,-0.0019768066566202684,-4.433345001834858e-5,-4.915798984075471e-8,-0.0019766648048065616,-4.422600808807836e-5,-4.905454320636164e-8,-0.001976590642014865,-4.418718038152136e-5,-4.901754862575995e-8,-0.0019765433922679146,-4.424941926591262e-5,-4.908018505043689e-8,-0.0019764714799322142,-4.441704193678446e-5,-4.924782281001948e-8,-0.0019763299672662825,-4.466351711965738e-5,-4.949503779025665e-8,-0.0019760958592488333,-4.494111748014449e-5,-4.9774988214425593e-8,-0.001975773776278894,-4.519821653836421e-5,-5.003649186587927e-8,-0.001975390495162118,-4.539533451112828e-5,-5.0239976118785304e-8,-0.0019749831859174212,-4.551335871876182e-5,-5.0365773681986254e-8,-0.0019745879207018306,-4.555320514137526e-5,-5.041400386812903e-8,-0.0019742323786003236,-4.553037719774458e-5,-5.039938833552872e-8,-0.0019739331147513276,-4.5468406296927464e-5,-5.03448680797245e-8,-0.001973695819172792,-4.539349471122782e-5,-5.0276287499947574e-8,-0.0019735168135767726,-4.533089935511781e-5,-5.0218721062822205e-8,-0.0019733846944876474,-4.5302611923024283e-5,-5.019408501320979e-8,-0.0019732817668098417,-4.532562487218592e-5,-5.021939519624579e-8,-0.0019731854504376916,-4.5410207074392044e-5,-5.0305107394665245e-8,-0.0019730701622044603,-4.5557997564901036e-5,-5.045329830787116e-8,-0.001972910223039121,-4.576026673732602e-5,-5.0655959638034884e-8,-0.001972684031500541,-4.5997198476817514E-05,-5.0894198826261366e-8,-0.001972379090884328,-4.623929153514652e-5,-5.113944114811148e-8,-0.001971996635686588,-4.6451727228890164e-5,-5.135753400078218e-8,-0.0019715539766186102,-4.660160044857538e-5,-5.1515737334611745e-8,-0.0019710828542270687,-4.6666477609024985e-5,-5.159115485388241e-8,-0.001970623298040414,-4.664162896085638e-5,-5.1578016403124346e-8,-0.001970214212090245,-4.65432620191606e-5,-5.1491151948029e-8,-0.001969883242927487,-4.6406229230851866e-5,-5.1364075446337285e-8,-0.001969638857557791,-4.627639846031354e-5,-5.124174919757445e-8,-0.001969467008160238,-4.6199420166105754e-5,-5.116961866658035e-8,-0.0019693336914688433,-4.6208627966382286e-5,-5.1181552597747694e-8,-0.001969193371546135,-4.631535486871011e-5,-5.128996338486575e-8,-0.0019690015104308046,-4.650497733936632e-5,-5.148150977961362e-8,-0.001968727504736385,-4.6740821064600386e-5,-5.172064567922468e-8,-0.001968363316252578,-4.697522012612561e-5,-5.196041523031695e-8,-0.00196792440570595,-4.71636765838571e-5,-5.2156492160433425e-8,-0.001967443051877653,-4.727655930735045e-5,-5.227890703313716e-8,-0.0019669575953292872,-4.730437768201357e-5,-5.2317472555509746e-8,-0.0019665022928231123,-4.7256201646844035e-5,-5.228042290007389e-8,-0.0019661009362071376,-4.715377406937989e-5,-5.218873377314962e-8,-0.0019657647779907092,-4.702464970878444e-5,-5.206938544394163e-8,-0.001965493477560509,-4.689660585321579e-5,-5.194979398067257e-8,-0.001965277377825799,-4.6794002474408414e-5,-5.185413345399812e-8,-0.001965099914950498,-4.67357278760477e-5,-5.1801254050097615e-8,-0.0019649396611614903,-4.673397854378611e-5,-5.180348656861776e-8,-0.0019647721014879383,-4.6793187059781656e-5,-5.186563289514447e-8,-0.0019645716558417217,-4.690878647692816e-5,-5.1983771468773974e-8,-0.0019643145874512157,-4.706604455706395e-5,-5.214404907793817e-8,-0.001963983213520618,-4.7239795327600476e-5,-5.232226406608289e-8,-0.0019635711534783046,-4.7396399391850306e-5,-5.248560550378622e-8,-0.0019630881783210172,-4.749923158841316e-5,-5.2597912011238834e-8,-0.0019625620385825687,-4.7517783547080394e-5,-5.262860028092075e-8,-0.001962034600536159,-4.743810866143697e-5,-5.2563034466538445e-8,-0.001961551663459193,-4.7270187530390955e-5,-5.2409958425237556e-8,-0.0019611493437624405,-4.7047867070956564e-5,-5.2201684891901307e-8,-0.0019608425118726406,-4.682012526184868e-5,-5.198578136085175e-8,-0.001960620223510975,-4.663679110534357e-5,-5.1811253235307756e-8,-0.00196044964691645,-4.65343886842311e-5,-5.1714684022350806e-8,-0.001960286244385532,-4.652696232149927e-5,-5.171103424799668e-8,-0.0019600861987816276,-4.660393314075276e-5,-5.1791161198884274e-8,-0.001959817384072231,-4.673447845393499e-5,-5.192571546679343e-8,-0.0019594663672666632,-4.687647620848606e-5,-5.207366237327364e-8,-0.0019590402013480103,-4.69873681531962e-5,-5.219291849091948e-8,-0.0019585630459199917,-4.7034093216261266e-5,-5.2250281015410575e-8,-0.0019580689434451474,-4.699963912862847e-5,-5.222813797470916e-8,-0.001957593098636109,-4.6884855780413277E-05,-5.212650982795257e-8,-0.0019571642607120374,-4.6705755925512453e-5,-5.196056523166988e-8,-0.001956800031936092,-4.648795164335014e-5,-5.175520387715332e-8,-0.0019565055327110657,-4.626040613743492e-5,-5.1538868280151164e-8,-0.001956274664949442,-4.605019885705157e-5,-5.133830575689433e-8,-0.0019560927255029953,-4.587904903303501e-5,-5.117507505063576e-8,-0.001955939273522816,-4.5761480824035993e-5,-5.106372503209461e-8,-0.00195579066288265,-4.570401845100373e-5,-5.101104052329391e-8,-0.001955622211363207,-4.570476038673568e-5,-5.101566680936453e-8,-0.001955410378080181,-4.575298140689403e-5,-5.1067700552761083e-8,-0.0019551355106216866,-4.5828851541139104e-5,-5.114829612455283e-8,-0.0019547856381423576,-4.590392133545704e-5,-5.122995115968192e-8,-0.001954361197611504,-4.594364275569868e-5,-5.127880370114713e-8,-0.001953879361532978,-4.591336545457481e-5,-5.126044894606853e-8,-0.001953375159198017,-4.5788157126795125e-5,-5.114965466945004e-8,-0.0019528960573228693,-4.556404200060815e-5,-5.094156483201756e-8,-0.0019524888638265663,-4.52650121756844e-5,-5.0658773399677315e-8,-0.0019521829510683111,-4.493969555783338e-5,-5.03482415102804e-8,-0.001951978224705543,-4.4646436883604996e-5,-5.006686001308755e-8,-0.0019518449631389671,-4.4433199757164185e-5,-4.9861909053352045e-8,-0.0019517355290165363,-4.43223575013476e-5,-4.9756164208185047e-8,-0.0019516011374687279,-4.430667685873654e-5,-4.9743737900243164e-8,-0.0019514058087092413,-4.4355660121435736e-5,-4.979589561049797e-8,-0.0019511334488388776,-4.442707829644108e-5,-4.987196748279403e-8,-0.0019507882121724506,-4.4478635729643045e-5,-4.993057447552316e-8,-0.0019503903208332868,-4.447687118184344e-5,-4.9938400968221414e-8,-0.0019499696523796678,-4.440237013879302e-5,-4.9875550740711113e-8,-0.0019495587983859016,-4.425144642123595e-5,-4.973750799595954e-8,-0.0019491867583722598,-4.403481674939329e-5,-4.953408613857425e-8,-0.001948874170726926,-4.3773966244990976e-5,-4.928597425302703e-8,-0.0019486306854478142,-4.3496186610003896e-5,-4.901984567298104e-8,-0.0019484545808215287,-4.322941742227304e-5,-4.876319520040075e-8,-0.0019483342448092852,-4.299784164805793e-5,-4.853991498678627e-8,-0.0019482508367361243,-4.281882578092175e-5,-4.8367249272998265E-08,-0.0019481813406516451,-4.2701332047739913e-5,-4.8254265238426306e-8,-0.001948101431884755,-4.2645465612550796e-5,-4.820147285858156e-8,-0.0019479880023605153,-4.2642663695294445e-5,-4.820104258643957e-8,-0.0019478215084132696,-4.267621983914629e-5,-4.823725928348993e-8,-0.0019475884766814169,-4.2722120831818105e-5,-4.8287176766687065e-8,-0.001947284537476418,-4.2750605376743135e-5,-4.832193112023108e-8,-0.0019469179020162252,-4.272943149953421e-5,-4.830978464674593e-8,-0.001946512130701754,-4.2629987351193034e-5,-4.8222103668448865e-8,-0.0019461057920909896,-4.243645483759409e-5,-4.804249139879382e-8,-0.0019457459924259364,-4.2155871844775294e-5,-4.777688442978733e-8,-0.001945474433914433,-4.182357814670306e-5,-4.745909633402526e-8,-0.0019453099923769398,-4.149726260691403e-5,-4.7145127891331156e-8,-0.0019452376149965635,-4.123797713130104e-5,-4.689469161507122e-8,-0.0019452123501192205,-4.108646923628689e-5,-4.67481344270079e-8,-0.0019451775408544185,-4.104846697515171e-5,-4.671199913017461e-8,-0.001945086305653114,-4.10964890190002e-5,-4.67605464329462e-8,-0.00194491498170104,-4.118420798055841e-5,-4.6849415350206084e-8,-0.0019446649566739968,-4.1263439193324884e-5,-4.693190382853436e-8,-0.0019443564891179575,-4.129638690638195e-5,-4.6970831215838533e-8,-0.001944019871009889,-4.126124977537125e-5,-4.694416268183079e-8,-0.0019436874568431314,-4.115267744009283e-5,-4.6845757576426216e-8,-0.0019433878283089455,-4.097933082895468e-5,-4.668329117893592e-8,-0.0019431420227587768,-4.076018683375537e-5,-4.64748293924473e-8,-0.001942961425049852,-4.052037587530838e-5,-4.624478413720799e-8,-0.001942847090506267,-4.028693694379081e-5,-4.6019666043409794e-8,-0.001942790358890472,-4.008483999357206e-5,-4.5824064376144906e-8,-0.0019427745871054582,-3.9933607897037706e-5,-4.5677259981585586e-8,-0.0019427777616891982,-3.984486508728241e-5,-4.559083113158273e-8,-0.0019427755865315058,-3.982107608163827e-5,-4.556748866183424e-8,-0.0019427445679542873,-3.985544668643988e-5,-4.5601049016244416e-8,-0.0019426648249855798,-3.9932722126588916e-5,-4.5677213148583996e-8,-0.0019425225723483325,-4.003067731752825e-5,-4.577491057145826e-8,-0.00194231231186212,-4.0122223590998573e-5,-4.586815250812175e-8,-0.001942038840723702,-4.017825071467646e-5,-4.592859500544757e-8,-0.0019417189403766162,-4.017172995117602e-5,-4.592943591477745e-8,-0.0019413817963929902,-4.0083668653272205e-5,-4.5851299075569445e-8,-0.0019410663758636533,-3.9910612776753746e-5,-4.5689797651230024e-8,-0.0019408138567119492,-3.9671609827259084e-5,-4.546263553447091e-8,-0.0019406546006421536,-3.941021451110704e-5,-4.52117972507066e-8,-0.001940593319235403,-3.918608994782784e-5,-4.499543804327817e-8,-0.0019406012767298,-3.905498590278002e-5,-4.486832358067523e-8,-0.001940623920404477,-3.904542284858823e-5,-4.4859006867683975e-8,-0.0019406025544464632,-3.914639483061919e-5,-4.495769578301747e-8,-0.001940497520876102,-3.931411884703988e-5,-4.512260307194805e-8,-0.001940299698239888,-3.949212761192832e-5,-4.5299254342045724e-8,-0.0019400271696272137,-3.9631546521015266e-5,-4.5440050246729585e-8,-0.0019397134945464904,-3.970249901148748e-5,-4.55153769119164e-8,-0.0019393955892964717,-3.969592038203203e-5,-4.551557626730208e-8,-0.0019391053846128947,-3.961966037424788e-5,-4.544745102453445e-8,-0.0019388656601532564,-3.9492805816283906e-5,-4.532898685003671e-8,-0.0019386887618311728,-3.9340423201373115e-5,-4.518433473733331e-8,-0.0019385768153243493,-3.9189313030825355e-5,-4.5039624737876385e-8,-0.0019385226755074644,-3.9064588188579694e-5,-4.491950007652083e-8,-0.0019385113945777103,-3.89868350713039e-5,-4.4844233237342264e-8,-0.0019385222021650083,-3.8969763524809525e-5,-4.48273957066787e-8,-0.0019385310528990875,-3.9018436577778017e-5,-4.4874176736247263E-08,-0.001938513684450707,-3.912838732750907e-5,-4.498060099930697e-8,-0.0019384488723173468,-3.928589530112374e-5,-4.51338353807561e-8,-0.001938321483040145,-3.946943857740446e-5,-4.531354277085539e-8,-0.0019381250107120861,-3.965222629013153e-5,-4.5494184057548586e-8,-0.0019378633026130548,-3.9805684583894356e-5,-4.5648196322549064e-8,-0.0019375512317700392,-3.990367219926965e-5,-4.574992768613837e-8,-0.0019372141057675222,-3.9927275177831916e-5,-4.5780279834495175e-8,-0.0019368852732491004,-3.987006414845319e-5,-4.573198875575406e-8,-0.0019366009982821448,-3.9743041431457964e-5,-4.561474398462704e-8,-0.001936392008214114,-3.9577268369624826e-5,-4.545806912288991e-8,-0.0019362725887905185,-3.9421116423997146e-5,-4.530885190760244e-8,-0.0019362308367980837,-3.93293215936308e-5,-4.522070434461868e-8,-0.0019362265448863605,-3.934447117414749e-5,-4.5235796012735197e-8,-0.0019362021567699314,-3.947831204143984e-5,-4.5366449130396565e-8,-0.0019361044622756712,-3.9704499044345756e-5,-4.558787687093552e-8,-0.0019359055467726995,-3.9969038024905696e-5,-4.5848165191453386e-8,-0.001935610918476163,-4.0212436952495197e-5,-4.608967212085328e-8,-0.0019352522767100955,-4.0390248298052926e-5,-4.626892936144965e-8,-0.001934872343550989,-4.04826572347339e-5,-4.636602580928481e-8,-0.0019345110162189247,-4.0492973987788945e-5,-4.6383349171738214e-8,-0.0019341974042064007,-4.0440353373262014e-5,-4.633877244453355e-8,-0.00193394745527741,-4.035183976460438e-5,-4.6258113992407355e-8,-0.0019337648831009675,-4.025623586702828e-5,-4.6169223646382756e-8,-0.001933643297940725,-4.018010690860001e-5,-4.6098017218746215e-8,-0.0019335684391845415,-4.014524819687492e-5,-4.606588963420782e-8,-0.0019335202829593439,-4.016691288990378e-5,-4.608791074426844e-8,-0.001933475196842574,-4.025240778009302e-5,-4.617145854048994e-8,-0.0019334084174011334,-4.039999941699849e-5,-4.6315210257224784e-8,-0.0019332970460884604,-4.0598441631085976e-5,-4.6508730328468455e-8,-0.0019331234337040622,-4.0827636234276635e-5,-4.67330881859333e-8,-0.0019328784570221483,-4.1060782189105156e-5,-4.69628242270068e-8,-0.001932564016748744,-4.126806268614148e-5,-4.716934132885776e-8,-0.0019321940512386387,-4.14215942181376e-5,-4.732552837106896e-8,-0.001931793485630655,-4.1500945427768556e-5,-4.741103326315836e-8,-0.0019313948975945483,-4.149824340283206e-5,-4.741729676503009e-8,-0.0019310330346188518,-4.142188515293687e-5,-4.7351395895912765e-8,-0.0019307375352558293,-4.1297801414388954e-5,-4.723760067108958e-8,-0.0019305246932332914,-4.116693684145903e-5,-4.711522060800814e-8,-0.0019303901558369954,-4.107771840039374e-5,-4.7031429532281454e-8,-0.001930305702440573,-4.1073507327231025e-5,-4.70290097302363e-8,-0.001930223661133537,-4.117772149833033e-5,-4.71316652941459e-8,-0.0019300904151773313,-4.1382707713134946e-5,-4.733292449466249e-8,-0.0019298652063116251,-4.1649473063614e-5,-4.7595646288971316e-8,-0.0019295353407003367,-4.192078311450537e-5,-4.786461098057043e-8,-0.0019291195029987889,-4.214178037375372e-5,-4.8086494979264673e-8,-0.0019286581510240075,-4.227740391874418e-5,-4.822680388860586e-8,-0.0019281977027044515,-4.23190945630982e-5,-4.827648982478889e-8,-0.001927776949794641,-4.228093381957044e-5,-4.8248402386580654e-8,-0.0019274200721663662,-4.219051722902683e-5,-4.8168652620736966e-8,-0.001927135772707496,-4.20798850584923e-5,-4.8067954346620734e-8,-0.0019269198332215003,-4.197912027142969e-5,-4.797542280744417e-8,-0.0019267586318278405,-4.1912777277154615e-5,-4.7915023022203665e-8,-0.0019266323173630316,-4.189820026513446e-5,-4.7903834928403336e-8,-0.0019265173637764677,-4.194471819140883e-5,-4.795122144177823e-8,-0.0019263888011234276,-4.205308385953557e-5,-4.805829680961167e-8,-0.0019262225974915343,-4.221501646557592e-5,-4.821751718558146e-8,-0.0019259985568891125,-4.2413183674726635e-5,-4.8412658231367925e-8,-0.0019257037357562376,-4.262227688328076e-5,-4.861977364178274e-8,-0.0019253358507307667,-4.281183412618318e-5,-4.88097763412886e-8,-0.0019249056464002532,-4.295109158693287e-5,-4.895296804974039e-8,-0.00192443696510101,-4.3015405547280085e-5,-4.9025146674251664e-8,-0.001923963576351099,-4.299286159649854e-5,-4.901401418858055e-8,-0.0019235227456985294,-4.288907110417211e-5,-4.892397352513479e-8,-0.0019231466972611288,-4.2728295806226845e-5,-4.8777489495455956e-8,-0.0019228540148536525,-4.2549887097491935e-5,-4.861195243355361e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json
new file mode 100644
index 0000000..771149a
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":10000,"numberOfSamples":1000,"samples":[1.9197471616856318e-4,7.996600532056201e-6,-1.2597360486632112e-8,1.923979354906972e-4,8.059544161443208e-6,-1.2601754449986743e-8,1.9274745963100852e-4,8.18217092448731e-6,-1.2612185701149497e-8,1.9301410614298842e-4,8.328459694631899e-6,-1.2625220207854334e-8,1.9320200661086356e-4,8.46367290461882e-6,-1.263746635903232e-8,1.933256574311564e-4,8.557979990756902e-6,-1.264596926377846e-8,1.9340729897750835e-4,8.588749871695277e-6,-1.2648467217789009e-8,1.9347454382165973e-4,8.54234886551231e-6,-1.2643575641672086e-8,1.9355780445299317e-4,8.41580428718647e-6,-1.2630935191527253e-8,1.9368703586457032e-4,8.218144650907273e-6,-1.2611321617725655e-8,1.9388759494511673e-4,7.970728457914735e-6,-1.2586673932584885e-8,1.9417557384287807e-4,7.70570255454025e-6,-1.2559972916060515e-8,1.9455353413614596e-4,7.461994170668981e-6,-1.2534909842557773e-8,1.950079268750979e-4,7.278838435440244e-6,-1.2515320800328438e-8,1.9550946566497787e-4,7.1877009230743185e-6,-1.250443183656935e-8,1.9601716991058025e-4,7.204296880679899e-6,-1.2504049076168112e-8,1.964858622143666e-4,7.322751895738212e-6,-1.2513893072518937e-8,1.9687601817327312e-4,7.513719443070609e-6,-1.2531293180978063e-8,1.9716418145619786e-4,7.727807131336245e-6,-1.255143733487227e-8,1.9735148270881055e-4,7.904972006017888e-6,-1.256828984627858e-8,1.9746717430474582e-4,7.989189307001313e-6,-1.2576107854737417e-8,1.9756414464783983e-4,7.945391162788686e-6,-1.2571208909452543e-8,1.9770522673983343e-4,7.772936988045046e-6,-1.255336219063038e-8,1.9794335851555265e-4,7.508737590816236e-6,-1.2526112219574885e-8,1.9830340643788719e-4,7.216310774252375e-6,-1.2495704511570225e-8,1.9877444051722307e-4,6.9643475770128966e-6,-1.2468991956480241e-8,1.9931605492441463e-4,6.804754497374457e-6,-1.2451273955690413e-8,1.99874367496323e-4,6.7599548302468994e-6,-1.2444993679265321e-8,2.0039900027274713e-4,6.82270849799812e-6,-1.2449629419202722e-8,2.0085428305204736e-4,6.964723431631095e-6,-1.2462470630692901e-8,2.012230129828281e-4,7.147810040913146e-6,-1.2479705950981818e-8,2.015048844233702e-4,7.3331078822919305e-6,-1.2497376827881843e-8,2.0171260728942556e-4,7.4869143007848404e-6,-1.2512018298014086e-8,2.0186784837753266e-4,7.583663846056725e-6,-1.2521002574264202e-8,2.0199788115223623e-4,7.6072954724533325e-6,-1.252268798054521e-8,2.0213287762151582e-4,7.552075776678594e-6,-1.25164799413586e-8,2.023032713093168e-4,7.423389313956485e-6,-1.250287524528341e-8,2.025365492604393e-4,7.238354929979809e-6,-1.2483501654253962e-8,2.0285312487000682e-4,7.025543178481034e-6,-1.2461102098633864e-8,2.032615548180566e-4,6.822697696785637e-6,-1.2439358398961576e-8,2.037542292355152e-4,6.671464949679808e-6,-1.2422433892723618e-8,2.043054648544205e-4,6.609017340781519e-6,-1.241418367286807e-8,2.0487402079284614e-4,6.658061470286973e-6,-1.2417141084804209e-8,2.0541091916908847e-4,6.8183286453880834e-6,-1.2431576848491557e-8,2.0587131297464264e-4,7.063148440915905e-6,-1.2455025250029365e-8,2.0622704282800456e-4,7.343452105811302e-6,-1.2482583077772363e-8,2.064756840198449e-4,7.598950788494315e-6,-1.2508013979414962e-8,2.0664282168786132e-4,7.773572333271332e-6,-1.2525372054527937e-8,2.0677643799377142e-4,7.830732911241555e-6,-1.2530654293509096e-8,2.069346139971509e-4,7.763969732585166e-6,-1.252297208136234e-8,2.0716968071363143e-4,7.599507240572051e-6,-1.2504868071919612e-8,2.075133831394106e-4,7.389324388835024e-6,-1.2481637303243253e-8,2.079680047158014e-4,7.196295440443784e-6,-1.2459822238997104e-8,2.0850678511286473e-4,7.076223630712314e-6,-1.2445361216516968e-8,2.09083353603553e-4,7.063208010991012e-6,-1.2442027977015235e-8,2.0964607359171694e-4,7.163288146015455e-6,-1.245068068918884e-8,2.1015153998119444e-4,7.357300167494584e-6,-1.2469466055778998e-8,2.105729208467013e-4,7.6098914082299795e-6,-1.2494715588623496e-8,2.1090206952705673e-4,7.880059152858419e-6,-1.2522068534104855e-8,2.1114705135521922e-4,8.129688725332927e-6,-1.2547426277362978e-8,2.11327623932954e-4,8.328785948689606e-6,-1.2567558359396523e-8,2.1147063027153733e-4,8.45781981905388e-6,-1.2580371063842255e-8,2.116062170779773e-4,8.508318739735103e-6,-1.2584953522756101e-8,2.1176489219544155e-4,8.482821664273282e-6,-1.2581533889456395e-8,2.1197487908306462e-4,8.394780190546323e-6,-1.2571439050506965e-8,2.1225908578335732e-4,8.268336110121104e-6,-1.2557075378613995e-8,2.1263125815806694e-4,8.137282943263268e-6,-1.2541867403695375e-8,2.1309149641396343e-4,8.042041677157666e-6,-1.2530015745409708e-8,2.1362232923984473e-4,8.023413973770414e-6,-1.2525906367685887e-8,2.141877185477536e-4,8.112834049185048e-6,-1.2533095524318957e-8,2.1473774581068903e-4,8.3210914871919e-6,-1.2553050116063849e-8,2.1522011129794914e-4,8.630080126066386e-6,-1.2584142235542132e-8,2.1559591766686086e-4,8.992908412392393e-6,-1.2621531987775295e-8,2.1585357677476676e-4,9.344915051726786e-6,-1.2658284937238318e-8,2.1601416666211921e-4,9.622593263837225e-6,-1.2687427039128446e-8,2.1612534488552648e-4,9.78287653756447e-6,-1.2704087855205246e-8,2.1624652249650514e-4,9.81514982519467e-6,-1.2706860844017089e-8,2.1643148366610137e-4,9.742398905621779e-6,-1.2697982257149455e-8,2.1671439125053968e-4,9.612686075077394e-6,-1.2682472194826136e-8,2.1710262618754617e-4,9.484942883597433e-6,-1.2666663487275253e-8,2.1757724992220657e-4,9.413689438536168e-6,-1.2656583095773519e-8,2.180998881122663e-4,9.436636301726828e-6,-1.2656579120301334e-8,2.1862349866680082e-4,9.567821662343242e-6,-1.2668481926430359e-8,2.1910382506955763e-4,9.797254291937394e-6,-1.2691451235088495e-8,2.1950852180187367e-4,1.0096209406878957e-5,-1.2722473686840802e-8,2.1982203208259762e-4,1.0425814221374339e-5,-1.2757289563240955e-8,2.2004593990235762e-4,1.0746017377170483e-5,-1.279141904043139e-8,2.2019594725035345e-4,1.1022697089033848e-5,-1.2821004358988786e-8,2.2029723714439854e-4,1.1231954282858246e-5,-1.284332207805951e-8,2.2037976133546005e-4,1.1361792925413278e-5,-1.285697045584737e-8,2.204743050715671e-4,1.1412058566647195e-5,-1.2861837839761607e-8,2.2060942735678435e-4,1.139360836886871e-5,-1.2858986747465736e-8,2.2080886496210573e-4,1.1327297175898568e-5,-1.2850546480647196e-8,2.2108883199633075e-4,1.1242779422350658e-5,-1.2839626876663463e-8,2.2145479727229533e-4,1.117656313941561e-5,-1.2830179748791994e-8,2.218978524119614e-4,1.1168241380550244e-5,-1.2826654765479383e-8,2.223918274118358e-4,1.125368271022084e-5,-1.2833271066266854e-8,2.2289360923823234e-4,1.1454892795233024e-5,-1.2852838922138324e-8,2.2334970247736352e-4,1.1768728623398749e-5,-1.288537714386462e-8,2.2371036423718345e-4,1.2159917386077626e-5,-1.2927189221052759e-8,2.2394786325905398e-4,1.2565129918165497e-5,-1.2971236046903973e-8,2.2407012789687003e-4,1.2910776320851335e-5,-1.3009149058543156e-8,2.2412080512659326e-4,1.3138423398335554e-5,-1.3034156281509835e-8,2.2416403518024246e-4,1.3225258584550226e-5,-1.3043432270151873e-8,2.242617193073924e-4,1.31895428771349e-5,-1.303873108036752e-8,2.244545122747121e-4,1.3080514119203897e-5,-1.302529805681681e-8,2.247533541484739e-4,1.2960154137190002e-5,-1.3009918312410972e-8,2.2514149681588606e-4,1.288542370013457e-5,-1.2999015386017868e-8,2.2558304221404233e-4,1.2896057941767493e-5,-1.2997297157850649e-8,2.2603369392279116e-4,1.3009117176953077e-5,-1.3007061790201875e-8,2.264507770082446e-4,1.3219243737167519e-5,-1.3028087674737915e-8,2.2680097981678127e-4,1.3502917845584759e-5,-1.3057987443448877e-8,2.2706512925085745e-4,1.3825112165154655e-5,-1.3092899943215674e-8,2.2723980182644377e-4,1.4146844760246526e-5,-1.312835960370297e-8,2.2733606659061404e-4,1.4432176615984899e-5,-1.316015072754668e-8,2.2737613010144923e-4,1.4653552288310205e-5,-1.3184975709050629e-8,2.2738889061095103e-4,1.4794967275872633e-5,-1.3200846957566375e-8,2.2740539458427508e-4,1.485298630857986e-5,-1.3207200828708261e-8,2.2745491914188558e-4,1.48361020505556e-5,-1.3204810600297655e-8,2.2756189301271438e-4,1.4763163136429955e-5,-1.3195611648549548e-8,2.2774342945347363e-4,1.4661392768367974e-5,-1.318251654013457e-8,2.2800711646406744e-4,1.4564073938727435e-5,-1.3169225227622847e-8,2.2834878588194946e-4,1.4507553748530596e-5,-1.3159958692847593e-8,2.287503519544513e-4,1.4526782542924386e-5,-1.3158983635572145e-8,2.2917872878590236e-4,1.4648464790645952e-5,-1.3169782666393387e-8,2.2958798770619958e-4,1.4881779191418465e-5,-1.3193861131791164e-8,2.2992738155013117e-4,1.5208892056563145e-5,-1.3229487616666131e-8,2.3015629354228862e-4,1.5580637661667213e-5,-1.3271075564489491e-8,2.3026234150305317e-4,1.5924292688085457e-5,-1.331008459441756e-8,2.3027280889853033e-4,1.6165999528322054e-5,-1.3337725131374554e-8,2.3024916735463958e-4,1.6259694822258185e-5,-1.3348408049319169e-8,2.3026415545918469e-4,1.6206222473384533e-5,-1.334196191813377e-8,2.303737207873722e-4,1.6050930760160185e-5,-1.3323325049974134e-8,2.3059936656605264e-4,1.586282236461781e-5,-1.3300188674521488e-8,2.309273397309413e-4,1.5709080036263402e-5,-1.328019137069129e-8,2.3131987266427655e-4,1.5637160807724585e-5,-1.3268952807786755e-8,2.3172978464227394e-4,1.5668110115491378e-5,-1.3269276372437528e-8,2.3211253167230013e-4,1.579838872190477e-5,-1.3281222326984168e-8,2.3243381968418038e-4,1.6005968044664794e-5,-1.3302645758738719e-8,2.326732628860945e-4,1.6257565449448583e-5,-1.3329918467555854e-8,2.3282524674238283e-4,1.651551762610959e-5,-1.3358697686405669e-8,2.3289788056306504e-4,1.674381866600482e-5,-1.3384673664069943e-8,2.3291052997145164e-4,1.6913063406322665e-5,-1.3404220672953126e-8,2.3289032072172143e-4,1.700401500413197e-5,-1.3414875180816028e-8,2.3286803858424185e-4,1.7009620439693355e-5,-1.3415595856352999e-8,2.328739025738482e-4,1.6935397883075238e-5,-1.3406804390503862e-8,2.3293373693946084e-4,1.6798289595216762e-5,-1.3390246403408823e-8,2.3306590757557672e-4,1.6624355851294292e-5,-1.3368746419574027e-8,2.3327907598190837e-4,1.6445739810291813e-5,-1.334591547674048e-8,2.3357067709120252e-4,1.6297106752196225e-5,-1.3325815392409889e-8,2.3392604926032666e-4,1.621152078481189e-5,-1.3312532903507163e-8,2.3431832644508823e-4,1.6215461539974096e-5,-1.3309583151627188e-8,2.3470981296471905e-4,1.6322593851986297e-5,-1.3319074542987742e-8,2.350563586266793e-4,1.6526652827706943e-5,-1.3340700335972787e-8,2.3531635632917516e-4,1.6795606538324656e-5,-1.3370882993466678e-8,2.3546449597391608e-4,1.7071515543042718e-5,-1.3402687449686616e-8,2.3550651143611578e-4,1.7281479296035646e-5,-1.3427194538859864e-8,2.354860662292638e-4,1.736119067195648e-5,-1.3436455207389577e-8,2.354745423562714e-4,1.7282664410910297e-5,-1.3426879119078932e-8,2.3554413988636483e-4,1.7069422488256228e-5,-1.340100684306105e-8,2.3573843359821594e-4,1.678735137254538e-5,-1.3366380140959267e-8,2.3605794175604995e-4,1.6516440745440828e-5,-1.333226482032832e-8,2.364666128436858e-4,1.6321330128306323e-5,-1.3306309980540544e-8,2.369106704107837e-4,1.6235316784717564e-5,-1.329272307712745e-8,2.373372411284009e-4,1.6259841608278305e-5,-1.3292124623119489e-8,2.3770594596677692e-4,1.6372931299750227e-5,-1.3302373390412671e-8,2.37993246071328e-4,1.6539681380754335e-5,-1.3319651568231e-8,2.3819211939730327e-4,1.6721074059761234e-5,-1.3339438365960858e-8,2.3830961030271236e-4,1.6880231173799742e-5,-1.335727306140373e-8,2.3836375681855868e-4,1.6986636247061285e-5,-1.3369334013755532e-8,2.3838035533166568e-4,1.701905501777484e-5,-1.33728675782703e-8,2.383895323005555e-4,1.6967478698558967e-5,-1.3366467989198284e-8,2.38422070556946e-4,1.6834089647268072e-5,-1.3350197399653409e-8,2.3850556570700744e-4,1.6633066038275236e-5,-1.3325545739040455e-8,2.3866072662191243e-4,1.6388979589520194e-5,-1.32952356240298e-8,2.3889832942241776e-4,1.613376763873816e-5,-1.3262897145540119e-8,2.3921726251748584e-4,1.5902571416136462e-5,-1.3232645062727092e-8,2.3960391772207974e-4,1.5728837101970084e-5,-1.3208572512056224e-8,2.4003306897066437e-4,1.5639090729009958e-5,-1.3194159292205045e-8,2.4047031694471747e-4,1.5647770280759835e-5,-1.3191601366742145e-8,2.408763192909911e-4,1.5752441997243236e-5,-1.320109658813078e-8,2.4121332685415593e-4,1.593012198481269e-5,-1.3220221033409507e-8,2.414543324312317e-4,1.6136500786482835e-5,-1.3243695130072412e-8,2.4159379503856346e-4,1.631092961927605e-5,-1.3263965868818756e-8,2.416563493402631e-4,1.6389819439386743e-5,-1.327294423034196e-8,2.416971351728686e-4,1.6327839253466488e-5,-1.3264745691624821e-8,2.4178793488179986e-4,1.611933231700696e-5,-1.323839068662466e-8,2.4199092390150611e-4,1.580664719687679e-5,-1.3198809867441091e-8,2.4233282522947923e-4,1.546635588883893e-5,-1.315515486800695e-8,2.42795161206397e-4,1.5179028049018296e-5,-1.3117189496490207e-8,2.4332560646111933e-4,1.5000197877739287e-5,-1.3091844309906427e-8,2.4386095630435782e-4,1.494730909943296e-5,-1.3081612462610715e-8,2.443476230301867e-4,1.5004081626133282e-5,-1.3084945993000656e-8,2.447521154769013e-4,1.513382584235183e-5,-1.3097713318885834e-8,2.4506227529865664e-4,1.529290726155764e-5,-1.3114741963102495e-8,2.4528352222681816e-4,1.5440210476210758e-5,-1.3130971246521739e-8,2.454337577216843e-4,1.554235342838633e-5,-1.3142157207141877e-8,2.4553879145722154e-4,1.5576059836117717e-5,-1.3145250706278301e-8,2.456286535961741e-4,1.5529165859651303e-5,-1.313858102750454e-8,2.4573440156436537e-4,1.5401067537156352e-5,-1.312192399297445e-8,2.4588495016140917e-4,1.5202739157127264e-5,-1.3096479904399723e-8,2.4610367254958987e-4,1.4956012999883382e-5,-1.3064759078539774e-8,2.4640490122437197e-4,1.4691580503364029e-5,-1.3030343464314749e-8,2.467909300514352e-4,1.444531172938255e-5,-1.299749108332309e-8,2.472503716788958e-4,1.4252978327617077e-5,-1.2970574858005676e-8,2.4775861981413225e-4,1.4143991993889015e-5,-1.2953383025503955e-8,2.482808292580495e-4,1.4135196216785739e-5,-1.2948356913590524e-8,2.4877732410946555e-4,1.4225995061342692e-5,-1.295589775406787e-8,2.492108317402965e-4,1.439598151292376e-5,-1.297390984283666e-8,2.495546496005041e-4,1.4605934664835293e-5,-1.2997753852338253e-8,2.4980058126312243e-4,1.4802976706468473e-5,-1.3020791083393111e-8,2.499648122532091e-4,1.4930522578149964e-5,-1.3035648974352602e-8,2.500889719183307e-4,1.4942625206491755e-5,-1.3036141981384923e-8,2.502332948927713e-4,1.4819937637970325e-5,-1.301942657528763e-8,2.5046053996871437e-4,1.458121681939785e-5,-1.2987549154608683e-8,2.508142835955966e-4,1.4282610184457833e-5,-1.294739872783118e-8,2.513011655620707e-4,1.4000896174505066e-5,-1.2908626141535389e-8,2.5188749805877945e-4,1.3806467779425598e-5,-1.288027326783674e-8,2.5251290861910285e-4,1.3739666020847875e-5,-1.286777210466249e-8,2.531129543478528e-4,1.3801980509944972e-5,-1.2871727408598455e-8,2.5363851477171943e-4,1.3963248403024858e-5,-1.288867324663838e-8,2.5406475771490327e-4,1.4177059797621997e-5,-1.2912910633960826e-8,2.543902585935145e-4,1.4395467555977205e-5,-1.2938351134914312e-8,2.5463093937902145e-4,1.457846819591566e-5,-1.295977796036463e-8,2.54813136638039e-4,1.4698160028561238e-5,-1.2973461632588474e-8,2.54967981581639e-4,1.4739503755468211e-5,-1.2977324579518188e-8,2.551274405562864e-4,1.4699654562096109e-5,-1.2970877284779953e-8,2.5532142348084824e-4,1.4587027197628657e-5,-1.2955077061468487e-8,2.5557518672666003e-4,1.4420380583572636e-5,-1.2932175481281603e-8,2.5590650103593743e-4,1.4227567224019883e-5,-1.2905548350362233e-8,2.5632253366152845e-4,1.4043212860365394e-5,-1.287943866108471e-8,2.568170361656435e-4,1.3904585536052271e-5,-1.285851192094646e-8,2.5736901125437294e-4,1.384542362248093e-5,-1.2847155402873307e-8,2.5794421239109947e-4,1.388843946076878e-5,-1.2848556465930347e-8,2.5850035030317047e-4,1.403829277109537e-5,-1.2863749847957166e-8,2.589956924459188e-4,1.4277505943607658e-5,-1.2890953907157057e-8,2.5939924357184515e-4,1.4567459494134127e-5,-1.2925525776831505e-8,2.596996993209261e-4,1.4855178454192225e-5,-1.2960705554380696e-8,2.5991041763439313e-4,1.5084813281586183e-5,-1.2989066766874659e-8,2.6006856585053105e-4,1.5211326349834672e-5,-1.3004361087109885e-8,2.602278725687631e-4,1.5213126500508729e-5,-1.3003294012197764e-8,2.6044583194747623e-4,1.5100107540589441e-5,-1.2986715711409487e-8,2.607678954750293e-4,1.4913817381501574e-5,-1.2959760458590743e-8,2.6121309337834975e-4,1.471789554231206e-5,-1.2930675613196354e-8,2.617666739936158e-4,1.4580147819581488e-5,-1.2908507750034461e-8,2.623838952785086e-4,1.4551998820653167e-5,-1.2900372867353652e-8,2.6300436611455946e-4,1.465364176688067e-5,-1.2909389577639032e-8,2.6357084573760297e-4,1.4871017273617807e-5,-1.293411963262422e-8,2.640443869669923e-4,1.5164543154651873e-5,-1.2969586613798102e-8,2.64410737769705e-4,1.548385098723045e-5,-1.3009177614068972e-8,2.6467821443590807e-4,1.5781554620764703e-5,-1.304650817055167e-8,2.648707916531887e-4,1.602193715049497e-5,-1.3076659266674922e-8,2.650204220774552e-4,1.6184189121099728e-5,-1.309668323525758e-8,0.00026516090400317593,1.626199634794566e-5,-1.3105583832666333e-8,2.653238016446657e-4,1.626157432670227e-5,-1.3104045518856175e-8,2.6553584872296177e-4,1.619953400725645e-5,-1.3094120073806924e-8,2.6581694404772865e-4,1.6101034287601604e-5,-1.3078966785871532e-8,2.6617803512994057e-4,1.599792643257314e-5,-1.3062635061321467e-8,2.666186743112128e-4,1.5926127147520803e-5,-1.3049789195619948e-8,2.671247177812508e-4,1.5921303481340893e-5,-1.3045222202262528e-8,2.6766743265218185e-4,1.6012313493671894e-5,-1.3053032308258361e-8,2.682058449019524e-4,1.6212993883764293e-5,-1.3075494404843321e-8,2.6869381754198406e-4,1.6514662380160417e-5,-1.3111934310112453e-8,2.690915392547794e-4,1.688312459406304e-5,-1.3158158531168263e-8,2.693782808806831e-4,1.726356887424719e-5,-1.3206971608799833e-8,2.695612194819721e-4,1.7593764377538284e-5,-1.3249899145305468e-8,2.696757969225932e-4,1.7821710710339604e-5,-1.3279603194733367e-8,2.697766262792751e-4,1.7921174890309415e-5,-1.3292069257397106e-8,2.699221571586634e-4,1.7899381168918985e-5,-1.3287759748585721e-8,2.701585140051222e-4,1.7794662659770487e-5,-1.3271427248333769e-8,2.7050743193193414e-4,1.7665574219650932e-5,-1.3250774476406711e-8,2.70961263500747e-4,1.7575149467220522e-5,-1.3234415117476824e-8,2.714859046544607e-4,1.7574737909080554e-5,-1.3229680863399421e-8,2.7203052331977687e-4,1.769170100835547e-5,-1.324083414757745e-8,2.7254117585821244e-4,1.7924189075479015e-5,-1.3268167506586092e-8,2.729741997691505e-4,1.8244128847031433e-5,-1.3308232751599827e-8,2.733054105239225e-4,1.860683481743521e-5,-1.335506308671976e-8,2.7353289682521516e-4,1.896345349760831e-5,-1.3401893664246537E-08,2.73673842637392e-4,1.9271996265799993e-5,-1.3442759869942829e-8,2.737578282615282e-4,1.9504213337008058e-5,-1.3473535503050086e-8,2.738194967147241e-4,1.9647848480923535e-5,-1.3492301040760689e-8,2.7389256852830313e-4,1.9705491001702175e-5,-1.3499197079042159e-8,2.740058704701865e-4,1.9691777654711647e-5,-1.3496023246278775e-8,2.741810262902575e-4,1.9630334079578346e-5,-1.3485807494797274e-8,2.744310131178127e-4,1.9551058078948304e-5,-1.347245824705066e-8,2.747588655876082e-4,1.948759434125028e-5,-1.3460484076347776e-8,2.7515620852405575e-4,1.9474357175009086e-5,-1.3454669802832967e-8,2.7560192124283077e-4,1.954221941430565e-5,-1.3459536895858992e-8,2.760620815654129e-4,1.9712188518429024e-5,-1.3478446229307413e-8,2.764931140341487e-4,1.998747860898367e-5,-1.3512381587099931e-8,2.768499825458415e-4,2.0346447047745347e-5,-1.3558791588758346e-8,2.7709934818909317e-4,2.0740975236487897e-5,-1.3611211001438215e-8,2.7723376707050325e-4,2.1104902391710272e-5,-1.3660381144345922e-8,2.7727951721184677e-4,2.1372977512600064e-5,-1.3696942301516698e-8,2.7729156569639065e-4,2.150364337470411e-5,-1.371469511192883e-8,2.7733590146886866e-4,2.1494482605572527e-5,-1.3712813986364758e-8,2.7746730910535865e-4,2.1382407878183956e-5,-1.3695935779833347e-8,2.777129170467314e-4,2.1229571564400812e-5,-1.3672319050985458e-8,2.7806720281447627e-4,2.1102980963536406e-5,-1.3651166775522754e-8,2.7849753778370835e-4,2.105639774177976e-5,-1.3640203101975407e-8,2.7895571606205595e-4,2.1119312740397868e-5,-1.36440855384151e-8,2.7939082054513723e-4,2.129380639205303e-5,-1.3663777942921247e-8,2.797602560487331e-4,2.155785003144518e-5,-1.3696778046641539e-8,2.8003725820557e-4,2.1872858482824725e-5,-1.3738005196123418e-8,2.802142004107094e-4,2.219328394309847e-5,-1.3781099702460829e-8,2.8030175709160225e-4,2.2476143948988695e-5,-1.381982555271776e-8,2.8032472939190016e-4,2.268859947612066e-5,-1.3849251125167231e-8,2.803159812312574e-4,2.2812371570131774e-5,-1.386647093141835e-8,2.803101183459111e-4,2.2844791364820303e-5,-1.387080182051307e-8,2.8033821087907477e-4,2.2797146171930603e-5,-1.3863552789390385e-8,2.8042420340903043e-4,2.2691458727297488e-5,-1.3847561307081722e-8,2.8058292600206835e-4,2.2556824850266946e-5,-1.3826691726476474e-8,2.8081916298474405e-4,2.2425953925453616e-5,-1.3805403994071266e-8,2.8112721903985157e-4,2.2331951025042324e-5,-1.3788383591687185e-8,2.8149066344888076e-4,2.2304951530066296e-5,-1.3780134438421739e-8,2.8188238547674434e-4,2.2367947560152177e-5,-1.3784386060479597e-8,2.822658721965546e-4,2.2531246589409013e-5,-1.380320444288144e-8,2.8259936195518845e-4,2.278597036190299e-5,-1.38358812243578e-8,2.828444569445365e-4,2.3098866508920356e-5,-1.3877999412904191e-8,2.82979105364523e-4,2.341279564136978e-5,-1.3921401485040897e-8,2.8301103748081484e-4,2.3657751771110462e-5,-1.3955814384309308e-8,2.8298340770177647e-4,2.37731328817469e-5,-1.3972176264270338e-8,2.8296484207766603e-4,2.3733029889624773e-5,-1.3966353021702428e-8,2.830249037760498e-4,2.3559828091315065e-5,-1.3941085550751729e-8,2.832073180871705e-4,2.331632681640619e-5,-1.3904875495648811e-8,2.8351576155621184e-4,2.308077284889224e-5,-1.3868553787955135e-8,2.8391769853862014e-4,2.2919547763551398e-5,-1.384157822144315e-8,2.8436019434869387e-4,2.287017449835268e-5,-1.3829694080640847e-8,2.847876469600927e-4,2.2937814065198065e-5,-1.3834319348602738e-8,2.8515485284144533e-4,2.3101223801610495e-5,-1.3853146215244e-8,2.85433793371567e-4,2.332264590269975e-5,-1.3881308460203237e-8,2.856153143340677e-4,2.3557815709961442e-5,-1.3912679492992264e-8,2.857074693224336e-4,2.3764383273789843e-5,-1.3941085356826256e-8,2.8573186713930584e-4,2.390828726211465e-5,-1.3961325891680267e-8,2.857188696819171e-4,2.39679560926046e-5,-1.3969911360196299e-8,2.8570231452007376e-4,2.3936257400670855e-5,-1.3965439487283113e-8,2.857144182944666e-4,2.382028199606721e-5,-1.394860030825303e-8,2.8578147687363805e-4,2.3639260037550102e-5,-1.3921869960500952e-8,2.8592084201393037e-4,2.342114432945347e-5,-1.3889012634409748e-8,2.8613931356911184e-4,2.3198585473751224e-5,-1.3854531958188717e-8,2.864327166543551e-4,2.3004883616430312e-5,-1.3823159470958645e-8,2.867863494363946e-4,2.2870125806672398e-5,-1.3799380523453057e-8,2.8717609388622425e-4,2.2817452101605205e-5,-1.378693317459741e-8,2.8757018441867614e-4,2.2859200077940465e-5,-1.378819562942302e-8,2.8793216925267906e-4,2.2992674449651844e-5,-1.3803413833910311e-8,2.8822619040308e-4,2.3196048522297792e-5,-1.3829891060439484e-8,2.8842548394305867e-4,2.3426397377221117e-5,-1.386152544402009e-8,2.885234854253173e-4,2.362330839766609e-5,-1.3889296541301406e-8,2.885438986592403e-4,2.3721722641275258e-5,-1.3903263102308176e-8,2.885424114376653e-4,2.3674183477913317e-5,-1.3896003696172715e-8,2.885929118709168e-4,2.3474313471584593e-5,-1.3866152311867126e-8,2.8875979009874574e-4,2.316637368653028e-5,-1.3819777847051538e-8,2.890704395776163e-4,2.283074746827438e-5,-1.3768264842029872e-8,2.895049885128943e-4,2.2551813469805068e-5,-1.3723757443181604e-8,2.900082669629545e-4,2.2387357101861408e-5,-1.3694865214262721e-8,2.9051374253208817e-4,2.235489612947439e-5,-1.36846867449533e-8,2.909649021340734e-4,2.2436103025525936e-5,-1.3691271872221072e-8,2.9132650488845045e-4,2.2590621258034392e-5,-1.3709370985045623e-8,2.9158637691061105e-4,2.2770429252790272e-5,-1.3732329579321405e-8,2.917517969683068e-4,2.2930448877807925e-5,-1.3753577653967498e-8,2.9184401188628566e-4,2.303489006955536e-5,-1.3767628184703838e-8,2.918927671925494e-4,2.3060445344766418e-5,-1.3770682898745772e-8,2.919314014291164e-4,2.299749274559909e-5,-1.3760937852867262e-8,2.9199247847638013e-4,2.2849926468667013e-5,-1.3738629102849638e-8,2.921039092862608e-4,2.2633834466347406e-5,-1.370584503210565e-8,2.92285666948327e-4,2.2375057960451114e-5,-1.3666144851793793e-8,2.925473850976914e-4,2.2105676829510934e-5,-1.3624037426111123e-8,2.9288716836903646e-4,2.185972836237773e-5,-1.3584395520403735e-8,2.93291734444017e-4,2.1668667070356885e-5,-1.355186975838904e-8,2.937378250344291e-4,2.1556973898122735e-5,-1.3530315087571015e-8,2.941947974500097e-4,2.1538210800188506e-5,-1.3522214675142932e-8,2.9462828965697827e-4,2.161178421989162e-5,-1.3528102494893166e-8,2.950049836659742e-4,2.176062612107966e-5,-1.3546028771640402e-8,2.9529877895283186e-4,2.1950341406551685e-5,-1.3571220417731373e-8,2.95498425036084e-4,2.2131299035723218e-5,-1.3596256341667975e-8,2.956153580837951e-4,2.22458472466366e-5,-1.361215968484941e-8,2.9568840667843486e-4,2.224225736534045e-5,-1.3610641296881544e-8,2.957800686939963e-4,2.2093977823393965e-5,-1.3587181550703598e-8,2.9595999348482825e-4,2.181678085271199e-5,-1.3543713834794471e-8,2.9627849161117025e-4,2.1471574018712877e-5,-1.3489060449153417e-8,2.9674319322068856e-4,2.1145294614123724e-5,-1.343609251827474e-8,2.9731425733706953e-4,2.09172161107864e-5,-1.3396774613550436e-8,2.9792187015270356e-4,2.082994835974585e-5,-1.3377886272534408e-8,2.984942122206886e-4,2.0880413673918396e-5,-1.3379586077781747e-8,2.989796522647844e-4,2.1030612573302552e-5,-1.3396809617098212e-8,2.993552928593664e-4,2.1226817991504233e-5,-1.3421929704689853e-8,2.9962420917402626e-4,2.141632957853267e-5,-1.3447160232838052e-8,2.998076048709863e-4,2.155742331817498e-5,-1.3466074608348756e-8,2.999366508951447e-4,2.162322261659597e-5,-1.3474303011588651e-8,3.0004605342871587e-4,2.160194083120627e-5,-1.3469704117491014e-8,3.001694758979349e-4,2.1495566477339442e-5,-1.3452259987949643e-8,3.003361714790454e-4,2.131801033581268e-5,-1.34238210598226e-8,3.00568250260884e-4,2.109291783629834e-5,-1.3387751649168571e-8,3.0087835205456256e-4,2.0850953582104578e-5,-1.3348491679679161e-8,3.012678716217725e-4,2.062624812724149e-5,-1.3311032550608233e-8,3.0172620046434173e-4,2.045193589878053e-5,-1.3280308792564854e-8,3.0223147737772435e-4,2.0355180263715515e-5,-1.3260534503027968e-8,3.027530905670879e-4,2.03523675046193e-5,-1.3254528922034592e-8,3.0325589739471393e-4,2.0445234386801097e-5,-1.326309141038214e-8,3.0370584098537583e-4,2.061873537337817e-5,-1.3284535301274032e-8,3.0407635475241393e-4,2.084132023298335e-5,-1.3314523112149486e-8,3.043548220950259e-4,2.106807932262644e-5,-1.334635951759101e-8,3.0454817712909907e-4,2.1247259597402573e-5,-1.337190847136496e-8,3.0468606841306306e-4,2.1330590886984806e-5,-1.338324729373875e-8,3.048190993710789e-4,2.1286814653441683e-5,-1.337492842426596e-8,3.0500947292813136e-4,2.1115405047104646e-5,-1.3346293728374482e-8,3.0531334240780847e-4,2.0854333144826318e-5,-1.330280661991811e-8,3.0575933228971686e-4,2.057446009779354e-5,-1.3255246543245369e-8,3.063336126043048e-4,2.035786012500672e-5,-1.3216390908366007e-8,3.0698195437051866e-4,2.0267933422058764e-5,-1.3196404367399528e-8,3.076297906607286e-4,2.0326989761099988e-5,-1.3199302777510673e-8,3.0820929098613465e-4,2.051301152374637e-5,-1.3222284594361782e-8,3.086790667643346e-4,2.0774250916837253e-5,-1.3257795354211066e-8,3.0902959140693113e-4,2.1050411845724763e-5,-1.3296685507824527e-8,3.0927719251130383e-4,2.1289582840270976e-5,-1.3330825505471842e-8,3.0945357058928e-4,2.145674944124067e-5,-1.33545105445674e-8,3.095961699201846e-4,2.153531284308726e-5,-1.3364818313685573e-8,3.0974146708267824e-4,2.152488868920895e-5,-1.3361368767381744e-8,3.0992097203242546e-4,2.1438017800151246e-5,-1.3345858365688848e-8,3.1015887202686857e-4,2.1297039816659653e-5,-1.3321563576426557e-8,3.1047036154725256e-4,2.1131275414374563e-5,-1.3292871575557973e-8,3.1086020309551777e-4,2.0974113615666323e-5,-1.3264820449894448e-8,0.00031132159469673937,2.0859458460963544e-5,-1.3242589706398116e-8,3.118358892299663e-4,2.08172018406579e-5,-1.3230876462418405e-8,3.123739556176808e-4,2.0867961619606607e-5,-1.3233145002595053e-8,3.1289980273878425e-4,2.1017999708571363e-5,-1.3250835029635484e-8,3.133765322075633e-4,2.1255710514705023e-5,-1.3282711917019378e-8,3.1377389441996034e-4,2.1551170659549085e-5,-1.332461455740315e-8,3.1407592571305155e-4,2.1859774047728385e-5,-1.3369828669154369e-8,3.1428671803730246e-4,2.212997996013805e-5,-1.3410177045357869e-8,3.14432506824964e-4,2.2314131680739853e-5,-1.3437721540724634e-8,3.1455876362506394e-4,2.2380463429616143e-5,-1.3446783871977407e-8,3.1472170043465105e-4,2.2323641852085563e-5,-1.3435813847370838e-8,3.1497476110345693e-4,2.217044112756572e-5,-1.3408494160108003e-8,3.153526234579617e-4,2.1976994096751363e-5,-1.337345682081832e-8,3.1585774444304715e-4,2.1815602165497123e-5,-1.3342262745022897e-8,3.1645594131746787e-4,2.1753230588716412e-5,-1.332596859353312e-8,3.170852855440563e-4,2.1829339986754936e-5,-1.3331486306519194e-8,3.1767609064744373e-4,2.204329336795916e-5,-1.335938578246327e-8,3.1817307131503856e-4,2.2357437282565592e-5,-1.3404182809004631e-8,3.185496252597622e-4,2.2713150253212193e-5,-1.3456770258106373e-8,3.188097318692035e-4,2.305068096859074e-5,-1.350756753269062e-8,3.1898017607109944e-4,2.3324049974074164e-5,-1.3548973772346303e-8,3.1909924742474843e-4,2.3507561072834535e-5,-1.3576520061523686e-8,3.192068961684871e-4,2.359541331330978e-5,-1.3588911123510958e-8,3.1933831976116504e-4,2.3597783076813762e-5,-1.358746123971623e-8,3.1952065880791903e-4,2.3536160980096142e-5,-1.3575362908229614e-8,3.19771579080949e-4,2.3439311888661372e-5,-1.3557025218592592e-8,3.200985885643759e-4,2.3340011786561243e-5,-1.3537543756519094e-8,3.2049846336595103e-4,2.3272031254568778e-5,-1.3522245412330314e-8,3.2095680118528186e-4,2.3266656684082567e-5,-1.3516194501257755e-8,3.214482960990994e-4,2.3348264536126095e-5,-1.3523546070473995e-8,3.219387035953197e-4,2.352905494166589e-5,-1.3546710031825095e-8,3.2238945173181284e-4,2.3803973484541637e-5,-1.3585453917150966e-8,3.2276517284783867e-4,2.414782235178386e-5,-1.3636274656717374e-8,3.2304300787259485e-4,2.4516917684648338e-5,-1.369247871891746e-8,3.2322093588827404e-4,2.4856694790520883e-5,-1.374527463790208e-8,3.2332167991338466e-4,2.5114409674883268e-5,-1.3785796286515207e-8,3.233897052011945e-4,2.525357146846435e-5,-1.3807516666649438e-8,3.2348120921461983e-4,2.5265406266578555e-5,-1.3808261001094046e-8,3.2364963922767976e-4,2.5173284625345988e-5,-1.3791120413398418e-8,3.2393091613960477e-4,2.5028248522414485e-5,-1.3763924450587002e-8,3.243327110819311e-4,2.489645279708152e-5,-1.3737355303383892e-8,3.2483114194985555e-4,2.4841661933600615e-5,-1.3722151158493351e-8,3.253764637315329e-4,2.4907661106982096e-5,-1.3726145974744325e-8,3.2590667505080653e-4,2.5106163518978407e-5,-1.3752074004335538e-8,3.263648743232834e-4,2.5414592771149465e-5,-1.3796943801410434e-8,3.267142644419916e-4,2.5784562274762126e-5,-1.3853232512079237e-8,3.2694560655390203e-4,2.6157379978950974e-5,-1.3911368702242648e-8,3.2707552207375036e-4,2.64802029079398e-5,-1.3962446344578679e-8,3.2713809920406574e-4,2.6717260951139974e-5,-1.4000191368277358e-8,3.2717430412455535e-4,2.685395991046812e-5,-1.4021757723105099e-8,3.272230250199076e-4,2.6895095773412356e-5,-1.4027518182301305e-8,3.273154328546555e-4,2.6859988741622723e-5,-1.4020303863838187e-8,3.27472427946398e-4,2.6777052624059808e-5,-1.4004517409235265e-8,3.2770404819257206e-4,2.667917357422416e-5,-1.3985374637999391e-8,3.2800968800751206e-4,2.6600135622202087e-5,-1.396833964272351e-8,3.283784197698704e-4,2.65715822213231e-5,-1.3958675851617953e-8,3.2878934377281676e-4,2.661975357857392e-5,-1.3960963251046796e-8,3.2921252136175277e-4,2.6761429111553565e-5,-1.397844020247438e-8,3.2961152402647006e-4,2.699907821559547e-5,-1.4012129808211943e-8,3.29948753915105e-4,2.7316263206531952e-5,-1.4059921868231094e-8,3.3019401009220286e-4,2.7675690266479282e-5,-1.4116060189696021e-8,3.303348983515174e-4,2.8023052525526852e-5,-1.417164175112956e-8,3.303851664433875e-4,2.8298564869411255e-5,-1.4216501609523993e-8,3.303858174704456e-4,2.845434313568276e-5,-1.4242167403395092e-8,3.303959416014983e-4,2.847131185450436e-5,-1.424477933710207e-8,3.304753311960585e-4,2.8367701265917583e-5,-1.4226626167552076e-8,3.3066574499633107e-4,2.8194592527739406e-5,-1.4195561924860455e-8,3.3097847333721307e-4,2.8020371048836455e-5,-1.4162617817120332e-8,3.3139229136450047e-4,2.7910733393913838e-5,-1.4138840614943994e-8,3.318610576038761e-4,2.7911418740544573e-5,-1.4132437583694847e-8,3.32327158660616e-4,2.8038257552148033e-5,-1.4146944421067845e-8,3.3273630146328536e-4,2.8275956095937735e-5,-1.4180721826563061e-8,3.3304982043797914e-4,2.8584590280257757e-5,-1.4227750741366778e-8,3.332518772704476e-4,2.8911198090895583e-5,-1.4279413650778645e-8,3.3335044303321585e-4,2.9203016014443303e-5,-1.4326720121414798e-8,3.3337264600420897e-4,2.9418844303718548e-5,-1.4362340255230543e-8,3.333565716870711e-4,2.953593528593423e-5,-1.438192328577023e-8,3.333423100299153e-4,2.955156240787833e-5,-1.4384490907506754e-8,3.333646227280616e-4,2.9480245799448394e-5,-1.4372041376989542e-8,3.3344841055820307e-4,2.9348582447400512e-5,-1.434870041016347e-8,3.3360692534264394e-4,2.9189588504290738e-5,-1.4319770705147037e-8,3.338418939605668e-4,2.903780052882538e-5,-1.429092220642219e-8,3.341445478842576e-4,2.8925502238673784e-5,-1.4267598983776846e-8,3.3449686902692956e-4,2.8879716510260736e-5,-1.4254567192028621e-8,3.34872893630502e-4,2.8919305085978387e-5,-1.4255452413328958e-8,3.3524046998712566e-4,2.905162633610626e-5,-1.4272125495191893e-8,3.3556438983591447e-4,2.926868042533546e-5,-1.4303906971243346e-8,3.358120415655983e-4,2.9543700862908523e-5,-1.4346787820191492e-8,3.359620973953016e-4,2.9830621885824582e-5,-1.4393165436296007e-8,3.3601476557872876e-4,3.0069847654572008e-5,-1.4432765793470925e-8,3.3599911919222826e-4,3.020259394749606e-5,-1.4455159337401374e-8,3.3597110300592314e-4,3.019141034190686e-5,-1.4453385307179457e-8,3.35998526488256e-4,3.00380349093956e-5,-1.4427081304578546e-8,3.3613729850181856e-4,2.9787423935761663e-5,-1.4383225010504009e-8,3.3641053011372276e-4,2.9513350056419022e-5,-1.4333808242876725e-8,3.368014006431015e-4,2.9292449987817804e-5,-1.4291641185111276e-8,3.3726185452744576e-4,2.9179980574871958e-5,-1.4266408426820145e-8,3.377303740186198e-4,2.9197037823386694e-5,-1.4262469364142498e-8,3.3814986945613203e-4,2.9330730888683372e-5,-1.427863436126763e-8,3.3848010158714516e-4,2.9543115154846164e-5,-1.4309336642064932e-8,3.38703273259897e-4,2.9783603206552747e-5,-1.4346471770152776e-8,3.388238715787891e-4,3.0001002317025725e-5,-1.4381352417660723e-8,3.388645512106792e-4,3.015313826145052e-5,-1.4406430035573901e-8,3.388596992978482e-4,3.0213214891368453e-5,-1.441656210821404e-8,3.388480896868653e-4,3.0172579589435465e-5,-1.4409671063513486e-8,3.3886595201610624e-4,3.0040010984943417e-5,-1.4386745775937594e-8,3.389415616773652e-4,2.983826465857231e-5,-1.435129353309962e-8,3.3909197448769624e-4,2.9599024245251944e-5,-1.4308467177209232e-8,3.393219732788287e-4,2.935743690567301e-5,-1.4264115645959442e-8,3.396247872186201e-4,2.9147198599977515e-5,-1.4223960274082391e-8,3.3998384944594585e-4,2.8996680396776103e-5,-1.419298232822601e-8,3.4037497978542483e-4,2.8925994092867653e-5,-1.4174970094013113e-8,3.4076876816749476e-4,2.8944576739562157e-5,-1.4172101451461987e-8,3.4113333363185183e-4,2.9048903134653624e-5,-1.4184452613283302e-8,3.4143806830900614e-4,2.9220259014859665e-5,-1.4209426481068721e-8,3.416592313159679e-4,2.942335957385573e-5,-1.4241300071719586e-8,3.4178768959361645e-4,2.9607879560626548e-5,-1.4271351102299056e-8,3.418373350901813e-4,2.971582378240197e-5,-1.4289150939638257e-8,3.4184996084014505e-4,2.9696727082961728e-5,-1.4285356690807156e-8,3.418902633601011e-4,2.952827110856552e-5,-1.425546855762454e-8,3.420270707706498e-4,2.9232745927517535e-5,-1.4202771104298555e-8,3.4230607491550166e-4,2.8876464783064984e-5,-1.4138250014917669e-8,3.4272891522547444e-4,2.8547270391760742e-5,-1.4076783978948293e-8,3.432521860159393e-4,2.8320914566404532e-5,-1.4031512125887654e-8,3.4380643577638096e-4,2.8235399587572567e-5,-1.4009518407800017e-8,3.4432227839255926e-4,2.8284922903914585e-5,-1.4010681330376893e-8,3.4474989405392577e-4,2.8430706232186193e-5,-1.4029244458375631e-8,3.450667007921132e-4,2.8618389049455682e-5,-1.405649452639386e-8,3.4527564357985356e-4,2.879355388007985e-5,-1.4083250375345564e-8,3.453987654829163e-4,2.8912049121438285e-5,-1.4101646097180218e-8,3.45469585268103e-4,2.894525815503267e-5,-1.4106194425210915e-8,3.4552604642457406e-4,2.8881730901118583e-5,-1.4094281874326899e-8,3.4560455047242703e-4,2.8726431535401165e-5,-1.4066215283106948e-8,3.457351529958053e-4,2.84982490045257e-5,-1.4024875511406945e-8,3.459380666037131e-4,2.8226171437823553e-5,-1.397505116091795e-8,3.462216637718113e-4,2.794459723979762e-5,-1.3922581182171141e-8,3.4658209986642525e-4,2.7688322235778394e-5,-1.3873458405560078e-8,3.4700449561030034e-4,2.748781270498401e-5,-1.3833031101689292e-8,3.474653304988083e-4,2.7365322208472776e-5,-1.3805386540778746e-8,3.479355692431911e-4,2.7332084280176915e-5,-1.3792904236856692e-8,3.483841987506852e-4,2.738651159118678e-5,-1.3795909548384521e-8,3.48782076015223e-4,2.7513276120753096e-5,-1.3812375954175199e-8,3.4910623716508923e-4,2.768327317176719e-5,-1.3837706596348546e-8,3.493450066374296e-4,2.785497909947437e-5,-1.3864767635512509e-8,3.4950380428156456e-4,2.7978582520697178e-5,-1.388452258098352e-8,3.496101796449104e-4,2.800470747307293e-5,-1.3887648902006153e-8,3.4971470295323565e-4,2.7898579782032046e-5,-1.3867255990212172e-8,3.498829672228969e-4,2.7657103890016168e-5,-1.3822133605209417e-8,3.5017591926531956e-4,2.7320571946380355e-5,-1.375894735333673e-8,3.5062370726759935e-4,2.6967510508779796e-5,-1.3691352108885298e-8,3.512076836751679e-4,2.668829415482261e-5,-1.3635359280006073e-8,3.518645594543916e-4,2.6549168451208284e-5,-1.3603044848274974e-8,3.525120860381075e-4,2.6567976763254272e-5,-1.359825241655584e-8,3.530801471377777e-4,2.671440633051558e-5,-1.3616465703002289e-8,3.5353016455276417e-4,2.692942938290615e-5,-1.3647971513994665e-8,3.538577002956241e-4,2.7148881753446637e-5,-1.3681795510084634e-8,3.540840771794443e-4,2.7320151877578618e-5,-1.3708567939664234e-8,3.542449634789241e-4,2.740961864282937e-5,-1.372191839944505e-8,3.543805993034693e-4,2.7403434203548572e-5,-1.3718799059739425e-8,3.545289983413223e-4,2.730498627401825e-5,-1.3699233288566783e-8,3.547216624954893e-4,2.7131303055044464e-5,-1.366581028187246e-8,3.5498087228620824e-4,2.690928730173587e-5,-1.3623050830270064e-8,3.5531797095255416e-4,2.6671814970846222e-5,-1.3576675347345746e-8,3.557325408326314e-4,2.6453572621222732e-5,-1.3532810617513158e-8,3.562126332903402e-4,2.628664184351773e-5,-1.3497191162436568e-8,3.5673629776197384e-4,2.619610347960688e-5,-1.3474416118620455e-8,3.5727449108908464e-4,2.6196233744873596e-5,-1.3467331827186608e-8,3.577951171362706e-4,2.628789151186731e-5,-1.3476583429700484e-8,3.582677504977914e-4,2.6457485603445368e-5,-1.3500355686777276e-8,3.5866856083210973e-4,2.667773719840518e-5,-1.3534335889835297e-8,3.58984983565573e-4,2.691031135287597e-5,-1.3571967951946276e-8,3.592197788921785e-4,2.7110381522096033e-5,-1.3605104433755066e-8,3.5939395836391525e-4,2.723347733466807e-5,-1.3625211838772243e-8,3.5954731475294516e-4,2.7245005640118063e-5,-1.3625233122092842e-8,3.5973439287282456e-4,2.7131819567977223e-5,-1.3601941703224978e-8,3.600135954575884e-4,2.6912915110491107e-5,-1.355814290805302e-8,3.60429073295564e-4,2.664325075241653e-5,-1.3503526756102676e-8,3.60990418920039e-4,2.64034696792908e-5,-1.3452835801158697e-8,3.6166146352094975e-4,2.6273775898966717e-5,-1.3421074493356377e-8,3.623688032765512e-4,2.630225709809558e-5,-1.3417659611230746e-8,3.6302889191182174e-4,2.6485921915614753e-5,-1.3442821004948017e-8,3.635787000997205e-4,2.6775836053406942e-5,-1.3488337737398986e-8,3.6399313254539714e-4,2.7100845265447172e-5,-1.3541675775041822e-8,3.6428387361378935e-4,2.739386253867796e-5,-1.3590675845310196e-8,3.644865074909421e-4,2.7608376878739416e-5,-1.3626575377250361e-8,3.6464576613601913e-4,2.7723005292816395e-5,-1.364495582745406e-8,3.6480461555127395e-4,2.77383404850266e-5,-1.3645341642181487e-8,3.6499818740537e-4,2.76710053685678e-5,-1.3630271402829668e-8,3.6525122259954397e-4,2.754788664050142e-5,-1.360432815008887e-8,3.6557730310316335e-4,2.7401492817728636e-5,-1.357329062063108e-8,3.659787553882458e-4,2.72661665993695e-5,-1.3543394730429565e-8,3.6644689750384423e-4,2.7174555417879994e-5,-1.352065178127914e-8,3.669628241382334e-4,2.7153908983776746e-5,-1.3510179030065285e-8,3.674992016602788e-4,2.7222166045638933e-5,-1.3515526234079713e-8,3.68023539090487e-4,2.73843521332642e-5,-1.3538046023492725e-8,3.685030041719975e-4,2.7630228716345682e-5,-1.357642629855776e-8,3.689102801263324e-4,2.793415315314418e-5,-1.362653567100988e-8,3.692294796808659e-4,2.825781083626839e-5,-1.368173224189925e-8,3.694608523244996e-4,2.8555916027981706e-5,-1.3733727733496358e-8,3.6962307871807993e-4,2.8784249160797294e-5,-1.3773978177336275e-8,3.697522993353289e-4,2.8908903102290343e-5,-1.3795451641862713e-8,3.6989731803456434e-4,2.8915385836666257e-5,-1.3794521381371401e-8,3.701106527110447e-4,2.8815745762559872e-5,-1.3772576532502819e-8,3.704358354453675e-4,2.8651045702873957e-5,-1.3736749819577554e-8,3.7089307273516974e-4,2.8486040803253674e-5,-1.369908367506479e-8,3.714679608227572e-4,2.8394043726751596e-5,-1.3673710854101186e-8,3.7210991213757036e-4,2.843405066778115e-5,-1.3672440108961631e-8,3.7274498490128303e-4,2.8628554579815174e-5,-1.3700371291720451e-8,3.733002400374539e-4,2.8953884905579092e-5,-1.375383654447321e-8,3.737283127161456e-4,2.934966667201483e-5,-1.3821992572909582e-8,3.74019840199307e-4,2.9742318752869464e-5,-1.3891158565206442e-8,3.741996113300426e-4,3.0069483883304552e-5,-1.3949424588473654e-8,3.743121974552402e-4,3.0294519375517385e-5,-1.3989456769194334e-8,3.7440629029591007e-4,3.0408720943630665e-5,-1.4009040575435913e-8,3.745237271452724e-4,3.042555417326966e-5,-1.4010137999684472e-8,3.7469432233555345e-4,3.0372415163084517e-5,-1.399745265579277e-8,3.7493481407911624e-4,3.0283392801809747e-5,-1.3977121315336288e-8,3.7524974009757705e-4,3.0194074963467853e-5,-1.3955729687359219e-8,3.7563276072333213e-4,3.013796030115297e-5,-1.3939607838651707e-8,3.7606789752317216e-4,3.014358067755694e-5,-1.3934276197156442e-8,3.765308715945007e-4,3.0231593508346177e-5,-1.394391327502817e-8,3.769911447976581e-4,3.0411553226949515e-5,-1.3970762499094855e-8,3.774153866080384e-4,3.067874957136116e-5,-1.4014505540693484e-8,3.7777276900158004e-4,3.101223988098575e-5,-1.4071785355970582e-8,3.780416881621932e-4,3.137561973052833e-5,-1.4136185048005719e-8,3.782164562994042e-4,3.1721813892388676e-5,-1.4198962795870701e-8,3.7831168136817563e-4,3.2002044707192615e-5,-1.4250643304019193e-8,3.7836207867593326e-4,3.2177378338159576e-5,-1.4283213281041604e-8,3.784166470845473e-4,3.222972568760059e-5,-1.4292338201740607e-8,3.7852801727424653e-4,3.216882097511682e-5,-1.4278915068388991e-8,3.7873941235653586e-4,3.2032643792585974e-5,-1.4249424676350356e-8,3.7907250187723524e-4,3.1880386191779476e-5,-1.4214835935159804e-8,3.79519524138801e-4,3.1778859253417956e-5,-1.4188143257430748e-8,3.800425591675725e-4,3.1785057707013906e-5,-1.4180988668013144e-8,3.8058155833472476e-4,3.192941802742809e-5,-1.420023019579586e-8,3.810702007095623e-4,3.220552703223705e-5,-1.424564138430845e-8,3.814550608339061e-4,3.257118968284767e-5,-1.4309824655516338e-8,3.8171088610531375e-4,3.2961679962287354e-5,-1.4380610992098202e-8,3.818457030615165e-4,3.3310117296884816e-5,-1.444499449135639e-8,3.8189440825249304e-4,3.356630414228731e-5,-1.4492871054400158e-8,3.8190518456659355e-4,3.3706990005561714e-5,-1.4519156100786139e-8,3.8192545511999565e-4,3.3735939536645784e-5,-1.4523932873023375e-8,0.00038199221663132935,3.36770574780388e-5,-1.4511243699103591e-8,3.8212794959808886e-4,3.356532850735636e-5,-1.44874232515469e-8,3.8234068283503006e-4,3.3438964212912564e-5,-1.445961632653455e-8,3.826260695837975e-4,3.333397058547786e-5,-1.4434725361888601e-8,3.8296985541619517e-4,3.328078604508245e-5,-1.4418750654133305e-8,3.8335002714571484e-4,3.3302014460873146e-5,-1.441635218389012e-8,3.837387391287661e-4,3.341034772114456e-5,-1.4430449062814374e-8,3.841046361875188e-4,3.3606223967194986e-5,-1.4461732780659432e-8,3.844163948873668e-4,3.3875453388444264e-5,-1.4508108409027856e-8,3.846481026697538e-4,3.4187920503036706e-5,-1.4564283527851176e-8,3.8478626988731516e-4,3.449926174844078e-5,-1.4621926226168586e-8,3.8483677916458626e-4,3.475742957885683e-5,-1.4670832194101453e-8,3.8482854708888275e-4,3.491455839733871e-5,-1.4701226812136726e-8,3.8481043392111564e-4,3.4941584971485933e-5,-1.4706695752866484e-8,3.8484010168733006e-4,3.484013825587449e-5,-1.468664371357169e-8,3.8496755452253895e-4,3.464574228765504e-5,-1.4647105606473425e-8,3.852194666708856e-4,3.4419635873436564e-5,-1.4599384135326243e-8,3.8559051584685747e-4,3.4231768838361375e-5,-1.4556966089518085e-8,3.8604470174984556e-4,3.4141257634779535e-5,-1.4531832281699271e-8,3.8652549596401316e-4,3.4180796113487486e-5,-1.4531324827219252e-8,3.8697101818921484e-4,3.434917801281351e-5,-1.4556386882613265e-8,3.8732970092140794e-4,3.461318978913546e-5,-1.4601550234372074e-8,3.875723463890504e-4,3.491766325493246e-5,-1.4656605918405712e-8,3.8769763284319733e-4,3.5200524303996284e-5,-1.4709446876581307e-8,3.8772997811639925e-4,3.540841369879993e-5,-1.474921260370285e-8,3.877109937265693e-4,3.550840337825738e-5,-1.476877406003373e-8,3.8768778169230556e-4,3.5492866851361164e-5,-1.476588786722735e-8,3.877020190388187e-4,3.5377264492801586e-5,-1.4742916279944912e-8,3.8778272420060984e-4,3.519311331097323e-5,-1.4705540490345767e-8,3.8794354267678884e-4,3.497940485725285e-5,-1.4661111679795208e-8,3.88183621815305e-4,3.4775082366194856e-5,-1.4617171125102894e-8,3.8849040862005046e-4,3.4613774624727124e-5,-1.4580401934381552e-8,3.888429039948693e-4,3.452069902788002e-5,-1.4556015515333534e-8,3.8921458948142855e-4,3.45109299576898e-5,-1.4547412738969088e-8,3.8957597873680495e-4,3.4588150401447517e-5,-1.455591709815627e-8,3.8989728274007056e-4,3.474336635341969e-5,-1.4580440622513306e-8,3.9015195396758514e-4,3.495368121352255e-5,-1.4617090694513199e-8,3.9032177735499337e-4,3.5182101792084835e-5,-1.4658947568485471e-8,3.9040340540185385e-4,3.5380277120652675e-5,-1.4696467881042956e-8,3.904146306630224e-4,3.549631641986946e-5,-1.4719008759851094e-8,3.903967427080332e-4,3.548836893154207e-5,-1.4717615696219794e-8,3.9040860609677376e-4,3.534095270614115e-5,-1.468840935651692e-8,3.905107938530057e-4,3.507658782265891e-5,-1.4635025503981219e-8,3.9074435561294203e-4,3.4754301960084933e-5,-1.4568447883446436e-8,3.911142837911334e-4,3.445237060488615e-5,-1.4503769375063293e-8,3.915867065914306e-4,3.4242280516138355e-5,-1.4455241755727162e-8,3.9210098851033884e-4,3.416630020580259e-5,-1.4431921054112957e-8,3.9258978921974933e-4,3.42277415173893e-5,-1.4435583191215956e-8,3.92997891960016e-4,3.43949587943332e-5,-1.446115512515839e-8,3.9329397995157005e-4,3.4614214184008465e-5,-1.4498870429778417e-8,3.934741228294369e-4,3.482529654460197e-5,-1.4537116508416524e-8,3.935585439745504e-4,3.497539271070658e-5,-1.456516089516988e-8,3.935841244453831e-4,3.502882428209544e-5,-1.4575248316469991e-8,3.935950084123615e-4,3.497180118274077e-5,-1.4563798423281858e-8,3.9363335905265697e-4,3.4812268755863353e-5,-1.453161028551469e-8,3.9373196934599825e-4,3.457567997812712e-5,-1.4483168817569692e-8,3.9390985158140024e-4,3.4298244121273065e-5,-1.442534785326174e-8,3.941710735045695e-4,3.401951202215226e-5,-1.4365908871774454e-8,3.945062887672119e-4,3.377587091359689e-5,-1.431215883946541e-8,3.948959058166358e-4,3.3595868201667825e-5,-1.4269990715109863e-8,3.9531378332501087e-4,3.34975018387911e-5,-1.4243345355196083e-8,3.95730734118531e-4,3.348697905005418e-5,-1.4233969882786683e-8,3.9611767962868447e-4,3.3558268125866676e-5,-1.424129255710753e-8,3.964487102877791e-4,3.3693000306870486e-5,-1.4262290516375536e-8,3.9670457560232427e-4,3.386072530925677e-5,-1.429136009013897e-8,3.96877142245794e-4,3.402026478479182e-5,-1.4320404114221407e-8,3.96974675963087e-4,3.412377428846557e-5,-1.433955280018419e-8,3.970263033690597e-4,3.412534347773198e-5,-1.4338948576893425e-8,3.970821930901893e-4,3.3994646882125137E-05,-1.4311677516442803e-8,3.972051269460485e-4,3.373258641401384e-5,-1.4257126814339408e-8,3.9745171697619185e-4,3.3380857036472385e-5,-1.4183048350455968e-8,3.9784887548471545e-4,3.3015677815108926e-5,-1.4104376616313594e-8,3.983784208606685e-4,3.272315572911758e-5,-1.4038376360391643e-8,3.989810077392129e-4,3.2567028222608205e-5,-1.3998275239165507e-8,3.995784033932848e-4,3.256650678484111e-5,-1.3988808427858587e-8,4.001011450991133e-4,3.269479846358877e-5,-1.4005705396679457e-8,4.0050766556828905e-4,3.2894820685850835e-5,-1.4038489709830286e-8,4.0078956955466436e-4,3.310064022337845e-5,-1.407446327281956e-8,4.0096621978551547e-4,3.325505206119748e-5,-1.4102093289319672e-8,4.010745404447036e-4,3.3319672146671645e-5,-1.4113112716440347e-8,4.0115849496576356e-4,3.3278246778498246e-5,-1.4103416685224999e-8,4.0126036221118603e-4,3.3135359116825646e-5,-1.4073080729645138e-8,4.014143685471576e-4,3.291243375807629e-5,-1.4025773677232568e-8,4.0164265136440953e-4,3.264223661405534e-5,-1.3967743564302586e-8,4.019534608500238e-4,3.236272447032621e-5,-1.390655605379301e-8,4.023414451750576e-4,3.211102729665613e-5,-1.3849797898036786e-8,4.0278971307670453e-4,3.191824538468825e-5,-1.3803953237611915e-8,4.032731686233601e-4,3.18056089510052e-5,-1.3773602883065726e-8,4.037624347508987e-4,3.178228329803735e-5,-1.376099772735688e-8,4.0422776760387706e-4,3.184466222614487e-5,-1.3765925422093045e-8,4.0464271102872616e-4,3.1976751617668895e-5,-1.3785736315062855e-8,4.049875078121135e-4,3.2151373504918296e-5,-1.3815449042655647e-8,4.0525242347578963e-4,3.2332175019236376e-5,-1.3847964962952615e-8,4.0544119121250843e-4,3.2476862419152035e-5,-1.3874561986942388e-8,4.05574305140568e-4,3.254270756363941e-5,-1.3885979640020726e-8,4.0569066632959827e-4,3.249544686392352e-5,-1.3874369128060043e-8,4.0584474135106326e-4,3.232141920233108e-5,-1.3836033795223245e-8,4.060959597117366e-4,3.203981711665866e-5,-1.3774198864523915e-8,4.0648944202457856e-4,3.170776499799547e-5,-1.3700205970255192e-8,4.070339380710125e-4,3.14094387988266e-5,-1.3631320248747382e-8,4.076901544592694e-4,3.122757281338524e-5,-1.3584880382566213e-8,4.083808447150242e-4,3.1209812559531696e-5,-1.357136683146307e-8,4.090200221087287e-4,3.1349995147856346e-5,-1.3590446140588086e-8,4.0954443123187515e-4,3.1595103343674464e-5,-1.3632168430282483e-8,4.099303837683666e-4,3.187049880203468e-5,-1.3681872256090355e-8,4.101918277261662e-4,3.210671035463291e-5,-1.3725481876963942e-8,4.103671176469619e-4,3.225608889167277e-5,-1.3752883934071199e-8,4.1050398879131114e-4,3.2297665182539014e-5,-1.3759059927073484e-8,4.106480562172606e-4,3.223425978678608e-5,-1.3743742869076615e-8,4.108359107796797e-4,3.208637535174844e-5,-1.371041895829871e-8,4.1109180515318115e-4,3.188566709771694e-5,-1.366514943234374e-8,4.1142658815250326e-4,3.166901056491771e-5,-1.3615380156688916e-8,4.118380537063425e-4,3.147326545835003e-5,-1.3568790580043022e-8,4.123123872285276e-4,3.1330693322293186e-5,-1.3532246924646132e-8,4.1282660990819755e-4,3.12650855735152e-5,-1.3510937230181173e-8,4.1335194038861985e-4,3.12888232285669e-5,-1.3507759179538763e-8,0.00041385782791872523,3.14012402587035e-5,-1.3523006860697865e-8,4.143162097043059e-4,3.158851800056764e-5,-1.3554343762603742e-8,4.147055736697891e-4,3.182504325345812e-5,-1.3596998591413753e-8,4.150145461827425e-4,3.207610038134238e-5,-1.3644157727172217e-8,4.1524476893370035e-4,3.230183268389632e-5,-1.368759809958973e-8,4.1541284364256985e-4,3.2462481911037404e-5,-1.3718658948585584e-8,4.1555091775811174e-4,3.252513293742975e-5,-1.3729683805619488e-8,4.1570478512098117e-4,3.247211793603926e-5,-1.3715984522395111e-8,4.159276624200048e-4,3.2310116826504505e-5,-1.3678055124053507e-8,4.1626805702971783e-4,3.2076790804311726e-5,-1.3623245822332607e-8,4.167524617387805e-4,3.1839355536118996e-5,-1.3565610929515464e-8,4.173687071937988e-4,3.1679433606488e-5,-1.352271054257597e-8,4.180608672886187e-4,3.166480571656874e-5,-1.3509541984888306e-8,4.187443288713044e-4,3.182021371545731e-5,-1.353221487846181e-8,4.193369682737023e-4,3.211533218369021e-5,-1.3585218588590153e-8,4.1978931227977685e-4,3.247863499575709e-5,-1.3654153761093438e-8,4.2009704087509506e-4,3.282777137229304e-5,-1.3721983897773367e-8,4.202929904690921e-4,3.309778073197644e-5,-1.377490014751364e-8,4.2042859167406205e-4,3.325494568929429e-5,-1.3805267082687721e-8,4.2055631802961126e-4,3.329635406528146e-5,-1.3811685967344244e-8,4.207187075410816e-4,3.324181570289828e-5,-1.3797529601781316e-8,4.209438553744661e-4,3.312430221578908e-5,-1.376914696052265e-8,4.212450114021482e-4,3.29820290127452e-5,-1.3734307231289387e-8,4.2162200611876914e-4,3.285276439909095e-5,-1.3700985550654417e-8,4.220632466273461e-4,3.276974175556986e-5,-1.3676406563612262e-8,4.225479806825113e-4,3.275847057478871e-5,-1.3666274054639809e-8,4.2304896717371235e-4,3.283409778896946e-5,-1.367416405793029e-8,4.23535782825238e-4,3.299935006506142e-5,-1.3701088573561653e-8,4.2397886988324306e-4,3.3243478824476034e-5,-1.374527589841765e-8,4.2435406637511227e-4,3.354279531934157e-5,-1.3802236076034794e-8,4.246470102477941e-4,3.3863147891369016e-5,-1.3865160722445153e-8,4.248566904943515e-4,3.4164346787876715e-5,-1.392568757735148e-8,4.249974307882397e-4,3.4406249583597606e-5,-1.3975043403899051e-8,4.2509869023787635e-4,3.455590008719841e-5,-1.4005525482322397e-8,4.252022353167417e-4,3.4594902384809774e-5,-1.4012200930378964e-8,4.2535628227180944e-4,3.452606191561703e-5,-1.3994602436161527e-8,4.2560627053101944e-4,3.437774195887487e-5,-1.3957997791203556e-8,4.259826655671023e-4,3.42033544248866e-5,-1.3913552496987838e-8,4.2648812302165757e-4,3.407288572264099e-5,-1.3876612700332113e-8,4.2708920644435e-4,3.405490071168592e-5,-1.3862734860228985e-8,4.2771960286236156e-4,3.419246160656786e-5,-1.388224482934693e-8,4.2829858276369735e-4,3.4483331127508464e-5,-1.39356667397566e-8,4.287591800201008e-4,3.487711132752329e-5,-1.401286696741407e-8,4.2907189221625086e-4,3.529375343362766e-5,-1.4096933853643936e-8,4.2925111181198606e-4,3.5653822332007866e-5,-1.4170691079982273e-8,4.293431436633978e-4,3.590386737424457e-5,-1.422220020649449e-8,4.294057069943159e-4,3.602629900089709e-5,-1.4246968028465437e-8,4.2949028887441184e-4,3.603476243390713e-5,-1.4247107509361492e-8,4.296326637699373e-4,3.596258975350247e-5,-1.422906114426545e-8,4.298507830160587e-4,3.585122067538412e-5,-1.4201284229219959e-8,4.30146821619837e-4,3.574178595192985e-5,-1.4172502101488057e-8,4.305105528179752e-4,3.567004669500458e-5,-1.4150577469349977e-8,4.309225690144668e-4,3.566353502127585e-5,-1.4141794633184363e-8,4.3135708115020477e-4,3.5739694174433475e-5,-1.4150368611616155e-8,4.3178466029482305e-4,3.5904363120716595e-5,-1.4178070671429282e-8,4.321754230960808e-4,3.615055457113382e-5,-1.4223940930016515e-8,4.3250300470527235e-4,3.645801938170371e-5,-1.4284152898436964e-8,4.327492141671965e-4,3.6794455062480333e-5,-1.4352180111878265e-8,4.329086361301494e-4,3.711914037777242e-5,-1.441944170755436e-8,4.329919362284678e-4,3.738922622588004e-5,-1.4476525706585657e-8,4.3302648954548616e-4,3.756805202918171e-5,-1.4514923144055002e-8,4.330533235187689e-4,3.763391300210855e-5,-1.4528989528198715e-8,4.331202330514279e-4,3.7587099620632155e-5,-1.4517675625248134e-8,4.33271953934643e-4,3.7453099149815584e-5,-1.4485529520827118e-8,4.335391170749413e-4,3.728040086638992e-5,-1.4442540122095772e-8,4.3392835970523195e-4,3.713209968463934e-5,-1.4402528788363379e-8,4.344165500758634e-4,3.707165347756771e-5,-1.4380064897967802e-8,4.3495230062594813e-4,3.714511840207765e-5,-1.438637838413005e-8,4.3546692736868404e-4,3.7364868229131036e-5,-1.4425430174624792e-8,4.3589372030768185e-4,3.7701867510223756e-5,-1.4491842764582526e-8,4.361893091351183e-4,3.8092289800798756e-5,-1.4572120153155367e-8,4.3634757852403625e-4,3.8457985039809324e-5,-1.464910812938325e-8,4.363991796352178e-4,3.8732147174392066e-5,-1.4707727290935779e-8,4.3639763452364114e-4,3.887826414780291e-5,-1.4739264857224268e-8,4.364001722647106e-4,3.889525252824335e-5,-1.474263969373984e-8,4.364523016838084e-4,3.881021476354108e-5,-1.4722977299200551e-8,4.365804771433114e-4,3.866556340462599e-5,-1.468896039574687e-8,4.367919722871205e-4,3.8506926413442914e-5,-1.4650297668231218e-8,4.370786669043261e-4,3.837491837753309e-5,-1.4615939698352876e-8,4.3742177567648004e-4,3.8300841711920557e-5,-1.4593067497875068e-8,4.377959505900983e-4,3.830495380523125e-5,-1.4586611379527836e-8,4.3817246361271725e-4,3.839583492266989e-5,-1.4599028669935255e-8,4.385219262133009e-4,3.856996202628723e-5,-1.4630154871815322e-8,4.388172474094774e-4,3.881133934777927e-5,-1.4677068982739351e-8,4.3903736753377824e-4,3.909172438758446e-5,-1.4734059655137036e-8,4.39171785700476e-4,3.9372492362129876e-5,-1.4792916472356046e-8,4.392250878709724e-4,3.9609287825052854e-5,-1.48438349018792e-8,4.392197841418492e-4,3.9760010138741e-5,-1.4877110525214467e-8,4.391952872335693e-4,3.9795215836805176e-5,-1.488546114998337e-8,4.392015028478242e-4,3.9708130526000964e-5,-1.4866368508482124e-8,4.392874740657098e-4,3.9520303226885334e-5,-1.4823547388579492e-8,4.3948798661524503e-4,3.927964654825381e-5,-1.4766788554084115e-8,4.3981252877586845e-4,3.905019462021475e-5,-1.4709963203151688e-8,4.4024057367895406e-4,3.889606668889953e-5,-1.4667637174980205e-8,4.407251019923313e-4,3.886426054421898e-5,-1.465121537204819e-8,4.4120371732378895e-4,3.897130268161372e-5,-1.4665702138134793e-8,4.4161456567829924e-4,3.919776198075389e-5,-1.4708062006301217e-8,4.41912806692747e-4,3.949272215218089e-5,-1.4767828043097781e-8,4.4208268554817335e-4,3.978761101197567e-5,-1.4829982902345276e-8,4.421409699762284e-4,4.001548958358082e-5,-1.4879284623686034e-8,4.421303237867017e-4,4.012928886396741e-5,-1.4904509091663218e-8,4.4210531633417574e-4,4.011254468451751e-5,-1.4901064005645254e-8,4.421168168722615e-4,3.997960143327207e-5,-1.487124044964496e-8,4.422004451507053e-4,3.9767094807069e-5,-1.4822485598136494e-8,4.4237183113721076e-4,3.9521669753076244e-5,-1.4764783122292205e-8,4.426279491665109e-4,3.928881642907068e-5,-1.4708204056709783e-8,4.429518454747351e-4,3.91054375635812e-5,-1.4661205248835662e-8,4.433181067887932e-4,3.899632725145631e-5,-1.4629752573422735e-8,4.436975223791884e-4,3.8973357147412855e-5,-1.4617048273316101e-8,4.4406056405082626e-4,3.903590468819179e-5,-1.4623561502714967e-8,4.4438008650014344e-4,3.91715076460056e-5,-1.4647122090138582e-8,4.446339768961001e-4,3.935646602380224e-5,-1.4682981479505956e-8,4.448083963396037e-4,3.955684978592832e-5,-1.4723927049201846e-8,4.4490177030358924e-4,3.973098128986008e-5,-1.4760714274992125e-8,4.4492878725670593e-4,3.9834759260079374e-5,-1.4783179135015065e-8,4.4492247041699046e-4,3.983068781073579e-5,-1.4782276848273152e-8,4.4493150521741963e-4,3.9699639584905065e-5,-1.4752832416571488e-8,4.4501065268293756e-4,3.945150399211428e-5,-1.4696101798232349e-8,4.452051621230111e-4,3.912878232058367e-5,-1.4620773630123115e-8,4.4553450758414917e-4,3.879851843897706e-5,-1.4541367888067542e-8,4.459831270119789e-4,3.853341144760553e-5,-1.4474199279655483e-8,4.4650334228181737e-4,3.83892962100095e-5,-1.4432428557074345e-8,4.470294963479162e-4,3.838843851633301e-5,-1.4422210720894016e-8,4.474971022466872e-4,3.8514644123259556e-5,-1.4441268698217063e-8,4.4785977033990704e-4,3.872025545847296e-5,-1.4480033042680275e-8,4.480991934681107e-4,3.8940889744311725e-5,-1.4524608121518424e-8,4.48226794522255e-4,3.911257774162124e-5,-1.4560498684405491e-8,4.482780588321118e-4,3.918669829382871e-5,-1.457607889926847e-8,4.4830195410043057e-4,3.913954024565277e-5,-1.4565007306195704e-8,4.483485381147606e-4,3.8974954360315984e-5,-1.4527125710483059e-8,4.484579671969714e-4,3.872030337677846e-5,-1.4467791545713628e-8,4.4865345969394e-4,3.841765061935548e-5,-1.4396030200337683e-8,4.489392960449042e-4,3.811327623924533e-5,-1.4322193270630174e-8,4.4930320331229367e-4,3.7848511485026534e-5,-1.4255821744391228e-8,4.497213338957374e-4,3.765366154702086e-5,-1.4204163537672068e-8,4.5016388935185643e-4,3.7545304813913294e-5,-1.4171463776027224e-8,4.5060002058532647e-4,3.752619081927828e-5,-1.415888242467012e-8,4.5100150770761724e-4,3.758652962581753e-5,-1.4164756572674547e-8,4.5134546376081325e-4,3.7705677615177184e-5,-1.4184941935731645e-8,4.5161665818218725e-4,3.785383751499737e-5,-1.4213111016563784e-8,4.518100423627256e-4,3.7994051971822126e-5,-1.4241074681839239e-8,4.5193371514478737e-4,3.8085369823532785e-5,-1.4259379743515523e-8,4.5201173652522936e-4,3.808847352382779e-5,-1.4258553184670598e-8,4.5208492668352473e-4,3.797471001575803e-5,-1.4231251193107125e-8,4.522066971808626e-4,3.77376787180318e-5,-1.4175095272905575e-8,4.5243135935849304e-4,3.7403252871591634e-5,-1.4095172040726785e-8,4.5279582657719995e-4,3.7030874343293475e-5,-1.4004497095542028e-8,4.5330172975054594e-4,3.6700112219684904e-5,-1.3921072538958264e-8,4.539088056613535e-4,3.648437266876659e-5,-1.3861984223206524e-8,4.545461169138244e-4,3.642372882885231e-5,-1.3837216692123784e-8,4.5513658700048617e-4,3.651138922317251e-5,-1.3846408129259836e-8,4.556220323441288e-4,3.66997016694241e-5,-1.3879890283223254e-8,4.559775185965056e-4,3.691969978430192e-5,-1.3922769386842146e-8,4.562122242740801e-4,3.710309854736905e-5,-1.3959682858114987e-8,4.5636084388552884e-4,3.7198647914217366e-5,-1.397848887776796e-8,4.564712492187718e-4,3.7180239677984124e-5,-1.3972296643507357e-8,4.5659257815677795e-4,3.7047788247771294e-5,-1.393998633269255e-8,4.5676585962010804e-4,3.682314037864092e-5,-1.3885605024489333e-8,4.57017899354544e-4,3.65430985371316e-5,-1.3816998895031419e-8,4.573585513254664e-4,3.625115082842816e-5,-1.3743986972765052e-8,4.5778120823241134e-4,3.5989329685002914e-5,-1.367641965358165e-8,4.582659310878471e-4,3.579152347703973e-5,-1.3622494409608255e-8,4.587842300484169e-4,3.567911872805785e-5,-1.3587614246913989e-8,4.5930436312677383e-4,3.565921697959824e-5,-1.357389940117045e-8,4.5979615512869434e-4,3.572510183973148e-5,-1.358027877351196e-8,4.6023475988321376e-4,3.585820060660067e-5,-1.360294284347647e-8,4.6060335832733674e-4,3.6030722091809204e-5,-1.3635911870639802e-8,4.60895139188042e-4,3.6208528902177354e-5,-1.3671590860836431e-8,4.6111494690815154e-4,3.635429757026502e-5,-1.3701352069797334e-8,4.612807925415506e-4,3.6431488839050474e-5,-1.3716346193401218e-8,4.614247987373746e-4,3.6410027954227026e-5,-1.3708835750741679e-8,4.6159205914533125e-4,3.62743262879114e-5,-1.3674231350069227e-8,4.6183498055835207e-4,3.6032773953528615e-5,-1.3613573886357206e-8,4.6220096368370197e-4,3.572504366766511e-5,-1.3535497406452498e-8,4.627142460022724e-4,3.5420516607509466e-5,-1.345601089443765e-8,4.633589570077975e-4,3.520158587923049e-5,-1.339462640412944e-8,4.640754895656249e-4,3.5133781640715624e-5,-1.336732887285183e-8,4.6477797333421513e-4,3.523710146370312e-5,-1.337976511947418e-8,4.653863109243403e-4,3.5476761963375476e-5,-1.3424888861955243e-8,4.658546211216421e-4,3.577942568893229e-5,-1.3486488367131025e-8,4.661813358342299e-4,3.6063351831523195e-5,-1.3545965988268696e-8,4.664004611033069e-4,3.626473218857858e-5,-1.3588320959816941e-8,4.665639958352068e-4,3.6350407228647365e-5,-1.360513303776225e-8,4.6672541684679767e-4,3.631790496298228e-5,-1.3594788762173888e-8,4.6692865416770923e-4,3.618845377576418e-5,-1.3561187150119446e-8,4.672026368560225e-4,3.5997925297469526e-5,-1.3511940939945172e-8,4.6755982834898976e-4,3.5788386314177225e-5,-1.3456575605413407e-8,4.67997179408685e-4,3.5601078032541834e-5,-1.3404875559273569e-8,4.684985923176623e-4,3.5470812389852354e-5,-1.3365423942936016e-8,4.6903849108559164e-4,3.542180047068913e-5,-1.3344439413006975e-8,4.695861596821659e-4,3.546508508953634e-5,-1.3345040436527447e-8,4.7011041192164126e-4,3.559772500847251e-5,-1.3367006714160734e-8,4.705840542170844e-4,3.580375537789526e-5,-1.3407016011675667e-8,4.7098759753275935e-4,3.6056678871433476e-5,-1.3459233547938723e-8,4.7131190949890184e-4,3.632298007574168e-5,-1.3516078049011552e-8,4.71559790690804e-4,3.6566204934469644e-5,-1.3569053058169974e-8,4.717465735754899e-4,3.6751383530202755E-05,-1.3609647477316639e-8,4.718998124130554e-4,3.684981905601746e-5,-1.3630405599256602e-8,4.7205781579265745e-4,3.684452081682734e-5,-1.3626310087204059e-8,4.7226605766033966e-4,3.673637051258554e-5,-1.3596506069195115e-8,4.725699924678846e-4,3.654994787786842e-5,-1.3546025765795578e-8,4.730033180778431e-4,3.6336041112372295e-5,-1.3486667699711668e-8,4.7357300089362716e-4,3.616604739808837e-5,-1.3435763281303896e-8,4.74246972161772e-4,3.611397064008277e-5,-1.3411769997669891e-8,4.7495468950762464e-4,3.6228226616847743e-5,-1.342728801093758e-8,4.756075265498231e-4,3.6506596772157785e-5,-1.3482806498111208e-8,4.761324789643435e-4,3.68921215314555e-5,-1.3565521966204982e-8,4.76500027685036e-4,3.729587464380291e-5,-1.3654665288008376e-8,4.7672987690625123e-4,3.763293743393644e-5,-1.3730017018062513e-8,4.768749775046739e-4,3.7850136442992455e-5,-1.3778472109271951e-8,4.7699763159739244e-4,3.7934345672070496e-5,-1.379606231317544e-8,4.7715085690734735e-4,3.790502947009683e-5,-1.3786386207802384e-8,4.7736947329048336e-4,3.780076670277705e-5,-1.3757715344810296e-8,4.7766881383462853e-4,3.7666865402247315e-5,-1.3720316041747617e-8,4.780473761409701e-4,3.7546640888132714e-5,-1.368447808114495e-8,4.7849069816615584e-4,3.747611264933771e-5,-1.3659170952435136e-8,4.789752246660876e-4,3.748091718942398e-5,-1.3651117518452754e-8,4.7947201707088224e-4,3.757448492495361e-5,-1.3664168314897276e-8,4.799505077512641e-4,3.775714321569889e-5,-1.3698971973992664e-8,4.803824002412184e-4,3.801622409426613e-5,-1.3752971782310215e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json
new file mode 100644
index 0000000..765f637
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":11000,"numberOfSamples":1000,"samples":[4.807455898115237e-4,3.832746570992544e-5,-1.3820749559112586e-8,4.810276804026849e-4,3.8657939483712816e-5,-1.3894708855793208e-8,4.8122851144731977e-4,3.897037866353488e-5,-1.3966029941865335e-8,4.8136122169643126e-4,3.922846753666153e-5,-1.4025813189547578e-8,4.8145158055841605e-4,3.94025277918899e-5,-1.406634943105251e-8,4.815355041583503e-4,3.9474978459853574e-5,-1.408245537787128e-8,4.8165478219839815e-4,3.9445013590506954e-5,-1.4072791780691197e-8,4.8185089652025466e-4,3.933196966399209e-5,-1.4041008026015441e-8,4.8215671196515623e-4,3.9176311765079673e-5,-1.3996340784096513e-8,4.825864763543066e-4,3.9036228711670225e-5,-1.3953028790341758e-8,4.8312623641597524e-4,3.897747212754661e-5,-1.3927849119148707e-8,4.837291888970253e-4,3.9055456474574426e-5,-1.3935510387344442e-8,4.843221611312391e-4,3.929313827217236e-5,-1.3982860442730526e-8,4.848265247112546e-4,3.966499254457847e-5,-1.4064616609993489e-8,4.8518733416020557e-4,4.009980545620315e-5,-1.4163881241573302e-8,4.853950931909375e-4,4.050581912340954e-5,-1.425830655995102e-8,4.854866151667581e-4,4.080574058134305e-5,-1.4328715323638037e-8,4.85525688196407e-4,4.096178493042818e-5,-1.4365239392562207e-8,4.855772001398806e-4,4.0979862819758134e-5,-1.4368394366073396e-8,4.856885804979649e-4,4.089713112766541e-5,-1.4346234987150922e-8,4.8588326125485515e-4,4.076435074414623e-5,-1.4310345248447114e-8,4.8616296080937287e-4,4.063161994000118e-5,-1.4272594843316575e-8,4.865136173432042e-4,4.054008405187016e-5,-1.4243172616081504e-8,4.8691142789272524e-4,4.051847158520118e-5,-1.4229620182921136e-8,4.8732762934217247e-4,4.0582299326150006e-5,-1.4236433463507242e-8,4.8773212709177916e-4,4.07341134689005e-5,-1.4264941962397524e-8,4.880965967034294e-4,4.096407600183585e-5,-1.4313353517338398e-8,4.88397573177068e-4,4.1250927252936434e-5,-1.4376959666340294e-8,4.886197129387349e-4,4.1563798332032156e-5,-1.4448564853229553e-8,4.887589435265532e-4,4.1865488207741994e-5,-1.451924254306548e-8,4.888247307700336e-4,4.211748974787741e-5,-1.4579476522027053e-8,4.888405100767859e-4,4.228641181812268e-5,-1.462064263346648e-8,4.888415356313333e-4,4.235083017747227e-5,-1.463666315611464e-8,4.888699069788087e-4,4.2307124574301165e-5,-1.462554429370797e-8,4.889672434197426e-4,4.2172729191325406e-5,-1.459042628142175e-8,4.89166100944331e-4,4.198561886052198e-5,-1.4539802909504917e-8,4.894815424795779e-4,4.179941029790374e-5,-1.4486638095790344e-8,4.899045597653066e-4,4.16738571918689e-5,-1.4446179472955758e-8,4.903995543457572e-4,4.1661226263416274e-5,-1.4432491631334258e-8,4.909084078410756e-4,4.179064877681403e-5,-1.4454232713012669e-8,4.913629055658968e-4,4.205495921373214e-5,-1.4510927067288458e-8,4.917043498415898e-4,4.2406630471518614e-5,-1.4591584452824552e-8,4.919041260653661e-4,4.2768455240018365e-5,-1.4677226547185713e-8,4.91975143734432e-4,4.30581023135401e-5,-1.4747087713819914e-8,4.919667281492841e-4,4.321634341236769e-5,-1.4785795141156964e-8,4.919450134806429e-4,4.322488299346272e-5,-1.4787918091785175e-8,4.919696544610528e-4,4.310619995991277e-5,-1.4758043194016052e-8,4.920780610928328e-4,4.2909134196637064e-5,-1.4707389424281414e-8,4.922813225790399e-4,4.269033595193827e-5,-1.464944226297227e-8,4.925688425220637e-4,4.249988199139718e-5,-1.4596537842685818e-8,4.92916302217559e-4,4.2373819969799324e-5,-1.4557994767186664e-8,4.932930424762773e-4,4.233227598512297e-5,-1.4539483417289066e-8,4.936673798735039e-4,4.2380499169877454e-5,-1.4543082916464466e-8,4.940100632622315e-4,4.251078828128216e-5,-1.4567604259159937e-8,4.942967406427109e-4,4.27043504794895e-5,-1.4608973846901326e-8,4.945102476677884e-4,4.2933063498730834e-5,-1.4660638792530654e-8,4.946431248320447e-4,4.316170803770033e-5,-1.4714088579726986e-8,4.947001929114915e-4,4.335150966562856e-5,-1.4759675319273507e-8,4.947003518474758e-4,4.3465620460088586e-5,-1.4787908056141978e-8,4.946762700491294e-4,4.3476391218321277e-5,-1.4791230435817252e-8,4.946706632709735e-4,4.337312853241991e-5,-1.4766006598097854e-8,4.947286919062398e-4,4.316792790944356e-5,-1.4714140745679074e-8,4.948875598480194e-4,4.289680338026428e-5,-1.46436248866499e-8,4.951660198459949e-4,4.261431606960693e-5,-1.4567507684274658e-8,4.955572023782361e-4,4.238205390573295e-5,-1.4501266960766878e-8,4.960275056948562e-4,4.225356593077395e-5,-1.4459112508157139e-8,4.965226079965434e-4,4.225970770296015e-5,-1.445012992875491e-8,4.969797348841862e-4,4.239855798309805e-5,-1.4475344797421208e-8,4.973435745501257e-4,4.263333074298414e-5,-1.452672530286383e-8,4.975817616767804e-4,4.290011641573763e-5,-1.4588789841322534e-8,4.976949342797306e-4,4.31246291984686e-5,-1.4642736998874316e-8,4.977169933512843e-4,4.32435191844831e-5,-1.4671952404593025e-8,4.977043744489744e-4,4.3222752491909916e-5,-1.4666876259907704e-8,4.977180995272924e-4,4.30657402384419e-5,-1.4627283126456636e-8,4.978060190996614e-4,4.280844975449757e-5,-1.4561258969220208e-8,4.979920722311104e-4,4.2505071693506214e-5,-1.4481783123106343e-8,4.982749931993637e-4,4.221149461163865e-5,-1.4402704387878677e-8,4.986341351162414e-4,4.1972812399652274e-5,-1.4335614319282961e-8,4.99038023174974e-4,4.181724732728816e-5,-1.4288203371298527e-8,4.994521132236064e-4,4.1755451375511826e-5,-1.4263899128169458e-8,4.998442497099592e-4,4.1782774302784495e-5,-1.4262268021020732e-8,5.001879318353291e-4,4.1882399162322495e-5,-1.4279703860248156e-8,5.004642516735846e-4,4.202823461485221e-5,-1.4310113798395751e-8,5.006634317541689e-4,4.218742398465999e-5,-1.4345522650409268e-8,5.007865154243883e-4,4.232301933686223e-5,-1.4376697915433863e-8,5.008471450808845e-4,4.239771827120947e-5,-1.4394026271468186e-8,5.008726192415792e-4,4.237947661390274e-5,-1.4388889379628621e-8,5.009027064025104e-4,4.224906691188224e-5,-1.4355605708386248e-8,5.009844664141034e-4,4.200814399437556e-5,-1.4293595372097094e-8,5.011622958425812e-4,4.168457799010023e-5,-1.4208933086185455e-8,5.014648490094809e-4,4.133098997158663e-5,-1.4114222164068199e-8,5.018933871908035e-4,4.1014046129932506e-5,-1.4026120755346876e-8,5.024172779489319e-4,4.079629120466331e-5,-1.3960894019653134e-8,5.029800978344093e-4,4.0716851663191706e-5,-1.3929502673170868e-8,5.035149205751237e-4,4.0778803174321974e-5,-1.3934148788121047e-8,5.039631026052139e-4,4.0948067350335475e-5,-1.3967574412809247e-8,5.042898951464934e-4,4.116358529728348e-5,-1.4015214047407058e-8,5.044923433820881e-4,4.1354546447450864e-5,-1.405930760929713e-8,5.045980853346142e-4,4.145904379395495e-5,-1.4083628433054094e-8,5.046562864241187e-4,4.143903113694813e-5,-1.4077491031220824e-8,5.047237703547672e-4,4.128796116298141e-5,-1.4038013428869964e-8,5.048504577142612e-4,4.1029648300892024e-5,-1.3970152894372228e-8,5.050682042868694e-4,4.070946922079784e-5,-1.3884718542673423e-8,5.053857892959258e-4,4.038129871002777e-5,-1.3795175637434057e-8,5.057904773855169e-4,4.0094587167200846e-5,-1.3714342555419928e-8,5.062542972907671e-4,3.988514116215506e-5,-1.3651908298048012e-8,5.067420758582822e-4,3.9771018930213065e-5,-1.36131932106548e-8,5.072186700798977e-4,3.9752847710952766e-5,-1.3599056334601855e-8,5.076541049257842e-4,3.981679039448647e-5,-1.3606552572220539e-8,5.080265636895346e-4,3.993839829792082e-5,-1.3629887915207912e-8,5.083239056768367e-4,4.008625429723009e-5,-1.366134539027628e-8,5.085445405312649e-4,4.02251540015048e-5,-1.3692068130210929e-8,5.086982215653529e-4,4.031923748367069e-5,-1.3712790472901225e-8,5.088067942896942e-4,4.033585746282454e-5,-1.3714758380114217e-8,5.089042016332715e-4,4.0250984480183826e-5,-1.369110873241738e-8,5.090342370463796e-4,4.005630209267127e-5,-1.36387919547938e-8,5.09244162874289e-4,3.976656292219734e-5,-1.3560660497017656e-8,5.095732393487734e-4,3.942360984383623e-5,-1.3466737784983145e-8,5.100381218559963e-4,3.9092145563312785e-5,-1.3373334502326575e-8,5.106211663506831e-4,3.884421714299498e-5,-1.3299185546533904e-8,5.112695708256073e-4,3.873558642398053e-5,-1.325938777322804e-8,5.119093049859852e-4,3.878426446529394e-5,-1.3259745614206067e-8,5.124690770718819e-4,3.896273593345075e-5,-1.3294485083970076e-8,5.129030399538616e-4,3.920805997219822e-5,-1.3348486880023718e-8,5.13202292093832e-4,3.944384781038976e-5,-1.3402621757432825e-8,5.133926118135372e-4,3.9603311868793384e-5,-1.3439524368879208e-8,5.135225876503645e-4,3.964513077729718e-5,-1.344773648237942e-8,5.136484244188965e-4,3.955939833262208e-5,-1.3423498173910979e-8,5.138202846515992e-4,3.936503101320661e-5,-1.337045078206997e-8,5.140727251366115e-4,3.9101620258126494e-5,-1.3297891578819023e-8,5.144200439889327e-4,3.8818723273896924e-5,-1.3218230049065295e-8,5.148563248939854e-4,3.8565076244178615e-5,-1.31442269252279e-8,5.153592942705727e-4,3.8379720577811564e-5,-1.3086552229207539e-8,5.158965586590853e-4,3.8286402743178446e-5,-1.3052102047767048e-8,5.164325300028227e-4,3.829166482457637e-5,-1.3043289492522785e-8,5.169345624266961e-4,3.838611140678518e-5,-1.3058250794240458e-8,5.173773998025525e-4,3.854777091398222e-5,-1.3091694599441699e-8,5.177457469094699e-4,3.8746318140652295E-05,-1.3136024508001314e-8,5.180353753683765e-4,3.894721737733719e-5,-1.3182422098429487e-8,5.182533801875123e-4,3.9115464526579055e-5,-1.322176802538456e-8,5.184180207872244e-4,3.9219155018714586e-5,-1.3245479826195314e-8,5.185582174206982e-4,3.923339887816621e-5,-1.3246473160946539e-8,5.187121920390923e-4,3.9145162676454723e-5,-1.3220474590964729e-8,0.00051892397371530155,3.895909776742693e-5,-1.316773040159988e-8,5.192361363727685e-4,3.8702959631497384e-5,-1.3094695644609137e-8,5.19678041196177e-4,3.8429183553321686e-5,-1.3014701920521112e-8,5.20251698135249e-4,3.820781513346968e-5,-1.2946243125940887e-8,5.209217831712024e-4,3.810779889170091e-5,-1.2908049988956758e-8,5.216188239536118e-4,3.817071047034634e-5,-1.2912046211167408e-8,5.222596846655533e-4,3.8389929217076366e-5,-1.295764933741635e-8,5.227776981227885e-4,3.870942493105218e-5,-1.3031193682067312e-8,5.231462221446176e-4,3.90449333361414e-5,-1.3111251595486714e-8,5.233834624169179e-4,3.9315346546736246e-5,-1.3176687479802485e-8,5.235394281321812e-4,3.946752696132619e-5,-1.3213083897284422e-8,5.236754233317036e-4,3.9485713744511626e-5,-1.3215295714260378e-8,5.238462568216775e-4,3.9387314888452363e-5,-1.3186630329662888e-8,5.240896667697123e-4,3.921173128856953e-5,-1.3136310014778118e-8,5.244226644038686e-4,3.900801174331826e-5,-1.3076572242619164e-8,5.248426426550115e-4,3.882439799199982e-5,-1.3020069826079723e-8,5.253311937372029e-4,3.870065090327242e-5,-1.2977767650741354e-8,5.258593061790778e-4,3.8663123547147846e-5,-1.2957402470289928e-8,5.263931056407179e-4,3.8722437005912813e-5,-1.2962597830659435e-8,5.268994400545242e-4,3.887355383309786e-5,-1.2992693609541672e-8,5.273506944811689e-4,3.909786013135494e-5,-1.304323238147115e-8,5.277283618928682e-4,3.9366737045691754e-5,-1.310693161469982e-8,5.280251104455353e-4,3.964596224958332e-5,-1.3174889451303355e-8,5.282454335082373e-4,3.990022972843365e-5,-1.3237768428264953e-8,5.284052231946588e-4,4.009736888639202e-5,-1.3286836033079106e-8,5.285305494829884e-4,4.021225325537939e-5,-1.3314912562979519e-8,5.286557060394544e-4,4.0230579521206196e-5,-1.3317363974876683e-8,5.288202403339737e-4,4.015271335318547e-5,-1.3293259523465599e-8,5.290641459351538e-4,3.999743645858218e-5,-1.3246644881952389e-8,5.29420183065172e-4,3.980429049478516e-5,-1.3187490243689071e-8,5.299032094367221e-4,3.963165594186321e-5,-1.313141009986588e-8,5.304988417193463e-4,3.9546878333224285e-5,-1.3097054263167734e-8,5.311574317731786e-4,3.96065921173356e-5,-1.3100650126240523e-8,5.318014578119245e-4,3.98319165292681e-5,-1.3149038022273758e-8,5.32349611324718e-4,4.019180005671327e-5,-1.3234910936428494e-8,5.327485204893838e-4,4.0608738174731215e-5,-1.3338177317094923e-8,5.32993774836213e-4,4.098800442554419e-5,-1.3433731281722263e-8,5.331274981533502e-4,4.125409164773492e-5,-1.3501160283562443e-8,5.332164335123858e-4,4.137379163363762e-5,-1.353087213849061e-8,5.333259193608972e-4,4.13576666322837e-5,-1.3524569124303872e-8,5.335024650995162e-4,4.124644008992089e-5,-1.3491904463169542e-8,5.337679129261047e-4,4.109355822924989e-5,-1.3446225415098136e-8,5.341216559001369e-4,4.0951180469202836e-5,-1.340113134321436e-8,5.345463734211426e-4,4.0861572281668134e-5,-1.3368231159593744e-8,5.350143019353962e-4,4.0852955656746325e-5,-1.3355852072504397e-8,5.354928423825327e-4,4.093817556745151e-5,-1.3368381791204466e-8,5.359493976739728e-4,4.111506478866112e-5,-1.3406093750610092e-8,5.363555591240247e-4,4.136805710751307e-5,-1.3465430533373401e-8,5.366906062535734e-4,4.167087291184944e-5,-1.353970510439085e-8,5.369441549435876e-4,4.199017748541348e-5,-1.3620131233801054e-8,5.371176836764395e-4,4.229004758300979e-5,-1.3697055796399448e-8,5.372246939412618e-4,4.2536815840649555e-5,-1.376122922588961e-8,5.372894831724115e-4,4.2703741062777625e-5,-1.3804984921125316e-8,5.373446669618185e-4,4.277512234113474e-5,-1.3823300988072162e-8,0.00053742757544824975,4.27496117961429e-5,-1.3814764582700658e-8,5.375755603610683e-4,4.264248462223457e-5,-1.3782413644499372e-8,5.378200593904353e-4,4.2486472593883745e-5,-1.373430126808111e-8,5.381792508290428e-4,4.233015478549633e-5,-1.368338167500512e-8,5.386499283189473e-4,4.223204705859813e-5,-1.3646059069466792e-8,5.392010226639216e-4,4.224848840771485e-5,-1.3638780125339982e-8,5.397734225659609e-4,4.2415447202705524e-5,-1.3672723821927818e-8,5.402914650870005e-4,4.272937436938092e-5,-1.3748141826012162e-8,5.406870951769552e-4,4.3138228021123006e-5,-1.3851605137995859e-8,5.409276624223462e-4,4.355360016244392e-5,-1.3959259082476329e-8,5.410308634400444e-4,4.388299832113226e-5,-1.404572807505199e-8,5.410560312127462e-4,4.406544519190341e-5,-1.409387560046213e-8,5.410774246421454e-4,4.4090008179269903e-5,-1.4099829500317099e-8,5.411566007764416e-4,4.399025355105983e-5,-1.4071552354515442e-8,5.413273035270495e-4,4.3823916588713976e-5,-1.4023612135435341e-8,5.415945168970027e-4,4.365179453199496e-5,-1.3971835246327046e-8,5.41941678191083e-4,4.3523829968479546e-5,-1.3929763987744986e-8,5.423397870270695e-4,4.3473105445618066e-5,-1.3906988846966135e-8,5.427550475932729e-4,4.3515132910834864e-5,-1.3908697960636151e-8,5.431542404764803e-4,4.364960885200329e-5,-1.393582992804166e-8,5.435083954292767e-4,4.386290135691708e-5,-1.3985503452994463e-8,5.437955680521673e-4,4.413075019834189e-5,-1.4051648813651171e-8,5.440031193610353e-4,4.442130458093591e-5,-1.4125847171957948e-8,5.441294904295869e-4,4.4698775986850106e-5,-1.4198377383350764e-8,5.441851609821107e-4,4.4927902109817414e-5,-1.4259451932272639e-8,5.44192274379237e-4,4.5079042801761985e-5,-1.4300570677415424e-8,5.441825131835359e-4,4.513324877772769e-5,-1.4315854380231034e-8,5.441931678314615e-4,4.508643514283918e-5,-1.4303200161377657e-8,5.442616930190452e-4,4.495182030705989e-5,-1.4265097005812744e-8,5.444193252662113e-4,4.475992062198913e-5,-1.420891194830896e-8,5.446845113517835e-4,4.455563870804244e-5,-1.4146439051286658e-8,5.450570012046475e-4,4.439214140356481e-5,-1.4092482439868092e-8,5.455138259491807e-4,4.432123995689494e-5,-1.4062247519459378e-8,5.460091567979519e-4,4.4380529159655735e-5,-1.4067548181360422e-8,5.464806332929459e-4,4.457933352573298e-5,-1.411246534473196e-8,5.468639351101996e-4,4.488842557502628e-5,-1.41900303462031e-8,5.471137114483806e-4,4.5240836901430264e-5,-1.4282186009332701e-8,5.472228700801882e-4,4.5549104705021665e-5,-1.436459415403402e-8,5.472286408053625e-4,4.573542557700775e-5,-1.4415174862346914e-8,5.471991045330296e-4,4.576046398285103e-5,-1.4422216878027767e-8,5.47206448294467e-4,4.56349055279638e-5,-1.4387623676551349e-8,5.473019740297997e-4,4.5409058585348715e-5,-1.4324164571538933e-8,5.475045890269017e-4,4.5149831126079944e-5,-1.4249406835206891e-8,5.47803705825606e-4,4.4918876045973197e-5,-1.4180002072172085e-8,5.481698176479473e-4,4.4759851057189094e-5,-1.412830013525889e-8,5.48565692247331e-4,4.469494792163449e-5,-1.410125538583461e-8,5.489546078069922e-4,4.4727065395722936e-5,-1.4100722236229494e-8,5.493051789854964e-4,4.484400912140682e-5,-1.4124308082445898e-8,5.495938405083384e-4,4.5022613923846395e-5,-1.4166321890606745e-8,5.498062624304646e-4,4.523222436300298e-5,-1.4218687392005276e-8,5.499384595504489e-4,4.54378852388539e-5,-1.4271863647322725e-8,5.49997724894559e-4,4.560386201037831e-5,-1.4315865288538859e-8,5.500030030438457e-4,4.5697985530979016e-5,-1.434147018981161e-8,5.499839508065228e-4,4.5696843463098964e-5,-1.4341625669559141e-8,5.499779032270899e-4,4.559110119398946e-5,-1.4312908167490931e-8,5.500244181110129e-4,4.5389582007094315e-5,-1.4256724128095877e-8,5.50157883005538e-4,4.512048381923619e-5,-1.417984329569152e-8,5.503995686945172e-4,4.482844257285975e-5,-1.4093882581779136e-8,5.507511242321261e-4,4.456714389146746e-5,-1.4013561269086788e-8,5.511914791808575e-4,4.438847474538031e-5,-1.3953862718354635e-8,5.516785262955729e-4,4.43302010252111e-5,-1.3926532510634918e-8,5.521561635635225e-4,4.4404755979930705e-5,-1.3936611787065186e-8,5.525663239678071e-4,4.459220322119048e-5,-1.3979975801327925e-8,5.528642063231052e-4,4.484065587117192e-5,-1.4043007349154969e-8,5.530328973052125e-4,4.507661529127626e-5,-1.4105288308440919e-8,5.530916519570143e-4,4.522480506594574e-5,-1.4145236907282978e-8,5.530923528858961e-4,4.523202408225343e-5,-1.4147030087645297e-8,5.531031506537776e-4,4.5085084291692684e-5,-1.4105860437065999e-8,5.531855430718504e-4,4.4813819040833696e-5,-1.4028958709191986e-8,5.533755526889687e-4,4.447784879142051e-5,-1.3932084645392354e-8,5.536768815553462e-4,4.41448232435347e-5,-1.3833668292310375e-8,5.540662856310166e-4,4.387093911013423e-5,-1.3749517436350942e-8,5.545054107827476e-4,4.369036706870036e-5,-1.3689826206305373e-8,5.549526056740539e-4,4.3613801028485625e-5,-1.3658542876311258e-8,5.553711420623051e-4,4.363257224331595e-5,-1.3654223719707622e-8,5.55733434845886e-4,4.3724503286497815e-5,-1.3671440617076656e-8,5.560225166865299e-4,4.385919757848827e-5,-1.3702164569045507e-8,5.56232263778228e-4,4.400211587684637e-5,-1.3736921152732457e-8,5.563673733728169e-4,4.4117846392702796e-5,-1.376575922796316e-8,5.564433941300915e-4,4.4173372568585065e-5,-1.3779194966470485e-8,5.564864419333089e-4,4.414206095567587e-5,-1.3769317275568825e-8,5.565317072407061e-4,4.4008603643539826E-05,-1.373115531210439e-8,5.566196665612034e-4,4.377426004116058e-5,-1.3664180386757936e-8,5.567893255742785e-4,4.3460653879901505e-5,-1.3573495648336821e-8,5.5706903259323e-4,4.3109638309396154e-5,-1.3470018373719109e-8,5.574671621600434e-4,4.277713905643178e-5,-1.3369019224232388e-8,5.579663031544923e-4,4.25209069743737e-5,-1.3286905991693288e-8,5.585242506155931e-4,4.2385091814629774e-5,-1.323695369887385e-8,5.590827837639093e-4,4.238670958930531e-5,-1.322532616995296e-8,5.595820943030839e-4,4.2508928121728134e-5,-1.324879527303495e-8,5.599765436803205e-4,4.270375260425213e-5,-1.3295025360336303e-8,5.602470647653046e-4,4.290357624198227e-5,-1.3345467218010926e-8,5.604066433327727e-4,4.3038521618008536e-5,-1.3380135565607916e-8,5.604971361354452e-4,4.305496671614097e-5,-1.3382982052173816e-8,5.605778644400599e-4,4.293002467591174e-5,-1.3346289025681776e-8,5.607089623263255e-4,4.267729978794635e-5,-1.3272636519098559e-8,5.609347399582315e-4,4.234165410834814e-5,-1.3173718674744843e-8,5.61272824224999e-4,4.1984822487049506e-5,-1.3066489427049024e-8,5.617125088503604e-4,4.1667542738988164e-5,-1.2968201743518012e-8,5.622215885905281e-4,4.1434866394617e-5,-1.289219032748799e-8,5.627575830200749e-4,4.130882130901546e-5,-1.2845587660872705e-8,5.632786025023382e-4,4.1288594336048484e-5,-1.2829102735199409e-8,5.637508743402848e-4,4.135555763250854e-5,-1.2838217765699319e-8,5.641523616550949e-4,4.147987966628914e-5,-1.2864954028178306e-8,5.644734987008431e-4,4.1626480056051095e-5,-1.2899567931198906e-8,5.647164882240774e-4,4.1759528984558676e-5,-1.2931887162585448e-8,5.648942535231952e-4,4.184578296212132e-5,-1.2952297818560158e-8,5.650294889116143e-4,4.1857547900959665e-5,-1.2952577895423737e-8,5.651535715361088e-4,4.177605896823371e-5,-1.2926828568155383e-8,5.653044894483615e-4,4.159567182824132e-5,-1.287267633441649e-8,5.655225692094629e-4,4.132839759346974e-5,-1.279266224815386e-8,5.658430328778544e-4,4.100697766475647e-5,-1.2695307297663935e-8,5.662857653330005e-4,4.068344030322492e-5,-1.2594934042639526e-8,5.668451659124272e-4,4.042019197207262e-5,-1.2509327194232984e-8,5.674853336557398e-4,4.027347907363591e-5,-1.2455107328985577e-8,5.681455713211361e-4,4.027408208489247e-5,-1.244214622307206e-8,5.68756746685192e-4,4.0414004798879e-5,-1.2469513131187434e-8,5.692626340933667e-4,4.0646580039138516e-5,-1.2525133623159566e-8,5.696369955166504e-4,4.090066807453131e-5,-1.2589478046435055e-8,5.698896665275624e-4,4.110245921092196e-5,-1.2641551835441664e-8,5.700608716068607e-4,4.1195953729986446e-5,-1.2664715990718236e-8,5.702077505850598e-4,4.1155798139361454e-5,-1.2650540717421748e-8,5.703884759901265e-4,4.099042424392756e-5,-1.2600051493450478e-8,5.706483903579017e-4,4.073662588412746e-5,-1.2522583891047876e-8,5.710109691405875e-4,4.0448332338844876e-5,-1.243290518949643e-8,5.714748841309391e-4,4.0182934684654553E-05,-1.2347452802728689e-8,5.720170435890389e-4,3.9988544477136714e-5,-1.2280615128135358e-8,5.726001321744273e-4,3.9895057969472874e-5,-1.2241921421025485e-8,5.731821206679281e-4,3.991064069654339e-5,-1.2234717623019245e-8,5.737250198595423e-4,4.002343402058786e-5,-1.2256397133360156e-8,5.742009861844149e-4,4.0206784374766535e-5,-1.2299779958393722e-8,5.745952088943357e-4,4.042579305071043e-5,-1.2355009254206567e-8,5.749061274942017e-4,4.064339540438695e-5,-1.2411383146639144e-8,5.751440773201222e-4,4.0825069665894794e-5,-1.2458778726029885e-8,5.753293799587323e-4,4.094221059405223e-5,-1.2488629625521792e-8,5.754904006567578e-4,4.097477176506438e-5,-1.2494646793562146e-8,5.756615125629631e-4,4.0913864151746437e-5,-1.2473547362790684e-8,5.758803459554417e-4,4.076472695839921e-5,-1.24259847650868e-8,5.761832436211499e-4,4.0549772255380785e-5,-1.2357617600292305e-8,5.765979379808243e-4,4.0310124351701156e-5,-1.2279811549458918e-8,5.771336876089873e-4,4.010269549721812e-5,-1.2209012413795871e-8,5.777716895829274e-4,3.9989598090760646e-5,-1.2163757626176808e-8,5.784616465902294e-4,4.001937776225071e-5,-1.2159125570823381e-8,5.791308482835355e-4,4.020580099469462e-5,-1.2200322952745242e-8,5.797065295022585e-4,4.0515899636114696e-5,-1.2278907274980914e-8,5.80142457888133e-4,4.087731150446172e-5,-1.2374661952472232e-8,5.804354401798264e-4,4.120363917341638e-5,-1.2462792256088949e-8,5.806232139856671e-4,4.142456024104346e-5,-1.2522577976320966e-8,5.807671988462954e-4,4.1505812543823224e-5,-1.2543184545504214e-8,5.809309310098887e-4,4.145299058481706e-5,-1.2524943479233836e-8,5.811633911987712e-4,4.130273058000135e-5,-1.2477155055317291e-8,5.814906054594975e-4,4.110843349549538e-5,-1.241437134424403e-8,5.819145513730104e-4,4.092617541810449e-5,-1.2352610977888855e-8,5.824169208822125e-4,4.0803658015597504e-5,-1.2306198503680667e-8,5.829655041898003e-4,4.077300848955851e-5,-1.2285457641107754e-8,5.835216304790936e-4,4.08473506951388e-5,-1.2295353076190144e-8,5.840475044047213e-4,4.1020878040647856e-5,-1.2335168157344423e-8,5.845123946407954e-4,4.1271912795883656e-5,-1.2399194688289209e-8,5.848968676341912e-4,4.1568009920163966e-5,-1.247819580484653e-8,5.851947152164219e-4,4.1871931312817365e-5,-1.2561243079423654e-8,5.854127287371877e-4,4.214737362730478e-5,-1.2637501168654626e-8,5.855689082537816e-4,4.236363657066199e-5,-1.2697641820982583e-8,5.856898580934266e-4,4.2498978178316354e-5,-1.2734800220127118e-8,5.85807889067023e-4,4.254292268264029e-5,-1.2745207957826337e-8,5.859579513795578e-4,4.249795347224145e-5,-1.272871639020561e-8,5.861741086786202e-4,4.2380895742717424e-5,-1.2689360718495551e-8,5.8648484953241e-4,4.2223796026970555e-5,-1.2635890084310931e-8,5.869065735812319e-4,4.2073073991807874e-5,-1.2581801894459312e-8,5.874356319421588e-4,4.19846475120227e-5,-1.2544061137121026e-8,5.880413756125081e-4,4.201259995003142e-5,-1.2539678227518325e-8,5.886653049404993e-4,4.219108683589354e-5,-1.2580052638216501e-8,5.8923238679551e-4,4.2514839582835756e-5,-1.266480189970253e-8,5.896756386652956e-4,4.2930283800824865e-5,-1.2778839288959433e-8,5.89964101552167e-4,4.334851356362142e-5,-1.2896139522771572e-8,5.901171113360668e-4,4.367814905014522e-5,-1.298951948589008e-8,5.901947880698806e-4,4.38602737483596e-5,-1.3040992057450742e-8,5.902714285460607e-4,4.3885736496831144e-5,-1.3046861211874255e-8,5.904086373518427e-4,4.3789236335983746e-5,-1.3016096632518927e-8,5.90640488345573e-4,4.362965960038413e-5,-1.2964884842237333e-8,5.90971946441086e-4,4.34695603945582e-5,-1.2911008855333938e-8,5.913852195337234e-4,4.336092270372908e-5,-1.2869904121306538e-8,5.918485774305888e-4,4.333812126088688e-5,-1.285252461742886e-8,5.923245446952727e-4,4.3416150897318016e-5,-1.2864501648532461e-8,5.927764593066211e-4,4.359190961413261e-5,-1.2906114467297666e-8,5.931734732856898e-4,4.384714236114294e-5,-1.2972841846778543e-8,5.934942150203255e-4,4.4152466088083324e-5,-1.3056421398296158e-8,5.937291030815587e-4,4.447215885443439e-5,-1.3146311817982143e-8,5.938811933955622e-4,4.47693426906656e-5,-1.3231356330999967e-8,5.93965485886057e-4,4.5011077674093984e-5,-1.3301399351245954e-8,5.94006799600864e-4,4.5172770496475155e-5,-1.334862131885749e-8,5.940365840398179e-4,4.5241413682133494e-5,-1.336846818500244e-8,5.940891110207756e-4,4.521750624615486e-5,-1.3360212923084611e-8,5.941973595900601e-4,4.511571456359875e-5,-1.3327250246980502e-8,5.943887128092454e-4,4.4964352725929755e-5,-1.3277177720368145e-8,5.946803298205737e-4,4.480359021479988e-5,-1.3221572693952441E-08,5.950740552025116e-4,4.4681698944798734e-5,-1.3175121289205661e-8,5.955515209880322e-4,4.4648007751150914e-5,-1.3153551831570361e-8,5.960715426732222e-4,4.474149532569575e-5,-1.3169977028198143e-8,5.965733804112413e-4,4.4975795704802126e-5,-1.3229934760324216e-8,5.969897334847129e-4,4.5325368620618036e-5,-1.3326761651752678e-8,5.972695820723137e-4,4.572244176421522e-5,-1.3440440521292401e-8,5.974020923934746e-4,4.607385900358259e-5,-1.3542760448690568e-8,5.974260041454101e-4,4.6295468638069834e-5,-1.3607887991505155e-8,5.974149745012774e-4,4.63461491160932e-5,-1.3622690856111841e-8,5.974464645346873e-4,4.62408255489987e-5,-1.3590608456208522e-8,5.975733330563519e-4,4.603711609863486e-5,-1.3527729382284185e-8,5.978120949073726e-4,4.5808229996933905e-5,-1.3455010772294891e-8,5.981476506938362e-4,4.561887790575258e-5,-1.3391473757723922e-8,5.985457456463102e-4,4.551241536514983e-5,-1.3350535217826406e-8,5.989652880636257e-4,4.550820785410715e-5,-1.3339057205444769e-8,5.993671400674556e-4,4.560473672048171e-5,-1.3357888193002322e-8,5.997192571010954e-4,4.578464443118222e-5,-1.340296607210915e-8,5.999993638835912e-4,4.601975491101805e-5,-1.3466562670281527e-8,6.001963194062474e-4,4.627562551405624e-5,-1.353859250547407e-8,6.003106951839153e-4,4.651585668922163e-5,-1.3607999789540018e-8,6.003545828554706e-4,4.670640694476506e-5,-1.3664190858733449e-8,6.003504102879558e-4,4.681993271445912e-5,-1.3698426655564152e-8,6.003285040062579e-4,4.6839792267256964e-5,-1.3705039077842174e-8,6.003233654665366e-4,4.6763054815347505e-5,-1.3682318721009288e-8,6.00368980029104e-4,4.6601915443853456e-5,-1.3632979669015082e-8,6.004936892972919e-4,4.638313791509782e-5,-1.3564152706925421e-8,6.007152397239569e-4,4.6145339984406526e-5,-1.348684271745055e-8,6.010365913857648e-4,4.5934168128419516e-5,-1.3414767746104295e-8,6.014429942225124e-4,4.5795480210201754e-5,-1.3362464203894209e-8,6.019011057532637e-4,4.576653383496385e-5,-1.334252963495435e-8,6.023615895275835e-4,4.586559553492988e-5,-1.3362105344807452e-8,6.027669935205449e-4,4.608188309838632e-5,-1.3419300705541302e-8,6.030658883371729e-4,4.6370003546858796e-5,-1.350105745458068e-8,6.032312519987232e-4,4.66548633865428e-5,-1.3584497719127712e-8,6.032758091670896e-4,4.685133527899667e-5,-1.3643100300052348e-8,6.032535495762095e-4,4.6894725810143705e-5,-1.365628640799527e-8,6.03241729155245e-4,4.6767362660908595e-5,-1.3617683021674188e-8,6.033108166392385e-4,4.65049510596044e-5,-1.3537085025814027e-8,6.034993182490741e-4,4.617895985207165e-5,-1.3435213551070888e-8,6.038060843341433e-4,4.5867317225684895e-5,-1.3335114749071355e-8,6.041994185155103e-4,4.563018257654167e-5,-1.3255104395874068e-8,6.046332663829588e-4,4.549926714185694e-5,-1.3205572436516151e-8,6.05061438746373e-4,4.5478931464839044e-5,-1.3189054107180226e-8,6.054462336936745e-4,4.555306960662015e-5,-1.3201909329785792e-8,6.05762009514742e-4,4.5692876070382345e-5,-1.3236331295070042e-8,6.059957599659084e-4,4.586321651672058e-5,-1.3282117826334546e-8,6.061465022300673e-4,4.6027351570760987e-5,-1.332813231699191e-8,6.062243702543427e-4,4.615066462844048e-5,-1.3363565264245378e-8,6.062495021200464e-4,4.620409516581872e-5,-1.3379104609315037e-8,6.062503718534889e-4,4.616766157689615e-5,-1.3368067825864579e-8,6.062610395188557e-4,4.6033924576426214e-5,-1.3327457601791911e-8,6.063169469718518e-4,4.581063544655485e-5,-1.3258772884036288e-8,6.064494044595206e-4,4.55215188896636e-5,-1.3168331958415403e-8,6.066795318747286e-4,4.52042881604833e-5,-1.3066866709055663e-8,6.070128998625647e-4,4.490545427349359e-5,-1.2968213330564991e-8,6.074363111856063e-4,4.467226793872749e-5,-1.2887087372606102e-8,6.079179098524724e-4,4.4543009907630994e-5,-1.2836174421477544e-8,6.084112436310817e-4,4.453736700212919e-5,-1.282297992625794e-8,6.08863370461571e-4,4.464886329443632e-5,-1.2847073663286673e-8,6.092264758703546e-4,4.4841679024146196e-5,-1.289860746681526e-8,6.094712937410751e-4,4.505445305432866e-5,-1.2959127922180999e-8,6.095987972448405e-4,4.521292039621171e-5,-1.3005410854173592e-8,6.096448764943399e-4,4.5250510079934645e-5,-1.3016030794821033e-8,6.096730138384927e-4,4.513114561506076e-5,-1.2978711001202054e-8,6.097545631549566e-4,4.486402580498518e-5,-1.2895124516848801e-8,6.099439852908066e-4,4.450134061490781e-5,-1.2780348513948726e-8,6.102610819546051e-4,4.4118743907326676e-5,-1.265702267633818e-8,6.106884949894511e-4,4.378880296374916e-5,-1.2547376438516559e-8,6.111831302385094e-4,4.356052924504412e-5,-1.2467023709897674e-8,6.116930853079845e-4,4.3451843285146805e-5,-1.2422507196552202e-8,6.121718091847651e-4,4.3453283807383274e-5,-1.2412110270198072e-8,6.125859229567852e-4,4.3537061943772174e-5,-1.242828767855344e-8,6.129174051327997e-4,4.3666315988779066e-5,-1.2460290569013057e-8,6.131625421240779e-4,4.380214478201701e-5,-1.249629588729844e-8,6.133297797994605e-4,4.390824915390768e-5,-1.2524935334363993e-8,6.134376059320164e-4,4.395405443660182e-5,-1.2536392208869133e-8,6.135126429920539e-4,4.391729178049016e-5,-1.2523285610369912e-8,6.135875232541355e-4,4.37866565556534e-5,-1.248151062142838e-8,6.136978474050366e-4,4.3564553195397556e-5,-1.2411078877572878e-8,6.138776204707606e-4,4.3269171658970975e-5,-1.2316794930864575e-8,6.141531157431434e-4,4.293451537346142e-5,-1.2208394276352459e-8,6.145360882992824e-4,4.260690395661579e-5,-1.2099680577646451e-8,6.150183068876578e-4,4.233718420343913e-5,-1.2006354865178858e-8,6.155698862543469e-4,4.216944569007125e-5,-1.194266561911202e-8,6.161432780116315e-4,4.212893829735594e-5,-1.191760894514987e-8,6.166829962369822e-4,4.221304211145604e-5,-1.1931838226690434e-8,6.171390028809723e-4,4.2388733189199025e-5,-1.1976435073662864e-8,6.174801786565707e-4,4.2598204728411776e-5,-1.2034228597516467e-8,6.177039713164523e-4,4.2771969148489644e-5,-1.2083631887323418e-8,6.178390324477566e-4,4.284658717591776e-5,-1.2104190944765916e-8,6.179391490155112e-4,4.2782467541547576e-5,-1.2082381407395732e-8,6.180690499519215e-4,4.257622589977647e-5,-1.2015807665370394e-8,6.182856981106309e-4,4.2262641290182364e-5,-1.1914142478848567e-8,6.186214061728539e-4,4.1904306638940616e-5,-1.1796159869780265e-8,6.190753692770967e-4,4.1572254817565175e-5,-1.168386155567887e-8,6.196167242703293e-4,4.1325277041778395e-5,-1.1596058210408694e-8,6.201967488488639e-4,4.119594759437842e-5,-1.1543865254199268e-8,6.20764019662867e-4,4.118716574602068e-5,-1.1529328261415304e-8,6.21276549030351e-4,4.127757978552318e-5,-1.154678533548196e-8,6.217080946567695e-4,4.143120927489927e-5,-1.1585638643255654e-8,6.220491812385284e-4,4.1606888823869886e-5,-1.1633240123016763e-8,6.223049974865838e-4,4.176527688606243e-5,-1.1677161479087305e-8,6.224922388533137e-4,4.1873203335198556e-5,-1.1706688765447071e-8,6.226360955927154e-4,4.1906205539858945e-5,-1.1713717885084007e-8,6.227676718629662e-4,4.185030251602371e-5,-1.1693341505436549E-08,6.229214415278793e-4,4.1703735041523074e-5,-1.1644381723185078e-8,6.231319853664534e-4,4.147878640125714e-5,-1.1569970337746821e-8,6.234292802965761e-4,4.120299476324085e-5,-1.1478018587251494e-8,6.238323413543623e-4,4.0918246606836314e-5,-1.1381111507640178e-8,6.243421835840833e-4,4.067585345858345e-5,-1.1295177991775304e-8,6.249366570621865e-4,4.052646987191822e-5,-1.1236482520549367e-8,6.255707246045346e-4,4.0506051125566727e-5,-1.1217220872998886e-8,6.261847863392266e-4,4.062225481812146e-5,-1.124105993740093e-8,6.267202336075681e-4,4.08475845493812e-5,-1.1300642714626034e-8,6.271371716095217e-4,4.112393555640522e-5,-1.1378640363826194e-8,6.274272002337375e-4,4.137818217173511e-5,-1.1452374173663731e-8,6.276160661029025e-4,4.1543172110683946e-5,-1.1500321761911784e-8,6.277555903893943e-4,4.157642470580568e-5,-1.1508102924530854e-8,6.27908422691926e-4,4.147064598947023e-5,-1.1472061584588963e-8,6.281309101857208e-4,4.125382444025051e-5,-1.1399670417759892e-8,6.284589806615875e-4,4.0979990293322234e-5,-1.1307001676311571e-8,6.289004951050204e-4,4.071397673517665e-5,-1.1214196847662963e-8,6.294355537344494e-4,4.051475934856745e-5,-1.1140281814471427e-8,6.300239373611482e-4,4.0422039237037176e-5,-1.1098767800734435e-8,6.306167817204206e-4,4.044943019418976e-5,-1.1095165829009265e-8,6.311685570877783e-4,4.058515042629986e-5,-1.1126836428171848e-8,6.316459742628735e-4,4.079850842401508e-5,-1.1184776656645354e-8,6.320322305868174e-4,4.104897677346346e-5,-1.1256406714476454e-8,6.323269912046183e-4,4.129481071708473e-5,-1.1328374881368757e-8,6.325436800244089e-4,4.149944694038418e-5,-1.138873428162963e-8,6.327057717418874e-4,4.16353572641571e-5,-1.142829124798009e-8,6.3284320211077e-4,4.168599958414399e-5,-1.144127484924841e-8,6.329892507073682e-4,4.1646813714983565e-5,-1.1425641935138297e-8,6.331776221375067e-4,4.1525972124440285e-5,-1.1383308731724334e-8,6.334390698103364e-4,4.134505386970275e-5,-1.1320431548573354e-8,6.337968406765966e-4,4.1139068109295805e-5,-1.1247577530122925e-8,6.342606793062239e-4,4.0954382499360176e-5,-1.1179279984573037e-8,6.34820349377044e-4,4.084256691331992e-5,-1.1132243894526839e-8,6.354414692002509e-4,4.084884439949683e-5,-1.1121682761778917e-8,6.360679001502076e-4,4.0996568100376256e-5,-1.1156195968997953e-8,6.366339468110234e-4,4.1273455162251384e-5,-1.1233067444498262e-8,6.370847593082296e-4,4.162814226045832e-5,-1.1336844237008164e-8,6.37396720814852e-4,4.1982708229566924e-5,-1.1443112874876232e-8,6.375870858518857e-4,4.225789061658065e-5,-1.1526456467575253e-8,6.377074182492132e-4,4.239935949578947e-5,-1.1568844891267493e-8,6.378247532323368e-4,4.239301187350808e-5,-1.1564617122042744e-8,6.380001550354765e-4,4.226467189936685e-5,-1.1520634437041544e-8,6.382730696351323e-4,4.20678159364482e-5,-1.145275407366425e-8,6.386547983664781e-4,4.186642207611976e-5,-1.1380759726833166e-8,6.391301491825187e-4,4.1718969727590826e-5,-1.1323481608403951e-8,6.396645134501095e-4,4.16669354931265E-05,-1.1295058824572489e-8,6.402135211432802e-4,4.1728883630486846e-5,-1.130272523179324e-8,6.407329313863037e-4,4.189994975384543e-5,-1.1346210158588048e-8,6.411869273337647e-4,4.215579668992807e-5,-1.141864418294653e-8,6.415535317098374e-4,4.245951292741821e-5,-1.1508603446175233e-8,6.418266451670236e-4,4.276953906141313e-5,-1.160268944345754e-8,6.420150711981394e-4,4.3046889911181794e-5,-1.168800792468656e-8,6.42139481568027e-4,4.326056338850396e-5,-1.1754073581974093e-8,6.422284650134046e-4,4.3390762964130205e-5,-1.1793939423120785e-8,6.423145863944254e-4,4.343025232088572e-5,-1.1804643333497793e-8,6.424308611712833e-4,4.3384560725109035e-5,-1.1787259369334247e-8,6.426075271147033e-4,4.327164998942055e-5,-1.1746830998873365e-8,6.428686772623222e-4,4.312121499188235e-5,-1.1692290186969063e-8,6.43228211111064e-4,4.297319789412587e-5,-1.163620160738782e-8,6.436849034127897e-4,4.2874338512484316e-5,-1.1593853762600689e-8,6.442175178239869e-4,4.287106863696716e-5,-1.1581024865378009e-8,6.447826241944376e-4,4.299769946587701e-5,-1.1610003778983072e-8,6.453192106631316e-4,4.326148989808878e-5,-1.1684410461728622e-8,6.457633643151136e-4,4.363072674477005e-5,-1.179495428359945e-8,6.460709780358178e-4,4.403539258500074e-5,-1.1919425251124777e-8,6.46238269440531e-4,4.438654427814625e-5,-1.202896701159812e-8,6.463067360377512e-4,4.460863357575101e-5,-1.2098638955452586e-8,6.463473522053487e-4,4.466782983677177e-5,-1.2116629130642991e-8,6.464328198700985e-4,4.458091988511223e-5,-1.2087172530117929e-8,6.466134080396352e-4,4.440296244483021e-5,-1.2026767218001455e-8,6.469062893985017e-4,4.420432212394621e-5,-1.1957162905655501e-8,6.472980673486538e-4,4.4049415375376975e-5,-1.1898899064049858e-8,6.477545569824074e-4,4.398348465637827e-5,-1.1867178141227173e-8,6.482321283936542e-4,4.402769158632383e-5,-1.1870077472484313e-8,6.486874451684293e-4,4.4180110616365914e-5,-1.190843181001741e-8,6.490845942283705e-4,4.442004791255551e-5,-1.1976767655848106e-8,6.493996674170178e-4,4.471399475420608e-5,-1.2064930829832403e-8,6.496230132730473e-4,4.502224997790057e-5,-1.2160170877601224e-8,6.497593165315699e-4,4.530541463222377e-5,-1.2249376594925378e-8,6.498257985589669e-4,4.5530023897967826e-5,-1.2321106524374785e-8,6.498490150835266e-4,4.5672787320462324e-5,-1.2367125184429808e-8,6.49860849248668e-4,4.5723111388483726e-5,-1.2383285624306336e-8,6.498943459428724e-4,4.56838734642481e-5,-1.2369777794004631e-8,6.499798483583396e-4,4.5570805788698724e-5,-1.2330940194194202e-8,6.50141540921297e-4,4.5410946737608354e-5,-1.2274858062634918e-8,6.50394252361549e-4,4.524034632505981e-5,-1.2212820673742356e-8,6.507402898474811e-4,4.510081644081227e-5,-1.2158498221920027e-8,6.511662941424877e-4,4.503501619399875e-5,-1.2126476181320007e-8,6.516409652377725e-4,4.507883196177047e-5,-1.2129687005367259e-8,6.521158333795178e-4,4.525065636203942e-5,-1.2175577965498676e-8,6.525322031476455e-4,4.553941364164363e-5,-1.2261726884082065e-8,6.528365381010586e-4,4.5896913451435045e-5,-1.2372957541494924e-8,6.53001864278318e-4,4.6243075736359524e-5,-1.2482966177543175e-8,6.530450153429226e-4,4.6489294263523875e-5,-1.2562182212005331e-8,6.530262302326049e-4,4.657300931178719e-5,-1.2589338662501737e-8,6.530266241761063e-4,4.6484341852986244e-5,-1.2560253186849565e-8,6.531153745404709e-4,4.626789168937222e-5,-1.248839206681805e-8,6.533259500794602e-4,4.600025166059354e-5,-1.2397689341809364e-8,6.536518626923442e-4,4.5759473698595974e-5,-1.2312978138197302e-8,6.540578644141293e-4,4.56028117197643e-5,-1.2253084886290816e-8,6.544960449519266e-4,4.555825704891566e-5,-1.222809841334969e-8,6.549192256583115e-4,4.562646405711048e-5,-1.2239671643138295e-8,6.552892641813089e-4,4.578752220519903e-5,-1.2282737836356728e-8,6.555809511761707e-4,4.6008638879196065e-5,-1.23475952409882e-8,6.557831063329746e-4,4.625097547136351e-5,-1.2421941128098137e-8,6.558981448308248e-4,4.647540239116749e-5,-1.2492798538365653e-8,6.559406151232579e-4,4.664739366488725e-5,-1.2548313680324879e-8,6.55934795368779e-4,4.674108669115587e-5,-1.2579299722569738e-8,6.559114262674878e-4,4.674234926529412e-5,-1.258037528172128e-8,6.559037475636952e-4,4.6650576798607184e-5,-1.2550589153337167e-8,6.559431799480559e-4,4.647890047352641e-5,-1.2493483386171588e-8,6.560551490320222e-4,4.625272895401807e-5,-1.241665830734056e-8,6.562554736211841e-4,4.6006843480568736e-5,-1.2330965549949725e-8,6.565475621712678e-4,4.5781298533340715e-5,-1.224938677601268e-8,6.569205673771478e-4,4.561626701972796e-5,-1.2185538559539806e-8,6.573487109405446e-4,4.554580590585966e-5,-1.2151659149246088e-8,6.577924153502072e-4,4.5590415220543125e-5,-1.215594635662814e-8,6.58202593113294e-4,4.574881097857109e-5,-1.2199412084801173e-8,6.585297262397721e-4,4.59909687918636e-5,-1.2273096298199133e-8,6.587382425042407e-4,4.62568085760598e-5,-1.2357324481940705e-8,6.588231495329708e-4,4.646624084061321e-5,-1.2425073606254522e-8,6.588204978599106e-4,4.65431768960108e-5,-1.2450244405357208e-8,6.588012287440477e-4,4.644637290291428e-5,-1.2418191579088436e-8,6.588458419334591e-4,4.61899779128904e-5,-1.2332619928155143e-8,6.590119357198074e-4,4.5838877755827045e-5,-1.2214031205022718e-8,6.593137391720427e-4,4.548068499544168e-5,-1.2090617955505468e-8,6.597236153319567e-4,4.519227164557173e-5,-1.1987544773090963e-8,6.601895628610029e-4,4.5018724180246425e-5,-1.1920237507966108e-8,6.606554423138694e-4,4.49697296954195e-5,-1.189308702067798e-8,6.610749674083071e-4,4.502738150794323e-5,-1.1901620274760557e-8,6.614178803084616e-4,4.515738862713096e-5,-1.1935726383931564e-8,6.616706357616994e-4,4.531887849385159e-5,-1.1982572911828448e-8,6.61834447382716e-4,4.547133072107415e-5,-1.2028824379413137e-8,6.6192264137107e-4,4.5579126378920714e-5,-1.2062283892577649e-8,6.619580115031964e-4,4.561475770029697e-5,-1.2073180904243843e-8,6.619700433900955e-4,4.556135838574398e-5,-1.2055197467963607e-8,6.61991699576438e-4,4.5414661343623503e-5,-1.200620365179172e-8,6.620555712945934e-4,4.51840896179602e-5,-1.1928622796913211e-8,6.621894741458482e-4,4.489240920507422e-5,-1.182931385336294e-8,6.624119923538018e-4,4.457342997377879e-5,-1.1718880084197724e-8,6.627287685916333e-4,4.4267655432898346e-5,-1.1610397059841187e-8,6.631303288208212e-4,4.401622188040044e-5,-1.1517614629584648e-8,6.635920520441031e-4,4.3853814799379214e-5,-1.1452739383809711e-8,6.640766309640293e-4,4.3801500136949246e-5,-1.1423990223408127e-8,6.645391547065707e-4,4.3860465762502585e-5,-1.1433213609765761e-8,6.649348907757294e-4,4.400781803244625e-5,-1.1474022268078109e-8,6.652295738743438e-4,4.4196208170768975e-5,-1.1531237312247409e-8,6.654109062286146e-4,4.435975285734818e-5,-1.1582666541464982e-8,6.654978651706966e-4,4.442827675775156e-5,-1.1603994416442983e-8,6.655421492594667e-4,4.434891282437948e-5,-1.1576365369570233e-8,6.656163939754637e-4,4.410816482066763e-5,-1.1494114352982963e-8,6.657897957674164e-4,4.3742356818358154e-5,-1.136844192019311e-8,6.661014873919342e-4,4.332714263267976e-5,-1.1223980436229123e-8,6.66546435586102e-4,4.294919512763321e-5,-1.1089453851181167e-8,6.670813088959861e-4,4.267547632709114e-5,-1.0987569771282318e-8,6.676444956798761e-4,4.2535713727573955e-5,-1.0929181332560628e-8,6.681774843805674e-4,4.252258156620681e-5,-1.0913107238000703e-8,6.686384044883153e-4,4.260325002735994e-5,-1.0929587800350869e-8,6.690062161390295e-4,4.2733346818073974e-5,-1.0964592948012124e-8,6.692787368457985e-4,4.286787118068754e-5,-1.1003310653399214e-8,6.694682707915127e-4,4.296777011126571e-5,-1.1032406940396475e-8,6.695972389198812e-4,4.300322240539698e-5,-1.1041321064106932e-8,6.696946149272839e-4,4.295523829967347e-5,-1.1023008875669534e-8,6.697929196037282e-4,4.2816698354687566e-5,-1.0974419442589062e-8,6.699251733474295e-4,4.2593196764431914e-5,-1.0896807753560433e-8,6.701212865700194e-4,4.230341044442153e-5,-1.0795842637994127e-8,6.704037174690174e-4,4.1978221761531796e-5,-1.0681328919295532e-8,6.707828559139265e-4,4.1657672615155404e-5,-1.0566288547495148e-8,6.712532690016723e-4,4.138524242901553e-5,-1.0465216530512158e-8,6.717922865944109e-4,4.119981360746378e-5,-1.0391550497627238e-8,6.723621835534646e-4,4.112674104581725e-5,-1.0354712996658229e-8,6.729163674503193e-4,4.117028254115718e-5,-1.0357404924622589e-8,6.734087601805087e-4,4.1309743555585105e-5,-1.0393953428156289e-8,6.738045432664134e-4,4.150094656252346e-5,-1.0450378613876328e-8,6.740899326696811e-4,4.168357203370962e-5,-1.0506544084907395e-8,6.742784623792691e-4,4.1793849405908306e-5,-1.0540362360195925e-8,6.744112537778521e-4,4.178074134045985e-5,-1.053345924363471e-8,6.745493044657425e-4,4.1621948675312874e-5,-1.0476951591107518e-8,6.747577135709221e-4,4.1334207987166106e-5,-1.0375304924468307e-8,6.750854372839487e-4,4.097200972504231e-5,-1.0246168788815136e-8,6.755482329271165e-4,4.0612262569480024e-5,-1.0115334350837037e-8,6.761231653952755e-4,4.032957409188221e-5,-1.0008413784011982e-8,6.767578521833027e-4,4.017301604488647e-5,-9.94290139609733e-9,6.773894310269758e-4,4.015465619698559e-5,-9.924065754328441e-9,6.779636072244319e-4,4.025271194279116e-5,-9.945684323589636e-9,6.784462992592076e-4,4.042426218751692e-5,-9.994032077050076e-9,6.788262531519046e-4,4.0619750895181834e-5,-1.0052621713449427e-8,6.791114670866537e-4,4.0793953317949755e-5,-1.0105937498144301e-8,6.793233103813246e-4,4.091197852871128e-5,-1.0141630257049476e-8,6.794909850969935e-4,4.0951453051865014e-5,-1.01514585939184e-8,6.7964728168145e-4,4.090274064307937e-5,-1.0131510062344522e-8,6.798254076015645e-4,4.076859742149239e-5,-1.0082138915684628e-8,6.800561699820016e-4,4.0563850495158245e-5,-1.0007849266961698e-8,6.8036477449427e-4,4.031492566409186e-5,-9.917132870207206e-9,6.807668440871827e-4,4.0058407100975396e-5,-9.822042726828585e-9,6.812639721347429e-4,3.98374389784475e-5,-9.737104678895134e-9,6.818400995093161e-4,3.9695020030860256e-5,-9.677186556046806e-9,6.824608377364019e-4,3.966437272967973e-5,-9.65429089058683e-9,6.830778514977682e-4,3.975846050622824e-5,-9.673896804332269e-9,6.8363893699842e-4,3.996251016407234e-5,-9.732153955509115e-9,6.841017372567231e-4,4.023361206932423e-5,-9.815394137449953e-9,6.844466228191916e-4,4.05092582535884e-5,-9.902727164968086e-9,6.846838738110617e-4,4.072297495515305e-5,-9.971213593928136e-9,6.848523051199315e-4,4.082220466885166e-5,-1.000201594026922e-8,6.850095982123903e-4,4.07828469698932e-5,-9.98560223372568e-9,6.852171873960667e-4,4.0616222783899834e-5,-9.924483469796086e-9,6.855238737488718e-4,4.036653532224773e-5,-9.832728989987601e-9,6.859526224257744e-4,4.00993290741107e-5,-9.732322816114245e-9,6.86494446675017e-4,3.988386503340198e-5,-9.647264291981038e-9,6.871115650576727e-4,3.977452661168896e-5,-9.597109977300679e-9,6.877489646437295e-4,3.979728759741124e-5,-9.592045225736865e-9,6.883501673843535e-4,3.994563772478752e-5,-9.631095222420986e-9,6.888714062386018e-4,4.018638516815171e-5,-9.70376889018204e-9,6.89289773006254e-4,4.047168422173579e-5,-9.79400284884246e-9,6.896042371432542e-4,4.075196513064055e-5,-9.884614283434994e-9,6.898314601928995e-4,4.0985699460782386e-5,-9.960814485912439e-9,6.899994707481199e-4,4.114457896454388e-5,-1.0012195088317796e-8,6.901416346331935e-4,4.1214864630885974e-5,-1.0033353714839723e-8,6.902920197616812e-4,4.119656099349532e-5,-1.0023683572674945e-8,6.904821165138293e-4,4.1101881144250444e-5,-9.986848350330236e-9,6.907382638650003e-4,4.09537582206849e-5,-9.930264533573738e-9,6.910790024415842e-4,4.0784383529647454e-5,-9.864646068425661e-9,6.915118287645734e-4,4.06330723894299e-5,-9.803388502339166e-9,6.92029478921974e-4,4.054225759251511e-5,-9.761330963984282e-9,6.926069404711696e-4,4.055042383207215e-5,-9.752392841996608e-9,6.93201577440324e-4,4.068187369966381e-5,-9.785963135087253e-9,6.937591702126083e-4,4.0935603885594335e-5,-9.86281521804032e-9,6.942270330740719e-4,4.1278405821690475e-5,-9.972398042232453e-9,6.945712632534799e-4,4.164815702606528e-5,-1.0093706764041374e-8,6.947908016139201e-4,4.196965425274466e-5,-1.0200641875276863e-8,6.949204861200494e-4,4.217816671559534e-5,-1.027018519806173e-8,6.950204845917e-4,4.2240436893643125e-5,-1.0289782773011855e-8,6.951568783835051e-4,4.2163991349505506e-5,-1.0260761389728324e-8,6.953820071952732e-4,4.1992296890793167e-5,-1.0196951522017627e-8,6.957214881833488e-4,4.1789873918597023e-5,-1.0119904592446122e-8,6.961704254910497e-4,4.162399139921554e-5,-1.0052855248199617e-8,6.966977464138914e-4,4.154851515582117e-5,-1.0015196278929336e-8,6.972559483814732e-4,4.159322790104321e-5,-1.0018554243928807e-8,6.977931798100247e-4,4.1759927789965654e-5,-1.006500579411969e-8,6.982647541256812e-4,4.202510292476047e-5,-1.0147554437825793e-8,6.986416504509654e-4,4.23477429452799e-5,-1.0252547579380231e-8,6.989144432942709e-4,4.267979568978907e-5,-1.0363254734980224e-8,6.990924889111561e-4,4.297633660441667e-5,-1.046354978955787e-8,6.991995765864698e-4,4.3203125469473766e-5,-1.0540778184890215e-8,6.992679525856361e-4,4.334055988722916e-5,-1.0587341630078698e-8,6.993324737511327e-4,4.338433788379723e-5,-1.0601042222300012e-8,6.994259422448656e-4,4.33439373540044e-5,-1.0584573537885036e-8,6.995758178822197e-4,4.324016014019141e-5,-1.0544655239898046e-8,6.998018846283525e-4,4.310255497934784e-5,-1.049116419505745e-8,7.001142366953494e-4,4.296687167505949e-5,-1.0436353487376878e-8,7.00511078834245e-4,4.28720812612912e-5,-1.0393964239501379e-8,7.009763426032131e-4,4.285598693783195e-5,-1.0377799290857615e-8,7.014781075470884e-4,4.294835757893481e-5,-1.0399281482030315e-8,7.01969994354906e-4,4.316142500987284e-5,-1.0463892261942207e-8,7.023982919714376e-4,4.3479848296496525E-05,-1.0567290124078954e-8,7.027162843902773e-4,4.385542505735799e-5,-1.0693127635927223e-8,7.029027821209852e-4,4.42135354664673e-5,-1.0815191406563102e-8,7.029758681401383e-4,4.44744496722845e-5,-1.0904987723913586e-8,7.029914590549362e-4,4.458263269534113e-5,-1.0942205658178163e-8,7.030240973959722e-4,4.4528749813272105e-5,-1.0922540209312683e-8,7.031394395161471e-4,4.435182467687107e-5,-1.0858532246731884e-8,7.033730001998939e-4,4.412187581728143e-5,-1.0773708033050758e-8,7.037236525719877e-4,4.391449186565976e-5,-1.0694038600834027e-8,7.041603691418619e-4,4.378961991431415e-5,-1.0640801646843702e-8,7.046353875274154e-4,4.378031259963003e-5,-1.0626632482199593e-8,7.050976569019387e-4,4.3890906265389334e-5,-1.0654550090175343e-8,7.055033512381783e-4,4.4101463726791514e-5,-1.0719012226212606e-8,7.058225832089542e-4,4.4375368649487437e-5,-1.0808140470310517e-8,7.060425584939559e-4,4.4667972118194066e-5,-1.0906544945457309e-8,7.061676354241381e-4,4.4934992978476056e-5,-1.0998328320161188e-8,7.062167941862384e-4,4.513963638656883e-5,-1.1069817830506132e-8,7.062192461146077e-4,4.525758094198104e-5,-1.1111586225981603e-8,7.062091365135665e-4,4.527941172781372e-5,-1.1119497270185845e-8,7.062203187254132e-4,4.521057587191405e-5,-1.1094762027694266e-8,7.062819845440831e-4,4.5069391812404094e-5,-1.1043233702560278e-8,7.06415505665796e-4,4.488393907460559e-5,-1.0974313413837001e-8,7.066323612634319e-4,4.4688540962570335e-5,-1.089978106738531e-8,7.069327966070445e-4,4.452012245181196e-5,-1.0832652650027417e-8,7.073048809528734e-4,4.4414291049901125e-5,-1.0785940512482935e-8,7.077239303819673e-4,4.4400593182769026e-5,-1.0771010723654536e-8,7.081530282662858e-4,4.449628480384157e-5,-1.0795218004047385e-8,7.08546309372772e-4,4.4698728013663695e-5,-1.0858860998889045e-8,7.088570074624559e-4,4.497837061391854e-5,-1.0952277710884579e-8,7.090511764918637e-4,4.527680031930541e-5,-1.1054882078469456e-8,7.091242875412201e-4,4.551603875633128e-5,-1.1138494306429178e-8,7.091120498076681e-4,4.562208888687946e-5,-1.117598713005094e-8,7.090846177539748e-4,4.5555482629709526e-5,-1.1152408119707443e-8,7.091216217038918e-4,4.533143658656323e-5,-1.1072207380177586e-8,7.092802036001695e-4,4.501504148607371e-5,-1.0957523637321026e-8,7.095747795025035e-4,4.469379194735881e-5,-1.0838617797559788e-8,7.099779924341384e-4,4.4444886939645104e-5,-1.0742641317809363e-8,7.104372322708001e-4,4.431417690490606e-5,-1.0686428868332595e-8,7.108944427121056e-4,4.43116119214771e-5,-1.067478403156329e-8,7.113007184917924e-4,4.441806234799192e-5,-1.0702470480375884e-8,7.11623679367533e-4,4.459632083759559e-5,-1.0757592826290675e-8,7.118492538786992e-4,4.480161570626685e-5,-1.0824953711808661e-8,7.11980233791131e-4,4.4989876558258635e-5,-1.0888886188899312e-8,7.120332870788396e-4,4.512373743613871e-5,-1.093553525218388e-8,7.120351830951165e-4,4.517671189813642e-5,-1.0954618391336977e-8,7.12018506314901e-4,4.513573773315998e-5,-1.094058962873492e-8,7.12017114163592e-4,4.500208629716573e-5,-1.0893112309757543e-8,7.120616914124563e-4,4.47905968840482e-5,-1.0816818974571956e-8,7.121758530794824e-4,4.452730583824109e-5,-1.0720449941183935e-8,7.12373225808455e-4,4.424582850797638e-5,-1.0615582948149321e-8,7.126557056969058e-4,4.3983020894276823E-05,-1.0515185840291802e-8,7.130128748690027e-4,4.377430370445033e-5,-1.0432097453514521e-8,7.134225026408814e-4,4.364884043657226e-5,-1.0377410518766734e-8,7.138521296875519e-4,4.3624612316220915e-5,-1.0358662531311387e-8,7.142621087199356e-4,4.370335181858926e-5,-1.0377769717223068e-8,7.146110340123279e-4,4.386580901383108e-5,-1.0428929632440784e-8,7.148644843579355e-4,4.406916289330847e-5,-1.0497305281474699e-8,7.150068229220568e-4,4.424991700273873e-5,-1.0559887164612516e-8,7.150530524366479e-4,4.4336178298709344e-5,-1.0590042672540263e-8,7.15053734810595e-4,4.42704276374271e-5,-1.056605287956476e-8,7.150846291680763e-4,4.403576931514396e-5,-1.0480847359923442e-8,7.152198511851885e-4,4.3670120179829765e-5,-1.0347183403858284e-8,7.155008744882165e-4,4.325529287265698e-5,-1.019372183871818e-8,7.159202063701489e-4,4.288442453165478e-5,-1.0053486378649688e-8,7.164288382090401e-4,4.262714020159595e-5,-9.95164253828637e-9,7.169595712173114e-4,4.2511112636761016e-5,-9.899008498589871e-9,7.174506599694499e-4,4.2524020942925516e-5,-9.892540841677029e-9,7.178598144621892e-4,4.2627404619268514e-5,-9.91983987587705e-9,7.181678446769699e-4,4.27721963699476e-5,-9.964266310840572e-9,7.183759126586623e-4,4.291045343841636e-5,-1.0008908875743132e-8,7.18500405594647e-4,4.300234497131943e-5,-1.0039122755238085e-8,7.185677828556197e-4,4.30196320106107e-5,-1.0044007543963475e-8,7.186101042079086e-4,4.294717412168661e-5,-1.001723346601736e-8,7.186610533817944e-4,4.278335317154585e-5,-9.957406051808767e-9,7.18752168284341e-4,4.253964376045135e-5,-9.867997924772748e-9,7.189091853091514e-4,4.2239192867652126e-5,-9.756827287293615e-9,7.191486680453425e-4,4.191412441845834e-5,-9.635062646698978e-9,7.194753833185204e-4,4.1601472907260915e-5,-9.515794554155215e-9,7.198809710473828e-4,4.1338056243998875e-5,-9.412302783608438e-9,7.203442861506658e-4,4.115483206636226e-5,-9.33615368049298e-9,7.208335901116579e-4,4.107136650050428e-5,-9.295250483512817e-9,7.21310582686931e-4,4.109113767836152e-5,-9.292009746461441e-9,7.217361374829578e-4,4.1198376722348027e-5,-9.321908690989147e-9,7.220776248483091e-4,4.135721706930838e-5,-9.372781644989014e-9,7.223174798075731e-4,4.151444248885548e-5,-9.42550576306746e-9,7.224616572947125e-4,4.160760778234224e-5,-9.456878589667109e-9,7.225448756233372e-4,4.157965702183735e-5,-9.445137808270311e-9,7.226279081272899e-4,4.139838628719147e-5,-9.377400707335786e-9,7.22782831518834e-4,4.107397411941798e-5,-9.256348015631858e-9,7.230679109607896e-4,4.066348908937088e-5,-9.10200491377539e-9,7.235030324353299e-4,4.025454393631868e-5,-8.94585670514005e-9,7.240604349135902e-4,3.993307278447048e-5,-8.819235976789946e-9,7.246770474161983e-4,3.9752475639384204e-5,-8.74220271896425e-9,7.25280167562206e-4,3.972032945361145e-5,-8.71863631377646e-9,7.258112499168408e-4,3.980545137139982e-5,-8.738490452126625e-9,7.262379795707331e-4,3.995588791311808e-5,-8.783922245220665e-9,7.265545698200255e-4,4.011659749582939e-5,-8.83541706972929e-9,7.267755339873465e-4,4.024105833074878e-5,-8.875936197311278e-9,7.269279845271264e-4,4.029652987094112e-5,-8.892976574019021e-9,7.270451450548466e-4,4.026516750216042e-5,-8.879235354411228e-9,7.271616327638609e-4,4.014326976173892e-5,-8.832575722188413e-9,7.273099551577129e-4,3.993996905439593e-5,-8.755682817923396e-9,7.275175140387404e-4,3.9675705000669275e-5,-8.65552457776656e-9,7.278037036096325e-4,3.938023732409923e-5,-8.542589315450922e-9,7.281770882665271e-4,3.9089662899162196e-5,-8.429786504232964e-9,7.286331360591269e-4,3.884197223268564e-5,-8.330888585721539e-9,7.291533677555678e-4,3.867120217350354e-5,-8.258515599405508e-9,7.297067738756757e-4,3.860090558086704e-5,-8.221844583454592e-9,7.302539666578742e-4,3.8638182704821905e-5,-8.224400957513714e-9,7.307538962269374e-4,3.876983049784128e-5,-8.262452625865695e-9,7.311722092434422e-4,3.896204742743471e-5,-8.324571705863522e-9,7.314897527645678e-4,3.9164524285314036e-5,-8.3927927962959e-9,7.317094414493923e-4,3.931904431090589e-5,-8.445566122962981e-9,7.318594845103638e-4,3.937201425400375e-5,-8.462392890762826e-9,7.319908066651358e-4,3.928917259530832e-5,-8.42948659848983e-9,7.321669790530052e-4,3.906885058053107e-5,-8.345010771919948e-9,7.324469928605998e-4,3.8748281868431985e-5,-8.22172192559327e-9,7.328651675913713e-4,3.839739804730499e-5,-8.084889760603431e-9,7.334166535442571e-4,3.809868218835139e-5,-7.964969302770367e-9,7.340570593855317e-4,3.791967584824037e-5,-7.88746795733556e-9,7.347180158889726e-4,3.789093829132095e-5,-7.864694610367329e-9,7.35330978895752e-4,3.799999059049531e-5,-7.893257941684946e-9,7.358473549973659e-4,3.820188625552753e-5,-7.95762224232136e-9,7.36247320859895e-4,3.8438037090302746e-5,-8.036768609057542e-9,7.365375874964547e-4,3.865343008418449e-5,-8.110432460280896e-9,7.367432165561168e-4,3.880698844533339e-5,-8.163005946748622e-9,7.368986354207467e-4,3.8875061863166875e-5,-8.185035831936871e-9,7.370405983510341e-4,3.885061218849014e-5,-8.173156102939069e-9,7.372035548293182e-4,3.8740714185469477e-5,-8.129326522098361e-9,7.374166923744471e-4,3.8563901864775714e-5,-8.05990590565618e-9,7.377017025310008e-4,3.834777065479802e-5,-7.974743340507008e-9,7.38070622142274e-4,3.8126512150255426e-5,-7.886238130470689e-9,7.385236155784789e-4,3.7937678633434624e-5,-7.80816935910351e-9,7.390471872462534e-4,3.7817479218706066e-5,-7.754041850862354e-9,7.39613896733862e-4,3.779443638936219e-5,-7.734832514708064e-9,7.401848806728716e-4,3.788221163124379e-5,-7.75635096994411e-9,7.407160397257579e-4,3.807351780711525e-5,-7.816863716772319e-9,7.411675017627108e-4,3.83377342940748e-5,-7.905958120875292e-9,7.415142919555773e-4,3.8624442718095306e-5,-8.005552813609206e-9,7.417549191637427e-4,3.887335159084064e-5,-8.093346705012602e-9,7.419146387750976e-4,3.902868594401002e-5,-8.14809060536792e-9,7.420415466924796e-4,3.9054260051663074e-5,-8.155305505607456e-9,7.421957712450767e-4,3.894484020912841e-5,-8.111780096870276e-9,7.424340938914088e-4,3.873006125504485e-5,-8.02737573183699e-9,7.42793899355561e-4,3.846880194086285e-5,-7.923264854219435e-9,7.432812620141698e-4,3.823437454532318e-5,-7.82664187542525e-9,7.438677441412036e-4,3.809405520022208e-5,-7.763143694430137e-9,7.444981839003461e-4,3.808955287654943e-5,-7.749409650064826e-9,7.451073361538792e-4,3.822586805072566e-5,-7.788599612458683e-9,7.456389114710405e-4,3.847282903416642e-5,-7.870587084328902e-9,7.460595325375159e-4,3.8777620572790256e-5,-7.97634017132848e-9,7.463633344203971e-4,3.90818258416466e-5,-8.084164382373755e-9,7.465679154850866e-4,3.9335967587656355e-5,-8.175197120055171e-9,7.467056704916095e-4,3.950769387356267e-5,-8.236653653676395e-9,7.468147802209882e-4,3.958364471163843e-5,-8.262748556136644e-9,7.469323302937862e-4,3.956728801685668e-5,-8.25406326448367e-9,7.470900224543724e-4,3.947522924674709e-5,-8.21625230612436E-09,7.473117786206921e-4,3.9333574246693434e-5,-8.15868872939971e-9,7.476122444451707e-4,3.917483364161524e-5,-8.093285230637837e-9,7.479954258414936e-4,3.9035053263447094e-5,-8.033430521419e-9,7.484532171378763e-4,3.8950407831258895e-5,-7.992775209673987e-9,7.489642810589979e-4,3.895244597740534e-5,-7.983527194781351e-9,7.494944525688141e-4,3.906165830601274e-5,-8.014060469529422e-9,7.500002746529996e-4,3.9280174203610924e-5,-8.086078232861302e-9,7.504369055959056e-4,3.9586013083436254e-5,-8.192238951203957e-9,7.507699029120727e-4,3.993257848288867e-5,-8.31570446363603e-9,7.509875768828624e-4,4.025651618290501e-5,-8.432888245201967e-9,7.511084739632404e-4,4.049377684511111e-5,-8.519412651981377e-9,7.511792950330379e-4,4.059903216808652e-5,-8.557453460506901e-9,7.51262580818493e-4,4.056073182061699e-5,-8.541545996409175e-9,7.514184424281146e-4,4.040549547796316e-5,-8.480474453332119e-9,7.516871944073718e-4,4.019036204144835e-5,-8.394680466844668e-9,7.520786833722089e-4,3.998634873333417e-5,-8.31041577663291e-9,7.525708694622507e-4,3.985920059382761e-5,-8.252707967838128e-9,7.531170338310043e-4,3.985300180192867e-5,-8.239147244363815e-9,7.536588526186752e-4,3.998070036708499e-5,-8.276008258796359e-9,7.541413990265233e-4,4.022342678605548e-5,-8.357544078241255e-9,7.54525863865062e-4,4.05380201242533e-5,-8.468421354961952e-9,7.547967008719969e-4,4.0869815523018587e-5,-8.588335122366214e-9,7.549619635945633e-4,4.116635887970118e-5,-8.697206288555848e-9,7.550480101612701e-4,4.1388047065979665e-5,-8.779387588935774e-9,7.550913554910073e-4,4.151357045899603e-5,-8.825967420826681e-9,7.551305842522161e-4,4.154031612162445e-5,-8.835132581061215e-9,7.552001895864037e-4,4.148139165922518e-5,-8.811164119887681e-9,7.55326828426084e-4,4.1361260126847735e-5,-8.762820923675844e-9,7.555274925687125e-4,4.12114438663705e-5,-8.70170647458801e-9,7.558087203055979e-4,4.1066871518413693e-5,-8.640891785799208e-9,7.561661037027524e-4,4.09626519740274e-5,-8.593743073534889e-9,7.565837873294337e-4,4.0930595848213674e-5,-8.572674913245856e-9,7.570343023719693e-4,4.0994708019895345e-5,-8.58746909968765e-9,7.574798432523166e-4,4.116526167701248e-5,-8.642942450707564e-9,7.578766597453443e-4,4.143219506580418e-5,-8.736227826676889e-9,7.581839700006578e-4,4.1760430647830195e-5,-8.85472089607003e-9,7.583769007372872e-4,4.209143613341075e-5,-8.97646260497755e-9,7.584593350854895e-4,4.235492678888832e-5,-9.074535079715516e-9,7.584693326984003e-4,4.249010700473473e-5,-9.125223368184249e-9,7.58470988460264e-4,4.246860282595259e-5,-9.116849569321388e-9,7.585337351705025e-4,4.230716762507732e-5,-9.054700673282172e-9,7.587083994551931e-4,4.206260627237825e-5,-8.959261900385463e-9,7.590114511903744e-4,4.181169099700161e-5,-8.858889905876627e-9,7.594231618304254e-4,4.162653730197789e-5,-8.780808674797843e-9,7.598974502542237e-4,4.155567159126383e-5,-8.744091746991325e-9,7.603770701441117e-4,4.161547883315085e-5,-8.756261200644959e-9,7.608083072352005e-4,4.1791395294714015e-5,-8.813314074637931e-9,7.611518311466191e-4,4.204568142158321e-5,-8.902175671211233e-9,7.613885521055572e-4,4.232834360337178e-5,-9.004492689727314e-9,7.615206177534766e-4,4.258845489577387e-5,-9.100837967244961e-9,7.61568322961355e-4,4.2783817580922045e-5,-9.174529986143186e-9,7.615641863347267e-4,4.288746563387388e-5,-9.214382010099968e-9,7.615458421224065e-4,4.289030424473849e-5,-9.215981555878051e-9,7.615493776879412e-4,4.280020160465099e-5,-9.181526671744856e-9,7.616042486398303e-4,4.26385797343642e-5,-9.118594656166542e-9,7.61730210455046e-4,4.2435795379432153e-5,-9.03837554219817e-9,7.61936050598561e-4,4.222646210520275e-5,-8.953874020503188e-9,7.622194897874063e-4,4.204535712200338e-5,-8.87837427683221e-9,7.625676250645121e-4,4.1923882039288665e-5,-8.824153587401546e-9,7.629576171601758e-4,4.188660389994002e-5,-8.801211913123232e-9,0.00076335781686778445,4.194730410322629e-5,-8.815719768604965e-9,7.637301806589586e-4,4.210424149540176e-5,-8.868024377405146e-9,7.640353866362429e-4,4.233530176320579e-5,-8.950502771608857e-9,7.642418368971225e-4,4.259542541961727e-5,-9.046295943306457e-9,7.643379706413167e-4,4.282042794217269e-5,-9.130652554192153e-9,7.643436783033333e-4,4.29411494887276e-5,-9.176459932444947e-9,7.643128225427903e-4,4.290719105443412e-5,-9.163573390875584e-9,7.643198908851147e-4,4.27107298651634e-5,-9.088104238947882e-9,7.644329712891078e-4,4.23954390951903e-5,-8.965872528852865e-9,7.646866633436667e-4,4.204199444422708e-5,-8.826934866527333e-9,7.650704200976676e-4,4.17372669333947e-5,-8.704057045239502e-9,7.655369936842672e-4,4.154471093131832e-5,-8.621706108552556e-9,7.660227565342318e-4,4.1489461027239444e-5,-8.590446292021975e-9,7.664679096395077e-4,4.155968867214678e-5,-8.60719762281304e-9,7.668295552510263e-4,4.1717667344140696e-5,-8.65897698447111e-9,7.670867797953163e-4,4.191334217832278e-5,-8.727615499482921e-9,7.672399375245228e-4,4.209611415617943e-5,-8.794011363368658e-9,7.673067113076542e-4,4.2223374435902354e-5,-8.841422117427617e-9,7.673167461421355e-4,4.226589688328241e-5,-8.857772846673981e-9,7.673057770691697e-4,4.221051342646373e-5,-8.837001052988211e-9,7.673098402283448e-4,4.206030802892788e-5,-8.779391079594279e-9,7.673601781277127e-4,4.18326361185597e-5,-8.690943756311483e-9,7.674793660680467e-4,4.1555511526051535e-5,-8.58199870451685e-9,7.676789770593695e-4,4.126301892957958e-5,-8.465429763661297e-9,7.679588364412986e-4,4.0990480338567314e-5,-8.354768907767848e-9,7.683075907368027e-4,4.077001331558171e-5,-8.262536838002104e-9,7.687041577968274e-4,4.062672035544098e-5,-8.198843955832656e-9,7.691197778494181e-4,4.057536670843389e-5,-8.170131786714939e-9,7.69520695114969e-4,4.061730481647757e-5,-8.17788778750396e-9,7.698719236009533e-4,4.073758088267318e-5,-8.217289031700045e-9,7.701429410375053e-4,4.090284202188645e-5,-8.276083307954193e-9,7.703158959245221e-4,4.106194157234824e-5,-8.334583011415699e-9]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json
new file mode 100644
index 0000000..ed067a1
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":12000,"numberOfSamples":1000,"samples":[7.703954280162467e-4,4.1152337826266915e-5,-8.368108119871265e-9,7.704163319665058e-4,4.111507788730868e-5,-8.352989399151336e-9,7.704421464154993e-4,4.091720944904923e-5,-8.275542352848811e-9,7.705485092428724e-4,4.05724562623383e-5,-8.140252864992262e-9,7.707939985966856e-4,4.014524130054576e-5,-7.971353086916377e-9,7.71193504222048e-4,3.972957759547678e-5,-7.80469566907836e-9,7.717115053607008e-4,3.9412072212316335e-5,-7.673655282248528e-9,7.722792203821364e-4,3.924081276169691e-5,-7.597334312683116e-9,7.728228927422465e-4,3.921592014800571e-5,-7.576902082499595e-9,7.732865636479628e-4,3.930044006202883e-5,-7.599469965429773e-9,7.736417360467977e-4,3.9439508716162856e-5,-7.645015059481085e-9,7.738862021781628e-4,3.9577299627356655e-5,-7.692550022805146e-9,7.740375781067476e-4,3.9667776867413035e-5,-7.724156675043192e-9,7.741257583521852e-4,3.9679734947780095e-5,-7.727075835179889e-9,7.741863193020013e-4,3.959810915098842e-5,-7.69451274251175e-9,7.742552430288779e-4,3.9423328672554246e-5,-7.625696494804441e-9,7.743646142276804e-4,3.9169548057952974e-5,-7.525395913350832e-9,7.745390796275454e-4,3.886191912277735e-5,-7.4029175785362335e-9,7.747931611691499e-4,3.853296073940333e-5,-7.2706518736087654e-9,7.751296404933389e-4,3.821816871539602e-5,-7.14230656603222e-9,7.75539277044951e-4,3.795118644851318e-5,-7.03102083378519e-9,7.760019965895818e-4,3.7759097444815016e-5,-6.947589780698099e-9,7.764894114568546e-4,3.7658393030000226e-5,-6.898960011119357e-9,7.769683935525284e-4,3.765194567776308e-5,-6.887041206138857e-9,7.77405468600329e-4,3.7727187339015794e-5,-6.907852463658269e-9,7.777719367210197e-4,3.7855696317654865e-5,-6.951096001721251e-9,7.780497715515111e-4,3.799465132874708e-5,-7.000433114460731e-9,7.782381033839588e-4,3.809125972066116e-5,-7.035036448543083e-9,7.783590131789634e-4,3.809174285674149e-5,-7.033143881376136e-9,7.784595953194529e-4,3.795570392998253e-5,-6.97793131163529e-9,7.786057068107846e-4,3.767368510457848e-5,-6.864708360881282e-9,7.78863996118783e-4,3.728037531656348e-5,-6.706310810691064e-9,7.792756265371022e-4,3.685219468959701e-5,-6.532225465482031e-9,7.798348397283327e-4,3.648330405006227e-5,-6.379231745544197e-9,7.804875774404013e-4,3.624915992465997e-5,-6.277220111165846e-9,7.811532791147602e-4,3.6178446406365796e-5,-6.238248751260801e-9,7.817563618614648e-4,3.624887846641678e-5,-6.254752293779451e-9,7.822492066349364e-4,3.6404572752001926e-5,-6.305999039127454e-9,7.826184621073835e-4,3.658034238992342e-5,-6.367226110433409e-9,7.828786448897808e-4,3.672020080806501e-5,-6.416659701095429e-9,7.830611528872669e-4,3.678622737434062e-5,-6.439002339589363e-9,7.83204269111392e-4,3.6760045223355876e-5,-6.4262288080890655e-9,7.83346116265409e-4,3.6640538094929564e-5,-6.376990645821899e-9,7.835202865150684e-4,3.644047816686522e-5,-6.2955425776532835e-9,7.837530585274323e-4,3.618322636043522e-5,-6.190565289506217e-9,7.840613538345039e-4,3.5899528490766174e-5,-6.073894295370791e-9,7.844511692520874e-4,3.56240404001225e-5,-5.959079652820332e-9,7.849166362486965e-4,3.5391266889247926e-5,-5.859734881539029e-9,7.854401461991078e-4,3.5230870470624936e-5,-5.787703349498604e-9,7.85994077008628e-4,3.516280326863614e-5,-5.751203618221222e-9,7.865443681490566e-4,3.519312942196211e-5,-5.753224515569559e-9,7.870557121649313e-4,3.531147041257569e-5,-5.790462278713693e-9,7.874977374834473e-4,3.549084781661851e-5,-5.8530751899271e-9,7.878512977067683e-4,3.5690381696580056e-5,-5.925483082828172e-9,7.88113902130303e-4,3.586089281430252e-5,-5.9883395159535995e-9,7.883033069918536e-4,3.595324388575569e-5,-6.021732124830117e-9,7.884579960410935e-4,3.5929083510116866e-5,-6.009544248256601e-9,7.886327975757129e-4,3.577280030598468e-5,-5.9444715378693474e-9,7.888879780100181e-4,3.550164046195876e-5,-5.832367391647236e-9,7.8927192870103e-4,3.51687389345516e-5,-5.693704861085736e-9,7.898018205719634e-4,3.4853326117873307e-5,-5.559814012217819e-9,7.904515896948133e-4,3.4636846056963114e-5,-5.463410169207496e-9,7.911567365586743e-4,3.457328365667514e-5,-5.426733674861982e-9,7.91836723351535e-4,3.4669207955395765e-5,-5.453450884163303e-9,7.924237202788972e-4,3.488486649734166e-5,-5.5288267094573905e-9,7.928824548961669e-4,3.515389152880303e-5,-5.627269436403621e-9,7.932136820118008e-4,3.540839736028799e-5,-5.722097489506235e-9,7.934449059141124e-4,3.5597063748403574e-5,-5.792673659357338e-9,7.936168882573704e-4,3.569210775996662e-5,-5.827295173952732e-9,7.937723217445624e-4,3.568791359332356e-5,-5.822884193637893e-9,7.93948800831336e-4,3.559595323883983e-5,-5.783216738249511e-9,7.941754088277288e-4,3.543933477989003e-5,-5.716920600537979e-9,7.944713320113322e-4,3.524834071649752e-5,-5.635744464363097e-9,7.948452117223364e-4,3.505690102972568e-5,-5.5531067119024055e-9,7.952946621025866e-4,3.489936168856889e-5,-5.482741290558481e-9,7.958060134527227e-4,3.4806877971801684e-5,-5.437234302862502e-9,7.963548356244236e-4,3.4803064153757236e-5,-5.4263155715433935e-9,7.969080873912969e-4,3.4899187129560714e-5,-5.454979598662578e-9,7.974285582348853e-4,3.50899868901018e-5,-5.521799771482021e-9,7.978815595783528e-4,3.53517139310461e-5,-5.618028402827992e-9,7.982428279621153e-4,3.5643920541599894e-5,-5.728107579266846e-9,7.985056927078104e-4,3.591576113045357e-5,-5.8319638327390805e-9,7.986852279968585e-4,3.6116131940588234e-5,-5.908914090462572e-9,7.988176580367524e-4,3.620557989303193e-5,-5.942429308719043e-9,7.989544079791842e-4,3.616720864975489e-5,-5.924668401918435e-9,7.991513656849079e-4,3.601375362426653e-5,-5.859607617947738e-9,7.994550428476274e-4,3.5788266373648105e-5,-5.763648882378041e-9,7.99888593020665e-4,3.5556588356057684e-5,-5.662870662485801e-9,8.004419741134302e-4,3.539153188530321e-5,-5.586797190304597e-9,8.010710698253013e-4,3.5351857597047766e-5,-5.559879219657929e-9,8.017086298947224e-4,3.546304659868737e-5,-5.5935163200738305e-9,8.022846671415112e-4,3.5708577068191366e-5,-5.6822096378184195e-9,8.027481145977655e-4,3.603666410112383e-5,-5.805964874906324e-9,8.03080122412991e-4,3.637928126071499e-5,-5.9377647708489825e-9,8.032943410005627e-4,3.66738652272459e-5,-6.0522761139605395e-9,8.034269249007324e-4,3.687843167960255e-5,-6.132033879229968e-9,8.035230519879982e-4,3.697653334579644e-5,-6.1696217748146e-9,8.036257380118303e-4,3.6974206946549126e-5,-6.166656508896828e-9,8.037692352128727e-4,3.689330257374978e-5,-6.131278442552063e-9,8.039764427338145e-4,3.6764723596644845e-5,-6.075520263494496e-9,8.042586457584074e-4,3.662315128777011e-5,-6.013183162784273e-9,8.046160819092535e-4,3.6503272989771094e-5,-5.9582713714511854e-9,8.050385231957502e-4,3.643678976682334e-5,-5.9237473528870625e-9,8.055057955743184e-4,3.644934285412461e-5,-5.920288595123292e-9,8.05988792090945e-4,3.655676717208342e-5,-5.95478706400642e-9,8.064519656770659e-4,3.676075426661275e-5,-6.028574833606665e-9,8.068582848986766e-4,3.7045013088594046e-5,-6.1357749440002495e-9,8.071769237677392e-4,3.737399900933667e-5,-6.26261951082692e-9,8.073924491758243e-4,3.769659412573422e-5,-6.388754892200863e-9,8.075124666197616e-4,3.7955997865778476e-5,-6.491115253060035e-9,8.075698393218493e-4,3.8104352666225344e-5,-6.549812033282912e-9,8.07616918266904e-4,3.811755258854625e-5,-6.5542030392740885e-9,8.077125028108634e-4,3.8004458985452114e-5,-6.506795533466793e-9,8.079056000982033e-4,3.780654452780539e-5,-6.4233624926436094e-9,8.082214227720043e-4,3.758774308343327e-5,-6.3291414262697445e-9,8.086539871520523e-4,3.741775103981728e-5,-6.252328710187585e-9,8.091672759069606e-4,3.7353752588214316e-5,-6.216752306565877e-9,8.097045052884347e-4,3.742558962134468e-5,-6.235686559437506e-9,8.10203012993122e-4,3.7628423384850995e-5,-6.308502277607127e-9,8.106106251449948e-4,3.792510731679957e-5,-6.421212634856097e-9,8.108985322821864e-4,3.8257644162653106e-5,-6.550833196339432e-9,8.11066628774171e-4,3.856383400569566e-5,-6.6720638631456955e-9,8.111401568994287e-4,3.8793232686939005e-5,-6.763879623403471e-9,8.111600098107639e-4,3.89173073971411e-5,-6.813868422693099e-9,8.111711107269196e-4,3.893182181341246e-5,-6.8194280235812216e-9,8.112128636990658e-4,3.8852913529948424e-5,-6.786357912765378e-9,8.1131356935384e-4,3.8710088334482416e-5,-6.726121364291298e-9,8.114885730374386e-4,3.853908980505929e-5,-6.652976845483148e-9,8.117408037071133e-4,3.837625006855202e-5,-6.5816575047402725e-9,8.120622864326276e-4,3.825456404102906e-5,-6.5257403552766695e-9,8.124357145823514e-4,3.82008938099246e-5,-6.496493824519633e-9,8.128358550233297e-4,3.823344877076438e-5,-6.50185004606853e-9,8.132312194083829e-4,3.8358874558908814e-5,-6.54518991660995e-9,8.135869354214777e-4,3.856887726212377e-5,-6.623869747140799e-9,8.138698868858205e-4,3.8837323813125146e-5,-6.727869263055802e-9,8.140566018155787e-4,3.91199837876055e-5,-6.83950023112515e-9,8.141427039935174e-4,3.935979230186433e-5,-6.9354371500791985e-9,8.14150262656473e-4,3.949946847388898e-5,-6.9918722744796985e-9,8.141277285832854e-4,3.949960053306327e-5,-6.991994835378283e-9,8.141388942367572e-4,3.935526219250151e-5,-6.93289197521611e-9,8.142430879224422e-4,3.910207785679162e-5,-6.8281493368907015e-9,8.144749296276758e-4,3.880686864520632e-5,-6.704223833237992e-9,8.1483306083408e-4,3.854646680042599e-5,-6.592073096421126e-9,8.152821053230805e-4,3.838435896231063e-5,-6.5178631025860026e-9,8.157651947313659e-4,3.835428291873892e-5,-6.49629781434836e-9,8.162207450781731e-4,3.845478693315215e-5,-6.528135674230928e-9,8.16597684699937e-4,3.865376270796675e-5,-6.60159629155916e-9,8.168657158061926e-4,3.889947743847334e-5,-6.69644446442954e-9,8.170194049574676e-4,3.913422953807289e-5,-6.7893400986806185e-9,8.17076394641524e-4,3.930728020730456e-5,-6.85914255437804e-9,8.170710316645813e-4,3.938449175604022e-5,-6.891061862959034e-9,8.170454569870298e-4,3.935306732398158e-5,-6.878882809994513e-9,8.170405722878981e-4,3.9221105681444305e-5,-6.825033584806315e-9,8.1708896023377e-4,3.901310215359767e-5,-6.7388979016364186e-9,8.172108407223391e-4,3.87633764776707e-5,-6.634171213681119e-9,8.174130175522054e-4,3.850938229687362e-5,-6.526094414707984e-9,8.176899834395489e-4,3.8286205079792516e-5,-6.4291520891420515e-9,8.180260959470649e-4,3.812267075009407e-5,-6.3554492104173685e-9,8.183979894619872e-4,3.803873780290355e-5,-6.313637763487015e-9,8.187769116206049e-4,3.804351923521837e-5,-6.308093725118056e-9,8.191312129866966e-4,3.813337134793312e-5,-6.338063937256885e-9,8.194296942684052e-4,3.8289922698924704e-5,-6.396704673018225e-9,8.196467238419641e-4,3.847879781237149e-5,-6.470354270719354e-9,8.197695294206804e-4,3.8650968100779566e-5,-6.538921130269099e-9,8.19806513649201e-4,3.874943540462814e-5,-6.5785960033068025e-9,8.197929489727498e-4,3.8723134804595094e-5,-6.5676898771434025e-9,8.197883002079536e-4,3.854613941350416e-5,-6.4947236728071645e-9,8.198609759695765e-4,3.823403064971981e-5,-6.365297279203114e-9,8.200636944477346e-4,3.784594464219167e-5,-6.203000857389413e-9,0.000820411436661712,3.746667085519243e-5,-6.042172936215794e-9,8.208749674671344e-4,3.7176223092774686e-5,-5.915617415305801e-9,8.213932248000017e-4,3.7022992160726405e-5,-5.843759010230899e-9,8.218961027605576e-4,3.701275044446644e-5,-5.830076453078521e-9,8.223254904904929e-4,3.711435819021485e-5,-5.863118056849916e-9,8.226473843906112e-4,3.727482958449793e-5,-5.922239824745653e-9,8.228545590175748e-4,3.7435687186837764e-5,-5.983966399587255e-9,8.229627474394682e-4,3.7545885310616436e-5,-6.027176921838554e-9,8.230036090129152e-4,3.756990148797665e-5,-6.036554527428151e-9,8.230167806825249e-4,3.749138311092206e-5,-6.004372061981051e-9,8.230423185742567e-4,3.731317666393389e-5,-5.930818699795622e-9,8.231143493501816e-4,3.705449505134662e-5,-5.823063768625377e-9,8.23256553209646e-4,3.674606808012696e-5,-5.693352353058202e-9,8.234798189428454e-4,3.642429612693932e-5,-5.556571384393087e-9,8.237820413355269e-4,3.6125418828181186e-5,-5.427765212931279e-9,8.241496751844597e-4,3.588054059534543e-5,-5.320016584338888e-9,8.245603883153199e-4,3.571199342395666e-5,-5.242923452023574e-9,8.249861688108776e-4,3.563099782478505e-5,-5.201638270344065e-9,8.253965549120751e-4,3.563626588694151e-5,-5.1962726434097535e-9,8.257620082869455e-4,3.571323197160154e-5,-5.221486300041849e-9,8.260577695440884e-4,3.583385451251235e-5,-5.266230045559657e-9,8.262687299902825e-4,3.595753207818218e-5,-5.313924512584801e-9,8.263954241197148e-4,3.6034603798458864e-5,-5.343784865943491e-9,8.264598903887887e-4,3.601442540484084e-5,-5.334201311502159e-9,8.265081515702821e-4,3.585914554288692e-5,-5.268642284511385e-9,8.26604385596247e-4,3.556101693181241e-5,-5.143074426032549e-9,8.268132192939278e-4,3.515537353926115e-5,-4.971501142912185e-9,8.271738744510702e-4,3.471782861774951e-5,-4.7848532086355065e-9,8.276795586094963e-4,3.4340322196190036e-5,-4.621118053741745e-9,8.282766891716653e-4,3.4095760039524445e-5,-4.5108069909192165e-9,8.288861464980373e-4,3.401140563924369e-5,-4.465996728964361e-9,8.29433355059079e-4,3.406500941237964e-5,-4.4785874372255114e-9,8.298704729894737e-4,3.420103631857123e-5,-4.526688711410476e-9,8.301833096396713e-4,3.4353709967328716e-5,-4.583790454622501e-9,8.303862100769367e-4,3.446546478614344e-5,-4.626173157513306e-9,8.305118250621173e-4,3.449687603771798e-5,-4.6370194576684565e-9,8.306008664699762e-4,3.442941009341466e-5,-4.607762309491803e-9,8.306940322478887e-4,3.426386875947961e-5,-4.537752547464339e-9,8.308263261536525e-4,3.401682527001027e-5,-4.4330652748613145e-9,8.310232819304966e-4,3.371620106257414e-5,-4.304822699303797e-9,8.312987280593526e-4,3.339641097448233e-5,-4.167187973746248e-9,8.31653979219806e-4,3.309335744578138e-5,-4.0351952674026125e-9,8.32078417238307e-4,3.283958122742209e-5,-3.9226242940869606e-9,8.325514069439921e-4,3.26599656110982e-5,-3.8401496329485945e-9,8.330453353948687e-4,3.256846904668967e-5,-3.793977723288974e-9,8.335293651888821e-4,3.2566169333962955e-5,-3.785049055168084e-9,8.33973516225973e-4,3.264061001145597e-5,-3.808740687729704e-9,8.343528580041156e-4,3.2766396288388346e-5,-3.855005633134729e-9,8.346517248312861e-4,3.290709657118518e-5,-3.9089874063833434e-9,8.348679389439184e-4,3.301872928211123e-5,-3.95230090306051e-9,8.350167359300278e-4,3.305558632640454e-5,-3.965393684369818e-9,8.351331058149185e-4,3.297932755397413e-5,-3.9314416005053e-9,8.352699660831031e-4,3.277126367429032e-5,-3.8417220291605366e-9,8.354889117471341e-4,3.244507340953231e-5,-3.7012047953805833e-9,8.358419691208809e-4,3.205326833172769e-5,-3.531440109697599e-9,8.36348763283404e-4,3.167867290599403e-5,-3.3670502139274996e-9,8.369813197061595e-4,3.140782451156133e-5,-3.244586908337016e-9,8.376693061030729e-4,3.129669563122999e-5,-3.1881493598681102e-9,8.383263658012633e-4,3.134863920078477e-5,-3.200051972071662e-9,8.388826052155265e-4,3.151766556410064e-5,-3.2619908468242225e-9,8.393050072888866e-4,3.173205489277276e-5,-3.344664087646371e-9,8.395988757541516e-4,3.192172100776251e-5,-3.419003963066664e-9,8.397963286098811e-4,3.203621272799185e-5,-3.46362815353071e-9,8.399416326313247e-4,3.205061679819683e-5,-3.4674080518768483e-9,8.400794992423449e-4,3.1963263817541386e-5,-3.4287495907215916e-9,8.402479103687121e-4,3.179002909330446e-5,-3.3534888117140308e-9,8.404745687451004e-4,3.155830071326884e-5,-3.2525737289196144e-9,8.407754646399417e-4,3.130173895136262e-5,-3.1399368209433314e-9,8.41154541388092e-4,3.1055764720891035e-5,-3.0305415711644196e-9,8.416041280544131e-4,3.085345156272672e-5,-2.9385364426828023e-9,8.421061656017975e-4,3.072164283076384e-5,-2.8755213785209154e-9,8.426344113814458e-4,3.067736638925079e-5,-2.8490015368691745e-9,8.431577953645121e-4,3.072498523450466e-5,-2.8612024549307127e-9,8.436447971117692e-4,3.085470440573325e-5,-2.9084547718786858e-9,8.440683720702881e-4,3.1042869672780824e-5,-2.981273689818602e-9,8.444108321936859e-4,3.125426055813509e-5,-3.065198477158535e-9,8.446680629527056e-4,3.144642492558669e-5,-3.142451937358192e-9,8.448524507159502e-4,3.15759057443261e-5,-3.194437005461156e-9,8.449938340091091e-4,3.160610588444374e-5,-3.2050494314965393e-9,8.451374660071655e-4,3.151638576719877e-5,-3.1646699302547115e-9,8.453375715697237e-4,3.1311130994121866e-5,-3.0742611477808833e-9,8.456453986738488e-4,3.1025780835067146e-5,-2.94819557957702e-9,8.46092653379528e-4,3.0725045293271956e-5,-2.81368862948315e-9,8.466753220872281e-4,3.0488818598972834e-5,-2.704879810332908e-9,8.473471109643087e-4,3.038640446510119e-5,-2.6518278127619258e-9,8.480305696476147e-4,3.0449024854662588e-5,-2.668679548466348e-9,8.486441257401572e-4,3.065628903781551e-5,-2.7477040330430985e-9,8.491313375173792e-4,3.094576582096809e-5,-2.8631317709746885e-9,8.494766164139384e-4,3.123946697058364e-5,-2.9822273668107125e-9,8.497020423260754e-4,3.1471127846907625e-5,-3.0767866876898872e-9,8.498521170161459e-4,3.16017891014394e-5,-3.129775126187276e-9,8.499770409409726e-4,3.1621830699592834e-5,-3.1363362066964675e-9,8.501209480543094e-4,3.1544720456021056e-5,-3.1013685836141294e-9,8.503161532077362e-4,3.1398399640952655e-5,-3.036097487468567e-9,8.505816546173871e-4,3.1217759899263695e-5,-2.9550165687006546e-9,8.509236995527479e-4,3.103916188717301e-5,-2.8735662703891047e-9,8.513369862483362e-4,3.0896507607776705e-5,-2.8063743424389867e-9,8.518060495699486e-4,3.081805794501351e-5,-2.7657886014572145e-9,8.523069735798167e-4,3.082345930368575e-5,-2.7605358876292335e-9,8.528098318936862e-4,3.0920864735206294e-5,-2.79447672381635e-9,8.532822991542584e-4,3.110457416848017e-5,-2.8656065993726486e-9,8.536945524033567e-4,3.1354085988535145e-5,-2.965633018689591e-9,8.540249574865114e-4,3.163548969538209e-5,-3.080489694586202e-9,8.542654720972812e-4,3.190574453586719e-5,-3.192028596537508e-9,8.544254041595665e-4,3.211974836915866e-5,-3.28090202256463e-9,8.545322236510779e-4,3.2239278828225266e-5,-3.3303148632010992e-9,8.546285733291039e-4,3.224218246448245e-5,-3.330007151957699e-9,8.547652672831671e-4,3.2129878781118014e-5,-3.279649312494011e-9,8.549907364400541e-4,3.193111420486313e-5,-3.1907193571916717e-9,8.553382926807156e-4,3.1699773222277685e-5,-3.0858345714949625e-9,8.558140144434115e-4,3.150496484434305e-5,-2.9946769942906606e-9,8.563897321781071e-4,3.1413455736156216e-5,-2.9464704670555277e-9,8.570061787799461e-4,3.1468304822318046e-5,-2.960646903904852e-9,8.575886586831152e-4,3.167199701229673e-5,-3.039317862345337e-9,8.580709942206223e-4,3.198346246211776e-5,-3.1656988018487623e-9,8.584171135061124e-4,3.233248147476386e-5,-3.310099393214403e-9,8.586297960336273e-4,3.264478971416768e-5,-3.440645754903185e-9,8.587438963877701e-4,3.286515489171303e-5,-3.5332321749884526e-9,8.58810255130539e-4,3.2968897888927814e-5,-3.5765784450704622e-9,8.588794391843271e-4,3.2960802961293873e-5,-3.5719305847910328e-9,8.589911009932855e-4,3.2866533850223576e-5,-3.529577019202463e-9,8.591697919005255e-4,3.272249454060714e-5,-3.4646650245504987e-9,8.594251730433313e-4,3.256765883619841e-5,-3.393767811079765e-9,8.597541389353542e-4,3.2438210292960187e-5,-3.3325521813766835e-9,8.601432315592983e-4,3.236427582707883e-5,-3.2942803106507433e-9,8.605707893509768e-4,3.236765846754327e-5,-3.2887387933129255e-9,8.610090272757816e-4,3.245976837958149e-5,-3.3212886990489386e-9,8.614266330715411e-4,3.2639496241471747e-5,-3.3919234343927197e-9,8.617925265638105e-4,3.289145361493536e-5,-3.4944824234170423e-9,8.620810773671341e-4,3.318566240946574e-5,-3.616455097562243e-9,8.62278291344594e-4,3.3480062508905175e-5,-3.7399625948591e-9,8.623874686730959e-4,3.372681857367478e-5,-3.844371487446432e-9,8.624320722870976e-4,3.38822001208865e-5,-3.910489310686052e-9,8.624536695365803e-4,3.391801974913249e-5,-3.925509323340507e-9,8.625041693741896e-4,3.3831145103447495e-5,-3.887217720697746e-9,8.626336863724894e-4,3.364749744285424e-5,-3.805912914971897e-9,8.628771728569449e-4,3.34184061309152e-5,-3.703085242205503e-9,8.632436901356097e-4,3.3209472451514874e-5,-3.606852247536402e-9,8.637117164869609e-4,3.30843353744748e-5,-3.5450791305814132e-9,8.64232526978409e-4,3.30874054017447e-5,-3.537852982664476e-9,8.647417259564168e-4,3.32305264787094e-5,-3.591449619924816e-9,8.651764977358669e-4,3.348834402295054e-5,-3.695963620118213e-9,8.654934113410493e-4,3.380514974584113e-5,-3.827962144226022e-9,8.65680227216288e-4,3.411174050293928e-5,-3.957644664897803e-9,8.657570330287688e-4,3.4346041766830635e-5,-4.057808965225653e-9,8.657669387277931e-4,3.446932313815453e-5,-4.11101586076775e-9,8.657613435022625e-4,3.4472588411529344e-5,-4.112539581686109e-9,8.657862135868558e-4,3.4373094380466114e-5,-4.069050533975013e-9,8.658735763707832e-4,3.4205060581144676e-5,-3.99475967321788e-9,8.660388852455758e-4,3.400943296480929e-5,-3.907091687927469e-9,8.66282466493992e-4,3.3825844969993364e-5,-3.823219696797409e-9,8.665927137849105e-4,3.3687619719216236e-5,-3.7578388388344435e-9,8.669494024009601e-4,3.361913423273398e-5,-3.7219299984715987e-9,8.673264891657124e-4,3.363439881774626e-5,-3.7220625465320145e-9,8.676945418145927e-4,3.373592694579208e-5,-3.7598487309122184e-9,8.680234235964354e-4,3.391351714465576e-5,-3.831368929963179e-9,8.682859972296471e-4,3.4143297256214016e-5,-3.926691202132316e-9,8.684632880644983e-4,3.4388163647136244e-5,-4.029972466578756e-9,8.685506814790997e-4,3.460127638371885e-5,-4.120889818604067e-9,8.685633840062911e-4,3.4734023180121915e-5,-4.178058611548191e-9,8.685380720783138e-4,3.4748252417980764e-5,-4.184372534042753e-9,8.685276349437916e-4,3.462966914812959e-5,-4.132901756292709e-9,8.685883291320915e-4,3.439669502663824e-5,-4.030854924441111e-9,8.687628382465881e-4,3.409933619952682e-5,-3.8992420211352555e-9,8.690658895057307e-4,3.3806647123293056e-5,-3.767634596223998e-9,8.694785799556857e-4,3.358696397155016e-5,-3.66578227162126e-9,8.69953568550893e-4,3.348840676249508e-5,-3.6152232829612797e-9,8.704286241585501e-4,3.352635120659295e-5,-3.623705146793659e-9,8.708434233092473e-4,3.36810197345908e-5,-3.6838087593563796e-9,8.711544860856722e-4,3.390464015558857e-5,-3.775680273187482e-9,8.713445725476498e-4,3.4135193673201416e-5,-3.872743220397276e-9,8.714246913321904e-4,3.4312587501143965e-5,-3.948669842514471e-9,8.714288385999942e-4,3.4392832306213484e-5,-3.983673438771948e-9,8.714035709437477e-4,3.4356588349835174e-5,-3.968454991877816e-9,8.713959401397892e-4,3.4210390500048455e-5,-3.904979500162979e-9,8.714434314935408e-4,3.398142071965159e-5,-3.80439632081465e-9,8.715682144280527e-4,3.370866502664886e-5,-3.6833035835006632e-9,8.717760142029626e-4,3.343373250814609e-5,-3.5597712152619653e-9,8.720583485322628e-4,3.3193644320049306e-5,-3.450143545804329e-9,8.723963305223968e-4,3.301640385510928e-5,-3.367013852901416e-9,8.727645877754009e-4,3.2918942751948914e-5,-3.318240190622122e-9,8.731346053164378e-4,3.290646426016532e-5,-3.3065975355143806e-9,8.734775263631105e-4,3.297227361968222e-5,-3.329661479803068e-9,8.737669246598247e-4,3.3097659941762863e-5,-3.3797021541565744e-9,8.739822501713752e-4,3.325204966262417e-5,-3.443668277316694e-9,8.741134429392175e-4,3.339441456133996e-5,-3.5037068763647772e-9,8.741663973729802e-4,3.347758868121113e-5,-3.538992779628764e-9,8.741674829281171e-4,3.3457101736264556e-5,-3.529614543781381e-9,8.741636709228396e-4,3.33044797175946e-5,-3.4624919926690294e-9,8.742144615830622e-4,3.302135267114131e-5,-3.337668517116169e-9,8.743747932608298e-4,3.264687423555464e-5,-3.1716545924770886e-9,8.746743840366114e-4,3.2251051243278426e-5,-2.9946081022665746e-9,8.751039489192597e-4,3.1913364921373566e-5,-2.841130150424048e-9,8.75616678903275e-4,3.169573821909346e-5,-2.738595983860198e-9,8.761445007935473e-4,3.162302292091491e-5,-2.698649906049282e-9,8.766203447195945e-4,3.167892308982781e-5,-2.715236885002451e-9,8.769963987697803e-4,3.18159383463042e-5,-2.7686104110067445e-9,8.772531062745815e-4,3.197221978649029e-5,-2.8323654947714774e-9,8.773990475854998e-4,3.2088299096119665e-5,-2.880564943726866e-9,8.774645762292172e-4,3.211954673233677e-5,-2.893205151464858e-9,8.774924155916585e-4,3.204298846969703e-5,-2.8593905607603026e-9,8.775277330636137e-4,3.185874387139908e-5,-2.778242446816188e-9,8.776094585559394e-4,3.158700840416259e-5,-2.657838435817586e-9,8.777641128132043e-4,3.126183960920271e-5,-2.5126548703569532e-9,8.78002877757191e-4,3.092341017264447e-5,-2.360210638245288e-9,8.78321864386743e-4,3.061051760107952e-5,-2.217716237311034e-9,8.787048132667152e-4,3.0354696413936292e-5,-2.0993733631963004e-9,8.791271129207127e-4,3.0176554948077197e-5,-2.0146576508170057e-9,8.795600526842855e-4,3.0084265265720063e-5,-1.9675904842138486e-9,8.799746005764623e-4,3.0073592700195904e-5,-1.9567272155798592e-9,8.803445685727407e-4,3.0128701933306585e-5,-1.9754931411414064e-9,8.806494724082241e-4,3.0223295863434567e-5,-2.012635250546257e-9,8.808775707256542e-4,3.0322170015652122e-5,-2.052817626545346e-9,8.810294629751855e-4,3.0383874541022066e-5,-2.077700737209661e-9,8.811219817814094e-4,3.0365784932921254e-5,-2.068140259899549e-9,8.811907881742122e-4,3.0232911390513986e-5,-2.0081342888122047e-9,8.812885190182023e-4,2.997035224275941e-5,-1.8904615726488688e-9,8.814748050867232e-4,2.9595882363843328e-5,-1.7223897108962145e-9,8.817972325406356e-4,2.9164896341324755e-5,-1.5279575596742727e-9,8.822694105023639e-4,2.8759323793384683e-5,-1.343146342028477e-9,8.828590048460752e-4,2.846005103322195e-5,-1.203784176843767e-9,8.834961316970444e-4,2.8315408404152892e-5,-1.1317019817736651e-9,8.840994293836644e-4,2.83238474756633e-5,-1.1270381711241277e-9,8.846048503517724e-4,2.8439563876848128e-5,-1.1705107836514342e-9,8.849825261434277e-4,2.859423427913567e-5,-1.2327153363012424e-9,8.852377405673897e-4,2.872082247503333e-5,-1.2843809606697235e-9,8.854014350719654e-4,2.876976020388615e-5,-1.303411303612948e-9,8.855175691600622e-4,2.8715569658327886e-5,-1.277894686911527e-9,8.856319414654461e-4,2.8556383656666185e-5,-1.2061264571813115e-9,8.857841196699158e-4,2.8309570284204513e-5,-1.0949624616496077e-9,8.86002414496257e-4,2.800577749822175e-5,-9.574157297751806e-10,8.863013254260068e-4,2.7682541703841347e-5,-8.099261480403505e-10,8.866810883604368e-4,2.737801278175877e-5,-6.695408320630273e-10,8.871291034948231e-4,2.712535762590261e-5,-5.513048593649785e-10,8.876228817584209e-4,2.6948399119048687e-5,-4.661876242949888e-10,8.881339924077757e-4,2.6858865286951922e-5,-4.197713685400893e-10,8.886323956855838e-4,2.6855412138336997e-5,-4.1179225649502044e-10,8.890905424093482e-4,2.6924258581403914e-5,-4.3643441475982406e-10,8.89486876270744e-4,2.704096977561104e-5,-4.831197421077393e-10,8.898087302066524e-4,2.7172978043164845e-5,-5.375765842824722e-10,8.900547902185537e-4,2.7282747178927522e-5,-5.831513974124379e-10,8.902372653753913e-4,2.733186854749421e-5,-6.02542926548089e-10,8.903834851144673e-4,2.7286782595027556e-5,-5.803341451115104e-10,8.905356820182493e-4,2.712678713758405e-5,-5.066546828876249e-10,8.907466490935431e-4,2.6853822167289743e-5,-3.817222697006188e-10,8.910687379135351e-4,2.650095008026581e-5,-2.1981389275727818e-10,8.915358613141435e-4,2.613316302797963e-5,-4.974968918210426e-11,8.921441557986117e-4,2.583341569558239e-5,9.130127597938247e-11,8.928435576312597e-4,2.5673648601187617e-5,1.7077634639135572e-10,8.935508750856743e-4,2.5683679634147847e-5,1.7468326592194504e-10,8.941811428365587e-4,2.5837610180360195e-5,1.1381510218411522e-10,8.946793739990621e-4,2.6067113585673513e-5,1.8006901262402275e-11,8.950349091826171e-4,2.6291644820413183e-5,-7.717084794839584e-11,8.952750213494531e-4,2.6446389435700407e-5,-1.427663814093566e-10,8.954475970296075e-4,2.64960814946439e-5,-1.625988001066087e-10,8.956041887442954e-4,2.6435196735103513e-5,-1.334689640026147e-10,8.957887712051753e-4,2.6280905283114967e-5,-6.224871917615731e-11,8.960323226691599e-4,2.6064317323041538e-5,3.777765165941726e-11,8.963513575114935e-4,2.5822815459411318e-5,1.5017549800954496e-10,8.96748509792149e-4,2.5594124919428984e-5,2.5799083696445723e-10,8.972140957359525e-4,2.5411712108030967e-5,3.459131555119787e-10,8.97728398380985e-4,2.5301088813513795e-5,4.0208667445015245e-10,8.982646818886401e-4,2.5276973108559064e-5,4.19511702332487e-10,8.987928885022273e-4,2.5341491278246515e-5,3.969097854818967e-10,8.992838386101128e-4,2.548373838032777e-5,3.389148700251626e-10,8.997135067687896e-4,2.5680959581705512e-5,2.5551799630259e-10,9.000668011166033e-4,2.590128913974731e-5,1.6084571383571664e-10,9.003404075887244e-4,2.610773225553987e-5,7.143433854803536e-11,9.005444531271067e-4,2.626306035931546e-5,4.124552392039377e-12,9.00702826310028e-4,2.6335350498633444e-5,-2.636373164642357e-11,9.008518990331428e-4,2.6304027478397698e-5,-1.0173572691243059e-11,9.010369750715351e-4,2.616622985452215e-5,5.4685092455799334e-11,9.013053376731691e-4,2.5942528849006335e-5,1.5954350428825642e-10,9.016950534266347e-4,2.5679451672258137e-5,2.8372503804596007e-10,9.022205066966907e-4,2.544470577148632e-5,3.9657633063202955e-10,9.028595081446744e-4,2.5311299328910574e-5,4.6464848630157026e-10,9.035509621163673e-4,2.5331826054565013e-5,4.634519661365919e-10,9.042106403831823e-4,2.5513725417149697e-5,3.8884970955208253e-10,9.047617243836385e-4,2.5811755065389144e-5,2.60664002639359e-10,9.051639505218222e-4,2.614554976562279e-5,1.1486292999309726e-10,9.054243849394402e-4,2.6432431256007105e-5,-1.1230224109221291e-11,9.055864786501333e-4,2.6615750824420068e-5,-9.174245642919217e-11,9.057083348203511e-4,2.6675961252054152e-5,-1.1728835587695205e-10,9.05843511575355e-4,2.6625694545636095e-5,-9.286576972832296e-11,9.06030514980889e-4,2.649764658641052e-5,-3.258481232105302e-11,9.06290090659766e-4,2.6332711316700743e-5,4.5492394804177083e-11,9.066269079166894e-4,2.617147979221003e-5,1.230902666428942e-10,9.07032727485054e-4,2.6049140781842117e-5,1.8405636274430814e-10,9.074895537591257e-4,2.5992565692749985e-5,2.1580884693763228e-10,9.079725233622418e-4,2.601842289978903e-5,2.1034058494702972e-10,9.08452843161885e-4,2.6131794189518346e-5,1.649501949413581e-10,9.089011187176733e-4,2.632531969086917e-5,8.266582317282753e-11,9.092912509323934e-4,2.657930002330282e-5,-2.7811191372744197e-11,9.096046947811349e-4,2.686337600497953e-5,-1.5287896453951608e-10,9.098343835696975e-4,2.7140160235303376e-5,-2.756580777618742e-10,9.099874027396871e-4,2.737067976970732e-5,-3.7839683569915226e-10,9.100856080701482e-4,2.7521019033657425e-5,-4.4541806075215186e-10,9.101636727790192e-4,2.756915427471307e-5,-4.662024595936307e-10,9.102644580498961e-4,2.751076592587584e-5,-4.3810314345020306E-10,9.104319511252228e-4,2.736291054800073e-5,-3.681879685719245e-10,9.107022221916946e-4,2.7164432891512126e-5,-2.736553609265788e-10,9.110933354507029e-4,2.6971680885033756e-5,-1.800824904443576e-10,9.11596330532063e-4,2.6848117080263942e-5,-1.167738231171905e-10,9.121710507471927e-4,2.6847793958635906e-5,-1.0913815308381964e-10,9.12751534970597e-4,2.6996070209376236e-5,-1.6964949395235283e-10,9.132634636288651e-4,2.72756008370633e-5,-2.9115810444199527e-10,9.136492992958313e-4,2.762733566158342e-5,-4.471383736182009e-10,9.138892892803114e-4,2.797002314543524e-5,-6.005507786510418e-10,9.140064810409892e-4,2.8229735821653137e-5,-7.173953360843062e-10,9.140537060586121e-4,2.8363778381520954e-5,-7.777099880424133e-10,9.14091744347561e-4,2.8368259804342512e-5,-7.790964097262822e-10,9.141707165736832e-4,2.8270290432506036e-5,-7.332676996715194e-10,9.143209375298112e-4,2.811333903517838e-5,-6.595294780294835e-10,9.145523676781168e-4,2.7943782175206335e-5,-5.787922436801097e-10,9.148586524660526e-4,2.780218073489562e-5,-5.09645207598181e-10,9.15222213264884e-4,2.771907523928594e-5,-4.663750532641056e-10,9.156186000215372e-4,2.771356286516508e-5,-4.581833019385022e-10,9.160198239972885e-4,2.7793018214471577e-5,-4.889247071998724e-10,9.163971548837643e-4,2.795307226790254e-5,-5.570122799444724e-10,9.167240149473723e-4,2.8177711329907586e-5,-6.554310086134877e-10,9.169794235753807e-4,2.8439962674449603e-5,-7.720472188029496e-10,9.171519825482253e-4,2.870402885777489e-5,-8.905750008556582e-10,9.172436935254598e-4,2.8929649817970348e-5,-9.925419838939779e-10,9.172722940063046e-4,2.9078832692983632e-5,-1.0603291660817625e-9,9.172706400546866e-4,2.912409780548574e-5,-1.080924584550345e-9,9.17282157849279e-4,2.9056323329246427e-5,-1.0495469582952546e-9,9.17352548715972e-4,2.8889652042343435e-5,-9.719977617501207e-10,9.175193386587934e-4,2.8661331040972106e-5,-8.647637143988589e-10,9.178017998224793e-4,2.842566755332037e-5,-7.524533284368034e-10,9.181939299909826e-4,2.824278153652306e-5,-6.627971222401617e-10,9.186627846165465e-4,2.8164133229208014e-5,-6.200278774014088e-10,9.19153691738718e-4,2.8217986087638425e-5,-6.380459293784765e-10,9.196025451004935e-4,2.8398984740483134E-05,-7.153326477966576e-10,9.199531003263491e-4,2.8666337663424036e-5,-8.338087002295918e-10,9.201741950295597e-4,2.8953522843619235e-5,-9.631226655409933e-10,9.202698561839225e-4,2.918802920852016e-5,-1.0697405631849333e-9,9.202770539297086e-4,2.9313951870328424e-5,-1.1274657767908662e-9,9.20251788073042e-4,2.9307694253609973e-5,-1.1248038587933661e-9,9.202503631241845e-4,2.918064509705824e-5,-1.0663142394564279e-9,9.203142811661418e-4,2.897003743896867e-5,-9.68530131895985e-10,9.204634699590332e-4,2.8724513202568727e-5,-8.534492296718607e-10,9.206973132387841e-4,2.849110787091789e-5,-7.426352211365498e-10,9.209999773637789e-4,2.8307067355278376e-5,-6.534492842105844e-10,9.213465790289916e-4,2.8196472237938423e-5,-5.974035621587512e-10,9.21708293335506e-4,2.8169942280115928e-5,-5.798940312517992e-10,9.220560080914304e-4,2.8225631349565033e-5,-6.005462214024394e-10,9.223629986190541e-4,2.8350410654034294e-5,-6.536955210792199e-10,9.226073866112044e-4,2.8520935298446312e-5,-7.28851240962084e-10,9.227750120124014e-4,2.8705005688838147e-5,-8.113094184352923e-10,9.228628541636617e-4,2.886416079327547e-5,-8.833278120249603e-10,9.228823589672353e-4,2.895853283479903e-5,-9.263428574000358e-10,9.228611534120579e-4,2.8954410829763517e-5,-9.244525203760215e-10,9.22841094274703e-4,2.8833597004887607e-5,-8.687589669821464e-10,9.228711087655056e-4,2.860178543460586e-5,-7.612984631604381e-10,9.229952903879357e-4,2.8291928119182712e-5,-6.167002132570091e-10,9.232395355675018e-4,2.7959342967609063e-5,-4.600776629160696e-10,9.236018170315074e-4,2.766851040299726e-5,-3.211006337196332e-10,9.240504121843283e-4,2.7475443382623978e-5,-2.2596816610665073e-10,9.24531262399518e-4,2.741170749626898e-5,-1.8999789985040983e-10,9.249820629694834e-4,2.747542499218661e-5,-2.1326498107148244e-10,9.25348579660942e-4,2.7631811895541113e-5,-2.805432543382063e-10,9.255984900902482e-4,2.7822723222327646e-5,-3.6544697746303546e-10,9.257290496695094e-4,2.798233184373522e-5,-4.3755816439126784e-10,9.25766534088789e-4,2.80545120609564e-5,-4.705154590635174e-10,9.257576987930197e-4,2.800685278340508e-5,-4.4865598588417815e-10,9.257561138535627e-4,2.7837106293070436e-5,-3.701910247767966e-10,9.258080615404461e-4,2.757056376533481e-5,-2.4616627976356377e-10,9.259425348434525e-4,2.7250326470559132e-5,-9.609656809923689e-11,9.261676807511085e-4,2.6924824434891593e-5,5.773311606893498e-11,9.264731188036599e-4,2.663697142690499e-5,1.9528968966108854e-10,9.268356351407438e-4,2.6417432659609167e-5,3.019901995562894e-10,9.272255509647921e-4,2.6282152592361178e-5,3.6997091936557287e-10,9.276120574189009e-4,2.6232846291373425e-5,3.9797540595297546e-10,9.279670116931762e-4,2.6258881085469936e-5,3.9055441141759986e-10,9.282675227858236e-4,2.633942937784366e-5,3.570959163618194e-10,9.284980234511821e-4,2.644547284239765e-5,3.109050504872678e-10,9.286524796636579e-4,2.654193492234242e-5,2.6822927772623276e-10,9.287369625751979e-4,2.6590780100069592e-5,2.468431766251289e-10,9.287720369209947e-4,2.6556135305642376e-5,2.636822102111064e-10,9.287934339306461e-4,2.6412028824363202e-5,3.312264037819188e-10,9.288486997992517e-4,2.6151880961107663e-5,4.530300718778846e-10,9.289878720362526e-4,2.5796515725207018e-5,6.199146734068698e-10,9.292487589067231e-4,2.5395465656098757e-5,8.092647167352129e-10,9.29641666352082e-4,2.5017209649756432e-5,9.894516360464816e-10,9.301413876496481e-4,2.472917795980915e-5,1.1290141747255939e-9,9.306922559167429e-4,2.4575229989538544e-5,1.2070780979559616e-9,9.312251819721861e-4,2.4561109000296633e-5,1.2202059312944135e-9,9.316789667520669e-4,2.465414560968802e-5,1.1827604254879246e-9,9.320169043861123e-4,2.479571175444768e-5,1.1213819953507269e-9,9.322336847376593e-4,2.4919677271373376e-5,1.0666004249723868e-9,9.323526991819391e-4,2.496981318218703e-5,1.044792681412822e-9,9.324168167771345e-4,2.4911728305382368e-5,1.072537792680831e-9,9.324763341556606e-4,2.473779692662344e-5,1.1541348440936524e-9,9.32577287240139e-4,2.446550131433796e-5,1.2821529509168165e-9,9.327524775390439e-4,2.4130741138395573e-5,1.440358563370683e-9,9.330166395630526e-4,2.3778318046824064e-5,1.608044416470438e-9,9.333661039477023e-4,2.345210977652227e-5,1.7646106799430005e-9,9.337821762564567e-4,2.3187164366326925e-5,1.8933448565731633e-9,9.342366534787011e-4,2.3004991867956138e-5,1.983756984261391e-9,9.346977645863617e-4,2.2912152275451638e-5,2.0323646948176415e-9,9.351352665974508e-4,2.2901360219547865e-5,2.0422501912195693e-9,9.355241516458479e-4,2.2953966611580642e-5,2.021915505548688e-9,9.358471024062418e-4,2.3042848220487e-5,1.983917263664366e-9,9.360962029673838e-4,2.313526295966051e-5,1.9435240421953627e-9,9.362744148421519e-4,2.319579877368126e-5,1.9173555450183216e-9,9.363970340869479e-4,2.3190008396632788e-5,1.921714213936969e-9,9.364926985739199e-4,2.3089580081948874e-5,1.970175219873316e-9,9.366025595028989e-4,2.287954350737153e-5,2.070174683549589e-9,9.367754583789063e-4,2.256662486320555e-5,2.219009962619075e-9,9.370572543760401e-4,2.2185503816041416e-5,2.40080151825208e-9,9.374749898088448e-4,2.179746684581724e-5,2.5870254829646286e-9,9.380215496738124e-4,2.1476617739059208e-5,2.7428988022427817e-9,9.386504920238448e-4,2.1285143976963856e-5,2.8389345262250392e-9,9.392879545260637e-4,2.124847926412409e-5,2.8626284858923288e-9,9.398581363504856e-4,2.1344635824425707e-5,2.8236063659948714e-9,9.403092110193681e-4,2.1513973951784947e-5,2.749245885993131e-9,9.406269138130842e-4,2.1682634723939766e-5,2.67386501863676e-9,9.408323763286779e-4,2.178648157968665e-5,2.6275885831474924e-9,9.409696504997068e-4,2.1786146578814432e-5,2.6292808737827737e-9,9.410906514838015e-4,2.1671298131321062e-5,2.6844268786052037e-9,9.41242649635597e-4,2.145702236312698e-5,2.786633456564728e-9,9.414601509848395e-4,2.1176178630965497e-5,2.9210047073092557e-9,9.417610200086401e-4,2.0870608445111807e-5,3.0681179766648086e-9,9.421460370053103e-4,2.0582809873944577e-5,3.207899651127782e-9,9.426010936837508e-4,2.0348968697412414e-5,3.3229824926066307e-9,9.431012540259686e-4,2.0193985304551373e-5,3.401195641488044e-9,9.436158120570794e-4,2.012884842892798e-5,3.436951038320817e-9,9.441134784478598e-4,2.015031500623975e-5,3.4314859276191417e-9,9.44566950904901e-4,2.0242534645964484e-5,3.3921135298370826e-9,9.449563631171996e-4,2.0379982085524475e-5,3.330805785534591e-9,9.45271517348029e-4,2.0530961708450033e-5,3.2625023737391606e-9,9.455131621575188e-4,2.0661233197895548e-5,3.203395247216593e-9,9.456936234191719e-4,2.0737740900431553e-5,3.1692023079153e-9,9.458369007988554e-4,2.073272466669384e-5,3.1732674706314038e-9,9.459779040524844e-4,2.0628653770206123e-5,3.224233945190357e-9,9.461597634391267e-4,2.0424167988906754e-5,3.3231751090821356e-9,9.46427574458297e-4,2.014003684687474e-5,3.4606600272122213e-9,9.468173676227388e-4,1.98221812789624e-5,3.615192303367057e-9,9.473413942934375e-4,1.9537012097558103e-5,3.755318583394564e-9,9.479753457182548e-4,1.9355058402098106e-5,3.847349600926752e-9,9.486571399076209e-4,1.9325058394134616e-5,3.867688552958027e-9,9.493040520760504e-4,1.9450539767815956e-5,3.814066075128484e-9,9.498430651538646e-4,1.9684623094334385e-5,3.7081770948540923e-9,9.502378728614017e-4,1.994861501821484e-5,3.5870008241428506e-9,9.504975307118342e-4,2.01632840220824e-5,3.4880374073031084e-9,9.506654032765242e-4,2.0274709481559317e-5,3.437068799563959e-9,9.507989420812344e-4,2.0264365859063468e-5,3.4433449550727618e-9,9.509516863480496e-4,2.0145143002205663e-5,3.5013586813003237e-9,9.511626032896819e-4,1.9950604861647016e-5,3.595755007819909e-9,9.514523625841899e-4,1.972359867900281e-5,3.7065483148110366e-9,9.518240846294337e-4,1.9507126203245064e-5,3.813351896094841e-9,9.522662841079077e-4,1.933798514493866e-5,3.898421280054506e-9,9.527567177104721e-4,1.9242649321887765e-5,3.94873970416592e-9,9.532666534200279e-4,1.9234898009828817e-5,3.9573083496472175e-9,9.537653046836214e-4,1.931500888982162e-5,3.923656171525834e-9,9.542241491314553e-4,1.9470419469034043e-5,3.853573929853045e-9,9.546208269205008e-4,1.967778168597357e-5,3.758113485784791e-9,9.549422337944906e-4,1.990624356532854e-5,3.6519733720235854e-9,9.551864658672643e-4,2.012153016907811e-5,3.5515235649189295e-9,9.553635348866212e-4,2.029033148993112e-5,3.4727284456947125e-9,9.554949463176509e-4,2.0384734278047446e-5,3.429079651875691e-9,9.55612166139684e-4,2.03866030610309e-5,3.4295402733541126e-9,9.557537872596488e-4,2.029183687422643e-5,3.4764900665650733e-9,9.559608378031081e-4,2.0114246891201803e-5,3.563775485379721e-9,9.562694312086343e-4,1.988802000189864e-5,3.6753836672060575e-9,9.567005353306505e-4,1.9666425812314765e-5,3.785918859393363e-9,9.572485741343938e-4,1.951354653734905e-5,3.864486310112931e-9,9.57873847869679e-4,1.9487015195238054e-5,3.8829949935352816e-9,9.58506375185627e-4,1.961495423927636e-5,3.827353654574862e-9,9.590658554599388e-4,1.9878214338844435e-5,3.706183686441474e-9,9.59491778185771e-4,2.021167822462048e-5,3.5503480856677113e-9,9.597671996149698e-4,2.0528378965229346e-5,3.4014299519401243e-9,9.599217284447296e-4,2.0753552855409916e-5,3.295380207449077e-9,9.600140258223889e-4,2.084893939258985e-5,3.2508500223577976e-9,9.601071466008167e-4,2.081721898662703e-5,3.2670417811981256e-9,9.602500853369318e-4,2.0691028420511654e-5,3.3288768573415605e-9,9.604701387776805e-4,2.051709319339869e-5,3.4144264007709955e-9,9.60773545484276e-4,2.034297332174702e-5,3.501100421052396e-9,9.611500679665309e-4,2.0208786324005668e-5,3.569552864573399e-9,9.615783591656324e-4,2.014318881895291e-5,3.6056735200335207e-9,9.620307130834803e-4,2.0161937110386437e-5,3.6014269400379457e-9,9.62477113531018e-4,2.0267731706648574e-5,3.5550823882264824e-9,9.628889049217328e-4,2.0450864920827385e-5,3.4710012484743916e-9,9.632422415170349e-4,2.069066577730867e-5,3.3589647822421636e-9,9.635212754316284e-4,2.0957906935666852e-5,3.2329849290971195e-9,9.637208099389389e-4,2.1218360815741975e-5,3.1095519476630494e-9,9.638478893925641e-4,2.143740445538196e-5,3.0054061149790872e-9,9.639218361763492e-4,2.158517204251695e-5,2.9350831633136274e-9,9.639725275225862e-4,2.164161332623286e-5,2.9085171189180765e-9,9.64036920303166e-4,2.1600821946777073e-5,2.928960887667208e-9,9.641539462469475e-4,2.1473982466179215e-5,2.991503500896854e-9,9.643579665181983e-4,2.129029021121154e-5,3.0824929931979146e-9,9.646710825382556e-4,2.1095019009386883e-5,3.180304929063653e-9,9.650951414487477e-4,2.0943493593642626e-5,3.2581268817857795e-9,9.656055505064805e-4,2.08898021785074e-5,3.2893920797482204e-9,9.661506527532753e-4,2.0970707862049013e-5,3.2556740154475738e-9,9.666609700686485e-4,2.1188936127107843e-5,3.154989219151684e-9,9.670695157136533e-4,2.1504456001118907e-5,3.0062342252277902e-9,9.673367523603838e-4,2.1842686062608042e-5,2.8453160317467475e-9,9.674669505838162e-4,2.2120216315934066e-5,2.7126670331229932e-9,9.675052672091475e-4,2.227588153984791e-5,2.6381300324599617e-9,9.67517310975436e-4,2.2290098639572074e-5,2.631571812351488e-9,9.675641549386202e-4,2.2184188610723864e-5,2.683192639935835e-9,9.676856175598294e-4,2.20050732406217e-5,2.770831293998539e-9,9.678958345343047e-4,2.1806797104405777e-5,2.8687326779884426e-9,9.681874796128061e-4,2.1636899335670483e-5,2.953998363007588e-9,9.685391645791842e-4,2.152957275673156e-5,3.00987037631748e-9,9.689223645110006e-4,2.150393434528262e-5,3.0266647100820593e-9,9.693065461435913e-4,2.1564905127593073e-5,3.0015027830697376e-9,9.696627464705727e-4,2.170489096403e-5,2.9376390040777005e-9,9.699663713453124e-4,2.190558400417185e-5,2.843664610904784e-9,9.701997585934131e-4,2.213998368625858e-5,2.732536103734538e-9,9.703546573483743e-4,2.2375052452482884e-5,2.6202568912921775e-9,9.704343769114892e-4,2.2575473791547756e-5,2.524023751178972e-9,9.70454924970594e-4,2.2708679506424222e-5,2.4597828841057676e-9,9.704442684490575e-4,2.2750680548228815e-5,2.4394191096140195e-9,9.70439123002729e-4,2.269163919856002e-5,2.4680675742140396e-9,9.704792630519241e-4,2.2539791907013454e-5,2.542185695856593e-9,9.706000419416595e-4,2.2322356320565065e-5,2.6490241837254375e-9,9.708244225247657e-4,2.208254490993235e-5,2.7679330778128663e-9,9.711561348596273e-4,2.1872563135784633e-5,2.8736116004682885e-9,9.715756674472968e-4,2.1743144202396543e-5,2.9411105609226534e-9,9.720408542324096e-4,2.1730926538918943e-5,2.952015717458691e-9,9.724936339510598e-4,2.1846219921065344e-5,2.9005828036571425e-9,9.728734724452532e-4,2.206526684943893e-5,2.797753482524233e-9,9.73135268736305e-4,2.2331915022099625e-5,2.670534930423955e-9,9.732656869873846e-4,2.2571721047228047e-5,2.5551777813643346e-9,9.732896097496811e-4,2.2715649390846857e-5,2.4855509251822116e-9,9.732616414073596e-4,2.272350320648063e-5,2.481624710067114e-9,9.732459633450723e-4,2.2595527734851322e-5,2.5437609524692543e-9,9.732948670608518e-4,2.2367393624596813e-5,2.6551037957679194e-9,9.73435775314028e-4,2.2093662920085047e-5,2.7895237218060307e-9,9.736697513088091e-4,2.18295826774539e-5,2.9203430820786453e-9,9.739779823635234e-4,2.1618463822268142e-5,3.0263986928152343e-9,9.743307630656896e-4,2.14864286442583e-5,3.094632000552376e-9,9.746951934172733e-4,2.1442559653592196e-5,3.120143478228777e-9,9.75040337470858e-4,2.1481561948537084e-5,3.105047155900916e-9,9.753402753088035e-4,2.1586872020260996e-5,3.0570669881734935e-9,9.755760407850127e-4,2.1733399542332765e-5,2.9882432258541283e-9,9.757372606998641e-4,2.1890007987213578e-5,2.913710103700545e-9,9.758238522467932e-4,2.2022308074060718e-5,2.8502981225779335e-9,9.758475695193567e-4,2.2096463822383953e-5,2.814649675643213e-9,9.75832592759985e-4,2.208441265972937e-5,2.8206647589847394e-9,9.758139779570534e-4,2.1970120824932505e-5,2.8764536267483205e-9,9.758329513980938e-4,2.1755459239150598e-5,2.9814657729990575e-9,9.759289405456378e-4,2.146343405290607e-5,3.1248755506446147e-9,9.761297562449015e-4,2.1136469459250627e-5,3.2863308207215907e-9,9.764427844228285e-4,2.0828722875066234e-5,3.4395760619971846e-9,9.768504235625822e-4,2.05936578116549e-5,3.558401665094199e-9,9.773119310828517e-4,2.047011212383905e-5,3.623414500991834e-9,9.777718670258082e-4,2.0470907088346007e-5,3.627703453703138e-9,9.781733258317801e-4,2.057752945621449e-5,3.5796494003707138e-9,9.784727031122457e-4,2.0742968740602736e-5,3.501766797457081e-9,9.786520083386822e-4,2.090280873294008e-5,3.4254174178099575e-9,9.787247391817811e-4,2.099234249163606e-5,3.3824366972435045e-9,9.787325073239532e-4,2.0964978181006943e-5,3.3960258792809006e-9,9.787325574450096e-4,2.080554329966027e-5,3.474116418782361e-9,9.78780386798012e-4,2.053316629811452e-5,3.607853339306525e-9,9.78914283306498e-4,2.0192836373745813e-5,3.7756288344559166e-9,9.79147450149718e-4,1.9840040928541138e-5,3.9505044744465266e-9,9.794691393037586e-4,1.9525344833017023e-5,4.107694790089413e-9,9.798520178516646e-4,1.928413468832371e-5,4.229601723499455e-9,9.802613780058582e-4,1.9132999458968806e-5,4.30768523320254e-9,9.806628425931363e-4,1.9071152761889917e-5,4.341903576740723e-9,9.810273134182267e-4,1.9084239326578834e-5,4.338962357581536e-9,9.81333537072951e-4,1.9148443642578993e-5,4.310353550740631e-9,9.81569296115634e-4,1.9233976343823555e-5,4.2706388260183405e-9,9.817321483998952e-4,1.9307966381521585e-5,4.235993167701627e-9,9.81830219636952e-4,1.933733918927407e-5,4.222757802688705e-9,9.818829501630556e-4,1.9292467400002797e-5,4.245632427234919e-9,9.819209964844942e-4,1.9152168044642423e-5,4.315222825428222e-9,9.8198392831691e-4,1.890983975966044e-5,4.435029642934434e-9,9.821143377150008e-4,1.857919889488635e-5,4.59861659028588e-9,9.823480141006478e-4,1.819663416702158e-5,4.788408783691395e-9,9.827021678395676e-4,1.781681352429813e-5,4.977767747591471e-9,9.8316630954625e-4,1.750019208422675e-5,5.1370239028109335e-9,9.837010460599907e-4,1.729533464359589e-5,5.242087342349132e-9,9.842471758127079e-4,1.722284340206006e-5,5.282365711457081e-9,9.847423799112572e-4,1.7267922501442923e-5,5.2645551112541595e-9,9.851390392167326e-4,1.7384650541422545e-5,5.210737350473865e-9,9.85416712413494e-4,1.7509721680699187e-5,5.151788515618179e-9,9.855858656559924e-4,1.7580163367743918e-5,5.118732221992248e-9,9.856830005405348e-4,1.754937325800318e-5,5.134813103943706e-9,9.857596419803308e-4,1.7397498039928058e-5,5.210281577132254e-9,9.858686370143312e-4,1.7134242430752782e-5,5.340872784086539e-9,9.860514093620037e-4,1.6794137806137563e-5,5.509998145968244e-9,9.863293550422345e-4,1.6426136917274978e-5,5.693759305662125e-9,9.867012674118518e-4,1.6080882897378395e-5,5.867166202605813e-9,9.871466831850105e-4,1.5799461394281728e-5,6.009706321470195e-9,9.876331363464859e-4,1.560644168178504e-5,6.108876220456722e-9,9.881244546795737e-4,1.5508013115131364e-5,6.16123561320287e-9,9.885877203164924e-4,1.5494168132305846e-5,6.1714423956312695e-9,9.889977731607897e-4,1.554301218967708e-5,6.150173958810571e-9,9.89339357154404e-4,1.5625438489487203e-5,6.11180328305642e-9,9.896077069428486e-4,1.5709163928471263e-5,6.072354236231378e-9,9.898084641090051e-4,1.5761986455145772e-5,6.047846128949401e-9,9.89957481892549e-4,1.575472773264608e-5,6.052821432389052e-9,9.900805416390554e-4,1.5664564164811243e-5,6.098708901861965e-9,9.902123484409752e-4,1.5479331179479615e-5,6.191709401312268e-9,9.903935258545628e-4,1.5202748222706768e-5,6.33020714370356e-9,9.906641160678208e-4,1.4859172652645127e-5,6.502381741232603e-9,9.910530106883304e-4,1.4494749524882107e-5,6.685572808518867e-9,9.915653761885476e-4,1.4170939529055735e-5,6.8494023081549725e-9,9.92173804543939e-4,1.3948485846748767e-5,6.963646567409606e-9,9.92820439606734e-4,1.3865800846189006e-5,7.008937764536123e-9,9.934330686488335e-4,1.3922023616282452e-5,6.98524850756154e-9,9.939493480964887e-4,1.4075052891534514e-5,6.91302227434678e-9,9.943372374337234e-4,1.4256527274009431e-5,6.825888020437902e-9,9.946022722861765e-4,1.4395571285888233e-5,6.75895614654633e-9,9.947808856143072e-4,1.4439740434982362e-5,6.738430832136037e-9,9.949257957257986e-4,1.4366093115323758e-5,6.776065172871318e-9,9.950905167510095e-4,1.418186073054903e-5,6.868729017701459e-9,9.953173989064848e-4,1.391790875148587e-5,7.001518418367263e-9,9.95630713119781e-4,1.3618756991412558e-5,7.152573416875709e-9,9.960345799292754e-4,1.3332040182830323e-5,7.29822948174995e-9,9.965148922381106e-4,1.3099245727471433e-5,7.4176277467670906e-9,9.970441941477112e-4,1.294893783688122e-5,7.496180701557594e-9,9.975882397394037e-4,1.2893264734091967e-5,7.527452492986098e-9,9.98112746713271e-4,1.2927881166143136e-5,7.513323955728468e-9,9.985890416039868e-4,1.3034634044303174e-5,7.462717843178684e-9,9.98997826875862e-4,1.3185900947308538e-5,7.389423516943071e-9,9.993309205324102e-4,1.3349405125668461e-5,7.3096360810763596e-9,9.99591375901445e-4,1.3492586365441474e-5,7.2397137309556e-9,9.99792668555754e-4,1.3586170648049899e-5,7.19436794380859e-9,9.999574846180697e-4,1.3607159236305784e-5,7.185183536470915e-9,0.0010001162353076604,1.3541721843540724e-5,7.219205045654568e-9,0.0010003049165363592,1.3388426048463978e-5,7.297338394204071e-9,0.0010005613623854227,1.3161776667357265e-5,7.4125560623676355e-9,0.0010009186855654698,1.2894930291567578e-5,7.548472365832492e-9,0.001001395431805748,1.2638913929780974e-5,7.679645009834532e-9,0.0010019842716833783,1.2454704246940159e-5,7.775465670467849e-9,0.0010026447567112351,1.2396089240531763e-5,7.80872345265965e-9,0.0010033080233894881,1.2487217081785896e-5,7.766920829338294e-9,0.0010038972478855197,1.2706548445498057e-5,7.660458605367358e-9,0.0010043565504526115,1.2989946449421098e-5,7.521224770364038e-9,0.001004672231437384,1.3254551939388285e-5,7.390681026669133e-9,0.0010048741581043606,1.3430195374539308e-5,7.304097230213788e-9,0.001005019125368549,1.3480998017901777e-5,7.27969563649755e-9,0.001005168386359312,1.340941335065461e-5,7.316596454133312e-9,0.0010053704906546521,1.3246930061867809e-5,7.3994046186029145e-9,0.0010056532197300141,1.3040000118914438e-5,7.505138119129774e-9,0.0010060229091539998,1.2837303701281687e-5,7.609490773330097e-9,0.0010064679702872599,1.2680694358525935e-5,7.691325334965295e-9,0.00100696410900686,1.2599802055308625e-5,7.73543576837147e-9,0.0010074799303969257,1.2609453088105831e-5,7.733972018905462e-9,0.0010079824262810555,1.270927137545503e-5,7.68678360040066e-9,0.001008441983199197,1.2885166585695294e-5,7.600766502657164e-9,0.0010088364680810365,1.3112382500046945e-5,7.488348827427479e-9,0.0010091540147537904,1.3359627618872047e-5,7.365366043977686e-9,0.0010093942793346546,1.3593707411098743e-5,7.248659658443538e-9,0.0010095681767792678,1.3783993741249416e-5,7.15377885761242e-9,0.0010096964280629517,1.3906222158150544e-5,7.093063507146875e-9,0.0010098073351207102,1.3945501108580383e-5,7.074156161434548e-9,0.001009933998475673,1.3898670498425644e-5,7.098839141011301e-9,0.0010101108925560731,1.3776156395851466e-5,7.162087545997906e-9,0.0010103693537762879,1.3603229200616472e-5,7.2513716092129284e-9,0.001010731370310706,1.3419833637562037e-5,7.3466457393835305e-9,0.0010112016762827962,1.3277108498864683e-5,7.422018074019115e-9,0.0010117598625822178,1.3228209751310446e-5,7.450356500270065e-9,0.0010123568768607588,1.3312347000828476e-5,7.411421404428368e-9,0.0010129222480500654,1.3535582819181508e-5,7.301724939909382e-9,0.001013385331984101,1.3858804132080293e-5,7.140781390672817e-9,0.001013703707706818,1.4205000113155494e-5,6.967497490960027e-9,0.0010138822454817784,1.448749274687313e-5,6.825833236491937e-9,0.0010139696115598694,1.464433393257325e-5,6.747309515966404e-9,0.001014034960781267,1.4658559233696529e-5,6.740744459985028e-9,0.0010141406929217946,1.4555765436898252e-5,6.793498539548968e-9,0.0010143254890754552,1.4386576477060897e-5,6.880297884166936e-9,0.0010146008251386124,1.420706593101242e-5,6.973012537470857e-9,0.0010149561275081414,1.4065065181815716e-5,7.047465907773897e-9,0.00101536675460542,1.3993570240248546e-5,7.0867457546242325e-9,0.0010158013574818438,1.4009210516690739e-5,7.0820601273590445e-9,0.0010162275161801665,1.4113340727320419e-5,7.032323770553171e-9,0.0010166159146742558,1.429419134817385e-5,6.943198192930504e-9,0.0010169435907143895,1.4529570251940101e-5,6.825790427443894e-9,0.001017196458485237,1.4790107827825064e-5,6.695003258799705e-9,0.0010173710222833715,1.5043063994411697e-5,6.5675509780237646e-9,0.0010174750556951806,1.5256600380969255e-5,6.459732390817189e-9,0.001017526963278131,1.5404159828331004e-5,6.385177403566588e-9,0.0010175537373666459,1.5468376233596634e-5,6.352868110860509e-9,0.001017587717364337,1.544402654131814e-5,6.365661713647204e-9,0.0010176624605994554,1.5339717534360233e-5,6.419435210938414e-9,0.0010178080063839555,1.5178075945731396e-5,6.502944076621323e-9,0.0010180457452669584,1.4994254410299033e-5,6.598491835633543e-9,0.001018383064035031,1.4832381264038678e-5,6.6836353960864175e-9,0.0010188083316972948,1.47391332796154e-5,6.734397667122887e-9,0.0010192878609278002,1.475363974145172e-5,6.730438678602947e-9,0.0010197678046505864,1.4894272655654495e-5,6.661915015952189e-9,0.00102018443463024,1.5145950174105276e-5,6.5361350999692345e-9,0.0010204836747962334,1.5455522234757765e-5,6.380048705078234e-9,0.0010206437243931602,1.5743334912936524e-5,6.2343512371156256e-9,0.0010206877187796243,1.5931055263172206e-5,6.139179160224897e-9,0.0010206758978202743,1.5972669549953236e-5,6.118206896081988e-9,0.0010206802785743953,1.587040614601252e-5,6.170538509004209e-9,0.0010207572457502255,1.5667653115910527e-5,6.274358304487625e-9,0.0010209325449119094,1.5426977239675342e-5,6.398084889086976e-9,0.0010212017498908892,1.520786821074164e-5,6.511580983868921e-9,0.0010215398590799887,1.5053291656116975e-5,6.5929010127443566e-9,0.001021912431934167,1.498569502034724e-5,6.630329259183798e-9,0.0010222841435015692,1.5008880327172054e-5,6.621529648464819e-9,0.0010226239917599095,1.5112068113238198e-5,6.571614831742929e-9,0.0010229080944826484,1.527401144689631e-5,6.491159177179544e-9,0.0010231212780165244,1.5466570242856973e-5,6.394419794620523e-9,0.001023258140679252,1.565799311163615e-5,6.29764201481796e-9,0.001023323723746117,1.581631986787821e-5,6.217269214912676e-9,0.0010233335657502231,1.5913194832607108e-5,6.1679458224003706e-9,0.001023312652942418,1.592801691867029e-5,6.160375068918902e-9,0.0010232928007281963,1.5851837316847298e-5,6.199331981376249e-9,0.0010233083950897286,1.5690131829775294e-5,6.282255337576482e-9,0.0010233908943278179,1.5463603240336597e-5,6.398818557630599e-9,0.0010235628682748299,1.5206365333078503e-5,6.531796793225194e-9,0.001023832615986048,1.4961295414609502e-5,6.659351030318273e-9,0.0010241904386357422,1.4772889164037382e-5,6.75860252344733e-9,0.001024607567166903,1.4678269177210256e-5,6.810218842264442e-9,0.001025038835875019,1.4697338813962965e-5,6.803536849223181e-9,0.0010254302198467145,1.4824014543455562e-5,6.7412161836967475e-9,0.001025731571596928,1.5021882123837198e-5,6.641636326261475e-9,0.0010259126052034333,1.522848767407803e-5,6.536783150416774e-9,0.0010259765363499528,1.5370953906319304e-5,6.464197088487894e-9,0.0010259633245588596,1.5390062552732196e-5,6.454503675266422e-9,0.0010259374918061134,1.5262568774086813e-5,6.519889575291671e-9,0.0010259645518792863,1.5009405517106155e-5,6.649894303135918e-9,0.0010260881771412683,1.4685110812366908e-5,6.816835676346961e-9,0.0010263193576777233,1.4355638624471758e-5,6.98711790063453e-9,0.0010266398889383535,1.4077159844329356e-5,7.1319926882616635e-9,0.001027014226018415,1.388425288732607e-5,7.2335633845970444e-9,0.0010274020414492461,1.3788133610311604e-5,7.285745723386852e-9,0.0010277670997235588,1.378095198171993e-5,7.292187151879546e-9,0.0010280818168414282,1.384189253769118e-5,7.263261955630348e-9,0.0010283288268859772,1.3942614549109414e-5,7.213352520340318e-9,0.0010285011445110084,1.405139140764495e-5,7.158731665697266e-9,0.0010286019408435882,1.413632711989153e-5,7.115870597147311e-9,0.0010286442540053864,1.4168322568558104e-5,7.09986088584424e-9,0.0010286504037499457,1.4124365397943462e-5,7.12268504128625e-9,0.0010286504791455998,1.3991292700524017e-5,7.191271681234185e-9,0.0010286791648484964,1.3769478993510954e-5,7.3056080066068604e-9,0.0010287705469715204,1.3475266008978337e-5,7.457494460578409e-9,0.001028951327632887,1.3140689311306862e-5,7.630660550566689e-9,0.0010292338285229816,1.280935564220711e-5,7.802822009644976e-9,0.0010296108825569928,1.2528353458002378e-5,7.949760843038067e-9,0.0010300546940236487,1.233759347627838e-5,8.050755726164393e-9,0.0010305208273311641,1.2259178009605778e-5,8.094075186049836e-9,0.0010309570900584187,1.2289732755782155e-5,8.08103476461809e-9,0.0010313157392175553,1.239822992254162e-5,8.027273387668908e-9,0.0010315663465513536,1.2530919495367793e-5,7.960336714121893e-9,0.0010317058209335492,1.2623500762804774e-5,7.913435014428099e-9,0.001031761762409121,1.2618455216019864e-5,7.916445804350526e-9,0.0010317863213620134,1.2482715648861428e-5,7.986708154305847e-9,0.0010318409415092163,1.2218875567850196e-5,8.123174915224233e-9,0.0010319770490094284,1.1864341225077265e-5,8.306813126168584e-9,0.00103222073763433,1.1478137897328902e-5,8.507363432120657e-9,0.001032567744181653,1.1121486498340977e-5,8.693293502779717e-9,0.001032989301697024,1.084087419509298e-5,8.840491614529463e-9,0.0010334441429188832,1.065944919603051e-5,8.936740074754993e-9,0.0010338905402688494,1.0577173083741774e-5,8.981736505163395e-9,0.0010342945423151325,1.0576383955421915e-5,8.98433665789792e-9,0.00103463375858786,1.0628837350001691e-5,8.958991422832772e-9,0.0010348979793146607,1.0701777354861157e-5,8.922621233770985e-9,0.0010350882727302663,1.0762337371071754e-5,8.89230185881902e-9,0.0010352157191526022,1.0780632780980312e-5,8.883608858628518e-9,0.0010353002554859072,1.0732303407048932e-5,8.90925860516677e-9,0.0010353694431257166,1.0601227344865006e-5,8.977690201699487e-9,0.0010354564618759658,1.0382697470573208e-5,9.09143350297743e-9,0.0010355964502504992,1.008658752883728e-5,9.245490273873833e-9,0.00103582062126145,9.739174784541215e-6,9.426394426544935e-9,0.001036148531357024,9.381685552026843e-6,9.612933762557046e-9,0.001036580411402926,9.063860868442835e-6,9.779418101910907e-9,0.0010370928511063498,8.832500434599207e-6,9.901545674027221e-9,0.0010376410685493903,8.717740287966906e-6,9.963490318062588e-9,0.001038168776362179,8.722090107823838e-6,9.963639543713632e-9,0.001038623174432724,8.817117820241822e-6,9.916433090139891e-9,0.0010389699638132367,8.949806345046257e-6,9.849185263172341e-9,0.0010392031310252545,9.056681538401306e-6,9.794814136056429e-9,0.0010393464417650642,9.081041880969784e-6,9.7828832107339e-9,0.0010394465445357972,8.98803121924295e-6,9.831716602058708e-9,0.0010395599652596504,8.773379181090786e-6,9.943793307826468e-9,0.0010397377850124105,8.463527638538071e-6,1.010562028455275e-8,0.0010400124740567555,8.107264085356009e-6,1.0292016552047566e-8,0.0010403907983126954,7.761647465210934e-6,1.047336668482392e-8,0.0010408546068110553,7.476975351250501e-6,1.0623406725890964e-8,0.0010413683448417354,7.285608742141655e-6,1.0725068130866081e-8,0.0010418898199738098,7.197436696745734e-6,1.077292879202111e-8,0.0010423802623030689,7.201792582882333e-6,1.0772323696065717e-8,0.0010428110604212102,7.273401012350935e-6,1.0736320365516424e-8,0.0010431666141344895,7.3794054706384364e-6,1.0682066369385867e-8,0.0010434442537033133,7.485424438284342e-6,1.062758834085327e-8,0.001043652630466233,7.559908129853109e-6,1.0589456096467488e-8,0.0010438096899647942,7.577040457584126e-6,1.0581220954317427e-8,0.0010439407598399314,7.518874452397437e-6,1.0612288493742078e-8,0.0010440766580099585,7.3774053804267025e-6,1.0686856280073861e-8,0.0010442511917944904,7.1569232978676465e-6,1.0802719477653824e-8,0.0010444971593526165,6.876269078840813e-6,1.0950114569202205e-8,0.001044840195797599,6.569674575005575e-6,1.1111270660756568e-8,0.0010452907905748228,6.284047442282688e-6,1.1261780001466925e-8,0.0010458366657182785,6.070632446913745e-6,1.1374885918198315e-8,0.0010464397212440041,5.970991705073476e-6,1.1428761032437083e-8,0.0010470419129418023,6.0012650636924906e-6,1.1414752486565529e-8,0.0010475808873286244,6.142246342171787e-6,1.134266195270011e-8,0.0010480101442759484,6.342031857499272e-6,1.1239472124113928e-8,0.0010483145665516262,6.531775462877667e-6,1.1141164514740623e-8,0.0010485141839921832,6.647674109549178e-6,1.1081204358546142e-8,0.0010486555927916323,6.649554437643226e-6,1.1080769771562399e-8,0.0010487962274780228,6.52970014858732e-6,1.1144090607712959e-8,0.001048988161110087,6.311113549640392e-6,1.1259318747852037e-8,0.001049266135585487,6.038217412853158e-6,1.140334069973273e-8,0.0010496417708631659,5.764112342343603e-6,1.1548386965958874e-8,0.001050103884713581,5.538005408647266e-6,1.1668579695155248e-8,0.0010506236688532541,5.395419538643018e-6,1.1745084312143063e-8,0.001051162793625547,5.352737678222033e-6,1.176905039772956e-8,0.0010516822059403249,5.4065291012566944e-6,1.1742069546748452e-8,0.0010521495626468031,5.5369304279269275e-6,1.1674479004989727e-8,0.0010525439851890206,5.7134564555245825e-6,1.1582329111142928e-8,0.0010528578438257308,5.9014015084172195e-6,1.1483979856274418e-8,0.0010530961263485919,6.067417747217445e-6,1.139710095373138e-8,0.0010532743691075914,6.1835874192326255e-6,1.133647354846759e-8,0.0010534160834845703,6.230045791333779e-6,1.1312589735762775e-8,0.001053550198721015,6.1966823130205854e-6,1.1330774854534354e-8,0.0010537085154161126,6.0844906794547615e-6,1.1390513063025623e-8,0.0010539227224054864,5.906847205676181e-6,1.1484802633572627e-8,0.00105422025687308,5.690435278638442e-6,1.1599668036115498e-8,0.0010546184278993171,5.4746708261865515e-6,1.1714426246353476e-8,0.001055117156275193,5.307635025766357e-6,1.1803769941651274e-8,0.001055692545616445,5.236529243510756e-6,1.184274644058134e-8,0.001056295705931545,5.292689648675187e-6,1.1814655608677331e-8,0.0010568617072468647,5.4757403210461624e-6,1.1719477956429268e-8,0.0010573293783666506,5.74604326804144e-6,1.157796966652239e-8,0.0010576645165347547,6.033560344798371e-6,1.1427058221344922e-8,0.0010578737870635731,6.261973517443829e-6,1.1307094518131505e-8,0.0010580009637449824,6.3760497725166996e-6,1.1247346419441141e-8,0.001058108517330219,6.358165356812837e-6,1.1257242872632262e-8,0.0010582556001528874,6.228289144348805e-6,1.1326384333356857e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json
new file mode 100644
index 0000000..d7e3be9
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":13000,"numberOfSamples":1000,"samples":[0.0010584823083198346,6.031818825503171e-6,1.14309469118811e-8,0.0010588036033781425,5.823520864538709e-6,1.1542103150393909e-8,0.0010592110744742987,5.6537248748726675e-6,1.1633248752700286e-8,0.0010596790894540058,5.559275280564943e-6,1.1684765345343194e-8,0.0010601724727019367,5.559236240846307e-6,1.1686339583847125e-8,0.0010606540091394276,5.654379293057021e-6,1.163732802349451e-8,0.0010610908819856466,5.829497270171977e-6,1.1545624012790231e-8,0.0010614594503400023,6.057715047147503e-6,1.1425423187205381e-8,0.001061747989835144,6.305862037083749e-6,1.1294367431781857e-8,0.0010619573719630783,6.539955951254238e-6,1.1170587469196216e-8,0.0010620999645025674,6.73003410085884e-6,1.107008326599654e-8,0.0010621972572704668,6.85379996171742e-6,1.1004756707165859e-8,0.0010622768540195135,6.898913123430779e-6,1.098119849532928e-8,0.0010623693266318172,6.864185869807982e-6,1.1000078885400938e-8,0.0010625050436689565,6.760079817880366e-6,1.1055907410923635e-8,0.001062710756522555,6.608668374463369e-6,1.1137052470541557e-8,0.0010630055440594903,6.442842455479279e-6,1.122613014857253e-8,0.0010633958133875673,6.303928192637586e-6,1.1301216346173524e-8,0.0010638698300656857,6.236227673998108e-6,1.1338700200742188e-8,0.0010643938207032379,6.277096687541316e-6,1.1318549017049607e-8,0.0010649135018336272,6.443029009602109e-6,1.1231761017071778e-8,0.0010653652534506645,6.716334917457601e-6,1.1087554932954997e-8,0.0010656971998236583,7.041447402084115e-6,1.0915428186536279e-8,0.0010658919742331224,7.338860744797124e-6,1.0757744815379704e-8,0.0010659770288683225,7.534292063466726e-6,1.0654138240953239e-8,0.001066013886508743,7.587831708115414e-6,1.0625935223163422e-8,0.0010660723258305996,7.506181686783977e-6,1.0669662265910576e-8,0.0010662052115061964,7.3335686443663195e-6,1.0761922260944352e-8,0.0010664358470525873,7.130863915281745e-6,1.0870481691937031e-8,0.0010667588393153595,6.955633515934309e-6,1.0964801902708683e-8,0.0010671485918925085,6.8498410434954626e-6,1.1022511941646397e-8,0.0010675694409390784,6.835426550329633e-6,1.1031759374762615e-8,0.0010679841615469535,6.915158645441867e-6,1.0990824083116765e-8,0.0010683599657830244,7.076052103195604e-6,1.0906394119921115e-8,0.0010686723933572796,7.293685466136946e-6,1.0791343615514796e-8,0.00106890765095213,7.536822311352906e-6,1.0662299642942404e-8,0.0010690635977016276,7.77211139688823e-6,1.0537115853861746e-8,0.001069149428980129,7.968577301214409e-6,1.0432429890255657e-8,0.0010691841550370862,8.101601929648258e-6,1.036149374624633e-8,0.0010691940071483454,8.156061538266819e-6,1.0332478423133815e-8,0.001069209055658057,8.128266563717782e-6,1.03474435063982e-8,0.0010692594713290538,8.026593480405271e-6,1.0402013164716527e-8,0.0010693717459872535,7.870945267100574e-6,1.0485664177770738e-8,0.0010695649713014753,7.691125951702836e-6,1.05825672334285e-8,0.0010698471837835711,7.524020444771572e-6,1.0673046459330192e-8,0.0010702118794917663,7.409199319244088e-6,1.073588364535248e-8,0.0010706353190277158,7.382260325524803e-6,1.0751866255570777e-8,0.0010710762838212979,7.465490347225327e-6,1.0708824642405977e-8,0.0010714809682874885,7.6570210693528492E-06,1.0607528738465052e-8,0.0010717954666795326,7.92266264450533e-6,1.0466162353522634e-8,0.0010719849482146093,8.197549025520211e-6,1.031948512559187e-8,0.0010720518335533688,8.403355641842077e-6,1.0209555077841326e-8,0.0010720405373210041,8.477632103826806e-6,1.0169920153450947e-8,0.001072021738228369,8.400092320472587e-6,1.021150931330851e-8,0.0010720635198379748,8.199374023477202e-6,1.0319075409549964e-8,0.0010722065788787624,7.937147885028722e-6,1.0459750886515433e-8,0.00107245583521534,7.681893768449438e-6,1.0597036740148054e-8,0.0010727875503866039,7.487659268153709e-6,1.0702071381753594e-8,0.0010731630002383215,7.384581405590331e-6,1.075864496894142e-8,0.0010735409195010803,7.379180450137632e-6,1.0763066178824929e-8,0.001073885642552888,7.459556157906894e-6,1.0721462765445143e-8,0.0010741711464074789,7.60167164073378e-6,1.064650717664984e-8,0.0010743824677307964,7.774854624539591e-6,1.05545292946971e-8,0.0010745158753886549,7.946253107214568e-6,1.0463140800736486e-8,0.0010745783975093434,8.084663970024577e-6,1.0389154063601514e-8,0.0010745867148931046,8.164015707520659e-6,1.0346669113505363e-8,0.0010745652935797434,8.166515928713906e-6,1.0345347414447921e-8,0.0010745436064007652,8.085247843115634e-6,1.0389003625916266e-8,0.001074552414002862,7.925732239563838e-6,1.04747713355022e-8,0.0010746194263179607,7.705947602888145e-6,1.0593098065321354e-8,0.0010747649179418883,7.45457851834404e-6,1.0728675241616273e-8,0.0010749978735612412,7.207509835919612e-6,1.0862287758949862e-8,0.0010753131883688583,7.0027414856204215e-6,1.0973502950806292e-8,0.0010756904320888402,6.874033979996817e-6,1.1044059873554255e-8,0.0010760947834755237,6.8436529769841505e-6,1.1061787085804026e-8,0.001076481049891446,6.914886396186059e-6,1.1024693263841812e-8,0.0010768018290682909,7.066051634150347e-6,1.0944283327208556e-8,0.0010770200321076698,7.249261634913781e-6,1.0846289489249666e-8,0.001077123420982185,7.39804993243476e-6,1.076656197635394e-8,0.0010771348797026668,7.44585714263904e-6,1.0741042838621376e-8,0.0010771101367558554,7.350779981649652e-6,1.0792371226593277e-8,0.0010771194563272597,7.114340819791003e-6,1.091978472227473e-8,0.0010772207158111727,6.781925749825741e-6,1.1098942285178267e-8,0.001077438751988009,6.423598569950669e-6,1.1292263291924475e-8,0.0010777614606054466,6.107174429654953e-6,1.1463350840217734e-8,0.001078150988925822,5.878278442603043e-6,1.1587643347827043e-8,0.0010785602961386523,5.753858224937523e-6,1.1655892460490189e-8,0.0010789465240847547,5.72623912615062e-6,1.167203738632892e-8,0.0010792781883616845,5.7715171050260465e-6,1.1648769383961856e-8,0.0010795372547668179,5.857715055435001e-6,1.1603202812664468e-8,0.001079718408317149,5.950842140755552e-6,1.1553633958985417e-8,0.0010798274054571314,6.018931123532262e-6,1.1517348515355086e-8,0.0010798793764046966,6.034916081994106e-6,1.150903056702829e-8,0.0010798970957694128,5.979082561969348e-6,1.1539400992860876e-8,0.0010799088782759599,5.841386795654391e-6,1.1613943229511664e-8,0.001079945671266815,5.6234999239785664e-6,1.1731800417280663e-8,0.0010800370563297977,5.339960624404898e-6,1.1885168170973472e-8,0.0010802063626677298,5.017558699714286e-6,1.2059638070394361e-8,0.001080465709873069,4.692281975823613e-6,1.2235836282107038e-8,0.0010808121845919524,4.403722523375394e-6,1.239241282362964e-8,0.0010812263927673289,4.1875776377249006e-6,1.2510056790341688e-8,0.0010816742755761358,4.067606126441703e-6,1.2575830541311822e-8,0.0010821124162932766,4.048764490048608e-6,1.2586910279254428e-8,0.001082496394029135,4.1132067224480435e-6,1.2552812557360103e-8,0.0010827911400719823,4.220728194789922e-6,1.2495218049522599e-8,0.0010829814407256138,4.315035608807498e-6,1.2444602628550136e-8,0.0010830795939978,4.336331558319785e-6,1.2433397469308228e-8,0.0010831263014689158,4.238515418925506e-6,1.2486625405764085e-8,0.0010831815716910997,4.005888907583e-6,1.2612831618416838e-8,0.0010833062871192334,3.6615290203470267e-6,1.2799568273597161e-8,0.0010835411795810717,3.261162454656364e-6,1.3016729071965934e-8,0.0010838933778462134,2.8737930394674124e-6,1.3227010267237029e-8,0.001084337034999438,2.5585169726812227e-6,1.3398407369065678e-8,0.0010848260137734957,2.3486087687672093e-6,1.351281176227918e-8,0.0010853104715353803,2.2479370425633493e-6,1.3567994079646327e-8,0.0010857496852788604,2.2371567972056594e-6,1.3574322546551323e-8,0.0010861181451779231,2.2837281191620208e-6,1.3549388239562281e-8,0.0010864060912470594,2.3509882779473265e-6,1.351309848109019e-8,0.001086617167375567,2.4043382300803017e-6,1.348429676688557e-8,0.0010867653789912383,2.414780175748046e-6,1.3478800918996513e-8,0.0010868723951977914,2.36090336349784e-6,1.3508287044674754e-8,0.0010869652859729975,2.230320299619587e-6,1.357949036950374e-8,0.0010870742527047388,2.0210940838380106e-6,1.3693435401754393e-8,0.0010872297036982135,1.7431263470573831e-6,1.3844706627164613e-8,0.0010874581583647045,1.4188304041524766e-6,1.4021110351396713e-8,0.0010877770309646244,1.0819285734700634e-6,1.420434005833336e-8,0.0010881892473587201,7.732394508393998e-7,1.4372250040797893e-8,0.0010886795450963712,5.330813350595426e-7,1.4502949312721697e-8,0.001089214649730255,3.9140243490344096e-7,1.458013766244398e-8,0.0010897487258969283,3.584072521389756e-7,1.459820749252219e-8,0.0010902335819651038,4.191729634013468e-7,1.4565214418600275e-8,0.0010906310187498445,5.348153076480196e-7,1.4502295396028616e-8,0.0010909236281021046,6.506177348026824e-7,1.443926695100913e-8,0.001091120685014961,7.092800663955221e-7,1.4407391615029013e-8,0.001091257136747916,6.658869235087142e-7,1.4431183604022623e-8,0.0010913854479859381,5.005821622148568e-7,1.4521478794650966e-8,0.0010915618860652314,2.251478759511052e-7,1.467185398741576e-8,0.0010918307189155313,-1.1924299742407577e-7,1.4859864732950039e-8,0.0010922113493534546,-4.734372432057817e-7,1.5053255310459487e-8,0.0010926932935980337,-7.775556028587294e-7,1.5219334684945516e-8,0.0010932410472572044,-9.877102401363634e-7,1.533407805988485e-8,0.0010938063797259453,-1.0859165470122615e-6,1.5387566050399254e-8,0.001094342455259391,-1.080589230442882e-6,1.5384321095468852e-8,0.00109481445675083,-9.995980021090122e-7,1.5339569592932147e-8,0.0010952043212414967,-8.803420527904827e-7,1.5273828324478645e-8,0.0010955103354372215,-7.608506842509845e-7,1.520800473466209e-8,0.0010957438947718288,-6.738297010954895e-7,1.516008890171015e-8,0.0010959255739260278,-6.435882030741187e-7,1.514342886133524e-8,0.0010960816844447629,-6.848008439732961e-7,1.516603611113632e-8,0.001096241543978873,-8.02004725041787e-7,1.5230321629549556e-8,0.0010964350536024304,-9.891361497491146e-7,1.5332873831182345e-8,0.0010966898752015986,-1.2290044827439803e-6,1.5464206803068726e-8,0.0010970275583669783,-1.4932930260580311e-6,1.5608784981685757e-8,0.0010974584822657629,-1.7443109645131954e-6,1.574598051452959e-8,0.0010979764965260918,-1.9399561880694465e-6,1.5852762521604583e-8,0.0010985554895813923,-2.0426623918831098e-6,1.590856103716042e-8,0.0010991510076969397,-2.031063016383569e-6,1.590164521848076e-8,0.0010997091337757634,-1.9102678540224635e-6,1.5834788151340182e-8,0.0011001814643931509,-1.7151290714917107e-6,1.5727115299126148e-8,0.0011005408546707206,-1.5028952094650604e-6,1.5610105905041306e-8,0.001100790948640354,-1.3368393448549428e-6,1.5518581808694086e-8,0.001100965184316589,-1.2672952194125447e-6,1.5480237846173764e-8,0.0011011161176956588,-1.3175209969869768e-6,1.5507843040213407e-8,0.0011012998469212088,-1.4787697248972343e-6,1.5596542078759433e-8,0.001101561065014156,-1.7146998910046917e-6,1.5726308035865734e-8,0.0011019226990827457,-1.9724071175410574e-6,1.586801490545639e-8,0.001102382007116548,-2.196363356079692e-6,1.5991084228148263e-8,0.0011029132667145561,-2.3416096021800094e-6,1.6070722292919825e-8,0.0011034757514399483,-2.38310916619068e-6,1.6093077245681256e-8,0.0011040244786115357,-2.31927776315323e-6,1.6057225467888683e-8,0.0011045205794044041,-2.1694385072843676e-6,1.597381802522786e-8,0.0011049385690624493,-1.966838354498544e-6,1.5861252045493124e-8,0.0011052692443645087,-1.750001842086337e-6,1.5740883086523665e-8,0.0011055186380034719,-1.5550353774155559e-6,1.5632734001830676e-8,0.0011057045369247066,-1.4103695910270938e-6,1.5552549745965977e-8,0.0011058522277989002,-1.3341378137981495e-6,1.551032955262108e-8,0.0011059906217503908,-1.3335025490994153e-6,1.5509962936515426e-8,0.001106149150194748,-1.404950501845874e-6,1.5549420079728942e-8,0.0011063551807779252,-1.5348143523852197e-6,1.5621073311654e-8,0.0011066313631327655,-1.6998081049754247e-6,1.5712016164878937e-8,0.0011069922927926747,-1.8679853774396568e-6,1.580459705808824e-8,0.0011074402507398938,-2.0011637405826746e-6,1.5877740607269027e-8,0.0011079607077455421,-2.060248709035317e-6,1.5909858156164228e-8,0.001108519738968454,-2.0144254988523965e-6,1.588390462537339e-8,0.0011090667951459137,-1.8531436940924132e-6,1.5794016241904865e-8,0.0011095457522609323,-1.5962893152773853E-06,1.5651187561937485e-8,0.0011099131036531966,-1.295286315591519e-6,1.548393416264128e-8,0.0011101558729649911,-1.0201697065466408e-6,1.5331133204623056e-8,0.0011102988958696094,-8.358929741676526e-7,1.5228836499800212e-8,0.001110396160826366,-7.792957175517323e-7,1.519745019538023e-8,0.00111051078357651,-8.4832733122868e-7,1.5235767590110828e-8,0.0011106942753399312,-1.0069042485667557e-6,1.5323711725274e-8,0.00111097368196469,-1.1999692577389667e-6,1.5430718007157876e-8,0.0011113487938456635,-1.370515245006706e-6,1.5525164027079777e-8,0.0011117968919402519,-1.472886234678616e-6,1.5581716379428368e-8,0.00111228126468647,-1.4803580618799743e-6,1.5585522069862342e-8,0.0011127605283525728,-1.38735025143936e-6,1.553345118973782e-8,0.0011131969606502966,-1.207467615593322e-6,1.5433042494833323e-8,0.0011135628384484684,-9.68609089136904e-7,1.5299812786382335e-8,0.0011138441430138264,-7.063766770539463e-7,1.515359787677788e-8,0.0011140413969519087,-4.5716749529745555e-7,1.5014692696968984e-8,0.0011141679771116317,-2.5224292949749117e-7,1.4900524553462284e-8,0.0011142467106409985,-1.1360505719006956e-7,1.4823340179212186e-8,0.0011143057375622243,-5.1947099677121166e-8,1.478906414284595e-8,0.0011143745275428235,-6.641623982905153e-8,1.479718055412551e-8,0.0011144805411490116,-1.4554045014367347e-7,1.4841267716474989e-8,0.0011146465039405943,-2.6868186327244643e-7,1.4909818722617364e-8,0.0011148879464543517,-4.077487512787168e-7,1.4987193531681402e-8,0.0011152106069133069,-5.293572049765862e-7,1.5054810350341645e-8,0.001115607505557431,-5.981354506604627e-7,1.5092967998964315e-8,0.0011160562278251995,-5.82238372920153e-7,1.508390498897239e-8,0.0011165181858738054,-4.617774614729789e-7,1.5016501585294573e-8,0.0011169427756374372,-2.3916486858598275e-7,1.489207589936706e-8,0.001117279123695704,5.281074662320559e-8,1.4728931150574154e-8,0.0011174945353303808,3.5238253651923323e-7,1.4561593636104278e-8,0.0011175918891919794,5.85237341776037e-7,1.4431602483043102e-8,0.001117613973298778,6.922600246158575e-7,1.4371955080154304e-8,0.0011176285284481737,6.540692000960255e-7,1.4393394122909386e-8,0.0011177012518909313,4.973859584028976e-7,1.4480914676359373e-8,0.0011178724639969737,2.807665191832271e-7,1.4601797634793543e-8,0.0011181484319527568,7.064887876481905e-8,1.4718987525011862e-8,0.0011185068668504749,-7.890745011779789e-8,1.4802357637019236e-8,0.0011189091709123736,-1.3646153918415363e-7,1.4834384089423755e-8,0.0011193126105248509,-9.43931094899234e-8,1.48108065335213e-8,0.0011196792366973227,3.5164048593491474e-8,1.473837430297344e-8,0.0011199811858316087,2.26369559642981e-7,1.4631494218090753e-8,0.0011202031869314724,4.4589422366034254e-7,1.4508776239873582e-8,0.00112034310520379,6.586854121746841e-7,1.4389816343386903e-8,0.0011204109385747102,8.330417415667043e-7,1.4292352649188305e-8,0.0011204265234972595,9.446967691452359e-7,1.4229970169917528e-8,0.0011204162785695454,9.796302768584618e-7,1.4210520366177409e-8,0.0011204093914756884,9.354136766252925e-7,1.423536740670385e-8,0.0011204339509095645,8.210357617533893e-7,1.4299488573279187e-8,0.0011205135047749502,6.554492436680685e-7,1.4392288214421408e-8,0.0011206642577800594,4.652528434009131e-7,1.4498888367884619e-8,0.001120892869175372,2.817729973787914e-7,1.4601751044198787e-8,0.0011211947550755549,1.3757495990860276e-7,1.4682621069015419e-8,0.0011215528883894927,6.21872975976025e-8,1.4724918735586556e-8,0.001121937523487324,7.657802320904832e-8,1.471684663627745e-8,0.0011223081121608392,1.862337483495964e-7,1.4655293964103262e-8,0.0011226193191337492,3.7406125879550593e-7,1.4549846746055096e-8,0.001122832579558784,5.965725646991329e-7,1.4424943518651694e-8,0.001122931860338344,7.888398809784377e-7,1.4317073347269448e-8,0.0011229368584202211,8.823540066354003e-7,1.42646972284513e-8,0.0011229030163360236,8.31978931560535e-7,1.4293081372632381e-8,0.0011229027871189272,6.377983868581165e-7,1.4402074372500076e-8,0.0011229961745440554,3.466313844851877e-7,1.4565346045514696e-8,0.0011232080312209413,3.131213495657076e-8,1.4742059226319447e-8,0.0011235241667242122,-2.384517151272013e-7,1.4893183747109764e-8,0.0011239038866639104,-4.1705069829968125e-7,1.4993199888376666e-8,0.0011242978045176068,-4.891837396590307e-7,1.5033552385496457e-8,0.0011246618087164136,-4.650533911979487e-7,1.501996092483476e-8,0.0011249644073865193,-3.712956185955165e-7,1.4967350495564534e-8,0.0011251887847238463,-2.4226609099827207e-7,1.489497804254355e-8,0.0011253319323496448,-1.1342860023329529e-7,1.4822732804632492e-8,0.001125402634959825,-1.6748392335343594e-8,1.476855463336166e-8,0.0011254190551908455,2.2583818610430424e-8,1.4746592428163293e-8,0.001125406006350285,-1.147849811646348e-8,1.4765866874794957e-8,0.0011253918703925659,-1.2428284425453638e-7,1.4829389975213278e-8,0.001125405153669,-3.098575433825358e-7,1.4933811618400424e-8,0.001125470825285484,-5.515007109536961e-7,1.5069747750744837e-8,0.0011256068473051415,-8.237402109522106e-7,1.522287862447306e-8,0.0011258213742378021,-1.0955210324600928e-6,1.5375735433027346e-8,0.001126110953640497,-1.33434576076099e-6,1.551002392607651e-8,0.0011264599688784321,-1.5110754595557068e-6,1.5609325258051984e-8,0.0011268415324472347,-1.6050367155868619e-6,1.5661979950811296e-8,0.0011272200850014037,-1.6091063327225863e-6,1.5663968705012574e-8,0.0011275562307977297,-1.5342861631028003e-6,1.5621508044081852e-8,0.0011278144681279808,-1.4124327608801717e-6,1.5552595027563792e-8,0.001127973697196369,-1.2945868803236955e-6,1.548604925928786e-8,0.0011280382587597413,-1.2418556395565706e-6,1.5456333428887506e-8,0.0011280441049613882,-1.3076713541081708e-6,1.5493515389976944e-8,0.0011280530903307478,-1.5159246352740396e-6,1.5610950547436537e-8,0.001128132778175655,-1.8463668689740967e-6,1.579711977668449e-8,0.0011283296134604944,-2.238778351585612e-6,1.601804452302929e-8,0.0011286507402838491,-2.6162893563312223e-6,1.6230430827785135e-8,0.001129064849116733,-2.914505922934018e-6,1.639803217786027e-8,0.0011295188883964043,-3.1003495271215335e-6,1.650223555792818e-8,0.0011299585096496848,-3.1743954370268017e-6,1.6543390761059785e-8,0.0011303422387863712,-3.1616614223987634e-6,1.6535639899295777e-8,0.0011306468543703053,-3.099226465392222e-6,1.649993957729718e-8,0.0011308665355909385,-3.026115926253836e-6,1.6458343678529448e-8,0.0011310092877528594,-2.97696670198988e-6,1.643041637428008e-8,0.0011310930107738839,-2.9787150579821667e-6,1.643135725219101e-8,0.0011311420979546502,-3.048971357365785e-6,1.6471083224590702e-8,0.0011311844863316548,-3.1951543584245246e-6,1.655374177555831e-8,0.0011312487969415517,-3.4140426711787296e-6,1.667746050617603e-8,0.001131361247585663,-3.6918347099299193e-6,1.683438659836271e-8,0.0011315422288500833,-4.005155407124281e-6,1.701126248263884e-8,0.0011318028686057846,-4.323516118603748e-6,1.719082210152812e-8,0.001132142305142021,-4.613386976593811e-6,1.7354095519871995e-8,0.001132546459390808,-4.843583003603475e-6,1.7483454475893005e-8,0.0011329889427781129,-4.991272754047409e-6,1.7566013688537354e-8,0.0011334344413259357,-5.047541910774497e-6,1.7596784618951905e-8,0.001133844458183822,-5.021292733474158e-6,1.7580889129752105e-8,0.0011341848700335095,-4.94040959890774e-6,1.753421475919338e-8,0.0011344344119443499,-4.8491916969188745e-6,1.748193700907113e-8,0.0011345925814498685,-4.801059066100088e-6,1.745434825021528e-8,0.001134684387300292,-4.846227082445247e-6,1.7479841111046328e-8,0.0011347584805635495,-5.0160858158737145e-6,1.7576061597522453e-8,0.0011348759327808268,-5.309263400214288e-6,1.7742064468409605e-8,0.0011350908173706725,-5.6869034120381485e-6,1.7955706489080888e-8,0.0011354299176144932,-6.082800701089851e-6,1.8179418623203863e-8,0.0011358822190113598,-6.426124898603051e-6,1.8373054177066374e-8,0.0011364043809356825,-6.665757949870108e-6,1.8507648393622844e-8,0.0011369384853650538,-6.7840861137196476e-6,1.8573247563186413e-8,0.0011374316455507916,-6.795823634017219e-6,1.8578280026159067e-8,0.001137848673807987,-6.736604005607285e-6,1.85430965640259e-8,0.001138175543947817,-6.649378408098194e-6,1.8492219634553844e-8,0.0011384164599360274,-6.574091986083006e-6,1.8448433493018965e-8,0.0011385884812031334,-6.5420367269707E-06,1.8429543600599157e-8,0.0011387163515221173,-6.573764105960214e-6,1.844718403120001e-8,0.0011388284833158092,-6.678850501571657e-6,1.8506697577031452e-8,0.0011389539421612653,-6.856289459219892e-6,1.8607380918886297e-8,0.0011391198567281403,-7.094990988364993e-6,1.8742791852569966e-8,0.0011393486909906535,-7.374470404067843e-6,1.8901162544082247e-8,0.001139655105173082,-7.666288253826918e-6,1.9066235687773136e-8,0.0011400426757558419,-7.936983461486883e-6,1.921894205864218e-8,0.0011405013577337874,-8.152936837249098e-6,1.9340168556050783e-8,0.0011410069453844265,-8.286904307477137e-6,1.941447163411268e-8,0.001141523687978373,-8.325052062458535e-6,1.943407977800105e-8,0.0011420104921204704,-8.272482966705914e-6,1.940204081740356e-8,0.0011424298885641681,-8.155032071176124e-6,1.9333238629293002e-8,0.0011427577026877223,-8.01590505046847e-6,1.9252449665323856e-8,0.0011429907616206283,-7.907174957399983e-6,1.9189445751876634e-8,0.0011431501649271265,-7.877608061907913e-6,1.917200273740673e-8,0.0011432784491987938,-7.9594886944176e-6,1.9218374972079383e-8,0.0011434302434748492,-8.157983701078854e-6,1.9331275036921774e-8,0.0011436578055424847,-8.446881947193677e-6,1.949552477305666e-8,0.00114399515501405,-8.773659928063834e-6,1.9681008281834052e-8,0.001144446522983574,-9.073972603149053e-6,1.9850948567032337e-8,0.0011449845240813815,-9.291172843971188e-6,1.997301868872744e-8,0.0011455595354737658,-9.393027652032006e-6,2.0028869806567677e-8,0.0011461161009334714,-9.378716130867975e-6,2.001814630971795e-8,0.0011466089029168024,-9.274461172054308e-6,1.9956008806800238e-8,0.0011470122988015584,-9.121833292035425e-6,1.9866427698242803e-8,0.00114732188508422,-8.96496066277439e-6,1.977481168122164e-8,0.001147550426654242,-8.84115873090527e-6,1.970259092640148e-8,0.0011477216937115396,-8.776250220560751e-6,1.966451506584681e-8,0.0011478647584178116,-8.783503033521037e-6,1.966805944170667e-8,0.0011480097210303582,-8.864451422748417e-6,1.971393023358895e-8,0.0011481847339456337,-9.010282799110149e-6,1.9796897029095008e-8,0.0011484137013095736,-9.203162855983934e-6,1.9906583070119853e-8,0.0011487139621447924,-9.417536219790016e-6,2.0028232082651543e-8,0.0011490935669522466,-9.622008265590576e-6,2.0143797216780358e-8,0.0011495483701545808,-9.782674812070154e-6,2.0233850339937727e-8,0.0011500598968202766,-9.868530899457088e-6,2.0280675342107168e-8,0.001150595576793416,-9.858788234789456e-6,2.027245503525575e-8,0.0011511130407411538,-9.750551556433113e-6,2.0207673116114426e-8,0.0011515690958261268,-9.563815939238883e-6,2.0097983923800655e-8,0.0011519316806153635,-9.340392670730376e-6,1.9967584121287674e-8,0.001152190749497022,-9.135185026245966e-6,1.9848156573524196e-8,0.0011523634382926925,-9.001659265593388e-6,1.9770455193964563e-8,0.0011524907957058544,-8.976351650421527e-6,1.975535707782608e-8,0.0011526268209164589,-9.067935946616826e-6,1.9807599727437817e-8,0.0011528235054923113,-9.25449432683755e-6,1.9914294904382524e-8,0.0011531166414686328,-9.489552149459594e-6,2.0048491573720485e-8,0.0011535164504243166,-9.71476019621844e-6,2.0176519619224113e-8,0.0011540055000518578,-9.875454353321969e-6,2.0266935867828633e-8,0.0011545443526542588,-9.934597905884134e-6,2.029851857027083e-8,0.0011550830429836547,-9.881012223473731e-6,2.026498429883669e-8,0.0011555744937682764,-9.729706251418504e-6,2.0175168201088018e-8,0.0011559854772124829,-9.51504938883692e-6,2.0049071556327196e-8,0.0011563021464909625,-9.280042396553756e-6,1.991163982225793e-8,0.0011565296752859802,-9.065727818539686e-6,1.9786613888511836e-8,0.001156687736425848,-8.903688987058367e-6,1.9692182364519e-8,0.0011568044046975123,-8.8125619957311e-6,1.9638981965480233e-8,0.0011569105458751,-8.797789715304598e-6,1.9629991386652268e-8,0.0011570356151798416,-8.853178776230065e-6,1.9661469660227554e-8,0.0011572048275839113,-8.963029002850191e-6,1.9724213131765286e-8,0.0011574371573823965,-9.104180604326605e-6,1.9804750235027096e-8,0.0011577435098976399,-9.247950130788989e-6,1.9886461799431398e-8,0.0011581246406424353,-9.362476184699034e-6,1.9950934601369646e-8,0.001158568958664678,-9.41631267388031e-6,1.9980033554842147e-8,0.001159051135572797,-9.383982662467644e-6,1.9959107105592105e-8,0.0011595332400694842,-9.253407196201551e-6,1.988127948054991e-8,0.0011599704116754437,-9.033473617199929e-6,1.9751830591591057e-8,0.001160321905079089,-8.757962164306107e-6,1.9590469326886845e-8,0.0011605651381540996,-8.481352968156326e-6,1.9428884611557018e-8,0.0011607066977102414,-8.264780100526713e-6,1.9302555692561575e-8,0.0011607835786356816,-8.156211653841857e-6,1.9239208531028127e-8,0.001160852303938451,-8.173672131833849e-6,1.9249082973678126e-8,0.0011609704050213417,-8.299502401002055e-6,1.9321670102197103e-8,0.0011611786600939425,-8.487524842860316e-6,1.942996472795716e-8,0.00116149085756971,-8.678548440956826e-6,1.9539526753642373e-8,0.0011618930476837161,-8.817263786054158e-6,1.961829467481908e-8,0.0011623502480845786,-8.865197369246996e-6,1.9644073624203352e-8,0.0011628170462849206,-8.807345064885849e-6,1.9608343243756524e-8,0.001163248772606246,-8.652436380407108e-6,1.9516370694754277e-8,0.0011636107636861521,-8.42810745764086e-6,1.9384372461534673e-8,0.0011638841503945102,-8.17290291549061e-6,1.9234838808357553e-8,0.0011640675332915647,-7.927309243105636e-6,1.9091306227406572e-8,0.001164174910574985,-7.725934562782125e-6,1.897381570422459e-8,0.0011642310911780206,-7.592301438636944e-6,1.8895911963434465e-8,0.001164266183153776,-7.536686249750781e-6,1.8863426101585725e-8,0.0011643105098843333,-7.556534996681924e-6,1.8874751833990127e-8,0.0011643907219274397,-7.638508383357229e-6,1.892205030520054e-8,0.0011645272144765674,-7.761166811425134e-6,1.8992807601442906e-8,0.0011647324707863098,-7.897651936164617e-6,1.9071379900299287e-8,0.0011650098094900412,-8.018265814666975e-6,1.914048233352255e-8,0.0011653521888236509,-8.093307790327415e-6,1.9182839583695098e-8,0.001165741133615056,-8.096798948189496e-6,1.9183362843101123e-8,0.0011661465394286383,-8.01169930545659e-6,1.913219846759754e-8,0.0011665289267256526,-7.836536321099879e-6,1.9028592765835697e-8,0.0011668460658409007,-7.591725078170206e-6,1.8884569456476698e-8,0.0011670647742319771,-7.321672629410377e-6,1.872613603007408e-8,0.0011671752536712213,-7.087778965397692e-6,1.8589162929747138e-8,0.0011672007945532352,-6.950506281680236e-6,1.8508875117680157e-8,0.0011671946165852476,-6.946270276537636e-6,1.8506350208028936e-8,0.0011672219724961402,-7.071417197234697e-6,1.8579216055933185e-8,0.0011673358746302342,-7.283275108892446e-6,1.8702356985605753e-8,0.0011675594159570796,-7.517413113909867e-6,1.8838061377010595e-8,0.0011678822015231747,-7.710561368063675e-6,1.8949420655493054e-8,0.0011682689261397071,-7.818135372925264e-6,1.9010538692202126e-8,0.0011686730493583339,-7.821696462300443e-6,1.90108499425854e-8,0.0011690494583318888,-7.727720962976632e-6,1.8954353489254236e-8,0.0011693632444199163,-7.56134032774171e-6,1.885590552632025e-8,0.00116959424227111,-7.358324729191973e-6,1.8736493783482777e-8,0.0011697381322427927,-7.157289319737172e-6,1.861866602390422e-8,0.001169805015940991,-6.993028321525914e-6,1.852264983791331e-8,0.0011698161546601542,-6.891491872816817e-6,1.8463458014440653e-8,0.0011697995747586565,-6.866806023143072e-6,1.8449195474681566e-8,0.001169785345145261,-6.9204124414224666e-6,1.8480593608555368e-8,0.0011698012390084927,-7.0420511084665356e-6,1.8551596753815423e-8,0.0011698692959780039,-7.212115770190638e-6,1.865072612237821e-8,0.001170003535115469,-7.40476340602822e-6,1.876287162320732e-8,0.0011702087001298016,-7.591191261412983e-6,1.887118665962335e-8,0.001170479701385697,-7.742851069545861e-6,1.895896527939579e-8,0.0011708015200401624,-7.834746251544546e-6,1.9011588216858993e-8,0.0011711496211634048,-7.849130822009977e-6,1.9018713426567524e-8,0.0011714913924403504,-7.779910197998646e-6,1.8976869060788222e-8,0.0011717897544849946,-7.637523831636095e-6,1.889230519205385e-8,0.001172010309956273,-7.452738502943907e-6,1.8783182601489195e-8,0.0011721323598993924,-7.275994332800178e-6,1.867913794942048e-8,0.0011721611281580594,-7.168155593634209e-6,1.861581265298405e-8,0.0011721343191450696,-7.1813051484193844e-6,1.862357539268324e-8,0.0011721149049607846,-7.335813716215587e-6,1.87141217167984e-8,0.001172168800567516,-7.607145133330706e-6,1.8872833135365767e-8,0.0011723380208572738,-7.933227173421569e-6,1.9063184028057393e-8,0.0011726252496139771,-8.239481077610759e-6,1.924143891636807e-8,0.0011729975280554965,-8.466260519538257e-6,1.9372719916227837e-8,0.0011734031858778484,-8.584501548552111e-6,1.944016181411194e-8,0.001173790302185874,-8.596454295920204e-6,1.944531693494591e-8,0.0011741190787508823,-8.527161410478187e-6,1.9403109104349883e-8,0.0011743669348481497,-8.413502697600549e-6,1.933534155711618e-8,0.0011745284115409797,-8.294793736602777e-6,1.9265131227668844e-8,0.0011746124079364151,-8.206190261184355e-6,1.9213032276832187e-8,0.0011746385065752375,-8.174556373859033e-6,1.9194649111671876e-8,0.0011746330915234392,-8.216052103381338e-6,1.9219279634408336e-8,0.0011746253880197785,-8.335082109550146e-6,1.9289350289034145e-8,0.0011746435809791025,-8.524542340119898e-6,1.9400586230916127e-8,0.0011747112692470335,-8.767280557710057e-6,1.954286430798587e-8,0.0011748445359639791,-9.03865596643075e-6,1.9701692857538592e-8,0.0011750499632298852,-9.309966660718363e-6,1.9860201817912727e-8,0.001175323799399941,-9.552298843262974e-6,2.0001396821218872e-8,0.00117565222379474,-9.740381416028808e-6,2.0110439466007515e-8,0.0011760125740055314,-9.856258828588306e-6,2.0176834214821782e-8,0.001176375524771259,-9.89270749701017e-6,2.0196458357561633e-8,0.0011767084198622795,-9.856295447680713e-6,2.0173355725141192e-8,0.0011769802534832457,-9.769680052766479e-6,2.0121046365166935e-8,0.001177168799588408,-9.671871258832764e-6,2.0062613323586582e-8,0.0011772694476469777,-9.6141384720008e-6,2.002822704058926e-8,0.0011773031276615976,-9.649130357389883e-6,2.004871269724044e-8,0.001177317927990144,-9.813195811093411e-6,2.0145182911243707e-8,0.0011773784774201084,-1.0107742086366462e-5,2.031816622647421e-8,0.0011775429199502576,-1.0491244705205072e-5,2.054301185498362e-8,0.001177837880102486,-1.0891186429975976e-5,2.077695811502661e-8,0.0011782469508336748,-1.1232228758863288e-5,2.0975685618500445e-8,0.0011787199252995327,-1.1464270048217633e-5,2.1109807093236463e-8,0.001179195117857407,-1.1575096317836384e-5,2.1172327792887724e-8,0.0011796204060343677,-1.1585333083324484e-5,2.117567378298927e-8,0.001179964253721622,-1.153426084540048e-5,2.1143276835969646e-8,0.001180216947487361,-1.1465789942356163e-5,2.1101215758474892e-8,0.0011803864077251783,-1.1418915216628996e-5,2.107252293342305e-8,0.0011804924552570766,-1.1422849945557147e-5,2.1074313204903283e-8,0.0011805616351961057,-1.149534972563153e-5,2.111684828473406e-8,0.0011806231296561194,-1.164260838042896e-5,2.1203547272920038e-8,0.001180705405349917,-1.185983590457733e-5,2.133138289587363e-8,0.0011808332022572984,-1.2132380829244001e-5,2.1491566451183692e-8,0.0011810247593277404,-1.2437538534793616e-5,2.1670609888946692e-8,0.00118128939658047,-1.2747235945817167e-5,2.1851893747692842e-8,0.0011816258296817952,-1.3031688632184382e-5,2.2017816721285344e-8,0.0011820217409164156,-1.3263766786722557e-5,2.215238102483769e-8,0.0011824549343442512,-1.3423476824073942e-5,2.224386173036045e-8,0.0011828960923008392,-1.3501908143475178e-5,2.228715845248425e-8,0.0011833129578829248,-1.3504032616951642e-5,2.2285447254115404e-8,0.0011836756314048944,-1.3449812928952117e-5,2.2250794275112108e-8,0.001183962592413837,-1.3373153848677134e-5,2.2203458812617827e-8,0.0011841669322909438,-1.3318065327970467e-5,2.2169537514422055e-8,0.0011843016926503368,-1.3331175884827947e-5,2.2176482373441217e-8,0.0011844020642103072,-1.3450260247773386e-5,2.2246332098472546e-8,0.001184521202676278,-1.3690428025695983e-5,2.2387640451217336e-8,0.0011847171293863903,-1.4032994909381187e-5,2.2589027933433944e-8,0.001185032463777717,-1.4424743371322873e-5,2.281883562996951e-8,0.0011854755677246913,-1.4792794984495582e-5,2.3033918419938312e-8,0.0011860147396502052,-1.507088024578483e-5,2.319513060443558e-8,0.0011865905179456926,-1.5223319477673633e-5,2.328150001628114e-8,0.0011871389466646689,-1.5253718038456167e-5,2.3295410581307743e-8,0.0011876123061146714,-1.519648813755946e-5,2.3257586969311357e-8,0.0011879885113928858,-1.5099845661934605e-5,2.3196940123018956e-8,0.0011882695341677578,-1.501035144178206e-5,2.31412842396481e-8,0.0011884742356245803,-1.4963788315746421e-5,2.3111852364620775e-8,0.001188630530564791,-1.4982034546106686e-5,2.3121452402727265e-8,0.0011887692807419578,-1.507353292827563e-5,2.3174817880824452e-8,0.0011889202463939105,-1.5235106883747588e-5,2.3269772227890994e-8,0.0011891093972103773,-1.5453904219857056e-5,2.3398442893928934e-8,0.001189356787492648,-1.5709243646093957e-5,2.3548380493865156e-8,0.001189674562434833,-1.597465760311393e-5,2.3703767108688843e-8,0.0011900650705906138,-1.622059546320253e-5,2.3847010207390837e-8,0.0011905194959919482,-1.641817450904896e-5,2.396096721453941e-8,0.0011910177895063875,-1.6543919681829082e-5,2.403177226492937e-8,0.0011915306556030559,-1.6584788766736868e-5,2.4051839818261955e-8,0.001192023898945927,-1.6542298384545826e-5,2.4022324070467803e-8,0.001192464757553144,-1.643440146715635e-5,2.3954211093486313e-8,0.001192829119799411,-1.629404609753833e-5,2.3867395750016865e-8,0.001193108027212104,-1.6164104458207515e-5,2.3787569044241983e-8,0.0011933118430555575,-1.608921071912973e-5,2.3741272731391792e-8,0.0011934707320330146,-1.6105658509481013e-5,2.374985781205688e-8,0.0011936303976635173,-1.623111932778949e-5,2.3823425330801796e-8,0.0011938425904213918,-1.6456797947603263e-5,2.3956291913805633e-8,0.0011941512693824246,-1.6745405678767475e-5,2.4125926378533872e-8,0.0011945777513011316,-1.703806116613979e-5,2.4297131106293858e-8,0.0011951108176325653,-1.7270552184130284e-5,2.4431706269672658e-8,0.0011957078826386161,-1.7394145331375484e-5,2.4500786304503858e-8,0.001196308651953773,-1.7391670563142902e-5,2.4494397478295562e-8,0.0011968553574094527,-1.7280885870127336e-5,2.442346637634852e-8,0.0011973097438809756,-1.7104486121415902e-5,2.4313830319614202e-8,0.0011976600271846305,-1.6913544964189015e-5,2.4196263777647027e-8,0.0011979178287977973,-1.6752823815132273e-5,2.4097605696463648e-8,0.0011981097707620147,-1.6652578579863055e-5,2.4035827004151324e-8,0.0011982686801686477,-1.6626751066110573e-5,2.401899572758425e-8,0.0011984270612510747,-1.6674980003615707e-5,2.4046572026728495e-8,0.0011986131998672476,-1.6785856209140574e-5,2.411144126081378e-8,0.00119884907936858,-1.6939967517406705e-5,2.4201781684558578e-8,0.0011991490988296598,-1.7112385016964997e-5,2.430255743190104e-8,0.0011995189044720176,-1.727490968716899e-5,2.4396846663078468e-8,0.0011999541434850292,-1.73987053704685e-5,2.446740213138539e-8,0.0012004395264967585,-1.7457927525291007e-5,2.4498820966803372E-08,0.0012009491082435547,-1.743451264755266e-5,2.4480422287605266e-8,0.001201448900782843,-1.7323465817622007e-5,2.4409425154034857e-8,0.0012019025457898729,-1.713703206787251e-5,2.429344400128628e-8,0.0012022796375072394,-1.6905527800039264e-5,2.415095110327444e-8,0.001202564674709609,-1.66730256383639e-5,2.4008615527302114e-8,0.0012027634568679232,-1.6487847620334767e-5,2.3895505198766226e-8,0.001202904030611828,-1.6390163394670685e-5,2.3835574955575874e-8,0.0012030311028923925,-1.6400516224166192e-5,2.384078723594285e-8,0.0012031951747230444,-1.6513004713512284e-5,2.390712060734509e-8,0.001203439368777117,-1.6695385826531313e-5,2.4014786720648956e-8,0.0012037875416534632,-1.6896357132806125e-5,2.413273573212916e-8,0.0012042369997383238,-1.7058417430140396e-5,2.422642990299439e-8,0.001204758270153749,-1.7133153462624448e-5,2.42669920335499e-8,0.0012053027296240449,-1.7094557087145528e-5,2.4239131779032624e-8,0.001205816243419089,-1.694576087819249e-5,2.414512189749825e-8,0.001206254208107606,-1.671652593603102e-5,2.4003224447649546e-8,0.0012065924774887938,-1.6452686017868706e-5,2.3841274764580573e-8,0.0012068306855210508,-1.6202252980745935e-5,2.3688257288772364e-8,0.0012069882451567506,-1.6003642610002783e-5,2.3567193058502826e-8,0.0012070962548821874,-1.5879317737007825e-5,2.3491350212189728e-8,0.0012071891126864752,-1.5834987172204415e-5,2.3463848234982794e-8,0.0012072982435586271,-1.5862395994595704e-5,2.3479429419473134E-08,0.0012074484919681056,-1.5943390285158226e-5,2.3526960795175952e-8,0.0012076565349967772,-1.6053727644420263e-5,2.3591735054261115e-8,0.0012079303224518817,-1.6166109640853678e-5,2.3657270713232458e-8,0.0012082687433021958,-1.625265566416613e-5,2.370677465035961e-8,0.0012086611896754904,-1.6287448494366172e-5,2.372466631141001e-8,0.0012090872917999832,-1.6249836702848495e-5,2.3698580523446967e-8,0.0012095176855486077,-1.6128815528154758e-5,2.3622028928013453e-8,0.0012099170613362122,-1.592798579392285e-5,2.349739986274672e-8,0.0012102505659388227,-1.566936060894537e-5,2.3338237567455915e-8,0.0012104933479661164,-1.5393153749585413e-5,2.316906420901978e-8,0.0012106406191476266,-1.5150881099106516e-5,2.302113572545944e-8,0.001210713427762985,-1.4991745019339821e-5,2.2924136337323242e-8,0.0012107557250189674,-1.4946543294335746e-5,2.2896419733099684e-8,0.0012108221716802248,-1.5016161651831003e-5,2.293810304377412e-8,0.0012109612315525406,-1.5170264902251345e-5,2.3030401775421017e-8,0.0012112005956738774,-1.535671009607627e-5,2.3141465559964834e-8,0.0012115402123723076,-1.551722648703216e-5,2.3235958218962858e-8,0.0012119541203185218,-1.5603217342101987e-5,2.32846361790215e-8,0.0012123989690091418,-1.558704649773601e-5,2.32711262155396e-8,0.0012128258188160085,-1.546672637976945e-5,2.3194667025593706e-8,0.0012131919055231588,-1.526397476343263e-5,2.306882035076686e-8,0.001213469672752588,-1.5016981076206275e-5,2.2916988632259907e-8,0.0012136512717100716,-1.4770193242323362e-5,2.2766165374691033e-8,0.0012137479589100495,-1.4563974629347552e-5,2.2640665341646183e-8,0.0012137852603573004,-1.4426773355970368e-5,2.255743926778347e-8,0.0012137959093788662,-1.4371343522844578e-5,2.2523883713028728e-8,0.0012138128365966673,-1.439499826481813e-5,2.2538091856692798e-8,0.0012138638400819995,-1.4482668698853964e-5,2.2590762305896745e-8,0.0012139685086682349,-1.4611158244269921e-5,2.2667775734842887e-8,0.0012141370773553156,-1.4753294457875256e-5,2.2752669276880412e-8,0.0012143704447298367,-1.4881339284913565e-5,2.2828655628043122e-8,0.0012146606157735983,-1.4969696583580246e-5,2.2880242761076628e-8,0.0012149911979015464,-1.499739616837105e-5,2.2894754107216863e-8,0.001215338074413792,-1.495094088433912e-5,2.286409075695815e-8,0.0012156709220629822,-1.4827860365214653e-5,2.278691472150337e-8,0.0012159566967008494,-1.4640607873998432e-5,2.2671006872583375e-8,0.0012161661678526474,-1.4419214392042551e-5,2.253482998176492e-8,0.0012162834218881762,-1.4209794962010202e-5,2.2406545421342624e-8,0.001216315642396274,-1.4065845309811994e-5,2.2318651755283653e-8,0.0012162975273846636,-1.4032046896515793e-5,2.229810801795348e-8,0.001216284646636957,-1.412603160851158e-5,2.2355282871068613e-8,0.0012163354726003424,-1.4328040488737538e-5,2.2477767363016963e-8,0.0012164899159747096,-1.4585949126754397e-5,2.263355123417095e-8,0.001216755574130199,-1.4833892797710722e-5,2.278243853374842e-8,0.0012171078245810246,-1.5014490026863692e-5,2.2889603737556964e-8,0.001217501208749591,-1.5094377647005056e-5,2.2935034657986378e-8,0.0012178847630020077,-1.5068934395509631e-5,2.2916347417685273e-8,0.0012182150285436164,-1.4958137548021152e-5,2.2846155074825506e-8,0.0012184640069405344,-1.4797783644600629e-5,2.2746590779909395e-8,0.0012186220505673322,-1.4629683731770791e-5,2.2643235920746163e-8,0.001218696822913379,-1.449297270290909e-5,2.2559801522444672e-8,0.0012187095811834294,-1.4417539138099393e-5,2.2514186857630122e-8,0.0012186898663968694,-1.4420061297596525e-5,2.2516180023635898e-8,0.0012186696633395672,-1.4502833252156467e-5,2.2566860603567102e-8,0.0012186780735641304,-1.4655108434294776e-5,2.2659490899290508e-8,0.0012187372918174148,-1.4856253456001961e-5,2.2781443114298367e-8,0.001218860273629298,-1.5079824490775369e-5,2.2916635639418696e-8,0.0012190500435946263,-1.5297700051893458e-5,2.3047988343221898e-8,0.001219300200263371,-1.548365519236493e-5,2.3159560794279936e-8,0.0012195960618367548,-1.5616237415079354e-5,2.3238309613797606e-8,0.0012199161265676276,-1.568118550987916e-5,2.3275603178996437e-8,0.0012202338545077081,-1.567373100870673e-5,2.326866879195279e-8,0.0012205201561264112,-1.560100091808706e-5,2.3222067337371707e-8,0.001220747382989795,-1.5484226141098953e-5,2.3148995007320677e-8,0.0012208955835540899,-1.535941411892994e-5,2.3071605072069785e-8,0.0012209607427107806,-1.5274050539459638e-5,2.3018902382756045e-8,0.001220962475274646,-1.5277280997782236e-5,2.3020705792687032e-8,0.0012209458731045407,-1.5403436960660497e-5,2.309762894932575e-8,0.0012209717976255354,-1.565448470536381e-5,2.3250476497938733e-8,0.0012210955463632595,-1.5992317511104423e-5,2.345566341649283e-8,0.0012213435678971353,-1.634934524496698e-5,2.367175263118225e-8,0.0012217022640911984,-1.6653999885394203e-5,2.3855040758167472e-8,0.0012221254162641652,-1.685673242853055e-5,2.397543609100118e-8,0.0012225539172616843,-1.694295513018085e-5,2.4024369111537456e-8,0.0012229355612905532,-1.6930207344080828e-5,2.4013018459709848e-8,0.0012232368258948774,-1.6856088422204816e-5,2.3964815471614588e-8,0.001223445818883135,-1.6764870074623695e-5,2.3907108196114857e-8,0.0012235694616662836,-1.66972195773145e-5,2.3864781052871904e-8,0.0012236282176459417,-1.668400111843338e-5,2.3856473140188308e-8,0.0012236504409797394,-1.6743379709783217e-5,2.3892909894168513e-8,0.0012236671763620997,-1.6880175503808295e-5,2.3976645895061022e-8,0.001223707624433692,-1.708683221483701e-5,2.4102766441136323e-8,0.0012237954317209335,-1.734565340062886e-5,2.426029685357651e-8,0.0012239459921608604,-1.7631973134540477e-5,2.4434117926847972e-8,0.0012241649213519893,-1.791791608308859e-5,2.4607207076905056e-8,0.0012244478183697678,-1.817632574317451e-5,2.476299133590999e-8,0.0012247812244358886,-1.838435464330882e-5,2.4887533086232756e-8,0.0012251444556581857,-1.8526399189167512e-5,2.4971356499031972e-8,0.001225512030680893,-1.8596356874691012e-5,2.5010875116620252e-8,0.0012258566090267735,-1.8599249204608337e-5,2.500940666446154e-8,0.0012261525206215848,-1.8552184327634754e-5,2.4977727871947743e-8,0.0012263801754533244,-1.8484389126531722e-5,2.4934001023126065e-8,0.001226531589440995,-1.8435353897332787e-5,2.4902521731442044e-8,0.0012266163824655456,-1.844942436845583e-5,2.4910327037782435e-8,0.0012266658987470957,-1.8565429063659797e-5,2.498085133256966e-8,0.0012267312754294553,-1.880207278591228e-5,2.5125090674904964e-8,0.0012268713258371598,-1.914430998630717e-5,2.533341535608457e-8,0.001227131022819862,-1.954022969406463e-5,2.557377342250434e-8,0.0012275202373195173,-1.991570456003484e-5,2.5800673545950185e-8,0.0012280066605481112,-2.0202550073462475e-5,2.5972399157529153e-8,0.0012285289260753722,-2.036442274620531e-5,2.6066887113834473e-8,0.0012290215337736447,-2.0405843598096857e-5,2.608730247250189e-8,0.0012294364792536673,-2.0362831684957532e-5,2.605626237353159e-8,0.0012297525480403702,-2.0285001528169813e-5,2.600470001447718e-8,0.001229973287643303,-2.0219675206655426e-5,2.596192790923771e-8,0.00123011945294299,-2.0202577079814657e-5,2.5949829286862887e-8,0.0012302208090147813,-2.0254570927893388e-5,2.598089556577197e-8,0.001230309575850642,-2.0382079862008366e-5,2.6058620701201978e-8,0.0012304158345859968,-2.0579100696291248e-5,2.6178889594627654e-8,0.0012305643517482184,-2.0829746668818747e-5,2.6331638580619262e-8,0.0012307723235892732,-2.1111062515209374e-5,2.6502607204116547e-8,0.0012310478548748765,-2.1396114777007075e-5,2.6675202086625746e-8,0.0012313891899758615,-2.1657391046044656e-5,2.6832534064826254e-8,0.0012317848985939483,-2.187044513583133e-5,2.6959629716658373e-8,0.001232215249623264,-2.2017430944470345e-5,2.7045614719736176e-8,0.0012326547447966258,-2.209001773221379e-5,2.7085542859440893e-8,0.0012330755592392312,-2.2091326924775106e-5,2.70816135899996e-8,0.0012334516279752959,-2.203663011034868e-5,2.7043580150642033e-8,0.001233763101802164,-2.1952544155669515e-5,2.6988170698065287e-8,0.001234000846053606,-2.1874499915341305e-5,2.6937404354593894e-8,0.0012341705639102628,-2.184212653370876e-5,2.691563704449534e-8,0.0012342956223987628,-2.1891979650956894e-5,2.6945050302677308e-8,0.001234416688585595,-2.2047557895417835e-5,2.7039585964648845e-8,0.0012345855888722889,-2.23083766412273e-5,2.719839449139654e-8,0.0012348517249173988,-2.2642708147870215e-5,2.7401545144008608e-8,0.0012352433616983397,-2.2990593392258627e-5,2.7611962377998624e-8,0.0012357521897338616,-2.328103233247334e-5,2.778596961972363e-8,0.0012363319390749912,-2.3458241076732956e-5,2.7889391237730747e-8,0.001236914832205126,-2.3503051358274284e-5,2.7910738893106944e-8,0.0012374372602634584,-2.34370143285074e-5,2.7863779646029196e-8,0.0012378600978094599,-2.3308844078715344e-5,2.7779123129400366e-8,0.001238175025995959,-2.3173834169043024e-5,2.7691345091404345e-8,0.0012383987375117022,-2.3077516654817154e-5,2.7628715793488518e-8,0.0012385621901050622,-2.304804267920002e-5,2.7608434146434345e-8,0.001238700730871274,-2.3095701387628564e-5,2.7636418998067664e-8,0.0012388473917175444,-2.321606101218933e-5,2.7709418024290113e-8,0.0012390291726658905,-2.339397590953754e-5,2.781763697063455e-8,0.001239265187271221,-2.3607198404592336e-5,2.7947049692492793e-8,0.0012395656932513142,-2.3829477290720274e-5,2.808131142382676e-8,0.001239931567574002,-2.4033454791804963e-5,2.8203502070202986e-8,0.001240354197034772,-2.419368952870141e-5,2.8297948187087624e-8,0.0012408160639877112,-2.4289979933212816e-5,2.835226322126063e-8,0.0012412924936616241,-2.431076507997636e-5,2.835947104322042e-8,0.001241754847581157,-2.4255949556786933e-5,2.8319783468064274e-8,0.0012421750027906508,-2.413837942889537e-5,2.8241514856497743e-8,0.0012425305735050856,-2.398330917104594e-5,2.8140695039591662e-8,0.001242810041407821,-2.3825431793646963e-5,2.803911624686781e-8,0.0012430167548026835,-2.3703494765039817e-5,2.796086702784852e-8,0.0012431707595330977,-2.3653019187846447e-5,2.792773776976358e-8,0.0012433075282853305,-2.3697965910599013e-5,2.7954078812129726e-8,0.0012434727173970845,-2.3842679769997022e-5,2.8041949740427052e-8,0.001243712463212426,-2.4066405760676784e-5,2.8177927469785303e-8,0.0012440601035040232,-2.432362427984792e-5,2.8333484399655164e-8,0.0012445228361571915,-2.4553159928907133e-5,2.84706844897476e-8,0.001245074558848186,-2.469598742631698e-5,2.8553156726817562e-8,0.0012456608862963842,-2.4715959349908565e-5,2.8558858281151512e-8,0.001246216708050109,-2.4613291013679496e-5,2.8488399775580813e-8,0.001246688489499405,-2.4423038202625592e-5,2.8364074640010765e-8,0.0012470500759516796,-2.4199802086790886e-5,2.8220269933140577e-8,0.0012473056186578205,-2.3997923243581362e-5,2.8091007067191165e-8,0.0012474816718979766,-2.3856832628854112e-5,2.8000725693752732e-8,0.0012476152297567857,-2.3795467178827526e-5,2.796083255759579e-8,0.0012477434727424471,-2.3813936544781482e-5,2.797087896365848e-8,0.0012478974825907967,-2.3898538079999737e-5,2.802185450423327e-8,0.0012480994715242364,-2.4027063105389873e-5,2.8099607177080368e-8,0.0012483620860405254,-2.4173063448967265e-5,2.8187527217003586e-8,0.0012486885425988454,-2.4309038643380227e-5,2.8268487756534477e-8,0.0012490729604937483,-2.4409048929309893e-5,2.832640747738927e-8,0.0012495008229754566,-2.4451320673572244e-5,2.8347832218140762e-8,0.0012499499393055541,-2.442119484453209e-5,2.8323772418069707e-8,0.0012503925365264328,-2.4314275664468087e-5,2.8251695604431464e-8,0.0012507990005257714,-2.4139030867608762e-5,2.8137171704645568e-8,0.001251143262636996,-2.391768914256767e-5,2.7994415164953935e-8,0.0012514090363835088,-2.368426701735876e-5,2.7844976389814205e-8,0.0012515953110546903,-2.3479107716070564e-5,2.771421375274228e-8,0.0012517191350728285,-2.3340474530020665e-5,2.7625933544735366e-8,0.0012518141482856812,-2.3295030625602135e-5,2.7596407518891168e-8,0.00125192444142756,-2.334975383124914e-5,2.7629401271552236e-8,0.0012520946514939732,-2.348776438369355e-5,2.7713746828686006e-8,0.0012523583631477433,-2.3669877510084097e-5,2.7824516476769492e-8,0.0012527277286170939,-2.38425421336231e-5,2.7928118057615044e-8,0.0012531876409788102,-2.3951178423680048e-5,2.7990642199443437e-8,0.0012536974445180235,-2.395580939174183e-5,2.7987543221912417e-8,0.0012542012794675764,-2.3843814405731823e-5,2.7911488512020674e-8,0.0012546444912580575,-2.3634230998913443e-5,2.7774939914552914e-8,0.0012549898708866338,-2.337098949679818e-5,2.760582318235473e-8,0.0012552269467497428,-2.31078977299701e-5,2.7438033142794907e-8,0.0012553712247767674,-2.2892283909759187e-5,2.730112602560997e-8,0.001255455539610628,-2.2753872111695107e-5,2.7213370434487382e-8,0.0012555187275849952,-2.2701515499694785e-5,2.7179817449245153e-8,0.0012555962675502516,-2.2726235663317327e-5,2.719436714414756e-8,0.0012557148843836085,-2.280713457832666e-5,2.724360162183075e-8,0.001255890687072248,-2.2917285638186973e-5,2.7310518757386415e-8,0.001256129398595488,-2.3028282424195017e-5,2.7377340966423323e-8,0.0012564273842037858,-2.3113398094334926e-5,2.742741470506988e-8,0.001256772748129926,-2.3149894992070267e-5,2.7446594516070987e-8,0.0012571463545275083,-2.3121157899020574e-5,2.7424565261140528e-8,0.0012575231640768645,-2.3019131476612913e-5,2.7356401669610725e-8,0.001257874612111306,-2.284700440575688e-5,2.7244296214391676e-8,0.0012581727000068063,-2.2621361371800596e-5,2.7098925268443296e-8,0.0012583959412701018,-2.2372382207858894e-5,2.6939533510837228e-8,0.0012585362273141267,-2.2140433227805133e-5,2.6791698499354605e-8,0.0012586042852673735,-2.196814660205169e-5,2.6682241581275458e-8,0.0012586306549829782,-2.1889126806689826e-5,2.6632055608261722e-8,0.0012586601311620252,-2.1916855981065547e-5,2.664914718129419e-8,0.0012587403517282045,-2.2038399148444123e-5,2.672480002912566e-8,0.0012589081308858302,-2.2216070066749486e-5,2.6834805998698666e-8,0.001259178401966701,-2.2397001174915816e-5,2.6945651229235044e-8,0.0012595395662738137,-2.2527436600423014e-5,2.7023591961309044e-8,0.0012599565073977735,-2.2567114697326255e-5,2.704368259177285e-8,0.0012603800277351954,-2.249955563699239e-5,2.6996141762203254e-8,0.0012607598300570521,-2.2335587057110256e-5,2.6888416016816608e-8,0.0012610573544834757,-2.2109330675960614e-5,2.674249136516303e-8,0.0012612547690560867,-2.186800615213288e-5,2.6588343449294578e-8,0.0012613575758832708,-2.1658922356915117e-5,2.6455686208838244e-8,0.001261390591051946,-2.151793017938794e-5,2.6366737636690552e-8,0.00126138947197204,-2.146269522919313e-5,2.6332111564846554e-8,0.001261391218294045,-2.1491868003257122e-5,2.635046486548411e-8,0.0012614266428808319,-2.15888902989852e-5,2.641103229929555e-8,0.0012615162216082754,-2.1727952954471072e-5,2.6497431575663864e-8,0.0012616690635331466,-2.187983048108349e-5,2.6591299115901463e-8,0.0012618838439774989,-2.2016383972793845e-5,2.6675035116793972e-8,0.0012621505235054361,-2.2113585277586392e-5,2.6733624171416905e-8,0.0012624521180612978,-2.2153524616584108e-5,2.6755867859438524e-8,0.00126276632102878,-2.2126043067001626e-5,2.6735440962205498e-8,0.0012630672801498218,-2.2030481309721585e-5,2.6672051476437688e-8,0.0012633282001385453,-2.1877576094169603e-5,2.6572675677080794e-8,0.0012635254927225803,-2.1690821374928485e-5,2.6452399559931268e-8,0.0012636447200479173,-2.150581193844573e-5,2.6333924961939377e-8,0.0012636873694712005,-2.1365630790647973e-5,2.62445471842398e-8,0.001263675689203714,-2.1311092535360135e-5,2.6209908895091034e-8,0.001263651583389443,-2.1367352542053175e-5,2.624553285893486e-8,0.0012636669236140193,-2.1532112858698217e-5,2.6349454998586358e-8,0.0012637672086514252,-2.1772261625864342e-5,2.6500247615930587e-8,0.0012639754671761418,-2.2032532614826404e-5,2.666264158225693e-8,0.001264284192241647,-2.2253087100624153e-5,2.679874434506354e-8,0.0012646586664950854,-2.238799657886381e-5,2.687976398338216e-8,0.001265048952007261,-2.2417146448438736e-5,2.68935001124463e-8,0.0012654046375396352,-2.2348637976309602e-5,2.6845743928639548e-8,0.001265687166465729,-2.2213199967963506e-5,2.6756558234120423e-8,0.0012658770847539854,-2.205411237295862e-5,2.6653709859809845e-8,0.0012659757694239995,-2.1916095275190147e-5,2.6565519875628988e-8,0.0012660024992930466,-2.1835733466883678e-5,2.6514812194613012e-8,0.0012659883363219941,-2.183504682483079e-5,2.6514975770749016e-8,0.001265968564043513,-2.1918984668542527e-5,2.656857289282304e-8,0.0012659755016867593,-2.2076758125450218e-5,2.666835322071545e-8,0.0012660331867845541,-2.2286013655878877e-5,2.6799978389807436e-8,0.0012661546447266811,-2.2518299270481508e-5,2.6945459630868268e-8,0.0012663416011667139,-2.2744366594706175e-5,2.708642168120064e-8,0.0012665859156780787,-2.2938374403736194e-5,2.720666230998871e-8,0.0012668718340026004,-2.308069895407578e-5,2.729387607334129e-8,0.0012671783608418628,-2.315961813842999e-5,2.7340731279403066e-8,0.0012674815022603028,-2.3172399530941718e-5,2.734561490457562e-8,0.0012677565540440863,-2.3126206424985553e-5,2.7313258391016998e-8,0.0012679809078356128,-2.3038880813856224e-5,2.7255232108115096e-8,0.0012681379667225815,-2.293909764723427e-5,2.718996925380211e-8,0.001268222410981478,-2.2864607647463806e-5,2.714153350665855e-8,0.0012682458991817589,-2.285674137919671e-5,2.7136033101520892e-8,0.0012682404442877298,-2.294997743206441e-5,2.7194986348181077e-8,0.0012682552261359058,-2.3158135615329883e-5,2.732665258099185e-8,0.0012683438357439264,-2.3463184370203866e-5,2.751908579692521e-8,0.0012685445912806244,-2.381508922712379e-5,2.774017528295886e-8,0.0012688635218484556,-2.4146813037913072e-5,2.794723304902699e-8,0.0012692705636366676,-2.439852622614259e-5,2.8102383947438925e-8,0.0012697114811386142,-2.453808374801821e-5,2.818558432617654e-8,0.0012701278926337827,-2.456798692026666e-5,2.8199025785485304E-08,0.0012704747097447653,-2.451874191640579e-5,2.8162796580241977e-8,0.0012707290511519327,-2.4435369716645258e-5,2.8106093111468987e-8,0.00127089082105009,-2.4363968771578763e-5,2.8058468845464867e-8,0.0012709780445711418,-2.4341966719446985e-5,2.804354865594735e-8,0.0012710200656264432,-2.439279816146933e-5,2.8075722588673664e-8,0.001271050641705294,-2.4524258495752033e-5,2.8159296031538897e-8,0.0012711018882705825,-2.4729497552478398e-5,2.8289339641440367e-8,0.0012711994916664129,-2.4989923105568873e-5,2.8453680377103202e-8,0.0012713595362361608,-2.5279401250563086e-5,2.863560229913506e-8,0.0012715871496310693,-2.5568988582094783e-5,2.8816787886148046e-8,0.0012718768697763392,-2.5831442116825033e-5,2.898007870930307e-8,0.0012722144010838205,-2.6044933071783422e-5,2.911175618979125e-8,0.0012725792455093397,-2.619559555621507e-5,2.9203144635270495e-8,0.001272947626786604,-2.627888618297095e-5,2.9251514544716158e-8,0.0012732953571026233,-2.630006763486035e-5,2.9260441855358742e-8,0.0012736006475878774,-2.6274127894061375e-5,2.9239767557704245e-8,0.0012738470763975945,-2.6225193166156763e-5,2.9205161411702542e-8,0.0012740270157430664,-2.6185124088254545e-5,2.9177104177386633e-8,0.0012741455908807501,-2.6190414429344983e-5,2.9178785414269988e-8,0.001274224316427514,-2.62760887589678e-5,2.9232165679184445e-8,0.0012743020615554482,-2.646586880061536e-5,2.935178899471236e-8,0.001274429803943883,-2.6760187731966526e-5,2.9537333686976303e-8,0.0012746566213436674,-2.712756647179489e-5,2.976831346906732e-8,0.0012750096385508432,-2.7507546288788524e-5,3.0006033761210905e-8,0.0012754781610912526,-2.7829406560484464e-5,3.020548189174035e-8,0.001276013858158292,-2.8039650417442057e-5,3.033279425528792e-8,0.0012765492750488386,-2.812244159011328e-5,3.0378310890776146e-8,0.001277023642649741,-2.810137217333263e-5,3.035772861075833e-8,0.0012774012466509133,-2.802473521408781e-5,3.0302589247883327e-8,0.0012776758745853178,-2.7945890596938154e-5,3.024749497268067e-8,0.0012778647758220772,-2.79085430819153e-5,3.022048134829472e-8,0.001277998800793535,-2.793980262467159e-5,3.0238533240266736e-8,0.0012781132813501053,-2.804931557698271e-5,3.0307171318946226e-8,0.0012782413834105137,-2.8231718287190717e-5,3.042226138414893e-8,0.0012784098972853835,-2.8470294804898002e-5,3.0572571320992245e-8,0.0012786367518833218,-2.8740849073584766e-5,3.074235593251752e-8,0.0012789297433653374,-2.9015619036969142e-5,3.091384476109464e-8,0.0012792863683563302,-2.9267159831319898e-5,3.10696300382083e-8,0.0012796947422641365,-2.9471974501639326e-5,3.119488465856777e-8,0.0012801355484260517,-2.9613619515355336e-5,3.127929159311357e-8,0.0012805848824221722,-2.9684936207415627e-5,3.131847898599492e-8,0.001281017638662968,-2.968910490383866e-5,3.131473845451968e-8,0.0012814109964758992,-2.963950002011583e-5,3.1276957457645865e-8,0.0012817477332364437,-2.9558493616968298e-5,3.1219814796159154e-8,0.0012820192456920046,-2.9475284638605605e-5,3.116227933862801e-8,0.001282228197848576,-2.9422701983244574e-5,3.1125420021043346e-8,0.001282390606699797,-2.943268070189973e-5,3.112941115271035e-8,0.0012825366317504978,-2.9529907636028162e-5,3.118948519163852e-8,0.0012827084194776662,-2.9723676059624966e-5,3.131088059813362e-8,0.0012829528288665348,-2.9999700516418604e-5,3.1483844908667825e-8,0.0012833079130263225,-3.0316201547194518e-5,3.168132285335997e-8,0.0012837859765342673,-3.061020073146328e-5,3.1863018658290956e-8,0.0012843618450062628,-3.081684226297564e-5,3.198765635324121e-8,0.0012849765874220782,-3.089521995994752e-5,3.20294184946202e-8,0.0012855586318208988,-3.084588285428632e-5,3.1989175468429604e-8,0.0012860510837547415,-3.0708540178211655e-5,3.189304549666774e-8,0.001286429391721135,-3.054259065273131e-5,3.1779790208841204e-8,0.0012867022080911398,-3.0404062537684042e-5,3.1685762437681995e-8,0.001286900377279203,-3.0330777585708804e-5,3.163518182633183e-8,0.001287063300987379,-3.0338387143386424e-5,3.163759774986754e-8,0.001287228565364857,-3.042354922701865e-5,3.1690131287687944e-8,0.0012874261434639106,-3.056970632894269e-5,3.1781451277475414e-8,0.0012876761011276928,-3.075264889043229e-5,3.189554315979008e-8,0.001287988197340863,-3.094489886686548e-5,3.201458498978887e-8,0.0012883622633117567,-3.111913753711612e-5,3.2121090216733314e-8,0.0012887890246263095,-3.125116421789353e-5,3.219969606469643e-8,0.0012892514436496775,-3.1322610080414284e-5,3.223881626240157e-8,0.0012897267572810904,-3.132337450102907e-5,3.223217751474067e-8,0.0012901893827250341,-3.125348366035541e-5,3.2180042784654345e-8,0.0012906146194111945,-3.1123848609875844e-5,3.208974051574626e-8,0.0012909826969805158,-3.0955505293186115e-5,3.197517438868874e-8,0.0012912825565626971,-3.0777215881050795e-5,3.185520292845642e-8,0.0012915147687625943,-3.0621540642874033e-5,3.175097395022615e-8,0.001291693035842951,-3.0519716537336427E-05,3.168249183610786e-8,0.0012918438362249742,-3.0495841413462402e-5,3.1664819795655e-8,0.0012920037928547566,-3.056087693364674e-5,3.1704304670211076e-8,0.0012922141715474165,-3.0707282053063105e-5,3.17953364867465e-8,0.001292512034520009,-3.090599709338316e-5,3.1918661500173786e-8,0.0012929187002381516,-3.110850773894603e-5,3.2042880122178096e-8,0.0012934285950733568,-3.1256693423193994e-5,3.213078673276235e-8,0.0012940044453168913,-3.1300498297250774e-5,3.215061328521406e-8,0.001294584877820033,-3.12176444133966e-5,3.20885883560331e-8,0.001295104589766634,-3.102462475607171e-5,3.195596529494129e-8,0.0012955179603695564,-3.077085167751126e-5,3.178521309227125e-8,0.0012958131840410975,-3.0518540566581096e-5,3.1616916955709714e-8,0.0012960105999187787,-3.032026641965267e-5,3.148511085415194e-8,0.0012961495978159076,-3.0205433323736027e-5,3.140845109678617e-8,0.0012962734470908504,-3.0178565979806494e-5,3.1389212768773746e-8,0.0012964186126221632,-3.022527856628844e-5,3.141738252834504e-8,0.0012966099467786687,-3.032037295760454e-5,3.1476126820308665e-8,0.0012968600751613467,-3.043465498738407e-5,3.154631955101938e-8,0.0012971707339509185,-3.0539529403013107e-5,3.160949484610287e-8,0.0012975345391934867,-3.0609886172662965e-5,3.164960498486348e-8,0.0012979366525891216,-3.062613758462698e-5,3.1654217987039235e-8,0.0012983564533401342,-3.057599296156603e-5,3.1615600298714555e-8,0.0012987695840761062,-3.0456167864014533e-5,3.1531828857941956e-8,0.0012991507884455799,-3.027379091331488e-5,3.140775068646107e-8,0.0012994777236449333,-3.004683999448522e-5,3.125530194558217e-8,0.0012997353921117309,-2.9802813505353085e-5,3.1092622133109445e-8,0.0012999202861004046,-2.9575139003558806e-5,3.09416264273142e-8,0.0013000430270444395,-2.93974130243819e-5,3.0824133092212875e-8,0.001300128331498118,-2.9296350396882437e-5,3.075718715872455e-8,0.0013002116679433546,-2.928500804947685e-5,3.074866956412388e-8,0.0013003328193243616,-2.935801434543197e-5,3.0794343521651624e-8,0.001300527308605543,-2.9490231267340253e-5,3.0877225135393917e-8,0.0013008171756119307,-2.9639869058835446e-5,3.0969838317194383e-8,0.0013012031591031939,-2.9756515314625574e-5,3.10395465251122e-8,0.0013016609455879465,-2.9793446563434323e-5,3.105650235031395e-8,0.0013021442562541905,-2.972172931898944e-5,3.100263591424007e-8,0.0013025961177511457,-2.9541337275106654e-5,3.087867894617946e-8,0.0013029660006317406,-2.9283509335878423e-5,3.0705543544897195e-8,0.0013032261586196996,-2.9001308736517474e-5,3.051808034793436e-8,0.0013033793833759004,-2.875164122635431e-5,3.035331118242153e-8,0.0013034547749617115,-2.8577237008618275e-5,3.023868954419752e-8,0.0013034950005774671,-2.8496554952853205e-5,3.018561791167246e-8,0.0013035422626375217,-2.8503927091162528e-5,3.018972942257647e-8,0.0013036286487182313,-2.8576659673191224e-5,3.023572044825167e-8,0.0013037723920898197,-2.8683998777921855e-5,3.0303320007544866e-8,0.0013039784710675347,-2.8794434907111588e-5,3.037204952208462e-8,0.0013042411712836108,-2.8880283437659195e-5,3.042410362765577e-8,0.0013045469059940415,-2.8920083977942182e-5,3.044577741719525e-8,0.0013048765892900785,-2.8899827777303695e-5,3.042817208710491e-8,0.0013052076096280716,-2.8813836177220682e-5,3.0367751697282956e-8,0.0013055158699504063,-2.8665686201342626e-5,3.026699500311816e-8,0.0013057784723598796,-2.8469027833693583e-5,3.0134989400730604e-8,0.0013059774012722158,-2.824758312302742e-5,2.998744624708401e-8,0.0013061039917527009,-2.803329661145913e-5,2.984543622349855e-8,0.0013061631500154798,-2.786174715368294e-5,2.973227959525612e-8,0.0013061755169066931,-2.7764752904717206e-5,2.966860348764004e-8,0.0013061756394885842,-2.7761595595907e-5,2.9666567318660748e-8,0.0013062052931786697,-2.785175086959786e-5,2.972518749832201e-8,0.001306303142538855,-2.801230059159129e-5,2.9828826603746476e-8,0.0013064938194895942,-2.820182285028999e-5,2.9949955265754234e-8,0.001306780086361943,-2.8370168467178228e-5,3.005571106771042e-8,0.0013071407644421912,-2.8471378373462444e-5,3.0116392578181026e-8,0.0013075352201250116,-2.8475996159682643e-5,3.011342304590286e-8,0.001307913334487316,-2.8379292346448963e-5,3.0044539506056616e-8,0.0013082284553436203,-2.820295608258615e-5,2.992467194139616e-8,0.001308449795111905,-2.798934380814309e-5,2.9781980996995586e-8,0.0013085703641908598,-2.7789555942438875e-5,2.9649940584985727e-8,0.0013086075992558702,-2.7649081856834136e-5,2.9557946510256037e-8,0.0013085965713823258,-2.7596068441511594e-5,2.9523765739778143e-8,0.001308578775603071,-2.763613069992761e-5,2.9550353019012925e-8,0.0013085910545795772,-2.7754483402330733e-5,2.9627464816654964e-8,0.0013086582864577261,-2.7923038311927625e-5,2.973644409629548e-8,0.00130879097813508,-2.810881146934206e-5,2.985573633256056e-8,0.0013089866559391336,-2.8280794299983097e-5,2.9965288371083946e-8,0.0013092330853364449,-2.841421177594859e-5,3.004918959647898e-8,0.0013095117218239086,-2.849249915857971e-5,3.00968495932514e-8,0.0013098006051115334,-2.8507901829533638e-5,3.010335322333937e-8,0.0013100766331532816,-2.8461574612671678e-5,3.006956699423517e-8,0.00131031764281404,-2.8363692896845595e-5,3.0002285569679514e-8,0.0013105049028917662,-2.823351948220192e-5,2.991431821194102e-8,0.0013106264457913824,-2.809877946612421e-5,2.9824048280105456e-8,0.001310681133427025,-2.7993271777071674e-5,2.9753766780009736e-8,0.0013106824426351005,-2.795161269268233e-5,2.972610709291234e-8,0.0013106598420135267,-2.8000824017845768e-5,2.975846481850516e-8,0.001310655166280242,-2.8150479328616627e-5,2.9856575254154354e-8,0.0013107127876955784,-2.8385509043680695e-5,3.000993471753322e-8,0.0013108657814568222,-2.866643869990418e-5,3.0192141079751784e-8,0.0013111236756196114,-2.8939129152693387e-5,3.036744088323199e-8,0.0013114677764056418,-2.915104009753794e-5,3.0501486920959236e-8,0.001311856492484787,-2.9267251923133067e-5,3.0571854184595145e-8,0.001312238049311916,-2.9279859822208612e-5,3.057411525864111e-8,0.0013125651169096678,-2.9208198159179714e-5,3.0521802359526976e-8,0.0013128064021552001,-2.909142250826646e-5,3.044129361786551e-8,0.0013129525886068233,-2.897698933927629e-5,3.0364030849243177e-8,0.001313016206816826,-2.890865807546817e-5,3.031854722956662e-8,0.001313026461668143,-2.8916887043806896e-5,3.0324238748257375e-8,0.0013130209243820167,-2.901349026915853e-5,3.0388075426164644e-8,0.0013130364508609068,-2.91912467162573e-5,3.050460897562148e-8,0.0013131016267059507,-2.9427863667728573e-5,3.0658773423636455e-8,0.00131323234339437,-2.9692576163541312e-5,3.0830280966021656e-8,0.0013134309224520154,-2.9953194080713292e-5,3.099817761610996e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json
new file mode 100644
index 0000000..e8e2db5
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":14000,"numberOfSamples":1000,"samples":[0.0013136880538731968,-3.0181825300251084e-5,3.1144455018197914e-8,0.0013139862307697747,-3.0358458604268804e-5,3.125626468859012e-8,0.0013143034381558063,-3.0472498704118995e-5,3.1326857923882795e-8,0.001314616342296335,-3.0522889122674205e-5,3.135568412117831e-8,0.0013149028238326915,-3.051757614543907e-5,3.134810730752583e-8,0.0013151441476950397,-3.0472812693602606e-5,3.1315005489895234e-8,0.001315327245423572,-3.041233669157899e-5,3.127221966442859e-8,0.0013154474985632677,-3.0365940022199845e-5,3.1239522569258994e-8,0.0013155119761371786,-3.0366482616605727e-5,3.123852579233063e-8,0.0013155421786821661,-3.044428590458291e-5,3.1288903751562086e-8,0.0013155741637083083,-3.061859253490029e-5,3.140279579367739e-8,0.0013156532826805987,-3.08878545724263e-5,3.15785553459714e-8,0.0013158221093964287,-3.122350814634265e-5,3.179684474210843e-8,0.0013161043666861684,-3.1573152017452694e-5,3.202287220092828e-8,0.001316492562279381,-3.187552478285449e-5,3.221630534507893e-8,0.0013169475071545026,-3.2081986318948946e-5,3.234541530079332e-8,0.0013174114482328236,-3.217362581767834e-5,3.2398333198900105e-8,0.0013178279759007432,-3.216549962188907e-5,3.238578137269618e-8,0.0013181587209702065,-3.209786877058771e-5,3.233512178519737e-8,0.0013183908584672483,-3.202101456924127e-5,3.2280078366949867e-8,0.0013185355723118594,-3.198087692229784e-5,3.22510415181099e-8,0.0013186210256550192,-3.200948903377424e-5,3.226871171627078e-8,0.001318683516304464,-3.212087078817048e-5,3.2341550899422565e-8,0.0013187592325329092,-3.2311333689063695e-5,3.246626921888799e-8,0.0013188777975085585,-3.256278527721231e-5,3.263027897225073e-8,0.0013190580943835157,-3.28478210560236e-5,3.281520552707126e-8,0.001319306537685271,-3.3135522599053245e-5,3.30007052286256e-8,0.0013196176305973269,-3.339691167788335e-5,3.3167938459672674e-8,0.0013199762931723731,-3.360923943949643e-5,3.330224076991175e-8,0.001320361240591444,-3.3758679883073964e-5,3.339478932604852e-8,0.0013207486407314094,-3.3841371491741154e-5,3.3443266039948134e-8,0.0013211154170834028,-3.3863122696377714e-5,3.345170814905867e-8,0.0013214419486963593,-3.3838325595684376e-5,3.342984862739796e-8,0.0013217143059939618,-3.3788485178276064e-5,3.3392152957732015e-8,0.0013219262892678202,-3.374042925569602e-5,3.3356565064026065e-8,0.0013220814837101608,-3.37239298755937e-5,3.334280561542386e-8,0.0013221952658236343,-3.3768093745891034e-5,3.336987271475884e-8,0.0013222959339579021,-3.389572813238187e-5,3.345230413051685e-8,0.0013224231012386285,-3.411559264521433e-5,3.359518483099222e-8,0.001322620987373266,-3.44143314836092e-5,3.378904291433436e-8,0.0013229254974994617,-3.47525377055976e-5,3.4007455453146385e-8,0.0013233481259613213,-3.507078420316715e-5,3.421110391244622e-8,0.0013238651644779758,-3.5307915680853196e-5,3.435980179531848e-8,0.0013244214578083684,-3.5424988893193025e-5,3.4428250117923195e-8,0.0013249498096669955,-3.5421322382391885e-5,3.441665080515855e-8,0.0013253957656545127,-3.533284530570563e-5,3.4349593606930406e-8,0.0013257341054285624,-3.521518782185486e-5,3.4264687362774436e-8,0.0013259708733802966,-3.5122901891955616e-5,3.4198504380576074e-8,0.0013261345823387194,-3.509485421874728e-5,3.4176685340857736e-8,0.0013262639590043055,-3.514877227589115e-5,3.421034115508173e-8,0.0013263974759466818,-3.5282692478288204e-5,3.42972534612874e-8,0.0013265664975942637,-3.547980948220061e-5,3.4425417060696266e-8,0.00132679174008558,-3.5714173837029465e-5,3.457707337361339e-8,0.0013270820868991236,-3.595606011854193e-5,3.473236215303623e-8,0.0013274350277215283,-3.617667618018595e-5,3.487237396855363e-8,0.0013278383205704806,-3.6352045676457e-5,3.4981566469251094e-8,0.0013282725585155749,-3.6465885830951754e-5,3.504952018493835e-8,0.0013287143399232126,-3.651136884131447e-5,3.507202780552796e-8,0.001329139723468503,-3.649166207236073e-5,3.5051459488144146e-8,0.0013295275370495275,-3.6419245769639135e-5,3.499636143139478e-8,0.0013298621741601225,-3.631427873602864e-5,3.492040029054349e-8,0.0013301357987788196,-3.620233676919433e-5,3.484081953074903e-8,0.0013303500182077856,-3.6111625895291846e-5,3.4776475543805855e-8,0.0013305170072328,-3.606960581815073e-5,3.4745462642883064e-8,0.0013306599051258836,-3.609882203418703e-5,3.4762278550856455e-8,0.0013308118536023116,-3.621166286686944e-5,3.483441417239421e-8,0.0013310123518564367,-3.64043217054422e-5,3.495855682409469e-8,0.0013312994223816388,-3.6651762152887505e-5,3.511751481890027e-8,0.0013316973518746693,-3.6907391838432765e-5,3.528018149292224e-8,0.0013322032136629622,-3.711186898684884e-5,3.540737536800615e-8,0.0013327798493111566,-3.721219549322923e-5,3.546437127639159e-8,0.0013333634934342639,-3.718420813249119e-5,3.543571757580381e-8,0.001333886255019829,-3.70450465515009e-5,3.53335093009964e-8,0.0013343019613464686,-3.6846215847581066e-5,3.5192757078025216e-8,0.001334600413137058,-3.6651362298198277e-5,3.505642654975122e-8,0.0013348042208097524,-3.6512872822752915e-5,3.495958564720737e-8,0.0013349544109773996,-3.6458841744971036e-5,3.49205708479965e-8,0.0013350949386154267,-3.649215529746224e-5,3.49404840851344e-8,0.0013352621732775469,-3.659679818886342e-5,3.500770195061645e-8,0.001335480179315456,-3.6746003522191745e-5,3.510363508802379e-8,0.0013357600358690303,-3.6909212409168185e-5,3.520756323936493e-8,0.0013361011544938224,-3.705705068984642e-5,3.52999605336332e-8,0.00133649332519081,-3.7164741980348925e-5,3.536463540591373e-8,0.0013369190829818159,-3.7214510810799346e-5,3.539015342857483e-8,0.0013373563443612583,-3.719721204638616e-5,3.537079341232845e-8,0.0013377813051418917,-3.711323131523201e-5,3.530711046883947e-8,0.0013381715937814552,-3.697254005026054e-5,3.520601101140213e-8,0.0013385094912165925,-3.6793660324817705e-5,3.5080116340020854e-8,0.0013387847813319696,-3.660147627572446e-5,3.494630461274569e-8,0.0013389968351418553,-3.642410292771776e-5,3.482354178926302e-8,0.0013391557003256266,-3.628905404552198e-5,3.473019081800264e-8,0.0013392819820180002,-3.621893946658274e-5,3.468102678374732e-8,0.0013394052631200586,-3.622700347066692e-5,3.468425016446891e-8,0.0013395607383982387,-3.631286700900988e-5,3.473878515860904e-8,0.0013397835600754613,-3.645915330073845e-5,3.483228424044899e-8,0.0013401005623555385,-3.663056453013473e-5,3.494077405219707e-8,0.0013405202232471124,-3.6777887727110934e-5,3.5031461893425745e-8,0.0013410241084409612,-3.684910446392256e-5,3.5070089714356354e-8,0.0013415655317836142,-3.68068037108336e-5,3.503236888286036e-8,0.0013420805713068025,-3.664539114072159e-5,3.491530557749418e-8,0.0013425100358751974,-3.6397470548011556e-5,3.47413920987351e-8,0.00134282186684753,-3.6122771266874264e-5,3.455114282299104e-8,0.0013430210440999052,-3.5884585735838275e-5,3.438718523558038e-8,0.0013431424937006674,-3.5727401868071906e-5,3.427912167202074e-8,0.00134323392387406,-3.5666709476200635e-5,3.423668442759081e-8,0.0013433393957544833,-3.569188452387105e-5,3.425186840423222e-8,0.0013434898472930886,-3.577592172660759e-5,3.430576805004325e-8,0.0013437006458960645,-3.588557734935549e-5,3.4375631883152696e-8,0.0013439733632099559,-3.598872432152733e-5,3.443987682266083e-8,0.0013442990272794215,-3.6058572131738544e-5,3.448082578605249e-8,0.0013446613049089872,-3.6075754726357985e-5,3.44859220020242e-8,0.001345039248616876,-3.6029368037547205e-5,3.444825503332818e-8,0.0013454098213895693,-3.591751673460431e-5,3.436684759254604e-8,0.0013457504724702282,-3.57474829484819e-5,3.424678910825797e-8,0.0013460419605556845,-3.5535332633184876e-5,3.409904369034362e-8,0.0013462713941414768,-3.530453678562293e-5,3.3939575913952353e-8,0.0013464350440412546,-3.5083247688415916e-5,3.3787496601098456e-8,0.001346540218956281,-3.490026072080504e-5,3.366224387151234e-8,0.0013466055506973335,-3.478008498355249e-5,3.358013732940204e-8,0.001346659241019408,-3.4737853074248655e-5,3.355088149022233e-8,0.0013467351263881956,-3.477505002897689e-5,3.3574748237485566e-8,0.0013468668157807983,-3.487707274585662e-5,3.36411293630354e-8,0.0013470805087412794,-3.501350818296307e-5,3.3728992049500143e-8,0.0013473874871725111,-3.5141989537112516e-5,3.3809694862078156e-8,0.0013477779846166242,-3.5216299066590065e-5,3.385250575241212e-8,0.0013482190793279586,-3.5198369687471605e-5,3.3832555330064887e-8,0.001348659613978359,-3.507162618165665e-5,3.3739577083562544e-8,0.001349043468490627,-3.485031268644354e-5,3.358395470384573e-8,0.001349327999366581,-3.4578485620740276e-5,3.3395893343763146e-8,0.0013494994616960665,-3.431622032059404e-5,3.321604676365601e-8,0.001349576900362316,-3.411840812110945e-5,3.3081186820720924e-8,0.0013496024923671088,-3.4016892922365775e-5,3.3012189592066463e-8,0.0013496246279193777,-3.401415154718749e-5,3.300992090644571e-8,0.0013496829179363164,-3.408870967312186e-5,3.305913434321514e-8,0.0013498005419856707,-3.420638364611618e-5,3.313629142245499e-8,0.001349983766265312,-3.433103577998142e-5,3.3216931742549514e-8,0.001350225503188383,-3.443167213616684e-5,3.328041116125517e-8,0.001350509870791549,-3.44857855079198e-5,3.3311987997451824e-8,0.001350816111848709,-3.44802776149318e-5,3.330325655153641e-8,0.0013511215354534733,-3.44113203272646e-5,3.325193674476666e-8,0.0013514038266242718,-3.428394324938091e-5,3.3161588903372553e-8,0.0013516432294084326,-3.41115562702498e-5,3.3041366067246576e-8,0.0013518249947347244,-3.391515061958602e-5,3.29055587983786e-8,0.0013519421489563276,-3.372159161237384e-5,3.277246672853169e-8,0.0013519981162253448,-3.35604192219653e-5,3.2662172488743894e-8,0.0013520082488663807,-3.345899609113347e-5,3.259313778399188e-8,0.0013519991491952143,-3.343655294053388e-5,3.257806735071459e-8,0.0013520049886915973,-3.349849264305731e-5,3.262004101630264e-8,0.0013520609158930905,-3.36328575909331e-5,3.2710241377374956e-8,0.0013521948074782938,-3.3810651240403614e-5,3.2828394204526694e-8,0.0013524194680195325,-3.399070247049815e-5,3.2946301667474426e-8,0.0013527275548078518,-3.412846985252045e-5,3.3033954284171145e-8,0.0013530910516223313,-3.41870260521444e-5,3.306696170857802e-8,0.0013534662186818406,-3.414758958099839e-5,3.303351712767489e-8,0.0013538036921596796,-3.401650121264336e-5,3.293885919569297e-8,0.0013540617630267778,-3.3825695437600704e-5,3.280532715743045e-8,0.0013542189655621978,-3.3625013396523797e-5,3.2666968653528377e-8,0.0013542809896239987,-3.3467679762926974e-5,3.255963827369867e-8,0.0013542783419837156,-3.3394020433318414e-5,3.251003853738814e-8,0.0013542554119995557,-3.342020697923614e-5,3.252828382153754e-8,0.0013542560140103023,-3.3536391035527796e-5,3.2606892142050424e-8,0.0013543116989025482,-3.371353007933651e-5,3.2725642792952345e-8,0.0013544365308802784,-3.391431273365121e-5,3.285910327271554e-8,0.0013546280975285543,-3.410316353858851e-5,3.2983383466057345e-8,0.0013548720539619643,-3.4252552907384106e-5,3.308026489902493e-8,0.001355147353668992,-3.43454908576762e-5,3.313870075252464e-8,0.0013554305468037433,-3.437553330264171e-5,3.315467676927687e-8,0.0013556988011802253,-3.434572357619407e-5,3.313045281129339e-8,0.0013559320038673691,-3.426735815892247e-5,3.30737806614842e-8,0.0013561145343338845,-3.415887769336406e-5,3.299724375590522e-8,0.0013562372346350193,-3.40446430953795e-5,3.291748056072256e-8,0.001356299729968249,-3.395293821719811e-5,3.285379960496967e-8,0.0013563126464800305,-3.39124616274109e-5,3.2825694374099335e-8,0.0013562986345168043,-3.394695718115785e-5,3.284908231937111e-8,0.0013562906901488832,-3.406854808973949e-5,3.2931730931658255e-8,0.0013563265580224901,-3.4271700357362895e-5,3.3069227097465745e-8,0.0013564394803830895,-3.453081024388408e-5,3.3243512234392763e-8,0.001356647830444362,-3.480395690125668e-5,3.342564568063368e-8,0.0013569477158602284,-3.504296952579012e-5,3.358281757335669e-8,0.0013573120584085639,-3.52068525793514e-5,3.368754392194241e-8,0.001357697050412798,-3.5273779767518736e-5,3.3725762172275216e-8,0.0013580538346326509,-3.524742322405932e-5,3.3700952947215904e-8,0.0013583414729187431,-3.515577457801083e-5,3.3633068996217375e-8,0.0013585373183607017,-3.504326814963739e-5,3.3552899090837633e-8,0.0013586421139425234,-3.4958781479045985e-5,3.3493719387707e-8,0.001358678685937704,-3.494290707046618e-5,3.3482624669021657e-8,0.001358684778336174,-3.501803608967189e-5,3.353396129882613e-8,0.001358702322909947,-3.518405715028354e-5,3.36466993389363e-8,0.0013587666406036992,-3.542061521536396e-5,3.380626499920978e-8,0.0013588989123856205,-3.5694495803273485e-5,3.398974496696862e-8,0.001359103663247866,-3.5969025766868755e-5,3.417229612867719e-8,0.0013593708567535968,-3.621226756590788e-5,3.4332592451649465e-8,0.0013596806793210175,-3.640207539916034e-5,3.4456072169122394e-8,0.0013600088338772479,-3.6527817297702786e-5,3.4535941490019846e-8,0.0013603309085686056,-3.6589745925869715e-5,3.4572666368770736e-8,0.0013606253906847028,-3.659727205627579e-5,3.4572817000381455e-8,0.0013608755966453268,-3.656705235731982e-5,3.45478428901892e-8,0.0013610710755603856,-3.652125748003627e-5,3.4512957394544435e-8,0.0013612090115036409,-3.648585481662091e-5,3.448596151433922e-8,0.0013612958461505,-3.648833256815448e-5,3.448560847301663e-8,0.0013613487825353768,-3.655412453139295e-5,3.452905427534737e-8,0.0013613960977975756,-3.6701245140876124e-5,3.4628141465119906e-8,0.0013614745650237811,-3.693358561190437e-5,3.4784884782548805e-8,0.0013616224205170902,-3.7235042204870165e-5,3.4987633233731027e-8,0.001361868091522445,-3.756832421090297e-5,3.521045772248526e-8,0.001362218255945228,-3.788197415238886e-5,3.541808383563176e-8,0.0013626514699812326,-3.812539193249165e-5,3.557619486093644e-8,0.001363122322234058,-3.8266165560665596e-5,3.566324383611881e-8,0.0013635754647547845,-3.830134386399334e-5,3.5678079037798024e-8,0.0013639630780626708,-3.825738313571894e-5,3.563975015298319e-8,0.001364258080357862,-3.817994201829989e-5,3.5580274568062977e-8,0.0013644589434662312,-3.811922202797349e-5,3.5534332460088205e-8,0.0013645865742663128,-3.81166924124298e-5,3.5530027944857735e-8,0.0013646762446455044,-3.819653354824757e-5,3.558310331044814e-8,0.001364767819829093,-3.8362605590993256e-5,3.569514079478911e-8,0.0013648967631197295,-3.8600238344742254e-5,3.585514627803409e-8,0.0013650874946786213,-3.888148752071901e-5,3.60434300221522e-8,0.0013653499642588421,-3.917227000116867e-5,3.62365942886353e-8,0.00136567964200512,-3.943967176457917e-5,3.6412451385441956e-8,0.0013660603709506384,-3.965784039600382e-5,3.65538578644758e-8,0.0013664688889499187,-3.981147629204727e-5,3.665089579529965e-8,0.0013668796761675812,-3.989679821734419e-5,3.6701401260529234e-8,0.0013672690955396569,-3.992052333462929e-5,3.6710241547116054e-8,0.0013676183253096337,-3.9897716306200194e-5,3.668789735721834e-8,0.0013679151464472477,-3.984932666566189e-5,3.664884493646582e-8,0.0013681550099158162,-3.979985343784534e-5,3.660997364210455e-8,0.0013683418187992174,-3.977508572660584e-5,3.658897704031485e-8,0.0013684886345164064,-3.9799531863791056e-5,3.6602481816290366e-8,0.0013686181140462686,-3.989297417404592e-5,3.6663608773571173e-8,0.0013687618136698219,-4.006569078124706e-5,3.677873040014451e-8,0.0013689567976789784,-4.031268759372785e-5,3.6943686509812775e-8,0.0013692379960220952,-4.0608958982055686e-5,3.714077674900414e-8,0.0013696263976024602,-4.0909688045915914e-5,3.733908018595111e-8,0.001370116858706226,-4.115943735403728e-5,3.7500783826076915e-8,0.0013706730192843547,-4.131030892561659e-5,3.759353716751259e-8,0.0013712357655380756,-4.1341651354543865e-5,3.760387092264407e-8,0.001371743681640421,-4.1269733274189294e-5,3.754378869036469e-8,0.0013721549303818486,-4.114093707006044e-5,3.744600118910848e-8,0.0013724590038156602,-4.1013018078885606e-5,3.7350822712677154e-8,0.0013726746583584263,-4.0935524588789915e-5,3.7292433498253575e-8,0.0013728388253621247,-4.093780361015353e-5,3.7290504667023286e-8,0.0013729936653109317,-4.102619609853645e-5,3.7348411588796894e-8,0.001373176359782013,-4.118762655376452e-5,3.745605098886693e-8,0.0013734130133102524,-4.139607981819826e-5,3.759467361926248e-8,0.0013737161837680623,-4.161950138762874e-5,3.7741869452387925e-8,0.0013740850229568907,-4.182594710895547e-5,3.787581954548767e-8,0.0013745072421834012,-4.198858396882682e-5,3.797857502949695e-8,0.0013749623837124778,-4.208926335925624e-5,3.803827857381001e-8,0.0013754258276343432,-4.2120407717748035e-5,3.8050265155743136e-8,0.001375872892622539,-4.2085198307853355e-5,3.801710263943968e-8,0.001376282469925798,-4.199628974034897e-5,3.7947728565110885e-8,0.0013766397572874227,-4.187345120748918e-5,3.7855899666402347e-8,0.0013769379150291574,-4.1740698791756187e-5,3.775826686919178e-8,0.0013771788132807986,-4.162339046388268e-5,3.76723488673647e-8,0.0013773731537905993,-4.154540420571933e-5,3.7614493141915814e-8,0.0013775401104706387,-4.1526264618012495e-5,3.759779228022895e-8,0.0013777064032593797,-4.157796597586423e-5,3.762987031680914e-8,0.001377904267471179,-4.170125910920436e-5,3.771044184184231e-8,0.0013781672206391812,-4.188175848661827e-5,3.78288749397831e-8,0.00137852256618738,-4.2087548328483725e-5,3.7962807628071696e-8,0.0013789809169083302,-4.2271422389212076e-5,3.807982991820045e-8,0.0013795260580142504,-4.238109909941585e-5,3.8144447194615674e-8,0.0013801120459359865,-4.237742637005507e-5,3.813041208095439e-8,0.0013806741263976,-4.225334424947585e-5,3.8033625865393774e-8,0.0013811520519300435,-4.2041187655938626e-5,3.787713159675286e-8,0.0013815136370865081,-4.180098864064637e-5,3.7703002181980215e-8,0.0013817644462791729,-4.159593522969593e-5,3.755522195444356e-8,0.0013819398040921613,-4.146995772891535e-5,3.7463973571636786e-8,0.0013820873195676013,-4.143814444971667e-5,3.74389528223684e-8,0.0013822508297504756,-4.1489856674521627e-5,3.747173694159376e-8,0.0013824612018183504,-4.159808318168086e-5,3.7542636676095634e-8,0.001382733677333939,-4.172918004101423e-5,3.76277743218216e-8,0.0013830692173663335,-4.185025959459586e-5,3.7704340994960595e-8,0.0013834575067367659,-4.193387127219509e-5,3.7753754368892116e-8,0.00138388030970731,-4.196070426809343e-5,3.776329962305264e-8,0.0013843148322871465,-4.1921028124019695e-5,3.7726878625517075e-8,0.0013847370777409624,-4.181512286564115e-5,3.7645150528966244e-8,0.0013851250900450299,-4.165273271465304e-5,3.752512539985943e-8,0.0013854619058602147,-4.145156074913463e-5,3.737919056711855e-8,0.0013857379458243554,-4.123483834305219e-5,3.722351350041851e-8,0.0013859525067954938,-4.1028195536964666e-5,3.707590164867331e-8,0.001386114186987945,-4.08562465832129e-5,3.6953376917189425e-8,0.0013862402914967716,-4.0739217947163935e-5,3.6869727504020365e-8,0.0013863552819137583,-4.068981038566365e-5,3.683325080139284e-8,0.0013864882812566375,-4.071045407698197e-5,3.684488191793497e-8,0.0013866695093654466,-4.0791084850707254e-5,3.689683217641563e-8,0.0013869252570760705,-4.0907845082072896e-5,3.6971967000828836e-8,0.0013872711358115565,-4.102392437415202e-5,3.7044638632372434e-8,0.0013877044103900269,-4.10944872644231e-5,3.708418444800822e-8,0.0013881982022425643,-4.107730918647336e-5,3.70621554354846e-8,0.0013887024507251455,-4.094823201885367e-5,3.696274535980045e-8,0.0013891560996636264,-4.071545369969397e-5,3.6792453536201996e-8,0.0013895088976246747,-4.042264374578624e-5,3.658214577314118e-8,0.0013897421255975183,-4.013475017712353e-5,3.637717862062872e-8,0.0013898751358086116,-3.99123909946508e-5,3.621955119697095e-8,0.0013899539157585976,-3.97898760399196e-5,3.613256495667892e-8,0.0013900305358917047,-3.976825529054825e-5,3.611605869920365e-8,0.0013901459897183817,-3.982280938552323e-5,3.615187595826213e-8,0.001390322583927315,-3.9916483926864295e-5,3.621354110721034e-8,0.0013905644815372748,-4.00116379826972e-5,3.627465691377648e-8,0.001390862196549241,-4.007719389834769e-5,3.6313891042696686e-8,0.0013911977272878053,-4.009168854677753e-5,3.631692015857626e-8,0.001391548803289706,-4.004388985804637e-5,3.627660019245447e-8,0.0013918921108757572,-3.9932383942914886e-5,3.619246897144912e-8,0.001392205925877442,-3.976474847087717e-5,3.607009012040189e-8,0.001392472481833256,-3.9556371616133894e-5,3.592027726302581e-8,0.0013926801795685095,-3.932876436594814e-5,3.5758025153182566e-8,0.0013928255206943443,-3.910712261197275e-5,3.5600891948591315e-8,0.0013929143574365078,-3.891704325009154e-5,3.546670424830646e-8,0.0013929619662561058,-3.878067864465175e-5,3.5370785800753655e-8,0.0013929916634681091,-3.8712865216251155e-5,3.5323145245009847e-8,0.0013930319212074739,-3.871783709874851e-5,3.532613964822986e-8,0.0013931121650108214,-3.878718027241075e-5,3.537313617747967e-8,0.0013932576761824852,-3.889956926863257e-5,3.544855030305457e-8,0.0013934841205019005,-3.902264562679513e-5,3.5529430896809445e-8,0.0013937923389470475,-3.911747336501126e-5,3.558876680690813e-8,0.0013941645951322254,-3.9146037401005566e-5,3.560072677257016e-8,0.0013945643433518572,-3.908149684330105e-5,3.554760976148454e-8,0.0013949419740809537,-3.8919080012482775e-5,3.54271205202408e-8,0.0013952477277678645,-3.868301987054237e-5,3.525691407233159e-8,0.001395448996586115,-3.842366805801884e-5,3.507242835859129e-8,0.0013955441184541493,-3.8202198743737096e-5,3.491619511363628e-8,0.001395563841894682,-3.806835542580855e-5,3.482237329132881e-8,0.0013955584098649994,-3.804297850225461e-5,3.4804676331452736e-8,0.0013955778157443777,-3.8114400232592614e-5,3.4854056156277526e-8,0.0013956561830292,-3.8248114880291454e-5,3.4945709067619815e-8,0.0013958061096767589,-3.840169374270801e-5,3.504970300817749e-8,0.001396021525706078,-3.853707477095065e-5,3.513962678304474e-8,0.0013962843041433993,-3.8627076516026636e-5,3.5197026880596114e-8,0.0013965707576988314,-3.865699570879773e-5,3.521229439063478e-8,0.0013968563725718281,-3.8623536025609064e-5,3.5183688298750485e-8,0.0013971187911648243,-3.8532907044979155e-5,3.511587978476073e-8,0.001397339741657006,-3.8398963032655006e-5,3.501866053362015e-8,0.0013975065707011172,-3.824149273866268e-5,3.490584928664414e-8,0.0013976137214529206,-3.808437691328442e-5,3.47941124837482e-8,0.0013976641337538325,-3.795316224892923e-5,3.470130668547223e-8,0.0013976701313359334,-3.787171824233571e-5,3.4644083108582145e-8,0.0013976530803277948,-3.785809777299285e-5,3.4634877223998395e-8,0.0013976411745630901,-3.792027581554576e-5,3.467883721971932e-8,0.0013976651171231898,-3.8052873706371765e-5,3.477154552196402e-8,0.001397752138213877,-3.8236151892252456e-5,3.489846164729002e-8,0.0013979195447783234,-3.8438219455829296e-5,3.5036710195449224e-8,0.0013981694399458889,-3.862056128580171e-5,3.515918741519236e-8,0.001398486147697437,-3.874608834560939e-5,3.524031957876636e-8,0.0013988374531938928,-3.878827062153085e-5,3.526239348503685e-8,0.001399180229735303,-3.873936055813441e-5,3.5221074317918304e-8,0.0013994701906148062,-3.861521125226919e-5,3.5128449985403174e-8,0.0013996740998213511,-3.845410205611195e-5,3.501191367250836e-8,0.0013997808979702491,-3.830798334251088e-5,3.490787420794603e-8,0.0013998068841861602,-3.822734029112152e-5,3.485117466616385e-8,0.0013997912690781416,-3.824484084870901e-5,3.486381492238321e-8,0.001399782875381604,-3.836511152067367e-5,3.494805808686753e-8,0.0013998239209614296,-3.856545057793629e-5,3.508720829151086e-8,0.0013999383452429608,-3.880618248898522e-5,3.5253069111989446e-8,0.001400128687982977,-3.9044513556967366e-5,3.5415721677933286e-8,0.0014003803140351105,-3.924559928935504e-5,3.555119946742358e-8,0.0014006688652410718,-3.938796884383357e-5,3.564509648433299e-8,0.0014009672459019793,-3.946401158692379e-5,3.569268613464028e-8,0.0014012504631784645,-3.9477773714654874e-5,3.5697219627372335e-8,0.0014014983378744935,-3.9442025791079544e-5,3.566783351875651e-8,0.0014016968485090753,-3.937562123845998e-5,3.561776933093947e-8,0.0014018389311078144,-3.930135009856592e-5,3.556297869454529e-8,0.0014019252611881805,-3.924395351028988e-5,3.552079791655267e-8,0.0014019650674987158,-3.922771502573723e-5,3.550823547292913e-8,0.0014019765254487317,-3.927316184126799e-5,3.5539561321083074e-8,0.0014019859072127623,-3.939286678870541e-5,3.562326047613582e-8,0.0014020245683540645,-3.9587049026522654e-5,3.57589225433063e-8,0.0014021232793080098,-3.984050350448809e-5,3.5935183683834784e-8,0.0014023045619820167,-4.0122876368864325e-5,3.613011664758931e-8,0.001402575188517273,-4.0393711578013267e-5,3.631499515737404e-8,0.0014029218430838034,-4.0611873294491905e-5,3.6461068646827724e-8,0.0014033123169753285,-4.074679499372091e-5,3.654749216388009e-8,0.0014037026283073234,-4.078780138232347e-5,3.6567752091281347e-8,0.0014040481592061073,-4.074819558912667e-5,3.653228462529379e-8,0.0014043154629272954,-4.0662606574106574e-5,3.646629348386904e-8,0.0014044912857379814,-4.057825582912705e-5,3.640333363998543e-8,0.001404586199481951,-4.054249152292174e-5,3.6376420565956945E-08,0.0014046315916832204,-4.059001163717845e-5,3.640913312668297e-8,0.0014046706036646942,-4.073363552405963e-5,3.650939734711049e-8,0.0014047457709805932,-4.096173679938644e-5,3.6668033280187714e-8,0.0014048875975041877,-4.1243138982900314e-5,3.686248986601918e-8,0.0014051079231287907,-4.153727189609017e-5,3.706412048229687e-8,0.0014053996891925462,-4.180543919169627e-5,3.724605723962737e-8,0.0014057418851642401,-4.201928520354164e-5,3.7388982979293707e-8,0.0014061067325829505,-4.216459310863377e-5,3.748357386154352e-8,0.0014064662792454632,-4.2240904034702006e-5,3.75300453375767e-8,0.001406796935332708,-4.225873123662221e-5,3.753610982343233e-8,0.0014070818711074016,-4.223609237701761e-5,3.7514565091294765e-8,0.0014073119283782146,-4.219538055815336e-5,3.748118402098386e-8,0.0014074858454996213,-4.216086923191445e-5,3.7453036902211475e-8,0.0014076103837110468,-4.215657537536124e-5,3.744699428145286e-8,0.001407700482867457,-4.2203893189522455e-5,3.7477990165415446e-8,0.0014077790394113716,-4.231848459825597e-5,3.755673767593618e-8,0.0014078754676845311,-4.250633958081457e-5,3.768691664581742e-8,0.0014080219967517041,-4.275967059593405e-5,3.7862358742113034e-8,0.0014082470158322466,-4.305438268393406e-5,3.8065444478173206e-8,0.0014085662107764442,-4.3351709842482535e-5,3.826846229183665e-8,0.0014089744868300872,-4.360598119993927e-5,3.843922404533621e-8,0.0014094431536157055,-4.377765422595991e-5,3.8550288702544655e-8,0.0014099256069116926,-4.384699363489847e-5,3.8588547143931624e-8,0.001410370621965012,-4.3822017616625005e-5,3.8560684416864574e-8,0.0014107379906385569,-4.373660777036701e-5,3.8491618344667396e-8,0.001411009964557524,-4.363969764258664e-5,3.841657689536917e-8,0.0014111946000197385,-4.3580512043394426e-5,3.8370420063415034e-8,0.0014113211867777273,-4.359545857298468e-5,3.837829828573306e-8,0.0014114306461733982,-4.3700232323209964e-5,3.8450239351540594e-8,0.001411564408632792,-4.388818610139138e-5,3.858035161105931e-8,0.0014117547305501578,-4.4134232812283986e-5,3.874997182226532e-8,0.0014120184750084578,-4.440248212920195e-5,3.8933324817321076e-8,0.0014123552829552618,-4.4655279826922307e-5,3.910396017989396e-8,0.0014127498958597165,-4.4861304314633954e-5,3.924032595412258e-8,0.0014131773611926266,-4.500092974261656e-5,3.932930729967511e-8,0.0014136092759243295,-4.5068124233728125e-5,3.9367328715653395e-8,0.001414019350464863,-4.50693223258045e-5,3.9359414083827914e-8,0.001414387280570928,-4.5020436860496765e-5,3.931705416718012e-8,0.0014147007530842784,-4.4943253683445574e-5,3.925572649703533e-8,0.0014149560140847756,-4.486209219785531e-5,3.919262101512192e-8,0.0014151576551419522,-4.4801074437002196e-5,3.914474595500056e-8,0.001415318136201093,-4.478183557739158e-5,3.912726793698288e-8,0.0014154572003696824,-4.482122856836196e-5,3.9151802563573214e-8,0.0014156009001108517,-4.492859041749618e-5,3.9224425325897754e-8,0.0014157795097893533,-4.5102449376290346e-5,3.93433918158505e-8,0.0014160233109937125,-4.532727500167816e-5,3.94970098303655e-8,0.0014163555567608258,-4.557201265798743e-5,3.96628298780135e-8,0.0014167833913719533,-4.579313198730899e-5,3.980996986060289e-8,0.0014172901012929602,-4.594441145983626e-5,3.990606550755613e-8,0.0014178341748209257,-4.599235373069634e-5,3.9928088314464635e-8,0.0014183591944381855,-4.593096157451421e-5,3.987268351609923e-8,0.0014188124373602864,-4.5787093578951006e-5,3.975984439233655e-8,0.001419163393834719,-4.561185313227637e-5,3.9626636645945325e-8,0.0014194126920989531,-4.5462152420401115e-5,3.951386849890556e-8,0.0014195882504336435,-4.5382171232237414e-5,3.945270542300551e-8,0.0014197329253106763,-4.539256577330823e-5,3.9456983564371725e-8,0.0014198906236090039,-4.548923231726588e-5,3.952257759491028e-8,0.001420095771986858,-4.5648857684138e-5,3.963175850856077e-8,0.0014203677362581296,-4.5837385340540104e-5,3.975959325884974e-8,0.0014207096597213865,-4.601850510949015e-5,3.988016811818957e-8,0.0014211104809135435,-4.616063637726872e-5,3.9971495331700885e-8,0.0014215489510336552,-4.624177480943514e-5,4.001871904464167e-8,0.0014219986351035052,-4.6251956591088596e-5,4.0015574979438314e-8,0.0014224329376801295,-4.619339291718908e-5,3.996426457805398e-8,0.001422829353219783,-4.607871301987465e-5,3.9874120697775513e-8,0.0014231724530763103,-4.592798447099774e-5,3.9759530620922137e-8,0.0014234554326269762,-4.57652124151591e-5,3.9637548056577846e-8,0.0014236803642659415,-4.561496504861187e-5,3.952556952558051e-8,0.0014238575838519927,-4.5499512314608026e-5,3.943929979142778e-8,0.0014240046262760098,-4.543644346492547e-5,3.9390987574810174e-8,0.0014241448474782898,-4.543650107068099e-5,3.938780661528568e-8,0.0014243055769598875,-4.55014025622324e-5,3.943030334635427e-8,0.0014245153230789524,-4.562160361393435e-5,3.951093333991738e-8,0.0014247992679477627,-4.5774516750711624e-5,3.9613026810845106e-8,0.0014251725776000539,-4.592471607435623e-5,3.97111673534239e-8,0.0014256324150758487,-4.6028499832087334e-5,3.9774539919194244e-8,0.0014261519278773282,-4.604466942670059e-5,3.97745103455597e-8,0.0014266816106519023,-4.595018557846401e-5,3.9695557904295956e-8,0.0014271621257017225,-4.575388705227969e-5,3.9544859389287236e-8,0.0014275457311608392,-4.549845458283125e-5,3.935358890200528e-8,0.001427815306107102,-4.524605002091276e-5,3.916657774531871e-8,0.0014279894860666584,-4.505443172790813e-5,3.9025101307670685e-8,0.001428111845943068,-4.4957151971777735e-5,3.895259664595886e-8,0.0014282324457039898,-4.4956997998443266e-5,3.8950037799349965e-8,0.0014283921152246375,-4.5031813061035744e-5,3.9000405529012745e-8,0.001428614503799861,-4.514594302658012e-5,3.907728510090153e-8,0.0014289052039444517,-4.526123102336767e-5,3.915303573565249e-8,0.0014292549887714064,-4.5344780633131716e-5,3.9204408290150735e-8,0.0014296445351593818,-4.537328317671618e-5,3.921546485399938e-8,0.0014300491927835234,-4.533479827914965e-5,3.917854634066426e-8,0.0014304433224275918,-4.522881772940035e-5,3.909403114722347e-8,0.001430804033341362,-4.5065037434135e-5,3.896929881664266e-8,0.001431114134170649,-4.486114602985143e-5,3.8817147411994384e-8,0.001431364173594574,-4.463995090524377e-5,3.8653843304944497e-8,0.001431553477665542,-4.4426110315797016e-5,3.8496905092415785e-8,0.0014316900992935974,-4.4242818950062476e-5,3.8362786478080485e-8,0.0014317897941557708,-4.410886020323244e-5,3.8264727869013804e-8,0.0014318743099349634,-4.403620954390451e-5,3.8210949087253464e-8,0.0014319691565770345,-4.402814004867514e-5,3.8203232744223565e-8,0.0014321008288139233,-4.407781633250867e-5,3.823596615193787e-8,0.0014322933132242908,-4.4167493057523215e-5,3.829575167824442e-8,0.0014325635783059797,-4.426874231918825e-5,3.8361828243839776e-8,0.0014329159984174987,-4.4344806916418694e-5,3.8407962919808685e-8,0.0014333367610415697,-4.435666435111393e-5,3.840682171688473e-8,0.0014337910720800594,-4.4273697098380086e-5,3.833742616530986e-8,0.0014342273731959762,-4.408716016137151e-5,3.819450047412489e-8,0.0014345914434781843,-4.382020957560829e-5,3.79954130449742e-8,0.0014348470970175808,-4.352582193219588e-5,3.7778581483576264e-8,0.0014349925697684392,-4.326902649537983e-5,3.759070188014273e-8,0.0014350613489107376,-4.3101343714786775e-5,3.746837044387351e-8,0.0014351064354383872,-4.304237393549526e-5,3.74248666578265e-8,0.0014351786308693037,-4.3077895175319485e-5,3.744893988723652e-8,0.001435311120145527,-4.3171511316731736e-5,3.751349253798805e-8,0.001435514983638263,-4.3280124103506245e-5,3.7587031889058094e-8,0.0014357827442222175,-4.33657644870084e-5,3.764234602726513e-8,0.0014360950176135047,-4.340168328161423e-5,3.766080981694061e-8,0.0014364268982985113,-4.3373918763642415e-5,3.7633249662091946e-8,0.0014367527843651797,-4.328039694830718e-5,3.755898187846603e-8,0.0014370497401466067,-4.312909776010434e-5,3.7444270646673757e-8,0.0014372999251545048,-4.29358844997081e-5,3.730070931627148e-8,0.0014374923724849156,-4.2722063680720855e-5,3.71435536648068e-8,0.0014376241618117747,-4.251167408721932e-5,3.6989920136254e-8,0.0014377009262072043,-4.2328490779715396e-5,3.6856738666764285e-8,0.0014377364788064743,-4.2192837572660376e-5,3.675846863045126e-8,0.0014377513692969844,-4.2118585485798534e-5,3.6704856042820815e-8,0.001437770451447845,-4.2110786884528316e-5,3.669912913273134e-8,0.0014378196981251372,-4.21642244916051e-5,3.6736925449717485e-8,0.0014379224790505686,-4.226308798281828e-5,3.680616377621557e-8,0.0014380955334853483,-4.238200534606743e-5,3.6888012155040675e-8,0.0014383449114242503,-4.2488670304332985e-5,3.6959034935254815e-8,0.0014386623333420816,-4.254848883471872e-5,3.69946922542799e-8,0.001439023053413255,-4.253172746547254e-5,3.6974437223496824e-8,0.00143938722951177,-4.242284653717159e-5,3.688818009449981e-8,0.001439707137154768,-4.222971419566938e-5,3.674257304428873e-8,0.0014399409659193428,-4.198781671588203e-5,3.656376280190634e-8,0.001440069459918548,-4.1753765044836575e-5,3.6392606119182155e-8,0.001440106597622063,-4.158679104094984e-5,3.6271381464065536e-8,0.0014400959148385573,-4.1525832600832144e-5,3.622739349459521e-8,0.0014400927711180566,-4.15752438414865e-5,3.626283531393904e-8,0.0014401429180055368,-4.170699406909172e-5,3.635659541946491e-8,0.0014402691460889587,-4.1875615871244114e-5,3.6475292110604114e-8,0.0014404700687453444,-4.20353985030447e-5,3.658586574851633e-8,0.0014407270427852904,-4.215187194132588e-5,3.666388371140973e-8,0.001441013130719309,-4.220595818615349e-5,3.6696359973947585e-8,0.0014413003263376396,-4.219308157288958e-5,3.6680826446642095e-8,0.001441564033217401,-4.212012924590863e-5,3.662287749152233e-8,0.0014417853809006085,-4.2002181831792545e-5,3.653368462176073e-8,0.0014419523959797523,-4.185969337729201e-5,3.642799751790315e-8,0.0014420606999227586,-4.171600435622608e-5,3.632248964966348e-8,0.0014421139198980406,-4.159487387718513e-5,3.623411674528073e-8,0.0014421237028206181,-4.151777055500738e-5,3.6178218018737015e-8,0.0014421089934266833,-4.150085444996026e-5,3.6166287820635e-8,0.0014420941576250958,-4.155198804294638e-5,3.620370937664565e-8,0.0014421057972856064,-4.166845338362705e-5,3.628802792965738e-8,0.0014421685219863218,-4.183607922736202e-5,3.6408352528175015e-8,0.0014423002757643633,-4.203032172674412e-5,3.65463031098458e-8,0.0014425080608542666,-4.22195472333642e-5,3.667862994977846e-8,0.001442784991572208,-4.237031728117714e-5,3.6781252110025435e-8,0.0014431095090614871,-4.245409762385614e-5,3.6834180674033206e-8,0.0014434474962299161,-4.245454297942441e-5,3.682664986919906e-8,0.0014437579597159325,-4.237398291446551e-5,3.676149381934002e-8,0.0014440024218877274,-4.2236870836770005e-5,3.665727124065034e-8,0.0014441566692500326,-4.208735480065546e-5,3.654623465415403e-8,0.0014442210777839057,-4.197894413823149e-5,3.646678154580181e-8,0.0014442238639085503,-4.1957657259825583e-5,3.6451395741224957e-8,0.001444213177633174,-4.204514955028633e-5,3.6514704020701185e-8,0.0014442400148779796,-4.2230738483301597e-5,3.664799820937176e-8,0.001444340327612597,-4.2477002171248194e-5,3.6823531208232587E-08,0.0014445252831045401,-4.273521305190709e-5,3.700583739358809e-8,0.001444782633063003,-4.296167146369278e-5,3.716358146341754e-8,0.0014450854085491184,-4.312785702347721e-5,3.727679374827056e-8,0.001445401951167018,-4.322288651739154e-5,3.733842340885731e-8,0.001445703365975638,-4.3250813436262515e-5,3.735212787958807e-8,0.0014459674945798882,-4.32260760357198e-5,3.73288004390637e-8,0.001446180300220262,-4.316923443732345e-5,3.728344873718978e-8,0.0014463359582635035,-4.310370309668452e-5,3.723292189167686e-8,0.0014464365687389773,-4.305328850624032e-5,3.719426687269874e-8,0.0014464918465855834,-4.304002473972689e-5,3.718325365119318e-8,0.0014465186728166825,-4.308181819575483e-5,3.721266618215463e-8,0.0014465400355141305,-4.3189687170519945e-5,3.7290221487352145e-8,0.0014465827531187007,-4.336489798552785e-5,3.741640893771544e-8,0.0014466736056468219,-4.3596841039752464e-5,3.758294229173246e-8,0.0014468340922974643,-4.386279199894946e-5,3.77726972029659e-8,0.0014470748301542683,-4.413057535440872e-5,3.7961848327240886e-8,0.0014473912922101449,-4.4364408720834884e-5,3.812432810558878e-8,0.0014477626657607462,-4.453297875666711e-5,3.8237820661230854e-8,0.001448154854433801,-4.461771816489685e-5,3.828974037644961e-8,0.0014485274030723117,-4.461890202134063e-5,3.8281447589952853e-8,0.0014488429638407447,-4.455758179245559e-5,3.822931479912126e-8,0.001449077126957026,-4.447225398864734e-5,3.816195570741389e-8,0.001449226023125882,-4.441032020245069e-5,3.8113794316332475e-8,0.0014493090755652274,-4.441579020404974e-5,3.8116125833806295e-8,0.001449364947092221,-4.451633994090186e-5,3.818794133287042e-8,0.0014494407057380814,-4.471426477041007e-5,3.832972073058778e-8,0.0014495774144823556,-4.498555350055323e-5,3.8523117853081915e-8,0.0014497978450341655,-4.5288121537755064e-5,3.873716648698755e-8,0.001450101396289851,-4.557563857325436e-5,3.89383696430426e-8,0.0014504674700356046,-4.581077178440381e-5,3.9100206897818924e-8,0.001450864329811925,-4.59729347684755e-5,3.920855010190983e-8,0.001451258767715561,-4.605934108050844e-5,3.92621859121156e-8,0.001451623153623208,-4.608136827590191e-5,3.926997648012008e-8,0.0014519388956488832,-4.605924560935e-5,3.9246910208725725e-8,0.0014521971379447417,-4.6017229535460886e-5,3.9210629613232204e-8,0.0014523980389310705,-4.5980057149587095e-5,3.917896492879653e-8,0.0014525496603379358,-4.597051953376308e-5,3.9168276920308264e-8,0.0014526669574361673,-4.600759430739576e-5,3.9192135619664394e-8,0.0014527708281076104,-4.610453020282936e-5,3.9259884840940946e-8,0.0014528867245701964,-4.626654176388048e-5,3.9374895639106777e-8,0.0014530421048613528,-4.648831416903428e-5,3.9532731387203335e-8,0.0014532621468013511,-4.6752190201937326e-5,3.971990995005398e-8,0.0014535637916342824,-4.7028515568426274e-5,3.9914326393312656e-8,0.0014539493947660874,-4.727971460801391e-5,4.008841173852169e-8,0.0014544025921314587,-4.7468597955633217e-5,4.021531201044032e-8,0.0014548892922685616,-4.7569142347220584e-5,4.027675511472258e-8,0.0014553650558184153,-4.7575810436338764e-5,4.026972977663235e-8,0.0014557870851216873,-4.750717265528638e-5,4.020889782847651e-8,0.0014561265502366723,-4.7401772022354576e-5,4.012327246018735e-8,0.0014563767220609832,-4.730757137609055e-5,4.004821937536077e-8,0.00145655435776092,-4.726880621379515e-5,4.001569186801683e-8,0.001456694463586125,-4.73144514864003e-5,4.004587627083997e-8,0.0014568404770532691,-4.7451327393656046e-5,4.0142460997834714e-8,0.0014570327641523222,-4.7663290283813975e-5,4.029246947753112e-8,0.001457298519145466,-4.7916441311999795e-5,4.047043105356473e-8,0.0014576457793189451,-4.816871716330359e-5,4.064555627563837e-8,0.0014580630692166065,-4.8380870254886153e-5,4.07896946312839e-8,0.0014585242916217804,-4.85254475628263e-5,4.0883660976549706e-8,0.0014589966823086494,-4.859135992178545e-5,4.092028278391199e-8,0.0014594488895383127,-4.8583561201735886e-5,4.0903922552317477e-8,0.0014598568660654338,-4.851917902858856e-5,4.084752107398645e-8,0.001460206718017994,-4.8422238333548e-5,4.0768741953613706e-8,0.0014604949812930131,-4.831876578154884e-5,4.068648768877478e-8,0.0014607274013576004,-4.823314160900414e-5,4.0618350180221016e-8,0.0014609172150457537,-4.8185712318530414e-5,4.057893429465176e-8,0.001461083502746424,-4.8191179258434105E-05,4.0578670798416085e-8,0.001461249671904525,-4.82571706133708e-5,4.0622715345642995e-8,0.001461441693727446,-4.838261929000545e-5,4.07097296081658e-8,0.0014616854233344243,-4.8556014057686534e-5,4.083066061163576e-8,0.0014620023267894015,-4.8754249269082786e-5,4.0968058990523775e-8,0.0014624034953483796,-4.894358809285292e-5,4.109698020827211e-8,0.0014628831941533296,-4.908464338861261e-5,4.118875936509696e-8,0.0014634150433660768,-4.914226299762998e-5,4.121824393937142e-8,0.0014639548020531532,-4.9098224861191336e-5,4.117296927439143e-8,0.001464451637979818,-4.8961091183785824e-5,4.106020733296679e-8,0.0014648646915946838,-4.8766820370606e-5,4.090722801199529e-8,0.0014651772883869003,-4.8568009313809076e-5,4.075319349404685e-8,0.0014654017214941388,-4.8416426777365386e-5,4.063612262558724e-8,0.0014655731149098806,-4.834715390556542e-5,4.05811408271586e-8,0.0014657366598345033,-4.8370472978448067e-5,4.0594648027202523e-8,0.0014659342958094506,-4.847253437725393e-5,4.066516335293664e-8,0.0014661950114605521,-4.862215666828612e-5,4.076876008564538e-8,0.0014665301910791108,-4.8780249807602064e-5,4.0876316291687736e-8,0.0014669336173157724,-4.8909088442915184e-5,4.096041061837196e-8,0.0014673849869394323,-4.89797010783182e-5,4.10005813588427e-8,0.0014678556191269404,-4.8976435201010984e-5,4.0986359543432826e-8,0.0014683149714162325,-4.889830880085964e-5,4.091793502517985e-8,0.0014687365529222206,-4.875735290426732e-5,4.080472681276175e-8,0.0014691021142846357,-4.857481423921316e-5,4.0662543710692137e-8,0.0014694036337962362,-4.8376450354823765e-5,4.0510213167388694e-8,0.0014696432745798936,-4.8188046898087444e-5,4.0366429937764576e-8,0.0014698319277800106,-4.803190530328035e-5,4.0247286006004545e-8,0.0014699871102827962,-4.7924526915939426e-5,4.0164595796703556e-8,0.0014701307848855516,-4.787522027490336e-5,4.012482396092963e-8,0.0014702872622128149,-4.788517195205734e-5,4.012834089633514e-8,0.0014704809975428358,-4.794666693736669e-5,4.0168855709075365e-8,0.0014707338344027386,-4.804244009905834e-5,4.0233062784634995e-8,0.0014710611213139102,-4.814566107532364e-5,4.030084085232558e-8,0.0014714665413726273,-4.822181569590968e-5,4.034683134470572e-8,0.001471936732554558,-4.823419676772928e-5,4.0344537351810816e-8,0.0014724385787785134,-4.815393883152968e-5,4.02735824939934e-8,0.0014729232921461939,-4.7972708991935915e-5,4.012881131104992e-8,0.001473339733380658,-4.771194684085152e-5,3.99268721108642e-8,0.0014736534482333627,-4.7420811459529796e-5,3.97045678271898e-8,0.0014738614631978186,-4.716016424666695e-5,3.9506949528936975e-8,0.0014739933492919856,-4.697982067329245e-5,3.937043540172194e-8,0.0014740979744279096,-4.690167112469379e-5,3.931032980142313e-8,0.0014742246024554207,-4.691644256644111e-5,3.9318604552850936e-8,0.0014744082651071803,-4.69922299640802e-5,3.9370563974310175e-8,0.0014746637140043946,-4.708756851895923e-5,3.943489870131204e-8,0.0014749866046875014,-4.7162958123676244e-5,3.948243157993727e-8,0.001475358543065385,-4.71883294842356e-5,3.949159654624633e-8,0.001475753210166725,-4.714652817698946e-5,3.945074236392933e-8,0.001476142078096254,-4.7033888847950614e-5,3.9358189832320374e-8,0.0014764992123982724,-4.685887934392134e-5,3.9220928510260014e-8,0.0014768049713061416,-4.663938791887539e-5,3.905248086942313e-8,0.001477048391317066,-4.639911917690382e-5,3.8870289051615004e-8,0.0014772281442441146,-4.61636413222774e-5,3.86929540003015e-8,0.0014773521218631534,-4.595660324837137e-5,3.8537604231317574e-8,0.0014774358574483667,-4.579659133441228e-5,3.841765492707048e-8,0.0014775001956065402,-4.569496823083304e-5,3.8341186816552856e-8,0.0014775686820781154,-4.565470129067433e-5,3.830999686167372e-8,0.0014776649243166784,-4.566994456347111e-5,3.8319233095593914e-8,0.0014778099359220231,-4.5726192560117234e-5,3.83575570353092e-8,0.0014780193244124584,-4.580097117160524e-5,3.840782891730723e-8,0.0014783000450939625,-4.5865328797617776e-5,3.8448445201550915e-8,0.0014786467079729625,-4.588696439857752e-5,3.845582251437362e-8,0.0014790384080720245,-4.583611242343526e-5,3.840873944588172e-8,0.0014794383527260398,-4.56945594107753e-5,3.82947864626867e-8,0.001479799398450005,-4.5465999161076066e-5,3.811769435150879e-8,0.0014800774121277783,-4.518250806512075e-5,3.790185132520664e-8,0.0014802492942168032,-4.489995809258601e-5,3.768879845012064e-8,0.0014803258879004637,-4.467961171000656e-5,3.7523621216932424e-8,0.0014803496588216847,-4.456364916372832e-5,3.7436882425543227E-08,0.0014803767789849922,-4.455914717389837e-5,3.743285124826617e-8,0.00148045471663273,-4.463944669785187e-5,3.749072374826842e-8,0.0014806079903739232,-4.4759080332929866e-5,3.757599995374444e-8,0.0014808363575325631,-4.4871298219932226e-5,3.7653765328709984e-8,0.0014811213748755097,-4.49400791113898e-5,3.7697698950566665e-8,0.0014814353063795221,-4.494494148911797e-5,3.769349125262831e-8,0.0014817486607833878,-4.488064489949951e-5,3.7638296039217246e-8,0.0014820352591590176,-4.475444899156155e-5,3.75383511170801e-8,0.001482275222988769,-4.458271568201399e-5,3.740624045556785e-8,0.0014824566343186552,-4.438752806725547e-5,3.7258364186440963e-8,0.0014825762933425046,-4.41933973514123e-5,3.711263205430016e-8,0.0014826396781233982,-4.402407385189993e-5,3.698628868785702e-8,0.0014826601038704105,-4.3899537486014864e-5,3.689381745950238e-8,0.0014826570290835308,-4.3833355408042506e-5,3.684500249109746e-8,0.0014826535665252642,-4.383076384824262e-5,3.684342893133268e-8,0.0014826734964349505,-4.388776027353641e-5,3.688571137475423e-8,0.0014827381250709867,-4.3991250197185465e-5,3.696157870415823e-8,0.0014828632277558774,-4.4120225732295084e-5,3.7054853705114773e-8,0.0014830562790585913,-4.424796254416029e-5,3.7145299091021524e-8,0.001483314114902658,-4.4345226853738956e-5,3.721123064884487e-8,0.0014836212427355765,-4.438471351759688e-5,3.723292906691934e-8,0.0014839495880320053,-4.434704884177869e-5,3.719700534277648e-8,0.0014842612053440878,-4.4227969750309367e-5,3.7101437221589655e-8,0.001484515578411819,-4.4044706083483356e-5,3.6959930289161086e-8,0.0014846818321571568,-4.383767436946015e-5,3.6802887599284104e-8,0.001484752665298912,-4.366282494601175e-5,3.6671649941767425e-8,0.0014847523079773632,-4.357345179251354e-5,3.6605110282143873e-8,0.0014847306685902028,-4.3598461730291396e-5,3.662379044416523e-8,0.0014847439416985908,-4.372996532663204e-5,3.672084767057359e-8,0.001484832455576805,-4.392834159757466e-5,3.6866053246575335e-8,0.0014850084524969315,-4.414052139172515e-5,3.701958292803764e-8,0.0014852579225742377,-4.4319394962506785e-5,3.7146574635816525e-8,0.00148555111690797,-4.443521318072178e-5,3.7225576915926685e-8,0.0014858540251273446,-4.447773434048518e-5,3.724992857383376e-8,0.0014861364543161625,-4.445270363925244e-5,3.722482225495067e-8,0.0014863760913723298,-4.437656318307988e-5,3.716309655277369e-8,0.0014865597532513933,-4.427164451826376e-5,3.708154822513582e-8,0.0014866832683675857,-4.4162460074345484e-5,3.699824191460888e-8,0.0014867508559287582,-4.407282323694022e-5,3.693054466535894e-8,0.0014867742340000237,-4.402339782503651e-5,3.68934712540527e-8,0.0014867713714220555,-4.402943420367354e-5,3.689807422058526e-8,0.0014867646564762282,-4.409867285281513e-5,3.6949844467746125e-8,0.0014867782740302412,-4.422973621937711e-5,3.7047415402730984e-8,0.0014868348754921309,-4.441152508594255e-5,3.718204520461165e-8,0.0014869519465962582,-4.462400182095811e-5,3.733824048865543e-8,0.0014871384186216602,-4.484053098879151e-5,3.749566462993671e-8,0.0014873921480441546,-4.5031733174503954e-5,3.7632239067973675e-8,0.0014876988747097991,-4.517047600970056e-5,3.772804673560034e-8,0.0014880330851069787,-4.5237407062414714e-5,3.776948065811721e-8,0.0014883611336936045,-4.522638867386191e-5,3.7753106366925946e-8,0.0014886470419661934,-4.5148829423299135e-5,3.768853679617695e-8,0.0014888610099375744,-4.503511107630251e-5,3.75991142701746e-8,0.0014889893734640611,-4.493078727593386e-5,3.7518833390943256e-8,0.0014890426802024238,-4.4885939658503095e-5,3.74844077895564e-8,0.0014890568559620368,-4.493900359979849e-5,3.752344755667185e-8,0.0014890836459080803,-4.5101175184416406e-5,3.7643181361237684e-8,0.001489172305795643,-4.535029512050693e-5,3.7826206234394064e-8,0.0014893513815948645,-4.5639131365739326e-5,3.803685162170241e-8,0.0014896203853677792,-4.591379586939746e-5,3.8234980089391865e-8,0.0014899543663838013,-4.613185728141613e-5,3.8389462478218916e-8,0.0014903162297077394,-4.6271946349084726e-5,3.848520377485263e-8,0.0014906691385107214,-4.6333741604474694e-5,3.852289537208366e-8,0.0014909844428688587,-4.6332267253878814e-5,3.851449641139075e-8,0.0014912446994979787,-4.629096295265064e-5,3.8477884251820716e-8,0.001491443475023993,-4.623604922293549e-5,3.843262815520471e-8,0.0014915838036451312,-4.61927449105687e-5,3.8397284898482245e-8,0.0014916764513131834,-4.618284796155863e-5,3.838776175182558e-8,0.0014917383357409837,-4.622298504810592e-5,3.8416126988273096e-8,0.0014917909428913139,-4.632303584535767e-5,3.848944739748476e-8,0.0014918583550758398,-4.648458412369112e-5,3.860856466449232e-8,0.0014919645095770773,-4.669969166698596e-5,3.8767106301308565e-8,0.001492129594339425,-4.695065290037247e-5,3.895130296913219e-8,0.0014923659795207224,-4.721144655663761e-5,3.914118664687933e-8,0.0014926745732702724,-4.745133715731877e-5,3.931347861780057e-8,0.0014930428020581202,-4.764050267803905e-5,3.944599080200351e-8,0.0014934453287540244,-4.77567381989998e-5,3.952272977792478e-8,0.0014938479976421455,-4.7791615726440825e-5,3.9538419803086526e-8,0.0014942145959709434,-4.775437268653611e-5,3.950114664854367e-8,0.0014945152548361581,-4.7672147717775885e-5,3.943216537025932e-8,0.0014947347496844735,-4.758571958330954e-5,3.936237614997539e-8,0.0014948784839529095,-4.754071729882442e-5,3.9325587712150906e-8,0.001494973688060228,-4.7575580700830986e-5,3.934960606065222e-8,0.001495063893699758,-4.7709339668887554e-5,3.9447410821275483e-8,0.0014951967819727924,-4.793386974666786e-5,3.961177012530231e-8,0.0014954089548056488,-4.82150113356529e-5,3.9816407071216556e-8,0.001495713972368483,-4.8503439552528306e-5,4.0024278257678855e-8,0.0014960992299929698,-4.875088216767253e-5,4.0199671339311314e-8,0.0014965325627533485,-4.892426755697233e-5,4.031863181757441e-8,0.0014969742965597005,-4.9012244353112056e-5,4.037361715514292e-8,0.0014973887060458133,-4.90234527916337e-5,4.037196030438772e-8,0.0014977509975768778,-4.897987925534544e-5,4.033069659995429e-8,0.0014980493699429142,-4.8909370842569586e-5,4.0270872530960104e-8,0.0014982838272042372,-4.8839785143966184e-5,4.0213214367086265e-8,0.0014984636893112296,-4.879533379597899e-5,4.017552829673121e-8,0.0014986050564438516,-4.879459745805125e-5,4.0171351190536136e-8,0.0014987286878216618,-4.884940264365551e-5,4.020917276631506e-8,0.0014988581486848397,-4.8963892845157507e-5,4.029171690125393e-8,0.0014990177337836207,-4.9133541633318104e-5,4.0415144161886566e-8,0.0014992296650089489,-4.934439725353427e-5,4.056846910653133e-8,0.0014995103608385159,-4.957328780427341e-5,4.073379081419653e-8,0.0014998661313054954,-4.978992849651283e-5,4.0888033317214166E-08,0.001500289438846751,-4.996169395570395e-5,4.100670227701081e-8,0.0015007575640223773,-5.00609271009138e-5,4.1069476582698656e-8,0.0015012354183340914,-5.0073132062903215e-5,4.106633523245191e-8,0.001501682931435136,-5.000313393611321e-5,4.10020124318666e-8,0.0015020653958463235,-4.9876318236111225e-5,4.089664152349184e-8,0.001502363510762478,-4.973362668651773e-5,4.078166708635209e-8,0.0015025796036362987,-4.9621359434477365e-5,4.06919240015438e-8,0.001502737788613337,-4.957881774687852e-5,4.0656280257301776e-8,0.0015028778851812186,-4.9627518948032364e-5,4.0689710099869005e-8,0.001503044775055048,-4.9765138003926926e-5,4.078912007859041e-8,0.001503276131990282,-4.9966042084288354e-5,4.093418214974257e-8,0.0015035921340975534,-5.0188522911167886e-5,4.109307745813918e-8,0.0015039904959644906,-5.038664086853307e-5,4.12314822617478e-8,0.0015044484479765602,-5.052272450607022e-5,4.1321828260849926e-8,0.0015049305867960681,-5.057627006151882e-5,4.1349724488542334e-8,0.0015053992671028003,-5.0546698588028124e-5,4.1315734395285215e-8,0.001505823682333701,-5.0450202162379264e-5,4.123276774522326e-8,0.0015061851264551991,-5.03131376162049e-5,4.1120991139124105e-8,0.00150647810650972,-5.0164985415371416e-5,4.100254562995308e-8,0.0015067085911635734,-5.003289045076868e-5,4.0897557578942296e-8,0.0015068910568689683,-4.9938339881018866e-5,4.0821788084939146e-8,0.0015070455081733843,-4.989557017837055e-5,4.078553560863914e-8,0.0015071949768719031,-4.991095762554463e-5,4.079319265895584e-8,0.0015073634330199596,-4.998270255847455e-5,4.0842964940455486e-8,0.001507573648758257,-5.0100484272582855e-5,4.092657881678172e-8,0.001507844474226869,-5.024531275080717e-5,4.1029213145852093E-08,0.0015081872475477102,-5.039029477878423e-5,4.113020982278904e-8,0.001508601639381369,-5.0503348351200574e-5,4.1205288990591655e-8,0.0015090721800536042,-5.0552825964399286e-5,4.123090271547341e-8,0.0015095677542445187,-5.051598845732162e-5,4.119061726808571e-8,0.0015100464398749296,-5.0388137396494456e-5,4.1081869583940654e-8,0.0015104661524490966,-5.0188150732697904e-5,4.091992886992478e-8,0.0015107980562968522,-4.995626598255443e-5,4.073597315450068e-8,0.0015110369884425087,-4.974323096834382e-5,4.056865503257804e-8,0.0015112037636235288,-4.9594689096187027e-5,4.0452143784550536e-8,0.0015113382538688342,-4.9537390122333774e-5,4.040571885063075e-8,0.001511486651518908,-4.9572491390367476e-5,4.0428949376900265e-8,0.0015116882343063284,-4.9677288522526345e-5,4.0503412055625985e-8,0.001511965832908493,-4.981328246977489e-5,4.0599203239587485e-8,0.0015123218678560742,-4.993712667865752e-5,4.0683458185044255e-8,0.0015127398774388951,-5.001120491259384e-5,4.072833176366586e-8,0.0015131902459503254,-5.0011430442294444e-5,4.0716651632460574e-8,0.0015136381639806527,-4.9930908725903795e-5,4.064433406034829e-8,0.0015140516272895985,-4.977923819466192e-5,4.051953249837382e-8,0.0015144075622012096,-4.9578319631606846e-5,4.035928102066704e-8,0.0015146949683276282,-4.9356355695184494e-5,4.0184938821169755e-8,0.0015149150502128804,-4.9141887980333486e-5,4.0017799643976816e-8,0.0015150791746275875,-4.895917584109024e-5,3.9875772118617474e-8,0.0015152057997848073,-4.8825388632539786e-5,3.977139653273003e-8,0.0015153173317295856,-4.874940504486354e-5,3.971098695425316e-8,0.0015154374095433952,-4.8731643689852686e-5,3.9694467703771245e-8,0.0015155886318726306,-4.876432642304724e-5,3.971551230211538e-8,0.0015157903988936615,-4.8831866635134174e-5,3.976183295261236e-8,0.0015160564336704537,-4.891150797550089e-5,3.9815759747989534e-8,0.001516391691608481,-4.8974788479225625e-5,3.985552106330658e-8,0.0015167888924818176,-4.899079602098747e-5,3.985786664037715e-8,0.0015172258993118245,-4.893217400965164e-5,3.9802659015735863e-8,0.0015176663030841539,-4.878381729040918e-5,3.967934665594565e-8,0.0015180658418397924,-4.855185669703154e-5,3.9493549812086156e-8,0.0015183852145058741,-4.8267882631723335e-5,3.927002879151628e-8,0.001518605245428821,-4.7983227159816685E-05,3.904816418536927e-8,0.0015187364109845078,-4.7752853667001454e-5,3.8869607112691156e-8,0.0015188162107197098,-4.76157007253304e-5,3.876330623471329e-8,0.0015188951081814535,-4.7581646967552716e-5,3.87356971621642e-8,0.0015190187423242043,-4.763095682004308e-5,3.877055536279872e-8,0.0015192148843438057,-4.7724206359166875e-5,3.883693164021174e-8,0.0015194889111096335,-4.7816122036906335e-5,3.890001525702813e-8,0.0015198265573875282,-4.78675190041975e-5,3.893034461914193e-8,0.0015202006147450764,-4.785267690604367e-5,3.8909281403952436e-8,0.0015205786058022936,-4.776206764521024e-5,3.883074987792664e-8,0.001520929655959892,-4.7601511265561416e-5,3.8700210594517606e-8,0.0015212297485279174,-4.73889457227636e-5,3.853192522081979e-8,0.001521464985636384,-4.714978616986874e-5,3.834534142739313e-8,0.001521632714070136,-4.691181862109943e-5,3.8161308626593714e-8,0.0015217407259916819,-4.6700544473304215e-5,3.7998737945680615e-8,0.001521805050737679,-4.653561112622005e-5,3.7872078917049705e-8,0.0015218469609350476,-4.6428620942574455e-5,3.77897496515343e-8,0.0015218898209953303,-4.638232433864213e-5,3.7753505077697286e-8,0.0015219562588472324,-4.63908829784902e-5,3.775855431522331e-8,0.0015220657852472567,-4.644073196168358e-5,3.779415592915643e-8,0.0015222326849345393,-4.6511768353575117e-5,3.78445580321092e-8,0.0015224639302797234,-4.6578917633677744e-5,3.789033821231449e-8,0.0015227569400496383,-4.6614434070743716e-5,3.791035015751786e-8,0.0015230973823843132,-4.659163295010869e-5,3.788469386599491e-8,0.0015234580899453059,-4.6490764418833046e-5,3.779915028577375e-8,0.0015238011301948635,-4.630679101973296e-5,3.765088713532935e-8,0.0015240852672769784,-4.6056717425461094e-5,3.7453737167092474e-8,0.001524279176362041,-4.578158370729293e-5,3.723946842777562e-8,0.0015243761207970313,-4.5537893273890615e-5,3.7051147789336374e-8,0.0015244012465784203,-4.537833811089991e-5,3.692846975976653e-8,0.0015244043069810233,-4.5330485030194646e-5,3.689159982476225e-8,0.001524440051851727,-4.5386093677926136e-5,3.693319329946158e-8,0.0015245475921702796,-4.550706901455292e-5,3.70231970685862e-8,0.001524739631177373,-4.564256280847005e-5,3.712221109997426e-8,0.0015250039821238194,-4.574645320979391e-5,3.719506196713576e-8,0.001525312469978232,-4.57880724817201e-5,3.7219009823727845e-8,0.0015256311465300198,-4.575529177708597e-5,3.71858758629502e-8,0.0015259283156329572,-4.5652460184988825e-5,3.710009588757813e-8,0.001526179490549331,-4.549604863952453e-5,3.697504333756095e-8,0.0015263698298762106,-4.5309863016883735e-5,3.682918922629797e-8,0.0015264948690534665,-4.5120549024834013e-5,3.668269874859717e-8,0.0015265600057452486,-4.495356643058214e-5,3.65545436819091e-8,0.0015265789603062382,-4.4829825029204026e-5,3.646015826369734e-8,0.0015265714591917814,-4.476317621887072e-5,3.640967597256171e-8,0.001526560393019653,-4.47588814097071e-5,3.6406785222506725e-8,0.0015265687425595057,-4.481319012855167e-5,3.6448328955322366e-8,0.001526616673386339,-4.491402171639455e-5,3.6524727155707175e-8,0.001526719088838322,-4.5042478706087005e-5,3.662110821247449e-8,0.001526883671120863,-4.517492388060347e-5,3.671899335520608e-8,0.001527109357997393,-4.528556689050531e-5,3.679846629243785e-8,0.0015273852648541443,-4.5349660451110904e-5,3.684080865883039e-8,0.0015276902649918051,-4.5347572784252786e-5,3.683168213824624e-8,0.0015279940023550515,-4.5269982630066084e-5,3.676496818810432e-8,0.001528260741500139,-4.5123660491407865e-5,3.664687940483986e-8,0.0015284573649040436,-4.493568923535388e-5,3.649883068748661e-8,0.0015285651819203082,-4.475224028990135e-5,3.6356268024786054e-8,0.001528591522529057,-4.462799322930828e-5,3.6260564495138095e-8,0.0015285733068809862,-4.4606708170989893e-5,3.6244339332635135e-8,0.0015285663015500417,-4.4701580903939586e-5,3.631667920617675e-8,0.001528623057978843,-4.4888075568297965e-5,3.645788182105769e-8,0.0015287721301055885,-4.511488889181742e-5,3.662804240559266e-8,0.0015290104785997134,-4.532567197125326e-5,3.678385405657058e-8,0.0015293104382067145,-4.547810886081325e-5,3.689331286542308e-8,0.0015296334898081117,-4.555238252513215e-5,3.6942127930790746e-8,0.0015299425822774475,-4.5549875508693376e-5,3.6932458321921016e-8,0.0015302094618059117,-4.5487012585997464e-5,3.687784149123152e-8,0.0015304173593234294,-4.538838777224406e-5,3.6797650641900755e-8,0.0015305608012845585,-4.5281191160702335e-5,3.6712741731269536e-8,0.0015306441945146152,-4.5191250244956506e-5,3.664253537729438e-8,0.0015306800306723414,-4.514019365633332e-5,3.660306514411148e-8,0.0015306868440561443,-4.5143317412885504e-5,3.660554118454364e-8,0.0015306868688130097,-4.5208046874071456e-5,3.665525950628058e-8,0.001530703372269813,-4.533304361844633e-5,3.675088279926432e-8,0.0015307577071024677,-4.550816475509205e-5,3.6884311766138235e-8,0.0015308663545292767,-4.5715530714938635e-5,3.7041438425744794e-8,0.001531038403461839,-4.5931705831679506e-5,3.7203859056823594e-8,0.0015312738096312358,-4.613076201647923e-5,3.7351380006003594e-8,0.001531562647587085,-4.628797631784266e-5,3.7465058196804165e-8,0.001531885540287841,-4.638388948223532e-5,3.753045447184219e-8,0.0015322154350115606,-4.6408424099129384e-5,3.75407624833672e-8,0.0015325210181051422,-4.636473481435046e-5,3.749952617090675e-8,0.0015327722562987192,-4.62720299113284e-5,3.742243109933671e-8,0.0015329482178092664,-4.616568661040811e-5,3.7337038635539955e-8,0.0015330459667584296,-4.60922941785365e-5,3.7278814888025735e-8,0.001533087023241133,-4.609795126881395e-5,3.728225619249699e-8,0.001533115983708838,-4.621153374983078e-5,3.736837190134323e-8,0.0015331876400693626,-4.643018459294151e-5,3.753391652633899e-8,0.0015333461088477486,-4.6716886718747485e-5,3.7749779963297116e-8,0.001533607077938741,-4.701413330082583e-5,3.797158062251958e-8,0.0015339536898771556,-4.7266463413301e-5,3.8156979046495933e-8,0.0015343469210881689,-4.7438804933053115e-5,3.827972461061156e-8,0.0015347420400233514,-4.7522609577066365e-5,3.833423468532848e-8,0.0015351018922789568,-4.75311913550837e-5,3.833175719045527e-8,0.0015354032268769953,-4.7490536847499134e-5,3.8293014468682244e-8,0.0015356372503282487,-4.7430749661384474e-5,3.8241437080403724e-8,0.0015358072060457936,-4.738020854009638e-5,3.819867181103716e-8,0.0015359252275494756,-4.736231090740194e-5,3.818223813016995e-8,0.0015360095332831896,-4.739380510817324e-5,3.820445815928393e-8,0.0015360820478136717,-4.748383499571379e-5,3.82718722773441e-8,0.001536166141831675,-4.763330834665019e-5,3.838478548063725e-8,0.001536284194639195,-4.783458629340891e-5,3.8536969464764897e-8,0.0015364548174580863,-4.8071792138992605e-5,3.871582755825761e-8,0.001536689888308331,-4.832221693893701e-5,3.890347256035087e-8,0.001536991949021952,-4.8559125680806725e-5,3.907898810591917e-8,0.0015373526882001662,-4.875585201501901e-5,3.9221757056841037E-08,0.0015377531409755225,-4.889068042494506e-5,3.931538272353313e-8,0.0015381659828674545,-4.895167436888976e-5,3.9351451406966635e-8,0.0015385598715198048,-4.894040830492917e-5,3.9332267184161023e-8,0.0015389053503828088,-4.887366805568127e-5,3.927184980018389e-8,0.0015391815674583567,-4.878238533919379e-5,3.919473310592367e-8,0.0015393827610044833,-4.870713902780217e-5,3.913220935194622e-8,0.001539522826925547,-4.868983638924286e-5,3.911586463438951e-8,0.001539635551012186,-4.8762258491063296e-5,3.916897922140672e-8,0.0015397681169518995,-4.893424373568861e-5,3.929783969200081e-8,0.0015399675307219867,-4.9186670824232385e-5,3.9486747633733346e-8,0.0015402639575685848,-4.94746582698892e-5,3.970072063670472e-8,0.001540658896768355,-4.974203898215638e-5,3.989665648604e-8,0.0015411250260262703,-4.9940960584229624e-5,4.0038309783718896e-8,0.0015416177088270302,-5.0046684404287795e-5,4.010752915400204e-8,0.0015420911707916128,-5.006124568783706e-5,4.010688682435594e-8,0.0015425111740769344,-5.000709715400226e-5,4.00545534176231e-8,0.0015428603593231258,-4.9916572907574924e-5,3.9975967592465016e-8,0.001543137348004615,-4.9822560505639655e-5,3.9896549730067413e-8,0.0015433527728847896,-4.9752685894152456e-5,3.983728353617607e-8,0.0015435248853113634,-4.972672630231794e-5,3.981289716560943e-8,0.0015436759860362377,-4.975595477250484e-5,3.9831537088095255e-8,0.0015438297952060482,-4.984325147671539e-5,3.989494979643839e-8,0.0015440093369692496,-4.998334813656624e-5,3.999866380557658e-8,0.0015442348151259754,-5.016309804535865e-5,4.013214246585282e-8,0.0015445211154071746,-5.0362121259628284e-5,4.027925529887606e-8,0.0015448749611662643,-5.055446980018576e-5,4.0419618992163206e-8,0.0015452923005028491,-5.071189862384606e-5,4.053125674762409e-8,0.0015457569800726891,-5.0808855828295383E-05,4.059460327889975e-8,0.0015462418900000286,-5.082850879931722e-5,4.059724221672877e-8,0.0015467132993301472,-5.076823346637892e-5,4.0538094268894254e-8,0.0015471380038922773,-5.064252614673594e-5,4.042945683138028e-8,0.0015474916360774626,-5.048174585710053e-5,4.0295709244955134e-8,0.0015477657624747324,-5.0326348408581844e-5,4.016852598729084e-8,0.0015479715584376128,-5.02176988612463e-5,4.00795759607021e-8,0.001548138675163666,-5.018759931395581e-5,4.0052468864238434e-8,0.001548309019173918,-5.0249167170106635e-5,4.0095999848332944e-8,0.001548526363415651,-5.039173011559901e-5,4.020064552392213e-8,0.001548824072026234,-5.0581979693915296e-5,4.033985817256759e-8,0.0015492146318262102,-5.0772290610955474e-5,4.047669746431854e-8,0.0015496851936439822,-5.091443598787875e-5,4.057438892398452e-8,0.001550201601146154,-5.0973893683465014e-5,4.0607169310144533e-8,0.001550719547427848,-5.093895551994056e-5,4.0567056747315524e-8,0.0015511979549022272,-5.082132789363123e-5,4.0464060310906736e-8,0.001551609085796503,-5.064930767517722e-5,4.032070429909841e-8,0.001551942485882253,-5.045777032215602e-5,4.0164179972009266e-8,0.001552203365741154,-5.027932903282667e-5,4.0019527762343134e-8,0.0015524080338778475,-5.0138911795649996e-5,3.990557662144009e-8,0.0015525789206599471,-5.005169954767954e-5,3.983352487266917e-8,0.0015527405622942454,-5.0023207216840704e-5,3.980713258549693e-8,0.001552916795278977,-5.005024771803662e-5,3.982350168918181e-8,0.0015531287739189376,-5.012197934084325e-5,3.987384769919168e-8,0.0015533932025365111,-5.022080731770897e-5,3.99441559610026e-8,0.0015537202826231122,-5.03234457482546e-5,4.0016025565273536e-8,0.0015541112665716941,-5.0402810390084915e-5,4.0068239562396716e-8,0.0015545561079804125,-5.0431489448755314e-5,4.007959506236113e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json
new file mode 100644
index 0000000..c6ac961
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":15000,"numberOfSamples":1000,"samples":[0.001555032396790159,-5.038717964716439e-5,4.003321453737454e-8,0.001555507240340409,-5.025945257220019e-5,3.992178064606655e-8,0.0015559433318249748,-5.005568561411016e-5,3.975199831316558e-8,0.0015563086828940746,-4.9802949292686764e-5,3.9545822083813816e-8,0.001556587031841404,-4.9543375923704664e-5,3.9336583092513e-8,0.0015567845028372617,-4.93232976794034e-5,3.9160317297773175e-8,0.0015569291408115862,-4.9179757456819175e-5,3.904518941710335e-8,0.0015570631279621951,-4.912957061070448e-5,3.90031151041951e-8,0.0015572306984882043,-4.916483994647903e-5,3.902661169621281e-8,0.0015574660511056152,-4.9255840502179806e-5,3.9091477245714126e-8,0.0015577847760354089,-4.9359606772293576e-5,3.9163823082464017e-8,0.001558180685115808,-4.943135773630568e-5,3.920908834205859e-8,0.0015586283968716341,-4.943566203060656e-5,3.920059314584998e-8,0.0015590906701226305,-4.9354497209498185e-5,3.9125494924869697e-8,0.001559528261058972,-4.919020584318819e-5,3.8986728207848124e-8,0.0015599093591160292,-4.896289913685733e-5,3.880070214408021e-8,0.0015602159244718476,-4.870367300374791e-5,3.8591890031225615e-8,0.001560445583043622,-4.844627081761637e-5,3.838637217885279e-8,0.0015606095190522666,-4.821988699048854e-5,3.8206389463064e-8,0.001560728059333107,-4.80447105719932e-5,3.8067072967328046e-8,0.0015608258215469178,-4.7930366808124216e-5,3.797538689472998e-8,0.0015609276655558022,-4.787644642721989e-5,3.793059714039383e-8,0.0015610558505919753,-4.7874043041353836e-5,3.792543115973339e-8,0.0015612281647851558,-4.7907464781617856e-5,3.794734148986789e-8,0.0015614564996265033,-4.795579391508165e-5,3.797969902153523e-8,0.0015617453775785114,-4.7994480662788104e-5,3.8003106795686565e-8,0.001562090231917282,-4.799751763502489e-5,3.7997236526191586e-8,0.0015624757732016965,-4.7940913074933274e-5,3.7943666553683704e-8,0.0015628755385377238,-4.780797264952134e-5,3.783002608138753e-8,0.0015632543909054244,-4.759591895225801e-5,3.765503864336205e-8,0.0015635755508337965,-4.7321569326116703e-5,3.743272490582087e-8,0.0015638118247210714,-4.702212301492192e-5,3.719276938020053e-8,0.0015639572183669657,-4.674759666086147e-5,3.697442350326965e-8,0.0015640325431972783,-4.654548661616456e-5,3.681443353406246e-8,0.0015640803149591668,-4.644389332460276e-5,3.673389012822279e-8,0.0015641503210691414,-4.644165242496307e-5,3.673070606589074e-8,0.0015642829369577056,-4.651013021168292e-5,3.678135043023996e-8,0.0015644977495392904,-4.660446073429612e-5,3.685000664095114e-8,0.001564790749643378,-4.6677917336542896e-5,3.6900071652951433e-8,0.001565138707406003,-4.66938238368795e-5,3.690350083708066e-8,0.0015655073435626183,-4.663241657433939e-5,3.6845954665167155e-8,0.0015658602190323327,-4.649255514773499e-5,3.672776169544263e-8,0.0015661663607259592,-4.628936931980565e-5,3.656170224679889e-8,0.0015664055799049252,-4.6049225283354464e-5,3.636883604376693e-8,0.001566571002171141,-4.580336936715299e-5,3.6173502381504967e-8,0.0015666687673390187,-4.558160277952096e-5,3.599852488215996e-8,0.0015667154033415197,-4.5407215387777025e-5,3.586148463513818e-8,0.0015667338355941623,-4.529393320932333e-5,3.577253994149994e-8,0.0015667490993197454,-4.524500274399756e-5,3.573380667359368e-8,0.0015667846174289822,-4.5254024907903564e-5,3.57399848967389e-8,0.001566859497029681,-4.5306834496840176e-5,3.5779734964378544e-8,0.0015669868024443458,-4.5383715412729446e-5,3.583733887760147e-8,0.001567172455798627,-4.546158479647085e-5,3.5894430294282084e-8,0.0015674144103284765,-4.551618411695069e-5,3.593183701499408e-8,0.001567701899164982,-4.5524599621765035e-5,3.593172347162997e-8,0.0015680149455750063,-4.5468646452923546e-5,3.588034316011282e-8,0.001568325023881159,-4.533952995396979e-5,3.577163595791014e-8,0.001568598375261144,-4.514331996072684e-5,3.561129614715066e-8,0.0015688033307539359,-4.490516831986402e-5,3.5419775786897466e-8,0.0015689213635770478,-4.4668520678280764e-5,3.5231422956829793e-8,0.0015689580930293371,-4.448560774152507e-5,3.508694038347068e-8,0.001568947072838441,-4.439966029933874e-5,3.501951652065551e-8,0.0015689406813127415,-4.442653532989222e-5,3.5040594280255434e-8,0.0015689905208410501,-4.454694343553021e-5,3.5134005465375e-8,0.0015691279470960945,-4.471462114836585e-5,3.526264408522862e-8,0.001569355167197491,-4.4874982251366504e-5,3.5383351783517066e-8,0.0015696491590304815,-4.498328840192346e-5,3.5461324901144965e-8,0.0015699730086184231,-4.5014843868502684e-5,3.547806086334234e-8,0.0015702878466824224,-4.496644962533722e-5,3.5432227789964445e-8,0.0015705615045717492,-4.48522455988792e-5,3.5336015448358164e-8,0.0015707731361774711,-4.469737825179658e-5,3.520983386424041e-8,0.0015709146371371892,-4.453167337270511e-5,3.507720338549927e-8,0.0015709899450492496,-4.4384204168804375e-5,3.4960569188722246e-8,0.0015710129446352492,-4.427899769327988e-5,3.487815813513884e-8,0.0015710044338982897,-4.4232035758685976e-5,3.484187409746818e-8,0.0015709885901114629,-4.424966839076787e-5,3.48562113954969e-8,0.0015709893763831153,-4.4328433769242266e-5,3.491813422291662e-8,0.0015710273252120134,-4.4456174728882454e-5,3.501786728147512e-8,0.001571117095259444,-4.4614146603934006e-5,3.514044529398255e-8,0.0015712659471281585,-4.4779625550250765e-5,3.526772890807883e-8,0.0015714729990209998,-4.492865339998087e-5,3.5380643711257126e-8,0.0015717290886569444,-4.503882672267935e-5,3.5461540303863484e-8,0.0015720171486412,-4.509218250304847e-5,3.549662088853352e-8,0.0015723131710548195,-4.507838065681111e-5,3.547847663955526e-8,0.0015725883317389549,-4.499835421555663e-5,3.540880348366659e-8,0.001572813307826608,-4.486786800809496e-5,3.5300892636416496e-8,0.0015729655070056204,-4.47191603474519e-5,3.518058646081875e-8,0.0015730384980441499,-4.459776227937817e-5,3.5083578249073555e-8,0.0015730502214990328,-4.4551776967474605e-5,3.504702004926623e-8,0.0015730436787471955,-4.461436338745037e-5,3.5095992048822466e-8,0.0015730749295945277,-4.478695231412046e-5,3.5230609633398364e-8,0.00157319126570817,-4.5034672737442647e-5,3.542266299781257e-8,0.0015734115792861226,-4.529940702276995e-5,3.562602881073632e-8,0.0015737208148722149,-4.552319788898638e-5,3.5795178558746185e-8,0.0015740799139331147,-4.5667994072365434e-5,3.590075376760617e-8,0.0015744426094396393,-4.572297761098429e-5,3.593523410445762e-8,0.0015747694654922382,-4.570060260613509e-5,3.5909545233455296e-8,0.0015750350883362262,-4.56275210357777e-5,3.584556214181634e-8,0.0015752294134122743,-4.5535604842148e-5,3.576877953266378e-8,0.0015753556604648073,-4.545534529408837e-5,3.5703062165524755e-8,0.0015754271119554817,-4.541175214597163e-5,3.566756900441209e-8,0.0015754637850900197,-4.5422021566715475e-5,3.567516845886349e-8,0.0015754892419881964,-4.549435685857388e-5,3.5731726192643936e-8,0.0015755275323007985,-4.562767745693644e-5,3.5835969133508226e-8,0.0015756002822981585,-4.581213815904196e-5,3.597985887669808e-8,0.0015757240290649212,-4.603051129355547e-5,3.6149580268519345e-8,0.0015759080778055216,-4.626046736804536e-5,3.632726928230143e-8,0.0015761532032229398,-4.6477532670966515e-5,3.6493374497356665e-8,0.0015764513190264005,-4.66583682351069e-5,3.662937540080888e-8,0.0015767861221216862,-4.6784116146357104e-5,3.67205887315865e-8,0.0015771347357232419,-4.6843579857850895e-5,3.6758772560147956e-8,0.0015774703483009739,-4.683599304438294e-5,3.67442426941251e-8,0.0015777659552356682,-4.677317302149219e-5,3.66873186351272e-8,0.0015779995237324785,-4.668049190430199e-5,3.660873387655922e-8,0.0015781605555831091,-4.659528839149842e-5,3.6538079166891776e-8,0.0015782567852510353,-4.656091594072024e-5,3.650901070819981e-8,0.0015783179633283798,-4.6615418475760236e-5,3.655049543919046e-8,0.0015783922903835324,-4.677665068892878e-5,3.667544840847755e-8,0.0015785325756434202,-4.703036852583066e-5,3.687171431896692e-8,0.0015787756427616659,-4.733035159097787e-5,3.7102367094230025e-8,0.0015791259181678027,-4.761430923312568e-5,3.731827295238525e-8,0.0015795538411506713,-4.7828037828527396e-5,3.747709330858676e-8,0.0015800096969891477,-4.7943878769038486E-05,3.7557792145692596e-8,0.0015804431624417705,-4.796481847401571e-5,3.756375094216574e-8,0.0015808178057632656,-4.791635491291735e-5,3.7516101368887467e-8,0.0015811164141571583,-4.783405291768669e-5,3.744360223405161e-8,0.0015813392677104443,-4.775314048922322e-5,3.737423693485045e-8,0.0015814993203580124,-4.7702326404354844e-5,3.733035174588052e-8,0.0015816171643790661,-4.7701193814970105e-5,3.7326791516613286e-8,0.0015817169630395575,-4.775965776778595e-5,3.737071389079256e-8,0.001581823347515752,-4.787832470052812e-5,3.7462041637598934e-8,0.0015819588828547596,-4.8049258257063996e-5,3.7594106726625155e-8,0.0015821417963573898,-4.8257082895207296e-5,3.775446258471748e-8,0.0015823838479101892,-4.848060164321304e-5,3.792608585212836e-8,0.001582688504544025,-4.869520808633535e-5,3.8089269531459865e-8,0.0015830498625370153,-4.887615170356731e-5,3.822428825087552e-8,0.0015834527637300596,-4.9002351733972964e-5,3.8314560752223585e-8,0.0015838743628422021,-4.906026034512833e-5,3.834982706901485e-8,0.001584287221216587,-4.904715037019271e-5,3.832875105474419e-8,0.001584663741938823,-4.897310145628491e-5,3.826032241557493e-8,0.001584981463061841,-4.8861079857009655e-5,3.8163607031293117e-8,0.0015852285820703014,-4.874466991235223e-5,3.8065608345197424e-8,0.0015854088600154176,-4.8662962215500585e-5,3.7997004979177486e-8,0.0015855444217866606,-4.86522846509656e-5,3.798563784368472e-8,0.001585674261819128,-4.8735533803462465e-5,3.804836085608511e-8,0.001585846375312292,-4.891189807186035e-5,3.818334234181005e-8,0.00158610348310477,-4.9151982596995845e-5,3.836657757562266e-8,0.001586466654834368,-4.9403489989380824e-5,3.8556531405909456e-8,0.0015869251102463237,-4.960807810621859e-5,3.870740581132169e-8,0.0015874391429179613,-4.9722343633764594e-5,3.8785587350351096e-8,0.0015879553631793688,-4.973190214442801e-5,3.878064452942808e-8,0.001588425577199708,-4.9652024693980827e-5,3.870567071163837e-8,0.00158881977381429,-4.951725979120483e-5,3.8588846273972866e-8,0.0015891295065786543,-4.936775952074638e-5,3.84623889278333e-8,0.001589364066660281,-4.9238715531157035e-5,3.8354092314337146e-8,0.001589543909685928,-4.9154994199223596e-5,3.8283168581558065e-8,0.0015896945618050432,-4.9129902713118106e-5,3.825948659678869e-8,0.0015898422153512498,-4.916611627099987e-5,3.8284520145138256e-8,0.001590010859028341,-4.925727610695112e-5,3.8352726691160195e-8,0.0015902202966968217,-4.938958761833569e-5,3.845280876708773e-8,0.0015904844846205953,-4.954336749390981e-5,3.8568874325898195e-8,0.0015908099083882816,-4.969485381752708e-5,3.868182932013065e-8,0.0015911941068452644,-4.98187279964764e-5,3.8771413773902485e-8,0.0015916248545581027,-4.989160905264646e-5,3.881908380631811e-8,0.0015920807276100831,-4.9896318601345885e-5,3.881152013111638e-8,0.0015925336582621405,-4.982618528736371e-5,3.874409592893164e-8,0.0015929536328127007,-4.9688213379708714e-5,3.862330576383604e-8,0.0015933149629505758,-4.950379940089145e-5,3.846710078351864e-8,0.001593602808933612,-4.930610263244153e-5,3.830248200720968e-8,0.0015938182399501703,-4.913404445176729e-5,3.8160453318297506e-8,0.0015939802243672306,-4.902380951458289e-5,3.806916042959481e-8,0.0015941233988982489,-4.899946750049259e-5,3.8046581250505863e-8,0.0015942911880484664,-4.906498251129774e-5,3.80945375169188e-8,0.0015945249563040758,-4.920032285756388e-5,3.8196040630227036e-8,0.0015948515164234465,-4.9364207196608636e-5,3.8317796980507725e-8,0.001595273159867582,-4.950449066879408e-5,3.841854809931519e-8,0.0015957650230228916,-4.9573895929635576e-5,3.846143646287539e-8,0.0015962822947114133,-4.954513058246872e-5,3.842577890144347e-8,0.0015967748230214939,-4.941856956430488e-5,3.8312929742037596e-8,0.001597202494943064,-4.921934317902047e-5,3.814375061431865e-8,0.0015975448239908775,-4.898645979137916e-5,3.794978155712491e-8,0.0015978022649466863,-4.876005227964857e-5,3.7762998553756675e-8,0.0015979913135114392,-4.85719625681952e-5,3.76083609760703e-8,0.0015981373497028673,-4.84414879329937e-5,3.750059586381275e-8,0.0015982682896983585,-4.837523496803743e-5,3.744429677813117e-8,0.0015984102235238262,-4.8369073369492696e-5,3.743563223650375e-8,0.0015985848577516198,-4.8410619737028296e-5,3.746436079232389e-8,0.0015988080578801715,-4.848147621960483e-5,3.751556089859576e-8,0.0015990887787054714,-4.8559129023742496e-5,3.7571077107145096e-8,0.0015994279675657184,-4.861890144868653e-5,3.761106919377434e-8,0.0015998175105410416,-4.8636534469734454e-5,3.761614354464905e-8,0.0016002397772522405,-4.859177185400766e-5,3.757032802152641e-8,0.0016006686543139628,-4.84728413566226e-5,3.74647259539885e-8,0.0016010729910405593,-4.828097347843213e-5,3.7301095421887124e-8,0.0016014227983081818,-4.8033231546302496e-5,3.709395135898375e-8,0.0016016972164009232,-4.776158920159305e-5,3.686957478771082e-8,0.001601891799677878,-4.750708267512769e-5,3.6661070725469196e-8,0.0016020220967839574,-4.730984733590426e-5,3.65002268054441e-8,0.0016021214376728508,-4.7197895387483466e-5,3.640855159267248e-8,0.0016022329539292035,-4.7178441191331395e-5,3.6390568883612766e-8,0.001602398098868516,-4.723486700987873e-5,3.64317778525816e-8,0.0016026451775172069,-4.7330459524417435e-5,3.6502037536061675e-8,0.0016029812826023223,-4.741790311922242e-5,3.6563402100527594e-8,0.0016033900211863004,-4.7451924030049034e-5,3.658023478305435e-8,0.0016038359142873748,-4.7401493578198037e-5,3.65287527576269e-8,0.0016042743565764664,-4.725778830099e-5,3.6403069368047857e-8,0.0016046639296792753,-4.703526837810497e-5,3.621574128865795e-8,0.0016049768310006606,-4.676579911472799e-5,3.599284252644777e-8,0.0016052041001474093,-4.6488499312397777e-5,3.576575444073776e-8,0.0016053547788864799,-4.623936983449527e-5,3.556292473478258e-8,0.0016054506685802667,-4.604404725371659e-5,3.540424269592429e-8,0.00160551955904301,-4.591491456251917e-5,3.529894528530359e-8,0.0016055893304846428,-4.585176544402924e-5,3.5246319584402404e-8,0.0016056839738281931,-4.584435487657563e-5,3.523780378361235e-8,0.0016058214226180075,-4.58754099005351e-5,3.525934967930275e-8,0.0016060125662822487,-4.5923316964371105e-5,3.5293484731850514e-8,0.0016062607469574757,-4.5964330399595076e-5,3.5321033008763995e-8,0.0016065612721366269,-4.597465556251913e-5,3.5322825752794e-8,0.001606900939181552,-4.5932990607520925e-5,3.528185027009399e-8,0.0016072580949436541,-4.582396800827508e-5,3.518611857277115e-8,0.0016076041773001588,-4.564246758849356e-5,3.503214741997083e-8,0.001607907835484071,-4.539791130326102e-5,3.482829369055841e-8,0.001608142149154005,-4.511646354493401e-5,3.4596304332457856e-8,0.0016082937279128775,-4.483839603063741e-5,3.4368956580540236e-8,0.001608370164011681,-4.460905850485839e-5,3.418262319337986e-8,0.0016084013367679887,-4.4465215778220584e-5,3.4066244784300986e-8,0.0016084321421592992,-4.442209614898366e-5,3.4031040378216796e-8,0.0016085087032214472,-4.4467328910789975e-5,3.406590890538271e-8,0.001608663854204168,-4.4564751128790306e-5,3.414084287148784e-8,0.0016089078261996121,-4.466603533873435e-5,3.4216585652257157e-8,0.0016092268749752002,-4.472491235101269e-5,3.425621097733665e-8,0.0016095888815234746,-4.470896660568734e-5,3.4234524970492415e-8,0.00160995294459917,-4.46061700180591e-5,3.414304169545714e-8,0.0016102797685153603,-4.442554150736995e-5,3.39901449867369e-8,0.001610540291413511,-4.41928249660299e-5,3.379729090404697e-8,0.001610720877149768,-4.3942959524330366e-5,3.3592785051752095e-8,0.0016108243718107255,-4.3711535533740247e-5,3.340493987008991e-8,0.0016108673896750982,-4.352740556905542e-5,3.325631883018611e-8,0.0016108751528596623,-4.340803798367828e-5,3.31602500419108e-8,0.0016108756639389974,-4.3358117340029234e-5,3.31199083561361e-8,0.00161089471982018,-4.33708154841172e-5,3.312942713946964e-8,0.0016109525410755215,-4.34306101333567e-5,3.317612870807587e-8,0.0016110620470242626,-4.351655218140907e-5,3.3243045504261954e-8,0.001611228317562383,-4.360524372648092e-5,3.331122931252226e-8,0.0016114486396584151,-4.367330914275547e-5,3.336174083792286e-8,0.0016117127150576606,-4.3699607289291936e-5,3.33775293772246e-8,0.0016120029665654158,-4.366764384768521e-5,3.3345510827283086e-8,0.0016122953248352881,-4.35685848202546e-5,3.3259070099345036e-8,0.0016125613483437497,-4.340490324202378e-5,3.312093756709973e-8,0.0016127727551766623,-4.319382193216696e-5,3.294576076085041e-8,0.0016129088996316033,-4.296843215561775e-5,3.276074107332174e-8,0.0016129659137071207,-4.277350269527232e-5,3.260204841704383e-8,0.0016129634518711477,-4.2654123502679954e-5,3.250560511019986e-8,0.0016129434192342419,-4.263951160928507e-5,3.249413087936494e-8,0.0016129578689934336,-4.272950726670111e-5,3.25664702196115e-8,0.001613050232896208,-4.2892278302879625e-5,3.2696007974918103e-8,0.0016132395138366183,-4.307566567224347e-5,3.2840080832235315e-8,0.0016135153781361821,-4.3225967007183096e-5,3.295532521363271e-8,0.0016138447598283675,-4.330446141592195e-5,3.3011068605873004e-8,0.0016141845061787268,-4.329558915141256e-5,3.299579503566333e-8,0.0016144937858859182,-4.320654916003372e-5,3.29165093334752e-8,0.0016147426836319956,-4.3061418898431364e-5,3.2793617549553344e-8,0.0016149162538619413,-4.28932148940195e-5,3.2654235700933185e-8,0.0016150148382885333,-4.273622151749938e-5,3.252591778532962e-8,0.0016150517857130536,-4.261972946654225e-5,3.243173477682972e-8,0.001615049514803641,-4.256367933918242e-5,3.238701919898679e-8,0.0016150347633862986,-4.2576490174574447e-5,3.239787068664833e-8,0.0016150339039934956,-4.265505690214593e-5,3.24613058418649e-8,0.0016150690590622733,-4.278649690659109e-5,3.2566675877575025e-8,0.0016151554483356746,-4.2951022505443604e-5,3.269788817933618e-8,0.0016153001048231429,-4.312527285417708e-5,3.283598386574173e-8,0.0016155017602802555,-4.328548587995333e-5,3.2961656880308e-8,0.0016157514557302796,-4.3410193344149555e-5,3.305749480030836e-8,0.0016160335151886938,-4.348253336100209e-5,3.310998203842222e-8,0.0016163267962227231,-4.3492450229067064e-5,3.311139396130571e-8,0.001616606420595729,-4.343902077762299e-5,3.306167660919614e-8,0.001616846570836147,-4.3332918110579625e-5,3.297027424956425e-8,0.0016170251774682734,-4.319829401359851e-5,3.285736904569684e-8,0.0016171308087405997,-4.307222907662207e-5,3.2753160720529384e-8,0.0016171704476762414,-4.299915965162309e-5,3.2693234113441636e-8,0.0016171742841552047,-4.301865193973153e-5,3.2708769773927315e-8,0.0016171918923307148,-4.314894035091985e-5,3.281350053431754e-8,0.0016172768691222427,-4.337450691395369e-5,3.299396166424684e-8,0.0016174652144145727,-4.364756211844907e-5,3.321089173978478e-8,0.0016177597932134746,-4.390561146011057e-5,3.341354613711286e-8,0.0016181304852361284,-4.4095543629212986e-5,3.3559243265705895e-8,0.0016185284692897027,-4.4190547319258514e-5,3.362705585213057e-8,0.0016189045522376445,-4.4193243891010715e-5,3.362020601659291e-8,0.0016192223969067512,-4.412817824935237e-5,3.355967969498163e-8,0.0016194638193470891,-4.403063195720452e-5,3.34748138358053e-8,0.0016196280163832983,-4.393679585500097e-5,3.339511192107193e-8,0.0016197277267549035,-4.3877154423368346e-5,3.334489133236136e-8,0.0016197845593948158,-4.387287847418416e-5,3.334056960624522e-8,0.0016198245204375643,-4.3934319125600074e-5,3.3389732573910446e-8,0.0016198739737394417,-4.4060948688515964e-5,3.3491313790702704e-8,0.001619956137050907,-4.424248547766236e-5,3.3636593203828094e-8,0.0016200882954145463,-4.4460987523551896e-5,3.381084517949932e-8,0.0016202798937417601,-4.469366279624242e-5,3.399550450501883e-8,0.0016205316675254457,-4.4916122131234496e-5,3.417072218106146e-8,0.0016208358841783572,-4.51056635939364e-5,3.431804144775011e-8,0.0016211775123474187,-4.524417861154815e-5,3.442285758382958e-8,0.0016215360341788234,-4.532053562216261e-5,3.447647579529873e-8,0.0016218877589150979,-4.5332465127465866e-5,3.4477688314315185e-8,0.0016222086413283134,-4.528794941479019e-5,3.4433800071019065e-8,0.0016224777898770169,-4.520602795248432e-5,3.436102856785716e-8,0.0016226820080681198,-4.511649275684907e-5,3.428394416218811e-8,0.0016228212897336288,-4.505716598228851e-5,3.423303906504118e-8,0.0016229139005976808,-4.50670885186496e-5,3.423920259833186e-8,0.0016229978830992289,-4.51749217202737e-5,3.432456868826437e-8,0.0016231246866747196,-4.538503437297744e-5,3.449162408965321e-8,0.0016233428870291516,-4.566853319778398e-5,3.4716252957965794e-8,0.0016236772248806965,-4.596812991238768e-5,3.495178509204106e-8,0.0016241152647686152,-4.621869465816446e-5,3.514559949367053e-8,0.0016246116056889723,-4.637312377459764e-5,3.526003661180751e-8,0.0016251072872445914,-4.6418152194176277e-5,3.5285198490338464e-8,0.0016255516901675028,-4.637296697358738e-5,3.523771443245092e-8,0.0016259155653828902,-4.627592173555477e-5,3.5149685697300395e-8,0.0016261928281600965,-4.616943668607092e-5,3.5056106184870745e-8,0.0016263953747431522,-4.608946050777786e-5,3.4986134383754507e-8,0.00162654592076792,-4.606055522365073e-5,3.4959174040392114e-8,0.0016266717530924076,-4.6094961601108544e-5,3.498436583192719e-8,0.0016268002162611959,-4.619362578856872e-5,3.506170277704274e-8,0.0016269555762756986,-4.6347898809298577e-5,3.5183591772346576e-8,0.0016271567027249208,-4.654151467710764e-5,3.533649211716943e-8,0.0016274153179251607,-4.675286847043376e-5,3.550269075582101e-8,0.0016277348011426761,-4.695766887346226e-5,3.566236234788382e-8,0.0016281097039318963,-4.7132008983412574e-5,3.5796030279421156e-8,0.0016285262644494334,-4.7255678611228e-5,3.5887315314142226e-8,0.001628964073625187,-4.731526564371127e-5,3.5925567937765023E-08,0.0016293987695045343,-4.7306594472402196e-5,3.5907931482636357e-8,0.0016298055166128098,-4.723617482978707e-5,3.5840485560798704e-8,0.0016301629750232944,-4.7121376003895105e-5,3.573820180050115e-8,0.0016304574112304933,-4.698912835410786e-5,3.562359354313474e-8,0.001630686636381212,-4.687296006046646e-5,3.552402309108488e-8,0.001630863266571223,-4.6807921698255846e-5,3.546744809793738e-8,0.001631016074302961,-4.6822961021669483e-5,3.5476346222796364e-8,0.0016311873490471736,-4.6931285427303824e-5,3.556023149782128e-8,0.0016314241196807519,-4.712134705140385e-5,3.570874980570606e-8,0.0016317631244090534,-4.7353656267366736e-5,3.5889370924150126e-8,0.0016322143049490748,-4.756904084464057e-5,3.605411987293246e-8,0.0016327523237028758,-4.770869469055887e-5,3.615570802256036e-8,0.001633323721960312,-4.7737093003807625e-5,3.616600609540491e-8,0.0016338673630050457,-4.7654512699828896e-5,3.608614967055138e-8,0.0016343363161102794,-4.7492623882838964e-5,3.59428498486487e-8,0.0016347097760828822,-4.729839554612501e-5,3.577507367476015e-8,0.0016349924051370127,-4.7117130386448616e-5,3.5619987353530545e-8,0.0016352061343948639,-4.6981902350859326e-5,3.550426387925348e-8,0.0016353807083681227,-4.691028273741784e-5,3.544154910868567e-8,0.0016355464804455415,-4.690570628738172e-5,3.543383998937961e-8,0.001635730112170018,-4.696057989449839e-5,3.5474262687520425e-8,0.0016359523601496132,-4.705941012943231e-5,3.5549738432914185e-8,0.0016362269041772656,-4.718145036852111e-5,3.56431208201011e-8,0.0016365595879771274,-4.730304536267612e-5,3.5735016865504467e-8,0.0016369478987237219,-4.7400035126582016e-5,3.58056778292684e-8,0.0016373808483354118,-4.7450543227840547e-5,3.583728050603426e-8,0.0016378397017732427,-4.7438197284311285e-5,3.581663456998011e-8,0.0016383000265438497,-4.7355354305080354e-5,3.573790790644766e-8,0.001638735210162438,-4.720557229499285e-5,3.5604668453241686e-8,0.0016391211394910926,-4.700451726643738e-5,3.5430520082254106e-8,0.001639441306452008,-4.6778640180967995e-5,3.5237790208829276e-8,0.0016396912690668532,-4.6561377647454084e-5,3.5054142350092676e-8,0.0016398813658379573,-4.63872399230719e-5,3.490753406266736e-8,0.0016400368292994823,-4.628458200577974e-5,3.4820292858860436e-8,0.0016401946504560447,-4.6268117996810935e-5,3.480322538106792e-8,0.0016403967479677747,-4.6332728578918845e-5,3.485095674241419e-8,0.001640679685853359,-4.645083249127904e-5,3.494018708827335e-8,0.0016410627568417529,-4.657595311703952e-5,3.5032828146860476e-8,0.0016415385136823188,-4.665404102506928e-5,3.5085209016852697e-8,0.0016420712361589218,-4.6640593747802424e-5,3.506183028304087e-8,0.0016426066758982037,-4.651680204060536e-5,3.49483030632206e-8,0.0016430902029990438,-4.6296213477060036e-5,3.4756616314912035e-8,0.0016434846325752775,-4.601807762842053e-5,3.451956176891535e-8,0.0016437792010674768,-4.573164001443794e-5,3.4277753576294015e-8,0.0016439873944463735,-4.5480182565328244e-5,3.406648234300473e-8,0.0016441377649539473,-4.5291435015766347e-5,3.390791520498886e-8,0.0016442637177816871,-4.517553440841134e-5,3.38096166616314e-8,0.0016443960339398652,-4.512789702654878e-5,3.376713660815342e-8,0.0016445588953631549,-4.5133752929414504e-5,3.3767884966551584e-8,0.0016447684565497988,-4.517231429766106e-5,3.3794572068923304e-8,0.001645032669366525,-4.521994135279829e-5,3.382772789479797e-8,0.0016453514524502528,-4.5252519765481794e-5,3.3847558228796395e-8,0.0016457168505185967,-4.524759349498278e-5,3.38356608525806e-8,0.001646113327512554,-4.51867851078022e-5,3.3777059144320585e-8,0.0016465187233436285,-4.5058731090684236e-5,3.366270182651552e-8,0.0016469065595708819,-4.4862213010709696e-5,3.349209230451183e-8,0.0016472501485759548,-4.460855757214049e-5,3.327522050357837e-8,0.0016475282892311342,-4.43219688174928e-5,3.303267631530774e-8,0.001647731361928809,-4.40365769207798e-5,3.279298525555044e-8,0.0016478658173717641,-4.378990661504161e-5,3.2587010223876336e-8,0.001647955012278325,-4.361395560197095e-5,3.244050743190803e-8,0.0016480353368982224,-4.352634140384957e-5,3.236693816783387e-8,0.0016481481573200063,-4.352430208745986e-5,3.236282743263174e-8,0.0016483294908475749,-4.358362185466893e-5,3.240727442369534e-8,0.001648600066709863,-4.366323577305269e-5,3.2466074614676396e-8,0.0016489585077819739,-4.371486073861877e-5,3.249977289857885e-8,0.0016493799815096145,-4.369565905864213e-5,3.247396466644824e-8,0.0016498216574363398,-4.35805854427313e-5,3.236916312326058e-8,0.0016502342591044501,-4.337016148742985e-5,3.2186868815840264e-8,0.0016505762173780565,-4.309020706568123e-5,3.194909432152713e-8,0.0016508250968513124,-4.278317246005813e-5,3.1691092721698956e-8,0.0016509819009967624,-4.24946924788503e-5,3.1450271221881416e-8,0.0016510674183862332,-4.226105950962592e-5,3.125597438215787e-8,0.0016511135338679924,-4.210202576888828e-5,3.112374663814163e-8,0.0016511538874274358,-4.201993406387043e-5,3.105483497910188e-8,0.0016512170388640625,-4.200324771532353e-5,3.1039256218679945e-8,0.0016513230147448136,-4.2031673250908966e-5,3.106005739207479e-8,0.0016514824899899535,-4.2080862105879425e-5,3.109711887696447e-8,0.0016516973653265966,-4.212590433392133e-5,3.1129923067476226e-8,0.001651961729402234,-4.214373526750093e-5,3.113947244255304e-8,0.001652262709403183,-4.2115034434587586e-5,3.11098777670916e-8,0.001652581282236162,-4.20262355409554e-5,3.103010807540562e-8,0.001652893563089459,-4.1871968498026697e-5,3.089609413234407e-8,0.0016531733119630543,-4.165773999853627e-5,3.071294747399099e-8,0.001653396304072018,-4.1401950749318465e-5,3.0496512296258735e-8,0.0016535465337220673,-4.113559677284715e-5,3.027291157231968e-8,0.00165362283822673,-4.08978653952933e-5,3.007468972951524e-8,0.001653643051829214,-4.072709688518788e-5,2.993320892854408e-8,0.0016536425379715574,-4.064915069866908e-5,2.986905479463843e-8,0.0016536658656256423,-4.0667642322225216e-5,2.988415848613424e-8,0.0016537538623654171,-4.076077998128367e-5,2.995949305378407e-8,0.0016539310239152949,-4.088682206365838e-5,3.0059909699632935e-8,0.0016541982039326847,-4.099610396545309e-5,3.0144299811144e-8,0.0016545328263749025,-4.1044953793367646e-5,3.0177129842224954e-8,0.0016548957129889686,-4.100692229408898e-5,3.013755445295461e-8,0.0016552417765755723,-4.0878540058739154e-5,3.0023865014476645e-8,0.0016555313813681053,-4.0678744800547455e-5,2.985267628556814e-8,0.0016557394578348126,-4.0442706059349526e-5,2.965356616713717e-8,0.0016558602205119905,-4.0212091256584694e-5,2.9460936650144332e-8,0.0016559066064064827,-4.002467175107929e-5,2.9305507808049016e-8,0.0016559051411805651,-3.990618815504244e-5,2.9207810627581598e-8,0.0016558883208421219,-3.986641734804314e-5,2.9175190181454984e-8,0.0016558871094012825,-3.989970995789232e-5,2.920244204328383e-8,0.0016559255239323612,-3.9988717521732396e-5,2.9274958922300416e-8,0.0016560179934640134,-4.010939295998521e-5,2.9372803922459204e-8,0.0016561690600313398,-4.023567907279301e-5,2.947446435780696e-8,0.0016563744709726966,-4.0343077329543915e-5,2.9559704687070583e-8,0.0016566227473716701,-4.04110569171678e-5,2.9611550177314757e-8,0.0016568967011817656,-4.0424765170366424e-5,2.9617783814663727e-8,0.0016571748725286567,-4.03766005139679e-5,2.9572361572399208e-8,0.001657433277921752,-4.026798280415287e-5,2.9476932544257488e-8,0.0016576481341211992,-4.011122108290574e-5,2.9342315929308953e-8,0.0016578002161897344,-3.993068140079735e-5,2.918927620055278e-8,0.0016578808882250792,-3.97616016784514e-5,2.904730413787855e-8,0.0016578983842147038,-3.964455859766971e-5,2.894986463588264e-8,0.0016578810457861806,-3.961480375790006e-5,2.8925550308629004e-8,0.0016578735047228827,-3.968893422226867e-5,2.8987194852995764e-8,0.0016579242628156493,-3.985510074322592e-5,2.9124022121367424e-8,0.0016580686098759247,-4.007348282468502e-5,2.9302307407495906e-8,0.001658315212483153,-4.028875236110224e-5,2.9475907260284677e-8,0.0016586433615687947,-4.044883713349159e-5,2.9601907087753384e-8,0.0016590113970561915,-4.0520869931719907e-5,2.9653810852602028e-8,0.0016593709065407672,-4.049825768358674e-5,2.9627222749183985e-8,0.0016596801558158162,-4.039855087642855e-5,2.953777937619335e-8,0.0016599128451770951,-4.025546688761349e-5,2.9414208659192474e-8,0.001660061372670357,-4.010894002692455e-5,2.928985879812469e-8,0.0016601355508499426,-3.999598249842553e-5,2.9195098085642385e-8,0.0016601582578794414,-3.994386969418339e-5,2.9151836997324146e-8,0.0016601594601349523,-3.9966285990856224e-5,2.9170608546724392E-08,0.0016601699239930832,-4.006254573710791e-5,2.9250175101477995e-8,0.0016602158041532625,-4.021951416375853e-5,2.9379253301896273e-8,0.0016603149537395255,-4.041536412718664e-5,2.9539614735345927e-8,0.00166047527124585,-4.062408817363606e-5,2.970971399095024e-8,0.0016606948895783432,-4.081978853524619e-5,2.986812443718438e-8,0.0016609636296508186,-4.098007900947471e-5,2.9996308350286483e-8,0.0016612650174455234,-4.108841983012459e-5,3.0080601450579956e-8,0.0016615783991599132,-4.113565076063209e-5,3.01135932639863e-8,0.00166188105966781,-4.11211016170598e-5,3.009513534055636e-8,0.001662150531071203,-4.105352714493535e-5,3.0033097660775586e-8,0.0016623675379770072,-4.095183539624763e-5,2.994381510048298e-8,0.0016625201033940193,-4.0844962473662907e-5,2.98517361833591e-8,0.0016626087554811723,-4.0769446539057265e-5,2.9787188477707118e-8,0.0016626514160071732,-4.0762994359918156e-5,2.9780965991072815e-8,0.0016626848298044925,-4.0853432310140516e-5,2.9855291758414986e-8,0.0016627585180696237,-4.104557297078488e-5,3.001319945286181e-8,0.0016629196343020275,-4.1312810810254054e-5,3.023184378109478e-8,0.0016631936622173485,-4.1601319751516236e-5,3.046615302114082e-8,0.0016635717482644979,-4.1848343784879263e-5,3.0664058183648755e-8,0.0016640132555107746,-4.200576477773202e-5,3.0786057280139574e-8,0.0016644620386205267,-4.205590491481198e-5,3.0818301607812385e-8,0.001664866364125141,-4.201279974388258e-5,3.0773509768777413e-8,0.001665192705554029,-4.1912072651471524e-5,3.068227045198648e-8,0.0016654301308830564,-4.1797159168452974e-5,3.0581274453788686e-8,0.0016655875286445104,-4.170783384293948e-5,3.050359333944092e-8,0.001665687465604892,-4.167319984191924e-5,3.0472896827926416e-8,0.0016657594905155892,-4.170874776273719e-5,3.050124412626773e-8,0.0016658342301060726,-4.181625386895793e-5,3.058929521132896e-8,0.0016659386770511526,-4.1985505643195065e-5,3.0727965256502515e-8,0.0016660927790692734,-4.2197234556937535e-5,3.0900934221248055e-8,0.001666307394327278,-4.242676039351328e-5,3.108761361993264e-8,0.0016665836116936171,-4.2647885737481854e-5,3.1266263776837525e-8,0.0016669133750296294,-4.2836615240290816e-5,3.141699700450582e-8,0.0016672812040082632,-4.29742538784887e-5,3.1524353127941986e-8,0.001667666583854231,-4.3049585079543835e-5,3.157918783389978e-8,0.0016680466219054927,-4.306016694156729e-5,3.1579840829446867e-8,0.0016683988209936053,-4.3012919060955386e-5,3.153264421759085e-8,0.0016687039684606657,-4.2924075892586436e-5,3.145177637443578e-8,0.001668949248977301,-4.281847186208641e-5,3.135844372913255e-8,0.001669131786259909,-4.272775819299064e-5,3.127914542178871e-8,0.0016692623804481766,-4.268653070428464e-5,3.1242302733313314e-8,0.0016693680627836978,-4.272526972232355e-5,3.1272440060728026e-8,0.0016694908319522278,-4.286013130087455e-5,3.138195636848311e-8,0.0016696795079151228,-4.3082236687797025e-5,3.156257050561017e-8,0.0016699738397906113,-4.335263606913009e-5,3.178138863954782e-8,0.0016703860640257925,-4.3610062290433165e-5,3.1987399692878435e-8,0.0016708909850968417,-4.3792311883293744e-5,3.212916881254575e-8,0.0016714333005318656,-4.3861116917503015e-5,3.217546090751692e-8,0.0016719492822700806,-4.3815726814167675e-5,3.2126524444803504e-8,0.0016723897475633752,-4.368843070089595e-5,3.201025739742718e-8,0.0016727324810957033,-4.352796787840965e-5,3.1868119479992646e-8,0.0016729818078562674,-4.338203342372647e-5,3.174024705968066e-8,0.001673160510358554,-4.3286058936851166e-5,3.165596355869807e-8,0.0016733001997954202,-4.325918304672302e-5,3.1630534790235667e-8,0.0016734335563792723,-4.3305040518058526e-5,3.166611119385737e-8,0.0016735892269826305,-4.3414715646800075e-5,3.1754482304429493e-8,0.0016737888324904195,-4.357023755789901e-5,3.188016234879414e-8,0.0016740453537005702,-4.3748057320064645e-5,3.202330368510447e-8,0.0016743624861162748,-4.392241829557162e-5,3.216241408654458e-8,0.0016747348092937828,-4.406860454410632e-5,3.227695616684352e-8,0.0016751487805059524,-4.416603666815915e-5,3.234987839857888e-8,0.001675584637718124,-4.420100590072595e-5,3.236992864406305e-8,0.0016760191120139118,-4.4168658691226686e-5,3.23333885762874e-8,0.0016764286255676625,-4.407397693962139e-5,3.224493873197347e-8,0.0016767926831136699,-4.393169599546051e-5,3.211753662941352e-8,0.001677097237930815,-4.3765093105344423e-5,3.197123217472216e-8,0.00167733777658621,-4.360358105039846e-5,3.183091478114156e-8,0.001677521869398556,-4.347902774846859e-5,3.172303510741116e-8,0.0016776707408900074,-4.342049118287758e-5,3.167116295241453e-8,0.0016778187422698135,-4.3447130391136005e-5,3.1690241873688606e-8,0.0016780089503785252,-4.3560098509420256e-5,3.178016652122048e-8,0.0016782833720448765,-4.373614563117936e-5,3.192080369790514e-8,0.0016786683666438333,-4.3927655024510755e-5,3.207221484054373e-8,0.001679160369115784,-4.407367191046424e-5,3.2183808817329206e-8,0.0016797209875307913,-4.412114009758808e-5,3.221188471697183e-8,0.0016802880403294148,-4.404672142738793e-5,3.213771971384632e-8,0.001680798773740542,-4.386597338792192e-5,3.197519004817064e-8,0.0016812121713359505,-4.362439078443936e-5,3.176318558267004e-8,0.0016815186777889915,-4.337739128303645e-5,3.1548644038694827e-8,0.0016817358173011794,-4.317163234212843e-5,3.137068706839119e-8,0.0016818964774662018,-4.303518866881324e-5,3.125235326029229e-8,0.0016820373053456571,-4.2976515779093504e-5,3.1199916976096325e-8,0.0016821908517579908,-4.298835334932385e-5,3.120645643391533e-8,0.001682381643870257,-4.305295001771544e-5,3.125647495228362e-8,0.0016826248641123465,-4.314669659029766e-5,3.1329875743603594e-8,0.0016829262935964223,-4.3243765750394774e-5,3.1404959032322505e-8,0.0016832827993444842,-4.3319058823132525e-5,3.1460773886099394e-8,0.0016836831808576592,-4.335081474193989e-5,3.147921387142313e-8,0.0016841094761317773,-4.332309858073908e-5,3.144709006843145e-8,0.0016845389965708768,-4.322812581928537e-5,3.1358136502702837e-8,0.0016849472827916928,-4.30680097516396e-5,3.121454317459761e-8,0.001685311817324549,-4.28553785051464e-5,3.102747616737498e-8,0.0016856160259362443,-4.2612465496661675e-5,3.081620600067579e-8,0.0016858529647612876,-4.2368472572295754e-5,3.060568908899294e-8,0.0016860279929869306,-4.2155252212118004e-5,3.042272064814904e-8,0.0016861597397253318,-4.2001707138160697e-5,3.029110352696416e-8,0.001686278802546357,-4.192753075558542e-5,3.0226450956112963e-8,0.0016864236511896307,-4.1937096150845514e-5,3.023131644925384e-8,0.0016866333005143353,-4.20148809990313e-5,3.029172471873377e-8,0.0016869370383114897,-4.212468985170035e-5,3.0376837396555156e-8,0.0016873432300061099,-4.221528826700933e-5,3.0443795692792346e-8,0.0016878316433975797,-4.223370069387507e-5,3.044875659726567e-8,0.0016883549945588567,-4.214339067565662e-5,3.0361907947096335e-8,0.0016888524992501178,-4.193939125212146e-5,3.017996755366323e-8,0.0016892708942925403,-4.165129888299081e-5,2.992858118803242e-8,0.0016895823148465297,-4.1331399559831654e-5,2.9652240492607542e-8,0.0016897900659125485,-4.103474076847829e-5,2.9397395175287495e-8,0.0016899216625505006,-4.080203475990938e-5,2.919799465346154e-8,0.0016900157054978312,-4.0652031392961096e-5,2.906915313908238e-8,0.0016901099208097574,-4.058288462987776e-5,2.900853004866035e-8,0.0016902339270298944,-4.057817378667731e-5,2.900165126974593e-8,0.0016904065626526063,-4.061354355146046e-5,2.9027644312851774e-8,0.0016906360051758417,-4.0661950119559325e-5,2.9063648467584324e-8,0.0016909209995482196,-4.069723028481099e-5,2.9087710885649258e-8,0.0016912522654108416,-4.069653884596306e-5,2.9080721860103752e-8,0.0016916138646757722,-4.064230977992161e-5,2.9028017183053914e-8,0.0016919847467131485,-4.052416230559773e-5,2.8921020015667242e-8,0.0016923408945919195,-4.034078146507427e-5,2.8758904768726176e-8,0.0016926584456100585,-4.0101338254094135e-5,2.854984370404633e-8,0.0016929177886920088,-3.98256830559316e-5,2.8311126828899853e-8,0.001693108077881154,-3.954252987433632e-5,2.8067479641023334e-8,0.0016932310746483276,-3.928519728252996e-5,2.7847258747180767e-8,0.0016933029691601435,-3.908519792267514e-5,2.767686433700739e-8,0.0016933530634665743,-3.896487647791898e-5,2.7574483226122663e-8,0.0016934189419301243,-3.893091195901987e-5,2.7544749748504323e-8,0.0016935386906464923,-3.897054727601237e-5,2.7575867805514548e-8,0.001693741560057379,-3.905203356829756e-5,2.7640332995878002e-8,0.0016940391412425884,-3.9130122676386634e-5,2.7699808677760945e-8,0.0016944196388182435,-3.9156405028759944e-5,2.7713881316001143e-8,0.0016948479443695268,-3.909270277009998e-5,2.7651188701418565e-8,0.0016952732925359264,-3.892369137957591e-5,2.749979593321849e-8,0.0016956435737868081,-3.8663481150373246e-5,2.7272496371780773e-8,0.001695921508217519,-3.835205250275875e-5,2.7003629854952092e-8,0.0016960956761315402,-3.804202367397545e-5,2.67378143191e-8,0.0016961815319577094,-3.778160361537539e-5,2.6515529524935576e-8,0.001696213032473906,-3.7601416121365983e-5,2.6362069074866936e-8,0.0016962301457196613,-3.750973613700963e-5,2.628370233701135e-8,0.0016962680770975457,-3.749551816840239e-5,2.627045669394839e-8,0.0016963512376621233,-3.753538910232288e-5,2.63021853253086e-8,0.0016964917453452192,-3.7600818583413475e-5,2.635465438290942e-8,0.001696690651419292,-3.766350660714986e-5,2.6404007688425848e-8,0.001696940137771745,-3.769874102950349e-5,2.642947829630893e-8,0.0016972256658882062,-3.7687335396604675e-5,2.6414948818137022e-8,0.0016975277902204365,-3.761694740849289e-5,2.635007890531258e-8,0.001697823895555182,-3.7483365373189244e-5,2.6231474474216885e-8,0.0016980904064073249,-3.729186542931282e-5,2.6063916854335785e-8,0.0016983059629982868,-3.705818431813839e-5,2.5861193564983613e-8,0.00169845567523588,-3.6808209557159376e-5,2.5645733638452276e-8,0.0016985358748413822,-3.6575286342219624e-5,2.544614117888997e-8,0.0016985578725676185,-3.6394393189292205e-5,2.5292069524213555e-8,0.0016985486004877865,-3.629367901585675e-5,2.5206946956193076e-8,0.001698546470920179,-3.628561471787852e-5,2.5200532434859682e-8,0.0016985925376170278,-3.6361141746669543e-5,2.5264171502710526e-8,0.0016987192823167937,-3.648970911878939e-5,2.537113473313952e-8,0.0016989407603901555,-3.66260131869023e-5,2.548261022146134e-8,0.0016992475797464068,-3.672165020583402e-5,2.5557724392811732e-8,0.0016996084606618878,-3.673811638230782e-5,2.5564517650592807e-8,0.001699977956475142,-3.6657310285023185e-5,2.5488638588697726e-8,0.0017003082070326627,-3.648654916289649e-5,2.5337305501061796e-8,0.001700561508238771,-3.625653060246809e-5,2.5137301531646965e-8,0.0017007199892369825,-3.601259358681587e-5,2.492738326789755e-8,0.0017007892677775634,-3.580192599678626e-5,2.474739066190967e-8,0.0017007949978842718,-3.566104751616369e-5,2.462773297309177e-8,0.0017007740285271689,-3.560774970729352e-5,2.4582760104628268e-8,0.001700763881614479,-3.5639540723169225e-5,2.4609678123756305e-8,0.0017007942876682992,-3.5737747088271245e-5,2.4692199666377635e-8,0.0017008827935677405,-3.5874468764077714e-5,2.48064931342209e-8,0.0017010342865269056,-3.601946403066804e-5,2.4926953335125145e-8,0.0017012429683338664,-3.614526778038245e-5,2.503041713192252e-8,0.0017014952046849267,-3.623023427960677e-5,2.5098644185563178e-8,0.001701772238022168,-3.626002631665762e-5,2.5119562344499273e-8,0.0017020524196195597,-3.6228338899696296e-5,2.5087946189913077e-8,0.0017023131682198593,-3.613749747676565e-5,2.500601481098576e-8,0.0017025331952084945,-3.599911636755302e-5,2.488403054979358e-8,0.001702695545569224,-3.583443484893609e-5,2.4740519688495516e-8,0.001702791658995604,-3.567341761960704e-5,2.4601345097724025e-8,0.001702825905263925,-3.5551336305842663e-5,2.449660803475595e-8,0.0017028188818827854,-3.550180632355494e-5,2.4454604213756933e-8,0.001702806735149731,-3.5546798682885895e-5,2.4493348244526906e-8,0.0017028341827005904,-3.5686793861779424e-5,2.4612368548798255e-8,0.0017029417119942861,-3.589622192692521e-5,2.4789084250634145e-8,0.001703151464359933,-3.612826882154989e-5,2.4983140816697334e-8,0.0017034584180842351,-3.632857896050061e-5,2.514822835935455e-8,0.0017038313132765339,-3.645226816286234e-5,2.5246595649292e-8,0.0017042226379164888,-3.647699395454146e-5,2.5260079820686068e-8,0.0017045828447247262,-3.640761249596701e-5,2.5193854756660187e-8,0.0017048733046878682,-3.627237682470769e-5,2.5072903100127402e-8,0.0017050744960167964,-3.611354589471979e-5,2.4933747465570844e-8,0.0017051883610562926,-3.597597816658294e-5,2.4814589910546375e-8,0.0017052354342512147,-3.5896752180398834e-5,2.4746512664333185e-8,0.0017052482576193312,-3.589793749996182e-5,2.4747526264296278e-8,0.001705263072666433,-3.598363726072869e-5,2.482032549880074e-8,0.0017053119227668128,-3.614137236019604e-5,2.4953695706256513e-8,0.0017054169711461474,-3.6346798808851755e-5,2.5126630491637535e-8,0.001705587948875609,-3.656997064057401e-5,2.5313627491764613e-8,0.0017058225445119196,-3.678132058142517e-5,2.548965965479151e-8,0.0017061087821257628,-3.69561651974611e-5,2.563388881603951e-8,0.0017064282269366776,-3.70773600928232e-5,2.5731871018470053e-8,0.0017067591018042412,-3.713639521195745e-5,2.5776518819360373e-8,0.0017070789070781516,-3.71335783856623e-5,2.576833424327725e-8,0.001707366647808429,-3.7077896034809675e-5,2.5715344204894712e-8,0.0017076050669122245,-3.6986775316050295e-5,2.563286430776859e-8,0.0017077833482693745,-3.6885519284883346e-5,2.5542879446377526e-8,0.0017079005422884115,-3.6805662765103294e-5,2.547244983570222e-8,0.0017079692563718653,-3.678101653653675e-5,2.545019000338502e-8,0.0017080179220300188,-3.684031594380135e-5,2.549999137370553e-8,0.0017080887479602191,-3.699691368462634e-5,2.5632392147724558e-8,0.001708228641281455,-3.723898589582162e-5,2.583648649016691e-8,0.0017084735851781347,-3.752657719115359e-5,2.607763848747086e-8,0.0017088326289339622,-3.7800822890985845e-5,2.6305464895935834e-8,0.0017092809717665692,-3.800389880699946e-5,2.6470864658603684e-8,0.001709767617820864,-3.810010719756817e-5,2.6543979991628234e-8,0.0017102337850382358,-3.8086965178193554e-5,2.6523588534275293e-8,0.0017106319934249428,-3.799214504651016e-5,2.6434316445958196e-8,0.0017109375331463164,-3.786074079930412e-5,2.6315481437475767e-8,0.0017111503518974585,-3.774050858751181e-5,2.6208213356204093e-8,0.0017112901426587356,-3.767043065840216e-5,2.6145574168089167e-8,0.001711388473927356,-3.767435097338324e-5,2.6147233879245078e-8,0.0017114807478860903,-3.7759148181293965e-5,2.6218181852708225e-8,0.0017115993915441882,-3.791616629237784e-5,2.6350243451075947e-8,0.0017117688340202747,-3.812478479964005e-5,2.6525321161408846e-8,0.0017120025462314225,-3.8357269218783055e-5,2.671957407701288e-8,0.0017123022368902155,-3.858401705662783e-5,2.690781030939024e-8,0.0017126589667248331,-3.8778319536625255e-5,2.706742096037333e-8,0.0017130556713426438,-3.892000575518932e-5,2.718139609955358e-8,0.0017134704463890348,-3.8997637220543705e-5,2.72401837338603e-8,0.0017138799079658143,-3.900926090925543e-5,2.7242381927571813e-8,0.0017142621560916798,-3.896209930041389e-5,2.719452965369347e-8,0.0017145992769997747,-3.887164408049795e-5,2.7110327165076998e-8,0.0017148795732618073,-3.876038090260755e-5,2.7009443934541433e-8,0.0017150997739135154,-3.8656079592503165e-5,2.691587804537622e-8,0.0017152674011576832,-3.858919935674702e-5,2.6855564023675893e-8,0.001715402930080424,-3.858850645778573e-5,2.68525620088811e-8,0.0017155403030105689,-3.867411814540851e-5,2.6923223505940072e-8,0.001715723354598753,-3.884849496986257e-5,2.706875788258036e-8,0.0017159957908326042,-3.9088518326831626e-5,2.7268754434345864e-8,0.0017163851403779347,-3.9344697300168935e-5,2.748066663980295e-8,0.001716886993958065,-3.955318428218216e-5,2.7650053898035193e-8,0.0017174602847125158,-3.965909042471542e-5,2.773040269966326e-8,0.001718040134972025,-3.963938085916244e-5,2.770265841257851e-8,0.0017185625897166842,-3.9511228867599055e-5,2.758236823583223e-8,0.0017189868062355465,-3.932167724591736e-5,2.7410713552494807e-8,0.001719303790073166,-3.912724285345024e-5,2.7236765021706585e-8,0.0017195315916373054,-3.897569321704473e-5,2.710159348901865e-8,0.0017197039490144403,-3.889639604552238e-5,2.7029929542711243e-8,0.001719859026622647,-3.889874932274322e-5,2.7028998797406246e-8,0.0017200313178398767,-3.897534491821806e-5,2.7091549749431207e-8,0.0017202469671751624,-3.910684938799904e-5,2.7200319928931065e-8,0.001720521602018453,-3.926695176135516e-5,2.7332412797781222e-8,0.001720859794259045,-3.942689817955544e-5,2.7463158757262513e-8,0.001721255728863236,-3.955955466122989e-5,2.756947544016638e-8,0.0017216948873827532,-3.9642868900642176e-5,2.7632707506931933e-8,0.001722156569161592,-3.966254350579579e-5,2.764085344336467e-8,0.0017226170439005363,-3.9613697538888915e-5,2.7590003469533287e-8,0.001723052976870324,-3.9501301872358064e-5,2.7484764624405265e-8,0.0017234446600947672,-3.933941901930363e-5,2.733763268972299e-8,0.001723778754377761,-3.914951517199835e-5,2.7167486552635708e-8,0.0017240504576373702,-3.8958063040786535e-5,2.6997386666773607e-8,0.0017242650711087881,-3.8793531002493264e-5,2.6851810256787167e-8,0.0017244389431611393,-3.868270733259092e-5,2.675337383241879e-8,0.0017245995113033862,-3.864602832841346e-5,2.671885005626151e-8,0.0017247834536315045,-3.8691681327300336e-5,2.6754311849929e-8,0.0017250313802367769,-3.880929377612953e-5,2.6850034141866425e-8,0.001725377842565471,-3.896581169015178e-5,2.697723630726428e-8,0.0017258375470063556,-3.910800396460535e-5,2.7090318371162557e-8,0.0017263930836693708,-3.917572346874251e-5,2.7138107085967308e-8,0.0017269933872087041,-3.912436180795919e-5,2.7082925689746156e-8,0.0017275689865215494,-3.8945638522437385e-5,2.691835379492017e-8,0.0017280585048235183,-3.86727214245852e-5,2.6673635556659343e-8,0.001728431073422244,-3.836534884152783e-5,2.6400818438587404e-8,0.0017286923868734853,-3.808504387510162e-5,2.61532106623058e-8,0.0017288748816655678,-3.787530232705404e-5,2.5968120288942417e-8,0.0017290217154868146,-3.7754199534558863E-05,2.5860493154658515e-8,0.0017291734675064128,-3.771726995413944e-5,2.582562501534354e-8,0.0017293607820238672,-3.7744848247661723E-05,2.584579636728525e-8,0.001729602000315515,-3.780948874960963e-5,2.5896883802857644e-8,0.001729903599395464,-3.788165973355425e-5,2.595331727889163e-8,0.0017302617181777903,-3.7933690493989186e-5,2.5991389794231897e-8,0.0017306640141175572,-3.794259510943676e-5,2.5991547940454676e-8,0.001731091755867424,-3.789224556048095e-5,2.594015958103042e-8,0.001731522255539111,-3.7775051882364856e-5,2.5830937167328825e-8,0.0017319317604426708,-3.7593037290670407e-5,2.5665905426726304e-8,0.0017322987686243735,-3.735795299004614e-5,2.545555029736884e-8,0.0017326074067128012,-3.709011144855787e-5,2.5217806685687195e-8,0.0017328503457029842,-3.6815919057722917e-5,2.4975834819967113e-8,0.001733030801250284,-3.6564297546596944e-5,2.4754770932095832e-8,0.001733163245050693,-3.636230112525841e-5,2.4577788776660804e-8,0.0017332725692263016,-3.6230386059595666e-5,2.446195888578073e-8,0.001733391561335409,-3.6177777041230204e-5,2.4414354594100277e-8,0.0017335564073636222,-3.619837183913728e-5,2.4428778625296542e-8,0.001733799814146551,-3.626816379255833e-5,2.4483858210644657e-8,0.0017341419144584454,-3.634606741287226e-5,2.454398795466479e-8,0.0017345806750870597,-3.638048933612316e-5,2.4565021790145197e-8,0.0017350858869240476,-3.632295309658755e-5,2.4505843202086038e-8,0.0017356024788424108,-3.614624025006184e-5,2.4343764994910206e-8,0.0017360663216553012,-3.585874629062718e-5,2.408675934782713e-8,0.0017364275421104804,-3.550486845228883e-5,2.377374351553505e-8,0.001736668888599713,-3.514850340937432e-5,2.34602712311622e-8,0.001736808661045457,-3.4848567953173e-5,2.3197265336036242e-8,0.001736888544939611,-3.464037865199596e-5,2.301485336433552e-8,0.0017369558513605297,-3.4530440416808935e-5,2.29179595201377e-8,0.001737049707092597,-3.4502354376221574e-5,2.289165624475731e-8,0.0017371947516276504,-3.4526982344086895e-5,2.2910199010581445e-8,0.0017374008073448293,-3.4571512886728264e-5,2.2944984052831473e-8,0.001737665467048844,-3.460545560147143e-5,2.2969695297045837e-8,0.001737977290689824,-3.460390307791772e-5,2.296299541437974e-8,0.0017383186141002541,-3.454918032334136e-5,2.290982677063709e-8,0.0017386679295325906,-3.4431804356590167e-5,2.2802188582601254e-8,0.0017390021734525031,-3.42511906097866e-5,2.2639776047910924e-8,0.0017392992945751758,-3.40160914722638e-5,2.243042545250072e-8,0.0017395413117880889,-3.374434814309473e-5,2.2189933916874547e-8,0.0017397176600680104,-3.346135952529788e-5,2.1940688488459516e-8,0.0017398281621878566,-3.319689225605055e-5,2.170877243418754e-8,0.0017398847366847004,-3.2980307378858836e-5,2.1519663391740078e-8,0.00173991100205662,-3.283480466826047e-5,2.1393128136041958e-8,0.0017399392899709579,-3.27718231350248e-5,2.1338379242105724e-8,0.00174000521831946,-3.278698042141254e-5,2.1350723083240454e-8,0.001740140572588363,-3.285870325852261e-5,2.1410652793135758e-8,0.0017403655886877377,-3.295034303669861e-5,2.1485963701877946e-8,0.0017406820927880144,-3.301629939579607e-5,2.153721791335664e-8,0.0017410695269251995,-3.301209684177935e-5,2.152643905078453e-8,0.001741486310794703,-3.290702867540473e-5,2.1427864745405244e-8,0.0017418784545159788,-3.269589869418132e-5,2.1237862433750336e-8,0.0017421948525763043,-3.2404476839655194e-5,2.097945465702013e-8,0.001742404370709457,-3.208389090653782e-5,2.069734831489266e-8,0.001742506671572139,-3.179415040864402e-5,2.0443603476147352e-8,0.0017425307722198473,-3.158389373995162e-5,2.0260073766504838e-8,0.0017425223974869423,-3.147622681133658e-5,2.0166207874633754e-8,0.0017425275508909542,-3.146622368211866e-5,2.0157058325399752e-8,0.0017425801811898768,-3.152827253738807e-5,2.020986020759265e-8,0.0017426972860252556,-3.162719052466486e-5,2.02938080720638e-8,0.001742880085460341,-3.172780363660379e-5,2.0378372619537326e-8,0.001743118076178938,-3.180084546028723e-5,2.0438317988914532e-8,0.0017433934077427334,-3.1825558838409014e-5,2.045583270732787e-8,0.0017436844082488409,-3.179033969714021e-5,2.0421013873564265e-8,0.001743968178512343,-3.169263001235832e-5,2.0331783624667846e-8,0.0017442227209409098,-3.153871728518193e-5,2.0193782525411485e-8,0.0017444291701622036,-3.134350069999404e-5,2.002022746940685e-8,0.0017445744879534223,-3.112978763186553e-5,1.9831294365844262e-8,0.0017446545474839863,-3.092639446856581e-5,1.9652370870985962e-8,0.0017446769299296102,-3.0764373350770444e-5,1.9510621046903156e-8,0.0017446621867443558,-3.067120727891532e-5,1.9429795770389297e-8,0.001744642159515886,-3.066382603124781e-5,1.9424111620866493e-8,0.0017446545782597647,-3.074243219545489e-5,1.9492972810802038e-8,0.0017447345609175441,-3.088764647827402e-5,1.961870511808151e-8,0.0017449051754598907,-3.106281392238331e-5,1.9768826171514667e-8,0.0017451700230479688,-3.122163105108318e-5,1.9902887093021913e-8,0.001745510408947374,-3.1319374667683715e-5,1.9982307573413395e-8,0.001745888357283682,-3.1324766347923475e-5,1.998060209584599e-8,0.0017462551360621196,-3.122919694479231e-5,1.989118907219179e-8,0.0017465634988662125,-3.105046157655002e-5,1.9730384470556232e-8,0.001746780545164631,-3.0829192817083005e-5,1.9534083265630877e-8,0.0017468971763283654,-3.06181089004315e-5,1.9348284579479396e-8,0.0017469304559974707,-3.0466979567041213e-5,1.921600927524104e-8,0.001746917542182514,-3.0408580265584186e-5,1.916519343229281e-8,0.001746903536584843,-3.0450937289348743e-5,1.9202135362128732e-8,0.0017469283478326418,-3.057824727716383e-5,1.931250208156185e-8,0.0017470175401144699,-3.075870969388561e-5,1.9468283092315117e-8,0.0017471793662891689,-3.095489208974001e-5,1.9636835355944387e-8,0.00174740696584924,-3.1132521919019314e-5,1.978845734405289e-8,0.0017476831047323403,-3.126577909856488e-5,1.9900875698021727e-8,0.0017479851225330183,-3.1339285687671686e-5,1.9960887050540934e-8,0.0017482888771933986,-3.134799753916344e-5,1.9964247391127438e-8,0.001748571500534339,-3.1296247023240655e-5,1.9914888607216414e-8,0.0017488134063673208,-3.1196725784627565e-5,1.9824099003596076e-8,0.0017490001909731922,-3.106955308858083e-5,1.970973106837139e-8,0.0017491248720657058,-3.0941022082626086e-5,1.9595042768266226e-8,0.0017491904664698418,-3.084128927975832e-5,1.9506546090950694e-8,0.0017492122725144203,-3.080019758367981e-5,1.9470218613974216e-8,0.0017492184473760612,-3.084086291599031e-5,1.950583763271849e-8,0.0017492470171063378,-3.097194995726486e-5,1.9620297100766168e-8,0.0017493381646387358,-3.1181363894115793e-5,1.980227981843363e-8,0.0017495228601829887,-3.143510381205071e-5,2.0021485851797534e-8,0.0017498116793050868,-3.168386290175472e-5,2.023458425088819e-8,0.0017501889553554505,-3.18764773563137e-5,2.039704390946832e-8,0.001750615655745262,-3.197543249573554e-5,2.0476649055390935e-8,0.0017510402683068693,-3.1968199999134966e-5,2.0463276536587624e-8,0.0017514133531797574,-3.187031880307763e-5,2.037138563020928e-8,0.0017517005273633118,-3.1719998107685436e-5,2.0235063634656074e-8,0.001751890219662361,-3.156694813316782e-5,2.009806183335921e-8,0.0017519948081852045,-3.1459214757831945e-5,2.0002203745109712e-8,0.0017520456413406555,-3.14316280501743e-5,1.99773642676767e-8,0.001752083843670919,-3.149863525213701e-5,2.0035412948970665e-8,0.0017521497040240116,-3.1652918673865666e-5,2.0169255510395947e-8,0.0017522736069611874,-3.186951297035694e-5,2.0356620338662876e-8,0.0017524707370152176,-3.211356229077129e-5,2.056690037038114e-8,0.0017527403103441905,-3.234896981308914e-5,2.076865466262888e-8,0.0017530684808992239,-3.254545176213017e-5,2.0935651692450514e-8,0.0017534331318351181,-3.2682714956734884e-5,2.1050408448247448e-8,0.0017538088119477358,-3.275180452227584e-5,2.110531752462392e-8,0.0017541707526388716,-3.275447431229004e-5,2.1102114748483773e-8,0.0017544976901405082,-3.270162706579011e-5,2.105056824283674e-8,0.0017547738024637697,-3.2611589026689284e-5,2.096699993899653e-8,0.0017549902985381242,-3.250844445279376e-5,2.0872790992964694e-8,0.001755147084288628,-3.242014951493518e-5,2.0792620166438958e-8,0.001755254570490484,-3.2375793594230804e-5,2.0751927960372814e-8,0.001755335063281145,-3.2401220502996406e-5,2.0772996896363735e-8,0.0017554223357314845,-3.251259859283147e-5,2.0869356621329078e-8,0.0017555573977173214,-3.2708863724273736e-5,2.1039332104000612e-8,0.0017557790984082053,-3.29660727723672e-5,2.126132814313656e-8,0.0017561108323753565,-3.3238262436040336e-5,2.1494763264115556e-8,0.0017565485849542516,-3.346811995275699e-5,2.1689479904005575e-8,0.0017570576145160576,-3.360552772869162e-5,2.1801953478252693e-8,0.001757581785070488,-3.362585143779291e-5,2.1811245999041253e-8,0.0017580620722044517,-3.353851148587489e-5,2.1726427797049774e-8,0.001758455202278241,-3.3382035778471196e-5,2.158208310470156e-8,0.0017587444079113072,-3.320959575010596e-5,2.1425399176948597e-8,0.0017589399770165945,-3.307263661221911e-5,2.130160656072588e-8,0.0017590722808459125,-3.3008502295315075e-5,2.1243072677899854e-8,0.001759181556547813,-3.3034286998855964e-5,2.1264051244620618e-8,0.0017593078653479616,-3.314644102862432e-5,2.1360602034657684e-8,0.0017594831921096522,-3.332452486865661e-5,2.1514143545573805e-8,0.0017597265437465275,-3.353738875474003e-5,2.1697021326259336e-8,0.001760042245970357,-3.3750244753001815e-5,2.1878713640531822e-8,0.001760421146334321,-3.393124357669487e-5,2.2031497920959415e-8,0.0017608439638752132,-3.405644801825657e-5,2.2134681640893213e-8,0.0017612857471203435,-3.411264048046515e-5,2.2176972713998292e-8,0.0017617204091223166,-3.409797973084421e-5,2.2157031793999206e-8,0.0017621245438929386,-3.402096746414191e-5,2.208259287114386e-8,0.0017624801775086999,-3.3898450706873454e-5,2.1968740632231774e-8,0.0017627765982876126,-3.3753300304850276e-5,2.183585863215288e-8,0.001763011621842634,-3.3612016549370004e-5,2.1707446371806972e-8,0.0017631925713161728,-3.350214912888116e-5,2.1607729651469524e-8,0.0017633370417948848,-3.344913871513708e-5,2.1558783250075647e-8,0.0017634730174059953,-3.347197967528787e-5,2.1576714714329268e-8,0.0017636371116576798,-3.357742597786236e-5,2.1666704084487572e-8,0.0017638691979690627,-3.3753723774377576e-5,2.181772916999189e-8,0.0017642023031790117,-3.396680513750332e-5,2.1999445627985694e-8,0.0017646491667109299,-3.4163476660183754e-5,2.2165086343053056e-8,0.0017651911849654452,-3.428501454789286e-5,2.226334653764835e-8,0.001765778160698935,-3.428858702670496e-5,2.2257091907866984e-8,0.0017663432093342334,-3.416606996623403e-5,2.213983656780172e-8,0.0017668269543614896,-3.3948415208319496e-5,2.193955489711035e-8,0.001767197842766506,-3.369259112538415e-5,2.17070724834961e-8,0.0017674586193811824,-3.34596154530708e-5,2.1496498412280247e-8,0.001767639060592299,-3.329574652596208e-5,2.1348468166328244e-8,0.0017677821871205088,-3.3223440312985864e-5,2.1282180173486558e-8,0.0017679311822968995,-3.324154570836546e-5,2.129578103953367e-8,0.001768120512436396,-3.333086353608994e-5,2.1371561635770116e-8,0.0017683715270797181,-3.346142626072527e-5,2.148260408851196e-8,0.0017686914318105862,-3.3599409128902524e-5,2.1598953117881766e-8,0.0017690744739801523,-3.371291615094851e-5,2.1692652330809286e-8,0.0017695045695388376,-3.3776430454713476e-5,2.1741529840179073e-8,0.0017699588242402324,-3.3773791444695706e-5,2.1731694812881347e-8,0.0017704114732510778,-3.369964876976124e-5,2.1658752122008647e-8,0.0017708378094016797,-3.355943690940463e-5,2.152778106353521e-8,0.0017712176390383754,-3.336799684118138e-5,2.1352151053456795e-8,0.0017715378651225137,-3.314720089247531e-5,2.1151437607701027e-8,0.0017717941126926234,-3.2923077927578334e-5,2.0948840418387312e-8,0.0017719915599731899,-3.272273093629134e-5,2.0768364307715262e-8,0.0017721450953806894,-3.257108279253322e-5,2.063183815712094e-8,0.001772278789586462,-3.248736044869667e-5,2.0555760321616602e-8,0.0017724243969323124,-3.2481099228891417e-5,2.0547838756955484e-8,0.0017726180377305497,-3.2547672204280884e-5,2.06032360891902e-8,0.001772893902096436,-3.26643881516983e-5,2.070137445010743e-8,0.0017732745145420026,-3.278970120097843e-5,2.0805422495871913e-8,0.0017737592672930375,-3.286910117515717e-5,2.0867510935645095e-8,0.0017743165104114895,-3.285007607212869e-5,2.0841794381781585e-8,0.0017748868641271837,-3.27030730663727e-5,2.0702786663879134e-8,0.0017754014530360297,-3.2437768348831866e-5,2.0459662686927267e-8,0.0017758080743716612,-3.2102608481630945e-5,2.015584789108212e-8,0.0017760903595036206,-3.17656634260758e-5,1.985200104905266e-8,0.0017762693117928238,-3.1488255206219554e-5,1.9602496536206447e-8,0.0017763894591366236,-3.13062590108772e-5,1.9438747273234566e-8,0.001776500414190258,-3.12255836885439e-5,1.9365283650061506e-8,0.0017766430268873303,-3.1228419406428315e-5,1.9365541425495753e-8,0.0017768429247380117,-3.128342719222774e-5,1.9411160162745227e-8,0.0017771097947912773,-3.1355028823638904e-5,1.9470365609482324e-8,0.0017774396800211817,-3.141000926638304e-5,1.9513809181670135e-8,0.0017778182926467716,-3.142162035464175e-5,1.951808140830944e-8,0.0017782244717445747,-3.137198226709649e-5,1.946769186203101e-8,0.0017786336024299082,-3.12533185341731e-5,1.9356066032986675e-8,0.0017790209705546684,-3.1068226775794e-5,1.9185763398043137e-8,0.0017793650121143564,-3.08290205222032e-5,1.8967926769402895e-8,0.001779650296646995,-3.055604937514018e-5,1.8720829744334336e-8,0.0017798698743530228,-3.0274995636721267e-5,1.846747256260845e-8,0.001780026632235612,-3.001344158238894e-5,1.8232467517967285e-8,0.0017801335374979842,-2.9797089846618077e-5,1.8038579085288705e-8,0.0017802127450977066,-2.964590951538579e-5,1.7903218620709243e-8,0.0017802935187865058,-2.9570467972433672e-5,1.783518762572123e-8,0.0017804088777299578,-2.9568714404354944e-5,1.7831942719272197e-8,0.0017805907080136712,-2.9623577448738986e-5,1.7877681205500904e-8,0.0017808630276179797,-2.97023326731302e-5,1.7943009994474517e-8,0.0017812337934054229,-2.97595557883807e-5,1.7987695659313328e-8,0.0017816872967592035,-2.9745687070046982e-5,1.7968220015004007e-8,0.0017821813976015835,-2.962172070135213e-5,1.7850629717166458e-8,0.0017826548299887984,-2.9376324177287026e-5,1.762553130680372e-8,0.0017830461959892749,-2.903634032102028e-5,1.731731488754778e-8,0.0017833176117902473,-2.866124927995671e-5,1.6979208783705445e-8,0.001783469533852475,-2.832122375637814e-5,1.6673724822837606e-8,0.0017835376035968266,-2.80706105762117e-5,1.6448993998207882e-8,0.0017835749164607615,-2.793168172891396e-5,1.6324306949224888e-8,0.0017836317390693452,-2.7894493168831586e-5,1.6290136262871556e-8,0.0017837425116183111,-2.7927737072698468e-5,1.6318029727125984e-8,0.0017839222251040216,-2.7991952248573566e-5,1.6372552649405453e-8,0.0017841690180765415,-2.804960543379875e-5,1.6420305148628225e-8,0.0017844690921453375,-2.8070762770376914e-5,1.6434881896134044e-8,0.001784801494145308,-2.803540319002629e-5,1.6398785045025665e-8,0.0017851419554334824,-2.7933929717305372e-5,1.6303760303012625e-8,0.0017854659718042635,-2.7766907604290468e-5,1.6150522430904983e-8,0.0017857515136427459,-2.7544366750350456e-5,1.5948164497142894e-8,0.0017859816002243757,-2.7284609584283965e-5,1.571315251966609e-8,0.0017861467536977667,-2.7012260273114013e-5,1.5467614316026404e-8,0.0017862470230057806,-2.6755286369400636e-5,1.5236648496569402e-8,0.0017862930134701384,-2.654104265296623e-5,1.504470406978934e-8,0.001786305424195102,-2.6391773125555355e-5,1.491146539228525e-8,0.0017863128449208082,-2.6320220335777346e-5,1.4847885035371189e-8,0.0017863478278571186,-2.632612309632168e-5,1.4853112441925018e-8,0.0017864415524204687,-2.639440009895842e-5,1.491303463720827e-8,0.0017866176433893105,-2.649564870787032e-5,1.500094022968379e-8,0.0017868858723667914,-2.6589505322540724e-5,1.5080702406757717e-8,0.0017872368982414784,-2.66314436018206e-5,1.5112903973863852e-8,0.0017876399981771522,-2.6583121415397484e-5,1.5063969741293373e-8,0.0017880463839678022,-2.6424855833963814e-5,1.4917086903880453e-8,0.0017884001103203367,-2.61662566626825e-5,1.4681479769128718e-8,0.0017886554421320897,-2.5848825556468653e-5,1.439459563665528e-8,0.0017887942451537537,-2.5535601758596886e-5,1.4112816495281188e-8,0.0017888338091817063,-2.5289736988679483e-5,1.3892330893168733e-8,0.0017888195185604239,-2.515213106178181e-5,1.3769205429052592e-8,0.0017888063464290775,-2.5129846263159923e-5,1.3749151498984439e-8,0.0017888398156686227,-2.5199537269306553e-5,1.3810764966794239e-8,0.0017889451574657782,-2.5320670226036306e-5,1.391749936516575e-8,0.0017891262814678304,-2.544988601042015e-5,1.4030567902762325e-8,0.0017893708634015488,-2.5550922719877188e-5,1.4117760285831568e-8,0.0017896570726811836,-2.5599109255723216e-5,1.4157333008626661e-8,0.0017899592671993573,-2.5582042811262578e-5,1.4138489270469296e-8,0.0017902519438446774,-2.5498478260559e-5,1.4060321791036643e-8,0.0017905123629933307,-2.535677868794753e-5,1.3930440496755607e-8,0.0017907225488373376,-2.51734072821892e-5,1.3763682625522863e-8,0.0017908711693659085,-2.4971322438834654e-5,1.3580725771725944e-8,0.0017909554371954345,-2.4777821665357153e-5,1.3406151734326352e-8,0.0017909827283962571,-2.462135499749847e-5,1.3265522508586063e-8,0.001790971202300491,-2.4527148765017287e-5,1.3181360162542386e-8,0.0017909485628708425,-2.4512064252896147e-5,1.316846906372442e-8,0.0017909483769799933,-2.457975629539259e-5,1.3229610662378395e-8,0.0017910040460442844,-2.4717652977466054e-5,1.3352913035006776e-8,0.001791141441592685,-2.4897216452611835e-5,1.3512291120867038e-8,0.0017913719494893788,-2.5078198784446382e-5,1.367144672572904e-8,0.0017916878464235458,-2.5216509648907783e-5,1.3791025050547342e-8,0.0017920615866127356,-2.5274345945545365e-5,1.3837668829362787e-8,0.0017924499408709217,-2.5230505604992228e-5,1.3793113821811035e-8,0.001792803043549295,-2.508822447015411e-5,1.3660997294053245e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json
new file mode 100644
index 0000000..bf89351
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":16000,"numberOfSamples":1000,"samples":[0.0017930770944964171,-2.487756201187732e-5,1.3468791504217692e-8,0.0017932476264231187,-2.464987080068864e-5,1.3262714904077391e-8,0.0017933184724985877,-2.446409956071231e-5,1.3095425337680572e-8,0.0017933216314600794,-2.436869143477916e-5,1.3009865564682467e-8,0.0017933067138776958,-2.438639601001157e-5,1.3025800857085489e-8,0.0017933242278720884,-2.450889654783832e-5,1.3135191695059903e-8,0.0017934104016406212,-2.470298517826634e-5,1.330788790362845e-8,0.0017935796118112995,-2.4923857068963115e-5,1.35036193070344e-8,0.0017938254296263332,-2.512860398380717e-5,1.3684062401894767e-8,0.001794127049257825,-2.5285096932882215e-5,1.3820701756483629e-8,0.0017944568919538132,-2.537530987356056e-5,1.389769075082024e-8,0.0017947867111250417,-2.5394724503292413e-5,1.3911234845185292e-8,0.0017950914943699093,-2.5349982163249467e-5,1.3867468677974076e-8,0.0017953516485814604,-2.5256290869559507e-5,1.3780165902829643e-8,0.0017955543110713956,-2.513520274015715e-5,1.3668792904120013e-8,0.0017956944918898108,-2.501264398241291e-5,1.3556752559378335e-8,0.0017957763330320648,-2.4916631576514276e-5,1.3469287614057573e-8,0.0017958142078399008,-2.487403171878831e-5,1.343048298157746e-8,0.0017958328475770424,-2.4906014603702265e-5,1.3459107884232579e-8,0.001795865353512456,-2.5022541802827092e-5,1.3563657130380593e-8,0.001795948122041468,-2.521726303763574e-5,1.3737855679584164e-8,0.0017961127345561176,-2.546517299188524e-5,1.395871521848886e-8,0.0017963766324439365,-2.572537619201675e-5,1.4189187885469435e-8,0.0017967359302593923,-2.5949711291697144e-5,1.4386024761031048e-8,0.0017971637506210216,-2.6095329969824996e-5,1.451109103127541e-8,0.0017976155937020869,-2.6137143168968956e-5,1.4542469045381444e-8,0.0017980404371389018,-2.607573723966647e-5,1.4481422712615806e-8,0.001798394095120732,-2.5938065908348892e-5,1.4352832525648934e-8,0.0017986508156540284,-2.5770774714917362e-5,1.4199014670934582e-8,0.0017988099091846071,-2.5628118914854457e-5,1.4068743101640252e-8,0.0017988956039585806,-2.555773604555096e-5,1.4004458068040699e-8,0.0017989500158965364,-2.558822796060149e-5,1.4031230788508505e-8,0.0017990211621026053,-2.5722340085414784e-5,1.415084222610123e-8,0.0017991498357205768,-2.593791853046823e-5,1.4342850551324464e-8,0.0017993597382745207,-2.6195968610161597e-5,1.4571956673982097e-8,0.0017996538157950808,-2.645239065855816e-5,1.4798559267271849e-8,0.0018000169294873425,-2.666894130169837e-5,1.498852497549383e-8,0.0018004224996779246,-2.6820193009237008e-5,1.5119328433877708e-8,0.0018008399579285909,-2.6895709367472842e-5,1.5181911626012463e-8,0.0018012407279650508,-2.6898643187987404e-5,1.5179375808053418e-8,0.0018016019580566775,-2.6842624017871885e-5,1.512418529733506e-8,0.0018019083507358257,-2.6748422125539742e-5,1.503519386765796e-8,0.0018021529000758112,-2.664111066735776e-5,1.4935106313335826e-8,0.0018023373010458653,-2.654770620791294e-5,1.4848328300519829e-8,0.0018024724205052492,-2.6494772143160663e-5,1.4798742963175621e-8,0.0018025786668415908,-2.6505317999914305e-5,1.4806850211476605e-8,0.0018026854955645365,-2.659451656531552e-5,1.4885891179718516e-8,0.0018028287921071594,-2.6764406036804033e-5,1.5037147763755564e-8,0.0018030448604636129,-2.6999007434058543e-5,1.5245693907824705e-8,0.0018033608554715635,-2.726276700041339e-5,1.5479157196478573e-8,0.0018037839756043577,-2.750560873314212e-5,1.5692371417557645e-8,0.0018042943907072807,-2.767567790489397e-5,1.583886014992919e-8,0.0018048471164087917,-2.7736268154231167e-5,1.5886025345858665e-8,0.0018053841995643509,-2.7679480289528892e-5,1.582737530167465e-8,0.0018058526507647669,-2.752969711011927e-5,1.5685558185452904e-8,0.001806220217685462,-2.73353380759272e-5,1.550478294473961e-8,0.0018064829196074033,-2.715336860705409e-5,1.533667607943918e-8,0.001806663117932587,-2.7033305913710596e-5,1.5225741546222746e-8,0.001806800801895628,-2.7005730814722615e-5,1.5199028506319084e-8,0.0018069420013151019,-2.7077300335566203e-5,1.5261811538653193e-8,0.0018071276684187964,-2.7232000211422743e-5,1.5398964117004876e-8,0.0018073853085648632,-2.7437165696606414e-5,1.5580585890886757e-8,0.0018077246572371043,-2.7652248535832284e-5,1.576998693661435e-8,0.0018081377800550024,-2.7838089562507862e-5,1.5932006675260243e-8,0.0018086029626342595,-2.7964541054522235e-5,1.603977518121356e-8,0.0018090908374324907,-2.8014926126988497e-5,1.607861859878816e-8,0.00180957084697334,-2.7986978508900445e-5,1.6046829753568754e-8,0.0018100165314672806,-2.7890983536707856e-5,1.5953965389800106e-8,0.0018104089137041853,-2.774636589803873e-5,1.5817776136232783e-8,0.0018107380434183873,-2.7577939639375955e-5,1.5660833269492737e-8,0.0018110032945058872,-2.7412588632335316e-5,1.5507519669488106e-8,0.0018112130984671998,-2.727650820984009e-5,1.5381492498527788e-8,0.0018113845185778008,-2.719266881496396e-5,1.5303331370154355e-8,0.0018115426463610783,-2.7177984586301253e-5,1.5287947407869493e-8,0.0018117192686648675,-2.7239724617485946e-5,1.5341380468993828e-8,0.001811949680932402,-2.7371212382235838e-5,1.545703888127489e-8,0.0018122663836599232,-2.754807176709037e-5,1.561247872864076e-8,0.0018126893601793177,-2.772785807579092e-5,1.57692019263019e-8,0.001813215168157243,-2.7856683016959833e-5,1.5878661656300398e-8,0.001813810503341971,-2.788443523714781e-5,1.589593222254393e-8,0.0018144169960900853,-2.7784424994027194e-5,1.5797369795099836e-8,0.0018149690546354657,-2.7567238609616395e-5,1.5593102180247856e-8,0.0018154173615913274,-2.7279217321055754e-5,1.532562475157829e-8,0.001815745477353155,-2.698524284095293e-5,1.5054105867581623e-8,0.001815971625884253,-2.674564379645672e-5,1.4833294082824518e-8,0.0018161376350310534,-2.6598869981665784e-5,1.4697715161200344e-8,0.0018162930699050063,-2.6555272801256695e-5,1.46561098570472e-8,0.0018164816791041126,-2.6600309925083196e-5,1.4694563048089877e-8,0.001816733162707175,-2.6702680190249542e-5,1.4784125685246063e-8,0.0018170600913158257,-2.682355433898887e-5,1.4889335877885533e-8,0.0018174585911996668,-2.6924764974141972e-5,1.4975656178105195e-8,0.0018179114635388195,-2.697514492077015e-5,1.5015123550887387e-8,0.0018183927840198378,-2.69547379106428e-5,1.499003182489609e-8,0.0018188731580403156,-2.6856711418009936e-5,1.4894556739454665e-8,0.001819324793629755,-2.6687029559253713e-5,1.473440683021408e-8,0.0018197256785068433,-2.6462277654925132e-5,1.4524849413287513e-8,0.001820062373922574,-2.6206258898886165e-5,1.428764312060864e-8,0.001820331254382838,-2.5946127881015275e-5,1.4047536963377575e-8,0.001820538445168254,-2.5708755861324498e-5,1.3828946837314153e-8,0.0018206989383891886,-2.5517624437804906e-5,1.365308557110985e-8,0.0018208352337955717,-2.5390152599451144e-5,1.3535489407026761e-8,0.0018209755912363625,-2.5335207243642732e-5,1.34837573147026e-8,0.001821151632775928,-2.5350517985874814e-5,1.3495281869197622e-8,0.0018213945362785741,-2.5420047270152325e-5,1.3555011738893574e-8,0.0018217289276931587,-2.551235675360919e-5,1.363413439824075e-8,0.001822164406689718,-2.5582239942904856e-5,1.3691653129699898e-8,0.001822686655285152,-2.557849948022469e-5,1.3681411343723724e-8,0.0018232531039378613,-2.5459295222371094e-5,1.3565889406493894e-8,0.0018237998026180275,-2.5211254782313133e-5,1.3333435451442727e-8,0.0018242618025331551,-2.48617013791813e-5,1.300934477782622e-8,0.0018245988973076108,-2.4473013353101097e-5,1.2650735273151976e-8,0.0018248114805428112,-2.4119027032174727e-5,1.2325005783849212e-8,0.0018249369229238492,-2.3856916289854328e-5,1.2084104532181132e-8,0.0018250308362240503,-2.371030618670482e-5,1.1949100841989596e-8,0.001825146047330891,-2.366910915234589e-5,1.1910159201163204e-8,0.0018253190675345766,-2.3700474694523012e-5,1.1936747643950821e-8,0.0018255659145471929,-2.3762271034004848e-5,1.1990121606287427e-8,0.0018258842445968248,-2.3813805840709907e-5,1.2033166516185259e-8,0.001826258169929863,-2.382242826521537e-5,1.2036355717542334e-8,0.0018266634773100754,-2.3766769983762126e-5,1.1980573637170289e-8,0.001827072388230482,-2.363782080690576e-5,1.1857967699394822e-8,0.0018274577516185762,-2.343858881848419e-5,1.1671564450583e-8,0.0018277966526101797,-2.318264021823313e-5,1.1433927158541618e-8,0.0018280733241575382,-2.2891668446499556e-5,1.1164967072672481e-8,0.0018282811577905753,-2.259224023359341e-5,1.0889004337993399e-8,0.001828423551827078,-2.231201801919025e-5,1.0631321018346868e-8,0.0018285135003267157,-2.207596922814408e-5,1.0414665395833809e-8,0.0018285721071275558,-2.1903000912757984e-5,1.0256127104231967e-8,0.0018286262706814032,-2.1803209435120533e-5,1.0164594038831645e-8,0.001828705702435555,-2.177583438325039e-5,1.0138909579633824e-8,0.001828839337656277,-2.1807956588344662e-5,1.0166784524005633e-8,0.0018290509329571627,-2.1874064192536067e-5,1.0224554437432966e-8,0.0018293535538177238,-2.1937215282132975e-5,1.027838557907086e-8,0.0018297433561300666,-2.1953289747187514e-5,1.0288214837085777e-8,0.0018301945153309169,-2.1879869760203124e-5,1.0215787794044302e-8,0.001830658946308421,-2.168992779500395e-5,1.0036992338479185e-8,0.0018310753618979378,-2.138679258668782e-5,9.755367998113473e-9,0.0018313889838965569,-2.1011704357252705e-5,9.40893730399691e-9,0.0018315746329431721,-2.063467135717398e-5,9.061841978804914e-9,0.0018316490783180249,-2.0328796754628263e-5,8.780851241439044e-9,0.0018316632653398112,-2.0141677331726018e-5,8.60917634137112e-9,0.001831679395233614,-2.0080681978185537e-5,8.55305072202464e-9,0.0018317476612021335,-2.0117816834583795e-5,8.586332987307337e-9,0.0018318940208144653,-2.0206428881992914e-5,8.665969743081962e-9,0.0018321201082134187,-2.0298263194615822e-5,8.747708166164193e-9,0.001832409908402203,-2.0354458317239478e-5,8.796142458866711e-9,0.00183273774398109,-2.035003732644327e-5,8.788718700893353e-9,0.001833074770107819,-2.027416826766039e-5,8.715846695855356e-9,0.001833393452426999,-2.0128529716534936e-5,8.579316424344743e-9,0.0018336705866361742,-1.992511730302927e-5,8.390268759309309e-9,0.0018338894912187423,-1.968387735533606e-5,8.167058601271752e-9,0.0018340416791292305,-1.943010095958344e-5,7.932910852662894e-9,0.0018341280134618974,-1.9191384559990707e-5,7.713154507289564e-9,0.0018341590816821458,-1.8994066898046752e-5,7.53193522572574e-9,0.0018341544149850127,-1.885940649167221e-5,7.40865932392435e-9,0.0018341403815578727,-1.8800038802715472e-5,7.3546966523347715e-9,0.0018341468535115438,-1.8817250628981883e-5,7.370872897137305e-9,0.0018342029234141627,-1.889956862277312e-5,7.446231414582977e-9,0.0018343321227258867,-1.9023083174690816e-5,7.558447698209529e-9,0.0018345476553118807,-1.9153707945490168e-5,7.676042116963366e-9,0.0018348481083950683,-1.9251549921866032e-5,7.762491329140837e-9,0.0018352144196331546,-1.9277769509678416e-5,7.782530133022137e-9,0.0018356096596253435,-1.920398976117508e-5,7.710681424220857e-9,0.0018359837763515755,-1.9022957466042443e-5,7.540865396769042e-9,0.0018362849741516284,-1.8756908829736255e-5,7.293910761478627e-9,0.0018364766833233455,-1.8457870012827724e-5,7.017737181329629e-9,0.0018365538571077135,-1.8194914639068882e-5,6.775647214996834e-9,0.001836548563460727,-1.803024372589666e-5,6.624410847690285e-9,0.0018365187675594202,-1.7995409567851337e-5,6.592525088216024e-9,0.0018365252877235454,-1.8081331449302935e-5,6.671177914624835e-9,0.0018366101542084223,-1.8246672589318575e-5,6.822077045534804e-9,0.0018367869375824912,-1.8436994200718304e-5,6.995122222991016e-9,0.001837043888830328,-1.8602938875977135e-5,7.145101322978344e-9,0.0018373537387537482,-1.8710583772040503e-5,7.241122599512904e-9,0.0018376837337121634,-1.8743874840279134e-5,7.2687428712580284e-9,0.0018380027530075403,-1.8702372696090056e-5,7.227808403795434e-9,0.0018382852635966235,-1.8597450955179613e-5,7.128926096284541e-9,0.001838513176276471,-1.8448670412689796e-5,6.990149973877557e-9,0.0018386767249291653,-1.8280754164638692e-5,6.8342449477846595e-9,0.0018387750038904136,-1.812090639012062e-5,6.686252226411574e-9,0.0018388162973281307,-1.799601728606697e-5,6.570911706461216e-9,0.0018388179260978472,-1.7929389648419776e-5,6.509607695224068e-9,0.0018388050594228275,-1.7937016075237906e-5,6.516893378261047e-9,0.0018388079846011016,-1.8023966004633595e-5,6.597145459559734e-9,0.001838857713922728,-1.818180313357647e-5,6.742223335637884e-9,0.0018389803552352245,-1.838806035919854e-5,6.9310780933096055e-9,0.0018391912530982262,-1.860858891245793e-5,7.132034188312767e-9,0.0018394902971468079,-1.88029481324306e-5,7.3078518212857724e-9,0.0018398597310770378,-1.8932177661136858e-5,7.422918615431776e-9,0.0018402654168871984,-1.896772954162206e-5,7.451423914551764e-9,0.0018406621235211068,-1.8899934385024923e-5,7.385028293072869e-9,0.0018410028729857332,-1.8743806537061265e-5,7.238049462551088e-9,0.0018412512510457238,-1.8539475868505472e-5,7.047719368366382e-9,0.0018413937282192889,-1.834483799071887e-5,6.86733900839635e-9,0.0018414470718991932,-1.8220140618210308e-5,6.752093172557913e-9,0.0018414557581306575,-1.8208514775956216e-5,6.741217444212319e-9,0.0018414780209857879,-1.8320709364073575e-5,6.844095149750602e-9,0.001841565803992494,-1.8532077021471085e-5,7.037638298125493e-9,0.0018417482230087799,-1.8793447944416692e-5,7.276395121919292e-9,0.001842025845932932,-1.9049480082961622e-5,7.509453930519011e-9,0.001842376034057044,-1.925507263145096e-5,7.69549565376883e-9,0.0018427639401787223,-1.9383990375315344e-5,7.810647629678605e-9,0.0018431531413094465,-1.942958955901095e-5,7.849070713791684e-9,0.0018435127392187048,-1.940088549418417e-5,7.8192866216250315E-09,0.001843820730492911,-1.9317320377072763e-5,7.739348166296656e-9,0.0018440648885501498,-1.9204160908646343e-5,7.632620118984367e-9,0.001844242531542363,-1.9089035068363377e-5,7.524612793811735e-9,0.0018443600647661403,-1.8999259868333292e-5,7.440521812341918e-9,0.001844432549312981,-1.8959307662865297e-5,7.402863667254894e-9,0.0018444829953387927,-1.8987874349045107e-5,7.428729689176291e-9,0.0018445407209490732,-1.9094430440071465e-5,7.52658268876082e-9,0.0018446380463958871,-1.9275761849198014e-5,7.693093256534828e-9,0.001844804951317121,-1.9513700180089063e-5,7.911127592194227e-9,0.0018450622049142106,-1.9775670897407012e-5,8.15036239379623e-9,0.0018454146537959305,-2.0019361155694627e-5,8.37168352380671e-9,0.0018458471645658634,-2.020149491512519e-5,8.53532123115057e-9,0.001846325472916595,-2.0288852030465627e-5,8.610991677718667e-9,0.001846802738334875,-2.0268255874207588e-5,8.587035433849896e-9,0.0018472305526570348,-2.0152106866842266e-5,8.475412368243551e-9,0.0018475714841345342,-1.99772538420524e-5,8.31053358635742e-9,0.0018478096100095864,-1.9796940495792812e-5,8.141712154172403e-9,0.0018479558587613187,-1.9667497884298463e-5,8.020816057287474e-9,0.0018480460497650023,-1.9633092096664974e-5,7.988216118779569e-9,0.0018481313475885142,-1.97130435184807e-5,8.061204673026506e-9,0.0018482635125553158,-1.989628715353263e-5,8.229056332405201e-9,0.0018484798977238869,-2.014547254945726e-5,8.45695909902495e-9,0.0018487937859131421,-2.0409270039150275e-5,8.697434490355547e-9,0.0018491933464550954,-2.0637777460108637e-5,8.904531720257321e-9,0.001849648388562267,-2.0794981895125802e-5,9.04525543618406e-9,0.0018501208603383453,-2.0864590650255843e-5,9.104868950596546e-9,0.0018505745805460858,-2.0849287684095834e-5,9.086145203825255e-9,0.0018509815951685388,-2.0766006244656177e-5,9.004964655845875e-9,0.0018513249009249032,-2.0640121265863943e-5,8.88493947825769e-9,0.0018515986248674762,-2.0500399014916906e-5,8.75275158592604e-9,0.0018518069924697927,-2.037529947986055e-5,8.634737803338043e-9,0.0018519630574627775,-2.029034519449881e-5,8.55444480376467e-9,0.0018520875544509319,-2.0265862670398454e-5,8.530515515536571e-9,0.0018522076118006106,-2.0314479503742223e-5,8.574357895458459e-9,0.001852354640478269,-2.043817792207266e-5,8.68743961998716e-9,0.0018525605725263623,-2.0625343158510295e-5,8.85862825193293e-9,0.0018528519045839407,-2.0849110173348045e-5,9.06276525797922e-9,0.0018532420360760945,-2.1069073571299936e-5,9.262339779435322e-9,0.001853724130935122,-2.123818424609054e-5,9.413907129041965e-9,0.0018542681745039775,-2.13146965067963e-5,9.479118156772436e-9,0.001854825500677946,-2.1275855803305648e-5,9.437327265942164e-9,0.0018553411001434338,-2.1127603421251835e-5,9.294511094167757e-9,0.001855769808091963,-2.0905197786356253e-5,9.083769325899609e-9,0.001856089934500493,-2.066366542445483e-5,8.856377940750694e-9,0.001856309055157489,-2.0461827016597087e-5,8.66688007773098e-9,0.0018564605291198604,-2.0346009610590452e-5,8.557941716365146e-9,0.0018565929794966702,-2.0338609963516525e-5,8.549815123998282e-9,0.0018567566935258077,-2.0434095465034442e-5,8.636794189047838e-9,0.0018569909246059376,-2.0602544164462002e-5,8.790679141975657e-9,0.001857315247217037,-2.079894845221756e-5,8.96952007306406e-9,0.0018577267622189627,-2.097526582003082e-5,9.12880609280628e-9,0.001858203223977554,-2.109175679528336e-5,9.231914666619509e-9,0.0018587104540100233,-2.1124682017155018e-5,9.257156442445109e-9,0.0018592113115679834,-2.106890188932159e-5,9.200104828967708e-9,0.0018596735056705283,-2.0935816127821806e-5,9.07163153057935e-9,0.0018600745996205108,-2.0748452915729757e-5,8.89332379757743e-9,0.0018604039664238258,-2.0535775690622106e-5,8.692194187757801e-9,0.0018606624467996109,-2.032768021272182e-5,8.496037214902576e-9,0.0018608607937328295,-2.0151290741381685e-5,8.329989644194028e-9,0.0018610177895546044,-2.0028404875289557e-5,8.214148845006132e-9,0.0018611584243115355,-1.9973516875703052e-5,8.161728802068476e-9,0.0018613119834204608,-1.999186368250376e-5,8.17725592983337e-9,0.0018615094730483387,-2.0077264157555704e-5,8.254611200906061e-9,0.0018617795921467622,-2.021010824142319e-5,8.375250055651793e-9,0.0018621426777235635,-2.0356759570897997e-5,8.507743574528015e-9,0.0018626030974959807,-2.0472527218197918e-5,8.610594760757943e-9,0.001863142529370494,-2.0510266452106173e-5,8.640213095127023e-9,0.001863718542838287,-2.0434462278556232e-5,8.563932655985352e-9,0.0018642726717816077,-2.0236362154722935e-5,8.374014217097276e-9,0.0018647478436570396,-1.9942109211313427e-5,8.095175761587323e-9,0.001865108368948935,-1.960728289796133e-5,7.779474788722417e-9,0.0018653524017467537,-1.9298711898535704e-5,7.4892916930745e-9,0.0018655107551995035,-1.9072315354648044e-5,7.27659510756275e-9,0.0018656340820196373,-1.895724351204022e-5,7.168151304633016e-9,0.0018657758320747826,-1.895135064135561e-5,7.161416176012306e-9,0.0018659780113648356,-1.9026593337249196e-5,7.229749985625541e-9,0.0018662631207856332,-1.9139791481250695e-5,7.332602529333776e-9,0.0018666323647777408,-1.9244376015289706e-5,7.426524029334083e-9,0.0018670686302071045,-1.93003096381889e-5,7.474374412439072e-9,0.0018675424105708905,-1.9280847880737214e-5,7.451532270409492e-9,0.0018680189994260549,-1.9175704489265866e-5,7.348747503653877e-9,0.0018684654564785955,-1.8990736169104185e-5,7.171778438188237e-9,0.0018688561260398076,-1.8744836865035615e-5,6.938463114669843e-9,0.0018691760026911882,-1.8465188498455326e-5,6.674284503730649e-9,0.001869421833270251,-1.818207784859466e-5,6.407542925266269e-9,0.0018696013388690184,-1.7924257543533537e-5,6.165035437391302e-9,0.0018697312745747144,-1.77154221714517e-5,5.968767927016784e-9,0.0018698350512996898,-1.7571817919185243e-5,5.8337191006715384e-9,0.0018699402886244905,-1.750060390009367e-5,5.76630978226681e-9,0.0018700762544792589,-1.7498573862310598e-5,5.763229760950721e-9,0.0018702708423503566,-1.7551071627329354e-5,5.8104800416812336e-9,0.0018705465025051088,-1.763137263486119e-5,5.882878383752786e-9,0.0018709146903029294,-1.770161615547732e-5,5.945007935726127e-9,0.0018713693790612124,-1.771717503436893e-5,5.955326079857078e-9,0.001871882005628167,-1.7636224585071255e-5,5.875056690709975e-9,0.0018724021730790383,-1.7434179833481032e-5,5.681589270232072e-9,0.0018728684333721528,-1.7118167658035483e-5,5.3819353393236815e-9,0.0018732287172204356,-1.6732355540166632e-5,5.017686966724454e-9,0.0018734616898216,-1.6346704189132433e-5,4.654472798669768e-9,0.0018735862278335242,-1.6031827206181716e-5,4.358367558462995e-9,0.0018736526901350647,-1.583326478782647e-5,4.1717537065880975e-9,0.0018737219046122688,-1.5758804508346698e-5,4.10148922345258e-9,0.0018738443004110933,-1.578241850439683e-5,4.12273758898688e-9,0.0018740479774201498,-1.5858384906640113e-5,4.192354118637595e-9,0.0018743368377812267,-1.5936813363410486e-5,4.2635170100055776e-9,0.0018746952507608576,-1.5975245333576563e-5,4.296582563572818e-9,0.001875095253598817,-1.594505681652756e-5,4.265000879239349e-9,0.0018755037392833745,-1.5833619336192383e-5,4.157239354603041e-9,0.0018758885761289046,-1.5643635440476038e-5,3.976084601740173e-9,0.001876223379869671,-1.539063040568846e-5,3.736258860742264e-9,0.0018764908158095375,-1.5099215718405392e-5,3.460921341786339e-9,0.0018766843555797306,-1.4798700313825205e-5,3.1775739251165955e-9,0.001876808514204054,-1.4518593640800304e-5,2.913862771528727e-9,0.001876877684600156,-1.428449594527703e-5,2.6937304046643276e-9,0.0018769138794313335,-1.4114849713635936e-5,2.534362112040424e-9,0.001876943877891384,-1.4018784813808756e-5,2.444153315210054e-9,0.0018769961556297737,-1.3994930354196748e-5,2.4215928014478305e-9,0.0018770976892354386,-1.4030988542626093e-5,2.454884423634573e-9,0.0018772705481379275,-1.4104015382463982e-5,2.5222631987773908e-9,0.001877528051302119,-1.4181603792678899e-5,2.5931789806121115e-9,0.0018778703569376982,-1.4224713941675174e-5,2.6310160704288327e-9,0.0018782801543122864,-1.4193451439422243e-5,2.598529820729149e-9,0.0018787205590664604,-1.405678212300852e-5,2.4669139600598395e-9,0.0018791386692319275,-1.3805285464980217e-5,2.2276810492311913e-9,0.0018794780123360833,-1.3462303276611882e-5,1.9030504386180313e-9,0.0018796988460152687,-1.3085081939944344e-5,1.5469771882351445e-9,0.001879797376121251,-1.2749246711917046e-5,1.2305366805810725e-9,0.001879810814909188,-1.2520431987685998e-5,1.0152379061173355e-9,0.0018798025069450173,-1.2428480565797385e-5,9.28792039154265e-10,0.0018798356637794984,-1.2459405930458762e-5,9.576569245815327e-10,0.0018799514652937973,-1.2567147881760806e-5,1.058227207885944e-9,0.0018801611228964044,-1.2694459694026742e-5,1.1765668337490139e-9,0.0018804504286041776,-1.2790844470236134e-5,1.2652815802583089e-9,0.0018807898296935043,-1.2822211239622132e-5,1.2925348480468322e-9,0.001881144296639176,-1.2773137375766395e-5,1.244082520275377e-9,0.001881480541304962,-1.2644829708590756e-5,1.1212779543347608e-9,0.0018817714830373492,-1.2451442593087324e-5,9.37573033027889e-10,0.0018819987877392661,-1.2216113471832141e-5,7.147943106851535e-10,0.0018821541835679256,-1.1967040551517974e-5,4.79481554800589e-10,0.001882239823342938,-1.1733614321682521e-5,2.592733145950963e-10,0.0018822677333682823,-1.1542659347071796e-5,7.937878641490489e-11,0.001882258290813125,-1.1414929386642006e-5,-4.073055482831923e-11,0.00188223769665013,-1.1362192719985607e-5,-9.008293919875422e-11,0.001882234648515446,-1.1385337979164145e-5,-6.800108198389007e-11,0.0018822765976668182,-1.147373068275585e-5,1.529829570741141e-11,0.0018823859220090569,-1.1605863972995146e-5,1.3934936610352848e-10,0.0018825762769299201,-1.1751333204930212e-5,2.7535196640362164e-10,0.001882849356696919,-1.1874174668779581e-5,3.8937810798312383e-10,0.0018831923326353601,-1.1937760844475924e-5,4.470257514000792e-10,0.0018835766745060477,-1.1911660763090492e-5,4.198775427362523e-10,0.0018839599006157666,-1.1780441166968134e-5,2.937343558620432e-10,0.0018842923200876947,-1.1552816367157377e-5,7.714292268036392e-11,0.0018845300065070212,-1.1267101431234662e-5,-1.935563353070176e-10,0.001884651848842402,-1.0986979616266467e-5,-4.582805070815646e-10,0.0018846729512961321,-1.0783668473551395e-5,-6.500369715974631e-10,0.001884644026311698,-1.0709107993313308e-5,-7.201687612284614e-10,0.0018846329849430254,-1.0774324376780514e-5,-6.586566194780138e-10,0.0018846977991100334,-1.0946622650667459e-5,-4.966346506891892e-10,0.0018848664449174443,-1.1166459365350037e-5,-2.9038739613313543e-10,0.0018851332005309256,-1.1371807843700045e-5,-9.836030862044166e-11,0.00188546833284025,-1.1516483567944784e-5,3.6072174092010136e-11,0.0018858320534413794,-1.1577196587717038e-5,9.118298144119174e-11,0.0018861858170151932,-1.1551897946543376e-5,6.526251494340663e-11,0.0018864988368209698,-1.1454250824736898e-5,-2.8641386320276168e-11,0.0018867506997908348,-1.130771157982184e-5,-1.683171289939276e-10,0.0018869317981828468,-1.114067253953726e-5,-3.269535468848281e-10,0.00188704288267068,-1.0982683580718171e-5,-4.766790893169354e-10,0.00188709425157458,-1.0861262431198378e-5,-5.915582605683498e-10,0.0018871045582005074,-1.0798915164720963e-5,-6.504092600231872e-10,0.0018870989904794264,-1.0810255077489202e-5,-6.395398827368157e-10,0.0018871065171513206,-1.089946266139451e-5,-5.551558313967678e-10,0.0018871561148395357,-1.1058676341069262e-5,-4.048719775294948e-10,0.0018872723151573511,-1.1267948529405112e-5,-2.077232698081918e-10,0.0018874707273317042,-1.1497174238386989e-5,7.702962172308863e-12,0.0018877543345839755,-1.1710094620244999e-5,2.0709679356946207e-10,0.0018881113731507087,-1.1870079468074387e-5,3.5592247332806187e-10,0.0018885154354453212,-1.1947025394181564e-5,4.2594198011051527e-10,0.0018889282709940963,-1.1924554434572256e-5,4.0198452420754266e-10,0.0018893057509901104,-1.180642796887354e-5,2.8793937793174093e-10,0.0018896072155190882,-1.1620319815144137e-5,1.102325230061882e-10,0.0018898073174633363,-1.141620503858083e-5,-8.378045830706647e-11,0.0018899072882816023,-1.1256680872880053e-5,-2.350144500265779e-10,0.00188994004525897,-1.1199004466727915e-5,-2.8962303888349816e-10,0.0018899634124805416,-1.1274091765243815e-5,-2.187662588737686e-10,0.0018900409279768637,-1.1472911999612212e-5,-3.133758064503063e-11,0.0018902183761997377,-1.1749297526970216e-5,2.2880621691449785e-10,0.0018905085190595347,-1.2038537620544541e-5,5.004579398597872e-10,0.0018908911977333046,-1.2281010673800587e-5,7.273646082903298e-10,0.0018913257026649535,-1.2438746635557551e-5,8.738262880584713e-10,0.001891766418942364,-1.2500025159169855e-5,9.289921702418269e-10,0.0018921745217345054,-1.2474898759061678e-5,9.025856295473614e-10,0.0018925235949496604,-1.2387224374957897e-5,8.173373978207359e-10,0.0018928006012498605,-1.2267242724669224e-5,7.019521780489794e-10,0.001893004532648849,-1.2146219309942353e-5,5.860420989860535e-10,0.0018931444568213974,-1.2052958305120446e-5,4.968374482519974e-10,0.0018932376922635935,-1.201136506885249e-5,4.5688395279176046e-10,0.0018933080932005942,-1.203830971069964e-5,4.820179060546816e-10,0.0018933840198379344,-1.2141431704543413e-5,5.792878687063079e-10,0.0018934954432214392,-1.2317048491958935e-5,7.449904944807481e-10,0.0018936698433884116,-1.2548874791752978e-5,9.63493451044306e-10,0.0018939271289290503,-1.2808571057900438e-5,1.207801973263226e-9,0.0018942745270844783,-1.3059009801183272e-5,1.4426931836520661e-9,0.0018947029628015445,-1.3260512884313262e-5,1.6306445395104082e-9,0.0018951865409454112,-1.3379240786205856e-5,1.739776196090901e-9,0.0018956861193035659,-1.339582085200682e-5,1.7520006276159735e-9,0.001896156784362993,-1.3311821218936873e-5,1.6691149414387627e-9,0.0018965578833635218,-1.315201628144059e-5,1.5148888736049156e-9,0.0018968634955145083,-1.2961201862073039e-5,1.3319718714925833e-9,0.0018970707895216053,-1.27953186054354e-5,1.1734090967998433e-9,0.0018972035254706415,-1.270792499395131e-5,1.0897877058615488e-9,0.0018973082905004745,-1.2734836504746565e-5,1.1147159041982071e-9,0.0018974426469162598,-1.2881765897702211e-5,1.2532161191392723e-9,0.0018976577334179135,-1.3120638566367633e-5,1.4783604413576136e-9,0.0018979817061840188,-1.3397830754750496e-5,1.7391592222003208e-9,0.001898411458923872,-1.3651830597880485e-5,1.9773042111285594e-9,0.0018989162166529016,-1.3832467412215963e-5,2.1453543532283e-9,0.0018994501504002229,-1.3913394698958246e-5,2.218528300226893e-9,0.0018999670934915821,-1.3894285229865015e-5,2.1967560935101533e-9,0.0019004313205916007,-1.3794987368719163e-5,2.0991062793393773e-9,0.0019008222473536457,-1.3646563923406225e-5,1.9552477096692173e-9,0.0019011342862434643,-1.3483210869567092e-5,1.7977502645593472e-9,0.0019013742670453792,-1.3336710126712298e-5,1.656805182705815e-9,0.0019015583445810035,-1.3233251710861967e-5,1.557210441490532e-9,0.0019017093215130678,-1.3191683234416556e-5,1.516718948288368e-9,0.0019018544551819409,-1.322222486221346e-5,1.5448335845441187e-9,0.0019020232614363063,-1.332508798252e-5,1.641518474045382e-9,0.0019022446122891282,-1.3489036976123344e-5,1.7958687511443292e-9,0.0019025425844261994,-1.369058867045455e-5,1.985394636394811e-9,0.0019029310998461496,-1.3895103526272778e-5,2.177098013812628e-9,0.0019034084130146504,-1.4061158291373949e-5,2.3316432829741173e-9,0.0019039536403952983,-1.4148798826174367e-5,2.411188360481643e-9,0.00190452798036301,-1.4130390523376207e-5,2.3896713112052716e-9,0.0019050821403015848,-1.4000599135125858e-5,2.262277159589695e-9,0.0019055688083909521,-1.3781106731241096e-5,2.0499028297317794e-9,0.0019059562148011579,-1.3517137805515713e-5,1.795813482384683e-9,0.0019062378216281627,-1.3266226807941069e-5,1.55488479026225e-9,0.0019064346707243743,-1.3082876840158903e-5,1.3789321851604236e-9,0.0019065897975290977,-1.300402884385789e-5,1.3028645792247607e-9,0.0019067566525288243,-1.3039478647258866e-5,1.335631681489911e-9,0.0019069848668208623,-1.3169664466781716e-5,1.458241594737562e-9,0.0019073072088376596,-1.3351363244590194e-5,1.6292950121476715e-9,0.0019077314104704636,-1.35297729754093e-5,1.7965331398129217e-9,0.0019082393455308658,-1.3653389545506359e-5,1.910981408664566e-9,0.0019087936495511212,-1.368692249063571e-5,1.9391998920108105e-9,0.0019093490888763,-1.36182247050182e-5,1.8698433679372743e-9,0.0019098643504093444,-1.3457815665676977e-5,1.7131785903247102e-9,0.0019103104535418381,-1.3232664882104302e-5,1.49513174647234e-9,0.001910674199703993,-1.2977653683504635e-5,1.2491153226176072e-9,0.001910957383345947,-1.2727836569487273e-5,1.0086216538112337e-9,0.0019111736376836673,-1.2513095263658599e-5,8.021151208985223e-10,0.0019113446910483782,-1.2355262008813369e-5,6.502990133921028e-10,0.0019114970699477254,-1.2266914435896981e-5,5.649887739956633e-10,0.001911659458251913,-1.2250863989869682e-5,5.48651037755953e-10,0.0019118603142655674,-1.2299688915426472e-5,5.939871771107086e-10,0.0019121250704395051,-1.2395224103850199e-5,6.83479516283135e-10,0.001912472298250459,-1.2508553962420433e-5,7.894175597020551e-10,0.0019129086995072113,-1.2601732458062466e-5,8.755614362231623e-10,0.0019134238587510172,-1.2632856875682743e-5,9.019823758839568e-10,0.0019139872139001782,-1.2565475255362356e-5,8.340185275907759e-10,0.0019145507149744756,-1.2380996991705414e-5,6.541016494998854e-10,0.0019150594943169597,-1.208942059331609e-5,3.720012705806915e-10,0.0019154687355826697,-1.1731803189978585e-5,2.7186751351475117e-11,0.0019157599073696201,-1.1370438510631843e-5,-3.2059589419623007e-10,0.0019159480871280882,-1.1069433649940181e-5,-6.099776897920081e-10,0.0019160765242110884,-1.0874351161307604e-5,-7.975067244527357e-10,0.001916201638240862,-1.0799731954230843e-5,-8.695695269755934e-10,0.0019163757206690922,-1.0828066294132719e-5,-8.432736692445251e-10,0.001916633663319116,-1.0918083407511515e-5,-7.583931686950212e-10,0.0019169865545414935,-1.1017681518618213e-5,-6.649208970516302e-10,0.0019174220148160516,-1.1077138327480256e-5,-6.104228457140029e-10,0.001917909652400136,-1.1059628873658679e-5,-6.300141180862712e-10,0.0019184095373273615,-1.0947442807596206e-5,-7.404583107456317e-10,0.0019188815145464583,-1.074336196537258e-5,-9.388858115135974e-10,0.0019192932808213034,-1.0467594123611643e-5,-1.20575358697917e-9,0.0019196256213150462,-1.0151606595075532e-5,-1.5107725145640873e-9,0.0019198741582867806,-9.830831037267878e-6,-1.8199155582087304e-9,0.001920048034328906,-9.53810189496491e-6,-2.101716952530784e-9,0.00192016664884815,-9.298985720095432e-6,-2.3317451423285186e-9,0.0019202557299710247,-9.129284586844093e-6,-2.4949779817672822e-9,0.0019203436982262987,-9.03425635494825e-6,-2.5865276762768656e-9,0.0019204586561453517,-9.008766308266697e-6,-2.6114761398253937e-9,0.0019206257964393613,-9.037767379553837e-6,-2.584400459288261e-9,0.0019208647556760669,-9.096934635335611e-6,-2.528749375572851e-9,0.0019211863918376449,-9.153791617985142e-6,-2.475744453410305e-9,0.0019215887893763244,-9.170318069016814e-6,-2.4618619106144695e-9,0.0019220532680969222,-9.108486698013456e-6,-2.5235177511399977e-9,0.0019225426370994027,-8.93968667282501e-6,-2.6880381102716844e-9,0.0019230051437690364,-8.656881355420935e-6,-2.9620064184294193e-9,0.0019233868768198299,-8.284641843373393e-6,-3.321635583237772e-9,0.0019236508865696793,-7.87924983238811e-6,-3.7126811593957043e-9,0.0019237944180940756,-7.513626152701059e-6,-4.064969808739745e-9,0.0019238530642237287,-7.251346875133989e-6,-4.317442787274023e-9,0.0019238875264319904,-7.123184534446885e-6,-4.440727658128514e-9,0.0019239602849499028,-7.118772335068044e-6,-4.445080751689829e-9,0.0019241150340064711,-7.195410187776e-6,-4.3718032484889515e-9,0.0019243672115235493,-7.296057858543114e-6,-4.275859784550209e-9,0.0019247056490780219,-7.366796576870663e-6,-4.209081160263236e-9,0.001925100638222425,-7.368390575798459e-6,-4.2090899838722325e-9,0.0019255136991263675,-7.28124033598263e-6,-4.29459094897082e-9,0.0019259062934330908,-7.105313322498182e-6,-4.465474633111174e-9,0.001926246455241092,-6.8569503429279765e-6,-4.705904064104801e-9,0.001926513155176582,-6.563908504672785e-6,-4.989086595641599e-9,0.0019266984060524598,-6.259565315487143e-6,-5.28285207654197e-9,0.0019268072181901595,-5.977125716265304e-6,-5.555231795710813e-9,0.0019268557194206991,-5.744607949504135e-6,-5.779286983994542e-9,0.001926867956789526,-5.581192829623622e-6,-5.93661711990306e-9,0.0019268720688889452,-5.495252817643273e-6,-6.019245563941074e-9,0.0019268965365545243,-5.483964670467983e-6,-6.029980211505466e-9,0.0019269669147046517,-5.534047865259946e-6,-5.981698489668393e-9,0.0019271030607710645,-5.623188311924287e-6,-5.895977467639949e-9,0.0019273166863302753,-5.7219540024492885e-6,-5.8012471529754476e-9,0.001927608964943563,-5.7963044626612365e-6,-5.730359732741071e-9,0.001927968073137577,-5.811296023443038e-6,-5.716996716285913e-9,0.001928367327868175,-5.736968151573158e-6,-5.789976737812062e-9,0.0019287657529438592,-5.556881102280313e-6,-5.965023129181158e-9,0.0019291137044280984,-5.2780252562612125e-6,-6.235225744033611e-9,0.0019293656129909568,-4.9378508432014095e-6,-6.564293224012181e-9,0.0019294981647026979,-4.601333003765205e-6,-6.88943201632588e-9,0.001929525485728095,-4.342876353937429e-6,-7.138863176862139e-9,0.0019294994801223031,-4.217696588858802e-6,-7.25946537969358e-9,0.0019294908116161604,-4.238299439230228e-6,-7.239417461315074e-9,0.001929560314582812,-4.371015270438031e-6,-7.111424613284696e-9,0.0019297377118852202,-4.55344246107046e-6,-6.935795233464066e-9,0.001930017314096714,-4.719917590952116e-6,-6.775858205910853e-9,0.001930367658027968,-4.821014209853837e-6,-6.679201920416775e-9,0.0019307459008136353,-4.8316120263198285e-6,-6.669947990797228e-9,0.0019311099639047478,-4.749855588336907e-6,-6.749791325681373e-9,0.001931426078730715,-4.591648798416053e-6,-6.903320619292728e-9,0.0019316723240502833,-4.384152509840636e-6,-7.104284083463843e-9,0.00193183957714851,-4.159855661523347e-6,-7.321298468100921e-9,0.0019319309590358179,-3.951522849872863e-6,-7.522721099309414e-9,0.001931960272729608,-3.7879464393165173e-6,-7.680755766459321e-9,0.0019319496225054618,-3.690498897752296e-6,-7.774788967531755e-9,0.0019319263202685097,-3.6706055523742944e-6,-7.793831867149322e-9,0.001931919267959071,-3.7283927164905087e-6,-7.737819257871908e-9,0.0019319552108667095,-3.852716726614077e-6,-7.617573393096083e-9,0.0019320552988749142,-4.02248969024826e-6,-7.453520879166667e-9,0.0019322322171346693,-4.209066647074804e-6,-7.27339092546293e-9,0.0019324880384187753,-4.379522397329557e-6,-7.109051304871561e-9,0.0019328128907126745,-4.5006846976982455e-6,-6.9926006585541975e-9,0.001933184500922892,-4.543960637217014e-6,-6.951680008281516e-9,0.0019335690805746674,-4.491239132575197e-6,-7.0037418708715674e-9,0.0019339247854987158,-4.3417098714221724e-6,-7.149447726110859e-9,0.0019342092422925217,-4.118009382523817e-6,-7.366743932940767e-9,0.0019343916827004838,-3.868204312684253e-6,-7.608992772716862e-9,0.001934467361572726,-3.658733712507117e-6,-7.811866984567964e-9,0.001934467204138646,-3.5553083996379697e-6,-7.911879053399946e-9,0.0019344532495840499,-3.5966460829545584e-6,-7.871776332288663e-9,0.0019344968195731504,-3.7753114217998696e-6,-7.698978894623498e-9,0.0019346495112623097,-4.03947689724567e-6,-7.443761240396356e-9,0.0019349242390860283,-4.315579736048795e-6,-7.177294842177374e-9,0.0019352959799658958,-4.537209508290387e-6,-6.9637480873944295e-9,0.0019357174371195988,-4.664295527601881e-6,-6.8417869033334726e-9,0.0019361376429321514,-4.687227031264865e-6,-6.820621053087697e-9,0.0019365149604292852,-4.620518272556331e-6,-6.886137513437268e-9,0.001936822735002006,-4.4930784615761195e-6,-7.01030959332819e-9,0.0019370497573068866,-4.3395817761451026e-6,-7.159541983283873e-9,0.0019371982714750445,-4.194332245529059e-6,-7.300606086896117e-9,0.0019372813098119841,-4.0872389658178436e-6,-7.404541171072901e-9,0.0019373200047168263,-4.041081596253815e-6,-7.449311969194115e-9,0.0019373408698219712,-4.06951090543502e-6,-7.421751862826817e-9,0.0019373728401152071,-4.175601163817662e-6,-7.318959872347354e-9,0.0019374438984557292,-4.351140097040351e-6,-7.14897163907601e-9,0.0019375773878386295,-4.577090029110529e-6,-6.930294004143148e-9,0.0019377884492321462,-4.8255307456941e-6,-6.690013847281935e-9,0.0019380811458521296,-5.063086450380342e-6,-6.460482833914179e-9,0.0019384468078961414,-5.2556340897116115e-6,-6.274765644942493e-9,0.001938864070694948,-5.373859826780817e-6,-6.161257575262624e-9,0.0019393008815218134,-5.39900090253849e-6,-6.138107237175963e-9,0.0019397185968336869,-5.328108998262378e-6,-6.208094891699568e-9,0.0019400783924782288,-5.178029968915432e-6,-6.3547673684562564e-9,0.001940350064460665,-4.986568248040517e-6,-6.541330751226949e-9,0.0019405222410656135,-4.808507589956162e-6,-6.714561951692604e-9,0.0019406110279473565,-4.704360703335738e-6,-6.815780527851394e-9,0.0019406619186682263,-4.722099909779016e-6,-6.798592282970913e-9,0.0019407397828170951,-4.877341093394415e-6,-6.6480630164182626e-9,0.0019409070239167167,-5.142645237546104e-6,-6.3909979796592525e-9,0.0019411991246476956,-5.455021750594156e-6,-6.08859132515089e-9,0.0019416113591816284,-5.739907638638507e-6,-5.813170806092759e-9,0.0019421039399188788,-5.938379623146413e-6,-5.621848443746926e-9,0.001942620441220814,-6.023358180511173e-6,-5.540825654139379e-9,0.0019431076064300335,-6.000155352616885e-6,-5.564854280690739e-9,0.0019435278468381142,-5.896618797745685e-6,-5.66679479290207e-9,0.0019438629592743444,-5.750852545969404e-6,-5.809548326748877e-9,0.0019441120808416875,-5.601534475667561e-6,-5.955480832384088e-9,0.001944287443752201,-5.482065741624393e-6,-6.072125549617999e-9,0.0019444101506376872,-5.417660736467644e-6,-6.135020234542866e-9,0.001944506708268009,-5.424015514502002e-6,-6.12900103028505e-9,0.0019446061453395735,-5.5065945921930115e-6,-6.048882321230036e-9,0.0019447372317435117,-5.660164219490716e-6,-5.899883466024544e-9,0.0019449253683826993,-5.8687316263243564E-06,-5.6976552684035205e-9,0.001945189030333371,-6.106463427556881e-6,-5.467362321854533e-9,0.001945536161431122,-6.340235377640483e-6,-5.241200084831334e-9,0.0019459613750219223,-6.534129514976202e-6,-5.0540407206024526E-09,0.0019464450016517627,-6.655627092463941e-6,-4.9374385215283745e-9,0.0019469548828858596,-6.682567740270542e-6,-4.912878296775678e-9,0.001947451269570495,-6.60932933283276e-6,-4.985758640608991e-9,0.0019478943525422965,-6.450513493834239e-6,-5.14178782748562e-9,0.0019482532181079584,-6.2407756398245034e-6,-5.347142200685174e-9,0.0019485145355209999,-6.029956846976695e-6,-5.553227818359947e-9,0.001948688832848761,-5.8732962326046545e-6,-5.706255960069141e-9,0.0019488117889920867,-5.817657136586249e-6,-5.76069054929591e-9,0.001948938125527602,-5.886667676818439e-6,-5.69370500652984e-9,0.0019491274075020232,-6.0699856033129015e-6,-5.515569915679763e-9,0.0019494249289553265,-6.3227915401508744E-06,-5.270071903094241e-9,0.001949845257742566,-6.578590377092514e-6,-5.022021831291358e-9,0.0019503668701211755,-6.771379833246088e-6,-4.8356927104913765e-9,0.001950941025999169,-6.857006618888046e-6,-4.754047856449597e-9,0.0019515098360051739,-6.823912357418047e-6,-4.788264987953578e-9,0.0019520240658229982,-6.690500284410137e-6,-4.920280238133386e-9,0.0019524536244067533,-6.49382548244997e-6,-5.113816259747165e-9,0.0019527895094792508,-6.276752315075202e-6,-5.326941081183438e-9,0.0019530401509459683,-6.078332438438705e-6,-5.521497393189113e-9,0.001953225817980965,-5.928567237035448e-6,-5.668236483345585e-9,0.0019533734478342783,-5.84651286102268e-6,-5.74866469745462e-9,0.0019535127069048035,-5.840135760566559e-6,-5.755159455452236e-9,0.0019536730713173847,-5.906707798229399e-6,-5.690546687804252e-9,0.0019538812761171337,-6.033223898987462e-6,-5.567654612994196e-9,0.0019541585144023286,-6.197000707763707e-6,-5.408699430107965e-9,0.0019545171385095907,-6.367107479822374e-6,-5.243879262195881e-9,0.0019549572076320533,-6.5074833444539475e-6,-5.108346058501838e-9,0.0019554639201165612,-6.582363249082454e-6,-5.03694129358835e-9,0.001956007498430186,-6.563809875728904e-6,-5.0568720809815e-9,0.001956546986261798,-6.4398326830353245e-6,-5.179789317621606e-9,0.001957038319601614,-6.220390777973844e-6,-5.3959025305882386e-9,0.001957445211377807,-5.938406346561329e-6,-5.6729623501463044E-09,0.0019577497434098727,-5.6441961139281294e-6,-5.961701088875459e-9,0.00195795905198493,-5.3940117834603315e-6,-6.207071934832427e-9,0.001958105475933685,-5.235595818058769e-6,-6.362420055449834e-9,0.0019582395183540724,-5.194843437985116e-6,-6.402542072145623e-9,0.001958417079498149,-5.267559275761301e-6,-6.331712684108876e-9,0.0019586841391798864,-5.419208397437096e-6,-6.183867152169376e-9,0.0019590632992368684,-5.5936274617679324e-6,-6.0140407497047866e-9,0.0019595468572287758,-5.728796846682779e-6,-5.882943397267424e-9,0.001960099404208329,-5.774659859002328e-6,-5.8395474337831e-9,0.0019606692273000065,-5.706491547132605e-6,-5.908007246472056e-9,0.001961203875844111,-5.5290734820936245e-6,-6.083550911233866e-9,0.001961663710892444,-5.271294504247528e-6,-6.33775249294814e-9,0.0019620291042840325,-4.974990706173587e-6,-6.62948408349352e-9,0.0019623006544432146,-4.683271223898374e-6,-6.916401377222745e-9,0.001962494734377491,-4.432015613971804e-6,-7.163317469825513e-9,0.00196263744876942,-4.24555166449937e-6,-7.3464495352867865e-9,0.001962759151531451,-4.135625053205161e-6,-7.454405906541533e-9,0.0019628903475563684,-4.102163162853727e-6,-7.487397138171459e-9,0.001963058825873597,-4.134581772027361e-6,-7.45591629508366e-9,0.0019632873735704035,-4.2130275752858015e-6,-7.37949782948698e-9,0.001963591384460584,-4.309670509689841e-6,-7.285447272084761e-9,0.001963976034392938,-4.390698571258319e-6,-7.2069014925367394E-09,0.00196443330876546,-4.419933657794488e-6,-7.1793089036528066e-9,0.0019649399761413515,-4.364865771727716e-6,-7.23453490273262e-9,0.001965458415821613,-4.2050069352158806e-6,-7.392670556572303e-9,0.0019659423021510165,-3.940624693125234e-6,-7.653438357820787e-9,0.001966347619651084,-3.5979703831828426e-6,-7.991020087185636e-9,0.001966646410720784,-3.2268073690315724e-6,-8.35646294373238e-9,0.001966837804951861,-2.88866026076316e-6,-8.6892469084276e-9,0.0019669507350560987,-2.638942552458159e-6,-8.93489923720782e-9,0.001967036219204756,-2.509897091168396e-6,-9.061792188439865e-9,0.0019671521102095036,-2.5011703515333097e-6,-9.070385947269845e-9,0.001967346338386762,-2.5810055380569523e-6,-8.992002968155938e-9,0.0019676443316525953,-2.696486676324743e-6,-8.878723391163976e-9,0.0019680437540308916,-2.788602202893239e-6,-8.788584213578214e-9,0.00196851699192739,-2.8074134547524235e-6,-8.77069512204032e-9,0.0019690198105688102,-2.723406029950918e-6,-8.854087293070188e-9,0.001969503286514971,-2.5325606025790628e-6,-9.042705655591e-9,0.0019699255438227234,-2.2545503651888572e-6,-9.317149614451272e-9,0.0019702602048416143,-1.9254253998824907e-6,-9.64186138287465e-9,0.0019704998243126686,-1.587626778063647e-6,-9.974977396460062e-9,0.001970654436207738,-1.2805361083925496e-6,-1.0277671836369529E-08,0.001970746848452303,-1.0338220010957484e-6,-1.0520734387427998e-8,0.001970806813276138,-8.642671882979529e-7,-1.0687691080751363e-8,0.0019708657346138646,-7.754852094272468e-7,-1.0775054263680461e-8,0.001970952685885467,-7.59358064857489e-7,-1.0790873734095068e-8,0.001971091690133412,-7.980785287859418e-7,-1.075270881326718e-8,0.0019712997330186763,-8.661819417994633e-7,-1.0685635082892515e-8,0.001971584912381313,-9.325958251431366e-7,-1.0620251655417039e-8,0.001971944386893563,-9.632389319096306e-7,-1.0590148555848218e-8,0.0019723623172643737,-9.250101036695197e-7,-1.0627989281767547e-8,0.001972808830631805,-7.919702181976068e-7,-1.0759406320346234e-8,0.0019732419679683944,-5.536462457545765e-7,-1.0994779047683153e-8,0.001973614823661226,-2.2335933302557065e-7,-1.1320973812675675e-8,0.0019738884737286657,1.5799990717252462e-7,-1.1697589927724113e-8,0.0019740473224203847,5.280347963458416e-7,-1.2062959771330483e-8,0.00197410928803649,8.20358883314744e-7,-1.2351497457826083e-8,0.001974123317235958,9.877098265902934e-7,-1.251656570489879e-8,0.001974153255924493,1.0192999814429548e-6,-1.2547588496020676e-8,0.0019742556717545824,9.434428611000109e-7,-1.2472576911245205e-8,0.0019744623865517686,8.154180584666158e-7,-1.2346103517772794e-8,0.001974774135226251,6.982018680757243e-7,-1.2230299564424663e-8,0.001975164866836536,6.44800593857355e-7,-1.2177471453811616e-8,0.001975592187135106,6.871905621175031e-7,-1.221921769330186e-8,0.001976009248334955,8.327104581488337e-7,-1.2362852376014084e-8,0.0019763749925609457,1.0663971388143509e-6,-1.259366276420492e-8,0.001976661273607453,1.3571121056137057e-6,-1.2880913658228117e-8,0.0019768563928079714,1.6655158949823804e-6,-1.3185711559255818e-8,0.001976965150873674,1.9522178827619e-6,-1.3469078659361015e-8,0.0019770060231024044,2.1846215565256827e-6,-1.3698753468466588e-8,0.001977006519814771,2.3414551764659016e-6,-1.3853691582153881E-08,0.0019769979445145433,2.4146980122888094e-6,-1.3925966248255384e-8,0.0019770105929741008,2.409217344158514e-6,-1.3920387497226856e-8,0.0019770700502998715,2.340825972519958e-6,-1.3852563760087515e-8,0.0019771946962903715,2.233613597212906e-6,-1.3746268263541514e-8,0.001977394083641216,2.117137695108602e-6,-1.3630691930216664e-8,0.00197766776849491,2.02355937158754e-6,-1.353764934893884e-8,0.0019780043391657534,1.9844130263776497e-6,-1.3498405475263642e-8,0.001978380746958981,2.0264143260061553e-6,-1.353951384539365e-8,0.001978762774876461,2.1656876800633962e-6,-1.3677055583687163e-8,0.00197910834678161,2.4005955486988004e-6,-1.3909478074330424e-8,0.0019793755690996236,2.7052325640155345e-6,-1.4211108687579435e-8,0.0019795358980323765,3.0280329593492748e-6,-1.4530782563116931e-8,0.0019795888602322726,3.3008762468395384e-6,-1.4800926854883546e-8,0.001979569909580966,3.4602522751505376e-6,-1.4958607317158036e-8,0.0019795428292347273,3.4729664075210322e-6,-1.4971007396679774e-8,0.0019795766858330343,3.3517185374406653e-6,-1.485078131230214e-8,0.001979719097725177,3.150012236996182e-6,-1.4650917551003886e-8,0.0019799807430923235,2.939717703579574e-6,-1.4442508997057445e-8,0.001980337179051505,2.785210747885825e-6,-1.4289220607364234e-8,0.001980742604001265,2.726455749296866e-6,-1.423061560237119e-8,0.0019811460867675897,2.7744247605888214e-6,-1.4277633511904348e-8,0.001981503955526798,2.915383589334282e-6,-1.4416788031389436e-8,0.0019817866606374806,3.119072655949307e-6,-1.4618203584318185e-8,0.0019819810541467733,3.3472878569643014e-6,-1.4844069697144964e-8,0.0019820896686203603,3.5612914305410776e-6,-1.5055977587760283e-8,0.00198212818028609,3.7276910519524167e-6,-1.522077511487346e-8,0.0019821217200457113,3.822702343827983e-6,-1.531483119915164e-8,0.001982100526968717,3.8346574475360094e-6,-1.5326546430867445e-8,0.001982095446197697,3.7647342774013897e-6,-1.525707214555077e-8,0.0019821337647565624,3.626027788928867e-6,-1.511936833404366e-8,0.00198223586051072,3.441229396883561e-6,-1.4935887639064302e-8,0.00198241295750562,3.2394074768603723e-6,-1.4735395171384388e-8,0.001982665941468611,3.0524134698759988e-6,-1.4549442314482317e-8,0.0019829850278711707,2.9111670054398966e-6,-1.4408723058841443e-8,0.0019833501452222605,2.841809897117393e-6,-1.4339272286988301e-8,0.0019837320752173157,2.8615334931783054e-6,-1.4358293854803897e-8,0.001984094861776407,2.9738376767734945e-6,-1.4469388182609625e-8,0.001984400625925791,3.163606036205151e-6,-1.465759406565055e-8,0.001984617903763515,3.39387177161666e-6,-1.4886148324894974e-8,0.001984733239124418,3.6078493427449448e-6,-1.5098540495896356e-8,0.001984762586708769,3.740319866084089e-6,-1.522990885918146e-8,0.001984755051949164,3.739151728899739e-6,-1.5228487094580237e-8,0.0019847812506757346,3.589373742862749e-6,-1.507949371776934e-8,0.0019849070018280613,3.324884794977739e-6,-1.481665653780441e-8,0.0019851657075547475,3.017077739740492e-6,-1.4510837813089766e-8,0.001985546337819205,2.7455641756043497e-6,-1.4240999293311826e-8,0.0019860027126962026,2.5689052542741243e-6,-1.4065234505030063e-8,0.001986474911058454,2.5102785475177926e-6,-1.4006586884914449e-8,0.001986909190146146,2.5597820777408202e-6,-1.4055310223533645e-8,0.001987269141598994,2.685729541695863e-6,-1.4180024373601416e-8,0.001987538415975901,2.8470244196991636e-6,-1.4339955147058143e-8,0.0019877184535379826,3.0026745725009918e-6,-1.4494369758932575e-8,0.001987824315689395,3.1178169485181043e-6,-1.4608579499453113e-8,0.0019878803285720108,3.1671431670578377e-6,-1.4657380747630862e-8,0.001987916017903525,3.1367378731829e-6,-1.4626916752757822e-8,0.00198796225735607,3.0248075252962984e-6,-1.4515412078652403e-8,0.001988047562103157,2.8413753222055076e-6,-1.4332850735856531e-8,0.0019881946131477435,2.60687216740141e-6,-1.4099542829987458e-8,0.001988417298411971,2.349527873938127e-6,-1.3843513258288562e-8,0.0019887187102340417,2.1016769841030624e-6,-1.3596844711551368e-8,0.001989090425727029,1.895388778983732e-6,-1.3391377619170956e-8,0.001989513160461744,1.7578895979745178e-6,-1.3254203612054567e-8,0.001989958770446367,1.7071788559904026e-6,-1.3203316404532476e-8,0.001990393534070427,1.7481911434179824e-6,-1.3243755974189393e-8,0.0019907827350952195,1.8697874359525122e-6,-1.336454230925692e-8,0.00199109681028482,2.0431157285996407e-6,-1.3536978415285554e-8,0.001991319151058384,2.222726763531207e-6,-1.371574429721612e-8,0.0019914544946981836,2.3526243150694117e-6,-1.3844968523515149e-8,0.0019915347809361574,2.379086977407752e-6,-1.3871077631016254e-8,0.001991617224389839,2.269346242030513e-6,-1.376144811926663e-8,0.0019917698902892863,2.0294384279911193e-6,-1.3522157951942242e-8,0.0019920466456429435,1.7095202837346074e-6,-1.3203206351826863e-8,0.001992463423863107,1.3885001624897012e-6,-1.288317749571206e-8,0.0019929908638321907,1.143480512993817e-6,-1.2638853847306288e-8,0.0019935682104733686,1.0214708448982725e-6,-1.2517091776224162e-8,0.0019941285130815195,1.0283869976145581e-6,-1.2523846927649901e-8,0.0019946200002937324,1.1365035316745898e-6,-1.2631538348227922e-8,0.001995015574720192,1.300685938679259e-6,-1.2795181679410482e-8,0.0019953118522825736,1.4734595686959486e-6,-1.2967407715671091e-8,0.0019955231121392253,1.6145721408287418e-6,-1.3108023269665573e-8,0.001995674485554681,1.6953207844439172e-6,-1.3188361405392658e-8,0.001995796372307964,1.6996250991069645e-6,-1.3192379686625797e-8,0.0019959203169879858,1.6236696505985474e-6,-1.3116312565503816e-8,0.0019960757921594096,1.475055708754886e-6,-1.2967807444551166e-8,0.0019962873383381975,1.271613814117125e-6,-1.2764702800757431e-8,0.001996571813660661,1.039617664310189e-6,-1.253321173415832e-8,0.001996935876688311,8.10987734279826e-7,-1.2305124592895642e-8,0.0019973742307001037,6.19237649378676e-7,-1.2113796509748371e-8,0.0019978693382533895,4.943937406260044e-7,-1.198913399233764e-8,0.0019983931254425164,4.575767847518032e-7,-1.1952232495962723e-8,0.0019989108215040154,5.162092500765573e-7,-1.2010593106379118e-8,0.0019993866344011147,6.609218430927506e-7,-1.215498240158599e-8,0.001999790531775251,8.650472468204294e-7,-1.2358850045151053e-8,0.0020001051872744658,1.0872195388065961e-6,-1.258086799786539e-8,0.0020003320300538583,1.2774384887276872e-6,-1.2770987731393865e-8,0.0020004948833237455,1.386820963278251e-6,-1.2880238021882123e-8,0.0020006389899060112,1.380409164658492e-6,-1.2873596607745973e-8,0.0020008230599442827,1.250445294729628e-6,-1.2743295658742569e-8,0.0020011035292148414,1.0248522465183068e-6,-1.2517287786395435e-8,0.0020015145004623476,7.642707366236366e-7,-1.2256256246504428e-8,0.002002052224806011,5.444286659134359e-7,-1.203598958625036e-8,0.0020026739455431216,4.2948544136936147e-7,-1.1920745495741174e-8,0.002003313579512777,4.496948714502562e-7,-1.1940890619262743e-8,0.0020039058326337656,5.94885512572639e-7,-1.208630936784008e-8,0.0020044058510690797,8.245709877731227e-7,-1.2316460457905977e-8,0.002004796841439746,1.0859096843776425e-6,-1.2578353220820108e-8,0.0020050868112686674,1.3296101468781744e-6,-1.2822521486441082e-8,0.0020053001577274294,1.5190539612688328e-6,-1.3012215262669332e-8,0.002005469139021302,1.6331027930982382e-6,-1.3126245137314179e-8,0.0020056275325741548,1.6652065850658668e-6,-1.3158091335992063e-8,0.0020058066106900104,1.6211993428942383e-6,-1.3113673482230696e-8,0.0020060325903481888,1.5170686408574125e-6,-1.3009079439298547e-8,0.002006324650222416,1.3769637497429265e-6,-1.2868534813545612e-8,0.0020066929754689877,1.2310800018681066e-6,-1.2722269046986007e-8,0.002007136798951896,1.1127780991151567e-6,-1.2603647647411476e-8,0.0020076429784578894,1.054378781853201e-6,-1.254500526328362e-8,0.002008186099861188,1.081598763449451e-6,-1.2572118807769247e-8,0.0020087311297168646,1.2074288608481698e-6,-1.2698088673752461e-8,0.002009239103287181,1.4270773152031296e-6,-1.2918234760844035e-8,0.0020096752789058284,1.716007875070945e-6,-1.3208055118895744e-8,0.0020100179652990918,2.0326550064858777e-6,-1.352587734554098e-8,0.0020102654993804938,2.3260539621831587e-6,-1.3820486693134687e-8,0.0020104390771972405,2.547030253336762e-6,-1.4042386690680413e-8,0.002010580106295075,2.6604804750482006e-6,-1.4156191902665433e-8,0.0020107419502173964,2.6557832329077294e-6,-1.4151139319925016e-8,0.0020109771879805558,2.5523069324261464e-6,-1.4046647718123685e-8,0.0020113229426591533,2.397375789826293e-6,-1.3890280276741745e-8,0.0020117884211216064,2.2554114694326285e-6,-1.3746841070905745e-8,0.0020123497341117697,2.1898980519676447e-6,-1.3680257875013628e-8,0.002012955651515441,2.2438213886840194e-6,-1.3733900181722728e-8,0.0020135433728180985,2.4266447610087438e-6,-1.39174182558369e-8,0.0020140579317852875,2.71366437476233e-6,-1.4206014604787913e-8,0.0020144668228012324,3.057204948402956e-6,-1.4551671002974376e-8,0.0020147647475891694,3.403199418756304e-6,-1.4899863316082618e-8,0.0020149692079483423,3.7055522989431925e-6,-1.520408419186706e-8,0.00201511150064555,3.9340846123691215e-6,-1.5433892567141782e-8,0.0020152277251075717,4.076173637410506e-6,-1.5576577887703656e-8,0.002015352239871468,4.134536644454852e-6,-1.563490853663456e-8,0.0020155138461719147,4.123692670047893e-6,-1.5623536213635403e-8,0.002015733840614426,4.0666243269108735e-6,-1.55656072328393e-8,0.0020160248674950276,3.992054942875605e-6,-1.549001455038565e-8,0.002016389829459018,3.93198510839712e-6,-1.542893704410032e-8,0.0020168206820040395,3.918765993757011e-6,-1.541493242521958e-8,0.0020172975756185623,3.980985777701276e-6,-1.5476833726911856E-08,0.0020177894153615887,4.137875398081949e-6,-1.5634127210906082e-8,0.002018257233673766,4.392939175307108e-6,-1.589050240627824e-8,0.0020186613266694954,4.728908346737077e-6,-1.6228694079735292e-8,0.0020189715206215524,5.107091194937329e-6,-1.660975065177038e-8,0.0020191776486713324,5.473615092617835e-6,-1.6979292753435012e-8,0.002019295779758033,5.772429950864491e-6,-1.7280651483171656e-8,0.002019366518176988,5.961349214838775e-6,-1.7471108259171236e-8,0.0020194449006417144,6.025194125173232e-6,-1.7535205282025255e-8,0.0020195851788385455,5.980999551576999e-6,-1.7490022440756466e-8,0.0020198257279237858,5.873603143711555e-6,-1.7380744515888384e-8,0.0020201787279912464,5.763467291729197e-6,-1.7268403150332105e-8,0.002020627231636164,5.710627551405569e-6,-1.7213706810198902e-8,0.002021130054639501,5.7592346508056935e-6,-1.7261429057047976e-8,0.002021632985760314,5.926817997082376e-6,-1.7429501306651574e-8,0.0020220830928120654,6.20118699778434e-6,-1.7705783145695567e-8,0.0020224418380563767,6.54565640069781e-6,-1.8053264624984565e-8,0.002022693062944097,6.910491614078083e-6,-1.842162169656846e-8,0.0020228439203432147,7.246330768272015e-6,-1.876083414523109e-8,0.00202291967499455,7.515105216752511e-6,-1.9032294027402762e-8,0.002022955371584404,7.695808702277565e-6,-1.9214681031198905e-8,0.0020229876289183193,7.785067752112486e-6,-1.9304540519772036e-8,0.002023048591573068,7.794246700981407e-6,-1.931333154928886e-8,0.0020231624980154585,7.745203409912733e-6,-1.926311028183914e-8,0.0020233442466032186,7.666212202219833e-6,-1.918240528759956e-8,0.0020235989734061375,7.588624354679677e-6,-1.9102866270263047e-8,0.002023921859131006,7.544034825291021e-6,-1.9056442936228402e-8,0.0020242978850773183,7.561308638331777e-6,-1.907241483206435e-8,0.0020247018586647472,7.662755338235264e-6,-1.9173526603769192e-8,0.0020250996748987574,7.859045107714878e-6,-1.9370801266084847e-8,0.0020254522736660083,8.143408211325172e-6,-1.9657586738974178e-8,0.0020257235021321623,8.487284167289417e-6,-2.0005064388235096e-8,0.0020258914008579325,8.841089839559924e-6,-2.0362983469746076e-8,0.0020259593522022504,9.143502782538063e-6,-2.0669092452411597e-8,0.002025960886878649,9.339097586877438e-6,-2.0867079499950275e-8,0.0020259529258870486,9.398254944606137e-6,-2.0926796085751366e-8,0.0020259980842913805,9.329515946722925e-6,-2.085676872498728e-8,0.0020261436498098338,9.177436067364245e-6,-2.0702003689784143e-8,0.002026406976788043,9.007145260904893e-6,-2.0528373390696197e-8,0.0020267726311981303,8.883574211806648e-6,-2.0401649057662443e-8,0.002027200045442295,8.85396367750792e-6,-2.0369837232274553e-8,0.00202763668051562,8.938366466169523e-6,-2.0453528387901555e-8,0.002028031669042613,9.128606584898225e-6,-2.0644735364591285e-8,0.0020283466335991557,9.39376249959402e-6,-2.0912327645621907e-8,0.00202856210099846,9.689503075361093e-6,-2.121142268331872e-8,0.002028679138809268,9.968698912730516e-6,-2.1494151041399055e-8,0.0020287166795685033,1.0191047732068404e-5,-2.1719481725996414e-8,0.0020287057358542504,1.0329897581158466e-5,-2.186021727137697e-8,0.0020286822638829623,1.0375287950705e-5,-2.1906123600102078e-8,0.0020286804677956084,1.0333353870444897e-5,-2.186332802988044e-8,0.0020287278066525257,1.022312602899354e-5,-2.175105158087606e-8,0.0020288421647846723,1.0072112218170743e-5,-2.1597111262225863e-8,0.0020290308875681577,9.911875842701016e-6,-2.143344844153332e-8,0.0020292909665944156,9.774243576700235e-6,-2.129232494824514e-8,0.0020296097239808366,9.688113323346603e-6,-2.1203133387480477e-8,0.0020299656877050217,9.67644684934271e-6,-2.11893658424898e-8,0.0020303297882378582,9.752905982662366e-6,-2.1265165055571597e-8,0.0020306676073327287,9.917766980710009e-6,-2.1431087980682735e-8,0.002030943934628873,1.0153584998504719e-5,-2.1669593622508353e-8,0.0020311306708723493,1.0422590466425067e-5,-2.1942323425636325e-8,0.002031217579951732,1.0669289798588603e-5,-2.219275019954811e-8,0.002031222335730858,1.0831796516238949e-5,-2.235778014634001e-8,0.002031193048301995,1.0861890930176747e-5,-2.2388241959551486e-8,0.00203119703859634,1.0746492481003186e-5,-2.2270735146629827e-8,0.002031297195154339,1.0517768776177442e-5,-2.2037844471414716e-8,0.0020315273094421984,1.0243291108028e-5,-2.1758092239078608e-8,0.0020318802493412753,1.0000530434740792e-5,-2.1510081000851584e-8,0.002032314137298937,9.850022664826762e-6,-2.1355340836590286e-8,0.002032770207259545,9.81982278786599e-6,-2.132258299426645e-8,0.0020331917199350323,9.904280503784482e-6,-2.14063888568104e-8,0.002033536949342053,1.0072489993620747e-5,-2.157566092331201e-8,0.0020337847861032054,1.0280151984724976e-5,-2.178555756437125e-8,0.002033934644404204,1.0480633734434917e-5,-2.1988684509594312e-8,0.002034002956023895,1.0633476288885205e-5,-2.2143773497299168e-8,0.0020340179562521273,1.0710065550269308e-5,-2.222152752762457e-8,0.002034013813275749,1.0696609639052564e-5,-2.2207730651406188e-8,0.002034024860105363,1.0594604521297306e-5,-2.2103765848150748e-8,0.002034080587443095,1.0419122419825089e-5,-2.19248717814829e-8,0.0020342019278727854,1.0195455518673118e-5,-2.169670062200928e-8,0.0020343991620295483,9.954802844166271e-6,-2.145091239995425e-8,0.0020346714321390342,9.729785129053017e-6,-2.122063084652677e-8,0.0020350074824118905,9.550386709694598e-6,-2.103636451097717e-8,0.002035387185509016,9.440493583899565e-6,-2.0922533216016104e-8,0.0020357836037984364,9.414912608424384e-6,-2.089444107511516e-8,0.0020361655489376162,9.476655420791237e-6,-2.0955452598258494e-8,0.002036501001353076,9.614310232276557e-6,-2.1094206564680248e-8,0.002036762210872142,9.79994037620005e-6,-2.1282363869390327e-8,0.0020369330481708123,9.989184837192771e-6,-2.1474658477092256e-8,0.002037017771296381,1.012628359366276e-5,-2.1614061269663444e-8,0.002037047915437464,1.015658110540848e-5,-2.164463677168314e-8,0.0020370813026867737,1.0046056108125668e-5,-2.153154985964805e-8,0.0020371875508600258,9.800650799576031e-6,-2.1280773292665346e-8,0.002037421936656467,9.472336381754918e-6,-2.094520101904596e-8,0.0020378005857027153,9.143072453333508e-6,-2.0608270685343048e-8,0.0020382928899801513,8.892876275813154e-6,-2.035149508235166e-8,0.0020388358398022157,8.770499811406708e-6,-2.0224669132370346e-8,0.002039359770557812,8.781941663669052e-6,-2.0234157130035133e-8,0.0020398103504522254,8.897729739466089e-6,-2.0350211586612295e-8,0.0020401588643933475,9.069382952218172e-6,-2.0523629149456965e-8,0.0020404019625274035,9.245293559122839e-6,-2.0701866584475123e-8,0.002040555827693921,9.381504609670853e-6,-2.0840025781472896e-8,0.0020406489259659406,9.447228151930216e-6,-2.0906536788607898e-8,0.0020407154331214734,9.426696770852405e-6,-2.088512838607746e-8,0.00204078985578392,9.318873354513713e-6,-2.077459998128169e-8,0.00204090271395194,9.135845367544504e-6,-2.0587206452044835e-8,0.0020410771407216085,8.900239108317796e-6,-2.034599700431967e-8,0.002041326419699712,8.641807325844239e-6,-2.0081292128129632e-8,0.0020416526435947345,8.393337339943669e-6,-1.982648942593215e-8,0.002042046703171445,8.186237577472187e-6,-1.9613586261310882e-8,0.0020424895896427346,8.046339142518472e-6,-1.9468954219893878e-8,0.0020429547843234747,7.990305000968632e-6,-1.940972395069631e-8,0.0020434115251253306,8.022843551834938e-6,-1.9440936885743926e-8,0.002043828782565443,8.134892448156656e-6,-1.9553616311880043e-8,0.0020441798602190554,8.302917025788585e-6,-1.972393223071845e-8,0.0020444477519546617,8.4896969525292e-6,-1.9913901817449882e-8,0.0020446311903293338,8.647706547103258e-6,-2.0074815114312748e-8,0.0020447501973034107,8.726723226422148e-6,-2.0155077328217368e-8,0.002044848244940901,8.686627904246379e-6,-2.011341515541943e-8,0.0020449867383772256,8.513737749746249e-6,-1.9935671842505055e-8,0.002045228541166259,8.234144633017872e-6,-1.964846070320371e-8,0.0020456134638839763,7.913572361465218e-6,-1.931898185881672e-8,0.0020461377861319533,7.63729312921591e-6,-1.9034476270744172e-8,0.0020467521585061633,7.477202828544634e-6,-1.8868592712503943e-8,0.002047381272856939,7.464688941483806e-6,-1.8853644549237028e-8,0.0020479532062943314,7.58431837206364e-6,-1.8974080315531745e-8,0.0020484215587382487,7.78774400789283e-6,-1.918060677428675e-8,0.0020487722662357426,8.015405362121847e-6,-1.941233147259879e-8,0.002049018198077936,8.214197838192044e-6,-1.9614843383185996e-8,0.0020491889216315115,8.346735295295853e-6,-1.9749735808637718e-8,0.0020493210512069144,8.393632060507522e-6,-1.979700451228811e-8,0.0020494512449664246,8.351957607960816e-6,-1.9753525015406534e-8,0.0020496117250101715,8.23232744734854e-6,-1.963010652990153e-8,0.002049827426776408,8.055769435622714e-6,-1.944827439536342e-8,0.002050114053526486,7.850558869214728e-6,-1.9236989441846953e-8,0.0020504767490431433,7.648847136675355e-6,-1.9029157282885984e-8,0.0020509094756088818,7.482854532348159e-6,-1.8857725613841873e-8,0.002051395453334524,7.380623768682452e-6,-1.8751377321085998e-8,0.0020519090052662243,7.361760387571575e-6,-1.8730230620980626e-8,0.0020524188593675297,7.433818308990292e-6,-1.8802173480598776e-8,0.0020528926844391848,7.589950602549962e-6,-1.8960428834936324e-8,0.0020533024421489844,7.808390524123514e-6,-1.9182928498524213e-8,0.0020536299340462158,8.054192913403938e-6,-1.9433978306497595e-8,0.0020538718361486044,8.283434195619361e-6,-1.9668482974938482e-8,0.0020540434289632683,8.45004521906672e-6,-1.9838956797592828e-8,0.0020541797514216247,8.515402796906978e-6,-1.99054534057615e-8,0.0020543322054149753,8.459930706160225e-6,-1.984759651675978e-8,0.0020545585952090927,8.293944827313858e-6,-1.9675807879402267e-8,0.0020549063810787,8.062431097372e-6,-1.9436246264897823e-8,0.0020553934153247633,7.837497117823304e-6,-1.920304947832446e-8,0.002055995700465939,7.696451661454231e-6,-1.9055809090821722e-8,0.002056651811353018,7.693154521324639e-6,-1.9050112336143213e-8,0.0020572846695030584,7.837818600247798e-6,-1.919671296351236e-8,0.002057829365555983,8.096658859821898e-6,-1.946106441052887e-8,0.002058252145844519,8.409493816274429e-6,-1.978134730901258e-8,0.0020585536030746266,8.712990432294358e-6,-2.0092375696100318e-8,0.002058759808669095,8.957877739096902e-6,-2.0343349339844396e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json
new file mode 100644
index 0000000..4dcccb3
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":17000,"numberOfSamples":1000,"samples":[0.0020589095356776037,9.116105504093818e-6,-2.0505272164235435e-8,0.002059043510293161,9.180255067418492e-6,-2.0570390059257767e-8,0.0020591976431414568,9.159302745262173e-6,-2.054785882824188e-8,0.002059399625909375,9.073759899582225e-6,-2.045874721325323e-8,0.0020596674746746844,8.95148439515232e-6,-2.033170765436402e-8,0.00206000888513569,8.824207938457376e-6,-2.019937465729761e-8,0.002060420904195782,8.724308617167852e-6,-2.0095032184184587e-8,0.0020608899779143205,8.68132520947309e-6,-2.0049049012491025e-8,0.0020613928365786132,8.717972919315283e-6,-2.008482719556681e-8,0.0020618988348358,8.845955809078727e-6,-2.021453482958727e-8,0.002062374125258358,9.062441716260134e-6,-2.0435474508193457e-8,0.0020627874895708226,9.348364762479418e-6,-2.072826871336509e-8,0.0020631169945883126,9.669654112154566e-6,-2.1058015950605946e-8,0.0020633560604633263,9.98198746864013e-6,-2.137908652587735e-8,0.002063517288428266,1.023877017749716e-5,-2.164330411583651e-8,0.002063632645942536,1.0401139220424818e-5,-2.1810299545772995e-8,0.0020637491502467223,1.0448183572471843e-5,-2.185815206205818e-8,0.0020639198525462597,1.0385066085844465e-5,-2.1791885352537092e-8,0.002064190922547863,1.0246206042140799e-5,-2.1646843352671344e-8,0.002064587291919049,1.0090636415679369e-5,-2.1483949591921145e-8,0.0020651014652658243,9.988078798241432e-6,-2.13753442005915e-8,0.002065691367589172,9.998026570269695e-6,-2.1382754626188622e-8,0.002066291012197917,1.0149230388591655e-5,-2.153622147579785e-8,0.002066831501387849,1.0429452683376921e-5,-2.182338975756979e-8,0.002067263169333099,1.0791237145000513e-5,-2.2195367611649683e-8,0.002067568557615017,1.1170401662074308e-5,-2.2585814103541868e-8,0.0020677618994642912,1.1507219742502304e-5,-2.2932879418767003e-8,0.0020678786593962845,1.1760992660056131e-5,-2.319433420100162e-8,0.00206796228678175,1.1914801500387303e-5,-2.3352529680849556e-8,0.0020680536670884195,1.1972789302221374e-5,-2.3411612372762594e-8,0.002068185083895209,1.1954165594086708e-5,-2.339133460421787e-8,0.0020683778972125345,1.1887104070253944e-5,-2.3320744180844544e-8,0.002068642307553408,1.180390121082168e-5,-2.3233173740066774e-8,0.002068977856263579,1.1737393814191125e-5,-2.3162537647244684e-8,0.002069373999389383,1.1717978706675388e-5,-2.3140267827765654e-8,0.0020698107873335274,1.1770514429890422e-5,-2.3192140613020073e-8,0.0020702602014525747,1.1910715973072524e-5,-2.3334573248691355e-8,0.002070688939508567,1.2141252692424613e-5,-2.3570578997251697e-8,0.0020710632916822844,1.2448527390387745e-5,-2.3886375187523575e-8,0.002071356066541742,1.2801803268012288e-5,-2.4250382510760558e-8,0.0020715543319876706,1.3156451701310057e-5,-2.4616491549786515e-8,0.00207166551766087,1.3462116971780244e-5,-2.493246716960177e-8,0.002071719050649512,1.3674624989544023e-5,-2.5152297788431047e-8,0.0020717617377544535,1.3768431742533288e-5,-2.524915847137308e-8,0.0020718472574079074,1.374550081599251e-5,-2.5224700784713937e-8,0.0020720223622184525,1.363727582508806e-5,-2.5111195478472052e-8,0.0020723137031515636,1.3498471162329926e-5,-2.496519243244624e-8,0.002072719191338335,1.339381780152275e-5,-2.485385332221292e-8,0.002073206795757431,1.338096643139214e-5,-2.483723759380846e-8,0.0020737219362692,1.3494245133198445e-5,-2.4951381108780162e-8,0.00207420211020392,1.373455339359368e-5,-2.5197661804572466e-8,0.0020745944143773383,1.4069430089365293e-5,-2.554271199173207e-8,0.002074869746023746,1.4443723774723879e-5,-2.5929405831806994e-8,0.0020750285128816304,1.479667972622433e-5,-2.6294607590510123e-8,0.0020750966176363173,1.5078544268788864e-5,-2.6586483364644268e-8,0.0020751148669499956,1.5260889492796408e-5,-2.677529701011583e-8,0.0020751270004247535,1.5338783722705668e-5,-2.6855711891848633e-8,0.0020751704833224575,1.5326746513909972e-5,-2.684261106263222e-8,0.0020752715762822763,1.5251984116094389e-5,-2.6764080409271047e-8,0.002075444009124103,1.5147762629496005e-5,-2.6654533703698157e-8,0.002075689729548116,1.504827746606285e-5,-2.6549398220846943e-8,0.002076000366210549,1.4985082629739757e-5,-2.6481430881895264e-8,0.002076358657231711,1.498441301720375e-5,-2.6477967033587838e-8,0.0020767397992757677,1.5064587977735741e-5,-2.6558240543651232e-8,0.002077113259954405,1.5233004156103975e-5,-2.6730240753699176e-8,0.0020774459186594374,1.548284453443912e-5,-2.6987226620384064e-8,0.002077707337417931,1.5790500049088474e-5,-2.7304945193864276e-8,0.002077877261826839,1.6115682164498162e-5,-2.764165309505029e-8,0.0020779538822941765,1.6406603632449e-5,-2.7943458192743133e-8,0.0020779594398716464,1.6611353072832964e-5,-2.8156170195329946e-8,0.0020779390055978278,1.6693382219093287e-5,-2.824146792653341e-8,0.0020779502913158923,1.6645409426593984e-5,-2.8191416586278918e-8,0.002078046844161103,1.6494938438233428e-5,-2.803425405045996e-8,0.0020782610782756087,1.6297779276038386e-5,-2.782772424649056e-8,0.0020785941150732565,1.612175588363035e-5,-2.7642241561896423e-8,0.0020790159587568842,1.6027141518751153e-5,-2.754063775278662e-8,0.0020794748756735038,1.6050743503202965e-5,-2.756160492638588e-8,0.0020799118940896845,1.619791239208086e-5,-2.7711253577368164e-8,0.0020802757626315633,1.6443513592555717e-5,-2.7963924844698012e-8,0.0020805345246273253,1.674043522617959e-5,-2.8270877063799093e-8,0.002080681226938013,1.7032634096537527e-5,-2.857380300224129e-8,0.002080732951995497,1.7268943244941685e-5,-2.881925151534997e-8,0.002080724194408864,1.7413982316484317e-5,-2.8970092565580946e-8,0.0020806971435383278,1.745367834708195e-5,-2.901136620869484e-8,0.0020806920260737966,1.7394912621893336e-5,-2.8949975367327408e-8,0.002080739988704213,1.72607815502705e-5,-2.8809768850635676e-8,0.002080859515267317,1.70838985357426e-5,-2.8624560861473263e-8,0.0020810559636607064,1.6899885539921436e-5,-2.8431349761988563e-8,0.0020813230557203376,1.6742274751481572e-5,-2.8265022453786016e-8,0.0020816451171855417,1.6639033795220282e-5,-2.8154767386943654e-8,0.0020819993189068113,1.6610203007369465e-5,-2.812164312243963e-8,0.0020823577851628115,1.6665911699555345e-5,-2.817650914736122e-8,0.0020826899633292987,1.680426930790959e-5,-2.8317770861029884e-8,0.002082966018551884,1.7009150846059025e-5,-2.852896394235378e-8,0.002083162073066397,1.7248756752608075e-5,-2.8777135556946513e-8,0.0020832674579102563,1.7476932878513038e-5,-2.9014151463292816e-8,0.0020832924694833593,1.7639846001218737e-5,-2.9183675584427234e-8,0.0020832727739094805,1.7689422424584678e-5,-2.9235274256026354e-8,0.0020832653064138955,1.7601030960855478e-5,-2.9142946193151746e-8,0.0020833330245630757,1.7387646058308056e-5,-2.8919920603682593e-8,0.002083522753935488,1.7100955802243916e-5,-2.8619808329920083e-8,0.0020838468179513333,1.6815710705222776e-5,-2.8320330725747508e-8,0.002084278439419095,1.6604039049236554e-5,-2.8096659219011013e-8,0.0020847625566020353,1.6512511531122853e-5,-2.799759622144117e-8,0.002085235023267062,1.6551414097566436e-5,-2.8034351982823543e-8,0.0020856408987005555,1.6697366798988196e-5,-2.8183104552679034e-8,0.0020859461245631033,1.690450794263447e-5,-2.8396456266918066e-8,0.0020861415082864985,1.7118421130651345e-5,-2.8617819915088376e-8,0.0020862405867537945,1.7288696492304295e-5,-2.8794501922373435e-8,0.0020862736330299575,1.737809826474195e-5,-2.8887350772104285e-8,0.002086279804006059,1.7367702998098975e-5,-2.8876251011356654e-8,0.0020862990421835854,1.7258011428210435e-5,-2.8761400589556528e-8,0.002086365115922038,1.7066487746353264e-5,-2.8560802190087286e-8,0.0020865008408489875,1.682256943694604e-5,-2.8305053907286174e-8,0.002086715919263949,1.656156014476701e-5,-2.8030941270095572e-8,0.0020870071990390262,1.6318714925791584e-5,-2.7775237638634485e-8,0.0020873606761909773,1.612444436636325e-5,-2.7569706696292268e-8,0.0020877543487093165,1.6001012803300085e-5,-2.7437694306513178e-8,0.0020881612220372825,1.596050578626689e-5,-2.7392040420271822e-8,0.002088552230288847,1.6003549082607828e-5,-2.7433729548710437e-8,0.0020888992435952967,1.611837191802468e-5,-2.7550832366391624e-8,0.0020891786471092483,1.6280160651193357e-5,-2.7717702617435652e-8,0.0020893761169842166,1.6451350603092855e-5,-2.7895164399045403e-8,0.002089492678959948,1.6584503687808136e-5,-2.803347849401429e-8,0.0020895506186168747,1.6629975070205594e-5,-2.8080421596796448e-8,0.0020895956639829702,1.654957839540818e-5,-2.799570583593579e-8,0.002089690395538273,1.6333804471878623e-5,-2.7769090685971695e-8,0.002089896033722322,1.6014373257708863e-5,-2.7433529126734662e-8,0.0020902475806469254,1.5661140369289124e-5,-2.7061908434893643e-8,0.002090735796633609,1.5359270098771867e-5,-2.67432120407e-8,0.00209130859780546,1.5176778132377433e-5,-2.6548672939580005e-8,0.002091891842946931,1.5140754055244766e-5,-2.6506954770801897e-8,0.0020924165245282877,1.5233761825979138e-5,-2.660030176659009e-8,0.002092838108888907,1.5407435049015967e-5,-2.6778581186473033e-8,0.0020931426145603437,1.5602073463539797e-5,-2.697961713028947e-8,0.002093342524197185,1.576303163752042e-5,-2.7146256028244872e-8,0.0020934681224012187,1.5850536534203465e-5,-2.7236664035016808e-8,0.002093558330924372,1.584356238962605e-5,-2.7228488040135843e-8,0.002093652929189025,1.5739702587511593e-5,-2.711885649216876e-8,0.002093786585558144,1.5552692842214613e-5,-2.6921891528832596e-8,0.002093984610700063,1.530847635566744e-5,-2.6664625730728237e-8,0.002094260408522702,1.5040327883243397e-5,-2.6381866829385993e-8,0.0020946146605398033,1.4783590396206654e-5,-2.6110629573656682e-8,0.0020950361908124754,1.4570612940870071e-5,-2.5884801421741135e-8,0.002095504287982403,1.4426464136665532e-5,-2.573066979561237e-8,0.0020959920098880948,1.436589162782448e-5,-2.566378974830331e-8,0.0020964698904481064,1.4391654082877689e-5,-2.568727581986414e-8,0.002096909672107035,1.4494027260271335e-5,-2.5791262682142066e-8,0.002097287955238897,1.4651254484391914e-5,-2.595327902709219e-8,0.0020975898588619776,1.483086589384205e-5,-2.6139490483611765e-8,0.0020978129239909112,1.4992194433574303e-5,-2.6307227096703933e-8,0.002097971126731232,1.5091109530391926e-5,-2.6409931481351222e-8,0.002098097703998993,1.5088284225384236e-5,-2.6405927211233465e-8,0.002098243998954342,1.4961356647547054e-5,-2.6271336291410024e-8,0.002098470643735973,1.4718558663920096e-5,-2.601451060716538e-8,0.002098829142769062,1.4406847413029446e-5,-2.568461021728266e-8,0.002099338584112944,1.4104891981013634e-5,-2.5364227738068856e-8,0.002099970577078888,1.389718581053549e-5,-2.51422113367583e-8,0.0021006554024350413,1.3839945599057747e-5,-2.5077873022135188e-8,0.0021013089162565824,1.3939075366767634e-5,-2.5177804466452004e-8,0.0021018642410454017,1.4152966541286029e-5,-2.5398697748388907e-8,0.002102290544234685,1.4414719463911722e-5,-2.5670555129297722e-8,0.002102593458372229,1.4657717276490355e-5,-2.5923475251490083e-8,0.002102803823419274,1.4832523419603329e-5,-2.610539494337901e-8,0.002102963997051854,1.4912874042482475e-5,-2.6188440763515092e-8,0.00210311701985688,1.489429901720448e-5,-2.6167581509441245e-8,0.00210329981316489,1.4789514144286761e-5,-2.605589711490424e-8,0.0021035395604685125,1.4623216960515582e-5,-2.5879181897882027e-8,0.002103852012857229,1.4427256816148642e-5,-2.5670874573032203e-8,0.0021042409306866908,1.4236166858646234e-5,-2.546731313778813e-8,0.002104698454320543,1.4082882456060734e-5,-2.53031751996881e-8,0.0021052064752133293,1.3994654154339699e-5,-2.5207158431920774e-8,0.0021057391315831625,1.3989407920046565e-5,-2.519818244598461e-8,0.002106266387320575,1.4073050130678136e-5,-2.5282607415599342e-8,0.002106758334830071,1.423820083636465e-5,-2.5452924691916057e-8,0.0021071897012097697,1.4464569256647e-5,-2.568810271807864e-8,0.0021075440763852053,1.4720984983073159e-5,-2.5955605114652786e-8,0.002107817455023985,1.4968991587208612e-5,-2.6215033812032676e-8,0.0021080207898770947,1.5167881763610569e-5,-2.6423345985019315e-8,0.0021081811782254606,1.52812712911579e-5,-2.6541802838830476e-8,0.002108340721814446,1.5285367127017497e-5,-2.6544815228638046e-8,0.002108551393130802,1.5178224387244792e-5,-2.6429882679400344e-8,0.0021088642657054028,1.4987405902763008e-5,-2.6225817522741596e-8,0.0021093131823441873,1.477109413125047e-5,-2.5993980396136906e-8,0.0021098973634679687,1.4606796678395606e-5,-2.5816350529623914e-8,0.0021105729078048107,1.4566334520348138e-5,-2.5769076832392603e-8,0.0021112628777701157,1.4686483996552583e-5,-2.589140375989459e-8,0.002111884963727069,1.49524858304974e-5,-2.616814292368397e-8,0.0021123820416213326,1.530564027223351e-5,-2.653758083888853e-8,0.002112738443062604,1.566943862865359e-5,-2.6919021383359056e-8,0.0021129763380782042,1.597734406587063e-5,-2.7242128079128386e-8,0.002113139906608551,1.6188913189144726e-5,-2.7463982116337144e-8,0.0021132785147635735,1.6292255587917617e-5,-2.7571731956963736e-8,0.002113435244892276,1.6298231436790853e-5,-2.7576542617677282e-8,0.002113641467647694,1.623231108640538e-5,-2.750507948119659e-8,0.0021139155020888497,1.612742596429646e-5,-2.739200662875825e-8,0.002114263195353226,1.601868102419684e-5,-2.7274398004963558e-8,0.002114679097938746,1.5939462619916927e-5,-2.7187584649230205e-8,0.002115147857818045,1.591820498712063e-5,-2.7161697731839154e-8,0.0021156460082405507,1.5975354031712748e-5,-2.7218453269601503e-8,0.0021161445333496127,1.6120489838517026e-5,-2.736813658476198e-8,0.002116612541248858,1.6350066999505276e-5,-2.7607239032229045e-8,0.002117021983644663,1.6646569377117553e-5,-2.791754490148783e-8,0.002117352837098394,1.697979911393296e-5,-2.826741083990463e-8,0.0021175978015787107,1.731065634053247e-5,-2.8615637817191073e-8,0.00211776543378165,1.759725263509948e-5,-2.8917829165943654e-8,0.002117880769420787,1.7802584133189674e-5,-2.9134478291953385e-8,0.002117982886203447,1.7902584529889876e-5,-2.9239569317390042e-8,0.002118119198387002,1.7893289828263934e-5,-2.922832774864068e-8,0.002118336487991736,1.7795584944785858e-5,-2.9122440610658274e-8,0.0021186692843823997,1.7655389538035962e-5,-2.8970402749374115e-8,0.0021191276345471233,1.7536852324466382e-5,-2.8840362727093884e-8,0.0021196884143433207,1.7507199823531867e-5,-2.880401634238384e-8,0.002120295925762307,1.7615411346021366e-5,-2.8913861014445143e-8,0.0021208758106100725,1.787247903713528e-5,-2.9182079529307654e-8,0.002121359406182991,1.8244267405424016e-5,-2.9572807067690778e-8,0.0021217074721560777,1.8663209769622012e-5,-3.0014474124992184e-8,0.0021219209004431955,1.905356541542978e-5,-3.042663828206199e-8,0.0021220343298265485,1.9356536768551152e-5,-3.0746705244532125e-8,0.002122099166839674,1.954377814105041e-5,-3.094431491310143e-8,0.002122166330543905,1.9617217855782224e-5,-3.102119259421685e-8,0.0021222752180405586,1.9600531064406503e-5,-3.100215517299388e-8,0.002122449658514504,1.952878967527067e-5,-3.092419165467688e-8,0.0021226984612435964,1.9440127761138346e-5,-3.082765962692926e-8,0.002123017846957808,1.9370314072744265e-5,-3.075052790344494e-8,0.0021233940681903195,1.934948928989278e-5,-3.0724888774326296e-8,0.0021238056794888474,1.9399952935627528e-5,-3.077458440678296e-8,0.002124225682580438,1.9534193054597844e-5,-3.091310551719368e-8,0.002124624113565031,1.9752886458047202e-5,-3.1141464105636413e-8,0.002124971655833702,2.0043233580223036e-5,-3.144639940286134e-8,0.00212524450155675,2.037859705176521e-5,-3.179992728445566e-8,0.002125429949440885,2.0720660307119964e-5,-3.216153381034379e-8,0.0021255313735390655,2.1024952911718785e-5,-3.2483951488909524e-8,0.0021255706390746042,2.1249553405534983e-5,-3.272236244662322e-8,0.0021255862274255134,2.136531580176944e-5,-3.284530096658392e-8,0.002125626472329969,2.136477599867833e-5,-3.2844230643420137e-8,0.0021257389764561077,2.1266765123494018e-5,-3.273861136499655e-8,0.0021259586471253046,2.1114766388613177e-5,-3.2574325849611996e-8,0.0021262973922635143,2.0968604798671925e-5,-3.241497651320302e-8,0.0021267384416393392,2.0890666115759917e-5,-3.2327268627746654e-8,0.0021272376715695132,2.0929425811587144e-5,-3.236339970670092e-8,0.002127733046172089,2.110460424404699e-5,-3.2545061768599696e-8,0.00212816092546539,2.1399236109442378e-5,-3.2854762929754035e-8,0.0021284746737500223,2.176302809822261e-5,-3.3239236614057686e-8,0.002128658496133636,2.212740460159936e-5,-3.362543623506609e-8,0.0021287304336883744,2.2426834845535454e-5,-3.3943333219980947e-8,0.0021287335646911943,2.2617434207905126e-5,-3.414584047635682e-8,0.0021287204228760234,2.2685679731977404e-5,-3.421817395035784e-8,0.0021287380406940413,2.264602236182866e-5,-3.417535947240264e-8,0.002128818715188701,2.2531501692113913e-5,-3.4052283410800604e-8,0.002128977344015476,2.2382911676892006e-5,-3.3892197642410027e-8,0.002129213263803856,2.2240213464310166e-5,-3.373760006185234e-8,0.0021295139322477768,2.2137245808817076e-5,-3.362460002842891e-8,0.0021298586205894944,2.2099046795842652e-5,-3.358004972356987e-8,0.0021302214146577676,2.2140545104573738e-5,-3.362013028869592e-8,0.0021305737006618716,2.2265607580957118e-5,-3.374931398457121e-8,0.0021308867762918587,2.2466010723704024e-5,-3.39592257518173e-8,0.002131135293920836,2.2720594046935103e-5,-3.4227667717305434e-8,0.0021313019334212695,2.2995565753170124e-5,-3.451884933521096e-8,0.0021313829342262734,2.3247460182788705e-5,-3.4786456209133385e-8,0.0021313929103826883,2.3430080081429465e-5,-3.4981018338903236e-8,0.0021313662623369065,2.35053775592328e-5,-3.506154647311194e-8,0.002131352534668617,2.3455775394926864e-5,-3.500875472352498e-8,0.0021314050619435174,2.3293157757724045e-5,-3.483475480248656e-8,0.0021315656878382726,2.305959461858975e-5,-3.458394904972025e-8,0.002131851148769884,2.2817817875395575e-5,-3.432300884872676e-8,0.002132246675708553,2.2634145895239077e-5,-3.412278123476084e-8,0.0021327093056224787,2.255991732479814e-5,-3.4038512859965103e-8,0.0021331794386085386,2.261762912569421e-5,-3.4094941293936804e-8,0.002133596614516856,2.2795606804280943e-5,-3.4280365800889207e-8,0.0021339148569076657,2.3052078776754165e-5,-3.455073970041519e-8,0.0021341135296762083,2.3327034579694484e-5,-3.484217778475803e-8,0.0021342009716787884,2.355832491670355e-5,-3.508814955727273e-8,0.0021342101969445745,2.3697300658380293e-5,-3.523629751598651e-8,0.0021341884075972216,2.3719450332254015e-5,-3.525994944230765e-8,0.002134184081791398,2.3627331849970435e-5,-3.5161372712859956e-8,0.002134235900463689,2.3446066878692636e-5,-3.4967036409302774e-8,0.0021343663946126897,2.321429430328426e-5,-3.471798296710547e-8,0.0021345807976598918,2.2974350116389325e-5,-3.4459344612988514e-8,0.0021348696549837566,2.2764450779378168e-5,-3.4231980765256686e-8,0.0021352131046345666,2.2613905870942357e-5,-3.4067347153649095e-8,0.0021355851791665065,2.25409643711599e-5,-3.398518306415485e-8,0.002135957353588875,2.255223300982052e-5,-3.3992879723749303e-8,0.0021363013822437923,2.264265540717151e-5,-3.408542886166249e-8,0.0021365919676518924,2.279553658100697e-5,-3.4245382178955386e-8,0.0021368099415358917,2.298274820199354e-5,-3.444296877039347e-8,0.0021369464146205742,2.3165964903851673e-5,-3.463731317033913e-8,0.0021370076236995232,2.3300428516159704e-5,-3.4780406073762714e-8,0.0021370188901841084,2.334275576213467e-5,-3.482548254690987e-8,0.002137024662802771,2.3262920180390915e-5,-3.473993474880969e-8,0.0021370813223880038,2.3057492795026685e-5,-3.451958523389752e-8,0.002137241889275746,2.2757801904735166e-5,-3.41974981982623e-8,0.0021375370262618257,2.2426116340509338e-5,-3.3839966919214845e-8,0.002137961316631726,2.213800200907653e-5,-3.3527737842564464e-8,0.0021384728126343628,2.1957459800264673e-5,-3.332951347872889e-8,0.002139006670366777,2.191643370582827e-5,-3.3280036206354196e-8,0.0021394959229136664,2.2007302232413204e-5,-3.3371904617377737e-8,0.0021398901271324055,2.2189143712365275e-5,-3.3562023526722955e-8,0.002140166006414651,2.2402515162981413e-5,-3.378718549615929e-8,0.002140329077781706,2.2586184572995143e-5,-3.398186921720036e-8,0.0021404083035632985,2.2691063196128188e-5,-3.409319354061641e-8,0.002140446731689183,2.2688976940126358e-5,-3.409045739764433e-8,0.002140490895281052,2.2575699890952926e-5,-3.396857223236857e-8,0.0021405812375513067,2.2368761539972847e-5,-3.374586429282327e-8,0.002140745261299301,2.21013187905107e-5,-3.345758704823717e-8,0.002140994332456639,2.181402372302832e-5,-3.314720913566537e-8,0.002141324077070165,2.15469856889004e-5,-3.285775427864785e-8,0.002141717448243737,2.1333424920190157e-5,-3.262494699138589e-8,0.0021421491254591573,2.1195757227350775e-5,-3.247299004550511e-8,0.0021425900057506363,2.1143998775028036e-5,-3.2412859574264454e-8,0.002143011062769476,2.117578153748411e-5,-3.2442332125159627e-8,0.0021433864887417924,2.1277166088685482e-5,-3.254683206575627e-8,0.0021436964440635616,2.142377656843826e-5,-3.270056832632809e-8,0.0021439298869587705,2.1582271289495213e-5,-3.2867992137633203e-8,0.0021440878674806683,2.1712763255525305e-5,-3.3006289361086e-8,0.002144187054590783,2.1773439803346106e-5,-3.3070310510598916e-8,0.002144262009093983,2.172867744059509e-5,-3.302135431596869e-8,0.002144363336494184,2.156066898233932e-5,-3.2839788635029706e-8,0.0021445484486645283,2.128161554298987e-5,-3.253826914107641e-8,0.0021448640499980975,2.093968006406232e-5,-3.216820242252745e-8,0.0021453256085358927,2.0610778355504582e-5,-3.181096877059883e-8,0.002145905198301666,2.0374493068902587e-5,-3.155211428654284e-8,0.00214653761622983,2.028404497865664e-5,-3.144915450204835e-8,0.002147143609271417,2.0346789600608755e-5,-3.151058660106004e-8,0.0021476575414585346,2.0525272704293914e-5,-3.1696854344447995e-8,0.002148045581613403,2.0755200980876327e-5,-3.193942834876001e-8,0.0021483090662633483,2.0968393190590092e-5,-3.2165288983192186e-8,0.002148476685362016,2.111059951237463e-5,-3.231601401750927e-8,0.002148592188673189,2.115054857145032e-5,-3.235756967674147e-8,0.0021487026050471423,2.108140192452833e-5,-3.2282037014221544e-8,0.002148849218208448,2.091738286919093e-5,-3.2104180012498956e-8,0.0021490617141141114,2.0687943158359667e-5,-3.185531826563116e-8,0.0021493552248900965,2.043093865495207e-5,-3.1576037272193084e-8,0.0021497299103959574,2.018578295980443e-5,-3.1308781112487576e-8,0.0021501726730506327,1.99873898678633e-5,-3.109124846202539e-8,0.0021506604730088547,1.986152543363258e-5,-3.0951322070678607e-8,0.0021511645783630928,1.9821951349432184e-5,-3.0903980935864254e-8,0.0021516549924586936,1.986945352369192e-5,-3.0950285248140185e-8,0.0021521044365688485,1.9992440843010033e-5,-3.107804747030246e-8,0.0021524916686676407,2.016856874486101e-5,-3.126355090492214e-8,0.0021528042317079527,2.0367018571783807e-5,-3.147390414350625e-8,0.002153040804545645,2.0551375958833374e-5,-3.167000555671362e-8,0.002153213305985311,2.0683403675124328e-5,-3.181050955508008e-8,0.002153348503797179,2.0728467991859314e-5,-3.185767901736995e-8,0.002153487865791758,2.06633838486928e-5,-3.178596101433709e-8,0.002153683336498533,2.0486260716953912e-5,-3.159278162166714e-8,0.0021539866168050876,2.022543685029994e-5,-3.130833435668043e-8,0.0021544317139913717,1.9941401323367558e-5,-3.099772567279643e-8,0.0021550161923323133,1.9714632358069782e-5,-3.074786370682314e-8,0.002155692720036186,1.961840203113644e-5,-3.0638105864892124e-8,0.0021563809762338523,1.9688010875520684e-5,-3.070702518398803e-8,0.0021569972223773057,1.990511081944595e-5,-3.0935392402114285e-8,0.002157485124027573,2.0207307545267066e-5,-3.125638734645144e-8,0.002157830955696959,2.0515501898373752e-5,-3.1584963952577884e-8,0.0021580591073866546,2.0761657983135865e-5,-3.1847730058857165e-8,0.0021582161445200332,2.0904745124936695e-5,-3.200013957830926e-8,0.0021583539825240404,2.0933500471754782e-5,-3.20295538061186e-8,0.0021585179343003775,2.0861021855106574e-5,-3.194956386357729e-8,0.0021587404344839763,2.071653038410741e-5,-3.179127525102121e-8,0.0021590389475030915,2.0537441620192218e-5,-3.159486520542445e-8,0.0021594163239126024,2.0362778417702688e-5,-3.140248197378161e-8,0.002159862527034524,2.02278948399552e-5,-3.12524698579826e-8,0.002160357285130327,2.0160345669093216e-5,-3.117480508185589e-8,0.002160873478204498,2.017687657565958e-5,-3.1187780101922056e-8,0.002161381090914999,2.028164028054539e-5,-3.1296077539601465e-8,0.0021618514304895253,2.0465857833124282e-5,-3.1490443368311834e-8,0.0021622611359319007,2.0709012451658273e-5,-3.174899334089471e-8,0.002162595566211041,2.0981352258249935e-5,-3.203986438715612e-8,0.0021628513653473066,2.1247405686018214e-5,-3.232489338007879e-8,0.0021630380775924086,2.1470340095996585e-5,-3.256419591015205e-8,0.0021631786722644116,2.1617083222566323e-5,-3.272164177108625e-8,0.00216330868415945,2.1664275769114177e-5,-3.277135694153426e-8,0.0021634731281762807,2.1605065487863532e-5,-3.2705257492733154e-8,0.0021637197852005,2.1455812436603205e-5,-3.254053477237097e-8,0.0021640877997709013,2.1259948537739125e-5,-3.232400898296171e-8,0.002164592603377122,2.108438739205041e-5,-3.212829934769005e-8,0.0021652124263154904,2.1004045458292953e-5,-3.2034996857797784e-8,0.002165885927123784,2.107545579977581e-5,-3.21059404679378e-8,0.002166528501769656,2.1310646054636276e-5,-3.235474767326647e-8,0.0021670632549307834,2.1668132745757332e-5,-3.273691349900394e-8,0.0021674499574846086,2.2069275229952522e-5,-3.3167461209084994e-8,0.002167695398646148,2.2430414143251984e-5,-3.355576152777364e-8,0.0021678424617177497,2.2691454458900874e-5,-3.383651203996052e-8,0.002167948850623929,2.2828166985303557e-5,-3.398307877885336e-8,0.0021680682294110717,2.2848871903014454e-5,-3.400396925492826e-8,0.002168239621410091,2.2783477264658934e-5,-3.393109259567893e-8,0.0021684843405062296,2.2671975588932204e-5,-3.380744770218485e-8,0.0021688073255370847,2.2555681481195456e-5,-3.367771500329707e-8,0.0021692001470083005,2.247154601714925e-5,-3.358207900819488e-8,0.0021696442585630864,2.2448607182279223e-5,-3.355228837104354e-8,0.0021701141864079454,2.250565226458912e-5,-3.360901884393857e-8,0.0021705808201399487,2.2649663627314837e-5,-3.376013066261044e-8,0.002171014994842116,2.2875029470842755e-5,-3.399981066861581e-8,0.0021713914000250586,2.3163823595123173e-5,-3.430889349840126e-8,0.002171692521788873,2.348758011808522e-5,-3.4656770876542255e-8,0.0021719120261017694,2.381072758144914e-5,-3.500503838425244e-8,0.002172056961163761,2.4095477309522668e-5,-3.531268029929626e-8,0.002172148267756013,2.430773141450824e-5,-3.5542386815216575e-8,0.0021722192183669113,2.4423369339532766e-5,-3.5667380799741086e-8,0.0021723115797911727,2.443412716691192e-5,-3.567793407850738e-8,0.002172469370856416,2.435222243916228e-5,-3.558662383347489e-8,0.002172730141133899,2.4212483806263987e-5,-3.5430893243344456e-8,0.0021731143123856107,2.406994280862633e-5,-3.527059410845282e-8,0.0021736147553494305,2.399049051461565e-5,-3.517783640369402e-8,0.0021741911382967354,2.4033616638707532e-5,-3.5218066388396594e-8,0.0021747750128882433,2.4230582571380168e-5,-3.542607458320517e-8,0.0021752887669595176,2.4567528571206925e-5,-3.5787372573666643e-8,0.002175673052155437,2.49852415759974e-5,-3.623781078312394e-8,0.002175908854725856,2.5399662837313294e-5,-3.668591393596756e-8,0.0021760215228088064,2.5733306593570758e-5,-3.704716213606398e-8,0.002176065901163682,2.5940343519971294e-5,-3.727134201842648e-8,0.0021761034783204496,2.6014370722419524e-5,-3.735101978943853e-8,0.0021761840080405325,2.598057227504093e-5,-3.731306905929495e-8,0.0021763370696546024,2.5881272618678495e-5,-3.7203079961238056e-8,0.002176571964578955,2.5762734966788867e-5,-3.7071131130532555e-8,0.002176881812643163,2.5666444320064544e-5,-3.6962369095902545e-8,0.002177248530362033,2.562462645803108e-5,-3.6912097310867254e-8,0.0021776471185262275,2.56583990067598e-5,-3.694366624460091e-8,0.0021780490847102727,2.577707907708006e-5,-3.706762059466764e-8,0.002178425470464016,2.5977906113517757e-5,-3.7281338682605485e-8,0.002178749995054507,2.6246122306122735e-5,-3.7569099018844795e-8,0.00217900258816672,2.6555835903572176e-5,-3.7903003824289374e-8,0.0021791731432856958,2.687235363923373e-5,-3.8245472427078433e-8,0.002179264774642755,2.715651610226576e-5,-3.8553882093067663e-8,0.0021792954993946666,2.737100012726711e-5,-3.878734993897014e-8,0.0021792972905228126,2.7487801409019163e-5,-3.891485525836279e-8,0.0021793118845096627,2.7495392292255558e-5,-3.8923106738733907e-8,0.0021793835257311045,2.740366279969572e-5,-3.8822101383632065e-8,0.0021795497062576503,2.7244969924330507e-5,-3.864650695887784e-8,0.0021798315902990814,2.70702521421955e-5,-3.845164962605757e-8,0.0021802262299320907,2.693987847972113e-5,-3.8303651911103566e-8,0.0021807030536763806,2.6909868400577606e-5,-3.826434729027413e-8,0.002181207209043901,2.7015773686396604e-5,-3.837346895969279e-8,0.002181671386070132,2.7258810728352984e-5,-3.8633200520179275e-8,0.0021820347882051537,2.7600628586197033e-5,-3.9002200115334744e-8,0.002182263235355336,2.7971926183414146e-5,-3.940491263576584e-8,0.0021823611556105044,2.829417321789066e-5,-3.9755366604696456e-8,0.0021823687183090976,2.8505597620353956e-5,-3.9985695960752894e-8,0.002182345504518596,2.8579166128070304e-5,-4.006587420492795e-8,0.00218234968005574,2.852535965389795e-5,-4.000679786407413e-8,0.0021824224556048176,2.838187447749541e-5,-3.984911376569704e-8,0.0021825822079256305,2.8198197432587352e-5,-3.964648840870845e-8,0.002182826606343748,2.802230424969246e-5,-3.9451180587015695e-8,0.0021831385394179867,2.7892584515013404e-5,-3.930524420287103e-8,0.002183492363313434,2.7834558372804433e-5,-3.9236882225582924e-8,0.00218385884397354,2.7860496490932013e-5,-3.9259933128383583e-8,0.0021842086588251997,2.7970168372585447e-5,-3.937460019364952e-8,0.0021845150758582356,2.815172900254157e-5,-3.956836422313752e-8,0.0021847565668936496,2.838260505830918e-5,-3.9816914283289737e-8,0.002184919839335821,2.8630898322059892e-5,-4.0085638458821643e-8,0.002185003215576358,2.885819450463714e-5,-4.033263381846127e-8,0.00218501956630861,2.9024619642616696e-5,-4.0514173513386934e-8,0.002184997331671042,2.9096343678574037e-5,-4.0592881414629923e-8,0.0021849779434766005,2.9054458176741742e-5,-4.054747138967016e-8,0.0021850086809995705,2.890265974050007e-5,-4.0381253019101765e-8,0.0021851317555203866,2.867039550492026e-5,-4.012573894978999e-8,0.002185372477190764,2.8408972654841787e-5,-3.983659301605007e-8,0.002185730455124099,2.8180528313815657e-5,-3.958174677758403e-8,0.0021861771693066417,2.804251014407566e-5,-3.942450075684918e-8,0.002186661265337064,2.803206489062113e-5,-3.940634962351665e-8,0.0021871205644257144,2.8154906091556042e-5,-3.953453886956924e-8,0.0021874978725242504,2.8382145494403323e-5,-3.977826745766282e-8,0.002187756423815575,2.865671184733779e-5,-4.0075466582978284e-8,0.0021878902551987,2.8908425992492547e-5,-4.0349239996036213E-08,0.0021879255831569328,2.907366219308399e-5,-4.052949755270081e-8,0.002187912085216684,2.9112986253584563e-5,-4.057244739063578e-8,0.0021879072199879612,2.9020292931549317e-5,-4.0470759660277784E-08,0.0021879598630596396,2.8820635503511565e-5,-4.025130399634947e-8,0.0021880992812219192,2.855917509608077e-5,-3.996313733776403e-8,0.002188332056726784,2.8287020621832985e-5,-3.9662060963515264e-8,0.0021886456060208528,2.804939262502735e-5,-3.9397673106991304e-8,0.0021890148819920466,2.7878715380127772e-5,-3.9205757381181164e-8,0.002189409156221178,2.7792378102702624e-5,-3.9105747978824426e-8,0.0021897972687176166,2.7793455583849522e-5,-3.9101439536603146e-8,0.0021901511374968234,2.7872602070577086e-5,-3.9183008468822456e-8,0.0021904481235000325,2.80099950384596e-5,-3.932910624744156e-8,0.002190673074057688,2.8177065500827853e-5,-3.950871255388833e-8,0.0021908206554662854,2.8338483116444323e-5,-3.9683248872783535e-8,0.002190898034144987,2.8455330491275332e-5,-3.980999342254779e-8,0.002190927155960091,2.8490498477234655e-5,-3.9847964078533655e-8,0.0021909449561215767,2.841676049523602e-5,-3.9766800450551744e-8,0.002190999293289918,2.8226395593368268e-5,-3.955740530076425e-8,0.0021911391604951622,2.7938931175521973e-5,-3.924055987672371e-8,0.0021914004248092763,2.7602074739011113e-5,-3.886808440988153e-8,0.00219179202133541,2.7282286475806473e-5,-3.851264350198292e-8,0.002192289357213238,2.704625873866707e-5,-3.82475557684289e-8,0.0021928392696263337,2.6940105864173445e-5,-3.812399760810237e-8,0.0021933752027235077,2.697500409955819e-5,-3.815512007691709e-8,0.002193836370061701,2.712470614302269e-5,-3.8313049345572726e-8,0.0021941837606845793,2.7334592335765326e-5,-3.8538514178115646e-8,0.0021944084668189573,2.753776194502866e-5,-3.875830475133487e-8,0.002194531286417225,2.7672583796492192e-5,-3.890450991618433e-8,0.002194595052600508,2.769704623340426e-5,-3.893040017878978e-8,0.0021946525033668582,2.759686253141467e-5,-3.881953924029014e-8,0.002194753120305771,2.7386090076476726e-5,-3.858667842959779e-8,0.0021949323250686314,2.7100914061041817e-5,-3.82710888669168e-8,0.0021952055424206626,2.678902702000713e-5,-3.792497063521771e-8,0.0021955679291575467,2.6498107213706706e-5,-3.760078207771899e-8,0.0021959986568907772,2.626660204683497e-5,-3.73410335002723e-8,0.0021964674766541165,2.6118501228737073e-5,-3.7172439057852775e-8,0.0021969413113013753,2.60620374695922e-5,-3.7104408935529385e-8,0.0021973894608135576,2.6091132908844254e-5,-3.7130604436828466e-8,0.00219778705276762,2.6188108161646412e-5,-3.7231911539965425e-8,0.0021981171577645352,2.6326541689641457e-5,-3.7379570709525906e-8,0.0021983722862443157,2.647389410124768e-5,-3.753800898406534e-8,0.0021985558494707763,2.6594192238440678e-5,-3.766770585522208e-8,0.0021986837479933113,2.6651537795907375e-5,-3.772898009889921e-8,0.0021987855132714115,2.6615420265459276e-5,-3.76878288712398e-8,0.0021989034252902504,2.646839864760911e-5,-3.752446513210713e-8,0.002199087291365176,2.621516384114665e-5,-3.7243437839789706e-8,0.002199383129417582,2.588937576288623e-5,-3.688130790905145e-8,0.0021998169911259277,2.555241378810931e-5,-3.650538638656394e-8,0.0022003802001003703,2.5279351320183844e-5,-3.619836871761591e-8,0.0022010254563611044,2.513422877506996e-5,-3.603114654032077e-8,0.002201679461595271,2.5145548720641303e-5,-3.603578324988553e-8,0.0022022676262901954,2.5295397762231912e-5,-3.619337702747384e-8,0.0022027384098715387,2.552770043771887e-5,-3.6442911016991864e-8,0.0022030761947726936,2.5769490088737933e-5,-3.6704451465803936e-8,0.0022032999837505608,2.5953710056367697e-5,-3.690413133727294e-8,0.002203452495899009,2.6035101872089713e-5,-3.699166081129466e-8,0.00220358608653898,2.5996726968420892e-5,-3.6947657521712005e-8,0.0022037500668679825,2.584868135819004e-5,-3.678246540474378e-8,0.0022039815599960576,2.562183741456571e-5,-3.6529498934363496e-8,0.0022043004146107474,2.5359154396673204e-5,-3.6235824598435174e-8,0.0022047079845341367,2.510642092784503e-5,-3.595198121736966e-8,0.002205189271399241,2.490392157422305e-5,-3.5722695471243174e-8,0.0022057175485827437,2.4780291065975067e-5,-3.557995202152093e-8,0.002206260229099632,2.4749273402388118E-05,-3.553929040719807e-8,0.0022067847011294868,2.4809362891213233e-5,-3.559935513770356e-8,0.002207263133432532,2.494571788740346e-5,-3.574402276444476e-8,0.0022076757646234684,2.5133391696059046e-5,-3.594599847110066e-8,0.0022080127950028375,2.534094893318031e-5,-3.61707958606488e-8,0.0022082753512539274,2.5533983406702185e-5,-3.6380543421501094e-8,0.0022084759594946783,2.5678586499651885e-5,-3.653770547250637e-8,0.0022086387115195184,2.5745202620986414e-5,-3.6609273231779453e-8,0.002208798772150077,2.5713550443386234e-5,-3.6572240060008746e-8,0.002208999993716592,2.557900040024047e-5,-3.6420802882875486e-8,0.0022092887458073814,2.5359488384672675e-5,-3.6174216899908184e-8,0.0022097025167608603,2.5099812062111692e-5,-3.588172643050776e-8,0.0022102543881308777,2.4867936743048755e-5,-3.56185625830845e-8,0.0022109195242995543,2.4738476511340537e-5,-3.5467648422950415e-8,0.002211634051687777,2.4765337819048855e-5,-3.5489237515539794e-8,0.002212313150289902,2.495636083716276e-5,-3.5692713187243686e-8,0.0022128823429647753,2.526671790565515e-5,-3.602912278257172e-8,0.0022133046472050132,2.5616981016093155e-5,-3.641102991172894e-8,0.0022135888531115686,2.5924578071327065e-5,-3.6747220225829005e-8,0.0022137783155401383,2.6130440340332528e-5,-3.69721280559337e-8,0.0022139309577410685,2.6210438172246873e-5,-3.705850643683236e-8,0.0022141014474845195,2.6172901848814536e-5,-3.7014821330468624e-8,0.0022143303324376486,2.604895373490618e-5,-3.687478915277662e-8,0.002214639802017609,2.5881451700368056e-5,-3.668537821684993e-8,0.0022150338963010646,2.5715502764954452e-5,-3.649643735626844e-8,0.0022155011447347337,2.5591302194405776e-5,-3.6352737563078843e-8,0.0022160184567097205,2.553907975187675e-5,-3.628822151576024e-8,0.0022165557263009628,2.5575938852458807e-5,-3.63223191891732e-8,0.0022170807551756427,2.5704576800506107e-5,-3.6458407892383054e-8,0.002217564030701961,2.591385422119361e-5,-3.668441906146322e-8,0.0022179828448299827,2.6181049859668053e-5,-3.697537858622144e-8,0.0022183242804138395,2.6475407977684876e-5,-3.729737331333177e-8,0.002218586851652362,2.6762362021212276e-5,-3.7612202106384365e-8,0.002218780907528584,2.7007899392426868e-5,-3.7882116402540654e-8,0.00221892800983572,2.718282261799535e-5,-3.807443917791746e-8,0.0022190594291572868,2.7266897794539164e-5,-3.816614008581418e-8,0.002219213643884262,2.7253074171586324e-5,-3.814862701576736e-8,0.0022194321448706397,2.7151812912431053e-5,-3.8032782192625904e-8,0.0022197524438374,2.699457943246866e-5,-3.785310248538782e-8,0.0022201977516507457,2.6834004944931882e-5,-3.7668058896544666e-8,0.0022207647596439554,2.6736960739406968e-5,-3.755241769514929e-8,0.002221414588087056,2.6767401671111417e-5,-3.757801963905858e-8,0.0022220754445295104,2.696116773143545e-5,-3.778551747050506e-8,0.002222662982074354,2.7304481080951647e-5,-3.81602371398771e-8,0.002223112492580615,2.7732335963690483e-5,-3.8630272100101265e-8,0.0022234048892087036,2.815262001038408e-5,-3.9093316095525206e-8,0.002223570353579146,2.8482812379548647e-5,-3.9457507211628694e-8,0.0022236698422765312,2.8677471002609632e-5,-3.9671972494411865e-8,0.002223768955546225,2.8734606819302868e-5,-3.973390147896533e-8,0.002223918561912486,2.8685068606721128e-5,-3.9676852435000445e-8,0.002224146947177898,2.857614254949019e-5,-3.955275079853739e-8,0.002224460584546953,2.8457539680318737e-5,-3.9416539001133896e-8,0.0022248488878112726,2.8372409677147155e-5,-3.931628151961653e-8,0.0022252897394614136,2.8352697862785916e-5,-3.9287926512737694e-8,0.002225754439448891,2.8417200189247082e-5,-3.9352956850409215e-8,0.0022262119752000306,2.8571064147124517e-5,-3.9517646409515605e-8,0.0022266329015272588,2.8806246946617162e-5,-3.977346217838114e-8,0.002226992971723243,2.9102919767945163e-5,-4.009861614536306e-8,0.002227276408541931,2.9431986686848863e-5,-4.046090776146395e-8,0.002227478443459657,2.975881765135786e-5,-4.082189498635584e-8,0.0022276066367046955,3.00479536480172e-5,-4.114208286135804e-8,0.0022276806541805206,3.0268246647568305e-5,-4.1386550741833944e-8,0.0022277304168021564,3.0397850263698415e-5,-4.153044218187168e-8,0.0022277927064168696,3.0428497299104088e-5,-4.1563769098494404e-8,0.0022279064138012593,3.036858246513481e-5,-4.149502940286735e-8,0.002228106506621653,3.0244655302837534e-5,-4.13531517818982e-8,0.0022284166785792644,3.0100550888706932e-5,-4.1186794221321944e-8,0.0022288411897262855,2.9992625796661267e-5,-4.10591614928939e-8,0.0022293578310589434,2.997937361758266e-5,-4.1036340003927136e-8,0.002229915827113162,3.0105006870106393e-5,-4.116870189588894e-8,0.0022304437011137785,3.0380336855881893e-5,-4.146920822621145e-8,0.0022308696821551816,3.0770008843180174e-5,-4.189889481023213e-8,0.0022311489278408515,3.119747911794132e-5,-4.237238494059883e-8,0.002231282975267909,3.157105128869589e-5,-4.278709882978031e-8,0.0022313182697664352,3.181892335039289e-5,-4.3062523712161575e-8,0.0022313244787628863,3.1913280890993805e-5,-4.316712531818715e-8,0.0022313668866389517,3.187208721013959e-5,-4.312031825412391e-8,0.0022314877691962513,3.174329917730292e-5,-4.297493790279011e-8,0.0022317016189136243,3.1584440533183345e-5,-4.2794660080913634e-8,0.0022320000376087473,3.1447193001066374e-5,-4.263700565313382e-8,0.0022323599775302527,3.1369544649942365e-5,-4.2544629399779314e-8,0.0022327512669868426,3.13736485445689e-5,-4.254281430583861e-8,0.0022331420789577098,3.146660704082846e-5,-4.264014632464142e-8,0.002233502662649728,3.164221547907365e-5,-4.283028278424188e-8,0.0022338081602597494,3.188287847991798e-5,-4.309400116155361e-8,0.0022340411058888376,3.216172283638613e-5,-4.340155202858812e-8,0.002234193788318541,3.244531827001491e-5,-4.371572186288535e-8,0.002234270215537642,3.269748772071455e-5,-4.399608728756532e-8,0.0022342870174345488,3.288434625146084e-5,-4.4204595810092806e-8,0.0022342725300309807,3.298010211189754e-5,-4.431198509478476e-8,0.00223426358719864,3.297265366270278e-5,-4.430402838113176e-8,0.002234300042169446,3.28677210223566e-5,-4.4186255163092324e-8,0.0022344176501358816,3.269023712664952e-5,-4.398572890389884e-8,0.0022346404530500393,3.248215526411121e-5,-4.374887676761402e-8,0.0022349739993351363,3.229642695778004e-5,-4.3534981383312984e-8,0.002235400846601725,3.218729338221004e-5,-4.3405375317758714e-8,0.0022358801294424515,3.2197598996961654e-5,-4.3409074494626946e-8,0.0022363531613351687,3.234518444318427e-5,-4.356719715545998e-8,0.0022367562584270713,3.26124404623423e-5,-4.386088239969612e-8,0.002237039364916164,3.2944799036726895e-5,-4.4229360674700297e-8,0.002237184585255663,3.3263008754100455e-5,-4.458371191536925e-8,0.0022372152097443723,3.348808466964168e-5,-4.4835003790813605e-8,0.002237188268790842,3.356890037152168e-5,-4.492538522979582e-8,0.002237172973766367,3.3498373396684425e-5,-4.4846285550617134e-8,0.002237226446062347,3.331063740330506e-5,-4.463527151098567e-8,0.0022373785866876966,3.306356285861056e-5,-4.435657408777556e-8,0.0022376301801785795,3.281796598936418e-5,-4.407798109343235e-8,0.002237960293002327,3.262266212632057e-5,-4.385422435645071e-8,0.0022383364907900727,3.250798890852662e-5,-4.371970523753345e-8,0.002238723456645966,3.2485676809755455e-5,-4.3688197681211816e-8,0.0022390886143439774,3.255173487689696e-5,-4.3755889161178954e-8,0.002239405282078471,3.2689939993701276e-5,-4.390514695537152e-8,0.002239654500276259,3.2874917872497975e-5,-4.410791058122196e-8,0.002239826466603891,3.3074841894149056e-5,-4.43287154816248e-8,0.0022399219825763365,3.325431872964785e-5,-4.452793608909369e-8,0.00223995372724577,3.337818442270938e-5,-4.466602508507044e-8,0.002239946609945796,3.341665474095889e-5,-4.4709250539583116e-8,0.0022399361149010558,3.335152643078121e-5,-4.463662869840457e-8,0.0022399637177205746,3.318214901741799e-5,-4.4446666383878356e-8,0.0022400692719222156,3.292908438196356e-5,-4.4161604326662625e-8,0.0022402815961347503,3.263324461259011e-5,-4.382667142532589e-8,0.0022406097829435986,3.234928937051243e-5,-4.35029200728048e-8,0.0022410381982317313,3.2133989991873885e-5,-4.325433505758617e-8,0.002241527366860039,3.2032192958380706e-5,-4.31320710589e-8,0.002242021338402319,3.206407169227447e-5,-4.315991919307524e-8,0.002242460373611949,3.22173758634287e-5,-4.3325235858678146e-8,0.0022427962572554097,3.244758975145919e-5,-4.3578759913273076e-8,0.002243006285647738,3.268735329396462e-5,-4.384500203668317e-8,0.002243101254106713,3.2863977904254935e-5,-4.4041959824776854e-8,0.002243123492551911,3.292048609982193e-5,-4.410494856355586e-8,0.0022431341784470964,3.283271918257909e-5,-4.400603585822717e-8,0.002243194132145136,3.261533508896748e-5,-4.376093452019552e-8,0.0022433459529788004,3.2314277942817154e-5,-4.342065606321087e-8,0.0022436045440565053,3.198999227156275e-5,-4.305276261895022e-8,0.002243958133515982,3.169947891807182e-5,-4.2721289735892826e-8,0.002244376640907042,3.148388477407264e-5,-4.2472798095789184e-8,0.0022448221512804886,3.136378685678507e-5,-4.233096289601714e-8,0.0022452575632132565,3.134045113321896e-5,-4.2297823602288997e-8,0.002245652005153063,3.139999666608745e-5,-4.2358322241039085e-8,0.002245983472810847,3.151802159817808e-5,-4.248543069195238e-8,0.0022462398578507008,3.166353197668659e-5,-4.2644554056704593e-8,0.002246419446397792,3.180211929402931e-5,-4.2797108244559135e-8,0.0022465314514837314,3.1898991863196846e-5,-4.290391686790522e-8,0.0022465964763423293,3.192267915682146e-5,-4.292934587877446e-8,0.0022466461542808808,3.185001140863545e-5,-4.2846882077462555e-8,0.0022467207138888905,3.1672240851810194e-5,-4.264604611928958e-8,0.0022468631990779767,3.140089843834509e-5,-4.2339079016408486e-8,0.0022471100388813652,3.1070610463486265e-5,-4.196427300171984e-8,0.002247479746499827,3.073566784992554e-5,-4.158230565870342e-8,0.0022479638331529823,3.045874199951375e-5,-4.1263714808448154e-8,0.002248524763253154,3.02937857422682e-5,-4.1069733388505545e-8,0.002249103611883865,3.0268960024283786e-5,-4.1032988729356464e-8,0.0022496357222364597,3.0376558929030593e-5,-4.114590430823665e-8,0.002250068824548509,3.0574158665270486e-5,-4.1361647414439126e-8,0.0022503772247836114,3.07964029825346e-5,-4.160710741763205e-8,0.002250567802057482,3.097301904580212e-5,-4.1803061544443096e-8,0.002250676749711126,3.1047324392743566e-5,-4.188509138902905e-8,0.0022507586723131802,3.099010340839463e-5,-4.1819420951854353e-8,0.002250871480347393,3.080538471041008e-5,-4.1609680129912226e-8,0.0022510615188335178,3.052699532297764e-5,-4.1293253390966694e-8,0.002251353179262093,3.0207520227351978e-5,-4.092900157619033e-8,0.0022517456031207373,2.990365199999711e-5,-4.058081653528731e-8,0.002252216441744965,2.966277801546249e-5,-4.0302454700107246e-8,0.0022527301904458124,2.9514465763670236e-5,-4.012779775956819e-8,0.0022532475943158755,2.9467955847632948e-5,-4.0067851081194045e-8,0.0022537333307623537,2.9514413442723212e-5,-4.0113146302274113E-08,0.0022541607881451917,2.9631644844628163e-5,-4.023900335211374e-8,0.002254514189838657,2.9789237110179563e-5,-4.041133614434692e-8,0.0022547890266936274,2.9952985275678716e-5,-4.059167064094272e-8,0.0022549917913854377,3.0088440765969818e-5,-4.074114160771088e-8,0.0022551396035145384,3.016407696389352e-5,-4.08240201186456e-8,0.0022552597216511264,3.015481429148342e-5,-4.081164539487939e-8,0.0022553882919875423,3.0046508802163843e-5,-4.0687495180085486e-8,0.002255567099077569,2.9841357504034444e-5,-4.045337540522603e-8,0.0022558369388607233,2.9562838755949134e-5,-4.0135156504026914e-8,0.0022562271875581842,2.9257130726269753e-5,-3.978455631529007e-8,0.0022567436326642507,2.898714903281843e-5,-3.947255364662877e-8,0.0022573598823487835,2.8817209579511943e-5,-3.927213390100102e-8,0.002258018966071855,2.8791605493017066e-5,-3.923404737454537e-8,0.002258648117312685,2.891633036493332e-5,-3.936599702943412e-8,0.0022591820275492096,2.9154153382066135e-5,-3.962682189325287e-8,0.0022595839247476135,2.9436595028559185e-5,-3.993977198480979e-8,0.00225985505008105,2.9686790215993037e-5,-4.021816649643196e-8,0.002260030241699472,2.9842461088519565e-5,-4.039130403089442e-8,0.002260164133587199,2.9870701143892955e-5,-4.042125712911031e-8,0.0022603147060398874,2.9772008334002676e-5,-4.0307640364203134e-8,0.002260529356679789,2.957539212424842e-5,-4.008236218492744e-8,0.0022608360709949985,2.9328088618681445e-5,-3.9798262676794195e-8,0.002261240279369694,2.9083351681059975e-5,-3.951545849385412e-8,0.0022617268003365322,2.888909043567816e-5,-3.9288472509905356e-8,0.0022622655482008036,2.8779388123142624e-5,-3.915647214350556e-8,0.002262819189102602,2.8770098261314698e-5,-3.913805732001187e-8,0.002263350798057785,2.88586129564398e-5,-3.92308125522209e-8,0.0022638299762149723,2.9026875547142857e-5,-3.9414639258724473e-8,0.00226423666135669,2.9246199189130553e-5,-3.9657234352431613e-8,0.0022645626786873415,2.9482478245198007e-5,-3.992005306099529e-8,0.0022648116674165116,2.9700822468235492e-5,-4.016358408751382e-8,0.0022649981596772123,2.9869345096513426e-5,-4.0351602493104255e-8,0.00226514630501003,2.9962411033835785e-5,-4.04547762743576e-8,0.002265288298830657,2.9963862391270176e-5,-4.045428268554886e-8,0.0022654620702153745,2.9870664852001304e-5,-4.034600056798178e-8,0.002265707212446325,2.969691295175194e-5,-4.0145217890832345e-8,0.002266057956294179,2.947691133511338e-5,-3.9890345763315734e-8,0.0022665329039003286,2.926444328548644e-5,-3.964227072360827e-8,0.0022671236887107245,2.9124484378898093e-5,-3.9475022511818455E-08,0.002267788240646869,2.9115420126813518e-5,-3.945552451759843e-8,0.0022684561262601086,2.9265821438624493e-5,-3.9617054061131354e-8,0.0022690490903026677,2.955733641213853e-5,-3.993960157280089e-8,0.002269509515122626,2.992626254599793e-5,-4.035147042985752e-8,0.00226982162214845,3.0286068029203308e-5,-4.0754733553186254e-8,0.0022700138757717004,3.055897303667495e-5,-4.1061025649979134e-8,0.0022701436737226793,3.069989577380529e-5,-4.1218699906638504e-8,0.00227027517647685,3.070387520696665e-5,-4.122131101616223e-8,0.002270461042897145,3.059919619723711e-5,-4.1100011651257346e-8,0.002270732689133939,3.0433729733369717e-5,-4.090835113136894e-8,0.002271098337780852,3.026097227227714e-5,-4.070670005595391e-8,0.002271546105525531,3.012906258930677e-5,-4.0549886052690306e-8,0.002272049606456396,3.007354356655947e-5,-4.0478868217575704e-8,0.0022725744638758933,3.011354728086309e-5,-4.051615436512521e-8,0.0022730847790649704,3.0250954443169037e-5,-4.066458322488583e-8,0.002273548838725809,3.047206367789406e-5,-4.0909059104787467e-8,0.0022739434936463994,3.075113090835044e-5,-4.1220551846418976e-8,0.0022742568636345524,3.105504186902545e-5,-4.156147942044127e-8,0.0022744892839467825,3.134835492335001e-5,-4.189151521878511e-8,0.0022746527416301044,3.159798737144839e-5,-4.217292294439811e-8,0.0022747692873981264,3.177714018497166e-5,-4.237495585906838e-8,0.0022748688113758886,3.186850606857967e-5,-4.247743480535395e-8,0.002274986290774487,3.186699225575003e-5,-4.2473855910760004e-8,0.0022751583117732004,3.178213127539921e-5,-4.237427673206388e-8,0.0022754182619907173,3.1640017291713195e-5,-4.2207768491395545e-8,0.0022757894556965316,3.1483670873694755e-5,-4.202308555544977e-8,0.0022762763149492913,3.1369490725813464e-5,-4.188476186116999e-8,0.002276855832823401,3.135697026894548e-5,-4.186133900931318e-8,0.0022774744421386866,3.1490633861351893e-5,-4.200454099581501e-8,0.0022780569340058936,3.177865036092299e-5,-4.232457983909165e-8,0.0022785298502353986,3.217986098398422e-5,-4.277512950721424e-8,0.002278850878859694,3.261186828087253e-5,-4.326249088421801e-8,0.002279027127460274,3.29810254809563e-5,-4.3679853601427606e-8,0.0022791101135152944,3.3218485070021266e-5,-4.3948435338700015e-8,0.0022791716138773816,3.33017751806445e-5,-4.404203618293163e-8,0.0022792763622203156,3.325354630218967e-5,-4.3985619723857855e-8,0.0022794650184009696,3.312474867222378e-5,-4.3836336864797965e-8,0.0022797502493714416,3.297479872131966e-5,-4.3661248003750406e-8,0.00228012142820996,3.285672340462785e-5,-4.35206528604119e-8,0.0022805525144040995,3.2809069538178984e-5,-4.3458910771532503e-8,0.002281009749824412,3.28530678199272e-5,-4.350102367560977e-8,0.002281457946481573,3.299290573495884e-5,-4.3652647942342574e-8,0.0022818653863613037,3.3217663060474e-5,-4.390203862093646e-8,0.0022822076095379298,3.350430854908523e-5,-4.4223341324998374e-8,0.0022824701581385626,3.38215008984268e-5,-4.458094556850484e-8,0.0022826501909389498,3.413398695711384e-5,-4.493459121134231e-8,0.0022827568168762593,3.44073498830337e-5,-4.524485208989148e-8,0.0022828100447377627,3.4612658901913384e-5,-4.547843105508966e-8,0.0022828384740465075,3.4730475087631895e-5,-4.561266796396316e-8,0.002282876011570533,3.475388096679199e-5,-4.5638964500433376e-8,0.002282957848421652,3.469040464851831e-5,-4.5565062411767125e-8,0.0022831158204580496,3.456271833872463e-5,-4.541606069616092e-8,0.0022833731202049406,3.440786048574832e-5,-4.5233819572801423e-8,0.0022837383081319583,3.427425554837967e-5,-4.507378989735375e-8,0.0022841992424606486,3.42151255976047e-5,-4.4997528462908375e-8,0.0022847190630679586,3.427694413898361e-5,-4.505929978605274e-8,0.0022852381039333777,3.448341082476899e-5,-4.528736898920922e-8,0.002285686017006873,3.4819631970934466e-5,-4.566551541864208e-8,0.0022860045965692596,3.522625967483624e-5,-4.6126130449042295e-8,0.0022861729555042707,3.5613274931110104e-5,-4.65660689031637e-8,0.002286219685653516,3.5892392446296056e-5,-4.688394305335418e-8,0.002286211691889868,3.601177133491025e-5,-4.7019944247694604e-8,0.002286225505956513,3.5972626779050686e-5,-4.697479161031815e-8,0.0022863188543598124,3.58205873724714e-5,-4.6799832485411654e-8,0.00228651668635773,3.562198060753e-5,-4.6570120297171264e-8,0.002286812966928041,3.5440632292562546e-5,-4.635820450409294e-8,0.002287180868527256,3.532389707738892e-5,-4.6218365864022434e-8,0.002287583967878681,3.5298098790532246e-5,-4.618136168410986e-8,0.0022879848284268977,3.536980504236021e-5,-4.6255633734096165e-8,0.0022883504197809537,3.552946613083765e-5,-4.643115703668337e-8,0.002288655274879669,3.575541538610793e-5,-4.668378554344655e-8,0.0022888834463104927,3.60176745468646e-5,-4.697952823998258e-8,0.002289029789277668,3.6281738912671874e-5,-4.727893103740416e-8,0.002289100595889158,3.65126058036671e-5,-4.754178038619249e-8,0.0022891133320047745,3.667916372430841e-5,-4.773217946936401e-8,0.0022890950961498148,3.675871799412574e-5,-4.782371311654076e-8,0.0022890795607725576,3.674100774676719e-5,-4.7804003549630296e-8,0.002289102527511509,3.663093644990813e-5,-4.767785241181172e-8,0.002289196541348638,3.644938070154096e-5,-4.746830614559982e-8,0.0022893851939173337,3.6231636872978196e-5,-4.7215134114218746e-8,0.002289677840039512,3.602331407239086e-5,-4.6970406519053876e-8,0.0022900654708520327,3.58736629553553e-5,-4.679101983320465e-8,0.002290518708418688,3.582634915501503e-5,-4.6728061346799346e-8,0.0022909894789891827,3.590809695929047e-5,-4.681348212371508e-8,0.002291418352774001,3.611712058525191e-5,-4.704638370723802e-8,0.002291748752111823,3.641569025232455e-5,-4.7384109668672996e-8,0.0022919460643483626,3.6733133288591057e-5,-4.774556420547209e-8,0.0022920143328060607,3.6983858880081674e-5,-4.803206329891999e-8,0.002291999814615806,3.7096977477987554e-5,-4.8161604641847836e-8,0.002291975474626928,3.704374634491269e-5,-4.8100515063701843e-8,0.0022920128248449328,3.6846970662485426e-5,-4.787422973248501e-8,0.0022921567275596033,3.656759825553701e-5,-4.7551933742153225e-8,0.0022924155206640656,3.627866505605262e-5,-4.721685937218435e-8,0.0022927669894349093,3.6041857596996885e-5,-4.6939648387720506e-8,0.002293172035520522,3.589533984270876e-5,-4.676448884083824e-8,0.002293587774220062,3.585234950794764e-5,-4.670737294106673e-8,0.00229397625599273,3.5905780732209896e-5,-4.676107434656356e-8,0.0022943087935883965,3.603438248915831e-5,-4.690198432790658e-8,0.0022945674627496593,3.6208248273547327e-5,-4.709625363021303e-8,0.0022947453752612396,3.639309951270794e-5,-4.730469355160464e-8,0.002294846618012875,3.655385217382977e-5,-4.748694572871607e-8,0.0022948859966711527,3.6658142221179055e-5,-4.760561192507473e-8,0.0022948882229804706,3.66802485027254e-5,-4.7630789899419904e-8,0.002294885915277481,3.660536515102313e-5,-4.754496057001509e-8,0.0022949158390162044,3.64335141641052e-5,-4.7347464493291285e-8,0.002295013303258485,3.6181877526743895e-5,-4.705723761896796e-8,0.0022952053707549756,3.5884255428738196e-5,-4.6712359540665154e-8,0.0022955042500871392,3.558678939109289e-5,-4.6365392836542746e-8,0.002295902637857623,3.534001900618766e-5,-4.607449202272132e-8,0.002296372603345501,3.518847407688666e-5,-4.5891531629784525e-8,0.002296868936882388,3.515979486113663e-5,-4.584945571699113e-8,0.002297337100875107,3.525571375908133e-5,-4.595154991513938e-8,0.0022977251112613487,3.54474663309797e-5,-4.6165727461002804e-8,0.002297997511006086,3.567828648084553e-5,-4.642708208073091e-8,0.0022981479038201797,3.587486868504097e-5,-4.665101902295781e-8,0.0022982048890346418,3.59670990491837e-5,-4.6756152857442506e-8,0.0022982264993906746,3.591076706084595e-5,-4.66907281238414e-8,0.00229828244392896,3.570370688981107e-5,-4.645139989864305e-8,0.0022984305793150974,3.538654013029307e-5,-4.6084187811529834e-8,0.002298698613153666,3.502687277549902e-5,-4.5666380520174655e-8,0.0022990791902976694,3.4695334694455384e-5,-4.5279093849930466e-8,0.0022995381727997865,3.4445276278051516e-5,-4.49839970221804e-8,0.002300029218953335,3.430321854904224e-5,-4.4812265883725474e-8,0.0023005071520190556,3.426970567379333e-5,-4.4765358220823394e-8,0.0023009363058259054,3.432593949783263e-5,-4.4822399265362546e-8,0.0023012938617268945,3.444159290053393e-5,-4.494899788620879e-8,0.002301570006953491,3.458126436569647e-5,-4.51046246777301e-8,0.002301766800108603,3.470904311234521e-5,-4.524791553057968e-8,0.002301896888738061,3.479179416047871e-5,-4.534053254240823e-8,0.002301982375857608,3.480208071788327e-5,-4.535057802732492e-8,0.0023020534602801847,3.472142304601621e-5,-4.525634915545079e-8,0.0023021460538406057,3.454404162586172e-5,-4.505063369302154e-8,0.002302297520970304,3.4280415377693827e-5,-4.474483116108385e-8,0.00230254017354546,3.395911142067943e-5,-4.4371164167657605e-8,0.0023028932564570586,3.3624877587848964e-5,-4.398066536436923e-8,0.0023033555964254958,3.333152309155398e-5,-4.3635188638132984e-8,0.0023039020503271127,3.312995217770553e-5,-4.339376844190064e-8,0.002304486385520222,3.305425894193706e-5,-4.329658172175806e-8,0.002305051035348368,3.3110519998397165e-5,-4.335181227808648e-8,0.0023055413708626526,3.3272560571329226e-5,-4.353040435431237e-8,0.0023059202737308734,3.348666573581906e-5,-4.3771124818958763e-8,0.0023061786570983014,3.368428524135492e-5,-4.3994995923487775e-8,0.0023063388048928817,3.379947725797813e-5,-4.412542796611055e-8,0.0023064492323863275,3.378653186463361e-5,-4.410875759920423e-8,0.0023065718780325255,3.363277880294064e-5,-4.392931753536871e-8,0.0023067648430645355,3.336223440573916e-5,-4.361391666217241e-8,0.0023070660644278905,3.302816568314063e-5,-4.322345795297547e-8,0.002307483727852774,3.269679339994018e-5,-4.2834243518091083e-8,0.0023079967124393116,3.242829025455311e-5,-4.2516054578377455e-8,0.002308563857239961,3.2262195589673835e-5,-4.2315205384790976e-8,0.0023091372052619127,3.221149782256434e-5,-4.224750159055635e-8,0.002309673844341424,3.2265073740245427e-5,-4.2300823774791806e-8,0.0023101432068525158,3.239501720334835e-5,-4.244342832539441e-8,0.0023105295861446016,3.256496006872504e-5,-4.2633513685632894e-8,0.0023108314009869526,3.2736917316135974e-5,-4.282717939490637e-8,0.002311059046577513,3.287596311964373e-5,-4.298390962236588e-8,0.0023112325956021447,3.2953249680788354e-5,-4.30701110947523e-8,0.00231137979665109,3.294831861010061e-5,-4.306178209267358e-8,0.0023115340997543143,3.285151044406728e-5,-4.2947275355292e-8,0.0023117319317365243,3.2666777386046935e-5,-4.2730561942988145e-8,0.0023120082445560355,3.241439708027806e-5,-4.243445694518821e-8,0.0023123897136956896,3.213200948149292e-5,-4.210197938273945e-8,0.002312886188388601,3.1871514418046985e-5,-4.179294978549619e-8,0.0023134830361791667,3.168968477884489e-5,-4.157326718028376e-8,0.0023141388246951094,3.163282940214068e-5,-4.149718047268907e-8,0.002314792329840861,3.172005820484998e-5,-4.158778555622238e-8,0.002315378896673669,3.193290371843414e-5,-4.182474929661659e-8,0.0023158505127047306,3.2217740072628357e-5,-4.214680612835947e-8,0.0023161909435828218,3.2501262856054346e-5,-4.2469442360932653e-8,0.002316419671183998,3.271254277366566e-5,-4.27103290681903e-8,0.0023165841921237427,3.2802780436011716e-5,-4.2812247472897776e-8,0.0023167450214273137,3.2756541656388914e-5,-4.275628838705075e-8,0.0023169591271539453,3.259272819167442e-5,-4.256326379538918e-8,0.0023172663812004936,3.2356898186037265e-5,-4.228512778642178e-8,0.0023176817453812227,3.2108186977599e-5,-4.199006993769168e-8,0.002318194185054491,3.1904582986137214e-5,-4.174553762547756e-8,0.00231877176791076,3.1790160014621046e-5,-4.1603324561922454e-8,0.002319371007020906,3.1787119353049104e-5,-4.159008391244041e-8,0.0023199475183516252,3.189400454355314e-5,-4.17049622110272e-8,0.0023204650305293554,3.20894591354611e-5,-4.1923747329153166e-8,0.002320900868517307,3.2339315150879754e-5,-4.220702939293869e-8,0.0023212476092142357,3.260440417190498e-5,-4.2509329097549e-8,0.0023215118356965506,3.284715719192341e-5,-4.278686762213579e-8,0.0023217113982006393,3.3036182323788574e-5,-4.300295310375987e-8,0.002321872364162279,3.314903836216729e-5,-4.313120169100703e-8,0.0023220262092654128,3.3173971066507745e-5,-4.315751282036905e-8,0.002322207158400309,3.311135649858902e-5,-4.3081732272613976e-8,0.0023224491028571363,3.297521373884765e-5,-4.291948491394481e-8,0.002322781228382118,3.279447518776715e-5,-4.270382165655561e-8,0.0023232216822924234,3.261266466520483e-5,-4.248505510679363e-8,0.002323769722566849,3.2483621858754785e-5,-4.2325943183644296e-8,0.002324398904211897,3.2460944922610885e-5,-4.228942774440365e-8,0.002325056179267136,3.258120401470381e-5,-4.241896142727533e-8,0.002325671964702718,3.2846122159074696e-5,-4.271751943685757e-8,0.00232618144268266,3.321386581244003e-5,-4.3137207029593565e-8,0.0023265488268709705,3.36082031220369e-5,-4.3589753742231386e-8,0.0023267814240886583,3.394420957442691e-5,-4.397636855767629e-8,0.0023269254239565483,3.415782391829717e-5,-4.422212158225807e-8,0.002327046906947544,3.422452814123435e-5,-4.429770088385412e-8,0.002327209206277997,3.4160981089080925e-5,-4.422143906155781e-8,0.002327456336525311,3.401357864203633e-5,-4.4046282714445835E-08,0.002327805923589105,3.384194337626255e-5,-4.384093488623098e-8,0.002328250166554385,3.37036441574621e-5,-4.3672328614357636e-8,0.002328761740259225,3.364315089403521e-5,-4.3592791245387643e-8,0.002329301915681379,3.36856352720997e-5,-4.3632602011700155e-8,0.002329829055291661,3.383516729126079e-5,-4.379753708045467e-8,0.0023303062390849644,3.407663050535043e-5,-4.407078165874924e-8,0.0023307070359199853,3.438049828740393e-5,-4.441833484198168e-8,0.0023310187619350036,3.470925636680583e-5,-4.4796515547741785e-8,0.0023312431048083324,3.502410718649536e-5,-4.515990686671555e-8,0.002331394528886721,3.5290797443504604e-5,-4.5468276438613356e-8,0.002331497260081565,3.5483844383961805e-5,-4.569154976787356e-8,0.002331581733856791,3.558904226640621e-5,-4.581270005257149e-8,0.0023316810811048884,3.560465423137779e-5,-4.582909582100883e-8,0.002331827771099224,3.5541816076164474e-5,-4.575300867708182e-8,0.0023320501595354027,3.542447396167401e-5,-4.561169901534009e-8,0.0023323683909373285,3.528871876135906e-5,-4.5446880835164095e-8,0.0023327891822946096,3.51805346933835e-5,-4.531231018055253e-8,0.002333299958278486,3.515015003696038e-5,-4.52672578511267e-8,0.0023338645432176663,3.5241270465413334e-5,-4.5363790266725256e-8,0.002334424562220092,3.5475412457926315e-5,-4.562814505895616e-8,0.0023349112408662287,3.583613212030472e-5,-4.6041947983230845e-8,0.002335268146958933,3.626338247097496e-5,-4.6535418255023436e-8,0.0023354760591965088,3.666773954728629e-5,-4.700402689339779e-8,0.0023355644528050535,3.696270836812873e-5,-4.7346394509497067e-8,0.002335600051392683,3.7098371862978543e-5,-4.75036656435806e-8,0.002335658860810056,3.707695140177438e-5,-4.747763880896117e-8,0.0023357987401432536,3.694435600604198e-5,-4.732093922172631e-8,0.002336045463982361,3.6767616798790464e-5,-4.711093689128459e-8,0.002336393449628172,3.661235323283033e-5,-4.6923808409687194e-8,0.00233681482692482,3.6528212315890726e-5,-4.68177625437056e-8,0.002337270388702322,3.6542959451067806e-5,-4.682607312286444e-8,0.0023377189367930666,3.66625719363429e-5,-4.6956871248297825e-8,0.002338124071548144,3.687450363014641e-5,-4.7196561629315964e-8,0.002338458716826444,3.71523445299233e-5,-4.75149713046986e-8,0.0023387078440758034,3.7461115310449495e-5,-4.787144263559505e-8,0.002338869585723431,3.7762817841687184e-5,-4.822140859107426e-8,0.0023389547817296704,3.802184043837775e-5,-4.852287616148231e-8,0.0023389850485431105,3.820974950563554e-5,-4.87421532200505e-8,0.002338989627065774,3.830895059743735e-5,-4.885815585004515e-8,0.0023390014899789605,3.8314840733578865e-5,-4.8864887051675046e-8,0.002339053227796983,3.823643256374001e-5,-4.8772155817743224e-8,0.0023391730470084114,3.809565596331883e-5,-4.860485990028719e-8,0.002339381007965399,3.7925524692509784e-5,-4.840106376674009e-8,0.0023396854228536312,3.776719520424567e-5,-4.82088209371393e-8,0.0023400793116841023,3.76654727255943e-5,-4.808107898018889e-8,0.002340537481346002,3.766178500501879e-5,-4.8067398459253976e-8,0.0023410160318337752,3.778395059438169e-5,-4.820166978989883e-8,0.0023414571514578423,3.8033753723512084e-5,-4.8487112668261064e-8,0.002341802014567862,3.837655741982126e-5,-4.888372230559299e-8,0.0023420114228051465,3.874102641968516e-5,-4.930783648964436e-8,0.0023420863661792065,3.9036695298684036e-5,-4.965293287954776e-8,0.0023420745217566197,3.918717458210972e-5,-4.982885057806455e-8,0.0023420538209714603,3.91622722916344e-5,-4.9799546790811774e-8,0.0023421004046062298,3.8988852688015025e-5,-4.959573407663678e-8,0.0023422602630217295,3.8734768578304047e-5,-4.9296049457022376e-8,0.0023425391360975905,3.847893082192605e-5,-4.899224673303789e-8,0.0023429102765989336,3.828568044273994e-5,-4.8759531463412606e-8,0.0023433299940436355,3.819251167163617e-5,-4.8642341136861975e-8,0.0023437518655280796,3.8209551159922836e-5,-4.865357708177263e-8,0.0023441359775748295,3.8325147109487965e-5,-4.87807783260245e-8,0.002344453495623456,3.8512988018584136e-5,-4.8994075741131246e-8,0.002344688236531956,3.873852777500904e-5,-4.9253489797137967e-8,0.0023448367420634006,3.896429832747165e-5,-4.951513690495988e-8,0.002344907563344286,3.915445172418351e-5,-4.973668851539436e-8,0.002344919846223446,3.927885131661452e-5,-4.9882338277690744e-8,0.0023449010717055798,3.9316757036171124e-5,-4.992722780668246e-8,0.0023448838074805536,3.925979958184939e-5,-4.986094461349622e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json
new file mode 100644
index 0000000..f46c700
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":18000,"numberOfSamples":1000,"samples":[0.002344901558802442,3.911368303105064e-5,-4.968948981883951e-8,0.002344984132234963,3.8898163040661456e-5,-4.9435280092255396e-8,0.002345153076453194,3.8645137911801235e-5,-4.913505665071581e-8,0.0023454177649364274,3.8394882701718704e-5,-4.883571430956027e-8,0.0023457726182683734,3.8190636084535106e-5,-4.858818570335279e-8,0.0023461958479369647,3.8071833815956895e-5,-4.8439580759263195E-08,0.0023466502566154754,3.806617270836784e-5,-4.8423700396250246e-8,0.0023470871667342188,3.818099295284342e-5,-4.855052067391149e-8,0.0023474547964515697,3.8395736841710905e-5,-4.8796864492445077e-8,0.002347711548848421,3.865908630266998e-5,-4.9102715263344044e-8,0.0023478420825502667,3.889571950044163e-5,-4.937914952780937e-8,0.00234786961391877,3.902607152063935e-5,-4.9531851099022974e-8,0.0023478548636246925,3.899526350333567e-5,-4.949545923878963e-8,0.002347876570857601,3.8797420616696476e-5,-4.926230021920203e-8,0.0023480009856264934,3.8479554435582394e-5,-4.888691218568922e-8,0.002348257394842648,3.81212678497871e-5,-4.8462214576854004e-8,0.0023486326479069406,3.7803093228172886e-5,-4.8082513592352674e-8,0.0023490835964367573,3.75814623825538e-5,-4.781433129307214e-8,0.002349556312825578,3.747939916176964e-5,-4.768549705089819e-8,0.002350001794120482,3.7490379203984336e-5,-4.768944037993623e-8,0.002350384381521822,3.758800212452211e-5,-4.779618621991062e-8,0.0023506841057128985,3.773572437125139e-5,-4.796348785816809e-8,0.0023508956980960788,3.7894232799687954e-5,-4.814536983155262e-8,0.00235102648099269,3.802641740658273e-5,-4.829803528414698e-8,0.002351094173287532,3.810084978765315e-5,-4.838411531070628e-8,0.0023511246964647747,3.8094608924835005e-5,-4.837614007717066e-8,0.0023511496348331447,3.799585924542727e-5,-4.825963731338258e-8,0.0023512029179003826,3.780605403700456e-5,-4.803571540037979e-8,0.002351316493203054,3.754110540847055e-5,-4.772242618165293e-8,0.002351515254331023,3.723065606146325e-5,-4.7353971759481864e-8,0.0023518120205759476,3.6914840723378074e-5,-4.697706960436158e-8,0.0023522036900594134,3.663842066327486e-5,-4.664428486396447e-8,0.0023526697415857454,3.6442835626573675e-5,-4.6404850464569947E-08,0.0023531739492806607,3.635743472275251e-5,-4.629433098034591e-8,0.0023536695969230293,3.639153741844735e-5,-4.632502065598751e-8,0.002354107963028887,3.65290387843179e-5,-4.64791633358682e-8,0.0023544493334192655,3.672744771866113e-5,-4.670739713326941e-8,0.0023546748244885193,3.692340046714689e-5,-4.693502893752279e-8,0.0023547957604870243,3.704596407123413e-5,-4.707779081016492e-8,0.002354855915443392,3.703656572046711e-5,-4.70656375977696e-8,0.0023549223160394474,3.68699978500431e-5,-4.6867843166706427e-8,0.002355064610704272,3.656683381659626e-5,-4.65078344897485e-8,0.002355330456332751,3.6188645949168455e-5,-4.605762360942627e-8,0.0023557290800031,3.581614088997792e-5,-4.561209830788785e-8,0.0023562313149006323,3.552104851024793e-5,-4.525598622392911e-8,0.002356784170343763,3.534573263514571e-5,-4.503985226093692e-8,0.00235733028458666,3.529761527789713e-5,-4.49733843052568e-8,0.002357823000083982,3.535587514723036e-5,-4.503300722505471e-8,0.0023582334607192713,3.548324139112816e-5,-4.517550230472812e-8,0.0023585511399880337,3.5636946080439145e-5,-4.535076312918837e-8,0.002358780962041987,3.577633956909642e-5,-4.551078335076926e-8,0.0023589395842511522,3.5867314155800855e-5,-4.561499749370089e-8,0.002359052080351249,3.588475773629073e-5,-4.563332272362631e-8,0.002359149147828655,3.58142084645814e-5,-4.554820350082022e-8,0.0023592643626533377,3.565335730415486e-5,-4.5356402142557453E-08,0.002359430841246486,3.541339537933329e-5,-4.507057121932486e-8,0.0023596768567981123,3.511952535451973e-5,-4.471987460114685e-8,0.0023600205188522927,3.480948168500788e-5,-4.4348345490610194e-8,0.0023604644698905536,3.452896471445555e-5,-4.400967986329848e-8,0.002360992350010294,3.432364769813786e-5,-4.375798612579386e-8,0.002361569042366369,3.422878850205881e-5,-4.363559641492016e-8,0.0023621460051594665,3.4259012492440044e-5,-4.3660883375380844e-8,0.0023626713616961515,3.440164922381125e-5,-4.3820080092443e-8,0.002363102567048767,3.4616447316981465e-5,-4.4066547053651594e-8,0.002363418276529288,3.484277697645849e-5,-4.432896661511161e-8,0.002363625904080295,3.501331834422755e-5,-4.452741922922826e-8,0.002363762140673494,3.50713100177352e-5,-4.459391491625094e-8,0.0023638851680286292,3.498694287747205e-5,-4.449207573009896e-8,0.0023640594734086117,3.4767688893707976e-5,-4.422967279774819e-8,0.002364337052724743,3.44579776897352e-5,-4.385849503168624e-8,0.0023647414089119547,3.412668761857231e-5,-4.345970698104098e-8,0.002365260922020612,3.3846152104623893e-5,-4.3119075143364176e-8,0.0023658544426327192,3.367093165302294e-5,-4.290180278936738e-8,0.0023664660490979486,3.362478090509265e-5,-4.2836928949552116e-8,0.002367041894211088,3.3699477499923e-5,-4.29156715149733e-8,0.0023675425813141815,3.3863070665591675e-5,-4.3100929149056666e-8,0.002367948361133545,3.407186155979982e-5,-4.334131276515742e-8,0.0023682583104001854,3.4281125480317074e-5,-4.358383945165417e-8,0.002368486347050624,3.4452289918945094e-5,-4.378254145392837e-8,0.002368656569458454,3.455667745010834e-5,-4.3903037676489125e-8,0.002368799213631667,3.457704329979657e-5,-4.39244496666408e-8,0.0023689474323752143,3.450818698611703e-5,-4.384015205758009e-8,0.0023691344170632556,3.4357416482385305e-5,-4.3658308045106786e-8,0.002369390127550806,3.4144946605107745e-5,-4.340234799568976e-8,0.002369737050180081,3.390358038895181e-5,-4.311066755298774e-8,0.0023701849761484078,3.367640314542406e-5,-4.283404275674573e-8,0.002370725808074802,3.351105695568608e-5,-4.262900855450118e-8,0.0023713306372070224,3.344998149691437e-5,-4.254638292238252e-8,0.0023719519724518553,3.351806525291478e-5,-4.261657041710548e-8,0.0023725329401571575,3.371175366291013e-5,-4.283642668257849e-8,0.0023730222295828053,3.3995002702351264e-5,-4.316414308379054e-8,0.002373389973065274,3.430578520129685e-5,-4.3526671192005085e-8,0.0023736381505010734,3.4572328983584834e-5,-4.38388242013889e-8,0.0023738010098588143,3.473355012811767e-5,-4.402752760022938e-8,0.00237393531167498,3.4756315512409036e-5,-4.40524591922618e-8,0.0023741041518875864,3.4643979531241987e-5,-4.391644020525929e-8,0.0023743597715574142,3.443428581685144e-5,-4.366325823519776e-8,0.002374730275263065,3.418808569592938e-5,-4.336456918047751e-8,0.0023752135991477064,3.397259983293269e-5,-4.3100208376556956e-8,0.002375779941817866,3.384415723124978e-5,-4.293768908589405e-8,0.0023763813960745914,3.383531261076801e-5,-4.2916694132470866e-8,0.0023769653178674142,3.394966546843266e-5,-4.304258701004152e-8,0.0023774870203995034,3.416488144273135e-5,-4.3289677344681276e-8,0.002377918235263097,3.444154087954113e-5,-4.3611544323386645e-8,0.0023782499725694506,3.473394751413563e-5,-4.3953871457543554e-8,0.002378490676997382,3.499948400810439e-5,-4.4265690042450136e-8,0.002378661785361829,3.520478219905836e-5,-4.45068771402646e-8,0.0023787927125148967,3.5328684667322306e-5,-4.465179236135274e-8,0.0023789164661922424,3.5362982250262976e-5,-4.4690190041228925e-8,0.002379066168330197,3.531210837114164e-5,-4.462683919511151e-8,0.0023792721073279486,3.519257964256899e-5,-4.448085699607398e-8,0.0023795586569317585,3.50323249823028e-5,-4.4284979324380445e-8,0.0023799404698155602,3.486935159153574e-5,-4.408411931944888e-8,0.00238041786411957,3.4748539855140206e-5,-4.39317205628605e-8,0.0023809723866902452,3.471506365948844e-5,-4.38820214882267e-8,0.0023815649852208134,3.48036933953732e-5,-4.397726798401748e-8,0.0023821401857936045,3.502563195655052e-5,-4.423182507960411e-8,0.0023826385643343764,3.535804096673262e-5,-4.461940477123716e-8,0.002383015549616911,3.574351081297848e-5,-4.507218244911266e-8,0.0023832590121007622,3.610394768843331e-5,-4.549722500288198e-8,0.0023833960729126107,3.6365403192313095e-5,-4.5806082879119395e-8,0.0023834844707587666,3.6482794911242564e-5,-4.594430660481812e-8,0.0023835926131679144,3.6453070353420245e-5,-4.5907232417809996e-8,0.0023837780068744117,3.6312527567923084e-5,-4.573698815443366e-8,0.002384072504190872,3.612228458903607e-5,-4.550549834835012e-8,0.002384477540262076,3.594951747525463e-5,-4.529245938741677e-8,0.0023849679834993427,3.5850894327466484e-5,-4.516576690664186e-8,0.0023855013057676516,3.586164050491832e-5,-4.5168379713013465e-8,0.0023860287687607305,3.599113018920311e-5,-4.5312724744731254e-8,0.002386506003294634,3.6224400739596276e-5,-4.558208417162952e-8,0.0023869010817420566,3.65281921996621e-5,-4.5937482125035984e-8,0.0023871989250919125,3.685955147899608e-5,-4.632784241705567e-8,0.002387401820865755,3.7174763898084735e-5,-4.6700739768763154e-8,0.002387526785819297,3.7436733765039484e-5,-4.701140163670798e-8,0.0023876010849905364,3.761979915266924e-5,-4.7228628272774645e-8,0.00238765727041805,3.771186667545958e-5,-4.733742080218521e-8,0.002387728725155376,3.7714449644070145e-5,-4.7339022820513065e-8,0.0023878460686218663,3.764152424039279e-5,-4.724953688088123e-8,0.002388034216505095,3.751792399775393e-5,-4.709805432518741e-8,0.0023883096269505005,3.7377464417580596e-5,-4.692455759226862e-8,0.002388677274146209,3.726041803036959e-5,-4.677709598428318e-8,0.0023891272588487315,3.720938268477899e-5,-4.6706986835451093e-8,0.0023896319399229,3.7262272101778856e-5,-4.6760418636059854e-8,0.0023901458647094826,3.7441849520893325e-5,-4.696572132812101e-8,0.002390611746871633,3.774354152197786e-5,-4.731844757029362e-8,0.0023909747687158945,3.81269601588696e-5,-4.777091840959034e-8,0.002391202906290385,3.8519192870702565e-5,-4.823603735908806e-8,0.0023913040660786186,3.883476948556154e-5,-4.8611270833999345e-8,0.002391328128732739,3.9006667440986484e-5,-4.881589018117696e-8,0.00239134943562406,3.90124026913742e-5,-4.882222941094568e-8,0.002391438487576229,3.8880411452464615e-5,-4.866331475848319e-8,0.0023916383708005662,3.867507853522781e-5,-4.841510309828039e-8,0.00239195590432241,3.847153998643774e-5,-4.816669872463936e-8,0.0023923668018147257,3.833341819751815e-5,-4.799408876442468e-8,0.002392828007801345,3.830015839190798e-5,-4.794511807386538e-8,0.0023932907590552147,3.8383856123547755e-5,-4.8035481865629606e-8,0.00239371096036409,3.857245714578611e-5,-4.82521178047072e-8,0.0023940559931876475,3.883616405890264e-5,-4.856042818085454e-8,0.0023943082930363074,3.9134985874419545e-5,-4.891304887908877e-8,0.0023944662220829185,3.9426309839536574e-5,-4.925889576057055e-8,0.0023945426540706474,3.967167832740828e-5,-4.955145041930234e-8,0.0023945617795173573,3.984206233309221e-5,-4.975530429415886e-8,0.002394554803373748,3.992121054124771e-5,-4.985033218746083e-8,0.00239455526447015,3.990695202747839e-5,-4.983330111917577e-8,0.002394594661569528,3.9810623353083994e-5,-4.971716322616409e-8,0.0023946988252229935,3.965513390937551e-5,-4.952874150407233e-8,0.0023948850777624304,3.9472259325648355e-5,-4.9305586614794425e-8,0.00239515997526318,3.9299439114975593e-5,-4.909233045733194e-8,0.0023955174021503037,3.9175945382072434e-5,-4.893628682300761e-8,0.002395937007932476,3.9137890421156826e-5,-4.8881533371822775e-8,0.002396383695909191,3.921131979781866e-5,-4.896047917113908e-8,0.0023968099593563576,3.9403258047878505e-5,-4.918277327372618e-8,0.002397163497613983,3.969252739918278e-5,-4.952387416863947e-8,0.0023974015854493413,4.002518309701328e-5,-4.99193026544001e-8,0.002397509675261247,4.0321678158350774e-5,-5.027326909845036e-8,0.0023975151824612907,4.049998955523513e-5,-5.048669925554299e-8,0.0023974844671535013,4.050819106081807e-5,-5.049657166197553e-8,0.002397499090668801,4.034853438152713e-5,-5.0304833087084466e-8,0.0023976229322382613,4.007667775600651e-5,-4.997738881179162e-8,0.002397879519985696,3.977656534145411e-5,-4.96140773901125E-08,0.0023982502957491016,3.9527801939768744e-5,-4.93098968993077e-8,0.002398689129527083,3.938302665345923e-5,-4.912820157919039e-8,0.002399141121851689,3.936112368628708e-5,-4.9092584839070415e-8,0.002399557122870482,3.945190021821551e-5,-4.919217196871091e-8,0.002399901681190261,3.9625470595205126e-5,-4.939240127952472e-8,0.0024001557140803276,3.9841782493496445e-5,-4.9646053324931454e-8,0.00240031603823306,4.0058414074826275e-5,-4.990243651972935e-8,0.0024003933848322214,4.02365269468108e-5,-5.0114610330648764e-8,0.0024004095942288745,4.034539638022784e-5,-5.0245052214989265e-8,0.0024003941453741816,4.0365693589607254e-5,-5.0269831914895396e-8,0.0024003801497172756,4.0291449589680024e-5,-5.018110199371788e-8,0.0024004000531943383,4.013054961443052e-5,-4.9987707246810776e-8,0.0024004814327914467,3.990360304898532e-5,-4.9713797552627094e-8,0.0024006433784475078,3.96412645683471e-5,-4.9395635374628664e-8,0.002400893829350257,3.938038444905259e-5,-4.907710595026679e-8,0.0024012280072063545,3.9159384872200925e-5,-4.88043653842751e-8,0.002401627983789423,3.901309599496099e-5,-4.861979177381442e-8,0.0024020634684160267,3.896712290496793e-5,-4.8555194568685595e-8,0.0024024942344411503,3.903172416614497e-5,-4.862420076639316e-8,0.0024028751869229125,3.919562945854613e-5,-4.881439962151439e-8,0.0024031652429550516,3.942160059336088e-5,-4.908159561584208e-8,0.0024033401183291706,3.964740296327271e-5,-4.9350792145343485e-8,0.002403406122558092,3.9796826052265784e-5,-4.952959530944614e-8,0.0024034075771528214,3.9802695108078196e-5,-4.953626629721684e-8,0.002403418663533099,3.963531471377749e-5,-4.933424264248788e-8,0.002403517483513351,3.9320414167136537e-5,-4.895377104664041e-8,0.00240375400559779,3.893213949475224e-5,-4.848339885001966e-8,0.0024041310350306584,3.856275056172833e-5,-4.803360539427687e-8,0.002404608522803643,3.8287467657906244e-5,-4.7694797328705657e-8,0.002405124618903588,3.814364277978108e-5,-4.7512463896821273e-8,0.002405618526611032,3.812961405164927e-5,-4.748570334517685e-8,0.0024060450436589023,3.821594093326314e-5,-4.7580367143404314e-8,0.002406379515424713,3.8359386346411104e-5,-4.774544974096198e-8,0.0024066165603803674,3.851416440298249e-5,-4.7926337409967924e-8,0.002406766193043988,3.863916072047892e-5,-4.8073452764022304e-8,0.0024068496190933135,3.870200493814187e-5,-4.814731567974312e-8,0.0024068954751543747,3.8681384728337856e-5,-4.812157280049673e-8,0.0024069363302526986,3.8568469741027326e-5,-4.7984907944708237e-8,0.002407005092363638,3.8367620010703626e-5,-4.774197343294295e-8,0.0024071311642991904,3.8096143001373596e-5,-4.741307791637707e-8,0.00240733648448139,3.7782662926820594e-5,-4.703219316231057e-8,0.0024076319591230843,3.746376601902139e-5,-4.664296180742872e-8,0.0024080150100535243,3.717901842199488e-5,-4.629284851707181e-8,0.0024084688627471237,3.6964873105139e-5,-4.6025986316963574e-8,0.002408963950387803,3.684822663195842e-5,-4.587550926484438e-8,0.002409461535231225,3.6840528070730786e-5,-4.585634918576009e-8,0.0024099194289861434,3.6933325176103526e-5,-4.595954827428758e-8,0.002410299639091284,3.709615129870326e-5,-4.6149286023116704e-8,0.0024105775736920194,3.727809719448076e-5,-4.636443290545415e-8,0.0024107515290991625,3.7414947503234764e-5,-4.652707276927955e-8,0.0024108494422053167,3.744332346904537e-5,-4.6559778833502254e-8,0.0024109280582808607,3.732068196771385e-5,-4.641012552830863e-8,0.0024110599588631028,3.704486401008396e-5,-4.6074593882075726e-8,0.0024113092457543352,3.666207745630117e-5,-4.560832165779338e-8,0.0024117058579894443,3.625440453889971e-5,-4.511002792620606e-8,0.00241223320394758,3.590984658345839e-5,-4.468591059086578e-8,0.0024128367433007784,3.569068786073452e-5,-4.4411566261216975e-8,0.002413447167854588,3.561679042361314e-5,-4.431182379727306e-8,0.002414003943390364,3.566857531655897e-5,-4.4364131508880796e-8,0.002414468917828636,3.5802128924618506e-5,-4.45164528407243e-8,0.0024148287689588913,3.596582802687616e-5,-4.4707042649597976e-8,0.0024150906323866994,3.6112294226174406e-5,-4.487876186163635e-8,0.0024152756199526553,3.620466985756144e-5,-4.4986732147043753e-8,0.002415412983422486,3.621886433437632e-5,-4.5001246595991545e-8,0.002415535705571361,3.614384708305006e-5,-4.490832914512481e-8,0.0024156771163272757,3.59813440871689e-5,-4.470949129805716e-8,0.0024158678193869285,3.5745351613970705e-5,-4.442116416614326e-8,0.002416132416351302,3.546120330008051e-5,-4.4073537242749924e-8,0.0024164859220694446,3.516352548830468e-5,-4.370808294460031e-8,0.00241693034169506,3.4892359785693274e-5,-4.337295078484064e-8,0.0024174524408001833,3.468719086143528e-5,-4.3115900098566585e-8,0.002418023930833043,3.457944258321774e-5,-4.2975364635792224e-8,0.002418604957254082,3.4584872568489474e-5,-4.297126534219297e-8,0.002419150952416655,3.469789771516463e-5,-4.30979643194712e-8,0.0024196218300455495,3.48898251884466e-5,-4.3321783064122653e-8,0.0024199916518604678,3.51121471359681e-5,-4.3584618304832864e-8,0.002420256595170644,3.5304987746849386e-5,-4.381393076419317e-8,0.002420439070447764,3.54098460734516e-5,-4.393818240200917e-8,0.002420585972638163,3.5384692412318615e-5,-4.39053621156832e-8,0.0024207596255476035,3.521796937688811e-5,-4.3700303187940916e-8,0.00242102169533141,3.493649672842064e-5,-4.335458114598203e-8,0.0024214136673983418,3.460203389622349e-5,-4.294254391313394e-8,0.0024219412696859064,3.4294397281599166e-5,-4.2560928350924536e-8,0.002422570997871016,3.40859042454751e-5,-4.2297873198728576e-8,0.002423241774708797,3.401825188013031e-5,-4.220478688725671e-8,0.002423886226246646,3.4092534703597756e-5,-4.2284029344064495e-8,0.002424450990286084,3.4275193790697986e-5,-4.2495842308161056e-8,0.002424907897269756,3.4513860089160096e-5,-4.277731373829174e-8,0.002425254646420478,3.475404717614502e-5,-4.306250514379759e-8,0.0024255087764721997,3.495073098604035e-5,-4.329653600382793e-8,0.0024256997145779124,3.5073628211510956e-5,-4.344214009667556e-8,0.0024258619447215263,3.510795400575972e-5,-4.3480765687463235e-8,0.002426030203565686,3.505305808974759e-5,-4.341105272837135e-8,0.0024262362674914877,3.4920608081784176e-5,-4.3246676601309794e-8,0.0024265064422872465,3.473295174654087e-5,-4.3014350394663596e-8,0.0024268589868617334,3.4521461493677566e-5,-4.275180769052857e-8,0.002427301138503399,3.432410975088323e-5,-4.250490759677728e-8,0.0024278260913050916,3.418129571204661e-5,-4.2322676945393295e-8,0.002428411097108386,3.4129280643721544e-5,-4.2249456747169526e-8,0.002429018449007624,3.4191654643649516e-5,-4.231457750259257e-8,0.002429600921945329,3.4370848029145066e-5,-4.2521942446609057e-8,0.002430111852543173,3.464306742421111e-5,-4.284362752322127e-8,0.0024305177078212167,3.4960014332554184e-5,-4.322166147588011e-8,0.0024308089963019476,3.525864256604065e-5,-4.3579634420191055e-8,0.0024310052103568625,3.54768490791095e-5,-4.3841674275576033e-8,0.0024311514832499894,3.5570331945046896e-5,-4.3953026184890535e-8,0.0024313076209347257,3.552531869349453e-5,-4.389576556823521e-8,0.0024315325810961527,3.5363327353876604e-5,-4.369491031447773e-8,0.0024318686265469066,3.513647254223246e-5,-4.341303915546696e-8,0.0024323294873825944,3.491423748049786e-5,-4.3134445579347336e-8,0.002432896167264619,3.476495141289254e-5,-4.294268271529085e-8,0.0024335222309093078,3.4737272570903575e-5,-4.2897907650809233e-8,0.0024341473034816276,3.484777220801906e-5,-4.3021473228785095e-8,0.0024347141143896403,3.5078911481254485e-5,-4.3293103813853885e-8,0.0024351828565165653,3.5387420696509406e-5,-4.3660807647483854e-8,0.0024355382696882246,3.571869639847352e-5,-4.4058284519528546e-8,0.0024357886769330174,3.602113490945862e-5,-4.442243365076725e-8,0.0024359595899447976,3.6255981177570735e-5,-4.470551282002724e-8,0.002436085616257832,3.64014787157889e-5,-4.4880378715262854e-8,0.002436203431207954,3.645261201880796e-5,-4.49403083766768e-8,0.002436346881699283,3.641860110716656e-5,-4.489600455109322e-8,0.0024365439720128446,3.631989439005647e-5,-4.477193408814986e-8,0.002436814886263786,3.618547757967348e-5,-4.460305079373914e-8,0.0024371701965660787,3.605043991849035e-5,-4.443187709405474e-8,0.0024376087810835056,3.5953118153448417e-5,-4.430512313890507e-8,0.002438115638816738,3.593080766479197e-5,-4.42685612060324e-8,0.0024386606910261066,3.601319060175138e-5,-4.43590417894124e-8,0.0024392005329820178,3.621366124796751e-5,-4.459380937231256e-8,0.0024396852406738875,3.652073535771226e-5,-4.495979153559817e-8,0.002440070792536112,3.689393707336404e-5,-4.540830813754903e-8,0.0024403341938348043,3.7269028978704966e-5,-4.586125501539923e-8,0.0024404847869948067,3.757420212930339e-5,-4.6230801286461525e-8,0.0024405649339235085,3.775253295873212e-5,-4.6446847061845124e-8,0.0024406379971211724,3.778108573313487e-5,-4.6480442904616754e-8,0.0024407684360130493,3.7678040163525975e-5,-4.635265130274541e-8,0.002441002576816896,3.749564568269083e-5,-4.6126207922268527e-8,0.0024413569455008703,3.730344562480743e-5,-4.58853778897302e-8,0.0024418164775716804,3.716885726843634e-5,-4.571251766869334e-8,0.002442341086211704,3.7141004685513786e-5,-4.566838003723965e-8,0.002442877339190302,3.72411338432493e-5,-4.5780171769525656e-8,0.002443371731515466,3.746064251142103e-5,-4.603872319654958e-8,0.002443782406429579,3.7766052234272806e-5,-4.640413953378797e-8,0.002444086872764397,3.810893879139721e-5,-4.681768347059421e-8,0.002444284388309687,3.843785498667255e-5,-4.721633349478445e-8,0.002444393232414692,3.8709012326829734e-5,-4.7546011694557105e-8,0.002444444549161754,3.889334328329184e-5,-4.7770454539860257e-8,0.002444475074792687,3.8979187827749855e-5,-4.787468720267451e-8,0.0024445206944451194,3.8971331473534686e-5,-4.7863936944109584e-8,0.0024446118314487707,3.8887888173957045e-5,-4.775982946018779e-8,0.0024447706911564257,3.8756507830295623e-5,-4.7595742185117445e-8,0.002445009754862674,3.861079858955392e-5,-4.741246632391835e-8,0.002445330792627307,3.848709249206566e-5,-4.7254353116952106e-8,0.0024457239072774276,3.84210898084392e-5,-4.7165331531864033e-8,0.002446166646694304,3.844355610942536e-5,-4.71836986496915e-8,0.002446624062616858,3.857428817952799e-5,-4.733464480752854e-8,0.0024470514934107203,3.88144481598043e-5,-4.762062321108293e-8,0.002447402125327943,3.913928762815128e-5,-4.801212199106996e-8,0.0024476400881559847,3.9495739935443694e-5,-4.8444475535150416e-8,0.0024477561339314394,3.981049166716775e-5,-4.8827712071902615e-8,0.002447778077693695,4.001077266348328e-5,-4.9072160123498955e-8,0.0024477670483197492,4.005148747549024e-5,-4.9121840338880554e-8,0.0024477974812433497,3.993465087268592e-5,-4.897832831402965e-8,0.002447929926440992,3.9709268450711776e-5,-4.870064967828901e-8,0.0024481909223161946,3.9451954414470326e-5,-4.838174394154787e-8,0.0024485684783898502,3.923993501418732e-5,-4.811575988446022e-8,0.0024490213965491316,3.9129377699806304e-5,-4.797180052202577e-8,0.0024494948154261892,3.91451644029732e-5,-4.798138431887394e-8,0.002449935069477873,3.928119976470324e-5,-4.8138482471436045e-8,0.002450300397506881,3.9507323269912974e-5,-4.840749035993413e-8,0.0024505668157711494,3.9779044908857327e-5,-4.8734735279841313E-08,0.0024507297637555462,4.004759573096723e-5,-4.906061161920809e-8,0.002450802394303154,4.02688488745371e-5,-4.9330599704006644e-8,0.0024508113644507706,4.0410128173367605e-5,-4.95038655686505e-8,0.002450791125069385,4.0454212555310635e-5,-4.955844487476108e-8,0.0024507778465312773,4.040035570468197e-5,-4.949267054201453e-8,0.0024508040198822152,4.026270069107783e-5,-4.932327950223557e-8,0.0024508944505534447,4.006688255862525e-5,-4.908122347286046e-8,0.0024510638634689867,3.984580917053899e-5,-4.880648823794057e-8,0.00245131584498336,3.963541528939374e-5,-4.854295462312273e-8,0.002451642653661857,3.9470681141633724e-5,-4.833364518839405e-8,0.002452025536044154,3.938176083843848e-5,-4.8216083300638214e-8,0.002452435488543121,3.938977033584164e-5,-4.8217107227132724e-8,0.002452835048062748,3.950174696583605e-5,-4.8346481745672895e-8,0.0024531824507044967,3.970500384005907e-5,-4.858962496972789e-8,0.0024534396241559695,3.9962702831889606e-5,-4.890182990265696e-8,0.0024535843268946146,4.021443150526203e-5,-4.920880941676828e-8,0.002453623652929858,4.0386636134526066e-5,-4.9419622792017125e-8,0.002453601452891794,4.041499005959166e-5,-4.945444695873122e-8,0.0024535904575645672,4.0272043808040254e-5,-4.9278768855135644e-8,0.002453667088416081,3.9984366591700615e-5,-4.892445528448971e-8,0.0024538804961186404,3.9625472135700606e-5,-4.8481018851177726e-8,0.002454234041076148,3.9286627001372286e-5,-4.8059919577965076e-8,0.002454688758937021,3.90430339964667e-5,-4.7753378723272426e-8,0.002455182859858328,3.893307901809375e-5,-4.760913419343073e-8,0.0024556538362148746,3.895585698194267e-5,-4.762729962876685e-8,0.0024560537286482022,3.908100050787737e-5,-4.777201985779246e-8,0.00245635559786168,3.92623565237223e-5,-4.7987768345426784e-8,0.002456553543520675,3.945013089553443e-5,-4.821391608652092e-8,0.002456659304914327,3.9599666210168044e-5,-4.839543997652059e-8,0.002456697551274787,3.9677063676223765e-5,-4.849000855734107e-8,0.002456700822614684,3.966238759049165e-5,-4.847222180997126e-8,0.0024567044573505052,3.9550907364328136e-5,-4.833540821334541e-8,0.0024567417680072287,3.935256550822404e-5,-4.8091109193474636e-8,0.0024568398052084747,3.9089819952275556e-5,-4.776643242859904e-8,0.002457016102034005,3.879409971555748e-5,-4.739964644423014e-8,0.0024572767266246858,3.850135084065896e-5,-4.7034702557923994e-8,0.002457615714144817,3.8247292949526414e-5,-4.671548886753261e-8,0.002458015719767934,3.806281830374309e-5,-4.648030512056859e-8,0.0024584497093368225,3.7969709899505705e-5,-4.6356668032574766e-8,0.0024588835950892117,3.797672416493626e-5,-4.6356402548602995e-8,0.002459280019112911,3.8076035091713856e-5,-4.647098884390965e-8,0.0024596039507214372,3.8240450757803655e-5,-4.666776031810568e-8,0.0024598307142160007,3.842294852242427e-5,-4.68890281670926e-8,0.002459955918353923,3.8561282527527495e-5,-4.7057687283657186e-8,0.0024600044256263562,3.85906258738798e-5,-4.7093002809037085e-8,0.0024600323640595525,3.846469351560399e-5,-4.693699010582562e-8,0.002460115198327215,3.817888591278212e-5,-4.658318142014719e-8,0.0024603211513315733,3.778139333481038e-5,-4.609033001301854e-8,0.0024606816896058582,3.7360118141523624e-5,-4.5566248750844804e-8,0.0024611773581020993,3.700873869629158e-5,-4.5126111329188663e-8,0.0024617480565587665,3.679136890764092e-5,-4.484915535672109e-8,0.0024623194040428297,3.6725241793431914e-5,-4.4757458521259293e-8,0.002462828313114861,3.6785610286324895e-5,-4.4821776764596e-8,0.0024632368323780508,3.692313753770688e-5,-4.49825480110503e-8,0.002463533911415987,3.7081973038857536e-5,-4.517174974987359e-8,0.002463730207416001,3.72123954530806e-5,-4.5328262829285335e-8,0.0024638508339381053,3.727738907944816e-5,-4.540602228952397e-8,0.0024639287406243806,3.725496815222289e-5,-4.537712390347134e-8,0.002463999440178538,3.7138246844026674e-5,-4.523220853693909e-8,0.002464096769834068,3.693441043162565e-5,-4.4979410248424785e-8,0.002464249278477507,3.6662920271676045e-5,-4.464221452771284e-8,0.0024644771058909905,3.6352892349154964e-5,-4.4256185173269244e-8,0.0024647894963774355,3.60394813223482e-5,-4.3864446992286476e-8,0.00246518333004217,3.575928664507124e-5,-4.3512032388348086e-8,0.00246564308966862,3.5545192829730305e-5,-4.323961698689231e-8,0.002466142462746481,3.54212599682058e-5,-4.30773347216381e-8,0.0024666475561435836,3.539825611996659e-5,-4.303928925890125e-8,0.002467121549800276,3.5470424064565755e-5,-4.311941218583528e-8,0.002467530510301026,3.5614038369783264e-5,-4.328936880925462e-8,0.0024678501018424014,3.578830836147025e-5,-4.3499317664747304e-8,0.00246807277205011,3.5939557401127685e-5,-4.368284640476247e-8,0.0024682141340358534,3.6009986170699735e-5,-4.3767824546787344e-8,0.002468315806348312,3.595167953042106e-5,-4.369398422338407e-8,0.002468440719277613,3.574403825458124e-5,-4.343483114258189e-8,0.0024686576285004418,3.5408406295791984e-5,-4.301598790135291e-8,0.002469016756628685,3.5009868675168896e-5,-4.251749277816247e-8,0.002469527016305481,3.4639085816369505e-5,-4.2051331770138575e-8,0.0024701491272457075,3.437918303108398e-5,-4.172053655964463e-8,0.0024708107727132163,3.4275108324639473e-5,-4.1581346163947136e-8,0.0024714349391305145,3.432221330845508e-5,-4.162900742123513e-8,0.0024719649634269477,3.447673339527891e-5,-4.181047415170179e-8,0.0024723756773897968,3.4677347990773343e-5,-4.2050733510056084e-8,0.0024726711706196352,3.486498141779451e-5,-4.227704642717137e-8,0.002472875776800631,3.499457801076819e-5,-4.243345755026598e-8,0.002473024311147267,3.5039164456257024e-5,-4.248596282344877e-8,0.002473154485424879,3.49892258455584e-5,-4.24219893311207e-8,0.0024733018836487117,3.485023256564978e-5,-4.224757508831041e-8,0.0024734966693373177,3.4639859686924084e-5,-4.198405931463602e-8,0.002473761122223743,3.4385249288497285e-5,-4.166470061647262e-8,0.0024741075410927692,3.412005527399114e-5,-4.1330957835760266e-8,0.0024745365035125336,3.388081280598191e-5,-4.1027956557272016e-8,0.0024750358991933777,3.3702298329276224e-5,-4.0798783384882296e-8,0.002475581446443766,3.361205682415149e-5,-4.0677810154140694e-8,0.0024761393094790735,3.362488283309667e-5,-4.068393655070341e-8,0.00247667099923248,3.3738415010136826e-5,-4.081509111115514e-8,0.0024771401592741794,3.393112591255991e-5,-4.104553604679316e-8,0.0024775202300596727,3.4163782098038836e-5,-4.132736396042357e-8,0.0024778015552186553,3.4384841805604154e-5,-4.15968981141725e-8,0.002477996355230064,3.453957481857277e-5,-4.178587242689799e-8,0.002478139925461257,3.4582095835946386e-5,-4.183646089222978e-8,0.0024782863608294597,3.448855008036613e-5,-4.171792894077942e-8,0.002478497599215119,3.426810101996982e-5,-4.1440616533293496e-8,0.002478826423475806,3.3966768621773196e-5,-4.106097101147728e-8,0.002479297655651806,3.365920201414745e-5,-4.067146491268234e-8,0.0024798956470742607,3.3427359889743966e-5,-4.0374142208359564e-8,0.002480566263107198,3.333281657692773e-5,-4.0246164098665086e-8,0.0024812348815230548,3.339569240715765e-5,-4.031349099874403e-8,0.002481832069138389,3.359098154088289e-5,-4.054608293176884e-8,0.0024823140828337882,3.3862509899205475e-5,-4.087496962472572e-8,0.0024826701499891905,3.4144843169478624e-5,-4.121926049669797e-8,0.0024829174589391183,3.438196398751778e-5,-4.150927531351717e-8,0.002483090231395934,3.453716218275256e-5,-4.169890994247633e-8,0.0024832289273681676,3.459479555529096e-5,-4.1768010969739914e-8,0.0024833725099405357,3.455739202683464e-5,-4.171898971311369e-8,0.002483553953461178,3.444130953944551e-5,-4.1571586234288615e-8,0.002483797896582137,3.42726872143246e-5,-4.135789466565913e-8,0.002484119250717028,3.408404982664835e-5,-4.111811949072816e-8,0.0024845220544084173,3.3911157045767064e-5,-4.08966177191401e-8,0.0024849984608592214,3.378942234513219e-5,-4.073744810316272e-8,0.002485528319030998,3.37493393541924e-5,-4.0678740705520224e-8,0.0024860802611576817,3.381090099062003e-5,-4.07458217081001e-8,0.002486615292822404,3.3977887022200906e-5,-4.094410565553709e-8,0.0024870933615432594,3.4233776242617746e-5,-4.1253884823212716e-8,0.0024874822433588704,3.454145160287273e-5,-4.162972775740252e-8,0.0024877666980437367,3.4848325612800404e-5,-4.200659476353093e-8,0.002487954948091704,3.5096872718110185e-5,-4.2312767159825944e-8,0.0024880797904155523,3.523845842873798e-5,-4.248704298833028e-8,0.002488193043039279,3.5246843277377304e-5,-4.249570636640487e-8,0.0024883539592743067,3.512738494103619e-5,-4.234426909230887e-8,0.0024886140602875923,3.49187025600563e-5,-4.207987071532803e-8,0.002489002194927896,3.468515900952789e-5,-4.178219564842183e-8,0.0024895143834379584,3.450085337149065e-5,-4.1543686661381805e-8,0.002490112692358687,3.4428839747837344e-5,-4.144362746866002e-8,0.002490735095733774,3.4502254176917696e-5,-4.152441444489307e-8,0.002491313820334456,3.47148501990305e-5,-4.177943206499539e-8,0.0024917952057646542,3.5025110867509906e-5,-4.21578484386859e-8,0.002492153108185882,3.537166319265242e-5,-4.2583614770799746e-8,0.0024923915653697563,3.569250545655623e-5,-4.297938359576452e-8,0.0024925381077774505,3.594019773552308e-5,-4.328553882965522e-8,0.0024926327298874706,3.608907519420701e-5,-4.346936640882342e-8,0.0024927174854313663,3.6135139860801745e-5,-4.352511605516019e-8,0.0024928293045150462,3.6091731116077385e-5,-4.3468759712982866e-8,0.0024929962078651933,3.598404077227055e-5,-4.3331234070503576e-8,0.002493235828937878,3.584424198247867e-5,-4.315237723752643e-8,0.002493554988497319,3.5707654226319e-5,-4.297612739315671e-8,0.002493949475402431,3.560950550536974e-5,-4.284648196073154e-8,0.002494403814902926,3.558150409860973e-5,-4.2803251027824265e-8,0.0024948914829334063,3.5647523756435825e-5,-4.287670742727347e-8,0.0024953765911673344,3.581825773142045e-5,-4.308089582356996e-8,0.0024958182908375675,3.608573040867354e-5,-4.340666705533066e-8,0.0024961786512342457,3.641986140806195e-5,-4.381718846972339e-8,0.0024964332001036105,3.677013333856981e-5,-4.424981283072611e-8,0.002496580985875428,3.707466125980302e-5,-4.4627260595163124e-8,0.00249664942189288,3.7275972463325826e-5,-4.487730097257107e-8,0.002496690103679088,3.733875515066651e-5,-4.4954995613220536e-8,0.0024967655193018647,3.726250067358835e-5,-4.485864320894178e-8,0.002496931013734003,3.7083456871196986e-5,-4.46324458229267e-8,0.0024972186148263043,3.686490845186074e-5,-4.435466169172905e-8,0.002497628180291189,3.6679510733870065e-5,-4.411582351619956e-8,0.002498128079111284,3.658972340409257e-5,-4.3994441199673844e-8,0.0024986644042137227,3.663208106121771e-5,-4.4037246854020054e-8,0.0024991755753180833,3.680926861936187e-5,-4.4248953740883185e-8,0.002499608064555356,3.709163133072151e-5,-4.459370765840227e-8,0.0024999288144117358,3.742710477725366e-5,-4.500715060851872e-8,0.0025001310412585205,3.775603780312682e-5,-4.5414811573711545e-8,0.0025002324917523817,3.8025992028683344e-5,-4.57506862741052e-8,0.002500267909808244,3.82021913744237e-5,-4.5970516699009e-8,0.0025002791334092648,3.827161818741498e-5,-4.6057156152074936e-8,0.002500306150636883,3.824142696912959e-5,-4.601877616789812e-8,0.002500381023813219,3.813396254515294e-5,-4.588273798227383e-8,0.002500524917925695,3.7980819109320463e-5,-4.5688184530668866e-8,0.002500747387946369,3.781755623906785e-5,-4.547941847511398e-8,0.0025010467943652028,3.7679593748579237e-5,-4.530076608806616e-8,0.002501411000812327,3.759894473403009e-5,-4.5192519652786e-8,0.002501818061535664,3.76010451065458e-5,-4.518700349120371e-8,0.002502237249305373,3.7700983349453346e-5,-4.530383549196263e-8,0.002502631391630373,3.789891117462528e-5,-4.5544060670952407e-8,0.0025029618245448393,3.817544639615828e-5,-4.588418136956523e-8,0.0025031968555852867,3.8489391629367015e-5,-4.6273070203581374e-8,0.002503322900130418,3.878132383082006e-5,-4.6636329847159344e-8,0.0025033544659702643,3.898595666221756e-5,-4.689179674409995e-8,0.0025033366866835474,3.9052160624291637e-5,-4.6974744631872444e-8,0.002503335424761968,3.8963286204251026e-5,-4.686346369928086e-8,0.002503416415545243,3.874697513072474e-5,-4.659163332249408e-8,0.002503622458507168,3.846773122092755e-5,-4.623914977805023e-8,0.0025039595976610314,3.820530008492874e-5,-4.590530882256746e-8,0.002504397631776516,3.802946606966512e-5,-4.5677537488936655e-8,0.002504882299547712,3.798169372682445e-5,-4.560852435839345e-8,0.002505352221421315,3.806826004220745e-5,-4.570743517294879e-8,0.00250575432324309,3.8263797822131395e-5,-4.59439244261933e-8,0.0025060542893460607,3.852145546614233e-5,-4.6260390338084265e-8,0.002506241100184328,3.878568465963214e-5,-4.658768272125083e-8,0.0025063261680084966,3.900454144029845e-5,-4.686046599932783e-8,0.0025063382859264074,3.913932359754488e-5,-4.702948014495108e-8,0.0025063160483484925,3.917014569025023e-5,-4.706882713849625e-8,0.002506299694580531,3.9097007570934184e-5,-4.697758835500036e-8,0.0025063241642786917,3.893705066219002e-5,-4.677655197485161e-8,0.002506414458106024,3.8719469291395064e-5,-4.650187612960767e-8,0.002506583529031959,3.847966713294664e-5,-4.6197729527279165e-8,0.0025068322231723375,3.825390939784268e-5,-4.5909552105830005e-8,0.00250715042643049,3.8075081039815325e-5,-4.5678747389959236e-8,0.002507518671035578,3.79694315028609e-5,-4.553864588391083e-8,0.002507909881434134,3.7953757863868274e-5,-4.551099211154035e-8,0.0025082914429322,3.8032479762118567e-5,-4.560219705504129e-8,0.0025086283062298424,3.819441369790588e-5,-4.5799089344806656e-8,0.002508888222288745,3.8409920504514224e-5,-4.6065065644875405e-8,0.002509049867274366,3.863051042059274e-5,-4.633938175836797e-8,0.002509113004638694,3.879425510226927e-5,-4.654391267553016e-8,0.0025091068429147767,3.883993594289078e-5,-4.6601084959132783e-8,0.0025090898042000585,3.872875934821506e-5,-4.6461387254399373e-8,0.002509134996273683,3.846495952331999e-5,-4.6129379088556667e-8,0.002509303823785431,3.810176136963081e-5,-4.567118163005868e-8,0.0025096206611317003,3.77249340788089e-5,-4.519386918014874e-8,0.0025100635025889603,3.742094334698776e-5,-4.480570179737146e-8,0.0025105750725739227,3.7247279761174246e-5,-4.4579149479260436e-8,0.0025110856597778002,3.721891833235642e-5,-4.4533963341258614e-8,0.0025115347336513087,3.7312355209207396e-5,-4.464198908935113e-8,0.0025118837717088426,3.7479672497395944e-5,-4.4844363555259744e-8,0.0025121197805155586,3.766434463552293e-5,-4.507092241835546e-8,0.0025122524606316582,3.781403239390384e-5,-4.5256039989766344e-8,0.002512308218517646,3.788897265948401e-5,-4.534921710684068e-8,0.002512323198993744,3.7866377431753216e-5,-4.532087455967344e-8,0.0025123364352792246,3.774164049515155e-5,-4.5164209733579505e-8,0.002512383722153255,3.752690440451212e-5,-4.4893662222274306e-8,0.0025124927690744884,3.724752495244522e-5,-4.454058376296237e-8,0.0025126800686300593,3.6937187041074546e-5,-4.4147073781900625e-8,0.002512949640805612,3.663249847498581e-5,-4.3759102263850506e-8,0.0025132935154346414,3.636784559588725e-5,-4.3419995601533096e-8,0.0025136935134270817,3.6171127440481755e-5,-4.3165098457630535e-8,0.002514123766723244,3.606055777639336e-5,-4.301781026749884e-8,0.002514553618955688,3.604231707921164e-5,-4.298663815376317e-8,0.0025149508839445193,3.610876316223164e-5,-4.306282715704458e-8,0.0025152857940081257,3.6237122105096005e-5,-4.321846926867821e-8,0.0025155362609611655,3.6389174493579715e-5,-4.3405830751730746e-8,0.002515694790395706,3.651350376824656e-5,-4.356001367114698e-8,0.002515776049335391,3.6552764092910476e-5,-4.360815615449484e-8,0.0025158217306482694,3.64579617376964e-5,-4.348766977365181e-8,0.002515896936537497,3.620833883698536e-5,-4.317158041654697e-8,0.002516073071847446,3.5828669318152446e-5,-4.269046581534293e-8,0.002516399987719169,3.539060604592482e-5,-4.213413246847748e-8,0.0025168814606322987,3.499021840014745e-5,-4.162331415721513e-8,0.0025174707936113064,3.4710531005774946e-5,-4.126263149227772e-8,0.002518090589616577,3.459078644678115e-5,-4.1102057661954364e-8,0.002518663524727177,3.4618912918017596e-5,-4.112741399925282e-8,0.0025191361740298083,3.474582741761788e-5,-4.1278096176040484e-8,0.0025194875406559848,3.490802432070915e-5,-4.147510457868247e-8,0.002519725292742549,3.504638962014763e-5,-4.16444050552658e-8,0.0025198766141857846,3.5116951628882e-5,-4.173036446018124e-8,0.002519978706172601,3.509468993429849e-5,-4.1700694202266914e-8,0.002520071130482626,3.497310385097045e-5,-4.154621540106111e-8,0.002520190252699242,3.4761794687652565e-5,-4.1278135639874127e-8,0.0025203652372844786,3.448316626617987e-5,-4.092409555262571e-8,0.002520615191656812,3.416849468288395e-5,-4.05232510677893e-8,0.002520947440465501,3.385345763496335e-5,-4.0120551152513905e-8,0.002521357059662189,3.3573332103171066e-5,-3.976057689732734e-8,0.0025218278023055253,3.335822588172072e-5,-3.9481488035551096e-8,0.0025223344083919984,3.3228896480038676e-5,-3.930979257938309e-8,0.0025228460215779803,3.319367073788616e-5,-3.925652251261835e-8,0.0025233303087924958,3.324669892834196e-5,-3.9315015622613785e-8,0.0025237579626117535,3.336760095667987e-5,-3.946031753109398e-8,0.0025241074151963775,3.352256518500154e-5,-3.9650309128366536e-8,0.0025243697315655363,3.366716014331096e-5,-3.982900185191263e-8,0.002524553460207322,3.375163915239177e-5,-3.9933128485974816e-8,0.002524688300114605,3.37298851909107e-5,-3.9903559505638475e-8,0.002524824998114826,3.357240651657453e-5,-3.970202211903166e-8,0.0025250277665400896,3.328120777325597e-5,-3.933021967054159e-8,0.002525356611076024,3.289990453199541e-5,-3.8842803606554595e-8,0.0025258428381231134,3.250914558990305e-5,-3.834160036262284e-8,0.0025264698957574395,3.220189906693548e-5,-3.794432342774024e-8,0.0025271741566565867,3.2047197639093385e-5,-3.773873488953271e-8,0.002527868930050737,3.206296769477658e-5,-3.7748283537389005e-8,0.002528477957775852,3.2214078628227146e-5,-3.792951338789108e-8,0.0025289589671146006,3.243333093220877e-5,-3.8198347470684486e-8,0.002529308244893737,3.2649160481611736e-5,-3.8464834618929027e-8,0.002529551044230285,3.280554245702909e-5,-3.8658136766423037e-8,0.0025297276422903844,3.286996887218826e-5,-3.873662679239773e-8,0.0025298816375502052,3.283279972249427e-5,-3.8687266747971134e-8,0.002530052440279624,3.2702708511500886e-5,-3.852013964263886e-8,0.0025302712732322313,3.250144171865661e-5,-3.8262077101730963E-08,0.002530559210242333,3.22591991158146e-5,-3.7950935413685944e-8,0.002530926148178654,3.2010602838034795e-5,-3.7630466201304596e-8,0.002531370351391248,3.1790798148834993e-5,-3.7345270529438355e-8,0.0025318786907376338,3.1631370951251876e-5,-3.713553615551818e-8,0.0025324279262051433,3.155608559611767e-5,-3.703162366365894e-8,0.0025329874164920214,3.1576901848478516e-5,-3.704907123537745e-8,0.0025335233363896095,3.1691081346079224e-5,-3.71849683887019e-8,0.002534004013295205,3.1880164541897305e-5,-3.741660475396124e-8,0.0025344056658638974,3.211134266810114e-5,-3.770302889521404e-8,0.0025347176716889862,3.234141683476799e-5,-3.798981805268735e-8,0.0025349464931195965,3.25231453918205e-5,-3.821692596727692e-8,0.002535117468766687,3.261356425395861e-5,-3.832919965284332e-8,0.002535273522037362,3.25837585549067e-5,-3.828894828785741e-8,0.0025354694854592633,3.242890013057747e-5,-3.808899818124254e-8,0.0025357608919522735,3.217582413424165e-5,-3.776263794934066e-8,0.002536187666940124,3.1883621764644e-5,-3.738458087106923e-8,0.0025367568259437178,3.1632385404099197e-5,-3.7056717765237276e-8,0.0025374327525164407,3.1499190159307474e-5,-3.687752844703763e-8,0.0025381439662942977,3.152925181564535e-5,-3.690529396896161e-8,0.00253880714969785,3.1717495544648184e-5,-3.7134493175846014e-8,0.002539357012067217,3.201212311537006e-5,-3.7500132915228656e-8,0.002539765928854451,3.233760649167408e-5,-3.79067823651572e-8,0.0025400453147970577,3.2622583246552875e-5,-3.82638918563021e-8,0.0025402331112333227,3.281872156862578e-5,-3.850972952935261e-8,0.002540377487382661,3.290621872055572e-5,-3.8618458257282727e-8,0.002540524155092487,3.288979390474908e-5,-3.8595246105451726e-8,0.0025407093934606078,3.279105867884921e-5,-3.846681028316092e-8,0.002540957537634892,3.2641231271875194e-5,-3.827233474111451e-8,0.002541280815381751,3.247562338960235e-5,-3.805651702208651e-8,0.0025416799467947535,3.232966235413645e-5,-3.786445609457888e-8,0.002542144857740274,3.223562798311164e-5,-3.7737407372711096e-8,0.002542655579590631,3.221938662051105e-5,-3.7708565661377785e-8,0.0025431838362320446,3.229680174430522e-5,-3.779849423590047e-8,0.0025436960054889923,3.247013233511464e-5,-3.8010564296692125e-8,0.00254415790798978,3.272542643389036e-5,-3.8327620226833e-8,0.002544541182956549,3.303226997284184e-5,-3.871155421654684e-8,0.0025448301444755037,3.334704611861932e-5,-3.9107270584671315e-8,0.0025450273211040327,3.3620069672829226e-5,-3.9451574837501164e-8,0.002545155729501141,3.380568399136757e-5,-3.968592063249876e-8,0.002545256556630443,3.387319471601984e-5,-3.977037692107729e-8,0.0025453820443540687,3.3816009067509984e-5,-3.969547432241733e-8,0.002545584452323269,3.365650342624907e-5,-3.948871602576002e-8,0.0025459029162299583,3.344455147949948e-5,-3.9213016496428415e-8,0.0025463510522096334,3.324840420752361e-5,-3.895529090102889e-8,0.002546909232956193,3.3138246514345544e-5,-3.8805530645937213e-8,0.002547525817875957,3.31656565561402e-5,-3.883045961997576e-8,0.002548129745697608,3.334578366524815e-5,-3.9050513834874766e-8,0.002548651901131051,3.3650693689135876e-5,-3.9431034299941284e-8,0.00254904685669721,3.4018656743914485e-5,-3.989388291545174e-8,0.002549305056062235,3.4375770534290136e-5,-4.034493649891447e-8,0.002549450755241978,3.465939649203068e-5,-4.070401123079711e-8,0.0025495291586907494,3.4833241697630345e-5,-4.092420182378461e-8,0.002549590687379239,3.4890489219274215e-5,-4.099602575860678e-8,0.0025496789205144556,3.4848031855415884e-5,-4.0940251920067316e-8,0.0025498244612649898,3.473730209237217e-5,-4.079637327911076e-8,0.0025500436032672657,3.459585033605535e-5,-4.061196445682029e-8,0.002550339547154352,3.4461308211710806e-5,-4.0434988555481746e-8,0.0025507043433619027,3.4367523260307965e-5,-4.030880973480197e-8,0.0025511206731693597,3.4341897944161364e-5,-4.0268729945377805e-8,0.002551563424104876,3.4402972367080165e-5,-4.03388608138628e-8,0.002552001606617659,3.4557690980306746e-5,-4.0528610973922175e-8,0.002552401461273141,3.479848664498499e-5,-4.082892216673805e-8,0.0025527314827823774,3.510120673609544e-5,-4.120952912256527e-8,0.002552969364218686,3.542565410114826e-5,-4.161951137566323e-8,0.0025531095580215266,3.572058968524942e-5,-4.19935413975739e-8,0.002553168729760865,3.59339104478195e-5,-4.226480110017664e-8,0.0025531858573809097,3.602631744383978e-5,-4.238244913932361e-8,0.0025532150611217693,3.598419299693054e-5,-4.232817322961466e-8,0.002553312233386756,3.582648549097322e-5,-4.212517282076237e-8,0.0025535195183206613,3.560220174300033e-5,-4.1835212060668614e-8,0.002553852830502855,3.537869695525301e-5,-4.15439349344679e-8,0.0025542964378125308,3.5224255096316406e-5,-4.133880357556166e-8,0.002554806195557747,3.519005643611671e-5,-4.1286055750094206e-8,0.002555320571266334,3.5296537354939525e-5,-4.141303722830442e-8,0.0025557766128750385,3.552799805828805e-5,-4.170091750744843e-8,0.002556126465171574,3.583732608559857e-5,-4.209034923582469e-8,0.002556349360987087,3.615973932622834e-5,-4.249882289419115e-8,0.0025564551410904254,3.6431100822784126e-5,-4.284408179364047e-8,0.0025564785276809823,3.6604393384032696e-5,-4.306534222497807e-8,0.002556467160589559,3.6658984478097046e-5,-4.3135357610844236e-8,0.002556468510402671,3.660096821231846e-5,-4.306106582894111e-8,0.0025565200544311623,3.645675748916501e-5,-4.28755593884766e-8,0.0025566445046864778,3.626394236750845e-5,-4.262649174123844e-8,0.0025568493925952245,3.606285126280341e-5,-4.236530656389189e-8,0.002557129168848333,3.589047078361781e-5,-4.213942711868888e-8,0.0025574680949682657,3.5776750212926264e-5,-4.1987475893609535e-8,0.0025578429268030643,3.574244515459497e-5,-4.193647233080398e-8,0.002558225197975276,3.579750560221392e-5,-4.1999734310573656e-8,0.0025585835602312756,3.593934241195524e-5,-4.217460204810126e-8,0.002558887016647417,3.61509584570488e-5,-4.2439939751589254e-8,0.0025591098618594843,3.639984373749989e-5,-4.2754572922321514e-8,0.002559238497448476,3.663948624180955e-5,-4.305908526809104e-8,0.002559278835866122,3.6815737799850185e-5,-4.3283910146574906e-8,0.002559261046831353,3.68791601038681e-5,-4.336518833602966e-8,0.0025592372774527606,3.680125222475687e-5,-4.3265665007869605e-8,0.0025592697003744484,3.658826729490232e-5,-4.299250430234186e-8,0.0025594113266689754,3.6284623802832374e-5,-4.260177686092147e-8,0.0025596874257284618,3.596177093402923e-5,-4.218437109225698e-8,0.0025600863540812774,3.569620677368294e-5,-4.183807532178788e-8,0.002560563687246403,3.554623400075656e-5,-4.1637989758230514e-8,0.002561056690233244,3.553661609585996e-5,-4.161684553067492e-8,0.0025615023865055877,3.565507989845713e-5,-4.176023644906828e-8,0.002561853048804872,3.585927599621287e-5,-4.20151041647804e-8,0.0025620856129585094,3.6090108860365954e-5,-4.230643641429664e-8,0.0025622040446008454,3.628699041834416e-5,-4.255663518033421e-8,0.0025622353918832905,3.6401300490328786e-5,-4.270283147309331e-8,0.0025622213473997326,3.6405401558346106e-5,-4.2708678956345274e-8,0.0025622078408738705,3.6295813489391095e-5,-4.256872173084837e-8,0.0025622353848293975,3.609068615788058e-5,-4.230540259760305e-8,0.00256233232102081,3.582322550250386e-5,-4.1960772840867707e-8,0.002562511863801732,3.553353735483984e-5,-4.158605612885912e-8,0.0025627725248878294,3.526111693837438e-5,-4.123196242121757e-8,0.00256310070883618,3.503928727808233e-5,-4.0941482037820396e-8,0.0025634741471409566,3.4891828381175004e-5,-4.074551346356165e-8,0.002563865248603042,3.483125361276283e-5,-4.066063228427299e-8,0.002564244075042713,3.4857926898380974e-5,-4.068793102758481e-8,0.002564581202623444,3.495942454822687e-5,-4.0812119542659516e-8,0.00256485109943431,3.5110048036088305e-5,-4.100075191629571e-8,0.0025650367242128005,3.527118210779312e-5,-4.120451556732618e-8,0.002565135498337338,3.539413055019303e-5,-4.136076151439963e-8,0.0025651654120114266,3.5427525351978796e-5,-4.1403038721833427e-8,0.0025651680412939974,3.533045146974794e-5,-4.127809559426407e-8,0.0025652038004362098,3.508913423679075e-5,-4.096749224333056e-8,0.0025653363340437958,3.472992631684516e-5,-4.050439181559414e-8,0.0025656093621240807,3.431861032240273e-5,-3.997271395936973e-8,0.0025660270415399614,3.394124366569468e-5,-3.9482630402027894e-8,0.0025665499166005316,3.367374522340637e-5,-3.913169321930131e-8,0.0025671094737676993,3.3555941288687166e-5,-3.8971649823626466e-8,0.0025676326398133926,3.358238507761676e-5,-3.899658257921173e-8,0.00256806353887396,3.3710715096302974e-5,-3.915332696323073e-8,0.0025683748955028416,3.387946611070678e-5,-3.936392740831083e-8,0.0025685688159335627,3.402630843529469e-5,-3.954873741392243e-8,0.0025686706264498697,3.410151913115822e-5,-3.96436201055269e-8,0.002568719735740128,3.4075375284090386e-5,-3.9609586863852165e-8,0.0025687602388208127,3.3940249039981586e-5,-3.9435794394587893e-8,0.002568832735617296,3.370870760914346e-5,-3.913743671001868e-8,0.0025689681542897694,3.340879250968684e-5,-3.874991257803349e-8,0.0025691840551694215,3.307763210742136e-5,-3.832068947589197e-8,0.002569483538443005,3.275462578485857e-5,-3.790047634512565e-8,0.00256985645494049,3.2475309573827486e-5,-3.753521316052912e-8,0.0025702822795653883,3.226668899010827e-5,-3.725997236190257e-8,0.002570733820216625,3.214437650152126e-5,-3.70952464417701e-8,0.002571181033117111,3.211133565934368e-5,-3.70453424363933e-8,0.0025715946013054125,3.215772517602418e-5,-3.7098167201791944e-8,0.002571949318347555,3.226144137496881e-5,-3.722583343084536e-8,0.002572227570996682,3.2389277195387017e-5,-3.738598474604562e-8,0.0025724233208959243,3.249913626791757e-5,-3.752447594345222e-8,0.002572546572517723,3.2544481248383096e-5,-3.7581027423136185e-8,0.002572627105263867,3.248253008845186e-5,-3.7499865346558056e-8,0.0025727146254667485,3.2286766565557764e-5,-3.7246045798024494e-8,0.0025728713746888203,3.196144702345607e-5,-3.6824362906102526e-8,0.0025731546573224077,3.1551122395760685e-5,-3.6291732875808416e-8,0.0025735930611439093,3.113531128318894e-5,-3.5750349486020505e-8,0.0025741686669498156,3.080383281342957e-5,-3.5315932671875985e-8,0.002574818793527538,3.0622158898999846e-5,-3.5073179334983326e-8,0.002575459250901792,3.0606384083367444e-5,-3.5043561582390667e-8,0.0025760157713347175,3.072183306088944e-5,-3.518340880366333e-8,0.0025764462366678763,3.0902486165110045e-5,-3.5408643786040035e-8,0.0025767458975593516,3.107681621716422e-5,-3.562773879707096e-8,0.0025769394739584782,3.118739906047621e-5,-3.5766760816977004e-8,0.0025770682803444704,3.12001551469743e-5,-3.5781267605868635e-8,0.0025771782767451306,3.110525759781823e-5,-3.565767914468704e-8,0.0025773113662062915,3.091339865537416e-5,-3.540879179965687e-8,0.0025774999609862632,3.065026064735654e-5,-3.5066958787603745e-8,0.0025777640357551542,3.035060945700293e-5,-3.4676643389330934e-8,0.002578110043284982,3.0052507451921462e-5,-3.428694627394564e-8,0.002578531397055513,2.9791926281541815e-5,-3.3944523195161236e-8,0.0025790103290381297,2.9598057935518227e-5,-3.368738209113566e-8,0.0025795209096909134,2.948965519446499e-5,-3.354007538112134e-8,0.002580032896739608,2.94727630782897e-5,-3.351077440578792e-8,0.0025805159234916397,2.954000878094914e-5,-3.3590389005577315e-8,0.002580943592558336,2.9671294779383406e-5,-3.375345201478358e-8,0.0025812972568394475,2.983567962877638e-5,-3.3960441519085414e-8,0.002581569412426488,2.9994385199715056e-5,-3.416148972868799e-8,0.002581766674986788,3.0105076417356167e-5,-3.430175679860849e-8,0.0025819120683374308,3.0127919994288804e-5,-3.4329229444587715e-8,0.002582045519993052,3.0034048227300084e-5,-3.420579656011638e-8,0.0025822203949664234,2.9816100977510195e-5,-3.392112802616561e-8,0.002582493526172687,2.9498181435378302e-5,-3.3505790908997055e-8,0.0025829078467866826,2.913934269067586e-5,-3.3035889417979293e-8,0.002583471922975573,2.8823154006253027e-5,-3.261957918279001e-8,0.0025841475821974037,2.8630944686295138e-5,-3.236241863773583e-8,0.0025848575009842015,2.860875020177161e-5,-3.23245690882075e-8,0.0025855132051104206,2.8747336224273945e-5,-3.249487409873808e-8,0.0025860483870083825,2.898840096044825e-5,-3.279872884323055e-8,0.0025864386289602428,2.925160284354101e-5,-3.31328354281292e-8,0.0025867003344974215,2.9464434140691195e-5,-3.340364643567008e-8,0.0025868758817611977,2.9580498213838604e-5,-3.355089908895895e-8,0.0025870163518221215,2.958356532888121e-5,-3.3552916689574256e-8,0.00258716874146591,2.948254760991543e-5,-3.342033057128494e-8,0.0025873690254704456,2.930331685653275e-5,-3.31857940505852e-8,0.0025876396104315717,2.908092911135896e-5,-3.289416461028243e-8,0.0025879892061104566,2.88534249664018e-5,-3.259456856612757e-8,0.0025884138089266786,2.8656989162023898e-5,-3.2334059412977954e-8,0.002588898359017111,2.8521979692271508e-5,-3.215231454490244e-8,0.002589419062272378,2.8469586189780088e-5,-3.2077164254932806e-8,0.002589946473323683,2.8509159090307877e-5,-3.212107523599057e-8,0.002590449393316276,2.8636563050092073e-5,-3.227904091415366e-8,0.002590899361197364,2.8834057391279875e-5,-3.2528461699677137e-8,0.00259127520629838,2.9071975778584452e-5,-3.2831291645010475e-8,0.0025915670649930126,2.9312176621478835e-5,-3.313838678718475e-8,0.0025917793326626975,2.951309804139549e-5,-3.33958896106978e-8,0.0025919320721802777,2.96361235160836e-5,-3.355336698452127e-8,0.002592060388232209,2.9652876016196784e-5,-3.357329612354791e-8,0.0025922110409532205,2.9552949250428954e-5,-3.344128213388367e-8,0.0025924352611730508,2.9350891816452204e-5,-3.3175402893513874e-8,0.0025927770732672843,2.908978789339379e-5,-3.2831114881942346e-8,0.0025932582302109035,2.8837351096213648e-5,-3.2496316807290324e-8,0.0025938644424488276,2.8670845449783314e-5,-3.2271752176790486e-8,0.00259454130569729,2.8651787572331885e-5,-3.223802204062918e-8,0.0025952073153012044,2.880006435961552e-5,-3.242178048536644e-8,0.0025957820237779284,2.9082752023308125e-5,-3.2781025144444316e-8,0.002596215451355888,2.942669394122801e-5,-3.3221292787055197e-8,0.0025965024447693404,2.9748129367640864e-5,-3.3634051131772567e-8,0.0025966765282158253,2.998185229157122e-5,-3.3934507817174133e-8,0.002596791242167228,3.009622528063916e-5,-3.408109516064842e-8,0.0025969011572768027,3.0092558261656323e-5,-3.4074756512656124e-8,0.002597049688176753,2.9995632087270322e-5,-3.3946851949197073e-8,0.0025972643186138377,2.9842572236855614e-5,-3.3744958806311066e-8,0.002597556681278304,2.9673938276303314e-5,-3.3521470462183287e-8,0.002597924726275709,2.9527819877394803e-5,-3.332595043754231e-8,0.0025983552864050196,2.9436122490796813e-5,-3.320019805897644e-8,0.002598826556628034,2.9421965307062316e-5,-3.3174709416024415e-8,0.0025993106853013,2.949756098639174e-5,-3.32658027069346e-8,0.002599776848353735,2.9662467082486734e-5,-3.347330412600232e-8,0.0026001951252648077,2.99025861685836e-5,-3.377926073172787e-8,0.0026005411717937273,3.019067108816419e-5,-3.414860105393843e-8,0.002600801115884702,3.048904747005782e-5,-3.453261736501532e-8,0.0026009756449572323,3.075479964565841e-5,-3.487558988314453e-8,0.0026010821201373643,3.094704699047445e-5,-3.512412559281178e-8,0.0026011537374556978,3.103526998712179e-5,-3.523794137373505e-8,0.0026012352359606815,3.100711111394474e-5,-3.52001023446636e-8,0.0026013752640351045,3.08739211784446e-5,-3.5024463414013454e-8,0.0026016160874248713,3.0672358090410115e-5,-3.475804093991398e-8,0.0026019820559800674,3.0460335902351476e-5,-3.447598865451195e-8,0.0026024694362678106,3.0306029731080202e-5,-3.4267389520307465e-8,0.0026030416290290835,3.0270338541856285e-5,-3.421233572704718e-8,0.0026036342474958208,3.0386657894908002e-5,-3.435533680675956e-8,0.0026041720030882468,3.064594194570206e-5,-3.4685549028801975e-8,0.0026045930310347977,3.09961293659131e-5,-3.513578419828963e-8,0.0026048698621258057,3.1359222083486464e-5,-3.560466452625087e-8,0.002605016277847952,3.165875436058266e-5,-3.5992435719287957e-8,0.0026050775582436726,3.1843809880593544e-5,-3.623231983185307e-8,0.0026051114117463955,3.1899280024474e-5,-3.630395313793583e-8,0.0026051700508598736,3.184180085895025e-5,-3.622821835659225e-8,0.0026052897100294578,3.1707923332180516e-5,-3.605202198717156e-8,0.0026054879335475844,3.154166996092474e-5,-3.5832271992857454e-8,0.0026057657097087847,3.138536625159791e-5,-3.5624031184444675e-8,0.0026061113393798714,3.1274330301516524e-5,-3.5473569113068227e-8,0.0026065041725679677,3.123426843754492e-5,-3.5414846395313414e-8,0.0026069176827509784,3.127995084377525e-5,-3.54676479866181e-8,0.0026073221793504135,3.141424395457776e-5,-3.563622226078849e-8,0.002607687760832499,3.162725534231478e-5,-3.590812143263662e-8,0.002607988052610515,3.189600175406857e-5,-3.6253749808592313e-8,0.0026082048747776295,3.218555030603266e-5,-3.662781876104157e-8,0.0026083332526672066,3.2452725750126513e-5,-3.697411627683993e-8,0.0026083853531278017,3.265297934002162e-5,-3.72343878712858e-8,0.0026083914259650088,3.2749867670578894e-5,-3.736065308576354e-8,0.002608396133617845,3.272507890931113e-5,-3.732831038939484e-8,0.0026084499787289036,3.258582024132688e-5,-3.714589715717855e-8,0.0026085974212649975,3.236651424287259e-5,-3.6857515677651e-8,0.0026088647679620098,3.2123260707560836e-5,-3.65358635683691e-8,0.002609251366434725,3.1921661831404596e-5,-3.6266559361749115e-8,0.0026097270315835943,3.182058662536569e-5,-3.612701970627575e-8,0.002610237284691165,3.185588171012813e-5,-3.6165054551592994e-8,0.002610716126815699,3.202876234196642e-5,-3.6383392719986345e-8,0.0026111037028992033,3.23033372673764e-5,-3.6736088564341154e-8,0.0026113636304113436,3.261570097552551e-5,-3.714014721843922e-8,0.002611493434829786,3.2892780986458314e-5,-3.750008482171149e-8,0.002611523495367077,3.307418573417459e-5,-3.7736560791061143E-08,0.002611505142783382,3.312826382278772e-5,-3.780750968567028e-8,0.002611493763715752,3.3056708359165294e-5,-3.771431792722278e-8,0.0026115341933477952,3.2888214172239555e-5,-3.749370515848177e-8,0.0026116528511147953,3.266635873779777e-5,-3.7202054725746606e-8,0.0026118568135878677,3.2437504850753895e-5,-3.6899719726700316e-8,0.0026121372770168093,3.22421675305727e-5,-3.663975855845446e-8,0.0026124744813415092,3.2110441667230555e-5,-3.646188211570326e-8,0.002612842227916604,3.206036322123708e-5,-3.639018811094762e-8,0.00261321139785924,3.2097696128144984e-5,-3.64327692480781e-8,0.00261355274464152,3.2216066114155835e-5,-3.658181139714531e-8,0.0026138396427348816,3.2397063044748426e-5,-3.681367790345908e-8,0.0026140514872013475,3.261067171343822e-5,-3.708942654441659e-8,0.0026141780311365196,3.2817050683532635e-5,-3.7357080590710184e-8,0.002614224114800926,3.297101014117252e-5,-3.7557436147006555e-8,0.002614213119889088,3.303013696291152e-5,-3.7634673802280204e-8,0.002614186549965068,3.296599359632987e-5,-3.755103806085695e-8,0.0026141973753741167,3.277534783937561e-5,-3.7301599143301795e-8,0.002614297046902401,3.248635183237581e-5,-3.69224435741917e-8,0.0026145197475576695,3.215508644569542e-5,-3.648630993783964e-8,0.002614870090159904,3.185171140863245e-5,-3.608467312200419e-8,0.0026153197674543857,3.164059402548646e-5,-3.5801927989370486e-8,0.0026158147703580206,3.156177686629293e-5,-3.569118447274441e-8,0.0026162903077401106,3.1620210993565046e-5,-3.5760006489734524e-8,0.0026166880991987354,3.1785560398102544e-5,-3.5969814749259693e-8,0.002616970841721617,3.200160523740788e-5,-3.624783231824479e-8,0.002617130261397801,3.220181753315225e-5,-3.65072435138508e-8,0.0026171871606737534,3.232655585316976e-5,-3.6669675925902054e-8,0.00261718397046602,3.233719347395405e-5,-3.6683842036219965e-8,0.0026171724016019787,3.222347506708292e-5,-3.6535405177033614e-8,0.0026172002283405987,3.200264024737339e-5,-3.624607593524087e-8,0.0026173011810684,3.171173130676567e-5,-3.586373455846947e-8,0.0026174902392406083,3.139662825485608e-5,-3.544818102047367e-8,0.0026177642440258567,3.110164755113335e-5,-3.5057518398642445e-8,0.0026181060091383474,3.086218416322592e-5,-3.4738433135395185e-8,0.0026184896650506663,3.070099873181416e-5,-3.452121062024481e-8,0.0026188855768160607,3.062736487635263e-5,-3.441851050195791e-8,0.0026192641644238587,3.063776642104189e-5,-3.44262138034998e-8,0.0026195987827379364,3.071705603650061e-5,-3.452490184616867e-8,0.0026198682621240295,3.083960982102611e-5,-3.4681327174304134e-8,0.0026200597799300902,3.0970713580179304e-5,-3.485016751422272e-8,0.0026201724252346513,3.106906901777973e-5,-3.497724556731821e-8,0.002620221032692184,3.1091763777759243e-5,-3.500601824118333e-8,0.0026202386178564006,3.10028288611161e-5,-3.4888839501679675e-8,0.0026202745150329704,3.0784947027866455e-5,-3.4602410900141006e-8,0.0026203852922867623,3.0450819216758257e-5,-3.416279062923851e-8,0.002620618265425924,3.0047622079189514e-5,-3.363132109745287e-8,0.002620992870319827,2.9648323815135033e-5,-3.31033303947174e-8,0.0026214894619416536,2.932979763141325e-5,-3.267956343422445e-8,0.0026220531242507274,2.9146566799369495e-5,-3.2431878766493014e-8,0.002622611657445149,2.9112958080091928e-5,-3.237984681690709e-8,0.0026230987533740094,2.9201352737337322e-5,-3.248826516711856e-8,0.0026234720422993033,2.935474709537481e-5,-3.268331002587069e-8,0.002623720696604966,2.950580934218716e-5,-3.28772184813543e-8,0.002623863141320352,2.9594733190630928e-5,-3.2991532941629956e-8,0.002623938403472255,2.9581523567624585e-5,-3.2973239176112444e-8,0.0026239948751797743,2.945153944445875e-5,-3.280223748832211e-8,0.002624079352158989,2.9214975075539966e-5,-3.249095709508292e-8,0.0026242282334253994,2.8901697565596798e-5,-3.207786296841002e-8,0.0026244620668671175,2.855315053807396e-5,-3.161700102240202e-8,0.0026247839524003213,2.821331655109691e-5,-3.116615430893701e-8,0.0026251814438661785,2.7920728883389294e-5,-3.077624804492969e-8,0.002625630821426735,2.770290261143587e-5,-3.048387523980967e-8,0.0026261023194173497,2.7573621615054672e-5,-3.030759911853844e-8,0.0026265650867071107,2.753272069170523e-5,-3.024760371638935e-8,0.0026269911754542366,2.7567495629662442e-5,-3.0287542037181364e-8,0.0026273585031503107,2.7654808956776647e-5,-3.0397305793839284e-8,0.0026276531846827346,2.776337289842733e-5,-3.0535989704684127e-8,0.0026278717322375995,2.785627661607388e-5,-3.0655133830369624e-8,0.0026280234298139303,2.7894361322732897e-5,-3.0703083939648824e-8,0.0026281325803872136,2.7841478039741167e-5,-3.063189326845691e-8,0.0026282392000712505,2.7672557297109677e-5,-3.040802070948686e-8,0.0026283955437060506,2.7384085700415085e-5,-3.002625965469175e-8,0.00262865565196701,2.700371371201096e-5,-2.9522515841626875e-8,0.002629057605315128,2.6592301817640855e-5,-2.897657699704715e-8,0.0026296042239974493,2.623136467768682e-5,-2.8495630917078668e-8,0.0026302538309996223,2.599585843503772e-5,-2.8178505464655922e-8,0.002630930614107705,2.5924188462011436e-5,-2.807623809106079e-8,0.0026315519205043305,2.6002942441934412e-5,-2.8171931342658712e-8,0.002632057542513618,2.6175113742488016e-5,-2.8391396121084223e-8,0.0026324258329257447,2.6364726212698507e-5,-2.8635308308118833e-8,0.002632672462723894,2.6502714775448774e-5,-2.881304110057633e-8,0.0026328380412312087,2.6543357889184606e-5,-2.8864178132588297e-8,0.0026329731241864014,2.6469411774491017e-5,-2.8765333495100423e-8,0.0026331258609140727,2.6289281768524357e-5,-2.852665947748336e-8,0.0026333338989213834,2.6030282261764095e-5,-2.8183285436663457e-8,0.002633620171689503,2.573080090149753e-5,-2.7785262712895203e-8,0.002633991642655656,2.5432731091922993e-5,-2.7387706234444074e-8,0.0026344403222787766,2.517473880061446e-5,-2.7041855038120544e-8,0.002634946113457011,2.498684705051351e-5,-2.6787753182580472e-8,0.0026354809501950237,2.4886802821856877e-5,-2.6649271729928865e-8,0.0026360135612485953,2.487845151655501e-5,-2.66318567861711e-8,0.0026365141657436557,2.4952076373098923e-5,-2.672296922722169e-8,0.002636958487571637,2.508635806998142e-5,-2.6894714182866534e-8,0.002637330770592852,2.5251345857424093e-5,-2.7107782135658014e-8,0.0026376258574601534,2.541191401004594e-5,-2.731596108184508e-8,0.002637850566159729,2.5531539580490765e-5,-2.747102088376633e-8,0.002638024527826738,2.557660264320669e-5,-2.7528304916922454e-8,0.0026381802741849004,2.552172015255805e-5,-2.7453780860784707e-8,0.0026383615500640014,2.535654692073106e-5,-2.7233147342018143e-8,0.0026386179885873363,2.5093413410281484e-5,-2.6882116638732477e-8,0.002638994289794082,2.4773009859853065e-5,-2.6454097522886618e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json
new file mode 100644
index 0000000..270577e
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":19000,"numberOfSamples":1000,"samples":[0.00263951402096563,2.446275040491078e-5,-2.6038117688221015e-8,0.0026401631724560673,2.4241976200195275e-5,-2.5739261712150362e-8,0.002640884349598046,2.417407411008679e-5,-2.5641764129475454e-8,0.0026415912918163185,2.4277459627606698e-5,-2.577057311285661e-8,0.0026422007751247287,2.4514250198517228e-5,-2.6076268743377622e-8,0.002642664329828072,2.4806135401016956e-5,-2.6455914313675208e-8,0.002642981408758501,2.5067420523334124e-5,-2.6796599674782414e-8,0.0026431902581784475,2.523476738670862e-5,-2.701462116287926e-8,0.0026433473077564114,2.5280434293348607e-5,-2.707291191164421e-8,0.0026435080278592402,2.5209814035850336e-5,-2.6977864625794997e-8,0.0026437153058168224,2.5051197769627946e-5,-2.6766036632474325e-8,0.002643995008250455,2.4844553414124373e-5,-2.6489610125027892e-8,0.002644356096346505,2.4632482174508258e-5,-2.6204648569688263e-8,0.002644792866933108,2.4453878979516923e-5,-2.5962750928942762e-8,0.002645287958825506,2.433962413644026e-5,-2.580522022561437e-8,0.0026458157625529125,2.4309628109960647e-5,-2.5758941317575327e-8,0.00264634623063722,2.4371028134717308e-5,-2.5833817493889664e-8,0.0026468490048528843,2.4517626043978552e-5,-2.6021955503015233e-8,0.002647297629221693,2.473075415894809e-5,-2.629884122598041e-8,0.002647673419069512,2.498168300232041e-5,-2.6626587976528904e-8,0.0026479684516871804,2.5235364563765828e-5,-2.6958906132239313e-8,0.0026481873145099825,2.54550480044092e-5,-2.724714977923732e-8,0.0026483474854581976,2.5607329200806667e-5,-2.744689859121178e-8,0.002648478321749667,2.5667306663201197e-5,-2.7524725198145248e-8,0.002648618565417001,2.562364143904652e-5,-2.746495256788262e-8,0.002648811933829168,2.548331398325493e-5,-2.7276137128600436e-8,0.002649099993304903,2.5275225022656478e-5,-2.6996080239347117e-8,0.0026495118344468096,2.5050470037239995e-5,-2.6692385337925312e-8,0.0026500516782408433,2.4875937156110125e-5,-2.6454031394300517e-8,0.0026506887377273874,2.481830242231187e-5,-2.637005584696817e-8,0.0026513571570154788,2.4919878684211346e-5,-2.649732055333089e-8,0.0026519727576500727,2.5176293414199947e-5,-2.6830682803784936e-8,0.00265246347865712,2.553137242424813e-5,-2.7296067819030845e-8,0.0026527977885291948,2.5897092428559638e-5,-2.777691417282513e-8,0.0026529937872264786,2.6188736914085377e-5,-2.8160834927125474e-8,0.0026531053400488365,2.6354405340763377e-5,-2.8378742435525895e-8,0.002653197143730883,2.6384803835271885e-5,-2.8417798104530085e-8,0.0026533237489522734,2.630496073324375e-5,-2.8310488620170042e-8,0.002653519415667135,2.61584941720321e-5,-2.8113966146280626e-8,0.0026537972075638358,2.5993391727317396e-5,-2.7891437296909137e-8,0.0026541528220946162,2.5852711656499893e-5,-2.7699980495729533e-8,0.002654569583467504,2.576980469437125e-5,-2.758418502662082e-8,0.002655022888269817,2.5766321279371505e-5,-2.7573341150534074e-8,0.0026554838903719694,2.5851487346184455e-5,-2.7680269328933923e-8,0.0026559228543872925,2.6021962722230312e-5,-2.7900982114737346e-8,0.0026563125592436493,2.6262270927647677e-5,-2.8215210320601784e-8,0.0026566318822620954,2.6546159408893735e-5,-2.8588246183577963e-8,0.0026568693325829773,2.683937297731775e-5,-2.8974675169938895e-8,0.00265702588046726,2.7104047119859548e-5,-2.9324209301872344e-8,0.0026571162804157502,2.730439944298196e-5,-2.9589182861804454e-8,0.002657168287578267,2.741298625135473e-5,-2.973278593466467e-8,0.002657219506910407,2.7416528074622072e-5,-2.9736788701860016e-8,0.002657312004454739,2.7320200846281446e-5,-2.9607346163960382e-8,0.0026574851280428084,2.714945498836805e-5,-2.9377627673142143e-8,0.0026577671410715864,2.6948550466389847e-5,-2.9106116594645743e-8,0.0026581666337407396,2.677480114515534e-5,-2.8869130261933987e-8,0.002658665644369953,2.668759153112913e-5,-2.874622335182529e-8,0.0026592177642860556,2.673249924766369e-5,-2.8798893801029236e-8,0.0026597551845333914,2.6923863313585407e-5,-2.9047096880029876e-8,0.0026602066278280773,2.7233239467283458e-5,-2.945360447347533e-8,0.0026605218701161496,2.759279450344971e-5,-2.992839322576825e-8,0.002660691339317348,2.791687831695263e-5,-3.0357403494703774e-8,0.0026607489650131524,2.813307297178182e-5,-3.064397603742436e-8,0.002660756316410744,2.820629128228656e-5,-3.0740975280116455e-8,0.00266077813131762,2.814444053347429e-5,-3.0658329382785926e-8,0.0026608626181401033,2.7987094517445165e-5,-3.044802835863527e-8,0.002661033282093157,2.7787369099427664e-5,-3.018018911351549e-8,0.002661290670229049,2.759646253123286e-5,-2.992268275086257e-8,0.002661618847227499,2.745466279524221e-5,-2.9729256636510297e-8,0.002661992324996788,2.7388048564438633e-5,-2.9635075082451442e-8,0.0026623814914065623,2.740846380825369e-5,-2.9656508743774662e-8,0.0026627564064791672,2.751469021981976e-5,-2.9792508338229933e-8,0.002663089657287003,2.769378081550649e-5,-3.002626101217006e-8,0.0026633589993581537,2.7922422231694105e-5,-3.032697532756177e-8,0.0026635502049094915,2.816877186333765e-5,-3.065235507227498e-8,0.002663660058606214,2.8395509491539593e-5,-3.095269273591784e-8,0.0026636988226479592,2.8564683516255168e-5,-3.1177317725720975e-8,0.0026636910185861354,2.8644267020628355e-5,-3.128328931824663e-8,0.002663673368164203,2.8615444636392442e-5,-3.124507257083623e-8,0.0026636892999802016,2.847882357726595e-5,-3.106284172552677e-8,0.0026637804953454328,2.8257367087954442e-5,-3.076651119240239e-8,0.0026639771539304236,2.7994347029093748e-5,-3.041320967031577e-8,0.002664289390944928,2.7745919962196963e-5,-3.0077603120369135e-8,0.0026647021583839263,2.7569343911087362e-5,-2.983632036881539e-8,0.002665175574611234,2.7508966541401323e-5,-2.9749234062979572e-8,0.002665651753105894,2.758308150002246e-5,-2.9841711448467954e-8,0.0026660679387967637,2.777557445101302e-5,-3.009314804079612e-8,0.002666373652606828,2.8036422130212083e-5,-3.043735504000154e-8,0.0026665467921051737,2.8293485634668975e-5,-3.0778184924067085e-8,0.002666601852555459,2.8473726055012245e-5,-3.1017907545195027e-8,0.0026665852853927806,2.8526301970881325e-5,-3.1088172804032435e-8,0.002666559122253182,2.843738526897907e-5,-3.0969895282801916e-8,0.0026665805053176046,2.823043592843639e-5,-3.069370740064932e-8,0.0026666863526158286,2.795380188020402e-5,-3.032352927191644e-8,0.002666888030781808,2.7663438827002143e-5,-2.993366290807507e-8,0.0026671748130789254,2.7408493516036183e-5,-2.958966680282094e-8,0.0026675216046985984,2.722333376093842e-5,-2.933771824724552e-8,0.0026678967932506742,2.7125467417972392e-5,-2.920171724683057e-8,0.002668268174343812,2.7116928055334394e-5,-2.918496557666993e-8,0.0026686067536675503,2.718687142750966e-5,-2.9273488870256556e-8,0.002668889153521843,2.7314125916714938e-5,-2.9439367095546293e-8,0.0026690995240611494,2.7469415229723713e-5,-2.9643692403226327e-8,0.002669231588881734,2.761768401200625e-5,-2.983969287822529e-8,0.0026692909045567758,2.772137604439484e-5,-2.9977123836592665e-8,0.002669296689582548,2.7745483589062654e-5,-3.0009007656812204e-8,0.0026692818814056923,2.76645400450632e-5,-2.9900964988722216e-8,0.002669289786419154,2.7470487600255673e-5,-2.9641735210395685e-8,0.0026693663135547675,2.7178855682651955e-5,-2.9251483856010147e-8,0.002669548600717101,2.6829814064937723e-5,-2.8783321052296953e-8,0.002669853232704221,2.6481571864986507e-5,-2.8314646721668814e-8,0.0026702686612265127,2.6196540227162797e-5,-2.792883344868289e-8,0.0026707555410017745,2.6024208042934442e-5,-2.769243626155642e-8,0.0026712556999075863,2.5986573478360687e-5,-2.7635653186376986e-8,0.002671707089748267,2.6071129511972674e-5,-2.7742712797765785e-8,0.0026720600901569886,2.6233603318288687e-5,-2.795522462078366e-8,0.002672290443135009,2.640954156364561e-5,-2.818742186699068e-8,0.0026724052428170825,2.653145786869803e-5,-2.8349002218997386e-8,0.002672440220313686,2.6546752821712073e-5,-2.8369163632258638e-8,0.0026724489957256573,2.6431102842522592e-5,-2.8214673922745004e-8,0.002672487698917711,2.6193125149463324e-5,-2.789629736013679e-8,0.0026726001820109838,2.586916578069951e-5,-2.746199942230688e-8,0.002672808644915501,2.551090053887501e-5,-2.6980507296689357e-8,0.0026731118372536797,2.5170934360175597e-5,-2.6522128760281473e-8,0.0026734896589889912,2.4891330726868854e-5,-2.6143393330707435e-8,0.0026739109227287,2.4697549447807037e-5,-2.5878832880513e-8,0.0026743410670043246,2.4597486622909633e-5,-2.5739543146492245e-8,0.002674747998989801,2.458373190904632e-5,-2.5716071958711425e-8,0.0026751057440529678,2.463704675194214e-5,-2.57830039780471e-8,0.0026753964831346907,2.47297865751725e-5,-2.5903529531835557e-8,0.00267561183646005,2.4828867315808e-5,-2.6033429491443315e-8,0.0026757540793394046,2.489859900654912e-5,-2.6124877326598502e-8,0.00267583747024861,2.4904174485618595e-5,-2.6131104709850983e-8,0.0026758891320712635,2.4816671777239062e-5,-2.6013096260213478e-8,0.0026759481268225807,2.4619877273035702e-5,-2.5748745104085175e-8,0.002676060878740094,2.4317891637757816e-5,-2.534308690420903e-8,0.002676271641860672,2.3940547910458253e-5,-2.4835628594163594e-8,0.0026766089922976954,2.3542240639262514e-5,-2.429887410844018e-8,0.002677072911743146,2.3190810939116947e-5,-2.3823549830955104e-8,0.002677629384711697,2.2947801471423495e-5,-2.349226195279842e-8,0.0026782174373540597,2.284747447523584e-5,-2.3351420427147178e-8,0.002678767190753552,2.2884450527373708e-5,-2.3394574904936935e-8,0.002679221246387928,2.3015772470718473e-5,-2.3564955982734086e-8,0.0026795504594499405,2.31755695605357e-5,-2.3774871289120044e-8,0.002679759170591716,2.3295137206169125e-5,-2.393243272963582e-8,0.0026798803135628544,2.3320917185443094e-5,-2.3965602905995443e-8,0.0026799640145154023,2.322577558520088e-5,-2.3837397612610006e-8,0.0026800639314745046,2.3012215146842673e-5,-2.3550384713622862E-08,0.0026802248899573116,2.2708392050599457e-5,-2.3141585163499967e-8,0.0026804742934984,2.235906805897442e-5,-2.2670554977751216e-8,0.0026808185968568944,2.2014267511493717e-5,-2.220428842578894e-8,0.0026812448336239396,2.171854636264718e-5,-2.180280461715125e-8,0.0026817259374465234,2.150323880680172e-5,-2.1508611094251824e-8,0.00268222781652349,2.1382809836528223e-5,-2.1341628366433782e-8,0.0026827161726339327,2.1355034347562173e-5,-2.1299284836488415e-8,0.0026831617535715744,2.140378470911418e-5,-2.1360196730420277e-8,0.0026835436457758872,2.1502965966267144e-5,-2.1489465414133864e-8,0.0026838509543692596,2.16204854567272e-5,-2.1644050147128995e-8,0.002684083542702058,2.1721810919128004e-5,-2.1777567204648777e-8,0.0026842524063363047,2.1773296218550722e-5,-2.184473901283113e-8,0.0026843798793523676,2.174584592951199e-5,-2.1806283785570994e-8,0.002684499254751002,2.1619604754520625e-5,-2.1635208600026604e-8,0.002684652615539522,2.1389936125771377e-5,-2.132488556836351e-8,0.0026848851553524585,2.1073684595338914e-5,-2.0897551736655894e-8,0.002685234761333537,2.071276203290809e-5,-2.040922349572789e-8,0.0026857179492677428,2.0370460882582813e-5,-1.9944823185549678e-8,0.002686317392056504,2.0116807827503108e-5,-1.9598553255649772e-8,0.002686979523907763,2.0004912349695077e-5,-1.9442129284992614e-8,0.0026876280837219843,2.0048512671163523e-5,-1.949455243073783e-8,0.0026881899249303247,2.0214024293583018e-5,-1.9711294931862544e-8,0.002688620249435145,2.043285656095454e-5,-2.000069039920413e-8,0.002688914623014258,2.0626936406510176e-5,-2.0258093448061607e-8,0.002689104448499188,2.073370425998305e-5,-2.0399378529749706e-8,0.0026892419298627126,2.0720641518941455e-5,-2.038044359813892e-8,0.00268938312888527,2.0587598019377475e-5,-2.0200427284762034e-8,0.002689574768650333,2.0360579482662567e-5,-1.989355990805515e-8,0.0026898465947728313,2.0081670543145843e-5,-1.9515867700560127e-8,0.0026902088053080623,1.9798500950558975e-5,-1.913120086648592e-8,0.002690653320029833,1.9555086732382298e-5,-1.8798959747669437e-8,0.0026911577108349486,1.9384918317815483e-5,-1.856468027518342e-8,0.0026916907283687213,1.9306783846534458e-5,-1.8454204375709315e-8,0.0026922183440946422,1.932346249716126e-5,-1.8471725008849565e-8,0.0026927093194704355,1.9422959535281348e-5,-1.8601349303398246e-8,0.002693139577075912,1.9581620030571056e-5,-1.8811304655394267e-8,0.0026934949979082095,1.9768275469618075e-5,-1.905959980051295e-8,0.0026937727037630865,1.9948579211282313e-5,-1.9299928293298172e-8,0.002693981227014739,2.008903816565814e-5,-1.9487102008012012e-8,0.0026941399761876384,2.0160743594175506e-5,-1.958202828436642e-8,0.002694278150304583,2.014308771745926e-5,-1.9556669135148625e-8,0.002694432839134833,2.0027814972522264e-5,-1.939951202924289e-8,0.0026946454407021474,1.9823465164879817e-5,-1.912164795226923e-8,0.002694955118743798,1.9559228013221924e-5,-1.876210188452582e-8,0.0026953885604227568,1.9285588555638527e-5,-1.8388822887488567e-8,0.002695947389646158,1.906784792733087e-5,-1.8090003030037158e-8,0.002696598361371597,1.8969529356223275e-5,-1.7951673808881418e-8,0.0026972747172651123,1.9028183067974308e-5,-1.8024976958726027e-8,0.002697894448259002,1.923482567582152e-5,-1.82982964892157e-8,0.0026983903263144058,1.953167385178543e-5,-1.8694084270395405e-8,0.0026987355972708806,1.9833273175935162e-5,-1.9097304148343785e-8,0.002698950451980689,2.005962260427181e-5,-1.9400090848296767e-8,0.0026990880859063043,2.016241265792062e-5,-1.9537100067242948e-8,0.0026992117922432905,2.013345355569334e-5,-1.949684506615443e-8,0.002699375647089422,1.999759245364751e-5,-1.9312213181089278e-8,0.002699614261285006,1.9798830819145078e-5,-1.9041939056218857e-8,0.0026999406340535597,1.9586801508834097e-5,-1.8752604336031518e-8,0.0027003488738597202,1.9406767550178475e-5,-1.850529554434705e-8,0.002700818970481651,1.9293437948365567e-5,-1.8347238284879605e-8,0.0027013220497049467,1.9267719508964687e-5,-1.8307237617048195e-8,0.002701825549465035,1.9335593552310834e-5,-1.839393020569358e-8,0.0027022980757690288,1.9488723621636194e-5,-1.8596431789749385e-8,0.002702713662607276,1.970654001153539e-5,-1.8887103092774177e-8,0.002703055157533248,1.9959543955443707e-5,-1.9226073522447195e-8,0.002703316448267429,2.0213520540267606e-5,-1.9567030088327615e-8,0.0027035033133196956,2.0434152409261692e-5,-1.986350378693203e-8,0.0027036329373279133,2.059147843487134e-5,-2.0074871352699753e-8,0.002703732317100221,2.0663912104588616e-5,-2.017172044859481e-8,0.002703835708462897,2.064176391337209e-5,-2.0140576017720335e-8,0.002703981045779454,2.0530222225002636e-5,-1.9987983238696774e-8,0.002704204955540068,2.0351562676141675e-5,-1.9743638549377247e-8,0.0027045358067139627,2.014570325430151e-5,-1.9461313750205066e-8,0.002704984805772576,1.996714707688034e-5,-1.92148397591981e-8,0.0027055368649279493,1.987574577050617e-5,-1.9085611169575944e-8,0.002706145685078051,1.9919963553539275e-5,-1.913981275734757e-8,0.0027067395839023285,2.0115935619329194e-5,-1.9399872245807953e-8,0.002707241964949466,2.0432627984345386e-5,-1.9824189275903496e-8,0.002707600561978769,2.079591363745013e-5,-2.031258854203578e-8,0.0027078094546453073,2.1114943868623784e-5,-2.0742078873478338e-8,0.0027079095029694275,2.1317626509160715e-5,-2.101494646065448e-8,0.002707967740739984,2.1374638784031844e-5,-2.1091231796414332e-8,0.0027080501916891273,2.1301291919555723e-5,-2.0991196408044287e-8,0.002708202805321296,2.1142645928582355e-5,-2.0775234408464792e-8,0.0027084452776870867,2.0954316120813476E-05,-2.0518098346501502e-8,0.002708774162575712,2.078764131629634e-5,-2.028905117718749e-8,0.002709169810830763,2.0681479161499233e-5,-2.014086685744763e-8,0.0027096034430987557,2.065925821172407e-5,-2.0105765910602988e-8,0.0027100428652535534,2.0729021182110605e-5,-2.0195268624788187e-8,0.0027104568599029245,2.088478077558925e-5,-2.0401806622108805e-8,0.0027108187654351296,2.1108546115977512e-5,-2.0701327617105837e-8,0.002711109496587725,2.1372986326076458e-5,-2.10568899223502e-8,0.002711319970232938,2.1644827851250796e-5,-2.142334211249965e-8,0.002711452708090201,2.1889050652350722e-5,-2.1753098561200446e-8,0.002711522206080725,2.207368852602839e-5,-2.2002679141313222e-8,0.002711553726110139,2.2174663760722812e-5,-2.2139227350930035e-8,0.0027115804817427185,2.2179989492678676E-05,-2.214615199321869e-8,0.0027116394229722046,2.2092790600064617e-5,-2.2027220749220564e-8,0.002711765902353902,2.1932661136871404e-5,-2.1808497541801675e-8,0.0027119875265561675,2.17349102139576e-5,-2.153749682666738e-8,0.0027123175594141167,2.154714321577371e-5,-2.1278725972971384e-8,0.002712748677090166,2.1422310197924048e-5,-2.1104340382649643e-8,0.0027132489457220156,2.1407462817094904e-5,-2.107881988743877e-8,0.002713763222707799,2.1528939153101463e-5,-2.12386510801654e-8,0.002714223539826301,2.17779711508261e-5,-2.1572526893751845e-8,0.0027145692235508168,2.210462782438041e-5,-2.201294395593925e-8,0.0027147705289971287,2.242831272043591e-5,-2.245045363896241e-8,0.002714842961370987,2.26651374401677e-5,-2.2770961975807826e-8,0.0027148417371246187,2.2759728481484883e-5,-2.2899019449501894e-8,0.0027148384646546696,2.270361220246182e-5,-2.2822761360270927e-8,0.002714894133814566,2.253147752919397e-5,-2.2588785865962968e-8,0.002715042481976411,2.230178058034443e-5,-2.227589996373742e-8,0.0027152877602880654,2.2075146022270574e-5,-2.196600255000497e-8,0.0027156119658795414,2.189977200438472e-5,-2.1724460810982776e-8,0.0027159847379479274,2.180547085498409e-5,-2.1592064109398672e-8,0.0027163717326484887,2.18037059038195e-5,-2.158495102003217e-8,0.0027167402462662167,2.189035707386248e-5,-2.169814943921391e-8,0.0027170626329077376,2.204902136902486e-5,-2.1909862774099005e-8,0.002717318577686348,2.225407880034124e-5,-2.2185536220454567e-8,0.002717496917322223,2.247368848952755e-5,-2.2481941172479003e-8,0.0027175971570509785,2.2673148098990517e-5,-2.2751819980273843e-8,0.002717630437619656,2.2818986025088118e-5,-2.2949521472554347e-8,0.002717619374232879,2.2883830547347417e-5,-2.3037639752791775e-8,0.0027175960863589687,2.2851508344780233e-5,-2.29939131948583e-8,0.002717598071460584,2.27213176952526e-5,-2.281699857396905e-8,0.0027176621709201596,2.2510260056520727e-5,-2.2529529271382513e-8,0.0027178174751903974,2.22521853070832e-5,-2.2177067543554316e-8,0.0027180784671276526,2.1993333213934358e-5,-2.1822217623532972e-8,0.0027184398641318065,2.178448760758116e-5,-2.153411268172913e-8,0.0027188745594770346,2.1670561409178468e-5,-2.137429317301222e-8,0.0027193360025531545,2.1679009178246315e-5,-2.1380826619141587e-8,0.002719766138446254,2.1809462677510583e-5,-2.1553961002315126e-8,0.00272010902935972,2.2028302823201387e-5,-2.184847600516649e-8,0.0027203278821346134,2.2272524858974438e-5,-2.2178797892063562e-8,0.0027204196799707763,2.24654419229855e-5,-2.2440404566424472e-8,0.002720419476537429,2.2541182151501676e-5,-2.2543308403420168e-8,0.002720389514355453,2.246792006086709e-5,-2.2443785172222848e-8,0.0027203968580779593,2.2257868624423312e-5,-2.2157995797522724e-8,0.0027204907531003454,2.1959156500183422e-5,-2.17509487518943e-8,0.0027206903780250197,2.1635680043467534e-5,-2.1309184877300774e-8,0.0027209858546815508,2.1346417556349277e-5,-2.0912787442917073e-8,0.002721347808163526,2.1132433058736414e-5,-2.06177932502233e-8,0.002721738732659261,2.101302770424033e-5,-2.045091160605777e-8,0.002722121842089695,2.0988064107378192e-5,-2.0412526919188236e-8,0.0027224663072612032,2.104272221321373e-5,-2.0482980964473065e-8,0.0027227497312666536,2.1152219247249398e-5,-2.0628864697851955e-8,0.0027229592187699085,2.1285646420264224e-5,-2.0808205423364215e-8,0.002723092024279769,2.140915534170127e-5,-2.0974851448080727e-8,0.002723156140984944,2.14891410191427e-5,-2.108288393508341e-8,0.002723170606461795,2.149605797679514e-5,-2.1091870780846034e-8,0.0027231647986974373,2.140913982897247e-5,-2.0973305086363463e-8,0.002723175747615389,2.122154123906254e-5,-2.0717585989345948e-8,0.0027232427667478894,2.094452464224403e-5,-2.0339705819586754e-8,0.0027233996145755853,2.0608713479640643e-5,-1.9880992713257535e-8,0.002723665721382843,2.026060892275378e-5,-1.9404470170278227e-8,0.0027240391567136266,1.9953854594028393e-5,-1.898310231028625e-8,0.002724494146855511,1.9736789731948312e-5,-1.8682948875842208e-8,0.002724984781134481,1.9639562245665583e-5,-1.8545605329381536e-8,0.002725454640230336,1.9664591180140306e-5,-1.8575060281540082e-8,0.0027258502841296267,1.978346436416098e-5,-1.8733227690675876e-8,0.0027261353236396123,1.9941877016394326e-5,-1.894645849238284e-8,0.002726301248658682,2.007230249813052e-5,-1.912271463933041e-8,0.0027263713289722514,2.011187104949174e-5,-1.9175991154117115e-8,0.002726395138448426,2.002057957804487e-5,-1.905127428909273e-8,0.002726434196991114,1.9793401183908815e-5,-1.8741182852925098e-8,0.0027265433420372793,1.946100805656228e-5,-1.828705235095383e-8,0.0027267551469351914,1.9078518607560066e-5,-1.7763682989189432e-8,0.002727073366580046,1.870747687105405e-5,-1.7254861286109985e-8,0.0027274765293817524,1.8398952985918913e-5,-1.683037011094019e-8,0.002727927993060576,1.818353027833995e-5,-1.6532295654523488e-8,0.0027283871266923043,1.8069347217504134e-5,-1.637222675764901e-8,0.0027288178204516824,1.804577514014172e-5,-1.633611041703065e-8,0.0027291931918580247,1.8089300870504294e-5,-1.6392157254153952e-8,0.0027294972768002954,1.816913014448269e-5,-1.649844892067187e-8,0.0027297251046408027,1.8251552466542002e-5,-1.660892918346911e-8,0.0027298822811575333,1.830324285422369e-5,-1.6677976929709144e-8,0.0027299846109979653,1.8294199006395545e-5,-1.6664471571957215e-8,0.0027300576392803658,1.8201084382144078e-5,-1.6536379482566312e-8,0.002730135367558795,1.801142871411346e-5,-1.6276481194654895e-8,0.0027302569950561194,1.772835840690819e-5,-1.5888815400112085e-8,0.002730460675000141,1.7374367034465673e-5,-1.540383280991605e-8,0.002730774317388617,1.6991538671805468e-5,-1.487874681986958e-8,0.002731205492992096,1.663554986253649e-5,-1.4389430286252634e-8,0.0027317346225685167,1.6362736100393333e-5,-1.401285392592605e-8,0.0027323159732417688,1.6213321694122396e-5,-1.3804237823242727e-8,0.0027328882043883593,1.6197272773221976e-5,-1.377768292956184e-8,0.002733391477933123,1.628923403372551e-5,-1.3899104903846669e-8,0.0027337846859482747,1.6435087027299024e-5,-1.4095004537599963e-8,0.002734056500043612,1.656745755001094e-5,-1.4273511480543449e-8,0.0027342271115420556,1.6624323330041047e-5,-1.4349761230979106e-8,0.002734341218625606,1.6564849873113524e-5,-1.4267579057934553e-8,0.0027344551943848145,1.6378505391622318e-5,-1.4012046808109738e-8,0.002734622289801755,1.608581588143182e-5,-1.3610682506044439e-8,0.0027348797656559553,1.5731229116967588e-5,-1.312384293400565e-8,0.0027352411979116873,1.5370487927067927e-5,-1.262758861964929e-8,0.0027356956705479342,1.5056407177672457e-5,-1.2194285616455754e-8,0.002736213318040265,1.4827270079832405e-5,-1.1876677483532097e-8,0.0027367546090290257,1.4700733657187753e-5,-1.169940036745348e-8,0.002737279962922846,1.4673731384326293e-5,-1.16586767454608e-8,0.0027377570640155654,1.4726736350655366e-5,-1.1728029197099415e-8,0.0027381648557289963,1.482989457646782e-5,-1.1866648191392354e-8,0.0027384946423735903,1.4948942426058718e-5,-1.2027544616739114e-8,0.002738749434445084,1.504985821963847e-5,-1.216399804528127e-8,0.0027389426406392242,1.5102225647928979e-5,-1.2234218749741384e-8,0.0027390967313658887,1.508190848938774e-5,-1.2205022203274869e-8,0.0027392418828776502,1.497377683520103e-5,-1.2055543818857391e-8,0.0027394140032673863,1.4774979914795335e-5,-1.1781703210623261e-8,0.0027396510558396095,1.449859754939216e-5,-1.1401214646296961e-8,0.0027399865631337478,1.4176337452192784e-5,-1.0957324233453986e-8,0.0027404401157403325,1.3857589419184968e-5,-1.0517579850249122e-8,0.002741006988407936,1.3601649709835046e-5,-1.016324470539438e-8,0.002741651946643131,1.3461932237357087e-5,-9.967701894510386e-9,0.0027423134297618586,1.3466164991872435e-5,-9.969292325791265e-9,0.0027429204127412043,1.3602045380436758e-5,-1.0151559338201335e-8,0.0027434161980657615,1.381781057785335e-5,-1.0443902181835858e-8,0.0027437775903663983,1.403930043979941e-5,-1.0744867582233018e-8,0.00274402026056172,1.4195086586668818e-5,-1.0956551973741348e-8,0.002744189707180539,1.4237647948831023e-5,-1.101361813162918e-8,0.0027443444308235623,1.4153214739371446e-5,-1.0896808965594635e-8,0.0027445391212823013,1.3960083614703103e-5,-1.063071839494125e-8,0.0027448126229584063,1.369940353501182e-5,-1.0271311517205686e-8,0.0027451820491002014,1.342296064314159e-5,-9.889353385649206e-9,0.0027456424369939375,1.3181296837245952e-5,-9.554228595057486e-9,0.0027461706266553357,1.301415215625418e-5,-9.320814951324564e-9,0.0027467319065318033,1.2944348784452829e-5,-9.220945708603037e-9,0.0027472878430236675,1.297566686114043e-5,-9.26028974478475e-9,0.0027478036209455806,1.3094521161716708e-5,-9.420488426281658e-9,0.0027482535395967965,1.3274409109423844e-5,-9.665206228210173e-9,0.002748624017387072,1.3481665911821765e-5,-9.94808846615289e-9,0.002748914201993835,1.3681151040180056e-5,-1.0220678594459335e-8,0.002749134840466332,1.3840922486020028e-5,-1.0438925666362003e-8,0.0027493062755827883,1.3935617636275572e-5,-1.0567851392877573e-8,0.0027494561978375956,1.3948871850020234e-5,-1.0584841736813426e-8,0.002749617298368145,1.3875330877006017e-5,-1.0482372438320108e-8,0.002749824478571436,1.3722661790345272e-5,-1.0270772986168708e-8,0.002750110830763187,1.3513482353169196e-5,-9.98093410823438e-9,0.00275050148863685,1.3286167853943228e-5,-9.665504146217214e-9,0.0027510052007713166,1.3092282740735443e-5,-9.395433012835077e-9,0.0027516054627253683,1.2987797311630384e-5,-9.247916863310523e-9,0.0027522560077975567,1.3016795714357577e-5,-9.283940992366734e-9,0.002752887270832192,1.3191513005764179e-5,-9.520705716744854e-9,0.0027534268750110877,1.3479307947422266e-5,-9.913575792228905e-9,0.002753827252818105,1.380820104122874e-5,-1.0363635022831688e-8,0.002754085066367869,1.4092408000508905e-5,-1.0752843979321471e-8,0.002754240423604777,1.4264671631161601e-5,-1.0988570669126968e-8,0.0027543577158397454,1.4297504261183262e-5,-1.1032801675695634e-8,0.0027545010082918016,1.4205075789953122e-5,-1.0904699986993847e-8,0.0027547161998007054,1.4030591799180186e-5,-1.0663283329901377e-8,0.0027550240194078655,1.3829185117178249e-5,-1.0384043206256625e-8,0.002755421453020713,1.3653474454465471e-5,-1.0139258403077382e-8,0.0027558875196220835,1.3544259564344984e-5,-9.985280220478687e-9,0.0027563903321073395,1.3525955479519786e-5,-9.956181654857124e-9,0.0027568938904163395,1.3605460183974092e-5,-1.0062009063794016e-8,0.002757364073561223,1.3773418082126131e-5,-1.029030898978133e-8,0.0027577735523741467,1.4007312606634619e-5,-1.0610254942756665e-8,0.002758105281049702,1.4275878871466236e-5,-1.0978721485269755e-8,0.0027583543129910426,1.4544196144378514e-5,-1.1347397176404875e-8,0.002758527884760369,1.4778781498711986e-5,-1.1669921998794136e-8,0.0027586439565762334,1.495202207329257e-5,-1.1908062139585563e-8,0.0027587286752269713,1.5045486741457556e-5,-1.2036263263573345e-8,0.002758813283168323,1.5052079543374385e-5,-1.2044567346228864e-8,0.0027589307562035483,1.497726783006875e-5,-1.1940277717807085e-8,0.0027591121400170103,1.4839587044545021e-5,-1.1748696271030066e-8,0.002759382258301141,1.4670374331164395e-5,-1.1512860934478634e-8,0.0027597543590631487,1.4512060743916354e-5,-1.1291303651724086e-8,0.002760223851724849,1.4413504572653444e-5,-1.1151667518328181e-8,0.002760762772812467,1.4420577561528979e-5,-1.1157671499436408e-8,0.002761318710750578,1.4561512390203414e-5,-1.1348746558323507e-8,0.00276182335825203,1.483046758444795e-5,-1.171717072812087e-8,0.002762213232767044,1.5178600777388183e-5,-1.2195628938203373e-8,0.0027624561618459875,1.5523579998102924e-5,-1.2670370954457433e-8,0.002762568055471419,1.577896645887847e-5,-1.3021911778698365e-8,0.002762607053442844,1.588892345218556e-5,-1.3173036202525945e-8,0.0027626477535367317,1.5847494556313896e-5,-1.3115353264673006e-8,0.002762752148698717,1.5693341116187472e-5,-1.290193227055894e-8,0.002762952717258098,1.5488291251018845e-5,-1.2617722370350503e-8,0.0027632510418019677,1.5294686690858635e-5,-1.2348462136331391e-8,0.0027636259344087917,1.5160707656321381e-5,-1.2160612203495138e-8,0.002764043924793039,1.511465428428553e-5,-1.2093523880228672e-8,0.002764468105360931,1.5165219435121325e-5,-1.2159711904489318e-8,0.0027648642771565795,1.5304554776486206e-5,-1.2348881160795975e-8,0.00276520491193756,1.551214917612753e-5,-1.2633083740317827e-8,0.0027654717421526196,1.5758859205074683e-5,-1.2972187445271782e-8,0.0027656573615933593,1.601108180866163e-5,-1.331966747011974e-8,0.0027657658412326984,1.623508143758839e-5,-1.3628693916074076e-8,0.0027658122315612965,1.6401336192405455e-5,-1.385824500072823e-8,0.0027658208032614435,1.64885423505343e-5,-1.397868551819702e-8,0.0027658220656359834,1.6486733828388484e-5,-1.397605157394892e-8,0.002765848891824904,1.639909794692674e-5,-1.3854513826157042e-8,0.0027659321674139512,1.6242317878778517e-5,-1.3636849548780435e-8,0.002766096303503263,1.6045369593808686e-5,-1.3362857387789591e-8,0.0027663548615603564,1.5846730676314847e-5,-1.308562701077851e-8,0.0027667064826740096,1.5689835021215877e-5,-1.2865361853446855e-8,0.002767131628491153,1.5616253392744474e-5,-1.2759959238257351e-8,0.002767591541465577,1.565613932350352e-5,-1.2811680422273687e-8,0.0027680318643640033,1.581672526418174e-5,-1.3031031172521404e-8,0.0027683935757452003,1.607229328191158e-5,-1.3382687188492964e-8,0.0027686315906423767,1.6362317419807093e-5,-1.3782849249591848e-8,0.0027687352106116232,1.660487394222258e-5,-1.4117902190796029e-8,0.002768738239820442,1.6725105080637398e-5,-1.4283993588661351e-8,0.0027687087079556953,1.6685822510540136e-5,-1.422947633870195e-8,0.0027687213527381837,1.650176304721841e-5,-1.3974559220475729e-8,0.0027688289978741332,1.622925799770131e-5,-1.3596908755438644e-8,0.002769048363398059,1.594031700512789e-5,-1.3195832869032236e-8,0.00276936337344147,1.569769408859385e-5,-1.2857958409166736e-8,0.002769738192543268,1.5541237964123733e-5,-1.2638499739393606e-8,0.002770130857577132,1.5485700596560033e-5,-1.2558236264973412e-8,0.0027705028435936804,1.5525121557837643e-5,-1.2609441752677153e-8,0.002770824104016123,1.5639139817898094e-5,-1.2764417778794309e-8,0.0027710750382562957,1.579871667179225e-5,-1.298325399628226e-8,0.002771246995946245,1.5970684935818387e-5,-1.322007185623983e-8,0.0027713422068845884,1.6121524757386047e-5,-1.3428307331702114e-8,0.0027713733059165882,1.622087961293736e-5,-1.3565689517813172e-8,0.0027713622519797507,1.6245092710609566e-5,-1.3599228831309594e-8,0.002771338258376431,1.6180665568763176e-5,-1.3510033682923686e-8,0.0027713344138243505,1.6027070557930125e-5,-1.3297175460530656e-8,0.0027713830768532144,1.579813080854103e-5,-1.2979564370243544e-8,0.0027715105782646693,1.5521323628688927e-5,-1.2595002061998987e-8,0.002771732045267941,1.5234636665673235e-5,-1.2195915802458485e-8,0.002772047301432447,1.4981007805899022e-5,-1.1841777298032802e-8,0.002772438752589332,1.4800880562158318e-5,-1.1588867502371844e-8,0.0027728720133379584,1.4723695349422957e-5,-1.1478455258934069e-8,0.0027733000270757664,1.475936384689405e-5,-1.1524829287417343e-8,0.0027736714038943994,1.4891518683271445e-5,-1.1705728640433002e-8,0.002773942949580787,1.5075513691583893e-5,-1.1959405556781578e-8,0.002774094298536084,1.5244784160866828e-5,-1.2193420369479077e-8,0.00277413935771806,1.5327642621168224e-5,-1.2308056164262575e-8,0.002774127095241945,1.5271382737278492e-5,-1.222991079233378e-8,0.002774127125267959,1.5063483024427677e-5,-1.1941373736095969e-8,0.002774204509579759,1.4737530909312808e-5,-1.1488800019336111e-8,0.0027743965548067697,1.43593324733346e-5,-1.0963210259393599e-8,0.0027747034985702353,1.4001351538615448e-5,-1.0464911437262635e-8,0.0027750951364715324,1.3719672259939094e-5,-1.007167416389651e-8,0.002775526051367617,1.3542754928601997e-5,-9.823200461899074e-9,0.0027759503581378433,1.3472044653032601e-5,-9.721903248961207e-9,0.0027763311030684443,1.3489110782461308e-5,-9.742655844025204e-9,0.0027766441055164853,1.356402503429683e-5,-9.84425800476849e-9,0.002776878237542247,1.3662175145885656e-5,-9.978801364369811e-9,0.00277703421910064,1.3749001999510627e-5,-1.0098250340897997e-8,0.002777123145672282,1.3793304300500613e-5,-1.0159108468992627e-8,0.002777165069365021,1.3769948799978488e-5,-1.012627712891473e-8,0.002777187380425079,1.366257139239754e-5,-9.976865115490197e-9,0.002777222427192686,1.3466379006569386e-5,-9.704079704233e-9,0.002777303795784524,1.3190508945819256e-5,-9.32046418862628e-9,0.0027774610887294536,1.285887005615791e-5,-8.859037531642524e-9,0.00277771379236086,1.250829794191475e-5,-8.370757335750319e-9,0.0027780656045215007,1.2183280121571277e-5,-7.917278908180143e-9,0.00277850108054271,1.1927476784055753e-5,-7.559280656595044e-9,0.002778986285044394,1.1773582658743977e-5,-7.3424319327927995e-9,0.0027794741941447932,1.1734065609188585e-5,-7.284473669250357e-9,0.0027799142794985264,1.1795451333347614e-5,-7.367127372081157e-9,0.00278026452821218,1.1918270864807826e-5,-7.535846169209884e-9,0.0027805032458643373,1.204384768123753e-5,-7.709138116829781e-9,0.0027806373209791524,1.2107676158375936e-5,-7.797171506191644e-9,0.002780703452468078,1.2057033090757864e-5,-7.726358310931846e-9,0.002780759925646668,1.186787561236933e-5,-7.46295792291357e-9,0.002780869728653987,1.155427127221588e-5,-7.026249491461181e-9,0.002781080498337681,1.1164946271353642e-5,-6.483757041896363e-9,0.002781409786732128,1.0767143875816982e-5,-5.928845847483083e-9,0.0027818421004138097,1.04248448157659e-5,-5.450501229246064e-9,0.0027823377629871307,1.0181105245430409e-5,-5.10879819574084e-9,0.002782847735319512,1.0050699713777196e-5,-4.924616944992279e-9,0.002783327243787241,1.0022856728953502e-5,-4.883325460734916e-9,0.0027837440651562097,1.0069594711575953e-5,-4.94624874966697e-9,0.0027840812269027786,1.015483206039899e-5,-5.063271670053514e-9,0.0027843360787357524,1.024152532104462e-5,-5.1827770304128115e-9,0.002784517883012557,1.0296305457586499e-5,-5.258162067166841e-9,0.0027846452783812006,1.0292292461840592e-5,-5.251838399917288e-9,0.002784744078074569,1.0211053940810853e-5,-5.138017383006263e-9,0.0027848451722726508,1.004447040455388e-5,-4.905319130341186e-9,0.002784981869337182,9.796760182050914e-6,-4.559563393831464e-9,0.0027851859388087303,9.486172936094592e-6,-4.1260871182282976e-9,0.0027854820195520776,9.145128566965864e-6,-3.649923337373014e-9,0.0027858809685050146,8.817212839408479e-6,-3.1916519447886542e-9,0.002786374004344479,8.549858663854469e-6,-2.8172810988601715e-9,0.002786930516713693,8.38311526590999e-6,-2.5826759770245543e-9,0.0027875021251903167,8.337323332657525e-6,-2.5164033042951878e-9,0.002788033442730153,8.404341144331321e-6,-2.6074358965324996e-9,0.0027884768663511967,8.546587963184419e-6,-2.8036922561923524e-9,0.002788806444515096,8.705359435428541e-6,-3.023511191011914e-9,0.002789025898946628,8.816155454370437e-6,-3.1769693624562517e-9,0.00278916808580964,8.826174280013064e-6,-3.1902919454504053e-9,0.0027892861494492062,8.708654066453408e-6,-3.0259083522581603e-9,0.002789439024007953,8.46996585135858e-6,-2.6924102085292982e-9,0.0027896754169786063,8.14743898998842e-6,-2.2415918566646356e-9,0.002790020989298804,7.798481749683577e-6,-1.7533598997337004e-9,0.0027904727105389194,7.484380983397801e-6,-1.3132102122914294e-9,0.0027910019465777094,7.254182931369871e-6,-9.89761674395551e-10,0.0027915644996498075,7.133899378245067e-6,-8.196308089392246e-10,0.002792113334641582,7.123723332179867e-6,-8.034153427098901e-10,0.0027926094573086616,7.202432983697204e-6,-9.117101623954198e-10,0.002793028233302452,7.335726174669705e-6,-1.0966748720526548e-9,0.0027933609484635524,7.4849003149403414e-6,-1.3041707157630382e-9,0.002793613109513304,7.61360949860106e-6,-1.4832721372423023e-9,0.002793801331699417,7.692125726622039e-6,-1.5923023708007069e-9,0.0027939501157332436,7.699650544928369e-6,-1.602113739190793e-9,0.0027940890449749374,7.62559574208575e-6,-1.4978805430814948e-9,0.0027942502546082484,7.47061613566804e-6,-1.2805101597583769e-9,0.002794465545354246,7.247708832349798e-6,-9.681400023267961e-10,0.0027947623730721393,6.982972729165114e-6,-5.97180208495864e-10,0.002795158293619206,6.714815163187818e-6,-2.2122179168722028e-10,0.0027956544044971682,6.489842552957791e-6,9.465788350054435e-11,0.0027962298905296608,6.353985618709735e-6,2.862426270105938e-10,0.0027968413003591638,6.339329590931643e-6,3.085594249353236e-10,0.002797430023565606,6.450574770211097e-6,1.5483829055035215e-10,0.0027979381407812233,6.657939065789282e-6,-1.33481326751483e-10,0.0027983274370340884,6.9023050870562255e-6,-4.73865860969561e-10,0.0027985929487883057,7.112534229482264e-6,-7.668664513252449e-10,0.0027987644712778367,7.227889781129287e-6,-9.274873085756629e-10,0.002798895846497114,7.215922522318092e-6,-9.102130577481535e-10,0.0027990476214502418,7.07954168609196e-6,-7.189055791823305e-10,0.002799270159329704,6.8528184660678055e-6,-4.0097058487487015e-10,0.0027995921098042825,6.589150394962895e-6,-3.089155205840986e-11,0.0028000160559371254,6.346543838175632e-6,3.10246237176008e-10,0.0028005208861621384,6.174077528739478e-6,5.536306075559972e-10,0.002801069138807742,6.102332622183427e-6,6.561508599671992e-10,0.002801616887775129,6.139228531226112e-6,6.063570042587458e-10,0.0028021235424224794,6.271340195284573e-6,4.227738196672006e-10,0.0028025593261495505,6.469448209654452e-6,1.462323628969768e-10,0.002802909202716053,6.696171451931554e-6,-1.7081556781815749e-10,0.0028031732715659992,6.913472533175175e-6,-4.748902722777455e-10,0.002803364595060627,7.088522312131387e-6,-7.198047146353163e-10,0.002803505761944061,7.197381055746142e-6,-8.718919784335805e-10,0.002803625279954858,7.226791581760613e-6,-9.125259098952547e-10,0.0028037543398572442,7.1748236665111314e-6,-8.389867042693141e-10,0.0028039239008144736,7.051055423278122e-6,-6.646711695244907e-10,0.0028041616337651505,6.8765748079719594e-6,-4.190817695600791e-10,0.0028044880974484863,6.6835013555270844e-6,-1.471822583423747e-10,0.0028049117634366405,6.5130028002482435e-6,9.333211200818222e-11,0.002805423407949294,6.410183518830969e-6,2.391581525590211e-10,0.0028059919682429956,6.414458134729057e-6,2.348761811647254e-10,0.0028065656354558507,6.545964496883274e-6,5.204916047160679e-11,0.0028070820322286597,6.792467980851788e-6,-2.923256812302114e-10,0.0028074875111325586,7.1049452709561795e-6,-7.295484999982558e-10,0.002807758398439204,7.408801568743201e-6,-1.1549479735996095e-9,0.002807912309953183,7.629016879277494e-6,-1.4632184010996237e-9,0.0028080018600268285,7.717209899264664e-6,-1.5864308892715257e-9,0.00280809416469148,7.666574793887121e-6,-1.5149558263742769e-9,0.0028082476851966315,7.509156810078956e-6,-1.293585924107478e-9,0.0028084967768828226,7.300588647517751e-6,-1.0001414868267381e-9,0.002808847262739549,7.101610708252468e-6,-7.196587372359342e-10,0.0028092805508106752,6.9632211202788204e-6,-5.236849754708002e-10,0.0028097620700029556,6.9179843415002716e-6,-4.5813084509820613e-10,0.0028102506436204987,6.977109497128568e-6,-5.3909443895529e-10,0.002810706875116468,7.1318269763759485e-6,-7.546337294862254e-10,0.002811099653827845,7.357649721019065e-6,-1.0705937383009498e-9,0.0028114103186717213,7.620360090645017e-6,-1.4389400470211245e-9,0.0028116342841793644,7.882562522965005e-6,-1.8069960493090511e-9,0.002811780336556491,8.109700436176797e-6,-2.1259981185286337e-9,0.0028118681577567702,8.274759500587497e-6,-2.3578054290919355e-9,0.002811924804212133,8.361260065829955e-6,-2.479149299892737e-9,0.002811980892546883,8.36454527445245e-6,-2.4834224476780367e-9,0.0028120670235339054,8.291786877210306e-6,-2.380638941437992e-9,0.002812210545938763,8.161235186498023e-6,-2.196355734372293e-9,0.0028124324269317093,8.000947582996757e-6,-1.9699141477060387e-9,0.0028127438794841287,7.846806856187975e-6,-1.7517213264542863e-9,0.002813142552806622,7.739137129470781e-6,-1.5985536553676695e-9,0.002813608808015108,7.716755992795095e-6,-1.5652027889490953e-9,0.002814103934259319,7.807540942446503e-6,-1.6911479779159391e-9,0.0028145735374341036,8.016337002635303e-6,-1.9834359406417603e-9,0.0028149593679730016,8.31455967856922e-6,-2.4019489267911616e-9,0.0028152192752681693,8.639495206008205e-6,-2.858393347499628e-9,0.002815347491924279,8.910155826623826e-6,-3.238690313459153e-9,0.0028153820992645705,9.056877288906372e-6,-3.444739279219633e-9,0.0028153917225959865,9.049565373279847e-6,-3.434183721829044e-9,0.0028154478006963196,8.907688181128402e-6,-3.234368005566589e-9,0.0028155987912163055,8.687766600877536e-6,-2.924641731063571e-9,0.002815858796138938,8.458997654451106e-6,-2.6021037702235526e-9,0.0028162112125574854,8.281283974367032e-6,-2.3508457347741356e-9,0.002816620244870729,8.193045999255578e-6,-2.2249439851131193e-9,0.002817043196425516,8.208464494140208e-6,-2.2446042949535775e-9,0.0028174399451113383,8.320583317078408e-6,-2.4004250119473305e-9,0.0028177788955663485,8.506869283546043e-6,-2.661052702041974e-9,0.0028180401266746525,8.735196722855205e-6,-2.9814634943747566e-9,0.002818216618208338,8.969546300902432e-6,-3.3109360361838935e-9,0.0028183139820533165,9.175233421802618e-6,-3.600466281728827e-9,0.0028183488727125663,9.323413400084446e-6,-3.809217986798757e-9,0.0028183463049050498,9.39458305470024e-6,-3.90954465122841e-9,0.0028183361606477814,9.380837778898787e-6,-3.890194719106599e-9,0.002818349263122649,9.286671155840795e-6,-3.757406772881838e-9,0.002818413492033781,9.128333531433483e-6,-3.53396419516556e-9,0.0028185502773691137,8.932029054209705e-6,-3.2566550844126667e-9,0.0028187715560268277,8.731181934898563e-6,-2.972477812164968e-9,0.0028190771735186674,8.562773878565448e-6,-2.7335615331514525e-9,0.002819452811212173,8.462515809163019e-6,-2.5904087552382515e-9,0.0028198689659859892,8.458399189389392e-6,-2.5827732791303527e-9,0.0028202823760493027,8.562461789260582e-6,-2.7279409911836136e-9,0.0028206420530898016,8.76203294867925e-6,-3.0082465413739715e-9,0.0028209016970371353,9.01428419331315e-6,-3.3633026041725225e-9,0.0028210372630595158,9.250300643214355e-6,-3.695772409602383e-9,0.0028210625026776777,9.393515552182452e-6,-3.897503770163006e-9,0.0028210309762700552,9.388841811821506e-6,-3.890735771174717e-9,0.0028210180397079793,9.227581680220804e-6,-3.6632088806019304e-9,0.002821090430482207,8.951597895319539e-6,-3.273910330543877e-9,0.002821281364602508,8.633748034245999e-6,-2.8253997402826636e-9,0.0028215841712364,8.34816387734706e-6,-2.4219756103304343e-9,0.0028219629940235817,8.147536600047868e-6,-2.1378075495426764e-9,0.0028223698510740254,8.054819543764938e-6,-2.0053439921519466e-9,0.002822758897752516,8.06627654451556e-6,-2.0195926662397562e-9,0.0028230947143213737,8.159510301354147e-6,-2.149322407764077e-9,0.0028233554406812823,8.301852148391436e-6,-2.348744115947894e-9,0.00282353282593384,8.45708600749022e-6,-2.5668892800147934e-9,0.002823630975521782,8.590367413029983e-6,-2.754534233626674e-9,0.002823664602469181,8.671985233133684e-6,-2.869577271902303e-9,0.0028236568220320374,8.680413957217215e-6,-2.881448031847007e-9,0.002823636368151626,8.604700974308771e-6,-2.77454826352887e-9,0.00282363417253053,8.446003171394267e-6,-2.55042869198829e-9,0.0028236793809163405,8.217892940976991e-6,-2.2281801649158934e-9,0.0028237951897224314,7.945063459574405e-6,-1.8425677017566835e-9,0.0028239951055245996,7.660380146708828e-6,-1.4398777251617586e-9,0.0028242801645024245,7.40050743300998e-6,-1.0718072754261351e-9,0.0028246375107151937,7.200455492493439e-6,-7.878393942073073e-10,0.002825040666646605,7.087470503711195e-6,-6.266431600801484e-10,0.002825451877475943,7.074723084324243e-6,-6.071044899922806e-10,0.00282582713879414,7.155466286875476e-6,-7.199525343266866e-10,0.0028261246005233435,7.299190176080726e-6,-9.222045847808211e-10,0.00282631625064073,7.452589468357933e-6,-1.138486076576167e-9,0.002826400528199012,7.5487591099507736e-6,-1.2740885116638722e-9,0.002826410104662908,7.52604944408374e-6,-1.2417419852670848e-9,0.0028264072933222306,7.3519489307029926e-6,-9.95445629992879e-10,0.002826464019776748,7.0400481913062265e-6,-5.543990372405558e-10,0.0028266339859106117,6.6478080126638315e-6,2.5428477574195166e-13,0.002826932486316038,6.254009951919073e-6,5.573195548555597e-10,0.002827334926475173,5.928910433440534e-6,1.017639188279871e-9,0.0028277917797869642,5.7135131054699254E-06,1.3232757200131534e-9,0.002828248468891538,5.614983691413445e-6,1.4639603114758254e-9,0.0028286601533812237,5.614073569452187e-6,1.4666632447107474e-9,0.0028289983913868215,5.676607424183315e-6,1.379463686399024e-9,0.002829251626940915,5.763552361016194e-6,1.257411163440545e-9,0.0028294226533315623,5.8378051497912814e-6,1.1529709034080448e-9,0.002829525391442807,5.868127420486881e-6,1.1104318965864509e-9,0.002829581983388046,5.831461400637911e-6,1.162556397104102e-9,0.0028296201636700017,5.714584370675174e-6,1.3281613329217984e-9,0.0028296704970861516,5.515438234757098e-6,1.610201352537694e-9,0.0028297631021037386,5.243980536622576e-6,1.9945855887171813e-9,0.0028299236827314406,4.922012339098648e-6,2.4504737826893106e-9,0.0028301691569658544,4.581263003820374e-6,2.933023335426697e-9,0.0028305037217332307,4.259296600010102e-6,3.3891673170969797e-9,0.002830916459461489,3.993408191619676e-6,3.766190530193445e-9,0.0028313814792820546,3.8133369601973606e-6,4.021977064794002e-9,0.0028318611572783646,3.7341893056990802e-6,4.135010647324168e-9,0.0028323123871055148,3.7511839643312496e-6,4.1118687449955575e-9,0.002832695135207755,3.837639289960757e-6,3.990171251095755e-9,0.0028329821184355144,3.947374265896908e-6,3.835263147375323e-9,0.0028331678013638183,4.02244680576321e-6,3.7292680413861366e-9,0.002833273994081028,4.0063226672806816e-6,3.752376733977591e-9,0.0028333486086335536,3.8605677828823e-6,3.959124752584863e-9,0.0028334548656437477,3.5800588386143807e-6,4.356815088093346e-9,0.0028336519146150165,3.199196575199989e-6,4.896744085319297e-9,0.002833973775156948,2.7832242943678695e-6,5.486528461109836e-9,0.002834417043797699,2.4062456980927005e-6,6.021220646396547e-9,0.002834944056387233,2.1262318186002894e-6,6.418661302859258e-9,0.0028354988875670265,1.969203084860813e-6,6.641874660667108e-9,0.0028360266300474844,1.927913656213458e-6,6.70098348403756e-9,0.0028364871221820765,1.971420933258333e-6,6.639725869469694e-9,0.0028368601012207684,2.0580493155069e-6,6.517137481949485e-9,0.002837143798391918,2.146084523307919e-6,6.392404569592256e-9,0.0028373505649315713,2.200262702481213e-6,6.315634711039505e-9,0.0028375022225614853,2.194747581939334e-6,6.323580516384682e-9,0.002837626278744532,2.1141632193792574e-6,6.438118184879123e-9,0.002837752983195648,1.9539503821470446e-6,6.665710573780227e-9,0.002837912672316925,1.720635357079953e-6,6.997035491702147e-9,0.0028381327625960472,1.4319563558805509e-6,7.406851308263388e-9,0.0028384339774149996,1.1162175023410766e-6,7.85496469067567e-9,0.0028388259645027686,8.098741102245192e-7,8.289678744088075e-9,0.0028393032769971362,5.525056854996284e-7,8.654901931555912e-9,0.002839843390194472,3.791424868007549e-7,8.900980702450035e-9,0.0028404085467517684,3.1124743347196077e-7,8.997452128487504e-9,0.002840952357445899,3.4901622113740223e-7,8.943973785765355e-9,0.002841430295633725,4.68119085106208e-7,8.775000509935415e-9,0.0028418113735728568,6.229385663401742e-7,8.555251582211405e-9,0.0028420874546643236,7.562180083845292e-7,8.366042862071104e-9,0.002842277186103206,8.12928826496597e-7,8.28557717186452e-9,0.0028424229792514757,7.548341939316745e-7,8.368220742089385e-9,0.0028425812098529235,5.718152359385369e-7,8.628388634888865e-9,0.002842807562695609,2.864119988032696e-7,9.034090564959052e-9,0.0028431411958904427,-5.075784686922267e-8,9.513435790152513e-9,0.002843592795816794,-3.745954342178899e-7,9.973922781259542e-9,0.00284414136383234,-6.243541079214667e-7,1.0329162879331443e-8,0.0028447415293055118,-7.608178796241404e-7,1.0523290713005752e-8,0.0028453383289325533,-7.7516339165713e-7,1.0543619193061516e-8,0.0028458829874018483,-6.870431643594794e-7,1.0418002465363624e-8,0.002846343745861855,-5.347045473568402e-7,1.0200845400060194e-8,0.002846709393672464,-3.626758819940621e-7,9.955588339874181e-9,0.0028469868913886353,-2.1168976993434465e-7,9.740321417669294e-9,0.0028471961486281772,-1.1277953739782726e-7,9.5993194186896e-9,0.002847364587199702,-8.507667609072321e-8,9.559858106078426e-9,0.0028475227795878447,-1.357926730672906e-7,9.63217247842041e-9,0.0028477012760148397,-2.6098770439544055e-7,9.810568108142715e-9,0.0028479280799226956,-4.4634904759132186e-7,1.0074568307647262e-8,0.002848226026012085,-6.678989044547163e-7,1.038996413878128e-8,0.002848609485491815,-8.932110104100397e-7,1.0710570698878495e-8,0.0028490803883028048,-1.08421348997412e-6,1.0982211998329638e-8,0.0028496244808374053,-1.2027066912850638e-6,1.1150545368581883e-8,0.0028502098087099434,-1.2189535497820264e-6,1.117325646547346e-8,0.0028507899812964224,-1.1218694346857707e-6,1.1034558640475975e-8,0.0028513137786630493,-9.269848437980516e-7,1.0756559639854864e-8,0.0028517396184371633,-6.772541783626091e-7,1.040045521595228e-8,0.002852049745857075,-4.3383629160081065e-7,1.0053410747715433e-8,0.002852257667938162,-2.588555502582333e-7,9.80397507841194e-9,0.0028524050176591494,-1.966808876808624e-7,9.715373390453078e-9,0.002852549088431962,-2.610733914805113e-7,9.807193562515353e-9,0.002852746181827145,-4.3236107396414083e-7,1.0051389365553414e-8,0.002853036583500799,-6.643300296990387e-7,1.0382115635541902e-8,0.0028534351813685878,-8.975086395893872e-7,1.0714629219647167e-8,0.002853929365115319,-1.0745790729053187e-6,1.096719853065988e-8,0.0028544839144717562,-1.1539281212368752e-6,1.1080391616891132e-8,0.002855051068247713,-1.1181731669905117e-6,1.1029268499031812e-8,0.002855582768565016,-9.75875355579879e-7,1.0825912624788529e-8,0.0028560415652221956,-7.566392276976092e-7,1.051252610395587e-8,0.0028564073406055135,-5.018534207721013e-7,1.0148247915315251e-8,0.002856678785926064,-2.5444286344771827e-7,9.794490668368394e-9,0.002856870524742683,-5.058886026101649e-8,9.503046426891806e-9,0.002857007914873242,8.512852095070961e-8,9.30908662963937e-9,0.0028571215454132087,1.412895044493818e-7,9.22891211852966e-9,0.002857242681589101,1.1896856287060092e-7,9.260923881079643e-9,0.0028573999738171854,3.009713316077348e-8,9.38800232202608e-9,0.0028576170512156747,-1.0428600410014353e-7,9.580041432918065e-9,0.002857910332403342,-2.5568229132032263e-7,9.796312889070212e-9,0.002858286478980994,-3.900984786692505e-7,9.988259642955946e-9,0.002858739364701392,-4.712582429285285e-7,1.0104059717794627e-8,0.00285924729195101,-4.661759280679692e-7,1.0096572400747676e-8,0.002859772355326098,-3.5361998523694726e-7,9.935435750221926e-9,0.0028602647405304277,-1.3415193562808552e-7,9.621442048735044e-9,0.0028606740590430527,1.6248167838119398e-7,9.197139078236257e-9,0.0028609662384943444,4.78853899398024e-7,8.74468806781909e-9,0.002861139063409164,7.44255750862787e-7,8.365236229068475e-9,0.002861226934688806,8.984655386532225e-7,8.144871394043985e-9,0.002861290126468282,9.137233591571715e-7,8.123196247026203e-9,0.0028613933351704225,8.035260371148903e-7,8.280824203979028e-9,0.002861584483698411,6.150660520729815e-7,8.55027050948895e-9,0.0028618827041504077,4.113854839993796e-7,8.841474477305177e-9,0.0028622775767180642,2.524378755512151e-7,9.068802254899132e-9,0.0028627363987564036,1.8135003911035153e-7,9.17060221962431e-9,0.0028632149243848224,2.1781405590917407e-7,9.118624569170666e-9,0.002863668101326738,3.577669060595684e-7,8.918529212376947e-9,0.0028640588395250108,5.775725882547501e-7,8.603998240368662e-9,0.002864363874395403,8.409557603452859e-7,8.226895323903023e-9,0.002864576317683268,1.1070964706719793e-6,7.845700967819764e-9,0.0028647049562361203,1.3383042800297684e-6,7.514484405755572e-9,0.0028647709664122996,1.505912805444349e-6,7.274393180785887e-9,0.0028648031644739605,1.5936658590036488e-6,7.148753085068565e-9,0.0028648329825001757,1.5985844872876452e-6,7.141820831205116e-9,0.0028648901078107145,1.5298597346848266e-6,7.240401923975936e-9,0.0028649992237887115,1.40662889791498e-6,7.417073022953166e-9,0.002865177723667968,1.255395999935133e-6,7.63388684017037e-9,0.002865433962330402,1.1074017364182093e-6,7.84611558047985e-9,0.0028657656359532793,9.9575507730559e-7,8.006322067477023e-9,0.002866158158739561,9.517297115380463e-7,8.069644697438206e-9,0.0028665835690910722,9.99411061201828e-7,8.001485323787432e-9,0.0028670015032235038,1.1483302317519537e-6,7.788115041184415e-9,0.002867364559705957,1.3852827350377053e-6,7.448455109494122e-9,0.0028676299233594852,1.6691386030128764e-6,7.041536345565719e-9,0.0028677759678411305,1.9347439744128324e-6,6.660862146080923e-9,0.0028678167309223023,2.1103546939003207e-6,6.409323306547407e-9,0.0028678034788689843,2.144698261273195e-6,6.3603400593137696e-9,0.0028678078376921227,2.029720577821034e-6,6.525302617003996e-9,0.0028678938191672595,1.8044434865642015e-6,6.8481776203151215e-9,0.002868094666236441,1.5376263800915127e-6,7.230454856236507e-9,0.002868405913933894,1.3009574329347206e-6,7.569539411050057e-9,0.0028687938676968555,1.1474463535309566e-6,7.789602788927635e-9,0.002869210861589051,1.1019524188615657e-6,7.855057338570128e-9,0.002869609334325944,1.1622461307956396e-6,7.769013139741857e-9,0.002869951231852881,1.3057241037395412e-6,7.563711223382599e-9,0.002870212677215331,1.4976923875705954e-6,7.288744102079043e-9,0.002870385194690064,1.699062535904297e-6,7.000097817318875e-9,0.002870474725317542,1.8727935944983242e-6,6.75093165594071e-9,0.002870499135165648,1.988954290042755e-6,6.584275013804583e-9,0.00287048464138741,2.0282382639665136e-6,6.527917653518532e-9,0.0028704616140799583,1.9837809533528225e-6,6.5917562221991524E-09,0.0028704602549171655,1.8612665906276216e-6,6.767640226165102e-9,0.002870506668811975,1.6774673462495774e-6,7.031500508441279e-9,0.0028706197689758587,1.457604560662817e-6,7.34716419913411e-9,0.0028708091655566463,1.2320673332684813e-6,7.671058717135242e-9,0.0028710739127016565,1.0328358362055718e-6,7.957305852913069e-9,0.0028714019528153388,8.896734068155328e-7,8.163146833604354e-9,0.0028717702214416355,8.259448522978371e-7,8.254940922690583e-9,0.0028721457505871515,8.537612288983449e-7,8.215181934479207e-9,0.0028724887943640687,9.684630238408015e-7,8.050494120702066e-9,0.0028727594429303256,1.1436800035455436e-6,7.798780069504199e-9,0.0028729285817180555,1.3300651297795598e-6,7.531028042365649e-9,0.0028729915695690435,1.462263368762386e-6,7.341218977444032e-9,0.002872978448805743,1.4772429274966988e-6,7.3198920236120235e-9,0.002872951252863827,1.339998687991839e-6,7.517195289934864e-9,0.0028729836176172785,1.0630678713911078e-6,7.914951705548082e-9,0.0028731308183241877,7.051695488262558e-7,8.42876029911416e-9,0.0028734078884947605,3.473260311513201e-7,8.942348496380804e-9,0.0028737882087745852,6.114666054513867e-8,9.353047158655345e-9,0.002874219668384876,-1.1272126322969022e-7,9.602619303010073e-9,0.0028746456433421104,-1.6888577001482716e-7,9.683354937474298e-9,0.002875020314855133,-1.291094150016922e-7,9.626438926383505e-9,0.00287531548780091,-3.018828501717634e-8,9.484597230108128e-9,0.0028755210579180877,8.668647485398011e-8,9.31689120875924e-9,0.0028756422882183752,1.8328829012502568e-7,9.178200849892443e-9,0.002875696134402279,2.288312141503027e-7,9.112800066087184e-9,0.002875707547399061,2.025805089596482e-7,9.150562494597015e-9,0.002875705846174958,9.52630333672185e-8,9.304873938120105e-9,0.0028757210926035038,-9.052120703341189e-8,9.57200496741452e-9,0.0028757804866157105,-3.4091383411167794e-7,9.932003851136088e-9,0.002875904942563708,-6.325855214179894e-7,1.035130470799866e-8,0.0028761062305016523,-9.357358663929467e-7,1.0787070613173603e-8,0.002876385114451254,-1.2180331505464313e-6,1.1192851470911072e-8,0.002876730724811969,-1.4490859095561661e-6,1.1524975361779462e-8,0.002877121258656621,-1.6050876840491572e-6,1.174919121731711e-8,0.002877526072604426,-1.6732673197605107e-6,1.1847070930135468e-8,0.0028779092664162932,-1.6557908710847165e-6,1.1821668584018685e-8,0.0028782350578963945,-1.5726563757144414e-6,1.1701746720225946e-8,0.002878475324870978,-1.4624372605699738e-6,1.1542873713258664e-8,0.0028786189483200725,-1.3787231489666856e-6,1.1422265207849368e-8,0.002878680701003052,-1.3798468481290254e-6,1.1423915368175761e-8,0.002878704787159146,-1.5113471987390404e-6,1.1613291349036044e-8,0.002878756903957089,-1.785757177929549e-6,1.2008265758302951e-8,0.002878902862502164,-2.1705939820080316e-6,1.2561939708202041e-8,0.0028791817969540797,-2.5954920375929927e-6,1.3173007501556022e-8,0.002879589402551466,-2.9784185508799e-6,1.3723483959784089e-8,0.0028800817252932734,-3.2567032182663314e-6,1.4123284543802338e-8,0.0028805956227206074,-3.4055518723271702e-6,1.4336808076009957e-8,0.00288107208392016,-3.4376003397330977e-6,1.4382284035630344e-8,0.0028814710783001875,-3.3898579305011365e-6,1.43129954824349e-8,0.0028817755563885373,-3.3082580675083343e-6,1.4195060433588716e-8,0.002881988308033612,-3.2361154678533363e-6,1.4090836012607044e-8,0.0028821262129773463,-3.207791533507497e-6,1.4049812193983022e-8,0.0028822147082530657,-3.246215519180097e-6,1.4105033781258338e-8,0.0028822834027905776,-3.36241780936278e-6,1.4272395487930903e-8,0.002882362616150177,-3.5558741422002764e-6,1.4551103140709693e-8,0.0028824803465096684,-3.815258525621979e-6,1.4924750790070064e-8,0.002882659335415783,-4.119686711663455e-6,1.5363142882474208e-8,0.0028829141547347752,-4.440809412356523e-6,1.5825359058537653e-8,0.0028832486380844327,-4.746136382797398e-6,1.626457640078978e-8,0.0028836543274357697,-5.003595714935634e-6,1.6634632356475022e-8,0.0028841105948802857,-5.186858658952929e-6,1.6897660746955784e-8,0.0028845868380229104,-5.280659678729527e-6,1.703172244416492e-8,0.0028850468268388713,-5.285119178421869e-6,1.703703042675255e-8,0.0028854548808014517,-5.2180136555174015e-6,1.693924927655556e-8,0.00288578318588404,-5.1141539701945615e-6,1.678862920440044e-8,0.0028860192930803964,-5.021207939658294e-6,1.6653980349342108e-8,0.0028861723562649236,-4.991365507388845e-6,1.6610608238690897e-8,0.0028862757956466495,-5.06888921218822e-6,1.6722303008240677e-8,0.0028863833910300974,-5.2754810860775145e-6,1.7020219754766915e-8,0.002886556622110814,-5.598336802918629e-6,1.7485702072118628e-8,0.0028868448006271175,-5.988001271290007e-6,1.804727106737048e-8,0.0028872654738177545,-6.371171534302883e-6,1.8599132347397268e-8,0.002887795844354059,-6.675623117016277e-6,1.903710691825924e-8,0.0028883812762736244,-6.855447025490349e-6,1.9295003604406827e-8,0.0028889563468819752,-6.903610854021034e-6,1.9362747686658358e-8,0.0028894665800328696,-6.847559620219423e-6,1.9280059028761153e-8,0.0028898810668172878,-6.734011844686922e-6,1.911450684067196e-8,0.0028901940052642504,-6.612662324206851e-6,1.893795127279494e-8,0.0028904191547270935,-6.524988204859821e-6,1.881034874825922e-8,0.002890582222841485,-6.4992181867616665e-6,1.8772471855239283e-8,0.0028907142743236822,-6.549601240706169e-6,1.8844849350322546e-8,0.0028908470537224477,-6.677663335062472e-6,1.9029580088897277e-8,0.0028910098168515577,-6.87394958687946e-6,1.9312855656179486e-8,0.0028912269035187145,-7.1197167658875545e-6,1.966742957177217e-8,0.0028915154465618195,-7.388703555439692e-6,2.0055217248474415e-8,0.002891882983346302,-7.649501334948221e-6,2.0430764834169687e-8,0.002892325261621495,-7.869140909601243e-6,2.0746451553512368e-8,0.002892825069667161,-8.018140622490618e-6,2.095977025193972e-8,0.0028933531569161294,-8.0765493987099e-6,2.1042023401707183e-8,0.0028938720607829473,-8.039749741569616e-6,2.0986676926427616e-8,0.002894342905333149,-7.92219781746215e-6,2.081475472290096e-8,0.0028947341280570267,-7.757261613370963e-6,2.0574609101836252e-8,0.0028950300744023127,-7.592178937176516e-6,2.033462657209387e-8,0.0028952370056188714,-7.47855706718128e-6,2.0169463592427875e-8,0.0028953844081573035,-7.460137255342665e-6,2.0142316838205095e-8,0.00289552034348127,-7.560525475110968e-6,2.0287169809216575e-8,0.0028957008077851775,-7.774273461944861e-6,2.0595931401456922e-8,0.0028959747760086865,-8.06484752748952e-6,2.1015565228355683e-8,0.0028963687909720668,-8.37202856618837e-6,2.1458840848969644e-8,0.002896876822197008,-8.628384556733143e-6,2.1828161536226112e-8,0.002897460687328443,-8.779917072525279e-6,2.2045408873836965e-8,0.0028980621551318326,-8.802502597728348e-6,2.207573173944743e-8,0.002898621746734977,-8.706920074860234e-6,2.1934852495291796e-8,0.0028990957821008693,-8.531279911183452e-6,2.1678125082780306e-8,0.002899465167343782,-8.326114196731398e-6,2.137891611386844e-8,0.0028997348041497496,-8.13959047569529e-6,2.110712912790612e-8,0.002899926963249216,-8.007836040779991e-6,2.091513975889782e-8,0.002900073067994656,-7.951291908204955e-6,2.0832502054918495e-8,0.002900206831484279,-7.975306429587075e-6,2.0866828269500727e-8,0.002900359629928538,-8.072622529241776e-6,2.1007425546019428e-8,0.0029005576921144888,-8.226159990315293e-6,2.1229360644075667e-8,0.0029008202589749987,-8.411462892954981e-6,2.1497037476612273e-8,0.0029011579526491515,-8.59892006014462e-6,2.176744153154923e-8,0.0029015709907129882,-8.756361710375036e-6,2.1993920303424827e-8,0.002902047505571332,-8.85279154909494e-6,2.2131593765595492e-8,0.0029025628872768883,-8.863671727157463e-6,2.2145000075912374e-8,0.0029030815052825793,-8.777345014016352e-6,2.2017385091665053e-8,0.0029035620496829224,-8.600986341434939e-6,2.175931513310784e-8,0.002903966637114285,-8.363362576374002e-6,2.141266869690318e-8,0.0029042717781266334,-8.111634884846253e-6,2.1045980547935134e-8,0.002904477372654277,-7.901280532790563e-6,2.073978444425112e-8,0.002904609628244343,-7.781372369153714e-6,2.0565217145761693e-8,0.002904715791276944,-7.780057503835996e-6,2.056294239996993e-8,0.0029048518634546975,-7.895457374774159e-6,2.0729997122619613e-8,0.0029050672122561154,-8.095212921731798e-6,2.1019213111936452e-8,0.0029053908949938285,-8.324795261790677e-6,2.1351336711916632e-8,0.002905823673533291,-8.52201545814966e-6,2.1636089845854755e-8,0.0029063379482547036,-8.63355664871243e-6,2.1796127132877224e-8,0.00290688567731947,-8.628754999473182e-6,2.178700899956975e-8,0.002907411886688896,-8.506448804640417e-6,2.1607149038605026e-8,0.002907869313118284,-8.29292031099503e-6,2.1294847433827952e-8,0.002908229337953015,-8.032291094367549e-6,2.0914343210019756e-8,0.002908486197412823,-7.773494661513888e-6,2.0536855496935417e-8,0.0029086544808403334,-7.5585686559262325e-6,2.0223523711567358e-8,0.0029087623904295403,-7.415402414785589e-6,2.001484051067057e-8,0.002908843981353781,-7.35553482324306e-6,1.9927459583560743e-8,0.002908932726752054,-7.375649943051864e-6,1.9956406208574644e-8,0.0029090572536835126,-7.460809532075294e-6,2.0079817615799907e-8,0.002909238952715364,-7.5879228762615555e-6,2.0264014865399943e-8,0.0029094906884145105,-7.728775534689363e-6,2.0467914700593435e-8,0.0029098158523242937,-7.852662044244406e-6,2.064685157630933e-8,0.002910207338650096,-7.929175550194102e-6,2.0756624253538985e-8,0.0029106466203267355,-7.931911576665453e-6,2.0758877958416994e-8,0.002911103814377557,-7.843588459108618e-6,2.062855490190973e-8,0.0029115402023730556,-7.66224497593975e-6,2.0362916420013977e-8,0.002911914696322001,-7.406730952055019e-6,1.998953139422466e-8,0.0029121945161994208,-7.118129171687856e-6,1.9568325801371748e-8,0.0029123675377467186,-6.853478439441242e-6,1.918239985768633e-8,0.002912450734123804,-6.670885447814342e-6,1.8916298524169225e-8,0.002912488859188778,-6.610394269086291e-6,1.88281387438807e-8,0.0029125417695362995,-6.679120462312963e-6,1.8928018749465943e-8,0.0029126652147423104,-6.848070988212437e-6,1.9173497757355166e-8,0.0029128935517388484,-7.061935206702308e-6,1.9483944368025575e-8,0.002913231037578079,-7.256695642236208e-6,1.9766193972595816e-8,0.0029136533209005457,-7.377571585707302e-6,1.9940619511564884e-8,0.0029141165252539614,-7.391701575272796e-6,1.9959524190801965e-8,0.0029145697689046887,-7.293322714917477e-6,1.981463990082668e-8,0.0029149673788549375,-7.1018310443380406e-6,1.953430007430907e-8,0.002915278149714961,-6.8545563898393026e-6,1.9172935518929185e-8,0.002915490151865234,-6.596725101954491e-6,1.8796465187354656e-8,0.0029156107375936115,-6.371248850546456e-6,1.846741356078346e-8,0.002915662539790091,-6.210673245514143e-6,1.8233164243708407e-8,0.0029156771594396804,-6.1327104522359935e-6,1.8119444504375368e-8,0.002915688499493966,-6.139498762978267e-6,1.812926086634637e-8,0.0029157272510905927,-6.219687203803143e-6,1.824596696099231e-8,0.0029158172217261446,-6.3520114728173305e-6,1.843850247261238e-8,0.002915973412501954,-6.5091582694995025e-6,1.8667034188020637e-8,0.0029162012640837876,-6.6612268782975755e-6,1.888798608393158e-8,0.0029164964235661433,-6.778735787311186e-6,1.9058396783844645e-8,0.002916844658644618,-6.835584702079287e-6,1.91402221340199e-8,0.0029172220097263466,-6.812552966048134e-6,1.910544630322981e-8,0.002917595884444303,-6.7017614420562816e-6,1.8942618913472558e-8,0.002917928412307093,-6.511815863831633e-6,1.8664385893287575e-8,0.00291818347875855,-6.2719153866716e-6,1.8313480562819844e-8,0.002918337682433519,-6.031490122748525e-6,1.7962147335797165e-8,0.002918392453911434,-5.8514246809711895e-6,1.7699255420367632e-8,0.0029183808220965175,-5.785913109725185e-6,1.760375851831056e-8,0.002918361694896576,-5.860827931022856e-6,1.7713146738291097e-8,0.0029184005478205227,-6.060277614749884e-6,1.8003943123245615e-8,0.0029185450818061424,-6.330635628385983e-6,1.8397723097046376e-8,0.002918808813042895,-6.6005652769916755e-6,1.8790403319492904e-8,0.002919169951357401,-6.805733183674234e-6,1.908827114831872e-8,0.0029195829508730235,-6.906435273516535e-6,1.92336174657321e-8,0.002919994648581057,-6.893430674434389e-6,1.9213166424777753e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json
new file mode 100644
index 0000000..7805bb3
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":2000,"numberOfSamples":1000,"samples":[-0.0019226433452019043,-4.2400202047522655e-5,-4.847209139509104e-8,-0.0019224915279308452,-4.232138293995991e-5,-4.839917575682174e-8,-0.0019223575599970867,-4.2339533342532786e-5,-4.841941987929699e-8,-0.0019221925201880694,-4.2455757141232014e-5,-4.853500256368106e-8,-0.0019219535221161883,-4.264378690983704e-5,-4.87214377132331e-8,-0.0019216173050324704,-4.285653639574512e-5,-4.893368444013015e-8,-0.0019211878632388768,-4.304035090341533e-5,-4.911986351109583e-8,-0.0019206944269591652,-4.3151566455827686e-5,-4.923733483565604e-8,-0.001920180782153211,-4.316840557061996e-5,-4.9264336921476375e-8,-0.0019196912154135558,-4.3093903838697776e-5,-4.920299044056076e-8,-0.001919259170950511,-4.2950548434361e-5,-4.9074301884897993e-8,-0.0019189019210674083,-4.277089886837732e-5,-4.8909249976046343e-8,-0.0019186208521778832,-4.258868047478004e-5,-4.8740241599705884e-8,-0.001918404926768647,-4.243272605567538e-5,-4.859521792579728e-8,-0.0019182349450095773,-4.2323928794774185e-5,-4.849461482060666e-8,-0.0019180872700253946,-4.2274266862589164E-05,-4.8450338629402915e-8,-0.001917936666180632,-4.228680533004299e-5,-4.846574052979398e-8,-0.00191775854316843,-4.2355896173164964e-5,-4.8535824807684226e-8,-0.0019175311877270766,-4.246735024004276e-5,-4.864742159638906e-8,-0.0019172384671460499,-4.25989290061144e-5,-4.877961167038227e-8,-0.0019168730864799963,-4.2721876682799584e-5,-4.890508625070886e-8,-0.0019164398837302117,-4.280432151427329e-5,-4.8993279677066866e-8,-0.0019159579014177714,-4.281706315274191e-5,-4.901583883335078e-8,-0.0019154594243000278,-4.27412144250086e-5,-4.8953968414289994e-8,-0.001914984557283099,-4.2575562469439085e-5,-4.880561552483321e-8,-0.0019145716125768752,-4.234039279521026e-5,-4.858934382627422e-8,-0.0019142459086730812,-4.207501807745824e-5,-4.834220694952108e-8,-0.0019140111182697102,-4.1828569489815494e-5,-4.811113500434928e-8,-0.0019138468399848853,-4.1646650455964184e-5,-4.794024685992306e-8,-0.0019137136475314569,-4.155842585264431e-5,-4.785840090516636e-8,-0.0019135639168575628,-4.156847538008292e-5,-4.787112479174571e-8,-0.001913354878178476,-4.165575436672902e-5,-4.795925785880041e-8,-0.001913060039736298,-4.1779660100407035e-5,-4.808445425303678e-8,-0.0019126758326174886,-4.189128905126362e-5,-4.8199834042895305e-8,-0.0019122216639617473,-4.194655693717889e-5,-4.8262624541360104e-8,-0.0019117335388331718,-4.191721880810053e-5,-4.8244930247959284e-8,-0.0019112535774869718,-4.17965282482666e-5,-4.8139407883790543e-8,-0.0019108191058004997,-4.159831661316574e-5,-4.795859671838348e-8,-0.001910454761111615,-4.13507805095086e-5,-4.7729094163578805e-8,-0.0019101693588310655,-4.108797784158734e-5,-4.74834365018481e-8,-0.0019099571113809235,-4.084210928294797e-5,-4.725264424568893e-8,-0.0019098014051956349,-4.06383521782112e-5,-4.706116300989979e-8,-0.001909679232807439,-4.049244367589526e-5,-4.6924445600308274e-8,-0.0019095650792493577,-4.041027304587661e-5,-4.684851156054176e-8,-0.0019094338706790138,-4.038850509596943e-5,-4.6830551880131895e-8,-0.0019092631960406178,-4.041545998091156e-5,-4.685979719885473e-8,-0.0019090353342274217,-4.0471961726856714e-5,-4.691831881589462e-8,-0.0019087395911655302,-4.053242839868951e-5,-4.698199191766588e-8,-0.0019083750969175394,-4.0566889485238066e-5,-4.7022295836454817e-8,-0.0019079535950202848,-4.05448090409642e-5,-4.7009857068801336e-8,-0.0019075008929219535,-4.0441352326518995e-5,-4.692041592595363e-8,-0.0019070548602137859,-4.024557340002766e-5,-4.674274417153859e-8,-0.0019066581194424014,-3.996789525520936e-5,-4.648596905336088e-8,-0.0019063458229643833,-3.964246667720178e-5,-4.618202616974119e-8,-0.001906132593687367,-3.932066250072738e-5,-4.5879631296205274e-8,-0.001906005112413036,-3.9056140911694693e-5,-4.563013841888741e-8,-0.0019059250849624966,-3.888725831245831e-5,-4.547077730150599e-8,-0.0019058418160187416,-3.882488208844757e-5,-4.541289156609024e-8,-0.0019057084893034362,-3.885058262649113e-5,-4.5439933455113804e-8,-0.0019054953071705263,-3.892448678948119e-5,-4.551462448108332e-8,-0.0019051956015066044,-3.899818092129441e-5,-4.559102248754266e-8,-0.001904824751066378,-3.902764552633575e-5,-4.562680789434229e-8,-0.0019044139453100216,-3.898286178877979e-5,-4.5592592314242095e-8,-0.0019040014133682513,-3.8852641286461894e-5,-4.547679044559279e-8,-0.0019036234930003598,-3.864464423892581e-5,-4.5285911009026024e-8,-0.0019033074182967,-3.838144973804248e-5,-4.504099501526467e-8,-0.0019030670807785748,-3.809414814477403e-5,-4.477156044224583e-8,-0.0019029021776647626,-3.7815292683842436e-5,-4.4508817510060506e-8,-0.001902800227035411,-3.757290803529455e-5,-4.427982585191298e-8,-0.0019027403062597105,-3.738655521525043e-5,-4.410361508352597e-8,-0.0019026972766109718,-3.726562021454014e-5,-4.3989482282936625e-8,-0.0019026455605967178,-3.720939282853564e-5,-4.393706825168861e-8,-0.001902562049494492,-3.720819681311018e-5,-4.393747898583925e-8,-0.0019024282429587474,-3.7244887169539354e-5,-4.397474157144386e-8,-0.0019022320167928473,-3.7296417780327447e-5,-4.402726172840666e-8,-0.0019019694121183246,-3.733563521997301e-5,-4.406942025345132e-8,-0.0019016466101295054,-3.7333817380047615e-5,-4.4073850286943826e-8,-0.001901281721675244,-3.72647279533573e-5,-4.401521158739995e-8,-0.0019009051492186858,-3.7110772537172744e-5,-4.387608872624823e-8,-0.0019005564761927897,-3.687070357499274e-5,-4.365449081610721e-8,-0.0019002760006965934,-3.656614621766662e-5,-4.3370288285066725e-8,-0.0019000913323042824,-3.624205466668279e-5,-4.306583828633659e-8,-0.0019000039601944792,-3.5956706816941076e-5,-4.279656932567122e-8,-0.0018999840816792122,-3.576226105855051e-5,-4.261250079410351e-8,-0.0018999792883793371,-3.568461104514584e-5,-4.253901137884262e-8,-0.001899933981398471,-3.5713853399087564e-5,-4.2567602344540055e-8,-0.0018998090711157681,-3.581022732657273e-5,-4.266128735242672e-8,-0.0018995924498515157,-3.5920529128532807E-05,-4.27699363285063e-8,-0.0018992979805863262,-3.599552540735251e-5,-4.284667515898346e-8,-0.001898956996465333,-3.60016505232314e-5,-4.2859033641491364e-8,-0.0018986077115788766,-3.5925404995038095e-5,-4.2793327231141533e-8,-0.0018982861274868695,-3.5772115322624845e-5,-4.2653762704726326e-8,-0.0018980197803509253,-3.556151123416992e-5,-4.245848237196928e-8,-0.0018978243192027849,-3.532201505409536e-5,-4.2234258129154944e-8,-0.0018977025183165013,-3.5084842908056075e-5,-4.201085903922587e-8,-0.001897645338891351,-3.487865622253372e-5,-4.181584089370757e-8,-0.001897634548299051,-3.472539749417785e-5,-4.1670438822720854e-8,-0.0018976462592206278,-3.4637684651986404E-05,-4.158699002545304e-8,-0.0018976547528813345,-3.461783260192269e-5,-4.156798431104482e-8,-0.0018976360025567379,-3.465835456450116e-5,-4.160658512785339e-8,-0.0018975704668702292,-3.474353699435762e-5,-4.168818028849286e-8,-0.0018974450856599756,-3.485154582856132e-5,-4.179238643199875e-8,-0.0018972547032642363,-3.4956750270050015e-5,-4.189517808310863e-8,-0.0018970031462578617,-3.5032293373468896e-5,-4.1971187462921197e-8,-0.001896704041121835,-3.5053177068163955e-5,-4.199649895495414e-8,-0.0018963811064912409,-3.500033872352196e-5,-4.195247884233675e-8,-0.0018960669388229457,-3.486606242620335e-5,-4.183101890714069e-8,-0.0018957986732221059,-3.466005594878666e-5,-4.1640536726904226e-8,-0.0018956091571617987,-3.441367338006517e-5,-4.141024300465335e-8,-0.0018955143084655717,-3.417789714991304e-5,-4.11883959487616e-8,-0.0018955015199407235,-3.401103934461799e-5,-4.103064766105313e-8,-0.0018955276091062383,-3.395751831846302e-5,-4.097979506922786e-8,-0.0018955320612609062,-3.4027724788744977e-5,-4.104650552871127e-8,-0.001895460925824634,-3.419213691026499e-5,-4.120354608540807e-8,-0.0018952876637236959,-3.439431347479264e-5,-4.139792350116541e-8,-0.0018950194973305701,-3.4574094187676726e-5,-4.157273141268476e-8,-0.00189468901820827,-3.468727701743215e-5,-4.168573954249668e-8,-0.0018943393648524587,-3.471417304124221e-5,-4.171758103848185e-8,-0.001894011175966523,-3.4658126432902484e-5,-4.1670568510380554e-8,-0.0018937347654549707,-3.4538913747532676e-5,-4.156270803527193e-8,-0.0018935271586108895,-3.438520384909261e-5,-4.1420753571334326e-8,-0.0018933922404869188,-3.4228171385826936e-5,-4.127420869753851e-8,-0.0018933224519850319,-3.409667569558539e-5,-4.115067186901395e-8,-0.001893301244193991,-3.40137190510597e-5,-4.10723266568858e-8,-0.0018933060255165923,-3.399399788202456e-5,-4.105348708812609e-8,-0.0018933114133081418,-3.404253904550354e-5,-4.109924608197351e-8,-0.0018932925837213562,-3.415443233452324e-5,-4.120524021833533e-8,-0.0018932284621856921,-3.431570348176952e-5,-4.135853030487643e-8,-0.001893104383091029,-3.4505267334039883e-5,-4.1539480078514925e-8,-0.00189291393259836,-3.469764551964496e-5,-4.172428673891212e-8,-0.0018926599383916741,-3.486610463956082e-5,-4.188783776156979e-8,-0.0018923546511316431,-3.498605241766292e-5,-4.2006785198344876e-8,-0.001892019101621626,-3.5038631408074926e-5,-4.206286015466167e-8,-0.0018916814855736094,-3.5014534367428806e-5,-4.204652314564249e-8,-0.001891374040852943,-3.491799599962725e-5,-4.196092987201902e-8,-0.0018911275262606326,-3.477018738663742e-5,-4.182542386637248e-8,-0.0018909628356181614,-3.460994197225293e-5,-4.167647877700423e-8,-0.0018908809794151223,-3.448870510773402e-5,-4.1563025636714426e-8,-0.001890855680381783,-3.4457266426274074e-5,-4.1533801407386716e-8,-0.0018908353879217353,-3.454621539121781e-5,-4.1618610494880996e-8,-0.0018907590601062614,-3.474930510512576e-5,-4.1812322746267864e-8,-0.0018905806559135173,-3.502183484605819e-5,-4.2073175486873276e-8,-0.0018902883688857062,-3.529801938551741e-5,-4.233914044230188e-8,-0.0018899068551920142,-3.551742428610809e-5,-4.255290749642152e-8,-0.001889483249018912,-3.564481602849056e-5,-4.268065997382881e-8,-0.0018890679245541686,-3.567523527632135e-5,-4.2716955210695495e-8,-0.00188870032072965,-3.562727788606181e-5,-4.267856906938492e-8,-0.0018884030745074487,-3.5532202829357725e-5,-4.2594437460528625e-8,-0.0018881823723488097,-3.54243921208098e-5,-4.2496795451858114e-8,-0.0018880312102406572,-3.533504994855418e-5,-4.2415230301185514e-8,-0.0018879332139387782,-3.5288747014991394e-5,-4.237330143238159e-8,-0.0018878660597741292,-3.5301680267534746e-5,-4.23867434249854e-8,-0.001887804493950075,-3.5380813257388804e-5,-4.246254511061698e-8,-0.0018877231921547025,-3.552361030820859e-5,-4.259866804167272e-8,-0.0018875996014664324,-3.5718391160070784e-5,-4.278440830777563e-8,-0.0018874167566322304,-3.594551788242534e-5,-4.300154835611885e-8,-0.0018871657927251448,-3.617965687985636e-5,-4.322647911791066e-8,-0.0018868476636197298,-3.639308212496223e-5,-4.3433238917490384e-8,-0.0018864736576865142,-3.655967876258171e-5,-4.359717299143751e-8,-0.0018860644895497603,-3.66591992046944e-5,-4.369885112248462e-8,-0.0018856478855353213,-3.668124668546799e-5,-4.37278181581545e-8,-0.0018852547440176993,-3.6628421846668554e-5,-4.3685686879638724e-8,-0.0018849140165977931,-3.651813115392309e-5,-4.358808695279573e-8,-0.0018846464338938206,-3.638236555382138e-5,-4.346473580791103e-8,-0.0018844576056432885,-3.6264235942699986e-5,-4.3356365793623564e-8,-0.0018843321784880178,-3.6209913884206997e-5,-4.3307130103906174e-8,-0.0018842322632395324,-3.625576306513159e-5,-4.335226126403655e-8,-0.0018841040436168481,-3.641349949400654e-5,-4.350374571050373e-8,-0.0018838940566287233,-3.6660400894427665e-5,-4.374080127460915e-8,-0.001883570085252579,-3.694276386559895e-5,-4.401301964778491e-8,-0.001883135475562002,-3.7194520085842316e-5,-4.425796870583932e-8,-0.001882627578444282,-3.73621475032825e-5,-4.442477583414205e-8,-0.0018821014403124572,-3.742201299485457e-5,-4.4490542846202025e-8,-0.001881609313986513,-3.7382507458315104e-5,-4.4462439215216833e-8,-0.0018811865907120172,-3.7274116019286886e-5,-4.436849914685254e-8,-0.001880847632416261,-3.713591350573811e-5,-4.424508395808057e-8,-0.00188058871037337,-3.7004918805228556e-5,-4.4126962304448526e-8,-0.0018803936614843618,-3.691021781204701e-5,-4.4041748300567786e-8,-0.0018802392951189633,-3.6870851790922326e-5,-4.400778710220607e-8,-0.0018800994849178696,-3.68957089255605e-5,-4.40339130327419e-8,-0.0018799481169941405,-3.698411204251374e-5,-4.411991825255021e-8,-0.0018797614670353787,-3.7126553405316096e-5,-4.425722892864331e-8,-0.0018795204776576248,-3.730559347706619e-5,-4.442976975442706e-8,-0.0018792131464299988,-3.749729428555327e-5,-4.46153152223929e-8,-0.0018788368365865878,-3.7673694011914794e-5,-4.4787772369335294e-8,-0.0018783998781203336,-3.780658890837698e-5,-4.492065092723705e-8,-0.0018779216417479986,-3.787236867220032e-5,-4.4991520603290696e-8,-0.0018774304478634798,-3.785712894848209e-5,-4.4986782858554793e-8,-0.001876959132956837,-3.776087580238688e-5,-4.490568783170876e-8,-0.001876538772816988,-3.759950843431477e-5,-4.476237298058196e-8,-0.0018761917084975216,-3.740363503756282e-5,-4.458499652618009e-8,-0.0018759253154816227,-3.721393836510612e-5,-4.441161416080866e-8,-0.0018757279816746558,-3.7073377257336396e-5,-4.4282962063134714e-8,-0.0018755687920489152,-3.701708377818567e-5,-4.4232881827984826e-8,-0.0018754023218197238,-3.706175871807319e-5,-4.427809041286009e-8,-0.0018751791516401983,-3.71976903316632e-5,-4.4410338519050925e-8,-0.0018748606150037481,-3.738752598197328e-5,-4.4594994984169714e-8,-0.0018744330348925565,-3.7574982787928245E-05,-4.47791613026569e-8,-0.0018739145177022712,-3.770239276914684e-5,-4.490826020461936e-8,-0.0018733495373167643,-3.773009490362128e-5,-4.4944415378813574e-8,-0.0018727931908080317,-3.764831441568e-5,-4.487773977743384e-8,-0.0018722931442570632,-3.7476441825173546e-5,-4.472576455407728e-8,-0.0018718776143170825,-3.72522449686114e-5,-4.452343076403651e-8,-0.0018715526178116695,-3.701813258333055e-5,-4.431030817274317e-8,-0.0018713062231411261,-3.681055615655657e-5,-4.4120686585272034e-8,-0.001871115468151383,-3.665468354723957e-5,-4.397851191896047e-8,-0.001870952694577932,-3.6563328602725056e-5,-4.389625440586987e-8,-0.0018707900517583916,-3.653811265418476e-5,-4.3875885637797216e-8,-0.0018706023334060244,-3.6571255822349916e-5,-4.391050608580251e-8,-0.0018703688700737859,-3.664722159578986e-5,-4.398588937722728e-8,-0.0018700751930006965,-3.6744157938658e-5,-4.408184554328447e-8,-0.0018697148769254426,-3.683557666976917e-5,-4.4173775089313205e-8,-0.0018692914772034106,-3.6892936200826666e-5,-4.423502611041501e-8,-0.0018688199023591616,-3.688965083963331e-5,-4.424057092448585e-8,-0.0018683261082645549,-3.680648604854699e-5,-4.4172010900809014e-8,-0.0018678439684996118,-3.663736658049673e-5,-4.4023038613393244e-8,-0.0018674088734324848,-3.639364723333976e-5,-4.3803546879327065e-8,-0.0018670490319146785,-3.610454803253589e-5,-4.354021989210011e-8,-0.001866776960604691,-3.581233195531623e-5,-4.327223113044107e-8,-0.0018665842545617494,-3.556274227869284e-5,-4.304246095848443e-8,-0.0018664419014308188,-3.539322985208859e-5,-4.2886518844144926e-8,-0.001866306540510951,-3.532250177755452e-5,-4.282282625286369e-8,-0.0018661311596336301,-3.5344543323723834e-5,-4.284673828172474e-8,-0.0018658774885188531,-3.542898898557433e-5,-4.293057236042494e-8,-0.0018655268253949977,-3.55281941668765e-5,-4.303001094315354e-8,-0.0018650860333417425,-3.55896847358241e-5,-4.309572055327366e-8,-0.0018645862558132557,-3.557072469934887e-5,-4.3087114771064386e-8,-0.001864074064290464,-3.54502290003869e-5,-4.298370377047688e-8,-0.0018635978679334747,-3.523359331224885e-5,-4.278980205390345e-8,-0.0018631947076426666,-3.494883476042089e-5,-4.2531058883068645e-8,-0.0018628822307316867,-3.4636347734627516E-05,-4.224496475448857e-8,-0.0018626577466252,-3.433705755884229e-5,-4.196979779298566e-8,-0.0018625028468491243,-3.408334448344101e-5,-4.173608792809358e-8,-0.0018623903292806535,-3.389462368841906e-5,-4.1562378749819724e-8,-0.001862290600784725,-3.377697613200107e-5,-4.145477037782527e-8,-0.0018621762300559555,-3.3725088096835355e-5,-4.14086669723388e-8,-0.0018620246347852986,-3.372488473601601e-5,-4.141123207304418e-8,-0.0018618195632346566,-3.375593156589706e-5,-4.1443656121148575e-8,-0.0018615521548540242,-3.3793432453618705e-5,-4.148302730689643e-8,-0.001861222100187459,-3.3810221048498295E-05,-4.15041470998425e-8,-0.0018608389284970092,-3.377941053241642e-5,-4.148192086511341e-8,-0.0018604228570434176,-3.367833230390359e-5,-4.139496124109246e-8,-0.0018600040268228783,-3.3493942425028966e-5,-4.123062094176194e-8,-0.001859618642548962,-3.322877352067173e-5,-4.0990619843655576e-8,-0.0018593011806838898,-3.290498445207031e-5,-4.0694967467908326e-8,-0.001859073836432133,-3.256319848003421e-5,-4.038105550600808e-8,-0.0018589370096645738,-3.225400787141628e-5,-4.0095898376829484e-8,-0.0018588658572420299,-3.202355089014602e-5,-3.988278237900221e-8,-0.001858815953690681,-3.1898535195761845e-5,-3.9767279252543205e-8,-0.0018587365322608792,-3.187731481624273e-5,-3.974875641256137e-8,-0.001858585847420525,-3.193072891426777e-5,-3.9800881931187754e-8,-0.0018583427276889898,-3.201157846011818e-5,-3.988018363222736e-8,-0.001858011024484624,-3.206838339685549e-5,-3.993871620605644e-8,-0.0018576168661056972,-3.2058722129593e-5,-3.993651170976707e-8,-0.001857200628294303,-3.1958785793748546e-5,-3.98506487342928e-8,-0.0018568063178679155,-3.1767390735336565e-5,-3.9679225404044e-8,-0.0018564711830394505,-3.150417991339459e-5,-3.943989843936122e-8,-0.0018562180244630548,-3.120309508365586e-5,-3.916393604405171e-8,-0.001856051832860989,-3.0903287984785486e-5,-3.888777991719524e-8,-0.0018559610387409902,-3.0640165715613776e-5,-3.864464037772421e-8,-0.0018559222165318323,-3.043888182499085e-5,-3.845831450517588e-8,-0.0018559062367179708,-3.031135180046263e-5,-3.8340287099323454e-8,-0.0018558839785556914,-3.025648674119293e-5,-3.828987583339211e-8,-0.0018558305005729916,-3.0262498510445098e-5,-3.829637141557298e-8,-0.0018557274688207667,-3.030998413607464e-5,-3.8341946180221575e-8,-0.0018555642923261315,-3.0374874455143256e-5,-3.8404431294548646e-8,-0.0018553386335638984,-3.043096245585696e-5,-3.8459652833342595e-8,-0.0018550567897867762,-3.0452262426219995e-5,-3.8483550463237314e-8,-0.0018547340635318174,-3.041572528206477e-5,-3.8454603062521525e-8,-0.0018543947164707576,-3.03048875961989e-5,-3.835716288178646e-8,-0.0018540704590361671,-3.0114692323656852e-5,-3.81859702743685e-8,-0.0018537960249984855,-2.985666954648834e-5,-3.79511015108531e-8,-0.0018536008786521339,-2.9562027461414482e-5,-3.768102528692731e-8,-0.0018534981424192035,-2.927893614320846e-5,-3.742024332911934e-8,-0.0018534751696137296,-2.9061233360087007e-5,-3.72188887172703e-8,-0.0018534923481789171,-2.8950357584252507e-5,-3.711593484750272e-8,-0.0018534940550578869,-2.8958436077817732e-5,-3.7123378482837e-8,-0.0018534282008300274,-2.9062277323979435e-5,-3.722046668883958e-8,-0.0018532645332598092,-2.921211788923309e-5,-3.736159207290112e-8,-0.0018530028720135114,-2.934986972526837e-5,-3.7493050320642694e-8,-0.0018526694542170326,-2.942727873570747e-5,-3.756982425163037e-8,-0.0018523058642196187,-2.9417150023504876e-5,-3.7566073539067835e-8,-0.0018519564866905035,-2.9316192868627697e-5,-3.7477965536880444e-8,-0.0018516584089416203,-2.9141557732680905e-5,-3.7320700414486564e-8,-0.001851435208412855,-2.8923992161479002e-5,-3.712235494419344e-8,-0.001851294541339165,-2.869997092993335e-5,-3.691666372244825e-8,-0.0018512288972952473,-2.850431556199019e-5,-3.673612972502268e-8,-0.0018512187605911334,-2.8364293030248146e-5,-3.6606422818222735e-8,-0.0018512372743969517,-2.8295880091963878e-5,-3.6542771387623024e-8,-0.001851255373367241,-2.830245486957463e-5,-3.654865101402205e-8,-0.0018512464347500161,-2.837567990696616e-5,-3.661658029509977e-8,-0.0018511897654824728,-2.849797616767571e-5,-3.6730452314410044e-8,-0.0018510726455833026,-2.864577894127868e-5,-3.6868605111867225e-8,-0.0018508911239511774,-2.879283048085962e-5,-3.700688885749968e-8,-0.0018506500169525825,-2.891316386992196e-5,-3.712138235946777e-8,-0.0018503624659893852,-2.8983841434482034e-5,-3.719083313132091e-8,-0.001850049192722774,-2.8987717253845237e-5,-3.719912582085492e-8,-0.00184973724683297,-2.8916604783197052e-5,-3.7138199915807674e-8,-0.0018494574590516221,-2.877500685094965e-5,-3.7011601488886906e-8,-0.001849239457271444,-2.8583618727700412e-5,-3.6837917133073514e-8,-0.001849103637120204,-2.8380420558935783e-5,-3.665199142573758e-8,-0.0018490512556514666,-2.8216113176951286e-5,-3.650082802289004e-8,-0.0018490568923369543,-2.814133170477168e-5,-3.643173901900574e-8,-0.001849070044366471,-2.8187498919253204e-5,-3.6474479853762786e-8,-0.0018490301023305032,-2.835027238269989e-5,-3.662573037762882e-8,-0.0018488899067574623,-2.8587217166636767e-5,-3.6846766146306595e-8,-0.0018486348257891318,-2.883361606393152e-5,-3.707797543919425e-8,-0.0018482863056600417,-2.902755950667316e-5,-3.726201459105288e-8,-0.0018478899852914469,-2.9130064005063796e-5,-3.736241363816512e-8,-0.0018474976562760789,-2.91321131307372e-5,-3.737016828147584e-8,-0.0018471524750899352,-2.905016180405401e-5,-3.729976063286029e-8,-0.0018468812786227445,-2.8916268553225196e-5,-3.718025357565311e-8,-0.0018466931172711491,-2.876806315238052e-5,-3.7046173746412294e-8,-0.0018465815057894385,-2.8640983775258864e-5,-3.6930365429741035e-8,-0.00184652829693714,-2.8563136245366806e-5,-3.685914654239289e-8,-0.0018465080445311866,-2.8552306292304803e-5,-3.6849396405970724e-8,-0.0018464923711327586,-2.8614698711177184e-5,-3.69072585309602e-8,-0.0018464540475209713,-2.874515858709884e-5,-3.702828145510411e-8,-0.001846370522506678,-2.8928669467886978e-5,-3.7198811661589566e-8,-0.001846226627091265,-2.9142919199792575e-5,-3.739840984195331e-8,-0.0018460161773210895,-2.936159596526058e-5,-3.7602928735736206e-8,-0.0018457424092981416,-2.9557907441157696e-5,-3.7787745528739335e-8,-0.0018454174436069045,-2.9707932709951874e-5,-3.793078679950588e-8,-0.001845060979936064,-2.9793682517744152e-5,-3.8015266553066575e-8,-0.0018446983139210466,-2.9805837685586976e-5,-3.803216933965162e-8,-0.001844357663506958,-2.974619611849742e-5,-3.7982560537325245e-8,-0.0018440664544479193,-2.9629797711193566e-5,-3.7879707314877856e-8,-0.001843845950446449,-2.948601531108566e-5,-3.775030341662861e-8,-0.0018437041818345754,-2.9356851092842417e-5,-3.763307774716062e-8,-0.0018436286704259478,-2.929018395984869e-5,-3.7572610524337075e-8,-0.0018435826591715672,-2.9326650546160026e-5,-3.7607099199983846e-8,-0.001843510243611047,-2.9482479522100277e-5,-3.7752270839027916e-8,-0.0018433534878047207,-2.9736569576451163e-5,-3.798922207122916e-8,-0.001843076228620517,-3.003258999787417e-5,-3.826624809927366e-8,-0.0018426810050820315,-3.0299279226205748e-5,-3.851758748645876e-8,-0.0018422077376924746,-3.0478508169391107e-5,-3.8689353289091895e-8,-0.0018417156239789582,-3.054470317700498e-5,-3.875746335719129e-8,-0.0018412606553196052,-3.050710730095082e-5,-3.872977574482587e-8,-0.001840880483325183,-3.0398882257686496e-5,-3.8636192256924036e-8,-0.001840590004125507,-3.026250677128237e-5,-3.851540126764517e-8,-0.0018403844397698059,-3.013820957242196e-5,-3.840435285169504e-8,-0.001840245361005513,-3.0057347763451893e-5,-3.8332152701456324e-8,-0.0018401466765782936,-3.0039751280580974e-5,-3.831749547487945e-8,-0.0018400595016326148,-3.0093363332831677e-5,-3.836817784862127e-8,-0.0018399559497764423,-3.0215015910877106e-5,-3.848169905675189e-8,-0.001839812170196447,-3.039186553279613e-5,-3.864654273812751e-8,-0.0018396108283989022,-3.060338054950594e-5,-3.884402378562721e-8,-0.0018393430417674114,-3.082394307346604e-5,-3.905071575977295e-8,-0.001839009544828154,-3.1026114366856945e-5,-3.924146216346563e-8,-0.0018386207708631277,-3.1184328723264915e-5,-3.939273712194119e-8,-0.0018381957305413437,-3.127857148136643e-5,-3.948596451419425e-8,-0.0018377597459139795,-3.1297656724416976e-5,-3.95104860508152e-8,-0.001837341137178437,-3.1241751125251476e-5,-3.946590292406994e-8,-0.0018369670512292443,-3.112376810976386e-5,-3.9363472022820164e-8,-0.0018366586561733092,-3.096932899220622e-5,-3.922626209101001e-8,-0.0018364258708403016,-3.0814812173559905e-5,-3.9087559514838445e-8,-0.0018362621920370473,-3.070252357614279e-5,-3.8986539372919337e-8,-0.0018361412688580824,-3.067203929167175e-5,-3.896025500527251e-8,-0.0018360180816703487,-3.0748042684471684e-5,-3.903223795898209e-8,-0.0018358378502917804,-3.092774827382751e-5,-3.920064225747588e-8,-0.0018355532968053283,-3.1174550168373766e-5,-3.9432189756387474e-8,-0.0018351446756584952,-3.142525945238052e-5,-3.966879216514516e-8,-0.001834631257077125,-3.161182618802566e-5,-3.9847630332795574e-8,-0.001834065391188641,-3.168747068911088e-5,-3.992527940095902e-8,-0.0018335116541834382,-3.164236364109196e-5,-3.989214970654177e-8,-0.0018330236496004874,-3.1501495858562004e-5,-3.977056585296882e-8,-0.0018326302885483708,-3.130976247069251e-5,-3.960119517536447e-8,-0.0018323344622033428,-3.111494455177007e-5,-3.94275962437217e-8,-0.0018321196002908996,-3.095597209536023e-5,-3.928554181120305e-8,-0.0018319582888422555,-3.085789845493625e-5,-3.919836392406287e-8,-0.0018318194757880513,-3.083157342368737e-5,-3.9176511626126014e-8,-0.0018316733480543946,-3.0875483927058214e-5,-3.9219089175635253e-8,-0.0018314943794796696,-3.097812687524317e-5,-3.931593991989682e-8,-0.0018312633560748676,-3.1120334429811935e-5,-3.9449760179892773e-8,-0.001830968913688379,-3.1277592120351454e-5,-3.9598246635518696e-8,-0.0018306087634235733,-3.14226374107931e-5,-3.9736499110668715e-8,-0.0018301904168349817,-3.152864766531905e-5,-3.9839932121797345e-8,-0.0018297309265778968,-3.1573033171681355e-5,-3.988771007373838e-8,-0.0018292551760944991,-3.154139489645285e-5,-3.986633134180522e-8,-0.0018287925523648566,-3.1430926466745534e-5,-3.977274223006469e-8,-0.0018283721888019805,-3.125244172846257e-5,-3.961626454205167e-8,-0.0018280173510476312,-3.1030241019074e-5,-3.941861928815817e-8,-0.0018277399014371466,-3.079933897322065e-5,-3.921157228495376e-8,-0.0018275359237807758,-3.060002936908609e-5,-3.9032106768399976e-8,-0.0018273836315456557,-3.0470075984707517e-5,-3.891530628053033e-8,-0.0018272448509398856,-3.0435259419920423e-5,-3.8885571590877783e-8,-0.0018270713806662069,-3.0500042234658058e-5,-3.8947817158765014e-8,-0.0018268166773114957,-3.064158208297821e-5,-3.908171343754616e-8,-0.0018264509824322654,-3.081128525962225e-5,-3.924294928095106e-8,-0.0018259745066705093,-3.0946791653507584e-5,-3.937422858396294e-8,-0.001825421200068397,-3.0992294321174295e-5,-3.942401662190722e-8,-0.001824848707194268,-3.091859675203208e-5,-3.936503312287334e-8,-0.0018243181665254498,-3.0732388589482095e-5,-3.920280801715213e-8,-0.0018238741939498265,-3.047033281073113e-5,-3.897033103345112e-8,-0.0018235344222076416,-3.0182968256406758e-5,-3.871343791162342e-8,-0.0018232907112232296,-2.9917962061241705e-5,-3.8475612220985564e-8,-0.0018231175915879915,-2.9709470223528575e-5,-3.8288287874661005e-8,-0.0018229820547856707,-2.9574767415543407e-5,-3.8167680241916334e-8,-0.0018228511227224586,-2.951575072500136e-5,-3.811601209651671e-8,-0.0018226963993247997,-2.9522399260808083e-5,-3.812455102291935e-8,-0.001822496346012939,-2.9576313361484465e-5,-3.817679071516764e-8,-0.00182223736569908,-2.9653667368211555e-5,-3.82511596794088e-8,-0.001821914484007764,-2.9727713244422272e-5,-3.8323339418991535e-8,-0.0018215319226575477,-2.9771325860086927e-5,-3.836859871537784e-8,-0.0018211033649289739,-2.9760077349048065e-5,-3.8364575828414726e-8,-0.0018206513209798074,-2.967600860452736e-5,-3.82946771372016e-8,-0.001820204868578569,-2.95117106918752e-5,-3.815177651088395e-8,-0.001819795308698592,-2.9273717903851084e-5,-3.7941337848129227e-8,-0.0018194499553985499,-2.8983792765006212e-5,-3.768268339819807e-8,-0.001819185216669178,-2.867678407238349e-5,-3.74071910297524e-8,-0.0018190008974349288,-2.83945853396037e-5,-3.715294339073842e-8,-0.001818877777254797,-2.8177048843502435e-5,-3.69565401325332e-8,-0.001818779842287521,-2.8051892787703585e-5,-3.684386725138177e-8,-0.0018186613648890997,-2.8026242318695985e-5,-3.682221547238342e-8,-0.0018184777104345217,-2.8082404782524753e-5,-3.687617397457534e-8,-0.0018181975534309522,-2.8179856821560048e-5,-3.6969212144048666e-8,-0.001817813196202531,-2.8264185854983048e-5,-3.705172966271644e-8,-0.001817345167041442,-2.8281685470529075e-5,-3.707441588866618e-8,-0.0018168381018592475,-2.8195553966210703e-5,-3.7003162870434875e-8,-0.0018163479603249767,-2.799754849487948e-5,-3.6829836985857307e-8,-0.0018159250008670967,-2.770979157575244e-5,-3.657403648862273e-8,-0.0018155995956956029,-2.7375894624095573e-5,-3.6275093682421794e-8,-0.0018153764219808644,-2.704596699485922e-5,-3.5978494998850386e-8,-0.0018152377869368145,-2.6762455524996808e-5,-3.572301447864534e-8,-0.001815152477201721,-2.6551760020655958e-5,-3.553302574177351e-8,-0.0018150853173970892,-2.6422470662984083e-5,-3.541677798998169e-8,-0.0018150042988686545,-2.6368080187245047e-5,-3.5368740905128105e-8,-0.001814884542944513,-2.637140326946383e-5,-3.5373559468304656e-8,-0.0018147098501943748,-2.640883213452553e-5,-3.540992975432918e-8,-0.001814472968339351,-2.6453705314678775e-5,-3.5453704890593495e-8,-0.0018141754822484056,-2.6478914642215583e-5,-3.548029701796509e-8,-0.0018138277280354835,-2.645933668573588e-5,-3.54668779570484e-8,-0.0018134485433922909,-2.63746995002284e-5,-3.539493771542412e-8,-0.0018130641999637516,-2.6213143484268603e-5,-3.525347116797519e-8,-0.0018127056529817164,-2.5975139443379584e-5,-3.504252776569707e-8,-0.0018124034131899443,-2.5676611824827752e-5,-3.477610412804476e-8,-0.0018121801872194175,-2.534931109205454e-5,-3.448259855575883e-8,-0.0018120429840718477,-2.503646524431114e-5,-3.420100849172037e-8,-0.0018119778375527472,-2.4783230392470123e-5,-3.3972382770939356e-8,-0.001811950347330866,-2.462408751833058e-5,-3.3828419190625865e-8,-0.0018119132838824324,-2.4571574822020067e-5,-3.3781151941416513e-8,-0.0018118193692635378,-2.461097139426063e-5,-3.381793208892705e-8,-0.0018116348830005524,-2.470333459138878e-5,-3.390395510139745e-8,-0.0018113494195414132,-2.479592830408992e-5,-3.399155855798691e-8,-0.0018109788397635016,-2.483652227449304e-5,-3.403315775348767e-8,-0.0018105608775236578,-2.4787225178468724e-5,-3.399388280325552e-8,-0.001810144903993606,-2.4634019749026035e-5,-3.386038668968676e-8,-0.0018097788424705386,-2.438943653685379e-5,-3.364343809426621e-8,-0.0018094970976968308,-2.408776623021186e-5,-3.3373712923926915e-8,-0.0018093131065530167,-2.3774611485516244e-5,-3.3092397700764274e-8,-0.0018092184234519324,-2.3494490111001275e-5,-3.283995827133673e-8,-0.0018091877331322158,-2.3280593294754563e-5,-3.2646790853564697e-8,-0.0018091871161683125,-2.314939866682767e-5,-3.252822506211939e-8,-0.0018091823293289193,-2.31004611501778e-5,-3.248421726376951e-8,-0.0018091448540584615,-2.311978262620908e-5,-3.250233499343941e-8,-0.0018090550794540737,-2.3184591180723153e-5,-3.2562086291900066e-8,-0.0018089031861997175,-2.3267897328885993e-5,-3.2639095018153503e-8,-0.0018086887334329814,-2.3342085624690892e-5,-3.2708403157821664e-8,-0.0018084198247745962,-2.338158487023955e-5,-3.2746898333729124e-8,-0.0018081122968712463,-2.3365150542970265e-5,-3.273533916353727e-8,-0.001807788822855228,-2.3278370617031e-5,-3.2660558495518114e-8,-0.0018074773359588981,-2.3116713555088714e-5,-3.251818044986732e-8,-0.0018072078836895496,-2.2888860456224638e-5,-3.231565942478291e-8,-0.0018070071067168634,-2.2619145607374683e-5,-3.2074584949186564e-8,-0.0018068904090166695,-2.2346867579039005e-5,-3.18301977417072e-8,-0.001806853807850492,-2.2119984734449717e-5,-3.162581546841964e-8,-0.0018068696241016469,-2.198255341150245e-5,-3.150153125112428e-8,-0.0018068904530553504,-2.195926967130759e-5,-3.1480191546692454e-8,-0.0018068624614854115,-2.2044177423088666e-5,-3.155704270849953e-8,-0.0018067433270976935,-2.2200245280886165e-5,-3.1699156433731375e-8,-0.0018065165630427827,-2.2371032429944445e-5,-3.1855811466588946e-8,-0.0018061958896326482,-2.2498959032548624e-5,-3.197492592167717e-8,-0.0018058190557784669,-2.2542034459431462e-5,-3.201819263383411e-8,-0.0018054353226003737,-2.2483393859611878e-5,-3.196979945333175e-8,-0.001805091981515879,-2.2332389766442987e-5,-3.183757466667896e-8,-0.0018048237525921153,-2.211905907663405e-5,-3.1648156894879373e-8,-0.0018046468284378982,-2.1884874969180767e-5,-3.1438765962970895e-8,-0.0018045577965828564,-2.167257080863706e-5,-3.124804952076372e-8,-0.0018045367469031802,-2.1517256483314775e-5,-3.1108003719807276e-8,-0.0018045532547471112,-2.1440415901790588e-5,-3.103843208390343e-8,-0.0018045734964459543,-2.1447606975861767e-5,-3.1044738831155513e-8,-0.0018045667264467702,-2.1529672691860464e-5,-3.111893588046535e-8,-0.0018045098804961046,-2.1666384245823865e-5,-3.1242914374253404e-8,-0.0018043898839023068,-2.183112130503548e-5,-3.1392708760228225e-8,-0.001804203954475141,-2.1995397908962797e-5,-3.1542638797071024e-8,-0.0018039586205425583,-2.2132522471774145e-5,-3.166864148494045e-8,-0.0018036682150897336,-2.222029327998615e-5,-3.1750683255942955e-8,-0.0018033532774611,-2.2243105107731316e-5,-3.1774601732825967e-8,-0.0018030388535303287,-2.2193945397383773e-5,-3.173385130063672e-8,-0.0018027522942073136,-2.2076575061598045e-5,-3.1631467135425805e-8,-0.0018025198123736337,-2.1907738260673892e-5,-3.148213395270582e-8,-0.0018023610503111382,-2.171835234695091e-5,-3.131339673265721e-8,-0.0018022817446064101,-2.155153029171974e-5,-3.1164020013668663e-8,-0.0018022664981731129,-2.145492195250491e-5,-3.107715875834362e-8,-0.0018022761116299893,-2.1466616576633423e-5,-3.1087611729159285e-8,-0.001802254637597213,-2.1598488185100718e-5,-3.1206666940015674e-8,-0.0018021472428660756,-2.182595909351053e-5,-3.1412695010306495e-8,-0.0018019218634438376,-2.2092822584774562e-5,-3.1655360838329714e-8,-0.0018015825756897933,-2.2331161258804622e-5,-3.187351846210822e-8,-0.0018011669858702807,-2.2485932648024347e-5,-3.2017362632812046e-8,-0.0018007305205330378,-2.2531424552391003e-5,-3.20632837968358e-8,-0.0018003274466781097,-2.247396849454174e-5,-3.201639378115172e-8,-0.001799997044701253,-2.2344006761817026e-5,-3.190352915618942e-8,-0.0017997576968600084,-2.2183994777753875e-5,-3.1762527108728355e-8,-0.0017996074214415598,-2.2037129804367622e-5,-3.163218737463046e-8,-0.0017995281388526994,-2.1939134700851098e-5,-3.1544874466880096e-8,-0.001799491474118722,-2.191336925847295e-5,-3.1522014871558e-8,-0.0017994648236848451,-2.196879034163294e-5,-3.157211653547259e-8,-0.0017994169612412726,-2.210030852102367e-5,-3.1690969385098476e-8,-0.0017993225970557186,-2.2291116208268445e-5,-3.1863685374065217e-8,-0.0017991654559053219,-2.2516364846537557e-5,-3.2068017711543623e-8,-0.0017989396964144166,-2.2747470340719118e-5,-3.2278281986817246e-8,-0.001798649733945888,-2.2956364822787877e-5,-3.246922246142647e-8,-0.0017983088087218547,-2.3119105042172602e-5,-3.2619262744900355e-8,-0.0017979368481374199,-2.3218557224021916e-5,-3.271288686018867e-8,-0.001797558043108042,-2.3246284945411038e-5,-3.274229168261259e-8,-0.0017971982454755217,-2.3203905608775542e-5,-3.2708591798824984e-8,-0.0017968820442133351,-2.3104089519329166e-5,-3.2622768771998037e-8,-0.0017966291126735867,-2.297111342990777e-5,-3.250628913382254e-8,-0.0017964493540700971,-2.2840186859440642e-5,-3.239064633254201e-8,-0.001796337092370337,-2.2753871040159905e-5,-3.231424590201427e-8,-0.001796266176874397,-2.2753701692947285e-5,-3.2314867821004395e-8,-0.0017961898758915664,-2.2866622884127602e-5,-3.241733430757836e-8,-0.0017960501969663332,-2.3089920943539757e-5,-3.261975895170297e-8,-0.0017957976108034395,-2.3383568322421448e-5,-3.288650179068292e-8,-0.0017954135250510931,-2.3679171476829465e-5,-3.315617804332179e-8,-0.0017949215447578652,-2.390518557869303e-5,-3.336437672142568e-8,-0.0017943787200954949,-2.401500851776904e-5,-3.3468942402757484e-8,-0.0017938521133034476,-2.400161061140643e-5,-3.346310636110839e-8,-0.0017933953283730748,-2.3893135268437862e-5,-3.3371567284018426e-8,-0.0017930360672664986,-2.3736813868647664e-5,-3.323619106299432e-8,-0.0017927757839283627,-2.3582117106361543e-5,-3.310107169625848e-8,-0.0017925963117210405,-2.3469363688785598e-5,-3.300241303329868e-8,-0.0017924682328384592,-2.342451096539411e-5,-3.296382113706184e-8,-0.0017923581550719071,-2.345828625550179e-5,-3.299539036168371e-8,-0.001792234150133278,-2.356759742598324e-5,-3.309481410911366e-8,-0.0017920696405059335,-2.3737980155055785e-5,-3.324947345493431e-8,-0.0017918461088012336,-2.3946656287756952e-5,-3.343914759620848e-8,-0.0017915547494891267,-2.416604836192296e-5,-3.363918826601897e-8,-0.0017911970460121622,-2.4367571375549456e-5,-3.382396166819764e-8,-0.0017907841940512808,-2.4525457139788785e-5,-3.3970302096064133e-8,-0.0017903353488858134,-2.4620205356925683e-5,-3.4060599419872674e-8,-0.001789874928831574,-2.464121873006898e-5,-3.408513361013069e-8,-0.0017894293545302076,-2.458842006514815e-5,-3.404350871950484e-8,-0.001789023505241213,-2.4472837169482275e-5,-3.394520600674971e-8,-0.0017886770648342907,-2.431614883409421e-5,-3.3809267595780996e-8,-0.0017884008200234735,-2.4149141187628658e-5,-3.366304609271047e-8,-0.001788192903348495,-2.4008712245158947e-5,-3.353964297579916e-8,-0.0017880354372265181,-2.393253545893989e-5,-3.347316905691076e-8,-0.0017878931539800256,-2.3950554353910987e-5,-3.34910405981934e-8,-0.0017877167144701928,-2.4073806065351983e-5,-3.360377068735919e-8,-0.001787453569690734,-2.428392045087678e-5,-3.379534491041236e-8,-0.0017870663495322726,-2.4530220442592966e-5,-3.402051298850108e-8,-0.0017865519910194932,-2.4741563720019448e-5,-3.4215448424805376e-8,-0.0017859491906381667,-2.4852189071213217e-5,-3.4321023197333045e-8,-0.001785325958533287,-2.482869995671932e-5,-3.4307016493753474e-8,-0.0017847528767015353,-2.4681669420333632e-5,-3.418245486606978e-8,-0.0017842781208460322,-2.4456188730650273e-5,-3.3987154219619505e-8,-0.0017839168488831807,-2.4210443635923462e-5,-3.3772695142451446e-8,-0.0017836554356915608,-2.3996010205156732e-5,-3.358499104157047e-8,-0.0017834629055072672,-2.384722325415727e-5,-3.345487005540549e-8,-0.0017833022278605421,-2.377911957973221e-5,-3.33961693481918e-8,-0.0017831382257718895,-2.3790191594592873e-5,-3.340803787799357e-8,-0.0017829420119458068,-2.386664304225821e-5,-3.347858835271957e-8,-0.0017826931337199766,-2.3986439556649512e-5,-3.35884337520014e-8,-0.001782380554182279,-2.4122805007119548e-5,-3.37138034186474e-8,-0.0017820030107513522,-2.424741808773985e-5,-3.382943346932811e-8,-0.0017815688268330704,-2.4333593880854584e-5,-3.391144581214018e-8,-0.0017810949919451016,-2.435957061890063e-5,-3.3940296734933424e-8,-0.0017806052023764001,-2.4311695591746605e-5,-3.3903609380761455e-8,-0.001780126733231539,-2.4186960953258744e-5,-3.3798419210927013e-8,-0.001779686389109376,-2.3994309151659606e-5,-3.363234575116789e-8,-0.0017793060255654567,-2.3754312161234117e-5,-3.3423362014270186e-8,-0.0017789982504817423,-2.3497003448101446e-5,-3.319796437690346e-8,-0.0017787629677499328,-2.325789658218794e-5,-3.2987743056121986e-8,-0.0017785853328477087,-2.307245026259536e-5,-3.2824528494159e-8,-0.001778435693719291,-2.29692203202828e-5,-3.2734270343295896e-8,-0.0017782724447692514,-2.2962114363640616e-5,-3.2729999425653523e-8,-0.0017780489744251891,-2.304310446279494e-5,-3.2805121499466924e-8,-0.0017777252482119056,-2.3178271529330762e-5,-3.292970232577239e-8,-0.0017772823647096638,-2.331129259651724e-5,-3.305351428606098e-8,-0.0017767346083272459,-2.3377529158287416e-5,-3.311868318348257e-8,-0.001776130764697321,-2.3326480780226323e-5,-3.3079844371637935e-8,-0.0017755397912121303,-2.3142506066602418e-5,-3.292267378791187e-8,-0.001775025923089456,-2.285130228165791e-5,-3.2669641431352325e-8,-0.001774626618706956,-2.2507845107702927e-5,-3.2369284423643596e-8,-0.0017743445685003865,-2.217390512592298e-5,-3.207630409849978e-8,-0.0017741544806826274,-2.1898231682136928e-5,-3.1834061464338805e-8,-0.0017740169436090173,-2.1707118952548065e-5,-3.166620956255327e-8,-0.001773891219541728,-2.1604779152879516e-5,-3.157692307526984e-8,-0.0017737432310165142,-2.157882930216389e-5,-3.155562491937049e-8,-0.0017735489504333692,-2.1606679331330368e-5,-3.1582552828697624e-8,-0.0017732949817235678,-2.1660754250425577e-5,-3.163336707176071e-8,-0.0017729779982578978,-2.1712249139899234e-5,-3.1682516270717386e-8,-0.0017726039251191308,-2.1733947237802756e-5,-3.170578892729579e-8,-0.0017721870422029683,-2.170274238348413e-5,-3.168258293259854e-8,-0.001771748742021881,-2.160228540957275e-5,-3.1598253034946674e-8,-0.001771315436498432,-2.142574791419228e-5,-3.144654198656495e-8,-0.0017709151725227585,-2.1178148251122183e-5,-3.123163082063926e-8,-0.0017705729667818262,-2.0877318554922502e-5,-3.096901728522543e-8,-0.00177030549185305,-2.055260685325797e-5,-3.0684433448224743e-8,-0.0017701162882080364,-2.0240789383713746e-5,-3.041032430169265e-8,-0.0017699929466398218,-1.99794218315807e-5,-3.018005089313501e-8,-0.0017699074633654773,-1.9798779288104986e-5,-3.002078373264498e-8,-0.0017698202590316055,-1.971411094245867e-5,-2.994657558110185e-8,-0.0017696875886955075,-1.9720002942223983e-5,-2.9953206911113435e-8,-0.0017694714315701055,-1.9788544043428927e-5,-3.0016365819494506e-8,-0.001769150179508032,-1.9872824099373976e-5,-3.009460999645151e-8,-0.0017687273917546744,-1.9916635597634004e-5,-3.013794933369788e-8,-0.0017682349328222557,-1.986951675134688e-5,-3.0101278511672435e-8,-0.00176772710105645,-1.970328034493384e-5,-2.995916376833186e-8,-0.0017672653670454336,-1.942323674398719e-5,-2.9715881402750377e-8,-0.0017668987135009146,-1.906762066737871e-5,-2.9404951820690843e-8,-0.0017666484557888058,-1.8694185914153163e-5,-2.9077305426574343e-8,-0.0017665045683398996,-1.836037649987278e-5,-2.8783779540595175e-8,-0.0017664336822339468,-1.810670803004512e-5,-2.85604298531802e-8,-0.0017663927590512497,-1.7949525459591675e-5,-2.8422063980110166e-8,-0.0017663414629926905,-1.7882936783559632e-5,-2.8363836548011972e-8,-0.001766249541876796,-1.7885707909765793e-5,-2.8367242121714928e-8,-0.001766099266242993,-1.7928819727490756e-5,-2.8406756909275128e-8,-0.0017658847993394775,-1.798137782732972e-5,-2.8455090069843767e-8,-0.001765610393070421,-1.8014480188581894e-5,-2.8486659197502897e-8,-0.0017652885448722823,-1.800366604960887e-5,-2.8479796999216368e-8,-0.0017649384258213695,-1.7930802219111313e-5,-2.8418420896184835e-8,-0.0017645842871166185,-1.778602853787445e-5,-2.829372109660203e-8,-0.0017642532352409623,-1.7569903288050705e-5,-2.81060198076404e-8,-0.001763971759473834,-1.7295278259522374e-5,-2.786641950500421e-8,-0.0017637607807011494,-1.698782162266873e-5,-2.7597305393828584e-8,-0.0017636298282722234,-1.668378910785923e-5,-2.7330463361969477e-8,-0.0017635720325075124,-1.6424062245120354e-5,-2.7101919283812356e-8,-0.0017635623160880396,-1.624485381333525e-5,-2.6943804573923697e-8,-0.0017635607308321933,-1.6167370096356146e-5,-2.6875224575923194e-8,-0.0017635211289864948,-1.6190012162179073e-5,-2.68952735608918e-8,-0.0017634030561349838,-1.6286391210993562e-5,-2.6981120973846906e-8,-0.0017631832067511017,-1.6410496829813158e-5,-2.7092420717209323e-8,-0.001762862804611093,-1.650784066444652e-5,-2.7181070789573557e-8,-0.001762468592752757,-1.6529538541808296e-5,-2.720366625840219e-8,-0.001762046894151369,-1.6445530812446836e-5,-2.713326263374019e-8,-0.0017616519554521687,-1.6253198861825676e-5,-2.696709599279156e-8,-0.0017613315225252794,-1.5978453405918325e-5,-2.672764292807032e-8,-0.0017611140058775958,-1.5668350101802668e-5,-2.645617877953825e-8,-0.0017610016624053787,-1.5377341425857762e-5,-2.6200694380823762e-8,-0.001760972152477191,-1.5152050261090025e-5,-2.6002466768736517e-8,-0.0017609872896826445,-1.5020078162915458e-5,-2.5886132235295784e-8,-0.0017610048499390252,-1.4986153105280482e-5,-2.585618781524479e-8,-0.0017609887967856529,-1.5035267740803247e-5,-2.5899659894477047e-8,-0.0017609151979063953,-1.5139768158020223e-5,-2.5992305073980463e-8,-0.001760773716567572,-1.5266958060346903e-5,-2.610532992986437e-8,-0.0017605661687073292,-1.5385079455718696e-5,-2.6210718388494383e-8,-0.0017603038826338377,-1.5467116653328303e-5,-2.6284636330568005e-8,-0.0017600050563999715,-1.5492918931559058e-5,-2.630931543163531e-8,-0.00175969254649456,-1.5450515709074643e-5,-2.6274181953792665e-8,-0.0017593918639489119,-1.5337330423786408e-5,-2.617687582404043e-8,-0.0017591287810466108,-1.516152233340109e-5,-2.6024399594225813e-8,-0.0017589258943309788,-1.4943092225619993e-5,-2.5834108333616962e-8,-0.0017587977883399433,-1.4713698844311321e-5,-2.563361964748376e-8,-0.001758745306123578,-1.4513557060983797e-5,-2.5458186180871662e-8,-0.0017587508567577885,-1.4384033445413648e-5,-2.534426611652559e-8,-0.0017587779139626098,-1.4356303112866524e-5,-2.5319563744401592e-8,-0.0017587774818432792,-1.4439371548397277e-5,-2.5392423095802513e-8,-0.0017587014180465244,-1.461308765223457e-5,-2.5545545630735418e-8,-0.0017585182143315644,-1.4831017637906244e-5,-2.573837988454579e-8,-0.001758224300036135,-1.5033522952700285e-5,-2.5918544356983626e-8,-0.0017578456814572269,-1.5165890121277228e-5,-2.6037769834404815e-8,-0.0017574296827317477,-1.5194062164951215e-5,-2.6065783871821737e-8,-0.0017570309130902051,-1.5112670663097581e-5,-2.5997452534758276e-8,-0.001756696813994369,-1.4944139321311835e-5,-2.5852086776316284e-8,-0.0017564568402563836,-1.473071652369088e-5,-2.566653582995585e-8,-0.0017563173354597894,-1.4522642160396031e-5,-2.548486082353178e-8,-0.0017562624354948073,-1.4365851015030895e-5,-2.5347546705261553e-8,-0.0017562599735600776,-1.4292151664489295e-5,-2.5282821848690496e-8,-0.001756270345717931,-1.4313890299943314e-5,-2.5301868529854778e-8,-0.0017562557588578422,-1.4423796145213121e-5,-2.5398581829437754e-8,-0.0017561874812613571,-1.4599191257972496e-5,-2.5553204717269587e-8,-0.0017560497205785389,-1.4808590783445874e-5,-2.573812424229174e-8,-0.0017558401001670073,-1.501849889141526e-5,-2.5923886858305346e-8,-0.0017555677036126833,-1.5198851791683837e-5,-2.6084035700955837e-8,-0.0017552499882569114,-1.5326523211685818e-5,-2.6198219746351277e-8,-0.0017549096171388453,-1.5387143092883683e-5,-2.625378099409158e-8,-0.0017545716844747704,-1.5375917958639373e-5,-2.624643446693762e-8,-0.0017542612485054693,-1.5298085448759974e-5,-2.618062930004095e-8,-0.0017540007404882867,-1.5169273450952789e-5,-2.6069861979063126e-8,-0.0017538066861335557,-1.5015531634949477e-5,-2.593675647987724e-8,-0.0017536853789179659,-1.4872118319182157e-5,-2.5812093138283254e-8,-0.0017536279768385933,-1.4779491480665109e-5,-2.5731383005018647e-8,-0.001753606952723239,-1.477510058162383e-5,-2.5727704626657337e-8,-0.0017535772625469973,-1.4881293853944655e-5,-2.5821044107833472e-8,-0.0017534854838303832,-1.5093084239007569e-5,-2.600743669074431e-8,-0.001753286710863749,-1.5372854528035302e-5,-2.6254185280220255e-8,-0.0017529628465813953,-1.5658309245887e-5,-2.650676375421154e-8,-0.0017525321779777868,-1.5882916451512282e-5,-2.6706754294287406e-8,-0.0017520438774256833,-1.599931632431093e-5,-2.6812413521358316e-8,-0.0017515603547515798,-1.599389242849295e-5,-2.6811474485739375e-8,-0.0017511370747768787,-1.58870721613282e-5,-2.6721446136561115e-8,-0.0017508085426400448,-1.5722498178991464e-5,-2.6580205900138525e-8,-0.001750583522276346,-1.5552126055896935e-5,-2.6433054088095324e-8,-0.0017504477988545496,-1.5423007708300132e-5,-2.6321212129111954e-8,-0.001750371174214469,-1.5368439711583733e-5,-2.62740633198849e-8,-0.001750315851837096,-1.5403810993203438e-5,-2.630543047416448e-8,-0.0017502443819633047,-1.552642617773328e-5,-2.641330452405617e-8,-0.0017501260881107377,-1.5718366270618406e-5,-2.6582255837826362e-8,-0.001749941315168841,-1.595138996435713e-5,-2.6787687878177625e-8,-0.0017496832210316077,-1.6192740022060927e-5,-2.7000937830024997e-8,-0.0017493572693855985,-1.6410744434680557e-5,-2.719422519070173e-8,-0.001748978948913387,-1.6579358203906588e-5,-2.7344668887639668e-8,-0.0017485704968312657,-1.6681163415333903e-5,-2.74369274282324e-8,-0.0017481574240992264,-1.670883282721197e-5,-2.7464466784574147e-8,-0.0017477653066889829,-1.666547427544194e-5,-2.742983935525184e-8,-0.0017474168841164288,-1.6564305460559376e-5,-2.7344394725503e-8,-0.001747129279233854,-1.6427879931202274e-5,-2.722763656186771e-8,-0.0017469110243550452,-1.6286771476204226e-5,-2.7106146180372478e-8,-0.0017467586534195868,-1.6177063093025705e-5,-2.7011472007132247e-8,-0.0017466533463252492,-1.6135412490742596e-5,-2.6975864478472212e-8,-0.0017465594178202246,-1.6190686058868135e-5,-2.7024931986323628e-8,-0.0017464276261986936,-1.6352739951425828e-5,-2.7167717614836124e-8,-0.0017462061719448097,-1.6602042086509395e-5,-2.7387475511613235e-8,-0.0017458589390846183,-1.688727509586495e-5,-2.7639480984314817e-8,-0.001745383793112345,-1.7137548063945405e-5,-2.7861723308800773e-8,-0.001744819115139456,-1.7287659579105718e-5,-2.7997065592867195e-8,-0.0017442316274042247,-1.7303833560797986e-5,-2.8015768007836517e-8,-0.0017436912573285538,-1.7194973975304273e-5,-2.7925287860788828e-8,-0.001743247452036388,-1.7004614184730193e-5,-2.7763247275154654e-8,-0.0017429180130239536,-1.6791404372740664e-5,-2.758049651565357e-8,-0.0017426913839497045,-1.6609904370917028e-5,-2.7424492345162885e-8,-0.001742536475141356,-1.649859690995107e-5,-2.7328913073261393e-8,-0.0017424137905466815,-1.6475754777084468e-5,-2.731001280582881e-8,-0.0017422844622990985,-1.6540670952381766e-5,-2.7367575703814308e-8,-0.001742116355369948,-1.6677544114767887e-5,-2.7488179361086792e-8,-0.0017418876343611228,-1.686031928037145e-5,-2.764933739189588e-8,-0.0017415883616594284,-1.70577248174131e-5,-2.782387438953023e-8,-0.0017412205022093819,-1.7238115114124338e-5,-2.7984175560639326e-8,-0.0017407965855088022,-1.737379930727008e-5,-2.8106002984605667e-8,-0.0017403372333003285,-1.744456666693547e-5,-2.81716008451723e-8,-0.0017398678463401798,-1.7440083829039737e-5,-2.817179627356715e-8,-0.0017394149398974874,-1.7360942313155324e-5,-2.8106908907450188e-8,-0.0017390025998627163,-1.7218462503755394e-5,-2.7986581351569095e-8,-0.0017386492629266872,-1.7033516940844868e-5,-2.78287765345854e-8,-0.0017383648667583472,-1.6834511621145167e-5,-2.7658071698212013e-8,-0.0017381483860776027,-1.6654526309760896e-5,-2.750323777098479e-8,-0.0017379857880764208,-1.6527352718845074e-5,-2.7393844848311547e-8,-0.0017378488996451671,-1.6481799532138352e-5,-2.735530264547702e-8,-0.0017376966372265247,-1.653390656976417e-5,-2.7402002468754002e-8,-0.0017374807521994074,-1.6678137811977933e-5,-2.752950967892001e-8,-0.0017371577619254865,-1.6881003467352378e-5,-2.7708880462880502e-8,-0.0017367058418978965,-1.7082956805723142e-5,-2.7888277038928824e-8,-0.0017361397871615877,-1.7213636041267133e-5,-2.8006313607759834e-8,-0.0017355130919502622,-1.7217983517437767e-5,-2.8014887489228886e-8,-0.0017349010873700975,-1.7080148864802256e-5,-2.789998107144859e-8,-0.0017343723348015217,-1.6829898005292252e-5,-2.7687166142917287e-8,-0.0017339647832955254,-1.6527764114669422e-5,-2.742869117101087e-8,-0.0017336786370508808,-1.6239846977128967e-5,-2.718170516827529e-8,-0.0017334849605685624,-1.6017009429821272e-5,-2.6990333500378085e-8,-0.0017333407869161536,-1.588567181395312e-5,-2.6877727087182345e-8,-0.0017332024740586718,-1.5848606242811324e-5,-2.6846667644146168e-8,-0.0017330340615586818,-1.5890746362680283e-5,-2.68844715727071e-8,-0.0017328110493750382,-1.598598400945783e-5,-2.696877596915934e-8,-0.00173252127473545,-1.6103053832416733e-5,-2.7072598915931684e-8,-0.0017321643150833425,-1.6210210138051937e-5,-2.716841036510506e-8,-0.0017317501140170313,-1.6278998147010685e-5,-2.723144593688566e-8,-0.0017312970188940173,-1.6287366080985484e-5,-2.7242447571344237e-8,-0.0017308292084595779,-1.6222185622260528e-5,-2.7189872388028625e-8,-0.001730373452436675,-1.6081006942388617e-5,-2.7071418830950497e-8,-0.0017299553582569695,-1.5872667604661172e-5,-2.6894553273205772e-8,-0.0017295955423252537,-1.5616500957420817e-5,-2.6675832877706237e-8,-0.0017293061873740823,-1.5340170469505593e-5,-2.6439061947713e-8,-0.0017290883470865532,-1.507625010199129e-5,-2.6212382075122478e-8,-0.0017289303472872032,-1.485771739629063e-5,-2.6024423253133448e-8,-0.0017288076171489378,-1.4712600788592941e-5,-2.5899692716363257e-8,-0.0017286843786890062,-1.4657982104751628e-5,-2.5853345982890227e-8,-0.0017285179920752429,-1.469378801204321e-5,-2.5885710544355952e-8,-0.0017282669016267444,-1.4797809692912494e-5,-2.597784298491023e-8,-0.0017279022709099565,-1.4924826606494031e-5,-2.6090678957383975e-8,-0.0017274210330882648,-1.5013539408658058e-5,-2.6171041964052904e-8,-0.0017268544886931924,-1.500339980186787e-5,-2.6166307322124555e-8,-0.0017262646488298942,-1.4857541654773406e-5,-2.6044338623451537e-8,-0.0017257250829835684,-1.4580494467278208e-5,-2.5808814537283378e-8,-0.0017252937794389228,-1.4218526667931194e-5,-2.5499476937908507e-8,-0.0017249930231404602,-1.3840794807331261e-5,-2.517585149150039e-8,-0.0017248067699141875,-1.351270711306445e-5,-2.4894335555473773e-8,-0.0017246934534974646,-1.3276295708485894e-5,-2.4691333401292228e-8,-0.0017246038274408126,-1.314433765536367e-5,-2.4578159853052325e-8,-0.0017244948196652298,-1.3105269854769773e-5,-2.454517288778279e-8,-0.0017243364526524838,-1.3132362073222714e-5,-2.456957312402072e-8,-0.0017241132667976712,-1.3192342565411862e-5,-2.4622786661510245e-8,-0.0017238228661482834,-1.325163183139236e-5,-2.4675851118792835e-8,-0.0017234735662261548,-1.3280343921097598e-5,-2.470291409721152e-8,-0.0017230820075737141,-1.3254924222723466e-5,-2.4683557620105018e-8,-0.0017226707950760843,-1.3160121817767504e-5,-2.4604525475472103e-8,-0.001722265910630456,-1.2990581890931382e-5,-2.4461095384133306e-8,-0.001721893605087852,-1.275194862461917e-5,-2.4258014835579526e-8,-0.0017215766694778005,-1.2461004044485085e-5,-2.400961012256891e-8,-0.0017213304202050618,-1.2144266502687791e-5,-2.373858904526001e-8,-0.0017211591144521662,-1.1834740035222872e-5,-2.3473278345894057e-8,-0.0017210536379387664,-1.15669121811399e-5,-2.3243368159746304e-8,-0.0017209912434660293,-1.137053703664978e-5,-2.3074600444917153e-8,-0.00172093786428734,-1.126418106526938e-5,-2.2983213066028008e-8,-0.0017208531150557185,-1.1249725559581083e-5,-2.2971150222902847e-8,-0.0017206977257007766,-1.1309037278010377e-5,-2.3023095245395752e-8,-0.0017204427559582552,-1.1404176889886242e-5,-2.3106548502949438e-8,-0.0017200791234227555,-1.1482681882738014e-5,-2.3176327687590162e-8,-0.0017196246541953794,-1.148889330573019e-5,-2.3184350335903796e-8,-0.001719124641958263,-1.1380227657635337e-5,-2.3093722950941158e-8,-0.0017186423638384035,-1.114361781624759e-5,-2.289295661201278e-8,-0.0017182400231541156,-1.0804036814357762e-5,-2.2603315828948557e-8,-0.0017179572397719124,-1.0418304686722344e-5,-2.2273489276189473e-8,-0.0017177979779009823,-1.0055136813138216e-5,-2.1962468500676522e-8,-0.0017177326568771723,-9.771363476111051e-6,-2.171915971274942e-8,-0.0017177126940655086,-9.59618259083335e-6,-2.1568855933039855e-8,-0.0017176882158911563,-9.528664202440341e-6,-2.151102115154199e-8,-0.0017176207842986657,-9.54532916023194e-6,-2.152570092195504e-8,-0.001717488539588401,-9.61114215968148e-6,-2.1582903167043163e-8,-0.0017172856020235222,-9.688935408136953e-6,-2.1650695633700068e-8,-0.0017170188075453885,-9.745503388018222e-6,-2.1700489974222203e-8,-0.001716704030343493,-9.75481187740589e-6,-2.1709853665659155e-8,-0.001716363051667733,-9.699527683861308e-6,-2.1663854398151375e-8,-0.0017160209740540878,-9.571902058244573e-6,-2.155581284513286e-8,-0.0017157037275235207,-9.374493289871258e-6,-2.1387892099804606e-8,-0.0017154351582843574,-9.12063251889091e-6,-2.1171465309349033e-8,-0.0017152334371241793,-8.834059379219236e-6,-2.0926792740536966e-8,-0.0017151070380174468,-8.54691461997685e-6,-2.0681324010697784e-8,-0.0017150511747853247,-8.295434661355793e-6,-2.0466057621787945e-8,-0.0017150460711992154,-8.113332137404114e-6,-2.030992124260642e-8,-0.0017150584488687581,-8.023886119027629e-6,-2.0233017236108107e-8,-0.0017150469068009022,-8.032794681682757e-6,-2.0240470470753276E-08,-0.0017149705846409252,-8.124212126971078e-6,-2.031895666669989e-8,-0.0017147992299687779,-8.261786867259084e-6,-2.043750161115691e-8,-0.0017145220766764634,-8.39524066367176e-6,-2.0553060054856926e-8,-0.001714152932724592,-8.471588872493842e-6,-2.062012893709478e-8,-0.0017137294505731322,-8.448766698921679e-6,-2.0602470471424994e-8,-0.0017133056268037235,-8.30827935977141e-6,-2.0484010951138584e-8,-0.0017129382965746429,-8.062726137621993e-6,-2.0275329834940626e-8,-0.0017126708829768335,-7.754388283059394e-6,-2.0012476947012425e-8,-0.0017125200757254853,-7.443621313326269e-6,-1.9747060849152198e-8,-0.0017124712795059404,-7.190431363037621e-6,-1.9530504080148718e-8,-0.001712485108463056,-7.0366396458408515e-6,-1.9398773754969298e-8,-0.0017125116285125956,-6.995979960543143e-6,-1.9363850589301513e-8,-0.0017125055152946264,-7.054904126090996e-6,-1.941433171688431e-8,-0.0017124362267456486,-7.181290036679982e-6,-1.9522819783303132e-8,-0.0017122912356786113,-7.33559115667751e-6,-1.9655458212988638e-8,-0.0017120739679193392,-7.480041670713854e-6,-1.9779851901213196e-8,-0.0017117993662422982,-7.584250733816216e-6,-1.9869913460128613e-8,-0.0017114893374762983,-7.627641340691138e-6,-1.9907989660052855e-8,-0.0017111690927208221,-7.6000125055850025e-6,-1.9885345225042433e-8,-0.0017108644073861132,-7.501412760528949e-6,-1.9802025000362843e-8,-0.0017105992780522003,-7.341978719606794e-6,-1.966667578346078e-8,-0.0017103933189507282,-7.1417111820099305e-6,-1.949632951528594e-8,-0.0017102585004460788,-6.929573781906971e-6,-1.9315642219774395e-8,-0.0017101954017993111,-6.7409497837180035e-6,-1.9154764556717096e-8,-0.0017101899463117245,-6.612514274616833e-6,-1.904501927146042e-8,-0.0017102124219094009,-6.574302226505446e-6,-1.9012164611844463e-8,-0.0017102208546907933,-6.640381461484933e-6,-1.906841604034119e-8,-0.0017101696872487946,-6.801430426475136e-6,-1.920604126355059e-8,-0.0017100221870999638,-7.023203351349197e-6,-1.939596217498844e-8,-0.0017097624173563275,-7.2532026779098715e-6,-1.959339512897098e-8,-0.0017094018542985613,-7.4343348959541015e-6,-1.9749511339903364e-8,-0.0017089776595243197,-7.520980981562084e-6,-1.982519953065219e-8,-0.0017085430785728673,-7.491875094526717e-6,-1.98021064005799e-8,-0.0017081533169143335,-7.355782261528479e-6,-1.968751486928549e-8,-0.0017078512816734047,-7.148736530329722e-6,-1.9512013140907094e-8,-0.0017076570788535014,-6.924050653939927e-6,-1.9321004792382517e-8,-0.0017075639301940206,-6.73805286028801e-6,-1.9162573935492407e-8,-0.0017075414744693901,-6.635623404704152e-6,-1.9075152574921577e-8,-0.0017075452538536885,-6.6397481673598866e-6,-1.907856769945405e-8,-0.0017075291279762277,-6.74799680854229e-6,-1.917095975773456e-8,-0.001707456464753147,-6.936270654025548e-6,-1.9331909124735297e-8,-0.001707306873839935,-7.167486224038338e-6,-1.9529815014463757e-8,-0.0017070774940020905,-7.40150152130711e-6,-1.9730384470556232e-8,-0.001706780055599116,-7.603160648750164e-6,-1.9903542367193303e-8,-0.0017064359548183703,-7.747073464223104e-6,-2.0027552034501053e-8,-0.0017060712869391593,-7.819370843360752e-6,-2.009053088308096e-8,-0.0017057128647851082,-7.81750689300007e-6,-2.0090272816758505e-8,-0.0017053853475831233,-7.749258787440385e-6,-2.0033369653230264e-8,-0.0017051090246987348,-7.63165252439743e-6,-1.9934273203516424e-8,-0.0017048976130836205,-7.48990374053086e-6,-1.9814391821666054e-8,-0.0017047556071532683,-7.355870167993619e-6,-1.9700800557958514e-8,-0.0017046752314598494,-7.265069438578037e-6,-1.962374814999241e-8,-0.001704633907873945,-7.251176602605976e-6,-1.9612010035070857e-8,-0.0017045942123405239,-7.337574074837141e-6,-1.968569133958673e-8,-0.0017045088636094908,-7.527447475358424e-6,-1.984773628854404e-8,-0.0017043321125059295,-7.796609969145614e-6,-2.0077728553648004e-8,-0.0017040352892301902,-8.094628881719389e-6,-2.033278529821439e-8,-0.0017036199174814714,-8.357321757473915e-6,-2.0558199710134475e-8,-0.0017031207453830734,-8.527279641554265e-6,-2.07049674527795e-8,-0.0017025957211632837,-8.573251713438601e-6,-2.0746330786424403e-8,-0.0017021073995130097,-8.499347348814524e-6,-2.0685612575558143e-8,-0.0017017044497118188,-8.341162243397592e-6,-2.0552915628861326e-8,-0.0017014101770728533,-8.152663137236833e-6,-2.0393996128262026e-8,-0.001701220123087332,-7.99029114266652e-6,-2.0256802195303342e-8,-0.0017011069963663247,-7.899440803721392e-6,-2.0180015465234488e-8,-0.0017010298088642021,-7.905934485141747e-6,-2.0185786978182623e-8,-0.0017009442845075707,-8.013087611659719e-6,-2.0277176829621546e-8,-0.001700812271449088,-8.203778005991368e-6,-2.043983579510598e-8,-0.001700608518360257,-8.446292559298515e-6,-2.0646923134808663e-8,-0.0017003238336688721,-8.702227743979316e-6,-2.086581340902206e-8,-0.0016999645473487364,-8.934420936028888e-6,-2.106486263485468e-8,-0.00169954913513485,-9.113190354238928e-6,-2.1218747636263865e-8,-0.0016991033874861217,-9.22001102864717e-6,-2.1311618593498575e-8,-0.0016986554807616981,-9.248647435155238e-6,-2.13380740034121e-8,-0.0016982318855080062,-9.204399731118582e-6,-2.1302519561850147e-8,-0.0016978543995590132,-9.10238542444722e-6,-2.121770451114759e-8,-0.0016975380294125626,-8.965565187764711e-6,-2.1103046899748445e-8,-0.0016972892355614753,-8.822716746064468e-6,-2.0982928734896224e-8,-0.001697104147393287,-8.706075816679848e-6,-2.0884721675880377e-8,-0.0016969666972081788,-8.647926619789557e-6,-2.0835920379221263e-8,-0.00169684740011825,-8.675181170249637e-6,-2.0859546028640884e-8,-0.0016967045804855362,-8.801519162920972e-6,-2.0967436610679105e-8,-0.0016964905065300056,-9.01844333619171e-6,-2.1152579343920042e-8,-0.0016961639731149969,-9.289415793960601e-6,-2.138406153842879e-8,-0.001695707106127775,-9.553311743058151e-6,-2.160998864081665e-8,-0.0016951385176591758,-9.741104001052941e-6,-2.1771702413548394e-8,-0.0016945128063564176,-9.801298769835388e-6,-2.1825425829586347e-8,-0.001693902985101117,-9.720976758235634e-6,-2.176009941619977e-8,-0.0016933741666031645,-9.529958261736527e-6,-2.1600847624303437e-8,-0.0016929627649807358,-9.286767509844959e-6,-2.1397063223247418e-8,-0.0016926700984223038,-9.056285660978077e-6,-2.1203544267075215e-8,-0.0016924690855679811,-8.890755742029625e-6,-2.1064502321326876e-8,-0.0016923170302585921,-8.819805710338477e-6,-2.1005150945671767e-8,-0.0016921682214408472,-8.8489478525651e-6,-2.1030391509463162e-8,-0.0016919833229793798,-8.963433333096914e-6,-2.1127991678712995e-8,-0.0016917350451069605,-9.1345146397534e-6,-2.1273812337831973e-8,-0.0016914106590955637,-9.326304850307346e-6,-2.1437577987506275e-8,-0.0016910119930584138,-9.50234733555081e-6,-2.158843896357954e-8,-0.0016905533915853798,-9.631291450467526e-6,-2.1699798048136526e-8,-0.0016900581754099764,-9.69110899668149e-6,-2.1752905508392625e-8,-0.0016895542586885487,-9.671493446052107e-6,-2.1738910779710982e-8,-0.0016890696305639124,-9.574362283327237e-6,-2.1659302094648493e-8,-0.0016886283866275086,-9.412685663855614e-6,-2.1524925607916213e-8,-0.001688247743667381,-9.208192002297713e-6,-2.1354054577412935e-8,-0.0016879360364431592,-8.98854909081757e-6,-2.1170017704178606e-8,-0.0016876914563649197,-8.784322466768402e-6,-2.0998642806816554e-8,-0.0016875013089274406,-8.625690463057586e-6,-2.086549585606093e-8,-0.0016873417279686287,-8.53858560005698e-6,-2.0792626469016813e-8,-0.001687178325547085,-8.539692110101775e-6,-2.079432297753112e-8,-0.0016869691166023061,-8.630151987089456e-6,-2.0871746461888742e-8,-0.0016866715029369072,-8.789267347131455e-6,-2.100754636158876e-8,-0.001686254318023176,-8.97163165767185e-6,-2.1163398058176738e-8,-0.0016857129301765929,-9.112940780203801e-6,-2.1284938230037018e-8,-0.0016850801573558933,-9.148161471228022e-6,-2.1317184884815498e-8,-0.001684422796496244,-9.037763226930734e-6,-2.122672379094548e-8,-0.0016838198027999708,-8.787797426035769e-6,-2.1018591580797273e-8,-0.0016833318949512636,-8.44940531154977e-6,-2.0735764854021037e-8,-0.0016829803888256231,-8.096954946202853e-6,-2.0440726785689123e-8,-0.0016827459755191082,-7.799047296914452e-6,-2.0191141842253217e-8,-0.001682583454796451,-7.598483392665845e-6,-2.0023083749209106e-8,-0.0016824406087873034,-7.507046345778621e-6,-1.9946647297024858e-8,-0.00168227233893414,-7.511005682637191e-6,-1.995050767444206e-8,-0.0016820477635596358,-7.580629314178077e-6,-2.0009840918065495e-8,-0.0016817519149339769,-7.679226904576688e-6,-2.0093885939198342e-8,-0.0016813844563981313,-7.770076038468931e-6,-2.017176810577966e-8,-0.00168095711875254,-7.821310599237092e-6,-2.02166337334569e-8,-0.0016804905773571324,-7.809332280904686e-6,-2.020854689581189e-8,-0.001680010953275545,-7.72105576611143e-6,-2.013639837823021e-8,-0.001679546036692029,-7.555014866778501e-6,-1.999884849506686e-8,-0.0016791214090587767,-7.3212178391739496e-6,-1.9804212819061585e-8,-0.0016787568208649483,-7.0396326381076e-6,-1.956919439356282e-8,-0.0016784633058374865,-6.737431280764423e-6,-1.9316573595337173e-8,-0.0016782413530992905,-6.445394475960026e-6,-1.907219462969039e-8,-0.001678080222805157,-6.193862700986028e-6,-1.8861571689255484e-8,-0.0016779584103784654,-6.008506027515523e-6,-1.8706342929766363e-8,-0.001677845249146384,-5.906093833141004e-6,-1.8620715185890165e-8,-0.0016777038192801804,-5.890290612856807e-6,-1.8607914310898255e-8,-0.0016774958004093384,-5.947719194763358e-6,-1.8656841222782147e-8,-0.0016771890493794792,-6.04551842846217e-6,-1.873997969081269e-8,-0.001676767832841618,-6.132885965309012e-6,-1.8814675758844495e-8,-0.0016762435242489034,-6.149771262434435e-6,-1.8830466334363702e-8,-0.0016756602448421592,-6.044400624246342e-6,-1.8743841862040513e-8,-0.001675087945535953,-5.795520152856072e-6,-1.8536922752685177e-8,-0.001674600133436057,-5.427392994706577e-6,-1.8229981102522346e-8,-0.0016742451149479186,-5.004926323171685e-6,-1.7877295972549893e-8,-0.0016740276746855878,-4.608399079730942e-6,-1.7546004506771972e-8,-0.0016739119980301556,-4.302510944871832e-6,-1.729026756861099e-8,-0.0016738412334485694,-4.117301795986611e-6,-1.7135338860309113e-8,-0.0016737597260480786,-4.047201977927108e-6,-1.7076725758927597e-8,-0.0016736272940627243,-4.062129813392705e-6,-1.708939796436854e-8,-0.0016734236526182423,-4.121225593287399e-6,-1.7139232302019368e-8,-0.0016731464204356393,-4.183527382690121e-6,-1.719194905092986e-8,-0.001672806667024793,-4.214324596648135e-6,-1.721846074771176e-8,-0.0016724243936852225,-4.1882372375009135e-6,-1.7197481453770475e-8,-0.0016720247121886067,-4.090499672781078e-6,-1.71166177315317e-8,-0.001671634560924054,-3.9173958791691575e-6,-1.697273167292582e-8,-0.0016712796064216253,-3.676148262014399e-6,-1.677183719774153e-8,-0.0016709811132979546,-3.3841381804794744e-6,-1.6528438089025636e-8,-0.001670752839878428,-3.067097445950772e-6,-1.626401154436992e-8,-0.0016705983902454557,-2.755995668689129e-6,-1.6004410253319553e-8,-0.0016705096420609104,-2.4827410471397807e-6,-1.5776279333381472e-8,-0.0016704667555038147,-2.2751486697532836e-6,-1.5602864533974782e-8,-0.001670440054529566,-2.151829226592785e-6,-1.5499751063543376e-8,-0.001670393800312215,-2.117817669325008e-6,-1.5471212409242127e-8,-0.001670291584102462,-2.1617204405963794e-6,-1.5507814775575798e-8,-0.0016701029794063543,-2.2550054075283997e-6,-1.5585801952800447e-8,-0.0016698110099757678,-2.354258371242796e-6,-1.5668961170856538e-8,-0.0016694193436379667,-2.4075797922360825e-6,-1.5713962061550806e-8,-0.0016689568880535386,-2.3659216383981152e-6,-1.5679837674904023e-8,-0.001668476255894404,-2.198389705642687e-6,-1.5540770761251108e-8,-0.0016680427111036224,-1.9070635849955495e-6,-1.5298448763090533e-8,-0.0016677138985701416,-1.5331708742942751e-6,-1.49871845626283e-8,-0.001667517861434114,-1.147223731015582e-6,-1.4665690841976024e-8,-0.0016674416245268775,-8.243545513833562e-7,-1.4396566986045408e-8,-0.0016674379465091208,-6.170824570407865e-7,-1.4223645290633774e-8,-0.0016674458929825874,-5.401446955353702e-7,-1.415932767755485e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json
new file mode 100644
index 0000000..ddc7d4d
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":20000,"numberOfSamples":1000,"samples":[0.002920358133904192,-6.784113942412794e-6,1.9052440314477163e-8,0.0029206413912713745,-6.613636446664559e-6,1.880279195741177e-8,0.0029208307139081857,-6.4248857259363685e-6,1.8526799455172666e-8,0.002920930147853429,-6.259580496894272e-6,1.8285299846459358e-8,0.002920958301557765,-6.151401288497133e-6,1.8127384394993633e-8,0.002920943527534336,-6.121517965926748e-6,1.8083876197142136e-8,0.002920918375602291,-6.176714362040785e-6,1.816459054828576e-8,0.0029209142523147777,-6.309966452545619e-6,1.8359183512205728e-8,0.0029209570493570875,-6.502919273456435e-6,1.864078390277559e-8,0.0029210641805222245,-6.729529878146821e-6,1.8971329337261025e-8,0.0029212431239192664,-6.960111764971586e-6,1.9307474224319167e-8,0.0029214911994797127,-7.165144308668532e-6,1.960613535377138e-8,0.002921796120285953,-7.318617634903727e-6,1.982935162046132e-8,0.002922137007124233,-7.4010933087209115e-6,1.994874542519259e-8,0.0029224858842140738,-7.402792330024526e-6,1.9950053694911065e-8,0.0029228100891597296,-7.3269133160290385e-6,1.9838013786501703e-8,0.0029230765056806078,-7.192875581754198e-6,1.9641124744988003e-8,0.002923258593947595,-7.038021661925838e-6,1.941411030247615e-8,0.0029233461420444737,-6.914897975233613e-6,1.9233867338703342e-8,0.0029233550561071457,-6.88082642372724e-6,1.9184132872670825e-8,0.002923331035256764,-6.979157664713172e-6,1.9328047777690732e-8,0.002923340142385916,-7.2183869507838524e-6,1.9677702094935728e-8,0.002923445583922481,-7.561828631160178e-6,2.0179192009197127e-8,0.002923681317946548,-7.937980661899995e-6,2.072789220706034e-8,0.0029240384097172193,-8.268180631197756e-6,2.1208898937220332e-8,0.0029244717828463846,-8.495446917109097e-6,2.1539128515592525e-8,0.0029249206337382287,-8.5993447870362e-6,2.168897594018406e-8,0.0029253292642615033,-8.593866031641322e-6,2.1679150221309016e-8,0.002925659785723746,-8.515407336314436e-6,2.1563040883823154e-8,0.0029258958667452545,-8.409144036535884e-6,2.140676187245665e-8,0.0029260405842169023,-8.318330424117874e-6,2.1273515340970926e-8,0.0029261116369550147,-8.277597083016847e-6,2.1213831819462888e-8,0.0029261360482877165,-8.309529221173803e-6,2.1260608728115165e-8,0.0029261452014683505,-8.42340926017503e-6,2.142729184107828e-8,0.002926170313882796,-8.615486024606374e-6,2.1708269585437497e-8,0.00292623844165663,-8.870566448345604e-6,2.2081201504360447e-8,0.00292636924853009,-9.164729529600066e-6,2.2511001728707966e-8,0.0029265727710682966,-9.46889441648262e-6,2.295507952203869e-8,0.0029268483980316373,-9.752900430721535e-6,2.336931848773817e-8,0.0029271851539575938,-9.989600330613871e-6,2.371405611551756e-8,0.0029275631112714875,-1.0158516530347245e-5,2.3959412562508196e-8,0.002927955664309901,-1.0248883948905652e-5,2.408973052847181e-8,0.002928332543885939,-1.0262052169211477e-5,2.4107097524156514e-8,0.002928663659626732,-1.0213176614852856e-5,2.4033835922844377e-8,0.002928924086482032,-1.0131859571605514e-5,2.391343414198871e-8,0.002929100469893201,-1.006068720901442e-5,2.380835533385682e-8,0.00292919825272032,-1.0049779074946679e-5,2.3791978424671676e-8,0.0029292472514429032,-1.0145544621233506e-5,2.3932078427797663e-8,0.0029293008561212352,-1.0374107175155202e-5,2.4266580620660107e-8,0.0029294238469290295,-1.0725024417737487e-5,2.4779841229322424e-8,0.002929669111734987,-1.114611883277768e-5,2.539521780426727e-8,0.0029300535325597157,-1.1558053316444333e-5,2.599647534430263e-8,0.0029305485124082784,-1.1884615009568598e-5,2.647210161222967e-8,0.0029310923955805034,-1.2081611605397568e-5,2.675757842754958e-8,0.002931616304399638,-1.2148069338781219e-5,2.6851763811636517e-8,0.002932067285150511,-1.2117575796211164e-5,2.6804177118692685e-8,0.002932418917621506,-1.2040100109443465e-5,2.6688285414068273e-8,0.002932670230039864,-1.1965464765100921e-5,2.657720810322275e-8,0.0029328387680504554,-1.1933289258766363e-5,2.6528961772784398e-8,0.00293295270881014,-1.196897681852962e-5,2.658062017342903e-8,0.002933044376699607,-1.2083490982675024e-5,2.67480469420976e-8,0.0029331455921541476,-1.2274805413081184e-5,2.7028061070784242e-8,0.002933284292138651,-1.2529877406152909e-5,2.7401345594697467e-8,0.00293348183921598,-1.2826952297089921e-5,2.7835835906596038e-8,0.0029337508490475143,-1.3138354603080276e-5,2.829083170402535e-8,0.002934093645838865,-1.3433894030281315e-5,2.872201713802254e-8,0.0029345016544849406,-1.3684880135773215e-5,2.908736254701938e-8,0.0029349561406361926,-1.386840837531521e-5,2.935340201831078e-8,0.002935430486740117,-1.3971275110489517e-5,2.95009506018706e-8,0.002935893835760189,-1.3992889279387817e-5,2.9529348563241594e-8,0.002936315747796631,-1.3946693107954746e-5,2.9458526641335536e-8,0.0029366714399644074,-1.3859725730502529e-5,2.9328347332084718e-8,0.0029369471463227275,-1.3770076163005065e-5,2.919483182596872e-8,0.0029371450608840764,-1.3721886782902614e-5,2.912277265954847e-8,0.002937286864066753,-1.3757394229001907e-5,2.917400350300773e-8,0.0029374138979444495,-1.3905986529102212e-5,2.9391340967481903e-8,0.002937581299334286,-1.4172039349156543e-5,2.9780814874648412e-8,0.002937844163109093,-1.45262281968288e-5,3.029905020497397e-8,0.0029382377175291947,-1.4907319198974039e-5,3.085599616240686e-8,0.0029387598782889463,-1.5239082205155629e-5,3.13397558100923e-8,0.0029393676298225253,-1.5457827043506526e-5,3.165695446938089e-8,0.002939992216838139,-1.5536378976067384e-5,3.1767915909756623e-8,0.0029405653190518453,-1.5490797301223943e-5,3.169654522724492e-8,0.002941041254771594,-1.536815347138079e-5,3.151235350452084e-8,0.00294140542344543,-1.5225670745632641e-5,3.129971116966001e-8,0.0029416699353257774,-1.511314588614597e-5,3.113191036723647e-8,0.002941863403875871,-1.5063955018859357e-5,3.105791466104839e-8,0.002942020994539501,-1.5093505935668198e-5,3.110013611490886e-8,0.002942177366646585,-1.520170158147927e-5,3.125814014183412e-8,0.0029423625508156873,-1.537654151057894e-5,3.1514004634474597e-8,0.002942599690849947,-1.559743059921687e-5,3.183721614696178e-8,0.00294290359336924,-1.5838011990550073e-5,3.2188849522134435e-8,0.00294327957060671,-1.606891948600009e-5,3.252562907878252e-8,0.002943722566359027,-1.626091105834113e-5,3.2804552667574874e-8,0.0029442169460562008,-1.6388674978272435e-5,3.2988495583917805e-8,0.002944737613991192,-1.643514977217652e-5,3.3052553288382284e-8,0.002945253028492552,-1.6395599116742716e-5,3.299000825108424e-8,0.0029457301748656087,-1.6280316984019043e-5,3.2816276383530096e-8,0.0029461409054937337,-1.6114844458962526e-5,3.2569189442586106e-8,0.002946468467779173,-1.59369584836108e-5,3.230452078197805e-8,0.0029467127007430827,-1.5790452065963385e-5,3.20867790313752e-8,0.002946892484190752,-1.571653783339316e-5,3.19765091292342e-8,0.0029470444074099875,-1.574421226294738e-5,3.201610119609517e-8,0.00294721700040216,-1.5881334913556607e-5,3.2216717921521556e-8,0.002947460426363542,-1.6108825234197094e-5,3.2549869520431156e-8,0.002947812788728661,-1.6380947123874963e-5,3.294795449427606e-8,0.002948286406491707,-1.663423983095662e-5,3.3317466246604255e-8,0.0029488597757889802,-1.6805051579412595e-5,3.356478318315856e-8,0.0029494809972528905,-1.6850594771345913e-5,3.362711592054566e-8,0.0029500837834087173,-1.6764027436157334e-5,3.3494691584581735e-8,0.002950609547099543,-1.65754022846451e-5,3.321214488618771e-8,0.0029510248489415226,-1.6338277873894157e-5,3.285874310463184e-8,0.002951326908519711,-1.6110067758768604e-5,3.251932528889389e-8,0.002951537740617979,-1.5935923031543694e-5,3.226045946019777e-8,0.002951692897861342,-1.5841154803625142e-5,3.2119268917177497e-8,0.0029518308167177263,-1.5831373922113136e-5,3.210371527010424e-8,0.002951985680243071,-1.5896753371837802e-5,3.219898309769699e-8,0.0029521838394617654,-1.6017149276703177e-5,3.237510141211502e-8,0.0029524425171660266,-1.6166416508957604e-5,3.259333287301716e-8,0.002952769476479237,-1.631566760743691e-5,3.281097659429368e-8,0.0029531628666808734,-1.6435949662826805e-5,3.298530817637135e-8,0.002953611072809355,-1.6501010877409013e-5,3.307765926789581e-8,0.0029540929521073237,-1.6490693620487103e-5,3.305842467294873e-8,0.002954579264429746,-1.639499922671663e-5,3.291305556929234e-8,0.00295503617946976,-1.6218085914775832e-5,3.264794315872196e-8,0.0029554312636725514,-1.598068794654785e-5,3.2293958485677294e-8,0.002955741283648492,-1.5719093070127868e-5,3.1904895652031e-8,0.002955959806034109,-1.547937573783238e-5,3.154889715991773e-8,0.0029561017019983917,-1.5307268455907255e-5,3.129343797151466e-8,0.002956202124345455,-1.5236171399037398e-5,3.118759456372629e-8,0.002956309344895545,-1.5277053681785616e-5,3.124717312307237e-8,0.002956473061121083,-1.5413664099591182e-5,3.144774573045378e-8,0.002956731321048645,-1.56048785559379e-5,3.1728248939181924e-8,0.00295709965139376,-1.5793981380019647e-5,3.20047831722283e-8,0.002957565526219128,-1.592284518104132e-5,3.2191570296512827e-8,0.002958090281759539,-1.5947524626471783e-5,3.2223937815342005e-8,0.0029586188407144266,-1.5850738642942996e-5,3.2076690446522256e-8,0.002959094945026436,-1.5646720190761735e-5,3.177121976954928e-8,0.002959476848073268,-1.5376083073574004e-5,3.136786811924238e-8,0.0029597476091094625,-1.5092533249955837e-5,3.094622473963542e-8,0.0029599165389014807,-1.4847001851064014e-5,3.058161120537158e-8,0.0029600126576895124,-1.4675368085643121e-5,3.032691574396036e-8,0.0029600742944759875,-1.4593152680899354e-5,3.020479859533819e-8,0.0029601393336397405,-1.4596748310243467e-5,3.020960605628144e-8,0.002960238698290419,-1.4668406120361078e-5,3.031483113270092e-8,0.002960393348094185,-1.4782054688900286e-5,3.048176038556993e-8,0.0029606137208240614,-1.4908213038661743e-5,3.0666732803764704e-8,0.002960900307724539,-1.5017561814104221e-5,3.082638893027108e-8,0.002961244434757364,-1.50835587775595e-5,3.092151102287129e-8,0.0029616289196745093,-1.508481954343969e-5,3.092053838966425e-8,0.0029620288994349014,-1.5007922270276185e-5,3.080373072655211e-8,0.002962413625758523,-1.485083932757977e-5,3.056826258788275e-8,0.0029627502369207145,-1.4626387490437281e-5,3.023332794121676e-8,0.002963010182597418,-1.4364071234967201e-5,2.9842834228472035E-08,0.002963177767764606,-1.4107920694885702e-5,2.9462135061082662e-8,0.002963258245024794,-1.390835698351417e-5,2.9165907356940043e-8,0.002963281197327158,-1.3808595017261191e-5,2.9017964910745684e-8,0.0029632955592347656,-1.3829869002871433e-5,2.9049396981577167e-8,0.0029633562901483323,-1.396211303207011e-5,2.9244867118890364e-8,0.002963507429295757,-1.4165122782118485e-5,2.9544476640865564e-8,0.0029637685076608447,-1.4380196230406393e-5,2.986111941278739e-8,0.0029641293995320965,-1.4547336536681909e-5,3.010599812437667e-8,0.0029645544477331213,-1.462147944059388e-5,3.021262159737794e-8,0.002964993199433165,-1.4582947790407866e-5,3.015220993420224e-8,0.002965393786237881,-1.4440252912374524e-5,2.993775541428279e-8,0.002965715263846332,-1.4225700000439636e-5,2.9617431791449873e-8,0.002965936105661564,-1.3985740295725363e-5,2.926023813664994e-8,0.0029660572013795127,-1.3768956215185547e-5,2.893816297894991e-8,0.0029660991821764673,-1.361495218959358e-5,2.8709729777681658e-8,0.0029660954822132313,-1.3546940317984253e-5,2.8609061319606824e-8,0.0029660836753954115,-1.3569374678669404e-5,2.86424548981107e-8,0.002966097715672726,-1.3670152439685494e-5,2.8791723939980673e-8,0.002966162758787371,-1.382559151959131e-5,2.9021622975413763e-8,0.002966292909415142,-1.4006141463460001e-5,2.9288313696922994e-8,0.0029664912327432187,-1.4181368889154244e-5,2.9546719679842586e-8,0.00296675098439865,-1.432364071392131e-5,2.975594063607446e-8,0.0029670571768570203,-1.441068763053631e-5,2.988302426452729e-8,0.0029673880824924595,-1.4427641005829092e-5,2.990599124607975e-8,0.0029677168251591012,-1.4369146872198044e-5,2.9817001755657374e-8,0.002968013691011178,-1.4241810907193253e-5,2.962601250879183e-8,0.0029682500709710805,-1.4066513065220714e-5,2.93642059457502e-8,0.002968404731954602,-1.387910107568484e-5,2.9084963591962518e-8,0.002968471978193223,-1.3727039399383037e-5,2.88588007731629e-8,0.002968469059433979,-1.3659767445614165e-5,2.875897632722551e-8,0.0029684378958154877,-1.3713145157645224e-5,2.8838395498620046e-8,0.00296843646941631,-1.3893353069001035e-5,2.9105800690051132e-8,0.0029685202671800416,-1.4169383669450605e-5,2.9514779524273305e-8,0.0029687215722676882,-1.4480741544933563e-5,2.997532983204709e-8,0.0029690374925616814,-1.4758063993347154e-5,3.038452227517716e-8,0.002969432550313911,-1.494625005415047e-5,3.0660807023103234e-8,0.0029698527534371528,-1.501941615613648e-5,3.076614564288683e-8,0.002970242975131316,-1.4983590593674082e-5,3.070991787329774e-8,0.002970560707010411,-1.486978332026129e-5,3.053852833456252e-8,0.002970783380041674,-1.4722598896256202e-5,3.031840881526067e-8,0.0029709096528671933,-1.4588664344004444e-5,3.01187930361603e-8,0.0029709563531596737,-1.4507263299708571e-5,2.999782950169233e-8,0.0029709528196634203,-1.450412607323851e-5,2.9993430059943106e-8,0.0029709340930672533,-1.4588613765477793e-5,3.011917526326649e-8,0.0029709342235076834,-1.4754157039491757e-5,3.036503994043903e-8,0.0029709808089967682,-1.4981337496558506e-5,3.070201327711546e-8,0.0029710914938153535,-1.524256500555707e-5,3.1089054340748793e-8,0.0029712726180356206,-1.5507206205397086e-5,3.1480689014010646e-8,0.0029715197167699482,-1.5746211713835314e-5,3.1833846061620287e-8,0.002971819217195222,-1.5935676545529305e-5,3.211310994113541e-8,0.0029721506391493777,-1.6059298169857467e-5,3.2294356226821274e-8,0.002972488915422919,-1.6110085669579795e-5,3.236730284468479e-8,0.0029728068475521232,-1.609171171330991e-5,3.233754856855953e-8,0.0029730780491342918,-1.6019684593364873e-5,3.2228331099957483e-8,0.002973280996517472,-1.5922014544477006e-5,3.2081488017266414e-8,0.002973404663571169,-1.5838170077771026e-5,3.195582334149546e-8,0.0029734552005521004,-1.581431674792034e-5,3.1919928221359786e-8,0.002973461188362297,-1.589302000644207e-5,3.2036819078499595e-8,0.0029734728689441363,-1.609792381140514e-5,3.234121094806937e-8,0.0029735507610109523,-1.6418860094304986e-5,3.281753040259766e-8,0.002973744280704623,-1.6807320664665265e-5,3.3393348896120576e-8,0.0029740698756861514,-1.7189700640362698e-5,3.395915574472174e-8,0.002974502213153519,-1.7494403406110863e-5,3.4408643234550394e-8,0.002974984560957685,-1.767802825408724e-5,3.4677597890506306e-8,0.0029754513730213712,-1.773672456282881e-5,3.476073805538473e-8,0.002975849730807777,-1.7700253301847003e-5,3.470280180238341e-8,0.0029761508530331345,-1.7616516953682456e-5,3.4575409590022556e-8,0.0029763511916333146,-1.7535807952942615e-5,3.445351817065031e-8,0.0029764671850589274,-1.7499734982786542e-5,3.439891544803893e-8,0.002976527814731713,-1.753553605886131e-5,3.445182277720747e-8,0.0029765674333753333,-1.7654482487030005e-5,3.462863214504655e-8,0.0029766197783471023,-1.785285028144174e-5,3.4923452338110174e-8,0.002976713303471049,-1.8114495901758313e-5,3.531200044507124e-8,0.00297686786306883,-1.841450460826479e-5,3.575704849602197e-8,0.002977092820345906,-1.8723439945705067e-5,3.6214741069552453E-08,0.0029773865940886136,-1.9011730919729806e-5,3.6641106825301627e-8,0.00297773758195352,-1.9253744086145604e-5,3.6998098021908325e-8,0.002978126225410339,-1.9431077092030192e-5,3.725847234837322e-8,0.002978527778364898,-1.953481608938666e-5,3.740914085341509e-8,0.0029789154040244796,-1.9566826718393777e-5,3.7453087807647996e-8,0.002979263474936315,-1.9540223734977267e-5,3.741007038668588e-8,0.002979551126528603,-1.9479037319080024e-5,3.731610210216535e-8,0.002979766242014358,-1.9416859969519788e-5,3.722137847792964e-8,0.0029799099497124348,-1.9393715173435276e-5,3.7185523694292244e-8,0.002980000915971834,-1.94498533312271e-5,3.7268276541520824e-8,0.0029800772524500073,-1.9615566721707554e-5,3.7514326950814606e-8,0.002980192469529219,-1.9898167604817833e-5,3.7934040287157073e-8,0.0029804022602219083,-2.0271164712515565e-5,3.8487521814506124e-8,0.0029807434701728474,-2.067424132501533e-5,3.9084720785291444e-8,0.0029812147089178787,-2.1030261025836366e-5,3.961077233026522e-8,0.0029817719928732045,-2.127449949752043e-5,3.99694784583061e-8,0.0029823449666828935,-2.1379992430783766e-5,4.0121037663042906e-8,0.0029828645165091085,-2.136410513008704e-5,4.009182899623436e-8,0.0029832854451143304,-2.127531976246566e-5,3.995464665032265e-8,0.002983594498668351,-2.1171712511966522e-5,3.97964527218785e-8,0.0029838054954291746,-2.1103248487216302e-5,3.9691834147374094e-8,0.002983948836829765,-2.110276132606735e-5,3.968953147631429e-8,0.002984061290257191,-2.1184288397485705e-5,3.981006008442894e-8,0.002984178513731084,-2.1345484561751207E-05,4.004945855912969e-8,0.00298433040769511,-2.157146104983014e-5,4.0385128619668554e-8,0.002984538433971821,-2.183875045296736e-5,4.078179890719198e-8,0.002984814157245484,-2.2119128743535838e-5,4.1197228817699106e-8,0.0029851587068223267,-2.2383338100873876e-5,4.158774803164346e-8,0.0029855631058775885,-2.260472386163859e-5,4.191366897386889e-8,0.002986009558291577,-2.2762699849510053e-5,4.214444460091879e-8,0.002986473810408079,-2.2845709776562213e-5,4.226307152736928e-8,0.0029869284555065143,-2.285321248440732e-5,4.226903134195116e-8,0.0029873468009023675,-2.279640960153469e-5,4.217934987696174e-8,0.0029877069362470323,-2.2697618488155953e-5,4.202762496290873e-8,0.002987995706883981,-2.2588196005956238e-5,4.186087368514205e-8,0.0029882122724941918,-2.250493424394035e-5,4.173407992678916e-8,0.002988370845250907,-2.2484777608857293e-5,4.170223881865493e-8,0.0029885017936435655,-2.255756728162393e-5,4.180950622118746e-8,0.002988649508545319,-2.2737002269993502e-5,4.20757789848222e-8,0.002988864944534272,-2.3011660125789477e-5,4.248345478531366e-8,0.0029891917531914853,-2.3340375925996207e-5,4.2970713042447454e-8,0.0029896486141179545,-2.3657833305475466e-5,4.3439950290240724e-8,0.002990215930999584,-2.3893473135528555e-5,4.378597223794274e-8,0.0029908371871804683,-2.399812996226874e-5,4.393568517521914e-8,0.0029914382467285117,-2.396417191820179e-5,4.3878147729951906e-8,0.0029919551613743003,-2.38265851199188e-5,4.3666186218943454e-8,0.0029923547556799392,-2.364535922564181e-5,4.33899815622375e-8,0.0029926388924618567,-2.34815530183942e-5,4.314111317342226e-8,0.0029928352743501543,-2.3379858232251807e-5,4.298635560434982e-8,0.002992983643000855,-2.3362211966869825e-5,4.2958145653724355e-8,0.002993124239325345,-2.3429729514789833e-5,4.305762336091702e-8,0.0029932908205783236,-2.3568260581625195e-5,4.3263117748307686e-8,0.0029935075467194595,-2.3754218892099406e-5,4.353897939933425e-8,0.002993788115402275,-2.3959322132927218e-5,4.3842700238288005e-8,0.002994135865131543,-2.415427368613513e-5,4.413039745178603e-8,0.002994544317604473,-2.431187474329782e-5,4.436143642962751e-8,0.0029949981369148688,-2.4409940834154676e-5,4.4502773677267694e-8,0.002995474733920963,-2.4434159363146072e-5,4.453322269139798e-8,0.002995946867852737,-2.438065412063379e-5,4.444727962470359e-8,0.0029963863997792425,-2.4257633800533217e-5,4.425756592263305e-8,0.0029967688850502656,-2.4085455016201706e-5,4.399488097416399e-8,0.002997078338300538,-2.3894673268282683e-5,4.370522458009922e-8,0.002997311349129843,-2.3721945852451404e-5,4.344359182276227e-8,0.002997479656226587,-2.360404297666528e-5,4.32649398235654e-8,0.0029976103593761477,-2.357065305448074e-5,4.3213385803306306e-8,0.002997743110787153,-2.3636926496027646e-5,4.3311086910764544e-8,0.002997923748088096,-2.379704664473801e-5,4.354874311053949e-8,0.0029981942175954005,-2.4020889171051923e-5,4.388077348084879e-8,0.0029985799058661606,-2.4256592745038067e-5,4.422930981774514e-8,0.0029990778745615423,-2.444143335305884e-5,4.450051619084297e-8,0.002999651934402648,-2.4520419116148653e-5,4.461236561595702e-8,0.003000240119555401,-2.4466536425871935e-5,4.452486712152954e-8,0.0030007744382348467,-2.4292342453891288e-5,4.4257372821343864e-8,0.0030012043836071256,-2.4045254021272564e-5,4.388146492212079e-8,0.003001512146798215,-2.3788596603881732E-05,4.3492440534199405e-8,0.003001713011004348,-2.3579216292932016e-5,4.3175608587979206e-8,0.0030018440201570076,-2.345253767991309e-5,4.298382851303703e-8,0.0030019492490419297,-2.3418849803166555e-5,4.293202980731309e-8,0.0030020683571267115,-2.3467794115789163e-5,4.300412504387121e-8,0.003002230577040951,-2.3575924418412295e-5,4.3164515275253525e-8,0.0030024530481396073,-2.371369072928725e-5,4.336864156691746e-8,0.0030027414546316424,-2.3850507219765965e-5,4.357057053753451e-8,0.0030030914014577796,-2.395813305179184e-5,4.3728004665977624e-8,0.003003489836964812,-2.4013129247926298e-5,4.3805913400348664e-8,0.003003916505986112,-2.3999045197511412e-5,4.3779791639210484e-8,0.0030043458018004154,-2.3908648392456543e-5,4.3639009503235175e-8,0.003004749546491452,-2.3746015567883387e-5,4.338995688522113e-8,0.0030051010544452283,-2.3527756377723387e-5,4.305786620408989e-8,0.003005380278727441,-2.3282359290256304e-5,4.268578367873625e-8,0.0030055791218540325,-2.3046814799346892e-5,4.232942511550203e-8,0.003005705403471987,-2.2860300990568903e-5,4.2047613637055405e-8,0.0030057838269298923,-2.2755768795899834e-5,4.188959157506121e-8,0.0030058528292368726,-2.275134395340437e-5,4.188212374752424e-8,0.003005957307061821,-2.2843946110056914e-5,4.2020014794074985E-08,0.003006138413427418,-2.300724171618979e-5,4.226319699714995e-8,0.0030064225790959894,-2.319527741556905e-5,4.254234844837243e-8,0.003006812562702178,-2.335201743558618e-5,4.277330694714285e-8,0.0030072836012702583,-2.3425444976355578e-5,4.2878234687331705e-8,0.003007787264335132,-2.3382901257872224e-5,4.280856410095554e-8,0.003008263689228249,-2.3222450315454287e-5,4.2561953877304193e-8,0.0030086592071474436,-2.2974830200955383e-5,4.218511547518296e-8,0.0030089426676550976,-2.26937486182808e-5,4.17591305405803e-8,0.00300911333844383,-2.2438134195979213e-5,4.137267939823414e-8,0.003009197487585295,-2.225432969879038e-5,4.1095226879594374e-8,0.003009236757661162,-2.216547948200621e-5,4.0961121500672567e-8,0.003009274709149118,-2.217043771176245e-5,4.09681037873079e-8,0.0030093468102407217,-2.224960297551781e-5,4.108625065125137e-8,0.003009475717436156,-2.2373205783984607e-5,4.1270546851323725e-8,0.003009670815179887,-2.250862585044295e-5,4.147189797251425e-8,0.0030099299700386954,-2.2625428795493783e-5,4.164463699013084e-8,0.00301024187402901,-2.269838136100306e-5,4.1750971465696804e-8,0.003010588197802463,-2.2709282253166442e-5,4.17636812926794e-8,0.0030109454772800953,-2.2648401738654642e-5,4.1668279995880246e-8,0.0030112871514783373,-2.2515993789587058e-5,4.1465320020488957e-8,0.003011586410402015,-2.2323777967550487e-5,4.1172650945728414e-8,0.003011820354517727,-2.2095615453953176e-5,4.082642765490463e-8,0.0030119753682766987,-2.1866121724890676e-5,4.0478962804724885e-8,0.0030120526329220835,-2.167596603147096e-5,4.019155827324615e-8,0.003012071619005174,-2.1563470526289128e-5,4.002177521312465e-8,0.0030120689879420764,-2.1553983387326334e-5,4.0007412510859045e-8,0.0030120914835277484,-2.1650539471334874e-5,4.015251477306536e-8,0.003012183981443884,-2.1829957093484467e-5,4.0421644155871945e-8,0.003012376436940448,-2.2046872823385574e-5,4.074612539538994e-8,0.003012674385510726,-2.2245060636632923e-5,4.104120937557746e-8,0.003013056385483303,-2.237249037808146e-5,4.122877520759659e-8,0.003013479206572159,-2.2395363336080645e-5,4.125840285038834e-8,0.00301388907552939,-2.2307009988112173e-5,4.112064949092303e-8,0.003014235716569667,-2.21292539477236e-5,4.0848957479960844e-8,0.0030144852458368573,-2.1905904722336058e-5,4.0509715506145036e-8,0.003014628140393211,-2.1690273931464643e-5,4.0183354013727575e-8,0.0030146798861370155,-2.1530670765035162e-5,3.9942465173289727e-8,0.003014674513909391,-2.1458647516230403e-5,3.9834154839566405e-8,0.0030146539150070514,-2.1483480978725524e-5,3.9871866653527925e-8,0.003014657045850174,-2.159355446238517e-5,4.003762590554032e-8,0.0030147123189946208,-2.1762610361229233e-5,4.029158028075859e-8,0.0030148344079461886,-2.1957660138997936e-5,4.0583952504102195e-8,0.003015024723893025,-2.214588593896058e-5,4.0865392615269084e-8,0.0030152739036193445,-2.22993320272481e-5,4.109395623141755e-8,0.0030155648211872598,-2.239750335835605e-5,4.123893927793968e-8,0.0030158753159103555,-2.242862410171888e-5,4.1282740545661414e-8,0.0030161804959735242,-2.239035571976067e-5,4.122196425411615e-8,0.0030164549748184135,-2.2290484655788065e-5,4.106850249505057e-8,0.0030166756785176938,-2.2147566876471484e-5,4.085053467582822e-8,0.0030168257902463656,-2.1990840651876128e-5,4.0612367627877493e-8,0.0030168998356597245,-2.185809576971141e-5,4.041113557692705e-8,0.003016908801918456,-2.1790004412026398e-5,4.030814374624823e-8,0.0030168827390098687,-2.1820318277313286e-5,4.035402021045058e-8,0.0030168675107474373,-2.19637983748077e-5,4.057054444845606e-8,0.003016913871536386,-2.220687703617631e-5,4.09366942603126e-8,0.003017061280745224,-2.2507121073764624e-5,4.138801109760418e-8,0.0030173232653145413,-2.28042122748035e-5,4.1833304318833444e-8,0.0030176816547766365,-2.3038752114974032e-5,4.218308051823787e-8,0.003018092461901088,-2.317060860472061e-5,4.2377204037070425e-8,0.0030185000617629827,-2.3189358211647577e-5,4.240056434796237e-8,0.0030188531890023565,-2.3114278349446322e-5,4.2282916648184983e-8,0.0030191172695145925,-2.298608274263823e-5,4.2086230161827244e-8,0.003019280521670172,-2.2854616393563075e-5,4.188596434454325e-8,0.00301935377876645,-2.27664496809722e-5,4.1752283274555145e-8,0.0030193653932179577,-2.2755137035095014e-5,4.173540981919782e-8,0.0030193531828910203,-2.2835689436507088e-5,4.185743087774839e-8,0.003019355569264338,-2.3003756094996915e-5,4.211123646364793e-8,0.003019403958407845,-2.323899690414335e-5,4.246574371735947e-8,0.003019517875462904,-2.3511172447957385e-5,4.2875145551518413e-8,0.003019703373553423,-2.3786991097561844e-5,4.328922423781491e-8,0.003019954219332213,-2.4036029761377636e-5,4.3662218358333147e-8,0.003020254766068992,-2.423482031971884e-5,4.395891153209101e-8,0.003020583367897793,-2.4369010761043288e-5,4.415784033020523e-8,0.0030209155492026242,-2.4434102956819604e-5,4.425239523927991e-8,0.0030212267021837735,-2.443546844269732e-5,4.4250868318591255e-8,0.0030214945520319145,-2.438812313993975e-5,4.417614262844354e-8,0.0030217018620748537,-2.4316298536123176e-5,4.406504030121207e-8,0.0030218398456035413,-2.4252307744576375e-5,4.396654725060574e-8,0.003021912331535931,-2.4233602777596313e-5,4.39372627104561e-8,0.0030219396761021347,-2.429662036167427e-5,4.4032012805518794e-8,0.0030219599100410016,-2.4466782499552282e-5,4.4288740896769435e-8,0.00302202361177359,-2.4746531459929342e-5,4.47105455738881e-8,0.003022180395983599,-2.5107010582484676e-5,4.525329764117915e-8,0.003022460057180725,-2.5490814286278737e-5,4.5829951905006934e-8,0.003022857627761485,-2.5828964736561783e-5,4.633626256410645e-8,0.003023332267934383,-2.6065721301283244e-5,4.668826880948124e-8,0.003023821927221237,-2.6178133626157623e-5,4.685181828073514e-8,0.0030242654527104103,-2.618060722133502e-5,4.6849397702988095e-8,0.00302462064736006,-2.6115003315723564e-5,4.674500325784846e-8,0.003024872054652819,-2.6034210741007566e-5,4.661907867346306e-8,0.003025029247398639,-2.5987096868666402e-5,4.654559337911846e-8,0.003025119674183166,-2.600869221520683e-5,4.657718713531259e-8,0.0030251798618585422,-2.6115962524536738e-5,4.6738915646380234e-8,0.003025247304514287,-2.6307892425086884e-5,4.702858653637406e-8,0.0030253540345252404,-2.6568373656992416e-5,4.742130825887169e-8,0.003025522180290973,-2.6870812112854194e-5,4.7876552038498893e-8,0.0030257616742353777,-2.718362842899639e-5,4.834647617031556e-8,0.0030260701248843638,-2.7475754898200334e-5,4.878418797216237e-8,0.003026434531440565,-2.7721296131052857e-5,4.915072369570908e-8,0.003026834267375794,-2.790282528074767e-5,4.941997646359749e-8,0.003027244652317317,-2.801310467185596e-5,4.958126578195143e-8,0.00302764045789911,-2.8055375984440208e-5,4.963976761859313e-8,0.0030279989828120874,-2.8042678247256376e-5,4.961548465878466e-8,0.003028302732030385,-2.7996614735003015e-5,4.9541371336797554e-8,0.0030285419382640503,-2.7945668380696642e-5,4.946074008271887e-8,0.0030287171664962805,-2.7922799028450726e-5,4.9423540183523226e-8,0.003028841979820805,-2.796162115926255e-5,4.948048077466765e-8,0.0030289448272879803,-2.8090202994150213e-5,4.967360897101288e-8,0.00302906808799766,-2.832216698757468e-5,5.002291747065914e-8,0.003029261393516597,-2.8646859820436187e-5,5.051165188848918e-8,0.0030295674732655794,-2.9023648863821986e-5,5.107788139765754e-8,0.0030300035036457318,-2.9387468552092513e-5,5.1622994265168756e-8,0.003030547654439084,-2.966892547984612e-5,5.204210187529804e-8,0.0030311419708281494,-2.9821700123341288e-5,5.226546402242462e-8,0.003031713429022907,-2.9841451121119933e-5,5.228710697781398e-8,0.0030322015269454838,-2.9764614366811912e-5,5.216297581619774e-8,0.003032576700297681,-2.964992539693665e-5,5.1982771928407634e-8,0.0030328427049061664,-2.95558177823456e-5,5.18354400080819e-8,0.0030330273738204275,-2.952483864326578e-5,5.178537523848844e-8,0.0030331699517057442,-2.9577898541893805e-5,5.1863748181959154e-8,0.0030333104138618784,-2.9715604944099784e-5,5.207074030425486e-8,0.003033482465717576,-2.9922976396352082e-5,5.238294189196952e-8,0.0030337098242709487,-3.017493755703473e-5,5.276185486031358e-8,0.0030340047066781646,-3.0441434203506502e-5,5.316170038656006e-8,0.0030343677318868385,-3.069201162682167e-5,5.353632168723621e-8,0.0030347889661070187,-3.089987345211356e-5,5.384526338775909e-8,0.0030352499978571756,-3.104524236184448e-5,5.405880170678398e-8,0.0030357268634388502,-3.111778908424594e-5,5.416158516454266e-8,0.0030361935715449567,-3.1117887001919675e-5,5.415451590233293e-8,0.003036625814699871,-3.105651407747209e-5,5.4054586154864e-8,0.003037004388893214,-3.095390233892545e-5,5.3892806738359834e-8,0.003037318044491069,-3.083722670992275e-5,5.3710656905416486e-8,0.0030375656938618433,-3.073753439132445e-5,5.355535566628204e-8,0.0030377579336559293,-3.068595891553895e-5,5.347403607373892e-8,0.0030379177300265737,-3.0709070813912385e-5,5.350663829087113e-8,0.00303807966723912,-3.0823076928323533e-5,5.367713979638666e-8,0.0030382864205653216,-3.102708512509555e-5,5.3983480616954495e-8,0.003038580787609243,-3.1297162733261364e-5,5.438876948576837e-8,0.0030389926926067358,-3.158502205672186e-5,5.481947606929273e-8,0.003039524072818,-3.1826340398447944e-5,5.517809779127173e-8,0.0030401396754807146,-3.196074975273588e-5,5.5373393880473416e-8,0.0030407732402690456,-3.1956872342941396e-5,5.5358273365942866e-8,0.0030413506216760183,-3.1827784431995975e-5,5.515324561172027e-8,0.0030418182463314066,-3.1625541651179424e-5,5.4838080988230775e-8,0.003042160215499455,-3.141800758364335e-5,5.4516451859117366e-8,0.003042396527409552,-3.126315753054347e-5,5.4276642795710085e-8,0.003042568426483442,-3.119410063882663e-5,5.416865946881467e-8,0.0030427219468042673,-3.121729790939866e-5,5.4201628447496637e-8,0.0030428965072263536,-3.131876817788899e-5,5.435349924198628e-8,0.0030431195875498325,-3.1472417249374476e-5,5.4583966139684054e-8,0.003043405671120528,-3.164719823662061e-5,5.48454888443154e-8,0.003043757278206,-3.181220441401584e-5,5.509103044165085e-8,0.0030441666670632966,-3.194016210578213e-5,5.527928024881129e-8,0.0030446177728978936,-3.2010055857858906e-5,5.537854846801234e-8,0.0030450884814295937,-3.200922767702134e-5,5.5369895852801475e-8,0.003045553386619406,-3.193493319092446e-5,5.524947681257876e-8,0.003045987115545042,-3.179510076572901e-5,5.502968803317016e-8,0.0030463680745412454,-3.1607871380829794e-5,5.473845618856727e-8,0.0030466821164058687,-3.139963516825679e-5,5.441621391559135e-8,0.0030469255028017037,-3.120163298944072e-5,5.4110664553357935e-8,0.003047106649642553,-3.1045429760949075e-5,5.3869815322197836e-8,0.003047246264489913,-3.0957724333207185e-5,5.373401644060654e-8,0.0030473756148905722,-3.0955076276420677e-5,5.372793333790556e-8,0.0030475327337165107,-3.10391075449408e-5,5.385333611732599e-8,0.0030477562593878016,-3.119291882112134e-5,5.408383161903094e-8,0.0030480767420623433,-3.138019112187306e-5,5.436371344206401e-8,0.003048506271394186,-3.154923496407961e-5,5.461427067933738e-8,0.003049029398017934,-3.164403612417949e-5,5.4750595244403097E-08,0.003049600741217892,-3.162181473782961e-5,5.470817249590223e-8,0.0030501546590933595,-3.147129459702184e-5,5.447053534930495e-8,0.0030506267199089275,-3.122124129326912e-5,5.408216609011085e-8,0.003050977543809847,-3.0931489493301834e-5,5.363475132421305e-8,0.0030512056349143645,-3.066970206362606e-5,5.323164358366911e-8,0.0030513427951945633,-3.048709541508865e-5,5.2950735410073135e-8,0.0030514375272195533,-3.0405493613713788e-5,5.2824725934812176e-8,0.0030515374213706445,-3.0418359774685625e-5,5.284287745599565e-8,0.003051677995809869,-3.050014466075965e-5,5.296553808075435e-8,0.0030518790092155215,-3.061696562449272e-5,5.314062781446654e-8,0.003052145625853913,-3.073469977610028e-5,5.3316031028704927e-8,0.0030524714707749288,-3.082377392153637e-5,5.344682144560079e-8,0.0030528417493476028,-3.086160174564249e-5,5.34988474804598e-8,0.0030532358836312897,-3.0833881042707114e-5,5.345060667689741e-8,0.003053629879526026,-3.0735485986035706e-5,5.3294565854492434e-8,0.0030539988364117142,-3.0571146292916206e-5,5.30382059792326e-8,0.0030543199507090837,-3.0355674406952507e-5,5.270438907050841e-8,0.0030545760956502454,-3.0113150877368533e-5,5.233010961195881e-8,0.00305475954547292,-2.9874438142143042e-5,5.1962653663563995e-8,0.003054874940487383,-2.967277780668974e-5,5.165280031939516e-8,0.0030549404324154324,-2.9537825570307475e-5,5.144563962738253e-8,0.0030549861390338404,-2.9489134143288323e-5,5.137059250576423e-8,0.0030550495976808005,-2.953061394193003e-5,5.143300630399881e-8,0.003055168710759939,-2.9647526534915528e-5,5.160970828560753e-8,0.0030553733364540553,-2.9807121158297693e-5,5.1850176986509324e-8,0.0030556770688369554,-2.9963521348213533e-5,5.208418350889287e-8,0.0030560711382057876,-3.0066914121891328e-5,5.223590149011024e-8,0.003056522783852153,-3.007606385331831e-5,5.224295582005858e-8,0.0030569803906741184,-2.9971466768568165e-5,5.207634125974998e-8,0.0030573862107332603,-2.9764480348069197e-5,5.1754164969916074e-8,0.0030576939719519337,-2.9497043921062268e-5,5.134105271121149e-8,0.0030578844960596806,-2.9229485363525857e-5,5.092940536552576e-8,0.0030579714726823846,-2.9020378842860718e-5,5.060856308901679e-8,0.00305799430929109,-2.890783769790072e-5,5.0436246780448754e-8,0.0030580024833647516,-2.8900743931462217e-5,5.042530128741445e-8,0.0030580398139917744,-2.8981793723107103e-5,5.0548579370877406e-8,0.0030581349144192635,-2.9117796452997896e-5,5.075489270553819e-8,0.0030582989710085853,-2.927092112731661e-5,5.0986296117823764e-8,0.00305852838098303,-2.9406906130383003e-5,5.1190589621726315e-8,0.00305880913029923,-2.9499417804318987e-5,5.132784410791377e-8,0.0030591209014314944,-2.9531615236497716e-5,5.1372652866946216e-8,0.003059440241717404,-2.949633831159525e-5,5.131434068941656e-8,0.00305974298908132,-2.9395907947313022e-5,5.1156659354477445e-8,0.0030600065090859636,-2.9241933794825013e-5,5.091753916282965e-8,0.00306021229511157,-2.9054948323373344e-5,5.062856693783168e-8,0.003060349177847135,-2.8863199511689882e-5,5.033312632870034e-8,0.003060416814008068,-2.8699745555567035e-5,5.008188395273282e-8,0.0030604284223485962,-2.8597283966096064e-5,4.992478512143156e-8,0.0030604111977471983,-2.858098323762389e-5,4.990002248696701e-8,0.0030604029204521956,-2.8660871126497475e-5,5.002240613766968e-8,0.0030604443802250266,-2.8826475438747818e-5,5.027527520898142e-8,0.0030605691021830185,-2.9046441406551585e-5,5.061009175503469e-8,0.00306079346737266,-2.927436144349517e-5,5.0955543464884993e-8,0.0030611106463299936,-2.945974872572592e-5,5.123445153963956e-8,0.003061490627398194,-2.9561147187201426e-5,5.1383839021491824e-8,0.0030618866932196325,-2.9557585511589545e-5,5.137235223398255e-8,0.0030622468460100747,-2.9455021239405097e-5,5.1209933881528055e-8,0.0030625273270125427,-2.9285654512983767e-5,5.0946554534423536e-8,0.0030627045011972953,-2.909970499319971e-5,5.065943900038011e-8,0.003062781223049597,-2.8951506243513924e-5,5.043168206571564e-8,0.0030627851170516554,-2.8884214842026012e-5,5.032886811317642e-8,0.003062759221135395,-2.8918582214671775e-5,5.038203695084455e-8,0.0030627487734678108,-2.9049687038960627e-5,5.0582911500186546e-8,0.0030627893702877065,-2.9251814457828465e-5,5.0891584468485985e-8,0.0030629003148716434,-2.9488179827505706e-5,5.1251525998749074e-8,0.0030630839037973016,-2.972103318011528e-5,5.160504457192073e-8,0.0030633288315558426,-2.9918997653759335e-5,5.190441062046527e-8,0.003063615124797014,-3.0060785653816723e-5,5.211739828811116e-8,0.003063918729338474,-3.013609360645597e-5,5.222854366679751e-8,0.003064214995878956,-3.014497667576545e-5,5.223815136496016e-8,0.0030644811540353513,-3.0096760320048008e-5,5.2160662139867385e-8,0.003064698316991432,-3.0009023509637796e-5,5.202315302953461e-8,0.0030648536429064674,-2.990656924730143e-5,5.1863784882354814e-8,0.0030649429933266646,-2.9819741475536308e-5,5.1729180727117875e-8,0.0030649738454125133,-2.9781167475517766e-5,5.166933721709507e-8,0.0030649674206902153,-2.98201748061254e-5,5.172897531156119e-8,0.0030649581828044383,-2.9955006804012056e-5,5.19355879701887e-8,0.0030649887015580467,-3.0184701153387606e-5,5.2287079973691934e-8,0.0030650993228122743,-3.048438554024296e-5,5.274472973817438e-8,0.0030653151426291397,-3.080799959377198e-5,5.3237545317571995e-8,0.0030656356436287177,-3.109971429626911e-5,5.36798936350581e-8,0.003066032397083313,-3.131062399609393e-5,5.3997123564829124e-8,0.0030664566457068772,-3.141392264624986e-5,5.414878191396371e-8,0.003066853673243906,-3.141241782904111e-5,5.414000445922996e-8,0.003067178107954643,-3.1336255718859404e-5,5.401782535141934e-8,0.003067405017322031,-3.123297452844401e-5,5.385569119674471e-8,0.0030675342967685115,-3.115406523908855e-5,5.3732673458228506e-8,0.0030675883450696387,-3.1142126616185284e-5,5.3713731593782084e-8,0.003067604598905477,-3.122165258980363e-5,5.3835712946092174e-8,0.0030676253853558076,-3.139518885501176e-5,5.41016984091395e-8,0.0030676878955794595,-3.164514859820826e-5,5.448403678006608e-8,0.0030678167760080873,-3.1940102956282886e-5,5.4934156079083943e-8,0.00306802082106185,-3.22432379520567e-5,5.539556794925043e-8,0.0030682938008947383,-3.252038055262967e-5,5.581610023286302e-8,0.003068618188348601,-3.2745712319185725e-5,5.6156527333722295e-8,0.0030689700372110436,-3.290455445210272e-5,5.63947158589191e-8,0.0030693235621584002,-3.299368835276426e-5,5.652604281911584e-8,0.0030696546829265168,-3.302018003318915e-5,5.656158441311524e-8,0.003069943501781531,-3.299964329710182e-5,5.652548727111865e-8,0.0030701761356594238,-3.295448884467991e-5,5.6452316329964884e-8,0.0030703464351241215,-3.2912168983386934e-5,5.6384348797087725e-8,0.0030704579205523843,-3.290292724600728e-5,5.6368046064395786e-8,0.0030705257705411666,-3.2956240209135014e-5,5.6448491101539555e-8,0.003070577902929506,-3.3095212754677564e-5,5.666072725949836e-8,0.003070653303256023,-3.332901887976236e-5,5.7018206275630994e-8,0.0030707954675129484,-3.3645317050531466e-5,5.750131258839977e-8,0.003071040281409215,-3.4006866132882734e-5,5.805237688321617e-8,0.003071401442066699,-3.435724590922433e-5,5.858460257890024e-8,0.003071860664240823,-3.463707718078335e-5,5.900700173455468e-8,0.003072369948294953,-3.4805077484133635e-5,5.9256687131385314e-8,0.0030728668933984586,-3.4853323968064e-5,5.932224867940723e-8,0.00307329574470014,-3.4808729472292477e-5,5.9245906426521214e-8,0.0030736238628414326,-3.472127382584356e-5,5.910521892617646e-8,0.0030738476136962186,-3.4646440956723325e-5,5.898583976281836e-8,0.0030739883560582247,-3.462984017376718e-5,5.895772090868357e-8,0.0030740829181741033,-3.46981445897087e-5,5.906122528438606e-8,0.0030741729261370603,-3.485661305223858e-5,5.930354340403719e-8,0.0030742957031104122,-3.509154811261891e-5,5.966276668283171e-8,0.0030744779277463736,-3.537572740023708e-5,6.00964697542749e-8,0.0030747323559975367,-3.5675189893930766e-5,6.055223916889516e-8,0.003075057487670119,-3.5956061174078274e-5,6.097812908001633e-8,0.0030754397046584866,-3.619027550379833e-5,6.133134047523962e-8,0.0030758570531433604,-3.6359408441814945e-5,6.158398173260262e-8,0.0030762836935755364,-3.645637499575067e-5,6.17255797130405e-8,0.0030766941332692503,-3.6485215974385064e-5,6.176270393282051e-8,0.00307706662715048,-3.645952970605651e-5,6.17165520944473e-8,0.0030773855806581914,-3.64002479832436e-5,6.161954383422073e-8,0.0030776432027652626,-3.63332416409525e-5,6.151163570192726e-8,0.003077840759611733,-3.628682113866609e-5,6.143643256726638e-8,0.003077989627912044,-3.628885788142236e-5,6.143667890109774e-8,0.0030781120193623807,-3.6363006241524466e-5,6.154837667649236e-8,0.0030782405956229293,-3.652349964920907e-5,6.179278977302228e-8,0.0030784153961581056,-3.6768720995789186e-5,6.216668724687254e-8,0.003078676287039924,-3.707542807113103e-5,6.263368664319519e-8,0.0030790504999446576,-3.739763323181358e-5,6.312273725650803e-8,0.0030795385416962856,-3.767491089624212e-5,6.354097060212617e-8,0.0030801063485889927,-3.7851372011602716E-05,6.380282181650783e-8,0.003080691860843348,-3.789839797156401e-5,6.3864909335135015E-08,0.0030812263089583505,-3.782804205247127e-5,6.374660437345014e-8,0.0030816595018051856,-3.768799022595951e-5,6.352218567186832e-8,0.003081975175275685,-3.754141745986299e-5,6.328960513196501e-8,0.0030821904003572086,-3.7444257862379394e-5,6.313520651894206e-8,0.003082343638281676,-3.743069219176931e-5,6.311124043335557e-8,0.0030824800552818033,-3.7509564541134194e-5,6.323047245576145e-8,0.0030826400072475326,-3.7668452785068254e-5,6.347276711043042e-8,0.003082852413765722,-3.788093848520992e-5,6.379661295313797e-8,0.003083132266538477,-3.811403698482697e-5,6.415076333549884e-8,0.0030834808667202927,-3.833449478651092e-5,6.448396137955909e-8,0.0030838877341181153,-3.8513714836371074e-5,6.475242681002939e-8,0.0030843336004778847,-3.8631288755844996e-5,6.49251538042667e-8,0.003084794042322366,-3.867707285475078e-5,6.49869875714132e-8,0.0030852433321181686,-3.865183435490819e-5,6.49395475346079e-8,0.0030856581339217173,-3.856655888053119e-5,6.48001336398034e-8,0.0030860206460516367,-3.844058492853828e-5,6.459884806542256e-8,0.0030863208771382037,-3.8298947069799535e-5,6.437449277747022e-8,0.0030865580404335806,-3.816935596666206e-5,6.416988298112212e-8,0.0030867412223701774,-3.807898089265322e-5,6.402682842646071e-8,0.0030868893766480983,-3.8050984731237867e-5,6.398072676630348e-8,0.0030870304944824955,-3.810068561233592e-5,6.405462439468387e-8,0.003087199430753806,-3.823122572618231e-5,6.425261522376926e-8,0.0030874333446925814,-3.842914766591009e-5,6.455320872359164e-8,0.0030877636895722525,-3.866159342862816e-5,6.490525234810125e-8,0.0030882049718960573,-3.887836166676586e-5,6.523127311346362e-8,0.003088743561312213,-3.9022341755227606e-5,6.544356507347711e-8,0.003089333590640843,-3.904860755320145e-5,6.547348840413299e-8,0.0030899071036917716,-3.894510170953161e-5,6.530322358465656e-8,0.0030903979050176593,-3.8742004346281896e-5,6.498015271661827e-8,0.003090767228006569,-3.8501181533249536e-5,6.460049051721142e-8,0.0030910160608724553,-3.8290854101103754e-5,6.426997931057188e-8,0.0030911786470456865,-3.816087723268984e-5,6.406549047523721e-8,0.003091304636594572,-3.81308943961482e-5,6.401668515462453e-8,0.0030914415331645385,-3.819243835001492e-5,6.410948319588161e-8,0.003091624053373996,-3.831851468248846e-5,6.430123035197483e-8,0.0030918706623143453,-3.8474104361764894e-5,6.453722136219927e-8,0.0030921846709144477,-3.8624255014770126e-5,6.476330985906157e-8,0.0030925572633731823,-3.8739191826344275e-5,6.493373044917373e-8,0.0030929709124494467,-3.879722444333691e-5,6.501542077873879e-8,0.003093402731555433,-3.8786312162609277e-5,6.499027635350036e-8,0.0030938277663450082,-3.870467412242986e-5,6.485599547202599e-8,0.0030942222139669767,-3.856054410640383e-5,6.462566902485165e-8,0.003094566519648795,-3.8371053174280506e-5,6.432606100579885e-8,0.0030948481721392368,-3.816012347433993e-5,6.399436069664364e-8,0.003095063804553022,-3.795541247827492e-5,6.36734419165358e-8,0.003095220250846101,-3.778464042825393e-5,6.34061366452044e-8,0.003095334440344874,-3.76716671513097e-5,6.322910755980504e-8,0.00309543208101415,-3.76325912073004e-5,6.316677889485286e-8,0.0030955450293822886,-3.767217508425234e-5,6.32258396731875e-8,0.003095707183071852,-3.778095740397159e-5,6.339090801722296e-8,0.00309594862334514,-3.793365750566644e-5,6.36222778804018e-8,0.003096287931628474,-3.80901905074783e-5,6.385770713701393e-8,0.0030967236941520254,-3.8201303672671125e-5,6.402124536059043e-8,0.003097228280907147,-3.822036947682624e-5,6.404140759803494e-8,0.0030977490184312755,-3.8120022723220564e-5,6.387670810024808e-8,0.0030982210755350135,-3.7907147081520453e-5,6.353864073301886e-8,0.0030985900761617553,-3.762610731223205e-5,6.309655120907573e-8,0.0030988336384995293,-3.734434007536094e-5,6.265523738702239e-8,0.003098968816215725,-3.7126254709522466e-5,6.231441792645098e-8,0.003099041425769494,-3.7010331236075636e-5,6.213318613669418e-8,0.0030991055833493103,-3.7000963291756114e-5,6.211747094970239e-8,0.0030992057850765756,-3.707503307238412e-5,6.223050579274813e-8,0.0030993681475792695,-3.719515769679686e-5,6.241367766141261e-8,0.0030996000182369945,-3.7321886461173106e-5,6.260562024590069e-8,0.0030998940056717068,-3.742152940130405e-5,6.275433238229519e-8,0.003100233021590866,-3.7469791909199243e-5,6.282264287237035e-8,0.0031005946146256498,-3.74527865541713e-5,6.278957087078115e-8,0.0031009543309571943,-3.7366892039579344e-5,6.264995951136436e-8,0.003101288498980592,-3.721816385706405e-5,6.241351573364313e-8,0.0031015767979117176,-3.702139137135275e-5,6.210337620395833e-8,0.0031018047687390517,-3.679862687950359e-5,6.175387343947005e-8,0.0031019661991720264,-3.657686241831285e-5,6.140695022313485e-8,0.0031020649564957345,-3.638462538015085e-5,6.110684934249384e-8,0.0031021156285978737,-3.624768225270253e-5,6.089338495755532e-8,0.003102142484188417,-3.6184428286903e-5,6.079473351831937e-8,0.0031021765631752685,-3.620172937410701e-5,6.082097958568538e-8,0.0031022510076930674,-3.629208197157182e-5,6.095979473559371e-8,0.0031023950750430954,-3.643289906673445e-5,6.117550104443778e-8,0.0031026275545373554,-3.658852828809345e-5,6.141241349154455e-8,0.0031029505897565103,-3.6715498961018746e-5,6.160314515690131e-8,0.0031033454561945222,-3.677128760644678e-5,6.168223979401771e-8,0.0031037725875075316,-3.672594194239396e-5,6.160407633853862e-8,0.0031041783170027994,-3.6573890333345214e-5,6.13609507617016e-8,0.0031045091130757767,-3.634081561194844e-5,6.099349544356457e-8,0.0031047297909969312,-3.607980110758601e-5,6.058452494813771e-8,0.0031048374201034855,-3.585494963702326e-5,6.023352619407363e-8,0.003104862516995215,-3.5718644691785436e-5,6.002135737673514e-8,0.003104856093193385,-3.569405931092349e-5,5.998319444364333e-8,0.0031048700872880267,-3.577137790618058e-5,6.010288490586609e-8,0.003104941604094109,-3.5916960865466545e-5,6.032745899023271e-8,0.00310508658575867,-3.608784938858073e-5,6.058987181278256e-8,0.003105301813939656,-3.6244129061960325e-5,6.082825896614451e-8,0.0031055709169320175,-3.6355939860998774e-5,6.099670423139435e-8,0.003105870647986892,-3.6405690275413666e-5,6.106846533436347e-8,0.0031061756914431407,-3.638750956805874e-5,6.103492926911871e-8,0.0031064618740461935,-3.630572623697611e-5,6.090315332297189e-8,0.0031067083897661323,-3.617327510332381e-5,6.069340518034317e-8,0.0031068996748370463,-3.6010179052804656e-5,6.043687697777326e-8,0.0031070273067826453,-3.5841809895788134e-5,6.017304374810048e-8,0.003107091924907097,-3.569640763286369e-5,5.994580924865879e-8,0.003107104690948129,-3.5601421586642455e-5,5.979775912534584e-8,0.0031070874280543044,-3.557871974140187e-5,5.976263364692894e-8,0.0031070705639987084,-3.563939705212548e-5,5.985721638430891e-8,0.00310708845076731,-3.577953751271076e-5,6.007479140748683e-8,0.0031071724854550274,-3.597857902840596e-5,6.0382741421625e-8,0.003107343449944664,-3.620155104969642e-5,6.072622362437715e-8,0.0031076051132779385,-3.640540195274204e-5,6.10381901744192e-8,0.0031079410880545904,-3.6548419234103456e-5,6.125412657583635e-8,0.0031083163328670636,-3.6600797795219e-5,6.132843658673388e-8,0.003108683776045806,-3.655377779638129e-5,6.12484672972554e-8,0.0031089953478281146,-3.642449473760269e-5,6.104178540723422e-8,0.0031092151923365167,-3.6254006005909544e-5,6.077284786520125e-8,0.003109331132111241,-3.6097367552710236e-5,6.052739707346827e-8,0.00310935954808475,-3.6007610042852635e-5,6.038750927329051e-8,0.0031093404361101393,-3.601917120844064e-5,6.04059490162074e-8,0.0031093239113226005,-3.6137917913298556e-5,6.059089030936383e-8,0.003109354124427072,-3.6341991680345246e-5,6.090751315544337e-8,0.0031094576079410963,-3.6591899919457295e-5,6.12939239128099e-8,0.003109639723574992,-3.684400498898479e-5,6.168222747975021e-8,0.003109888172433052,-3.706155993675539e-5,6.201562972733295e-8,0.003110179865335902,-3.7220522609188814e-5,6.225730522644977e-8,0.0031104876813696455,-3.731061864999249e-5,6.239184703464731e-8,0.00311078539719096,-3.733367074941028e-5,6.242252235980394e-8,0.0031110506840359895,-3.730106234421321e-5,6.236728729470829e-8,0.003111266829818254,-3.723134017143124e-5,6.225510727514509e-8,0.0031114239398752712,-3.7148181411718e-5,6.212287206499815e-8,0.0031115201531575613,-3.7078419428024274e-5,6.201236188919679e-8,0.003111562975299694,-3.7049500972479054e-5,6.196625586571644e-8,0.003111570240611829,-3.7085775629295866e-5,6.20222732746493e-8,0.0031115696907623807,-3.720350361712773e-5,6.220533256957703e-8,0.003111595961660061,-3.740535774526301e-5,6.251900193071125e-8,0.0031116842348012787,-3.7676298720104116e-5,6.293919212979045e-8,0.0031118612256879658,-3.798340020650173e-5,6.341407163920447e-8,0.003112136139777003,-3.828150901245256e-5,6.387306782824209e-8,0.003112495379209596,-3.852427301854293e-5,6.424415997620797e-8,0.003112903926884855,-3.867726198381603e-5,6.447432367142958e-8,0.0031133136874417224,-3.872848224078679e-5,6.454579824951314e-8,0.0031136761793375063,-3.8692456923064395E-05,6.448222652228261e-8,0.0031139554371912236,-3.860656882561176e-5,6.434267804320025e-8,0.0031141372703484766,-3.8521032659985596e-5,6.420576709598722e-8,0.0031142324513703736,-3.848555621137015e-5,6.414873497201981e-8,0.003114273122112332,-3.85363882869955e-5,6.422732768153216e-8,0.0031143034616922818,-3.868736365238427e-5,6.446208120483557e-8,0.0031143674207793413,-3.892758353008189e-5,6.483503018920008e-8,0.003114497459059395,-3.9226240381586666e-5,6.529750515880651e-8,0.0031147078121036174,-3.954245370409532e-5,6.578559894383833e-8,0.00311499378960663,-3.983627974908429e-5,6.623730004445356e-8,0.0031153360888836355,-4.007726426013293e-5,6.660567612073376e-8,0.0031157075151952004,-4.024868825724295e-5,6.686529743458914e-8,0.00311607947574405,-4.034776414925683e-5,6.701237492469503e-8,0.0031164267230209515,-4.038331710088937e-5,6.706105409678788e-8,0.0031167301083817336,-4.037260325837689e-5,6.703845169512361e-8,0.003116977890976981,-4.033831580823609e-5,6.698004129434217e-8,0.0031171663505323325,-4.030610095786534e-5,6.692583316158584e-8,0.0031173002857739405,-4.030233658179883e-5,6.691691302618574e-8,0.0031173935830516013,-4.035158745219613e-5,6.699141672014888e-8,0.003117469472534857,-4.047311163717984e-5,6.71790093138832e-8,0.0031175594775110223,-4.067616621474953e-5,6.749354678239481e-8,0.0031176996760878236,-4.095478103045957e-5,6.792501578391407e-8,0.003117923245200117,-4.1284097202451735e-5,6.843400804444655e-8,0.003118249965451604,-4.162156390749211e-5,6.895378532468487e-8,0.0031186762577232225,-4.1915651713568604e-5,6.940399276282996e-8,0.0031191714040973333,-4.212116830683181e-5,6.971456663709166e-8,0.0031196840741649716,-4.2215346438736336e-5,6.985077033810668e-8,0.003120157847027817,-4.220674667049533e-5,6.98269624957057e-8,0.0031205489414833265,-4.2132362620646234e-5,6.97018734876997e-8,0.0031208383916512266,-4.20448327662397e-5,6.955836204462521e-8,0.003121034785095203,-4.199616018547974e-5,6.947774286240719e-8,0.003121168632125931,-4.202421267565137e-5,6.951862361251391e-8,0.0031212820770698153,-4.214528318978495e-5,6.970544612819716e-8,0.0031214177248149594,-4.235306877230772e-5,7.002722768273191e-8,0.0031216092731973467,-4.2622792035729374e-5,7.044435725304227e-8,0.0031218754919343627,-4.2918580516760454e-5,7.090035608149642e-8,0.0031222181803268524,-4.320209457310386e-5,7.133539946884241e-8,0.003122623947005099,-4.344044848734895e-5,7.169857291254788e-8,0.00312306884485219,-4.361179467816571e-5,7.195639886437939e-8,0.003123524289638139,-4.370774340490241e-5,7.209642624241596e-8,0.0031239626656890764,-4.373282262997294e-5,7.21262580887302e-8,0.0031243615440335547,-4.3701909396077086e-5,7.206948965492392e-8,0.0031247061538028763,-4.3636780471882876e-5,7.196033443639855e-8,0.0031249903765416783,-4.356272900897019e-5,7.183837800351165e-8,0.0031252168682957006,-4.3505688790359626e-5,7.174410685588453e-8,0.0031253968441908885,-4.348975073626395e-5,7.17150048965672e-8,0.0031255497310814042,-4.35346390742139e-5,7.178155313739291e-8,0.00312570246406995,-4.3652662272077505e-5,7.196242839516862e-8,0.0031258876523310264,-4.384487979547073e-5,7.225856364534224e-8,0.003126139361453899,-4.409699636109416e-5,7.26468964950289e-8,0.003126485461480311,-4.437689592985936e-5,7.307674195249288e-8,0.003126937079372063,-4.4637120813428204e-5,7.347383911846252e-8,0.003127478854765807,-4.482535361453673e-5,7.375675854161458e-8,0.0031280666690904416,-4.490213927602775e-5,7.386449999496449e-8,0.0031286382404406153,-4.4858518891369295e-5,7.37839353542856e-8,0.0031291344460409416,-4.472272685316552e-5,7.356017852034121e-8,0.0031295207052957296,-4.455029894921475e-5,7.328095575302624e-8,0.0031297969026368396,-4.440289276125083e-5,7.304320913549977e-8,0.0031299925059136854,-4.4327735522592144e-5,7.292069128837017e-8,0.0031301525953489643,-4.4346566926362245e-5,7.294663172919162e-8,0.003130323040755186,-4.44552245163689e-5,7.311334170083266e-8,0.0031305398839340287,-4.463002091424208e-5,7.338260528006618e-8,0.00313082404631057,-4.483652215332876e-5,7.369977824422968e-8,0.0031311803606072124,-4.503787355813529e-5,7.400698484506922e-8,0.0031315994383132096,-4.5201450522542784e-5,7.425347439859536e-8,0.0031320612381614877,-4.530356848674249e-5,7.440279963037097e-8,0.0031325396046175753,-4.533218545978504e-5,7.443682235158883e-8,0.003133007088926917,-4.528754210138793e-5,7.435654510846008e-8,0.003133439334571156,-4.51809403698077e-5,7.41801159799911e-8,0.003133818472273233,-4.503213230381495e-5,7.393873233871031e-8,0.003134135205289634,-4.486591093923118e-5,7.367133504974223e-8,0.0031343895555660316,-4.470855447784281e-5,7.34190699593144e-8,0.003134590575431148,-4.4584622562577654e-5,7.322027017012072e-8,0.0031347554245567386,-4.451420562905288e-5,7.310611312884732e-8,0.0031349080100163845,-4.451044644791041e-5,7.309669605942408e-8,0.0031350771198854635,-4.457710742852157e-5,7.319723119373661e-8,0.0031352936217133444,-4.47060605212665e-5,7.339422020383135e-8,0.0031355858958112227,-4.487510826442938e-5,7.365224958348347e-8,0.003135972822388433,-4.5047645339306655e-5,7.391369496033267e-8,0.0031364549294214225,-4.517674188187485e-5,7.410524949995039e-8,0.003137006880828943,-4.521608014150156e-5,7.415499865583744e-8,0.0031375773084138556,-4.513707215275879e-5,7.401903658596108e-8,0.003138101428611319,-4.494515854131807e-5,7.370680978793502e-8,0.0031385245037932065,-4.468383466731007e-5,7.328731665396651e-8,0.0031388241332245405,-4.441996388809048e-5,7.286597138629206e-8,0.003139017499846824,-4.421722026618582e-5,7.254276438257211e-8,0.003139150157383647,-4.411342074013215e-5,7.237653893372397e-8,0.0031392756212672386,-4.411288523762928e-5,7.237306272266767e-8,0.003139437968769991,-4.4192948719133804e-5,7.249557334607343e-8,0.0031396632755686426,-4.431658177299298e-5,7.268500837724008e-8,0.0031399588406845693,-4.444412071309936e-5,7.287870894461722e-8,0.0031403166737552367,-4.454122642373622e-5,7.302295817715162e-8,0.0031407183126958165,-4.4583109623867075e-5,7.307944575839242e-8,0.0031411394477191415,-4.4556196731207386e-5,7.302762227868937e-8,0.0031415539994911366,-4.445830099035177e-5,7.28647417048713e-8,0.003141937728993228,-4.429775179132686e-5,7.260437295376374e-8,0.0031422713373744243,-4.4091609934731785e-5,7.227358181570472e-8,0.0031425429027575314,-4.386309308749254e-5,7.190893225978437e-8,0.0031427494576673834,-4.363836426557965e-5,7.155149576181157e-8,0.0031428974772572276,-4.3442976873453624e-5,7.124128957024562e-8,0.003143002214192302,-4.329843267004607e-5,7.101185038058907e-8,0.003143086052266109,-4.321920239699395e-5,7.088551186228275e-8,0.0031431760678829164,-4.3210361139567735e-5,7.086966698763124e-8,0.0031433008971223707,-4.3265945431617366e-5,7.09542336198036e-8,0.003143486895319873,-4.336813785078726e-5,7.111052058211447e-8,0.0031437533847702066,-4.348759147027911e-5,7.12919612296051e-8,0.0031441069213620117,-4.358585463469756e-5,7.143813366953108e-8,0.003144535476545944,-4.362139298757207e-5,7.148429942205696e-8,0.003145005091611609,-4.3560203673701036e-5,7.137795505629189e-8,0.003145463126681861,-4.3389675112285365e-5,7.11003324650128e-8,0.003145851574927433,-4.3129979926205826e-5,7.068402441148508e-8,0.0031461283507413433,-4.2833959953962696e-5,7.021264040871186e-8,0.003146286100171612,-4.257032356693477e-5,6.979432110562806e-8,0.0031463558591178996,-4.239669820392884e-5,6.951932082306872e-8,0.003146392327049763,-4.233819904869464e-5,6.942631862677053e-8,0.0031464507043553205,-4.2383168839997224e-5,6.94958958380317e-8,0.0031465688651928546,-4.249459392815535e-5,6.966883115670779e-8,0.0031467612849682977,-4.262689345829094e-5,6.987285185595196e-8,0.0031470222789782287,-4.273918499304871e-5,7.004366315740973e-8,0.0031473330289561153,-4.2802158807808166e-5,7.013567759431403e-8,0.003147668417268007,-4.279983806022786e-5,7.01245308551207e-8,0.0031480021049310764,-4.272860133319068e-5,7.00052672228628e-8,0.0031483099313495784,-4.259528124034335e-5,6.978916831189976e-8,0.0031485723125253334,-4.241509647530167e-5,6.950045735299453e-8,0.0031487761173877083,-4.2209454417396814e-5,6.917289890407978e-8,0.0031489161538580373,-4.2003459881328945e-5,6.884596295593158e-8,0.003148996162170557,-4.1822953882087386e-5,6.856021556609623e-8,0.003149028978654053,-4.169106752864223e-5,6.835188836388549e-8,0.003149035482429731,-4.162464544196019e-5,6.824720046102467e-8,0.003149042199251593,-4.163112014627014e-5,6.825739085675065e-8,0.00314907771956232,-4.170639233813112e-5,6.837538674971382e-8,0.0031491682653819867,-4.18342132313785e-5,6.857492364962827e-8,0.0031493329122884942,-4.198742613049102e-5,6.881267918772647e-8,0.003149579039836493,-4.213120402571019e-5,6.903358555963276e-8,0.0031498986271138838,-4.2228420130555436e-5,6.91794432100356e-8,0.0031502664228729867,-4.2247298350746497e-5,6.920097199180307e-8,0.003150641701734798,-4.217078712182122e-5,6.907238815589541e-8,0.0031509754961388586,-4.200545381164349e-5,6.880509810771359e-8,0.0031512238608324395,-4.1785638196682574e-5,6.845392811745735e-8,0.0031513640821730364,-4.1567794289340616e-5,6.810802378555436e-8,0.003151406157010707,-4.141327484247085e-5,6.786370323995615e-8,0.0031513912510576945,-4.136560918026271e-5,6.778876311671728e-8,0.003151375804577231,-4.1434395174820625e-5,6.789730029476199e-8,0.0031514098642566202,-4.159482257943738e-5,6.81492342574456e-8,0.0031515215625475173,-4.18012216288661e-5,6.847194098192803e-8,0.0031517136174996478,-4.200494130433833e-5,6.878861599395965e-8,0.0031519692707481077,-4.216756787951769e-5,6.903911030241721e-8,0.003152261517243071,-4.2266490087485424e-5,6.918851693440988e-8,0.0031525610670786637,-4.229461685062819e-5,6.922644943555905e-8,0.0031528414655990046,-4.22573706176436e-5,6.9162068457332e-8,0.003153081775375267,-4.216923255662013e-5,6.901853417953314e-8,0.0031532678798198805,-4.205077312180638e-5,6.882835975902144e-8,0.0031533932546355388,-4.192616457967239e-5,6.862959482793142e-8,0.0031534595708972847,-4.1820803001536924e-5,6.84621653927876e-8,0.0031534770784778826,-4.175861379115542e-5,6.836364650161207e-8,0.0031534643622982412,-4.17588032667655e-5,6.836409543908077e-8,0.0031534468701465957,-4.183228856251606e-5,6.848035579602831e-8,0.003153453782052926,-4.197854007215975e-5,6.871105220452271e-8,0.003153513263736754,-4.218384148552481e-5,6.903390427614672e-8,0.0031536467429532566,-4.242196322172231e-5,6.940693592124387e-8,0.003153863430347162,-4.265783483101526e-5,6.977446531891138e-8,0.003154156585993926,-4.285397543340932e-5,7.007742427316526e-8,0.00315450279718283,-4.2978622186424466e-5,7.026625449926472e-8,0.0031548650041122103,-4.301400854080456e-5,7.031388230440871e-8,0.00315519943918034,-4.296289169347691e-5,7.022577473855363e-8,0.003155465859320983,-4.285109888117147e-5,7.00436294628589e-8,0.0031556391659936065,-4.272394847220358e-5,6.983943122484468e-8,0.0031557188612724523,-4.263555517927237e-5,6.969842457165365e-8,0.0031557317728420436,-4.263280101975123e-5,6.969387032889604e-8,0.0031557249027450757,-4.2739520543408744e-5,6.98623192302485e-8,0.0031557498994496218,-4.294833096833603e-5,7.019104128047928e-8,0.00315584589866597,-4.322452786249621e-5,7.062447804376743e-8,0.0031560287243041687,-4.3519737897634517e-5,7.108598411323216e-8,0.003156290210848438,-4.378791545601902e-5,7.150311106554863e-8,0.0031566054069980037,-4.3996660675542415e-5,7.182534984786604e-8,0.0031569423808284628,-4.4131253208340974e-5,7.203026754938302e-8,0.003157270337523358,-4.4192994871844845e-5,7.212064457656072e-8,0.003157564470837877,-4.419496903596624e-5,7.211761487890475e-8,0.003157808015852627,-4.415761251223253e-5,7.205364259861087e-8,0.0031579926823708912,-4.4105138784809375e-5,7.196695049477917e-8,0.0031581184957774153,-4.406285452731199e-5,7.189738913692536e-8,0.003158193599416625,-4.4054911516432865e-5,7.188294750699247e-8,0.003158234031798483,-4.4101897275740684e-5,7.195593087373301e-8,0.003158263018098467,-4.421788006294162e-5,7.213822712040806e-8,0.003158309054218505,-4.440704337455989e-5,7.243594276621938e-8,0.0031584021289597524,-4.466069514352587e-5,7.283470938809992e-8,0.0031585679463628875,-4.495603322513259e-5,7.329786169090022e-8,0.003158821045759386,-4.5258255933040026e-5,7.37699600181512e-8,0.003159158924190263,-4.5526890236963015e-5,7.418696615489833e-8,0.0031595597943583466,-4.572549126524957e-5,7.44916678688917e-8,0.003159985788919604,-4.5832004494916494e-5,7.465002833083531e-8,0.003160391467505701,-4.5846244908167024e-5,7.466284408960723e-8,0.003160735390904223,-4.5791651761595475e-5,7.456824370500927e-8,0.003160991329864051,-4.5710340506587154e-5,7.443354724124745e-8,0.0031611557652805296,-4.56525958579643e-5,7.433840211999739e-8,0.0031612493653574466,-4.566356507695597e-5,7.43536688058528e-8,0.0031613116320375638,-4.577082683019708e-5,7.452191859422641e-8,0.00316138983687732,-4.5976704493927694e-5,7.484561016922063e-8,0.0031615255351170207,-4.625816721714404e-5,7.52873081576349e-8,0.00316174330606514,-4.6574539940815696e-5,7.578215147025375e-8,0.0031620456464795553,-4.687999059605023e-5,7.625769376845123e-8,0.003162415165519021,-4.713588347181678e-5,7.665335200741533e-8,0.003162822036835446,-4.731880660958561e-5,7.693289460631574e-8,0.0031632329785881486,-4.7422738256966696e-5,7.708762391075058e-8,0.0031636185498555743,-4.7456548574135615e-5,7.713222429686289e-8,0.003163957394531511,-4.743930170684533e-5,7.709723112409955e-8,0.003164237749092535,-4.7395460395258866e-5,7.702145770310557e-8,0.0031644572629982944,-4.735103026805132e-5,7.694598016390119e-8,0.0031646221440750945,-4.733077694987257e-5,7.690981863864776e-8,0.003164746262745098,-4.735610332844896e-5,7.694660644621445e-8,0.003164850315648308,-4.744295341822404e-5,7.708123668442743e-8,0.003164960615211108,-4.7599282087552986e-5,7.732580598792541e-8,0.00316510674443353,-4.7822150507262595e-5,7.767502077308712e-8,0.0031653173075884386,-4.809522158373371e-5,7.810233831505504e-8,0.003165613500816317,-4.8388234367153477e-5,7.855932068502407e-8,0.003166001527547761,-4.8660505245747866e-5,7.898136490858256e-8,0.0031664667240323473,-4.886967395690606e-5,7.930165483686465e-8,0.0031669732473650035,-4.898427913808119e-5,7.947106008168446e-8,0.0031674717018881997,-4.899555012818512e-5,7.94766938590658e-8,0.0031679131839261526,-4.892263568963575e-5,7.934999749978144e-8,0.0031682643359964833,-4.8808002238974886e-5,7.91591853553536e-8,0.0031685171259444567,-4.8704610129976645e-5,7.898863798646383e-8,0.003168689888016564,-4.866027347872532e-5,7.891391738685978e-8,0.0031688203554882553,-4.870497925930795e-5,7.898168134647224e-8,0.0031689541483683986,-4.884458925824059e-5,7.919995944645049e-8,0.003169132666912061,-4.90615415154104e-5,7.953967154409288e-8,0.0031693835370994743,-4.932123743816433e-5,7.994513150365482e-8,0.0031697155633991425,-4.958174182690445e-5,8.034963065946353e-8,0.0031701188096189092,-4.9803993111668386e-5,8.069160780662406e-8,0.0031705690690595756,-4.995993501816825e-5,8.092735112553882e-8,0.0031710349046023332,-5.003685841512912e-5,8.103761860361142e-8,0.003171484997353245,-5.003758483585365e-5,8.10276899103105e-8,0.0031718939250299756,-4.997743721292307e-5,8.092241368604767e-8,0.0031722454763997874,-4.98796363572316e-5,8.075886678430627e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json
new file mode 100644
index 0000000..841a3de
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":21000,"numberOfSamples":1000,"samples":[0.0031725336341924394,-4.9770637985046546e-5,8.057900832626396e-8,0.0031727619720193665,-4.967631255249218e-5,8.042370582661394e-8,0.0031729423213677447,-4.961918610821703e-5,8.032842301827844e-8,0.003173093301004051,-4.9616439750269165e-5,8.032005503717977e-8,0.0031732388512125246,-4.9678142521825614e-5,8.04140915834666e-8,0.003173406461172115,-4.980531114277095e-5,8.061152056197695e-8,0.003173624434517486,-4.998780080363393e-5,8.089554409980637e-8,0.0031739174410596086,-5.02027153676187e-5,8.122921958837977e-8,0.0031743000569504428,-5.0414905317985565e-5,8.155645946622467e-8,0.0031747693572844707,-5.058170552271261e-5,8.1809696462639e-8,0.003175299754099858,-5.066328166614758e-5,8.192630588543693e-8,0.003175844728509721,-5.06368615606572e-5,8.187106223913913e-8,0.003176348378152092,-5.0508762136083794e-5,8.16550486069026e-8,0.0031767639923363524,-5.0316402748498936e-5,8.133866443459827e-8,0.0031770709661550177,-5.011689791600365e-5,8.101329428919594e-8,0.0031772811274633317,-4.9967147620633346e-5,8.076944687326912e-8,0.003177432030673561,-4.9905479367471625e-5,8.066745206192551e-8,0.003177572270523811,-4.994259580574966e-5,8.072317955227706e-8,0.003177746439699948,-5.0063033684474547e-5,8.091070950808379e-8,0.0031779848344744835,-5.0233470557248106e-5,8.117598151931799e-8,0.0031782992076989803,-5.0413262606724425e-5,8.145387798184555e-8,0.003178683508504494,-5.056397454491497e-5,8.168346678500409e-8,0.0031791178624765563,-5.0656360805938936e-5,8.181895509495128e-8,0.003179574229733301,-5.067436252240991e-5,8.183576329438713e-8,0.003180022490647086,-5.0616168724939576e-5,8.173192449420742e-8,0.0031804358927458322,-5.049270511433461e-5,8.152548156884965e-8,0.0031807950553075313,-5.0324297904340744e-5,8.124910490024964e-8,0.0031810901697997096,-5.013646650496189e-5,8.094342997127281e-8,0.003181321456190578,-4.995570801310683e-5,8.065043893174666e-8,0.0031814982527144423,-4.9805917795511555e-5,8.040785329190629e-8,0.0031816373210504898,-4.970574993088201e-5,8.024497887522197e-8,0.0031817608717426495,-4.9666782981278536e-5,8.017978161620004e-8,0.0031818944706078238,-4.969213348437762e-5,8.021665586604609e-8,0.003182064656150664,-4.977526990474911e-5,8.034455083019423e-8,0.0031822958582123618,-4.9899054210053294e-5,8.053555151866265e-8,0.0031826060765792474,-5.00355420814562e-5,8.074475516704612e-8,0.0031830011463665404,-5.014786026254351e-5,8.091345990457809e-8,0.0031834686693217383,-5.0195995982255704e-5,8.097846711663703e-8,0.0031839746468371897,-5.01475748419181e-5,8.088913626890179e-8,0.0031844673261262986,-4.999173257679851e-5,8.062922765445895e-8,0.003184891172592454,-4.974957666882377e-5,8.023331134917238e-8,0.0031852075073160895,-4.9472597723993216e-5,7.978406694492346e-8,0.0031854111053174357,-4.922574084934537e-5,7.938518959159813e-8,0.0031855320833315435,-4.9062718900561163e-5,7.912193983519057e-8,0.003185621952271365,-4.9007423813544054e-5,7.903149987919705e-8,0.003185733140730741,-4.905026352546958e-5,7.909733195325303e-8,0.003185903073154297,-4.915750209942922e-5,7.926446313102022e-8,0.0031861477150601954,-4.9285511618747645e-5,7.946261622724468e-8,0.0031864630412842053,-4.9393086955828754e-5,7.962606325736776e-8,0.0031868305582437354,-4.944910682330027e-5,7.970578335261417e-8,0.0031872237417380285,-4.9435815064372105e-5,7.967442526435043e-8,0.003187613799646374,-4.934910556784959e-5,7.952642648280632e-8,0.0031879743406409483,-4.919701658863508e-5,7.927535204629794e-8,0.0031882849181979036,-4.899707191619981e-5,7.894954072044581e-8,0.0031885333705692622,-4.8772886247731465e-5,7.85867133852273e-8,0.0031887169235430774,-4.8550472591157195e-5,7.82281831475899e-8,0.0031888421191353347,-4.8354611885566905e-5,7.791317453714298e-8,0.0031889236591736768,-4.820561826479776e-5,7.767373204135999e-8,0.003188982392912168,-4.811685191685343e-5,7.753076281390647e-8,0.0031890428229633568,-4.80931088914721e-5,7.749144001256398e-8,0.003189130371339149,-4.8129751866914776e-5,7.754779717892457e-8,0.0031892684093893045,-4.821248076042052e-5,7.767640704932689e-8,0.003189474936144377,-4.8317827589117846e-5,7.78393091488724e-8,0.003189758740824415,-4.841472688601514e-5,7.798671830001753e-8,0.0031901151496382964,-4.846801130205281e-5,7.806277470675716e-8,0.0031905224205677797,-4.844497532884705e-5,7.801604196463123e-8,0.003190941284990858,-4.8325353983456495e-5,7.781525298490396e-8,0.0031913210506145494,-4.811258839800113e-5,7.746697340533311e-8,0.0031916141519961177,-4.784055752540146e-5,7.702604990677442e-8,0.003191795418319783,-4.7568255887754585e-5,7.658695371946121e-8,0.0031918755740832448,-4.73600221174305e-5,7.625217949764229e-8,0.003191898603829455,-4.725988960279658e-5,7.609132297246147e-8,0.0031919229650166662,-4.7275184045738147e-5,7.611500607230232e-8,0.003191998333085281,-4.737827479416436e-5,7.62779363395227e-8,0.0031921508881996145,-4.752216804202383e-5,7.65041794434679e-8,0.003192381393929433,-4.765854984268982e-5,7.671628736820805e-8,0.0031926718219546014,-4.7750056416319196e-5,7.685497758163076e-8,0.003192994371773742,-4.7775167613736925e-5,7.688676322707986e-8,0.0031933191121518447,-4.7727892633397725e-5,7.680310882032987e-8,0.0031936191057208192,-4.761498877639121e-5,7.661565929511285e-8,0.0031938734231599622,-4.74525826505499e-5,7.635065824624502e-8,0.0031940688710230926,-4.7262880918771545e-5,7.60436847923047e-8,0.0031942008964133926,-4.707097737875328e-5,7.573466367930087e-8,0.0031942737606263116,-4.6901719035824056e-5,7.546299629687368e-8,0.003194299972841271,-4.6776661718682426e-5,7.526278957837741e-8,0.003194298887206334,-4.6711226468842323e-5,7.51583342891208e-8,0.003194294386829285,-4.671240074914931e-5,7.516039741374076e-8,0.0031943118407074603,-4.6777394668392805e-5,7.526403312546946e-8,0.0031943746893159835,-4.6893437644436546e-5,7.544826377873212e-8,0.0031945009495270385,-4.7038759907479775e-5,7.567773903852656e-8,0.0031946998830175675,-4.7184820903478814e-5,7.590646855791671e-8,0.0031949691011137634,-4.729986237129749e-5,7.608369607755573e-8,0.0031952925157211496,-4.735397448743149e-5,7.616211706606225e-8,0.003195640046002511,-4.7325873413935426e-5,7.610866131565764e-8,0.0031959707011487326,-4.721084275969199e-5,7.591694218179518e-8,0.0031962407678702612,-4.7027544120006907e-5,7.561778712416466e-8,0.0031964172220154555,-4.68193172139658e-5,7.528100427078354e-8,0.003196492459990767,-4.664522204584982e-5,7.500092425591764e-8,0.003196492024360513,-4.6560407478603466e-5,7.486507180241458e-8,0.0031964677331033607,-4.6593856889802264e-5,7.491877034751068e-8,0.003196477403032644,-4.673659702635629e-5,7.514654134177191e-8,0.0031965625176653793,-4.694773588519694e-5,7.548204705047288e-8,0.0031967362693748544,-4.717322873987367e-5,7.583837429474331e-8,0.003196985533609338,-4.73651776342118e-5,7.613905990916508e-8,0.0031972812138878572,-4.74929888958597e-5,7.633588427653374e-8,0.003197589462630078,-4.7545490933105095e-5,7.64119965822908e-8,0.0031978796496195555,-4.752757942989125e-5,7.637620017022061e-8,0.00319812848863574,-4.745512493931714e-5,7.625453549820702e-8,0.00319832144886984,-4.73503257355979e-5,7.608275219379998e-8,0.003198452856742482,-4.723812082730018e-5,7.590064580016247e-8,0.0031985255501511783,-4.7143356527051194e-5,7.57476813144896e-8,0.0031985502819583764,-4.708825806567633e-5,7.565908112945316e-8,0.003198544736531598,-4.708995351933302e-5,7.566191375034777e-8,0.0031985318797554075,-4.7158036203798245e-5,7.577116598009077e-8,0.0031985373474858482,-4.729251335254058e-5,7.598640463765804e-8,0.003198585869566576,-4.7482775567525455e-5,7.629010685976644e-8,0.003198697155597323,-4.77081476564717e-5,7.664860219081877e-8,0.0031988819238857836,-4.794029858008897e-5,7.701607636820799e-8,0.003199138852327985,-4.8147471043280815e-5,7.734153154992998e-8,0.003199453210956632,-4.830010600773658e-5,7.757794512375888e-8,0.003199797758983186,-4.8377126251611665e-5,7.769236057072432e-8,0.0032001363178023106,-4.8371976704389703e-5,7.767540881795748e-8,0.0032004303140051693,-4.829716076321788e-5,7.754825940028813e-8,0.0032006480922657813,-4.818534649742223e-5,7.736402060215561e-8,0.0032007754503471137,-4.8084736666072045e-5,7.720004750070717e-8,0.0032008237523528764,-4.804734673697885e-5,7.713910918442968e-8,0.0032008304786310298,-4.811209016681051e-5,7.724247975155619e-8,0.0032008488052868407,-4.828932206014769e-5,7.75255161602495e-8,0.0032009288771208118,-4.8555592301733185e-5,7.794960329169746e-8,0.0032010998408043487,-4.886272668875077e-5,7.843695977208304e-8,0.003201361960637265,-4.915635461273817e-5,7.89004476629134e-8,0.0032016912406135044,-4.939361188750261e-5,7.927192014721211e-8,0.0032020513707647475,-4.955240233850549e-5,7.951689650027676e-8,0.003202405716929175,-4.963141986809062e-5,7.963431614369855e-8,0.003202725094131901,-4.964474472975755e-5,7.96475824883057e-8,0.0032029909049170156,-4.961523348656123e-5,7.959378125967193e-8,0.0032031952157390927,-4.9569099471490336e-5,7.951497736532009e-8,0.003203339535741044,-4.9532218017991734e-5,7.945241230521701e-8,0.003203433394698867,-4.9527674213515084e-5,7.944273135170713e-8,0.003203493051170196,-4.9573859322178696e-5,7.951503476725994e-8,0.0032035401504446515,-4.968261143955701e-5,7.968790885396807e-8,0.003203599881864006,-4.9857248372708116e-5,7.996622623173358e-8,0.0032036981474841027,-5.009083623491609e-5,8.033833401588e-8,0.003203857560932273,-5.036549668524096e-5,8.077497791863144e-8,0.003204092697562571,-5.0653692877754714e-5,8.123148677107812e-8,0.003204405679190628,-5.092213317310819e-5,8.165420910353239e-8,0.0032047836194003913,-5.1138171334250516e-5,8.199093925766638e-8,0.0032051993388942314,-5.1277508026645685e-5,8.220333981594443e-8,0.0032056159214573134,-5.1331152612609345e-5,8.227803147217174e-8,0.003205994476325643,-5.130950962968257e-5,8.223291039616594e-8,0.0032063034747539243,-5.124205747668012e-5,8.211628608958799e-8,0.0032065274675029567,-5.117202959915313e-5,8.199800522314307e-8,0.0032066727907678195,-5.114661833837934e-5,8.195353656090792e-8,0.003206768020942503,-5.120449980278048e-5,8.204400434520673e-8,0.003206857735831905,-5.1363916576045276e-5,8.229736031489842e-8,0.0032069901253816147,-5.161569359479557e-5,8.269759795845019e-8,0.0032072020803685336,-5.192501441612641e-5,8.318797642795423e-8,0.0032075077397297554,-5.2242393867866604e-5,8.368882847285539e-8,0.0032078955532431,-5.251946367429561e-5,8.412289258504691e-8,0.0032083345384939406,-5.272262269658563e-5,8.443706503733802e-8,0.0032087857334492185,-5.2839458337762004e-5,8.461246000974382e-8,0.0032092132683576424,-5.287735806351859e-5,8.466190722367029e-8,0.003209591378752329,-5.285732676741347e-5,8.461980304623928e-8,0.0032099067777057117,-5.28068081968459e-5,8.45304822826286e-8,0.0032101578456377655,-5.275393921740916e-5,8.443903221733049e-8,0.0032103524731652163,-5.272386017376191e-5,8.438550073902889e-8,0.003210505786562472,-5.273660287213019e-5,8.440164096217491e-8,0.0032106382225371155,-5.280577247081059e-5,8.450886182259405e-8,0.0032107738321281018,-5.293736316606222e-5,8.471631689347386e-8,0.0032109383060951215,-5.312841217033488e-5,8.501870672494748e-8,0.0032111560978738906,-5.3365752533195204e-5,8.53942849508674e-8,0.0032114462795934918,-5.362571089155793e-5,8.580446840164302e-8,0.003211817437324192,-5.3875979778961625e-5,8.619700739786424e-8,0.003212262941595191,-5.408075100149098e-5,8.651439387397291e-8,0.0032127589082548043,-5.42090965214644e-5,8.670741201761251e-8,0.003213267160170133,-5.4244595572723914e-5,8.675057308886833e-8,0.0032137438024166646,-5.419248668805494e-5,8.665344939450431e-8,0.003214151231767454,-5.4080711291759844e-5,8.646208359285265e-8,0.0032144693035585834,-5.395352361443707e-5,8.624839037585663e-8,0.003214701461565474,-5.385958237500533e-5,8.609072790016972e-8,0.003214873783886847,-5.383864063516811e-5,8.605238679805011e-8,0.0032150276171485034,-5.391105610832501e-5,8.616487457733809e-8,0.003215208326315366,-5.4072889410851724e-5,8.642041535988369e-8,0.0032154533705997484,-5.429755486548332e-5,8.677506471248515e-8,0.0032157828754069747,-5.4543390211428154e-5,8.716123185097693e-8,0.0032161952720170784,-5.47649828140714e-5,8.750601063943785e-8,0.0032166691643119804,-5.492483570390711e-5,8.7749822276115e-8,0.003217170484883344,-5.500177601999277e-5,8.785966932376333e-8,0.0032176621369899984,-5.499386164298536e-5,8.783350388091249e-8,0.0032181127441866936,-5.491583634520034e-5,8.76958803060696e-8,0.003218502126948113,-5.479314994168618e-5,8.748819344576886e-8,0.0032188229483265337,-5.465521433334049e-5,8.72578166749344e-8,0.0032190794757014783,-5.452988429357098e-5,8.704931644272088e-8,0.0032192849457666393,-5.443991014971355e-5,8.689888287838887e-8,0.003219458734952503,-5.440110974291796e-5,8.683149639470852e-8,0.003219623918717538,-5.442154904813298e-5,8.685964506488469e-8,0.0032198052118412182,-5.45010330062948e-5,8.698248405259667e-8,0.0032200268668433098,-5.463053766414709e-5,8.718490554543236e-8,0.0032203099278025797,-5.479171920972871e-5,8.743680309860852e-8,0.0032206683696555803,-5.4957218224956276e-5,8.769370344416006e-8,0.003221104252445989,-5.509302127948437e-5,8.790074530833945e-8,0.0032216031987040658,-5.516423932315975e-5,8.800209652952139e-8,0.003222132914621037,-5.514457142603367e-5,8.795617458979574e-8,0.003222647901010924,-5.502711200558859e-5,8.775290593353369e-8,0.0032231013851103294,-5.483131338436564e-5,8.74247239172623e-8,0.003223460966712298,-5.4600702849415643e-5,8.704264763661174e-8,0.003223720696988658,-5.43901749473945e-5,8.66955543476372e-8,0.0032239032022557705,-5.4248004296358326e-5,8.646099319840247e-8,0.003224051050262102,-5.4200944786757004e-5,8.638114273675721e-8,0.003224212268778945,-5.424827912428962e-5,8.645345453958669e-8,0.0032244265358801734,-5.4365234327404105e-5,8.663660081008881e-8,0.003224716276502034,-5.451231450454134e-5,8.686597920410975e-8,0.003225083737911467,-5.4646403659949004e-5,8.707189019189658e-8,0.0032255131188312245,-5.473059972318432e-5,8.719538813836393e-8,0.0032259761006378034,-5.4741087113638165e-5,8.719911679190398e-8,0.0032264390598020325,-5.467034723233956e-5,8.707212789604444e-8,0.003226870334335864,-5.452668660564738e-5,8.682879510984012e-8,0.0032272460710804887,-5.4330699940323715e-5,8.65029138253738e-8,0.0032275536298945894,-5.4109915442819836e-5,8.613902532997006e-8,0.003227792304669776,-5.389313593906661e-5,8.5783374691673e-8,0.0032279718677233277,-5.370570458175747e-5,8.547642058179856e-8,0.003228109845550558,-5.356634066004432e-5,8.524786544988952e-8,0.003228228456413095,-5.348557339633553e-5,8.511420042723426e-8,0.0032283518197443535,-5.346531342893715e-5,8.507801310989298e-8,0.0032285035568127823,-5.349896832429377e-5,8.512814037196994e-8,0.003228704536722173,-5.357174984312455e-5,8.524016481482288e-8,0.0032289703539402797,-5.366119984972382e-5,8.537735462686527e-8,0.00322930813206437,-5.373842092470895e-5,8.549282323459017e-8,0.003229712689921856,-5.377103839587337e-5,8.553448506801853e-8,0.0032301631836865975,-5.3729107718665944e-5,8.545465152637074e-8,0.0032306227277087924,-5.359428799950994e-5,8.522472059019744e-8,0.0032310441986026,-5.337012969281068e-5,8.48515280839209e-8,0.0032313836582013745,-5.30879790841398e-5,8.438660592029636e-8,0.0032316176061930268,-5.280197806460897e-5,8.391790250084734e-8,0.0032317548261706127,-5.2571609399665335e-5,8.354146004605948e-8,0.0032318343808087915,-5.243934120871027e-5,8.332524114371036e-8,0.00323190997001867,-5.24157284474321e-5,8.328513968311465e-8,0.003232029903870015,-5.247922773889295e-5,8.33849749888785e-8,0.0032322230037252673,-5.2587959715898925e-5,8.355594128527012e-8,0.0032324945300250224,-5.269508974157829e-5,8.372185756843382e-8,0.0032328299476484103,-5.2761097382812485e-5,8.381914925073835e-8,0.0032332022647684135,-5.2760565068347416e-5,8.380767128683809e-8,0.0032335796804347913,-5.268412304439345e-5,8.367349551296979e-8,0.003233931955256522,-5.2537170491451925e-5,8.342645104170425e-8,0.00323423510297691,-5.2336755010051395e-5,8.309480474079313e-8,0.003234474406802793,-5.210743061617814e-5,8.271847665355266e-8,0.0032346457437325534,-5.187668488346703e-5,8.234172294838152e-8,0.003234755280902423,-5.167055575138879e-5,8.200621219761825e-8,0.003234817807050895,-5.150997501251897e-5,8.174527616602243e-8,0.00323485410132211,-5.140821394599531e-5,8.157988013641992e-8,0.0032348878601373273,-5.1369622605597356e-5,8.15166024002056e-8,0.003234942697918216,-5.138953284328997e-5,8.154743911983669e-8,0.00323503947037617,-5.1454958354580704e-5,8.16508993774942e-8,0.0032351938886941546,-5.154582187779148e-5,8.179401797604287e-8,0.0032354142832091816,-5.16366609641141e-5,8.193524012891515e-8,0.003235699333554656,-5.1699018157927345e-5,8.202847891428973e-8,0.0032360358332845078,-5.170513116825102e-5,8.202923924758582e-8,0.003236397395298634,-5.163367599192616e-5,8.190391001440081e-8,0.0032367460274376706,-5.147751296830587e-5,8.164208997353886e-8,0.003237038911014802,-5.125146075858404e-5,8.126881868503913e-8,0.0032372413519731985,-5.099546813545693e-5,8.084938120768122e-8,0.0032373424767896393,-5.076735769152771e-5,8.04773994266105e-8,0.003237364737593232,-5.0623575968753e-5,8.024369261604461e-8,0.0032373583817348877,-5.0595930934664296e-5,8.01987556722749e-8,0.0032373814263608053,-5.067835383782129e-5,8.033154293976049e-8,0.0032374767927001143,-5.0831888417986464e-5,8.05778502518239e-8,0.0032376595358681605,-5.100299476696643e-5,8.08503013355666e-8,0.0032379179830066707,-5.1142929781694154e-5,8.106998345596535e-8,0.0032382234578475634,-5.121949714913483e-5,8.118548183125027e-8,0.0032385413765336594,-5.1220034229706235e-5,8.117745244402647e-8,0.0032388396301233986,-5.1148784000511076e-5,8.105395968506553e-8,0.00323909343633175,-5.1022080757357263e-5,8.084232217504016e-8,0.003239287476598087,-5.086344596635564e-5,8.058099601387515e-8,0.003239416418574005,-5.06993062299847e-5,8.031267394281034e-8,0.0032394844711164405,-5.055531403368913e-5,8.007849327535253e-8,0.0032395041778899027,-5.0453203864372276e-5,7.991313554603084e-8,0.003239494528968082,-5.0408228290502986e-5,7.98408045445796e-8,0.0032394784475627734,-5.0427301336513986e-5,7.987225828658261e-8,0.003239479791896909,-5.050810067219918e-5,8.000332058699083e-8,0.0032395202194974377,-5.063931236648878e-5,8.021522493846629e-8,0.003239616293252338,-5.080193546123921e-5,8.047671952390412e-8,0.003239777049036872,-5.097147176821398e-5,8.074769163503124e-8,0.003240002171167665,-5.112088531384368e-5,8.098412232278307e-8,0.0032402808961741075,-5.122423243494423e-5,8.114415044682696e-8,0.0032405918090109447,-5.126100829262938e-5,8.119521335082708e-8,0.003240904131438615,-5.122133435508816e-5,8.112236888320618e-8,0.003241181684719136,-5.111146117220087e-5,8.093692711688671e-8,0.003241390622446391,-5.095766931217798e-5,8.068237971757372e-8,0.0032415106650658305,-5.080520775946731e-5,8.04323546602781e-8,0.003241546514068598,-5.070868740467566e-5,8.027494782684523e-8,0.0032415324844812794,-5.071373081832885e-5,8.028313812372978e-8,0.003241523709398545,-5.083705921425271e-5,8.048281634683229e-8,0.0032415751240446157,-5.1057319994444045e-5,8.083823631077988e-8,0.003241719537245258,-5.132391935969942e-5,8.126660197144499e-8,0.0032419576140943988,-5.157842278878715e-5,8.167296421774885e-8,0.0032422632301883753,-5.177516910115313e-5,8.198373070848606e-8,0.0032425973491017465,-5.189151237656024e-5,8.216316480911329e-8,0.003242921385633165,-5.192728220314501e-5,8.221219939811576e-8,0.003243205429064354,-5.1898436692860174e-5,8.215775773060924e-8,0.0032434313058024543,-5.182970678799692e-5,8.204054311489319e-8,0.0032435923938506023,-5.1748673330064326e-5,8.190536290404036e-8,0.0032436920809447035,-5.1681708633171465e-5,8.179466859600291e-8,0.0032437419250657485,-5.165123951677518e-5,8.17443236041018e-8,0.0032437597611700603,-5.167373948957442e-5,8.178051974505204e-8,0.0032437676397874047,-5.1758154968282606e-5,8.191729901686929e-8,0.003243789408658554,-5.190473825027876e-5,8.215464440259327e-8,0.0032438478099100776,-5.2104555505873134e-5,8.247762756783664e-8,0.0032439612563935362,-5.234009583257239e-5,8.28573715553115e-8,0.0032441407595725984,-5.258721229750601e-5,8.325425050664329e-8,0.0032443875424479525,-5.281834024054875e-5,8.36232428780749e-8,0.0032446918276209393,-5.300675228469284e-5,8.392100559929466e-8,0.0032450332255609038,-5.3131371114476176e-5,8.411381289746435e-8,0.00324538295404514,-5.318148371486626e-5,8.418520437848297e-8,0.003245707983573782,-5.316071079859441e-5,8.414223757206918e-8,0.0032459772192329835,-5.3089364431137183e-5,8.401896535485175e-8,0.0032461694781570896,-5.300370532228837e-5,8.387484551908885e-8,0.003246281847351533,-5.2950284714670026e-5,8.37853066862844e-8,0.0032463352544695014,-5.297443793121066e-5,8.382308719834454e-8,0.0032463728424833803,-5.310479309421307e-5,8.403337508404443e-8,0.003246448216996769,-5.333992759564566e-5,8.441256609303461e-8,0.0032466062921121183,-5.364552457477591e-5,8.49040114435253e-8,0.0032468659901151594,-5.396605828032138e-5,8.541718992475005e-8,0.003247214553528512,-5.424562065011762e-5,8.586156956307863e-8,0.003247615679936334,-5.444642162568678e-5,8.617657458590432e-8,0.003248024912597425,-5.455655514944839e-5,8.634399975468773e-8,0.003248403432332568,-5.458687626580262e-5,8.638262859372707e-8,0.0032487255353343303,-5.4562352771310106e-5,8.633386467620277e-8,0.00324898008935198,-5.451326661190067e-5,8.624724859115626e-8,0.0032491685238771285,-5.4468896133598934e-5,8.617020704301661e-8,0.0032493017385686698,-5.44538837415368e-5,8.614231992982142e-8,0.0032493972235823195,-5.448639212370825e-5,8.619253072529561e-8,0.0032494766715691,-5.4577106999117414e-5,8.633766110669544e-8,0.003249563821635595,-5.4728537878472483e-5,8.658130339795376e-8,0.0032496821379050258,-5.4934496846960336e-5,8.691293350608795e-8,0.0032498520196944476,-5.5180047124981716e-5,8.730779131766455e-8,0.0032500875683692987,-5.544249647615775e-5,8.772852392629017e-8,0.0032503934051933206,-5.569395062737085e-5,8.812944569042736e-8,0.0032507623946056432,-5.5905572624570456e-5,8.846361811302392e-8,0.0032511752416808635,-5.60531534073218e-5,8.869203900002466e-8,0.0032516027189509527,-5.6122949655416366e-5,8.879316740083876e-8,0.003252010653866079,-5.6116271961945236e-5,8.87702629117698e-8,0.0032523669850277413,-5.605136928982403e-5,8.865417136694602e-8,0.0032526495630223616,-5.596163996267052e-5,8.850004846746351e-8,0.003252852996146235,-5.588978132512746e-5,8.837752315420322e-8,0.0032529925562878982,-5.58782471815996e-5,8.83550511189378e-8,0.003253103082055259,-5.595758026448335e-5,8.848108953757554e-8,0.0032532314776745693,-5.613576384150119e-5,8.876716640678854e-8,0.0032534234568621025,-5.6393001850667115e-5,8.917985280515563e-8,0.0032537084871765787,-5.668575826548498e-5,8.964767779069584e-8,0.0032540894242032077,-5.696017640428366e-5,9.008307761306017e-8,0.00325454214619616,-5.716962075359378e-5,9.041084937999461e-8,0.0032550252674333844,-5.728830620990315e-5,9.059011621990187e-8,0.003255494511827089,-5.731556283163272e-5,9.06209904156305e-8,0.003255914883576044,-5.7271048375594106e-5,9.0536487245569e-8,0.003256266746644497,-5.71854418674298e-5,9.03871423788393e-8,0.003256546050101389,-5.709145577327869e-5,9.022629331978918e-8,0.003256761198809244,-5.701770488175832e-5,9.010018411835402e-8,0.0032569290319573213,-5.6985589687069876e-5,9.004308407198988e-8,0.0032570712782715805,-5.700820517414628e-5,9.007569729439265e-8,0.003257211829634789,-5.709019855395602e-5,9.02050273070369e-8,0.003257374555642879,-5.722785472994945e-5,9.042451477474267e-8,0.0032575811280771455,-5.740918789972536e-5,9.07141464433097e-8,0.0032578484112563417,-5.761434937787547e-5,9.104111671626653e-8,0.003258185352705804,-5.781702102123823e-5,9.136217618930464e-8,0.0032585898547709312,-5.7987501554828986e-5,9.162880083070914e-8,0.003259046711760422,-5.8097856157750106e-5,9.179571951463989e-8,0.0032595281106661137,-5.812865707175766e-5,9.183195308320635e-8,0.003259997899742414,-5.807559874358659e-5,9.173151942039728e-8,0.003260419534272522,-5.7953377600878414e-5,9.151954278320197e-8,0.003260765818064894,-5.7794560130481856e-5,9.125009531413922e-8,0.0032610273094332534,-5.7642803315349266e-5,9.099481763997835e-8,0.0032612163205118245,-5.754195090058938e-5,9.082492438170712e-8,0.0032613648222029144,-5.752416949150301e-5,9.07918667306029e-8,0.0032615165714595593,-5.7600716096652344e-5,9.09125486368035e-8,0.003261715522120589,-5.7758163232549566e-5,9.116362370356967e-8,0.003261993680028687,-5.796146329096944e-5,9.148694570509478e-8,0.0032623620293660872,-5.8163394938097374e-5,9.180524978805767e-8,0.003262807665272582,-5.8317766793719975e-5,9.20437012761951e-8,0.0032632983134054426,-5.839199548958222e-5,9.215020451540345e-8,0.0032637924706452283,-5.8374669624859956e-5,9.210741718701442e-8,0.0032642511156409566,-5.827592207902026e-5,9.193302480930112e-8,0.0032646467560847373,-5.8121634092867766e-5,9.167002565308534e-8,0.003264967464613854,-5.794476140729533e-5,9.137245205768258e-8,0.0032652161360441057,-5.777729029325265e-5,9.109227604970783e-8,0.0032654068966987506,-5.764485386744147e-5,9.087078295628466e-8,0.003265560763456718,-5.756421591411039e-5,9.073466938213295e-8,0.0032657018358711034,-5.754278131830879e-5,9.069539608026732e-8,0.0032658544101094944,-5.757911789189286e-5,9.075008999633211e-8,0.0032660408074434333,-5.766372839766714e-5,9.088277448331733e-8,0.003266279396647697,-5.777976701135738e-5,9.106550153542938e-8,0.003266582301739539,-5.790395532285883e-5,9.12598753635655e-8,0.0032669526451217174,-5.80083795326496e-5,9.142009964322477e-8,0.003267381767555401,-5.8063972041273024e-5,9.149881185930952e-8,0.0032678476163183977,-5.804619770493952e-5,9.145646309337639e-8,0.003268316164476314,-5.79424713012002e-5,9.12733988533491e-8,0.0032687475221006164,-5.7759070899220414e-5,9.096097972973574e-8,0.003269106529960257,-5.7523825509117984e-5,9.056570793575683e-8,0.0032693746058921917,-5.7281393394498796e-5,9.01612217244734e-8,0.0032695575700859222,-5.7081169177186004e-5,8.982829299441299e-8,0.003269685200835826,-5.696205583363011e-5,8.962983858648573e-8,0.003269802214385346,-5.69404396125155e-5,8.959138558936853e-8,0.0032699545344188102,-5.700604476264368e-5,8.969464615227079e-8,0.0032701763009091883,-5.7126338282034846e-5,8.988518777066455e-8,0.003270481677542585,-5.725676162404585e-5,9.008956185060092e-8,0.0032708629470038705,-5.735286992395743e-5,9.023531943545998e-8,0.00327129431081459,-5.73809369580062e-5,9.026823726629858e-8,0.003271739599354458,-5.7324683909892404e-5,9.0162995318363e-8,0.0032721614993477402,-5.7187059246788255e-5,8.992569167509696e-8,0.0032725298445275717,-5.698731841848309e-5,8.958873870059514e-8,0.0032728270521627735,-5.675482647236528e-5,8.920055536744774e-8,0.003273049851570274,-5.652171851946322e-5,8.881356947561132e-8,0.0032732076970815966,-5.6316492523811355e-5,8.847388481842329e-8,0.003273319145670565,-5.615979289425225e-5,8.821459453534936e-8,0.0032734076545255755,-5.6062581528121386e-5,8.80529729256984e-8,0.003273497839452653,-5.602614665502433e-5,8.799058220459504e-8,0.003273612612866018,-5.604313201827532e-5,8.801494830994981e-8,0.0032737710867281598,-5.609888691693807e-5,8.81017115844299e-8,0.0032739868282610452,-5.617282175496241e-5,8.821681580619211e-8,0.0032742660365082388,-5.6239927611709573e-5,8.831905491514963e-8,0.003274605453936708,-5.627300819139812e-5,8.836386764965425e-8,0.0032749903608651097,-5.624637481283029e-5,8.830953041101465e-8,0.0032753938061936853,-5.614154823740327e-5,8.812653176627841e-8,0.0032757789936782864,-5.595449360495289e-5,8.78092919463083e-8,0.003276106647287594,-5.5701960526054305e-5,8.738628367074491e-8,0.0032763471421135533,-5.5422576587764e-5,8.692152997987455e-8,0.003276493258995722,-5.516877259292599e-5,8.650115186701256e-8,0.0032765664014518425,-5.499014654352684e-5,8.6206007430559e-8,0.003276610999942624,-5.491529491512299e-5,8.608196484440229e-8,0.00327667876464851,-5.494164014254628e-5,8.612345199946136e-8,0.0032768108494707626,-5.5038149965003114e-5,8.627829358674474e-8,0.0032770262708863127,-5.5157998227194705e-5,8.646888984364038e-8,0.0032773198064892668,-5.525387498988542e-5,8.661760852501955e-8,0.003277667339223204,-5.528988528837087e-5,8.666631731922832e-8,0.0032780346135977243,-5.5247658906088445e-5,8.658614562003795e-8,0.0032783860663120725,-5.512713483912658e-5,8.637835326428021e-8,0.0032786918994025917,-5.494363190933129e-5,8.606912261480339e-8,0.0032789327276445193,-5.472280951801439e-5,8.570104945011115e-8,0.003279101674465376,-5.449476059083265e-5,8.532342409842275e-8,0.0032792040453030104,-5.4288301754132294e-5,8.498301212375031e-8,0.0032792550494914192,-5.4126402494692005e-5,8.471678473867611e-8,0.00327927635003745,-5.402331015253779e-5,8.454741469132955e-8,0.003279292261048445,-5.398344931011103e-5,8.448159405887646e-8,0.0032793262697919023,-5.4001841681931624e-5,8.451073771217038e-8,0.0032793983038223334,-5.406554644950239e-5,8.461328637466328e-8,0.003279522775013503,-5.4155543035676e-5,8.475773055077884e-8,0.0032797071337421773,-5.4248736184423704e-5,8.490590178054932e-8,0.0032799506498463736,-5.432014534373688e-5,8.501666483516674e-8,0.003280243299674806,-5.434560660615751e-5,8.505051210231342e-8,0.003280565004985942,-5.430549748269372e-5,8.497579494488648e-8,0.003280886168989561,-5.4189871664097075e-5,8.47771184438119e-8,0.003281171139090372,-5.4004474659509736e-5,8.446499011144445e-8,0.003281386101154559,-5.377533480404946e-5,8.408301336304262e-8,0.0032815110470657827,-5.354778435894943e-5,8.370597725390225e-8,0.003281551525320081,-5.3376005048922325e-5,8.342256462979238e-8,0.0032815423544261006,-5.3303997698127796e-5,8.330417977081286e-8,0.0032815375199139597,-5.334662167257096e-5,8.337402779899631e-8,0.003281589425999078,-5.3482477388724635e-5,8.359571772677401e-8,0.003281729077837722,-5.366347603158219e-5,8.388931201996357e-8,0.0032819577992785165,-5.383448660629819e-5,8.416390530143764e-8,0.003282252028816867,-5.3951461208844274e-5,8.434755805679241e-8,0.003282575064733863,-5.399087527054447e-5,8.440270284958065e-8,0.0032828888308288045,-5.395041499415586e-5,8.432692167156779e-8,0.0032831620823933123,-5.384442525035143e-5,8.414501783308623e-8,0.003283374577592845,-5.369758720472906e-5,8.389827797025655e-8,0.0032835182149421297,-5.3538900495709054e-5,8.363445972132653e-8,0.003283596317507677,-5.3396677990892325e-5,8.339967143688218e-8,0.0032836217594359217,-5.3294597136367996e-5,8.323212142857587e-8,0.0032836142689651616,-5.3248868881598726e-5,8.31577096068053e-8,0.0032835972456282487,-5.326663219322064e-5,8.318754756177193e-8,0.003283594445314077,-5.33455619881586e-5,8.331735797629278e-8,0.003283626858166137,-5.34746355750414e-5,8.35286872417797e-8,0.0032837101355881193,-5.363590835227975e-5,8.379175121758466e-8,0.0032838527983820075,-5.3806929427041975e-5,8.406937560267436e-8,0.003284055181100754,-5.396343946274494e-5,8.432148778286718e-8,0.0032843089773761463,-5.40822511951771e-5,8.450998775388706e-8,0.003284597358913076,-5.414438100313206e-5,8.460404446842303e-8,0.003284895834787221,-5.413857912979374e-5,8.458595257932233e-8,0.003285174445296768,-5.406532947278778e-5,8.445757818292492e-8,0.0032854023338345904,-5.3940697089698616e-5,8.424636958756322e-8,0.0032855554831677934,-5.379806390910282e-5,8.400782714837921e-8,0.003285626815766494,-5.3684562539693467e-5,8.38193737194727e-8,0.0032856347701112503,-5.3649414340871245e-5,8.376117760633833e-8,0.0032856235616832005,-5.3725485877918647e-5,8.38860837426238e-8,0.003285650142636974,-5.391249164401037e-5,8.419236027689752e-8,0.0032857616382241683,-5.4173556173630084e-5,8.461836300416228e-8,0.003285976011289329,-5.444965808100916e-5,8.50665090145353e-8,0.003286277545198635,-5.468347961861177e-5,8.544264341871019e-8,0.0032866275363075573,-5.483838580460321e-5,8.568728752895917e-8,0.0032869809330381304,-5.490461627338049e-5,8.578565026164803e-8,0.0032872996339806037,-5.489474335285152e-5,8.575977711296552e-8,0.003287559053510933,-5.48347345844862e-5,8.565341922089876e-8,0.0032877491677817746,-5.475543920672599e-5,8.551775502054806e-8,0.0032878725457978937,-5.4686451467669074e-5,8.540127833973602e-8,0.0032879413934742783,-5.465235422268597e-5,8.534381381044643e-8,0.003287974597188788,-5.4670536130827427e-5,8.53731992403231e-8,0.003287994886136215,-5.474993658443841e-5,8.550343585455102e-8,0.003288026004617243,-5.489052942074253e-5,8.573393033814724e-8,0.0032880898877680324,-5.508355309891816e-5,8.604985500404462e-8,0.003288203921857211,-5.5312587539400495e-5,8.642385409484243e-8,0.0032883785505384453,-5.5555608027442216E-05,8.681938148259401e-8,0.0032886156357365445,-5.578790705412445e-5,8.719554080619211e-8,0.0032889078436774757,-5.5985521987479445e-5,8.751283667062376e-8,0.003289239125545009,-5.612881998939157e-5,8.77392146012537e-8,0.003289586318797038,-5.620594849831879e-5,8.78558281449679e-8,0.0032899218910641607,-5.621585137160659e-5,8.786195042061433e-8,0.0032902179191576634,-5.617054021271309e-5,8.77784760736655e-8,0.0032904515278464005,-5.609599525829377e-5,8.764903319639631e-8,0.003290611690989794,-5.603034994237022e-5,8.753663675600585e-8,0.0032907060886177963,-5.601757230920074e-5,8.751312401969255e-8,0.0032907648315062244,-5.60957001758165e-5,8.763993271030684e-8,0.00329083651219213,-5.628175714456582e-5,8.794367269940098e-8,0.003290973902945432,-5.656023599277606e-5,8.839762192953688e-8,0.003291213321631433,-5.6884077700507716e-5,8.892363541663668e-8,0.003291558763057707,-5.7191191598862794e-5,8.941943124269481e-8,0.0032919809643103797,-5.742839856654776e-5,8.979798297636507e-8,0.0032924313677109907,-5.756902600419823e-5,9.001640079964623e-8,0.0032928611324823196,-5.7616237434723784e-5,9.008120657162066e-8,0.003293234884122227,-5.759476981903807e-5,9.003437623650073e-8,0.003293535602904595,-5.753893290328132e-5,8.993321103832823e-8,0.003293762927268325,-5.7482792094576774e-5,8.983397854989548e-8,0.003293928650397064,-5.745439610101603e-5,8.978246898705095e-8,0.003294052074754002,-5.7473344437337244e-5,8.981023130920463e-8,0.003294156313027807,-5.755021904012821e-5,8.993390698836747e-8,0.0032942654733313977,-5.768674160814335e-5,9.01556607176256e-8,0.0032944022662521263,-5.787621616364838e-5,9.046394738638393e-8,0.003294585697181951,-5.810428412374258e-5,9.083470767938509e-8,0.003294828730883638,-5.835025192829971e-5,9.123350329312376e-8,0.0032951361110117538,-5.858935210068161e-5,9.161924961334033e-8,0.003295502862145243,-5.879608733804884e-5,9.194981099819587e-8,0.0032959140922813155,-5.894836427269165e-5,9.218894166181916e-8,0.003296346501630117,-5.903178845858687e-5,9.2313465377073e-8,0.0032967716942378903,-5.904330752969372e-5,9.231927451156279e-8,0.003297161013652729,-5.8993325195830865e-5,9.222465017716898e-8,0.0032974912528637187,-5.8905595820280855e-5,9.206977518622295e-8,0.0032977504065195102,-5.881449638135142e-5,9.191186754025751e-8,0.003297942473857903,-5.875940209359208e-5,9.181563871498607e-8,0.0032980898714052753,-5.877616173854993e-5,9.183921908280787e-8,0.0032982314957932714,-5.88866346272826e-5,9.201718962789459e-8,0.0032984146833885644,-5.908904162486795e-5,9.23451566292984e-8,0.0032986812779857745,-5.935379884542151e-5,9.277334751463147e-8,0.003299051997951586,-5.962945134656554e-5,9.321663709787946e-8,0.003299516827886728,-5.985901363351853e-5,9.358146928311346e-8,0.0033000378122319263,-5.999998453310655e-5,9.379868554416737e-8,0.003300563468977945,-6.003775679601342e-5,9.384541959529023e-8,0.003301046759699778,-5.9986342425414024e-5,9.374604054768167e-8,0.0033014576765286454,-5.987863396959832e-5,9.355579500500295e-8,0.003301786809054379,-5.975339670750789e-5,9.33390980278829e-8,0.0033020419823445663,-5.964508164161518e-5,9.315264867329e-8,0.0033022421362587082,-5.9578548895871055e-5,9.303685979764736e-8,0.003302411561432909,-5.9567748630520254e-5,9.301394192772079e-8,0.0033025757102160976,-5.961647141519134e-5,9.308938092423752e-8,0.003302758454813665,-5.971971311326604e-5,9.32543085753427e-8,0.003302980149123383,-5.986499809573707e-5,9.348767984635991e-8,0.0033032558966772426,-6.003362496588928e-5,9.375826851834662e-8,0.003303593705146403,-6.0202192353766145e-5,9.402715772445558e-8,0.0033039926166897105,-6.034495084095433e-5,9.425167222522078e-8,0.003304441386900897,-6.043737478577002e-5,9.439138689843304e-8,0.003304918618617791,-6.046082993353868e-5,9.441594479608006e-8,0.0033053952081656575,-6.040751190609572e-5,9.431324511412548e-8,0.0033058394190006372,-6.028418972979809e-5,9.409552551950787e-8,0.0033062239072710452,-6.011307792870043e-5,9.380056022170947e-8,0.0033065329819612454,-5.99287475949815e-5,9.348622559924204e-8,0.003306767914704313,-5.977122717532698e-5,9.321879190076651e-8,0.003306948486177933,-5.9676703637333575e-5,9.305741226162379e-8,0.0033071098761496675,-5.966803032891732e-5,9.303855751819586e-8,0.003307295078633383,-5.974750722150152e-5,9.316446634613662e-8,0.003307544114132092,-5.9894223093106617E-05,9.339925812123948e-8,0.0033078824817017226,-6.006764076265878e-5,9.367527554290179e-8,0.003308312428674662,-6.021771715946743e-5,9.390997219756039e-8,0.003308810868846452,-6.02993136284251e-5,9.402960860305769e-8,0.003309335890088662,-6.028585030600706e-5,9.39915224159716e-8,0.003309839846317023,-6.017646168426142e-5,9.379561381316522e-8,0.003310283495942255,-5.999380790271972e-5,9.348042402784567e-8,0.0033106453888089448,-5.977450811021991e-5,9.310709708273535e-8,0.0033109239015205183,-5.955734946844783e-5,9.273979011758474e-8,0.003311133299984977,-5.937407692846487e-5,9.243051520461885e-8,0.0033112972340637236,-5.924481776115903e-5,9.221178385233012e-8,0.0033114426199441147,-5.917750316763905e-5,9.209590179549796e-8,0.0033115952609545363,-5.9169497804775444e-5,9.207784107991695e-8,0.003311777204723194,-5.920987375766593e-5,9.213904652853273e-8,0.0033120052080999,-5.92814938356559e-5,9.225082851606375e-8,0.003312289594904694,-5.936274846059623e-5,9.237717028262174e-8,0.003312633024578902,-5.942929679557276e-5,9.247760893901174e-8,0.003313029137070735,-5.945642637260442e-5,9.251122688928723e-8,0.0033134615879803833,-5.942257807852542e-5,9.244260873645003e-8,0.0033139044987459776,-5.931413137224047e-5,9.22498336783901e-8,0.0033143255654085853,-5.913063940039792e-5,9.193309185903323e-8,0.003314692523404364,-5.888852657791199e-5,9.152061902109267e-8,0.003314982071759978,-5.862063074863608e-5,9.106765658072329e-8,0.0033151883441194956,-5.836990960235362e-5,9.064573525743296e-8,0.003315327061036844,-5.817820907612507e-5,9.032387007253822e-8,0.003315432756404787,-5.807381239007963e-5,9.014792415786519e-8,0.003315549502730872,-5.80625870862475e-5,9.012617527068651e-8,0.0033157184572218204,-5.8126053541180765e-5,9.022654455023874e-8,0.003315966551858763,-5.8226689676969886e-5,9.038585941639497e-8,0.0033162996332138915,-5.831825523870404e-5,9.052728727571216e-8,0.0033167015288640424,-5.835787971070538e-5,9.058041563143791e-8,0.0033171388754599613,-5.8316694902620264e-5,9.049864230177064e-8,0.003317570199537387,-5.818631498100734e-5,9.026951683504713e-8,0.0033179566224040904,-5.7979533462259516e-5,8.99154851350754e-8,0.0033182710352989515,-5.772533753434543e-5,8.94853309482593e-8,0.003318503156852944,-5.746022504077495e-5,8.903967082003617e-8,0.003318659520612165,-5.721893166409305e-5,8.863565691424088e-8,0.0033187593907932924,-5.7027409664830245e-5,8.831554830627552e-8,0.0033188288152567313,-5.6899447070337116e-5,8.810136402150192e-8,0.0033188949683195744,-5.683663868685322e-5,8.799503967854189e-8,0.0033189820031886176,-5.683044444173091e-5,8.79819251290983e-8,0.0033191086079180677,-5.686498657172212e-5,8.80353851458633e-8,0.0033192868090701146,-5.6919687627007744e-5,8.812108202417043e-8,0.0033195213608058194,-5.6971468212093134e-5,8.820056393045532e-8,0.003319809205334997,-5.6996756676009524e-5,8.823463939940167e-8,0.0033201388682853913,-5.6973850769248384e-5,8.818741927408212e-8,0.0033204901645404743,-5.688617916715095e-5,8.803185327819643e-8,0.0033208351653437364,-5.672667481568836e-5,8.775700668157399e-8,0.0033211417606726764,-5.650258196722333e-5,8.737589343481958e-8,0.0033213807589085697,-5.623860290952227e-5,8.693042466255639e-8,0.003321535704580842,-5.5975194089382036e-5,8.64882803546673e-8,0.003321611779853912,-5.575964063734652e-5,8.612788421461543e-8,0.0033216383488875716,-5.563121550563371e-5,8.591372038897917e-8,0.00332166160133251,-5.560648771923718e-5,8.587208299016034e-8,0.003321729332346463,-5.567246407025703e-5,8.597999999454416e-8,0.0033218749696411454,-5.5791288194139026e-5,8.617344710132884e-8,0.003322108078793622,-5.591357362818337e-5,8.636987047930183e-8,0.003322414074917141,-5.599359775464645e-5,8.649361999558831e-8,0.0033227610657908736,-5.600062818328033e-5,8.649468343439781e-8,0.0033231098129842453,-5.592409172339057e-5,8.635693899550423e-8,0.003323423401229845,-5.577304858807897e-5,8.60968278743868e-8,0.0033236746106560327,-5.5571625019046895e-5,8.57553706414179e-8,0.0033238501378285963,-5.535223551652658e-5,8.538670353148495e-8,0.003323951512978097,-5.5148243821503265e-5,8.504591708672522e-8,0.0033239930515267515,-5.4987516475655016e-5,8.477855814651931e-8,0.003323997693098464,-5.4888022929405465e-5,8.461360179444422e-8,0.0033239919654675055,-5.485601986581888e-5,8.456067453943338e-8,0.0033240012834951657,-5.4886614374086276e-5,8.461111130656435e-8,0.00332404640453801,-5.496599005265156e-5,8.474164448132102e-8,0.003324141328817078,-5.507438956499113e-5,8.491926542726227e-8,0.003324292421254159,-5.5189074106772154e-5,8.510604823670503e-8,0.0033244982624229583,-5.528690636714247e-5,8.526342573891019e-8,0.0033247498139609742,-5.534665974060568e-5,8.5356116539381e-8,0.003325030738318475,-5.535139742517621e-5,8.535622814349039e-8,0.003325318078773487,-5.529132808874682e-5,8.524810407518335e-8,0.0033255840434287193,-5.516732559483926e-5,8.503412127897562e-8,0.003325800025884042,-5.4994500283684165e-5,8.474038755337137e-8,0.003325943636647162,-5.4803921202816106e-5,8.441925947919739e-8,0.003326007954119694,-5.463949661780294e-5,8.414386557641033e-8,0.0033260093929748016,-5.454751850488496e-5,8.39906316797749e-8,0.0033259881913321188,-5.4560143825206843e-5,8.401195873056964e-8,0.0033259972865628765,-5.4680122236649234e-5,8.421112518435034e-8,0.003326082679984568,-5.4876669269890736e-5,8.453576539427439e-8,0.0033262656698723574,-5.509660108184346e-5,8.489670021080734e-8,0.0033265367421952,-5.528454025680654e-5,8.520177547374201e-8,0.0033268625692368203,-5.540089651290604e-5,8.53858406600953e-8,0.0033271997836301316,-5.5430263445104554e-5,8.542454745717457e-8,0.00332750801243725,-5.538020410605459e-5,8.533193941439912e-8,0.0033277582273325535,-5.527451512296222e-5,8.514878834424156e-8,0.0033279360985943923,-5.514504454421498e-5,8.492865234127454e-8,0.0033280417206101223,-5.502443713341801e-5,8.47257264967664e-8,0.0033280872119350394,-5.494062573953781e-5,8.458583816329359e-8,0.0033280931856418602,-5.4913121909954754e-5,8.454056432249686e-8,0.003328084687829209,-5.49510529651956e-5,8.460424445406648e-8,0.003328087119786794,-5.505287514330795e-5,8.477367296994299e-8,0.003328122619004344,-5.520754438276987e-5,8.503008040542494e-8,0.0033282072794208633,-5.539681605654844e-5,8.534289014342119e-8,0.0033283494784650124,-5.559823205385741e-5,8.567459021016955e-8,0.0033285493241682613,-5.5788247308437714e-5,8.5985886311372e-8,0.0033287989546007955,-5.594511202878772e-5,8.624053969095568e-8,0.0033290834152926,-5.605145404558202e-5,8.640978601385084e-8,0.0033293820025522038,-5.609665354800625e-5,8.647641681844645e-8,0.00332967012765513,-5.607914249037254e-5,8.64386360154981e-8,0.003329922108265471,-5.600868372770514e-5,8.63137014691309e-8,0.003330115618151409,-5.590807269377462e-5,8.614043768918587e-8,0.0033302381328333365,-5.58126677029861e-5,8.597808953775239e-8,0.0033302943335076583,-5.5765475825965935e-5,8.589791861426393e-8,0.0033303112431023363,-5.580611329656748e-5,8.596488539474054e-8,0.003330335893358347,-5.595512706192685e-5,8.621187561535514e-8,0.0033304217950196257,-5.620076748901601e-5,8.661809726569148e-8,0.0033306077541668403,-5.649824615334275e-5,8.710815973363818e-8,0.003330900673735715,-5.678551821777345e-5,8.757850948338549e-8,0.0033312733708816735,-5.7007580014031255e-5,8.793794593475561e-8,0.003331677827847687,-5.713506396332166e-5,8.81385544183494e-8,0.0033320641462310304,-5.7168762976044525e-5,8.818303689777447e-8,0.003332394888741356,-5.713232454494835e-5,8.81121521924967e-8,0.003332650948899174,-5.706056072566515e-5,8.79848172366316e-8,0.0033328307387244707,-5.69892054818512e-5,8.786079588531413e-8,0.003332946103134148,-5.6948270940260595e-5,8.7789662082767e-8,0.003333017524013881,-5.695869565914077e-5,8.780546633003202e-8,0.003333069785980845,-5.7031151550971855e-5,8.79250644837299e-8,0.003333128293176569,-5.7166122827538784e-5,8.814848616597651e-8,0.003333215942814037,-5.735486447701515e-5,8.846062555209589e-8,0.003333350526081416,-5.758107712399529e-5,8.883400189972032e-8,0.003333542711568079,-5.782323256543382e-5,8.923255045240708e-8,0.0033337948024626724,-5.805748921759443e-5,8.961641831353482e-8,0.0033341004955474854,-5.826092281925177e-5,8.994735848331943e-8,0.0033344456574180216,-5.8414663420069585e-5,9.019404254409442e-8,0.0033348099763535065,-5.850667539814434e-5,9.033680470762473e-8,0.0033351693972139954,-5.8534013007029704e-5,9.037145788055351e-8,0.0033354992652454255,-5.850435337312846e-5,9.031176994724097e-8,0.003335778150817505,-5.8436628216984924e-5,9.019026948162117e-8,0.0033359924676545083,-5.836033415719681e-5,9.005674088553579e-8,0.003336141696475799,-5.831247259530645e-5,8.99728131408324e-8,0.003336242937122228,-5.833081796090152e-5,9.000064726389226e-8,0.003336332072852576,-5.844314497737879e-5,9.018519988192054e-8,0.003336457993721301,-5.8654611621949015e-5,9.053364701309959e-8,0.003336668034416213,-5.8939341334053395e-5,9.100181248328803e-8,0.0033369886308538366,-5.9243988034202145e-5,9.15003563787348e-8,0.0033374117211466396,-5.950577741976175e-5,9.192485569877443e-8,0.0033378966406314506,-5.9676814334938345e-5,9.219623025373824e-8,0.003338387060585492,-5.974061238822445e-5,9.228818050131115e-8,0.003338832161640395,-5.9712769824558396e-5,9.222809662066525e-8,0.003339200660884803,-5.9629238348668325e-5,9.207713490030904e-8,0.0033394839946629365,-5.9531508527586526e-5,9.19051435138701e-8,0.00333969194933606,-5.9455615021928336e-5,9.177216062406416e-8,0.0033398456958361393,-5.9426735296063406e-5,9.171952556625893e-8,0.0033399714625476887,-5.94580076063395e-5,9.176821138029921e-8,0.0033400959454044452,-5.9551503177061825e-5,9.19207583444299e-8,0.003340243216604815,-5.969991931487511e-5,9.21642828744451e-8,0.003340432528612182,-5.988845372977386e-5,9.247363390315894e-8,0.00334067661964073,-6.009682747560091e-5,9.281470236403697e-8,0.003340980391006287,-6.0301603901974886e-5,9.314821825194654e-8,0.0033413400860247433,-6.047899922745841e-5,9.34344253905957e-8,0.0033417433406987395,-6.0608161718892285e-5,9.363861218700703e-8,0.0033421704338331562,-6.0674530868574566e-5,9.373681434940468e-8,0.003342596793867571,-6.067274472862805e-5,9.372073186756808e-8,0.003342996619504433,-6.060857747387037e-5,9.360092417739725e-8,0.0033433472973181913,-6.049938316515723e-5,9.340736779360886e-8,0.003343634076313921,-6.037265637678459e-5,9.318674843140178e-8,0.003343854352958671,-6.026253039672385e-5,9.29962869527095e-8,0.0033440207974379525,-6.02040503597778e-5,9.289398103642671e-8,0.00334416209570793,-6.0225227664861864e-5,9.292540486542561e-8,0.0033443195738953684,-6.033783862182839e-5,9.310869759814082e-8,0.0033445382535737425,-6.052967926745262e-5,9.342213643036966e-8,0.0033448528768625176,-6.076271261213488e-5,9.380146725962548e-8,0.0033452733341006566,-6.098129519580642e-5,9.415379750598335e-8,0.0033457773304763423,-6.11302103754188e-5,9.43875995339562e-8,0.003346316441695281,-6.117498982465232e-5,9.444642575943193e-8,0.0033468338086486238,-6.111354333006799e-5,9.432810795018451e-8,0.0033472838692474196,-6.097324927755117e-5,9.4079645301939e-8,0.0033476441985163447,-6.0797240704200516e-5,9.377398884436344e-8,0.0033479163084475117,-6.062888070521747e-5,9.348385258171712e-8,0.003348119017326552,-6.050124738963157e-5,9.326410433273226e-8,0.0033482798563691583,-6.043317112036643e-5,9.314535120928058e-8,0.0033484280459571253,-6.0429873261064216e-5,9.313533471622201e-8,0.0033485900303240564,-6.0485597297215256e-5,9.322360188274091e-8,0.0033487870427821647,-6.058650061285441e-5,9.338645264051759e-8,0.003349033779148276,-6.071317745669125e-5,9.359112405668456e-8,0.003349337512154647,-6.084287930407258e-5,9.379941019517652e-8,0.0033496973868342426,-6.0951778738148076e-5,9.39713912066027e-8,0.0033501040189214903,-6.1017654657638296e-5,9.406994902831682e-8,0.003350539852327468,-6.102313701204754e-5,9.406628005534092e-8,0.0033509808424563464,-6.0959184102096446e-5,9.394579478956938e-8,0.0033513997985662727,-6.0828035243102085e-5,9.371305998195274e-8,0.003351771242630648,-6.064464806465786e-5,9.339407682046672e-8,0.0033520770502697586,-6.043567280060645e-5,9.303431185934628e-8,0.0033523115992083793,-6.023549059632611e-5,9.269175686275925e-8,0.0033524849538567095,-6.0079656147178764e-5,9.242570667708549e-8,0.003352622868607595,-5.999683644913714e-5,9.228321247007672e-8,0.0033527629108964156,-6.0000858451751614e-5,9.228598308330152e-8,0.0033529466888537886,-6.0084899028015664e-5,9.242109352946563e-8,0.003353209163212818,-6.0220101719581925e-5,9.263915942649568e-8,0.003353567452423346,-6.036056292024498e-5,9.286301996208644e-8,0.003354013074553909,-6.045506176241125e-5,9.300742375322236e-8,0.003354511938151932,-6.0462793179074204e-5,9.300515855826013e-8,0.003355013937094379,-6.036701837740332e-5,9.282957547814603e-8,0.0033554690078815767,-6.018006277425595e-5,9.250263119120252e-8,0.0033558424476254254,-5.9937221757790955e-5,9.208440293612802e-8,0.0033561228412348943,-5.9683282240027307e-5,9.165030735952862e-8,0.003356320744440452,-5.9458664926667036e-5,9.126781835699132e-8,0.003356461215846782,-5.929059997108527e-5,9.09818074709203e-8,0.0033565749791113304,-5.919060979973586e-5,9.081060603989335e-8,0.0033566915189816907,-5.915640839670276e-5,9.07494897969949e-8,0.0033568350305881473,-5.91755770416691e-5,9.077702401431161e-8,0.003357022613830941,-5.9229226963443656e-5,9.086121990946202e-8,0.003357263701159578,-5.929496452229679e-5,9.096440629587108e-8,0.003357559911226247,-5.934921839576949e-5,9.104702421945221e-8,0.0033579049385909485,-5.9369383956175455e-5,9.1071192375381e-8,0.0033582845835001054,-5.9336313704812116e-5,9.100494733703145e-8,0.00335867744667257,-5.923739982099832e-5,9.082751861971475e-8,0.003359057001605932,-5.906997363720898e-5,9.053508695821385e-8,0.003359395616398978,-5.884413276926084e-5,9.014546329210125e-8,0.003359670484111321,-5.858354614172143e-5,8.96992412648217e-8,0.003359870306372325,-5.83227294745991e-5,8.925494292974744e-8,0.003360000476205311,-5.8100244081356475e-5,8.887733886137964e-8,0.0033600842939887445,-5.794905158876692e-5,8.862112733910623e-8,0.0033601588394004405,-5.7886876867381644e-5,8.851484939281549e-8,0.0033602660797591934,-5.790993390908707e-5,8.85506789176601e-8,0.003360441674025316,-5.799244505104898e-5,8.868407215376571e-8,0.003360704848971143,-5.809247460735285e-5,8.884397868653839e-8,0.003361052408555661,-5.8162610399993446e-5,8.895098477449679e-8,0.0033614587985430038,-5.816263041067814e-5,8.893850581578914e-8,0.003361882595100984,-5.807055435201572e-5,8.877103313526498e-8,0.0033622778382321966,-5.788851232418176e-5,8.845357733079992e-8,0.003362606646946412,-5.764123357960088e-5,8.802875740347297e-8,0.003362848722009863,-5.736772166360094e-5,8.756257923304475e-8,0.003363004624307182,-5.710951428610873e-5,8.712465566458204e-8,0.0033630925651310676,-5.690004657624532e-5,8.677046271557997e-8,0.0033631411170110623,-5.6758424875231495e-5,8.653114040510852e-8,0.003363181256001812,-5.668835779717318e-5,8.641199419472419e-8,0.0033632402740149748,-5.6680785627308535e-5,8.639713164955336e-8,0.0033633383786634027,-5.67180183840242e-5,8.64564805526587e-8,0.0033634874868962595,-5.6777755378881375e-5,8.65524655651299e-8,0.0033636912810481303,-5.683628445550697e-5,8.66452477529796e-8,0.003363945718484768,-5.687086249094485e-5,8.669663650025481e-8,0.0033642395389277832,-5.686171426360383e-5,8.667346696354637e-8,0.0033645548029027344,-5.6794222114151424e-5,8.655138743646585e-8,0.0033648679728196743,-5.6661634264931834e-5,8.631952160889124e-8,0.003365152316192434,-5.646808727765676e-5,8.598556119531746e-8,0.0033653823440695273,-5.6231009443925796e-5,8.557966538825618e-8,0.003365540348867742,-5.598115619209057e-5,8.515425825459867e-8,0.0033656236291926926,-5.5758262063050816e-5,8.477643543829795e-8,0.003365649237974656,-5.5601580627967396e-5,8.451187493962213e-8,0.003365652653538818,-5.5537505781072915e-5,8.440402629396734e-8,0.0033656789459104476,-5.5569291146105796e-5,8.445703766415184e-8,0.003365769023611574,-5.5674099565599833e-5,8.463116901817921e-8,0.003365946605285959,-5.580935658495085e-5,8.485389455646114e-8,0.003366211262409989,-5.592573091926771e-5,8.504204720695987e-8,0.0033665395943343838,-5.598132333980049e-5,8.512577176624952e-8,0.003366892961472996,-5.59521898282755e-5,8.506604596898847e-8,0.003367228357217615,-5.583677491599288e-5,8.486175343471328e-8,0.0033675090217883843,-5.565418314517531e-5,8.454632832083293e-8,0.0033677122812087027,-5.543770395775392e-5,8.417651191158752e-8,0.0033678331653782018,-5.522579913828783e-5,8.381704806824443e-8,0.0033678834944036373,-5.50530389308712e-5,8.352552276592036e-8,0.0033678872697589877,-5.494321345418341e-5,8.334103225252462e-8,0.003367874119813055,-5.490600237086945e-5,8.327889130742978e-8,0.0033678728417263332,-5.493731937946403e-5,8.333146207894089e-8,0.003367906582298691,-5.50223028120182e-5,8.347329601819736e-8,0.003367990240931756,-5.5139459330814e-5,8.36680693328067e-8,0.003368129820921837,-5.5264706650024884e-5,8.387526013174893e-8,0.0033683230141878383,-5.53746278372721e-5,8.405550425907457e-8,0.0033685602874602904,-5.544884667401181e-5,8.417455801548991e-8,0.0033688260245799536,-5.5471875403664845e-5,8.420648096017351e-8,0.0033690996964164,-5.54349217648513e-5,8.41368044105891e-8,0.0033693574390171246,-5.533796983745346e-5,8.396611154911362e-8,0.003369574738556079,-5.51920190230235e-5,8.371373979967595e-8,0.0033697309471166486,-5.502062543221554e-5,8.342014676700197e-8,0.0033698157191195807,-5.4858963662490004e-5,8.314502135403152e-8,0.00336983588693757,-5.4748211466438515e-5,8.295758836096101e-8,0.003369819180796456,-5.472435396786891e-5,8.291770942984493e-8,0.0033698103447281362,-5.4804144817696605e-5,8.305241791698605e-8,0.0033698580327925177,-5.497509215486744e-5,8.333937840761425e-8,0.00336999704671909,-5.519660736781785e-5,8.370918090270701e-8,0.003370235023755808,-5.541355414664154e-5,8.406846696487325e-8,0.0033705505910493,-5.557548077177791e-5,8.43325066766928e-8,0.0033709027002781183,-5.565191209448797e-5,8.445094442884492e-8,0.0033712449573918956,-5.563811944371171e-5,8.441726573141519e-8,0.0033715383281370122,-5.5551947479558465e-5,8.426301455023264e-8,0.0033717588003342688,-5.5425603682988634e-5,8.404350744757277e-8,0.0033718997534319347,-5.529628730757146e-5,8.382176259040501e-8,0.0033719703516509663,-5.519808521396885e-5,8.365483265879684e-8,0.0033719915125817105,-5.515616301581334e-5,8.358424368986457e-8,0.003371990670460589,-5.5183508520810655e-5,8.363084262341449e-8,0.003371996312094328,-5.5280222125438397e-5,8.37938999603007e-8,0.0033720332014755966,-5.543506986883743e-5,8.405389123547616e-8,0.0033721189855487107,-5.56286157858378e-5,8.437778720791833e-8,0.003372262458821144,-5.5837078683713314e-5,8.472545698884107e-8,0.0033724633940253805,-5.603614789623234e-5,8.505597653427594e-8,0.003372713546608454,-5.620417709122976e-5,8.533294234846123e-8,0.0033729982668022603,-5.632452546423462e-5,8.552844070193068e-8,0.00337329829570848,-5.6387235045065904e-5,8.562597120345452e-8,0.003373591662554191,-5.639037939243083e-5,8.56228158420924e-8,0.0033738558827816345,-5.634128823507716e-5,8.553209949381927e-8,0.0033740709065428706,-5.625757728164715e-5,8.538435984518772e-8,0.0033742233614416587,-5.6167318041165296e-5,8.522753464272809e-8,0.0033743120850930324,-5.6106839883563096e-5,8.512295286558207e-8,0.0033743535182657845,-5.6114284681771475e-5,8.51343302306435e-8,0.003374383584560917,-5.621816091412462e-5,8.530860378052354e-8,0.003374451653711905,-5.642363033026548e-5,8.565316246357324e-8,0.003374604874548048,-5.670392651341919e-5,8.612176775673318e-8,0.003374868363272367,-5.700515151316815e-5,8.662290807184912e-8,0.0033752327666612806,-5.726543902108981e-5,8.705223569982031e-8,0.003375657734454065,-5.743861941957818e-5,8.733251492462779e-8,0.00337608883276525,-5.7508964679654286e-5,8.743842547911098e-8,0.0033764770314720334,-5.749109053497066e-5,8.739613430904317e-8,0.003376791288154108,-5.741928432963936e-5,8.726484516431357e-8,0.003377021873463669,-5.733428391425587e-5,8.711405749206888e-8,0.003377177244553692,-5.727289468373037e-5,8.700584615729924e-8,0.0033772782065038614,-5.7261975296652276e-5,8.698482352101486e-8,0.003377351897211726,-5.731608876134401e-5,8.707450164078988e-8,0.0033774266600864046,-5.743750053577925e-5,8.727765185706965e-8,0.0033775279397840904,-5.761758344607225e-5,8.757892428997106e-8,0.0033776751676794963,-5.783921764291742e-5,8.794897670651642e-8,0.0033778797227997696,-5.807988352583364e-5,8.834963725304223e-8,0.0033781440270615184,-5.831509017006301e-5,8.873957895692964e-8,0.0033784617768650477,-5.8521803894550365e-5,8.908001953560924e-8,0.003378819238634322,-5.868149381761238e-5,8.933984781642511e-8,0.003379197323670683,-5.8782439093002966e-5,8.949957584080041e-8,0.003379574066231394,-5.882122050843463e-5,8.955393397490966e-8,0.003379927308581292,-5.880351542948081e-5,8.951323372093641e-8,0.0033802375736910525,-5.8744255904977356e-5,8.940353066295135e-8,0.003380491220639322,-5.86670851430349e-5,8.92654614473728e-8,0.003380684061250688,-5.8602724717853605e-5,8.915117457299559e-8,0.003380825238790617,-5.8585283278155506e-5,8.911787039413452e-8,0.0033809400725077258,-5.8645366370736766e-5,8.921617853680288e-8,0.0033810692089788217,-5.8799874204040243e-5,8.947323513780382e-8,0.003381260821250198,-5.904106722336901e-5,8.987469296042821e-8,0.0033815547925915685,-5.933123263112307e-5,9.0356110182332e-8,0.003381964109575867,-5.961028832185029e-5,9.081592148861166e-8,0.0033824647851254143,-5.981713959083937e-5,9.1151422106769e-8,0.003383003169851391,-5.9914358833980524e-5,9.130033548932249e-8,0.0033835175357943767,-5.9901254032734106e-5,9.126278647579509e-8,0.0033839605590798446,-5.980890433849116e-5,9.10926902260356e-8,0.00338431099616989,-5.968366488858203e-5,9.086948355865654e-8,0.0033845727837585357,-5.9570442762593056e-5,9.066948346775116e-8,0.0033847670858004075,-5.950243521857609e-5,9.05484296124944e-8,0.0033849232362922243,-5.9497727807565615e-5,9.053594275132374e-8,0.0033850716583332255,-5.956024397003957e-5,9.063751388399143e-8,0.0033852393421935963,-5.9682490187505253e-5,9.083949487511646e-8,0.0033854472176725985,-5.984859127500225e-5,9.111441080009529e-8,0.0033857086133339863,-6.003720459463659e-5,9.142588647628522e-8,0.0033860284271986017,-6.022439650227471e-5,9.173340583043047e-8,0.003386402955846923,-6.038656005091193e-5,9.199713865518988e-8,0.003386820462731965,-6.0503374088305864e-5,9.218289744117541e-8,0.003387262658810295,-6.05606230682693e-5,9.226693315388558e-8,0.0033877071395750856,-6.0552452997181255e-5,9.223981379163578e-8,0.0033881305330445235,-6.048266726105932e-5,9.210864890465263e-8,0.0033885120041810286,-6.036487174837796e-5,9.189727295160823e-8,0.003388836782278121,-6.022136221100909e-5,9.164417689053099e-8,0.003389099364723984,-6.008071140194549e-5,9.139814912203612e-8,0.003389306087909998,-5.9974056769629564e-5,9.121173103792565e-8,0.0033894766507592314,-5.992991778520634e-5,9.113234376727132e-8,0.0033896436217253243,-5.9967392439029444e-5,9.119094033650632e-8,0.003389848331184142,-6.00884494472235e-5,9.138938243016609e-8,0.003390131696696725,-6.027176738671097e-5,9.169052134537972e-8,0.003390520408645742,-6.0472489173007385e-5,9.20181223124543e-8,0.003391013048776062,-6.0632291852483944e-5,9.227391611926006e-8,0.003391574685345615,-6.069936708195099e-5,9.237117323434914e-8,0.0033921465752053356,-6.0649508463182645e-5,9.227013011226155e-8,0.003392668019375996,-6.049561955058757e-5,9.199390213601754e-8,0.003393098109249708,-6.027985582758634e-5,9.161498325294656e-8,0.003393425788317697,-6.005472021645174e-5,9.12229510324662e-8,0.00339366621882231,-5.986502345047448e-5,9.089367784604274e-8,0.003393849764889761,-5.973824800765525e-5,9.067301795341194e-8,0.0033940108887349028,-5.9683418753718195e-5,9.057517474706375e-8,0.0033941806177451347,-5.969475502631139e-5,9.058927390461232e-8,0.0033943828082887316,-5.9756555264083074e-5,9.068792616803152e-8,0.0033946329021984417,-5.984744069403636e-5,9.083450585144963e-8,0.003394937808251754,-5.994358255246006e-5,9.098854172687638e-8,0.003395296161910116,-6.002127117598997e-5,9.110993548500498e-8,0.003395698804414143,-6.0059267214638514e-5,9.116285658288206e-8,0.0033961296425301405,-6.004122350292775e-5,9.111984405853812e-8,0.0033965672449549665,-5.995817702591761e-5,9.096608893871411e-8,0.0033969875056327195,-5.9810681332088226e-5,9.070310529653611e-8,0.0033973673472186662,-5.960989551896998e-5,9.035055940505286e-8,0.0033976890073721226,-5.937702862808381e-5,8.994519524467432e-8,0.00339794414966279,-5.914078600227383e-5,8.953626954603158e-8,0.00339813686265762,-5.893285864413488e-5,8.91776383701858e-8,0.0033982846760873316,-5.8782022201718587e-5,8.891757350029357e-8,0.0033984170426695744,-5.8707756459061303e-5,8.878796990728907e-8,0.0033985710041651773,-5.8714419523522015e-5,8.879474808736464e-8,0.003398783964213327,-5.8787308590801815e-5,8.891163690828701e-8,0.003399084097724401,-5.889244323337396e-5,8.908026373626042e-8,0.003399480270250761,-5.898203293481756e-5,8.921967011645284e-8,0.0033999551699554283,-5.900646431000797e-5,8.924656326463904e-8,0.003400466358786225,-5.893049216975236e-5,8.91024588459512e-8,0.003400957801068039,-5.8747104648884236e-5,8.877683281588798e-8,0.003401378527359106,-5.848118000125292e-5,8.831304298309702e-8,0.0034016995373273343,-5.817987411373497e-5,8.779181892187154e-8,0.0034019205448226966,-5.789489120259509e-5,8.730103063936285e-8,0.0034020649231812825,-5.7666180030203005e-5,8.690798801868969e-8,0.003402168049287801,-5.751375176227864e-5,8.664571506488682e-8,0.003402265858276145,-5.743804869788241e-5,8.651389470980682e-8,0.00340238747932283,-5.742519852330234e-5,8.64881096032888e-8,0.0034025522455255973,-5.7453234933997976e-5,8.653057385184077e-8,0.0034027695489980392,-5.7497130460310654e-5,8.659865614011625e-8,0.003403039886903058,-5.753221388492227e-5,8.665054230622828e-8,0.0034033560870460524,-5.753644074444263e-5,8.664895352331391e-8,0.0034037044047870047,-5.7492186034072585e-5,8.656414307834132e-8,0.003404065680014834,-5.738807359108861e-5,8.637705347880114e-8,0.0034044170305128105,-5.722099116240365e-5,8.60828262613509e-8,0.003404734597935735,-5.6997926909140374e-5,8.569395943787588e-8,0.003404997558905359,-5.6736793275923886e-5,8.524163215191012e-8,0.0034051929890715296,-5.646520876211743e-5,8.477344074418974e-8,0.003405320408160798,-5.621648018227168e-5,8.434631513995815e-8,0.003405394300451476,-5.6022900264124296e-5,8.40149123124777e-8,0.0034054430646795236,-5.590772696450894e-5,8.381791884209707e-8,0.0034055038606741876,-5.587815564824331e-5,8.376626228374444e-8,0.0034056142384550816,-5.59216390476811e-5,8.383721738396868e-8,0.003405802567121793,-5.600706841995555e-5,8.397686437719106e-8,0.003406079762115114,-5.609104831024885e-5,8.411111539414267e-8,0.0034064347003346877,-5.6128202268790945e-5,8.416335082003054e-8,0.0034068351738956544,-5.6083285215666045e-5,8.407483916197228e-8,0.003407235151776666,-5.594181500695267e-5,8.382243623901492e-8,0.0034075871596243503,-5.5715353849958e-5,8.342714398589868e-8,0.0034078560389337632,-5.543856994368361e-5,8.294878555047174e-8,0.0034080288015259303,-5.5158405656903775e-5,8.246741739171249e-8,0.003408116556022004,-5.491960304745137e-5,8.20587213493105e-8,0.0034081483496585887,-5.475262430635319e-5,8.17736335484883e-8,0.0034081606287834965,-5.466819510979342e-5,8.162935251217643e-8,0.003408187213574958,-5.465879991060622e-5,8.161218884734959e-8,0.0034082529479952245,-5.470438823302094e-5,8.168747464274309e-8,0.0034083714747449156,-5.477893708194855e-5,8.181075694408507e-8,0.0034085458513296286,-5.4855751000708015e-5,8.193669718795236e-8,0.003408770414545297,-5.4910925975911326e-5,8.202480039048432e-8,0.003409032781106392,-5.4925363401297566e-5,8.204274072682829e-8,0.0034093155318804143,-5.488606600123461e-5,8.196858076576507e-8,0.0034095977133735593,-5.478735913882586e-5,8.179294852554372e-8,0.0034098566636729913,-5.463228818846857e-5,8.1521508229844755E-08,0.003410070752139286,-5.443391476149148e-5,8.117715796819658e-8,0.0034102233957102024,-5.4215684339399623e-5,8.0800505879973e-8,0.003410308068531649,-5.400958289018258e-5,8.044648266424068e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json
new file mode 100644
index 0000000..5a65685
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":22000,"numberOfSamples":1000,"samples":[0.003410332914201753,-5.3850894022675106e-5,8.017517098961131e-8,0.003410322528879365,-5.376958194615e-5,8.003701237438996e-8,0.0034103145652221627,-5.3780481135696216e-5,8.005617875605212e-8,0.0034103506775372276,-5.3876274061593275e-5,8.021888857849169e-8,0.003410464307410866,-5.402707135418975e-5,8.047308167596654e-8,0.003410669971601388,-5.4187778507499705e-5,8.074133887896081e-8,0.003410958362427396,-5.431078402439631e-5,8.094271511350002e-8,0.0034112988966924413,-5.435925986441926e-5,8.101538020005893e-8,0.0034116483046836123,-5.431671386401488e-5,8.093263501288651e-8,0.0034119621492173344,-5.41904204198061e-5,8.070834304160092e-8,0.0034122059256284677,-5.400841636122217e-5,8.039138838903804e-8,0.0034123629141804617,-5.38113276447821e-5,8.005145827068325e-8,0.003412436926427523,-5.3641509849942013e-5,7.976047048128742e-8,0.0034124495366027988,-5.3532666321671336e-5,7.957504010808949e-8,0.0034124330661485227,-5.350283981451321e-5,7.952484351765614e-8,0.0034124218722404974,-5.3552370565715433e-5,7.960947036368768e-8,0.0034124447457084236,-5.3666539079328896e-5,7.980316491937519e-8,0.0034125202858526367,-5.382106091332426e-5,8.00642647210325e-8,0.0034126555868305777,-5.398815305369993e-5,8.034545908014444e-8,0.0034128473776592204,-5.414152490629849e-5,8.06021342297411e-8,0.0034130843642180496,-5.425966542015235e-5,8.079783644736344e-8,0.0034133497512128354,-5.4327618445658844e-5,8.090725685897239e-8,0.003413623435855102,-5.4337869912637006e-5,8.091781018622006e-8,0.003413883907454681,-5.429097539492461e-5,8.083081580105819e-8,0.0034141102665403125,-5.419622361028624e-5,8.066268207707981e-8,0.0034142849136512055,-5.407215162017978e-5,8.044570051432896e-8,0.00341439730488426,-5.394617096384391e-5,8.022718223765307e-8,0.003414448551881033,-5.385201336379878e-5,8.006482802604857e-8,0.0034144554442633347,-5.382365677022172e-5,8.001619006311863e-8,0.003414451133210198,-5.388562472720168e-5,8.012215438343905e-8,0.0034144795115925615,-5.4042269894100845e-5,8.038890648236031e-8,0.003414582717752921,-5.427144088560471e-5,8.077748959286917e-8,0.0034147858366957128,-5.452785635760065e-5,8.120990068433355e-8,0.003415086335408109,-5.475685197042185e-5,8.159276299340531e-8,0.0034154541675420077,-5.491264135361651e-5,8.184854560101504e-8,0.003415842328369328,-5.497241133679643e-5,8.19395012048398e-8,0.0034162020648540446,-5.494079694397467e-5,8.187500799224558e-8,0.0034164960597480513,-5.484509224563486e-5,8.170297816008171e-8,0.003416705855690934,-5.472520370648011e-5,8.14923147861858e-8,0.0034168331491478627,-5.462263220717812e-5,8.131389578844407e-8,0.003416896425673255,-5.457135459703978e-5,8.122506662590603e-8,0.003416924864737033,-5.459196701501527e-5,8.125992201462119e-8,0.0034169512624180483,-5.468942093895768e-5,8.142580537893595e-8,0.0034170054267853647,-5.485407812356393e-5,8.17054100824689e-8,0.0034171092005408077,-5.506533196508355e-5,8.206310391954363e-8,0.0034172737893538854,-5.529662285957986e-5,8.24534661992994e-8,0.0034174994368857004,-5.552057481406241e-5,8.282992315001632e-8,0.0034177769459542693,-5.5713266654435735e-5,8.315188937008223e-8,0.0034180902481047706,-5.58571185539423e-5,8.338960767448971e-8,0.0034184192209990544,-5.594239734507513e-5,8.352672714006698e-8,0.0034187422744122974,-5.5967759795049916e-5,8.356130894842189e-8,0.0034190386613258106,-5.5940313585960716e-5,8.350600300356605e-8,0.0034192907451060053,-5.5875438829459745e-5,8.338772029482915e-8,0.0034194865853197334,-5.5796286755981725e-5,8.324661178228372e-8,0.0034196231618546383,-5.573239332743332e-5,8.313343416160889e-8,0.0034197100026956712,-5.571629566234729e-5,8.310353167794132e-8,0.0034197718373557965,-5.5777017730924494e-5,8.320565011677361e-8,0.0034198476546487924,-5.593045265235306e-5,8.346570742357244e-8,0.0034199832418701356,-5.6169307155583144e-5,8.387000547866622e-8,0.0034202166393619616,-5.64584557493018e-5,8.435767926960611e-8,0.0034205614639800535,-5.67418663020452e-5,8.483274082655738e-8,0.003420997727034218,-5.696140593963007e-5,8.51962311929662e-8,0.0034214773558268368,-5.707879301142648e-5,8.538365211417604e-8,0.0034219421419332224,-5.708851047552745e-5,8.538688805157197e-8,0.0034223438059788605,-5.701585691614104e-5,8.525060072019697e-8,0.0034226564954146083,-5.690413699843295e-5,8.504993386503595e-8,0.003422878920363075,-5.679944106094893e-5,8.486413227000239e-8,0.0034230291674335464,-5.6739176541925223e-5,8.475681081074442e-8,0.003423136660697731,-5.6746178962097036e-5,8.476606168603778e-8,0.0034232343831674863,-5.682746769406769e-5,8.490269488349289e-8,0.0034233527024106186,-5.697594757338996e-5,8.515352124084064e-8,0.003423515048462373,-5.717372366496969e-5,8.548725451920484e-8,0.003423735360724929,-5.739623453008071e-5,8.586162778920173e-8,0.0034240171921175824,-5.761661689063496e-5,8.623076555625632e-8,0.003424354282394761,-5.7809781532945634e-5,8.655200921001188e-8,0.003424732337212298,-5.795580012171021e-5,8.679159414405439e-8,0.0034251316600929604,-5.804228112995662e-5,8.692867283680107e-8,0.0034255301389273553,-5.8065571370678764e-5,8.695739993818016e-8,0.0034259061435299876,-5.8030942708281336e-5,8.68873016976559e-8,0.003426241192945239,-5.7952061490074354e-5,8.674237096252997e-8,0.003426522442310002,-5.784987818084441e-5,8.655906513984539e-8,0.0034267450710929025,-5.775090698206635e-5,8.638314938058331e-8,0.0034269146613510586,-5.768461436478088e-5,8.626498016672915e-8,0.0034270492888037753,-5.7679206341423455e-5,8.625215296635437e-8,0.0034271801115048016,-5.775513150463932e-5,8.637847340111039e-8,0.003427348318837799,-5.791673040416302e-5,8.66500111928406e-8,0.003427596290732135,-5.814466196255829e-5,8.703260278195282e-8,0.0034279529627239238,-5.8394327194921334e-5,8.744949479355945e-8,0.003428418470586544,-5.860576263431353e-5,8.77983298726461e-8,0.00342895785967562,-5.872474275422114e-5,8.79870966366347e-8,0.0034295111225311516,-5.872520138069127e-5,8.797231646130829e-8,0.0034300159367414112,-5.8619276575255356e-5,8.777608739665868e-8,0.003430429936364875,-5.8449346719175054e-5,8.747221956219683e-8,0.0034307409539403753,-5.8269005362368705e-5,8.715330218992734e-8,0.0034309636874953423,-5.812488879415304e-5,8.689927969838687e-8,0.0034311290547955646,-5.804651663753494e-5,8.676002574361577e-8,0.0034312730856115364,-5.804431513186724e-5,8.675224016919222e-8,0.003431428842749821,-5.811258599710215e-5,8.686495556850346e-8,0.003431621833748501,-5.823424073945281e-5,8.706799112634763e-8,0.0034318679871170456,-5.838549788451625e-5,8.732014432177786e-8,0.0034321731793053077,-5.854001187955921e-5,8.757621999925782e-8,0.0034325337535511193,-5.8672442465983527E-05,8.779300375802679e-8,0.0034329377969641297,-5.876149483775846e-5,8.79343338304245e-8,0.0034333670820067457,-5.8792422402358875e-5,8.7975316488367e-8,0.0034337996533433854,-5.875886549720411e-5,8.790547650809066e-8,0.0034342129023982814,-5.8663743295375374e-5,8.773032040338553e-8,0.0034345867528595554,-5.8519040728693963E-05,8.747098149349937e-8,0.00343490662495616,-5.834457618854895e-5,8.716204139286165e-8,0.003435165997133961,-5.816584043444344e-5,8.684766473704805e-8,0.003435368377604481,-5.8010940498476064e-5,8.657614158669101e-8,0.003435528469312809,-5.79066894188021e-5,8.639300030976978e-8,0.0034356721817477088,-5.787374966119817e-5,8.633265875065238e-8,0.0034358346431882215,-5.7920805816179714e-5,8.640865043476558e-8,0.00343605489737805,-5.8038637339463834e-5,8.660388209222903e-8,0.0034363663675272185,-5.8196543664505935e-5,8.686495377469283e-8,0.003436784132872785,-5.834498191690136e-5,8.710692888866458e-8,0.003437293776835478,-5.8427735873480615e-5,8.72341254787051e-8,0.0034378497110881335,-5.8402092841660325e-5,8.717442687949159e-8,0.0034383882973978448,-5.8257765502926945e-5,8.691145603639477e-8,0.003438851408713721,-5.802240303565348e-5,8.649384664598423e-8,0.0034392073380863355,-5.774932951993929e-5,8.601401185593557e-8,0.0034394577744100104,-5.749559608304214e-5,8.557022184800596e-8,0.003439630233895451,-5.7303386349150334e-5,8.523451882013677e-8,0.0034397639148655676,-5.71921018810065e-5,8.503923334835471e-8,0.003439897152082377,-5.716002300749245e-5,8.498019404726612e-8,0.0034400599773055985,-5.719061355114749e-5,8.502796230293353e-8,0.0034402713672934656,-5.725932344600479e-5,8.513976877355545e-8,0.0034405393098027363,-5.7338962376120295e-5,8.52687687250456e-8,0.0034408620305790096,-5.7403458295962594e-5,8.5370360365332e-8,0.0034412295639111826,-5.74305399376233e-5,8.540661686558558e-8,0.0034416255077720182,-5.7403819017073256e-5,8.534975049941572e-8,0.0034420290593737894,-5.7314494475115625e-5,8.518502074925517e-8,0.0034424175204084556,-5.7162649725107814e-5,8.491300299198063e-8,0.0034427693744096327,-5.695780291358059e-5,8.45505703435799e-8,0.003443067694390436,-5.671827027498391e-5,8.412977141244271e-8,0.0034433033585062117,-5.6469137408961e-5,8.369422260683416e-8,0.003443477522363603,-5.6238888006486065e-5,8.329312068593308e-8,0.0034436028265143223,-5.6054927768332085e-5,8.297335687745774e-8,0.0034437028776761053,-5.593849466785818e-5,8.277067663956046e-8,0.0034438096971042514,-5.589961405993521e-5,8.270110737924363e-8,0.0034439589152577502,-5.593284157050621e-5,8.275395289466784e-8,0.0034441825909026142,-5.601493075148707e-5,8.288821797121621e-8,0.0034445001635288017,-5.610621465702858e-5,8.303535737202917e-8,0.0034449095226591654,-5.615762951966539e-5,8.311147869532069e-8,0.0034453821233687756,-5.612393855092263e-5,8.303989847633601e-8,0.003445866927768903,-5.598013860657117e-5,8.277898571579688e-8,0.003446305117155568,-5.573359851034611e-5,8.234268399454156e-8,0.003446650688170405,-5.54237541297035e-5,8.179975395214818e-8,0.003446886420895123,-5.5107576665760024e-5,8.124862318937609e-8,0.0034470267259821934,-5.483846667724602e-5,8.078097385183255e-8,0.00344710766051307,-5.464993566767857e-5,8.04536936374894e-8,0.003447171789706657,-5.455038535028025e-5,8.028012646114274e-8,0.0034472558389312216,-5.452741901483898e-5,8.02378602589795e-8,0.003447384454009153,-5.455622510521429e-5,8.028347230580017e-8,0.003447569166450617,-5.460748845901849e-5,8.036626359875367e-8,0.003447810144196527,-5.465292154467429e-5,8.043768722291936e-8,0.0034480987268725206,-5.466849659176279e-5,8.045671557812648e-8,0.003448419783191651,-5.46362499989435e-5,8.039277888315682e-8,0.003448753772593059,-5.45454637568273e-5,8.022774113086465e-8,0.0034490787902391605,-5.439364106836301e-5,7.995762374625734e-8,0.003449372967644381,-5.41872734508112e-5,7.959400330433788e-8,0.0034496174799257423,-5.394199608711304e-5,7.916430464845655e-8,0.003449800033082265,-5.368150494101013e-5,7.870985989025718e-8,0.0034499182123150364,-5.343472982432336e-5,7.828086678372597e-8,0.003449981722370573,-5.323117506956941e-5,7.792815673433031e-8,0.0034500124919465153,-5.30949612652312e-5,7.769278778854012e-8,0.0034500419488425822,-5.303878495366926e-5,7.759565134357626e-8,0.003450105483013042,-5.305939695552917e-5,7.762989261880157e-8,0.0034502349108771345,-5.3136052000312036E-05,7.775860628781301e-8,0.00345045036327994,-5.3232896856317525e-5,7.791934553656435e-8,0.0034507534559009615,-5.330563477313901e-5,7.803586216602371e-8,0.0034511239123253042,-5.331189940292976e-5,7.80359816725961e-8,0.0034515217741313154,-5.3223411868618484e-5,7.787229296285301e-8,0.0034518963778732035,-5.303630985682997e-5,7.753954870439826e-8,0.003452200772443476,-5.277494601652743e-5,7.708083438603485e-8,0.0034524067233620208,-5.24857622131667e-5,7.657676351766069e-8,0.003452513539318852,-5.222238745671445e-5,7.611970105647155e-8,0.003452546358006263,-5.202834487641089e-5,7.578401494859984e-8,0.003452545316805372,-5.1925238857953614e-5,7.56059228122419e-8,0.0034525517079226162,-5.1910531969244896e-5,7.55799748568084e-8,0.0034525973425899702,-5.1963341595560646e-5,7.566935879164173e-8,0.003452699860306806,-5.2053492925631584e-5,7.582168477769657e-8,0.003452863075258511,-5.2149607426261665e-5,7.598291155508565e-8,0.0034530799060755258,-5.222439818684115e-5,7.61063070119408e-8,0.003453335818338361,-5.2257343532068194e-5,7.615685892232103e-8,0.003453611766785339,-5.223571891965294e-5,7.61129377116946e-8,0.0034538864899658996,-5.215494408708145e-5,7.596690383151867e-8,0.003454138506384482,-5.201882998128307e-5,7.572562427973521e-8,0.003454348337076918,-5.183978826068164e-5,7.541091271463072e-8,0.0034545013314538756,-5.1638552963418784e-5,7.505903324803353e-8,0.003454591043269122,-5.144265642680074e-5,7.47179322561575e-8,0.0034546224963198295,-5.128290588661151e-5,7.444094709790633e-8,0.003454614029832736,-5.118756231866206e-5,7.427657654620211e-8,0.0034545960964780477,-5.117499667449252e-5,7.425575471974446e-8,0.0034546059759224725,-5.124696696840789e-5,7.438038383349255e-8,0.003454678971542103,-5.13853618139435e-5,7.46180167622108e-8,0.003454838496800186,-5.155451806553497e-5,7.490622976898416e-8,0.003455088410098183,-5.170923490366474e-5,7.516676020545438e-8,0.0034554104312331923,-5.18063784397559e-5,7.53256558047392e-8,0.0034557677626890567,-5.181660232781692e-5,7.533338722547459e-8,0.003456114043853787,-5.173270086815992e-5,7.517894604581043e-8,0.0034564052677747885,-5.157212308820495e-5,7.48937718027089e-8,0.003456611436614271,-5.1372648185342906e-5,7.454392055414663e-8,0.0034567244663298784,-5.118206849108857e-5,7.421205085109125e-8,0.0034567595924578005,-5.104487112438851e-5,7.397444303572169e-8,0.0034567496932292933,-5.0990411029647274e-5,7.388079046187029e-8,0.0034567348219838017,-5.1026634462844345E-05,7.394368941315555e-8,0.0034567511208470503,-5.1140910162072285e-5,7.41404001886787e-8,0.003456822969488365,-5.130640701071599e-5,7.442407063670418e-8,0.0034569600809666373,-5.149059048477161e-5,7.473844540174441e-8,0.003457158836079232,-5.166263101478568e-5,7.503054191154755e-8,0.0034574058624226842,-5.179814342816616e-5,7.525864485773623e-8,0.0034576819982162126,-5.188131487414444e-5,7.53958236160267e-8,0.003457965624434055,-5.190529764163641e-5,7.543055726802653e-8,0.003458235153642075,-5.187182989119657e-5,7.536613158997809e-8,0.003458470988800748,-5.179074706531707e-5,7.52198852644471e-8,0.0034586575036994354,-5.1679536585510255e-5,7.502247538759579e-8,0.0034587855033521653,-5.156254212189298e-5,7.481641900418598e-8,0.0034588552057932243,-5.1469030724573484e-5,7.465256143383775e-8,0.0034588791061978532,-5.142920657003421e-5,7.458297859873786e-8,0.003458883218149259,-5.1467660711166246e-5,7.464955268013278e-8,0.0034589045776179444,-5.159510836468649e-5,7.48697763858947e-8,0.0034589835250980615,-5.180135000044591e-5,7.522485150187091e-8,0.0034591517840109193,-5.205370320062124e-5,7.56573232920082e-8,0.0034594206555359705,-5.2303828254811026e-5,7.608317761780516e-8,0.0034597750906966754,-5.250174966429808e-5,7.641623908985145e-8,0.0034601771049745287,-5.2611539439694236e-5,7.659526793472266e-8,0.003460577222136936,-5.262200185778321e-5,7.660223703442587e-8,0.003460928903507887,-5.254861496345348e-5,7.646534203758294e-8,0.003461200559315436,-5.2427345790902366e-5,7.624789704143432e-8,0.0034613819623500147,-5.230371513415596e-5,7.602909490634815e-8,0.00346148446467581,-5.2220931733726785e-5,7.58833715008536e-8,0.003461536103359664,-5.2210117968981436e-5,7.586364467457609e-8,0.003461573517811942,-5.2284544913011865e-5,7.599167543503633e-8,0.0034616329485504336,-5.243864613206289e-5,7.625673698865155e-8,0.003461742549106104,-5.265142211148723e-5,7.662177846795173e-8,0.003461917703165235,-5.2892782274308036e-5,7.703449448843473e-8,0.0034621599737674246,-5.313072477304534e-5,7.74396760194996e-8,0.0034624591084389793,-5.33374098966768e-5,7.778955053911857e-8,0.003462796779292467,-5.349304510582412e-5,7.805033191515012e-8,0.003463150686187144,-5.3587487694671127e-5,7.820488911072816e-8,0.0034634980867577683,-5.362014291759816e-5,7.825256020973388e-8,0.0034638184347490337,-5.35989854743125e-5,7.820751398896041e-8,0.0034640953366142095,-5.353936163065365e-5,7.809672470592285e-8,0.0034643182806015373,-5.3462782486652334e-5,7.795785220255605e-8,0.0034644845501561154,-5.339545627403919e-5,7.783656035226323e-8,0.0034646014413177184,-5.336592005983549e-5,7.778221516267927e-8,0.0034646882637985664,-5.3400881599815127e-5,7.78405393635882e-8,0.003464776653159077,-5.351867683920702e-5,7.804231285445772e-8,0.003464906957150965,-5.372111733504216e-5,7.838949782169935e-8,0.0034651189235659127,-5.398689725856593e-5,7.884418711991946e-8,0.0034654377510551313,-5.427171287388532e-5,7.932912268318844e-8,0.003465861181889111,-5.45189747063227e-5,7.974637922620187e-8,0.0034663557995089868,-5.4679006723517416e-5,8.001057810235294e-8,0.003466866832075317,-5.4727667638690595e-5,8.008101605182355e-8,0.003467337213583027,-5.467430917764118e-5,7.997525515932372e-8,0.0034677259185634294,-5.45558137956383e-5,7.975848386026634e-8,0.0034680175758430914,-5.4421850197762574e-5,7.951758779610465e-8,0.003468221945391668,-5.431943863471243e-5,7.93341221303494e-8,0.003468366749984431,-5.4282189894998705e-5,7.926564782173139e-8,0.003468488253575451,-5.432554626942201e-5,7.933775100923389e-8,0.003468622577673265,-5.4446940976185534e-5,7.954473091422483e-8,0.00346879910386759,-5.4629139136083834e-5,7.985575566520995e-8,0.003469036315266957,-5.484531500646757e-5,8.022385234336574e-8,0.0034693400970225562,-5.506482644748267e-5,8.05959068464886e-8,0.003469704347103154,-5.525874833196587e-5,8.09221138287859e-8,0.003470113426848338,-5.54043045866477e-5,8.116348069551332e-8,0.003470545719066106,-5.548767615842907e-5,8.129655797854296e-8,0.0034709775149081618,-5.550506450046016e-5,8.131522490515083e-8,0.0034713865350294564,-5.546223505877917e-5,8.122990831469518e-8,0.00347175466700389,-5.537307165347207e-5,8.10651077332558e-8,0.003472069935483391,-5.5257707024367603e-5,8.085614780070984e-8,0.0034723279767847086,-5.514048489525153e-5,8.064555763367976e-8,0.0034725332728849033,-5.504767565387728e-5,8.047894670947377e-8,0.0034727002510506733,-5.5004592720721175e-5,8.039983781883514e-8,0.003472853897452726,-5.5031486682279284e-5,8.044249502323219e-8,0.0034730286883273595,-5.513778809238864e-5,8.062209526950794e-8,0.003473263973229728,-5.531544130156531e-5,8.092351809161323e-8,0.0034735943076693245,-5.553413717659481e-5,8.129347436960563e-8,0.003474035665897499,-5.574326882078972e-5,8.16441259001113e-8,0.0034745731955609315,-5.5884742086398796e-5,8.18752580591423e-8,0.0034751596486798657,-5.5914583892773785e-5,8.19115493205368e-8,0.003475729749079442,-5.5822556153648676e-5,8.173640984494093e-8,0.0034762246796353497,-5.563705319293436e-5,8.140033666182622e-8,0.003476612701492186,-5.541203574155975e-5,8.099801039245487e-8,0.003476895422108325,-5.52051656998577e-5,8.063001150121857e-8,0.0034771002354880218,-5.50597528893753e-5,8.037124816213464e-8,0.003477266808137206,-5.499678333889154e-5,8.025718895626209e-8,0.003477434878777277,-5.501575513956466e-5,8.028567476587208e-8,0.0034776364077081026,-5.510010155564282e-5,8.042677847876208e-8,0.0034778919129647623,-5.522370891534653e-5,8.063443431098723e-8,0.003478209655577147,-5.53567664624354e-5,8.085668027157581e-8,0.003478586484780268,-5.547053781197861e-5,8.104383769654996e-8,0.003479009745324267,-5.5541137233202974e-5,8.115488223399064e-8,0.0034794599661624203,-5.55522999409954e-5,8.116209039532e-8,0.00347991406310937,-5.5497055559913984e-5,8.105385714697197e-8,0.00348034877409459,-5.5378226962704636e-5,8.083554656447708e-8,0.003480743967899695,-5.5207701396177e-5,8.052824678244802e-8,0.003481085399356866,-5.500462615502403e-5,8.016563989201027e-8,0.003481366669257658,-5.4792906661938594e-5,7.978960191727658e-8,0.0034815903954937507,-5.459831114198394e-5,7.944505128213398e-8,0.003481768645435652,-5.444530524158718e-5,7.917429462220676e-8,0.003481922641158277,-5.435363020679066e-5,7.901097650404148e-8,0.003482081557943241,-5.43344611388244e-5,7.897344901624152e-8,0.0034822796949849086,-5.438607219406785e-5,7.90574880741661e-8,0.0034825508886991334,-5.4489814677525574e-5,7.922969966297901e-8,0.003482919510198329,-5.460863179618924e-5,7.942530879637457e-8,0.00348338922468968,-5.4691530175031036e-5,7.955606784582527e-8,0.0034839341482262006,-5.468684887826709e-5,7.953314250976801e-8,0.003484500044929782,-5.456236411226566e-5,7.930171563250027e-8,0.003485020395764967,-5.432242661163013e-5,7.887051211495277e-8,0.003485441830665722,-5.4009666442778456e-5,7.831463037203127e-8,0.003485744308334187,-5.3687830051453043e-5,7.774555423085291e-8,0.003485944356059249,-5.341619454208322e-5,7.726643890430705e-8,0.0034860824605426953,-5.323068031905013e-5,7.69391413336341e-8,0.003486205192699337,-5.313887848336849e-5,7.677573716104043e-8,0.003486351616487765,-5.312585818689202e-5,7.674902644824243e-8,0.003486546989851855,-5.3163832246076e-5,7.680975614919294e-8,0.003486802071512451,-5.322081037736187e-5,7.690188262653895e-8,0.003487115234474545,-5.326655085161755e-5,7.697289095930539e-8,0.003487475361305784,-5.3276107450321254e-5,7.697977967690026e-8,0.00348786468748232,-5.323188756023941e-5,7.689243976502786e-8,0.003488261541112851,-5.3124867656400085e-5,7.669564695902987e-8,0.0034886431118577687,-5.2955187271283527e-5,7.639006967152842e-8,0.0034889883345022694,-5.273207584356439e-5,7.599217164183895e-8,0.00348928082718179,-5.247287143335613e-5,7.553253065060545e-8,0.0034895115406157772,-5.220092938007728e-5,7.505217138911657e-8,0.0034896806403166163,-5.194253721386278e-5,7.45970984578306e-8,0.003489798281891112,-5.17231700616895e-5,7.421163449310192e-8,0.003489884081885023,-5.156346255637453e-5,7.393127924950925e-8,0.0034899651917605482,-5.1475349070217194e-5,7.37759579390884e-8,0.0034900730046242873,-5.145880727187514e-5,7.374448490150087e-8,0.0034902384487222934,-5.149957504391051e-5,7.38108940008001e-8,0.003490485713360978,-5.1568581097192085e-5,7.392383226896056e-8,0.0034908247516596694,-5.162452953725788e-5,7.401135645851316e-8,0.0034912442178913756,-5.162129070334261e-5,7.399384833356589e-8,0.0034917082870866084,-5.152067046187914e-5,7.380600775763368e-8,0.003492161919526589,-5.1307906470345714e-5,7.342344472404727e-8,0.0034925468003312904,-5.100251708159784e-5,7.28812436475048e-8,0.0034928230231711763,-5.065567102917774e-5,7.22692085054129e-8,0.00349298480607223,-5.0332008284307815e-5,7.170010948102879e-8,0.003493060486880091,-5.008509810197167e-5,7.126687367301145e-8,0.0034930978108644877,-4.994040408769448e-5,7.10129659368693e-8,0.003493144812116986,-4.989292212429899e-5,7.092852991350264e-8,0.003493236329890927,-4.991616821749949e-5,7.09664233386691e-8,0.003493389382240401,-4.997451260323819e-5,7.106400377600212e-8,0.0034936049670886314,-5.003303046878982e-5,7.116036558566628e-8,0.0034938724850190725,-5.006315699024087e-5,7.120605641471014e-8,0.003494174181710002,-5.004500801825621e-5,7.116689888635155e-8,0.003494488647240114,-4.9967898958017656e-5,7.10247226686362e-8,0.003494793491455296,-4.983017838931351e-5,7.077701977191036e-8,0.0034950676495118685,-4.963883343406836e-5,7.043629688622425e-8,0.0034952936893218015,-4.940884123717768e-5,7.00290073852739e-8,0.0034954602703394025,-4.91619116469257e-5,6.959337044053813e-8,0.003495564525333123,-4.8924164351532744e-5,6.917524860206665e-8,0.0034956137545527114,-4.872255946766232e-5,6.882178267966077e-8,0.003495625715726868,-4.858035828766625e-5,6.857332667336269e-8,0.003495626962793271,-4.8512296531638016e-5,6.845495049254806e-8,0.003495649053141319,-4.852049680516395e-5,6.846936904534974e-8,0.00349572299679345,-4.859225484338337e-5,6.859329915473242e-8,0.0034958728136478237,-4.870052145709375e-5,6.877863372874697e-8,0.003496109274904872,-4.8807474643686194e-5,6.895900381066696e-8,0.0034964250870034323,-4.887130098211752e-5,6.906179269833887e-8,0.0034967931639454048,-4.885581409325789e-5,6.902485348345956e-8,0.0034971698712657363,-4.874139651093061e-5,6.881530246607359e-8,0.0034975044920154213,-4.853405294472491e-5,6.84449092255104e-8,0.0034977539089692195,-4.82679369446728e-5,6.797415829244196e-8,0.0034978977356623906,-4.799750824878962e-5,6.749837862946622e-8,0.003497946438249529,-4.778016802970108e-5,6.71174247409688e-8,0.003497937170337883,-4.765667743097292e-5,6.690162413586374e-8,0.0034979190953097782,-4.763908471093491e-5,6.687094352623798e-8,0.003497936251514583,-4.771117288133363e-5,6.699607854306233e-8,0.0034980160892215074,-4.783863709240464e-5,6.72164958349271e-8,0.0034981665960245093,-4.798196106874302e-5,6.746304065721289e-8,0.0034983797653029723,-4.810632101892896e-5,6.7675162011292e-8,0.003498637465113023,-4.818668505636025e-5,6.780961989824135e-8,0.003498916867361659,-4.820909523255125e-5,6.784251930616007e-8,0.0034991943722301896,-4.816994545602405e-5,6.77679407084832e-8,0.003499448182358842,-4.8074658565751284e-5,6.759564195017042e-8,0.003499660159392372,-4.793641707463699e-5,6.734892080114882e-8,0.003499817561197899,-4.777495464323169e-5,6.70625616249293e-8,0.0034999149556601225,-4.761498368904733e-5,6.678005875369204e-8,0.0034999561644388504,-4.7483672003196496e-5,6.654908362581237e-8,0.003499955598723389,-4.7406752130685654e-5,6.64145242188782e-8,0.003499937981419274,-4.7403373506660164e-5,6.64093764187308e-8,0.0034999354725625304,-4.748062569635709e-5,6.654518620862992e-8,0.0034999818663642855,-4.762947778629249e-5,6.680512211808298e-8,0.003500104737353191,-4.782411608126126e-5,6.714310459443665e-8,0.0035003176166506283,-4.802589279357225e-5,6.749101949715656e-8,0.0035006147541124916,-4.819155958831892e-5,6.777333062458293e-8,0.0035009704717046735,-4.8283900302600454e-5,6.79257035406021e-8,0.0035013438418472647,-4.828195062171539e-5,6.791269545624289e-8,0.0035016879794580935,-4.818789700989003e-5,6.77394776851162e-8,0.00350196195728518,-4.8028314713332036e-5,6.7453611515929e-8,0.0035021422800556846,-4.784851634702435e-5,6.713486096804716e-8,0.0035022301857497284,-4.770064526201016e-5,6.687425034339409e-8,0.0035022515726871335,-4.762872570098612e-5,6.674801281177754e-8,0.003502248809025409,-4.76559744371242e-5,6.6795665439382e-8,0.0035022673478896467,-4.777938593190681e-5,6.701087743219682e-8,0.003502342631637575,-4.7973344665574994e-5,6.734808187955503e-8,0.0035024922414820824,-4.819969702053791e-5,6.774024524213613e-8,0.003502715017307082,-4.841926028605082e-5,6.811897897486228e-8,0.0035029954034810603,-4.8600480484494276e-5,6.842952899629088e-8,0.003503309784163736,-4.872362633221379e-5,6.863790981889476e-8,0.0035036322351094896,-4.878127146575032e-5,6.873159448741184e-8,0.0035039386022962613,-4.877672372667128e-5,6.871671928860393e-8,0.003504208970165578,-4.87218399559206e-5,6.861430714964363e-8,0.003504429141433504,-4.863501729753385e-5,6.845682584882933e-8,0.00350459182981821,-4.853945290340068e-5,6.828516088744188e-8,0.0035046979735865453,-4.846124060565817e-5,6.814520400131455e-8,0.00350475808642424,-4.842667362547513e-5,6.808297903800876e-8,0.00350479302443529,-4.845822639406622e-5,6.813746753851686e-8,0.003504833027239744,-4.8569169986268695e-5,6.833115419174137e-8,0.003504913702238319,-4.8757838383985466e-5,6.866012446657687e-8,0.0035050683853181447,-4.900391199350466e-5,6.908782646579392e-8,0.0035053182256271995,-4.926964452673352e-5,6.954751938057267e-8,0.003505663509814919,-4.950767016413277e-5,6.995616209346973e-8,0.003506080502214955,-4.967398233611283e-5,7.023720489982495e-8,0.0035065262851390663,-4.974153435641874e-5,7.034430756266863e-8,0.003506950416802348,-4.970896615211756e-5,7.027638385694825e-8,0.003507309058355678,-4.960110682063593e-5,7.0078148342398e-8,0.003507576569966767,-4.9461571981689524e-5,6.982680430100155e-8,0.003507751260505524,-4.9340525835212706e-5,6.961036660223815e-8,0.0035078543380118467,-4.928155435713404e-5,6.950463542881697e-8,0.003507923017411245,-4.931120710474176e-5,6.955507505634865e-8,0.003508000088817847,-4.943373386134086e-5,6.976794205386932e-8,0.0035081230318595195,-4.9631997266688886e-5,7.011223942234489e-8,0.003508315707408989,-4.987372010955851e-5,7.053089174394624e-8,0.003508584634184765,-5.012067906449034e-5,7.095689951327328e-8,0.003508920154172877,-5.033779131119303e-5,7.13291488630146e-8,0.0035093011174319503,-5.0499608977751295e-5,7.16036029544808e-8,0.0035097008909079027,-5.059322819724562e-5,7.175822123658268e-8,0.003510092795370233,-5.0618099620991336e-5,7.179252228933486e-8,0.0035104540074803628,-5.058396686418179e-5,7.172395576915468e-8,0.0035107678630634256,-5.050815563358695e-5,7.15831936559844e-8,0.0035110250474179707,-5.041300190160958e-5,7.140965978633763e-8,0.003511224303772449,-5.0323602655051194e-5,7.124755864747469e-8,0.003511373081760116,-5.026556563032649e-5,7.114182180173342e-8,0.0035114881227789486,-5.026219499321855e-5,7.113303314780363e-8,0.003511595434404246,-5.0330578468163386e-5,7.125049337013055e-8,0.003511728512620591,-5.047647794780582e-5,7.15033405278639e-8,0.0035119233836461974,-5.0689046876978714e-5,7.187153222950117e-8,0.003512209769178392,-5.093800093324406e-5,7.230120436607415e-8,0.003512599955153083,-5.1176799888461815e-5,7.271049692322936e-8,0.003513080034794742,-5.135392592457402e-5,7.300940477436388e-8,0.003513609502076132,-5.14298349934786e-5,7.312941724983363e-8,0.0035141320281950124,-5.139216413429823e-5,7.305001548325024e-8,0.0035145936629104664,-5.1261041454466944e-5,7.28077595651944e-8,0.003514959887450534,-5.108168091747994e-5,7.248300624823855e-8,0.0035152241266274524,-5.090867675710344e-5,7.217204520177112e-8,0.0035154059396990682,-5.078968882418096e-5,7.195828527441259e-8,0.0035155420813633245,-5.075426745699315e-5,7.189270617613542e-8,0.0035156751083582306,-5.0809654038145116e-5,7.198679130075311e-8,0.003515843117254807,-5.094257374417173e-5,7.221607476825528e-8,0.0035160725094786714,-5.112494538587068e-5,7.253048594280297e-8,0.0035163744088703465,-5.132142690619098e-5,7.286773029032713e-8,0.0035167446049327736,-5.1497064920155425e-5,7.316666417595633e-8,0.003517166385541075,-5.1623642515698906e-5,7.337826896105822e-8,0.0035176151934762446,-5.168374224689177e-5,7.347259275945112e-8,0.0035180638474490854,-5.167220679053694e-5,7.344117159692746e-8,0.003518487230567752,-5.159533656149261e-5,7.329555446259182e-8,0.0035188657466365884,-5.146856119474064e-5,7.306321274190783e-8,0.0035191873567905307,-5.13134535075297e-5,7.278232032475649e-8,0.0035194484899109596,-5.1154771029381724e-5,7.249655785721567e-8,0.0035196543025420254,-5.101775638284942e-5,7.225031546170417e-8,0.0035198186084428556,-5.0925530397301455e-5,7.208400788541844e-8,0.0035199635105888586,-5.089622436322815e-5,7.202894163244655e-8,0.003520118343208592,-5.093945103045378e-5,7.210112224469392e-8,0.0035203169511922577,-5.105206016209678e-5,7.229397007328736e-8,0.003520592065648051,-5.1214188069510806e-5,7.2571689142489e-8,0.00352096625240208,-5.138810927673326e-5,7.286756429012272e-8,0.0035214411001403445,-5.1523353653888815e-5,7.309310451119305e-8,0.0035219896591436894,-5.15702050538723e-5,7.316168179423694e-8,0.0035225589618442157,-5.149859927706176e-5,7.302152157725176e-8,0.003523085668432638,-5.1313067895405906e-5,7.268175566529078e-8,0.003523518917940908,-5.105359802726036e-5,7.221375246224139e-8,0.003523838095962248,-5.0780520742168284e-5,7.17243210762634e-8,0.0035240564761216146,-5.0552185506667285e-5,7.13161973079306e-8,0.003524211505779421,-5.040730619616483e-5,7.105688273569124e-8,0.003524349502340482,-5.035813602950126e-5,7.096680808680643e-8,0.0035245122820342207,-5.039321453053906e-5,7.102455458373297e-8,0.003524729076631242,-5.0485092313253465e-5,7.1180850127246e-8,0.003525013583176288,-5.059899047337806e-5,7.137404304621766e-8,0.003525364590777378,-5.070022815478351e-5,7.154318300099117e-8,0.0035257686958330417,-5.075977742115368e-5,7.163764186847562e-8,0.003526204144558562,-5.075793251795897e-5,7.16233638631601e-8,0.003526645154897335,-5.06861406598159e-5,7.148591957241648e-8,0.003527066167471657,-5.0547118838004726e-5,7.123062042100954e-8,0.0035274455836368955,-5.03535175473795e-5,7.088014482938875e-8,0.003527768623758874,-5.012545639882056e-5,7.047021401502236e-8,0.0035280290362206864,-4.988738877980477e-5,7.004408058198917e-8,0.0035282296839363246,-4.966483945398808e-5,6.964675729891865e-8,0.003528382291270085,-4.9481325891113706e-5,6.931952735975422e-8,0.003528506567199636,-4.935546278755109e-5,6.909476075587484e-8,0.003528628724271695,-4.929815291741338e-5,6.899092748257108e-8,0.0035287791842859104,-4.9309749713025403e-5,6.900767973450815e-8,0.0035289888641371506,-4.9377284113068966e-5,6.912119895490268e-8,0.003529283256307753,-4.947268367777429e-5,6.92813827041382e-8,0.0035296742313782816,-4.955407009659888e-5,6.941439827038625e-8,0.003530151349516904,-4.957278427309963e-5,6.943511266213218e-8,0.0035306772094212354,-4.948747198735312e-5,6.92717079077621e-8,0.003531192964839601,-4.928195652942658e-5,6.889685346018671e-8,0.0035316365215482056,-4.89774365236009e-5,6.834895029601523e-8,0.003531966575744259,-4.862874958980648e-5,6.772540073203424e-8,0.0035321786442322665,-4.830377164926679e-5,6.714615431489767e-8,0.003532303511122255,-4.805750770984733e-5,6.670788672264682e-8,0.0035323910644271955,-4.7915439884981005e-5,6.645464473265158e-8,0.003532490905278016,-4.787198094158151e-5,6.637538089556046e-8,0.0035326391070453276,-4.7899603242805185e-5,6.6420465804465665E-08,0.003532853457600977,-4.79609329089279e-5,6.652335567882734e-8,0.003533134764875135,-4.801870810507902e-5,6.661826425948239e-8,0.0035334709225311187,-4.80420607780708e-5,6.6651124930788e-8,0.0035338414892082007,-4.800969554135657e-5,6.658497123133597e-8,0.003534221883309781,-4.791109649069916e-5,6.640185991590025e-8,0.0035345870911481937,-4.774650430734176e-5,6.610271983901248e-8,0.003534914922415681,-4.7525956167852065e-5,6.570564041722356e-8,0.003535188784668761,-4.726751897573049e-5,6.524278234784632e-8,0.003535399869757837,-4.699475689773158e-5,6.475593288560843e-8,0.003535548488616758,-4.673352273796198e-5,6.429082959559262e-8,0.0035356443027719678,-4.6508419457597334e-5,6.389085743601263e-8,0.003535705452163371,-4.633936348530399e-5,6.359090277517784e-8,0.0035357567090917945,-4.623851257366044e-5,6.341187165168234e-8,0.003535826730715225,-4.6207747236638295e-5,6.335626221346214e-8,0.0035359444328626815,-4.62369186224868e-5,6.340521229944e-8,0.0035361343987252193,-4.6303140463713727e-5,6.351750974087675e-8,0.0035364112077063,-4.637182901460024e-5,6.363172583245652e-8,0.0035367731674912405,-4.640084478194753e-5,6.367372155706706e-8,0.003537197303637594,-4.634911429135081e-5,6.357183762261232e-8,0.0035376391122535576,-4.618966433176537e-5,6.327964211385549e-8,0.003538041119459337,-4.592349949638268e-5,6.280007246840904e-8,0.0035383510638224264,-4.558644822183458e-5,6.219724757422401e-8,0.0035385429814836127,-4.524104977366377e-5,6.158200500178063e-8,0.0035386287865788782,-4.495389988038994e-5,6.107183348045023e-8,0.003538652157842681,-4.477026159769317e-5,6.074602879654554e-8,0.0035386688439036844,-4.47004078804151e-5,6.062170724859673e-8,0.003538726003163398,-4.4722809906257866e-5,6.065974926915645e-8,0.0035388505435425223,-4.4797903515981296e-5,6.078947944701308e-8,0.003539047874416657,-4.488281287540454e-5,6.093489620785433e-8,0.0035393068814284787,-4.4941391084842396e-5,6.103238884542969e-8,0.003539606554146499,-4.494882794965666e-5,6.103867464873075e-8,0.003539921676724328,-4.4892499760318906e-5,6.093205597538492e-8,0.003540226919719803,-4.477102781459113e-5,6.07105950251088e-8,0.0035404997394379314,-4.4592754938286915e-5,6.03893845810904e-8,0.0035407226338242614,-4.437398906963968e-5,5.999749164758063e-8,0.003540885022134315,-4.413694086471505e-5,5.957436958624628e-8,0.0035409847601478635,-4.3907158055120185e-5,5.91653320895687e-8,0.003541029039603609,-4.371029443432704e-5,5.881578782502931e-8,0.003541034222876167,-4.3568356911767184e-5,5.856451374224705e-8,0.0035410242820919035,-4.34959360356527e-5,5.843690932693798e-8,0.0035410278165807162,-4.349704460319828e-5,5.8439391136652944e-8,0.003541073866467474,-4.35631774348635e-5,5.8556051173999174e-8,0.003541186954993939,-4.367314619920436e-5,5.874856491748497e-8,0.0035413819586960823,-4.379504612211161e-5,5.895993621631804e-8,0.003541659481115643,-4.389056974908652e-5,5.9122364071120686e-8,0.0035420026717852874,-4.392188556736655e-5,5.9169501196338025e-8,0.0035423770266627625,-4.386091460591744e-5,5.9052739202674654e-8,0.003542735137307152,-4.369954534362978e-5,5.8758966934382756e-8,0.003543027709928473,-4.345726115647605e-5,5.8323693696870554e-8,0.003543219432923343,-4.318096116450492e-5,5.783045574779396e-8,0.0035433037039722254,-4.293306375151269e-5,5.7389662664115485e-8,0.003543307510625984,-4.2770211481893025e-5,5.710096925546551e-8,0.003543281657416864,-4.2722564889928e-5,5.7016803661170176e-8,0.0035432808969128654,-4.2784998811324036e-5,5.7127048886294805e-8,0.003543345083182791,-4.29237431526913e-5,5.7371094348610354e-8,0.0035434901225729534,-4.309218173774192e-5,5.766603094543882e-8,0.0035437096200434323,-4.324625449648452e-5,5.793397699501254e-8,0.003543982437111229,-4.335377416740421e-5,5.811844457672117e-8,0.003544280963361055,-4.339731616568985e-5,5.81892230593214e-8,0.003544577345674607,-4.337307492070495e-5,5.814014309175838e-8,0.0035448472547188253,-4.328818788598209e-5,5.798423922921832e-8,0.003545071945356522,-4.315800457900615e-5,5.774893393946444e-8,0.0035452395202854154,-4.300371531604833e-5,5.7471914844255585e-8,0.0035453459408502194,-4.285012265748278e-5,5.719723861116069e-8,0.0035453958923160433,-4.2723120313231096e-5,5.697084279090594e-8,0.0035454032149012556,-4.264651128545993e-5,5.683482254338785e-8,0.0035453903011499546,-4.2638151061864956e-5,5.682050114724788e-8,0.003545385835098054,-4.270593783651835e-5,5.6941284815840156e-8,0.0035454206037119564,-4.2844639289619016e-5,5.718710304786205e-8,0.003545521737679013,-4.3034763683612925e-5,5.7522579910149e-8,0.0035457064554863466,-4.3244478586494526e-5,5.7890672855239426e-8,0.0035459768841103315,-4.343484771283477e-5,5.822218243869248e-8,0.0035463175130871715,-4.35676865911608e-5,5.8449803092231185e-8,0.003546696374372438,-4.361459001005239e-5,5.852408386886376e-8,0.003547070408275864,-4.3565227278255075e-5,5.842791123349795e-8,0.0035473947092906958,-4.343266116837182e-5,5.8185596798430805e-8,0.003547634245769986,-4.3253317404532224e-5,5.786248016398101e-8,0.003547775128552845,-4.307980993012999e-5,5.755198880500784e-8,0.0035478310759871168,-4.296686019185961e-5,5.7350653828112885e-8,0.003547840931561206,-4.295416001320256e-5,5.732790326738767e-8,0.003547856465191098,-4.305323561587963e-5,5.7503072995357236e-8,0.0035479251065484753,-4.3244764513410865e-5,5.7840967381065036e-8,0.0035480755467052556,-4.3487437490787506e-5,5.82678059755974e-8,0.003548312159234838,-4.3733132149183526e-5,5.869821561074207e-8,0.003548618609759482,-4.394085957403888e-5,5.9059893258797215e-8,0.0035489665155445534,-4.4084657379925696e-5,5.930742385274079e-8,0.0035493243155301293,-4.4155064485646884e-5,5.94246850590516e-8,0.0035496635912923074,-4.415657349882108e-5,5.942017343141657e-8,0.003549962454933137,-4.4103723515838815e-5,5.932002348157367e-8,0.0035502068853032385,-4.401745537774121e-5,5.91615814739689e-8,0.0035503910919313167,-4.392223541541534e-5,5.898836758135166e-8,0.0035505176599334156,-4.3843716170544275e-5,5.884594653272736e-8,0.0035505977261718136,-4.3806355923926305e-5,5.877765373835154e-8,0.0035506509029348764,-4.38304481117814e-5,5.881923373523053e-8,0.0035507042417583052,-4.392838644885185e-5,5.8992150582505356e-8,0.003550789375607358,-4.4100629561268414e-5,5.9296460179193444e-8,0.0035509372747178996,-4.4332623510118206e-5,5.970549942120029e-8,0.0035511709877155606,-4.459455929913146e-5,6.016568287046157e-8,0.0035514981633926815,-4.4845618151110135e-5,6.060425933750863e-8,0.0035519062473257645,-4.504285818124529e-5,6.094521953949166e-8,0.003552363010141798,-4.515265199572119e-5,6.112959670344877e-8,0.0035528232538145662,-4.516091931665212e-5,6.113348597576136e-8,0.0035532400588138987,-4.5078419810363994e-5,6.097717700290937e-8,0.0035535771481694945,-4.4939099071296303e-5,6.07218955472018e-8,0.0035538186514130496,-4.479186991256323e-5,6.045492489427308e-8,0.0035539735035672354,-4.4688098423139305e-5,6.02672442098929e-8,0.0035540731748337205,-4.466810631879039e-5,6.022963420680442e-8,0.0035541630731403067,-4.475043551216551e-5,6.037388305148787e-8,0.003554289865126375,-4.4927280773815736e-5,6.068503341769779e-8,0.0035544886846951913,-4.516779476639947e-5,6.110755581298996e-8,0.0035547745839082123,-4.542805241964009e-5,6.156319330980759e-8,0.0035551408759050616,-4.5663759910920776e-5,6.197350799964669e-8,0.003555563963135248,-4.5841008864221135e-5,6.227883337795943e-8,0.0035560116876657694,-4.5941979139417047e-5,6.24482093400329e-8,0.0035564516280192447,-4.596527201117455e-5,6.24798008660841e-8,0.003556857010155012,-4.592266312849646e-5,6.239502440655055e-8,0.003557209714814007,-4.5834565631833704e-5,6.223046308066282e-8,0.003557501080364987,-4.572581403912075e-5,6.203040815733011e-8,0.0035577315537230697,-4.562240269450946e-5,6.184110140786349e-8,0.003557910036471095,-4.554903608560832e-5,6.170637764909142e-8,0.0035580533024840793,-4.552692161730423e-5,6.166368747736406e-8,0.0035581853049642667,-4.557119728743023e-5,6.173946177102266e-8,0.0035583356940717664,-4.568768485662425e-5,6.194333838364082e-8,0.0035585365708927026,-4.586927857225371e-5,6.226185510588425e-8,0.0035588166627198116,-4.609326999183041e-5,6.265390851272246e-8,0.003559193137323904,-4.632193829336071e-5,6.30520372167614e-8,0.003559663281878733,-4.650876999059089e-5,6.337362542760012e-8,0.003560200245713937,-4.661063021140253e-5,6.354254648899662e-8,0.0035607569317794813,-4.6602396654738655e-5,6.351506594055439e-8,0.003561278648384015,-4.6487494514614917e-5,6.32983887923139e-8,0.0035617199935504846,-4.6298558243764545e-5,6.29516014692535e-8,0.003562058627582537,-4.608741314362649e-5,6.256758166751812e-8,0.0035623004672044175,-4.5909078533960046e-5,6.224430829280521e-8,0.003562475581175662,-4.5806486601264316e-5,6.205760310203278e-8,0.0035626279001984354,-4.580067735294027e-5,6.204384806523509e-8,0.003562802954124633,-4.5888015756848204e-5,6.219537779330008e-8,0.003563037055132452,-4.6043654273636875e-5,6.246701201447148e-8,0.003563350070700666,-4.622932203076322e-5,6.27901620525839e-8,0.0035637427913076075,-4.6403085941301916e-5,6.309025042503193e-8,0.003564198880158738,-4.6528682381631946e-5,6.330320173165173e-8,0.0035646903766327347,-4.658232632749611e-5,6.338736538669235e-8,0.0035651848849890845,-4.6555732749513495e-5,6.332870370697999e-8,0.0035656523705938485,-4.645535269046844e-5,6.313929883122431e-8,0.0035660700713561725,-4.6298937321714985e-5,6.285117367268997e-8,0.003566425004528302,-4.611096934697695e-5,6.250815533966789e-8,0.0035667143995241142,-4.591827694533483e-5,6.215809174271331e-8,0.0035669448573334944,-4.574655007561588e-5,6.184666832943819e-8,0.0035671310343054594,-4.561778706202556e-5,6.161284724828767e-8,0.0035672942787601126,-4.554824175451044e-5,6.148516952915002e-8,0.0035674611803288114,-4.5546361387194964e-5,6.147805454901015e-8,0.003567661543033928,-4.5610385548273515e-5,6.158757512312564e-8,0.003567924912442449,-4.5725767445714075e-5,6.178702994408387e-8,0.0035682748142848095,-4.5863544983274e-5,6.202428486357496e-8,0.0035687207877180566,-4.598192357438832e-5,6.222480065079293e-8,0.0035692503506583244,-4.603366023380281e-5,6.230484445613422e-8,0.0035698255742100237,-4.597995195287227e-5,6.219611092854864e-8,0.0035703895352063105,-4.580682740172019e-5,6.187471998839677e-8,0.003570883632004423,-4.553525834522834e-5,6.137904502638934e-8,0.003571268864222055,-4.521699225352601e-5,6.080211684283172e-8,0.0035715396695708015,-4.4916408899932836e-5,6.025908338968015e-8,0.003571723198393817,-4.468799023289393e-5,5.984686372144387e-8,0.003571866379697392,-4.456067955242553e-5,5.961625196141818e-8,0.0035720191409290983,-4.453406964456066e-5,5.956536150564443e-8,0.0035722211083410766,-4.458410992868764e-5,5.965019352482582e-8,0.003572494625911943,-4.4673173061435514e-5,5.980293252365561e-8,0.0035728434568544545,-4.476028636567257e-5,5.995034390494367e-8,0.0035732552997467812,-4.480936493091201e-5,6.002839604720158e-8,0.003573706429317807,-4.479480285769821e-5,5.99920413721776e-8,0.0035741673042217212,-4.4704415364411226e-5,5.982025244393188e-8,0.0035746082437256763,-4.45398457623661e-5,5.951659167339322e-8,0.003575004335958261,-4.43147481520429e-5,5.9105889956792483e-8,0.003575338940318722,-4.405137481478573e-5,5.862814161090186e-8,0.0035756054724064797,-4.3776367002100296e-5,5.81310100746709e-8,0.0035758075061845546,-4.3516565870462726e-5,5.766237414128631e-8,0.0035759576042431298,-4.32955011747464e-5,5.726406668644314e-8,0.003576075473322457,-4.313078064462699e-5,5.696719548910158e-8,0.0035761858511276887,-4.3032185858342236e-5,5.678871564724287e-8,0.0035763162079560256,-4.300017921430965e-5,5.672876610846801e-8,0.0035764940524594456,-4.3024605140873026e-5,5.6768438605918676e-8,0.0035767432881861085,-4.30836704446525e-5,5.686814868430869e-8,0.0035770790275487753,-4.314407216803266e-5,5.6968106744896594e-8,0.0035775010573515023,-4.3164050813275044e-5,5.699394484154996e-8,0.003577987803146952,-4.310136895375068e-5,5.6870952361826546e-8,0.0035784948165471183,-4.292678335936257e-5,5.65479221696561e-8,0.003578962840272767,-4.2639405852658924e-5,5.602429479005061e-8,0.003579336851006414,-4.227498438897039e-5,5.536473452635238e-8,0.003579588685688661,-4.18979968512765e-5,5.468488805835137e-8,0.0035797296080622783,-4.1578011198993515e-5,5.4109049105691114e-8,0.0035798042114301037,-4.1363105981440804e-5,5.372259413331688e-8,0.0035798702564199783,-4.126542984896543e-5,5.354626012529212e-8,0.0035799774382410184,-4.126391236459329e-5,5.354128307652321e-8,0.003580154993927935,-4.1317791469285e-5,5.363395239974795e-8,0.003580409608935486,-4.1381581597515776e-5,5.374262013811699e-8,0.003580729783643385,-4.1415934670145685e-5,5.3797139133405634e-8,0.003581092408746188,-4.139336320909661e-5,5.3748926352074026e-8,0.003581469034566333,-4.130007224972205e-5,5.357400193982709e-8,0.0035818310034735766,-4.1135487314135264e-5,5.3271956810880735e-8,0.0035821534692491988,-4.0910476824976e-5,5.286268340386592e-8,0.003582418418358619,-4.06446935945381e-5,5.238161243589318e-8,0.0035826166797022483,-4.0363280171443215e-5,5.187384845082181e-8,0.00358274884529989,-4.009317462540421e-5,5.1387588037206476e-8,0.003582824995614943,-3.985933882274082e-5,5.096737917280055e-8,0.0035828632611508504,-3.9681384105172434e-5,5.064806914993073e-8,0.0035828875139954875,-3.957098298811167e-5,5.045014818249678e-8,0.003582924529544475,-3.953016479695639e-5,5.0376688098463605e-8,0.00358300081862799,-3.955047708564117e-5,5.0411877426842314e-8,0.0035831392261010796,-3.961300640930363e-5,5.052117648958689e-8,0.003583355214352302,-3.968931328155379e-5,5.065319072165797e-8,0.0035836526718863154,-3.974377438611344e-5,5.074407946967609e-8,0.003584019676710392,-3.973841845099247e-5,5.072633320424865e-8,0.0035844258489106545,-3.9641235948389545e-5,5.0543575221023724e-8,0.003584824176308066,-3.943762986883524e-5,5.0170788891649215e-8,0.0035851605988330357,-3.914173842671066e-5,4.963424297277142e-8,0.0035853918960880448,-3.880043670747472e-5,4.9018405921792256e-8,0.003585505322328108,-3.848249328671764e-5,4.844644654517097e-8,0.003585527515563994,-3.8253569503164206e-5,4.803549689485371e-8,0.0035855144146158527,-3.8149888897543195e-5,4.784960245800021e-8,0.0035855273906091824,-3.8166487904675314e-5,4.787887836846632e-8,0.0035856104495281117,-3.8265157169492204e-5,4.805402080142565e-8,0.0035857798816200707,-3.8393560363288984e-5,4.828082047147677e-8,0.0035860268763078557,-3.8503227747035004e-5,4.847250586230702e-8,0.003586326680961035,-3.855986372475001e-5,4.8568113786697065e-8,0.003586648121636525,-3.8546152355993225e-5,4.853728942981486e-8,0.0035869605978639182,-3.846010828728895e-5,4.837710529272839e-8,0.003587238303345829,-3.8311783073421156e-5,4.810602981932446e-8,0.0035874625495865785,-3.811982896336047e-5,4.775775329407981e-8,0.00358762304655042,-3.790829412712801e-5,4.7375493462969575e-8,0.003587718543212155,-3.7703539314087314e-5,4.700651815697953e-8,0.0035877568854504843,-3.753109690746856e-5,4.669652828927809e-8,0.0035877543189045003,-3.741240911193318e-5,4.648378792509094e-8,0.0035877337821993926,-3.736170012036886e-5,4.639348279578213e-8,0.003587722146397466,-3.738348798138e-5,4.643324183247487e-8,0.003587746637258956,-3.747117499085622e-5,4.659063494568057e-8,0.0035878308010265218,-3.760702188597041e-5,4.683321176191194e-8,0.0035879904688035855,-3.776372946249842e-5,4.7111485215557924e-8,0.0035882302134709367,-3.790765307608103e-5,4.736488113389693e-8,0.0035885407027646038,-3.800358818517712e-5,4.753047496748133e-8,0.0035888975265631912,-3.802122612155703e-5,4.755460390198331e-8,0.003589262683625903,-3.7943134492679234e-5,4.740703403510289e-8,0.003589590313060849,-3.777295305645327e-5,4.709535929441549e-8,0.0035898376636516174,-3.754070148435225e-5,4.6674180657203245e-8,0.003589979939820703,-3.730052104784748e-5,4.6240824276023414e-8,0.003590023371945228,-3.711708048632642e-5,4.5910925049693536e-8,0.0035900077501635065,-3.7042871910765236e-5,4.577784781514526e-8,0.0035899933020088546,-3.709707415007798e-5,4.587502096050476e-8,0.003590037208575344,-3.725873614994456e-5,4.6163979998570615e-8,0.0035901730111987757,-3.747812082032692e-5,4.655494611376622e-8,0.0035904033060219416,-3.769784537258867e-5,4.6944876133643913e-8,0.003590705852666982,-3.787137405914086e-5,4.725061888805473e-8,0.0035910458330059257,-3.7972004750569304e-5,4.7424881917477886e-8,0.0035913870901548824,-3.799305368319623e-5,4.7456342834723396e-8,0.003591699210907479,-3.794340612840332e-5,4.736148608065085e-8,0.0035919606768198722,-3.7842095199116786e-5,4.7174801397497153e-8,0.0035921596171359957,-3.7713708795726786e-5,4.6940568127754947e-8,0.003592293558379161,-3.758490512066759e-5,4.6706667488679346e-8,0.0035923688823323,-3.7481625279828046e-5,4.651961895285797e-8,0.0035924001126666325,-3.742650014676788e-5,4.641991343171655e-8,0.003592408782381076,-3.743612894819133e-5,4.643708427178588e-8,0.0035924214411165024,-3.751830128528744e-5,4.6584688608919025e-8,0.0035924664696293106,-3.7669705308534085e-5,4.685621045027915e-8,0.003592569774155505,-3.7874901547291835e-5,4.7223301285490726e-8,0.003592749902450613,-3.810728859606727e-5,4.763765035237718e-8,0.0035930135281971444,-3.833251364146036e-5,4.8037268016193544e-8,0.003593352477999401,-3.85142094254474e-5,4.835692293551611e-8,0.003593743318325711,-3.862124028617287e-5,4.8541211620976406e-8,0.0035941500803349773,-3.8635219635304036e-5,4.855799005285224e-8,0.0035945303054739485,-3.8556856029829644e-5,4.8409563859566875e-8,0.0035948441441678958,-3.84093266238022e-5,4.8138450958546775e-8,0.0035950652932258955,-3.823653707192244e-5,4.7823971958565097E-08,0.003595191000352243,-3.809453371200407e-5,4.7566669363102354e-8,0.003595246796889517,-3.803631027123147e-5,4.7461060314247433E-08,0.0035952816700368603,-3.809404780623166e-5,4.756396298769029e-8,0.0035953529476908017,-3.826654280703843e-5,4.7872228760978966e-8,0.0035955064360887307,-3.851914359448242e-5,4.832290540180464e-8,0.0035957614102684605,-3.8797097685212365e-5,4.8817364790469434e-8,0.0035961074408753227,-3.904519065318432e-5,4.925659081088645e-8,0.0035965125426542463,-3.922380619036841e-5,4.9569925989950274e-8,0.0035969362675940465,-3.9315732962972006e-5,4.972712682605005e-8,0.003597341109482439,-3.932441886961113e-5,4.9735041797245097e-8,0.0035976991308152764,-3.9267828750470704e-5,4.962644042986901e-8,0.0035979941492756103,-3.917176770050048e-5,4.944797265987095e-8,0.0035982212646163817,-3.906461231436291e-5,4.925073309806581e-8,0.0035983853864858173,-3.8973731332623625e-5,4.9083882869826816e-8,0.003598499705108412,-3.8923037020490345e-5,4.899027237780294e-8,0.003598584313547959,-3.893093107139329e-5,4.900272753215885e-8,0.003598664665047769,-3.900814200916675e-5,4.914012707459969e-8,0.003598769295912446,-3.91554181102269e-5,4.940325446403414e-8,0.003598926296552057,-3.936159589408526e-5,4.9771395938974046e-8,0.0035991584178781378,-3.9603052569638225e-5,5.020149262688757e-8,0.0035994774570306106,-3.9845742495034574e-5,5.063196470603437e-8,0.003599879456446016,-4.0050595060088164e-5,5.099254875986903e-8,0.0036003427551529487,-4.018188155414745e-5,5.121939647495595e-8,0.0036008305267239238,-4.021666105614067e-5,5.127201267350899e-8,0.003601298082359539,-4.015241628723848e-5,5.114683795044416e-8,0.0036017034785005065,-4.001010080325409e-5,5.0882498429844205e-8,0.0036020186446318633,-3.983102151691306e-5,5.055393791953197e-8,0.00360223784043595,-3.966773922720605e-5,5.025583994965174e-8,0.0036023807275160397,-3.957088011118183e-5,5.0078834765566855e-8,0.0036024884440489483,-3.957514576006304e-5,5.008445593779248e-8,0.003602612836630004,-3.9688759093846825e-5,5.028643421396089e-8,0.003602801507346342,-3.9890448396384285e-5,5.064559582445518e-8,0.0036030837132397233,-4.013591224250133e-5,5.1081729897139555e-8,0.0036034625787910108,-4.037175117016467e-5,5.149873123423126e-8,0.0036039164745840613,-4.0551277524241955e-5,5.181297742668326e-8,0.0036044080529050305,-4.0646004294966926e-5,5.197384946590186e-8,0.00360489619893693,-4.064945869958866e-5,5.197041780922286e-8,0.0036053460251226866,-4.0574082061552914e-5,5.182570742191499e-8,0.0036057344318386826,-4.044453999591332e-5,5.158455566701788e-8,0.0036060514579108944,-4.029075668722807e-5,5.130104481965624e-8,0.003606299011004411,-4.01424970484346e-5,5.1028778692332877e-8,0.0036064885833287518,-4.0025849226308426e-5,5.081459498933569e-8,0.003606638973317254,-3.9961099891688534e-5,5.069476213733481e-8,0.003606774332411993,-3.9961203232245695e-5,5.069221405358963e-8,0.0036069222452277806,-4.003023028212907e-5,5.081374865009258e-8,0.0036071112182922568,-4.016168303508934e-5,5.1047028727656355e-8,0.003607366963232316,-4.033714988858951e-5,5.135826999643147e-8,0.0036077072303672525,-4.0526398781894345e-5,5.169257162187404e-8,0.0036081358410376746,-4.069044856608033e-5,5.19795998409735e-8,0.00360863791472181,-4.0788768684664725e-5,5.214662964419998e-8,0.0036091792602710175,-4.079000858969095e-5,5.2137837160242114e-8,0.003609712280943959,-4.068309768113012e-5,5.1934170132578293e-8,0.0036101880918484254,-4.04838562463079e-5,5.1565076095717744e-8,0.0036105710604826644,-4.0233135214053623e-5,5.11049366675387e-8,0.0036108500263461432,-3.998610781681087e-5,5.065355467128838e-8,0.003611041677968052,-3.9796540409886596e-5,5.0307660035659015e-8,0.0036111851665100313,-3.970186618515915e-5,5.0134017422303575e-8,0.0036113304864999287,-3.971382372907988e-5,5.0152753919674675e-8,0.0036115247250119607,-3.98167918000583e-5,5.033467938084641e-8,0.0036118001491949494,-3.997345877334354e-5,5.061180843179813e-8,0.003612167114637999,-4.013564216404726e-5,5.089703004119631e-8,0.0036126132814578962,-4.025692196720492e-5,5.110687626163271e-8,0.0036131087640671185,-4.0303479742982214e-5,5.118093281193777e-8,0.0036136150876857724,-4.026034802700086e-5,5.109292725088119e-8,0.003614094856008835,-4.0132016043704154e-5,5.085165351686192e-8,0.0036145193074628326,-3.993836208888382e-5,5.0493512681573206e-8,0.003614872292763547,-3.9708210576448246e-5,5.0070825982924494e-8,0.003615150815762236,-3.947285164647236e-5,4.9640137095099506e-8,0.0036153632808230353,-3.926096931140428e-5,4.9253097195019005e-8,0.0036155267616432177,-3.909538048400595e-5,4.89506275147321e-8,0.0036156642392711075,-3.8991230807476714e-5,4.8759693003331155e-8,0.0036158021749105296,-3.895495080175904e-5,4.86914245950835e-8,0.0036159682275933073,-3.8983383111791493e-5,4.873955389149923e-8,0.003616188577386115,-3.9062911493915725e-5,4.887889729439448e-8,0.0036164842465590077,-3.9168981167351876e-5,4.906461395007111e-8,0.003616866127419069,-3.926707099410478e-5,4.9234122993500053E-08,0.003617329348913702,-3.931673398289274e-5,4.9314522167269587e-8,0.003617849150796829,-3.928001916208648e-5,4.923780665633049e-8,0.003618381798653043,-3.913360777112033e-5,4.896267227430695e-8,0.0036188735440883186,-3.888055553865431e-5,4.849554188132768e-8,0.003619276853702225,-3.855491658006466e-5,4.789873129478229e-8,0.0036195676184713646,-3.821416389457841e-5,4.7276580612196774e-8,0.0036197545025373444,-3.792090095161403e-5,4.6742254073388355e-8,0.0036198753513412853,-3.772222272857822e-5,4.6380371688515686e-8,0.0036199830801991757,-3.763623905030227e-5,4.6222755173165736e-8,0.00362012849213772,-3.7650144684676776e-5,4.624521707582522e-8,0.003620346940104583,-3.77278873639625e-5,4.6381754134727366e-8,0.0036206519317770578,-3.7822429509832206e-5,4.654694600928876e-8,0.0036210353347296935,-3.788800232657244e-5,4.6658156643896576e-8,0.0036214722356083732,-3.7889552847069945e-5,4.665250017723497e-8,0.0036219282737146377,-3.7808250334028e-5,4.6496606350338104e-8,0.003622367558528604,-3.764294604213074e-5,4.618907856043481e-8,0.003622759613618764,-3.740807222574171e-5,4.5756568470016735e-8,0.003623084197594277,-3.7129000539556704e-5,4.524531717165578e-8,0.0036233334897944123,-3.6836271033352585e-5,4.471070197478162e-8,0.003623511822352105,-3.656004150987419e-5,4.42072171491852e-8,0.003623633625770037,-3.632568696345636e-5,4.378055463898182e-8,0.0036237204746564565,-3.615095303416537e-5,4.3462496938331666e-8,0.0036237980238943072,-3.604451542869379e-5,4.326833725239851e-8,0.0036238932087061873,-3.600542881626248e-5,4.3195891834918523e-8,0.0036240316260941043,-3.6022998605292114e-5,4.322528366433578e-8,0.003624234754252283,-3.6076927455552074E-05,4.331926852948421e-8,0.0036245165668879796,-3.613800749232242e-5,4.34246123367742e-8,0.003624879311897084,-3.617023187311202e-5,4.3476066000601294e-8,0.0036253090835464646,-3.6135726391495956e-5,4.3405390637871034e-8,0.0036257732585274127,-3.6003592967351125e-5,4.315733397260209e-8,0.0036262232058954036,-3.576186980901324e-5,4.271111422394686e-8,0.003626605331546473,-3.542823247726426e-5,4.209956869519151e-8,0.003626879436036661,-3.50518579454549e-5,4.1412337399755736e-8,0.0036270365079126123,-3.470071004044956e-5,4.0772704917605835e-8,0.0036271047904969573,-3.443736111457935e-5,4.029373159298715e-8,0.0036271389316380864,-3.429581521273013e-5,4.003629528591115e-8,0.0036271983746661196,-3.427189565117347e-5,3.999186380888534e-8,0.0036273272627723543,-3.433001504928174e-5,4.009507060595036e-8,0.0036275443605000503,-3.441929039714666e-5,4.02532013146905e-8,0.003627843559349204,-3.448978456372097e-5,4.037574941419381e-8,0.0036282007307444626,-3.450355291645972e-5,4.039436204166938e-8,0.0036285824334346233,-3.443962968437811e-5,4.027168052144104e-8,0.003628953774846586,-3.4294406238919776e-5,4.000181674287031e-8,0.003629284453436167,-3.4079224683629005e-5,3.960585055025596e-8,0.00362955288864694,-3.381643465683662e-5,3.912462715686188e-8,0.0036297485036715003,-3.353465476085004e-5,3.8610171191587416e-8,0.0036298722480067286,-3.3263883330298314e-5,3.811684927278125e-8,0.003629935574821214,-3.303104643643447e-5,3.769332757952957e-8,0.003629958188257625,-3.285642390889165e-5,3.737611903004188e-8,0.003629964993502037,-3.275128511796277e-5,3.7185320702803963e-8,0.0036299828010852926,-3.271683137367501e-5,3.712271268820873e-8,0.003630037189355566,-3.274419552984249e-5,3.7171770693712e-8,0.003630149597490292,-3.281517977483511e-5,3.729903127915843e-8,0.0036303345419651353,-3.290362286671258e-5,3.7456641443449155e-8,0.0036305967997701106,-3.297753462876925e-5,3.758635247116539e-8,0.003630928513207681,-3.300252642506156e-5,3.762587782766384e-8,0.0036313068265694214,-3.294744940956532e-5,3.7519188323039196e-8,0.00363169380297549,-3.2792780456482834e-5,3.7231652891866554e-8,0.0036320412779389313,-3.254062980327011e-5,3.676798183842747e-8,0.0036323028298620714,-3.222229600651305e-5,3.618566999286661e-8,0.00363245144150968,-3.1896535693968474e-5,3.559165692670533e-8,0.003632494924818845,-3.163343128727202e-5,3.5112974053962996e-8,0.003632477752238004,-3.148784739433187e-5,3.4848610971418145e-8,0.0036324645616411712,-3.147677766139223e-5,3.4828549478256566e-8,0.003632513929295136,-3.1574620316264846e-5,3.5005434477029905e-8,0.0036326579319382944,-3.1727711619258e-5,3.528122902984301e-8,0.0036328967617592235,-3.187682011716218e-5,3.554823526809591e-8,0.0036332061434049393,-3.197502524181992e-5,3.572156454636925e-8,0.0036335495974229026,-3.1995847248725226e-5,3.575374279393732e-8,0.003633889293870905,-3.19333227910892e-5,3.563461873953822e-8,0.003634193172744235,-3.17978842240923e-5,3.538369154094479e-8,0.003634438615965457,-3.161109030916799e-5,3.504045625380042e-8,0.003634613855985011,-3.1400671454106465e-5,3.465541572534082e-8,0.003634718071699902,-3.11961575856113e-5,3.428219175465637e-8,0.003634760562279025,-3.102500639946222e-5,3.3970535921702535e-8,0.0036347591134491177,-3.0909251987672765e-5,3.376025962304962e-8,0.003634737607805422,-3.086278268132625e-5,3.367629517795057e-8,0.0036347229490649663,-3.088948453492992e-5,3.372533325761154e-8,0.003634741563228235,-3.0982560065987805e-5,3.389460784514429e-8,0.003634815901229414,-3.112512713113596e-5,3.4153020033679004e-8,0.0036349612766972193,-3.129198170965659e-5,3.4454394956192596e-8,0.003635183245992869,-3.145240784677646e-5,3.4742669582784826e-8,0.0036354757079425717,-3.1573956992053166e-5,3.495886526255861e-8,0.0036358199160614058,-3.1627212256825974e-5,3.504983415027823e-8,0.0036361849045063073,-3.159171660721317e-5,3.4979039620345153e-8,0.003636530479561921,-3.1462895172653124e-5,3.473901011215707e-8,0.0036368142578559253,-3.1258495477149596e-5,3.436280051338025e-8,0.003637003387374721,-3.102115681331883e-5,3.3928392231956515e-8,0.003637088755021439,-3.081237158304347e-5,3.35475459720963e-8,0.003637094946225761,-3.069500019812094e-5,3.333402234292594e-8,0.0036370770559699434,-3.0708848592774254e-5,3.335935424561485e-8,0.0036371013292986853,-3.085231309250355e-5,3.361973574732224e-8,0.0036372186076369544,-3.108268917674487e-5,3.4036836713625407e-8,0.0036374461301725914,-3.133543760619602e-5,3.449300493597974e-8,0.0036377666800752285,-3.154966294649507e-5,3.4877648547478624e-8,0.003638141297749838,-3.1685759118405125e-5,3.511925103365506e-8,0.0036385252843173046,-3.173024090401332e-5,3.5193980505349496e-8,0.0036388799750885084,-3.1691380373824776e-5,3.5117541386689996e-8,0.003639178463924923,-3.1591479016366276e-5,3.493096321710203e-8,0.003639406831918024,-3.145964120367891e-5,3.4687408289269027e-8,0.0036395631103395176,-3.132641488984484e-5,3.444246310972407e-8,0.003639655535314708,-3.122008096808154e-5,3.4247456211883176e-8,0.0036397006665107633,-3.1163893875378406e-5,3.414448139816457e-8,0.003639721329488939,-3.1173806420359784e-5,3.416226804857164e-8,0.0036397441644748767,-3.125655767899938e-5,3.431270209771732e-8,0.003639796568166988,-3.140832386339877e-5,3.458839076722247e-8,0.0036399030331303018,-3.161441580614675e-5,3.49621599593727e-8,0.0036400812861970703,-3.1850493516183555e-5,3.538933414193512e-8,0.0036403388783366928,-3.2085469069802425e-5,3.581309683606768e-8,0.003640670899708472,-3.228595888933305e-5,3.617266898678714e-8,0.003641059410890908,-3.242184074945234e-5,3.6413480741849684e-8,0.003641474976614793,-3.2472192397990765e-5,3.6497992784001544e-8,0.0036418804736073327,-3.243081777099901e-5,3.6415684316993066e-8,0.0036422373048892133,-3.231046066567557e-5,3.619054998193656e-8,0.003642513965287651,-3.2144261682321465e-5,3.588351146600024e-8,0.0036426959856221573,-3.198235682061668e-5,3.5586005065773693e-8,0.0036427944977556605,-3.1881697208743154e-5,3.5401356745524745e-8,0.0036428486849075714,-3.188933045907144e-5,3.5414444145402196e-8,0.0036429173685921887,-3.202403752604784e-5,3.565852233264122e-8,0.0036430596414088368,-3.226577445343364e-5,3.609629779052436e-8,0.0036433124954249867,-3.2561078847616284e-5,3.66299793816928e-8,0.0036436776177795477,-3.284337212027593e-5,3.713830880496045e-8,0.0036441242313400286,-3.3057030277970586e-5,3.7520345040000954e-8,0.0036446041810241324,-3.317277180321848e-5,3.772337507096917e-8,0.0036450692490085615,-3.3189738563198884e-5,3.7746545722749065e-8,0.003645482899676809,-3.3128175256394194e-5,3.7627357042686266e-8,0.0036458246434632187,-3.301933774306142e-5,3.7423151774873677e-8,0.003646089234413236,-3.289707990184836e-5,3.71957515176344e-8,0.003646283665094115,-3.279244336538491e-5,3.7001641525103554e-8,0.0036464239349174375,-3.273067656021924e-5,3.6886607019548715e-8,0.0036465323149864697,-3.272957018214073e-5,3.6882747854165715e-8,0.0036466349961541663,-3.279825429446103e-5,3.700630533575309e-8,0.0036467596710251142,-3.2936106766617314e-5,3.725568811188398e-8,0.0036469325807821826,-3.313193807407561e-5,3.7610026698915855e-8,0.0036471748124150484,-3.3364069240662704e-5,3.802938859382088e-8,0.003647498169133209,-3.360210126412473e-5,3.845809149088258e-8,0.0036479015316435363,-3.38109253939106e-5,3.883209072712449e-8,0.003648368986541947,-3.395689666898082e-5,3.909027582893097e-8,0.003648870921029724,-3.401521748118757e-5,3.9187927000580045e-8,0.0036493686380024244,-3.397675991479839e-5,3.91090927084104e-8,0.0036498219897588453,-3.385230235314705e-5,3.887418894134722e-8,0.0036501985693956885,-3.367263505175776e-5,3.854000701640252e-8,0.0036504824684245895,-3.348382883038354e-5,3.819088250354824e-8,0.003650680396759058,-3.333785800459016e-5,3.792145205144569e-8,0.003650822939161007,-3.3279840876376515e-5,3.781338373671198e-8,0.003650959134371577,-3.3334613467666114e-5,3.791106516073476e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json
new file mode 100644
index 0000000..3f54533
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":23000,"numberOfSamples":1000,"samples":[0.003651144035305788,-3.3496975736922465e-5,3.820410327566936e-8,0.0036514219143992843,-3.3730554777606135e-5,3.862552436820353e-8,0.0036518112676496577,-3.397791609056264e-5,3.907035721036122e-8,0.00365229870095008,-3.417907449598782e-5,3.9429383363913e-8,0.00365284489977173,-3.4290356787269744e-5,3.962343833009104e-8,0.0036533992613388363,-3.429527055965991e-5,3.962310443890886e-8,0.003653915601993734,-3.4204210437811016e-5,3.9448034728001705e-8,0.0036543625588809866,-3.404606217387052e-5,3.915149562803171e-8,0.003654726821743164,-3.385745548023324e-5,3.880065521411588e-8,0.003655011114586897,-3.367402646076845e-5,3.846060844958942e-8,0.003655229952491537,-3.352516388562213e-5,3.818482941081412e-8,0.0036554053665251193,-3.343165583497147e-5,3.8010946814686524e-8,0.0036555634966590643,-3.3404964167691095e-5,3.7959478606448984e-8,0.0036557319972541605,-3.3447035834001456e-5,3.803352192134055e-8,0.0036559377077366316,-3.355009646938942e-5,3.821840523078073e-8,0.003656203941986329,-3.3696494348695236e-5,3.848145228658821e-8,0.0036565469978612378,-3.3859223781751256e-5,3.877301569526761e-8,0.0036569720596978405,-3.4004124438745524e-5,3.9030579556823116e-8,0.003657469498455847,-3.40947073072433e-5,3.918763315500793e-8,0.003658013393850613,-3.409978236972752e-5,3.918760770228968e-8,0.0036585642841328063,-3.400250012732713e-5,3.9000338042948336e-8,0.003659077039174998,-3.380774452480385e-5,3.8635466490843415e-8,0.0036595124517896076,-3.354428513728769e-5,3.8146233975437406e-8,0.0036598488695074555,-3.325957393919969e-5,3.761980345160911e-8,0.0036600895177045143,-3.30080589998171e-5,3.7155744789631976e-8,0.0036602626699706706,-3.2836659874036776e-5,3.6839414480127626e-8,0.0036604145345912036,-3.277203283919482e-5,3.671875744486885e-8,0.003660597076071134,-3.281332359526204e-5,3.679128814107534e-8,0.0036608541980586175,-3.293230507705976e-5,3.700462952878297e-8,0.003661210012998719,-3.308093000187256e-5,3.7270537712529526e-8,0.003661662575751951,-3.320440094368456e-5,3.74888633727299e-8,0.003662185161327315,-3.325597408349231e-5,3.7574542846225874e-8,0.003662734729255613,-3.320874898829924e-5,3.747900861351535e-8,0.0036632644530644296,-3.3060666580031256e-5,3.719917570818271e-8,0.003663735688217234,-3.283177311008349e-5,3.677230797634811e-8,0.003664125550367317,-3.255600900274537e-5,3.6260899113540797e-8,0.0036644288159946347,-3.227144312843095e-5,3.573475239964142e-8,0.003664655379067319,-3.20122786606644e-5,3.525635740926294e-8,0.0036648256060508692,-3.180406776074698e-5,3.487218993328028e-8,0.0036649655917790954,-3.166186058055134e-5,3.460940215582945e-8,0.003665103342555086,-3.15901849968733e-5,3.4475849367541365e-8,0.003665265988254904,-3.158372346364206e-5,3.4461364201339914e-8,0.003665477540567749,-3.162801003528849e-5,3.4539055157405407e-8,0.0036657565338192736,-3.17000936026722e-5,3.466655892539428e-8,0.0036661130590637785,-3.176968248208968e-5,3.478820502904388e-8,0.003666545202793297,-3.180174937323968e-5,3.483986629008923e-8,0.003667035788941662,-3.1761745550580205e-5,3.475855435760227e-8,0.0036675514497473767,-3.162389916152661e-5,3.449759311569503e-8,0.003668046654744528,-3.138114071038292e-5,3.404470126419763e-8,0.0036684741721542814,-3.105261032794423e-5,3.343560777759723e-8,0.003668799974560434,-3.068345735179965e-5,3.2753539214570226e-8,0.0036690165364966303,-3.0334013759936222e-5,3.2109244036842246e-8,0.0036691474276989216,-3.0061206934846583e-5,3.160683200695938e-8,0.0036692401145173264,-2.9900241087574385e-5,3.131020806459519e-8,0.0036693503292834495,-2.9854613982101406e-5,3.122493185911916e-8,0.003669525187357138,-2.989751080207272e-5,3.1301037813817e-8,0.0036697912282753556,-2.9982013376298203e-5,3.1452001909760237e-8,0.003670149929656101,-3.0055069990531985e-5,3.15804774867729e-8,0.00367058012275416,-3.007069224005011e-5,3.160245845426072e-8,0.003671045233915078,-2.9999480736268876e-5,3.14646043020311e-8,0.00367150289146305,-2.9833136999524488e-5,3.1152343179196404e-8,0.0036719145236925356,-2.9583830819543413e-5,3.068856987855197e-8,0.0036722528819754623,-2.9279274289988172e-5,3.012451965536157e-8,0.0036725060723375516,-2.8955216659429878e-5,2.9525956515840337e-8,0.003672677754130943,-2.864755268356975e-5,2.895869275364607e-8,0.003672784291843022,-2.838594682136872e-5,2.8476927435519246e-8,0.0036728502871910297,-2.8189969093245898e-5,2.8116221838894727e-8,0.0036729039195573616,-2.8067750927584617e-5,2.7891105878276732e-8,0.0036729730472076353,-2.8016458620949784e-5,2.7795998669456532e-8,0.0036730823256591566,-2.8023639314141942e-5,2.7807699502206006e-8,0.0036732510393670506,-2.806876922500443e-5,2.7888233842029837e-8,0.0036734911388206174,-2.8124848250507907e-5,2.7987802985082756e-8,0.003673805048096844,-2.8160365318995213e-5,2.8048454388623762e-8,0.0036741831643614118,-2.8142417714421486e-5,2.800989211450284e-8,0.0036746017845311393,-2.8042014596425726e-5,2.781926303572099e-8,0.003675023305396148,-2.7842042600133794e-5,2.7445742165138232e-8,0.003675401277467576,-2.7546573380207877e-5,2.6897486202051013e-8,0.0036756920590245525,-2.718737099853137e-5,2.623340000871415e-8,0.0036758711240840844,-2.682142732552505e-5,2.555844943167183e-8,0.0036759465937811365,-2.6515692647237495e-5,2.499551903112205e-8,0.0036759605227197774,-2.6323182982489206e-5,2.464151777744949e-8,0.0036759744983032644,-2.6262593443452535e-5,2.4530039671133795e-8,0.0036760466285700347,-2.6312844659637143e-5,2.462156779143457e-8,0.0036762123044454384,-2.6424126112870143e-5,2.4824015221802194e-8,0.003676476786014314,-2.6537239075107872e-5,2.5028430559382807e-8,0.0036768192350094923,-2.6601221243758545e-5,2.5141395201407517e-8,0.0036772028513650874,-2.658386925131194e-5,2.5104237965815816e-8,0.0036775858883604795,-2.6474864491415744e-5,2.4898599976612817e-8,0.0036779306440379686,-2.6283647779182486e-5,2.4542371246482394e-8,0.003678209538973982,-2.603439997978615e-5,2.408037372138913e-8,0.003678408358108114,-2.5759783494692988e-5,2.357282896906436e-8,0.003678526948850447,-2.5494493653466036e-5,2.308351403533256e-8,0.0036785777355817883,-2.5269467883076505e-5,2.2669143006386352e-8,0.003678582593628918,-2.5107461818455048e-5,2.2371273529194018e-8,0.003678568782474355,-2.5020417507422695e-5,2.2211520779320994e-8,0.0036785647042003374,-2.500871973525351e-5,2.21902445854814e-8,0.0036785961805071692,-2.5062054156622615e-5,2.228816628316454e-8,0.003678683593958781,-2.5161266743696174e-5,2.24697994986493e-8,0.003678839813725382,-2.528068865976697e-5,2.268772363615898e-8,0.0036790686589521994,-2.5390721102639514e-5,2.28873548323344e-8,0.0036793636633603534,-2.5460766843175067e-5,2.301239734670839e-8,0.0036797070625050198,-2.5462938404665122e-5,2.3011746096490555e-8,0.0036800695540226,-2.5377224112577794e-5,2.2849032250097418e-8,0.0036804123072578534,-2.5198284596178738e-5,2.251506689142407e-8,0.003680693157902537,-2.4942526484895308E-05,2.2040681988927512e-8,0.003680878158399637,-2.4651854910035483e-5,2.150341156448466e-8,0.0036809565821238504,-2.4388619881055524e-5,2.101802531841774e-8,0.003680952179938686,-2.4218042502926116e-5,2.0704157135192892e-8,0.003680920788736872,-2.418258152607271e-5,2.063924897056901e-8,0.0036809307429876595,-2.428216159309294e-5,2.082238656290625e-8,0.0036810354111426534,-2.4473729304710523e-5,2.1173726237950885e-8,0.003681253971997315,-2.4690578711906134e-5,2.1570233191745147e-8,0.0036815697161010955,-2.4868511669727512e-5,2.1893875946001677e-8,0.00368194233743989,-2.4964629040890916e-5,2.2066135288962184e-8,0.003682324212490332,-2.496342898745231e-5,2.2059068741709067e-8,0.0036826731166814996,-2.4873277705717296e-5,2.1888636709994033e-8,0.0036829591588462465,-2.4718729832185195e-5,2.1600441398920033e-8,0.003683167023967205,-2.4532594782350245e-5,2.1255080252265367e-8,0.0036832954099022645,-2.4349370543578626e-5,2.0916081024659693e-8,0.0036833550335923348,-2.4200218198591833e-5,2.0640692551785886e-8,0.0036833658565634006,-2.410924176009306e-5,2.047307011231562e-8,0.00368335380237866,-2.4090944865297163e-5,2.0439619325797367e-8,0.0036833471475006176,-2.4148859135246296e-5,2.054650508300012e-8,0.003683372810946003,-2.4275435196936255e-5,2.07794955328708e-8,0.003683452919780664,-2.445325289733475e-5,2.110623168930102e-8,0.003683602046501696,-2.465734339942249e-5,2.1480525304410102e-8,0.003683825298735307,-2.4858264023953814e-5,2.184802813428788e-8,0.0036841172991974114,-2.5025683730293013e-5,2.2152849985111426e-8,0.0036844620856947494,-2.5132324086251992e-5,2.234486049199623e-8,0.003684833943600737,-2.5158192450841574e-5,2.2387540094785343e-8,0.0036851994497372497,-2.5095227283073492e-5,2.226654684123872e-8,0.003685521611166236,-2.495214102688181e-5,2.199854944989616e-8,0.0036857671361551635,-2.4758044853092278e-5,2.1637716007903936e-8,0.0036859169029455434,-2.4561976529873085E-05,2.127462522493109e-8,0.0036859772914223593,-2.44246555966739e-5,2.102094321803886e-8,0.0036859863765741317,-2.4400569866343113e-5,2.0976459090247287e-8,0.0036860072100742725,-2.451503865503077e-5,2.1187033549314085e-8,0.0036861059724534228,-2.4748908547852973e-5,2.1616674172997784e-8,0.003686324629094954,-2.504318975211854e-5,2.2156284356747038e-8,0.003686664486266351,-2.5323155005089623e-5,2.2668137696737203e-8,0.0036870898114569946,-2.5527244493044108e-5,2.303909962374833e-8,0.003687546149128421,-2.5624766795011134e-5,2.3213143420424893e-8,0.00368798044731879,-2.5617338941137874e-5,2.3193859568407812e-8,0.0036883539373483384,-2.5529670793774248e-5,2.3027315403045705e-8,0.0036886463867155743,-2.5397760191839542e-5,2.2780188658898496e-8,0.003688854693802478,-2.5259351496340612e-5,2.2522155643143783e-8,0.0036889891708466456,-2.5147850491353615e-5,2.231471497123031e-8,0.0036890695533378795,-2.5088946206269493e-5,2.2205016955307542e-8,0.0036891214131626097,-2.5098827308126288e-5,2.222261384963983e-8,0.0036891729137179556,-2.518329063537529e-5,2.2377841591020216e-8,0.0036892516769625227,-2.5337494371236543e-5,2.2661397865423784e-8,0.0036893816097385863,-2.554645169281843e-5,2.3045303929869593e-8,0.0036895797925711486,-2.578657672893664e-5,2.3485809567516533e-8,0.0036898538468566012,-2.6028463573269312e-5,2.392855402626147e-8,0.003690200266554174,-2.624073990187162e-5,2.431568410168666e-8,0.0036906040827712275,-2.6394652975592825e-5,2.4594312535909952e-8,0.0036910401320671615,-2.646892578198544e-5,2.4725481010514338e-8,0.0036914760290490357,-2.6454258869800837e-5,2.469246723504824e-8,0.0036918767628710283,-2.6356872170899155e-5,2.450728188668473e-8,0.003692210885339878,-2.6200462392483775e-5,2.4214168577148188e-8,0.0036924581686777775,-2.602543095805307e-5,2.388800430693621e-8,0.003692617733382483,-2.5883626505455566e-5,2.362443103435925e-8,0.0036927139953002153,-2.58271594885082e-5,2.3519158494680385e-8,0.0036927961075991973,-2.5891978747853797e-5,2.3637775773338626e-8,0.0036929267649546634,-2.6081277797364088e-5,2.398538810384016e-8,0.0036931609455419815,-2.6358161739026842e-5,2.4493348826303326e-8,0.0036935234174346435,-2.665549718890737e-5,2.5037572254635175e-8,0.003693998101314756,-2.6900775812927172e-5,2.5484402286752192e-8,0.0036945360219985063,-2.7042710855034788e-5,2.5739608547857825e-8,0.0036950760446270714,-2.7065371302568437e-5,2.57743737612283e-8,0.003695565661023816,-2.6985691375977797e-5,2.5620578062499176e-8,0.00369597274607554,-2.684069713273219e-5,2.5347080120574853e-8,0.003696287324292012,-2.667345195030066e-5,2.5033662232297028e-8,0.0036965173262114045,-2.6523010525635966e-5,2.4752456189175374e-8,0.0036966825886261623,-2.6419227346433036e-5,2.455840471365584e-8,0.003696809522700842,-2.6380986372349695e-5,2.4486064306819182e-8,0.0036969270936339123,-2.6416117172469423e-5,2.454950799475654e-8,0.0036970637745599656,-2.6521893503182198e-5,2.4743286277766767e-8,0.0036972449046433265,-2.6685737210574117e-5,2.504376987032764e-8,0.0036974900334030988,-2.6886274245188e-5,2.541115595707101e-8,0.003697810176347896,-2.7095219934198905e-5,2.5793006605434385e-8,0.0036982053804941253,-2.728057365079077e-5,2.613018555159297e-8,0.003698663356525077,-2.7411217452902692e-5,2.6365357275177697e-8,0.0036991599725369096,-2.7462484334453646e-5,2.6453253365305067e-8,0.0036996621606698965,-2.7421763096580724e-5,2.6370997112730044e-8,0.00370013328491362,-2.729281033021235e-5,2.6126029195423446e-8,0.0037005403211717563,-2.7097411250876837e-5,2.5759105766375958e-8,0.0037008616198824073,-2.6873458549975153e-5,2.534063229254157e-8,0.0037010937154705065,-2.6669054268328128e-5,2.4959623377691335e-8,0.0037012553893138378,-2.6532771677849146e-5,2.470560529795536e-8,0.003701386925754609,-2.6501162935385394e-5,2.464554459140342e-8,0.0037015427319560873,-2.65862451416973e-5,2.4800881221936585e-8,0.0037017770840136652,-2.6767600671031702e-5,2.5133175185444305e-8,0.003702126226889177,-2.6994365678892358e-5,2.5547991564237983e-8,0.003702594034496086,-2.7199503702774686e-5,2.5921361512321817e-8,0.003703149146929241,-2.7322124217394617e-5,2.6140992193989e-8,0.0037037362260185593,-2.732763109091641e-5,2.6143421934714618e-8,0.003704295665546802,-2.721607872496196e-5,2.5929372282700263e-8,0.0037047816795343263,-2.7016566312550213e-5,2.5553267597604028e-8,0.003705171555362991,-2.6773370862474705e-5,2.509745527697299e-8,0.003705465407158616,-2.6531809403462105e-5,2.4645955131628586e-8,0.0037056802842188206,-2.6328749558537203e-5,2.4266888380384873e-8,0.003705842962671197,-2.6188473724591307e-5,2.4004889346311846e-8,0.0037059839388316924,-2.6122241314280676e-5,2.3880388417301026e-8,0.0037061332623507665,-2.6129556128220352e-5,2.3892034999399584e-8,0.003706317770909461,-2.6199800840217618e-5,2.4019772205175913e-8,0.0037065589557418377,-2.6313745875571078e-5,2.4227665838511646e-8,0.003706870840343872,-2.644512355745995e-5,2.4466855843329514e-8,0.003707257688373799,-2.6562856852741105e-5,2.4679720562225874e-8,0.003707711915905993,-2.6634592082949376e-5,2.4806441695489335e-8,0.003708213120455237,-2.663186058357122e-5,2.479455939697902e-8,0.0037087294412449907,-2.6536451255494063e-5,2.4610743259413702e-8,0.003709222214515911,-2.6346543661015368e-5,2.4252099963225886e-8,0.0037096538724641567,-2.6080329046030495e-5,2.3752812169666824e-8,0.003709997524539029,-2.577492734907529e-5,2.3182040780489726e-8,0.0037102454227998637,-2.5479672505274922e-5,2.263137359655951e-8,0.0037104132986381126,-2.524481178501241e-5,2.219379012489409e-8,0.0037105385684950997,-2.5108446768208215e-5,2.1939440481081604e-8,0.003710672201591465,-2.5085405601484373e-5,2.1895121723236657e-8,0.0037108659074224157,-2.5161493732589e-5,2.2033822651041703e-8,0.0037111577917986476,-2.5295461489293446e-5,2.2278586025456243e-8,0.0037115606470070174,-2.542917933201141e-5,2.2521498478199035e-8,0.0037120571654388006,-2.5503837048517596e-5,2.2653719725711947e-8,0.003712604656330799,-2.5477070966070233e-5,2.259714366597435e-8,0.0037131481138471807,-2.5334611035146297e-5,2.232587717598007e-8,0.0037136365417578987,-2.509202414715311e-5,2.1869364929837613e-8,0.0037140360486028587,-2.4786787143587042e-5,2.1297584304020552e-8,0.0037143354755474435,-2.4465255139622436e-5,2.069678054959071e-8,0.003714544467024974,-2.4170306202152613e-5,2.0146497047207724e-8,0.003714687020580643,-2.393338515246342e-5,1.9704838425664365e-8,0.0037147941125955726,-2.3771532108372094e-5,1.9403042636394202e-8,0.0037148976705766875,-2.3687944947412868e-5,1.924662719845783e-8,0.0037150265340877417,-2.367419895466894e-5,1.9219583030809972e-8,0.003715204015883382,-2.37127525260934e-5,1.928905809182854e-8,0.0037154462776015544,-2.377915294824585e-5,1.9409457545578542e-8,0.0037157608120527794,-2.384409788521174e-5,1.9526274662557453e-8,0.0037161447586631148,-2.387597552240848e-5,1.9580823667812967e-8,0.003716583383528966,-2.384460787773986e-5,1.9517213785745727e-8,0.0037170496879362957,-2.372665990986959e-5,1.929240272445178e-8,0.003717506623292282,-2.3512366057301022e-5,1.8888665065491976e-8,0.003717913280569818,-2.3211764390501293e-5,1.832510925529357e-8,0.0037182350231976446,-2.2857213753819283e-5,1.766226069432184e-8,0.0037184549931704456,-2.2499015996168416e-5,1.69938183046161e-8,0.0037185822522199053,-2.2193400184984013e-5,1.642422937600723e-8,0.0037186520125712316,-2.1986125984029035e-5,1.6038180871423233e-8,0.0037187166025020217,-2.1897980951190913e-5,1.5873715102312037e-8,0.0037188302313518797,-2.1918094714878887e-5,1.5909975868926e-8,0.0037190333250862505,-2.200738683831528e-5,1.6073822676410523e-8,0.003719341736464505,-2.211021106517147e-5,1.6261616807192078e-8,0.003719743573072058,-2.216979978548509e-5,1.636795341593824e-8,0.0037202036700935363,-2.214280148765948e-5,1.631260873446929e-8,0.0037206737661205037,-2.2009147434640982e-5,1.6058763393847896e-8,0.0037211051970497504,-2.1775071201819367e-5,1.5618506174731158e-8,0.003721460458739193,-2.1469112666244478e-5,1.5045318183279198e-8,0.0037217205729197273,-2.113297412457324e-5,1.4417004888548999e-8,0.0037218868002361744,-2.081050254733132e-5,1.3815164650950308e-8,0.0037219772900882707,-2.0538209327698315e-5,1.3307554545741322e-8,0.003722020789722907,-2.033950176989565e-5,1.2937408851043707e-8,0.00372204987109083,-2.022296133826621e-5,1.2720322617019088e-8,0.0037220953992123298,-2.018363795951063e-5,1.2646747001885697e-8,0.0037221828649194387,-2.0205878245740093e-5,1.26873047206367e-8,0.0037223303313133104,-2.02664502220618e-5,1.2798609312135926e-8,0.003722547317866394,-2.0337344535813425e-5,1.292845264550573e-8,0.0037228339677174557,-2.0388317730423293e-5,1.3020518278734751e-8,0.003723180190839855,-2.0389705420379754e-5,1.3019629712220013e-8,0.0037235650128087322,-2.0316187736311858e-5,1.2878799919059847e-8,0.003723957027956693,-2.0152005616268402e-5,1.256897561523051e-8,0.003724317479797812,-1.9897320189773163e-5,1.2090860847159705e-8,0.0037246074892309214,-1.9573777293026863e-5,1.1485194896322013e-8,0.0037247994563825186,-1.922551672634567e-5,1.0834500081040653e-8,0.003724889413287953,-1.8911635022200557e-5,1.024891375539621e-8,0.003724903860006442,-1.8689419208005423e-5,9.834890386340725e-9,0.0037248950039658825,-1.8593936835862856e-5,9.657227552497414e-9,0.0037249241617011717,-1.8624070004157957e-5,9.713213497022367e-9,0.0037250406734058938,-1.874272347827841e-5,9.933231932671707e-9,0.003725266442256563,-1.889068343187049e-5,1.0206743013046786e-8,0.003725591957814072,-1.900639132302381e-5,1.0419161121580107e-8,0.0037259828367480837,-1.9042941445738243e-5,1.0483445088589561e-8,0.0037263919105630754,-1.8977532859680972e-5,1.0357575288150131e-8,0.0037267718541946424,-1.8812970780198845e-5,1.004722544629047e-8,0.0037270852122032435,-1.857321752592454e-5,9.597390829866145e-9,0.0037273105106150057,-1.829556589372417e-5,9.077766944676528e-9,0.0037274442822466383,-1.8021665816886436e-5,8.566019197106112e-9,0.003727499446205275,-1.7789180452793088e-5,8.132238797880786e-9,0.0037275009651962054,-1.762549477405663e-5,7.827238632585327e-9,0.003727480107433613,-1.7544324987777415e-5,7.676278027300595e-9,0.003727468693735596,-1.7545252223564655e-5,7.678260381961283e-9,0.0037274943796830745,-1.7615546114334517e-5,7.809198521585769e-9,0.0037275775048591624,-1.773333185341448e-5,8.028155894012631e-9,0.003727729461688348,-1.7871140037744037e-5,8.283855986333845e-9,0.0037279521045785026,-1.7999224672154963e-5,8.520831022886832e-9,0.0037282376812551145,-1.80885880022614e-5,8.685033780576021e-9,0.0037285690243083164,-1.8114038809190196e-5,8.729555432946514e-9,0.003728920113641478,-1.8057767593507887e-5,8.621345067804234e-9,0.0037292576952676747,-1.7913835381609194e-5,8.349624258909386e-9,0.0037295452618239825,-1.769325645659619e-5,7.935342096310923e-9,0.003729750685610381,-1.742782377238727e-5,7.438195143004906e-9,0.0037298573864923707,-1.7169070621178025e-5,6.954523489002591e-9,0.0037298756982351187,-1.6978346810287705e-5,6.598664526266755e-9,0.003729847357057938,-1.690734999300974e-5,6.466620041821976e-9,0.0037298361456615196,-1.6976011363689884e-5,6.594939654273422e-9,0.0037299052651525726,-1.716065001020904e-5,6.938856540972064e-9,0.003730092529452638,-1.7401587629302746e-5,7.386701385086378e-9,0.0037303974273488636,-1.7626624987369516e-5,7.803782958842304e-9,0.0037307856005640463,-1.7776600142330956e-5,8.080023637204767e-9,0.0037312048557727917,-1.782075236454326e-5,8.158500185359126e-9,0.0037316025984929033,-1.7758874434021704e-5,8.039315141398938e-9,0.003731938096263313,-1.7614499874872118e-5,7.76676690099454e-9,0.0037321881752387263,-1.7424800949631686e-5,7.410439462798648e-9,0.003732347832913049,-1.7230987288991442e-5,7.047285654047261e-9,0.003732427807332729,-1.7070752855394434e-5,6.747564430999931e-9,0.0037324505819447216,-1.6972951318685194e-5,6.564937105062063e-9,0.0037324456392299724,-1.695435236964585e-5,6.530439072511247e-9,0.003732444524964121,-1.701842445824136e-5,6.650238763256346e-9,0.0037324762624747466,-1.7155994000405556e-5,6.906918712508451e-9,0.003732563584080442,-1.734745000939961e-5,7.263649467205659e-9,0.003732720347862681,-1.7566052220995436e-5,7.670403442963853e-9,0.003732950305259306,-1.7781762662003478e-5,8.071102483695934e-9,0.003733247046701793,-1.796503766997897e-5,8.410658713739836e-9,0.003733594793483443,-1.8090329320746774e-5,8.641476568061361e-9,0.003733969829689655,-1.8139333953936072e-5,8.729522514097567e-9,0.0037343425695851745,-1.8104141430392796e-5,8.660245887318678e-9,0.003734680606263795,-1.7990430125363365e-5,8.444572497323546e-9,0.003734953553838489,-1.782034694147802e-5,8.124239420623847e-9,0.003735140403146867,-1.7633507226156773e-5,7.77352976095781e-9,0.003735238848109435,-1.748329459267977e-5,7.4921953391734e-9,0.003735273477531778,-1.742550583944127e-5,7.384151459049214e-9,0.0037352966592492363,-1.749922907883764e-5,7.52182191537506e-9,0.0037353759026406193,-1.7706708770883272e-5,7.908742842178216e-9,0.003735568740471046,-1.8005201420696946e-5,8.464598259716825e-9,0.003735897522340255,-1.8320262806021934e-5,9.050180658370451e-9,0.0037363400742964556,-1.8575326378219387e-5,9.522633384422312e-9,0.0037368415776035976,-1.8720037863678725e-5,9.788290822532997e-9,0.0037373380712256233,-1.874245668787921e-5,9.825363797506921e-9,0.0037377771555825133,-1.8663787364666786e-5,9.673974471483982e-9,0.0037381282616453346,-1.852433494079792e-5,9.409797508911304e-9,0.0037383834002827367,-1.8369540890756483e-5,9.117901324121186e-9,0.003738552757404369,-1.824019873721411e-5,8.874473223547163e-9,0.003738658809558917,-1.8167100505264942e-5,8.736870253285727e-9,0.003738730844138739,-1.8168783218842287e-5,8.739462794445459e-9,0.0037388003329487827,-1.8251037280980622e-5,8.892751862877826e-9,0.00373889698628947,-1.8407514500518183e-5,9.18453775255549e-9,0.0037390453516148825,-1.8621272393550024e-5,9.582855243041857e-9,0.0037392620029640536,-1.886722395403692e-5,1.0040612490717398e-8,0.0037395535311001136,-1.9115464924135617e-5,1.0501851379362463e-8,0.0037399156645016815,-1.9335279841595094e-5,1.0909231443508442e-8,0.003740333727271666,-1.949936503986908e-5,1.1211879486748627e-8,0.0037407843754003085,-1.9587781487259298e-5,1.1372730485053469e-8,0.00374123843967038,-1.9591286559904284e-5,1.1374739407503882e-8,0.003741664694071747,-1.951376722599113e-5,1.1225445494692067e-8,0.003742034426709988,-1.9373566096839915e-5,1.0959456056172562e-8,0.0037423268826330203,-1.9203348136011737e-5,1.0638143074060602e-8,0.0037425355319994974,-1.9047512251718933e-5,1.0344682395521544e-8,0.003742674153842459,-1.8955552707843683e-5,1.0171510875620036e-8,0.003742780075672932,-1.897020365172007e-5,1.0198117014107015e-8,0.003742910352084255,-1.91115247419747e-5,1.0461391980825988e-8,0.003743127236642866,-1.936274082819314e-5,1.0929372494595087e-8,0.0037434748877366456,-1.966787992300605e-5,1.1497025901544866e-8,0.0037439582292228346,-1.994830716850865e-5,1.2017239417133448e-8,0.0037445380916303205,-2.0132874757777342e-5,1.235715857869903e-8,0.003745147304945264,-2.018475709919423e-5,1.24483095139559e-8,0.003745717536123864,-2.0110039024257403e-5,1.2302602979977455e-8,0.0037462009957385913,-1.994718213155144e-5,1.1992528512288664e-8,0.003746578533952196,-1.9748112336383324e-5,1.1615631205305184e-8,0.0037468562058775336,-1.9561943110626034e-5,1.1263957057301948e-8,0.0037470568320752493,-1.942580720910747e-5,1.1006894832462288e-8,0.003747211591296955,-1.936188801722068e-5,1.0885690830408487e-8,0.0037473537091404366,-1.937798694893093e-5,1.0914592901045096e-8,0.00374751426169476,-1.9469411529319156e-5,1.1084443738119213e-8,0.003747719306811906,-1.9621107982094123e-5,1.1366715498674678e-8,0.003747987653823677,-1.98098865025236e-5,1.171772196127629e-8,0.0037483289877986337,-2.00069900657524e-5,1.2083476553019989e-8,0.0037487424409848157,-2.018133651430223e-5,1.2405790481457967e-8,0.003749216049729212,-2.0303576953806943e-5,1.262985740223278e-8,0.0037497276616432853,-2.0350656359240593e-5,1.2712744009555985e-8,0.0037502476097356495,-2.0310161881186038e-5,1.263147987969798e-8,0.0037507430698388022,-2.01836052339569e-5,1.238917732256602e-8,0.003751183640813286,-1.9987806416820744e-5,1.201762072309364e-8,0.003751547358372743,-1.975377558398845e-5,1.1575159589463945e-8,0.0037518262278624856,-1.9522888966651756e-5,1.1139487350292194e-8,0.003752030366449994,-1.9340357022812065e-5,1.0795307888503861e-8,0.003752189575101569,-1.9246075080711368e-5,1.0617115929008991e-8,0.00375235065514588,-1.926362082860626e-5,1.0648597353873207e-8,0.00375256874733072,-1.9389760757096198e-5,1.0883103913087454e-8,0.0037528923589819,-1.95889336244771e-5,1.1253515334163685e-8,0.003753345377221318,-1.9798233653190108e-5,1.1641722277737352e-8,0.003753914085684261,-1.9945444226348306e-5,1.1912441558529761e-8,0.0037545482183929373,-1.997468342657704e-5,1.1961217063101045e-8,0.003755178268860511,-1.9866841003214947e-5,1.1752664664935419e-8,0.003755740498054235,-1.9643572837075e-5,1.132790926630942e-8,0.003756196287862252,-1.9354386897528227e-5,1.078027677361611e-8,0.0037565380292510645,-1.9056473937833167e-5,1.02173374524946e-8,0.003756783287516352,-1.879808625982981e-5,9.729641408606765e-9,0.003756964059188642,-1.8610299848009276e-5,9.375278483928095e-9,0.0037571168822495586,-1.850601029274588e-5,9.178087064121487e-9,0.0037572761536310796,-1.8482743679660896e-5,9.133032553034088e-9,0.003757470458105261,-1.8526444575679007e-5,9.213386299761704e-9,0.003757720726876309,-1.8614862202039136e-5,9.377117285257808e-9,0.0037580391353763576,-1.8720347719301517e-5,9.572164083264661e-9,0.0037584281701537876,-1.88124868526117e-5,9.741392613497707e-9,0.003758879845331222,-1.886115999095588e-5,9.828343171502811e-9,0.003759375547369298,-1.884045521805883e-5,9.784556157303305e-9,0.0037598873171901443,-1.8733336140393533e-5,9.578297218737537e-9,0.0037603812993048536,-1.8536245409891986e-5,9.20316322759362e-9,0.003760823522734917,-1.826223272290799e-5,8.683933253519903e-9,0.0037611872682305502,-1.794102306496649e-5,8.07668074991078e-9,0.003761460322951104,-1.761495849043393e-5,7.461118830695648e-9,0.003761649939215854,-1.7330967802997768e-5,6.925453527388214e-9,0.003761783669047966,-1.7130080930370736e-5,6.546618226195867e-9,0.0037619052215471355,-1.7036850169632218e-5,6.370380696093653e-9,0.0037620655927134623,-1.7051287457088965e-5,6.396265383341771e-9,0.0037623107889809214,-1.7145824206739997e-5,6.571987750426438e-9,0.0037626686506996173,-1.7269316797664524e-5,6.8011328521040325e-9,0.0037631385620556235,-1.7358826009662052e-5,6.965369983083214e-9,0.003763688525936491,-1.735727517214488e-5,6.957620478797519e-9,0.0037642627046168722,-1.7231514285195872e-5,6.7159383377332736e-9,0.003764798192409383,-1.6983144070799588e-5,6.243784790204022e-9,0.003765244475384821,-1.6646684177942917e-5,5.606514320308481e-9,0.003765577041731878,-1.6276113749033035e-5,4.905976489211403e-9,0.0037658001496303955,-1.5926872483978327e-5,4.246574565661419e-9,0.003765940043113608,-1.5641428521669665e-5,3.7080826046676444e-9,0.0037660339883212393,-1.5442580188857785e-5,3.3330932819261697e-9,0.0037661202972565054,-1.533378212849883e-5,3.1277370664346276e-9,0.0037662317987403426,-1.530331931720143e-5,3.0696368494463564e-9,0.00376639269783391,-1.5329353706236113e-5,3.117459743615627e-9,0.0037666175999535394,-1.5384239766858776e-5,3.2190461479142756e-9,0.003766911424015544,-1.5437798596845338e-5,3.3175546155956647e-9,0.0037672694199051165,-1.5460010735471215e-5,3.3565118674225895e-9,0.003767677144880793,-1.5423844881946676e-5,3.285127707090549e-9,0.0037681108405431198,-1.5308808573030386e-5,3.0649759961602738e-9,0.00376853909328297,-1.5105335091860154e-5,2.678249819012819e-9,0.0037689267978603287,-1.4819271966290807e-5,2.1362017496681052e-9,0.0037692419464796334,-1.4474679157593949e-5,1.4843891964449467e-9,0.003769464408607395,-1.4112525842013234e-5,8.001758661740843e-10,0.0037695940570376656,-1.3783562552421724e-5,1.7924187200268179e-10,0.003769654513644912,-1.3535943066435279e-5,-2.877953882684514e-10,0.003769689655352273,-1.3401132828683478e-5,-5.419454827697908e-10,0.0037697528877103145,-1.3383352936094304e-5,-5.756719343471206e-10,0.0037698924838657317,-1.3456848768446041e-5,-4.379133873754168e-10,0.0037701379529232566,-1.3572133855236433e-5,-2.2219011005250034e-10,0.0037704917152187136,-1.36690613658659e-5,-4.190341608565942e-11,0.003770928286669406,-1.3692704936665648e-5,-4.184426881656405e-13,0.003771400984222682,-1.360764722503169e-5,-1.6419689144365008e-10,0.0037718542846100875,-1.3406801484918508e-5,-5.462400593197952e-10,0.0037722383742051645,-1.3112239502991186e-5,-1.1045888736203505e-9,0.0037725215280944423,-1.2767820548965187e-5,-1.756277314541145e-9,0.003772696517123917,-1.2426225277517897e-5,-2.4018373226817705e-9,0.003772779492258509,-1.2135018031827889e-5,-2.9516198186066968e-9,0.0037728027992608884,-1.1926333275018554e-5,-3.345233937647147e-9,0.003772805248437262,-1.1812618336310583e-5,-3.559509949169215e-9,0.0037728234022769208,-1.1787985186950563e-5,-3.605855082757096e-9,0.003772885871274732,-1.1832888997680663e-5,-3.5213519611769673e-9,0.0037730107830056705,-1.1919671821302818e-5,-3.3582733409701644e-9,0.0037732054834411486,-1.201738319949041e-5,-3.1750111515168823e-9,0.0037734672788120238,-1.2095393134790393e-5,-3.029308059715573e-9,0.0037737843623683997,-1.2126141515841897e-5,-2.9731078275435696e-9,0.0037741366633792803,-1.2087713479066177e-5,-3.0477005332985616e-9,0.0037744969434948855,-1.1966854684521575e-5,-3.2780044851181107e-9,0.0037748329505799573,-1.1762652811277419e-5,-3.665584516120736e-9,0.0037751117090649177,-1.1490296257088035e-5,-4.1815534879312055e-9,0.003775306671071242,-1.1183066734645489e-5,-4.762857357367671e-9,0.0037754069823609203,-1.0889694911885241e-5,-5.3173572358538974e-9,0.0037754256798606545,-1.0664706834353456e-5,-5.742147928915882e-9,0.003775401726689244,-1.0552455653838138e-5,-5.953742048116789e-9,0.003775391866454253,-1.0570337492320954e-5,-5.9196954740658214E-09,0.0037754533346908404,-1.069965404964022e-5,-5.6757115830877735e-9,0.0037756245234761812,-1.0889973474384802e-5,-5.3172574611983255e-9,0.0037759125769722722,-1.1075505491388981e-5,-4.9685789284492975e-9,0.0037762927653174714,-1.119569145297422e-5,-4.743856103245313e-9,0.0037767180710236953,-1.1211551456236634e-5,-4.716422581730153e-9,0.0037771336262513635,-1.1113289439129748e-5,-4.904484620551893e-9,0.0037774906920141566,-1.0919093669290008e-5,-5.273435637376515e-9,0.0037777568305629415,-1.0667562119560446e-5,-5.750186818487831e-9,0.0037779208867569462,-1.0406866195721732e-5,-6.243650787702565e-9,0.003777992767016646,-1.018352746019933e-5,-6.665958168127169e-9,0.0037779989182269913,-1.0033140590648544e-5,-6.949989656900959e-9,0.0037779751011073896,-9.97469904417571e-6,-7.060078675057539e-9,0.0037779584786724603,-1.0009194292538516e-5,-6.994608417451776e-9,0.0037779809048557934,-1.0121958368840203e-5,-6.781516708789922e-9,0.0037780645720082466,-1.0287344353781977e-5,-6.469394097223917e-9,0.003778220234630747,-1.047413085648688e-5,-6.1172540917545026e-9,0.003778447456985994,-1.0650388607779883e-5,-5.785368244403539e-9,0.003778735979536752,-1.078723859059365e-5,-5.528224279977244e-9,0.0037790674522738318,-1.086163687447547e-5,-5.3893085312301e-9,0.0037794172242492487,-1.0858682366088469e-5,-5.396741791551607e-9,0.003779756331525049,-1.0773944571270184e-5,-5.55883105247937e-9,0.0037800542820276006,-1.0616049404699768e-5,-5.859127603922072e-9,0.0037802835715694304,-1.0409041615552987e-5,-6.251958361016585e-9,0.0037804265587483227,-1.019284428731572e-5,-6.661632999833887e-9,0.0037804839392265306,-1.0019107510829138e-5,-6.990419724209726e-9,0.003780481632655872,-9.940027335123063e-6,-7.139785874260027e-9,0.003780470551458204,-9.990760852975178e-6,-7.043636122099973e-9,0.0037805145003715693,-1.0171924492472818e-5,-6.701260118724001e-9,0.0037806679024364473,-1.0443026877787217e-5,-6.189548974586507e-9,0.003780953749669685,-1.0734040814978671e-5,-5.640990002948598e-9,0.003781354446672115,-1.0970848138577473e-5,-5.195569712053512e-9,0.0037818202123343133,-1.1100878236964057e-5,-4.952398320323635e-9,0.0037822885451625726,-1.1106690075405191e-5,-4.9441331682067115e-9,0.0037827037918562686,-1.1004732221553931e-5,-5.139393429677356e-9,0.003783029580921028,-1.083450210581651e-5,-5.463297256101165e-9,0.0037832528926456414,-1.0645014240624529e-5,-5.8230619263333884E-09,0.003783382008619057,-1.0483107839539345e-5,-6.130107278142606e-9,0.0037834411521074293,-1.0385293670330903e-5,-6.315462602182711e-9,0.003783463866855065,-1.0373167422302901e-5,-6.338434431871988e-9,0.003783486346677699,-1.0451924135314523e-5,-6.1894075059543604e-9,0.0037835415059761126,-1.0611498941792025e-5,-5.887657773983901e-9,0.0037836543994592214,-1.0829747870240204e-5,-5.475280541301254e-9,0.0037838393893894684,-1.1076912436351042e-5,-5.00868499477498e-9,0.0037840991940355684,-1.1320547095963303e-5,-4.549244861849569e-9,0.0037844256115939245,-1.1530111692398709e-5,-4.154636535393267e-9,0.003784801380528869,-1.168067724546158e-5,-3.871892905681978e-9,0.0037852026131201958,-1.1755664641185652e-5,-3.732277813199833e-9,0.0037856015155439153,-1.1748839795853997e-5,-3.747515652641209e-9,0.003785969367532291,-1.166580442859177e-5,-3.906921033511718e-9,0.00378628001510182,-1.1525110745466617e-5,-4.175235589964458e-9,0.003786514449205436,-1.1358637205725354e-5,-4.491921267897067e-9,0.0037866667919770496,-1.1209875032777431e-5,-4.774493370527981e-9,0.0037867507548969247,-1.1128029735137191e-5,-4.929817589830909e-9,0.0037868036489551913,-1.1156279232741838e-5,-4.8764159931144795e-9,0.0037868831215570773,-1.1315159538627571e-5,-4.575860551166065e-9,0.0037870524179700496,-1.1587432273622035e-5,-4.061235434398263e-9,0.0037873563096598654,-1.1915434657407038e-5,-3.441960618087722e-9,0.0037877994416602927,-1.2218268853877623e-5,-2.871179678081107e-9,0.00378834159065941,-1.2422814649923206e-5,-2.4871089224278254e-9,0.0037889140278449785,-1.249102829822317e-5,-2.361451809750297e-9,0.0037894464319104034,-1.2428832387716597e-5,-2.4826372919214795e-9,0.003789888854569995,-1.2276000741283246e-5,-2.775033513542293e-9,0.003790220598166225,-1.2087372015433666e-5,-3.13458685349092e-9,0.003790447689810322,-1.1915907774812648e-5,-3.4609407828149515e-9,0.0037905948035725874,-1.1802236082212254e-5,-3.6772233896817644e-9,0.003790696401172688,-1.1770385986698964e-5,-3.73808626895047e-9,0.003790789335206898,-1.1827575732369238e-5,-3.6300747743801807e-9,0.003790907337032187,-1.1966138926110403e-5,-3.3679632150517645e-9,0.0037910770946163676,-1.2166553303929558e-5,-2.9889909055131355e-9,0.0037913156361942314,-1.2401135693384962e-5,-2.545809144827838e-9,0.0037916289168516333,-1.263815898674036e-5,-2.0986190900712304e-9,0.0037920116463947694,-1.2846175399722612e-5,-1.7069510131467538e-9,0.0037924484233062025,-1.299819527970367e-5,-1.4217770124520617e-9,0.0037929160329965078,-1.3075228465631499e-5,-1.2788768709480869e-9,0.0037933865555892653,-1.3068858631174979e-5,-1.294030013439374e-9,0.0037938309814365434,-1.2982776331081918e-5,-1.4601266957738199e-9,0.0037942231481280977,-1.283322743822306e-5,-1.7462770627408988e-9,0.003794543866539171,-1.2648304256008901e-5,-2.0991058430070644e-9,0.003794785242433129,-1.2465858940810928e-5,-2.4467144889246194e-9,0.0037949550625008244,-1.232927438422763e-5,-2.7067816859225326e-9,0.003795080187817642,-1.2279927284374798e-5,-2.8009626097236014e-9,0.0037952065161867134,-1.2345871523227187e-5,-2.6763892980301933e-9,0.0037953921373555235,-1.2528542983790664e-5,-2.3307936469979733e-9,0.0037956913857025054,-1.2793157015980988e-5,-1.8305356927816436e-9,0.003796132776286854,-1.3071563213552118e-5,-1.3050406169510527e-9,0.0037967017325761278,-1.328280143626571e-5,-9.077926254452141e-10,0.0037973411548898497,-1.3364516232244082e-5,-7.568234874396928e-10,0.0037979727650269374,-1.3297561018064426e-5,-8.881042448926196e-10,0.003798527090663047,-1.3109356495992466e-5,-1.2492122368724608e-9,0.003798964917021712,-1.28570520619648e-5,-1.7313517826797332e-9,0.0037992820034057637,-1.2603783737617608e-5,-2.2145093402545987e-9,0.003799500926082306,-1.240063635168012e-5,-2.6017407417391375e-9,0.0037996585584883936,-1.2278587025970907e-5,-2.8344302677579545e-9,0.0037997952173949366,-1.2248205620853774e-5,-2.892780987975255e-9,0.0037999474748775944,-1.2303191954665917e-5,-2.789037696090718e-9,0.003800144171209063,-1.2424890429828608e-5,-2.5588855394347242e-9,0.0038004044225855666,-1.2586549203308632e-5,-2.2533402981175947e-9,0.003800736709459013,-1.2757180681021012e-5,-1.9313801867040904e-9,0.0038011386726849684,-1.2905234943333781e-5,-1.6529274004774604e-9,0.0038015976307220777,-1.300228941643676e-5,-1.4718298071475957e-9,0.0038020920655212837,-1.3026745702081325e-5,-1.4288825387251392e-9,0.0038025942999659027,-1.2967137471847075e-5,-1.5456250913598982e-9,0.0038030742779153713,-1.2824453504739554e-5,-1.8199956009474816e-9,0.0038035040835843223,-1.2613005619355985e-5,-2.224696148359336e-9,0.003803862725819495,-1.2359515273662385e-5,-2.7088896073266286e-9,0.0038041406058219682,-1.210021971862752e-5,-3.203654961905564e-9,0.003804343039903815,-1.187601536262798e-5,-3.6312222314006306e-9,0.0038044921992625045,-1.172572264151848e-5,-3.9178384073525195e-9,0.00380462650870891,-1.1677577510893996e-5,-4.010014190249887e-9,0.0038047960105914956,-1.1739750231113836e-5,-3.892553967922982e-9,0.0038050522524015824,-1.1892359741202971e-5,-3.603641811340095e-9,0.0038054328722651374,-1.2085474055587181e-5,-3.238495369877979e-9,0.003805944893983198,-1.224821847258572e-5,-2.931950879082715e-9,0.003806555314129275,-1.2310374852742212e-5,-2.8173999266934114e-9,0.003807197680863527,-1.2229146407934576e-5,-2.9759540232212596e-9,0.0038077950074467274,-1.2006673466743497e-5,-3.4031768325958983e-9,0.003808287639007238,-1.1687444632760447e-5,-4.014049779331443e-9,0.003808650970431554,-1.1338022030420527e-5,-4.681632012604156e-9,0.003808896131037573,-1.1022265614456972e-5,-5.284306129734353e-9,0.0038090582406506883,-1.0784417102233183e-5,-5.738002868905132e-9,0.0038091815513970188,-1.0643809594594406e-5,-6.006202185145872e-9,0.003809307974440942,-1.0597903969188504e-5,-6.094047127429888e-9,0.0038094707196667066,-1.062865600428072e-5,-6.036147477861492e-9,0.0038096919065528753,-1.070881560223071e-5,-5.8845641294033734e-9,0.003809982306819115,-1.0806887438420577e-5,-5.699365884995947e-9,0.003810341878982876,-1.0890883083801036e-5,-5.541482188826337e-9,0.003810760558410313,-1.0931470433055232e-5,-5.466698369518253e-9,0.003811219360612792,-1.0905036479831683e-5,-5.5198308461602985e-9,0.003811692191355198,-1.0796853778255012e-5,-5.728734249431048e-9,0.0038121488378866334,-1.0604042188757008e-5,-6.098714331775193e-9,0.0038125593293713445,-1.0337543772812268e-5,-6.608803289335694e-9,0.003812899313522184,-1.0022178567600895e-5,-7.211652084835195e-9,0.003813155569947561,-9.694053505107579e-6,-7.838435889364233e-9,0.003813330410478557,-9.395101236701062e-6,-8.409236512806301e-9,0.0038134436413059824,-9.165292526420089e-6,-8.847896464769259e-9,0.0038135310890633975,-9.033789295919845e-6,-9.098924795496566e-9,0.0038136392405932478,-9.010703935907942e-6,-9.143237881021444e-9,0.0038138161247166904,-9.081404582108e-6,-9.008993457535895e-9,0.003814099382214336,-9.205645720023213e-6,-8.773169562587337e-9,0.0038145038512597245,-9.323767143029389e-6,-8.549656250554983e-9,0.003815012795942145,-9.370894020933878e-6,-8.462137200027408e-9,0.0038155779477628124,-9.29673571143693E-06,-8.606350895718982e-9,0.0038161315938342274,-9.08397255339519e-6,-9.015063906599803e-9,0.0038166080185463146,-8.755923206484596e-6,-9.64348405426532e-9,0.003816965037754244,-8.368207760136484e-6,-1.0385219024877421e-8,0.003817195248806939,-7.988222530295059e-6,-1.1111520776134655e-8,0.0038173229340541176,-7.673167559394442e-6,-1.1713278449963451e-8,0.0038173910001939285,-7.456361956860252e-6,-1.212711923818663e-8,0.0038174460930694254,-7.344703089557365e-6,-1.234016488954878e-8,0.0038175278039535875,-7.323953104584782e-6,-1.2379836417372083e-8,0.00381766349450458,-7.3667834734719346E-06,-1.2298441630227018e-8,0.003817867345920316,-7.44006181186134e-6,-1.2159268639340678e-8,0.003818141527292887,-7.510114938000029e-6,-1.2026573341010378e-8,0.003818477933177015,-7.546220680736763e-6,-1.1958946292781465e-8,0.003818859819405176,-7.523169308927341e-6,-1.2004439996582582e-8,0.0038192634063506886,-7.4236603910782554e-6,-1.2196000644852678e-8,0.0038196599709800997,-7.2408663983656445e-6,-1.254657877456703e-8,0.003820019070571289,-6.980898470168708e-6,-1.3044426574530458e-8,0.0038203132898458427,-6.664287919255013e-6,-1.3650268900585339e-8,0.0038205242460868597,-6.325154432293589e-6,-1.4298887743684189e-8,0.0038206486164603457,-6.006817141678243e-6,-1.4907506500728048e-8,0.0038207020750147184,-5.75354803338733e-6,-1.5391558345619086e-8,0.0038207189146382747,-5.599839594091006e-6,-1.568521212544733e-8,0.0038207461938191602,-5.560151445206347e-6,-1.5760970711142652e-8,0.00382083315281559,-5.622636517693993e-6,-1.5641635859755003e-8,0.003821018492077559,-5.749455228146534e-6,-1.5399662200224305e-8,0.0038213190875863523,-5.884391306755396e-6,-1.5142562499287096e-8,0.0038217235693960125,-5.966361142703782e-6,-1.4987076158289204e-8,0.0038221931563597426,-5.9456270845393625e-6,-1.502819170366169e-8,0.0038226704818977797,-5.798272337779563e-6,-1.531149257821805e-8,0.0038230947974088572,-5.5340664292121286e-6,-1.581812655956149e-8,0.0038234191450172406,-5.194116998158923e-6,-1.6469310260958883e-8,0.003823623312951976,-4.838285790666961e-6,-1.7150435861376128e-8,0.0038237175482825378,-4.526986941152714e-6,-1.7745939341755873e-8,0.0038237362016777052,-4.3046651521168036e-6,-1.8170927741837015e-8,0.003823725137708133,-4.1908453164058315e-6,-1.8388262055022257e-8,0.003823728754133948,-4.180212251173304e-6,-1.8408322336149633e-8,0.0038237809830387044,-4.2490079943162265e-6,-1.8276693046141356e-8,0.0038239015028385787,-4.363551982793333e-6,-1.8057833412152605e-8,0.003824095946593768,-4.487740674388706e-6,-1.7820751134813358e-8,0.003824358126063857,-4.588281903972761e-6,-1.7629039709488436e-8,0.0038246727136478013,-4.637862217435199e-6,-1.753487003336477e-8,0.003825017627068585,-4.61711276381841e-6,-1.7575256806811815e-8,0.003825366118825118,-4.516259894351772e-6,-1.7768895996776932e-8,0.0038256891088083935,-4.336919177129825e-6,-1.8112701958105336e-8,0.0038259584950023394,-4.093846046758095e-6,-1.8578421203903003e-8,0.00382615197722384,-3.815735474025295e-6,-1.9111084395452904e-8,0.0038262592364493595,-3.543489200549398e-6,-1.963234108463913e-8,0.0038262880282502877,-3.3242349858685718e-6,-2.005195595532296e-8,0.0038262672917729517,-3.200584377536259e-6,-2.0288421016364784e-8,0.0038262439982333636,-3.197318624244381e-6,-2.029444817156697e-8,0.003826272400189211,-3.3105522427901474e-6,-2.0077656752741834e-8,0.0038263982363601133,-3.505059768382942e-6,-1.9705603558615896e-8,0.003826643866615569,-3.7224637285441357e-6,-1.929005491723827e-8,0.003827000550067141,-3.897808129259171e-6,-1.8955276671465806e-8,0.0038274307773840765,-3.9781801362031975e-6,-1.8802446818552187e-8,0.0038278791501668245,-3.936838386802747e-6,-1.8882656721060616e-8,0.003828287511464482,-3.7789936758587133e-6,-1.91858484343628e-8,0.003828609599833306,-3.538639788532877e-6,-1.9646859993872794e-8,0.0038288214789188135,-3.2682591437941436e-6,-2.01651251887211e-8,0.0038289254924217973,-3.0247269062595245e-6,-2.0631684713590868e-8,0.0038289472814131997,-2.855414110560565e-6,-2.0955834728401942e-8,0.0038289273259179074,-2.788188187669053e-6,-2.108429624581785e-8,0.0038289100096469695,-2.827593307999e-6,-2.100851341943847e-8,0.0038289336504991763,-2.957270847791984e-6,-2.0759969177050435e-8,0.0038290239989857604,-3.1466075062872564e-6,-2.0397397678011425e-8,0.0038291919363631554,-3.358735621529485e-6,-1.9991428033826533e-8,0.0038294345412146105,-3.5575484015966483e-6,-1.9611153660184545e-8,0.0038297379974115684,-3.7126062375014595e-6,-1.931477643950267e-8,0.0038300809546290265,-3.8019422327944494e-6,-1.9144289526878937e-8,0.003830437556664625,-3.813471476213471e-6,-1.9122815383613343e-8,0.0038307800423785735,-3.7458453013279217e-6,-1.925296167705247e-8,0.0038310813355700818,-3.6092600087004904e-6,-1.951522260747604e-8,0.003831318289772106,-3.4261620143933223e-6,-1.9866570427390518e-8,0.0038314761727888578,-3.2310651372663914e-6,-2.024078705408704e-8,0.003831554328173983,-3.067891478985199e-6,-2.0553606536838275e-8,0.00383157155253598,-2.9829338185445362e-6,-2.071629056719002e-8,0.0038315679388297268,-3.0127134004410304e-6,-2.0658964500687748e-8,0.0038315991481782685,-3.1692879484097765e-6,-2.0358751628086406e-8,0.0038317214021556132,-3.429727904878386e-6,-1.9859827008455862e-8,0.0038319713636641617,-3.7377031114383478e-6,-1.9270251199510938e-8,0.003832350581616624,-4.0199454376947184e-6,-1.8730381252591345e-8,0.003832823444733821,-4.211063811726861e-6,-1.8365375552540856e-8,0.0038333298168283644,-4.2746105018214276e-6,-1.82449115700899e-8,0.0038338051698647065,-4.211439514210527e-6,-1.8367216874901712e-8,0.003834198761806769,-4.0546278942909735e-6,-1.8668806860764246e-8,0.003834484151940069,-3.856273197654131e-6,-1.9049773936193798e-8,0.0038346613147808603,-3.6724518049993973e-6,-1.940260611015573e-8,0.0038347524550533677,-3.550605899014387e-6,-1.9636361789940677e-8,0.0038347942577808274,-3.52127028068912e-6,-1.969253972068335e-8,0.0038348288874075678,-3.5944825007219915e-6,-1.9551978029488838e-8,0.0038348954913967792,-3.7604912766397788e-6,-1.9233502467926943e-8,0.0038350235792819626,-3.9939514459539405e-6,-1.8785861778853742e-8,0.0038352291926199416,-4.260277158951203e-6,-1.8275496622939114e-8,0.003835514073341714,-4.522523088560736e-6,-1.7773291753942183e-8,0.0038358673369616493,-4.7473979554075516E-06,-1.7343025332758908e-8,0.0038362687210526454,-4.9095732722181525e-6,-1.7033139263666595e-8,0.00383669236799276,-4.99408908331157e-6,-1.6872194841765404e-8,0.003837110381916312,-4.997253315309627e-6,-1.6867206012024054e-8,0.0038374959397268127,-4.926686817006647e-6,-1.7003556999435392e-8,0.003837826168240292,-4.800973729438346e-6,-1.724561889505605e-8,0.0038380852198412027,-4.64897087800454e-6,-1.7538006826362915e-8,0.0038382680055769084,-4.508244405378731e-6,-1.780856000998818e-8,0.0038383845372422826,-4.4213473667315845e-6,-1.7975542156029803e-8,0.0038384635487548452,-4.428331072852901e-6,-1.7962111992879813e-8,0.003838552412999034,-4.554891468079644e-6,-1.7719129920892407e-8,0.003838709449637709,-4.79857611780019e-6,-1.7251579776228027e-8,0.003838986727658379,-5.120008018211622e-6,-1.6635275122453434e-8,0.0038394080255532118,-5.448208410521412e-6,-1.6006525398447498e-8,0.0038399539523913803,-5.703228860578149e-6,-1.5518689679738132e-8,0.003840565607656355,-5.826728491288216e-6,-1.5283563189269852e-8,0.0038411666084649057,-5.803303992373885e-6,-1.5330502316579828e-8,0.003841690669226006,-5.6615015185918996e-6,-1.5604511736937722e-8,0.0038421002535852433,-5.457713918832178e-6,-1.5997183329700725e-8,0.0038423907809453407,-5.254822630049416e-6,-1.6387728287251544e-8,0.003842584084612968,-5.1054363205735894e-6,-1.6675159725889587e-8,0.0038427176193724898,-5.043044755021766e-6,-1.6795248365588627e-8,0.003842834018332966,-5.07989312250766e-6,-1.6724578044920652e-8,0.003842972942410085,-5.209054269116863e-6,-1.6476567824802356e-8,0.0038431654789848045,-5.4086399567047076e-6,-1.60933997922233e-8,0.00384343077449617,-5.647036470412883e-6,-1.563595510392797e-8,0.00384377466746861,-5.888566057774086e-6,-1.5172890552403953e-8,0.003844190175581018,-6.098988812967744e-6,-1.477000694122479e-8,0.0038446595948861905,-6.250255466342545e-6,-1.4481091439427506e-8,0.003845157818995818,-6.324023724179862e-6,-1.4341201409106802e-8,0.0038456562996112983,-6.313615647304992e-6,-1.4362989566193652e-8,0.003846127011783707,-6.224437602563978e-6,-1.4535971378501742e-8,0.003846546039512686,-6.073206328661482e-6,-1.4828020425045514e-8,0.0038468967151338742,-5.886318244836747e-6,-1.518844046641186e-8,0.0038471724104394123,-5.6974965543184785e-6,-1.5552409101517088e-8,0.0038473791476006172,-5.544524492413738e-6,-1.5847232591313744e-8,0.0038475379016441485,-5.464345014145458e-6,-1.6001824499551356e-8,0.0038476855030219305,-5.485613097100651e-6,-1.596112434254084e-8,0.003847871879727775,-5.6186931393504005e-6,-1.5705383768277254e-8,0.0038481508803807564,-5.845389848453475e-6,-1.526986177286528e-8,0.003848563503714657,-6.114171536753636e-6,-1.4753886498476955e-8,0.0038491178160156275,-6.348715588209728e-6,-1.4304328128888127e-8,0.0038497770085141143,-6.472740813382431e-6,-1.4067840281603289e-8,0.0038504673064347367,-6.441502007513236e-6,-1.4130328256331074e-8,0.0038511053849232322,-6.261082594443713e-6,-1.4479857491646347e-8,0.003851629844832358,-5.983091492067725e-6,-1.5016874116127136e-8,0.003852018859395578,-5.680152288202065e-6,-1.5601434430578248e-8,0.0038522882875718684,-5.418923444947771e-6,-1.6105201466218447e-8,0.0038524776393092323,-5.243503092060938e-6,-1.644339124890214e-8,0.0038526343526436983,-5.171293042120779e-6,-1.658266798991624e-8,0.0038528022610099396,-5.196803821713961e-6,-1.6533754071038998e-8,0.003853015203081441,-5.2983925912731155e-6,-1.6338444310091512e-8,0.003853294442269686,-5.444945618229092e-6,-1.6056762373860484e-8,0.0038536482567425854,-5.601504835855946e-6,-1.5756133822008962e-8,0.0038540726814287585,-5.7339517789242305e-6,-1.550233250246981e-8,0.0038545530770026947,-5.813032433141409e-6,-1.535167747524828e-8,0.003855066511348219,-5.817774971569551e-6,-1.5344433001374196e-8,0.0038555849763886965,-5.738119863076067e-6,-1.5499788248752717e-8,0.0038560793166990247,-5.576384824864866e-6,-1.5813120373490353e-8,0.0038565234608473496,-5.347216994734051e-6,-1.6256150387493468e-8,0.0038568984147355433,-5.075979025649893e-6,-1.678004601450871e-8,0.00385719557764678,-4.795731754718215e-6,-1.7321162029551486e-8,0.0038574190570229696,-4.543041028615571e-6,-1.780903983008837e-8,0.003857586762326891,-4.352859428110214e-6,-1.817625138390654e-8,0.003857730049101876,-4.252572787910336e-6,-1.8369938134093778e-8,0.0038578912513364937,-4.255213948707043e-6,-1.8364992404288677e-8,0.003858117874957074,-4.3525404651654585e-6,-1.8177456727680517e-8,0.003858452354547486,-4.510210597999658e-6,-1.7873784612501723e-8,0.003858917791777117,-4.669051428707108e-6,-1.756829129472984e-8,0.003859503672194377,-4.756979406824098e-6,-1.7400082133742694e-8,0.003860160107605068,-4.712384004790362e-6,-1.7487936966225806e-8,0.0038608091664962376,-4.510570068775836e-6,-1.7879323414882926e-8,0.003861372398538454,-4.177424357879907e-6,-1.8524047943606895e-8,0.003861800506333025,-3.7795425476321384e-6,-1.9293349565570984e-8,0.0038620880164654562,-3.396288792625095e-6,-2.0033913711143205e-8,0.003862267166860147,-3.0911799396654256e-6,-2.062317555474824e-8,0.0038623893494130436,-2.8966628210158406e-6,-2.099867596807234e-8,0.003862506563495998,-2.8140990119499413e-6,-2.115798768293966e-8,0.0038626598321244918,-2.822389550608056e-6,-2.114198102596278e-8,0.003862874873005275,-2.8882527356427605e-6,-2.1014973901108832e-8,0.003863162336153394,-2.9744902195046028e-6,-2.0848814677809523e-8,0.0038635199304515298,-3.045533830271848e-6,-2.0712205478631623e-8,0.0038639348992436243,-3.0710234770790767e-6,-2.066378398501029e-8,0.0038643864355204357,-3.028367117469868e-6,-2.0747147455070232e-8,0.00386484822728367,-2.904831494192115e-6,-2.0986801911394604e-8,0.0038652914752601592,-2.699236644680084e-6,-2.1384920240420773e-8,0.003865688624510196,-2.4228755743300013e-6,-2.191962018272638e-8,0.00386601767419727,-2.0990064949875313e-6,-2.2545976090700474e-8,0.003866266452299767,-1.760409030734062e-6,-2.3200715561079226e-8,0.0038664359843247702,-1.4449098341719433e-6,-2.3810796904036255e-8,0.0038665420780329414,-1.1892409375748905e-6,-2.4305217895457498e-8,0.003866614450261009,-1.0220808697119544e-6,-2.4628464023641513e-8,0.0038666931331427633,-9.574329517630934e-7,-2.4753373068809092e-8,0.00386682224894407,-9.894664267422647e-7,-2.469119648990868e-8,0.0038670414158975728,-1.0900193002419434e-6,-2.449647640784153e-8,0.0038673755149895308,-1.2103925169421118e-6,-2.4263553007702945e-8,0.0038678247276590877,-1.2892296045959293e-6,-2.4111252377403624e-8,0.003868358444959499,-1.267252656795297e-6,-2.4154311249935473e-8,0.0038689178723244452,-1.106609395965305e-6,-2.446591385034712e-8,0.0038694306364283385,-8.077989637281885e-7,-2.504494355576824e-8,0.0038698345342124824,-4.141703486132289e-7,-2.5807311711834674e-8,0.003870099809101716,1.7314109784301966e-9,-2.661245619101961e-8,0.0038702378083155316,3.6458720020279093e-7,-2.7314567339474627e-8,0.0038702920854368386,6.214663267685033e-7,-2.7811317375819918e-8,0.0038703190910244194,7.53858335647063e-7,-2.8067074676155508e-8,0.00387036974897286,7.748010931081934e-7,-2.8107228302703305e-8,0.0038704788581488724,7.175311052953002e-7,-2.7996153658333026e-8,0.0038706626331334653,6.232083040671878e-7,-2.781347285744613e-8,0.0038709211656908133,5.318687125353667e-7,-2.7636609917695287e-8,0.003871242513436442,4.772284502188831e-7,-2.753078648423058e-8,0.003871606525933271,4.841804967947889e-7,-2.754418615260003e-8,0.0038719879135084533,5.675785755217659e-7,-2.7705577960566147e-8,0.003872358880346966,7.314004543716178e-7,-2.8022675148351287e-8,0.0038726919022138077,9.680249185641712e-7,-2.8480732932027746e-8,0.003872963138652044,1.2579586782204766e-6,-2.9042030043767234e-8,0.00387315657601737,1.5708285211382788e-6,-2.9647789466682646e-8,0.0038732683373289547,1.86855923238929e-6,-3.0224309921934445e-8,0.0038733099271485473,2.1112153111972303e-6,-3.069424612561177e-8,0.003873308852725411,2.2650543922665764e-6,-3.0992188082449424e-8,0.0038733053736022243,2.3111642765606837e-6,-3.108140596859698e-8,0.003873345192169577,2.2521788410355123e-6,-3.0966904370240415e-8,0.0038734693367986866,2.1146262125177263e-6,-3.0700024716839653e-8,0.003873703593536369,1.9454980220390796e-6,-3.037183659191588e-8,0.0038740502205765353,1.8030645268901052e-6,-3.009534652539585e-8,0.003874484463380578,1.7433559304306285e-6,-2.997927136727451e-8,0.003874957745425761,1.805067475563303e-6,-3.009872427079351e-8,0.0038754081819814224,1.9969121911983876e-6,-3.0470633717663e-8,0.0038757768904046563,2.2921729176794824e-6,-3.104314330933098e-8,0.0038760255596562514,2.6342273406501153e-6,-3.1706344087442033e-8,0.003876148467003275,2.953007064522305e-6,-3.232426651598912e-8,0.003876173208269964,3.1867247516892045e-6,-3.2777089184574225e-8,0.0038761496228379723,3.299682974732298e-6,-3.2995681880150156e-8,0.0038761325461103228,3.2890272755367357e-6,-3.297463097922817e-8,0.003876166403606068,3.179714693762658e-6,-3.276239593634084e-8,0.003876276896591104,3.0126859225590633e-6,-3.243833774524097e-8,0.0038764701624275557,2.8325579269208208e-6,-3.208888404389721e-8,0.0038767365992111737,2.6787515873070964e-6,-3.1790385133102694e-8,0.003877056148306675,2.580816495240054e-6,-3.160009687833867e-8,0.003877403029010765,2.556826343211539e-6,-3.1553084495681475e-8,0.0038777493008821016,2.613289973686861e-6,-3.166203618942354e-8,0.0038780675614554605,2.745446505360736e-6,-3.191780672517262e-8,0.003878333476381656,2.937524412643369e-6,-3.2289889347489e-8,0.0038785287779384415,3.1632353044676755e-6,-3.2727348319001116e-8,0.0038786449743421613,3.38733667833281e-6,-3.3161835770498974e-8,0.0038786873128192818,3.569409484611795e-6,-3.351491898098499e-8,0.003878677591593657,3.6707118908738144e-6,-3.371139093728882e-8,0.003878653651155005,3.663736005572876e-6,-3.369782934114989e-8,0.003878663611183559,3.5420997935283253e-6,-3.346179770353897e-8,0.003878754731082063,3.3267106762652564e-6,-3.304380167421774e-8,0.003878959662882301,3.0642480397399228e-6,-3.2534349810315585e-8,0.0038792851193151815,2.8166766000497898e-6,-3.2053637071171815e-8,0.003879707781335941,2.644580007151263e-6,-3.171924924585675e-8,0.003880179414535661,2.590044261113597e-6,-3.161296170025512e-8,0.003880639462395093,2.664856929841553e-6,-3.175779169109812e-8,0.003881030963909623,2.847441295081661e-6,-3.211196330829822e-8,0.003881315132026455,3.088989773401876e-6,-3.258074793403881e-8,0.003881480673019954,3.3267950065992406e-6,-3.304234350010906e-8,0.0038815453906210946,3.500934082932849e-6,-3.33803219040278e-8,0.0038815497710628015,3.5694288741531944e-6,-3.3513127109619604e-8,0.003881544796778198,3.5173837589184617e-6,-3.341184114435914e-8,0.003881578212321525,3.3577257039687044e-6,-3.310159999772678e-8,0.0038816837406748395,3.1243817248589497e-6,-3.264830861127478e-8,0.0038818760151617553,2.8614164265762064e-6,-3.213752525507882e-8,0.0038821512694009203,2.612341272483004e-6,-3.165370238768937e-8,0.0038824917692874394,2.4124461107722537e-6,-3.1265314802538124e-8,0.003882871480346175,2.2849072067360234e-6,-3.1017329356398934e-8,0.0038832611824149987,2.2398928027330586e-6,-3.0929494207351274e-8,0.0038836323245214632,2.275318774487282e-6,-3.099781618751069e-8,0.0038839597921307414,2.378108423025778e-6,-3.119699030134757e-8,0.0038842242152507703,2.5254286212354412e-6,-3.148275781095068e-8,0.0038844144663355965,2.686059250390416e-6,-3.179451894543604e-8,0.0038845306688387576,2.822639547206788e-6,-3.2059675183163195e-8,0.003884587357003466,2.8959475224504465e-6,-3.220196455639171e-8,0.0038846153737523,2.8722310269464106e-6,-3.21557550736718e-8,0.003884660056959134,2.7333387608771316e-6,-3.18857668919105e-8,0.0038847732762158013,2.4869046599035173e-6,-3.1406851357082614e-8,0.0038849991252745794,2.1712642698410145e-6,-3.0793495921892944e-8,0.0038853574442500984,1.8496451423368823e-6,-3.016850650976043e-8,0.0038858330515733975,1.5925789224385644e-6,-2.9668865383990577e-8,0.003886377556622482,1.4547566015723252e-6,-2.940082528056271e-8,0.0038869241473787107,1.4569552475180457e-6,-2.9404819127186324e-8,0.0038874085176017156,1.5809669809562609e-6,-2.9645564220367717e-8,0.003887786800305342,1.7780034980890623e-6,-3.002832302171855e-8,0.0038880447159318995,1.9850173646662214e-6,-3.0430573951043864e-8,0.0038881971924163384,2.1420596256770285e-6,-3.073574438290413e-8,0.003888280961175994,2.205781072292864e-6,-3.085948449380518e-8,0.0038883435694981065,2.1568374784550173e-6,-3.076410840731744e-8,0.0038884319296096136,2.0009593416802778e-6,-3.0460718017368735e-8,0.00388858281744708,1.7646673454508626e-6,-3.000089846925649e-8,0.003888816937092785,1.487387634284406e-6,-2.9461380448588014e-8,0.003889137213009564,1.2122368285186793e-6,-2.8926083312790018e-8,0.0038895308769200843,9.77741933194379e-7,-2.8469964105098837e-8,0.0038899740437511265,8.120453633245923e-7,-2.81477220260484e-8,0.003890437171818333,7.300902557734322e-7,-2.7988343358411724e-8,0.0038908900772970704,7.333723847624609e-7,-2.7994672649499975e-8,0.0038913058202770783,8.11313345377628e-7,-2.8146131740211625e-8,0.003891663485624368,9.432958331578632e-7,-2.8402680159512044e-8,0.0038919502946732623,1.1008399990349611e-6,-2.8708996787877187e-8,0.0038921635340459903,1.2499486900889057e-6,-2.8998973546822423e-8,0.0038923125934744473,1.3541502616078596e-6,-2.9201603267134142e-8,0.0038924208408559866,1.379197734291158e-6,-2.9250157793629576e-8,0.0038925260361622285,1.3003034856014153e-6,-2.909634192665132e-8,0.0038926769630940033,1.1115916402400212e-6,-2.8728743103664676e-8,0.0038929238963934187,8.34996763450161e-7,-2.819013439953649e-8,0.003893302729372596,5.229491681716229e-7,-2.7582633768285374e-8,0.0038938176635446077,2.486270920040773e-7,-2.704868519022275e-8,0.0038944323474479204,8.290889866841129e-8,-2.6726217478885122e-8,0.0038950779585628413,6.71542862886964e-8,-2.6695708784190685e-8,0.0038956768103849595,1.9679611586948285e-7,-2.694825472718397e-8,0.003896169311776245,4.2495370109331924e-7,-2.73925766726845e-8,0.003896530677936019,6.822594553111313e-7,-2.7893606935094835e-8,0.0038967721729981984,9.007324311420936e-7,-2.8318972956552194e-8,0.003896930972109137,1.0312737312306008e-6,-2.8573056292209646e-8,0.0038970560356940956,1.0512333616440805e-6,-2.8611714898809007e-8,0.0038971954492596143,9.637576168076825e-7,-2.84410251401411e-8,0.0038973875128366286,7.922909732076531e-7,-2.8106623400673385e-8,0.003897655773663217,5.73039745366953e-7,-2.7679078820458593e-8,0.0038980074203048315,3.470975623162463e-7,-2.723855936562174e-8,0.003898434383602654,1.532557749678879e-7,-2.686076811069166e-8,0.003898916483642837,2.2273778031217942e-8,-2.6605698033749048e-8,0.003899425869944706,-2.6879705272445377e-8,-2.651026260606674e-8,0.003899931946443452,1.135752503116599e-8,-2.658517606455315e-8,0.003900405988380751,1.2952483923987927e-7,-2.6815784333920333e-8,0.0039008248607193337,3.0902597073996624e-7,-2.7165815642283763e-8,0.0039011736945926885,5.228355224148576e-7,-2.7582659172522265e-8,0.003901447733469793,7.385703341824681e-7,-2.800327930437387e-8,0.0039016535931530446,9.218576909926763e-7,-2.8360689234556944e-8,0.003901810063641041,1.0402342282423203e-6,-2.8591513682344532e-8,0.0039019482346590566,1.068114437545263e-6,-2.8645727584383664e-8,0.0039021099156309434,9.933162871447647e-7,-2.8499486010026745e-8,0.0039023425147539973,8.245733393134014e-7,-2.816985246159411e-8,0.0039026886667243655,5.973876226969504e-7,-2.7726207946250197e-8,0.0039031709184319144,3.732053312467776e-7,-2.728856993304565e-8,0.003903776436955178,2.2643689124575264e-7,-2.7002203145251322e-8,0.0039044517336320776,2.1908852626009318e-7,-2.6988107235954432e-8,0.0039051160269753435,3.7343990320735743e-7,-2.728970832405026e-8,0.0039056904602020087,6.597257455398579e-7,-2.7848816986833218e-8,0.0039061274952976715,1.008182754458275e-6,-2.8529159419230002e-8,0.003906424029832539,1.337864454440272e-6,-2.917267690733211e-8,0.0039066143239121455,1.584673185538172e-6,-2.9654276855512307e-8,0.003906751629333246,1.7160417124478927e-6,-2.991045051383723e-8,0.003906889981347287,1.7312807173328777e-6,-2.993987957694521e-8,0.003907072257425082,1.6535639424178371e-6,-2.978777180552823e-8,0.003907324953080964,1.5196860399174986e-6,-2.9525923596991393e-8,0.003907657617907691,1.3710174126904936e-6,-2.9235136326534077e-8,0.003908064791635279,1.246627938272527e-6,-2.8991808582392042e-8,0.003908529121213566,1.178355331974727e-6,-2.8858246582644022e-8,0.0039090251008069895,1.1874723538953122e-6,-2.8876064406570793e-8,0.0039095231741027164,1.2828026766380307e-6,-2.9062457134925734e-8,0.003909993971965604,1.4602429723720258e-6,-2.940930205385144e-8,0.003910412376088683,1.7037257014122688e-6,-2.9885126077279e-8,0.003910760972899444,1.9875614267849495e-6,-3.043974711070414e-8,0.003911032543742426,2.279815827653438e-6,-3.1010855542352346e-8,0.003911231493909528,2.5463069029857515e-6,-3.153173238001942e-8,0.003911374222650876,2.7549910335127733e-6,-3.193972170951845e-8,0.003911488384327841,2.880624085469085e-6,-3.218531726661661e-8,0.003911610864352182,2.909667982481857e-6,-3.224183476086153e-8,0.003911783886839922,2.84536194505679e-6,-3.211546429333361e-8,0.003912048236733935,2.7121190655270843e-6,-3.1853969077637996e-8,0.003912432956737331,2.5569177610852085e-6,-3.1549408250500364e-8,0.003912942711842446,2.4439948046497946e-6,-3.13276712957956e-8,0.003913547494005578,2.439525781374463e-6,-3.1318405148871284e-8,0.003914182801008766,2.587612510786791e-6,-3.160796365905382e-8,0.00391476670682019,2.8876813198392386e-6,-3.219515496038958e-8,0.003915229878465214,3.288612511808708e-6,-3.297977441605243e-8,0.00391554262842195,3.707168304776008e-6,-3.3798756641249064e-8,0.003915722816780819,4.061134667377567e-6,-3.449114586943816e-8,0.0039158221519932715,4.297554871760769e-6,-3.495337435976911e-8,0.003915902612886247,4.403020028690837e-6,-3.5159304982510026e-8,0.003916016771863963,4.3972762305046315e-6,-3.51476057496457e-8,0.003916198069716032,4.319425094326008e-6,-3.499472431255641e-8,0.003916459596845121,4.214738888555488e-6,-3.4789167335719515e-8,0.003916797401300606,4.125457418511884e-6,-3.46135897824814e-8,0.003917195121291198,4.085545626385126e-6,-3.453456558879286e-8,0.003917628376812855,4.118078743411213e-6,-3.459741276197698e-8,0.00391806864547818,4.234057023541767e-6,-3.4823781820516536e-8,0.0039184868549933145,4.432100524385358e-6,-3.521100643460954e-8,0.003918856894454718,4.698942282664103e-6,-3.5733089149345645e-8,0.003919159062997544,5.010909292212568e-6,-3.634366398414867e-8,0.003919383180819294,5.336673361384431e-6,-3.698142096457321e-8,0.003919530829987342,5.641296545403175e-6,-3.757799607711368e-8,0.0039196162213828035,5.891218249778886e-6,-3.8067651883344666e-8,0.0039196653747344806,6.059652716046391e-6,-3.8397777275256785E-08,0.003919713456096689,6.131770978781817e-6,-3.853905013964011e-8,0.003919800276775679,6.108967573413839e-6,-3.849390802272054e-8,0.003919964045053333,6.011521522845613e-6,-3.830191792649171e-8,0.003920233494230299,5.878730153642338e-6,-3.804014811232711e-8,0.003920618992780859,5.764983763374026e-6,-3.781547454419313e-8,0.00392110459247313,5.730010496430183e-6,-3.7745352062984805e-8,0.0039216448866342514,5.822802882578071e-6,-3.792614771435408e-8,0.00392217165582521,6.062441369382195e-6,-3.839540769990899e-8,0.003922612784897084,6.424343781374744e-6,-3.910483982583697e-8,0.003922918279510956,6.842549813656679e-6,-3.9924854655693004e-8,0.0039230801956615,7.231684285990491e-6,-4.068779460101494e-8,0.003923134148926395,7.5187772284920845e-6,-4.125047503163074e-8,0.003923141833425455,7.667435752105012e-6,-4.1541586012182924e-8,0.003923166269325025,7.683166138878378e-6,-4.1571999586433136e-8,0.003923253198934327,7.602234341381125e-6,-4.1412808153840096e-8,0.00392342418128479,7.474463541507354e-6,-4.1161593315289665e-8,0.003923678875818511,7.348774715809465e-6,-4.091417238620076e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json
new file mode 100644
index 0000000..509a7d1
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":24000,"numberOfSamples":1000,"samples":[0.003924001349468574,7.264665173102422e-6,-4.0747989552475184e-8,0.003924366586169156,7.248790607297544e-6,-4.0715438046854016e-8,0.0039247455983737215,7.31449699975775e-6,-4.084288354023843e-8,0.003925109134008881,7.462510402409807e-6,-4.1131928535769936e-8,0.003925430619334403,7.681943579661476e-6,-4.156132990390201e-8,0.003925688916221978,7.9515663056217e-6,-4.208949033990723e-8,0.003925871139610513,8.241724001493012e-6,-4.26582543580377e-8,0.003925975343160025,8.517452558510482e-6,-4.319903585164052e-8,0.003926012408625573,8.743124708146312e-6,-4.364190844664137e-8,0.0039260062351111815,8.888393011087458e-6,-4.392721436513869e-8,0.0039259914819518545,8.934553769547599e-6,-4.401802379763859e-8,0.003926008601681654,8.87995541059872e-6,-4.391078722925618e-8,0.003926096603853184,8.742886424791559e-6,-4.364111335220435e-8,0.003926284700461693,8.560700555841224e-6,-4.328218871863738e-8,0.003926584419799495,8.38460458304358e-6,-4.293463839580567e-8,0.003926983982520055,8.27018419490559e-6,-4.270791978660203e-8,0.003927446933578442,8.26450952654458e-6,-4.269489056436631e-8,0.003927917035426422,8.392007583137403e-6,-4.294388907717355e-8,0.003928330548152765,8.643213090672838e-6,-4.343648270886796e-8,0.003928634404239271,8.97202431142347e-6,-4.4082022548759444e-8,0.003928804571353034,9.306016764539644e-6,-4.473798796749362e-8,0.003928855847415065,9.568840746130847e-6,-4.525415343428905e-8,0.0039288366735898165,9.705875342600683e-6,-4.552310678124801e-8,0.003928810708523999,9.70075387287824e-6,-4.5512697637589113e-8,0.003928834802404048,9.575566014901797e-6,-4.526632710582171e-8,0.003928943827175889,9.377534807333275e-6,-4.487669985208786e-8,0.003929146690245219,9.161289638700064e-6,-4.445102369531869e-8,0.003929431010766044,8.97479258527682e-6,-4.408344678591044e-8,0.003929771249439363,8.851942834798086e-6,-4.3840594450064106e-8,0.003930136299987928,8.810775413828423e-6,-4.375803213461219e-8,0.0039304949376361325,8.854733935909684e-6,-4.3842713182813283e-8,0.003930819251349883,8.97490756364095e-6,-4.4077307493303816e-8,0.003931086911330102,9.152169769274805e-6,-4.442436000944777e-8,0.0039312831240633185,9.359120650070548e-6,-4.4830096409770687e-8,0.003931402736278697,9.562353565431697e-6,-4.522888479978551e-8,0.0039314523679986994,9.725809891954073e-6,-4.554983213541918e-8,0.003931451821677968,9.81581544058732e-6,-4.572667330703574e-8,0.0039314335373014,9.807739373223678e-6,-4.5710846370490446e-8,0.003931438847422937,9.693139686684408e-6,-4.5485541526462294e-8,0.003931510540598468,9.485126741041124e-6,-4.507628154878644e-8,0.0039316827752822045,9.21922505098598e-6,-4.455269004539336e-8,0.003931971055312627,8.947933809120098e-6,-4.401789076476449e-8,0.0039323657307728825,8.729358784614993e-6,-4.358622919525109e-8,0.003932831731699162,8.612643855888081e-6,-4.335462841531593e-8,0.003933315344617792,8.62429738570606e-6,-4.337560654570439e-8,0.003933756715300976,8.759463349484685e-6,-4.363994931455601e-8,0.003934105106059232,8.981053856326873e-6,-4.407485811762412e-8,0.003934332913929343,9.227877438043526e-6,-4.4559891225405716e-8,0.0039344440871193175,9.430525068002884e-6,-4.4958286576969273e-8,0.003934473402796723,9.530858688927084e-6,-4.5155432327327116e-8,0.003934475863914978,9.498545685117723e-6,-4.509149078422063e-8,0.003934509718222492,9.33827824991407e-6,-4.47756142603218e-8,0.003934619792227327,9.085158588882537e-6,-4.427682786107174e-8,0.003934827415641757,8.791280140237335e-6,-4.369760258181166e-8,0.00393512933343696,8.510038014808986e-6,-4.31429928445453e-8,0.0039355035636141015,8.284081649552148e-6,-4.269695029529051e-8,0.003935918018543304,8.139406686077033e-6,-4.241070000822375e-8,0.003936338353846052,8.084775818140693e-6,-4.2301584302013366e-8,0.003936733445406277,8.114176353890525e-6,-4.235787766689351e-8,0.0039370785461212525,8.210197709692123e-6,-4.254541828860122e-8,0.003937356971767464,8.347130480599071e-6,-4.281369430236631e-8,0.003937561263758311,8.493567783692922e-6,-4.310094762045791e-8,0.003937694438031615,8.615002843389891e-6,-4.333926631812809e-8,0.003937771330134241,8.67725650150846e-6,-4.346131796842194e-8,0.003937819322870859,8.651508326884634e-6,-4.3410256470381495e-8,0.003937877058427044,8.521099894445721e-6,-4.3153137231452934e-8,0.003937989463885939,8.288931327634417e-6,-4.269550841092151e-8,0.003938198228981029,7.982475866423666e-6,-4.209131265757179e-8,0.003938529202136906,7.652421272823026e-6,-4.144024574779018e-8,0.003938981172624146,7.362348631112524e-6,-4.086748201679056e-8,0.003939521858698951,7.171057158621901e-6,-4.048891544782165e-8,0.003940094615197016,7.113880374154503e-6,-4.0374365707466556e-8,0.0039406342007793785,7.190918645244552e-6,-4.052432522098116e-8,0.003941085456845227,7.366953288287352e-6,-4.086966435709471e-8,0.003941417979926735,7.582297213206803e-6,-4.1292902967637985e-8,0.003941632550878733,7.769811582108233e-6,-4.1661704613367465e-8,0.0039417586573959,7.872367731094012e-6,-4.186332403044912e-8,0.00394184498935138,7.856147459827803e-6,-4.183089280710224e-8,0.003941946090056001,7.716963831159671e-6,-4.155595404739903e-8,0.003942108844751583,7.478721284531861e-6,-4.1085488184775086e-8,0.003942362280649743,7.1851264448118275e-6,-4.0505610055412035e-8,0.003942713056297738,6.887545188092401e-6,-3.9917635489093076e-8,0.003943147094181412,6.63285056822077e-6,-3.9414089140640513e-8,0.00394363576055283,6.45458746493619e-6,-3.906122521138246e-8,0.003944143851940386,6.3689698481875325e-6,-3.889108334065558e-8,0.003944636869159611,6.375238897636767e-6,-3.89021835862169e-8,0.003945086178514301,6.458758785510235e-6,-3.906566285644976e-8,0.003945471885644119,6.595087712929455e-6,-3.9333345409787816e-8,0.003945784062145488,6.75381682031183e-6,-3.96453240801719e-8,0.0039460231949269235,6.9018086924852714e-6,-3.993631138475404e-8,0.003946200484182494,7.0061699834473986e-6,-4.0141443325436696e-8,0.003946338123548155,7.037663514739489e-6,-4.020297398706976e-8,0.003946469030517169,6.975321308310946e-6,-4.007939202239149e-8,0.0039466347171631935,6.8125615268396335e-6,-3.9757548945000605e-8,0.003946879526314831,6.563781000662389e-6,-3.926572917290399e-8,0.003947240113576192,6.26832771088985e-6,-3.8681519815076635e-8,0.00394773162032693,5.987155767768718e-6,-3.8125213666258697e-8,0.00394833606959585,5.788678511154436e-6,-3.7731893344309e-8,0.0039490010315956,5.726070108611301e-6,-3.760663760887806e-8,0.003949653254363835,5.815841448021564e-6,-3.778221021701663e-8,0.003950222933085804,6.029784395114221e-6,-3.8203094717768544e-8,0.003950666763769117,6.305251283013329e-6,-3.874572335149639e-8,0.003950978997636163,6.567633107643007e-6,-3.926282625402561e-8,0.003951187946508848,6.753390037519353e-6,-3.9628897768472654e-8,0.003951342970045106,6.82499234587586e-6,-3.9769697357740485e-8,0.00395149899125544,6.775528812781524e-6,-3.9671369919487616e-8,0.003951703461040263,6.625121099539185e-6,-3.9373432374454456e-8,0.003951987858015527,6.412572497682793e-6,-3.8952382552237284e-8,0.003952363959429004,6.185216687773946e-6,-3.8501729618800614e-8,0.003952824318389738,5.9890392604355895e-6,-3.811248119847719e-8,0.003953346084383744,5.8605580191022866e-6,-3.7857015174201214e-8,0.003953896995412957,5.821583390244034e-6,-3.777860582122305e-8,0.003954442092751837,5.877359468380301e-6,-3.7887672658214384e-8,0.003954949781935346,6.017769412892624e-6,-3.816417373000497e-8,0.003955396289717578,6.220694202785564e-6,-3.856432318594815e-8,0.003955768174884203,6.456367672750993e-6,-3.902927598979735e-8,0.003956063179994125,6.691705169501888e-6,-3.949369249275251e-8,0.003956290051901221,6.894111093467348e-6,-3.989319559509603e-8,0.003956467854520423,7.034854759428582e-6,-4.017095218887658e-8,0.0039566249669400816,7.092436622888951e-6,-4.0284290088954386e-8,0.003956797478346305,7.056481487425291e-6,-4.021245059161304e-8,0.003957025994777186,6.932388600346256e-6,-3.996590300588929e-8,0.003957349414623954,6.7458410699163445e-6,-3.959537173887109e-8,0.003957794778545756,6.544498614818847e-6,-3.9195220973930975e-8,0.003958364489074411,6.392651543668574e-6,-3.889283923884582e-8,0.003959026190955713,6.355295837039837e-6,-3.881705762450065e-8,0.003959713978117959,6.473712946892012e-6,-3.904975388942963e-8,0.003960346658841707,6.743821961530491e-6,-3.958294960032686e-8,0.003960857575990237,7.112323350996538e-6,-4.031115186969541e-8,0.0039612197932018854,7.496174919039376e-6,-4.10699402100219e-8,0.003961452306299503,7.814588012843276e-6,-4.169936348567501e-8,0.003961606574536528,8.01530911676443e-6,-4.209596468724888e-8,0.003961744529834369,8.08439052342442e-6,-4.223205431160473e-8,0.003961919898203691,8.041055608842375e-6,-4.2145503385516964e-8,0.003962167934107929,7.92540646416268e-6,-4.1915471608097986e-8,0.003962502766954194,7.785608877629877e-6,-4.1637175222764884e-8,0.003962919504652272,7.667738377555936e-6,-4.140189174962666e-8,0.00396339860412415,7.6088866362392024e-6,-4.128330394764023e-8,0.003963911081389532,7.633028280277278e-6,-4.132919427751386e-8,0.003964423927548092,7.749152914604407e-6,-4.1557593105492124e-8,0.003964905318504584,7.951432583245587e-6,-4.1957026443146924e-8,0.003965329172806784,8.221199670866641e-6,-4.249046155503989e-8,0.0039656786145144665,8.530378408627668e-6,-4.310220299700377e-8,0.003965947990889918,8.845841392371245e-6,-4.37266017606286e-8,0.003966143368775138,9.134007815143316e-6,-4.429715430491004e-8,0.003966281763390242,9.365126081644348e-6,-4.475489492347632e-8,0.003966389432433808,9.517028569907252e-6,-4.50557398961551e-8,0.0039664994413490615,9.578380169243303e-6,-4.517691762130738e-8,0.003966648478154706,9.551562333274848e-6,-4.512279719134597e-8,0.003966872442131501,9.455213790585541e-6,-4.493010285476397e-8,0.003967200009096507,9.325645135291122e-6,-4.4670856835179115e-8,0.003967643942139405,9.215087087823338e-6,-4.4448923046119814e-8,0.0039681916280942,9.183905742556441e-6,-4.438445858297688e-8,0.003968799131557344,9.284666046934797e-6,-4.4582129386551373e-8,0.003969395714603861,9.540259293398974e-6,-4.508756258136944e-8,0.0039699037202130414,9.926237027984614e-6,-4.585222439096121e-8,0.003970268552470416,1.0371684773005795e-5,-4.673521137896835e-8,0.003970482142169558,1.078412203468818e-5,-4.755282003004367e-8,0.0039705843561092195,1.10860283048514e-5,-4.815115477383973e-8,0.003970642360386332,1.1241376583518066e-5,-4.845874452293147e-8,0.003970722821708415,1.125981504453911e-5,-4.8494689966727235e-8,0.0039708723071808566,1.11829441885822e-5,-4.834134805360363e-8,0.003971110919069601,1.1065211622363857e-5,-4.810650188240576e-8,0.003971435431608885,1.0958632735931508e-5,-4.7893216781566505e-8,0.003971826265812919,1.0903990546723049e-5,-4.778250186894762e-8,0.003972254586729742,1.0927283245886881e-5,-4.782624238951511e-8,0.003972688105211575,1.1039249843146977e-5,-4.8046116883982526e-8,0.0039730955939297884,1.1236386675066273e-5,-4.843545087392066e-8,0.00397345054557075,1.1502799362280447e-5,-4.8962807876693554e-8,0.003973734208169738,1.1812792318729848e-5,-4.9577158828296015e-8,0.003973937950405579,1.2134265111817801e-5,-5.021471558067026e-8,0.003974064679006379,1.2432918992578263e-5,-5.080734411592102e-8,0.003974128944467808,1.2676973960732623e-5,-5.129190491821449e-8,0.003974155556457899,1.2841827542246017e-5,-5.1619414061577866e-8,0.0039741767870729505,1.2914097734147498e-5,-5.1763003268766806e-8,0.003974228381508199,1.2894585117898373e-5,-5.1723840310494984e-8,0.0039743446740342315,1.2799778794775203e-5,-5.1534278839920305e-8,0.003974553031218095,1.2661651645222267e-5,-5.1257656952560386e-8,0.00397486770830553,1.252526192551265e-5,-5.0983665712715536e-8,0.003975283624309093,1.244306855380536e-5,-5.081702986908633e-8,0.003975771762776541,1.2464764616558008e-5,-5.085712444532777e-8,0.003976279358595454,1.2622668128129355e-5,-5.1168686224427466e-8,0.003976738806949802,1.2915806066879637e-5,-5.174997205879499e-8,0.00397708712480231,1.3300494013523065e-5,-5.251398213335525e-8,0.003977290708495544,1.3697307875515348e-5,-5.3302462984544026e-8,0.003977362035950759,1.4017395454687275e-5,-5.393846232144907e-8,0.003977355858695399,1.4196719691249908e-5,-5.429455632185751e-8,0.003977345605575303,1.4218583669657343e-5,-5.433755885903962e-8,0.003977394646971235,1.4112859234273654e-5,-5.412679978292305e-8,0.003977538120767945,1.3937040535825622e-5,-5.377637606636613e-8,0.003977780313015663,1.3753373811437281e-5,-5.3409789340420174E-08,0.0039781024005110955,1.361276026355333e-5,-5.312812805725196e-8,0.003978473023124186,1.3547849219766439e-5,-5.299644136530384e-8,0.003978857094370713,1.3572654477401475e-5,-5.304293291262342e-8,0.00397922161367756,1.3685187261991948e-5,-5.326404503945597e-8,0.0039795391090315735,1.387078103509612e-5,-5.363091484811033e-8,0.003979789799970764,1.4105237357237993e-5,-5.4095556401576257e-8,0.0039799632178153825,1.4357845076354077e-5,-5.45968922420498e-8,0.003980059500806607,1.4594673222991368e-5,-5.506737604277994e-8,0.003980090142970023,1.4782539911570218e-5,-5.5440930753357645e-8,0.003980077642195864,1.4893710156689642e-5,-5.566226817310781e-8,0.003980053468419345,1.4910803096605801e-5,-5.56965853216742e-8,0.0039800541106269635,1.4830983623911673e-5,-5.553787293347947e-8,0.0039801154418540406,1.466838142817004e-5,-5.5213797919344863e-8,0.003980266139921954,1.4453775388946017e-5,-5.478524269653043e-8,0.003980521287767714,1.4231023369268172e-5,-5.4339391697161045e-8,0.003980877353979621,1.4050315119139707e-5,-5.397640762167942e-8,0.003981309717837675,1.395868469966156e-5,-5.3790488944141864e-8,0.003981774090037387,1.3988628469092594e-5,-5.3846999457069773e-8,0.003982213281677193,1.4146764402475845e-5,-5.415961657859051e-8,0.003982570011449755,1.4406143821260008e-5,-5.467482526558627e-8,0.003982804131697453,1.47071498764841e-5,-5.527369286809923e-8,0.003982908778352366,1.4970992193698437e-5,-5.579891732093303e-8,0.003982916824397885,1.5124448073961797e-5,-5.6104337480320424e-8,0.003982891263406429,1.5126160410236833e-5,-5.610742482232311e-8,0.00398290215454356,1.4980743595872157e-5,-5.581730514030468e-8,0.0039830019202654705,1.4733222541316497e-5,-5.532354528930037e-8,0.003983211326857249,1.4448727937037265e-5,-5.4755680309660146e-8,0.003983520104257227,1.4189885389384998e-5,-5.423828496751849e-8,0.003983897259054235,1.4001826693159665e-5,-5.386125283385029e-8,0.003984303459136277,1.3907216352427944e-5,-5.366993275012876e-8,0.003984700579759181,1.3908279420985249e-5,-5.3669095525382856e-8,0.003985057207973846,1.399170223752423e-5,-5.3832563887307894e-8,0.00398535107067196,1.4133635001783242e-5,-5.411306762933109e-8,0.003985569881970607,1.4303771905497005e-5,-5.445033306625039e-8,0.0039857117052029475,1.4468652878353123e-5,-5.4777689929636526e-8,0.003985785248092382,1.4594817843348775e-5,-5.502840613731594e-8,0.003985809897015252,1.4652472383143383e-5,-5.514301337657362e-8,0.003985814826438397,1.4619974837042523e-5,-5.5078226609295487e-8,0.0039858363205629195,1.4488750116827408e-5,-5.481669944437828e-8,0.003985912714645442,1.426742833517886e-5,-5.4375274115178266e-8,0.003986077146685968,1.3983468945714063e-5,-5.380829619913038e-8,0.003986349418788184,1.3680607655818763e-5,-5.320267121504874e-8,0.003986729243878734,1.3411429492368585e-5,-5.266321054783875e-8,0.003987193368925278,1.3226052188088213e-5,-5.229014065094215e-8,0.0039876982347206835,1.3159498917999302e-5,-5.2153854337675876E-08,0.00398818833657533,1.3221106579292605e-5,-5.227358445765773e-8,0.003988608901007278,1.338916970518754e-5,-5.260647556617648e-8,0.003988920183252699,1.3613194193081244e-5,-5.3051916801022585e-8,0.003989109646982799,1.3824650626505712e-5,-5.347299765131535e-8,0.003989197746223967,1.3954767944424933e-5,-5.373215558025435e-8,0.003989233827788415,1.3954763566654355e-5,-5.373171638754063e-8,0.003989281800794039,1.3811236850979288e-5,-5.3444699852450874e-8,0.003989400134260441,1.3549823535973889e-5,-5.292209959911019e-8,0.003989624365284392,1.3225093106393183e-5,-5.227268643727621e-8,0.003989959279866753,1.290162083662521e-5,-5.1625249279043706e-8,0.0039903824814073756,1.2635093520500604e-5,-5.109093995112096e-8,0.00399085532254792,1.2460509228031144e-5,-5.0739748289693165e-8,0.003991335096141489,1.2389290014694273e-5,-5.0594703090057124e-8,0.003991784193685639,1.2412788238110021e-5,-5.063879306432595e-8,0.0039921750376531425,1.2508400657934924e-5,-5.082710027342623e-8,0.0039924916979013365,1.264552801312763e-5,-5.109866380876292e-8,0.003992729733420645,1.2790244411010073e-5,-5.138580639540977e-8,0.003992895505481774,1.2908774182592685e-5,-5.162109554086806e-8,0.003993005539841018,1.2970483448082949e-5,-5.1743325651077926e-8,0.003993085805853583,1.2951169554634605e-5,-5.170407528089941e-8,0.0039931702182065525,1.2837098930575677e-5,-5.1475750096119304e-8,0.003993297356816803,1.2629535465925717e-5,-5.106062222453551e-8,0.003993504537036869,1.2348458326471559e-5,-5.04982889205154e-8,0.00399381928261621,1.2033164964636035e-5,-4.9866956012253766e-8,0.003994250001187529,1.1737322154317254e-5,-4.9273662215669775e-8,0.0039947794474397376,1.1517572315967707e-5,-4.883161802180583e-8,0.003995364932969854,1.1417909076784898e-5,-4.8629022529340004e-8,0.0039959471867255245,1.145512467560501e-5,-4.8699907040692296e-8,0.003996465923696541,1.1611411554188564e-5,-4.9009176717670445e-8,0.003996876828671035,1.1837637422183225e-5,-4.9458966925161574e-8,0.003997163971009506,1.2066380201857806e-5,-4.991458667779847e-8,0.003997343759283495,1.2230228260355551e-5,-5.024110820721207e-8,0.003997459714537061,1.227962356731739e-5,-5.033913205513782e-8,0.0039975700174394516,1.2195246540345806e-5,-5.016966528746188e-8,0.0039977315793668896,1.199171433994848e-5,-4.9761614483588085e-8,0.003997985303974457,1.1711837911922054e-5,-4.920037428897476e-8,0.003998346858193554,1.1413566865496914e-5,-4.8601769213070115e-8,0.0039988053495900785,1.1154143067304714e-5,-4.808037527313077e-8,0.0039993293627035445,1.0976671983429418e-5,-4.7722620398013583e-8,0.003999877225762814,1.0902767894712806e-5,-4.7571985490559816e-8,0.004000407493370264,1.0931979187466173e-5,-4.762776490445662e-8,0.00400088668699902,1.1046120607170104e-5,-4.785368769200271e-8,0.0040012933178902805,1.1215681826101956e-5,-4.8190753288722657e-8,0.004001618824597613,1.140602944436198e-5,-4.856968419517292e-8,0.004001866716617343,1.1582292382143262e-5,-4.8920729394387654e-8,0.004002051089467816,1.1712900988527266e-5,-4.9180732644461024e-8,0.004002195134543225,1.1772393926335084e-5,-4.9298705411811596e-8,0.0040023296147842545,1.1744241358596293e-5,-4.9241438831947997e-8,0.004002490702025333,1.1624164492064202e-5,-4.9000150214148706e-8,0.004002716177242634,1.1423787492992013e-5,-4.859784391910101e-8,0.0040030390227214704,1.1173356864132723e-5,-4.8094833920023865e-8,0.004003478361347815,1.0920997712239193e-5,-4.7587334303852796e-8,0.004004029802038545,1.0725563863908767e-5,-4.719320099784125e-8,0.004004659792221574,1.0641953511935584e-5,-4.7022548424382676e-8,0.004005309358395405,1.0702231547952575e-5,-4.713991105371558e-8,0.004005909305357476,1.0900742430031743e-5,-4.7534332339053704e-8,0.004006402231050277,1.1192022790909333e-5,-4.8115061170983004e-8,0.004006761493609258,1.1504328555145381e-5,-4.8738556290387605e-8,0.004006998416788491,1.1762810600434922e-5,-4.925487801263246e-8,0.0040071557972175655,1.1911802199676452e-5,-4.955234189469917e-8,0.004007292492485376,1.1928068755813912e-5,-4.9584090451901684e-8,0.004007466154921649,1.182270536529946e-5,-4.9371962164986925e-8,0.004007719484345561,1.1633960677447274e-5,-4.8992235679285965e-8,0.004008072516982853,1.1415035698476774e-5,-4.855132546462214e-8,0.004008521247009628,1.1220739757355388e-5,-4.81591306861145e-8,0.004009041556486812,1.1095986552782165e-5,-4.790595409748483e-8,0.004009596684482728,1.1068126254001404e-5,-4.784699794194256e-8,0.004010146061004549,1.1144061978931795e-5,-4.799641499742937e-8,0.0040106533603855915,1.1311869844993711e-5,-4.833044905420133e-8,0.004011092236707525,1.1545566812726804e-5,-4.8796997573800546e-8,0.004011449171177877,1.1811239466230054e-5,-4.9327987188523245e-8,0.004011723764818403,1.2072971677857698e-5,-4.985134835693644e-8,0.00401192736389657,1.2297623888833959e-5,-5.0300619813788786e-8,0.004012080963416897,1.2458294160137046e-5,-5.06218316152855e-8,0.004012212952149902,1.2536886563441079e-5,-5.077857415701251e-8,0.004012356748830488,1.2526361690877996e-5,-5.075648134300845e-8,0.004012547921684051,1.2433048238960548e-5,-5.0567928963629637e-8,0.0040128199805693305,1.2278886932150372e-5,-5.025666471468604e-8,0.004013197985529161,1.2102470950470938e-5,-4.990002190519058e-8,0.00401369000353784,1.1956510006150005e-5,-4.960388878819715e-8,0.004014278532066863,1.1898883530667995e-5,-4.948472066423443e-8,0.0040149167491389135,1.197622246061075e-5,-4.963648586630433e-8,0.004015535619726837,1.2203997061740317e-5,-5.0090569001978953e-8,0.004016064005360639,1.2553240036393509e-5,-5.0789018255737813e-8,0.0040164548830214815,1.2954750430225737e-5,-5.1592962190804215e-8,0.004016703733644348,1.3322431746732769e-5,-5.232951731508461e-8,0.004016848431434354,1.3584310465564186e-5,-5.2854110685949694e-8,0.004016951977140229,1.3704978067918915e-5,-5.309550581731473e-8,0.00401707918422125,1.3690726517722423e-5,-5.3066050186417026e-8,0.004017278464444657,1.3580022117076173e-5,-5.284257367174307e-8,0.004017573349390648,1.3427603643939568e-5,-5.253461517336548e-8,0.004017962524787026,1.3289293461804937e-5,-5.2254123260796106e-8,0.004018424992325505,1.3210932934703492e-5,-5.2093339215260626e-8,0.0040189273729024705,1.3221997414880813e-5,-5.211190437947683e-8,0.0040194315062708425,1.3333214209773679e-5,-5.2331872879317006e-8,0.004019901334926071,1.3537385768781908e-5,-5.273915282943784e-8,0.00402030839443015,1.3812681913253474e-5,-5.3290015781132485e-8,0.004020635440219238,1.4127527132908653e-5,-5.392095666905157e-8,0.004020878035146411,1.4446146519830484e-5,-5.455996088115213e-8,0.004021044226821732,1.473392798977689e-5,-5.513737746601209e-8,0.00402115275112109,1.496191131793451e-5,-5.559493860655362e-8,0.004021230393628464,1.5110074592057919e-5,-5.589227823087387e-8,0.004021308993990323,1.5169566143298608e-5,-5.601133518705951e-8,0.004021422225284333,1.5144214158221058e-5,-5.595940175161358e-8,0.0040216019835709,1.505150937068162e-5,-5.57712373201424e-8,0.004021873939755527,1.4922916833095616e-5,-5.550989215428107e-8,0.0040222517467002885,1.4802621499919506e-5,-5.5264327043482085e-8,0.004022730175355548,1.4742845077977562e-5,-5.513999395696767e-8,0.00402327924617558,1.4793651408929851e-5,-5.5238179247849234e-8,0.004023843665981839,1.498685836194858e-5,-5.562340967782772e-8,0.004024352851506316,1.5318263529964064e-5,-5.62874975195311e-8,0.004024743118745088,1.573836892528872e-5,-5.7130821512435726e-8,0.004024984194842726,1.6162535861771282e-5,-5.7982877436069443E-08,0.004025094377176705,1.6501026274800637e-5,-5.866291758713605e-8,0.004025133037057492,1.6693810177365013e-5,-5.9050065212816505e-8,0.0040251747474465615,1.6730082192383597e-5,-5.912247029379822e-8,0.004025281332087344,1.6644195416193686e-5,-5.894897656672424e-8,0.004025485746450353,1.6495866969054968e-5,-5.864930998217878e-8,0.004025790429201538,1.634835179138792e-5,-5.8350370181822665e-8,0.0040261746462862255,1.6253223052331517e-5,-5.815584387978385e-8,0.0040266044641294775,1.624327250382378e-5,-5.813200951807451e-8,0.004027041638836209,1.633135361213576e-5,-5.8305293951082345e-8,0.00402745025711566,1.6512469372403883e-5,-5.866622925242898e-8,0.00402780134494779,1.6767326438795646e-5,-5.917637987828972e-8,0.004028075926393701,1.7066612366788847e-5,-5.977686171643531e-8,0.004028266748303052,1.7375686093179322e-5,-6.039784671300595e-8,0.004028378700267617,1.7659404592882538e-5,-6.096841423803015e-8,0.004028427921096438,1.7886793273255926e-5,-6.142604364033798e-8,0.00402843964084909,1.8035151508268353e-5,-6.172486403108444e-8,0.004028445012514573,1.809312331270539e-5,-6.184175008856881e-8,0.0040284773268235005,1.8062494703952662e-5,-6.177988665082503e-8,0.004028567910222432,1.7958723498241694e-5,-6.156990468255793e-8,0.004028741861400401,1.781021131030546e-5,-6.12686094634135e-8,0.0040290136622913525,1.765619786846825e-5,-6.095496322789188e-8,0.0040293826809504,1.754280016104753e-5,-6.07222216328837e-8,0.004029829124215082,1.751619084809753e-5,-6.066410876225836e-8,0.004030312256108125,1.7612020509539247e-5,-6.085324393616324e-8,0.004030774031389632,1.7841815454699297e-5,-6.131341293797681e-8,0.00403115142107213,1.8180564860966387e-5,-6.199433879515745e-8,0.0040313974300052735,1.8563852856182064e-5,-6.27659191383855e-8,0.004031503203472192,1.8902856758312773e-5,-6.344869780801121e-8,0.004031507215610012,1.9116091643266002e-5,-6.387812802255732e-8,0.004031481930153734,1.916242569246173e-5,-6.397118926916185e-8,0.004031503768949901,1.9055383830683572e-5,-6.375504333127174e-8,0.004031624504421274,1.885153534554923e-5,-6.334344369125224e-8,0.00403185885677837,1.8623798019755862e-5,-6.288296518438462e-8,0.004032189274944319,1.8436620157024645e-5,-6.250321630029159e-8,0.004032579178971542,1.83324637336343e-5,-6.228981683190497e-8,0.004032986090714059,1.8329161981569122e-5,-6.227911243671427e-8,0.0040333708125981456,1.8423493871162983e-5,-6.246522183995398e-8,0.004033702484811329,1.8596808258675e-5,-6.281112340841897e-8,0.0040339608469825575,1.882045266602357e-5,-6.325939983367222e-8,0.004034137070431829,1.906045203237547e-5,-6.374161530130195e-8,0.004034233855241526,1.928170635220029e-5,-6.41868612531973e-8,0.004034264876079334,1.9452018078757834e-5,-6.453000617107153e-8,0.004034253391531761,1.9546047063260236e-5,-6.47197441623075e-8,0.004034229755724816,1.9548977882390267e-5,-6.472596597020264e-8,0.004034227730682795,1.9459320969577683e-5,-6.454533452522716e-8,0.004034279865723162,1.9290186380915923e-5,-6.420383235003002e-8,0.004034412486171448,1.9068594732676885e-5,-6.375547510633614e-8,0.00403464093034948,1.8832637893526655e-5,-6.327679436677401e-8,0.004034965687074627,1.8626536313167505e-5,-6.285707244922939e-8,0.004035370034247165,1.8493819644007736e-5,-6.258465123000945e-8,0.004035819874790727,1.846886648562048e-5,-6.252971679787746e-8,0.004036266904185114,1.856732169763407e-5,-6.272465029492704e-8,0.0040366565598250765,1.8777113738250836e-5,-6.31455681508602e-8,0.0040369414612311345,1.9053783781087113e-5,-6.370271942688705e-8,0.004037098344333292,1.932539834606959e-5,-6.42504851948613e-8,0.004037141902942749,1.951083270094533e-5,-6.462457097034529e-8,0.004037125865169994,1.954813798447868e-5,-6.46995458547251e-8,0.004037125861820998,1.9419995141300983e-5,-6.444028053955575e-8,0.00403721048480607,1.9160768124473176e-5,-6.391602935018678e-8,0.004037416430514758,1.88403649270376e-5,-6.326771012194285e-8,0.0040377405727112705,1.853563684839144e-5,-6.265022145619625e-8,0.004038149143064464,1.8305856043064805e-5,-6.218312567891382e-8,0.004038594479970898,1.8181596820678142e-5,-6.192833669694351e-8,0.004039029805036155,1.8165835433560526e-5,-6.189230839848963e-8,0.004039418015136255,1.8241197474729e-5,-6.204049708155263e-8,0.0040397350446880215,1.837815198734788e-5,-6.231370568667206e-8,0.004039969999138671,1.8541650006683282e-5,-6.264136381327966e-8,0.004040124041563737,1.8695860404660215e-5,-6.295108921511804e-8,0.004040209074777056,1.8807706049100226e-5,-6.317591860236914e-8,0.004040246363654397,1.88500021655281e-5,-6.32607471793734e-8,0.004040264737547788,1.8804636954320954e-5,-6.316879237455187e-8,0.004040297831687618,1.866571824947087e-5,-6.288791561688243e-8,0.004040379958326903,1.844201983765977e-5,-6.243550964565625e-8,0.004040540705219954,1.8157672301950075e-5,-6.185990253089828e-8,0.004040799030115895,1.7850119174229367e-5,-6.123634554926798e-8,0.0040411581509778,1.7564868093298403e-5,-6.065660011340943e-8,0.004041602732207329,1.734741098407994e-5,-6.021277355052825e-8,0.0040420995762303815,1.7233639004230466e-5,-5.997796689164541e-8,0.004042602323436688,1.724067110935005e-5,-5.998756494201581e-8,0.00404305992163886,1.736012884995211e-5,-6.022533875758978e-8,0.004043427966196684,1.7555910433464828e-5,-6.061865961283453e-8,0.0040436810936756275,1.7768500926616962e-5,-6.104709566844615e-8,0.004043823230883101,1.7927149455153616e-5,-6.1367140862782e-8,0.004043891164479845,1.7968977540453174e-5,-6.145110341710769e-8,0.004043947176700689,1.7860007267002482e-5,-6.122984744605595e-8,0.0040440603521150744,1.760913353792817e-5,-6.072111082777755e-8,0.004044282997667049,1.726658843338252e-5,-6.002633777071843e-8,0.004044633306112802,1.6905912165610116e-5,-5.929416783466505e-8,0.0040450925842591984,1.6598297213721576e-5,-5.866858772554347e-8,0.004045616463144047,1.6391968202125593e-5,-5.824729428445154e-8,0.004046152091763345,1.630410509649094e-5,-5.80653572847142e-8,0.004046652760383014,1.6324348036651065e-5,-5.8102214711525505e-8,0.004047085929565268,1.6424100266681775e-5,-5.830035937199191e-8,0.004047435228495953,1.6566189179488793e-5,-5.8584786032397173e-8,0.004047698959744002,1.671216642566975e-5,-5.8877737365682856e-8,0.004047887444712365,1.6826943646276348e-5,-5.9108127517374904e-8,0.00404802049508203,1.6881670483517197e-5,-5.9217433706880595e-8,0.004048125273323472,1.6855947238255258e-5,-5.9164217502915826e-8,0.004048234127401434,1.674008799311883e-5,-5.8928701076803824e-8,0.004048381670060571,1.6537530470193916e-5,-5.851761039418674e-8,0.004048600436416601,1.6266746291805815e-5,-5.796802584768781e-8,0.004048914984056892,1.5961326425245878e-5,-5.734760338043135e-8,0.004049335282066074,1.566668088020222e-5,-5.674801447212363e-8,0.0040498513719114376,1.5432414454828066e-5,-5.626965875165331e-8,0.004050431921230339,1.5301075079280176e-5,-5.5998974280483204e-8,0.004051028668995067,1.5296083993458358e-5,-5.598395649797168e-8,0.004051586738790464,1.5412983005455173e-5,-5.62162478465142e-8,0.004052058328986434,1.5617600591062285e-5,-5.6627167195976384e-8,0.004052415758160085,1.5852514347711364e-5,-5.7100596870077054e-8,0.004052659913064241,1.6050494133565283e-5,-5.7500160816537554e-8,0.0040528214440387015,1.6151570852562244e-5,-5.7703907353645075e-8,0.004052953861013157,1.611931020329749e-5,-5.763746552942237e-8,0.004053119682835466,1.595162622613579e-5,-5.729612717276807e-8,0.004053373025435257,1.5682212292362576e-5,-5.6747852350428666e-8,0.004053744027610918,1.537106055446932e-5,-5.611410681536437e-8,0.004054230846152612,1.5086637935810276e-5,-5.553375453822118e-8,0.004054802304411898,1.488624806595296e-5,-5.5123232299645195e-8,0.0040554095026198176,1.4802029857689209e-5,-5.494808734565473e-8,0.004056000829014219,1.4836834906018199e-5,-5.501449222707493e-8,0.0040565344012080526,1.496913360261363e-5,-5.527907211829798e-8,0.004056984713435475,1.5162646600086324e-5,-5.5668377746635783e-8,0.004057343673139978,1.537616244421555e-5,-5.609881419197702e-8,0.004057618154709957,1.5570907870645105e-5,-5.6491651348612124e-8,0.004057826336088842,1.571498161585009e-5,-5.678207302107251e-8,0.004057994236563965,1.5785663812756403e-5,-5.692387796847087e-8,0.004058152876449292,1.5770755436499932e-5,-5.6892175274642595e-8,0.004058335730497766,1.56698047725992e-5,-5.6685842838322767e-8,0.004058575736492297,1.5495479753201927e-5,-5.6330312045967666e-8,0.004058901067412491,1.5274593050186677e-5,-5.587969998232432e-8,0.0040593292989023755,1.504744016568601e-5,-5.541556302293769e-8,0.004059860688647646,1.4863522530534258e-5,-5.5038323485976716e-8,0.004060472924789321,1.4772178278052189e-5,-5.484831991380623e-8,0.004061121016256655,1.4808824187926628e-5,-5.491786333355384e-8,0.004061745398388068,1.4980995070619321e-5,-5.526278213620586e-8,0.0040622878335508355,1.5260905424743596e-5,-5.58271445794069e-8,0.00406270977840194,1.5589957864201896e-5,-5.6492254117461846e-8,0.004063005280007226,1.5895053516072876e-5,-5.71096919262533e-8,0.004063202722944347,1.611033761314179e-5,-5.7545486920249105e-8,0.004063355322523949,1.6195737978189514e-5,-5.7717829505718655e-8,0.004063524982892078,1.614629397440836e-5,-5.761611433490631e-8,0.0040637654881181635,1.5990874718776372e-5,-5.729846921069878e-8,0.0040641096822484745,1.5782374878243806e-5,-5.687200018963553e-8,0.004064563196214051,1.558309622417832e-5,-5.646323142518138e-8,0.004065105372946402,1.5449401160722053e-5,-5.6186965778914343e-8,0.004065696400389077,1.5419375479983378e-5,-5.612111731815594e-8,0.004066288252635861,1.5506240841777267e-5,-5.6293121212787874e-8,0.004066836155862962,1.5698542971993716e-5,-5.668010909236039e-8,0.004067307459695976,1.5966009975132922e-5,-5.7220705532581126e-8,0.00406768613309999,1.6268363193234948e-5,-5.783296271933897e-8,0.004067972917711898,1.6564106468153707e-5,-5.8432340733695405e-8,0.004068182486831887,1.681727652571284e-5,-5.894554234053274e-8,0.00406833933892352,1.7001503611134662e-5,-5.931880776278692e-8,0.004068473756113949,1.7101841750667816e-5,-5.952159722920657e-8,0.004068618388467829,1.7115337876791556e-5,-5.9547687041123166e-8,0.004068805319711415,1.7051183194416186e-5,-5.941546370891142e-8,0.004069063045413328,1.693080237181354e-5,-5.9168176976249445e-8,0.004069412642286213,1.6787584460103433e-5,-5.887352588619779e-8,0.004069862675046376,1.6665125654505054e-5,-5.862021049541122e-8,0.0040704033862420915,1.6612132979317868e-5,-5.8507611354420696e-8,0.004071002433343476,1.6672362317351996e-5,-5.8625252169843815e-8,0.004071606146962371,1.6870078458229394e-5,-5.90230533337598e-8,0.004072150180031084,1.7195707718266797e-5,-5.968194828764344e-8,0.004072579327330133,1.7600304654934825e-5,-6.050250155157372e-8,0.004072869038903364,1.800622384140864e-5,-6.132663264350784e-8,0.004073036765467772,1.8332569931295446e-5,-6.1989505493645e-8,0.004073135737926338,1.852349328887892e-5,-6.237718185712606e-8,0.004073234663677566,1.85650892687075e-5,-6.246099877342193e-8,0.004073394556097025,1.848476914851136e-5,-6.229627231999442e-8,0.004073652726352091,1.833737723399551e-5,-6.199414171839608e-8,0.004074017372470005,1.818678426452505e-5,-6.168431508746106e-8,0.0040744707750797445,1.808984214398682e-5,-6.148259812586677e-8,0.004074977337424825,1.8085790232343694e-5,-6.14693541796517e-8,0.004075493263269258,1.8191439776279438e-5,-6.167952512829171e-8,0.004075975798354961,1.840124607827241e-5,-6.210249277646861e-8,0.004076390776901895,1.8691144047334405e-5,-6.268964660170682e-8,0.004076717622217568,1.902494399145827e-5,-6.336732629192284e-8,0.004076951353972912,1.9361837440099986e-5,-6.405219775676581e-8,0.004077101746210127,1.96635091438295e-5,-6.46659095300111e-8,0.0040771903314508785,1.989970237527024e-5,-6.514655672234517e-8,0.004077246262806788,2.005165635670929e-5,-6.545569860243698e-8,0.004077302032084395,2.0113486301099913e-5,-6.558109876386352e-8,0.0040773896466789,2.0092092019349717e-5,-6.553647593087778e-8,0.004077537342209875,2.0006253451383885e-5,-6.535969647604283e-8,0.004077766555167821,1.988527789663943e-5,-6.511016738314298e-8,0.004078088689458051,1.976710784085783e-5,-6.486516989220184e-8,0.004078501328342447,1.96951136887764e-5,-6.471343334262049e-8,0.004078984379126887,1.971216651307541e-5,-6.474300004433253e-8,0.004079498090171917,1.985082590723176e-5,-6.502100525056876e-8,0.004079986278779378,2.0120252289371937e-5,-6.55667052274478e-8,0.004080388235941525,2.0494122797303468e-5,-6.632662153528476e-8,0.004080659282108669,2.0908086133771597e-5,-6.716933519624624e-8,0.0040807921628955995,2.1274886377819846e-5,-6.791652262392293e-8,0.004080825530396653,2.151542116556529e-5,-6.840653341073122e-8,0.00408083076942298,2.1590301346052778e-5,-6.855881484240877e-8,0.00408088328291802,2.1513241158620907e-5,-6.84010788689678e-8,0.004081035155949392,2.134019848115492e-5,-6.804703209129059e-8,0.004081302546732209,2.1144355238359504e-5,-6.764545015636383e-8,0.004081668918553097,2.0992072249557375e-5,-6.733141248227607e-8,0.00408209685499066,2.092848134334002e-5,-6.719713964870882e-8,0.004082540990125184,2.09731231952271e-5,-6.72830951751148e-8,0.004082958197133572,2.112218615191573e-5,-6.758231956110174e-8,0.00408331422869279,2.1353847294547875e-5,-6.805099975797541e-8,0.0040835874057665485,2.1634567155020024e-5,-6.862106700376206e-8,0.004083770116681637,2.1925434668298697e-5,-6.921309213990532e-8,0.004083868551366543,2.218816882099307e-5,-6.974866033503243e-8,0.0040839008942840345,2.239039499761978e-5,-7.016132947403248e-8,0.004083894232067077,2.250978778831476e-5,-7.0405207142333e-8,0.004083880571241067,2.25366960163881e-5,-7.046030306590217e-8,0.00408389252947929,2.2475031488631666e-5,-7.033426314434203e-8,0.004083959249418965,2.2341562177163083e-5,-7.00608865512821e-8,0.004084102836943754,2.2163971654346905e-5,-6.969625158825354e-8,0.004084335399848269,2.1977972812721735e-5,-6.931302372966625e-8,0.004084656614019778,2.1823582213426522e-5,-6.899305140282665e-8,0.004085051725131036,2.1740298666453316e-5,-6.881758196303943e-8,0.00408549043013785,2.1760499615591525e-5,-6.88536205880247e-8,0.004085928134416261,2.1900671848150498e-5,-6.913569532030017e-8,0.0040863118371121795,2.215161693360532e-5,-6.964550832191338e-8,0.004086592559838579,2.2471365259167905e-5,-7.029728262333709e-8,0.004086743511323791,2.278742626781085e-5,-7.094245749548945e-8,0.004086777069432108,2.3014650869490377e-5,-7.140649996468963e-8,0.004086748324489586,2.3086554162397423e-5,-7.155319319147187e-8,0.004086737210606845,2.298478523801362e-5,-7.134486880118048e-8,0.0040868162246094596,2.274751838270059e-5,-7.085933294161156e-8,0.004087022774633262,2.245098166859568e-5,-7.025197183973786e-8,0.004087351063401967,2.21773293531232e-5,-6.969023534135919e-8,0.004087762942117613,2.1988078250473938e-5,-6.929965848306815e-8,0.004088206426731321,2.1912888693068682e-5,-6.914113536613453e-8,0.0040886315320029145,2.1951514131721826e-5,-6.921484527465759e-8,0.004088999563181579,2.2082048330308014e-5,-6.947683655171173e-8,0.004089286694209541,2.227007195705091e-5,-6.985740065000953e-8,0.0040894840997412005,2.2476260228544262e-5,-7.027641992708612e-8,0.004089596524746182,2.2662126678655353e-5,-7.065510425729817e-8,0.004089640201779963,2.2794420332461283e-5,-7.092513321189004e-8,0.0040896402838893646,2.284862699133553e-5,-7.103599943485881e-8,0.004089627705490863,2.2811697616913437e-5,-7.096068474456991e-8,0.004089635411507748,2.2683801109797253e-5,-7.069921973276663e-8,0.004089694115390104,2.2478677051700234e-5,-7.027932793650815e-8,0.004089828036207196,2.2222286505042233e-5,-6.975365444924291e-8,0.004090051161470819,2.1949786269337134e-5,-6.919369964114232e-8,0.004090364511991667,2.170103932630054e-5,-6.86808528694382e-8,0.004090754790796106,2.151498959955255e-5,-6.829506592183514e-8,0.004091194666195651,2.142330844766789e-5,-6.810185855541579e-8,0.004091644993372157,2.1443624281504225e-5,-6.813824314344391e-8,0.0040920596967446154,2.1572833523424404e-5,-6.83986719144852e-8,0.004092394222561333,2.1782031162445324e-5,-6.88243378416857e-8,0.00409261763274889,2.2016102025325163e-5,-6.93022303226837e-8,0.0040927261558925485,2.2201941671687712e-5,-6.968213454108016e-8,0.004092752390399775,2.226781056753669e-5,-6.98165868041908e-8,0.004092761828782771,2.217010941896625e-5,-6.961594162020133e-8,0.004092832347522563,2.191489742469643e-5,-6.90924145000651e-8,0.004093023916310563,2.1559197363135236e-5,-6.836256507621499e-8,0.004093355382863215,2.1188443825140062e-5,-6.760103065423595e-8,0.004093801442773309,2.0883140487863215e-5,-6.697239893387999e-8,0.004094308353665391,2.0693642127327703e-5,-6.657980636574702e-8,0.004094815962852751,2.0632674505226746e-5,-6.644971858931919e-8,0.0040952745320277885,2.068224872375703e-5,-6.654596569206641e-8,0.0040956524926629954,2.0806194730034872e-5,-6.67951505187713e-8,0.004095937126088291,2.0961685991746184e-5,-6.711000602505771e-8,0.004096131713874594,2.1107263596701378e-5,-6.740571701477901e-8,0.004096251810518326,2.1207630473032185e-5,-6.760979080112129e-8,0.004096321810660583,2.123646163530461e-5,-6.766796655208107e-8,0.004096371868974252,2.117828020698269e-5,-6.754820351325027e-8,0.004096434786498749,2.102987222746858e-5,-6.724363080817744e-8,0.0040965424713340064,2.0801158863912584e-5,-6.677428971329367e-8,0.004096721827951759,2.0514974467630822e-5,-6.618661611930796e-8,0.004096990403276643,2.0205057223031076e-5,-6.554934138305202e-8,0.004097352573177603,1.9911884762201487e-5,-6.494509874821933e-8,0.0040977972420050135,1.9676507214749987e-5,-6.445798705026133e-8,0.00409829795293573,1.953307645034436e-5,-6.415839226662203e-8,0.00409881595753222,1.950131413892924e-5,-6.408749767114518e-8,0.0040993062317397294,1.958041987144307e-5,-6.424454113672405e-8,0.004099725949858662,1.9745840788228674e-5,-6.457984351456717e-8,0.004100044534043069,1.9950335607570126e-5,-6.499672432697775e-8,0.004100253632198516,2.013084019847643e-5,-6.536554032319219e-8,0.004100374104936217,2.0221969791798727e-5,-6.555157283498206e-8,0.004100455954183344,2.017477740412432e-5,-6.545379905395303e-8,0.0041005675891791,1.9975516702515512e-5,-6.504358355699308e-8,0.004100774805833544,1.965545542492212e-5,-6.438482789008002e-8,0.004101116885460426,1.928372582152993e-5,-6.361922074229146e-8,0.004101591870619371,1.894360567216253e-5,-6.291755062884213e-8,0.004102159238000308,1.8703470116557066e-5,-6.242018269746027e-8,0.00410275747591571,1.859703517591237e-5,-6.219659152435074e-8,0.0041033257619690735,1.8620141853715126e-5,-6.223872071816769e-8,0.004103819526959297,1.874065523208672e-5,-6.248114525442182e-8,0.004104216341986781,1.8912959818053868e-5,-6.283064370406833e-8,0.004104514378076207,1.909031638156852e-5,-6.319144791179558e-8,0.004104727475774354,1.9232607115184218e-5,-6.348113509152911e-8,0.004104879851426564,1.931006277488053e-5,-6.363836365897142e-8,0.004105001750774871,1.9304641429037065e-5,-6.362581755356893e-8,0.004105126061105588,1.9210481227772614e-5,-6.343120965738759e-8,0.004105285298052878,1.903412670485694e-5,-6.306774716776545e-8,0.004105508333763851,1.879451414608241e-5,-6.257405625726658e-8,0.004105816518487927,1.8522105372562953e-5,-6.201237977882163e-8,0.004106219408261088,1.8256224455901378e-5,-6.146316659960243e-8,0.004106711031782206,1.8039834534071813e-5,-6.101448588822051e-8,0.00410726820104739,1.7911758794004197e-5,-6.074620274769431e-8,0.00410785241819564,1.7897526858302653e-5,-6.071123337928272e-8,0.004108416180285091,1.8001212401072268e-5,-6.091866896065255e-8,0.0041089130241994485,1.820113748087769e-5,-6.132469615222139e-8,0.004109309104207408,1.8451646262672002e-5,-6.183595690444914e-8,0.0041095931983087045,1.869153552715818e-5,-6.232669811154938e-8,0.004109782084836411,1.8857869433917337e-5,-6.266717936609684e-8,0.004109919049387194,1.890226775739589e-5,-6.275732940350907e-8,0.004110064678761718,1.8805497319272342e-5,-6.255697025959145e-8,0.004110281124285083,1.858555641793577e-5,-6.210261238000375e-8,0.004110613703963449,1.829511610327427e-5,-6.150227952510236e-8,0.004111076186029953,1.8007169267841526e-5,-6.090602884987728e-8,0.004111646199815092,1.779292050803584e-5,-6.046048759796877e-8,0.0041122733354077975,1.770055011084275e-5,-6.026514317284309e-8,0.0041128962379817155,1.774357289428051e-5,-6.034829633072815e-8,0.004113460777981091,1.790224628658376e-5,-6.06698069713779e-8,0.004113932211375858,1.8134726118468195e-5,-6.114390913053563e-8,0.004114298813701848,1.8391239948785017e-5,-6.166830949707429e-8,0.004114568894174971,1.862570592744579e-5,-6.214811466500701e-8,0.004114764817887481,1.8802594772439982e-5,-6.251002429640857e-8,0.004114916941016438,1.8899611324047082e-5,-6.270792853777051e-8,0.004115058788903396,1.8907892822336005e-5,-6.272336282371548e-8,0.004115223529956793,1.883126597625609e-5,-6.256398245923092e-8,0.00411544112890223,1.8685396522870248e-5,-6.226179188618023e-8,0.004115735426728429,1.8496880076378558e-5,-6.187126850283822e-8,0.004116120670135077,1.830166124887891e-5,-6.146615285795259e-8,0.0041165976094830435,1.8141735245261587e-5,-6.113275473128614e-8,0.0041171501459813615,1.8059102673713814e-5,-6.095761535265301e-8,0.0041177444298378775,1.808677278934742e-5,-6.100903876410642e-8,0.0041183326482072515,1.8238377845822922e-5,-6.131565461947553e-8,0.004118862644895194,1.8500025366803055e-5,-6.184947666116739e-8,0.004119291845670744,1.882888305936909e-5,-6.252277761117837e-8,0.004119600995524518,1.916129270179671e-5,-6.320463576506777e-8,0.004119802051454148,1.9429176950619105e-5,-6.375467477591138e-8,0.004119936452241972,1.9579389208801835e-5,-6.406297574667329e-8,0.004120063979010977,1.958911524116044e-5,-6.408192449547398e-8,0.004120246088908799,1.9472222424355246e-5,-6.383944294513096e-8,0.00412052913259154,1.927501773422856e-5,-6.343041897475507e-8,0.004120932292519319,1.906320686341203e-5,-6.299000026420115e-8,0.0041214433902594435,1.890409343719484e-5,-6.265701578056743e-8,0.004122023468462977,1.884920647966687e-5,-6.253815085908088e-8,0.004122618451191795,1.8922390072082127e-5,-6.268323571647604e-8,0.004123173897075194,1.911656377839061e-5,-6.307832429936484e-8,0.0041236480036418895,1.939920158835302e-5,-6.365677983994343e-8,0.004124019202185466,1.9723461236942205e-5,-6.432213367561228e-8,0.004124287288244285,2.0040448516884058e-5,-6.49734234542431e-8,0.004124469567213898,2.0308896945277934e-5,-6.552527867409888e-8,0.004124594685466592,2.050066336393985e-5,-6.591937018917111e-8,0.004124696486907284,2.0602417835979338e-5,-6.61279466825767e-8,0.004124809121272801,2.0614914334906605e-5,-6.615231627858997e-8,0.00412496354787499,2.055127128513555e-5,-6.601926590271963e-8,0.004125184918062037,2.0435134717556e-5,-6.57772755655983e-8,0.004125490124622406,2.029885113054249e-5,-6.549281651963915e-8,0.004125884999648892,2.0181120072676474e-5,-6.524562199853932e-8,0.004126361187835996,2.012312227810521e-5,-6.512079755335909e-8,0.004126893637683346,2.016202160381174e-5,-6.519543374690128e-8,0.0041274407643772945,2.0321520249793008e-5,-6.551902559572129e-8,0.0041279499280898095,2.0601210358685798e-5,-6.609131944530118e-8,0.00412836969991199,2.0969274287628928e-5,-6.684706034379096e-8,0.004128666706476001,2.1364544730577544e-5,-6.766013860494177e-8,0.0041288402130868545,2.1711284432474734e-5,-6.837410979895914e-8,0.0041289260941142205,2.1943052421982018e-5,-6.88515335136089e-8,0.0041289863790102055,2.2025323150899638e-5,-6.902071138081227e-8,0.004129088666642758,2.1966206179071726e-5,-6.889782614187511e-8,0.0041292849632450085,2.1811418243791324e-5,-6.857662713945957e-8,0.0041295982485091585,2.1627811881081866e-5,-6.819461136355642e-8,0.004130019713586947,2.1483464269815928e-5,-6.789215710034456e-8,0.004130514847826705,2.1431037977969292e-5,-6.777831067919666e-8,0.004131034556120914,2.1497848193685356e-5,-6.79102050168444e-8,0.0041315275855180284,2.1683260008845836e-5,-6.828741599827955e-8,0.0041319514162801475,2.196236627165169e-5,-6.885922779761631e-8,0.0041322797208666745,2.2294052841138688e-5,-6.95410620986726e-8,0.004132505435793167,2.2631076927335552e-5,-7.023526137874012e-8,0.004132639559466678,2.2929656701609897e-5,-7.085103297987233e-8,0.0041327068073958445,2.3156619956378226e-5,-7.131941152567361e-8,0.004132739789933165,2.329325563893979e-5,-7.160135080100659e-8,0.0041327732697304005,2.3336073204430915e-5,-7.168931655885992e-8,0.004132839498526474,2.3295362222597494e-5,-7.160425905283545e-8,0.00413296489491445,2.319267720853539e-5,-7.139037898864675e-8,0.004133167727447015,2.3058081690060263e-5,-7.110948143247038e-8,0.004133456251584568,2.2927368246838634e-5,-7.083536734083875e-8,0.004133826864680379,2.2838893766911416e-5,-7.064744138921729e-8,0.004134262246139552,2.2829234263837425e-5,-7.062178621276581e-8,0.004134730285875639,2.2926717969593375e-5,-7.081769093706275e-8,0.004135185707911027,2.31425991815179e-5,-7.125916402041035e-8,0.0041355769071945506,2.346164589422353e-5,-7.191520269449173e-8,0.004135859441965122,2.383687117408675e-5,-7.268874415754124e-8,0.00413601369908566,2.4195039750171892e-5,-7.342810252300716e-8,0.004136058529573073,2.4456681249135846e-5,-7.396855759155849e-8,0.004136050487278654,2.456513384479195e-5,-7.419258398190955e-8,0.004136065019007573,2.4509860369459744e-5,-7.407805053129414e-8,0.004136168231272512,2.4330162569653813e-5,-7.370577611668552e-8,0.004136394459822497,2.409789030051738e-5,-7.322376999160329e-8,0.0041367395368764786,2.389056192725738e-5,-7.279186780905995e-8,0.0041371686481556655,2.3768649735412706e-5,-7.253505860848046e-8,0.004137631091783037,2.3763952092816136e-5,-7.251957894397494e-8,0.0041380747660009765,2.3878490225956004e-5,-7.275049880309497e-8,0.004138456791204421,2.4090059448810835e-5,-7.318286374029693e-8,0.004138749601503419,2.4360668956780575e-5,-7.37387885346733e-8,0.004138943194899096,2.4645468588374668e-5,-7.4325712073413e-8,0.004139044422775969,2.49009409295305e-5,-7.485336553975188e-8,0.0041390740178470385,2.509158954761269e-5,-7.52478055388981e-8,0.004139062078858488,2.519450532721772e-5,-7.546109277291754e-8,0.004139042857680081,2.5201537323836e-5,-7.547591881161818e-8,0.004139049681730755,2.5119185084212284e-5,-7.530538123596477e-8,0.004139110696144454,2.4966623708413148e-5,-7.498882514872912e-8,0.004139245793706889,2.4772544989273615e-5,-7.458527889421062e-8,0.004139464664095014,2.4571523457755883e-5,-7.416602259172535e-8,0.0041397656452513715,2.4400247311316832e-5,-7.380696250121588e-8,0.004140135103394312,2.4293510720908743e-5,-7.358048043260725e-8,0.004140547313718007,2.427954414351527e-5,-7.354575599206736e-8,0.004140965413628404,2.4374141223041407e-5,-7.373639326420042e-8,0.004141344873455721,2.457362346913388e-5,-7.414551482757032e-8,0.004141641326420783,2.48483642172095e-5,-7.471205791422762e-8,0.0041418235765014145,2.5141002654557318e-5,-7.53169965475809e-8,0.004141889215372904,2.537511100337642e-5,-7.58014858398564e-8,0.004141874921065243,2.5477517766043897e-5,-7.601342829768719e-8,0.004141851043315424,2.5408217951499304e-5,-7.58696248028512e-8,0.004141897199717203,2.5181416417097176e-5,-7.539927233814727e-8,0.004142070032062376,2.4862233791190885e-5,-7.473692425033855e-8,0.004142382136416294,2.4539521848464896e-5,-7.406615519129582e-8,0.004142802962387187,2.4291862821753357e-5,-7.354938496791458e-8,0.004143276515293847,2.4165133492908547e-5,-7.328171206236878e-8,0.004143742610608551,2.416776805253065e-5,-7.328119646301892e-8,0.004144152149564842,2.427840550811608e-5,-7.350451056510971e-8,0.004144474270556827,2.4457891470911152e-5,-7.387144252687797e-8,0.004144697408744952,2.4660435604785124e-5,-7.428767698568889e-8,0.004144827026181618,2.484202674459949e-5,-7.466207837487929e-8,0.004144881994566124,2.4966196964502726e-5,-7.491871231531306e-8,0.0041448905048311665,2.500781452275799e-5,-7.500493400442998e-8,0.004144885711446158,2.4955282841337656e-5,-7.489617429690564e-8,0.004144901261135358,2.481120187725696e-5,-7.459741678649363e-8,0.004144966982912023,2.4591489692204364e-5,-7.41413441693972e-8,0.004145105121592094,2.4322991873659133e-5,-7.358329870301691e-8,0.004145327544473218,2.403980237268326e-5,-7.299364256044502e-8,0.004145634190738719,2.377879003345024e-5,-7.24485997969921e-8,0.0041460127758167105,2.3574818073592004e-5,-7.202053283003591e-8,0.00414643966336036,2.3455929817344242e-5,-7.17680808924154e-8,0.004146881876040019,2.343860803994068e-5,-7.172625974921142e-8,0.0041473004753961136,2.3523144481116746e-5,-7.189658153429537e-8,0.004147656007247302,2.3689506623327728e-5,-7.223811648289735e-8,0.004147916808771172,2.3895221603221915e-5,-7.266284458651311e-8,0.0041480699650081705,2.4078275121643128e-5,-7.304167053080141e-8,0.004148132195104441,2.4168654642653938e-5,-7.322864004199276e-8,0.004148154320381181,2.4109831376965727e-5,-7.310586674653458e-8,0.004148211444887462,2.388423375298592e-5,-7.263656875158706e-8,0.004148377033934869,2.3528252738308904e-5,-7.189610084153054e-8,0.004148691963497075,2.3123109596003326e-5,-7.105280147716092e-8,0.0041491473031022115,2.27629923552026e-5,-7.030185625864194e-8,0.004149691355374006,2.251899382813585e-5,-6.979067613092937e-8,0.004150253959921051,2.2418989460666156e-5,-6.957735617198645e-8,0.0041507716459602394,2.2449203170718728e-5,-6.963393426794152e-8,0.0041512023452277315,2.2568972898863263e-5,-6.987681903782312e-8,0.004151528686471275,2.2727414027209948e-5,-7.020106669410957e-8,0.004151754402958528,2.287579296648152e-5,-7.050582576156142e-8,0.004151898371708361,2.2974592076086222e-5,-7.070894000466604e-8,0.004151988885126911,2.2996670531363484e-5,-7.075363347500511e-8,0.004152058955955876,2.2928322974470473e-5,-7.061092750138042e-8,0.004152142382845093,2.2769356506527704e-5,-7.02799821925708e-8,0.0041522701226427315,2.253246200945357e-5,-6.978684571499767e-8,0.004152466791086021,2.2241707192617996e-5,-6.91812637823709e-8,0.004152747431065876,2.192983419561754e-5,-6.853098876725601e-8,0.004153115009949348,2.163416853510276e-5,-6.791329347391853e-8,0.004153559267504416,2.1391372281000134e-5,-6.740420502635174e-8,0.004154057371060857,2.1231670864169294e-5,-6.706668724391143e-8,0.004154576533781043,2.1173336928637963e-5,-6.693925978559595e-8,0.004155078480972005,2.121824985076246e-5,-6.702665399660066e-8,0.00415552544495053,2.1349266802329204e-5,-6.729405133405011e-8,0.004155887326128362,2.153005321203464e-5,-6.76663910045802e-8,0.004156149549489265,2.1708297200182368e-5,-6.803485371706521e-8,0.004156320429207047,2.18236504091612e-5,-6.827342868724723e-8,0.004156435436193511,2.1821325191162423e-5,-6.826745995209362e-8,0.004156554325266331,2.1670061717922965e-5,-6.795132318021076e-8,0.004156747395736589,2.137880483492358e-5,-6.734326680703699e-8,0.004157071827894007,2.100211751024774e-5,-6.655662407843876e-8,0.004157547507220719,2.0626045399976664e-5,-6.577030263586701e-8,0.004158146618620178,2.033725265562143e-5,-6.516458127082557e-8,0.0041588047435924405,2.0191197783449442e-5,-6.485500848833399e-8,0.00415944679960301,2.0196654226797564e-5,-6.486025586921148e-8,0.004160012347865569,2.0321627878139327e-5,-6.51143438105989e-8,0.004160468885463152,2.0512010737360385e-5,-6.550526134746365e-8,0.004160812154099564,2.071068901280456e-5,-6.591452917912113e-8,0.004161059067630895,2.087014425419266e-5,-6.624331294613351e-8,0.004161239040043181,2.095792204410952e-5,-6.642382604808944e-8,0.004161386829742425,2.095738077188751e-5,-6.642102047979822e-8,0.0041615375835493676,2.0866361049708102e-5,-6.622998144256762e-8,0.004161723445766619,2.069540030448162e-5,-6.587231810027344e-8,0.004161970833005958,2.0465957657424777e-5,-6.53924752623177e-8,0.004162297807662163,2.0208374532718804e-5,-6.485342857751e-8,0.004162711465524075,1.9958972538912966e-5,-6.433060157681065e-8,0.004163205788963567,1.9755721872438256e-5,-6.390289279020207e-8,0.004163760874885751,1.9632401292486634e-5,-6.364064398012052e-8,0.0041643445126078645,1.9611945515193513e-5,-6.359191191485507e-8,0.004164916661599382,1.9700370056451175e-5,-6.376982675484982e-8,0.004165436593260296,1.9883038081479463e-5,-6.414465536185601e-8,0.004165871533002719,2.0124840290481865e-5,-6.464389273479223e-8,0.004166204973161034,2.03750141868381e-5,-6.516203187808346e-8,0.0041664427071129,2.0576291719662896e-5,-6.557950750839939e-8,0.004166614831251215,2.067725739446178e-5,-6.578854573835485e-8,0.004166772201513261,2.064596860090837e-5,-6.572180046924913e-8,0.004166976394844767,2.0481684872547044e-5,-6.537706967734264e-8,0.004167283762105637,2.0220289969068403e-5,-6.482876722062341e-8,0.0041677270966903575,1.9928853053708316e-5,-6.42166276496646e-8,0.004168301889621721,1.9687639520167372e-5,-6.370817178698891e-8,0.004168964945397345,1.9564346141463034e-5,-6.344493463573707e-8,0.0041696482095524585,1.9591663234778752e-5,-6.349560115607152e-8,0.004170281928490304,1.975909669494271e-5,-6.383883261318782e-8,0.004170815776114936,2.002177562328637e-5,-6.438149484450375e-8,0.004171229165072177,2.0319307693815556e-5,-6.499787658365365e-8,0.004171529641595815,2.0594371506068787e-5,-6.556842529790701e-8,0.004171744205095692,2.08044574697309e-5,-6.600426377969002e-8,0.004171909319060356,2.0925909999591906e-5,-6.625570255367975e-8,0.004172063035543002,2.095283945319605e-5,-6.631007474738575e-8,0.004172240006446445,2.0893942567726186e-5,-6.618518936112582e-8,0.004172468631381149,2.0769185793469826e-5,-6.592244924085984e-8,0.00417276921141435,2.0606998287037323e-5,-6.558098507505531e-8,0.004173152263607924,2.044171213681954e-5,-6.523229587640529e-8,0.004173616699217774,2.0310521591751063e-5,-6.49539193513707e-8,0.004174148228173609,2.0249146804649307e-5,-6.482044670278411e-8,0.0041747190205534725,2.0285797724636808e-5,-6.489100076513135e-8,0.004175290038969232,2.043401685070224e-5,-6.519431780277011e-8,0.004175817138082009,2.0686286120805764e-5,-6.571531492271147e-8,0.004176260742955059,2.1011275247548487e-5,-6.638915896100802e-8,0.004176596947866172,2.135738903704526e-5,-6.710846106930013e-8,0.004176826283818876,2.1663316572518304e-5,-6.774516430718877e-8,0.004176976440504031,2.187329985370935e-5,-6.818241888125293e-8,0.004177097171342621,2.1952541600749897e-5,-6.834687461472092e-8,0.004177248393652027,2.1897850265493772e-5,-6.823110493770005e-8,0.004177484698447774,2.1740143881249863e-5,-6.789904756326871e-8,0.004177840456289382,2.153777152476557e-5,-6.74722389787032e-8,0.004178319648003268,2.1361956093379974e-5,-6.709951969906079e-8,0.004178893720907776,2.1277850737766288e-5,-6.69174602353876e-8,0.004179508920172153,2.1326593435868438e-5,-6.701273548062968e-8,0.00418010143870764,2.1514398644594126e-5,-6.739909921106913e-8,0.004180615325979776,2.181278040040501e-5,-6.801760816720763e-8,0.004181016588925626,2.2169477458321236e-5,-6.875930338309788e-8,0.004181298828271539,2.2524986894682156e-5,-6.949975199756988e-8,0.004181480040607371,2.282791399696808e-5,-7.013122390191389e-8,0.0041815939531634075,2.304443453220907e-5,-7.058260201965475e-8,0.004181680312312281,2.3160968578745368e-5,-7.082508197011263e-8,0.0041817771738139765,2.31820016723154e-5,-7.086767934850143e-8,0.004181916138040746,2.3125777208913207e-5,-7.074824050457918e-8,0.004182119981389813,2.301988109644779e-5,-7.052420786013162e-8,0.004182401587912403,2.2897560902910874e-5,-7.026493333350233e-8,0.004182763226082177,2.279464572132352e-5,-7.004528039888718e-8,0.004183195714757309,2.27463722411251e-5,-6.993905040066949e-8,0.0041836776903782045,2.2783245722880823e-5,-7.001037080800247e-8,0.004184175936522711,2.2925337371297516e-5,-7.030174363642383e-8,0.004184648351533992,2.3175376573468616e-5,-7.081948145094982e-8,0.00418505106926234,2.351265779926658e-5,-7.152078397866612e-8,0.00418534981740814,2.3891456557676195e-5,-7.231026107348822e-8,0.004185532699444083,2.4247798955379997e-5,-7.305402455302344e-8,0.0041856186975773695,2.4515523630203316e-5,-7.361333203789702e-8,0.004185656116733408,2.4647127383329684e-5,-7.388829334143641e-8,0.004185709463990267,2.4630561585255983e-5,-7.385309068068146e-8,0.004185839553237669,2.4494045601495442e-5,-7.356612233607162e-8,0.004186085175026919,2.4297013898756418e-5,-7.315119149276783e-8,0.004186453058714402,2.4111865678345753e-5,-7.275951997366621e-8,0.00418691819641979,2.4003918546233812e-5,-7.252797509274851e-8,0.004187432570247736,2.4015686123816057e-5,-7.254618294928173e-8,0.004187938527366445,2.4158751006996613e-5,-7.283932258420115e-8,0.00418838289655064,2.4413937365967342e-5,-7.336815666881627e-8,0.004188728513422404,2.4738606360928003e-5,-7.404399556996649e-8,0.00418896077263449,2.5078536869024493e-5,-7.475342352649681e-8,0.004189088187108331,2.5380979408035573e-5,-7.538568393181177e-8,0.004189137637378765,2.560542386655624e-5,-7.585541248978948e-8,0.004189146482758514,2.5729746333905715e-5,-7.611571356090715e-8,0.004189154226481784,2.5751295531856018e-5,-7.616056328669566e-8,0.004189195811872894,2.5684118435083626e-5,-7.601902615037475e-8,0.004189297432699497,2.55542284301067e-5,-7.574531169066045e-8,0.004189474640743976,2.539461358412779e-5,-7.54082984053367e-8,0.004189731923761839,2.5240920754474522e-5,-7.508253449426259e-8,0.004190062893369365,2.5127892543049684e-5,-7.484086743090381e-8,0.004190450577587119,2.508605327542561e-5,-7.474758404267058e-8,0.004190867863493793,2.5137902888573805e-5,-7.48504270355493e-8,0.004191278851066964,2.5293029167128904e-5,-7.517021445445091e-8,0.004191642553303303,2.55423836176811e-5,-7.568861108228818e-8,0.004191920429727899,2.585359199989586e-5,-7.633807975528864e-8,0.004192087961726734,2.6171043691637975e-5,-7.700197953776512e-8,0.0041921473996541884,2.6425138639552714e-5,-7.753404214212685e-8,0.004192134962329874,2.655208648022618e-5,-7.780007245043969e-8,0.004192114992464122,2.6518357750800253e-5,-7.772933711625707e-8,0.004192159595389882,2.6337159580545134e-5,-7.734907825665287e-8,0.0041923223662205,2.6066037508450072e-5,-7.677941655751047e-8,0.004192619875803577,2.578592305862587e-5,-7.618950486964727e-8,0.0041930293080447165,2.557321200031067e-5,-7.57392457018824e-8,0.004193500258489232,2.5478197525003033e-5,-7.553431849801728e-8,0.004193972401104941,2.5516253407646417e-5,-7.560771560475328e-8,0.004194391412284077,2.5670481527066318e-5,-7.592504671513956e-8,0.004194719476384159,2.5901118869691845e-5,-7.640387556528128e-8,0.004194939943894964,2.6157253045760205e-5,-7.693795310378307e-8,0.004195057196908215,2.6387965736528168e-5,-7.742045708403442e-8,0.004195093049339342,2.655137914482246e-5,-7.776307074307687e-8,0.0041950809049979216,2.662075619193178e-5,-7.790902792572845e-8,0.0041950589164355375,2.6587196549228087e-5,-7.783901651533447e-8,0.004195063418449753,2.6459035460426867e-5,-7.75700484300396e-8,0.004195123687424457,2.6258649342688074e-5,-7.714875237095379e-8,0.004195258624765763,2.6017731648806405e-5,-7.664139315682479e-8,0.0041954753979068695,2.5772178721423704e-5,-7.612311259338277e-8,0.004195769575099257,2.5557431308106203e-5,-7.566822001278618e-8,0.004196126138573454,2.540453466231477e-5,-7.534204817948078e-8,0.004196520954855405,2.53367037714102e-5,-7.51938225051339e-8,0.004196922622790946,2.5365966871741377e-5,-7.524954946219042e-8,0.004197295156724912,2.5489504985313087e-5,-7.550410520029874e-8,0.004197602564194241,2.5685951525308174e-5,-7.591317047680027e-8,0.004197816369561635,2.5913292788382522e-5,-7.638861304882352e-8,0.004197925960352721,2.6111518336327034e-5,-7.68040568734833e-8,0.004197949030411529,2.6213720596972247e-5,-7.701841069760118e-8,0.004197935777056729,2.6166841984154432e-5,-7.691972134593537e-8,0.004197959246279704,2.5955973534895593e-5,-7.647632694596954e-8,0.004198090449018128,2.561816100677808e-5,-7.576574198158926e-8,0.0041983690577137925,2.523320397695459e-5,-7.495518310321368e-8,0.00419878704502883,2.4893403872054307e-5,-7.423809664192561e-8,0.004199294657828197,2.466944744060831e-5,-7.37627848726335e-8,0.004199822567905109,2.4590529631573546e-5,-7.35909004360926e-8,0.004200305861270729,2.4644214422214637e-5,-7.369713717322046e-8,0.0042006995521685,2.478930388189759e-5,-7.399597656866322e-8,0.0042009837510207735,2.497203494463084e-5,-7.437531825774549e-8,0.004201161612568837,2.5139530804678885e-5,-7.472443695283559e-8,0.0042012538478359,2.524867550071118e-5,-7.495254886807737e-8,0.004201292331705662,2.527094607106964e-5,-7.49991216701699e-8,0.00420131393742547,2.5194311755950153e-5,-7.483814941996342e-8,0.004201354951284227,2.502295376661067e-5,-7.447781373617757e-8,0.0042014462866753815,2.4775206437341213e-5,-7.395626000164893e-8,0.004201609778427287,2.448005996210069e-5,-7.333420007618452e-8,0.004201855844869758,2.4172631007671907e-5,-7.268529378705414e-8,0.004202182698645817,2.3889171851144942e-5,-7.208562808425933e-8,0.004202577017310062,2.3662279170995062e-5,-7.160372968477706e-8,0.004203015758641201,2.351672818202007e-5,-7.129194406720078e-8,0.004203468829726377,2.3466037764782944e-5,-7.11792747736706e-8,0.004203902457944527,2.3509754658052647e-5,-7.126556074908164e-8,0.004204283346550584,2.3631449505063676e-5,-7.151698648158335e-8,0.004204584061959764,2.3797752657327603e-5,-7.186374646115213e-8,0.0042047900364866496,2.3959694992948275e-5,-7.22027000677904e-8,0.0042049075001769935,2.4058568751254713e-5,-7.240978381987185e-8,0.004204969667533672,2.4038460412971196e-5,-7.23666645880367e-8,0.004205036113172845,2.386531479855544e-5,-7.200115046387884e-8,0.004205179685910332,2.3546624248548318e-5,-7.132872503889457e-8,0.0042054607744250174,2.313929579412769e-5,-7.046897812798647e-8,0.00420589989798239,2.27347232082449e-5,-6.961404483515537e-8,0.004206466015888612,2.242427014344388e-5,-6.895601774624227e-8,0.004207089445384607,2.2264274521212205e-5,-6.861351443079364e-8,0.004207690765000283,2.2260358548173973e-5,-6.859880736537034e-8,0.004208207794816714,2.2375384589948536e-5,-6.883449347627073e-8,0.004208608832725967,2.2550256047354552e-5,-6.919700655526116e-8,0.004208892174623421,2.2724239908018644e-5,-6.955907850228315e-8,0.0042090782601795,2.284808125073127e-5,-6.981713891001085e-8,0.004209200296160906,2.2889691428958756e-5,-6.990328564693268e-8,0.004209296350094005,2.283492007234416e-5,-6.97870980120373e-8,0.004209403565906254,2.268592751806816e-5,-6.947247890090181e-8,0.004209554005893156,2.2458595057271006e-5,-6.899240475833879e-8,0.004209771538720962,2.2179411033598958e-5,-6.840241608206303e-8,0.00421006954601963,2.1881833085248087e-5,-6.777287276654248e-8,0.0042104495193963105,2.1602047665670182e-5,-6.717991814560981e-8,0.0042109008189892645,2.137421177667367e-5,-6.669544160393412e-8,0.004211401868604031,2.1225620883696596e-5,-6.637699983388579e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json
new file mode 100644
index 0000000..ea90103
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":25000,"numberOfSamples":1000,"samples":[0.0042119228229227776,2.117242668988509e-5,-6.625892772821196e-8,0.00421242951621424,2.1216421815835606e-5,-6.634559593072919e-8,0.004212888396602669,2.1343324948057996e-5,-6.660764965178544e-8,0.004213272077688695,2.1522955697259163e-5,-6.698208934125665e-8,0.004213565153061029,2.171164617537871e-5,-6.737707330135306e-8,0.004213769823711238,2.1857483451438128e-5,-6.768286051317844e-8,0.004213910198871436,2.190927122349849e-5,-6.779084064030356e-8,0.004214032922657624,2.1829493537962127e-5,-6.762116816618272e-8,0.004214200852587069,2.160938196621095e-5,-6.71548148810529e-8,0.004214477322022827,2.1280462370500936e-5,-6.645802296286292e-8,0.004214903100503305,2.091373094832423e-5,-6.568048925307495e-8,0.004215475880773675,2.0600151223130995e-5,-6.501412598684065e-8,0.004216145898744334,2.0417442948628495e-5,-6.462301093688222e-8,0.004216833579580056,2.0400376819345232e-5,-6.458079850055622e-8,0.004217459970123071,2.053157579362677e-5,-6.485132807375522e-8,0.004217972502130171,2.0755398012646987e-5,-6.531780445307867e-8,0.004218354775674382,2.100283844312381e-5,-6.583514699901046e-8,0.004218621473875984,2.1213061032032433e-5,-6.627523661803764e-8,0.004218806437975746,2.1344829856945014e-5,-6.655094448616457e-8,0.0042189509605779895,2.1378863630848206e-5,-6.662115374902181e-8,0.004219095409105211,2.1315105530184897e-5,-6.648517553484988e-8,0.004219274283414654,2.1168357298914947e-5,-6.617374421911176e-8,0.0042195135261831026,2.0964046864058137e-5,-6.574021509881736e-8,0.0042198289277669875,2.0734467344645254e-5,-6.52526270229363e-8,0.004220225061155502,2.0515161357874974e-5,-6.478598265567233e-8,0.004220694716869642,2.0341013243499278e-5,-6.441392136515793e-8,0.004221219187507694,2.024179213121955e-5,-6.419932023758131e-8,0.004221769966808666,2.0237378693578086e-5,-6.418431147260425e-8,0.0042223122778394,2.033346797221274e-5,-6.438129961003437e-8,0.004222810379006872,2.051879431947242e-5,-6.47670814186124e-8,0.0042232340746766765,2.0764877854194254e-5,-6.528213506219293e-8,0.004223565395287756,2.1029006330211313e-5,-6.583665389689409e-8,0.004223804128873946,2.1260585340412296e-5,-6.632374566900979e-8,0.004223970876957566,2.1410361180324564e-5,-6.663887945834917e-8,0.004224106369310762,2.14415465441151e-5,-6.670356203916723e-8,0.0042242657983087495,2.134115638552841e-5,-6.648957977625455e-8,0.004224507399419219,2.112855412696634e-5,-6.603731852191216e-8,0.004224876159364572,2.085686994094544e-5,-6.545888489491197e-8,0.004225386732174476,2.0603067839644234e-5,-6.491709513429656e-8,0.004226013160943935,2.0446027498544085e-5,-6.457905743766462e-8,0.004226693128151923,2.043932475634994e-5,-6.45585312505897e-8,0.004227347974683707,2.059163946791718e-5,-6.487440472016235e-8,0.004227909703767054,2.086563813515611e-5,-6.544822544194953e-8,0.004228341362829596,2.1195202646072075e-5,-6.614053530613902e-8,0.004228642402086946,2.1510125092377255e-5,-6.680302045077538e-8,0.004228840647210552,2.1755805619472572e-5,-6.732012834688552e-8,0.004228978598476052,2.190213346099413e-5,-6.762786101905045e-8,0.0042291010496863166,2.194302357527711e-5,-6.771287814009528e-8,0.0042292470592518745,2.1891133200885374e-5,-6.760145956889963e-8,0.004229446049571827,2.1771621167792976e-5,-6.73464393792848e-8,0.004229716468222322,2.1616855272094037e-5,-6.701607817399818e-8,0.004230065522044785,2.146232151279719e-5,-6.668539495546459e-8,0.004230489183412082,2.134317016838142e-5,-6.642880367863476e-8,0.004230972374903851,2.12906866823376e-5,-6.631261090471438e-8,0.004231489771832401,2.132821216102119e-5,-6.638640134078987e-8,0.00423200798906628,2.1466603019303647e-5,-6.667347585959588e-8,0.004232489876042049,2.1700112891328544e-5,-6.716214332465655e-8,0.004232901078212662,2.2004253231900497e-5,-6.780110661848243e-8,0.0042332180115707534,2.233735468493118e-5,-6.850259405413669e-8,0.004233435294041164,2.264690582136456e-5,-6.915558955274176e-8,0.004233570081750011,2.288024682846949e-5,-6.964836523197342e-8,0.004233661175459219,2.299740945877807e-5,-6.989570010663392e-8,0.00423376212210765,2.298272324126421e-5,-6.986362270031153e-8,0.004233929261141872,2.2851697779811398e-5,-6.958422181245012e-8,0.004234207211841524,2.2650495622957343e-5,-6.915475814576002e-8,0.004234615425259081,2.2446809897144912e-5,-6.871849564593151e-8,0.004235140014210337,2.231313047848069e-5,-6.842929415254376e-8,0.004235734703969059,2.230620625541042e-5,-6.840801170460767e-8,0.004236332511029088,2.2449320169543877e-5,-6.870475534746973e-8,0.004236865352914913,2.2724777630289437e-5,-6.928273029224622e-8,0.004237284245080581,2.3080599212484498e-5,-7.003223837757029e-8,0.004237571736415137,2.3448608166368112E-05,-7.080893495957507e-8,0.004237742342841121,2.3765484141766943e-5,-7.147847424023432e-8,0.004237833085799702,2.3988137660734125e-5,-7.194917126202141e-8,0.004237890189882673,2.4099447950975766e-5,-7.218425790080511e-8,0.004237957595590428,2.4105773514283147e-5,-7.219670738284095e-8,0.004238069919582637,2.4030269658422523e-5,-7.203516533111505e-8,0.004238249618365501,2.39056679238968e-5,-7.176871236223504e-8,0.004238506777009503,2.376842054507791e-5,-7.14744782604305e-8,0.004238839960336995,2.3654485763485328e-5,-7.122870298290076e-8,0.004239237195182148,2.359612316887198e-5,-7.109993006965748e-8,0.00423967689584437,2.3618836515735366e-5,-7.114251881836275e-8,0.00424012919339875,2.3737839999153642e-5,-7.138914208350213e-8,0.004240558555859129,2.3954028829091893e-5,-7.184219988672258e-8,0.004240928632216016,2.425035359666654e-5,-7.246603747851151e-8,0.004241209686151803,2.4590515496345863e-5,-7.31840475098621e-8,0.004241387602314709,2.4922420371615704e-5,-7.388587732093796e-8,0.00424147157146284,2.5187961743731242e-5,-7.44481247159738e-8,0.004241496426214619,2.5338027012562994e-5,-7.476619148263978e-8,0.004241516665120159,2.53481927416961e-5,-7.478765248745461e-8,0.004241592614544567,2.5228750538790737e-5,-7.453362965654456e-8,0.004241773093309497,2.5024267468472517e-5,-7.409800415341168e-8,0.004242080828456248,2.480219962828495e-5,-7.362345063271682e-8,0.004242505642303187,2.463448176734963e-5,-7.326256531566072e-8,0.004243007230734643,2.4578174120876555e-5,-7.313688342900408e-8,0.004243526169055569,2.4660842178798045e-5,-7.330574786416262e-8,0.004243999680967984,2.4874463362710607e-5,-7.375310120416703e-8,0.0042443776570801894,2.5179193207145155e-5,-7.439515440950807e-8,0.004244634361830328,2.551555261019759e-5,-7.510602778954726e-8,0.0042447725833558445,2.5820973313206575e-5,-7.575282082432305e-8,0.004244819645713096,2.6045265557054406e-5,-7.622855268466984e-8,0.004244817657500771,2.6160427534331055e-5,-7.647316726976563e-8,0.004244812063322777,2.6162998914343238e-5,-7.647870316326475e-8,0.004244842201737484,2.6070232563465724e-5,-7.628128320228887e-8,0.004244935733735506,2.5913058455968382e-5,-7.594622609168704e-8,0.004245106822619801,2.572872050475992e-5,-7.555241538069889e-8,0.004245356804103788,2.5554802441117856e-5,-7.517960510152853e-8,0.004245675934005867,2.5425040582432493e-5,-7.48995353162313e-8,0.004246045266184226,2.53664067068817e-5,-7.47697603900719e-8,0.004246438382144604,2.5396616745149382e-5,-7.482836234073875e-8,0.004246823330043397,2.552139706651534e-5,-7.508808847131201e-8,0.004247165619004974,2.5731389115804212e-5,-7.55296442638736e-8,0.004247433275937945,2.5999499171301278e-5,-7.609589214748047e-8,0.0042476044631466715,2.6280705900143398e-5,-7.669131102787287e-8,0.004247676613223559,2.6517177808645175e-5,-7.719284879324458e-8,0.004247673609435171,2.6650746595202952e-5,-7.747651982304646e-8,0.004247645708001549,2.66412350943042e-5,-7.74564776254694e-8,0.004247658309913079,2.6483856580341366e-5,-7.712204781528955e-8,0.004247771456591539,2.6216061034290582e-5,-7.655226898516179e-8,0.004248018640476505,2.590800755606473e-5,-7.589568494417051e-8,0.004248395212570714,2.563994069145496e-5,-7.532244221725396e-8,0.004248861259489376,2.5477021622606432e-5,-7.497104067998361e-8,0.00424935590167607,2.5452038700586148e-5,-7.491170753332291e-8,0.004249815624233812,2.5560514080836893e-5,-7.513587325912593e-8,0.0042501900081495896,2.5766672608186727e-5,-7.556853344785969e-8,0.004250451383611506,2.6015861961209102e-5,-7.609427999654669e-8,0.0042505977356969114,2.6248914551540066e-5,-7.658758795271883e-8,0.0042506498090625795,2.6415031884901112e-5,-7.694017883491166e-8,0.004250644097952955,2.648096828203765e-5,-7.708071584908982e-8,0.0042506237812728765,2.6435303290169302e-5,-7.698415129034421e-8,0.004250629816343292,2.6287691938557887e-5,-7.667036324682085e-8,0.0042506940711203485,2.6064200669597658e-5,-7.619435383064163e-8,0.00425083548128867,2.5800616341765846e-5,-7.563201480582007e-8,0.004251059186062351,2.5535598231431913e-5,-7.506549954746807e-8,0.004251357853991461,2.5304981396812947e-5,-7.457106386619228e-8,0.004251714123475805,2.5137752884505912e-5,-7.421052674232194e-8,0.004252103288002902,2.5053445751813735e-5,-7.402578044122805e-8,0.0042524958808914486,2.5060282096586535e-5,-7.403485203242214e-8,0.004252860347046862,2.5153483119387155e-5,-7.422821487858902e-8,0.004253166420302202,2.5313592833064807e-5,-7.4565027741937e-8,0.004253390056795452,2.5505445065978426e-5,-7.497072826604751e-8,0.004253520373611728,2.567954717105097e-5,-7.533987563241299e-8,0.004253567583483577,2.5778553226866115e-5,-7.555000192971296e-8,0.004253568477479618,2.57508981459835e-5,-7.549083696491824e-8,0.004253583802551681,2.5570092233629636e-5,-7.51055603806773e-8,0.004253683035294351,2.5251865633977112e-5,-7.44273175308893e-8,0.0042539191944363595,2.4857202588394434e-5,-7.35855734003273e-8,0.004254305764216735,2.447438286380503e-5,-7.276784994537231e-8,0.004254809815918776,2.4186839495990022e-5,-7.215147164839955e-8,0.004255365549942023,2.40441206534225e-5,-7.184200794898621e-8,0.004255899200387112,2.4050089820884473e-5,-7.184826829956902e-8,0.0042563516080044266,2.416972185021108e-5,-7.209662433728606e-8,0.004256690396141003,2.434605252160264e-5,-7.246675786316027e-8,0.0042569115892744334,2.4517943449023026e-5,-7.282912443145628e-8,0.0042570344588616455,2.463347637775471e-5,-7.30732558512375e-8,0.0042570934805204125,2.465775417313392e-5,-7.312438614433928e-8,0.004257129932313604,2.4575925834567138e-5,-7.295011734563332e-8,0.0042571843494951115,2.4392667825468296e-5,-7.255962537821784e-8,0.00425729039774817,2.4129023933815476e-5,-7.199717208281165e-8,0.004257470606229811,2.3817370327804808e-5,-7.133146006679518e-8,0.004257734255741909,2.349544247400287e-5,-7.064283667735547e-8,0.004258077393204028,2.3200390137071024e-5,-7.001050679824002e-8,0.004258484618862725,2.2963666553012255e-5,-6.950158216921607e-8,0.004258932027056634,2.2807293789006354e-5,-6.916316297269846e-8,0.0042593906153518026,2.2741586385370254e-5,-6.901757022449099e-8,0.0042598297434363165,2.276399055898611e-5,-6.905989169541386e-8,0.004260220606168873,2.2858651267932304e-5,-6.925694232532747e-8,0.004260539991874552,2.2996585299082128e-5,-6.954740578872719e-8,0.004260774793749827,2.3136869567961894e-5,-6.984415171021355e-8,0.004260927452055153,2.3230106921002925e-5,-7.004155848425731e-8,0.004261021309681241,2.3226075701983406e-5,-7.003196358517582e-8,0.004261102938290243,2.308688722779646e-5,-6.9733984200722e-8,0.004261236712509181,2.2804045770392858e-5,-6.912910597515336e-8,0.004261487734137989,2.2412204909363093e-5,-6.829103484152083e-8,0.004261895857940792,2.1987951130290533e-5,-6.738297115674651e-8,0.004262453748847359,2.1626559517556065e-5,-6.660796308383029e-8,0.004263104835077354,2.14049565306401e-5,-6.613002381831203e-8,0.004263765230072934,2.1352073118542486e-5,-6.601108302348439e-8,0.004264356348996169,2.14434400684497e-5,-6.619951822339648e-8,0.00426482929740014,2.1618744627758198e-5,-6.656745990661841e-8,0.004265171943391067,2.1807560186110623e-5,-6.696539410340849e-8,0.004265402331610535,2.194966411597293e-5,-6.726522140368924e-8,0.004265556764276095,2.2005321336605362e-5,-6.738204521109695e-8,0.004265678484351986,2.1957407300082035e-5,-6.727876331639272e-8,0.004265809259589074,2.1808924150594526e-5,-6.696101507231523e-8,0.004265983904005325,2.1578682448027443e-5,-6.646826954849454e-8,0.004266226920993157,2.1296504146896058e-5,-6.586379168206377e-8,0.004266550629286272,2.0998265292050864e-5,-6.522408289024045e-8,0.004266954602654954,2.072086530767614e-5,-6.46280184319503e-8,0.0042674264408546,2.0497353315112702e-5,-6.414629674705478e-8,0.004267943861511287,2.0352576012947905e-5,-6.383209365453901e-8,0.004268477960877023,2.0299833661802612e-5,-6.371398436365584e-8,0.004268997253092252,2.0338959047789847e-5,-6.379193925228933e-8,0.004269472004022922,2.0455923406950072e-5,-6.403649435074647e-8,0.004269878504480831,2.0623872099556896e-5,-6.439082513227808e-8,0.004270203091943123,2.0805512560485156e-5,-6.477560803074754e-8,0.004270445852852126,2.0956944805511876e-5,-6.509700275244613e-8,0.004270623800199121,2.10334314266037e-5,-6.525895403540025e-8,0.004270772558072353,2.0997890319405713e-5,-6.518152289098647e-8,0.00427094441011345,2.083220432249813e-5,-6.482534637528951e-8,0.004271199798210908,2.05492416329248e-5,-6.421755267416815e-8,0.00427159041645784,2.0199863007888447e-5,-6.346677840095314e-8,0.004272137010630017,1.986641311092636e-5,-6.274914812415897e-8,0.004272812866192905,1.9637907019181664e-5,-6.225512618287865e-8,0.004273546661830289,1.957484111226967e-5,-6.211428300886088e-8,0.004274248084309201,1.9683554754882735e-5,-6.234052528862284e-8,0.004274842584556,1.9916585609271047e-5,-6.283284863669002e-8,0.004275294989396107,2.0196932839426866e-5,-6.34271221447608e-8,0.004275612111248886,2.044876157713103e-5,-6.396157774097112e-8,0.004275829854443942,2.0618302854561106e-5,-6.432132893338302e-8,0.004275996344867708,2.068048102350494e-5,-6.445246254988373e-8,0.004276158761153353,2.0635703336763096e-5,-6.435525871581819e-8,0.00427635575964747,2.050278681984088e-5,-6.406929194779216e-8,0.004276614264766545,2.03118344130943e-5,-6.365844604760266e-8,0.004276948681532183,2.0098462742130343e-5,-6.319870838452115e-8,0.00427736112987467,1.9899240304877655e-5,-6.276838480380487e-8,0.004277842211255956,1.974773290141609e-5,-6.243949971073313e-8,0.004278372391904025,1.967077619426468e-5,-6.226968673760751e-8,0.004278924276628769,1.9684968915617704e-5,-6.229464867897638e-8,0.00427946603046503,1.9793798937027695e-5,-6.252207128612635e-8,0.004279965907331355,1.9986115124125946e-5,-6.292842834492383e-8,0.004280397398965965,2.0236567080278434e-5,-6.345990398536185e-8,0.004280744247696593,2.0508303055502708e-5,-6.403801521126411e-8,0.004281004505802116,2.075787626038736e-5,-6.45698971255669e-8,0.004281192901995228,2.0941958152062637e-5,-6.496252518206134e-8,0.004281340930710332,2.1025255578912166e-5,-6.513969573609285e-8,0.004281494037741554,2.0988991621400003e-5,-6.506040387677097e-8,0.004281705020143845,2.083884172795236e-5,-6.473613988226346e-8,0.004282022932066112,2.0609966237029076e-5,-6.424190093837948e-8,0.004282478182800925,2.0365345667199266e-5,-6.371269223823294e-8,0.004283067616495902,2.018344302717714e-5,-6.331700549222439e-8,0.004283747241477742,2.0134651144824004e-5,-6.320619458649664e-8,0.0042844407554519515,2.0253973496551404e-5,-6.345578723847007e-8,0.004285064598384449,2.0524555265033713e-5,-6.403009214368057e-8,0.004285558228008341,2.0883667246896797e-5,-6.479498002189184e-8,0.004285903068305841,2.1248575485531713e-5,-6.557331881327865e-8,0.004286121591209917,2.1546759971092086e-5,-6.620971443688664e-8,0.004286261550244254,2.173512138139228e-5,-6.661161891835543e-8,0.004286377010822107,2.1803562222643158e-5,-6.675698118613891e-8,0.004286514639174886,2.1767962224157696e-5,-6.667927461907289e-8,0.004286707249844844,2.1659831340824737e-5,-6.644549978914754e-8,0.004286972651294204,2.1517288514130502e-5,-6.613702981233638e-8,0.004287315036407035,2.137879459328305e-5,-6.583625969488997e-8,0.004287726996196279,2.1279125575024203e-5,-6.561792724729806e-8,0.00428819142343141,2.1246497524740444e-5,-6.554282703858169e-8,0.004288683412819257,2.1300005175710134e-5,-6.56522121072733e-8,0.004289172646002349,2.144705325197606e-5,-6.596225331674356e-8,0.004289626831671317,2.1681083267848825e-5,-6.64591918001667e-8,0.004290016489747565,2.1980505883871905e-5,-6.709706780234995e-8,0.0042903207017423875,2.2309974166205005e-5,-6.780039689973465e-8,0.004290532704681695,2.2624802256956494e-5,-6.847351420232322e-8,0.004290663720481053,2.2878545281189634e-5,-6.901668815447957e-8,0.004290743428588021,2.3032647343331645e-5,-6.934675430215987e-8,0.004290816160740989,2.3066060527652307e-5,-6.941783186631997e-8,0.004290932973482719,2.298241860165485e-5,-6.923692897416443e-8,0.004291140720082246,2.281268438762679e-5,-6.886989001401675e-8,0.004291469988513568,2.261171092999127e-5,-6.843422945885471e-8,0.0042919245712092595,2.244789438370406e-5,-6.807700264279899e-8,0.004292475971297328,2.238658804783379e-5,-6.793912075922681e-8,0.004293066649609138,2.2470558774809148e-5,-6.811318501504072e-8,0.004293623937526895,2.2703998892035536e-5,-6.860890598586648e-8,0.0042940818493636184,2.304812006375384e-5,-6.934344898792616e-8,0.004294402362672422,2.3432831436448893e-5,-7.016645002765099e-8,0.004294586104386337,2.378055743966283e-5,-7.091121590795328e-8,0.004294667795317409,2.4030920659155234e-5,-7.144780929009046e-8,0.004294700566059802,2.4155324165777983e-5,-7.171440891510901e-8,0.004294738209100082,2.4157840931771394e-5,-7.171925710040148e-8,0.0042948226573763385,2.4066452881318333e-5,-7.152192906009953e-8,0.004294978812281802,2.3921337639631674e-5,-7.120830502904449e-8,0.004295214901080934,2.3765000948817973e-5,-7.08694876550506e-8,0.004295525436407369,2.363587044291823e-5,-7.058807624485363e-8,0.004295894601684546,2.3564786623837452E-05,-7.04305813207749e-8,0.004296299122201778,2.357308522950433e-5,-7.044321503200956e-8,0.004296710657229467,2.367115187319423e-5,-7.064870539544668e-8,0.004297098295590391,2.38568917503796e-5,-7.104295898373251e-8,0.004297431906932636,2.4114275885103977e-5,-7.159190498213205e-8,0.004297686870625992,2.4412901902798002e-5,-7.223050607165677e-8,0.004297849991681794,2.4710049162891303e-5,-7.286710575334312e-8,0.00429792530231652,2.4956591162591826e-5,-7.339606327152146e-8,0.004297937372396556,2.5107015043400802e-5,-7.371925088269417e-8,0.004297929510021779,2.5131737805527713e-5,-7.377254984435431e-8,0.004297955548234345,2.5027789983162344e-5,-7.354890403274291e-8,0.004298066575615005,2.4823310836198834e-5,-7.310812995376074e-8,0.004298296552607654,2.4573070322224938e-5,-7.256747872959403e-8,0.004298651648983001,2.434559188780995e-5,-7.207413756368472e-8,0.004299106911661393,2.4205518413300738e-5,-7.176741926718479e-8,0.004299611453430702,2.4196312655059432e-5,-7.174150839999789e-8,0.0043001009376553104,2.4328171010078167e-5,-7.201924724959771e-8,0.004300514215980978,2.45747458074727e-5,-7.254478183774332e-8,0.00430080955408668,2.4880164403869278e-5,-7.319841098782959e-8,0.00430097535914321,2.5174795560467062e-5,-7.383040760602065e-8,0.004301031639911904,2.5394822709818133e-5,-7.430318462394381e-8,0.004301021854896047,2.549876742515806e-5,-7.452698087324046e-8,0.004300998826632299,2.5475424898201563e-5,-7.447707677090092e-8,0.0043010105133326326,2.5341837209243172e-5,-7.418955573869462e-8,0.00430109035070397,2.513426620792213e-5,-7.374198268112992e-8,0.004301253742716078,2.48970164755011e-5,-7.32294267491531e-8,0.004301499427306543,2.467299592201586e-5,-7.274417707510015e-8,0.0043018132999952385,2.4497627550464064e-5,-7.236262240548909e-8,0.004302172657874503,2.4395814589290057e-5,-7.213867310051331e-8,0.004302549817683467,2.4380785913499932e-5,-7.210122313442096e-8,0.0043029149958991805,2.44536492446394e-5,-7.225313252007961e-8,0.004303238964457443,2.460296377691644e-5,-7.2570238773880585E-08,0.00430349625434463,2.4804348391217722e-5,-7.300042578258291e-8,0.0043036695281246816,2.50209511462533e-5,-7.34645445614565e-8,0.0043037550770795956,2.5206324498041653e-5,-7.386254745634518e-8,0.004303768148276709,2.5311391686062272e-5,-7.408849797523384e-8,0.004303745290754547,2.5296058710614142e-5,-7.405564302472968e-8,0.0043037402219377715,2.5143263129179642e-5,-7.372674513257676e-8,0.004303811401843918,2.486984655474745e-5,-7.31375476237472e-8,0.004304003924871586,2.452738717704159e-5,-7.239861410051003e-8,0.004304332998053507,2.4189634346796077e-5,-7.166837537127397e-8,0.004304777053220583,2.3930305794275484e-5,-7.110548942813876e-8,0.0043052839373079,2.380055815885997e-5,-7.082046368346776e-8,0.004305786979287081,2.381512406074437e-5,-7.084577599968396e-8,0.004306223908680077,2.3950918898359302e-5,-7.113265222969439e-8,0.0043065521824008435,2.4156359154944985e-5,-7.157081214482665e-8,0.00430675720105395,2.4366745878058644e-5,-7.202132826384251e-8,0.00430685272341944,2.452074994873828e-5,-7.235202054839195e-8,0.0043068746876313785,2.457397362237289e-5,-7.246674040986775e-8,0.004306870807432403,2.450692094765032e-5,-7.232274420159353e-8,0.0043068889333198876,2.4326274108967804e-5,-7.193368553734489e-8,0.004306967157178836,2.4060115372153373e-5,-7.135951482856131e-8,0.004307127792060001,2.3749312473508598e-5,-7.068800846487233e-8,0.004307375847549257,2.3437998378882705e-5,-7.001424126954424e-8,0.0043077011487614265,2.316559033074148e-5,-6.942331161839482e-8,0.004308082476774727,2.296156998550824e-5,-6.897901648309085e-8,0.004308492160407662,2.2843008936849732e-5,-6.871848008341235e-8,0.00430890014225028,2.2814028032551207e-5,-6.865098180169714e-8,0.004309277281921247,2.2866200020617407e-5,-6.875880227967708e-8,0.004309598220494261,2.2979234337591817e-5,-6.899862356038913e-8,0.004309844408536244,2.3121853538730567e-5,-6.930329429478826e-8,0.0043100078615668095,2.3253479651415424e-5,-6.95853524949172e-8,0.004310095640386761,2.3328083445441076e-5,-6.974529757037752e-8,0.0043101338257101485,2.3301787131791224e-5,-6.968807200575135e-8,0.004310168187241177,2.3144787924465443e-5,-6.934892854607553e-8,0.004310257826444425,2.285531683637069e-5,-6.872365125157918e-8,0.004310459684221365,2.2469228310805165e-5,-6.788925321183882e-8,0.0043108073193948325,2.2056750050369026e-5,-6.699692997284909e-8,0.004311294032439131,2.170255209789584e-5,-6.622910378436072e-8,0.004311871307369093,2.1476062378587954e-5,-6.573553756794064e-8,0.004312465198993063,2.1407057452158824e-5,-6.558081946270183e-8,0.004313001977162613,2.147859710794636e-5,-6.572910476913147e-8,0.00431343005920553,2.1637960989153616e-5,-6.606750631843108e-8,0.004313730316577628,2.181691089414023e-5,-6.644950764688654e-8,0.004313914738250244,2.1951418489715036e-5,-6.673726332891451e-8,0.004314017860593639,2.1995240270097538e-5,-6.6830778021755e-8,0.00431408563427076,2.1926188546349096e-5,-6.668152880876458e-8,0.004314164844430976,2.1746350005664837e-5,-6.62931915957548e-8,0.00431429466372932,2.1478088191753095e-5,-6.571331506627689e-8,0.004314501024681896,2.1157447735519515e-5,-6.501929657323107e-8,0.004314794068269408,2.0826407239506826e-5,-6.430170217264929e-8,0.004315168523400873,2.0525388218328684e-5,-6.364798919827755e-8,0.00431560642180513,2.0287173353931803e-5,-6.31292183912412e-8,0.0043160812455876356,2.0132909454777427e-5,-6.279132138753954e-8,0.004316562520177888,2.007033177327738e-5,-6.265126152698634e-8,0.00431702006617794,2.00938082788825e-5,-6.269717769742918e-8,0.004317427588706235,2.018551638500187e-5,-6.28909388180351e-8,0.004317765712734754,2.0317234227004703e-5,-6.317193328846631e-8,0.004318024775138963,2.0452628316515763e-5,-6.34618604024906e-8,0.00431820770093002,2.0550394730606987e-5,-6.367139110618334e-8,0.004318332893899484,2.0569188001987255e-5,-6.371081436092053e-8,0.004318436011644906,2.04754635624101e-5,-6.350712260775898e-8,0.0043185681789404615,2.0254385622796044e-5,-6.302778494565895e-8,0.004318787523787666,1.9921423273137004e-5,-6.230594134708772e-8,0.004319142414166795,1.9528518015015e-5,-6.145372829533996e-8,0.004319650180655444,1.9156534321257355e-5,-6.064588141621515e-8,0.004320282432594846,1.8890460254098007e-5,-6.006610839445816e-8,0.00432096924731175,1.8786257539194468e-5,-5.983551079099197e-8,0.004321623889974825,1.8848028753740572e-5,-5.996331107102821e-8,0.004322174856199251,1.9029232241916958e-5,-6.03494594472305e-8,0.004322587553187694,1.9254995930678356e-5,-6.083272565155132e-8,0.004322867520357473,1.9450265918529555e-5,-6.125132934634046e-8,0.004323049667978551,1.956007946768571e-5,-6.148655784160723e-8,0.004323182862961931,1.9557648041747735e-5,-6.148015369528662e-8,0.004323316556168647,1.9443050480583164e-5,-6.123159791433297e-8,0.004323491840940722,1.9237131005163212e-5,-6.0785188942898e-8,0.004323736659978244,1.8974013586600857e-5,-6.021415798447603e-8,0.00432406401637427,1.8693883726101143e-5,-5.960523413418266e-8,0.004324472264424686,1.8436553474490432e-5,-5.904470094336049e-8,0.004324946983099295,1.8236033860153257e-5,-5.860648003866715e-8,0.004325464084859797,1.811635649105119e-5,-5.8342897748555724e-8,0.004325993794135984,1.8088868183602328e-5,-5.8278740560323874e-8,0.004326505053826906,1.8151193617222837e-5,-5.84090469392405e-8,0.004326969827564337,1.8287871460248693e-5,-5.870057233852731e-8,0.004327366867667058,1.8472348280178974e-5,-5.909613070587311e-8,0.004327684784604043,1.8669955227489085e-5,-5.952094345795759e-8,0.004327924409123366,1.8841706401499647e-5,-5.989069354469142e-8,0.004328100446453682,1.8948978694444737e-5,-6.012153384588638e-8,0.004328242207755195,1.8959396499784854e-5,-6.014285604854431e-8,0.00432839251061342,1.8854306712077532e-5,-5.991366270790545e-8,0.004328602976287375,1.8637363771232864e-5,-5.9441399495521534e-8,0.004328923808193235,1.834172061702968e-5,-5.879768517306489e-8,0.0043293877420519525,1.803074398317214e-5,-5.8119858923673065e-8,0.004329992303019424,1.7786082973530267e-5,-5.7585025996974733e-8,0.0043306904239555155,1.768141014178147e-5,-5.735306902442807e-8,0.004331400140317573,1.7751344357086818e-5,-5.749928204325917e-8,0.00433203358321681,1.797402614272783e-5,-5.79766211094402e-8,0.004332530332663138,1.828016466901793e-5,-5.8635303908857e-8,0.004332875915402321,1.858298602165903e-5,-5.928765562337491e-8,0.00433309804217549,1.8810034258350935e-5,-5.977689798049865e-8,0.004333248483983109,1.8921204984793378e-5,-6.001607106531904e-8,0.00433338344031064,1.891050947589809e-5,-5.999178553599807e-8,0.004333550076056095,1.879802272931174e-5,-5.974688447449809e-8,0.00433378028617974,1.8619161178224815e-5,-5.935746777534596e-8,0.004334089547866698,1.841532739235039e-5,-5.891288378805079e-8,0.004334478361386218,1.8227051919153682e-5,-5.8500987248132956e-8,0.004334934676237755,1.8089192813388756e-5,-5.819765687811798e-8,0.004335436753461419,1.8027479513569926e-5,-5.805910095808496e-8,0.0043359564346629785,1.805604332199269e-5,-5.8116315662884676e-8,0.004336462854060841,1.8175905259323786e-5,-5.837173979925861e-8,0.0043369265589401195,1.8374650843245116e-5,-5.8798606028170783e-8,0.0043373237749320314,1.8627644789034814e-5,-5.9343665372251605e-8,0.004337640287689868,1.8900903887741546e-5,-5.993342885257249e-8,0.004337874393414731,1.915541028175581e-5,-6.0483416036833585E-08,0.004338038508031595,1.935252810257927e-5,-6.090974291052553e-8,0.004338159117798005,1.9460134108828392e-5,-6.114232980148806e-8,0.004338274774933433,1.9459013263327866e-5,-6.113884811203717e-8,0.004338431681466829,1.9348999136279857e-5,-6.089826911602292e-8,0.004338676165081497,1.9153806772625883e-5,-6.047161761109011e-8,0.004339043688685932,1.8922294391678095e-5,-5.996487910391701e-8,0.004339545635601907,1.872276095381814e-5,-5.952661815361361e-8,0.004340158161930944,1.8627380820978457e-5,-5.9314042383671195e-8,0.004340820587457169,1.8688023122385006e-5,-5.944030774359304e-8,0.0043414499059315215,1.8912570225124942e-5,-5.992294543545765e-8,0.004341969354982378,1.9256317958197064e-5,-6.066513104038634e-8,0.00434233727438235,1.963727956575248e-5,-6.148895689362684e-8,0.004342559700425284,1.9968375421524345e-5,-6.22053917653275e-8,0.004342681194553419,2.0187890581981525e-5,-6.268039485374884e-8,0.004342762928135588,2.0273446998614515e-5,-6.286515201466919e-8,0.004342861762115175,2.0238340874590014e-5,-6.278807051788223e-8,0.0043430181177510525,2.0118621313219873e-5,-6.25268278416331e-8,0.004343252686041884,1.9959504096147545e-5,-6.217910056180777e-8,0.004343568466291725,1.9805367104343365e-5,-6.184105171446118e-8,0.004343954731686096,1.9693836953182042e-5,-6.159455561595036e-8,0.004344390973704534,1.9652723436851773e-5,-6.150043408182522e-8,0.004344850331140559,1.969838524407601e-5,-6.159471002910778e-8,0.004345302792489047,1.9834740731576415e-5,-6.188629404236862e-8,0.004345718569954192,2.0052786388798823e-5,-6.235588467085406e-8,0.004346071890108299,2.0330942481172956e-5,-6.295676357140448e-8,0.004346345120939216,2.0636843362656404e-5,-6.361874562488397e-8,0.004346532649407227,2.0931092520010435e-5,-6.425633112670948e-8,0.004346643556812209,2.1172987348254808e-5,-6.478105282775598e-8,0.004346702139067369,2.1327622981692872e-5,-6.511679997367014e-8,0.004346745608778673,2.137326837845882e-5,-6.521581332631904e-8,0.004346818808370958,2.130755124320618e-5,-6.507223672428581e-8,0.004346966320702236,2.1150975510158874e-5,-6.472999399619078e-8,0.004347222824520035,2.0946473775532036e-5,-6.428207114555517e-8,0.004347603087958219,2.0753784072168932e-5,-6.385844812624413e-8,0.004348093942432825,2.0637814013072452e-5,-6.36007815326696e-8,0.004348651739160019,2.0651659508830847e-5,-6.36252925003523e-8,0.0043492091234758985,2.0818025289423062e-5,-6.398208836552688e-8,0.004349692649033529,2.1116545144798856e-5,-6.462735152225057e-8,0.004350046851532632,2.148558579412229e-5,-6.542717677117046e-8,0.004350254077818288,2.1841590704683874e-5,-6.619972247540033e-8,0.004350339218690546,2.2108334127427978e-5,-6.677897296497183e-8,0.0043503570289232605,2.2241363549602545e-5,-6.706795464383658e-8,0.004350370300956235,2.2236598604831392e-5,-6.705740408002692e-8,0.004350430646805905,2.2122994339245096e-5,-6.680980212150948e-8,0.004350568672542956,2.1947338186704e-5,-6.642641374111236e-8,0.004350793241612556,2.1759652050497017e-5,-6.601571687264844e-8,0.0043510958731244245,2.1603418432720286e-5,-6.567227801223937e-8,0.004351456464205779,2.1510811396030194e-5,-6.546638399293138e-8,0.004351848247956533,2.1501213936502228e-5,-6.544069492800358e-8,0.004352241536665431,2.1581184167779784e-5,-6.560999904068952e-8,0.00435260671995346,2.174478040527643e-5,-6.596178678053824e-8,0.004352917203110646,2.1974004373243897e-5,-6.645716600620018e-8,0.004353152776554337,2.2239771173006768e-5,-6.70329889115276e-8,0.0043533034557195595,2.250423557099356e-5,-6.760694213289382e-8,0.004353373159793762,2.2725320394767957e-5,-6.808739588456914e-8,0.004353381934028024,2.2863721397970617e-5,-6.838860655220757e-8,0.004353365144473504,2.2891593869259356e-5,-6.844958399294913e-8,0.004353368520464555,2.2800891768739177e-5,-6.825225963723115e-8,0.004353439178980252,2.2608536352457108e-5,-6.783284315230564e-8,0.004353614398994551,2.235592337679717e-5,-6.728093363331758e-8,0.004353911091254241,2.210179351953395e-5,-6.672420060605343e-8,0.004354319093981324,2.1909457854221882e-5,-6.63007028625976e-8,0.00435480070535855,2.183105798865961e-5,-6.612459579585697e-8,0.004355297564439238,2.1892701313526038e-5,-6.62535720399581e-8,0.004355744274261172,2.208486894760374e-5,-6.666768156040473e-8,0.004356085988373349,2.2362140804206785e-5,-6.72684784304803e-8,0.004356294790867451,2.265429960519879e-5,-6.790310472655907e-8,0.004356378446729466,2.2886711643210605e-5,-6.840875002736263e-8,0.004356377083974059,2.300287959510685e-5,-6.866191818023424e-8,0.004356348835649946,2.2979906602058662e-5,-6.861222380829316e-8,0.004356351070803769,2.283100298627068e-5,-6.828791603511024e-8,0.0043564253033482265,2.2596103437619816e-5,-6.777550831067574e-8,0.004356590438485916,2.232692894571213e-5,-6.71873398673657e-8,0.004356843977258533,2.207328036231141e-5,-6.663181407464889e-8,0.00435716773989199,2.1874255200302816e-5,-6.619429149558181e-8,0.0043575345277402245,2.17545974438534e-5,-6.592907552880914e-8,0.00435791364940389,2.1724473774609717e-5,-6.585880479157714e-8,0.004358274835255978,2.1780736857639492e-5,-6.597708420358102e-8,0.00435859102021611,2.190842428008057e-5,-6.625166759485598e-8,0.004358840788105637,2.2082124326210005e-5,-6.66273960160543e-8,0.004359011140673432,2.2267590761594875e-5,-6.702970759557112e-8,0.004359100770459174,2.2424521416654e-5,-6.737069654700543e-8,0.0043591232349589806,2.2511572931629804e-5,-6.756005138998922e-8,0.004359108521787183,2.2494178942973776e-5,-6.752211476792377e-8,0.004359100878157092,2.235434252364082e-5,-6.721725820444066e-8,0.004359151203790916,2.209952344550378e-5,-6.666129656422452e-8,0.004359304391648528,2.1766202486049173e-5,-6.59333189575158e-8,0.004359585156155929,2.141440124607869e-5,-6.516384241477555e-8,0.004359988028082468,2.1112991988769316e-5,-6.450292098818624e-8,0.004360476321122433,2.0920264451710092e-5,-6.407788779132097e-8,0.004360991139310915,2.0866833130000284e-5,-6.395608344448584e-8,0.0043614672632936585,2.094691373648151e-5,-6.412567446990825e-8,0.00436185047259702,2.1120373710730043e-5,-6.449986452881506e-8,0.004362111124733698,2.1324180464702604e-5,-6.4941620161576e-8,0.004362250570187353,2.1489435250093217e-5,-6.53007002748905e-8,0.004362299121386524,2.155913544719217e-5,-6.54524253343876e-8,0.004362306490900004,2.1501808725852057e-5,-6.532755100187959e-8,0.004362327761153033,2.131732881203479e-5,-6.492513324816661e-8,0.0043624093738372635,2.103373524474476e-5,-6.430576510522246e-8,0.0043625793884881775,2.0697054625575986e-5,-6.356950528095524e-8,0.004362844207020741,2.0358383999011046e-5,-6.282776240788013e-8,0.004363191208127825,2.006260880711081e-5,-6.217865603614356e-8,0.004363594835992581,1.984133466131531e-5,-6.169150041406605e-8,0.004364023394089613,1.971031936272081e-5,-6.140108548051583e-8,0.004364444713893855,1.9670147056786693e-5,-6.130906149278202e-8,0.004364830116595006,1.9708457183723877e-5,-6.13887614197793e-8,0.004365157008842049,1.9802456355045293e-5,-6.159066614971228e-8,0.0043654108447642925,1.9921222630134676e-5,-6.184741174273681e-8,0.004365587133171469,2.002805687530203e-5,-6.207888714985402e-8,0.004365693773882021,2.0083687956816993e-5,-6.219920719112305e-8,0.004365753261816067,2.0051413982690625e-5,-6.21279557727769e-8,0.004365803266929434,1.990492580654581e-5,-6.18073352015643e-8,0.004365893211815998,1.963812772857377e-5,-6.122369196067238e-8,0.00436607468587738,1.9273718051626967e-5,-6.042630561545666e-8,0.004366386030933518,1.8864892817626648e-5,-5.953112197574838e-8,0.004366836077417156,1.8485075349996475e-5,-5.869834534688314e-8,0.004367395636384049,1.8206114824510273e-5,-5.808489610024617e-8,0.0043680034475078715,1.807342018736887e-5,-5.779018629925774e-8,0.004368585429190273,1.8090183319349116e-5,-5.7821670584522674e-8,0.004369078205338029,1.8218018646954217e-5,-5.8096130493753056e-8,0.004369446485515545,1.8391914972714372e-5,-5.8472137246485704e-8,0.00436968898915749,1.854111673960781e-5,-5.879546235081837e-8,0.004369833869388169,1.8607666783746486e-5,-5.893945230499611e-8,0.004369927829734204,1.8558083076927652e-5,-5.883053071818364e-8,0.0043700232722843815,1.8387261432697222e-5,-5.845686139765173e-8,0.004370166642890487,1.8115771799109823e-5,-5.78626810222891e-8,0.004370389908592708,1.778250420799372e-5,-5.7132479090411445e-8,0.004370706190176643,1.7434832951346612e-5,-5.63696521066772e-8,0.004371109765100231,1.7118586178875612e-5,-5.5674571774707e-8,0.00437157972214823,1.6869939219546253e-5,-5.5126719806860253e-8,0.004372085769119738,1.671054970042191e-5,-5.477386649502183e-8,0.004372594495239376,1.6646123535862942e-5,-5.462880762363998e-8,0.004373074761423813,1.6667710334556395e-5,-5.467217352867607e-8,0.004373501568673639,1.675457816700928e-5,-5.485876153998176e-8,0.004373858478157565,1.687756120804058e-5,-5.5124896858937915e-8,0.004374139111879542,1.7002287531392034e-5,-5.5395470307775045e-8,0.0043743482958161295,1.7092346989803696e-5,-5.559079621301812e-8,0.004374503133939031,1.7112951246571128e-5,-5.5634563689226273e-8,0.004374633720251839,1.7035925052044434e-5,-5.546478116239983e-8,0.00437478225005965,1.6846665517467146e-5,-5.504911354774486e-8,0.0043749983953135655,1.6552475631203626e-5,-5.440324873724291e-8,0.004375328872488854,1.618927976830758e-5,-5.360566541222857e-8,0.0043758013925030695,1.5821068508656155e-5,-5.2796405543630164e-8,0.004376408267399701,1.552634116046679e-5,-5.214735730105396e-8,0.004377099954417064,1.5371900421595234E-05,-5.180488666204743e-8,0.004377797060914417,1.5385036173928835e-5,-5.182897065432117e-8,0.004378418187720637,1.5540645773084347e-5,-5.2165003016123936e-8,0.004378909008357041,1.5771884933839974e-5,-5.266706122898232e-8,0.0043792572209281865,1.599719360222389e-5,-5.315697219265368e-8,0.004379488986244382,1.6147744983164754e-5,-5.34842622002332e-8,0.004379653735493992,1.6183696763184442e-5,-5.356159676976171e-8,0.004379807029548539,1.6097454183882332e-5,-5.337188796430934e-8,0.004379997377027852,1.5908215829117925e-5,-5.2956489809098333e-8,0.004380258535441446,1.5652790384862128e-5,-5.239536296392365e-8,0.004380606499311609,1.5376010872551103e-5,-5.178635373794103e-8,0.00438103981704955,1.5122274389860483e-5,-5.122678455064238e-8,0.0043815422062817,1.4928716380928159e-5,-5.079841505994918e-8,0.0043820867949589636,1.4820349015323273e-5,-5.055656434916802e-8,0.004382641303252554,1.4807475268811135e-5,-5.052422039228374e-8,0.004383173380248949,1.4885420145896664e-5,-5.0691348370280644e-8,0.004383655356796422,1.5036302184118528e-5,-5.1018815625741976e-8,0.004384067847834171,1.5232293344004387e-5,-5.144564428159387e-8,0.0043844019828522774,1.543961315370945e-5,-5.1897827868784535e-8,0.004384660446837142,1.5622634657119858e-5,-5.229728990740927e-8,0.0043848576711448175,1.5747902572815793e-5,-5.257058563354719e-8,0.0043850193932531934,1.5788236658408824e-5,-5.2657827564574646e-8,0.0043851814481957125,1.572732220635757e-5,-5.252279948825495e-8,0.004385386970873339,1.5565072314536914e-5,-5.216487783723147e-8,0.004385680534183977,1.532309143986357e-5,-5.163119876709418e-8,0.004386097920633204,1.5047759637200314e-5,-5.102352030618483e-8,0.004386652021040343,1.4806503360449029e-5,-5.0490006751438264e-8,0.004387319473877426,1.4672634763753373e-5,-5.019184730718326e-8,0.004388037475553013,1.4699180145777687e-5,-5.024571194944651e-8,0.004388719358254085,1.4892581471994294e-5,-5.066597535539156e-8,0.004389286252243407,1.5203884862031068e-5,-5.1345376667470573e-8,0.00438969797548042,1.5546829342512437e-5,-5.209476228885879e-8,0.004389964650890107,1.583302129175502e-5,-5.272030351592314e-8,0.004390134913807563,1.6002864742013964e-5,-5.309129370757188e-8,0.004390272271287374,1.6037840528340582e-5,-5.3166940446750974e-8,0.004390434097429688,1.595511112825302e-5,-5.298445643173724e-8,0.004390660057645578,1.579392903294117e-5,-5.262936255347156e-8,0.004390969109008046,1.5602006407262715e-5,-5.220585215637865e-8,0.0043913615412258964,1.542537772061049e-5,-5.1814795817357e-8,0.004391823037389939,1.5302039558842245e-5,-5.153985439117854e-8,0.004392329121287766,1.5258332624760626e-5,-5.143939304550827e-8,0.004392849551497714,1.5307073316800725e-5,-5.1542117695367437e-8,0.004393352682154456,1.54470359086033e-5,-5.18457185429351e-8,0.00439380971458905,1.566375392426153e-5,-5.23185628529972e-8,0.004394198597306122,1.5931683059558592e-5,-5.2904527284831545e-8,0.004394507186734965,1.621768345692803e-5,-5.353077333402549e-8,0.004394735227108045,1.6485492657756142e-5,-5.411762647781867e-8,0.004394894902223298,1.6700626893534787e-5,-5.45892803278868e-8,0.004395009971871057,1.6835218512750443e-5,-5.48843068576531e-8,0.004395113603586854,1.687246367982367e-5,-5.496537371682426e-8,0.004395244949411491,1.6810475067017456e-5,-5.482779901120044e-8,0.0043954442427448425,1.6665347947444088e-5,-5.450649984627839e-8,0.004395745883391455,1.6472740140844224e-5,-5.407968384406357e-8,0.0043961693024316155,1.6286178870649144e-5,-5.366522773031633e-8,0.0043967088244268844,1.616943709032258e-5,-5.340384348847231e-8,0.00439732633496883,1.6180870696195093e-5,-5.342443633742838e-8,0.004397953375547895,1.635135413255929e-5,-5.379535836427356e-8,0.0043985084347460835,1.6664842817597192e-5,-5.448152340898046e-8,0.004398926535594353,1.7055762545965226e-5,-5.533868602056141e-8,0.004399186184162931,1.7430878674003617e-5,-5.616169045398201e-8,0.004399316502889809,1.7706012639717648e-5,-5.676535310620799e-8,0.004399380619391071,1.7836085828877507e-5,-5.7050496127308454e-8,0.0043994479138703985,1.782330059445976e-5,-5.70217692683362e-8,0.004399571685962228,1.7705329205192075e-5,-5.676158687960766e-8,0.004399779842592975,1.7535919356775476e-5,-5.6387604272475e-8,0.004400076250313624,1.736849329520766e-5,-5.601691660456328e-8,0.0044004470021380936,1.7246443601718784e-5,-5.574493496590799e-8,0.0044008672958289925,1.7199144884804796e-5,-5.5636639903815625e-8,0.004401307044890794,1.724130099925887e-5,-5.572497188992369e-8,0.00440173510197177,1.737368836590099e-5,-5.6012208288017816e-8,0.004402122691783258,1.7584415933249197e-5,-5.6472543144591716e-8,0.004402446537357039,1.785064042267672e-5,-5.705582151470724e-8,0.004402691816659508,1.8141037663291022e-5,-5.7693066337959046e-8,0.004402854735432183,1.841939830699297e-5,-5.8304506128850546e-8,0.0044029441466111215,1.86494319283523e-5,-5.88101859483882e-8,0.004402981550175842,1.8800342453498846e-5,-5.914217622460607e-8,0.004402999067764595,1.8852377164001726e-5,-5.925669183407802e-8,0.004403035359985339,1.8801411674438728e-5,-5.914416507577008e-8,0.0044031298139103415,1.866162281600663e-5,-5.883524829467042e-8,0.004403315601073636,1.8465518632622366e-5,-5.8401102927705954e-8,0.004403612303337892,1.8260820798133723e-5,-5.794674902359043e-8,0.00440401903455858,1.810360352195355e-5,-5.7596036212635465e-8,0.004404509752154576,1.8047165882872968e-5,-5.746702598309528e-8,0.004405033516436402,1.812725114889848e-5,-5.763917890945277e-8,0.004405522902615492,1.834684093381671e-5,-5.8119578846809494e-8,0.0044059119457882465,1.866727755270758e-5,-5.8823215461512124e-8,0.004406159440016461,1.9013925428711905e-5,-5.958550245976834e-8,0.004406266628248096,1.9299284542711648e-5,-6.021339687547807e-8,0.004406277737108989,1.945484969608813e-5,-6.055575571644973e-8,0.004406261496645234,1.9454837423611572e-5,-6.055559500071444e-8,0.004406284449775708,1.9319660877416878e-5,-6.025761062267969e-8,0.00440639062788073,1.910099176720538e-5,-5.977521664665257e-8,0.004406594829344743,1.886022453602534e-5,-5.924323335780905e-8,0.004406887078573716,1.8651292088100253e-5,-5.878025539400848e-8,0.004407241761031286,1.8511880264080445e-5,-5.846944211875105e-8,0.0044076263524043535,1.8461551898719056e-5,-5.835435137480919e-8,0.0044080076754981525,1.8503530268696664e-5,-5.8442683603324096e-8,0.00440835579500999,1.862755742929406e-5,-5.871235534719573e-8,0.004408646532290339,1.881262321625275e-5,-5.911736690258402e-8,0.004408863496128932,1.9029458207028737e-5,-5.959328119831901e-8,0.004409000066919958,1.924325840921723e-5,-6.006330961355848e-8,0.004409061253908856,1.9417302526743488e-5,-6.044637646552229e-8,0.004409064800155661,1.9517894893698925e-5,-6.066804549783033e-8,0.00440904055014602,1.9520391771617026e-5,-6.067376479634501e-8,0.004409027212339246,1.9415263477098266e-5,-6.044217579738232e-8,0.004409066265143777,1.9212538136596372e-5,-5.99949182565613e-8,0.004409193715141178,1.8942795303234154e-5,-5.939893403493536e-8,0.0044094314113227616,1.865344497733075e-5,-5.875845298339941e-8,0.004409780143242562,1.8400286623901103e-5,-5.8196555817766816e-8,0.004410216569539457,1.8235638567657733e-5,-5.782905216370578e-8,0.004410695422717016,1.8195238170461436e-5,-5.773546974239403e-8,0.004411157650944433,1.8286844900537162e-5,-5.7933659296607315e-8,0.004411543971861461,1.8484117436023682e-5,-5.836601541020027e-8,0.004411811395675748,1.8729348317482946e-5,-5.890535923731313e-8,0.004411947793992804,1.89470109132833e-5,-5.938486561457419e-8,0.0044119780011767805,1.906592214848751e-5,-5.964712702981143e-8,0.004411956808968038,1.9042277832868503e-5,-5.9595124411453214e-8,0.004411950401682743,1.8873156757466962e-5,-5.92220569871064e-8,0.004412014554899769,1.8594182067809693e-5,-5.8606156280090905e-8,0.004412179536671111,1.8263848967560027e-5,-5.7876134214088945e-8,0.0044124466739733125,1.7943581917926447e-5,-5.716729690606632e-8,0.004412794575472388,1.7682304086576782e-5,-5.6587619247160394e-8,0.004413189368832398,1.7509204078874898e-5,-5.6201810628385806e-8,0.004413594086340192,1.743345530047553e-5,-5.603059765879325e-8,0.004413975065031127,1.7447630029714103e-5,-5.605809066694707e-8,0.004414305472350097,1.7532025516451413e-5,-5.6241179923360305e-8,0.004414567041261399,1.7658503065552773e-5,-5.651793566777759e-8,0.004414751115520992,1.779363418722658e-5,-5.681456751260478e-8,0.004414859663338807,1.7901658854669397e-5,-5.7052019121006296e-8,0.0044149062993784445,1.794805755027884e-5,-5.7153915757579485e-8,0.004414916691840586,1.7904389601374315e-5,-5.7057269944060924e-8,0.004414927200000021,1.77543682378513e-5,-5.672588204884182e-8,0.0044149804922138025,1.750003314877578e-5,-5.616395099473292e-8,0.00441511759337999,1.7165714561544804e-5,-5.542484487782527e-8,0.004415367428776234,1.679696126662312e-5,-5.460881274387819e-8,0.0044157368984729635,1.64525946058128e-5,-5.3845568238601775e-8,0.0044162055472075626,1.6190716787134946e-5,-5.3263516737987664e-8,0.004416727899593218,1.6052589799655223e-5,-5.295419024084609e-8,0.0044172437234548155,1.6049869174066154e-5,-5.294395078197559e-8,0.004417693384688244,1.615974344870538e-5,-5.3183040430361466e-8,0.004418033663467096,1.6329784446188893e-5,-5.355607037861073e-8,0.004418249405605174,1.6491255741248804e-5,-5.391129234465096e-8,0.004418357633513688,1.657727659886784e-5,-5.41007360539825e-8,0.004418402673640693,1.6540796109409133e-5,-5.4020027084270734e-8,0.004418443391223361,1.636694373579072e-5,-5.3635805163711675e-8,0.004418536429934856,1.6075637077552477e-5,-5.2991599870440183e-8,0.004418721153570862,1.5713686813819345e-5,-5.219048380509432e-8,0.004419011327149181,1.5339827180016276e-5,-5.136208116526004e-8,0.004419395436149071,1.5008693642004086e-5,-5.062720950800594e-8,0.004419843763828487,1.475917925423041e-5,-5.0072119853676645e-8,0.004420318190940414,1.4609543041482485e-5,-4.973758066953034e-8,0.004420781006999231,1.455837640529271e-5,-4.9620879180614367e-8,0.004421200875707693,1.4588855571197866e-5,-4.9685116993361385e-8,0.004421555921818236,1.4673832615992423e-5,-4.9870423302738325e-8,0.004421834861138942,1.4780363310829798e-5,-5.0103979045361175e-8,0.004422037237442245,1.4873349197413976e-5,-5.030810679146616e-8,0.0044221735003303324,1.4918708687383351e-5,-5.0407314602882546e-8,0.004422265076734925,1.488684665139391e-5,-5.0335987892971714e-8,0.004422343894139628,1.4757129675741033e-5,-5.004829930915722e-8,0.004422450182798508,1.4523472760162985e-5,-4.953057889944237e-8,0.004422627129488367,1.4199935359410018e-5,-4.8813710361903955e-8,0.004422911606825086,1.382367526534905e-5,-4.7979688149729203e-8,0.004423322237828266,1.3451651182103001e-5,-4.715436315562399e-8,0.00442384901396835,1.3148639319550321e-5,-4.6480995689175956e-8,0.004424450465700748,1.2968277830758903e-5,-4.6078384882655163e-8,0.004425062411682258,1.2934115116972632e-5,-4.599895383332543e-8,0.004425616532075163,1.3029713949506274e-5,-4.620678002907812e-8,0.00442606125460747,1.3203026493029452e-5,-4.658713648167632e-8,0.004426376247492937,1.3382921571667098e-5,-4.698291956016331e-8,0.0044265757656095205,1.3500398155340669e-5,-4.7241493967355725e-8,0.0044267015746751685,1.3506656906523134e-5,-4.7254652877251136e-8,0.004426809564985756,1.3383317501207797e-5,-4.698127400556689e-8,0.004426954798878417,1.3143641854113754e-5,-4.645015416988944e-8,0.004427178862902963,1.282611238434304e-5,-4.574598280569655e-8,0.004427502065621027,1.248309395401886e-5,-4.498442593684408e-8,0.004427921557662274,1.2167909243147152e-5,-4.4283605507852286e-8,0.0044284149290582065,1.1923590626574095e-5,-4.373914849628887e-8,0.004428947492553156,1.1775726251332769e-5,-4.340818287378602e-8,0.0044294807498054785,1.1730276245194692e-5,-4.330431159108967e-8,0.00442997978210213,1.1775616157272551e-5,-4.3402016286169154e-8,0.004430418284203898,1.1887104697408922e-5,-4.3646763807176316e-8,0.004430781078167451,1.2032394059880673e-5,-4.396683813881441e-8,0.004431064723837474,1.2176260557030221e-5,-4.428411771350637e-8,0.0044312770935376515,1.228454666456542e-5,-4.452283720664672e-8,0.004431436570445023,1.2327479539015128e-5,-4.4616919616307796e-8,0.004431571073044788,1.2282959424570596e-5,-4.451723465126646e-8,0.004431716519505703,1.2140402085948442e-5,-4.420012359781004e-8,0.004431913708413011,1.190525144918933e-5,-4.367745401611296e-8,0.004432202271488714,1.1603137979985335e-5,-4.3005902031456583e-8,0.00443261096494701,1.128105558813796e-5,-4.228959825337529e-8,0.004433145658560025,1.1001798769206879e-5,-4.166779716993523e-8,0.004433779801368679,1.082900401217352e-5,-4.12817006687968e-8,0.004434454646972603,1.0805123199301839e-5,-4.122560821070611e-8,0.004435094025680583,1.093179184586048e-5,-4.1503363883340675e-8,0.004435629850168535,1.1164738583475233e-5,-4.20170322203088e-8,0.004436026030782993,1.1428372850655338e-5,-4.259921088755147e-8,0.004436288544140871,1.1642827137621819e-5,-4.30729574358741e-8,0.00443645852333741,1.1749408550127374e-5,-4.33081550485094e-8,0.004436594888881352,1.1724150687214207e-5,-4.3251474414460785e-8,0.004436755874140951,1.1577909422798677e-5,-4.292656969019233e-8,0.00443698556045168,1.134743368171151e-5,-4.241440383930332e-8,0.004437307141160754,1.1082923092713402e-5,-4.1825890935872864e-8,0.004437722000943753,1.0835997728485317e-5,-4.1275427325207346e-8,0.004438212894918262,1.0650076781292515e-5,-4.0859608303239765e-8,0.004438749638289341,1.055393982394728e-5,-4.0642808497137944e-8,0.004439295959152751,1.0558721353467244e-5,-4.065026502851615e-8,0.004439816265453436,1.065819146280534e-5,-4.0868482817672476e-8,0.004440281272009354,1.0831676496297347e-5,-4.1251640135869176e-8,0.004440671831938921,1.1048643543678123e-5,-4.173183848769729e-8,0.004440980777783971,1.1273898329578631e-5,-4.2230779881881195e-8,0.00444121303269828,1.1472474912977608e-5,-4.267071508775094e-8,0.004441384565236301,1.1613723431763203e-5,-4.298351149337096e-8,0.004441520716355006,1.1674659260946504e-5,-4.311801611635916e-8,0.004441654103827259,1.1642927188475744e-5,-4.304658575328331e-8,0.004441821893723169,1.151970903380154e-5,-4.277157863485106e-8,0.004442061733825511,1.1322569755221519e-5,-4.2331789891194374e-8,0.004442405367359218,1.1087324544257746e-5,-4.1806717475930976e-8,0.004442869542993695,1.0866655575333044e-5,-4.1313536007648224e-8,0.004443445735403163,1.0722317764963522e-5,-4.0989728756109695e-8,0.004444093284368835,1.0708865030730829e-5,-4.0956817567218523e-8,0.0044447430760904995,1.085167507562386e-5,-4.127142029165161e-8,0.004445316435740319,1.1129602124610225e-5,-4.1886642259513546e-8,0.004445754128237322,1.1475626607160576e-5,-4.2653546623268654e-8,0.004446040101964218,1.180003031512926e-5,-4.3372752883896014e-8,0.004446205530673317,1.2024629257590159e-5,-4.387057130415036e-8,0.004446312162708855,1.2108771182796773e-5,-4.405669777283164e-8,0.004446427135514646,1.2055740045207085e-5,-4.3938284164400834e-8,0.004446602819718554,1.1902415131929761e-5,-4.3596893302424874e-8,0.004446867462772274,1.1702280581489064e-5,-4.3150880569211476e-8,0.00444722502652385,1.1510013581017392e-5,-4.272141346034424e-8,0.004447660112373166,1.1371009258943887e-5,-4.240940734950581e-8,0.004448144592351008,1.1315808141326373e-5,-4.228315760058449e-8,0.00444864413440166,1.1358103698667109e-5,-4.237371725707588e-8,0.004449124029971733,1.1495141539025288e-5,-4.2675501313854964e-8,0.004449554153193063,1.1709878328814522e-5,-4.315087896932633e-8,0.004449912835517964,1.1974488478859295e-5,-4.373794004970734e-8,0.004450189440411732,1.2254789064169708e-5,-4.4360459045246395e-8,0.004450385488268202,1.2515133469631053e-5,-4.493894052335691e-8,0.004450514285615522,1.2723218588808307e-5,-4.540139076746559e-8,0.004450599251519201,1.285424788009527e-5,-4.569253626675187e-8,0.0044506713012207,1.2894201090678989e-5,-4.578100104332719e-8,0.004450765540459394,1.2842246866083047e-5,-4.5664633203186566e-8,0.004450917284953617,1.2712332911019386e-5,-4.537412450667041e-8,0.004451157155322636,1.2533780867555994e-5,-4.497450577626395e-8,0.004451504873237557,1.2350163721766086e-5,-4.45628020467471e-8,0.004451961919675364,1.2214876307893983e-5,-4.425820466465791e-8,0.004452504731610211,1.218142064773772e-5,-4.418032467973815e-8,0.004453082319776596,1.2287689702351628e-5,-4.441399178406356e-8,0.0044536237576869794,1.2537566429059222e-5,-4.496809227303929e-8,0.004454058600129623,1.2889221277017663e-5,-4.5749448011482285e-8,0.004454344557171657,1.3261764007055407e-5,-4.657774011379726e-8,0.004454487209756872,1.356321056345686e-5,-4.724799032523849e-8,0.004454537817108847,1.3726577222573843e-5,-4.761103975360433e-8,0.004454569953530231,1.3733042945322505e-5,-4.762500825386583e-8,0.0044546503114754445,1.3611019367534598e-5,-4.7353008192290663e-8,0.004454819540444871,1.3417353161617989e-5,-4.692121901981639e-8,0.004455088006355839,1.3214963151419203e-5,-4.6469264458608674e-8,0.0044554417320164475,1.3056798315819873e-5,-4.6114776888332594e-8,0.00445585181070049,1.2978205618864193e-5,-4.5936593073707565e-8,0.004456283063848414,1.2995515360089378e-5,-4.597157388372203e-8,0.004456700455403941,1.3107894323916252e-5,-4.621850553884396e-8,0.0044570734879752745,1.3300386432833933e-5,-4.664459015113946e-8,0.004457379329847273,1.354733210799182e-5,-4.719288460843296e-8,0.004457605083715164,1.381611653844664e-5,-4.779065425340231e-8,0.004457749208594007,1.4071308351959136e-5,-4.835873390854053e-8,0.004457821935847933,1.4279162754995978e-5,-4.882171487818592e-8,0.004457844413589892,1.4412244841220207e-5,-4.9118304592704225e-8,0.004457846392811299,1.4453606997495086e-5,-4.9210578647334747e-8,0.004457862579541846,1.4399892313824196e-5,-4.909080557286075e-8,0.004457928006711199,1.4262935015950712e-5,-4.878499921089497e-8,0.0044580728160356475,1.406956442522464e-5,-4.835259699152093e-8,0.004458316817654614,1.385936585539174e-5,-4.7881662798881046e-8,0.004458664213340158,1.3680097018682372e-5,-4.7478820736234354e-8,0.004459099197509258,1.3580228791160693e-5,-4.725262339870064e-8,0.004459584026033035,1.3598195514992196e-5,-4.728940689142557e-8,0.004460062199621417,1.3749252092781208e-5,-4.762371409222547e-8,0.0044604695823886415,1.4013664681784223e-5,-4.8211740969940616e-8,0.004460753777901616,1.4333327715772738e-5,-4.8923755358978294e-8,0.004460895857321044,1.4624178301927179e-5,-4.957195585635171e-8,0.00446092230560696,1.4804495669279922e-5,-4.997383459421404e-8,0.004460896977374359,1.4826692738442146e-5,-5.002318300311229e-8,0.004460895349738283,1.4694329378561483e-5,-4.972790533985917e-8,0.004460976016780967,1.4455254987504552e-5,-4.919452719357374e-8,0.0044611646111219405,1.4178234027314433e-5,-4.857603680579923e-8,0.004461454185855782,1.3928460573193122e-5,-4.801746458935442e-8,0.0044618157539403095,1.3752419469232318e-5,-4.7622364855750946e-8,0.0044622107137216325,1.3673354803297678e-5,-4.7442825841443116e-8,0.00446260043945746,1.369354382664959e-5,-4.7484455725649896e-8,0.004462952022908023,1.3799219006272274e-5,-4.7717131725367e-8,0.004463241121058138,1.3965553328710682e-5,-4.8085882901992276e-8,0.004463453324834858,1.4160873361938923e-5,-4.852016867099879e-8,0.0044635849469705675,1.435036495631774e-5,-4.894218569650978e-8,0.004463643417515637,1.4499782775240661e-5,-4.9275285274911396e-8,0.004463647051016639,1.4579493829923948e-5,-4.945312739285398e-8,0.004463623708041326,1.456882906403381e-5,-4.9429429021382195e-8,0.004463607842406662,1.4460176219189537e-5,-4.918704040982184e-8,0.0044636357910401445,1.4261818394534823e-5,-4.874420470914212e-8,0.0044637397511841466,1.3998495202235436e-5,-4.815581116683994e-8,0.004463941391235043,1.3708962880863763e-5,-4.7508063679370155e-8,0.004464246337336341,1.3440376771153735e-5,-4.6906117413019404e-8,0.0044646407956383674,1.3240001878015215e-5,-4.645569825673976e-8,0.004465091381001237,1.3145269848031426e-5,-4.624087973870854e-8,0.004465549066273715,1.3173598219246631e-5,-4.6301165592733985e-8,0.004465957939694511,1.3314136875100861e-5,-4.661280004540448e-8,0.004466268576327031,1.352468763662037e-5,-4.708169932958065e-8,0.00446645372428031,1.3737541360524216e-5,-4.7556478385599956e-8,0.004466520878302181,1.3876287526487771e-5,-4.786615773013864e-8,0.004466514326078782,1.3880445157377903e-5,-4.7875375783545784e-8,0.004466502142877897,1.3727918531229615e-5,-4.753461483998569e-8,0.004466552086217613,1.344312403337607e-5,-4.689826847344771e-8,0.0044667082651349286,1.3085819784721498e-5,-4.609959388131855e-8,0.004466980019477852,1.2727550786706039e-5,-4.529813388914731e-8,0.004467345755137234,1.2428783962732317e-5,-4.4628795806165725e-8,0.004467765779943532,1.2225982089979055e-5,-4.4173112494455235e-8,0.004468196005854024,1.2129693991677846e-5,-4.395498255353792e-8,0.004468597642816224,1.2129490543834448e-5,-4.395156917433471e-8,0.00446894206410521,1.2201011417455164e-5,-4.410885737385981e-8,0.00446921225500677,1.2312244640502023e-5,-4.43555394468987e-8,0.004469402654481283,1.2428213420078234e-5,-4.46134499502362e-8,0.0044695185950805304,1.2514503621319245e-5,-4.48055188286882e-8,0.004469575723049835,1.2540430548831996e-5,-4.486296672886854e-8,0.004469599148903078,1.2482479511679878e-5,-4.473308223481721e-8,0.004469621667375493,1.2328204497541601e-5,-4.4387945702341005e-8,0.004469680258111596,1.2080054076724377e-5,-4.38329250854799e-8,0.004469810440791369,1.1757832861630705e-5,-4.3112118745779403e-8,0.004470038938882233,1.139812552580378e-5,-4.2307071423256166e-8,0.004470376233823944,1.1049363336854192e-5,-4.1525836645826615e-8,0.004470811437085582,1.0762470256707936e-5,-4.088220096014905e-8,0.004471311827050345,1.057885493987764e-5,-4.046892914926202e-8,0.004471828174441778,1.0518954079644614e-5,-4.0332120643179816e-8,0.00447230517930829,1.057478045414597e-5,-4.045439322306815e-8,0.004472694773246646,1.0709058764895794e-5,-4.075274930775221e-8,0.004472969079340785,1.0862056909000877e-5,-4.1093716830421817e-8,0.004473129460972397,1.096542999972803e-5,-4.1324306385980915e-8,0.004473208349376754,1.0960344314636686e-5,-4.131265117419883e-8,0.004473261801176122,1.0814980769902441e-5,-4.098727821687716e-8,0.004473353611162491,1.0535090952922028e-5,-4.036078520359405e-8,0.004473535890618031,1.0162456216834655e-5,-3.952640941680167e-8,0.004473833792415958,9.760956408521302e-6,-3.862688960352953e-8,0.004474240602953426,9.396173414810474e-6,-3.7808898628385294e-8,0.004474724001444978,9.11738920258227e-6,-3.718281945206038e-8,0.004475238859403357,8.948272943174389e-6,-3.6801887768029544e-8,0.0044757402350894555,8.887048525787006e-6,-3.6662466891908055e-8,0.004476192324498001,8.912754115928486e-6,-3.6717928510436886e-8,0.004476572466872101,8.99328366656885e-6,-3.689655835364853e-8,0.004476871540255352,9.092325994737656e-6,-3.711706737226179e-8,0.0044770926280973825,9.174281950373387e-6,-3.7299643889725875e-8,0.004477249315061717,9.207572991317009e-6,-3.737343689531388e-8,0.0044773641629216165,9.167232096321902e-6,-3.7282422144220036e-8,0.004477467204936426,9.037578898248145e-6,-3.699141801660316e-8,0.004477593756950581,8.815347168589488e-6,-3.649307148880597e-8,0.00447778058690321,8.512872182307729e-6,-3.5814955514758316e-8,0.004478059745215661,8.159958224253264e-6,-3.502372164908136e-8,0.004478450365817333,7.802247766408065e-6,-3.4221459193305144e-8,0.004478950468601355,7.494062159631074e-6,-3.3529720730520204e-8,0.004479532465119492,7.285542176108168e-6,-3.3060801908352687e-8,0.004480146136971822,7.2072554470058906e-6,-3.288331103792207e-8,0.004480730224220354,7.258279349781589e-6,-3.2995444030558204e-8,0.004481229449583244,7.4035582392112385e-6,-3.331896233314279e-8,0.004481610689525678,7.582522644393277e-6,-3.371838931973838e-8,0.004481872292063173,7.725939025928392e-6,-3.403868938062639e-8,0.00448204374844317,7.774910697168804e-6,-3.414782399457034e-8,0.004482176671298304,7.696059172490782e-6,-3.397078855811176e-8,0.004482330435030019,7.4890430319435334e-6,-3.350650916046562e-8,0.004482556672721601,7.1850969128227755e-6,-3.282465246101726e-8,0.0044828866992572885,6.837522641746615e-6,-3.2044432737991846e-8,0.0044833250857910616,6.507056498926579e-6,-3.130192899832561e-8,0.004483850858172803,6.24650987263678e-6,-3.071570165203201e-8,0.004484425307959444,6.08924159396039e-6,-3.036088489326645e-8,0.004485003194359061,6.044356934728174e-6,-3.025827024763154e-8,0.004485543401858622,6.098712850233066e-6,-3.0378643182073185e-8,0.004486016219005494,6.2234233182378906e-6,-3.0657287324259747e-8,0.0044864064166258944,6.3817652026060565e-6,-3.1011736157922704e-8,0.004486712974298434,6.536100940869929e-6,-3.135738930785751e-8,0.004486946987567679,6.652794334948827e-6,-3.16186317416998e-8,0.0044871290855611435,6.705289352964788e-6,-3.173578594963119e-8,0.004487287039748156,6.676139966458214e-6,-3.1669660514816774e-8,0.004487453549021817,6.558809591876483e-6,-3.1405558068106883e-8,0.004487663626245549,6.359694715241642e-6,-3.095779699979666e-8,0.004487950667436226,6.100153211559874e-6,-3.0374268126452117e-8,0.004488340386805238,5.817319379742182e-6,-2.973828357636435e-8,0.004488842722498734,5.561454687988725e-6,-2.9162651978515495e-8,0.004489443758855133,5.387386078451001e-6,-2.87704753805209e-8,0.00449010207955269,5.339481305214199e-6,-2.866142686948672e-8,0.004490754688042762,5.434077367358827e-6,-2.887228736862537e-8,0.004491334130057058,5.647948607453723e-6,-2.9351019643881805e-8,0.004491791249757919,5.921297869142392e-6,-2.99634549511861e-8,0.004492112629279643,6.17644552752166e-6,-3.0535254824106297e-8,0.00449232388491216,6.343735825162951e-6,-3.0910079891972617e-8,0.004492478423788278,6.3824291151391336e-6,-3.0996454297399085e-8,0.0044926387333911215,6.288994539844147e-6,-3.078631234061721e-8,0.004492858636300761,6.092913739653983e-6,-3.0345562453837724e-8,0.004493171588724417,5.844789364045817e-6,-2.9787493231587065e-8,0.00449358619792652,5.60206433789655e-6,-2.9240893731404095e-8,0.004494087869175982,5.4161245069199806e-6,-2.882123891207294e-8,0.004494644740160421,5.322864554289205e-6,-2.8609503663609465e-8,0.004495216006784931,5.337654872160231e-6,-2.864069875751362e-8,0.004495760772876803,5.45491845871229e-6,-2.8902689986086383e-8,0.00449624562807949,5.6517357057193595e-6,-2.9344127629553888e-8,0.004496649625176552,5.894052353282223e-6,-2.988837234120634e-8,0.004496966197981279,6.14368973988668e-6,-3.044936038422412e-8,0.004497202413708704,6.364618307242032e-6,-3.094585642668188e-8,0.004497376491928267,6.527582409948589e-6,-3.131194447327545e-8,0.004497514640436966,6.6129278100694005e-6,-3.150337999113445e-8,0.004497647925917268,6.612117621637158e-6,-3.150093270015358e-8,0.004497809336845073,6.528610724443239e-6,-3.131231070153016e-8,0.004498030707089667,6.3785361876222695e-6,-3.09736925859592e-8,0.004498338829174895,6.191080665260008e-6,-3.055066942661581e-8,0.004498750077775436,6.0076683654676744e-6,-3.013646953689903e-8,0.004499263612814337,5.8780642609847445e-6,-2.9843203850422515e-8,0.004499854940636369,5.851244450515609e-6,-2.9781269629881294E-08,0.004500473936466841,5.960397636023314e-6,-3.002551100540538e-8,0.004501052719345036,6.205775394502228e-6,-3.057655086561226e-8,0.00450152565398311,6.544818406940442e-6,-3.133855594471292e-8,0.004501855052718436,6.89991925988118e-6,-3.213677936923044e-8,0.004502048299394567,7.184984577129539e-6,-3.277745584916125e-8,0.00450215485481849,7.337928245096862e-6,-3.312096524996092e-8,0.004502244939964075,7.34104622514252e-6,-3.31275673941889e-8,0.0045023832883471036,7.220589179745083e-6,-3.285626158580508e-8,0.0045026110823796145,7.030850470500054e-6,-3.2428926008768215e-8,0.0045029404092560505,6.834169236371335e-6,-3.198546698313869e-8,0.004503358106314494,6.685082210089396e-6,-3.1648403907449894e-8,0.004503833931529304,6.621199922123047e-6,-3.150250475699595e-8,0.004504329393182454,6.659916022098113e-6,-3.158735035096041e-8,0.004504805490228415,6.79906815339101e-6,-3.18986098972113e-8,0.0045052288712172945,7.020052500014815e-6,-3.239479081077634e-8,0.004505576291020284,7.292536290791366e-6,-3.300768877577651e-8,0.004505837190189702,7.580099251624076e-6,-3.3655110613896705e-8,0.0045060143045280365,7.846042790020471e-6,-3.42541110553583e-8,0.004506122446663604,8.058625318459529e-6,-3.473295260761845e-8,0.0045061858442556986,8.195104654863028e-6,-3.504028264202122e-8,0.004506234642510104,8.244233774000591e-6,-3.515070923594395e-8,0.004506301185498216,8.20730170658394e-6,-3.506705303538336e-8,0.004506416396345633,8.098093426558627e-6,-3.482021907021817e-8,0.004506606235169193,7.94206498498607e-6,-3.446740371929097e-8,0.004506887964378976,7.774744655900673e-6,-3.4088620681013444e-8,0.004507265898608951,7.63883680811971e-6,-3.378026681707891e-8,0.004507726866888514,7.578827637892328e-6,-3.364294154809401e-8,0.0045082369085281135,7.631796357853752e-6,-3.376059550196789e-8,0.0045087423408103665,7.81442404265071e-6,-3.4171064362557586e-8,0.004509179270358261,8.109527450340536e-6,-3.48355963905556e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json
new file mode 100644
index 0000000..d989a12
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":26000,"numberOfSamples":1000,"samples":[0.004509493310776733,8.460255546355793e-6,-3.5625800851343465e-8,0.004509663584584268,8.78152154032578e-6,-3.634960149730122e-8,0.004509716789810693,8.989819707723907e-6,-3.681866430913203e-8,0.004509719059465651,9.037418772725032e-6,-3.692552117143939e-8,0.004509748243703133,8.930185223519827e-6,-3.668355434778159e-8,0.004509863647122957,8.719470842231082e-6,-3.620846132642241e-8,0.004510089653785742,8.476972036399517e-6,-3.5661533171045015e-8,0.004510416800722429,8.269299770251092e-6,-3.51925282944491e-8,0.004510813094911667,8.1427235238956e-6,-3.4905561743649874e-8,0.004511237012805131,8.118815983827459e-6,-3.4849442039030304e-8,0.004511647598100416,8.19695215375018e-6,-3.5023237901990346e-8,0.004512010754110658,8.359585736620415e-6,-3.538793530902102e-8,0.004512302608721269,8.577895407180773e-6,-3.5878908014654e-8,0.004512511101780664,8.817020399356672e-6,-3.6417590410461715e-8,0.004512636407156604,9.040913865577355e-6,-3.692247406897225e-8,0.004512690307657771,9.216869444768706e-6,-3.7319489010541575e-8,0.004512694498577715,9.319590010896785e-6,-3.755134208751638e-8,0.004512677812454461,9.33448051439994e-6,-3.758499305360356e-8,0.004512672525088187,9.259714461186162e-6,-3.74162487552752e-8,0.004512710155956202,9.106773676260358e-6,-3.7070886445067697e-8,0.004512817232229619,8.899452134994748e-6,-3.660239062283695e-8,0.004513011361703757,8.671416905011533e-6,-3.6086549932726506e-8,0.0045132978459024205,8.462410007400726e-6,-3.561303803422552e-8,0.00451366700674806,8.313087368408677e-6,-3.5273853268424084e-8,0.004514092641922462,8.258223307030978e-6,-3.5147920393724736e-8,0.004514532771288454,8.318077690988317e-6,-3.5281410931936163e-8,0.004514934630932754,8.4888481118899e-6,-3.566597134940736e-8,0.004515245854344678,8.735374126556136e-6,-3.622214330179837e-8,0.0045154316998782295,8.991891199064452e-6,-3.6801147360575755e-8,0.004515492902915043,9.176856590224277e-6,-3.7218586920753816e-8,0.004515473030595792,9.22132948769478e-6,-3.731873347690093e-8,0.004515445973338222,9.09843419372188e-6,-3.704104339955742e-8,0.00451548682469044,8.835578371895206e-6,-3.644751863773576e-8,0.00451564268107663,8.500985857177386e-6,-3.5692080359945736e-8,0.0045159197183348996,8.174205711565663e-6,-3.495399269113799e-8,0.004516289609363855,7.91891452501725e-6,-3.437668106843999e-8,0.004516706111846334,7.769533914623208e-6,-3.403776290168179e-8,0.004517121078763411,7.73134067417984e-6,-3.3949388348932536e-8,0.0045174946878258695,7.787734155315276e-6,-3.4074540770568025e-8,0.004517799867137044,7.908923469211388e-6,-3.434642142253354e-8,0.004518023021591153,8.059160327422076e-6,-3.468456742654183e-8,0.004518163140214663,8.202005982025426e-6,-3.50066650311153e-8,0.004518230411948181,8.30424890030949e-6,-3.523747823122548e-8,0.004518244570725208,8.33915192550796e-6,-3.531634932075353e-8,0.004518232782286238,8.28935594403696e-6,-3.5203891163581475e-8,0.004518226774465987,8.149365170645358e-6,-3.488762043767852e-8,0.004518259006711036,7.927116613346235e-6,-3.438542274392408e-8,0.004518358060544222,7.643963370228097e-6,-3.3745425584923236e-8,0.004518543856405558,7.332621283429884e-6,-3.3041356370972954e-8,0.004518823498710852,7.0329632269025115e-6,-3.236314547040654e-8,0.004519188579967757,6.785903929501321e-6,-3.180325247605029e-8,0.004519614661144808,6.626048418181081e-6,-3.14401232958339e-8,0.0045200634304379044,6.5740276672578925e-6,-3.132079397132222e-8,0.004520487966458727,6.62956304606739e-6,-3.144502131997278e-8,0.00452084147546764,6.766843341505083e-6,-3.175463526314589e-8,0.004521089187148414,6.934764185105069e-6,-3.2134004538126606e-8,0.004521221269959029,7.065025688552307e-6,-3.2428442843453624e-8,0.004521261859102045,7.089574850293132e-6,-3.248384715700535e-8,0.0045212674299407694,6.964089990219654e-6,-3.2199939344201606e-8,0.004521310513078177,6.687544084459722e-6,-3.1574464342686096e-8,0.004521453447203763,6.305670157088708e-6,-3.071085821791362e-8,0.0045217253573987225,5.893958647960642e-6,-2.9779688167653515e-8,0.004522114733755025,5.529133856038296e-6,-2.8954214723599135e-8,0.004522579377927455,5.264744210794258e-6,-2.8355366465152043e-8,0.004523065009217748,5.120982847527676e-6,-2.802885167464862e-8,0.004523521972907846,5.088150002782038e-6,-2.7952986672350293e-8,0.004523914736487703,5.136932989628306e-6,-2.8061821235107004e-8,0.004524224518460753,5.229079919518181e-6,-2.8269112293518485e-8,0.004524447866784532,5.325356167857952e-6,-2.8486202260608446e-8,0.004524593830297251,5.390497834119252e-6,-2.8633216627973057e-8,0.004524681160259874,5.396171432205578e-6,-2.864585654482284e-8,0.004524735849207278,5.323027317101781e-6,-2.8480176026552257e-8,0.0045247886943237964,5.16249823096028e-6,-2.8116730602371682e-8,0.004524872353940403,4.918444281738836e-6,-2.7564280225240977e-8,0.0045250174349796965,4.608134848323794e-6,-2.68619228883987e-8,0.004525247591606092,4.261615509273891e-6,-2.6077583364155316e-8,0.004525574321292053,3.918549452938378e-6,-2.530086898948843e-8,0.00452599277311532,3.622150479587777e-6,-2.462943302074595e-8,0.0045264801545203655,3.4107258886289212e-6,-2.4149954956603862e-8,0.004526998018263306,3.308450392319929e-6,-2.3917312554474847e-8,0.004527498775693957,3.317760005942039e-6,-2.3937301228621522e-8,0.00452793558120547,3.415707219466181e-6,-2.415823276235786e-8,0.00452827373820132,3.555942963102195e-6,-2.4475281614218993e-8,0.004528501076735233,3.677053577969154e-6,-2.4749321189987848e-8,0.004528634255226658,3.7166708540264696e-6,-2.4838951555615288e-8,0.00452871788049019,3.6288209284880697e-6,-2.4639908971730102e-8,0.004528814461392247,3.399578871249497e-6,-2.4120586107355082e-8,0.004528986348915549,3.0544546974012395e-6,-2.3338735228699577e-8,0.004529275447593868,2.652362755159554e-6,-2.2427751850493508e-8,0.0045296894826229355,2.266809562799965e-6,-2.1554061940523532e-8,0.004530201357681512,1.962172998408435e-6,-2.0863453384503786e-8,0.004530761107800889,1.7757792179593227e-6,-2.044053421769499e-8,0.004531313427122603,1.7122786235617054e-6,-2.0295983770420518e-8,0.0045318125655776954,1.749367675975404e-6,-2.037944352447753e-8,0.004532230187937357,1.8490802478591477e-6,-2.0605011670815894e-8,0.00453255650096998,1.968861091375431e-6,-2.08762767548505e-8,0.004532797413529103,2.069429992863889e-6,-2.1104137100273155e-8,0.004532970455627508,2.1191957801873115e-6,-2.121685754164669e-8,0.004533101006844266,2.0963386322046738e-6,-2.1164869031366592e-8,0.004533219236241922,1.9898190337828303e-6,-2.09231193072752e-8,0.004533357423629913,1.8001513809640854e-6,-2.0492836790277707e-8,0.004533546992225019,1.540165048997408e-6,-1.9903207651827864e-8,0.004533814625910253,1.2352637227640804e-6,-1.9211889086172134e-8,0.0045341773121543635,9.220902568912064e-7,-1.8501932634248034e-8,0.004534637007950439,6.443360771918933e-7,-1.7872295458798828e-8,0.004535176664792075,4.4499167138597644e-7,-1.7420339103780497e-8,0.004535760035304328,3.557925328380303e-7,-1.7217978115692215e-8,0.004536337215533742,3.866412902473646e-7,-1.728772350881937e-8,0.004536855876733859,5.191842687487436e-7,-1.7588072274695526e-8,0.004537275385870752,7.081369882607212e-7,-1.8016430469229954e-8,0.004537579125593926,8.912435030713721e-7,-1.8431639886474907e-8,0.004537780530744449,1.005317578228007e-6,-1.8690357071296403e-8,0.004537920538034231,1.0034699039837472e-6,-1.868616129977461e-8,0.0045380570398233745,8.682810605385142e-7,-1.837946472292758e-8,0.004538249294644987,6.169983072998986e-7,-1.780931248930263e-8,0.004538541670781989,2.970358272201004e-7,-1.708319176747392e-8,0.004538951579800054,-2.7231731686069303e-8,-1.634711520277816e-8,0.004539465565272268,-2.9245638234442717e-7,-1.5744867236873657e-8,0.004540044817016876,-4.530987714794202e-7,-1.537993968878856e-8,0.004540637691521912,-4.913904592554641e-7,-1.5292863661002783e-8,0.0045411941681401885,-4.179588426089708e-7,-1.545968048557915e-8,0.0045416771529875445,-2.646725790176748e-7,-1.580808820140591e-8,0.004542067915028178,-7.389589463817978e-8,-1.624181308946475e-8,0.004542365941693601,1.1161571806108388e-7,-1.6663601282918254e-8,0.004542585366851695,2.557719936323004e-7,-1.6991327574329404e-8,0.004542750301596352,3.328556897280507e-7,-1.7166487509062615e-8,0.004542890539772055,3.288339048433999e-7,-1.7157205799619142e-8,0.004543038110357333,2.4148307307612337e-7,-1.6958505979006495e-8,0.00454322442352209,8.020747945813414e-8,-1.659185787564851e-8,0.004543477357567356,-1.341554185295706e-7,-1.6104693284517906e-8,0.0045438176089469635,-3.6995599015852086e-7,-1.5568968349127696e-8,0.004544254057927853,-5.868612278189073e-7,-1.507632289085078e-8,0.004544778812882803,-7.409000787411416e-7,-1.4726631776247386e-8,0.0045453638821404034,-7.933529756111925e-7,-1.4607830316871693e-8,0.004545962512626217,-7.226259496806341e-7,-1.4768947865738407e-8,0.004546517831531095,-5.353354038386974e-7,-1.5194914668309396e-8,0.004546978401910495,-2.705801777601392e-7,-1.5796839796783648e-8,0.004547315606031961,7.426064280520287e-9,-1.6428760347708144e-8,0.00454753489003374,2.2771495362971647e-7,-1.6929398929145512e-8,0.004547674975302893,3.348200634734904e-7,-1.7172762210130373e-8,0.004547795269270398,3.0546407671952013e-7,-1.7106022758788838e-8,0.004547957342816333,1.5361082419481356e-7,-1.6760923023671023e-8,0.004548207818776337,-7.620926519655014e-8,-1.623857269178295e-8,0.004548567688113334,-3.2310178950335675e-7,-1.5677235728358874e-8,0.004549029689400049,-5.261904517049809e-7,-1.5215224434557068e-8,0.004549562879332015,-6.387181991297879e-7,-1.4958938590346338e-8,0.004550122119909111,-6.369676213818445e-7,-1.4962560924246113e-8,0.004550659547407562,-5.227487180281773e-7,-1.522226203843342e-8,0.00455113503524916,-3.198295674394947e-7,-1.568415057741117e-8,0.004551523306381531,-6.614611648123595e-8,-1.6261898726347644e-8,0.004551816641272785,1.9551328796095916e-7,-1.685796274830549e-8,0.004552023601182218,4.2580724108011224e-7,-1.7382583753550408e-8,0.004552165189758773,5.945892816202448e-7,-1.7766991018379748e-8,0.004552270093790798,6.837932410099917e-7,-1.7970026091410244e-8,0.004552370226282839,6.880617875256065e-7,-1.797954851084639e-8,0.004552497089156715,6.141061808103928e-7,-1.781091130786019e-8,0.004552678823971549,4.796156243032983e-7,-1.7504429067141582e-8,0.004552937441607541,3.1202357072442164e-7,-1.7122570952647516e-8,0.004553285657210565,1.4683488458868566e-7,-1.6746191281231358e-8,0.004553723072438308,2.461230159602889e-8,-1.6467701649164962e-8,0.004554232297584862,-1.4673606685835707e-8,-1.6378198838017022e-8,0.004554776931368462,5.916408340345163e-8,-1.654648595704409e-8,0.004555304544316013,2.5471410996338887e-7,-1.699210890005788e-8,0.004555757580182239,5.487508779098537e-7,-1.766206390844868e-8,0.00455609163018589,8.847980560550384e-7,-1.8427567403072217e-8,0.004556294266149341,1.1862585904106192e-6,-1.9114066338961307e-8,0.00455639356224145,1.3819276275300728e-6,-1.955944643880223e-8,0.004556449423840962,1.4320994076717743e-6,-1.967347844662727e-8,0.00455653146260646,1.3415196289400694e-6,-1.9467164239301853e-8,0.004556695250636879,1.1538974614742377e-6,-1.9040064669564954e-8,0.00455696762660136,9.337292242152009e-7,-1.8538868697838413e-8,0.004557344253094815,7.457228920368247e-7,-1.8110674855141883e-8,0.004557796262614695,6.393184058846508e-7,-1.7867944352973605e-8,0.004558280964655819,6.408021303045762e-7,-1.7870661006435703e-8,0.004558752717751708,7.521507776956689e-7,-1.812364701480733e-8,0.004559171865542613,9.545520907436515e-7,-1.8584396920373626e-8,0.004559510918417762,1.214685417394258e-6,-1.9177186559210626e-8,0.0045597577345257365,1.492268065989241e-6,-1.9810175736451022e-8,0.004559915758252532,1.747525782261627e-6,-2.0392490975707653e-8,0.004560001790681829,1.947399946982737e-6,-2.084852456530275e-8,0.004560042130719432,2.069755428846989e-6,-2.112766147211479e-8,0.004560068031127442,2.105379942421046e-6,-2.1208875035905857e-8,0.004560111313149676,2.0580137470542224e-6,-2.110073390215724e-8,0.004560200668904181,1.943025512553438e-6,-2.083829693588606e-8,0.004560358702285993,1.785412603296129e-6,-2.0478523102675264e-8,0.004560599413535639,1.6174458646150957e-6,-2.009495393525646e-8,0.004560925771429382,1.4758038902445344e-6,-1.977126696599221e-8,0.004561327227637577,1.3976103681723366e-6,-1.9592281027131787e-8,0.004561777687863393,1.414475222692563e-6,-1.963031184849548e-8,0.004562235579990404,1.5439760444566057e-6,-1.9925614673578647e-8,0.004562648675447503,1.7796412722016043e-6,-2.046341689014831e-8,0.004562966076598825,2.0834817290894464e-6,-2.1156859279096877e-8,0.004563156563769151,2.3880171788488707e-6,-2.1851733662215338e-8,0.004563226026995868,2.6134961406077906e-6,-2.236596297709388e-8,0.004563222002259049,2.697182257226839e-6,-2.255654425324677e-8,0.004563218140920344,2.6200473503104345e-6,-2.2380369070183947e-8,0.004563285177328307,2.4142697533356353e-6,-2.1911080480621846e-8,0.00456346510562536,2.1474700508499156e-6,-2.1302898831592876e-8,0.0045637614855055355,1.8952029862123072e-6,-2.0727876983910757e-8,0.004564146109374209,1.717390042126911e-6,-2.0322347502066937e-8,0.004564573586655692,1.6467160412382832e-6,-2.0160696512706902e-8,0.004564995621143562,1.6879982482464885e-6,-2.025403919365333e-8,0.004565371098880404,1.823849272809698e-6,-2.0563061761098215e-8,0.004565671575998424,2.0224636955771143e-6,-2.1015577494141815e-8,0.004565883304822525,2.2451570701558744e-6,-2.1523520714831093e-8,0.004566007062175339,2.4528861969496664e-6,-2.1997743592595424e-8,0.004566056469157245,2.6116666971517507e-6,-2.23604574329312e-8,0.004566055109573586,2.6967378051573467e-6,-2.2554903643749895e-8,0.004566032787591015,2.6952576374760298e-6,-2.2551638035756678e-8,0.004566021340058094,2.6074130943391173e-6,-2.2351082445335482e-8,0.004566050456020915,2.445916611802514e-6,-2.198229461679592e-8,0.004566143978834918,2.234071638222029e-6,-2.1498460356284963e-8,0.004566316991076654,2.002834908710053e-6,-2.0970174692905903e-8,0.004566573698773829,1.7872369419549948e-6,-2.047735188978444e-8,0.004566906025496633,1.6222415688750605e-6,-2.009987915744285e-8,0.004567292941820179,1.5378947751270364e-6,-1.9906572258774763e-8,0.0045677009482845456,1.5534732761251689e-6,-1.9941722705096247e-8,0.004568086845586504,1.6706423254153708e-6,-2.0209304708076832e-8,0.004568404479915657,1.8669001932336232e-6,-2.065787129431821e-8,0.004568616641222311,2.0927296815380814e-6,-2.1174057753546027e-8,0.004568710628782926,2.277737563029436e-6,-2.159677431671749e-8,0.004568710906383361,2.3496980887248315e-6,-2.1760931647364762e-8,0.004568678450507578,2.2627328227331568e-6,-2.1561913449607736e-8,0.004568690934995052,2.0202730399911163e-6,-2.100789416692359e-8,0.004568811461316786,1.6765736725135978e-6,-2.0223021008261412e-8,0.004569064102334118,1.3138502582226867e-6,-1.939501198865483e-8,0.00456942983638702,1.0095623883627573e-6,-1.870048308376553e-8,0.0045698609228537225,8.126805895776015e-7,-1.8250956905805127e-8,0.004570301299600792,7.370286449055343e-7,-1.8077863586350383e-8,0.004570702395164331,7.675146472653699e-7,-1.8146849034032396e-8,0.004571031105591736,8.712119800734532e-7,-1.838299920858834e-8,0.004571271553897738,1.0077872223193491e-6,-1.8694474593890068e-8,0.004571423431715869,1.1371794672960694e-6,-1.898988427190855e-8,0.00457149912894306,1.224623094486609e-6,-1.9189713805360918e-8,0.004571520661368493,1.2439529482437433e-6,-1.9233970167685107e-8,0.004571516461258664,1.1798659800376192e-6,-1.90875063062554e-8,0.004571517887299565,1.0292685411183112e-6,-1.874320617434184e-8,0.00457155544903053,8.015811947188519e-7,-1.822266996676711e-8,0.004571654890494846,5.177527012148897e-7,-1.757386049492885e-8,0.0045718335249696285,2.0776980474633583e-7,-1.686531683855287e-8,0.004572097388308316,-9.323396016944465e-8,-1.6177255542095043e-8,0.004572439665645757,-3.4987692521596087e-7,-1.5590463436344316e-8,0.004572840644505964,-5.31972816140779e-7,-1.5173961796713732e-8,0.004573269348815289,-6.200415053200593e-7,-1.4972436045635267e-8,0.004573687024026574,-6.10406095595246e-7,-1.4994491965318193e-8,0.004574052809641157,-5.192579563073559e-7,-1.520320779417572e-8,0.00457433198222599,-3.843987328357727e-7,-1.5512049283710714e-8,0.004574506433080039,-2.6231970700412053e-7,-1.57915871799184e-8,0.004574585098804139,-2.1787955603130257e-7,-1.5893271807468845e-8,0.0045746091849351205,-3.056827632750247e-7,-1.569220003592137e-8,0.004574645498676162,-5.476968892825376e-7,-1.513834525051923e-8,0.004574765267068838,-9.184797312588896e-7,-1.4290196294897466e-8,0.00457501606601899,-1.3499749934384158e-6,-1.3303575679860455e-8,0.004575402559457306,-1.7569182650377685e-6,-1.2373436343486388e-8,0.00457588755670308,-2.0690376161348062e-6,-1.1660288023729968e-8,0.004576410675222101,-2.2521266223356963e-6,-1.1242149216779647e-8,0.004576911396180024,-2.3103385627944873e-6,-1.1109414454615705e-8,0.004577344958268909,-2.275047092560445e-6,-1.119036156480763e-8,0.004577688009744958,-2.190125367673378e-6,-1.1384764724171442e-8,0.00457793703023403,-2.1001362793857524e-6,-1.1590799048558753e-8,0.004578103680851678,-2.0432033769984585e-6,-1.1721260373927869e-8,0.004578209903486739,-2.0476287663152695e-6,-1.1711299731405369e-8,0.00457828387494594,-2.1305649056463137e-6,-1.1521549135013692e-8,0.004578356691217041,-2.2974938653969773e-6,-1.113942510021554e-8,0.004578459254883159,-2.5420904405371936e-6,-1.0579494532798996e-8,0.004578618975408969,-2.8466169571197294e-6,-9.882523233547e-9,0.004578856169100808,-3.183321162571054e-6,-9.112167432714705e-9,0.004579180478803452,-3.5174083811508843e-6,-8.34808453913955e-9,0.004579588120477424,-3.8118316727193404e-6,-7.674971745318212e-9,0.004580060934558044,-4.03352156185739e-6,-7.168392305513895e-9,0.0045805679854873955,-4.1600968235078126e-6,-6.87951141941344e-9,0.0045810699651512255,-4.185692981165825e-6,-6.821782230335321e-9,0.00458152603375295,-4.124467505914989e-6,-6.962856854404446e-9,0.004581902189684743,-4.010657797913334e-6,-7.224349646031663e-9,0.004582179915574498,-3.894438306832133e-6,-7.491268811747432e-9,0.004582363424246814,-3.833098119282915e-6,-7.632267271587255e-9,0.004582483126184382,-3.8777855317296025e-6,-7.53011848341852e-9,0.004582592398102796,-4.057840675385612e-6,-7.117693448106915e-9,0.004582755475052093,-4.367487092300224e-6,-6.408428922268497e-9,0.004583027684494128,-4.761913130848646e-6,-5.505193981758026e-9,0.004583434904318093,-5.1682652158940795e-6,-4.575001218916299e-9,0.004583962740856525,-5.509717091332434e-6,-3.793847647778333e-9,0.004584562235224711,-5.731726984261732e-6,-3.286608037184449e-9,0.0045851690079899594,-5.8173444046123675e-6,-3.092013230972495e-9,0.004585724984926677,-5.785936446522613e-6,-3.1655856948169594e-9,0.004586192672434863,-5.680003803249362e-6,-3.4098510201368928e-9,0.004586558909587067,-5.549240041603622e-6,-3.710862720240599e-9,0.004586831090544941,-5.438473165345392e-6,-3.965824489806852e-9,0.004587030516411275,-5.381337431846182e-6,-4.097587491428378e-9,0.004587186126494469,-5.398361853965937e-6,-4.059053627389166e-9,0.0045873298103882906,-5.49731379182367e-6,-3.8324359563939324e-9,0.004587493095288864,-5.6741958005571095e-6,-3.427014054705955e-9,0.0045877044693880785,-5.914235263036652e-6,-2.876857912876998e-9,0.004587986651218072,-6.192958116809043e-6,-2.238299632400325e-9,0.004588353448843592,-6.477950803344133e-6,-1.5858038797377467e-9,0.004588806428404769,-6.73216177730537e-6,-1.0043412823020856e-9,0.00458933233628059,-6.919340188748711e-6,-5.769299288868636e-10,0.004589902743292579,-7.011376771941958e-6,-3.6786881572565e-10,0.004590477310455618,-6.996130497857601e-6,-4.0485922692968167e-10,0.004591011167147137,-6.883260760486553e-6,-6.656513658249578e-10,0.0045914652682251846,-6.705371049354524e-6,-1.075393733113511e-9,0.004591817010039603,-6.512924106794449e-6,-1.5182606557942965e-9,0.004592067796621043,-6.363468442006583e-6,-1.8621675068497396e-9,0.004592244944227824,-6.307637731525589e-6,-1.9909320328163395e-9,0.004592396800370081,-6.375463343972728e-6,-1.835720290287429e-9,0.004592581636072272,-6.566741952320174e-6,-1.397147556305703e-9,0.004592852503308843,-6.848670800862258e-6,-7.506592754098574e-10,0.0045932418347822595,-7.16265852740837e-6,-3.085310633349787e-11,0.004593750787773998,-7.439775464126724e-6,6.039907256439864e-10,0.004594348004365676,-7.620693551409611e-6,1.0176568839792315e-9,0.004594979307958952,-7.67285027729872e-6,1.1353900564086016e-9,0.004595584733360852,-7.597882344516838e-6,9.60993606260401e-10,0.004596115629330661,-7.427042036220201e-6,5.663444100107817e-10,0.004596545284004681,-7.208277314545172e-6,6.172570217697634e-11,0.004596870828408168,-6.9916428475073475e-6,-4.377209163440163e-10,0.004597108555701069,-6.818392915343977e-6,-8.371051908542961e-10,0.004597286586221487,-6.715617670183615e-6,-1.0741512526115635e-9,0.004597438018468549,-6.6953943241077795e-6,-1.1211643140079087e-9,0.004597595917342151,-6.7563461785649045e-6,-9.814428534041288e-10,0.0045977900559172604,-6.8858632210796456e-6,-6.841521467843064e-10,0.004598044659033155,-7.062128212677125e-6,-2.796287018101613e-10,0.004598376318128057,-7.255916920005681e-6,1.6480339335871812e-10,0.004598791545151504,-7.4327601793754e-6,5.698408862789437e-10,0.004599284036273952,-7.55641510487658e-6,8.521963256757693e-10,0.004599832545317101,-7.59449169585154e-6,9.37519703522967e-10,0.004600401089893143,-7.526267837569374e-6,7.783330705853753e-10,0.0046009435048163455,-7.351117380604259e-6,3.7337668699399923e-10,0.004601413323426574,-7.094082392306315e-6,-2.1959916877791475e-10,0.004601777276461345,-6.804398311453375e-6,-8.872456883447427e-10,0.004602027574734469,-6.544807205465784e-6,-1.4852269544859042e-9,0.004602187108824936,-6.373998484428838e-6,-1.878640796994688e-9,0.004602304305622246,-6.328662725555859e-6,-1.983290254130587e-9,0.004602439234285484,-6.4122851305789306e-6,-1.7913894121004542e-9,0.004602646341656962,-6.59454075292182e-6,-1.372856112257814e-9,0.004602959791749618,-6.820555679744346e-6,-8.539567811146143e-10,0.004603385401025903,-7.026168406663905e-6,-3.8223413598513426e-10,0.004603900535041509,-7.154432726648315e-6,-8.862971018962839e-11,0.004604461221360877,-7.16909923779504e-6,-5.6530923583887666e-11,0.004605014161836207,-7.061911347469658e-6,-3.0496913721986693e-10,0.004605510173710997,-6.852198505821913e-6,-7.894778705239851e-10,0.004605915231864156,-6.579480498016876e-6,-1.4190378636351609e-9,0.004606216233404941,-6.291994615044852e-6,-2.0824711583876744e-9,0.00460642071017142,-6.035108556079831e-6,-2.675171494544614e-9,0.00460655193149057,-5.842863718623184e-6,-3.1186589302558516e-9,0.004606641995139615,-5.733972110264688e-6,-3.369853455113043e-9,0.004606725264452894,-5.711711571864843e-6,-3.4213163304000836e-9,0.0046068334424430035,-5.7661813773756325e-6,-3.2960088168680032e-9,0.004606992447073734,-5.877366283212291e-6,-3.0401786490361465e-9,0.004607220525040382,-6.01804827384349e-6,-2.7166204947669695e-9,0.004607526828035787,-6.156368380259616e-6,-2.3987754818787228e-9,0.004607909878637184,-6.2584771004198995e-6,-2.1646433927517645e-9,0.004608355861891447,-6.292108699703443e-6,-2.0885544550141327e-9,0.004608837460403657,-6.231941022115572e-6,-2.2288041686048496e-9,0.004609314869247811,-6.066944432541149e-6,-2.610692390028512e-9,0.004609741181179981,-5.808287594175388e-6,-3.208296374163034e-9,0.004610073532643847,-5.494016982094601e-6,-3.9337217762102935e-9,0.004610288280096579,-5.185259144008995e-6,-4.645941435360547e-9,0.004610393895995997,-4.950873931477467e-6,-5.186269288801948e-9,0.004610433184336685,-4.844246198175972e-6,-5.431895389162019e-9,0.004610470758879338,-4.8829096485003395e-6,-5.342766223918112e-9,0.0046105707030473,-5.0419564476459976e-6,-4.976589310976798e-9,0.004610775446429694,-5.26417400954597e-6,-4.465310329754646e-9,0.004611094963682681,-5.480348310975678e-6,-3.968302033161426e-9,0.00461150823724263,-5.62972692844612e-6,-3.625329611994953e-9,0.004611973094222571,-5.673786679284628e-6,-3.524987578971608e-9,0.0046124390559712505,-5.60146915226002e-6,-3.692726761576285e-9,0.004612859222188488,-5.427288532920816e-6,-4.095184948750271e-9,0.004613199097686521,-5.184761096077944e-6,-4.655216115005645e-9,0.00461344157660515,-4.917463952163088e-6,-5.272388730713527e-9,0.004613587996069912,-4.669665926120923e-6,-5.844552407820035e-9,0.004613655691602776,-4.478251084401866e-6,-6.28652082530562e-9,0.004613673077859672,-4.367267921755222e-6,-6.542744128551488e-9,0.00461367367651798,-4.345651474038695e-6,-6.592631310893555e-9,0.0046136904516331,-4.407814373872608e-6,-6.449178045460803e-9,0.004613751389181142,-4.536239263420983e-6,-6.152919507168062e-9,0.004613876649815567,-4.704994955452618e-6,-5.763751856803909e-9,0.004614077028175075,-4.883303608630905e-6,-5.352690069082215e-9,0.004614353162834188,-5.038827337005442e-6,-4.994329710158694e-9,0.004614695036423012,-5.140875843306533e-6,-4.759499974144619e-9,0.004615081647533657,-5.164078436357073e-6,-4.706796509128987e-9,0.004615481345908867,-5.093156815280933e-6,-4.871507157630509e-9,0.004615854140456318,-4.928932317867542e-6,-5.251665030544923e-9,0.004616157793161933,-4.694284295014727e-6,-5.794263848231378e-9,0.004616358878782183,-4.436656622864292e-6,-6.389541647842568e-9,0.004616447225878722,-4.222062557520083e-6,-6.884973524270293e-9,0.004616447316459371,-4.117217975337249e-6,-7.126660174101772e-9,0.0046164171712829195,-4.163817419832329e-6,-7.018720722844495e-9,0.004616430002982171,-4.358091358751388e-6,-6.5703061256921416e-9,0.004616545920780777,-4.64955458388336e-6,-5.898225015384205e-9,0.004616789519416018,-4.961068379082266e-6,-5.180477898492885e-9,0.004617144952363664,-5.21797868115541e-6,-4.5890532040936815e-9,0.004617567428571435,-5.370589400078979e-6,-4.238257150629672e-9,0.004618001377383055,-5.4024523567296e-6,-4.165786813726474e-9,0.00461839617858386,-5.326689531338634e-6,-4.341319230810882e-9,0.004618715659086564,-5.176427103811998e-6,-4.688546619249612e-9,0.004618941704013463,-4.994299138923035e-6,-5.1092602716603065e-9,0.0046190738457956015,-4.823500218588578e-6,-5.503860695653606e-9,0.004619126539673815,-4.701021915286869e-6,-5.786919842108562e-9,0.00461912513350184,-4.6530002781485684e-6,-5.897985711351209e-9,0.004619101113456684,-4.692128922859444e-6,-5.8076723886911916e-9,0.004619087174435325,-4.817110070681227e-6,-5.5190059356818914e-9,0.004619112672785507,-5.013950645613634e-6,-5.064416509080086e-9,0.004619199956383798,-5.258745206492392e-6,-4.499227652478228e-9,0.004619361925076508,-5.521396310506229e-6,-3.892989039720409e-9,0.004619600861690062,-5.769630238686212e-6,-3.3201995651143257e-9,0.0046199082837785595,-5.972903127371703e-6,-2.851352592334347e-9,0.004620265553426885,-6.106140175320044e-6,-2.5443702178223045e-9,0.004620645157437597,-6.15344235394916e-6,-2.4360418005486742e-9,0.004621012910332626,-6.111969284666793e-6,-2.5329705998129033e-9,0.004621331889116244,-5.995896088586415e-6,-2.8023280874564467e-9,0.004621569196957076,-5.839257062531263e-6,-3.16525563366286e-9,0.004621705946598681,-5.6949592448301445e-6,-3.499245426945735e-9,0.0046217486369424686,-5.626269776579186e-6,-3.6579976183436843e-9,0.004621736346891752,-5.688589628394338e-6,-3.5136773121236357e-9,0.004621735560203208,-5.9056093086997374e-6,-3.011976455429588e-9,0.004621818663207311,-6.252544277839716e-6,-2.2106262735571202e-9,0.004622034186749106,-6.660327133482274e-6,-1.269447535738715e-9,0.004622386277920894,-7.0421296244785226e-6,-3.8895869566759596e-10,0.004622835921998608,-7.326987257096725e-6,2.672247922603419e-10,0.004623320597655784,-7.481387241366695e-6,6.22078154458821e-10,0.004623778166074979,-7.511256501722334e-6,6.895832720469361e-10,0.0046241631750252934,-7.4503005879202574e-6,5.476957123973267e-10,0.0046244526906444455,-7.344777280885875e-6,3.031921981158643e-10,0.004624644751104253,-7.241142852555951e-6,6.324918068849496e-11,0.0046247535293354415,-7.178329664083658e-6,-8.227089394819571e-11,0.004624803929537004,-7.1838293799132266e-6,-6.982495105222414e-11,0.004624826696230001,-7.272134715425384e-6,1.3414464882997706e-10,0.004624854095060916,-7.444583539571314e-6,5.327371256362688e-10,0.004624916026302616,-7.690267618702546e-6,1.1006291093985203e-9,0.004625036574007785,-7.98793405485864e-6,1.7885067099525766e-9,0.004625231133799637,-8.30888821439031e-6,2.5298802519654072e-9,0.004625504428824734,-8.620815020618825e-6,3.2500039740028935e-9,0.004625849747329165,-8.892151827359156e-6,3.875986187591585e-9,0.0046262495157665465,-9.09652545200698e-6,4.346970267559263e-9,0.004626677147753625,-9.216883627944467e-6,4.623605244888573e-9,0.004627100098948487,-9.249002221467704e-6,4.6961442314090165e-9,0.004627484100502901,-9.204044867914665e-6,4.590434874603475e-9,0.004627798689161824,-9.109776567161958e-6,4.3708109803278244e-9,0.004628024187515499,-9.0095003276215e-6,4.1376398888795614e-9,0.004628159602392367,-8.956974239448121e-6,4.015455545081188e-9,0.004628229255540625,-9.005485803645908e-6,4.127521100134283e-9,0.004628283803510658,-9.1910726190435e-6,4.556926589182645e-9,0.004628390435834369,-9.514454774165462e-6,5.304877259037512e-9,0.004628610918423801,-9.931843970056032e-6,6.269651296939101e-9,0.004628975503068454,-1.03648245865506e-5,7.2696549997176675e-9,0.004629467998225569,-1.0728850454589621e-5,8.10939549229837e-9,0.004630032512152586,-1.0965482676576773e-5,8.65397700401509e-9,0.004630597398772655,-1.1060056137677217e-5,8.86984853736169e-9,0.004631101082919748,-1.1038122203419039e-5,8.816457412620772e-9,0.004631507147841215,-1.0948389067229884e-5,8.606690701628071e-9,0.004631806481354592,-1.0844288661248472e-5,8.364204739480547e-9,0.004632011465302068,-1.0771358781577292e-5,8.194291991699351e-9,0.004632147892557216,-1.0761401585255883e-5,8.170455351365712e-9,0.004632247893263616,-1.0831308542105932e-5,8.331728476942694e-9,0.00463234477781505,-1.0984114505098195e-5,8.685073680741978e-9,0.004632469369290628,-1.1210771926742844e-5,9.209415190899736e-9,0.004632647141513031,-1.1492171204089592e-5,9.860291714348777e-9,0.004632895765556187,-1.1801489544677315e-5,1.0575356211698413e-8,0.004633222987185644,-1.2107161747595294e-5,1.1281365019742708e-8,0.004633625109689717,-1.2376748980879223e-5,1.1903214390625413e-8,0.004634086659004174,-1.2581610090192167e-5,1.2374746891829162e-8,0.004634581752502566,-1.2701806877036646e-5,1.2650024924146413e-8,0.004635077356706937,-1.273044813037253e-5,1.2713298103112125e-8,0.004635538281190807,-1.2676599340062202e-5,1.2585709492729057e-8,0.004635933426539173,-1.2565907068775515e-5,1.2326775887080312e-8,0.0046362425090470906,-1.2438342120984666e-5,1.202920592778017e-8,0.004636462294497865,-1.234271921279755e-5,1.1806193185873564e-8,0.004636611028747824,-1.232775517799123e-5,1.1770617073140064e-8,0.004636729067608224,-1.2429993538057063e-5,1.2006973681361427e-8,0.004636873204322435,-1.2660614669240317e-5,1.2540806146547426e-8,0.004637103047741207,-1.2995764214321633e-5,1.3316407776853431e-8,0.004637461294852211,-1.3376967540621544e-5,1.4197950262497705e-8,0.00463795534065098,-1.3726217412767458e-5,1.5004554273269622e-8,0.004638550845381015,-1.3972478316380603e-5,1.5571711376454045e-8,0.004639183148953752,-1.4077211752893863e-5,1.5810383357853653e-8,0.0046397812865391925,-1.4045280259926954e-5,1.5732214181573113e-8,0.0046402914283477465,-1.3917086868911308e-5,1.5431235497281092e-8,0.004640688992994678,-1.3749519789539588e-5,1.50396004361683e-8,0.004640977811977925,-1.3597154104758875e-5,1.4683939035007512e-8,0.0046411816590931215,-1.3500634643284917e-5,1.4458435271925997e-8,0.004641334337283517,-1.3482814716284878e-5,1.4415936504639937e-8,0.004641471841569615,-1.3549864644392499e-5,1.45705737914381e-8,0.004641627345314647,-1.36943373473814e-5,1.4904873429144573e-8,0.004641828265389255,-1.3898382253809021e-5,1.5377192152694978e-8,0.004642094369945667,-1.4136568493739574e-5,1.592827642183505e-8,0.004642436229981527,-1.4378530825307724e-5,1.648746362443435e-8,0.004642853793025203,-1.4591962398589605e-5,1.6979710468902657e-8,0.00464333536372152,-1.4746476784586312e-5,1.7334602810121096e-8,0.004643857739129038,-1.481845010519349e-5,1.749756817785199e-8,0.00464438837763796,-1.479624509342569e-5,1.7441917675913e-8,0.0046448901141322415,-1.4684572553892183e-5,1.7178880316379137e-8,0.00464532817306209,-1.4506395760338885e-5,1.676197448758261e-8,0.0046456782783954416,-1.4300948688484878e-5,1.628240091514535e-8,0.004645933875498211,-1.4117326680498562e-5,1.5854168093428857e-8,0.004646110289799332,-1.4004423473821114e-5,1.5590715394014384e-8,0.004646244116896511,-1.399911276381716e-5,1.5577449679665026e-8,0.004646387005593405,-1.41153100211975e-5,1.5846355805771457e-8,0.004646594141764705,-1.4337032558028205e-5,1.6359950354097322e-8,0.004646909305258094,-1.4618613247030586e-5,1.701188561366317e-8,0.0046473503812339495,-1.4894178333601433e-5,1.7649042879564176e-8,0.004647900916773948,-1.5095625610264924e-5,1.811329983033688e-8,0.004648512809389593,-1.5173842404411922e-5,1.829077431406508e-8,0.004649120903019922,-1.5114403601433032e-5,1.8148248545685655e-8,0.004649663817187577,-1.4940331193331636e-5,1.7739550224659373e-8,0.004650101646361556,-1.4701189768492982e-5,1.7180166575556488e-8,0.004650423559198932,-1.4455016176381626e-5,1.6605176919502795e-8,0.004650644665764515,-1.4251827770794912e-5,1.613086614501808e-8,0.004650796624019296,-1.4124141025250696e-5,1.583268895658235e-8,0.004650917415804542,-1.4084914955533756e-5,1.5740543813909623e-8,0.004651043598431591,-1.4130241265291127e-5,1.5845089278510927e-8,0.0046512057278376125,-1.4243729279101672e-5,1.6107974164142077e-8,0.0046514261340793615,-1.4400690454054686e-5,1.6471579916206996e-8,0.00465171789456136,-1.4571531090473221e-5,1.6866922638427443e-8,0.004652084137226091,-1.4724599130893931e-5,1.7220302263998086e-8,0.00465251732741125,-1.4829134893015994e-5,1.746020024223448e-8,0.004652998819609395,-1.4859005735948932e-5,1.7525983107701823e-8,0.004653499526234626,-1.4797478165342453e-5,1.7378984205893643e-8,0.004653982822792938,-1.4642447874902636e-5,1.701461884775316e-8,0.004654410522758944,-1.4410540357957179e-5,1.6471859896107837e-8,0.004654751676673082,-1.4137726039344877e-5,1.5834608479389963e-8,0.0046549921899199246,-1.3874312315314267e-5,1.5219993013443092e-8,0.004655141733859297,-1.3673984905797297e-5,1.4752835810267254e-8,0.004655234441725839,-1.3579420898515158e-5,1.4532174851046341e-8,0.00465532189043984,-1.3609191262358246e-5,1.460084197006534e-8,0.00465545992364021,-1.3750758727023153e-5,1.4929278998332993e-8,0.004655693328327301,-1.3962304090208998e-5,1.5419907146882814e-8,0.004656043110456753,-1.4183068768481111e-5,1.5931259431933548e-8,0.0046565001678516875,-1.434927671056179e-5,1.631501554350779e-8,0.004657027305155954,-1.4411158052329369e-5,1.6455548921583325e-8,0.004657569281103155,-1.434612452943196e-5,1.630052615942731e-8,0.004658068049326739,-1.41639120076071e-5,1.5872851697627348e-8,0.0046584782426453645,-1.3901969676808915e-5,1.525993191601153e-8,0.0046587776708922075,-1.3613082255371558e-5,1.458484088844579e-8,0.004658969832612916,-1.3350233172794423e-5,1.397103491590227e-8,0.004659079003760188,-1.3154157206487545e-5,1.3513330900768914e-8,0.004659141208384155,-1.3046837117797856e-5,1.3262761688597618e-8,0.004659194957403009,-1.3031068730407019e-5,1.3225604937819598e-8,0.004659274330167408,-1.3094026415269862e-5,1.3371747416260096e-8,0.0046594050651191455,-1.3212282800757067e-5,1.3646426315830232e-8,0.004659602999671059,-1.3356523513515203e-5,1.3981232874721674e-8,0.004659873789227049,-1.3495310852038219E-05,1.430287645128278e-8,0.004660213024776066,-1.359808005239616e-5,1.4540151248134795e-8,0.00466060633304002,-1.3637992835869933e-5,1.4630579714044076e-8,0.00466102965981684,-1.3595349253137439e-5,1.4528372069494455e-8,0.004661450563042212,-1.3461902340691184e-5,1.421449651710166e-8,0.004661831730217652,-1.3245578696188559e-5,1.3707678548966238e-8,0.004662137755511344,-1.2973872164911173e-5,1.307227092715899e-8,0.004662344999202101,-1.2693012432152884e-5,1.2416231574338447e-8,0.0046624519407560735,-1.2460082818593682E-05,1.1872648439435237e-8,0.004662485004202495,-1.2327880026386206e-5,1.1564379854227212e-8,0.004662494901102442,-1.2327021407297365e-5,1.1562375295099926e-8,0.004662542595555069,-1.24533420275431e-5,1.185644126351985e-8,0.0046626799506357805,-1.2667322066857839e-5,1.2354101779958266e-8,0.004662933402383711,-1.2906251170550697e-5,1.2909087247827492e-8,0.004663297073919368,-1.3103506845817271e-5,1.3366273288023952e-8,0.004663736575308624,-1.3207064274389993e-5,1.360471420722314e-8,0.00466420034455511,-1.3191474217760806e-5,1.3565421464328888e-8,0.004664633821846689,-1.3061257113502004e-5,1.3259181775894936e-8,0.0046649923454657955,-1.284657142486857e-5,1.2756441236261749e-8,0.0046652500093320995,-1.2593575575264028e-5,1.2164869400910327e-8,0.004665403125135055,-1.2352518526780268e-5,1.160163133759852e-8,0.004665468293837048,-1.2166612359423423e-5,1.1167452954822372e-8,0.004665476372929213,-1.2064179756235221e-5,1.092829431744967e-8,0.004665464527011558,-1.205536188602705e-5,1.090765701107904e-8,0.00466546866248559,-1.2133139463074206e-5,1.1088976843000324e-8,0.004665517840456056,-1.2277264814901737e-5,1.1424838647350068e-8,0.00466563119751025,-1.245936221956031e-5,1.1848924275875613e-8,0.004665817006354218,-1.2647802841822536e-5,1.2287410809984839e-8,0.004666073053110041,-1.281166414378168e-5,1.2668190698852117e-8,0.004666387542373383,-1.292381306206243e-5,1.2928022906658796e-8,0.004666740117300406,-1.2963606556451226e-5,1.3018805625924864e-8,0.004667103089208761,-1.2919782368290056e-5,1.2914336858847914e-8,0.004667443516313451,-1.2793855787151033e-5,1.261828935995056e-8,0.004667727216102982,-1.2603634007130076e-5,1.2172443742013038e-8,0.004667925717887047,-1.2385223968453717e-5,1.1661335221281164e-8,0.004668025982969037,-1.2190587373047782e-5,1.1206425769168459e-8,0.004668040124918859,-1.2077562615726495e-5,1.0942668267392677e-8,0.004668009332740903,-1.2092131257680859e-5,1.0977046211594681e-8,0.004667995963365245,-1.2248776168792324e-5,1.1342816317376177e-8,0.004668063394253834,-1.2519839245074089e-5,1.1974895693262607e-8,0.004668252213447853,-1.2842352538933383e-5,1.272604191553377e-8,0.004668565476656956,-1.3140346753934688e-5,1.3419026252516424e-8,0.004668970137839872,-1.3350798188378615e-5,1.390712963685913e-8,0.00466941145688206,-1.3440881943664238e-5,1.4114239617360718e-8,0.004669831352637258,-1.3411820715628956e-5,1.4043647933471819e-8,0.004670183125758375,-1.3292231840828618e-5,1.3762398499525709e-8,0.004670439551567326,-1.3126587614643615e-5,1.3374333363953765e-8,0.0046705947835942166,-1.2963357965618242e-5,1.2992486691062576e-8,0.004670661871582767,-1.2845325839862214e-5,1.2716578643366719e-8,0.004670667699865216,-1.2802931475699457e-5,1.2617538625965364e-8,0.004670646681376949,-1.2850763728081769e-5,1.2729307862896565e-8,0.00467063427678483,-1.2987111806417097e-5,1.304775137827414e-8,0.004670661343090428,-1.3196164916613432e-5,1.353577457443399e-8,0.004670750064167247,-1.3452020070287972e-5,1.4132715042564545e-8,0.004670911777831962,-1.3723508501828329e-5,1.4765677409608379e-8,0.004671146597861861,-1.397894625705489e-5,1.5360669460035923e-8,0.004671444375319671,-1.4190158848444865e-5,1.5851986140975655e-8,0.004671786392194452,-1.4335593144657587e-5,1.6189419371909977e-8,0.004672147385320302,-1.440277455442945e-5,1.634395024210514e-8,0.004672497882915822,-1.439047323877524e-5,1.63128171558708e-8,0.004672807221955093,-1.4310754474099981e-5,1.6124358297051074e-8,0.004673047967062916,-1.4190585450886653e-5,1.5841798023873977e-8,0.004673202402940901,-1.4071681804180103e-5,1.556283414706472e-8,0.004673270739720579,-1.4006175424222032e-5,1.5409373309145138e-8,0.004673278417874302,-1.4045585886180635e-5,1.5501616287218707e-8,0.0046732771097705355,-1.4223112429589761e-5,1.5916656213600744e-8,0.0046733335426375954,-1.4535231411889031e-5,1.6645637433110732e-8,0.0046735060396706435,-1.4934337773744007e-5,1.7576826633511244e-8,0.004673819189801707,-1.5341741234222534e-5,1.852618723245616e-8,0.004674252268579398,-1.5677278964770178e-5,1.9306615085994873e-8,0.004674748944885229,-1.5888924620635015e-5,1.9797027686382072e-8,0.004675240882951573,-1.5966460031890974e-5,1.997414641383107e-8,0.004675670613593522,-1.593625842060622e-5,1.9900119679567408e-8,0.0046760041793818975,-1.5845643844857367e-5,1.9685820881802324e-8,0.00467623309851158,-1.5746690960885734e-5,1.945294625392006e-8,0.004676369818220206,-1.568457041001168e-5,1.930686205008403e-8,0.004676440772138309,-1.5691203227189234e-5,1.932191376955323e-8,0.004676479528732202,-1.5782987495501686e-5,1.9536206216259085e-8,0.004676520954653062,-1.5961033347667108e-5,1.995215400474037e-8,0.004676596422060922,-1.6212951573783454e-5,2.0540610281932875e-8,0.004676730027189161,-1.6515837372076925e-5,2.1247813816331533e-8,0.004676935979999788,-1.6840152095742693e-5,2.2004505046599017e-8,0.004677217318990602,-1.7154102391278926e-5,2.2736247570911134e-8,0.00467756602649892,-1.7428077777037665e-5,2.3373860561672378e-8,0.004677964479425937,-1.763863379374355e-5,2.3862716425329537e-8,0.0046783879238457065,-1.7771596392012232e-5,2.4169923607945506e-8,0.004678807583239352,-1.782417897198473e-5,2.4289203675387195e-8,0.004679194192743565,-1.780618647288843e-5,2.4243687912563586e-8,0.004679521978008149,-1.7740311713799754e-5,2.4086639550366526e-8,0.0046797732769125674,-1.7661270247751158e-5,2.3899445231071237e-8,0.004679943926326737,-1.7612934963310745e-5,2.378485408762777e-8,0.00468004874105327,-1.76419904879494e-5,2.38520116422879e-8,0.0046801248137174605,-1.7786845602176726e-5,2.4190427202702886e-8,0.004680228593309382,-1.806263404032576e-5,2.4834927068767032e-8,0.004680422650323219,-1.844760764224442e-5,2.5734020536887993e-8,0.0046807527992763975,-1.8880759513499523e-5,2.674458018490809e-8,0.0046812254701966765,-1.9278549072575866e-5,2.7671099756894892e-8,0.004681800427430815,-1.9566523632612258e-5,2.8339657629219468e-8,0.004682406079741662,-1.9708395147643984e-5,2.8665861411746463e-8,0.004682968366748158,-1.9715465849410977e-5,2.867679352392317e-8,0.004683435608529261,-1.9634266355882566e-5,2.8481924313167707e-8,0.0046837883337889595,-1.952439154406978e-5,2.822106187628867e-8,0.004684035487230924,-1.9439673756009193e-5,2.8020203083391307e-8,0.004684204485088165,-1.941806770279495e-5,2.7967929163297136e-8,0.00468433116167156,-1.9479029937500837e-5,2.8109428435669545e-8,0.004684452186456466,-1.9625176187452407e-5,2.845049597540157e-8,0.004684600168465979,-1.984553498761316e-5,2.896517248241957e-8,0.0046848006032723915,-2.0118998764571928e-5,2.9603786467988204e-8,0.0046850698397548065,-2.041773635670475e-5,3.0300926191513015e-8,0.004685413783371999,-2.0710763850050337e-5,3.098384943257845e-8,0.00468582740770953,-2.096777642395736e-5,3.1581541361914726e-8,0.004686295292293071,-2.1163165376747107e-5,3.203417446835051e-8,0.004686793459251504,-2.127986172954694e-5,3.230208207219933e-8,0.004687292561605285,-2.1312386356273433e-5,3.2372809600881676e-8,0.0046877621105637915,-2.126854613740853e-5,3.2264991110637834e-8,0.004688175258111988,-2.1169442043346494e-5,3.202831932504239e-8,0.004688513640797768,-2.104761290672734e-5,3.173919627450822e-8,0.004688771804655766,-2.0943260277204035e-5,3.149188772523059e-8,0.004688960704666771,-2.089847309766487e-5,3.138494951118754e-8,0.004689109427812848,-2.0949239557927876e-5,3.150244410680444e-8,0.0046892635417487075,-2.111546408427255e-5,3.189053130139887e-8,0.004689477922148566,-2.139077308886334e-5,3.253367882818093e-8,0.004689802698454854,-2.1736387602686895e-5,3.3340499356742825e-8,0.004690264446209853,-2.2085256460148676e-5,3.415361339714332e-8,0.004690850572478942,-2.2360461861946586e-5,3.4792836260214054e-8,0.004691507905376526,-2.2503277074614084e-5,3.512087981369812e-8,0.0046921603699025816,-2.2496547289027997e-5,3.5098078105129547e-8,0.004692737515622717,-2.2369205648309436e-5,3.4792895698371355e-8,0.0046931977430484575,-2.218033828194287e-5,3.434443116540985e-8,0.004693535450245421,-2.19946049648199e-5,3.390460552743203e-8,0.004693773572452373,-2.1862829343110403e-5,3.359254933534034e-8,0.0046939501630360635,-2.181362607661693e-5,3.3475032195887265e-8,0.004694106408800557,-2.1853986931876104e-5,3.356800326714713e-8,0.004694278929507639,-2.1974145041739544e-5,3.384814078091561e-8,0.004694495986966662,-2.2153135943492177e-5,3.4265942399950725e-8,0.00469477605708682,-2.236343686777121e-5,3.475658838964401e-8,0.004695127385027143,-2.25745849279392e-5,3.5248415385464474e-8,0.004695547882976639,-2.2756322352379375e-5,3.567032900021728e-8,0.004696025355911659,-2.2881787560675736e-5,3.595935203368904e-8,0.004696538399017729,-2.2930998865573962e-5,3.6068830865346576e-8,0.0046970585118214685,-2.2894428695522926e-5,3.597678695177047e-8,0.0046975538398428066,-2.277591695522771e-5,3.569266368776685e-8,0.004697994417085737,-2.2593897361128732e-5,3.52601055038316e-8,0.004698358163045725,-2.238005741037552e-5,3.475374675121492e-8,0.0046986364344812365,-2.2175013783692378e-5,3.4269031535764016e-8,0.0046988377483364,-2.2021316841364653e-5,3.3905777612987485e-8,0.004698988505350433,-2.1954843872662592E-05,3.3747957039559153e-8,0.00469913001615439,-2.199603289469974e-5,3.384312019587815e-8,0.004699311555481439,-2.2142626039551497e-5,3.418542095617081e-8,0.004699579681160445,-2.2366028659942287e-5,3.470720003209844e-8,0.004699965159038889,-2.261379023439517e-5,3.528496641002932e-8,0.0047004707613474824,-2.2820209470544427e-5,3.576439822294622e-8,0.004701065275270101,-2.29245915141501e-5,3.600321104272019e-8,0.0047016890656927665,-2.2891951736126434e-5,3.591970431021748e-8,0.004702272011748362,-2.2726666777386748e-5,3.5524736397453896e-8,0.004702756920507253,-2.2470877734699576e-5,3.491788013206634e-8,0.004703116987165939,-2.2187808782063738e-5,3.4248104068405246e-8,0.004703359534640568,-2.193925935774467e-5,3.3660754039070295e-8,0.004703517130520162,-2.176842696306175e-5,3.325714330433221e-8,0.004703633418269326,-2.1693450292192006e-5,3.3079469125848756e-8,0.004703750784664788,-2.1710014565138826e-5,3.311710181821752e-8,0.004703902999268972,-2.1798210735348334e-5,3.332284229703271e-8,0.00470411241473192,-2.1929606093883388e-5,3.362958798550564e-8,0.004704389870876045,-2.207267688476105e-5,3.396308166894864e-8,0.0047047356012256255,-2.2196523423997598e-5,3.425061394883235e-8,0.004705140226676658,-2.2273583221930157e-5,3.4427402906015455e-8,0.004705585684179088,-2.2282131344618075e-5,3.444250019797068e-8,0.004706046484988976,-2.2209080754436687e-5,3.426539393023329e-8,0.004706492021561705,-2.205305499960459e-5,3.389321201807501e-8,0.004706890608130669,-2.182697129221664e-5,3.3356730967267744e-8,0.00470721539646339,-2.1558758464267093e-5,3.2721977504560417e-8,0.004707451321018943,-2.12887104727388e-5,3.208392178194558e-8,0.004707601124258925,-2.1062650368795808e-5,3.1550339335174934e-8,0.004707687923092548,-2.092164673284272e-5,3.1217597646232705e-8,0.004707752373939844,-2.0890881213821516e-5,3.1144495257733445e-8,0.004707844271649323,-2.097124597532204e-5,3.1332583670419434e-8,0.004708010475613604,-2.113670162270532e-5,3.172008981581706e-8,0.004708282385389394,-2.1338748014371744e-5,3.219257613945702e-8,0.0047086664359290925,-2.15173693706775e-5,3.2608780636782456e-8,0.0047091404880734164,-2.161606952423453e-5,3.283599569519555e-8,0.004709657840613588,-2.159728736032355e-5,3.278626927707014e-8,0.0047101587972046815,-2.14536381865304e-5,3.244275536750323e-8,0.004710587092019814,-2.1210639927389882e-5,3.1866026733256766e-8,0.004710905784652387,-2.0918934500008726e-5,3.11756702803512e-8,0.004711106530119068,-2.0638435018091832e-5,3.051288304831013e-8,0.004711208865517889,-2.0420804081158147e-5,2.999917704131898e-8,0.004711250995690448,-2.029710843358638e-5,2.9707348003223693e-8,0.004711277151420492,-2.0274053881011356e-5,2.9652724627549498e-8,0.00471132674977426,-2.033766978305856e-5,2.9801983439850805e-8,0.00471142806619857,-2.046071242907155e-5,3.009067825446045e-8,0.004711596296366146,-2.061020016312087e-5,3.044100612335261e-8,0.004711834389857875,-2.0753171954947886e-5,3.077533281366249e-8,0.004712134965726818,-2.086041685204148e-5,3.1024925417154556e-8,0.004712482251510385,-2.090882235568343e-5,3.1135456149055995e-8,0.004712853737906606,-2.0883211847782863e-5,3.107133595210802e-8,0.004713221881139335,-2.0778334625325025e-5,3.082042383122008e-8,0.004713556597760101,-2.0601134262572815e-5,3.0399376917884984e-8,0.004713829354068818,-2.037263915355485e-5,2.9858068237885336e-8,0.004714019207495355,-2.0127999853239356e-5,2.9279591365504785e-8,0.004714120040236812,-1.9912737159773322e-5,2.8771311538676714e-8,0.00471414655809,-1.9773869991005393e-5,2.8443873226592142e-8,0.004714135386249772,-1.9746861801332327e-5,2.83804276963628e-8,0.004714138370032906,-1.984258160661189e-5,2.8606000254505665e-8,0.004714208596707071,-2.004036454826956e-5,2.9071316232283385e-8,0.004714383927031075,-2.029154199139544e-5,2.966130936884501e-8,0.00471467478824134,-2.0532945180363846e-5,3.022705867006223e-8,0.004715061013315357,-2.070513244011117e-5,3.0628741349271914e-8,0.00471549819391272,-2.076855953990602e-5,3.0773644450018024e-8,0.004715930398805945,-2.0712828599232458e-5,3.06378229761092e-8,0.00471630479798327,-2.0557372487725065e-5,3.02675794944921e-8,0.00471658419168978,-2.0344538606421003e-5,2.9763064924636998e-8,0.004716754587575241,-2.012762846230072e-5,2.9250034311585e-8,0.004716826391143379,-1.9957347775696705e-5,2.8847903519089865e-8,0.004716829482927148,-1.9870328926400146e-5,2.8642734974974278e-8,0.004716804183631088,-1.9882591570309303e-5,2.8671899620700577e-8,0.004716791192796836,-1.9989005281011388e-5,2.8922902741116466e-8,0.004716823437325514,-2.016770532199581e-5,2.934387756265717e-8,0.004716921469150951,-2.0387043502867066e-5,2.986002387931219e-8,0.0047170924226144694,-2.0612596164450385e-5,3.0390138793191444e-8,0.004717331446500595,-2.081266616228881e-5,3.085955828244744e-8,0.00471762425529221,-2.0961852660023846e-5,3.120852397033979e-8,0.004717949786709429,-2.104309008518074e-5,3.139695112234478e-8,0.004718282560551554,-2.104890203008696e-5,3.1407378398035346e-8,0.00471859492533725,-2.0982516486430054e-5,3.1247623321056654e-8,0.004718859796079545,-2.0859052414961204e-5,3.0953605446153896e-8,0.004719054624823485,-2.0706285041295662e-5,3.059112867970817e-8,0.004719167008269947,-2.0563643657749342e-5,3.025342322589191e-8,0.0047192012609654915,-2.0477478018717793e-5,3.00498426889888e-8,0.00471918345441392,-2.0491050133859172e-5,3.0082155472353386e-8,0.004719160711673773,-2.0630138351970563e-5,3.041060704503147e-8,0.004719191097019601,-2.0889406258420564e-5,3.1021931692673706e-8,0.004719325043469325,-2.1227769789697886e-5,3.181866698159706e-8,0.0047195859260143365,-2.1578468896618452e-5,3.264310559084911e-8,0.004719960156972756,-2.187111814865657e-5,3.3329373513019146e-8,0.004720402230039262,-2.2055137896671795e-5,3.375863627291979e-8,0.004720851199728154,-2.211368644516015e-5,3.3891818178741824e-8,0.004721249742534635,-2.2064084478755165e-5,3.3770422384395773e-8,0.004721558271420089,-2.194802371751545e-5,3.349326327499581e-8,0.004721761248337392,-2.181765833721016e-5,3.318355542341268e-8,0.004721866556401599,-2.1722520963282726e-5,3.295805030285286e-8,0.004721900238871268,-2.169987115382176e-5,3.29043510790176e-8,0.004721898892204645,-2.176929055241197e-5,3.306826983285239e-8,0.004721901529417458,-2.193141803818353e-5,3.345092527192641e-8,0.004721942348745987,-2.2170269412426117e-5,3.401426136456454e-8,0.004722045516212493,-2.2458138717909424e-5,3.4692640398515564e-8,0.004722222546618573,-2.2761699487966296e-5,3.540726851507083e-8,0.0047224722135377,-2.3047940802877143e-5,3.6080226653327896e-8,0.004722782394577666,-2.3288951948910685e-5,3.6645758612571877e-8,0.004723132980101565,-2.3465103100195668e-5,3.7057739558551584e-8,0.004723499026608934,-2.3566743782828097e-5,3.729363200615465e-8,0.004723853726366984,-2.3594919509001365e-5,3.7356145869933e-8,0.004724171226410891,-2.356158846622636e-5,3.727375668144662e-8,0.00472442964344223,-2.3489522051841577e-5,3.710048713221879e-8,0.004724614776565834,-2.3411574874169688e-5,3.691415587823861e-8,0.004724724794459883,-2.3368277341243487e-5,3.6810591870453345e-8,0.0047247752100325596,-2.340213360934399e-5,3.6890033197833116e-8,0.004724801818033701,-2.354741153860014e-5,3.723294414462482e-8,0.00472485768521177,-2.3816423663497148e-5,3.786770260091306e-8,0.004725000635390749,-2.418751526032683e-5,3.8742466858000376e-8,0.004725272431033011,-2.4603620051597823e-5,3.972202334985268e-8,0.0047256788219663705,-2.4987702204493527e-5,4.062439541897351e-8,0.004726183285667441,-2.5270759185625143e-5,4.128696584233639e-8,0.004726720126803429,-2.541754230471784e-5,4.162712542300643e-8,0.004727219448344189,-2.5435941739691993e-5,4.166429361538732e-8,0.004727629770664268,-2.536784151980682e-5,4.149811650246318e-8,0.00472792886355938,-2.5270329894455154e-5,4.126387077300937e-8,0.00472812265068321,-2.5197835046972124e-5,4.109015364379114e-8,0.0047282373150355555,-2.5190669974525258e-5,4.1071880240448236e-8,0.004728309665470908,-2.5270343003186838e-5,4.125937504726307e-8,0.004728378624615121,-2.543968430350618e-5,4.165883422548709e-8,0.004728478767596398,-2.5685707126707573e-5,4.223916565564198e-8,0.004728635885651726,-2.5983880913205705e-5,4.294209090323031e-8,0.004728864409439411,-2.6303109090072288e-5,4.369389967187808e-8,0.00472916659618418,-2.6610845597161917e-5,4.44175634064523e-8,0.004729533321857145,-2.687781278328495e-5,4.5043926732075706e-8,0.00472994622235607,-2.708187235910797e-5,4.55208730022123e-8,0.004730380793270376,-2.721067737099242e-5,4.5819553184842186e-8,0.004730809906752847,-2.7262961196945158e-5,4.593735403726144e-8,0.004731207297948036,-2.724866569169805e-5,4.589813042879811e-8,0.004731550882303068,-2.7188193463415645e-5,4.5750407942570875e-8,0.004731825972564864,-2.7110878798737e-5,4.5563763450471336e-8,0.004732028530653421,-2.7052515132200603e-5,4.54229491228676e-8,0.004732168446389242,-2.7051350258781955e-5,4.541834024160813e-8,0.004732272116670077,-2.714157631827611e-5,4.563044734216501e-8,0.004732382358303023,-2.734381236381859e-5,4.610740117539504e-8,0.004732552676207028,-2.765400554259749e-5,4.6838853150868065e-8,0.004732833512182073,-2.803550331529912e-5,4.773748847006038e-8,0.004733252285295634,-2.842190019560124e-5,4.864598097253564e-8,0.004733796293531172,-2.8735835655547945e-5,4.9381511830951945e-8,0.004734411109839088,-2.891853713979851e-5,4.980557132802008e-8,0.004735019503554785,-2.895397730306729e-5,4.9880998252676156e-8,0.004735551138537044,-2.887270533546891e-5,4.9680920882470014e-8,0.00473596575267552,-2.873482839748109e-5,4.9348284107208375e-8,0.004736259519104328,-2.8605104853960317e-5,4.903667122874668e-8,0.004736457060975534,-2.8533821667809858e-5,4.886493863585071e-8,0.0047365979415711565,-2.85485921602435e-5,4.88979128990018e-8,0.004736724583238949,-2.8654807118183317e-5,4.914769787656253e-8,0.0047368742116397,-2.8840382877356432e-5,4.958511728727826e-8,0.004737074552126241,-2.9081541619000465e-5,5.015347478913712e-8,0.004737342012367782,-2.934812648323624e-5,5.078111482310837e-8,0.004737681309886265,-2.960821833601568e-5,5.139231870366264e-8,0.004738086098954303,-2.9832193363411564e-5,5.191692419486976e-8,0.004738540469209245,-2.9996259595434974e-5,5.229874245767923e-8,0.0047390212881655396,-3.0085394338945098e-5,5.2502529913061444e-8,0.004739501377336211,-3.0095423581682325e-5,5.251886124976056e-8,0.004739953305782397,-3.0033870472254683e-5,5.236603682676017e-8,0.004740353348319325,-2.9919407976351642e-5,5.208868447062693e-8,0.004740685200385828,-2.9779991128983356e-5,5.175327771239827e-8,0.004740943182403257,-2.9649741613378564e-5,5.1440738209547884e-8,0.004741134674185391,-2.9564621576085497e-5,5.1236171222247815e-8,0.004741281429687509,-2.955689735080932e-5,5.121571324845782e-8,0.004741419089674041,-2.9648317114137292e-5,5.1430346955513816e-8,0.004741593583568248,-2.984236535396184e-5,5.18876132323745e-8,0.0047418528064249385,-3.0117417530783683e-5,5.2535574522677666e-8,0.004742232999460031,-3.0424697664623252e-5,5.325821214909581e-8,0.004742742611363063,-3.069609207813721e-5,5.3894094209571386e-8,0.004743351393757184,-3.086414788615748e-5,5.4283751424790724e-8,0.004743994368040548,-3.088836563852584e-5,5.433186801908802e-8,0.004744593460110826,-3.0773559410401626e-5,5.4050676811265004e-8,0.004745086788273111,-3.0567784478253706e-5,5.3554919237006306e-8,0.004745448989905369,-3.034083898991905e-5,5.301067418598428e-8,0.0047456930853903715,-3.015732469647893e-5,5.257126350003612e-8,0.004745857698513026,-3.00585998089884e-5,5.233439298931279e-8,0.004745990240669041,-3.0058200221043662e-5,5.233146185427817e-8,0.004746133999600095,-3.01466801907586e-5,5.2539325380684306e-8,0.004746321325199566,-3.0299826522431672e-5,5.289999214373297e-8,0.004746571565708012,-3.048628868783824e-5,5.333878061980279e-8,0.004746891547053987,-3.067323831866283e-5,5.377769034777425e-8,0.004747276976592629,-3.083031101807034e-5,5.414468688672485e-8,0.0047477141402886116,-3.09325591886319E-05,5.4380693556431183e-8,0.004748181886555148,-3.096289364885244e-5,5.444541244979396e-8,0.004748654088097438,-3.09141513535335e-5,5.432224087989675e-8,0.004749102826477359,-3.079058892868887e-5,5.4021765189798875e-8,0.0047495023578297945,-3.060826542501298e-5,5.358256772490767e-8,0.004749833466407175,-3.0393770407297746e-5,5.306810148158317e-8,0.0047500874842839194,-3.018108231591561e-5,5.2559163277776153e-8,0.004750269208928283,-3.000667785776047e-5,5.214226026089898e-8,0.004750398005292498,-2.990333609399654e-5,5.1894905169507964e-8,0.004750506508683392,-2.9893424852776115e-5,5.186969825178604e-8,0.004750636541043871,-2.9982645840082855e-5,5.2079533030619567e-8,0.0047508320083346,-3.0155421919572188e-5,5.248676449937229e-8,0.004751128908639331,-3.037369192805859e-5,5.300052553271625e-8,0.0047515437134295745,-3.058146946640733e-5,5.348771766126394e-8,0.004752063484848125,-3.071700733657849e-5,5.380196084787112e-8,0.0047526432287152715,-3.073156493559227e-5,5.382809002665862e-8,0.004753215530274019,-3.060859876345908e-5,5.352758456900073e-8,0.004753711939495655,-3.0373149193153703e-5,5.2960713748294996e-8,0.004754087100048578,-3.0083973403278307e-5,5.226769683183297e-8,0.00475433293603724,-2.98112136590755e-5,5.1615475629158006e-8,0.004754476264544549,-2.9611822552670604e-5,5.113920082596975e-8,0.004754563953700199,-2.9514823359041654e-5,5.0907249040929476e-8,0.0047546455613278705,-2.9520016886330627e-5,5.0918372072733805e-8,0.004754761071596459,-2.9605722627759065e-5,5.112036823852704e-8,0.004754935662167024,-2.9739033755819657e-5,5.143462572713782e-8,0.0047551796096890735,-2.988434036747737e-5,5.1776389895648226e-8,0.004755490589258526,-3.0008869624587908e-5,5.206783588245407e-8,0.004755856442393838,-3.008584029224015e-5,5.224546763974042e-8,0.004756257668350731,-3.0096339668500227e-5,5.2264540791731686e-8,0.004756669706745484,-3.0030731792701057e-5,5.210242554479061e-8,0.004757065414585785,-2.9889908539192638e-5,5.176159886049536e-8,0.004757418195542284,-2.968619040159789e-5,5.1271759843174285e-8,0.00475770601363651,-2.9443203318333868e-5,5.0689459342253564e-8,0.004757915965546911,-2.9193873541743718e-5,5.009323271378707e-8,0.004758048438176281,-2.8975983699953833e-5,4.957295059706262e-8,0.0047581194741599594,-2.882542250153593e-5,4.921372935448555e-8,0.004758160019778779,-2.876818870394926e-5,4.9076934374705044e-8,0.004758211358591651,-2.8813062505827567e-5,4.9182827912228046e-8,0.004758317093348088,-2.894711954955259e-5,4.950002836532726e-8,0.004758513086696229,-2.913579719092093e-5,4.994582695633771e-8,0.004758817511140333,-2.932837760191171e-5,5.03993731608605e-8,0.004759223605850981,-2.9468701036464705e-5,5.072723219425754e-8,0.004759697867909933,-2.9509504216527897e-5,5.0817464553032814e-8,0.004760185864983653,-2.942696235017769e-5,5.061410130962157e-8,0.0047606259543624555,-2.9230317643366145e-5,5.0139889000795495e-8,0.004760967607467908,-2.896139174117637e-5,4.9494965504536796e-8,0.004761187350905263,-2.8682116608214554e-5,4.882704196243258e-8,0.004761294966547717,-2.8454389880011927e-5,4.828336259201367e-8,0.004761327275387122,-2.8321230768383856e-5,4.796585845162461e-8,0.004761333553681048,-2.829714704173953e-5,4.790836114893017e-8,0.0047613601652829966,-2.8369688621673795e-5,4.808053312846534e-8,0.004761440321646852,-2.8508399895063426e-5,4.8409387338905586e-8,0.004761590551451071,-2.8675522491192136e-5,4.880485640357133e-8,0.004761812082991868,-2.883449707617644e-5,4.917998782520274e-8,0.004762094385548418,-2.8955069947828657e-5,4.946298307321452e-8,0.004762418882065095,-2.9015693696433737e-5,4.960280392062293e-8,0.0047627620311700624,-2.9004461174501594e-5,4.95713500331758e-8,0.004763097828331392,-2.8919547543918302e-5,4.936452599578333e-8,0.004763400221147088,-2.8769621484632385e-5,4.90032528762637e-8,0.004763646058855578,-2.8574085268911304e-5,4.8534040160042696e-8,0.004763818946533213,-2.8362398774863e-5,4.802731915464349e-8,0.004763913739565946,-2.8171404920085826e-5,4.757097276326134e-8,0.004763940543520972,-2.8039773963918373e-5,4.725700354486537e-8,0.004763926283878361,-2.7999613583819032e-5,4.7161505527736824e-8,0.004763911790083301,-2.806694015820014e-5,4.732201788368541e-8,0.004763943561668426,-2.8234348316907707e-5,4.772020956502153e-8,0.004764061768513518,-2.846950262937871e-5,4.827848357257109e-8,0.004764288248044224,-2.8721294087771193e-5,4.8874818169044365e-8,0.004764618840848933,-2.893247019251986e-5,4.93729414401414e-8,0.004765022978940383,-2.905493603698263e-5,4.965875709174304e-8,0.004765450868508584,-2.9062967578863874e-5,4.967170122917772e-8,0.004765846191254104,-2.8960399760946087e-5,4.942169071629253e-8,0.00476616076776282,-2.8779715550303997e-5,4.8986766544630736e-8,0.004766367084636814,-2.8573141543301774e-5,4.849172329484978e-8,0.004766464911858467,-2.839814847115955e-5,4.807347695622499e-8,0.00476647980983421,-2.8301831799976193e-5,4.784386143983262e-8,0.004766454199070231,-2.830937480805551e-5,4.7862255367856655e-8,0.004766434603844106,-2.8420157629011527e-5,4.8126495550133353e-8,0.004766459867818386,-2.861169104607286e-5,4.8582435764613466e-8,0.004766553900979995,-2.8848469249434867e-5,4.9145161379864336e-8,0.004766723895020026,-2.9091731049801776e-5,4.9722271610959204e-8,0.004766962652236033,-2.9307102792118214e-5,5.023203099217928e-8,0.004767252783211253,-2.946903329270971e-5,5.061383669831442e-8,0.004767570966247876,-2.956252059197733e-5,5.083224211036534e-8,0.00476789143265435,-2.9583263200849124e-5,5.0877272768619633e-8,0.004768188657904238,-2.9537233992896767e-5,5.076341708753041e-8,0.004768439713838026,-2.9440208044921784e-5,5.0528530531352904e-8,0.004768626910754468,-2.9317193423369705e-5,5.0232483468787865e-8,0.004768741178477299,-2.9201099070795987e-5,4.9953931538163455e-8,0.004768786027644776,-2.9129513499080413e-5,4.978252629146496e-8,0.004768780936853772,-2.9138496012208616e-5,4.980400285879896e-8,0.0047687618966803106,-2.9253256552848995e-5,5.007792821246455e-8,0.004768776430770757,-2.94777909524039e-5,5.0613091054872876e-8,0.004768871988096792,-2.9788111750287958e-5,5.13515752527904e-8,0.004769080444607102,-3.013432954967566e-5,5.2173957718739495e-8,0.004769405284770623,-3.0453486715106665e-5,5.293006343952431e-8,0.004769818220406904,-3.0688999004594416e-5,5.3485350267577706e-8,0.00477026743433048,-3.080834002271513e-5,5.376298803352503e-8,0.004770693577738604,-3.081168201237658e-5,5.3764285152528835e-8,0.004771046589895863,-3.072935915638893e-5,5.3562407814568835e-8,0.004771297631526678,-3.0610999818195513e-5,5.3276237909610404e-8,0.004771443711692161,-3.051122681918304e-5,5.303613422492912e-8,0.004771505396973143,-3.047631542556714e-5,5.295212013490912e-8,0.004771519499267242,-3.0534710642808274e-5,5.3091406911566415e-8,0.004771529205577235,-3.0692816320908944e-5,5.346855026149306e-8,0.00477157418650815,-3.0936189653487376e-5,5.404847750248202e-8,0.004771682921045021,-3.123511651048176e-5,5.4759893534474465e-8,0.004771868687189363,-3.1552574400663744e-5,5.551430977654335e-8,0.004772129449714966,-3.1852223337845775e-5,5.622508871487745e-8,0.004772450721118148,-3.210457768014518e-5,5.682212037646142e-8,0.0047728099065585915,-3.2290564110685556e-5,5.726024480323222e-8,0.004773180754965365,-3.240266257319448e-5,5.752190311025016e-8,0.004773537085899212,-3.244442374528547e-5,5.761592957241243e-8,0.004773855633711976,-3.242925814099788e-5,5.757463774878549e-8,0.004774118342142201,-3.237905496994603e-5,5.7450525834272396e-8,0.004774314614586185,-3.23226647010406e-5,5.731264700502641e-8,0.004774443914942631,-3.2293765111534964e-5,5.724146147285952e-8,0.004774518652136438,-3.232717786829844e-5,5.731994509929363e-8,0.0047745663374796085,-3.245259117379958e-5,5.761852250142311e-8,0.004774628801644312,-3.268548015279706e-5,5.817341730913397e-8,0.004774755642402249,-3.301726301171104e-5,5.896332753649877e-8,0.004774990554962329,-3.340982109567715e-5,5.989660608993938e-8,0.004775353818295921,-3.3800784181514464e-5,6.082409330155231e-8,0.004775829687604098,-3.412186477507274e-5,6.158296115132251e-8,0.004776367868533359,-3.4323594773016025e-5,6.205572173406188e-8,0.004776900497853547,-3.439347655809735e-5,6.22134491263007e-8,0.004777365818310518,-3.435798439395554e-5,6.21203712505869e-8,0.004777726423271264,-3.426947678704886e-5,6.190234646575702e-8,0.004777975587727213,-3.418704078505039e-5,6.170085067616404e-8,0.004778133031878161,-3.416016772550692e-5,6.163388088984261e-8,0.004778235183303571,-3.42193194337018e-5,6.177353927618648e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json
new file mode 100644
index 0000000..2cb2765
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":27000,"numberOfSamples":426,"samples":[0.004778324486778677,-3.437325503603603e-5,6.213990841775234e-8,0.0047784403655323285,-3.4611193149972956e-5,6.270647293317436e-8,0.004778612794687001,-3.490776213298559e-5,6.34120907874662e-8,0.004778858592736182,-3.52292773450405e-5,6.41760174740733e-8,0.004779180332297561,-3.554033000747647e-5,6.491361305699471e-8,0.0047795676373042825,-3.580972313910667e-5,6.555048782196374e-8,0.004780000304382801,-3.601491695515349e-5,6.603309632804475e-8,0.00478045244087296,-3.61445559073166e-5,6.63347373647879e-8,0.004780896788498023,-3.619907152539314e-5,6.64569282050896e-8,0.004781308537182374,-3.6189716300693844e-5,6.642701476463283e-8,0.004781668287402928,-3.613665338138569e-5,6.62935418736394e-8,0.004781964263597514,-3.606664631235279e-5,6.612070094818705e-8,0.004782194088007322,-3.6010502207012165e-5,6.598220199376154e-8,0.004782366358377176,-3.600003307813221e-5,6.595397202033107e-8,0.004782501973157172,-3.6063967015481664e-5,6.610431957871602e-8,0.004782634428155468,-3.622211612037997e-5,6.647996630880908e-8,0.004782807312744113,-3.647777437681964e-5,6.708796154697767e-8,0.004783066725500625,-3.681018070253991e-5,6.787788985789277e-8,0.004783447527929692,-3.717158351927006e-5,6.873512189479286e-8,0.004783956543699519,-3.749495769285591e-5,6.949941757309266e-8,0.004784561694818515,-3.7714824470447004e-5,7.001467512930746e-8,0.00478519734376055,-3.779386901530488e-5,7.019245393058328e-8,0.004785787298279908,-3.773988586048272e-5,7.005238005891471e-8,0.004786273540716633,-3.760159745695435e-5,6.971198893123057e-8,0.004786634261718939,-3.7446681679021194e-5,6.93338948131939e-8,0.004786883955125812,-3.7336538281738074e-5,6.90651418882107e-8,0.004787060855944783,-3.731025026111713e-5,6.89987545085644e-8,0.004787211498019626,-3.738052485901743e-5,6.916423518663561e-8,0.004787378723491085,-3.753768633517913e-5,6.953747098677388e-8,0.004787594743852002,-3.775688736390837e-5,7.005827277528313e-8,0.004787878341866488,-3.8005421267547694e-5,7.064797754466723e-8,0.004788234677867704,-3.824887091042978e-5,7.122411974828502e-8,0.004788656578890198,-3.845602832364749e-5,7.171211724931977e-8,0.004789126866304347,-3.8602762874008655e-5,7.205447458736902e-8,0.004789621527438917,-3.867476505188969e-5,7.221733392634786e-8,0.004790113453092092,-3.866900598852055e-5,7.219394452663505e-8,0.004790576389242894,-3.859380569021363e-5,7.200475975629059e-8,0.004790988658217021,-3.846749668906106e-5,7.169414035802423e-8,0.004791336185455692,-3.831592746623132e-5,7.132428928460062e-8,0.004791614602286293,-3.8169236193829984e-5,7.096748066882624e-8,0.004791830442019499,-3.8058199395276177E-05,7.069730505809583e-8,0.00479200147328233,-3.8010251494226334e-5,7.057912997799612e-8,0.00479215608282581,-3.8045112493544786e-5,7.065962097547686e-8,0.004792331243570715,-3.816988109148568e-5,7.095502401154791e-8,0.00479256801539422,-3.837391090721481e-5,7.143902873254914e-8,0.004792903356231363,-3.8625101009650084e-5,7.203412021826269e-8,0.00479335809982377,-3.887092912081732e-5,7.261428947824125e-8,0.004793923998139211,-3.904832069801235e-5,7.302876037880577e-8,0.004794557121329183,-3.910366330394545e-5,7.314982344552248e-8,0.004795186187943556,-3.901641098772414e-5,7.292918982979318e-8,0.004795737032643518,-3.881216157437762e-5,7.242916797983955e-8,0.004796161501972789,-3.855411099464743e-5,7.180203477009054e-8,0.004796453566145229,-3.831658356890081e-5,7.122636889591443e-8,0.004796644767523727,-3.815714860499036e-5,7.084000022037542e-8,0.004796785949434881,-3.8101951194646106e-5,7.070485098911682e-8,0.004796928139441377,-3.8146598603855446e-5,7.080934608157665e-8,0.004797110480654036,-3.8265789851055167e-5,7.109188904690533e-8,0.004797355877127002,-3.8424311612934556e-5,7.146748579270787e-8,0.004797671612426517,-3.8585616852327366e-5,7.184835086333892e-8,0.004798052093481322,-3.8717282547673696e-5,7.215687639979793e-8,0.004798481982683185,-3.879416904832568e-5,7.233306811500727e-8,0.0047989392109531745,-3.880032466659669e-5,7.233903786826962e-8,0.004799398014519919,-3.873014716490181e-5,7.216177815700216e-8,0.004799832156249859,-3.858883316916818e-5,7.181423253686315e-8,0.004800218353251468,-3.839193072968296e-5,7.133417138730679e-8,0.004800539728226463,-3.816370201797726e-5,7.07801739212383e-8,0.004800788798428815,-3.7934150450836535e-5,7.022440790334248e-8,0.004800969422381577,-3.773493298607536e-5,6.97427737273164e-8,0.004801097307136082,-3.7594608437565975e-5,6.940350057998089e-8,0.004801198860837516,-3.753375575082618e-5,6.925545753494772e-8,0.004801308307002621,-3.7560557353341817e-5,6.931760143740602e-8,0.004801463061629263,-3.766739513003747e-5,6.957089748412672e-8,0.0048016973159992595,-3.7829085241195104e-5,6.995424232825527e-8,0.004802033897188718,-3.800393663211438e-5,7.036721161540528e-8,0.004802475381486049,-3.8139426649914707e-5,7.068384881196978e-8,0.004802997237534293,-3.8183940325160886e-5,7.078086051437349e-8,0.0048035477616877155,-3.810365748834886e-5,7.057799420498539e-8,0.004804059432364746,-3.789890582121566e-5,7.007704800926735e-8,0.004804471058177286,-3.76100617891968e-5,6.93758159734603e-8,0.004804751226949466,-3.730566920695092e-5,6.863938578566553e-8,0.0048049094711126545,-3.705654492532993e-5,6.803781398940207e-8,0.004804988697932718,-3.691017647857788e-5,6.768458911635844e-8,0.004805045208603211,-3.687881976068849e-5,6.760819207952647e-8,0.004805128912216125,-3.6943695478478026e-5,6.776250536534154e-8,0.004805272128763522,-3.706800766501402e-5,6.805842303113509e-8,0.0048054875443432725,-3.72102043926267e-5,6.839587172762585e-8,0.004805771578807736,-3.733305531184578e-5,6.868556225257375e-8,0.004806109373196501,-3.740819210339049e-5,6.885971585954908e-8,0.004806479267214914,-3.741763766075652e-5,6.887556737614801e-8,0.00480685624919262,-3.7353970688048305e-5,6.871568343569287e-8,0.00480721474503835,-3.722005965565962e-5,6.838732853486281e-8,0.004807531254878627,-3.70285788369557e-5,6.792132402469517e-8,0.004807787168840347,-3.680107359176237e-5,6.736978068548045e-8,0.0048079717908961535,-3.656606685754552e-5,6.680147748275388e-8,0.004808085124176199,-3.635572067784862e-5,6.629375291303479e-8,0.0048081395655390005,-3.6201003683608846e-5,6.59208353445968e-8,0.004808159619935799,-3.61259119702826e-5,6.573995300854134e-8,0.004808179052187587,-3.614182096799145e-5,6.577781399967254e-8,0.0048082354644977225,-3.624339663861216e-5,6.602088125342372e-8,0.004808363016906486,-3.640739698014146e-5,6.641263422122376e-8,0.004808584568140996,-3.659514206004428e-5,6.685967165663355e-8,0.004808904762436531,-3.6758854267688404e-5,6.724710168628325e-8,0.00480930579650223,-3.685155258136531e-5,6.746239580653564e-8,0.0048097478566896616,-3.683927126708737e-5,6.742470100953433e-8,0.004810176029910032,-3.6712847565078014e-5,6.711298772615927e-8,0.0048105340254307105,-3.649482817530326e-5,6.658239512536003e-8,0.004810781727205723,-3.62365842449442e-5,6.595705126594526e-8,0.004810909644980501,-3.6003671889103674e-5,6.539470778083783e-8,0.004810942478516832,-3.5853999525254e-5,6.503419712779448e-8,0.004810929054258762,-3.581891665158464e-5,6.495006857326439e-8,0.0048109239580987374,-3.589619723046781e-5,6.513597488805307e-8,0.0048109704482596355,-3.605632765339819e-5,6.552011162684835e-8,0.004811091479469972,-3.625616637154878e-5,6.599830095926331e-8,0.0048112894999106535,-3.645235261818129e-5,6.646628961790225e-8,0.004811551496979631,-3.661003899809157e-5,6.684062633294758e-8,0.004811855326073649,-3.6706519877171644e-5,6.706718834733222e-8,0.004812175008010524,-3.673147922115121e-5,6.71216166824625e-8,0.00481248442724685,-3.668578285980148e-5,6.70063528600365e-8,0.004812759857408077,-3.6580011791983614e-5,6.67471364140862e-8,0.004812982021847438,-3.643312892218514e-5,6.638984182107787e-8,0.004813138260380984,-3.627105788419161e-5,6.599705939990736e-8,0.004813224984539436,-3.612453739463318e-5,6.56428706687843e-8,0.004813250027706149,-3.6025539008764395e-5,6.540413556464342e-8,0.004813233901618618,-3.600194055235022e-5,6.53476083256435e-8,0.004813208641342787,-3.6070981482546236e-5,6.55141956879046e-8,0.004813213185891162,-3.623309956685937e-5,6.590422431888505e-8,0.0048132853329533815,-3.6468577247922494e-5,6.646953796652841e-8,0.00481345196089862,-3.6739232782648675e-5,6.711775543238068e-8,0.004813720524850067,-3.699585543676539e-5,6.773031548224511e-8,0.004814074915372328,-3.718990777229592e-5,6.819070851646075e-8,0.004814477519636433,-3.7286327454266165e-5,6.841524919716474e-8,0.004814877412507499,-3.727371265226798e-5,6.837744468682739e-8,0.004815222824200392,-3.71687674239285e-5,6.811846623591315e-8,0.004815474776181273,-3.70132472069625e-5,6.773954080785747e-8,0.0048156180606356,-3.686348225678969e-5,6.737652512252384e-8,0.004815665783668138,-3.677486127562191e-5,6.716247159200004e-8,0.004815655222405848,-3.678604759224073e-5,6.718971555136587e-8,0.004815636005506843,-3.690868613654817e-5,6.74853269118757e-8,0.004815655154643246,-3.712641741469069e-5,6.800902880734398e-8,0.0048157448657402905,-3.740272786418989e-5,6.86723392503097e-8,0.004815916982414414,-3.769330697538445e-5,6.936842915828944e-8,0.004816164398472773,-3.79575991566434e-5,6.999989097850887e-8,0.004816466732888395,-3.8166161444911164e-5,7.049630552378684e-8,0.004816796998892661,-3.830332545250297e-5,7.082047667647441e-8,0.004817127128752034,-3.8366574426466915e-5,7.096680517792435e-8,0.004817431716377734,-3.8364425072400815e-5,7.095614538559232e-8,0.00481769031494261,-3.831406952629976e-5,7.0830151666776e-8,0.004817889007363463,-3.823930287395324e-5,7.064632660863894e-8,0.004818021924002364,-3.81685964240486e-5,7.047337979987863e-8,0.004818092995005395,-3.8132677946559405e-5,7.038533637487357e-8,0.004818117609598462,-3.8160829347254704e-5,7.045252292139183e-8,0.0048181231757472446,-3.8275439457385075e-5,7.072838433001155e-8,0.004818147032808319,-3.848524220234855e-5,7.123323584537503e-8,0.004818230263552585,-3.877913888410908e-5,7.193954194116859e-8,0.004818407376247594,-3.9123929426344404e-5,7.276667979907158e-8,0.004818694517905241,-3.946919365675648e-5,7.359290131063591e-8,0.004819081226702352,-3.975987623674142e-5,7.428575222689352e-8,0.004819530473516512,-3.99528372131395e-5,7.474192447320143e-8,0.004819988207444505,-4.003071053802827e-5,7.492052207630327e-8,0.0048203989246250615,-4.000728896884301e-5,7.485582965376748e-8,0.004820721175466344,-3.99227597487728e-5,7.464556945092878e-8,0.004820937782280773,-3.9831445677784674e-5,7.442110541926777e-8,0.004821058434419171,-3.978679151255124e-5,7.431111753324506e-8,0.004821115078288102,-3.982808284365596e-5,7.44096350669423e-8,0.0048211522270188,-3.9972043873461636e-5,7.475600152324611e-8,0.004821215190839854,-4.021085655268812e-5,7.533039650683856e-8,0.004821339447086454,-4.051642323333889e-5,7.606436621672032e-8,0.004821543793180569,-4.084903826994292e-5,7.686186217830935e-8,0.004821828560137223,-4.11675330397259e-5,7.762370019061549e-8,0.00482217843219588,-4.143791773110746e-5,7.826830249781045e-8,0.004822568060222116,-4.163862375087511e-5,7.874420409142698e-8,0.004822968276370532,-4.176204785493435e-5,7.903364411314588e-8,0.0048233512962861805,-4.1813332547424874e-5,7.914952587908982e-8,0.004823694268337095,-4.180773689787612e-5,7.912902718095061e-8,0.004823981341733217,-4.176770959006623e-5,7.902653839294732e-8,0.004824204843306262,-4.172022434438517e-5,7.890725119874452e-8,0.004824366170721857,-4.169434217802275e-5,7.884127164436675e-8,0.0048244767088938545,-4.1718500655906905e-5,7.889702962949885e-8,0.004824558542278362,-4.1816828861910714e-5,7.9132317175072e-8,0.004824644046356498,-4.2004005130913916e-5,7.958186192139638e-8,0.004824772810595939,-4.227902970506275e-5,8.02424031086156e-8,0.004824984330163837,-4.261986981161869e-5,8.105999852427741e-8,0.0048253063789773926,-4.2982701249766916e-5,8.192845535537351e-8,0.004825742302472369,-4.330968240475467e-5,8.2708249557431e-8,0.004826263889668254,-4.354578668059347e-5,8.326714000557609e-8,0.004826816164327769,-4.365883275531775e-5,8.352838122738419e-8,0.004827334389224904,-4.3652515189787744e-5,8.350199407923697e-8,0.0048277656748831246,-4.356505406150206e-5,8.328128245698638e-8,0.00482808475136242,-4.3454640222978786e-5,8.300742298950006e-8,0.0048282979694060126,-4.337986978855226e-5,8.282198985286413e-8,0.004828436715004647,-4.3383781338829196e-5,8.28283556019412e-8,0.004828545452468338,-4.3485739353153795e-5,8.307227830943268e-8,0.004828669442671055,-4.368097256269977e-5,8.354112596095182e-8,0.004828845131978453,-4.394543747541324e-5,8.417594361299053e-8,0.004829094332003,-4.42434357404026e-5,8.489003053203357e-8,0.004829422222056958,-4.453594609792681e-5,8.558908046994333e-8,0.004829818689134246,-4.4788154520325726e-5,8.618928271603903e-8,0.004830262162433468,-4.497503014521456e-5,8.663067376891177e-8,0.004830724791376845,-4.508429236527066e-5,8.688419593273334e-8,0.004831177763389958,-4.5116784857431304e-5,8.695250414418422e-8,0.0048315958105310045,-4.50848066644472e-5,8.686584714086303e-8,0.004831960372320328,-4.50092207251216e-5,8.667501419792826e-8,0.004832261385448886,-4.4916181410082026e-5,8.644339426785272e-8,0.004832498085672877,-4.4834021165063305e-5,8.623945104183476e-8,0.004832679280731162,-4.479034989518507e-5,8.612971656792317e-8,0.004832823322580668,-4.480906858922817e-5,8.61715560370843e-8,0.004832957631610085,-4.490685000713927e-5,8.640463908636807e-8,0.0048331170643941285,-4.508874878499018e-5,8.684036295819687e-8,0.004833339822081472,-4.5343323574385394e-5,8.745021561454051e-8,0.004833659599911437,-4.5639123415037367e-5,8.815754137046817e-8,0.004834094074838598,-4.592604139982e-5,8.884105976880853e-8,0.004834633097564738,-4.6145321609871045e-5,8.935914049205118e-8,0.004835233759482804,-4.624855257649796e-5,8.959560230484134e-8,0.004835829415303181,-4.621862951064732e-5,8.951018080070509e-8,0.004836352230776127,-4.6080232054244594e-5,8.916366565204528e-8,0.0048367583349983355,-4.589150422661235e-5,8.869757625100208e-8,0.004837041591904654,-4.572106996194247e-5,8.827831621545146e-8,0.004837230223456968,-4.562385027524527e-5,8.803847379686291e-8,0.004837371762779652,-4.562714338453696e-5,8.804318221037112e-8,0.004837516153686477,-4.572936473719342e-5,8.828738354028514e-8,0.004837703559825233,-4.590705729913291e-5,8.871321255880796e-8,0.00483795842100459,-4.6124666861455577e-5,8.923395641208231e-8,0.0048382884248457615,-4.634354743735913e-5,8.975592732878355e-8,0.004838686449812278,-4.652885932931713e-5,9.019505444720963e-8,0.004839134059291325,-4.6654302346770156e-5,9.048817401084265e-8,0.00483960577414928,-4.670490119196287e-5,9.059963781515475e-8,0.004840073592346507,-4.6677962776577816e-5,9.052354945919353e-8,0.004840511260350432,-4.6582397345525144e-5,9.028205993460479e-8,0.004840897899231785,-4.643670396318439e-5,8.992042145949509e-8,0.004841220660300779,-4.626596989787898e-5,8.949965282921296e-8,0.004841476202205037,-4.6098371678003375e-5,8.908802385796573e-8,0.004841671077489782,-4.596168029442229e-5,8.875259106524241e-8,0.004841821307091204,-4.587997080031785e-5,8.855125453694367e-8,0.004841951292609372,-4.587045888723051e-5,8.852512147964674e-8,0.004842091964053706,-4.5940344193465115e-5,8.869088863412212e-8,0.004842277739297711,-4.6083631809650075e-5,8.903322182845005e-8,0.004842541493972926,-4.627838807084122e-5,8.949828371537751e-8,0.004842906839177331,-4.648600438823033e-5,8.999219477976895e-8,0.004843378264295116,-4.665522221668618e-5,9.039097681872455e-8,0.004843932381435793,-4.6733606371812626e-5,9.056834871587784e-8,0.004844516593310677,-4.6686017948423326e-5,9.044026966797496e-8,0.004845061297440305,-4.651301745333522e-5,9.000924058638993e-8,0.004845504427784852,-4.6256995746914114e-5,8.93789350952813e-8,0.004845816313409309,-4.598827316210438e-5,8.872033893206934e-8,0.004846009719910427,-4.5777184591241536e-5,8.820391758061302e-8,0.004846129972474116,-4.566860671556084e-5,8.793778061329034e-8,0.0048462338316596935,-4.567181248329228e-5,8.794324136066889e-8,0.004846370227429732,-4.576600567215227e-5,8.816863162886767e-8,0.0048465699861102345,-4.591338738919411e-5,8.852141023091782e-8,0.004846844129874208,-4.6071908146491065e-5,8.889930925992923e-8,0.004847187112262369,-4.6204138643279386e-5,8.921179902089594e-8,0.004847581703514996,-4.6282067896565305e-5,8.939150694429025e-8,0.004848003735402131,-4.6289076937789076e-5,8.939877769506586e-8,0.004848426256645651,-4.6220321509909585e-5,8.922246700657916e-8,0.004848823209408606,-4.608209856359733e-5,8.887836627853265e-8,0.004849172664527739,-4.58903562975773e-5,8.840557932192903e-8,0.0048494595475039315,-4.5668426291373705e-5,8.786099087737668e-8,0.0048496777143903665,-4.544400174802944e-5,8.731188333905859e-8,0.004849831083297237,-4.524549703219852e-5,8.682706510070045e-8,0.0048499335706496585,-4.5098191704872816e-5,8.646751496052212e-8,0.004850007839811998,-4.502058698290767e-5,8.627758023189437e-8,0.004850082971399407,-4.502123491055191e-5,8.627733894012528e-8,0.00485019108473835,-4.509627653317102e-5,8.645669590689583e-8,0.004850362866722029,-4.522799803925022e-5,8.677198648497969e-8,0.004850621906510939,-4.5384910987798636e-5,8.71463393443206e-8,0.004850977946640694,-4.552441540774088e-5,8.747633199424684e-8,0.00485142013660625,-4.5599608404899196e-5,8.764862963748815e-8,0.0048519131380055204,-4.557121093968653e-5,8.756886324253519e-8,0.004852400538216197,-4.5422915883702246e-5,8.719862480298039e-8,0.004852819081156075,-4.517383633579113e-5,8.658536065820687e-8,0.004853121273694221,-4.4878623615075926e-5,8.586240756352643e-8,0.004853295526580276,-4.461012521329985e-5,8.52067471895604e-8,0.004853370910340709,-4.443133874108983e-5,8.477085726904584e-8,0.004853402989489355,-4.437253239360528e-5,8.462723494908248e-8,0.004853450340338429,-4.442557395851914e-5,8.475489986913897e-8,0.004853555566747505,-4.4554520782041413e-5,8.506551757055743e-8,0.004853737798332979,-4.471246662007726e-5,8.54446544743408e-8,0.00485399486389547,-4.485554721718429e-5,8.57858896141624e-8,0.004854309864890948,-4.495075979662197e-5,8.600964247263456e-8,0.00485465803028982,-4.497849770452831e-5,8.6069040778254e-8,0.00485501203358417,-4.493206747983682e-5,8.594850455856457e-8,0.00485534568228858,-4.481608527441229e-5,8.565974574854902e-8,0.004855636618776108,-4.464461889212684e-5,8.523726941055656e-8,0.004855868536584048,-4.4439150233652795e-5,8.473347207406128e-8,0.0048560330722339125,-4.422617519806977e-5,8.421282174134603e-8,0.004856131296365982,-4.4034205116743515e-5,8.374453608584602e-8,0.004856174444895931,-4.389004599187381e-5,8.339349699528367e-8,0.004856183359155293,-4.381463425405478e-5,8.321012126246628e-8,0.004856186304500604,-4.381908244061987e-5,8.322079181766202e-8,0.0048562152009108475,-4.3901681750652377e-5,8.342065742125228e-8,0.004856300584346492,-4.4046572784289005e-5,8.37705159905011e-8,0.004856465867596215,-4.422466583704176e-5,8.419918887759595e-8,0.004856721671702306,-4.439714167069116e-5,8.46121777512187e-8,0.004857061176355107,-4.452169624559631e-5,8.490696041970339e-8,0.004857457829840346,-4.456149265628484e-5,8.499476400738042e-8,0.00485786732258919,-4.4495941699599566e-5,8.482662558070934e-8,0.0048582357611451545,-4.433064375541632e-5,8.44172762033907e-8,0.004858514335168011,-4.4101716857274364e-5,8.385533918607352e-8,0.004858676764439197,-4.386931833014717e-5,8.32873433067394e-8,0.004858731337204977,-4.369916734671689e-5,8.287271910808891e-8,0.004858719353578516,-4.363884359422422e-5,8.272626402178683e-8,0.004858699079100403,-4.370113971203409e-5,8.287790899006382e-8,0.004858723862983524,-4.3863152455982114e-5,8.32708541147057e-8,0.004858826040038608,-4.4079389942548624e-5,8.379377681762571e-8,0.00485901243298159,-4.429951477497208e-5,8.432416681478761e-8,0.004859269289883763,-4.448198863401187e-5,8.476146671893096e-8,0.004859570954995191,-4.460045524794661e-5,8.504236029963514e-8,0.004859887795941977,-4.464428204949593e-5,8.514179476144743e-8,0.004860191622124641,-4.461614115330714e-5,8.506688634502332e-8,0.004860458789785439,-4.452889224023546e-5,8.48492775788132e-8,0.004860671945597038,-4.440278682495274e-5,8.453839235720549e-8,0.004860821241729715,-4.426305156165498e-5,8.419563819915824e-8,0.004860905419245433,-4.4137473414217795e-5,8.388856225560573e-8,0.004860932724572903,-4.405349915154474e-5,8.368376120026044e-8,0.004860921196088654,-4.403452027360999e-5,8.363778704610134e-8,0.004860897562807879,-4.4095524083173727e-5,8.378654746993848e-8,0.004860894101884112,-4.4238943389541296e-5,8.413526183041853e-8,0.0048609433408634845,-4.4451997534014956e-5,8.465211854456047e-8,0.004861071294856948,-4.470688491827875e-5,8.526891053304732e-8,0.004861290736213975,-4.4964675805282034e-5,8.589067031036176e-8,0.004861596402411748,-4.518269904195639e-5,8.641375721967553e-8,0.00486196380325942,-4.5324110154403064e-5,8.674916232953769e-8,0.0048623525742310615,-4.536760086172835e-5,8.684603658726279e-8,0.004862714420798966,-4.531482706925229e-5,8.670954354944289e-8,0.004863004623796651,-4.519303097661249e-5,8.640693812132527e-8,0.004863194723425296,-4.505076964306804e-5,8.605688184505726e-8,0.0048632825102846704,-4.494612337857568e-5,8.58005774809639e-8,0.004863294732214557,-4.492967036023607e-5,8.576036145889535e-8,0.004863279646140609,-4.50281209417457e-5,8.600009804265731e-8,0.004863291238192513,-4.5235972657266385e-5,8.650521261792416e-8,0.004863371875000471,-4.5519265521149334e-5,8.719217023603693e-8,0.004863541092600532,-4.5828989880735264e-5,8.794132978880563e-8,0.0048637941431590335,-4.611699389480268e-5,8.863570335939151e-8,0.004864108348633099,-4.6347665140982225e-5,8.918925654220265e-8,0.00486445241548828,-4.650270904600831e-5,8.95582979767788e-8,0.0048647945683711405,-4.658026758675538e-5,8.973908538631549e-8,0.004865107760312099,-4.659122884457311e-5,8.975868058567857e-8,0.004865372216069882,-4.655509521210519e-5,8.966485595145175e-8,0.004865576369720018,-4.649651590121914e-5,8.95177115085765e-8,0.004865717179949249,-4.644257685804242e-5,8.938315205316097e-8,0.004865800395588709,-4.642041241650156e-5,8.932709842864613e-8,0.004865840829426269,-4.6454505120622764e-5,8.940887781848442e-8,0.004865862139653059,-4.656317873149144e-5,8.967262906616372e-8,0.00486589520436499,-4.675433988431925e-5,9.013692766243163e-8,0.00486597415698355,-4.7021367342236717e-5,9.07848659725663e-8,0.004866129742279287,-4.7340909048838094e-5,9.15588685419079e-8,0.004866380968437412,-4.7674714425056845e-5,9.236536298478788e-8,0.004866727661902241,-4.797676853483728e-5,9.309231162293983e-8,0.004867147324684734,-4.8204752728047944e-5,9.363717379329655e-8,0.004867598631309231,-4.833237436364809e-5,9.393686151571851e-8,0.00486803127888161,-4.835807099496604e-5,9.398874966956663e-8,0.004868399226752945,-4.8306738611208255e-5,9.385460419655338e-8,0.0048686730911499205,-4.8223736532853264e-5,9.364566598366033e-8,0.004868847969216985,-4.816304071077976e-5,9.349354754634237e-8,0.0048689445715649204,-4.817300077705271e-5,9.351546946352385e-8,0.004869003383995121,-4.8283613222312364e-5,9.378341924616291e-8,0.004869073380924081,-4.849890638879081e-5,9.43059380023238e-8,0.0048691985524858695,-4.8796843985408144e-5,9.50282614209952e-8,0.004869406558763143,-4.9136789945777165e-5,9.585077822881535e-8,0.0048697031730176215,-4.947169627205198e-5,9.665881714263925e-8,0.004870073718317038,-4.9760441298475204e-5,9.735263346838005e-8,0.004870489786100687,-4.9976304469416066e-5,9.786787764373727e-8,0.004870917867218918,-5.010990840288102e-5,9.818254906626896e-8,0.004871326805083185,-5.016747905294032e-5,9.831256717497081e-8,0.004871692531052498,-5.016661596207553e-5,9.830134495028733e-8,0.004872000142688164,-5.0131652452055496e-5,9.820844897666668e-8,0.004872244237261572,-5.008976155652556e-5,9.810014547881626e-8,0.004872428488982316,-5.0068019068499616e-5,9.804229692860984e-8,0.004872565118915182,-5.0091037618228904e-5,9.809461966944169e-8,0.0048726744092658725,-5.017854275436142e-5,9.830475483883204e-8,0.004872783856378547,-5.034234927557437e-5,9.870086948139556e-8,0.00487292606572329,-5.058265619676878e-5,9.928265588588883e-8,0.0048731343054660824,-5.0884445663438285e-5,1.0001269113882292e-7,0.004873435129492483,-5.1215919899950034e-5,1.0081284930929764e-7,0.0048738390660209,-5.153170034332811e-5,1.015723136253397e-7,0.004874332805219763,-5.178266204412348e-5,1.0217165527867006e-7,0.004874877889632444,-5.1930947916088274e-5,1.0251939608479708e-7,0.004875419222669628,-5.196437324983978e-5,1.0258697726965176e-7,0.004875901546822159,-5.190279042143044e-5,1.0242405238386324e-7,0.004876286929160504,-5.179247995187442e-5,1.0214451691172397e-7,0.004876565554442809,-5.1691121210262656e-5,1.0188954108256096e-7,0.004876756238178176,-5.165032541885692e-5,1.0178476106510073e-7,0.004876898311797196,-5.170234825273362e-5,1.0190790776405611e-7,0.004877039291090606,-5.185415619525043e-5,1.0227463542533915e-7,0.004877222603926023,-5.20886997024062e-5,1.0284205932149231e-7,0.004877478233490123,-5.237148471881915e-5,1.0352515418660084e-7,0.004877817707882309,-5.2659998699574115e-5,1.0421992098956346e-7,0.004878233764547773,-5.291357147653802e-5,1.0482740644614637e-7,0.004878704103850562,-5.310151400306657e-5,1.0527339067231532e-7,0.0048791978095219886,-5.3207947753445196e-5,1.0551996632875121e-7,0.004879682486508378,-5.323275948828798e-5,1.055676880907866e-7,0.0048801303140343175,-5.318929968967715e-5,1.0544982140066945e-7,0.004880521970866183,-5.3100190207577814e-5,1.0522202640813102e-7,0.004880848294653186,-5.299267897057388e-5,1.0495098947741473e-7,0.0048811102117961675,-5.289457264711433e-5,1.0470451475918726e-7,0.004881317747189281,-5.2831136722353006e-5,1.045440020638691e-7,0.004881488756100408,-5.282274765893747e-5,1.0451875219165502e-7,0.004881647595748994,-5.2882791831743e-5,1.0466084584560046e-7,0.004881823499265498,-5.301535663747745e-5,1.0497951455693293e-7,0.004882047968987757,-5.321257874700818e-5,1.0545473459947656e-7,0.004882350207115018,-5.34522364381064e-5,1.0603152097503244e-7,0.004882749931583773,-5.3697319596594616e-5,1.0661911602920183e-7,0.004883248411975124,-5.390029444311228e-5,1.0710159048430002e-7,0.004883821223283848,-5.40142565780382e-5,1.0736509452548331e-7,0.004884418535029374,-5.400964585550486e-5,1.07338516263783e-7,0.004884977331862179,-5.388945231346987e-5,1.0703038492932809e-7,0.004885442982784979,-5.369291520334631e-5,1.0653767571805211e-7,0.0048857896031786405,-5.348285896525935e-5,1.060146273029446e-7,0.004886027899428079,-5.33225701704739e-5,1.0561598542362421e-7,0.004886197488183362,-5.3254761974328e-5,1.0544546399226637e-7,0.004886350220054461,-5.329186339414478e-5,1.0553216327134056e-7,0.00488653376420074,-5.341832436145469e-5,1.058366269418165e-7,0.004886780973520583,-5.3599972431194304e-5,1.0627419538425782e-7,0.004887105836022719,-5.379505921217329e-5,1.0674231474866518e-7,0.00488750437159898,-5.3963749688183614e-5,1.071437647657893e-7,0.004887958428542934,-5.4074868096297026e-5,1.074029666188478e-7,0.004888440866556042,-5.410987220354813e-5,1.0747544257958971e-7,0.004888921197063378,-5.406429862465683e-5,1.0735113586693954e-7,0.004889370931079509,-5.3946902121682926e-5,1.0705217492870693e-7,0.004889767913025726,-5.377692855867965e-5,1.0662613496775146e-7,0.004890099148351,-5.3580229669963764e-5,1.0613649899040003e-7,0.0048903619623596834,-5.3384985707783635e-5,1.0565218481282615e-7,0.004890563646224889,-5.321774155887791e-5,1.0523787065252472e-7,0.004890720050330306,-5.310023848256073e-5,1.0494629332969267e-7,0.00489085365033552,-5.304708763981897e-5,1.0481260896297154e-7,0.004890991351657461,-5.306401912048959e-5,1.0485014474108545e-7]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json
new file mode 100644
index 0000000..9767b1b
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":3000,"numberOfSamples":1000,"samples":[-0.0016674126654346861,-5.729007527752374e-7,-1.4186514962201376e-8,-0.0016673064653587321,-6.734015165127343e-7,-1.4270276706700349e-8,-0.0016671184978181936,-7.942288639572809e-7,-1.4371055120518062e-8,-0.0016668581653082658,-8.937549802808163e-7,-1.4454094104781238e-8,-0.0016665462863460693,-9.416288807763305e-7,-1.4494058993362982e-8,-0.0016662092022260732,-9.201664606449159e-7,-1.4476216298494372e-8,-0.0016658745541862263,-8.237755484396502e-7,-1.4395945891238539e-8,-0.0016655683268689287,-6.578186550518726e-7,-1.4257765362438796e-8,-0.0016653124526036561,-4.3741842925891825e-7,-1.4074304544820363e-8,-0.0016651224530400707,-1.8607276082775895e-7,-1.3865132894139859e-8,-0.0016650049642489826,6.643303169026634e-8,-1.3655018765663274e-8,-0.0016649554928538104,2.8739437967418395e-7,-1.347113935991257e-8,-0.0016649572160637774,4.4604795424859426e-7,-1.3339056817593825e-8,-0.0016649817855313575,5.194876808583452e-7,-1.3277813795917761e-8,-0.0016649928181043465,4.985157505581373e-7,-1.329507262967021e-8,-0.00166495207648607,3.9179414860133283e-7,-1.3383654246342673e-8,-0.0016648274069321705,2.26664827416035e-7,-1.352084347660865e-8,-0.001664600739494372,4.5708357821865315e-8,-1.367124421905444e-8,-0.001664274219706894,-1.0088239670451744e-7,-1.3793127784445051e-8,-0.0016638726869829803,-1.6616023108150796e-7,-1.3847473701249546e-8,-0.0016634410124484337,-1.1869904209770958e-7,-1.3808176255662588e-8,-0.0016630354517974334,4.659577780072841e-8,-1.3671009811639623e-8,-0.001662709627560605,3.030262655914423e-7,-1.3458136463059741e-8,-0.0016624982880314673,5.958730436677693e-7,-1.3214963229037875e-8,-0.001662404794976831,8.568537842964569e-7,-1.2998163907749735e-8,-0.0016623988702162175,1.0254972177202318e-6,-1.2857973826241794e-8,-0.0016624271346917532,1.0685455003698803e-6,-1.2822084766277138e-8,-0.0016624319248438782,9.883600460942418e-7,-1.2888614390257493e-8,-0.001662369242835807,8.174787260993229e-7,-1.3030565315055226e-8,-0.0016622183938909184,6.041843871353809e-7,-1.3207794337616674e-8,-0.0016619818565370786,3.9717316279278375e-7,-1.3379782718210806e-8,-0.0016616789185444716,2.3502260822879676e-7,-1.3514435597222689e-8,-0.0016613377123989804,1.417265131744283e-7,-1.3591822041815075e-8,-0.0016609886089808544,1.2662367606576446e-7,-1.360423147824086e-8,-0.0016606598282278315,1.863922842656112e-7,-1.3554490273298172e-8,-0.0016603748199426104,3.0744517886406376e-7,-1.3453938412913645e-8,-0.0016601505255394024,4.680421085231016e-7,-1.3320649411749458e-8,-0.0016599957713533597,6.402384067973255e-7,-1.3177803860265977e-8,-0.0016599094977454972,7.922656339357963e-7,-1.3051723165875262e-8,-0.0016598791098382528,8.920717595398815e-7,-1.296895475612751e-8,-0.0016598798337515695,9.124839151887528e-7,-1.2952012505708826e-8,-0.001659876379622952,8.376861160842476e-7,-1.3014014454721298e-8,-0.0016598280484381447,6.695105801256583e-7,-1.3153456420237919e-8,-0.0016596973256014155,4.309782162426044e-7,-1.3351256087288848e-8,-0.001659460185844518,1.644717783767708e-7,-1.3572258355341262e-8,-0.0016591147270322442,-7.656124715275952e-8,-1.3772130406953462e-8,-0.0016586845140589572,-2.408327142852044e-7,-1.3908356700286018e-8,-0.0016582146152118225,-2.934361433791715e-7,-1.3952042824758485e-8,-0.0016577609941446497,-2.2641155822799227e-7,-1.3896646268225657e-8,-0.0016573762399432718,-6.21980795145008e-8,-1.3760786009222337e-8,-0.0016570956693766155,1.5125835864904947e-7,-1.3584155440668849e-8,-0.0016569277304044742,3.526938844470182e-7,-1.3417439166449944e-8,-0.0016568517179810498,4.838995413033776e-7,-1.3308801583491872e-8,-0.0016568239567060939,5.055051370474298e-7,-1.329085416886814e-8,-0.0016567907846579653,4.069873023778711e-7,-1.3372361772156796e-8,-0.0016567038867919353,2.0748592272561992e-7,-1.3537525963856996e-8,-0.001656532487673912,-5.231661404744325e-8,-1.375267653077842e-8,-0.0016562685745488837,-3.2332365832738283e-7,-1.3977143471321514e-8,-0.0016559247754694372,-5.607837026808751e-7,-1.4173848477561865e-8,-0.0016555275418913935,-7.327632792039998e-7,-1.4316343411791168e-8,-0.0016551092006448183,-8.233258722118555e-7,-1.4391445802169112e-8,-0.0016547013993568505,-8.316848376668471e-7,-1.439852456672699e-8,-0.0016543308264849162,-7.693391900307951e-7,-1.4347111821174578e-8,-0.0016540168884855639,-6.568154472154755e-7,-1.4254194224863743e-8,-0.00165377050241833,-5.208100635030763e-7,-1.4141844859881727e-8,-0.001653593196269087,-3.917048152325665e-7,-1.4035172614624135e-8,-0.001653476129350162,-3.0088888763530243e-7,-1.3960118899539777e-8,-0.0016533992421155022,-2.7714172882948965e-7,-1.3940479436687606e-8,-0.0016533313967630901,-3.4151069511884616e-7,-1.3993675666328718e-8,-0.001653232946576946,-5.008677652271779e-7,-1.4125420729844042e-8,-0.001653062183142646,-7.418000865678651e-7,-1.4324648124704472e-8,-0.0016527858361718897,-1.0281008249946432e-6,-1.456142157572885e-8,-0.0016523911376223348,-1.305464686483764e-6,-1.4790826634502255e-8,-0.0016518942603108112,-1.5146795210217696e-6,-1.4963914427081036e-8,-0.001651339688429203,-1.609920243457309e-6,-1.5042853245080335e-8,-0.0016507887609035258,-1.5746267527137686e-6,-1.501402985970417e-8,-0.0016503014049699613,-1.4275884845194972e-6,-1.4893009020259092e-8,-0.0016499186673924447,-1.2167625516751627e-6,-1.4719368976416159e-8,-0.0016496525262988243,-1.0042695210536724e-6,-1.4544312694847968e-8,-0.0016494852722868205,-8.488903215522008e-7,-1.4416272286595473e-8,-0.0016493768933366411,-7.916520763817829e-7,-1.4369068693422452e-8,-0.0016492770441696662,-8.477319335831267e-7,-1.441525088113211e-8,-0.0016491379089976894,-1.005586142802875e-6,-1.454535921366001e-8,-0.0016489247906258263,-1.2324077723442385e-6,-1.4732398295614608e-8,-0.0016486222435663186,-1.483745124523919e-6,-1.4939753931208416e-8,-0.0016482349077829455,-1.714387062746813e-6,-1.5130169934377415e-8,-0.0016477837047942081,-1.8876251196414704e-6,-1.5273388453025773e-8,-0.0016472992687706423,-1.9809318567924716e-6,-1.53508288088995e-8,-0.0016468148667739665,-1.987610693939075e-6,-1.5356941194346824e-8,-0.0016463605427636564,-1.915263460295526e-6,-1.529794271457019e-8,-0.0016459592556230336,-1.7824940981911972e-6,-1.5189110139549575e-8,-0.0016456248820582223,-1.6151699815473968e-6,-1.5051713360546717e-8,-0.0016453614347904178,-1.4430148462818047e-6,-1.4910218742385646e-8,-0.0016451628120618224,-1.2966201405178637e-6,-1.4789829372760213e-8,-0.0016450127057533186,-1.2044728826030512e-6,-1.4714032583746818e-8,-0.0016448847709624051,-1.1893868953393184e-6,-1.4701653351213367e-8,-0.0016447437874436506,-1.2638103881750775e-6,-1.4762980827432679e-8,-0.0016445491773054968,-1.4241708565546202e-6,-1.48951005064794e-8,-0.0016442623193067107,-1.645902905672155e-6,-1.5077791633897704e-8,-0.0016438578535539828,-1.8825890625995552e-6,-1.5272828105373147e-8,-0.0016433361724119703,-2.073293524915233e-6,-1.5430051194420875e-8,-0.0016427306855190664,-2.1595591992381907e-6,-1.5501400836018825e-8,-0.0016421028587470339,-2.107131410238427e-6,-1.545878784662949e-8,-0.0016415236596336047,-1.921503495197351e-6,-1.5306805835881395e-8,-0.0016410491716874508,-1.6475995048951014e-6,-1.508237666232406e-8,-0.0016407026930217476,-1.3532595827599134e-6,-1.4841150585489634e-8,-0.0016404710798181709,-1.1058220927750292e-6,-1.4638324030823384e-8,-0.0016403140434198668,-9.529880693486804e-7,-1.4513000663883932e-8,-0.0016401794241349037,-9.138189075949228e-7,-1.4480834585139251e-8,-0.001640017698453548,-9.79444485492997e-7,-1.4534599598191043e-8,-0.0016397921504842823,-1.1199629554508742e-6,-1.46498259445195e-8,-0.001639483962540219,-1.2938873374757163e-6,-1.4792536911725107e-8,-0.0016390929025693608,-1.4576102121358978e-6,-1.492701055511908e-8,-0.0016386346780947172,-1.5734220969873702e-6,-1.5022352898574618e-8,-0.0016381360741017184,-1.615194314249089e-6,-1.50571474431728e-8,-0.0016376290513289884,-1.5712506992188948e-6,-1.502179647791281e-8,-0.0016371449438908516,-1.4444928408342774e-6,-1.4918620999811586e-8,-0.0016367096648583616,-1.25031555175269e-6,-1.4760165902237422e-8,-0.0016363404739891797,-1.0131188796195411e-6,-1.4566365366279228e-8,-0.0016360443826047542,-7.623240043753878e-7,-1.4361298196704363e-8,-0.0016358178081207191,-5.285826195157557e-7,-1.4170084868955413e-8,-0.0016356469788772767,-3.4036970890659786e-7,-1.4016082203265821e-8,-0.001635508814606122,-2.207663722595964e-7,-1.3918227118982464e-8,-0.0016353723164385856,-1.840892669518823e-7,-1.3888261221685396e-8,-0.0016352009622329746,-2.3204470491520787e-7,-1.3927578205263703e-8,-0.0016349571713373055,-3.4963943026521634e-7,-1.4023883873503605e-8,-0.0016346099310555375,-5.023932688054426e-7,-1.4148931817790818e-8,-0.0016341454885156152,-6.3792299560969e-7,-1.4259849140121573e-8,-0.0016335782650784292,-6.955174267981529e-7,-1.4307009536395608e-8,-0.0016329555381133835,-6.248455078933967e-7,-1.4249353069369657e-8,-0.001632348566823429,-4.0811994916454653e-7,-1.4072462495238987e-8,-0.0016318292392897165,-7.307325909948915e-8,-1.3799065103672127e-8,-0.0016314426223732346,3.1411804635436726e-7,-1.348317422928833e-8,-0.0016311911484804568,6.740899862647185e-7,-1.3189486706427881e-8,-0.0016310385568320672,9.431757478148973e-7,-1.2969887537649966e-8,-0.0016309281956906096,1.0909595365989285e-6,-1.284917620325891e-8,-0.0016308035869936743,1.1218851358131656e-6,-1.2823744428951683e-8,-0.001630622539391083,1.0659851233981184e-6,-1.286910999649688e-8,-0.0016303628898681499,9.662126791094569e-7,-1.2950244535657924e-8,-0.0016300220532569065,8.673019924964457e-7,-1.303067628890683e-8,-0.0016296132995635643,8.078877149326865e-7,-1.3078931636879651e-8,-0.001629160810966706,8.157006448712503e-7,-1.3072446478192921e-8,-0.0016286945140845575,9.051596921306019e-7,-1.2999506114425888e-8,-0.001628245126395128,1.0769022975441644e-6,-1.285960415768863e-8,-0.0016278397306271277,1.3189544201936767e-6,-1.266248230864526e-8,-0.001627498165347806,1.6092434451098838e-6,-1.2426094284497363e-8,-0.0016272305284777825,1.919140067868813e-6,-1.2173739988352222e-8,-0.0016270360259148394,2.2175661941671596e-6,-1.1930728972988056e-8,-0.0016269031154630333,2.475096567993343e-6,-1.1721030329836182e-8,-0.0016268106690123906,2.6677037698851066e-6,-1.1564201830643506e-8,-0.0016267299509751117,2.7800877693262435e-6,-1.1472661493037969e-8,-0.0016266273869119789,2.808609891480967e-6,-1.1449301618478332e-8,-0.0016264683188791577,2.7638226285538478e-6,-1.148545475645509e-8,-0.001626222281076474,2.6722456015579204e-6,-1.1559486532781036e-8,-0.0016258702666007566,2.576093825543154e-6,-1.1637054006801947e-8,-0.001625413368763386,2.528652681956703e-6,-1.1674892793466553e-8,-0.0016248800163113045,2.5829769218688514e-6,-1.163000825805575e-8,-0.0016243264182511817,2.7739410660516134e-6,-1.147422855629942e-8,-0.001623824448257784,3.0994362029174313e-6,-1.1209399713251122e-8,-0.0016234371005962335,3.5125193005639037e-6,-1.0873674286989874e-8,-0.0016231924460283597,3.934280626806754e-6,-1.0531046713794774e-8,-0.0016230722116879442,4.2839261521980505e-6,-1.0247004462157263e-8,-0.0016230223920017024,4.509022315061528e-6,-1.0064052989792204e-8,-0.001622977701628644,4.599308318664541e-6,-9.990503166746648e-9,-0.0016228844735368534,4.580979504172208e-6,-1.0005062897292258e-8,-0.0016227124043607017,4.500425340947215e-6,-1.007001881606373e-8,-0.0016224552660553113,4.4079367639713336E-06,-1.0144494972609784e-8,-0.001622125516269599,4.346659224530802e-6,-1.0193467505461069e-8,-0.001621747326018003,4.347159211571133e-6,-1.0192193851439426e-8,-0.001621350394160166,4.425844840376646e-6,-1.0127472727933714e-8,-0.0016209651093993971,4.585398795260131e-6,-9.99724721593909e-9,-0.001620618755614523,4.816205832030953e-6,-9.809405621898151e-9,-0.0016203324293711152,5.0984795936064065e-6,-9.580037457445881e-9,-0.0016201185778446112,5.4050620808012625e-6,-9.331168050521922e-9,-0.0016199792751218015,5.7049341968223675e-6,-9.087925536625024e-9,-0.0016199055449921847,5.967355112173079e-6,-8.875191668941198e-9,-0.0016198780222882233,6.166231880713312e-6,-8.714053321567563e-9,-0.0016198689897785872,6.284171358720325e-6,-8.618507598772804e-9,-0.0016198456428020592,6.315766071306402e-6,-8.59280112903386e-9,-0.001619774385405621,6.26973000154361e-6,-8.629727496350617e-9,-0.0016196259296935819,6.169525357590731e-6,-8.710169915500509e-9,-0.0016193810015156772,6.052090182629365e-6,-8.804188184311565e-9,-0.0016190363271137104,5.963922429773775e-6,-8.87422587160706e-9,-0.0016186098081281857,5.953407381087274e-6,-8.88131796854117e-9,-0.0016181424573248472,6.058817784323751e-6,-8.794748910421731e-9,-0.0016176935536342239,6.293589642068541e-6,-8.60386918296675e-9,-0.001617326219104022,6.634329004002173e-6,-8.327694536227654e-9,-0.0016170853930605306,7.020289243504353e-6,-8.015286175478002e-9,-0.0016169778930223832,7.370415677596483e-6,-7.732028934152944e-9,-0.0016169675000937544,7.6131522800298654E-06,-7.535643904942126e-9,-0.0016169901136538418,7.713155380487486e-6,-7.454642010804234e-9,-0.0016169800837689205,7.679978347262525e-6,-7.481256003272846e-9,-0.0016168922572558102,7.556948303108508e-6,-7.580374851378752e-9,-0.0016167104555515727,7.400752728903742e-6,-7.706059646917471e-9,-0.0016164437683271215,7.26360821746386e-6,-7.816027752541982e-9,-0.0016161173530747812,7.183346466944154e-6,-7.879724076888564e-9,-0.0016157633104902577,7.180632707092512e-6,-7.880570755501255e-9,-0.0016154140207041772,7.260286490250837e-6,-7.814851788477083e-9,-0.001615098001463881,7.414069548772224e-6,-7.689396067402687e-9,-0.001614837378113596,7.623584166153096e-6,-7.519187049980965e-9,-0.0016146461104334338,7.863038966555796e-6,-7.325110558075486e-9,-0.0016145285922477045,8.102151822196889e-6,-7.13161729702838e-9,-0.0016144786655525626,8.30954750461279e-6,-6.963995681741373e-9,-0.0016144794389958994,8.456851025280304e-6,-6.8450772368244266e-9,-0.0016145044863076245,8.523247037034214e-6,-6.791555454796449e-9,-0.0016145208238440725,8.499790759989043e-6,-6.810504300559879e-9,-0.0016144936330299336,8.392510891781708e-6,-6.896885929710203e-9,-0.001614392228170857,8.223343280763281e-6,-7.032834909617165e-9,-0.0016141963521061268,8.028183732838383e-6,-7.189288356946133e-9,-0.0016139016436967962,7.851860839942969e-6,-7.330101133146092e-9,-0.0016135231106711163,7.740313336524296e-6,-7.4183830864822594e-9,-0.0016130954016894184,7.730606125699386e-6,-7.424519615650904e-9,-0.0016126685428214326,7.840105042654435e-6,-7.334806831697677e-9,-0.0016122981087462733,8.057474208610399e-6,-7.1585873366644e-9,-0.0016120303080747725,8.339676729142519e-6,-6.930579850289531e-9,-0.001611885615787256,8.619402313112867e-6,-6.704899178695777e-9,-0.0016118481928508355,8.824139607217275e-6,-6.539785116730204e-9,-0.001611868604140801,8.90107812285037e-6,-6.477642765675682e-9,-0.001611881154272387,8.835912981377337e-6,-6.529915716142489e-9,-0.0016118277460059921,8.655388821984905e-6,-6.674986610903632e-9,-0.001611675919713035,8.41338736769802e-6,-6.869352972909047e-9,-0.0016114237381993468,8.169993921702883e-6,-7.06452679210035e-9,-0.001611093177231819,7.974354515474472e-6,-7.220908293079042e-9,-0.0016107187721478148,7.856385780125358e-6,-7.3144902295771e-9,-0.0016103373933631776,7.826230747315016e-6,-7.33726541883732e-9,-0.0016099815773490676,7.877830737849756e-6,-7.294288237410739e-9,-0.0016096761674665666,7.993507370107692e-6,-7.199928950656389e-9,-0.0016094369744081014,8.147984768505116e-6,-7.074608444117655e-9,-0.0016092702451640983,8.311598200694667e-6,-6.942216930039938e-9,-0.00160917228355665,8.453152537768642e-6,-6.827830668858108e-9,-0.001609129179254943,8.543077992903146e-6,-6.755189047281374e-9,-0.0016091171262881026,8.557333011262786e-6,-6.743558851885236e-9,-0.0016091041391435737,8.481979668330493e-6,-6.804049103358642e-9,-0.0016090539129368906,8.317618601666572e-6,-6.9360391917084e-9,-0.0016089320065604345,8.082194724983374e-6,-7.1249350615802805e-9,-0.0016087135318696238,7.810443188597418e-6,-7.342654995567478e-9,-0.0016083904469439763,7.548814847622212e-6,-7.551773316743061e-9,-0.0016079759933311404,7.346151109873746e-6,-7.71307892483668e-9,-0.0016075042761180575,7.242056143792723e-6,-7.794939036152872e-9,-0.00160702430711951,7.255973870729432e-6,-7.782022387653911e-9,-0.0016065893832426634,7.380066935880531e-6,-7.680904798184895e-9,-0.0016062439692449664,7.578337494266571e-6,-7.520654677956422e-9,-0.0016060111996290365,7.793284040925081e-6,-7.347429731587253e-9,-0.001605884722251656,7.959699219668078e-6,-7.2134347447406345e-9,-0.0016058284903456366,8.02276170190471e-6,-7.162490523129645e-9,-0.001605786300256652,7.954794950983538e-6,-7.216659725347376e-9,-0.0016056989183379042,7.763856680531235e-6,-7.3693711382787e-9,-0.0016055223349501092,7.489910937153623e-6,-7.5884774454684e-9,-0.0016052394922760655,7.190282869697641e-6,-7.827929734487749e-9,-0.0016048613732839356,6.9214213509586415e-6,-8.042440056461898e-9,-0.0016044191014809085,6.724717813606781e-6,-8.19887721405118e-9,-0.0016039523942876091,6.620315668122966e-6,-8.281210552001504e-9,-0.0016034994404368291,6.608103489245576e-6,-8.289661775609236e-9,-0.00160309058100955,6.672612775449543e-6,-8.236730302719379e-9,-0.0016027456251598608,6.788717605477168e-6,-8.142605180973005e-9,-0.0016024734564696638,6.92643298585074e-6,-8.031328805630021e-9,-0.001602272562723833,7.054461000471735e-6,-7.927975303945096e-9,-0.0016021316395473646,7.1429733909865235e-6,-7.85643420942448e-9,-0.001602030096147785,7.166416618010949e-6,-7.837159326460504e-9,-0.0016019389325304322,7.106967943498292e-6,-7.884384590805072e-9,-0.001601822909317285,6.958748005321464e-6,-8.002733282683978e-9,-0.001601645025670833,6.732028706082511e-6,-8.183846196126166e-9,-0.0016013737843991493,6.455595568760507e-6,-8.404514185145453e-9,-0.0016009923060795966,6.174736476004758e-6,-8.628343547216521e-9,-0.0016005063926833,5.943025935706647e-6,-8.81240660038963e-9,-0.001599947436018963,5.80863970378304e-6,-8.918249717289788e-9,-0.0015993671346443959,5.799343297164342e-6,-8.923895711975885e-9,-0.001598824450917896,5.912206177088279e-6,-8.831981049727163e-9,-0.0015983691261643967,6.112691262219383e-6,-8.670353040535608e-9,-0.001598027750726865,6.34370842368762e-6,-8.484735141405814e-9,-0.001597796970333321,6.541210365541908e-6,-8.32624668865039e-9,-0.0015976453400901444,6.6511270032490696e-6,-8.237927113772566e-9,-0.0015975225826418882,6.642865882163979e-6,-8.244027233433758e-9,-0.0015973733172837778,6.5160674645092064e-6,-8.344671256899067e-9,-0.0015971514460371861,6.299134854850162e-6,-8.517063826659138e-9,-0.0015968312197721644,6.040236787256278e-6,-8.722695998097968e-9,-0.0015964119337554,5.793741677183589e-6,-8.918192024461737e-9,-0.0015959153524303371,5.606512708157547e-6,-9.066246268690955e-9,-0.0015953776009036073,5.508240931702783e-6,-9.143302312759663e-9,-0.0015948390145066778,5.5079279870896205e-6,-9.142302190616902e-9,-0.0015943353730508711,5.595937570596819e-6,-9.07100224242127E-09,-0.0015938924112206762,5.749295724445448e-6,-8.947734194601513e-9,-0.0015935237022038366,5.937745603497693e-6,-8.796600268425784e-9,-0.0015932308952599915,6.128923308494835e-6,-8.643381449495809e-9,-0.0015930050349990598,6.292138592490837e-6,-8.512542405787741e-9,-0.0015928280496299403,6.401112560124816e-6,-8.425039499555748e-9,-0.001592674118163697,6.436402325511549e-6,-8.396358552439093e-9,-0.001592511242825915,6.388162226916735e-6,-8.434284847973138e-9,-0.0015923038548076277,6.259479463662382e-6,-8.536238644079333e-9,-0.0015920175360308354,6.069704190545227e-6,-8.686647143544019e-9,-0.0015916265581974022,5.855945053772369e-6,-8.855809836079169e-9,-0.0015911234432686942,5.66982094337028e-6,-9.002557749844637e-9,-0.0015905271902137126,5.566980643098267e-6,-9.082660120678599e-9,-0.0015898846649755427,5.5901058549402035e-6,-9.062364074658102e-9,-0.0015892607401442954,5.751420421663427e-6,-8.932240034166934e-9,-0.0015887185141690312,6.0241142294602755e-6,-8.713870498328418e-9,-0.0015882979764191441,6.3490168297115175e-6,-8.454426383873467e-9,-0.0015880035039804617,6.654182728757788e-6,-8.211064945180594e-9,-0.0015878052699886624,6.877775058584288e-6,-8.032786882775957e-9,-0.0015876517590710897,6.984489838970192e-6,-7.947450754328946e-9,-0.0015874863779336544,6.971221701182685e-6,-7.957325293941682e-9,-0.0015872619917445506,6.863185748489404e-6,-8.042215733171648e-9,-0.0015869502414554443,6.704200258300083e-6,-8.167230467721707e-9,-0.0015865450265327885,6.544861833301743e-6,-8.292209810873044e-9,-0.001586060881771174,6.431419708027262e-6,-8.380562643969391e-9,-0.0015855275390838218,6.397223103243651e-6,-8.4060105625722e-9,-0.001584982293378186,6.457920516330214e-6,-8.356321717507075e-9,-0.0015844620349776742,6.61081898948137e-6,-8.233749425801078e-9,-0.0015839966677754043,6.837813403661317e-6,-8.052680242552925e-9,-0.0015836049744388627,7.110512974486875e-6,-7.83558877254055e-9,-0.00158329313272495,7.39599782801762e-6,-7.60852007937778e-9,-0.0015830553572955281,7.661943418484884e-6,-7.397063210929995e-9,-0.0015828757453601038,7.88048537908479e-6,-7.223288825216026e-9,-0.0015827305073950087,8.030921094971425e-6,-7.103576255489422e-9,-0.0015825902239223386,8.10175707948008e-6,-7.046953362750228e-9,-0.0015824222470464458,8.09261347207407e-6,-7.0535751904136625e-9,-0.0015821938020142208,8.016239439311893e-6,-7.1131587433406575e-9,-0.001581876678930113,7.90023529461386e-6,-7.203688583790658e-9,-0.0015814541506088944,7.786937005316729e-6,-7.291589958387156e-9,-0.001580929437716428,7.72886735500687e-6,-7.33539011103742e-9,-0.001580332627237802,7.777305469592599e-6,-7.294769075619663e-9,-0.0015797203731629178,7.964409090283794e-6,-7.144630568893987e-9,-0.0015791630814620142,8.285391603077017e-6,-6.889058321940481e-9,-0.001578720878001717,8.692298812053108e-6,-6.566101724486824e-9,-0.001578419502984907,9.10747486170557e-6,-6.2370916464480965e-9,-0.0015782405062512823,9.452091527792786e-6,-5.9641611304561455e-9,-0.0015781312909732138,9.674079549613374e-6,-5.7882606428250385e-9,-0.001578027360075597,9.761402781761969e-6,-5.718703551331627e-9,-0.0015778737449317608,9.738155742011253e-6,-5.736256424581671e-9,-0.0015776373992268053,9.650582774239132e-6,-5.804222309092312e-9,-0.0015773098917586672,9.551555633876995e-6,-5.88077278945436e-9,-0.0015769037319662415,9.488450878456881e-6,-5.928572703455147e-9,-0.001576445875891479,9.49569390768316e-6,-5.920653078048749e-9,-0.001575970674530697,9.591327497139855e-6,-5.84304192231517e-9,-0.0015755133171369835,9.77658865659438e-6,-5.694997471322311e-9,-0.0015751042615903047,1.003778163139329e-5,-5.487458624638412e-9,-0.001574765041689377,1.0349895109118027e-5,-5.240176643150512e-9,-0.0015745057554236149,1.0681318357532525e-5,-4.978030419643896e-9,-0.001574324361526077,1.0998934195309128e-5,-4.727059345412328e-9,-0.0015742076584801335,1.1272847997949395e-5,-4.510760254880358e-9,-0.0015741334933916324,1.148015300643822e-5,-4.347106597166391e-9,-0.0015740736145208995,1.1607546540740536e-5,-4.2464524410951475e-9,-0.0015739967905234456,1.165297766004052e-5,-4.210215818202505e-9,-0.0015738721019847755,1.1626573124438477e-5,-4.230176567081147e-9,-0.0015736725816667494,1.1550994953670337e-5,-4.288272760115865e-9,-0.0015733796828682138,1.1460984868635478e-5,-4.357060355334619e-9,-0.0015729888863822469,1.1400977627530216e-5,-4.401668546947189e-9,-0.001572515654131937,1.1418948321355508e-5,-4.38465144129614e-9,-0.0015719991378984194,1.155499016771094e-5,-4.27489553861985e-9,-0.0015714991590845522,1.1825387317786e-5,-4.059992614526739e-9,-0.0015710820407434478,1.2207971645261938e-5,-3.757587705347629e-9,-0.00157079647604091,1.2639630181296142e-5,-3.4172617851035963e-9,-0.0015706506457699233,1.3034205729014649e-5,-3.106531606911105e-9,-0.0015706061696304065,1.3315507185698884e-5,-2.885049906609442e-9,-0.0015705947849098492,1.3446774868260129e-5,-2.7815199812259615e-9,-0.0015705471798354855,1.3439686701807493e-5,-2.7865797392088607e-9,-0.0015704165589056223,1.3341690442592115e-5,-2.8627232184856177e-9,-0.0015701872847721412,1.3213818456770147e-5,-2.9617956699222407e-9,-0.0015698706765883304,1.3111683729022345e-5,-3.0400379076245207e-9,-0.0015694951802119525,1.3074916344619818e-5,-3.0664473087197053e-9,-0.0015690965559719964,1.3124045477720016e-5,-3.02518922812497E-09,-0.0015687104237655423,1.3261776187223445e-5,-2.914483963298332e-9,-0.0015683672849147719,1.3476135614623932e-5,-2.744017121960997e-9,-0.001568089331561201,1.3744221248213585e-5,-2.531925583923272e-9,-0.001567888481635352,1.4036199389495978e-5,-2.301652902586154e-9,-0.0015677654444036897,1.431949385617295e-5,-2.0787019259425203e-9,-0.001567709854690696,1.4563082634763757e-5,-1.8873090716874538e-9,-0.0015677016010537767,1.474164561397543e-5,-1.7472081474154697e-9,-0.0015677133377832947,1.4839081201440235e-5,-1.6708576042155112e-9,-0.0015677139033290711,1.4850945784761677e-5,-1.6615071481920558e-9,-0.001567672273456403,1.4785614343760266e-5,-1.712298071717079e-9,-0.001567561728035762,1.4664077909571058e-5,-1.8064872373507266e-9,-0.001567363964362006,1.4518342278869283e-5,-1.9188087740274477e-9,-0.0015670730416101715,1.4388371092908044e-5,-2.017975036911366e-9,-0.001566699009351379,1.4317124795163991e-5,-2.0706086887569183e-9,-0.001566270342050259,1.434288706438812e-5,-2.0471994116831762e-9,-0.0015658331609196012,1.4488670512990482e-5,-1.9302484376469083e-9,-0.0015654445000836176,1.4750408147840926e-5,-1.72331580198987e-9,-0.0015651576376926135,1.5088818242514955e-5,-1.4572399696723894e-9,-0.0015650016611725502,1.543273520838367e-5,-1.1875289074112136e-9,-0.0015649646525930018,1.5699315031914638e-5,-9.786981777112633e-10,-0.0015649932080395524,1.5825615668091956e-5,-8.797288461446118e-10,-0.0015650127561441629,1.5794360168681763e-5,-9.039460652179229e-10,-0.0015649578766231919,1.5637909598140213e-5,-1.0258340424130335e-9,-0.0015647946888691952,1.5419919015121727e-5,-1.1953572908828253e-9,-0.001564525408102832,1.5208671664966406e-5,-1.3589165068917122e-9,-0.0015641786040441487,1.5056893076463547e-5,-1.4752664574075088e-9,-0.00156379486909857,1.4993534545273575e-5,-1.521981552315444e-9,-0.0015634150399108117,1.5024788854757072e-5,-1.4945831313107964e-9,-0.0015630731490801214,1.5139317110787819e-5,-1.4023153307767539e-9,-0.0015627932503844573,1.5314097884522007e-5,-1.2634546568637839e-9,-0.0015625884467632353,1.5519419283943223e-5,-1.1013546330723007e-9,-0.001562460875346721,1.5722949233932406e-5,-9.412785609553453e-10,-0.0015624021479970563,1.5893311969822037e-5,-8.076525173200512e-10,-0.0015623942663999986,1.600355815982286e-5,-7.213957276926135e-10,-0.0015624113087739449,1.603464562664121e-5,-6.972120092446669e-10,-0.0015624222244725121,1.5978599480086515e-5,-7.411073308205331e-10,-0.0015623947894483653,1.5840685366149302e-5,-8.486840929629714e-10,-0.0015623003825704094,1.563995164582476e-5,-1.0047498832725248e-9,-0.00156211896716867,1.5407677934949402e-5,-1.1846143530044873e-9,-0.0015618434715127026,1.5183522199556461e-5,-1.3572122413585078e-9,-0.001561482731818114,1.5009579708722523e-5,-1.4898312300154014e-9,-0.0015610623229379093,1.492287455651844e-5,-1.553978673492256e-9,-0.0015606225925568506,1.4946887881331915e-5,-1.5318866836714567e-9,-0.001560212971251659,1.5083203136375069e-5,-1.422837639342225e-9,-0.0015598818401117295,1.530556706953706e-5,-1.2475983890907835e-9,-0.0015596626235708532,1.5560011265301256e-5,-1.0482226412439358e-9,-0.001559559627593272,1.577486934926789e-5,-8.802955933378288e-10,-0.0015595405570984476,1.5881538273988095e-5,-7.9692043926817e-10,-0.0015595430360532403,1.5839771966023374e-5,-8.291538101517867e-10,-0.0015594959955338393,1.5654660779172335e-5,-9.72801001056983e-10,-0.0015593463001946208,1.5374391353418983e-5,-1.190114515735307e-9,-0.0015590762116928854,1.5069709060576866e-5,-1.4258030022227316e-9,-0.001558703847788798,1.4807611900845037e-5,-1.6276153266680996e-9,-0.0015582703547364113,1.4632787290015397e-5,-1.7608768873779355e-9,-0.00155782354477752,1.4561962806159921e-5,-1.812864234105201e-9,-0.0015574055106049006,1.4587994709651823e-5,-1.7895075593158592e-9,-0.0015570463687551211,1.4687835068240819e-5,-1.7090593224017948e-9,-0.0015567627265973315,1.4830172836249719e-5,-1.5960694700656643e-9,-0.0015565585721585488,1.4981143223910987e-5,-1.4769346528028385e-9,-0.0015564268779924705,1.5108248878273527e-5,-1.3768878228299211e-9,-0.001556351184307716,1.5183283689987646e-5,-1.3177718726983572e-9,-0.0015563071846080817,1.518499355836712e-5,-1.3159931882651027e-9,-0.001556264759061091,1.5101840586844419e-5,-1.3803631127402186e-9,-0.0015561910289953722,1.493467497760959e-5,-1.5099983155967233e-9,-0.001556054769142461,1.4698525876528096e-5,-1.692928407678446e-9,-0.0015558319325716652,1.4422419435365395e-5,-1.9062865699394374e-9,-0.00155551134062967,1.4146276673803998e-5,-2.118820791349384e-9,-0.0015550990200105716,1.3914554215767493e-5,-2.2959501362179986e-9,-0.0015546195256492723,1.376733680242155e-5,-2.406755127218841e-9,-0.001554113115567492,1.3730683214261952e-5,-2.4314473667369036e-9,-0.001553628664032215,1.3808584379673326e-5,-2.367474165297039e-9,-0.0015532132442453931,1.3978822784027847e-5,-2.232532482775318e-9,-0.0015529002123789554,1.4194626461009348e-5,-2.063117347756414e-9,-0.0015526985302697924,1.439325938164884e-5,-1.907804521574992e-9,-0.0015525869004329388,1.4511149461068737e-5,-1.8155962076796212e-9,-0.0015525163561113226,1.4502518791870292e-5,-1.821618126894051e-9,-0.0015524229966605255,1.4355340596169604e-5,-1.934861536785402e-9,-0.0015522480046320417,1.4097085782131253e-5,-2.1337720574238567e-9,-0.0015519570630758844,1.3785964147240603e-5,-2.373056019133126e-9,-0.0015515502090884452,1.3490805690072358e-5,-2.5993134735632945e-9,-0.0015510581583219735,1.3269136012428824e-5,-2.7680732374480753e-9,-0.0015505287216183647,1.3153018247135854e-5,-2.8547493909096727e-9,-0.0015500111337097319,1.3146302784594268e-5,-2.8566824400189927e-9,-0.0015495446374244918,1.3230505435768768e-5,-2.788469542937826e-9,-0.001549153320614908,1.3373991814169866e-5,-2.6747740927702085e-9,-0.0015488458317407083,1.3540368315253085e-5,-2.543818936185515e-9,-0.0015486175736199625,1.3694424215569561e-5,-2.422826603784886e-9,-0.0015484534953238353,1.3805782453544893e-5,-2.335244042665086e-9,-0.0015483305799586244,1.3851194736815257e-5,-2.2989915178837034e-9,-0.0015482199989999771,1.3816427644258473e-5,-2.3249912029369815e-9,-0.001548089463216438,1.369826171317471e-5,-2.41558809311908e-9,-0.0015479064843226234,1.3506495043573231e-5,-2.5629790637511724e-9,-0.0015476430650823826,1.3265142070830212e-5,-2.748308110889761e-9,-0.0015472817047777522,1.3011433188873347e-5,-2.9425170054115522e-9,-0.0015468215378123499,1.2791153939947237e-5,-3.1100615838046316e-9,-0.0015462823008519895,1.264978126784404e-5,-3.2158634430605283e-9,-0.0015457034820694632,1.2620793299373853e-5,-3.23437207800151e-9,-0.0015451371557708795,1.271461979911524e-5,-3.1580199349164043e-9,-0.0015446354809309358,1.2912598720449401e-5,-3.001718234269623e-9,-0.0015442364302565255,1.3169086681883902e-5,-2.801040276875315e-9,-0.0015439524938185769,1.342193894043896e-5,-2.604019123633512e-9,-0.0015437662068975597,1.3608488064402962e-5,-2.4588197532468753e-9,-0.0015436340713854192,1.3682357584886e-5,-2.4008622169249547e-9,-0.001543497962354699,1.3626252232787606e-5,-2.4430807619033354e-9,-0.00154330101649021,1.3456844397511336e-5,-2.572263294225788e-9,-0.0015430034083978895,1.3219882326718478e-5,-2.7529027871083723e-9,-0.0015425929181858147,1.2976711436722279e-5,-2.937645646025132e-9,-0.0015420866882192013,1.278670592403656e-5,-3.080856310691857e-9,-0.00154152398796979,1.2691851204048305e-5,-3.1504613502583297e-9,-0.001540953480044075,1.2708519035282108e-5,-3.1341863973903237e-9,-0.0015404202334010281,1.2827867903263539e-5,-3.039126457904035e-9,-0.0015399566733843208,1.302256759212801e-5,-2.886485245993735e-9,-0.0015395788942260255,1.325586308652444e-5,-2.7045866919813093e-9,-0.0015392872954454852,1.3489692472678766e-5,-2.5226746116671805e-9,-0.0015390695180788213,1.3690362719305401e-5,-2.3666060094382767e-9,-0.0015389039426561332,1.3831829101966165e-5,-2.2563601055744896e-9,-0.0015387628159656927,1.3897428531583792e-5,-2.20469239650718e-9,-0.0015386148936828994,1.388103058929039e-5,-2.2162086122068876e-9,-0.0015384280799308537,1.3788188762037226e-5,-2.28644706084773e-9,-0.0015381727896268602,1.3637252599749298e-5,-2.4010335015984904e-9,-0.00153782662638598,1.3459685165893791e-5,-2.5355047694054314e-9,-0.0015373803606947806,1.3298103454663454e-5,-2.6569224773298658e-9,-0.0015368439449366434,1.3200271754010526e-5,-2.7285944715443808e-9,-0.0015362497069414172,1.3208268582747388e-5,-2.7184455758695063e-9,-0.0015356491281297727,1.3344727868614513e-5,-2.609535624585385e-9,-0.0015351012857119798,1.3601376685119754e-5,-2.4087144532296773e-9,-0.001534655333305587,1.3936432395579682e-5,-2.1484399499017215e-9,-0.0015343338675460306,1.4284442308400234e-5,-1.8790986065537597e-9,-0.001534124900712501,1.4575769360907748e-5,-1.6540268609434805e-9,-0.001533986063403117,1.4757650849527079e-5,-1.5134089313619608e-9,-0.0015338585577077514,1.4808523097929115e-5,-1.4733758294952858e-9,-0.001533684646016743,1.4741520547899112e-5,-1.5234227094639102e-9,-0.001533422629589494,1.4597945041350879e-5,-1.6315309243635806e-9,-0.0015330556633583313,1.4434363097761433e-5,-1.7541719141681908e-9,-0.0015325932941699795,1.43077142414427e-5,-1.8477863331828831e-9,-0.0015320665277323265,1.426230754346835e-5,-1.878725396982042e-9,-0.0015315185461519663,1.4321473573738102e-5,-1.8295328556822685e-9,-0.001530993934766879,1.4485180350014558e-5,-1.7006180859558923e-9,-0.001530529287402824,1.4733246178698408e-5,-1.5076755247691595e-9,-0.0015301472235543963,1.5032273750256648e-5,-1.2763383865137975e-9,-0.001529854434526647,1.5343751423442615e-5,-1.0360201232972493e-9,-0.0015296430494533845,1.5631173065596047e-5,-8.145421075795626e-10,-0.0015294939224596445,1.5865044960165455e-5,-6.343581941131169e-10,-0.0015293804665335667,1.6025681201232713e-5,-5.104211518947967e-10,-0.0015292721800424954,1.6104406698012555e-5,-4.492264661427397e-10,-0.0015291376898846022,1.610398838942385e-5,-4.484456737093128e-10,-0.0015289476443276155,1.6038826092304203e-5,-4.967851368558057e-10,-0.0015286780300962212,1.5934920116292352e-5,-5.7407767303816e-10,-0.0015283144581671828,1.5828995706173513e-5,-6.520649957069123e-10,-0.001527857433495814,1.5765420962771622e-5,-6.968641554284709e-10,-0.0015273273599870595,1.578919190086431e-5,-6.74377333345776e-10,-0.001526766307082904,1.5934197950098757e-5,-5.592021348606761e-10,-0.0015262325434225242,1.6208917896855537e-5,-3.454009983392546e-10,-0.0015257856016340661,1.6585900155219326e-5,-5.434009904032178e-11,-0.001525465322369261,1.7003376453317625e-5,2.6667254099619e-10,-0.0015252747715500247,1.738282006332563e-5,5.577945753003107e-10,-0.0015251774516648478,1.765614484759572e-5,7.673293029466002e-10,-0.0015251111941016761,1.778888314628154e-5,8.693422948032573e-10,-0.0015250108675460873,1.7788373699605145e-5,8.698678813149482e-10,-0.0015248284104435656,1.769597096092772e-5,8.008933904221264e-10,-0.001524543138352943,1.7570342537972436e-5,7.074837082249667e-10,-0.001524161958697962,1.747014596631279e-5,6.344307222398109e-10,-0.00152371290844506,1.7441141511317046e-5,6.163780060845438e-10,-0.001523235851785127,1.7509215448337496e-5,6.72585413499027e-10,-0.0015227730669315363,1.7678694633934106e-5,8.058200670495614e-10,-0.0015223612736943114,1.7934688640477055e-5,1.0043203383510617e-9,-0.0015220259505717274,1.82482101335355e-5,1.2458005545171251e-9,-0.0015217783771147274,1.858278154644696e-5,1.502482588468059e-9,-0.0015216153779278,1.8901176203271382e-5,1.7461563926156706e-9,-0.001521521286606779,1.9171184850908933e-5,1.9524855806838318e-9,-0.0015214713531420381,1.936973086375099e-5,2.1040967574472464e-9,-0.0015214357043695024,1.9485117407839795e-5,2.1923000740043392e-9,-0.001521383137404215,1.9517692447771478e-5,2.217627952739704e-9,-0.0015212844821984616,1.9479511468266107e-5,2.1895835175049778e-9,-0.0015211156742934025,1.939342867657197e-5,2.1258913140746853e-9,-0.0015208608563400331,1.9291673965034527e-5,2.0512979780619082e-9,-0.001520515854495682,1.9213505125941906e-5,1.995657851135691e-9,-0.0015200919884612346,1.9200901897949216e-5,1.9905876211772794e-9,-0.0015196190517206686,1.9290978781291798e-5,2.0637415938522103e-9,-0.001519144803733725,1.9504713196396947e-5,2.2304122471037216e-9,-0.001518727462232059,1.9834280591372538e-5,2.484141135478913e-9,-0.0015184192950395239,2.0235367514319987e-5,2.7910634415758664e-9,-0.0015182452262433325,2.0633099952696904e-5,3.0944338572009063e-9,-0.0015181877354138221,2.094520859440517e-5,3.3320858875781925e-9,-0.0015181899043198905,2.1113683302729238e-5,3.4603240998125803e-9,-0.0015181776587180065,2.1127106051478163e-5,3.4708520228233463e-9,-0.0015180885131474918,2.1021030404410242e-5,3.391091106264991e-9,-0.0015178909438639508,2.0859213783789e-5,3.2698730446144373e-9,-0.0015175877233646422,2.0709171992738493e-5,3.1587082248994756e-9,-0.0015172073558787026,2.0623842481949752e-5,3.0977101310951086e-9,-0.0015167914191089214,2.063317965218757e-5,3.109204821067375e-9,-0.0015163832619076432,2.0743705953134367e-5,3.1975368071754336e-9,-0.0015160200669873704,2.0942485608743105e-5,3.3523023756736195e-9,-0.0015157281682930876,2.1202788343014117e-5,3.5528268410564887e-9,-0.0015155208240000008,2.1490072546112796e-5,3.7727761422749006e-9,-0.0015153978329193042,2.1767775800983042e-5,3.984512020996164e-9,-0.0015153466823297202,2.2002561279956053e-5,4.162975427671088e-9,-0.0015153449752000046,2.2168662578104594e-5,4.2888951154383054e-9,-0.0015153638372301824,2.225102728825126e-5,4.351136659371982e-9,-0.001515371889179471,2.2246993016359994e-5,4.3479874066622305e-9,-0.0015153392563930425,2.216641597337143e-5,4.287271959233951e-9,-0.001515241213541778,2.2030490914074532e-5,4.1854284582402095e-9,-0.0015150613338686283,2.1869574703626888e-5,4.065761994294679e-9,-0.0015147941551076818,2.1720147110229897e-5,3.956004055400928e-9,-0.0015144474064621842,2.1620798118500058e-5,3.885163322724043e-9,-0.0015140436280418352,2.160676344805545e-5,3.879380610579873e-9,-0.0015136202312386242,2.1702388771875214e-5,3.956357484574458e-9,-0.001513226034844196,2.191177437422689e-5,4.1185205826258535e-9,-0.0015129120080209172,2.221001677650227e-5,4.346649078495528e-9,-0.001512715541928629,2.254041791686142e-5,4.597890678761155e-9,-0.001512642323751254,2.282451516198137e-5,4.8132638236435735e-9,-0.001512656112032841,2.2987226657755368e-5,4.936448725917021e-9,-0.0015126871339836351,2.2987814401065566e-5,4.937036368579893e-9,-0.0015126589666124984,2.283832816494508e-5,4.824488181507253e-9,-0.0015125191642603442,2.2596939508072832e-5,4.643164810446097e-9,-0.001512255771697461,2.234135481963672e-5,4.452159952580022e-9,-0.0015118937115124553,2.2139907404171068e-5,4.303255975411923e-9,-0.00151147883232571,2.203443093930126e-5,4.227845582902372e-9,-0.001511060993239207,2.2037202305538674e-5,4.234671953457867e-9,-0.0015106824975225093,2.213657085421608e-5,4.314282868663287e-9,-0.0015103725536317254,2.2305348342064856e-5,4.4455958177446396e-9,-0.001510145935250769,2.2508543748264166e-5,4.601885979825811e-9,-0.0015100037941396729,2.27093975733727e-5,4.75536669510632e-9,-0.0015099353530227085,2.2873996336669858e-5,4.880600371514767e-9,-0.0015099200916151164,2.2974973370313923e-5,4.957188134048892e-9,-0.0015099304637137257,2.2994496007904244e-5,4.971952359005194e-9,-0.0015099352286913673,2.2926461766264454e-5,4.920579998432417e-9,-0.0015099033645110472,2.277759522000927e-5,4.808472749402745e-9,-0.0015098082535331882,2.256704567886276e-5,4.650450638927179e-9,-0.0015096316019525189,2.2324318804894625e-5,4.469136915658275e-9,-0.0015093665766133704,2.208567924099814e-5,4.2921241199986e-9,-0.0015090197629728298,2.1889299652124044e-5,4.148176635499323e-9,-0.0015086116448405531,2.1769507934527783e-5,4.062815296740895e-9,-0.0015081753500045245,2.1750466832938717e-5,4.05360291565382e-9,-0.0015077531763032308,2.183960388547096e-5,4.125383508132904e-9,-0.0015073900399322092,2.202167990402843e-5,4.2660809956394935e-9,-0.0015071232263286609,2.225573764208077e-5,4.44462415416496e-9,-0.0015069693776782423,2.2478572667533146e-5,4.6136193435732875e-9,-0.0015069127900212765,2.261830809440704e-5,4.719430802140069e-9,-0.0015069025568193628,2.2617773461514468e-5,4.719545121206075e-9,-0.0015068654430890603,2.2459193836491986e-5,4.601005606662283e-9,-0.001506732732291867,2.2175454413684737e-5,4.388897633440769e-9,-0.0015064676102254564,2.1838262916960467e-5,4.1374773793336535e-9,-0.0015060770908259737,2.152899176668202e-5,3.9081543995164606e-9,-0.0015056034531821725,2.130964096087466e-5,3.747499605308365e-9,-0.0015051039831142801,2.120817745888039e-5,3.67616765940978e-9,-0.0015046318558587788,2.121994692951462e-5,3.6900798243215312e-9,-0.0015042251268647423,2.1317953608248667e-5,3.768369282876351e-9,-0.0015039036630436163,2.1464388035088392e-5,3.88222893943776e-9,-0.0015036707819547192,2.1619516091843104e-5,4.001665844105285e-9,-0.0015035165886605325,2.1747302655433718e-5,4.099689013291884e-9,-0.00150342132600212,2.1818716266063703e-5,4.154695925069204e-9,-0.001503358325448771,2.1813879500024203e-5,4.1519986156729824e-9,-0.0015032968462424501,2.1723736492507323e-5,4.08503905892022e-9,-0.0015032052341075262,2.155133538091197e-5,3.956368101994074e-9,-0.0015030546872407823,2.1312355770057032e-5,3.778071180337243e-9,-0.0015028235326783174,2.103420332333634e-5,3.5710789610787957e-9,-0.0015025013887804367,2.075307806093682e-5,3.362886440108658e-9,-0.0015020922453497882,2.0508886287330707e-5,3.183598559287639e-9,-0.0015016154742786625,2.0338452391119222e-5,3.0607104114683997e-9,-0.0015011040515861569,2.0268076034948164e-5,3.0134867470089806e-9,-0.001500599804274013,2.030688168146457e-5,3.04807733049152e-9,-0.0015001460726057133,2.044239395900025e-5,3.154424023362247e-9,-0.00149977856352969,2.0639604039527855e-5,3.305819021705255e-9,-0.0014995156172464786,2.0844817059723325e-5,3.461959279396227e-9,-0.0014993500137638414,2.0995399978085027e-5,3.576249789876038e-9,-0.0014992456432738306,2.1035335583678028e-5,3.60729449457631e-9,-0.0014991428844553212,2.0933644184201608e-5,3.532476786791916e-9,-0.0014989745730104767,2.0698804268457708e-5,3.3586078624101303e-9,-0.0014986888360896111,2.0380406021878866e-5,3.1231135922833585e-9,-0.0014982686733544998,2.0053717417477414e-5,2.88245886837212e-9,-0.001497737525690711,1.979300837962255e-5,2.692135997911263e-9,-0.001497148017881539,1.9647196210900128e-5,2.588415637713842e-9,-0.0014965613991866607,1.9629093705834248e-5,2.5803785904338805e-9,-0.0014960289411646245,1.971968706434261e-5,2.653283174951249e-9,-0.0014955820412908304,1.9880736800477454e-5,2.778157555940626e-9,-0.0014952309905867504,2.006787897714019e-5,2.9216817011335566e-9,-0.0014949687552116315,2.0239968863611068e-5,3.053154202397362e-9,-0.001494776174475137,2.0364131096063462e-5,3.1481831138080597e-9,-0.0014946265704327824,2.0417849223123522e-5,3.1901577490234746e-9,-0.0014944892845262566,2.038968095963877e-5,3.170735822070018e-9,-0.001494332545660484,2.0279629489477603e-5,3.090127645122555e-9,-0.0014941263545837618,2.009946410020862e-5,2.957370145196969e-9,-0.0014938459444002585,1.9872625600314708e-5,2.7902699955053625e-9,-0.0014934759328347927,1.9632856641228426e-5,2.614335134584265e-9,-0.0014930145655336932,1.9420569813598002e-5,2.4599538294097267e-9,-0.001492476702076429,1.9276431553751654e-5,2.3574741074222654e-9,-0.001491893815555032,1.923270705234934e-5,2.3306640563010123e-9,-0.0014913096645020614,1.930428755097455e-5,2.3900526656468323e-9,-0.0014907716135890666,1.9482318555866433e-5,2.5283426168944e-9,-0.0014903193643921373,1.973316438958572e-5,2.7198781518158167e-9,-0.0014899741448074898,2.0003956799043533e-5,2.9249937542774248e-9,-0.0014897315523588778,2.023395845028581e-5,3.098573729705269e-9,-0.0014895604078392077,2.036929696434408e-5,3.200967785115278e-9,-0.0014894086578894246,2.0377579597678796e-5,3.2087039570247428e-9,-0.0014892158047863976,2.0258385868426954e-5,3.122098731804692e-9,-0.001488929416536435,2.00457625312811e-5,2.9669485121319134e-9,-0.0014885210657221955,1.9800292408669174e-5,2.7885218058526498e-9,-0.0014879957071757151,1.9591794282292342e-5,2.6386436925550972e-9,-0.0014873899746012964,1.9478359809753334e-5,2.5601312681883347e-9,-0.0014867596618360918,1.949011570768919e-5,2.5748323704033555e-9,-0.0014861620498762876,1.96239922223134e-5,2.6799132147527057e-9,-0.0014856407320978139,1.9849868774778618e-5,2.8525944425785092e-9,-0.0014852179082245765,2.0123138972227992e-5,3.0595746869390322e-9,-0.001484894404555705,2.0397436089605455e-5,3.266468246613373e-9,-0.0014846544662120268,2.063358248057847e-5,3.444366312054756e-9,-0.0014844719149976677,2.080401172999627e-5,3.573026893968126e-9,-0.0014843155256631664,2.089389600951698e-5,3.6416569247405195e-9,-0.0014841529717873015,2.0900677734307805e-5,3.6485643076621275e-9,-0.0014839536957402732,2.083324538196875e-5,3.6005774495059056e-9,-0.0014836914694317035,2.0711220588510544e-5,3.5125354304605184e-9,-0.0014833473561297718,2.0564086382282243e-5,3.406608295349423e-9,-0.0014829133688975399,2.0429297886048457e-5,3.3108019367196984e-9,-0.0014823963710327067,2.0348185310062236e-5,3.25579730356668E-09,-0.0014818207428450856,2.0358734524199104e-5,3.269510016130022e-9,-0.0014812274772494347,2.048563738802864e-5,3.369725367338494e-9,-0.0014806675693328044,2.0730221397913308e-5,3.556767697544755e-9,-0.0014801896123771137,2.106481501301274e-5,3.809538836492915e-9,-0.0014798249253679303,2.143590416769047e-5,4.088059593597637e-9,-0.0014795761455542354,2.177709692752412e-5,4.3431788306475135e-9,-0.0014794146511569793,2.202796158292254e-5,4.530508461441201e-9,-0.0014792883061481331,2.21516328538685e-5,4.623353141774396e-9,-0.0014791364524373138,2.2144870224967428e-5,4.620002061129199e-9,-0.001478906684187595,2.203791530288745e-5,4.543444647931511e-9,-0.0014785683235115793,2.1885258092804413e-5,4.434360357647662e-9,-0.0014781193401062422,2.1750689691606835e-5,4.339933827235743e-9,-0.0014775854795386373,2.169092982823376e-5,4.3017291032046366e-9,-0.001477012299802205,2.1742145708306606e-5,4.345842348530162e-9,-0.0014764526498468376,2.191281179061359e-5,4.477843345187745e-9,-0.0014759534363243591,2.2184454181331846e-5,4.683549499194312e-9,-0.0014755455960484022,2.2519217855883682e-5,4.93475027814799e-9,-0.0014752396898019221,2.2870962823821085e-5,5.1974073013490225e-9,-0.0014750271342094889,2.3195958122338928e-5,5.439457561441334e-9,-0.0014748851544931095,2.3460421517391652e-5,5.636259530417908e-9,-0.0014747829673421675,2.3644120169039524e-5,5.773169265596725e-9,-0.001474687320693333,2.374080291527646e-5,5.845840169919798e-9,-0.0014745666070528286,2.3756880234768512e-5,5.859274017653767e-9,-0.0014743937130802754,2.370958754850038e-5,5.826487086509059e-9,-0.0014741482569230124,2.3625217663658505e-5,5.767179828898929e-9,-0.001473818894785108,2.353730629244631e-5,5.7063097259063755e-9,-0.0014734060778071696,2.3484074946004946e-5,5.672082995091509e-9,-0.001472924981874492,2.3504008874457454e-5,5.692603170476783e-9,-0.0014724072644037177,2.3628534088270373e-5,5.790480507708103e-9,-0.0014718991918354172,2.387197597384268e-5,5.975569281186334e-9,-0.0014714535304005726,2.422153315886059e-5,6.2378093646216116e-9,-0.0014711147480171334,2.463284924493281e-5,6.5441791770475725e-9,-0.0014709018005976526,2.5037149761910478e-5,6.844044438239558e-9,-0.0014707971735682401,2.5361087416693702e-5,7.08371765685339e-9,-0.0014707499231823534,2.5551998946229314e-5,7.224937628064112e-9,-0.0014706928556039132,2.559617122586235e-5,7.2582251778159335e-9,-0.0014705654035565266,2.5521412187611647e-5,7.204692681405604e-9,-0.0014703314954858874,2.5384704814681434e-5,7.106814374546921e-9,-0.001469986538679709,2.5252782134341083e-5,7.013936096625625e-9,-0.0014695540981764408,2.5183955143550453e-5,6.968766442288963e-9,-0.0014690762900327096,2.5215950258180403e-5,6.998456432120111e-9,-0.0014686020708823385,2.5360870206104967e-5,7.1110940673169154e-9,-0.001468176386598783,2.5606318665205407e-5,7.296811789583651e-9,-0.001467831922902369,2.592100301791191e-5,7.532134484148677e-9,-0.0014675843884544473,2.6263002803544234e-5,7.786145194716698e-9,-0.0014674316308986469,2.6588795756606222e-5,8.027060457500164e-9,-0.0014673561469447757,2.6861167542429433e-5,8.22790296065784e-9,-0.001467329858105644,2.7054651629686617e-5,8.370365121482301e-9,-0.0014673197245071011,2.7158013293985568e-5,8.446566196624374e-9,-0.0014672929285562525,2.717410966689769e-5,8.458950180331899e-9,-0.0014672208834997042,2.7118011201820044e-5,8.4189307986924e-9,-0.0014670820001531884,2.7014370775278294e-5,8.34495143072538e-9,-0.0014668636033767842,2.6894642929169563e-5,8.260369284515231e-9,-0.0014665634811135814,2.6794222102966245e-5,8.19123024785904e-9,-0.0014661914098972825,2.674909228562432e-5,8.163696466874626e-9,-0.001465770520724381,2.679114846664634e-5,8.200590836488431e-9,-0.001465337400999473,2.6941364730020337e-5,8.316505230393117e-9,-0.0014649388274165344,2.720105595585084e-5,8.511638713086152e-9,-0.0014646228477321868,2.7543744071366404e-5,8.766111014759959e-9,-0.0014644237187200332,2.791300341092992e-5,9.03854416039646e-9,-0.001464344966501293,2.8232690622237343e-5,9.273507511061049e-9,-0.00146435037296069,2.8431059296295023e-5,9.418980704214775e-9,-0.0014643722903750673,2.8469546292426055e-5,9.447272055057291e-9,-0.0014643365365555757,2.835968319109381e-5,9.367378735882624e-9,-0.0014641906956874835,2.8157374663821298e-5,9.220801767421116e-9,-0.0014639203699168175,2.793907130398366e-5,9.063972153156974e-9,-0.001463547743641747,2.777469392086682e-5,8.94819704622287e-9,-0.0014631181589848093,2.770971394278009e-5,8.906400483072525e-9,-0.0014626840013922983,2.7759615661242276e-5,8.949152904876544e-9,-0.0014622919778576426,2.7913376841285792e-5,9.067487925009645e-9,-0.0014619755187329977,2.8141209895819113e-5,9.238874894232356e-9,-0.0014617515941158011,2.840319839203045e-5,9.43374255358404e-9,-0.0014616206414562979,2.8657228590944903e-5,9.621316724398479e-9,-0.0014615686117483452,2.88656511750599e-5,9.77438646312151e-9,-0.0014615705063021332,2.9000359578134314e-5,9.872855466969257e-9,-0.0014615948598680729,2.9046009835060456e-5,9.905967029354836e-9,-0.001461608579480747,2.900124632155569e-5,9.873148682283592e-9,-0.0014615815016667387,2.8877991973552452e-5,9.783504838835818e-9,-0.001461490094774729,2.86991569091944e-5,9.65415693656674e-9,-0.0014613200429391873,2.8495379357004293e-5,9.507823393054517e-9,-0.0014610677949529376,2.8301325099769305e-5,9.370010304543687e-9,-0.0014607412749224225,2.8151769243240655e-5,9.266016170060544e-9,-0.001460359934266054,2.807741831222614e-5,9.217802419101563e-9,-0.001459954104262802,2.810012125881796e-5,9.240548810429125e-9,-0.0014595629027557774,2.8227079611997363e-5,9.338632920695437e-9,-0.001459229207373408,2.8444570378339046e-5,9.501348366973721e-9,-0.0014589903312328463,2.8713478214577256e-5,9.699906185659169e-9,-0.0014588646330113623,2.8970928160528702e-5,9.888704607981145e-9,-0.0014588380390138703,2.9143000527045176e-5,1.0014441084658272e-8,-0.0014588592510678298,2.916941323267889e-5,1.0033827086917958e-8,-0.0014588523821274818,2.9030953044343186e-5,9.933409035109415e-9,-0.0014587456644553276,2.8762477106263568e-5,9.739062259576716e-9,-0.001458501091057045,2.844024437257861e-5,9.506799999855063e-9,-0.001458127143420008,2.8150315430128008e-5,9.299622484807696e-9,-0.001457669435461303,2.7957472722960843e-5,9.164649386359438e-9,-0.0014571891196582215,2.788982620398424e-5,9.12181556433836e-9,-0.001456742655817562,2.7940470402478702e-5,9.1652351867303225E-09,-0.0014563700347164715,2.807848674258035e-5,9.271524962474886e-9,-0.0014560912588836175,2.826144010513699e-5,9.409190716108027e-9,-0.0014559078903742333,2.8445360201978687e-5,9.546033498517481e-9,-0.0014558067229891146,2.859145029300421e-5,9.65399985693406e-9,-0.0014557639343839687,2.867025540336573e-5,9.712068997365372e-9,-0.0014557492065120391,2.8664138594720785e-5,9.707890097359682e-9,-0.0014557298001960863,2.8568493551007577e-5,9.638560286519974e-9,-0.0014556745936851589,2.839177608483774e-5,9.510625422205857e-9,-0.0014555579370875656,2.815423714782051e-5,9.339183329667601e-9,-0.0014553629537277198,2.788526924195518e-5,9.14595894628804e-9,-0.0014550838573302906,2.7619586166606147e-5,8.95646433151999e-9,-0.0014547270310782067,2.7392671032165182e-5,8.796565507284847e-9,-0.0014543107698863327,2.7235881381529104e-5,8.688803061502544e-9,-0.0014538636547068316,2.7171559156514596e-5,8.648806078255112e-9,-0.0014534215710303232,2.7208440099601352e-5,8.68207399305285e-9,-0.001453023162629078,2.7337595874378007e-5,8.781285876904159e-9,-0.0014527031545351094,2.7529636906441165e-5,8.924571639210088e-9,-0.0014524833008458392,2.7735059993107925e-5,9.075970709988018e-9,-0.0014523621957538728,2.7890571544417234e-5,9.19001842577633e-9,-0.0014523077282724134,2.793379091660291e-5,9.22219677030714e-9,-0.0014522585937687897,2.7825223830983982e-5,9.144582317840528e-9,-0.0014521403795198652,2.7569149189017554e-5,8.960821255109384e-9,-0.001451893505617349,2.7219493141957345e-5,8.71038541518176e-9,-0.0014514989868257015,2.6862149989671336e-5,8.455773632611902e-9,-0.0014509858377754307,2.6581283086955036e-5,8.257991564297597e-9,-0.0014504161415827162,2.642918854125528e-5,8.154588223766253e-9,-0.0014498591074915373,2.6414918608475404e-5,8.151437565096828e-9,-0.0014493694267968629,2.6511849721997745e-5,8.228438049517682e-9,-0.001448977429522189,2.667403387196817e-5,8.351639483937653e-9,-0.0014486894408670674,2.6851542282472955e-5,8.484552463610772e-9,-0.0014484932417684118,2.700055872143433e-5,8.595494996252945e-9,-0.0014483645278005612,2.7088384874182358e-5,8.661115546099852e-9,-0.0014482724252906584,2.709519725146361e-5,8.667505390416874e-9,-0.0014481837922433506,2.7014246607076915e-5,8.610209915657879e-9,-0.0014480667630384213,2.6851367625677863e-5,8.493819386236972e-9,-0.0014478939985973695,2.6623968239600285e-5,8.331252341426477e-9,-0.0014476458307236476,2.635924813759418e-5,8.142498231074953e-9,-0.00144731311061095,2.6091231865376743e-5,7.952456649511876e-9,-0.0014468992107673786,2.5856444834127285e-5,7.787722099695875e-9,-0.0014464205463444633,2.5688537660867144e-5,7.672567457310853e-9,-0.0014459051593164764,2.5612502082256553e-5,7.624669465502379e-9,-0.0014453891705153014,2.5639343311066898e-5,7.651283894303304e-9,-0.0014449112632642608,2.5762226244715e-5,7.746636370364774e-9,-0.0014445057152640856,2.595501245227754e-5,7.891145026699935e-9,-0.0014441946694093064,2.6173960497131583e-5,8.052917461887092e-9,-0.0014439806475695987,2.636349963132186e-5,8.192048807278225e-9,-0.0014438411873451745,2.646690890427581e-5,8.268250609640819e-9,-0.0014437286296687954,2.6441511003512633e-5,8.251567637578792e-9,-0.001443578444853297,2.6275165731848128e-5,8.1339948899965e-9,-0.0014433273202660133,2.5997083928831833e-5,7.937096006765073e-9,-0.001442936409115405,2.567444219779277e-5,7.709508223593939e-9,-0.0014424086701659907,2.5391506100637698e-5,7.511889392046065e-9,-0.0014417892862947695,2.5219227646515815e-5,7.3950023164529674e-9,-0.001441147821285167,2.5191187270965408e-5,7.382424698161206e-9,-0.0014405525671188652,2.5297654232244746e-5,7.46642211059057e-9,-0.0014400506984845914,2.549697136888099e-5,7.616367322101587e-9,-0.0014396609875323325,2.573422047511667e-5,7.792362299919142e-9,-0.0014393770763216152,2.595731091946943e-5,7.956884889193762e-9,-0.0014391755390315833,2.6126299063856226e-5,8.081435414644157e-9,-0.0014390240648945822,2.621661961154909e-5,8.14872862017226e-9,-0.0014388876944924675,2.6218749094750767e-5,8.152319004850451e-9,-0.0014387330155882449,2.6136521805769236e-5,8.095315097039274e-9,-0.0014385310964584244,2.5985249879172986e-5,7.98902323659588e-9,-0.0014382599562942464,2.578984727441783e-5,7.851630723953415e-9,-0.001437907000473791,2.558258430097201e-5,7.706602007982529e-9,-0.0014374713475980292,2.539984818095332e-5,7.580298299298504e-9,-0.0014369654370357835,2.5277430919184726E-05,7.498481675769508e-9,-0.0014364149450387434,2.524445155724815e-5,7.481837634246073e-9,-0.0014358560907401488,2.531680732424275e-5,7.541239382042651e-9,-0.0014353299421923447,2.549174348391302e-5,7.67395063074306e-9,-0.0014348742608147498,2.5745447771436074e-5,7.862124322155557e-9,-0.0014345144552345818,2.6035180886781052e-5,8.074600559849243e-9,-0.0014342558619612528,2.6306381027453562e-5,8.272200047331242e-9,-0.001434079589311781,2.6503932782313694e-5,8.415841468953633e-9,-0.0014339437223416472,2.658569469617018e-5,8.476099349229682e-9,-0.0014337909162949274,2.653533090809111e-5,8.442148816768944e-9,-0.0014335620776601706,2.6370518693983798e-5,8.32738512813637e-9,-0.0014332136074441035,2.614232716045764e-5,8.16878953155742e-9,-0.0014327328436069065,2.592319956427502e-5,8.01823403658462e-9,-0.0014321447131647473,2.5785451237951414e-5,7.927095900408931e-9,-0.0014315049081303302,2.5778022969174607e-5,7.92972291182139e-9,-0.001430881462440153,2.591187567232032e-5,8.0331743458699e-9,-0.0014303331772278684,2.616035797685171e-5,8.217711692267238e-9,-0.0014298944934438224,2.6472481447071226e-5,8.446469961108673e-9,-0.0014295714210435305,2.6790920056085873e-5,8.67839265732808e-9,-0.0014293466416022695,2.706669905365202e-5,8.878682424407924e-9,-0.0014291886521796292,2.726698482237647e-5,9.024249768378522e-9,-0.0014290605250002484,2.7376714200605378e-5,9.104750656058354e-9,-0.0014289262535661926,2.7396668664601868e-5,9.121125674470142e-9,-0.0014287546376585928,2.734037378186705e-5,9.083361209742851e-9,-0.0014285215854872378,2.7231132652078738e-5,9.008387004102195e-9,-0.0014282118094740023,2.7099446056366132e-5,8.91824477219024e-9,-0.0014278205169719102,2.6980369162120895e-5,8.838165817857077e-9,-0.0014273551041353886,2.6910052790540644e-5,8.794014126806641e-9,-0.001426836217410468,2.692081607168585e-5,8.808668492982802e-9,-0.0014262969989791532,2.703467650249471e-5,8.897360695655925e-9,-0.0014257791653392638,2.7256366225002294e-5,9.062761040100194e-9,-0.0014253252294257476,2.7568169951920956e-5,9.291482753990074e-9,-0.0014249678412150235,2.7929586139618507e-5,9.554082763102208e-9,-0.001424719247272349,2.8283922152095817e-5,9.8099633515569e-9,-0.0014245649540888968,2.857138997614607e-5,1.0016784431585915e-8,-0.001424464819701088,2.874523105273305e-5,1.0141889729331605e-8,-0.0014243621807249333,2.8785614912595313e-5,1.0172034668321106e-8,-0.001424198594399113,2.8706550061364885e-5,1.0118076747905602e-8,-0.0014239298298215845,2.855338333973738e-5,1.0012952173362216e-8,-0.0014235384273948743,2.8391359153604704e-5,9.903332600293055e-9,-0.001423039068963574,2.8288237213866135e-5,9.837163726172813e-9,-0.0014224748046457894,2.8295862255426144e-5,9.850620457112531e-9,-0.0014219048911750486,2.8436423102220665e-5,9.95855573897215e-9,-0.0014213881167722824,2.8698019217145672e-5,1.0151643259449534e-8,-0.001420967450066756,2.9040746996965335e-5,1.0400951762124473e-8,-0.0014206611416994707,2.941022918094345e-5,1.066766982712532e-8,-0.001420462210050991,2.9752840746124096e-5,1.0913884054961945e-8,-0.0014203445464611544,3.0027360180390388e-5,1.111072374244291e-8,-0.0014202718523974758,3.0210625033603962e-5,1.1242230035220288e-8,-0.0014202059478694213,3.0297793467362173e-5,1.130543514634517e-8,-0.0014201126851082163,3.0299379741317255e-5,1.1308212546961511e-8,-0.001419965354967399,3.023722740125861e-5,1.126641797154726e-8,-0.0014197463754245395,3.0140745523510838e-5,1.1201222166966375e-8,-0.0014194482287997765,3.004374201377961e-5,1.1136832656018542e-8,-0.0014190743137684472,2.9981438465230445e-5,1.1098298258684281e-8,-0.001418639809555389,2.9986901963587264e-5,1.1108885328964141e-8,-0.001418171968272546,3.008617815680982e-5,1.1186579824169502e-8,-0.0014177085861886171,3.0291942135319834e-5,1.133964646008498e-8,-0.001417293059956346,3.05967206924271e-5,1.1562003200599675e-8,-0.0014169650708668305,3.0968510049347896e-5,1.1830355814926381e-8,-0.0014167481369272308,3.135278601208798e-5,1.210581797947972e-8,-0.0014166384270926171,3.168371673086619e-5,1.2341922339142801e-8,-0.001416601011852032,3.1903068064781095e-5,1.2497950944243014e-8,-0.001416577597530908,3.197990561297152e-5,1.2552765821321245e-8,-0.001416504023895075,3.192205189348772e-5,1.2512782170450044e-8,-0.0014163303334027324,3.177388113563488e-5,1.241023118085146e-8,-0.0014160352058320256,3.160197306166359e-5,1.2292773285630224e-8,-0.00141563020412267,3.147525183817631e-5,1.2209223647116733e-8,-0.001415154182806351,3.144686499940079e-5,1.219665427065755e-8,-0.0014146612944608804,3.1542588220823e-5,1.2272337128455885e-8,-0.0014142068212377667,3.17574992652059e-5,1.2431711044918489e-8,-0.0014138345495532411,3.206030619328251e-5,1.2651790954942593e-8,-0.0014135683760217552,3.240316711893786e-5,1.2898338055852669e-8,-0.0014134095167311366,3.273394154711765e-5,1.3134557510283644e-8,-0.0014133391618895421,3.300757270905415e-5,1.3329020931988017e-8,-0.0014133249690354472,3.31939594183018e-5,1.34610409333419e-8,-0.0014133289896605121,3.328119077205221e-5,1.3522794560786908e-8,-0.001413314822460721,3.3274656159752014e-5,1.3518607273504532e-8,-0.0014132527079583823,3.3193518643689525e-5,1.3462443644765452e-8,-0.0014131223461608018,3.3066195373724894e-5,1.3374722960227905e-8,-0.001412913992766144,3.292604615376844e-5,1.3279258055873786e-8,-0.0014126286522506636,3.2807704536436217e-5,1.3200599557144906e-8,-0.0014122779793304208,3.274378481004234e-5,1.3161617579820244e-8,-0.0014118840527596287,3.276134215889836e-5,1.318093997452497e-8,-0.0014114785988180107,3.287744387268909e-5,1.3269863918137662e-8,-0.0014111005438624472,3.309364278437632e-5,1.3428626290622916e-8,-0.0014107903444190032,3.339035361538781e-5,1.3642698341029341e-8,-0.0014105801213301545,3.372401496582465e-5,1.388102605623399e-8,-0.0014104809172316352,3.403140528598448e-5,1.4099169038639324e-8,-0.0014104721889999377,3.4244418459823575e-5,1.4249623837810556e-8,-0.0014105012730983308,3.431313016865975e-5,1.4297897851110098e-8,-0.0014104976530675871,3.4227232153276674e-5,1.4237483279052317e-8,-0.0014103978203613941,3.4023102917727105e-5,1.409478258989675e-8,-0.0014101683041605874,3.37710788967813e-5,1.3920030577394821e-8,-0.0014098152448564095,3.3549879175073367e-5,1.3769043937615413e-8,-0.0014093780596700428,3.342166325020871e-5,1.3685419104499984e-8,-0.0014089135400348065,3.341756238018929e-5,1.3690309226175862e-8,-0.0014084788334548454,3.3535493238112093e-5,1.37811189010826e-8,-0.0014081186845767038,3.374669781848928e-5,1.3936497322555077e-8,-0.0014078585339577186,3.400633332696204e-5,1.4124144409347155e-8,-0.0014077028508541673,3.42645878758073e-5,1.4308805334751806e-8,-0.0014076373664685578,3.4476340111075574e-5,1.4459025629545484e-8,-0.0014076339312917433,3.4608360343685586e-5,1.4552028310657353e-8,-0.0014076568208633863,3.464345854701809e-5,1.457641017245677e-8,-0.001407669277186434,3.458141606859998e-5,1.4532638817739162e-8,-0.0014076391876356137,3.443714237304597e-5,1.4431695615751243e-8,-0.0014075431589499628,3.42369134134312e-5,1.4292440206539112e-8,-0.0014073687088618709,3.401369363319955e-5,1.4138337135936162e-8,-0.0014071148025871514,3.380247774740365e-5,1.3994150056515684e-8,-0.0014067912957618034,3.363619137526845e-5,1.3882976655598566e-8,-0.001406417785833611,3.3542132876375727e-5,1.3823657520053249e-8,-0.0014060220696082155,3.3538605100390865e-5,1.3828389059174037e-8,-0.0014056380007306819,3.363132267047934e-5,1.3900311168766636e-8,-0.0014053019647113963,3.3809476163547754e-5,1.403098639393186e-8,-0.0014050467952829435,3.404235090138576e-5,1.4198316878603361e-8,-0.0014048925106380783,3.427900969237467e-5,1.4366522015636952e-8,-0.0014048352740607154,3.4454830578689884e-5,1.4490717899879615e-8,-0.0014048394576729162,3.450785686877302e-5,1.452817586539771e-8,-0.0014048405652307403,3.4402642110255266e-5,1.4454790297227312e-8,-0.001404764049178016,3.415061768516878e-5,1.4279243287251102e-8,-0.0014045544794032856,3.381223147440442e-5,1.4044512501709342e-8,-0.001404199019517501,3.34753415760048e-5,1.3812662721467575e-8,-0.0014037308928993113,3.322120032523223e-5,1.3640780805957817e-8,-0.0014032126628860826,3.309751484531842e-5,1.3561886833224022e-8,-0.0014027118105852483,3.311012467826726e-5,1.3579138976547671e-8,-0.0014022815504324637,3.3230920394382554e-5,1.3671690150678322e-8,-0.0014019518800177807,3.341272421638346e-5,1.3805518700988216e-8,-0.0014017290980962978,3.360354473780993e-5,1.3943711301648619e-8,-0.0014016000243125806,3.375694744860536e-5,1.4053807349603574e-8,-0.001401537920759662,3.383830386691697e-5,1.4112051071441454e-8,-0.001401508516602354,3.38278961316903e-5,1.4105333153706423e-8,-0.0014014756088146735,3.372177220527613e-5,1.4031568509718768e-8,-0.0014014060660440912,3.353076489929489e-5,1.3898885331730495e-8,-0.0014012739860668733,3.327793091957308e-5,1.3723815329935129e-8,-0.0014010636973225197,3.2994742987017955e-5,1.3528667448275764e-8,-0.0014007713279077503,3.271646976821572e-5,1.3338315101143095e-8,-0.0014004048383781237,3.247734073521475e-5,1.3176767910392181e-8,-0.001399982720160362,3.230609707347399e-5,1.3063963984102755e-8,-0.0013995317115542282,3.222223618554686e-5,1.3013065431940527e-8,-0.0013990837824146862,3.223298100013896e-5,1.3028362806501945e-8,-0.0013986724408224693,3.2330914871978444e-5,1.310378977963939e-8,-0.0013983280897938944,3.249234472603756e-5,1.3222059543851011e-8,-0.0013980719157413676,3.26771022098923e-5,1.3354806377875613e-8,-0.001397908301055983,3.2831582187595467E-05,1.3464847011626819e-8,-0.001397817347062273,3.289747667782527e-5,1.3512189019105797e-8,-0.001397751512132713,3.28277047548693e-5,1.3464871106866769e-8,-0.0013976423203658295,3.260691801970788e-5,1.3312974762696126e-8,-0.0013974208313565252,3.2266892279175194e-5,1.3079220779759064e-8,-0.0013970462170215551,3.188350281420138e-5,1.2816866134850941e-8,-0.001396526429072313,3.15504266134185e-5,1.2591347003175733e-8,-0.0013959162362914407,3.134208482490942e-5,1.2454319312828303e-8,-0.0013952934212709952,3.12876940613365e-5,1.2425488800691024e-8,-0.0013947290248052181,3.1368994960239776e-5,1.2491155941132685e-8,-0.0013942677926455445,3.153656609401135e-5,1.2615901943459306e-8,-0.001393923604268954,3.173094679442987e-5,1.2757639356311874e-8,-0.0013936850245932673,3.189863660685751e-5,1.287894027262053e-8,-0.0013935243292366379,3.20005016684368e-5,1.295286703830315e-8,-0.0013934059148908537,3.2014351751696166e-5,1.2964583482053157e-8,-0.0013932926868055352,3.193431439306784e-5,1.29106853876459e-8,-0.0013931506171936453,3.176890244780789e-5,1.279767711238989e-8,-0.0013929521622677431,3.153852371658084e-5,1.2640170940633758e-8,-0.0013926789463034916,3.1272453315631026e-5,1.2458806214965603e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json
new file mode 100644
index 0000000..fb9e3f3
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":4000,"numberOfSamples":1000,"samples":[-0.0013923237156324762,3.10051313115372e-5,1.227772476593132e-8,-0.0013918913030339685,3.0771749723490945e-5,1.2121506307793586e-8,-0.0013913982265213998,3.060338976954708e-5,1.2011722091998317e-8,-0.0013908707040811456,3.052231698115309e-5,1.1963565646016446e-8,-0.001390341194667023,3.053811122326968e-5,1.198311590315129e-8,-0.0013898437960375297,3.064516965374932e-5,1.206567850949141e-8,-0.0013894089283486013,3.0821985171837794e-5,1.219550046257788e-8,-0.0013890577325521491,3.103246124664618e-5,1.234697235237071e-8,-0.001388796542557306,3.12295787680487e-5,1.2487412403812631e-8,-0.0013886120720738905,3.136210718279558e-5,1.2581786671309725e-8,-0.0013884688947041909,3.1385084006792996e-5,1.2599819994917749e-8,-0.0013883119458332274,3.127360474065753e-5,1.2525244839418013e-8,-0.0013880771300425396,3.103666131759266e-5,1.2365079707027838e-8,-0.0013877108551321243,3.072388276790292e-5,1.2154123117817592e-8,-0.0013871929430152989,3.0416606360292832e-5,1.1948741207200948e-8,-0.001386550391714903,3.0201205713724095e-5,1.1808429582903155e-8,-0.0013858506737383077,3.01357997768827e-5,1.1772803776767341e-8,-0.0013851759104291312,3.0229273883448915e-5,1.1847175892297428e-8,-0.001384592881220668,3.0443874540562336e-5,1.2004550146250928e-8,-0.0013841349373795028,3.0716035009628255e-5,1.2200281016361826e-8,-0.0013838008265632472,3.098058540822912e-5,1.2389009867920565e-8,-0.0013835645353088798,3.118712181259742e-5,1.2536034707260684e-8,-0.0013833877106148682,3.130621279611001e-5,1.2621499602221395e-8,-0.0013832296076505604,3.132862793970199e-5,1.2639667607070031e-8,-0.0013830533398082588,3.12615629520694e-5,1.2596119024238894e-8,-0.0013828292717648978,3.1124447793189026e-5,1.2504739208443173e-8,-0.001382536894290198,3.094526718665489e-5,1.238515875044467e-8,-0.001382166093661862,3.0757242436986546e-5,1.2260502826500002e-8,-0.0013817180828804721,3.059536687843876e-5,1.2155030689028627e-8,-0.0013812057662645032,3.0492356610198686e-5,1.2091316281131741e-8,-0.001380652965115511,3.0473944416237442e-5,1.2086924984252354e-8,-0.0013800918794172976,3.055405387965315e-5,1.2151015510603047e-8,-0.0013795585330693598,3.073089776278415e-5,1.2281664264941277e-8,-0.0013790865545975047,3.098519781713838e-5,1.2464780864846123e-8,-0.0013787002512115332,3.128152698517288e-5,1.2675280274755086e-8,-0.0013784083744284533,3.1573186320784075e-5,1.2880703491497357e-8,-0.0013782000273174174,3.181021399913377e-5,1.3046891803617532e-8,-0.0013780438976636682,3.19495350745652e-5,1.3144947940134445E-08,-0.0013778917807731484,3.1965865743675875e-5,1.3158522917130986e-8,-0.0013776871187557247,3.186125601721507e-5,1.3090054814128084e-8,-0.0013773784345414448,3.167005542915762e-5,1.2963872114938864e-8,-0.0013769355296510653,3.145540027821075e-5,1.2823586040322064e-8,-0.0013763632310821636,3.129451925350386e-5,1.2721957602677264e-8,-0.0013757051938257864,3.12548297658547e-5,1.2704580862237566e-8,-0.0013750325167593762,3.136980980661643e-5,1.2793513871866098e-8,-0.0013744200205683455,3.162705495398507e-5,1.297932656913296e-8,-0.001373921486003332,3.197529339541822e-5,1.3226141868971426e-8,-0.0013735559011152846,3.2345581764334165e-5,1.348632479099502e-8,-0.001373308834962327,3.267443076739067e-5,1.371638565723486e-8,-0.0013731440063741707,3.2918760928589506e-5,1.3887174851188765e-8,-0.0013730169969555664,3.306017025212218e-5,1.3986670884338575e-8,-0.001372885707505598,3.310177282032628e-5,1.4017645484980559e-8,-0.0013727161916267327,3.3062157152929236e-5,1.3993385650784678e-8,-0.0013724849650755444,3.2969528124314865e-5,1.3933613214447525e-8,-0.0013721795043743403,3.2857132549704686e-5,1.3861350571725312e-8,-0.001371798199420233,3.275975393211377e-5,1.3800541749182052e-8,-0.001371350267391638,3.2710546394120883e-5,1.3773879566233536e-8,-0.0013708554660210265,3.273748651144435e-5,1.3800332746004124e-8,-0.0013703429392595617,3.285908614832062e-5,1.3892159705457934e-8,-0.0013698482842253537,3.3079732505826116e-5,1.4051723281032588e-8,-0.0013694081789119867,3.33859216188847e-5,1.4269017354682299e-8,-0.0013690527752354515,3.3745292715916165e-5,1.4521206280880815e-8,-0.0013687973523058758,3.411026251376824e-5,1.4775341685527618e-8,-0.001368635864809167,3.442685430142285e-5,1.4994571911094206e-8,-0.001368539190809793,3.464725058126877e-5,1.5146764379461272e-8,-0.0013684596653155585,3.474271507765218e-5,1.5213225547749854e-8,-0.001368341412275528,3.471292842213015e-5,1.519483961915156e-8,-0.0013681340963783179,3.458864103148684e-5,1.5113572919781048e-8,-0.001367806641243441,3.442624486265195e-5,1.50084742827696e-8,-0.0013673571913396174,3.429481060775766e-5,1.492663952720893e-8,-0.0013668159712882611,3.425816744323766e-5,1.4910976651613327e-8,-0.0013662389537410337,3.4356679623137404e-5,1.4987969233571176e-8,-0.0013656929127156684,3.45948313307106e-5,1.5159539607809455e-8,-0.0013652362239514341,3.493996318255312e-5,1.540252269790559e-8,-0.0013649025854399397,3.533339206451559e-5,1.5676457844807535e-8,-0.001364694017006319,3.5709311516460834e-5,1.5936510012581336e-8,-0.0013645848390629765,3.6013317990182196e-5,1.6146000719145376e-8,-0.001364533006244744,3.6213785847992433e-5,1.6284003030435945e-8,-0.0013644928514191061,3.630413358810897e-5,1.6346724249025713e-8,-0.0013644247321696538,3.629841553527456e-5,1.6344369702902035e-8,-0.0013643001276189908,3.622421100892573e-5,1.6296216699097295e-8,-0.0013641030557909385,3.611585301733881e-5,1.6225972675099123e-8,-0.001363829489218644,3.6009284510185593e-5,1.6158272516967093e-8,-0.0013634861732545276,3.59384398039273e-5,1.6116209694143087e-8,-0.0013630895393642458,3.593237657339973e-5,1.6119355456194334e-8,-0.0013626646638417342,3.601230966247092e-5,1.618170797397962e-8,-0.001362243629102119,3.61880268938273e-5,1.6309266089582144e-8,-0.0013618622841067652,3.64538655276576e-5,1.6497393820657673e-8,-0.0013615544772974737,3.6785502430891855e-5,1.6728827194428735e-8,-0.0013613437161679772,3.713991173468955e-5,1.697386187057922e-8,-0.001361234021080087,3.746108911824493e-5,1.719439828116546e-8,-0.0013612037638524796,3.7692536866159856e-5,1.7352457140518053e-8,-0.001361206847971344,3.779396838960132e-5,1.742144636974678e-8,-0.0013611832374142226,3.7756031020244054e-5,1.7396011201743785e-8,-0.001361076191644119,3.7606086154550635e-5,1.7295762883204998e-8,-0.0013608496577971183,3.7401677631123275e-5,1.716059227166306e-8,-0.0013604990488915285,3.721408821670011e-5,1.7039232838343093e-8,-0.0013600520125571307,3.710835900255645e-5,1.697551683056106e-8,-0.0013595600099726545,3.712640498271043e-5,1.699695432191236e-8,-0.0013590841935409244,3.727760024130748e-5,1.71086275657347e-8,-0.001358679890204125,3.7538440708709115e-5,1.7293378278633092e-8,-0.00135838372132039,3.7860514706880266e-5,1.7517577456580113e-8,-0.0013582064390924846,3.818407848658802e-5,1.7740504047095585e-8,-0.0013581329272131877,3.845318903981301e-5,1.7924558906917483e-8,-0.0013581286541984837,3.862806850028087e-5,1.804345582610699e-8,-0.0013581498661130592,3.869159882723496e-5,1.8086397228283904e-8,-0.0013581539476281528,3.8649261142348775e-5,1.8057850041261867e-8,-0.0013581071226586598,3.8524189345567815e-5,1.7974088393725628e-8,-0.0013579883897526658,3.835008509330396e-5,1.7858356144320932e-8,-0.00135779018044884,3.8164384929534315e-5,1.7736239335068338e-8,-0.001357517027048097,3.800295694389865e-5,1.7632074255281237e-8,-0.0013571835099064594,3.789645286761099e-5,1.7566453802397066e-8,-0.0013568122323385436,3.786770844912354e-5,1.7554432313878906e-8,-0.0013564319146861178,3.792940545542113e-5,1.760394100218013e-8,-0.0013560751230173448,3.808144637277682e-5,1.771409396726125e-8,-0.001355774723096159,3.830809315615486e-5,1.7873437098055103e-8,-0.0013555581129589143,3.85759738967685e-5,1.805883775217439e-8,-0.0013554390847187276,3.883530834118127e-5,1.8236503204011578e-8,-0.001355409076240439,3.9027250633763036e-5,1.836699003058032e-8,-0.0013554321238842734,3.909874292882928e-5,1.8415131641263553e-8,-0.0013554490528045462,3.90218298649933e-5,1.836291168093209e-8,-0.0013553934777036426,3.88088274293409e-5,1.8219570358978306e-8,-0.0013552148739573212,3.8513364752411945e-5,1.8022193158569097e-8,-0.0013548976458011926,3.821394753241361e-5,1.7824422483376295e-8,-0.0013544662886432806,3.7987376502045904e-5,1.767824374087245e-8,-0.001353975167144596,3.788495877740173e-5,1.7617747380746665e-8,-0.0013534897169433626,3.792082265498023e-5,1.765132964873523e-8,-0.0013530679623867672,3.807359000944715e-5,1.776318309780284e-8,-0.0013527479846985185,3.82970266342332e-5,1.7920945154219862e-8,-0.0013525427737545379,3.8534126622979775e-5,1.8085549434599747e-8,-0.0013524413684721215,3.8730475725509086e-5,1.8220348872787433e-8,-0.0013524143580498815,3.8844550459139665e-5,1.829793515757917e-8,-0.0013524218120327396,3.885388259987187e-5,1.830403299861606e-8,-0.0013524218425320289,3.8756778190668846e-5,1.8238389323156565e-8,-0.0013523781464381873,3.857000249417001e-5,1.8113029207340084e-8,-0.0013522652859119853,3.832360437107422e-5,1.7948697828581297e-8,-0.0013520711816035556,3.805446144349454e-5,1.7770522740602527e-8,-0.0013517970474576544,3.7800026057570636e-5,1.760383303417335e-8,-0.0013514555502732262,3.759328234789039e-5,1.7470765883749638e-8,-0.0013510681406707162,3.745922197053802e-5,1.7387859156658665e-8,-0.0013506622145259056,3.741251692416933e-5,1.7364450412879974e-8,-0.0013502682953014952,3.7455843878886433e-5,1.7401577299135237e-8,-0.0013499170098815133,3.757843888576176e-5,1.749114206947162e-8,-0.0013496352319221148,3.775487577483726e-5,1.7615323797154796e-8,-0.001349440649488639,3.794495617766193e-5,1.7746750386563e-8,-0.0013493347424008647,3.809671819615431e-5,1.7850659872577422e-8,-0.001349295890582923,3.8155046902679206e-5,1.7890635669466993e-8,-0.0013492766959825838,3.807708327935155e-5,1.783874654599152e-8,-0.0013492110735612106,3.785133903622449e-5,1.768815260529381e-8,-0.001349033855976422,3.751108479626499e-5,1.7461969909133265e-8,-0.0013487069795288752,3.71303580506857e-5,1.7210535401503925e-8,-0.0013482379377772538,3.67993136705882e-5,1.6994726215196717e-8,-0.001347678208637462,3.659042766946213e-5,1.6863046213677397e-8,-0.0013471024913643088,3.6534216931232214e-5,1.6835204236635903e-8,-0.0013465817610538201,3.661531138061667e-5,1.6899639174625656e-8,-0.0013461637307948591,3.67855921967629e-5,1.702274689456107e-8,-0.0013458659040266978,3.698362593147122e-5,1.716236688366139e-8,-0.0013456786096961092,3.715150481672573e-5,1.7279353443021854e-8,-0.0013455729607305563,3.7245547989349e-5,1.7344764650321256e-8,-0.0013455098437546319,3.724113849988471e-5,1.7342896275356996e-8,-0.0013454479816408654,3.713333537401668e-5,1.7271384802952297e-8,-0.0013453504339775678,3.693472237791048e-5,1.7139497446621565e-8,-0.0013451893773290563,3.66714125531848e-5,1.69653115025737e-8,-0.001344949053305138,3.6377906041960216e-5,1.677225728879621e-8,-0.0013446268270830342,3.6091487557028635e-5,1.658542561013439e-8,-0.0013442324429496473,3.584683872566402e-5,1.642801203779135e-8,-0.0013437858000863968,3.567151610583387e-5,1.6318286339007397e-8,-0.0013433138090793446,3.5582718952246464e-5,1.6267381969080993e-8,-0.0013428468552322856,3.5585336135370534e-5,1.6277959343087233e-8,-0.0013424151246411572,3.567102736278635e-5,1.6343650045473796e-8,-0.0013420448217986622,3.581815905326798e-5,1.6449191850671144e-8,-0.0013417540843769415,3.5992621037087415e-5,1.6571231526067074e-8,-0.0013415482762467888,3.6150103914661236e-5,1.6680073457991738e-8,-0.0013414149103668283,3.624123041516313e-5,1.6743183400191018e-8,-0.0013413198868642417,3.622112481074397e-5,1.6731446982117347e-8,-0.00134120845189209,3.606369069563323e-5,1.662842184473864e-8,-0.0013410151654745213,3.577732086480887e-5,1.644054815603201e-8,-0.0013406846000409867,3.5413460407537786e-5,1.6202722853245097e-8,-0.0013401964609990825,3.505743910760731e-5,1.597215167212452e-8,-0.001339580425708274,3.479926151774641e-5,1.5808809507200667e-8,-0.0013389081886428587,3.4697739505285814e-5,1.5751417893888703e-8,-0.0013382653066040724,3.475913717423584e-5,1.5803205836748927e-8,-0.0013377198411129057,3.494136132320177e-5,1.593492656261746e-8,-0.0013373043650111932,3.517656334298736e-5,1.610030358752367e-8,-0.001337015439682562,3.5396327466275055e-5,1.6253166407767607e-8,-0.0013368239990238354,3.5548502293726705e-5,1.6358821610884963e-8,-0.0013366882809558854,3.560374914900627e-5,1.639832805964985e-8,-0.001336564467218173,3.55549452941308e-5,1.636783817572624e-8,-0.001336413776905145,3.541320348266067e-5,1.627564290331889e-8,-0.0013362066349266496,3.520293709170862e-5,1.6138666700184393e-8,-0.0013359249232274644,3.4956909941254224e-5,1.5979096337218204e-8,-0.001335562924155841,3.4711420854670354e-5,1.582122151313896e-8,-0.0013351271377057652,3.4501629448674695e-5,1.568840971408109e-8,-0.0013346349529169633,3.435711455278746e-5,1.5600199028356044e-8,-0.0013341121333342526,3.429797828590833e-5,1.5569686455152157e-8,-0.0013335892705868344,3.433199575848479e-5,1.5601580165570786e-8,-0.0013330975858291425,3.4453164621146024e-5,1.5691228226897585e-8,-0.0013326644706178011,3.464175000353744e-5,1.5824749599259128e-8,-0.0013323090899715643,3.4865868704546576e-5,1.5980301002253026e-8,-0.001332038338966892,3.508467362609938e-5,1.6130447896255385e-8,-0.0013318434113794785,3.525330077002587e-5,1.6245627748951825e-8,-0.0013316975322695253,3.5330051294305984e-5,1.629891139049964e-8,-0.001331556286785722,3.528619312938393e-5,1.6272293810409786e-8,-0.0013313628892067757,3.5117465072944155e-5,1.6163989779264318e-8,-0.0013310606240185723,3.485372509921916e-5,1.5994525193249938e-8,-0.001330612092239529,3.4560074860567006e-5,1.5807325007709106e-8,-0.0013300188819388664,3.432251695865668e-5,1.5659203035008636e-8,-0.0013293294672254824,3.4218415257834896e-5,1.5600856484188996e-8,-0.0013286258106659328,3.4284781738908746e-5,1.565595284409048e-8,-0.0013279927272366466,3.45034557497139e-5,1.5811466092247673e-8,-0.001327487245815521,3.481218305757908e-5,1.6025241776050835e-8,-0.0013271243297834456,3.5132573390047304e-5,1.6244759544611692e-8,-0.0013268819281744182,3.539726971412401e-5,1.6425301589944376e-8,-0.0013267165573191055,3.556482846968116e-5,1.6539830337867083e-8,-0.0013265791200544272,3.5621827657685704e-5,1.65802341767557e-8,-0.0013264257556151145,3.5577571686315266e-5,1.6553560503722946e-8,-0.0013262233226004878,3.5456646993180176e-5,1.6476832678516347e-8,-0.0013259512363842734,3.529220284957108e-5,1.637245418374682e-8,-0.001325601512184336,3.512067149730725e-5,1.626470172512635e-8,-0.0013251780734556981,3.497753493359976e-5,1.6177001160356565e-8,-0.0013246955832461917,3.4893601735033355e-5,1.6129548566876927e-8,-0.0013241776457557696,3.48914999010468e-5,1.6137021291032074e-8,-0.001323654076904617,3.4982458503977466e-5,1.6206426975212878e-8,-0.001323157041794967,3.5163901163299414e-5,1.633548781930137e-8,-0.0013227162371304468,3.5418581049974166e-5,1.651211397605036e-8,-0.001322353687199993,3.571581068946272e-5,1.6715367990939248e-8,-0.0013220789387146789,3.601504810064792e-5,1.6918061706656873e-8,-0.0013218855424575772,3.627176280866538e-5,1.7090842854582353e-8,-0.0013217496703317407,3.644508967537851e-5,1.720733490398808e-8,-0.0013216315923340778,3.65064979819164e-5,1.7249749168249524e-8,-0.0013214807524120568,3.644842841848515e-5,1.7214291107647377e-8,-0.0013212451222116156,3.6291038759722376e-5,1.711523751546295e-8,-0.0013208846495029996,3.60839095678969e-5,1.6985751198887913e-8,-0.0013203863550454039,3.5898854230369885e-5,1.6873006904681262e-8,-0.0013197752519399667,3.581166273538234e-5,1.682623169287687e-8,-0.0013191132255276836,3.587626651540886e-5,1.6879911863534467e-8,-0.0013184815790603076,3.610241659999537e-5,1.7039381967031404e-8,-0.0013179528033887597,3.645020189165614e-5,1.7277474450637978e-8,-0.0013175658344386403,3.684610326885073e-5,1.7545256584706124e-8,-0.0013173174371027003,3.721139594219093e-5,1.7790800848516823e-8,-0.0013171711591591722,3.7487162393554715e-5,1.797564920289059e-8,-0.0013170751083556422,3.764583818573417e-5,1.8082333520008842e-8,-0.0013169783809209286,3.768958704883004e-5,1.8113134460390254e-8,-0.001316841058972772,3.764169488899078e-5,1.8084193168326844e-8,-0.001316637900558923,3.7536910324560003e-5,1.8018963620713753e-8,-0.0013163581227781179,3.74137736701684e-5,1.7943079177386814e-8,-0.0013160036253867771,3.730942928907114e-5,1.7880963442603383e-8,-0.0013155869869080489,3.725613444561233e-5,1.7853614375631473e-8,-0.0013151295414577234,3.7278505354125304e-5,1.787686235519351e-8,-0.0013146592408699255,3.7390914042800114e-5,1.7959684433815758e-8,-0.0013142077768859126,3.759497729467439e-5,1.8102557862085905e-8,-0.0013138065061219567,3.787768395385184e-5,1.829626511989185e-8,-0.0013134811566555547,3.821118959139425e-5,1.852186865762894e-8,-0.0013132460042088404,3.855535190871637e-5,1.8752556581883928e-8,-0.0013130988888896927,3.886358760935178e-5,1.895768052314085e-8,-0.0013130187880983333,3.9091668685304416e-5,1.9108648012779857e-8,-0.0013129673945528086,3.920788927157972e-5,1.9185567048502283e-8,-0.001312895240496861,3.920217618512819e-5,1.918302681873874e-8,-0.001312751730863596,3.9091588709663886e-5,1.911338071545348e-8,-0.0013124973851131767,3.892009752658912e-5,1.9006243630838438e-8,-0.0013121156803837925,3.875132474201483e-5,1.8903462645629538e-8,-0.0013116210944716046,3.865427657691962e-5,1.884969011796569e-8,-0.0013110596023093825,3.868436788208665e-5,1.8880112079492577e-8,-0.0013104989534392041,3.8865074759319735e-5,1.9008779400316116e-8,-0.0013100096397849926,3.917783531577995e-5,1.9222392671536106e-8,-0.001309642829716195,3.9566441267412706e-5,1.9483464693369486e-8,-0.0013094148936341004,3.995569860122959e-5,1.974262974906959e-8,-0.0013093055437344233,4.027611457180882e-5,1.9954738594955732e-8,-0.001309269039156997,4.048329051082387e-5,2.0091415425642147e-8,-0.0013092512762208149,4.0565121305456764e-5,2.0145608286767512e-8,-0.001309204630257768,4.053753924890765e-5,2.012862157893427e-8,-0.0013090962818779034,4.043433842048082e-5,2.0063277178960123e-8,-0.0013089102465701447,4.029664197237238e-5,1.997689758602726e-8,-0.0013086455823332675,4.0164989376255385e-5,1.9896096938048397e-8,-0.0013083132488531785,4.0074480065967925e-5,1.984365052124649e-8,-0.0013079330725531747,4.005204604799757e-5,1.9836785608003348e-8,-0.0013075312073712847,4.011466197911539e-5,1.9886069633644747e-8,-0.001307137746835643,4.026767679567208e-5,1.9994358344677895e-8,-0.0013067837953618638,4.0503094151805196e-5,2.01557240211866e-8,-0.001306497350497541,4.079836018355392e-5,2.0354765247593485e-8,-0.0013062978171497592,4.111688713507512e-5,2.0567103458832157e-8,-0.0013061898867567608,4.141184316071489e-5,2.076202115095573e-8,-0.0013061586859034154,4.163420723263055e-5,2.0907824211338083e-8,-0.001306168888940125,4.174442656977121e-5,2.097944515467198e-8,-0.0013061699709006594,4.1724685296821706e-5,2.0966324787464215e-8,-0.0013061076049721034,4.1587191985985025e-5,2.0877595932876798e-8,-0.0013059383156452651,4.137443165518275e-5,2.0741958445759947e-8,-0.0013056425938951044,4.115010375057371e-5,2.060146632532868e-8,-0.0013052319085176942,4.098302152604378e-5,2.0500810520890916e-8,-0.001304747148248314,4.092874780265062e-5,2.0475326047336553e-8,-0.0013042487662768554,4.101434730128175e-5,2.0541288681716853e-8,-0.0013038012226081626,4.1230688242288156e-5,2.0691321547541416e-8,-0.0013034559571685768,4.153480564579156e-5,2.0896370294196396e-8,-0.0013032379646765557,4.186207205593781e-5,2.111390047210881e-8,-0.0013031404096450596,4.214456168589532e-5,2.1299885763046148e-8,-0.0013031290193728036,4.232935992827865e-5,2.1420571741681682e-8,-0.0013031540596875038,4.23905340975399e-5,2.1460031357444974e-8,-0.0013031647722243158,4.233156537247573e-5,2.1421513055924925e-8,-0.0013031210288061141,4.217942322107834e-5,2.132339132411696e-8,-0.0013029993698451085,4.19743987627646e-5,2.1192421768565933e-8,-0.0013027936105723457,4.175999540557228e-5,2.1057114924379603e-8,-0.0013025120277159838,4.157542941681899e-5,2.094288448231488e-8,-0.0013021733414850117,4.145125605159004e-5,2.0869268627645957e-8,-0.001301802931785606,4.1407329810052036e-5,2.08486684580033e-8,-0.0013014297605223135,4.1451908374797514e-5,2.0885812894513818e-8,-0.001301083724057496,4.158098532303902e-5,2.097737756976615e-8,-0.0013007927456693646,4.177756479690925e-5,2.1111607157953057e-8,-0.0013005788777021498,4.201134797256275e-5,2.126826146359011e-8,-0.0013004531008736547,4.224008178027535e-5,2.1419659516259312e-8,-0.0013004095063849311,4.241435176037529e-5,2.1533904163364884e-8,-0.001300421059288809,4.248719684661846e-5,2.1581120022324038e-8,-0.0013004404355749176,4.2427837091928494e-5,2.154224223145945e-8,-0.0013004089398097013,4.223528221728633e-5,2.1417667998620045e-8,-0.001300273032166463,4.194483810430357e-5,2.1231287584532605e-8,-0.0013000028044365167,4.162178844603964e-5,2.1026176296912758e-8,-0.0012996038559836165,4.13426408192214e-5,2.0852193780685487e-8,-0.0012991166051237216,4.117141562699113e-5,2.075042537733095e-8,-0.0012986036072820868,4.11409724530234e-5,2.0741091404972655e-8,-0.00129813093698426,4.1245817779201306e-5,2.0819172199719124e-8,-0.0012977508063343123,4.144686388868798e-5,2.095795336418839e-8,-0.001297490230837804,4.168441992169005e-5,2.1117875653405696e-8,-0.0012973474395914163,4.1894427134593377e-5,2.1257279803455193e-8,-0.001297295439153459,4.2023506126082147e-5,2.1342116234441085e-8,-0.001297290782074011,4.2039616230905444e-5,2.135260920238544e-8,-0.0012972848326498105,4.193654440887813e-5,2.1285844007437435e-8,-0.0012972345579685953,4.173200901824314e-5,2.1154255926592056e-8,-0.0012971103085002236,4.146082617494708e-5,2.0981029477300475e-8,-0.0012968992859630204,4.116578087591e-5,2.0794135694006106e-8,-0.0012966049398672192,4.0888917956883526e-5,2.062073980233298e-8,-0.0012962436295018886,4.066503581169255e-5,2.048307865442981e-8,-0.0012958401889284622,4.051793533458231e-5,2.039611146731544e-8,-0.0012954236654983476,4.045897416475759e-5,2.036662737785466e-8,-0.001295023782419015,4.0486965044612695e-5,2.039320583348045e-8,-0.0012946679941183582,4.058855472756083e-5,2.04665171281949e-8,-0.001294378612670228,4.0738730472340536e-5,2.056977240662803e-8,-0.0012941693814056939,4.0901748941956324e-5,2.0679500965812705e-8,-0.0012940411451917645,4.1033526442706687e-5,2.0767257575044023e-8,-0.0012939771911233996,4.108715604463087e-5,2.0803239961642293e-8,-0.0012939403977219072,4.102298074380838e-5,2.0762689854466084e-8,-0.0012938758566673656,4.082263405184535e-5,2.0634736809638925e-8,-0.0012937224662835883,4.050242606522025e-5,2.04308134609819e-8,-0.0012934330065076513,4.0117530900919203e-5,2.0187204767311665e-8,-0.00129299496709262,3.974958987689844e-5,1.995693470396842e-8,-0.0012924399284722028,3.947942732467301e-5,1.97920270271869e-8,-0.0012918341252307118,3.935776650460108e-5,1.9724509449887175e-8,-0.0012912547182092019,3.938930857514804e-5,1.97562193674393e-8,-0.001290764690673244,3.9536318616132313E-05,1.9861433777957795e-8,-0.0012903973760540492,3.973598386964465e-5,1.999850762256767e-8,-0.001290153512484858,3.992107605315687e-5,2.0123564778314824e-8,-0.0012900074223779303,4.003630507822636e-5,2.0201177921784495e-8,-0.0012899173653183767,4.0047651738485965e-5,2.0210256251888748e-8,-0.001289836338458807,3.9945200597234635e-5,2.0145554957262593e-8,-0.0012897212998023743,3.9741174964429464E-05,2.0016045030261284e-8,-0.0012895399514628268,3.946480109359224e-5,1.984132894245313e-8,-0.001289274703109967,3.915530609271689e-5,1.9647018285539673e-8,-0.0012889236983102278,3.885435148165427e-5,1.9459904493796818e-8,-0.0012884992067051736,3.8599204907948656e-5,1.9303690980758627e-8,-0.0012880241094008248,3.841760919532316e-5,1.919581678542283e-8,-0.0012875274288492854,3.832480054634275e-5,1.9145604099175267e-8,-0.0012870398381923532,3.8322598965528926e-5,1.9153682307136752e-8,-0.001286589752637628,3.840001624621069e-5,1.921238243257403e-8,-0.001286200095515784,3.853470660398659e-5,1.9306731004946026e-8,-0.0012858854886256378,3.86948874374072e-5,1.9415831342562718e-8,-0.001285649499877651,3.8841815281819475e-5,1.9514646939711093e-8,-0.0012854817125208561,3.893347048250045e-5,1.9576511347082232e-8,-0.0012853550995704204,3.893063802338816e-5,1.957702413451274e-8,-0.0012852255062502298,3.880636244566652e-5,1.9499927026725242e-8,-0.0012850362965845573,3.855807120421911e-5,1.9344575221523857e-8,-0.0012847311762881526,3.821819412132976e-5,1.9132471126811794e-8,-0.0012842747415224602,3.785512960173213e-5,1.8907745295762985e-8,-0.0012836727720354248,3.755682902569352e-5,1.8726620068053298e-8,-0.0012829784848701268,3.739895052372073e-5,1.863702330001396e-8,-0.0012822761530718633,3.7413406126274804e-5,1.86584821716486e-8,-0.0012816490975353263,3.7576622715437714e-5,1.8774747376732938e-8,-0.0012811506382189232,3.782352818577273e-5,1.8943030423325083e-8,-0.001280792436308164,3.8075703038799706e-5,1.9112370169816575e-8,-0.0012805506354879592,3.8266803390174146e-5,1.924016463208864e-8,-0.001280380738437669,3.835616719714332e-5,1.9300925603521577e-8,-0.0012802324630361284,3.833113206068958e-5,1.9287565495948508e-8,-0.0012800605197691444,3.820264194508425e-5,1.920823586964087e-8,-0.0012798308757682997,3.799830026151315e-5,1.9081529959526996e-8,-0.001279523586304221,3.775524645033635e-5,1.8931707405877297e-8,-0.0012791333774328948,3.751366233471992e-5,1.8784512978711527e-8,-0.0012786686262423056,3.731102412992637e-5,1.866362274807214e-8,-0.001278148993439162,3.717726455085912e-5,1.858772206348688e-8,-0.001277601942460214,3.7131143654458575e-5,1.8568311190285357e-8,-0.001277058498171101,3.717813474632904e-5,1.860839408251708e-8,-0.0012765487555219646,3.7310038774287194e-5,1.8702216632045073e-8,-0.0012760977084929888,3.750624505138479e-5,1.8836075192321827e-8,-0.0012757217769639956,3.773626898786361e-5,1.8990020553034313e-8,-0.0012754261510291623,3.796321117292025e-5,1.9140234836138346e-8,-0.0012752029370164196,3.814797161205375e-5,1.92619071682081e-8,-0.0012750300928311285,3.825433491231409e-5,1.9332571089335484e-8,-0.0012748715426223701,3.825537269909844e-5,1.933609650898041e-8,-0.0012746797344262949,3.814138317428424e-5,1.926746861138821e-8,-0.0012744025805871105,3.7928235466975745e-5,1.9137729803848053e-8,-0.0012739963106319753,3.76626292022581e-5,1.897701998328715e-8,-0.0012734431088101711,3.741827327675125e-5,1.8832033009774208e-8,-0.0012727667106644165,3.7277449564075795e-5,1.875439150470419e-8,-0.0012720341118107905,3.730026444876515e-5,1.8781318347441222e-8,-0.0012713356167803904,3.749648014380484e-5,1.8917966913490027e-8,-0.0012707503868975216,3.7818967997163176e-5,1.913345694695096e-8,-0.0012703173742792029,3.818460780063819e-5,1.937431495323869e-8,-0.0012700276843224567,3.850870965846999e-5,1.958648929745315e-8,-0.0012698377681131297,3.873234768920965e-5,1.9732821725893906e-8,-0.0012696906468235986,3.883226562099348e-5,1.9799315570624595e-8,-0.0012695333572401244,3.881646913695297e-5,1.9792123553590806e-8,-0.0012693264687479164,3.8713735516634753e-5,1.9730552119127156e-8,-0.0012690470332673868,3.856312435152506e-5,1.9640099461015192e-8,-0.0012686878191508922,3.840594630060172e-5,1.9547213377593627E-08,-0.0012682550883168057,3.8280251328920796e-5,1.9475836828836382e-8,-0.0012677659821863632,3.8216972883763434e-5,1.9445125675948716e-8,-0.0012672456478990807,3.823702573972687e-5,1.9467782522189376e-8,-0.0012667239315270157,3.834915450270301e-5,1.954879813655444e-8,-0.0012662315252516165,3.8548712365379255e-5,1.9684700622829385e-8,-0.0012657956741872701,3.881779556352557e-5,1.9863631777743846E-08,-0.0012654358895180374,3.9127111421915734e-5,2.0066562567351532e-8,-0.0012651603219259492,3.943960149495701e-5,2.0269701099621573e-8,-0.0012649633922718845,3.97155188282893e-5,2.044787773900412e-8,-0.0012648251191054683,3.991847051986315e-5,2.0578512385264233e-8,-0.0012647124020133814,4.002181530954318e-5,2.0645672703362345e-8,-0.0012645824423290432,4.0014854271467307e-5,2.0643806946391964e-8,-0.001264388687972703,3.99081829052254e-5,2.0580779083148893e-8,-0.001264089784429187,3.973682895821391e-5,2.0479457047750557e-8,-0.0012636612589438738,3.955863316563664e-5,2.0376410433125773e-8,-0.001263107692385635,3.944474943991824e-5,2.031587286383709e-8,-0.0012624700916807313,3.9460627398303827e-5,2.0337965483915675e-8,-0.0012618210646095807,3.9641206055020366e-5,2.0463436185732815e-8,-0.0012612438544760331,3.997186027742948e-5,2.0682014530823786e-8,-0.0012608019231333165,4.03889145758586e-5,2.095293879084057e-8,-0.001260515403514942,4.080331509500292e-5,2.1219900523197546e-8,-0.0012603580066779792,4.1134769690694334e-5,2.143251915066937e-8,-0.0012602736669382706,4.133709908764442e-5,2.156229199212994e-8,-0.0012602001674625438,4.140455790552599e-5,2.1606510199617428e-8,-0.0012600871138250655,4.13627425982667e-5,2.1582334626039323e-8,-0.0012599037723692542,4.125395520943257e-5,2.1517286350261602e-8,-0.001259639059405887,4.112448324373034e-5,2.1440993984703374e-8,-0.0012592978126801822,4.1016374406620794e-5,2.1379934028673295e-8,-0.0012588963729254486,4.096310517242658e-5,2.1354792900167895e-8,-0.0012584587728795547,4.0987516848376617e-5,2.13793433801656e-8,-0.0012580135545439072,4.110070043061135e-5,2.145990419081642e-8,-0.001257590729174874,4.130124851631068e-5,2.1594960240885516e-8,-0.0012572184068382751,4.1574933436424366e-5,2.1774990856265992e-8,-0.0012569188758809874,4.1895365866185666e-5,2.198290829395347e-8,-0.0012567044061644376,4.2226400284913416e-5,2.2195638913385633e-8,-0.0012565736154616957,4.252676325544257e-5,2.2387154231576545e-8,-0.0012565095347204847,4.275674007069808e-5,2.2532803702984725e-8,-0.001256480413149145,4.2886024148070224e-5,2.261430451888185e-8,-0.0012564438185601924,4.290116127527485e-5,2.262433259898739e-8,-0.0012563537977570908,4.2810748157597085e-5,2.256953566001536e-8,-0.0012561701266762151,4.264685474788228e-5,2.2471059965738813e-8,-0.001255868216795208,4.246161786198218e-5,2.2362052663867524e-8,-0.00125544775922725,4.2318356345838705e-5,2.2281882031267264e-8,-0.0012549374800614776,4.22774052795677e-5,2.226731056823057e-8,-0.0012543928884045982,4.237873413357958e-5,2.2341924508824796e-8,-0.0012538846382849707,4.262624486160383e-5,2.2506767656905367e-8,-0.0012534783871114205,4.2981135163356555e-5,2.2736596297391955e-8,-0.0012532126561929605,4.3370682260662835e-5,2.2985558206766268e-8,-0.0012530852538086268,4.3711798272939364e-5,2.3201876301994538e-8,-0.0012530559769681426,4.393918260812166e-5,2.3345305957001018e-8,-0.0012530638749481211,4.4024288239515566e-5,2.3398863033464984e-8,-0.0012530490271740113,4.3977672971138264e-5,2.3370162208987406e-8,-0.0012529684380834512,4.383778762251783e-5,2.3284209882351702e-8,-0.0012528018888721966,4.365500575092296e-5,2.317318439808869e-8,-0.001252549834499636,4.34782797526141e-5,2.3067930135885604e-8,-0.0012522276998212633,4.334721846604825e-5,2.2992993745712078e-8,-0.0012518599576908918,4.3288848879161106e-5,2.2964722563118695e-8,-0.0012514754687159037,4.331706400168195e-5,2.299109201556656e-8,-0.0012511041057524219,4.343305080609753e-5,2.3072114029472213e-8,-0.0012507740089569535,4.362583037811218e-5,2.3200256491004583e-8,-0.001250508740600051,4.387284960062057e-5,2.336086149484763e-8,-0.0012503238892904954,4.414121645053139e-5,2.353297738143989e-8,-0.0012502232383400124,4.439057639247119e-5,2.3691245534858623e-8,-0.0012501953913701654,4.4578519987771495e-5,2.380937649691334e-8,-0.0012502124466062187,4.466862199857083e-5,2.386522426953918e-8,-0.0012502324655709908,4.463985453790723e-5,2.38466230351851e-8,-0.0012502066668911443,4.449465916127025e-5,2.3756267679178933e-8,-0.0012500904907569506,4.4262301368479445e-5,2.3613540810084584e-8,-0.0012498556988007213,4.3995081325114545e-5,2.3451824758728542e-8,-0.0012494996714732477,4.375734202677175e-5,2.3311357072906797e-8,-0.0012490486343557058,4.360978994232384e-5,2.3229326501100328e-8,-0.0012485532799728183,4.359328030608507e-5,2.3229896399582473e-8,-0.001248077323762565,4.3716595091107244e-5,2.331696995481848e-8,-0.0012476814413027032,4.395208150458591e-5,2.3471965518926978e-8,-0.0012474066926813987,4.424143994728845e-5,2.3657815110514976e-8,-0.001247262641945451,4.4511219507711075e-5,2.3828756487483382e-8,-0.0012472248755787513,4.469382181566311e-5,2.3943301525145774e-8,-0.0012472435198697964,4.474664503382738e-5,2.3975912178036033e-8,-0.001247259506344416,4.466205719091103e-5,2.3922954185837815e-8,-0.0012472217473297215,4.446513739596869e-5,2.3801066644975018e-8,-0.0012470987187946957,4.420202198632878e-5,2.3639715221988536e-8,-0.0012468817729012385,4.392519162060175e-5,2.3471897838937096e-8,-0.0012465817445801888,4.368137901444268e-5,2.3326586331146017e-8,-0.0012462224178688196,4.3504603084736476e-5,2.3224476425034505e-8,-0.0012458339394664786,4.3413868956406416e-5,2.317671064191687e-8,-0.0012454477067935401,4.341371210977519e-5,2.318536732956266e-8,-0.001245092875503066,4.349582099726864e-5,2.3244572533892913e-8,-0.001244793861427751,4.364070138997217e-5,2.334159650208275e-8,-0.0012445680145702208,4.381919330597018e-5,2.3457855646996076e-8,-0.0012444228840729505,4.399437802864513e-5,2.35701808197754e-8,-0.0012443530695937283,4.4124913953168016e-5,2.3652983748257247e-8,-0.0012443375127046577,4.4170905959475854e-5,2.36819578137255e-8,-0.001244339050323051,4.410267397222573e-5,2.3639490947179656e-8,-0.0012443085409083597,4.391102098493597e-5,2.352090842966235e-8,-0.0012441949428326805,4.361529559426061e-5,2.3339274923289387e-8,-0.0012439599109511782,4.3264248999509696e-5,2.3125688607710063e-8,-0.0012435919172900148,4.292632418466513e-5,2.2923014333021052e-8,-0.0012431132807987672,4.2670863701421686e-5,2.2774032688701237e-8,-0.0012425758812366372,4.2547004754978845e-5,2.2708303443627026e-8,-0.001242046681417017,4.256875652229016e-5,2.273310098467663e-8,-0.0012415887940260054,4.2711639999148036e-5,2.2831736522023835e-8,-0.0012412448848635037,4.292095325018456e-5,2.2969151481539737e-8,-0.0012410276081992223,4.312771971755229e-5,2.310214052847942e-8,-0.0012409187405165644,4.3266945611404475e-5,2.3190749585606232e-8,-0.001240876179833917,4.329319757536537e-5,2.3207763152117412e-8,-0.0012408462077011405,4.3189822733976015e-5,2.314410023143346e-8,-0.001240777320283415,4.297005585476495e-5,2.3009154427995445e-8,-0.0012406317702474867,4.267059575677806e-5,2.2826536022629307e-8,-0.0012403919863629748,4.234042689642282e-5,2.26269926746929e-8,-0.0012400610415698615,4.2028799199970334e-5,2.2440951581700866e-8,-0.0012396584394359302,4.1775753442481906e-5,2.229275950494211e-8,-0.001239213642370792,4.160681735016447e-5,2.2197568374873713e-8,-0.001238759622997134,4.153164993599383e-5,2.21606545642313e-8,-0.0012383277669794706,4.154532626799311e-5,2.217831390256571e-8,-0.0012379443945620973,4.163077699858882e-5,2.223941511624005e-8,-0.0012376284470835346,4.17613701854737e-5,2.2327028899360917e-8,-0.0012373896362990083,4.190335157601163e-5,2.2420000164546246e-8,-0.001237226498897373,4.201852746249583e-5,2.2494706995441768e-8,-0.0012371242703294284,4.2068080603654364e-5,2.2527507113518604e-8,-0.0012370533291036505,4.201858038815096e-5,2.249845761104157e-8,-0.001236970018387961,4.18506164139745e-5,2.239652980094868e-8,-0.0012368223070618539,4.1568658962976625e-5,2.2225481522563593e-8,-0.0012365619116138991,4.120801712255095e-5,2.2007914498811416e-8,-0.0012361611416612153,4.083280694899721e-5,2.1783828379414836e-8,-0.001235627714205694,4.052073423663693e-5,2.1601104914924004e-8,-0.0012350082702082678,4.0337708897671565e-5,2.149979267276202e-8,-0.0012343757042772982,4.031356310619789e-5,2.1497194944095898e-8,-0.0012338050721628741,4.043155020851939e-5,2.1581628688838263e-8,-0.001233349834870539,4.063630930677973e-5,2.1717708568439122e-8,-0.0012330286624901638,4.0854394434720134e-5,2.1859385815913868e-8,-0.001232825543872876,4.1016780529853954e-5,2.1964061307544442e-8,-0.0012326994687433222,4.1075328421856106e-5,2.20027389188401e-8,-0.001232597984556413,4.1010377237678075e-5,2.196447509602127e-8,-0.0012324701701386766,4.083038763729262e-5,2.1855784862297425e-8,-0.0012322765508626758,4.0566046838917725e-5,2.1696628675659008e-8,-0.0012319949600370919,4.026131873137667e-5,2.151464212796346e-8,-0.0012316222127142264,3.996359807215556e-5,2.1339009160521587e-8,-0.0012311720726316338,3.971485937041825e-5,2.1195127901571155e-8,-0.001230670573013148,3.954524762662862e-5,2.1100877649413684e-8,-0.0012301501032358588,3.946977464651513e-5,2.1064790494578928e-8,-0.0012296436170803153,3.9487963552311815e-5,2.108595595697376e-8,-0.0012291799191749856,3.958568949318732e-5,2.1155185653788322e-8,-0.0012287803742935324,3.973818698101526e-5,2.1256853700710867e-8,-0.001228456809047748,3.991337515449703e-5,2.1370956879184295e-8,-0.0012282101383242943,4.007518264093764e-5,2.1475236423481508e-8,-0.0012280293349605576,4.0187061533075706e-5,2.1547450730279715e-8,-0.0012278906587169442,4.0216265386799466e-5,2.1568075140606426e-8,-0.001227757733952711,4.0139660658889306e-5,2.152381649965794e-8,-0.001227584040852701,3.995131561109933e-5,2.141206714008766e-8,-0.0012273199557392438,3.9670437193476325e-5,2.1245481814044025e-8,-0.0012269256617048919,3.934568255249432e-5,2.1054357934419238e-8,-0.001226387988600605,3.9049849819512705e-5,2.088324803621528e-8,-0.0012257337792927004,3.886073981427376e-5,2.077925099285005e-8,-0.001225029176986983,3.8832259555441034e-5,2.0774438780732722e-8,-0.0012243597146831978,3.897014608672804e-5,2.087118383561181e-8,-0.001223799174185458,3.922790438935534e-5,2.1039910874573118e-8,-0.0012233842237546633,3.952612757691313e-5,2.123118242844517e-8,-0.001223107335217403,3.9782946538246464e-5,2.139456934167179e-8,-0.0012229273220081428,3.993907780657064e-5,2.1494114292522025e-8,-0.001222787747765819,3.996887325239496e-5,2.1515041468992588e-8,-0.0012226337779387417,3.987869845089384e-5,2.1462498186417195e-8,-0.0012224231672501788,3.9698352797038394e-5,2.135591073507243e-8,-0.001222131287192134,3.94706075535104e-5,2.1222223071618265e-8,-0.0012217517999359017,3.924165377627985e-5,2.1089871554669243e-8,-0.0012212945943425393,3.905340977839935e-5,2.0984126176207197e-8,-0.0012207820344604945,3.8937868022761935e-5,2.0923847255017387e-8,-0.0012202442110411317,3.891356765329418e-5,2.0919587003276005e-8,-0.0012197138193019857,3.898419985757117e-5,2.0972925719657997e-8,-0.0012192212575737466,3.913919956043711e-5,2.1076902982625034e-8,-0.0012187904880345962,3.9356035455342134e-5,2.1217396945348294e-8,-0.001218436045934365,3.960367962125383e-5,2.1375213106972125e-8,-0.00121816125440768,3.9846620466140236e-5,2.1528562534707792e-8,-0.0012179574526165029,4.004903399140244e-5,2.165570613461297e-8,-0.0012178040605647724,4.0179078031285165e-5,2.1737684879836926e-8,-0.001217669467291421,4.021348370120589e-5,2.1761144819940345e-8,-0.0012175131332450237,4.014272182328031e-5,2.1721351070588032e-8,-0.001217289990042325,3.997662689165655e-5,2.162532349147562e-8,-0.0012169585457825218,3.9749007528304005e-5,2.1494297600574853e-8,-0.0012164931847068905,3.9517836703297245e-5,2.136358703249228e-8,-0.0012158983378917096,3.9356329110915773e-5,2.1277115324960004e-8,-0.0012152176438466392,3.9332104759699913E-05,2.127493647531436e-8,-0.001214528479586985,3.947928991470707e-5,2.1376600643727462e-8,-0.0012139177363669367,3.9778311663362115e-5,2.1569180758206194e-8,-0.0012134484162272517,4.015900048914238e-5,2.180933946924029e-8,-0.0012131363021741985,4.052837642935356e-5,2.2040280902569133e-8,-0.0012129497831343294,4.080665261167639e-5,2.2213672818770073e-8,-0.0012128291159121656,4.095125233841926e-5,2.230428148992462e-8,-0.001212710628911282,4.096082546243361e-5,2.2312340353820234e-8,-0.0012125440419645064,4.0864936103992574e-5,2.2257017392004202e-8,-0.0012122998065612566,4.070927702557695e-5,2.2167052698862267e-8,-0.001211969092054254,4.054291261138361e-5,2.207270204179144e-8,-0.0012115601294701622,4.04096307802744e-5,2.2000393390250897e-8,-0.0012110935055385707,4.034290695442932e-5,2.1969806882960636e-8,-0.001210597514896922,4.0363263803066746e-5,2.1992540281281542e-8,-0.001210103734529621,4.047720018381726e-5,2.2071717239761007e-8,-0.0012096427900898502,4.0677387217859966e-5,2.22022573473533e-8,-0.0012092403935229314,4.094407090176532e-5,2.237175494917936e-8,-0.0012089138646246408,4.124773087837309e-5,2.2562054742508997e-8,-0.001208669509931094,4.155294488543246e-5,2.2751575294808985e-8,-0.0012085012343950414,4.1823087158483395e-5,2.2918206290301382e-8,-0.0012083905541689021,4.20253509279023e-5,2.304245225579731e-8,-0.0012083080279941285,4.213570362400274e-5,2.3110503419034456e-8,-0.0012082161114372763,4.2143459888724324e-5,2.3116949841108062e-8,-0.0012080735324706796,4.2055159230597596e-5,2.3066900585552403e-8,-0.001207841533426535,4.189723091537656e-5,2.297724001603263e-8,-0.0012074923383279116,4.171613868549196e-5,2.2876363669851336e-8,-0.001207019283053891,4.157362669411139e-5,2.2801120538061767e-8,-0.0012064459189305014,4.1534493783767346e-5,2.2789521758592166e-8,-0.0012058286024298984,4.164656524482071e-5,2.2869009240234377e-8,-0.0012052460554162017,4.19184087749905e-5,2.3043477200400544e-8,-0.0012047743940046401,4.2307229374438395e-5,2.3286316882609802e-8,-0.0012044572585227797,4.272895499439604e-5,2.3546579750409415e-8,-0.001204288381331058,4.308962693418823e-5,2.376779519103741e-8,-0.0012042176630236775,4.332107815521141e-5,2.390938507508682e-8,-0.0012041753802073372,4.340093341660907e-5,2.3958706867713977e-8,-0.00120409843142815,4.335014281596996e-5,2.3929491995290315e-8,-0.0012039461046134032,4.3216266495513626e-5,2.3851510393422998e-8,-0.0012037033879847602,4.305483536435831e-5,2.3758982441867673e-8,-0.001203376539335363,4.291599030590616e-5,2.368228317218689e-8,-0.00120298613557427,4.283755592078561e-5,2.364376268900528e-8,-0.00120256066507784,4.2842730196850536e-5,2.365655954004364e-8,-0.0012021315896690958,4.29401323049733e-5,2.3724918753893763e-8,-0.0012017295357681474,4.3124764351869256e-5,2.384500705422323e-8,-0.0012013810188355309,4.3379445958178134e-5,2.400589014719376e-8,-0.0012011053959982453,4.367684303151363e-5,2.4190760318183176e-8,-0.0012009120711434845,4.3982426851927915e-5,2.4378686124360526e-8,-0.001200798320179096,4.4258666524398955e-5,2.4547135559008024e-8,-0.0012007483813156155,4.447035815567847e-5,2.4675237441635286e-8,-0.0012007344048218429,4.45904789956841e-5,2.4747373111654414e-8,-0.0012007195396916456,4.4605667043112055E-05,2.475647427648304e-8,-0.0012006630679124704,4.4520319606676825e-5,2.4706349244549025e-8,-0.0012005271433299393,4.435834252862902e-5,2.4612444809990292e-8,-0.0012002844344340745,4.416178423355356e-5,2.450065938028214e-8,-0.0011999257549066937,4.39856842762662e-5,2.4403951995426074e-8,-0.0011994662184232547,4.3888471317910234e-5,2.435650342589999e-8,-0.001198947460842372,4.3917923813857226e-5,2.43855173915342e-8,-0.001198432684587654,4.409482178445086e-5,2.4501884310528832e-8,-0.0011979921332492878,4.43998509534339e-5,2.469284335350204e-8,-0.00119768078598594,4.4772044938470945e-5,2.492136091235081e-8,-0.0011975168459692923,4.512476493318901e-5,2.5135693210741254e-8,-0.00119747326559844,4.53756385533257e-5,2.528710231716238e-8,-0.0011974888649364393,4.547604253094459e-5,2.5347319618533324e-8,-0.0011974930862349044,4.542451975687877e-5,2.5316491092253453e-8,-0.0011974302262546881,4.525952548655604e-5,2.5218719541367353e-8,-0.0011972721728209824,4.5039793706352555e-5,2.509006550443868e-8,-0.0011970183063790395,4.48245155389913e-5,2.4966396418741908e-8,-0.001196687932279745,4.4660550904328974e-5,2.487559033145641e-8,-0.0011963111623788396,4.457738285834904e-5,2.4834604037411308e-8,-0.0011959215436754737,4.45871920184613e-5,2.4849769736576936e-8,-0.0011955511692190652,4.468712727908596e-5,2.4918432734679642e-8,-0.0011952275920148667,4.486193679281758e-5,2.5030717037665653e-8,-0.001194971551310585,4.508639373150898e-5,2.5171047327290172e-8,-0.001194794863314542,4.5327777567539424e-5,2.5319623085596163e-8,-0.001194698341899172,4.554901617532855e-5,2.5454274898017947e-8,-0.0011946701458042791,4.5713081220382614e-5,2.555310251854561e-8,-0.0011946854231435274,4.5788787339589856e-5,2.5597980508971714e-8,-0.0011947082714650892,4.575734391539159e-5,2.5578493326096783e-8,-0.0011946966519119835,4.561819225984636e-5,2.5495358009355167e-8,-0.0011946100335258174,4.539218001394653e-5,2.536213072497259e-8,-0.0011944184455051122,4.512031317912244e-5,2.5204163446924352e-8,-0.0011941107653257608,4.485734384224478e-5,2.5054453515492776e-8,-0.0011936999083235803,4.466088478508766e-5,2.4946937452023213e-8,-0.0011932230592092813,4.457796164782929e-5,2.4908499047797812e-8,-0.001192735881163747,4.463180004644925e-5,2.4951402925395812e-8,-0.0011923007264965835,4.481237616870531e-5,2.506816181625162e-8,-0.001191970530689217,4.507461064861558e-5,2.523093820360962e-8,-0.0011917724140860335,4.5347229185161454e-5,2.5397066980609755e-8,-0.0011916972032087528,4.5552150560644986e-5,2.552053976524705e-8,-0.0011917008223672682,4.5628853227269786e-5,2.55662585680403e-8,-0.001191718836140086,4.55536438037028e-5,2.5521241678494558e-8,-0.0011916882079971906,4.534483429463704e-5,2.5397506076360736e-8,-0.0011915661764232738,4.50523352358896e-5,2.52256885925892e-8,-0.0011913387387294007,4.47385355732246e-5,2.504346293478613e-8,-0.0011910180546011024,4.446011631860293e-5,2.4884567965759092e-8,-0.0011906333941084394,4.425692301702829e-5,2.4772196056940904e-8,-0.0011902211184680275,4.414860982271032e-5,2.4717178867113547e-8,-0.0011898169790774708,4.4136455261757274e-5,2.4719329452121577e-8,-0.0011894514485054754,4.420725000515381e-5,2.4769977404092045e-8,-0.0011891472970888017,4.43372203473938e-5,2.4854416724191735e-8,-0.0011889182539292847,4.449528806773453e-5,2.4953861754942293e-8,-0.0011887678749798924,4.464592966057503e-5,2.504712463555681e-8,-0.0011886883030289687,4.4752380198887884e-5,2.5112510632544797e-8,-0.0011886592771498138,4.478098874931083e-5,2.5130424449580425e-8,-0.0011886483992062577,4.4707117457076194e-5,2.5086889829383304e-8,-0.0011886140329250244,4.4522010180780784e-5,2.4977592415005244e-8,-0.0011885119078034235,4.4238713784012066e-5,2.4811273251672534e-8,-0.0011883051844906306,4.3894051675223444e-5,2.461069041472246e-8,-0.0011879756183442926,4.354386275480496e-5,2.4409531085824178e-8,-0.0011875317045031677,4.3250911754683235e-5,2.4244998266980886e-8,-0.001187009814984017,4.306830808202916e-5,2.4147865942933328e-8,-0.0011864667588603476,4.302388062774488e-5,2.4133330210664937e-8,-0.0011859656180111609,4.3111034611001064e-5,2.4195943412766552e-8,-0.0011855592107146609,4.328925296709795e-5,2.4310387221332328e-8,-0.0011852761111206852,4.349413359054941e-5,2.443782423047731e-8,-0.0011851131455521931,4.3654131747047644e-5,2.4535986395746288e-8,-0.0011850365116463047,4.370946428713365e-5,2.4570271546609728e-8,-0.0011849914632903148,4.362784368851426e-5,2.4522773768495008e-8,-0.001184917896100419,4.341215487751708e-5,2.43964861556252e-8,-0.0011847668283073867,4.3097519747167916e-5,2.4213256739576758e-8,-0.001184512183165127,4.273915270154866e-5,2.400637699709233e-8,-0.001184154359433377,4.239606712181469e-5,2.381082880477647e-8,-0.001183715829325232,4.211673537541401e-5,2.3654834718410355e-8,-0.001183232091457753,4.193072848064575e-5,2.355508585492585e-8,-0.001182742076052658,4.184692919527811e-5,2.351593181722576e-8,-0.001182280783554334,4.185637277082278e-5,2.3531280291149167e-8,-0.0011818749650736491,4.193705913158789e-5,2.3587563717348847e-8,-0.0011815412371566454,4.20587459208501e-5,2.3666591547139997e-8,-0.001181285518418681,4.218688550045602e-5,2.374784651401943e-8,-0.0011811028444095974,4.2285853886151184e-5,2.381037385561812e-8,-0.001180977123076948,4.232217251513254e-5,2.3834703066651765e-8,-0.0011808810539391222,4.2268560697046846e-5,2.3805269882627502e-8,-0.0011807771612472478,4.2109361969074505e-5,2.3713602572318883e-8,-0.0011806214602274067,4.1846957049957275e-5,2.356200196449372e-8,-0.0011803711677501327,4.150714518977967e-5,2.3366529209186637e-8,-0.0011799963986054275,4.113978509884284e-5,2.3157162420999488e-8,-0.0011794927933482826,4.08108363408142e-5,2.2972909369344754e-8,-0.0011788890049142986,4.058504354233647e-5,2.2851491515976213e-8,-0.0011782430294203484,4.050438512482597e-5,2.2816671906510717e-8,-0.0011776263052778516,4.0571991173592686e-5,2.2868981508891815e-8,-0.0011771016155169122,4.074982996867079e-5,2.2984703383283737e-8,-0.0011767044632477951,4.097122380197114e-5,2.3123630234264177e-8,-0.0011764349839248737,4.1161829736862925e-5,2.3241707139593455e-8,-0.0011762614801303043,4.1260299791107996e-5,2.330328303434297e-8,-0.0011761320404088328,4.1232336783918625e-5,2.328924297558214e-8,-0.0011759893133244327,4.1075838938516295e-5,2.3199711124094704e-8,-0.0011757842580515552,4.081779203779472e-5,2.3051819147004552e-8,-0.001175486057786376,4.050513963720658e-5,2.2873984543674025e-8,-0.0011750866908770193,4.0192525827399625e-5,2.2698514425147638e-8,-0.0011745998913217442,3.9930000443378806e-5,2.2554401861589946e-8,-0.0011740555181366963,3.975350915748105e-5,2.2461942074838184e-8,-0.0011734914447389271,3.967996159531561e-5,2.2430123462058758e-8,-0.001172945410878914,3.970705295686038e-5,2.245677720924922e-8,-0.0011724486794790487,3.981662159239835e-5,2.2530685939862905e-8,-0.0011720222605774908,3.997974255206267e-5,2.263458529327139e-8,-0.0011716754580197422,4.0161947727554296e-5,2.274816904236688e-8,-0.0011714059108263474,4.032766224367516e-5,2.285064391621753e-8,-0.0011712002787532773,4.044378850159482e-5,2.2922839703133115e-8,-0.001171035100466492,4.048293650443117e-5,2.2949153547451752e-8,-0.0011708778846540614,4.042697766162125e-5,2.2919658210313572e-8,-0.0011706891457959967,4.0271429475899425e-5,2.2832600750891778e-8,-0.001170426728995793,4.0030416719605716e-5,2.269711830719015e-8,-0.0011700538042031948,3.9740414742010276e-5,2.253517245414926e-8,-0.0011695506069301434,3.945916078722506e-5,2.2380689483545792e-8,-0.0011689268944945577,3.9255517922141815e-5,2.227353935744273e-8,-0.001168228173677312,3.918909798715985e-5,2.224769728531718e-8,-0.0011675279781217165,3.9285907063139966e-5,2.2317220439852915e-8,-0.0011669049542857158,3.952322670802093e-5,2.24676871654407e-8,-0.0011664145207980038,3.9834885125080155e-5,2.265953681114611e-8,-0.001166070295452867,4.013563731944959e-5,2.2842517129925196e-8,-0.0011658440641923867,4.035108613749354e-5,2.2973299450432576e-8,-0.0011656808972777184,4.043846993678506e-5,2.302764914878378e-8,-0.0011655191438936243,4.039246802510346e-5,2.300366653105076e-8,-0.0011653067613803536,4.023909875147127e-5,2.291788321046429e-8,-0.001165010689103841,4.002390781978695e-5,2.2797942341975254e-8,-0.0011646197556137458,3.979940906101893e-5,2.2674938420648966e-8,-0.0011641429633779334,3.961443280877213e-5,2.2577103601577477e-8,-0.0011636049134929856,3.950632417993853e-5,2.252541402741315e-8,-0.0011630396411959254,3.9496218494349576e-5,2.253115281543781e-8,-0.001162483900516477,3.95874667786907e-5,2.2595320378682432e-8,-0.0011619709327954436,3.976699600781008e-5,2.2709638135691125e-8,-0.0011615255979191684,4.000893838449559e-5,2.2858712233979922e-8,-0.0011611613858706039,4.0279582776409567e-5,2.3022849008527116e-8,-0.001160879376169587,4.054263299169933e-5,2.3181024514051384e-8,-0.0011606687592218374,4.076394687408465e-5,2.3313608208272293e-8,-0.0011605083240079387,4.09154288041749e-5,2.3404666156265128e-8,-0.00116036847554564,4.097823517679709e-5,2.34438834621506e-8,-0.0011602136824594566,4.0945659648512586e-5,2.3428227761797474e-8,-0.0011600057215318002,4.0826012397539306e-5,2.3363471925632195e-8,-0.0011597086232655231,4.0645264473458956e-5,2.326545539839303e-8,-0.0011592962457193116,4.0447999006798314e-5,2.3160337368834338e-8,-0.00115876229853727,4.0293821820255384e-5,2.3082332980724006e-8,-0.0011581301558147067,4.0245920350732926e-5,2.3067127381392428e-8,-0.0011574563121098651,4.035081622828792e-5,2.3140425634618856e-8,-0.0011568199270357543,4.061526212816023e-5,2.3304961265381497e-8,-0.0011562968471505665,4.099409631845051e-5,2.353376588241085e-8,-0.0011559290458727804,4.140161770840252e-5,2.3776854904296303e-8,-0.0011557078806939019,4.1744238983237644e-5,2.3980097768470524e-8,-0.0011555814912751524,4.195588110422897e-5,2.4105697188319998E-08,-0.001155479481195814,4.201658493401853e-5,2.4142985129680127e-8,-0.00115533863075793,4.194919447273282e-5,2.4106395513946268e-8,-0.0011551182129401877,4.1802901903976074e-5,2.4025610864818883e-8,-0.0011548035981328402,4.163510488935334e-5,2.3934641492285587e-8,-0.0011544024679921467,4.149790402491649e-5,2.3863731188845464e-8,-0.0011539381598193543,4.143037373269924e-5,2.3834886083816383e-8,-0.0011534428504190312,4.145529592249755e-5,2.3860242372633465e-8,-0.0011529515734318722,4.157867605802834e-5,2.3942156152824156e-8,-0.001152497126030711,4.17910018793201e-5,2.407424330087287e-8,-0.00115210581430915,4.2069853360416185e-5,2.4243037050196697e-8,-0.001151794185245135,4.238365328686831e-5,2.4430139497299415e-8,-0.0011515669930675036,4.269628302794372e-5,2.461478437537122e-8,-0.0011514166348674099,4.2972125399724006e-5,2.4776661433350763e-8,-0.0011513241096236361,4.318091082678523e-5,2.4898702175336794e-8,-0.0011512612721551612,4.330181717597658e-5,2.496949457208967e-8,-0.001151194039557355,4.332656629776271e-5,2.4985098203453446e-8,-0.0011510862887999457,4.326145348232724e-5,2.4950132422663092e-8,-0.0011509043845628019,4.312830423117919e-5,2.4878096818187747e-8,-0.0011506225888506414,4.296414251839801e-5,2.4790856099194497e-8,-0.0011502295873348479,4.281860836006933e-5,2.4716871495239724e-8,-0.0011497354598191344,4.27473669523015e-5,2.4687324428481763e-8,-0.0011491767132249047,4.27998987093043e-5,2.4729297172923822e-8,-0.0011486149745644995,4.300208635109734e-5,2.4856210146960896e-8,-0.0011481242788471762,4.333890754543513e-5,2.505836780419132e-8,-0.0011477663805973333,4.37484335258334e-5,2.529978271595454e-8,-0.0011475638693054652,4.413754488074797e-5,2.552713565537854e-8,-0.0011474880690233208,4.441675095791563e-5,2.5689536506059154e-8,-0.0011474716437174161,4.4535329714636256e-5,2.5758576446798924e-8,-0.0011474381423005444,4.4496153607781065e-5,2.573686319342581e-8,-0.0011473298248947472,4.434525522139947e-5,2.5651963688180006e-8,-0.0011471206519927625,4.4148021131686344e-5,2.5542431090685233e-8,-0.0011468143867924144,4.396712744434881e-5,2.5444745012451112e-8,-0.001146435178096694,4.384958556407789e-5,2.538566338712817e-8,-0.0011460173053052653,4.382244135856911e-5,2.537984964690841e-8,-0.0011455972066733823,4.389369052636168e-5,2.543072424927479e-8,-0.001145208205189756,4.4055310810386594e-5,2.553258147049571e-8,-0.0011448771116926027,4.4286732802865605e-5,2.5672846892049696e-8,-0.001144621838537778,4.455834866317327e-5,2.5834176207532318e-8,-0.0011444496596464482,4.483524010238264e-5,2.5996533958276677e-8,-0.0011443561757723407,4.508136367107901e-5,2.6139484084071172e-8,-0.001144325302176957,4.526422796836885e-5,2.624479996609313e-8,-0.0011443306796744088,4.5359678801102835e-5,2.629920696942144e-8,-0.001144338684074093,4.535607232962796e-5,2.6296805202445227e-8,-0.0011443128443530714,4.525711697688811e-5,2.6240674007741413e-8,-0.0011442192204715602,4.5082805045375516e-5,2.6143256225398415e-8,-0.0011440321422607781,4.4868033997148654e-5,2.6025290536327584e-8,-0.0011437397009143968,4.465876200865301e-5,2.5913293776335838e-8,-0.0011433483936894827,4.450556201387472e-5,2.5835666573269417e-8,-0.0011428859132346458,4.4454301330230345e-5,2.5817407374967364e-8,-0.0011424002463549068,4.4534205124580296e-5,2.587362598157788e-8,-0.0011419527122034946,4.474530750720313e-5,2.600289980431649e-8,-0.0011416033368196802,4.505002810376823e-5,2.618294554588382e-8,-0.001141390428908636,4.5375931822066494e-5,2.6372385764556846e-8,-0.0011413123883100827,4.5634818511907473e-5,2.6521473534591453e-8,-0.001141323589395823,4.5754058078499044e-5,2.6589641295518906e-8,-0.0011413505127724332,4.570482861131677e-5,2.65614039044391e-8,-0.0011413207093381398,4.5510745451041515e-5,2.6451239643199213e-8,-0.001141188094617734,4.523323032317512e-5,2.6295158823665544e-8,-0.0011409425267060696,4.494512245552072e-5,2.613539055975473e-8,-0.0011406039242835295,4.470782444666231e-5,2.6007055239340012e-8,-0.001140209199720666,4.455976514490526e-5,2.5931497221064563e-8,-0.0011397998215520568,4.451513360626569e-5,2.591575701768682e-8,-0.001139413450043509,4.456814837601221e-5,2.595536246540539e-8,-0.0011390795966643849,4.469876670368622e-5,2.60379203690528e-8,-0.0011388178217883774,4.487777100093782e-5,2.614620234117578e-8,-0.001138637029323737,4.507087406977781e-5,2.6260499784491232e-8,-0.0011385351171898522,4.524231213375679e-5,2.636058011508952e-8,-0.001138498908997064,4.5358536475447353e-5,2.6427687830903223e-8,-0.001138504742717813,4.539239795883406e-5,2.6446876610957435e-8,-0.0011385203577618363,4.5327686077719404e-5,2.6409596426616204e-8,-0.001138508626476679,4.5163215308385346e-5,2.6316020938140107e-8,-0.001138433164520453,4.491524922861346e-5,2.617635271007851e-8,-0.0011382651611644248,4.461705208805853e-5,2.60103768433134e-8,-0.0011379901212315725,4.431475914112068e-5,2.5844832363761734e-8,-0.0011376128472153897,4.405962607495448e-5,2.5708742448517676e-8,-0.0011371591432191399,4.38977377850055e-5,2.5627459120037902e-8,-0.0011366732292220137,4.385892899825392e-5,2.561652405049774e-8,-0.0011362103950232623,4.394710877414942e-5,2.5676581411835278e-8,-0.0011358251542952108,4.413475261191414e-5,2.5790765942044402e-8,-0.0011355565320898134,4.436471443508226e-5,2.5926126309661128e-8,-0.0011354142388612493,4.456177182242592e-5,2.6040272006294392e-8,-0.0011353715564004837,4.4653360616528623e-5,2.6092925147649926e-8,-0.0011353705510015804,4.459362909579968e-5,2.605922322764486e-8,-0.0011353404038372476,4.4380227560943225e-5,2.5938971302698022e-8,-0.0011352217466509087,4.405454262243014e-5,2.5756616732937143e-8,-0.0011349852948189293,4.368490247039827e-5,2.5551578991552723e-8,-0.0011346366674042077,4.334216194977203e-5,2.5364227495662016e-8,-0.001134208126523297,4.307971922662928e-5,2.5224447033233243e-8,-0.0011337443916172296,4.292448780803408e-5,2.5146609857361533e-8,-0.0011332897864486306,4.287791196077834e-5,2.5130427988720302e-8,-0.0011328801743606684,4.292232941936807e-5,2.5164886702881576e-8,-0.0011325395437544183,4.302832693352377e-5,2.5232645329543546e-8,-0.0011322795036267984,4.316082969546979e-5,2.5313558114926845e-8,-0.0011320999644248192,4.328354167402069e-5,2.538712994851353e-8,-0.0011319900022255828,4.336233306022805e-5,2.5434328063291953e-8,-0.0011319286947636842,4.336840808418778e-5,2.5439298179225213e-8,-0.0011318863330729578,4.328188187579225e-5,2.5391365668682646e-8,-0.001131826798984989,4.309582777844892e-5,2.5287327028303578e-8,-0.0011317119237820342,4.282000536402383e-5,2.513352362103692e-8,-0.0011315081184450266,4.248267021715128e-5,2.4946745756693704e-8,-0.0011311944679122136,4.212855215251888e-5,2.47528810798855e-8,-0.001130770145740669,4.181171313272162e-5,2.458263730132284e-8,-0.0011302581872849279,4.158375073838242e-5,2.446470685820663e-8,-0.0011297031604086858,4.1480108144529596e-5,2.4418045723061402e-8,-0.001129162188693781,4.15087736209508e-5,2.4445738038119535e-8,-0.001128691235841923,4.164541695493883e-5,2.453267453652789e-8,-0.0011283303644603515,4.1837167858544846e-5,2.464812593336712e-8,-0.0011280922029762194,4.201470996660632e-5,2.4752841228200912e-8,-0.0011279572033331556,4.2109977185660934e-5,2.480903447905591e-8,-0.0011278777807429035,4.2074869072542864e-5,2.4790706388729773e-8,-0.0011277911058960631,4.189530837193729e-5,2.4691226160505966e-8,-0.0011276372138476932,4.15954194176583e-5,2.4525357679971217e-8,-0.0011273763094417542,4.1229584247699144e-5,2.4324526909304625e-8,-0.0011269987883137111,4.0865150594873515e-5,2.4126913313744505e-8,-0.0011265246487921932,4.056282496645149e-5,2.396636013648397e-8,-0.0011259939870450367,4.0362229990203176e-5,2.3864352719984643e-8,-0.0011254538280006646,4.027651035222083e-5,2.3827236887481313e-8,-0.0011249466443459084,4.029509964658356e-5,2.3848081936514294e-8,-0.0011245033782163948,4.0390924133027086e-5,2.3910968573532058e-8,-0.0011241409403492657,4.052829514471608e-5,2.3995517170635476e-8,-0.00112386263638038,4.066934213518109e-5,2.4080458369857855e-8,-0.001123659844043524,4.077852227744454e-5,2.4146059818045725e-8,-0.0011235138537491161,4.082575535334954e-5,2.417579891950277e-8,-0.0011233975399612892,4.078906093563617e-5,2.4157813543967808e-8,-0.0011232772130354719,4.065741806846923e-5,2.4086515680471002e-8,-0.0011231154772805123,4.043402590037051e-5,2.3964410167377178e-8,-0.0011228760409062776,4.0139252991621545e-5,2.380366568263808e-8,-0.0011225309508780508,3.9811507466245704e-5,2.362643573893063e-8,-0.0011220694021852218,3.9503593998477884e-5,2.3462607402847364e-8,-0.0011215052868612503,3.927276808058977e-5,2.334405693151438e-8,-0.0011208791815421717,3.916532907922445e-5,2.32959719470691e-8,-0.0011202512996662164,3.9200465609938846e-5,2.332793726446843e-8,-0.001119685750452599,3.936055511280073e-5,2.3428801926640012e-8,-0.0011192313624241938,3.959351310628623e-5,2.3568365483427852e-8,-0.0011189067970222813,3.982728786145331e-5,2.370580293829856e-8,-0.0011186957125675833,3.9990849821071303e-5,2.380156013682102e-8,-0.0011185529359586416,4.003380335406222e-5,2.382827657042045e-8,-0.0011184183604654927,3.9938559297950844e-5,2.3777363910180102e-8,-0.0011182335261142832,3.972257873820071e-5,2.365991178424167e-8,-0.0011179561348970367,3.943138742499119e-5,2.3502406776038373e-8,-0.0011175690250342211,3.9125231705559594e-5,2.333898219278873e-8,-0.0011170818909624026,3.8863484851492184e-5,2.3202592856615218e-8,-0.0011165261146400343,3.869113689297805e-5,2.3117576365828163e-8,-0.0011159450191786187,3.863070018781825e-5,2.309541688994295e-8,-0.001115382950846316,3.8680782729081375e-5,2.3134291481037248e-8,-0.0011148763323054643,3.88202433349568e-5,2.3221657136516122e-8,-0.0011144484116093652,3.9015366788503146e-5,2.333836405534532e-8,-0.0011141077300649053,3.922741200952648e-5,2.3462821981382622e-8,-0.0011138492060015412,3.941880989590515e-5,2.357433208540127e-8,-0.0011136564631223104,3.955748183796071e-5,2.3655382121537695e-8,-0.001113504398766395,3.961966181875024e-5,2.3693174947865333e-8,-0.0011133616119702572,3.9591985478981636e-5,2.3680806672121074e-8,-0.0011131929173312004,3.9473502927766754e-5,2.3618399758240768e-8,-0.001112962646214551,3.927781992830418e-5,2.3514237054040706e-8,-0.0011126396430199091,3.903476453581059e-5,2.338553477815076e-8,-0.0011122044622860591,3.878987372235069e-5,2.325794563447264e-8,-0.0011116579050496058,3.859916050478475e-5,2.3162471082326266e-8,-0.0011110277638066819,3.8517161490373446e-5,2.3128770665243614e-8,-0.0011103686318442126,3.857932217863279e-5,2.317550345585091e-8,-0.0011097504345893342,3.878498007287958e-5,2.3301147042226735e-8,-0.0011092368658773112,3.909083067031221e-5,2.348067606937274e-8,-0.001108862561025627,3.9421677057301995e-5,2.3671766690779e-8,-0.0011086207894536008,3.969541345367182e-5,2.3828789988108746e-8,-0.001108467784835197,3.9850203582443234e-5,2.3917930158623212e-8,-0.0011083400223898265,3.986149013467848e-5,2.3926558339224554e-8,-0.0011081749835332257,3.9744019406875444e-5,2.3864144977322292e-8,-0.0011079272311021648,3.954206227866765e-5,2.3756473773474773e-8,-0.0011075764036130426,3.9314276041815806e-5,2.3636846724881514e-8,-0.0011071276513506274,3.911872082508301e-5,2.353751460723729e-8,-0.001106606712234522,3.9001210256697606e-5,2.3483218868648787e-8,-0.0011060519911277476,3.8988244203939216e-5,2.3487531140898155e-8,-0.001105505670300844,3.908468395961993e-5,2.3551953376769463e-8,-0.001105005565791467,3.927568764132802e-5,2.3667339954019526e-8,-0.0011045790708096976,3.9531788880221474e-5,2.3816896490402398e-8,-0.0011042398847317478,3.9815546406795756e-5,2.397985579796228e-8,-0.0011039874767033147,4.008822786866677e-5,2.413504494817365e-8,-0.0011038086569949937,4.031539899273079e-5,2.4263827315283715e-8,-0.0011036803427045844,4.047087645509333e-5,2.4352204679952328e-8,-0.0011035726966564098,4.053916604625667e-5,2.4392162684179795e-8,-0.0011034522434320714,4.051692930416066e-5,2.438250815301555e-8,-0.0011032850399023103,4.041397991610771e-5,2.4329393420554233e-8,-0.0011030403485004744,4.0253960514007384e-5,2.424655679752155e-8,-0.001102695483905325,4.0074227905403326e-5,2.415503580398189e-8,-0.001102242193580227,3.992352368685253e-5,2.4081660659305638e-8,-0.0011016936673696796,3.985525563697915e-5,2.4055253488353385e-8,-0.0011010891641663526,3.991473667135059e-5,2.409971221190807e-8,-0.0011004912378463276,4.012168328025906e-5,2.422468321626409e-8,-0.0010999711538006204,4.045477360482803e-5,2.4417430252093232e-8,-0.0010995842055226655,4.084938248726866e-5,2.4641830821643385e-8,-0.0010993460929871167,4.121581701041971e-5,2.484844677700392e-8,-0.0010992250658169746,4.1472215284716905e-5,2.4992557013455944e-8,-0.0010991556460179283,4.1574464276116506e-5,2.505058969589844e-8,-0.0010990652089385281,4.1527398961356164e-5,2.5026265284520233e-8,-0.001098898156768374,4.1375312448001e-5,2.4945200752454744e-8,-0.0010986280334354423,4.118167475058328e-5,2.484337320183111e-8,-0.0010982574815838655,4.100937470290851e-5,2.4755843824772127e-8,-0.0010978110406426043,4.090738485072404e-5,2.4709226856153248e-8,-0.0010973257121964122,4.0904499228446404e-5,2.471836767874099e-8,-0.0010968421791160742,4.10083665738254e-5,2.4786177550209052e-8,-0.0010963977347210852,4.120779805968306e-5,2.4905329142025246e-8,-0.0010960210677344888,4.147702335351955e-5,2.506090255556026e-8,-0.0010957289251758702,4.178110279291195e-5,2.5233456325869303e-8,-0.001095524697387541,4.2081778366454555e-5,2.540215364575196e-8,-0.0010953988246681838,4.2343079153780506e-5,2.5547670181248777e-8,-0.0010953307583887954,4.253610901231246e-5,2.5654681311269465e-8,-0.0010952920447938042,4.264254236325311e-5,2.571372890267199e-8,-0.0010952499739452775,4.2656633559821643e-5,2.5722338660353446e-8,-0.0010951713587064734,4.2585944785351156e-5,2.5685421940828945e-8,-0.0010950263137780906,4.245110365085979e-5,2.5615053368196092e-8,-0.001094792159453469,4.2284683294743016e-5,2.5529653777638224e-8,-0.0010944577225138132,4.212890345796607e-5,2.5452477208888395e-8,-0.0010940280855575993,4.2031223829935575e-5,2.5409021613321293e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json
new file mode 100644
index 0000000..3a71254
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":5000,"numberOfSamples":1000,"samples":[-0.001093528836966317,4.203642676149489e-5,2.5422725793163846e-8,-0.0010930072646208094,4.217440867148639e-5,2.5508574660559997e-8,-0.0010925265640548522,4.2445448281040656e-5,2.566549440168746e-8,-0.0010921498584701538,4.280927315836898e-5,2.5870776828536737e-8,-0.0010919163003251823,4.318794211770871e-5,2.6081780444674054e-8,-0.001091820523294629,4.348883154959585e-5,2.624831762871915e-8,-0.00109181029138295,4.364045659227296e-5,2.6331989440280285e-8,-0.0010918072934319603,4.362110831307491e-5,2.6321766949888615e-8,-0.0010917391971531742,4.346321105608486e-5,2.6236404835428295e-8,-0.0010915640090047574,4.323393624900339e-5,2.611370862534541e-8,-0.0010912766199280236,4.3007345034387695e-5,2.599493426705449e-8,-0.0010909009016498547,4.284299979150903e-5,2.5912727223068096e-8,-0.001090476431342811,4.277625215835485e-5,2.5885719367964947e-8,-0.0010900465218413144,4.2817753215300766e-5,2.5918503099339365e-8,-0.0010896499951765957,4.2957752709860237e-5,2.6004412180594708e-8,-0.0010893164869373976,4.3171842376795946e-5,2.612906955898042e-8,-0.0010890641035068592,4.34265580743787e-5,2.6273675178051805e-8,-0.0010888984776027527,4.3684563677071033e-5,2.6417842719480934e-8,-0.0010888129019089097,4.3909513777838174e-5,2.65421057988998e-8,-0.0010887895341848287,4.407054827337014e-5,2.663018859077577e-8,-0.0010888016920848876,4.4146217427231046e-5,2.667102788931276e-8,-0.001088817192482838,4.4127450376416946e-5,2.6660363442769395e-8,-0.0010888024752733671,4.401909753500576e-5,2.6601590837686793e-8,-0.0010887270459753056,4.383981898364833e-5,2.65056658451493e-8,-0.0010885677996571497,4.362036647066958e-5,2.639002532249307e-8,-0.0010883129235325867,4.3400346577718806e-5,2.627658759927833e-8,-0.0010879651578661836,4.322346930498476e-5,2.6188934255361087e-8,-0.001087544097987234,4.313109216854214e-5,2.6148709458164907e-8,-0.001087086674855694,4.315374123594729e-5,2.617116796712862e-8,-0.001086644066498112,4.330094126455337e-5,2.6260046435218025e-8,-0.0010862728381159504,4.3551620609182124e-5,2.640284239026193e-8,-0.00108601928226965,4.38502022017017e-5,2.656903579292576e-8,-0.0010859001135970722,4.411523709589743e-5,2.6714781887700585e-8,-0.0010858889754997796,4.426383145393484e-5,2.6795876138844725e-8,-0.0010859203351680025,4.424423453619814e-5,2.6785128110422738e-8,-0.001085913618912209,4.4058578601592776e-5,2.668460538734044e-8,-0.001085805393800295,4.376072785978275e-5,2.6524487039470494e-8,-0.0010855708545136362,4.343117507166159e-5,2.6349304657863846e-8,-0.0010852250584937636,4.314592290426317e-5,2.620071963961655e-8,-0.0010848090868554553,4.295570916633156e-5,2.6105975798650347e-8,-0.001084372654611788,4.2880291469861494e-5,2.6074830737518084e-8,-0.0010839610398885847,4.291308032542563e-5,2.6102403255115617e-8,-0.0010836081790852113,4.302959653013973e-5,2.6174200961517643e-8,-0.0010833344520610171,4.3195574161869046e-5,2.6270850944433867e-8,-0.001083146945167361,4.3373198164366636e-5,2.637160337223827e-8,-0.0010830405767407777,4.352569954505452e-5,2.645674242392391e-8,-0.0010829995124754573,4.3621083270509026e-5,2.6509425138913995e-8,-0.001082998991414148,4.363548696163819e-5,2.6517334874121295e-8,-0.0010830078695757855,4.3556232067080865e-5,2.6474252100274967e-8,-0.0010829921546684827,4.338421730365343e-5,2.638134536379059e-8,-0.0010829195457739626,4.313495597945831e-5,2.6247737743075178e-8,-0.0010827645199852117,4.2837568459182473e-5,2.6089894868217516e-8,-0.0010825131481838203,4.2531405839397756e-5,2.5929625306960433e-8,-0.0010821667257754604,4.2260415291339646e-5,2.5790800121408916e-8,-0.001081743391863589,4.2065789758412284e-5,2.5695202717475755e-8,-0.0010812771260442285,4.197779093233889e-5,2.5658116797976546e-8,-0.00108081368235774,4.2007788209395396e-5,2.5684279138019833e-8,-0.0010804030553122393,4.214188129809646e-5,2.5764875776401685e-8,-0.0010800884167244415,4.2338329128859495e-5,2.5876603076949472e-8,-0.001079892778156456,4.2531881372048156e-5,2.598424858567189e-8,-0.001079807154698478,4.264767562282009e-5,2.6048107274120274e-8,-0.0010797867060579334,4.262394191909685e-5,2.6035904077434437e-8,-0.001079760973783162,4.243610779021697e-5,2.593546226975552e-8,-0.0010796577282035234,4.210950720238184e-5,2.5761387251077892e-8,-0.00107942993302375,4.171117273294466e-5,2.555057096694696e-8,-0.001079071274203828,4.132383281774707e-5,2.5348037433669575e-8,-0.001078613065447523,4.101676275871758e-5,2.5191031444188244e-8,-0.0010781076445001167,4.082789625905243e-5,2.509930154443339e-8,-0.0010776094725232313,4.076147500814069e-5,2.507401361434535e-8,-0.0010771620659250866,4.079616385676292e-5,2.5102488709573008e-8,-0.001076792527426751,4.089624684549766e-5,2.5164595184415124e-8,-0.001076511483357941,4.102115014348993e-5,2.523807558214155e-8,-0.001076315486299618,4.1131846253385905e-5,2.530198861820359e-8,-0.00107618985214185,4.1194730844247526e-5,2.533864785318205e-8,-0.0010761111699562399,4.118418519494565e-5,2.5334821170315685e-8,-0.0010760496321073894,4.1084740905426734e-5,2.5282775112651636e-8,-0.0010759717151872302,4.089317638698599e-5,2.5181368331821842e-8,-0.0010758437806077928,4.062025720268964e-5,2.5037000465379675e-8,-0.001075636874965737,4.029124488214523e-5,2.4863872287821255e-8,-0.001075332344175619,3.994403311673042e-5,2.4682887122784044e-8,-0.0010749270772761371,3.962409533524119e-5,2.4518755050929554e-8,-0.0010744366625150808,3.937631781230898e-5,2.439541151761965e-8,-0.0010738948032005251,3.92350369958662e-5,2.433057466908826e-8,-0.0010733481764564313,3.9214698025557454e-5,2.433083409288902e-8,-0.0010728472503692334,3.930384295442124e-5,2.4388737863373705e-8,-0.0010724347731497891,3.94645175457536e-5,2.44828950313044e-8,-0.0010721343835682733,3.9638151634969455e-5,2.458148402653822e-8,-0.001071942205574794,3.9757775235519326e-5,2.4648932372444277e-8,-0.001071824440490328,3.976485588304506e-5,2.4654800605721794e-8,-0.0010717234455627444,3.962693202706781e-5,2.4582909766611626e-8,-0.0010715727554048086,3.935008138551149e-5,2.4437676459267312e-8,-0.0010713175244551965,3.8979848282591754e-5,2.4244352737564492e-8,-0.0010709326265880106,3.858785169979547e-5,2.4041693976913273e-8,-0.0010704300073954966,3.8248525783302696e-5,2.386941805332488e-8,-0.0010698520086136918,3.801636200014798e-5,2.375603419291011e-8,-0.0010692550526086402,3.791333074165718e-5,2.371227592816189e-8,-0.0010686922574283954,3.792939556885814e-5,2.3731673323543086e-8,-0.0010682017404291997,3.80320722103819e-5,2.379598347049132e-8,-0.0010678024504110503,3.8178531959137147e-5,2.3881867002065674e-8,-0.001067495548138812,3.832556322890049e-5,2.3966240581430207e-8,-0.001067268273277274,3.843582509864842e-5,2.4029501058277472e-8,-0.0010670980487706369,3.848102746680633e-5,2.4057051807740725e-8,-0.0010669558863532884,3.844342728250387e-5,2.4039967070581163e-8,-0.001066809160826231,3.8316803241082525e-5,2.3975457859135465e-8,-0.0010666243579828204,3.810746586828673e-5,2.386741669396789e-8,-0.0010663705574710293,3.7835149903862285e-5,2.3726898442079206e-8,-0.0010660241691441985,3.753288897009294e-5,2.3571997852970833e-8,-0.0010655747063436035,3.724442359481839e-5,2.3426335194630528e-8,-0.0010650302250668731,3.701779702157739e-5,2.331547794071486e-8,-0.0010644199291991467,3.68949742785659e-5,2.3261297539301097e-8,-0.001063791223981958,3.6899545236002384e-5,2.327544760228617e-8,-0.0010632000453968727,3.7026820203446666e-5,2.335429289972638e-8,-0.0010626963599818942,3.7241111127013385e-5,2.3477789197827204e-8,-0.0010623095681190381,3.748268981872828e-5,2.3613519575245354e-8,-0.0010620391726174265,3.768289862153553e-5,2.3724946388273585e-8,-0.0010618540779868658,3.7782581455481364e-5,2.3781234371721873e-8,-0.0010617006609737272,3.7748061352030124e-5,2.3765573920194672e-8,-0.0010615170480434892,3.758012724746697e-5,2.367965267011593e-8,-0.0010612495768359004,3.731371428715724e-5,2.3543130785882002e-8,-0.0010608669746345562,3.700835235428079e-5,2.3388256328231037e-8,-0.001060368182069979,3.6731912216637085e-5,2.325105313533104e-8,-0.0010597813426304625,3.654245594481344e-5,2.316169727120985e-8,-0.0010591544075762823,3.647402066316346e-5,2.313718174627855e-8,-0.0010585410167500333,3.653074230958909e-5,2.317853751683003e-8,-0.001057986920975386,3.669012758790272e-5,2.327290785733631e-8,-0.0010575211579176061,3.691257472653399e-5,2.339881300069309e-8,-0.001057153350837812,3.715260399430297e-5,2.3532138314401993e-8,-0.0010568758374386459,3.736812754225494e-5,2.365093104713143e-8,-0.0010566681914793606,3.752620921432137e-5,2.3738273286109503e-8,-0.0010565020401735535,3.760563844652094e-5,2.378349597906288e-8,-0.0010563451015339039,3.759754719033252e-5,2.3782437194464704e-8,-0.0010561643423562313,3.750528822528541e-5,2.3737377447389552e-8,-0.001055928777775758,3.734426906295574e-5,2.365696343832137e-8,-0.0010556126783150875,3.714173971895337e-5,2.3556054900511646e-8,-0.0010551998123746519,3.693577609363618e-5,2.3455071168099988e-8,-0.0010546886977346502,3.677200754758798e-5,2.3378106802298378e-8,-0.001054097575413405,3.66964742503015e-5,2.33490503669857e-8,-0.001053466266416154,3.674410830929957e-5,2.338552532428398e-8,-0.0010528513171096396,3.6925144473778674e-5,2.3491902560416617e-8,-0.0010523125721679219,3.721530665965493e-5,2.365441113669717e-8,-0.0010518941136466624,3.7556866487537555e-5,2.384196911473466e-8,-0.001051607652331739,3.787365765176419e-5,2.4014260649323585e-8,-0.0010514271013640408,3.809514403546298e-5,2.4134458275138142e-8,-0.001051297410707953,3.8178799703989044e-5,2.4180962088243847e-8,-0.001051153003686843,3.812136015142763e-5,2.415318391268279e-8,-0.00105093733776516,3.795628189484318e-5,2.4069945427589834e-8,-0.001050616809646753,3.7741095264425834e-5,2.396246019827039e-8,-0.0010501863481547247,3.754067586859115e-5,2.3865199592522806e-8,-0.0010496673073456411,3.7411575394765774e-5,2.380750812194908e-8,-0.0010490998191358019,3.739064048823195e-5,2.380774834712807e-8,-0.0010485322021737509,3.748944550858809e-5,2.38707245777141e-8,-0.0010480100257824426,3.769477583367159e-5,2.398835336975793e-8,-0.0010475672083879396,3.797425178348991e-5,2.4142928600404912e-8,-0.0010472208647171518,3.8285082197056416e-5,2.4311824887822292e-8,-0.0010469704046910332,3.858335909600687e-5,2.4472287017073512e-8,-0.0010468001087383734,3.883168894481607e-5,2.4605240478689e-8,-0.0010466836675630368,3.900401645641016e-5,2.469763622155349e-8,-0.0010465891449321784,3.9087623690885925e-5,2.4743396088065535e-8,-0.00104648333056439,3.908308679776768e-5,2.4743374271449885e-8,-0.0010463351903678341,3.900321589613522e-5,2.4704818833201865e-8,-0.0010461187174899236,3.887169112109677e-5,2.4640634398441143e-8,-0.0010458157657489216,3.872153411276594e-5,2.456847676636226e-8,-0.0010454194198092652,3.8592904649491364e-5,2.4509434847279802e-8,-0.0010449379598351336,3.85290470767447e-5,2.4485769249212857e-8,-0.0010443983417922637,3.8568960460999586e-5,2.4517067123617403e-8,-0.0010438466104127784,3.8736263817727636e-5,2.4614598497805885e-8,-0.0010433416549984493,3.902636136480175e-5,2.477493404220497e-8,-0.0010429399987465788,3.9398027050649106e-5,2.4975871277955936e-8,-0.0010426746362297934,3.9777843434769186e-5,2.5178904654138547e-8,-0.0010425380922074639,4.0081503788804406e-5,2.5340291710930592e-8,-0.0010424814444555638,4.0244644241275436e-5,2.5427023133151833e-8,-0.0010424322947735387,4.024690202392131e-5,2.5429321392407133e-8,-0.0010423219582340482,4.01162830340403e-5,2.5362869290134385e-8,-0.0010421073140257824,3.9914219183457514e-5,2.526080398688154e-8,-0.0010417790504298643,3.9712303792083824e-5,2.5161204349048078e-8,-0.001041357514815806,3.957206053756882e-5,2.509620077309175e-8,-0.0010408820867983744,3.953305791576254e-5,2.5085701841939114e-8,-0.0010403994183290342,3.960922925354849e-5,2.5135719972456448e-8,-0.001039953473752625,3.979097235888994e-5,2.5239903766051643e-8,-0.0010395783534878653,4.005056096735985e-5,2.538278306056733e-8,-0.0010392939602767437,4.034918264408066e-5,2.5543680164653243e-8,-0.001039104389012981,4.0644480901831106e-5,2.5700644896490313e-8,-0.0010389988421567525,4.089757785496551e-5,2.5833941072896978e-8,-0.0010389545970551956,4.107865514075927e-5,2.5928726316951552e-8,-0.0010389412824983889,4.11705030871186e-5,2.5976731161695342e-8,-0.001038925600905446,4.116986580467381e-5,2.5976894786312716e-8,-0.0010388757116827172,4.108687415422475e-5,2.5935077860987764e-8,-0.0010387648487817887,4.094320887370908e-5,2.586310945168862e-8,-0.0010385741873378635,4.0769583233729096e-5,2.5777407288912374e-8,-0.0010382952268426782,4.0602784133407614e-5,2.569728649515853e-8,-0.0010379320091739295,4.04820837611387e-5,2.564292327050562e-8,-0.0010375031926033312,4.0444330838904017e-5,2.56327270085341e-8,-0.0010370431136598767,4.0516825192555824e-5,2.5679750881275533e-8,-0.0010365998252919112,4.07078727032145e-5,2.5787103029239512e-8,-0.0010362274507746704,4.0997023108730364e-5,2.59432896351184e-8,-0.0010359711779905647,4.133023718538513e-5,2.6120005918730713e-8,-0.0010358476721283505,4.1627586877103866e-5,2.6276137158887212e-8,-0.0010358308191826967,4.180745449119192e-5,2.6370052259346927e-8,-0.0010358552027499252,4.18193769451226e-5,2.6376375102413223e-8,-0.0010358403135057738,4.166678727036104e-5,2.6297719124715485e-8,-0.0010357228189093813,4.140456572009227e-5,2.6163449539399887e-8,-0.0010354780401623975,4.111391003936417e-5,2.6016503918615263e-8,-0.0010351214402610947,4.0871490524131414e-5,2.5897043112633257e-8,-0.0010346952781462417,4.0728626709958974e-5,2.5831362930703574e-8,-0.0010342513894169626,4.070496768499591e-5,2.582864079884688e-8,-0.0010338376130666347,4.0792468598692156e-5,2.588333975697396e-8,-0.001033489928572441,4.09637112677769e-5,2.5979990127741127e-8,-0.0010332292836012598,4.118057987218832e-5,2.6098059615421084e-8,-0.0010330613284611158,4.140165888760393e-5,2.6215931638488723e-8,-0.0010329777530100068,4.158819846524718e-5,2.631390656871405e-8,-0.0010329586810779521,4.170886241656704e-5,2.6376437158564403e-8,-0.001032975936317296,4.1743274993385874e-5,2.6393736765147437e-8,-0.0010329969885598913,4.168421213030391e-5,2.636277559384442e-8,-0.0010329892783965391,4.153821954893292e-5,2.62875676595281e-8,-0.0010329244588995863,4.132454750884092e-5,2.6178635261370543e-8,-0.001032782060381272,4.10726094101633e-5,2.6051674387741775e-8,-0.0010325522769319654,4.0818357819433007e-5,2.5925576579428118e-8,-0.0010322377709549141,4.0599882712942876e-5,2.5819988038191913e-8,-0.0010318544785740738,4.045240035953763e-5,2.575258468299546e-8,-0.001031431325710975,4.0402610592020545e-5,2.5736166079833738e-8,-0.0010310082903914864,4.04622844238969e-5,2.577556155474702e-8,-0.0010306315696239265,4.062155526853457e-5,2.586455506912295e-8,-0.0010303445107737654,4.084394736602622e-5,2.5983723580936618e-8,-0.00103017415051348,4.106712011714914e-5,2.6101034286724267e-8,-0.00103011645990442,4.121429379152592e-5,2.617762452180817e-8,-0.0010301283373702107,4.1218183604357294e-5,2.617978519094077e-8,-0.0010301360479824519,4.1049891214193474e-5,2.6093535091742128e-8,-0.0010300617418679534,4.073592787552085e-5,2.5933314593629573e-8,-0.0010298552834028627,4.0349707833675383e-5,2.5737635695545288e-8,-0.0010295123624857808,3.9981058901976845e-5,2.555325702866578e-8,-0.0010290699371210256,3.970266737753418e-5,2.541762182017323e-8,-0.0010285862799355606,3.95510226577242e-5,2.5348871652570656e-8,-0.001028119665030133,3.952567217658717e-5,2.5345604153804084e-8,-0.0010277146398166707,3.9599592103778894e-5,2.5392608827923747e-8,-0.0010273969445857086,3.9732019239784237e-5,2.54679029136312e-8,-0.0010271741439923543,3.987889635605635e-5,2.554837330653049e-8,-0.0010270387420002831,3.999979218338487e-5,2.5613362144150908e-8,-0.0010269717730998133,4.006209216467498e-5,2.564665439659544e-8,-0.0010269462335600545,4.004361181148552e-5,2.563758062373979e-8,-0.001026930475247916,3.993429582593155e-5,2.5581696150718296e-8,-0.0010268917955752411,3.9737131056284514e-5,2.54811632465487e-8,-0.0010268003254188763,3.946803547779058e-5,2.5344696049297998e-8,-0.001026633045285693,3.9154302349015926e-5,2.51867793373167e-8,-0.001026377413673644,3.883136780108241e-5,2.502596843310329e-8,-0.0010260339595217747,3.8538067531633994e-5,2.4882331374804033e-8,-0.00102561729797183,3.8310807330376756e-5,2.477430480252826e-8,-0.0010251551932449294,3.8177261675103885e-5,2.471538175976041e-8,-0.001024685487708184,3.8150384280356484e-5,2.4711128828705612e-8,-0.0010242508292970316,3.822352571453758e-5,2.475696413222644e-8,-0.0010238910923221203,3.836763523516221e-5,2.4837113045173785e-8,-0.0010236336767047106,3.853222377882937e-5,2.492543131105467e-8,-0.0010234830537858264,3.865239008611646e-5,2.49891058187856e-8,-0.0010234129983969168,3.8663590948988006e-5,2.4996031285257513e-8,-0.0010233670245726736,3.852273512816904e-5,2.492524814844594e-8,-0.001023271959887443,3.822833359285693e-5,2.4776942964655382e-8,-0.0010230632432314934,3.782769524653137e-5,2.4575998844550145e-8,-0.0010227107525744934,3.740279961889332e-5,2.436473371991324e-8,-0.0010222302402959167,3.703969137491942e-5,2.418716232193019e-8,-0.0010216740030515826,3.6798124988745376e-5,2.4073362152007457e-8,-0.001021108290579188,3.669683896443461e-5,2.4031974626159863e-8,-0.0010205912572348655,3.6717350983459955e-5,2.4052398420585333e-8,-0.0010201604372997207,3.681830406381751e-5,2.411249122180296e-8,-0.0010198303307530497,3.6950727918991715e-5,2.418666800590093e-8,-0.0010195960756659162,3.706898533184759e-5,2.4251597017513103e-8,-0.001019439056359185,3.713670445797552e-5,2.4289132019925126e-8,-0.001019332059571601,3.7129221763336125e-5,2.428734485125245e-8,-0.0010192433493335681,3.70343141516297e-5,2.4240686043212892e-8,-0.0010191400194511332,3.685229866278754e-5,2.4149908608415946e-8,-0.0010189911883879065,3.659580376531763e-5,2.402192783224623e-8,-0.0010187714343872375,3.628895436908966e-5,2.3869435845986977e-8,-0.0010184645132939021,3.596533710163379e-5,2.3709873676371996e-8,-0.001018066855839815,3.566412672527142e-5,2.3563393719128077e-8,-0.0010175898667280023,3.542425031334137e-5,2.3449761052332165e-8,-0.0010170599390659412,3.5277162817117435e-5,2.3384558945173422e-8,-0.001016515394012989,3.523949770501541e-5,2.3375440811865953e-8,-0.0010160002224420199,3.530738001007149e-5,2.3419397704779323e-8,-0.0010155553831384591,3.545419198619564e-5,2.3501928264935122e-8,-0.001015209142874551,3.563302488615149e-5,2.3598624983890202e-8,-0.0010149684067089226,3.5784346527384886e-5,2.3679292211144022e-8,-0.0010148133891465872,3.584860072421633e-5,2.3714344288769612e-8,-0.0010146982630651578,3.5782055660811007E-05,2.3682629377636572e-8,-0.0010145599654888093,3.557207326886522e-5,2.3578848270284908e-8,-0.0010143351722388912,3.5245823371830506e-5,2.3417678410022003e-8,-0.0010139811800521554,3.486632047924191e-5,2.3231576085062046e-8,-0.001013492050599654,3.4513974439642034e-5,2.3061330561170134e-8,-0.0010129013184621315,3.4259974954934804e-5,2.2942555475658693e-8,-0.0010122691652813616,3.4143842428325755e-5,2.289440024171102e-8,-0.001011660964001645,3.416527319904436e-5,2.291564249859294e-8,-0.0010111280235503381,3.429134318278579e-5,2.2988645742694414e-8,-0.0010106976785511353,3.447205752042876e-5,2.3087503664077148e-8,-0.0010103730798261847,3.465571175252602e-5,2.3185940039964153e-8,-0.0010101387428839818,3.479919616418346e-5,2.3262469964226124e-8,-0.0010099675794849883,3.487271276682596e-5,2.3302608900919384e-8,-0.0010098269209837737,3.4860699206272e-5,2.3299134968487392e-8,-0.0010096829020666328,3.476102080226269e-5,2.3251535621906485e-8,-0.0010095036482449427,3.4583741581220033e-5,2.316533851284319e-8,-0.00100926202814437,3.434990375649573e-5,2.3051517011118484e-8,-0.0010089385902406682,3.409004467856952e-5,2.2925769286763956e-8,-0.0010085248696185096,3.384168830235557e-5,2.2807227493595864e-8,-0.0010080265806791115,3.3644931550302674e-5,2.2716140262856692e-8,-0.0010074654828322916,3.353571640167953e-5,2.26703687608163e-8,-0.0010068782778092742,3.353743271134205e-5,2.268110345686206e-8,-0.0010063112194841138,3.36528689313314e-5,2.274888894220196e-8,-0.0010058104572475534,3.3859569732431347e-5,2.286150383963712e-8,-0.0010054101212326877,3.411145176628525e-5,2.2995062591133473e-8,-0.0010051217418514823,3.434769733360527e-5,2.3118734876600543e-8,-0.0010049287823506632,3.450726125747007e-5,2.3202145373587556e-8,-0.0010047886815621875,3.454511779650876e-5,2.3223469127649264e-8,-0.001004642523791172,3.444551550645358e-5,2.317587375654054e-8,-0.0010044301777682276,3.4228082912857005e-5,2.307029016040388e-8,-0.0010041070053985303,3.394428660482434e-5,2.293333606477324e-8,-0.0010036572007801948,3.366424530591849e-5,2.280046957873214e-8,-0.0010030989670374397,3.3457142010512746e-5,2.2706067870780697e-8,-0.001002478977520436,3.3371580578821594e-5,2.2673661179006083e-8,-0.0010018578283530568,3.342312200493025e-5,2.2709939398912565e-8,-0.0010012922882052613,3.359334378293894e-5,2.2804621910948108e-8,-0.0010008212275209021,3.3839363188058443e-5,2.2935524319804295e-8,-0.0010004594328713067,3.410840614322706e-5,2.3076001992787873e-8,-0.0010001992187818722,3.4351274842747164e-5,2.320166356575127e-8,-0.0010000167281470184,3.453101661995363e-5,2.3294552412610813e-8,-9.998793317252265e-4,3.462633409658824e-5,2.3344654270450874e-8,-9.997518470452732e-4,3.4631318428131296e-5,2.3349607127017085e-8,-9.996009199043014e-4,3.455348552109253e-5,2.3313647478180466e-8,-9.9939795849614e-4,3.44114906802232e-5,2.3246470434010358e-8,-9.99121407187035e-4,3.4233040893128126e-5,2.3162210737379513e-8,-9.987590833800812e-4,3.405276743515656e-5,2.3078368950141786e-8,-9.983108679056524e-4,3.390926822320403e-5,2.3014265042933495e-8,-9.97791306534957e-4,3.384032770146051e-5,2.2988554306834156e-8,-9.972307991430098e-4,3.3875718713881964e-5,2.3015580148524872e-8,-9.966733564831009e-4,3.4028221102158114e-5,2.310094837163757e-8,-9.961691020362934e-4,3.428546408696686e-5,2.3237638825588425e-8,-9.957615865134595e-4,3.46069401339788e-5,2.3404762682669036e-8,-9.954733186501152e-4,3.493021100327155e-5,2.357086532821176e-8,-9.952956330342465e-4,3.5186762200118035e-5,2.370192787102682e-8,-9.95188477807128e-4,3.532262383638006e-5,2.377162507367407e-8,-9.950913872963697e-4,3.5315508210565336e-5,2.376975873492727e-8,-9.94941500795456e-4,3.518154860532421e-5,2.3705430116577784e-8,-9.946916452042978e-4,3.496972133573339e-5,2.3603993034892922e-8,-9.943224955306555e-4,3.4747072949003844e-5,2.3499389344168517e-8,-9.938459958236127e-4,3.458033160070616e-5,2.3424766870853507e-8,-9.933002965673123e-4,3.451936283405707e-5,2.3404222600228282e-8,-9.92738532106868e-4,3.4586492210376424e-5,2.34477123751599e-8,-9.922149570488884e-4,3.47737697346077e-5,2.35500702634693e-8,-9.917723365169562e-4,3.504802300243e-5,2.369389615669735e-8,-9.91433801696836e-4,3.536137626092322e-5,2.385500900287136e-8,-9.912006576782077e-4,3.566352992413874e-5,2.4008564476421496e-8,-9.910555099664157e-4,3.591217265700787e-5,2.4134077453991628e-8,-9.909685467225334e-4,3.607935109184319e-5,2.4218367354514807e-8,-9.90904493799253e-4,3.615353059249766e-5,2.4256393376223053e-8,-9.90828480212809e-4,3.613845925610944e-5,2.4250587005171246e-8,-9.90710154736621e-4,3.605041340979941e-5,2.420946428455628e-8,-9.905262925749175e-4,3.5915102415850375e-5,2.4146106990416895e-8,-9.902625674466235e-4,3.576480559520487e-5,2.407673810359449e-8,-9.899151595612757e-4,3.563558997580312e-5,2.4019285840091026e-8,-9.894925239248037e-4,3.556393259086711e-5,2.399161892926978e-8,-9.890169789091286e-4,3.558183032668142e-5,2.400906596769323e-8,-9.885248529442735e-4,3.570977187754583e-5,2.4080982598891237e-8,-9.880631022206629e-4,3.594816942793109e-5,2.4206693186517794e-8,-9.876803749587692e-4,3.6270078383065484e-5,2.4372152484305683e-8,-9.874125517596248e-4,3.662032117452578e-5,2.4549731590826265e-8,-9.872671120179847e-4,3.6926008414473374e-5,2.470348797116585e-8,-9.872146960178598e-4,3.7118461255131244e-5,2.4799926090503432e-8,-9.871951531337715e-4,3.715829143129886e-5,2.482028574407889e-8,-9.871375620403313e-4,3.705077677427379e-5,2.476806781996489e-8,-9.869847448893906e-4,3.684329236067619e-5,2.466765451933042e-8,-9.867105450566658e-4,3.660725536650436e-5,2.4555140657066402e-8,-9.86323904247596e-4,3.641469724773145e-5,2.4466432455541804e-8,-9.858615016007492e-4,3.631928880259697e-5,2.442766534764061e-8,-9.85374633250025e-4,3.634645237112784e-5,2.4450388419430107e-8,-9.849156337300748e-4,3.649235218034662e-5,2.453139904021426e-8,-9.845270231932197e-4,3.672923823051199e-5,2.465582036281864e-8,-9.842346708626541e-4,3.7014300862134964e-5,2.4801822245291615e-8,-9.840451716688692e-4,3.729969081586018e-5,2.4945700886248175e-8,-9.839470708571595e-4,3.754181375466232e-5,2.5066377411016933e-8,-9.839150653915634e-4,3.770836043790428e-5,2.514864253568232e-8,-9.83915845150665e-4,3.778218739727299e-5,2.5184832131647895e-8,-9.839141440703577e-4,3.776204586365129e-5,2.5175023720621267e-8,-9.838778946578378e-4,3.7660825559131726e-5,2.5126110722890017e-8,-9.837819111355383e-4,3.750231363693385e-5,2.5050212268447694e-8,-9.83610120160167e-4,3.731747931219535e-5,2.4962853060990782e-8,-9.833567922937184e-4,3.714089212336408e-5,2.4881163070795294e-8,-9.830272886633775e-4,3.700727412351498e-5,2.4822096717103307e-8,-9.826385911278707e-4,3.69477424015823e-5,2.4800505830703303e-8,-9.82219396284537e-4,3.698509836147771e-5,2.4826830050034716e-8,-9.818087670899545e-4,3.712771767756578e-5,2.4904243886600084e-8,-9.814515702841564e-4,3.7362648046258683e-5,2.5025539421476875e-8,-9.811889802018954e-4,3.7650571338024e-5,2.5170939795615703e-8,-9.810442154511204e-4,3.792755371116602e-5,2.5309102919604293e-8,-9.810080333830023e-4,3.811864493199592e-5,2.5403711739960307e-8,-9.81033207624282e-4,3.8163102204115404e-5,2.5425633123846726e-8,-9.810462359989666e-4,3.804100654306584e-5,2.5365828059548833e-8,-9.809743731534347e-4,3.778505688611488e-5,2.524112956896296e-8,-9.807739041156364e-4,3.746843502401319e-5,2.508825210734586e-8,-9.804438663459916e-4,3.717577379911337e-5,2.4949313572355698e-8,-9.800204118408863e-4,3.697428727925494e-5,2.485733884169189e-8,-9.795593431768212e-4,3.6897909348930136e-5,2.4828320900585492e-8,-9.791176972697106e-4,3.694613487266822e-5,2.4860822858248447e-8,-9.78740821256568e-4,3.709208601691692e-5,2.4940346749398108e-8,-9.784561041063255e-4,3.7293678129001164e-5,2.5045249521682385e-8,-9.782718489133458e-4,3.7504071244625615e-5,2.5152145120602866e-8,-9.781792758595254e-4,3.7679941882763186e-5,2.5239992535436655e-8,-9.781562333794412e-4,3.778745647138105e-5,2.5292850462091087e-8,-9.781718882523143e-4,3.780606999115621e-5,2.530147602469855e-8,-9.781918620216884e-4,3.773013883351006e-5,2.5263886480747403e-8,-9.781832167389938e-4,3.7568458080856365e-5,2.518501010675023e-8,-9.78118742072559e-4,3.7342042791065954e-5,2.507558218052921e-8,-9.779801236071979e-4,3.708061130398327e-5,2.4950452157285786e-8,-9.777597868775496e-4,3.681839353569755e-5,2.4826535622686178e-8,-9.774615375963498e-4,3.6589861622145944e-5,2.47206704952449e-8,-9.771002958644923e-4,3.642562803302159e-5,2.464752335844287e-8,-9.767011177636903e-4,3.6348412775412787e-5,2.461757103592887e-8,-9.762974059618317e-4,3.636884684333104e-5,2.463512177599872e-8,-9.759277035517238e-4,3.648101405343806e-5,2.4696356361916733e-8,-9.75629951246629e-4,3.665840901177218e-5,2.4787660934629145e-8,-9.754322748465593e-4,3.685252659570957e-5,2.4885193908702775e-8,-9.75340987613693e-4,3.699788916582287e-5,2.495739454375517e-8,-9.753299684090048e-4,3.702722840929396e-5,2.4972198717358794e-8,-9.753395265608093e-4,3.689599167738356e-5,2.490869287630752e-8,-9.752920720559031e-4,3.6606102877796636e-5,2.4768523544825133e-8,-9.751219280535475e-4,3.62127126348543e-5,2.457919604533296e-8,-9.748035378869218e-4,3.580501071706199e-5,2.4384716721739845e-8,-9.743604317943561e-4,3.5470563709328834E-05,2.4228018734390125e-8,-9.738510761405169e-4,3.526450154078282e-5,2.4135686744524703e-8,-9.733435765106256e-4,3.519840608946445e-5,2.411249078547065e-8,-9.728943634004211e-4,3.5247780682422384e-5,2.4145284649450995e-8,-9.725377477092212e-4,3.536768335651393e-5,2.4211049479849402e-8,-9.722848444423038e-4,3.550754893515966e-5,2.428448154165182e-8,-9.72127563371285e-4,3.562150854076412e-5,2.4343174928178926e-8,-9.720441769973178e-4,3.567417242302132e-5,2.437035998268252e-8,-9.720046367152485e-4,3.56432887461309e-5,2.4355963585866076e-8,-9.719752390974952e-4,3.552063301357858e-5,2.4296779131561367e-8,-9.719228596586245e-4,3.531171554305102e-5,2.4196141313711178e-8,-9.718188423673552e-4,3.503437202507118e-5,2.406317927089353e-8,-9.716423998941957e-4,3.471621408885309e-5,2.3911605715671775e-8,-9.713832408989576e-4,3.439096166140005e-5,2.3757978780585042e-8,-9.710430366130846e-4,3.409389102193965e-5,2.361948593481193e-8,-9.70635446133547e-4,3.3856923351839665e-5,2.3511491505683215e-8,-9.701846919981149e-4,3.370390574741038e-5,2.3445165212560717e-8,-9.697228228770885e-4,3.364647614797688e-5,2.342546325722505e-8,-9.692857745624962e-4,3.368081166293388e-5,2.3449670440655165e-8,-9.689081926968012e-4,3.378557365972413e-5,2.3506650641077334e-8,-9.686168099705691e-4,3.392170644199995e-5,2.357703705485365e-8,-9.684224658620934e-4,3.4035563171401795e-5,2.3634937383161203e-8,-9.68312113340623e-4,3.406746818840269e-5,2.3652061632635778e-8,-9.682443258694862e-4,3.396706662113197e-5,2.3604922859051918e-8,-9.681538286062369e-4,3.371329935534211e-5,2.348419799835916e-8,-9.679692761326831e-4,3.333058404686902e-5,2.330235800983941e-8,-9.676407409410866e-4,3.2888734991917684e-5,2.3093584924486144e-8,-9.671629996624705e-4,3.2480309923178234e-5,2.2902797651000153e-8,-9.665791080763037e-4,3.2184835146996645e-5,2.276825671546724e-8,-9.659613244934983e-4,3.204046428493923e-5,2.270778086296016e-8,-9.653822640887052e-4,3.203767611505963e-5,2.2715798323767404e-8,-9.648929276683705e-4,3.213287335072607e-5,2.2770213229558723e-8,-9.645149837962753e-4,3.226903530996189e-5,2.2842729866168465e-8,-9.642442355567376e-4,3.239247708087407e-5,2.2907171397624284e-8,-9.640587530216115e-4,3.24620993246358e-5,2.2943963859402317e-8,-9.639270001539048e-4,3.245248074250296e-5,2.2941464499432092e-8,-9.638140578411377e-4,3.235353569481727e-5,2.2895550510650823e-8,-9.6368595444148e-4,3.2168912493880215e-5,2.28086319018673e-8,-9.635128997527551e-4,3.191410788621952e-5,2.2688634455621677e-8,-9.632720633656184e-4,3.161432337084309e-5,2.2547969983926774e-8,-9.629500908473864e-4,3.1301728190777524e-5,2.2402276055104036e-8,-9.625451789726969e-4,3.101176374193039e-5,2.226867575507521e-8,-9.620681774777247e-4,3.077836455776551e-5,2.216345368450055e-8,-9.615420329416084e-4,3.0628500411465295e-5,2.209935540113096e-8,-9.609991467969121e-4,3.057690888665009e-5,2.2082994490797295e-8,-9.604766797714861e-4,3.062205911343596e-5,2.2112942498469528e-8,-9.600102747775835e-4,3.074434601472043e-5,2.2179018433807102e-8,-9.596270214263777e-4,3.090724439259373e-5,2.2263089974248304e-8,-9.593386562986945e-4,3.1061771792007744e-5,2.2341454918293274e-8,-9.591361349101454e-4,3.1154428547892235e-5,2.2388764734143828e-8,-9.589871735461636e-4,3.113854434292479e-5,2.2383389507898628e-8,-9.588390052667267e-4,3.0987899671081076e-5,2.23137088373979e-8,-9.586285812047179e-4,3.0709291166627064e-5,2.2183841699676357e-8,-9.583004549904042e-4,3.034807980718291e-5,2.20160808943815e-8,-9.578277490469907e-4,2.9980170319710332e-5,2.1846942684937246e-8,-9.572262091683876e-4,2.968886340238766e-5,2.1716059377740093e-8,-9.565515092747311e-4,2.953507814969651e-5,2.1651963566920276e-8,-9.558790138711099e-4,2.9536365304518656e-5,2.166217296734255e-8,-9.552767930981623e-4,2.9665583334704913e-5,2.173278583758932e-8,-9.547860467171304e-4,2.9867061406297094e-5,2.1836474927304304e-8,-9.544158266696612e-4,3.0078540975903094e-5,2.1943173400982044e-8,-9.541492278461368e-4,3.024805141205629e-5,2.20281932369835e-8,-9.539540335951516e-4,3.034185193150517e-5,2.2075920768301698e-8,-9.537924048895253e-4,3.0345247140230987e-5,2.208000983233228e-8,-9.536275311546465e-4,3.025982229495277e-5,2.204185499562896e-8,-9.534275077413425e-4,3.0099841725022342e-5,2.1968736705240954e-8,-9.531675967845711e-4,2.9889041402266785e-5,2.187225621318765e-8,-9.528318988517542e-4,2.9657867759765324e-5,2.1767059789256722e-8,-9.524149404686213e-4,2.9440645440285744e-5,2.1669541941369942e-8,-9.519231274636026e-4,2.9272003957849185e-5,2.1596154336982085e-8,-9.513754532627277e-4,2.9182105324352853e-5,2.156109047838405e-8,-9.508024505321581e-4,2.9190878090889825e-5,2.1573483188737836e-8,-9.502424663511357e-4,2.9302351813132366e-5,2.1634700321363326e-8,-9.49735030418587e-4,2.9500882232911995e-5,2.1736638845838566e-8,-9.493122042363756e-4,2.975120128025421e-5,2.1861931766478845e-8,-9.489899450602254e-4,3.0003488125871785e-5,2.19865714491652e-8,-9.487620601966599e-4,3.020311750055373e-5,2.2084695992892515e-8,-9.485988957950232e-4,3.030316317880326e-5,2.2134553407674564e-8,-9.484518091654521e-4,3.0276810472256283e-5,2.2124270364054122e-8,-9.482632222856166e-4,3.0126538386465414e-5,2.205597301242971e-8,-9.479807554179524e-4,2.9887047408005317e-5,2.194689841841948e-8,-9.475724436270446e-4,2.961960692398054e-5,2.1826477535904775e-8,-9.470384606933393e-4,2.9397309036501518e-5,2.1729216202936675e-8,-9.464140919087501e-4,2.9284117233135745e-5,2.168479093152599e-8,-9.457607135250013e-4,2.931474722874649e-5,2.1708699518209903e-8,-9.451468703045619e-4,2.948415363474355e-5,2.179756824154432e-8,-9.446272642077682e-4,2.975166154093429e-5,2.19313942223417e-8,-9.442287741878977e-4,3.005706659105484e-5,2.2081348790756766e-8,-9.439480612138644e-4,3.0340177706433605e-5,2.2219059244211306e-8,-9.437587330039747e-4,3.05555047742844e-5,2.232346391891961e-8,-9.436224123828684e-4,3.0678595514250895e-5,2.2383640253534496e-8,-9.434987028230832e-4,3.0705355294702186e-5,2.2398300631400305e-8,-9.433518093842979e-4,3.0647746413302585e-5,2.2373619930447855e-8,-9.431539596951896e-4,3.052879162175852e-5,2.2320812424416252e-8,-9.42886827941632e-4,3.0378337056025078e-5,2.2254139731918605e-8,-9.425421763466582e-4,3.0229750427711546e-5,2.2189391361884014e-8,-9.421224563862095e-4,3.011700715597695e-5,2.2142531937943215e-8,-9.416414774327706e-4,3.0071346469157127e-5,2.212810620989906e-8,-9.411245660268458e-4,3.0116816661240038e-5,2.215710354642401e-8,-9.406070615964384e-4,3.026467552618603e-5,2.2234316233793085e-8,-9.40129838692488e-4,3.050774422637882e-5,2.2355753528190237e-8,-9.397312194328286e-4,3.0817081031483444e-5,2.2507225708871276e-8,-9.394363651629871e-4,3.1143952690525606e-5,2.266544635054926e-8,-9.39247469629382e-4,3.14289902634384e-5,2.2802467253505157e-8,-9.391392811567771e-4,3.161734154321736e-5,2.28928419535772e-8,-9.390631834203985e-4,3.1675072753920046e-5,2.292128485717643e-8,-9.389595011470184e-4,3.160054917881444e-5,2.2887892684632222e-8,-9.38774017044829e-4,3.142629938669554e-5,2.2808821851867562E-08,-9.384731170441491e-4,3.121073248180759e-5,2.2712144428496986e-8,-9.380529653295315e-4,3.102263562512172e-5,2.2630329259409035e-8,-9.37540421932073e-4,3.0923179639618185e-5,2.2591680785415607e-8,-9.369857583175107e-4,3.095034383443137e-5,2.261312414301245e-8,-9.364492385837592e-4,3.1109898640259824e-5,2.269626110812058e-8,-9.359853619300495e-4,3.137546064701527e-5,2.2827755619925506e-8,-9.356295240548179e-4,3.16974681512932e-5,2.2983821119346855e-8,-9.353911527823038e-4,3.2017802198202046e-5,2.313717510433112e-8,-9.35254811672147e-4,3.228479107023496e-5,2.326399499414142e-8,-9.351875597689146e-4,3.2463820357644084e-5,2.3348709349042408e-8,-9.351488611202442e-4,3.2541398176328435e-5,2.338570291153537e-8,-9.350994833205346e-4,3.25234996917194e-5,2.3378386345866902e-8,-9.350074661012362e-4,3.2430678404906835e-5,2.333682380228043e-8,-9.348510276335349e-4,3.229243028857118e-5,2.3275080016553152e-8,-9.346193314669444e-4,3.214231620297721e-5,2.3208959235950077e-8,-9.34312262797197e-4,3.2014221186669155e-5,2.3154273367792384e-8,-9.339400414025882e-4,3.193933185076618e-5,2.3125418905859264e-8,-9.33522913696338e-4,3.194305448645945e-5,2.3133910756853474e-8,-9.330904862493931e-4,3.204115275895757e-5,2.3186578394138074e-8,-9.326796244283101e-4,3.223492294630654e-5,2.3283386135426127e-8,-9.323295184334296e-4,3.250635238251842e-5,2.3415326287966734e-8,-9.320730236673442e-4,3.281574833663746e-5,2.356349553000111e-8,-9.319252711366798e-4,3.310543782936856e-5,2.3700943505328696e-8,-9.318736216132645e-4,3.331219177128394e-5,2.3798471243414568e-8,-9.318752640651988e-4,3.338676318697942e-5,2.3833655432768257e-8,-9.31866963948998e-4,3.331301147491189e-5,2.3799668733206908e-8,-9.317849968972861e-4,3.311655040946259e-5,2.3709231637614105e-8,-9.315865645433877e-4,3.2857438239323513e-5,2.3591073380549135e-8,-9.312628626536916e-4,3.2610345594110236e-5,2.3480457903216238e-8,-9.308393005661033e-4,3.24417200448329e-5,2.3408301483171562e-8,-9.303651936824847e-4,3.239281090859414e-5,2.339318150193606e-8,-9.298986864069065e-4,3.24725338782039e-5,2.343818307136948e-8,-9.29492219127464e-4,3.265959531263871e-5,2.3532245846076462e-8,-9.291818021359038e-4,3.2911055999915944e-5,2.3654527540462002e-8,-9.289814804693926e-4,3.317408157338681e-5,2.3780107907133812e-8,-9.28883102878134e-4,3.339795710135585e-5,2.3885603751994195e-8,-9.288606081706539e-4,3.3543937048918637e-5,2.3953598676844333e-8,-9.288772589118661e-4,3.3591181371482934e-5,2.3975172255395918e-8,-9.288937419745458e-4,3.353814016920971e-5,2.395033272948154e-8,-9.288751893623011e-4,3.340004673214571e-5,2.3886721538417358e-8,-9.287959268978146e-4,3.320403594462646e-5,2.3797303763589087e-8,-9.286417064222096e-4,3.298355112980294e-5,2.369778683496962e-8,-9.284099392258089e-4,3.277328729013441e-5,2.3604298515993387e-8,-9.281087947963245e-4,3.260518664063019e-5,2.3531530406527254e-8,-9.277558922978596e-4,3.25053020042501e-5,2.3491259018736307e-8,-9.27376881127838e-4,3.2490978444289704E-05,2.349102519309791e-8,-9.270036743482587e-4,3.2567791005183e-5,2.3532761106056747e-8,-9.266715169341242e-4,3.2726055504754945e-5,2.361130945511728e-8,-9.264137151151058e-4,3.293770276831043e-5,2.3713172494102367e-8,-9.262532777753961e-4,3.315574465668824e-5,2.3816439311101114e-8,-9.261924253535585e-4,3.331972423030237e-5,2.389335984974595e-8,-9.262040127993932e-4,3.336992217268715e-5,2.3916815814377182e-8,-9.262317722939682e-4,3.326872605091641e-5,2.3870037451283865e-8,-9.26204733848964e-4,3.3020183443077696e-5,2.3755545743126395e-8,-9.260627882338456e-4,3.267485106444268e-5,2.3597373291928313e-8,-9.257806549268176e-4,3.2313603001887904e-5,2.343349628055146e-8,-9.253766285983505e-4,3.201794497161325e-5,2.3301884783205278e-8,-9.249026226141552e-4,3.1842977355389055e-5,2.3227766419155888e-8,-9.244236141866019e-4,3.1804942562237756e-5,2.321783898637054e-8,-9.239978305283136e-4,3.188429203691447e-5,2.3261932645223352e-8,-9.236643245273065e-4,3.203781785436325e-5,2.3339012154274225e-8,-9.234386977616611e-4,3.221281488408803e-5,2.3424069805742805e-8,-9.233147289125141e-4,3.235906739356297e-5,2.3493825767808208e-8,-9.232692914346888e-4,3.243722377144107e-5,2.3530540271546322e-8,-9.232686902572398e-4,3.242362191865267e-5,2.3524031114582375e-8,-9.232753070314963e-4,3.231198064538372e-5,2.347219924760264e-8,-9.232537561991422e-4,3.211234823824068e-5,2.3380345332508162e-8,-9.231758558037119e-4,3.1847866001873865e-5,2.3259584838009844e-8,-9.230239270817444e-4,3.155012781518374e-5,2.3124710835478002e-8,-9.227922362546493e-4,3.1253999746506684e-5,2.299185234886264e-8,-9.224867387452752e-4,3.0992724464646724e-5,2.2876250708263638e-8,-9.221236055597706e-4,3.079385597163362e-5,2.27903811393233e-8,-9.217270560533948e-4,3.067609570471294e-5,2.2742468990955336e-8,-9.213267796337176e-4,3.064680318714811e-5,2.2735346156833847e-8,-9.20954912564315e-4,3.0699934328855683e-5,2.2765581416612138e-8,-9.206421478418023e-4,3.08143607477365e-5,2.2822873109824424e-8,-9.204122660196305e-4,3.095320827010874e-5,2.2889943688910157e-8,-9.202747886912586e-4,3.106597764009101e-5,2.2943650815208422e-8,-9.20216936947342e-4,3.1095988189358365e-5,2.2958395502173376e-8,-9.201985234595585e-4,3.099497926622176e-5,2.2912665548665453e-8,-9.201557642877907e-4,3.074296687634402e-5,2.2797948208220792e-8,-9.200186966514138e-4,3.0364621739963786e-5,2.2626137511840795e-8,-9.197385636888824e-4,2.9929213138156976e-5,2.242949417390068e-8,-9.193108394574188e-4,2.9527970187913423e-5,2.225019669376877e-8,-9.187785340875029e-4,2.9238845703639758e-5,2.2123997801802605e-8,-9.182134225021054e-4,2.9098989670442113e-5,2.2067447146301895e-8,-9.176879830111815e-4,2.9098589555165532e-5,2.2075132170368005e-8,-9.17253784391652e-4,2.9193712335522423e-5,2.212586268610836e-8,-9.169332050515159e-4,2.932621852597383e-5,2.2192168520093514e-8,-9.167219505579218e-4,2.944065181810668e-5,2.224829932694638e-8,-9.165966656263807e-4,2.949439756587482e-5,2.2274934020959177e-8,-9.165233093736817e-4,2.9461840863147958e-5,2.226094758259148e-8,-9.164642868928159e-4,2.9334685108527463e-5,2.220331133229603e-8,-9.163839913645998e-4,2.9120232422900573e-5,2.2106066579955823e-8,-9.162530317647461e-4,2.883851348103519e-5,2.1978863978225656e-8,-9.160513185398048e-4,2.8518597058158136e-5,2.1835244906513958e-8,-9.15769988624412e-4,2.8194298243653313e-5,2.1690730238489156e-8,-9.154120664548803e-4,2.7899535170271005e-5,2.1560765750180442e-8,-9.149917488095805e-4,2.7663738874698725e-5,2.1458654195702416e-8,-9.145323801553542e-4,2.7507851429598272e-5,2.1393709233720136e-8,-9.140634112563936e-4,2.744128142921948e-5,2.136983448703116e-8,-9.136166435043148e-4,2.745994641856036e-5,2.1384644526880326e-8,-9.13221944692427e-4,2.754549808736449e-5,2.1429208794373388e-8,-9.129024910120398e-4,2.7665888640565562e-5,2.148847949703196e-8,-9.126694819496386e-4,2.7777706431344518e-5,2.154253176218981e-8,-9.125166098566058e-4,2.7831321553144563e-5,2.156899691685832e-8,-9.124157000485842e-4,2.7780165658292776e-5,2.1547232079309533e-8,-9.123165267733067e-4,2.759442992476146e-5,2.1464373542698462e-8,-9.121548623777333e-4,2.7276427140508372e-5,2.1322119221499095e-8,-9.118711019526034e-4,2.6870144591949852e-5,2.114094313683426e-8,-9.114350063079968e-4,2.6455006129514234e-5,2.0957209029743784e-8,-9.108634742462995e-4,2.6120092101343845e-5,2.081139801841706e-8,-9.102178200814272e-4,2.5929424367736944e-5,2.0732255869559906e-8,-9.095797117160946e-4,2.5898353086471822e-5,2.0726067368364644e-8,-9.090202329768966e-4,2.5993933266429337e-5,2.077699539719869e-8,-9.085793014011967e-4,2.615479802733407e-5,2.0856387709915296e-8,-9.082619863653898e-4,2.6315579246745158e-5,2.09341239475786e-8,-9.080467696016204e-4,2.6424152758084614e-5,2.098656643738969e-8,-9.078974977973308e-4,2.6448875948786817e-5,2.0999792057647626e-8,-9.077736775849799e-4,2.6378608518081082e-5,2.0969414117202983e-8,-9.076374388060467e-4,2.621931034153885e-5,2.089880711320176e-8,-9.074576563940846e-4,2.598981028468818e-5,2.0797007293920687e-8,-9.072123555606045e-4,2.5717763310892864e-5,2.067680801973962e-8,-9.068901702931364e-4,2.543581375595846e-5,2.055305287961445e-8,-9.064910919600087e-4,2.51777245706118e-5,2.044096225969404e-8,-9.060264239903059e-4,2.497429600456872e-5,2.0354350101638346e-8,-9.055176396903595e-4,2.4849147035049042e-5,2.0303725663131417e-8,-9.049938331462582e-4,2.48148520431951e-5,2.0294513960783498e-8,-9.044877759473634e-4,2.487013629166907e-5,2.0325761996341625e-8,-9.040309431041147e-4,2.4998716181532725e-5,2.0389648367651206e-8,-9.036480496186143e-4,2.5170219741609872e-5,2.0472012539751645e-8,-9.033517513971097e-4,2.534346091236584e-5,2.0553994872596846e-8,-9.031382345469437e-4,2.5472113323665762e-5,2.0614734900078757e-8,-9.029845516590252e-4,2.5512741628428336e-5,2.0635033273204925e-8,-9.028490149929373e-4,2.5434954827073677e-5,2.0601836238167363e-8,-9.026764902106563e-4,2.5232408447057923e-5,2.0513003051675774e-8,-9.02410173775587e-4,2.4931333305205534e-5,2.03809375747986e-8,-9.020092509206674e-4,2.459113424824214e-5,2.0232703367730958e-8,-9.014671775780341e-4,2.4291763948560345e-5,2.0104263036672917e-8,-9.008206650653747e-4,2.4108119510329703e-5,2.0028949316011377e-8,-9.001407652157997e-4,2.40815816794724e-5,2.002473027343289e-8,-8.995076036470077e-4,2.4204454860463047e-5,2.0087372224985797e-8,-8.989819618378563e-4,2.442640209534498e-5,2.0193550978397385e-8,-8.985886426926948e-4,2.4677367529835956e-5,2.0311351442965695e-8,-8.983168875609791e-4,2.489249041554455e-5,2.0411570672683616e-8,-8.981321994515865e-4,2.5027742305275945e-5,2.0474734817052442e-8,-8.979905680705888e-4,2.506411353886881e-5,2.0492861273368607e-8,-8.978493659111419e-4,2.50042478933684e-5,2.0467761838839778e-8,-8.976735626310779e-4,2.486629512223054e-5,2.040810250953443e-8,-8.974383807300419e-4,2.46779904367794e-5,2.0326637181998767e-8,-8.971300793370073e-4,2.447195277178342e-5,2.0238087853917463e-8,-8.967460299014721e-4,2.4281946492655756e-5,2.0157529321890946e-8,-8.962944874862408e-4,2.41394984040332e-5,2.009894778188007e-8,-8.957939342688571e-4,2.4070383811391924e-5,2.0073707412014148e-8,-8.952715333108823e-4,2.4090842783267837e-5,2.0088849549234874e-8,-8.94760107898572e-4,2.420397021695154e-5,2.014545178891125e-8,-8.942933680114259e-4,2.4397265038716906e-5,2.0237535845060154e-8,-8.938997498069575e-4,2.4642474151023778e-5,2.0352064205131918e-8,-8.935958998883974e-4,2.4898610660257977E-05,2.047041270308535e-8,-8.933813137979958e-4,2.5118392150347438e-5,2.057138082449648e-8,-8.932357382837027e-4,2.525738915614616e-5,2.0635360425476936e-8,-8.931205738507962e-4,2.5284299096435977e-5,2.0648906749984923e-8,-8.929848689198422e-4,2.5190265415252555e-5,2.0608774843090036e-8,-8.927757350545704e-4,2.4994824362930195e-5,2.052437537467493e-8,-8.924519189134882e-4,2.4745797708676503e-5,2.0417514294488545e-8,-8.919975931406865e-4,2.4510848006438183e-5,2.031846414448125e-8,-8.914314961573257e-4,2.436039906856739e-5,2.0258291785338553e-8,-8.908058509117407e-4,2.4345690900774747e-5,2.0259156353576073e-8,-8.901923458736179e-4,2.4480408023514104e-5,2.032632704668696e-8,-8.896591855754514e-4,2.473538117757218e-5,2.0446077286436584e-8,-8.892494467896753e-4,2.505003874490458e-5,2.0590986107984132e-8,-8.889707658958967e-4,2.5354671159387962e-5,2.0729934824061592e-8,-8.887992171195747e-4,2.5592069573353648e-5,2.0837712880844427e-8,-8.886922966930062e-4,2.572983863637043e-5,2.0900398514110002e-8,-8.886031916452067e-4,2.576187327548421e-5,2.0915874009217856e-8,-8.884910916697882e-4,2.5702806387382103e-5,2.0891201501616617e-8,-8.883263469942507e-4,2.5580247122862124e-5,2.0839048300129043e-8,-8.880918126579759e-4,2.5427917810549098e-5,2.0774582188619598e-8,-8.877822930623571e-4,2.528066113611859e-5,2.071327182632323e-8,-8.874034503409459e-4,2.51709375729389e-5,2.0669390176493168e-8,-8.869707261418254e-4,2.5125989723721748e-5,2.0654810035291582e-8,-8.865081500699982e-4,2.5164954314173364e-5,2.067774642510077e-8,-8.86046435520712e-4,2.5295625909005256e-5,2.074132329135633e-8,-8.856195799846079e-4,2.5511276908268373e-5,2.0842176511925037e-8,-8.852594627043434e-4,2.578871501824554e-5,2.0969645761179816e-8,-8.849887434082308e-4,2.6089236359805585e-5,2.1106290594163275e-8,-8.848135668142814e-4,2.6363915683878577e-5,2.12303363316089e-8,-8.847186517320325e-4,2.6563437790964064e-5,2.132009779085571e-8,-8.846674515235134e-4,2.6650601378864086e-5,2.1359523275735847e-8,-8.846087189309281e-4,2.66117823350549e-5,2.1343206192558952e-8,-8.844884826177575e-4,2.6463259603390726e-5,2.1279054822091283e-8,-8.84264302201615e-4,2.6249677950410016e-5,2.1187425909026206e-8,-8.839176546726403e-4,2.6034332006823362e-5,2.109662263366006e-8,-8.83460649868888e-4,2.588342561020468e-5,2.1035784916221402e-8,-8.82934630955511e-4,2.584833167410523e-5,2.102703848956324e-8,-8.824002202963414e-4,2.595091364572211e-5,2.1079174189276926e-8,-8.81920975885244e-4,2.61768927835987e-5,2.1185003004173495e-8,-8.815456299885851e-4,2.648030419312936e-5,2.132360042425762e-8,-8.812952960849518e-4,2.6797977084991984e-5,2.146685384949102e-8,-8.811602994497689e-4,2.7068443874576867e-5,2.1587808754275467e-8,-8.811068251980501e-4,2.7247856141716944e-5,2.1667584069800153e-8,-8.81089260979772e-4,2.7317788146902162e-5,2.169866440830599e-8,-8.810626671495409e-4,2.7284359038585255e-5,2.168436095027221e-8,-8.809914703339173e-4,2.7171697969967655e-5,2.1635803660338795e-8,-8.80853375306616e-4,2.7013728986054004e-5,2.1568241334736312e-8,-8.806396376131523e-4,2.6847076911299085e-5,2.14978976330453e-8,-8.803534902028214e-4,2.670608170906783e-5,2.1439805851815076e-8,-8.800081064751453e-4,2.661959400830792e-5,2.140644761622855e-8,-8.796247407013677e-4,2.6608697363742646e-5,2.1406789555317838e-8,-8.792309875330124e-4,2.668453948521081e-5,2.1445354689839482e-8,-8.788585456571649e-4,2.684586308158884e-5,2.152116684744657e-8,-8.78539601693883e-4,2.7076554888474195e-5,2.162673250547703e-8,-8.783011687268403e-4,2.7344451028370228e-5,2.1747606543339466e-8,-8.781575952511767e-4,2.760340690883203e-5,2.1863392752506867e-8,-8.781030584565838e-4,2.780060405021578e-5,2.1951002414711444e-8,-8.781075985026394e-4,2.7889387640801088e-5,2.1990279643567898e-8,-8.781205807905475e-4,2.7844561840664714e-5,2.197066505165757e-8,-8.780829418086908e-4,2.767387999018061e-5,2.1896173090185512e-8,-8.779448870805086e-4,2.74194206923248e-5,2.178590013371832e-8,-8.776820355245091e-4,2.7146767973214645e-5,2.166911671129024e-8,-8.773032995196551e-4,2.692589193920319e-5,2.157667830482182e-8,-8.768478522267831e-4,2.6811226903755186e-5,2.153215088316852e-8,-8.763733034865937e-4,2.6827771709541934e-5,2.1545755773169187e-8,-8.759398672705631e-4,2.6966612293309254e-5,2.1612637371882027e-8,-8.75595423955086e-4,2.718972268856917e-5,2.171528609991872e-8,-8.753651397527334e-4,2.744156484383133e-5,2.182888124213572e-8,-8.75247681912975e-4,2.766380317219204e-5,2.1927841507686533e-8,-8.752182834583848e-4,2.7809084316441637e-5,2.1991802394858896e-8,-8.752370705991506e-4,2.78503969031841e-5,2.2009553750829985e-8,-8.752596751637627e-4,2.7784140827711733e-5,2.1980196488628183e-8,-8.752468743315799e-4,2.7627256123099378e-5,2.1911727125109708e-8,-8.751709906385506e-4,2.741056684869909e-5,2.181802519722558e-8,-8.750184292407893e-4,2.717106230583093e-5,2.1715442258405405e-8,-8.747891179445456e-4,2.6945211256019782e-5,2.161989799005169e-8,-8.744942264117304e-4,2.6764246324536103e-5,2.1544865267399724e-8,-8.741534012510591e-4,2.6651298588158375e-5,2.1500162537119337e-8,-8.73792188217311e-4,2.6619664630001775e-5,2.1491228293641114e-8,-8.734396730616577e-4,2.6671435073366737e-5,2.1518551762450664e-8,-8.731258580016011e-4,2.679606382670435e-5,2.1577100432093963e-8,-8.7287798682881e-4,2.696908317973565e-5,2.165584590639723e-8,-8.727151324958717e-4,2.7152056798777518e-5,2.1737843898724333e-8,-8.726411876491597e-4,2.7295776371153268e-5,2.180169400597056e-8,-8.72638123277193e-4,2.7348884643569248e-5,2.1825288578833227e-8,-8.726635290724197e-4,2.7272385770363037e-5,2.1792059497611342e-8,-8.726572026318421e-4,2.7056308642078688e-5,2.16981558387545e-8,-8.725583379939474e-4,2.673014546177635e-5,2.1556946339519295e-8,-8.723277672615219e-4,2.6358529275551267e-5,2.1397083391496553e-8,-8.719640776249092e-4,2.6020955368897574e-5,2.1253534423843147e-8,-8.715045501738401e-4,2.5784651947306544e-5,2.1155571953329428e-8,-8.71011034255676e-4,2.5683903518439307e-5,2.1117663450457478e-8,-8.705491307552995e-4,2.5713812934991007e-5,2.113685431521052e-8,-8.701702166525884e-4,2.5837496324388218e-5,2.119617587482424e-8,-8.699014006819977e-4,2.6000426627921144e-5,2.1271201276789622e-8,-8.697436570127698e-4,2.6145631661998167e-5,2.1336868320268546e-8,-8.696759171271625e-4,2.6225891752515828E-05,2.137282593288771e-8,-8.696624900426764e-4,2.621144415050257e-5,2.136666972028361e-8,-8.696616766384265e-4,2.609309797451578e-5,2.1315093592520665e-8,-8.696339802855976e-4,2.58812240139253e-5,2.1223246173929514e-8,-8.695486258957221e-4,2.560145694153938e-5,2.1102720086846007e-8,-8.693875014404906e-4,2.5288439658636282e-5,2.096877998090809e-8,-8.691463110554454e-4,2.4979158898865863e-5,2.083749001199522e-8,-8.688333814216199e-4,2.4707133641329762e-5,2.0723252879501703e-8,-8.684669509396333e-4,2.449818770419122e-5,2.0637035505226535e-8,-8.680718625220174e-4,2.4367943926356345e-5,2.0585317375536392e-8,-8.676763190924599e-4,2.432063005736646e-5,2.0569587886541e-8,-8.673088635246923e-4,2.4348592526606557e-5,2.0586157121313442e-8,-8.669953180759233e-4,2.4432155464044134e-5,2.0626149014017224e-8,-8.667551694766482e-4,2.4539935083866278e-5,2.0675728630559995e-8,-8.665969051568935e-4,2.4630410220170644e-5,2.0716875446414914e-8,-8.665124727648299e-4,2.4656354944466406e-5,2.0729342915038327e-8,-8.664725697134575e-4,2.4573949994687252e-5,2.0694555012387574e-8,-8.664264664054185e-4,2.43569138231536e-5,2.0601608133330403e-8,-8.663110139622543e-4,2.401199304406164e-5,2.0453867175701917e-8,-8.660704693962533e-4,2.3586965902470763e-5,2.0272378725582345e-8,-8.656806366986982e-4,2.316147155005631e-5,2.0091868871878088e-8,-8.651633988921566e-4,2.281978312873848e-5,1.9948869925345905e-8,-8.645805810525198e-4,2.2618527290404762e-5,1.9867633866200034e-8,-8.640097643843145e-4,2.256770525095591e-5,1.9851904328723277e-8,-8.635166675543678e-4,2.2633614094821955e-5,1.9886336038762515e-8,-8.63137948012429e-4,2.2757311910044172e-5,1.9944743482180508e-8,-8.628781813717942e-4,2.2875933655872637e-5,1.9999555353413913e-8,-8.62716501594731e-4,2.2938215554097242e-5,2.0028639520069148e-8,-8.626167844185233e-4,2.291219190087368e-5,2.0018587878018706e-8,-8.625373867297079e-4,2.2786717609544522e-5,1.9965210231098124e-8,-8.624388179572647e-4,2.256927580919071e-5,1.987237287145151e-8,-8.62289189850553e-4,2.2281913356921493e-5,1.975006320331657e-8,-8.620677332013985e-4,2.195621272300181e-5,1.9612130462789248e-8,-8.617664966194991e-4,2.16277997444501e-5,1.9473928068892485e-8,-8.613902656342819e-4,2.1330954467429593e-5,1.935006757875441e-8,-8.609548908336364e-4,2.109389378252815e-5,1.9252475069560743e-8,-8.60484364617139e-4,2.0935189055747062e-5,1.9188905233103563e-8,-8.600071436128826e-4,2.086164348674763e-5,1.91620410767755e-8,-8.595522857630777e-4,2.086763182325774e-5,1.916920143547591e-8,-8.591457649603986e-4,2.0935595960451394e-5,1.9202563113239573e-8,-8.588070106868445e-4,2.103741778004402e-5,1.9249802291736785e-8,-8.585455278490724e-4,2.1136657572340328e-5,1.9295144248855717e-8,-8.583574459539792e-4,2.119206027325631e-5,1.9320951414396224e-8,-8.582223041875423e-4,2.1163256231024873e-5,1.9310193204886934e-8,-8.581015046639913e-4,2.1019633830437e-5,1.9250187621650533e-8,-8.579412331421961e-4,2.0752106826417253e-5,1.913751847356446e-8,-8.576831677947019e-4,2.0384459053393114e-5,1.898276909784322e-8,-8.572838524692297e-4,1.997686961930766e-5,1.8811952221028124e-8,-8.567366035007616e-4,1.9613260947646273e-5,1.8661045623987466e-8,-8.560824766647061e-4,1.9371935268362093e-5,1.8563376708157653e-8,-8.553990379155328e-4,1.9293084341216936e-5,1.8535706064271064e-8,-8.547703530167884e-4,1.936321412352537e-5,1.8571651992880513e-8,-8.542559556665059e-4,1.952555465174852e-5,1.864632532315067e-8,-8.538756727449201e-4,1.970687106733324e-5,1.8727989569739696e-8,-8.536133022643489e-4,1.9843141688829028e-5,1.8789169711081318e-8,-8.534305325201742e-4,1.989357508587466e-5,1.8812667709058706e-8,-8.532814843157356e-4,1.984307509264013e-5,1.879252452479186e-8,-8.531232008002682e-4,1.969807749884717e-5,1.8732068113313398e-8,-8.529215833508998e-4,1.9480194465247334e-5,1.864101205609392e-8,-8.526540395091069e-4,1.9220106769211913e-5,1.8532719999846374e-8,-8.523103008730304e-4,1.8952387630912345e-5,1.8421969114052342e-8,-8.518922166171214e-4,1.8711017815063302e-5,1.83230973754797e-8,-8.514126718644334e-4,1.8525339647629737e-5,1.8248378472723516e-8,-8.508935758492765e-4,1.8416482805648164e-5,1.820658103690855e-8,-8.503628746581636e-4,1.839451037204468e-5,1.8201787199229734e-8,-8.498506739728784e-4,1.8456726342008194e-5,1.823266217066025e-8,-8.493848597949864e-4,1.858755364818312e-5,1.8292382925859e-8,-8.489867877928165e-4,1.8760075533750793e-5,1.8369304773500778e-8,-8.486675197616957e-4,1.8939094885436825e-5,1.8448317961918758e-8,-8.484249414374999e-4,1.908551666785093e-5,1.8512794690847823e-8,-8.482420318448436e-4,1.9161892414962764e-5,1.854700959220887e-8,-8.480866947760388e-4,1.9139120485201888e-5,1.853898427741999e-8,-8.47914089849887e-4,1.9004229019293404e-5,1.8483705191242097e-8,-8.476729841454053e-4,1.8768219337488148e-5,1.8386304668266145e-8,-8.473174336537129e-4,1.847105600233066e-5,1.8264025543393118e-8,-8.46823043761053e-4,1.8178888378359918e-5,1.814493877116609e-8,-8.462024594710862e-4,1.7968779622830955e-5,1.8061442704564362e-8,-8.455100213327113e-4,1.790201857047041e-5,1.8039011781499097e-8,-8.44827387250912e-4,1.7997506299222376e-5,1.8085063263440332e-8,-8.442336473553949e-4,1.82219741246474e-5,1.8184995677384506e-8,-8.437761660142642e-4,1.8504766407932626e-5,1.8308588065556925e-8,-8.434584576481965e-4,1.8767662195956877e-5,1.842267679658266e-8,-8.4324815382798e-4,1.895151458304113e-5,1.8502419193258396e-8,-8.430953104809079e-4,1.9028223922689918e-5,1.853631028756183e-8,-8.429494942284543e-4,1.8998849917980934e-5,1.852528741826402e-8,-8.427701821877676e-4,1.8884905878580218e-5,1.8478909462789927E-08,-8.425307640973115e-4,1.8718917804788393e-5,1.8411232187863652e-8,-8.4221863676526e-4,1.853706175763964e-5,1.8337626368837928e-8,-8.418337179676496e-4,1.837420046907955e-5,1.827269721178165e-8,-8.413866423383756e-4,1.8260484347668602e-5,1.822893007494307e-8,-8.408968704231464e-4,1.8218648925198794e-5,1.821564458019552e-8,-8.403904546985228e-4,1.8261602613572497e-5,1.8238040596675744e-8,-8.398971047784783e-4,1.8390365569227584e-5,1.8296347683661744e-8,-8.394462933471349e-4,1.859286581010708e-5,1.8385307406524103e-8,-8.390625554693548e-4,1.8844349042141637e-5,1.849434016111365e-8,-8.387606740926772e-4,1.9109956838288736e-5,1.86086555425353e-8,-8.38541735765671e-4,1.934955354341349e-5,1.871133966197072e-8,-8.383910411803681e-4,1.9524369896896514e-5,1.8786212347626552e-8,-8.382786396254357e-4,1.9604517498810704e-5,1.882101552190826e-8,-8.381628606157513e-4,1.957613104080785e-5,1.8810378176449664e-8,-8.379968680478822e-4,1.9446885164135782e-5,1.8758024552986323e-8,-8.377380159940519e-4,1.924845999124919e-5,1.8677651607636933e-8,-8.373591718549969e-4,1.9034058927322546e-5,1.8591733411884385e-8,-8.368597531357094e-4,1.886904423475679e-5,1.8527502435010273e-8,-8.362722099438048e-4,1.881422597460021e-5,1.8509963766801086e-8,-8.356585036787218e-4,1.890516421021724e-5,1.8553367099453363e-8,-8.350935969910999e-4,1.913599743885326e-5,1.865465529485676e-8,-8.346403242080155e-4,1.945802313397077e-5,1.8793064946602195e-8,-8.34327545916489e-4,1.979670869488179e-5,1.893732043323308e-8,-8.341432058884843e-4,2.0079064624085877e-5,1.905704488089487e-8,-8.340443957116498e-4,2.0256813697895776e-5,1.9132370964305275e-8,-8.339762461212966e-4,2.0315496394862994e-5,1.915767659009268e-8,-8.338890176634837e-4,2.0269954024688864e-5,1.9139616310843984e-8,-8.337477088005211e-4,2.015310994528189e-5,1.9092327487425826e-8,-8.335344195487556e-4,2.0004740360878148e-5,1.9032641784256222e-8,-8.332464619472108e-4,1.9863456916696745e-5,1.897669433393755e-8,-8.328930721117551e-4,1.9762094713418337e-5,1.8938027533986976e-8,-8.32492297882966e-4,1.9725314418621403e-5,1.8926665101186917e-8,-8.32068415293489e-4,1.97681582273195e-5,1.8948588036477114e-8,-8.316495311428089e-4,1.9894810847537727e-5,1.900526818571205e-8,-8.312647852018803e-4,2.0097427747145573e-5,1.909320121864192e-8,-8.309406311115315e-4,2.0355522535096095e-5,1.9203660731413604e-8,-8.306961138447342e-4,2.0636898921431595e-5,1.9323105247655924e-8,-8.305378232200559e-4,2.0901137965268803e-5,1.9434664802670044e-8,-8.304559556956476e-4,2.1106081507306507e-5,1.9520878928693548e-8,-8.304232734093543e-4,2.121667553013109e-5,1.9567400873830927e-8,-8.303983658234531e-4,2.121422167099143e-5,1.9566836162855173e-8,-8.303333870477527e-4,2.1103220227911646e-5,1.952153119702011e-8,-8.301848490250651e-4,2.0913258553630374e-5,1.9444248405592745e-8,-8.299248979192241e-4,2.069466744819484e-5,1.935621254368111e-8,-8.295501421522738e-4,2.0508232040964325e-5,1.928269583340997e-8,-8.290853574454966e-4,2.0410715377186484e-5,1.9246942812164235e-8,-8.285801055587781e-4,2.0439332177392955e-5,1.9263794111536346e-8,-8.2809766077195e-4,2.059951905236773e-5,1.9334808940806114e-8,-8.276980402284858e-4,2.086083916102179e-5,1.944680759157122e-8,-8.274201421640853e-4,2.1164367562493242e-5,1.957510063623294e-8,-8.272700826664273e-4,2.1440488239337026e-5,1.9690891838981256e-8,-8.272211164209307e-4,2.163042771909038e-5,1.9770119508971764e-8,-8.272248984694739e-4,2.1702369405362463e-5,1.980002378644996e-8,-8.27228099796603e-4,2.1656229173428763e-5,1.9781034701150995e-8,-8.271868289199328e-4,2.151765544352276e-5,1.9724204114230814e-8,-8.270743741962598e-4,2.1326531390819485e-5,1.9646358599563786e-8,-8.26882219952542e-4,2.1125677324855516e-5,1.9565355735798533e-8,-8.266169368517766e-4,2.095292185174144e-5,1.94967870339568e-8,-8.262957480189584e-4,2.0836914464318622e-5,1.9452286083130493e-8,-8.25942474644233e-4,2.0795532754586838e-5,1.9438941053262905e-8,-8.255843718992038e-4,2.083550384946244e-5,1.9459206265133282e-8,-8.252495647333255e-4,2.095228065573517e-5,1.9510899184512012e-8,-8.249644062349847e-4,2.112985311313308e-5,1.958715392852858e-8,-8.247500865889223e-4,2.1340896571258705e-5,1.96765117319045e-8,-8.24618243855376e-4,2.1548299489712724e-5,1.9763583444848516e-8,-8.245661579256653e-4,2.1709369314150928e-5,1.983081139445514e-8,-8.245731982415894e-4,2.1783542272099323e-5,1.9861656355918796e-8,-8.246010337711906e-4,2.174293624505869e-5,1.9844932417100713e-8,-8.24599762693081e-4,2.1582829143363222e-5,1.9779092489063103e-8,-8.245199320168276e-4,2.1327443144663598e-5,1.9674559193285197e-8,-8.243271463267552e-4,2.1027056964939968e-5,1.9552443886955017e-8,-8.240137478913354e-4,2.0745880537874062E-05,1.9439417625111437e-8,-8.236027048837928e-4,2.054443207807126e-5,1.9360323569771445e-8,-8.231420981185931e-4,2.046260583006955e-5,1.9331166390175837e-8,-8.226923062309316e-4,2.050897293837082e-5,1.9354816716611825e-8,-8.223101620532402e-4,2.065914064149752e-5,1.9420558033546697e-8,-8.220346412416486e-4,2.0863033376546166e-5,1.9507310836051278e-8,-8.218778118280972e-4,2.1058697312165184e-5,1.958944171580837e-8,-8.218233231961076e-4,2.1188662210092975e-5,1.964349015093813e-8,-8.218326197553458e-4,2.1214125651217814e-5,1.9653903415513317e-8,-8.21856605729153e-4,2.112285109501725e-5,1.9616154125454246e-8,-8.218486723198633e-4,2.092896166987658e-5,1.9536534435121197e-8,-8.21774900682099e-4,2.0665900016862456e-5,1.9429164058162805e-8,-8.216189955439171e-4,2.0376078120981753e-5,1.9311669317101807e-8,-8.213819939742871e-4,2.010103213726683e-5,1.9201115798957357e-8,-8.210785719648872e-4,1.987447711399243e-5,1.911118281263017e-8,-8.20732153301422e-4,1.9718757169934105e-5,1.905076891931154e-8,-8.203703758138432e-4,1.964388881521585e-5,1.9023668998090353e-8,-8.200215277640999e-4,1.9647991667492965e-5,1.9028805308153496e-8,-8.197118007420141e-4,1.971813517172542e-5,1.906061049159396e-8,-8.194627667111748e-4,1.983118207998987e-5,1.910940136475893e-8,-8.192884188063901e-4,1.99548908795387e-5,1.9161861647232118e-8,-8.191914615513263e-4,2.005020377589606e-5,1.920200887423933e-8,-8.191593400069361e-4,2.0076033762683125e-5,1.92131658914827e-8,-8.191616964490206e-4,1.999753215727303e-5,1.918132541360626e-8,-8.191520734989105e-4,1.9797250015148836e-5,1.909967483876304e-8,-8.190765586708921e-4,1.948575838000759e-5,1.8972896885336155e-8,-8.188893026085382e-4,1.9105659284594878e-5,1.881876618035338e-8,-8.185698549347501e-4,1.8723588649551148e-5,1.8664805935860888e-8,-8.181336800547649e-4,1.8410527065246534e-5,1.8540121068539456e-8,-8.176292682317155e-4,1.8218322499468568e-5,1.8465698823274743e-8,-8.171225750854558e-4,1.816336880244077e-5,1.844774602721915e-8,-8.166763753560664e-4,1.8224017124166648e-5,1.8476781130729858e-8,-8.163333375780404e-4,1.8350561857245017e-5,1.853193523194076e-8,-8.16107745214289e-4,1.8481632209535812e-5,1.8587831243527868e-8,-8.159860616604793e-4,1.8560533642340127e-5,1.8621333711184525e-8,-8.159338548044192e-4,1.8547406867931718e-5,1.8616474714546974e-8,-8.159059685028022e-4,1.8425544094309115e-5,1.856691337547998e-8,-8.158571772717478e-4,1.8201877478809365e-5,1.8475986230218312e-8,-8.157511568267292e-4,1.790263037304738e-5,1.8354797984609146e-8,-8.155662647845826e-4,1.756578402681822e-5,1.8219061692464088e-8,-8.152974777324008e-4,1.7232463817564305e-5,1.80855624276064e-8,-8.149548380423059e-4,1.6939285910434784e-5,1.79690735294896e-8,-8.14559552341495e-4,1.6713010048744217e-5,1.7880250136234366e-8,-8.141391520903434e-4,1.6567887899189816e-5,1.7824625038532265e-8,-8.13722894907782e-4,1.65052911686815e-5,1.7802510165505718e-8,-8.133380240113629e-4,1.6514764792978118e-5,1.7809448528021547e-8,-8.130068823177181e-4,1.6575692411162992e-5,1.7836899066496914e-8,-8.127444898746023e-4,1.6659173301351172e-5,1.787301036505299e-8,-8.12556110967037e-4,1.6730231029844328e-5,1.79035428156178e-8,-8.1243455505061e-4,1.6751012160459823e-5,1.7913194389418595e-8,-8.123576337801389e-4,1.6686038010803166e-5,1.7887740556088877e-8,-8.122873281432063e-4,1.6510317217035855e-5,1.7817300812807638e-8,-8.12173296759821e-4,1.6219656866485414e-5,1.7700472205744483e-8,-8.119633169768517e-4,1.5839706948872637e-5,1.754794502201198e-8,-8.116204935794114e-4,1.5427302108426434e-5,1.7382995748216617e-8,-8.111412381260521e-4,1.5058049525129414e-5,1.723638629723847e-8,-8.105632272728717e-4,1.4801145884299286e-5,1.713607209252042e-8,-8.099554919138893e-4,1.4692744717581516e-5,1.7096374287795603e-8,-8.093939263332287e-4,1.4722847634811913e-5,1.7112747706322244e-8,-8.089353936498745e-4,1.484233801753127e-5,1.7164799969601408e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json
new file mode 100644
index 0000000..36daa45
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":6000,"numberOfSamples":1000,"samples":[-8.086030009769924e-4,1.4983810405869992e-5,1.7224897231104907e-8,-8.083859978917138e-4,1.5083891420443416e-5,1.7267300877946733e-8,-8.082495498012613e-4,1.5098334698112563e-5,1.727428602498279e-8,-8.08147627922185e-4,1.5007880436382382e-5,1.72384405012867e-8,-8.080344588306433e-4,1.4817024022017442e-5,1.716203842239244e-8,-8.078727223656254e-4,1.4548770451198794e-5,1.705477562558989e-8,-8.076383715174149e-4,1.4237727414253643e-5,1.6930867623711068e-8,-8.07322519250199e-4,1.3922902257012772e-5,1.6806096847405343e-8,-8.069308512481781e-4,1.3641062334595963e-5,1.6695163186853533e-8,-8.064810674365431e-4,1.3421371907981373e-5,1.6609600165603765e-8,-8.059989962711845e-4,1.3281793410593358e-5,1.65564122262766e-8,-8.055140919096513e-4,1.3227437282497666e-5,1.6537470119423336e-8,-8.050550211507427e-4,1.3250758311506548e-5,1.654960752689265e-8,-8.046459011976815e-4,1.3333167640947059e-5,1.658525704041747e-8,-8.04303377210941e-4,1.3447472960351647e-5,1.6633415280209964e-8,-8.040343930544604e-4,1.3560785131852206e-5,1.6680814883554258e-8,-8.038344371049681e-4,1.3637887698738715e-5,1.6713305884428016e-8,-8.036861808400415e-4,1.3645376246194308e-5,1.6717552173535383e-8,-8.035588881624019e-4,1.355715046434086e-5,1.668324932697258e-8,-8.034098545481887e-4,1.3361633179672876e-5,1.660599824235996e-8,-8.031899161995416e-4,1.3069806636622722e-5,1.6490473396248044e-8,-8.028548171317579e-4,1.2720836118968e-5,1.635260915989386e-8,-8.023817298130074e-4,1.2379672673151174e-5,1.6218567533971117e-8,-8.017848916609258e-4,1.21214866090865e-5,1.6118432225501397e-8,-8.011195394685814e-4,1.2004672862047483e-5,1.6075358566152277e-8,-8.004664161243661e-4,1.2045064498369676e-5,1.6095295025865495e-8,-7.999018683719954e-4,1.2207888551202842e-5,1.6163899894807838e-8,-7.994702224832471e-4,1.242340488168506e-5,1.625294935668257e-8,-7.991732540075557e-4,1.2615665237930678e-5,1.6331930886767175e-8,-7.989782632286061e-4,1.2727385321542004e-5,1.6378010390939176e-8,-7.988353176257354e-4,1.2731278778766297e-5,1.6380533700705246e-8,-7.98693545654588e-4,1.262891363153558e-5,1.6340492793338305e-8,-7.985117563218257e-4,1.2443008649451221e-5,1.6267331548458157e-8,-7.982633092416262e-4,1.2208291416633506e-5,1.617517573988445e-8,-7.97937024226046e-4,1.1963551111059878e-5,1.6079587401967125e-8,-7.975359220318068e-4,1.1745517867734186e-5,1.5995123017000115e-8,-7.970748169146011e-4,1.1584298423249006e-5,1.5933578635139873e-8,-7.96577147084504e-4,1.1500116000004205e-5,1.59027823489698e-8,-7.960712612774264e-4,1.1501312858278244e-5,1.5905873133149612e-8,-7.955863788122124e-4,1.1583659586297626e-5,1.5941057128577827e-8,-7.951485028139105e-4,1.1731083070377464e-5,1.6001886167851592e-8,-7.947767272267163e-4,1.191780985300591e-5,1.607808021319529e-8,-7.944803671342594e-4,1.2111620389700717e-5,1.615680382240154e-8,-7.942570988685387e-4,1.2277833661532118e-5,1.622426162217438e-8,-7.940921495251726e-4,1.2383811890041994e-5,1.6267523534675877e-8,-7.939586304605242e-4,1.2403888228974189e-5,1.627651653757225e-8,-7.938193280601158e-4,1.2324675476991541e-5,1.6246136706354253e-8,-7.936307142675456e-4,1.2150538325271284e-5,1.6178380649204796e-8,-7.933502814410618e-4,1.1908091876990174e-5,1.608405253597014e-8,-7.929477558193591e-4,1.164701184564693e-5,1.5982993948326116e-8,-7.924185834346178e-4,1.1433225812865484e-5,1.5901308272972388e-8,-7.91794201526995e-4,1.1331683271163489e-5,1.5864503448445484e-8,-7.911404620961953e-4,1.1381697803054312e-5,1.5887775959579784e-8,-7.905387505296019e-4,1.1576581858174432e-5,1.5968081661271605e-8,-7.900557579253249e-4,1.1862063556780149e-5,1.6083659449037498e-8,-7.897185238722374e-4,1.2157584885353175e-5,1.6202533533502623e-8,-7.895090488599649e-4,1.238821600505574e-5,1.629512295943271e-8,-7.893784662655317e-4,1.2508703453700893e-5,1.6343711956180873e-8,-7.892687928634058e-4,1.2510154891614356e-5,1.6345059350363414e-8,-7.891303130012338e-4,1.2412762325594466e-5,1.630746636423513e-8,-7.889301607306106e-4,1.22532563576661e-5,1.6245726990312346e-8,-7.886537075923972e-4,1.207350096757021e-5,1.6176528951831164e-8,-7.883021088407754e-4,1.1912612868365128e-5,1.611529698390703e-8,-7.878886554381245e-4,1.1802366938175958e-5,1.6074404646753326e-8,-7.874351827903575e-4,1.1764678405500699e-5,1.606225725212218e-8,-7.869686785579548e-4,1.1810193745663737e-5,1.6082821884922013e-8,-7.865178808041266e-4,1.1937644143326378e-5,1.613543027797478e-8,-7.861097334099989e-4,1.2134002375285157e-5,1.621485643068633e-8,-7.857657050956631e-4,1.2375715139896458e-5,1.631178566628287e-8,-7.854982761710509e-4,1.2631342722271491e-5,1.6413830995212057e-8,-7.853082129742637e-4,1.2865627763957707e-5,1.650712800670973e-8,-7.851832404152557e-4,1.3044611801087987e-5,1.6578365268496393e-8,-7.850984979333072e-4,1.3141234772513003e-5,1.661701655440917e-8,-7.850189859904393e-4,1.314074642924285e-5,1.6617484545055545e-8,-7.849040783473408e-4,1.3045167089176555e-5,1.658083277620777e-8,-7.847140887854131e-4,1.2875989940709468e-5,1.6515781106734278e-8,-7.84418739673568e-4,1.2674020385660439e-5,1.643854403323704e-8,-7.840067264380274e-4,1.2494690124657561e-5,1.637089555624342e-8,-7.834940629310338e-4,1.2397202649814611e-5,1.633586078646625e-8,-7.829269123445694e-4,1.242762480633356e-5,1.6351121218225165e-8,-7.823738580167101e-4,1.2600199243328678e-5,1.6421819173272966e-8,-7.819059640317111e-4,1.2886068491034284e-5,1.6536310251172648e-8,-7.815711190078477e-4,1.3218908359013295e-5,1.6668481029581357e-8,-7.813760467322517e-4,1.3518369457025356e-5,1.678692018769316e-8,-7.812866097556989e-4,1.3719738169680302e-5,1.6866455278038853e-8,-7.81245043675736e-4,1.3793772038801468e-5,1.689586528796916e-8,-7.811924892995569e-4,1.3748855436262393e-5,1.6878708749903426e-8,-7.810853126995724e-4,1.3619700644445478e-5,1.6828864667497608e-8,-7.809012145161698e-4,1.3452099763330615e-5,1.6764485192192976e-8,-7.806376216935296e-4,1.3290653946538645e-5,1.6703112676782687e-8,-7.803066615377375e-4,1.31716120529323e-5,1.6658847878700447e-8,-7.799298430182615e-4,1.311988593603372e-5,1.6641219568441624e-8,-7.795337437080761e-4,1.3148379669826384e-5,1.665500141543589e-8,-7.791466519745774e-4,1.3258192670318894e-5,1.6700371540229692e-8,-7.787956166079658e-4,1.3439123013885566e-5,1.6773161126941902e-8,-7.785034521569552e-4,1.3670540636302536e-5,1.6865211246133127e-8,-7.782855194761558e-4,1.3923070098588027e-5,1.6965022456657025e-8,-7.781465158733033e-4,1.4161671472159447e-5,1.705894395665733e-8,-7.780780274644127e-4,1.4350439747166847e-5,1.713304166764391e-8,-7.780578724819625e-4,1.4458808126371696e-5,1.717552433911576e-8,-7.780520945693767e-4,1.4468165316748068e-5,1.7179332308174036e-8,-7.780199264883032e-4,1.4377381074197417e-5,1.7144283672725583e-8,-7.779212697790456e-4,1.42055818063788e-5,1.707811591367681e-8,-7.777254715128031e-4,1.399092160934568e-5,1.6995928407681764e-8,-7.774196852037493e-4,1.37848241088391e-5,1.691784077706239e-8,-7.770148281025337e-4,1.3641905255902624e-5,1.68649932739021e-8,-7.7654695118254e-4,1.3606723344494496e-5,1.6854386908037733e-8,-7.760719733956719e-4,1.3699981752654324e-5,1.6893614104122298e-8,-7.756528920660803e-4,1.3908611710779359e-5,1.6977171984468366e-8,-7.753414973715193e-4,1.4185135339496087e-5,1.708636928482128e-8,-7.751607783545031e-4,1.4459758828692502e-5,1.7194078255654558e-8,-7.750965022472446e-4,1.4662655192892729e-5,1.7273331572288793e-8,-7.751031768498831e-4,1.4747011345581016e-5,1.730618293517172e-8,-7.751215862559233e-4,1.4701900854900151e-5,1.7288656969080978e-8,-7.750986283316115e-4,1.45502732264208e-5,1.7229950783472687e-8,-7.750005720993924e-4,1.4336090541435382e-5,1.714739884303355e-8,-7.748166257563864e-4,1.4108830030091316e-5,1.7060381671628664e-8,-7.74555246270904e-4,1.3911680743308552e-5,1.6985680755460048e-8,-7.742375216046733e-4,1.3775437312394145e-5,1.6935101840957774e-8,-7.738908672395347e-4,1.3716934985120997e-5,1.691492118059338e-8,-7.735443296708602e-4,1.373987657547806e-5,1.6926288994825302e-8,-7.732253688257358e-4,1.3836379992091725e-5,1.6965903557041073e-8,-7.729574201870145e-4,1.398850143961783e-5,1.702664562074045e-8,-7.727575479089458e-4,1.41697546103367e-5,1.7098179346093112e-8,-7.726338127068317e-4,1.4347167415583573e-5,1.7167741915981117e-8,-7.72582526013079e-4,1.4484672906976143e-5,1.7221441721592798e-8,-7.725862452751478e-4,1.4548420666369706e-5,1.724630156120042e-8,-7.726138958417847e-4,1.4513823225779425e-5,1.723297684502607e-8,-7.726244080267737e-4,1.4372974279860863e-5,1.717861929269323e-8,-7.725743889406402e-4,1.4139927504773041e-5,1.708890500581759e-8,-7.724286327675101e-4,1.3851021527237483e-5,1.6978122122320604e-8,-7.721705055599232e-4,1.3558663671444288e-5,1.6866694872960056e-8,-7.718085762849863e-4,1.3319387181004731e-5,1.6776479385700888e-8,-7.713767987397502e-4,1.3179295367351444e-5,1.6725086614472134e-8,-7.709275714331829e-4,1.3161122848693512e-5,1.6720920077215314e-8,-7.705191844169844e-4,1.3256827859980563e-5,1.6760442718757147e-8,-7.702008063045723e-4,1.3428227793557443e-5,1.6828582942267516e-8,-7.699990644679152e-4,1.361618554202354e-5,1.6902388068197547e-8,-7.699104039245936e-4,1.3756467861176603e-5,1.6957151603506948e-8,-7.699023224946573e-4,1.3797806695198463e-5,1.697331252819716e-8,-7.69923693570122e-4,1.3715970518988264e-5,1.6941802014512077e-8,-7.699204730517889e-4,1.3518607018056203e-5,1.686585566047806e-8,-7.698506029324883e-4,1.3239647040700348e-5,1.675881321149357e-8,-7.696928309426752e-4,1.292679553392078e-5,1.663924458294889e-8,-7.694477547487295e-4,1.2627916951666916e-5,1.6525649634657365e-8,-7.691330174202381e-4,1.2380977939982187e-5,1.6432564147368763e-8,-7.687761526504343e-4,1.2209237379755138e-5,1.6368739832210366e-8,-7.684079653894965e-4,1.2120781661778011e-5,1.633703602331063e-8,-7.680577369530784e-4,1.2110432408898472e-5,1.6335228492463344e-8,-7.677501944254693e-4,1.21623329271923e-5,1.6357054465017322e-8,-7.675035516029946e-4,1.2252353588631538e-5,1.6393155437041988e-8,-7.673278510063229e-4,1.2350244031443248e-5,1.6431898304259127e-8,-7.672231013092557e-4,1.2422047112441263e-5,1.6460286860244704e-8,-7.671772688900853e-4,1.243363156115782e-5,1.6465302548663993e-8,-7.671649640707796e-4,1.2356108383738767e-5,1.6435971563363704e-8,-7.671484101972802e-4,1.2173134658280302e-5,1.6366160768870968e-8,-7.670825263514741e-4,1.188858814480631e-5,1.6257519307403445e-8,-7.669249561884815e-4,1.153125860759139e-5,1.6121270567197454e-8,-7.666492306156377e-4,1.115245465159126e-5,1.5977261511360678e-8,-7.662560978121537e-4,1.0814456656206232e-5,1.5849466079461248e-8,-7.657770512027595e-4,1.05724402594284e-5,1.5758977593618244e-8,-7.65267023298901e-4,1.0456872508954073e-5,1.571723833544501e-8,-7.647885985095952e-4,1.0463873633946137e-5,1.5722417018223885e-8,-7.643941100002343e-4,1.0557097979145212e-5,1.5760262592280024e-8,-7.641121194876584e-4,1.0679365871370066e-5,1.580868049828012e-8,-7.639418824019487e-4,1.0769014504534602e-5,1.5844044262621295e-8,-7.63856040874777e-4,1.0775642632836637e-5,1.5847200884499e-8,-7.638095816807227e-4,1.067134664327151e-5,1.5807708446849496e-8,-7.637520719001363e-4,1.0455341968064698e-5,1.5725533933861105e-8,-7.636398633410946e-4,1.015159717703648e-5,1.5610082730947348e-8,-7.634452271731003e-4,9.80080001717917e-6,1.547706895850993e-8,-7.63160419406769e-4,9.449412193445568e-6,1.5344290126782374e-8,-7.627963935193374e-4,9.13916163473737e-6,1.522760366709052e-8,-7.623775983584871e-4,8.899634906261868e-6,1.5138131787055436e-8,-7.619351862275943e-4,8.745021320744058e-6,1.5081084100568852e-8,-7.615007251523846e-4,8.674467790722235e-6,1.5055961298020598E-08,-7.611015754607918e-4,8.674636046522299e-6,1.5057573206547553e-8,-7.607580727699104e-4,8.723012138457471e-6,1.507730793528806e-8,-7.604819845856674e-4,8.79104729455283e-6,1.5104310215033872e-8,-7.602755220059144e-4,8.84693302571431e-6,1.512651308174354e-8,-7.60130395955743e-4,8.858401879917029e-6,1.5131688225382546e-8,-7.600268787531797e-4,8.796280560370882e-6,1.5108794499177295e-8,-7.599335469922736e-4,8.639531259323042e-6,1.5049899963453894e-8,-0.000759809210702789,8.381910431287344e-6,1.495271925500096e-8,-7.596089689111743e-4,8.038852722231386e-6,1.4823230368913413e-8,-7.592954714676379e-4,7.651012523481406e-6,1.4677004696445236e-8,-7.588534536653339e-4,7.279557888325591e-6,1.4537373653592984e-8,-7.583012167940397e-4,6.990438849818558e-6,1.4429384557414762e-8,-7.576907836367265e-4,6.831496399448591e-6,1.4371061617021388e-8,-7.570930731261787e-4,6.813281142864784e-6,1.4366159181078007e-8,-7.56573893838745e-4,6.904553518906711e-6,1.440256548875904e-8,-7.561728030269616e-4,7.044803405478948e-6,1.445716559337654e-8,-7.55894167206311e-4,7.166043359666975e-6,1.450415417168199e-8,-7.55711412564325e-4,7.212993883249746e-6,1.4522671727194704e-8,-7.555791656848098e-4,7.1549930276133835e-6,1.4501273602714309e-8,-7.554470640511585e-4,6.988776194001312e-6,1.443893097512812e-8,-7.552712370159999e-4,6.734529749762169e-6,1.4343479112262025e-8,-7.550218631592772e-4,6.428246653777687e-6,1.422866437274883e-8,-7.546866678361489e-4,6.112788824185316e-6,1.4110719482184918e-8,-7.542707923333388e-4,5.8292867079302145e-6,1.400510243390426e-8,-7.537936783321645e-4,5.610111184424559e-6,1.392387568318107e-8,-7.532839358400108e-4,5.474383321977379e-6,1.3874075234006555e-8,-7.527734587962739e-4,5.42640635004478e-6,1.3857186797906472e-8,-7.522919859404003e-4,5.45669894844625e-6,1.386957766596827e-8,-7.518629339501932e-4,5.544851652733658e-6,1.3903575419281547e-8,-7.515008253699221e-4,5.66324214311497e-6,1.3948838400251825e-8,-7.51210094786353e-4,5.780767390543559e-6,1.3993723032625362e-8,-7.509847483529711e-4,5.866229168685598e-6,1.4026532943938554e-8,-7.508084438557491e-4,5.891537175053618e-6,1.4036723339664531e-8,-7.506548991499108e-4,5.835186884660035e-6,1.4016225902040902e-8,-7.504890649576297e-4,5.6865153995048614e-6,1.3961069522205696e-8,-7.502702069824309e-4,5.450810519333698e-6,1.3873309470797243e-8,-7.499584705215199e-4,5.154093641144201e-6,1.376281194863296e-8,-7.495258303846799e-4,4.844492327076601e-6,1.3647730610076522e-8,-7.489697010459084e-4,4.585680212391129e-6,1.3551982235163058e-8,-7.483229773845283e-4,4.439424944083938e-6,1.3498642646116442e-8,-7.47651384167147e-4,4.441135789993236e-6,1.3500781498633393e-8,-7.47033630108719e-4,4.5810783550153105e-6,1.3554518828823992e-8,-7.465319640685318e-4,4.8048662841334895e-6,1.3639340521473976e-8,-7.461696806020518e-4,5.035072310667735e-6,1.3726250888424918e-8,-7.45927649234082e-4,5.200984456189078e-6,1.3788876550238137e-8,-7.457581262680648e-4,5.260058265685222e-6,1.3811432021938078e-8,-7.456046602651826e-4,5.203880705388684e-6,1.3790914319102578e-8,-7.454181631269655e-4,5.052110434397819e-6,1.373481274651468e-8,-7.451656280700271e-4,4.841472760620587e-6,1.3656958068869079e-8,-7.448325507537849e-4,4.61494382342504e-6,1.357343640410499e-8,-7.444214445461733e-4,4.413322175715639e-6,1.3499417669267064e-8,-7.439484346229335e-4,4.2694368736615086e-6,1.3447009746671435e-8,-7.434389857049532e-4,4.204518303627032e-6,1.3423957631836567e-8,-7.429232000552066e-4,4.22642353337615e-6,1.3433047936838739e-8,-7.424310713391792e-4,4.3296407656193255e-6,1.3472159698785832e-8,-7.419881612882491e-4,4.496920195240808e-6,1.3534885426142835e-8,-7.416121363128246e-4,4.702242436589464e-6,1.3611614172495427e-8,-7.413105280088105e-4,4.9146848337064315e-6,1.369092983616905e-8,-7.410798564648585e-4,5.102579289552534e-6,1.3761123342581654e-8,-7.409059284613239e-4,5.2374620959614515e-6,1.3811649751762265e-8,-7.40765021747722e-4,5.2976581500819286e-6,1.3834473325427858e-8,-7.406258251361314e-4,5.271569720175211e-6,1.3825313013330133e-8,-7.404522940607082e-4,5.16079816624066e-6,1.3784817350730312e-8,-7.402080188256512e-4,4.982998369865964e-6,1.3719616164717567e-8,-7.398629579022926e-4,4.773502162654375e-6,1.3642888630399176e-8,-7.394027814983437e-4,4.583451075155526e-6,1.3573616754794363e-8,-7.388391120671625e-4,4.471358391383276e-6,1.3533406453527241e-8,-7.382156353710173e-4,4.486293417993243e-6,1.3540246689754017e-8,-7.376025584177996e-4,4.646263952038066e-6,1.360057244394542e-8,-7.370753966750942e-4,4.923220958661702e-6,1.3703844593894654e-8,-7.366853493943496e-4,5.247831278658755e-6,1.3824412277992002e-8,-7.364384127765779e-4,5.535851078356583e-6,1.3931243008841947e-8,-7.362964904189415e-4,5.721421847439438e-6,1.400013251189647e-8,-7.361977969831083e-4,5.777834083495166e-6,1.4021317172913075e-8,-7.360817614101209e-4,5.717840477241389e-6,1.3999596259483795e-8,-7.359055977095308e-4,5.580085272187351e-6,1.3949330970951832e-8,-7.356494891230436e-4,5.412741838724204e-6,1.3888375540751401e-8,-7.353140711726487e-4,5.2611317114854454e-6,1.3833462198014537e-8,-7.349148352444343e-4,5.160747629068616e-6,1.3797605620566516e-8,-7.34476381499244e-4,5.134402307300587e-6,1.378907362699951e-8,-7.340275945238301e-4,5.1916865952263e-6,1.3811240956866352e-8,-7.335976379390709e-4,5.3295409738639065e-6,1.386285790594125e-8,-7.332124264851362e-4,5.533583318487555e-6,1.393857552488052e-8,-7.328914883847182e-4,5.780224195792896e-6,1.4029729175094004e-8,-7.326453464977734e-4,6.039657534633526e-6,1.412541622107681e-8,-7.324737353478441e-4,6.279722160979335e-6,1.4213885118568412e-8,-7.323650721376349e-4,6.470322863277057e-6,1.4284138014656952e-8,-7.322974036581984e-4,6.587844288483066e-6,1.4327549734585913e-8,-7.322407659586676e-4,6.619032470350085e-6,1.4339305787613665e-8,-7.321607813179032e-4,6.563928060747684e-6,1.4319492082724502e-8,-7.320233046863541e-4,6.4374966021072834e-6,1.4273690279829042e-8,-7.317999978283977e-4,6.269641412024475e-6,1.4212954276300681e-8,-7.314747508146167e-4,6.103003158628865e-6,1.415295567438129e-8,-7.310503956340962e-4,5.987372946262786e-6,1.4111888222525968e-8,-7.30553886574779e-4,5.969501086118192e-6,1.4106716472582734e-8,-7.300364338939657e-4,6.078516230287104e-6,1.4147877299553037e-8,-7.295642924788504e-4,6.3107236580662384e-6,1.4233817360402606e-8,-7.29198788762624e-4,6.622175486804494e-6,1.4348383535941494e-8,-7.289720333664855e-4,6.9380135239147e-6,1.4464270004578152e-8,-7.288720132220635e-4,7.178968146684719e-6,1.4552629285696456e-8,-7.288478475491566e-4,7.292033122646066e-6,1.4594189017363577e-8,-7.288324425920637e-4,7.267653302542506e-6,1.4585519239748402e-8,-7.287681356467766e-4,7.1358561174840265e-6,1.4537665753835853e-8,-7.286220514824529e-4,6.9483598487620115e-6,1.4469630977301123e-8,-7.28388085845522e-4,6.7592678922152605e-6,1.4401275496516345e-8,-7.280804913481166e-4,6.612273121504457e-6,1.4348581630811597e-8,-7.277252407959589e-4,6.5354231757555416e-6,1.4321716844225746e-8,-7.273527660572583e-4,6.540950211029966e-6,1.4324997142073501e-8,-7.269930114233965e-4,6.6273182842564705e-6,1.4357691570767854e-8,-7.26672240266485e-4,6.781718300136292e-6,1.4414990002890305e-8,-7.264107154812758e-4,6.982473886382033e-6,1.4488915944389668e-8,-7.262207318281119e-4,7.201524453767113e-6,1.4569238469116222e-8,-7.261048945983162e-4,7.407366857871365e-6,1.464452799757507e-8,-7.260549073749619e-4,7.568797659062485e-6,1.4703494431167381e-8,-7.26051465526772e-4,7.659436861891897e-6,1.4736614332348274e-8,-7.260658689683676e-4,7.662469338693832e-6,1.4737849783051846e-8,-7.260636091525101e-4,7.574690894230019e-6,1.4706123818166879e-8,-7.260097162467727e-4,7.408843381596091e-6,1.4646170303919831e-8,-7.258751869359084e-4,7.193327753172565e-6,1.4568414770672015e-8,-7.256434329193616e-4,6.968816351578809e-6,1.4487705994885722e-8,-7.253155606930208e-4,6.781829885047062e-6,1.4420936000282275e-8,-7.249132562182546e-4,6.6756763505280914e-6,1.4383719471977372e-8,-7.244778292372096e-4,6.679612946037396e-6,1.438647617104953e-8,-7.240638597492315e-4,6.798235959896041e-6,1.443065370266917e-8,-7.237266826504071e-4,7.004766318589259e-6,1.4506391489857573e-8,-7.235054613225411e-4,7.243025516191428e-6,1.4593301323513466e-8,-7.2340765660686e-4,7.441405783647142e-6,1.4665511557876749e-8,-7.234034010785615e-4,7.53631382926181e-6,1.4700082991218885e-8,-7.234351925205399e-4,7.495034347391305e-6,1.468523799630331e-8,-7.234393429224217e-4,7.325932982914151e-6,1.462407472647779e-8,-7.233679091640017e-4,7.071240070168453e-6,1.4531993918580552e-8,-7.2320061796834e-4,6.7884821942071435e-6,1.4429962503804012e-8,-7.229442000740695e-4,6.531515408382787e-6,1.4337580335722595e-8,-7.226237824510028e-4,6.338676971745417e-6,1.4268730878278133e-8,-7.222726609371696e-4,6.229186086844068e-6,1.4230270463511608e-8,-7.219243370456767e-4,6.204979076589403e-6,1.4222735101428858e-8,-7.216077209136364e-4,6.254637305234233e-6,1.424182454315981e-8,-7.213447052154808e-4,6.357313551246988e-6,1.427987548429127e-8,-7.211489353260135e-4,6.485977719230195e-6,1.432706196354135e-8,-7.210249390732579e-4,6.610178726644471e-6,1.4372391800318248e-8,-7.209673047686168e-4,6.69888928465445e-6,1.440471413451235e-8,-7.209601280974389e-4,6.7240278150433335e-6,1.4413965009805703e-8,-7.20977427897608e-4,6.664882671759e-6,1.4392744472576701e-8,-7.209854343714221e-4,6.51295128433434e-6,1.4338056762127022e-8,-7.209473640933031e-4,6.27595967171071e-6,1.4252764848687728e-8,-7.20830498270342e-4,5.979351536502665e-6,1.4146129546232638e-8,-7.206142541252474e-4,5.663667819126294e-6,1.4032848951131945e-8,-7.202969652261338e-4,5.377288241995543e-6,1.3930404038766788e-8,-7.198989165010806e-4,5.1656853148451214e-6,1.3855144520274798e-8,-7.194600346572165e-4,5.059761967389392e-6,1.381807600558674e-8,-7.190320840484526e-4,5.066413372274996e-6,1.3821501796020195e-8,-7.186667008859963e-4,5.164217116728777e-6,1.3857550892980985e-8,-7.184018625214499e-4,5.306290101127747e-6,1.3909277458429183e-8,-7.182503872805278e-4,5.430848543585556e-6,1.3954476928807232e-8,-7.181945402363831e-4,5.477745639924967e-6,1.3971593615188382e-8,-7.181899363308149e-4,5.406401461740874e-6,1.3946114620028615e-8,-7.181787956068019e-4,5.208432912413644e-6,1.3875092760960466e-8,-7.181080232052682e-4,4.909307597908525e-6,1.3767756999698908e-8,-7.179446434546303e-4,4.558250395919083e-6,1.3641890350548404e-8,-7.176825410055812e-4,4.2115104900122955e-6,1.3517783575060329e-8,-7.173394303115774e-4,3.9166207270580965e-6,1.3412530864261023e-8,-7.169476918402883e-4,3.7030604472824477e-6,1.3336657086835069e-8,-7.165441754546074e-4,3.5802790936875876e-6,1.3293434686648582e-8,-7.161624370313028e-4,3.540740334466443e-6,1.3280030267105057e-8,-7.158283342384227e-4,3.5648889198243974e-6,1.3289336702046267e-8,-7.155582446948228e-4,3.6259309695520506e-6,1.3311712356351884e-8,-7.153587035969551e-4,3.6936410852722728e-6,1.3336343509346127e-8,-7.152264834437153e-4,3.7373251672731826e-6,1.3352284086218272e-8,-7.151486443905965e-4,3.7285507918335262e-6,1.3349406474614047e-8,-7.151027106872547e-4,3.6443643170977546e-6,1.3319531867733131e-8,-7.150577088567976e-4,3.471371309569102e-6,1.3257885044742072e-8,-7.149771233861474e-4,3.2102934517910352e-6,1.3164734543938834e-8,-7.148246566289133e-4,2.879607352494538e-6,1.304671174381637e-8,-7.145727155168279e-4,2.5159715205526265e-6,1.2916970172838227e-8,-7.14211741474117e-4,2.1691340011926946e-6,1.2793345447593278e-8,-7.13756704294834e-4,1.8907340958244058e-6,1.2694309938959155e-8,-7.13246867286023e-4,1.7195895090076379e-6,1.263368292154631e-8,-7.127372110269032e-4,1.6687917986243744e-6,1.2616035558109819e-8,-7.122837106314069e-4,1.7200599947476228e-6,1.2634736954970411e-8,-7.11927625851379e-4,1.8279231828251246e-6,1.2673513419775649e-8,-7.116842639270483e-4,1.9322272870562014e-6,1.2710931582090524e-8,-7.115395372739504e-4,1.9745795969288553e-6,1.2726232447310445e-8,-7.114547557725002e-4,1.9136654302389338e-6,1.270474472926178e-8,-7.113777961538001e-4,1.735292690655213e-6,1.2641441637291946e-8,-7.112572859060644e-4,1.4546876493828617e-6,1.2541763992937194e-8,-7.110556761496227e-4,1.1107338000528394e-6,1.2419577806846834e-8,-7.107574398631749e-4,7.542984399074633e-7,1.2293006190122626e-8,-7.103703854584871e-4,4.3467766591549663e-7,1.2179579666103922e-8,-7.099206413352514e-4,1.8848792044254664e-7,1.209227121863942e-8,-7.094440058956009e-4,3.38112439872334e-8,1.2037433652280913e-8,-7.089770272256449e-4,-3.005946575574514e-8,1.2014751159396523e-8,-7.085502677011695e-4,-1.8942666134325098e-8,1.2018584823579895e-8,-7.081845728037587e-4,4.1504324056836106e-8,1.2039859175127503e-8,-7.078898530136206e-4,1.2085396250360532e-7,1.2067846450829226e-8,-7.07665357590904e-4,1.8796389173417595e-7,1.2091574008084617e-8,-7.075005062641622e-4,2.1404627281451953e-7,1.2100880394544461e-8,-7.073757642706145e-4,1.7527949313218791e-7,1.2087321949694448e-8,-7.072636271028598e-4,5.563556618695607e-8,1.2045175593473184e-8,-7.07130371455471e-4,-1.496666377152965e-7,1.1972682276401499e-8,-7.069396260706627e-4,-4.3038263800395507e-7,1.1873415802529695e-8,-7.06658736467273e-4,-7.585342773530107e-7,1.1757266370952408e-8,-7.062679103912365e-4,-1.0893111587869973e-6,1.164011958067034e-8,-7.057699493448573e-4,-1.3683565279279107e-6,1.1541242460665835e-8,-7.051958014848092e-4,-1.546143275736306e-6,1.1478149826314971e-8,-7.046006461074884e-4,-1.5955509000684547e-6,1.1460378253613378e-8,-7.040489785775769e-4,-1.5244730508863847e-6,1.1485082661954835e-8,-7.035938487042454e-4,-1.3758182686775965e-6,1.1537113738876136e-8,-7.032597812034259e-4,-1.2137575651664247e-6,1.1593901613711014e-8,-7.030369079407669e-4,-1.1027795845962554e-6,1.1632801609042198e-8,-7.028872532957906e-4,-1.0889580682558247e-6,1.1637630789638363e-8,-7.027584678100196e-4,-1.1897271998792792e-6,1.1602238033439061e-8,-7.025988796732991e-4,-1.3932883666335377e-6,1.1530725736851102e-8,-7.02369467900341e-4,-1.6652872066721532e-6,1.1435125811886794e-8,-7.020507465969052e-4,-1.959328698109832e-6,1.1331711320640786e-8,-7.016442939978633e-4,-2.2282184952551496e-6,1.1237034626369414e-8,-7.011697035243303e-4,-2.4335618600813347e-6,1.1164544945400339e-8,-7.006583801112918e-4,-2.5521150452073807e-6,1.1122365961218336e-8,-7.001460060304543e-4,-2.5781375982917395e-6,1.1112496075816941e-8,-6.996655112290227e-4,-2.5220161431554106e-6,1.1131319063948755e-8,-6.992418776281199e-4,-2.4062965783673872e-6,1.1171004748331547e-8,-6.988893060139256e-4,-2.260591788360715e-6,1.1221277939326513e-8,-6.986105278643894e-4,-2.1166353920163535e-6,1.1271116834225942e-8,-6.983975667488254e-4,-2.0042272969958953e-6,1.1310137596645092e-8,-6.982331775114807e-4,-1.948167868728002e-6,1.1329646935505253e-8,-6.980924984224593e-4,-1.9658036073505293e-6,1.1323502940205919e-8,-6.979449169280985e-4,-2.064692866216944e-6,1.128895545665963e-8,-6.977566158534427e-4,-2.240091878769088e-6,1.1227562045779688e-8,-6.974946560896657e-4,-2.4725062008836e-6,1.1146078731656455e-8,-6.971334322778307e-4,-2.7265579611108132e-6,1.1056870056968845e-8,-6.966634001809645e-4,-2.9535495920723803e-6,1.0976992639682918e-8,-6.960998225694706e-4,-3.1003923112501523e-6,1.0925024976391107e-8,-6.954864809875409e-4,-3.125514095301827e-6,1.0915470365326537e-8,-6.94888405730523e-4,-3.0171655312078273e-6,1.0952385872816837e-8,-6.943721615170897e-4,-2.8040956720319907e-6,1.1025740558355747e-8,-6.939812476892919e-4,-2.5493950355256136e-6,1.111363121856989e-8,-6.937199582600355e-4,-2.328052856844355e-6,1.119007794880418e-8,-6.935545525919977e-4,-2.199995786806156e-6,1.123431816683279e-8,-6.93429179173718e-4,-2.1924546956316556e-6,1.1236874298485071e-8,-6.932862200777068e-4,-2.2974342328778687e-6,1.1200440938200634e-8,-6.930818299262455e-4,-2.4806963116481874e-6,1.1136809772812793e-8,-6.927932877982263e-4,-2.69515791678022e-6,1.1062250907052743e-8,-6.924193527516066e-4,-2.8932872464684024e-6,1.0993214408490107e-8,-6.919763333906085e-4,-3.036081365862266e-6,1.0943205101581768e-8,-6.91492215226939e-4,-3.098326934476717e-6,1.0920952638432522e-8,-6.910002904512773e-4,-3.070683044984637e-6,1.0929697707612377e-8,-6.905331356871504e-4,-2.959140124946023e-6,1.0967394783237994e-8,-6.90117596465121e-4,-2.7823877442401985e-6,1.1027633804261848e-8,-6.897712626577218e-4,-2.567793687719598e-6,1.1101026790081565e-8,-6.895006358475275e-4,-2.3467550008997916e-6,1.1176795508382824e-8,-6.89300944615274e-4,-2.150115599113473e-6,1.1244329229978124e-8,-6.891573100006782e-4,-2.00424231133623e-6,1.1294520632905088e-8,-6.890467540316551e-4,-1.9280356409594636e-6,1.1320793607430406e-8,-6.889406381638624e-4,-1.930734024848246e-6,1.1319874885504703e-8,-6.888074504279619e-4,-2.0102414136189414e-6,1.1292397488351405e-8,-6.886161724085662e-4,-2.1518695593095066e-6,1.1243363432643985e-8,-6.883407101463712e-4,-2.327739840236361e-6,1.1182368829498123e-8,-6.879658514959947e-4,-2.497813089077346e-6,1.1123245267791766e-8,-6.874944007746656e-4,-2.6143891697839814e-6,1.108247815801189e-8,-6.869533275424424e-4,-2.6320148015926607e-6,1.1075749525894508e-8,-6.863944546199724e-4,-2.522826202578732e-6,1.1112635168862053e-8,-6.858844538666012e-4,-2.2926275030821306e-6,1.1191109583836215e-8,-6.854832279089802e-4,-1.9877298379677976e-6,1.1295269233710088e-8,-6.852191743942243e-4,-1.6834486218362717e-6,1.1399318636952878e-8,-6.850762207670568e-4,-1.4561494259965552e-6,1.1477115718733162e-8,-6.850017506227822e-4,-1.353885669014518e-6,1.1512169978020316e-8,-6.849299395502611e-4,-1.382232489232581e-6,1.1502489363880025e-8,-6.848057305429362e-4,-1.5099055715152289e-6,1.1458706325152704e-8,-6.845983153559325e-4,-1.6859188037799119e-6,1.1398245647313847e-8,-6.843027428170722e-4,-1.8571846721204412e-6,1.1339299333489303e-8,-6.839342878524915e-4,-1.9804742909492373e-6,1.1296704524613013e-8,-6.83520537940993e-4,-2.0280142608472192e-6,1.1280001238857747e-8,-6.830941226507634e-4,-1.9884992920636643e-6,1.1293074773063915e-8,-6.826870433621648e-4,-1.8656132505174621e-6,1.13346680053564e-8,-6.823264387413217e-4,-1.6753696630438363e-6,1.1399305110651174e-8,-6.82031487121087e-4,-1.4427423697938251e-6,1.1478456664893744e-8,-6.818114056550049e-4,-1.1978017957364357e-6,1.1561864398442774e-8,-6.816645845240956e-4,-9.716026242010502e-7,1.1638940368353777e-8,-6.81578901101889e-4,-7.920793248862827e-7,1.1700156773758746e-8,-6.815332503350359e-4,-6.803319074311323e-7,1.173830361103633e-8,-6.815001275355418e-4,-6.477490111422285e-7,1.1749467706559448e-8,-6.814489184104265e-4,-6.941843501332436e-7,1.1733661035226025e-8,-6.813496403718091e-4,-8.071935459534741e-7,1.1695093476635976e-8,-6.81177053403738e-4,-9.623862476189849e-7,1.164206416834527e-8,-6.809151476327394e-4,-1.1251098518570805e-6,1.158639073471916e-8,-6.80561933977751e-4,-1.254012468855875e-6,1.154218474453644e-8,-6.801338767888566e-4,-1.307464024167702e-6,1.1523643336190613e-8,-6.79668066854345e-4,-1.2535982747354408e-6,1.1541612761355467e-8,-6.792188902309273e-4,-1.0830088825351644e-6,1.1599275967291585e-8,-6.78845970446115e-4,-8.196398734036575e-7,1.1688487599342648e-8,-6.785938804680131e-4,-5.21865523976247e-7,1.1789443842818592e-8,-6.784716853381285e-4,-2.670917135713526e-7,1.1875898145539714e-8,-6.784454801674145e-4,-1.229862560247459e-7,1.1924869708763637e-8,-6.78451422731065e-4,-1.2039502744957288e-7,1.1925808501975738e-8,-6.784224136183189e-4,-2.4413852327126643e-7,1.188376744728601e-8,-6.783122474568518e-4,-4.450160638167141e-7,1.1815400961230667e-8,-6.781056774875232e-4,-6.622121589485789e-7,1.1741382274874111e-8,-6.778146379208505e-4,-8.426921141446391e-7,1.1679787181502826e-8,-6.774678679897052e-4,-9.513665380458594e-7,1.1642596348323024e-8,-6.771004646386013e-4,-9.730261227384026e-7,1.163500954750871e-8,-6.767463032638174e-4,-9.096388229470013e-7,1.165635793010542e-8,-6.764335621130428e-4,-7.761178639860844e-7,1.170155308564171e-8,-6.761823408651586e-4,-5.962181208590508e-7,1.1762500661860506e-8,-6.76003339470729e-4,-3.9886548663780184e-7,1.1829366116277767e-8,-6.758971746004418e-4,-2.1465214616865e-7,1.189177429067364e-8,-6.75854349008327e-4,-7.229850977163453e-8,1.1940006997847552e-8,-6.758560464209218e-4,4.947983413017979e-9,1.1966210837941946e-8,-6.75876029123182e-4,2.7488136745964224e-9,1.196554475242547e-8,-6.758837935815457e-4,-8.161918553295126e-8,1.1937085753012027e-8,-6.758487615666738e-4,-2.3790708629766936e-7,1.1884286585775744e-8,-6.757450114730958e-4,-4.432901815565406e-7,1.1814847546413683e-8,-6.75555981832124e-4,-6.647221873892998e-7,1.1739927591423942e-8,-6.752785440219556e-4,-8.632714013106472e-7,1.1672680443195546e-8,-6.749257989924772e-4,-1.0003070529774613e-6,1.1626159710092367e-8,-6.745277736728225e-4,-1.04533785405786e-6,1.1610666373841045e-8,-6.74128768082691e-4,-9.849061499935828e-7,1.1630749295767326e-8,-6.737798662443241e-4,-8.306924641557072e-7,1.1682486866486084e-8,-6.735259935027122e-4,-6.231378273326227e-7,1.1752281613645974e-8,-6.733897881249691e-4,-4.257941722485988e-7,1.1818755484053001e-8,-6.733589931298577e-4,-3.0779861157673254e-7,1.185861347121806e-8,-6.733862647382449e-4,-3.189045445843042e-7,1.1855019353474524e-8,-6.734052719418553e-4,-4.6933352922082787e-7,1.1804407956455615e-8,-6.73356095178138e-4,-7.26669545411652e-7,1.1717608951207223e-8,-6.732058920007578e-4,-1.03135768079192e-6,1.1614681309859787e-8,-6.729549688437168e-4,-1.3203085634674708e-6,1.1516948301661333e-8,-6.726292231984343e-4,-1.5456410863813466e-6,1.1440629950089799e-8,-6.722669138054278e-4,-1.6825813512472906e-6,1.1394139323916218e-8,-6.719069745690607e-4,-1.728292691642922e-6,1.1378462534167964e-8,-6.715817867987357e-4,-1.6963310651301452e-6,1.1389032635968985e-8,-6.713140269531039e-4,-1.6104898771342205e-6,1.1417818254359392e-8,-6.711159576172181e-4,-1.4997911391117643e-6,1.1455027849828653e-8,-6.7098967808978e-4,-1.3947627025395655e-6,1.1490377166722129e-8,-6.709276170943395e-4,-1.3244157649111584e-6,1.1514110299334853e-8,-6.709132260466664e-4,-1.3133527174552276e-6,1.1517964713543777e-8,-6.709221924822578e-4,-1.3787160274900425e-6,1.1496180968261428e-8,-6.709246793383498e-4,-1.5271024239717297e-6,1.144652479963841e-8,-6.708890101922466e-4,-1.7521057789037506e-6,1.1371108056069637e-8,-6.707867329827515e-4,-2.03349427394575e-6,1.1276673671676083e-8,-6.705983390374779e-4,-2.3389296906621046e-6,1.1174033427878806e-8,-6.703183942720542e-4,-2.6286525837106187e-6,1.1076507144233978e-8,-6.699586275639561e-4,-2.862764821608109e-6,1.0997482902064068e-8,-6.695477636789244e-4,-3.009877260332382e-6,1.0947514998244096e-8,-6.691275106414471e-4,-3.0553669347500317e-6,1.093155672567259e-8,-6.687448110835039e-4,-3.0073333148598256e-6,1.0946969098039167e-8,-6.684411914721439e-4,-2.8982694801256994e-6,1.09829603567278e-8,-6.682410506419115e-4,-2.7805932569171573e-6,1.1022061743662119e-8,-6.681420923177971e-4,-2.7151112480580224e-6,1.1043947687668447e-8,-6.681122430425281e-4,-2.7538322953627776e-6,1.103115103055556e-8,-6.680967532338296e-4,-2.922229780866871e-6,1.0975005824736362e-8,-6.680351768836946e-4,-3.208938989025025e-6,1.0879155445024393e-8,-6.678818198079746e-4,-3.569206800689314e-6,1.07584697087957e-8,-6.676199799142348e-4,-3.941264216912157e-6,1.0633592515886972e-8,-6.672637124200508e-4,-4.26723863883779e-6,1.0523919613312888e-8,-6.668484745365341e-4,-4.508722102625259e-6,1.0442353880863865e-8,-6.664173881818245e-4,-4.652194081672177e-6,1.0393476953270497e-8,-6.660096559372878e-4,-4.705856726945458e-6,1.0374609216835914e-8,-6.6565400917304e-4,-4.692450116383464e-6,1.0378215067070535e-8,-6.65366691378365e-4,-4.641992506869934e-6,1.0394325668100645e-8,-6.651520724436302e-4,-4.586289293999795e-6,1.0412367136578511e-8,-6.650041770194664e-4,-4.555288303349263e-6,1.0422370733593156e-8,-6.649082145975189e-4,-4.574557922642622e-6,1.0415807035090087e-8,-6.648419516531094e-4,-4.663098319825658e-6,1.0386306849815094e-8,-6.647772977923628e-4,-4.830967209773467e-6,1.0330446811403125e-8,-6.64682793482468e-4,-5.0767082913095886e-6,1.0248610310513204e-8,-6.645276535009935e-4,-5.385272368662441e-6,1.014569716509483e-8,-6.642874935506787e-4,-5.727739295789978e-6,1.0031241672519338e-8,-6.639508926581502e-4,-6.064303841982294e-6,9.918438764338643e-9,-6.635248175263377e-4,-6.351327713612035e-6,9.821803180388749e-9,-6.630363208422775e-4,-6.551644593751551e-6,9.753736842483382e-9,-6.625286011154107e-4,-6.6453412099685115e-6,9.720943269391243e-9,-6.620515220562129e-4,-6.637210765563028e-6,9.721958663164957e-9,-6.616490030515382e-4,-6.557815458928014e-6,9.746799934408593e-9,-6.613470434299081e-4,-6.457206611119339e-6,9.779019488102298e-9,-6.611460182660693e-4,-6.3927400851426745e-6,9.799687434697574e-9,-6.610196289517972e-4,-6.414181155194645e-6,9.79227361540468e-9,-6.609211623926225e-4,-6.550090663171576e-6,9.747151909141079e-9,-6.607958578615187e-4,-6.799453044112043e-6,9.664428684028409e-9,-6.605961968829965e-4,-7.131600161094896e-6,9.554052462247139e-9,-6.602952658559864e-4,-7.495192731900008e-6,9.432897717263338e-9,-6.59893337291204e-4,-7.833471097170003e-6,9.319721647992294e-9,-6.594154199307799e-4,-8.10003951822256e-6,9.229912967892944e-9,-6.589015974741606e-4,-8.26940720505979e-6,9.171982193286219e-9,-6.583948475325114e-4,-8.339570999084169e-6,9.146702941363071e-9,-6.579310057521284e-4,-8.32782653290947e-6,9.1484953460235e-9,-6.575332522116057e-4,-8.26326332931551e-6,9.167892353553748e-9,-6.572109057110091e-4,-8.179301464685762e-6,9.193979644439203e-9,-6.569608894446945e-4,-8.108097437895046e-6,9.21621770862212e-9,-6.56770170806039e-4,-8.077049399664383e-6,9.225578151807406e-9,-6.566181353193237e-4,-8.106736580969876e-6,9.2152178288862e-9,-6.56478602741209e-4,-8.209430423295186e-6,9.18097422655523e-9,-6.563217982510564e-4,-8.387533414582957e-6,9.121895607077113e-9,-6.561169927829369e-4,-8.631800308226666e-6,9.04085550962115e-9,-6.558365936151278e-4,-8.91992576094595e-6,8.945052981019506e-9,-6.55462020900297e-4,-9.216878126763627e-6,8.845932484547084e-9,-6.549905970801155e-4,-9.47883318251498e-6,8.757896962005024e-9,-6.544410174747893e-4,-9.66200422791736e-6,8.695387849400742e-9,-6.538536905887626e-4,-9.73541782277881e-6,8.668667779698704e-9,-6.532830284212719e-4,-9.693338183562016e-6,8.679746644976681e-9,-6.527824423394355e-4,-9.561069012846983e-6,8.72050444633388e-9,-6.523874598641779e-4,-9.389804754378765e-6,8.77438033627454e-9,-6.521043283306284e-4,-9.24162630277522e-6,8.821227300503736e-9,-6.519088365606864e-4,-9.170835057503315e-6,8.843328210896267e-9,-6.517549256998489e-4,-9.20896440435165e-6,8.83024338053133e-9,-6.515887679402991e-4,-9.35797527614904e-6,8.781065819974303e-9,-6.513631828401716e-4,-9.592194273994584e-6,8.703882366870197e-9,-6.510485784423071e-4,-9.866901365965093e-6,8.613066195460134e-9,-6.506383852720353e-4,-1.0130449155765347e-5,8.525370284901691e-9,-6.501484713535216e-4,-1.0336665778532513e-5,8.455876704000505e-9,-6.496113485493177e-4,-1.0454609877589606e-5,8.414782975243667e-9,-6.490671674646127e-4,-1.0473577830441985e-5,8.405737418544261e-9,-6.485542315122563e-4,-1.0402716045749107e-5,8.42594207718587e-9,-6.48101570190052e-4,-1.0266290315339773e-5,8.467673384414735e-9,-6.477249772667448e-4,-1.0096801161149698e-5,8.520499798179897e-9,-6.474264817325805e-4,-9.928189624151298e-6,8.573469231980985e-9,-6.471962142913522e-4,-9.790591753984345e-6,8.616798727509629e-9,-6.470153398393853e-4,-9.707072173579713e-6,8.642931881769316e-9,-6.4685902944632e-4,-9.691946903899617e-6,8.647090904414083e-9,-6.466990567131604e-4,-9.749935634588221e-6,8.627569008879582e-9,-6.465061945891082e-4,-9.875497327061216e-6,8.585973740369635e-9,-6.462529770962636e-4,-1.005213254042066e-5,8.527489357020453e-9,-6.459175297868126e-4,-1.0252057697941712e-5,8.46101921967877e-9,-6.454888874271263e-4,-1.0437434177263124e-5,8.398808897746156e-9,-6.449732096697071e-4,-1.0564966265109888e-5,8.354946495019238e-9,-6.4439852831923e-4,-1.0595381812212404e-5,8.34225639995346e-9,-6.438138844513587e-4,-1.0507072144502154e-5,8.367854756241516e-9,-6.432790367365826e-4,-1.0308974899831868e-5,8.428993979308454e-9,-6.428454586197086e-4,-1.0044472629606271e-5,8.511840347096126e-9,-6.425364546618369e-4,-9.780404242463435e-6,8.595019151624936e-9,-6.423374992473061e-4,-9.584105091257316e-6,8.656940621566346e-9,-6.422025862017104e-4,-9.499924509528801e-6,8.683268961814048e-9,-6.420723318815535e-4,-9.536788226021915e-6,8.6709032555823e-9,-6.418937058551346e-4,-9.670339340684684e-6,8.62736165406817e-9,-6.416333150807353e-4,-9.854985606826542e-6,8.567021549391805e-9,-6.412819489618678e-4,-1.0038675384978085e-5,8.506456394204669e-9,-6.40852233208935e-4,-1.0175358821881159e-5,8.460459308358457e-9,-6.403723843214741e-4,-1.0233119886925515e-5,8.439407583253215e-9,-6.398785177155639e-4,-1.0197922583846564e-5,8.44800812947473e-9,-6.394070755339369e-4,-1.0073651943128085e-5,8.485229457435074e-9,-6.389883923031362e-4,-9.879211991447938e-6,8.545190825663756e-9,-6.386421940044092e-4,-9.643564938301254e-6,8.61872891621823e-9,-6.383754932638375e-4,-9.399866438278023e-6,8.695270282083074e-9,-6.381828126059341e-4,-9.179868626602678e-6,8.764629424150486e-9,-6.380482197594612e-4,-9.009455497870036e-6,8.818449463555083e-9,-6.379484020972791e-4,-8.905757191846968e-6,8.851137444227476e-9,-6.378559844764216e-4,-8.875794396678722e-6,8.860308373744816e-9,-6.37742611576723e-4,-8.916182840260416e-6,8.846890961194638e-9,-6.375817826161573e-4,-9.013389503892508e-6,8.815063136955268e-9,-6.373517365413405e-4,-9.144324590548281e-6,8.772088767448038e-9,-6.37038822435467e-4,-9.277480646007872e-6,8.727983133697308e-9,-6.366416476230471e-4,-9.375433709051482e-6,8.69473010267958e-9,-6.361755073060954e-4,-9.400076070259292e-6,8.68460137525384e-9,-6.356751215483993e-4,-9.321725715954837e-6,8.70721463674457e-9,-6.351921226563311e-4,-9.131431137281154e-6,8.765577089452952e-9,-6.34783668220924e-4,-8.851983055038034e-6,8.852573074499977e-9,-6.34492590110691e-4,-8.53933103808297e-6,8.950528563696693e-9,-6.343273922649219e-4,-8.26772377613986e-6,9.035920785086607e-9,-6.342551582389573e-4,-8.102013804904856e-6,9.088118007656425e-9,-6.342142013915741e-4,-8.071933386762328e-6,9.097504097485443e-9,-6.341394360266019e-4,-8.163387841999844e-6,9.06827899549311e-9,-6.339853162802021e-4,-8.329403778276332e-6,9.01508325066568e-9,-6.337359214736137e-4,-8.510810762680521e-6,8.956528860220945e-9,-6.334023030696212e-4,-8.65473815155575e-6,8.909374863487501e-9,-6.330132471509208e-4,-8.725202991217194e-6,8.885158614041552e-9,-6.326051717095914e-4,-8.706169178413972e-6,8.889176992237429e-9,-6.32214019748295e-4,-8.599843727994052e-6,8.920959050065301e-9,-6.318697327111989e-4,-8.422780448879686e-6,8.975440229886825e-9,-6.315928418750007e-4,-8.20125617049522e-6,9.044392176943476e-9,-6.313926873838825e-4,-7.966459175451952e-6,9.117945199759327e-9,-6.31267082506243e-4,-7.749777386235528e-6,9.186104282521891e-9,-6.312033160743475e-4,-7.5785372180136775e-6,9.240130028371382e-9,-6.311803126735913e-4,-7.472534294452365e-6,9.273661681811642e-9,-6.311716770969148e-4,-7.441681249593242e-6,9.283469414099118e-9,-6.311491861629334e-4,-7.484987837433047e-6,9.269772409499044e-9,-6.310862639818491e-4,-7.590780571477355e-6,9.236162458649285e-9,-6.309612058273856e-4,-7.737892241529536e-6,9.189230845951367e-9,-6.307601275839634e-4,-7.897660405035442e-6,9.137956611667645e-9,-6.304796987183105e-4,-8.036756534142556e-6,9.09284140190737e-9,-6.301296693209371e-4,-8.121168651637492e-6,9.064674114885852e-9,-6.297347052073675e-4,-8.122014010732786e-6,9.062695008476826e-9,-6.293340333682221e-4,-8.02357893613418e-6,9.092032490280441e-9,-6.289764922907992e-4,-7.832498886235678e-6,9.150771158405365e-9,-6.287088356458074e-4,-7.584313389584958e-6,9.227855564074418e-9,-6.285582300395714e-4,-7.340955663643736e-6,9.303857526237659e-9,-6.285162181702288e-4,-7.173981894358338e-6,9.35622506385365e-9,-6.28535844534191e-4,-7.137050918742098e-6,9.367918818323381e-9,-6.285482266619833e-4,-7.242236086511384e-6,9.334891322630107e-9,-6.284908233474023e-4,-7.4556587282647425e-6,9.267547066221383e-9,-6.28330425274692e-4,-7.714648020679488e-6,9.185435045716488e-9,-6.28069302206002e-4,-7.95377724697567e-6,9.109102634548203e-9,-6.277362671666278e-4,-8.124785819023314e-6,9.053825972438715e-9,-6.273721375619873e-4,-8.204270724462586e-6,9.02715680817319e-9,-6.27017398081553e-4,-8.191793049541557e-6,9.029461806338658e-9,-6.267047725449272e-4,-8.103665827061228e-6,9.055810702686439e-9,-6.26456043916988e-4,-7.966249400547607e-6,9.098033223137005e-9,-6.26281416479543e-4,-7.810389877515416e-6,9.146451274581206e-9,-6.261800463441795e-4,-7.667092566462788e-6,9.191260130576387e-9,-6.261411718711373e-4,-7.564004290537873e-6,9.223675064183579e-9,-6.261457836463466e-4,-7.522438367703082e-6,9.23690378724907e-9,-6.261689058554466e-4,-7.554911651594159e-6,9.226935824039986e-9,-6.26182575765119e-4,-7.663394769762143e-6,9.193084339014298e-9,-6.261594321595429e-4,-7.83867655737204e-6,9.138166390547462e-9,-6.26076519398364e-4,-8.061135092227624e-6,9.068247870454783e-9,-6.259188201018052e-4,-8.302926480673475e-6,8.991964522431026e-9,-6.256821123187454e-4,-8.531474630101965e-6,8.919455933728389e-9,-6.253747887567023e-4,-8.714062415411706e-6,8.860964423618094e-9,-6.250183114255093e-4,-8.823240323023451e-6,8.825167866103795e-9,-6.246458882436894e-4,-8.842823215536685e-6,8.817300503612222e-9,-6.242985755887415e-4,-8.774026346559433e-6,8.837199099376945e-9,-6.240177934968095e-4,-8.640273119230142e-6,8.87774343727035e-9,-6.238340168367981e-4,-8.487734929015043e-6,8.924628410892147e-9,-6.237537835039231e-4,-8.37786762163323e-6,8.958649435262117e-9,-6.237508622334895e-4,-8.370050553809897e-6,8.961109428361436e-9,-6.237694285501078e-4,-8.498608243715725e-6,8.921029687418638e-9,-6.237425116459058e-4,-8.75592709653261e-6,8.840509552635665e-9,-6.236182223750581e-4,-9.0935440897417e-6,8.734482255018053e-9,-6.233789176946422e-4,-9.44210315649724e-6,8.62453087546554e-9,-6.230431618178639e-4,-9.738006393072087e-6,8.530559779025655e-9,-6.226528415322329e-4,-9.942072412796151e-6,8.464944949980187e-9,-6.222558156538971e-4,-1.0044216892862036e-5,8.431044644216811e-9,-6.218928123420268e-4,-1.0057759649626142e-5,8.424931676993069e-9,-6.215911924046659e-4,-1.0010051523072495e-5,8.438260126232764e-9,-6.213639804945358e-4,-9.934048776771606e-6,8.460847692598394e-9,-6.212115296909202e-4,-9.862436775050359e-6,8.482499035264433e-9,-6.211238864357817e-4,-9.823973462843352e-6,8.494171700339035e-9,-6.210830596535341e-4,-9.841115150435778e-6,8.488757155704299e-9,-6.210651942122257e-4,-9.928215073960674e-6,8.461672312188594e-9,-6.210429443543682e-4,-1.0090001829574346e-5,8.411340895070526e-9,-6.209883936927952e-4,-1.032045635967511e-5,8.339532086435201e-9,-6.208766895726924e-4,-1.0602611237518307e-5,8.251410557946112e-9,-6.206901011511374e-4,-1.0909904384581257e-5,8.155117882712867e-9,-6.204217801816662e-4,-1.1209428967393452e-5,8.060785794006027e-9,-6.200783346355796e-4,-1.1467000570356854e-5,7.978999665257574e-9,-6.196803527606607e-4,-1.1653487857353938e-5,7.918867885019981e-9,-6.192602675084233e-4,-1.1751341629004252e-5,7.886009589301413e-9,-6.18857430993645e-4,-1.1760013081941588e-5,7.880853644284182e-9,-6.185107199373036e-4,-1.1698990162283051e-5,7.897639687734814e-9,-6.182494033759342e-4,-1.1607106693188978e-5,7.924550386176266e-9,-6.180837782626559e-4,-1.1536704553317361e-5,7.945441153139379e-9,-6.17998354061986e-4,-1.1541930108901036e-5,7.943422534415343e-9,-6.179514865732182e-4,-1.1662608663681637e-5,7.905878369024749e-9,-6.178847530264709e-4,-1.1908666705688085e-5,7.829382187794986e-9,-6.177413716940561e-4,-1.225291771545529e-5,7.722050838337925e-9,-6.174866683392963e-4,-1.2638281908291842e-5,7.601388082277714e-9,-6.171202061499132e-4,-1.2997807711744528e-5,7.488094639614473e-9,-6.166733164451345e-4,-1.3277552122048224e-5,7.398956214429256e-9,-6.161948260617495e-4,-1.3451111439177265e-5,7.342324255674225e-9,-6.157338992816079e-4,-1.3521276834735159e-5,7.317585667968248e-9,-6.153277910312762e-4,-1.351221220619276e-5,7.3175400954822244e-9,-6.149969832299286e-4,-1.345864223227892e-5,7.331678474457581e-9,-6.147459001310118e-4,-1.3396792379450818e-5,7.3489284361196675e-9,-6.14566195981989e-4,-1.335865891362545e-5,7.3594093806847335e-9,-6.144404163975216e-4,-1.3369061432935648e-5,7.3553652588823905e-9,-6.143451013492217e-4,-1.3444276092296466e-5,7.331624223806665e-9,-6.142533201726146e-4,-1.3591271145411236e-5,7.285864502738724e-9,-6.141370824533147e-4,-1.3807054893883965e-5,7.2188286363125555e-9,-6.139701752177742e-4,-1.4078197634895255e-5,7.134475176715785e-9,-6.137317622253945e-4,-1.4381127354302392e-5,7.03989660873347e-9,-6.13410548401449e-4,-1.4684067691371548e-5,6.944744457685035e-9,-6.130086364730966e-4,-1.4951295234998012e-5,6.8599511266353936e-9,-6.125436581487522e-4,-1.5149749237378634e-5,6.795727421966501e-9,-6.120476639627279e-4,-1.5256983677622905e-5,6.759136642679807e-9,-6.115619176413706e-4,-1.5268340231572266e-5,6.751886205597447e-9,-6.111281095430912e-4,-1.520077746265615e-5,6.769114447606619e-9,-6.107779587857513e-4,-1.5091461683002552e-5,6.799746818271109e-9,-6.10524015294988e-4,-1.4990666324170982e-5,6.828571027830531e-9,-6.103544553284269e-4,-1.4950126437351983e-5,6.839718154874809e-9,-6.10233932630094e-4,-1.5009403395997819e-5,6.820816675408024e-9,-6.101112797303565e-4,-1.5183860384006196e-5,6.7667449207401965e-9,-6.099330136988942e-4,-1.5458296216177136e-5,6.6817180549403645e-9,-6.096591780398321e-4,-1.5789545255279567e-5,6.578625916310926e-9,-6.092759401267423e-4,-1.611861496564348e-5,6.475384794437283e-9,-6.087995316766636e-4,-1.638857118742033e-5,6.389456320634693e-9,-6.082696917744599e-4,-1.656102986792536e-5,6.332762451172584e-9,-6.07735931357823e-4,-1.6624724248411486e-5,6.309028251969762e-9,-6.07243028636269e-4,-1.659408062376702e-5,6.314176973263146e-9,-6.068212130456064e-4,-1.6500688633924005e-5,6.3388763395423195e-9,-6.064828882107512e-4,-1.6382732655089433e-5,6.3716957047222936e-9,-6.062244250029457e-4,-1.6276375396916556e-5,6.401688363734559e-9,-6.060303124501623e-4,-1.6210566121514825e-5,6.41997117246288e-9,-6.058775295989655e-4,-1.6204774019256874e-5,6.420448907864246e-9,-6.057391575612956e-4,-1.6268443228459086e-5,6.400024095330046e-9,-6.055871563899351e-4,-1.640110876257458e-5,6.358597590462493e-9,-6.053947651586242e-4,-1.6592563064539658e-5,6.299040120511544e-9,-6.051391799853258e-4,-1.6823062293831563e-5,6.2271479239230684e-9,-6.04804958969757e-4,-1.7064185629920318e-5,6.15140407656365e-9,-6.043880305658054e-4,-1.7281339145854306e-5,6.082244629251485e-9,-6.038993664978827e-4,-1.743882255386278e-5,6.03054138334135e-9,-6.033664982363028e-4,-1.7507647128342022e-5,6.005236775662678e-9,-6.028306776843586e-4,-1.747471621344875e-5,6.0105545030052955e-9,-6.02338498179153e-4,-1.7350074414647643e-5,6.043785475000533e-9,-6.019293636463869e-4,-1.7168208077473955e-5,6.094852354472843e-9,-6.016229799273229e-4,-1.6981102965108023e-5,6.148328418570691e-9,-6.014120043088848e-4,-1.6844415703121967e-5,6.1875079574704055e-9,-6.012631542790681e-4,-1.6801491798937394e-5,6.199152357907398e-9,-6.011264926259588e-4,-1.687094638850435e-5,6.177250027198649e-9,-6.009494858060641e-4,-1.7041783355707502e-5,6.124605564008008e-9,-6.006912495843881e-4,-1.7277030403387907e-5,6.051910031149934e-9,-6.003329547922971e-4,-1.7524265175610315e-5,5.974701125327572e-9,-5.998817609412311e-4,-1.7729749635034893e-5,5.909152133979997e-9,-5.993674834698096e-4,-1.7852060415235455e-5,5.8679359897686786e-9,-5.98833377167506e-4,-1.7871308208750187e-5,5.857377281089162e-9,-5.983242961249349e-4,-1.7791603804934904e-5,5.876628602108236e-9,-5.978761089750183e-4,-1.763692721889734e-5,5.9188348328191164e-9,-5.97509246371083e-4,-1.744281060909608e-5,5.973566370425565e-9,-5.972272340443155e-4,-1.724717783696112e-5,6.029530158965291e-9,-5.970191412732754e-4,-1.708303930127975e-5,6.076760853223087e-9,-5.968639601907031e-4,-1.6974182393121108e-5,6.107949062772968e-9,-5.967351618909186e-4,-1.6933562355692315e-5,6.1189757620988596e-9,-5.966044914543551e-4,-1.6963408114122988e-5,6.108924653343465e-9,-5.964448552706594e-4,-1.7056054741231575e-5,6.079858424794432e-9,-5.962326779452772e-4,-1.719488339402509e-5,6.036551327657856e-9,-5.959503269411983e-4,-1.7355296242159556e-5,5.9862122504836265e-9,-5.955890709894159e-4,-1.7506243438176608e-5,5.9380510048463094e-9,-5.951525234145372e-4,-1.7613258416163484e-5,5.902393637339857e-9,-5.946596553230791e-4,-1.764400034962936e-5,5.889033529766786e-9,-5.941454005656148e-4,-1.757658081028564e-5,5.9047300999132285e-9,-5.936562505153676e-4,-1.740909145309199e-5,5.9503386560754e-9,-5.932393300043767e-4,-1.7166185049999746e-5,6.018820818675055e-9,-5.929270253618056e-4,-1.6897363809678338e-5,6.095715953083003e-9,-5.927235829331455e-4,-1.6664334583585255e-5,6.162832492505709e-9,-5.926012168281408e-4,-1.6521086061127168e-5,6.204080876826821e-9,-5.925088318791681e-4,-1.6495650783895652e-5,6.2108462578212325e-9,-5.923893296595289e-4,-1.6581983910685432e-5,6.18445634623603e-9,-5.921973240230338e-4,-1.6744373968298434e-5,6.135018198325406e-9,-5.919105305805832e-4,-1.6930486544110382e-5,6.077709827522491e-9,-5.915325837551485e-4,-1.708674963487434e-5,6.028320742756395e-9,-5.910887401414671e-4,-1.7171114333858196e-5,5.999481940305171e-9,-5.906173977802621e-4,-1.7160751663905477e-5,5.998318193545036e-9,-5.901602907269286e-4,-1.7054266849847147e-5,6.025679671747184e-9,-5.897536026274595e-4,-1.6869186278252847e-5,6.076768658723353e-9,-5.894215706944987e-4,-1.6636088071657184e-5,6.142787676934763e-9,-5.891734417193177e-4,-1.639112845867565e-5,6.21311247089221e-9,-5.890037891503861e-4,-1.616881901687457e-5,6.277444531418832e-9,-5.888953870874903e-4,-1.599649526801642e-5,6.32750261058349e-9,-5.888234156540204e-4,-1.5891120266408232e-5,6.358035497480615e-9,-5.887598278097893e-4,-1.585830828911002e-5,6.36716114540014e-9,-5.886770911880141e-4,-1.5892951435849457e-5,6.356201350362242e-9,-5.88551067772663e-4,-1.598065881617845e-5,6.329251478975357e-9,-5.883632730491481e-4,-1.609944079656462e-5,6.292675486505938e-9,-5.881029486085081e-4,-1.622153632414498e-5,6.254574948934901e-9,-5.877692932525501e-4,-1.6315735016464423e-5,6.224131558643309e-9,-5.873738337045345e-4,-1.6350916709415508e-5,6.2105932820424296e-9,-5.869421485315761e-4,-1.630165097021894e-5,6.221632150191717e-9,-5.865131121598357e-4,-1.6156063475258574e-5,6.261002414793579e-9,-5.861331744440621e-4,-1.592434760802166e-5,6.325989749491587e-9,-5.858441940187316e-4,-1.5643598634390996e-5,6.405942312898085e-9,-5.856671951075539e-4,-1.5373106219251778e-5,6.483607719282582e-9,-5.855897763285556e-4,-1.517729276675414e-5,6.540086767802591e-9,-5.855664407766135e-4,-1.5101743305100796e-5,6.561819413722951e-9,-5.855345304499817e-4,-1.5154956209859986e-5,6.545946710766161e-9,-5.854378007236991e-4,-1.5306366023333386e-5,6.500984799091855e-9,-5.852448952227367e-4,-1.550045098503084e-5,6.442830961710452e-9,-5.849551516575722e-4,-1.567734639813534e-5,6.388848412759949e-9,-5.845930082893017e-4,-1.5789777542943528e-5,6.352965558410412e-9,-5.841969678310368e-4,-1.5811729052473348e-5,6.343113417189745e-9,-5.838084552194186e-4,-1.5739511632880423e-5,6.360814546463471e-9,-5.834633032295308e-4,-1.5588003820527e-5,6.402145833924053e-9,-5.831864760835484e-4,-1.538472081382847e-5,6.4593502606737386e-9,-5.829896181558738e-4,-1.5163375096637597e-5,6.5226561160815544e-9,-5.828708999533577e-4,-1.4957769589611858e-5,6.582074977801076e-9,-5.828167555766546e-4,-1.479662672105976e-5,6.628984531476504e-9,-5.828049993600993e-4,-1.46998740108272e-5,6.657304486326205e-9,-5.828086784632086e-4,-1.4676619073704028e-5,6.664156600488167e-9,-5.828000486403008e-4,-1.472477456925716e-5,6.649997471487258e-9,-5.827541399829672e-4,-1.4832100153552331e-5,6.618295601842242e-9,-5.826515746817173e-4,-1.4978198357449995e-5,6.574915976578972e-9,-5.824806499688132e-4,-1.5136975222470618e-5,6.5273858129103555e-9,-0.00058223891266244855,-1.5279382997478107e-5,6.484113573877451e-9,-5.819343932522649e-4,-1.537659130322262e-5,6.453510098108357e-9,-5.815864337643335e-4,-1.540395190071223e-5,6.442875322162274e-9,-5.812255138914551e-4,-1.5346207013270155e-5,6.456887019322757e-9,-5.808906783087563e-4,-1.5203879326331496e-5,6.495696015125998e-9,-5.806227398257667e-4,-1.4999252917115385e-5,6.553106536171523e-9,-5.804523980144355e-4,-1.4778150938693694E-05,6.6159779015583296e-9,-5.803857787226134e-4,-1.460244790593015e-5,6.666344613112382e-9,-5.803949019080188e-4,-1.453107430828226e-5,6.68691651811743e-9,-5.804222577193308e-4,-1.4595598468279076e-5,6.6681996557004115e-9,-5.804015691477434e-4,-1.4784365571006996e-5,6.613182223466211e-9,-5.802844416075218e-4,-1.504659664064087e-5,6.536251455252701e-9,-5.800572407115345e-4,-1.5314205201811868e-5,6.456956105272316e-9,-5.79740462121484e-4,-1.5527257460748158e-5,6.392682319350163e-9,-5.793754455308698e-4,-1.564997575685766e-5,6.354031421288331e-9,-5.79008526869674e-4,-1.5673984575231003E-05,6.3438332685434564e-9,-5.786793595545836e-4,-1.561305703577987e-5,6.358555023821292e-9,-5.78414926698478e-4,-1.5494822966848187e-5,6.390561211013941e-9,-5.782279782895778e-4,-1.535291284406682e-5,6.430282529202295e-9,-5.781179986625985e-4,-1.5220866757312826e-5,6.467953037038186e-9,-5.780733038593612e-4,-1.5127728821522725e-5,6.494942808591026e-9,-5.780737214613339e-4,-1.5094878202343984e-5,6.5047765753731806e-9,-5.780937304323509e-4,-1.5133945325895573e-5,6.493829724860568e-9,-5.781059012122124e-4,-1.5245845768728994e-5,6.461654192249107e-9,-5.780844231366714e-4,-1.5420967008494582E-05,6.410916404303534e-9,-5.780084375089962e-4,-1.5640566187065733e-5,6.346952753693187e-9,-5.778647777628711e-4,-1.5879285361295647e-5,6.277008199105833e-9,-5.776498175490725e-4,-1.6108436934896513e-5,6.209288793870668e-9,-5.773703656839252e-4,-1.6299721111280603e-5,6.151931069035016e-9,-5.770436111533959e-4,-1.6429208290678547e-5,6.111913238799296e-9,-5.766960225533119e-4,-1.6481506020845262e-5,6.093889659946264e-9,-5.763608734161528e-4,-1.6454038016908552e-5,6.098936037071565e-9,-5.760736744361726e-4,-1.6361021724264736e-5,6.123317511020036e-9,-5.758647102549619e-4,-1.6235696451862072e-5,6.157725998483951e-9,-5.757488547335339e-4,-1.612803540234014e-5,6.1878352067051535e-9,-5.757153315080947e-4,-1.609480237938911e-5,6.197125012537102e-9,-5.757234435926061e-4,-1.6181340271018654e-5,6.17217305833007e-9,-5.757111211388329e-4,-1.6400971995423106e-5,6.108703432860775e-9,-5.756170143529824e-4,-1.6724228696811727e-5,6.014819069588441e-9,-5.754058752564376e-4,-1.7087730422599016e-5,5.908527015219574e-9,-5.750819117894468e-4,-1.7419566737748216e-5,5.810457691770534e-9,-5.746829127406637e-4,-1.7665934924859706e-5,5.736209930949652e-9,-5.742617293776332e-4,-1.7804887133825812e-5,5.692403621165638e-9,-5.738676244788915e-4,-1.7844643668928444e-5,5.677123312045796e-9,-5.735352118200017e-4,-1.781324586487339e-5,5.682774688163753e-9,-5.732813705044003e-4,-1.774712544477777e-5,5.699224028512855e-9,-5.731070706253558e-4,-1.7682465513048927e-5,5.716183635261324e-9,-5.730010810481334e-4,-1.7650014543434743e-5,5.7246996299768535e-9,-5.729437243720952e-4,-1.7672436560521165e-5,5.717992329661441e-9,-5.729101327422091e-4,-1.77629912703616e-5,5.691943387538161e-9,-5.728732254490138e-4,-1.7924881686606425e-5,5.645364913125561e-9,-5.728066872098459e-4,-1.8151183111504288e-5,5.580046983978404e-9,-5.726880446715707e-4,-1.8425518479711568e-5,5.500544376149344e-9,-5.725017360320156e-4,-1.8723776519021976e-5,5.4136497171616706e-9,-5.722417478110209e-4,-1.901709758465021e-5,5.327525281669176e-9,-5.719132058612187e-4,-1.9275973453983113e-5,5.250556794951275e-9,-5.715324599224961e-4,-1.9474966424702655e-5,5.190061549896955e-9,-5.711254487065863e-4,-1.9597425970417595e-5,5.150993130292952e-9,-5.707243215314012e-4,-1.963951786184574e-5,5.134796911166756e-9,-5.703624645452386e-4,-1.961289496480425e-5,5.138582384870229e-9,-5.700681701023597e-4,-1.9545349551733103e-5,5.154808129149603e-9,-5.698573617980196e-4,-1.947850234148492e-5,5.171796776237571e-9,-5.697265168248463e-4,-1.946126166119291e-5,5.175504776714801e-9,-5.696483046445741e-4,-1.9538307489946467e-5,5.152814866181088e-9,-5.695737447050487e-4,-1.9735023712205888e-5,5.095954657144991e-9,-5.694440581573207e-4,-2.0044122435153433e-5,5.006492424902162e-9,-5.692107976121244e-4,-2.0422259733411498e-5,4.896447185420986e-9,-5.688556702159739e-4,-2.080239735784011e-5,4.784807248298537e-9,-5.683984430252771e-4,-2.1118146298752406e-5,4.69055903235853e-9,-5.678877874524411e-4,-2.1327200844530532e-5,4.6259837892894646e-9,-5.673813072802742e-4,-2.1421699487486857e-5,4.593705379214873e-9,-5.669266461901139e-4,-2.1423333992840117e-5,4.588040913127525e-9,-5.665515251973581e-4,-2.1370168449335505e-5,4.598631280140418e-9,-5.66262954244887e-4,-2.1303510202976556e-5,4.614029495947506e-9,-5.660516519242294e-4,-2.1259150169743164e-5,4.624106881604416e-9,-5.658977760906469e-4,-2.1263246516499423e-5,4.621241923637268e-9,-5.657758344743934e-4,-2.1331262909287216e-5,4.600715978969188e-9,-5.656582879656547e-4,-2.146824690958318e-5,4.560744399958647e-9,-5.655182799852074e-4,-2.166944979816653e-5,4.502372881234427e-9,-5.653320939464026e-4,-2.19210611198664e-5,4.429288721729575e-9,-5.650817267772786e-4,-2.2201302733604196e-5,4.347494108741701e-9,-5.647576281566446e-4,-2.248238891148829e-5,4.2647329227178e-9,-5.64361175875774e-4,-2.273385814627313e-5,4.1895539317782425e-9,-5.639060211063388e-4,-2.2927360460003696e-5,4.129994037758887e-9,-5.634173669126164e-4,-2.3042324624474837e-5,4.092025805841426e-9,-5.629285951340259e-4,-2.3071330028784256e-5,4.078067292741761e-9,-5.624753358397186e-4,-2.3023652525244365e-5,4.085953126634584e-9,-5.620879235594856e-4,-2.2925599059856908e-5,4.1087412604200885e-9,-5.617838311213657e-4,-2.2816948292584702e-5,4.13556726191145e-9,-5.615618506350042e-4,-2.274366245931516e-5,4.1535543827756625e-9,-5.613996862607292e-4,-2.2747751693369897e-5,4.150602400752755e-9,-5.61256426475516e-4,-2.2855979724977274e-5,4.1186293748158945e-9,-5.61080812039059e-4,-2.307016575944345e-5,4.056477812301431e-9,-5.608247544560862e-4,-2.3362823347901296e-5,3.971353014138016e-9,-5.6045888275338e-4,-2.3681771753724775e-5,3.877666551810311e-9,-5.599840255643514e-4,-2.3964648029816697e-5,3.7929726560466655e-9,-5.594323224548366e-4,-2.4158896301923775e-5,3.732284697554104e-9,-5.588562140180068e-4,-2.4238382403495358e-5,3.7033386543166194e-9,-5.583104935056323e-4,-2.4208922097151482e-5,3.7049913841555217e-9,-5.578362118896362e-4,-2.4101634993633252e-5,3.729013562684922e-9,-5.574526700823866e-4,-2.395959922159319e-5,3.763717738012945e-9,-5.571580150477938e-4,-2.3824918225424018e-5,3.7974724057465164e-9,-5.56934945270612e-4,-2.3730431642789787e-5,3.820986693463586e-9,-5.567575402096818e-4,-2.369650431855389e-5,3.828264474037562e-9,-5.565968561839238e-4,-2.3731175634325677e-5,3.81667238499676e-9,-5.564247258473144e-4,-2.383170766272784e-5,3.786608603817477e-9,-5.562162343773809e-4,-2.3986308687498875e-5,3.741076017959136e-9,-5.559516320965893e-4,-2.41756410521933e-5,3.6852669334650524e-9,-5.556182989939095e-4,-2.4374329729557413e-5,3.626126257835752e-9,-5.552129829469255e-4,-2.455308708972398e-5,3.5717509128408136e-9,-5.547439478003086e-4,-2.4682169708976556e-5,3.5304410056635687e-9,-5.542320441001034e-4,-2.4736519034990855e-5,3.509299202176376e-9,-5.537093394875636e-4,-2.470209240070845e-5,3.5124945121858324e-9,-5.532141884717492e-4,-2.4581739735308707e-5,3.539625413001244e-9,-5.527827987017785e-4,-2.4398065123244182e-5,3.584874043486559e-9,-5.524392207026548e-4,-2.419093064879187e-5,3.6375935558350362E-09,-5.521871673866484e-4,-2.400904254983496e-5,3.6845003460724823e-9,-5.52006996859421e-4,-2.3897600320895216e-5,3.7129769442225496e-9,-5.518594417411545e-4,-2.3885806156130697e-5,3.714505319352247e-9,-5.516952472542898e-4,-2.3978206075858976e-5,3.6871706513466653e-9,-5.514680023266997e-4,-2.415252676916681e-5,3.636467576060659e-9,-5.511466570996784e-4,-2.436472997812125e-5,3.5741160763841065e-9,-5.507243054631822e-4,-2.456016575596165e-5,3.5151030037156743e-9,-5.502204943898792e-4,-2.4688078368491355e-5,3.4736716022299434e-9,-5.49675845316952e-4,-2.4715297420699776e-5,3.4594450841273604e-9,-5.491403496431156e-4,-2.4634524609268043e-5,3.475010754579904e-9,-5.486594079579832e-4,-2.4464309834586896e-5,3.5158016687115214e-9,-5.482626949453814e-4,-2.424130364105868e-5,3.572121989232335e-9,-5.479593003710058e-4,-2.400859263852101e-5,3.6322781071167195e-9,-5.477393924139225e-4,-2.380483572567349e-5,3.685543859039702e-9,-5.475800136344878e-4,-2.365734300350956e-5,3.7241138416981567e-9,-5.47451900115605e-4,-2.3579686113701558e-5,3.743864278401933e-9,-5.473251545092862e-4,-2.3572576485177517e-5,3.744220422532077e-9,-5.471730460260657e-4,-2.3626248739021626e-5,3.727569108803425e-9,-5.469742478632765e-4,-2.3723043848052887e-5,3.6985616396725427e-9,-5.467142469598954e-4,-2.3839630731377964e-5,3.6634824609621807e-9,-5.463866264206015e-4,-2.3948973655604125e-5,3.6296880385067596e-9,-5.4599456793534e-4,-2.4022629138410048e-5,3.604980769764583e-9,-5.455523444943196e-4,-2.4034135649642785e-5,3.5967054365603564e-9,-5.450858818683846e-4,-2.396401744104895e-5,3.6104037986387385e-9,-5.446308564687652e-4,-2.380610222496027e-5,3.648086038965713e-9,-5.442267710418497e-4,-2.3573376044700058e-5,3.7065940327411654e-9,-5.43906780201333e-4,-2.3300037015731352e-5,3.776970362392915e-9,-5.436858585814063e-4,-2.303631065445945e-5,3.8457757017923984e-9,-5.43552613478327e-4,-2.28353475000358e-5,3.898554409891338e-9,-5.434699258623914e-4,-2.2736277504907688e-5,3.924381501274142e-9,-5.433855832143338e-4,-2.275078970747129e-5,3.919540539705527e-9,-5.43248646299094e-4,-2.285936214945721e-5,3.888688548443496e-9,-5.430245801652687e-4,-2.3018194797770242e-5,3.8431759853901846e-9,-5.427037893107168e-4,-2.3172944399802506e-5,3.7974973736510936e-9,-5.423020260258028e-4,-2.3273629234107787e-5,3.765329016282113e-9,-5.418542195221602e-4,-2.328631805513169e-5,3.756319626683319e-9,-5.414045400541133e-4,-2.3199382210688513e-5,3.774257587440266e-9,-5.409955890221134e-4,-2.302384304625818e-5,3.8167930066406206e-9,-5.406592269132189e-4,-2.2788582348018324e-5,3.876564618794517e-9,-5.404109156371855e-4,-2.253214165155441e-5,3.943315026925249e-9,-5.402484736817223e-4,-2.2293496058127136e-5,4.00637464546443e-9,-5.401548723226671e-4,-2.210423231623976e-5,4.056855142789439e-9]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json
new file mode 100644
index 0000000..f56819c
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":7000,"numberOfSamples":1000,"samples":[-5.401035826582183e-4,-2.1983771746004456e-5,4.089071108861903e-9,-5.400645679375473e-4,-2.1937995914044596e-5,4.1010390739496695e-9,-5.400093979365809e-4,-2.1960549237341188e-5,4.094200825458988e-9,-5.399147607226752e-4,-2.203560775605646e-5,4.072680770337793e-9,-5.397644338651072e-4,-2.2140989396072942e-5,4.0424039620270295e-9,-5.395502643031555e-4,-2.2250959079911428e-5,4.010291455194114e-9,-5.392727708698771e-4,-2.233868896010399e-5,3.983582390762636e-9,-5.389417235021638e-4,-2.2378792834005243e-5,3.969178139964558e-9,-5.385766058145648e-4,-2.235055698671764e-5,3.972815745495291e-9,-5.382062428829531e-4,-2.2242365349685453e-5,3.9978965146973945e-9,-5.378662132655593e-4,-2.205712418011711e-5,4.043993326717811e-9,-5.375924932704364e-4,-2.181705877637256e-5,4.105479870305896e-9,-5.374109340395555e-4,-2.1564488189815053e-5,4.171221914461289e-9,-5.373252109046606e-4,-2.13546121672999e-5,4.226432351021938e-9,-5.373095626709229e-4,-2.123923851906108e-5,4.256999417283581e-9,-5.373130817418842e-4,-2.1246850964482913e-5,4.25485673473855e-9,-5.372765380678705e-4,-2.136960735856047e-5,4.221561718856039e-9,-5.371540300970259e-4,-2.156549994879516e-5,4.167859343731849e-9,-5.36928145915775e-4,-2.177449463181616e-5,4.109507993256763e-9,-5.36612298142394e-4,-2.193926959851254e-5,4.061836554881471e-9,-5.362421974391817e-4,-2.202084762893932e-5,4.035594559950374e-9,-5.358628658080441e-4,-2.200502185841941e-5,4.035163172736923e-9,-5.355167351147426e-4,-2.1900830823744038e-5,4.058798324504693e-9,-5.35235449411885e-4,-2.173439788390032e-5,4.100071676730384e-9,-5.350357193602122e-4,-2.15410881740401e-5,4.14980207032798e-9,-5.349185757880749e-4,-2.135782693181579e-5,4.198050291539687e-9,-5.348712290073628e-4,-2.121657442592248e-5,4.2359280087428855e-9,-5.348708000481933e-4,-2.1139615342117445e-5,4.257004944159546e-9,-5.348890826615417e-4,-2.113709309176623e-5,4.258128208977309e-9,-5.348974104172614e-4,-2.1206799246401138e-5,4.239584522007182e-9,-5.348708384321045e-4,-2.1335822917691524e-5,4.204678615706449e-9,-5.347911231697716e-4,-2.1503424398811796e-5,4.158913513206647e-9,-5.346483663470459e-4,-2.1684383203511062e-5,4.109023325019758e-9,-5.344415971986584e-4,-2.185222293312799e-5,4.062070768370815e-9,-5.341787121227865e-4,-2.198213649495927e-5,4.024683100836483e-9,-5.338760303296781e-4,-2.2053786749643512e-5,4.002365575691231e-9,-5.335574557412858e-4,-2.2054309116071213e-5,3.998758028608726e-9,-5.332528017860458e-4,-2.198181627770456e-5,4.014702338546216e-9,-5.32994271803446e-4,-2.1849184863030615e-5,4.047158626760407e-9,-5.328099775273082e-4,-2.1686695872980368E-05,4.088373074123842e-9,-5.327143982259301e-4,-2.1540670747909262e-5,4.1261167888255816e-9,-5.326982547305342e-4,-2.146472539588816e-5,4.145954976805639e-9,-5.327237676269208e-4,-2.150269819024173e-5,4.135827219007261e-9,-5.32732172820136e-4,-2.166880035547954e-5,4.091442962833996e-9,-5.32664363807273e-4,-2.193675634261866e-5,4.019307535221708e-9,-5.324850262715923e-4,-2.2247356034033065e-5,3.93482109123221e-9,-5.321959712692641e-4,-2.253169043764306e-5,3.856170494966331e-9,-5.318318024819819e-4,-2.2736299986202895e-5,3.797697407775919e-9,-5.314434001136979e-4,-2.283727543038531e-5,3.7661716224598815e-9,-5.310801862783224e-4,-2.2840328090950416e-5,3.760701663621395e-9,-5.307784695622606e-4,-2.277209911293882e-5,3.774865010501329e-9,-5.305570300482153e-4,-2.2669296597542187e-5,3.799377675031908e-9,-5.304177923198672e-4,-2.2569563199808032e-5,3.824373068544768e-9,-5.303490345079164e-4,-2.2505211219014473e-5,3.841055895162692e-9,-5.303294436667859e-4,-2.2499458669989806e-5,3.842819986704146e-9,-5.303323047521583e-4,-2.2564506861846283e-5,3.825934653411622e-9,-5.303295770130921e-4,-2.2701095439328812e-5,3.78981094362531e-9,-5.302956400451363e-4,-2.2899349303107257e-5,3.736840685640963e-9,-5.30210473665667e-4,-2.314073527658426e-5,3.6718507329490764e-9,-5.300620142371433e-4,-2.340093393614476e-5,3.601265981895817e-9,-5.298474349228372e-4,-2.3653284469214588e-5,3.532132956929273e-9,-5.29573308984056e-4,-2.3872320401723e-5,3.4711768964710575e-9,-5.292548431176042e-4,-2.403707365259649e-5,3.4239812057610383e-9,-5.289143407918906e-4,-2.4134058857944783e-5,3.3942741989696835e-9,-5.285789266630395e-4,-2.4159906281443744e-5,3.3832709646259577e-9,-5.282773952237134e-4,-2.4123609199085298e-5,3.389033411558258e-9,-5.280357364388392e-4,-2.404808982327215e-5,3.4059246595776906e-9,-5.278708810726782e-4,-2.3969949940549298e-5,3.4245089739342943e-9,-5.277831391864141e-4,-2.3935357712190903e-5,3.4325187746853774e-9,-5.277497546540487e-4,-2.3990053843999665e-5,3.417490568679712e-9,-5.277243373408124e-4,-2.416362760309801e-5,3.371043381811958e-9,-5.276472969010053e-4,-2.4453303594010498e-5,3.2933522318209953e-9,-5.274672038760931e-4,-2.4817592116745615e-5,3.1949762152372857e-9,-5.271634422555336e-4,-2.5188059386224728e-5,3.0937979755767632e-9,-5.267559068389037e-4,-2.549567899523349e-5,3.008057415556971e-9,-5.262952781608044e-4,-2.569664316277229e-5,2.9495561606916857e-9,-5.258412694183832e-4,-2.5783493066863733e-5,2.9207489680924703e-9,-5.254425066389419e-4,-2.5779503885456728e-5,2.9161612247094987e-9,-5.251263833011977e-4,-2.5724489785007588e-5,2.925940256027055e-9,-5.248986095698239e-4,-2.566102959629115e-5,2.9392604634341714e-9,-5.247480432907525e-4,-2.5625368004893986e-5,2.946595015690205e-9,-5.246528338231885e-4,-2.5643091786020372e-5,2.940887498147975e-9,-5.245858121778989e-4,-2.572797628618578e-5,2.918009092055048e-9,-5.245186697908287e-4,-2.5882406676612352e-5,2.8768303754599108e-9,-5.244252403009383e-4,-2.6098529986454154e-5,2.8190430572214277e-9,-5.242842104460674e-4,-2.6359918036558112e-5,2.748752781998075e-9,-5.240813809095547e-4,-2.664376012583758e-5,2.6718566779627634e-9,-5.23811405473642e-4,-2.6923697743507696e-5,2.5952305181850944e-9,-5.234786998958045e-4,-2.7173303690041893e-5,2.5257824612885647e-9,-5.230971720563157e-4,-2.7369871435687406e-5,2.4694878843742183e-9,-5.226886747385083e-4,-2.749801736194075e-5,2.4305157487672832e-9,-5.222802740203602e-4,-2.7552679878417226e-5,2.410501767346455e-9,-5.219004721067165e-4,-2.7541114744677728e-5,2.4080150610133087e-9,-5.215746064004773e-4,-2.748348611429587e-5,2.4182963593044943e-9,-5.213196916609409e-4,-2.741169261001642e-5,2.433387542607336e-9,-5.211390633776294e-4,-2.7365830864708946e-5,2.442883976030173e-9,-5.210177939670833e-4,-2.7387386588784694e-5,2.4356382416405185e-9,-5.2092103264559e-4,-2.7508753633437043e-5,2.4025749182162106e-9,-5.207983793056417e-4,-2.7740648686792387e-5,2.3401865242185253e-9,-5.205966266482828e-4,-2.806223642295004e-5,2.253350576167634e-9,-5.202789824851698e-4,-2.8421269302758358e-5,2.1554312055901617e-9,-5.198423209709797e-4,-2.8748981292602243e-5,2.064380772209385e-9,-5.193213569961983e-4,-2.8985277857182498e-5,1.996093068377223e-9,-5.187754286828383e-4,-2.9100856801229018e-5,1.95860814721846e-9,-5.182654734879904e-4,-2.910408008464851e-5,1.950328402209735e-9,-5.17834468885133e-4,-2.903146570281326e-5,1.9624204795998646e-9,-5.174994717055985e-4,-2.8930642345991606e-5,1.9830589980046977e-9,-5.172543344144145e-4,-2.8845521813800735e-5,2.0010793286060667e-9,-5.170775031307184e-4,-2.8808046397317225e-5,2.0080420772500573e-9,-5.169400421587481e-4,-2.883586587420426e-5,1.998918998843043e-9,-5.168116638617822e-4,-2.8933416322078027e-5,1.9719933681402133e-9,-5.166645952694134e-4,-2.9094191480639365e-5,1.928446821526537e-9,-5.16476024252827e-4,-2.930309443473024e-5,1.8718459878098334e-9,-5.162298604848831e-4,-2.9538674218475745e-5,1.8075644448687839e-9,-5.15918183163581e-4,-2.9775463189840496e-5,1.7421226458261029e-9,-5.155423951219354e-4,-2.9986754143992856e-5,1.682415416929058e-9,-5.151137407302886e-4,-3.0148054298078004e-5,1.6348102041026057e-9,-5.14652612618079e-4,-3.024103796625174e-5,1.6041685250154395e-9,-5.141862173715009e-4,-3.025736743569097e-5,1.5929194416540232e-9,-5.137445594032925e-4,-3.0201544061071227e-5,1.6003442662174793e-9,-5.133551073665073e-4,-3.0091913298744713e-5,1.6222546448333353e-9,-5.130369284461957e-4,-2.9959105712960137e-5,1.651244127376648e-9,-5.127954099507898e-4,-2.9841663506552026e-5,1.6776263789056898e-9,-5.126187743607301e-4,-2.977911818282605e-5,1.6910763709352394e-9,-5.124775920139699e-4,-2.980317215645477e-5,1.6828919402962205e-9,-5.123285291058596e-4,-2.992827896807966e-5,1.6485704768880652e-9,-5.121232184702717e-4,-3.0144080674584436e-5,1.5900146804836555e-9,-5.118216874803194e-4,-3.041333535976552e-5,1.5163090868023582e-9,-5.114069216089788e-4,-3.06788578426189e-5,1.4420450362417905e-9,-5.108941341159282e-4,-3.087997193374652e-5,1.383045829244638e-9,-5.103283884814538e-4,-3.097314754523197e-5,1.350950290890561e-9,-5.097696659935665e-4,-3.0946985077149386e-5,1.3492802047218747e-9,-5.092722871601308e-4,-3.0823751756630565e-5,1.3729826486285837e-9,-5.088689790088103e-4,-3.064783528784369e-5,1.4112787115572115e-9,-5.085657929059659e-4,-3.046880866802487e-5,1.4518356546063253e-9,-5.08346811352875e-4,-3.032757248561428e-5,1.4841879987672864e-9,-5.081833205273989e-4,-3.024951848205968e-5,1.5014927928567059e-9,-5.080425577921641e-4,-3.024389232124672e-5,1.5008319918093534e-9,-5.078937898414977e-4,-3.0306504584070308e-5,1.4827093655212703e-9,-5.077117106050379e-4,-3.042331137863873e-5,1.4502784815439696e-9,-5.074781087294359e-4,-3.0573627604291196e-5,1.4085697181512755e-9,-5.071827632231985e-4,-3.0732762305829554e-5,1.363783212066794e-9,-5.068241386956512e-4,-3.087440447664662e-5,1.322616276444108e-9,-5.064099743494193e-4,-3.097328317084115e-5,1.2915471371343079e-9,-5.059573813360568e-4,-3.100850766576199e-5,1.2759963019804067e-9,-5.054917280931815e-4,-3.09675266499804e-5,1.2793674539120017e-9,-5.050436028710859e-4,-3.085000943630236e-5,1.3021016279347987e-9,-5.046435847782699e-4,-3.067039629349787e-5,1.3410151010863194e-9,-5.043154041700915e-4,-3.0457621016956392e-5,1.3892739397176436e-9,-5.040690924503929e-4,-3.025093383015183e-5,1.4372920683562972e-9,-5.038963498673596e-4,-3.0091976510982597e-5,1.4745708467378526e-9,-5.037701041335682e-4,-3.001474285367648e-5,1.4921523724764496e-9,-5.036491510419384e-4,-3.0036038672483e-5,1.4850891219563646e-9,-5.034873278369172e-4,-3.0149240525066758e-5,1.4542250103523055e-9,-5.032453132593057e-4,-3.032361586041559e-5,1.4066373962624775e-9,-5.029021178492986e-4,-3.0510322165871625e-5,1.3543382658568904e-9,-5.024627404979756e-4,-3.06545113386691e-5,1.3112907864465489e-9,-5.01958677253733e-4,-3.0710749963624354e-5,1.2894420761309303e-9,-5.014397693770699e-4,-3.065674386674007e-5,1.2951067361437504e-9,-5.009594637119274e-4,-3.0499774007028698e-5,1.327181960804589e-9,-5.005591265624038e-4,-3.027289359707675e-5,1.3779593095465411e-9,-5.002577464773517e-4,-3.002286754188913e-5,1.4360302437884732e-9,-5.000502980916162e-4,-2.9795642680252517e-5,1.4898545010720947e-9,-4.999135018056022e-4,-2.96252177016554e-5,1.530564984614016e-9,-4.998148703059288e-4,-2.9528734833433275e-5,1.5533180663703762e-9,-4.997210391324866e-4,-2.9507108813167577e-5,1.557313949211449e-9,-4.996033580441727e-4,-2.95486805281199e-5,1.5450349761472517e-9,-4.994407134467235e-4,-2.963354086042027e-5,1.5212284427432084e-9,-4.99220513807549e-4,-2.9737275227078863e-5,1.4919412361183264e-9,-4.989388300780407e-4,-2.9833867578447486e-5,1.4637165471569636e-9,-4.986003615032496e-4,-2.989808300652266e-5,1.442933990607473e-9,-4.982184149831263e-4,-2.9907927865987277e-5,1.4351810441446417e-9,-4.978145252172193e-4,-2.9847712851288548e-5,1.4445248582206659e-9,-4.974169169914042e-4,-2.971176155615385e-5,1.4726359068551763e-9,-4.970569165391165e-4,-2.9508056286774713e-5,1.517893845763169e-9,-4.967628303390822e-4,-2.926026998042455e-5,1.574829976621728e-9,-4.96551978398408e-4,-2.900608455871382e-5,1.634431128285346e-9,-4.96423302209712e-4,-2.879027553840682e-5,1.6857146709917446e-9,-4.963541060645736e-4,-2.865323310167557e-5,1.7184681499924557e-9,-4.963036761354488e-4,-2.861842652841363e-5,1.7263462753477494e-9,-4.962236841992082e-4,-2.8683800491744274e-5,1.7091218148852898e-9,-4.960720233794146e-4,-2.8820919804120417e-5,1.673117417745899e-9,-4.958250916601518e-4,-2.898244031513813e-5,1.6295915726764063e-9,-4.954843911405692e-4,-2.911516518981793e-5,1.591663143962164e-9,-4.950757567029083e-4,-2.9174289607850693e-5,1.5708062654753593e-9,-4.946419883627445e-4,-2.9134683182893188e-5,1.5739443674704452e-9,-4.942313197632331e-4,-2.899634780038582e-5,1.601897900139963e-9,-4.938850760519116e-4,-2.8782878175581034e-5,1.6495407345080696e-9,-4.936280480341194e-4,-2.8533738897703263e-5,1.707525662802973e-9,-4.934641902772148e-4,-2.8293088750190768e-5,1.7649546067683797e-9,-4.933783032088761e-4,-2.80988640410467e-5,1.8121051613246878e-9,-4.933422254005704e-4,-2.7975289802310766e-5,1.8424210940995162e-9,-4.933227875226166e-4,-2.793022331205908e-5,1.853363241919422e-9,-4.932888738289174e-4,-2.7956735636432285e-5,1.8461872237371115e-9,-4.932160962554518e-4,-2.8037116641906087e-5,1.8250326211687373e-9,-4.930889594766327e-4,-2.8147435486230603e-5,1.7957702854856959e-9,-4.929012427190119e-4,-2.8261502965497104e-5,1.7649326447086253e-9,-4.926554961798312e-4,-2.835390391705434e-5,1.7388763334173934e-9,-4.923623095573031e-4,-2.8402349479687208e-5,1.7231683216680764e-9,-4.920395867133475e-4,-2.8389889647024718e-5,1.722073563894763e-9,-4.917115540492151e-4,-2.8307497965287012e-5,1.7379836944677346e-9,-4.914067695061618e-4,-2.815714883271202e-5,1.7707008124423624e-9,-4.911541935152892e-4,-2.7954758530073625e-5,1.8166878141640076e-9,-4.9097673506944e-4,-2.773135265619518e-5,1.868683014872907e-9,-4.908829819257416e-4,-2.753002578310636e-5,1.9163130986412e-9,-4.908600342594571e-4,-2.7396792960745575e-5,1.9482274136412787e-9,-4.908721173909682e-4,-2.736633164669827e-5,1.9555585722015448e-9,-4.908685218729858e-4,-2.7447945016454782e-5,1.935427847646306e-9,-4.907995565142859e-4,-2.7619289411182313e-5,1.8926347984558103e-9,-4.906336832509187e-4,-2.7832348344015255e-5,1.8383867655335314e-9,-4.903676923646972e-4,-2.802925951189207e-5,1.7865984348223615e-9,-4.900260027571856e-4,-2.81603898676814e-5,1.7495716625922467e-9,-4.89651135545775e-4,-2.8197278587712897e-5,1.7348223698973235e-9,-4.892906052692192e-4,-2.8137212384925217e-5,1.7438257478064728e-9,-4.889850187707911e-4,-2.800028120231637e-5,1.7725003438639047e-9,-4.887600631930353e-4,-2.782169608840279e-5,1.8128296668897378e-9,-4.886231415493295e-4,-2.764229676123075e-5,1.8550063239660704e-9,-4.885642484701803e-4,-2.7499550273375093e-5,1.8896080581632753e-9,-4.88560103003217e-4,-2.7420633789239168e-5,1.9094190965771907e-9,-4.885802098906471e-4,-2.741859369588705e-5,1.9105887095828677e-9,-4.885932963466409e-4,-2.749186494528233e-5,1.892958847920264e-9,-4.885727070221833e-4,-2.7626586385723848e-5,1.8596151082628022e-9,-4.884999125827284e-4,-2.780056601507957e-5,1.815912403162441e-9,-4.883659918181414e-4,-2.7987688626019622e-5,1.7683031663824352e-9,-4.881714965792303e-4,-2.8161857991136438e-5,1.7232621331153711e-9,-4.879253817230721e-4,-2.8300053385778088e-5,1.6864793191295907e-9,-4.876435954604153e-4,-2.838460913858599e-5,1.6623231380987314e-9,-4.87347570898538e-4,-2.8405127125376862e-5,1.6534487206287574e-9,-4.870624676766653e-4,-2.8360400428380635e-5,1.660397458157364e-9,-4.8681464921107224e-4,-2.8260451760282097e-5,1.6810999234867354e-9,-4.8662762504571956e-4,-2.8128194590838857e-5,1.710378936760407e-9,-4.865159493111669e-4,-2.7999259061439134e-5,1.7398402884595435e-9,-4.864778001628795e-4,-2.7917688216241995e-5,1.758782346831438e-9,-4.864891773662556e-4,-2.7925623648319725e-5,1.7566564873211407e-9,-4.8650469881442816e-4,-2.8048055389582203e-5,1.7268436941845679e-9,-4.8646900022718986e-4,-2.8278862045047066e-5,1.6701987909042514e-9,-4.863366661408441e-4,-2.8577505119019685e-5,1.596014686119699e-9,-4.8609095859314307e-4,-2.888149066944309e-5,1.5191180487893385e-9,-4.8575031131327785e-4,-2.9129303897496962e-5,1.4543917377772392e-9,-4.853594628443761e-4,-2.928127077721007e-5,1.4117786999065398e-9,-4.8497195747729835e-4,-2.932864068445588e-5,1.394071849831376e-9,-4.846337505125269e-4,-2.92901557766113e-5,1.397598481510503e-9,-4.8437354423659196e-4,-2.9201624636557654e-5,1.4144787727407432e-9,-4.842002284292061e-4,-2.9104393029698005e-5,1.4351477859261177e-9,-4.841052181270292e-4,-2.903609161431683e-5,1.4504558263885193e-9,-4.84067228217977e-4,-2.9024670479161186e-5,1.4531643834621424e-9,-4.840577748119623e-4,-2.90853939257728e-5,1.438879930124667e-9,-4.8404655015113853e-4,-2.9220176531956694e-5,1.4064663055144139e-9,-4.840061936266715e-4,-2.9418854952069273e-5,1.3579222509944927e-9,-4.839159970403585e-4,-2.9661986241126522e-5,1.2977592972372048e-9,-4.8376421255598803e-4,-2.99245694584744e-5,1.2320364517035848e-9,-4.8354887698368103e-4,-3.0180063885511402e-5,1.1672683012708056e-9,-4.832772700501507e-4,-3.0404142004948953e-5,1.1094257627540442e-9,-4.829643557323166e-4,-3.0577722626730395e-5,1.06319106972272e-9,-4.826306810340864e-4,-3.068915192762852e-5,1.0314937573263063e-9,-4.823000236618913e-4,-3.073572511170575e-5,1.0152261736262526e-9,-4.819967854440488e-4,-3.07247596187981e-5,1.0130129991719876e-9,-4.8174290438235536e-4,-3.067424662353938e-5,1.0209817846856487e-9,-4.8155387647187757e-4,-3.061273027346073e-5,1.032629336411569e-9,-4.814336608023644e-4,-3.057734555154527e-5,1.0391143981355627e-9,-4.813692597631775e-4,-3.060832201910778e-5,1.0304832601707698e-9,-4.813275459614071e-4,-3.073869463472397e-5,9.981998565152625e-10,-4.812585659790297e-4,-3.09804507134622e-5,9.386721541243323e-10,-4.811087866201458e-4,-3.1312961751180574e-5,8.56262021686922e-10,-4.8084200197442165e-4,-3.168291882514008e-5,7.634346976835111e-10,-4.804573453938174e-4,-3.202098523525012e-5,6.767668830172286e-10,-4.799919742448245e-4,-3.226863232885468e-5,6.104833504614054e-10,-4.7950561722214457e-4,-3.239963129412474e-5,5.713324640502453e-10,-4.7905711130771735e-4,-3.2424683834516966e-5,5.57489239643948e-10,-4.7868648919253005e-4,-3.2380572165611614e-5,5.61014998658449e-10,-4.78408756745913e-4,-3.231372536823076e-5,5.715060758294507e-10,-0.00047821695541208484,-3.226672810540936e-5,5.790543339561175e-10,-4.780892929635116e-4,-3.2270696159169436e-5,5.759797425532569e-10,-4.7799654019284706e-4,-3.2342694027153804e-5,5.575709307492149e-10,-4.7790798337904856e-4,-3.2486240286347094e-5,5.222191413059654e-10,-4.7779572256916394e-4,-3.269322339193252e-5,4.712137846897875e-10,-4.776377532430203e-4,-3.294643314889626e-5,4.0828191455557877e-10,-4.7742011900052996e-4,-3.322255415686779e-5,3.3887550315425643e-10,-4.7713813362436103e-4,-3.3495522236272236e-5,2.692723543611399e-10,-4.767966058786844e-4,-3.374005506219493e-5,2.0561845121165476e-10,-4.764089810761079e-4,-3.3935100660724256e-5,1.5304719488686107e-10,-4.759953978571277e-4,-3.4066794130658526e-5,1.150012473363178e-10,-4.75579914293648e-4,-3.4130529894258694e-5,9.281539758685568e-11,-4.7518726401693057e-4,-3.4132012358599385e-5,8.552166664277137e-11,-4.7483937947707337e-4,-3.4087283256587925e-5,8.9808001360197e-11,-4.745518134530909e-4,-3.402168289331611e-5,1.0012352749726892e-10,-4.743301302744044e-4,-3.396758918434555e-5,1.0901384685598315e-10,-4.7416643965561046e-4,-3.3960444197777966e-5,1.0790405985855532e-10,-4.740368979791793e-4,-3.4032281179469596e-5,8.86169595898152e-11,-4.739021227586955e-4,-3.420250408423377e-5,4.5725881072999446e-11,-4.7371326042227083e-4,-3.446757033559661e-5,-2.0710561717845824e-11,-4.734254927457585e-4,-3.479429725681101e-5,-1.0330249928567228e-10,-4.7301639236006836e-4,-3.5123672220509924e-5,-1.881476569178234e-10,-4.725000431178112e-4,-3.5388839961071916e-5,-2.591876480176443e-10,-4.7192604541348076e-4,-3.554105374407855e-5,-3.044707002743182e-10,-4.7136099969806975e-4,-3.556883779945993e-5,-3.206993534357789e-10,-4.7086294225468346e-4,-3.549888047725581e-5,-3.1342792392102554e-10,-4.7046352272326177e-4,-3.538050951555742e-5,-2.935213287305637e-10,-4.7016473226171217e-4,-3.5265590743997314e-5,-2.726806915020762e-10,-4.699464136836216e-4,-3.5194260656001715e-5,-2.6030955535709985e-10,-4.697770469616606e-4,-3.518932915329649e-5,-2.622205939252974e-10,-4.696228012465099e-4,-3.5256920462369833e-5,-2.8060094716625834e-10,-4.6945333703288087e-4,-3.538992906669341e-5,-3.145484253008059e-10,-4.69244867902677e-4,-3.5571919634512485e-5,-3.607624652693146e-10,-4.6898164086817774e-4,-3.5780529452895425e-5,-4.1425452821863957e-10,-4.686566863176195e-4,-3.5990449974228233e-5,-4.690962154934373e-10,-4.6827208786035787e-4,-3.617631589754077e-5,-5.192139267408718e-10,-4.678386863652773e-4,-3.631568320727738e-5,-5.591870571551936e-10,-4.6737497335989225e-4,-3.6392083291211825e-5,-5.849904896303589e-10,-4.6690488301707415e-4,-3.639782201853782e-5,-5.94602599597509e-10,-4.6645445102384944e-4,-3.633592139146378e-5,-5.883906819014525e-10,-4.660476945176547e-4,-3.6220661871468307e-5,-5.692228942796334e-10,-4.657022695838701e-4,-3.6076407131886816e-5,-5.422815071321678e-10,-4.6542554666657507e-4,-3.5934607127357874e-5,-5.145430862929582e-10,-4.6521176990474016e-4,-3.582914597600692e-5,-4.93889587145379e-10,-4.650408921003716e-4,-3.579037660247443e-5,-4.878228226654467e-10,-4.6487973809540686e-4,-3.583822677071e-5,-5.017887049330647e-10,-4.646864289969452e-4,-3.5975183793548686e-5,-5.37296846788472e-10,-4.64418929535433e-4,-3.618107017587765e-5,-5.903807450996709e-10,-4.640473748557744e-4,-3.641280549063968e-5,-6.513004445318026e-10,-4.6356706963375163e-4,-3.6612571972860786e-5,-7.064066461510136e-10,-4.6300573393137634e-4,-3.672503075757567e-5,-7.42296675743031e-10,-4.624182914159778e-4,-3.671797163766815e-5,-7.508047679955584e-10,-4.6186855565977626e-4,-3.659550128472903e-5,-7.321670756526646e-10,-4.614064225580401e-4,-3.6395389241618036e-5,-6.944563282812404e-10,-4.610528332327597e-4,-3.6172385710832e-5,-6.498299076742612e-10,-4.607987283925611e-4,-3.597801715887471e-5,-6.100320374056605e-10,-4.6061468507508637e-4,-3.5846959612404006e-5,-5.833503649471653e-10,-4.6046349004600013e-4,-3.579313229929127e-5,-5.736387227312834e-10,-4.6030994274539054e-4,-3.5812705095171745e-5,-5.807834219497946e-10,-4.601262422144594e-4,-3.588972134772124e-5,-6.017486078129592e-10,-4.5989390505752053e-4,-3.600142119002202e-5,-6.316505581854882e-10,-4.596038614192552e-4,-3.61222398339944e-5,-6.646706362294414e-10,-4.592559568531993e-4,-3.6226694452753686e-5,-6.948193567656552e-10,-4.5885834703375316e-4,-3.629175808199892e-5,-7.166060109300918e-10,-4.584267277797475e-4,-3.629920933167143e-5,-7.25651034334448e-10,-4.5798303120869814e-4,-3.623817319516776e-5,-7.192617233124736e-10,-4.575530806030977e-4,-3.610762730040304e-5,-6.969458465337379e-10,-4.571628892970559e-4,-3.591815255208761e-5,-6.607620683323364e-10,-4.56833823604343e-4,-3.569198142091502e-5,-6.153534493322551e-10,-4.5657747279228704e-4,-3.54605678450924e-5,-5.675121322431022e-10,-4.5639155317605325e-4,-3.525945503013983e-5,-5.251872676244543e-10,-4.562582877399368e-4,-3.5121101489857186e-5,-4.960025021303906e-10,-4.561462404911574e-4,-3.5067166813251846e-5,-4.855281510313871e-10,-4.560157354184803e-4,-3.510209657136758e-5,-4.956760285975314e-10,-4.558271844438492e-4,-3.520973052125918e-5,-5.23642942124648e-10,-4.555509722539143e-4,-3.5354377231198915e-5,-5.618485388203806e-10,-4.551767900011865e-4,-3.5487271728465515e-5,-5.99216862288837e-10,-4.547194931700101e-4,-3.555821241925147e-5,-6.238372524193589e-10,-4.5421824807652514e-4,-3.553016757808225e-5,-6.264728450339745e-10,-4.537270827198009e-4,-3.539206308847836e-5,-6.037125880351339e-10,-4.532987076358123e-4,-3.5163679660655164e-5,-5.592847955933052e-10,-4.5296792741134556e-4,-3.488912728160238e-5,-5.027086388929701e-10,-4.527422313081323e-4,-3.462138798450755e-5,-4.458766460131134e-10,-4.5260323410913533e-4,-3.4405453702598874e-5,-3.9926413768010085e-10,-4.5251644486876176e-4,-3.426740951649623e-5,-3.6938487658784766e-10,-4.5244332300902997e-4,-3.421213627964388e-5,-3.5808595438001316e-10,-4.523505626185003e-4,-3.4227480505678286e-5,-3.632636675315268e-10,-4.5221482312207624e-4,-3.4290899461766846e-5,-3.8020116677613763e-10,-4.5202375557595886e-4,-3.437554371425792e-5,-4.029081427514244e-10,-4.5177505774483904e-4,-3.445460262322402e-5,-4.251869797649234e-10,-4.514749547370295e-4,-3.4504079311446706e-5,-4.4139362238526164e-10,-4.5113679020358777e-4,-3.450468018923218e-5,-4.469651496899405e-10,-4.507797731939009e-4,-3.444350711070474e-5,-4.388225099902334e-10,-4.504274678763231e-4,-3.431595710739258e-5,-4.1574789980056126e-10,-4.501053968208255e-4,-3.412772239306382e-5,-3.7876689398194317e-10,-4.49837245052929e-4,-3.3896171321560205e-5,-3.3143923698792594e-10,-4.4963967883302245e-4,-3.364990241377015e-5,-2.7982500286964254e-10,-4.495167350280108e-4,-3.342519780636138e-5,-2.3182893325347959e-10,-4.494557916595384e-4,-3.32588698365336e-5,-1.9575098987866422e-10,-4.494275238613324e-4,-3.317868246084438e-5,-1.7822526619476317e-10,-4.493912544321645e-4,-3.319433112785999e-5,-1.8215182067943742e-10,-4.4930491559363935e-4,-3.329257874488547e-5,-2.0541584757431906e-10,-4.491366544886963e-4,-3.343893518934762e-5,-2.409915239755049e-10,-4.4887423428689434e-4,-3.358582747083409e-5,-2.785249749837473e-10,-4.4852918924545023e-4,-3.3684857564196356e-5,-3.069592004180854e-10,-4.481345025764483e-4,-3.3699547562141865E-05,-3.174400965017838e-10,-4.477364173205387e-4,-3.36150453685436e-5,-3.056899582009406e-10,-4.473824653024104e-4,-3.3442075559446554e-5,-2.731645840371916e-10,-4.471089794236686e-4,-3.3213746559910004e-5,-2.2659609678642381e-10,-4.4693193476726584e-4,-3.2975892326254515e-5,-1.7600234698550785e-10,-4.4684415933761597e-4,-3.2774072581832724e-5,-1.318180279743324e-10,-4.468195596048631e-4,-3.264180812728822e-5,-1.0215906621877542e-10,-4.468221350963377e-4,-3.259390394722096e-5,-9.111564082088563e-11,-4.468159270102211e-4,-3.262613831507543e-5,-9.843768488394674e-11,-4.4677253154619184e-4,-3.271981887431175e-5,-1.2037327381122013e-10,-4.466747593938944e-4,-3.2848326037323585e-5,-1.5107991793165482e-10,-4.465169535590928e-4,-3.298315215165685e-5,-1.8405170853296948e-10,-4.4630337571044507e-4,-3.309824656748056e-5,-2.1323351666357844e-10,-4.4604597579605345e-4,-3.317263929462189e-5,-2.337308573244723e-10,-4.45762317539977e-4,-3.3191928530204014e-5,-2.421841171496663e-10,-4.454738218877487e-4,-3.314935956184844e-5,-2.369644191333686e-10,-4.4520398080873634e-4,-3.304699535971351e-5,-2.1835135532547503e-10,-4.449759188950929e-4,-3.289697404544757e-5,-1.887628854791514e-10,-4.448087241116615e-4,-3.2722220146874976e-5,-1.529489231537002e-10,-4.4471242614531716e-4,-3.2555363695373645e-5,-1.1787226547448037e-10,-4.446825403539786e-4,-3.2434324371631275e-5,-9.188130706746193e-11,-4.4469655992664646e-4,-3.2393735943472714e-5,-8.291075104452407e-11,-4.4471563063769776e-4,-3.245364245052461e-5,-9.596818943647909e-11,-4.446933654754844e-4,-3.2609831845342675e-5,-1.3086158754423952e-10,-4.445900359888028e-4,-3.2831347836709934e-5,-1.814400172328324e-10,-4.4438642125605143e-4,-3.306811219248421e-5,-2.370680722983898e-10,-4.4409080264432883e-4,-3.326622792760892e-5,-2.858581212801058e-10,-4.437360837083105e-4,-3.33843518504114e-5,-3.1823887552277983e-10,-4.433690949210459e-4,-3.340463330407339e-5,-3.294487374573945e-10,-4.430370755530498e-4,-3.3335321031998855e-5,-3.203184353265311e-10,-4.427759960089928e-4,-3.320596713714179e-5,-2.9650278742528307e-10,-4.4260339341241914e-4,-3.305809413124731e-5,-2.666935334285821e-10,-4.425164934095727e-4,-3.293443729480453e-5,-2.403889490512539e-10,-4.424951037855245e-4,-3.286939195932481e-5,-2.2573681301802528e-10,-4.4250792553513906e-4,-3.2882577323854434e-5,-2.2789539745179735e-10,-4.425203905633074e-4,-3.297653466831185e-5,-2.4823497974085815e-10,-4.425019734590562e-4,-3.313848660280707e-5,-2.8448803781729026e-10,-4.424313311491289e-4,-3.334499881923905e-5,-3.3168004394333305e-10,-4.422985572981347e-4,-3.3567784931305844e-5,-3.834657566606249e-10,-4.4210484891880924e-4,-3.377905354369237e-5,-4.3346022827032136e-10,-4.4186050614891556e-4,-3.3955460677570604e-5,-4.762630706971752e-10,-0.00044158229376506733,-3.408047587119074e-5,-5.080560853142402e-10,-4.4129088951131405e-4,-3.4145537682724034e-5,-5.268328707022444e-10,-4.4100864451780675e-4,-3.415060214756904e-5,-5.324321778308508e-10,-4.4075744431709034e-4,-3.4104538515809105e-5,-5.265509515466792e-10,-4.405562048159596e-4,-3.402543308853396e-5,-5.128193797311413e-10,-4.4041749799388676e-4,-3.394031824044413e-5,-4.968520411437988e-10,-4.4034317371603764e-4,-3.388321666420194e-5,-4.859836819661576e-10,-4.4031985380117906e-4,-3.389003663385937e-5,-4.882781596747447e-10,-4.4031667309458187e-4,-3.398947734201114e-5,-5.105417250572887e-10,-4.40288726603928e-4,-3.419139460117802e-5,-5.556392875995702e-10,-4.4018852720764694e-4,-3.447763007612022e-5,-6.202734840122589e-10,-4.3998312776834925e-4,-3.4802253044518366e-5,-6.948530997978604e-10,-4.396688525708522e-4,-3.510470657110431e-5,-7.662719727894685e-10,-4.3927463938373874e-4,-3.533108692677226e-5,-8.225278615720626e-10,-4.388514849831018e-4,-3.545261924397217e-5,-8.567545923869293e-10,-4.384542114569926e-4,-3.5472467064472854e-5,-8.687704570663886e-10,-4.381250309194333e-4,-3.542007387575285e-5,-8.640367362840351e-10,-4.3788477725332484e-4,-3.533865244353876e-5,-8.512299465652137e-10,-4.377321566231613e-4,-3.52722511840646e-5,-8.396926899517458e-10,-4.3764830456916964e-4,-3.525614476523123e-5,-8.374333127536711e-10,-4.376036478383992e-4,-3.531151963905395e-5,-8.498330044244647e-10,-4.3756499698159503e-4,-3.544392307484552e-5,-8.790159276265403e-10,-4.3750174764789934e-4,-3.56445680225368e-5,-9.238259471745557e-10,-4.3739057794072914e-4,-3.5893675770702265e-5,-9.803621067461992e-10,-4.372182577922428e-4,-3.6165025749781834e-5,-1.042950971201023e-9,-4.369824734841252e-4,-3.6430802734025703e-5,-1.1053246753441703e-9,-4.36690901264442e-4,-3.6665949804834746e-5,-1.1617407465670032e-9,-4.3635900542241446e-4,-3.685147801086402e-5,-1.2078249534317108e-9,-4.360071976804138e-4,-3.697647114841903e-5,-1.2410262063482944e-9,-4.356579555231565e-4,-3.7038915732516285e-5,-1.260728985867218e-9,-4.353331667358742e-4,-3.704575670653252e-5,-1.2681800873321904e-9,-4.350516275750907e-4,-3.701249208677096e-5,-1.2663789075441324e-9,-4.348264748497907e-4,-3.696235632581322e-5,-1.2599873663792249e-9,-4.3466228069439307e-4,-3.692480626009468e-5,-1.2551736513394884e-9,-4.3455177288540366e-4,-3.6932510170417106e-5,-1.25912798564809e-9,-4.3447301468774706e-4,-3.701572674939781e-5,-1.278902275184977e-9,-4.3438916026796164e-4,-3.71935894381788e-5,-1.3194060826546412e-9,-4.3425376802956616e-4,-3.74638561498117e-5,-1.3809346111075104e-9,-4.340236163024067e-4,-3.779593543622154e-5,-1.4574024307369292e-9,-4.3367640876553675e-4,-3.8134118564692025e-5,-1.5369256916288049e-9,-4.332244241737091e-4,-3.8414502041651824e-5,-1.6055222702572017e-9,-4.3271386018431076e-4,-3.858948430017033e-5,-1.652481129483999e-9,-4.3220787923143326e-4,-3.864607462666557e-5,-1.6743270763616353e-9,-4.317629656468537e-4,-3.860761863456337e-5,-1.6752156913577408e-9,-4.3141176547786695e-4,-3.8520414864384305e-5,-1.6642240440609935e-9,-4.3115868222643985e-4,-3.8435327419660585e-5,-1.651702421749401e-9,-4.3098557996193025e-4,-3.8393580822086956e-5,-1.6464759363415677e-9,-4.3086147835504085e-4,-3.841992287116871e-5,-1.65440671246263e-9,-4.307516674336233e-4,-3.8521823132790755e-5,-1.6780078303099869e-9,-4.306243804306794e-4,-3.8692067403099935e-5,-1.716664885505569e-9,-4.3045497513185133e-4,-3.891267180424769e-5,-1.7671843133691706e-9,-4.302282105989142e-4,-3.9159095494623204e-5,-1.824566327370246e-9,-4.299390751286171e-4,-3.940438880534627e-5,-1.8829431790449586e-9,-4.295924025130069e-4,-3.9623034498814555e-5,-1.936562263178734e-9,-4.292014630930585e-4,-3.9794261037469396e-5,-1.9806593157273097e-9,-4.287856876623859e-4,-3.9904630596068394e-5,-2.0120950226613972e-9,-4.28367754503315e-4,-3.994964610903417e-5,-2.0296763544745215e-9,-4.279704452993792e-4,-3.9934237516808346e-5,-2.0341813886434956e-9,-4.276136265667553e-4,-3.987227137249826e-5,-2.0282039753249915e-9,-4.273114688402678e-4,-3.978527077197651e-5,-2.0159259234067885e-9,-4.2706992488113834e-4,-3.9700366198973295e-5,-2.002829069662559e-9,-4.268845197863682e-4,-3.964737840173896e-5,-1.9952647642030475e-9,-4.267386265969893e-4,-3.965471131576109e-5,-1.999700373052887e-9,-4.266029510717304e-4,-3.9743544324180614e-5,-2.0214358793739664e-9,-4.26437834568534e-4,-3.992039295746758e-5,-2.0627867533072652e-9,-4.2620038657907274e-4,-4.016980373449743e-5,-2.1212012265236316e-9,-4.2585728334790284e-4,-4.0451299582123726e-5,-2.1883606719571155e-9,-4.25400265363133e-4,-4.070596598753596e-5,-2.25155109322746e-9,-4.248561337280175e-4,-4.0874859811857436e-5,-2.2977411834001216e-9,-4.242820619720334e-4,-4.092274432793028e-5,-2.3187965446079723e-9,-4.237451316903482e-4,-4.085341822572131e-5,-2.3147791360394584e-9,-4.2329694415442286e-4,-4.070654441064251e-5,-2.2932869092235596e-9,-4.229578411734412e-4,-4.0538947222353454e-5,-2.2656447239000503e-9,-4.2271688421275413e-4,-4.040304127911455e-5,-2.2426165588610284e-9,-4.225427433080427e-4,-4.0333144803596924e-5,-2.231704275563879e-9,-4.223968689264773e-4,-4.0342043136537935e-5,-2.2363639652971267e-9,-4.222434398179648e-4,-4.042433106460874e-5,-2.256430112670042e-9,-4.220548334090586e-4,-4.056222883882198e-5,-2.2890006714688703e-9,-4.218136677594013e-4,-4.073117018433807e-5,-2.3293788637137593e-9,-4.21512946299068e-4,-4.0904258616967875e-5,-2.3719643641673716e-9,-4.2115531676598317e-4,-4.105575217512033e-5,-2.4111025484600863e-9,-4.207517952197999e-4,-4.1163907229954436e-5,-2.441863734119646e-9,-4.203200113401336e-4,-4.121333480514526e-5,-2.460678044086568e-9,-4.198819221794372e-4,-4.119688223171917e-5,-2.4657691210332674e-9,-4.194609188969578e-4,-4.111682572964086e-5,-2.4573520283086842e-9,-4.1907848888926417e-4,-4.0985005162454883e-5,-2.4375869987131062e-9,-4.1875086145044143e-4,-4.082171835588424e-5,-2.4103369791762464e-9,-4.1848604840921634e-4,-4.065342570658751e-5,-2.3807851127628465e-9,-4.182816061708275e-4,-4.050935427302264e-5,-2.3549026071762925e-9,-4.1812347686722286e-4,-4.041715861848515e-5,-2.3387103150409148e-9,-4.1798629068454416e-4,-4.039789505126642e-5,-2.337275945283984e-9,-4.178356307985684e-4,-4.046059638808345e-5,-2.353438615303446e-9,-4.1763304542852736e-4,-4.0597133531294696e-5,-2.3864309135234715e-9,-4.17344485054109e-4,-4.07791348421971e-5,-2.4308988000567276e-9,-4.1695157842682465e-4,-4.095991780817399e-5,-2.477108670627579e-9,-4.16462448119742e-4,-4.108433698392642e-5,-2.5130503328766345e-9,-4.15915771968092e-4,-4.1106404871525956e-5,-2.528346010590168e-9,-4.153721159190534e-4,-4.100833523430551e-5,-2.5184530965389194e-9,-4.1489323356661917e-4,-4.0810007275967356e-5,-2.4867440031700544e-9,-4.1451934265011636e-4,-4.056149998336314e-5,-2.443004015897615e-9,-4.14257057163492e-4,-4.032253315069391e-5,-2.399280027476654e-9,-4.140829643037679e-4,-4.014115402159914e-5,-2.365624213252662e-9,-4.139573594589503e-4,-4.004203540654317e-5,-2.347719850083814e-9,-4.1383883902764264e-4,-4.0026135838993726e-5,-2.346648557292666e-9,-4.1369395521428763e-4,-4.007714518494776e-5,-2.359918634965156e-9,-4.1350116283010187e-4,-4.0169438678037385e-5,-2.3828275358386247e-9,-4.132509204849382e-4,-4.02745458009851e-5,-2.409672202656709e-9,-4.12944098431814e-4,-4.036544899383293e-5,-2.434693727626981e-9,-4.1259003312596384e-4,-4.0419283786942026e-5,-2.4528076757501718e-9,-4.1220463180241106e-4,-4.041920894315126e-5,-2.460165886913844e-9,-4.118084241146482e-4,-4.035589750016881e-5,-2.4545551866637317e-9,-4.114243079808707e-4,-4.0228769440772255e-5,-2.4356339267987566e-9,-4.1107472547243434e-4,-4.004674770704506e-5,-2.4050065497151834e-9,-4.107782411517076e-4,-3.982801465533893e-5,-2.3661110631512318e-9,-4.1054594259781567e-4,-3.959827057314572e-5,-2.3238887851075064e-9,-4.10378395758591e-4,-3.938732383127705e-5,-2.2842171118400988e-9,-4.1026395191599125e-4,-3.922422342717951e-5,-2.2530908614786637e-9,-4.101791123460307e-4,-3.9131562701737556e-5,-2.23557803383868e-9,-4.100913745510124e-4,-3.911997116984464e-5,-2.2346619299068557e-9,-4.099645570075549e-4,-3.9183950507037974e-5,-2.250178149363926e-9,-4.097661972198411e-4,-3.930021397784681e-5,-2.278150153434694e-9,-4.0947612025577423e-4,-3.9429780090729804e-5,-2.310922006873919e-9,-4.090943862753506e-4,-3.952493336780649e-5,-2.338459230035468e-9,-4.086456517799025e-4,-3.954111611657848e-5,-2.3508883014153373e-9,-4.081763984351799e-4,-3.945141594102922e-5,-2.34172318966217e-9,-4.0774310491620253e-4,-3.9258165010706924e-5,-2.3105104000586573e-9,-4.0739410414728915e-4,-3.899487440782558e-5,-2.2634068239480487e-9,-4.071530517716821e-4,-3.8715380711305496e-5,-2.2110648360130516e-9,-4.07012517735472e-4,-3.8474663908117465e-5,-2.1647814676881445e-9,-4.0694031503661626e-4,-3.83111097332982e-5,-2.132885090794267e-9,-4.0689355328915437e-4,-3.823811500140989e-5,-2.118905391336737e-9,-4.0683245131795863e-4,-3.824611552137267e-5,-2.121744169365106e-9,-4.0672875066320724e-4,-3.83106584547127e-5,-2.137053712749919e-9,-4.065681541205749e-4,-3.8401284561318635e-5,-2.1588842425524963e-9,-4.063489170280104e-4,-3.848820200325258e-5,-2.181051087605659e-9,-4.0607899542711783e-4,-3.854620981262006e-5,-2.198080022710527e-9,-4.0577321760118843e-4,-3.855665233157998e-5,-2.2057933114142437e-9,-4.054509336224549e-4,-3.850839314776131e-5,-2.2016348705458945e-9,-4.051339790749997e-4,-3.839848304650612e-5,-2.1848218714545927e-9,-4.0484452728607707e-4,-3.8232763492249975e-5,-2.1563917184551757e-9,-4.046024009615301e-4,-3.8026166396044666e-5,-2.1191704389762e-9,-4.0442170184689123e-4,-3.780206287518215e-5,-2.0776109012345515e-9,-4.043071522932379e-4,-3.7589916539575194e-5,-2.037394588277785e-9,-4.0425112417486777e-4,-3.7420805564781884e-5,-2.0046841607319565e-9,-4.0423270413599097e-4,-3.732108474951415e-5,-1.9850017433876396e-9,-4.042199941499895e-4,-3.7305461211264305e-5,-1.9818909364028005e-9,-4.041759729458141e-4,-3.7371576180890595e-5,-1.995722476799383e-9,-4.040669367934563e-4,-3.749819781395151e-5,-2.023080949156707e-9,-4.038714430168704e-4,-3.764824543910441e-5,-2.0570719150784504e-9,-4.0358723837979936e-4,-3.777652245214125e-5,-2.088652532821821e-9,-4.0323392522940814e-4,-3.784066890271968e-5,-2.108786263221883e-9,-4.028499668827034e-4,-3.7812733764463005e-5,-2.110917795052249e-9,-4.024839213955273e-4,-3.768809159565209e-5,-2.0930452841422504e-9,-4.0218154105103323e-4,-3.748838143603014e-5,-2.0586134771402745e-9,-4.0197245691300375e-4,-3.7256296497542606e-5,-2.0156987881971886e-9,-4.0186148165965595e-4,-3.7042976733979594e-5,-1.974586200188155e-9,-4.018283808339541e-4,-3.6892494178303976e-5,-1.944623987475064e-9,-4.0183608868270894e-4,-3.6829760565161567e-5,-1.9316327261505804e-9,-4.0184323029191903e-4,-3.685629057238657e-5,-1.9367984159228025e-9,-4.0181540972463755e-4,-3.6953941902521246e-5,-1.9571606390107712e-9,-4.0173160962337696e-4,-3.7093205760581396e-5,-1.9871078224997477e-9,-4.015852743493223e-4,-3.724183204408453e-5,-2.0200937211791826e-9,-4.013819118193629e-4,-3.737112093517171e-5,-2.0500268935527753e-9,-4.0113546642722405e-4,-3.745934046666174e-5,-2.072145790532876e-9,-4.008649162475529e-4,-3.749303145455463e-5,-2.0834320591036338e-9,-4.005915876567197e-4,-3.746722429672266e-5,-2.0827005722215756e-9,-4.00337051736825e-4,-3.7385338843855984e-5,-2.0705219071079996e-9,-4.0012112723467486e-4,-3.725911600757237e-5,-2.0491068141487655e-9,-3.9995945006566694e-4,-3.710838880148392e-5,-2.02219878218256e-9,-3.9986036290861937e-4,-3.696000071532959e-5,-1.9948926212214277e-9,-3.9982147601925637e-4,-3.684496081292581e-5,-1.9731958999948373e-9,-3.998270224104261e-4,-3.6793151712941985e-5,-1.9631309255681626e-9,-3.9984782850540707e-4,-3.6825820017548094e-5,-1.9693326621769157e-9,-3.9984567314217234e-4,-3.6947721487253395e-5,-1.9934475370821446e-9,-3.997823060669654e-4,-3.714229558595796e-5,-2.0329994613703186e-9,-3.996308094008664e-4,-3.7373115060623765e-5,-2.0814266273117242e-9,-3.99384988712439e-4,-3.759249203934011e-5,-2.1295566994293455e-9,-3.9906271036433164e-4,-3.775472405457742e-5,-2.1681019565900638e-9,-3.987016202917927e-4,-3.7829193936713294e-5,-2.190272534708571e-9,-3.9834887836798216e-4,-3.780875269054671e-5,-2.193608295241445e-9,-3.980485538263064e-4,-3.7711034648837475e-5,-2.1805271009791155e-9,-3.978305141809676e-4,-3.75729460791574e-5,-2.157555028882998e-9,-3.9770366530245046e-4,-3.744037328616604e-5,-2.1335311050243456e-9,-3.9765504299890545e-4,-3.735613027207092e-5,-2.1172878104897155e-9,-3.976546923721489e-4,-3.7349520461290274e-5,-2.1154458093897077e-9,-3.976645841027215e-4,-3.7430385886824955e-5,-2.1309453027747796e-9,-3.9764857481630915e-4,-3.7588969553787584e-5,-2.16269710822895e-9,-3.975803240688057e-4,-3.78008285196242e-5,-2.206328545718188e-9,-3.9744725472712117e-4,-3.8034406317778884e-5,-2.2556260006985536e-9,-3.972504331599879e-4,-3.825848207709496e-5,-2.304116143937135e-9,-3.970016678082849e-4,-3.8447576129588216e-5,-2.346328968114079e-9,-3.967195597523896e-4,-3.85847761019194e-5,-2.378535140950185e-9,-3.9642580202908984e-4,-3.8662499543895226e-5,-2.3989805580658325e-9,-3.9614227617272086e-4,-3.8682093918056946e-5,-2.407778956750608e-9,-3.9588887819566896e-4,-3.865305185717903e-5,-2.406662527805749e-9,-3.9568165300506234e-4,-3.8592229765188354e-5,-2.3987512411946675e-9,-3.9553072846361295e-4,-3.852295871827556e-5,-2.3883867003944353e-9,-3.9543774790634314e-4,-3.847345808670505e-5,-2.3809297326839213e-9,-3.9539305003282924e-4,-3.847364136251777e-5,-2.382287114028292e-9,-3.9537371824626544e-4,-3.854948972135635e-5,-2.397910865159832e-9,-3.9534454501332527e-4,-3.8715107497318946e-5,-2.4312142198376576e-9,-3.952641095528031e-4,-3.896460770802551e-5,-2.4818178598376683e-9,-3.9509636929992376e-4,-3.9268210077471814e-5,-2.5445577437541576e-9,-3.9482433024793544e-4,-3.957704143478872e-5,-2.6102337078048142e-9,-3.944590437311957e-4,-3.983728465279895e-5,-2.66827632892777e-9,-3.9403811672779804e-4,-4.000826568398732e-5,-2.7102607573795425e-9,-3.936136334447647e-4,-4.007582516475161e-5,-2.732568246881595e-9,-3.932354489171214e-4,-4.005509986930359e-5,-2.7370829288428234e-9,-3.9293735005261444e-4,-3.9983124149450465e-5,-2.730028550413103e-9,-3.927304162113228e-4,-3.990616554842289e-5,-2.7198283129693987e-9,-3.926037104670152e-4,-3.986712394333029e-5,-2.7148744382944538e-9,-3.925300340245018e-4,-3.989630581245046e-5,-2.721726552456415e-9,-3.924740322961887e-4,-4.000673567964125e-5,-2.7439566656949624e-9,-3.9240044960224226e-4,-4.0193797020507027e-5,-2.781711773518208e-9,-3.9228100027058804e-4,-4.043835453992976e-5,-2.8319939335662753e-9,-3.920988397429943e-4,-4.071220949346134e-5,-2.8895632795737313e-9,-3.918501286346216e-4,-4.098447018044798e-5,-2.9482215655903276e-9,-3.915428759247042e-4,-4.1227354423628e-5,-3.002126932202798e-9,-3.911938860598323e-4,-4.142035578932055e-5,-3.0468184632871506e-9,-3.908248865257149e-4,-4.1552391217979064e-5,-3.079773043002786e-9,-3.904587877773441e-4,-4.162213920665322e-5,-3.100490246668063e-9,-3.901166540589265e-4,-4.163716629526032e-5,-3.1102498369570066e-9,-3.898154596295406e-4,-4.1612528206521545e-5,-3.1117545046976984e-9,-3.895663343014008e-4,-4.15692477287104e-5,-3.108816873159751e-9,-3.893729274795302e-4,-4.1532643167673676e-5,-3.106122424164249e-9,-3.8922964958095066e-4,-4.1530120920376783e-5,-3.108959796232942e-9,-3.8911993547672825e-4,-4.158773400879558e-5,-3.1226873440949273e-9,-3.890154780111431e-4,-4.172477613316137e-5,-3.1516937951170783e-9,-3.8887832398421657e-4,-4.1946490302301866e-5,-3.1978260954989524e-9,-3.8866798799491536e-4,-4.2236923527193535e-5,-3.2587392014650204e-9,-3.883541075724722e-4,-4.255643026767475e-5,-3.3271796700881e-9,-3.879309179981178e-4,-4.2848970224092304e-5,-3.3923178303223024e-9,-3.874252936797595e-4,-4.3060086306725585e-5,-3.4432808142227515e-9,-3.8689085406422015e-4,-4.315822428367038e-5,-3.473343383367832e-9,-3.863889877673784e-4,-4.3147231358598694e-5,-3.4823712443678767e-9,-3.859670303418556e-4,-4.306282988945449e-5,-3.476235200012914e-9,-3.856450179732965e-4,-4.29567332020061e-5,-3.4640108169692097e-9,-3.8541502948697586e-4,-4.287851646215824e-5,-3.4548315486565543e-9,-3.852493149355605e-4,-4.2863147399264384e-5,-3.4556957290431317e-9,-3.851111325842977e-4,-4.2926194690833945e-5,-3.4704676625369628e-9,-3.849641750666217e-4,-4.306488479653104e-5,-3.4997555963823663e-9,-3.8477904449105344e-4,-4.326230537360815e-5,-3.541315667419064e-9,-3.845368505256895e-4,-4.349269606106779e-5,-3.5907716079917845e-9,-3.842305470775176e-4,-4.372677264988809e-5,-3.6425556238611925e-9,-3.838644713396162e-4,-4.393662457551494e-5,-3.690971057311515e-9,-3.834524001017426e-4,-4.4099766813166904e-5,-3.731195660582228e-9,-3.8301455462920074e-4,-4.4201952462350065e-5,-3.760022682061001e-9,-3.8257407697839317e-4,-4.42385677285092e-5,-3.776219192075404e-9,-3.821534971407641e-4,-4.42146190699868e-5,-3.78049345493217e-9,-3.8177167811354886e-4,-4.414353188785048e-5,-3.775176115440497e-9,-3.814415037458072e-4,-4.404520966037506e-5,-3.763795599090132e-9,-3.811682438952999e-4,-4.3943745048884684e-5,-3.750686091708826e-9,-3.8094841874788385e-4,-4.3864881721126706e-5,-3.740645067077998e-9,-3.807690606418496e-4,-4.383310219135978e-5,-3.738542478624394e-9,-3.8060747113549404e-4,-4.3868015094879415e-5,-3.7487069852998005e-9,-3.8043212896826716e-4,-4.397964230952124e-5,-3.77392849591353e-9,-3.8020614214202126e-4,-4.416283549922484e-5,-3.814126337469046e-9,-3.7989477348660916e-4,-4.43925934432593e-5,-3.8651369785543476e-9,-3.7947723172862823e-4,-4.462397219530305e-5,-3.918497560033356e-9,-3.789593875598948e-4,-4.4800964639163135e-5,-3.96317158934382e-9,-3.783796554624242e-4,-4.487522211492297e-5,-3.989310173516736e-9,-3.7780028171270733e-4,-4.482731494297352e-5,-3.992457390009027e-9,-3.772848187336151e-4,-4.4677289049787794e-5,-3.975587279866091e-9,-3.768738589342568e-4,-4.4476302813578715e-5,-3.947557776892742e-9,-3.765731596693725e-4,-4.4284647088400656e-5,-3.919157973229763e-9,-3.763583684669076e-4,-4.415011216339383e-5,-3.8993178944763496e-9,-3.7618935482083637e-4,-4.409689236608701e-5,-3.893153730927883e-9,-3.760245905568384e-4,-4.412564418670974e-5,-3.901816527226052e-9,-3.758305281239963e-4,-4.4219737409461237e-5,-3.923290331122069e-9,-3.755856622553639e-4,-4.435289044370741e-5,-3.953443754350989e-9,-3.752809867131644e-4,-4.449563849145108e-5,-3.987032034029203e-9,-3.749186681115099e-4,-4.462002058569582e-5,-4.018598786101294e-9,-3.745100126286204e-4,-4.4702883418774216e-5,-4.043293546650498e-9,-3.740730272909859e-4,-4.472824114947566e-5,-4.057558558959361e-9,-3.736296275242296e-4,-4.4688796131403827e-5,-4.059581153155581e-9,-3.732025909944763e-4,-4.4586579231906474e-5,-4.049448013925343e-9,-3.7281240901532864e-4,-4.4432606619089756e-5,-4.029008414573869e-9,-3.724743361521061e-4,-4.4245446122239154e-5,-4.001513612609417e-9,-3.7219604683176886e-4,-4.404881315412431e-5,-3.971147889469539e-9,-3.719761559946201e-4,-4.386851506422404e-5,-3.942550572712875e-9,-3.718036869016746e-4,-4.3729011292962504e-5,-3.920339561133363e-9,-3.716585476438696e-4,-4.364979112255484e-5,-3.908574248164302e-9,-3.715130942800803e-4,-4.364173138022532e-5,-3.910078188684471e-9,-3.713350457921283e-4,-4.370352841575415e-5,-3.925586069346227e-9,-3.7109238380513845e-4,-4.3818651024463044e-5,-3.9528488394828995e-9,-3.707607845405598e-4,-4.395425389302266e-5,-3.986112633364346e-9,-3.7033298488081413e-4,-4.406449097933762e-5,-4.01659369367896e-9,-3.698271408886742e-4,-4.4100617660546984e-5,-4.034478858226037e-9,-3.6928850300559833e-4,-4.402761136944001e-5,-4.032309510928544e-9,-3.6877886950402043e-4,-4.3841161627626426e-5,-4.008397336623387e-9,-3.68354844176475e-4,-4.3574127073054776e-5,-3.9681227490621515e-9,-3.680456442399449e-4,-4.328536888044946e-5,-3.921896540270247e-9,-3.678438514995482e-4,-4.303605390842075e-5,-3.88088052714649e-9,-3.6771344272492777e-4,-4.286765668321312e-5,-3.853066475373028e-9,-3.6760744211130974e-4,-4.279271827029995e-5,-3.841571155142976e-9,-3.6748400287878505e-4,-4.279868404809011e-5,-3.845110101089603e-9,-3.6731503805980255e-4,-4.2858040425471004e-5,-3.859505188909107e-9,-3.670878782353395e-4,-4.293828963274571e-5,-3.879232548481663e-9,-3.668030259099282e-4,-4.300887457302174e-5,-3.8986149146387406e-9,-3.664707239972699e-4,-4.304497730933188e-5,-3.912649349560868e-9,-3.6610775839668016e-4,-4.302929792015812e-5,-3.917575783781463e-9,-3.657347454762509e-4,-4.295287241734541e-5,-3.911245377621743e-9,-3.653736412651876e-4,-4.2815417391808795e-5,-3.893281236926014e-9,-3.650452228879931e-4,-4.2625259277326516e-5,-3.865029786249455e-9,-3.6476641984123815e-4,-4.239866016669585e-5,-3.8293301914713776e-9,-3.645476115673927e-4,-4.215819173345968e-5,-3.790137077788593e-9,-3.643903517009124e-4,-4.192994909126311e-5,-3.752032661708107e-9,-3.642861036996599e-4,-4.173977362622034e-5,-3.71966635491313e-9,-3.642164327955368e-4,-4.160892942215545e-5,-3.697132215015159e-9,-3.641549093482707e-4,-4.1549858066543754e-5,-3.6872863278909777e-9,-3.6407072313266787e-4,-4.1562773802817286e-5,-3.6910546876715064e-9,-3.639337297548633e-4,-4.1633785245227165e-5,-3.706842402789998e-9,-3.637205402382895e-4,-4.17351263688552e-5,-3.730239026226662e-9,-3.634210733541716e-4,-4.182826882524199e-5,-3.7543125950062615e-9,-3.6304426985984744e-4,-4.187077889867399e-5,-3.770791848359487e-9,-3.626205679360432e-4,-4.1827023967553126e-5,-3.772195287003563e-9,-3.621980590998262e-4,-4.168082324199709e-5,-3.754465893092228e-9,-3.6183040236259707e-4,-4.144515737090433e-5,-3.719051514202747e-9,-3.615588707716338e-4,-4.1162290906568653e-5,-3.6731031521314867e-9,-3.61396538504054e-4,-4.089083947416614e-5,-3.627175685529882e-9,-3.6132387086853867e-4,-4.0684523717909506e-5,-3.5913642442355727e-9,-3.612984871112935e-4,-4.057381858184938e-5,-3.57191628278744e-9,-3.6127263538453984e-4,-4.0559572504084276e-5,-3.5699106570700582e-9,-3.6120844626298833e-4,-4.061897653845609e-5,-3.5820719173724824e-9,-3.610852118619653e-4,-4.0717434213808e-5,-3.6026558942381903e-9,-3.608991626924136e-4,-4.0819528038116416e-5,-3.625305177385425e-9,-3.6065929725962267e-4,-4.0895889554540754e-5,-3.644354040211268e-9,-3.6038248887045136e-4,-4.092611299111932e-5,-3.6555594903413846e-9,-3.6008948797461456e-4,-4.089924983103489e-5,-3.6564197922185135e-9,-3.598020583044798e-4,-4.0813324951301555e-5,-3.6462285238279096e-9,-3.5954081132138837e-4,-4.06746448702424e-5,-3.625955167087689e-9,-3.593232203764928e-4,-4.049706401005377e-5,-3.5980159849031315e-9,-3.591614767911618e-4,-4.030096233320472e-5,-3.5659792059672047e-9,-3.5906017581369425e-4,-4.011143008152642e-5,-3.5342021902016163e-9,-3.590142746293756e-4,-3.9955202075565014e-5,-3.5073577657903728e-9,-3.5900813493897933e-4,-3.9856294031816824e-5,-3.4898049410216977e-9,-3.590165228657977e-4,-3.9830885148132995e-5,-3.484809323888809e-9,-3.5900811619758537e-4,-3.988259608517585e-5,-3.4937187933879266e-9,-3.589513508368191e-4,-3.9999692692636196e-5,-3.515316951993148e-9,-3.588215300116031e-4,-4.015553409221791e-5,-3.5456245459726613e-9,-3.586074994236263e-4,-4.031277515563591e-5,-3.578347724118303e-9,-3.5831611404968134e-4,-4.0430887172238557e-5,-3.6060328154525907e-9,-3.5797300106842354e-4,-4.0475752013014714e-5,-3.621798180660383e-9,-3.5761860209188446e-4,-4.0429328523306393E-05,-3.6212892232579545e-9,-3.572993273213688e-4,-4.029669010026284e-5,-3.604282007806e-9,-3.5705516107877836e-4,-4.01074134564653e-5,-3.575261109336151e-9,-3.56907171864305e-4,-3.990910227757714e-5,-3.542466178765705e-9,-3.5685000952815797e-4,-3.975360446642084e-5,-3.51546370509442e-9,-3.568535768631939e-4,-3.968060851260814e-5,-3.502095452651505e-9,-3.568738387353768e-4,-3.9705767185260144e-5,-3.506123139270059e-9,-3.568676969066613e-4,-3.981847075560239e-5,-3.526548679024781e-9,-3.568050583051709e-4,-3.9988930782059254e-5,-3.558632436406407e-9,-3.56673931076042e-4,-4.017965642244248e-5,-3.595815124716367e-9,-3.564788653472729e-4,-4.035578451744323e-5,-3.631596410599711e-9,-3.562358193015023e-4,-4.049130472750036e-5,-3.6608170038248088e-9,-3.5596655047241536e-4,-4.057119598922274e-5,-3.6802591959901357e-9,-3.556941971200325e-4,-4.059099060777297e-5,-3.688733399766354e-9,-3.554403466676326e-4,-4.055530827745248e-5,-3.6868596918516015e-9,-3.552231502274103e-4,-4.047630480756108e-5,-3.6767210257453985e-9,-3.550558309426621e-4,-4.0372330118324426e-5,-3.6615103358701634e-9,-3.549450842029947e-4,-4.0266541812810685e-5,-3.6452166207126978e-9,-3.5488926874896996e-4,-4.018488717008979e-5,-3.6323023478007748e-9,-3.5487679855453013e-4,-4.0152863925988295e-5,-3.6272565039705226e-9,-3.5488564634128154e-4,-4.019082120417089e-5,-3.6339063053833576e-9,-3.548851821818268e-4,-4.030831790087331e-5,-3.6544836887830023e-9,-3.548412788564619e-4,-4.049915486044093e-5,-3.6886696467672877e-9,-3.547243771613122e-4,-4.073952000048624e-5,-3.733057102710848e-9,-3.5451840841679887e-4,-4.0991294984085655e-5,-3.781467494098887e-9,-3.5422725173712733e-4,-4.121070540757682e-5,-3.826258266543762e-9,-3.538757710829669e-4,-4.136004087638724e-5,-3.8603033376723175e-9,-3.53504443877645e-4,-4.1418554823238366e-5,-3.879000807542093e-9,-3.5315908496719346e-4,-4.1388813578662445e-5,-3.881636157749867e-9,-3.528788443462086e-4,-4.1296476166252965e-5,-3.871679975513234e-9,-3.5268596813342254e-4,-4.118364620333568e-5,-3.855939529728651e-9,-3.525801622010045e-4,-4.109766926615156e-5,-3.84277572321506e-9,-3.5253922633776333e-4,-4.107846753507557e-5,-3.839853266345332e-9,-3.5252589900936437e-4,-4.1148172477191464e-5,-3.852089139473279e-9,-3.5249873593641004e-4,-4.130635182893659e-5,-3.880468677924388e-9,-3.524232758040045e-4,-4.153215835850133e-5,-3.922098707575269e-9,-3.5227977421103506e-4,-4.179200475176239e-5,-3.971370515911904e-9,-3.5206553777650213e-4,-4.2049383308559924e-5,-4.02168889154195e-9,-3.517923456022032e-4,-4.22732706596802e-5,-4.067108127961648e-9,-3.5148116482799436e-4,-4.2443054420599876e-5,-4.103423630040207e-9,-3.5115656427665365e-4,-4.254990072284108e-5,-4.128602719456839e-9,-3.508422977149487e-4,-4.259571927212223e-5,-4.1426852963775e-9,-3.505584283820493e-4,-4.2591075740938084e-5,-4.1473814440995675e-9,-3.503196597354921e-4,-4.2553010117369735e-5,-4.145588069811775e-9,-3.5013425081355416e-4,-4.250315194947812e-5,-4.140977734111264e-9,-3.5000296732766683e-4,-4.246594915992028e-5,-4.1376949637137355e-9,-3.4991789475969336e-4,-4.2466442610266224e-5,-4.140069290235601e-9,-3.4986146693382345e-4,-4.252696515740907e-5,-4.152177172551735e-9,-3.498066307483597e-4,-4.266243723623054e-5,-4.177099698568324e-9,-3.497195305195477e-4,-4.287472041112924e-5,-4.215884841538455e-9,-3.495659175480646e-4,-4.31478811621325e-5,-4.266536865943841e-9,-3.4932096349046604e-4,-4.3447520413318964e-5,-4.323660910585198e-9,-3.4897946134101256e-4,-4.372699512012349e-5,-4.379354851830018e-9,-3.4856132871286715e-4,-4.394038767390347e-5,-4.425380590164783e-9,-3.481082489458901e-4,-4.4057719624662955e-5,-4.455829749739181e-9,-3.4767160295073125e-4,-4.407548988414973e-5,-4.469069235668393e-9,-3.4729671592580966e-4,-4.401761276765464e-5,-4.468122927844235e-9,-3.470101043459885e-4,-4.392694681445468e-5,-4.459514042827404e-9,-3.4681399513372885e-4,-4.3851866775344917e-5,-4.4512484058967996e-9,-3.466884675872167e-4,-4.383320048423082e-5,-4.450711814114548e-9,-3.465989335162038e-4,-4.3895141685846634e-5,-4.463003731704032e-9,-3.4650592936654275e-4,-4.404155435899953e-5,-4.4899789588464385e-9,-3.4637451628011674e-4,-4.425746261242522e-5,-4.53010146035591e-9,-3.46181278482088e-4,-4.451449326164072e-5,-4.579071229769213e-9,-3.459177599712526e-4,-4.477844122387709e-5,-4.631023039653653e-9,-3.4559013570456575e-4,-4.501691233562397e-5,-4.679952084717743e-9,-3.452158716119919e-4,-4.520525913805162e-5,-4.720973867124305e-9,-3.4481879495999203e-4,-4.532981541959789e-5,-4.7511223937350465e-9,-3.4442408015957925e-4,-4.538843813449534e-5,-4.769589480143558e-9,-3.440542089166945e-4,-4.5389084894805184e-5,-4.7774936884748956e-9,-3.437263070319252e-4,-4.534740102436488e-5,-4.77738576894948e-9,-3.4345067735983324e-4,-4.5284143124787143e-5,-4.772713716467364e-9,-3.4323003778487113e-4,-4.5222842054429787e-5,-4.76739691027074e-9,-3.4305901194424496e-4,-4.518761784714889e-5,-4.765524511352927e-9,-3.429236989818069e-4,-4.52007347246193e-5,-4.771068404277782e-9,-3.428015696217947e-4,-4.5279382227483e-5,-4.787430575127021e-9,-3.426625060919474e-4,-4.543136538951815e-5,-4.8166784633623644E-09,-3.424723163020663e-4,-4.565015092623224e-5,-4.858517932523486e-9,-3.4219991287895055e-4,-4.591113849483137e-5,-4.9093917591879784e-9,-3.418278103507178e-4,-4.6172490727433865e-5,-4.962406765475092e-9,-3.413624942079579e-4,-4.6383736833411844e-5,-5.008742784565768e-9,-3.408383536332906e-4,-4.650185695871724e-5,-5.040476506469633e-9,-3.4030994982600497e-4,-4.650853684917004e-5,-5.053640312983224e-9,-3.398339484712107e-4,-4.641889431496161e-5,-5.0498114969366615e-9,-3.394494690556336e-4,-4.627597601679743e-5,-5.03533340901495e-9,-3.3916682212753793e-4,-4.6134299214963423e-5,-5.018789578479401e-9,-3.389684970747851e-4,-4.60416761329767e-5,-5.0082068715226695e-9,-3.388189563580666e-4,-4.602714616208865e-5,-5.009119290870518e-9,-3.386770001401216e-4,-4.609734320211425e-5,-5.023773996416256e-9,-3.385060967047203e-4,-4.623938128036451e-5,-5.051224680335727e-9,-3.382808819877009e-4,-4.642712042057251e-5,-5.0879722483668916e-9,-3.3798991630609986e-4,-4.662831095629719e-5,-5.128915587919849e-9,-3.3763548039858775e-4,-4.6811176467318076e-5,-5.16845422831316e-9,-3.3723121913479214e-4,-4.694969103565298e-5,-5.201576989894772e-9,-3.367983998553216e-4,-4.7027084779648636e-5,-5.224733145745607e-9,-3.3636159656376993e-4,-4.703738149569362e-5,-5.236319126134027e-9,-3.359445418555763e-4,-4.698513068870385e-5,-5.236724866703748e-9,-3.3556670577894265e-4,-4.688372871358966e-5,-5.228009274195705e-9,-3.3524095168534554e-4,-4.675286146676685e-5,-5.213367901026198e-9,-3.3497229454820115e-4,-4.661567260074138e-5,-5.196589566113095e-9,-3.3475746495397114e-4,-4.6496053972731513e-5,-5.181629379466889e-9,-3.3458496403935856e-4,-4.6416067332450106e-5,-5.172290074158099e-9,-3.3443550989848553e-4,-4.639329367171046e-5,-5.171902756508261e-9,-3.3428303229029717e-4,-4.64378573046309e-5,-5.182859497219969e-9,-3.3409679136510515e-4,-4.654895942300463e-5,-5.205901867299847e-9,-3.3384565314112754e-4,-4.671137333713532e-5,-5.2392644177281354e-9,-3.3350538321036714e-4,-4.689360879171389e-5,-5.278078891925973e-9,-3.330683964243518e-4,-4.705068211910057e-5,-5.314688239576653e-9,-3.3255256023083976e-4,-4.713428191609814e-5,-5.340419822664278e-9,-3.320027438393118e-4,-4.71097541805525e-5,-5.3486420687704235e-9,-3.314797357602177e-4,-4.6972927801329136e-5,-5.337761831657595e-9,-3.3103860655846234e-4,-4.67558263411006e-5,-5.312260680512601e-9,-3.307076685003807e-4,-4.651535747158061e-5,-5.28090259224886e-9,-3.30480214378984e-4,-4.6310845214460665e-5,-5.2532057684234896e-9,-3.303220348953695e-4,-4.618357322333606e-5,-5.236272390095169e-9,-3.301874844254908e-4,-4.61477186883596e-5,-5.233313814606197e-9,-3.3003452239918076e-4,-4.619282888887948e-5,-5.243799607308075e-9,-3.2983367667361197e-4,-4.6292393090905275e-5,-5.264447531098321e-9,-3.2957087722242947e-4,-4.6413211027825386e-5,-5.2904004316313725e-9,-3.2924630863698787e-4,-4.652281087401979e-5,-5.316302669134748e-9,-3.288714144932077e-4,-4.659436358753661e-5,-5.337217434375077e-9,-3.284653025069503e-4,-4.6609576179093505e-5,-5.349376028202255e-9,-3.2805103471112654e-4,-4.656006986482792e-5,-5.35069069746132e-9,-3.2765205016821133e-4,-4.6447489372098676E-05,-5.340948027169847e-9,-3.2728894386480116e-4,-4.628254233746377e-5,-5.321669265696422e-9,-3.2697676918230653e-4,-4.608314579988514e-5,-5.295709141439522e-9,-3.2672307735294367e-4,-4.5871826451843845e-5,-5.266715731905392e-9,-3.265269163253492e-4,-4.567268490866273e-5,-5.238595811180517e-9,-3.263787833299249e-4,-4.5508326939279494e-5,-5.2150856928611045e-9,-3.262613612892449e-4,-4.5396953226487785e-5,-5.199410066665686e-9,-3.26150973687626e-4,-4.5349627530952965e-5,-5.193932690177878e-9,-3.2601983786595027e-4,-4.5367769831319596e-5,-5.1997081785981995e-9,-3.2583937029624085e-4,-4.544098475670977e-5,-5.215918457321146e-9,-3.2558503734766617e-4,-4.554569690961154e-5,-5.2393381578890325e-9,-3.252430307869566e-4,-4.5645933134909383e-5,-5.264196058241929e-9,-3.248178384294444e-4,-4.56983335628188e-5,-5.282923877448141e-9,-3.2433764411315686e-4,-4.566298738150629e-5,-5.288101154267343e-9,-3.238524934028116e-4,-4.55187894312056e-5,-5.275271384380036e-9,-3.2342122598822694e-4,-4.527677794176033e-5,-5.245365700942163e-9,-3.230898582700321e-4,-4.498163827286755e-5,-5.205044425823437e-9,-3.228725935037573e-4,-4.469651453348592e-5,-5.164266989512154e-9,-3.2274750094473347e-4,-4.4478159074842894e-5,-5.13235180184745e-9,-3.226689152698676e-4,-4.435700005748701e-5,-5.114830829337623e-9,-3.225871774071815e-4,-4.433186738587753e-5,-5.112508862693316e-9,-3.2246425807672813e-4,-4.437776497525427e-5,-5.1224162241922625e-9,-3.2228031504722966e-4,-4.445858657848031e-5,-5.139485592758135e-9,-3.2203286741891803e-4,-4.4538062588412724E-05,-5.1580709737048375e-9,-3.217324318411406e-4,-4.4586481028774453E-05,-5.173027330322962e-9,-3.213975733128406e-4,-4.458364652752997e-5,-5.180397855754135e-9,-3.210507152123642e-4,-4.451955192695055e-5,-5.177821168001773e-9,-3.20714821071863e-4,-4.43939735421001e-5,-5.164703758157465e-9,-3.2041064399458284e-4,-4.421548906702248e-5,-5.1421458139077516e-9,-3.2015437220027257e-4,-4.400000934734236e-5,-5.112638550353013e-9,-3.199556359923085e-4,-4.3768795235697604e-5,-5.079609309330488e-9,-3.1981598750983545e-4,-4.354585021416585e-5,-5.046904699548832e-9,-3.197281840014739e-4,-4.3354726543107915e-5,-5.018289250760496e-9,-3.196765829420705e-4,-4.321510531744181e-5,-4.997015044656991e-9,-3.1963870183165634e-4,-4.313959806056474e-5,-4.985452141399794e-9,-3.195878597550035e-4,-4.313112514042971e-5,-4.984725308729074e-9,-3.1949679113388595e-4,-4.318123126172128e-5,-4.994338339842217e-9,-3.1934206103072054e-4,-4.326970683766678e-5,-5.0118522340722995e-9,-3.191090769027233e-4,-4.336592775766331e-5,-5.032784985900198e-9,-3.1879727330728615e-4,-4.3432619842126424e-5,-5.0510003085641095e-9,-3.184242585414621e-4,-4.3432905625344e-5,-5.059844813029959e-9,-3.180265341602522e-4,-4.3340679734383175e-5,-5.054050804727019e-9,-3.1765375634226675e-4,-4.315212077889462e-5,-5.031931810784182e-9,-3.173550483018549e-4,-4.289299386726835e-5,-4.996837554368338e-9,-3.1716080997909414e-4,-4.261505262909454e-5,-4.9567039021442e-9,-3.170692069796597e-4,-4.237923706416617e-5,-4.921374850462595e-9,-3.170465026363197e-4,-4.223264659485568e-5,-4.898891858407981e-9,-3.170418960140496e-4,-4.21921256965402e-5,-4.892790866082162e-9,-3.1700761388347835e-4,-4.224278875220216e-5,-4.901672313350512e-9,-3.169131831034806e-4,-4.234911923149743e-5,-4.920678900423363e-9,-3.16749371627084e-4,-4.246978287171236e-5,-4.943593716023741e-9,-3.165243898644444e-4,-4.2568904032282556e-5,-4.964541739482594e-9,-3.1625720934575716e-4,-4.262161789567898e-5,-4.9789925323940574e-9,-3.159714090148497e-4,-4.2615163483100204e-5,-4.984192983307216e-9,-3.1569080936814757e-4,-4.254769010175503e-5,-4.979239205595006e-9,-3.154366980394452e-4,-4.242640923152246e-5,-4.964927408765917e-9,-3.1522594108550356e-4,-4.226576420878259e-5,-4.9434488536958256e-9,-3.150694594909588e-4,-4.2085617046374826e-5,-4.9179780034059015e-9,-3.1497088780468846e-4,-4.190919872197873e-5,-4.892216555795521e-9,-3.1492551795328115e-4,-4.1760510317359374e-5,-4.869937621819285e-9,-3.1491993926755705e-4,-4.166103135750512e-5,-4.85453930904946e-9,-3.1493292291119807e-4,-4.162602317937051e-5,-4.8486082924002386e-9,-3.149378852148921e-4,-4.166109759027768e-5,-4.853496717228234e-9,-3.149068763252208e-4,-4.1759869297922245e-5,-4.8689420569251265e-9,-3.1481563886056355e-4,-4.1903492821241635e-5,-4.892817724760096e-9,-3.146489018901334e-4,-4.206263788736928e-5,-4.921152563389806e-9,-3.1440486675449474e-4,-4.220199291018188e-5,-4.948556753677259e-9,-3.1409782736031844e-4,-4.2286972882281444e-5,-4.969141215356648e-9,-3.1375783301927705e-4,-4.229193221838251e-5,-4.9779020409811375e-9,-3.1342629281164673e-4,-4.2208473219180394e-5,-4.972322659694826e-9,-3.131469410284784e-4,-4.205134100763301e-5,-4.953675901336095e-9,-3.129532228356514e-4,-4.185850783786602e-5,-4.927339367737182e-9,-3.128559402293983e-4,-4.168268583803075e-5,-4.901590331357037e-9,-3.128372712174129e-4,-4.157504774094596e-5,-4.884996661975068e-9,-3.1285591758021213e-4,-4.1567376446027606e-5,-4.883435028626847e-9,-3.1286216261514294e-4,-4.166161325502891e-5,-4.898203035129861e-9,-3.128152510161355e-4,-4.1832011412133305e-5,-4.926093299613993e-9,-3.1269456478840265e-4,-4.2037319835952676e-5,-4.96108661782143e-9,-3.1250114325379443e-4,-4.2235381879465134e-5,-4.996540702951394e-9,-3.1225205877241923e-4,-4.239361488219513e-5,-5.026892948270938e-9,-3.119724750885652e-4,-4.249330688871886e-5,-5.048533140222312e-9,-3.116889276893549e-4,-4.252921835778996e-5,-5.059987008882629e-9,-3.1142503078342897e-4,-4.25069961860904e-5,-5.0616921955618265e-9,-3.111992283429283e-4,-4.244023805497469e-5,-5.055583300773006e-9,-3.1102368764590496e-4,-4.234797844643438e-5,-5.044617784933671e-9,-3.1090358734081304e-4,-4.22526006575234e-5,-5.032321067688745e-9,-3.108364399804756e-4,-4.217778740604939e-5,-5.022387283844178e-9,-3.108115257297438e-4,-4.214600986581236e-5,-5.018313830814128e-9,-3.1080993296466673e-4,-4.2175257475328325e-5,-5.023008475613783e-9,-3.1080593916080375e-4,-4.227521362395652e-5,-5.038322479284464e-9,-3.1077034837130563e-4,-4.244369565068855e-5,-5.06453984568056e-9,-3.1067585579162317e-4,-4.266468404943358e-5,-5.099969884051941e-9,-3.105035849258535e-4,-4.290936505875487e-5,-5.140877929168914e-9,-3.1024899896644803e-4,-4.314094465863473e-5,-5.181956628701638e-9,-3.0992505626402714e-4,-4.332264950955875e-5,-5.217361941575282e-9,-3.095610883380589e-4,-4.342700451466909e-5,-5.2421145403966415e-9,-3.091971222357173e-4,-4.3443817524911114e-5,-5.253502474396329e-9,-3.088746927985775e-4,-4.338445254519018e-5,-5.252067765269822e-9,-3.086262289687441e-4,-4.328075377912741e-5,-5.241813665026146e-9,-3.084657459880443e-4,-4.317815751980895e-5,-5.229427402694319e-9,-3.083838136062314e-4,-4.312402180818095e-5,-5.222569664693657e-9,-3.083492587428513e-4,-4.315408297432371e-5,-5.227650075739371e-9,-3.083181203766566e-4,-4.328165458806027e-5,-5.247856867561176e-9,-3.082471429138195e-4,-4.349411061585933e-5,-5.2822613795529054e-9,-3.081064848257633e-4,-4.375827146070421e-5,-5.3263709887758225e-9,-3.0788661043989416e-4,-4.403198008161343e-5,-5.373792020884821e-9,-3.0759759139367557e-4,-4.4276497491867025e-5,-5.418190385136207e-9,-3.072628362842785e-4,-4.4465056129220834e-5,-5.454790327401472e-9,-3.0691106900856074e-4,-4.458588788817899e-5,-5.481074258715986e-9,-3.0656967318466223e-4,-4.4640878311394534e-5,-5.496772186340735e-9,-3.0626062010192915e-4,-4.464213768265969e-5,-5.5034243148592386e-9,-3.0599865177202766e-4,-4.460833959835805e-5,-5.503787246380918e-9,-3.057908013060658e-4,-4.4561687503291136e-5,-5.501265100167681e-9,-3.0563641143263365e-4,-4.4525580714277986e-5,-5.4994619326435316e-9,-3.0552715792361276e-4,-4.4522582031122806e-5,-5.501861033144501e-9,-3.0544706109613843e-4,-4.457210286773981e-5,-5.511548919490009e-9,-0.00030537297561927964,-4.4687381552856436e-5,-5.5308628299553145e-9]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json
new file mode 100644
index 0000000..2eec942
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":8000,"numberOfSamples":1000,"samples":[-3.0527640252829807e-4,-4.487182696660493e-5,-5.56088448082571e-9,-3.051274863200565e-4,-4.511556230951057e-5,-5.6008437940501195e-9,-3.049014822200931e-4,-4.5393887171247894e-5,-5.647698563779582e-9,-3.045865825423837e-4,-4.566978863347711e-5,-5.696284894052496e-9,-3.041902526794886e-4,-4.590165294193654e-5,-5.7403050551512475e-9,-3.0374053440293064e-4,-4.605480630272924e-5,-5.774008768966934e-9,-3.032803042778928e-4,-4.6112832816305496e-5,-5.793973590280497e-9,-3.028557483245855e-4,-4.608383761616052e-5,-5.800251345674449e-9,-3.025032355259023e-4,-4.599882516164128e-5,-5.796427523208801e-9,-3.022393949447573e-4,-4.5902896545994185e-5,-5.788631331365615e-9,-3.020574267495867e-4,-4.5842714571687194e-5,-5.7838921806700334e-9,-3.019300694661608e-4,-4.585434504667538e-5,-5.7883384069394884e-9,-3.0181769376023336e-4,-4.595468543172006e-5,-5.805682519418446e-9,-3.0167899235319e-4,-4.613834629665025e-5,-5.83635658405951e-9,-3.014813398322303e-4,-4.638044052124705e-5,-5.877534282545917e-9,-3.0120806044062887e-4,-4.664417952898078e-5,-5.924029708374941e-9,-3.008608032921932e-4,-4.689076983299546e-5,-5.969769115749644e-9,-3.004568895018775e-4,-4.70885065576558e-5,-6.009334760264992e-9,-3.000232042040917e-4,-4.7218579979817117e-5,-6.039104695872155e-9,-2.995891071912802e-4,-4.72766796425179e-5,-6.057736521969508e-9,-2.9918053358217385e-4,-4.7271135672653113e-5,-6.066024169441235e-9,-2.9881634126882297e-4,-4.721922325858296e-5,-6.066350982343671e-9,-2.9850682571005375e-4,-4.714317647578276e-5,-6.0620073426491385e-9,-2.982536857147729e-4,-4.706682514849363e-5,-6.056588919504954e-9,-2.9805063249734796e-4,-4.7013055973122464e-5,-6.053577596287479e-9,-2.978841024009395e-4,-4.700177778028711e-5,-6.0560846647952315e-9,-2.97733963612634e-4,-4.7047861809806975e-5,-6.066639640409404e-9,-2.975745746966664e-4,-4.715862391952254e-5,-6.086875521052076e-9,-2.9737697702912646e-4,-4.733079302488828e-5,-6.117026762619431e-9,-2.9711318240313096e-4,-4.754766231303244e-5,-6.1553289826818086e-9,-2.967630328757633e-4,-4.777820603997843e-5,-6.1976547684464505e-9,-2.963225516133362e-4,-4.7980702799556336e-5,-6.237878353608434e-9,-2.9581034269964766e-4,-4.8112531767448336e-5,-6.26929277722192e-9,-2.952671701271256e-4,-4.8144449769795835e-5,-6.286810452998715e-9,-2.9474584957997816e-4,-4.807330163392616e-5,-6.28897999422168e-9,-2.942942146728656e-4,-4.7925741507049555e-5,-6.278697823265868e-9,-2.939390776646052e-4,-4.774982986598883e-5,-6.2621933111198565e-9,-2.9367888471910724e-4,-4.759858957460034e-5,-6.246887112949443e-9,-2.9348722961036977e-4,-4.751366495959348e-5,-6.239195834786848e-9,-2.933236015115482e-4,-4.7515401306169104e-5,-6.243051945843658e-9,-2.9314581436119905e-4,-4.760093779409941e-5,-6.2593279168203955e-9,-2.9292007500896937e-4,-4.774844549298213e-5,-6.286013467788338e-9,-2.926269983387905e-4,-4.792463505513392e-5,-6.318926256564662e-9,-2.9226350769051096e-4,-4.80930810595307e-5,-6.352759512595941e-9,-2.918412941194005e-4,-4.822168516898902e-5,-6.382264012712696e-9,-2.9138274761924426e-4,-4.8288192173938596e-5,-6.4033284884177525e-9,-2.9091546827443674e-4,-4.828307144331461e-5,-6.4137142155758484e-9,-2.904666459630382e-4,-4.820960531850297e-5,-6.413290100567614e-9,-2.9005845372039675e-4,-4.808169188193544e-5,-6.403779607548024e-9,-2.897051121066428e-4,-4.7920298339887756e-5,-6.388175539851937e-9,-2.894117280467004e-4,-4.77495594070045e-5,-6.3700487926475646e-9,-2.891745460224369e-4,-4.7593309240161246e-5,-6.352958916462981e-9,-2.889819981834109e-4,-4.7472392700331755e-5,-6.340071065896678e-9,-2.8881605249833365e-4,-4.740260960082055e-5,-6.333942633116508e-9,-2.886536932128631e-4,-4.739292957383811e-5,-6.336355114475078e-9,-2.884687014832789e-4,-4.7443667570689896e-5,-6.348050662755428e-9,-2.8823427250380447e-4,-4.754452904089668e-5,-6.368308311532382e-9,-2.879272735231633e-4,-4.767303651414079e-5,-6.394467888137689e-9,-2.875345818250315e-4,-4.7794856179294424e-5,-6.4217381728864196e-9,-2.8706055734247936e-4,-4.786832012302628e-5,-6.443756519509059e-9,-2.865324198422822e-4,-4.785486234755549e-5,-6.4542037210419195e-9,-2.859983895327293e-4,-4.773390713864742e-5,-6.449179015088165e-9,-2.8551497623516194e-4,-4.7515537099475336e-5,-6.429222290163076e-9,-2.8512656698742036e-4,-4.724172825041583e-5,-6.399602792241161e-9,-2.8484791237568235e-4,-4.697228518879425e-5,-6.368414825098121e-9,-2.846599731981497e-4,-4.676227057336778e-5,-6.343524830079535e-9,-2.845204990113826e-4,-4.664360730421715e-5,-6.330077698450703e-9,-2.8438137789211793e-4,-4.661903031892221e-5,-6.32954910609419e-9,-2.842033332610527e-4,-4.666740117899054e-5,-6.340163616828402e-9,-2.8396352830062366e-4,-4.6754274987887116e-5,-6.357961127061933e-9,-2.836566692220362e-4,-4.684229725179311e-5,-6.377959739889069e-9,-2.8329216427076527e-4,-4.689886773239183e-5,-6.395189096969708e-9,-2.828896488527907e-4,-4.6900720390375284e-5,-6.405540596281919e-9,-2.824742018907562e-4,-4.6836037546351875e-5,-6.4064023526000905e-9,-2.8207178859335354e-4,-4.670471097933904e-5,-6.397002591025266e-9,-2.817052464373959e-4,-4.6517083949337426e-5,-6.378389721142845e-9,-2.8139115347079264e-4,-4.629149712487325e-5,-6.3530658178796655e-9,-2.811378256204399e-4,-4.605106192105769e-5,-6.324396845660935e-9,-2.8094456582733565e-4,-4.582011369839805e-5,-6.295969795469077e-9,-2.8080213121061873e-4,-4.562084808863251e-5,-6.271061910825657e-9,-2.806941282722342e-4,-4.547056083835451e-5,-6.252305778500468e-9,-2.805989529923734e-4,-4.537959014034061e-5,-6.241511789741509e-9,-2.80492067241958e-4,-4.5349843601162954e-5,-6.239532828776588e-9,-2.803485913613245e-4,-4.5373805665704785e-5,-6.246068068716576e-9,-2.8014639891832464e-4,-4.543399639996473e-5,-6.259380228216586e-9,-2.7987013346108646e-4,-4.550321157816095e-5,-6.276047783203556e-9,-2.795162996405821e-4,-4.5546626057891795e-5,-6.291045688354151e-9,-2.790984739623287e-4,-4.5527321372703615e-5,-6.298505516465384e-9,-2.7865004000894166e-4,-4.541620148794469e-5,-6.2933199008508685e-9,-2.7822043288384707e-4,-4.520484869900707e-5,-6.273276588202333e-9,-2.7786184532760936e-4,-4.4915535087074116e-5,-6.240723143326448e-9,-2.776091852793529e-4,-4.459975553570474e-5,-6.202458787212566e-9,-2.774638632702066e-4,-4.432123225548417e-5,-6.167368360824802e-9,-2.7739275622409024e-4,-4.41307893297388e-5,-6.142942429461774e-9,-2.7734363791847937e-4,-4.404793703195258e-5,-6.132712569902154e-9,-2.772666481119829e-4,-4.405873879426259e-5,-6.135803693451539e-9,-2.7712954630060494e-4,-4.41272344392883e-5,-6.148198003690473e-9,-2.769220926915838e-4,-4.421078330515423e-5,-6.164515668643785e-9,-2.7665243775120893e-4,-4.4271847046803456e-5,-6.179465722684056e-9,-2.7634044414996943e-4,-4.42840858576599e-5,-6.188763867311319e-9,-2.760112787880964e-4,-4.4233969441495255e-5,-6.1896325079837635e-9,-2.7569053678467995e-4,-4.4119908832911274e-5,-6.1810143630256235e-9,-2.7540081443001705e-4,-4.395037973603709e-5,-6.1635500652351195e-9,-2.7515925763830574e-4,-4.374163186724933e-5,-6.13931893200916e-9,-2.7497583229343773e-4,-4.351509382685275e-5,-6.1113765985356755e-9,-2.7485228599034487e-4,-4.3294504323835476e-5,-6.083191373407955e-9,-2.747818899337699e-4,-4.3102814240736015e-5,-6.0580978536060394e-9,-2.7475014030275356e-4,-4.2959058861573174e-5,-6.038863549547172e-9,-2.747364727847155e-4,-4.287561578709453e-5,-6.027414092691353e-9,-2.7471679197166814e-4,-4.2856211898555225e-5,-6.024680664675889e-9,-2.74666552518033e-4,-4.2894856634732136e-5,-6.0304870842090665e-9,-2.745641634544586e-4,-4.297583426922976e-5,-6.043429961128174e-9,-2.7439449831047824e-4,-4.307484329777695e-5,-6.060781782144661e-9,-2.7415239183585174e-4,-4.316139154284506e-5,-6.078538519547611e-9,-2.738458939963984e-4,-4.320289628151456e-5,-6.0918223659286445e-9,-2.7349833665268886e-4,-4.317111271140737e-5,-6.095829254040278e-9,-2.731473286401864e-4,-4.305077016877184e-5,-6.087300751131777e-9,-2.728384066406977e-4,-4.284850797286421e-5,-6.0661306830069746e-9,-2.726122464122091e-4,-4.2597682445614436e-5,-6.036317211131248e-9,-2.724883882208636e-4,-4.2353186226421395e-5,-6.005346149629137e-9,-2.724538993112942e-4,-4.21739660621937e-5,-5.981721324392774e-9,-2.7246601864680027e-4,-4.209994110375406e-5,-5.971667694606237e-9,-2.724694960632973e-4,-4.2136627145050584e-5,-5.976871636177898e-9,-2.724184831524113e-4,-4.225643997788255e-5,-5.9944559253544774e-9,-2.7229051896981396e-4,-4.241362759713718e-5,-6.018773549341146e-9,-2.720878961454436e-4,-4.2562043557314734e-5,-6.043635716054438e-9,-2.718303929497391e-4,-4.266714123706157e-5,-6.063913242192316e-9,-2.715458512132313e-4,-4.271024379125761e-5,-6.076285881259704e-9,-2.712626659453091e-4,-4.268748746246162e-5,-6.07938776767281e-9,-2.710052329722968e-4,-4.260653559518088e-5,-6.073631332430156e-9,-2.707916949070718e-4,-4.248307887576607e-5,-6.060863861100873e-9,-2.7063291676093104e-4,-4.233782096456377e-5,-6.043919283576518e-9,-2.70531999054325e-4,-4.2193858972839276e-5,-6.026112658845783e-9,-2.7048412159524855e-4,-4.207417276834723e-5,-6.010749252660998e-9,-2.704768085276078e-4,-4.199898085891688e-5,-6.0007083249929064e-9,-2.7049091718653486e-4,-4.198292846456885e-5,-5.998122765150181e-9,-2.705026716692996e-4,-4.203245930769175e-5,-6.0041500657964715e-9,-2.704867786001442e-4,-4.2143960157053555e-5,-6.018813110137525e-9,-2.7042033326989443e-4,-4.2303217237346e-5,-6.0408918160634616e-9,-2.702869966792254e-4,-4.248659500899885e-5,-6.067897441023674e-9,-2.7008072908028737e-4,-4.26641123975258e-5,-6.096212887106141e-9,-2.698083301299173e-4,-4.2804202514864496e-5,-6.121495193355481e-9,-2.6949017078992116e-4,-4.287971029548579e-5,-6.139410707238995e-9,-2.6915846953213103e-4,-4.287457712691834e-5,-6.146692366322419e-9,-2.688523188530164e-4,-4.2790136468926805e-5,-6.142330933965789e-9,-2.6860905054935876e-4,-4.2648942394378234e-5,-6.128480097984698e-9,-2.684529386021688e-4,-4.249325511328419e-5,-6.110525799006696e-9,-2.683846561272461e-4,-4.237577162193681e-5,-6.0958916495610374e-9,-2.6837713845480256e-4,-4.2343242447415576e-5,-6.091676533973367e-9,-2.6838259865424467e-4,-4.241897119821026e-5,-6.1020278393601044e-9,-2.6834954243159544e-4,-4.259356052706968e-5,-6.126618946744287e-9,-2.682414538672124e-4,-4.282968580925502e-5,-6.161071746178656e-9,-2.680473788683876e-4,-4.307777590451198e-5,-6.198928228542621e-9,-2.6778068952418554e-4,-4.329323584064263e-5,-6.233932842908828e-9,-2.6746984498891765e-4,-4.3447294758245534e-5,-6.261585257801009e-9,-2.6714767994234935e-4,-4.3529579126087075e-5,-6.279696539448954e-9,-2.6684354540698494e-4,-4.3545106782298875e-5,-6.288235271926127e-9,-2.6657927046700944e-4,-4.3509317188260445e-5,-6.288838671033637e-9,-2.6636794026195363e-4,-4.3443465401146905e-5,-6.284232359286678e-9,-2.662140688653375e-4,-4.33711394559145e-5,-6.277670357631493e-9,-2.661141777281877e-4,-4.331570058397092e-5,-6.272450417208355e-9,-2.660574130223562e-4,-4.329813146063895e-5,-6.271533343649169e-9,-2.6602631028516745e-4,-4.3334832510506525e-5,-6.277259574999488e-9,-2.6599810856047266e-4,-4.3435186752350394e-5,-6.291119283070944e-9,-2.6594709819864e-4,-4.35991710667151e-5,-6.313534449691571e-9,-2.6584826187483416e-4,-4.3815728146144786e-5,-6.3436577175095264e-9,-2.6568197080015167e-4,-4.406282185693006e-5,-6.379260979809167e-9,-2.654388737832523e-4,-4.4309976961368614e-5,-6.416844899921613e-9,-2.651235904796523e-4,-4.452352360454744e-5,-6.45208973946681e-9,-2.6475574490715504e-4,-4.467379291793127e-5,-6.480660100582804e-9,-2.643674413816663e-4,-4.474263772198858e-5,-6.499235785255884e-9,-2.639972203386808e-4,-4.472932230357101e-5,-6.506524425656316e-9,-2.636814333534693e-4,-4.4652981742684745e-5,-6.50394943475184e-9,-2.6344474410546685e-4,-4.455031096217054e-5,-6.4957052750673075e-9,-2.6329215242018296e-4,-4.446797824163044e-5,-6.487971527226249e-9,-2.6320539661309406e-4,-4.445066132419316e-5,-6.487318143828218e-9,-2.63146231141766e-4,-4.452761326611089e-5,-6.498693327228091e-9,-2.630670795117471e-4,-4.4702593314460794e-5,-6.523735117410233e-9,-2.629259962418986e-4,-4.495205403355389e-5,-6.560195481816707e-9,-2.626998326199566e-4,-4.523322969000845e-5,-6.6028055138425835e-9,-2.6238984542081514e-4,-4.5498615964264204e-5,-6.645151128486782e-9,-2.620181139265042e-4,-4.57101034480172e-5,-6.681643636040315e-9,-2.6161796896905014e-4,-4.584720776675456e-5,-6.7088001834994565e-9,-2.6122365300701173e-4,-4.590801043953323e-5,-6.725594759670876e-9,-2.608629732320002e-4,-4.590508421570969e-5,-6.733110680725014e-9,-2.605538971319134e-4,-4.585973386898697e-5,-6.733869753505527e-9,-2.6030410219870376e-4,-4.5796853823059685e-5,-6.731122265893311e-9,-2.601120119629486e-4,-4.574121346938611e-5,-6.728248726724007e-9,-2.5996821459528486e-4,-4.571499884470834e-5,-6.728333811525041e-9,-2.5985675252670267e-4,-4.573601546615178e-5,-6.733900781581118e-9,-2.597563470776258e-4,-4.581593891770877e-5,-6.7467347208660815e-9,-2.596420276961034e-4,-4.5958327928148174e-5,-6.76770494879153e-9,-2.594877524327709e-4,-4.6156630892450285e-5,-6.796534200413236e-9,-2.5927042693107434e-4,-4.6392942692009576e-5,-6.8315565589601714e-9,-2.589751849875842e-4,-4.663871238482509e-5,-6.86962752289666e-9,-2.586008062635789e-4,-4.685864046342157e-5,-6.906416881867135e-9,-2.5816311466290005e-4,-4.7018104873896896e-5,-6.937219567577798e-9,-2.5769402554871504e-4,-4.70926588010539e-5,-6.9581636155644655e-9,-2.5723517884218273e-4,-4.707644773329669e-5,-6.967428938305518e-9,-2.568273908815006e-4,-4.6986025040791123e-5,-6.966001210496018e-9,-2.564992393431867e-4,-4.685748280218821e-5,-6.957630999254399e-9,-2.5625871902160277e-4,-4.6737400412949545e-5,-6.947966529409689e-9,-2.5609074998136574e-4,-4.667043573132832e-5,-6.943105351110571e-9,-2.5596122517727485e-4,-4.6687347367702306e-5,-6.947967062704738e-9,-2.5582634783583117e-4,-4.6796866950713174e-5,-6.964938644351132e-9,-2.5564461158371896e-4,-4.698373076282578e-5,-6.993209196686726e-9,-2.553879109156633e-4,-4.7213518226825917E-05,-7.029044733220987e-9,-2.5504832832596024e-4,-4.744277599023395e-5,-7.066933407213379e-9,-2.5463858429774843e-4,-4.7630969964505535e-5,-7.1011838454172516e-9,-2.541865650862485e-4,-4.775023325017012e-5,-7.127396703046114e-9,-2.537265402404863e-4,-4.7790107831489385e-5,-7.143345909601783e-9,-2.532904918374822e-4,-4.775683549761495e-5,-7.1491178104008635e-9,-2.529021042786563e-4,-4.766889086299671e-5,-7.146663004807935e-9,-2.525741732148423e-4,-4.7551249353078e-5,-7.139062192878236e-9,-2.5230871169483677e-4,-4.743029000875771e-5,-7.129782907503167e-9,-2.5209851175530824e-4,-4.733012368995658e-5,-7.12209759254885e-9,-2.519291245187472e-4,-4.7270279788107355e-5,-7.1187265860613594e-9,-2.517806968882801e-4,-4.726422556842384e-5,-7.12166746585097e-9,-2.5162963986732293e-4,-4.731809415808857e-5,-7.132097650423624e-9,-2.514505510713131e-4,-4.742927313984141e-5,-7.1502341423829864e-9,-2.512190030433243e-4,-4.758501628393123e-5,-7.175103678264232e-9,-2.5091568236328035e-4,-4.7761815907209246e-5,-7.204305121348925e-9,-2.5053181294401e-4,-4.7926849500478765e-5,-7.233991717484305e-9,-2.500746237911642e-4,-4.804301276238442e-5,-7.259360514494356e-9,-2.495701519604955e-4,-4.8078046570921506e-5,-7.275783141609628e-9,-2.490601882212913e-4,-4.8015746621047336e-5,-7.280321967292176e-9,-2.4859206990471175e-4,-4.786450499113676e-5,-7.272987851368456e-9,-2.4820404096295365e-4,-4.7657974491023386e-5,-7.2570490683069305e-9,-2.479123719305355e-4,-4.744593983612639e-5,-7.238137844085153e-9,-2.477062542180496e-4,-4.7278801363755583e-5,-7.2225323219480234e-9,-2.475523859045091e-4,-4.719243023421515e-5,-7.2153509223338515e-9,-2.4740634073176207e-4,-4.7199163254914456e-5,-7.21928276128765e-9,-2.472256149075255e-4,-4.728689651818537e-5,-7.234113502680999e-9,-2.469800996566623e-4,-4.742481447800407e-5,-7.2570090226968695e-9,-2.4665781472638505e-4,-4.757279635380423e-5,-7.283374548153914e-9,-2.462655369996502e-4,-4.769151536169288e-5,-7.308038135183422e-9,-2.458251322065457e-4,-4.775085456159175e-5,-7.326465854721028e-9,-2.4536711100036463e-4,-4.77350886691006e-5,-7.3357152755733405e-9,-2.4492329122390537e-4,-4.764420066221715e-5,-7.334911212083219e-9,-2.4452039783219196e-4,-4.749169496663902e-5,-7.3251748443696005e-9,-2.441758732145271e-4,-4.7300134577938174e-5,-7.309112821670338e-9,-2.4389627170717684e-4,-4.7095968591426874e-5,-7.2900891206745445e-9,-2.4367780651202367e-4,-4.6904922721911e-5,-7.2715143086660904e-9,-2.4350820404063506e-4,-4.674862028056588e-5,-7.2563236900772534e-9,-2.4336901910568495e-4,-4.6642494199979074e-5,-7.246701350541432e-9,-2.4323787902715116e-4,-4.6594604978692496e-5,-7.243991435989502e-9,-2.4309057272598025e-4,-4.6604855006113405e-5,-7.248666445835073e-9,-2.4290326713360635e-4,-4.666429753503088e-5,-7.260234391154556e-9,-2.4265533867043101e-4,-4.67546250155109e-5,-7.2770527231963495e-9,-2.4233328045250883e-4,-4.684845105661854e-5,-7.29615811529741e-9,-2.4193563237893614e-4,-4.6911622727816726e-5,-7.313363425619466e-9,-2.4147769061437337e-4,-4.690904210391057e-5,-7.323911274472526e-9,-2.409931846698145e-4,-4.68145030450435e-5,-7.3237831866979765e-9,-2.405293638181594e-4,-4.6622304985804496e-5,-7.311327256640174e-9,-2.4013397134164407e-4,-4.6354911420302454e-5,-7.288398575368516e-9,-2.3983792521253927e-4,-4.606009583001144e-5,-7.260171753226957e-9,-2.396424964711392e-4,-4.579591722183568e-5,-7.233460507133913e-9,-2.3951876787466002e-4,-4.561007369104896e-5,-7.21434469153871e-9,-2.394196251219914e-4,-4.552433842374012e-5,-7.206304347525716e-9,-2.3929702425245816e-4,-4.553082614515197e-5,-7.209572961363757e-9,-2.3911604156302504e-4,-4.559902693265397e-5,-7.221607636814043e-9,-2.3886148969033618e-4,-4.56878141259867e-5,-7.238141334743658e-9,-2.385376124584638e-4,-4.57569458542221e-5,-7.25434375948497e-9,-2.381635151221613e-4,-4.5775227331894453e-5,-7.265844606590987e-9,-2.3776689984276165e-4,-4.57248113055291e-5,-7.26951760352044e-9,-2.3737775512568452e-4,-4.560224089873021e-5,-7.26396202658587e-9,-2.3702288262502963e-4,-4.541701560695537e-5,-7.249620171308552e-9,-2.3672182048234104e-4,-4.518837706556744e-5,-7.228512886555455e-9,-2.3648451210419064e-4,-4.494110071809932e-5,-7.203679129923876e-9,-2.3631073766417756e-4,-4.470112417759971e-5,-7.1784915077864556e-9,-2.3619104748406788e-4,-4.449166637344944e-5,-7.156032804897266e-9,-2.361087730659606e-4,-4.433028327220373e-5,-7.138674148007875e-9,-2.3604256281260482e-4,-4.422705852302139e-5,-7.1278965459513375e-9,-2.3596896071219697e-4,-4.41837594790764e-5,-7.124282211477298e-9,-2.358648734407393e-4,-4.419359846967748e-5,-7.127541904743606e-9,-2.3571005457793368e-4,-4.424139308519803e-5,-7.136477505700135e-9,-2.3548986076137152e-4,-4.4304182265018096e-5,-7.148875985336727e-9,-2.3519855436410849e-4,-4.435271161882365e-5,-7.16145714276836e-9,-2.348430390860336e-4,-4.4354724701945077e-5,-7.170110582162483e-9,-2.3444587375598763e-4,-4.428117792866847e-5,-7.170657306550671e-9,-2.3404509111068765e-4,-4.411557127942225e-5,-7.1601656476032516e-9,-2.3368771973065835e-4,-4.386412570504797e-5,-7.138447255205115e-9,-2.334157329157928e-4,-4.356117057573164e-5,-7.108920211252188e-9,-2.3324859251575434e-4,-4.326304457334257e-5,-7.077986722810363e-9,-2.3317225159038513e-4,-4.3029164658112595e-5,-7.0528241170588876e-9,-2.3314325821755143e-4,-4.289880884221161e-5,-7.038651316312173e-9,-2.3310674475310233e-4,-4.287707539508815e-5,-7.037006731343113e-9,-2.330173793949718e-4,-4.2937138101060195e-5,-7.045793591462278e-9,-2.3285221519255721e-4,-4.303448249497462e-5,-7.060613085178226e-9,-2.3261221161084732e-4,-4.312326355963217e-5,-7.076380098752534e-9,-2.3231616237874106e-4,-4.3167782922615494e-5,-7.0885642907420745e-9,-2.3199226213489643e-4,-4.3147504709399666e-5,-7.093925360427784e-9,-2.3167066135599025e-4,-4.305722178644823e-5,-7.090854405127532e-9,-2.3137815592412457e-4,-4.290464072813479e-5,-7.079431225173229e-9,-2.3113482317374794e-4,-4.2706990561187926e-5,-7.061239222047379e-9,-2.3095210624270325e-4,-4.248733394858226e-5,-7.0389514644621475e-9,-2.3083209319112942e-4,-4.22708356697799e-5,-7.0157556508521975e-9,-2.3076787058155768e-4,-4.208124244565444e-5,-6.994754152444318e-9,-2.3074481404720975e-4,-4.193779429781794e-5,-6.978475418029599e-9,-2.3074269629111773e-4,-4.185278131262165e-5,-6.9685812919441475e-9,-2.3073838954341724e-4,-4.183002690679065e-5,-6.9657828504140465e-9,-2.307087773182823e-4,-4.1864416184094224e-5,-6.969890191920407e-9,-2.3063358371772487e-4,-4.19423194920427e-5,-6.979881232260712e-9,-2.304980447362638e-4,-4.204276810737836e-5,-6.993919691136392e-9,-2.3029541532778425e-4,-4.2139396145542684e-5,-7.00935383163725e-9,-2.3002929420596648e-4,-4.220331442258605e-5,-7.022821179996584e-9,-2.297155277725766e-4,-4.220735882242904e-5,-7.0306406913778314e-9,-2.2938274641947577e-4,-4.2132214476566026e-5,-7.029632424365228e-9,-2.2906972807424893e-4,-4.197407643695822e-5,-7.018296801761733e-9,-2.2881761972917472e-4,-4.175160042946605e-5,-6.997961873684011e-9,-2.286567093282979e-4,-4.15075256296687e-5,-6.9732029722847966e-9,-2.2859182172845228e-4,-4.129977684881916e-5,-6.9508561159118375e-9,-2.2859518852719337e-4,-4.118158264999498e-5,-6.937623078004585e-9,-2.2861445669427582e-4,-4.1179317366699686e-5,-6.937368890191579e-9,-2.2859373178187907e-4,-4.128165726085842e-5,-6.949709434593278e-9,-2.2849535207625107e-4,-4.144683429672747e-5,-6.970641653126126e-9,-2.283102601143957e-4,-4.162180946726997e-5,-6.994513297007544e-9,-2.280546314648973e-4,-4.1760936140705576e-5,-7.015996457807604e-9,-2.2775905137933017e-4,-4.1836162324814815e-5,-7.0312662464705675e-9,-2.2745750303615093e-4,-4.183854159207291e-5,-7.038384862713035e-9,-2.2717978153226345e-4,-4.1774688473891304e-5,-7.037214328561364e-9,-2.269476550317656e-4,-4.166168283592476e-5,-7.029107904443636e-9,-2.2677360769187676e-4,-4.152239765949198e-5,-7.016489998134974e-9,-2.2666086428735168e-4,-4.13817553708349e-5,-7.002360297324509e-9,-2.2660400530891817e-4,-4.126365474609324e-5,-6.989766583218536e-9,-2.2659004542151717e-4,-4.1188304668478054e-5,-6.981333927974789e-9,-2.266000219235072e-4,-4.116989011754661e-5,-6.978931288333946e-9,-2.266111881676761e-4,-4.12146495166316e-5,-6.9835033237536505e-9,-2.2659985001449061e-4,-4.131967774449151e-5,-6.9950455254666655e-9,-2.2654460748588225e-4,-4.147283960401956e-5,-7.012666563520272e-9,-2.264295628693442e-4,-4.165394006870694e-5,-7.034672741319516e-9,-2.2624709886908756e-4,-4.183709352380845e-5,-7.058654437906543e-9,-2.259998866238783e-4,-4.1994173550205136e-5,-7.081632424729571e-9,-2.2570180047419192e-4,-4.20991362790095e-5,-7.100361989265034e-9,-2.2537742095192945e-4,-4.213298776272619e-5,-7.111886301353217e-9,-2.2505959382885995e-4,-4.208912506154797e-5,-7.114348718520941e-9,-2.2478421898691062e-4,-4.197821401236689e-5,-7.107904138739319e-9,-2.2458174592226204e-4,-4.1830607186345735e-5,-7.0953504217620375e-9,-2.244663606137209e-4,-4.169327376221295e-5,-7.081979987657558e-9,-2.2442665203386655e-4,-4.1618683723854355e-5,-7.074284006802257e-9,-2.2442408061700852e-4,-4.1646821969372816e-5,-7.077692877238242e-9,-2.2440397415766895e-4,-4.178786877968106e-5,-7.0943342038050634e-9,-2.2431615173148974e-4,-4.201628734466668e-5,-7.122132208245681e-9,-2.2413418489370047e-4,-4.2281316841771065e-5,-7.155838491573877e-9,-2.238625036955378e-4,-4.252762716447894e-5,-7.189267752364687e-9,-2.2352958981585374e-4,-4.271389191467571e-5,-7.217364886846549e-9,-2.231742512295794e-4,-4.2821232086966055e-5,-7.2372470959088515e-9,-2.2283320562756947e-4,-4.285179730744506e-5,-7.2482661351785805e-9,-2.2253387205703278e-4,-4.282232746248896e-5,-7.2515555960049095e-9,-2.2229206566917885e-4,-4.275713751688142e-5,-7.2494356512215224e-9,-2.2211260756237194e-4,-4.2682685880708425e-5,-7.244838453971768e-9,-2.2199099538278396e-4,-4.262399641811782e-5,-7.240796077498677e-9,-2.2191514949620428e-4,-4.260230497054901e-5,-7.240011891369483e-9,-2.2186707232957353e-4,-4.26332616889838e-5,-7.244543832697758e-9,-2.2182464125580366e-4,-4.2725338241283515e-5,-7.255615619695993e-9,-2.217638453501513e-4,-4.287842690194515e-5,-7.273534478793906e-9,-2.2166170729793913e-4,-4.308298693357485e-5,-7.2976765517466445e-9,-2.2149980429336165e-4,-4.332033803452491e-5,-7.326522432477613e-9,-2.2126785688274673e-4,-4.3564584276414805e-5,-7.357751075488498e-9,-2.20966584781167e-4,-4.3786290015324124e-5,-7.388436436288333e-9,-2.2060898292754956e-4,-4.395759483340187e-5,-7.415404439706891e-9,-2.202193504707468e-4,-4.405796910551689e-5,-7.435775583366592e-9,-2.1982983813928416e-4,-4.407947682940211e-5,-7.4476444040565705e-9,-2.1947474914701923e-4,-4.403040203489803e-5,-7.450766846569757e-9,-2.1918316392070605e-4,-4.393615767618415e-5,-7.447040423172644e-9,-2.1897091886597989e-4,-4.3836355658260945e-5,-7.440501159279104e-9,-2.188338255077648e-4,-4.3777167322247025e-5,-7.4366017543605706e-9,-2.187450180632313e-4,-4.379926707359548e-5,-7.440747299185002e-9,-2.1865951766138927e-4,-4.3924079338995526e-5,-7.456451577868975e-9,-2.1852701523895825e-4,-4.414394644131482e-5,-7.48388495394003e-9,-2.1830915181893224e-4,-4.442241000664643e-5,-7.51964660486929e-9,-2.1799327092026865e-4,-4.47064341649404e-5,-7.558021886353412e-9,-2.1759542948186208e-4,-4.4945093539923776e-5,-7.593080121112747e-9,-2.1715190572061313e-4,-4.510525927973701e-5,-7.62051102463403e-9,-2.1670511352975532e-4,-4.5177775919498044e-5,-7.63846614779529e-9,-2.1629130702600425e-4,-4.5174263035486545e-5,-7.647414111500688e-9,-2.1593400226015044e-4,-4.511913434864514e-5,-7.649461867526958e-9,-2.1564283671687278e-4,-4.504151932089862e-5,-7.647573809127245e-9,-2.1541555700511315e-4,-4.496945565191675e-5,-7.644907915657562e-9,-2.152409460728591e-4,-4.4926547873120016E-05,-7.644326527091175e-9,-2.1510150205944102e-4,-4.493027145003056e-5,-7.648080390942638e-9,-2.1497560662559327e-4,-4.499101379307958e-5,-7.65764086825275e-9,-2.1483945926710325e-4,-4.511125926355644e-5,-7.673632641449619e-9,-2.1466926637521481e-4,-4.528477274004901e-5,-7.695803268049495e-9,-2.144441173207301e-4,-4.549613641988964e-5,-7.722992976764426e-9,-2.1414962209211983e-4,-4.572138551931352e-5,-7.753133503949428e-9,-2.137817825713578e-4,-4.5930557875204e-5,-7.783365806364265e-9,-2.1334992695909555e-4,-4.609259275443571e-5,-7.810385927253544e-9,-2.1287718132165904e-4,-4.6182138061975344e-5,-7.831058043246478e-9,-2.123972901802133e-4,-4.618667111745394e-5,-7.843194529569795e-9,-2.1194776550871445e-4,-4.611156504767954e-5,-7.846275859882824e-9,-2.1156084382754122e-4,-4.598097245517623e-5,-7.841849026160612e-9,-2.1125475027746477e-4,-4.5833615902049135e-5,-7.833415837621815e-9,-2.1102786191385352e-4,-4.57141563789811e-5,-7.825754714870187e-9,-2.1085766176323766e-4,-4.5662121102797614e-5,-7.823773717687805e-9,-2.1070526783781765e-4,-4.570112440445812e-5,-7.831148800367581e-9,-2.1052503260910168e-4,-4.5831388471697066e-5,-7.84914193292144e-9,-2.1027715631769618e-4,-4.602835716858338e-5,-7.876058836978009e-9,-2.0993957436240816e-4,-4.6248926026246374e-5,-7.90766713758257e-9,-2.095146194759454e-4,-4.644402823389973e-5,-7.938509723459188e-9,-2.0902749841148404e-4,-4.6573103373786205e-5,-7.963593692431587e-9,-2.085173003005473e-4,-4.6614726939852604e-5,-7.979751223426029e-9,-2.080247685004384e-4,-4.656971988276465e-5,-7.986202202748241e-9,-2.0758195037667867e-4,-4.645702153575651e-5,-7.984303236040702e-9,-2.0720680107128868e-4,-4.630568678322192e-5,-7.976805592462343e-9,-2.069027746736158e-4,-4.6146864470554793E-05,-7.967006829227965e-9,-2.0666149949068237e-4,-4.6008053738656595e-5,-7.958051544835984e-9,-2.0646643337144435e-4,-4.591001322147901e-5,-7.952478950941206e-9,-2.0629619473845173e-4,-4.586558575032321e-5,-7.952010523962518e-9,-2.0612715730170046e-4,-4.587946155808738e-5,-7.957511462395227e-9,-2.0593551752786214e-4,-4.594814009737746e-5,-7.969025447952002e-9,-2.0569936999224403e-4,-4.6059814191126656e-5,-7.985789917193825e-9,-2.054013396767555e-4,-4.619444426954505e-5,-8.006201300389058e-9,-2.0503200586908336e-4,-4.632476440606799e-5,-8.027795774410303e-9,-2.0459370977526643e-4,-4.6419232557928356e-5,-8.04739911864323e-9,-2.0410341514187733e-4,-4.644771828424737e-5,-8.061606874456355e-9,-2.0359249297940358e-4,-4.6389591386022976e-5,-8.06761967917358e-9,-2.0310152417526018e-4,-4.6241943470151586e-5,-8.064208675557398e-9,-2.026701314330422e-4,-4.602412220191169e-5,-8.05238930586289e-9,-2.0232482212882342e-4,-4.5775201703916056e-5,-8.035415203185357e-9,-2.0206981769589567e-4,-4.5543952383211005e-5,-8.017995799141722e-9,-2.0188503857131567e-4,-4.5374719563007136e-5,-8.005002937932091e-9,-2.0173208974531864e-4,-4.5294685661682146e-5,-8.000132839061242e-9,-2.0156558865288865e-4,-4.530694102432007e-5,-8.004940251523124e-9,-2.0134563404935994e-4,-4.5390862347908655e-5,-8.018476540387911e-9,-2.010477628284383e-4,-4.5508700213428396e-5,-8.037583629336856e-9,-2.0066816008643582e-4,-4.56159424839469e-5,-8.05775420557668e-9,-2.002233040454102e-4,-4.5672547498502866e-5,-8.074324603901956e-9,-1.9974456130923202e-4,-4.5652156194690424e-5,-8.083656540042794e-9,-1.992695170896543e-4,-4.554701856445397e-5,-8.083957366931921e-9,-1.9883270591920156e-4,-4.5367698049175715e-5,-8.075522287619769e-9,-1.9845841745310465e-4,-4.513832170771045e-5,-8.060398815725766e-9,-1.981572124953109e-4,-4.488951139782889e-5,-8.041672208553757e-9,-1.9792619199168255e-4,-4.46514605035761e-5,-8.022654713173082e-9,-1.97751818665741e-4,-4.444885607769098e-5,-8.006221420156825e-9,-1.9761372928278598e-4,-4.429815409582809e-5,-7.994418534127477e-9,-1.9748834183331958e-4,-4.4206787770554826e-5,-7.988349103172298e-9,-1.9735172150645567e-4,-4.417347840913245e-5,-7.988243219864344e-9,-1.9718177685405577e-4,-4.4188897515318655e-5,-7.993577576316224e-9,-1.969602185929472e-4,-4.423633228093872e-5,-8.003137811219496e-9,-1.96674791367231e-4,-4.429249144944042e-5,-8.01500158984719e-9,-1.9632209229852586e-4,-4.43290434847933e-5,-8.026530943997656e-9,-1.9591072087203853e-4,-4.4315855466975366e-5,-8.03455558004738e-9,-1.9546352222861362e-4,-4.422685189198833e-5,-8.035926730100295e-9,-1.9501665604001342e-4,-4.404835137258371e-5,-8.028456381532183e-9,-1.9461311284592976e-4,-4.3787482447394696e-5,-8.011956426634773e-9,-1.9429036612252486e-4,-4.3475903590539156e-5,-7.988819905738023e-9,-1.9406609579109184e-4,-4.31641133352837e-5,-7.963631507898714e-9,-1.939293801808378e-4,-4.290607476846081e-5,-7.941776010191559e-9,-1.9384326424020214e-4,-4.274050836180446e-5,-7.927647618378034e-9,-1.9375801371840964e-4,-4.267820492195053e-5,-7.923311832665135e-9,-1.9362806935360174e-4,-4.270088509049269e-5,-7.928124868965717e-9,-1.934249241067107e-4,-4.277008015595093e-5,-7.93923136862352e-9,-1.931422172148227e-4,-4.284026359050476e-5,-7.952533831849908e-9,-1.9279378906395382e-4,-4.287086605432226e-5,-7.963753390058145e-9,-1.9240746774724533e-4,-4.283438753175265e-5,-7.96935681810304e-9,-1.9201729184363728e-4,-4.272004332166115e-5,-7.967224995384466e-9,-1.9165604145344355e-4,-4.253352928312996e-5,-7.956980058119363e-9,-1.9134921912310286e-4,-4.229384282667856e-5,-7.939923003820991e-9,-1.9111121492372828e-4,-4.202818834980984e-5,-7.91860535841166e-9,-1.9094402083634387e-4,-4.176615800307559e-5,-7.896162848299419e-9,-1.9083831639714896e-4,-4.1534410208336746e-5,-7.87561120850624e-9,-1.9077625422079947e-4,-4.1352743879738196e-5,-7.859295143438076e-9,-1.9073505303328413e-4,-4.123196142628293e-5,-7.848605195695082e-9,-1.9069054410135802e-4,-4.1173414159399545e-5,-7.843964753064974e-9,-1.906201224278099e-4,-4.116971136664543e-5,-7.844982280018888e-9,-1.905050256123524e-4,-4.1205978856558556e-5,-7.850625899117948e-9,-1.9033218543530693e-4,-4.126132493487268e-5,-7.859318656901609e-9,-1.9009597946679268e-4,-4.131052250053904e-5,-7.868951080561997e-9,-1.8980014139863044e-4,-4.1326260782891054e-5,-7.876912836277283e-9,-1.8945967012305145e-4,-4.128269700216912e-5,-7.880323549005257e-9,-1.8910169760086778e-4,-4.116102678475968e-5,-7.876614821307504e-9,-0.00018876338867391296,-4.0956863108143176e-5,-7.864445949430287e-9,-1.884847853602136e-4,-4.0687258733253435e-5,-7.844654109638144e-9,-1.8829616966925856e-4,-4.039278804799636e-5,-7.820672655457958e-9,-1.88203845813791e-4,-4.012954778719805e-5,-7.797856014628003e-9,-1.8818277508791647e-4,-3.995054240701812e-5,-7.781684520999545e-9,-1.881832875362198e-4,-3.988448188439229e-5,-7.77566376533795e-9,-1.8815018874959586e-4,-3.992443525486756e-5,-7.780096416824334e-9,-1.880434791354815e-4,-4.003285000490112e-5,-7.792321866458137e-9,-1.8784973035415947e-4,-4.015822215563545e-5,-7.808013539986401e-9,-1.8758115050261835e-4,-4.025292234742e-5,-7.822655543413694e-9,-1.872668184883031e-4,-4.02846843903453e-5,-7.832609350063291e-9,-1.869421745375567e-4,-4.024036343886389e-5,-7.835668960723405e-9,-1.866405011096358e-4,-4.012421563344865e-5,-7.831233109466725e-9,-1.8638746606769327e-4,-3.9953517066443375e-5,-7.820209997762073e-9,-1.8619833336478678e-4,-3.9753447846682424E-05,-7.804705559277455e-9,-1.8607713456172942e-4,-3.955211791223761e-5,-7.787528077260694e-9,-1.8601733956143633e-4,-3.937609305312275e-5,-7.771594675631029e-9,-1.8600372362801028e-4,-3.924671808006975e-5,-7.759377516311174e-9,-1.860151033940145e-4,-3.9177490549839045e-5,-7.752521038826082e-9,-1.86027579535179e-4,-3.917265795237302e-5,-7.751697825195558e-9,-1.8601784500762417e-4,-3.922712275877602e-5,-7.756683939980297e-9,-1.859660991240961e-4,-3.932748873083235e-5,-7.76655338904938e-9,-1.858583415306685e-4,-3.945386020008228e-5,-7.779863803220138e-9,-1.856880765199331e-4,-3.9582104032858643e-5,-7.794764745634513e-9,-1.8545751111847034e-4,-3.968648336286518e-5,-7.80905273811186e-9,-1.8517832726768282e-4,-3.974272194646584e-5,-7.820277095975539e-9,-1.8487191715710737e-4,-3.973182286832981e-5,-7.826043324454552e-9,-1.84568326062585e-4,-3.964498003485806e-5,-7.824607063924266e-9,-1.8430252736954805e-4,-3.948909619720772e-5,-7.81567723225054e-9,-1.841068015813026e-4,-3.9290916557531185e-5,-7.801120265142914e-9,-1.8399941650295114e-4,-3.9096168023688346e-5,-7.785080204503404e-9,-1.8397315757144196e-4,-3.8959732030985414e-5,-7.773061430941858e-9,-1.8399121969710352e-4,-3.892667494260442e-5,-7.769999153806498e-9,-1.8399720413110593e-4,-3.9012062532908605e-5,-7.778165646339316e-9,-1.8393709799280938e-4,-3.919247414624714e-5,-7.796192327999907e-9,-1.837809253347292e-4,-3.94159913142451e-5,-7.81983562463752e-9,-1.835314504140859e-4,-3.9624174692404916e-5,-7.843866044999501e-9,-1.832175926465497e-4,-3.9772376929694886e-5,-7.863852973816922e-9,-0.00018288007799367867,-3.983939802399363e-5,-7.877101234873762e-9,-1.825581525567214e-4,-3.9826609012344015e-5,-7.88278698428171e-9,-1.8228153953364634e-4,-3.975151493070294e-5,-7.881673076367993e-9,-1.8206747389102235e-4,-3.96403257759107e-5,-7.87567869457065e-9,-1.8192093438847728e-4,-3.952183195728649e-5,-7.867403264403688e-9,-1.818363144226791e-4,-3.94230088792691e-5,-7.859627774104685e-9,-1.8179960057993597e-4,-3.9365938879669173e-5,-7.854836651382487e-9,-1.817908037429815e-4,-3.9365650403408574e-5,-7.85483970570868e-9,-1.817866154295425e-4,-3.9428705477013426e-5,-7.860566324909944e-9,-1.81763290141203e-4,-3.955254076382139e-5,-7.872043997922005e-9,-1.8169966125836646e-4,-3.9725745338659054e-5,-7.888521312020506e-9,-1.8157997375724025e-4,-3.992943179925509e-5,-7.908654800013727e-9,-1.8139615201193202e-4,-4.01395859443014e-5,-7.930677800847704e-9,-1.8114926843234067e-4,-4.0330149429537525e-5,-7.952524911278175e-9,-1.808500494869329e-4,-4.047662276442048e-5,-7.971962158343955e-9,-1.8051827933978514e-4,-4.055992560857808e-5,-7.986810256067089e-9,-1.8018101316444614e-4,-4.0570277674346596e-5,-7.995336625795394e-9,-1.7986930754112723e-4,-4.0510916503467394e-5,-7.996822725172099e-9,-1.796128754203871e-4,-4.0400967753350356e-5,-7.992167447243349e-9,-1.7943243126465743e-4,-4.027577035424067e-5,-7.984224841668468e-9,-1.793308527151646e-4,-4.0182267013651894e-5,-7.97751603843064e-9,-1.7928650189256697e-4,-4.016762654034507e-5,-7.977085620844553e-9,-1.7925412028238575e-4,-4.026237728195528e-5,-7.986681974367066e-9,-1.791774416147169e-4,-4.046502137035069e-5,-8.007050548514257e-9,-1.79010578141659e-4,-4.07384889308924e-5,-8.03541534862946e-9,-1.7873692411944845e-4,-4.102346717380981e-5,-8.066621496285543e-9,-1.783741420058078e-4,-4.1261830836882335e-5,-8.095249938080533e-9,-1.7796361074475225e-4,-4.1416463164230464e-5,-8.117421582789139e-9,-1.7755290410782594e-4,-4.1478368578888085e-5,-8.131520449449486e-9,-1.7718135033389617e-4,-4.146198733197798e-5,-8.13797055610707e-9,-1.768730990346715e-4,-4.139529321745453e-5,-8.138602365296292e-9,-1.766365818208645e-4,-4.131042648440153e-5,-8.135996394797593e-9,-1.7646729539195152e-4,-4.123728457209718e-5,-8.132931548149722e-9,-1.7635140912427015e-4,-4.119998363428822e-5,-8.131940782911007e-9,-1.7626901592075078e-4,-4.1215139264067615e-5,-8.13497319552361e-9,-1.7619688175239353e-4,-4.129104627639256e-5,-8.143187102834443e-9,-1.7611095329391106e-4,-4.142731358893801e-5,-8.156888519239014e-9,-1.7598889716912629e-4,-4.1614887437690714e-5,-8.17558928584182e-9,-1.7581281192462515e-4,-4.183670829192403e-5,-8.198133122013413e-9,-1.7557194116890116e-4,-4.206939570725801e-5,-8.222846596370708e-9,-1.7526489185315834e-4,-4.2286145337228534e-5,-8.247693685378518e-9,-1.749007892130791e-4,-4.246067239676419e-5,-8.27045287578726e-9,-1.7449889291473196e-4,-4.257177890837406e-5,-8.288966601271894e-9,-1.7408636134491067e-4,-4.260785569445014e-5,-8.301502622549816e-9,-1.7369417612683185e-4,-4.257044116629862e-5,-8.307207425135431e-9,-1.733515749373912e-4,-4.247603925671317e-5,-8.306560538240727e-9,-1.7307951561946385e-4,-4.235546258407321e-5,-8.301660768772593e-9,-1.7288404300892215e-4,-4.224980670333177e-5,-8.296116391034056e-9,-1.7275126742316764e-4,-4.220232082429011e-5,-8.29435675977847e-9,-1.7264662508130276e-4,-4.2246603872407674e-5,-8.300377709365537e-9,-1.7252121501086634e-4,-4.239390927424923e-5,-8.316260399484159e-9,-1.723259194563172e-4,-4.262512746453453e-5,-8.341125038747223e-9,-1.7202921853819408e-4,-4.289359303196469e-5,-8.371205255110296e-9,-1.7163005621497463e-4,-4.314027956941037e-5,-8.401196120311941e-9,-1.7115808212438073e-4,-4.3314891182245837e-5,-8.426208336859534e-9,-1.706611339045414e-4,-4.3391899781138715e-5,-8.4432830383759e-9,-1.701876762651756e-4,-4.3374419715413495e-5,-8.4518562411058e-9,-1.6977323193821857e-4,-4.328714577136297e-5,-8.4533209117178e-9,-1.6943492968409378e-4,-4.316484300779904e-5,-8.450215049832509e-9,-1.691728141266524e-4,-4.304229490465962e-5,-8.445454567334958e-9,-1.689743734967421e-4,-4.294814563749508e-5,-8.441762371783732e-9,-1.6881942342299218e-4,-4.2902261156559144e-5,-8.441296223429344e-9,-1.6868404487941965e-4,-4.291519214458628e-5,-8.445444774098598e-9,-1.6854347563705814e-4,-4.2988495594045744e-5,-8.454766529152133e-9,-1.6837439851704656e-4,-4.3115257163194266e-5,-8.469036389597806e-9,-1.681571293442517e-4,-4.3280710287122344e-5,-8.487346444855007e-9,-1.6787800682957013e-4,-4.3463272785180736e-5,-8.508217625345404e-9,-1.675319055511752e-4,-4.363653952219832e-5,-8.529718093993882e-9,-1.6712433065999726e-4,-4.3772654109465174e-5,-8.549625270960761e-9,-1.6667221550076703e-4,-4.3847053130506195e-5,-8.565688893545171e-9,-1.6620251090174813e-4,-4.384394863589244e-5,-8.576022891083493e-9,-1.6574805161057994e-4,-4.3761243185843136e-5,-8.57958137502147e-9,-1.653410166729793e-4,-4.361321227414499e-5,-8.57659196538238e-9,-1.6500526069332353e-4,-4.3429595920686075e-5,-8.568780938240553e-9,-1.6474941938175833e-4,-4.325061380526027e-5,-8.559242374508827e-9,-1.6456278474184848e-4,-4.311845658282386e-5,-8.551872091484495e-9,-1.6441558827007797e-4,-4.306679435913246e-5,-8.55041163875152e-9,-1.6426459590353389e-4,-4.31107428021797e-5,-8.55731514316368e-9,-1.6406370565747632e-4,-4.324040567689213e-5,-8.572814975918328e-9,-1.6377738091422734e-4,-4.3421136814201817e-5,-8.594619277300757e-9,-1.6339259528422065e-4,-4.360218549923664e-5,-8.618509053213847e-9,-1.6292403742707357e-4,-4.3731933663244515e-5,-8.639692356752142e-9,-1.6240945516230828e-4,-4.3773994492029846e-5,-8.654343911008955e-9,-1.618968607756375e-4,-4.371721460881521e-5,-8.660647603934844e-9,-1.614295836691662e-4,-4.357579691594396e-5,-8.658990171403235e-9,-1.6103554540079272e-4,-4.338116258064244e-5,-8.65143750147207e-9,-1.6072371734170566e-4,-4.317072694826411e-5,-8.640899300411265e-9,-1.60486597377181e-4,-4.2978486922922624e-5,-8.630346264051817e-9,-1.6030553083480994e-4,-4.28295955015562e-5,-8.622255741822829e-9,-1.6015613527411944e-4,-4.2738546072660895e-5,-8.618310231123223e-9,-1.6001252941236853e-4,-4.270953342717434e-5,-8.619310983523769e-9,-1.5985023392522713e-4,-4.27376696865566e-5,-8.62524258194941e-9,-1.5964820616548375e-4,-4.281026269130828e-5,-8.635407427994393e-9,-1.5939063606626693e-4,-4.290797545834162e-5,-8.648555381100611e-9,-1.5906893911632526e-4,-4.300622619989431e-5,-8.662980381924239e-9,-1.586839320425307e-4,-4.307745905419132e-5,-8.6766176574788e-9,-1.5824763893893554e-4,-4.309485149551601e-5,-8.687224944489166e-9,-1.577836553301402e-4,-4.303761508032331e-5,-8.692728743322592e-9,-1.5732473003351639e-4,-4.2897150815443866e-5,-8.691735505534104e-9,-1.5690673041701025e-4,-4.2682099455994495e-5,-8.684069583127032e-9,-1.5655967783061677e-4,-4.241963218334136e-5,-8.671100768675983e-9,-1.5629842252569848e-4,-4.215106331379977e-5,-8.65564776892293e-9,-1.5611654367897435e-4,-4.1922027222526855e-5,-8.641393519477788e-9,-1.5598634365727104e-4,-4.1769990723229766e-5,-8.631943434242865e-9,-1.558655337576891e-4,-4.171332468953909e-5,-8.62980875112357e-9,-1.55708599326998e-4,-4.1745676230751626e-5,-8.635639653747643e-9,-1.5547926756793228e-4,-4.183738871643539e-5,-8.64796410233513e-9,-1.5516040876164026e-4,-4.194344529267842e-5,-8.663544317198107e-9,-1.5475857077794318e-4,-4.2015642345345564e-5,-8.678275332417251e-9,-1.5430178219828054e-4,-4.2015487508945786e-5,-8.688346657903147e-9,-1.538312653883322e-4,-4.1923888974596855e-5,-8.691272266061803e-9,-1.5338985144061818e-4,-4.174464729428951e-5,-8.686443715723425e-9,-1.5301108912570144e-4,-4.150107912857046e-5,-8.675074640975934e-9,-1.5271247020407983e-4,-4.1227745509928506e-5,-8.659650972450587e-9,-1.5249412865362623e-4,-4.096082102643691e-5,-8.643154944543995e-9,-1.5234202142190386e-4,-4.0730361657362306e-5,-8.628341074666747e-9,-1.522332666590427e-4,-4.0556036818412694e-5,-8.617240877586801e-9,-1.5214146355814283e-4,-4.044607832465574e-5,-8.610948820189256e-9,-1.5204082770238207e-4,-4.0398276306418136e-5,-8.609649713449356e-9,-1.5190894966737008e-4,-4.040182404940597e-5,-8.612791693953891e-9,-1.5172855998777816e-4,-4.04392073340307e-5,-8.619289651721801e-9,-1.5148890221367985e-4,-4.048788673301634e-5,-8.627671304566296e-9,-1.511871960678653e-4,-4.052207249406931e-5,-8.636154913727928e-9,-1.5083025434630082e-4,-4.051521495503619e-5,-8.642725787473477e-9,-1.5043574158394175e-4,-4.044383852156764e-5,-8.645327734018624e-9,-1.500319353466808e-4,-4.029297377626192e-5,-8.642261093560134e-9,-1.496544166579292e-4,-4.006242686937451e-5,-8.632759521112276e-9,-1.4933857066749907e-4,-3.9771500609913104e-5,-8.61753525645397e-9,-1.4910878327908136e-4,-3.9458613965874134e-5,-8.598961074703302e-9,-1.4896817540041468e-4,-3.9173255620837376e-5,-8.580634729706417e-9,-1.4889434793359147e-4,-3.896143953895252e-5,-8.566369717397555e-9,-1.488446779231985e-4,-3.885027635490195e-5,-8.558992598500318e-9,-1.4876971971684565e-4,-3.883878985692342e-5,-8.559461170923111e-9,-1.4862882605840358e-4,-3.889897430693147e-5,-8.566637964807312e-9,-1.484015496846831e-4,-3.8985699273179814e-5,-8.577719545041904e-9,-1.4809146958670756e-4,-3.9050500471712874e-5,-8.589075917670951e-9,-1.4772283139077166e-4,-3.90541832810773e-5,-8.597200861671296e-9,-1.4733252302452735e-4,-3.8975093804996464e-5,-8.599531021666814e-9,-1.46960319709348e-4,-3.8811988524448995e-5,-8.594969943036304e-9,-1.4663989849332713e-4,-3.8581911562734315e-5,-8.58402541962936e-9,-1.4639243737691714e-4,-3.831439622032589e-5,-8.568556760394407e-9,-1.4622381432699978e-4,-3.8043832331238845e-5,-8.551221326080342e-9,-1.4612546696149864e-4,-3.780203085357788e-5,-8.534793996272362e-9,-1.4607800835754142e-4,-3.761267871861787e-5,-8.521560570514165e-9,-1.46056126596556e-4,-3.748848840769632e-5,-8.512936995642796e-9,-1.4603336462438332e-4,-3.743087337648366e-5,-8.509368863912567e-9,-1.4598588657925202e-4,-3.743138625583485e-5,-8.510465027645555e-9,-1.4589496353338089e-4,-3.747399290628529e-5,-8.515247763091069e-9,-1.4574843347403674e-4,-3.753744263121957e-5,-8.522385868843517e-9,-1.4554162934537264e-4,-3.759745129656199e-5,-8.530332304446479e-9,-1.4527818133022795e-4,-3.7628889350479104e-5,-8.537375532161534e-9,-1.4497079464529807e-4,-3.76084521534279e-5,-8.541699439939246e-9,-1.446416124057033e-4,-3.751836753687077e-5,-8.541581339326527e-9,-1.4432111704455668e-4,-3.7351398285757994e-5,-8.535812444372269e-9,-1.4404404714688575e-4,-3.711638518574359e-5,-8.524282605408122e-9,-1.438412079624837e-4,-3.684187866182322e-5,-8.508477097627533e-9,-1.4372811461076546e-4,-3.657397293866363e-5,-8.491503673689153e-9,-1.436949746655447e-4,-3.636532952138359e-5,-8.477371791217123e-9,-1.437049148338037e-4,-3.625715011489158e-5,-8.469647157873269e-9,-1.4370460041685984e-4,-3.626225419817731e-5,-8.470096677118393e-9,-1.436435657655829e-4,-3.6359182629031623e-5,-8.478059693349249e-9,-1.4349217679652826e-4,-3.650097828056397e-5,-8.49083875172551e-9,-1.4324944734727836e-4,-3.663301747612782e-5,-8.50476357027434e-9,-1.4293924274250757e-4,-3.6710244446883646e-5,-8.516318183217591e-9,-1.42599606440927e-4,-3.670734481993864e-5,-8.522934387042323e-9,-1.4227107692698355e-4,-3.66208983276144e-5,-8.523380609554418e-9,-1.4198762087161575e-4,-3.646586091026803e-5,-8.517827359725516e-9,-1.4177127123896665e-4,-3.626931158012475e-5,-8.507668428407443e-9,-1.4163010445375599e-4,-3.606360234221836e-5,-8.495144285064709e-9,-1.4155881398565556e-4,-3.588006957388633e-5,-8.482821921176052e-9,-1.4154122929864088e-4,-3.574396664003745e-5,-8.473039059830415e-9,-1.4155410250967632e-4,-3.5671120527783085e-5,-8.467454781925923e-9,-1.4157137341078065e-4,-3.5666522461359366e-5,-8.46681890030178e-9,-1.4156819516112225e-4,-3.572468450852716e-5,-8.4709875707388e-9,-1.4152418460917606e-4,-3.58313730753767e-5,-8.47912807725831e-9,-1.4142558873947818e-4,-3.59661705458511e-5,-8.489992557926502e-9,-1.412664184643966e-4,-3.6105261696455e-5,-8.502137383045136e-9,-1.4104888166358994e-4,-3.6224110895191465e-5,-8.514032189748423e-9,-1.4078340386514088e-4,-3.630008132933925e-5,-8.524097794432883e-9,-1.4048831120426743e-4,-3.6315244359799485e-5,-8.530777751256682e-9,-1.4018893987105985e-4,-3.6259700669489686e-5,-8.532761075544734e-9,-1.399154045802046e-4,-3.613554770648095e-5,-8.529406358796928e-9,-1.396978493880879e-4,-3.5960758369385744e-5,-8.5212719609298e-9,-1.395584274220083e-4,-3.5770777754258144e-5,-8.510484614118273e-9,-1.395010799090941e-4,-3.5614419533547606e-5,-8.500584815712752e-9,-1.3950347955379841e-4,-3.554134224026499e-5,-8.495600252331792e-9,-1.395181326667312e-4,-3.5583057711782186e-5,-8.49852886633527e-9,-1.3948692048425989e-4,-3.573661667274257e-5,-8.509976577861838e-9,-1.3936409233349114e-4,-3.596248146847602e-5,-8.52783178092342e-9,-1.3913464178440764e-4,-3.6200002121230084e-5,-8.548219699136488e-9,-1.3881747770678196e-4,-3.6391341144876804e-5,-8.567072309384218e-9,-1.384540237025143e-4,-3.650005380239695e-5,-8.581375137160207e-9,-1.380914704582618e-4,-3.6517145395985524e-5,-8.589669620504838e-9,-1.3776939627770373e-4,-3.645667302158028e-5,-8.591982763540148e-9,-1.375129529417687e-4,-3.634680402050186e-5,-8.589508759325445e-9,-1.373315794560991e-4,-3.622095854655851e-5,-8.584220023840957e-9,-1.3722091216789167e-4,-3.61110737959683e-5,-8.578448656336925e-9,-1.3716598999432205e-4,-3.6043161150447865e-5,-8.574449379800085e-9,-1.37144819913883e-4,-3.6034601772228566e-5,-8.573995788120039e-9,-1.3713202193536196e-4,-3.60927847497726e-5,-8.578098184526851e-9,-1.3710237308793484e-4,-3.621495858814332e-5,-8.586914569799196e-9,-1.3703402980724396e-4,-3.6389181641333254e-5,-8.5998516774355e-9,-1.36911205202354e-4,-3.65962542961265e-5,-8.615789199981454e-9,-1.3672602214730465e-4,-3.68124573584491e-5,-8.633327431858329e-9,-1.36479349089764e-4,-3.701271677512592e-5,-8.650970819822634e-9,-1.3618068653054776e-4,-3.717379627140313e-5,-8.667222550115315e-9,-1.358472662707308e-4,-3.7277344343605105e-5,-8.680647089426607e-9,-1.3550242612119607e-4,-3.731274903926245e-5,-8.68999424871703e-9,-1.3517320152061808e-4,-3.727978006702851e-5,-8.694459140313209e-9,-1.3488680793789882e-4,-3.719092897384664e-5,-8.694073713436727e-9,-1.3466544021457864e-4,-3.707279073129639e-5,-8.69010051987593e-9,-1.3451925275556113e-4,-3.696481485133304e-5,-8.685177236944263e-9,-1.344388658671642e-4,-3.69131046298267e-5,-8.682934876706395e-9,-1.3439108416693466e-4,-3.695778715724225e-5,-8.68695839392729e-9,-1.3432331140892352e-4,-3.7116200157038535e-5,-8.699334814541392e-9,-1.3417981211901297e-4,-3.737010340084863e-5,-8.71951455375979e-9,-1.339246580951755e-4,-3.7667420214442775e-5,-8.744316749020727e-9,-1.3355816900488716e-4,-3.7941435370631326e-5,-8.769244026211392e-9,-1.3311593340372153e-4,-3.813725721253883e-5,-8.79029609068621e-9,-1.3265197371800877e-4,-3.8229929052285945e-5,-8.80518898519348e-9,-1.3221793913426716e-4,-3.822643977336777e-5,-8.813555366407018e-9,-1.318492290963614e-4,-3.8155740932226004e-5,-8.816480101901048e-9,-1.3156091565529496e-4,-3.8055615871408505e-5,-8.815891247203971e-9,-1.3135036452187486e-4,-3.796239043644523e-5,-8.814051427765528e-9,-1.31202438800492e-4,-3.7905049072083586e-5,-8.813160873514698e-9,-1.3109463784149872e-4,-3.79028210263575e-5,-8.81503385420893e-9,-1.3100122611687848e-4,-3.796469387651649e-5,-8.820852830416448e-9,-1.3089648863076503e-4,-3.80897908046812e-5,-8.83104051118581e-9,-1.3075748536931842e-4,-3.826825886682798e-5,-8.84527997381368e-9,-1.3056648321026467e-4,-3.848267424904795e-5,-8.862659526172724e-9,-1.3031305885508222e-4,-3.871009371470224e-5,-8.881878607082005e-9,-1.2999564462678402e-4,-3.8924886973358905e-5,-8.90144922639146e-9,-1.296221126551315e-4,-3.9102224081252054e-5,-8.919852317394064e-9,-1.292091137554164e-4,-3.9221787764163894e-5,-8.935653170963314e-9,-1.287801342980387e-4,-3.9271231345139034e-5,-8.947626178113364e-9,-1.2836237102655372e-4,-3.924893370147562e-5,-8.954946573809908e-9,-1.2798264289840097e-4,-3.916561004732102e-5,-8.957459750970044e-9,-1.2766262594780724e-4,-3.9044431207776e-5,-8.955969094344736e-9,-1.2741366297480022e-4,-3.891923161696911e-5,-8.952404162384802e-9,-1.2723168997357461e-4,-3.883000967390067e-5,-8.949679509496966e-9,-1.27093748029005e-4,-3.881487829910734e-5,-8.951097831921052e-9,-1.2695870357679422e-4,-3.8898685950468335e-5,-8.959323326278861e-9,-1.267751555869125e-4,-3.908106724078372e-5,-8.975233990146882e-9,-1.2649729890266872e-4,-3.933002315131596e-5,-8.997238422616873e-9,-1.2610380646318407e-4,-3.958793924368254e-5,-9.021623338742478e-9,-1.2560933231630603e-4,-3.979117636916569e-5,-9.043949542052622e-9,-1.250601064281325e-4,-3.989428803618717e-5,-9.060747657363913e-9,-1.2451535807132656e-4,-3.988519479442612e-5,-9.070550347589108e-9,-1.2402584828578883e-4,-3.978414776435241e-5,-9.073886011159246e-9,-1.236205981940215e-4,-3.963065544738354e-5,-9.07260038223968e-9,-1.2330492479386814e-4,-3.946804731107443e-5,-9.06907791995821e-9,-1.2306592379153069e-4,-3.9332584341514184e-5,-9.065663183276685e-9,-1.228800828847495e-4,-3.9248605036294036e-5,-9.064298093394783e-9,-1.2271974809462355e-4,-3.9227959023930204e-5,-9.066308761174449e-9,-1.2255751932836511e-4,-3.9271422800291845e-5,-9.07230522767062e-9,-1.2236902385258616e-4,-3.937056825807537e-5,-9.082190481665708e-9,-1.2213485314795255e-4,-3.950953825587356e-5,-9.0952670217167e-9,-1.2184219766310128e-4,-3.966680598205627e-5,-9.110401741288104e-9,-1.2148636162885278e-4,-3.981726696521993e-5,-9.12619905571748e-9,-1.2107197250418744e-4,-3.9935062083796264e-5,-9.141156188037495e-9,-1.2061333772280514e-4,-3.9997258003077964e-5,-9.153805898123638e-9,-1.2013331124746263e-4,-3.998800386203117e-5,-9.162873756252375e-9,-1.1966030668005657e-4,-3.990236796499482e-5,-9.167476141008514e-9,-1.1922355711720542e-4,-3.9748848224879454e-5,-9.16735668291749e-9,-1.1884727409519039e-4,-3.9549573910041856e-5,-9.163106709226148e-9,-1.1854484500946807e-4,-3.9337626281964046e-5,-9.156273357353645e-9,-1.1831435745928925e-4,-3.9151554868869843e-5,-9.149247534449742e-9,-1.1813661119487769e-4,-3.9027669333984225e-5,-9.144851147026704e-9,-1.1797667960421902e-4,-3.899110483450793e-5,-9.145628060950681e-9,-1.1778991790734548e-4,-3.904737063700308e-5,-9.15299150810211e-9,-1.175325624741728e-4,-3.9177091689939015e-5,-9.166537396277783e-9,-1.1717523308225653e-4,-3.933731131848976e-5,-9.183898816605155e-9,-1.1671489921126038e-4,-3.947171279421601e-5,-9.20137620436505e-9,-1.1617906373001206e-4,-3.952820645458404e-5,-9.215188158288917e-9,-1.1561807446250038e-4,-3.947694802803824e-5,-9.222771080593783e-9,-1.1508795403832579e-4,-3.931977427169145e-5,-9.223487247363517e-9,-1.1463218392673738e-4,-3.9086539305895255e-5,-9.21849929028679e-9,-1.142709592978943e-4,-3.8821745934336895e-5,-9.210076040428456e-9,-1.1400074179654687e-4,-3.856946273893001e-5,-9.20078618611514e-9,-1.1380094799943816e-4,-3.836294492571193e-5,-9.192886631995141e-9,-1.1364261812623197e-4,-3.822069459714716e-5,-9.1879765359956e-9,-1.1349551541127026e-4,-3.814719957123449e-5,-9.186871306246775e-9,-1.1333258761490281e-4,-3.8135736535814055e-5,-9.189633338269424e-9,-1.1313230069867286e-4,-3.817141008984336e-5,-9.195706259883106e-9,-1.1287982382393343e-4,-3.823369291997683e-5,-9.204097657482591e-9,-1.1256786310513337e-4,-3.829851605574717e-5,-9.213553802888529e-9,-1.1219751803139118e-4,-3.8340376762559447e-5,-9.22269414066259e-9,-1.1177904223869293e-4,-3.833503671167999e-5,-9.230116686601745e-9,-1.1133191698447232e-4,-3.826315103578705e-5,-9.234523255112086e-9,-1.1088335748373442e-4,-3.811461096830071e-5,-9.234910233392347e-9,-1.1046449079987319e-4,-3.789262697562118e-5,-9.230826308386785e-9,-1.1010413601670693e-4,-3.7615910350771354e-5,-9.222627139411862e-9,-1.0982130517158393e-4,-3.731722308065027e-5,-9.21160402770721e-9,-1.0961868889767661e-4,-3.703748088216355e-5,-9.199872312326249e-9,-1.0947969429209346e-4,-3.681630820680492e-5,-9.189976537874282e-9,-1.0937067838856088e-4,-3.668157414423921e-5,-9.184272074658242e-9,-1.0924829447019257e-4,-3.664109554625678e-5,-9.18424056176897e-9,-1.0907020550257687e-4,-3.667913877536005e-5,-9.189954915184103e-9,-1.0880642515705916e-4,-3.6759033088402764e-5,-9.199907267392656e-9,-1.0844824947981108e-4,-3.683171835853091e-5,-9.211326762762983e-9,-1.0801195079731945e-4,-3.684853152381634e-5,-9.220949393187014e-9,-1.0753533107081977e-4,-3.6774884340293415e-5,-9.225997564122934e-9,-1.0706735543311275e-4,-3.6600269285523224e-5,-9.22499909034669e-9,-1.0665405844386353e-4,-3.634060345263345e-5,-9.218128116932532e-9,-1.0632599695639417e-4,-3.6031911809698865e-5,-9.206981038369621e-9,-1.0609189824736788e-4,-3.5718319405997615e-5,-9.19395506438557e-9,-1.0593992002165717e-4,-3.543962353913638e-5,-9.181522987160879e-9,-1.0584432970216088e-4,-3.5222894444418944e-5,-9.171654265312317e-9,-1.0577377509585269e-4,-3.5079615353876484e-5,-9.165501882736301e-9,-1.0569811427307857e-4,-3.500714701067259e-5,-9.163352800650679e-9,-1.0559264518508524e-4,-3.499226206662488e-5,-9.164771801813917e-9,-1.0544004786505433e-4,-3.5014920510423576e-5,-9.16883982493074e-9,-1.0523095671395252e-4,-3.5051391464275926e-5,-9.174389778026609e-9,-1.0496405295401565e-4,-3.507665669286638e-5,-9.180172150801203e-9,-1.0464618835727268e-4,-3.506655725701059e-5,-9.184939032839345e-9,-1.0429252092118758e-4,-3.500030193581135e-5,-9.187495988674884e-9,-1.039261276946598e-4,-3.48637823947789e-5,-9.186800523449334e-9,-1.0357615793353864e-4,-3.46536541858101e-5,-9.182170455832e-9,-1.0327350441689744e-4,-3.4381246691956354e-5,-9.173580720955574e-9,-1.0304364939716516e-4,-3.4074253186413085e-5,-9.161923230549191e-9,-1.0289802766204464e-4,-3.3773697803369534e-5,-9.149039646343281e-9,-1.0282725778280255e-4,-3.3524929232600696e-5,-9.137394421723031e-9,-1.0280029662432293e-4,-3.336441855594974e-5,-9.129418606410994e-9,-1.0277162008556858e-4,-3.3307298589755e-5,-9.126750143428798e-9,-1.0269452672034878e-4,-3.334132380659976e-5,-9.129679824022376e-9,-1.0253530901109662e-4,-3.3430128766657056e-5,-9.137028969170211e-9,-1.0228281327026914e-4,-3.352418168582912e-5,-9.146483951023313e-9,-1.0195058478501845e-4,-3.357486167811767e-5,-9.155243273725392e-9,-1.0157200536431759e-4,-3.354696552794696e-5,-9.160762004820197e-9,-1.0119077576295845e-4,-3.3426523116505044e-5,-9.161389983981338e-9,-1.0084972538708518e-4,-3.322258471680729e-5,-9.1567428994038e-9,-1.0058085340582454e-4,-3.296319855077416e-5,-9.1477233287177e-9,-1.0039895151362752e-4,-3.268715204906611e-5,-9.13620386476633e-9,-1.0030009479870362e-4,-3.243403248359135e-5,-9.124482475916777e-9,-1.0026481761500761e-4,-3.2235448634192776e-5,-9.114685797381227e-9,-1.002643617789796e-4,-3.210959204158094e-5,-9.108299298278605e-9,-1.0026767382911762e-4,-3.205986487873324e-5,-9.105941746310106e-9,-1.0024717983614368e-4,-3.207681406252085e-5,-9.107401083971613e-9,-1.0018239318013028e-4,-3.214184576455504e-5,-9.111860642617299e-9,-1.0006142614792553e-4,-3.223125875718116e-5,-9.118191582072067e-9,-9.988108258667136e-5,-3.2319691729833556e-5,-9.1251948611398e-9,-9.964632646321523e-5,-3.238278403756544e-5,-9.131729422340635e-9,-9.936964829441685e-5,-3.239938756272473e-5,-9.136742201877834e-9,-9.907040628933112e-5,-3.2353857807257145e-5,-9.139278262243717e-9,-9.877374852922494e-5,-3.22388541842853e-5,-9.138569270716463e-9,-9.850827687016545e-5,-3.2058685656720396e-5,-9.13425646517205e-9,-9.830143939364078e-5,-3.1832365719454527e-5,-9.126703455871307e-9,-9.817223068137955e-5,-3.159432274657247e-5,-9.117234559865558e-9,-9.812252419680496e-5,-3.138997708142053e-5,-9.108071823699427e-9,-9.813089016549055e-5,-3.126452109365012e-5,-9.10182146027846e-9,-9.815412222958905e-5,-3.124710157480261e-5,-9.100604093125194e-9,-9.813914491830552e-5,-3.1337456387429606e-5,-9.105211374499513e-9,-9.804153498796248e-5,-3.150322611607172e-5,-9.11475449547984e-9,-9.784154686536156e-5,-3.1690737195221436e-5,-9.127000792101932e-9,-9.754967528636868e-5,-3.1843765894223964e-5,-9.139172281973027e-9,-9.720055366819144e-5,-3.192085559051927e-5,-9.148776150107598e-9,-9.684015327249356e-5,-3.1904655488520306e-5,-9.154172659673398e-9,-9.651257696551535e-5,-3.180236177111936e-5,-9.154822358487452e-9,-9.62504127431069e-5,-3.163996841124646e-5,-9.151274976782774e-9,-9.60698168291565e-5,-3.145374077091899e-5,-9.144961054288212e-9,-9.596984265486474e-5,-3.128151423757891e-5,-9.137828523893096e-9,-9.593497386265119e-5,-3.115537334164327e-5,-9.131885483864583e-9,-9.593976606922285e-5,-3.109656681303233e-5,-9.128751308860314e-9,-9.595447136657913e-5,-3.111310201829616e-5,-9.129337933414458e-9,-9.595049936624177e-5,-3.119999178987712e-5,-9.133745810921736e-9,-9.590477548725535e-5,-3.134160856925637e-5,-9.141380171958168e-9,-9.580246226255177e-5,-3.151529116825042e-5,-9.151211708597388e-9,-9.563797539391283e-5,-3.16952830703858e-5,-9.162060481302314e-9,-9.541467373049275e-5,-3.185625961327806e-5,-9.172796825714589e-9,-9.514380915860319e-5,-3.197615493895167e-5,-9.182419310694514e-9,-9.48431552537596e-5,-3.2038443093745316e-5,-9.190051974883061e-9,-9.453543133902659e-5,-3.2034182987011704e-5,-9.194952520053085e-9,-9.424633486772374e-5,-3.1964113362905855e-5,-9.19662086089252e-9,-9.400158823504068e-5,-3.18408340759899e-5,-9.195038235111904e-9,-9.382220633420554e-5,-3.169033305608827e-5,-9.19095818861579e-9,-9.371778135278529e-5,-3.155104568024974e-5,-9.186065400464665e-9,-9.367914980804929e-5,-3.1468046822899884e-5,-9.182785199579648e-9,-9.367412170350315e-5,-3.1480918711509026e-5,-9.183626205872267e-9,-9.365156347345576e-5,-3.160755715402989e-5,-9.19020294586336e-9,-9.355668865963729e-5,-3.183175941432533e-5,-9.202419571888166e-9,-9.335267713728581e-5,-3.210430056471749e-5,-9.218371347956345e-9,-9.303667906521569e-5,-3.236020861117679e-5,-9.235103819495216e-9,-9.264032211325917e-5,-3.2543385860012626e-5,-9.249755228307922e-9,-9.221548591093086e-5,-3.262483810785695e-5,-9.26041652356236e-9,-9.181507378196565e-5,-3.260698117914955e-5,-9.266413523353581e-9,-9.147845491400025e-5,-3.251632942914815e-5,-9.268166415699002e-9,-9.122520847559706e-5,-3.239154168921172e-5,-9.266889513425695e-9,-9.105564635912965e-5,-3.227244723700269e-5,-9.2642646836748e-9,-9.095498913811478e-5,-3.219240887699171e-5,-9.262101784399266e-9,-9.08987318910297e-5,-3.217406213098664e-5,-9.261994204243429e-9,-9.085793054099272e-5,-3.222762121230062e-5,-9.265019829464496e-9,-9.080392835417925e-5,-3.2351052738033134e-5,-9.271567916967034e-9,-9.071228168806134e-5,-3.253168391369461e-5,-9.28134185774094e-9,-9.056569168800201e-5,-3.2748874236925676e-5,-9.293522462109239e-9,-9.035578936575062e-5,-3.297739074658915e-5,-9.307015941925984e-9,-9.008365802729651e-5,-3.319108369388331e-5,-9.32068773621464e-9,-8.975916266917992e-5,-3.336636099032471e-5,-9.33350717957054e-9,-8.939940883763627e-5,-3.348509546284864e-5,-9.344592008056796e-9,-8.902663953210632e-5,-3.353691102753202e-5,-9.353211946825554e-9,-8.866569313938621e-5,-3.352090126483869e-5,-9.35883336145802e-9,-8.834103551839693e-5,-3.3446806313605515e-5,-9.361261938630803e-9,-8.807317448099914e-5,-3.333560303798455e-5,-9.360872293875294e-9,-8.787408489854848e-5,-3.321895898344246e-5,-9.35881896249169e-9,-8.774178162211213e-5,-3.313618048205553e-5,-9.357051719661311e-9,-8.765551941425548e-5,-3.312704407820512e-5,-9.357971217288903e-9,-8.75747733839315e-5,-3.3219976944643985e-5,-9.363691049098633e-9,-8.74461410016907e-5,-3.341812218722618e-5,-9.375114762347986e-9,-8.7220065678816e-5,-3.3690479945789706e-5,-9.391311854138805e-9,-8.687212463896635e-5,-3.397702246395055e-5,-9.409699673510456e-9,-8.641654285989432e-5,-3.420979174434094e-5,-9.427069578077248e-9,-8.590181922728967e-5,-3.433967242416912e-5,-9.440848661633535e-9,-8.539061620032401e-5,-3.435314501297649e-5,-9.44984340985916e-9,-8.493672097339013e-5,-3.4271269582614564e-5,-9.454233252297501e-9,-8.45709727893319e-5,-3.413584988272384e-5,-9.45513539359531e-9,-8.429907159057472e-5,-3.399315338192215e-5,-9.454135610822126e-9,-8.410710066635141e-5,-3.388222278476255e-5,-9.452932691116559e-9,-8.39694300761685e-5,-3.382927951155617e-5,-9.453065287658341e-9,-8.385576288840835e-5,-3.384661045247159e-5,-9.455682021020762e-9,-8.373632656338405e-5,-3.39337961074905e-5,-9.461372860972362e-9,-8.358545827544782e-5,-3.407987563331084e-5,-9.470111676055729e-9,-8.338408132706894e-5,-3.426590539557689e-5,-9.481331913003121e-9,-8.312136430352067e-5,-3.446778153328366e-5,-9.494105686910258e-9,-8.279564587432089e-5,-3.465932720987703e-5,-9.507355644814983e-9,-8.241450667287213e-5,-3.481564090403858e-5,-9.520030613693909e-9,-8.19937854235765e-5,-3.491646452503521e-5,-9.531207314372736e-9,-8.155553782746594e-5,-3.494912799250977e-5,-9.540129776878508e-9,-8.112514759519504e-5,-3.491073158250606e-5,-9.546243568285508e-9,-8.072780222779476e-5,-3.480934834136822e-5,-9.549283156140592e-9,-8.038456389393579e-5,-3.466401475530754e-5,-9.549426224657887e-9,-8.010831362600719e-5,-3.450333338545574e-5,-9.54746360191402e-9,-7.989980971585162e-5,-3.4362440274271346e-5,-9.544875278633311e-9,-7.974437782718713e-5,-3.427773727254322e-5,-9.543676237437192e-9,-7.961061805952735e-5,-3.427884237468908e-5,-9.545950110564333e-9,-7.945341861300056e-5,-3.437837958684637e-5,-9.553132576768602e-9,-7.922353858236074e-5,-3.456254513569184e-5,-9.56529984876067e-9,-7.888371631202135e-5,-3.478810345141471e-5,-9.580865713138687e-9,-7.842594949679023e-5,-3.499174125974583e-5,-9.597013547859506e-9,-7.787972052612896e-5,-3.5111823238104886e-5,-9.61077091176288e-9,-7.730339317992335e-5,-3.5112654366270275e-5,-9.620133730535203e-9,-7.676190727235558e-5,-3.4997103078953485e-5,-9.624598331243174e-9,-7.630368913524509e-5,-3.480106932702219e-5,-9.62496228087358e-9,-7.594864786183333e-5,-3.457584341541249e-5,-9.622755990773589e-9,-7.568955618661085e-5,-3.4369955647098174e-5,-9.619710536672963e-9,-7.550120699012476e-5,-3.4218070735318946e-5,-9.617407235355379e-9,-7.53506844299028e-5,-3.4137703834965904e-5,-9.617061902570326e-9,-7.520512620818642e-5,-3.4130887726558557e-5,-9.619389347609227e-9,-7.503635353608889e-5,-3.4187713250424024e-5,-9.624544759331411e-9,-7.482323554456231e-5,-3.4289930549698735e-5,-9.63216195796353e-9,-7.455284746952063e-5,-3.441408243113663e-5,-9.641484197830746e-9,-7.422104933606681e-5,-3.4534311144901265e-5,-9.651545196785234e-9,-7.383266982034839e-5,-3.4625139821498456e-5,-9.661340808730684e-9,-7.340115252227199e-5,-3.466447763315732e-5,-9.669951148188559e-9,-7.29472860281118e-5,-3.4636811794840895e-5,-9.676610258024069e-9,-7.249670181575391e-5,-3.453612755069931e-5,-9.680751536488109e-9,-7.207617225320659e-5,-3.436789907206864e-5,-9.682071150846721e-9,-7.170907254595313e-5,-3.414954611457939e-5,-9.680633872207702e-9,-7.141062395474628e-5,-3.39088790257861e-5,-9.676997430229804e-9,-7.118375946617258e-5,-3.3680346460547944e-5,-9.672282908069223e-9,-7.101650731517465e-5,-3.349931488623629e-5,-9.668098481187566e-9,-7.088172523947388e-5,-3.33948756399492e-5,-9.666247026220778e-9,-7.074007291564022e-5,-3.3381977619494795e-5,-9.668224096412342e-9,-7.054706001923604e-5,-3.345448175111133e-5,-9.674640120668145e-9,-7.026421186175586e-5,-3.358188659485631e-5,-9.68481262676929e-9,-6.987236648803186e-5,-3.371310919852034e-5,-9.69679586348801e-9,-6.938216497629712e-5,-3.3789366876241454e-5,-9.707962916374584e-9,-6.883511643281062e-5,-3.376368965928737e-5,-9.715940864866819e-9,-6.829161852117123e-5,-3.3618736578177726e-5,-9.719434092883315e-9,-6.781005922500603e-5,-3.337302815858778e-5,-9.718519685799377e-9,-6.742756648217968e-5,-3.307197650765509e-5,-9.714369050431293e-9,-6.715167109481134e-5,-3.276964162612763e-5,-9.70868572509175e-9,-6.696431540140377e-5,-3.251149483555875e-5,-9.703181489926008e-9,-6.683272014943683e-5,-3.23249804831107e-5,-9.699229967536756e-9,-6.672046595425307e-5,-3.221830593712131e-5,-9.69768646622021e-9,-6.659514882482948e-5,-3.218413792480631e-5,-9.69883261424372e-9,-6.643222102070501e-5,-3.2204715407059465e-5,-9.702422223220024e-9,-6.621623206383647e-5,-3.225639014403438e-5,-9.707811412099236e-9,-6.594084229704343e-5,-3.231307689206832e-5,-9.714134303646899e-9,-6.560847130759857e-5,-3.234892257240772e-5,-9.720473000120565e-9,-6.522984548096849e-5,-3.2340745725612146e-5,-9.725978398839142e-9,-6.482324202400488e-5,-3.227068092840828e-5,-9.72993539962299e-9,-6.441292964570893e-5,-3.212909927557402e-5,-9.731798587080863e-9,-6.402628163536215e-5,-3.1917364877182857e-5,-9.731239839313383e-9,-6.368937200887575e-5,-3.164953586182567e-5,-9.728232443086724e-9,-6.342148728367543e-5,-3.135192586641782e-5,-9.723155862069091e-9,-6.3229704409613e-5,-3.105968506127635e-5,-9.716864968224381e-9,-6.310518395759158e-5,-3.081035792541784e-5,-9.710646408580894e-9,-6.302274843342547e-5,-3.0635492967811876e-5,-9.706009068758345e-9,-6.294459210654977e-5,-3.055226083848084e-5,-9.704313675315504e-9,-6.282790628516361e-5,-3.0557342633427204e-5,-9.706329094269245e-9,-6.263513206345579e-5,-3.062513212686725e-5,-9.711875217337033e-9]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json
new file mode 100644
index 0000000..76c3a68
--- /dev/null
+++ b/examples/cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json
@@ -0,0 +1 @@
+{"version":"1.0","updated":"2008 Dec 02 20:00:00 UTC","interpolationOrder":9,"xysAlgorithm":"SOFA_DEL_PSI_EPS","sampleZeroJulianEphemerisDate":2442396.5,"stepSizeDays":1,"startIndex":9000,"numberOfSamples":1000,"samples":[-6.23446137633139e-5,-3.071164556992463e-5,-9.719731332151204e-9,-6.19586809157847e-5,-3.076438157665265e-5,-9.727914890125598e-9,-6.150587794551883e-5,-3.073654937098242e-5,-9.734280833128142e-9,-6.1034943329782044e-5,-3.060168191808949e-5,-9.737216476929997e-9,-6.0601038606681665e-5,-3.036287029042388e-5,-9.736134809126074e-9,-6.024888746053323e-5,-3.0051869736974383e-5,-9.731565682588457e-9,-5.999994090928063e-5,-2.971789522758825e-5,-9.724862066857019e-9,-5.9848834314815545e-5,-2.9411354882677176e-5,-9.71770907732456e-9,-5.976923198886019e-5,-2.916989718887004e-5,-9.711648469978378e-9,-5.972462316432335e-5,-2.9011586735457638e-5,-9.707751149758674e-9,-5.967870819510338e-5,-2.8935387308633597e-5,-9.70647628370283e-9,-5.9602228253192676e-5,-2.89259970676844e-5,-9.707695687073557e-9,-5.947591112549622e-5,-2.8959747148304846e-5,-9.710838540242717e-9,-5.929077173354268e-5,-2.9009608654381066e-5,-9.715094525623705e-9,-5.904719567985657e-5,-2.9048773862964067e-5,-9.71960852884578e-9,-5.8753773367436014e-5,-2.9053136374370507e-5,-9.72361187781754e-9,-5.842624685184096e-5,-2.9003338061866847e-5,-9.726475623750488e-9,-5.8086360356536405e-5,-2.8886966009567993e-5,-9.727714468149827e-9,-5.776002754298137e-5,-2.870105742876016e-5,-9.726995392498005e-9,-5.74741651198525e-5,-2.845449366073143e-5,-9.72419549652686e-9,-5.725183467800746e-5,-2.8169256139263426e-5,-9.71951151762819e-9,-5.7106100541113594e-5,-2.7879041181757347e-5,-9.713564114276547e-9,-5.7034227249689176e-5,-2.7623923778951554e-5,-9.707405962417725e-9,-5.7014849044397024e-5,-2.744114170465607e-5,-9.702361282140308e-9,-5.701050918052841e-5,-2.735425399096375e-5,-9.699698830847758e-9,-5.697609718243167e-5,-2.7364576162975244e-5,-9.700232368303819e-9,-5.6871038817050416e-5,-2.7448633497066595e-5,-9.704002376450864e-9,-5.667116781282969e-5,-2.7563221973356075e-5,-9.710182005555758e-9,-5.637617678776307e-5,-2.765667320675218e-5,-9.717264987992663e-9,-5.601027591624169e-5,-2.7682736375781414e-5,-9.723480590272698e-9,-5.561600483675091e-5,-2.7612936285683867e-5,-9.727297528384073e-9,-5.524303937361784e-5,-2.7443956618506687e-5,-9.727850312943274e-9,-5.493513840003189e-5,-2.7197955922928915e-5,-9.725154651913568e-9,-5.471906725691787e-5,-2.6915691607899557e-5,-9.72005407261872e-9,-5.4598911019501836e-5,-2.6644703453075705e-5,-9.713934027115233e-9,-5.455730383150816e-5,-2.64266189741069e-5,-9.708311206523093e-9,-5.4562420129529145e-5,-2.6287768574123053e-5,-9.704433569738843e-9,-5.457752704343605e-5,-2.623553492658023e-5,-9.703008653848694e-9,-5.456957532646678e-5,-2.6260220049275858e-5,-9.704121931504624e-9,-5.451464446828428e-5,-2.6340246599419492e-5,-9.707335422027123e-9,-5.439995050230707e-5,-2.6448131932234545e-5,-9.711898924726039e-9,-5.422339633670513e-5,-2.6555532499365036e-5,-9.716981565914689e-9,-5.399194066121386e-5,-2.663678226094542e-5,-9.721842938139277e-9,-5.37197431734721e-5,-2.667116151947731e-5,-9.725902670942154e-9,-5.342650643560834e-5,-2.6644534881516494e-5,-9.728727486336505e-9,-5.313587618209729e-5,-2.655097739679037e-5,-9.729995225631237e-9,-5.287334596399925e-5,-2.639462790136861e-5,-9.72950469114869e-9,-5.266297173036476e-5,-2.619143036945524e-5,-9.727266597271218e-9,-5.252243553464907e-5,-2.596971389861331e-5,-9.723645863256587e-9,-5.245681707745194e-5,-2.5767877042401753e-5,-9.719459836489783e-9,-5.245295661436816e-5,-2.562748717562385e-5,-9.715914975816248e-9,-5.247784135201871e-5,-2.558182145120203e-5,-9.714321344765071e-9,-5.248433005910525e-5,-2.5643167778965002e-5,-9.71565414605581e-9,-5.242443255043768e-5,-2.5794981125069657e-5,-9.720157774265109e-9,-5.2265507859568556e-5,-2.599424952537427e-5,-9.727205074415084e-9,-5.200192042456586e-5,-2.6184413784918434e-5,-9.735490249337039e-9,-5.165673914621095e-5,-2.6313264574752945e-5,-9.743443035999223e-9,-5.127351919687404e-5,-2.6348054742647138e-5,-9.749667801257827e-9,-5.0902725125982576e-5,-2.6282713166082426e-5,-9.75326720347049e-9,-5.0588284184408174e-5,-2.6136491038281e-5,-9.754009356253531e-9,-5.0357993370069754e-5,-2.5946393683606597e-5,-9.752342082004198e-9,-5.0219232993974796e-5,-2.5756667981670227e-5,-9.749262933352734e-9,-5.015982106504244e-5,-2.5608303159542794e-5,-9.746061951023208e-9,-5.0152906269271166e-5,-2.5530759317958693e-5,-9.743991748123502e-9,-5.016424167598713e-5,-2.5537314473559887e-5,-9.743957229389409e-9,-5.015987799753719e-5,-2.5624510658344092e-5,-9.746324283706057e-9,-5.011244865581866e-5,-2.5775123374663638e-5,-9.750904754883811e-9,-5.000492623338741e-5,-2.596321755352963e-5,-9.757101352467545e-9,-4.9831698223674514e-5,-2.6159651038122543e-5,-9.764134932390347e-9,-4.959756293540752e-5,-2.6336794409959954e-5,-9.77125471218565e-9,-4.9315586018946434e-5,-2.6471880876366733e-5,-9.777857341227311e-9,-4.900467765247903e-5,-2.6549048296052148e-5,-9.78350042703132e-9,-4.868733505302663e-5,-2.6560573645593127e-5,-9.787854781108205e-9,-4.8387507995782974e-5,-2.6507830841147043e-5,-9.790671063781774e-9,-4.812820015775109e-5,-2.640221991296037e-5,-9.791823659827242e-9,-4.792822925558667e-5,-2.626586053182433e-5,-9.791440657019166e-9,-4.7797688235235664e-5,-2.6131146731513124e-5,-9.790058210807481e-9,-4.7732434736905576e-5,-2.603750245204811e-5,-9.788680030956192e-9,-4.770949127982192e-5,-2.602362103765612e-5,-9.788622629016349e-9,-4.768699088683465e-5,-2.6115132800391774e-5,-9.791115783371455e-9,-4.7612514838547504e-5,-2.6311416798164514e-5,-9.796791594098938e-9,-4.744004786748611e-5,-2.6579162837951064e-5,-9.805340798551625e-9,-4.714894275327642e-5,-2.68596183979786e-5,-9.81558384504337e-9,-4.675409408145582e-5,-2.7088789244523173e-5,-9.82593563524379e-9,-4.63007016373858e-5,-2.7220538865820394e-5,-9.834966162719081e-9,-4.584698755933853e-5,-2.7240537539346205e-5,-9.841756608580806e-9,-4.544489497457328e-5,-2.716612358051693e-5,-9.845989371386469e-9,-4.512720869220526e-5,-2.7035870592725035e-5,-9.847894204339548e-9,-4.490350340869352e-5,-2.6895966227287968e-5,-9.848150476851382e-9,-4.4762813526265216e-5,-2.6788619054627426e-5,-9.847749002642056e-9,-4.467974944751262e-5,-2.6744535726717833e-5,-9.847788854326644e-9,-4.4621551529998665e-5,-2.67793858092927e-5,-9.849227199555758e-9,-4.4554711427458415e-5,-2.6893402551401513e-5,-9.852654250504786e-9,-4.445048423814215e-5,-2.7073346152810357e-5,-9.858177344922723e-9,-4.428881976659844e-5,-2.7296183901073322e-5,-9.865455416384905e-9,-4.406041691263042e-5,-2.753370714423536e-5,-9.873857188997167e-9,-4.376691930956634e-5,-2.7757247847319554e-5,-9.882664459772306e-9,-4.3419538053046194e-5,-2.7941805347373132e-5,-9.891234414250543e-9,-4.303660454191013e-5,-2.8069095603610774e-5,-9.899069051818642e-9,-4.264069174434751e-5,-2.8129368229640377e-5,-9.90579879900749e-9,-4.2255769073996823e-5,-2.8122238695490774e-5,-9.911139409555858e-9,-4.1904486407320275e-5,-2.8056896725693683e-5,-9.914892497705433e-9,-4.160543814119917e-5,-2.7951878164291356e-5,-9.9170275201943e-9,-4.137010911506443e-5,-2.783431847991674e-5,-9.917825281106567e-9,-4.119921521788755e-5,-2.7738086497587085e-5,-9.917998408072091e-9,-4.107878264055179e-5,-2.769954625238172e-5,-9.91867215364473e-9,-4.097763615938715e-5,-2.7749689768273665e-5,-9.921139370467895e-9,-4.0849404904229084e-5,-2.7902797854934692e-5,-9.926407792259145e-9,-4.0642441010064514e-5,-2.8145057541786642e-5,-9.934713814169385e-9,-4.031787237599612e-5,-2.8430538779043658e-5,-9.945298702787681e-9,-3.9868810330146976e-5,-2.8691908882654146e-5,-9.9566665170196e-9,-3.932833565054289e-5,-2.8864961803409028e-5,-9.967212572062042e-9,-3.875854394725441e-5,-2.891437192128338e-5,-9.975808367109482e-9,-3.822616913640833e-5,-2.8845330760606945e-5,-9.98201180056612e-9,-3.777943806979286e-5,-2.869613572190929e-5,-9.98594693625295e-9,-3.743725664498184e-5,-2.8519754654329504e-5,-9.98810862349428e-9,-3.719134397363045e-5,-2.8366020937962917e-5,-9.989234069973608e-9,-3.701525587842487e-5,-2.8270836040562245e-5,-9.99020103086058e-9,-3.6874340673262915e-5,-2.8252557552493445E-05,-9.991881928374356e-9,-3.6733633947777075e-5,-2.831302992680173e-5,-9.994958846882884e-9,-3.656313374093195e-5,-2.844073037686516e-5,-9.999766501751608e-9,-3.634100881655143e-5,-2.8614561011922926e-5,-1.000623541918002e-8,-3.605533964519792e-5,-2.8807801587885512e-5,-1.0013957531492734e-8,-3.570465334841229e-5,-2.8992079074828512e-5,-1.0022338457116705e-8,-3.529734816247884e-5,-2.914116709250595e-5,-1.0030762046344616e-8,-3.485006993645185e-5,-2.92343805861204e-5,-1.0038702615702036e-8,-3.4385142229079815e-5,-2.9259238226273796e-5,-1.0045757091094494e-8,-3.3927359255493513e-5,-2.9213049460563632e-5,-1.0051621058011619e-8,-3.350058407226353e-5,-2.9103332940466208e-5,-1.0056066702504657e-8,-3.3124457063630464e-5,-2.8947189972084985e-5,-1.0058976990550987e-8,-3.2811366323358286e-5,-2.8769735723801098e-5,-1.0060445345746964e-8,-3.256375787328263e-5,-2.8601623226662544e-5,-1.0060897143616392e-8,-3.2371816097269846e-5,-2.8475488693954947e-5,-1.0061145174295647e-8,-3.221189052935458e-5,-2.842075314931494e-5,-1.0062287880142022e-8,-3.204694100578321e-5,-2.8456309260332803e-5,-1.0065415316236122e-8,-3.183109485034811e-5,-2.8581804503757855e-5,-1.007118993199182e-8,-3.152026648812525e-5,-2.877048997646703e-5,-1.0079484318373714e-8,-3.108835216793204e-5,-2.8969238348406404e-5,-1.0089312218910324e-8,-3.0542974461299724e-5,-2.911131486583659e-5,-1.0099182540644034e-8,-2.992994780628945e-5,-2.9140766616140142e-5,-1.0107715115987456e-8,-2.9319253695152042e-5,-2.9036541761832005e-5,-1.0114124886146775e-8,-2.877809393386789e-5,-2.8820960229194144e-5,-1.0118307228329601e-8,-2.8346852894650365e-5,-2.8547443251060635e-5,-1.0120625267983092e-8,-2.803055359693186e-5,-2.8277133796314353e-5,-1.0121677071264258e-8,-2.7805852942645365e-5,-2.8058810315545394e-5,-1.0122171969069935e-8,-2.7634885870697304e-5,-2.7919586021142028e-5,-1.0122851241518537e-8,-2.7477784344898564e-5,-2.7865136011979794e-5,-1.0124374041290903e-8,-2.73005681768325e-5,-2.788470342701019e-5,-1.0127178785398857e-8,-2.707876938176712e-5,-2.7957027015369363e-5,-1.0131386580299943e-8,-2.6798428484780897e-5,-2.8055381987984983e-5,-1.0136799525049531e-8,-2.6455880523470634e-5,-2.8151496961065997e-5,-1.0142993650083491e-8,-2.6056989964450905e-5,-2.8218751221123247e-5,-1.0149458252670142e-8,-2.5615936366383297e-5,-2.82350089513246e-5,-1.0155717100330529e-8,-2.5153423477268736e-5,-2.8185218808561722e-5,-1.0161389371918144e-8,-2.469410784372093e-5,-2.80636100261117e-5,-1.0166188348621973e-8,-2.426321414819864e-5,-2.787501653366006e-5,-1.0169893731105325e-8,-2.3882668480529245e-5,-2.763487038497263e-5,-1.01723489245492e-8,-2.3567286234310905e-5,-2.7367666919278267e-5,-1.017351616196784e-8,-2.332156842397692e-5,-2.7103905438103306e-5,-1.017357593949472e-8,-2.3137641969046203e-5,-2.6875705732266855e-5,-1.0173013410180529e-8,-2.299476051584912e-5,-2.6711500845227497E-05,-1.017261329344951e-8,-2.2860705750699917e-5,-2.663018704620786e-5,-1.0173308322342749e-8,-2.2695665047880168e-5,-2.663518611623227e-5,-1.017589092482202e-8,-2.2459337873909423e-5,-2.6709603552242226e-5,-1.0180685150351775e-8,-2.212140867809451e-5,-2.6814846177850375e-5,-1.0187337375833014e-8,-2.1673671732367735e-5,-2.6895869468464378e-5,-1.0194873028803975e-8,-2.1139047774474032e-5,-2.68952440266726e-5,-1.0202044877588625e-8,-2.0570501852735378e-5,-2.6773653165214853e-5,-1.0207808391111026e-8,-2.0035779945461135e-5,-2.6527596262472074e-5,-1.0211650200164242e-8,-1.95929968856085e-5,-2.6192859779762135e-5,-1.0213616507492086e-8,-1.9270119523824262e-5,-2.5830075681245798e-5,-1.021413380368983e-8,-1.905933904298975e-5,-2.5500927912146165e-5,-1.021381348729072e-8,-1.892657043021345e-5,-2.5248592103061754e-5,-1.0213321886218076e-8,-1.8827443033921196e-5,-2.5090146839981592e-5,-1.0213277816654462e-8,-1.8720869387209668e-5,-2.5019585350191788e-5,-1.0214142627298827e-8,-1.8576464284264876e-5,-2.5015668692887527e-5,-1.0216127260583814e-8,-1.8376611843414558e-5,-2.504980617624261e-5,-1.0219166169699748e-8,-1.8115567499788158e-5,-2.5091878000311348e-5,-1.022297593256864e-8,-1.77975879404375e-5,-2.511396168920078e-5,-1.0227169183059294e-8,-1.743505293856026e-5,-2.5092754555130803e-5,-1.0231368833090536e-8,-1.7046707371919865e-5,-2.5011456803880348e-5,-1.0235274298180084e-8,-1.6655740859370975e-5,-2.4861532084328557e-5,-1.023866489114029e-8,-1.6287282974612118e-5,-2.464432330060455e-5,-1.0241365206381334e-8,-1.596501252310151e-5,-2.4372025169081737e-5,-1.024321801882643e-8,-1.570702113141324e-5,-2.406725812436014e-5,-1.0244103967347291e-8,-1.552160951313559e-5,-2.376063009939192e-5,-1.0244017040254267e-8,-1.5404061827608693e-5,-2.3486101581026236e-5,-1.0243161489551215e-8,-1.5335535519959935e-5,-2.327460877469775e-5,-1.0242006517918706e-8,-1.5284891552236783e-5,-2.314712391361825e-5,-1.0241237021644048e-8,-1.5213603604440276e-5,-2.3108728191468194e-5,-1.0241580512137116e-8,-1.5083201808082548e-5,-2.3145172717351075e-5,-1.0243555303704379e-8,-1.4864218209902013e-5,-2.32231622645874e-5,-1.0247243960115732e-8,-1.4545036900022462e-5,-2.3295366098052616e-5,-1.0252208937023976e-8,-1.4138251105215157e-5,-2.3310524416851092e-5,-1.0257614027791928e-8,-1.368146422366092e-5,-2.322748601135849e-5,-1.0262512342819018e-8,-1.322989051622768e-5,-2.3029486169829173e-5,-1.0266164007946504e-8,-1.2840855736179594e-5,-2.2732545405069593e-5,-1.0268236392507776e-8,-1.2555169579427251e-5,-2.238231187733215e-5,-1.0268825150242116e-8,-1.2383914527037539e-5,-2.2038912589209548e-5,-1.0268347802691693e-8,-1.2307249887307113e-5,-2.1756613087809175e-5,-1.0267393640885903e-8,-1.2284812012886326e-5,-2.156813016555327e-5,-1.0266572608916944e-8,-1.2270971936084373e-5,-2.1479552451146128e-5,-1.0266376938115249e-8,-1.2227457536302338e-5,-2.1474911265539056e-5,-1.0267077590847187e-8,-1.2129749205895953e-5,-2.1525263563921737e-5,-1.0268689111523196e-8,-1.1967892292312714e-5,-2.1597450054922837e-5,-1.0271017429226725e-8,-1.174422548889918e-5,-2.166023896731968e-5,-1.0273764819876203e-8,-1.1470257655664928e-5,-2.1687790859828148e-5,-1.0276640831595281e-8,-1.1163872918540682e-5,-2.16613873970703e-5,-1.0279429528370393e-8,-1.0847087574647729e-5,-2.1570437594962387e-5,-1.0281991235380007e-8,-1.0544002989509588e-5,-2.141339145539365e-5,-1.0284216045362617e-8,-1.0278390240021108e-5,-2.1198652865103365e-5,-1.0285974464584003e-8,-1.0070447996162899e-5,-2.0945037086426453e-5,-1.028711043152021e-8,-9.932690801530476e-6,-2.068088652200719e-5,-1.028749799157689e-8,-9.86563644678306e-6,-2.0440844298465255e-5,-1.0287141168707594e-8,-9.854764583517574e-6,-2.0259766952748523e-5,-1.028626273479879e-8,-9.870619619233569e-6,-2.01644508838674e-5,-1.0285319481300823e-8,-9.8733786193769e-6,-2.0165339281957866e-5,-1.0284908068411034e-8,-9.821625784056985e-6,-2.0251252759600633e-5,-1.0285579389915266e-8,-9.683168074476673e-6,-2.0389683901633625e-5,-1.0287635145367275e-8,-9.444561568473699e-6,-2.053338593781372e-5,-1.0290997813059452e-8,-9.116224347150207e-6,-2.063177957102368e-5,-1.0295216467786993e-8,-8.731339354531077e-6,-2.0644132770129046e-5,-1.0299605534523448e-8,-8.338457137712565e-6,-2.055092931652111e-5,-1.030345694288755e-8,-7.98933323349338e-6,-2.0360097137701205e-5,-1.0306242488373733e-8,-7.72506620945875e-6,-2.0105711184980106e-5,-1.0307743277604975e-8,-7.564775484823967e-6,-1.983876173135379e-5,-1.0308080804889762e-8,-7.500921681843046e-6,-1.9612526930376168e-5,-1.0307656350511951e-8,-7.503139782780013e-6,-1.946768074753192e-5,-1.0307019062928134e-8,-7.528820005869814e-6,-1.9422601531502887e-5,-1.0306699910081859e-8,-7.535794278292598e-6,-1.947177763761887e-5,-1.0307063665786794e-8,-7.492269894596984e-6,-1.959128917115925e-5,-1.0308233957531626e-8,-7.381486721375345e-6,-1.974765598713154e-5,-1.0310113143840973e-8,-7.201498312177095e-6,-1.990624677978869e-5,-1.031247670749912e-8,-6.962107167616799e-6,-2.0037161470478344e-5,-1.031508699283958e-8,-6.680993863389137e-6,-2.011834907841151e-5,-1.0317770097194946e-8,-6.380273436048308e-6,-2.0136768138740442e-5,-1.032042648831648e-8,-6.0838277247680745e-6,-2.0088636779103125e-5,-1.0322983928965702e-8,-5.815108860030673e-6,-1.9979521669310532e-5,-1.0325335032912242e-8,-5.594817165694961e-6,-1.9824453315227466e-5,-1.0327309582072665e-8,-5.437930590768389e-6,-1.9647685779100526e-5,-1.0328712972235372e-8,-5.349939383493514e-6,-1.948122710398913e-5,-1.0329423078834094e-8,-5.3228826376455855e-6,-1.936095973346019e-5,-1.0329498903693821e-8,-5.332864110333339e-6,-1.9319532507723174e-5,-1.0329235310495402e-8,-5.341522628441661e-6,-1.9376734531154476e-5,-1.0329117209882681e-8,-5.303353476159965e-6,-1.953039383977173e-5,-1.0329676054612896e-8,-5.17823507516099e-6,-1.9752454282041895e-5,-1.0331308373795825e-8,-4.945019491343102e-6,-1.9993909540435985e-5,-1.0334140752283602e-8,-4.610138350751177e-6,-2.019829297048899e-5,-1.0337995748268947e-8,-4.206914461260477e-6,-2.0318725218684748e-5,-1.0342450652703292e-8,-3.7858145479968068e-6,-2.033162353691172e-5,-1.0346947057188743e-8,-3.3999204340748854e-6,-2.0242322080569558e-5,-1.0350921705190584e-8,-3.090978422107698e-6,-2.0081863583639396e-5,-1.035394277316305e-8,-2.879939472361453e-6,-1.9897267305424163e-5,-1.0355827001534681e-8,-2.7637461044958318e-6,-1.9738805558921248e-5,-1.035669501194934e-8,-2.7182918430026305e-6,-1.9647845328083208e-5,-1.0356930437472887e-8,-2.706078182001334e-6,-1.964815539595743e-5,-1.0357046501868146e-8,-2.6861280184476436e-6,-1.9742416449230415e-5,-1.035751449251452e-8,-2.623356484294166e-6,-1.9914165200530054e-5,-1.0358627867133187e-8,-2.495051690997066e-6,-2.0133848461016657e-5,-1.0360457505484327e-8,-2.2933525948354025e-6,-2.0366613404506264e-5,-1.0362901596694904e-8,-2.024101506874866e-6,-2.057945330065126e-5,-1.036578541391425e-8,-1.703438490176005e-6,-2.0746243231691587e-5,-1.0368950180661795e-8,-1.353670649395772e-6,-2.085034603832491e-5,-1.0372285844231933e-8,-9.995092065925437e-7,-2.0885306200609506e-5,-1.0375703780683756e-8,-6.650892091385618e-7,-2.085449651147433e-5,-1.0379079635308058e-8,-3.715968940342627e-7,-2.0770428531116953e-5,-1.0382217349452199e-8,-1.3503446063713592e-7,-2.065397945826239e-5,-1.0384871607393536e-8,3.635039213145238e-8,-2.053328258334241e-5,-1.0386834569506982e-8,1.451554926153161e-7,-2.0441523455916053e-5,-1.038805057918194e-8,2.0789280435282035e-7,-2.041250688557186e-5,-1.0388697272151172e-8,2.56355366977416e-7,-2.047315309918241e-5,-1.0389176849844525e-8,3.3464806040304173e-7,-2.0633626967615144e-5,-1.039000389350313e-8,4.896682666698106e-7,-2.0878520990299207e-5,-1.0391635630909641e-8,7.558554175414243e-7,-2.1164864508976094e-5,-1.0394332164603972e-8,1.1400137473200676e-6,-2.143168146622313e-5,-1.039811235383832e-8,1.6149011662753742e-6,-2.161972150492724e-5,-1.040278944838272e-8,2.1267889603254867e-6,-2.169252145724684e-5,-1.0408016370122865e-8,2.613791080986166e-6,-2.1648099623553002e-5,-1.0413314414030032e-8,3.0255611796536674e-6,-2.1516600834236966e-5,-1.0418136661790554e-8,3.335896657502066e-6,-2.1347475609993867e-5,-1.0422008383847894e-8,3.5455028334495375e-6,-2.1193595706788387e-5,-1.0424695027343131e-8,3.6771057866818085e-6,-2.1098205117584193e-5,-1.0426297045670991e-8,3.766730983759074e-6,-2.1087212163472165e-5,-1.0427207186394536e-8,3.8543118584060025e-6,-2.116678673670468e-5,-1.0427955059979016e-8,3.97556153049034e-6,-2.1325112935168602e-5,-1.0429021553114722e-8,4.156112148298531e-6,-2.1536968915716497e-5,-1.043071137120023e-8,4.4083884967787636e-6,-2.1769858276116903e-5,-1.0433124870667529e-8,4.731238299426264e-6,-2.199039967092715e-5,-1.0436213182297564e-8,5.111871251593329e-6,-2.216982148981789e-5,-1.0439862617282118e-8,5.5293180610449155e-6,-2.228781360239789e-5,-1.0443951826756803e-8,5.958483105439134e-6,-2.2334471279948907e-5,-1.0448355486385057e-8,6.3739591557127685e-6,-2.2310548005592115e-5,-1.0452908274701619e-8,6.753167656295747e-6,-2.2226596306971968e-5,-1.0457371227043073e-8,7.0788641774440105e-6,-2.2101555638768476e-5,-1.0461442256004719e-8,7.341270437022586e-6,-2.19610250197676e-5,-1.0464828194753588e-8,7.540107011405848e-6,-2.18351220744106e-5,-1.0467357564690674e-8,7.686656069240698e-6,-2.1755428418429816e-5,-1.0469080980364281e-8,7.805377469636384e-6,-2.175014455624397e-5,-1.047029980195859e-8,7.933563002743403e-6,-2.1836872868918745e-5,-1.0471493607166954e-8,8.116719413656968e-6,-2.2013889674084526e-5,-1.0473170238320335e-8,8.397782946960609e-6,-2.2253242470900754e-5,-1.0475713376965965e-8,8.801167458084262e-6,-2.2501424654771112e-5,-1.0479313312473675e-8,9.31809147430383e-6,-2.2692544610459407e-5,-1.0483994091602052e-8,9.903277804372193e-6,-2.2771894060168208e-5,-1.0489651043077342e-8,1.0488693236733184e-5,-2.2718401944810526e-5,-1.0496011071352977e-8,1.1008517592282977e-5,-2.2552507598399298e-5,-1.0502567400688094e-8,1.14214527653244e-5,-2.2325484053898436e-5,-1.0508639692043991e-8,1.1719729539192924e-5,-2.2098427892878435e-5,-1.051360321451119e-8,1.192434757606461e-5,-2.192293983959106e-5,-1.0517149141774825e-8,1.2073148493867486e-5,-2.1830348879371115e-5,-1.0519399549919799e-8,1.2208507379845121e-5,-2.1829582167914723e-5,-1.0520823108331641e-8,1.2368142087573956e-5,-2.1910517424363665e-5,-1.0522026852220468e-8,1.2579647860001937e-5,-2.204963465047748e-5,-1.0523548294514526e-8,1.2858046046948135e-5,-2.2216044306126058e-5,-1.052573427092128e-8,1.3205504635807662e-5,-2.2377097194277054e-5,-1.0528728383253077e-8,1.3612660353343853e-5,-2.2503232700248113e-5,-1.0532528837699294e-8,1.4061128311368573e-5,-2.257179941745656e-5,-1.053705767622001e-8,1.4526835423976653e-5,-2.2569659248670465e-5,-1.0542194374134102e-8,1.4983796312142356e-5,-2.2494425657141477e-5,-1.0547763574333112e-8,1.5407831934948618e-5,-2.2354282969079747e-5,-1.0553504640982075e-8,1.5779770461427512e-5,-2.2166624359187616e-5,-1.0559067684047334e-8,1.608797482690634e-5,-2.195590135189993e-5,-1.0564065337397685e-8,1.6330245854374478e-5,-2.1750905552668204e-5,-1.0568177866410433e-8,1.6515130621988764e-5,-2.1581513602797013e-5,-1.0571271898841906e-8,1.6662595891771928e-5,-2.1474755707688038e-5,-1.0573475716392125e-8,1.680367989659793e-5,-2.144982680559584e-5,-1.0575164031555221e-8,1.6977991855744892e-5,-2.15119081550659e-5,-1.0576851619497795e-8,1.7227451460833117e-5,-2.164590037929872e-5,-1.0579043607594197e-8,1.758528349482335e-5,-2.1813063305720084e-5,-1.0582122319913347e-8,1.8061786594786307e-5,-2.1955189701945334e-5,-1.058632473338257e-8,1.8632948981106676e-5,-2.200995658499017e-5,-1.0591773118012249e-8,1.9241195983456193e-5,-2.193466323120593e-5,-1.0598445172373046e-8,1.981317133003406e-5,-2.1726452282952587e-5,-1.0606040069575834e-8,2.0287448616256157e-5,-2.1425281858291863e-5,-1.061388459734303e-8,2.0636332778655594e-5,-2.109672690297479e-5,-1.0621077002227759e-8,2.087033260256244e-5,-2.0805852875933422e-5,-1.0626847060734854e-8,2.1026869693195923e-5,-2.0597119217422514e-5,-1.0630882019558624e-8,2.115329294074093e-5,-2.0487273010198692e-5,-1.0633405474768798e-8,2.129300028400665e-5,-2.0468775249628576e-5,-1.0635008899056331e-8,2.1477766769687902e-5,-2.0517857674518222e-5,-1.0636384654839218e-8,2.172530639983127e-5,-2.0602735888928814e-5,-1.0638109815842078e-8,2.203989369531137e-5,-2.0690072956350867e-5,-1.0640550610319622e-8,2.2414327228279076e-5,-2.0749586688981025e-5,-1.0643876480653403e-8,2.2832428864176618e-5,-2.075731437602081e-5,-1.0648123545462657e-8,2.327186373709147e-5,-2.06979052512023e-5,-1.065324691100052e-8,2.370725263408254e-5,-2.056607264478361e-5,-1.065912813728469e-8,2.4113571523498897e-5,-2.0367140342581537e-5,-1.0665546197757955e-8,2.4469666599175597e-5,-2.011644324456059e-5,-1.067215081453571e-8,2.4761457155718238e-5,-1.9837455761494462e-5,-1.0678483547801098e-8,2.4984396740016067e-5,-1.9558825643028435e-5,-1.0684064625935296e-8,2.5144939672969598e-5,-1.9310587473940774e-5,-1.0688525639022025e-8,2.5260818881569855e-5,-1.9119802585786575e-5,-1.06917361236997e-8,2.535994562171527e-5,-1.9005914717674657e-5,-1.069386581323808e-8,2.5477696466233576e-5,-1.897609088271257e-5,-1.0695349149176802e-8,2.5652094341733997e-5,-1.902096367210599e-5,-1.0696767956414568e-8,2.5916298087693046e-5,-1.9111975005796678e-5,-1.0698709732170148e-8,2.628859728374691e-5,-1.9202643001807574e-5,-1.0701666562329869e-8,2.6762094197675117e-5,-1.9236556751696734e-5,-1.0705996336353121e-8,2.729911355674748e-5,-1.9163344524585584e-5,-1.0711891767678148e-8,2.783684602254258e-5,-1.895885387153898e-5,-1.0719277613221644e-8,2.8306670586864564e-5,-1.8639334239086277e-5,-1.072766183557865e-8,2.8659855505782475e-5,-1.8258763113995928e-5,-1.073612159190717e-8,2.8885279659063856e-5,-1.7888184927921706e-5,-1.0743575505291491e-8,2.9009231738796605e-5,-1.7588764782654586e-5,-1.0749225136080199e-8,2.908000233439939e-5,-1.7393518711195572e-5,-1.0752864147570606e-8,2.914855079008243e-5,-1.7304111401313012e-5,-1.0754868997586099e-8,2.9254770735155143e-5,-1.7298721919266967e-5,-1.0755947029287413e-8,2.9421960148790195e-5,-1.73433769434448e-5,-1.0756840443938963e-8,2.9657262395368594e-5,-1.7401543433202763e-5,-1.075813349050785e-8,2.9954830790562838e-5,-1.7440335048629465e-5,-1.0760197584755174e-8,3.0299471035757358e-5,-1.7433879737981824e-5,-1.0763229561035464e-8,3.066988743140981e-5,-1.7365039408173015e-5,-1.0767308977273792e-8,3.104156445903691e-5,-1.7226340848682806e-5,-1.0772421289059723e-8,3.138958150404849e-5,-1.7020431608455362e-5,-1.0778433463519163e-8,3.169160978062888e-5,-1.67599800034654e-5,-1.0785050830896731e-8,3.193113385062856e-5,-1.6466649719056538e-5,-1.0791801522036606e-8,3.2100549457274216e-5,-1.6168735086317945e-5,-1.0798090040294278e-8,3.2203473041458363e-5,-1.5897357896149383e-5,-1.080332573716205e-8,3.225558795119785e-5,-1.568153341658853e-5,-1.0807089151843031e-8,3.2283527758016355e-5,-1.5542734995758057e-5,-1.0809272801144117e-8,3.232156973954858e-5,-1.548986537631878e-5,-1.0810136690642487e-8,3.24062788787755e-5,-1.551564386066977e-5,-1.0810253821627843E-08,3.256954672694955e-5,-1.5595319915829232e-5,-1.0810370807169095e-8,3.2830743045217534e-5,-1.5688646392023816e-5,-1.0811243374832355e-8,3.318930936264058e-5,-1.5746136030541182e-5,-1.0813499406816032e-8,3.362016828548337e-5,-1.572010074949781e-5,-1.0817540474292183e-8,3.4075238666891787e-5,-1.5579179787124913e-5,-1.0823450353064908e-8,3.449382518613816e-5,-1.532196370613026e-5,-1.0830892582439516e-8,3.482107455406541e-5,-1.498254328611866e-5,-1.0839063244369992e-8,3.502767239053273e-5,-1.4622079522363778e-5,-1.0846829814097262e-8,3.5120439857015004e-5,-1.4307820231652071e-5,-1.085309302508078e-8,3.51375862864246e-5,-1.4089687106817873e-5,-1.085719959088525e-8,3.513199200269295e-5,-1.3986345854532377e-5,-1.085914650566585e-8,3.51525500412995e-5,-1.3985560988209588e-5,-1.085947705163363e-8,3.523209339490654e-5,-1.4054646803086456e-5,-1.0858988747294016e-8,3.5384088933798624e-5,-1.4153334684894148e-5,-1.0858452300955869e-8,3.560538153213612e-5,-1.4243709791482467e-5,-1.0858457682387729e-8,3.5881218350812025e-5,-1.4295764431560704e-5,-1.0859389106431877e-8,3.619005612992247e-5,-1.4289538747822578e-5,-1.0861464399875234e-8,3.650727263331189e-5,-1.4215445163763979e-5,-1.0864770150441248e-8,3.680795793798622e-5,-1.4073968871802461e-5,-1.0869255064842456e-8,3.7069338849790505e-5,-1.3875233842953704e-5,-1.0874690311021376e-8,3.7273324238066565e-5,-1.3638322204225281e-5,-1.0880636211450608e-8,3.740935211446729e-5,-1.338984019635138e-5,-1.0886460859978193e-8,3.747723555199965e-5,-1.3161108246832657e-5,-1.0891439508632244e-8,3.748918890039127e-5,-1.2983612439641286e-5,-1.0894923864558378e-8,3.746992648426565e-5,-1.2882969889767162e-5,-1.0896531846094513e-8,3.745388166964016e-5,-1.2872486930655807e-5,-1.089628939077259e-8,3.7479301400060466e-5,-1.2948111531254483e-5,-1.089466332568615e-8,3.758006931596514e-5,-1.3086710784613064e-5,-1.0892467653005773e-8,3.7777099336497654e-5,-1.3248905734680901e-5,-1.0890674230236611e-8,3.807156828641263e-5,-1.3386503835473725e-5,-1.0890190192257392e-8,3.844207700891592e-5,-1.3453370708504295e-5,-1.0891659080748418e-8,3.8847217212184006e-5,-1.341755372714709e-5,-1.0895313751720727e-8,3.9234030267991595e-5,-1.3271607631699584e-5,-1.090089279363746e-8,3.955132226947631e-5,-1.3037539781839813e-5,-1.0907643242370493e-8,3.976462669241938e-5,-1.2763223288738137e-5,-1.0914452499003047e-8,3.9867493531828635e-5,-1.250952451713426e-5,-1.0920130006578416e-8,3.988372523989806e-5,-1.2331758085782543e-5,-1.0923768775661982e-8,3.9858740281902724e-5,-1.226291312067013e-5,-1.0925025267279314e-8,3.98438771345933e-5,-1.2305852412647015e-5,-1.0924174807119913e-8,3.988096864166715e-5,-1.2436775734862486e-5,-1.092193559817097e-8,3.9993234799773925e-5,-1.2616327199137168e-5,-1.0919186656117713e-8,4.0184029323987886e-5,-1.2802124998079611e-5,-1.0916728214422174e-8,4.0441034122307655e-5,-1.295806215039957e-5,-1.0915158387722742e-8,4.07423430323965e-5,-1.3059008181614689e-5,-1.0914851840032176e-8,4.106194258997215e-5,-1.309190696252388e-5,-1.0915982377055156e-8,4.137369026554492e-5,-1.305496471159586e-5,-1.0918538217819229e-8,4.165397699143815e-5,-1.295627528662622e-5,-1.0922312589289403e-8,4.188372567499801e-5,-1.281253335343146e-5,-1.0926886273075621e-8,4.205038798547874e-5,-1.2647779157268254e-5,-1.0931637253225023e-8,4.2150263329725885e-5,-1.2491600175957169e-5,-1.0935808929506866e-8,4.219089514943613e-5,-1.2376014975777942e-5,-1.0938645719799141e-8,4.219264556971658e-5,-1.2330443038611213e-5,-1.0939574041035733e-8,4.2187994684927e-5,-1.2374868917154073e-5,-1.0938381011529256e-8,4.221708942536862e-5,-1.251262722220375e-5,-1.0935330563847715e-8,4.2319148750577894e-5,-1.272563608677644e-5,-1.0931164753811414e-8,4.252146931834362e-5,-1.2975210570017808e-5,-1.0926967333923104e-8,4.282981205890698e-5,-1.3209939979367455e-5,-1.0923913734952636e-8,4.3224317253663856e-5,-1.3379021269503886e-5,-1.092296888156952e-8,4.3663191015489984e-5,-1.3446687017306154e-5,-1.0924616375420668e-8,4.40932553261884e-5,-1.3402692615521834e-5,-1.0928699864093918e-8,4.446391154055205e-5,-1.3265486287865059e-5,-1.0934436131087437e-8,4.4740262897078254e-5,-1.3077370375528966e-5,-1.0940609312170373e-8,4.491180449520049e-5,-1.2893262674070154e-5,-1.0945898968800855e-8,4.49944176700801e-5,-1.2766207079580588e-5,-1.0949239480507803e-8,4.502512200115446e-5,-1.273370298418019e-5,-1.0950092267772875e-8,4.505116850684658e-5,-1.2808910095088956e-5,-1.0948539845884595e-8,4.511705275984765e-5,-1.2979305349759284e-5,-1.0945188231944347e-8,4.5253768849291526e-5,-1.3212635289537497e-5,-1.0940942427650663e-8,4.547343858202198e-5,-1.3467274984818715e-5,-1.093675586758881e-8,4.576991139681106e-5,-1.370288962080165e-5,-1.0933437996680767e-8,4.6123562686564354e-5,-1.3888173614010929e-5,-1.0931552459312198e-8,4.6507586318521756e-5,-1.4004532581867268e-5,-1.0931388495325245e-8,4.689364295154041e-5,-1.404638935558007e-5,-1.0932970781736282e-8,4.725592017948633e-5,-1.401955872819049e-5,-1.0936077710211673e-8,4.7573669880768315e-5,-1.3939013934426217e-5,-1.0940262282537435e-8,4.783282623871706e-5,-1.3826794886489019e-5,-1.0944887017204275e-8,4.8027394648472436e-5,-1.3710116999369636e-5,-1.0949190756732851e-8,4.816102679731794e-5,-1.361918978051325e-5,-1.095239527820225e-8,4.824866180786038e-5,-1.3583965343721564e-5,-1.0953844774146032e-8,4.8317389669767263E-05,-1.3629077500997938e-5,-1.0953156144793383e-8,4.8404937665998705e-5,-1.3766894228811147e-5,-1.0950352515756894e-8,4.85539270343216e-5,-1.3990186698127629e-5,-1.094594628661613e-8,4.880120852726276e-5,-1.4267952993854126e-5,-1.0940929580088114e-8,4.9164604434804093e-5,-1.4548760923785778e-5,-1.0936627198037842e-8,4.963284107903462e-5,-1.4773613411439147e-5,-1.0934389782899522e-8,5.016508945338154e-5,-1.4894876338232566e-5,-1.0935178671721424e-8,5.070227547728938e-5,-1.4892932210451892e-5,-1.0939190020118924e-8,5.118560276541905e-5,-1.4782534477633037e-5,-1.0945713139716886e-8,5.157392379064546e-5,-1.4606625431828425e-5,-1.095332893238933e-8,5.185338963389235e-5,-1.4421810233716862e-5,-1.0960371481365232e-8,5.203770610741841e-5,-1.4282157086463557e-5,-1.0965440644733544e-8,5.216122418436789e-5,-1.422646572966351e-5,-1.0967760623641757e-8,5.226841451573015e-5,-1.4271353392898255e-5,-1.0967288706004566e-8,5.2402901302713924e-5,-1.4410350265664105e-5,-1.0964601820102489e-8,5.2598368352539667e-5,-1.4617978010402564e-5,-1.0960658830434025e-8,5.2872840342696726e-5,-1.4857176091440661e-5,-1.0956540629101209e-8,5.322704970841118e-5,-1.5088075305254894e-5,-1.0953236332976238e-8,5.364663492512684e-5,-1.5275993367745722e-5,-1.0951500603035131e-8,5.410696514106418e-5,-1.539698624027727e-5,-1.095178087382418e-8,5.457893133346143e-5,-1.5440298921740233e-5,-1.0954194761142424e-8,5.50342383558213e-5,-1.540806131983914e-5,-1.0958542424790509e-8,5.544932692850507e-5,-1.5313173657149106e-5,-1.096434545062792e-8,5.580777697902618e-5,-1.5176465955951547e-5,-1.0970910845978872e-8,5.610161114139606e-5,-1.502389729946295e-5,-1.0977420875607443e-8,5.633207828382777e-5,-1.4883981469539802e-5,-1.0983045974823884e-8,5.651030827952544e-5,-1.4785143953867945e-5,-1.0987069782932988e-8,5.6657843445042456E-05,-1.475241870537396e-5,-1.098900869828785e-8,5.68064043339674e-5,-1.480281230944594e-5,-1.0988713689162896e-8,5.6995445257911e-5,-1.493919710310919e-5,-1.0986451645489575e-8,5.726569833881333e-5,-1.5144085304198487e-5,-1.0982961665724738e-8,5.7647873217573626e-5,-1.537676462498628e-5,-1.097945336000276e-8,5.8148783022304093e-5,-1.5578618482013747e-5,-1.0977468969124607e-8,5.8741629395056166e-5,-1.5689303712884644e-5,-1.0978518978595156e-8,5.936880170599819e-5,-1.5669452550320848e-5,-1.0983516728908241e-8,5.995982222233368e-5,-1.5518212400740367e-5,-1.0992265385709335e-8,6.045655109961612e-5,-1.5274524989521094e-5,-1.100336461316192e-8,6.083213388443301e-5,-1.500128721893175e-5,-1.1014687824535179e-8,6.109517706905173e-5,-1.476232162248893e-5,-1.1024177858417426e-8,6.128078642644321e-5,-1.4603933293794295e-5,-1.1030515003487311e-8,6.14360565632286e-5,-1.4546623392676997e-5,-1.1033379525122147e-8,6.160676979381152e-5,-1.4585862441534919e-5,-1.1033325129027129e-8,6.182836446050053e-5,-1.4698115916188576e-5,-1.103144492460905e-8,6.212137962144658e-5,-1.4848716247797194e-5,-1.1029016395917635e-8,6.249043218855688e-5,-1.499957486442772e-5,-1.1027231651313366e-8,6.292575713367833e-5,-1.5115848315998846e-5,-1.1027035010884309e-8,6.340659244996193e-5,-1.5171078050374148e-5,-1.1029042575856415e-8,6.39057084276371e-5,-1.5150397168465046e-5,-1.1033511588368882e-8,6.439430170432664e-5,-1.5051632264841132e-5,-1.1040338007405747e-8,6.484651366485014e-5,-1.4884453987230887e-5,-1.1049078955669309e-8,6.524295871579131e-5,-1.4668006957840344e-5,-1.1059009733669053e-8,6.557293822920603e-5,-1.4427696477046931e-5,-1.106922243082436e-8,6.583546021894932e-5,-1.4191801641639522e-5,-1.1078757988711264e-8,6.603942429151922e-5,-1.3988227254888844e-5,-1.1086754263160646e-8,6.620324712438544e-5,-1.3841351539194972e-5,-1.1092584244638724e-8,6.635399675116738e-5,-1.376871069724712e-5,-1.1095960923446284e-8,6.652567539394843e-5,-1.377713360613599e-5,-1.1097002545640146e-8,6.675562941069513e-5,-1.3858317394900903e-5,-1.109626926494747e-8,6.707780774668518e-5,-1.3985038180359028e-5,-1.1094780789983727e-8,6.751241829499467e-5,-1.4110813964274978e-5,-1.1093985695546706e-8,6.805398404589733e-5,-1.4176969697956724e-5,-1.1095592658974113e-8,6.866384590550756e-5,-1.4129570457204582e-5,-1.1101140430408416e-8,6.927548828970987e-5,-1.3942193950697216e-5,-1.1111323602410547e-8,6.981586375490909e-5,-1.3632135932979031e-5,-1.1125409233657399e-8,7.023376113526364e-5,-1.3257268294156674e-5,-1.1141255562749935e-8,7.051856313032443e-5,-1.2893039413830864e-5,-1.1156102060587921e-8,7.06990864524921e-5,-1.2603544775620664e-5,-1.1167680283957444e-8,7.082667807448929e-5,-1.2422764469719474e-5,-1.1174960488599823e-8,7.095499623308146e-5,-1.2351727669469376e-5,-1.1178226969257668e-8,7.112590319904138e-5,-1.2366745927631601e-5,-1.1178667858819269e-8,7.136360199813396e-5,-1.2431038164156497e-5,-1.117783577309838e-8,7.167471562637514e-5,-1.2504825814492575e-5,-1.1177222677717251e-8,7.20513073116622e-5,-1.2552337068439892e-5,-1.1178022183958767e-8,7.247483939519828e-5,-1.2546082636510993e-5,-1.1181041603564716e-8,7.292025057925622e-5,-1.2469246626440453e-5,-1.1186692155499417e-8,7.335996924164086e-5,-1.2316707228409032e-5,-1.1195001134773114e-8,7.376777185043507e-5,-1.2094851223874839e-5,-1.1205627668886617e-8,7.41223204444516e-5,-1.1820215935622424e-5,-1.1217891224875756e-8,7.441008632046292e-5,-1.1516986111407657e-5,-1.1230839822596301e-8,7.462727595584035e-5,-1.121357421653002e-5,-1.1243374292470443e-8,7.478054238337684e-5,-1.0938760084437633e-5,-1.1254418929902535e-8,7.48865297826223e-5,-1.0717820966566956e-5,-1.1263107130437595e-8,7.497036903850236e-5,-1.0568904309436396e-5,-1.1268942299422062e-8,7.506321783824891e-5,-1.0499811842188604e-5,-1.1271900341615984e-8,7.519881869817697e-5,-1.0505257389349248e-5,-1.1272463646632064e-8,7.540869080999105e-5,-1.056479190521469e-5,-1.1271600290428743e-8,7.571546174872404e-5,-1.0642370424357846e-5,-1.1270700670162078e-8,7.61246291272292e-5,-1.0689513165947758e-5,-1.1271446895380041e-8,7.661678435223831e-5,-1.0654320433158899e-5,-1.1275546237460665e-8,7.71448147730922e-5,-1.0497201563490087e-5,-1.1284249952033519e-8,7.764205458950148e-5,-1.0209521680141907e-5,-1.1297711821998253e-8,7.804347387462571e-5,-9.824875614952504e-6,-1.1314530735816466e-8,7.831185681715099e-5,-9.411967862924406e-6,-1.133196933848187e-8,7.84533388443129e-5,-9.048847109690942e-6,-1.134696307423481e-8,7.851205357156255e-5,-8.792740654590127e-6,-1.1357361358067248e-8,7.854866512846068e-5,-8.662856311024963e-6,-1.1362623719687482e-8,7.861729582289454e-5,-8.642245361453145e-6,-1.1363680031735883e-8,7.875197622822127e-5,-8.691794929389404e-6,-1.1362277223349593e-8,7.896418283479847e-5,-8.765841602924702e-6,-1.1360297098831838e-8,7.924709191886245e-5,-8.823284793479496e-6,-1.1359315593534433e-8,7.95818503140842e-5,-8.833269852576455e-6,-1.1360426738010168e-8,7.994322616848324e-5,-8.777041367256928e-6,-1.1364233495034238e-8,8.030394161526125e-5,-8.647855079034407e-6,-1.1370898907447606e-8,8.063800618353983e-5,-8.450099063104403e-6,-1.13801913797548e-8,8.092351739561471e-5,-8.197986994855086e-6,-1.139151507594174e-8,8.114517708580553e-5,-7.913748681025796e-6,-1.1403947928868321e-8,8.129649091610874e-5,-7.625053643838189e-6,-1.1416325803923466e-8,8.13812925714093e-5,-7.361498470228608e-6,-1.1427396960663914e-8,8.141408671042445e-5,-7.150374877007221e-6,-1.143603391639288e-8,8.141887617018724e-5,-7.012246466696308e-6,-1.1441458496670813e-8,8.142639354204631e-5,-6.9569547070524565e-6,-1.1443423882852663e-8,8.146989071188947e-5,-6.980733178277085e-6,-1.1442305223764873e-8,8.157988588747373e-5,-7.0650386142183395e-6,-1.1439079612900346e-8,8.177834068751832e-5,-7.177494714956207e-6,-1.1435206339439226e-8,8.207274310460953e-5,-7.275416748518267e-6,-1.1432431508335396e-8,8.24510452990543e-5,-7.312655501458012e-6,-1.1432513684254343e-8,8.287939415777408e-5,-7.250137973215447e-6,-1.14368513607406e-8,8.330545375814392e-5,-7.068926237825051e-6,-1.1446018896562171e-8,8.366980628525399e-5,-6.781801504635946e-6,-1.1459328098698728e-8,8.392475651610919e-5,-6.436424280153653e-6,-1.147469615909485e-8,8.405365240588183e-5,-6.103856380286995e-6,-1.1489120917511639e-8,8.407948845031888e-5,-5.853970011362507e-6,-1.1499731792143241e-8,8.405583920133282e-5,-5.729599983451548e-6,-1.1504887252346792e-8,8.404479026302159e-5,-5.733734864168806e-6,-1.1504668019600196e-8,8.409487550610288e-5,-5.8348805222652595e-6,-1.1500567610929476e-8,8.422953279231353e-5,-5.983832090974439e-6,-1.1494726575699467e-8,8.44475135877195e-5,-6.130958240035688e-6,-1.1489203384318796e-8,8.473016954110671e-5,-6.237308506807428e-6,-1.1485549198160168e-8,8.504997460131159e-5,-6.278822698858891e-6,-1.1484684339034437e-8,8.537722202659041e-5,-6.24604350020151e-6,-1.1486947837148801e-8,8.56843216611937e-5,-6.141962433049987e-6,-1.149219497561945e-8,8.594839135529726e-5,-5.979584647913548e-6,-1.1499878642207251e-8,8.615303700245352e-5,-5.7797022876110846e-6,-1.1509108282661373e-8,8.628989016331793e-5,-5.568700527437504e-6,-1.1518717192858226e-8,8.636003840534361e-5,-5.3759285752394796e-6,-1.1527377565087991e-8,8.637502793286532e-5,-5.230188533993722e-6,-1.1533784620290696e-8,8.635675385529202e-5,-5.155286769746592e-6,-1.1536897415011626e-8,8.63355224875678e-5,-5.165182714998419e-6,-1.1536184302568082e-8,8.634591892159362e-5,-5.259775561616308e-6,-1.1531803962477889e-8,8.642073115040163e-5,-5.4226586174864975e-6,-1.152465872996433e-8,8.65839351077441e-5,-5.622046886179956e-6,-1.1516287597576716e-8,8.684430755827092e-5,-5.8153923203604484e-6,-1.1508609070013934e-8,8.719130249188195e-5,-5.95728092691672e-6,-1.1503558232602766e-8,8.759455242721197e-5,-6.009491974966764e-6,-1.150267039330855e-8,8.800800850055604e-5,-5.95147211987009e-6,-1.1506668360848453e-8,8.837913286366379e-5,-5.7886627769627485e-6,-1.1515138637633855e-8,8.866225574551908e-5,-5.555373933240397e-6,-1.1526431984484355e-8,8.883301404506053e-5,-5.309063543337344e-6,-1.1537937388838975e-8,8.889840023466499e-5,-5.115164449411993e-6,-1.1546777723907165e-8,8.889656623832367e-5,-5.026383401286591e-6,-1.1550737585091733e-8,8.888441107440784e-5,-5.065123260574208e-6,-1.154900893343037e-8,8.891787950494431e-5,-5.21765631045529e-6,-1.1542374452129857e-8,8.903443511633252e-5,-5.442337151279303e-6,-1.1532775965427147e-8,8.924516874443352e-5,-5.686194762207577e-6,-1.1522563607641413e-8,8.953744138069596e-5,-5.90108623252899e-6,-1.1513813593362013e-8,8.988360538093972e-5,-6.053558073616242e-6,-1.1507938669655695e-8,9.025045498071756e-5,-6.127657333921901e-6,-1.1505594789433005e-8,9.06062942791196e-5,-6.123105910016481e-6,-1.1506768232466762e-8,9.092503624012695e-5,-6.051676523403866e-6,-1.1510921388865986e-8,9.118813404710323e-5,-5.933591903961702e-6,-1.1517128603869335e-8,9.138545565664259e-5,-5.794575433039127e-6,-1.1524189430321015e-8,9.151591271894805e-5,-5.66334449111308e-6,-1.1530742462923101e-8,9.158811085003475e-5,-5.568946066028995e-6,-1.1535410442970295e-8,9.162072310193748e-5,-5.537335450390624e-6,-1.1536995250412474e-8,9.164182458652515e-5,-5.58694690455087e-6,-1.1534711584048976e-8,9.168620213239225e-5,-5.723696108466005e-6,-1.152841879943091e-8,9.178992959661302e-5,-5.936777568263604e-6,-1.1518779345972147e-8,9.198249027190544e-5,-6.197337314678204e-6,-1.1507263760530225e-8,9.227820821065515e-5,-6.461935833751877e-6,-1.1495944136778205e-8,9.266993147833276e-5,-6.6812950165578724e-6,-1.1487076652143873e-8,9.31278874804674e-5,-6.8125918600802576e-6,-1.1482550916430714e-8,9.360510332344588e-5,-6.831677883244499e-6,-1.1483350519634967e-8,9.404841563306238e-5,-6.741163582188049e-6,-1.1489195433374426e-8,9.441208477567966e-5,-6.57151688468949e-6,-1.1498505989231926e-8,9.467017588287623e-5,-6.374429642810231e-6,-1.1508741618074349e-8,9.482411049793587e-5,-6.20983930092064e-6,-1.1517053215341923e-8,9.490280063124226e-5,-6.12986333255191e-6,-1.1521069363394867e-8,9.49546446025167e-5,-6.164351503798526e-6,-1.1519561592846616e-8,9.503343971679581e-5,-6.312991752990002e-6,-1.1512751366586703e-8,9.518296893644879e-5,-6.546957614728857e-6,-1.1502154648514587e-8,9.54258618892581e-5,-6.819249442704191e-6,-1.1490053068776307e-8,9.576033063758811e-5,-7.079181183195936e-6,-1.147882172959562e-8,9.616458460450145e-5,-7.285251177458946e-6,-1.1470361003639736e-8,9.660557779129375e-5,-7.412533789784719e-6,-1.1465779950685564e-8,9.70480253349657e-5,-7.454061673847203e-6,-1.1465342600263835e-8,9.746107955264904e-5,-7.418094434670623e-6,-1.1468592015480105e-8,9.782204348641294e-5,-7.323724614127018e-6,-1.1474549309030842e-8,9.811778004559563e-5,-7.196576837891347e-6,-1.1481914889362466e-8,9.834488254743438e-5,-7.065336659585935e-6,-1.1489242896633806e-8,9.85094970832235e-5,-6.958985648334306e-6,-1.1495095179541215e-8,9.862717385640469e-5,-6.90413645241066e-6,-1.1498196338733799e-8,9.8722513616579e-5,-6.921815594705209e-6,-1.1497607920369037e-8,9.882784972662761e-5,-7.023345607949021e-6,-1.1492923262731212e-8,9.897986411696639e-5,-7.205665995436498e-6,-1.148446098537155e-8,9.921318771121227e-5,-7.447586546246423e-6,-1.1473395307025696e-8,9.955120060763667e-5,-7.709619295232465e-6,-1.146172404791077e-8,9.999642762624879e-5,-7.940035443749168e-6,-1.1451968869426325e-8,1.0052494732063333e-4,-8.087647613726074e-6,-1.1446579632065744e-8,1.0108913471724907e-4,-8.117933472199266e-6,-1.1447169892722494e-8,1.016297505105532e-4,-8.025879558080473e-6,-1.1453875399227287e-8,1.0209339869072522e-4,-7.839290063002508e-6,-1.1465163461608666e-8,1.0244827762320929e-4,-7.610760831100816e-6,-1.1478236898852096e-8,1.0269227243374284e-4,-7.4019405703705335e-6,-1.1489879553959839e-8,1.0285149371859283e-4,-7.266368505272329e-6,-1.1497391887392736e-8,1.0297118136782965e-4,-7.236336161787715e-6,-1.1499280042755185e-8,1.0310270675950262e-4,-7.316726316035047e-6,-1.1495523318503002e-8,1.0329056362595021e-4,-7.486349598341804e-6,-1.148742159707798e-8,1.0356255453322497e-4,-7.705430672579288e-6,-1.1477144225777614e-8,1.0392519544575366e-4,-7.926623660176716e-6,-1.1467147125266295e-8,1.0436481553339658e-4,-8.106347722194308e-6,-1.1459615835618466e-8,1.048532139215313e-4,-8.213492770649762e-6,-1.1456056721422704e-8,1.0535556460250918e-4,-8.23373787288498e-6,-1.1457100913129077e-8,1.0583805546501133e-4,-8.169439622731186e-6,-1.1462518463608636e-8,1.0627352735391126e-4,-8.036400609196678e-6,-1.1471385560392026e-8,1.066445607363988e-4,-7.859266130393587e-6,-1.1482325768957206e-8,1.0694441306334356e-4,-7.666977342055716e-6,-1.1493758257334187e-8,1.0717666268625118e-4,-7.489017281889044e-6,-1.1504111986789331e-8,1.0735435490295485e-4,-7.35244966639261e-6,-1.1511999323604564e-8,1.0749903983642938e-4,-7.2792806829164845e-6,-1.1516363131548234e-8,1.0763957831135115e-4,-7.283580274524651e-6,-1.151661702847303e-8,1.0781007680501017e-4,-7.368012685883945e-6,-1.1512793302970118e-8,1.0804590054700001e-4,-7.520061810504988e-6,-1.1505692043057436e-8,1.0837680611466255e-4,-7.709425069854278e-6,-1.1496977420176755e-8,1.0881740161785823e-4,-7.889347522041987e-6,-1.1489103221812277e-8,1.0935759791410143e-4,-8.004876957400208e-6,-1.1484917776821892e-8,1.099584343313986e-4,-8.008601428695032e-6,-1.1486882532745956e-8,1.1055881062444225e-4,-7.879155597116695e-6,-1.1496092004950944e-8,1.1109371258594231e-4,-7.633039843956237e-6,-1.1511581608136922E-08,1.1151663459051103e-4,-7.321605202687162e-6,-1.1530431309502565e-8,1.1181492903404441e-4,-7.013454241810893e-6,-1.1548741122352925e-8,1.1201106022014476e-4,-6.771340174468865e-6,-1.1562985724005811e-8,1.1215140197415839e-4,-6.634405209780007e-6,-1.1571068149846324e-8,1.1228984212495073e-4,-6.611278102413541e-6,-1.1572697123814852e-8,1.1247315925664164e-4,-6.6831267112462406e-6,-1.1569144942454731e-8,1.127316993096942e-4,-6.812598750203812e-6,-1.156266778319374e-8,1.1307579932787652e-4,-6.954602663343077e-6,-1.1555859496188551e-8,1.1349688400417341e-4,-7.066217820959545e-6,-1.1551101049908461e-8,1.139717903089487e-4,-7.114299397794903e-6,-1.1550167056351804e-8,1.1446891416054345e-4,-7.080077937874377e-6,-1.1554002562827165e-8,1.149548174283551e-4,-6.960537575809596e-6,-1.1562667346861427e-8,1.1540007923220339e-4,-6.766933444370123e-6,-1.1575426285469924e-8,1.1578354861211906e-4,-6.521295786051894e-6,-1.1590947546989276e-8,1.1609463410885247e-4,-6.2519478086589645e-6,-1.160756007562344e-8,1.1633376296363593e-4,-5.989012039941205e-6,-1.1623518348194946e-8,1.1651156393922294e-4,-5.760573051355079e-6,-1.1637234212047214e-8,1.1664740182339614e-4,-5.589622358594828e-6,-1.1647459659802337e-8,1.1676759334021895e-4,-5.4915067272458905e-6,-1.1653428976732367e-8,1.1690326783015823e-4,-5.471531648050538e-6,-1.1654974611229112e-8,1.1708746557034123e-4,-5.5225030012895636e-6,-1.1652632718742514e-8,1.1735068033667883e-4,-5.622479874781477e-6,-1.1647735276380047e-8,1.1771412944112854e-4,-5.734062550996382e-6,-1.1642435438662262e-8,1.1818113725851937e-4,-5.8076621481172495e-6,-1.163954187668793e-8,1.1872926880585935e-4,-5.791344442245663e-6,-1.1642004245374285e-8,1.1930855430309953e-4,-5.647553044674574e-6,-1.1651984086518556e-8,1.1985155215788543e-4,-5.371443175151925e-6,-1.1669760410394222e-8,1.2029547121095116e-4,-4.99995084485974e-6,-1.1693115291372944e-8,1.2060678781026997e-4,-4.6024408688642385e-6,-1.1717833613867049e-8,1.2079400904598451e-4,-4.255199093046226e-6,-1.173926368756903e-8,1.2090126966665237e-4,-4.0137842781003e-6,-1.1754062382778059e-8,1.2098843584166365e-4,-3.897678566972292e-6,-1.176115704922468e-8,1.2111008984554611e-4,-3.891400665164609e-6,-1.1761637208694449e-8,1.213022496940009e-4,-3.95630760713687e-6,-1.1757971241563372e-8,1.2157839399120963e-4,-4.044896229076136e-6,-1.1753097167220337e-8,1.2193195516922581e-4,-4.112420305157807e-6,-1.1749718015863004e-8,1.2234182152848596e-4,-4.124267718560327e-6,-1.174987984666976e-8,1.227785275255919e-4,-4.059624660286843e-6,-1.1754780294877045e-8,1.2321007408265877e-4,-3.9124489345179326e-6,-1.1764728817057517e-8,1.2360698042256985e-4,-3.6904598768444323e-6,-1.1779212189448352e-8,1.2394631226203136e-4,-3.4126109266878824e-6,-1.1797041115608418e-8,1.242144823774108e-4,-3.1055077065965403e-6,-1.1816559520484416e-8,1.2440867826661164e-4,-2.799226073876711e-6,-1.1835897138338729e-8,1.2453685337986063e-4,-2.523031477587932e-6,-1.1853238148010125e-8,1.2461646512564885e-4,-2.301547896694e-6,-1.186706784611472e-8,1.2467235994619418e-4,-2.1516861724259745e-6,-1.1876371614580685e-8,1.2473410454800834e-4,-2.0803083645591164e-6,-1.1880779589050701e-8,1.2483283115915695e-4,-2.0825349597226646e-6,-1.1880660082478308e-8,1.2499748069359724e-4,-2.14069314709482e-6,-1.1877165836353078e-8,1.2525010295091812e-4,-2.2241823656063393e-6,-1.1872226457607199e-8,1.2559995192754653e-4,-2.2912602137460035e-6,-1.1868437590207958e-8,1.2603705811992328e-4,-2.2945068883105327e-6,-1.1868742828901586e-8,1.2652772420829495e-4,-2.191539426597471e-6,-1.1875794007561012e-8,1.2701630641300356e-4,-1.9604423994929207e-6,-1.1890987874401511e-8,1.2743771444703272e-4,-1.6147035257241735e-6,-1.1913481241468902e-8,1.2774003479321577e-4,-1.2075860053489198e-6,-1.1939854087612531e-8,1.2790733523272295e-4,-8.17705683285339e-7,-1.1965019553764724e-8,1.279679628288094e-4,-5.194673008425952e-7,-1.1984174542305361e-8,1.279816584662349e-4,-3.5470155045429583e-7,-1.1994671485721905e-8,1.280138942373341e-4,-3.2155917529888203e-7,-1.1996712018024326e-8,1.2811314916667707e-4,-3.832848611376374e-7,-1.1992721904466058e-8,1.2830082617175774e-4,-4.869902782138533e-7,-1.198611016092719e-8,1.2857305116365837e-4,-5.810461096132203e-7,-1.1980164163535222E-08,1.289084172136336e-4,-6.257202090277428e-7,-1.197740043466469e-8,1.2927653296285668e-4,-5.972525154990381e-7,-1.1979329944634138e-8,1.2964491995966202e-4,-4.877474608997493e-7,-1.1986472365228349e-8,1.2998387075651414e-4,-3.031311612369654e-7,-1.1998477370081351e-8,1.3026979244258862e-4,-6.038288953220458e-8,-1.2014282732417834e-8,1.3048752957989842e-4,2.1562191863560383e-7,-1.2032296857404085e-8,1.3063183983413705e-4,4.956069602951913e-7,-1.2050612633462722e-8,1.3070798712429174e-4,7.49696777087375e-7,-1.2067254493324593e-8,1.3073127127371782e-4,9.513984761652111e-7,-1.2080450782354818e-8,1.3072533232997706e-4,1.0813761032640532e-6,-1.2088898078971734e-8,1.3071932425519906e-4,1.1305045965556356e-6,-1.2091976791290884e-8,1.3074424349902703e-4,1.1018477731859764e-6,-1.2089887050399828e-8,1.3082870101893535e-4,1.0113362985932872e-6,-1.2083690937629776e-8,1.3099441618179766e-4,8.869501908669666e-7,-1.2075251931326807e-8,1.3125168068481923e-4,7.662116754938402e-7,-1.2067066918911372e-8,1.3159510738595574e-4,6.915586905267705e-7,-1.2061965515433264e-8,1.3200056820097142e-4,7.028841658829567e-7,-1.2062624571151364e-8,1.3242528918228636e-4,8.270198550287169e-7,-1.2070869118686841e-8,1.3281385380364976e-4,1.0657937989025924e-6,-1.2086852795495238e-8,1.3311208615874337e-4,1.3873940278361398e-6,-1.2108442324416934e-8,1.3328674475046086e-4,1.728378788589479e-6,-1.2131335420364398e-8,1.333423026531807e-4,2.011359960326922e-6,-1.2150284217646462e-8,1.333230859574093e-4,2.173641367897251e-6,-1.2161076558038903e-8,1.3329628509418603e-4,2.1916886718834704e-6,-1.2162183678561086e-8,1.3332488742110422e-4,2.0869799011873835e-6,-1.2155091872515184e-8,1.3344631607287334e-4,1.9118834458728775e-6,-1.214330168860428e-8,1.3366614959370036e-4,1.7270017762180142e-6,-1.213081977253317e-8,1.339647660819936e-4,1.5827822630531564e-6,-1.2120978054806648e-8,1.3430900171919165e-4,1.5107505188582636e-6,-1.2115885232530696e-8,1.346625507586368e-4,1.5227555156633589e-6,-1.2116379839448163e-8,1.3499278908367805e-4,1.6143357752029857e-6,-1.2122232655650623e-8,1.352743630890875e-4,1.7691319425712106e-6,-1.2132411706736463e-8,1.3549082147805045e-4,1.9628976716705375e-6,-1.214532559179744e-8,1.3563536205606977e-4,2.1669414090184472e-6,-1.2159041601093816e-8,1.3571114539193986e-4,2.3513531864422336e-6,-1.2171504657912729e-8,1.3573115122892719e-4,2.488365757099318e-6,-1.218077928907646e-8,1.3571726302195615e-4,2.555989521491244e-6,-1.2185316078541546e-8,1.3569814446294577e-4,2.5416602671032738e-6,-1.2184217684665625e-8,1.3570568585111713e-4,2.4452206623935392e-6,-1.2177449976565543e-8,1.3577024230789847e-4,2.280427964073108e-6,-1.216594442676682e-8,1.3591527737192273e-4,2.0743135607314645e-6,-1.2151550454018783e-8,1.361522991152803e-4,1.8640121265254014e-6,-1.213681987513195e-8,1.3647708727637718e-4,1.6911483786144465e-6,-1.2124630980449703e-8,1.3686810998498884e-4,1.5943000966245994e-6,-1.211767957644585e-8,1.3728794824521178e-4,1.6002951590033876e-6,-1.2117875538135754e-8,1.376885995265603e-4,1.715563961241601e-6,-1.2125719871977474e-8,1.380212492054774e-4,1.9198116421548985e-6,-1.2139827416802713e-8,1.3824979653251647e-4,2.16545754172393e-6,-1.2156862702966804e-8,1.3836476748777283e-4,2.3863798766054845e-6,-1.2172165361997345e-8,1.3839118089512586e-4,2.516681597723158e-6,-1.2181109204786456e-8,1.383836958661086e-4,2.5139173425388923e-6,-1.2180756018019766e-8,1.3840809682379775e-4,2.3754960365028225e-6,-1.2170971847677191e-8,1.3851731397930713e-4,2.1385549249810985e-6,-1.2154358737266609e-8,1.387345180742526e-4,1.8635150257748393e-6,-1.2135089041809021e-8,0.00013905061657867654,1.6115027181214983e-6,-1.21173713319074e-8,1.3943376606727773e-4,1.4271981388203693e-6,-1.2104305360794658e-8,1.3984300364040437e-4,1.3321511005655048e-6,-1.2097427842395805e-8,1.4023941764179271e-4,1.3266107575433846e-6,-1.2096814698533307e-8,1.4059252722173118e-4,1.3952876797859035e-6,-1.2101447432625885e-8,1.4088264636512158e-4,1.5134604515907064e-6,-1.2109616882522158e-8,1.4110100645417162e-4,1.651840139911393e-6,-1.211925900245617e-8,1.4124909369002032e-4,1.780117071596497e-6,-1.212821380203447e-8,1.41337902381737e-4,1.8698047521882043e-6,-1.2134441476175163e-8,1.413871243968482e-4,1.897057213198281e-6,-1.2136236886680415e-8,1.4142383018431504e-4,1.845841427761066e-6,-1.2132461012287831e-8,1.4147997719204125e-4,1.7113175489430788e-6,-1.2122777537746821e-8,1.4158823504138685e-4,1.502646517645388e-6,-1.2107840476713205e-8,1.4177619737628733e-4,1.2439767012537168e-6,-1.2089354094720186e-8,1.420599003828967e-4,9.723315462248096e-7,-1.206992596215161e-8,1.4243837480090518e-4,7.317359454874271e-7,-1.205266945550483e-8,1.428912639706557e-4,5.641719353741576e-7,-1.2040586686537376e-8,1.4338097885540922e-4,4.993306811954009e-7,-1.2035847099509482e-8,1.4385960277296563e-4,5.458783176763343e-7,-1.2039139663143369e-8,1.4427940471458366e-4,6.868122641353136e-7,-1.2049291370737595e-8,1.4460478846783334e-4,8.807411239238364e-7,-1.2063317321420302e-8,1.4482281559751307e-4,1.069839105541091e-6,-1.2076991054963683e-8,0.00014494904837242869,1.1937309248725323e-6,-1.2085887289049307e-8,1.4502568900064648e-4,1.2064426101944527e-6,-1.208665562177113e-8,1.4511070047506638e-4,1.0911379333922037e-6,-1.2078100163221958e-8,1.4526028585175462e-4,8.663198283372468e-7,-1.2061600256805915e-8,1.4551122674497707e-4,5.797058648325919e-7,-1.204063541031233e-8,1.45870714182893e-4,2.919007977922922e-7,-1.2019605889673682e-8,1.4631756661427476e-4,5.7383281304037876e-8,-1.2002481688680475e-8,1.4681257082234934e-4,-8.908235910099019e-8,-1.199182771411262e-8,1.4731178048653533e-4,-1.3681974382092278e-7,-1.1988462719314775e-8,1.4777718123388823e-4,-9.589928020150776e-8,-1.1991666707489123e-8,1.4818241807458256e-4,9.827970495226143e-9,-1.1999669866292774e-8,1.4851424057603252e-4,1.4975826284681487e-7,-1.2010174857616424e-8,1.4877150780700368e-4,2.9190903564939884e-7,-1.2020776035974408e-8,1.4896338718739874e-4,4.064988238931833e-7,-1.2029249027716422e-8,1.491076446423247e-4,4.6841038637613003e-7,-1.2033745868534184e-8,1.4922916257107874e-4,4.5938546572257956e-7,-1.2032953779941988e-8,1.493582247095228e-4,3.705242197180493e-7,-1.2026262139108474e-8,1.4952777954767635e-4,2.051005400277564e-7,-1.2013946805018194e-8,1.4976894050346446e-4,-1.904479417246828e-8,-1.19973299130609e-8,1.5010454947427974e-4,-2.6906541765304796e-7,-1.1978814248321542e-8,1.5054183504320976e-4,-5.005400438808663e-7,-1.1961656886072548e-8,1.510667193509588e-4,-6.659267765992611e-7,-1.1949384554955782e-8,1.5164312623254563e-4,-7.269820831206918e-7,-1.1944897119523432e-8,1.5221953156980696e-4,-6.673181911368249e-7,-1.1949511382214759e-8,1.5274192731700445e-4,-4.998737686083151e-7,-1.1962335916114308e-8,1.5316902981055573e-4,-2.655106490847173e-7,-1.198030645635063e-8,1.5348421088217352e-4,-2.266891378647792e-8,-1.1998944827432675e-8,1.537000877768807e-4,1.6834438575237464e-7,-1.2013585861232607e-8,1.538547110431581e-4,2.613132906223005e-7,-1.2020649305678164e-8,1.5400096519828458e-4,2.3581112219275996e-7,-1.2018566303697278e-8,1.5419235863208593e-4,1.0173672189554832e-7,-1.2008120314198619e-8,1.5446908544374386e-4,-1.043344103221339e-7,-1.1992147545698048e-8,1.548482390991489e-4,-3.2985719788034745e-7,-1.1974709621771796e-8,1.5532098094650596e-4,-5.207662508907146e-7,-1.1959996690102956e-8,1.5585716932915963e-4,-6.350241871756243e-7,-1.1951293605787887e-8,1.5641522266013897e-4,-6.511187991959759e-7,-1.1950307300835039e-8,1.569532769257661e-4,-5.697016549164902e-7,-1.1957005001839564e-8,1.5743798528095797e-4,-4.09469379855435e-7,-1.1969906863521253e-8,1.5784917981561064e-4,-2.0015710169451744e-7,-1.1986632887038163e-8,1.5818066995231428e-4,2.4528128874972442e-8,-1.2004482272335572e-8,1.584385964221662e-4,2.3238212408654543e-7,-1.2020894960770384e-8,1.5863886107822444e-4,3.9624199560292434e-7,-1.2033748244121223e-8,1.588046247824748e-4,4.961257588820515e-7,-1.2041519855910776e-8,1.5896414577085214e-4,5.208075434900433e-7,-1.2043387212766305e-8,1.5914861628490783e-4,4.6946391491526275e-7,-1.2039325589190074e-8,1.5938926955830503e-4,3.53541008361074e-7,-1.2030232908600866e-8,1.5971294009466412e-4,1.982741610365036e-7,-1.2018050074089633e-8,1.601357000258253e-4,4.2346553631336995e-8,-1.2005764507559371e-8,1.6065547610377416e-4,-6.653262914643824e-8,-1.199711354071502e-8,1.6124655500583345e-4,-8.178371801242496e-8,-1.1995829366236498e-8,1.618604147678731e-4,2.7237558855628032e-8,-1.200446695222325e-8,1.624361983654284e-4,2.6113543526894443e-7,-1.2023214939678597e-8,1.6291924082183584e-4,5.850389636777833e-7,-1.2049358081100115e-8,1.6328002909722807e-4,9.37029053897171e-7,-1.2077889657121621e-8,1.6352419934365228e-4,1.2479123374621913e-6,-1.2103126439366304e-8,1.6368904604779273e-4,1.4631281062483648e-6,-1.2120552485357369e-8,1.6382956183236765e-4,1.557395384432055e-6,-1.2128060940280816e-8,1.6400122926582002e-4,1.5381144862877748e-6,-1.2126239058948575e-8,1.6424588726093894e-4,1.439208355081074e-6,-1.2117853915445577e-8,1.6458370748174056e-4,1.3096328102448778e-6,-1.2106913755361764e-8,1.6501154402339606e-4,1.200644338827852e-6,-1.2097641160415495e-8,1.6550648589063686e-4,1.1547586852730628e-6,-1.2093577694547275e-8,1.6603290776267415e-4,1.198176070928625e-6,-1.209694831318382e-8,1.665511035023388e-4,1.3375614745420673e-6,-1.2108362039271342e-8,1.6702550418416318e-4,1.5612138983333382e-6,-1.2126873437650308e-8,1.674307780932752e-4,1.8436692523999273e-6,-1.2150349328123835e-8,1.677549195800197e-4,2.152050182706575e-6,-1.2176009110305286e-8,1.6799940801179606e-4,2.4524165413076667e-6,-1.2200981766056503e-8,1.6817724583540448e-4,2.7148658232038214e-6,-1.2222754118217347e-8,1.683099873280913e-4,2.9168866968960664e-6,-1.2239454785978735e-8,1.6842467146592558e-4,3.0452180407235236e-6,-1.224999322944638e-8,1.6855102695086848e-4,3.0968539557096263e-6,-1.2254119042353992e-8,1.6871880126855085e-4,3.079744230574199e-6,-1.2252464324778996e-8,1.6895472067160068e-4,3.0133940896606534e-6,-1.2246598903420829e-8,1.6927840464195295e-4,2.9289893043908684e-6,-1.2239070910506032e-8,1.6969685867088022e-4,2.8677904600524987e-6,-1.2233319274918822e-8,1.7019831718506845e-4,2.875824828445984e-6,-1.2233272151029017e-8,1.7074810284391787e-4,2.993272269193482e-6,-1.224246480019927e-8,1.7129098425295404e-4,3.2394101336393448e-6,-1.2262719249205929e-8,1.7176398102373194e-4,3.5987654038797006e-6,-1.2292867630372567e-8,1.7211809981800891e-4,4.018086806079489e-6,-1.2328398800877828e-8,1.723391427347796e-4,4.420818917734477e-6,-1.2362681188303285e-8,1.7245473153053103e-4,4.734662467285292e-6,-1.2389396409868513e-8,1.7252252726735316e-4,4.917578549027333e-6,-1.2404843785782865e-8,1.726071540897258e-4,4.968749604148368e-6,-1.2408893192054333e-8,1.727589046978858e-4,4.9221724964740185e-6,-1.2404411962237101e-8,1.7300260344177033e-4,4.83048076677902e-6,-1.2395876284086118e-8,1.7333699122422784e-4,4.748210739532242e-6,-1.2387966354953343e-8,1.7374060169450008e-4,4.719717242328655e-6,-1.2384556320964524e-8,1.7417998643729247e-4,4.77276442662093e-6,-1.2388155529251713e-8,1.7461775716833916e-4,4.916710446013261e-6,-1.2399710045232228e-8,1.7501937203030822e-4,5.1438468128633355e-6,-1.24186647572412e-8,1.7535828951289732e-4,5.432860035887848e-6,-1.2443225854658522e-8,1.756192629618798e-4,5.753664444472852e-6,-1.247077258016822e-8,1.7579965373443565e-4,6.07283129609336e-6,-1.249834752183416e-8,1.7590884946030766e-4,6.358829228718526e-6,-1.2523139875377372e-8,1.759661130968674e-4,6.586381943570775e-6,-1.2542883039875933e-8,1.759974500115724e-4,6.739459298134962e-6,-1.2556116611078232e-8,1.760321637278397e-4,6.812845618154416e-6,-1.2562313354106072e-8,1.7609950601134763e-4,6.812603660833107e-6,-1.2561914546371991e-8,1.7622548831381987e-4,6.755770295736606e-6,-1.2556315384687489e-8,1.7642970412317874e-4,6.669448359319251e-6,-1.2547819558221092e-8,1.7672181959903853e-4,6.589129298634931e-6,-1.2539538164845853e-8,1.7709754531837021e-4,6.555409184978373e-6,-1.253513882005936e-8,1.7753484841258758e-4,6.6077367992058346e-6,-1.2538298544744623e-8,1.7799261074736457e-4,6.774298835042637e-6,-1.2551762208519981e-8,1.7841520147040621e-4,7.059131678797954e-6,-1.2576102085454612e-8,1.7874610453487877e-4,7.431432411420299e-6,-1.2608660039097732e-8,1.7894917443968755e-4,7.825953175386766e-6,-1.264353962001558e-8,1.7902774380033063e-4,8.161207083206408e-6,-1.2673296174765145e-8,1.790278108183074e-4,8.37057801926549e-6,-1.2691829535203863e-8,1.7902000252517539e-4,8.429111940731165e-6,-1.2696822098010562e-8,1.7907052731275117e-4,8.359865779353108e-6,-1.2690259514578959e-8,1.792184376056174e-4,8.218710920752939e-6,-1.2677033409507345e-8,1.7946899122588982e-4,8.070217272528202e-6,-1.2662824877992331e-8,1.798005516314884e-4,7.968098174834111e-6,-1.2652431102927129e-8,1.8017678902342154e-4,7.945639373964074e-6,-1.2648941656457344e-8,1.8055783018827178e-4,8.014489469180937e-6,-1.2653594995131369e-8,1.809079743025977e-4,8.167991049630246e-6,-1.2666002492302427e-8,1.8120015594670137e-4,8.386055770599257e-6,-1.2684515636010646e-8,1.81418169137406e-4,8.640136272423779e-6,-1.2706635648062213e-8,1.8155745362714864e-4,8.897929471115659e-6,-1.2729437938407207e-8,1.816247890930127e-4,9.127778918254038e-6,-1.2749994232411722e-8,1.8163698371062952e-4,9.302709168045539e-6,-1.2765766433492419e-8,1.8161856182727902e-4,9.403888438419948e-6,-1.2774938041748913e-8,1.815985642893323e-4,9.423138551089404e-6,-1.2776645313126941e-8,1.8160681506560852e-4,9.36415692920561e-6,-1.2771087603012172e-8,1.8167007529985502e-4,9.242389932513445e-6,-1.2759527269267482e-8,1.8180839374719023e-4,9.083630182385395e-6,-1.2744194260900506e-8,1.8203189191582484e-4,8.921407254932055e-6,-1.272809684680252e-8,1.8233811686921964e-4,8.793234923543979e-6,-1.271472568547752e-8,1.8271007573164471e-4,8.735513832696627e-6,-1.2707603433132443e-8,1.831156226205783e-4,8.776587215035303e-6,-1.2709611967731912e-8,1.835098044135818e-4,8.927979072561361e-6,-1.2722097762312471e-8,1.8384221630675696e-4,9.175500192615347e-6,-1.27439367278731e-8,1.840705475552472e-4,9.474371020128938e-6,-1.2771002906062082e-8,1.841780628060236e-4,9.754616948466088e-6,-1.279667951127827e-8,1.8418683651227492e-4,9.940934290960093e-6,-1.281380356682737e-8,1.8415563603335129e-4,9.98187460304554e-6,-1.281747050358581e-8,1.8415861263877017e-4,9.872544364405676e-6,-1.2807136409084753e-8,1.842552921475183e-4,9.65575714304891e-6,-1.278665574601449e-8,1.8446960989311107e-4,9.401323160175794e-6,-1.2762350921109002e-8,1.847878917819339e-4,9.177921705907351e-6,-1.274048999348862e-8,1.851716145817177e-4,9.033077144764868e-6,-1.2725517880425859e-8,1.8557404333119885e-4,8.98674862545095e-6,-1.2719465951244568e-8,1.8595285565285299e-4,9.03489153155634e-6,-1.2722206457539776e-8,1.8627673471227903e-4,9.156961441484826e-6,-1.2732052732514901e-8,1.8652737698281774e-4,9.323291635298407e-6,-1.2746379558568107e-8,1.8669908398996258e-4,9.500851281252383e-6,-1.276214259667023e-8,1.867974540649122e-4,9.657494220093313e-6,-1.2776296198795173e-8,1.868377674238962e-4,9.765290802188679e-6,-1.2786140679959678e-8,1.8684306967336814e-4,9.803397871508996e-6,-1.2789619363565743e-8,1.868417147083351e-4,9.760610094037025e-6,-1.2785567727151342e-8,1.8686412458466885e-4,9.637324414561794e-6,-1.2773894189412115e-8,1.8693880886411663e-4,9.44635537749392e-6,-1.2755655110877828e-8,1.8708806034181723e-4,9.212124471751703e-6,-1.2732996276901077e-8,1.873239407935784e-4,8.968006164774606e-6,-1.2708946706398693e-8,1.8764524855502274e-4,8.751851247504868e-6,-1.2687053344743047e-8,1.8803613506589658e-4,8.600047003777075e-6,-1.267086308882513e-8,1.884668350213392e-4,8.540750156571121e-6,-1.266327943929974e-8,1.8889688401037388e-4,8.586957156317759e-6,-1.2665841049346619e-8,1.892813662336039e-4,8.7303677532984365E-06,-1.2678028004774141e-8,1.8958055151708885e-4,8.937957777496288e-6,-1.269682650981506e-8,1.8977205698003573e-4,9.154221964303619e-6,-1.2716894887330907e-8,1.8986226816951858e-4,9.312023948278568e-6,-1.2731645634466873e-8,1.8989097282145473e-4,9.3523306591095e-6,-1.2735235873700964e-8,1.899229344963519e-4,9.246977657328054e-6,-1.2724818924541804e-8,1.9002600500419477e-4,9.012639158824845e-6,-1.2701873808086355e-8,1.90245267253111e-4,8.705899735453676e-6,-1.267169944090641e-8,1.9058743747324758e-4,8.400731767561984e-6,-1.2641284800066107e-8,1.9102317062649488e-4,8.161375525659737e-6,-1.261678823134974e-8,1.915028135995743e-4,8.024638131175617e-6,-1.2601877107848063e-8]}
\ No newline at end of file
diff --git a/examples/cesium/Assets/Images/bing_maps_credit.png b/examples/cesium/Assets/Images/bing_maps_credit.png
new file mode 100644
index 0000000..15109db
Binary files /dev/null and b/examples/cesium/Assets/Images/bing_maps_credit.png differ
diff --git a/examples/cesium/Assets/Images/cesium_credit.png b/examples/cesium/Assets/Images/cesium_credit.png
new file mode 100644
index 0000000..4d1722b
Binary files /dev/null and b/examples/cesium/Assets/Images/cesium_credit.png differ
diff --git a/examples/cesium/Assets/Images/google_earth_credit.png b/examples/cesium/Assets/Images/google_earth_credit.png
new file mode 100644
index 0000000..a7622d8
Binary files /dev/null and b/examples/cesium/Assets/Images/google_earth_credit.png differ
diff --git a/examples/cesium/Assets/Images/ion-credit.png b/examples/cesium/Assets/Images/ion-credit.png
new file mode 100644
index 0000000..71b7bdf
Binary files /dev/null and b/examples/cesium/Assets/Images/ion-credit.png differ
diff --git a/examples/cesium/Assets/Textures/LensFlare/DirtMask.jpg b/examples/cesium/Assets/Textures/LensFlare/DirtMask.jpg
new file mode 100644
index 0000000..5329902
Binary files /dev/null and b/examples/cesium/Assets/Textures/LensFlare/DirtMask.jpg differ
diff --git a/examples/cesium/Assets/Textures/LensFlare/StarBurst.jpg b/examples/cesium/Assets/Textures/LensFlare/StarBurst.jpg
new file mode 100644
index 0000000..b54ac09
Binary files /dev/null and b/examples/cesium/Assets/Textures/LensFlare/StarBurst.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg
new file mode 100644
index 0000000..0cad646
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg
new file mode 100644
index 0000000..7e63bd6
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg
new file mode 100644
index 0000000..e65f1c7
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg
new file mode 100644
index 0000000..605f63f
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg
new file mode 100644
index 0000000..319458e
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg
new file mode 100644
index 0000000..a6a3859
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg
new file mode 100644
index 0000000..6913a2b
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg
new file mode 100644
index 0000000..df89ed2
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg
new file mode 100644
index 0000000..8f27415
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg
new file mode 100644
index 0000000..ce2b06e
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg
new file mode 100644
index 0000000..e3c0312
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg
new file mode 100644
index 0000000..f3ec321
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg
new file mode 100644
index 0000000..b59816c
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg
new file mode 100644
index 0000000..795f212
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg
new file mode 100644
index 0000000..822b065
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg
new file mode 100644
index 0000000..4dd18ea
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg
new file mode 100644
index 0000000..4540c7c
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg
new file mode 100644
index 0000000..32c6e5a
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg
new file mode 100644
index 0000000..7c39094
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg
new file mode 100644
index 0000000..3e7abe7
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg
new file mode 100644
index 0000000..0e0f1e9
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg
new file mode 100644
index 0000000..732c32f
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg
new file mode 100644
index 0000000..576ec70
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg
new file mode 100644
index 0000000..6347041
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg
new file mode 100644
index 0000000..300aa58
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg
new file mode 100644
index 0000000..cd70fca
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg
new file mode 100644
index 0000000..eabb83c
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg
new file mode 100644
index 0000000..54e6b00
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg
new file mode 100644
index 0000000..311241c
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg
new file mode 100644
index 0000000..5ba398c
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg
new file mode 100644
index 0000000..e03c0c0
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg
new file mode 100644
index 0000000..01a1caf
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg
new file mode 100644
index 0000000..372e3ef
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg
new file mode 100644
index 0000000..fbcfa62
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg
new file mode 100644
index 0000000..334ab25
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg
new file mode 100644
index 0000000..ebbc3a0
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg
new file mode 100644
index 0000000..c3a8e97
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg
new file mode 100644
index 0000000..8f730f3
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg
new file mode 100644
index 0000000..75235d6
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg
new file mode 100644
index 0000000..036d682
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg
new file mode 100644
index 0000000..dfd2144
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg b/examples/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg
new file mode 100644
index 0000000..82c2a34
Binary files /dev/null and b/examples/cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg differ
diff --git a/examples/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml b/examples/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml
new file mode 100644
index 0000000..d7734cc
--- /dev/null
+++ b/examples/cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml
@@ -0,0 +1,14 @@
+
+ x
, y
, and z
properties.
+ * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.
+ * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
+ *
+ * @example
+ * // Compute an axis aligned bounding box enclosing two points.
+ * const box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
+ */
+ AxisAlignedBoundingBox.fromPoints = function (positions, result) {
+ if (!defaultValue.defined(result)) {
+ result = new AxisAlignedBoundingBox();
+ }
+
+ if (!defaultValue.defined(positions) || positions.length === 0) {
+ result.minimum = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.minimum);
+ result.maximum = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.maximum);
+ result.center = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.center);
+ return result;
+ }
+
+ let minimumX = positions[0].x;
+ let minimumY = positions[0].y;
+ let minimumZ = positions[0].z;
+
+ let maximumX = positions[0].x;
+ let maximumY = positions[0].y;
+ let maximumZ = positions[0].z;
+
+ const length = positions.length;
+ for (let i = 1; i < length; i++) {
+ const p = positions[i];
+ const x = p.x;
+ const y = p.y;
+ const z = p.z;
+
+ minimumX = Math.min(x, minimumX);
+ maximumX = Math.max(x, maximumX);
+ minimumY = Math.min(y, minimumY);
+ maximumY = Math.max(y, maximumY);
+ minimumZ = Math.min(z, minimumZ);
+ maximumZ = Math.max(z, maximumZ);
+ }
+
+ const minimum = result.minimum;
+ minimum.x = minimumX;
+ minimum.y = minimumY;
+ minimum.z = minimumZ;
+
+ const maximum = result.maximum;
+ maximum.x = maximumX;
+ maximum.y = maximumY;
+ maximum.z = maximumZ;
+
+ result.center = Matrix3.Cartesian3.midpoint(minimum, maximum, result.center);
+
+ return result;
+ };
+
+ /**
+ * Duplicates a AxisAlignedBoundingBox instance.
+ *
+ * @param {AxisAlignedBoundingBox} box The bounding box to duplicate.
+ * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.
+ * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
+ */
+ AxisAlignedBoundingBox.clone = function (box, result) {
+ if (!defaultValue.defined(box)) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new AxisAlignedBoundingBox(box.minimum, box.maximum, box.center);
+ }
+
+ result.minimum = Matrix3.Cartesian3.clone(box.minimum, result.minimum);
+ result.maximum = Matrix3.Cartesian3.clone(box.maximum, result.maximum);
+ result.center = Matrix3.Cartesian3.clone(box.center, result.center);
+ return result;
+ };
+
+ /**
+ * Compares the provided AxisAlignedBoundingBox componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {AxisAlignedBoundingBox} [left] The first AxisAlignedBoundingBox.
+ * @param {AxisAlignedBoundingBox} [right] The second AxisAlignedBoundingBox.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ AxisAlignedBoundingBox.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Matrix3.Cartesian3.equals(left.center, right.center) &&
+ Matrix3.Cartesian3.equals(left.minimum, right.minimum) &&
+ Matrix3.Cartesian3.equals(left.maximum, right.maximum))
+ );
+ };
+
+ let intersectScratch = new Matrix3.Cartesian3();
+ /**
+ * Determines which side of a plane a box is located.
+ *
+ * @param {AxisAlignedBoundingBox} box The bounding box to test.
+ * @param {Plane} plane The plane to test against.
+ * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
+ * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
+ * on the opposite side, and {@link Intersect.INTERSECTING} if the box
+ * intersects the plane.
+ */
+ AxisAlignedBoundingBox.intersectPlane = function (box, plane) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("box", box);
+ Check.Check.defined("plane", plane);
+ //>>includeEnd('debug');
+
+ intersectScratch = Matrix3.Cartesian3.subtract(
+ box.maximum,
+ box.minimum,
+ intersectScratch
+ );
+ const h = Matrix3.Cartesian3.multiplyByScalar(
+ intersectScratch,
+ 0.5,
+ intersectScratch
+ ); //The positive half diagonal
+ const normal = plane.normal;
+ const e =
+ h.x * Math.abs(normal.x) +
+ h.y * Math.abs(normal.y) +
+ h.z * Math.abs(normal.z);
+ const s = Matrix3.Cartesian3.dot(box.center, normal) + plane.distance; //signed distance from center
+
+ if (s - e > 0) {
+ return Transforms.Intersect.INSIDE;
+ }
+
+ if (s + e < 0) {
+ //Not in front because normals point inward
+ return Transforms.Intersect.OUTSIDE;
+ }
+
+ return Transforms.Intersect.INTERSECTING;
+ };
+
+ /**
+ * Duplicates this AxisAlignedBoundingBox instance.
+ *
+ * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.
+ * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.
+ */
+ AxisAlignedBoundingBox.prototype.clone = function (result) {
+ return AxisAlignedBoundingBox.clone(this, result);
+ };
+
+ /**
+ * Determines which side of a plane this box is located.
+ *
+ * @param {Plane} plane The plane to test against.
+ * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
+ * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
+ * on the opposite side, and {@link Intersect.INTERSECTING} if the box
+ * intersects the plane.
+ */
+ AxisAlignedBoundingBox.prototype.intersectPlane = function (plane) {
+ return AxisAlignedBoundingBox.intersectPlane(this, plane);
+ };
+
+ /**
+ * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {AxisAlignedBoundingBox} [right] The right hand side AxisAlignedBoundingBox.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ AxisAlignedBoundingBox.prototype.equals = function (right) {
+ return AxisAlignedBoundingBox.equals(this, right);
+ };
+
+ exports.AxisAlignedBoundingBox = AxisAlignedBoundingBox;
+
+}));
+//# sourceMappingURL=AxisAlignedBoundingBox-50342d27.js.map
diff --git a/examples/cesium/Workers/AxisAlignedBoundingBox-50342d27.js.map b/examples/cesium/Workers/AxisAlignedBoundingBox-50342d27.js.map
new file mode 100644
index 0000000..3ebbdbf
--- /dev/null
+++ b/examples/cesium/Workers/AxisAlignedBoundingBox-50342d27.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"AxisAlignedBoundingBox-50342d27.js","sources":["../../../Source/Core/AxisAlignedBoundingBox.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Intersect from \"./Intersect.js\";\r\n\r\n/**\r\n * Creates an instance of an AxisAlignedBoundingBox from the minimum and maximum points along the x, y, and z axes.\r\n * @alias AxisAlignedBoundingBox\r\n * @constructor\r\n *\r\n * @param {Cartesian3} [minimum=Cartesian3.ZERO] The minimum point along the x, y, and z axes.\r\n * @param {Cartesian3} [maximum=Cartesian3.ZERO] The maximum point along the x, y, and z axes.\r\n * @param {Cartesian3} [center] The center of the box; automatically computed if not supplied.\r\n *\r\n * @see BoundingSphere\r\n * @see BoundingRectangle\r\n */\r\nfunction AxisAlignedBoundingBox(minimum, maximum, center) {\r\n /**\r\n * The minimum point defining the bounding box.\r\n * @type {Cartesian3}\r\n * @default {@link Cartesian3.ZERO}\r\n */\r\n this.minimum = Cartesian3.clone(defaultValue(minimum, Cartesian3.ZERO));\r\n\r\n /**\r\n * The maximum point defining the bounding box.\r\n * @type {Cartesian3}\r\n * @default {@link Cartesian3.ZERO}\r\n */\r\n this.maximum = Cartesian3.clone(defaultValue(maximum, Cartesian3.ZERO));\r\n\r\n // If center was not defined, compute it.\r\n if (!defined(center)) {\r\n center = Cartesian3.midpoint(this.minimum, this.maximum, new Cartesian3());\r\n } else {\r\n center = Cartesian3.clone(center);\r\n }\r\n\r\n /**\r\n * The center point of the bounding box.\r\n * @type {Cartesian3}\r\n */\r\n this.center = center;\r\n}\r\n\r\n/**\r\n * Creates an instance of an AxisAlignedBoundingBox from its corners.\r\n *\r\n * @param {Cartesian3} minimum The minimum point along the x, y, and z axes.\r\n * @param {Cartesian3} maximum The maximum point along the x, y, and z axes.\r\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\r\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.\r\n *\r\n * @example\r\n * // Compute an axis aligned bounding box from the two corners.\r\n * const box = Cesium.AxisAlignedBoundingBox.fromCorners(new Cesium.Cartesian3(-1, -1, -1), new Cesium.Cartesian3(1, 1, 1));\r\n */\r\nAxisAlignedBoundingBox.fromCorners = function (minimum, maximum, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"minimum\", minimum);\r\n Check.defined(\"maximum\", maximum);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new AxisAlignedBoundingBox();\r\n }\r\n\r\n result.minimum = Cartesian3.clone(minimum, result.minimum);\r\n result.maximum = Cartesian3.clone(maximum, result.maximum);\r\n result.center = Cartesian3.midpoint(minimum, maximum, result.center);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes an instance of an AxisAlignedBoundingBox. The box is determined by\r\n * finding the points spaced the farthest apart on the x, y, and z axes.\r\n *\r\n * @param {Cartesian3[]} positions List of points that the bounding box will enclose. Each point must have a x
, y
, and z
properties.\r\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\r\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.\r\n *\r\n * @example\r\n * // Compute an axis aligned bounding box enclosing two points.\r\n * const box = Cesium.AxisAlignedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);\r\n */\r\nAxisAlignedBoundingBox.fromPoints = function (positions, result) {\r\n if (!defined(result)) {\r\n result = new AxisAlignedBoundingBox();\r\n }\r\n\r\n if (!defined(positions) || positions.length === 0) {\r\n result.minimum = Cartesian3.clone(Cartesian3.ZERO, result.minimum);\r\n result.maximum = Cartesian3.clone(Cartesian3.ZERO, result.maximum);\r\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\r\n return result;\r\n }\r\n\r\n let minimumX = positions[0].x;\r\n let minimumY = positions[0].y;\r\n let minimumZ = positions[0].z;\r\n\r\n let maximumX = positions[0].x;\r\n let maximumY = positions[0].y;\r\n let maximumZ = positions[0].z;\r\n\r\n const length = positions.length;\r\n for (let i = 1; i < length; i++) {\r\n const p = positions[i];\r\n const x = p.x;\r\n const y = p.y;\r\n const z = p.z;\r\n\r\n minimumX = Math.min(x, minimumX);\r\n maximumX = Math.max(x, maximumX);\r\n minimumY = Math.min(y, minimumY);\r\n maximumY = Math.max(y, maximumY);\r\n minimumZ = Math.min(z, minimumZ);\r\n maximumZ = Math.max(z, maximumZ);\r\n }\r\n\r\n const minimum = result.minimum;\r\n minimum.x = minimumX;\r\n minimum.y = minimumY;\r\n minimum.z = minimumZ;\r\n\r\n const maximum = result.maximum;\r\n maximum.x = maximumX;\r\n maximum.y = maximumY;\r\n maximum.z = maximumZ;\r\n\r\n result.center = Cartesian3.midpoint(minimum, maximum, result.center);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a AxisAlignedBoundingBox instance.\r\n *\r\n * @param {AxisAlignedBoundingBox} box The bounding box to duplicate.\r\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\r\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if none was provided. (Returns undefined if box is undefined)\r\n */\r\nAxisAlignedBoundingBox.clone = function (box, result) {\r\n if (!defined(box)) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new AxisAlignedBoundingBox(box.minimum, box.maximum, box.center);\r\n }\r\n\r\n result.minimum = Cartesian3.clone(box.minimum, result.minimum);\r\n result.maximum = Cartesian3.clone(box.maximum, result.maximum);\r\n result.center = Cartesian3.clone(box.center, result.center);\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided AxisAlignedBoundingBox componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {AxisAlignedBoundingBox} [left] The first AxisAlignedBoundingBox.\r\n * @param {AxisAlignedBoundingBox} [right] The second AxisAlignedBoundingBox.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nAxisAlignedBoundingBox.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n Cartesian3.equals(left.center, right.center) &&\r\n Cartesian3.equals(left.minimum, right.minimum) &&\r\n Cartesian3.equals(left.maximum, right.maximum))\r\n );\r\n};\r\n\r\nlet intersectScratch = new Cartesian3();\r\n/**\r\n * Determines which side of a plane a box is located.\r\n *\r\n * @param {AxisAlignedBoundingBox} box The bounding box to test.\r\n * @param {Plane} plane The plane to test against.\r\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\r\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\r\n * on the opposite side, and {@link Intersect.INTERSECTING} if the box\r\n * intersects the plane.\r\n */\r\nAxisAlignedBoundingBox.intersectPlane = function (box, plane) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"box\", box);\r\n Check.defined(\"plane\", plane);\r\n //>>includeEnd('debug');\r\n\r\n intersectScratch = Cartesian3.subtract(\r\n box.maximum,\r\n box.minimum,\r\n intersectScratch\r\n );\r\n const h = Cartesian3.multiplyByScalar(\r\n intersectScratch,\r\n 0.5,\r\n intersectScratch\r\n ); //The positive half diagonal\r\n const normal = plane.normal;\r\n const e =\r\n h.x * Math.abs(normal.x) +\r\n h.y * Math.abs(normal.y) +\r\n h.z * Math.abs(normal.z);\r\n const s = Cartesian3.dot(box.center, normal) + plane.distance; //signed distance from center\r\n\r\n if (s - e > 0) {\r\n return Intersect.INSIDE;\r\n }\r\n\r\n if (s + e < 0) {\r\n //Not in front because normals point inward\r\n return Intersect.OUTSIDE;\r\n }\r\n\r\n return Intersect.INTERSECTING;\r\n};\r\n\r\n/**\r\n * Duplicates this AxisAlignedBoundingBox instance.\r\n *\r\n * @param {AxisAlignedBoundingBox} [result] The object onto which to store the result.\r\n * @returns {AxisAlignedBoundingBox} The modified result parameter or a new AxisAlignedBoundingBox instance if one was not provided.\r\n */\r\nAxisAlignedBoundingBox.prototype.clone = function (result) {\r\n return AxisAlignedBoundingBox.clone(this, result);\r\n};\r\n\r\n/**\r\n * Determines which side of a plane this box is located.\r\n *\r\n * @param {Plane} plane The plane to test against.\r\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\r\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\r\n * on the opposite side, and {@link Intersect.INTERSECTING} if the box\r\n * intersects the plane.\r\n */\r\nAxisAlignedBoundingBox.prototype.intersectPlane = function (plane) {\r\n return AxisAlignedBoundingBox.intersectPlane(this, plane);\r\n};\r\n\r\n/**\r\n * Compares this AxisAlignedBoundingBox against the provided AxisAlignedBoundingBox componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {AxisAlignedBoundingBox} [right] The right hand side AxisAlignedBoundingBox.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nAxisAlignedBoundingBox.prototype.equals = function (right) {\r\n return AxisAlignedBoundingBox.equals(this, right);\r\n};\r\nexport default AxisAlignedBoundingBox;\r\n"],"names":["Cartesian3","defaultValue","defined","Check","Intersect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE;EAC1D;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,OAAO,GAAGA,kBAAU,CAAC,KAAK,CAACC,yBAAY,CAAC,OAAO,EAAED,kBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1E;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,OAAO,GAAGA,kBAAU,CAAC,KAAK,CAACC,yBAAY,CAAC,OAAO,EAAED,kBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1E;EACA;EACA,EAAE,IAAI,CAACE,oBAAO,CAAC,MAAM,CAAC,EAAE;EACxB,IAAI,MAAM,GAAGF,kBAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAIA,kBAAU,EAAE,CAAC,CAAC;EAC/E,GAAG,MAAM;EACT,IAAI,MAAM,GAAGA,kBAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;EACtC,GAAG;AACH;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;EACvB,CAAC;AACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA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AAO,sBAAsB,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;EACpD,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,sBAAsB,CAAC,SAAS,CAAC,cAAc,GAAG,UAAU,KAAK,EAAE;EACnE,EAAE,OAAO,sBAAsB,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;EAC5D,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,sBAAsB,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,KAAK,EAAE;EAC3D,EAAE,OAAO,sBAAsB,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;EACpD,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/BoundingRectangle-6617ed83.js b/examples/cesium/Workers/BoundingRectangle-6617ed83.js
new file mode 100644
index 0000000..1dfdcc7
--- /dev/null
+++ b/examples/cesium/Workers/BoundingRectangle-6617ed83.js
@@ -0,0 +1,395 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Transforms-11fb6b0a'], (function (exports, Matrix2, Matrix3, Check, defaultValue, Transforms) { 'use strict';
+
+ /**
+ * A bounding rectangle given by a corner, width and height.
+ * @alias BoundingRectangle
+ * @constructor
+ *
+ * @param {Number} [x=0.0] The x coordinate of the rectangle.
+ * @param {Number} [y=0.0] The y coordinate of the rectangle.
+ * @param {Number} [width=0.0] The width of the rectangle.
+ * @param {Number} [height=0.0] The height of the rectangle.
+ *
+ * @see BoundingSphere
+ * @see Packable
+ */
+ function BoundingRectangle(x, y, width, height) {
+ /**
+ * The x coordinate of the rectangle.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.x = defaultValue.defaultValue(x, 0.0);
+
+ /**
+ * The y coordinate of the rectangle.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.y = defaultValue.defaultValue(y, 0.0);
+
+ /**
+ * The width of the rectangle.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.width = defaultValue.defaultValue(width, 0.0);
+
+ /**
+ * The height of the rectangle.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.height = defaultValue.defaultValue(height, 0.0);
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ BoundingRectangle.packedLength = 4;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {BoundingRectangle} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ BoundingRectangle.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value.x;
+ array[startingIndex++] = value.y;
+ array[startingIndex++] = value.width;
+ array[startingIndex] = value.height;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {BoundingRectangle} [result] The object into which to store the result.
+ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
+ */
+ BoundingRectangle.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingRectangle();
+ }
+ result.x = array[startingIndex++];
+ result.y = array[startingIndex++];
+ result.width = array[startingIndex++];
+ result.height = array[startingIndex];
+ return result;
+ };
+
+ /**
+ * Computes a bounding rectangle enclosing the list of 2D points.
+ * The rectangle is oriented with the corner at the bottom left.
+ *
+ * @param {Cartesian2[]} positions List of points that the bounding rectangle will enclose. Each point must have x
and y
properties.
+ * @param {BoundingRectangle} [result] The object onto which to store the result.
+ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
+ */
+ BoundingRectangle.fromPoints = function (positions, result) {
+ if (!defaultValue.defined(result)) {
+ result = new BoundingRectangle();
+ }
+
+ if (!defaultValue.defined(positions) || positions.length === 0) {
+ result.x = 0;
+ result.y = 0;
+ result.width = 0;
+ result.height = 0;
+ return result;
+ }
+
+ const length = positions.length;
+
+ let minimumX = positions[0].x;
+ let minimumY = positions[0].y;
+
+ let maximumX = positions[0].x;
+ let maximumY = positions[0].y;
+
+ for (let i = 1; i < length; i++) {
+ const p = positions[i];
+ const x = p.x;
+ const y = p.y;
+
+ minimumX = Math.min(x, minimumX);
+ maximumX = Math.max(x, maximumX);
+ minimumY = Math.min(y, minimumY);
+ maximumY = Math.max(y, maximumY);
+ }
+
+ result.x = minimumX;
+ result.y = minimumY;
+ result.width = maximumX - minimumX;
+ result.height = maximumY - minimumY;
+ return result;
+ };
+
+ const defaultProjection = new Transforms.GeographicProjection();
+ const fromRectangleLowerLeft = new Matrix3.Cartographic();
+ const fromRectangleUpperRight = new Matrix3.Cartographic();
+ /**
+ * Computes a bounding rectangle from a rectangle.
+ *
+ * @param {Rectangle} rectangle The valid rectangle used to create a bounding rectangle.
+ * @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.
+ * @param {BoundingRectangle} [result] The object onto which to store the result.
+ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
+ */
+ BoundingRectangle.fromRectangle = function (rectangle, projection, result) {
+ if (!defaultValue.defined(result)) {
+ result = new BoundingRectangle();
+ }
+
+ if (!defaultValue.defined(rectangle)) {
+ result.x = 0;
+ result.y = 0;
+ result.width = 0;
+ result.height = 0;
+ return result;
+ }
+
+ projection = defaultValue.defaultValue(projection, defaultProjection);
+
+ const lowerLeft = projection.project(
+ Matrix2.Rectangle.southwest(rectangle, fromRectangleLowerLeft)
+ );
+ const upperRight = projection.project(
+ Matrix2.Rectangle.northeast(rectangle, fromRectangleUpperRight)
+ );
+
+ Matrix2.Cartesian2.subtract(upperRight, lowerLeft, upperRight);
+
+ result.x = lowerLeft.x;
+ result.y = lowerLeft.y;
+ result.width = upperRight.x;
+ result.height = upperRight.y;
+ return result;
+ };
+
+ /**
+ * Duplicates a BoundingRectangle instance.
+ *
+ * @param {BoundingRectangle} rectangle The bounding rectangle to duplicate.
+ * @param {BoundingRectangle} [result] The object onto which to store the result.
+ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)
+ */
+ BoundingRectangle.clone = function (rectangle, result) {
+ if (!defaultValue.defined(rectangle)) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new BoundingRectangle(
+ rectangle.x,
+ rectangle.y,
+ rectangle.width,
+ rectangle.height
+ );
+ }
+
+ result.x = rectangle.x;
+ result.y = rectangle.y;
+ result.width = rectangle.width;
+ result.height = rectangle.height;
+ return result;
+ };
+
+ /**
+ * Computes a bounding rectangle that is the union of the left and right bounding rectangles.
+ *
+ * @param {BoundingRectangle} left A rectangle to enclose in bounding rectangle.
+ * @param {BoundingRectangle} right A rectangle to enclose in a bounding rectangle.
+ * @param {BoundingRectangle} [result] The object onto which to store the result.
+ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
+ */
+ BoundingRectangle.union = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingRectangle();
+ }
+
+ const lowerLeftX = Math.min(left.x, right.x);
+ const lowerLeftY = Math.min(left.y, right.y);
+ const upperRightX = Math.max(left.x + left.width, right.x + right.width);
+ const upperRightY = Math.max(left.y + left.height, right.y + right.height);
+
+ result.x = lowerLeftX;
+ result.y = lowerLeftY;
+ result.width = upperRightX - lowerLeftX;
+ result.height = upperRightY - lowerLeftY;
+ return result;
+ };
+
+ /**
+ * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.
+ *
+ * @param {BoundingRectangle} rectangle A rectangle to expand.
+ * @param {Cartesian2} point A point to enclose in a bounding rectangle.
+ * @param {BoundingRectangle} [result] The object onto which to store the result.
+ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
+ */
+ BoundingRectangle.expand = function (rectangle, point, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ Check.Check.typeOf.object("point", point);
+ //>>includeEnd('debug');
+
+ result = BoundingRectangle.clone(rectangle, result);
+
+ const width = point.x - result.x;
+ const height = point.y - result.y;
+
+ if (width > result.width) {
+ result.width = width;
+ } else if (width < 0) {
+ result.width -= width;
+ result.x = point.x;
+ }
+
+ if (height > result.height) {
+ result.height = height;
+ } else if (height < 0) {
+ result.height -= height;
+ result.y = point.y;
+ }
+
+ return result;
+ };
+
+ /**
+ * Determines if two rectangles intersect.
+ *
+ * @param {BoundingRectangle} left A rectangle to check for intersection.
+ * @param {BoundingRectangle} right The other rectangle to check for intersection.
+ * @returns {Intersect} Intersect.INTERSECTING
if the rectangles intersect, Intersect.OUTSIDE
otherwise.
+ */
+ BoundingRectangle.intersect = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ const leftX = left.x;
+ const leftY = left.y;
+ const rightX = right.x;
+ const rightY = right.y;
+ if (
+ !(
+ leftX > rightX + right.width ||
+ leftX + left.width < rightX ||
+ leftY + left.height < rightY ||
+ leftY > rightY + right.height
+ )
+ ) {
+ return Transforms.Intersect.INTERSECTING;
+ }
+
+ return Transforms.Intersect.OUTSIDE;
+ };
+
+ /**
+ * Compares the provided BoundingRectangles componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {BoundingRectangle} [left] The first BoundingRectangle.
+ * @param {BoundingRectangle} [right] The second BoundingRectangle.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ BoundingRectangle.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left.x === right.x &&
+ left.y === right.y &&
+ left.width === right.width &&
+ left.height === right.height)
+ );
+ };
+
+ /**
+ * Duplicates this BoundingRectangle instance.
+ *
+ * @param {BoundingRectangle} [result] The object onto which to store the result.
+ * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.
+ */
+ BoundingRectangle.prototype.clone = function (result) {
+ return BoundingRectangle.clone(this, result);
+ };
+
+ /**
+ * Determines if this rectangle intersects with another.
+ *
+ * @param {BoundingRectangle} right A rectangle to check for intersection.
+ * @returns {Intersect} Intersect.INTERSECTING
if the rectangles intersect, Intersect.OUTSIDE
otherwise.
+ */
+ BoundingRectangle.prototype.intersect = function (right) {
+ return BoundingRectangle.intersect(this, right);
+ };
+
+ /**
+ * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {BoundingRectangle} [right] The right hand side BoundingRectangle.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ BoundingRectangle.prototype.equals = function (right) {
+ return BoundingRectangle.equals(this, right);
+ };
+
+ exports.BoundingRectangle = BoundingRectangle;
+
+}));
+//# sourceMappingURL=BoundingRectangle-6617ed83.js.map
diff --git a/examples/cesium/Workers/BoundingRectangle-6617ed83.js.map b/examples/cesium/Workers/BoundingRectangle-6617ed83.js.map
new file mode 100644
index 0000000..14b5f51
--- /dev/null
+++ b/examples/cesium/Workers/BoundingRectangle-6617ed83.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"BoundingRectangle-6617ed83.js","sources":["../../../Source/Core/BoundingRectangle.js"],"sourcesContent":["import Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport GeographicProjection from \"./GeographicProjection.js\";\r\nimport Intersect from \"./Intersect.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\n\r\n/**\r\n * A bounding rectangle given by a corner, width and height.\r\n * @alias BoundingRectangle\r\n * @constructor\r\n *\r\n * @param {Number} [x=0.0] The x coordinate of the rectangle.\r\n * @param {Number} [y=0.0] The y coordinate of the rectangle.\r\n * @param {Number} [width=0.0] The width of the rectangle.\r\n * @param {Number} [height=0.0] The height of the rectangle.\r\n *\r\n * @see BoundingSphere\r\n * @see Packable\r\n */\r\nfunction BoundingRectangle(x, y, width, height) {\r\n /**\r\n * The x coordinate of the rectangle.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.x = defaultValue(x, 0.0);\r\n\r\n /**\r\n * The y coordinate of the rectangle.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.y = defaultValue(y, 0.0);\r\n\r\n /**\r\n * The width of the rectangle.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.width = defaultValue(width, 0.0);\r\n\r\n /**\r\n * The height of the rectangle.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.height = defaultValue(height, 0.0);\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nBoundingRectangle.packedLength = 4;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {BoundingRectangle} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nBoundingRectangle.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value.x;\r\n array[startingIndex++] = value.y;\r\n array[startingIndex++] = value.width;\r\n array[startingIndex] = value.height;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {BoundingRectangle} [result] The object into which to store the result.\r\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\r\n */\r\nBoundingRectangle.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new BoundingRectangle();\r\n }\r\n result.x = array[startingIndex++];\r\n result.y = array[startingIndex++];\r\n result.width = array[startingIndex++];\r\n result.height = array[startingIndex];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a bounding rectangle enclosing the list of 2D points.\r\n * The rectangle is oriented with the corner at the bottom left.\r\n *\r\n * @param {Cartesian2[]} positions List of points that the bounding rectangle will enclose. Each point must have x
and y
properties.\r\n * @param {BoundingRectangle} [result] The object onto which to store the result.\r\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\r\n */\r\nBoundingRectangle.fromPoints = function (positions, result) {\r\n if (!defined(result)) {\r\n result = new BoundingRectangle();\r\n }\r\n\r\n if (!defined(positions) || positions.length === 0) {\r\n result.x = 0;\r\n result.y = 0;\r\n result.width = 0;\r\n result.height = 0;\r\n return result;\r\n }\r\n\r\n const length = positions.length;\r\n\r\n let minimumX = positions[0].x;\r\n let minimumY = positions[0].y;\r\n\r\n let maximumX = positions[0].x;\r\n let maximumY = positions[0].y;\r\n\r\n for (let i = 1; i < length; i++) {\r\n const p = positions[i];\r\n const x = p.x;\r\n const y = p.y;\r\n\r\n minimumX = Math.min(x, minimumX);\r\n maximumX = Math.max(x, maximumX);\r\n minimumY = Math.min(y, minimumY);\r\n maximumY = Math.max(y, maximumY);\r\n }\r\n\r\n result.x = minimumX;\r\n result.y = minimumY;\r\n result.width = maximumX - minimumX;\r\n result.height = maximumY - minimumY;\r\n return result;\r\n};\r\n\r\nconst defaultProjection = new GeographicProjection();\r\nconst fromRectangleLowerLeft = new Cartographic();\r\nconst fromRectangleUpperRight = new Cartographic();\r\n/**\r\n * Computes a bounding rectangle from a rectangle.\r\n *\r\n * @param {Rectangle} rectangle The valid rectangle used to create a bounding rectangle.\r\n * @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.\r\n * @param {BoundingRectangle} [result] The object onto which to store the result.\r\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\r\n */\r\nBoundingRectangle.fromRectangle = function (rectangle, projection, result) {\r\n if (!defined(result)) {\r\n result = new BoundingRectangle();\r\n }\r\n\r\n if (!defined(rectangle)) {\r\n result.x = 0;\r\n result.y = 0;\r\n result.width = 0;\r\n result.height = 0;\r\n return result;\r\n }\r\n\r\n projection = defaultValue(projection, defaultProjection);\r\n\r\n const lowerLeft = projection.project(\r\n Rectangle.southwest(rectangle, fromRectangleLowerLeft)\r\n );\r\n const upperRight = projection.project(\r\n Rectangle.northeast(rectangle, fromRectangleUpperRight)\r\n );\r\n\r\n Cartesian2.subtract(upperRight, lowerLeft, upperRight);\r\n\r\n result.x = lowerLeft.x;\r\n result.y = lowerLeft.y;\r\n result.width = upperRight.x;\r\n result.height = upperRight.y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a BoundingRectangle instance.\r\n *\r\n * @param {BoundingRectangle} rectangle The bounding rectangle to duplicate.\r\n * @param {BoundingRectangle} [result] The object onto which to store the result.\r\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided. (Returns undefined if rectangle is undefined)\r\n */\r\nBoundingRectangle.clone = function (rectangle, result) {\r\n if (!defined(rectangle)) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new BoundingRectangle(\r\n rectangle.x,\r\n rectangle.y,\r\n rectangle.width,\r\n rectangle.height\r\n );\r\n }\r\n\r\n result.x = rectangle.x;\r\n result.y = rectangle.y;\r\n result.width = rectangle.width;\r\n result.height = rectangle.height;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a bounding rectangle that is the union of the left and right bounding rectangles.\r\n *\r\n * @param {BoundingRectangle} left A rectangle to enclose in bounding rectangle.\r\n * @param {BoundingRectangle} right A rectangle to enclose in a bounding rectangle.\r\n * @param {BoundingRectangle} [result] The object onto which to store the result.\r\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\r\n */\r\nBoundingRectangle.union = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new BoundingRectangle();\r\n }\r\n\r\n const lowerLeftX = Math.min(left.x, right.x);\r\n const lowerLeftY = Math.min(left.y, right.y);\r\n const upperRightX = Math.max(left.x + left.width, right.x + right.width);\r\n const upperRightY = Math.max(left.y + left.height, right.y + right.height);\r\n\r\n result.x = lowerLeftX;\r\n result.y = lowerLeftY;\r\n result.width = upperRightX - lowerLeftX;\r\n result.height = upperRightY - lowerLeftY;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a bounding rectangle by enlarging the provided rectangle until it contains the provided point.\r\n *\r\n * @param {BoundingRectangle} rectangle A rectangle to expand.\r\n * @param {Cartesian2} point A point to enclose in a bounding rectangle.\r\n * @param {BoundingRectangle} [result] The object onto which to store the result.\r\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\r\n */\r\nBoundingRectangle.expand = function (rectangle, point, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n Check.typeOf.object(\"point\", point);\r\n //>>includeEnd('debug');\r\n\r\n result = BoundingRectangle.clone(rectangle, result);\r\n\r\n const width = point.x - result.x;\r\n const height = point.y - result.y;\r\n\r\n if (width > result.width) {\r\n result.width = width;\r\n } else if (width < 0) {\r\n result.width -= width;\r\n result.x = point.x;\r\n }\r\n\r\n if (height > result.height) {\r\n result.height = height;\r\n } else if (height < 0) {\r\n result.height -= height;\r\n result.y = point.y;\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Determines if two rectangles intersect.\r\n *\r\n * @param {BoundingRectangle} left A rectangle to check for intersection.\r\n * @param {BoundingRectangle} right The other rectangle to check for intersection.\r\n * @returns {Intersect} Intersect.INTERSECTING
if the rectangles intersect, Intersect.OUTSIDE
otherwise.\r\n */\r\nBoundingRectangle.intersect = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n const leftX = left.x;\r\n const leftY = left.y;\r\n const rightX = right.x;\r\n const rightY = right.y;\r\n if (\r\n !(\r\n leftX > rightX + right.width ||\r\n leftX + left.width < rightX ||\r\n leftY + left.height < rightY ||\r\n leftY > rightY + right.height\r\n )\r\n ) {\r\n return Intersect.INTERSECTING;\r\n }\r\n\r\n return Intersect.OUTSIDE;\r\n};\r\n\r\n/**\r\n * Compares the provided BoundingRectangles componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {BoundingRectangle} [left] The first BoundingRectangle.\r\n * @param {BoundingRectangle} [right] The second BoundingRectangle.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nBoundingRectangle.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left.x === right.x &&\r\n left.y === right.y &&\r\n left.width === right.width &&\r\n left.height === right.height)\r\n );\r\n};\r\n\r\n/**\r\n * Duplicates this BoundingRectangle instance.\r\n *\r\n * @param {BoundingRectangle} [result] The object onto which to store the result.\r\n * @returns {BoundingRectangle} The modified result parameter or a new BoundingRectangle instance if one was not provided.\r\n */\r\nBoundingRectangle.prototype.clone = function (result) {\r\n return BoundingRectangle.clone(this, result);\r\n};\r\n\r\n/**\r\n * Determines if this rectangle intersects with another.\r\n *\r\n * @param {BoundingRectangle} right A rectangle to check for intersection.\r\n * @returns {Intersect} Intersect.INTERSECTING
if the rectangles intersect, Intersect.OUTSIDE
otherwise.\r\n */\r\nBoundingRectangle.prototype.intersect = function (right) {\r\n return BoundingRectangle.intersect(this, right);\r\n};\r\n\r\n/**\r\n * Compares this BoundingRectangle against the provided BoundingRectangle componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {BoundingRectangle} [right] The right hand side BoundingRectangle.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nBoundingRectangle.prototype.equals = function (right) {\r\n return BoundingRectangle.equals(this, right);\r\n};\r\nexport default BoundingRectangle;\r\n"],"names":["defaultValue","Check","defined","GeographicProjection","Cartographic","Rectangle","Cartesian2","Intersect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EASA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,iBAAiB,CAAC,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AAiB,CAAC,SAAS,CAAC,SAAS,GAAG,UAAU,KAAK,EAAE;EACzD,EAAE,OAAO,iBAAiB,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;EAClD,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,KAAK,EAAE;EACtD,EAAE,OAAO,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;EAC/C,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/BoxGeometry-2c7f2d2d.js b/examples/cesium/Workers/BoxGeometry-2c7f2d2d.js
new file mode 100644
index 0000000..ae13e28
--- /dev/null
+++ b/examples/cesium/Workers/BoxGeometry-2c7f2d2d.js
@@ -0,0 +1,910 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './VertexFormat-f2d74c96'], (function (exports, Transforms, Matrix3, Check, ComponentDatatype, defaultValue, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, VertexFormat) { 'use strict';
+
+ const diffScratch = new Matrix3.Cartesian3();
+
+ /**
+ * Describes a cube centered at the origin.
+ *
+ * @alias BoxGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.
+ * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ *
+ * @see BoxGeometry.fromDimensions
+ * @see BoxGeometry.createGeometry
+ * @see Packable
+ *
+ * @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo}
+ *
+ * @example
+ * const box = new Cesium.BoxGeometry({
+ * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
+ * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
+ * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
+ * });
+ * const geometry = Cesium.BoxGeometry.createGeometry(box);
+ */
+ function BoxGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const min = options.minimum;
+ const max = options.maximum;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("min", min);
+ Check.Check.typeOf.object("max", max);
+ if (
+ defaultValue.defined(options.offsetAttribute) &&
+ options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP
+ ) {
+ throw new Check.DeveloperError(
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
+
+ this._minimum = Matrix3.Cartesian3.clone(min);
+ this._maximum = Matrix3.Cartesian3.clone(max);
+ this._vertexFormat = vertexFormat;
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createBoxGeometry";
+ }
+
+ /**
+ * Creates a cube centered at the origin given its dimensions.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3
, respectively.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @returns {BoxGeometry}
+ *
+ * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.
+ *
+ *
+ * @example
+ * const box = Cesium.BoxGeometry.fromDimensions({
+ * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
+ * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
+ * });
+ * const geometry = Cesium.BoxGeometry.createGeometry(box);
+ *
+ * @see BoxGeometry.createGeometry
+ */
+ BoxGeometry.fromDimensions = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const dimensions = options.dimensions;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("dimensions", dimensions);
+ Check.Check.typeOf.number.greaterThanOrEquals("dimensions.x", dimensions.x, 0);
+ Check.Check.typeOf.number.greaterThanOrEquals("dimensions.y", dimensions.y, 0);
+ Check.Check.typeOf.number.greaterThanOrEquals("dimensions.z", dimensions.z, 0);
+ //>>includeEnd('debug');
+
+ const corner = Matrix3.Cartesian3.multiplyByScalar(dimensions, 0.5, new Matrix3.Cartesian3());
+
+ return new BoxGeometry({
+ minimum: Matrix3.Cartesian3.negate(corner, new Matrix3.Cartesian3()),
+ maximum: corner,
+ vertexFormat: options.vertexFormat,
+ offsetAttribute: options.offsetAttribute,
+ });
+ };
+
+ /**
+ * Creates a cube from the dimensions of an AxisAlignedBoundingBox.
+ *
+ * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.
+ * @returns {BoxGeometry}
+ *
+ *
+ *
+ * @example
+ * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0,
+ * -75.0, 30.0,
+ * -70.0, 30.0,
+ * -68.0, 40.0
+ * ]));
+ * const box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);
+ *
+ * @see BoxGeometry.createGeometry
+ */
+ BoxGeometry.fromAxisAlignedBoundingBox = function (boundingBox) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("boundingBox", boundingBox);
+ //>>includeEnd('debug');
+
+ return new BoxGeometry({
+ minimum: boundingBox.minimum,
+ maximum: boundingBox.maximum,
+ });
+ };
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ BoxGeometry.packedLength =
+ 2 * Matrix3.Cartesian3.packedLength + VertexFormat.VertexFormat.packedLength + 1;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {BoxGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ BoxGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ Matrix3.Cartesian3.pack(value._minimum, array, startingIndex);
+ Matrix3.Cartesian3.pack(
+ value._maximum,
+ array,
+ startingIndex + Matrix3.Cartesian3.packedLength
+ );
+ VertexFormat.VertexFormat.pack(
+ value._vertexFormat,
+ array,
+ startingIndex + 2 * Matrix3.Cartesian3.packedLength
+ );
+ array[
+ startingIndex + 2 * Matrix3.Cartesian3.packedLength + VertexFormat.VertexFormat.packedLength
+ ] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchMin = new Matrix3.Cartesian3();
+ const scratchMax = new Matrix3.Cartesian3();
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+ const scratchOptions = {
+ minimum: scratchMin,
+ maximum: scratchMax,
+ vertexFormat: scratchVertexFormat,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {BoxGeometry} [result] The object into which to store the result.
+ * @returns {BoxGeometry} The modified result parameter or a new BoxGeometry instance if one was not provided.
+ */
+ BoxGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const min = Matrix3.Cartesian3.unpack(array, startingIndex, scratchMin);
+ const max = Matrix3.Cartesian3.unpack(
+ array,
+ startingIndex + Matrix3.Cartesian3.packedLength,
+ scratchMax
+ );
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex + 2 * Matrix3.Cartesian3.packedLength,
+ scratchVertexFormat
+ );
+ const offsetAttribute =
+ array[
+ startingIndex + 2 * Matrix3.Cartesian3.packedLength + VertexFormat.VertexFormat.packedLength
+ ];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+ return new BoxGeometry(scratchOptions);
+ }
+
+ result._minimum = Matrix3.Cartesian3.clone(min, result._minimum);
+ result._maximum = Matrix3.Cartesian3.clone(max, result._maximum);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {BoxGeometry} boxGeometry A description of the box.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ BoxGeometry.createGeometry = function (boxGeometry) {
+ const min = boxGeometry._minimum;
+ const max = boxGeometry._maximum;
+ const vertexFormat = boxGeometry._vertexFormat;
+
+ if (Matrix3.Cartesian3.equals(min, max)) {
+ return;
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ let indices;
+ let positions;
+
+ if (
+ vertexFormat.position &&
+ (vertexFormat.st ||
+ vertexFormat.normal ||
+ vertexFormat.tangent ||
+ vertexFormat.bitangent)
+ ) {
+ if (vertexFormat.position) {
+ // 8 corner points. Duplicated 3 times each for each incident edge/face.
+ positions = new Float64Array(6 * 4 * 3);
+
+ // +z face
+ positions[0] = min.x;
+ positions[1] = min.y;
+ positions[2] = max.z;
+ positions[3] = max.x;
+ positions[4] = min.y;
+ positions[5] = max.z;
+ positions[6] = max.x;
+ positions[7] = max.y;
+ positions[8] = max.z;
+ positions[9] = min.x;
+ positions[10] = max.y;
+ positions[11] = max.z;
+
+ // -z face
+ positions[12] = min.x;
+ positions[13] = min.y;
+ positions[14] = min.z;
+ positions[15] = max.x;
+ positions[16] = min.y;
+ positions[17] = min.z;
+ positions[18] = max.x;
+ positions[19] = max.y;
+ positions[20] = min.z;
+ positions[21] = min.x;
+ positions[22] = max.y;
+ positions[23] = min.z;
+
+ // +x face
+ positions[24] = max.x;
+ positions[25] = min.y;
+ positions[26] = min.z;
+ positions[27] = max.x;
+ positions[28] = max.y;
+ positions[29] = min.z;
+ positions[30] = max.x;
+ positions[31] = max.y;
+ positions[32] = max.z;
+ positions[33] = max.x;
+ positions[34] = min.y;
+ positions[35] = max.z;
+
+ // -x face
+ positions[36] = min.x;
+ positions[37] = min.y;
+ positions[38] = min.z;
+ positions[39] = min.x;
+ positions[40] = max.y;
+ positions[41] = min.z;
+ positions[42] = min.x;
+ positions[43] = max.y;
+ positions[44] = max.z;
+ positions[45] = min.x;
+ positions[46] = min.y;
+ positions[47] = max.z;
+
+ // +y face
+ positions[48] = min.x;
+ positions[49] = max.y;
+ positions[50] = min.z;
+ positions[51] = max.x;
+ positions[52] = max.y;
+ positions[53] = min.z;
+ positions[54] = max.x;
+ positions[55] = max.y;
+ positions[56] = max.z;
+ positions[57] = min.x;
+ positions[58] = max.y;
+ positions[59] = max.z;
+
+ // -y face
+ positions[60] = min.x;
+ positions[61] = min.y;
+ positions[62] = min.z;
+ positions[63] = max.x;
+ positions[64] = min.y;
+ positions[65] = min.z;
+ positions[66] = max.x;
+ positions[67] = min.y;
+ positions[68] = max.z;
+ positions[69] = min.x;
+ positions[70] = min.y;
+ positions[71] = max.z;
+
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+ }
+
+ if (vertexFormat.normal) {
+ const normals = new Float32Array(6 * 4 * 3);
+
+ // +z face
+ normals[0] = 0.0;
+ normals[1] = 0.0;
+ normals[2] = 1.0;
+ normals[3] = 0.0;
+ normals[4] = 0.0;
+ normals[5] = 1.0;
+ normals[6] = 0.0;
+ normals[7] = 0.0;
+ normals[8] = 1.0;
+ normals[9] = 0.0;
+ normals[10] = 0.0;
+ normals[11] = 1.0;
+
+ // -z face
+ normals[12] = 0.0;
+ normals[13] = 0.0;
+ normals[14] = -1.0;
+ normals[15] = 0.0;
+ normals[16] = 0.0;
+ normals[17] = -1.0;
+ normals[18] = 0.0;
+ normals[19] = 0.0;
+ normals[20] = -1.0;
+ normals[21] = 0.0;
+ normals[22] = 0.0;
+ normals[23] = -1.0;
+
+ // +x face
+ normals[24] = 1.0;
+ normals[25] = 0.0;
+ normals[26] = 0.0;
+ normals[27] = 1.0;
+ normals[28] = 0.0;
+ normals[29] = 0.0;
+ normals[30] = 1.0;
+ normals[31] = 0.0;
+ normals[32] = 0.0;
+ normals[33] = 1.0;
+ normals[34] = 0.0;
+ normals[35] = 0.0;
+
+ // -x face
+ normals[36] = -1.0;
+ normals[37] = 0.0;
+ normals[38] = 0.0;
+ normals[39] = -1.0;
+ normals[40] = 0.0;
+ normals[41] = 0.0;
+ normals[42] = -1.0;
+ normals[43] = 0.0;
+ normals[44] = 0.0;
+ normals[45] = -1.0;
+ normals[46] = 0.0;
+ normals[47] = 0.0;
+
+ // +y face
+ normals[48] = 0.0;
+ normals[49] = 1.0;
+ normals[50] = 0.0;
+ normals[51] = 0.0;
+ normals[52] = 1.0;
+ normals[53] = 0.0;
+ normals[54] = 0.0;
+ normals[55] = 1.0;
+ normals[56] = 0.0;
+ normals[57] = 0.0;
+ normals[58] = 1.0;
+ normals[59] = 0.0;
+
+ // -y face
+ normals[60] = 0.0;
+ normals[61] = -1.0;
+ normals[62] = 0.0;
+ normals[63] = 0.0;
+ normals[64] = -1.0;
+ normals[65] = 0.0;
+ normals[66] = 0.0;
+ normals[67] = -1.0;
+ normals[68] = 0.0;
+ normals[69] = 0.0;
+ normals[70] = -1.0;
+ normals[71] = 0.0;
+
+ attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals,
+ });
+ }
+
+ if (vertexFormat.st) {
+ const texCoords = new Float32Array(6 * 4 * 2);
+
+ // +z face
+ texCoords[0] = 0.0;
+ texCoords[1] = 0.0;
+ texCoords[2] = 1.0;
+ texCoords[3] = 0.0;
+ texCoords[4] = 1.0;
+ texCoords[5] = 1.0;
+ texCoords[6] = 0.0;
+ texCoords[7] = 1.0;
+
+ // -z face
+ texCoords[8] = 1.0;
+ texCoords[9] = 0.0;
+ texCoords[10] = 0.0;
+ texCoords[11] = 0.0;
+ texCoords[12] = 0.0;
+ texCoords[13] = 1.0;
+ texCoords[14] = 1.0;
+ texCoords[15] = 1.0;
+
+ //+x face
+ texCoords[16] = 0.0;
+ texCoords[17] = 0.0;
+ texCoords[18] = 1.0;
+ texCoords[19] = 0.0;
+ texCoords[20] = 1.0;
+ texCoords[21] = 1.0;
+ texCoords[22] = 0.0;
+ texCoords[23] = 1.0;
+
+ // -x face
+ texCoords[24] = 1.0;
+ texCoords[25] = 0.0;
+ texCoords[26] = 0.0;
+ texCoords[27] = 0.0;
+ texCoords[28] = 0.0;
+ texCoords[29] = 1.0;
+ texCoords[30] = 1.0;
+ texCoords[31] = 1.0;
+
+ // +y face
+ texCoords[32] = 1.0;
+ texCoords[33] = 0.0;
+ texCoords[34] = 0.0;
+ texCoords[35] = 0.0;
+ texCoords[36] = 0.0;
+ texCoords[37] = 1.0;
+ texCoords[38] = 1.0;
+ texCoords[39] = 1.0;
+
+ // -y face
+ texCoords[40] = 0.0;
+ texCoords[41] = 0.0;
+ texCoords[42] = 1.0;
+ texCoords[43] = 0.0;
+ texCoords[44] = 1.0;
+ texCoords[45] = 1.0;
+ texCoords[46] = 0.0;
+ texCoords[47] = 1.0;
+
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: texCoords,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ const tangents = new Float32Array(6 * 4 * 3);
+
+ // +z face
+ tangents[0] = 1.0;
+ tangents[1] = 0.0;
+ tangents[2] = 0.0;
+ tangents[3] = 1.0;
+ tangents[4] = 0.0;
+ tangents[5] = 0.0;
+ tangents[6] = 1.0;
+ tangents[7] = 0.0;
+ tangents[8] = 0.0;
+ tangents[9] = 1.0;
+ tangents[10] = 0.0;
+ tangents[11] = 0.0;
+
+ // -z face
+ tangents[12] = -1.0;
+ tangents[13] = 0.0;
+ tangents[14] = 0.0;
+ tangents[15] = -1.0;
+ tangents[16] = 0.0;
+ tangents[17] = 0.0;
+ tangents[18] = -1.0;
+ tangents[19] = 0.0;
+ tangents[20] = 0.0;
+ tangents[21] = -1.0;
+ tangents[22] = 0.0;
+ tangents[23] = 0.0;
+
+ // +x face
+ tangents[24] = 0.0;
+ tangents[25] = 1.0;
+ tangents[26] = 0.0;
+ tangents[27] = 0.0;
+ tangents[28] = 1.0;
+ tangents[29] = 0.0;
+ tangents[30] = 0.0;
+ tangents[31] = 1.0;
+ tangents[32] = 0.0;
+ tangents[33] = 0.0;
+ tangents[34] = 1.0;
+ tangents[35] = 0.0;
+
+ // -x face
+ tangents[36] = 0.0;
+ tangents[37] = -1.0;
+ tangents[38] = 0.0;
+ tangents[39] = 0.0;
+ tangents[40] = -1.0;
+ tangents[41] = 0.0;
+ tangents[42] = 0.0;
+ tangents[43] = -1.0;
+ tangents[44] = 0.0;
+ tangents[45] = 0.0;
+ tangents[46] = -1.0;
+ tangents[47] = 0.0;
+
+ // +y face
+ tangents[48] = -1.0;
+ tangents[49] = 0.0;
+ tangents[50] = 0.0;
+ tangents[51] = -1.0;
+ tangents[52] = 0.0;
+ tangents[53] = 0.0;
+ tangents[54] = -1.0;
+ tangents[55] = 0.0;
+ tangents[56] = 0.0;
+ tangents[57] = -1.0;
+ tangents[58] = 0.0;
+ tangents[59] = 0.0;
+
+ // -y face
+ tangents[60] = 1.0;
+ tangents[61] = 0.0;
+ tangents[62] = 0.0;
+ tangents[63] = 1.0;
+ tangents[64] = 0.0;
+ tangents[65] = 0.0;
+ tangents[66] = 1.0;
+ tangents[67] = 0.0;
+ tangents[68] = 0.0;
+ tangents[69] = 1.0;
+ tangents[70] = 0.0;
+ tangents[71] = 0.0;
+
+ attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents,
+ });
+ }
+
+ if (vertexFormat.bitangent) {
+ const bitangents = new Float32Array(6 * 4 * 3);
+
+ // +z face
+ bitangents[0] = 0.0;
+ bitangents[1] = 1.0;
+ bitangents[2] = 0.0;
+ bitangents[3] = 0.0;
+ bitangents[4] = 1.0;
+ bitangents[5] = 0.0;
+ bitangents[6] = 0.0;
+ bitangents[7] = 1.0;
+ bitangents[8] = 0.0;
+ bitangents[9] = 0.0;
+ bitangents[10] = 1.0;
+ bitangents[11] = 0.0;
+
+ // -z face
+ bitangents[12] = 0.0;
+ bitangents[13] = 1.0;
+ bitangents[14] = 0.0;
+ bitangents[15] = 0.0;
+ bitangents[16] = 1.0;
+ bitangents[17] = 0.0;
+ bitangents[18] = 0.0;
+ bitangents[19] = 1.0;
+ bitangents[20] = 0.0;
+ bitangents[21] = 0.0;
+ bitangents[22] = 1.0;
+ bitangents[23] = 0.0;
+
+ // +x face
+ bitangents[24] = 0.0;
+ bitangents[25] = 0.0;
+ bitangents[26] = 1.0;
+ bitangents[27] = 0.0;
+ bitangents[28] = 0.0;
+ bitangents[29] = 1.0;
+ bitangents[30] = 0.0;
+ bitangents[31] = 0.0;
+ bitangents[32] = 1.0;
+ bitangents[33] = 0.0;
+ bitangents[34] = 0.0;
+ bitangents[35] = 1.0;
+
+ // -x face
+ bitangents[36] = 0.0;
+ bitangents[37] = 0.0;
+ bitangents[38] = 1.0;
+ bitangents[39] = 0.0;
+ bitangents[40] = 0.0;
+ bitangents[41] = 1.0;
+ bitangents[42] = 0.0;
+ bitangents[43] = 0.0;
+ bitangents[44] = 1.0;
+ bitangents[45] = 0.0;
+ bitangents[46] = 0.0;
+ bitangents[47] = 1.0;
+
+ // +y face
+ bitangents[48] = 0.0;
+ bitangents[49] = 0.0;
+ bitangents[50] = 1.0;
+ bitangents[51] = 0.0;
+ bitangents[52] = 0.0;
+ bitangents[53] = 1.0;
+ bitangents[54] = 0.0;
+ bitangents[55] = 0.0;
+ bitangents[56] = 1.0;
+ bitangents[57] = 0.0;
+ bitangents[58] = 0.0;
+ bitangents[59] = 1.0;
+
+ // -y face
+ bitangents[60] = 0.0;
+ bitangents[61] = 0.0;
+ bitangents[62] = 1.0;
+ bitangents[63] = 0.0;
+ bitangents[64] = 0.0;
+ bitangents[65] = 1.0;
+ bitangents[66] = 0.0;
+ bitangents[67] = 0.0;
+ bitangents[68] = 1.0;
+ bitangents[69] = 0.0;
+ bitangents[70] = 0.0;
+ bitangents[71] = 1.0;
+
+ attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents,
+ });
+ }
+
+ // 12 triangles: 6 faces, 2 triangles each.
+ indices = new Uint16Array(6 * 2 * 3);
+
+ // +z face
+ indices[0] = 0;
+ indices[1] = 1;
+ indices[2] = 2;
+ indices[3] = 0;
+ indices[4] = 2;
+ indices[5] = 3;
+
+ // -z face
+ indices[6] = 4 + 2;
+ indices[7] = 4 + 1;
+ indices[8] = 4 + 0;
+ indices[9] = 4 + 3;
+ indices[10] = 4 + 2;
+ indices[11] = 4 + 0;
+
+ // +x face
+ indices[12] = 8 + 0;
+ indices[13] = 8 + 1;
+ indices[14] = 8 + 2;
+ indices[15] = 8 + 0;
+ indices[16] = 8 + 2;
+ indices[17] = 8 + 3;
+
+ // -x face
+ indices[18] = 12 + 2;
+ indices[19] = 12 + 1;
+ indices[20] = 12 + 0;
+ indices[21] = 12 + 3;
+ indices[22] = 12 + 2;
+ indices[23] = 12 + 0;
+
+ // +y face
+ indices[24] = 16 + 2;
+ indices[25] = 16 + 1;
+ indices[26] = 16 + 0;
+ indices[27] = 16 + 3;
+ indices[28] = 16 + 2;
+ indices[29] = 16 + 0;
+
+ // -y face
+ indices[30] = 20 + 0;
+ indices[31] = 20 + 1;
+ indices[32] = 20 + 2;
+ indices[33] = 20 + 0;
+ indices[34] = 20 + 2;
+ indices[35] = 20 + 3;
+ } else {
+ // Positions only - no need to duplicate corner points
+ positions = new Float64Array(8 * 3);
+
+ positions[0] = min.x;
+ positions[1] = min.y;
+ positions[2] = min.z;
+ positions[3] = max.x;
+ positions[4] = min.y;
+ positions[5] = min.z;
+ positions[6] = max.x;
+ positions[7] = max.y;
+ positions[8] = min.z;
+ positions[9] = min.x;
+ positions[10] = max.y;
+ positions[11] = min.z;
+ positions[12] = min.x;
+ positions[13] = min.y;
+ positions[14] = max.z;
+ positions[15] = max.x;
+ positions[16] = min.y;
+ positions[17] = max.z;
+ positions[18] = max.x;
+ positions[19] = max.y;
+ positions[20] = max.z;
+ positions[21] = min.x;
+ positions[22] = max.y;
+ positions[23] = max.z;
+
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+
+ // 12 triangles: 6 faces, 2 triangles each.
+ indices = new Uint16Array(6 * 2 * 3);
+
+ // plane z = corner.Z
+ indices[0] = 4;
+ indices[1] = 5;
+ indices[2] = 6;
+ indices[3] = 4;
+ indices[4] = 6;
+ indices[5] = 7;
+
+ // plane z = -corner.Z
+ indices[6] = 1;
+ indices[7] = 0;
+ indices[8] = 3;
+ indices[9] = 1;
+ indices[10] = 3;
+ indices[11] = 2;
+
+ // plane x = corner.X
+ indices[12] = 1;
+ indices[13] = 6;
+ indices[14] = 5;
+ indices[15] = 1;
+ indices[16] = 2;
+ indices[17] = 6;
+
+ // plane y = corner.Y
+ indices[18] = 2;
+ indices[19] = 3;
+ indices[20] = 7;
+ indices[21] = 2;
+ indices[22] = 7;
+ indices[23] = 6;
+
+ // plane x = -corner.X
+ indices[24] = 3;
+ indices[25] = 0;
+ indices[26] = 4;
+ indices[27] = 3;
+ indices[28] = 4;
+ indices[29] = 7;
+
+ // plane y = -corner.Y
+ indices[30] = 0;
+ indices[31] = 1;
+ indices[32] = 5;
+ indices[33] = 0;
+ indices[34] = 5;
+ indices[35] = 4;
+ }
+
+ const diff = Matrix3.Cartesian3.subtract(max, min, diffScratch);
+ const radius = Matrix3.Cartesian3.magnitude(diff) * 0.5;
+
+ if (defaultValue.defined(boxGeometry._offsetAttribute)) {
+ const length = positions.length;
+ const offsetValue =
+ boxGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ boundingSphere: new Transforms.BoundingSphere(Matrix3.Cartesian3.ZERO, radius),
+ offsetAttribute: boxGeometry._offsetAttribute,
+ });
+ };
+
+ let unitBoxGeometry;
+
+ /**
+ * Returns the geometric representation of a unit box, including its vertices, indices, and a bounding sphere.
+ * @returns {Geometry} The computed vertices and indices.
+ *
+ * @private
+ */
+ BoxGeometry.getUnitBox = function () {
+ if (!defaultValue.defined(unitBoxGeometry)) {
+ unitBoxGeometry = BoxGeometry.createGeometry(
+ BoxGeometry.fromDimensions({
+ dimensions: new Matrix3.Cartesian3(1.0, 1.0, 1.0),
+ vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
+ })
+ );
+ }
+ return unitBoxGeometry;
+ };
+
+ exports.BoxGeometry = BoxGeometry;
+
+}));
+//# sourceMappingURL=BoxGeometry-2c7f2d2d.js.map
diff --git a/examples/cesium/Workers/BoxGeometry-2c7f2d2d.js.map b/examples/cesium/Workers/BoxGeometry-2c7f2d2d.js.map
new file mode 100644
index 0000000..5f6a569
--- /dev/null
+++ b/examples/cesium/Workers/BoxGeometry-2c7f2d2d.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"BoxGeometry-2c7f2d2d.js","sources":["../../../Source/Core/BoxGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\nconst diffScratch = new Cartesian3();\r\n\r\n/**\r\n * Describes a cube centered at the origin.\r\n *\r\n * @alias BoxGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.\r\n * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n *\r\n * @see BoxGeometry.fromDimensions\r\n * @see BoxGeometry.createGeometry\r\n * @see Packable\r\n *\r\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Box.html|Cesium Sandcastle Box Demo}\r\n *\r\n * @example\r\n * const box = new Cesium.BoxGeometry({\r\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\r\n * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),\r\n * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)\r\n * });\r\n * const geometry = Cesium.BoxGeometry.createGeometry(box);\r\n */\r\nfunction BoxGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const min = options.minimum;\r\n const max = options.maximum;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"min\", min);\r\n Check.typeOf.object(\"max\", max);\r\n if (\r\n defined(options.offsetAttribute) &&\r\n options.offsetAttribute === GeometryOffsetAttribute.TOP\r\n ) {\r\n throw new DeveloperError(\r\n \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\r\n\r\n this._minimum = Cartesian3.clone(min);\r\n this._maximum = Cartesian3.clone(max);\r\n this._vertexFormat = vertexFormat;\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._workerName = \"createBoxGeometry\";\r\n}\r\n\r\n/**\r\n * Creates a cube centered at the origin given its dimensions.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3
, respectively.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @returns {BoxGeometry}\r\n *\r\n * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.\r\n *\r\n *\r\n * @example\r\n * const box = Cesium.BoxGeometry.fromDimensions({\r\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\r\n * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)\r\n * });\r\n * const geometry = Cesium.BoxGeometry.createGeometry(box);\r\n *\r\n * @see BoxGeometry.createGeometry\r\n */\r\nBoxGeometry.fromDimensions = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const dimensions = options.dimensions;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"dimensions\", dimensions);\r\n Check.typeOf.number.greaterThanOrEquals(\"dimensions.x\", dimensions.x, 0);\r\n Check.typeOf.number.greaterThanOrEquals(\"dimensions.y\", dimensions.y, 0);\r\n Check.typeOf.number.greaterThanOrEquals(\"dimensions.z\", dimensions.z, 0);\r\n //>>includeEnd('debug');\r\n\r\n const corner = Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3());\r\n\r\n return new BoxGeometry({\r\n minimum: Cartesian3.negate(corner, new Cartesian3()),\r\n maximum: corner,\r\n vertexFormat: options.vertexFormat,\r\n offsetAttribute: options.offsetAttribute,\r\n });\r\n};\r\n\r\n/**\r\n * Creates a cube from the dimensions of an AxisAlignedBoundingBox.\r\n *\r\n * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.\r\n * @returns {BoxGeometry}\r\n *\r\n *\r\n *\r\n * @example\r\n * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0,\r\n * -75.0, 30.0,\r\n * -70.0, 30.0,\r\n * -68.0, 40.0\r\n * ]));\r\n * const box = Cesium.BoxGeometry.fromAxisAlignedBoundingBox(aabb);\r\n *\r\n * @see BoxGeometry.createGeometry\r\n */\r\nBoxGeometry.fromAxisAlignedBoundingBox = function (boundingBox) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"boundingBox\", boundingBox);\r\n //>>includeEnd('debug');\r\n\r\n return new BoxGeometry({\r\n minimum: boundingBox.minimum,\r\n maximum: boundingBox.maximum,\r\n });\r\n};\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nBoxGeometry.packedLength =\r\n 2 * Cartesian3.packedLength + VertexFormat.packedLength + 1;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {BoxGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nBoxGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n Cartesian3.pack(value._minimum, array, startingIndex);\r\n Cartesian3.pack(\r\n value._maximum,\r\n array,\r\n startingIndex + Cartesian3.packedLength\r\n );\r\n VertexFormat.pack(\r\n value._vertexFormat,\r\n array,\r\n startingIndex + 2 * Cartesian3.packedLength\r\n );\r\n array[\r\n startingIndex + 2 * Cartesian3.packedLength + VertexFormat.packedLength\r\n ] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchMin = new Cartesian3();\r\nconst scratchMax = new Cartesian3();\r\nconst scratchVertexFormat = new VertexFormat();\r\nconst scratchOptions = {\r\n minimum: scratchMin,\r\n maximum: scratchMax,\r\n vertexFormat: scratchVertexFormat,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {BoxGeometry} [result] The object into which to store the result.\r\n * @returns {BoxGeometry} The modified result parameter or a new BoxGeometry instance if one was not provided.\r\n */\r\nBoxGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const min = Cartesian3.unpack(array, startingIndex, scratchMin);\r\n const max = Cartesian3.unpack(\r\n array,\r\n startingIndex + Cartesian3.packedLength,\r\n scratchMax\r\n );\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex + 2 * Cartesian3.packedLength,\r\n scratchVertexFormat\r\n );\r\n const offsetAttribute =\r\n array[\r\n startingIndex + 2 * Cartesian3.packedLength + VertexFormat.packedLength\r\n ];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n return new BoxGeometry(scratchOptions);\r\n }\r\n\r\n result._minimum = Cartesian3.clone(min, result._minimum);\r\n result._maximum = Cartesian3.clone(max, result._maximum);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a box, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {BoxGeometry} boxGeometry A description of the box.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nBoxGeometry.createGeometry = function (boxGeometry) {\r\n const min = boxGeometry._minimum;\r\n const max = boxGeometry._maximum;\r\n const vertexFormat = boxGeometry._vertexFormat;\r\n\r\n if (Cartesian3.equals(min, max)) {\r\n return;\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n let indices;\r\n let positions;\r\n\r\n if (\r\n vertexFormat.position &&\r\n (vertexFormat.st ||\r\n vertexFormat.normal ||\r\n vertexFormat.tangent ||\r\n vertexFormat.bitangent)\r\n ) {\r\n if (vertexFormat.position) {\r\n // 8 corner points. Duplicated 3 times each for each incident edge/face.\r\n positions = new Float64Array(6 * 4 * 3);\r\n\r\n // +z face\r\n positions[0] = min.x;\r\n positions[1] = min.y;\r\n positions[2] = max.z;\r\n positions[3] = max.x;\r\n positions[4] = min.y;\r\n positions[5] = max.z;\r\n positions[6] = max.x;\r\n positions[7] = max.y;\r\n positions[8] = max.z;\r\n positions[9] = min.x;\r\n positions[10] = max.y;\r\n positions[11] = max.z;\r\n\r\n // -z face\r\n positions[12] = min.x;\r\n positions[13] = min.y;\r\n positions[14] = min.z;\r\n positions[15] = max.x;\r\n positions[16] = min.y;\r\n positions[17] = min.z;\r\n positions[18] = max.x;\r\n positions[19] = max.y;\r\n positions[20] = min.z;\r\n positions[21] = min.x;\r\n positions[22] = max.y;\r\n positions[23] = min.z;\r\n\r\n // +x face\r\n positions[24] = max.x;\r\n positions[25] = min.y;\r\n positions[26] = min.z;\r\n positions[27] = max.x;\r\n positions[28] = max.y;\r\n positions[29] = min.z;\r\n positions[30] = max.x;\r\n positions[31] = max.y;\r\n positions[32] = max.z;\r\n positions[33] = max.x;\r\n positions[34] = min.y;\r\n positions[35] = max.z;\r\n\r\n // -x face\r\n positions[36] = min.x;\r\n positions[37] = min.y;\r\n positions[38] = min.z;\r\n positions[39] = min.x;\r\n positions[40] = max.y;\r\n positions[41] = min.z;\r\n positions[42] = min.x;\r\n positions[43] = max.y;\r\n positions[44] = max.z;\r\n positions[45] = min.x;\r\n positions[46] = min.y;\r\n positions[47] = max.z;\r\n\r\n // +y face\r\n positions[48] = min.x;\r\n positions[49] = max.y;\r\n positions[50] = min.z;\r\n positions[51] = max.x;\r\n positions[52] = max.y;\r\n positions[53] = min.z;\r\n positions[54] = max.x;\r\n positions[55] = max.y;\r\n positions[56] = max.z;\r\n positions[57] = min.x;\r\n positions[58] = max.y;\r\n positions[59] = max.z;\r\n\r\n // -y face\r\n positions[60] = min.x;\r\n positions[61] = min.y;\r\n positions[62] = min.z;\r\n positions[63] = max.x;\r\n positions[64] = min.y;\r\n positions[65] = min.z;\r\n positions[66] = max.x;\r\n positions[67] = min.y;\r\n positions[68] = max.z;\r\n positions[69] = min.x;\r\n positions[70] = min.y;\r\n positions[71] = max.z;\r\n\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n const normals = new Float32Array(6 * 4 * 3);\r\n\r\n // +z face\r\n normals[0] = 0.0;\r\n normals[1] = 0.0;\r\n normals[2] = 1.0;\r\n normals[3] = 0.0;\r\n normals[4] = 0.0;\r\n normals[5] = 1.0;\r\n normals[6] = 0.0;\r\n normals[7] = 0.0;\r\n normals[8] = 1.0;\r\n normals[9] = 0.0;\r\n normals[10] = 0.0;\r\n normals[11] = 1.0;\r\n\r\n // -z face\r\n normals[12] = 0.0;\r\n normals[13] = 0.0;\r\n normals[14] = -1.0;\r\n normals[15] = 0.0;\r\n normals[16] = 0.0;\r\n normals[17] = -1.0;\r\n normals[18] = 0.0;\r\n normals[19] = 0.0;\r\n normals[20] = -1.0;\r\n normals[21] = 0.0;\r\n normals[22] = 0.0;\r\n normals[23] = -1.0;\r\n\r\n // +x face\r\n normals[24] = 1.0;\r\n normals[25] = 0.0;\r\n normals[26] = 0.0;\r\n normals[27] = 1.0;\r\n normals[28] = 0.0;\r\n normals[29] = 0.0;\r\n normals[30] = 1.0;\r\n normals[31] = 0.0;\r\n normals[32] = 0.0;\r\n normals[33] = 1.0;\r\n normals[34] = 0.0;\r\n normals[35] = 0.0;\r\n\r\n // -x face\r\n normals[36] = -1.0;\r\n normals[37] = 0.0;\r\n normals[38] = 0.0;\r\n normals[39] = -1.0;\r\n normals[40] = 0.0;\r\n normals[41] = 0.0;\r\n normals[42] = -1.0;\r\n normals[43] = 0.0;\r\n normals[44] = 0.0;\r\n normals[45] = -1.0;\r\n normals[46] = 0.0;\r\n normals[47] = 0.0;\r\n\r\n // +y face\r\n normals[48] = 0.0;\r\n normals[49] = 1.0;\r\n normals[50] = 0.0;\r\n normals[51] = 0.0;\r\n normals[52] = 1.0;\r\n normals[53] = 0.0;\r\n normals[54] = 0.0;\r\n normals[55] = 1.0;\r\n normals[56] = 0.0;\r\n normals[57] = 0.0;\r\n normals[58] = 1.0;\r\n normals[59] = 0.0;\r\n\r\n // -y face\r\n normals[60] = 0.0;\r\n normals[61] = -1.0;\r\n normals[62] = 0.0;\r\n normals[63] = 0.0;\r\n normals[64] = -1.0;\r\n normals[65] = 0.0;\r\n normals[66] = 0.0;\r\n normals[67] = -1.0;\r\n normals[68] = 0.0;\r\n normals[69] = 0.0;\r\n normals[70] = -1.0;\r\n normals[71] = 0.0;\r\n\r\n attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normals,\r\n });\r\n }\r\n\r\n if (vertexFormat.st) {\r\n const texCoords = new Float32Array(6 * 4 * 2);\r\n\r\n // +z face\r\n texCoords[0] = 0.0;\r\n texCoords[1] = 0.0;\r\n texCoords[2] = 1.0;\r\n texCoords[3] = 0.0;\r\n texCoords[4] = 1.0;\r\n texCoords[5] = 1.0;\r\n texCoords[6] = 0.0;\r\n texCoords[7] = 1.0;\r\n\r\n // -z face\r\n texCoords[8] = 1.0;\r\n texCoords[9] = 0.0;\r\n texCoords[10] = 0.0;\r\n texCoords[11] = 0.0;\r\n texCoords[12] = 0.0;\r\n texCoords[13] = 1.0;\r\n texCoords[14] = 1.0;\r\n texCoords[15] = 1.0;\r\n\r\n //+x face\r\n texCoords[16] = 0.0;\r\n texCoords[17] = 0.0;\r\n texCoords[18] = 1.0;\r\n texCoords[19] = 0.0;\r\n texCoords[20] = 1.0;\r\n texCoords[21] = 1.0;\r\n texCoords[22] = 0.0;\r\n texCoords[23] = 1.0;\r\n\r\n // -x face\r\n texCoords[24] = 1.0;\r\n texCoords[25] = 0.0;\r\n texCoords[26] = 0.0;\r\n texCoords[27] = 0.0;\r\n texCoords[28] = 0.0;\r\n texCoords[29] = 1.0;\r\n texCoords[30] = 1.0;\r\n texCoords[31] = 1.0;\r\n\r\n // +y face\r\n texCoords[32] = 1.0;\r\n texCoords[33] = 0.0;\r\n texCoords[34] = 0.0;\r\n texCoords[35] = 0.0;\r\n texCoords[36] = 0.0;\r\n texCoords[37] = 1.0;\r\n texCoords[38] = 1.0;\r\n texCoords[39] = 1.0;\r\n\r\n // -y face\r\n texCoords[40] = 0.0;\r\n texCoords[41] = 0.0;\r\n texCoords[42] = 1.0;\r\n texCoords[43] = 0.0;\r\n texCoords[44] = 1.0;\r\n texCoords[45] = 1.0;\r\n texCoords[46] = 0.0;\r\n texCoords[47] = 1.0;\r\n\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: texCoords,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n const tangents = new Float32Array(6 * 4 * 3);\r\n\r\n // +z face\r\n tangents[0] = 1.0;\r\n tangents[1] = 0.0;\r\n tangents[2] = 0.0;\r\n tangents[3] = 1.0;\r\n tangents[4] = 0.0;\r\n tangents[5] = 0.0;\r\n tangents[6] = 1.0;\r\n tangents[7] = 0.0;\r\n tangents[8] = 0.0;\r\n tangents[9] = 1.0;\r\n tangents[10] = 0.0;\r\n tangents[11] = 0.0;\r\n\r\n // -z face\r\n tangents[12] = -1.0;\r\n tangents[13] = 0.0;\r\n tangents[14] = 0.0;\r\n tangents[15] = -1.0;\r\n tangents[16] = 0.0;\r\n tangents[17] = 0.0;\r\n tangents[18] = -1.0;\r\n tangents[19] = 0.0;\r\n tangents[20] = 0.0;\r\n tangents[21] = -1.0;\r\n tangents[22] = 0.0;\r\n tangents[23] = 0.0;\r\n\r\n // +x face\r\n tangents[24] = 0.0;\r\n tangents[25] = 1.0;\r\n tangents[26] = 0.0;\r\n tangents[27] = 0.0;\r\n tangents[28] = 1.0;\r\n tangents[29] = 0.0;\r\n tangents[30] = 0.0;\r\n tangents[31] = 1.0;\r\n tangents[32] = 0.0;\r\n tangents[33] = 0.0;\r\n tangents[34] = 1.0;\r\n tangents[35] = 0.0;\r\n\r\n // -x face\r\n tangents[36] = 0.0;\r\n tangents[37] = -1.0;\r\n tangents[38] = 0.0;\r\n tangents[39] = 0.0;\r\n tangents[40] = -1.0;\r\n tangents[41] = 0.0;\r\n tangents[42] = 0.0;\r\n tangents[43] = -1.0;\r\n tangents[44] = 0.0;\r\n tangents[45] = 0.0;\r\n tangents[46] = -1.0;\r\n tangents[47] = 0.0;\r\n\r\n // +y face\r\n tangents[48] = -1.0;\r\n tangents[49] = 0.0;\r\n tangents[50] = 0.0;\r\n tangents[51] = -1.0;\r\n tangents[52] = 0.0;\r\n tangents[53] = 0.0;\r\n tangents[54] = -1.0;\r\n tangents[55] = 0.0;\r\n tangents[56] = 0.0;\r\n tangents[57] = -1.0;\r\n tangents[58] = 0.0;\r\n tangents[59] = 0.0;\r\n\r\n // -y face\r\n tangents[60] = 1.0;\r\n tangents[61] = 0.0;\r\n tangents[62] = 0.0;\r\n tangents[63] = 1.0;\r\n tangents[64] = 0.0;\r\n tangents[65] = 0.0;\r\n tangents[66] = 1.0;\r\n tangents[67] = 0.0;\r\n tangents[68] = 0.0;\r\n tangents[69] = 1.0;\r\n tangents[70] = 0.0;\r\n tangents[71] = 0.0;\r\n\r\n attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n const bitangents = new Float32Array(6 * 4 * 3);\r\n\r\n // +z face\r\n bitangents[0] = 0.0;\r\n bitangents[1] = 1.0;\r\n bitangents[2] = 0.0;\r\n bitangents[3] = 0.0;\r\n bitangents[4] = 1.0;\r\n bitangents[5] = 0.0;\r\n bitangents[6] = 0.0;\r\n bitangents[7] = 1.0;\r\n bitangents[8] = 0.0;\r\n bitangents[9] = 0.0;\r\n bitangents[10] = 1.0;\r\n bitangents[11] = 0.0;\r\n\r\n // -z face\r\n bitangents[12] = 0.0;\r\n bitangents[13] = 1.0;\r\n bitangents[14] = 0.0;\r\n bitangents[15] = 0.0;\r\n bitangents[16] = 1.0;\r\n bitangents[17] = 0.0;\r\n bitangents[18] = 0.0;\r\n bitangents[19] = 1.0;\r\n bitangents[20] = 0.0;\r\n bitangents[21] = 0.0;\r\n bitangents[22] = 1.0;\r\n bitangents[23] = 0.0;\r\n\r\n // +x face\r\n bitangents[24] = 0.0;\r\n bitangents[25] = 0.0;\r\n bitangents[26] = 1.0;\r\n bitangents[27] = 0.0;\r\n bitangents[28] = 0.0;\r\n bitangents[29] = 1.0;\r\n bitangents[30] = 0.0;\r\n bitangents[31] = 0.0;\r\n bitangents[32] = 1.0;\r\n bitangents[33] = 0.0;\r\n bitangents[34] = 0.0;\r\n bitangents[35] = 1.0;\r\n\r\n // -x face\r\n bitangents[36] = 0.0;\r\n bitangents[37] = 0.0;\r\n bitangents[38] = 1.0;\r\n bitangents[39] = 0.0;\r\n bitangents[40] = 0.0;\r\n bitangents[41] = 1.0;\r\n bitangents[42] = 0.0;\r\n bitangents[43] = 0.0;\r\n bitangents[44] = 1.0;\r\n bitangents[45] = 0.0;\r\n bitangents[46] = 0.0;\r\n bitangents[47] = 1.0;\r\n\r\n // +y face\r\n bitangents[48] = 0.0;\r\n bitangents[49] = 0.0;\r\n bitangents[50] = 1.0;\r\n bitangents[51] = 0.0;\r\n bitangents[52] = 0.0;\r\n bitangents[53] = 1.0;\r\n bitangents[54] = 0.0;\r\n bitangents[55] = 0.0;\r\n bitangents[56] = 1.0;\r\n bitangents[57] = 0.0;\r\n bitangents[58] = 0.0;\r\n bitangents[59] = 1.0;\r\n\r\n // -y face\r\n bitangents[60] = 0.0;\r\n bitangents[61] = 0.0;\r\n bitangents[62] = 1.0;\r\n bitangents[63] = 0.0;\r\n bitangents[64] = 0.0;\r\n bitangents[65] = 1.0;\r\n bitangents[66] = 0.0;\r\n bitangents[67] = 0.0;\r\n bitangents[68] = 1.0;\r\n bitangents[69] = 0.0;\r\n bitangents[70] = 0.0;\r\n bitangents[71] = 1.0;\r\n\r\n attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangents,\r\n });\r\n }\r\n\r\n // 12 triangles: 6 faces, 2 triangles each.\r\n indices = new Uint16Array(6 * 2 * 3);\r\n\r\n // +z face\r\n indices[0] = 0;\r\n indices[1] = 1;\r\n indices[2] = 2;\r\n indices[3] = 0;\r\n indices[4] = 2;\r\n indices[5] = 3;\r\n\r\n // -z face\r\n indices[6] = 4 + 2;\r\n indices[7] = 4 + 1;\r\n indices[8] = 4 + 0;\r\n indices[9] = 4 + 3;\r\n indices[10] = 4 + 2;\r\n indices[11] = 4 + 0;\r\n\r\n // +x face\r\n indices[12] = 8 + 0;\r\n indices[13] = 8 + 1;\r\n indices[14] = 8 + 2;\r\n indices[15] = 8 + 0;\r\n indices[16] = 8 + 2;\r\n indices[17] = 8 + 3;\r\n\r\n // -x face\r\n indices[18] = 12 + 2;\r\n indices[19] = 12 + 1;\r\n indices[20] = 12 + 0;\r\n indices[21] = 12 + 3;\r\n indices[22] = 12 + 2;\r\n indices[23] = 12 + 0;\r\n\r\n // +y face\r\n indices[24] = 16 + 2;\r\n indices[25] = 16 + 1;\r\n indices[26] = 16 + 0;\r\n indices[27] = 16 + 3;\r\n indices[28] = 16 + 2;\r\n indices[29] = 16 + 0;\r\n\r\n // -y face\r\n indices[30] = 20 + 0;\r\n indices[31] = 20 + 1;\r\n indices[32] = 20 + 2;\r\n indices[33] = 20 + 0;\r\n indices[34] = 20 + 2;\r\n indices[35] = 20 + 3;\r\n } else {\r\n // Positions only - no need to duplicate corner points\r\n positions = new Float64Array(8 * 3);\r\n\r\n positions[0] = min.x;\r\n positions[1] = min.y;\r\n positions[2] = min.z;\r\n positions[3] = max.x;\r\n positions[4] = min.y;\r\n positions[5] = min.z;\r\n positions[6] = max.x;\r\n positions[7] = max.y;\r\n positions[8] = min.z;\r\n positions[9] = min.x;\r\n positions[10] = max.y;\r\n positions[11] = min.z;\r\n positions[12] = min.x;\r\n positions[13] = min.y;\r\n positions[14] = max.z;\r\n positions[15] = max.x;\r\n positions[16] = min.y;\r\n positions[17] = max.z;\r\n positions[18] = max.x;\r\n positions[19] = max.y;\r\n positions[20] = max.z;\r\n positions[21] = min.x;\r\n positions[22] = max.y;\r\n positions[23] = max.z;\r\n\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n\r\n // 12 triangles: 6 faces, 2 triangles each.\r\n indices = new Uint16Array(6 * 2 * 3);\r\n\r\n // plane z = corner.Z\r\n indices[0] = 4;\r\n indices[1] = 5;\r\n indices[2] = 6;\r\n indices[3] = 4;\r\n indices[4] = 6;\r\n indices[5] = 7;\r\n\r\n // plane z = -corner.Z\r\n indices[6] = 1;\r\n indices[7] = 0;\r\n indices[8] = 3;\r\n indices[9] = 1;\r\n indices[10] = 3;\r\n indices[11] = 2;\r\n\r\n // plane x = corner.X\r\n indices[12] = 1;\r\n indices[13] = 6;\r\n indices[14] = 5;\r\n indices[15] = 1;\r\n indices[16] = 2;\r\n indices[17] = 6;\r\n\r\n // plane y = corner.Y\r\n indices[18] = 2;\r\n indices[19] = 3;\r\n indices[20] = 7;\r\n indices[21] = 2;\r\n indices[22] = 7;\r\n indices[23] = 6;\r\n\r\n // plane x = -corner.X\r\n indices[24] = 3;\r\n indices[25] = 0;\r\n indices[26] = 4;\r\n indices[27] = 3;\r\n indices[28] = 4;\r\n indices[29] = 7;\r\n\r\n // plane y = -corner.Y\r\n indices[30] = 0;\r\n indices[31] = 1;\r\n indices[32] = 5;\r\n indices[33] = 0;\r\n indices[34] = 5;\r\n indices[35] = 4;\r\n }\r\n\r\n const diff = Cartesian3.subtract(max, min, diffScratch);\r\n const radius = Cartesian3.magnitude(diff) * 0.5;\r\n\r\n if (defined(boxGeometry._offsetAttribute)) {\r\n const length = positions.length;\r\n const offsetValue =\r\n boxGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n boundingSphere: new BoundingSphere(Cartesian3.ZERO, radius),\r\n offsetAttribute: boxGeometry._offsetAttribute,\r\n });\r\n};\r\n\r\nlet unitBoxGeometry;\r\n\r\n/**\r\n * Returns the geometric representation of a unit box, including its vertices, indices, and a bounding sphere.\r\n * @returns {Geometry} The computed vertices and indices.\r\n *\r\n * @private\r\n */\r\nBoxGeometry.getUnitBox = function () {\r\n if (!defined(unitBoxGeometry)) {\r\n unitBoxGeometry = BoxGeometry.createGeometry(\r\n BoxGeometry.fromDimensions({\r\n dimensions: new Cartesian3(1.0, 1.0, 1.0),\r\n vertexFormat: VertexFormat.POSITION_ONLY,\r\n })\r\n );\r\n }\r\n return unitBoxGeometry;\r\n};\r\nexport default BoxGeometry;\r\n"],"names":["Cartesian3","defaultValue","Check","defined","GeometryOffsetAttribute","DeveloperError","VertexFormat","GeometryAttributes","GeometryAttribute","ComponentDatatype","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,MAAM,WAAW,GAAG,IAAIA,kBAAU,EAAE,CAAC;AACrC;EACA;EACA;EACA;EACA;EACA;EACA;EAC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AAG,EAAE,GAAG,CAAC;EACjD,QAAQ,YAAY,EAAEM,yBAAY,CAAC,aAAa;EAChD,OAAO,CAAC;EACR,KAAK,CAAC;EACN,GAAG;EACH,EAAE,OAAO,eAAe,CAAC;EACzB,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/Check-d10e5f2e.js b/examples/cesium/Workers/Check-d10e5f2e.js
new file mode 100644
index 0000000..36df0e1
--- /dev/null
+++ b/examples/cesium/Workers/Check-d10e5f2e.js
@@ -0,0 +1,316 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './defaultValue-0ab18f7d'], (function (exports, defaultValue) { 'use strict';
+
+ /**
+ * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,
+ * argument out of range, etc. This exception should only be thrown during development;
+ * it usually indicates a bug in the calling code. This exception should never be
+ * caught; instead the calling code should strive not to generate it.
+ *
+ * On the other hand, a {@link RuntimeError} indicates an exception that may
+ * be thrown at runtime, e.g., out of memory, that the calling code should be prepared
+ * to catch.
+ *
+ * @alias DeveloperError
+ * @constructor
+ * @extends Error
+ *
+ * @param {String} [message] The error message for this exception.
+ *
+ * @see RuntimeError
+ */
+ function DeveloperError(message) {
+ /**
+ * 'DeveloperError' indicating that this exception was thrown due to a developer error.
+ * @type {String}
+ * @readonly
+ */
+ this.name = "DeveloperError";
+
+ /**
+ * The explanation for why this exception was thrown.
+ * @type {String}
+ * @readonly
+ */
+ this.message = message;
+
+ //Browsers such as IE don't have a stack property until you actually throw the error.
+ let stack;
+ try {
+ throw new Error();
+ } catch (e) {
+ stack = e.stack;
+ }
+
+ /**
+ * The stack trace of this exception, if available.
+ * @type {String}
+ * @readonly
+ */
+ this.stack = stack;
+ }
+
+ if (defaultValue.defined(Object.create)) {
+ DeveloperError.prototype = Object.create(Error.prototype);
+ DeveloperError.prototype.constructor = DeveloperError;
+ }
+
+ DeveloperError.prototype.toString = function () {
+ let str = `${this.name}: ${this.message}`;
+
+ if (defaultValue.defined(this.stack)) {
+ str += `\n${this.stack.toString()}`;
+ }
+
+ return str;
+ };
+
+ /**
+ * @private
+ */
+ DeveloperError.throwInstantiationError = function () {
+ throw new DeveloperError(
+ "This function defines an interface and should not be called directly."
+ );
+ };
+
+ /**
+ * Contains functions for checking that supplied arguments are of a specified type
+ * or meet specified conditions
+ * @private
+ */
+ const Check = {};
+
+ /**
+ * Contains type checking functions, all using the typeof operator
+ */
+ Check.typeOf = {};
+
+ function getUndefinedErrorMessage(name) {
+ return `${name} is required, actual value was undefined`;
+ }
+
+ function getFailedTypeErrorMessage(actual, expected, name) {
+ return `Expected ${name} to be typeof ${expected}, actual typeof was ${actual}`;
+ }
+
+ /**
+ * Throws if test is not defined
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value that is to be checked
+ * @exception {DeveloperError} test must be defined
+ */
+ Check.defined = function (name, test) {
+ if (!defaultValue.defined(test)) {
+ throw new DeveloperError(getUndefinedErrorMessage(name));
+ }
+ };
+
+ /**
+ * Throws if test is not typeof 'function'
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value to test
+ * @exception {DeveloperError} test must be typeof 'function'
+ */
+ Check.typeOf.func = function (name, test) {
+ if (typeof test !== "function") {
+ throw new DeveloperError(
+ getFailedTypeErrorMessage(typeof test, "function", name)
+ );
+ }
+ };
+
+ /**
+ * Throws if test is not typeof 'string'
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value to test
+ * @exception {DeveloperError} test must be typeof 'string'
+ */
+ Check.typeOf.string = function (name, test) {
+ if (typeof test !== "string") {
+ throw new DeveloperError(
+ getFailedTypeErrorMessage(typeof test, "string", name)
+ );
+ }
+ };
+
+ /**
+ * Throws if test is not typeof 'number'
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value to test
+ * @exception {DeveloperError} test must be typeof 'number'
+ */
+ Check.typeOf.number = function (name, test) {
+ if (typeof test !== "number") {
+ throw new DeveloperError(
+ getFailedTypeErrorMessage(typeof test, "number", name)
+ );
+ }
+ };
+
+ /**
+ * Throws if test is not typeof 'number' and less than limit
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value to test
+ * @param {Number} limit The limit value to compare against
+ * @exception {DeveloperError} test must be typeof 'number' and less than limit
+ */
+ Check.typeOf.number.lessThan = function (name, test, limit) {
+ Check.typeOf.number(name, test);
+ if (test >= limit) {
+ throw new DeveloperError(
+ `Expected ${name} to be less than ${limit}, actual value was ${test}`
+ );
+ }
+ };
+
+ /**
+ * Throws if test is not typeof 'number' and less than or equal to limit
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value to test
+ * @param {Number} limit The limit value to compare against
+ * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit
+ */
+ Check.typeOf.number.lessThanOrEquals = function (name, test, limit) {
+ Check.typeOf.number(name, test);
+ if (test > limit) {
+ throw new DeveloperError(
+ `Expected ${name} to be less than or equal to ${limit}, actual value was ${test}`
+ );
+ }
+ };
+
+ /**
+ * Throws if test is not typeof 'number' and greater than limit
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value to test
+ * @param {Number} limit The limit value to compare against
+ * @exception {DeveloperError} test must be typeof 'number' and greater than limit
+ */
+ Check.typeOf.number.greaterThan = function (name, test, limit) {
+ Check.typeOf.number(name, test);
+ if (test <= limit) {
+ throw new DeveloperError(
+ `Expected ${name} to be greater than ${limit}, actual value was ${test}`
+ );
+ }
+ };
+
+ /**
+ * Throws if test is not typeof 'number' and greater than or equal to limit
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value to test
+ * @param {Number} limit The limit value to compare against
+ * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit
+ */
+ Check.typeOf.number.greaterThanOrEquals = function (name, test, limit) {
+ Check.typeOf.number(name, test);
+ if (test < limit) {
+ throw new DeveloperError(
+ `Expected ${name} to be greater than or equal to ${limit}, actual value was ${test}`
+ );
+ }
+ };
+
+ /**
+ * Throws if test is not typeof 'object'
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value to test
+ * @exception {DeveloperError} test must be typeof 'object'
+ */
+ Check.typeOf.object = function (name, test) {
+ if (typeof test !== "object") {
+ throw new DeveloperError(
+ getFailedTypeErrorMessage(typeof test, "object", name)
+ );
+ }
+ };
+
+ /**
+ * Throws if test is not typeof 'boolean'
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value to test
+ * @exception {DeveloperError} test must be typeof 'boolean'
+ */
+ Check.typeOf.bool = function (name, test) {
+ if (typeof test !== "boolean") {
+ throw new DeveloperError(
+ getFailedTypeErrorMessage(typeof test, "boolean", name)
+ );
+ }
+ };
+
+ /**
+ * Throws if test is not typeof 'bigint'
+ *
+ * @param {String} name The name of the variable being tested
+ * @param {*} test The value to test
+ * @exception {DeveloperError} test must be typeof 'bigint'
+ */
+ Check.typeOf.bigint = function (name, test) {
+ if (typeof test !== "bigint") {
+ throw new DeveloperError(
+ getFailedTypeErrorMessage(typeof test, "bigint", name)
+ );
+ }
+ };
+
+ /**
+ * Throws if test1 and test2 is not typeof 'number' and not equal in value
+ *
+ * @param {String} name1 The name of the first variable being tested
+ * @param {String} name2 The name of the second variable being tested against
+ * @param {*} test1 The value to test
+ * @param {*} test2 The value to test against
+ * @exception {DeveloperError} test1 and test2 should be type of 'number' and be equal in value
+ */
+ Check.typeOf.number.equals = function (name1, name2, test1, test2) {
+ Check.typeOf.number(name1, test1);
+ Check.typeOf.number(name2, test2);
+ if (test1 !== test2) {
+ throw new DeveloperError(
+ `${name1} must be equal to ${name2}, the actual values are ${test1} and ${test2}`
+ );
+ }
+ };
+ var Check$1 = Check;
+
+ exports.Check = Check$1;
+ exports.DeveloperError = DeveloperError;
+
+}));
+//# sourceMappingURL=Check-d10e5f2e.js.map
diff --git a/examples/cesium/Workers/Check-d10e5f2e.js.map b/examples/cesium/Workers/Check-d10e5f2e.js.map
new file mode 100644
index 0000000..882d04a
--- /dev/null
+++ b/examples/cesium/Workers/Check-d10e5f2e.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Check-d10e5f2e.js","sources":["../../../Source/Core/DeveloperError.js","../../../Source/Core/Check.js"],"sourcesContent":["import defined from \"./defined.js\";\r\n\r\n/**\r\n * Constructs an exception object that is thrown due to a developer error, e.g., invalid argument,\r\n * argument out of range, etc. This exception should only be thrown during development;\r\n * it usually indicates a bug in the calling code. This exception should never be\r\n * caught; instead the calling code should strive not to generate it.\r\n *
\r\n * On the other hand, a {@link RuntimeError} indicates an exception that may\r\n * be thrown at runtime, e.g., out of memory, that the calling code should be prepared\r\n * to catch.\r\n *\r\n * @alias DeveloperError\r\n * @constructor\r\n * @extends Error\r\n *\r\n * @param {String} [message] The error message for this exception.\r\n *\r\n * @see RuntimeError\r\n */\r\nfunction DeveloperError(message) {\r\n /**\r\n * 'DeveloperError' indicating that this exception was thrown due to a developer error.\r\n * @type {String}\r\n * @readonly\r\n */\r\n this.name = \"DeveloperError\";\r\n\r\n /**\r\n * The explanation for why this exception was thrown.\r\n * @type {String}\r\n * @readonly\r\n */\r\n this.message = message;\r\n\r\n //Browsers such as IE don't have a stack property until you actually throw the error.\r\n let stack;\r\n try {\r\n throw new Error();\r\n } catch (e) {\r\n stack = e.stack;\r\n }\r\n\r\n /**\r\n * The stack trace of this exception, if available.\r\n * @type {String}\r\n * @readonly\r\n */\r\n this.stack = stack;\r\n}\r\n\r\nif (defined(Object.create)) {\r\n DeveloperError.prototype = Object.create(Error.prototype);\r\n DeveloperError.prototype.constructor = DeveloperError;\r\n}\r\n\r\nDeveloperError.prototype.toString = function () {\r\n let str = `${this.name}: ${this.message}`;\r\n\r\n if (defined(this.stack)) {\r\n str += `\\n${this.stack.toString()}`;\r\n }\r\n\r\n return str;\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nDeveloperError.throwInstantiationError = function () {\r\n throw new DeveloperError(\r\n \"This function defines an interface and should not be called directly.\"\r\n );\r\n};\r\nexport default DeveloperError;\r\n","import defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * Contains functions for checking that supplied arguments are of a specified type\r\n * or meet specified conditions\r\n * @private\r\n */\r\nconst Check = {};\r\n\r\n/**\r\n * Contains type checking functions, all using the typeof operator\r\n */\r\nCheck.typeOf = {};\r\n\r\nfunction getUndefinedErrorMessage(name) {\r\n return `${name} is required, actual value was undefined`;\r\n}\r\n\r\nfunction getFailedTypeErrorMessage(actual, expected, name) {\r\n return `Expected ${name} to be typeof ${expected}, actual typeof was ${actual}`;\r\n}\r\n\r\n/**\r\n * Throws if test is not defined\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value that is to be checked\r\n * @exception {DeveloperError} test must be defined\r\n */\r\nCheck.defined = function (name, test) {\r\n if (!defined(test)) {\r\n throw new DeveloperError(getUndefinedErrorMessage(name));\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test is not typeof 'function'\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value to test\r\n * @exception {DeveloperError} test must be typeof 'function'\r\n */\r\nCheck.typeOf.func = function (name, test) {\r\n if (typeof test !== \"function\") {\r\n throw new DeveloperError(\r\n getFailedTypeErrorMessage(typeof test, \"function\", name)\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test is not typeof 'string'\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value to test\r\n * @exception {DeveloperError} test must be typeof 'string'\r\n */\r\nCheck.typeOf.string = function (name, test) {\r\n if (typeof test !== \"string\") {\r\n throw new DeveloperError(\r\n getFailedTypeErrorMessage(typeof test, \"string\", name)\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test is not typeof 'number'\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value to test\r\n * @exception {DeveloperError} test must be typeof 'number'\r\n */\r\nCheck.typeOf.number = function (name, test) {\r\n if (typeof test !== \"number\") {\r\n throw new DeveloperError(\r\n getFailedTypeErrorMessage(typeof test, \"number\", name)\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test is not typeof 'number' and less than limit\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value to test\r\n * @param {Number} limit The limit value to compare against\r\n * @exception {DeveloperError} test must be typeof 'number' and less than limit\r\n */\r\nCheck.typeOf.number.lessThan = function (name, test, limit) {\r\n Check.typeOf.number(name, test);\r\n if (test >= limit) {\r\n throw new DeveloperError(\r\n `Expected ${name} to be less than ${limit}, actual value was ${test}`\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test is not typeof 'number' and less than or equal to limit\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value to test\r\n * @param {Number} limit The limit value to compare against\r\n * @exception {DeveloperError} test must be typeof 'number' and less than or equal to limit\r\n */\r\nCheck.typeOf.number.lessThanOrEquals = function (name, test, limit) {\r\n Check.typeOf.number(name, test);\r\n if (test > limit) {\r\n throw new DeveloperError(\r\n `Expected ${name} to be less than or equal to ${limit}, actual value was ${test}`\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test is not typeof 'number' and greater than limit\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value to test\r\n * @param {Number} limit The limit value to compare against\r\n * @exception {DeveloperError} test must be typeof 'number' and greater than limit\r\n */\r\nCheck.typeOf.number.greaterThan = function (name, test, limit) {\r\n Check.typeOf.number(name, test);\r\n if (test <= limit) {\r\n throw new DeveloperError(\r\n `Expected ${name} to be greater than ${limit}, actual value was ${test}`\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test is not typeof 'number' and greater than or equal to limit\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value to test\r\n * @param {Number} limit The limit value to compare against\r\n * @exception {DeveloperError} test must be typeof 'number' and greater than or equal to limit\r\n */\r\nCheck.typeOf.number.greaterThanOrEquals = function (name, test, limit) {\r\n Check.typeOf.number(name, test);\r\n if (test < limit) {\r\n throw new DeveloperError(\r\n `Expected ${name} to be greater than or equal to ${limit}, actual value was ${test}`\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test is not typeof 'object'\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value to test\r\n * @exception {DeveloperError} test must be typeof 'object'\r\n */\r\nCheck.typeOf.object = function (name, test) {\r\n if (typeof test !== \"object\") {\r\n throw new DeveloperError(\r\n getFailedTypeErrorMessage(typeof test, \"object\", name)\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test is not typeof 'boolean'\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value to test\r\n * @exception {DeveloperError} test must be typeof 'boolean'\r\n */\r\nCheck.typeOf.bool = function (name, test) {\r\n if (typeof test !== \"boolean\") {\r\n throw new DeveloperError(\r\n getFailedTypeErrorMessage(typeof test, \"boolean\", name)\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test is not typeof 'bigint'\r\n *\r\n * @param {String} name The name of the variable being tested\r\n * @param {*} test The value to test\r\n * @exception {DeveloperError} test must be typeof 'bigint'\r\n */\r\nCheck.typeOf.bigint = function (name, test) {\r\n if (typeof test !== \"bigint\") {\r\n throw new DeveloperError(\r\n getFailedTypeErrorMessage(typeof test, \"bigint\", name)\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Throws if test1 and test2 is not typeof 'number' and not equal in value\r\n *\r\n * @param {String} name1 The name of the first variable being tested\r\n * @param {String} name2 The name of the second variable being tested against\r\n * @param {*} test1 The value to test\r\n * @param {*} test2 The value to test against\r\n * @exception {DeveloperError} test1 and test2 should be type of 'number' and be equal in value\r\n */\r\nCheck.typeOf.number.equals = function (name1, name2, test1, test2) {\r\n Check.typeOf.number(name1, test1);\r\n Check.typeOf.number(name2, test2);\r\n if (test1 !== test2) {\r\n throw new DeveloperError(\r\n `${name1} must be equal to ${name2}, the actual values are ${test1} and ${test2}`\r\n );\r\n }\r\n};\r\nexport default Check;\r\n"],"names":["defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,cAAc,CAAC,OAAO,EAAE;EACjC;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;AAC/B;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACzB;EACA;EACA,EAAE,IAAI,KAAK,CAAC;EACZ,EAAE,IAAI;EACN,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;EACtB,GAAG,CAAC,OAAO,CAAC,EAAE;EACd,IAAI,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;EACpB,GAAG;AACH;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;EACrB,CAAC;AACD;EACA,IAAIA,oBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;EAC5B,EAAE,cAAc,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;EAC5D,EAAE,cAAc,CAAC,SAAS,CAAC,WAAW,GAAG,cAAc,CAAC;EACxD,CAAC;AACD;EACA,cAAc,CAAC,SAAS,CAAC,QAAQ,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AAE,KAAK,EAAE;EACnE,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;EACpC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;EACpC,EAAE,IAAI,KAAK,KAAK,KAAK,EAAE;EACvB,IAAI,MAAM,IAAI,cAAc;EAC5B,MAAM,CAAC,EAAE,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;EACvF,KAAK,CAAC;EACN,GAAG;EACH,CAAC,CAAC;AACF,gBAAe,KAAK;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/Color-c019c34b.js b/examples/cesium/Workers/Color-c019c34b.js
new file mode 100644
index 0000000..2b3aaa7
--- /dev/null
+++ b/examples/cesium/Workers/Color-c019c34b.js
@@ -0,0 +1,2288 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Transforms-11fb6b0a', './Math-9be8b918'], (function (exports, Check, defaultValue, Transforms, Math$1) { 'use strict';
+
+ function hue2rgb(m1, m2, h) {
+ if (h < 0) {
+ h += 1;
+ }
+ if (h > 1) {
+ h -= 1;
+ }
+ if (h * 6 < 1) {
+ return m1 + (m2 - m1) * 6 * h;
+ }
+ if (h * 2 < 1) {
+ return m2;
+ }
+ if (h * 3 < 2) {
+ return m1 + (m2 - m1) * (2 / 3 - h) * 6;
+ }
+ return m1;
+ }
+
+ /**
+ * A color, specified using red, green, blue, and alpha values,
+ * which range from 0
(no intensity) to 1.0
(full intensity).
+ * @param {Number} [red=1.0] The red component.
+ * @param {Number} [green=1.0] The green component.
+ * @param {Number} [blue=1.0] The blue component.
+ * @param {Number} [alpha=1.0] The alpha component.
+ *
+ * @constructor
+ * @alias Color
+ *
+ * @see Packable
+ */
+ function Color(red, green, blue, alpha) {
+ /**
+ * The red component.
+ * @type {Number}
+ * @default 1.0
+ */
+ this.red = defaultValue.defaultValue(red, 1.0);
+ /**
+ * The green component.
+ * @type {Number}
+ * @default 1.0
+ */
+ this.green = defaultValue.defaultValue(green, 1.0);
+ /**
+ * The blue component.
+ * @type {Number}
+ * @default 1.0
+ */
+ this.blue = defaultValue.defaultValue(blue, 1.0);
+ /**
+ * The alpha component.
+ * @type {Number}
+ * @default 1.0
+ */
+ this.alpha = defaultValue.defaultValue(alpha, 1.0);
+ }
+
+ /**
+ * Creates a Color instance from a {@link Cartesian4}. x
, y
, z
,
+ * and w
map to red
, green
, blue
, and alpha
, respectively.
+ *
+ * @param {Cartesian4} cartesian The source cartesian.
+ * @param {Color} [result] The object onto which to store the result.
+ * @returns {Color} The modified result parameter or a new Color instance if one was not provided.
+ */
+ Color.fromCartesian4 = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Color(cartesian.x, cartesian.y, cartesian.z, cartesian.w);
+ }
+
+ result.red = cartesian.x;
+ result.green = cartesian.y;
+ result.blue = cartesian.z;
+ result.alpha = cartesian.w;
+ return result;
+ };
+
+ /**
+ * Creates a new Color specified using red, green, blue, and alpha values
+ * that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.
+ *
+ * @param {Number} [red=255] The red component.
+ * @param {Number} [green=255] The green component.
+ * @param {Number} [blue=255] The blue component.
+ * @param {Number} [alpha=255] The alpha component.
+ * @param {Color} [result] The object onto which to store the result.
+ * @returns {Color} The modified result parameter or a new Color instance if one was not provided.
+ */
+ Color.fromBytes = function (red, green, blue, alpha, result) {
+ red = Color.byteToFloat(defaultValue.defaultValue(red, 255.0));
+ green = Color.byteToFloat(defaultValue.defaultValue(green, 255.0));
+ blue = Color.byteToFloat(defaultValue.defaultValue(blue, 255.0));
+ alpha = Color.byteToFloat(defaultValue.defaultValue(alpha, 255.0));
+
+ if (!defaultValue.defined(result)) {
+ return new Color(red, green, blue, alpha);
+ }
+
+ result.red = red;
+ result.green = green;
+ result.blue = blue;
+ result.alpha = alpha;
+ return result;
+ };
+
+ /**
+ * Creates a new Color that has the same red, green, and blue components
+ * of the specified color, but with the specified alpha value.
+ *
+ * @param {Color} color The base color
+ * @param {Number} alpha The new alpha component.
+ * @param {Color} [result] The object onto which to store the result.
+ * @returns {Color} The modified result parameter or a new Color instance if one was not provided.
+ *
+ * @example const translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);
+ */
+ Color.fromAlpha = function (color, alpha, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("color", color);
+ Check.Check.typeOf.number("alpha", alpha);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Color(color.red, color.green, color.blue, alpha);
+ }
+
+ result.red = color.red;
+ result.green = color.green;
+ result.blue = color.blue;
+ result.alpha = alpha;
+ return result;
+ };
+
+ let scratchArrayBuffer;
+ let scratchUint32Array;
+ let scratchUint8Array;
+ if (Transforms.FeatureDetection.supportsTypedArrays()) {
+ scratchArrayBuffer = new ArrayBuffer(4);
+ scratchUint32Array = new Uint32Array(scratchArrayBuffer);
+ scratchUint8Array = new Uint8Array(scratchArrayBuffer);
+ }
+
+ /**
+ * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness
+ * of the system.
+ *
+ * @param {Number} rgba A single numeric unsigned 32-bit RGBA value.
+ * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
+ * @returns {Color} The color object.
+ *
+ * @example
+ * const color = Cesium.Color.fromRgba(0x67ADDFFF);
+ *
+ * @see Color#toRgba
+ */
+ Color.fromRgba = function (rgba, result) {
+ // scratchUint32Array and scratchUint8Array share an underlying array buffer
+ scratchUint32Array[0] = rgba;
+ return Color.fromBytes(
+ scratchUint8Array[0],
+ scratchUint8Array[1],
+ scratchUint8Array[2],
+ scratchUint8Array[3],
+ result
+ );
+ };
+
+ /**
+ * Creates a Color instance from hue, saturation, and lightness.
+ *
+ * @param {Number} [hue=0] The hue angle 0...1
+ * @param {Number} [saturation=0] The saturation value 0...1
+ * @param {Number} [lightness=0] The lightness value 0...1
+ * @param {Number} [alpha=1.0] The alpha component 0...1
+ * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
+ * @returns {Color} The color object.
+ *
+ * @see {@link http://www.w3.org/TR/css3-color/#hsl-color|CSS color values}
+ */
+ Color.fromHsl = function (hue, saturation, lightness, alpha, result) {
+ hue = defaultValue.defaultValue(hue, 0.0) % 1.0;
+ saturation = defaultValue.defaultValue(saturation, 0.0);
+ lightness = defaultValue.defaultValue(lightness, 0.0);
+ alpha = defaultValue.defaultValue(alpha, 1.0);
+
+ let red = lightness;
+ let green = lightness;
+ let blue = lightness;
+
+ if (saturation !== 0) {
+ let m2;
+ if (lightness < 0.5) {
+ m2 = lightness * (1 + saturation);
+ } else {
+ m2 = lightness + saturation - lightness * saturation;
+ }
+
+ const m1 = 2.0 * lightness - m2;
+ red = hue2rgb(m1, m2, hue + 1 / 3);
+ green = hue2rgb(m1, m2, hue);
+ blue = hue2rgb(m1, m2, hue - 1 / 3);
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Color(red, green, blue, alpha);
+ }
+
+ result.red = red;
+ result.green = green;
+ result.blue = blue;
+ result.alpha = alpha;
+ return result;
+ };
+
+ /**
+ * Creates a random color using the provided options. For reproducible random colors, you should
+ * call {@link CesiumMath#setRandomNumberSeed} once at the beginning of your application.
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {Number} [options.red] If specified, the red component to use instead of a randomized value.
+ * @param {Number} [options.minimumRed=0.0] The maximum red value to generate if none was specified.
+ * @param {Number} [options.maximumRed=1.0] The minimum red value to generate if none was specified.
+ * @param {Number} [options.green] If specified, the green component to use instead of a randomized value.
+ * @param {Number} [options.minimumGreen=0.0] The maximum green value to generate if none was specified.
+ * @param {Number} [options.maximumGreen=1.0] The minimum green value to generate if none was specified.
+ * @param {Number} [options.blue] If specified, the blue component to use instead of a randomized value.
+ * @param {Number} [options.minimumBlue=0.0] The maximum blue value to generate if none was specified.
+ * @param {Number} [options.maximumBlue=1.0] The minimum blue value to generate if none was specified.
+ * @param {Number} [options.alpha] If specified, the alpha component to use instead of a randomized value.
+ * @param {Number} [options.minimumAlpha=0.0] The maximum alpha value to generate if none was specified.
+ * @param {Number} [options.maximumAlpha=1.0] The minimum alpha value to generate if none was specified.
+ * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
+ * @returns {Color} The modified result parameter or a new instance if result was undefined.
+ *
+ * @exception {DeveloperError} minimumRed must be less than or equal to maximumRed.
+ * @exception {DeveloperError} minimumGreen must be less than or equal to maximumGreen.
+ * @exception {DeveloperError} minimumBlue must be less than or equal to maximumBlue.
+ * @exception {DeveloperError} minimumAlpha must be less than or equal to maximumAlpha.
+ *
+ * @example
+ * //Create a completely random color
+ * const color = Cesium.Color.fromRandom();
+ *
+ * //Create a random shade of yellow.
+ * const color1 = Cesium.Color.fromRandom({
+ * red : 1.0,
+ * green : 1.0,
+ * alpha : 1.0
+ * });
+ *
+ * //Create a random bright color.
+ * const color2 = Cesium.Color.fromRandom({
+ * minimumRed : 0.75,
+ * minimumGreen : 0.75,
+ * minimumBlue : 0.75,
+ * alpha : 1.0
+ * });
+ */
+ Color.fromRandom = function (options, result) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ let red = options.red;
+ if (!defaultValue.defined(red)) {
+ const minimumRed = defaultValue.defaultValue(options.minimumRed, 0);
+ const maximumRed = defaultValue.defaultValue(options.maximumRed, 1.0);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.lessThanOrEquals("minimumRed", minimumRed, maximumRed);
+ //>>includeEnd('debug');
+
+ red =
+ minimumRed + Math$1.CesiumMath.nextRandomNumber() * (maximumRed - minimumRed);
+ }
+
+ let green = options.green;
+ if (!defaultValue.defined(green)) {
+ const minimumGreen = defaultValue.defaultValue(options.minimumGreen, 0);
+ const maximumGreen = defaultValue.defaultValue(options.maximumGreen, 1.0);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.lessThanOrEquals(
+ "minimumGreen",
+ minimumGreen,
+ maximumGreen
+ );
+ //>>includeEnd('debug');
+ green =
+ minimumGreen +
+ Math$1.CesiumMath.nextRandomNumber() * (maximumGreen - minimumGreen);
+ }
+
+ let blue = options.blue;
+ if (!defaultValue.defined(blue)) {
+ const minimumBlue = defaultValue.defaultValue(options.minimumBlue, 0);
+ const maximumBlue = defaultValue.defaultValue(options.maximumBlue, 1.0);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.lessThanOrEquals(
+ "minimumBlue",
+ minimumBlue,
+ maximumBlue
+ );
+ //>>includeEnd('debug');
+
+ blue =
+ minimumBlue + Math$1.CesiumMath.nextRandomNumber() * (maximumBlue - minimumBlue);
+ }
+
+ let alpha = options.alpha;
+ if (!defaultValue.defined(alpha)) {
+ const minimumAlpha = defaultValue.defaultValue(options.minimumAlpha, 0);
+ const maximumAlpha = defaultValue.defaultValue(options.maximumAlpha, 1.0);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.lessThanOrEquals(
+ "minumumAlpha",
+ minimumAlpha,
+ maximumAlpha
+ );
+ //>>includeEnd('debug');
+
+ alpha =
+ minimumAlpha +
+ Math$1.CesiumMath.nextRandomNumber() * (maximumAlpha - minimumAlpha);
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Color(red, green, blue, alpha);
+ }
+
+ result.red = red;
+ result.green = green;
+ result.blue = blue;
+ result.alpha = alpha;
+ return result;
+ };
+
+ //#rgba
+ const rgbaMatcher = /^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i;
+ //#rrggbbaa
+ const rrggbbaaMatcher = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i;
+ //rgb(), rgba(), or rgb%()
+ const rgbParenthesesMatcher = /^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i;
+ //hsl() or hsla()
+ const hslParenthesesMatcher = /^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;
+
+ /**
+ * Creates a Color instance from a CSS color value.
+ *
+ * @param {String} color The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format.
+ * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
+ * @returns {Color} The color object, or undefined if the string was not a valid CSS color.
+ *
+ *
+ * @example
+ * const cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');
+ * const green = Cesium.Color.fromCssColorString('green');
+ *
+ * @see {@link http://www.w3.org/TR/css3-color|CSS color values}
+ */
+ Color.fromCssColorString = function (color, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.string("color", color);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Color();
+ }
+
+ // Remove all whitespaces from the color string
+ color = color.replace(/\s/g, "");
+
+ const namedColor = Color[color.toUpperCase()];
+ if (defaultValue.defined(namedColor)) {
+ Color.clone(namedColor, result);
+ return result;
+ }
+
+ let matches = rgbaMatcher.exec(color);
+ if (matches !== null) {
+ result.red = parseInt(matches[1], 16) / 15;
+ result.green = parseInt(matches[2], 16) / 15.0;
+ result.blue = parseInt(matches[3], 16) / 15.0;
+ result.alpha = parseInt(defaultValue.defaultValue(matches[4], "f"), 16) / 15.0;
+ return result;
+ }
+
+ matches = rrggbbaaMatcher.exec(color);
+ if (matches !== null) {
+ result.red = parseInt(matches[1], 16) / 255.0;
+ result.green = parseInt(matches[2], 16) / 255.0;
+ result.blue = parseInt(matches[3], 16) / 255.0;
+ result.alpha = parseInt(defaultValue.defaultValue(matches[4], "ff"), 16) / 255.0;
+ return result;
+ }
+
+ matches = rgbParenthesesMatcher.exec(color);
+ if (matches !== null) {
+ result.red =
+ parseFloat(matches[1]) / ("%" === matches[1].substr(-1) ? 100.0 : 255.0);
+ result.green =
+ parseFloat(matches[2]) / ("%" === matches[2].substr(-1) ? 100.0 : 255.0);
+ result.blue =
+ parseFloat(matches[3]) / ("%" === matches[3].substr(-1) ? 100.0 : 255.0);
+ result.alpha = parseFloat(defaultValue.defaultValue(matches[4], "1.0"));
+ return result;
+ }
+
+ matches = hslParenthesesMatcher.exec(color);
+ if (matches !== null) {
+ return Color.fromHsl(
+ parseFloat(matches[1]) / 360.0,
+ parseFloat(matches[2]) / 100.0,
+ parseFloat(matches[3]) / 100.0,
+ parseFloat(defaultValue.defaultValue(matches[4], "1.0")),
+ result
+ );
+ }
+
+ result = undefined;
+ return result;
+ };
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ Color.packedLength = 4;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {Color} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ Color.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+ array[startingIndex++] = value.red;
+ array[startingIndex++] = value.green;
+ array[startingIndex++] = value.blue;
+ array[startingIndex] = value.alpha;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {Color} [result] The object into which to store the result.
+ * @returns {Color} The modified result parameter or a new Color instance if one was not provided.
+ */
+ Color.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+ if (!defaultValue.defined(result)) {
+ result = new Color();
+ }
+ result.red = array[startingIndex++];
+ result.green = array[startingIndex++];
+ result.blue = array[startingIndex++];
+ result.alpha = array[startingIndex];
+ return result;
+ };
+
+ /**
+ * Converts a 'byte' color component in the range of 0 to 255 into
+ * a 'float' color component in the range of 0 to 1.0.
+ *
+ * @param {Number} number The number to be converted.
+ * @returns {Number} The converted number.
+ */
+ Color.byteToFloat = function (number) {
+ return number / 255.0;
+ };
+
+ /**
+ * Converts a 'float' color component in the range of 0 to 1.0 into
+ * a 'byte' color component in the range of 0 to 255.
+ *
+ * @param {Number} number The number to be converted.
+ * @returns {Number} The converted number.
+ */
+ Color.floatToByte = function (number) {
+ return number === 1.0 ? 255.0 : (number * 256.0) | 0;
+ };
+
+ /**
+ * Duplicates a Color.
+ *
+ * @param {Color} color The Color to duplicate.
+ * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
+ * @returns {Color} The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)
+ */
+ Color.clone = function (color, result) {
+ if (!defaultValue.defined(color)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ return new Color(color.red, color.green, color.blue, color.alpha);
+ }
+ result.red = color.red;
+ result.green = color.green;
+ result.blue = color.blue;
+ result.alpha = color.alpha;
+ return result;
+ };
+
+ /**
+ * Returns true if the first Color equals the second color.
+ *
+ * @param {Color} left The first Color to compare for equality.
+ * @param {Color} right The second Color to compare for equality.
+ * @returns {Boolean} true
if the Colors are equal; otherwise, false
.
+ */
+ Color.equals = function (left, right) {
+ return (
+ left === right || //
+ (defaultValue.defined(left) && //
+ defaultValue.defined(right) && //
+ left.red === right.red && //
+ left.green === right.green && //
+ left.blue === right.blue && //
+ left.alpha === right.alpha)
+ );
+ };
+
+ /**
+ * @private
+ */
+ Color.equalsArray = function (color, array, offset) {
+ return (
+ color.red === array[offset] &&
+ color.green === array[offset + 1] &&
+ color.blue === array[offset + 2] &&
+ color.alpha === array[offset + 3]
+ );
+ };
+
+ /**
+ * Returns a duplicate of a Color instance.
+ *
+ * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
+ * @returns {Color} The modified result parameter or a new instance if result was undefined.
+ */
+ Color.prototype.clone = function (result) {
+ return Color.clone(this, result);
+ };
+
+ /**
+ * Returns true if this Color equals other.
+ *
+ * @param {Color} other The Color to compare for equality.
+ * @returns {Boolean} true
if the Colors are equal; otherwise, false
.
+ */
+ Color.prototype.equals = function (other) {
+ return Color.equals(this, other);
+ };
+
+ /**
+ * Returns true
if this Color equals other componentwise within the specified epsilon.
+ *
+ * @param {Color} other The Color to compare for equality.
+ * @param {Number} [epsilon=0.0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if the Colors are equal within the specified epsilon; otherwise, false
.
+ */
+ Color.prototype.equalsEpsilon = function (other, epsilon) {
+ return (
+ this === other || //
+ (defaultValue.defined(other) && //
+ Math.abs(this.red - other.red) <= epsilon && //
+ Math.abs(this.green - other.green) <= epsilon && //
+ Math.abs(this.blue - other.blue) <= epsilon && //
+ Math.abs(this.alpha - other.alpha) <= epsilon)
+ );
+ };
+
+ /**
+ * Creates a string representing this Color in the format '(red, green, blue, alpha)'.
+ *
+ * @returns {String} A string representing this Color in the format '(red, green, blue, alpha)'.
+ */
+ Color.prototype.toString = function () {
+ return `(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;
+ };
+
+ /**
+ * Creates a string containing the CSS color value for this color.
+ *
+ * @returns {String} The CSS equivalent of this color.
+ *
+ * @see {@link http://www.w3.org/TR/css3-color/#rgba-color|CSS RGB or RGBA color values}
+ */
+ Color.prototype.toCssColorString = function () {
+ const red = Color.floatToByte(this.red);
+ const green = Color.floatToByte(this.green);
+ const blue = Color.floatToByte(this.blue);
+ if (this.alpha === 1) {
+ return `rgb(${red},${green},${blue})`;
+ }
+ return `rgba(${red},${green},${blue},${this.alpha})`;
+ };
+
+ /**
+ * Creates a string containing CSS hex string color value for this color.
+ *
+ * @returns {String} The CSS hex string equivalent of this color.
+ */
+ Color.prototype.toCssHexString = function () {
+ let r = Color.floatToByte(this.red).toString(16);
+ if (r.length < 2) {
+ r = `0${r}`;
+ }
+ let g = Color.floatToByte(this.green).toString(16);
+ if (g.length < 2) {
+ g = `0${g}`;
+ }
+ let b = Color.floatToByte(this.blue).toString(16);
+ if (b.length < 2) {
+ b = `0${b}`;
+ }
+ if (this.alpha < 1) {
+ let hexAlpha = Color.floatToByte(this.alpha).toString(16);
+ if (hexAlpha.length < 2) {
+ hexAlpha = `0${hexAlpha}`;
+ }
+ return `#${r}${g}${b}${hexAlpha}`;
+ }
+ return `#${r}${g}${b}`;
+ };
+
+ /**
+ * Converts this color to an array of red, green, blue, and alpha values
+ * that are in the range of 0 to 255.
+ *
+ * @param {Number[]} [result] The array to store the result in, if undefined a new instance will be created.
+ * @returns {Number[]} The modified result parameter or a new instance if result was undefined.
+ */
+ Color.prototype.toBytes = function (result) {
+ const red = Color.floatToByte(this.red);
+ const green = Color.floatToByte(this.green);
+ const blue = Color.floatToByte(this.blue);
+ const alpha = Color.floatToByte(this.alpha);
+
+ if (!defaultValue.defined(result)) {
+ return [red, green, blue, alpha];
+ }
+ result[0] = red;
+ result[1] = green;
+ result[2] = blue;
+ result[3] = alpha;
+ return result;
+ };
+
+ /**
+ * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness
+ * of the system.
+ *
+ * @returns {Number} A single numeric unsigned 32-bit RGBA value.
+ *
+ *
+ * @example
+ * const rgba = Cesium.Color.BLUE.toRgba();
+ *
+ * @see Color.fromRgba
+ */
+ Color.prototype.toRgba = function () {
+ // scratchUint32Array and scratchUint8Array share an underlying array buffer
+ scratchUint8Array[0] = Color.floatToByte(this.red);
+ scratchUint8Array[1] = Color.floatToByte(this.green);
+ scratchUint8Array[2] = Color.floatToByte(this.blue);
+ scratchUint8Array[3] = Color.floatToByte(this.alpha);
+ return scratchUint32Array[0];
+ };
+
+ /**
+ * Brightens this color by the provided magnitude.
+ *
+ * @param {Number} magnitude A positive number indicating the amount to brighten.
+ * @param {Color} result The object onto which to store the result.
+ * @returns {Color} The modified result parameter.
+ *
+ * @example
+ * const brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());
+ */
+ Color.prototype.brighten = function (magnitude, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("magnitude", magnitude);
+ Check.Check.typeOf.number.greaterThanOrEquals("magnitude", magnitude, 0.0);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ magnitude = 1.0 - magnitude;
+ result.red = 1.0 - (1.0 - this.red) * magnitude;
+ result.green = 1.0 - (1.0 - this.green) * magnitude;
+ result.blue = 1.0 - (1.0 - this.blue) * magnitude;
+ result.alpha = this.alpha;
+ return result;
+ };
+
+ /**
+ * Darkens this color by the provided magnitude.
+ *
+ * @param {Number} magnitude A positive number indicating the amount to darken.
+ * @param {Color} result The object onto which to store the result.
+ * @returns {Color} The modified result parameter.
+ *
+ * @example
+ * const darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());
+ */
+ Color.prototype.darken = function (magnitude, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("magnitude", magnitude);
+ Check.Check.typeOf.number.greaterThanOrEquals("magnitude", magnitude, 0.0);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ magnitude = 1.0 - magnitude;
+ result.red = this.red * magnitude;
+ result.green = this.green * magnitude;
+ result.blue = this.blue * magnitude;
+ result.alpha = this.alpha;
+ return result;
+ };
+
+ /**
+ * Creates a new Color that has the same red, green, and blue components
+ * as this Color, but with the specified alpha value.
+ *
+ * @param {Number} alpha The new alpha component.
+ * @param {Color} [result] The object onto which to store the result.
+ * @returns {Color} The modified result parameter or a new Color instance if one was not provided.
+ *
+ * @example const translucentRed = Cesium.Color.RED.withAlpha(0.9);
+ */
+ Color.prototype.withAlpha = function (alpha, result) {
+ return Color.fromAlpha(this, alpha, result);
+ };
+
+ /**
+ * Computes the componentwise sum of two Colors.
+ *
+ * @param {Color} left The first Color.
+ * @param {Color} right The second Color.
+ * @param {Color} result The object onto which to store the result.
+ * @returns {Color} The modified result parameter.
+ */
+ Color.add = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.red = left.red + right.red;
+ result.green = left.green + right.green;
+ result.blue = left.blue + right.blue;
+ result.alpha = left.alpha + right.alpha;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise difference of two Colors.
+ *
+ * @param {Color} left The first Color.
+ * @param {Color} right The second Color.
+ * @param {Color} result The object onto which to store the result.
+ * @returns {Color} The modified result parameter.
+ */
+ Color.subtract = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.red = left.red - right.red;
+ result.green = left.green - right.green;
+ result.blue = left.blue - right.blue;
+ result.alpha = left.alpha - right.alpha;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise product of two Colors.
+ *
+ * @param {Color} left The first Color.
+ * @param {Color} right The second Color.
+ * @param {Color} result The object onto which to store the result.
+ * @returns {Color} The modified result parameter.
+ */
+ Color.multiply = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.red = left.red * right.red;
+ result.green = left.green * right.green;
+ result.blue = left.blue * right.blue;
+ result.alpha = left.alpha * right.alpha;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise quotient of two Colors.
+ *
+ * @param {Color} left The first Color.
+ * @param {Color} right The second Color.
+ * @param {Color} result The object onto which to store the result.
+ * @returns {Color} The modified result parameter.
+ */
+ Color.divide = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.red = left.red / right.red;
+ result.green = left.green / right.green;
+ result.blue = left.blue / right.blue;
+ result.alpha = left.alpha / right.alpha;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise modulus of two Colors.
+ *
+ * @param {Color} left The first Color.
+ * @param {Color} right The second Color.
+ * @param {Color} result The object onto which to store the result.
+ * @returns {Color} The modified result parameter.
+ */
+ Color.mod = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.red = left.red % right.red;
+ result.green = left.green % right.green;
+ result.blue = left.blue % right.blue;
+ result.alpha = left.alpha % right.alpha;
+ return result;
+ };
+
+ /**
+ * Computes the linear interpolation or extrapolation at t between the provided colors.
+ *
+ * @param {Color} start The color corresponding to t at 0.0.
+ * @param {Color} end The color corresponding to t at 1.0.
+ * @param {Number} t The point along t at which to interpolate.
+ * @param {Color} result The object onto which to store the result.
+ * @returns {Color} The modified result parameter.
+ */
+ Color.lerp = function (start, end, t, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("start", start);
+ Check.Check.typeOf.object("end", end);
+ Check.Check.typeOf.number("t", t);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.red = Math$1.CesiumMath.lerp(start.red, end.red, t);
+ result.green = Math$1.CesiumMath.lerp(start.green, end.green, t);
+ result.blue = Math$1.CesiumMath.lerp(start.blue, end.blue, t);
+ result.alpha = Math$1.CesiumMath.lerp(start.alpha, end.alpha, t);
+ return result;
+ };
+
+ /**
+ * Multiplies the provided Color componentwise by the provided scalar.
+ *
+ * @param {Color} color The Color to be scaled.
+ * @param {Number} scalar The scalar to multiply with.
+ * @param {Color} result The object onto which to store the result.
+ * @returns {Color} The modified result parameter.
+ */
+ Color.multiplyByScalar = function (color, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("color", color);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.red = color.red * scalar;
+ result.green = color.green * scalar;
+ result.blue = color.blue * scalar;
+ result.alpha = color.alpha * scalar;
+ return result;
+ };
+
+ /**
+ * Divides the provided Color componentwise by the provided scalar.
+ *
+ * @param {Color} color The Color to be divided.
+ * @param {Number} scalar The scalar to divide with.
+ * @param {Color} result The object onto which to store the result.
+ * @returns {Color} The modified result parameter.
+ */
+ Color.divideByScalar = function (color, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("color", color);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.red = color.red / scalar;
+ result.green = color.green / scalar;
+ result.blue = color.blue / scalar;
+ result.alpha = color.alpha / scalar;
+ return result;
+ };
+
+ /**
+ * An immutable Color instance initialized to CSS color #F0F8FF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.ALICEBLUE = Object.freeze(Color.fromCssColorString("#F0F8FF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FAEBD7
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.ANTIQUEWHITE = Object.freeze(Color.fromCssColorString("#FAEBD7"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #00FFFF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.AQUA = Object.freeze(Color.fromCssColorString("#00FFFF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #7FFFD4
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.AQUAMARINE = Object.freeze(Color.fromCssColorString("#7FFFD4"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #F0FFFF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.AZURE = Object.freeze(Color.fromCssColorString("#F0FFFF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #F5F5DC
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.BEIGE = Object.freeze(Color.fromCssColorString("#F5F5DC"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFE4C4
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.BISQUE = Object.freeze(Color.fromCssColorString("#FFE4C4"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #000000
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.BLACK = Object.freeze(Color.fromCssColorString("#000000"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFEBCD
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.BLANCHEDALMOND = Object.freeze(Color.fromCssColorString("#FFEBCD"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #0000FF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.BLUE = Object.freeze(Color.fromCssColorString("#0000FF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #8A2BE2
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.BLUEVIOLET = Object.freeze(Color.fromCssColorString("#8A2BE2"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #A52A2A
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.BROWN = Object.freeze(Color.fromCssColorString("#A52A2A"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #DEB887
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.BURLYWOOD = Object.freeze(Color.fromCssColorString("#DEB887"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #5F9EA0
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.CADETBLUE = Object.freeze(Color.fromCssColorString("#5F9EA0"));
+ /**
+ * An immutable Color instance initialized to CSS color #7FFF00
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.CHARTREUSE = Object.freeze(Color.fromCssColorString("#7FFF00"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #D2691E
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.CHOCOLATE = Object.freeze(Color.fromCssColorString("#D2691E"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FF7F50
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.CORAL = Object.freeze(Color.fromCssColorString("#FF7F50"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #6495ED
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.CORNFLOWERBLUE = Object.freeze(Color.fromCssColorString("#6495ED"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFF8DC
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.CORNSILK = Object.freeze(Color.fromCssColorString("#FFF8DC"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #DC143C
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.CRIMSON = Object.freeze(Color.fromCssColorString("#DC143C"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #00FFFF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.CYAN = Object.freeze(Color.fromCssColorString("#00FFFF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #00008B
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKBLUE = Object.freeze(Color.fromCssColorString("#00008B"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #008B8B
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKCYAN = Object.freeze(Color.fromCssColorString("#008B8B"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #B8860B
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKGOLDENROD = Object.freeze(Color.fromCssColorString("#B8860B"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #A9A9A9
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKGRAY = Object.freeze(Color.fromCssColorString("#A9A9A9"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #006400
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKGREEN = Object.freeze(Color.fromCssColorString("#006400"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #A9A9A9
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKGREY = Color.DARKGRAY;
+
+ /**
+ * An immutable Color instance initialized to CSS color #BDB76B
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKKHAKI = Object.freeze(Color.fromCssColorString("#BDB76B"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #8B008B
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKMAGENTA = Object.freeze(Color.fromCssColorString("#8B008B"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #556B2F
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKOLIVEGREEN = Object.freeze(Color.fromCssColorString("#556B2F"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FF8C00
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKORANGE = Object.freeze(Color.fromCssColorString("#FF8C00"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #9932CC
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKORCHID = Object.freeze(Color.fromCssColorString("#9932CC"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #8B0000
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKRED = Object.freeze(Color.fromCssColorString("#8B0000"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #E9967A
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKSALMON = Object.freeze(Color.fromCssColorString("#E9967A"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #8FBC8F
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKSEAGREEN = Object.freeze(Color.fromCssColorString("#8FBC8F"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #483D8B
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKSLATEBLUE = Object.freeze(Color.fromCssColorString("#483D8B"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #2F4F4F
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKSLATEGRAY = Object.freeze(Color.fromCssColorString("#2F4F4F"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #2F4F4F
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKSLATEGREY = Color.DARKSLATEGRAY;
+
+ /**
+ * An immutable Color instance initialized to CSS color #00CED1
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKTURQUOISE = Object.freeze(Color.fromCssColorString("#00CED1"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #9400D3
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DARKVIOLET = Object.freeze(Color.fromCssColorString("#9400D3"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FF1493
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DEEPPINK = Object.freeze(Color.fromCssColorString("#FF1493"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #00BFFF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DEEPSKYBLUE = Object.freeze(Color.fromCssColorString("#00BFFF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #696969
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DIMGRAY = Object.freeze(Color.fromCssColorString("#696969"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #696969
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DIMGREY = Color.DIMGRAY;
+
+ /**
+ * An immutable Color instance initialized to CSS color #1E90FF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.DODGERBLUE = Object.freeze(Color.fromCssColorString("#1E90FF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #B22222
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.FIREBRICK = Object.freeze(Color.fromCssColorString("#B22222"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFFAF0
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.FLORALWHITE = Object.freeze(Color.fromCssColorString("#FFFAF0"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #228B22
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.FORESTGREEN = Object.freeze(Color.fromCssColorString("#228B22"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FF00FF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.FUCHSIA = Object.freeze(Color.fromCssColorString("#FF00FF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #DCDCDC
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.GAINSBORO = Object.freeze(Color.fromCssColorString("#DCDCDC"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #F8F8FF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.GHOSTWHITE = Object.freeze(Color.fromCssColorString("#F8F8FF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFD700
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.GOLD = Object.freeze(Color.fromCssColorString("#FFD700"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #DAA520
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.GOLDENROD = Object.freeze(Color.fromCssColorString("#DAA520"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #808080
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.GRAY = Object.freeze(Color.fromCssColorString("#808080"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #008000
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.GREEN = Object.freeze(Color.fromCssColorString("#008000"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #ADFF2F
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.GREENYELLOW = Object.freeze(Color.fromCssColorString("#ADFF2F"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #808080
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.GREY = Color.GRAY;
+
+ /**
+ * An immutable Color instance initialized to CSS color #F0FFF0
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.HONEYDEW = Object.freeze(Color.fromCssColorString("#F0FFF0"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FF69B4
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.HOTPINK = Object.freeze(Color.fromCssColorString("#FF69B4"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #CD5C5C
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.INDIANRED = Object.freeze(Color.fromCssColorString("#CD5C5C"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #4B0082
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.INDIGO = Object.freeze(Color.fromCssColorString("#4B0082"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFFFF0
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.IVORY = Object.freeze(Color.fromCssColorString("#FFFFF0"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #F0E68C
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.KHAKI = Object.freeze(Color.fromCssColorString("#F0E68C"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #E6E6FA
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LAVENDER = Object.freeze(Color.fromCssColorString("#E6E6FA"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFF0F5
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LAVENDAR_BLUSH = Object.freeze(Color.fromCssColorString("#FFF0F5"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #7CFC00
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LAWNGREEN = Object.freeze(Color.fromCssColorString("#7CFC00"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFFACD
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LEMONCHIFFON = Object.freeze(Color.fromCssColorString("#FFFACD"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #ADD8E6
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTBLUE = Object.freeze(Color.fromCssColorString("#ADD8E6"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #F08080
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTCORAL = Object.freeze(Color.fromCssColorString("#F08080"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #E0FFFF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTCYAN = Object.freeze(Color.fromCssColorString("#E0FFFF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FAFAD2
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTGOLDENRODYELLOW = Object.freeze(Color.fromCssColorString("#FAFAD2"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #D3D3D3
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTGRAY = Object.freeze(Color.fromCssColorString("#D3D3D3"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #90EE90
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTGREEN = Object.freeze(Color.fromCssColorString("#90EE90"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #D3D3D3
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTGREY = Color.LIGHTGRAY;
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFB6C1
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTPINK = Object.freeze(Color.fromCssColorString("#FFB6C1"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #20B2AA
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTSEAGREEN = Object.freeze(Color.fromCssColorString("#20B2AA"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #87CEFA
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTSKYBLUE = Object.freeze(Color.fromCssColorString("#87CEFA"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #778899
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTSLATEGRAY = Object.freeze(Color.fromCssColorString("#778899"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #778899
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTSLATEGREY = Color.LIGHTSLATEGRAY;
+
+ /**
+ * An immutable Color instance initialized to CSS color #B0C4DE
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTSTEELBLUE = Object.freeze(Color.fromCssColorString("#B0C4DE"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFFFE0
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIGHTYELLOW = Object.freeze(Color.fromCssColorString("#FFFFE0"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #00FF00
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIME = Object.freeze(Color.fromCssColorString("#00FF00"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #32CD32
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LIMEGREEN = Object.freeze(Color.fromCssColorString("#32CD32"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FAF0E6
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.LINEN = Object.freeze(Color.fromCssColorString("#FAF0E6"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FF00FF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MAGENTA = Object.freeze(Color.fromCssColorString("#FF00FF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #800000
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MAROON = Object.freeze(Color.fromCssColorString("#800000"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #66CDAA
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MEDIUMAQUAMARINE = Object.freeze(Color.fromCssColorString("#66CDAA"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #0000CD
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MEDIUMBLUE = Object.freeze(Color.fromCssColorString("#0000CD"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #BA55D3
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MEDIUMORCHID = Object.freeze(Color.fromCssColorString("#BA55D3"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #9370DB
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MEDIUMPURPLE = Object.freeze(Color.fromCssColorString("#9370DB"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #3CB371
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MEDIUMSEAGREEN = Object.freeze(Color.fromCssColorString("#3CB371"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #7B68EE
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MEDIUMSLATEBLUE = Object.freeze(Color.fromCssColorString("#7B68EE"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #00FA9A
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MEDIUMSPRINGGREEN = Object.freeze(Color.fromCssColorString("#00FA9A"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #48D1CC
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MEDIUMTURQUOISE = Object.freeze(Color.fromCssColorString("#48D1CC"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #C71585
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MEDIUMVIOLETRED = Object.freeze(Color.fromCssColorString("#C71585"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #191970
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MIDNIGHTBLUE = Object.freeze(Color.fromCssColorString("#191970"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #F5FFFA
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MINTCREAM = Object.freeze(Color.fromCssColorString("#F5FFFA"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFE4E1
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MISTYROSE = Object.freeze(Color.fromCssColorString("#FFE4E1"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFE4B5
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.MOCCASIN = Object.freeze(Color.fromCssColorString("#FFE4B5"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFDEAD
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.NAVAJOWHITE = Object.freeze(Color.fromCssColorString("#FFDEAD"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #000080
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.NAVY = Object.freeze(Color.fromCssColorString("#000080"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FDF5E6
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.OLDLACE = Object.freeze(Color.fromCssColorString("#FDF5E6"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #808000
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.OLIVE = Object.freeze(Color.fromCssColorString("#808000"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #6B8E23
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.OLIVEDRAB = Object.freeze(Color.fromCssColorString("#6B8E23"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFA500
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.ORANGE = Object.freeze(Color.fromCssColorString("#FFA500"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FF4500
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.ORANGERED = Object.freeze(Color.fromCssColorString("#FF4500"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #DA70D6
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.ORCHID = Object.freeze(Color.fromCssColorString("#DA70D6"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #EEE8AA
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.PALEGOLDENROD = Object.freeze(Color.fromCssColorString("#EEE8AA"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #98FB98
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.PALEGREEN = Object.freeze(Color.fromCssColorString("#98FB98"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #AFEEEE
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.PALETURQUOISE = Object.freeze(Color.fromCssColorString("#AFEEEE"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #DB7093
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.PALEVIOLETRED = Object.freeze(Color.fromCssColorString("#DB7093"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFEFD5
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.PAPAYAWHIP = Object.freeze(Color.fromCssColorString("#FFEFD5"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFDAB9
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.PEACHPUFF = Object.freeze(Color.fromCssColorString("#FFDAB9"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #CD853F
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.PERU = Object.freeze(Color.fromCssColorString("#CD853F"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFC0CB
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.PINK = Object.freeze(Color.fromCssColorString("#FFC0CB"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #DDA0DD
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.PLUM = Object.freeze(Color.fromCssColorString("#DDA0DD"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #B0E0E6
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.POWDERBLUE = Object.freeze(Color.fromCssColorString("#B0E0E6"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #800080
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.PURPLE = Object.freeze(Color.fromCssColorString("#800080"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FF0000
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.RED = Object.freeze(Color.fromCssColorString("#FF0000"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #BC8F8F
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.ROSYBROWN = Object.freeze(Color.fromCssColorString("#BC8F8F"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #4169E1
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.ROYALBLUE = Object.freeze(Color.fromCssColorString("#4169E1"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #8B4513
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SADDLEBROWN = Object.freeze(Color.fromCssColorString("#8B4513"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FA8072
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SALMON = Object.freeze(Color.fromCssColorString("#FA8072"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #F4A460
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SANDYBROWN = Object.freeze(Color.fromCssColorString("#F4A460"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #2E8B57
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SEAGREEN = Object.freeze(Color.fromCssColorString("#2E8B57"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFF5EE
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SEASHELL = Object.freeze(Color.fromCssColorString("#FFF5EE"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #A0522D
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SIENNA = Object.freeze(Color.fromCssColorString("#A0522D"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #C0C0C0
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SILVER = Object.freeze(Color.fromCssColorString("#C0C0C0"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #87CEEB
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SKYBLUE = Object.freeze(Color.fromCssColorString("#87CEEB"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #6A5ACD
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SLATEBLUE = Object.freeze(Color.fromCssColorString("#6A5ACD"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #708090
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SLATEGRAY = Object.freeze(Color.fromCssColorString("#708090"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #708090
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SLATEGREY = Color.SLATEGRAY;
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFFAFA
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SNOW = Object.freeze(Color.fromCssColorString("#FFFAFA"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #00FF7F
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.SPRINGGREEN = Object.freeze(Color.fromCssColorString("#00FF7F"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #4682B4
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.STEELBLUE = Object.freeze(Color.fromCssColorString("#4682B4"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #D2B48C
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.TAN = Object.freeze(Color.fromCssColorString("#D2B48C"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #008080
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.TEAL = Object.freeze(Color.fromCssColorString("#008080"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #D8BFD8
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.THISTLE = Object.freeze(Color.fromCssColorString("#D8BFD8"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FF6347
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.TOMATO = Object.freeze(Color.fromCssColorString("#FF6347"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #40E0D0
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.TURQUOISE = Object.freeze(Color.fromCssColorString("#40E0D0"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #EE82EE
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.VIOLET = Object.freeze(Color.fromCssColorString("#EE82EE"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #F5DEB3
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.WHEAT = Object.freeze(Color.fromCssColorString("#F5DEB3"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFFFFF
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.WHITE = Object.freeze(Color.fromCssColorString("#FFFFFF"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #F5F5F5
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.WHITESMOKE = Object.freeze(Color.fromCssColorString("#F5F5F5"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #FFFF00
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.YELLOW = Object.freeze(Color.fromCssColorString("#FFFF00"));
+
+ /**
+ * An immutable Color instance initialized to CSS color #9ACD32
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.YELLOWGREEN = Object.freeze(Color.fromCssColorString("#9ACD32"));
+
+ /**
+ * An immutable Color instance initialized to CSS transparent.
+ *
+ *
+ * @constant
+ * @type {Color}
+ */
+ Color.TRANSPARENT = Object.freeze(new Color(0, 0, 0, 0));
+
+ exports.Color = Color;
+
+}));
+//# sourceMappingURL=Color-c019c34b.js.map
diff --git a/examples/cesium/Workers/Color-c019c34b.js.map b/examples/cesium/Workers/Color-c019c34b.js.map
new file mode 100644
index 0000000..8902156
--- /dev/null
+++ b/examples/cesium/Workers/Color-c019c34b.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Color-c019c34b.js","sources":["../../../Source/Core/Color.js"],"sourcesContent":["import Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport FeatureDetection from \"./FeatureDetection.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\nfunction hue2rgb(m1, m2, h) {\r\n if (h < 0) {\r\n h += 1;\r\n }\r\n if (h > 1) {\r\n h -= 1;\r\n }\r\n if (h * 6 < 1) {\r\n return m1 + (m2 - m1) * 6 * h;\r\n }\r\n if (h * 2 < 1) {\r\n return m2;\r\n }\r\n if (h * 3 < 2) {\r\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\r\n }\r\n return m1;\r\n}\r\n\r\n/**\r\n * A color, specified using red, green, blue, and alpha values,\r\n * which range from 0
(no intensity) to 1.0
(full intensity).\r\n * @param {Number} [red=1.0] The red component.\r\n * @param {Number} [green=1.0] The green component.\r\n * @param {Number} [blue=1.0] The blue component.\r\n * @param {Number} [alpha=1.0] The alpha component.\r\n *\r\n * @constructor\r\n * @alias Color\r\n *\r\n * @see Packable\r\n */\r\nfunction Color(red, green, blue, alpha) {\r\n /**\r\n * The red component.\r\n * @type {Number}\r\n * @default 1.0\r\n */\r\n this.red = defaultValue(red, 1.0);\r\n /**\r\n * The green component.\r\n * @type {Number}\r\n * @default 1.0\r\n */\r\n this.green = defaultValue(green, 1.0);\r\n /**\r\n * The blue component.\r\n * @type {Number}\r\n * @default 1.0\r\n */\r\n this.blue = defaultValue(blue, 1.0);\r\n /**\r\n * The alpha component.\r\n * @type {Number}\r\n * @default 1.0\r\n */\r\n this.alpha = defaultValue(alpha, 1.0);\r\n}\r\n\r\n/**\r\n * Creates a Color instance from a {@link Cartesian4}. x
, y
, z
,\r\n * and w
map to red
, green
, blue
, and alpha
, respectively.\r\n *\r\n * @param {Cartesian4} cartesian The source cartesian.\r\n * @param {Color} [result] The object onto which to store the result.\r\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\r\n */\r\nColor.fromCartesian4 = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Color(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\r\n }\r\n\r\n result.red = cartesian.x;\r\n result.green = cartesian.y;\r\n result.blue = cartesian.z;\r\n result.alpha = cartesian.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a new Color specified using red, green, blue, and alpha values\r\n * that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.\r\n *\r\n * @param {Number} [red=255] The red component.\r\n * @param {Number} [green=255] The green component.\r\n * @param {Number} [blue=255] The blue component.\r\n * @param {Number} [alpha=255] The alpha component.\r\n * @param {Color} [result] The object onto which to store the result.\r\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\r\n */\r\nColor.fromBytes = function (red, green, blue, alpha, result) {\r\n red = Color.byteToFloat(defaultValue(red, 255.0));\r\n green = Color.byteToFloat(defaultValue(green, 255.0));\r\n blue = Color.byteToFloat(defaultValue(blue, 255.0));\r\n alpha = Color.byteToFloat(defaultValue(alpha, 255.0));\r\n\r\n if (!defined(result)) {\r\n return new Color(red, green, blue, alpha);\r\n }\r\n\r\n result.red = red;\r\n result.green = green;\r\n result.blue = blue;\r\n result.alpha = alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a new Color that has the same red, green, and blue components\r\n * of the specified color, but with the specified alpha value.\r\n *\r\n * @param {Color} color The base color\r\n * @param {Number} alpha The new alpha component.\r\n * @param {Color} [result] The object onto which to store the result.\r\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\r\n *\r\n * @example const translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);\r\n */\r\nColor.fromAlpha = function (color, alpha, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"color\", color);\r\n Check.typeOf.number(\"alpha\", alpha);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Color(color.red, color.green, color.blue, alpha);\r\n }\r\n\r\n result.red = color.red;\r\n result.green = color.green;\r\n result.blue = color.blue;\r\n result.alpha = alpha;\r\n return result;\r\n};\r\n\r\nlet scratchArrayBuffer;\r\nlet scratchUint32Array;\r\nlet scratchUint8Array;\r\nif (FeatureDetection.supportsTypedArrays()) {\r\n scratchArrayBuffer = new ArrayBuffer(4);\r\n scratchUint32Array = new Uint32Array(scratchArrayBuffer);\r\n scratchUint8Array = new Uint8Array(scratchArrayBuffer);\r\n}\r\n\r\n/**\r\n * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness\r\n * of the system.\r\n *\r\n * @param {Number} rgba A single numeric unsigned 32-bit RGBA value.\r\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\r\n * @returns {Color} The color object.\r\n *\r\n * @example\r\n * const color = Cesium.Color.fromRgba(0x67ADDFFF);\r\n *\r\n * @see Color#toRgba\r\n */\r\nColor.fromRgba = function (rgba, result) {\r\n // scratchUint32Array and scratchUint8Array share an underlying array buffer\r\n scratchUint32Array[0] = rgba;\r\n return Color.fromBytes(\r\n scratchUint8Array[0],\r\n scratchUint8Array[1],\r\n scratchUint8Array[2],\r\n scratchUint8Array[3],\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Creates a Color instance from hue, saturation, and lightness.\r\n *\r\n * @param {Number} [hue=0] The hue angle 0...1\r\n * @param {Number} [saturation=0] The saturation value 0...1\r\n * @param {Number} [lightness=0] The lightness value 0...1\r\n * @param {Number} [alpha=1.0] The alpha component 0...1\r\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\r\n * @returns {Color} The color object.\r\n *\r\n * @see {@link http://www.w3.org/TR/css3-color/#hsl-color|CSS color values}\r\n */\r\nColor.fromHsl = function (hue, saturation, lightness, alpha, result) {\r\n hue = defaultValue(hue, 0.0) % 1.0;\r\n saturation = defaultValue(saturation, 0.0);\r\n lightness = defaultValue(lightness, 0.0);\r\n alpha = defaultValue(alpha, 1.0);\r\n\r\n let red = lightness;\r\n let green = lightness;\r\n let blue = lightness;\r\n\r\n if (saturation !== 0) {\r\n let m2;\r\n if (lightness < 0.5) {\r\n m2 = lightness * (1 + saturation);\r\n } else {\r\n m2 = lightness + saturation - lightness * saturation;\r\n }\r\n\r\n const m1 = 2.0 * lightness - m2;\r\n red = hue2rgb(m1, m2, hue + 1 / 3);\r\n green = hue2rgb(m1, m2, hue);\r\n blue = hue2rgb(m1, m2, hue - 1 / 3);\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Color(red, green, blue, alpha);\r\n }\r\n\r\n result.red = red;\r\n result.green = green;\r\n result.blue = blue;\r\n result.alpha = alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a random color using the provided options. For reproducible random colors, you should\r\n * call {@link CesiumMath#setRandomNumberSeed} once at the beginning of your application.\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {Number} [options.red] If specified, the red component to use instead of a randomized value.\r\n * @param {Number} [options.minimumRed=0.0] The maximum red value to generate if none was specified.\r\n * @param {Number} [options.maximumRed=1.0] The minimum red value to generate if none was specified.\r\n * @param {Number} [options.green] If specified, the green component to use instead of a randomized value.\r\n * @param {Number} [options.minimumGreen=0.0] The maximum green value to generate if none was specified.\r\n * @param {Number} [options.maximumGreen=1.0] The minimum green value to generate if none was specified.\r\n * @param {Number} [options.blue] If specified, the blue component to use instead of a randomized value.\r\n * @param {Number} [options.minimumBlue=0.0] The maximum blue value to generate if none was specified.\r\n * @param {Number} [options.maximumBlue=1.0] The minimum blue value to generate if none was specified.\r\n * @param {Number} [options.alpha] If specified, the alpha component to use instead of a randomized value.\r\n * @param {Number} [options.minimumAlpha=0.0] The maximum alpha value to generate if none was specified.\r\n * @param {Number} [options.maximumAlpha=1.0] The minimum alpha value to generate if none was specified.\r\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\r\n * @returns {Color} The modified result parameter or a new instance if result was undefined.\r\n *\r\n * @exception {DeveloperError} minimumRed must be less than or equal to maximumRed.\r\n * @exception {DeveloperError} minimumGreen must be less than or equal to maximumGreen.\r\n * @exception {DeveloperError} minimumBlue must be less than or equal to maximumBlue.\r\n * @exception {DeveloperError} minimumAlpha must be less than or equal to maximumAlpha.\r\n *\r\n * @example\r\n * //Create a completely random color\r\n * const color = Cesium.Color.fromRandom();\r\n *\r\n * //Create a random shade of yellow.\r\n * const color1 = Cesium.Color.fromRandom({\r\n * red : 1.0,\r\n * green : 1.0,\r\n * alpha : 1.0\r\n * });\r\n *\r\n * //Create a random bright color.\r\n * const color2 = Cesium.Color.fromRandom({\r\n * minimumRed : 0.75,\r\n * minimumGreen : 0.75,\r\n * minimumBlue : 0.75,\r\n * alpha : 1.0\r\n * });\r\n */\r\nColor.fromRandom = function (options, result) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n let red = options.red;\r\n if (!defined(red)) {\r\n const minimumRed = defaultValue(options.minimumRed, 0);\r\n const maximumRed = defaultValue(options.maximumRed, 1.0);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.lessThanOrEquals(\"minimumRed\", minimumRed, maximumRed);\r\n //>>includeEnd('debug');\r\n\r\n red =\r\n minimumRed + CesiumMath.nextRandomNumber() * (maximumRed - minimumRed);\r\n }\r\n\r\n let green = options.green;\r\n if (!defined(green)) {\r\n const minimumGreen = defaultValue(options.minimumGreen, 0);\r\n const maximumGreen = defaultValue(options.maximumGreen, 1.0);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.lessThanOrEquals(\r\n \"minimumGreen\",\r\n minimumGreen,\r\n maximumGreen\r\n );\r\n //>>includeEnd('debug');\r\n green =\r\n minimumGreen +\r\n CesiumMath.nextRandomNumber() * (maximumGreen - minimumGreen);\r\n }\r\n\r\n let blue = options.blue;\r\n if (!defined(blue)) {\r\n const minimumBlue = defaultValue(options.minimumBlue, 0);\r\n const maximumBlue = defaultValue(options.maximumBlue, 1.0);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.lessThanOrEquals(\r\n \"minimumBlue\",\r\n minimumBlue,\r\n maximumBlue\r\n );\r\n //>>includeEnd('debug');\r\n\r\n blue =\r\n minimumBlue + CesiumMath.nextRandomNumber() * (maximumBlue - minimumBlue);\r\n }\r\n\r\n let alpha = options.alpha;\r\n if (!defined(alpha)) {\r\n const minimumAlpha = defaultValue(options.minimumAlpha, 0);\r\n const maximumAlpha = defaultValue(options.maximumAlpha, 1.0);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.lessThanOrEquals(\r\n \"minumumAlpha\",\r\n minimumAlpha,\r\n maximumAlpha\r\n );\r\n //>>includeEnd('debug');\r\n\r\n alpha =\r\n minimumAlpha +\r\n CesiumMath.nextRandomNumber() * (maximumAlpha - minimumAlpha);\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Color(red, green, blue, alpha);\r\n }\r\n\r\n result.red = red;\r\n result.green = green;\r\n result.blue = blue;\r\n result.alpha = alpha;\r\n return result;\r\n};\r\n\r\n//#rgba\r\nconst rgbaMatcher = /^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i;\r\n//#rrggbbaa\r\nconst rrggbbaaMatcher = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i;\r\n//rgb(), rgba(), or rgb%()\r\nconst rgbParenthesesMatcher = /^rgba?\\(\\s*([0-9.]+%?)\\s*,\\s*([0-9.]+%?)\\s*,\\s*([0-9.]+%?)(?:\\s*,\\s*([0-9.]+))?\\s*\\)$/i;\r\n//hsl() or hsla()\r\nconst hslParenthesesMatcher = /^hsla?\\(\\s*([0-9.]+)\\s*,\\s*([0-9.]+%)\\s*,\\s*([0-9.]+%)(?:\\s*,\\s*([0-9.]+))?\\s*\\)$/i;\r\n\r\n/**\r\n * Creates a Color instance from a CSS color value.\r\n *\r\n * @param {String} color The CSS color value in #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), or hsla() format.\r\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\r\n * @returns {Color} The color object, or undefined if the string was not a valid CSS color.\r\n *\r\n *\r\n * @example\r\n * const cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');\r\n * const green = Cesium.Color.fromCssColorString('green');\r\n *\r\n * @see {@link http://www.w3.org/TR/css3-color|CSS color values}\r\n */\r\nColor.fromCssColorString = function (color, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.string(\"color\", color);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Color();\r\n }\r\n\r\n // Remove all whitespaces from the color string\r\n color = color.replace(/\\s/g, \"\");\r\n\r\n const namedColor = Color[color.toUpperCase()];\r\n if (defined(namedColor)) {\r\n Color.clone(namedColor, result);\r\n return result;\r\n }\r\n\r\n let matches = rgbaMatcher.exec(color);\r\n if (matches !== null) {\r\n result.red = parseInt(matches[1], 16) / 15;\r\n result.green = parseInt(matches[2], 16) / 15.0;\r\n result.blue = parseInt(matches[3], 16) / 15.0;\r\n result.alpha = parseInt(defaultValue(matches[4], \"f\"), 16) / 15.0;\r\n return result;\r\n }\r\n\r\n matches = rrggbbaaMatcher.exec(color);\r\n if (matches !== null) {\r\n result.red = parseInt(matches[1], 16) / 255.0;\r\n result.green = parseInt(matches[2], 16) / 255.0;\r\n result.blue = parseInt(matches[3], 16) / 255.0;\r\n result.alpha = parseInt(defaultValue(matches[4], \"ff\"), 16) / 255.0;\r\n return result;\r\n }\r\n\r\n matches = rgbParenthesesMatcher.exec(color);\r\n if (matches !== null) {\r\n result.red =\r\n parseFloat(matches[1]) / (\"%\" === matches[1].substr(-1) ? 100.0 : 255.0);\r\n result.green =\r\n parseFloat(matches[2]) / (\"%\" === matches[2].substr(-1) ? 100.0 : 255.0);\r\n result.blue =\r\n parseFloat(matches[3]) / (\"%\" === matches[3].substr(-1) ? 100.0 : 255.0);\r\n result.alpha = parseFloat(defaultValue(matches[4], \"1.0\"));\r\n return result;\r\n }\r\n\r\n matches = hslParenthesesMatcher.exec(color);\r\n if (matches !== null) {\r\n return Color.fromHsl(\r\n parseFloat(matches[1]) / 360.0,\r\n parseFloat(matches[2]) / 100.0,\r\n parseFloat(matches[3]) / 100.0,\r\n parseFloat(defaultValue(matches[4], \"1.0\")),\r\n result\r\n );\r\n }\r\n\r\n result = undefined;\r\n return result;\r\n};\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nColor.packedLength = 4;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {Color} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nColor.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n array[startingIndex++] = value.red;\r\n array[startingIndex++] = value.green;\r\n array[startingIndex++] = value.blue;\r\n array[startingIndex] = value.alpha;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {Color} [result] The object into which to store the result.\r\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\r\n */\r\nColor.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n if (!defined(result)) {\r\n result = new Color();\r\n }\r\n result.red = array[startingIndex++];\r\n result.green = array[startingIndex++];\r\n result.blue = array[startingIndex++];\r\n result.alpha = array[startingIndex];\r\n return result;\r\n};\r\n\r\n/**\r\n * Converts a 'byte' color component in the range of 0 to 255 into\r\n * a 'float' color component in the range of 0 to 1.0.\r\n *\r\n * @param {Number} number The number to be converted.\r\n * @returns {Number} The converted number.\r\n */\r\nColor.byteToFloat = function (number) {\r\n return number / 255.0;\r\n};\r\n\r\n/**\r\n * Converts a 'float' color component in the range of 0 to 1.0 into\r\n * a 'byte' color component in the range of 0 to 255.\r\n *\r\n * @param {Number} number The number to be converted.\r\n * @returns {Number} The converted number.\r\n */\r\nColor.floatToByte = function (number) {\r\n return number === 1.0 ? 255.0 : (number * 256.0) | 0;\r\n};\r\n\r\n/**\r\n * Duplicates a Color.\r\n *\r\n * @param {Color} color The Color to duplicate.\r\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\r\n * @returns {Color} The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)\r\n */\r\nColor.clone = function (color, result) {\r\n if (!defined(color)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n return new Color(color.red, color.green, color.blue, color.alpha);\r\n }\r\n result.red = color.red;\r\n result.green = color.green;\r\n result.blue = color.blue;\r\n result.alpha = color.alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns true if the first Color equals the second color.\r\n *\r\n * @param {Color} left The first Color to compare for equality.\r\n * @param {Color} right The second Color to compare for equality.\r\n * @returns {Boolean} true
if the Colors are equal; otherwise, false
.\r\n */\r\nColor.equals = function (left, right) {\r\n return (\r\n left === right || //\r\n (defined(left) && //\r\n defined(right) && //\r\n left.red === right.red && //\r\n left.green === right.green && //\r\n left.blue === right.blue && //\r\n left.alpha === right.alpha)\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nColor.equalsArray = function (color, array, offset) {\r\n return (\r\n color.red === array[offset] &&\r\n color.green === array[offset + 1] &&\r\n color.blue === array[offset + 2] &&\r\n color.alpha === array[offset + 3]\r\n );\r\n};\r\n\r\n/**\r\n * Returns a duplicate of a Color instance.\r\n *\r\n * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.\r\n * @returns {Color} The modified result parameter or a new instance if result was undefined.\r\n */\r\nColor.prototype.clone = function (result) {\r\n return Color.clone(this, result);\r\n};\r\n\r\n/**\r\n * Returns true if this Color equals other.\r\n *\r\n * @param {Color} other The Color to compare for equality.\r\n * @returns {Boolean} true
if the Colors are equal; otherwise, false
.\r\n */\r\nColor.prototype.equals = function (other) {\r\n return Color.equals(this, other);\r\n};\r\n\r\n/**\r\n * Returns true
if this Color equals other componentwise within the specified epsilon.\r\n *\r\n * @param {Color} other The Color to compare for equality.\r\n * @param {Number} [epsilon=0.0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if the Colors are equal within the specified epsilon; otherwise, false
.\r\n */\r\nColor.prototype.equalsEpsilon = function (other, epsilon) {\r\n return (\r\n this === other || //\r\n (defined(other) && //\r\n Math.abs(this.red - other.red) <= epsilon && //\r\n Math.abs(this.green - other.green) <= epsilon && //\r\n Math.abs(this.blue - other.blue) <= epsilon && //\r\n Math.abs(this.alpha - other.alpha) <= epsilon)\r\n );\r\n};\r\n\r\n/**\r\n * Creates a string representing this Color in the format '(red, green, blue, alpha)'.\r\n *\r\n * @returns {String} A string representing this Color in the format '(red, green, blue, alpha)'.\r\n */\r\nColor.prototype.toString = function () {\r\n return `(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;\r\n};\r\n\r\n/**\r\n * Creates a string containing the CSS color value for this color.\r\n *\r\n * @returns {String} The CSS equivalent of this color.\r\n *\r\n * @see {@link http://www.w3.org/TR/css3-color/#rgba-color|CSS RGB or RGBA color values}\r\n */\r\nColor.prototype.toCssColorString = function () {\r\n const red = Color.floatToByte(this.red);\r\n const green = Color.floatToByte(this.green);\r\n const blue = Color.floatToByte(this.blue);\r\n if (this.alpha === 1) {\r\n return `rgb(${red},${green},${blue})`;\r\n }\r\n return `rgba(${red},${green},${blue},${this.alpha})`;\r\n};\r\n\r\n/**\r\n * Creates a string containing CSS hex string color value for this color.\r\n *\r\n * @returns {String} The CSS hex string equivalent of this color.\r\n */\r\nColor.prototype.toCssHexString = function () {\r\n let r = Color.floatToByte(this.red).toString(16);\r\n if (r.length < 2) {\r\n r = `0${r}`;\r\n }\r\n let g = Color.floatToByte(this.green).toString(16);\r\n if (g.length < 2) {\r\n g = `0${g}`;\r\n }\r\n let b = Color.floatToByte(this.blue).toString(16);\r\n if (b.length < 2) {\r\n b = `0${b}`;\r\n }\r\n if (this.alpha < 1) {\r\n let hexAlpha = Color.floatToByte(this.alpha).toString(16);\r\n if (hexAlpha.length < 2) {\r\n hexAlpha = `0${hexAlpha}`;\r\n }\r\n return `#${r}${g}${b}${hexAlpha}`;\r\n }\r\n return `#${r}${g}${b}`;\r\n};\r\n\r\n/**\r\n * Converts this color to an array of red, green, blue, and alpha values\r\n * that are in the range of 0 to 255.\r\n *\r\n * @param {Number[]} [result] The array to store the result in, if undefined a new instance will be created.\r\n * @returns {Number[]} The modified result parameter or a new instance if result was undefined.\r\n */\r\nColor.prototype.toBytes = function (result) {\r\n const red = Color.floatToByte(this.red);\r\n const green = Color.floatToByte(this.green);\r\n const blue = Color.floatToByte(this.blue);\r\n const alpha = Color.floatToByte(this.alpha);\r\n\r\n if (!defined(result)) {\r\n return [red, green, blue, alpha];\r\n }\r\n result[0] = red;\r\n result[1] = green;\r\n result[2] = blue;\r\n result[3] = alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness\r\n * of the system.\r\n *\r\n * @returns {Number} A single numeric unsigned 32-bit RGBA value.\r\n *\r\n *\r\n * @example\r\n * const rgba = Cesium.Color.BLUE.toRgba();\r\n *\r\n * @see Color.fromRgba\r\n */\r\nColor.prototype.toRgba = function () {\r\n // scratchUint32Array and scratchUint8Array share an underlying array buffer\r\n scratchUint8Array[0] = Color.floatToByte(this.red);\r\n scratchUint8Array[1] = Color.floatToByte(this.green);\r\n scratchUint8Array[2] = Color.floatToByte(this.blue);\r\n scratchUint8Array[3] = Color.floatToByte(this.alpha);\r\n return scratchUint32Array[0];\r\n};\r\n\r\n/**\r\n * Brightens this color by the provided magnitude.\r\n *\r\n * @param {Number} magnitude A positive number indicating the amount to brighten.\r\n * @param {Color} result The object onto which to store the result.\r\n * @returns {Color} The modified result parameter.\r\n *\r\n * @example\r\n * const brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());\r\n */\r\nColor.prototype.brighten = function (magnitude, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"magnitude\", magnitude);\r\n Check.typeOf.number.greaterThanOrEquals(\"magnitude\", magnitude, 0.0);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n magnitude = 1.0 - magnitude;\r\n result.red = 1.0 - (1.0 - this.red) * magnitude;\r\n result.green = 1.0 - (1.0 - this.green) * magnitude;\r\n result.blue = 1.0 - (1.0 - this.blue) * magnitude;\r\n result.alpha = this.alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Darkens this color by the provided magnitude.\r\n *\r\n * @param {Number} magnitude A positive number indicating the amount to darken.\r\n * @param {Color} result The object onto which to store the result.\r\n * @returns {Color} The modified result parameter.\r\n *\r\n * @example\r\n * const darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());\r\n */\r\nColor.prototype.darken = function (magnitude, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"magnitude\", magnitude);\r\n Check.typeOf.number.greaterThanOrEquals(\"magnitude\", magnitude, 0.0);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n magnitude = 1.0 - magnitude;\r\n result.red = this.red * magnitude;\r\n result.green = this.green * magnitude;\r\n result.blue = this.blue * magnitude;\r\n result.alpha = this.alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a new Color that has the same red, green, and blue components\r\n * as this Color, but with the specified alpha value.\r\n *\r\n * @param {Number} alpha The new alpha component.\r\n * @param {Color} [result] The object onto which to store the result.\r\n * @returns {Color} The modified result parameter or a new Color instance if one was not provided.\r\n *\r\n * @example const translucentRed = Cesium.Color.RED.withAlpha(0.9);\r\n */\r\nColor.prototype.withAlpha = function (alpha, result) {\r\n return Color.fromAlpha(this, alpha, result);\r\n};\r\n\r\n/**\r\n * Computes the componentwise sum of two Colors.\r\n *\r\n * @param {Color} left The first Color.\r\n * @param {Color} right The second Color.\r\n * @param {Color} result The object onto which to store the result.\r\n * @returns {Color} The modified result parameter.\r\n */\r\nColor.add = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.red = left.red + right.red;\r\n result.green = left.green + right.green;\r\n result.blue = left.blue + right.blue;\r\n result.alpha = left.alpha + right.alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise difference of two Colors.\r\n *\r\n * @param {Color} left The first Color.\r\n * @param {Color} right The second Color.\r\n * @param {Color} result The object onto which to store the result.\r\n * @returns {Color} The modified result parameter.\r\n */\r\nColor.subtract = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.red = left.red - right.red;\r\n result.green = left.green - right.green;\r\n result.blue = left.blue - right.blue;\r\n result.alpha = left.alpha - right.alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise product of two Colors.\r\n *\r\n * @param {Color} left The first Color.\r\n * @param {Color} right The second Color.\r\n * @param {Color} result The object onto which to store the result.\r\n * @returns {Color} The modified result parameter.\r\n */\r\nColor.multiply = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.red = left.red * right.red;\r\n result.green = left.green * right.green;\r\n result.blue = left.blue * right.blue;\r\n result.alpha = left.alpha * right.alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise quotient of two Colors.\r\n *\r\n * @param {Color} left The first Color.\r\n * @param {Color} right The second Color.\r\n * @param {Color} result The object onto which to store the result.\r\n * @returns {Color} The modified result parameter.\r\n */\r\nColor.divide = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.red = left.red / right.red;\r\n result.green = left.green / right.green;\r\n result.blue = left.blue / right.blue;\r\n result.alpha = left.alpha / right.alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise modulus of two Colors.\r\n *\r\n * @param {Color} left The first Color.\r\n * @param {Color} right The second Color.\r\n * @param {Color} result The object onto which to store the result.\r\n * @returns {Color} The modified result parameter.\r\n */\r\nColor.mod = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.red = left.red % right.red;\r\n result.green = left.green % right.green;\r\n result.blue = left.blue % right.blue;\r\n result.alpha = left.alpha % right.alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the linear interpolation or extrapolation at t between the provided colors.\r\n *\r\n * @param {Color} start The color corresponding to t at 0.0.\r\n * @param {Color} end The color corresponding to t at 1.0.\r\n * @param {Number} t The point along t at which to interpolate.\r\n * @param {Color} result The object onto which to store the result.\r\n * @returns {Color} The modified result parameter.\r\n */\r\nColor.lerp = function (start, end, t, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"start\", start);\r\n Check.typeOf.object(\"end\", end);\r\n Check.typeOf.number(\"t\", t);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.red = CesiumMath.lerp(start.red, end.red, t);\r\n result.green = CesiumMath.lerp(start.green, end.green, t);\r\n result.blue = CesiumMath.lerp(start.blue, end.blue, t);\r\n result.alpha = CesiumMath.lerp(start.alpha, end.alpha, t);\r\n return result;\r\n};\r\n\r\n/**\r\n * Multiplies the provided Color componentwise by the provided scalar.\r\n *\r\n * @param {Color} color The Color to be scaled.\r\n * @param {Number} scalar The scalar to multiply with.\r\n * @param {Color} result The object onto which to store the result.\r\n * @returns {Color} The modified result parameter.\r\n */\r\nColor.multiplyByScalar = function (color, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"color\", color);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.red = color.red * scalar;\r\n result.green = color.green * scalar;\r\n result.blue = color.blue * scalar;\r\n result.alpha = color.alpha * scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Divides the provided Color componentwise by the provided scalar.\r\n *\r\n * @param {Color} color The Color to be divided.\r\n * @param {Number} scalar The scalar to divide with.\r\n * @param {Color} result The object onto which to store the result.\r\n * @returns {Color} The modified result parameter.\r\n */\r\nColor.divideByScalar = function (color, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"color\", color);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.red = color.red / scalar;\r\n result.green = color.green / scalar;\r\n result.blue = color.blue / scalar;\r\n result.alpha = color.alpha / scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F0F8FF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.ALICEBLUE = Object.freeze(Color.fromCssColorString(\"#F0F8FF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FAEBD7\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.ANTIQUEWHITE = Object.freeze(Color.fromCssColorString(\"#FAEBD7\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #00FFFF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.AQUA = Object.freeze(Color.fromCssColorString(\"#00FFFF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #7FFFD4\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.AQUAMARINE = Object.freeze(Color.fromCssColorString(\"#7FFFD4\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F0FFFF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.AZURE = Object.freeze(Color.fromCssColorString(\"#F0FFFF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F5F5DC\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.BEIGE = Object.freeze(Color.fromCssColorString(\"#F5F5DC\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFE4C4\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.BISQUE = Object.freeze(Color.fromCssColorString(\"#FFE4C4\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #000000\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.BLACK = Object.freeze(Color.fromCssColorString(\"#000000\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFEBCD\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.BLANCHEDALMOND = Object.freeze(Color.fromCssColorString(\"#FFEBCD\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #0000FF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.BLUE = Object.freeze(Color.fromCssColorString(\"#0000FF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #8A2BE2\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.BLUEVIOLET = Object.freeze(Color.fromCssColorString(\"#8A2BE2\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #A52A2A\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.BROWN = Object.freeze(Color.fromCssColorString(\"#A52A2A\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #DEB887\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.BURLYWOOD = Object.freeze(Color.fromCssColorString(\"#DEB887\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #5F9EA0\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.CADETBLUE = Object.freeze(Color.fromCssColorString(\"#5F9EA0\"));\r\n/**\r\n * An immutable Color instance initialized to CSS color #7FFF00\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.CHARTREUSE = Object.freeze(Color.fromCssColorString(\"#7FFF00\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #D2691E\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.CHOCOLATE = Object.freeze(Color.fromCssColorString(\"#D2691E\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FF7F50\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.CORAL = Object.freeze(Color.fromCssColorString(\"#FF7F50\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #6495ED\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.CORNFLOWERBLUE = Object.freeze(Color.fromCssColorString(\"#6495ED\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFF8DC\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.CORNSILK = Object.freeze(Color.fromCssColorString(\"#FFF8DC\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #DC143C\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.CRIMSON = Object.freeze(Color.fromCssColorString(\"#DC143C\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #00FFFF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.CYAN = Object.freeze(Color.fromCssColorString(\"#00FFFF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #00008B\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKBLUE = Object.freeze(Color.fromCssColorString(\"#00008B\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #008B8B\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKCYAN = Object.freeze(Color.fromCssColorString(\"#008B8B\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #B8860B\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKGOLDENROD = Object.freeze(Color.fromCssColorString(\"#B8860B\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #A9A9A9\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKGRAY = Object.freeze(Color.fromCssColorString(\"#A9A9A9\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #006400\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKGREEN = Object.freeze(Color.fromCssColorString(\"#006400\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #A9A9A9\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKGREY = Color.DARKGRAY;\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #BDB76B\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKKHAKI = Object.freeze(Color.fromCssColorString(\"#BDB76B\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #8B008B\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKMAGENTA = Object.freeze(Color.fromCssColorString(\"#8B008B\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #556B2F\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKOLIVEGREEN = Object.freeze(Color.fromCssColorString(\"#556B2F\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FF8C00\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKORANGE = Object.freeze(Color.fromCssColorString(\"#FF8C00\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #9932CC\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKORCHID = Object.freeze(Color.fromCssColorString(\"#9932CC\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #8B0000\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKRED = Object.freeze(Color.fromCssColorString(\"#8B0000\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #E9967A\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKSALMON = Object.freeze(Color.fromCssColorString(\"#E9967A\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #8FBC8F\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKSEAGREEN = Object.freeze(Color.fromCssColorString(\"#8FBC8F\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #483D8B\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKSLATEBLUE = Object.freeze(Color.fromCssColorString(\"#483D8B\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #2F4F4F\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKSLATEGRAY = Object.freeze(Color.fromCssColorString(\"#2F4F4F\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #2F4F4F\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKSLATEGREY = Color.DARKSLATEGRAY;\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #00CED1\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKTURQUOISE = Object.freeze(Color.fromCssColorString(\"#00CED1\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #9400D3\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DARKVIOLET = Object.freeze(Color.fromCssColorString(\"#9400D3\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FF1493\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DEEPPINK = Object.freeze(Color.fromCssColorString(\"#FF1493\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #00BFFF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DEEPSKYBLUE = Object.freeze(Color.fromCssColorString(\"#00BFFF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #696969\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DIMGRAY = Object.freeze(Color.fromCssColorString(\"#696969\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #696969\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DIMGREY = Color.DIMGRAY;\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #1E90FF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.DODGERBLUE = Object.freeze(Color.fromCssColorString(\"#1E90FF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #B22222\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.FIREBRICK = Object.freeze(Color.fromCssColorString(\"#B22222\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFFAF0\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.FLORALWHITE = Object.freeze(Color.fromCssColorString(\"#FFFAF0\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #228B22\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.FORESTGREEN = Object.freeze(Color.fromCssColorString(\"#228B22\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FF00FF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.FUCHSIA = Object.freeze(Color.fromCssColorString(\"#FF00FF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #DCDCDC\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.GAINSBORO = Object.freeze(Color.fromCssColorString(\"#DCDCDC\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F8F8FF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.GHOSTWHITE = Object.freeze(Color.fromCssColorString(\"#F8F8FF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFD700\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.GOLD = Object.freeze(Color.fromCssColorString(\"#FFD700\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #DAA520\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.GOLDENROD = Object.freeze(Color.fromCssColorString(\"#DAA520\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #808080\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.GRAY = Object.freeze(Color.fromCssColorString(\"#808080\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #008000\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.GREEN = Object.freeze(Color.fromCssColorString(\"#008000\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #ADFF2F\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.GREENYELLOW = Object.freeze(Color.fromCssColorString(\"#ADFF2F\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #808080\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.GREY = Color.GRAY;\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F0FFF0\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.HONEYDEW = Object.freeze(Color.fromCssColorString(\"#F0FFF0\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FF69B4\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.HOTPINK = Object.freeze(Color.fromCssColorString(\"#FF69B4\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #CD5C5C\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.INDIANRED = Object.freeze(Color.fromCssColorString(\"#CD5C5C\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #4B0082\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.INDIGO = Object.freeze(Color.fromCssColorString(\"#4B0082\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFFFF0\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.IVORY = Object.freeze(Color.fromCssColorString(\"#FFFFF0\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F0E68C\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.KHAKI = Object.freeze(Color.fromCssColorString(\"#F0E68C\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #E6E6FA\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LAVENDER = Object.freeze(Color.fromCssColorString(\"#E6E6FA\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFF0F5\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LAVENDAR_BLUSH = Object.freeze(Color.fromCssColorString(\"#FFF0F5\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #7CFC00\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LAWNGREEN = Object.freeze(Color.fromCssColorString(\"#7CFC00\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFFACD\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LEMONCHIFFON = Object.freeze(Color.fromCssColorString(\"#FFFACD\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #ADD8E6\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTBLUE = Object.freeze(Color.fromCssColorString(\"#ADD8E6\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F08080\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTCORAL = Object.freeze(Color.fromCssColorString(\"#F08080\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #E0FFFF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTCYAN = Object.freeze(Color.fromCssColorString(\"#E0FFFF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FAFAD2\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTGOLDENRODYELLOW = Object.freeze(Color.fromCssColorString(\"#FAFAD2\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #D3D3D3\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTGRAY = Object.freeze(Color.fromCssColorString(\"#D3D3D3\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #90EE90\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTGREEN = Object.freeze(Color.fromCssColorString(\"#90EE90\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #D3D3D3\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTGREY = Color.LIGHTGRAY;\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFB6C1\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTPINK = Object.freeze(Color.fromCssColorString(\"#FFB6C1\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #20B2AA\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTSEAGREEN = Object.freeze(Color.fromCssColorString(\"#20B2AA\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #87CEFA\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTSKYBLUE = Object.freeze(Color.fromCssColorString(\"#87CEFA\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #778899\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTSLATEGRAY = Object.freeze(Color.fromCssColorString(\"#778899\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #778899\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTSLATEGREY = Color.LIGHTSLATEGRAY;\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #B0C4DE\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTSTEELBLUE = Object.freeze(Color.fromCssColorString(\"#B0C4DE\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFFFE0\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIGHTYELLOW = Object.freeze(Color.fromCssColorString(\"#FFFFE0\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #00FF00\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIME = Object.freeze(Color.fromCssColorString(\"#00FF00\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #32CD32\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LIMEGREEN = Object.freeze(Color.fromCssColorString(\"#32CD32\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FAF0E6\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.LINEN = Object.freeze(Color.fromCssColorString(\"#FAF0E6\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FF00FF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MAGENTA = Object.freeze(Color.fromCssColorString(\"#FF00FF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #800000\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MAROON = Object.freeze(Color.fromCssColorString(\"#800000\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #66CDAA\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MEDIUMAQUAMARINE = Object.freeze(Color.fromCssColorString(\"#66CDAA\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #0000CD\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MEDIUMBLUE = Object.freeze(Color.fromCssColorString(\"#0000CD\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #BA55D3\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MEDIUMORCHID = Object.freeze(Color.fromCssColorString(\"#BA55D3\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #9370DB\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MEDIUMPURPLE = Object.freeze(Color.fromCssColorString(\"#9370DB\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #3CB371\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MEDIUMSEAGREEN = Object.freeze(Color.fromCssColorString(\"#3CB371\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #7B68EE\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MEDIUMSLATEBLUE = Object.freeze(Color.fromCssColorString(\"#7B68EE\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #00FA9A\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MEDIUMSPRINGGREEN = Object.freeze(Color.fromCssColorString(\"#00FA9A\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #48D1CC\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MEDIUMTURQUOISE = Object.freeze(Color.fromCssColorString(\"#48D1CC\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #C71585\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MEDIUMVIOLETRED = Object.freeze(Color.fromCssColorString(\"#C71585\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #191970\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MIDNIGHTBLUE = Object.freeze(Color.fromCssColorString(\"#191970\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F5FFFA\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MINTCREAM = Object.freeze(Color.fromCssColorString(\"#F5FFFA\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFE4E1\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MISTYROSE = Object.freeze(Color.fromCssColorString(\"#FFE4E1\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFE4B5\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.MOCCASIN = Object.freeze(Color.fromCssColorString(\"#FFE4B5\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFDEAD\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.NAVAJOWHITE = Object.freeze(Color.fromCssColorString(\"#FFDEAD\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #000080\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.NAVY = Object.freeze(Color.fromCssColorString(\"#000080\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FDF5E6\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.OLDLACE = Object.freeze(Color.fromCssColorString(\"#FDF5E6\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #808000\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.OLIVE = Object.freeze(Color.fromCssColorString(\"#808000\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #6B8E23\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.OLIVEDRAB = Object.freeze(Color.fromCssColorString(\"#6B8E23\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFA500\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.ORANGE = Object.freeze(Color.fromCssColorString(\"#FFA500\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FF4500\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.ORANGERED = Object.freeze(Color.fromCssColorString(\"#FF4500\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #DA70D6\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.ORCHID = Object.freeze(Color.fromCssColorString(\"#DA70D6\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #EEE8AA\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.PALEGOLDENROD = Object.freeze(Color.fromCssColorString(\"#EEE8AA\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #98FB98\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.PALEGREEN = Object.freeze(Color.fromCssColorString(\"#98FB98\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #AFEEEE\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.PALETURQUOISE = Object.freeze(Color.fromCssColorString(\"#AFEEEE\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #DB7093\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.PALEVIOLETRED = Object.freeze(Color.fromCssColorString(\"#DB7093\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFEFD5\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.PAPAYAWHIP = Object.freeze(Color.fromCssColorString(\"#FFEFD5\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFDAB9\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.PEACHPUFF = Object.freeze(Color.fromCssColorString(\"#FFDAB9\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #CD853F\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.PERU = Object.freeze(Color.fromCssColorString(\"#CD853F\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFC0CB\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.PINK = Object.freeze(Color.fromCssColorString(\"#FFC0CB\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #DDA0DD\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.PLUM = Object.freeze(Color.fromCssColorString(\"#DDA0DD\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #B0E0E6\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.POWDERBLUE = Object.freeze(Color.fromCssColorString(\"#B0E0E6\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #800080\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.PURPLE = Object.freeze(Color.fromCssColorString(\"#800080\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FF0000\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.RED = Object.freeze(Color.fromCssColorString(\"#FF0000\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #BC8F8F\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.ROSYBROWN = Object.freeze(Color.fromCssColorString(\"#BC8F8F\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #4169E1\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.ROYALBLUE = Object.freeze(Color.fromCssColorString(\"#4169E1\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #8B4513\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SADDLEBROWN = Object.freeze(Color.fromCssColorString(\"#8B4513\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FA8072\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SALMON = Object.freeze(Color.fromCssColorString(\"#FA8072\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F4A460\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SANDYBROWN = Object.freeze(Color.fromCssColorString(\"#F4A460\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #2E8B57\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SEAGREEN = Object.freeze(Color.fromCssColorString(\"#2E8B57\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFF5EE\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SEASHELL = Object.freeze(Color.fromCssColorString(\"#FFF5EE\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #A0522D\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SIENNA = Object.freeze(Color.fromCssColorString(\"#A0522D\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #C0C0C0\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SILVER = Object.freeze(Color.fromCssColorString(\"#C0C0C0\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #87CEEB\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SKYBLUE = Object.freeze(Color.fromCssColorString(\"#87CEEB\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #6A5ACD\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SLATEBLUE = Object.freeze(Color.fromCssColorString(\"#6A5ACD\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #708090\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SLATEGRAY = Object.freeze(Color.fromCssColorString(\"#708090\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #708090\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SLATEGREY = Color.SLATEGRAY;\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFFAFA\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SNOW = Object.freeze(Color.fromCssColorString(\"#FFFAFA\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #00FF7F\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.SPRINGGREEN = Object.freeze(Color.fromCssColorString(\"#00FF7F\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #4682B4\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.STEELBLUE = Object.freeze(Color.fromCssColorString(\"#4682B4\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #D2B48C\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.TAN = Object.freeze(Color.fromCssColorString(\"#D2B48C\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #008080\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.TEAL = Object.freeze(Color.fromCssColorString(\"#008080\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #D8BFD8\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.THISTLE = Object.freeze(Color.fromCssColorString(\"#D8BFD8\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FF6347\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.TOMATO = Object.freeze(Color.fromCssColorString(\"#FF6347\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #40E0D0\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.TURQUOISE = Object.freeze(Color.fromCssColorString(\"#40E0D0\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #EE82EE\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.VIOLET = Object.freeze(Color.fromCssColorString(\"#EE82EE\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F5DEB3\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.WHEAT = Object.freeze(Color.fromCssColorString(\"#F5DEB3\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFFFFF\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.WHITE = Object.freeze(Color.fromCssColorString(\"#FFFFFF\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #F5F5F5\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.WHITESMOKE = Object.freeze(Color.fromCssColorString(\"#F5F5F5\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #FFFF00\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.YELLOW = Object.freeze(Color.fromCssColorString(\"#FFFF00\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS color #9ACD32\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.YELLOWGREEN = Object.freeze(Color.fromCssColorString(\"#9ACD32\"));\r\n\r\n/**\r\n * An immutable Color instance initialized to CSS transparent.\r\n * \r\n *\r\n * @constant\r\n * @type {Color}\r\n */\r\nColor.TRANSPARENT = Object.freeze(new Color(0, 0, 0, 0));\r\nexport default Color;\r\n"],"names":["defaultValue","Check","defined","FeatureDetection","CesiumMath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,SAAS,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,CA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ACA;EACA;EACA;EACA;EACA;EACA,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAAC;AACvE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/ComponentDatatype-13a5630b.js b/examples/cesium/Workers/ComponentDatatype-13a5630b.js
new file mode 100644
index 0000000..d5271b9
--- /dev/null
+++ b/examples/cesium/Workers/ComponentDatatype-13a5630b.js
@@ -0,0 +1,367 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './defaultValue-0ab18f7d', './Check-d10e5f2e', './WebGLConstants-f27a5e29'], (function (exports, defaultValue, Check, WebGLConstants) { 'use strict';
+
+ /**
+ * WebGL component datatypes. Components are intrinsics,
+ * which form attributes, which form vertices.
+ *
+ * @enum {Number}
+ */
+ const ComponentDatatype = {
+ /**
+ * 8-bit signed byte corresponding to gl.BYTE
and the type
+ * of an element in Int8Array
.
+ *
+ * @type {Number}
+ * @constant
+ */
+ BYTE: WebGLConstants.WebGLConstants.BYTE,
+
+ /**
+ * 8-bit unsigned byte corresponding to UNSIGNED_BYTE
and the type
+ * of an element in Uint8Array
.
+ *
+ * @type {Number}
+ * @constant
+ */
+ UNSIGNED_BYTE: WebGLConstants.WebGLConstants.UNSIGNED_BYTE,
+
+ /**
+ * 16-bit signed short corresponding to SHORT
and the type
+ * of an element in Int16Array
.
+ *
+ * @type {Number}
+ * @constant
+ */
+ SHORT: WebGLConstants.WebGLConstants.SHORT,
+
+ /**
+ * 16-bit unsigned short corresponding to UNSIGNED_SHORT
and the type
+ * of an element in Uint16Array
.
+ *
+ * @type {Number}
+ * @constant
+ */
+ UNSIGNED_SHORT: WebGLConstants.WebGLConstants.UNSIGNED_SHORT,
+
+ /**
+ * 32-bit signed int corresponding to INT
and the type
+ * of an element in Int32Array
.
+ *
+ * @memberOf ComponentDatatype
+ *
+ * @type {Number}
+ * @constant
+ */
+ INT: WebGLConstants.WebGLConstants.INT,
+
+ /**
+ * 32-bit unsigned int corresponding to UNSIGNED_INT
and the type
+ * of an element in Uint32Array
.
+ *
+ * @memberOf ComponentDatatype
+ *
+ * @type {Number}
+ * @constant
+ */
+ UNSIGNED_INT: WebGLConstants.WebGLConstants.UNSIGNED_INT,
+
+ /**
+ * 32-bit floating-point corresponding to FLOAT
and the type
+ * of an element in Float32Array
.
+ *
+ * @type {Number}
+ * @constant
+ */
+ FLOAT: WebGLConstants.WebGLConstants.FLOAT,
+
+ /**
+ * 64-bit floating-point corresponding to gl.DOUBLE
(in Desktop OpenGL;
+ * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})
+ * and the type of an element in Float64Array
.
+ *
+ * @memberOf ComponentDatatype
+ *
+ * @type {Number}
+ * @constant
+ * @default 0x140A
+ */
+ DOUBLE: WebGLConstants.WebGLConstants.DOUBLE,
+ };
+
+ /**
+ * Returns the size, in bytes, of the corresponding datatype.
+ *
+ * @param {ComponentDatatype} componentDatatype The component datatype to get the size of.
+ * @returns {Number} The size in bytes.
+ *
+ * @exception {DeveloperError} componentDatatype is not a valid value.
+ *
+ * @example
+ * // Returns Int8Array.BYTES_PER_ELEMENT
+ * const size = Cesium.ComponentDatatype.getSizeInBytes(Cesium.ComponentDatatype.BYTE);
+ */
+ ComponentDatatype.getSizeInBytes = function (componentDatatype) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(componentDatatype)) {
+ throw new Check.DeveloperError("value is required.");
+ }
+ //>>includeEnd('debug');
+
+ switch (componentDatatype) {
+ case ComponentDatatype.BYTE:
+ return Int8Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.UNSIGNED_BYTE:
+ return Uint8Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.SHORT:
+ return Int16Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.UNSIGNED_SHORT:
+ return Uint16Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.INT:
+ return Int32Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.UNSIGNED_INT:
+ return Uint32Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.FLOAT:
+ return Float32Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.DOUBLE:
+ return Float64Array.BYTES_PER_ELEMENT;
+ //>>includeStart('debug', pragmas.debug);
+ default:
+ throw new Check.DeveloperError("componentDatatype is not a valid value.");
+ //>>includeEnd('debug');
+ }
+ };
+
+ /**
+ * Gets the {@link ComponentDatatype} for the provided TypedArray instance.
+ *
+ * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} array The typed array.
+ * @returns {ComponentDatatype} The ComponentDatatype for the provided array, or undefined if the array is not a TypedArray.
+ */
+ ComponentDatatype.fromTypedArray = function (array) {
+ if (array instanceof Int8Array) {
+ return ComponentDatatype.BYTE;
+ }
+ if (array instanceof Uint8Array) {
+ return ComponentDatatype.UNSIGNED_BYTE;
+ }
+ if (array instanceof Int16Array) {
+ return ComponentDatatype.SHORT;
+ }
+ if (array instanceof Uint16Array) {
+ return ComponentDatatype.UNSIGNED_SHORT;
+ }
+ if (array instanceof Int32Array) {
+ return ComponentDatatype.INT;
+ }
+ if (array instanceof Uint32Array) {
+ return ComponentDatatype.UNSIGNED_INT;
+ }
+ if (array instanceof Float32Array) {
+ return ComponentDatatype.FLOAT;
+ }
+ if (array instanceof Float64Array) {
+ return ComponentDatatype.DOUBLE;
+ }
+
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(
+ "array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array."
+ );
+ //>>includeEnd('debug');
+ };
+
+ /**
+ * Validates that the provided component datatype is a valid {@link ComponentDatatype}
+ *
+ * @param {ComponentDatatype} componentDatatype The component datatype to validate.
+ * @returns {Boolean} true
if the provided component datatype is a valid value; otherwise, false
.
+ *
+ * @example
+ * if (!Cesium.ComponentDatatype.validate(componentDatatype)) {
+ * throw new Cesium.DeveloperError('componentDatatype must be a valid value.');
+ * }
+ */
+ ComponentDatatype.validate = function (componentDatatype) {
+ return (
+ defaultValue.defined(componentDatatype) &&
+ (componentDatatype === ComponentDatatype.BYTE ||
+ componentDatatype === ComponentDatatype.UNSIGNED_BYTE ||
+ componentDatatype === ComponentDatatype.SHORT ||
+ componentDatatype === ComponentDatatype.UNSIGNED_SHORT ||
+ componentDatatype === ComponentDatatype.INT ||
+ componentDatatype === ComponentDatatype.UNSIGNED_INT ||
+ componentDatatype === ComponentDatatype.FLOAT ||
+ componentDatatype === ComponentDatatype.DOUBLE)
+ );
+ };
+
+ /**
+ * Creates a typed array corresponding to component data type.
+ *
+ * @param {ComponentDatatype} componentDatatype The component data type.
+ * @param {Number|Array} valuesOrLength The length of the array to create or an array.
+ * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array.
+ *
+ * @exception {DeveloperError} componentDatatype is not a valid value.
+ *
+ * @example
+ * // creates a Float32Array with length of 100
+ * const typedArray = Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT, 100);
+ */
+ ComponentDatatype.createTypedArray = function (
+ componentDatatype,
+ valuesOrLength
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(componentDatatype)) {
+ throw new Check.DeveloperError("componentDatatype is required.");
+ }
+ if (!defaultValue.defined(valuesOrLength)) {
+ throw new Check.DeveloperError("valuesOrLength is required.");
+ }
+ //>>includeEnd('debug');
+
+ switch (componentDatatype) {
+ case ComponentDatatype.BYTE:
+ return new Int8Array(valuesOrLength);
+ case ComponentDatatype.UNSIGNED_BYTE:
+ return new Uint8Array(valuesOrLength);
+ case ComponentDatatype.SHORT:
+ return new Int16Array(valuesOrLength);
+ case ComponentDatatype.UNSIGNED_SHORT:
+ return new Uint16Array(valuesOrLength);
+ case ComponentDatatype.INT:
+ return new Int32Array(valuesOrLength);
+ case ComponentDatatype.UNSIGNED_INT:
+ return new Uint32Array(valuesOrLength);
+ case ComponentDatatype.FLOAT:
+ return new Float32Array(valuesOrLength);
+ case ComponentDatatype.DOUBLE:
+ return new Float64Array(valuesOrLength);
+ //>>includeStart('debug', pragmas.debug);
+ default:
+ throw new Check.DeveloperError("componentDatatype is not a valid value.");
+ //>>includeEnd('debug');
+ }
+ };
+
+ /**
+ * Creates a typed view of an array of bytes.
+ *
+ * @param {ComponentDatatype} componentDatatype The type of the view to create.
+ * @param {ArrayBuffer} buffer The buffer storage to use for the view.
+ * @param {Number} [byteOffset] The offset, in bytes, to the first element in the view.
+ * @param {Number} [length] The number of elements in the view.
+ * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array view of the buffer.
+ *
+ * @exception {DeveloperError} componentDatatype is not a valid value.
+ */
+ ComponentDatatype.createArrayBufferView = function (
+ componentDatatype,
+ buffer,
+ byteOffset,
+ length
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(componentDatatype)) {
+ throw new Check.DeveloperError("componentDatatype is required.");
+ }
+ if (!defaultValue.defined(buffer)) {
+ throw new Check.DeveloperError("buffer is required.");
+ }
+ //>>includeEnd('debug');
+
+ byteOffset = defaultValue.defaultValue(byteOffset, 0);
+ length = defaultValue.defaultValue(
+ length,
+ (buffer.byteLength - byteOffset) /
+ ComponentDatatype.getSizeInBytes(componentDatatype)
+ );
+
+ switch (componentDatatype) {
+ case ComponentDatatype.BYTE:
+ return new Int8Array(buffer, byteOffset, length);
+ case ComponentDatatype.UNSIGNED_BYTE:
+ return new Uint8Array(buffer, byteOffset, length);
+ case ComponentDatatype.SHORT:
+ return new Int16Array(buffer, byteOffset, length);
+ case ComponentDatatype.UNSIGNED_SHORT:
+ return new Uint16Array(buffer, byteOffset, length);
+ case ComponentDatatype.INT:
+ return new Int32Array(buffer, byteOffset, length);
+ case ComponentDatatype.UNSIGNED_INT:
+ return new Uint32Array(buffer, byteOffset, length);
+ case ComponentDatatype.FLOAT:
+ return new Float32Array(buffer, byteOffset, length);
+ case ComponentDatatype.DOUBLE:
+ return new Float64Array(buffer, byteOffset, length);
+ //>>includeStart('debug', pragmas.debug);
+ default:
+ throw new Check.DeveloperError("componentDatatype is not a valid value.");
+ //>>includeEnd('debug');
+ }
+ };
+
+ /**
+ * Get the ComponentDatatype from its name.
+ *
+ * @param {String} name The name of the ComponentDatatype.
+ * @returns {ComponentDatatype} The ComponentDatatype.
+ *
+ * @exception {DeveloperError} name is not a valid value.
+ */
+ ComponentDatatype.fromName = function (name) {
+ switch (name) {
+ case "BYTE":
+ return ComponentDatatype.BYTE;
+ case "UNSIGNED_BYTE":
+ return ComponentDatatype.UNSIGNED_BYTE;
+ case "SHORT":
+ return ComponentDatatype.SHORT;
+ case "UNSIGNED_SHORT":
+ return ComponentDatatype.UNSIGNED_SHORT;
+ case "INT":
+ return ComponentDatatype.INT;
+ case "UNSIGNED_INT":
+ return ComponentDatatype.UNSIGNED_INT;
+ case "FLOAT":
+ return ComponentDatatype.FLOAT;
+ case "DOUBLE":
+ return ComponentDatatype.DOUBLE;
+ //>>includeStart('debug', pragmas.debug);
+ default:
+ throw new Check.DeveloperError("name is not a valid value.");
+ //>>includeEnd('debug');
+ }
+ };
+ var ComponentDatatype$1 = Object.freeze(ComponentDatatype);
+
+ exports.ComponentDatatype = ComponentDatatype$1;
+
+}));
+//# sourceMappingURL=ComponentDatatype-13a5630b.js.map
diff --git a/examples/cesium/Workers/ComponentDatatype-13a5630b.js.map b/examples/cesium/Workers/ComponentDatatype-13a5630b.js.map
new file mode 100644
index 0000000..a30ddfc
--- /dev/null
+++ b/examples/cesium/Workers/ComponentDatatype-13a5630b.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"ComponentDatatype-13a5630b.js","sources":["../../../Source/Core/ComponentDatatype.js"],"sourcesContent":["import defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport WebGLConstants from \"./WebGLConstants.js\";\r\n\r\n/**\r\n * WebGL component datatypes. Components are intrinsics,\r\n * which form attributes, which form vertices.\r\n *\r\n * @enum {Number}\r\n */\r\nconst ComponentDatatype = {\r\n /**\r\n * 8-bit signed byte corresponding to gl.BYTE
and the type\r\n * of an element in Int8Array
.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n BYTE: WebGLConstants.BYTE,\r\n\r\n /**\r\n * 8-bit unsigned byte corresponding to UNSIGNED_BYTE
and the type\r\n * of an element in Uint8Array
.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE,\r\n\r\n /**\r\n * 16-bit signed short corresponding to SHORT
and the type\r\n * of an element in Int16Array
.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n SHORT: WebGLConstants.SHORT,\r\n\r\n /**\r\n * 16-bit unsigned short corresponding to UNSIGNED_SHORT
and the type\r\n * of an element in Uint16Array
.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n UNSIGNED_SHORT: WebGLConstants.UNSIGNED_SHORT,\r\n\r\n /**\r\n * 32-bit signed int corresponding to INT
and the type\r\n * of an element in Int32Array
.\r\n *\r\n * @memberOf ComponentDatatype\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n INT: WebGLConstants.INT,\r\n\r\n /**\r\n * 32-bit unsigned int corresponding to UNSIGNED_INT
and the type\r\n * of an element in Uint32Array
.\r\n *\r\n * @memberOf ComponentDatatype\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n UNSIGNED_INT: WebGLConstants.UNSIGNED_INT,\r\n\r\n /**\r\n * 32-bit floating-point corresponding to FLOAT
and the type\r\n * of an element in Float32Array
.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n FLOAT: WebGLConstants.FLOAT,\r\n\r\n /**\r\n * 64-bit floating-point corresponding to gl.DOUBLE
(in Desktop OpenGL;\r\n * this is not supported in WebGL, and is emulated in Cesium via {@link GeometryPipeline.encodeAttribute})\r\n * and the type of an element in Float64Array
.\r\n *\r\n * @memberOf ComponentDatatype\r\n *\r\n * @type {Number}\r\n * @constant\r\n * @default 0x140A\r\n */\r\n DOUBLE: WebGLConstants.DOUBLE,\r\n};\r\n\r\n/**\r\n * Returns the size, in bytes, of the corresponding datatype.\r\n *\r\n * @param {ComponentDatatype} componentDatatype The component datatype to get the size of.\r\n * @returns {Number} The size in bytes.\r\n *\r\n * @exception {DeveloperError} componentDatatype is not a valid value.\r\n *\r\n * @example\r\n * // Returns Int8Array.BYTES_PER_ELEMENT\r\n * const size = Cesium.ComponentDatatype.getSizeInBytes(Cesium.ComponentDatatype.BYTE);\r\n */\r\nComponentDatatype.getSizeInBytes = function (componentDatatype) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(componentDatatype)) {\r\n throw new DeveloperError(\"value is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n switch (componentDatatype) {\r\n case ComponentDatatype.BYTE:\r\n return Int8Array.BYTES_PER_ELEMENT;\r\n case ComponentDatatype.UNSIGNED_BYTE:\r\n return Uint8Array.BYTES_PER_ELEMENT;\r\n case ComponentDatatype.SHORT:\r\n return Int16Array.BYTES_PER_ELEMENT;\r\n case ComponentDatatype.UNSIGNED_SHORT:\r\n return Uint16Array.BYTES_PER_ELEMENT;\r\n case ComponentDatatype.INT:\r\n return Int32Array.BYTES_PER_ELEMENT;\r\n case ComponentDatatype.UNSIGNED_INT:\r\n return Uint32Array.BYTES_PER_ELEMENT;\r\n case ComponentDatatype.FLOAT:\r\n return Float32Array.BYTES_PER_ELEMENT;\r\n case ComponentDatatype.DOUBLE:\r\n return Float64Array.BYTES_PER_ELEMENT;\r\n //>>includeStart('debug', pragmas.debug);\r\n default:\r\n throw new DeveloperError(\"componentDatatype is not a valid value.\");\r\n //>>includeEnd('debug');\r\n }\r\n};\r\n\r\n/**\r\n * Gets the {@link ComponentDatatype} for the provided TypedArray instance.\r\n *\r\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} array The typed array.\r\n * @returns {ComponentDatatype} The ComponentDatatype for the provided array, or undefined if the array is not a TypedArray.\r\n */\r\nComponentDatatype.fromTypedArray = function (array) {\r\n if (array instanceof Int8Array) {\r\n return ComponentDatatype.BYTE;\r\n }\r\n if (array instanceof Uint8Array) {\r\n return ComponentDatatype.UNSIGNED_BYTE;\r\n }\r\n if (array instanceof Int16Array) {\r\n return ComponentDatatype.SHORT;\r\n }\r\n if (array instanceof Uint16Array) {\r\n return ComponentDatatype.UNSIGNED_SHORT;\r\n }\r\n if (array instanceof Int32Array) {\r\n return ComponentDatatype.INT;\r\n }\r\n if (array instanceof Uint32Array) {\r\n return ComponentDatatype.UNSIGNED_INT;\r\n }\r\n if (array instanceof Float32Array) {\r\n return ComponentDatatype.FLOAT;\r\n }\r\n if (array instanceof Float64Array) {\r\n return ComponentDatatype.DOUBLE;\r\n }\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(\r\n \"array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.\"\r\n );\r\n //>>includeEnd('debug');\r\n};\r\n\r\n/**\r\n * Validates that the provided component datatype is a valid {@link ComponentDatatype}\r\n *\r\n * @param {ComponentDatatype} componentDatatype The component datatype to validate.\r\n * @returns {Boolean} true
if the provided component datatype is a valid value; otherwise, false
.\r\n *\r\n * @example\r\n * if (!Cesium.ComponentDatatype.validate(componentDatatype)) {\r\n * throw new Cesium.DeveloperError('componentDatatype must be a valid value.');\r\n * }\r\n */\r\nComponentDatatype.validate = function (componentDatatype) {\r\n return (\r\n defined(componentDatatype) &&\r\n (componentDatatype === ComponentDatatype.BYTE ||\r\n componentDatatype === ComponentDatatype.UNSIGNED_BYTE ||\r\n componentDatatype === ComponentDatatype.SHORT ||\r\n componentDatatype === ComponentDatatype.UNSIGNED_SHORT ||\r\n componentDatatype === ComponentDatatype.INT ||\r\n componentDatatype === ComponentDatatype.UNSIGNED_INT ||\r\n componentDatatype === ComponentDatatype.FLOAT ||\r\n componentDatatype === ComponentDatatype.DOUBLE)\r\n );\r\n};\r\n\r\n/**\r\n * Creates a typed array corresponding to component data type.\r\n *\r\n * @param {ComponentDatatype} componentDatatype The component data type.\r\n * @param {Number|Array} valuesOrLength The length of the array to create or an array.\r\n * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array.\r\n *\r\n * @exception {DeveloperError} componentDatatype is not a valid value.\r\n *\r\n * @example\r\n * // creates a Float32Array with length of 100\r\n * const typedArray = Cesium.ComponentDatatype.createTypedArray(Cesium.ComponentDatatype.FLOAT, 100);\r\n */\r\nComponentDatatype.createTypedArray = function (\r\n componentDatatype,\r\n valuesOrLength\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(componentDatatype)) {\r\n throw new DeveloperError(\"componentDatatype is required.\");\r\n }\r\n if (!defined(valuesOrLength)) {\r\n throw new DeveloperError(\"valuesOrLength is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n switch (componentDatatype) {\r\n case ComponentDatatype.BYTE:\r\n return new Int8Array(valuesOrLength);\r\n case ComponentDatatype.UNSIGNED_BYTE:\r\n return new Uint8Array(valuesOrLength);\r\n case ComponentDatatype.SHORT:\r\n return new Int16Array(valuesOrLength);\r\n case ComponentDatatype.UNSIGNED_SHORT:\r\n return new Uint16Array(valuesOrLength);\r\n case ComponentDatatype.INT:\r\n return new Int32Array(valuesOrLength);\r\n case ComponentDatatype.UNSIGNED_INT:\r\n return new Uint32Array(valuesOrLength);\r\n case ComponentDatatype.FLOAT:\r\n return new Float32Array(valuesOrLength);\r\n case ComponentDatatype.DOUBLE:\r\n return new Float64Array(valuesOrLength);\r\n //>>includeStart('debug', pragmas.debug);\r\n default:\r\n throw new DeveloperError(\"componentDatatype is not a valid value.\");\r\n //>>includeEnd('debug');\r\n }\r\n};\r\n\r\n/**\r\n * Creates a typed view of an array of bytes.\r\n *\r\n * @param {ComponentDatatype} componentDatatype The type of the view to create.\r\n * @param {ArrayBuffer} buffer The buffer storage to use for the view.\r\n * @param {Number} [byteOffset] The offset, in bytes, to the first element in the view.\r\n * @param {Number} [length] The number of elements in the view.\r\n * @returns {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} A typed array view of the buffer.\r\n *\r\n * @exception {DeveloperError} componentDatatype is not a valid value.\r\n */\r\nComponentDatatype.createArrayBufferView = function (\r\n componentDatatype,\r\n buffer,\r\n byteOffset,\r\n length\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(componentDatatype)) {\r\n throw new DeveloperError(\"componentDatatype is required.\");\r\n }\r\n if (!defined(buffer)) {\r\n throw new DeveloperError(\"buffer is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n byteOffset = defaultValue(byteOffset, 0);\r\n length = defaultValue(\r\n length,\r\n (buffer.byteLength - byteOffset) /\r\n ComponentDatatype.getSizeInBytes(componentDatatype)\r\n );\r\n\r\n switch (componentDatatype) {\r\n case ComponentDatatype.BYTE:\r\n return new Int8Array(buffer, byteOffset, length);\r\n case ComponentDatatype.UNSIGNED_BYTE:\r\n return new Uint8Array(buffer, byteOffset, length);\r\n case ComponentDatatype.SHORT:\r\n return new Int16Array(buffer, byteOffset, length);\r\n case ComponentDatatype.UNSIGNED_SHORT:\r\n return new Uint16Array(buffer, byteOffset, length);\r\n case ComponentDatatype.INT:\r\n return new Int32Array(buffer, byteOffset, length);\r\n case ComponentDatatype.UNSIGNED_INT:\r\n return new Uint32Array(buffer, byteOffset, length);\r\n case ComponentDatatype.FLOAT:\r\n return new Float32Array(buffer, byteOffset, length);\r\n case ComponentDatatype.DOUBLE:\r\n return new Float64Array(buffer, byteOffset, length);\r\n //>>includeStart('debug', pragmas.debug);\r\n default:\r\n throw new DeveloperError(\"componentDatatype is not a valid value.\");\r\n //>>includeEnd('debug');\r\n }\r\n};\r\n\r\n/**\r\n * Get the ComponentDatatype from its name.\r\n *\r\n * @param {String} name The name of the ComponentDatatype.\r\n * @returns {ComponentDatatype} The ComponentDatatype.\r\n *\r\n * @exception {DeveloperError} name is not a valid value.\r\n */\r\nComponentDatatype.fromName = function (name) {\r\n switch (name) {\r\n case \"BYTE\":\r\n return ComponentDatatype.BYTE;\r\n case \"UNSIGNED_BYTE\":\r\n return ComponentDatatype.UNSIGNED_BYTE;\r\n case \"SHORT\":\r\n return ComponentDatatype.SHORT;\r\n case \"UNSIGNED_SHORT\":\r\n return ComponentDatatype.UNSIGNED_SHORT;\r\n case \"INT\":\r\n return ComponentDatatype.INT;\r\n case \"UNSIGNED_INT\":\r\n return ComponentDatatype.UNSIGNED_INT;\r\n case \"FLOAT\":\r\n return ComponentDatatype.FLOAT;\r\n case \"DOUBLE\":\r\n return ComponentDatatype.DOUBLE;\r\n //>>includeStart('debug', pragmas.debug);\r\n default:\r\n throw new DeveloperError(\"name is not a valid value.\");\r\n //>>includeEnd('debug');\r\n }\r\n};\r\nexport default Object.freeze(ComponentDatatype);\r\n"],"names":["WebGLConstants","defined","DeveloperError","defaultValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,iBAAiB,GAAG;EAC1B;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,EAAEA,6BAAc,CAAC,IAAI;AAC3B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,aAAa,EAAEA,6BAAc,CAAC,aAAa;AAC7C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,KAAK,EAAEA,6BAAc,CAAC,KAAK;AAC7B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,cAAc,EAAEA,6BAAc,CAAC,cAAc;AAC/C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,GAAG,EAAEA,6BAAc,CAAC,GAAG;AACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,YAAY,EAAEA,6BAAc,CAAC,YAAY;AAC3C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,KAAK,EAAEA,6BAAc,CAAC,KAAK;AAC7B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,MAAM,EAAEA,6BAAc,CAAC,MAAM;EAC/B,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB,CAAC,cAAc,GAAG,UAAU,iBAAiB,EAAE;EAChE;EACA,EAAE,IAAI,CAACC,oBAAO,CAAC,iBAAiB,CAAC,EAAE;EACnC,IAAI,MAAM,IAAIC,oBAAc,CAAC,oBAAoB,CAAC,CAAC;EACnD,GAAG;EACH;AACA;EACA,EAAE,QAAQ,iBAAiB;EAC3B,IAAI,KAAK,iBAAiB,CAAC,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AC;AACF,4BAAe,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/CoplanarPolygonGeometryLibrary-dfba6465.js b/examples/cesium/Workers/CoplanarPolygonGeometryLibrary-dfba6465.js
new file mode 100644
index 0000000..f6895e3
--- /dev/null
+++ b/examples/cesium/Workers/CoplanarPolygonGeometryLibrary-dfba6465.js
@@ -0,0 +1,158 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './OrientedBoundingBox-7e2eebab'], (function (exports, Matrix2, Matrix3, Check, OrientedBoundingBox) { 'use strict';
+
+ /**
+ * @private
+ */
+ const CoplanarPolygonGeometryLibrary = {};
+
+ const scratchIntersectionPoint = new Matrix3.Cartesian3();
+ const scratchXAxis = new Matrix3.Cartesian3();
+ const scratchYAxis = new Matrix3.Cartesian3();
+ const scratchZAxis = new Matrix3.Cartesian3();
+ const obbScratch = new OrientedBoundingBox.OrientedBoundingBox();
+
+ CoplanarPolygonGeometryLibrary.validOutline = function (positions) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("positions", positions);
+ //>>includeEnd('debug');
+
+ const orientedBoundingBox = OrientedBoundingBox.OrientedBoundingBox.fromPoints(
+ positions,
+ obbScratch
+ );
+ const halfAxes = orientedBoundingBox.halfAxes;
+ const xAxis = Matrix3.Matrix3.getColumn(halfAxes, 0, scratchXAxis);
+ const yAxis = Matrix3.Matrix3.getColumn(halfAxes, 1, scratchYAxis);
+ const zAxis = Matrix3.Matrix3.getColumn(halfAxes, 2, scratchZAxis);
+
+ const xMag = Matrix3.Cartesian3.magnitude(xAxis);
+ const yMag = Matrix3.Cartesian3.magnitude(yAxis);
+ const zMag = Matrix3.Cartesian3.magnitude(zAxis);
+
+ // If all the points are on a line return undefined because we can't draw a polygon
+ return !(
+ (xMag === 0 && (yMag === 0 || zMag === 0)) ||
+ (yMag === 0 && zMag === 0)
+ );
+ };
+
+ // call after removeDuplicates
+ CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function (
+ positions,
+ centerResult,
+ planeAxis1Result,
+ planeAxis2Result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("positions", positions);
+ Check.Check.defined("centerResult", centerResult);
+ Check.Check.defined("planeAxis1Result", planeAxis1Result);
+ Check.Check.defined("planeAxis2Result", planeAxis2Result);
+ //>>includeEnd('debug');
+
+ const orientedBoundingBox = OrientedBoundingBox.OrientedBoundingBox.fromPoints(
+ positions,
+ obbScratch
+ );
+ const halfAxes = orientedBoundingBox.halfAxes;
+ const xAxis = Matrix3.Matrix3.getColumn(halfAxes, 0, scratchXAxis);
+ const yAxis = Matrix3.Matrix3.getColumn(halfAxes, 1, scratchYAxis);
+ const zAxis = Matrix3.Matrix3.getColumn(halfAxes, 2, scratchZAxis);
+
+ const xMag = Matrix3.Cartesian3.magnitude(xAxis);
+ const yMag = Matrix3.Cartesian3.magnitude(yAxis);
+ const zMag = Matrix3.Cartesian3.magnitude(zAxis);
+ const min = Math.min(xMag, yMag, zMag);
+
+ // If all the points are on a line return undefined because we can't draw a polygon
+ if (
+ (xMag === 0 && (yMag === 0 || zMag === 0)) ||
+ (yMag === 0 && zMag === 0)
+ ) {
+ return false;
+ }
+
+ let planeAxis1;
+ let planeAxis2;
+
+ if (min === yMag || min === zMag) {
+ planeAxis1 = xAxis;
+ }
+ if (min === xMag) {
+ planeAxis1 = yAxis;
+ } else if (min === zMag) {
+ planeAxis2 = yAxis;
+ }
+ if (min === xMag || min === yMag) {
+ planeAxis2 = zAxis;
+ }
+
+ Matrix3.Cartesian3.normalize(planeAxis1, planeAxis1Result);
+ Matrix3.Cartesian3.normalize(planeAxis2, planeAxis2Result);
+ Matrix3.Cartesian3.clone(orientedBoundingBox.center, centerResult);
+ return true;
+ };
+
+ function projectTo2D(position, center, axis1, axis2, result) {
+ const v = Matrix3.Cartesian3.subtract(position, center, scratchIntersectionPoint);
+ const x = Matrix3.Cartesian3.dot(axis1, v);
+ const y = Matrix3.Cartesian3.dot(axis2, v);
+
+ return Matrix2.Cartesian2.fromElements(x, y, result);
+ }
+
+ CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function (
+ center,
+ axis1,
+ axis2
+ ) {
+ return function (positions) {
+ const positionResults = new Array(positions.length);
+ for (let i = 0; i < positions.length; i++) {
+ positionResults[i] = projectTo2D(positions[i], center, axis1, axis2);
+ }
+
+ return positionResults;
+ };
+ };
+
+ CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction = function (
+ center,
+ axis1,
+ axis2
+ ) {
+ return function (position, result) {
+ return projectTo2D(position, center, axis1, axis2, result);
+ };
+ };
+ var CoplanarPolygonGeometryLibrary$1 = CoplanarPolygonGeometryLibrary;
+
+ exports.CoplanarPolygonGeometryLibrary = CoplanarPolygonGeometryLibrary$1;
+
+}));
+//# sourceMappingURL=CoplanarPolygonGeometryLibrary-dfba6465.js.map
diff --git a/examples/cesium/Workers/CoplanarPolygonGeometryLibrary-dfba6465.js.map b/examples/cesium/Workers/CoplanarPolygonGeometryLibrary-dfba6465.js.map
new file mode 100644
index 0000000..5dd4c09
--- /dev/null
+++ b/examples/cesium/Workers/CoplanarPolygonGeometryLibrary-dfba6465.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"CoplanarPolygonGeometryLibrary-dfba6465.js","sources":["../../../Source/Core/CoplanarPolygonGeometryLibrary.js"],"sourcesContent":["import Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\r\n\r\n/**\r\n * @private\r\n */\r\nconst CoplanarPolygonGeometryLibrary = {};\r\n\r\nconst scratchIntersectionPoint = new Cartesian3();\r\nconst scratchXAxis = new Cartesian3();\r\nconst scratchYAxis = new Cartesian3();\r\nconst scratchZAxis = new Cartesian3();\r\nconst obbScratch = new OrientedBoundingBox();\r\n\r\nCoplanarPolygonGeometryLibrary.validOutline = function (positions) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"positions\", positions);\r\n //>>includeEnd('debug');\r\n\r\n const orientedBoundingBox = OrientedBoundingBox.fromPoints(\r\n positions,\r\n obbScratch\r\n );\r\n const halfAxes = orientedBoundingBox.halfAxes;\r\n const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);\r\n const yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);\r\n const zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);\r\n\r\n const xMag = Cartesian3.magnitude(xAxis);\r\n const yMag = Cartesian3.magnitude(yAxis);\r\n const zMag = Cartesian3.magnitude(zAxis);\r\n\r\n // If all the points are on a line return undefined because we can't draw a polygon\r\n return !(\r\n (xMag === 0 && (yMag === 0 || zMag === 0)) ||\r\n (yMag === 0 && zMag === 0)\r\n );\r\n};\r\n\r\n// call after removeDuplicates\r\nCoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function (\r\n positions,\r\n centerResult,\r\n planeAxis1Result,\r\n planeAxis2Result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"positions\", positions);\r\n Check.defined(\"centerResult\", centerResult);\r\n Check.defined(\"planeAxis1Result\", planeAxis1Result);\r\n Check.defined(\"planeAxis2Result\", planeAxis2Result);\r\n //>>includeEnd('debug');\r\n\r\n const orientedBoundingBox = OrientedBoundingBox.fromPoints(\r\n positions,\r\n obbScratch\r\n );\r\n const halfAxes = orientedBoundingBox.halfAxes;\r\n const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);\r\n const yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);\r\n const zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);\r\n\r\n const xMag = Cartesian3.magnitude(xAxis);\r\n const yMag = Cartesian3.magnitude(yAxis);\r\n const zMag = Cartesian3.magnitude(zAxis);\r\n const min = Math.min(xMag, yMag, zMag);\r\n\r\n // If all the points are on a line return undefined because we can't draw a polygon\r\n if (\r\n (xMag === 0 && (yMag === 0 || zMag === 0)) ||\r\n (yMag === 0 && zMag === 0)\r\n ) {\r\n return false;\r\n }\r\n\r\n let planeAxis1;\r\n let planeAxis2;\r\n\r\n if (min === yMag || min === zMag) {\r\n planeAxis1 = xAxis;\r\n }\r\n if (min === xMag) {\r\n planeAxis1 = yAxis;\r\n } else if (min === zMag) {\r\n planeAxis2 = yAxis;\r\n }\r\n if (min === xMag || min === yMag) {\r\n planeAxis2 = zAxis;\r\n }\r\n\r\n Cartesian3.normalize(planeAxis1, planeAxis1Result);\r\n Cartesian3.normalize(planeAxis2, planeAxis2Result);\r\n Cartesian3.clone(orientedBoundingBox.center, centerResult);\r\n return true;\r\n};\r\n\r\nfunction projectTo2D(position, center, axis1, axis2, result) {\r\n const v = Cartesian3.subtract(position, center, scratchIntersectionPoint);\r\n const x = Cartesian3.dot(axis1, v);\r\n const y = Cartesian3.dot(axis2, v);\r\n\r\n return Cartesian2.fromElements(x, y, result);\r\n}\r\n\r\nCoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function (\r\n center,\r\n axis1,\r\n axis2\r\n) {\r\n return function (positions) {\r\n const positionResults = new Array(positions.length);\r\n for (let i = 0; i < positions.length; i++) {\r\n positionResults[i] = projectTo2D(positions[i], center, axis1, axis2);\r\n }\r\n\r\n return positionResults;\r\n };\r\n};\r\n\r\nCoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction = function (\r\n center,\r\n axis1,\r\n axis2\r\n) {\r\n return function (position, result) {\r\n return projectTo2D(position, center, axis1, axis2, result);\r\n };\r\n};\r\nexport default CoplanarPolygonGeometryLibrary;\r\n"],"names":["Cartesian3","OrientedBoundingBox","Check","Matrix3","Cartesian2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAC1C;EACA,MAAM,wBAAwB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAClD,MAAM,YAAY,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACtC,MAAM,YAAY,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACtC,MAAM,YAAY,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACtC,MAAM,UAAU,GAAG,IAAIC,uCAAmB,EAAE,CAAC;AAC7C;EACA,8BAA8B,CAAC,YAAY,GAAG,UAAU,SAAS,EAAE;EACnE;EACA,EAAEC,WAAK,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;EACxC;AACA;EACA,EAAE,MAAM,mBAAmB,GAAGD,uCAAmB,CAAC,UAAU;EAC5D,IAAI,SAAS;EACb,IAAI,UAAU;EACd,GAAG,CAAC;EACJ,EAAE,MAAM,QAAQ,GAAG,mBAAmB,CAAC,QAAQ,CAAC;EAChD,EAAE,MAAM,KAAK,GAAGE,eAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;EAC7D,EAAE,MAAM,KAAK,GAAGA,eAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,YAAY,CAAC,CAAC;EAC7D,EAAE,MAAM,KAAK,GAAGA,eAAO,CAA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CAAC;AACF;EACA,8BAA8B,CAAC,8BAA8B,GAAG;EAChE,EAAE,MAAM;EACR,EAAE,KAAK;EACP,EAAE,KAAK;EACP,EAAE;EACF,EAAE,OAAO,UAAU,QAAQ,EAAE,MAAM,EAAE;EACrC,IAAI,OAAO,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;EAC/D,GAAG,CAAC;EACJ,CAAC,CAAC;AACF,yCAAe,8BAA8B;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/CorridorGeometryLibrary-152d0356.js b/examples/cesium/Workers/CorridorGeometryLibrary-152d0356.js
new file mode 100644
index 0000000..67ca0e8
--- /dev/null
+++ b/examples/cesium/Workers/CorridorGeometryLibrary-152d0356.js
@@ -0,0 +1,524 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './PolylineVolumeGeometryLibrary-eed2bdf7', './defaultValue-0ab18f7d', './Math-9be8b918', './PolylinePipeline-3c021236', './Transforms-11fb6b0a'], (function (exports, Matrix3, PolylineVolumeGeometryLibrary, defaultValue, Math$1, PolylinePipeline, Transforms) { 'use strict';
+
+ /**
+ * @private
+ */
+ const CorridorGeometryLibrary = {};
+
+ const scratch1 = new Matrix3.Cartesian3();
+ const scratch2 = new Matrix3.Cartesian3();
+ const scratch3 = new Matrix3.Cartesian3();
+ const scratch4 = new Matrix3.Cartesian3();
+
+ const scaleArray2 = [new Matrix3.Cartesian3(), new Matrix3.Cartesian3()];
+
+ const cartesian1 = new Matrix3.Cartesian3();
+ const cartesian2 = new Matrix3.Cartesian3();
+ const cartesian3 = new Matrix3.Cartesian3();
+ const cartesian4 = new Matrix3.Cartesian3();
+ const cartesian5 = new Matrix3.Cartesian3();
+ const cartesian6 = new Matrix3.Cartesian3();
+ const cartesian7 = new Matrix3.Cartesian3();
+ const cartesian8 = new Matrix3.Cartesian3();
+ const cartesian9 = new Matrix3.Cartesian3();
+ const cartesian10 = new Matrix3.Cartesian3();
+
+ const quaterion = new Transforms.Quaternion();
+ const rotMatrix = new Matrix3.Matrix3();
+ function computeRoundCorner(
+ cornerPoint,
+ startPoint,
+ endPoint,
+ cornerType,
+ leftIsOutside
+ ) {
+ const angle = Matrix3.Cartesian3.angleBetween(
+ Matrix3.Cartesian3.subtract(startPoint, cornerPoint, scratch1),
+ Matrix3.Cartesian3.subtract(endPoint, cornerPoint, scratch2)
+ );
+ const granularity =
+ cornerType === PolylineVolumeGeometryLibrary.CornerType.BEVELED
+ ? 1
+ : Math.ceil(angle / Math$1.CesiumMath.toRadians(5)) + 1;
+
+ const size = granularity * 3;
+ const array = new Array(size);
+
+ array[size - 3] = endPoint.x;
+ array[size - 2] = endPoint.y;
+ array[size - 1] = endPoint.z;
+
+ let m;
+ if (leftIsOutside) {
+ m = Matrix3.Matrix3.fromQuaternion(
+ Transforms.Quaternion.fromAxisAngle(
+ Matrix3.Cartesian3.negate(cornerPoint, scratch1),
+ angle / granularity,
+ quaterion
+ ),
+ rotMatrix
+ );
+ } else {
+ m = Matrix3.Matrix3.fromQuaternion(
+ Transforms.Quaternion.fromAxisAngle(cornerPoint, angle / granularity, quaterion),
+ rotMatrix
+ );
+ }
+
+ let index = 0;
+ startPoint = Matrix3.Cartesian3.clone(startPoint, scratch1);
+ for (let i = 0; i < granularity; i++) {
+ startPoint = Matrix3.Matrix3.multiplyByVector(m, startPoint, startPoint);
+ array[index++] = startPoint.x;
+ array[index++] = startPoint.y;
+ array[index++] = startPoint.z;
+ }
+
+ return array;
+ }
+
+ function addEndCaps(calculatedPositions) {
+ let cornerPoint = cartesian1;
+ let startPoint = cartesian2;
+ let endPoint = cartesian3;
+
+ let leftEdge = calculatedPositions[1];
+ startPoint = Matrix3.Cartesian3.fromArray(
+ calculatedPositions[1],
+ leftEdge.length - 3,
+ startPoint
+ );
+ endPoint = Matrix3.Cartesian3.fromArray(calculatedPositions[0], 0, endPoint);
+ cornerPoint = Matrix3.Cartesian3.midpoint(startPoint, endPoint, cornerPoint);
+ const firstEndCap = computeRoundCorner(
+ cornerPoint,
+ startPoint,
+ endPoint,
+ PolylineVolumeGeometryLibrary.CornerType.ROUNDED,
+ false
+ );
+
+ const length = calculatedPositions.length - 1;
+ const rightEdge = calculatedPositions[length - 1];
+ leftEdge = calculatedPositions[length];
+ startPoint = Matrix3.Cartesian3.fromArray(
+ rightEdge,
+ rightEdge.length - 3,
+ startPoint
+ );
+ endPoint = Matrix3.Cartesian3.fromArray(leftEdge, 0, endPoint);
+ cornerPoint = Matrix3.Cartesian3.midpoint(startPoint, endPoint, cornerPoint);
+ const lastEndCap = computeRoundCorner(
+ cornerPoint,
+ startPoint,
+ endPoint,
+ PolylineVolumeGeometryLibrary.CornerType.ROUNDED,
+ false
+ );
+
+ return [firstEndCap, lastEndCap];
+ }
+
+ function computeMiteredCorner(
+ position,
+ leftCornerDirection,
+ lastPoint,
+ leftIsOutside
+ ) {
+ let cornerPoint = scratch1;
+ if (leftIsOutside) {
+ cornerPoint = Matrix3.Cartesian3.add(position, leftCornerDirection, cornerPoint);
+ } else {
+ leftCornerDirection = Matrix3.Cartesian3.negate(
+ leftCornerDirection,
+ leftCornerDirection
+ );
+ cornerPoint = Matrix3.Cartesian3.add(position, leftCornerDirection, cornerPoint);
+ }
+ return [
+ cornerPoint.x,
+ cornerPoint.y,
+ cornerPoint.z,
+ lastPoint.x,
+ lastPoint.y,
+ lastPoint.z,
+ ];
+ }
+
+ function addShiftedPositions(positions, left, scalar, calculatedPositions) {
+ const rightPositions = new Array(positions.length);
+ const leftPositions = new Array(positions.length);
+ const scaledLeft = Matrix3.Cartesian3.multiplyByScalar(left, scalar, scratch1);
+ const scaledRight = Matrix3.Cartesian3.negate(scaledLeft, scratch2);
+ let rightIndex = 0;
+ let leftIndex = positions.length - 1;
+
+ for (let i = 0; i < positions.length; i += 3) {
+ const pos = Matrix3.Cartesian3.fromArray(positions, i, scratch3);
+ const rightPos = Matrix3.Cartesian3.add(pos, scaledRight, scratch4);
+ rightPositions[rightIndex++] = rightPos.x;
+ rightPositions[rightIndex++] = rightPos.y;
+ rightPositions[rightIndex++] = rightPos.z;
+
+ const leftPos = Matrix3.Cartesian3.add(pos, scaledLeft, scratch4);
+ leftPositions[leftIndex--] = leftPos.z;
+ leftPositions[leftIndex--] = leftPos.y;
+ leftPositions[leftIndex--] = leftPos.x;
+ }
+ calculatedPositions.push(rightPositions, leftPositions);
+
+ return calculatedPositions;
+ }
+
+ /**
+ * @private
+ */
+ CorridorGeometryLibrary.addAttribute = function (
+ attribute,
+ value,
+ front,
+ back
+ ) {
+ const x = value.x;
+ const y = value.y;
+ const z = value.z;
+ if (defaultValue.defined(front)) {
+ attribute[front] = x;
+ attribute[front + 1] = y;
+ attribute[front + 2] = z;
+ }
+ if (defaultValue.defined(back)) {
+ attribute[back] = z;
+ attribute[back - 1] = y;
+ attribute[back - 2] = x;
+ }
+ };
+
+ const scratchForwardProjection = new Matrix3.Cartesian3();
+ const scratchBackwardProjection = new Matrix3.Cartesian3();
+
+ /**
+ * @private
+ */
+ CorridorGeometryLibrary.computePositions = function (params) {
+ const granularity = params.granularity;
+ const positions = params.positions;
+ const ellipsoid = params.ellipsoid;
+ const width = params.width / 2;
+ const cornerType = params.cornerType;
+ const saveAttributes = params.saveAttributes;
+ let normal = cartesian1;
+ let forward = cartesian2;
+ let backward = cartesian3;
+ let left = cartesian4;
+ let cornerDirection = cartesian5;
+ let startPoint = cartesian6;
+ let previousPos = cartesian7;
+ let rightPos = cartesian8;
+ let leftPos = cartesian9;
+ let center = cartesian10;
+ let calculatedPositions = [];
+ const calculatedLefts = saveAttributes ? [] : undefined;
+ const calculatedNormals = saveAttributes ? [] : undefined;
+ let position = positions[0]; //add first point
+ let nextPosition = positions[1];
+
+ forward = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.subtract(nextPosition, position, forward),
+ forward
+ );
+ normal = ellipsoid.geodeticSurfaceNormal(position, normal);
+ left = Matrix3.Cartesian3.normalize(Matrix3.Cartesian3.cross(normal, forward, left), left);
+ if (saveAttributes) {
+ calculatedLefts.push(left.x, left.y, left.z);
+ calculatedNormals.push(normal.x, normal.y, normal.z);
+ }
+ previousPos = Matrix3.Cartesian3.clone(position, previousPos);
+ position = nextPosition;
+ backward = Matrix3.Cartesian3.negate(forward, backward);
+
+ let subdividedPositions;
+ const corners = [];
+ let i;
+ const length = positions.length;
+ for (i = 1; i < length - 1; i++) {
+ // add middle points and corners
+ normal = ellipsoid.geodeticSurfaceNormal(position, normal);
+ nextPosition = positions[i + 1];
+ forward = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.subtract(nextPosition, position, forward),
+ forward
+ );
+ cornerDirection = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.add(forward, backward, cornerDirection),
+ cornerDirection
+ );
+
+ const forwardProjection = Matrix3.Cartesian3.multiplyByScalar(
+ normal,
+ Matrix3.Cartesian3.dot(forward, normal),
+ scratchForwardProjection
+ );
+ Matrix3.Cartesian3.subtract(forward, forwardProjection, forwardProjection);
+ Matrix3.Cartesian3.normalize(forwardProjection, forwardProjection);
+
+ const backwardProjection = Matrix3.Cartesian3.multiplyByScalar(
+ normal,
+ Matrix3.Cartesian3.dot(backward, normal),
+ scratchBackwardProjection
+ );
+ Matrix3.Cartesian3.subtract(backward, backwardProjection, backwardProjection);
+ Matrix3.Cartesian3.normalize(backwardProjection, backwardProjection);
+
+ const doCorner = !Math$1.CesiumMath.equalsEpsilon(
+ Math.abs(Matrix3.Cartesian3.dot(forwardProjection, backwardProjection)),
+ 1.0,
+ Math$1.CesiumMath.EPSILON7
+ );
+
+ if (doCorner) {
+ cornerDirection = Matrix3.Cartesian3.cross(
+ cornerDirection,
+ normal,
+ cornerDirection
+ );
+ cornerDirection = Matrix3.Cartesian3.cross(
+ normal,
+ cornerDirection,
+ cornerDirection
+ );
+ cornerDirection = Matrix3.Cartesian3.normalize(cornerDirection, cornerDirection);
+ const scalar =
+ width /
+ Math.max(
+ 0.25,
+ Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.cross(cornerDirection, backward, scratch1)
+ )
+ );
+ const leftIsOutside = PolylineVolumeGeometryLibrary.PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(
+ forward,
+ backward,
+ position,
+ ellipsoid
+ );
+ cornerDirection = Matrix3.Cartesian3.multiplyByScalar(
+ cornerDirection,
+ scalar,
+ cornerDirection
+ );
+ if (leftIsOutside) {
+ rightPos = Matrix3.Cartesian3.add(position, cornerDirection, rightPos);
+ center = Matrix3.Cartesian3.add(
+ rightPos,
+ Matrix3.Cartesian3.multiplyByScalar(left, width, center),
+ center
+ );
+ leftPos = Matrix3.Cartesian3.add(
+ rightPos,
+ Matrix3.Cartesian3.multiplyByScalar(left, width * 2, leftPos),
+ leftPos
+ );
+ scaleArray2[0] = Matrix3.Cartesian3.clone(previousPos, scaleArray2[0]);
+ scaleArray2[1] = Matrix3.Cartesian3.clone(center, scaleArray2[1]);
+ subdividedPositions = PolylinePipeline.PolylinePipeline.generateArc({
+ positions: scaleArray2,
+ granularity: granularity,
+ ellipsoid: ellipsoid,
+ });
+ calculatedPositions = addShiftedPositions(
+ subdividedPositions,
+ left,
+ width,
+ calculatedPositions
+ );
+ if (saveAttributes) {
+ calculatedLefts.push(left.x, left.y, left.z);
+ calculatedNormals.push(normal.x, normal.y, normal.z);
+ }
+ startPoint = Matrix3.Cartesian3.clone(leftPos, startPoint);
+ left = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(normal, forward, left),
+ left
+ );
+ leftPos = Matrix3.Cartesian3.add(
+ rightPos,
+ Matrix3.Cartesian3.multiplyByScalar(left, width * 2, leftPos),
+ leftPos
+ );
+ previousPos = Matrix3.Cartesian3.add(
+ rightPos,
+ Matrix3.Cartesian3.multiplyByScalar(left, width, previousPos),
+ previousPos
+ );
+ if (
+ cornerType === PolylineVolumeGeometryLibrary.CornerType.ROUNDED ||
+ cornerType === PolylineVolumeGeometryLibrary.CornerType.BEVELED
+ ) {
+ corners.push({
+ leftPositions: computeRoundCorner(
+ rightPos,
+ startPoint,
+ leftPos,
+ cornerType,
+ leftIsOutside
+ ),
+ });
+ } else {
+ corners.push({
+ leftPositions: computeMiteredCorner(
+ position,
+ Matrix3.Cartesian3.negate(cornerDirection, cornerDirection),
+ leftPos,
+ leftIsOutside
+ ),
+ });
+ }
+ } else {
+ leftPos = Matrix3.Cartesian3.add(position, cornerDirection, leftPos);
+ center = Matrix3.Cartesian3.add(
+ leftPos,
+ Matrix3.Cartesian3.negate(
+ Matrix3.Cartesian3.multiplyByScalar(left, width, center),
+ center
+ ),
+ center
+ );
+ rightPos = Matrix3.Cartesian3.add(
+ leftPos,
+ Matrix3.Cartesian3.negate(
+ Matrix3.Cartesian3.multiplyByScalar(left, width * 2, rightPos),
+ rightPos
+ ),
+ rightPos
+ );
+ scaleArray2[0] = Matrix3.Cartesian3.clone(previousPos, scaleArray2[0]);
+ scaleArray2[1] = Matrix3.Cartesian3.clone(center, scaleArray2[1]);
+ subdividedPositions = PolylinePipeline.PolylinePipeline.generateArc({
+ positions: scaleArray2,
+ granularity: granularity,
+ ellipsoid: ellipsoid,
+ });
+ calculatedPositions = addShiftedPositions(
+ subdividedPositions,
+ left,
+ width,
+ calculatedPositions
+ );
+ if (saveAttributes) {
+ calculatedLefts.push(left.x, left.y, left.z);
+ calculatedNormals.push(normal.x, normal.y, normal.z);
+ }
+ startPoint = Matrix3.Cartesian3.clone(rightPos, startPoint);
+ left = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(normal, forward, left),
+ left
+ );
+ rightPos = Matrix3.Cartesian3.add(
+ leftPos,
+ Matrix3.Cartesian3.negate(
+ Matrix3.Cartesian3.multiplyByScalar(left, width * 2, rightPos),
+ rightPos
+ ),
+ rightPos
+ );
+ previousPos = Matrix3.Cartesian3.add(
+ leftPos,
+ Matrix3.Cartesian3.negate(
+ Matrix3.Cartesian3.multiplyByScalar(left, width, previousPos),
+ previousPos
+ ),
+ previousPos
+ );
+ if (
+ cornerType === PolylineVolumeGeometryLibrary.CornerType.ROUNDED ||
+ cornerType === PolylineVolumeGeometryLibrary.CornerType.BEVELED
+ ) {
+ corners.push({
+ rightPositions: computeRoundCorner(
+ leftPos,
+ startPoint,
+ rightPos,
+ cornerType,
+ leftIsOutside
+ ),
+ });
+ } else {
+ corners.push({
+ rightPositions: computeMiteredCorner(
+ position,
+ cornerDirection,
+ rightPos,
+ leftIsOutside
+ ),
+ });
+ }
+ }
+ backward = Matrix3.Cartesian3.negate(forward, backward);
+ }
+ position = nextPosition;
+ }
+
+ normal = ellipsoid.geodeticSurfaceNormal(position, normal);
+ scaleArray2[0] = Matrix3.Cartesian3.clone(previousPos, scaleArray2[0]);
+ scaleArray2[1] = Matrix3.Cartesian3.clone(position, scaleArray2[1]);
+ subdividedPositions = PolylinePipeline.PolylinePipeline.generateArc({
+ positions: scaleArray2,
+ granularity: granularity,
+ ellipsoid: ellipsoid,
+ });
+ calculatedPositions = addShiftedPositions(
+ subdividedPositions,
+ left,
+ width,
+ calculatedPositions
+ );
+ if (saveAttributes) {
+ calculatedLefts.push(left.x, left.y, left.z);
+ calculatedNormals.push(normal.x, normal.y, normal.z);
+ }
+
+ let endPositions;
+ if (cornerType === PolylineVolumeGeometryLibrary.CornerType.ROUNDED) {
+ endPositions = addEndCaps(calculatedPositions);
+ }
+
+ return {
+ positions: calculatedPositions,
+ corners: corners,
+ lefts: calculatedLefts,
+ normals: calculatedNormals,
+ endPositions: endPositions,
+ };
+ };
+ var CorridorGeometryLibrary$1 = CorridorGeometryLibrary;
+
+ exports.CorridorGeometryLibrary = CorridorGeometryLibrary$1;
+
+}));
+//# sourceMappingURL=CorridorGeometryLibrary-152d0356.js.map
diff --git a/examples/cesium/Workers/CorridorGeometryLibrary-152d0356.js.map b/examples/cesium/Workers/CorridorGeometryLibrary-152d0356.js.map
new file mode 100644
index 0000000..3612d67
--- /dev/null
+++ b/examples/cesium/Workers/CorridorGeometryLibrary-152d0356.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"CorridorGeometryLibrary-152d0356.js","sources":["../../../Source/Core/CorridorGeometryLibrary.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport CornerType from \"./CornerType.js\";\r\nimport defined from \"./defined.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport PolylinePipeline from \"./PolylinePipeline.js\";\r\nimport PolylineVolumeGeometryLibrary from \"./PolylineVolumeGeometryLibrary.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\n\r\n/**\r\n * @private\r\n */\r\nconst CorridorGeometryLibrary = {};\r\n\r\nconst scratch1 = new Cartesian3();\r\nconst scratch2 = new Cartesian3();\r\nconst scratch3 = new Cartesian3();\r\nconst scratch4 = new Cartesian3();\r\n\r\nconst scaleArray2 = [new Cartesian3(), new Cartesian3()];\r\n\r\nconst cartesian1 = new Cartesian3();\r\nconst cartesian2 = new Cartesian3();\r\nconst cartesian3 = new Cartesian3();\r\nconst cartesian4 = new Cartesian3();\r\nconst cartesian5 = new Cartesian3();\r\nconst cartesian6 = new Cartesian3();\r\nconst cartesian7 = new Cartesian3();\r\nconst cartesian8 = new Cartesian3();\r\nconst cartesian9 = new Cartesian3();\r\nconst cartesian10 = new Cartesian3();\r\n\r\nconst quaterion = new Quaternion();\r\nconst rotMatrix = new Matrix3();\r\nfunction computeRoundCorner(\r\n cornerPoint,\r\n startPoint,\r\n endPoint,\r\n cornerType,\r\n leftIsOutside\r\n) {\r\n const angle = Cartesian3.angleBetween(\r\n Cartesian3.subtract(startPoint, cornerPoint, scratch1),\r\n Cartesian3.subtract(endPoint, cornerPoint, scratch2)\r\n );\r\n const granularity =\r\n cornerType === CornerType.BEVELED\r\n ? 1\r\n : Math.ceil(angle / CesiumMath.toRadians(5)) + 1;\r\n\r\n const size = granularity * 3;\r\n const array = new Array(size);\r\n\r\n array[size - 3] = endPoint.x;\r\n array[size - 2] = endPoint.y;\r\n array[size - 1] = endPoint.z;\r\n\r\n let m;\r\n if (leftIsOutside) {\r\n m = Matrix3.fromQuaternion(\r\n Quaternion.fromAxisAngle(\r\n Cartesian3.negate(cornerPoint, scratch1),\r\n angle / granularity,\r\n quaterion\r\n ),\r\n rotMatrix\r\n );\r\n } else {\r\n m = Matrix3.fromQuaternion(\r\n Quaternion.fromAxisAngle(cornerPoint, angle / granularity, quaterion),\r\n rotMatrix\r\n );\r\n }\r\n\r\n let index = 0;\r\n startPoint = Cartesian3.clone(startPoint, scratch1);\r\n for (let i = 0; i < granularity; i++) {\r\n startPoint = Matrix3.multiplyByVector(m, startPoint, startPoint);\r\n array[index++] = startPoint.x;\r\n array[index++] = startPoint.y;\r\n array[index++] = startPoint.z;\r\n }\r\n\r\n return array;\r\n}\r\n\r\nfunction addEndCaps(calculatedPositions) {\r\n let cornerPoint = cartesian1;\r\n let startPoint = cartesian2;\r\n let endPoint = cartesian3;\r\n\r\n let leftEdge = calculatedPositions[1];\r\n startPoint = Cartesian3.fromArray(\r\n calculatedPositions[1],\r\n leftEdge.length - 3,\r\n startPoint\r\n );\r\n endPoint = Cartesian3.fromArray(calculatedPositions[0], 0, endPoint);\r\n cornerPoint = Cartesian3.midpoint(startPoint, endPoint, cornerPoint);\r\n const firstEndCap = computeRoundCorner(\r\n cornerPoint,\r\n startPoint,\r\n endPoint,\r\n CornerType.ROUNDED,\r\n false\r\n );\r\n\r\n const length = calculatedPositions.length - 1;\r\n const rightEdge = calculatedPositions[length - 1];\r\n leftEdge = calculatedPositions[length];\r\n startPoint = Cartesian3.fromArray(\r\n rightEdge,\r\n rightEdge.length - 3,\r\n startPoint\r\n );\r\n endPoint = Cartesian3.fromArray(leftEdge, 0, endPoint);\r\n cornerPoint = Cartesian3.midpoint(startPoint, endPoint, cornerPoint);\r\n const lastEndCap = computeRoundCorner(\r\n cornerPoint,\r\n startPoint,\r\n endPoint,\r\n CornerType.ROUNDED,\r\n false\r\n );\r\n\r\n return [firstEndCap, lastEndCap];\r\n}\r\n\r\nfunction computeMiteredCorner(\r\n position,\r\n leftCornerDirection,\r\n lastPoint,\r\n leftIsOutside\r\n) {\r\n let cornerPoint = scratch1;\r\n if (leftIsOutside) {\r\n cornerPoint = Cartesian3.add(position, leftCornerDirection, cornerPoint);\r\n } else {\r\n leftCornerDirection = Cartesian3.negate(\r\n leftCornerDirection,\r\n leftCornerDirection\r\n );\r\n cornerPoint = Cartesian3.add(position, leftCornerDirection, cornerPoint);\r\n }\r\n return [\r\n cornerPoint.x,\r\n cornerPoint.y,\r\n cornerPoint.z,\r\n lastPoint.x,\r\n lastPoint.y,\r\n lastPoint.z,\r\n ];\r\n}\r\n\r\nfunction addShiftedPositions(positions, left, scalar, calculatedPositions) {\r\n const rightPositions = new Array(positions.length);\r\n const leftPositions = new Array(positions.length);\r\n const scaledLeft = Cartesian3.multiplyByScalar(left, scalar, scratch1);\r\n const scaledRight = Cartesian3.negate(scaledLeft, scratch2);\r\n let rightIndex = 0;\r\n let leftIndex = positions.length - 1;\r\n\r\n for (let i = 0; i < positions.length; i += 3) {\r\n const pos = Cartesian3.fromArray(positions, i, scratch3);\r\n const rightPos = Cartesian3.add(pos, scaledRight, scratch4);\r\n rightPositions[rightIndex++] = rightPos.x;\r\n rightPositions[rightIndex++] = rightPos.y;\r\n rightPositions[rightIndex++] = rightPos.z;\r\n\r\n const leftPos = Cartesian3.add(pos, scaledLeft, scratch4);\r\n leftPositions[leftIndex--] = leftPos.z;\r\n leftPositions[leftIndex--] = leftPos.y;\r\n leftPositions[leftIndex--] = leftPos.x;\r\n }\r\n calculatedPositions.push(rightPositions, leftPositions);\r\n\r\n return calculatedPositions;\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nCorridorGeometryLibrary.addAttribute = function (\r\n attribute,\r\n value,\r\n front,\r\n back\r\n) {\r\n const x = value.x;\r\n const y = value.y;\r\n const z = value.z;\r\n if (defined(front)) {\r\n attribute[front] = x;\r\n attribute[front + 1] = y;\r\n attribute[front + 2] = z;\r\n }\r\n if (defined(back)) {\r\n attribute[back] = z;\r\n attribute[back - 1] = y;\r\n attribute[back - 2] = x;\r\n }\r\n};\r\n\r\nconst scratchForwardProjection = new Cartesian3();\r\nconst scratchBackwardProjection = new Cartesian3();\r\n\r\n/**\r\n * @private\r\n */\r\nCorridorGeometryLibrary.computePositions = function (params) {\r\n const granularity = params.granularity;\r\n const positions = params.positions;\r\n const ellipsoid = params.ellipsoid;\r\n const width = params.width / 2;\r\n const cornerType = params.cornerType;\r\n const saveAttributes = params.saveAttributes;\r\n let normal = cartesian1;\r\n let forward = cartesian2;\r\n let backward = cartesian3;\r\n let left = cartesian4;\r\n let cornerDirection = cartesian5;\r\n let startPoint = cartesian6;\r\n let previousPos = cartesian7;\r\n let rightPos = cartesian8;\r\n let leftPos = cartesian9;\r\n let center = cartesian10;\r\n let calculatedPositions = [];\r\n const calculatedLefts = saveAttributes ? [] : undefined;\r\n const calculatedNormals = saveAttributes ? [] : undefined;\r\n let position = positions[0]; //add first point\r\n let nextPosition = positions[1];\r\n\r\n forward = Cartesian3.normalize(\r\n Cartesian3.subtract(nextPosition, position, forward),\r\n forward\r\n );\r\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\r\n left = Cartesian3.normalize(Cartesian3.cross(normal, forward, left), left);\r\n if (saveAttributes) {\r\n calculatedLefts.push(left.x, left.y, left.z);\r\n calculatedNormals.push(normal.x, normal.y, normal.z);\r\n }\r\n previousPos = Cartesian3.clone(position, previousPos);\r\n position = nextPosition;\r\n backward = Cartesian3.negate(forward, backward);\r\n\r\n let subdividedPositions;\r\n const corners = [];\r\n let i;\r\n const length = positions.length;\r\n for (i = 1; i < length - 1; i++) {\r\n // add middle points and corners\r\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\r\n nextPosition = positions[i + 1];\r\n forward = Cartesian3.normalize(\r\n Cartesian3.subtract(nextPosition, position, forward),\r\n forward\r\n );\r\n cornerDirection = Cartesian3.normalize(\r\n Cartesian3.add(forward, backward, cornerDirection),\r\n cornerDirection\r\n );\r\n\r\n const forwardProjection = Cartesian3.multiplyByScalar(\r\n normal,\r\n Cartesian3.dot(forward, normal),\r\n scratchForwardProjection\r\n );\r\n Cartesian3.subtract(forward, forwardProjection, forwardProjection);\r\n Cartesian3.normalize(forwardProjection, forwardProjection);\r\n\r\n const backwardProjection = Cartesian3.multiplyByScalar(\r\n normal,\r\n Cartesian3.dot(backward, normal),\r\n scratchBackwardProjection\r\n );\r\n Cartesian3.subtract(backward, backwardProjection, backwardProjection);\r\n Cartesian3.normalize(backwardProjection, backwardProjection);\r\n\r\n const doCorner = !CesiumMath.equalsEpsilon(\r\n Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)),\r\n 1.0,\r\n CesiumMath.EPSILON7\r\n );\r\n\r\n if (doCorner) {\r\n cornerDirection = Cartesian3.cross(\r\n cornerDirection,\r\n normal,\r\n cornerDirection\r\n );\r\n cornerDirection = Cartesian3.cross(\r\n normal,\r\n cornerDirection,\r\n cornerDirection\r\n );\r\n cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection);\r\n const scalar =\r\n width /\r\n Math.max(\r\n 0.25,\r\n Cartesian3.magnitude(\r\n Cartesian3.cross(cornerDirection, backward, scratch1)\r\n )\r\n );\r\n const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(\r\n forward,\r\n backward,\r\n position,\r\n ellipsoid\r\n );\r\n cornerDirection = Cartesian3.multiplyByScalar(\r\n cornerDirection,\r\n scalar,\r\n cornerDirection\r\n );\r\n if (leftIsOutside) {\r\n rightPos = Cartesian3.add(position, cornerDirection, rightPos);\r\n center = Cartesian3.add(\r\n rightPos,\r\n Cartesian3.multiplyByScalar(left, width, center),\r\n center\r\n );\r\n leftPos = Cartesian3.add(\r\n rightPos,\r\n Cartesian3.multiplyByScalar(left, width * 2, leftPos),\r\n leftPos\r\n );\r\n scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);\r\n scaleArray2[1] = Cartesian3.clone(center, scaleArray2[1]);\r\n subdividedPositions = PolylinePipeline.generateArc({\r\n positions: scaleArray2,\r\n granularity: granularity,\r\n ellipsoid: ellipsoid,\r\n });\r\n calculatedPositions = addShiftedPositions(\r\n subdividedPositions,\r\n left,\r\n width,\r\n calculatedPositions\r\n );\r\n if (saveAttributes) {\r\n calculatedLefts.push(left.x, left.y, left.z);\r\n calculatedNormals.push(normal.x, normal.y, normal.z);\r\n }\r\n startPoint = Cartesian3.clone(leftPos, startPoint);\r\n left = Cartesian3.normalize(\r\n Cartesian3.cross(normal, forward, left),\r\n left\r\n );\r\n leftPos = Cartesian3.add(\r\n rightPos,\r\n Cartesian3.multiplyByScalar(left, width * 2, leftPos),\r\n leftPos\r\n );\r\n previousPos = Cartesian3.add(\r\n rightPos,\r\n Cartesian3.multiplyByScalar(left, width, previousPos),\r\n previousPos\r\n );\r\n if (\r\n cornerType === CornerType.ROUNDED ||\r\n cornerType === CornerType.BEVELED\r\n ) {\r\n corners.push({\r\n leftPositions: computeRoundCorner(\r\n rightPos,\r\n startPoint,\r\n leftPos,\r\n cornerType,\r\n leftIsOutside\r\n ),\r\n });\r\n } else {\r\n corners.push({\r\n leftPositions: computeMiteredCorner(\r\n position,\r\n Cartesian3.negate(cornerDirection, cornerDirection),\r\n leftPos,\r\n leftIsOutside\r\n ),\r\n });\r\n }\r\n } else {\r\n leftPos = Cartesian3.add(position, cornerDirection, leftPos);\r\n center = Cartesian3.add(\r\n leftPos,\r\n Cartesian3.negate(\r\n Cartesian3.multiplyByScalar(left, width, center),\r\n center\r\n ),\r\n center\r\n );\r\n rightPos = Cartesian3.add(\r\n leftPos,\r\n Cartesian3.negate(\r\n Cartesian3.multiplyByScalar(left, width * 2, rightPos),\r\n rightPos\r\n ),\r\n rightPos\r\n );\r\n scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);\r\n scaleArray2[1] = Cartesian3.clone(center, scaleArray2[1]);\r\n subdividedPositions = PolylinePipeline.generateArc({\r\n positions: scaleArray2,\r\n granularity: granularity,\r\n ellipsoid: ellipsoid,\r\n });\r\n calculatedPositions = addShiftedPositions(\r\n subdividedPositions,\r\n left,\r\n width,\r\n calculatedPositions\r\n );\r\n if (saveAttributes) {\r\n calculatedLefts.push(left.x, left.y, left.z);\r\n calculatedNormals.push(normal.x, normal.y, normal.z);\r\n }\r\n startPoint = Cartesian3.clone(rightPos, startPoint);\r\n left = Cartesian3.normalize(\r\n Cartesian3.cross(normal, forward, left),\r\n left\r\n );\r\n rightPos = Cartesian3.add(\r\n leftPos,\r\n Cartesian3.negate(\r\n Cartesian3.multiplyByScalar(left, width * 2, rightPos),\r\n rightPos\r\n ),\r\n rightPos\r\n );\r\n previousPos = Cartesian3.add(\r\n leftPos,\r\n Cartesian3.negate(\r\n Cartesian3.multiplyByScalar(left, width, previousPos),\r\n previousPos\r\n ),\r\n previousPos\r\n );\r\n if (\r\n cornerType === CornerType.ROUNDED ||\r\n cornerType === CornerType.BEVELED\r\n ) {\r\n corners.push({\r\n rightPositions: computeRoundCorner(\r\n leftPos,\r\n startPoint,\r\n rightPos,\r\n cornerType,\r\n leftIsOutside\r\n ),\r\n });\r\n } else {\r\n corners.push({\r\n rightPositions: computeMiteredCorner(\r\n position,\r\n cornerDirection,\r\n rightPos,\r\n leftIsOutside\r\n ),\r\n });\r\n }\r\n }\r\n backward = Cartesian3.negate(forward, backward);\r\n }\r\n position = nextPosition;\r\n }\r\n\r\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\r\n scaleArray2[0] = Cartesian3.clone(previousPos, scaleArray2[0]);\r\n scaleArray2[1] = Cartesian3.clone(position, scaleArray2[1]);\r\n subdividedPositions = PolylinePipeline.generateArc({\r\n positions: scaleArray2,\r\n granularity: granularity,\r\n ellipsoid: ellipsoid,\r\n });\r\n calculatedPositions = addShiftedPositions(\r\n subdividedPositions,\r\n left,\r\n width,\r\n calculatedPositions\r\n );\r\n if (saveAttributes) {\r\n calculatedLefts.push(left.x, left.y, left.z);\r\n calculatedNormals.push(normal.x, normal.y, normal.z);\r\n }\r\n\r\n let endPositions;\r\n if (cornerType === CornerType.ROUNDED) {\r\n endPositions = addEndCaps(calculatedPositions);\r\n }\r\n\r\n return {\r\n positions: calculatedPositions,\r\n corners: corners,\r\n lefts: calculatedLefts,\r\n normals: calculatedNormals,\r\n endPositions: endPositions,\r\n };\r\n};\r\nexport default CorridorGeometryLibrary;\r\n"],"names":["Cartesian3","Quaternion","Matrix3","CornerType","CesiumMath","defined","PolylineVolumeGeometryLibrary","PolylinePipeline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EASA;EACA;EACA;EACA,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC;EACA,MAAM,QAAQ,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAClC,MAAM,QAAQ,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAClC,MAAM,QAAQ,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAClC,MAAM,QAAQ,GAAG,IAAIA,kBAAU,EAAE,CAAC;AAClC;EACA,MAAM,WAAW,GAAG,CAAC,IAAIA,kBAAU,EAAE,EAAE,IAAIA,kBAAU,EAAE,CAAC,CAAC;AACzD;EACA,MAAM,UAAU,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACpC,MAAM,UAAU,GAAG,IAAIA,kBA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AC;EACjE,EAAE,WAAW,CAAC,CAAC,CAAC,GAAGA,kBAAU,CAAC,KAAK,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;EAC9D,EAAE,mBAAmB,GAAGO,iCAAgB,CAAC,WAAW,CAAC;EACrD,IAAI,SAAS,EAAE,WAAW;EAC1B,IAAI,WAAW,EAAE,WAAW;EAC5B,IAAI,SAAS,EAAE,SAAS;EACxB,GAAG,CAAC,CAAC;EACL,EAAE,mBAAmB,GAAG,mBAAmB;EAC3C,IAAI,mBAAmB;EACvB,IAAI,IAAI;EACR,IAAI,KAAK;EACT,IAAI,mBAAmB;EACvB,GAAG,CAAC;EACJ,EAAE,IAAI,cAAc,EAAE;EACtB,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;EACjD,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;EACzD,GAAG;AACH;EACA,EAAE,IAAI,YAAY,CAAC;EACnB,EAAE,IAAI,UAAU,KAAKJ,wCAAU,CAAC,OAAO,EAAE;EACzC,IAAI,YAAY,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;EACnD,GAAG;AACH;EACA,EAAE,OAAO;EACT,IAAI,SAAS,EAAE,mBAAmB;EAClC,IAAI,OAAO,EAAE,OAAO;EACpB,IAAI,KAAK,EAAE,eAAe;EAC1B,IAAI,OAAO,EAAE,iBAAiB;EAC9B,IAAI,YAAY,EAAE,YAAY;EAC9B,GAAG,CAAC;EACJ,CAAC,CAAC;AACF,kCAAe,uBAAuB;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/CylinderGeometry-2b94e575.js b/examples/cesium/Workers/CylinderGeometry-2b94e575.js
new file mode 100644
index 0000000..f3a64fe
--- /dev/null
+++ b/examples/cesium/Workers/CylinderGeometry-2b94e575.js
@@ -0,0 +1,493 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Transforms-11fb6b0a', './Matrix2-036c77dd', './Matrix3-f22b0303', './ComponentDatatype-13a5630b', './CylinderGeometryLibrary-d951e1d0', './defaultValue-0ab18f7d', './Check-d10e5f2e', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89', './Math-9be8b918', './VertexFormat-f2d74c96'], (function (exports, Transforms, Matrix2, Matrix3, ComponentDatatype, CylinderGeometryLibrary, defaultValue, Check, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1, VertexFormat) { 'use strict';
+
+ const radiusScratch = new Matrix2.Cartesian2();
+ const normalScratch = new Matrix3.Cartesian3();
+ const bitangentScratch = new Matrix3.Cartesian3();
+ const tangentScratch = new Matrix3.Cartesian3();
+ const positionScratch = new Matrix3.Cartesian3();
+
+ /**
+ * A description of a cylinder.
+ *
+ * @alias CylinderGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Number} options.length The length of the cylinder.
+ * @param {Number} options.topRadius The radius of the top of the cylinder.
+ * @param {Number} options.bottomRadius The radius of the bottom of the cylinder.
+ * @param {Number} [options.slices=128] The number of edges around the perimeter of the cylinder.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ *
+ * @exception {DeveloperError} options.slices must be greater than or equal to 3.
+ *
+ * @see CylinderGeometry.createGeometry
+ *
+ * @example
+ * // create cylinder geometry
+ * const cylinder = new Cesium.CylinderGeometry({
+ * length: 200000,
+ * topRadius: 80000,
+ * bottomRadius: 200000,
+ * });
+ * const geometry = Cesium.CylinderGeometry.createGeometry(cylinder);
+ */
+ function CylinderGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const length = options.length;
+ const topRadius = options.topRadius;
+ const bottomRadius = options.bottomRadius;
+ const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
+ const slices = defaultValue.defaultValue(options.slices, 128);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(length)) {
+ throw new Check.DeveloperError("options.length must be defined.");
+ }
+ if (!defaultValue.defined(topRadius)) {
+ throw new Check.DeveloperError("options.topRadius must be defined.");
+ }
+ if (!defaultValue.defined(bottomRadius)) {
+ throw new Check.DeveloperError("options.bottomRadius must be defined.");
+ }
+ if (slices < 3) {
+ throw new Check.DeveloperError(
+ "options.slices must be greater than or equal to 3."
+ );
+ }
+ if (
+ defaultValue.defined(options.offsetAttribute) &&
+ options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP
+ ) {
+ throw new Check.DeveloperError(
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
+ );
+ }
+ //>>includeEnd('debug');
+
+ this._length = length;
+ this._topRadius = topRadius;
+ this._bottomRadius = bottomRadius;
+ this._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat);
+ this._slices = slices;
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createCylinderGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ CylinderGeometry.packedLength = VertexFormat.VertexFormat.packedLength + 5;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {CylinderGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ CylinderGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ array[startingIndex++] = value._length;
+ array[startingIndex++] = value._topRadius;
+ array[startingIndex++] = value._bottomRadius;
+ array[startingIndex++] = value._slices;
+ array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+ const scratchOptions = {
+ vertexFormat: scratchVertexFormat,
+ length: undefined,
+ topRadius: undefined,
+ bottomRadius: undefined,
+ slices: undefined,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {CylinderGeometry} [result] The object into which to store the result.
+ * @returns {CylinderGeometry} The modified result parameter or a new CylinderGeometry instance if one was not provided.
+ */
+ CylinderGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ const length = array[startingIndex++];
+ const topRadius = array[startingIndex++];
+ const bottomRadius = array[startingIndex++];
+ const slices = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.length = length;
+ scratchOptions.topRadius = topRadius;
+ scratchOptions.bottomRadius = bottomRadius;
+ scratchOptions.slices = slices;
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+ return new CylinderGeometry(scratchOptions);
+ }
+
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._length = length;
+ result._topRadius = topRadius;
+ result._bottomRadius = bottomRadius;
+ result._slices = slices;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {CylinderGeometry} cylinderGeometry A description of the cylinder.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ CylinderGeometry.createGeometry = function (cylinderGeometry) {
+ let length = cylinderGeometry._length;
+ const topRadius = cylinderGeometry._topRadius;
+ const bottomRadius = cylinderGeometry._bottomRadius;
+ const vertexFormat = cylinderGeometry._vertexFormat;
+ const slices = cylinderGeometry._slices;
+
+ if (
+ length <= 0 ||
+ topRadius < 0 ||
+ bottomRadius < 0 ||
+ (topRadius === 0 && bottomRadius === 0)
+ ) {
+ return;
+ }
+
+ const twoSlices = slices + slices;
+ const threeSlices = slices + twoSlices;
+ const numVertices = twoSlices + twoSlices;
+
+ const positions = CylinderGeometryLibrary.CylinderGeometryLibrary.computePositions(
+ length,
+ topRadius,
+ bottomRadius,
+ slices,
+ true
+ );
+
+ const st = vertexFormat.st ? new Float32Array(numVertices * 2) : undefined;
+ const normals = vertexFormat.normal
+ ? new Float32Array(numVertices * 3)
+ : undefined;
+ const tangents = vertexFormat.tangent
+ ? new Float32Array(numVertices * 3)
+ : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(numVertices * 3)
+ : undefined;
+
+ let i;
+ const computeNormal =
+ vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent;
+
+ if (computeNormal) {
+ const computeTangent = vertexFormat.tangent || vertexFormat.bitangent;
+
+ let normalIndex = 0;
+ let tangentIndex = 0;
+ let bitangentIndex = 0;
+
+ const theta = Math.atan2(bottomRadius - topRadius, length);
+ const normal = normalScratch;
+ normal.z = Math.sin(theta);
+ const normalScale = Math.cos(theta);
+ let tangent = tangentScratch;
+ let bitangent = bitangentScratch;
+
+ for (i = 0; i < slices; i++) {
+ const angle = (i / slices) * Math$1.CesiumMath.TWO_PI;
+ const x = normalScale * Math.cos(angle);
+ const y = normalScale * Math.sin(angle);
+ if (computeNormal) {
+ normal.x = x;
+ normal.y = y;
+
+ if (computeTangent) {
+ tangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(Matrix3.Cartesian3.UNIT_Z, normal, tangent),
+ tangent
+ );
+ }
+
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = normal.x;
+ normals[normalIndex++] = normal.y;
+ normals[normalIndex++] = normal.z;
+ normals[normalIndex++] = normal.x;
+ normals[normalIndex++] = normal.y;
+ normals[normalIndex++] = normal.z;
+ }
+
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ }
+
+ if (vertexFormat.bitangent) {
+ bitangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(normal, tangent, bitangent),
+ bitangent
+ );
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ }
+ }
+ }
+
+ for (i = 0; i < slices; i++) {
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = 0;
+ normals[normalIndex++] = 0;
+ normals[normalIndex++] = -1;
+ }
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = 1;
+ tangents[tangentIndex++] = 0;
+ tangents[tangentIndex++] = 0;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents[bitangentIndex++] = 0;
+ bitangents[bitangentIndex++] = -1;
+ bitangents[bitangentIndex++] = 0;
+ }
+ }
+
+ for (i = 0; i < slices; i++) {
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = 0;
+ normals[normalIndex++] = 0;
+ normals[normalIndex++] = 1;
+ }
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = 1;
+ tangents[tangentIndex++] = 0;
+ tangents[tangentIndex++] = 0;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents[bitangentIndex++] = 0;
+ bitangents[bitangentIndex++] = 1;
+ bitangents[bitangentIndex++] = 0;
+ }
+ }
+ }
+
+ const numIndices = 12 * slices - 12;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(numVertices, numIndices);
+ let index = 0;
+ let j = 0;
+ for (i = 0; i < slices - 1; i++) {
+ indices[index++] = j;
+ indices[index++] = j + 2;
+ indices[index++] = j + 3;
+
+ indices[index++] = j;
+ indices[index++] = j + 3;
+ indices[index++] = j + 1;
+
+ j += 2;
+ }
+
+ indices[index++] = twoSlices - 2;
+ indices[index++] = 0;
+ indices[index++] = 1;
+ indices[index++] = twoSlices - 2;
+ indices[index++] = 1;
+ indices[index++] = twoSlices - 1;
+
+ for (i = 1; i < slices - 1; i++) {
+ indices[index++] = twoSlices + i + 1;
+ indices[index++] = twoSlices + i;
+ indices[index++] = twoSlices;
+ }
+
+ for (i = 1; i < slices - 1; i++) {
+ indices[index++] = threeSlices;
+ indices[index++] = threeSlices + i;
+ indices[index++] = threeSlices + i + 1;
+ }
+
+ let textureCoordIndex = 0;
+ if (vertexFormat.st) {
+ const rad = Math.max(topRadius, bottomRadius);
+ for (i = 0; i < numVertices; i++) {
+ const position = Matrix3.Cartesian3.fromArray(positions, i * 3, positionScratch);
+ st[textureCoordIndex++] = (position.x + rad) / (2.0 * rad);
+ st[textureCoordIndex++] = (position.y + rad) / (2.0 * rad);
+ }
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+ }
+
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents,
+ });
+ }
+
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents,
+ });
+ }
+
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: st,
+ });
+ }
+
+ radiusScratch.x = length * 0.5;
+ radiusScratch.y = Math.max(bottomRadius, topRadius);
+
+ const boundingSphere = new Transforms.BoundingSphere(
+ Matrix3.Cartesian3.ZERO,
+ Matrix2.Cartesian2.magnitude(radiusScratch)
+ );
+
+ if (defaultValue.defined(cylinderGeometry._offsetAttribute)) {
+ length = positions.length;
+ const offsetValue =
+ cylinderGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ boundingSphere: boundingSphere,
+ offsetAttribute: cylinderGeometry._offsetAttribute,
+ });
+ };
+
+ let unitCylinderGeometry;
+
+ /**
+ * Returns the geometric representation of a unit cylinder, including its vertices, indices, and a bounding sphere.
+ * @returns {Geometry} The computed vertices and indices.
+ *
+ * @private
+ */
+ CylinderGeometry.getUnitCylinder = function () {
+ if (!defaultValue.defined(unitCylinderGeometry)) {
+ unitCylinderGeometry = CylinderGeometry.createGeometry(
+ new CylinderGeometry({
+ topRadius: 1.0,
+ bottomRadius: 1.0,
+ length: 1.0,
+ vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
+ })
+ );
+ }
+ return unitCylinderGeometry;
+ };
+
+ exports.CylinderGeometry = CylinderGeometry;
+
+}));
+//# sourceMappingURL=CylinderGeometry-2b94e575.js.map
diff --git a/examples/cesium/Workers/CylinderGeometry-2b94e575.js.map b/examples/cesium/Workers/CylinderGeometry-2b94e575.js.map
new file mode 100644
index 0000000..ba8994c
--- /dev/null
+++ b/examples/cesium/Workers/CylinderGeometry-2b94e575.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"CylinderGeometry-2b94e575.js","sources":["../../../Source/Core/CylinderGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport CylinderGeometryLibrary from \"./CylinderGeometryLibrary.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\nconst radiusScratch = new Cartesian2();\r\nconst normalScratch = new Cartesian3();\r\nconst bitangentScratch = new Cartesian3();\r\nconst tangentScratch = new Cartesian3();\r\nconst positionScratch = new Cartesian3();\r\n\r\n/**\r\n * A description of a cylinder.\r\n *\r\n * @alias CylinderGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Number} options.length The length of the cylinder.\r\n * @param {Number} options.topRadius The radius of the top of the cylinder.\r\n * @param {Number} options.bottomRadius The radius of the bottom of the cylinder.\r\n * @param {Number} [options.slices=128] The number of edges around the perimeter of the cylinder.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n *\r\n * @exception {DeveloperError} options.slices must be greater than or equal to 3.\r\n *\r\n * @see CylinderGeometry.createGeometry\r\n *\r\n * @example\r\n * // create cylinder geometry\r\n * const cylinder = new Cesium.CylinderGeometry({\r\n * length: 200000,\r\n * topRadius: 80000,\r\n * bottomRadius: 200000,\r\n * });\r\n * const geometry = Cesium.CylinderGeometry.createGeometry(cylinder);\r\n */\r\nfunction CylinderGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const length = options.length;\r\n const topRadius = options.topRadius;\r\n const bottomRadius = options.bottomRadius;\r\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\r\n const slices = defaultValue(options.slices, 128);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(length)) {\r\n throw new DeveloperError(\"options.length must be defined.\");\r\n }\r\n if (!defined(topRadius)) {\r\n throw new DeveloperError(\"options.topRadius must be defined.\");\r\n }\r\n if (!defined(bottomRadius)) {\r\n throw new DeveloperError(\"options.bottomRadius must be defined.\");\r\n }\r\n if (slices < 3) {\r\n throw new DeveloperError(\r\n \"options.slices must be greater than or equal to 3.\"\r\n );\r\n }\r\n if (\r\n defined(options.offsetAttribute) &&\r\n options.offsetAttribute === GeometryOffsetAttribute.TOP\r\n ) {\r\n throw new DeveloperError(\r\n \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n this._length = length;\r\n this._topRadius = topRadius;\r\n this._bottomRadius = bottomRadius;\r\n this._vertexFormat = VertexFormat.clone(vertexFormat);\r\n this._slices = slices;\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._workerName = \"createCylinderGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nCylinderGeometry.packedLength = VertexFormat.packedLength + 5;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {CylinderGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCylinderGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n array[startingIndex++] = value._length;\r\n array[startingIndex++] = value._topRadius;\r\n array[startingIndex++] = value._bottomRadius;\r\n array[startingIndex++] = value._slices;\r\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchVertexFormat = new VertexFormat();\r\nconst scratchOptions = {\r\n vertexFormat: scratchVertexFormat,\r\n length: undefined,\r\n topRadius: undefined,\r\n bottomRadius: undefined,\r\n slices: undefined,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {CylinderGeometry} [result] The object into which to store the result.\r\n * @returns {CylinderGeometry} The modified result parameter or a new CylinderGeometry instance if one was not provided.\r\n */\r\nCylinderGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n const length = array[startingIndex++];\r\n const topRadius = array[startingIndex++];\r\n const bottomRadius = array[startingIndex++];\r\n const slices = array[startingIndex++];\r\n const offsetAttribute = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.length = length;\r\n scratchOptions.topRadius = topRadius;\r\n scratchOptions.bottomRadius = bottomRadius;\r\n scratchOptions.slices = slices;\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n return new CylinderGeometry(scratchOptions);\r\n }\r\n\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._length = length;\r\n result._topRadius = topRadius;\r\n result._bottomRadius = bottomRadius;\r\n result._slices = slices;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a cylinder, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {CylinderGeometry} cylinderGeometry A description of the cylinder.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nCylinderGeometry.createGeometry = function (cylinderGeometry) {\r\n let length = cylinderGeometry._length;\r\n const topRadius = cylinderGeometry._topRadius;\r\n const bottomRadius = cylinderGeometry._bottomRadius;\r\n const vertexFormat = cylinderGeometry._vertexFormat;\r\n const slices = cylinderGeometry._slices;\r\n\r\n if (\r\n length <= 0 ||\r\n topRadius < 0 ||\r\n bottomRadius < 0 ||\r\n (topRadius === 0 && bottomRadius === 0)\r\n ) {\r\n return;\r\n }\r\n\r\n const twoSlices = slices + slices;\r\n const threeSlices = slices + twoSlices;\r\n const numVertices = twoSlices + twoSlices;\r\n\r\n const positions = CylinderGeometryLibrary.computePositions(\r\n length,\r\n topRadius,\r\n bottomRadius,\r\n slices,\r\n true\r\n );\r\n\r\n const st = vertexFormat.st ? new Float32Array(numVertices * 2) : undefined;\r\n const normals = vertexFormat.normal\r\n ? new Float32Array(numVertices * 3)\r\n : undefined;\r\n const tangents = vertexFormat.tangent\r\n ? new Float32Array(numVertices * 3)\r\n : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(numVertices * 3)\r\n : undefined;\r\n\r\n let i;\r\n const computeNormal =\r\n vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent;\r\n\r\n if (computeNormal) {\r\n const computeTangent = vertexFormat.tangent || vertexFormat.bitangent;\r\n\r\n let normalIndex = 0;\r\n let tangentIndex = 0;\r\n let bitangentIndex = 0;\r\n\r\n const theta = Math.atan2(bottomRadius - topRadius, length);\r\n const normal = normalScratch;\r\n normal.z = Math.sin(theta);\r\n const normalScale = Math.cos(theta);\r\n let tangent = tangentScratch;\r\n let bitangent = bitangentScratch;\r\n\r\n for (i = 0; i < slices; i++) {\r\n const angle = (i / slices) * CesiumMath.TWO_PI;\r\n const x = normalScale * Math.cos(angle);\r\n const y = normalScale * Math.sin(angle);\r\n if (computeNormal) {\r\n normal.x = x;\r\n normal.y = y;\r\n\r\n if (computeTangent) {\r\n tangent = Cartesian3.normalize(\r\n Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent),\r\n tangent\r\n );\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n normals[normalIndex++] = normal.x;\r\n normals[normalIndex++] = normal.y;\r\n normals[normalIndex++] = normal.z;\r\n normals[normalIndex++] = normal.x;\r\n normals[normalIndex++] = normal.y;\r\n normals[normalIndex++] = normal.z;\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n tangents[tangentIndex++] = tangent.x;\r\n tangents[tangentIndex++] = tangent.y;\r\n tangents[tangentIndex++] = tangent.z;\r\n tangents[tangentIndex++] = tangent.x;\r\n tangents[tangentIndex++] = tangent.y;\r\n tangents[tangentIndex++] = tangent.z;\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n bitangent = Cartesian3.normalize(\r\n Cartesian3.cross(normal, tangent, bitangent),\r\n bitangent\r\n );\r\n bitangents[bitangentIndex++] = bitangent.x;\r\n bitangents[bitangentIndex++] = bitangent.y;\r\n bitangents[bitangentIndex++] = bitangent.z;\r\n bitangents[bitangentIndex++] = bitangent.x;\r\n bitangents[bitangentIndex++] = bitangent.y;\r\n bitangents[bitangentIndex++] = bitangent.z;\r\n }\r\n }\r\n }\r\n\r\n for (i = 0; i < slices; i++) {\r\n if (vertexFormat.normal) {\r\n normals[normalIndex++] = 0;\r\n normals[normalIndex++] = 0;\r\n normals[normalIndex++] = -1;\r\n }\r\n if (vertexFormat.tangent) {\r\n tangents[tangentIndex++] = 1;\r\n tangents[tangentIndex++] = 0;\r\n tangents[tangentIndex++] = 0;\r\n }\r\n if (vertexFormat.bitangent) {\r\n bitangents[bitangentIndex++] = 0;\r\n bitangents[bitangentIndex++] = -1;\r\n bitangents[bitangentIndex++] = 0;\r\n }\r\n }\r\n\r\n for (i = 0; i < slices; i++) {\r\n if (vertexFormat.normal) {\r\n normals[normalIndex++] = 0;\r\n normals[normalIndex++] = 0;\r\n normals[normalIndex++] = 1;\r\n }\r\n if (vertexFormat.tangent) {\r\n tangents[tangentIndex++] = 1;\r\n tangents[tangentIndex++] = 0;\r\n tangents[tangentIndex++] = 0;\r\n }\r\n if (vertexFormat.bitangent) {\r\n bitangents[bitangentIndex++] = 0;\r\n bitangents[bitangentIndex++] = 1;\r\n bitangents[bitangentIndex++] = 0;\r\n }\r\n }\r\n }\r\n\r\n const numIndices = 12 * slices - 12;\r\n const indices = IndexDatatype.createTypedArray(numVertices, numIndices);\r\n let index = 0;\r\n let j = 0;\r\n for (i = 0; i < slices - 1; i++) {\r\n indices[index++] = j;\r\n indices[index++] = j + 2;\r\n indices[index++] = j + 3;\r\n\r\n indices[index++] = j;\r\n indices[index++] = j + 3;\r\n indices[index++] = j + 1;\r\n\r\n j += 2;\r\n }\r\n\r\n indices[index++] = twoSlices - 2;\r\n indices[index++] = 0;\r\n indices[index++] = 1;\r\n indices[index++] = twoSlices - 2;\r\n indices[index++] = 1;\r\n indices[index++] = twoSlices - 1;\r\n\r\n for (i = 1; i < slices - 1; i++) {\r\n indices[index++] = twoSlices + i + 1;\r\n indices[index++] = twoSlices + i;\r\n indices[index++] = twoSlices;\r\n }\r\n\r\n for (i = 1; i < slices - 1; i++) {\r\n indices[index++] = threeSlices;\r\n indices[index++] = threeSlices + i;\r\n indices[index++] = threeSlices + i + 1;\r\n }\r\n\r\n let textureCoordIndex = 0;\r\n if (vertexFormat.st) {\r\n const rad = Math.max(topRadius, bottomRadius);\r\n for (i = 0; i < numVertices; i++) {\r\n const position = Cartesian3.fromArray(positions, i * 3, positionScratch);\r\n st[textureCoordIndex++] = (position.x + rad) / (2.0 * rad);\r\n st[textureCoordIndex++] = (position.y + rad) / (2.0 * rad);\r\n }\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n if (vertexFormat.position) {\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normals,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.st) {\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: st,\r\n });\r\n }\r\n\r\n radiusScratch.x = length * 0.5;\r\n radiusScratch.y = Math.max(bottomRadius, topRadius);\r\n\r\n const boundingSphere = new BoundingSphere(\r\n Cartesian3.ZERO,\r\n Cartesian2.magnitude(radiusScratch)\r\n );\r\n\r\n if (defined(cylinderGeometry._offsetAttribute)) {\r\n length = positions.length;\r\n const offsetValue =\r\n cylinderGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n boundingSphere: boundingSphere,\r\n offsetAttribute: cylinderGeometry._offsetAttribute,\r\n });\r\n};\r\n\r\nlet unitCylinderGeometry;\r\n\r\n/**\r\n * Returns the geometric representation of a unit cylinder, including its vertices, indices, and a bounding sphere.\r\n * @returns {Geometry} The computed vertices and indices.\r\n *\r\n * @private\r\n */\r\nCylinderGeometry.getUnitCylinder = function () {\r\n if (!defined(unitCylinderGeometry)) {\r\n unitCylinderGeometry = CylinderGeometry.createGeometry(\r\n new CylinderGeometry({\r\n topRadius: 1.0,\r\n bottomRadius: 1.0,\r\n length: 1.0,\r\n vertexFormat: VertexFormat.POSITION_ONLY,\r\n })\r\n );\r\n }\r\n return unitCylinderGeometry;\r\n};\r\nexport default CylinderGeometry;\r\n"],"names":["Cartesian2","Cartesian3","defaultValue","VertexFormat","defined","DeveloperError","GeometryOffsetAttribute","CylinderGeometryLibrary","CesiumMath","IndexDatatype","GeometryAttributes","GeometryAttribute","ComponentDatatype","BoundingSphere","Geometry","PrimitiveType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,aAAa,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACvC,MAAM,aAAa,GAAG,IAAIC,kBAAU,EAAE,CAAC;EACvC,MAAM,gBAAgB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC1C,MAAM,cAAc,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACxC,MAAM,eAAe,GAAG,IAAIA,kBAAU,EAAE,CAAC;AACzC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,gBAAgB,CAAC,OAAO,EAAE;EACnC,EAAE,OAAO,GAAGC,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;EAChC,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;EACtC,EAAE,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAA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ED,yBAAY,CAAC,aAAa;EAChD,OAAO,CAAC;EACR,KAAK,CAAC;EACN,GAAG;EACH,EAAE,OAAO,oBAAoB,CAAC;EAC9B,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/CylinderGeometryLibrary-d951e1d0.js b/examples/cesium/Workers/CylinderGeometryLibrary-d951e1d0.js
new file mode 100644
index 0000000..b388009
--- /dev/null
+++ b/examples/cesium/Workers/CylinderGeometryLibrary-d951e1d0.js
@@ -0,0 +1,89 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Math-9be8b918'], (function (exports, Math$1) { 'use strict';
+
+ /**
+ * @private
+ */
+ const CylinderGeometryLibrary = {};
+
+ /**
+ * @private
+ */
+ CylinderGeometryLibrary.computePositions = function (
+ length,
+ topRadius,
+ bottomRadius,
+ slices,
+ fill
+ ) {
+ const topZ = length * 0.5;
+ const bottomZ = -topZ;
+
+ const twoSlice = slices + slices;
+ const size = fill ? 2 * twoSlice : twoSlice;
+ const positions = new Float64Array(size * 3);
+ let i;
+ let index = 0;
+ let tbIndex = 0;
+ const bottomOffset = fill ? twoSlice * 3 : 0;
+ const topOffset = fill ? (twoSlice + slices) * 3 : slices * 3;
+
+ for (i = 0; i < slices; i++) {
+ const angle = (i / slices) * Math$1.CesiumMath.TWO_PI;
+ const x = Math.cos(angle);
+ const y = Math.sin(angle);
+ const bottomX = x * bottomRadius;
+ const bottomY = y * bottomRadius;
+ const topX = x * topRadius;
+ const topY = y * topRadius;
+
+ positions[tbIndex + bottomOffset] = bottomX;
+ positions[tbIndex + bottomOffset + 1] = bottomY;
+ positions[tbIndex + bottomOffset + 2] = bottomZ;
+
+ positions[tbIndex + topOffset] = topX;
+ positions[tbIndex + topOffset + 1] = topY;
+ positions[tbIndex + topOffset + 2] = topZ;
+ tbIndex += 3;
+ if (fill) {
+ positions[index++] = bottomX;
+ positions[index++] = bottomY;
+ positions[index++] = bottomZ;
+ positions[index++] = topX;
+ positions[index++] = topY;
+ positions[index++] = topZ;
+ }
+ }
+
+ return positions;
+ };
+ var CylinderGeometryLibrary$1 = CylinderGeometryLibrary;
+
+ exports.CylinderGeometryLibrary = CylinderGeometryLibrary$1;
+
+}));
+//# sourceMappingURL=CylinderGeometryLibrary-d951e1d0.js.map
diff --git a/examples/cesium/Workers/CylinderGeometryLibrary-d951e1d0.js.map b/examples/cesium/Workers/CylinderGeometryLibrary-d951e1d0.js.map
new file mode 100644
index 0000000..9e671ed
--- /dev/null
+++ b/examples/cesium/Workers/CylinderGeometryLibrary-d951e1d0.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"CylinderGeometryLibrary-d951e1d0.js","sources":["../../../Source/Core/CylinderGeometryLibrary.js"],"sourcesContent":["import CesiumMath from \"./Math.js\";\r\n\r\n/**\r\n * @private\r\n */\r\nconst CylinderGeometryLibrary = {};\r\n\r\n/**\r\n * @private\r\n */\r\nCylinderGeometryLibrary.computePositions = function (\r\n length,\r\n topRadius,\r\n bottomRadius,\r\n slices,\r\n fill\r\n) {\r\n const topZ = length * 0.5;\r\n const bottomZ = -topZ;\r\n\r\n const twoSlice = slices + slices;\r\n const size = fill ? 2 * twoSlice : twoSlice;\r\n const positions = new Float64Array(size * 3);\r\n let i;\r\n let index = 0;\r\n let tbIndex = 0;\r\n const bottomOffset = fill ? twoSlice * 3 : 0;\r\n const topOffset = fill ? (twoSlice + slices) * 3 : slices * 3;\r\n\r\n for (i = 0; i < slices; i++) {\r\n const angle = (i / slices) * CesiumMath.TWO_PI;\r\n const x = Math.cos(angle);\r\n const y = Math.sin(angle);\r\n const bottomX = x * bottomRadius;\r\n const bottomY = y * bottomRadius;\r\n const topX = x * topRadius;\r\n const topY = y * topRadius;\r\n\r\n positions[tbIndex + bottomOffset] = bottomX;\r\n positions[tbIndex + bottomOffset + 1] = bottomY;\r\n positions[tbIndex + bottomOffset + 2] = bottomZ;\r\n\r\n positions[tbIndex + topOffset] = topX;\r\n positions[tbIndex + topOffset + 1] = topY;\r\n positions[tbIndex + topOffset + 2] = topZ;\r\n tbIndex += 3;\r\n if (fill) {\r\n positions[index++] = bottomX;\r\n positions[index++] = bottomY;\r\n positions[index++] = bottomZ;\r\n positions[index++] = topX;\r\n positions[index++] = topY;\r\n positions[index++] = topZ;\r\n }\r\n }\r\n\r\n return positions;\r\n};\r\nexport default CylinderGeometryLibrary;\r\n"],"names":["CesiumMath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC;EACA;EACA;EACA;EACA,uBAAuB,CAAC,gBAAgB,GAAG;EAC3C,EAAE,MAAM;EACR,EAAE,SAAS;EACX,EAAE,YAAY;EACd,EAAE,MAAM;EACR,EAAE,IAAI;EACN,EAAE;EACF,EAAE,MAAM,IAAI,GAAG,MAAM,GAAG,GAAG,CAAC;EAC5B,EAAE,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC;AACxB;EACA,EAAE,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;EACnC,EAAE,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,GAAG,QAAQ,GAAG,QAAQ,CAAC;EAC9C,EAAE,MAAM,SAAS,GAAG,IAAI,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;EAC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I,SAAS,CAAC,OAAO,GAAG,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;EAC9C,IAAI,OAAO,IAAI,CAAC,CAAC;EACjB,IAAI,IAAI,IAAI,EAAE;EACd,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;EACnC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;EACnC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC;EACnC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;EAChC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;EAChC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;EAChC,KAAK;EACL,GAAG;AACH;EACA,EAAE,OAAO,SAAS,CAAC;EACnB,CAAC,CAAC;AACF,kCAAe,uBAAuB;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/EllipseGeometry-6f0c1448.js b/examples/cesium/Workers/EllipseGeometry-6f0c1448.js
new file mode 100644
index 0000000..51e41b6
--- /dev/null
+++ b/examples/cesium/Workers/EllipseGeometry-6f0c1448.js
@@ -0,0 +1,1330 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Transforms-11fb6b0a', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './EllipseGeometryLibrary-d3f88cc2', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryInstance-b2be3e5a', './GeometryOffsetAttribute-cc320d7d', './GeometryPipeline-f28890f4', './IndexDatatype-b4e5cf89', './Math-9be8b918', './VertexFormat-f2d74c96'], (function (exports, Transforms, Matrix2, Matrix3, Check, ComponentDatatype, defaultValue, EllipseGeometryLibrary, GeometryAttribute, GeometryAttributes, GeometryInstance, GeometryOffsetAttribute, GeometryPipeline, IndexDatatype, Math$1, VertexFormat) { 'use strict';
+
+ const scratchCartesian1 = new Matrix3.Cartesian3();
+ const scratchCartesian2 = new Matrix3.Cartesian3();
+ const scratchCartesian3 = new Matrix3.Cartesian3();
+ const scratchCartesian4 = new Matrix3.Cartesian3();
+ const texCoordScratch = new Matrix2.Cartesian2();
+ const textureMatrixScratch = new Matrix3.Matrix3();
+ const tangentMatrixScratch = new Matrix3.Matrix3();
+ const quaternionScratch = new Transforms.Quaternion();
+
+ const scratchNormal = new Matrix3.Cartesian3();
+ const scratchTangent = new Matrix3.Cartesian3();
+ const scratchBitangent = new Matrix3.Cartesian3();
+
+ const scratchCartographic = new Matrix3.Cartographic();
+ const projectedCenterScratch = new Matrix3.Cartesian3();
+
+ const scratchMinTexCoord = new Matrix2.Cartesian2();
+ const scratchMaxTexCoord = new Matrix2.Cartesian2();
+
+ function computeTopBottomAttributes(positions, options, extrude) {
+ const vertexFormat = options.vertexFormat;
+ const center = options.center;
+ const semiMajorAxis = options.semiMajorAxis;
+ const semiMinorAxis = options.semiMinorAxis;
+ const ellipsoid = options.ellipsoid;
+ const stRotation = options.stRotation;
+ const size = extrude ? (positions.length / 3) * 2 : positions.length / 3;
+ const shadowVolume = options.shadowVolume;
+
+ const textureCoordinates = vertexFormat.st
+ ? new Float32Array(size * 2)
+ : undefined;
+ const normals = vertexFormat.normal ? new Float32Array(size * 3) : undefined;
+ const tangents = vertexFormat.tangent
+ ? new Float32Array(size * 3)
+ : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(size * 3)
+ : undefined;
+
+ const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : undefined;
+
+ let textureCoordIndex = 0;
+
+ // Raise positions to a height above the ellipsoid and compute the
+ // texture coordinates, normals, tangents, and bitangents.
+ let normal = scratchNormal;
+ let tangent = scratchTangent;
+ let bitangent = scratchBitangent;
+
+ const projection = new Transforms.GeographicProjection(ellipsoid);
+ const projectedCenter = projection.project(
+ ellipsoid.cartesianToCartographic(center, scratchCartographic),
+ projectedCenterScratch
+ );
+
+ const geodeticNormal = ellipsoid.scaleToGeodeticSurface(
+ center,
+ scratchCartesian1
+ );
+ ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);
+
+ let textureMatrix = textureMatrixScratch;
+ let tangentMatrix = tangentMatrixScratch;
+ if (stRotation !== 0) {
+ let rotation = Transforms.Quaternion.fromAxisAngle(
+ geodeticNormal,
+ stRotation,
+ quaternionScratch
+ );
+ textureMatrix = Matrix3.Matrix3.fromQuaternion(rotation, textureMatrix);
+
+ rotation = Transforms.Quaternion.fromAxisAngle(
+ geodeticNormal,
+ -stRotation,
+ quaternionScratch
+ );
+ tangentMatrix = Matrix3.Matrix3.fromQuaternion(rotation, tangentMatrix);
+ } else {
+ textureMatrix = Matrix3.Matrix3.clone(Matrix3.Matrix3.IDENTITY, textureMatrix);
+ tangentMatrix = Matrix3.Matrix3.clone(Matrix3.Matrix3.IDENTITY, tangentMatrix);
+ }
+
+ const minTexCoord = Matrix2.Cartesian2.fromElements(
+ Number.POSITIVE_INFINITY,
+ Number.POSITIVE_INFINITY,
+ scratchMinTexCoord
+ );
+ const maxTexCoord = Matrix2.Cartesian2.fromElements(
+ Number.NEGATIVE_INFINITY,
+ Number.NEGATIVE_INFINITY,
+ scratchMaxTexCoord
+ );
+
+ let length = positions.length;
+ const bottomOffset = extrude ? length : 0;
+ const stOffset = (bottomOffset / 3) * 2;
+ for (let i = 0; i < length; i += 3) {
+ const i1 = i + 1;
+ const i2 = i + 2;
+ const position = Matrix3.Cartesian3.fromArray(positions, i, scratchCartesian1);
+
+ if (vertexFormat.st) {
+ const rotatedPoint = Matrix3.Matrix3.multiplyByVector(
+ textureMatrix,
+ position,
+ scratchCartesian2
+ );
+ const projectedPoint = projection.project(
+ ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic),
+ scratchCartesian3
+ );
+ Matrix3.Cartesian3.subtract(projectedPoint, projectedCenter, projectedPoint);
+
+ texCoordScratch.x =
+ (projectedPoint.x + semiMajorAxis) / (2.0 * semiMajorAxis);
+ texCoordScratch.y =
+ (projectedPoint.y + semiMinorAxis) / (2.0 * semiMinorAxis);
+
+ minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);
+ minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);
+ maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);
+ maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);
+
+ if (extrude) {
+ textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;
+ textureCoordinates[textureCoordIndex + 1 + stOffset] =
+ texCoordScratch.y;
+ }
+
+ textureCoordinates[textureCoordIndex++] = texCoordScratch.x;
+ textureCoordinates[textureCoordIndex++] = texCoordScratch.y;
+ }
+
+ if (
+ vertexFormat.normal ||
+ vertexFormat.tangent ||
+ vertexFormat.bitangent ||
+ shadowVolume
+ ) {
+ normal = ellipsoid.geodeticSurfaceNormal(position, normal);
+
+ if (shadowVolume) {
+ extrudeNormals[i + bottomOffset] = -normal.x;
+ extrudeNormals[i1 + bottomOffset] = -normal.y;
+ extrudeNormals[i2 + bottomOffset] = -normal.z;
+ }
+
+ if (
+ vertexFormat.normal ||
+ vertexFormat.tangent ||
+ vertexFormat.bitangent
+ ) {
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ tangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(Matrix3.Cartesian3.UNIT_Z, normal, tangent),
+ tangent
+ );
+ Matrix3.Matrix3.multiplyByVector(tangentMatrix, tangent, tangent);
+ }
+ if (vertexFormat.normal) {
+ normals[i] = normal.x;
+ normals[i1] = normal.y;
+ normals[i2] = normal.z;
+ if (extrude) {
+ normals[i + bottomOffset] = -normal.x;
+ normals[i1 + bottomOffset] = -normal.y;
+ normals[i2 + bottomOffset] = -normal.z;
+ }
+ }
+
+ if (vertexFormat.tangent) {
+ tangents[i] = tangent.x;
+ tangents[i1] = tangent.y;
+ tangents[i2] = tangent.z;
+ if (extrude) {
+ tangents[i + bottomOffset] = -tangent.x;
+ tangents[i1 + bottomOffset] = -tangent.y;
+ tangents[i2 + bottomOffset] = -tangent.z;
+ }
+ }
+
+ if (vertexFormat.bitangent) {
+ bitangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(normal, tangent, bitangent),
+ bitangent
+ );
+ bitangents[i] = bitangent.x;
+ bitangents[i1] = bitangent.y;
+ bitangents[i2] = bitangent.z;
+ if (extrude) {
+ bitangents[i + bottomOffset] = bitangent.x;
+ bitangents[i1 + bottomOffset] = bitangent.y;
+ bitangents[i2 + bottomOffset] = bitangent.z;
+ }
+ }
+ }
+ }
+ }
+
+ if (vertexFormat.st) {
+ length = textureCoordinates.length;
+ for (let k = 0; k < length; k += 2) {
+ textureCoordinates[k] =
+ (textureCoordinates[k] - minTexCoord.x) /
+ (maxTexCoord.x - minTexCoord.x);
+ textureCoordinates[k + 1] =
+ (textureCoordinates[k + 1] - minTexCoord.y) /
+ (maxTexCoord.y - minTexCoord.y);
+ }
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+
+ if (vertexFormat.position) {
+ const finalPositions = EllipseGeometryLibrary.EllipseGeometryLibrary.raisePositionsToHeight(
+ positions,
+ options,
+ extrude
+ );
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: finalPositions,
+ });
+ }
+
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates,
+ });
+ }
+
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents,
+ });
+ }
+
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents,
+ });
+ }
+
+ if (shadowVolume) {
+ attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: extrudeNormals,
+ });
+ }
+
+ if (extrude && defaultValue.defined(options.offsetAttribute)) {
+ let offsetAttribute = new Uint8Array(size);
+ if (options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else {
+ const offsetValue =
+ options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute,
+ });
+ }
+
+ return attributes;
+ }
+
+ function topIndices(numPts) {
+ // numTriangles in half = 3 + 8 + 12 + ... = -1 + 4 + (4 + 4) + (4 + 4 + 4) + ... = -1 + 4 * (1 + 2 + 3 + ...)
+ // = -1 + 4 * ((n * ( n + 1)) / 2)
+ // total triangles = 2 * numTrangles in half
+ // indices = total triangles * 3;
+ // Substitute numPts for n above
+
+ const indices = new Array(12 * (numPts * (numPts + 1)) - 6);
+ let indicesIndex = 0;
+ let prevIndex;
+ let numInterior;
+ let positionIndex;
+ let i;
+ let j;
+ // Indices triangles to the 'right' of the north vector
+
+ prevIndex = 0;
+ positionIndex = 1;
+ for (i = 0; i < 3; i++) {
+ indices[indicesIndex++] = positionIndex++;
+ indices[indicesIndex++] = prevIndex;
+ indices[indicesIndex++] = positionIndex;
+ }
+
+ for (i = 2; i < numPts + 1; ++i) {
+ positionIndex = i * (i + 1) - 1;
+ prevIndex = (i - 1) * i - 1;
+
+ indices[indicesIndex++] = positionIndex++;
+ indices[indicesIndex++] = prevIndex;
+ indices[indicesIndex++] = positionIndex;
+
+ numInterior = 2 * i;
+ for (j = 0; j < numInterior - 1; ++j) {
+ indices[indicesIndex++] = positionIndex;
+ indices[indicesIndex++] = prevIndex++;
+ indices[indicesIndex++] = prevIndex;
+
+ indices[indicesIndex++] = positionIndex++;
+ indices[indicesIndex++] = prevIndex;
+ indices[indicesIndex++] = positionIndex;
+ }
+
+ indices[indicesIndex++] = positionIndex++;
+ indices[indicesIndex++] = prevIndex;
+ indices[indicesIndex++] = positionIndex;
+ }
+
+ // Indices for center column of triangles
+ numInterior = numPts * 2;
+ ++positionIndex;
+ ++prevIndex;
+ for (i = 0; i < numInterior - 1; ++i) {
+ indices[indicesIndex++] = positionIndex;
+ indices[indicesIndex++] = prevIndex++;
+ indices[indicesIndex++] = prevIndex;
+
+ indices[indicesIndex++] = positionIndex++;
+ indices[indicesIndex++] = prevIndex;
+ indices[indicesIndex++] = positionIndex;
+ }
+
+ indices[indicesIndex++] = positionIndex;
+ indices[indicesIndex++] = prevIndex++;
+ indices[indicesIndex++] = prevIndex;
+
+ indices[indicesIndex++] = positionIndex++;
+ indices[indicesIndex++] = prevIndex++;
+ indices[indicesIndex++] = prevIndex;
+
+ // Reverse the process creating indices to the 'left' of the north vector
+ ++prevIndex;
+ for (i = numPts - 1; i > 1; --i) {
+ indices[indicesIndex++] = prevIndex++;
+ indices[indicesIndex++] = prevIndex;
+ indices[indicesIndex++] = positionIndex;
+
+ numInterior = 2 * i;
+ for (j = 0; j < numInterior - 1; ++j) {
+ indices[indicesIndex++] = positionIndex;
+ indices[indicesIndex++] = prevIndex++;
+ indices[indicesIndex++] = prevIndex;
+
+ indices[indicesIndex++] = positionIndex++;
+ indices[indicesIndex++] = prevIndex;
+ indices[indicesIndex++] = positionIndex;
+ }
+
+ indices[indicesIndex++] = prevIndex++;
+ indices[indicesIndex++] = prevIndex++;
+ indices[indicesIndex++] = positionIndex++;
+ }
+
+ for (i = 0; i < 3; i++) {
+ indices[indicesIndex++] = prevIndex++;
+ indices[indicesIndex++] = prevIndex;
+ indices[indicesIndex++] = positionIndex;
+ }
+ return indices;
+ }
+
+ let boundingSphereCenter = new Matrix3.Cartesian3();
+
+ function computeEllipse(options) {
+ const center = options.center;
+ boundingSphereCenter = Matrix3.Cartesian3.multiplyByScalar(
+ options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),
+ options.height,
+ boundingSphereCenter
+ );
+ boundingSphereCenter = Matrix3.Cartesian3.add(
+ center,
+ boundingSphereCenter,
+ boundingSphereCenter
+ );
+ const boundingSphere = new Transforms.BoundingSphere(
+ boundingSphereCenter,
+ options.semiMajorAxis
+ );
+ const cep = EllipseGeometryLibrary.EllipseGeometryLibrary.computeEllipsePositions(
+ options,
+ true,
+ false
+ );
+ const positions = cep.positions;
+ const numPts = cep.numPts;
+ const attributes = computeTopBottomAttributes(positions, options, false);
+ let indices = topIndices(numPts);
+ indices = IndexDatatype.IndexDatatype.createTypedArray(positions.length / 3, indices);
+ return {
+ boundingSphere: boundingSphere,
+ attributes: attributes,
+ indices: indices,
+ };
+ }
+
+ function computeWallAttributes(positions, options) {
+ const vertexFormat = options.vertexFormat;
+ const center = options.center;
+ const semiMajorAxis = options.semiMajorAxis;
+ const semiMinorAxis = options.semiMinorAxis;
+ const ellipsoid = options.ellipsoid;
+ const height = options.height;
+ const extrudedHeight = options.extrudedHeight;
+ const stRotation = options.stRotation;
+ const size = (positions.length / 3) * 2;
+
+ const finalPositions = new Float64Array(size * 3);
+ const textureCoordinates = vertexFormat.st
+ ? new Float32Array(size * 2)
+ : undefined;
+ const normals = vertexFormat.normal ? new Float32Array(size * 3) : undefined;
+ const tangents = vertexFormat.tangent
+ ? new Float32Array(size * 3)
+ : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(size * 3)
+ : undefined;
+
+ const shadowVolume = options.shadowVolume;
+ const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : undefined;
+
+ let textureCoordIndex = 0;
+
+ // Raise positions to a height above the ellipsoid and compute the
+ // texture coordinates, normals, tangents, and bitangents.
+ let normal = scratchNormal;
+ let tangent = scratchTangent;
+ let bitangent = scratchBitangent;
+
+ const projection = new Transforms.GeographicProjection(ellipsoid);
+ const projectedCenter = projection.project(
+ ellipsoid.cartesianToCartographic(center, scratchCartographic),
+ projectedCenterScratch
+ );
+
+ const geodeticNormal = ellipsoid.scaleToGeodeticSurface(
+ center,
+ scratchCartesian1
+ );
+ ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);
+ const rotation = Transforms.Quaternion.fromAxisAngle(
+ geodeticNormal,
+ stRotation,
+ quaternionScratch
+ );
+ const textureMatrix = Matrix3.Matrix3.fromQuaternion(rotation, textureMatrixScratch);
+
+ const minTexCoord = Matrix2.Cartesian2.fromElements(
+ Number.POSITIVE_INFINITY,
+ Number.POSITIVE_INFINITY,
+ scratchMinTexCoord
+ );
+ const maxTexCoord = Matrix2.Cartesian2.fromElements(
+ Number.NEGATIVE_INFINITY,
+ Number.NEGATIVE_INFINITY,
+ scratchMaxTexCoord
+ );
+
+ let length = positions.length;
+ const stOffset = (length / 3) * 2;
+ for (let i = 0; i < length; i += 3) {
+ const i1 = i + 1;
+ const i2 = i + 2;
+ let position = Matrix3.Cartesian3.fromArray(positions, i, scratchCartesian1);
+ let extrudedPosition;
+
+ if (vertexFormat.st) {
+ const rotatedPoint = Matrix3.Matrix3.multiplyByVector(
+ textureMatrix,
+ position,
+ scratchCartesian2
+ );
+ const projectedPoint = projection.project(
+ ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic),
+ scratchCartesian3
+ );
+ Matrix3.Cartesian3.subtract(projectedPoint, projectedCenter, projectedPoint);
+
+ texCoordScratch.x =
+ (projectedPoint.x + semiMajorAxis) / (2.0 * semiMajorAxis);
+ texCoordScratch.y =
+ (projectedPoint.y + semiMinorAxis) / (2.0 * semiMinorAxis);
+
+ minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);
+ minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);
+ maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);
+ maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);
+
+ textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;
+ textureCoordinates[textureCoordIndex + 1 + stOffset] = texCoordScratch.y;
+
+ textureCoordinates[textureCoordIndex++] = texCoordScratch.x;
+ textureCoordinates[textureCoordIndex++] = texCoordScratch.y;
+ }
+
+ position = ellipsoid.scaleToGeodeticSurface(position, position);
+ extrudedPosition = Matrix3.Cartesian3.clone(position, scratchCartesian2);
+ normal = ellipsoid.geodeticSurfaceNormal(position, normal);
+
+ if (shadowVolume) {
+ extrudeNormals[i + length] = -normal.x;
+ extrudeNormals[i1 + length] = -normal.y;
+ extrudeNormals[i2 + length] = -normal.z;
+ }
+
+ let scaledNormal = Matrix3.Cartesian3.multiplyByScalar(
+ normal,
+ height,
+ scratchCartesian4
+ );
+ position = Matrix3.Cartesian3.add(position, scaledNormal, position);
+ scaledNormal = Matrix3.Cartesian3.multiplyByScalar(
+ normal,
+ extrudedHeight,
+ scaledNormal
+ );
+ extrudedPosition = Matrix3.Cartesian3.add(
+ extrudedPosition,
+ scaledNormal,
+ extrudedPosition
+ );
+
+ if (vertexFormat.position) {
+ finalPositions[i + length] = extrudedPosition.x;
+ finalPositions[i1 + length] = extrudedPosition.y;
+ finalPositions[i2 + length] = extrudedPosition.z;
+
+ finalPositions[i] = position.x;
+ finalPositions[i1] = position.y;
+ finalPositions[i2] = position.z;
+ }
+
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
+ bitangent = Matrix3.Cartesian3.clone(normal, bitangent);
+ const next = Matrix3.Cartesian3.fromArray(
+ positions,
+ (i + 3) % length,
+ scratchCartesian4
+ );
+ Matrix3.Cartesian3.subtract(next, position, next);
+ const bottom = Matrix3.Cartesian3.subtract(
+ extrudedPosition,
+ position,
+ scratchCartesian3
+ );
+
+ normal = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(bottom, next, normal),
+ normal
+ );
+
+ if (vertexFormat.normal) {
+ normals[i] = normal.x;
+ normals[i1] = normal.y;
+ normals[i2] = normal.z;
+
+ normals[i + length] = normal.x;
+ normals[i1 + length] = normal.y;
+ normals[i2 + length] = normal.z;
+ }
+
+ if (vertexFormat.tangent) {
+ tangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(bitangent, normal, tangent),
+ tangent
+ );
+ tangents[i] = tangent.x;
+ tangents[i1] = tangent.y;
+ tangents[i2] = tangent.z;
+
+ tangents[i + length] = tangent.x;
+ tangents[i + 1 + length] = tangent.y;
+ tangents[i + 2 + length] = tangent.z;
+ }
+
+ if (vertexFormat.bitangent) {
+ bitangents[i] = bitangent.x;
+ bitangents[i1] = bitangent.y;
+ bitangents[i2] = bitangent.z;
+
+ bitangents[i + length] = bitangent.x;
+ bitangents[i1 + length] = bitangent.y;
+ bitangents[i2 + length] = bitangent.z;
+ }
+ }
+ }
+
+ if (vertexFormat.st) {
+ length = textureCoordinates.length;
+ for (let k = 0; k < length; k += 2) {
+ textureCoordinates[k] =
+ (textureCoordinates[k] - minTexCoord.x) /
+ (maxTexCoord.x - minTexCoord.x);
+ textureCoordinates[k + 1] =
+ (textureCoordinates[k + 1] - minTexCoord.y) /
+ (maxTexCoord.y - minTexCoord.y);
+ }
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: finalPositions,
+ });
+ }
+
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates,
+ });
+ }
+
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents,
+ });
+ }
+
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents,
+ });
+ }
+
+ if (shadowVolume) {
+ attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: extrudeNormals,
+ });
+ }
+
+ if (defaultValue.defined(options.offsetAttribute)) {
+ let offsetAttribute = new Uint8Array(size);
+ if (options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else {
+ const offsetValue =
+ options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute,
+ });
+ }
+
+ return attributes;
+ }
+
+ function computeWallIndices(positions) {
+ const length = positions.length / 3;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(length, length * 6);
+ let index = 0;
+ for (let i = 0; i < length; i++) {
+ const UL = i;
+ const LL = i + length;
+ const UR = (UL + 1) % length;
+ const LR = UR + length;
+ indices[index++] = UL;
+ indices[index++] = LL;
+ indices[index++] = UR;
+ indices[index++] = UR;
+ indices[index++] = LL;
+ indices[index++] = LR;
+ }
+
+ return indices;
+ }
+
+ const topBoundingSphere = new Transforms.BoundingSphere();
+ const bottomBoundingSphere = new Transforms.BoundingSphere();
+
+ function computeExtrudedEllipse(options) {
+ const center = options.center;
+ const ellipsoid = options.ellipsoid;
+ const semiMajorAxis = options.semiMajorAxis;
+ let scaledNormal = Matrix3.Cartesian3.multiplyByScalar(
+ ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),
+ options.height,
+ scratchCartesian1
+ );
+ topBoundingSphere.center = Matrix3.Cartesian3.add(
+ center,
+ scaledNormal,
+ topBoundingSphere.center
+ );
+ topBoundingSphere.radius = semiMajorAxis;
+
+ scaledNormal = Matrix3.Cartesian3.multiplyByScalar(
+ ellipsoid.geodeticSurfaceNormal(center, scaledNormal),
+ options.extrudedHeight,
+ scaledNormal
+ );
+ bottomBoundingSphere.center = Matrix3.Cartesian3.add(
+ center,
+ scaledNormal,
+ bottomBoundingSphere.center
+ );
+ bottomBoundingSphere.radius = semiMajorAxis;
+
+ const cep = EllipseGeometryLibrary.EllipseGeometryLibrary.computeEllipsePositions(
+ options,
+ true,
+ true
+ );
+ const positions = cep.positions;
+ const numPts = cep.numPts;
+ const outerPositions = cep.outerPositions;
+ const boundingSphere = Transforms.BoundingSphere.union(
+ topBoundingSphere,
+ bottomBoundingSphere
+ );
+ const topBottomAttributes = computeTopBottomAttributes(
+ positions,
+ options,
+ true
+ );
+ let indices = topIndices(numPts);
+ const length = indices.length;
+ indices.length = length * 2;
+ const posLength = positions.length / 3;
+ for (let i = 0; i < length; i += 3) {
+ indices[i + length] = indices[i + 2] + posLength;
+ indices[i + 1 + length] = indices[i + 1] + posLength;
+ indices[i + 2 + length] = indices[i] + posLength;
+ }
+
+ const topBottomIndices = IndexDatatype.IndexDatatype.createTypedArray(
+ (posLength * 2) / 3,
+ indices
+ );
+
+ const topBottomGeo = new GeometryAttribute.Geometry({
+ attributes: topBottomAttributes,
+ indices: topBottomIndices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ });
+
+ const wallAttributes = computeWallAttributes(outerPositions, options);
+ indices = computeWallIndices(outerPositions);
+ const wallIndices = IndexDatatype.IndexDatatype.createTypedArray(
+ (outerPositions.length * 2) / 3,
+ indices
+ );
+
+ const wallGeo = new GeometryAttribute.Geometry({
+ attributes: wallAttributes,
+ indices: wallIndices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ });
+
+ const geo = GeometryPipeline.GeometryPipeline.combineInstances([
+ new GeometryInstance.GeometryInstance({
+ geometry: topBottomGeo,
+ }),
+ new GeometryInstance.GeometryInstance({
+ geometry: wallGeo,
+ }),
+ ]);
+
+ return {
+ boundingSphere: boundingSphere,
+ attributes: geo[0].attributes,
+ indices: geo[0].indices,
+ };
+ }
+
+ function computeRectangle(
+ center,
+ semiMajorAxis,
+ semiMinorAxis,
+ rotation,
+ granularity,
+ ellipsoid,
+ result
+ ) {
+ const cep = EllipseGeometryLibrary.EllipseGeometryLibrary.computeEllipsePositions(
+ {
+ center: center,
+ semiMajorAxis: semiMajorAxis,
+ semiMinorAxis: semiMinorAxis,
+ rotation: rotation,
+ granularity: granularity,
+ },
+ false,
+ true
+ );
+ const positionsFlat = cep.outerPositions;
+ const positionsCount = positionsFlat.length / 3;
+ const positions = new Array(positionsCount);
+ for (let i = 0; i < positionsCount; ++i) {
+ positions[i] = Matrix3.Cartesian3.fromArray(positionsFlat, i * 3);
+ }
+ const rectangle = Matrix2.Rectangle.fromCartesianArray(positions, ellipsoid, result);
+ // Rectangle width goes beyond 180 degrees when the ellipse crosses a pole.
+ // When this happens, make the rectangle into a "circle" around the pole
+ if (rectangle.width > Math$1.CesiumMath.PI) {
+ rectangle.north =
+ rectangle.north > 0.0
+ ? Math$1.CesiumMath.PI_OVER_TWO - Math$1.CesiumMath.EPSILON7
+ : rectangle.north;
+ rectangle.south =
+ rectangle.south < 0.0
+ ? Math$1.CesiumMath.EPSILON7 - Math$1.CesiumMath.PI_OVER_TWO
+ : rectangle.south;
+ rectangle.east = Math$1.CesiumMath.PI;
+ rectangle.west = -Math$1.CesiumMath.PI;
+ }
+ return rectangle;
+ }
+
+ /**
+ * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
+ *
+ * @alias EllipseGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.
+ * @param {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.
+ * @param {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.
+ * @param {Number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface.
+ * @param {Number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface.
+ * @param {Number} [options.rotation=0.0] The angle of rotation counter-clockwise from north.
+ * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates counter-clockwise from north.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The angular distance between points on the ellipse in radians.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ *
+ * @exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero.
+ * @exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis.
+ * @exception {DeveloperError} granularity must be greater than zero.
+ *
+ *
+ * @example
+ * // Create an ellipse.
+ * const ellipse = new Cesium.EllipseGeometry({
+ * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
+ * semiMajorAxis : 500000.0,
+ * semiMinorAxis : 300000.0,
+ * rotation : Cesium.Math.toRadians(60.0)
+ * });
+ * const geometry = Cesium.EllipseGeometry.createGeometry(ellipse);
+ *
+ * @see EllipseGeometry.createGeometry
+ */
+ function EllipseGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const center = options.center;
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ const semiMajorAxis = options.semiMajorAxis;
+ const semiMinorAxis = options.semiMinorAxis;
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("options.center", center);
+ Check.Check.typeOf.number("options.semiMajorAxis", semiMajorAxis);
+ Check.Check.typeOf.number("options.semiMinorAxis", semiMinorAxis);
+ if (semiMajorAxis < semiMinorAxis) {
+ throw new Check.DeveloperError(
+ "semiMajorAxis must be greater than or equal to the semiMinorAxis."
+ );
+ }
+ if (granularity <= 0.0) {
+ throw new Check.DeveloperError("granularity must be greater than zero.");
+ }
+ //>>includeEnd('debug');
+
+ const height = defaultValue.defaultValue(options.height, 0.0);
+ const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
+
+ this._center = Matrix3.Cartesian3.clone(center);
+ this._semiMajorAxis = semiMajorAxis;
+ this._semiMinorAxis = semiMinorAxis;
+ this._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid);
+ this._rotation = defaultValue.defaultValue(options.rotation, 0.0);
+ this._stRotation = defaultValue.defaultValue(options.stRotation, 0.0);
+ this._height = Math.max(extrudedHeight, height);
+ this._granularity = granularity;
+ this._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat);
+ this._extrudedHeight = Math.min(extrudedHeight, height);
+ this._shadowVolume = defaultValue.defaultValue(options.shadowVolume, false);
+ this._workerName = "createEllipseGeometry";
+ this._offsetAttribute = options.offsetAttribute;
+
+ this._rectangle = undefined;
+ this._textureCoordinateRotationPoints = undefined;
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ EllipseGeometry.packedLength =
+ Matrix3.Cartesian3.packedLength +
+ Matrix3.Ellipsoid.packedLength +
+ VertexFormat.VertexFormat.packedLength +
+ 9;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {EllipseGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ EllipseGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ Matrix3.Cartesian3.pack(value._center, array, startingIndex);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ array[startingIndex++] = value._semiMajorAxis;
+ array[startingIndex++] = value._semiMinorAxis;
+ array[startingIndex++] = value._rotation;
+ array[startingIndex++] = value._stRotation;
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;
+ array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchCenter = new Matrix3.Cartesian3();
+ const scratchEllipsoid = new Matrix3.Ellipsoid();
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+ const scratchOptions = {
+ center: scratchCenter,
+ ellipsoid: scratchEllipsoid,
+ vertexFormat: scratchVertexFormat,
+ semiMajorAxis: undefined,
+ semiMinorAxis: undefined,
+ rotation: undefined,
+ stRotation: undefined,
+ height: undefined,
+ granularity: undefined,
+ extrudedHeight: undefined,
+ shadowVolume: undefined,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {EllipseGeometry} [result] The object into which to store the result.
+ * @returns {EllipseGeometry} The modified result parameter or a new EllipseGeometry instance if one was not provided.
+ */
+ EllipseGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const center = Matrix3.Cartesian3.unpack(array, startingIndex, scratchCenter);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ const semiMajorAxis = array[startingIndex++];
+ const semiMinorAxis = array[startingIndex++];
+ const rotation = array[startingIndex++];
+ const stRotation = array[startingIndex++];
+ const height = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const shadowVolume = array[startingIndex++] === 1.0;
+ const offsetAttribute = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.height = height;
+ scratchOptions.extrudedHeight = extrudedHeight;
+ scratchOptions.granularity = granularity;
+ scratchOptions.stRotation = stRotation;
+ scratchOptions.rotation = rotation;
+ scratchOptions.semiMajorAxis = semiMajorAxis;
+ scratchOptions.semiMinorAxis = semiMinorAxis;
+ scratchOptions.shadowVolume = shadowVolume;
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return new EllipseGeometry(scratchOptions);
+ }
+
+ result._center = Matrix3.Cartesian3.clone(center, result._center);
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._semiMajorAxis = semiMajorAxis;
+ result._semiMinorAxis = semiMinorAxis;
+ result._rotation = rotation;
+ result._stRotation = stRotation;
+ result._height = height;
+ result._granularity = granularity;
+ result._extrudedHeight = extrudedHeight;
+ result._shadowVolume = shadowVolume;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the bounding rectangle based on the provided options
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.
+ * @param {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.
+ * @param {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.
+ * @param {Number} [options.rotation=0.0] The angle of rotation counter-clockwise from north.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The angular distance between points on the ellipse in radians.
+ * @param {Rectangle} [result] An object in which to store the result
+ *
+ * @returns {Rectangle} The result rectangle
+ */
+ EllipseGeometry.computeRectangle = function (options, result) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const center = options.center;
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ const semiMajorAxis = options.semiMajorAxis;
+ const semiMinorAxis = options.semiMinorAxis;
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ const rotation = defaultValue.defaultValue(options.rotation, 0.0);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("options.center", center);
+ Check.Check.typeOf.number("options.semiMajorAxis", semiMajorAxis);
+ Check.Check.typeOf.number("options.semiMinorAxis", semiMinorAxis);
+ if (semiMajorAxis < semiMinorAxis) {
+ throw new Check.DeveloperError(
+ "semiMajorAxis must be greater than or equal to the semiMinorAxis."
+ );
+ }
+ if (granularity <= 0.0) {
+ throw new Check.DeveloperError("granularity must be greater than zero.");
+ }
+ //>>includeEnd('debug');
+
+ return computeRectangle(
+ center,
+ semiMajorAxis,
+ semiMinorAxis,
+ rotation,
+ granularity,
+ ellipsoid,
+ result
+ );
+ };
+
+ /**
+ * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {EllipseGeometry} ellipseGeometry A description of the ellipse.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ EllipseGeometry.createGeometry = function (ellipseGeometry) {
+ if (
+ ellipseGeometry._semiMajorAxis <= 0.0 ||
+ ellipseGeometry._semiMinorAxis <= 0.0
+ ) {
+ return;
+ }
+
+ const height = ellipseGeometry._height;
+ const extrudedHeight = ellipseGeometry._extrudedHeight;
+ const extrude = !Math$1.CesiumMath.equalsEpsilon(
+ height,
+ extrudedHeight,
+ 0,
+ Math$1.CesiumMath.EPSILON2
+ );
+
+ ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(
+ ellipseGeometry._center,
+ ellipseGeometry._center
+ );
+ const options = {
+ center: ellipseGeometry._center,
+ semiMajorAxis: ellipseGeometry._semiMajorAxis,
+ semiMinorAxis: ellipseGeometry._semiMinorAxis,
+ ellipsoid: ellipseGeometry._ellipsoid,
+ rotation: ellipseGeometry._rotation,
+ height: height,
+ granularity: ellipseGeometry._granularity,
+ vertexFormat: ellipseGeometry._vertexFormat,
+ stRotation: ellipseGeometry._stRotation,
+ };
+ let geometry;
+ if (extrude) {
+ options.extrudedHeight = extrudedHeight;
+ options.shadowVolume = ellipseGeometry._shadowVolume;
+ options.offsetAttribute = ellipseGeometry._offsetAttribute;
+ geometry = computeExtrudedEllipse(options);
+ } else {
+ geometry = computeEllipse(options);
+
+ if (defaultValue.defined(ellipseGeometry._offsetAttribute)) {
+ const length = geometry.attributes.position.values.length;
+ const offsetValue =
+ ellipseGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ boundingSphere: geometry.boundingSphere,
+ offsetAttribute: ellipseGeometry._offsetAttribute,
+ });
+ };
+
+ /**
+ * @private
+ */
+ EllipseGeometry.createShadowVolume = function (
+ ellipseGeometry,
+ minHeightFunc,
+ maxHeightFunc
+ ) {
+ const granularity = ellipseGeometry._granularity;
+ const ellipsoid = ellipseGeometry._ellipsoid;
+
+ const minHeight = minHeightFunc(granularity, ellipsoid);
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
+
+ return new EllipseGeometry({
+ center: ellipseGeometry._center,
+ semiMajorAxis: ellipseGeometry._semiMajorAxis,
+ semiMinorAxis: ellipseGeometry._semiMinorAxis,
+ ellipsoid: ellipsoid,
+ rotation: ellipseGeometry._rotation,
+ stRotation: ellipseGeometry._stRotation,
+ granularity: granularity,
+ extrudedHeight: minHeight,
+ height: maxHeight,
+ vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
+ shadowVolume: true,
+ });
+ };
+
+ function textureCoordinateRotationPoints(ellipseGeometry) {
+ const stRotation = -ellipseGeometry._stRotation;
+ if (stRotation === 0.0) {
+ return [0, 0, 0, 1, 1, 0];
+ }
+
+ const cep = EllipseGeometryLibrary.EllipseGeometryLibrary.computeEllipsePositions(
+ {
+ center: ellipseGeometry._center,
+ semiMajorAxis: ellipseGeometry._semiMajorAxis,
+ semiMinorAxis: ellipseGeometry._semiMinorAxis,
+ rotation: ellipseGeometry._rotation,
+ granularity: ellipseGeometry._granularity,
+ },
+ false,
+ true
+ );
+ const positionsFlat = cep.outerPositions;
+ const positionsCount = positionsFlat.length / 3;
+ const positions = new Array(positionsCount);
+ for (let i = 0; i < positionsCount; ++i) {
+ positions[i] = Matrix3.Cartesian3.fromArray(positionsFlat, i * 3);
+ }
+
+ const ellipsoid = ellipseGeometry._ellipsoid;
+ const boundingRectangle = ellipseGeometry.rectangle;
+ return GeometryAttribute.Geometry._textureCoordinateRotationPoints(
+ positions,
+ stRotation,
+ ellipsoid,
+ boundingRectangle
+ );
+ }
+
+ Object.defineProperties(EllipseGeometry.prototype, {
+ /**
+ * @private
+ */
+ rectangle: {
+ get: function () {
+ if (!defaultValue.defined(this._rectangle)) {
+ this._rectangle = computeRectangle(
+ this._center,
+ this._semiMajorAxis,
+ this._semiMinorAxis,
+ this._rotation,
+ this._granularity,
+ this._ellipsoid
+ );
+ }
+ return this._rectangle;
+ },
+ },
+ /**
+ * For remapping texture coordinates when rendering EllipseGeometries as GroundPrimitives.
+ * @private
+ */
+ textureCoordinateRotationPoints: {
+ get: function () {
+ if (!defaultValue.defined(this._textureCoordinateRotationPoints)) {
+ this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(
+ this
+ );
+ }
+ return this._textureCoordinateRotationPoints;
+ },
+ },
+ });
+
+ exports.EllipseGeometry = EllipseGeometry;
+
+}));
+//# sourceMappingURL=EllipseGeometry-6f0c1448.js.map
diff --git a/examples/cesium/Workers/EllipseGeometry-6f0c1448.js.map b/examples/cesium/Workers/EllipseGeometry-6f0c1448.js.map
new file mode 100644
index 0000000..4a0ba06
--- /dev/null
+++ b/examples/cesium/Workers/EllipseGeometry-6f0c1448.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"EllipseGeometry-6f0c1448.js","sources":["../../../Source/Core/EllipseGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport EllipseGeometryLibrary from \"./EllipseGeometryLibrary.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport GeographicProjection from \"./GeographicProjection.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryInstance from \"./GeometryInstance.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport GeometryPipeline from \"./GeometryPipeline.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\nconst scratchCartesian1 = new Cartesian3();\r\nconst scratchCartesian2 = new Cartesian3();\r\nconst scratchCartesian3 = new Cartesian3();\r\nconst scratchCartesian4 = new Cartesian3();\r\nconst texCoordScratch = new Cartesian2();\r\nconst textureMatrixScratch = new Matrix3();\r\nconst tangentMatrixScratch = new Matrix3();\r\nconst quaternionScratch = new Quaternion();\r\n\r\nconst scratchNormal = new Cartesian3();\r\nconst scratchTangent = new Cartesian3();\r\nconst scratchBitangent = new Cartesian3();\r\n\r\nconst scratchCartographic = new Cartographic();\r\nconst projectedCenterScratch = new Cartesian3();\r\n\r\nconst scratchMinTexCoord = new Cartesian2();\r\nconst scratchMaxTexCoord = new Cartesian2();\r\n\r\nfunction computeTopBottomAttributes(positions, options, extrude) {\r\n const vertexFormat = options.vertexFormat;\r\n const center = options.center;\r\n const semiMajorAxis = options.semiMajorAxis;\r\n const semiMinorAxis = options.semiMinorAxis;\r\n const ellipsoid = options.ellipsoid;\r\n const stRotation = options.stRotation;\r\n const size = extrude ? (positions.length / 3) * 2 : positions.length / 3;\r\n const shadowVolume = options.shadowVolume;\r\n\r\n const textureCoordinates = vertexFormat.st\r\n ? new Float32Array(size * 2)\r\n : undefined;\r\n const normals = vertexFormat.normal ? new Float32Array(size * 3) : undefined;\r\n const tangents = vertexFormat.tangent\r\n ? new Float32Array(size * 3)\r\n : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(size * 3)\r\n : undefined;\r\n\r\n const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : undefined;\r\n\r\n let textureCoordIndex = 0;\r\n\r\n // Raise positions to a height above the ellipsoid and compute the\r\n // texture coordinates, normals, tangents, and bitangents.\r\n let normal = scratchNormal;\r\n let tangent = scratchTangent;\r\n let bitangent = scratchBitangent;\r\n\r\n const projection = new GeographicProjection(ellipsoid);\r\n const projectedCenter = projection.project(\r\n ellipsoid.cartesianToCartographic(center, scratchCartographic),\r\n projectedCenterScratch\r\n );\r\n\r\n const geodeticNormal = ellipsoid.scaleToGeodeticSurface(\r\n center,\r\n scratchCartesian1\r\n );\r\n ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);\r\n\r\n let textureMatrix = textureMatrixScratch;\r\n let tangentMatrix = tangentMatrixScratch;\r\n if (stRotation !== 0) {\r\n let rotation = Quaternion.fromAxisAngle(\r\n geodeticNormal,\r\n stRotation,\r\n quaternionScratch\r\n );\r\n textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);\r\n\r\n rotation = Quaternion.fromAxisAngle(\r\n geodeticNormal,\r\n -stRotation,\r\n quaternionScratch\r\n );\r\n tangentMatrix = Matrix3.fromQuaternion(rotation, tangentMatrix);\r\n } else {\r\n textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix);\r\n tangentMatrix = Matrix3.clone(Matrix3.IDENTITY, tangentMatrix);\r\n }\r\n\r\n const minTexCoord = Cartesian2.fromElements(\r\n Number.POSITIVE_INFINITY,\r\n Number.POSITIVE_INFINITY,\r\n scratchMinTexCoord\r\n );\r\n const maxTexCoord = Cartesian2.fromElements(\r\n Number.NEGATIVE_INFINITY,\r\n Number.NEGATIVE_INFINITY,\r\n scratchMaxTexCoord\r\n );\r\n\r\n let length = positions.length;\r\n const bottomOffset = extrude ? length : 0;\r\n const stOffset = (bottomOffset / 3) * 2;\r\n for (let i = 0; i < length; i += 3) {\r\n const i1 = i + 1;\r\n const i2 = i + 2;\r\n const position = Cartesian3.fromArray(positions, i, scratchCartesian1);\r\n\r\n if (vertexFormat.st) {\r\n const rotatedPoint = Matrix3.multiplyByVector(\r\n textureMatrix,\r\n position,\r\n scratchCartesian2\r\n );\r\n const projectedPoint = projection.project(\r\n ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic),\r\n scratchCartesian3\r\n );\r\n Cartesian3.subtract(projectedPoint, projectedCenter, projectedPoint);\r\n\r\n texCoordScratch.x =\r\n (projectedPoint.x + semiMajorAxis) / (2.0 * semiMajorAxis);\r\n texCoordScratch.y =\r\n (projectedPoint.y + semiMinorAxis) / (2.0 * semiMinorAxis);\r\n\r\n minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);\r\n minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);\r\n maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);\r\n maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);\r\n\r\n if (extrude) {\r\n textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;\r\n textureCoordinates[textureCoordIndex + 1 + stOffset] =\r\n texCoordScratch.y;\r\n }\r\n\r\n textureCoordinates[textureCoordIndex++] = texCoordScratch.x;\r\n textureCoordinates[textureCoordIndex++] = texCoordScratch.y;\r\n }\r\n\r\n if (\r\n vertexFormat.normal ||\r\n vertexFormat.tangent ||\r\n vertexFormat.bitangent ||\r\n shadowVolume\r\n ) {\r\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\r\n\r\n if (shadowVolume) {\r\n extrudeNormals[i + bottomOffset] = -normal.x;\r\n extrudeNormals[i1 + bottomOffset] = -normal.y;\r\n extrudeNormals[i2 + bottomOffset] = -normal.z;\r\n }\r\n\r\n if (\r\n vertexFormat.normal ||\r\n vertexFormat.tangent ||\r\n vertexFormat.bitangent\r\n ) {\r\n if (vertexFormat.tangent || vertexFormat.bitangent) {\r\n tangent = Cartesian3.normalize(\r\n Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent),\r\n tangent\r\n );\r\n Matrix3.multiplyByVector(tangentMatrix, tangent, tangent);\r\n }\r\n if (vertexFormat.normal) {\r\n normals[i] = normal.x;\r\n normals[i1] = normal.y;\r\n normals[i2] = normal.z;\r\n if (extrude) {\r\n normals[i + bottomOffset] = -normal.x;\r\n normals[i1 + bottomOffset] = -normal.y;\r\n normals[i2 + bottomOffset] = -normal.z;\r\n }\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n tangents[i] = tangent.x;\r\n tangents[i1] = tangent.y;\r\n tangents[i2] = tangent.z;\r\n if (extrude) {\r\n tangents[i + bottomOffset] = -tangent.x;\r\n tangents[i1 + bottomOffset] = -tangent.y;\r\n tangents[i2 + bottomOffset] = -tangent.z;\r\n }\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n bitangent = Cartesian3.normalize(\r\n Cartesian3.cross(normal, tangent, bitangent),\r\n bitangent\r\n );\r\n bitangents[i] = bitangent.x;\r\n bitangents[i1] = bitangent.y;\r\n bitangents[i2] = bitangent.z;\r\n if (extrude) {\r\n bitangents[i + bottomOffset] = bitangent.x;\r\n bitangents[i1 + bottomOffset] = bitangent.y;\r\n bitangents[i2 + bottomOffset] = bitangent.z;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (vertexFormat.st) {\r\n length = textureCoordinates.length;\r\n for (let k = 0; k < length; k += 2) {\r\n textureCoordinates[k] =\r\n (textureCoordinates[k] - minTexCoord.x) /\r\n (maxTexCoord.x - minTexCoord.x);\r\n textureCoordinates[k + 1] =\r\n (textureCoordinates[k + 1] - minTexCoord.y) /\r\n (maxTexCoord.y - minTexCoord.y);\r\n }\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n\r\n if (vertexFormat.position) {\r\n const finalPositions = EllipseGeometryLibrary.raisePositionsToHeight(\r\n positions,\r\n options,\r\n extrude\r\n );\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: finalPositions,\r\n });\r\n }\r\n\r\n if (vertexFormat.st) {\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: textureCoordinates,\r\n });\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normals,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangents,\r\n });\r\n }\r\n\r\n if (shadowVolume) {\r\n attributes.extrudeDirection = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: extrudeNormals,\r\n });\r\n }\r\n\r\n if (extrude && defined(options.offsetAttribute)) {\r\n let offsetAttribute = new Uint8Array(size);\r\n if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\r\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\r\n } else {\r\n const offsetValue =\r\n options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\r\n offsetAttribute = offsetAttribute.fill(offsetValue);\r\n }\r\n\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: offsetAttribute,\r\n });\r\n }\r\n\r\n return attributes;\r\n}\r\n\r\nfunction topIndices(numPts) {\r\n // numTriangles in half = 3 + 8 + 12 + ... = -1 + 4 + (4 + 4) + (4 + 4 + 4) + ... = -1 + 4 * (1 + 2 + 3 + ...)\r\n // = -1 + 4 * ((n * ( n + 1)) / 2)\r\n // total triangles = 2 * numTrangles in half\r\n // indices = total triangles * 3;\r\n // Substitute numPts for n above\r\n\r\n const indices = new Array(12 * (numPts * (numPts + 1)) - 6);\r\n let indicesIndex = 0;\r\n let prevIndex;\r\n let numInterior;\r\n let positionIndex;\r\n let i;\r\n let j;\r\n // Indices triangles to the 'right' of the north vector\r\n\r\n prevIndex = 0;\r\n positionIndex = 1;\r\n for (i = 0; i < 3; i++) {\r\n indices[indicesIndex++] = positionIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n indices[indicesIndex++] = positionIndex;\r\n }\r\n\r\n for (i = 2; i < numPts + 1; ++i) {\r\n positionIndex = i * (i + 1) - 1;\r\n prevIndex = (i - 1) * i - 1;\r\n\r\n indices[indicesIndex++] = positionIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n indices[indicesIndex++] = positionIndex;\r\n\r\n numInterior = 2 * i;\r\n for (j = 0; j < numInterior - 1; ++j) {\r\n indices[indicesIndex++] = positionIndex;\r\n indices[indicesIndex++] = prevIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n\r\n indices[indicesIndex++] = positionIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n indices[indicesIndex++] = positionIndex;\r\n }\r\n\r\n indices[indicesIndex++] = positionIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n indices[indicesIndex++] = positionIndex;\r\n }\r\n\r\n // Indices for center column of triangles\r\n numInterior = numPts * 2;\r\n ++positionIndex;\r\n ++prevIndex;\r\n for (i = 0; i < numInterior - 1; ++i) {\r\n indices[indicesIndex++] = positionIndex;\r\n indices[indicesIndex++] = prevIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n\r\n indices[indicesIndex++] = positionIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n indices[indicesIndex++] = positionIndex;\r\n }\r\n\r\n indices[indicesIndex++] = positionIndex;\r\n indices[indicesIndex++] = prevIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n\r\n indices[indicesIndex++] = positionIndex++;\r\n indices[indicesIndex++] = prevIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n\r\n // Reverse the process creating indices to the 'left' of the north vector\r\n ++prevIndex;\r\n for (i = numPts - 1; i > 1; --i) {\r\n indices[indicesIndex++] = prevIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n indices[indicesIndex++] = positionIndex;\r\n\r\n numInterior = 2 * i;\r\n for (j = 0; j < numInterior - 1; ++j) {\r\n indices[indicesIndex++] = positionIndex;\r\n indices[indicesIndex++] = prevIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n\r\n indices[indicesIndex++] = positionIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n indices[indicesIndex++] = positionIndex;\r\n }\r\n\r\n indices[indicesIndex++] = prevIndex++;\r\n indices[indicesIndex++] = prevIndex++;\r\n indices[indicesIndex++] = positionIndex++;\r\n }\r\n\r\n for (i = 0; i < 3; i++) {\r\n indices[indicesIndex++] = prevIndex++;\r\n indices[indicesIndex++] = prevIndex;\r\n indices[indicesIndex++] = positionIndex;\r\n }\r\n return indices;\r\n}\r\n\r\nlet boundingSphereCenter = new Cartesian3();\r\n\r\nfunction computeEllipse(options) {\r\n const center = options.center;\r\n boundingSphereCenter = Cartesian3.multiplyByScalar(\r\n options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),\r\n options.height,\r\n boundingSphereCenter\r\n );\r\n boundingSphereCenter = Cartesian3.add(\r\n center,\r\n boundingSphereCenter,\r\n boundingSphereCenter\r\n );\r\n const boundingSphere = new BoundingSphere(\r\n boundingSphereCenter,\r\n options.semiMajorAxis\r\n );\r\n const cep = EllipseGeometryLibrary.computeEllipsePositions(\r\n options,\r\n true,\r\n false\r\n );\r\n const positions = cep.positions;\r\n const numPts = cep.numPts;\r\n const attributes = computeTopBottomAttributes(positions, options, false);\r\n let indices = topIndices(numPts);\r\n indices = IndexDatatype.createTypedArray(positions.length / 3, indices);\r\n return {\r\n boundingSphere: boundingSphere,\r\n attributes: attributes,\r\n indices: indices,\r\n };\r\n}\r\n\r\nfunction computeWallAttributes(positions, options) {\r\n const vertexFormat = options.vertexFormat;\r\n const center = options.center;\r\n const semiMajorAxis = options.semiMajorAxis;\r\n const semiMinorAxis = options.semiMinorAxis;\r\n const ellipsoid = options.ellipsoid;\r\n const height = options.height;\r\n const extrudedHeight = options.extrudedHeight;\r\n const stRotation = options.stRotation;\r\n const size = (positions.length / 3) * 2;\r\n\r\n const finalPositions = new Float64Array(size * 3);\r\n const textureCoordinates = vertexFormat.st\r\n ? new Float32Array(size * 2)\r\n : undefined;\r\n const normals = vertexFormat.normal ? new Float32Array(size * 3) : undefined;\r\n const tangents = vertexFormat.tangent\r\n ? new Float32Array(size * 3)\r\n : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(size * 3)\r\n : undefined;\r\n\r\n const shadowVolume = options.shadowVolume;\r\n const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : undefined;\r\n\r\n let textureCoordIndex = 0;\r\n\r\n // Raise positions to a height above the ellipsoid and compute the\r\n // texture coordinates, normals, tangents, and bitangents.\r\n let normal = scratchNormal;\r\n let tangent = scratchTangent;\r\n let bitangent = scratchBitangent;\r\n\r\n const projection = new GeographicProjection(ellipsoid);\r\n const projectedCenter = projection.project(\r\n ellipsoid.cartesianToCartographic(center, scratchCartographic),\r\n projectedCenterScratch\r\n );\r\n\r\n const geodeticNormal = ellipsoid.scaleToGeodeticSurface(\r\n center,\r\n scratchCartesian1\r\n );\r\n ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);\r\n const rotation = Quaternion.fromAxisAngle(\r\n geodeticNormal,\r\n stRotation,\r\n quaternionScratch\r\n );\r\n const textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrixScratch);\r\n\r\n const minTexCoord = Cartesian2.fromElements(\r\n Number.POSITIVE_INFINITY,\r\n Number.POSITIVE_INFINITY,\r\n scratchMinTexCoord\r\n );\r\n const maxTexCoord = Cartesian2.fromElements(\r\n Number.NEGATIVE_INFINITY,\r\n Number.NEGATIVE_INFINITY,\r\n scratchMaxTexCoord\r\n );\r\n\r\n let length = positions.length;\r\n const stOffset = (length / 3) * 2;\r\n for (let i = 0; i < length; i += 3) {\r\n const i1 = i + 1;\r\n const i2 = i + 2;\r\n let position = Cartesian3.fromArray(positions, i, scratchCartesian1);\r\n let extrudedPosition;\r\n\r\n if (vertexFormat.st) {\r\n const rotatedPoint = Matrix3.multiplyByVector(\r\n textureMatrix,\r\n position,\r\n scratchCartesian2\r\n );\r\n const projectedPoint = projection.project(\r\n ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic),\r\n scratchCartesian3\r\n );\r\n Cartesian3.subtract(projectedPoint, projectedCenter, projectedPoint);\r\n\r\n texCoordScratch.x =\r\n (projectedPoint.x + semiMajorAxis) / (2.0 * semiMajorAxis);\r\n texCoordScratch.y =\r\n (projectedPoint.y + semiMinorAxis) / (2.0 * semiMinorAxis);\r\n\r\n minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);\r\n minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);\r\n maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);\r\n maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);\r\n\r\n textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;\r\n textureCoordinates[textureCoordIndex + 1 + stOffset] = texCoordScratch.y;\r\n\r\n textureCoordinates[textureCoordIndex++] = texCoordScratch.x;\r\n textureCoordinates[textureCoordIndex++] = texCoordScratch.y;\r\n }\r\n\r\n position = ellipsoid.scaleToGeodeticSurface(position, position);\r\n extrudedPosition = Cartesian3.clone(position, scratchCartesian2);\r\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\r\n\r\n if (shadowVolume) {\r\n extrudeNormals[i + length] = -normal.x;\r\n extrudeNormals[i1 + length] = -normal.y;\r\n extrudeNormals[i2 + length] = -normal.z;\r\n }\r\n\r\n let scaledNormal = Cartesian3.multiplyByScalar(\r\n normal,\r\n height,\r\n scratchCartesian4\r\n );\r\n position = Cartesian3.add(position, scaledNormal, position);\r\n scaledNormal = Cartesian3.multiplyByScalar(\r\n normal,\r\n extrudedHeight,\r\n scaledNormal\r\n );\r\n extrudedPosition = Cartesian3.add(\r\n extrudedPosition,\r\n scaledNormal,\r\n extrudedPosition\r\n );\r\n\r\n if (vertexFormat.position) {\r\n finalPositions[i + length] = extrudedPosition.x;\r\n finalPositions[i1 + length] = extrudedPosition.y;\r\n finalPositions[i2 + length] = extrudedPosition.z;\r\n\r\n finalPositions[i] = position.x;\r\n finalPositions[i1] = position.y;\r\n finalPositions[i2] = position.z;\r\n }\r\n\r\n if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\r\n bitangent = Cartesian3.clone(normal, bitangent);\r\n const next = Cartesian3.fromArray(\r\n positions,\r\n (i + 3) % length,\r\n scratchCartesian4\r\n );\r\n Cartesian3.subtract(next, position, next);\r\n const bottom = Cartesian3.subtract(\r\n extrudedPosition,\r\n position,\r\n scratchCartesian3\r\n );\r\n\r\n normal = Cartesian3.normalize(\r\n Cartesian3.cross(bottom, next, normal),\r\n normal\r\n );\r\n\r\n if (vertexFormat.normal) {\r\n normals[i] = normal.x;\r\n normals[i1] = normal.y;\r\n normals[i2] = normal.z;\r\n\r\n normals[i + length] = normal.x;\r\n normals[i1 + length] = normal.y;\r\n normals[i2 + length] = normal.z;\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n tangent = Cartesian3.normalize(\r\n Cartesian3.cross(bitangent, normal, tangent),\r\n tangent\r\n );\r\n tangents[i] = tangent.x;\r\n tangents[i1] = tangent.y;\r\n tangents[i2] = tangent.z;\r\n\r\n tangents[i + length] = tangent.x;\r\n tangents[i + 1 + length] = tangent.y;\r\n tangents[i + 2 + length] = tangent.z;\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n bitangents[i] = bitangent.x;\r\n bitangents[i1] = bitangent.y;\r\n bitangents[i2] = bitangent.z;\r\n\r\n bitangents[i + length] = bitangent.x;\r\n bitangents[i1 + length] = bitangent.y;\r\n bitangents[i2 + length] = bitangent.z;\r\n }\r\n }\r\n }\r\n\r\n if (vertexFormat.st) {\r\n length = textureCoordinates.length;\r\n for (let k = 0; k < length; k += 2) {\r\n textureCoordinates[k] =\r\n (textureCoordinates[k] - minTexCoord.x) /\r\n (maxTexCoord.x - minTexCoord.x);\r\n textureCoordinates[k + 1] =\r\n (textureCoordinates[k + 1] - minTexCoord.y) /\r\n (maxTexCoord.y - minTexCoord.y);\r\n }\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n\r\n if (vertexFormat.position) {\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: finalPositions,\r\n });\r\n }\r\n\r\n if (vertexFormat.st) {\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: textureCoordinates,\r\n });\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normals,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangents,\r\n });\r\n }\r\n\r\n if (shadowVolume) {\r\n attributes.extrudeDirection = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: extrudeNormals,\r\n });\r\n }\r\n\r\n if (defined(options.offsetAttribute)) {\r\n let offsetAttribute = new Uint8Array(size);\r\n if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\r\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\r\n } else {\r\n const offsetValue =\r\n options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\r\n offsetAttribute = offsetAttribute.fill(offsetValue);\r\n }\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: offsetAttribute,\r\n });\r\n }\r\n\r\n return attributes;\r\n}\r\n\r\nfunction computeWallIndices(positions) {\r\n const length = positions.length / 3;\r\n const indices = IndexDatatype.createTypedArray(length, length * 6);\r\n let index = 0;\r\n for (let i = 0; i < length; i++) {\r\n const UL = i;\r\n const LL = i + length;\r\n const UR = (UL + 1) % length;\r\n const LR = UR + length;\r\n indices[index++] = UL;\r\n indices[index++] = LL;\r\n indices[index++] = UR;\r\n indices[index++] = UR;\r\n indices[index++] = LL;\r\n indices[index++] = LR;\r\n }\r\n\r\n return indices;\r\n}\r\n\r\nconst topBoundingSphere = new BoundingSphere();\r\nconst bottomBoundingSphere = new BoundingSphere();\r\n\r\nfunction computeExtrudedEllipse(options) {\r\n const center = options.center;\r\n const ellipsoid = options.ellipsoid;\r\n const semiMajorAxis = options.semiMajorAxis;\r\n let scaledNormal = Cartesian3.multiplyByScalar(\r\n ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),\r\n options.height,\r\n scratchCartesian1\r\n );\r\n topBoundingSphere.center = Cartesian3.add(\r\n center,\r\n scaledNormal,\r\n topBoundingSphere.center\r\n );\r\n topBoundingSphere.radius = semiMajorAxis;\r\n\r\n scaledNormal = Cartesian3.multiplyByScalar(\r\n ellipsoid.geodeticSurfaceNormal(center, scaledNormal),\r\n options.extrudedHeight,\r\n scaledNormal\r\n );\r\n bottomBoundingSphere.center = Cartesian3.add(\r\n center,\r\n scaledNormal,\r\n bottomBoundingSphere.center\r\n );\r\n bottomBoundingSphere.radius = semiMajorAxis;\r\n\r\n const cep = EllipseGeometryLibrary.computeEllipsePositions(\r\n options,\r\n true,\r\n true\r\n );\r\n const positions = cep.positions;\r\n const numPts = cep.numPts;\r\n const outerPositions = cep.outerPositions;\r\n const boundingSphere = BoundingSphere.union(\r\n topBoundingSphere,\r\n bottomBoundingSphere\r\n );\r\n const topBottomAttributes = computeTopBottomAttributes(\r\n positions,\r\n options,\r\n true\r\n );\r\n let indices = topIndices(numPts);\r\n const length = indices.length;\r\n indices.length = length * 2;\r\n const posLength = positions.length / 3;\r\n for (let i = 0; i < length; i += 3) {\r\n indices[i + length] = indices[i + 2] + posLength;\r\n indices[i + 1 + length] = indices[i + 1] + posLength;\r\n indices[i + 2 + length] = indices[i] + posLength;\r\n }\r\n\r\n const topBottomIndices = IndexDatatype.createTypedArray(\r\n (posLength * 2) / 3,\r\n indices\r\n );\r\n\r\n const topBottomGeo = new Geometry({\r\n attributes: topBottomAttributes,\r\n indices: topBottomIndices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n });\r\n\r\n const wallAttributes = computeWallAttributes(outerPositions, options);\r\n indices = computeWallIndices(outerPositions);\r\n const wallIndices = IndexDatatype.createTypedArray(\r\n (outerPositions.length * 2) / 3,\r\n indices\r\n );\r\n\r\n const wallGeo = new Geometry({\r\n attributes: wallAttributes,\r\n indices: wallIndices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n });\r\n\r\n const geo = GeometryPipeline.combineInstances([\r\n new GeometryInstance({\r\n geometry: topBottomGeo,\r\n }),\r\n new GeometryInstance({\r\n geometry: wallGeo,\r\n }),\r\n ]);\r\n\r\n return {\r\n boundingSphere: boundingSphere,\r\n attributes: geo[0].attributes,\r\n indices: geo[0].indices,\r\n };\r\n}\r\n\r\nfunction computeRectangle(\r\n center,\r\n semiMajorAxis,\r\n semiMinorAxis,\r\n rotation,\r\n granularity,\r\n ellipsoid,\r\n result\r\n) {\r\n const cep = EllipseGeometryLibrary.computeEllipsePositions(\r\n {\r\n center: center,\r\n semiMajorAxis: semiMajorAxis,\r\n semiMinorAxis: semiMinorAxis,\r\n rotation: rotation,\r\n granularity: granularity,\r\n },\r\n false,\r\n true\r\n );\r\n const positionsFlat = cep.outerPositions;\r\n const positionsCount = positionsFlat.length / 3;\r\n const positions = new Array(positionsCount);\r\n for (let i = 0; i < positionsCount; ++i) {\r\n positions[i] = Cartesian3.fromArray(positionsFlat, i * 3);\r\n }\r\n const rectangle = Rectangle.fromCartesianArray(positions, ellipsoid, result);\r\n // Rectangle width goes beyond 180 degrees when the ellipse crosses a pole.\r\n // When this happens, make the rectangle into a \"circle\" around the pole\r\n if (rectangle.width > CesiumMath.PI) {\r\n rectangle.north =\r\n rectangle.north > 0.0\r\n ? CesiumMath.PI_OVER_TWO - CesiumMath.EPSILON7\r\n : rectangle.north;\r\n rectangle.south =\r\n rectangle.south < 0.0\r\n ? CesiumMath.EPSILON7 - CesiumMath.PI_OVER_TWO\r\n : rectangle.south;\r\n rectangle.east = CesiumMath.PI;\r\n rectangle.west = -CesiumMath.PI;\r\n }\r\n return rectangle;\r\n}\r\n\r\n/**\r\n * A description of an ellipse on an ellipsoid. Ellipse geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\r\n *\r\n * @alias EllipseGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.\r\n * @param {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.\r\n * @param {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.\r\n * @param {Number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface.\r\n * @param {Number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface.\r\n * @param {Number} [options.rotation=0.0] The angle of rotation counter-clockwise from north.\r\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates counter-clockwise from north.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The angular distance between points on the ellipse in radians.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n *\r\n * @exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero.\r\n * @exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis.\r\n * @exception {DeveloperError} granularity must be greater than zero.\r\n *\r\n *\r\n * @example\r\n * // Create an ellipse.\r\n * const ellipse = new Cesium.EllipseGeometry({\r\n * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\r\n * semiMajorAxis : 500000.0,\r\n * semiMinorAxis : 300000.0,\r\n * rotation : Cesium.Math.toRadians(60.0)\r\n * });\r\n * const geometry = Cesium.EllipseGeometry.createGeometry(ellipse);\r\n *\r\n * @see EllipseGeometry.createGeometry\r\n */\r\nfunction EllipseGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const center = options.center;\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n const semiMajorAxis = options.semiMajorAxis;\r\n const semiMinorAxis = options.semiMinorAxis;\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"options.center\", center);\r\n Check.typeOf.number(\"options.semiMajorAxis\", semiMajorAxis);\r\n Check.typeOf.number(\"options.semiMinorAxis\", semiMinorAxis);\r\n if (semiMajorAxis < semiMinorAxis) {\r\n throw new DeveloperError(\r\n \"semiMajorAxis must be greater than or equal to the semiMinorAxis.\"\r\n );\r\n }\r\n if (granularity <= 0.0) {\r\n throw new DeveloperError(\"granularity must be greater than zero.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const height = defaultValue(options.height, 0.0);\r\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\r\n\r\n this._center = Cartesian3.clone(center);\r\n this._semiMajorAxis = semiMajorAxis;\r\n this._semiMinorAxis = semiMinorAxis;\r\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\r\n this._rotation = defaultValue(options.rotation, 0.0);\r\n this._stRotation = defaultValue(options.stRotation, 0.0);\r\n this._height = Math.max(extrudedHeight, height);\r\n this._granularity = granularity;\r\n this._vertexFormat = VertexFormat.clone(vertexFormat);\r\n this._extrudedHeight = Math.min(extrudedHeight, height);\r\n this._shadowVolume = defaultValue(options.shadowVolume, false);\r\n this._workerName = \"createEllipseGeometry\";\r\n this._offsetAttribute = options.offsetAttribute;\r\n\r\n this._rectangle = undefined;\r\n this._textureCoordinateRotationPoints = undefined;\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nEllipseGeometry.packedLength =\r\n Cartesian3.packedLength +\r\n Ellipsoid.packedLength +\r\n VertexFormat.packedLength +\r\n 9;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {EllipseGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nEllipseGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n Cartesian3.pack(value._center, array, startingIndex);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n array[startingIndex++] = value._semiMajorAxis;\r\n array[startingIndex++] = value._semiMinorAxis;\r\n array[startingIndex++] = value._rotation;\r\n array[startingIndex++] = value._stRotation;\r\n array[startingIndex++] = value._height;\r\n array[startingIndex++] = value._granularity;\r\n array[startingIndex++] = value._extrudedHeight;\r\n array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\r\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchCenter = new Cartesian3();\r\nconst scratchEllipsoid = new Ellipsoid();\r\nconst scratchVertexFormat = new VertexFormat();\r\nconst scratchOptions = {\r\n center: scratchCenter,\r\n ellipsoid: scratchEllipsoid,\r\n vertexFormat: scratchVertexFormat,\r\n semiMajorAxis: undefined,\r\n semiMinorAxis: undefined,\r\n rotation: undefined,\r\n stRotation: undefined,\r\n height: undefined,\r\n granularity: undefined,\r\n extrudedHeight: undefined,\r\n shadowVolume: undefined,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {EllipseGeometry} [result] The object into which to store the result.\r\n * @returns {EllipseGeometry} The modified result parameter or a new EllipseGeometry instance if one was not provided.\r\n */\r\nEllipseGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const center = Cartesian3.unpack(array, startingIndex, scratchCenter);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n const semiMajorAxis = array[startingIndex++];\r\n const semiMinorAxis = array[startingIndex++];\r\n const rotation = array[startingIndex++];\r\n const stRotation = array[startingIndex++];\r\n const height = array[startingIndex++];\r\n const granularity = array[startingIndex++];\r\n const extrudedHeight = array[startingIndex++];\r\n const shadowVolume = array[startingIndex++] === 1.0;\r\n const offsetAttribute = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.height = height;\r\n scratchOptions.extrudedHeight = extrudedHeight;\r\n scratchOptions.granularity = granularity;\r\n scratchOptions.stRotation = stRotation;\r\n scratchOptions.rotation = rotation;\r\n scratchOptions.semiMajorAxis = semiMajorAxis;\r\n scratchOptions.semiMinorAxis = semiMinorAxis;\r\n scratchOptions.shadowVolume = shadowVolume;\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return new EllipseGeometry(scratchOptions);\r\n }\r\n\r\n result._center = Cartesian3.clone(center, result._center);\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._semiMajorAxis = semiMajorAxis;\r\n result._semiMinorAxis = semiMinorAxis;\r\n result._rotation = rotation;\r\n result._stRotation = stRotation;\r\n result._height = height;\r\n result._granularity = granularity;\r\n result._extrudedHeight = extrudedHeight;\r\n result._shadowVolume = shadowVolume;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the bounding rectangle based on the provided options\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.\r\n * @param {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.\r\n * @param {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.\r\n * @param {Number} [options.rotation=0.0] The angle of rotation counter-clockwise from north.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The angular distance between points on the ellipse in radians.\r\n * @param {Rectangle} [result] An object in which to store the result\r\n *\r\n * @returns {Rectangle} The result rectangle\r\n */\r\nEllipseGeometry.computeRectangle = function (options, result) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const center = options.center;\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n const semiMajorAxis = options.semiMajorAxis;\r\n const semiMinorAxis = options.semiMinorAxis;\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n const rotation = defaultValue(options.rotation, 0.0);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"options.center\", center);\r\n Check.typeOf.number(\"options.semiMajorAxis\", semiMajorAxis);\r\n Check.typeOf.number(\"options.semiMinorAxis\", semiMinorAxis);\r\n if (semiMajorAxis < semiMinorAxis) {\r\n throw new DeveloperError(\r\n \"semiMajorAxis must be greater than or equal to the semiMinorAxis.\"\r\n );\r\n }\r\n if (granularity <= 0.0) {\r\n throw new DeveloperError(\"granularity must be greater than zero.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n return computeRectangle(\r\n center,\r\n semiMajorAxis,\r\n semiMinorAxis,\r\n rotation,\r\n granularity,\r\n ellipsoid,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {EllipseGeometry} ellipseGeometry A description of the ellipse.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nEllipseGeometry.createGeometry = function (ellipseGeometry) {\r\n if (\r\n ellipseGeometry._semiMajorAxis <= 0.0 ||\r\n ellipseGeometry._semiMinorAxis <= 0.0\r\n ) {\r\n return;\r\n }\r\n\r\n const height = ellipseGeometry._height;\r\n const extrudedHeight = ellipseGeometry._extrudedHeight;\r\n const extrude = !CesiumMath.equalsEpsilon(\r\n height,\r\n extrudedHeight,\r\n 0,\r\n CesiumMath.EPSILON2\r\n );\r\n\r\n ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(\r\n ellipseGeometry._center,\r\n ellipseGeometry._center\r\n );\r\n const options = {\r\n center: ellipseGeometry._center,\r\n semiMajorAxis: ellipseGeometry._semiMajorAxis,\r\n semiMinorAxis: ellipseGeometry._semiMinorAxis,\r\n ellipsoid: ellipseGeometry._ellipsoid,\r\n rotation: ellipseGeometry._rotation,\r\n height: height,\r\n granularity: ellipseGeometry._granularity,\r\n vertexFormat: ellipseGeometry._vertexFormat,\r\n stRotation: ellipseGeometry._stRotation,\r\n };\r\n let geometry;\r\n if (extrude) {\r\n options.extrudedHeight = extrudedHeight;\r\n options.shadowVolume = ellipseGeometry._shadowVolume;\r\n options.offsetAttribute = ellipseGeometry._offsetAttribute;\r\n geometry = computeExtrudedEllipse(options);\r\n } else {\r\n geometry = computeEllipse(options);\r\n\r\n if (defined(ellipseGeometry._offsetAttribute)) {\r\n const length = geometry.attributes.position.values.length;\r\n const offsetValue =\r\n ellipseGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n geometry.attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n }\r\n\r\n return new Geometry({\r\n attributes: geometry.attributes,\r\n indices: geometry.indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n boundingSphere: geometry.boundingSphere,\r\n offsetAttribute: ellipseGeometry._offsetAttribute,\r\n });\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nEllipseGeometry.createShadowVolume = function (\r\n ellipseGeometry,\r\n minHeightFunc,\r\n maxHeightFunc\r\n) {\r\n const granularity = ellipseGeometry._granularity;\r\n const ellipsoid = ellipseGeometry._ellipsoid;\r\n\r\n const minHeight = minHeightFunc(granularity, ellipsoid);\r\n const maxHeight = maxHeightFunc(granularity, ellipsoid);\r\n\r\n return new EllipseGeometry({\r\n center: ellipseGeometry._center,\r\n semiMajorAxis: ellipseGeometry._semiMajorAxis,\r\n semiMinorAxis: ellipseGeometry._semiMinorAxis,\r\n ellipsoid: ellipsoid,\r\n rotation: ellipseGeometry._rotation,\r\n stRotation: ellipseGeometry._stRotation,\r\n granularity: granularity,\r\n extrudedHeight: minHeight,\r\n height: maxHeight,\r\n vertexFormat: VertexFormat.POSITION_ONLY,\r\n shadowVolume: true,\r\n });\r\n};\r\n\r\nfunction textureCoordinateRotationPoints(ellipseGeometry) {\r\n const stRotation = -ellipseGeometry._stRotation;\r\n if (stRotation === 0.0) {\r\n return [0, 0, 0, 1, 1, 0];\r\n }\r\n\r\n const cep = EllipseGeometryLibrary.computeEllipsePositions(\r\n {\r\n center: ellipseGeometry._center,\r\n semiMajorAxis: ellipseGeometry._semiMajorAxis,\r\n semiMinorAxis: ellipseGeometry._semiMinorAxis,\r\n rotation: ellipseGeometry._rotation,\r\n granularity: ellipseGeometry._granularity,\r\n },\r\n false,\r\n true\r\n );\r\n const positionsFlat = cep.outerPositions;\r\n const positionsCount = positionsFlat.length / 3;\r\n const positions = new Array(positionsCount);\r\n for (let i = 0; i < positionsCount; ++i) {\r\n positions[i] = Cartesian3.fromArray(positionsFlat, i * 3);\r\n }\r\n\r\n const ellipsoid = ellipseGeometry._ellipsoid;\r\n const boundingRectangle = ellipseGeometry.rectangle;\r\n return Geometry._textureCoordinateRotationPoints(\r\n positions,\r\n stRotation,\r\n ellipsoid,\r\n boundingRectangle\r\n );\r\n}\r\n\r\nObject.defineProperties(EllipseGeometry.prototype, {\r\n /**\r\n * @private\r\n */\r\n rectangle: {\r\n get: function () {\r\n if (!defined(this._rectangle)) {\r\n this._rectangle = computeRectangle(\r\n this._center,\r\n this._semiMajorAxis,\r\n this._semiMinorAxis,\r\n this._rotation,\r\n this._granularity,\r\n this._ellipsoid\r\n );\r\n }\r\n return this._rectangle;\r\n },\r\n },\r\n /**\r\n * For remapping texture coordinates when rendering EllipseGeometries as GroundPrimitives.\r\n * @private\r\n */\r\n textureCoordinateRotationPoints: {\r\n get: function () {\r\n if (!defined(this._textureCoordinateRotationPoints)) {\r\n this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(\r\n this\r\n );\r\n }\r\n return this._textureCoordinateRotationPoints;\r\n },\r\n },\r\n});\r\nexport default EllipseGeometry;\r\n"],"names":["Cartesian3","Cartesian2","Matrix3","Quaternion","Cartographic","GeographicProjection","GeometryAttributes","EllipseGeometryLibrary","GeometryAttribute","ComponentDatatype","defined","GeometryOffsetAttribute","BoundingSphere","IndexDatatype","Geometry","PrimitiveType","GeometryPipeline","GeometryInstance","Rectangle","CesiumMath","defaultValue","Ellipsoid","VertexFormat","Check","DeveloperError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,iBAAiB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC3C,MAAM,iBAAiB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC3C,MAAM,iBAAiB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC3C,MAAM,iBAAiB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC3C,MAAM,eAAe,GAAG,IAAIC,kBAAU,EAAE,CAAC;EACzC,MAAM,oBAAoB,GAAG,IAAIC,eAAO,EAAE,CAAC;EAC3C,MAAM,oBAAoB,GAAG,IAAIA,eAAO,EAAE,CAAC;EAC3C,MAAM,iBAAiB,GAAG,IAAIC,qBAAU,EAAE,CAAC;AAC3C;EACA,MAAM,aAAa,GAAG,IAAIH,kBAAU,EAAE,CAAC;EACvC,MAAM,cAAc,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACxC,MAAM,gBAAgB,GAAG,IAAIA,kBAAU,EAAE,CAAC;AAC1C;EACA,MAAM,mBAAmB,GAAG,IAAII,oBAAY,EAAE,CAAC;EAC/C,MAAM,sBAAsB,GAAG,IAAIJ,kBAAU,EAAE,CAAC;AAChD;EACA,MAAM,kBAAkB,GAAG,IAAIC,kBAAU,EAAE,CAAC;EAC5C,MAAM,kBAAkB,GAAG,IAAIA,kBAAU,EAAE,CAAC;AAC5C;EACA,SAAS,0BAA0B,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE;EACjE,EAAE,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;EAC5C,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;EAChC,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;EAC9C,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,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AC;EAC9D,GAAG;AACH;EACA,EAAE,MAAM,SAAS,GAAG,eAAe,CAAC,UAAU,CAAC;EAC/C,EAAE,MAAM,iBAAiB,GAAG,eAAe,CAAC,SAAS,CAAC;EACtD,EAAE,OAAOc,0BAAQ,CAAC,gCAAgC;EAClD,IAAI,SAAS;EACb,IAAI,UAAU;EACd,IAAI,SAAS;EACb,IAAI,iBAAiB;EACrB,GAAG,CAAC;EACJ,CAAC;AACD;EACA,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,SAAS,EAAE;EACnD;EACA;EACA;EACA,EAAE,SAAS,EAAE;EACb,IAAI,GAAG,EAAE,YAAY;EACrB,MAAM,IAAI,CAACJ,oBAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;EACrC,QAAQ,IAAI,CAAC,UAAU,GAAG,gBAAgB;EAC1C,UAAU,IAAI,CAAC,OAAO;EACtB,UAAU,IAAI,CAAC,cAAc;EAC7B,UAAU,IAAI,CAAC,cAAc;EAC7B,UAAU,IAAI,CAAC,SAAS;EACxB,UAAU,IAAI,CAAC,YAAY;EAC3B,UAAU,IAAI,CAAC,UAAU;EACzB,SAAS,CAAC;EACV,OAAO;EACP,MAAM,OAAO,IAAI,CAAC,UAAU,CAAC;EAC7B,KAAK;EACL,GAAG;EACH;EACA;EACA;EACA;EACA,EAAE,+BAA+B,EAAE;EACnC,IAAI,GAAG,EAAE,YAAY;EACrB,MAAM,IAAI,CAACA,oBAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,EAAE;EAC3D,QAAQ,IAAI,CAAC,gCAAgC,GAAG,+BAA+B;EAC/E,UAAU,IAAI;EACd,SAAS,CAAC;EACV,OAAO;EACP,MAAM,OAAO,IAAI,CAAC,gCAAgC,CAAC;EACnD,KAAK;EACL,GAAG;EACH,CAAC,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/EllipseGeometryLibrary-d3f88cc2.js b/examples/cesium/Workers/EllipseGeometryLibrary-d3f88cc2.js
new file mode 100644
index 0000000..dde7c42
--- /dev/null
+++ b/examples/cesium/Workers/EllipseGeometryLibrary-d3f88cc2.js
@@ -0,0 +1,392 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './Math-9be8b918', './Transforms-11fb6b0a'], (function (exports, Matrix3, Math$1, Transforms) { 'use strict';
+
+ const EllipseGeometryLibrary = {};
+
+ const rotAxis = new Matrix3.Cartesian3();
+ const tempVec = new Matrix3.Cartesian3();
+ const unitQuat = new Transforms.Quaternion();
+ const rotMtx = new Matrix3.Matrix3();
+
+ function pointOnEllipsoid(
+ theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ result
+ ) {
+ const azimuth = theta + rotation;
+
+ Matrix3.Cartesian3.multiplyByScalar(eastVec, Math.cos(azimuth), rotAxis);
+ Matrix3.Cartesian3.multiplyByScalar(northVec, Math.sin(azimuth), tempVec);
+ Matrix3.Cartesian3.add(rotAxis, tempVec, rotAxis);
+
+ let cosThetaSquared = Math.cos(theta);
+ cosThetaSquared = cosThetaSquared * cosThetaSquared;
+
+ let sinThetaSquared = Math.sin(theta);
+ sinThetaSquared = sinThetaSquared * sinThetaSquared;
+
+ const radius =
+ ab / Math.sqrt(bSqr * cosThetaSquared + aSqr * sinThetaSquared);
+ const angle = radius / mag;
+
+ // Create the quaternion to rotate the position vector to the boundary of the ellipse.
+ Transforms.Quaternion.fromAxisAngle(rotAxis, angle, unitQuat);
+ Matrix3.Matrix3.fromQuaternion(unitQuat, rotMtx);
+
+ Matrix3.Matrix3.multiplyByVector(rotMtx, unitPos, result);
+ Matrix3.Cartesian3.normalize(result, result);
+ Matrix3.Cartesian3.multiplyByScalar(result, mag, result);
+ return result;
+ }
+
+ const scratchCartesian1 = new Matrix3.Cartesian3();
+ const scratchCartesian2 = new Matrix3.Cartesian3();
+ const scratchCartesian3 = new Matrix3.Cartesian3();
+ const scratchNormal = new Matrix3.Cartesian3();
+ /**
+ * Returns the positions raised to the given heights
+ * @private
+ */
+ EllipseGeometryLibrary.raisePositionsToHeight = function (
+ positions,
+ options,
+ extrude
+ ) {
+ const ellipsoid = options.ellipsoid;
+ const height = options.height;
+ const extrudedHeight = options.extrudedHeight;
+ const size = extrude ? (positions.length / 3) * 2 : positions.length / 3;
+
+ const finalPositions = new Float64Array(size * 3);
+
+ const length = positions.length;
+ const bottomOffset = extrude ? length : 0;
+ for (let i = 0; i < length; i += 3) {
+ const i1 = i + 1;
+ const i2 = i + 2;
+
+ const position = Matrix3.Cartesian3.fromArray(positions, i, scratchCartesian1);
+ ellipsoid.scaleToGeodeticSurface(position, position);
+
+ const extrudedPosition = Matrix3.Cartesian3.clone(position, scratchCartesian2);
+ const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);
+ const scaledNormal = Matrix3.Cartesian3.multiplyByScalar(
+ normal,
+ height,
+ scratchCartesian3
+ );
+ Matrix3.Cartesian3.add(position, scaledNormal, position);
+
+ if (extrude) {
+ Matrix3.Cartesian3.multiplyByScalar(normal, extrudedHeight, scaledNormal);
+ Matrix3.Cartesian3.add(extrudedPosition, scaledNormal, extrudedPosition);
+
+ finalPositions[i + bottomOffset] = extrudedPosition.x;
+ finalPositions[i1 + bottomOffset] = extrudedPosition.y;
+ finalPositions[i2 + bottomOffset] = extrudedPosition.z;
+ }
+
+ finalPositions[i] = position.x;
+ finalPositions[i1] = position.y;
+ finalPositions[i2] = position.z;
+ }
+
+ return finalPositions;
+ };
+
+ const unitPosScratch = new Matrix3.Cartesian3();
+ const eastVecScratch = new Matrix3.Cartesian3();
+ const northVecScratch = new Matrix3.Cartesian3();
+ /**
+ * Returns an array of positions that make up the ellipse.
+ * @private
+ */
+ EllipseGeometryLibrary.computeEllipsePositions = function (
+ options,
+ addFillPositions,
+ addEdgePositions
+ ) {
+ const semiMinorAxis = options.semiMinorAxis;
+ const semiMajorAxis = options.semiMajorAxis;
+ const rotation = options.rotation;
+ const center = options.center;
+
+ // Computing the arc-length of the ellipse is too expensive to be practical. Estimating it using the
+ // arc length of the sphere is too inaccurate and creates sharp edges when either the semi-major or
+ // semi-minor axis is much bigger than the other. Instead, scale the angle delta to make
+ // the distance along the ellipse boundary more closely match the granularity.
+ const granularity = options.granularity * 8.0;
+
+ const aSqr = semiMinorAxis * semiMinorAxis;
+ const bSqr = semiMajorAxis * semiMajorAxis;
+ const ab = semiMajorAxis * semiMinorAxis;
+
+ const mag = Matrix3.Cartesian3.magnitude(center);
+
+ const unitPos = Matrix3.Cartesian3.normalize(center, unitPosScratch);
+ let eastVec = Matrix3.Cartesian3.cross(Matrix3.Cartesian3.UNIT_Z, center, eastVecScratch);
+ eastVec = Matrix3.Cartesian3.normalize(eastVec, eastVec);
+ const northVec = Matrix3.Cartesian3.cross(unitPos, eastVec, northVecScratch);
+
+ // The number of points in the first quadrant
+ let numPts = 1 + Math.ceil(Math$1.CesiumMath.PI_OVER_TWO / granularity);
+
+ const deltaTheta = Math$1.CesiumMath.PI_OVER_TWO / (numPts - 1);
+ let theta = Math$1.CesiumMath.PI_OVER_TWO - numPts * deltaTheta;
+ if (theta < 0.0) {
+ numPts -= Math.ceil(Math.abs(theta) / deltaTheta);
+ }
+
+ // If the number of points were three, the ellipse
+ // would be tessellated like below:
+ //
+ // *---*
+ // / | \ | \
+ // *---*---*---*
+ // / | \ | \ | \ | \
+ // / .*---*---*---*. \
+ // * ` | \ | \ | \ | `*
+ // \`.*---*---*---*.`/
+ // \ | \ | \ | \ | /
+ // *---*---*---*
+ // \ | \ | /
+ // *---*
+ // The first and last column have one position and fan to connect to the adjacent column.
+ // Each other vertical column contains an even number of positions.
+ const size = 2 * (numPts * (numPts + 2));
+ const positions = addFillPositions ? new Array(size * 3) : undefined;
+ let positionIndex = 0;
+ let position = scratchCartesian1;
+ let reflectedPosition = scratchCartesian2;
+
+ const outerPositionsLength = numPts * 4 * 3;
+ let outerRightIndex = outerPositionsLength - 1;
+ let outerLeftIndex = 0;
+ const outerPositions = addEdgePositions
+ ? new Array(outerPositionsLength)
+ : undefined;
+
+ let i;
+ let j;
+ let numInterior;
+ let t;
+ let interiorPosition;
+
+ // Compute points in the 'eastern' half of the ellipse
+ theta = Math$1.CesiumMath.PI_OVER_TWO;
+ position = pointOnEllipsoid(
+ theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ position
+ );
+ if (addFillPositions) {
+ positions[positionIndex++] = position.x;
+ positions[positionIndex++] = position.y;
+ positions[positionIndex++] = position.z;
+ }
+ if (addEdgePositions) {
+ outerPositions[outerRightIndex--] = position.z;
+ outerPositions[outerRightIndex--] = position.y;
+ outerPositions[outerRightIndex--] = position.x;
+ }
+ theta = Math$1.CesiumMath.PI_OVER_TWO - deltaTheta;
+ for (i = 1; i < numPts + 1; ++i) {
+ position = pointOnEllipsoid(
+ theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ position
+ );
+ reflectedPosition = pointOnEllipsoid(
+ Math.PI - theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ reflectedPosition
+ );
+
+ if (addFillPositions) {
+ positions[positionIndex++] = position.x;
+ positions[positionIndex++] = position.y;
+ positions[positionIndex++] = position.z;
+
+ numInterior = 2 * i + 2;
+ for (j = 1; j < numInterior - 1; ++j) {
+ t = j / (numInterior - 1);
+ interiorPosition = Matrix3.Cartesian3.lerp(
+ position,
+ reflectedPosition,
+ t,
+ scratchCartesian3
+ );
+ positions[positionIndex++] = interiorPosition.x;
+ positions[positionIndex++] = interiorPosition.y;
+ positions[positionIndex++] = interiorPosition.z;
+ }
+
+ positions[positionIndex++] = reflectedPosition.x;
+ positions[positionIndex++] = reflectedPosition.y;
+ positions[positionIndex++] = reflectedPosition.z;
+ }
+
+ if (addEdgePositions) {
+ outerPositions[outerRightIndex--] = position.z;
+ outerPositions[outerRightIndex--] = position.y;
+ outerPositions[outerRightIndex--] = position.x;
+ outerPositions[outerLeftIndex++] = reflectedPosition.x;
+ outerPositions[outerLeftIndex++] = reflectedPosition.y;
+ outerPositions[outerLeftIndex++] = reflectedPosition.z;
+ }
+
+ theta = Math$1.CesiumMath.PI_OVER_TWO - (i + 1) * deltaTheta;
+ }
+
+ // Compute points in the 'western' half of the ellipse
+ for (i = numPts; i > 1; --i) {
+ theta = Math$1.CesiumMath.PI_OVER_TWO - (i - 1) * deltaTheta;
+
+ position = pointOnEllipsoid(
+ -theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ position
+ );
+ reflectedPosition = pointOnEllipsoid(
+ theta + Math.PI,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ reflectedPosition
+ );
+
+ if (addFillPositions) {
+ positions[positionIndex++] = position.x;
+ positions[positionIndex++] = position.y;
+ positions[positionIndex++] = position.z;
+
+ numInterior = 2 * (i - 1) + 2;
+ for (j = 1; j < numInterior - 1; ++j) {
+ t = j / (numInterior - 1);
+ interiorPosition = Matrix3.Cartesian3.lerp(
+ position,
+ reflectedPosition,
+ t,
+ scratchCartesian3
+ );
+ positions[positionIndex++] = interiorPosition.x;
+ positions[positionIndex++] = interiorPosition.y;
+ positions[positionIndex++] = interiorPosition.z;
+ }
+
+ positions[positionIndex++] = reflectedPosition.x;
+ positions[positionIndex++] = reflectedPosition.y;
+ positions[positionIndex++] = reflectedPosition.z;
+ }
+
+ if (addEdgePositions) {
+ outerPositions[outerRightIndex--] = position.z;
+ outerPositions[outerRightIndex--] = position.y;
+ outerPositions[outerRightIndex--] = position.x;
+ outerPositions[outerLeftIndex++] = reflectedPosition.x;
+ outerPositions[outerLeftIndex++] = reflectedPosition.y;
+ outerPositions[outerLeftIndex++] = reflectedPosition.z;
+ }
+ }
+
+ theta = Math$1.CesiumMath.PI_OVER_TWO;
+ position = pointOnEllipsoid(
+ -theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ position
+ );
+
+ const r = {};
+ if (addFillPositions) {
+ positions[positionIndex++] = position.x;
+ positions[positionIndex++] = position.y;
+ positions[positionIndex++] = position.z;
+ r.positions = positions;
+ r.numPts = numPts;
+ }
+ if (addEdgePositions) {
+ outerPositions[outerRightIndex--] = position.z;
+ outerPositions[outerRightIndex--] = position.y;
+ outerPositions[outerRightIndex--] = position.x;
+ r.outerPositions = outerPositions;
+ }
+
+ return r;
+ };
+ var EllipseGeometryLibrary$1 = EllipseGeometryLibrary;
+
+ exports.EllipseGeometryLibrary = EllipseGeometryLibrary$1;
+
+}));
+//# sourceMappingURL=EllipseGeometryLibrary-d3f88cc2.js.map
diff --git a/examples/cesium/Workers/EllipseGeometryLibrary-d3f88cc2.js.map b/examples/cesium/Workers/EllipseGeometryLibrary-d3f88cc2.js.map
new file mode 100644
index 0000000..096a2bc
--- /dev/null
+++ b/examples/cesium/Workers/EllipseGeometryLibrary-d3f88cc2.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"EllipseGeometryLibrary-d3f88cc2.js","sources":["../../../Source/Core/EllipseGeometryLibrary.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\n\r\nconst EllipseGeometryLibrary = {};\r\n\r\nconst rotAxis = new Cartesian3();\r\nconst tempVec = new Cartesian3();\r\nconst unitQuat = new Quaternion();\r\nconst rotMtx = new Matrix3();\r\n\r\nfunction pointOnEllipsoid(\r\n theta,\r\n rotation,\r\n northVec,\r\n eastVec,\r\n aSqr,\r\n ab,\r\n bSqr,\r\n mag,\r\n unitPos,\r\n result\r\n) {\r\n const azimuth = theta + rotation;\r\n\r\n Cartesian3.multiplyByScalar(eastVec, Math.cos(azimuth), rotAxis);\r\n Cartesian3.multiplyByScalar(northVec, Math.sin(azimuth), tempVec);\r\n Cartesian3.add(rotAxis, tempVec, rotAxis);\r\n\r\n let cosThetaSquared = Math.cos(theta);\r\n cosThetaSquared = cosThetaSquared * cosThetaSquared;\r\n\r\n let sinThetaSquared = Math.sin(theta);\r\n sinThetaSquared = sinThetaSquared * sinThetaSquared;\r\n\r\n const radius =\r\n ab / Math.sqrt(bSqr * cosThetaSquared + aSqr * sinThetaSquared);\r\n const angle = radius / mag;\r\n\r\n // Create the quaternion to rotate the position vector to the boundary of the ellipse.\r\n Quaternion.fromAxisAngle(rotAxis, angle, unitQuat);\r\n Matrix3.fromQuaternion(unitQuat, rotMtx);\r\n\r\n Matrix3.multiplyByVector(rotMtx, unitPos, result);\r\n Cartesian3.normalize(result, result);\r\n Cartesian3.multiplyByScalar(result, mag, result);\r\n return result;\r\n}\r\n\r\nconst scratchCartesian1 = new Cartesian3();\r\nconst scratchCartesian2 = new Cartesian3();\r\nconst scratchCartesian3 = new Cartesian3();\r\nconst scratchNormal = new Cartesian3();\r\n/**\r\n * Returns the positions raised to the given heights\r\n * @private\r\n */\r\nEllipseGeometryLibrary.raisePositionsToHeight = function (\r\n positions,\r\n options,\r\n extrude\r\n) {\r\n const ellipsoid = options.ellipsoid;\r\n const height = options.height;\r\n const extrudedHeight = options.extrudedHeight;\r\n const size = extrude ? (positions.length / 3) * 2 : positions.length / 3;\r\n\r\n const finalPositions = new Float64Array(size * 3);\r\n\r\n const length = positions.length;\r\n const bottomOffset = extrude ? length : 0;\r\n for (let i = 0; i < length; i += 3) {\r\n const i1 = i + 1;\r\n const i2 = i + 2;\r\n\r\n const position = Cartesian3.fromArray(positions, i, scratchCartesian1);\r\n ellipsoid.scaleToGeodeticSurface(position, position);\r\n\r\n const extrudedPosition = Cartesian3.clone(position, scratchCartesian2);\r\n const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);\r\n const scaledNormal = Cartesian3.multiplyByScalar(\r\n normal,\r\n height,\r\n scratchCartesian3\r\n );\r\n Cartesian3.add(position, scaledNormal, position);\r\n\r\n if (extrude) {\r\n Cartesian3.multiplyByScalar(normal, extrudedHeight, scaledNormal);\r\n Cartesian3.add(extrudedPosition, scaledNormal, extrudedPosition);\r\n\r\n finalPositions[i + bottomOffset] = extrudedPosition.x;\r\n finalPositions[i1 + bottomOffset] = extrudedPosition.y;\r\n finalPositions[i2 + bottomOffset] = extrudedPosition.z;\r\n }\r\n\r\n finalPositions[i] = position.x;\r\n finalPositions[i1] = position.y;\r\n finalPositions[i2] = position.z;\r\n }\r\n\r\n return finalPositions;\r\n};\r\n\r\nconst unitPosScratch = new Cartesian3();\r\nconst eastVecScratch = new Cartesian3();\r\nconst northVecScratch = new Cartesian3();\r\n/**\r\n * Returns an array of positions that make up the ellipse.\r\n * @private\r\n */\r\nEllipseGeometryLibrary.computeEllipsePositions = function (\r\n options,\r\n addFillPositions,\r\n addEdgePositions\r\n) {\r\n const semiMinorAxis = options.semiMinorAxis;\r\n const semiMajorAxis = options.semiMajorAxis;\r\n const rotation = options.rotation;\r\n const center = options.center;\r\n\r\n // Computing the arc-length of the ellipse is too expensive to be practical. Estimating it using the\r\n // arc length of the sphere is too inaccurate and creates sharp edges when either the semi-major or\r\n // semi-minor axis is much bigger than the other. Instead, scale the angle delta to make\r\n // the distance along the ellipse boundary more closely match the granularity.\r\n const granularity = options.granularity * 8.0;\r\n\r\n const aSqr = semiMinorAxis * semiMinorAxis;\r\n const bSqr = semiMajorAxis * semiMajorAxis;\r\n const ab = semiMajorAxis * semiMinorAxis;\r\n\r\n const mag = Cartesian3.magnitude(center);\r\n\r\n const unitPos = Cartesian3.normalize(center, unitPosScratch);\r\n let eastVec = Cartesian3.cross(Cartesian3.UNIT_Z, center, eastVecScratch);\r\n eastVec = Cartesian3.normalize(eastVec, eastVec);\r\n const northVec = Cartesian3.cross(unitPos, eastVec, northVecScratch);\r\n\r\n // The number of points in the first quadrant\r\n let numPts = 1 + Math.ceil(CesiumMath.PI_OVER_TWO / granularity);\r\n\r\n const deltaTheta = CesiumMath.PI_OVER_TWO / (numPts - 1);\r\n let theta = CesiumMath.PI_OVER_TWO - numPts * deltaTheta;\r\n if (theta < 0.0) {\r\n numPts -= Math.ceil(Math.abs(theta) / deltaTheta);\r\n }\r\n\r\n // If the number of points were three, the ellipse\r\n // would be tessellated like below:\r\n //\r\n // *---*\r\n // / | \\ | \\\r\n // *---*---*---*\r\n // / | \\ | \\ | \\ | \\\r\n // / .*---*---*---*. \\\r\n // * ` | \\ | \\ | \\ | `*\r\n // \\`.*---*---*---*.`/\r\n // \\ | \\ | \\ | \\ | /\r\n // *---*---*---*\r\n // \\ | \\ | /\r\n // *---*\r\n // The first and last column have one position and fan to connect to the adjacent column.\r\n // Each other vertical column contains an even number of positions.\r\n const size = 2 * (numPts * (numPts + 2));\r\n const positions = addFillPositions ? new Array(size * 3) : undefined;\r\n let positionIndex = 0;\r\n let position = scratchCartesian1;\r\n let reflectedPosition = scratchCartesian2;\r\n\r\n const outerPositionsLength = numPts * 4 * 3;\r\n let outerRightIndex = outerPositionsLength - 1;\r\n let outerLeftIndex = 0;\r\n const outerPositions = addEdgePositions\r\n ? new Array(outerPositionsLength)\r\n : undefined;\r\n\r\n let i;\r\n let j;\r\n let numInterior;\r\n let t;\r\n let interiorPosition;\r\n\r\n // Compute points in the 'eastern' half of the ellipse\r\n theta = CesiumMath.PI_OVER_TWO;\r\n position = pointOnEllipsoid(\r\n theta,\r\n rotation,\r\n northVec,\r\n eastVec,\r\n aSqr,\r\n ab,\r\n bSqr,\r\n mag,\r\n unitPos,\r\n position\r\n );\r\n if (addFillPositions) {\r\n positions[positionIndex++] = position.x;\r\n positions[positionIndex++] = position.y;\r\n positions[positionIndex++] = position.z;\r\n }\r\n if (addEdgePositions) {\r\n outerPositions[outerRightIndex--] = position.z;\r\n outerPositions[outerRightIndex--] = position.y;\r\n outerPositions[outerRightIndex--] = position.x;\r\n }\r\n theta = CesiumMath.PI_OVER_TWO - deltaTheta;\r\n for (i = 1; i < numPts + 1; ++i) {\r\n position = pointOnEllipsoid(\r\n theta,\r\n rotation,\r\n northVec,\r\n eastVec,\r\n aSqr,\r\n ab,\r\n bSqr,\r\n mag,\r\n unitPos,\r\n position\r\n );\r\n reflectedPosition = pointOnEllipsoid(\r\n Math.PI - theta,\r\n rotation,\r\n northVec,\r\n eastVec,\r\n aSqr,\r\n ab,\r\n bSqr,\r\n mag,\r\n unitPos,\r\n reflectedPosition\r\n );\r\n\r\n if (addFillPositions) {\r\n positions[positionIndex++] = position.x;\r\n positions[positionIndex++] = position.y;\r\n positions[positionIndex++] = position.z;\r\n\r\n numInterior = 2 * i + 2;\r\n for (j = 1; j < numInterior - 1; ++j) {\r\n t = j / (numInterior - 1);\r\n interiorPosition = Cartesian3.lerp(\r\n position,\r\n reflectedPosition,\r\n t,\r\n scratchCartesian3\r\n );\r\n positions[positionIndex++] = interiorPosition.x;\r\n positions[positionIndex++] = interiorPosition.y;\r\n positions[positionIndex++] = interiorPosition.z;\r\n }\r\n\r\n positions[positionIndex++] = reflectedPosition.x;\r\n positions[positionIndex++] = reflectedPosition.y;\r\n positions[positionIndex++] = reflectedPosition.z;\r\n }\r\n\r\n if (addEdgePositions) {\r\n outerPositions[outerRightIndex--] = position.z;\r\n outerPositions[outerRightIndex--] = position.y;\r\n outerPositions[outerRightIndex--] = position.x;\r\n outerPositions[outerLeftIndex++] = reflectedPosition.x;\r\n outerPositions[outerLeftIndex++] = reflectedPosition.y;\r\n outerPositions[outerLeftIndex++] = reflectedPosition.z;\r\n }\r\n\r\n theta = CesiumMath.PI_OVER_TWO - (i + 1) * deltaTheta;\r\n }\r\n\r\n // Compute points in the 'western' half of the ellipse\r\n for (i = numPts; i > 1; --i) {\r\n theta = CesiumMath.PI_OVER_TWO - (i - 1) * deltaTheta;\r\n\r\n position = pointOnEllipsoid(\r\n -theta,\r\n rotation,\r\n northVec,\r\n eastVec,\r\n aSqr,\r\n ab,\r\n bSqr,\r\n mag,\r\n unitPos,\r\n position\r\n );\r\n reflectedPosition = pointOnEllipsoid(\r\n theta + Math.PI,\r\n rotation,\r\n northVec,\r\n eastVec,\r\n aSqr,\r\n ab,\r\n bSqr,\r\n mag,\r\n unitPos,\r\n reflectedPosition\r\n );\r\n\r\n if (addFillPositions) {\r\n positions[positionIndex++] = position.x;\r\n positions[positionIndex++] = position.y;\r\n positions[positionIndex++] = position.z;\r\n\r\n numInterior = 2 * (i - 1) + 2;\r\n for (j = 1; j < numInterior - 1; ++j) {\r\n t = j / (numInterior - 1);\r\n interiorPosition = Cartesian3.lerp(\r\n position,\r\n reflectedPosition,\r\n t,\r\n scratchCartesian3\r\n );\r\n positions[positionIndex++] = interiorPosition.x;\r\n positions[positionIndex++] = interiorPosition.y;\r\n positions[positionIndex++] = interiorPosition.z;\r\n }\r\n\r\n positions[positionIndex++] = reflectedPosition.x;\r\n positions[positionIndex++] = reflectedPosition.y;\r\n positions[positionIndex++] = reflectedPosition.z;\r\n }\r\n\r\n if (addEdgePositions) {\r\n outerPositions[outerRightIndex--] = position.z;\r\n outerPositions[outerRightIndex--] = position.y;\r\n outerPositions[outerRightIndex--] = position.x;\r\n outerPositions[outerLeftIndex++] = reflectedPosition.x;\r\n outerPositions[outerLeftIndex++] = reflectedPosition.y;\r\n outerPositions[outerLeftIndex++] = reflectedPosition.z;\r\n }\r\n }\r\n\r\n theta = CesiumMath.PI_OVER_TWO;\r\n position = pointOnEllipsoid(\r\n -theta,\r\n rotation,\r\n northVec,\r\n eastVec,\r\n aSqr,\r\n ab,\r\n bSqr,\r\n mag,\r\n unitPos,\r\n position\r\n );\r\n\r\n const r = {};\r\n if (addFillPositions) {\r\n positions[positionIndex++] = position.x;\r\n positions[positionIndex++] = position.y;\r\n positions[positionIndex++] = position.z;\r\n r.positions = positions;\r\n r.numPts = numPts;\r\n }\r\n if (addEdgePositions) {\r\n outerPositions[outerRightIndex--] = position.z;\r\n outerPositions[outerRightIndex--] = position.y;\r\n outerPositions[outerRightIndex--] = position.x;\r\n r.outerPositions = outerPositions;\r\n }\r\n\r\n return r;\r\n};\r\nexport default EllipseGeometryLibrary;\r\n"],"names":["Cartesian3","Quaternion","Matrix3","CesiumMath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC;EACA,MAAM,OAAO,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACjC,MAAM,OAAO,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACjC,MAAM,QAAQ,GAAG,IAAIC,qBAAU,EAAE,CAAC;EAClC,MAAM,MAAM,GAAG,IAAIC,eAAO,EAAE,CAAC;AAC7B;EACA,SAAS,gBAAgB;EACzB,EAAE,KAAK;EACP,EAAE,QAAQ;EACV,EAAE,QAAQ;EACV,EAAE,OAAO;EACT,EAAE,IAAI;EACN,EAAE,EAAE;EACJ,EAAE,IAAI;EACN,EAAE,GAAG;EACL,EAAE,OAAO;EACT,EAAE,MAAM;EACR,EAAE;EACF,EAAE,MAAM,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;AACnC;EACA,EAAEF,kBAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;EACnE,EAAEA,kBAAU,CAAC,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c,CAAC,eAAe,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;EACnD,IAAI,CAAC,CAAC,cAAc,GAAG,cAAc,CAAC;EACtC,GAAG;AACH;EACA,EAAE,OAAO,CAAC,CAAC;EACX,CAAC,CAAC;AACF,iCAAe,sBAAsB;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/EllipseOutlineGeometry-ea3faee0.js b/examples/cesium/Workers/EllipseOutlineGeometry-ea3faee0.js
new file mode 100644
index 0000000..0d1aa55
--- /dev/null
+++ b/examples/cesium/Workers/EllipseOutlineGeometry-ea3faee0.js
@@ -0,0 +1,469 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Transforms-11fb6b0a', './Matrix3-f22b0303', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './Check-d10e5f2e', './EllipseGeometryLibrary-d3f88cc2', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89', './Math-9be8b918'], (function (exports, Transforms, Matrix3, ComponentDatatype, defaultValue, Check, EllipseGeometryLibrary, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1) { 'use strict';
+
+ const scratchCartesian1 = new Matrix3.Cartesian3();
+ let boundingSphereCenter = new Matrix3.Cartesian3();
+
+ function computeEllipse(options) {
+ const center = options.center;
+ boundingSphereCenter = Matrix3.Cartesian3.multiplyByScalar(
+ options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),
+ options.height,
+ boundingSphereCenter
+ );
+ boundingSphereCenter = Matrix3.Cartesian3.add(
+ center,
+ boundingSphereCenter,
+ boundingSphereCenter
+ );
+ const boundingSphere = new Transforms.BoundingSphere(
+ boundingSphereCenter,
+ options.semiMajorAxis
+ );
+ const positions = EllipseGeometryLibrary.EllipseGeometryLibrary.computeEllipsePositions(
+ options,
+ false,
+ true
+ ).outerPositions;
+
+ const attributes = new GeometryAttributes.GeometryAttributes({
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: EllipseGeometryLibrary.EllipseGeometryLibrary.raisePositionsToHeight(
+ positions,
+ options,
+ false
+ ),
+ }),
+ });
+
+ const length = positions.length / 3;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(length, length * 2);
+ let index = 0;
+ for (let i = 0; i < length; ++i) {
+ indices[index++] = i;
+ indices[index++] = (i + 1) % length;
+ }
+
+ return {
+ boundingSphere: boundingSphere,
+ attributes: attributes,
+ indices: indices,
+ };
+ }
+
+ const topBoundingSphere = new Transforms.BoundingSphere();
+ const bottomBoundingSphere = new Transforms.BoundingSphere();
+ function computeExtrudedEllipse(options) {
+ const center = options.center;
+ const ellipsoid = options.ellipsoid;
+ const semiMajorAxis = options.semiMajorAxis;
+ let scaledNormal = Matrix3.Cartesian3.multiplyByScalar(
+ ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),
+ options.height,
+ scratchCartesian1
+ );
+ topBoundingSphere.center = Matrix3.Cartesian3.add(
+ center,
+ scaledNormal,
+ topBoundingSphere.center
+ );
+ topBoundingSphere.radius = semiMajorAxis;
+
+ scaledNormal = Matrix3.Cartesian3.multiplyByScalar(
+ ellipsoid.geodeticSurfaceNormal(center, scaledNormal),
+ options.extrudedHeight,
+ scaledNormal
+ );
+ bottomBoundingSphere.center = Matrix3.Cartesian3.add(
+ center,
+ scaledNormal,
+ bottomBoundingSphere.center
+ );
+ bottomBoundingSphere.radius = semiMajorAxis;
+
+ let positions = EllipseGeometryLibrary.EllipseGeometryLibrary.computeEllipsePositions(
+ options,
+ false,
+ true
+ ).outerPositions;
+ const attributes = new GeometryAttributes.GeometryAttributes({
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: EllipseGeometryLibrary.EllipseGeometryLibrary.raisePositionsToHeight(
+ positions,
+ options,
+ true
+ ),
+ }),
+ });
+
+ positions = attributes.position.values;
+ const boundingSphere = Transforms.BoundingSphere.union(
+ topBoundingSphere,
+ bottomBoundingSphere
+ );
+ let length = positions.length / 3;
+
+ if (defaultValue.defined(options.offsetAttribute)) {
+ let applyOffset = new Uint8Array(length);
+ if (options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
+ applyOffset = applyOffset.fill(1, 0, length / 2);
+ } else {
+ const offsetValue =
+ options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
+ applyOffset = applyOffset.fill(offsetValue);
+ }
+
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ let numberOfVerticalLines = defaultValue.defaultValue(options.numberOfVerticalLines, 16);
+ numberOfVerticalLines = Math$1.CesiumMath.clamp(
+ numberOfVerticalLines,
+ 0,
+ length / 2
+ );
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ length,
+ length * 2 + numberOfVerticalLines * 2
+ );
+
+ length /= 2;
+ let index = 0;
+ let i;
+ for (i = 0; i < length; ++i) {
+ indices[index++] = i;
+ indices[index++] = (i + 1) % length;
+ indices[index++] = i + length;
+ indices[index++] = ((i + 1) % length) + length;
+ }
+
+ let numSide;
+ if (numberOfVerticalLines > 0) {
+ const numSideLines = Math.min(numberOfVerticalLines, length);
+ numSide = Math.round(length / numSideLines);
+
+ const maxI = Math.min(numSide * numberOfVerticalLines, length);
+ for (i = 0; i < maxI; i += numSide) {
+ indices[index++] = i;
+ indices[index++] = i + length;
+ }
+ }
+
+ return {
+ boundingSphere: boundingSphere,
+ attributes: attributes,
+ indices: indices,
+ };
+ }
+
+ /**
+ * A description of the outline of an ellipse on an ellipsoid.
+ *
+ * @alias EllipseOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.
+ * @param {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.
+ * @param {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.
+ * @param {Number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface.
+ * @param {Number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface.
+ * @param {Number} [options.rotation=0.0] The angle from north (counter-clockwise) in radians.
+ * @param {Number} [options.granularity=0.02] The angular distance between points on the ellipse in radians.
+ * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surface of an extruded ellipse.
+ *
+ * @exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero.
+ * @exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis.
+ * @exception {DeveloperError} granularity must be greater than zero.
+ *
+ * @see EllipseOutlineGeometry.createGeometry
+ *
+ * @example
+ * const ellipse = new Cesium.EllipseOutlineGeometry({
+ * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
+ * semiMajorAxis : 500000.0,
+ * semiMinorAxis : 300000.0,
+ * rotation : Cesium.Math.toRadians(60.0)
+ * });
+ * const geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);
+ */
+ function EllipseOutlineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const center = options.center;
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ const semiMajorAxis = options.semiMajorAxis;
+ const semiMinorAxis = options.semiMinorAxis;
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(center)) {
+ throw new Check.DeveloperError("center is required.");
+ }
+ if (!defaultValue.defined(semiMajorAxis)) {
+ throw new Check.DeveloperError("semiMajorAxis is required.");
+ }
+ if (!defaultValue.defined(semiMinorAxis)) {
+ throw new Check.DeveloperError("semiMinorAxis is required.");
+ }
+ if (semiMajorAxis < semiMinorAxis) {
+ throw new Check.DeveloperError(
+ "semiMajorAxis must be greater than or equal to the semiMinorAxis."
+ );
+ }
+ if (granularity <= 0.0) {
+ throw new Check.DeveloperError("granularity must be greater than zero.");
+ }
+ //>>includeEnd('debug');
+
+ const height = defaultValue.defaultValue(options.height, 0.0);
+ const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
+
+ this._center = Matrix3.Cartesian3.clone(center);
+ this._semiMajorAxis = semiMajorAxis;
+ this._semiMinorAxis = semiMinorAxis;
+ this._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid);
+ this._rotation = defaultValue.defaultValue(options.rotation, 0.0);
+ this._height = Math.max(extrudedHeight, height);
+ this._granularity = granularity;
+ this._extrudedHeight = Math.min(extrudedHeight, height);
+ this._numberOfVerticalLines = Math.max(
+ defaultValue.defaultValue(options.numberOfVerticalLines, 16),
+ 0
+ );
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createEllipseOutlineGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ EllipseOutlineGeometry.packedLength =
+ Matrix3.Cartesian3.packedLength + Matrix3.Ellipsoid.packedLength + 8;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {EllipseOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ EllipseOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ Matrix3.Cartesian3.pack(value._center, array, startingIndex);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ array[startingIndex++] = value._semiMajorAxis;
+ array[startingIndex++] = value._semiMinorAxis;
+ array[startingIndex++] = value._rotation;
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._numberOfVerticalLines;
+ array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchCenter = new Matrix3.Cartesian3();
+ const scratchEllipsoid = new Matrix3.Ellipsoid();
+ const scratchOptions = {
+ center: scratchCenter,
+ ellipsoid: scratchEllipsoid,
+ semiMajorAxis: undefined,
+ semiMinorAxis: undefined,
+ rotation: undefined,
+ height: undefined,
+ granularity: undefined,
+ extrudedHeight: undefined,
+ numberOfVerticalLines: undefined,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {EllipseOutlineGeometry} [result] The object into which to store the result.
+ * @returns {EllipseOutlineGeometry} The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.
+ */
+ EllipseOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const center = Matrix3.Cartesian3.unpack(array, startingIndex, scratchCenter);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const semiMajorAxis = array[startingIndex++];
+ const semiMinorAxis = array[startingIndex++];
+ const rotation = array[startingIndex++];
+ const height = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const numberOfVerticalLines = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.height = height;
+ scratchOptions.extrudedHeight = extrudedHeight;
+ scratchOptions.granularity = granularity;
+ scratchOptions.rotation = rotation;
+ scratchOptions.semiMajorAxis = semiMajorAxis;
+ scratchOptions.semiMinorAxis = semiMinorAxis;
+ scratchOptions.numberOfVerticalLines = numberOfVerticalLines;
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return new EllipseOutlineGeometry(scratchOptions);
+ }
+
+ result._center = Matrix3.Cartesian3.clone(center, result._center);
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._semiMajorAxis = semiMajorAxis;
+ result._semiMinorAxis = semiMinorAxis;
+ result._rotation = rotation;
+ result._height = height;
+ result._granularity = granularity;
+ result._extrudedHeight = extrudedHeight;
+ result._numberOfVerticalLines = numberOfVerticalLines;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {EllipseOutlineGeometry} ellipseGeometry A description of the ellipse.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ EllipseOutlineGeometry.createGeometry = function (ellipseGeometry) {
+ if (
+ ellipseGeometry._semiMajorAxis <= 0.0 ||
+ ellipseGeometry._semiMinorAxis <= 0.0
+ ) {
+ return;
+ }
+
+ const height = ellipseGeometry._height;
+ const extrudedHeight = ellipseGeometry._extrudedHeight;
+ const extrude = !Math$1.CesiumMath.equalsEpsilon(
+ height,
+ extrudedHeight,
+ 0,
+ Math$1.CesiumMath.EPSILON2
+ );
+
+ ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(
+ ellipseGeometry._center,
+ ellipseGeometry._center
+ );
+ const options = {
+ center: ellipseGeometry._center,
+ semiMajorAxis: ellipseGeometry._semiMajorAxis,
+ semiMinorAxis: ellipseGeometry._semiMinorAxis,
+ ellipsoid: ellipseGeometry._ellipsoid,
+ rotation: ellipseGeometry._rotation,
+ height: height,
+ granularity: ellipseGeometry._granularity,
+ numberOfVerticalLines: ellipseGeometry._numberOfVerticalLines,
+ };
+ let geometry;
+ if (extrude) {
+ options.extrudedHeight = extrudedHeight;
+ options.offsetAttribute = ellipseGeometry._offsetAttribute;
+ geometry = computeExtrudedEllipse(options);
+ } else {
+ geometry = computeEllipse(options);
+
+ if (defaultValue.defined(ellipseGeometry._offsetAttribute)) {
+ const length = geometry.attributes.position.values.length;
+ const offsetValue =
+ ellipseGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: geometry.boundingSphere,
+ offsetAttribute: ellipseGeometry._offsetAttribute,
+ });
+ };
+
+ exports.EllipseOutlineGeometry = EllipseOutlineGeometry;
+
+}));
+//# sourceMappingURL=EllipseOutlineGeometry-ea3faee0.js.map
diff --git a/examples/cesium/Workers/EllipseOutlineGeometry-ea3faee0.js.map b/examples/cesium/Workers/EllipseOutlineGeometry-ea3faee0.js.map
new file mode 100644
index 0000000..a2d369e
--- /dev/null
+++ b/examples/cesium/Workers/EllipseOutlineGeometry-ea3faee0.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"EllipseOutlineGeometry-ea3faee0.js","sources":["../../../Source/Core/EllipseOutlineGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport EllipseGeometryLibrary from \"./EllipseGeometryLibrary.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\n\r\nconst scratchCartesian1 = new Cartesian3();\r\nlet boundingSphereCenter = new Cartesian3();\r\n\r\nfunction computeEllipse(options) {\r\n const center = options.center;\r\n boundingSphereCenter = Cartesian3.multiplyByScalar(\r\n options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),\r\n options.height,\r\n boundingSphereCenter\r\n );\r\n boundingSphereCenter = Cartesian3.add(\r\n center,\r\n boundingSphereCenter,\r\n boundingSphereCenter\r\n );\r\n const boundingSphere = new BoundingSphere(\r\n boundingSphereCenter,\r\n options.semiMajorAxis\r\n );\r\n const positions = EllipseGeometryLibrary.computeEllipsePositions(\r\n options,\r\n false,\r\n true\r\n ).outerPositions;\r\n\r\n const attributes = new GeometryAttributes({\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: EllipseGeometryLibrary.raisePositionsToHeight(\r\n positions,\r\n options,\r\n false\r\n ),\r\n }),\r\n });\r\n\r\n const length = positions.length / 3;\r\n const indices = IndexDatatype.createTypedArray(length, length * 2);\r\n let index = 0;\r\n for (let i = 0; i < length; ++i) {\r\n indices[index++] = i;\r\n indices[index++] = (i + 1) % length;\r\n }\r\n\r\n return {\r\n boundingSphere: boundingSphere,\r\n attributes: attributes,\r\n indices: indices,\r\n };\r\n}\r\n\r\nconst topBoundingSphere = new BoundingSphere();\r\nconst bottomBoundingSphere = new BoundingSphere();\r\nfunction computeExtrudedEllipse(options) {\r\n const center = options.center;\r\n const ellipsoid = options.ellipsoid;\r\n const semiMajorAxis = options.semiMajorAxis;\r\n let scaledNormal = Cartesian3.multiplyByScalar(\r\n ellipsoid.geodeticSurfaceNormal(center, scratchCartesian1),\r\n options.height,\r\n scratchCartesian1\r\n );\r\n topBoundingSphere.center = Cartesian3.add(\r\n center,\r\n scaledNormal,\r\n topBoundingSphere.center\r\n );\r\n topBoundingSphere.radius = semiMajorAxis;\r\n\r\n scaledNormal = Cartesian3.multiplyByScalar(\r\n ellipsoid.geodeticSurfaceNormal(center, scaledNormal),\r\n options.extrudedHeight,\r\n scaledNormal\r\n );\r\n bottomBoundingSphere.center = Cartesian3.add(\r\n center,\r\n scaledNormal,\r\n bottomBoundingSphere.center\r\n );\r\n bottomBoundingSphere.radius = semiMajorAxis;\r\n\r\n let positions = EllipseGeometryLibrary.computeEllipsePositions(\r\n options,\r\n false,\r\n true\r\n ).outerPositions;\r\n const attributes = new GeometryAttributes({\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: EllipseGeometryLibrary.raisePositionsToHeight(\r\n positions,\r\n options,\r\n true\r\n ),\r\n }),\r\n });\r\n\r\n positions = attributes.position.values;\r\n const boundingSphere = BoundingSphere.union(\r\n topBoundingSphere,\r\n bottomBoundingSphere\r\n );\r\n let length = positions.length / 3;\r\n\r\n if (defined(options.offsetAttribute)) {\r\n let applyOffset = new Uint8Array(length);\r\n if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\r\n applyOffset = applyOffset.fill(1, 0, length / 2);\r\n } else {\r\n const offsetValue =\r\n options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\r\n applyOffset = applyOffset.fill(offsetValue);\r\n }\r\n\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n let numberOfVerticalLines = defaultValue(options.numberOfVerticalLines, 16);\r\n numberOfVerticalLines = CesiumMath.clamp(\r\n numberOfVerticalLines,\r\n 0,\r\n length / 2\r\n );\r\n\r\n const indices = IndexDatatype.createTypedArray(\r\n length,\r\n length * 2 + numberOfVerticalLines * 2\r\n );\r\n\r\n length /= 2;\r\n let index = 0;\r\n let i;\r\n for (i = 0; i < length; ++i) {\r\n indices[index++] = i;\r\n indices[index++] = (i + 1) % length;\r\n indices[index++] = i + length;\r\n indices[index++] = ((i + 1) % length) + length;\r\n }\r\n\r\n let numSide;\r\n if (numberOfVerticalLines > 0) {\r\n const numSideLines = Math.min(numberOfVerticalLines, length);\r\n numSide = Math.round(length / numSideLines);\r\n\r\n const maxI = Math.min(numSide * numberOfVerticalLines, length);\r\n for (i = 0; i < maxI; i += numSide) {\r\n indices[index++] = i;\r\n indices[index++] = i + length;\r\n }\r\n }\r\n\r\n return {\r\n boundingSphere: boundingSphere,\r\n attributes: attributes,\r\n indices: indices,\r\n };\r\n}\r\n\r\n/**\r\n * A description of the outline of an ellipse on an ellipsoid.\r\n *\r\n * @alias EllipseOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3} options.center The ellipse's center point in the fixed frame.\r\n * @param {Number} options.semiMajorAxis The length of the ellipse's semi-major axis in meters.\r\n * @param {Number} options.semiMinorAxis The length of the ellipse's semi-minor axis in meters.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.\r\n * @param {Number} [options.height=0.0] The distance in meters between the ellipse and the ellipsoid surface.\r\n * @param {Number} [options.extrudedHeight] The distance in meters between the ellipse's extruded face and the ellipsoid surface.\r\n * @param {Number} [options.rotation=0.0] The angle from north (counter-clockwise) in radians.\r\n * @param {Number} [options.granularity=0.02] The angular distance between points on the ellipse in radians.\r\n * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surface of an extruded ellipse.\r\n *\r\n * @exception {DeveloperError} semiMajorAxis and semiMinorAxis must be greater than zero.\r\n * @exception {DeveloperError} semiMajorAxis must be greater than or equal to the semiMinorAxis.\r\n * @exception {DeveloperError} granularity must be greater than zero.\r\n *\r\n * @see EllipseOutlineGeometry.createGeometry\r\n *\r\n * @example\r\n * const ellipse = new Cesium.EllipseOutlineGeometry({\r\n * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\r\n * semiMajorAxis : 500000.0,\r\n * semiMinorAxis : 300000.0,\r\n * rotation : Cesium.Math.toRadians(60.0)\r\n * });\r\n * const geometry = Cesium.EllipseOutlineGeometry.createGeometry(ellipse);\r\n */\r\nfunction EllipseOutlineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const center = options.center;\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n const semiMajorAxis = options.semiMajorAxis;\r\n const semiMinorAxis = options.semiMinorAxis;\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(center)) {\r\n throw new DeveloperError(\"center is required.\");\r\n }\r\n if (!defined(semiMajorAxis)) {\r\n throw new DeveloperError(\"semiMajorAxis is required.\");\r\n }\r\n if (!defined(semiMinorAxis)) {\r\n throw new DeveloperError(\"semiMinorAxis is required.\");\r\n }\r\n if (semiMajorAxis < semiMinorAxis) {\r\n throw new DeveloperError(\r\n \"semiMajorAxis must be greater than or equal to the semiMinorAxis.\"\r\n );\r\n }\r\n if (granularity <= 0.0) {\r\n throw new DeveloperError(\"granularity must be greater than zero.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const height = defaultValue(options.height, 0.0);\r\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\r\n\r\n this._center = Cartesian3.clone(center);\r\n this._semiMajorAxis = semiMajorAxis;\r\n this._semiMinorAxis = semiMinorAxis;\r\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\r\n this._rotation = defaultValue(options.rotation, 0.0);\r\n this._height = Math.max(extrudedHeight, height);\r\n this._granularity = granularity;\r\n this._extrudedHeight = Math.min(extrudedHeight, height);\r\n this._numberOfVerticalLines = Math.max(\r\n defaultValue(options.numberOfVerticalLines, 16),\r\n 0\r\n );\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._workerName = \"createEllipseOutlineGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nEllipseOutlineGeometry.packedLength =\r\n Cartesian3.packedLength + Ellipsoid.packedLength + 8;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {EllipseOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nEllipseOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n Cartesian3.pack(value._center, array, startingIndex);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n array[startingIndex++] = value._semiMajorAxis;\r\n array[startingIndex++] = value._semiMinorAxis;\r\n array[startingIndex++] = value._rotation;\r\n array[startingIndex++] = value._height;\r\n array[startingIndex++] = value._granularity;\r\n array[startingIndex++] = value._extrudedHeight;\r\n array[startingIndex++] = value._numberOfVerticalLines;\r\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchCenter = new Cartesian3();\r\nconst scratchEllipsoid = new Ellipsoid();\r\nconst scratchOptions = {\r\n center: scratchCenter,\r\n ellipsoid: scratchEllipsoid,\r\n semiMajorAxis: undefined,\r\n semiMinorAxis: undefined,\r\n rotation: undefined,\r\n height: undefined,\r\n granularity: undefined,\r\n extrudedHeight: undefined,\r\n numberOfVerticalLines: undefined,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {EllipseOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {EllipseOutlineGeometry} The modified result parameter or a new EllipseOutlineGeometry instance if one was not provided.\r\n */\r\nEllipseOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const center = Cartesian3.unpack(array, startingIndex, scratchCenter);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const semiMajorAxis = array[startingIndex++];\r\n const semiMinorAxis = array[startingIndex++];\r\n const rotation = array[startingIndex++];\r\n const height = array[startingIndex++];\r\n const granularity = array[startingIndex++];\r\n const extrudedHeight = array[startingIndex++];\r\n const numberOfVerticalLines = array[startingIndex++];\r\n const offsetAttribute = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.height = height;\r\n scratchOptions.extrudedHeight = extrudedHeight;\r\n scratchOptions.granularity = granularity;\r\n scratchOptions.rotation = rotation;\r\n scratchOptions.semiMajorAxis = semiMajorAxis;\r\n scratchOptions.semiMinorAxis = semiMinorAxis;\r\n scratchOptions.numberOfVerticalLines = numberOfVerticalLines;\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return new EllipseOutlineGeometry(scratchOptions);\r\n }\r\n\r\n result._center = Cartesian3.clone(center, result._center);\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._semiMajorAxis = semiMajorAxis;\r\n result._semiMinorAxis = semiMinorAxis;\r\n result._rotation = rotation;\r\n result._height = height;\r\n result._granularity = granularity;\r\n result._extrudedHeight = extrudedHeight;\r\n result._numberOfVerticalLines = numberOfVerticalLines;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of an outline of an ellipse on an ellipsoid, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {EllipseOutlineGeometry} ellipseGeometry A description of the ellipse.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nEllipseOutlineGeometry.createGeometry = function (ellipseGeometry) {\r\n if (\r\n ellipseGeometry._semiMajorAxis <= 0.0 ||\r\n ellipseGeometry._semiMinorAxis <= 0.0\r\n ) {\r\n return;\r\n }\r\n\r\n const height = ellipseGeometry._height;\r\n const extrudedHeight = ellipseGeometry._extrudedHeight;\r\n const extrude = !CesiumMath.equalsEpsilon(\r\n height,\r\n extrudedHeight,\r\n 0,\r\n CesiumMath.EPSILON2\r\n );\r\n\r\n ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(\r\n ellipseGeometry._center,\r\n ellipseGeometry._center\r\n );\r\n const options = {\r\n center: ellipseGeometry._center,\r\n semiMajorAxis: ellipseGeometry._semiMajorAxis,\r\n semiMinorAxis: ellipseGeometry._semiMinorAxis,\r\n ellipsoid: ellipseGeometry._ellipsoid,\r\n rotation: ellipseGeometry._rotation,\r\n height: height,\r\n granularity: ellipseGeometry._granularity,\r\n numberOfVerticalLines: ellipseGeometry._numberOfVerticalLines,\r\n };\r\n let geometry;\r\n if (extrude) {\r\n options.extrudedHeight = extrudedHeight;\r\n options.offsetAttribute = ellipseGeometry._offsetAttribute;\r\n geometry = computeExtrudedEllipse(options);\r\n } else {\r\n geometry = computeEllipse(options);\r\n\r\n if (defined(ellipseGeometry._offsetAttribute)) {\r\n const length = geometry.attributes.position.values.length;\r\n const offsetValue =\r\n ellipseGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n geometry.attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n }\r\n\r\n return new Geometry({\r\n attributes: geometry.attributes,\r\n indices: geometry.indices,\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: geometry.boundingSphere,\r\n offsetAttribute: ellipseGeometry._offsetAttribute,\r\n });\r\n};\r\nexport default EllipseOutlineGeometry;\r\n"],"names":["Cartesian3","BoundingSphere","EllipseGeometryLibrary","GeometryAttributes","GeometryAttribute","ComponentDatatype","IndexDatatype","defined","GeometryOffsetAttribute","defaultValue","CesiumMath","Ellipsoid","DeveloperError","Geometry","PrimitiveType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,iBAAiB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC3C,IAAI,oBAAoB,GAAG,IAAIA,kBAAU,EAAE,CAAC;AAC5C;EACA,SAAS,cAAc,CAAC,OAAO,EAAE;EACjC,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;EAChC,EAAE,oBAAoB,GAAGA,kBAAU,CAAC,gBAAgB;EACpD,IAAI,OAAO,CAAC,SAAS,CAAC,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,CAAC;EACzE,IAAI,OAAO,CAAC,MAAM;EAClB,IAAI,oBAAoB;EACxB,GAAG,CAAC;EACJ,EAAE,oBAAoB,GAAGA,kBAAU,CAAC,GAAG;EACvC,IAAI,MAAM;EACV,IAAI,oBAAoB;EACxB,IAAI,oBAAoB;EACxB,GAAG,CAAC;EACJ,EAAE,MAAM,cAAc,GAAG,IAAIC,yBAAc;EAC3C,IAAI,oBAAoB;EACxB,IAAI,OAAO,CAAC,aAAa;EACzB,GAAG,CAAC;EACJ,EAAE,MAAM,SAAS,GAAGC,6CAAsB,CAAC,uBAAuB;EAClE,IAAI,OAAO;EACX,IAAI,KAAK;EACT,IAAI,IAAI;EACR,GAAG,CAAC,cAAc,CAAC;AACnB;EACA,EAAE,MAAM,UAAU,GAAG,IAAIC,qCAAkB,CAAC;EAC5C,IAAI,QAAQ,EAAE,IAAIC,mCAAiB,CAAC;EACpC,MAAM,iBAAiB,EAAEC,mCAAiB,CAAC,MAAM;EACjD,MAAM,sBAAsB,EAAE,CAAC;EAC/B,MAAM,MAAM,EAAEH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AC9D,QAAQ,iBAAiB,EAAEC,mCAAiB,CAAC,aAAa;EAC1D,QAAQ,sBAAsB,EAAE,CAAC;EACjC,QAAQ,MAAM,EAAE,WAAW;EAC3B,OAAO,CAAC,CAAC;EACT,KAAK;EACL,GAAG;AACH;EACA,EAAE,OAAO,IAAIQ,0BAAQ,CAAC;EACtB,IAAI,UAAU,EAAE,QAAQ,CAAC,UAAU;EACnC,IAAI,OAAO,EAAE,QAAQ,CAAC,OAAO;EAC7B,IAAI,aAAa,EAAEC,+BAAa,CAAC,KAAK;EACtC,IAAI,cAAc,EAAE,QAAQ,CAAC,cAAc;EAC3C,IAAI,eAAe,EAAE,eAAe,CAAC,gBAAgB;EACrD,GAAG,CAAC,CAAC;EACL,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/EllipsoidGeodesic-38d0ed4a.js b/examples/cesium/Workers/EllipsoidGeodesic-38d0ed4a.js
new file mode 100644
index 0000000..f29ace6
--- /dev/null
+++ b/examples/cesium/Workers/EllipsoidGeodesic-38d0ed4a.js
@@ -0,0 +1,546 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Math-9be8b918'], (function (exports, Matrix3, Check, defaultValue, Math$1) { 'use strict';
+
+ function setConstants(ellipsoidGeodesic) {
+ const uSquared = ellipsoidGeodesic._uSquared;
+ const a = ellipsoidGeodesic._ellipsoid.maximumRadius;
+ const b = ellipsoidGeodesic._ellipsoid.minimumRadius;
+ const f = (a - b) / a;
+
+ const cosineHeading = Math.cos(ellipsoidGeodesic._startHeading);
+ const sineHeading = Math.sin(ellipsoidGeodesic._startHeading);
+
+ const tanU = (1 - f) * Math.tan(ellipsoidGeodesic._start.latitude);
+
+ const cosineU = 1.0 / Math.sqrt(1.0 + tanU * tanU);
+ const sineU = cosineU * tanU;
+
+ const sigma = Math.atan2(tanU, cosineHeading);
+
+ const sineAlpha = cosineU * sineHeading;
+ const sineSquaredAlpha = sineAlpha * sineAlpha;
+
+ const cosineSquaredAlpha = 1.0 - sineSquaredAlpha;
+ const cosineAlpha = Math.sqrt(cosineSquaredAlpha);
+
+ const u2Over4 = uSquared / 4.0;
+ const u4Over16 = u2Over4 * u2Over4;
+ const u6Over64 = u4Over16 * u2Over4;
+ const u8Over256 = u4Over16 * u4Over16;
+
+ const a0 =
+ 1.0 +
+ u2Over4 -
+ (3.0 * u4Over16) / 4.0 +
+ (5.0 * u6Over64) / 4.0 -
+ (175.0 * u8Over256) / 64.0;
+ const a1 = 1.0 - u2Over4 + (15.0 * u4Over16) / 8.0 - (35.0 * u6Over64) / 8.0;
+ const a2 = 1.0 - 3.0 * u2Over4 + (35.0 * u4Over16) / 4.0;
+ const a3 = 1.0 - 5.0 * u2Over4;
+
+ const distanceRatio =
+ a0 * sigma -
+ (a1 * Math.sin(2.0 * sigma) * u2Over4) / 2.0 -
+ (a2 * Math.sin(4.0 * sigma) * u4Over16) / 16.0 -
+ (a3 * Math.sin(6.0 * sigma) * u6Over64) / 48.0 -
+ (Math.sin(8.0 * sigma) * 5.0 * u8Over256) / 512;
+
+ const constants = ellipsoidGeodesic._constants;
+
+ constants.a = a;
+ constants.b = b;
+ constants.f = f;
+ constants.cosineHeading = cosineHeading;
+ constants.sineHeading = sineHeading;
+ constants.tanU = tanU;
+ constants.cosineU = cosineU;
+ constants.sineU = sineU;
+ constants.sigma = sigma;
+ constants.sineAlpha = sineAlpha;
+ constants.sineSquaredAlpha = sineSquaredAlpha;
+ constants.cosineSquaredAlpha = cosineSquaredAlpha;
+ constants.cosineAlpha = cosineAlpha;
+ constants.u2Over4 = u2Over4;
+ constants.u4Over16 = u4Over16;
+ constants.u6Over64 = u6Over64;
+ constants.u8Over256 = u8Over256;
+ constants.a0 = a0;
+ constants.a1 = a1;
+ constants.a2 = a2;
+ constants.a3 = a3;
+ constants.distanceRatio = distanceRatio;
+ }
+
+ function computeC(f, cosineSquaredAlpha) {
+ return (
+ (f * cosineSquaredAlpha * (4.0 + f * (4.0 - 3.0 * cosineSquaredAlpha))) /
+ 16.0
+ );
+ }
+
+ function computeDeltaLambda(
+ f,
+ sineAlpha,
+ cosineSquaredAlpha,
+ sigma,
+ sineSigma,
+ cosineSigma,
+ cosineTwiceSigmaMidpoint
+ ) {
+ const C = computeC(f, cosineSquaredAlpha);
+
+ return (
+ (1.0 - C) *
+ f *
+ sineAlpha *
+ (sigma +
+ C *
+ sineSigma *
+ (cosineTwiceSigmaMidpoint +
+ C *
+ cosineSigma *
+ (2.0 * cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint - 1.0)))
+ );
+ }
+
+ function vincentyInverseFormula(
+ ellipsoidGeodesic,
+ major,
+ minor,
+ firstLongitude,
+ firstLatitude,
+ secondLongitude,
+ secondLatitude
+ ) {
+ const eff = (major - minor) / major;
+ const l = secondLongitude - firstLongitude;
+
+ const u1 = Math.atan((1 - eff) * Math.tan(firstLatitude));
+ const u2 = Math.atan((1 - eff) * Math.tan(secondLatitude));
+
+ const cosineU1 = Math.cos(u1);
+ const sineU1 = Math.sin(u1);
+ const cosineU2 = Math.cos(u2);
+ const sineU2 = Math.sin(u2);
+
+ const cc = cosineU1 * cosineU2;
+ const cs = cosineU1 * sineU2;
+ const ss = sineU1 * sineU2;
+ const sc = sineU1 * cosineU2;
+
+ let lambda = l;
+ let lambdaDot = Math$1.CesiumMath.TWO_PI;
+
+ let cosineLambda = Math.cos(lambda);
+ let sineLambda = Math.sin(lambda);
+
+ let sigma;
+ let cosineSigma;
+ let sineSigma;
+ let cosineSquaredAlpha;
+ let cosineTwiceSigmaMidpoint;
+
+ do {
+ cosineLambda = Math.cos(lambda);
+ sineLambda = Math.sin(lambda);
+
+ const temp = cs - sc * cosineLambda;
+ sineSigma = Math.sqrt(
+ cosineU2 * cosineU2 * sineLambda * sineLambda + temp * temp
+ );
+ cosineSigma = ss + cc * cosineLambda;
+
+ sigma = Math.atan2(sineSigma, cosineSigma);
+
+ let sineAlpha;
+
+ if (sineSigma === 0.0) {
+ sineAlpha = 0.0;
+ cosineSquaredAlpha = 1.0;
+ } else {
+ sineAlpha = (cc * sineLambda) / sineSigma;
+ cosineSquaredAlpha = 1.0 - sineAlpha * sineAlpha;
+ }
+
+ lambdaDot = lambda;
+
+ cosineTwiceSigmaMidpoint = cosineSigma - (2.0 * ss) / cosineSquaredAlpha;
+
+ if (!isFinite(cosineTwiceSigmaMidpoint)) {
+ cosineTwiceSigmaMidpoint = 0.0;
+ }
+
+ lambda =
+ l +
+ computeDeltaLambda(
+ eff,
+ sineAlpha,
+ cosineSquaredAlpha,
+ sigma,
+ sineSigma,
+ cosineSigma,
+ cosineTwiceSigmaMidpoint
+ );
+ } while (Math.abs(lambda - lambdaDot) > Math$1.CesiumMath.EPSILON12);
+
+ const uSquared =
+ (cosineSquaredAlpha * (major * major - minor * minor)) / (minor * minor);
+ const A =
+ 1.0 +
+ (uSquared *
+ (4096.0 + uSquared * (uSquared * (320.0 - 175.0 * uSquared) - 768.0))) /
+ 16384.0;
+ const B =
+ (uSquared *
+ (256.0 + uSquared * (uSquared * (74.0 - 47.0 * uSquared) - 128.0))) /
+ 1024.0;
+
+ const cosineSquaredTwiceSigmaMidpoint =
+ cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint;
+ const deltaSigma =
+ B *
+ sineSigma *
+ (cosineTwiceSigmaMidpoint +
+ (B *
+ (cosineSigma * (2.0 * cosineSquaredTwiceSigmaMidpoint - 1.0) -
+ (B *
+ cosineTwiceSigmaMidpoint *
+ (4.0 * sineSigma * sineSigma - 3.0) *
+ (4.0 * cosineSquaredTwiceSigmaMidpoint - 3.0)) /
+ 6.0)) /
+ 4.0);
+
+ const distance = minor * A * (sigma - deltaSigma);
+
+ const startHeading = Math.atan2(
+ cosineU2 * sineLambda,
+ cs - sc * cosineLambda
+ );
+ const endHeading = Math.atan2(cosineU1 * sineLambda, cs * cosineLambda - sc);
+
+ ellipsoidGeodesic._distance = distance;
+ ellipsoidGeodesic._startHeading = startHeading;
+ ellipsoidGeodesic._endHeading = endHeading;
+ ellipsoidGeodesic._uSquared = uSquared;
+ }
+
+ const scratchCart1 = new Matrix3.Cartesian3();
+ const scratchCart2 = new Matrix3.Cartesian3();
+ function computeProperties(ellipsoidGeodesic, start, end, ellipsoid) {
+ const firstCartesian = Matrix3.Cartesian3.normalize(
+ ellipsoid.cartographicToCartesian(start, scratchCart2),
+ scratchCart1
+ );
+ const lastCartesian = Matrix3.Cartesian3.normalize(
+ ellipsoid.cartographicToCartesian(end, scratchCart2),
+ scratchCart2
+ );
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.greaterThanOrEquals(
+ "value",
+ Math.abs(
+ Math.abs(Matrix3.Cartesian3.angleBetween(firstCartesian, lastCartesian)) - Math.PI
+ ),
+ 0.0125
+ );
+ //>>includeEnd('debug');
+
+ vincentyInverseFormula(
+ ellipsoidGeodesic,
+ ellipsoid.maximumRadius,
+ ellipsoid.minimumRadius,
+ start.longitude,
+ start.latitude,
+ end.longitude,
+ end.latitude
+ );
+
+ ellipsoidGeodesic._start = Matrix3.Cartographic.clone(
+ start,
+ ellipsoidGeodesic._start
+ );
+ ellipsoidGeodesic._end = Matrix3.Cartographic.clone(end, ellipsoidGeodesic._end);
+ ellipsoidGeodesic._start.height = 0;
+ ellipsoidGeodesic._end.height = 0;
+
+ setConstants(ellipsoidGeodesic);
+ }
+
+ /**
+ * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.
+ *
+ * @alias EllipsoidGeodesic
+ * @constructor
+ *
+ * @param {Cartographic} [start] The initial planetodetic point on the path.
+ * @param {Cartographic} [end] The final planetodetic point on the path.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the geodesic lies.
+ */
+ function EllipsoidGeodesic(start, end, ellipsoid) {
+ const e = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+ this._ellipsoid = e;
+ this._start = new Matrix3.Cartographic();
+ this._end = new Matrix3.Cartographic();
+
+ this._constants = {};
+ this._startHeading = undefined;
+ this._endHeading = undefined;
+ this._distance = undefined;
+ this._uSquared = undefined;
+
+ if (defaultValue.defined(start) && defaultValue.defined(end)) {
+ computeProperties(this, start, end, e);
+ }
+ }
+
+ Object.defineProperties(EllipsoidGeodesic.prototype, {
+ /**
+ * Gets the ellipsoid.
+ * @memberof EllipsoidGeodesic.prototype
+ * @type {Ellipsoid}
+ * @readonly
+ */
+ ellipsoid: {
+ get: function () {
+ return this._ellipsoid;
+ },
+ },
+
+ /**
+ * Gets the surface distance between the start and end point
+ * @memberof EllipsoidGeodesic.prototype
+ * @type {Number}
+ * @readonly
+ */
+ surfaceDistance: {
+ get: function () {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("distance", this._distance);
+ //>>includeEnd('debug');
+
+ return this._distance;
+ },
+ },
+
+ /**
+ * Gets the initial planetodetic point on the path.
+ * @memberof EllipsoidGeodesic.prototype
+ * @type {Cartographic}
+ * @readonly
+ */
+ start: {
+ get: function () {
+ return this._start;
+ },
+ },
+
+ /**
+ * Gets the final planetodetic point on the path.
+ * @memberof EllipsoidGeodesic.prototype
+ * @type {Cartographic}
+ * @readonly
+ */
+ end: {
+ get: function () {
+ return this._end;
+ },
+ },
+
+ /**
+ * Gets the heading at the initial point.
+ * @memberof EllipsoidGeodesic.prototype
+ * @type {Number}
+ * @readonly
+ */
+ startHeading: {
+ get: function () {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("distance", this._distance);
+ //>>includeEnd('debug');
+
+ return this._startHeading;
+ },
+ },
+
+ /**
+ * Gets the heading at the final point.
+ * @memberof EllipsoidGeodesic.prototype
+ * @type {Number}
+ * @readonly
+ */
+ endHeading: {
+ get: function () {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("distance", this._distance);
+ //>>includeEnd('debug');
+
+ return this._endHeading;
+ },
+ },
+ });
+
+ /**
+ * Sets the start and end points of the geodesic
+ *
+ * @param {Cartographic} start The initial planetodetic point on the path.
+ * @param {Cartographic} end The final planetodetic point on the path.
+ */
+ EllipsoidGeodesic.prototype.setEndPoints = function (start, end) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("start", start);
+ Check.Check.defined("end", end);
+ //>>includeEnd('debug');
+
+ computeProperties(this, start, end, this._ellipsoid);
+ };
+
+ /**
+ * Provides the location of a point at the indicated portion along the geodesic.
+ *
+ * @param {Number} fraction The portion of the distance between the initial and final points.
+ * @param {Cartographic} [result] The object in which to store the result.
+ * @returns {Cartographic} The location of the point along the geodesic.
+ */
+ EllipsoidGeodesic.prototype.interpolateUsingFraction = function (
+ fraction,
+ result
+ ) {
+ return this.interpolateUsingSurfaceDistance(
+ this._distance * fraction,
+ result
+ );
+ };
+
+ /**
+ * Provides the location of a point at the indicated distance along the geodesic.
+ *
+ * @param {Number} distance The distance from the inital point to the point of interest along the geodesic
+ * @param {Cartographic} [result] The object in which to store the result.
+ * @returns {Cartographic} The location of the point along the geodesic.
+ *
+ * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance
+ */
+ EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function (
+ distance,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("distance", this._distance);
+ //>>includeEnd('debug');
+
+ const constants = this._constants;
+
+ const s = constants.distanceRatio + distance / constants.b;
+
+ const cosine2S = Math.cos(2.0 * s);
+ const cosine4S = Math.cos(4.0 * s);
+ const cosine6S = Math.cos(6.0 * s);
+ const sine2S = Math.sin(2.0 * s);
+ const sine4S = Math.sin(4.0 * s);
+ const sine6S = Math.sin(6.0 * s);
+ const sine8S = Math.sin(8.0 * s);
+
+ const s2 = s * s;
+ const s3 = s * s2;
+
+ const u8Over256 = constants.u8Over256;
+ const u2Over4 = constants.u2Over4;
+ const u6Over64 = constants.u6Over64;
+ const u4Over16 = constants.u4Over16;
+ let sigma =
+ (2.0 * s3 * u8Over256 * cosine2S) / 3.0 +
+ s *
+ (1.0 -
+ u2Over4 +
+ (7.0 * u4Over16) / 4.0 -
+ (15.0 * u6Over64) / 4.0 +
+ (579.0 * u8Over256) / 64.0 -
+ (u4Over16 - (15.0 * u6Over64) / 4.0 + (187.0 * u8Over256) / 16.0) *
+ cosine2S -
+ ((5.0 * u6Over64) / 4.0 - (115.0 * u8Over256) / 16.0) * cosine4S -
+ (29.0 * u8Over256 * cosine6S) / 16.0) +
+ (u2Over4 / 2.0 -
+ u4Over16 +
+ (71.0 * u6Over64) / 32.0 -
+ (85.0 * u8Over256) / 16.0) *
+ sine2S +
+ ((5.0 * u4Over16) / 16.0 -
+ (5.0 * u6Over64) / 4.0 +
+ (383.0 * u8Over256) / 96.0) *
+ sine4S -
+ s2 *
+ ((u6Over64 - (11.0 * u8Over256) / 2.0) * sine2S +
+ (5.0 * u8Over256 * sine4S) / 2.0) +
+ ((29.0 * u6Over64) / 96.0 - (29.0 * u8Over256) / 16.0) * sine6S +
+ (539.0 * u8Over256 * sine8S) / 1536.0;
+
+ const theta = Math.asin(Math.sin(sigma) * constants.cosineAlpha);
+ const latitude = Math.atan((constants.a / constants.b) * Math.tan(theta));
+
+ // Redefine in terms of relative argument of latitude.
+ sigma = sigma - constants.sigma;
+
+ const cosineTwiceSigmaMidpoint = Math.cos(2.0 * constants.sigma + sigma);
+
+ const sineSigma = Math.sin(sigma);
+ const cosineSigma = Math.cos(sigma);
+
+ const cc = constants.cosineU * cosineSigma;
+ const ss = constants.sineU * sineSigma;
+
+ const lambda = Math.atan2(
+ sineSigma * constants.sineHeading,
+ cc - ss * constants.cosineHeading
+ );
+
+ const l =
+ lambda -
+ computeDeltaLambda(
+ constants.f,
+ constants.sineAlpha,
+ constants.cosineSquaredAlpha,
+ sigma,
+ sineSigma,
+ cosineSigma,
+ cosineTwiceSigmaMidpoint
+ );
+
+ if (defaultValue.defined(result)) {
+ result.longitude = this._start.longitude + l;
+ result.latitude = latitude;
+ result.height = 0.0;
+ return result;
+ }
+
+ return new Matrix3.Cartographic(this._start.longitude + l, latitude, 0.0);
+ };
+
+ exports.EllipsoidGeodesic = EllipsoidGeodesic;
+
+}));
+//# sourceMappingURL=EllipsoidGeodesic-38d0ed4a.js.map
diff --git a/examples/cesium/Workers/EllipsoidGeodesic-38d0ed4a.js.map b/examples/cesium/Workers/EllipsoidGeodesic-38d0ed4a.js.map
new file mode 100644
index 0000000..747d8fd
--- /dev/null
+++ b/examples/cesium/Workers/EllipsoidGeodesic-38d0ed4a.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"EllipsoidGeodesic-38d0ed4a.js","sources":["../../../Source/Core/EllipsoidGeodesic.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\nfunction setConstants(ellipsoidGeodesic) {\r\n const uSquared = ellipsoidGeodesic._uSquared;\r\n const a = ellipsoidGeodesic._ellipsoid.maximumRadius;\r\n const b = ellipsoidGeodesic._ellipsoid.minimumRadius;\r\n const f = (a - b) / a;\r\n\r\n const cosineHeading = Math.cos(ellipsoidGeodesic._startHeading);\r\n const sineHeading = Math.sin(ellipsoidGeodesic._startHeading);\r\n\r\n const tanU = (1 - f) * Math.tan(ellipsoidGeodesic._start.latitude);\r\n\r\n const cosineU = 1.0 / Math.sqrt(1.0 + tanU * tanU);\r\n const sineU = cosineU * tanU;\r\n\r\n const sigma = Math.atan2(tanU, cosineHeading);\r\n\r\n const sineAlpha = cosineU * sineHeading;\r\n const sineSquaredAlpha = sineAlpha * sineAlpha;\r\n\r\n const cosineSquaredAlpha = 1.0 - sineSquaredAlpha;\r\n const cosineAlpha = Math.sqrt(cosineSquaredAlpha);\r\n\r\n const u2Over4 = uSquared / 4.0;\r\n const u4Over16 = u2Over4 * u2Over4;\r\n const u6Over64 = u4Over16 * u2Over4;\r\n const u8Over256 = u4Over16 * u4Over16;\r\n\r\n const a0 =\r\n 1.0 +\r\n u2Over4 -\r\n (3.0 * u4Over16) / 4.0 +\r\n (5.0 * u6Over64) / 4.0 -\r\n (175.0 * u8Over256) / 64.0;\r\n const a1 = 1.0 - u2Over4 + (15.0 * u4Over16) / 8.0 - (35.0 * u6Over64) / 8.0;\r\n const a2 = 1.0 - 3.0 * u2Over4 + (35.0 * u4Over16) / 4.0;\r\n const a3 = 1.0 - 5.0 * u2Over4;\r\n\r\n const distanceRatio =\r\n a0 * sigma -\r\n (a1 * Math.sin(2.0 * sigma) * u2Over4) / 2.0 -\r\n (a2 * Math.sin(4.0 * sigma) * u4Over16) / 16.0 -\r\n (a3 * Math.sin(6.0 * sigma) * u6Over64) / 48.0 -\r\n (Math.sin(8.0 * sigma) * 5.0 * u8Over256) / 512;\r\n\r\n const constants = ellipsoidGeodesic._constants;\r\n\r\n constants.a = a;\r\n constants.b = b;\r\n constants.f = f;\r\n constants.cosineHeading = cosineHeading;\r\n constants.sineHeading = sineHeading;\r\n constants.tanU = tanU;\r\n constants.cosineU = cosineU;\r\n constants.sineU = sineU;\r\n constants.sigma = sigma;\r\n constants.sineAlpha = sineAlpha;\r\n constants.sineSquaredAlpha = sineSquaredAlpha;\r\n constants.cosineSquaredAlpha = cosineSquaredAlpha;\r\n constants.cosineAlpha = cosineAlpha;\r\n constants.u2Over4 = u2Over4;\r\n constants.u4Over16 = u4Over16;\r\n constants.u6Over64 = u6Over64;\r\n constants.u8Over256 = u8Over256;\r\n constants.a0 = a0;\r\n constants.a1 = a1;\r\n constants.a2 = a2;\r\n constants.a3 = a3;\r\n constants.distanceRatio = distanceRatio;\r\n}\r\n\r\nfunction computeC(f, cosineSquaredAlpha) {\r\n return (\r\n (f * cosineSquaredAlpha * (4.0 + f * (4.0 - 3.0 * cosineSquaredAlpha))) /\r\n 16.0\r\n );\r\n}\r\n\r\nfunction computeDeltaLambda(\r\n f,\r\n sineAlpha,\r\n cosineSquaredAlpha,\r\n sigma,\r\n sineSigma,\r\n cosineSigma,\r\n cosineTwiceSigmaMidpoint\r\n) {\r\n const C = computeC(f, cosineSquaredAlpha);\r\n\r\n return (\r\n (1.0 - C) *\r\n f *\r\n sineAlpha *\r\n (sigma +\r\n C *\r\n sineSigma *\r\n (cosineTwiceSigmaMidpoint +\r\n C *\r\n cosineSigma *\r\n (2.0 * cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint - 1.0)))\r\n );\r\n}\r\n\r\nfunction vincentyInverseFormula(\r\n ellipsoidGeodesic,\r\n major,\r\n minor,\r\n firstLongitude,\r\n firstLatitude,\r\n secondLongitude,\r\n secondLatitude\r\n) {\r\n const eff = (major - minor) / major;\r\n const l = secondLongitude - firstLongitude;\r\n\r\n const u1 = Math.atan((1 - eff) * Math.tan(firstLatitude));\r\n const u2 = Math.atan((1 - eff) * Math.tan(secondLatitude));\r\n\r\n const cosineU1 = Math.cos(u1);\r\n const sineU1 = Math.sin(u1);\r\n const cosineU2 = Math.cos(u2);\r\n const sineU2 = Math.sin(u2);\r\n\r\n const cc = cosineU1 * cosineU2;\r\n const cs = cosineU1 * sineU2;\r\n const ss = sineU1 * sineU2;\r\n const sc = sineU1 * cosineU2;\r\n\r\n let lambda = l;\r\n let lambdaDot = CesiumMath.TWO_PI;\r\n\r\n let cosineLambda = Math.cos(lambda);\r\n let sineLambda = Math.sin(lambda);\r\n\r\n let sigma;\r\n let cosineSigma;\r\n let sineSigma;\r\n let cosineSquaredAlpha;\r\n let cosineTwiceSigmaMidpoint;\r\n\r\n do {\r\n cosineLambda = Math.cos(lambda);\r\n sineLambda = Math.sin(lambda);\r\n\r\n const temp = cs - sc * cosineLambda;\r\n sineSigma = Math.sqrt(\r\n cosineU2 * cosineU2 * sineLambda * sineLambda + temp * temp\r\n );\r\n cosineSigma = ss + cc * cosineLambda;\r\n\r\n sigma = Math.atan2(sineSigma, cosineSigma);\r\n\r\n let sineAlpha;\r\n\r\n if (sineSigma === 0.0) {\r\n sineAlpha = 0.0;\r\n cosineSquaredAlpha = 1.0;\r\n } else {\r\n sineAlpha = (cc * sineLambda) / sineSigma;\r\n cosineSquaredAlpha = 1.0 - sineAlpha * sineAlpha;\r\n }\r\n\r\n lambdaDot = lambda;\r\n\r\n cosineTwiceSigmaMidpoint = cosineSigma - (2.0 * ss) / cosineSquaredAlpha;\r\n\r\n if (!isFinite(cosineTwiceSigmaMidpoint)) {\r\n cosineTwiceSigmaMidpoint = 0.0;\r\n }\r\n\r\n lambda =\r\n l +\r\n computeDeltaLambda(\r\n eff,\r\n sineAlpha,\r\n cosineSquaredAlpha,\r\n sigma,\r\n sineSigma,\r\n cosineSigma,\r\n cosineTwiceSigmaMidpoint\r\n );\r\n } while (Math.abs(lambda - lambdaDot) > CesiumMath.EPSILON12);\r\n\r\n const uSquared =\r\n (cosineSquaredAlpha * (major * major - minor * minor)) / (minor * minor);\r\n const A =\r\n 1.0 +\r\n (uSquared *\r\n (4096.0 + uSquared * (uSquared * (320.0 - 175.0 * uSquared) - 768.0))) /\r\n 16384.0;\r\n const B =\r\n (uSquared *\r\n (256.0 + uSquared * (uSquared * (74.0 - 47.0 * uSquared) - 128.0))) /\r\n 1024.0;\r\n\r\n const cosineSquaredTwiceSigmaMidpoint =\r\n cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint;\r\n const deltaSigma =\r\n B *\r\n sineSigma *\r\n (cosineTwiceSigmaMidpoint +\r\n (B *\r\n (cosineSigma * (2.0 * cosineSquaredTwiceSigmaMidpoint - 1.0) -\r\n (B *\r\n cosineTwiceSigmaMidpoint *\r\n (4.0 * sineSigma * sineSigma - 3.0) *\r\n (4.0 * cosineSquaredTwiceSigmaMidpoint - 3.0)) /\r\n 6.0)) /\r\n 4.0);\r\n\r\n const distance = minor * A * (sigma - deltaSigma);\r\n\r\n const startHeading = Math.atan2(\r\n cosineU2 * sineLambda,\r\n cs - sc * cosineLambda\r\n );\r\n const endHeading = Math.atan2(cosineU1 * sineLambda, cs * cosineLambda - sc);\r\n\r\n ellipsoidGeodesic._distance = distance;\r\n ellipsoidGeodesic._startHeading = startHeading;\r\n ellipsoidGeodesic._endHeading = endHeading;\r\n ellipsoidGeodesic._uSquared = uSquared;\r\n}\r\n\r\nconst scratchCart1 = new Cartesian3();\r\nconst scratchCart2 = new Cartesian3();\r\nfunction computeProperties(ellipsoidGeodesic, start, end, ellipsoid) {\r\n const firstCartesian = Cartesian3.normalize(\r\n ellipsoid.cartographicToCartesian(start, scratchCart2),\r\n scratchCart1\r\n );\r\n const lastCartesian = Cartesian3.normalize(\r\n ellipsoid.cartographicToCartesian(end, scratchCart2),\r\n scratchCart2\r\n );\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.greaterThanOrEquals(\r\n \"value\",\r\n Math.abs(\r\n Math.abs(Cartesian3.angleBetween(firstCartesian, lastCartesian)) - Math.PI\r\n ),\r\n 0.0125\r\n );\r\n //>>includeEnd('debug');\r\n\r\n vincentyInverseFormula(\r\n ellipsoidGeodesic,\r\n ellipsoid.maximumRadius,\r\n ellipsoid.minimumRadius,\r\n start.longitude,\r\n start.latitude,\r\n end.longitude,\r\n end.latitude\r\n );\r\n\r\n ellipsoidGeodesic._start = Cartographic.clone(\r\n start,\r\n ellipsoidGeodesic._start\r\n );\r\n ellipsoidGeodesic._end = Cartographic.clone(end, ellipsoidGeodesic._end);\r\n ellipsoidGeodesic._start.height = 0;\r\n ellipsoidGeodesic._end.height = 0;\r\n\r\n setConstants(ellipsoidGeodesic);\r\n}\r\n\r\n/**\r\n * Initializes a geodesic on the ellipsoid connecting the two provided planetodetic points.\r\n *\r\n * @alias EllipsoidGeodesic\r\n * @constructor\r\n *\r\n * @param {Cartographic} [start] The initial planetodetic point on the path.\r\n * @param {Cartographic} [end] The final planetodetic point on the path.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the geodesic lies.\r\n */\r\nfunction EllipsoidGeodesic(start, end, ellipsoid) {\r\n const e = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n this._ellipsoid = e;\r\n this._start = new Cartographic();\r\n this._end = new Cartographic();\r\n\r\n this._constants = {};\r\n this._startHeading = undefined;\r\n this._endHeading = undefined;\r\n this._distance = undefined;\r\n this._uSquared = undefined;\r\n\r\n if (defined(start) && defined(end)) {\r\n computeProperties(this, start, end, e);\r\n }\r\n}\r\n\r\nObject.defineProperties(EllipsoidGeodesic.prototype, {\r\n /**\r\n * Gets the ellipsoid.\r\n * @memberof EllipsoidGeodesic.prototype\r\n * @type {Ellipsoid}\r\n * @readonly\r\n */\r\n ellipsoid: {\r\n get: function () {\r\n return this._ellipsoid;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the surface distance between the start and end point\r\n * @memberof EllipsoidGeodesic.prototype\r\n * @type {Number}\r\n * @readonly\r\n */\r\n surfaceDistance: {\r\n get: function () {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"distance\", this._distance);\r\n //>>includeEnd('debug');\r\n\r\n return this._distance;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the initial planetodetic point on the path.\r\n * @memberof EllipsoidGeodesic.prototype\r\n * @type {Cartographic}\r\n * @readonly\r\n */\r\n start: {\r\n get: function () {\r\n return this._start;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the final planetodetic point on the path.\r\n * @memberof EllipsoidGeodesic.prototype\r\n * @type {Cartographic}\r\n * @readonly\r\n */\r\n end: {\r\n get: function () {\r\n return this._end;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the heading at the initial point.\r\n * @memberof EllipsoidGeodesic.prototype\r\n * @type {Number}\r\n * @readonly\r\n */\r\n startHeading: {\r\n get: function () {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"distance\", this._distance);\r\n //>>includeEnd('debug');\r\n\r\n return this._startHeading;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the heading at the final point.\r\n * @memberof EllipsoidGeodesic.prototype\r\n * @type {Number}\r\n * @readonly\r\n */\r\n endHeading: {\r\n get: function () {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"distance\", this._distance);\r\n //>>includeEnd('debug');\r\n\r\n return this._endHeading;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Sets the start and end points of the geodesic\r\n *\r\n * @param {Cartographic} start The initial planetodetic point on the path.\r\n * @param {Cartographic} end The final planetodetic point on the path.\r\n */\r\nEllipsoidGeodesic.prototype.setEndPoints = function (start, end) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"start\", start);\r\n Check.defined(\"end\", end);\r\n //>>includeEnd('debug');\r\n\r\n computeProperties(this, start, end, this._ellipsoid);\r\n};\r\n\r\n/**\r\n * Provides the location of a point at the indicated portion along the geodesic.\r\n *\r\n * @param {Number} fraction The portion of the distance between the initial and final points.\r\n * @param {Cartographic} [result] The object in which to store the result.\r\n * @returns {Cartographic} The location of the point along the geodesic.\r\n */\r\nEllipsoidGeodesic.prototype.interpolateUsingFraction = function (\r\n fraction,\r\n result\r\n) {\r\n return this.interpolateUsingSurfaceDistance(\r\n this._distance * fraction,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Provides the location of a point at the indicated distance along the geodesic.\r\n *\r\n * @param {Number} distance The distance from the inital point to the point of interest along the geodesic\r\n * @param {Cartographic} [result] The object in which to store the result.\r\n * @returns {Cartographic} The location of the point along the geodesic.\r\n *\r\n * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance\r\n */\r\nEllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function (\r\n distance,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"distance\", this._distance);\r\n //>>includeEnd('debug');\r\n\r\n const constants = this._constants;\r\n\r\n const s = constants.distanceRatio + distance / constants.b;\r\n\r\n const cosine2S = Math.cos(2.0 * s);\r\n const cosine4S = Math.cos(4.0 * s);\r\n const cosine6S = Math.cos(6.0 * s);\r\n const sine2S = Math.sin(2.0 * s);\r\n const sine4S = Math.sin(4.0 * s);\r\n const sine6S = Math.sin(6.0 * s);\r\n const sine8S = Math.sin(8.0 * s);\r\n\r\n const s2 = s * s;\r\n const s3 = s * s2;\r\n\r\n const u8Over256 = constants.u8Over256;\r\n const u2Over4 = constants.u2Over4;\r\n const u6Over64 = constants.u6Over64;\r\n const u4Over16 = constants.u4Over16;\r\n let sigma =\r\n (2.0 * s3 * u8Over256 * cosine2S) / 3.0 +\r\n s *\r\n (1.0 -\r\n u2Over4 +\r\n (7.0 * u4Over16) / 4.0 -\r\n (15.0 * u6Over64) / 4.0 +\r\n (579.0 * u8Over256) / 64.0 -\r\n (u4Over16 - (15.0 * u6Over64) / 4.0 + (187.0 * u8Over256) / 16.0) *\r\n cosine2S -\r\n ((5.0 * u6Over64) / 4.0 - (115.0 * u8Over256) / 16.0) * cosine4S -\r\n (29.0 * u8Over256 * cosine6S) / 16.0) +\r\n (u2Over4 / 2.0 -\r\n u4Over16 +\r\n (71.0 * u6Over64) / 32.0 -\r\n (85.0 * u8Over256) / 16.0) *\r\n sine2S +\r\n ((5.0 * u4Over16) / 16.0 -\r\n (5.0 * u6Over64) / 4.0 +\r\n (383.0 * u8Over256) / 96.0) *\r\n sine4S -\r\n s2 *\r\n ((u6Over64 - (11.0 * u8Over256) / 2.0) * sine2S +\r\n (5.0 * u8Over256 * sine4S) / 2.0) +\r\n ((29.0 * u6Over64) / 96.0 - (29.0 * u8Over256) / 16.0) * sine6S +\r\n (539.0 * u8Over256 * sine8S) / 1536.0;\r\n\r\n const theta = Math.asin(Math.sin(sigma) * constants.cosineAlpha);\r\n const latitude = Math.atan((constants.a / constants.b) * Math.tan(theta));\r\n\r\n // Redefine in terms of relative argument of latitude.\r\n sigma = sigma - constants.sigma;\r\n\r\n const cosineTwiceSigmaMidpoint = Math.cos(2.0 * constants.sigma + sigma);\r\n\r\n const sineSigma = Math.sin(sigma);\r\n const cosineSigma = Math.cos(sigma);\r\n\r\n const cc = constants.cosineU * cosineSigma;\r\n const ss = constants.sineU * sineSigma;\r\n\r\n const lambda = Math.atan2(\r\n sineSigma * constants.sineHeading,\r\n cc - ss * constants.cosineHeading\r\n );\r\n\r\n const l =\r\n lambda -\r\n computeDeltaLambda(\r\n constants.f,\r\n constants.sineAlpha,\r\n constants.cosineSquaredAlpha,\r\n sigma,\r\n sineSigma,\r\n cosineSigma,\r\n cosineTwiceSigmaMidpoint\r\n );\r\n\r\n if (defined(result)) {\r\n result.longitude = this._start.longitude + l;\r\n result.latitude = latitude;\r\n result.height = 0.0;\r\n return result;\r\n }\r\n\r\n return new Cartographic(this._start.longitude + l, latitude, 0.0);\r\n};\r\nexport default EllipsoidGeodesic;\r\n"],"names":["CesiumMath","Cartesian3","Check","Cartographic","defaultValue","Ellipsoid","defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,SAAS,YAAY,CAAC,iBAAiB,EAAE;EACzC,EAAE,MAAM,QAAQ,GAAG,iBAAiB,CAAC,SAAS,CAAC;EAC/C,EAAE,MAAM,CAAC,GAAG,iBAAiB,CAAC,UAAU,CAAC,aAAa,CAAC;EACvD,EAAE,MAAM,CAAC,GAAG,iBAAiB,CAAC,UAAU,CAAC,aAAa,CAAC;EACvD,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CA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AAE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK;EAC3B,IAAI,SAAS,GAAG,SAAS,CAAC,WAAW;EACrC,IAAI,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC,aAAa;EACrC,GAAG,CAAC;AACJ;EACA,EAAE,MAAM,CAAC;EACT,IAAI,MAAM;EACV,IAAI,kBAAkB;EACtB,MAAM,SAAS,CAAC,CAAC;EACjB,MAAM,SAAS,CAAC,SAAS;EACzB,MAAM,SAAS,CAAC,kBAAkB;EAClC,MAAM,KAAK;EACX,MAAM,SAAS;EACf,MAAM,WAAW;EACjB,MAAM,wBAAwB;EAC9B,KAAK,CAAC;AACN;EACA,EAAE,IAAII,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;EACjD,IAAI,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;EAC/B,IAAI,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC;EACxB,IAAI,OAAO,MAAM,CAAC;EAClB,GAAG;AACH;EACA,EAAE,OAAO,IAAIH,oBAAY,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,CAAC,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;EACpE,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/EllipsoidGeometry-66510462.js b/examples/cesium/Workers/EllipsoidGeometry-66510462.js
new file mode 100644
index 0000000..f62b0e0
--- /dev/null
+++ b/examples/cesium/Workers/EllipsoidGeometry-66510462.js
@@ -0,0 +1,663 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Transforms-11fb6b0a', './Matrix2-036c77dd', './Matrix3-f22b0303', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './Check-d10e5f2e', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89', './Math-9be8b918', './VertexFormat-f2d74c96'], (function (exports, Transforms, Matrix2, Matrix3, ComponentDatatype, defaultValue, Check, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1, VertexFormat) { 'use strict';
+
+ const scratchPosition = new Matrix3.Cartesian3();
+ const scratchNormal = new Matrix3.Cartesian3();
+ const scratchTangent = new Matrix3.Cartesian3();
+ const scratchBitangent = new Matrix3.Cartesian3();
+ const scratchNormalST = new Matrix3.Cartesian3();
+ const defaultRadii = new Matrix3.Cartesian3(1.0, 1.0, 1.0);
+
+ const cos = Math.cos;
+ const sin = Math.sin;
+
+ /**
+ * A description of an ellipsoid centered at the origin.
+ *
+ * @alias EllipsoidGeometry
+ * @constructor
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.
+ * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.
+ * @param {Number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
+ * @param {Number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
+ * @param {Number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.
+ * @param {Number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.
+ * @param {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.
+ * @param {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ *
+ * @exception {DeveloperError} options.slicePartitions cannot be less than three.
+ * @exception {DeveloperError} options.stackPartitions cannot be less than three.
+ *
+ * @see EllipsoidGeometry#createGeometry
+ *
+ * @example
+ * const ellipsoid = new Cesium.EllipsoidGeometry({
+ * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
+ * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)
+ * });
+ * const geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);
+ */
+ function EllipsoidGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const radii = defaultValue.defaultValue(options.radii, defaultRadii);
+ const innerRadii = defaultValue.defaultValue(options.innerRadii, radii);
+ const minimumClock = defaultValue.defaultValue(options.minimumClock, 0.0);
+ const maximumClock = defaultValue.defaultValue(options.maximumClock, Math$1.CesiumMath.TWO_PI);
+ const minimumCone = defaultValue.defaultValue(options.minimumCone, 0.0);
+ const maximumCone = defaultValue.defaultValue(options.maximumCone, Math$1.CesiumMath.PI);
+ const stackPartitions = Math.round(defaultValue.defaultValue(options.stackPartitions, 64));
+ const slicePartitions = Math.round(defaultValue.defaultValue(options.slicePartitions, 64));
+ const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (slicePartitions < 3) {
+ throw new Check.DeveloperError(
+ "options.slicePartitions cannot be less than three."
+ );
+ }
+ if (stackPartitions < 3) {
+ throw new Check.DeveloperError(
+ "options.stackPartitions cannot be less than three."
+ );
+ }
+ //>>includeEnd('debug');
+
+ this._radii = Matrix3.Cartesian3.clone(radii);
+ this._innerRadii = Matrix3.Cartesian3.clone(innerRadii);
+ this._minimumClock = minimumClock;
+ this._maximumClock = maximumClock;
+ this._minimumCone = minimumCone;
+ this._maximumCone = maximumCone;
+ this._stackPartitions = stackPartitions;
+ this._slicePartitions = slicePartitions;
+ this._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat);
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createEllipsoidGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ EllipsoidGeometry.packedLength =
+ 2 * Matrix3.Cartesian3.packedLength + VertexFormat.VertexFormat.packedLength + 7;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {EllipsoidGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ EllipsoidGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ Matrix3.Cartesian3.pack(value._radii, array, startingIndex);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ Matrix3.Cartesian3.pack(value._innerRadii, array, startingIndex);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ array[startingIndex++] = value._minimumClock;
+ array[startingIndex++] = value._maximumClock;
+ array[startingIndex++] = value._minimumCone;
+ array[startingIndex++] = value._maximumCone;
+ array[startingIndex++] = value._stackPartitions;
+ array[startingIndex++] = value._slicePartitions;
+ array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchRadii = new Matrix3.Cartesian3();
+ const scratchInnerRadii = new Matrix3.Cartesian3();
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+ const scratchOptions = {
+ radii: scratchRadii,
+ innerRadii: scratchInnerRadii,
+ vertexFormat: scratchVertexFormat,
+ minimumClock: undefined,
+ maximumClock: undefined,
+ minimumCone: undefined,
+ maximumCone: undefined,
+ stackPartitions: undefined,
+ slicePartitions: undefined,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {EllipsoidGeometry} [result] The object into which to store the result.
+ * @returns {EllipsoidGeometry} The modified result parameter or a new EllipsoidGeometry instance if one was not provided.
+ */
+ EllipsoidGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const radii = Matrix3.Cartesian3.unpack(array, startingIndex, scratchRadii);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ const innerRadii = Matrix3.Cartesian3.unpack(array, startingIndex, scratchInnerRadii);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ const minimumClock = array[startingIndex++];
+ const maximumClock = array[startingIndex++];
+ const minimumCone = array[startingIndex++];
+ const maximumCone = array[startingIndex++];
+ const stackPartitions = array[startingIndex++];
+ const slicePartitions = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.minimumClock = minimumClock;
+ scratchOptions.maximumClock = maximumClock;
+ scratchOptions.minimumCone = minimumCone;
+ scratchOptions.maximumCone = maximumCone;
+ scratchOptions.stackPartitions = stackPartitions;
+ scratchOptions.slicePartitions = slicePartitions;
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+ return new EllipsoidGeometry(scratchOptions);
+ }
+
+ result._radii = Matrix3.Cartesian3.clone(radii, result._radii);
+ result._innerRadii = Matrix3.Cartesian3.clone(innerRadii, result._innerRadii);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._minimumClock = minimumClock;
+ result._maximumClock = maximumClock;
+ result._minimumCone = minimumCone;
+ result._maximumCone = maximumCone;
+ result._stackPartitions = stackPartitions;
+ result._slicePartitions = slicePartitions;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {EllipsoidGeometry} ellipsoidGeometry A description of the ellipsoid.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ EllipsoidGeometry.createGeometry = function (ellipsoidGeometry) {
+ const radii = ellipsoidGeometry._radii;
+ if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {
+ return;
+ }
+
+ const innerRadii = ellipsoidGeometry._innerRadii;
+ if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {
+ return;
+ }
+
+ const minimumClock = ellipsoidGeometry._minimumClock;
+ const maximumClock = ellipsoidGeometry._maximumClock;
+ const minimumCone = ellipsoidGeometry._minimumCone;
+ const maximumCone = ellipsoidGeometry._maximumCone;
+ const vertexFormat = ellipsoidGeometry._vertexFormat;
+
+ // Add an extra slice and stack so that the number of partitions is the
+ // number of surfaces rather than the number of joints
+ let slicePartitions = ellipsoidGeometry._slicePartitions + 1;
+ let stackPartitions = ellipsoidGeometry._stackPartitions + 1;
+
+ slicePartitions = Math.round(
+ (slicePartitions * Math.abs(maximumClock - minimumClock)) /
+ Math$1.CesiumMath.TWO_PI
+ );
+ stackPartitions = Math.round(
+ (stackPartitions * Math.abs(maximumCone - minimumCone)) / Math$1.CesiumMath.PI
+ );
+
+ if (slicePartitions < 2) {
+ slicePartitions = 2;
+ }
+ if (stackPartitions < 2) {
+ stackPartitions = 2;
+ }
+
+ let i;
+ let j;
+ let index = 0;
+
+ // Create arrays for theta and phi. Duplicate first and last angle to
+ // allow different normals at the intersections.
+ const phis = [minimumCone];
+ const thetas = [minimumClock];
+ for (i = 0; i < stackPartitions; i++) {
+ phis.push(
+ minimumCone + (i * (maximumCone - minimumCone)) / (stackPartitions - 1)
+ );
+ }
+ phis.push(maximumCone);
+ for (j = 0; j < slicePartitions; j++) {
+ thetas.push(
+ minimumClock + (j * (maximumClock - minimumClock)) / (slicePartitions - 1)
+ );
+ }
+ thetas.push(maximumClock);
+ const numPhis = phis.length;
+ const numThetas = thetas.length;
+
+ // Allow for extra indices if there is an inner surface and if we need
+ // to close the sides if the clock range is not a full circle
+ let extraIndices = 0;
+ let vertexMultiplier = 1.0;
+ const hasInnerSurface =
+ innerRadii.x !== radii.x ||
+ innerRadii.y !== radii.y ||
+ innerRadii.z !== radii.z;
+ let isTopOpen = false;
+ let isBotOpen = false;
+ let isClockOpen = false;
+ if (hasInnerSurface) {
+ vertexMultiplier = 2.0;
+ if (minimumCone > 0.0) {
+ isTopOpen = true;
+ extraIndices += slicePartitions - 1;
+ }
+ if (maximumCone < Math.PI) {
+ isBotOpen = true;
+ extraIndices += slicePartitions - 1;
+ }
+ if ((maximumClock - minimumClock) % Math$1.CesiumMath.TWO_PI) {
+ isClockOpen = true;
+ extraIndices += (stackPartitions - 1) * 2 + 1;
+ } else {
+ extraIndices += 1;
+ }
+ }
+
+ const vertexCount = numThetas * numPhis * vertexMultiplier;
+ const positions = new Float64Array(vertexCount * 3);
+ const isInner = new Array(vertexCount).fill(false);
+ const negateNormal = new Array(vertexCount).fill(false);
+
+ // Multiply by 6 because there are two triangles per sector
+ const indexCount = slicePartitions * stackPartitions * vertexMultiplier;
+ const numIndices =
+ 6 *
+ (indexCount +
+ extraIndices +
+ 1 -
+ (slicePartitions + stackPartitions) * vertexMultiplier);
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(indexCount, numIndices);
+
+ const normals = vertexFormat.normal
+ ? new Float32Array(vertexCount * 3)
+ : undefined;
+ const tangents = vertexFormat.tangent
+ ? new Float32Array(vertexCount * 3)
+ : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(vertexCount * 3)
+ : undefined;
+ const st = vertexFormat.st ? new Float32Array(vertexCount * 2) : undefined;
+
+ // Calculate sin/cos phi
+ const sinPhi = new Array(numPhis);
+ const cosPhi = new Array(numPhis);
+ for (i = 0; i < numPhis; i++) {
+ sinPhi[i] = sin(phis[i]);
+ cosPhi[i] = cos(phis[i]);
+ }
+
+ // Calculate sin/cos theta
+ const sinTheta = new Array(numThetas);
+ const cosTheta = new Array(numThetas);
+ for (j = 0; j < numThetas; j++) {
+ cosTheta[j] = cos(thetas[j]);
+ sinTheta[j] = sin(thetas[j]);
+ }
+
+ // Create outer surface
+ for (i = 0; i < numPhis; i++) {
+ for (j = 0; j < numThetas; j++) {
+ positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = radii.z * cosPhi[i];
+ }
+ }
+
+ // Create inner surface
+ let vertexIndex = vertexCount / 2.0;
+ if (hasInnerSurface) {
+ for (i = 0; i < numPhis; i++) {
+ for (j = 0; j < numThetas; j++) {
+ positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = innerRadii.z * cosPhi[i];
+
+ // Keep track of which vertices are the inner and which ones
+ // need the normal to be negated
+ isInner[vertexIndex] = true;
+ if (i > 0 && i !== numPhis - 1 && j !== 0 && j !== numThetas - 1) {
+ negateNormal[vertexIndex] = true;
+ }
+ vertexIndex++;
+ }
+ }
+ }
+
+ // Create indices for outer surface
+ index = 0;
+ let topOffset;
+ let bottomOffset;
+ for (i = 1; i < numPhis - 2; i++) {
+ topOffset = i * numThetas;
+ bottomOffset = (i + 1) * numThetas;
+
+ for (j = 1; j < numThetas - 2; j++) {
+ indices[index++] = bottomOffset + j;
+ indices[index++] = bottomOffset + j + 1;
+ indices[index++] = topOffset + j + 1;
+
+ indices[index++] = bottomOffset + j;
+ indices[index++] = topOffset + j + 1;
+ indices[index++] = topOffset + j;
+ }
+ }
+
+ // Create indices for inner surface
+ if (hasInnerSurface) {
+ const offset = numPhis * numThetas;
+ for (i = 1; i < numPhis - 2; i++) {
+ topOffset = offset + i * numThetas;
+ bottomOffset = offset + (i + 1) * numThetas;
+
+ for (j = 1; j < numThetas - 2; j++) {
+ indices[index++] = bottomOffset + j;
+ indices[index++] = topOffset + j;
+ indices[index++] = topOffset + j + 1;
+
+ indices[index++] = bottomOffset + j;
+ indices[index++] = topOffset + j + 1;
+ indices[index++] = bottomOffset + j + 1;
+ }
+ }
+ }
+
+ let outerOffset;
+ let innerOffset;
+ if (hasInnerSurface) {
+ if (isTopOpen) {
+ // Connect the top of the inner surface to the top of the outer surface
+ innerOffset = numPhis * numThetas;
+ for (i = 1; i < numThetas - 2; i++) {
+ indices[index++] = i;
+ indices[index++] = i + 1;
+ indices[index++] = innerOffset + i + 1;
+
+ indices[index++] = i;
+ indices[index++] = innerOffset + i + 1;
+ indices[index++] = innerOffset + i;
+ }
+ }
+
+ if (isBotOpen) {
+ // Connect the bottom of the inner surface to the bottom of the outer surface
+ outerOffset = numPhis * numThetas - numThetas;
+ innerOffset = numPhis * numThetas * vertexMultiplier - numThetas;
+ for (i = 1; i < numThetas - 2; i++) {
+ indices[index++] = outerOffset + i + 1;
+ indices[index++] = outerOffset + i;
+ indices[index++] = innerOffset + i;
+
+ indices[index++] = outerOffset + i + 1;
+ indices[index++] = innerOffset + i;
+ indices[index++] = innerOffset + i + 1;
+ }
+ }
+ }
+
+ // Connect the edges if clock is not closed
+ if (isClockOpen) {
+ for (i = 1; i < numPhis - 2; i++) {
+ innerOffset = numThetas * numPhis + numThetas * i;
+ outerOffset = numThetas * i;
+ indices[index++] = innerOffset;
+ indices[index++] = outerOffset + numThetas;
+ indices[index++] = outerOffset;
+
+ indices[index++] = innerOffset;
+ indices[index++] = innerOffset + numThetas;
+ indices[index++] = outerOffset + numThetas;
+ }
+
+ for (i = 1; i < numPhis - 2; i++) {
+ innerOffset = numThetas * numPhis + numThetas * (i + 1) - 1;
+ outerOffset = numThetas * (i + 1) - 1;
+ indices[index++] = outerOffset + numThetas;
+ indices[index++] = innerOffset;
+ indices[index++] = outerOffset;
+
+ indices[index++] = outerOffset + numThetas;
+ indices[index++] = innerOffset + numThetas;
+ indices[index++] = innerOffset;
+ }
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+ }
+
+ let stIndex = 0;
+ let normalIndex = 0;
+ let tangentIndex = 0;
+ let bitangentIndex = 0;
+ const vertexCountHalf = vertexCount / 2.0;
+
+ let ellipsoid;
+ const ellipsoidOuter = Matrix3.Ellipsoid.fromCartesian3(radii);
+ const ellipsoidInner = Matrix3.Ellipsoid.fromCartesian3(innerRadii);
+
+ if (
+ vertexFormat.st ||
+ vertexFormat.normal ||
+ vertexFormat.tangent ||
+ vertexFormat.bitangent
+ ) {
+ for (i = 0; i < vertexCount; i++) {
+ ellipsoid = isInner[i] ? ellipsoidInner : ellipsoidOuter;
+ const position = Matrix3.Cartesian3.fromArray(positions, i * 3, scratchPosition);
+ const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);
+ if (negateNormal[i]) {
+ Matrix3.Cartesian3.negate(normal, normal);
+ }
+
+ if (vertexFormat.st) {
+ const normalST = Matrix2.Cartesian2.negate(normal, scratchNormalST);
+ st[stIndex++] =
+ Math.atan2(normalST.y, normalST.x) / Math$1.CesiumMath.TWO_PI + 0.5;
+ st[stIndex++] = Math.asin(normal.z) / Math.PI + 0.5;
+ }
+
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = normal.x;
+ normals[normalIndex++] = normal.y;
+ normals[normalIndex++] = normal.z;
+ }
+
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ const tangent = scratchTangent;
+
+ // Use UNIT_X for the poles
+ let tangetOffset = 0;
+ let unit;
+ if (isInner[i]) {
+ tangetOffset = vertexCountHalf;
+ }
+ if (
+ !isTopOpen &&
+ i >= tangetOffset &&
+ i < tangetOffset + numThetas * 2
+ ) {
+ unit = Matrix3.Cartesian3.UNIT_X;
+ } else {
+ unit = Matrix3.Cartesian3.UNIT_Z;
+ }
+ Matrix3.Cartesian3.cross(unit, normal, tangent);
+ Matrix3.Cartesian3.normalize(tangent, tangent);
+
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ }
+
+ if (vertexFormat.bitangent) {
+ const bitangent = Matrix3.Cartesian3.cross(normal, tangent, scratchBitangent);
+ Matrix3.Cartesian3.normalize(bitangent, bitangent);
+
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ }
+ }
+ }
+
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: st,
+ });
+ }
+
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents,
+ });
+ }
+
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents,
+ });
+ }
+ }
+
+ if (defaultValue.defined(ellipsoidGeometry._offsetAttribute)) {
+ const length = positions.length;
+ const offsetValue =
+ ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ boundingSphere: Transforms.BoundingSphere.fromEllipsoid(ellipsoidOuter),
+ offsetAttribute: ellipsoidGeometry._offsetAttribute,
+ });
+ };
+
+ let unitEllipsoidGeometry;
+
+ /**
+ * Returns the geometric representation of a unit ellipsoid, including its vertices, indices, and a bounding sphere.
+ * @returns {Geometry} The computed vertices and indices.
+ *
+ * @private
+ */
+ EllipsoidGeometry.getUnitEllipsoid = function () {
+ if (!defaultValue.defined(unitEllipsoidGeometry)) {
+ unitEllipsoidGeometry = EllipsoidGeometry.createGeometry(
+ new EllipsoidGeometry({
+ radii: new Matrix3.Cartesian3(1.0, 1.0, 1.0),
+ vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
+ })
+ );
+ }
+ return unitEllipsoidGeometry;
+ };
+
+ exports.EllipsoidGeometry = EllipsoidGeometry;
+
+}));
+//# sourceMappingURL=EllipsoidGeometry-66510462.js.map
diff --git a/examples/cesium/Workers/EllipsoidGeometry-66510462.js.map b/examples/cesium/Workers/EllipsoidGeometry-66510462.js.map
new file mode 100644
index 0000000..9925fd5
--- /dev/null
+++ b/examples/cesium/Workers/EllipsoidGeometry-66510462.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"EllipsoidGeometry-66510462.js","sources":["../../../Source/Core/EllipsoidGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\nconst scratchPosition = new Cartesian3();\r\nconst scratchNormal = new Cartesian3();\r\nconst scratchTangent = new Cartesian3();\r\nconst scratchBitangent = new Cartesian3();\r\nconst scratchNormalST = new Cartesian3();\r\nconst defaultRadii = new Cartesian3(1.0, 1.0, 1.0);\r\n\r\nconst cos = Math.cos;\r\nconst sin = Math.sin;\r\n\r\n/**\r\n * A description of an ellipsoid centered at the origin.\r\n *\r\n * @alias EllipsoidGeometry\r\n * @constructor\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.\r\n * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.\r\n * @param {Number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\r\n * @param {Number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\r\n * @param {Number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.\r\n * @param {Number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.\r\n * @param {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.\r\n * @param {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n *\r\n * @exception {DeveloperError} options.slicePartitions cannot be less than three.\r\n * @exception {DeveloperError} options.stackPartitions cannot be less than three.\r\n *\r\n * @see EllipsoidGeometry#createGeometry\r\n *\r\n * @example\r\n * const ellipsoid = new Cesium.EllipsoidGeometry({\r\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\r\n * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0)\r\n * });\r\n * const geometry = Cesium.EllipsoidGeometry.createGeometry(ellipsoid);\r\n */\r\nfunction EllipsoidGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const radii = defaultValue(options.radii, defaultRadii);\r\n const innerRadii = defaultValue(options.innerRadii, radii);\r\n const minimumClock = defaultValue(options.minimumClock, 0.0);\r\n const maximumClock = defaultValue(options.maximumClock, CesiumMath.TWO_PI);\r\n const minimumCone = defaultValue(options.minimumCone, 0.0);\r\n const maximumCone = defaultValue(options.maximumCone, CesiumMath.PI);\r\n const stackPartitions = Math.round(defaultValue(options.stackPartitions, 64));\r\n const slicePartitions = Math.round(defaultValue(options.slicePartitions, 64));\r\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (slicePartitions < 3) {\r\n throw new DeveloperError(\r\n \"options.slicePartitions cannot be less than three.\"\r\n );\r\n }\r\n if (stackPartitions < 3) {\r\n throw new DeveloperError(\r\n \"options.stackPartitions cannot be less than three.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n this._radii = Cartesian3.clone(radii);\r\n this._innerRadii = Cartesian3.clone(innerRadii);\r\n this._minimumClock = minimumClock;\r\n this._maximumClock = maximumClock;\r\n this._minimumCone = minimumCone;\r\n this._maximumCone = maximumCone;\r\n this._stackPartitions = stackPartitions;\r\n this._slicePartitions = slicePartitions;\r\n this._vertexFormat = VertexFormat.clone(vertexFormat);\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._workerName = \"createEllipsoidGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nEllipsoidGeometry.packedLength =\r\n 2 * Cartesian3.packedLength + VertexFormat.packedLength + 7;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {EllipsoidGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nEllipsoidGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n Cartesian3.pack(value._radii, array, startingIndex);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n Cartesian3.pack(value._innerRadii, array, startingIndex);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n array[startingIndex++] = value._minimumClock;\r\n array[startingIndex++] = value._maximumClock;\r\n array[startingIndex++] = value._minimumCone;\r\n array[startingIndex++] = value._maximumCone;\r\n array[startingIndex++] = value._stackPartitions;\r\n array[startingIndex++] = value._slicePartitions;\r\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchRadii = new Cartesian3();\r\nconst scratchInnerRadii = new Cartesian3();\r\nconst scratchVertexFormat = new VertexFormat();\r\nconst scratchOptions = {\r\n radii: scratchRadii,\r\n innerRadii: scratchInnerRadii,\r\n vertexFormat: scratchVertexFormat,\r\n minimumClock: undefined,\r\n maximumClock: undefined,\r\n minimumCone: undefined,\r\n maximumCone: undefined,\r\n stackPartitions: undefined,\r\n slicePartitions: undefined,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {EllipsoidGeometry} [result] The object into which to store the result.\r\n * @returns {EllipsoidGeometry} The modified result parameter or a new EllipsoidGeometry instance if one was not provided.\r\n */\r\nEllipsoidGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const radii = Cartesian3.unpack(array, startingIndex, scratchRadii);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n const innerRadii = Cartesian3.unpack(array, startingIndex, scratchInnerRadii);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n const minimumClock = array[startingIndex++];\r\n const maximumClock = array[startingIndex++];\r\n const minimumCone = array[startingIndex++];\r\n const maximumCone = array[startingIndex++];\r\n const stackPartitions = array[startingIndex++];\r\n const slicePartitions = array[startingIndex++];\r\n const offsetAttribute = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.minimumClock = minimumClock;\r\n scratchOptions.maximumClock = maximumClock;\r\n scratchOptions.minimumCone = minimumCone;\r\n scratchOptions.maximumCone = maximumCone;\r\n scratchOptions.stackPartitions = stackPartitions;\r\n scratchOptions.slicePartitions = slicePartitions;\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n return new EllipsoidGeometry(scratchOptions);\r\n }\r\n\r\n result._radii = Cartesian3.clone(radii, result._radii);\r\n result._innerRadii = Cartesian3.clone(innerRadii, result._innerRadii);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._minimumClock = minimumClock;\r\n result._maximumClock = maximumClock;\r\n result._minimumCone = minimumCone;\r\n result._maximumCone = maximumCone;\r\n result._stackPartitions = stackPartitions;\r\n result._slicePartitions = slicePartitions;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of an ellipsoid, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {EllipsoidGeometry} ellipsoidGeometry A description of the ellipsoid.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nEllipsoidGeometry.createGeometry = function (ellipsoidGeometry) {\r\n const radii = ellipsoidGeometry._radii;\r\n if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {\r\n return;\r\n }\r\n\r\n const innerRadii = ellipsoidGeometry._innerRadii;\r\n if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {\r\n return;\r\n }\r\n\r\n const minimumClock = ellipsoidGeometry._minimumClock;\r\n const maximumClock = ellipsoidGeometry._maximumClock;\r\n const minimumCone = ellipsoidGeometry._minimumCone;\r\n const maximumCone = ellipsoidGeometry._maximumCone;\r\n const vertexFormat = ellipsoidGeometry._vertexFormat;\r\n\r\n // Add an extra slice and stack so that the number of partitions is the\r\n // number of surfaces rather than the number of joints\r\n let slicePartitions = ellipsoidGeometry._slicePartitions + 1;\r\n let stackPartitions = ellipsoidGeometry._stackPartitions + 1;\r\n\r\n slicePartitions = Math.round(\r\n (slicePartitions * Math.abs(maximumClock - minimumClock)) /\r\n CesiumMath.TWO_PI\r\n );\r\n stackPartitions = Math.round(\r\n (stackPartitions * Math.abs(maximumCone - minimumCone)) / CesiumMath.PI\r\n );\r\n\r\n if (slicePartitions < 2) {\r\n slicePartitions = 2;\r\n }\r\n if (stackPartitions < 2) {\r\n stackPartitions = 2;\r\n }\r\n\r\n let i;\r\n let j;\r\n let index = 0;\r\n\r\n // Create arrays for theta and phi. Duplicate first and last angle to\r\n // allow different normals at the intersections.\r\n const phis = [minimumCone];\r\n const thetas = [minimumClock];\r\n for (i = 0; i < stackPartitions; i++) {\r\n phis.push(\r\n minimumCone + (i * (maximumCone - minimumCone)) / (stackPartitions - 1)\r\n );\r\n }\r\n phis.push(maximumCone);\r\n for (j = 0; j < slicePartitions; j++) {\r\n thetas.push(\r\n minimumClock + (j * (maximumClock - minimumClock)) / (slicePartitions - 1)\r\n );\r\n }\r\n thetas.push(maximumClock);\r\n const numPhis = phis.length;\r\n const numThetas = thetas.length;\r\n\r\n // Allow for extra indices if there is an inner surface and if we need\r\n // to close the sides if the clock range is not a full circle\r\n let extraIndices = 0;\r\n let vertexMultiplier = 1.0;\r\n const hasInnerSurface =\r\n innerRadii.x !== radii.x ||\r\n innerRadii.y !== radii.y ||\r\n innerRadii.z !== radii.z;\r\n let isTopOpen = false;\r\n let isBotOpen = false;\r\n let isClockOpen = false;\r\n if (hasInnerSurface) {\r\n vertexMultiplier = 2.0;\r\n if (minimumCone > 0.0) {\r\n isTopOpen = true;\r\n extraIndices += slicePartitions - 1;\r\n }\r\n if (maximumCone < Math.PI) {\r\n isBotOpen = true;\r\n extraIndices += slicePartitions - 1;\r\n }\r\n if ((maximumClock - minimumClock) % CesiumMath.TWO_PI) {\r\n isClockOpen = true;\r\n extraIndices += (stackPartitions - 1) * 2 + 1;\r\n } else {\r\n extraIndices += 1;\r\n }\r\n }\r\n\r\n const vertexCount = numThetas * numPhis * vertexMultiplier;\r\n const positions = new Float64Array(vertexCount * 3);\r\n const isInner = new Array(vertexCount).fill(false);\r\n const negateNormal = new Array(vertexCount).fill(false);\r\n\r\n // Multiply by 6 because there are two triangles per sector\r\n const indexCount = slicePartitions * stackPartitions * vertexMultiplier;\r\n const numIndices =\r\n 6 *\r\n (indexCount +\r\n extraIndices +\r\n 1 -\r\n (slicePartitions + stackPartitions) * vertexMultiplier);\r\n const indices = IndexDatatype.createTypedArray(indexCount, numIndices);\r\n\r\n const normals = vertexFormat.normal\r\n ? new Float32Array(vertexCount * 3)\r\n : undefined;\r\n const tangents = vertexFormat.tangent\r\n ? new Float32Array(vertexCount * 3)\r\n : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(vertexCount * 3)\r\n : undefined;\r\n const st = vertexFormat.st ? new Float32Array(vertexCount * 2) : undefined;\r\n\r\n // Calculate sin/cos phi\r\n const sinPhi = new Array(numPhis);\r\n const cosPhi = new Array(numPhis);\r\n for (i = 0; i < numPhis; i++) {\r\n sinPhi[i] = sin(phis[i]);\r\n cosPhi[i] = cos(phis[i]);\r\n }\r\n\r\n // Calculate sin/cos theta\r\n const sinTheta = new Array(numThetas);\r\n const cosTheta = new Array(numThetas);\r\n for (j = 0; j < numThetas; j++) {\r\n cosTheta[j] = cos(thetas[j]);\r\n sinTheta[j] = sin(thetas[j]);\r\n }\r\n\r\n // Create outer surface\r\n for (i = 0; i < numPhis; i++) {\r\n for (j = 0; j < numThetas; j++) {\r\n positions[index++] = radii.x * sinPhi[i] * cosTheta[j];\r\n positions[index++] = radii.y * sinPhi[i] * sinTheta[j];\r\n positions[index++] = radii.z * cosPhi[i];\r\n }\r\n }\r\n\r\n // Create inner surface\r\n let vertexIndex = vertexCount / 2.0;\r\n if (hasInnerSurface) {\r\n for (i = 0; i < numPhis; i++) {\r\n for (j = 0; j < numThetas; j++) {\r\n positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];\r\n positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];\r\n positions[index++] = innerRadii.z * cosPhi[i];\r\n\r\n // Keep track of which vertices are the inner and which ones\r\n // need the normal to be negated\r\n isInner[vertexIndex] = true;\r\n if (i > 0 && i !== numPhis - 1 && j !== 0 && j !== numThetas - 1) {\r\n negateNormal[vertexIndex] = true;\r\n }\r\n vertexIndex++;\r\n }\r\n }\r\n }\r\n\r\n // Create indices for outer surface\r\n index = 0;\r\n let topOffset;\r\n let bottomOffset;\r\n for (i = 1; i < numPhis - 2; i++) {\r\n topOffset = i * numThetas;\r\n bottomOffset = (i + 1) * numThetas;\r\n\r\n for (j = 1; j < numThetas - 2; j++) {\r\n indices[index++] = bottomOffset + j;\r\n indices[index++] = bottomOffset + j + 1;\r\n indices[index++] = topOffset + j + 1;\r\n\r\n indices[index++] = bottomOffset + j;\r\n indices[index++] = topOffset + j + 1;\r\n indices[index++] = topOffset + j;\r\n }\r\n }\r\n\r\n // Create indices for inner surface\r\n if (hasInnerSurface) {\r\n const offset = numPhis * numThetas;\r\n for (i = 1; i < numPhis - 2; i++) {\r\n topOffset = offset + i * numThetas;\r\n bottomOffset = offset + (i + 1) * numThetas;\r\n\r\n for (j = 1; j < numThetas - 2; j++) {\r\n indices[index++] = bottomOffset + j;\r\n indices[index++] = topOffset + j;\r\n indices[index++] = topOffset + j + 1;\r\n\r\n indices[index++] = bottomOffset + j;\r\n indices[index++] = topOffset + j + 1;\r\n indices[index++] = bottomOffset + j + 1;\r\n }\r\n }\r\n }\r\n\r\n let outerOffset;\r\n let innerOffset;\r\n if (hasInnerSurface) {\r\n if (isTopOpen) {\r\n // Connect the top of the inner surface to the top of the outer surface\r\n innerOffset = numPhis * numThetas;\r\n for (i = 1; i < numThetas - 2; i++) {\r\n indices[index++] = i;\r\n indices[index++] = i + 1;\r\n indices[index++] = innerOffset + i + 1;\r\n\r\n indices[index++] = i;\r\n indices[index++] = innerOffset + i + 1;\r\n indices[index++] = innerOffset + i;\r\n }\r\n }\r\n\r\n if (isBotOpen) {\r\n // Connect the bottom of the inner surface to the bottom of the outer surface\r\n outerOffset = numPhis * numThetas - numThetas;\r\n innerOffset = numPhis * numThetas * vertexMultiplier - numThetas;\r\n for (i = 1; i < numThetas - 2; i++) {\r\n indices[index++] = outerOffset + i + 1;\r\n indices[index++] = outerOffset + i;\r\n indices[index++] = innerOffset + i;\r\n\r\n indices[index++] = outerOffset + i + 1;\r\n indices[index++] = innerOffset + i;\r\n indices[index++] = innerOffset + i + 1;\r\n }\r\n }\r\n }\r\n\r\n // Connect the edges if clock is not closed\r\n if (isClockOpen) {\r\n for (i = 1; i < numPhis - 2; i++) {\r\n innerOffset = numThetas * numPhis + numThetas * i;\r\n outerOffset = numThetas * i;\r\n indices[index++] = innerOffset;\r\n indices[index++] = outerOffset + numThetas;\r\n indices[index++] = outerOffset;\r\n\r\n indices[index++] = innerOffset;\r\n indices[index++] = innerOffset + numThetas;\r\n indices[index++] = outerOffset + numThetas;\r\n }\r\n\r\n for (i = 1; i < numPhis - 2; i++) {\r\n innerOffset = numThetas * numPhis + numThetas * (i + 1) - 1;\r\n outerOffset = numThetas * (i + 1) - 1;\r\n indices[index++] = outerOffset + numThetas;\r\n indices[index++] = innerOffset;\r\n indices[index++] = outerOffset;\r\n\r\n indices[index++] = outerOffset + numThetas;\r\n indices[index++] = innerOffset + numThetas;\r\n indices[index++] = innerOffset;\r\n }\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n\r\n if (vertexFormat.position) {\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n }\r\n\r\n let stIndex = 0;\r\n let normalIndex = 0;\r\n let tangentIndex = 0;\r\n let bitangentIndex = 0;\r\n const vertexCountHalf = vertexCount / 2.0;\r\n\r\n let ellipsoid;\r\n const ellipsoidOuter = Ellipsoid.fromCartesian3(radii);\r\n const ellipsoidInner = Ellipsoid.fromCartesian3(innerRadii);\r\n\r\n if (\r\n vertexFormat.st ||\r\n vertexFormat.normal ||\r\n vertexFormat.tangent ||\r\n vertexFormat.bitangent\r\n ) {\r\n for (i = 0; i < vertexCount; i++) {\r\n ellipsoid = isInner[i] ? ellipsoidInner : ellipsoidOuter;\r\n const position = Cartesian3.fromArray(positions, i * 3, scratchPosition);\r\n const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);\r\n if (negateNormal[i]) {\r\n Cartesian3.negate(normal, normal);\r\n }\r\n\r\n if (vertexFormat.st) {\r\n const normalST = Cartesian2.negate(normal, scratchNormalST);\r\n st[stIndex++] =\r\n Math.atan2(normalST.y, normalST.x) / CesiumMath.TWO_PI + 0.5;\r\n st[stIndex++] = Math.asin(normal.z) / Math.PI + 0.5;\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n normals[normalIndex++] = normal.x;\r\n normals[normalIndex++] = normal.y;\r\n normals[normalIndex++] = normal.z;\r\n }\r\n\r\n if (vertexFormat.tangent || vertexFormat.bitangent) {\r\n const tangent = scratchTangent;\r\n\r\n // Use UNIT_X for the poles\r\n let tangetOffset = 0;\r\n let unit;\r\n if (isInner[i]) {\r\n tangetOffset = vertexCountHalf;\r\n }\r\n if (\r\n !isTopOpen &&\r\n i >= tangetOffset &&\r\n i < tangetOffset + numThetas * 2\r\n ) {\r\n unit = Cartesian3.UNIT_X;\r\n } else {\r\n unit = Cartesian3.UNIT_Z;\r\n }\r\n Cartesian3.cross(unit, normal, tangent);\r\n Cartesian3.normalize(tangent, tangent);\r\n\r\n if (vertexFormat.tangent) {\r\n tangents[tangentIndex++] = tangent.x;\r\n tangents[tangentIndex++] = tangent.y;\r\n tangents[tangentIndex++] = tangent.z;\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n const bitangent = Cartesian3.cross(normal, tangent, scratchBitangent);\r\n Cartesian3.normalize(bitangent, bitangent);\r\n\r\n bitangents[bitangentIndex++] = bitangent.x;\r\n bitangents[bitangentIndex++] = bitangent.y;\r\n bitangents[bitangentIndex++] = bitangent.z;\r\n }\r\n }\r\n }\r\n\r\n if (vertexFormat.st) {\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: st,\r\n });\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normals,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangents,\r\n });\r\n }\r\n }\r\n\r\n if (defined(ellipsoidGeometry._offsetAttribute)) {\r\n const length = positions.length;\r\n const offsetValue =\r\n ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n boundingSphere: BoundingSphere.fromEllipsoid(ellipsoidOuter),\r\n offsetAttribute: ellipsoidGeometry._offsetAttribute,\r\n });\r\n};\r\n\r\nlet unitEllipsoidGeometry;\r\n\r\n/**\r\n * Returns the geometric representation of a unit ellipsoid, including its vertices, indices, and a bounding sphere.\r\n * @returns {Geometry} The computed vertices and indices.\r\n *\r\n * @private\r\n */\r\nEllipsoidGeometry.getUnitEllipsoid = function () {\r\n if (!defined(unitEllipsoidGeometry)) {\r\n unitEllipsoidGeometry = EllipsoidGeometry.createGeometry(\r\n new EllipsoidGeometry({\r\n radii: new Cartesian3(1.0, 1.0, 1.0),\r\n vertexFormat: VertexFormat.POSITION_ONLY,\r\n })\r\n );\r\n }\r\n return unitEllipsoidGeometry;\r\n};\r\nexport default EllipsoidGeometry;\r\n"],"names":["Cartesian3","defaultValue","CesiumMath","VertexFormat","DeveloperError","defined","IndexDatatype","GeometryAttributes","GeometryAttribute","ComponentDatatype","Ellipsoid","Cartesian2","GeometryOffsetAttribute","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,eAAe,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACzC,MAAM,aAAa,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACvC,MAAM,cAAc,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACxC,MAAM,gBAAgB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC1C,MAAM,eAAe,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACzC,MAAM,YAAY,GAAG,IAAIA,kBAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AACnD;EACA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;EACrB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;AACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,iBAAiB,CAAC,OAAO,EAAE;EACpC,EAAE,OAAO,GAAGC,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA,EAAE,MAAM,KAAK,GAAGA,yBAAY,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,CA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EAC/B,MAAM,MAAM,EAAE,WAAW;EACzB,KAAK,CAAC,CAAC;EACP,GAAG;AACH;EACA,EAAE,OAAO,IAAII,0BAAQ,CAAC;EACtB,IAAI,UAAU,EAAE,UAAU;EAC1B,IAAI,OAAO,EAAE,OAAO;EACpB,IAAI,aAAa,EAAEC,+BAAa,CAAC,SAAS;EAC1C,IAAI,cAAc,EAAEC,yBAAc,CAAC,aAAa,CAAC,cAAc,CAAC;EAChE,IAAI,eAAe,EAAE,iBAAiB,CAAC,gBAAgB;EACvD,GAAG,CAAC,CAAC;EACL,CAAC,CAAC;AACF;EACA,IAAI,qBAAqB,CAAC;AAC1B;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB,CAAC,gBAAgB,GAAG,YAAY;EACjD,EAAE,IAAI,CAACV,oBAAO,CAAC,qBAAqB,CAAC,EAAE;EACvC,IAAI,qBAAqB,GAAG,iBAAiB,CAAC,cAAc;EAC5D,MAAM,IAAI,iBAAiB,CAAC;EAC5B,QAAQ,KAAK,EAAE,IAAIL,kBAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;EAC5C,QAAQ,YAAY,EAAEG,yBAAY,CAAC,aAAa;EAChD,OAAO,CAAC;EACR,KAAK,CAAC;EACN,GAAG;EACH,EAAE,OAAO,qBAAqB,CAAC;EAC/B,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/EllipsoidOutlineGeometry-c18e3c42.js b/examples/cesium/Workers/EllipsoidOutlineGeometry-c18e3c42.js
new file mode 100644
index 0000000..d960f0a
--- /dev/null
+++ b/examples/cesium/Workers/EllipsoidOutlineGeometry-c18e3c42.js
@@ -0,0 +1,480 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Transforms-11fb6b0a', './Matrix3-f22b0303', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './Check-d10e5f2e', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89', './Math-9be8b918'], (function (exports, Transforms, Matrix3, ComponentDatatype, defaultValue, Check, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1) { 'use strict';
+
+ const defaultRadii = new Matrix3.Cartesian3(1.0, 1.0, 1.0);
+ const cos = Math.cos;
+ const sin = Math.sin;
+
+ /**
+ * A description of the outline of an ellipsoid centered at the origin.
+ *
+ * @alias EllipsoidOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.
+ * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.
+ * @param {Number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
+ * @param {Number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.
+ * @param {Number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.
+ * @param {Number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.
+ * @param {Number} [options.stackPartitions=10] The count of stacks for the ellipsoid (1 greater than the number of parallel lines).
+ * @param {Number} [options.slicePartitions=8] The count of slices for the ellipsoid (Equal to the number of radial lines).
+ * @param {Number} [options.subdivisions=128] The number of points per line, determining the granularity of the curvature.
+ *
+ * @exception {DeveloperError} options.stackPartitions must be greater than or equal to one.
+ * @exception {DeveloperError} options.slicePartitions must be greater than or equal to zero.
+ * @exception {DeveloperError} options.subdivisions must be greater than or equal to zero.
+ *
+ * @example
+ * const ellipsoid = new Cesium.EllipsoidOutlineGeometry({
+ * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),
+ * stackPartitions: 6,
+ * slicePartitions: 5
+ * });
+ * const geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);
+ */
+ function EllipsoidOutlineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const radii = defaultValue.defaultValue(options.radii, defaultRadii);
+ const innerRadii = defaultValue.defaultValue(options.innerRadii, radii);
+ const minimumClock = defaultValue.defaultValue(options.minimumClock, 0.0);
+ const maximumClock = defaultValue.defaultValue(options.maximumClock, Math$1.CesiumMath.TWO_PI);
+ const minimumCone = defaultValue.defaultValue(options.minimumCone, 0.0);
+ const maximumCone = defaultValue.defaultValue(options.maximumCone, Math$1.CesiumMath.PI);
+ const stackPartitions = Math.round(defaultValue.defaultValue(options.stackPartitions, 10));
+ const slicePartitions = Math.round(defaultValue.defaultValue(options.slicePartitions, 8));
+ const subdivisions = Math.round(defaultValue.defaultValue(options.subdivisions, 128));
+
+ //>>includeStart('debug', pragmas.debug);
+ if (stackPartitions < 1) {
+ throw new Check.DeveloperError("options.stackPartitions cannot be less than 1");
+ }
+ if (slicePartitions < 0) {
+ throw new Check.DeveloperError("options.slicePartitions cannot be less than 0");
+ }
+ if (subdivisions < 0) {
+ throw new Check.DeveloperError(
+ "options.subdivisions must be greater than or equal to zero."
+ );
+ }
+ if (
+ defaultValue.defined(options.offsetAttribute) &&
+ options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP
+ ) {
+ throw new Check.DeveloperError(
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
+ );
+ }
+ //>>includeEnd('debug');
+
+ this._radii = Matrix3.Cartesian3.clone(radii);
+ this._innerRadii = Matrix3.Cartesian3.clone(innerRadii);
+ this._minimumClock = minimumClock;
+ this._maximumClock = maximumClock;
+ this._minimumCone = minimumCone;
+ this._maximumCone = maximumCone;
+ this._stackPartitions = stackPartitions;
+ this._slicePartitions = slicePartitions;
+ this._subdivisions = subdivisions;
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createEllipsoidOutlineGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ EllipsoidOutlineGeometry.packedLength = 2 * Matrix3.Cartesian3.packedLength + 8;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {EllipsoidOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ EllipsoidOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ Matrix3.Cartesian3.pack(value._radii, array, startingIndex);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ Matrix3.Cartesian3.pack(value._innerRadii, array, startingIndex);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ array[startingIndex++] = value._minimumClock;
+ array[startingIndex++] = value._maximumClock;
+ array[startingIndex++] = value._minimumCone;
+ array[startingIndex++] = value._maximumCone;
+ array[startingIndex++] = value._stackPartitions;
+ array[startingIndex++] = value._slicePartitions;
+ array[startingIndex++] = value._subdivisions;
+ array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchRadii = new Matrix3.Cartesian3();
+ const scratchInnerRadii = new Matrix3.Cartesian3();
+ const scratchOptions = {
+ radii: scratchRadii,
+ innerRadii: scratchInnerRadii,
+ minimumClock: undefined,
+ maximumClock: undefined,
+ minimumCone: undefined,
+ maximumCone: undefined,
+ stackPartitions: undefined,
+ slicePartitions: undefined,
+ subdivisions: undefined,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {EllipsoidOutlineGeometry} [result] The object into which to store the result.
+ * @returns {EllipsoidOutlineGeometry} The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.
+ */
+ EllipsoidOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const radii = Matrix3.Cartesian3.unpack(array, startingIndex, scratchRadii);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ const innerRadii = Matrix3.Cartesian3.unpack(array, startingIndex, scratchInnerRadii);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+
+ const minimumClock = array[startingIndex++];
+ const maximumClock = array[startingIndex++];
+ const minimumCone = array[startingIndex++];
+ const maximumCone = array[startingIndex++];
+ const stackPartitions = array[startingIndex++];
+ const slicePartitions = array[startingIndex++];
+ const subdivisions = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.minimumClock = minimumClock;
+ scratchOptions.maximumClock = maximumClock;
+ scratchOptions.minimumCone = minimumCone;
+ scratchOptions.maximumCone = maximumCone;
+ scratchOptions.stackPartitions = stackPartitions;
+ scratchOptions.slicePartitions = slicePartitions;
+ scratchOptions.subdivisions = subdivisions;
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+ return new EllipsoidOutlineGeometry(scratchOptions);
+ }
+
+ result._radii = Matrix3.Cartesian3.clone(radii, result._radii);
+ result._innerRadii = Matrix3.Cartesian3.clone(innerRadii, result._innerRadii);
+ result._minimumClock = minimumClock;
+ result._maximumClock = maximumClock;
+ result._minimumCone = minimumCone;
+ result._maximumCone = maximumCone;
+ result._stackPartitions = stackPartitions;
+ result._slicePartitions = slicePartitions;
+ result._subdivisions = subdivisions;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {EllipsoidOutlineGeometry} ellipsoidGeometry A description of the ellipsoid outline.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ EllipsoidOutlineGeometry.createGeometry = function (ellipsoidGeometry) {
+ const radii = ellipsoidGeometry._radii;
+ if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {
+ return;
+ }
+
+ const innerRadii = ellipsoidGeometry._innerRadii;
+ if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {
+ return;
+ }
+
+ const minimumClock = ellipsoidGeometry._minimumClock;
+ const maximumClock = ellipsoidGeometry._maximumClock;
+ const minimumCone = ellipsoidGeometry._minimumCone;
+ const maximumCone = ellipsoidGeometry._maximumCone;
+ const subdivisions = ellipsoidGeometry._subdivisions;
+ const ellipsoid = Matrix3.Ellipsoid.fromCartesian3(radii);
+
+ // Add an extra slice and stack to remain consistent with EllipsoidGeometry
+ let slicePartitions = ellipsoidGeometry._slicePartitions + 1;
+ let stackPartitions = ellipsoidGeometry._stackPartitions + 1;
+
+ slicePartitions = Math.round(
+ (slicePartitions * Math.abs(maximumClock - minimumClock)) /
+ Math$1.CesiumMath.TWO_PI
+ );
+ stackPartitions = Math.round(
+ (stackPartitions * Math.abs(maximumCone - minimumCone)) / Math$1.CesiumMath.PI
+ );
+
+ if (slicePartitions < 2) {
+ slicePartitions = 2;
+ }
+ if (stackPartitions < 2) {
+ stackPartitions = 2;
+ }
+
+ let extraIndices = 0;
+ let vertexMultiplier = 1.0;
+ const hasInnerSurface =
+ innerRadii.x !== radii.x ||
+ innerRadii.y !== radii.y ||
+ innerRadii.z !== radii.z;
+ let isTopOpen = false;
+ let isBotOpen = false;
+ if (hasInnerSurface) {
+ vertexMultiplier = 2.0;
+ // Add 2x slicePartitions to connect the top/bottom of the outer to
+ // the top/bottom of the inner
+ if (minimumCone > 0.0) {
+ isTopOpen = true;
+ extraIndices += slicePartitions;
+ }
+ if (maximumCone < Math.PI) {
+ isBotOpen = true;
+ extraIndices += slicePartitions;
+ }
+ }
+
+ const vertexCount =
+ subdivisions * vertexMultiplier * (stackPartitions + slicePartitions);
+ const positions = new Float64Array(vertexCount * 3);
+
+ // Multiply by two because two points define each line segment
+ const numIndices =
+ 2 *
+ (vertexCount +
+ extraIndices -
+ (slicePartitions + stackPartitions) * vertexMultiplier);
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(vertexCount, numIndices);
+
+ let i;
+ let j;
+ let theta;
+ let phi;
+ let index = 0;
+
+ // Calculate sin/cos phi
+ const sinPhi = new Array(stackPartitions);
+ const cosPhi = new Array(stackPartitions);
+ for (i = 0; i < stackPartitions; i++) {
+ phi =
+ minimumCone + (i * (maximumCone - minimumCone)) / (stackPartitions - 1);
+ sinPhi[i] = sin(phi);
+ cosPhi[i] = cos(phi);
+ }
+
+ // Calculate sin/cos theta
+ const sinTheta = new Array(subdivisions);
+ const cosTheta = new Array(subdivisions);
+ for (i = 0; i < subdivisions; i++) {
+ theta =
+ minimumClock + (i * (maximumClock - minimumClock)) / (subdivisions - 1);
+ sinTheta[i] = sin(theta);
+ cosTheta[i] = cos(theta);
+ }
+
+ // Calculate the latitude lines on the outer surface
+ for (i = 0; i < stackPartitions; i++) {
+ for (j = 0; j < subdivisions; j++) {
+ positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = radii.z * cosPhi[i];
+ }
+ }
+
+ // Calculate the latitude lines on the inner surface
+ if (hasInnerSurface) {
+ for (i = 0; i < stackPartitions; i++) {
+ for (j = 0; j < subdivisions; j++) {
+ positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = innerRadii.z * cosPhi[i];
+ }
+ }
+ }
+
+ // Calculate sin/cos phi
+ sinPhi.length = subdivisions;
+ cosPhi.length = subdivisions;
+ for (i = 0; i < subdivisions; i++) {
+ phi = minimumCone + (i * (maximumCone - minimumCone)) / (subdivisions - 1);
+ sinPhi[i] = sin(phi);
+ cosPhi[i] = cos(phi);
+ }
+
+ // Calculate sin/cos theta for each slice partition
+ sinTheta.length = slicePartitions;
+ cosTheta.length = slicePartitions;
+ for (i = 0; i < slicePartitions; i++) {
+ theta =
+ minimumClock +
+ (i * (maximumClock - minimumClock)) / (slicePartitions - 1);
+ sinTheta[i] = sin(theta);
+ cosTheta[i] = cos(theta);
+ }
+
+ // Calculate the longitude lines on the outer surface
+ for (i = 0; i < subdivisions; i++) {
+ for (j = 0; j < slicePartitions; j++) {
+ positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = radii.z * cosPhi[i];
+ }
+ }
+
+ // Calculate the longitude lines on the inner surface
+ if (hasInnerSurface) {
+ for (i = 0; i < subdivisions; i++) {
+ for (j = 0; j < slicePartitions; j++) {
+ positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = innerRadii.z * cosPhi[i];
+ }
+ }
+ }
+
+ // Create indices for the latitude lines
+ index = 0;
+ for (i = 0; i < stackPartitions * vertexMultiplier; i++) {
+ const topOffset = i * subdivisions;
+ for (j = 0; j < subdivisions - 1; j++) {
+ indices[index++] = topOffset + j;
+ indices[index++] = topOffset + j + 1;
+ }
+ }
+
+ // Create indices for the outer longitude lines
+ let offset = stackPartitions * subdivisions * vertexMultiplier;
+ for (i = 0; i < slicePartitions; i++) {
+ for (j = 0; j < subdivisions - 1; j++) {
+ indices[index++] = offset + i + j * slicePartitions;
+ indices[index++] = offset + i + (j + 1) * slicePartitions;
+ }
+ }
+
+ // Create indices for the inner longitude lines
+ if (hasInnerSurface) {
+ offset =
+ stackPartitions * subdivisions * vertexMultiplier +
+ slicePartitions * subdivisions;
+ for (i = 0; i < slicePartitions; i++) {
+ for (j = 0; j < subdivisions - 1; j++) {
+ indices[index++] = offset + i + j * slicePartitions;
+ indices[index++] = offset + i + (j + 1) * slicePartitions;
+ }
+ }
+ }
+
+ if (hasInnerSurface) {
+ let outerOffset = stackPartitions * subdivisions * vertexMultiplier;
+ let innerOffset = outerOffset + subdivisions * slicePartitions;
+ if (isTopOpen) {
+ // Draw lines from the top of the inner surface to the top of the outer surface
+ for (i = 0; i < slicePartitions; i++) {
+ indices[index++] = outerOffset + i;
+ indices[index++] = innerOffset + i;
+ }
+ }
+
+ if (isBotOpen) {
+ // Draw lines from the top of the inner surface to the top of the outer surface
+ outerOffset += subdivisions * slicePartitions - slicePartitions;
+ innerOffset += subdivisions * slicePartitions - slicePartitions;
+ for (i = 0; i < slicePartitions; i++) {
+ indices[index++] = outerOffset + i;
+ indices[index++] = innerOffset + i;
+ }
+ }
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes({
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ }),
+ });
+
+ if (defaultValue.defined(ellipsoidGeometry._offsetAttribute)) {
+ const length = positions.length;
+ const offsetValue =
+ ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: Transforms.BoundingSphere.fromEllipsoid(ellipsoid),
+ offsetAttribute: ellipsoidGeometry._offsetAttribute,
+ });
+ };
+
+ exports.EllipsoidOutlineGeometry = EllipsoidOutlineGeometry;
+
+}));
+//# sourceMappingURL=EllipsoidOutlineGeometry-c18e3c42.js.map
diff --git a/examples/cesium/Workers/EllipsoidOutlineGeometry-c18e3c42.js.map b/examples/cesium/Workers/EllipsoidOutlineGeometry-c18e3c42.js.map
new file mode 100644
index 0000000..770f104
--- /dev/null
+++ b/examples/cesium/Workers/EllipsoidOutlineGeometry-c18e3c42.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"EllipsoidOutlineGeometry-c18e3c42.js","sources":["../../../Source/Core/EllipsoidOutlineGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\n\r\nconst defaultRadii = new Cartesian3(1.0, 1.0, 1.0);\r\nconst cos = Math.cos;\r\nconst sin = Math.sin;\r\n\r\n/**\r\n * A description of the outline of an ellipsoid centered at the origin.\r\n *\r\n * @alias EllipsoidOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {Cartesian3} [options.radii=Cartesian3(1.0, 1.0, 1.0)] The radii of the ellipsoid in the x, y, and z directions.\r\n * @param {Cartesian3} [options.innerRadii=options.radii] The inner radii of the ellipsoid in the x, y, and z directions.\r\n * @param {Number} [options.minimumClock=0.0] The minimum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\r\n * @param {Number} [options.maximumClock=2*PI] The maximum angle lying in the xy-plane measured from the positive x-axis and toward the positive y-axis.\r\n * @param {Number} [options.minimumCone=0.0] The minimum angle measured from the positive z-axis and toward the negative z-axis.\r\n * @param {Number} [options.maximumCone=PI] The maximum angle measured from the positive z-axis and toward the negative z-axis.\r\n * @param {Number} [options.stackPartitions=10] The count of stacks for the ellipsoid (1 greater than the number of parallel lines).\r\n * @param {Number} [options.slicePartitions=8] The count of slices for the ellipsoid (Equal to the number of radial lines).\r\n * @param {Number} [options.subdivisions=128] The number of points per line, determining the granularity of the curvature.\r\n *\r\n * @exception {DeveloperError} options.stackPartitions must be greater than or equal to one.\r\n * @exception {DeveloperError} options.slicePartitions must be greater than or equal to zero.\r\n * @exception {DeveloperError} options.subdivisions must be greater than or equal to zero.\r\n *\r\n * @example\r\n * const ellipsoid = new Cesium.EllipsoidOutlineGeometry({\r\n * radii : new Cesium.Cartesian3(1000000.0, 500000.0, 500000.0),\r\n * stackPartitions: 6,\r\n * slicePartitions: 5\r\n * });\r\n * const geometry = Cesium.EllipsoidOutlineGeometry.createGeometry(ellipsoid);\r\n */\r\nfunction EllipsoidOutlineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const radii = defaultValue(options.radii, defaultRadii);\r\n const innerRadii = defaultValue(options.innerRadii, radii);\r\n const minimumClock = defaultValue(options.minimumClock, 0.0);\r\n const maximumClock = defaultValue(options.maximumClock, CesiumMath.TWO_PI);\r\n const minimumCone = defaultValue(options.minimumCone, 0.0);\r\n const maximumCone = defaultValue(options.maximumCone, CesiumMath.PI);\r\n const stackPartitions = Math.round(defaultValue(options.stackPartitions, 10));\r\n const slicePartitions = Math.round(defaultValue(options.slicePartitions, 8));\r\n const subdivisions = Math.round(defaultValue(options.subdivisions, 128));\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (stackPartitions < 1) {\r\n throw new DeveloperError(\"options.stackPartitions cannot be less than 1\");\r\n }\r\n if (slicePartitions < 0) {\r\n throw new DeveloperError(\"options.slicePartitions cannot be less than 0\");\r\n }\r\n if (subdivisions < 0) {\r\n throw new DeveloperError(\r\n \"options.subdivisions must be greater than or equal to zero.\"\r\n );\r\n }\r\n if (\r\n defined(options.offsetAttribute) &&\r\n options.offsetAttribute === GeometryOffsetAttribute.TOP\r\n ) {\r\n throw new DeveloperError(\r\n \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n this._radii = Cartesian3.clone(radii);\r\n this._innerRadii = Cartesian3.clone(innerRadii);\r\n this._minimumClock = minimumClock;\r\n this._maximumClock = maximumClock;\r\n this._minimumCone = minimumCone;\r\n this._maximumCone = maximumCone;\r\n this._stackPartitions = stackPartitions;\r\n this._slicePartitions = slicePartitions;\r\n this._subdivisions = subdivisions;\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._workerName = \"createEllipsoidOutlineGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nEllipsoidOutlineGeometry.packedLength = 2 * Cartesian3.packedLength + 8;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {EllipsoidOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nEllipsoidOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n Cartesian3.pack(value._radii, array, startingIndex);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n Cartesian3.pack(value._innerRadii, array, startingIndex);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n array[startingIndex++] = value._minimumClock;\r\n array[startingIndex++] = value._maximumClock;\r\n array[startingIndex++] = value._minimumCone;\r\n array[startingIndex++] = value._maximumCone;\r\n array[startingIndex++] = value._stackPartitions;\r\n array[startingIndex++] = value._slicePartitions;\r\n array[startingIndex++] = value._subdivisions;\r\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchRadii = new Cartesian3();\r\nconst scratchInnerRadii = new Cartesian3();\r\nconst scratchOptions = {\r\n radii: scratchRadii,\r\n innerRadii: scratchInnerRadii,\r\n minimumClock: undefined,\r\n maximumClock: undefined,\r\n minimumCone: undefined,\r\n maximumCone: undefined,\r\n stackPartitions: undefined,\r\n slicePartitions: undefined,\r\n subdivisions: undefined,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {EllipsoidOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {EllipsoidOutlineGeometry} The modified result parameter or a new EllipsoidOutlineGeometry instance if one was not provided.\r\n */\r\nEllipsoidOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const radii = Cartesian3.unpack(array, startingIndex, scratchRadii);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n const innerRadii = Cartesian3.unpack(array, startingIndex, scratchInnerRadii);\r\n startingIndex += Cartesian3.packedLength;\r\n\r\n const minimumClock = array[startingIndex++];\r\n const maximumClock = array[startingIndex++];\r\n const minimumCone = array[startingIndex++];\r\n const maximumCone = array[startingIndex++];\r\n const stackPartitions = array[startingIndex++];\r\n const slicePartitions = array[startingIndex++];\r\n const subdivisions = array[startingIndex++];\r\n const offsetAttribute = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.minimumClock = minimumClock;\r\n scratchOptions.maximumClock = maximumClock;\r\n scratchOptions.minimumCone = minimumCone;\r\n scratchOptions.maximumCone = maximumCone;\r\n scratchOptions.stackPartitions = stackPartitions;\r\n scratchOptions.slicePartitions = slicePartitions;\r\n scratchOptions.subdivisions = subdivisions;\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n return new EllipsoidOutlineGeometry(scratchOptions);\r\n }\r\n\r\n result._radii = Cartesian3.clone(radii, result._radii);\r\n result._innerRadii = Cartesian3.clone(innerRadii, result._innerRadii);\r\n result._minimumClock = minimumClock;\r\n result._maximumClock = maximumClock;\r\n result._minimumCone = minimumCone;\r\n result._maximumCone = maximumCone;\r\n result._stackPartitions = stackPartitions;\r\n result._slicePartitions = slicePartitions;\r\n result._subdivisions = subdivisions;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of an outline of an ellipsoid, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {EllipsoidOutlineGeometry} ellipsoidGeometry A description of the ellipsoid outline.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nEllipsoidOutlineGeometry.createGeometry = function (ellipsoidGeometry) {\r\n const radii = ellipsoidGeometry._radii;\r\n if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {\r\n return;\r\n }\r\n\r\n const innerRadii = ellipsoidGeometry._innerRadii;\r\n if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {\r\n return;\r\n }\r\n\r\n const minimumClock = ellipsoidGeometry._minimumClock;\r\n const maximumClock = ellipsoidGeometry._maximumClock;\r\n const minimumCone = ellipsoidGeometry._minimumCone;\r\n const maximumCone = ellipsoidGeometry._maximumCone;\r\n const subdivisions = ellipsoidGeometry._subdivisions;\r\n const ellipsoid = Ellipsoid.fromCartesian3(radii);\r\n\r\n // Add an extra slice and stack to remain consistent with EllipsoidGeometry\r\n let slicePartitions = ellipsoidGeometry._slicePartitions + 1;\r\n let stackPartitions = ellipsoidGeometry._stackPartitions + 1;\r\n\r\n slicePartitions = Math.round(\r\n (slicePartitions * Math.abs(maximumClock - minimumClock)) /\r\n CesiumMath.TWO_PI\r\n );\r\n stackPartitions = Math.round(\r\n (stackPartitions * Math.abs(maximumCone - minimumCone)) / CesiumMath.PI\r\n );\r\n\r\n if (slicePartitions < 2) {\r\n slicePartitions = 2;\r\n }\r\n if (stackPartitions < 2) {\r\n stackPartitions = 2;\r\n }\r\n\r\n let extraIndices = 0;\r\n let vertexMultiplier = 1.0;\r\n const hasInnerSurface =\r\n innerRadii.x !== radii.x ||\r\n innerRadii.y !== radii.y ||\r\n innerRadii.z !== radii.z;\r\n let isTopOpen = false;\r\n let isBotOpen = false;\r\n if (hasInnerSurface) {\r\n vertexMultiplier = 2.0;\r\n // Add 2x slicePartitions to connect the top/bottom of the outer to\r\n // the top/bottom of the inner\r\n if (minimumCone > 0.0) {\r\n isTopOpen = true;\r\n extraIndices += slicePartitions;\r\n }\r\n if (maximumCone < Math.PI) {\r\n isBotOpen = true;\r\n extraIndices += slicePartitions;\r\n }\r\n }\r\n\r\n const vertexCount =\r\n subdivisions * vertexMultiplier * (stackPartitions + slicePartitions);\r\n const positions = new Float64Array(vertexCount * 3);\r\n\r\n // Multiply by two because two points define each line segment\r\n const numIndices =\r\n 2 *\r\n (vertexCount +\r\n extraIndices -\r\n (slicePartitions + stackPartitions) * vertexMultiplier);\r\n const indices = IndexDatatype.createTypedArray(vertexCount, numIndices);\r\n\r\n let i;\r\n let j;\r\n let theta;\r\n let phi;\r\n let index = 0;\r\n\r\n // Calculate sin/cos phi\r\n const sinPhi = new Array(stackPartitions);\r\n const cosPhi = new Array(stackPartitions);\r\n for (i = 0; i < stackPartitions; i++) {\r\n phi =\r\n minimumCone + (i * (maximumCone - minimumCone)) / (stackPartitions - 1);\r\n sinPhi[i] = sin(phi);\r\n cosPhi[i] = cos(phi);\r\n }\r\n\r\n // Calculate sin/cos theta\r\n const sinTheta = new Array(subdivisions);\r\n const cosTheta = new Array(subdivisions);\r\n for (i = 0; i < subdivisions; i++) {\r\n theta =\r\n minimumClock + (i * (maximumClock - minimumClock)) / (subdivisions - 1);\r\n sinTheta[i] = sin(theta);\r\n cosTheta[i] = cos(theta);\r\n }\r\n\r\n // Calculate the latitude lines on the outer surface\r\n for (i = 0; i < stackPartitions; i++) {\r\n for (j = 0; j < subdivisions; j++) {\r\n positions[index++] = radii.x * sinPhi[i] * cosTheta[j];\r\n positions[index++] = radii.y * sinPhi[i] * sinTheta[j];\r\n positions[index++] = radii.z * cosPhi[i];\r\n }\r\n }\r\n\r\n // Calculate the latitude lines on the inner surface\r\n if (hasInnerSurface) {\r\n for (i = 0; i < stackPartitions; i++) {\r\n for (j = 0; j < subdivisions; j++) {\r\n positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];\r\n positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];\r\n positions[index++] = innerRadii.z * cosPhi[i];\r\n }\r\n }\r\n }\r\n\r\n // Calculate sin/cos phi\r\n sinPhi.length = subdivisions;\r\n cosPhi.length = subdivisions;\r\n for (i = 0; i < subdivisions; i++) {\r\n phi = minimumCone + (i * (maximumCone - minimumCone)) / (subdivisions - 1);\r\n sinPhi[i] = sin(phi);\r\n cosPhi[i] = cos(phi);\r\n }\r\n\r\n // Calculate sin/cos theta for each slice partition\r\n sinTheta.length = slicePartitions;\r\n cosTheta.length = slicePartitions;\r\n for (i = 0; i < slicePartitions; i++) {\r\n theta =\r\n minimumClock +\r\n (i * (maximumClock - minimumClock)) / (slicePartitions - 1);\r\n sinTheta[i] = sin(theta);\r\n cosTheta[i] = cos(theta);\r\n }\r\n\r\n // Calculate the longitude lines on the outer surface\r\n for (i = 0; i < subdivisions; i++) {\r\n for (j = 0; j < slicePartitions; j++) {\r\n positions[index++] = radii.x * sinPhi[i] * cosTheta[j];\r\n positions[index++] = radii.y * sinPhi[i] * sinTheta[j];\r\n positions[index++] = radii.z * cosPhi[i];\r\n }\r\n }\r\n\r\n // Calculate the longitude lines on the inner surface\r\n if (hasInnerSurface) {\r\n for (i = 0; i < subdivisions; i++) {\r\n for (j = 0; j < slicePartitions; j++) {\r\n positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];\r\n positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];\r\n positions[index++] = innerRadii.z * cosPhi[i];\r\n }\r\n }\r\n }\r\n\r\n // Create indices for the latitude lines\r\n index = 0;\r\n for (i = 0; i < stackPartitions * vertexMultiplier; i++) {\r\n const topOffset = i * subdivisions;\r\n for (j = 0; j < subdivisions - 1; j++) {\r\n indices[index++] = topOffset + j;\r\n indices[index++] = topOffset + j + 1;\r\n }\r\n }\r\n\r\n // Create indices for the outer longitude lines\r\n let offset = stackPartitions * subdivisions * vertexMultiplier;\r\n for (i = 0; i < slicePartitions; i++) {\r\n for (j = 0; j < subdivisions - 1; j++) {\r\n indices[index++] = offset + i + j * slicePartitions;\r\n indices[index++] = offset + i + (j + 1) * slicePartitions;\r\n }\r\n }\r\n\r\n // Create indices for the inner longitude lines\r\n if (hasInnerSurface) {\r\n offset =\r\n stackPartitions * subdivisions * vertexMultiplier +\r\n slicePartitions * subdivisions;\r\n for (i = 0; i < slicePartitions; i++) {\r\n for (j = 0; j < subdivisions - 1; j++) {\r\n indices[index++] = offset + i + j * slicePartitions;\r\n indices[index++] = offset + i + (j + 1) * slicePartitions;\r\n }\r\n }\r\n }\r\n\r\n if (hasInnerSurface) {\r\n let outerOffset = stackPartitions * subdivisions * vertexMultiplier;\r\n let innerOffset = outerOffset + subdivisions * slicePartitions;\r\n if (isTopOpen) {\r\n // Draw lines from the top of the inner surface to the top of the outer surface\r\n for (i = 0; i < slicePartitions; i++) {\r\n indices[index++] = outerOffset + i;\r\n indices[index++] = innerOffset + i;\r\n }\r\n }\r\n\r\n if (isBotOpen) {\r\n // Draw lines from the top of the inner surface to the top of the outer surface\r\n outerOffset += subdivisions * slicePartitions - slicePartitions;\r\n innerOffset += subdivisions * slicePartitions - slicePartitions;\r\n for (i = 0; i < slicePartitions; i++) {\r\n indices[index++] = outerOffset + i;\r\n indices[index++] = innerOffset + i;\r\n }\r\n }\r\n }\r\n\r\n const attributes = new GeometryAttributes({\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n }),\r\n });\r\n\r\n if (defined(ellipsoidGeometry._offsetAttribute)) {\r\n const length = positions.length;\r\n const offsetValue =\r\n ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: BoundingSphere.fromEllipsoid(ellipsoid),\r\n offsetAttribute: ellipsoidGeometry._offsetAttribute,\r\n });\r\n};\r\nexport default EllipsoidOutlineGeometry;\r\n"],"names":["Cartesian3","defaultValue","CesiumMath","DeveloperError","defined","GeometryOffsetAttribute","Ellipsoid","IndexDatatype","GeometryAttributes","GeometryAttribute","ComponentDatatype","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,YAAY,GAAG,IAAIA,kBAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;EACnD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;EACrB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;AACrB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,wBAAwB,CAAC,OAAO,EAAE;EAC3C,EAAE,OAAO,GAAGC,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA,EAAE,MAAM,KAAK,GAAGA,yBAAY,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;EAC1D,EAAE,MAAM,UAAU,GAAGA,yBAAY,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;EAC7D,EAAE,MAAM,YAAY,GAAGA,yBAAY,CAAC,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;EAC/D,EAAE,MAAM,YAAY,GAAGA,yBAAY,CAAC,OAAO,CAAC,YAAY,EAAEC,iBAAU,CAAC,MAAM,CAAC,CAAC;EAC7E,EAAE,MAAM,WAAW,GAAGD,yBAAY,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;EAC7D,EAAE,MAAM,WAAW,GAAGA,yBAAY,CAAC,OAAO,CAAC,WAAW,EAAEC,iBAAU,CAAC,EAAE,CAAC,CAAC;EACvE,EAAE,MAAM,eAAe,GA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;EACrB,MAAM,iBAAiB,CAAC,gBAAgB,KAAKC,+CAAuB,CAAC,IAAI;EACzE,UAAU,CAAC;EACX,UAAU,CAAC,CAAC;EACZ,IAAI,MAAM,WAAW,GAAG,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;EACrE,IAAI,UAAU,CAAC,WAAW,GAAG,IAAII,mCAAiB,CAAC;EACnD,MAAM,iBAAiB,EAAEC,mCAAiB,CAAC,aAAa;EACxD,MAAM,sBAAsB,EAAE,CAAC;EAC/B,MAAM,MAAM,EAAE,WAAW;EACzB,KAAK,CAAC,CAAC;EACP,GAAG;AACH;EACA,EAAE,OAAO,IAAIC,0BAAQ,CAAC;EACtB,IAAI,UAAU,EAAE,UAAU;EAC1B,IAAI,OAAO,EAAE,OAAO;EACpB,IAAI,aAAa,EAAEC,+BAAa,CAAC,KAAK;EACtC,IAAI,cAAc,EAAEC,yBAAc,CAAC,aAAa,CAAC,SAAS,CAAC;EAC3D,IAAI,eAAe,EAAE,iBAAiB,CAAC,gBAAgB;EACvD,GAAG,CAAC,CAAC;EACL,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/EllipsoidRhumbLine-48b4507b.js b/examples/cesium/Workers/EllipsoidRhumbLine-48b4507b.js
new file mode 100644
index 0000000..018ce00
--- /dev/null
+++ b/examples/cesium/Workers/EllipsoidRhumbLine-48b4507b.js
@@ -0,0 +1,767 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Math-9be8b918'], (function (exports, Matrix3, Check, defaultValue, Math$1) { 'use strict';
+
+ function calculateM(ellipticity, major, latitude) {
+ if (ellipticity === 0.0) {
+ // sphere
+ return major * latitude;
+ }
+
+ const e2 = ellipticity * ellipticity;
+ const e4 = e2 * e2;
+ const e6 = e4 * e2;
+ const e8 = e6 * e2;
+ const e10 = e8 * e2;
+ const e12 = e10 * e2;
+ const phi = latitude;
+ const sin2Phi = Math.sin(2 * phi);
+ const sin4Phi = Math.sin(4 * phi);
+ const sin6Phi = Math.sin(6 * phi);
+ const sin8Phi = Math.sin(8 * phi);
+ const sin10Phi = Math.sin(10 * phi);
+ const sin12Phi = Math.sin(12 * phi);
+
+ return (
+ major *
+ ((1 -
+ e2 / 4 -
+ (3 * e4) / 64 -
+ (5 * e6) / 256 -
+ (175 * e8) / 16384 -
+ (441 * e10) / 65536 -
+ (4851 * e12) / 1048576) *
+ phi -
+ ((3 * e2) / 8 +
+ (3 * e4) / 32 +
+ (45 * e6) / 1024 +
+ (105 * e8) / 4096 +
+ (2205 * e10) / 131072 +
+ (6237 * e12) / 524288) *
+ sin2Phi +
+ ((15 * e4) / 256 +
+ (45 * e6) / 1024 +
+ (525 * e8) / 16384 +
+ (1575 * e10) / 65536 +
+ (155925 * e12) / 8388608) *
+ sin4Phi -
+ ((35 * e6) / 3072 +
+ (175 * e8) / 12288 +
+ (3675 * e10) / 262144 +
+ (13475 * e12) / 1048576) *
+ sin6Phi +
+ ((315 * e8) / 131072 + (2205 * e10) / 524288 + (43659 * e12) / 8388608) *
+ sin8Phi -
+ ((693 * e10) / 1310720 + (6237 * e12) / 5242880) * sin10Phi +
+ ((1001 * e12) / 8388608) * sin12Phi)
+ );
+ }
+
+ function calculateInverseM(M, ellipticity, major) {
+ const d = M / major;
+
+ if (ellipticity === 0.0) {
+ // sphere
+ return d;
+ }
+
+ const d2 = d * d;
+ const d3 = d2 * d;
+ const d4 = d3 * d;
+ const e = ellipticity;
+ const e2 = e * e;
+ const e4 = e2 * e2;
+ const e6 = e4 * e2;
+ const e8 = e6 * e2;
+ const e10 = e8 * e2;
+ const e12 = e10 * e2;
+ const sin2D = Math.sin(2 * d);
+ const cos2D = Math.cos(2 * d);
+ const sin4D = Math.sin(4 * d);
+ const cos4D = Math.cos(4 * d);
+ const sin6D = Math.sin(6 * d);
+ const cos6D = Math.cos(6 * d);
+ const sin8D = Math.sin(8 * d);
+ const cos8D = Math.cos(8 * d);
+ const sin10D = Math.sin(10 * d);
+ const cos10D = Math.cos(10 * d);
+ const sin12D = Math.sin(12 * d);
+
+ return (
+ d +
+ (d * e2) / 4 +
+ (7 * d * e4) / 64 +
+ (15 * d * e6) / 256 +
+ (579 * d * e8) / 16384 +
+ (1515 * d * e10) / 65536 +
+ (16837 * d * e12) / 1048576 +
+ ((3 * d * e4) / 16 +
+ (45 * d * e6) / 256 -
+ (d * (32 * d2 - 561) * e8) / 4096 -
+ (d * (232 * d2 - 1677) * e10) / 16384 +
+ (d * (399985 - 90560 * d2 + 512 * d4) * e12) / 5242880) *
+ cos2D +
+ ((21 * d * e6) / 256 +
+ (483 * d * e8) / 4096 -
+ (d * (224 * d2 - 1969) * e10) / 16384 -
+ (d * (33152 * d2 - 112599) * e12) / 1048576) *
+ cos4D +
+ ((151 * d * e8) / 4096 +
+ (4681 * d * e10) / 65536 +
+ (1479 * d * e12) / 16384 -
+ (453 * d3 * e12) / 32768) *
+ cos6D +
+ ((1097 * d * e10) / 65536 + (42783 * d * e12) / 1048576) * cos8D +
+ ((8011 * d * e12) / 1048576) * cos10D +
+ ((3 * e2) / 8 +
+ (3 * e4) / 16 +
+ (213 * e6) / 2048 -
+ (3 * d2 * e6) / 64 +
+ (255 * e8) / 4096 -
+ (33 * d2 * e8) / 512 +
+ (20861 * e10) / 524288 -
+ (33 * d2 * e10) / 512 +
+ (d4 * e10) / 1024 +
+ (28273 * e12) / 1048576 -
+ (471 * d2 * e12) / 8192 +
+ (9 * d4 * e12) / 4096) *
+ sin2D +
+ ((21 * e4) / 256 +
+ (21 * e6) / 256 +
+ (533 * e8) / 8192 -
+ (21 * d2 * e8) / 512 +
+ (197 * e10) / 4096 -
+ (315 * d2 * e10) / 4096 +
+ (584039 * e12) / 16777216 -
+ (12517 * d2 * e12) / 131072 +
+ (7 * d4 * e12) / 2048) *
+ sin4D +
+ ((151 * e6) / 6144 +
+ (151 * e8) / 4096 +
+ (5019 * e10) / 131072 -
+ (453 * d2 * e10) / 16384 +
+ (26965 * e12) / 786432 -
+ (8607 * d2 * e12) / 131072) *
+ sin6D +
+ ((1097 * e8) / 131072 +
+ (1097 * e10) / 65536 +
+ (225797 * e12) / 10485760 -
+ (1097 * d2 * e12) / 65536) *
+ sin8D +
+ ((8011 * e10) / 2621440 + (8011 * e12) / 1048576) * sin10D +
+ ((293393 * e12) / 251658240) * sin12D
+ );
+ }
+
+ function calculateSigma(ellipticity, latitude) {
+ if (ellipticity === 0.0) {
+ // sphere
+ return Math.log(Math.tan(0.5 * (Math$1.CesiumMath.PI_OVER_TWO + latitude)));
+ }
+
+ const eSinL = ellipticity * Math.sin(latitude);
+ return (
+ Math.log(Math.tan(0.5 * (Math$1.CesiumMath.PI_OVER_TWO + latitude))) -
+ (ellipticity / 2.0) * Math.log((1 + eSinL) / (1 - eSinL))
+ );
+ }
+
+ function calculateHeading(
+ ellipsoidRhumbLine,
+ firstLongitude,
+ firstLatitude,
+ secondLongitude,
+ secondLatitude
+ ) {
+ const sigma1 = calculateSigma(ellipsoidRhumbLine._ellipticity, firstLatitude);
+ const sigma2 = calculateSigma(
+ ellipsoidRhumbLine._ellipticity,
+ secondLatitude
+ );
+ return Math.atan2(
+ Math$1.CesiumMath.negativePiToPi(secondLongitude - firstLongitude),
+ sigma2 - sigma1
+ );
+ }
+
+ function calculateArcLength(
+ ellipsoidRhumbLine,
+ major,
+ minor,
+ firstLongitude,
+ firstLatitude,
+ secondLongitude,
+ secondLatitude
+ ) {
+ const heading = ellipsoidRhumbLine._heading;
+ const deltaLongitude = secondLongitude - firstLongitude;
+
+ let distance = 0.0;
+
+ //Check to see if the rhumb line has constant latitude
+ //This equation will diverge if heading gets close to 90 degrees
+ if (
+ Math$1.CesiumMath.equalsEpsilon(
+ Math.abs(heading),
+ Math$1.CesiumMath.PI_OVER_TWO,
+ Math$1.CesiumMath.EPSILON8
+ )
+ ) {
+ //If heading is close to 90 degrees
+ if (major === minor) {
+ distance =
+ major *
+ Math.cos(firstLatitude) *
+ Math$1.CesiumMath.negativePiToPi(deltaLongitude);
+ } else {
+ const sinPhi = Math.sin(firstLatitude);
+ distance =
+ (major *
+ Math.cos(firstLatitude) *
+ Math$1.CesiumMath.negativePiToPi(deltaLongitude)) /
+ Math.sqrt(1 - ellipsoidRhumbLine._ellipticitySquared * sinPhi * sinPhi);
+ }
+ } else {
+ const M1 = calculateM(
+ ellipsoidRhumbLine._ellipticity,
+ major,
+ firstLatitude
+ );
+ const M2 = calculateM(
+ ellipsoidRhumbLine._ellipticity,
+ major,
+ secondLatitude
+ );
+
+ distance = (M2 - M1) / Math.cos(heading);
+ }
+ return Math.abs(distance);
+ }
+
+ const scratchCart1 = new Matrix3.Cartesian3();
+ const scratchCart2 = new Matrix3.Cartesian3();
+
+ function computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) {
+ const firstCartesian = Matrix3.Cartesian3.normalize(
+ ellipsoid.cartographicToCartesian(start, scratchCart2),
+ scratchCart1
+ );
+ const lastCartesian = Matrix3.Cartesian3.normalize(
+ ellipsoid.cartographicToCartesian(end, scratchCart2),
+ scratchCart2
+ );
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.greaterThanOrEquals(
+ "value",
+ Math.abs(
+ Math.abs(Matrix3.Cartesian3.angleBetween(firstCartesian, lastCartesian)) - Math.PI
+ ),
+ 0.0125
+ );
+ //>>includeEnd('debug');
+
+ const major = ellipsoid.maximumRadius;
+ const minor = ellipsoid.minimumRadius;
+ const majorSquared = major * major;
+ const minorSquared = minor * minor;
+ ellipsoidRhumbLine._ellipticitySquared =
+ (majorSquared - minorSquared) / majorSquared;
+ ellipsoidRhumbLine._ellipticity = Math.sqrt(
+ ellipsoidRhumbLine._ellipticitySquared
+ );
+
+ ellipsoidRhumbLine._start = Matrix3.Cartographic.clone(
+ start,
+ ellipsoidRhumbLine._start
+ );
+ ellipsoidRhumbLine._start.height = 0;
+
+ ellipsoidRhumbLine._end = Matrix3.Cartographic.clone(end, ellipsoidRhumbLine._end);
+ ellipsoidRhumbLine._end.height = 0;
+
+ ellipsoidRhumbLine._heading = calculateHeading(
+ ellipsoidRhumbLine,
+ start.longitude,
+ start.latitude,
+ end.longitude,
+ end.latitude
+ );
+ ellipsoidRhumbLine._distance = calculateArcLength(
+ ellipsoidRhumbLine,
+ ellipsoid.maximumRadius,
+ ellipsoid.minimumRadius,
+ start.longitude,
+ start.latitude,
+ end.longitude,
+ end.latitude
+ );
+ }
+
+ function interpolateUsingSurfaceDistance(
+ start,
+ heading,
+ distance,
+ major,
+ ellipticity,
+ result
+ ) {
+ if (distance === 0.0) {
+ return Matrix3.Cartographic.clone(start, result);
+ }
+
+ const ellipticitySquared = ellipticity * ellipticity;
+
+ let longitude;
+ let latitude;
+ let deltaLongitude;
+
+ //Check to see if the rhumb line has constant latitude
+ //This won't converge if heading is close to 90 degrees
+ if (
+ Math.abs(Math$1.CesiumMath.PI_OVER_TWO - Math.abs(heading)) > Math$1.CesiumMath.EPSILON8
+ ) {
+ //Calculate latitude of the second point
+ const M1 = calculateM(ellipticity, major, start.latitude);
+ const deltaM = distance * Math.cos(heading);
+ const M2 = M1 + deltaM;
+ latitude = calculateInverseM(M2, ellipticity, major);
+
+ //Now find the longitude of the second point
+ const sigma1 = calculateSigma(ellipticity, start.latitude);
+ const sigma2 = calculateSigma(ellipticity, latitude);
+ deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);
+ longitude = Math$1.CesiumMath.negativePiToPi(start.longitude + deltaLongitude);
+ } else {
+ //If heading is close to 90 degrees
+ latitude = start.latitude;
+ let localRad;
+
+ if (ellipticity === 0.0) {
+ // sphere
+ localRad = major * Math.cos(start.latitude);
+ } else {
+ const sinPhi = Math.sin(start.latitude);
+ localRad =
+ (major * Math.cos(start.latitude)) /
+ Math.sqrt(1 - ellipticitySquared * sinPhi * sinPhi);
+ }
+
+ deltaLongitude = distance / localRad;
+ if (heading > 0.0) {
+ longitude = Math$1.CesiumMath.negativePiToPi(start.longitude + deltaLongitude);
+ } else {
+ longitude = Math$1.CesiumMath.negativePiToPi(start.longitude - deltaLongitude);
+ }
+ }
+
+ if (defaultValue.defined(result)) {
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = 0;
+
+ return result;
+ }
+
+ return new Matrix3.Cartographic(longitude, latitude, 0);
+ }
+
+ /**
+ * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.
+ *
+ * @alias EllipsoidRhumbLine
+ * @constructor
+ *
+ * @param {Cartographic} [start] The initial planetodetic point on the path.
+ * @param {Cartographic} [end] The final planetodetic point on the path.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rhumb line lies.
+ *
+ * @exception {DeveloperError} angle between start and end must be at least 0.0125 radians.
+ */
+ function EllipsoidRhumbLine(start, end, ellipsoid) {
+ const e = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+ this._ellipsoid = e;
+ this._start = new Matrix3.Cartographic();
+ this._end = new Matrix3.Cartographic();
+
+ this._heading = undefined;
+ this._distance = undefined;
+ this._ellipticity = undefined;
+ this._ellipticitySquared = undefined;
+
+ if (defaultValue.defined(start) && defaultValue.defined(end)) {
+ computeProperties(this, start, end, e);
+ }
+ }
+
+ Object.defineProperties(EllipsoidRhumbLine.prototype, {
+ /**
+ * Gets the ellipsoid.
+ * @memberof EllipsoidRhumbLine.prototype
+ * @type {Ellipsoid}
+ * @readonly
+ */
+ ellipsoid: {
+ get: function () {
+ return this._ellipsoid;
+ },
+ },
+
+ /**
+ * Gets the surface distance between the start and end point
+ * @memberof EllipsoidRhumbLine.prototype
+ * @type {Number}
+ * @readonly
+ */
+ surfaceDistance: {
+ get: function () {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("distance", this._distance);
+ //>>includeEnd('debug');
+
+ return this._distance;
+ },
+ },
+
+ /**
+ * Gets the initial planetodetic point on the path.
+ * @memberof EllipsoidRhumbLine.prototype
+ * @type {Cartographic}
+ * @readonly
+ */
+ start: {
+ get: function () {
+ return this._start;
+ },
+ },
+
+ /**
+ * Gets the final planetodetic point on the path.
+ * @memberof EllipsoidRhumbLine.prototype
+ * @type {Cartographic}
+ * @readonly
+ */
+ end: {
+ get: function () {
+ return this._end;
+ },
+ },
+
+ /**
+ * Gets the heading from the start point to the end point.
+ * @memberof EllipsoidRhumbLine.prototype
+ * @type {Number}
+ * @readonly
+ */
+ heading: {
+ get: function () {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("distance", this._distance);
+ //>>includeEnd('debug');
+
+ return this._heading;
+ },
+ },
+ });
+
+ /**
+ * Create a rhumb line using an initial position with a heading and distance.
+ *
+ * @param {Cartographic} start The initial planetodetic point on the path.
+ * @param {Number} heading The heading in radians.
+ * @param {Number} distance The rhumb line distance between the start and end point.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rhumb line lies.
+ * @param {EllipsoidRhumbLine} [result] The object in which to store the result.
+ * @returns {EllipsoidRhumbLine} The EllipsoidRhumbLine object.
+ */
+ EllipsoidRhumbLine.fromStartHeadingDistance = function (
+ start,
+ heading,
+ distance,
+ ellipsoid,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("start", start);
+ Check.Check.defined("heading", heading);
+ Check.Check.defined("distance", distance);
+ Check.Check.typeOf.number.greaterThan("distance", distance, 0.0);
+ //>>includeEnd('debug');
+
+ const e = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+ const major = e.maximumRadius;
+ const minor = e.minimumRadius;
+ const majorSquared = major * major;
+ const minorSquared = minor * minor;
+ const ellipticity = Math.sqrt((majorSquared - minorSquared) / majorSquared);
+
+ heading = Math$1.CesiumMath.negativePiToPi(heading);
+ const end = interpolateUsingSurfaceDistance(
+ start,
+ heading,
+ distance,
+ e.maximumRadius,
+ ellipticity
+ );
+
+ if (
+ !defaultValue.defined(result) ||
+ (defaultValue.defined(ellipsoid) && !ellipsoid.equals(result.ellipsoid))
+ ) {
+ return new EllipsoidRhumbLine(start, end, e);
+ }
+
+ result.setEndPoints(start, end);
+ return result;
+ };
+
+ /**
+ * Sets the start and end points of the rhumb line.
+ *
+ * @param {Cartographic} start The initial planetodetic point on the path.
+ * @param {Cartographic} end The final planetodetic point on the path.
+ */
+ EllipsoidRhumbLine.prototype.setEndPoints = function (start, end) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("start", start);
+ Check.Check.defined("end", end);
+ //>>includeEnd('debug');
+
+ computeProperties(this, start, end, this._ellipsoid);
+ };
+
+ /**
+ * Provides the location of a point at the indicated portion along the rhumb line.
+ *
+ * @param {Number} fraction The portion of the distance between the initial and final points.
+ * @param {Cartographic} [result] The object in which to store the result.
+ * @returns {Cartographic} The location of the point along the rhumb line.
+ */
+ EllipsoidRhumbLine.prototype.interpolateUsingFraction = function (
+ fraction,
+ result
+ ) {
+ return this.interpolateUsingSurfaceDistance(
+ fraction * this._distance,
+ result
+ );
+ };
+
+ /**
+ * Provides the location of a point at the indicated distance along the rhumb line.
+ *
+ * @param {Number} distance The distance from the inital point to the point of interest along the rhumbLine.
+ * @param {Cartographic} [result] The object in which to store the result.
+ * @returns {Cartographic} The location of the point along the rhumb line.
+ *
+ * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance
+ */
+ EllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function (
+ distance,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("distance", distance);
+ if (!defaultValue.defined(this._distance) || this._distance === 0.0) {
+ throw new Check.DeveloperError(
+ "EllipsoidRhumbLine must have distinct start and end set."
+ );
+ }
+ //>>includeEnd('debug');
+
+ return interpolateUsingSurfaceDistance(
+ this._start,
+ this._heading,
+ distance,
+ this._ellipsoid.maximumRadius,
+ this._ellipticity,
+ result
+ );
+ };
+
+ /**
+ * Provides the location of a point at the indicated longitude along the rhumb line.
+ * If the longitude is outside the range of start and end points, the first intersection with the longitude from the start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.
+ *
+ * @param {Number} intersectionLongitude The longitude, in radians, at which to find the intersection point from the starting point using the heading.
+ * @param {Cartographic} [result] The object in which to store the result.
+ * @returns {Cartographic} The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
+ *
+ * @exception {DeveloperError} start and end must be set before calling function findIntersectionWithLongitude.
+ */
+ EllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function (
+ intersectionLongitude,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("intersectionLongitude", intersectionLongitude);
+ if (!defaultValue.defined(this._distance) || this._distance === 0.0) {
+ throw new Check.DeveloperError(
+ "EllipsoidRhumbLine must have distinct start and end set."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const ellipticity = this._ellipticity;
+ const heading = this._heading;
+ const absHeading = Math.abs(heading);
+ const start = this._start;
+
+ intersectionLongitude = Math$1.CesiumMath.negativePiToPi(intersectionLongitude);
+
+ if (
+ Math$1.CesiumMath.equalsEpsilon(
+ Math.abs(intersectionLongitude),
+ Math.PI,
+ Math$1.CesiumMath.EPSILON14
+ )
+ ) {
+ intersectionLongitude = Math$1.CesiumMath.sign(start.longitude) * Math.PI;
+ }
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartographic();
+ }
+
+ // If heading is -PI/2 or PI/2, this is an E-W rhumb line
+ // If heading is 0 or PI, this is an N-S rhumb line
+ if (Math.abs(Math$1.CesiumMath.PI_OVER_TWO - absHeading) <= Math$1.CesiumMath.EPSILON8) {
+ result.longitude = intersectionLongitude;
+ result.latitude = start.latitude;
+ result.height = 0;
+ return result;
+ } else if (
+ Math$1.CesiumMath.equalsEpsilon(
+ Math.abs(Math$1.CesiumMath.PI_OVER_TWO - absHeading),
+ Math$1.CesiumMath.PI_OVER_TWO,
+ Math$1.CesiumMath.EPSILON8
+ )
+ ) {
+ if (
+ Math$1.CesiumMath.equalsEpsilon(
+ intersectionLongitude,
+ start.longitude,
+ Math$1.CesiumMath.EPSILON12
+ )
+ ) {
+ return undefined;
+ }
+
+ result.longitude = intersectionLongitude;
+ result.latitude =
+ Math$1.CesiumMath.PI_OVER_TWO *
+ Math$1.CesiumMath.sign(Math$1.CesiumMath.PI_OVER_TWO - heading);
+ result.height = 0;
+ return result;
+ }
+
+ // Use iterative solver from Equation 9 from http://edwilliams.org/ellipsoid/ellipsoid.pdf
+ const phi1 = start.latitude;
+ const eSinPhi1 = ellipticity * Math.sin(phi1);
+ const leftComponent =
+ Math.tan(0.5 * (Math$1.CesiumMath.PI_OVER_TWO + phi1)) *
+ Math.exp((intersectionLongitude - start.longitude) / Math.tan(heading));
+ const denominator = (1 + eSinPhi1) / (1 - eSinPhi1);
+
+ let newPhi = start.latitude;
+ let phi;
+ do {
+ phi = newPhi;
+ const eSinPhi = ellipticity * Math.sin(phi);
+ const numerator = (1 + eSinPhi) / (1 - eSinPhi);
+ newPhi =
+ 2 *
+ Math.atan(
+ leftComponent * Math.pow(numerator / denominator, ellipticity / 2)
+ ) -
+ Math$1.CesiumMath.PI_OVER_TWO;
+ } while (!Math$1.CesiumMath.equalsEpsilon(newPhi, phi, Math$1.CesiumMath.EPSILON12));
+
+ result.longitude = intersectionLongitude;
+ result.latitude = newPhi;
+ result.height = 0;
+ return result;
+ };
+
+ /**
+ * Provides the location of a point at the indicated latitude along the rhumb line.
+ * If the latitude is outside the range of start and end points, the first intersection with the latitude from that start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.
+ *
+ * @param {Number} intersectionLatitude The latitude, in radians, at which to find the intersection point from the starting point using the heading.
+ * @param {Cartographic} [result] The object in which to store the result.
+ * @returns {Cartographic} The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.
+ *
+ * @exception {DeveloperError} start and end must be set before calling function findIntersectionWithLongitude.
+ */
+ EllipsoidRhumbLine.prototype.findIntersectionWithLatitude = function (
+ intersectionLatitude,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("intersectionLatitude", intersectionLatitude);
+ if (!defaultValue.defined(this._distance) || this._distance === 0.0) {
+ throw new Check.DeveloperError(
+ "EllipsoidRhumbLine must have distinct start and end set."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const ellipticity = this._ellipticity;
+ const heading = this._heading;
+ const start = this._start;
+
+ // If start and end have same latitude, return undefined since it's either no intersection or infinite intersections
+ if (
+ Math$1.CesiumMath.equalsEpsilon(
+ Math.abs(heading),
+ Math$1.CesiumMath.PI_OVER_TWO,
+ Math$1.CesiumMath.EPSILON8
+ )
+ ) {
+ return;
+ }
+
+ // Can be solved using the same equations from interpolateUsingSurfaceDistance
+ const sigma1 = calculateSigma(ellipticity, start.latitude);
+ const sigma2 = calculateSigma(ellipticity, intersectionLatitude);
+ const deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);
+ const longitude = Math$1.CesiumMath.negativePiToPi(start.longitude + deltaLongitude);
+
+ if (defaultValue.defined(result)) {
+ result.longitude = longitude;
+ result.latitude = intersectionLatitude;
+ result.height = 0;
+
+ return result;
+ }
+
+ return new Matrix3.Cartographic(longitude, intersectionLatitude, 0);
+ };
+
+ exports.EllipsoidRhumbLine = EllipsoidRhumbLine;
+
+}));
+//# sourceMappingURL=EllipsoidRhumbLine-48b4507b.js.map
diff --git a/examples/cesium/Workers/EllipsoidRhumbLine-48b4507b.js.map b/examples/cesium/Workers/EllipsoidRhumbLine-48b4507b.js.map
new file mode 100644
index 0000000..eba02ac
--- /dev/null
+++ b/examples/cesium/Workers/EllipsoidRhumbLine-48b4507b.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"EllipsoidRhumbLine-48b4507b.js","sources":["../../../Source/Core/EllipsoidRhumbLine.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\nfunction calculateM(ellipticity, major, latitude) {\r\n if (ellipticity === 0.0) {\r\n // sphere\r\n return major * latitude;\r\n }\r\n\r\n const e2 = ellipticity * ellipticity;\r\n const e4 = e2 * e2;\r\n const e6 = e4 * e2;\r\n const e8 = e6 * e2;\r\n const e10 = e8 * e2;\r\n const e12 = e10 * e2;\r\n const phi = latitude;\r\n const sin2Phi = Math.sin(2 * phi);\r\n const sin4Phi = Math.sin(4 * phi);\r\n const sin6Phi = Math.sin(6 * phi);\r\n const sin8Phi = Math.sin(8 * phi);\r\n const sin10Phi = Math.sin(10 * phi);\r\n const sin12Phi = Math.sin(12 * phi);\r\n\r\n return (\r\n major *\r\n ((1 -\r\n e2 / 4 -\r\n (3 * e4) / 64 -\r\n (5 * e6) / 256 -\r\n (175 * e8) / 16384 -\r\n (441 * e10) / 65536 -\r\n (4851 * e12) / 1048576) *\r\n phi -\r\n ((3 * e2) / 8 +\r\n (3 * e4) / 32 +\r\n (45 * e6) / 1024 +\r\n (105 * e8) / 4096 +\r\n (2205 * e10) / 131072 +\r\n (6237 * e12) / 524288) *\r\n sin2Phi +\r\n ((15 * e4) / 256 +\r\n (45 * e6) / 1024 +\r\n (525 * e8) / 16384 +\r\n (1575 * e10) / 65536 +\r\n (155925 * e12) / 8388608) *\r\n sin4Phi -\r\n ((35 * e6) / 3072 +\r\n (175 * e8) / 12288 +\r\n (3675 * e10) / 262144 +\r\n (13475 * e12) / 1048576) *\r\n sin6Phi +\r\n ((315 * e8) / 131072 + (2205 * e10) / 524288 + (43659 * e12) / 8388608) *\r\n sin8Phi -\r\n ((693 * e10) / 1310720 + (6237 * e12) / 5242880) * sin10Phi +\r\n ((1001 * e12) / 8388608) * sin12Phi)\r\n );\r\n}\r\n\r\nfunction calculateInverseM(M, ellipticity, major) {\r\n const d = M / major;\r\n\r\n if (ellipticity === 0.0) {\r\n // sphere\r\n return d;\r\n }\r\n\r\n const d2 = d * d;\r\n const d3 = d2 * d;\r\n const d4 = d3 * d;\r\n const e = ellipticity;\r\n const e2 = e * e;\r\n const e4 = e2 * e2;\r\n const e6 = e4 * e2;\r\n const e8 = e6 * e2;\r\n const e10 = e8 * e2;\r\n const e12 = e10 * e2;\r\n const sin2D = Math.sin(2 * d);\r\n const cos2D = Math.cos(2 * d);\r\n const sin4D = Math.sin(4 * d);\r\n const cos4D = Math.cos(4 * d);\r\n const sin6D = Math.sin(6 * d);\r\n const cos6D = Math.cos(6 * d);\r\n const sin8D = Math.sin(8 * d);\r\n const cos8D = Math.cos(8 * d);\r\n const sin10D = Math.sin(10 * d);\r\n const cos10D = Math.cos(10 * d);\r\n const sin12D = Math.sin(12 * d);\r\n\r\n return (\r\n d +\r\n (d * e2) / 4 +\r\n (7 * d * e4) / 64 +\r\n (15 * d * e6) / 256 +\r\n (579 * d * e8) / 16384 +\r\n (1515 * d * e10) / 65536 +\r\n (16837 * d * e12) / 1048576 +\r\n ((3 * d * e4) / 16 +\r\n (45 * d * e6) / 256 -\r\n (d * (32 * d2 - 561) * e8) / 4096 -\r\n (d * (232 * d2 - 1677) * e10) / 16384 +\r\n (d * (399985 - 90560 * d2 + 512 * d4) * e12) / 5242880) *\r\n cos2D +\r\n ((21 * d * e6) / 256 +\r\n (483 * d * e8) / 4096 -\r\n (d * (224 * d2 - 1969) * e10) / 16384 -\r\n (d * (33152 * d2 - 112599) * e12) / 1048576) *\r\n cos4D +\r\n ((151 * d * e8) / 4096 +\r\n (4681 * d * e10) / 65536 +\r\n (1479 * d * e12) / 16384 -\r\n (453 * d3 * e12) / 32768) *\r\n cos6D +\r\n ((1097 * d * e10) / 65536 + (42783 * d * e12) / 1048576) * cos8D +\r\n ((8011 * d * e12) / 1048576) * cos10D +\r\n ((3 * e2) / 8 +\r\n (3 * e4) / 16 +\r\n (213 * e6) / 2048 -\r\n (3 * d2 * e6) / 64 +\r\n (255 * e8) / 4096 -\r\n (33 * d2 * e8) / 512 +\r\n (20861 * e10) / 524288 -\r\n (33 * d2 * e10) / 512 +\r\n (d4 * e10) / 1024 +\r\n (28273 * e12) / 1048576 -\r\n (471 * d2 * e12) / 8192 +\r\n (9 * d4 * e12) / 4096) *\r\n sin2D +\r\n ((21 * e4) / 256 +\r\n (21 * e6) / 256 +\r\n (533 * e8) / 8192 -\r\n (21 * d2 * e8) / 512 +\r\n (197 * e10) / 4096 -\r\n (315 * d2 * e10) / 4096 +\r\n (584039 * e12) / 16777216 -\r\n (12517 * d2 * e12) / 131072 +\r\n (7 * d4 * e12) / 2048) *\r\n sin4D +\r\n ((151 * e6) / 6144 +\r\n (151 * e8) / 4096 +\r\n (5019 * e10) / 131072 -\r\n (453 * d2 * e10) / 16384 +\r\n (26965 * e12) / 786432 -\r\n (8607 * d2 * e12) / 131072) *\r\n sin6D +\r\n ((1097 * e8) / 131072 +\r\n (1097 * e10) / 65536 +\r\n (225797 * e12) / 10485760 -\r\n (1097 * d2 * e12) / 65536) *\r\n sin8D +\r\n ((8011 * e10) / 2621440 + (8011 * e12) / 1048576) * sin10D +\r\n ((293393 * e12) / 251658240) * sin12D\r\n );\r\n}\r\n\r\nfunction calculateSigma(ellipticity, latitude) {\r\n if (ellipticity === 0.0) {\r\n // sphere\r\n return Math.log(Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + latitude)));\r\n }\r\n\r\n const eSinL = ellipticity * Math.sin(latitude);\r\n return (\r\n Math.log(Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + latitude))) -\r\n (ellipticity / 2.0) * Math.log((1 + eSinL) / (1 - eSinL))\r\n );\r\n}\r\n\r\nfunction calculateHeading(\r\n ellipsoidRhumbLine,\r\n firstLongitude,\r\n firstLatitude,\r\n secondLongitude,\r\n secondLatitude\r\n) {\r\n const sigma1 = calculateSigma(ellipsoidRhumbLine._ellipticity, firstLatitude);\r\n const sigma2 = calculateSigma(\r\n ellipsoidRhumbLine._ellipticity,\r\n secondLatitude\r\n );\r\n return Math.atan2(\r\n CesiumMath.negativePiToPi(secondLongitude - firstLongitude),\r\n sigma2 - sigma1\r\n );\r\n}\r\n\r\nfunction calculateArcLength(\r\n ellipsoidRhumbLine,\r\n major,\r\n minor,\r\n firstLongitude,\r\n firstLatitude,\r\n secondLongitude,\r\n secondLatitude\r\n) {\r\n const heading = ellipsoidRhumbLine._heading;\r\n const deltaLongitude = secondLongitude - firstLongitude;\r\n\r\n let distance = 0.0;\r\n\r\n //Check to see if the rhumb line has constant latitude\r\n //This equation will diverge if heading gets close to 90 degrees\r\n if (\r\n CesiumMath.equalsEpsilon(\r\n Math.abs(heading),\r\n CesiumMath.PI_OVER_TWO,\r\n CesiumMath.EPSILON8\r\n )\r\n ) {\r\n //If heading is close to 90 degrees\r\n if (major === minor) {\r\n distance =\r\n major *\r\n Math.cos(firstLatitude) *\r\n CesiumMath.negativePiToPi(deltaLongitude);\r\n } else {\r\n const sinPhi = Math.sin(firstLatitude);\r\n distance =\r\n (major *\r\n Math.cos(firstLatitude) *\r\n CesiumMath.negativePiToPi(deltaLongitude)) /\r\n Math.sqrt(1 - ellipsoidRhumbLine._ellipticitySquared * sinPhi * sinPhi);\r\n }\r\n } else {\r\n const M1 = calculateM(\r\n ellipsoidRhumbLine._ellipticity,\r\n major,\r\n firstLatitude\r\n );\r\n const M2 = calculateM(\r\n ellipsoidRhumbLine._ellipticity,\r\n major,\r\n secondLatitude\r\n );\r\n\r\n distance = (M2 - M1) / Math.cos(heading);\r\n }\r\n return Math.abs(distance);\r\n}\r\n\r\nconst scratchCart1 = new Cartesian3();\r\nconst scratchCart2 = new Cartesian3();\r\n\r\nfunction computeProperties(ellipsoidRhumbLine, start, end, ellipsoid) {\r\n const firstCartesian = Cartesian3.normalize(\r\n ellipsoid.cartographicToCartesian(start, scratchCart2),\r\n scratchCart1\r\n );\r\n const lastCartesian = Cartesian3.normalize(\r\n ellipsoid.cartographicToCartesian(end, scratchCart2),\r\n scratchCart2\r\n );\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.greaterThanOrEquals(\r\n \"value\",\r\n Math.abs(\r\n Math.abs(Cartesian3.angleBetween(firstCartesian, lastCartesian)) - Math.PI\r\n ),\r\n 0.0125\r\n );\r\n //>>includeEnd('debug');\r\n\r\n const major = ellipsoid.maximumRadius;\r\n const minor = ellipsoid.minimumRadius;\r\n const majorSquared = major * major;\r\n const minorSquared = minor * minor;\r\n ellipsoidRhumbLine._ellipticitySquared =\r\n (majorSquared - minorSquared) / majorSquared;\r\n ellipsoidRhumbLine._ellipticity = Math.sqrt(\r\n ellipsoidRhumbLine._ellipticitySquared\r\n );\r\n\r\n ellipsoidRhumbLine._start = Cartographic.clone(\r\n start,\r\n ellipsoidRhumbLine._start\r\n );\r\n ellipsoidRhumbLine._start.height = 0;\r\n\r\n ellipsoidRhumbLine._end = Cartographic.clone(end, ellipsoidRhumbLine._end);\r\n ellipsoidRhumbLine._end.height = 0;\r\n\r\n ellipsoidRhumbLine._heading = calculateHeading(\r\n ellipsoidRhumbLine,\r\n start.longitude,\r\n start.latitude,\r\n end.longitude,\r\n end.latitude\r\n );\r\n ellipsoidRhumbLine._distance = calculateArcLength(\r\n ellipsoidRhumbLine,\r\n ellipsoid.maximumRadius,\r\n ellipsoid.minimumRadius,\r\n start.longitude,\r\n start.latitude,\r\n end.longitude,\r\n end.latitude\r\n );\r\n}\r\n\r\nfunction interpolateUsingSurfaceDistance(\r\n start,\r\n heading,\r\n distance,\r\n major,\r\n ellipticity,\r\n result\r\n) {\r\n if (distance === 0.0) {\r\n return Cartographic.clone(start, result);\r\n }\r\n\r\n const ellipticitySquared = ellipticity * ellipticity;\r\n\r\n let longitude;\r\n let latitude;\r\n let deltaLongitude;\r\n\r\n //Check to see if the rhumb line has constant latitude\r\n //This won't converge if heading is close to 90 degrees\r\n if (\r\n Math.abs(CesiumMath.PI_OVER_TWO - Math.abs(heading)) > CesiumMath.EPSILON8\r\n ) {\r\n //Calculate latitude of the second point\r\n const M1 = calculateM(ellipticity, major, start.latitude);\r\n const deltaM = distance * Math.cos(heading);\r\n const M2 = M1 + deltaM;\r\n latitude = calculateInverseM(M2, ellipticity, major);\r\n\r\n //Now find the longitude of the second point\r\n const sigma1 = calculateSigma(ellipticity, start.latitude);\r\n const sigma2 = calculateSigma(ellipticity, latitude);\r\n deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);\r\n longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);\r\n } else {\r\n //If heading is close to 90 degrees\r\n latitude = start.latitude;\r\n let localRad;\r\n\r\n if (ellipticity === 0.0) {\r\n // sphere\r\n localRad = major * Math.cos(start.latitude);\r\n } else {\r\n const sinPhi = Math.sin(start.latitude);\r\n localRad =\r\n (major * Math.cos(start.latitude)) /\r\n Math.sqrt(1 - ellipticitySquared * sinPhi * sinPhi);\r\n }\r\n\r\n deltaLongitude = distance / localRad;\r\n if (heading > 0.0) {\r\n longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);\r\n } else {\r\n longitude = CesiumMath.negativePiToPi(start.longitude - deltaLongitude);\r\n }\r\n }\r\n\r\n if (defined(result)) {\r\n result.longitude = longitude;\r\n result.latitude = latitude;\r\n result.height = 0;\r\n\r\n return result;\r\n }\r\n\r\n return new Cartographic(longitude, latitude, 0);\r\n}\r\n\r\n/**\r\n * Initializes a rhumb line on the ellipsoid connecting the two provided planetodetic points.\r\n *\r\n * @alias EllipsoidRhumbLine\r\n * @constructor\r\n *\r\n * @param {Cartographic} [start] The initial planetodetic point on the path.\r\n * @param {Cartographic} [end] The final planetodetic point on the path.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rhumb line lies.\r\n *\r\n * @exception {DeveloperError} angle between start and end must be at least 0.0125 radians.\r\n */\r\nfunction EllipsoidRhumbLine(start, end, ellipsoid) {\r\n const e = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n this._ellipsoid = e;\r\n this._start = new Cartographic();\r\n this._end = new Cartographic();\r\n\r\n this._heading = undefined;\r\n this._distance = undefined;\r\n this._ellipticity = undefined;\r\n this._ellipticitySquared = undefined;\r\n\r\n if (defined(start) && defined(end)) {\r\n computeProperties(this, start, end, e);\r\n }\r\n}\r\n\r\nObject.defineProperties(EllipsoidRhumbLine.prototype, {\r\n /**\r\n * Gets the ellipsoid.\r\n * @memberof EllipsoidRhumbLine.prototype\r\n * @type {Ellipsoid}\r\n * @readonly\r\n */\r\n ellipsoid: {\r\n get: function () {\r\n return this._ellipsoid;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the surface distance between the start and end point\r\n * @memberof EllipsoidRhumbLine.prototype\r\n * @type {Number}\r\n * @readonly\r\n */\r\n surfaceDistance: {\r\n get: function () {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"distance\", this._distance);\r\n //>>includeEnd('debug');\r\n\r\n return this._distance;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the initial planetodetic point on the path.\r\n * @memberof EllipsoidRhumbLine.prototype\r\n * @type {Cartographic}\r\n * @readonly\r\n */\r\n start: {\r\n get: function () {\r\n return this._start;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the final planetodetic point on the path.\r\n * @memberof EllipsoidRhumbLine.prototype\r\n * @type {Cartographic}\r\n * @readonly\r\n */\r\n end: {\r\n get: function () {\r\n return this._end;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the heading from the start point to the end point.\r\n * @memberof EllipsoidRhumbLine.prototype\r\n * @type {Number}\r\n * @readonly\r\n */\r\n heading: {\r\n get: function () {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"distance\", this._distance);\r\n //>>includeEnd('debug');\r\n\r\n return this._heading;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Create a rhumb line using an initial position with a heading and distance.\r\n *\r\n * @param {Cartographic} start The initial planetodetic point on the path.\r\n * @param {Number} heading The heading in radians.\r\n * @param {Number} distance The rhumb line distance between the start and end point.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rhumb line lies.\r\n * @param {EllipsoidRhumbLine} [result] The object in which to store the result.\r\n * @returns {EllipsoidRhumbLine} The EllipsoidRhumbLine object.\r\n */\r\nEllipsoidRhumbLine.fromStartHeadingDistance = function (\r\n start,\r\n heading,\r\n distance,\r\n ellipsoid,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"start\", start);\r\n Check.defined(\"heading\", heading);\r\n Check.defined(\"distance\", distance);\r\n Check.typeOf.number.greaterThan(\"distance\", distance, 0.0);\r\n //>>includeEnd('debug');\r\n\r\n const e = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n const major = e.maximumRadius;\r\n const minor = e.minimumRadius;\r\n const majorSquared = major * major;\r\n const minorSquared = minor * minor;\r\n const ellipticity = Math.sqrt((majorSquared - minorSquared) / majorSquared);\r\n\r\n heading = CesiumMath.negativePiToPi(heading);\r\n const end = interpolateUsingSurfaceDistance(\r\n start,\r\n heading,\r\n distance,\r\n e.maximumRadius,\r\n ellipticity\r\n );\r\n\r\n if (\r\n !defined(result) ||\r\n (defined(ellipsoid) && !ellipsoid.equals(result.ellipsoid))\r\n ) {\r\n return new EllipsoidRhumbLine(start, end, e);\r\n }\r\n\r\n result.setEndPoints(start, end);\r\n return result;\r\n};\r\n\r\n/**\r\n * Sets the start and end points of the rhumb line.\r\n *\r\n * @param {Cartographic} start The initial planetodetic point on the path.\r\n * @param {Cartographic} end The final planetodetic point on the path.\r\n */\r\nEllipsoidRhumbLine.prototype.setEndPoints = function (start, end) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"start\", start);\r\n Check.defined(\"end\", end);\r\n //>>includeEnd('debug');\r\n\r\n computeProperties(this, start, end, this._ellipsoid);\r\n};\r\n\r\n/**\r\n * Provides the location of a point at the indicated portion along the rhumb line.\r\n *\r\n * @param {Number} fraction The portion of the distance between the initial and final points.\r\n * @param {Cartographic} [result] The object in which to store the result.\r\n * @returns {Cartographic} The location of the point along the rhumb line.\r\n */\r\nEllipsoidRhumbLine.prototype.interpolateUsingFraction = function (\r\n fraction,\r\n result\r\n) {\r\n return this.interpolateUsingSurfaceDistance(\r\n fraction * this._distance,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Provides the location of a point at the indicated distance along the rhumb line.\r\n *\r\n * @param {Number} distance The distance from the inital point to the point of interest along the rhumbLine.\r\n * @param {Cartographic} [result] The object in which to store the result.\r\n * @returns {Cartographic} The location of the point along the rhumb line.\r\n *\r\n * @exception {DeveloperError} start and end must be set before calling function interpolateUsingSurfaceDistance\r\n */\r\nEllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function (\r\n distance,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"distance\", distance);\r\n if (!defined(this._distance) || this._distance === 0.0) {\r\n throw new DeveloperError(\r\n \"EllipsoidRhumbLine must have distinct start and end set.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n return interpolateUsingSurfaceDistance(\r\n this._start,\r\n this._heading,\r\n distance,\r\n this._ellipsoid.maximumRadius,\r\n this._ellipticity,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Provides the location of a point at the indicated longitude along the rhumb line.\r\n * If the longitude is outside the range of start and end points, the first intersection with the longitude from the start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.\r\n *\r\n * @param {Number} intersectionLongitude The longitude, in radians, at which to find the intersection point from the starting point using the heading.\r\n * @param {Cartographic} [result] The object in which to store the result.\r\n * @returns {Cartographic} The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.\r\n *\r\n * @exception {DeveloperError} start and end must be set before calling function findIntersectionWithLongitude.\r\n */\r\nEllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function (\r\n intersectionLongitude,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"intersectionLongitude\", intersectionLongitude);\r\n if (!defined(this._distance) || this._distance === 0.0) {\r\n throw new DeveloperError(\r\n \"EllipsoidRhumbLine must have distinct start and end set.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const ellipticity = this._ellipticity;\r\n const heading = this._heading;\r\n const absHeading = Math.abs(heading);\r\n const start = this._start;\r\n\r\n intersectionLongitude = CesiumMath.negativePiToPi(intersectionLongitude);\r\n\r\n if (\r\n CesiumMath.equalsEpsilon(\r\n Math.abs(intersectionLongitude),\r\n Math.PI,\r\n CesiumMath.EPSILON14\r\n )\r\n ) {\r\n intersectionLongitude = CesiumMath.sign(start.longitude) * Math.PI;\r\n }\r\n\r\n if (!defined(result)) {\r\n result = new Cartographic();\r\n }\r\n\r\n // If heading is -PI/2 or PI/2, this is an E-W rhumb line\r\n // If heading is 0 or PI, this is an N-S rhumb line\r\n if (Math.abs(CesiumMath.PI_OVER_TWO - absHeading) <= CesiumMath.EPSILON8) {\r\n result.longitude = intersectionLongitude;\r\n result.latitude = start.latitude;\r\n result.height = 0;\r\n return result;\r\n } else if (\r\n CesiumMath.equalsEpsilon(\r\n Math.abs(CesiumMath.PI_OVER_TWO - absHeading),\r\n CesiumMath.PI_OVER_TWO,\r\n CesiumMath.EPSILON8\r\n )\r\n ) {\r\n if (\r\n CesiumMath.equalsEpsilon(\r\n intersectionLongitude,\r\n start.longitude,\r\n CesiumMath.EPSILON12\r\n )\r\n ) {\r\n return undefined;\r\n }\r\n\r\n result.longitude = intersectionLongitude;\r\n result.latitude =\r\n CesiumMath.PI_OVER_TWO *\r\n CesiumMath.sign(CesiumMath.PI_OVER_TWO - heading);\r\n result.height = 0;\r\n return result;\r\n }\r\n\r\n // Use iterative solver from Equation 9 from http://edwilliams.org/ellipsoid/ellipsoid.pdf\r\n const phi1 = start.latitude;\r\n const eSinPhi1 = ellipticity * Math.sin(phi1);\r\n const leftComponent =\r\n Math.tan(0.5 * (CesiumMath.PI_OVER_TWO + phi1)) *\r\n Math.exp((intersectionLongitude - start.longitude) / Math.tan(heading));\r\n const denominator = (1 + eSinPhi1) / (1 - eSinPhi1);\r\n\r\n let newPhi = start.latitude;\r\n let phi;\r\n do {\r\n phi = newPhi;\r\n const eSinPhi = ellipticity * Math.sin(phi);\r\n const numerator = (1 + eSinPhi) / (1 - eSinPhi);\r\n newPhi =\r\n 2 *\r\n Math.atan(\r\n leftComponent * Math.pow(numerator / denominator, ellipticity / 2)\r\n ) -\r\n CesiumMath.PI_OVER_TWO;\r\n } while (!CesiumMath.equalsEpsilon(newPhi, phi, CesiumMath.EPSILON12));\r\n\r\n result.longitude = intersectionLongitude;\r\n result.latitude = newPhi;\r\n result.height = 0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Provides the location of a point at the indicated latitude along the rhumb line.\r\n * If the latitude is outside the range of start and end points, the first intersection with the latitude from that start point in the direction of the heading is returned. This follows the spiral property of a rhumb line.\r\n *\r\n * @param {Number} intersectionLatitude The latitude, in radians, at which to find the intersection point from the starting point using the heading.\r\n * @param {Cartographic} [result] The object in which to store the result.\r\n * @returns {Cartographic} The location of the intersection point along the rhumb line, undefined if there is no intersection or infinite intersections.\r\n *\r\n * @exception {DeveloperError} start and end must be set before calling function findIntersectionWithLongitude.\r\n */\r\nEllipsoidRhumbLine.prototype.findIntersectionWithLatitude = function (\r\n intersectionLatitude,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"intersectionLatitude\", intersectionLatitude);\r\n if (!defined(this._distance) || this._distance === 0.0) {\r\n throw new DeveloperError(\r\n \"EllipsoidRhumbLine must have distinct start and end set.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const ellipticity = this._ellipticity;\r\n const heading = this._heading;\r\n const start = this._start;\r\n\r\n // If start and end have same latitude, return undefined since it's either no intersection or infinite intersections\r\n if (\r\n CesiumMath.equalsEpsilon(\r\n Math.abs(heading),\r\n CesiumMath.PI_OVER_TWO,\r\n CesiumMath.EPSILON8\r\n )\r\n ) {\r\n return;\r\n }\r\n\r\n // Can be solved using the same equations from interpolateUsingSurfaceDistance\r\n const sigma1 = calculateSigma(ellipticity, start.latitude);\r\n const sigma2 = calculateSigma(ellipticity, intersectionLatitude);\r\n const deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);\r\n const longitude = CesiumMath.negativePiToPi(start.longitude + deltaLongitude);\r\n\r\n if (defined(result)) {\r\n result.longitude = longitude;\r\n result.latitude = intersectionLatitude;\r\n result.height = 0;\r\n\r\n return result;\r\n }\r\n\r\n return new Cartographic(longitude, intersectionLatitude, 0);\r\n};\r\nexport default EllipsoidRhumbLine;\r\n"],"names":["CesiumMath","Cartesian3","Check","Cartographic","defined","defaultValue","Ellipsoid","DeveloperError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,SAAS,UAAU,CAAC,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE;EAClD,EAAE,IAAI,WAAW,KAAK,GAAG,EAAE;EAC3B;EACA,IAAI,OAAO,KAAK,GAAG,QAAQ,CAAC;EAC5B,GAAG;AACH;EACA,EAAE,MAAM,EAAE,GAAG,WAAW,GAAG,WAAW,CAAC;EACvC,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;EACrB,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;EACrB,EAAE,MAAM,EA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CAAC;AAC5B;EACA;EACA,EAAE;EACF,IAAIP,iBAAU,CAAC,aAAa;EAC5B,MAAM,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;EACvB,MAAMA,iBAAU,CAAC,WAAW;EAC5B,MAAMA,iBAAU,CAAC,QAAQ;EACzB,KAAK;EACL,IAAI;EACJ,IAAI,OAAO;EACX,GAAG;AACH;EACA;EACA,EAAE,MAAM,MAAM,GAAG,cAAc,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;EAC7D,EAAE,MAAM,MAAM,GAAG,cAAc,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;EACnE,EAAE,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,GAAG,MAAM,CAAC,CAAC;EAC/D,EAAE,MAAM,SAAS,GAAGA,iBAAU,CAAC,cAAc,CAAC,KAAK,CAAC,SAAS,GAAG,cAAc,CAAC,CAAC;AAChF;EACA,EAAE,IAAII,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;EACjC,IAAI,MAAM,CAAC,QAAQ,GAAG,oBAAoB,CAAC;EAC3C,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AACtB;EACA,IAAI,OAAO,MAAM,CAAC;EAClB,GAAG;AACH;EACA,EAAE,OAAO,IAAID,oBAAY,CAAC,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC,CAAC;EAC9D,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/EllipsoidTangentPlane-c421b2cb.js b/examples/cesium/Workers/EllipsoidTangentPlane-c421b2cb.js
new file mode 100644
index 0000000..06e0195
--- /dev/null
+++ b/examples/cesium/Workers/EllipsoidTangentPlane-c421b2cb.js
@@ -0,0 +1,399 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './AxisAlignedBoundingBox-50342d27', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './IntersectionTests-2c7928de', './Plane-c9f1487d', './Transforms-11fb6b0a'], (function (exports, AxisAlignedBoundingBox, Matrix2, Matrix3, Check, defaultValue, IntersectionTests, Plane, Transforms) { 'use strict';
+
+ const scratchCart4 = new Matrix2.Cartesian4();
+ /**
+ * A plane tangent to the provided ellipsoid at the provided origin.
+ * If origin is not on the surface of the ellipsoid, it's surface projection will be used.
+ * If origin is at the center of the ellipsoid, an exception will be thrown.
+ * @alias EllipsoidTangentPlane
+ * @constructor
+ *
+ * @param {Cartesian3} origin The point on the surface of the ellipsoid where the tangent plane touches.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.
+ *
+ * @exception {DeveloperError} origin must not be at the center of the ellipsoid.
+ */
+ function EllipsoidTangentPlane(origin, ellipsoid) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("origin", origin);
+ //>>includeEnd('debug');
+
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+ origin = ellipsoid.scaleToGeodeticSurface(origin);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(origin)) {
+ throw new Check.DeveloperError(
+ "origin must not be at the center of the ellipsoid."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const eastNorthUp = Transforms.Transforms.eastNorthUpToFixedFrame(origin, ellipsoid);
+ this._ellipsoid = ellipsoid;
+ this._origin = origin;
+ this._xAxis = Matrix3.Cartesian3.fromCartesian4(
+ Matrix2.Matrix4.getColumn(eastNorthUp, 0, scratchCart4)
+ );
+ this._yAxis = Matrix3.Cartesian3.fromCartesian4(
+ Matrix2.Matrix4.getColumn(eastNorthUp, 1, scratchCart4)
+ );
+
+ const normal = Matrix3.Cartesian3.fromCartesian4(
+ Matrix2.Matrix4.getColumn(eastNorthUp, 2, scratchCart4)
+ );
+ this._plane = Plane.Plane.fromPointNormal(origin, normal);
+ }
+
+ Object.defineProperties(EllipsoidTangentPlane.prototype, {
+ /**
+ * Gets the ellipsoid.
+ * @memberof EllipsoidTangentPlane.prototype
+ * @type {Ellipsoid}
+ */
+ ellipsoid: {
+ get: function () {
+ return this._ellipsoid;
+ },
+ },
+
+ /**
+ * Gets the origin.
+ * @memberof EllipsoidTangentPlane.prototype
+ * @type {Cartesian3}
+ */
+ origin: {
+ get: function () {
+ return this._origin;
+ },
+ },
+
+ /**
+ * Gets the plane which is tangent to the ellipsoid.
+ * @memberof EllipsoidTangentPlane.prototype
+ * @readonly
+ * @type {Plane}
+ */
+ plane: {
+ get: function () {
+ return this._plane;
+ },
+ },
+
+ /**
+ * Gets the local X-axis (east) of the tangent plane.
+ * @memberof EllipsoidTangentPlane.prototype
+ * @readonly
+ * @type {Cartesian3}
+ */
+ xAxis: {
+ get: function () {
+ return this._xAxis;
+ },
+ },
+
+ /**
+ * Gets the local Y-axis (north) of the tangent plane.
+ * @memberof EllipsoidTangentPlane.prototype
+ * @readonly
+ * @type {Cartesian3}
+ */
+ yAxis: {
+ get: function () {
+ return this._yAxis;
+ },
+ },
+
+ /**
+ * Gets the local Z-axis (up) of the tangent plane.
+ * @memberof EllipsoidTangentPlane.prototype
+ * @readonly
+ * @type {Cartesian3}
+ */
+ zAxis: {
+ get: function () {
+ return this._plane.normal;
+ },
+ },
+ });
+
+ const tmp = new AxisAlignedBoundingBox.AxisAlignedBoundingBox();
+ /**
+ * Creates a new instance from the provided ellipsoid and the center
+ * point of the provided Cartesians.
+ *
+ * @param {Cartesian3[]} cartesians The list of positions surrounding the center point.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.
+ * @returns {EllipsoidTangentPlane} The new instance of EllipsoidTangentPlane.
+ */
+ EllipsoidTangentPlane.fromPoints = function (cartesians, ellipsoid) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartesians", cartesians);
+ //>>includeEnd('debug');
+
+ const box = AxisAlignedBoundingBox.AxisAlignedBoundingBox.fromPoints(cartesians, tmp);
+ return new EllipsoidTangentPlane(box.center, ellipsoid);
+ };
+
+ const scratchProjectPointOntoPlaneRay = new IntersectionTests.Ray();
+ const scratchProjectPointOntoPlaneCartesian3 = new Matrix3.Cartesian3();
+
+ /**
+ * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.
+ *
+ * @param {Cartesian3} cartesian The point to project.
+ * @param {Cartesian2} [result] The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point
+ */
+ EllipsoidTangentPlane.prototype.projectPointOntoPlane = function (
+ cartesian,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ const ray = scratchProjectPointOntoPlaneRay;
+ ray.origin = cartesian;
+ Matrix3.Cartesian3.normalize(cartesian, ray.direction);
+
+ let intersectionPoint = IntersectionTests.IntersectionTests.rayPlane(
+ ray,
+ this._plane,
+ scratchProjectPointOntoPlaneCartesian3
+ );
+ if (!defaultValue.defined(intersectionPoint)) {
+ Matrix3.Cartesian3.negate(ray.direction, ray.direction);
+ intersectionPoint = IntersectionTests.IntersectionTests.rayPlane(
+ ray,
+ this._plane,
+ scratchProjectPointOntoPlaneCartesian3
+ );
+ }
+
+ if (defaultValue.defined(intersectionPoint)) {
+ const v = Matrix3.Cartesian3.subtract(
+ intersectionPoint,
+ this._origin,
+ intersectionPoint
+ );
+ const x = Matrix3.Cartesian3.dot(this._xAxis, v);
+ const y = Matrix3.Cartesian3.dot(this._yAxis, v);
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix2.Cartesian2(x, y);
+ }
+ result.x = x;
+ result.y = y;
+ return result;
+ }
+ return undefined;
+ };
+
+ /**
+ * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.
+ * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.
+ *
+ * @see EllipsoidTangentPlane.projectPointOntoPlane
+ *
+ * @param {Cartesian3[]} cartesians The array of points to project.
+ * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.
+ * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided.
+ */
+ EllipsoidTangentPlane.prototype.projectPointsOntoPlane = function (
+ cartesians,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartesians", cartesians);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = [];
+ }
+
+ let count = 0;
+ const length = cartesians.length;
+ for (let i = 0; i < length; i++) {
+ const p = this.projectPointOntoPlane(cartesians[i], result[count]);
+ if (defaultValue.defined(p)) {
+ result[count] = p;
+ count++;
+ }
+ }
+ result.length = count;
+ return result;
+ };
+
+ /**
+ * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.
+ *
+ * @param {Cartesian3} cartesian The point to project.
+ * @param {Cartesian2} [result] The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided.
+ */
+ EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function (
+ cartesian,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix2.Cartesian2();
+ }
+
+ const ray = scratchProjectPointOntoPlaneRay;
+ ray.origin = cartesian;
+ Matrix3.Cartesian3.clone(this._plane.normal, ray.direction);
+
+ let intersectionPoint = IntersectionTests.IntersectionTests.rayPlane(
+ ray,
+ this._plane,
+ scratchProjectPointOntoPlaneCartesian3
+ );
+ if (!defaultValue.defined(intersectionPoint)) {
+ Matrix3.Cartesian3.negate(ray.direction, ray.direction);
+ intersectionPoint = IntersectionTests.IntersectionTests.rayPlane(
+ ray,
+ this._plane,
+ scratchProjectPointOntoPlaneCartesian3
+ );
+ }
+
+ const v = Matrix3.Cartesian3.subtract(
+ intersectionPoint,
+ this._origin,
+ intersectionPoint
+ );
+ const x = Matrix3.Cartesian3.dot(this._xAxis, v);
+ const y = Matrix3.Cartesian3.dot(this._yAxis, v);
+
+ result.x = x;
+ result.y = y;
+ return result;
+ };
+
+ /**
+ * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.
+ *
+ * @see EllipsoidTangentPlane.projectPointToNearestOnPlane
+ *
+ * @param {Cartesian3[]} cartesians The array of points to project.
+ * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.
+ * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided. This will have the same length as cartesians
.
+ */
+ EllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function (
+ cartesians,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartesians", cartesians);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = [];
+ }
+
+ const length = cartesians.length;
+ result.length = length;
+ for (let i = 0; i < length; i++) {
+ result[i] = this.projectPointToNearestOnPlane(cartesians[i], result[i]);
+ }
+ return result;
+ };
+
+ const projectPointsOntoEllipsoidScratch = new Matrix3.Cartesian3();
+ /**
+ * Computes the projection of the provided 2D position onto the 3D ellipsoid.
+ *
+ * @param {Cartesian2} cartesian The points to project.
+ * @param {Cartesian3} [result] The Cartesian3 instance to store result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
+ */
+ EllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function (
+ cartesian,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ const ellipsoid = this._ellipsoid;
+ const origin = this._origin;
+ const xAxis = this._xAxis;
+ const yAxis = this._yAxis;
+ const tmp = projectPointsOntoEllipsoidScratch;
+
+ Matrix3.Cartesian3.multiplyByScalar(xAxis, cartesian.x, tmp);
+ result = Matrix3.Cartesian3.add(origin, tmp, result);
+ Matrix3.Cartesian3.multiplyByScalar(yAxis, cartesian.y, tmp);
+ Matrix3.Cartesian3.add(result, tmp, result);
+ ellipsoid.scaleToGeocentricSurface(result, result);
+
+ return result;
+ };
+
+ /**
+ * Computes the projection of the provided 2D positions onto the 3D ellipsoid.
+ *
+ * @param {Cartesian2[]} cartesians The array of points to project.
+ * @param {Cartesian3[]} [result] The array of Cartesian3 instances onto which to store results.
+ * @returns {Cartesian3[]} The modified result parameter or a new array of Cartesian3 instances if none was provided.
+ */
+ EllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function (
+ cartesians,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartesians", cartesians);
+ //>>includeEnd('debug');
+
+ const length = cartesians.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length);
+ } else {
+ result.length = length;
+ }
+
+ for (let i = 0; i < length; ++i) {
+ result[i] = this.projectPointOntoEllipsoid(cartesians[i], result[i]);
+ }
+
+ return result;
+ };
+
+ exports.EllipsoidTangentPlane = EllipsoidTangentPlane;
+
+}));
+//# sourceMappingURL=EllipsoidTangentPlane-c421b2cb.js.map
diff --git a/examples/cesium/Workers/EllipsoidTangentPlane-c421b2cb.js.map b/examples/cesium/Workers/EllipsoidTangentPlane-c421b2cb.js.map
new file mode 100644
index 0000000..47b5af3
--- /dev/null
+++ b/examples/cesium/Workers/EllipsoidTangentPlane-c421b2cb.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"EllipsoidTangentPlane-c421b2cb.js","sources":["../../../Source/Core/EllipsoidTangentPlane.js"],"sourcesContent":["import AxisAlignedBoundingBox from \"./AxisAlignedBoundingBox.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartesian4 from \"./Cartesian4.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport IntersectionTests from \"./IntersectionTests.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport Plane from \"./Plane.js\";\r\nimport Ray from \"./Ray.js\";\r\nimport Transforms from \"./Transforms.js\";\r\n\r\nconst scratchCart4 = new Cartesian4();\r\n/**\r\n * A plane tangent to the provided ellipsoid at the provided origin.\r\n * If origin is not on the surface of the ellipsoid, it's surface projection will be used.\r\n * If origin is at the center of the ellipsoid, an exception will be thrown.\r\n * @alias EllipsoidTangentPlane\r\n * @constructor\r\n *\r\n * @param {Cartesian3} origin The point on the surface of the ellipsoid where the tangent plane touches.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.\r\n *\r\n * @exception {DeveloperError} origin must not be at the center of the ellipsoid.\r\n */\r\nfunction EllipsoidTangentPlane(origin, ellipsoid) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"origin\", origin);\r\n //>>includeEnd('debug');\r\n\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n origin = ellipsoid.scaleToGeodeticSurface(origin);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(origin)) {\r\n throw new DeveloperError(\r\n \"origin must not be at the center of the ellipsoid.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const eastNorthUp = Transforms.eastNorthUpToFixedFrame(origin, ellipsoid);\r\n this._ellipsoid = ellipsoid;\r\n this._origin = origin;\r\n this._xAxis = Cartesian3.fromCartesian4(\r\n Matrix4.getColumn(eastNorthUp, 0, scratchCart4)\r\n );\r\n this._yAxis = Cartesian3.fromCartesian4(\r\n Matrix4.getColumn(eastNorthUp, 1, scratchCart4)\r\n );\r\n\r\n const normal = Cartesian3.fromCartesian4(\r\n Matrix4.getColumn(eastNorthUp, 2, scratchCart4)\r\n );\r\n this._plane = Plane.fromPointNormal(origin, normal);\r\n}\r\n\r\nObject.defineProperties(EllipsoidTangentPlane.prototype, {\r\n /**\r\n * Gets the ellipsoid.\r\n * @memberof EllipsoidTangentPlane.prototype\r\n * @type {Ellipsoid}\r\n */\r\n ellipsoid: {\r\n get: function () {\r\n return this._ellipsoid;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the origin.\r\n * @memberof EllipsoidTangentPlane.prototype\r\n * @type {Cartesian3}\r\n */\r\n origin: {\r\n get: function () {\r\n return this._origin;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the plane which is tangent to the ellipsoid.\r\n * @memberof EllipsoidTangentPlane.prototype\r\n * @readonly\r\n * @type {Plane}\r\n */\r\n plane: {\r\n get: function () {\r\n return this._plane;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the local X-axis (east) of the tangent plane.\r\n * @memberof EllipsoidTangentPlane.prototype\r\n * @readonly\r\n * @type {Cartesian3}\r\n */\r\n xAxis: {\r\n get: function () {\r\n return this._xAxis;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the local Y-axis (north) of the tangent plane.\r\n * @memberof EllipsoidTangentPlane.prototype\r\n * @readonly\r\n * @type {Cartesian3}\r\n */\r\n yAxis: {\r\n get: function () {\r\n return this._yAxis;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the local Z-axis (up) of the tangent plane.\r\n * @memberof EllipsoidTangentPlane.prototype\r\n * @readonly\r\n * @type {Cartesian3}\r\n */\r\n zAxis: {\r\n get: function () {\r\n return this._plane.normal;\r\n },\r\n },\r\n});\r\n\r\nconst tmp = new AxisAlignedBoundingBox();\r\n/**\r\n * Creates a new instance from the provided ellipsoid and the center\r\n * point of the provided Cartesians.\r\n *\r\n * @param {Cartesian3[]} cartesians The list of positions surrounding the center point.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.\r\n * @returns {EllipsoidTangentPlane} The new instance of EllipsoidTangentPlane.\r\n */\r\nEllipsoidTangentPlane.fromPoints = function (cartesians, ellipsoid) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartesians\", cartesians);\r\n //>>includeEnd('debug');\r\n\r\n const box = AxisAlignedBoundingBox.fromPoints(cartesians, tmp);\r\n return new EllipsoidTangentPlane(box.center, ellipsoid);\r\n};\r\n\r\nconst scratchProjectPointOntoPlaneRay = new Ray();\r\nconst scratchProjectPointOntoPlaneCartesian3 = new Cartesian3();\r\n\r\n/**\r\n * Computes the projection of the provided 3D position onto the 2D plane, radially outward from the {@link EllipsoidTangentPlane.ellipsoid} coordinate system origin.\r\n *\r\n * @param {Cartesian3} cartesian The point to project.\r\n * @param {Cartesian2} [result] The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided. Undefined if there is no intersection point\r\n */\r\nEllipsoidTangentPlane.prototype.projectPointOntoPlane = function (\r\n cartesian,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n const ray = scratchProjectPointOntoPlaneRay;\r\n ray.origin = cartesian;\r\n Cartesian3.normalize(cartesian, ray.direction);\r\n\r\n let intersectionPoint = IntersectionTests.rayPlane(\r\n ray,\r\n this._plane,\r\n scratchProjectPointOntoPlaneCartesian3\r\n );\r\n if (!defined(intersectionPoint)) {\r\n Cartesian3.negate(ray.direction, ray.direction);\r\n intersectionPoint = IntersectionTests.rayPlane(\r\n ray,\r\n this._plane,\r\n scratchProjectPointOntoPlaneCartesian3\r\n );\r\n }\r\n\r\n if (defined(intersectionPoint)) {\r\n const v = Cartesian3.subtract(\r\n intersectionPoint,\r\n this._origin,\r\n intersectionPoint\r\n );\r\n const x = Cartesian3.dot(this._xAxis, v);\r\n const y = Cartesian3.dot(this._yAxis, v);\r\n\r\n if (!defined(result)) {\r\n return new Cartesian2(x, y);\r\n }\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n return undefined;\r\n};\r\n\r\n/**\r\n * Computes the projection of the provided 3D positions onto the 2D plane (where possible), radially outward from the global origin.\r\n * The resulting array may be shorter than the input array - if a single projection is impossible it will not be included.\r\n *\r\n * @see EllipsoidTangentPlane.projectPointOntoPlane\r\n *\r\n * @param {Cartesian3[]} cartesians The array of points to project.\r\n * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.\r\n * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided.\r\n */\r\nEllipsoidTangentPlane.prototype.projectPointsOntoPlane = function (\r\n cartesians,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartesians\", cartesians);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = [];\r\n }\r\n\r\n let count = 0;\r\n const length = cartesians.length;\r\n for (let i = 0; i < length; i++) {\r\n const p = this.projectPointOntoPlane(cartesians[i], result[count]);\r\n if (defined(p)) {\r\n result[count] = p;\r\n count++;\r\n }\r\n }\r\n result.length = count;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the projection of the provided 3D position onto the 2D plane, along the plane normal.\r\n *\r\n * @param {Cartesian3} cartesian The point to project.\r\n * @param {Cartesian2} [result] The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided.\r\n */\r\nEllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function (\r\n cartesian,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian2();\r\n }\r\n\r\n const ray = scratchProjectPointOntoPlaneRay;\r\n ray.origin = cartesian;\r\n Cartesian3.clone(this._plane.normal, ray.direction);\r\n\r\n let intersectionPoint = IntersectionTests.rayPlane(\r\n ray,\r\n this._plane,\r\n scratchProjectPointOntoPlaneCartesian3\r\n );\r\n if (!defined(intersectionPoint)) {\r\n Cartesian3.negate(ray.direction, ray.direction);\r\n intersectionPoint = IntersectionTests.rayPlane(\r\n ray,\r\n this._plane,\r\n scratchProjectPointOntoPlaneCartesian3\r\n );\r\n }\r\n\r\n const v = Cartesian3.subtract(\r\n intersectionPoint,\r\n this._origin,\r\n intersectionPoint\r\n );\r\n const x = Cartesian3.dot(this._xAxis, v);\r\n const y = Cartesian3.dot(this._yAxis, v);\r\n\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the projection of the provided 3D positions onto the 2D plane, along the plane normal.\r\n *\r\n * @see EllipsoidTangentPlane.projectPointToNearestOnPlane\r\n *\r\n * @param {Cartesian3[]} cartesians The array of points to project.\r\n * @param {Cartesian2[]} [result] The array of Cartesian2 instances onto which to store results.\r\n * @returns {Cartesian2[]} The modified result parameter or a new array of Cartesian2 instances if none was provided. This will have the same length as cartesians
.\r\n */\r\nEllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function (\r\n cartesians,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartesians\", cartesians);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = [];\r\n }\r\n\r\n const length = cartesians.length;\r\n result.length = length;\r\n for (let i = 0; i < length; i++) {\r\n result[i] = this.projectPointToNearestOnPlane(cartesians[i], result[i]);\r\n }\r\n return result;\r\n};\r\n\r\nconst projectPointsOntoEllipsoidScratch = new Cartesian3();\r\n/**\r\n * Computes the projection of the provided 2D position onto the 3D ellipsoid.\r\n *\r\n * @param {Cartesian2} cartesian The points to project.\r\n * @param {Cartesian3} [result] The Cartesian3 instance to store result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\r\n */\r\nEllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function (\r\n cartesian,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n const ellipsoid = this._ellipsoid;\r\n const origin = this._origin;\r\n const xAxis = this._xAxis;\r\n const yAxis = this._yAxis;\r\n const tmp = projectPointsOntoEllipsoidScratch;\r\n\r\n Cartesian3.multiplyByScalar(xAxis, cartesian.x, tmp);\r\n result = Cartesian3.add(origin, tmp, result);\r\n Cartesian3.multiplyByScalar(yAxis, cartesian.y, tmp);\r\n Cartesian3.add(result, tmp, result);\r\n ellipsoid.scaleToGeocentricSurface(result, result);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the projection of the provided 2D positions onto the 3D ellipsoid.\r\n *\r\n * @param {Cartesian2[]} cartesians The array of points to project.\r\n * @param {Cartesian3[]} [result] The array of Cartesian3 instances onto which to store results.\r\n * @returns {Cartesian3[]} The modified result parameter or a new array of Cartesian3 instances if none was provided.\r\n */\r\nEllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function (\r\n cartesians,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartesians\", cartesians);\r\n //>>includeEnd('debug');\r\n\r\n const length = cartesians.length;\r\n if (!defined(result)) {\r\n result = new Array(length);\r\n } else {\r\n result.length = length;\r\n }\r\n\r\n for (let i = 0; i < length; ++i) {\r\n result[i] = this.projectPointOntoEllipsoid(cartesians[i], result[i]);\r\n }\r\n\r\n return result;\r\n};\r\nexport default EllipsoidTangentPlane;\r\n"],"names":["Cartesian4","Check","defaultValue","Ellipsoid","defined","DeveloperError","Transforms","Cartesian3","Matrix4","Plane","AxisAlignedBoundingBox","Ray","IntersectionTests","Cartesian2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,YAAY,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE;EAClD;EACA,EAAEC,WAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;EAClC;AACA;EACA,EAAE,SAAS,GAAGC,yBAAY,CAAC,SAAS,EAAEC,iBAAS,CAAC,KAAK,CAAC,CAAC;EACvD,EAAE,MAAM,GAAG,SAAS,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;AACpD;EACA;EACA,EAAE,IAAI,CAACC,oBAAO,CAAC,MAAM,CAAC,EAAE;EACxB,IAAI,MAAM,IAAIC,oBAAc;EAC5B,MAAM,oDAAoD;EAC1D,KAAK,CAAC;EACN,GAAG;EACH;AACA;EACA,EAAE,MAAM,WAAW,GAAGC,qBAAU,CAAC,uBAAuB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;EAC5E,EAAE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;EAC9B,EAAE,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;EACxB,EAAE,IAAI,CAAC,MAAM,GAAGC,kBAAU,CAAC,cAAc;EACzC,IAAIC,eAAO,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,EAAE,YAAY,CAAC;EACnD,GAAG,CAAC;EACJ,EAAE,IAAI,CAAC,MAAM,GAAGD,kBAAU,CAAC,cAAc;EACzC,IAAIC,eAAO,CAAC,SAAS,CAAC,WAAW,EAA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AC;EACvD,EAAEA,kBAAU,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;EACtC,EAAE,SAAS,CAAC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACrD;EACA,EAAE,OAAO,MAAM,CAAC;EAChB,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,qBAAqB,CAAC,SAAS,CAAC,0BAA0B,GAAG;EAC7D,EAAE,UAAU;EACZ,EAAE,MAAM;EACR,EAAE;EACF;EACA,EAAEN,WAAK,CAAC,OAAO,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;EAC1C;AACA;EACA,EAAE,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;EACnC,EAAE,IAAI,CAACG,oBAAO,CAAC,MAAM,CAAC,EAAE;EACxB,IAAI,MAAM,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;EAC/B,GAAG,MAAM;EACT,IAAI,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;EAC3B,GAAG;AACH;EACA,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE,CAAC,EAAE;EACnC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;EACzE,GAAG;AACH;EACA,EAAE,OAAO,MAAM,CAAC;EAChB,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/EncodedCartesian3-38e2691f.js b/examples/cesium/Workers/EncodedCartesian3-38e2691f.js
new file mode 100644
index 0000000..e936445
--- /dev/null
+++ b/examples/cesium/Workers/EncodedCartesian3-38e2691f.js
@@ -0,0 +1,197 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d'], (function (exports, Matrix3, Check, defaultValue) { 'use strict';
+
+ /**
+ * A fixed-point encoding of a {@link Cartesian3} with 64-bit floating-point components, as two {@link Cartesian3}
+ * values that, when converted to 32-bit floating-point and added, approximate the original input.
+ *
+ * This is used to encode positions in vertex buffers for rendering without jittering artifacts + * as described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. + *
+ * + * @alias EncodedCartesian3 + * @constructor + * + * @private + */ + function EncodedCartesian3() { + /** + * The high bits for each component. Bits 0 to 22 store the whole value. Bits 23 to 31 are not used. + * + * @type {Cartesian3} + * @default {@link Cartesian3.ZERO} + */ + this.high = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO); + + /** + * The low bits for each component. Bits 7 to 22 store the whole value, and bits 0 to 6 store the fraction. Bits 23 to 31 are not used. + * + * @type {Cartesian3} + * @default {@link Cartesian3.ZERO} + */ + this.low = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO); + } + + /** + * Encodes a 64-bit floating-point value as two floating-point values that, when converted to + * 32-bit floating-point and added, approximate the original input. The returned object + * hashigh
and low
properties for the high and low bits, respectively.
+ * + * The fixed-point encoding follows {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. + *
+ * + * @param {Number} value The floating-point value to encode. + * @param {Object} [result] The object onto which to store the result. + * @returns {Object} The modified result parameter or a new instance if one was not provided. + * + * @example + * const value = 1234567.1234567; + * const splitValue = Cesium.EncodedCartesian3.encode(value); + */ + EncodedCartesian3.encode = function (value, result) { + //>>includeStart('debug', pragmas.debug); + Check.Check.typeOf.number("value", value); + //>>includeEnd('debug'); + + if (!defaultValue.defined(result)) { + result = { + high: 0.0, + low: 0.0, + }; + } + + let doubleHigh; + if (value >= 0.0) { + doubleHigh = Math.floor(value / 65536.0) * 65536.0; + result.high = doubleHigh; + result.low = value - doubleHigh; + } else { + doubleHigh = Math.floor(-value / 65536.0) * 65536.0; + result.high = -doubleHigh; + result.low = value + doubleHigh; + } + + return result; + }; + + const scratchEncode = { + high: 0.0, + low: 0.0, + }; + + /** + * Encodes a {@link Cartesian3} with 64-bit floating-point components as two {@link Cartesian3} + * values that, when converted to 32-bit floating-point and added, approximate the original input. + *+ * The fixed-point encoding follows {@link https://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. + *
+ * + * @param {Cartesian3} cartesian The cartesian to encode. + * @param {EncodedCartesian3} [result] The object onto which to store the result. + * @returns {EncodedCartesian3} The modified result parameter or a new EncodedCartesian3 instance if one was not provided. + * + * @example + * const cart = new Cesium.Cartesian3(-10000000.0, 0.0, 10000000.0); + * const encoded = Cesium.EncodedCartesian3.fromCartesian(cart); + */ + EncodedCartesian3.fromCartesian = function (cartesian, result) { + //>>includeStart('debug', pragmas.debug); + Check.Check.typeOf.object("cartesian", cartesian); + //>>includeEnd('debug'); + + if (!defaultValue.defined(result)) { + result = new EncodedCartesian3(); + } + + const high = result.high; + const low = result.low; + + EncodedCartesian3.encode(cartesian.x, scratchEncode); + high.x = scratchEncode.high; + low.x = scratchEncode.low; + + EncodedCartesian3.encode(cartesian.y, scratchEncode); + high.y = scratchEncode.high; + low.y = scratchEncode.low; + + EncodedCartesian3.encode(cartesian.z, scratchEncode); + high.z = scratchEncode.high; + low.z = scratchEncode.low; + + return result; + }; + + const encodedP = new EncodedCartesian3(); + + /** + * Encodes the providedcartesian
, and writes it to an array with high
+ * components followed by low
components, i.e. [high.x, high.y, high.z, low.x, low.y, low.z]
.
+ * + * This is used to create interleaved high-precision position vertex attributes. + *
+ * + * @param {Cartesian3} cartesian The cartesian to encode. + * @param {Number[]} cartesianArray The array to write to. + * @param {Number} index The index into the array to start writing. Six elements will be written. + * + * @exception {DeveloperError} index must be a number greater than or equal to 0. + * + * @example + * const positions = [ + * new Cesium.Cartesian3(), + * // ... + * ]; + * const encodedPositions = new Float32Array(2 * 3 * positions.length); + * let j = 0; + * for (let i = 0; i < positions.length; ++i) { + * Cesium.EncodedCartesian3.writeElement(positions[i], encodedPositions, j); + * j += 6; + * } + */ + EncodedCartesian3.writeElements = function (cartesian, cartesianArray, index) { + //>>includeStart('debug', pragmas.debug); + Check.Check.defined("cartesianArray", cartesianArray); + Check.Check.typeOf.number("index", index); + Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0); + //>>includeEnd('debug'); + + EncodedCartesian3.fromCartesian(cartesian, encodedP); + const high = encodedP.high; + const low = encodedP.low; + + cartesianArray[index] = high.x; + cartesianArray[index + 1] = high.y; + cartesianArray[index + 2] = high.z; + cartesianArray[index + 3] = low.x; + cartesianArray[index + 4] = low.y; + cartesianArray[index + 5] = low.z; + }; + + exports.EncodedCartesian3 = EncodedCartesian3; + +})); +//# sourceMappingURL=EncodedCartesian3-38e2691f.js.map diff --git a/examples/cesium/Workers/EncodedCartesian3-38e2691f.js.map b/examples/cesium/Workers/EncodedCartesian3-38e2691f.js.map new file mode 100644 index 0000000..bbc15d7 --- /dev/null +++ b/examples/cesium/Workers/EncodedCartesian3-38e2691f.js.map @@ -0,0 +1 @@ +{"version":3,"file":"EncodedCartesian3-38e2691f.js","sources":["../../../Source/Core/EncodedCartesian3.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defined from \"./defined.js\";\r\n\r\n/**\r\n * A fixed-point encoding of a {@link Cartesian3} with 64-bit floating-point components, as two {@link Cartesian3}\r\n * values that, when converted to 32-bit floating-point and added, approximate the original input.\r\n *\r\n * This is used to encode positions in vertex buffers for rendering without jittering artifacts\r\n * as described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\r\n *
\r\n *\r\n * @alias EncodedCartesian3\r\n * @constructor\r\n *\r\n * @private\r\n */\r\nfunction EncodedCartesian3() {\r\n /**\r\n * The high bits for each component. Bits 0 to 22 store the whole value. Bits 23 to 31 are not used.\r\n *\r\n * @type {Cartesian3}\r\n * @default {@link Cartesian3.ZERO}\r\n */\r\n this.high = Cartesian3.clone(Cartesian3.ZERO);\r\n\r\n /**\r\n * The low bits for each component. Bits 7 to 22 store the whole value, and bits 0 to 6 store the fraction. Bits 23 to 31 are not used.\r\n *\r\n * @type {Cartesian3}\r\n * @default {@link Cartesian3.ZERO}\r\n */\r\n this.low = Cartesian3.clone(Cartesian3.ZERO);\r\n}\r\n\r\n/**\r\n * Encodes a 64-bit floating-point value as two floating-point values that, when converted to\r\n * 32-bit floating-point and added, approximate the original input. The returned object\r\n * hashigh
and low
properties for the high and low bits, respectively.\r\n * \r\n * The fixed-point encoding follows {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\r\n *
\r\n *\r\n * @param {Number} value The floating-point value to encode.\r\n * @param {Object} [result] The object onto which to store the result.\r\n * @returns {Object} The modified result parameter or a new instance if one was not provided.\r\n *\r\n * @example\r\n * const value = 1234567.1234567;\r\n * const splitValue = Cesium.EncodedCartesian3.encode(value);\r\n */\r\nEncodedCartesian3.encode = function (value, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"value\", value);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = {\r\n high: 0.0,\r\n low: 0.0,\r\n };\r\n }\r\n\r\n let doubleHigh;\r\n if (value >= 0.0) {\r\n doubleHigh = Math.floor(value / 65536.0) * 65536.0;\r\n result.high = doubleHigh;\r\n result.low = value - doubleHigh;\r\n } else {\r\n doubleHigh = Math.floor(-value / 65536.0) * 65536.0;\r\n result.high = -doubleHigh;\r\n result.low = value + doubleHigh;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nconst scratchEncode = {\r\n high: 0.0,\r\n low: 0.0,\r\n};\r\n\r\n/**\r\n * Encodes a {@link Cartesian3} with 64-bit floating-point components as two {@link Cartesian3}\r\n * values that, when converted to 32-bit floating-point and added, approximate the original input.\r\n *\r\n * The fixed-point encoding follows {@link https://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\r\n *
\r\n *\r\n * @param {Cartesian3} cartesian The cartesian to encode.\r\n * @param {EncodedCartesian3} [result] The object onto which to store the result.\r\n * @returns {EncodedCartesian3} The modified result parameter or a new EncodedCartesian3 instance if one was not provided.\r\n *\r\n * @example\r\n * const cart = new Cesium.Cartesian3(-10000000.0, 0.0, 10000000.0);\r\n * const encoded = Cesium.EncodedCartesian3.fromCartesian(cart);\r\n */\r\nEncodedCartesian3.fromCartesian = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new EncodedCartesian3();\r\n }\r\n\r\n const high = result.high;\r\n const low = result.low;\r\n\r\n EncodedCartesian3.encode(cartesian.x, scratchEncode);\r\n high.x = scratchEncode.high;\r\n low.x = scratchEncode.low;\r\n\r\n EncodedCartesian3.encode(cartesian.y, scratchEncode);\r\n high.y = scratchEncode.high;\r\n low.y = scratchEncode.low;\r\n\r\n EncodedCartesian3.encode(cartesian.z, scratchEncode);\r\n high.z = scratchEncode.high;\r\n low.z = scratchEncode.low;\r\n\r\n return result;\r\n};\r\n\r\nconst encodedP = new EncodedCartesian3();\r\n\r\n/**\r\n * Encodes the providedcartesian
, and writes it to an array with high
\r\n * components followed by low
components, i.e. [high.x, high.y, high.z, low.x, low.y, low.z]
.\r\n * \r\n * This is used to create interleaved high-precision position vertex attributes.\r\n *
\r\n *\r\n * @param {Cartesian3} cartesian The cartesian to encode.\r\n * @param {Number[]} cartesianArray The array to write to.\r\n * @param {Number} index The index into the array to start writing. Six elements will be written.\r\n *\r\n * @exception {DeveloperError} index must be a number greater than or equal to 0.\r\n *\r\n * @example\r\n * const positions = [\r\n * new Cesium.Cartesian3(),\r\n * // ...\r\n * ];\r\n * const encodedPositions = new Float32Array(2 * 3 * positions.length);\r\n * let j = 0;\r\n * for (let i = 0; i < positions.length; ++i) {\r\n * Cesium.EncodedCartesian3.writeElement(positions[i], encodedPositions, j);\r\n * j += 6;\r\n * }\r\n */\r\nEncodedCartesian3.writeElements = function (cartesian, cartesianArray, index) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartesianArray\", cartesianArray);\r\n Check.typeOf.number(\"index\", index);\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n //>>includeEnd('debug');\r\n\r\n EncodedCartesian3.fromCartesian(cartesian, encodedP);\r\n const high = encodedP.high;\r\n const low = encodedP.low;\r\n\r\n cartesianArray[index] = high.x;\r\n cartesianArray[index + 1] = high.y;\r\n cartesianArray[index + 2] = high.z;\r\n cartesianArray[index + 3] = low.x;\r\n cartesianArray[index + 4] = low.y;\r\n cartesianArray[index + 5] = low.z;\r\n};\r\nexport default EncodedCartesian3;\r\n"],"names":["Cartesian3","Check","defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAIA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,iBAAiB,GAAG;EAC7B;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,IAAI,GAAGA,kBAAU,CAAC,KAAK,CAACA,kBAAU,CAAC,IAAI,CAAC,CAAC;AAChD;EACA;EACA;EACA;EACA;EACA;E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ACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB,CAAC,aAAa,GAAG,UAAU,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE;EAC9E;EACA,EAAED,WAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;EAClD,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;EACtC,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;EAC7D;AACA;EACA,EAAE,iBAAiB,CAAC,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;EACvD,EAAE,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;EAC7B,EAAE,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;AAC3B;EACA,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;EACjC,EAAE,cAAc,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;EACrC,EAAE,cAAc,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;EACrC,EAAE,cAAc,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;EACpC,EAAE,cAAc,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;EACpC,EAAE,cAAc,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;EACpC,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/examples/cesium/Workers/FrustumGeometry-f3f058a2.js b/examples/cesium/Workers/FrustumGeometry-f3f058a2.js new file mode 100644 index 0000000..cca5de0 --- /dev/null +++ b/examples/cesium/Workers/FrustumGeometry-f3f058a2.js @@ -0,0 +1,2538 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.99 + * + * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. + */ + +define(['exports', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Matrix2-036c77dd', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './Math-9be8b918', './Plane-c9f1487d', './VertexFormat-f2d74c96'], (function (exports, Transforms, Matrix3, Matrix2, Check, ComponentDatatype, defaultValue, GeometryAttribute, GeometryAttributes, Math$1, Plane, VertexFormat) { 'use strict'; + + /** + * The culling volume defined by planes. + * + * @alias CullingVolume + * @constructor + * + * @param {Cartesian4[]} [planes] An array of clipping planes. + */ + function CullingVolume(planes) { + /** + * Each plane is represented by a Cartesian4 object, where the x, y, and z components + * define the unit vector normal to the plane, and the w component is the distance of the + * plane from the origin. + * @type {Cartesian4[]} + * @default [] + */ + this.planes = defaultValue.defaultValue(planes, []); + } + + const faces = [new Matrix3.Cartesian3(), new Matrix3.Cartesian3(), new Matrix3.Cartesian3()]; + Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_X, faces[0]); + Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_Y, faces[1]); + Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_Z, faces[2]); + + const scratchPlaneCenter = new Matrix3.Cartesian3(); + const scratchPlaneNormal = new Matrix3.Cartesian3(); + const scratchPlane = new Plane.Plane(new Matrix3.Cartesian3(1.0, 0.0, 0.0), 0.0); + + /** + * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere. + * The planes are aligned to the x, y, and z axes in world coordinates. + * + * @param {BoundingSphere} boundingSphere The bounding sphere used to create the culling volume. + * @param {CullingVolume} [result] The object onto which to store the result. + * @returns {CullingVolume} The culling volume created from the bounding sphere. + */ + CullingVolume.fromBoundingSphere = function (boundingSphere, result) { + //>>includeStart('debug', pragmas.debug); + if (!defaultValue.defined(boundingSphere)) { + throw new Check.DeveloperError("boundingSphere is required."); + } + //>>includeEnd('debug'); + + if (!defaultValue.defined(result)) { + result = new CullingVolume(); + } + + const length = faces.length; + const planes = result.planes; + planes.length = 2 * length; + + const center = boundingSphere.center; + const radius = boundingSphere.radius; + + let planeIndex = 0; + + for (let i = 0; i < length; ++i) { + const faceNormal = faces[i]; + + let plane0 = planes[planeIndex]; + let plane1 = planes[planeIndex + 1]; + + if (!defaultValue.defined(plane0)) { + plane0 = planes[planeIndex] = new Matrix2.Cartesian4(); + } + if (!defaultValue.defined(plane1)) { + plane1 = planes[planeIndex + 1] = new Matrix2.Cartesian4(); + } + + Matrix3.Cartesian3.multiplyByScalar(faceNormal, -radius, scratchPlaneCenter); + Matrix3.Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter); + + plane0.x = faceNormal.x; + plane0.y = faceNormal.y; + plane0.z = faceNormal.z; + plane0.w = -Matrix3.Cartesian3.dot(faceNormal, scratchPlaneCenter); + + Matrix3.Cartesian3.multiplyByScalar(faceNormal, radius, scratchPlaneCenter); + Matrix3.Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter); + + plane1.x = -faceNormal.x; + plane1.y = -faceNormal.y; + plane1.z = -faceNormal.z; + plane1.w = -Matrix3.Cartesian3.dot( + Matrix3.Cartesian3.negate(faceNormal, scratchPlaneNormal), + scratchPlaneCenter + ); + + planeIndex += 2; + } + + return result; + }; + + /** + * Determines whether a bounding volume intersects the culling volume. + * + * @param {Object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested. + * @returns {Intersect} Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE. + */ + CullingVolume.prototype.computeVisibility = function (boundingVolume) { + //>>includeStart('debug', pragmas.debug); + if (!defaultValue.defined(boundingVolume)) { + throw new Check.DeveloperError("boundingVolume is required."); + } + //>>includeEnd('debug'); + + const planes = this.planes; + let intersecting = false; + for (let k = 0, len = planes.length; k < len; ++k) { + const result = boundingVolume.intersectPlane( + Plane.Plane.fromCartesian4(planes[k], scratchPlane) + ); + if (result === Transforms.Intersect.OUTSIDE) { + return Transforms.Intersect.OUTSIDE; + } else if (result === Transforms.Intersect.INTERSECTING) { + intersecting = true; + } + } + + return intersecting ? Transforms.Intersect.INTERSECTING : Transforms.Intersect.INSIDE; + }; + + /** + * Determines whether a bounding volume intersects the culling volume. + * + * @param {Object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested. + * @param {Number} parentPlaneMask A bit mask from the boundingVolume's parent's check against the same culling + * volume, such that if (planeMask & (1 << planeIndex) === 0), for k < 31, then + * the parent (and therefore this) volume is completely inside plane[planeIndex] + * and that plane check can be skipped. + * @returns {Number} A plane mask as described above (which can be applied to this boundingVolume's children). + * + * @private + */ + CullingVolume.prototype.computeVisibilityWithPlaneMask = function ( + boundingVolume, + parentPlaneMask + ) { + //>>includeStart('debug', pragmas.debug); + if (!defaultValue.defined(boundingVolume)) { + throw new Check.DeveloperError("boundingVolume is required."); + } + if (!defaultValue.defined(parentPlaneMask)) { + throw new Check.DeveloperError("parentPlaneMask is required."); + } + //>>includeEnd('debug'); + + if ( + parentPlaneMask === CullingVolume.MASK_OUTSIDE || + parentPlaneMask === CullingVolume.MASK_INSIDE + ) { + // parent is completely outside or completely inside, so this child is as well. + return parentPlaneMask; + } + + // Start with MASK_INSIDE (all zeros) so that after the loop, the return value can be compared with MASK_INSIDE. + // (Because if there are fewer than 31 planes, the upper bits wont be changed.) + let mask = CullingVolume.MASK_INSIDE; + + const planes = this.planes; + for (let k = 0, len = planes.length; k < len; ++k) { + // For k greater than 31 (since 31 is the maximum number of INSIDE/INTERSECTING bits we can store), skip the optimization. + const flag = k < 31 ? 1 << k : 0; + if (k < 31 && (parentPlaneMask & flag) === 0) { + // boundingVolume is known to be INSIDE this plane. + continue; + } + + const result = boundingVolume.intersectPlane( + Plane.Plane.fromCartesian4(planes[k], scratchPlane) + ); + if (result === Transforms.Intersect.OUTSIDE) { + return CullingVolume.MASK_OUTSIDE; + } else if (result === Transforms.Intersect.INTERSECTING) { + mask |= flag; + } + } + + return mask; + }; + + /** + * For plane masks (as used in {@link CullingVolume#computeVisibilityWithPlaneMask}), this special value + * represents the case where the object bounding volume is entirely outside the culling volume. + * + * @type {Number} + * @private + */ + CullingVolume.MASK_OUTSIDE = 0xffffffff; + + /** + * For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value + * represents the case where the object bounding volume is entirely inside the culling volume. + * + * @type {Number} + * @private + */ + CullingVolume.MASK_INSIDE = 0x00000000; + + /** + * For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value + * represents the case where the object bounding volume (may) intersect all planes of the culling volume. + * + * @type {Number} + * @private + */ + CullingVolume.MASK_INDETERMINATE = 0x7fffffff; + + /** + * The viewing frustum is defined by 6 planes. + * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components + * define the unit vector normal to the plane, and the w component is the distance of the + * plane from the origin/camera position. + * + * @alias OrthographicOffCenterFrustum + * @constructor + * + * @param {Object} [options] An object with the following properties: + * @param {Number} [options.left] The left clipping plane distance. + * @param {Number} [options.right] The right clipping plane distance. + * @param {Number} [options.top] The top clipping plane distance. + * @param {Number} [options.bottom] The bottom clipping plane distance. + * @param {Number} [options.near=1.0] The near clipping plane distance. + * @param {Number} [options.far=500000000.0] The far clipping plane distance. + * + * @example + * const maxRadii = ellipsoid.maximumRadius; + * + * const frustum = new Cesium.OrthographicOffCenterFrustum(); + * frustum.right = maxRadii * Cesium.Math.PI; + * frustum.left = -c.frustum.right; + * frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth); + * frustum.bottom = -c.frustum.top; + * frustum.near = 0.01 * maxRadii; + * frustum.far = 50.0 * maxRadii; + */ + function OrthographicOffCenterFrustum(options) { + options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT); + + /** + * The left clipping plane. + * @type {Number} + * @default undefined + */ + this.left = options.left; + this._left = undefined; + + /** + * The right clipping plane. + * @type {Number} + * @default undefined + */ + this.right = options.right; + this._right = undefined; + + /** + * The top clipping plane. + * @type {Number} + * @default undefined + */ + this.top = options.top; + this._top = undefined; + + /** + * The bottom clipping plane. + * @type {Number} + * @default undefined + */ + this.bottom = options.bottom; + this._bottom = undefined; + + /** + * The distance of the near plane. + * @type {Number} + * @default 1.0 + */ + this.near = defaultValue.defaultValue(options.near, 1.0); + this._near = this.near; + + /** + * The distance of the far plane. + * @type {Number} + * @default 500000000.0; + */ + this.far = defaultValue.defaultValue(options.far, 500000000.0); + this._far = this.far; + + this._cullingVolume = new CullingVolume(); + this._orthographicMatrix = new Matrix2.Matrix4(); + } + + function update$3(frustum) { + //>>includeStart('debug', pragmas.debug); + if ( + !defaultValue.defined(frustum.right) || + !defaultValue.defined(frustum.left) || + !defaultValue.defined(frustum.top) || + !defaultValue.defined(frustum.bottom) || + !defaultValue.defined(frustum.near) || + !defaultValue.defined(frustum.far) + ) { + throw new Check.DeveloperError( + "right, left, top, bottom, near, or far parameters are not set." + ); + } + //>>includeEnd('debug'); + + if ( + frustum.top !== frustum._top || + frustum.bottom !== frustum._bottom || + frustum.left !== frustum._left || + frustum.right !== frustum._right || + frustum.near !== frustum._near || + frustum.far !== frustum._far + ) { + //>>includeStart('debug', pragmas.debug); + if (frustum.left > frustum.right) { + throw new Check.DeveloperError("right must be greater than left."); + } + if (frustum.bottom > frustum.top) { + throw new Check.DeveloperError("top must be greater than bottom."); + } + if (frustum.near <= 0 || frustum.near > frustum.far) { + throw new Check.DeveloperError( + "near must be greater than zero and less than far." + ); + } + //>>includeEnd('debug'); + + frustum._left = frustum.left; + frustum._right = frustum.right; + frustum._top = frustum.top; + frustum._bottom = frustum.bottom; + frustum._near = frustum.near; + frustum._far = frustum.far; + frustum._orthographicMatrix = Matrix2.Matrix4.computeOrthographicOffCenter( + frustum.left, + frustum.right, + frustum.bottom, + frustum.top, + frustum.near, + frustum.far, + frustum._orthographicMatrix + ); + } + } + + Object.defineProperties(OrthographicOffCenterFrustum.prototype, { + /** + * Gets the orthographic projection matrix computed from the view frustum. + * @memberof OrthographicOffCenterFrustum.prototype + * @type {Matrix4} + * @readonly + */ + projectionMatrix: { + get: function () { + update$3(this); + return this._orthographicMatrix; + }, + }, + }); + + const getPlanesRight$1 = new Matrix3.Cartesian3(); + const getPlanesNearCenter$1 = new Matrix3.Cartesian3(); + const getPlanesPoint = new Matrix3.Cartesian3(); + const negateScratch = new Matrix3.Cartesian3(); + + /** + * Creates a culling volume for this frustum. + * + * @param {Cartesian3} position The eye position. + * @param {Cartesian3} direction The view direction. + * @param {Cartesian3} up The up direction. + * @returns {CullingVolume} A culling volume at the given position and orientation. + * + * @example + * // Check if a bounding volume intersects the frustum. + * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp); + * const intersect = cullingVolume.computeVisibility(boundingVolume); + */ + OrthographicOffCenterFrustum.prototype.computeCullingVolume = function ( + position, + direction, + up + ) { + //>>includeStart('debug', pragmas.debug); + if (!defaultValue.defined(position)) { + throw new Check.DeveloperError("position is required."); + } + if (!defaultValue.defined(direction)) { + throw new Check.DeveloperError("direction is required."); + } + if (!defaultValue.defined(up)) { + throw new Check.DeveloperError("up is required."); + } + //>>includeEnd('debug'); + + const planes = this._cullingVolume.planes; + const t = this.top; + const b = this.bottom; + const r = this.right; + const l = this.left; + const n = this.near; + const f = this.far; + + const right = Matrix3.Cartesian3.cross(direction, up, getPlanesRight$1); + Matrix3.Cartesian3.normalize(right, right); + const nearCenter = getPlanesNearCenter$1; + Matrix3.Cartesian3.multiplyByScalar(direction, n, nearCenter); + Matrix3.Cartesian3.add(position, nearCenter, nearCenter); + + const point = getPlanesPoint; + + // Left plane + Matrix3.Cartesian3.multiplyByScalar(right, l, point); + Matrix3.Cartesian3.add(nearCenter, point, point); + + let plane = planes[0]; + if (!defaultValue.defined(plane)) { + plane = planes[0] = new Matrix2.Cartesian4(); + } + plane.x = right.x; + plane.y = right.y; + plane.z = right.z; + plane.w = -Matrix3.Cartesian3.dot(right, point); + + // Right plane + Matrix3.Cartesian3.multiplyByScalar(right, r, point); + Matrix3.Cartesian3.add(nearCenter, point, point); + + plane = planes[1]; + if (!defaultValue.defined(plane)) { + plane = planes[1] = new Matrix2.Cartesian4(); + } + plane.x = -right.x; + plane.y = -right.y; + plane.z = -right.z; + plane.w = -Matrix3.Cartesian3.dot(Matrix3.Cartesian3.negate(right, negateScratch), point); + + // Bottom plane + Matrix3.Cartesian3.multiplyByScalar(up, b, point); + Matrix3.Cartesian3.add(nearCenter, point, point); + + plane = planes[2]; + if (!defaultValue.defined(plane)) { + plane = planes[2] = new Matrix2.Cartesian4(); + } + plane.x = up.x; + plane.y = up.y; + plane.z = up.z; + plane.w = -Matrix3.Cartesian3.dot(up, point); + + // Top plane + Matrix3.Cartesian3.multiplyByScalar(up, t, point); + Matrix3.Cartesian3.add(nearCenter, point, point); + + plane = planes[3]; + if (!defaultValue.defined(plane)) { + plane = planes[3] = new Matrix2.Cartesian4(); + } + plane.x = -up.x; + plane.y = -up.y; + plane.z = -up.z; + plane.w = -Matrix3.Cartesian3.dot(Matrix3.Cartesian3.negate(up, negateScratch), point); + + // Near plane + plane = planes[4]; + if (!defaultValue.defined(plane)) { + plane = planes[4] = new Matrix2.Cartesian4(); + } + plane.x = direction.x; + plane.y = direction.y; + plane.z = direction.z; + plane.w = -Matrix3.Cartesian3.dot(direction, nearCenter); + + // Far plane + Matrix3.Cartesian3.multiplyByScalar(direction, f, point); + Matrix3.Cartesian3.add(position, point, point); + + plane = planes[5]; + if (!defaultValue.defined(plane)) { + plane = planes[5] = new Matrix2.Cartesian4(); + } + plane.x = -direction.x; + plane.y = -direction.y; + plane.z = -direction.z; + plane.w = -Matrix3.Cartesian3.dot(Matrix3.Cartesian3.negate(direction, negateScratch), point); + + return this._cullingVolume; + }; + + /** + * Returns the pixel's width and height in meters. + * + * @param {Number} drawingBufferWidth The width of the drawing buffer. + * @param {Number} drawingBufferHeight The height of the drawing buffer. + * @param {Number} distance The distance to the near plane in meters. + * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space. + * @param {Cartesian2} result The object onto which to store the result. + * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively. + * + * @exception {DeveloperError} drawingBufferWidth must be greater than zero. + * @exception {DeveloperError} drawingBufferHeight must be greater than zero. + * @exception {DeveloperError} pixelRatio must be greater than zero. + * + * @example + * // Example 1 + * // Get the width and height of a pixel. + * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2()); + */ + OrthographicOffCenterFrustum.prototype.getPixelDimensions = function ( + drawingBufferWidth, + drawingBufferHeight, + distance, + pixelRatio, + result + ) { + update$3(this); + + //>>includeStart('debug', pragmas.debug); + if (!defaultValue.defined(drawingBufferWidth) || !defaultValue.defined(drawingBufferHeight)) { + throw new Check.DeveloperError( + "Both drawingBufferWidth and drawingBufferHeight are required." + ); + } + if (drawingBufferWidth <= 0) { + throw new Check.DeveloperError("drawingBufferWidth must be greater than zero."); + } + if (drawingBufferHeight <= 0) { + throw new Check.DeveloperError("drawingBufferHeight must be greater than zero."); + } + if (!defaultValue.defined(distance)) { + throw new Check.DeveloperError("distance is required."); + } + if (!defaultValue.defined(pixelRatio)) { + throw new Check.DeveloperError("pixelRatio is required."); + } + if (pixelRatio <= 0) { + throw new Check.DeveloperError("pixelRatio must be greater than zero."); + } + if (!defaultValue.defined(result)) { + throw new Check.DeveloperError("A result object is required."); + } + //>>includeEnd('debug'); + + const frustumWidth = this.right - this.left; + const frustumHeight = this.top - this.bottom; + const pixelWidth = (pixelRatio * frustumWidth) / drawingBufferWidth; + const pixelHeight = (pixelRatio * frustumHeight) / drawingBufferHeight; + + result.x = pixelWidth; + result.y = pixelHeight; + return result; + }; + + /** + * Returns a duplicate of a OrthographicOffCenterFrustum instance. + * + * @param {OrthographicOffCenterFrustum} [result] The object onto which to store the result. + * @returns {OrthographicOffCenterFrustum} The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided. + */ + OrthographicOffCenterFrustum.prototype.clone = function (result) { + if (!defaultValue.defined(result)) { + result = new OrthographicOffCenterFrustum(); + } + + result.left = this.left; + result.right = this.right; + result.top = this.top; + result.bottom = this.bottom; + result.near = this.near; + result.far = this.far; + + // force update of clone to compute matrices + result._left = undefined; + result._right = undefined; + result._top = undefined; + result._bottom = undefined; + result._near = undefined; + result._far = undefined; + + return result; + }; + + /** + * Compares the provided OrthographicOffCenterFrustum componentwise and returns + *true
if they are equal, false
otherwise.
+ *
+ * @param {OrthographicOffCenterFrustum} [other] The right hand side OrthographicOffCenterFrustum.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ OrthographicOffCenterFrustum.prototype.equals = function (other) {
+ return (
+ defaultValue.defined(other) &&
+ other instanceof OrthographicOffCenterFrustum &&
+ this.right === other.right &&
+ this.left === other.left &&
+ this.top === other.top &&
+ this.bottom === other.bottom &&
+ this.near === other.near &&
+ this.far === other.far
+ );
+ };
+
+ /**
+ * Compares the provided OrthographicOffCenterFrustum componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {OrthographicOffCenterFrustum} other The right hand side OrthographicOffCenterFrustum.
+ * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if this and other are within the provided epsilon, false
otherwise.
+ */
+ OrthographicOffCenterFrustum.prototype.equalsEpsilon = function (
+ other,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ return (
+ other === this ||
+ (defaultValue.defined(other) &&
+ other instanceof OrthographicOffCenterFrustum &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.right,
+ other.right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.left,
+ other.left,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.top,
+ other.top,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.bottom,
+ other.bottom,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.near,
+ other.near,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.far,
+ other.far,
+ relativeEpsilon,
+ absoluteEpsilon
+ ))
+ );
+ };
+
+ /**
+ * The viewing frustum is defined by 6 planes.
+ * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
+ * define the unit vector normal to the plane, and the w component is the distance of the
+ * plane from the origin/camera position.
+ *
+ * @alias OrthographicFrustum
+ * @constructor
+ *
+ * @param {Object} [options] An object with the following properties:
+ * @param {Number} [options.width] The width of the frustum in meters.
+ * @param {Number} [options.aspectRatio] The aspect ratio of the frustum's width to it's height.
+ * @param {Number} [options.near=1.0] The distance of the near plane.
+ * @param {Number} [options.far=500000000.0] The distance of the far plane.
+ *
+ * @example
+ * const maxRadii = ellipsoid.maximumRadius;
+ *
+ * const frustum = new Cesium.OrthographicFrustum();
+ * frustum.near = 0.01 * maxRadii;
+ * frustum.far = 50.0 * maxRadii;
+ */
+ function OrthographicFrustum(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ this._offCenterFrustum = new OrthographicOffCenterFrustum();
+
+ /**
+ * The horizontal width of the frustum in meters.
+ * @type {Number}
+ * @default undefined
+ */
+ this.width = options.width;
+ this._width = undefined;
+
+ /**
+ * The aspect ratio of the frustum's width to it's height.
+ * @type {Number}
+ * @default undefined
+ */
+ this.aspectRatio = options.aspectRatio;
+ this._aspectRatio = undefined;
+
+ /**
+ * The distance of the near plane.
+ * @type {Number}
+ * @default 1.0
+ */
+ this.near = defaultValue.defaultValue(options.near, 1.0);
+ this._near = this.near;
+
+ /**
+ * The distance of the far plane.
+ * @type {Number}
+ * @default 500000000.0;
+ */
+ this.far = defaultValue.defaultValue(options.far, 500000000.0);
+ this._far = this.far;
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ OrthographicFrustum.packedLength = 4;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {OrthographicFrustum} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ OrthographicFrustum.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value.width;
+ array[startingIndex++] = value.aspectRatio;
+ array[startingIndex++] = value.near;
+ array[startingIndex] = value.far;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {OrthographicFrustum} [result] The object into which to store the result.
+ * @returns {OrthographicFrustum} The modified result parameter or a new OrthographicFrustum instance if one was not provided.
+ */
+ OrthographicFrustum.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new OrthographicFrustum();
+ }
+
+ result.width = array[startingIndex++];
+ result.aspectRatio = array[startingIndex++];
+ result.near = array[startingIndex++];
+ result.far = array[startingIndex];
+
+ return result;
+ };
+
+ function update$2(frustum) {
+ //>>includeStart('debug', pragmas.debug);
+ if (
+ !defaultValue.defined(frustum.width) ||
+ !defaultValue.defined(frustum.aspectRatio) ||
+ !defaultValue.defined(frustum.near) ||
+ !defaultValue.defined(frustum.far)
+ ) {
+ throw new Check.DeveloperError(
+ "width, aspectRatio, near, or far parameters are not set."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const f = frustum._offCenterFrustum;
+
+ if (
+ frustum.width !== frustum._width ||
+ frustum.aspectRatio !== frustum._aspectRatio ||
+ frustum.near !== frustum._near ||
+ frustum.far !== frustum._far
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (frustum.aspectRatio < 0) {
+ throw new Check.DeveloperError("aspectRatio must be positive.");
+ }
+ if (frustum.near < 0 || frustum.near > frustum.far) {
+ throw new Check.DeveloperError(
+ "near must be greater than zero and less than far."
+ );
+ }
+ //>>includeEnd('debug');
+
+ frustum._aspectRatio = frustum.aspectRatio;
+ frustum._width = frustum.width;
+ frustum._near = frustum.near;
+ frustum._far = frustum.far;
+
+ const ratio = 1.0 / frustum.aspectRatio;
+ f.right = frustum.width * 0.5;
+ f.left = -f.right;
+ f.top = ratio * f.right;
+ f.bottom = -f.top;
+ f.near = frustum.near;
+ f.far = frustum.far;
+ }
+ }
+
+ Object.defineProperties(OrthographicFrustum.prototype, {
+ /**
+ * Gets the orthographic projection matrix computed from the view frustum.
+ * @memberof OrthographicFrustum.prototype
+ * @type {Matrix4}
+ * @readonly
+ */
+ projectionMatrix: {
+ get: function () {
+ update$2(this);
+ return this._offCenterFrustum.projectionMatrix;
+ },
+ },
+ });
+
+ /**
+ * Creates a culling volume for this frustum.
+ *
+ * @param {Cartesian3} position The eye position.
+ * @param {Cartesian3} direction The view direction.
+ * @param {Cartesian3} up The up direction.
+ * @returns {CullingVolume} A culling volume at the given position and orientation.
+ *
+ * @example
+ * // Check if a bounding volume intersects the frustum.
+ * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
+ * const intersect = cullingVolume.computeVisibility(boundingVolume);
+ */
+ OrthographicFrustum.prototype.computeCullingVolume = function (
+ position,
+ direction,
+ up
+ ) {
+ update$2(this);
+ return this._offCenterFrustum.computeCullingVolume(position, direction, up);
+ };
+
+ /**
+ * Returns the pixel's width and height in meters.
+ *
+ * @param {Number} drawingBufferWidth The width of the drawing buffer.
+ * @param {Number} drawingBufferHeight The height of the drawing buffer.
+ * @param {Number} distance The distance to the near plane in meters.
+ * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
+ *
+ * @exception {DeveloperError} drawingBufferWidth must be greater than zero.
+ * @exception {DeveloperError} drawingBufferHeight must be greater than zero.
+ * @exception {DeveloperError} pixelRatio must be greater than zero.
+ *
+ * @example
+ * // Example 1
+ * // Get the width and height of a pixel.
+ * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());
+ */
+ OrthographicFrustum.prototype.getPixelDimensions = function (
+ drawingBufferWidth,
+ drawingBufferHeight,
+ distance,
+ pixelRatio,
+ result
+ ) {
+ update$2(this);
+ return this._offCenterFrustum.getPixelDimensions(
+ drawingBufferWidth,
+ drawingBufferHeight,
+ distance,
+ pixelRatio,
+ result
+ );
+ };
+
+ /**
+ * Returns a duplicate of a OrthographicFrustum instance.
+ *
+ * @param {OrthographicFrustum} [result] The object onto which to store the result.
+ * @returns {OrthographicFrustum} The modified result parameter or a new OrthographicFrustum instance if one was not provided.
+ */
+ OrthographicFrustum.prototype.clone = function (result) {
+ if (!defaultValue.defined(result)) {
+ result = new OrthographicFrustum();
+ }
+
+ result.aspectRatio = this.aspectRatio;
+ result.width = this.width;
+ result.near = this.near;
+ result.far = this.far;
+
+ // force update of clone to compute matrices
+ result._aspectRatio = undefined;
+ result._width = undefined;
+ result._near = undefined;
+ result._far = undefined;
+
+ this._offCenterFrustum.clone(result._offCenterFrustum);
+
+ return result;
+ };
+
+ /**
+ * Compares the provided OrthographicFrustum componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {OrthographicFrustum} [other] The right hand side OrthographicFrustum.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ OrthographicFrustum.prototype.equals = function (other) {
+ if (!defaultValue.defined(other) || !(other instanceof OrthographicFrustum)) {
+ return false;
+ }
+
+ update$2(this);
+ update$2(other);
+
+ return (
+ this.width === other.width &&
+ this.aspectRatio === other.aspectRatio &&
+ this._offCenterFrustum.equals(other._offCenterFrustum)
+ );
+ };
+
+ /**
+ * Compares the provided OrthographicFrustum componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {OrthographicFrustum} other The right hand side OrthographicFrustum.
+ * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if this and other are within the provided epsilon, false
otherwise.
+ */
+ OrthographicFrustum.prototype.equalsEpsilon = function (
+ other,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ if (!defaultValue.defined(other) || !(other instanceof OrthographicFrustum)) {
+ return false;
+ }
+
+ update$2(this);
+ update$2(other);
+
+ return (
+ Math$1.CesiumMath.equalsEpsilon(
+ this.width,
+ other.width,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.aspectRatio,
+ other.aspectRatio,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ this._offCenterFrustum.equalsEpsilon(
+ other._offCenterFrustum,
+ relativeEpsilon,
+ absoluteEpsilon
+ )
+ );
+ };
+
+ /**
+ * The viewing frustum is defined by 6 planes.
+ * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
+ * define the unit vector normal to the plane, and the w component is the distance of the
+ * plane from the origin/camera position.
+ *
+ * @alias PerspectiveOffCenterFrustum
+ * @constructor
+ *
+ * @param {Object} [options] An object with the following properties:
+ * @param {Number} [options.left] The left clipping plane distance.
+ * @param {Number} [options.right] The right clipping plane distance.
+ * @param {Number} [options.top] The top clipping plane distance.
+ * @param {Number} [options.bottom] The bottom clipping plane distance.
+ * @param {Number} [options.near=1.0] The near clipping plane distance.
+ * @param {Number} [options.far=500000000.0] The far clipping plane distance.
+ *
+ * @example
+ * const frustum = new Cesium.PerspectiveOffCenterFrustum({
+ * left : -1.0,
+ * right : 1.0,
+ * top : 1.0,
+ * bottom : -1.0,
+ * near : 1.0,
+ * far : 100.0
+ * });
+ *
+ * @see PerspectiveFrustum
+ */
+ function PerspectiveOffCenterFrustum(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ /**
+ * Defines the left clipping plane.
+ * @type {Number}
+ * @default undefined
+ */
+ this.left = options.left;
+ this._left = undefined;
+
+ /**
+ * Defines the right clipping plane.
+ * @type {Number}
+ * @default undefined
+ */
+ this.right = options.right;
+ this._right = undefined;
+
+ /**
+ * Defines the top clipping plane.
+ * @type {Number}
+ * @default undefined
+ */
+ this.top = options.top;
+ this._top = undefined;
+
+ /**
+ * Defines the bottom clipping plane.
+ * @type {Number}
+ * @default undefined
+ */
+ this.bottom = options.bottom;
+ this._bottom = undefined;
+
+ /**
+ * The distance of the near plane.
+ * @type {Number}
+ * @default 1.0
+ */
+ this.near = defaultValue.defaultValue(options.near, 1.0);
+ this._near = this.near;
+
+ /**
+ * The distance of the far plane.
+ * @type {Number}
+ * @default 500000000.0
+ */
+ this.far = defaultValue.defaultValue(options.far, 500000000.0);
+ this._far = this.far;
+
+ this._cullingVolume = new CullingVolume();
+ this._perspectiveMatrix = new Matrix2.Matrix4();
+ this._infinitePerspective = new Matrix2.Matrix4();
+ }
+
+ function update$1(frustum) {
+ //>>includeStart('debug', pragmas.debug);
+ if (
+ !defaultValue.defined(frustum.right) ||
+ !defaultValue.defined(frustum.left) ||
+ !defaultValue.defined(frustum.top) ||
+ !defaultValue.defined(frustum.bottom) ||
+ !defaultValue.defined(frustum.near) ||
+ !defaultValue.defined(frustum.far)
+ ) {
+ throw new Check.DeveloperError(
+ "right, left, top, bottom, near, or far parameters are not set."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const t = frustum.top;
+ const b = frustum.bottom;
+ const r = frustum.right;
+ const l = frustum.left;
+ const n = frustum.near;
+ const f = frustum.far;
+
+ if (
+ t !== frustum._top ||
+ b !== frustum._bottom ||
+ l !== frustum._left ||
+ r !== frustum._right ||
+ n !== frustum._near ||
+ f !== frustum._far
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (frustum.near <= 0 || frustum.near > frustum.far) {
+ throw new Check.DeveloperError(
+ "near must be greater than zero and less than far."
+ );
+ }
+ //>>includeEnd('debug');
+
+ frustum._left = l;
+ frustum._right = r;
+ frustum._top = t;
+ frustum._bottom = b;
+ frustum._near = n;
+ frustum._far = f;
+ frustum._perspectiveMatrix = Matrix2.Matrix4.computePerspectiveOffCenter(
+ l,
+ r,
+ b,
+ t,
+ n,
+ f,
+ frustum._perspectiveMatrix
+ );
+ frustum._infinitePerspective = Matrix2.Matrix4.computeInfinitePerspectiveOffCenter(
+ l,
+ r,
+ b,
+ t,
+ n,
+ frustum._infinitePerspective
+ );
+ }
+ }
+
+ Object.defineProperties(PerspectiveOffCenterFrustum.prototype, {
+ /**
+ * Gets the perspective projection matrix computed from the view frustum.
+ * @memberof PerspectiveOffCenterFrustum.prototype
+ * @type {Matrix4}
+ * @readonly
+ *
+ * @see PerspectiveOffCenterFrustum#infiniteProjectionMatrix
+ */
+ projectionMatrix: {
+ get: function () {
+ update$1(this);
+ return this._perspectiveMatrix;
+ },
+ },
+
+ /**
+ * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.
+ * @memberof PerspectiveOffCenterFrustum.prototype
+ * @type {Matrix4}
+ * @readonly
+ *
+ * @see PerspectiveOffCenterFrustum#projectionMatrix
+ */
+ infiniteProjectionMatrix: {
+ get: function () {
+ update$1(this);
+ return this._infinitePerspective;
+ },
+ },
+ });
+
+ const getPlanesRight = new Matrix3.Cartesian3();
+ const getPlanesNearCenter = new Matrix3.Cartesian3();
+ const getPlanesFarCenter = new Matrix3.Cartesian3();
+ const getPlanesNormal = new Matrix3.Cartesian3();
+ /**
+ * Creates a culling volume for this frustum.
+ *
+ * @param {Cartesian3} position The eye position.
+ * @param {Cartesian3} direction The view direction.
+ * @param {Cartesian3} up The up direction.
+ * @returns {CullingVolume} A culling volume at the given position and orientation.
+ *
+ * @example
+ * // Check if a bounding volume intersects the frustum.
+ * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
+ * const intersect = cullingVolume.computeVisibility(boundingVolume);
+ */
+ PerspectiveOffCenterFrustum.prototype.computeCullingVolume = function (
+ position,
+ direction,
+ up
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(position)) {
+ throw new Check.DeveloperError("position is required.");
+ }
+
+ if (!defaultValue.defined(direction)) {
+ throw new Check.DeveloperError("direction is required.");
+ }
+
+ if (!defaultValue.defined(up)) {
+ throw new Check.DeveloperError("up is required.");
+ }
+ //>>includeEnd('debug');
+
+ const planes = this._cullingVolume.planes;
+
+ const t = this.top;
+ const b = this.bottom;
+ const r = this.right;
+ const l = this.left;
+ const n = this.near;
+ const f = this.far;
+
+ const right = Matrix3.Cartesian3.cross(direction, up, getPlanesRight);
+
+ const nearCenter = getPlanesNearCenter;
+ Matrix3.Cartesian3.multiplyByScalar(direction, n, nearCenter);
+ Matrix3.Cartesian3.add(position, nearCenter, nearCenter);
+
+ const farCenter = getPlanesFarCenter;
+ Matrix3.Cartesian3.multiplyByScalar(direction, f, farCenter);
+ Matrix3.Cartesian3.add(position, farCenter, farCenter);
+
+ const normal = getPlanesNormal;
+
+ //Left plane computation
+ Matrix3.Cartesian3.multiplyByScalar(right, l, normal);
+ Matrix3.Cartesian3.add(nearCenter, normal, normal);
+ Matrix3.Cartesian3.subtract(normal, position, normal);
+ Matrix3.Cartesian3.normalize(normal, normal);
+ Matrix3.Cartesian3.cross(normal, up, normal);
+ Matrix3.Cartesian3.normalize(normal, normal);
+
+ let plane = planes[0];
+ if (!defaultValue.defined(plane)) {
+ plane = planes[0] = new Matrix2.Cartesian4();
+ }
+ plane.x = normal.x;
+ plane.y = normal.y;
+ plane.z = normal.z;
+ plane.w = -Matrix3.Cartesian3.dot(normal, position);
+
+ //Right plane computation
+ Matrix3.Cartesian3.multiplyByScalar(right, r, normal);
+ Matrix3.Cartesian3.add(nearCenter, normal, normal);
+ Matrix3.Cartesian3.subtract(normal, position, normal);
+ Matrix3.Cartesian3.cross(up, normal, normal);
+ Matrix3.Cartesian3.normalize(normal, normal);
+
+ plane = planes[1];
+ if (!defaultValue.defined(plane)) {
+ plane = planes[1] = new Matrix2.Cartesian4();
+ }
+ plane.x = normal.x;
+ plane.y = normal.y;
+ plane.z = normal.z;
+ plane.w = -Matrix3.Cartesian3.dot(normal, position);
+
+ //Bottom plane computation
+ Matrix3.Cartesian3.multiplyByScalar(up, b, normal);
+ Matrix3.Cartesian3.add(nearCenter, normal, normal);
+ Matrix3.Cartesian3.subtract(normal, position, normal);
+ Matrix3.Cartesian3.cross(right, normal, normal);
+ Matrix3.Cartesian3.normalize(normal, normal);
+
+ plane = planes[2];
+ if (!defaultValue.defined(plane)) {
+ plane = planes[2] = new Matrix2.Cartesian4();
+ }
+ plane.x = normal.x;
+ plane.y = normal.y;
+ plane.z = normal.z;
+ plane.w = -Matrix3.Cartesian3.dot(normal, position);
+
+ //Top plane computation
+ Matrix3.Cartesian3.multiplyByScalar(up, t, normal);
+ Matrix3.Cartesian3.add(nearCenter, normal, normal);
+ Matrix3.Cartesian3.subtract(normal, position, normal);
+ Matrix3.Cartesian3.cross(normal, right, normal);
+ Matrix3.Cartesian3.normalize(normal, normal);
+
+ plane = planes[3];
+ if (!defaultValue.defined(plane)) {
+ plane = planes[3] = new Matrix2.Cartesian4();
+ }
+ plane.x = normal.x;
+ plane.y = normal.y;
+ plane.z = normal.z;
+ plane.w = -Matrix3.Cartesian3.dot(normal, position);
+
+ //Near plane computation
+ plane = planes[4];
+ if (!defaultValue.defined(plane)) {
+ plane = planes[4] = new Matrix2.Cartesian4();
+ }
+ plane.x = direction.x;
+ plane.y = direction.y;
+ plane.z = direction.z;
+ plane.w = -Matrix3.Cartesian3.dot(direction, nearCenter);
+
+ //Far plane computation
+ Matrix3.Cartesian3.negate(direction, normal);
+
+ plane = planes[5];
+ if (!defaultValue.defined(plane)) {
+ plane = planes[5] = new Matrix2.Cartesian4();
+ }
+ plane.x = normal.x;
+ plane.y = normal.y;
+ plane.z = normal.z;
+ plane.w = -Matrix3.Cartesian3.dot(normal, farCenter);
+
+ return this._cullingVolume;
+ };
+
+ /**
+ * Returns the pixel's width and height in meters.
+ *
+ * @param {Number} drawingBufferWidth The width of the drawing buffer.
+ * @param {Number} drawingBufferHeight The height of the drawing buffer.
+ * @param {Number} distance The distance to the near plane in meters.
+ * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
+ *
+ * @exception {DeveloperError} drawingBufferWidth must be greater than zero.
+ * @exception {DeveloperError} drawingBufferHeight must be greater than zero.
+ * @exception {DeveloperError} pixelRatio must be greater than zero.
+ *
+ * @example
+ * // Example 1
+ * // Get the width and height of a pixel.
+ * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
+ *
+ * @example
+ * // Example 2
+ * // Get the width and height of a pixel if the near plane was set to 'distance'.
+ * // For example, get the size of a pixel of an image on a billboard.
+ * const position = camera.position;
+ * const direction = camera.direction;
+ * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
+ * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
+ * const distance = Cesium.Cartesian3.magnitude(toCenterProj);
+ * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
+ */
+ PerspectiveOffCenterFrustum.prototype.getPixelDimensions = function (
+ drawingBufferWidth,
+ drawingBufferHeight,
+ distance,
+ pixelRatio,
+ result
+ ) {
+ update$1(this);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(drawingBufferWidth) || !defaultValue.defined(drawingBufferHeight)) {
+ throw new Check.DeveloperError(
+ "Both drawingBufferWidth and drawingBufferHeight are required."
+ );
+ }
+ if (drawingBufferWidth <= 0) {
+ throw new Check.DeveloperError("drawingBufferWidth must be greater than zero.");
+ }
+ if (drawingBufferHeight <= 0) {
+ throw new Check.DeveloperError("drawingBufferHeight must be greater than zero.");
+ }
+ if (!defaultValue.defined(distance)) {
+ throw new Check.DeveloperError("distance is required.");
+ }
+ if (!defaultValue.defined(pixelRatio)) {
+ throw new Check.DeveloperError("pixelRatio is required");
+ }
+ if (pixelRatio <= 0) {
+ throw new Check.DeveloperError("pixelRatio must be greater than zero.");
+ }
+ if (!defaultValue.defined(result)) {
+ throw new Check.DeveloperError("A result object is required.");
+ }
+ //>>includeEnd('debug');
+
+ const inverseNear = 1.0 / this.near;
+ let tanTheta = this.top * inverseNear;
+ const pixelHeight =
+ (2.0 * pixelRatio * distance * tanTheta) / drawingBufferHeight;
+ tanTheta = this.right * inverseNear;
+ const pixelWidth =
+ (2.0 * pixelRatio * distance * tanTheta) / drawingBufferWidth;
+
+ result.x = pixelWidth;
+ result.y = pixelHeight;
+ return result;
+ };
+
+ /**
+ * Returns a duplicate of a PerspectiveOffCenterFrustum instance.
+ *
+ * @param {PerspectiveOffCenterFrustum} [result] The object onto which to store the result.
+ * @returns {PerspectiveOffCenterFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
+ */
+ PerspectiveOffCenterFrustum.prototype.clone = function (result) {
+ if (!defaultValue.defined(result)) {
+ result = new PerspectiveOffCenterFrustum();
+ }
+
+ result.right = this.right;
+ result.left = this.left;
+ result.top = this.top;
+ result.bottom = this.bottom;
+ result.near = this.near;
+ result.far = this.far;
+
+ // force update of clone to compute matrices
+ result._left = undefined;
+ result._right = undefined;
+ result._top = undefined;
+ result._bottom = undefined;
+ result._near = undefined;
+ result._far = undefined;
+
+ return result;
+ };
+
+ /**
+ * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {PerspectiveOffCenterFrustum} [other] The right hand side PerspectiveOffCenterFrustum.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ PerspectiveOffCenterFrustum.prototype.equals = function (other) {
+ return (
+ defaultValue.defined(other) &&
+ other instanceof PerspectiveOffCenterFrustum &&
+ this.right === other.right &&
+ this.left === other.left &&
+ this.top === other.top &&
+ this.bottom === other.bottom &&
+ this.near === other.near &&
+ this.far === other.far
+ );
+ };
+
+ /**
+ * Compares the provided PerspectiveOffCenterFrustum componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {PerspectiveOffCenterFrustum} other The right hand side PerspectiveOffCenterFrustum.
+ * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if this and other are within the provided epsilon, false
otherwise.
+ */
+ PerspectiveOffCenterFrustum.prototype.equalsEpsilon = function (
+ other,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ return (
+ other === this ||
+ (defaultValue.defined(other) &&
+ other instanceof PerspectiveOffCenterFrustum &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.right,
+ other.right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.left,
+ other.left,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.top,
+ other.top,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.bottom,
+ other.bottom,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.near,
+ other.near,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.far,
+ other.far,
+ relativeEpsilon,
+ absoluteEpsilon
+ ))
+ );
+ };
+
+ /**
+ * The viewing frustum is defined by 6 planes.
+ * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
+ * define the unit vector normal to the plane, and the w component is the distance of the
+ * plane from the origin/camera position.
+ *
+ * @alias PerspectiveFrustum
+ * @constructor
+ *
+ * @param {Object} [options] An object with the following properties:
+ * @param {Number} [options.fov] The angle of the field of view (FOV), in radians.
+ * @param {Number} [options.aspectRatio] The aspect ratio of the frustum's width to it's height.
+ * @param {Number} [options.near=1.0] The distance of the near plane.
+ * @param {Number} [options.far=500000000.0] The distance of the far plane.
+ * @param {Number} [options.xOffset=0.0] The offset in the x direction.
+ * @param {Number} [options.yOffset=0.0] The offset in the y direction.
+ *
+ * @example
+ * const frustum = new Cesium.PerspectiveFrustum({
+ * fov : Cesium.Math.PI_OVER_THREE,
+ * aspectRatio : canvas.clientWidth / canvas.clientHeight
+ * near : 1.0,
+ * far : 1000.0
+ * });
+ *
+ * @see PerspectiveOffCenterFrustum
+ */
+ function PerspectiveFrustum(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ this._offCenterFrustum = new PerspectiveOffCenterFrustum();
+
+ /**
+ * The angle of the field of view (FOV), in radians. This angle will be used
+ * as the horizontal FOV if the width is greater than the height, otherwise
+ * it will be the vertical FOV.
+ * @type {Number}
+ * @default undefined
+ */
+ this.fov = options.fov;
+ this._fov = undefined;
+ this._fovy = undefined;
+
+ this._sseDenominator = undefined;
+
+ /**
+ * The aspect ratio of the frustum's width to it's height.
+ * @type {Number}
+ * @default undefined
+ */
+ this.aspectRatio = options.aspectRatio;
+ this._aspectRatio = undefined;
+
+ /**
+ * The distance of the near plane.
+ * @type {Number}
+ * @default 1.0
+ */
+ this.near = defaultValue.defaultValue(options.near, 1.0);
+ this._near = this.near;
+
+ /**
+ * The distance of the far plane.
+ * @type {Number}
+ * @default 500000000.0
+ */
+ this.far = defaultValue.defaultValue(options.far, 500000000.0);
+ this._far = this.far;
+
+ /**
+ * Offsets the frustum in the x direction.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.xOffset = defaultValue.defaultValue(options.xOffset, 0.0);
+ this._xOffset = this.xOffset;
+
+ /**
+ * Offsets the frustum in the y direction.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.yOffset = defaultValue.defaultValue(options.yOffset, 0.0);
+ this._yOffset = this.yOffset;
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ PerspectiveFrustum.packedLength = 6;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {PerspectiveFrustum} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ PerspectiveFrustum.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value.fov;
+ array[startingIndex++] = value.aspectRatio;
+ array[startingIndex++] = value.near;
+ array[startingIndex++] = value.far;
+ array[startingIndex++] = value.xOffset;
+ array[startingIndex] = value.yOffset;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {PerspectiveFrustum} [result] The object into which to store the result.
+ * @returns {PerspectiveFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
+ */
+ PerspectiveFrustum.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new PerspectiveFrustum();
+ }
+
+ result.fov = array[startingIndex++];
+ result.aspectRatio = array[startingIndex++];
+ result.near = array[startingIndex++];
+ result.far = array[startingIndex++];
+ result.xOffset = array[startingIndex++];
+ result.yOffset = array[startingIndex];
+
+ return result;
+ };
+
+ function update(frustum) {
+ //>>includeStart('debug', pragmas.debug);
+ if (
+ !defaultValue.defined(frustum.fov) ||
+ !defaultValue.defined(frustum.aspectRatio) ||
+ !defaultValue.defined(frustum.near) ||
+ !defaultValue.defined(frustum.far)
+ ) {
+ throw new Check.DeveloperError(
+ "fov, aspectRatio, near, or far parameters are not set."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const f = frustum._offCenterFrustum;
+
+ if (
+ frustum.fov !== frustum._fov ||
+ frustum.aspectRatio !== frustum._aspectRatio ||
+ frustum.near !== frustum._near ||
+ frustum.far !== frustum._far ||
+ frustum.xOffset !== frustum._xOffset ||
+ frustum.yOffset !== frustum._yOffset
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (frustum.fov < 0 || frustum.fov >= Math.PI) {
+ throw new Check.DeveloperError("fov must be in the range [0, PI).");
+ }
+
+ if (frustum.aspectRatio < 0) {
+ throw new Check.DeveloperError("aspectRatio must be positive.");
+ }
+
+ if (frustum.near < 0 || frustum.near > frustum.far) {
+ throw new Check.DeveloperError(
+ "near must be greater than zero and less than far."
+ );
+ }
+ //>>includeEnd('debug');
+
+ frustum._aspectRatio = frustum.aspectRatio;
+ frustum._fov = frustum.fov;
+ frustum._fovy =
+ frustum.aspectRatio <= 1
+ ? frustum.fov
+ : Math.atan(Math.tan(frustum.fov * 0.5) / frustum.aspectRatio) * 2.0;
+ frustum._near = frustum.near;
+ frustum._far = frustum.far;
+ frustum._sseDenominator = 2.0 * Math.tan(0.5 * frustum._fovy);
+ frustum._xOffset = frustum.xOffset;
+ frustum._yOffset = frustum.yOffset;
+
+ f.top = frustum.near * Math.tan(0.5 * frustum._fovy);
+ f.bottom = -f.top;
+ f.right = frustum.aspectRatio * f.top;
+ f.left = -f.right;
+ f.near = frustum.near;
+ f.far = frustum.far;
+
+ f.right += frustum.xOffset;
+ f.left += frustum.xOffset;
+ f.top += frustum.yOffset;
+ f.bottom += frustum.yOffset;
+ }
+ }
+
+ Object.defineProperties(PerspectiveFrustum.prototype, {
+ /**
+ * Gets the perspective projection matrix computed from the view frustum.
+ * @memberof PerspectiveFrustum.prototype
+ * @type {Matrix4}
+ * @readonly
+ *
+ * @see PerspectiveFrustum#infiniteProjectionMatrix
+ */
+ projectionMatrix: {
+ get: function () {
+ update(this);
+ return this._offCenterFrustum.projectionMatrix;
+ },
+ },
+
+ /**
+ * The perspective projection matrix computed from the view frustum with an infinite far plane.
+ * @memberof PerspectiveFrustum.prototype
+ * @type {Matrix4}
+ * @readonly
+ *
+ * @see PerspectiveFrustum#projectionMatrix
+ */
+ infiniteProjectionMatrix: {
+ get: function () {
+ update(this);
+ return this._offCenterFrustum.infiniteProjectionMatrix;
+ },
+ },
+
+ /**
+ * Gets the angle of the vertical field of view, in radians.
+ * @memberof PerspectiveFrustum.prototype
+ * @type {Number}
+ * @readonly
+ * @default undefined
+ */
+ fovy: {
+ get: function () {
+ update(this);
+ return this._fovy;
+ },
+ },
+
+ /**
+ * @readonly
+ * @private
+ */
+ sseDenominator: {
+ get: function () {
+ update(this);
+ return this._sseDenominator;
+ },
+ },
+ });
+
+ /**
+ * Creates a culling volume for this frustum.
+ *
+ * @param {Cartesian3} position The eye position.
+ * @param {Cartesian3} direction The view direction.
+ * @param {Cartesian3} up The up direction.
+ * @returns {CullingVolume} A culling volume at the given position and orientation.
+ *
+ * @example
+ * // Check if a bounding volume intersects the frustum.
+ * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);
+ * const intersect = cullingVolume.computeVisibility(boundingVolume);
+ */
+ PerspectiveFrustum.prototype.computeCullingVolume = function (
+ position,
+ direction,
+ up
+ ) {
+ update(this);
+ return this._offCenterFrustum.computeCullingVolume(position, direction, up);
+ };
+
+ /**
+ * Returns the pixel's width and height in meters.
+ *
+ * @param {Number} drawingBufferWidth The width of the drawing buffer.
+ * @param {Number} drawingBufferHeight The height of the drawing buffer.
+ * @param {Number} distance The distance to the near plane in meters.
+ * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.
+ *
+ * @exception {DeveloperError} drawingBufferWidth must be greater than zero.
+ * @exception {DeveloperError} drawingBufferHeight must be greater than zero.
+ * @exception {DeveloperError} pixelRatio must be greater than zero.
+ *
+ * @example
+ * // Example 1
+ * // Get the width and height of a pixel.
+ * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());
+ *
+ * @example
+ * // Example 2
+ * // Get the width and height of a pixel if the near plane was set to 'distance'.
+ * // For example, get the size of a pixel of an image on a billboard.
+ * const position = camera.position;
+ * const direction = camera.direction;
+ * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive
+ * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector
+ * const distance = Cesium.Cartesian3.magnitude(toCenterProj);
+ * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());
+ */
+ PerspectiveFrustum.prototype.getPixelDimensions = function (
+ drawingBufferWidth,
+ drawingBufferHeight,
+ distance,
+ pixelRatio,
+ result
+ ) {
+ update(this);
+ return this._offCenterFrustum.getPixelDimensions(
+ drawingBufferWidth,
+ drawingBufferHeight,
+ distance,
+ pixelRatio,
+ result
+ );
+ };
+
+ /**
+ * Returns a duplicate of a PerspectiveFrustum instance.
+ *
+ * @param {PerspectiveFrustum} [result] The object onto which to store the result.
+ * @returns {PerspectiveFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.
+ */
+ PerspectiveFrustum.prototype.clone = function (result) {
+ if (!defaultValue.defined(result)) {
+ result = new PerspectiveFrustum();
+ }
+
+ result.aspectRatio = this.aspectRatio;
+ result.fov = this.fov;
+ result.near = this.near;
+ result.far = this.far;
+
+ // force update of clone to compute matrices
+ result._aspectRatio = undefined;
+ result._fov = undefined;
+ result._near = undefined;
+ result._far = undefined;
+
+ this._offCenterFrustum.clone(result._offCenterFrustum);
+
+ return result;
+ };
+
+ /**
+ * Compares the provided PerspectiveFrustum componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {PerspectiveFrustum} [other] The right hand side PerspectiveFrustum.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ PerspectiveFrustum.prototype.equals = function (other) {
+ if (!defaultValue.defined(other) || !(other instanceof PerspectiveFrustum)) {
+ return false;
+ }
+
+ update(this);
+ update(other);
+
+ return (
+ this.fov === other.fov &&
+ this.aspectRatio === other.aspectRatio &&
+ this._offCenterFrustum.equals(other._offCenterFrustum)
+ );
+ };
+
+ /**
+ * Compares the provided PerspectiveFrustum componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {PerspectiveFrustum} other The right hand side PerspectiveFrustum.
+ * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if this and other are within the provided epsilon, false
otherwise.
+ */
+ PerspectiveFrustum.prototype.equalsEpsilon = function (
+ other,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ if (!defaultValue.defined(other) || !(other instanceof PerspectiveFrustum)) {
+ return false;
+ }
+
+ update(this);
+ update(other);
+
+ return (
+ Math$1.CesiumMath.equalsEpsilon(
+ this.fov,
+ other.fov,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ this.aspectRatio,
+ other.aspectRatio,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ this._offCenterFrustum.equalsEpsilon(
+ other._offCenterFrustum,
+ relativeEpsilon,
+ absoluteEpsilon
+ )
+ );
+ };
+
+ const PERSPECTIVE = 0;
+ const ORTHOGRAPHIC = 1;
+
+ /**
+ * Describes a frustum at the given the origin and orientation.
+ *
+ * @alias FrustumGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.
+ * @param {Cartesian3} options.origin The origin of the frustum.
+ * @param {Quaternion} options.orientation The orientation of the frustum.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ */
+ function FrustumGeometry(options) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("options", options);
+ Check.Check.typeOf.object("options.frustum", options.frustum);
+ Check.Check.typeOf.object("options.origin", options.origin);
+ Check.Check.typeOf.object("options.orientation", options.orientation);
+ //>>includeEnd('debug');
+
+ const frustum = options.frustum;
+ const orientation = options.orientation;
+ const origin = options.origin;
+ const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
+
+ // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by
+ // creating multiple FrustumGeometrys. This way the near plane of one frustum doesn't overlap
+ // the far plane of another.
+ const drawNearPlane = defaultValue.defaultValue(options._drawNearPlane, true);
+
+ let frustumType;
+ let frustumPackedLength;
+ if (frustum instanceof PerspectiveFrustum) {
+ frustumType = PERSPECTIVE;
+ frustumPackedLength = PerspectiveFrustum.packedLength;
+ } else if (frustum instanceof OrthographicFrustum) {
+ frustumType = ORTHOGRAPHIC;
+ frustumPackedLength = OrthographicFrustum.packedLength;
+ }
+
+ this._frustumType = frustumType;
+ this._frustum = frustum.clone();
+ this._origin = Matrix3.Cartesian3.clone(origin);
+ this._orientation = Transforms.Quaternion.clone(orientation);
+ this._drawNearPlane = drawNearPlane;
+ this._vertexFormat = vertexFormat;
+ this._workerName = "createFrustumGeometry";
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ 2 +
+ frustumPackedLength +
+ Matrix3.Cartesian3.packedLength +
+ Transforms.Quaternion.packedLength +
+ VertexFormat.VertexFormat.packedLength;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {FrustumGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ FrustumGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const frustumType = value._frustumType;
+ const frustum = value._frustum;
+
+ array[startingIndex++] = frustumType;
+
+ if (frustumType === PERSPECTIVE) {
+ PerspectiveFrustum.pack(frustum, array, startingIndex);
+ startingIndex += PerspectiveFrustum.packedLength;
+ } else {
+ OrthographicFrustum.pack(frustum, array, startingIndex);
+ startingIndex += OrthographicFrustum.packedLength;
+ }
+
+ Matrix3.Cartesian3.pack(value._origin, array, startingIndex);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+ Transforms.Quaternion.pack(value._orientation, array, startingIndex);
+ startingIndex += Transforms.Quaternion.packedLength;
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+ array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;
+
+ return array;
+ };
+
+ const scratchPackPerspective = new PerspectiveFrustum();
+ const scratchPackOrthographic = new OrthographicFrustum();
+ const scratchPackQuaternion = new Transforms.Quaternion();
+ const scratchPackorigin = new Matrix3.Cartesian3();
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {FrustumGeometry} [result] The object into which to store the result.
+ */
+ FrustumGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const frustumType = array[startingIndex++];
+
+ let frustum;
+ if (frustumType === PERSPECTIVE) {
+ frustum = PerspectiveFrustum.unpack(
+ array,
+ startingIndex,
+ scratchPackPerspective
+ );
+ startingIndex += PerspectiveFrustum.packedLength;
+ } else {
+ frustum = OrthographicFrustum.unpack(
+ array,
+ startingIndex,
+ scratchPackOrthographic
+ );
+ startingIndex += OrthographicFrustum.packedLength;
+ }
+
+ const origin = Matrix3.Cartesian3.unpack(array, startingIndex, scratchPackorigin);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+ const orientation = Transforms.Quaternion.unpack(
+ array,
+ startingIndex,
+ scratchPackQuaternion
+ );
+ startingIndex += Transforms.Quaternion.packedLength;
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+ const drawNearPlane = array[startingIndex] === 1.0;
+
+ if (!defaultValue.defined(result)) {
+ return new FrustumGeometry({
+ frustum: frustum,
+ origin: origin,
+ orientation: orientation,
+ vertexFormat: vertexFormat,
+ _drawNearPlane: drawNearPlane,
+ });
+ }
+
+ const frustumResult =
+ frustumType === result._frustumType ? result._frustum : undefined;
+ result._frustum = frustum.clone(frustumResult);
+
+ result._frustumType = frustumType;
+ result._origin = Matrix3.Cartesian3.clone(origin, result._origin);
+ result._orientation = Transforms.Quaternion.clone(orientation, result._orientation);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._drawNearPlane = drawNearPlane;
+
+ return result;
+ };
+
+ function getAttributes(
+ offset,
+ normals,
+ tangents,
+ bitangents,
+ st,
+ normal,
+ tangent,
+ bitangent
+ ) {
+ const stOffset = (offset / 3) * 2;
+
+ for (let i = 0; i < 4; ++i) {
+ if (defaultValue.defined(normals)) {
+ normals[offset] = normal.x;
+ normals[offset + 1] = normal.y;
+ normals[offset + 2] = normal.z;
+ }
+ if (defaultValue.defined(tangents)) {
+ tangents[offset] = tangent.x;
+ tangents[offset + 1] = tangent.y;
+ tangents[offset + 2] = tangent.z;
+ }
+ if (defaultValue.defined(bitangents)) {
+ bitangents[offset] = bitangent.x;
+ bitangents[offset + 1] = bitangent.y;
+ bitangents[offset + 2] = bitangent.z;
+ }
+ offset += 3;
+ }
+
+ st[stOffset] = 0.0;
+ st[stOffset + 1] = 0.0;
+ st[stOffset + 2] = 1.0;
+ st[stOffset + 3] = 0.0;
+ st[stOffset + 4] = 1.0;
+ st[stOffset + 5] = 1.0;
+ st[stOffset + 6] = 0.0;
+ st[stOffset + 7] = 1.0;
+ }
+
+ const scratchRotationMatrix = new Matrix3.Matrix3();
+ const scratchViewMatrix = new Matrix2.Matrix4();
+ const scratchInverseMatrix = new Matrix2.Matrix4();
+
+ const scratchXDirection = new Matrix3.Cartesian3();
+ const scratchYDirection = new Matrix3.Cartesian3();
+ const scratchZDirection = new Matrix3.Cartesian3();
+ const scratchNegativeX = new Matrix3.Cartesian3();
+ const scratchNegativeY = new Matrix3.Cartesian3();
+ const scratchNegativeZ = new Matrix3.Cartesian3();
+
+ const frustumSplits = new Array(3);
+
+ const frustumCornersNDC = new Array(4);
+ frustumCornersNDC[0] = new Matrix2.Cartesian4(-1.0, -1.0, 1.0, 1.0);
+ frustumCornersNDC[1] = new Matrix2.Cartesian4(1.0, -1.0, 1.0, 1.0);
+ frustumCornersNDC[2] = new Matrix2.Cartesian4(1.0, 1.0, 1.0, 1.0);
+ frustumCornersNDC[3] = new Matrix2.Cartesian4(-1.0, 1.0, 1.0, 1.0);
+
+ const scratchFrustumCorners = new Array(4);
+ for (let i = 0; i < 4; ++i) {
+ scratchFrustumCorners[i] = new Matrix2.Cartesian4();
+ }
+
+ FrustumGeometry._computeNearFarPlanes = function (
+ origin,
+ orientation,
+ frustumType,
+ frustum,
+ positions,
+ xDirection,
+ yDirection,
+ zDirection
+ ) {
+ const rotationMatrix = Matrix3.Matrix3.fromQuaternion(
+ orientation,
+ scratchRotationMatrix
+ );
+ let x = defaultValue.defaultValue(xDirection, scratchXDirection);
+ let y = defaultValue.defaultValue(yDirection, scratchYDirection);
+ let z = defaultValue.defaultValue(zDirection, scratchZDirection);
+
+ x = Matrix3.Matrix3.getColumn(rotationMatrix, 0, x);
+ y = Matrix3.Matrix3.getColumn(rotationMatrix, 1, y);
+ z = Matrix3.Matrix3.getColumn(rotationMatrix, 2, z);
+
+ Matrix3.Cartesian3.normalize(x, x);
+ Matrix3.Cartesian3.normalize(y, y);
+ Matrix3.Cartesian3.normalize(z, z);
+
+ Matrix3.Cartesian3.negate(x, x);
+
+ const view = Matrix2.Matrix4.computeView(origin, z, y, x, scratchViewMatrix);
+
+ let inverseView;
+ let inverseViewProjection;
+ if (frustumType === PERSPECTIVE) {
+ const projection = frustum.projectionMatrix;
+ const viewProjection = Matrix2.Matrix4.multiply(
+ projection,
+ view,
+ scratchInverseMatrix
+ );
+ inverseViewProjection = Matrix2.Matrix4.inverse(
+ viewProjection,
+ scratchInverseMatrix
+ );
+ } else {
+ inverseView = Matrix2.Matrix4.inverseTransformation(view, scratchInverseMatrix);
+ }
+
+ if (defaultValue.defined(inverseViewProjection)) {
+ frustumSplits[0] = frustum.near;
+ frustumSplits[1] = frustum.far;
+ } else {
+ frustumSplits[0] = 0.0;
+ frustumSplits[1] = frustum.near;
+ frustumSplits[2] = frustum.far;
+ }
+
+ for (let i = 0; i < 2; ++i) {
+ for (let j = 0; j < 4; ++j) {
+ let corner = Matrix2.Cartesian4.clone(
+ frustumCornersNDC[j],
+ scratchFrustumCorners[j]
+ );
+
+ if (!defaultValue.defined(inverseViewProjection)) {
+ if (defaultValue.defined(frustum._offCenterFrustum)) {
+ frustum = frustum._offCenterFrustum;
+ }
+
+ const near = frustumSplits[i];
+ const far = frustumSplits[i + 1];
+
+ corner.x =
+ (corner.x * (frustum.right - frustum.left) +
+ frustum.left +
+ frustum.right) *
+ 0.5;
+ corner.y =
+ (corner.y * (frustum.top - frustum.bottom) +
+ frustum.bottom +
+ frustum.top) *
+ 0.5;
+ corner.z = (corner.z * (near - far) - near - far) * 0.5;
+ corner.w = 1.0;
+
+ Matrix2.Matrix4.multiplyByVector(inverseView, corner, corner);
+ } else {
+ corner = Matrix2.Matrix4.multiplyByVector(
+ inverseViewProjection,
+ corner,
+ corner
+ );
+
+ // Reverse perspective divide
+ const w = 1.0 / corner.w;
+ Matrix3.Cartesian3.multiplyByScalar(corner, w, corner);
+
+ Matrix3.Cartesian3.subtract(corner, origin, corner);
+ Matrix3.Cartesian3.normalize(corner, corner);
+
+ const fac = Matrix3.Cartesian3.dot(z, corner);
+ Matrix3.Cartesian3.multiplyByScalar(corner, frustumSplits[i] / fac, corner);
+ Matrix3.Cartesian3.add(corner, origin, corner);
+ }
+
+ positions[12 * i + j * 3] = corner.x;
+ positions[12 * i + j * 3 + 1] = corner.y;
+ positions[12 * i + j * 3 + 2] = corner.z;
+ }
+ }
+ };
+
+ /**
+ * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {FrustumGeometry} frustumGeometry A description of the frustum.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ FrustumGeometry.createGeometry = function (frustumGeometry) {
+ const frustumType = frustumGeometry._frustumType;
+ const frustum = frustumGeometry._frustum;
+ const origin = frustumGeometry._origin;
+ const orientation = frustumGeometry._orientation;
+ const drawNearPlane = frustumGeometry._drawNearPlane;
+ const vertexFormat = frustumGeometry._vertexFormat;
+
+ const numberOfPlanes = drawNearPlane ? 6 : 5;
+ let positions = new Float64Array(3 * 4 * 6);
+ FrustumGeometry._computeNearFarPlanes(
+ origin,
+ orientation,
+ frustumType,
+ frustum,
+ positions
+ );
+
+ // -x plane
+ let offset = 3 * 4 * 2;
+ positions[offset] = positions[3 * 4];
+ positions[offset + 1] = positions[3 * 4 + 1];
+ positions[offset + 2] = positions[3 * 4 + 2];
+ positions[offset + 3] = positions[0];
+ positions[offset + 4] = positions[1];
+ positions[offset + 5] = positions[2];
+ positions[offset + 6] = positions[3 * 3];
+ positions[offset + 7] = positions[3 * 3 + 1];
+ positions[offset + 8] = positions[3 * 3 + 2];
+ positions[offset + 9] = positions[3 * 7];
+ positions[offset + 10] = positions[3 * 7 + 1];
+ positions[offset + 11] = positions[3 * 7 + 2];
+
+ // -y plane
+ offset += 3 * 4;
+ positions[offset] = positions[3 * 5];
+ positions[offset + 1] = positions[3 * 5 + 1];
+ positions[offset + 2] = positions[3 * 5 + 2];
+ positions[offset + 3] = positions[3];
+ positions[offset + 4] = positions[3 + 1];
+ positions[offset + 5] = positions[3 + 2];
+ positions[offset + 6] = positions[0];
+ positions[offset + 7] = positions[1];
+ positions[offset + 8] = positions[2];
+ positions[offset + 9] = positions[3 * 4];
+ positions[offset + 10] = positions[3 * 4 + 1];
+ positions[offset + 11] = positions[3 * 4 + 2];
+
+ // +x plane
+ offset += 3 * 4;
+ positions[offset] = positions[3];
+ positions[offset + 1] = positions[3 + 1];
+ positions[offset + 2] = positions[3 + 2];
+ positions[offset + 3] = positions[3 * 5];
+ positions[offset + 4] = positions[3 * 5 + 1];
+ positions[offset + 5] = positions[3 * 5 + 2];
+ positions[offset + 6] = positions[3 * 6];
+ positions[offset + 7] = positions[3 * 6 + 1];
+ positions[offset + 8] = positions[3 * 6 + 2];
+ positions[offset + 9] = positions[3 * 2];
+ positions[offset + 10] = positions[3 * 2 + 1];
+ positions[offset + 11] = positions[3 * 2 + 2];
+
+ // +y plane
+ offset += 3 * 4;
+ positions[offset] = positions[3 * 2];
+ positions[offset + 1] = positions[3 * 2 + 1];
+ positions[offset + 2] = positions[3 * 2 + 2];
+ positions[offset + 3] = positions[3 * 6];
+ positions[offset + 4] = positions[3 * 6 + 1];
+ positions[offset + 5] = positions[3 * 6 + 2];
+ positions[offset + 6] = positions[3 * 7];
+ positions[offset + 7] = positions[3 * 7 + 1];
+ positions[offset + 8] = positions[3 * 7 + 2];
+ positions[offset + 9] = positions[3 * 3];
+ positions[offset + 10] = positions[3 * 3 + 1];
+ positions[offset + 11] = positions[3 * 3 + 2];
+
+ if (!drawNearPlane) {
+ positions = positions.subarray(3 * 4);
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes({
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ }),
+ });
+
+ if (
+ defaultValue.defined(vertexFormat.normal) ||
+ defaultValue.defined(vertexFormat.tangent) ||
+ defaultValue.defined(vertexFormat.bitangent) ||
+ defaultValue.defined(vertexFormat.st)
+ ) {
+ const normals = defaultValue.defined(vertexFormat.normal)
+ ? new Float32Array(3 * 4 * numberOfPlanes)
+ : undefined;
+ const tangents = defaultValue.defined(vertexFormat.tangent)
+ ? new Float32Array(3 * 4 * numberOfPlanes)
+ : undefined;
+ const bitangents = defaultValue.defined(vertexFormat.bitangent)
+ ? new Float32Array(3 * 4 * numberOfPlanes)
+ : undefined;
+ const st = defaultValue.defined(vertexFormat.st)
+ ? new Float32Array(2 * 4 * numberOfPlanes)
+ : undefined;
+
+ const x = scratchXDirection;
+ const y = scratchYDirection;
+ const z = scratchZDirection;
+
+ const negativeX = Matrix3.Cartesian3.negate(x, scratchNegativeX);
+ const negativeY = Matrix3.Cartesian3.negate(y, scratchNegativeY);
+ const negativeZ = Matrix3.Cartesian3.negate(z, scratchNegativeZ);
+
+ offset = 0;
+ if (drawNearPlane) {
+ getAttributes(offset, normals, tangents, bitangents, st, negativeZ, x, y); // near
+ offset += 3 * 4;
+ }
+ getAttributes(offset, normals, tangents, bitangents, st, z, negativeX, y); // far
+ offset += 3 * 4;
+ getAttributes(
+ offset,
+ normals,
+ tangents,
+ bitangents,
+ st,
+ negativeX,
+ negativeZ,
+ y
+ ); // -x
+ offset += 3 * 4;
+ getAttributes(
+ offset,
+ normals,
+ tangents,
+ bitangents,
+ st,
+ negativeY,
+ negativeZ,
+ negativeX
+ ); // -y
+ offset += 3 * 4;
+ getAttributes(offset, normals, tangents, bitangents, st, x, z, y); // +x
+ offset += 3 * 4;
+ getAttributes(offset, normals, tangents, bitangents, st, y, z, negativeX); // +y
+
+ if (defaultValue.defined(normals)) {
+ attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals,
+ });
+ }
+ if (defaultValue.defined(tangents)) {
+ attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents,
+ });
+ }
+ if (defaultValue.defined(bitangents)) {
+ attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents,
+ });
+ }
+ if (defaultValue.defined(st)) {
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: st,
+ });
+ }
+ }
+
+ const indices = new Uint16Array(6 * numberOfPlanes);
+ for (let i = 0; i < numberOfPlanes; ++i) {
+ const indexOffset = i * 6;
+ const index = i * 4;
+
+ indices[indexOffset] = index;
+ indices[indexOffset + 1] = index + 1;
+ indices[indexOffset + 2] = index + 2;
+ indices[indexOffset + 3] = index;
+ indices[indexOffset + 4] = index + 2;
+ indices[indexOffset + 5] = index + 3;
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ boundingSphere: Transforms.BoundingSphere.fromVertices(positions),
+ });
+ };
+
+ exports.FrustumGeometry = FrustumGeometry;
+ exports.OrthographicFrustum = OrthographicFrustum;
+ exports.PerspectiveFrustum = PerspectiveFrustum;
+
+}));
+//# sourceMappingURL=FrustumGeometry-f3f058a2.js.map
diff --git a/examples/cesium/Workers/FrustumGeometry-f3f058a2.js.map b/examples/cesium/Workers/FrustumGeometry-f3f058a2.js.map
new file mode 100644
index 0000000..5e791ac
--- /dev/null
+++ b/examples/cesium/Workers/FrustumGeometry-f3f058a2.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"FrustumGeometry-f3f058a2.js","sources":["../../../Source/Core/CullingVolume.js","../../../Source/Core/OrthographicOffCenterFrustum.js","../../../Source/Core/OrthographicFrustum.js","../../../Source/Core/PerspectiveOffCenterFrustum.js","../../../Source/Core/PerspectiveFrustum.js","../../../Source/Core/FrustumGeometry.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartesian4 from \"./Cartesian4.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Intersect from \"./Intersect.js\";\r\nimport Plane from \"./Plane.js\";\r\n\r\n/**\r\n * The culling volume defined by planes.\r\n *\r\n * @alias CullingVolume\r\n * @constructor\r\n *\r\n * @param {Cartesian4[]} [planes] An array of clipping planes.\r\n */\r\nfunction CullingVolume(planes) {\r\n /**\r\n * Each plane is represented by a Cartesian4 object, where the x, y, and z components\r\n * define the unit vector normal to the plane, and the w component is the distance of the\r\n * plane from the origin.\r\n * @type {Cartesian4[]}\r\n * @default []\r\n */\r\n this.planes = defaultValue(planes, []);\r\n}\r\n\r\nconst faces = [new Cartesian3(), new Cartesian3(), new Cartesian3()];\r\nCartesian3.clone(Cartesian3.UNIT_X, faces[0]);\r\nCartesian3.clone(Cartesian3.UNIT_Y, faces[1]);\r\nCartesian3.clone(Cartesian3.UNIT_Z, faces[2]);\r\n\r\nconst scratchPlaneCenter = new Cartesian3();\r\nconst scratchPlaneNormal = new Cartesian3();\r\nconst scratchPlane = new Plane(new Cartesian3(1.0, 0.0, 0.0), 0.0);\r\n\r\n/**\r\n * Constructs a culling volume from a bounding sphere. Creates six planes that create a box containing the sphere.\r\n * The planes are aligned to the x, y, and z axes in world coordinates.\r\n *\r\n * @param {BoundingSphere} boundingSphere The bounding sphere used to create the culling volume.\r\n * @param {CullingVolume} [result] The object onto which to store the result.\r\n * @returns {CullingVolume} The culling volume created from the bounding sphere.\r\n */\r\nCullingVolume.fromBoundingSphere = function (boundingSphere, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(boundingSphere)) {\r\n throw new DeveloperError(\"boundingSphere is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new CullingVolume();\r\n }\r\n\r\n const length = faces.length;\r\n const planes = result.planes;\r\n planes.length = 2 * length;\r\n\r\n const center = boundingSphere.center;\r\n const radius = boundingSphere.radius;\r\n\r\n let planeIndex = 0;\r\n\r\n for (let i = 0; i < length; ++i) {\r\n const faceNormal = faces[i];\r\n\r\n let plane0 = planes[planeIndex];\r\n let plane1 = planes[planeIndex + 1];\r\n\r\n if (!defined(plane0)) {\r\n plane0 = planes[planeIndex] = new Cartesian4();\r\n }\r\n if (!defined(plane1)) {\r\n plane1 = planes[planeIndex + 1] = new Cartesian4();\r\n }\r\n\r\n Cartesian3.multiplyByScalar(faceNormal, -radius, scratchPlaneCenter);\r\n Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter);\r\n\r\n plane0.x = faceNormal.x;\r\n plane0.y = faceNormal.y;\r\n plane0.z = faceNormal.z;\r\n plane0.w = -Cartesian3.dot(faceNormal, scratchPlaneCenter);\r\n\r\n Cartesian3.multiplyByScalar(faceNormal, radius, scratchPlaneCenter);\r\n Cartesian3.add(center, scratchPlaneCenter, scratchPlaneCenter);\r\n\r\n plane1.x = -faceNormal.x;\r\n plane1.y = -faceNormal.y;\r\n plane1.z = -faceNormal.z;\r\n plane1.w = -Cartesian3.dot(\r\n Cartesian3.negate(faceNormal, scratchPlaneNormal),\r\n scratchPlaneCenter\r\n );\r\n\r\n planeIndex += 2;\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Determines whether a bounding volume intersects the culling volume.\r\n *\r\n * @param {Object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested.\r\n * @returns {Intersect} Intersect.OUTSIDE, Intersect.INTERSECTING, or Intersect.INSIDE.\r\n */\r\nCullingVolume.prototype.computeVisibility = function (boundingVolume) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(boundingVolume)) {\r\n throw new DeveloperError(\"boundingVolume is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const planes = this.planes;\r\n let intersecting = false;\r\n for (let k = 0, len = planes.length; k < len; ++k) {\r\n const result = boundingVolume.intersectPlane(\r\n Plane.fromCartesian4(planes[k], scratchPlane)\r\n );\r\n if (result === Intersect.OUTSIDE) {\r\n return Intersect.OUTSIDE;\r\n } else if (result === Intersect.INTERSECTING) {\r\n intersecting = true;\r\n }\r\n }\r\n\r\n return intersecting ? Intersect.INTERSECTING : Intersect.INSIDE;\r\n};\r\n\r\n/**\r\n * Determines whether a bounding volume intersects the culling volume.\r\n *\r\n * @param {Object} boundingVolume The bounding volume whose intersection with the culling volume is to be tested.\r\n * @param {Number} parentPlaneMask A bit mask from the boundingVolume's parent's check against the same culling\r\n * volume, such that if (planeMask & (1 << planeIndex) === 0), for k < 31, then\r\n * the parent (and therefore this) volume is completely inside plane[planeIndex]\r\n * and that plane check can be skipped.\r\n * @returns {Number} A plane mask as described above (which can be applied to this boundingVolume's children).\r\n *\r\n * @private\r\n */\r\nCullingVolume.prototype.computeVisibilityWithPlaneMask = function (\r\n boundingVolume,\r\n parentPlaneMask\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(boundingVolume)) {\r\n throw new DeveloperError(\"boundingVolume is required.\");\r\n }\r\n if (!defined(parentPlaneMask)) {\r\n throw new DeveloperError(\"parentPlaneMask is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (\r\n parentPlaneMask === CullingVolume.MASK_OUTSIDE ||\r\n parentPlaneMask === CullingVolume.MASK_INSIDE\r\n ) {\r\n // parent is completely outside or completely inside, so this child is as well.\r\n return parentPlaneMask;\r\n }\r\n\r\n // Start with MASK_INSIDE (all zeros) so that after the loop, the return value can be compared with MASK_INSIDE.\r\n // (Because if there are fewer than 31 planes, the upper bits wont be changed.)\r\n let mask = CullingVolume.MASK_INSIDE;\r\n\r\n const planes = this.planes;\r\n for (let k = 0, len = planes.length; k < len; ++k) {\r\n // For k greater than 31 (since 31 is the maximum number of INSIDE/INTERSECTING bits we can store), skip the optimization.\r\n const flag = k < 31 ? 1 << k : 0;\r\n if (k < 31 && (parentPlaneMask & flag) === 0) {\r\n // boundingVolume is known to be INSIDE this plane.\r\n continue;\r\n }\r\n\r\n const result = boundingVolume.intersectPlane(\r\n Plane.fromCartesian4(planes[k], scratchPlane)\r\n );\r\n if (result === Intersect.OUTSIDE) {\r\n return CullingVolume.MASK_OUTSIDE;\r\n } else if (result === Intersect.INTERSECTING) {\r\n mask |= flag;\r\n }\r\n }\r\n\r\n return mask;\r\n};\r\n\r\n/**\r\n * For plane masks (as used in {@link CullingVolume#computeVisibilityWithPlaneMask}), this special value\r\n * represents the case where the object bounding volume is entirely outside the culling volume.\r\n *\r\n * @type {Number}\r\n * @private\r\n */\r\nCullingVolume.MASK_OUTSIDE = 0xffffffff;\r\n\r\n/**\r\n * For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value\r\n * represents the case where the object bounding volume is entirely inside the culling volume.\r\n *\r\n * @type {Number}\r\n * @private\r\n */\r\nCullingVolume.MASK_INSIDE = 0x00000000;\r\n\r\n/**\r\n * For plane masks (as used in {@link CullingVolume.prototype.computeVisibilityWithPlaneMask}), this value\r\n * represents the case where the object bounding volume (may) intersect all planes of the culling volume.\r\n *\r\n * @type {Number}\r\n * @private\r\n */\r\nCullingVolume.MASK_INDETERMINATE = 0x7fffffff;\r\nexport default CullingVolume;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartesian4 from \"./Cartesian4.js\";\r\nimport CullingVolume from \"./CullingVolume.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\n\r\n/**\r\n * The viewing frustum is defined by 6 planes.\r\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\r\n * define the unit vector normal to the plane, and the w component is the distance of the\r\n * plane from the origin/camera position.\r\n *\r\n * @alias OrthographicOffCenterFrustum\r\n * @constructor\r\n *\r\n * @param {Object} [options] An object with the following properties:\r\n * @param {Number} [options.left] The left clipping plane distance.\r\n * @param {Number} [options.right] The right clipping plane distance.\r\n * @param {Number} [options.top] The top clipping plane distance.\r\n * @param {Number} [options.bottom] The bottom clipping plane distance.\r\n * @param {Number} [options.near=1.0] The near clipping plane distance.\r\n * @param {Number} [options.far=500000000.0] The far clipping plane distance.\r\n *\r\n * @example\r\n * const maxRadii = ellipsoid.maximumRadius;\r\n *\r\n * const frustum = new Cesium.OrthographicOffCenterFrustum();\r\n * frustum.right = maxRadii * Cesium.Math.PI;\r\n * frustum.left = -c.frustum.right;\r\n * frustum.top = c.frustum.right * (canvas.clientHeight / canvas.clientWidth);\r\n * frustum.bottom = -c.frustum.top;\r\n * frustum.near = 0.01 * maxRadii;\r\n * frustum.far = 50.0 * maxRadii;\r\n */\r\nfunction OrthographicOffCenterFrustum(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n /**\r\n * The left clipping plane.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.left = options.left;\r\n this._left = undefined;\r\n\r\n /**\r\n * The right clipping plane.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.right = options.right;\r\n this._right = undefined;\r\n\r\n /**\r\n * The top clipping plane.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.top = options.top;\r\n this._top = undefined;\r\n\r\n /**\r\n * The bottom clipping plane.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.bottom = options.bottom;\r\n this._bottom = undefined;\r\n\r\n /**\r\n * The distance of the near plane.\r\n * @type {Number}\r\n * @default 1.0\r\n */\r\n this.near = defaultValue(options.near, 1.0);\r\n this._near = this.near;\r\n\r\n /**\r\n * The distance of the far plane.\r\n * @type {Number}\r\n * @default 500000000.0;\r\n */\r\n this.far = defaultValue(options.far, 500000000.0);\r\n this._far = this.far;\r\n\r\n this._cullingVolume = new CullingVolume();\r\n this._orthographicMatrix = new Matrix4();\r\n}\r\n\r\nfunction update(frustum) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n !defined(frustum.right) ||\r\n !defined(frustum.left) ||\r\n !defined(frustum.top) ||\r\n !defined(frustum.bottom) ||\r\n !defined(frustum.near) ||\r\n !defined(frustum.far)\r\n ) {\r\n throw new DeveloperError(\r\n \"right, left, top, bottom, near, or far parameters are not set.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (\r\n frustum.top !== frustum._top ||\r\n frustum.bottom !== frustum._bottom ||\r\n frustum.left !== frustum._left ||\r\n frustum.right !== frustum._right ||\r\n frustum.near !== frustum._near ||\r\n frustum.far !== frustum._far\r\n ) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (frustum.left > frustum.right) {\r\n throw new DeveloperError(\"right must be greater than left.\");\r\n }\r\n if (frustum.bottom > frustum.top) {\r\n throw new DeveloperError(\"top must be greater than bottom.\");\r\n }\r\n if (frustum.near <= 0 || frustum.near > frustum.far) {\r\n throw new DeveloperError(\r\n \"near must be greater than zero and less than far.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n frustum._left = frustum.left;\r\n frustum._right = frustum.right;\r\n frustum._top = frustum.top;\r\n frustum._bottom = frustum.bottom;\r\n frustum._near = frustum.near;\r\n frustum._far = frustum.far;\r\n frustum._orthographicMatrix = Matrix4.computeOrthographicOffCenter(\r\n frustum.left,\r\n frustum.right,\r\n frustum.bottom,\r\n frustum.top,\r\n frustum.near,\r\n frustum.far,\r\n frustum._orthographicMatrix\r\n );\r\n }\r\n}\r\n\r\nObject.defineProperties(OrthographicOffCenterFrustum.prototype, {\r\n /**\r\n * Gets the orthographic projection matrix computed from the view frustum.\r\n * @memberof OrthographicOffCenterFrustum.prototype\r\n * @type {Matrix4}\r\n * @readonly\r\n */\r\n projectionMatrix: {\r\n get: function () {\r\n update(this);\r\n return this._orthographicMatrix;\r\n },\r\n },\r\n});\r\n\r\nconst getPlanesRight = new Cartesian3();\r\nconst getPlanesNearCenter = new Cartesian3();\r\nconst getPlanesPoint = new Cartesian3();\r\nconst negateScratch = new Cartesian3();\r\n\r\n/**\r\n * Creates a culling volume for this frustum.\r\n *\r\n * @param {Cartesian3} position The eye position.\r\n * @param {Cartesian3} direction The view direction.\r\n * @param {Cartesian3} up The up direction.\r\n * @returns {CullingVolume} A culling volume at the given position and orientation.\r\n *\r\n * @example\r\n * // Check if a bounding volume intersects the frustum.\r\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\r\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\r\n */\r\nOrthographicOffCenterFrustum.prototype.computeCullingVolume = function (\r\n position,\r\n direction,\r\n up\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(position)) {\r\n throw new DeveloperError(\"position is required.\");\r\n }\r\n if (!defined(direction)) {\r\n throw new DeveloperError(\"direction is required.\");\r\n }\r\n if (!defined(up)) {\r\n throw new DeveloperError(\"up is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const planes = this._cullingVolume.planes;\r\n const t = this.top;\r\n const b = this.bottom;\r\n const r = this.right;\r\n const l = this.left;\r\n const n = this.near;\r\n const f = this.far;\r\n\r\n const right = Cartesian3.cross(direction, up, getPlanesRight);\r\n Cartesian3.normalize(right, right);\r\n const nearCenter = getPlanesNearCenter;\r\n Cartesian3.multiplyByScalar(direction, n, nearCenter);\r\n Cartesian3.add(position, nearCenter, nearCenter);\r\n\r\n const point = getPlanesPoint;\r\n\r\n // Left plane\r\n Cartesian3.multiplyByScalar(right, l, point);\r\n Cartesian3.add(nearCenter, point, point);\r\n\r\n let plane = planes[0];\r\n if (!defined(plane)) {\r\n plane = planes[0] = new Cartesian4();\r\n }\r\n plane.x = right.x;\r\n plane.y = right.y;\r\n plane.z = right.z;\r\n plane.w = -Cartesian3.dot(right, point);\r\n\r\n // Right plane\r\n Cartesian3.multiplyByScalar(right, r, point);\r\n Cartesian3.add(nearCenter, point, point);\r\n\r\n plane = planes[1];\r\n if (!defined(plane)) {\r\n plane = planes[1] = new Cartesian4();\r\n }\r\n plane.x = -right.x;\r\n plane.y = -right.y;\r\n plane.z = -right.z;\r\n plane.w = -Cartesian3.dot(Cartesian3.negate(right, negateScratch), point);\r\n\r\n // Bottom plane\r\n Cartesian3.multiplyByScalar(up, b, point);\r\n Cartesian3.add(nearCenter, point, point);\r\n\r\n plane = planes[2];\r\n if (!defined(plane)) {\r\n plane = planes[2] = new Cartesian4();\r\n }\r\n plane.x = up.x;\r\n plane.y = up.y;\r\n plane.z = up.z;\r\n plane.w = -Cartesian3.dot(up, point);\r\n\r\n // Top plane\r\n Cartesian3.multiplyByScalar(up, t, point);\r\n Cartesian3.add(nearCenter, point, point);\r\n\r\n plane = planes[3];\r\n if (!defined(plane)) {\r\n plane = planes[3] = new Cartesian4();\r\n }\r\n plane.x = -up.x;\r\n plane.y = -up.y;\r\n plane.z = -up.z;\r\n plane.w = -Cartesian3.dot(Cartesian3.negate(up, negateScratch), point);\r\n\r\n // Near plane\r\n plane = planes[4];\r\n if (!defined(plane)) {\r\n plane = planes[4] = new Cartesian4();\r\n }\r\n plane.x = direction.x;\r\n plane.y = direction.y;\r\n plane.z = direction.z;\r\n plane.w = -Cartesian3.dot(direction, nearCenter);\r\n\r\n // Far plane\r\n Cartesian3.multiplyByScalar(direction, f, point);\r\n Cartesian3.add(position, point, point);\r\n\r\n plane = planes[5];\r\n if (!defined(plane)) {\r\n plane = planes[5] = new Cartesian4();\r\n }\r\n plane.x = -direction.x;\r\n plane.y = -direction.y;\r\n plane.z = -direction.z;\r\n plane.w = -Cartesian3.dot(Cartesian3.negate(direction, negateScratch), point);\r\n\r\n return this._cullingVolume;\r\n};\r\n\r\n/**\r\n * Returns the pixel's width and height in meters.\r\n *\r\n * @param {Number} drawingBufferWidth The width of the drawing buffer.\r\n * @param {Number} drawingBufferHeight The height of the drawing buffer.\r\n * @param {Number} distance The distance to the near plane in meters.\r\n * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\r\n *\r\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\r\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\r\n * @exception {DeveloperError} pixelRatio must be greater than zero.\r\n *\r\n * @example\r\n * // Example 1\r\n * // Get the width and height of a pixel.\r\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());\r\n */\r\nOrthographicOffCenterFrustum.prototype.getPixelDimensions = function (\r\n drawingBufferWidth,\r\n drawingBufferHeight,\r\n distance,\r\n pixelRatio,\r\n result\r\n) {\r\n update(this);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(drawingBufferWidth) || !defined(drawingBufferHeight)) {\r\n throw new DeveloperError(\r\n \"Both drawingBufferWidth and drawingBufferHeight are required.\"\r\n );\r\n }\r\n if (drawingBufferWidth <= 0) {\r\n throw new DeveloperError(\"drawingBufferWidth must be greater than zero.\");\r\n }\r\n if (drawingBufferHeight <= 0) {\r\n throw new DeveloperError(\"drawingBufferHeight must be greater than zero.\");\r\n }\r\n if (!defined(distance)) {\r\n throw new DeveloperError(\"distance is required.\");\r\n }\r\n if (!defined(pixelRatio)) {\r\n throw new DeveloperError(\"pixelRatio is required.\");\r\n }\r\n if (pixelRatio <= 0) {\r\n throw new DeveloperError(\"pixelRatio must be greater than zero.\");\r\n }\r\n if (!defined(result)) {\r\n throw new DeveloperError(\"A result object is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const frustumWidth = this.right - this.left;\r\n const frustumHeight = this.top - this.bottom;\r\n const pixelWidth = (pixelRatio * frustumWidth) / drawingBufferWidth;\r\n const pixelHeight = (pixelRatio * frustumHeight) / drawingBufferHeight;\r\n\r\n result.x = pixelWidth;\r\n result.y = pixelHeight;\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns a duplicate of a OrthographicOffCenterFrustum instance.\r\n *\r\n * @param {OrthographicOffCenterFrustum} [result] The object onto which to store the result.\r\n * @returns {OrthographicOffCenterFrustum} The modified result parameter or a new OrthographicOffCenterFrustum instance if one was not provided.\r\n */\r\nOrthographicOffCenterFrustum.prototype.clone = function (result) {\r\n if (!defined(result)) {\r\n result = new OrthographicOffCenterFrustum();\r\n }\r\n\r\n result.left = this.left;\r\n result.right = this.right;\r\n result.top = this.top;\r\n result.bottom = this.bottom;\r\n result.near = this.near;\r\n result.far = this.far;\r\n\r\n // force update of clone to compute matrices\r\n result._left = undefined;\r\n result._right = undefined;\r\n result._top = undefined;\r\n result._bottom = undefined;\r\n result._near = undefined;\r\n result._far = undefined;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided OrthographicOffCenterFrustum componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {OrthographicOffCenterFrustum} [other] The right hand side OrthographicOffCenterFrustum.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nOrthographicOffCenterFrustum.prototype.equals = function (other) {\r\n return (\r\n defined(other) &&\r\n other instanceof OrthographicOffCenterFrustum &&\r\n this.right === other.right &&\r\n this.left === other.left &&\r\n this.top === other.top &&\r\n this.bottom === other.bottom &&\r\n this.near === other.near &&\r\n this.far === other.far\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided OrthographicOffCenterFrustum componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {OrthographicOffCenterFrustum} other The right hand side OrthographicOffCenterFrustum.\r\n * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if this and other are within the provided epsilon, false
otherwise.\r\n */\r\nOrthographicOffCenterFrustum.prototype.equalsEpsilon = function (\r\n other,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n return (\r\n other === this ||\r\n (defined(other) &&\r\n other instanceof OrthographicOffCenterFrustum &&\r\n CesiumMath.equalsEpsilon(\r\n this.right,\r\n other.right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.left,\r\n other.left,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.top,\r\n other.top,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.bottom,\r\n other.bottom,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.near,\r\n other.near,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.far,\r\n other.far,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ))\r\n );\r\n};\r\nexport default OrthographicOffCenterFrustum;\r\n","import Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport OrthographicOffCenterFrustum from \"./OrthographicOffCenterFrustum.js\";\r\n\r\n/**\r\n * The viewing frustum is defined by 6 planes.\r\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\r\n * define the unit vector normal to the plane, and the w component is the distance of the\r\n * plane from the origin/camera position.\r\n *\r\n * @alias OrthographicFrustum\r\n * @constructor\r\n *\r\n * @param {Object} [options] An object with the following properties:\r\n * @param {Number} [options.width] The width of the frustum in meters.\r\n * @param {Number} [options.aspectRatio] The aspect ratio of the frustum's width to it's height.\r\n * @param {Number} [options.near=1.0] The distance of the near plane.\r\n * @param {Number} [options.far=500000000.0] The distance of the far plane.\r\n *\r\n * @example\r\n * const maxRadii = ellipsoid.maximumRadius;\r\n *\r\n * const frustum = new Cesium.OrthographicFrustum();\r\n * frustum.near = 0.01 * maxRadii;\r\n * frustum.far = 50.0 * maxRadii;\r\n */\r\nfunction OrthographicFrustum(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n this._offCenterFrustum = new OrthographicOffCenterFrustum();\r\n\r\n /**\r\n * The horizontal width of the frustum in meters.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.width = options.width;\r\n this._width = undefined;\r\n\r\n /**\r\n * The aspect ratio of the frustum's width to it's height.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.aspectRatio = options.aspectRatio;\r\n this._aspectRatio = undefined;\r\n\r\n /**\r\n * The distance of the near plane.\r\n * @type {Number}\r\n * @default 1.0\r\n */\r\n this.near = defaultValue(options.near, 1.0);\r\n this._near = this.near;\r\n\r\n /**\r\n * The distance of the far plane.\r\n * @type {Number}\r\n * @default 500000000.0;\r\n */\r\n this.far = defaultValue(options.far, 500000000.0);\r\n this._far = this.far;\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nOrthographicFrustum.packedLength = 4;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {OrthographicFrustum} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nOrthographicFrustum.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value.width;\r\n array[startingIndex++] = value.aspectRatio;\r\n array[startingIndex++] = value.near;\r\n array[startingIndex] = value.far;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {OrthographicFrustum} [result] The object into which to store the result.\r\n * @returns {OrthographicFrustum} The modified result parameter or a new OrthographicFrustum instance if one was not provided.\r\n */\r\nOrthographicFrustum.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new OrthographicFrustum();\r\n }\r\n\r\n result.width = array[startingIndex++];\r\n result.aspectRatio = array[startingIndex++];\r\n result.near = array[startingIndex++];\r\n result.far = array[startingIndex];\r\n\r\n return result;\r\n};\r\n\r\nfunction update(frustum) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n !defined(frustum.width) ||\r\n !defined(frustum.aspectRatio) ||\r\n !defined(frustum.near) ||\r\n !defined(frustum.far)\r\n ) {\r\n throw new DeveloperError(\r\n \"width, aspectRatio, near, or far parameters are not set.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const f = frustum._offCenterFrustum;\r\n\r\n if (\r\n frustum.width !== frustum._width ||\r\n frustum.aspectRatio !== frustum._aspectRatio ||\r\n frustum.near !== frustum._near ||\r\n frustum.far !== frustum._far\r\n ) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (frustum.aspectRatio < 0) {\r\n throw new DeveloperError(\"aspectRatio must be positive.\");\r\n }\r\n if (frustum.near < 0 || frustum.near > frustum.far) {\r\n throw new DeveloperError(\r\n \"near must be greater than zero and less than far.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n frustum._aspectRatio = frustum.aspectRatio;\r\n frustum._width = frustum.width;\r\n frustum._near = frustum.near;\r\n frustum._far = frustum.far;\r\n\r\n const ratio = 1.0 / frustum.aspectRatio;\r\n f.right = frustum.width * 0.5;\r\n f.left = -f.right;\r\n f.top = ratio * f.right;\r\n f.bottom = -f.top;\r\n f.near = frustum.near;\r\n f.far = frustum.far;\r\n }\r\n}\r\n\r\nObject.defineProperties(OrthographicFrustum.prototype, {\r\n /**\r\n * Gets the orthographic projection matrix computed from the view frustum.\r\n * @memberof OrthographicFrustum.prototype\r\n * @type {Matrix4}\r\n * @readonly\r\n */\r\n projectionMatrix: {\r\n get: function () {\r\n update(this);\r\n return this._offCenterFrustum.projectionMatrix;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Creates a culling volume for this frustum.\r\n *\r\n * @param {Cartesian3} position The eye position.\r\n * @param {Cartesian3} direction The view direction.\r\n * @param {Cartesian3} up The up direction.\r\n * @returns {CullingVolume} A culling volume at the given position and orientation.\r\n *\r\n * @example\r\n * // Check if a bounding volume intersects the frustum.\r\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\r\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\r\n */\r\nOrthographicFrustum.prototype.computeCullingVolume = function (\r\n position,\r\n direction,\r\n up\r\n) {\r\n update(this);\r\n return this._offCenterFrustum.computeCullingVolume(position, direction, up);\r\n};\r\n\r\n/**\r\n * Returns the pixel's width and height in meters.\r\n *\r\n * @param {Number} drawingBufferWidth The width of the drawing buffer.\r\n * @param {Number} drawingBufferHeight The height of the drawing buffer.\r\n * @param {Number} distance The distance to the near plane in meters.\r\n * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\r\n *\r\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\r\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\r\n * @exception {DeveloperError} pixelRatio must be greater than zero.\r\n *\r\n * @example\r\n * // Example 1\r\n * // Get the width and height of a pixel.\r\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 0.0, scene.pixelRatio, new Cesium.Cartesian2());\r\n */\r\nOrthographicFrustum.prototype.getPixelDimensions = function (\r\n drawingBufferWidth,\r\n drawingBufferHeight,\r\n distance,\r\n pixelRatio,\r\n result\r\n) {\r\n update(this);\r\n return this._offCenterFrustum.getPixelDimensions(\r\n drawingBufferWidth,\r\n drawingBufferHeight,\r\n distance,\r\n pixelRatio,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Returns a duplicate of a OrthographicFrustum instance.\r\n *\r\n * @param {OrthographicFrustum} [result] The object onto which to store the result.\r\n * @returns {OrthographicFrustum} The modified result parameter or a new OrthographicFrustum instance if one was not provided.\r\n */\r\nOrthographicFrustum.prototype.clone = function (result) {\r\n if (!defined(result)) {\r\n result = new OrthographicFrustum();\r\n }\r\n\r\n result.aspectRatio = this.aspectRatio;\r\n result.width = this.width;\r\n result.near = this.near;\r\n result.far = this.far;\r\n\r\n // force update of clone to compute matrices\r\n result._aspectRatio = undefined;\r\n result._width = undefined;\r\n result._near = undefined;\r\n result._far = undefined;\r\n\r\n this._offCenterFrustum.clone(result._offCenterFrustum);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided OrthographicFrustum componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {OrthographicFrustum} [other] The right hand side OrthographicFrustum.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nOrthographicFrustum.prototype.equals = function (other) {\r\n if (!defined(other) || !(other instanceof OrthographicFrustum)) {\r\n return false;\r\n }\r\n\r\n update(this);\r\n update(other);\r\n\r\n return (\r\n this.width === other.width &&\r\n this.aspectRatio === other.aspectRatio &&\r\n this._offCenterFrustum.equals(other._offCenterFrustum)\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided OrthographicFrustum componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {OrthographicFrustum} other The right hand side OrthographicFrustum.\r\n * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if this and other are within the provided epsilon, false
otherwise.\r\n */\r\nOrthographicFrustum.prototype.equalsEpsilon = function (\r\n other,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n if (!defined(other) || !(other instanceof OrthographicFrustum)) {\r\n return false;\r\n }\r\n\r\n update(this);\r\n update(other);\r\n\r\n return (\r\n CesiumMath.equalsEpsilon(\r\n this.width,\r\n other.width,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.aspectRatio,\r\n other.aspectRatio,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n this._offCenterFrustum.equalsEpsilon(\r\n other._offCenterFrustum,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n )\r\n );\r\n};\r\nexport default OrthographicFrustum;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartesian4 from \"./Cartesian4.js\";\r\nimport CullingVolume from \"./CullingVolume.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\n\r\n/**\r\n * The viewing frustum is defined by 6 planes.\r\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\r\n * define the unit vector normal to the plane, and the w component is the distance of the\r\n * plane from the origin/camera position.\r\n *\r\n * @alias PerspectiveOffCenterFrustum\r\n * @constructor\r\n *\r\n * @param {Object} [options] An object with the following properties:\r\n * @param {Number} [options.left] The left clipping plane distance.\r\n * @param {Number} [options.right] The right clipping plane distance.\r\n * @param {Number} [options.top] The top clipping plane distance.\r\n * @param {Number} [options.bottom] The bottom clipping plane distance.\r\n * @param {Number} [options.near=1.0] The near clipping plane distance.\r\n * @param {Number} [options.far=500000000.0] The far clipping plane distance.\r\n *\r\n * @example\r\n * const frustum = new Cesium.PerspectiveOffCenterFrustum({\r\n * left : -1.0,\r\n * right : 1.0,\r\n * top : 1.0,\r\n * bottom : -1.0,\r\n * near : 1.0,\r\n * far : 100.0\r\n * });\r\n *\r\n * @see PerspectiveFrustum\r\n */\r\nfunction PerspectiveOffCenterFrustum(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n /**\r\n * Defines the left clipping plane.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.left = options.left;\r\n this._left = undefined;\r\n\r\n /**\r\n * Defines the right clipping plane.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.right = options.right;\r\n this._right = undefined;\r\n\r\n /**\r\n * Defines the top clipping plane.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.top = options.top;\r\n this._top = undefined;\r\n\r\n /**\r\n * Defines the bottom clipping plane.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.bottom = options.bottom;\r\n this._bottom = undefined;\r\n\r\n /**\r\n * The distance of the near plane.\r\n * @type {Number}\r\n * @default 1.0\r\n */\r\n this.near = defaultValue(options.near, 1.0);\r\n this._near = this.near;\r\n\r\n /**\r\n * The distance of the far plane.\r\n * @type {Number}\r\n * @default 500000000.0\r\n */\r\n this.far = defaultValue(options.far, 500000000.0);\r\n this._far = this.far;\r\n\r\n this._cullingVolume = new CullingVolume();\r\n this._perspectiveMatrix = new Matrix4();\r\n this._infinitePerspective = new Matrix4();\r\n}\r\n\r\nfunction update(frustum) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n !defined(frustum.right) ||\r\n !defined(frustum.left) ||\r\n !defined(frustum.top) ||\r\n !defined(frustum.bottom) ||\r\n !defined(frustum.near) ||\r\n !defined(frustum.far)\r\n ) {\r\n throw new DeveloperError(\r\n \"right, left, top, bottom, near, or far parameters are not set.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const t = frustum.top;\r\n const b = frustum.bottom;\r\n const r = frustum.right;\r\n const l = frustum.left;\r\n const n = frustum.near;\r\n const f = frustum.far;\r\n\r\n if (\r\n t !== frustum._top ||\r\n b !== frustum._bottom ||\r\n l !== frustum._left ||\r\n r !== frustum._right ||\r\n n !== frustum._near ||\r\n f !== frustum._far\r\n ) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (frustum.near <= 0 || frustum.near > frustum.far) {\r\n throw new DeveloperError(\r\n \"near must be greater than zero and less than far.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n frustum._left = l;\r\n frustum._right = r;\r\n frustum._top = t;\r\n frustum._bottom = b;\r\n frustum._near = n;\r\n frustum._far = f;\r\n frustum._perspectiveMatrix = Matrix4.computePerspectiveOffCenter(\r\n l,\r\n r,\r\n b,\r\n t,\r\n n,\r\n f,\r\n frustum._perspectiveMatrix\r\n );\r\n frustum._infinitePerspective = Matrix4.computeInfinitePerspectiveOffCenter(\r\n l,\r\n r,\r\n b,\r\n t,\r\n n,\r\n frustum._infinitePerspective\r\n );\r\n }\r\n}\r\n\r\nObject.defineProperties(PerspectiveOffCenterFrustum.prototype, {\r\n /**\r\n * Gets the perspective projection matrix computed from the view frustum.\r\n * @memberof PerspectiveOffCenterFrustum.prototype\r\n * @type {Matrix4}\r\n * @readonly\r\n *\r\n * @see PerspectiveOffCenterFrustum#infiniteProjectionMatrix\r\n */\r\n projectionMatrix: {\r\n get: function () {\r\n update(this);\r\n return this._perspectiveMatrix;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the perspective projection matrix computed from the view frustum with an infinite far plane.\r\n * @memberof PerspectiveOffCenterFrustum.prototype\r\n * @type {Matrix4}\r\n * @readonly\r\n *\r\n * @see PerspectiveOffCenterFrustum#projectionMatrix\r\n */\r\n infiniteProjectionMatrix: {\r\n get: function () {\r\n update(this);\r\n return this._infinitePerspective;\r\n },\r\n },\r\n});\r\n\r\nconst getPlanesRight = new Cartesian3();\r\nconst getPlanesNearCenter = new Cartesian3();\r\nconst getPlanesFarCenter = new Cartesian3();\r\nconst getPlanesNormal = new Cartesian3();\r\n/**\r\n * Creates a culling volume for this frustum.\r\n *\r\n * @param {Cartesian3} position The eye position.\r\n * @param {Cartesian3} direction The view direction.\r\n * @param {Cartesian3} up The up direction.\r\n * @returns {CullingVolume} A culling volume at the given position and orientation.\r\n *\r\n * @example\r\n * // Check if a bounding volume intersects the frustum.\r\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\r\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\r\n */\r\nPerspectiveOffCenterFrustum.prototype.computeCullingVolume = function (\r\n position,\r\n direction,\r\n up\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(position)) {\r\n throw new DeveloperError(\"position is required.\");\r\n }\r\n\r\n if (!defined(direction)) {\r\n throw new DeveloperError(\"direction is required.\");\r\n }\r\n\r\n if (!defined(up)) {\r\n throw new DeveloperError(\"up is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const planes = this._cullingVolume.planes;\r\n\r\n const t = this.top;\r\n const b = this.bottom;\r\n const r = this.right;\r\n const l = this.left;\r\n const n = this.near;\r\n const f = this.far;\r\n\r\n const right = Cartesian3.cross(direction, up, getPlanesRight);\r\n\r\n const nearCenter = getPlanesNearCenter;\r\n Cartesian3.multiplyByScalar(direction, n, nearCenter);\r\n Cartesian3.add(position, nearCenter, nearCenter);\r\n\r\n const farCenter = getPlanesFarCenter;\r\n Cartesian3.multiplyByScalar(direction, f, farCenter);\r\n Cartesian3.add(position, farCenter, farCenter);\r\n\r\n const normal = getPlanesNormal;\r\n\r\n //Left plane computation\r\n Cartesian3.multiplyByScalar(right, l, normal);\r\n Cartesian3.add(nearCenter, normal, normal);\r\n Cartesian3.subtract(normal, position, normal);\r\n Cartesian3.normalize(normal, normal);\r\n Cartesian3.cross(normal, up, normal);\r\n Cartesian3.normalize(normal, normal);\r\n\r\n let plane = planes[0];\r\n if (!defined(plane)) {\r\n plane = planes[0] = new Cartesian4();\r\n }\r\n plane.x = normal.x;\r\n plane.y = normal.y;\r\n plane.z = normal.z;\r\n plane.w = -Cartesian3.dot(normal, position);\r\n\r\n //Right plane computation\r\n Cartesian3.multiplyByScalar(right, r, normal);\r\n Cartesian3.add(nearCenter, normal, normal);\r\n Cartesian3.subtract(normal, position, normal);\r\n Cartesian3.cross(up, normal, normal);\r\n Cartesian3.normalize(normal, normal);\r\n\r\n plane = planes[1];\r\n if (!defined(plane)) {\r\n plane = planes[1] = new Cartesian4();\r\n }\r\n plane.x = normal.x;\r\n plane.y = normal.y;\r\n plane.z = normal.z;\r\n plane.w = -Cartesian3.dot(normal, position);\r\n\r\n //Bottom plane computation\r\n Cartesian3.multiplyByScalar(up, b, normal);\r\n Cartesian3.add(nearCenter, normal, normal);\r\n Cartesian3.subtract(normal, position, normal);\r\n Cartesian3.cross(right, normal, normal);\r\n Cartesian3.normalize(normal, normal);\r\n\r\n plane = planes[2];\r\n if (!defined(plane)) {\r\n plane = planes[2] = new Cartesian4();\r\n }\r\n plane.x = normal.x;\r\n plane.y = normal.y;\r\n plane.z = normal.z;\r\n plane.w = -Cartesian3.dot(normal, position);\r\n\r\n //Top plane computation\r\n Cartesian3.multiplyByScalar(up, t, normal);\r\n Cartesian3.add(nearCenter, normal, normal);\r\n Cartesian3.subtract(normal, position, normal);\r\n Cartesian3.cross(normal, right, normal);\r\n Cartesian3.normalize(normal, normal);\r\n\r\n plane = planes[3];\r\n if (!defined(plane)) {\r\n plane = planes[3] = new Cartesian4();\r\n }\r\n plane.x = normal.x;\r\n plane.y = normal.y;\r\n plane.z = normal.z;\r\n plane.w = -Cartesian3.dot(normal, position);\r\n\r\n //Near plane computation\r\n plane = planes[4];\r\n if (!defined(plane)) {\r\n plane = planes[4] = new Cartesian4();\r\n }\r\n plane.x = direction.x;\r\n plane.y = direction.y;\r\n plane.z = direction.z;\r\n plane.w = -Cartesian3.dot(direction, nearCenter);\r\n\r\n //Far plane computation\r\n Cartesian3.negate(direction, normal);\r\n\r\n plane = planes[5];\r\n if (!defined(plane)) {\r\n plane = planes[5] = new Cartesian4();\r\n }\r\n plane.x = normal.x;\r\n plane.y = normal.y;\r\n plane.z = normal.z;\r\n plane.w = -Cartesian3.dot(normal, farCenter);\r\n\r\n return this._cullingVolume;\r\n};\r\n\r\n/**\r\n * Returns the pixel's width and height in meters.\r\n *\r\n * @param {Number} drawingBufferWidth The width of the drawing buffer.\r\n * @param {Number} drawingBufferHeight The height of the drawing buffer.\r\n * @param {Number} distance The distance to the near plane in meters.\r\n * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\r\n *\r\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\r\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\r\n * @exception {DeveloperError} pixelRatio must be greater than zero.\r\n *\r\n * @example\r\n * // Example 1\r\n * // Get the width and height of a pixel.\r\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());\r\n *\r\n * @example\r\n * // Example 2\r\n * // Get the width and height of a pixel if the near plane was set to 'distance'.\r\n * // For example, get the size of a pixel of an image on a billboard.\r\n * const position = camera.position;\r\n * const direction = camera.direction;\r\n * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive\r\n * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector\r\n * const distance = Cesium.Cartesian3.magnitude(toCenterProj);\r\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());\r\n */\r\nPerspectiveOffCenterFrustum.prototype.getPixelDimensions = function (\r\n drawingBufferWidth,\r\n drawingBufferHeight,\r\n distance,\r\n pixelRatio,\r\n result\r\n) {\r\n update(this);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(drawingBufferWidth) || !defined(drawingBufferHeight)) {\r\n throw new DeveloperError(\r\n \"Both drawingBufferWidth and drawingBufferHeight are required.\"\r\n );\r\n }\r\n if (drawingBufferWidth <= 0) {\r\n throw new DeveloperError(\"drawingBufferWidth must be greater than zero.\");\r\n }\r\n if (drawingBufferHeight <= 0) {\r\n throw new DeveloperError(\"drawingBufferHeight must be greater than zero.\");\r\n }\r\n if (!defined(distance)) {\r\n throw new DeveloperError(\"distance is required.\");\r\n }\r\n if (!defined(pixelRatio)) {\r\n throw new DeveloperError(\"pixelRatio is required\");\r\n }\r\n if (pixelRatio <= 0) {\r\n throw new DeveloperError(\"pixelRatio must be greater than zero.\");\r\n }\r\n if (!defined(result)) {\r\n throw new DeveloperError(\"A result object is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const inverseNear = 1.0 / this.near;\r\n let tanTheta = this.top * inverseNear;\r\n const pixelHeight =\r\n (2.0 * pixelRatio * distance * tanTheta) / drawingBufferHeight;\r\n tanTheta = this.right * inverseNear;\r\n const pixelWidth =\r\n (2.0 * pixelRatio * distance * tanTheta) / drawingBufferWidth;\r\n\r\n result.x = pixelWidth;\r\n result.y = pixelHeight;\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns a duplicate of a PerspectiveOffCenterFrustum instance.\r\n *\r\n * @param {PerspectiveOffCenterFrustum} [result] The object onto which to store the result.\r\n * @returns {PerspectiveOffCenterFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.\r\n */\r\nPerspectiveOffCenterFrustum.prototype.clone = function (result) {\r\n if (!defined(result)) {\r\n result = new PerspectiveOffCenterFrustum();\r\n }\r\n\r\n result.right = this.right;\r\n result.left = this.left;\r\n result.top = this.top;\r\n result.bottom = this.bottom;\r\n result.near = this.near;\r\n result.far = this.far;\r\n\r\n // force update of clone to compute matrices\r\n result._left = undefined;\r\n result._right = undefined;\r\n result._top = undefined;\r\n result._bottom = undefined;\r\n result._near = undefined;\r\n result._far = undefined;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided PerspectiveOffCenterFrustum componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {PerspectiveOffCenterFrustum} [other] The right hand side PerspectiveOffCenterFrustum.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nPerspectiveOffCenterFrustum.prototype.equals = function (other) {\r\n return (\r\n defined(other) &&\r\n other instanceof PerspectiveOffCenterFrustum &&\r\n this.right === other.right &&\r\n this.left === other.left &&\r\n this.top === other.top &&\r\n this.bottom === other.bottom &&\r\n this.near === other.near &&\r\n this.far === other.far\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided PerspectiveOffCenterFrustum componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {PerspectiveOffCenterFrustum} other The right hand side PerspectiveOffCenterFrustum.\r\n * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if this and other are within the provided epsilon, false
otherwise.\r\n */\r\nPerspectiveOffCenterFrustum.prototype.equalsEpsilon = function (\r\n other,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n return (\r\n other === this ||\r\n (defined(other) &&\r\n other instanceof PerspectiveOffCenterFrustum &&\r\n CesiumMath.equalsEpsilon(\r\n this.right,\r\n other.right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.left,\r\n other.left,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.top,\r\n other.top,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.bottom,\r\n other.bottom,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.near,\r\n other.near,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.far,\r\n other.far,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ))\r\n );\r\n};\r\nexport default PerspectiveOffCenterFrustum;\r\n","import Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PerspectiveOffCenterFrustum from \"./PerspectiveOffCenterFrustum.js\";\r\n\r\n/**\r\n * The viewing frustum is defined by 6 planes.\r\n * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components\r\n * define the unit vector normal to the plane, and the w component is the distance of the\r\n * plane from the origin/camera position.\r\n *\r\n * @alias PerspectiveFrustum\r\n * @constructor\r\n *\r\n * @param {Object} [options] An object with the following properties:\r\n * @param {Number} [options.fov] The angle of the field of view (FOV), in radians.\r\n * @param {Number} [options.aspectRatio] The aspect ratio of the frustum's width to it's height.\r\n * @param {Number} [options.near=1.0] The distance of the near plane.\r\n * @param {Number} [options.far=500000000.0] The distance of the far plane.\r\n * @param {Number} [options.xOffset=0.0] The offset in the x direction.\r\n * @param {Number} [options.yOffset=0.0] The offset in the y direction.\r\n *\r\n * @example\r\n * const frustum = new Cesium.PerspectiveFrustum({\r\n * fov : Cesium.Math.PI_OVER_THREE,\r\n * aspectRatio : canvas.clientWidth / canvas.clientHeight\r\n * near : 1.0,\r\n * far : 1000.0\r\n * });\r\n *\r\n * @see PerspectiveOffCenterFrustum\r\n */\r\nfunction PerspectiveFrustum(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n this._offCenterFrustum = new PerspectiveOffCenterFrustum();\r\n\r\n /**\r\n * The angle of the field of view (FOV), in radians. This angle will be used\r\n * as the horizontal FOV if the width is greater than the height, otherwise\r\n * it will be the vertical FOV.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.fov = options.fov;\r\n this._fov = undefined;\r\n this._fovy = undefined;\r\n\r\n this._sseDenominator = undefined;\r\n\r\n /**\r\n * The aspect ratio of the frustum's width to it's height.\r\n * @type {Number}\r\n * @default undefined\r\n */\r\n this.aspectRatio = options.aspectRatio;\r\n this._aspectRatio = undefined;\r\n\r\n /**\r\n * The distance of the near plane.\r\n * @type {Number}\r\n * @default 1.0\r\n */\r\n this.near = defaultValue(options.near, 1.0);\r\n this._near = this.near;\r\n\r\n /**\r\n * The distance of the far plane.\r\n * @type {Number}\r\n * @default 500000000.0\r\n */\r\n this.far = defaultValue(options.far, 500000000.0);\r\n this._far = this.far;\r\n\r\n /**\r\n * Offsets the frustum in the x direction.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.xOffset = defaultValue(options.xOffset, 0.0);\r\n this._xOffset = this.xOffset;\r\n\r\n /**\r\n * Offsets the frustum in the y direction.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.yOffset = defaultValue(options.yOffset, 0.0);\r\n this._yOffset = this.yOffset;\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nPerspectiveFrustum.packedLength = 6;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {PerspectiveFrustum} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nPerspectiveFrustum.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value.fov;\r\n array[startingIndex++] = value.aspectRatio;\r\n array[startingIndex++] = value.near;\r\n array[startingIndex++] = value.far;\r\n array[startingIndex++] = value.xOffset;\r\n array[startingIndex] = value.yOffset;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {PerspectiveFrustum} [result] The object into which to store the result.\r\n * @returns {PerspectiveFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.\r\n */\r\nPerspectiveFrustum.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new PerspectiveFrustum();\r\n }\r\n\r\n result.fov = array[startingIndex++];\r\n result.aspectRatio = array[startingIndex++];\r\n result.near = array[startingIndex++];\r\n result.far = array[startingIndex++];\r\n result.xOffset = array[startingIndex++];\r\n result.yOffset = array[startingIndex];\r\n\r\n return result;\r\n};\r\n\r\nfunction update(frustum) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n !defined(frustum.fov) ||\r\n !defined(frustum.aspectRatio) ||\r\n !defined(frustum.near) ||\r\n !defined(frustum.far)\r\n ) {\r\n throw new DeveloperError(\r\n \"fov, aspectRatio, near, or far parameters are not set.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const f = frustum._offCenterFrustum;\r\n\r\n if (\r\n frustum.fov !== frustum._fov ||\r\n frustum.aspectRatio !== frustum._aspectRatio ||\r\n frustum.near !== frustum._near ||\r\n frustum.far !== frustum._far ||\r\n frustum.xOffset !== frustum._xOffset ||\r\n frustum.yOffset !== frustum._yOffset\r\n ) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (frustum.fov < 0 || frustum.fov >= Math.PI) {\r\n throw new DeveloperError(\"fov must be in the range [0, PI).\");\r\n }\r\n\r\n if (frustum.aspectRatio < 0) {\r\n throw new DeveloperError(\"aspectRatio must be positive.\");\r\n }\r\n\r\n if (frustum.near < 0 || frustum.near > frustum.far) {\r\n throw new DeveloperError(\r\n \"near must be greater than zero and less than far.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n frustum._aspectRatio = frustum.aspectRatio;\r\n frustum._fov = frustum.fov;\r\n frustum._fovy =\r\n frustum.aspectRatio <= 1\r\n ? frustum.fov\r\n : Math.atan(Math.tan(frustum.fov * 0.5) / frustum.aspectRatio) * 2.0;\r\n frustum._near = frustum.near;\r\n frustum._far = frustum.far;\r\n frustum._sseDenominator = 2.0 * Math.tan(0.5 * frustum._fovy);\r\n frustum._xOffset = frustum.xOffset;\r\n frustum._yOffset = frustum.yOffset;\r\n\r\n f.top = frustum.near * Math.tan(0.5 * frustum._fovy);\r\n f.bottom = -f.top;\r\n f.right = frustum.aspectRatio * f.top;\r\n f.left = -f.right;\r\n f.near = frustum.near;\r\n f.far = frustum.far;\r\n\r\n f.right += frustum.xOffset;\r\n f.left += frustum.xOffset;\r\n f.top += frustum.yOffset;\r\n f.bottom += frustum.yOffset;\r\n }\r\n}\r\n\r\nObject.defineProperties(PerspectiveFrustum.prototype, {\r\n /**\r\n * Gets the perspective projection matrix computed from the view frustum.\r\n * @memberof PerspectiveFrustum.prototype\r\n * @type {Matrix4}\r\n * @readonly\r\n *\r\n * @see PerspectiveFrustum#infiniteProjectionMatrix\r\n */\r\n projectionMatrix: {\r\n get: function () {\r\n update(this);\r\n return this._offCenterFrustum.projectionMatrix;\r\n },\r\n },\r\n\r\n /**\r\n * The perspective projection matrix computed from the view frustum with an infinite far plane.\r\n * @memberof PerspectiveFrustum.prototype\r\n * @type {Matrix4}\r\n * @readonly\r\n *\r\n * @see PerspectiveFrustum#projectionMatrix\r\n */\r\n infiniteProjectionMatrix: {\r\n get: function () {\r\n update(this);\r\n return this._offCenterFrustum.infiniteProjectionMatrix;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the angle of the vertical field of view, in radians.\r\n * @memberof PerspectiveFrustum.prototype\r\n * @type {Number}\r\n * @readonly\r\n * @default undefined\r\n */\r\n fovy: {\r\n get: function () {\r\n update(this);\r\n return this._fovy;\r\n },\r\n },\r\n\r\n /**\r\n * @readonly\r\n * @private\r\n */\r\n sseDenominator: {\r\n get: function () {\r\n update(this);\r\n return this._sseDenominator;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Creates a culling volume for this frustum.\r\n *\r\n * @param {Cartesian3} position The eye position.\r\n * @param {Cartesian3} direction The view direction.\r\n * @param {Cartesian3} up The up direction.\r\n * @returns {CullingVolume} A culling volume at the given position and orientation.\r\n *\r\n * @example\r\n * // Check if a bounding volume intersects the frustum.\r\n * const cullingVolume = frustum.computeCullingVolume(cameraPosition, cameraDirection, cameraUp);\r\n * const intersect = cullingVolume.computeVisibility(boundingVolume);\r\n */\r\nPerspectiveFrustum.prototype.computeCullingVolume = function (\r\n position,\r\n direction,\r\n up\r\n) {\r\n update(this);\r\n return this._offCenterFrustum.computeCullingVolume(position, direction, up);\r\n};\r\n\r\n/**\r\n * Returns the pixel's width and height in meters.\r\n *\r\n * @param {Number} drawingBufferWidth The width of the drawing buffer.\r\n * @param {Number} drawingBufferHeight The height of the drawing buffer.\r\n * @param {Number} distance The distance to the near plane in meters.\r\n * @param {Number} pixelRatio The scaling factor from pixel space to coordinate space.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new instance of {@link Cartesian2} with the pixel's width and height in the x and y properties, respectively.\r\n *\r\n * @exception {DeveloperError} drawingBufferWidth must be greater than zero.\r\n * @exception {DeveloperError} drawingBufferHeight must be greater than zero.\r\n * @exception {DeveloperError} pixelRatio must be greater than zero.\r\n *\r\n * @example\r\n * // Example 1\r\n * // Get the width and height of a pixel.\r\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, 1.0, scene.pixelRatio, new Cesium.Cartesian2());\r\n *\r\n * @example\r\n * // Example 2\r\n * // Get the width and height of a pixel if the near plane was set to 'distance'.\r\n * // For example, get the size of a pixel of an image on a billboard.\r\n * const position = camera.position;\r\n * const direction = camera.direction;\r\n * const toCenter = Cesium.Cartesian3.subtract(primitive.boundingVolume.center, position, new Cesium.Cartesian3()); // vector from camera to a primitive\r\n * const toCenterProj = Cesium.Cartesian3.multiplyByScalar(direction, Cesium.Cartesian3.dot(direction, toCenter), new Cesium.Cartesian3()); // project vector onto camera direction vector\r\n * const distance = Cesium.Cartesian3.magnitude(toCenterProj);\r\n * const pixelSize = camera.frustum.getPixelDimensions(scene.drawingBufferWidth, scene.drawingBufferHeight, distance, scene.pixelRatio, new Cesium.Cartesian2());\r\n */\r\nPerspectiveFrustum.prototype.getPixelDimensions = function (\r\n drawingBufferWidth,\r\n drawingBufferHeight,\r\n distance,\r\n pixelRatio,\r\n result\r\n) {\r\n update(this);\r\n return this._offCenterFrustum.getPixelDimensions(\r\n drawingBufferWidth,\r\n drawingBufferHeight,\r\n distance,\r\n pixelRatio,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Returns a duplicate of a PerspectiveFrustum instance.\r\n *\r\n * @param {PerspectiveFrustum} [result] The object onto which to store the result.\r\n * @returns {PerspectiveFrustum} The modified result parameter or a new PerspectiveFrustum instance if one was not provided.\r\n */\r\nPerspectiveFrustum.prototype.clone = function (result) {\r\n if (!defined(result)) {\r\n result = new PerspectiveFrustum();\r\n }\r\n\r\n result.aspectRatio = this.aspectRatio;\r\n result.fov = this.fov;\r\n result.near = this.near;\r\n result.far = this.far;\r\n\r\n // force update of clone to compute matrices\r\n result._aspectRatio = undefined;\r\n result._fov = undefined;\r\n result._near = undefined;\r\n result._far = undefined;\r\n\r\n this._offCenterFrustum.clone(result._offCenterFrustum);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided PerspectiveFrustum componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {PerspectiveFrustum} [other] The right hand side PerspectiveFrustum.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nPerspectiveFrustum.prototype.equals = function (other) {\r\n if (!defined(other) || !(other instanceof PerspectiveFrustum)) {\r\n return false;\r\n }\r\n\r\n update(this);\r\n update(other);\r\n\r\n return (\r\n this.fov === other.fov &&\r\n this.aspectRatio === other.aspectRatio &&\r\n this._offCenterFrustum.equals(other._offCenterFrustum)\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided PerspectiveFrustum componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {PerspectiveFrustum} other The right hand side PerspectiveFrustum.\r\n * @param {Number} relativeEpsilon The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if this and other are within the provided epsilon, false
otherwise.\r\n */\r\nPerspectiveFrustum.prototype.equalsEpsilon = function (\r\n other,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n if (!defined(other) || !(other instanceof PerspectiveFrustum)) {\r\n return false;\r\n }\r\n\r\n update(this);\r\n update(other);\r\n\r\n return (\r\n CesiumMath.equalsEpsilon(\r\n this.fov,\r\n other.fov,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n this.aspectRatio,\r\n other.aspectRatio,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n this._offCenterFrustum.equalsEpsilon(\r\n other._offCenterFrustum,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n )\r\n );\r\n};\r\nexport default PerspectiveFrustum;\r\n","import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartesian4 from \"./Cartesian4.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport OrthographicFrustum from \"./OrthographicFrustum.js\";\r\nimport PerspectiveFrustum from \"./PerspectiveFrustum.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\nconst PERSPECTIVE = 0;\r\nconst ORTHOGRAPHIC = 1;\r\n\r\n/**\r\n * Describes a frustum at the given the origin and orientation.\r\n *\r\n * @alias FrustumGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.\r\n * @param {Cartesian3} options.origin The origin of the frustum.\r\n * @param {Quaternion} options.orientation The orientation of the frustum.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n */\r\nfunction FrustumGeometry(options) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"options\", options);\r\n Check.typeOf.object(\"options.frustum\", options.frustum);\r\n Check.typeOf.object(\"options.origin\", options.origin);\r\n Check.typeOf.object(\"options.orientation\", options.orientation);\r\n //>>includeEnd('debug');\r\n\r\n const frustum = options.frustum;\r\n const orientation = options.orientation;\r\n const origin = options.origin;\r\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\r\n\r\n // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by\r\n // creating multiple FrustumGeometrys. This way the near plane of one frustum doesn't overlap\r\n // the far plane of another.\r\n const drawNearPlane = defaultValue(options._drawNearPlane, true);\r\n\r\n let frustumType;\r\n let frustumPackedLength;\r\n if (frustum instanceof PerspectiveFrustum) {\r\n frustumType = PERSPECTIVE;\r\n frustumPackedLength = PerspectiveFrustum.packedLength;\r\n } else if (frustum instanceof OrthographicFrustum) {\r\n frustumType = ORTHOGRAPHIC;\r\n frustumPackedLength = OrthographicFrustum.packedLength;\r\n }\r\n\r\n this._frustumType = frustumType;\r\n this._frustum = frustum.clone();\r\n this._origin = Cartesian3.clone(origin);\r\n this._orientation = Quaternion.clone(orientation);\r\n this._drawNearPlane = drawNearPlane;\r\n this._vertexFormat = vertexFormat;\r\n this._workerName = \"createFrustumGeometry\";\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n 2 +\r\n frustumPackedLength +\r\n Cartesian3.packedLength +\r\n Quaternion.packedLength +\r\n VertexFormat.packedLength;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {FrustumGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nFrustumGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const frustumType = value._frustumType;\r\n const frustum = value._frustum;\r\n\r\n array[startingIndex++] = frustumType;\r\n\r\n if (frustumType === PERSPECTIVE) {\r\n PerspectiveFrustum.pack(frustum, array, startingIndex);\r\n startingIndex += PerspectiveFrustum.packedLength;\r\n } else {\r\n OrthographicFrustum.pack(frustum, array, startingIndex);\r\n startingIndex += OrthographicFrustum.packedLength;\r\n }\r\n\r\n Cartesian3.pack(value._origin, array, startingIndex);\r\n startingIndex += Cartesian3.packedLength;\r\n Quaternion.pack(value._orientation, array, startingIndex);\r\n startingIndex += Quaternion.packedLength;\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;\r\n\r\n return array;\r\n};\r\n\r\nconst scratchPackPerspective = new PerspectiveFrustum();\r\nconst scratchPackOrthographic = new OrthographicFrustum();\r\nconst scratchPackQuaternion = new Quaternion();\r\nconst scratchPackorigin = new Cartesian3();\r\nconst scratchVertexFormat = new VertexFormat();\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {FrustumGeometry} [result] The object into which to store the result.\r\n */\r\nFrustumGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const frustumType = array[startingIndex++];\r\n\r\n let frustum;\r\n if (frustumType === PERSPECTIVE) {\r\n frustum = PerspectiveFrustum.unpack(\r\n array,\r\n startingIndex,\r\n scratchPackPerspective\r\n );\r\n startingIndex += PerspectiveFrustum.packedLength;\r\n } else {\r\n frustum = OrthographicFrustum.unpack(\r\n array,\r\n startingIndex,\r\n scratchPackOrthographic\r\n );\r\n startingIndex += OrthographicFrustum.packedLength;\r\n }\r\n\r\n const origin = Cartesian3.unpack(array, startingIndex, scratchPackorigin);\r\n startingIndex += Cartesian3.packedLength;\r\n const orientation = Quaternion.unpack(\r\n array,\r\n startingIndex,\r\n scratchPackQuaternion\r\n );\r\n startingIndex += Quaternion.packedLength;\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n const drawNearPlane = array[startingIndex] === 1.0;\r\n\r\n if (!defined(result)) {\r\n return new FrustumGeometry({\r\n frustum: frustum,\r\n origin: origin,\r\n orientation: orientation,\r\n vertexFormat: vertexFormat,\r\n _drawNearPlane: drawNearPlane,\r\n });\r\n }\r\n\r\n const frustumResult =\r\n frustumType === result._frustumType ? result._frustum : undefined;\r\n result._frustum = frustum.clone(frustumResult);\r\n\r\n result._frustumType = frustumType;\r\n result._origin = Cartesian3.clone(origin, result._origin);\r\n result._orientation = Quaternion.clone(orientation, result._orientation);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._drawNearPlane = drawNearPlane;\r\n\r\n return result;\r\n};\r\n\r\nfunction getAttributes(\r\n offset,\r\n normals,\r\n tangents,\r\n bitangents,\r\n st,\r\n normal,\r\n tangent,\r\n bitangent\r\n) {\r\n const stOffset = (offset / 3) * 2;\r\n\r\n for (let i = 0; i < 4; ++i) {\r\n if (defined(normals)) {\r\n normals[offset] = normal.x;\r\n normals[offset + 1] = normal.y;\r\n normals[offset + 2] = normal.z;\r\n }\r\n if (defined(tangents)) {\r\n tangents[offset] = tangent.x;\r\n tangents[offset + 1] = tangent.y;\r\n tangents[offset + 2] = tangent.z;\r\n }\r\n if (defined(bitangents)) {\r\n bitangents[offset] = bitangent.x;\r\n bitangents[offset + 1] = bitangent.y;\r\n bitangents[offset + 2] = bitangent.z;\r\n }\r\n offset += 3;\r\n }\r\n\r\n st[stOffset] = 0.0;\r\n st[stOffset + 1] = 0.0;\r\n st[stOffset + 2] = 1.0;\r\n st[stOffset + 3] = 0.0;\r\n st[stOffset + 4] = 1.0;\r\n st[stOffset + 5] = 1.0;\r\n st[stOffset + 6] = 0.0;\r\n st[stOffset + 7] = 1.0;\r\n}\r\n\r\nconst scratchRotationMatrix = new Matrix3();\r\nconst scratchViewMatrix = new Matrix4();\r\nconst scratchInverseMatrix = new Matrix4();\r\n\r\nconst scratchXDirection = new Cartesian3();\r\nconst scratchYDirection = new Cartesian3();\r\nconst scratchZDirection = new Cartesian3();\r\nconst scratchNegativeX = new Cartesian3();\r\nconst scratchNegativeY = new Cartesian3();\r\nconst scratchNegativeZ = new Cartesian3();\r\n\r\nconst frustumSplits = new Array(3);\r\n\r\nconst frustumCornersNDC = new Array(4);\r\nfrustumCornersNDC[0] = new Cartesian4(-1.0, -1.0, 1.0, 1.0);\r\nfrustumCornersNDC[1] = new Cartesian4(1.0, -1.0, 1.0, 1.0);\r\nfrustumCornersNDC[2] = new Cartesian4(1.0, 1.0, 1.0, 1.0);\r\nfrustumCornersNDC[3] = new Cartesian4(-1.0, 1.0, 1.0, 1.0);\r\n\r\nconst scratchFrustumCorners = new Array(4);\r\nfor (let i = 0; i < 4; ++i) {\r\n scratchFrustumCorners[i] = new Cartesian4();\r\n}\r\n\r\nFrustumGeometry._computeNearFarPlanes = function (\r\n origin,\r\n orientation,\r\n frustumType,\r\n frustum,\r\n positions,\r\n xDirection,\r\n yDirection,\r\n zDirection\r\n) {\r\n const rotationMatrix = Matrix3.fromQuaternion(\r\n orientation,\r\n scratchRotationMatrix\r\n );\r\n let x = defaultValue(xDirection, scratchXDirection);\r\n let y = defaultValue(yDirection, scratchYDirection);\r\n let z = defaultValue(zDirection, scratchZDirection);\r\n\r\n x = Matrix3.getColumn(rotationMatrix, 0, x);\r\n y = Matrix3.getColumn(rotationMatrix, 1, y);\r\n z = Matrix3.getColumn(rotationMatrix, 2, z);\r\n\r\n Cartesian3.normalize(x, x);\r\n Cartesian3.normalize(y, y);\r\n Cartesian3.normalize(z, z);\r\n\r\n Cartesian3.negate(x, x);\r\n\r\n const view = Matrix4.computeView(origin, z, y, x, scratchViewMatrix);\r\n\r\n let inverseView;\r\n let inverseViewProjection;\r\n if (frustumType === PERSPECTIVE) {\r\n const projection = frustum.projectionMatrix;\r\n const viewProjection = Matrix4.multiply(\r\n projection,\r\n view,\r\n scratchInverseMatrix\r\n );\r\n inverseViewProjection = Matrix4.inverse(\r\n viewProjection,\r\n scratchInverseMatrix\r\n );\r\n } else {\r\n inverseView = Matrix4.inverseTransformation(view, scratchInverseMatrix);\r\n }\r\n\r\n if (defined(inverseViewProjection)) {\r\n frustumSplits[0] = frustum.near;\r\n frustumSplits[1] = frustum.far;\r\n } else {\r\n frustumSplits[0] = 0.0;\r\n frustumSplits[1] = frustum.near;\r\n frustumSplits[2] = frustum.far;\r\n }\r\n\r\n for (let i = 0; i < 2; ++i) {\r\n for (let j = 0; j < 4; ++j) {\r\n let corner = Cartesian4.clone(\r\n frustumCornersNDC[j],\r\n scratchFrustumCorners[j]\r\n );\r\n\r\n if (!defined(inverseViewProjection)) {\r\n if (defined(frustum._offCenterFrustum)) {\r\n frustum = frustum._offCenterFrustum;\r\n }\r\n\r\n const near = frustumSplits[i];\r\n const far = frustumSplits[i + 1];\r\n\r\n corner.x =\r\n (corner.x * (frustum.right - frustum.left) +\r\n frustum.left +\r\n frustum.right) *\r\n 0.5;\r\n corner.y =\r\n (corner.y * (frustum.top - frustum.bottom) +\r\n frustum.bottom +\r\n frustum.top) *\r\n 0.5;\r\n corner.z = (corner.z * (near - far) - near - far) * 0.5;\r\n corner.w = 1.0;\r\n\r\n Matrix4.multiplyByVector(inverseView, corner, corner);\r\n } else {\r\n corner = Matrix4.multiplyByVector(\r\n inverseViewProjection,\r\n corner,\r\n corner\r\n );\r\n\r\n // Reverse perspective divide\r\n const w = 1.0 / corner.w;\r\n Cartesian3.multiplyByScalar(corner, w, corner);\r\n\r\n Cartesian3.subtract(corner, origin, corner);\r\n Cartesian3.normalize(corner, corner);\r\n\r\n const fac = Cartesian3.dot(z, corner);\r\n Cartesian3.multiplyByScalar(corner, frustumSplits[i] / fac, corner);\r\n Cartesian3.add(corner, origin, corner);\r\n }\r\n\r\n positions[12 * i + j * 3] = corner.x;\r\n positions[12 * i + j * 3 + 1] = corner.y;\r\n positions[12 * i + j * 3 + 2] = corner.z;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a frustum, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {FrustumGeometry} frustumGeometry A description of the frustum.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nFrustumGeometry.createGeometry = function (frustumGeometry) {\r\n const frustumType = frustumGeometry._frustumType;\r\n const frustum = frustumGeometry._frustum;\r\n const origin = frustumGeometry._origin;\r\n const orientation = frustumGeometry._orientation;\r\n const drawNearPlane = frustumGeometry._drawNearPlane;\r\n const vertexFormat = frustumGeometry._vertexFormat;\r\n\r\n const numberOfPlanes = drawNearPlane ? 6 : 5;\r\n let positions = new Float64Array(3 * 4 * 6);\r\n FrustumGeometry._computeNearFarPlanes(\r\n origin,\r\n orientation,\r\n frustumType,\r\n frustum,\r\n positions\r\n );\r\n\r\n // -x plane\r\n let offset = 3 * 4 * 2;\r\n positions[offset] = positions[3 * 4];\r\n positions[offset + 1] = positions[3 * 4 + 1];\r\n positions[offset + 2] = positions[3 * 4 + 2];\r\n positions[offset + 3] = positions[0];\r\n positions[offset + 4] = positions[1];\r\n positions[offset + 5] = positions[2];\r\n positions[offset + 6] = positions[3 * 3];\r\n positions[offset + 7] = positions[3 * 3 + 1];\r\n positions[offset + 8] = positions[3 * 3 + 2];\r\n positions[offset + 9] = positions[3 * 7];\r\n positions[offset + 10] = positions[3 * 7 + 1];\r\n positions[offset + 11] = positions[3 * 7 + 2];\r\n\r\n // -y plane\r\n offset += 3 * 4;\r\n positions[offset] = positions[3 * 5];\r\n positions[offset + 1] = positions[3 * 5 + 1];\r\n positions[offset + 2] = positions[3 * 5 + 2];\r\n positions[offset + 3] = positions[3];\r\n positions[offset + 4] = positions[3 + 1];\r\n positions[offset + 5] = positions[3 + 2];\r\n positions[offset + 6] = positions[0];\r\n positions[offset + 7] = positions[1];\r\n positions[offset + 8] = positions[2];\r\n positions[offset + 9] = positions[3 * 4];\r\n positions[offset + 10] = positions[3 * 4 + 1];\r\n positions[offset + 11] = positions[3 * 4 + 2];\r\n\r\n // +x plane\r\n offset += 3 * 4;\r\n positions[offset] = positions[3];\r\n positions[offset + 1] = positions[3 + 1];\r\n positions[offset + 2] = positions[3 + 2];\r\n positions[offset + 3] = positions[3 * 5];\r\n positions[offset + 4] = positions[3 * 5 + 1];\r\n positions[offset + 5] = positions[3 * 5 + 2];\r\n positions[offset + 6] = positions[3 * 6];\r\n positions[offset + 7] = positions[3 * 6 + 1];\r\n positions[offset + 8] = positions[3 * 6 + 2];\r\n positions[offset + 9] = positions[3 * 2];\r\n positions[offset + 10] = positions[3 * 2 + 1];\r\n positions[offset + 11] = positions[3 * 2 + 2];\r\n\r\n // +y plane\r\n offset += 3 * 4;\r\n positions[offset] = positions[3 * 2];\r\n positions[offset + 1] = positions[3 * 2 + 1];\r\n positions[offset + 2] = positions[3 * 2 + 2];\r\n positions[offset + 3] = positions[3 * 6];\r\n positions[offset + 4] = positions[3 * 6 + 1];\r\n positions[offset + 5] = positions[3 * 6 + 2];\r\n positions[offset + 6] = positions[3 * 7];\r\n positions[offset + 7] = positions[3 * 7 + 1];\r\n positions[offset + 8] = positions[3 * 7 + 2];\r\n positions[offset + 9] = positions[3 * 3];\r\n positions[offset + 10] = positions[3 * 3 + 1];\r\n positions[offset + 11] = positions[3 * 3 + 2];\r\n\r\n if (!drawNearPlane) {\r\n positions = positions.subarray(3 * 4);\r\n }\r\n\r\n const attributes = new GeometryAttributes({\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n }),\r\n });\r\n\r\n if (\r\n defined(vertexFormat.normal) ||\r\n defined(vertexFormat.tangent) ||\r\n defined(vertexFormat.bitangent) ||\r\n defined(vertexFormat.st)\r\n ) {\r\n const normals = defined(vertexFormat.normal)\r\n ? new Float32Array(3 * 4 * numberOfPlanes)\r\n : undefined;\r\n const tangents = defined(vertexFormat.tangent)\r\n ? new Float32Array(3 * 4 * numberOfPlanes)\r\n : undefined;\r\n const bitangents = defined(vertexFormat.bitangent)\r\n ? new Float32Array(3 * 4 * numberOfPlanes)\r\n : undefined;\r\n const st = defined(vertexFormat.st)\r\n ? new Float32Array(2 * 4 * numberOfPlanes)\r\n : undefined;\r\n\r\n const x = scratchXDirection;\r\n const y = scratchYDirection;\r\n const z = scratchZDirection;\r\n\r\n const negativeX = Cartesian3.negate(x, scratchNegativeX);\r\n const negativeY = Cartesian3.negate(y, scratchNegativeY);\r\n const negativeZ = Cartesian3.negate(z, scratchNegativeZ);\r\n\r\n offset = 0;\r\n if (drawNearPlane) {\r\n getAttributes(offset, normals, tangents, bitangents, st, negativeZ, x, y); // near\r\n offset += 3 * 4;\r\n }\r\n getAttributes(offset, normals, tangents, bitangents, st, z, negativeX, y); // far\r\n offset += 3 * 4;\r\n getAttributes(\r\n offset,\r\n normals,\r\n tangents,\r\n bitangents,\r\n st,\r\n negativeX,\r\n negativeZ,\r\n y\r\n ); // -x\r\n offset += 3 * 4;\r\n getAttributes(\r\n offset,\r\n normals,\r\n tangents,\r\n bitangents,\r\n st,\r\n negativeY,\r\n negativeZ,\r\n negativeX\r\n ); // -y\r\n offset += 3 * 4;\r\n getAttributes(offset, normals, tangents, bitangents, st, x, z, y); // +x\r\n offset += 3 * 4;\r\n getAttributes(offset, normals, tangents, bitangents, st, y, z, negativeX); // +y\r\n\r\n if (defined(normals)) {\r\n attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normals,\r\n });\r\n }\r\n if (defined(tangents)) {\r\n attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangents,\r\n });\r\n }\r\n if (defined(bitangents)) {\r\n attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangents,\r\n });\r\n }\r\n if (defined(st)) {\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: st,\r\n });\r\n }\r\n }\r\n\r\n const indices = new Uint16Array(6 * numberOfPlanes);\r\n for (let i = 0; i < numberOfPlanes; ++i) {\r\n const indexOffset = i * 6;\r\n const index = i * 4;\r\n\r\n indices[indexOffset] = index;\r\n indices[indexOffset + 1] = index + 1;\r\n indices[indexOffset + 2] = index + 2;\r\n indices[indexOffset + 3] = index;\r\n indices[indexOffset + 4] = index + 2;\r\n indices[indexOffset + 5] = index + 3;\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n boundingSphere: BoundingSphere.fromVertices(positions),\r\n });\r\n};\r\nexport default FrustumGeometry;\r\n"],"names":["defaultValue","Cartesian3","Plane","defined","DeveloperError","Cartesian4","Intersect","Matrix4","update","getPlanesRight","getPlanesNearCenter","CesiumMath","Check","VertexFormat","Quaternion","Matrix3","GeometryAttributes","GeometryAttribute","ComponentDatatype","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,aAAa,CAAC,MAAM,EAAE;EAC/B;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,MAAM,GAAGA,yBAAY,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;EACzC,CAAC;AACD;EACA,MAAM,KAAK,GAAG,CAAC,IAAIC,kBAAU,EAAE,EAAE,IAAIA,kBAAU,EAAE,EAAE,IAAIA,kBAAU,EAAE,CAAC,CAAC;AACrEA,oBAAU,CAAC,KAAK,CAACA,kBAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9CA,oBAAU,CAAC,KAAK,CAACA,kBAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9CA,oBAAU,CAAC,KAAK,CAACA,kBAAU,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C;EACA,MAAM,kBAAkB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC5C,MAAM,kBAAkB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC5C,MAAM,YAAY,GAAG,IAAIC,WAAK,CAAC,IAAID,kBAAU,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AACnE;EACA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AC;EACzC,GAAG;AACH;EACA,EAAE,OAAO,IAAIC,0BAAQ,CAAC;EACtB,IAAI,UAAU,EAAE,UAAU;EAC1B,IAAI,OAAO,EAAE,OAAO;EACpB,IAAI,aAAa,EAAEC,+BAAa,CAAC,SAAS;EAC1C,IAAI,cAAc,EAAEC,yBAAc,CAAC,YAAY,CAAC,SAAS,CAAC;EAC1D,GAAG,CAAC,CAAC;EACL,CAAC;;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/GeometryAttribute-f2746b95.js b/examples/cesium/Workers/GeometryAttribute-f2746b95.js
new file mode 100644
index 0000000..d9db492
--- /dev/null
+++ b/examples/cesium/Workers/GeometryAttribute-f2746b95.js
@@ -0,0 +1,645 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './WebGLConstants-f27a5e29', './Transforms-11fb6b0a'], (function (exports, Matrix2, Matrix3, Check, defaultValue, WebGLConstants, Transforms) { 'use strict';
+
+ /**
+ * @private
+ */
+ const GeometryType = {
+ NONE: 0,
+ TRIANGLES: 1,
+ LINES: 2,
+ POLYLINES: 3,
+ };
+ var GeometryType$1 = Object.freeze(GeometryType);
+
+ /**
+ * The type of a geometric primitive, i.e., points, lines, and triangles.
+ *
+ * @enum {Number}
+ */
+ const PrimitiveType = {
+ /**
+ * Points primitive where each vertex (or index) is a separate point.
+ *
+ * @type {Number}
+ * @constant
+ */
+ POINTS: WebGLConstants.WebGLConstants.POINTS,
+
+ /**
+ * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
+ *
+ * @type {Number}
+ * @constant
+ */
+ LINES: WebGLConstants.WebGLConstants.LINES,
+
+ /**
+ * Line loop primitive where each vertex (or index) after the first connects a line to
+ * the previous vertex, and the last vertex implicitly connects to the first.
+ *
+ * @type {Number}
+ * @constant
+ */
+ LINE_LOOP: WebGLConstants.WebGLConstants.LINE_LOOP,
+
+ /**
+ * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
+ *
+ * @type {Number}
+ * @constant
+ */
+ LINE_STRIP: WebGLConstants.WebGLConstants.LINE_STRIP,
+
+ /**
+ * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
+ *
+ * @type {Number}
+ * @constant
+ */
+ TRIANGLES: WebGLConstants.WebGLConstants.TRIANGLES,
+
+ /**
+ * Triangle strip primitive where each vertex (or index) after the first two connect to
+ * the previous two vertices forming a triangle. For example, this can be used to model a wall.
+ *
+ * @type {Number}
+ * @constant
+ */
+ TRIANGLE_STRIP: WebGLConstants.WebGLConstants.TRIANGLE_STRIP,
+
+ /**
+ * Triangle fan primitive where each vertex (or index) after the first two connect to
+ * the previous vertex and the first vertex forming a triangle. For example, this can be used
+ * to model a cone or circle.
+ *
+ * @type {Number}
+ * @constant
+ */
+ TRIANGLE_FAN: WebGLConstants.WebGLConstants.TRIANGLE_FAN,
+ };
+
+ /**
+ * @private
+ */
+ PrimitiveType.isLines = function (primitiveType) {
+ return (
+ primitiveType === PrimitiveType.LINES ||
+ primitiveType === PrimitiveType.LINE_LOOP ||
+ primitiveType === PrimitiveType.LINE_STRIP
+ );
+ };
+
+ /**
+ * @private
+ */
+ PrimitiveType.isTriangles = function (primitiveType) {
+ return (
+ primitiveType === PrimitiveType.TRIANGLES ||
+ primitiveType === PrimitiveType.TRIANGLE_STRIP ||
+ primitiveType === PrimitiveType.TRIANGLE_FAN
+ );
+ };
+
+ /**
+ * @private
+ */
+ PrimitiveType.validate = function (primitiveType) {
+ return (
+ primitiveType === PrimitiveType.POINTS ||
+ primitiveType === PrimitiveType.LINES ||
+ primitiveType === PrimitiveType.LINE_LOOP ||
+ primitiveType === PrimitiveType.LINE_STRIP ||
+ primitiveType === PrimitiveType.TRIANGLES ||
+ primitiveType === PrimitiveType.TRIANGLE_STRIP ||
+ primitiveType === PrimitiveType.TRIANGLE_FAN
+ );
+ };
+
+ var PrimitiveType$1 = Object.freeze(PrimitiveType);
+
+ /**
+ * A geometry representation with attributes forming vertices and optional index data
+ * defining primitives. Geometries and an {@link Appearance}, which describes the shading,
+ * can be assigned to a {@link Primitive} for visualization. A Primitive
can
+ * be created from many heterogeneous - in many cases - geometries for performance.
+ * + * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}. + *
+ * + * @alias Geometry + * @constructor + * + * @param {Object} options Object with the following properties: + * @param {GeometryAttributes} options.attributes Attributes, which make up the geometry's vertices. + * @param {PrimitiveType} [options.primitiveType=PrimitiveType.TRIANGLES] The type of primitives in the geometry. + * @param {Uint16Array|Uint32Array} [options.indices] Optional index data that determines the primitives in the geometry. + * @param {BoundingSphere} [options.boundingSphere] An optional bounding sphere that fully enclosed the geometry. + * + * @see PolygonGeometry + * @see RectangleGeometry + * @see EllipseGeometry + * @see CircleGeometry + * @see WallGeometry + * @see SimplePolylineGeometry + * @see BoxGeometry + * @see EllipsoidGeometry + * + * @demo {@link https://sandcastle.cesium.com/index.html?src=Geometry%20and%20Appearances.html|Geometry and Appearances Demo} + * + * @example + * // Create geometry with a position attribute and indexed lines. + * const positions = new Float64Array([ + * 0.0, 0.0, 0.0, + * 7500000.0, 0.0, 0.0, + * 0.0, 7500000.0, 0.0 + * ]); + * + * const geometry = new Cesium.Geometry({ + * attributes : { + * position : new Cesium.GeometryAttribute({ + * componentDatatype : Cesium.ComponentDatatype.DOUBLE, + * componentsPerAttribute : 3, + * values : positions + * }) + * }, + * indices : new Uint16Array([0, 1, 1, 2, 2, 0]), + * primitiveType : Cesium.PrimitiveType.LINES, + * boundingSphere : Cesium.BoundingSphere.fromVertices(positions) + * }); + */ + function Geometry(options) { + options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT); + + //>>includeStart('debug', pragmas.debug); + Check.Check.typeOf.object("options.attributes", options.attributes); + //>>includeEnd('debug'); + + /** + * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a + * {@link GeometryAttribute} containing the attribute's data. + *+ * Attributes are always stored non-interleaved in a Geometry. + *
+ *+ * There are reserved attribute names with well-known semantics. The following attributes + * are created by a Geometry (depending on the provided {@link VertexFormat}. + *
position
- 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.normal
- Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.st
- 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.bitangent
- Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.tangent
- Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.+ * The following attribute names are generally not created by a Geometry, but are added + * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare + * the geometry for rendering. + *
position3DHigh
- High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.position3DLow
- Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.position3DHigh
- High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.position2DLow
- Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.color
- RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.pickColor
- RGBA color used for picking. 32-bit floating-point. 4 components per attribute.true
and componentDatatype
is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
+ * @param {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} [options.values] The values for the attributes stored in a typed array.
+ *
+ * @exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4.
+ *
+ *
+ * @example
+ * const geometry = new Cesium.Geometry({
+ * attributes : {
+ * position : new Cesium.GeometryAttribute({
+ * componentDatatype : Cesium.ComponentDatatype.FLOAT,
+ * componentsPerAttribute : 3,
+ * values : new Float32Array([
+ * 0.0, 0.0, 0.0,
+ * 7500000.0, 0.0, 0.0,
+ * 0.0, 7500000.0, 0.0
+ * ])
+ * })
+ * },
+ * primitiveType : Cesium.PrimitiveType.LINE_LOOP
+ * });
+ *
+ * @see Geometry
+ */
+ function GeometryAttribute(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(options.componentDatatype)) {
+ throw new Check.DeveloperError("options.componentDatatype is required.");
+ }
+ if (!defaultValue.defined(options.componentsPerAttribute)) {
+ throw new Check.DeveloperError("options.componentsPerAttribute is required.");
+ }
+ if (
+ options.componentsPerAttribute < 1 ||
+ options.componentsPerAttribute > 4
+ ) {
+ throw new Check.DeveloperError(
+ "options.componentsPerAttribute must be between 1 and 4."
+ );
+ }
+ if (!defaultValue.defined(options.values)) {
+ throw new Check.DeveloperError("options.values is required.");
+ }
+ //>>includeEnd('debug');
+
+ /**
+ * The datatype of each component in the attribute, e.g., individual elements in
+ * {@link GeometryAttribute#values}.
+ *
+ * @type ComponentDatatype
+ *
+ * @default undefined
+ */
+ this.componentDatatype = options.componentDatatype;
+
+ /**
+ * A number between 1 and 4 that defines the number of components in an attributes.
+ * For example, a position attribute with x, y, and z components would have 3 as
+ * shown in the code example.
+ *
+ * @type Number
+ *
+ * @default undefined
+ *
+ * @example
+ * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
+ * attribute.componentsPerAttribute = 3;
+ * attribute.values = new Float32Array([
+ * 0.0, 0.0, 0.0,
+ * 7500000.0, 0.0, 0.0,
+ * 0.0, 7500000.0, 0.0
+ * ]);
+ */
+ this.componentsPerAttribute = options.componentsPerAttribute;
+
+ /**
+ * When true
and componentDatatype
is an integer format,
+ * indicate that the components should be mapped to the range [0, 1] (unsigned)
+ * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
+ * + * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}. + *
+ * + * @type Boolean + * + * @default false + * + * @example + * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE; + * attribute.componentsPerAttribute = 4; + * attribute.normalize = true; + * attribute.values = new Uint8Array([ + * Cesium.Color.floatToByte(color.red), + * Cesium.Color.floatToByte(color.green), + * Cesium.Color.floatToByte(color.blue), + * Cesium.Color.floatToByte(color.alpha) + * ]); + */ + this.normalize = defaultValue.defaultValue(options.normalize, false); + + /** + * The values for the attributes stored in a typed array. In the code example, + * every three elements invalues
defines one attributes since
+ * componentsPerAttribute
is 3.
+ *
+ * @type {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array}
+ *
+ * @default undefined
+ *
+ * @example
+ * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;
+ * attribute.componentsPerAttribute = 3;
+ * attribute.values = new Float32Array([
+ * 0.0, 0.0, 0.0,
+ * 7500000.0, 0.0, 0.0,
+ * 0.0, 7500000.0, 0.0
+ * ]);
+ */
+ this.values = options.values;
+ }
+
+ exports.Geometry = Geometry;
+ exports.GeometryAttribute = GeometryAttribute;
+ exports.GeometryType = GeometryType$1;
+ exports.PrimitiveType = PrimitiveType$1;
+
+}));
+//# sourceMappingURL=GeometryAttribute-f2746b95.js.map
diff --git a/examples/cesium/Workers/GeometryAttribute-f2746b95.js.map b/examples/cesium/Workers/GeometryAttribute-f2746b95.js.map
new file mode 100644
index 0000000..796c82b
--- /dev/null
+++ b/examples/cesium/Workers/GeometryAttribute-f2746b95.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"GeometryAttribute-f2746b95.js","sources":["../../../Source/Core/GeometryType.js","../../../Source/Core/PrimitiveType.js","../../../Source/Core/Geometry.js","../../../Source/Core/GeometryAttribute.js"],"sourcesContent":["/**\r\n * @private\r\n */\r\nconst GeometryType = {\r\n NONE: 0,\r\n TRIANGLES: 1,\r\n LINES: 2,\r\n POLYLINES: 3,\r\n};\r\nexport default Object.freeze(GeometryType);\r\n","import WebGLConstants from \"./WebGLConstants.js\";\r\n\r\n/**\r\n * The type of a geometric primitive, i.e., points, lines, and triangles.\r\n *\r\n * @enum {Number}\r\n */\r\nconst PrimitiveType = {\r\n /**\r\n * Points primitive where each vertex (or index) is a separate point.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n POINTS: WebGLConstants.POINTS,\r\n\r\n /**\r\n * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n LINES: WebGLConstants.LINES,\r\n\r\n /**\r\n * Line loop primitive where each vertex (or index) after the first connects a line to\r\n * the previous vertex, and the last vertex implicitly connects to the first.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n LINE_LOOP: WebGLConstants.LINE_LOOP,\r\n\r\n /**\r\n * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n LINE_STRIP: WebGLConstants.LINE_STRIP,\r\n\r\n /**\r\n * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n TRIANGLES: WebGLConstants.TRIANGLES,\r\n\r\n /**\r\n * Triangle strip primitive where each vertex (or index) after the first two connect to\r\n * the previous two vertices forming a triangle. For example, this can be used to model a wall.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n TRIANGLE_STRIP: WebGLConstants.TRIANGLE_STRIP,\r\n\r\n /**\r\n * Triangle fan primitive where each vertex (or index) after the first two connect to\r\n * the previous vertex and the first vertex forming a triangle. For example, this can be used\r\n * to model a cone or circle.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n TRIANGLE_FAN: WebGLConstants.TRIANGLE_FAN,\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPrimitiveType.isLines = function (primitiveType) {\r\n return (\r\n primitiveType === PrimitiveType.LINES ||\r\n primitiveType === PrimitiveType.LINE_LOOP ||\r\n primitiveType === PrimitiveType.LINE_STRIP\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPrimitiveType.isTriangles = function (primitiveType) {\r\n return (\r\n primitiveType === PrimitiveType.TRIANGLES ||\r\n primitiveType === PrimitiveType.TRIANGLE_STRIP ||\r\n primitiveType === PrimitiveType.TRIANGLE_FAN\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPrimitiveType.validate = function (primitiveType) {\r\n return (\r\n primitiveType === PrimitiveType.POINTS ||\r\n primitiveType === PrimitiveType.LINES ||\r\n primitiveType === PrimitiveType.LINE_LOOP ||\r\n primitiveType === PrimitiveType.LINE_STRIP ||\r\n primitiveType === PrimitiveType.TRIANGLES ||\r\n primitiveType === PrimitiveType.TRIANGLE_STRIP ||\r\n primitiveType === PrimitiveType.TRIANGLE_FAN\r\n );\r\n};\r\n\r\nexport default Object.freeze(PrimitiveType);\r\n","import Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport GeometryType from \"./GeometryType.js\";\r\nimport Matrix2 from \"./Matrix2.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\nimport Transforms from \"./Transforms.js\";\r\n\r\n/**\r\n * A geometry representation with attributes forming vertices and optional index data\r\n * defining primitives. Geometries and an {@link Appearance}, which describes the shading,\r\n * can be assigned to a {@link Primitive} for visualization. A Primitive
can\r\n * be created from many heterogeneous - in many cases - geometries for performance.\r\n * \r\n * Geometries can be transformed and optimized using functions in {@link GeometryPipeline}.\r\n *
\r\n *\r\n * @alias Geometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {GeometryAttributes} options.attributes Attributes, which make up the geometry's vertices.\r\n * @param {PrimitiveType} [options.primitiveType=PrimitiveType.TRIANGLES] The type of primitives in the geometry.\r\n * @param {Uint16Array|Uint32Array} [options.indices] Optional index data that determines the primitives in the geometry.\r\n * @param {BoundingSphere} [options.boundingSphere] An optional bounding sphere that fully enclosed the geometry.\r\n *\r\n * @see PolygonGeometry\r\n * @see RectangleGeometry\r\n * @see EllipseGeometry\r\n * @see CircleGeometry\r\n * @see WallGeometry\r\n * @see SimplePolylineGeometry\r\n * @see BoxGeometry\r\n * @see EllipsoidGeometry\r\n *\r\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Geometry%20and%20Appearances.html|Geometry and Appearances Demo}\r\n *\r\n * @example\r\n * // Create geometry with a position attribute and indexed lines.\r\n * const positions = new Float64Array([\r\n * 0.0, 0.0, 0.0,\r\n * 7500000.0, 0.0, 0.0,\r\n * 0.0, 7500000.0, 0.0\r\n * ]);\r\n *\r\n * const geometry = new Cesium.Geometry({\r\n * attributes : {\r\n * position : new Cesium.GeometryAttribute({\r\n * componentDatatype : Cesium.ComponentDatatype.DOUBLE,\r\n * componentsPerAttribute : 3,\r\n * values : positions\r\n * })\r\n * },\r\n * indices : new Uint16Array([0, 1, 1, 2, 2, 0]),\r\n * primitiveType : Cesium.PrimitiveType.LINES,\r\n * boundingSphere : Cesium.BoundingSphere.fromVertices(positions)\r\n * });\r\n */\r\nfunction Geometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"options.attributes\", options.attributes);\r\n //>>includeEnd('debug');\r\n\r\n /**\r\n * Attributes, which make up the geometry's vertices. Each property in this object corresponds to a\r\n * {@link GeometryAttribute} containing the attribute's data.\r\n *\r\n * Attributes are always stored non-interleaved in a Geometry.\r\n *
\r\n *\r\n * There are reserved attribute names with well-known semantics. The following attributes\r\n * are created by a Geometry (depending on the provided {@link VertexFormat}.\r\n *
position
- 3D vertex position. 64-bit floating-point (for precision). 3 components per attribute. See {@link VertexFormat#position}.normal
- Normal (normalized), commonly used for lighting. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#normal}.st
- 2D texture coordinate. 32-bit floating-point. 2 components per attribute. See {@link VertexFormat#st}.bitangent
- Bitangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#bitangent}.tangent
- Tangent (normalized), used for tangent-space effects like bump mapping. 32-bit floating-point. 3 components per attribute. See {@link VertexFormat#tangent}.\r\n * The following attribute names are generally not created by a Geometry, but are added\r\n * to a Geometry by a {@link Primitive} or {@link GeometryPipeline} functions to prepare\r\n * the geometry for rendering.\r\n *
position3DHigh
- High 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.position3DLow
- Low 32 bits for encoded 64-bit position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.position3DHigh
- High 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.position2DLow
- Low 32 bits for encoded 64-bit 2D (Columbus view) position computed with {@link GeometryPipeline.encodeAttribute}. 32-bit floating-point. 4 components per attribute.color
- RGBA color (normalized) usually from {@link GeometryInstance#color}. 32-bit floating-point. 4 components per attribute.pickColor
- RGBA color used for picking. 32-bit floating-point. 4 components per attribute.true
and componentDatatype
is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.\r\n * @param {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} [options.values] The values for the attributes stored in a typed array.\r\n *\r\n * @exception {DeveloperError} options.componentsPerAttribute must be between 1 and 4.\r\n *\r\n *\r\n * @example\r\n * const geometry = new Cesium.Geometry({\r\n * attributes : {\r\n * position : new Cesium.GeometryAttribute({\r\n * componentDatatype : Cesium.ComponentDatatype.FLOAT,\r\n * componentsPerAttribute : 3,\r\n * values : new Float32Array([\r\n * 0.0, 0.0, 0.0,\r\n * 7500000.0, 0.0, 0.0,\r\n * 0.0, 7500000.0, 0.0\r\n * ])\r\n * })\r\n * },\r\n * primitiveType : Cesium.PrimitiveType.LINE_LOOP\r\n * });\r\n *\r\n * @see Geometry\r\n */\r\nfunction GeometryAttribute(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(options.componentDatatype)) {\r\n throw new DeveloperError(\"options.componentDatatype is required.\");\r\n }\r\n if (!defined(options.componentsPerAttribute)) {\r\n throw new DeveloperError(\"options.componentsPerAttribute is required.\");\r\n }\r\n if (\r\n options.componentsPerAttribute < 1 ||\r\n options.componentsPerAttribute > 4\r\n ) {\r\n throw new DeveloperError(\r\n \"options.componentsPerAttribute must be between 1 and 4.\"\r\n );\r\n }\r\n if (!defined(options.values)) {\r\n throw new DeveloperError(\"options.values is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n /**\r\n * The datatype of each component in the attribute, e.g., individual elements in\r\n * {@link GeometryAttribute#values}.\r\n *\r\n * @type ComponentDatatype\r\n *\r\n * @default undefined\r\n */\r\n this.componentDatatype = options.componentDatatype;\r\n\r\n /**\r\n * A number between 1 and 4 that defines the number of components in an attributes.\r\n * For example, a position attribute with x, y, and z components would have 3 as\r\n * shown in the code example.\r\n *\r\n * @type Number\r\n *\r\n * @default undefined\r\n *\r\n * @example\r\n * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;\r\n * attribute.componentsPerAttribute = 3;\r\n * attribute.values = new Float32Array([\r\n * 0.0, 0.0, 0.0,\r\n * 7500000.0, 0.0, 0.0,\r\n * 0.0, 7500000.0, 0.0\r\n * ]);\r\n */\r\n this.componentsPerAttribute = options.componentsPerAttribute;\r\n\r\n /**\r\n * When true
and componentDatatype
is an integer format,\r\n * indicate that the components should be mapped to the range [0, 1] (unsigned)\r\n * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\r\n * \r\n * This is commonly used when storing colors using {@link ComponentDatatype.UNSIGNED_BYTE}.\r\n *
\r\n *\r\n * @type Boolean\r\n *\r\n * @default false\r\n *\r\n * @example\r\n * attribute.componentDatatype = Cesium.ComponentDatatype.UNSIGNED_BYTE;\r\n * attribute.componentsPerAttribute = 4;\r\n * attribute.normalize = true;\r\n * attribute.values = new Uint8Array([\r\n * Cesium.Color.floatToByte(color.red),\r\n * Cesium.Color.floatToByte(color.green),\r\n * Cesium.Color.floatToByte(color.blue),\r\n * Cesium.Color.floatToByte(color.alpha)\r\n * ]);\r\n */\r\n this.normalize = defaultValue(options.normalize, false);\r\n\r\n /**\r\n * The values for the attributes stored in a typed array. In the code example,\r\n * every three elements invalues
defines one attributes since\r\n * componentsPerAttribute
is 3.\r\n *\r\n * @type {number[]|Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array}\r\n *\r\n * @default undefined\r\n *\r\n * @example\r\n * attribute.componentDatatype = Cesium.ComponentDatatype.FLOAT;\r\n * attribute.componentsPerAttribute = 3;\r\n * attribute.values = new Float32Array([\r\n * 0.0, 0.0, 0.0,\r\n * 7500000.0, 0.0, 0.0,\r\n * 0.0, 7500000.0, 0.0\r\n * ]);\r\n */\r\n this.values = options.values;\r\n}\r\nexport default GeometryAttribute;\r\n"],"names":["WebGLConstants","defaultValue","Check","PrimitiveType","GeometryType","defined","DeveloperError","Cartographic","Cartesian3","Matrix4","Cartesian2","Quaternion","Matrix2","Rectangle","Transforms","Matrix3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA,MAAM,YAAY,GAAG;EACrB,EAAE,IAAI,EAAE,CAAC;EACT,EAAE,SAAS,EAAE,CAAC;EACd,EAAE,KAAK,EAAE,CAAC;EACV,EAAE,SAAS,EAAE,CAAC;EACd,CAAC,CAAC;AACF,uBAAe,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;;ECP1C;EACA;EACA;EACA;EACA;EACA,MAAM,aAAa,GAAG;EACtB;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,MAAM,EAAEA,6BAAc,CAAC,MAAM;AAC/B;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,KAAK,EAAEA,6BAAc,CAAC,KAAK;AAC7B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,EAAEA,6BAAc,CAAC,SAAS;AACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,UAAU,EAAEA,6BAAc,CAAC,UAAU;AACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,EAAEA,6BAAc,CAAC,SAAS;AACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,cAAc,EAAEA,6BAAc,CAAC,cAAc;AAC/C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,YAAY,EAAEA,6BAAc,CAAC,YAAY;EAC3C,CAAC,CAA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O,GAAGC,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA;EACA,EAAEC,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;EAChE;AACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;AACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,aAAa,GAAGD,yBAAY;EACnC,IAAI,OAAO,CAAC,aAAa;EACzB,IAAIE,eAAa,CAAC,SAAS;EAC3B,GAAG,CAAC;AACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;AAC/C;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,YAAY,GAAGF,yBAAY,CAAC,OAAO,CAAC,YAAY,EAAEG,cAAY,CAAC,IAAI,CAAC,CAAC;AAC5E;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACnD;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;EACjD,CAAC;AACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ,CAAC,uBAAuB,GAAG,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C,IAAI;EACJ,IAAI,MAAM,IAAIA,oBAAc;EAC5B,MAAM,yDAAyD;EAC/D,KAAK,CAAC;EACN,GAAG;EACH,EAAE,IAAI,CAACD,oBAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;EAChC,IAAI,MAAM,IAAIC,oBAAc,CAAC,6BAA6B,CAAC,CAAC;EAC5D,GAAG;EACH;AACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;AACrD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;AAC/D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,SAAS,GAAGL,yBAAY,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC1D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;EAC/B;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/GeometryAttributes-eb2609b7.js b/examples/cesium/Workers/GeometryAttributes-eb2609b7.js
new file mode 100644
index 0000000..3756359
--- /dev/null
+++ b/examples/cesium/Workers/GeometryAttributes-eb2609b7.js
@@ -0,0 +1,117 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './defaultValue-0ab18f7d'], (function (exports, defaultValue) { 'use strict';
+
+ /**
+ * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a
+ * {@link GeometryAttribute} containing the attribute's data.
+ * + * Attributes are always stored non-interleaved in a Geometry. + *
+ * + * @alias GeometryAttributes + * @constructor + */ + function GeometryAttributes(options) { + options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT); + + /** + * The 3D position attribute. + *+ * 64-bit floating-point (for precision). 3 components per attribute. + *
+ * + * @type GeometryAttribute + * + * @default undefined + */ + this.position = options.position; + + /** + * The normal attribute (normalized), which is commonly used for lighting. + *+ * 32-bit floating-point. 3 components per attribute. + *
+ * + * @type GeometryAttribute + * + * @default undefined + */ + this.normal = options.normal; + + /** + * The 2D texture coordinate attribute. + *+ * 32-bit floating-point. 2 components per attribute + *
+ * + * @type GeometryAttribute + * + * @default undefined + */ + this.st = options.st; + + /** + * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping. + *+ * 32-bit floating-point. 3 components per attribute. + *
+ * + * @type GeometryAttribute + * + * @default undefined + */ + this.bitangent = options.bitangent; + + /** + * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping. + *+ * 32-bit floating-point. 3 components per attribute. + *
+ * + * @type GeometryAttribute + * + * @default undefined + */ + this.tangent = options.tangent; + + /** + * The color attribute. + *+ * 8-bit unsigned integer. 4 components per attribute. + *
+ * + * @type GeometryAttribute + * + * @default undefined + */ + this.color = options.color; + } + + exports.GeometryAttributes = GeometryAttributes; + +})); +//# sourceMappingURL=GeometryAttributes-eb2609b7.js.map diff --git a/examples/cesium/Workers/GeometryAttributes-eb2609b7.js.map b/examples/cesium/Workers/GeometryAttributes-eb2609b7.js.map new file mode 100644 index 0000000..8cdaf07 --- /dev/null +++ b/examples/cesium/Workers/GeometryAttributes-eb2609b7.js.map @@ -0,0 +1 @@ +{"version":3,"file":"GeometryAttributes-eb2609b7.js","sources":["../../../Source/Core/GeometryAttributes.js"],"sourcesContent":["import defaultValue from \"./defaultValue.js\";\r\n\r\n/**\r\n * Attributes, which make up a geometry's vertices. Each property in this object corresponds to a\r\n * {@link GeometryAttribute} containing the attribute's data.\r\n *\r\n * Attributes are always stored non-interleaved in a Geometry.\r\n *
\r\n *\r\n * @alias GeometryAttributes\r\n * @constructor\r\n */\r\nfunction GeometryAttributes(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n /**\r\n * The 3D position attribute.\r\n *\r\n * 64-bit floating-point (for precision). 3 components per attribute.\r\n *
\r\n *\r\n * @type GeometryAttribute\r\n *\r\n * @default undefined\r\n */\r\n this.position = options.position;\r\n\r\n /**\r\n * The normal attribute (normalized), which is commonly used for lighting.\r\n *\r\n * 32-bit floating-point. 3 components per attribute.\r\n *
\r\n *\r\n * @type GeometryAttribute\r\n *\r\n * @default undefined\r\n */\r\n this.normal = options.normal;\r\n\r\n /**\r\n * The 2D texture coordinate attribute.\r\n *\r\n * 32-bit floating-point. 2 components per attribute\r\n *
\r\n *\r\n * @type GeometryAttribute\r\n *\r\n * @default undefined\r\n */\r\n this.st = options.st;\r\n\r\n /**\r\n * The bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.\r\n *\r\n * 32-bit floating-point. 3 components per attribute.\r\n *
\r\n *\r\n * @type GeometryAttribute\r\n *\r\n * @default undefined\r\n */\r\n this.bitangent = options.bitangent;\r\n\r\n /**\r\n * The tangent attribute (normalized), which is used for tangent-space effects like bump mapping.\r\n *\r\n * 32-bit floating-point. 3 components per attribute.\r\n *
\r\n *\r\n * @type GeometryAttribute\r\n *\r\n * @default undefined\r\n */\r\n this.tangent = options.tangent;\r\n\r\n /**\r\n * The color attribute.\r\n *\r\n * 8-bit unsigned integer. 4 components per attribute.\r\n *
\r\n *\r\n * @type GeometryAttribute\r\n *\r\n * @default undefined\r\n */\r\n this.color = options.color;\r\n}\r\nexport default GeometryAttributes;\r\n"],"names":["defaultValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,kBAAkB,CAAC,OAAO,EAAE;EACrC,EAAE,OAAO,GAAGA,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAC/B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;AACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;AACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;EAC7B;;;;;;;;"} \ No newline at end of file diff --git a/examples/cesium/Workers/GeometryInstance-b2be3e5a.js b/examples/cesium/Workers/GeometryInstance-b2be3e5a.js new file mode 100644 index 0000000..7f41461 --- /dev/null +++ b/examples/cesium/Workers/GeometryInstance-b2be3e5a.js @@ -0,0 +1,147 @@ +/** + * @license + * Cesium - https://github.com/CesiumGS/cesium + * Version 1.99 + * + * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. + */ + +define(['exports', './defaultValue-0ab18f7d', './Check-d10e5f2e', './Matrix2-036c77dd'], (function (exports, defaultValue, Check, Matrix2) { 'use strict'; + + /** + * Geometry instancing allows one {@link Geometry} object to be positions in several + * different locations and colored uniquely. For example, one {@link BoxGeometry} can + * be instanced several times, each with a differentmodelMatrix
to change
+ * its position, rotation, and scale.
+ *
+ * @alias GeometryInstance
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Geometry|GeometryFactory} options.geometry The geometry to instance.
+ * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The model matrix that transforms to transform the geometry from model to world coordinates.
+ * @param {Object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick} or get/set per-instance attributes with {@link Primitive#getGeometryInstanceAttributes}.
+ * @param {Object} [options.attributes] Per-instance attributes like a show or color attribute shown in the example below.
+ *
+ *
+ * @example
+ * // Create geometry for a box, and two instances that refer to it.
+ * // One instance positions the box on the bottom and colored aqua.
+ * // The other instance positions the box on the top and color white.
+ * const geometry = Cesium.BoxGeometry.fromDimensions({
+ * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
+ * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)
+ * });
+ * const instanceBottom = new Cesium.GeometryInstance({
+ * geometry : geometry,
+ * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
+ * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
+ * attributes : {
+ * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
+ * },
+ * id : 'bottom'
+ * });
+ * const instanceTop = new Cesium.GeometryInstance({
+ * geometry : geometry,
+ * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
+ * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),
+ * attributes : {
+ * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)
+ * },
+ * id : 'top'
+ * });
+ *
+ * @see Geometry
+ */
+ function GeometryInstance(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(options.geometry)) {
+ throw new Check.DeveloperError("options.geometry is required.");
+ }
+ //>>includeEnd('debug');
+
+ /**
+ * The geometry being instanced.
+ *
+ * @type Geometry
+ *
+ * @default undefined
+ */
+ this.geometry = options.geometry;
+
+ /**
+ * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.
+ * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.
+ * Local reference frames can be used by providing a different transformation matrix, like that returned
+ * by {@link Transforms.eastNorthUpToFixedFrame}.
+ *
+ * @type Matrix4
+ *
+ * @default Matrix4.IDENTITY
+ */
+ this.modelMatrix = Matrix2.Matrix4.clone(
+ defaultValue.defaultValue(options.modelMatrix, Matrix2.Matrix4.IDENTITY)
+ );
+
+ /**
+ * User-defined object returned when the instance is picked or used to get/set per-instance attributes.
+ *
+ * @type Object
+ *
+ * @default undefined
+ *
+ * @see Scene#pick
+ * @see Primitive#getGeometryInstanceAttributes
+ */
+ this.id = options.id;
+
+ /**
+ * Used for picking primitives that wrap geometry instances.
+ *
+ * @private
+ */
+ this.pickPrimitive = options.pickPrimitive;
+
+ /**
+ * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.
+ * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.
+ *
+ * @type Object
+ *
+ * @default undefined
+ */
+ this.attributes = defaultValue.defaultValue(options.attributes, {});
+
+ /**
+ * @private
+ */
+ this.westHemisphereGeometry = undefined;
+ /**
+ * @private
+ */
+ this.eastHemisphereGeometry = undefined;
+ }
+
+ exports.GeometryInstance = GeometryInstance;
+
+}));
+//# sourceMappingURL=GeometryInstance-b2be3e5a.js.map
diff --git a/examples/cesium/Workers/GeometryInstance-b2be3e5a.js.map b/examples/cesium/Workers/GeometryInstance-b2be3e5a.js.map
new file mode 100644
index 0000000..368a0ca
--- /dev/null
+++ b/examples/cesium/Workers/GeometryInstance-b2be3e5a.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"GeometryInstance-b2be3e5a.js","sources":["../../../Source/Core/GeometryInstance.js"],"sourcesContent":["import defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\n\r\n/**\r\n * Geometry instancing allows one {@link Geometry} object to be positions in several\r\n * different locations and colored uniquely. For example, one {@link BoxGeometry} can\r\n * be instanced several times, each with a different modelMatrix
to change\r\n * its position, rotation, and scale.\r\n *\r\n * @alias GeometryInstance\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Geometry|GeometryFactory} options.geometry The geometry to instance.\r\n * @param {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The model matrix that transforms to transform the geometry from model to world coordinates.\r\n * @param {Object} [options.id] A user-defined object to return when the instance is picked with {@link Scene#pick} or get/set per-instance attributes with {@link Primitive#getGeometryInstanceAttributes}.\r\n * @param {Object} [options.attributes] Per-instance attributes like a show or color attribute shown in the example below.\r\n *\r\n *\r\n * @example\r\n * // Create geometry for a box, and two instances that refer to it.\r\n * // One instance positions the box on the bottom and colored aqua.\r\n * // The other instance positions the box on the top and color white.\r\n * const geometry = Cesium.BoxGeometry.fromDimensions({\r\n * vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,\r\n * dimensions : new Cesium.Cartesian3(1000000.0, 1000000.0, 500000.0)\r\n * });\r\n * const instanceBottom = new Cesium.GeometryInstance({\r\n * geometry : geometry,\r\n * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\r\n * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),\r\n * attributes : {\r\n * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)\r\n * },\r\n * id : 'bottom'\r\n * });\r\n * const instanceTop = new Cesium.GeometryInstance({\r\n * geometry : geometry,\r\n * modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(\r\n * Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 3000000.0), new Cesium.Matrix4()),\r\n * attributes : {\r\n * color : Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)\r\n * },\r\n * id : 'top'\r\n * });\r\n *\r\n * @see Geometry\r\n */\r\nfunction GeometryInstance(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(options.geometry)) {\r\n throw new DeveloperError(\"options.geometry is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n /**\r\n * The geometry being instanced.\r\n *\r\n * @type Geometry\r\n *\r\n * @default undefined\r\n */\r\n this.geometry = options.geometry;\r\n\r\n /**\r\n * The 4x4 transformation matrix that transforms the geometry from model to world coordinates.\r\n * When this is the identity matrix, the geometry is drawn in world coordinates, i.e., Earth's WGS84 coordinates.\r\n * Local reference frames can be used by providing a different transformation matrix, like that returned\r\n * by {@link Transforms.eastNorthUpToFixedFrame}.\r\n *\r\n * @type Matrix4\r\n *\r\n * @default Matrix4.IDENTITY\r\n */\r\n this.modelMatrix = Matrix4.clone(\r\n defaultValue(options.modelMatrix, Matrix4.IDENTITY)\r\n );\r\n\r\n /**\r\n * User-defined object returned when the instance is picked or used to get/set per-instance attributes.\r\n *\r\n * @type Object\r\n *\r\n * @default undefined\r\n *\r\n * @see Scene#pick\r\n * @see Primitive#getGeometryInstanceAttributes\r\n */\r\n this.id = options.id;\r\n\r\n /**\r\n * Used for picking primitives that wrap geometry instances.\r\n *\r\n * @private\r\n */\r\n this.pickPrimitive = options.pickPrimitive;\r\n\r\n /**\r\n * Per-instance attributes like {@link ColorGeometryInstanceAttribute} or {@link ShowGeometryInstanceAttribute}.\r\n * {@link Geometry} attributes varying per vertex; these attributes are constant for the entire instance.\r\n *\r\n * @type Object\r\n *\r\n * @default undefined\r\n */\r\n this.attributes = defaultValue(options.attributes, {});\r\n\r\n /**\r\n * @private\r\n */\r\n this.westHemisphereGeometry = undefined;\r\n /**\r\n * @private\r\n */\r\n this.eastHemisphereGeometry = undefined;\r\n}\r\nexport default GeometryInstance;\r\n"],"names":["defaultValue","defined","DeveloperError","Matrix4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,gBAAgB,CAAC,OAAO,EAAE;EACnC,EAAE,OAAO,GAAGA,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA;EACA,EAAE,IAAI,CAACC,oBAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;EAClC,IAAI,MAAM,IAAIC,oBAAc,CAAC,+BAA+B,CAAC,CAAC;EAC9D,GAAG;EACH;AACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;AACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,WAAW,GAAGC,eAAO,CAAC,KAAK;EAClC,IAAIH,yBAAY,CAAC,OAAO,CAAC,WAAW,EAAEG,eAAO,CAAC,QAAQ,CAAC;EACvD,GAAG,CAAC;AACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;AACvB;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAC7C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,UAAU,GAAGH,yBAAY,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AACzD;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;EAC1C;EACA;EACA;EACA,EAAE,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;EAC1C;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/GeometryOffsetAttribute-cc320d7d.js b/examples/cesium/Workers/GeometryOffsetAttribute-cc320d7d.js
new file mode 100644
index 0000000..f88c423
--- /dev/null
+++ b/examples/cesium/Workers/GeometryOffsetAttribute-cc320d7d.js
@@ -0,0 +1,42 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports'], (function (exports) { 'use strict';
+
+ /**
+ * Represents which vertices should have a value of `true` for the `applyOffset` attribute
+ * @private
+ */
+ const GeometryOffsetAttribute = {
+ NONE: 0,
+ TOP: 1,
+ ALL: 2,
+ };
+ var GeometryOffsetAttribute$1 = Object.freeze(GeometryOffsetAttribute);
+
+ exports.GeometryOffsetAttribute = GeometryOffsetAttribute$1;
+
+}));
+//# sourceMappingURL=GeometryOffsetAttribute-cc320d7d.js.map
diff --git a/examples/cesium/Workers/GeometryOffsetAttribute-cc320d7d.js.map b/examples/cesium/Workers/GeometryOffsetAttribute-cc320d7d.js.map
new file mode 100644
index 0000000..e7df18f
--- /dev/null
+++ b/examples/cesium/Workers/GeometryOffsetAttribute-cc320d7d.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"GeometryOffsetAttribute-cc320d7d.js","sources":["../../../Source/Core/GeometryOffsetAttribute.js"],"sourcesContent":["/**\r\n * Represents which vertices should have a value of `true` for the `applyOffset` attribute\r\n * @private\r\n */\r\nconst GeometryOffsetAttribute = {\r\n NONE: 0,\r\n TOP: 1,\r\n ALL: 2,\r\n};\r\nexport default Object.freeze(GeometryOffsetAttribute);\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA,MAAM,uBAAuB,GAAG;EAChC,EAAE,IAAI,EAAE,CAAC;EACT,EAAE,GAAG,EAAE,CAAC;EACR,EAAE,GAAG,EAAE,CAAC;EACR,CAAC,CAAC;AACF,kCAAe,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/GeometryPipeline-f28890f4.js b/examples/cesium/Workers/GeometryPipeline-f28890f4.js
new file mode 100644
index 0000000..503adbc
--- /dev/null
+++ b/examples/cesium/Workers/GeometryPipeline-f28890f4.js
@@ -0,0 +1,3716 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './AttributeCompression-e9888cb8', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Math-9be8b918', './Transforms-11fb6b0a', './ComponentDatatype-13a5630b', './EncodedCartesian3-38e2691f', './GeometryAttribute-f2746b95', './IndexDatatype-b4e5cf89', './IntersectionTests-2c7928de', './Plane-c9f1487d'], (function (exports, AttributeCompression, Matrix2, Matrix3, Check, defaultValue, Math$1, Transforms, ComponentDatatype, EncodedCartesian3, GeometryAttribute, IndexDatatype, IntersectionTests, Plane) { 'use strict';
+
+ const scratchCartesian1 = new Matrix3.Cartesian3();
+ const scratchCartesian2$1 = new Matrix3.Cartesian3();
+ const scratchCartesian3$1 = new Matrix3.Cartesian3();
+
+ /**
+ * Computes the barycentric coordinates for a point with respect to a triangle.
+ *
+ * @function
+ *
+ * @param {Cartesian2|Cartesian3} point The point to test.
+ * @param {Cartesian2|Cartesian3} p0 The first point of the triangle, corresponding to the barycentric x-axis.
+ * @param {Cartesian2|Cartesian3} p1 The second point of the triangle, corresponding to the barycentric y-axis.
+ * @param {Cartesian2|Cartesian3} p2 The third point of the triangle, corresponding to the barycentric z-axis.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3|undefined} The modified result parameter or a new Cartesian3 instance if one was not provided. If the triangle is degenerate the function will return undefined.
+ *
+ * @example
+ * // Returns Cartesian3.UNIT_X
+ * const p = new Cesium.Cartesian3(-1.0, 0.0, 0.0);
+ * const b = Cesium.barycentricCoordinates(p,
+ * new Cesium.Cartesian3(-1.0, 0.0, 0.0),
+ * new Cesium.Cartesian3( 1.0, 0.0, 0.0),
+ * new Cesium.Cartesian3( 0.0, 1.0, 1.0));
+ */
+ function barycentricCoordinates(point, p0, p1, p2, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("point", point);
+ Check.Check.defined("p0", p0);
+ Check.Check.defined("p1", p1);
+ Check.Check.defined("p2", p2);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ // Implementation based on http://www.blackpawn.com/texts/pointinpoly/default.html.
+ let v0;
+ let v1;
+ let v2;
+ let dot00;
+ let dot01;
+ let dot02;
+ let dot11;
+ let dot12;
+
+ if (!defaultValue.defined(p0.z)) {
+ if (Matrix2.Cartesian2.equalsEpsilon(point, p0, Math$1.CesiumMath.EPSILON14)) {
+ return Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_X, result);
+ }
+ if (Matrix2.Cartesian2.equalsEpsilon(point, p1, Math$1.CesiumMath.EPSILON14)) {
+ return Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_Y, result);
+ }
+ if (Matrix2.Cartesian2.equalsEpsilon(point, p2, Math$1.CesiumMath.EPSILON14)) {
+ return Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_Z, result);
+ }
+
+ v0 = Matrix2.Cartesian2.subtract(p1, p0, scratchCartesian1);
+ v1 = Matrix2.Cartesian2.subtract(p2, p0, scratchCartesian2$1);
+ v2 = Matrix2.Cartesian2.subtract(point, p0, scratchCartesian3$1);
+
+ dot00 = Matrix2.Cartesian2.dot(v0, v0);
+ dot01 = Matrix2.Cartesian2.dot(v0, v1);
+ dot02 = Matrix2.Cartesian2.dot(v0, v2);
+ dot11 = Matrix2.Cartesian2.dot(v1, v1);
+ dot12 = Matrix2.Cartesian2.dot(v1, v2);
+ } else {
+ if (Matrix3.Cartesian3.equalsEpsilon(point, p0, Math$1.CesiumMath.EPSILON14)) {
+ return Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_X, result);
+ }
+ if (Matrix3.Cartesian3.equalsEpsilon(point, p1, Math$1.CesiumMath.EPSILON14)) {
+ return Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_Y, result);
+ }
+ if (Matrix3.Cartesian3.equalsEpsilon(point, p2, Math$1.CesiumMath.EPSILON14)) {
+ return Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_Z, result);
+ }
+
+ v0 = Matrix3.Cartesian3.subtract(p1, p0, scratchCartesian1);
+ v1 = Matrix3.Cartesian3.subtract(p2, p0, scratchCartesian2$1);
+ v2 = Matrix3.Cartesian3.subtract(point, p0, scratchCartesian3$1);
+
+ dot00 = Matrix3.Cartesian3.dot(v0, v0);
+ dot01 = Matrix3.Cartesian3.dot(v0, v1);
+ dot02 = Matrix3.Cartesian3.dot(v0, v2);
+ dot11 = Matrix3.Cartesian3.dot(v1, v1);
+ dot12 = Matrix3.Cartesian3.dot(v1, v2);
+ }
+
+ result.y = dot11 * dot02 - dot01 * dot12;
+ result.z = dot00 * dot12 - dot01 * dot02;
+ const q = dot00 * dot11 - dot01 * dot01;
+
+ // Triangle is degenerate
+ if (q === 0) {
+ return undefined;
+ }
+
+ result.y /= q;
+ result.z /= q;
+ result.x = 1.0 - result.y - result.z;
+ return result;
+ }
+
+ /**
+ * Encapsulates an algorithm to optimize triangles for the post
+ * vertex-shader cache. This is based on the 2007 SIGGRAPH paper
+ * 'Fast Triangle Reordering for Vertex Locality and Reduced Overdraw.'
+ * The runtime is linear but several passes are made.
+ *
+ * @namespace Tipsify
+ *
+ * @see
+ * Fast Triangle Reordering for Vertex Locality and Reduced Overdraw
+ * by Sander, Nehab, and Barczak
+ *
+ * @private
+ */
+ const Tipsify = {};
+
+ /**
+ * Calculates the average cache miss ratio (ACMR) for a given set of indices.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Number[]} options.indices Lists triads of numbers corresponding to the indices of the vertices
+ * in the vertex buffer that define the geometry's triangles.
+ * @param {Number} [options.maximumIndex] The maximum value of the elements in args.indices
.
+ * If not supplied, this value will be computed.
+ * @param {Number} [options.cacheSize=24] The number of vertices that can be stored in the cache at any one time.
+ * @returns {Number} The average cache miss ratio (ACMR).
+ *
+ * @exception {DeveloperError} indices length must be a multiple of three.
+ * @exception {DeveloperError} cacheSize must be greater than two.
+ *
+ * @example
+ * const indices = [0, 1, 2, 3, 4, 5];
+ * const maxIndex = 5;
+ * const cacheSize = 3;
+ * const acmr = Cesium.Tipsify.calculateACMR({indices : indices, maxIndex : maxIndex, cacheSize : cacheSize});
+ */
+ Tipsify.calculateACMR = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const indices = options.indices;
+ let maximumIndex = options.maximumIndex;
+ const cacheSize = defaultValue.defaultValue(options.cacheSize, 24);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(indices)) {
+ throw new Check.DeveloperError("indices is required.");
+ }
+ //>>includeEnd('debug');
+
+ const numIndices = indices.length;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (numIndices < 3 || numIndices % 3 !== 0) {
+ throw new Check.DeveloperError("indices length must be a multiple of three.");
+ }
+ if (maximumIndex <= 0) {
+ throw new Check.DeveloperError("maximumIndex must be greater than zero.");
+ }
+ if (cacheSize < 3) {
+ throw new Check.DeveloperError("cacheSize must be greater than two.");
+ }
+ //>>includeEnd('debug');
+
+ // Compute the maximumIndex if not given
+ if (!defaultValue.defined(maximumIndex)) {
+ maximumIndex = 0;
+ let currentIndex = 0;
+ let intoIndices = indices[currentIndex];
+ while (currentIndex < numIndices) {
+ if (intoIndices > maximumIndex) {
+ maximumIndex = intoIndices;
+ }
+ ++currentIndex;
+ intoIndices = indices[currentIndex];
+ }
+ }
+
+ // Vertex time stamps
+ const vertexTimeStamps = [];
+ for (let i = 0; i < maximumIndex + 1; i++) {
+ vertexTimeStamps[i] = 0;
+ }
+
+ // Cache processing
+ let s = cacheSize + 1;
+ for (let j = 0; j < numIndices; ++j) {
+ if (s - vertexTimeStamps[indices[j]] > cacheSize) {
+ vertexTimeStamps[indices[j]] = s;
+ ++s;
+ }
+ }
+
+ return (s - cacheSize + 1) / (numIndices / 3);
+ };
+
+ /**
+ * Optimizes triangles for the post-vertex shader cache.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Number[]} options.indices Lists triads of numbers corresponding to the indices of the vertices
+ * in the vertex buffer that define the geometry's triangles.
+ * @param {Number} [options.maximumIndex] The maximum value of the elements in args.indices
.
+ * If not supplied, this value will be computed.
+ * @param {Number} [options.cacheSize=24] The number of vertices that can be stored in the cache at any one time.
+ * @returns {Number[]} A list of the input indices in an optimized order.
+ *
+ * @exception {DeveloperError} indices length must be a multiple of three.
+ * @exception {DeveloperError} cacheSize must be greater than two.
+ *
+ * @example
+ * const indices = [0, 1, 2, 3, 4, 5];
+ * const maxIndex = 5;
+ * const cacheSize = 3;
+ * const reorderedIndices = Cesium.Tipsify.tipsify({indices : indices, maxIndex : maxIndex, cacheSize : cacheSize});
+ */
+ Tipsify.tipsify = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const indices = options.indices;
+ const maximumIndex = options.maximumIndex;
+ const cacheSize = defaultValue.defaultValue(options.cacheSize, 24);
+
+ let cursor;
+
+ function skipDeadEnd(vertices, deadEnd, indices, maximumIndexPlusOne) {
+ while (deadEnd.length >= 1) {
+ // while the stack is not empty
+ const d = deadEnd[deadEnd.length - 1]; // top of the stack
+ deadEnd.splice(deadEnd.length - 1, 1); // pop the stack
+
+ if (vertices[d].numLiveTriangles > 0) {
+ return d;
+ }
+ }
+
+ while (cursor < maximumIndexPlusOne) {
+ if (vertices[cursor].numLiveTriangles > 0) {
+ ++cursor;
+ return cursor - 1;
+ }
+ ++cursor;
+ }
+ return -1;
+ }
+
+ function getNextVertex(
+ indices,
+ cacheSize,
+ oneRing,
+ vertices,
+ s,
+ deadEnd,
+ maximumIndexPlusOne
+ ) {
+ let n = -1;
+ let p;
+ let m = -1;
+ let itOneRing = 0;
+ while (itOneRing < oneRing.length) {
+ const index = oneRing[itOneRing];
+ if (vertices[index].numLiveTriangles) {
+ p = 0;
+ if (
+ s -
+ vertices[index].timeStamp +
+ 2 * vertices[index].numLiveTriangles <=
+ cacheSize
+ ) {
+ p = s - vertices[index].timeStamp;
+ }
+ if (p > m || m === -1) {
+ m = p;
+ n = index;
+ }
+ }
+ ++itOneRing;
+ }
+ if (n === -1) {
+ return skipDeadEnd(vertices, deadEnd, indices, maximumIndexPlusOne);
+ }
+ return n;
+ }
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(indices)) {
+ throw new Check.DeveloperError("indices is required.");
+ }
+ //>>includeEnd('debug');
+
+ const numIndices = indices.length;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (numIndices < 3 || numIndices % 3 !== 0) {
+ throw new Check.DeveloperError("indices length must be a multiple of three.");
+ }
+ if (maximumIndex <= 0) {
+ throw new Check.DeveloperError("maximumIndex must be greater than zero.");
+ }
+ if (cacheSize < 3) {
+ throw new Check.DeveloperError("cacheSize must be greater than two.");
+ }
+ //>>includeEnd('debug');
+
+ // Determine maximum index
+ let maximumIndexPlusOne = 0;
+ let currentIndex = 0;
+ let intoIndices = indices[currentIndex];
+ const endIndex = numIndices;
+ if (defaultValue.defined(maximumIndex)) {
+ maximumIndexPlusOne = maximumIndex + 1;
+ } else {
+ while (currentIndex < endIndex) {
+ if (intoIndices > maximumIndexPlusOne) {
+ maximumIndexPlusOne = intoIndices;
+ }
+ ++currentIndex;
+ intoIndices = indices[currentIndex];
+ }
+ if (maximumIndexPlusOne === -1) {
+ return 0;
+ }
+ ++maximumIndexPlusOne;
+ }
+
+ // Vertices
+ const vertices = [];
+ let i;
+ for (i = 0; i < maximumIndexPlusOne; i++) {
+ vertices[i] = {
+ numLiveTriangles: 0,
+ timeStamp: 0,
+ vertexTriangles: [],
+ };
+ }
+ currentIndex = 0;
+ let triangle = 0;
+ while (currentIndex < endIndex) {
+ vertices[indices[currentIndex]].vertexTriangles.push(triangle);
+ ++vertices[indices[currentIndex]].numLiveTriangles;
+ vertices[indices[currentIndex + 1]].vertexTriangles.push(triangle);
+ ++vertices[indices[currentIndex + 1]].numLiveTriangles;
+ vertices[indices[currentIndex + 2]].vertexTriangles.push(triangle);
+ ++vertices[indices[currentIndex + 2]].numLiveTriangles;
+ ++triangle;
+ currentIndex += 3;
+ }
+
+ // Starting index
+ let f = 0;
+
+ // Time Stamp
+ let s = cacheSize + 1;
+ cursor = 1;
+
+ // Process
+ let oneRing = [];
+ const deadEnd = []; //Stack
+ let vertex;
+ let intoVertices;
+ let currentOutputIndex = 0;
+ const outputIndices = [];
+ const numTriangles = numIndices / 3;
+ const triangleEmitted = [];
+ for (i = 0; i < numTriangles; i++) {
+ triangleEmitted[i] = false;
+ }
+ let index;
+ let limit;
+ while (f !== -1) {
+ oneRing = [];
+ intoVertices = vertices[f];
+ limit = intoVertices.vertexTriangles.length;
+ for (let k = 0; k < limit; ++k) {
+ triangle = intoVertices.vertexTriangles[k];
+ if (!triangleEmitted[triangle]) {
+ triangleEmitted[triangle] = true;
+ currentIndex = triangle + triangle + triangle;
+ for (let j = 0; j < 3; ++j) {
+ // Set this index as a possible next index
+ index = indices[currentIndex];
+ oneRing.push(index);
+ deadEnd.push(index);
+
+ // Output index
+ outputIndices[currentOutputIndex] = index;
+ ++currentOutputIndex;
+
+ // Cache processing
+ vertex = vertices[index];
+ --vertex.numLiveTriangles;
+ if (s - vertex.timeStamp > cacheSize) {
+ vertex.timeStamp = s;
+ ++s;
+ }
+ ++currentIndex;
+ }
+ }
+ }
+ f = getNextVertex(
+ indices,
+ cacheSize,
+ oneRing,
+ vertices,
+ s,
+ deadEnd,
+ maximumIndexPlusOne
+ );
+ }
+
+ return outputIndices;
+ };
+ var Tipsify$1 = Tipsify;
+
+ /**
+ * Content pipeline functions for geometries.
+ *
+ * @namespace GeometryPipeline
+ *
+ * @see Geometry
+ */
+ const GeometryPipeline = {};
+
+ function addTriangle(lines, index, i0, i1, i2) {
+ lines[index++] = i0;
+ lines[index++] = i1;
+
+ lines[index++] = i1;
+ lines[index++] = i2;
+
+ lines[index++] = i2;
+ lines[index] = i0;
+ }
+
+ function trianglesToLines(triangles) {
+ const count = triangles.length;
+ const size = (count / 3) * 6;
+ const lines = IndexDatatype.IndexDatatype.createTypedArray(count, size);
+
+ let index = 0;
+ for (let i = 0; i < count; i += 3, index += 6) {
+ addTriangle(lines, index, triangles[i], triangles[i + 1], triangles[i + 2]);
+ }
+
+ return lines;
+ }
+
+ function triangleStripToLines(triangles) {
+ const count = triangles.length;
+ if (count >= 3) {
+ const size = (count - 2) * 6;
+ const lines = IndexDatatype.IndexDatatype.createTypedArray(count, size);
+
+ addTriangle(lines, 0, triangles[0], triangles[1], triangles[2]);
+ let index = 6;
+
+ for (let i = 3; i < count; ++i, index += 6) {
+ addTriangle(
+ lines,
+ index,
+ triangles[i - 1],
+ triangles[i],
+ triangles[i - 2]
+ );
+ }
+
+ return lines;
+ }
+
+ return new Uint16Array();
+ }
+
+ function triangleFanToLines(triangles) {
+ if (triangles.length > 0) {
+ const count = triangles.length - 1;
+ const size = (count - 1) * 6;
+ const lines = IndexDatatype.IndexDatatype.createTypedArray(count, size);
+
+ const base = triangles[0];
+ let index = 0;
+ for (let i = 1; i < count; ++i, index += 6) {
+ addTriangle(lines, index, base, triangles[i], triangles[i + 1]);
+ }
+
+ return lines;
+ }
+
+ return new Uint16Array();
+ }
+
+ /**
+ * Converts a geometry's triangle indices to line indices. If the geometry has an indices
+ * and its primitiveType
is TRIANGLES
, TRIANGLE_STRIP
,
+ * TRIANGLE_FAN
, it is converted to LINES
; otherwise, the geometry is not changed.
+ * + * This is commonly used to create a wireframe geometry for visual debugging. + *
+ * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modifiedgeometry
argument, with its triangle indices converted to lines.
+ *
+ * @exception {DeveloperError} geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.
+ *
+ * @example
+ * geometry = Cesium.GeometryPipeline.toWireframe(geometry);
+ */
+ GeometryPipeline.toWireframe = function (geometry) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(geometry)) {
+ throw new Check.DeveloperError("geometry is required.");
+ }
+ //>>includeEnd('debug');
+
+ const indices = geometry.indices;
+ if (defaultValue.defined(indices)) {
+ switch (geometry.primitiveType) {
+ case GeometryAttribute.PrimitiveType.TRIANGLES:
+ geometry.indices = trianglesToLines(indices);
+ break;
+ case GeometryAttribute.PrimitiveType.TRIANGLE_STRIP:
+ geometry.indices = triangleStripToLines(indices);
+ break;
+ case GeometryAttribute.PrimitiveType.TRIANGLE_FAN:
+ geometry.indices = triangleFanToLines(indices);
+ break;
+ //>>includeStart('debug', pragmas.debug);
+ default:
+ throw new Check.DeveloperError(
+ "geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN."
+ );
+ //>>includeEnd('debug');
+ }
+
+ geometry.primitiveType = GeometryAttribute.PrimitiveType.LINES;
+ }
+
+ return geometry;
+ };
+
+ /**
+ * Creates a new {@link Geometry} with LINES
representing the provided
+ * attribute (attributeName
) for the provided geometry. This is used to
+ * visualize vector attributes like normals, tangents, and bitangents.
+ *
+ * @param {Geometry} geometry The Geometry
instance with the attribute.
+ * @param {String} [attributeName='normal'] The name of the attribute.
+ * @param {Number} [length=10000.0] The length of each line segment in meters. This can be negative to point the vector in the opposite direction.
+ * @returns {Geometry} A new Geometry
instance with line segments for the vector.
+ *
+ * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter.
+ *
+ * @example
+ * const geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);
+ */
+ GeometryPipeline.createLineSegmentsForVectors = function (
+ geometry,
+ attributeName,
+ length
+ ) {
+ attributeName = defaultValue.defaultValue(attributeName, "normal");
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(geometry)) {
+ throw new Check.DeveloperError("geometry is required.");
+ }
+ if (!defaultValue.defined(geometry.attributes.position)) {
+ throw new Check.DeveloperError("geometry.attributes.position is required.");
+ }
+ if (!defaultValue.defined(geometry.attributes[attributeName])) {
+ throw new Check.DeveloperError(
+ `geometry.attributes must have an attribute with the same name as the attributeName parameter, ${attributeName}.`
+ );
+ }
+ //>>includeEnd('debug');
+
+ length = defaultValue.defaultValue(length, 10000.0);
+
+ const positions = geometry.attributes.position.values;
+ const vectors = geometry.attributes[attributeName].values;
+ const positionsLength = positions.length;
+
+ const newPositions = new Float64Array(2 * positionsLength);
+
+ let j = 0;
+ for (let i = 0; i < positionsLength; i += 3) {
+ newPositions[j++] = positions[i];
+ newPositions[j++] = positions[i + 1];
+ newPositions[j++] = positions[i + 2];
+
+ newPositions[j++] = positions[i] + vectors[i] * length;
+ newPositions[j++] = positions[i + 1] + vectors[i + 1] * length;
+ newPositions[j++] = positions[i + 2] + vectors[i + 2] * length;
+ }
+
+ let newBoundingSphere;
+ const bs = geometry.boundingSphere;
+ if (defaultValue.defined(bs)) {
+ newBoundingSphere = new Transforms.BoundingSphere(bs.center, bs.radius + length);
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: {
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: newPositions,
+ }),
+ },
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: newBoundingSphere,
+ });
+ };
+
+ /**
+ * Creates an object that maps attribute names to unique locations (indices)
+ * for matching vertex attributes and shader programs.
+ *
+ * @param {Geometry} geometry The geometry, which is not modified, to create the object for.
+ * @returns {Object} An object with attribute name / index pairs.
+ *
+ * @example
+ * const attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);
+ * // Example output
+ * // {
+ * // 'position' : 0,
+ * // 'normal' : 1
+ * // }
+ */
+ GeometryPipeline.createAttributeLocations = function (geometry) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(geometry)) {
+ throw new Check.DeveloperError("geometry is required.");
+ }
+ //>>includeEnd('debug')
+
+ // There can be a WebGL performance hit when attribute 0 is disabled, so
+ // assign attribute locations to well-known attributes.
+ const semantics = [
+ "position",
+ "positionHigh",
+ "positionLow",
+
+ // From VertexFormat.position - after 2D projection and high-precision encoding
+ "position3DHigh",
+ "position3DLow",
+ "position2DHigh",
+ "position2DLow",
+
+ // From Primitive
+ "pickColor",
+
+ // From VertexFormat
+ "normal",
+ "st",
+ "tangent",
+ "bitangent",
+
+ // For shadow volumes
+ "extrudeDirection",
+
+ // From compressing texture coordinates and normals
+ "compressedAttributes",
+ ];
+
+ const attributes = geometry.attributes;
+ const indices = {};
+ let j = 0;
+ let i;
+ const len = semantics.length;
+
+ // Attribute locations for well-known attributes
+ for (i = 0; i < len; ++i) {
+ const semantic = semantics[i];
+
+ if (defaultValue.defined(attributes[semantic])) {
+ indices[semantic] = j++;
+ }
+ }
+
+ // Locations for custom attributes
+ for (const name in attributes) {
+ if (attributes.hasOwnProperty(name) && !defaultValue.defined(indices[name])) {
+ indices[name] = j++;
+ }
+ }
+
+ return indices;
+ };
+
+ /**
+ * Reorders a geometry's attributes and indices
to achieve better performance from the GPU's pre-vertex-shader cache.
+ *
+ * @param {Geometry} geometry The geometry to modify.
+ * @returns {Geometry} The modified geometry
argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.
+ *
+ * @exception {DeveloperError} Each attribute array in geometry.attributes must have the same number of attributes.
+ *
+ *
+ * @example
+ * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);
+ *
+ * @see GeometryPipeline.reorderForPostVertexCache
+ */
+ GeometryPipeline.reorderForPreVertexCache = function (geometry) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(geometry)) {
+ throw new Check.DeveloperError("geometry is required.");
+ }
+ //>>includeEnd('debug');
+
+ const numVertices = GeometryAttribute.Geometry.computeNumberOfVertices(geometry);
+
+ const indices = geometry.indices;
+ if (defaultValue.defined(indices)) {
+ const indexCrossReferenceOldToNew = new Int32Array(numVertices);
+ for (let i = 0; i < numVertices; i++) {
+ indexCrossReferenceOldToNew[i] = -1;
+ }
+
+ // Construct cross reference and reorder indices
+ const indicesIn = indices;
+ const numIndices = indicesIn.length;
+ const indicesOut = IndexDatatype.IndexDatatype.createTypedArray(numVertices, numIndices);
+
+ let intoIndicesIn = 0;
+ let intoIndicesOut = 0;
+ let nextIndex = 0;
+ let tempIndex;
+ while (intoIndicesIn < numIndices) {
+ tempIndex = indexCrossReferenceOldToNew[indicesIn[intoIndicesIn]];
+ if (tempIndex !== -1) {
+ indicesOut[intoIndicesOut] = tempIndex;
+ } else {
+ tempIndex = indicesIn[intoIndicesIn];
+ indexCrossReferenceOldToNew[tempIndex] = nextIndex;
+
+ indicesOut[intoIndicesOut] = nextIndex;
+ ++nextIndex;
+ }
+ ++intoIndicesIn;
+ ++intoIndicesOut;
+ }
+ geometry.indices = indicesOut;
+
+ // Reorder attributes
+ const attributes = geometry.attributes;
+ for (const property in attributes) {
+ if (
+ attributes.hasOwnProperty(property) &&
+ defaultValue.defined(attributes[property]) &&
+ defaultValue.defined(attributes[property].values)
+ ) {
+ const attribute = attributes[property];
+ const elementsIn = attribute.values;
+ let intoElementsIn = 0;
+ const numComponents = attribute.componentsPerAttribute;
+ const elementsOut = ComponentDatatype.ComponentDatatype.createTypedArray(
+ attribute.componentDatatype,
+ nextIndex * numComponents
+ );
+ while (intoElementsIn < numVertices) {
+ const temp = indexCrossReferenceOldToNew[intoElementsIn];
+ if (temp !== -1) {
+ for (let j = 0; j < numComponents; j++) {
+ elementsOut[numComponents * temp + j] =
+ elementsIn[numComponents * intoElementsIn + j];
+ }
+ }
+ ++intoElementsIn;
+ }
+ attribute.values = elementsOut;
+ }
+ }
+ }
+
+ return geometry;
+ };
+
+ /**
+ * Reorders a geometry's indices
to achieve better performance from the GPU's
+ * post vertex-shader cache by using the Tipsify algorithm. If the geometry primitiveType
+ * is not TRIANGLES
or the geometry does not have an indices
, this function has no effect.
+ *
+ * @param {Geometry} geometry The geometry to modify.
+ * @param {Number} [cacheCapacity=24] The number of vertices that can be held in the GPU's vertex cache.
+ * @returns {Geometry} The modified geometry
argument, with its indices reordered for the post-vertex-shader cache.
+ *
+ * @exception {DeveloperError} cacheCapacity must be greater than two.
+ *
+ *
+ * @example
+ * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);
+ *
+ * @see GeometryPipeline.reorderForPreVertexCache
+ * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw}
+ * by Sander, Nehab, and Barczak
+ */
+ GeometryPipeline.reorderForPostVertexCache = function (
+ geometry,
+ cacheCapacity
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(geometry)) {
+ throw new Check.DeveloperError("geometry is required.");
+ }
+ //>>includeEnd('debug');
+
+ const indices = geometry.indices;
+ if (geometry.primitiveType === GeometryAttribute.PrimitiveType.TRIANGLES && defaultValue.defined(indices)) {
+ const numIndices = indices.length;
+ let maximumIndex = 0;
+ for (let j = 0; j < numIndices; j++) {
+ if (indices[j] > maximumIndex) {
+ maximumIndex = indices[j];
+ }
+ }
+ geometry.indices = Tipsify$1.tipsify({
+ indices: indices,
+ maximumIndex: maximumIndex,
+ cacheSize: cacheCapacity,
+ });
+ }
+
+ return geometry;
+ };
+
+ function copyAttributesDescriptions(attributes) {
+ const newAttributes = {};
+
+ for (const attribute in attributes) {
+ if (
+ attributes.hasOwnProperty(attribute) &&
+ defaultValue.defined(attributes[attribute]) &&
+ defaultValue.defined(attributes[attribute].values)
+ ) {
+ const attr = attributes[attribute];
+ newAttributes[attribute] = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: attr.componentDatatype,
+ componentsPerAttribute: attr.componentsPerAttribute,
+ normalize: attr.normalize,
+ values: [],
+ });
+ }
+ }
+
+ return newAttributes;
+ }
+
+ function copyVertex(destinationAttributes, sourceAttributes, index) {
+ for (const attribute in sourceAttributes) {
+ if (
+ sourceAttributes.hasOwnProperty(attribute) &&
+ defaultValue.defined(sourceAttributes[attribute]) &&
+ defaultValue.defined(sourceAttributes[attribute].values)
+ ) {
+ const attr = sourceAttributes[attribute];
+
+ for (let k = 0; k < attr.componentsPerAttribute; ++k) {
+ destinationAttributes[attribute].values.push(
+ attr.values[index * attr.componentsPerAttribute + k]
+ );
+ }
+ }
+ }
+ }
+
+ /**
+ * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the
+ * indices
fit into unsigned shorts. This is used to meet the WebGL requirements
+ * when unsigned int indices are not supported.
+ *
+ * If the geometry does not have any indices
, this function has no effect.
+ *
position
attribute to 2D, replacing the position
+ * attribute with separate position3D
and position2D
attributes.
+ *
+ * If the geometry does not have a position
, this function has no effect.
+ *
geometry
argument with position3D
and position2D
attributes.
+ *
+ * @exception {DeveloperError} geometry must have attribute matching the attributeName argument.
+ * @exception {DeveloperError} The attribute componentDatatype must be ComponentDatatype.DOUBLE.
+ * @exception {DeveloperError} Could not project a point to 2D.
+ *
+ * @example
+ * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');
+ */
+ GeometryPipeline.projectTo2D = function (
+ geometry,
+ attributeName,
+ attributeName3D,
+ attributeName2D,
+ projection
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(geometry)) {
+ throw new Check.DeveloperError("geometry is required.");
+ }
+ if (!defaultValue.defined(attributeName)) {
+ throw new Check.DeveloperError("attributeName is required.");
+ }
+ if (!defaultValue.defined(attributeName3D)) {
+ throw new Check.DeveloperError("attributeName3D is required.");
+ }
+ if (!defaultValue.defined(attributeName2D)) {
+ throw new Check.DeveloperError("attributeName2D is required.");
+ }
+ if (!defaultValue.defined(geometry.attributes[attributeName])) {
+ throw new Check.DeveloperError(
+ `geometry must have attribute matching the attributeName argument: ${attributeName}.`
+ );
+ }
+ if (
+ geometry.attributes[attributeName].componentDatatype !==
+ ComponentDatatype.ComponentDatatype.DOUBLE
+ ) {
+ throw new Check.DeveloperError(
+ "The attribute componentDatatype must be ComponentDatatype.DOUBLE."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const attribute = geometry.attributes[attributeName];
+ projection = defaultValue.defined(projection) ? projection : new Transforms.GeographicProjection();
+ const ellipsoid = projection.ellipsoid;
+
+ // Project original values to 2D.
+ const values3D = attribute.values;
+ const projectedValues = new Float64Array(values3D.length);
+ let index = 0;
+
+ for (let i = 0; i < values3D.length; i += 3) {
+ const value = Matrix3.Cartesian3.fromArray(
+ values3D,
+ i,
+ scratchProjectTo2DCartesian3
+ );
+
+ const lonLat = ellipsoid.cartesianToCartographic(
+ value,
+ scratchProjectTo2DCartographic
+ );
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(lonLat)) {
+ throw new Check.DeveloperError(
+ `Could not project point (${value.x}, ${value.y}, ${value.z}) to 2D.`
+ );
+ }
+ //>>includeEnd('debug');
+
+ const projectedLonLat = projection.project(
+ lonLat,
+ scratchProjectTo2DCartesian3
+ );
+
+ projectedValues[index++] = projectedLonLat.x;
+ projectedValues[index++] = projectedLonLat.y;
+ projectedValues[index++] = projectedLonLat.z;
+ }
+
+ // Rename original cartesians to WGS84 cartesians.
+ geometry.attributes[attributeName3D] = attribute;
+
+ // Replace original cartesians with 2D projected cartesians
+ geometry.attributes[attributeName2D] = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: projectedValues,
+ });
+ delete geometry.attributes[attributeName];
+
+ return geometry;
+ };
+
+ const encodedResult = {
+ high: 0.0,
+ low: 0.0,
+ };
+
+ /**
+ * Encodes floating-point geometry attribute values as two separate attributes to improve
+ * rendering precision.
+ * + * This is commonly used to create high-precision position vertex attributes. + *
+ * + * @param {Geometry} geometry The geometry to modify. + * @param {String} attributeName The name of the attribute. + * @param {String} attributeHighName The name of the attribute for the encoded high bits. + * @param {String} attributeLowName The name of the attribute for the encoded low bits. + * @returns {Geometry} The modifiedgeometry
argument, with its encoded attribute.
+ *
+ * @exception {DeveloperError} geometry must have attribute matching the attributeName argument.
+ * @exception {DeveloperError} The attribute componentDatatype must be ComponentDatatype.DOUBLE.
+ *
+ * @example
+ * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');
+ */
+ GeometryPipeline.encodeAttribute = function (
+ geometry,
+ attributeName,
+ attributeHighName,
+ attributeLowName
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(geometry)) {
+ throw new Check.DeveloperError("geometry is required.");
+ }
+ if (!defaultValue.defined(attributeName)) {
+ throw new Check.DeveloperError("attributeName is required.");
+ }
+ if (!defaultValue.defined(attributeHighName)) {
+ throw new Check.DeveloperError("attributeHighName is required.");
+ }
+ if (!defaultValue.defined(attributeLowName)) {
+ throw new Check.DeveloperError("attributeLowName is required.");
+ }
+ if (!defaultValue.defined(geometry.attributes[attributeName])) {
+ throw new Check.DeveloperError(
+ `geometry must have attribute matching the attributeName argument: ${attributeName}.`
+ );
+ }
+ if (
+ geometry.attributes[attributeName].componentDatatype !==
+ ComponentDatatype.ComponentDatatype.DOUBLE
+ ) {
+ throw new Check.DeveloperError(
+ "The attribute componentDatatype must be ComponentDatatype.DOUBLE."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const attribute = geometry.attributes[attributeName];
+ const values = attribute.values;
+ const length = values.length;
+ const highValues = new Float32Array(length);
+ const lowValues = new Float32Array(length);
+
+ for (let i = 0; i < length; ++i) {
+ EncodedCartesian3.EncodedCartesian3.encode(values[i], encodedResult);
+ highValues[i] = encodedResult.high;
+ lowValues[i] = encodedResult.low;
+ }
+
+ const componentsPerAttribute = attribute.componentsPerAttribute;
+
+ geometry.attributes[attributeHighName] = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: componentsPerAttribute,
+ values: highValues,
+ });
+ geometry.attributes[attributeLowName] = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: componentsPerAttribute,
+ values: lowValues,
+ });
+ delete geometry.attributes[attributeName];
+
+ return geometry;
+ };
+
+ let scratchCartesian3 = new Matrix3.Cartesian3();
+
+ function transformPoint(matrix, attribute) {
+ if (defaultValue.defined(attribute)) {
+ const values = attribute.values;
+ const length = values.length;
+ for (let i = 0; i < length; i += 3) {
+ Matrix3.Cartesian3.unpack(values, i, scratchCartesian3);
+ Matrix2.Matrix4.multiplyByPoint(matrix, scratchCartesian3, scratchCartesian3);
+ Matrix3.Cartesian3.pack(scratchCartesian3, values, i);
+ }
+ }
+ }
+
+ function transformVector(matrix, attribute) {
+ if (defaultValue.defined(attribute)) {
+ const values = attribute.values;
+ const length = values.length;
+ for (let i = 0; i < length; i += 3) {
+ Matrix3.Cartesian3.unpack(values, i, scratchCartesian3);
+ Matrix3.Matrix3.multiplyByVector(matrix, scratchCartesian3, scratchCartesian3);
+ scratchCartesian3 = Matrix3.Cartesian3.normalize(
+ scratchCartesian3,
+ scratchCartesian3
+ );
+ Matrix3.Cartesian3.pack(scratchCartesian3, values, i);
+ }
+ }
+ }
+
+ const inverseTranspose = new Matrix2.Matrix4();
+ const normalMatrix = new Matrix3.Matrix3();
+
+ /**
+ * Transforms a geometry instance to world coordinates. This changes
+ * the instance's modelMatrix
to {@link Matrix4.IDENTITY} and transforms the
+ * following attributes if they are present: position
, normal
,
+ * tangent
, and bitangent
.
+ *
+ * @param {GeometryInstance} instance The geometry instance to modify.
+ * @returns {GeometryInstance} The modified instance
argument, with its attributes transforms to world coordinates.
+ *
+ * @example
+ * Cesium.GeometryPipeline.transformToWorldCoordinates(instance);
+ */
+ GeometryPipeline.transformToWorldCoordinates = function (instance) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(instance)) {
+ throw new Check.DeveloperError("instance is required.");
+ }
+ //>>includeEnd('debug');
+
+ const modelMatrix = instance.modelMatrix;
+
+ if (Matrix2.Matrix4.equals(modelMatrix, Matrix2.Matrix4.IDENTITY)) {
+ // Already in world coordinates
+ return instance;
+ }
+
+ const attributes = instance.geometry.attributes;
+
+ // Transform attributes in known vertex formats
+ transformPoint(modelMatrix, attributes.position);
+ transformPoint(modelMatrix, attributes.prevPosition);
+ transformPoint(modelMatrix, attributes.nextPosition);
+
+ if (
+ defaultValue.defined(attributes.normal) ||
+ defaultValue.defined(attributes.tangent) ||
+ defaultValue.defined(attributes.bitangent)
+ ) {
+ Matrix2.Matrix4.inverse(modelMatrix, inverseTranspose);
+ Matrix2.Matrix4.transpose(inverseTranspose, inverseTranspose);
+ Matrix2.Matrix4.getMatrix3(inverseTranspose, normalMatrix);
+
+ transformVector(normalMatrix, attributes.normal);
+ transformVector(normalMatrix, attributes.tangent);
+ transformVector(normalMatrix, attributes.bitangent);
+ }
+
+ const boundingSphere = instance.geometry.boundingSphere;
+ if (defaultValue.defined(boundingSphere)) {
+ instance.geometry.boundingSphere = Transforms.BoundingSphere.transform(
+ boundingSphere,
+ modelMatrix,
+ boundingSphere
+ );
+ }
+
+ instance.modelMatrix = Matrix2.Matrix4.clone(Matrix2.Matrix4.IDENTITY);
+
+ return instance;
+ };
+
+ function findAttributesInAllGeometries(instances, propertyName) {
+ const length = instances.length;
+
+ const attributesInAllGeometries = {};
+
+ const attributes0 = instances[0][propertyName].attributes;
+ let name;
+
+ for (name in attributes0) {
+ if (
+ attributes0.hasOwnProperty(name) &&
+ defaultValue.defined(attributes0[name]) &&
+ defaultValue.defined(attributes0[name].values)
+ ) {
+ const attribute = attributes0[name];
+ let numberOfComponents = attribute.values.length;
+ let inAllGeometries = true;
+
+ // Does this same attribute exist in all geometries?
+ for (let i = 1; i < length; ++i) {
+ const otherAttribute = instances[i][propertyName].attributes[name];
+
+ if (
+ !defaultValue.defined(otherAttribute) ||
+ attribute.componentDatatype !== otherAttribute.componentDatatype ||
+ attribute.componentsPerAttribute !==
+ otherAttribute.componentsPerAttribute ||
+ attribute.normalize !== otherAttribute.normalize
+ ) {
+ inAllGeometries = false;
+ break;
+ }
+
+ numberOfComponents += otherAttribute.values.length;
+ }
+
+ if (inAllGeometries) {
+ attributesInAllGeometries[name] = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: attribute.componentDatatype,
+ componentsPerAttribute: attribute.componentsPerAttribute,
+ normalize: attribute.normalize,
+ values: ComponentDatatype.ComponentDatatype.createTypedArray(
+ attribute.componentDatatype,
+ numberOfComponents
+ ),
+ });
+ }
+ }
+ }
+
+ return attributesInAllGeometries;
+ }
+
+ const tempScratch = new Matrix3.Cartesian3();
+
+ function combineGeometries(instances, propertyName) {
+ const length = instances.length;
+
+ let name;
+ let i;
+ let j;
+ let k;
+
+ const m = instances[0].modelMatrix;
+ const haveIndices = defaultValue.defined(instances[0][propertyName].indices);
+ const primitiveType = instances[0][propertyName].primitiveType;
+
+ //>>includeStart('debug', pragmas.debug);
+ for (i = 1; i < length; ++i) {
+ if (!Matrix2.Matrix4.equals(instances[i].modelMatrix, m)) {
+ throw new Check.DeveloperError("All instances must have the same modelMatrix.");
+ }
+ if (defaultValue.defined(instances[i][propertyName].indices) !== haveIndices) {
+ throw new Check.DeveloperError(
+ "All instance geometries must have an indices or not have one."
+ );
+ }
+ if (instances[i][propertyName].primitiveType !== primitiveType) {
+ throw new Check.DeveloperError(
+ "All instance geometries must have the same primitiveType."
+ );
+ }
+ }
+ //>>includeEnd('debug');
+
+ // Find subset of attributes in all geometries
+ const attributes = findAttributesInAllGeometries(instances, propertyName);
+ let values;
+ let sourceValues;
+ let sourceValuesLength;
+
+ // Combine attributes from each geometry into a single typed array
+ for (name in attributes) {
+ if (attributes.hasOwnProperty(name)) {
+ values = attributes[name].values;
+
+ k = 0;
+ for (i = 0; i < length; ++i) {
+ sourceValues = instances[i][propertyName].attributes[name].values;
+ sourceValuesLength = sourceValues.length;
+
+ for (j = 0; j < sourceValuesLength; ++j) {
+ values[k++] = sourceValues[j];
+ }
+ }
+ }
+ }
+
+ // Combine index lists
+ let indices;
+
+ if (haveIndices) {
+ let numberOfIndices = 0;
+ for (i = 0; i < length; ++i) {
+ numberOfIndices += instances[i][propertyName].indices.length;
+ }
+
+ const numberOfVertices = GeometryAttribute.Geometry.computeNumberOfVertices(
+ new GeometryAttribute.Geometry({
+ attributes: attributes,
+ primitiveType: GeometryAttribute.PrimitiveType.POINTS,
+ })
+ );
+ const destIndices = IndexDatatype.IndexDatatype.createTypedArray(
+ numberOfVertices,
+ numberOfIndices
+ );
+
+ let destOffset = 0;
+ let offset = 0;
+
+ for (i = 0; i < length; ++i) {
+ const sourceIndices = instances[i][propertyName].indices;
+ const sourceIndicesLen = sourceIndices.length;
+
+ for (k = 0; k < sourceIndicesLen; ++k) {
+ destIndices[destOffset++] = offset + sourceIndices[k];
+ }
+
+ offset += GeometryAttribute.Geometry.computeNumberOfVertices(instances[i][propertyName]);
+ }
+
+ indices = destIndices;
+ }
+
+ // Create bounding sphere that includes all instances
+ let center = new Matrix3.Cartesian3();
+ let radius = 0.0;
+ let bs;
+
+ for (i = 0; i < length; ++i) {
+ bs = instances[i][propertyName].boundingSphere;
+ if (!defaultValue.defined(bs)) {
+ // If any geometries have an undefined bounding sphere, then so does the combined geometry
+ center = undefined;
+ break;
+ }
+
+ Matrix3.Cartesian3.add(bs.center, center, center);
+ }
+
+ if (defaultValue.defined(center)) {
+ Matrix3.Cartesian3.divideByScalar(center, length, center);
+
+ for (i = 0; i < length; ++i) {
+ bs = instances[i][propertyName].boundingSphere;
+ const tempRadius =
+ Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.subtract(bs.center, center, tempScratch)
+ ) + bs.radius;
+
+ if (tempRadius > radius) {
+ radius = tempRadius;
+ }
+ }
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: primitiveType,
+ boundingSphere: defaultValue.defined(center)
+ ? new Transforms.BoundingSphere(center, radius)
+ : undefined,
+ });
+ }
+
+ /**
+ * Combines geometry from several {@link GeometryInstance} objects into one geometry.
+ * This concatenates the attributes, concatenates and adjusts the indices, and creates
+ * a bounding sphere encompassing all instances.
+ * + * If the instances do not have the same attributes, a subset of attributes common + * to all instances is used, and the others are ignored. + *
+ *+ * This is used by {@link Primitive} to efficiently render a large amount of static data. + *
+ * + * @private + * + * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined. + * @returns {Geometry} A single geometry created from the provided geometry instances. + * + * @exception {DeveloperError} All instances must have the same modelMatrix. + * @exception {DeveloperError} All instance geometries must have an indices or not have one. + * @exception {DeveloperError} All instance geometries must have the same primitiveType. + * + * + * @example + * for (let i = 0; i < instances.length; ++i) { + * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]); + * } + * const geometries = Cesium.GeometryPipeline.combineInstances(instances); + * + * @see GeometryPipeline.transformToWorldCoordinates + */ + GeometryPipeline.combineInstances = function (instances) { + //>>includeStart('debug', pragmas.debug); + if (!defaultValue.defined(instances) || instances.length < 1) { + throw new Check.DeveloperError( + "instances is required and must have length greater than zero." + ); + } + //>>includeEnd('debug'); + + const instanceGeometry = []; + const instanceSplitGeometry = []; + const length = instances.length; + for (let i = 0; i < length; ++i) { + const instance = instances[i]; + + if (defaultValue.defined(instance.geometry)) { + instanceGeometry.push(instance); + } else if ( + defaultValue.defined(instance.westHemisphereGeometry) && + defaultValue.defined(instance.eastHemisphereGeometry) + ) { + instanceSplitGeometry.push(instance); + } + } + + const geometries = []; + if (instanceGeometry.length > 0) { + geometries.push(combineGeometries(instanceGeometry, "geometry")); + } + + if (instanceSplitGeometry.length > 0) { + geometries.push( + combineGeometries(instanceSplitGeometry, "westHemisphereGeometry") + ); + geometries.push( + combineGeometries(instanceSplitGeometry, "eastHemisphereGeometry") + ); + } + + return geometries; + }; + + const normal = new Matrix3.Cartesian3(); + const v0 = new Matrix3.Cartesian3(); + const v1 = new Matrix3.Cartesian3(); + const v2 = new Matrix3.Cartesian3(); + + /** + * Computes per-vertex normals for a geometry containingTRIANGLES
by averaging the normals of
+ * all triangles incident to the vertex. The result is a new normal
attribute added to the geometry.
+ * This assumes a counter-clockwise winding order.
+ *
+ * @param {Geometry} geometry The geometry to modify.
+ * @returns {Geometry} The modified geometry
argument with the computed normal
attribute.
+ *
+ * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3.
+ * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}.
+ *
+ * @example
+ * Cesium.GeometryPipeline.computeNormal(geometry);
+ */
+ GeometryPipeline.computeNormal = function (geometry) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(geometry)) {
+ throw new Check.DeveloperError("geometry is required.");
+ }
+ if (
+ !defaultValue.defined(geometry.attributes.position) ||
+ !defaultValue.defined(geometry.attributes.position.values)
+ ) {
+ throw new Check.DeveloperError(
+ "geometry.attributes.position.values is required."
+ );
+ }
+ if (!defaultValue.defined(geometry.indices)) {
+ throw new Check.DeveloperError("geometry.indices is required.");
+ }
+ if (geometry.indices.length < 2 || geometry.indices.length % 3 !== 0) {
+ throw new Check.DeveloperError(
+ "geometry.indices length must be greater than 0 and be a multiple of 3."
+ );
+ }
+ if (geometry.primitiveType !== GeometryAttribute.PrimitiveType.TRIANGLES) {
+ throw new Check.DeveloperError(
+ "geometry.primitiveType must be PrimitiveType.TRIANGLES."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const indices = geometry.indices;
+ const attributes = geometry.attributes;
+ const vertices = attributes.position.values;
+ const numVertices = attributes.position.values.length / 3;
+ const numIndices = indices.length;
+ const normalsPerVertex = new Array(numVertices);
+ const normalsPerTriangle = new Array(numIndices / 3);
+ const normalIndices = new Array(numIndices);
+ let i;
+ for (i = 0; i < numVertices; i++) {
+ normalsPerVertex[i] = {
+ indexOffset: 0,
+ count: 0,
+ currentCount: 0,
+ };
+ }
+
+ let j = 0;
+ for (i = 0; i < numIndices; i += 3) {
+ const i0 = indices[i];
+ const i1 = indices[i + 1];
+ const i2 = indices[i + 2];
+ const i03 = i0 * 3;
+ const i13 = i1 * 3;
+ const i23 = i2 * 3;
+
+ v0.x = vertices[i03];
+ v0.y = vertices[i03 + 1];
+ v0.z = vertices[i03 + 2];
+ v1.x = vertices[i13];
+ v1.y = vertices[i13 + 1];
+ v1.z = vertices[i13 + 2];
+ v2.x = vertices[i23];
+ v2.y = vertices[i23 + 1];
+ v2.z = vertices[i23 + 2];
+
+ normalsPerVertex[i0].count++;
+ normalsPerVertex[i1].count++;
+ normalsPerVertex[i2].count++;
+
+ Matrix3.Cartesian3.subtract(v1, v0, v1);
+ Matrix3.Cartesian3.subtract(v2, v0, v2);
+ normalsPerTriangle[j] = Matrix3.Cartesian3.cross(v1, v2, new Matrix3.Cartesian3());
+ j++;
+ }
+
+ let indexOffset = 0;
+ for (i = 0; i < numVertices; i++) {
+ normalsPerVertex[i].indexOffset += indexOffset;
+ indexOffset += normalsPerVertex[i].count;
+ }
+
+ j = 0;
+ let vertexNormalData;
+ for (i = 0; i < numIndices; i += 3) {
+ vertexNormalData = normalsPerVertex[indices[i]];
+ let index = vertexNormalData.indexOffset + vertexNormalData.currentCount;
+ normalIndices[index] = j;
+ vertexNormalData.currentCount++;
+
+ vertexNormalData = normalsPerVertex[indices[i + 1]];
+ index = vertexNormalData.indexOffset + vertexNormalData.currentCount;
+ normalIndices[index] = j;
+ vertexNormalData.currentCount++;
+
+ vertexNormalData = normalsPerVertex[indices[i + 2]];
+ index = vertexNormalData.indexOffset + vertexNormalData.currentCount;
+ normalIndices[index] = j;
+ vertexNormalData.currentCount++;
+
+ j++;
+ }
+
+ const normalValues = new Float32Array(numVertices * 3);
+ for (i = 0; i < numVertices; i++) {
+ const i3 = i * 3;
+ vertexNormalData = normalsPerVertex[i];
+ Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, normal);
+ if (vertexNormalData.count > 0) {
+ for (j = 0; j < vertexNormalData.count; j++) {
+ Matrix3.Cartesian3.add(
+ normal,
+ normalsPerTriangle[normalIndices[vertexNormalData.indexOffset + j]],
+ normal
+ );
+ }
+
+ // We can run into an issue where a vertex is used with 2 primitives that have opposite winding order.
+ if (
+ Matrix3.Cartesian3.equalsEpsilon(Matrix3.Cartesian3.ZERO, normal, Math$1.CesiumMath.EPSILON10)
+ ) {
+ Matrix3.Cartesian3.clone(
+ normalsPerTriangle[normalIndices[vertexNormalData.indexOffset]],
+ normal
+ );
+ }
+ }
+
+ // We end up with a zero vector probably because of a degenerate triangle
+ if (
+ Matrix3.Cartesian3.equalsEpsilon(Matrix3.Cartesian3.ZERO, normal, Math$1.CesiumMath.EPSILON10)
+ ) {
+ // Default to (0,0,1)
+ normal.z = 1.0;
+ }
+
+ Matrix3.Cartesian3.normalize(normal, normal);
+ normalValues[i3] = normal.x;
+ normalValues[i3 + 1] = normal.y;
+ normalValues[i3 + 2] = normal.z;
+ }
+
+ geometry.attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normalValues,
+ });
+
+ return geometry;
+ };
+
+ const normalScratch = new Matrix3.Cartesian3();
+ const normalScale = new Matrix3.Cartesian3();
+ const tScratch = new Matrix3.Cartesian3();
+
+ /**
+ * Computes per-vertex tangents and bitangents for a geometry containing TRIANGLES
.
+ * The result is new tangent
and bitangent
attributes added to the geometry.
+ * This assumes a counter-clockwise winding order.
+ * + * Based on Computing Tangent Space Basis Vectors + * for an Arbitrary Mesh by Eric Lengyel. + *
+ * + * @param {Geometry} geometry The geometry to modify. + * @returns {Geometry} The modifiedgeometry
argument with the computed tangent
and bitangent
attributes.
+ *
+ * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3.
+ * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}.
+ *
+ * @example
+ * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);
+ */
+ GeometryPipeline.computeTangentAndBitangent = function (geometry) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(geometry)) {
+ throw new Check.DeveloperError("geometry is required.");
+ }
+ //>>includeEnd('debug');
+
+ const attributes = geometry.attributes;
+ const indices = geometry.indices;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(attributes.position) || !defaultValue.defined(attributes.position.values)) {
+ throw new Check.DeveloperError(
+ "geometry.attributes.position.values is required."
+ );
+ }
+ if (!defaultValue.defined(attributes.normal) || !defaultValue.defined(attributes.normal.values)) {
+ throw new Check.DeveloperError("geometry.attributes.normal.values is required.");
+ }
+ if (!defaultValue.defined(attributes.st) || !defaultValue.defined(attributes.st.values)) {
+ throw new Check.DeveloperError("geometry.attributes.st.values is required.");
+ }
+ if (!defaultValue.defined(indices)) {
+ throw new Check.DeveloperError("geometry.indices is required.");
+ }
+ if (indices.length < 2 || indices.length % 3 !== 0) {
+ throw new Check.DeveloperError(
+ "geometry.indices length must be greater than 0 and be a multiple of 3."
+ );
+ }
+ if (geometry.primitiveType !== GeometryAttribute.PrimitiveType.TRIANGLES) {
+ throw new Check.DeveloperError(
+ "geometry.primitiveType must be PrimitiveType.TRIANGLES."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const vertices = geometry.attributes.position.values;
+ const normals = geometry.attributes.normal.values;
+ const st = geometry.attributes.st.values;
+
+ const numVertices = geometry.attributes.position.values.length / 3;
+ const numIndices = indices.length;
+ const tan1 = new Array(numVertices * 3);
+
+ let i;
+ for (i = 0; i < tan1.length; i++) {
+ tan1[i] = 0;
+ }
+
+ let i03;
+ let i13;
+ let i23;
+ for (i = 0; i < numIndices; i += 3) {
+ const i0 = indices[i];
+ const i1 = indices[i + 1];
+ const i2 = indices[i + 2];
+ i03 = i0 * 3;
+ i13 = i1 * 3;
+ i23 = i2 * 3;
+ const i02 = i0 * 2;
+ const i12 = i1 * 2;
+ const i22 = i2 * 2;
+
+ const ux = vertices[i03];
+ const uy = vertices[i03 + 1];
+ const uz = vertices[i03 + 2];
+
+ const wx = st[i02];
+ const wy = st[i02 + 1];
+ const t1 = st[i12 + 1] - wy;
+ const t2 = st[i22 + 1] - wy;
+
+ const r = 1.0 / ((st[i12] - wx) * t2 - (st[i22] - wx) * t1);
+ const sdirx = (t2 * (vertices[i13] - ux) - t1 * (vertices[i23] - ux)) * r;
+ const sdiry =
+ (t2 * (vertices[i13 + 1] - uy) - t1 * (vertices[i23 + 1] - uy)) * r;
+ const sdirz =
+ (t2 * (vertices[i13 + 2] - uz) - t1 * (vertices[i23 + 2] - uz)) * r;
+
+ tan1[i03] += sdirx;
+ tan1[i03 + 1] += sdiry;
+ tan1[i03 + 2] += sdirz;
+
+ tan1[i13] += sdirx;
+ tan1[i13 + 1] += sdiry;
+ tan1[i13 + 2] += sdirz;
+
+ tan1[i23] += sdirx;
+ tan1[i23 + 1] += sdiry;
+ tan1[i23 + 2] += sdirz;
+ }
+
+ const tangentValues = new Float32Array(numVertices * 3);
+ const bitangentValues = new Float32Array(numVertices * 3);
+
+ for (i = 0; i < numVertices; i++) {
+ i03 = i * 3;
+ i13 = i03 + 1;
+ i23 = i03 + 2;
+
+ const n = Matrix3.Cartesian3.fromArray(normals, i03, normalScratch);
+ const t = Matrix3.Cartesian3.fromArray(tan1, i03, tScratch);
+ const scalar = Matrix3.Cartesian3.dot(n, t);
+ Matrix3.Cartesian3.multiplyByScalar(n, scalar, normalScale);
+ Matrix3.Cartesian3.normalize(Matrix3.Cartesian3.subtract(t, normalScale, t), t);
+
+ tangentValues[i03] = t.x;
+ tangentValues[i13] = t.y;
+ tangentValues[i23] = t.z;
+
+ Matrix3.Cartesian3.normalize(Matrix3.Cartesian3.cross(n, t, t), t);
+
+ bitangentValues[i03] = t.x;
+ bitangentValues[i13] = t.y;
+ bitangentValues[i23] = t.z;
+ }
+
+ geometry.attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangentValues,
+ });
+
+ geometry.attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangentValues,
+ });
+
+ return geometry;
+ };
+
+ const scratchCartesian2 = new Matrix2.Cartesian2();
+ const toEncode1 = new Matrix3.Cartesian3();
+ const toEncode2 = new Matrix3.Cartesian3();
+ const toEncode3 = new Matrix3.Cartesian3();
+ let encodeResult2 = new Matrix2.Cartesian2();
+ /**
+ * Compresses and packs geometry normal attribute values to save memory.
+ *
+ * @param {Geometry} geometry The geometry to modify.
+ * @returns {Geometry} The modified geometry
argument, with its normals compressed and packed.
+ *
+ * @example
+ * geometry = Cesium.GeometryPipeline.compressVertices(geometry);
+ */
+ GeometryPipeline.compressVertices = function (geometry) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(geometry)) {
+ throw new Check.DeveloperError("geometry is required.");
+ }
+ //>>includeEnd('debug');
+
+ const extrudeAttribute = geometry.attributes.extrudeDirection;
+ let i;
+ let numVertices;
+ if (defaultValue.defined(extrudeAttribute)) {
+ //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes
+ const extrudeDirections = extrudeAttribute.values;
+ numVertices = extrudeDirections.length / 3.0;
+ const compressedDirections = new Float32Array(numVertices * 2);
+
+ let i2 = 0;
+ for (i = 0; i < numVertices; ++i) {
+ Matrix3.Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1);
+ if (Matrix3.Cartesian3.equals(toEncode1, Matrix3.Cartesian3.ZERO)) {
+ i2 += 2;
+ continue;
+ }
+ encodeResult2 = AttributeCompression.AttributeCompression.octEncodeInRange(
+ toEncode1,
+ 65535,
+ encodeResult2
+ );
+ compressedDirections[i2++] = encodeResult2.x;
+ compressedDirections[i2++] = encodeResult2.y;
+ }
+
+ geometry.attributes.compressedAttributes = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: compressedDirections,
+ });
+ delete geometry.attributes.extrudeDirection;
+ return geometry;
+ }
+
+ const normalAttribute = geometry.attributes.normal;
+ const stAttribute = geometry.attributes.st;
+
+ const hasNormal = defaultValue.defined(normalAttribute);
+ const hasSt = defaultValue.defined(stAttribute);
+ if (!hasNormal && !hasSt) {
+ return geometry;
+ }
+
+ const tangentAttribute = geometry.attributes.tangent;
+ const bitangentAttribute = geometry.attributes.bitangent;
+
+ const hasTangent = defaultValue.defined(tangentAttribute);
+ const hasBitangent = defaultValue.defined(bitangentAttribute);
+
+ let normals;
+ let st;
+ let tangents;
+ let bitangents;
+
+ if (hasNormal) {
+ normals = normalAttribute.values;
+ }
+ if (hasSt) {
+ st = stAttribute.values;
+ }
+ if (hasTangent) {
+ tangents = tangentAttribute.values;
+ }
+ if (hasBitangent) {
+ bitangents = bitangentAttribute.values;
+ }
+
+ const length = hasNormal ? normals.length : st.length;
+ const numComponents = hasNormal ? 3.0 : 2.0;
+ numVertices = length / numComponents;
+
+ let compressedLength = numVertices;
+ let numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0;
+ numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0;
+ compressedLength *= numCompressedComponents;
+
+ const compressedAttributes = new Float32Array(compressedLength);
+
+ let normalIndex = 0;
+ for (i = 0; i < numVertices; ++i) {
+ if (hasSt) {
+ Matrix2.Cartesian2.fromArray(st, i * 2.0, scratchCartesian2);
+ compressedAttributes[
+ normalIndex++
+ ] = AttributeCompression.AttributeCompression.compressTextureCoordinates(scratchCartesian2);
+ }
+
+ const index = i * 3.0;
+ if (hasNormal && defaultValue.defined(tangents) && defaultValue.defined(bitangents)) {
+ Matrix3.Cartesian3.fromArray(normals, index, toEncode1);
+ Matrix3.Cartesian3.fromArray(tangents, index, toEncode2);
+ Matrix3.Cartesian3.fromArray(bitangents, index, toEncode3);
+
+ AttributeCompression.AttributeCompression.octPack(
+ toEncode1,
+ toEncode2,
+ toEncode3,
+ scratchCartesian2
+ );
+ compressedAttributes[normalIndex++] = scratchCartesian2.x;
+ compressedAttributes[normalIndex++] = scratchCartesian2.y;
+ } else {
+ if (hasNormal) {
+ Matrix3.Cartesian3.fromArray(normals, index, toEncode1);
+ compressedAttributes[
+ normalIndex++
+ ] = AttributeCompression.AttributeCompression.octEncodeFloat(toEncode1);
+ }
+
+ if (hasTangent) {
+ Matrix3.Cartesian3.fromArray(tangents, index, toEncode1);
+ compressedAttributes[
+ normalIndex++
+ ] = AttributeCompression.AttributeCompression.octEncodeFloat(toEncode1);
+ }
+
+ if (hasBitangent) {
+ Matrix3.Cartesian3.fromArray(bitangents, index, toEncode1);
+ compressedAttributes[
+ normalIndex++
+ ] = AttributeCompression.AttributeCompression.octEncodeFloat(toEncode1);
+ }
+ }
+ }
+
+ geometry.attributes.compressedAttributes = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: numCompressedComponents,
+ values: compressedAttributes,
+ });
+
+ if (hasNormal) {
+ delete geometry.attributes.normal;
+ }
+ if (hasSt) {
+ delete geometry.attributes.st;
+ }
+ if (hasBitangent) {
+ delete geometry.attributes.bitangent;
+ }
+ if (hasTangent) {
+ delete geometry.attributes.tangent;
+ }
+
+ return geometry;
+ };
+
+ function indexTriangles(geometry) {
+ if (defaultValue.defined(geometry.indices)) {
+ return geometry;
+ }
+ const numberOfVertices = GeometryAttribute.Geometry.computeNumberOfVertices(geometry);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (numberOfVertices < 3) {
+ throw new Check.DeveloperError("The number of vertices must be at least three.");
+ }
+ if (numberOfVertices % 3 !== 0) {
+ throw new Check.DeveloperError(
+ "The number of vertices must be a multiple of three."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ numberOfVertices,
+ numberOfVertices
+ );
+ for (let i = 0; i < numberOfVertices; ++i) {
+ indices[i] = i;
+ }
+
+ geometry.indices = indices;
+ return geometry;
+ }
+
+ function indexTriangleFan(geometry) {
+ const numberOfVertices = GeometryAttribute.Geometry.computeNumberOfVertices(geometry);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (numberOfVertices < 3) {
+ throw new Check.DeveloperError("The number of vertices must be at least three.");
+ }
+ //>>includeEnd('debug');
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ numberOfVertices,
+ (numberOfVertices - 2) * 3
+ );
+ indices[0] = 1;
+ indices[1] = 0;
+ indices[2] = 2;
+
+ let indicesIndex = 3;
+ for (let i = 3; i < numberOfVertices; ++i) {
+ indices[indicesIndex++] = i - 1;
+ indices[indicesIndex++] = 0;
+ indices[indicesIndex++] = i;
+ }
+
+ geometry.indices = indices;
+ geometry.primitiveType = GeometryAttribute.PrimitiveType.TRIANGLES;
+ return geometry;
+ }
+
+ function indexTriangleStrip(geometry) {
+ const numberOfVertices = GeometryAttribute.Geometry.computeNumberOfVertices(geometry);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (numberOfVertices < 3) {
+ throw new Check.DeveloperError("The number of vertices must be at least 3.");
+ }
+ //>>includeEnd('debug');
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ numberOfVertices,
+ (numberOfVertices - 2) * 3
+ );
+ indices[0] = 0;
+ indices[1] = 1;
+ indices[2] = 2;
+
+ if (numberOfVertices > 3) {
+ indices[3] = 0;
+ indices[4] = 2;
+ indices[5] = 3;
+ }
+
+ let indicesIndex = 6;
+ for (let i = 3; i < numberOfVertices - 1; i += 2) {
+ indices[indicesIndex++] = i;
+ indices[indicesIndex++] = i - 1;
+ indices[indicesIndex++] = i + 1;
+
+ if (i + 2 < numberOfVertices) {
+ indices[indicesIndex++] = i;
+ indices[indicesIndex++] = i + 1;
+ indices[indicesIndex++] = i + 2;
+ }
+ }
+
+ geometry.indices = indices;
+ geometry.primitiveType = GeometryAttribute.PrimitiveType.TRIANGLES;
+ return geometry;
+ }
+
+ function indexLines(geometry) {
+ if (defaultValue.defined(geometry.indices)) {
+ return geometry;
+ }
+ const numberOfVertices = GeometryAttribute.Geometry.computeNumberOfVertices(geometry);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (numberOfVertices < 2) {
+ throw new Check.DeveloperError("The number of vertices must be at least two.");
+ }
+ if (numberOfVertices % 2 !== 0) {
+ throw new Check.DeveloperError("The number of vertices must be a multiple of 2.");
+ }
+ //>>includeEnd('debug');
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ numberOfVertices,
+ numberOfVertices
+ );
+ for (let i = 0; i < numberOfVertices; ++i) {
+ indices[i] = i;
+ }
+
+ geometry.indices = indices;
+ return geometry;
+ }
+
+ function indexLineStrip(geometry) {
+ const numberOfVertices = GeometryAttribute.Geometry.computeNumberOfVertices(geometry);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (numberOfVertices < 2) {
+ throw new Check.DeveloperError("The number of vertices must be at least two.");
+ }
+ //>>includeEnd('debug');
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ numberOfVertices,
+ (numberOfVertices - 1) * 2
+ );
+ indices[0] = 0;
+ indices[1] = 1;
+ let indicesIndex = 2;
+ for (let i = 2; i < numberOfVertices; ++i) {
+ indices[indicesIndex++] = i - 1;
+ indices[indicesIndex++] = i;
+ }
+
+ geometry.indices = indices;
+ geometry.primitiveType = GeometryAttribute.PrimitiveType.LINES;
+ return geometry;
+ }
+
+ function indexLineLoop(geometry) {
+ const numberOfVertices = GeometryAttribute.Geometry.computeNumberOfVertices(geometry);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (numberOfVertices < 2) {
+ throw new Check.DeveloperError("The number of vertices must be at least two.");
+ }
+ //>>includeEnd('debug');
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ numberOfVertices,
+ numberOfVertices * 2
+ );
+
+ indices[0] = 0;
+ indices[1] = 1;
+
+ let indicesIndex = 2;
+ for (let i = 2; i < numberOfVertices; ++i) {
+ indices[indicesIndex++] = i - 1;
+ indices[indicesIndex++] = i;
+ }
+
+ indices[indicesIndex++] = numberOfVertices - 1;
+ indices[indicesIndex] = 0;
+
+ geometry.indices = indices;
+ geometry.primitiveType = GeometryAttribute.PrimitiveType.LINES;
+ return geometry;
+ }
+
+ function indexPrimitive(geometry) {
+ switch (geometry.primitiveType) {
+ case GeometryAttribute.PrimitiveType.TRIANGLE_FAN:
+ return indexTriangleFan(geometry);
+ case GeometryAttribute.PrimitiveType.TRIANGLE_STRIP:
+ return indexTriangleStrip(geometry);
+ case GeometryAttribute.PrimitiveType.TRIANGLES:
+ return indexTriangles(geometry);
+ case GeometryAttribute.PrimitiveType.LINE_STRIP:
+ return indexLineStrip(geometry);
+ case GeometryAttribute.PrimitiveType.LINE_LOOP:
+ return indexLineLoop(geometry);
+ case GeometryAttribute.PrimitiveType.LINES:
+ return indexLines(geometry);
+ }
+
+ return geometry;
+ }
+
+ function offsetPointFromXZPlane(p, isBehind) {
+ if (Math.abs(p.y) < Math$1.CesiumMath.EPSILON6) {
+ if (isBehind) {
+ p.y = -Math$1.CesiumMath.EPSILON6;
+ } else {
+ p.y = Math$1.CesiumMath.EPSILON6;
+ }
+ }
+ }
+
+ function offsetTriangleFromXZPlane(p0, p1, p2) {
+ if (p0.y !== 0.0 && p1.y !== 0.0 && p2.y !== 0.0) {
+ offsetPointFromXZPlane(p0, p0.y < 0.0);
+ offsetPointFromXZPlane(p1, p1.y < 0.0);
+ offsetPointFromXZPlane(p2, p2.y < 0.0);
+ return;
+ }
+
+ const p0y = Math.abs(p0.y);
+ const p1y = Math.abs(p1.y);
+ const p2y = Math.abs(p2.y);
+
+ let sign;
+ if (p0y > p1y) {
+ if (p0y > p2y) {
+ sign = Math$1.CesiumMath.sign(p0.y);
+ } else {
+ sign = Math$1.CesiumMath.sign(p2.y);
+ }
+ } else if (p1y > p2y) {
+ sign = Math$1.CesiumMath.sign(p1.y);
+ } else {
+ sign = Math$1.CesiumMath.sign(p2.y);
+ }
+
+ const isBehind = sign < 0.0;
+ offsetPointFromXZPlane(p0, isBehind);
+ offsetPointFromXZPlane(p1, isBehind);
+ offsetPointFromXZPlane(p2, isBehind);
+ }
+
+ const c3 = new Matrix3.Cartesian3();
+ function getXZIntersectionOffsetPoints(p, p1, u1, v1) {
+ Matrix3.Cartesian3.add(
+ p,
+ Matrix3.Cartesian3.multiplyByScalar(
+ Matrix3.Cartesian3.subtract(p1, p, c3),
+ p.y / (p.y - p1.y),
+ c3
+ ),
+ u1
+ );
+ Matrix3.Cartesian3.clone(u1, v1);
+ offsetPointFromXZPlane(u1, true);
+ offsetPointFromXZPlane(v1, false);
+ }
+
+ const u1 = new Matrix3.Cartesian3();
+ const u2 = new Matrix3.Cartesian3();
+ const q1 = new Matrix3.Cartesian3();
+ const q2 = new Matrix3.Cartesian3();
+
+ const splitTriangleResult = {
+ positions: new Array(7),
+ indices: new Array(3 * 3),
+ };
+
+ function splitTriangle(p0, p1, p2) {
+ // In WGS84 coordinates, for a triangle approximately on the
+ // ellipsoid to cross the IDL, first it needs to be on the
+ // negative side of the plane x = 0.
+ if (p0.x >= 0.0 || p1.x >= 0.0 || p2.x >= 0.0) {
+ return undefined;
+ }
+
+ offsetTriangleFromXZPlane(p0, p1, p2);
+
+ const p0Behind = p0.y < 0.0;
+ const p1Behind = p1.y < 0.0;
+ const p2Behind = p2.y < 0.0;
+
+ let numBehind = 0;
+ numBehind += p0Behind ? 1 : 0;
+ numBehind += p1Behind ? 1 : 0;
+ numBehind += p2Behind ? 1 : 0;
+
+ const indices = splitTriangleResult.indices;
+
+ if (numBehind === 1) {
+ indices[1] = 3;
+ indices[2] = 4;
+ indices[5] = 6;
+ indices[7] = 6;
+ indices[8] = 5;
+
+ if (p0Behind) {
+ getXZIntersectionOffsetPoints(p0, p1, u1, q1);
+ getXZIntersectionOffsetPoints(p0, p2, u2, q2);
+
+ indices[0] = 0;
+ indices[3] = 1;
+ indices[4] = 2;
+ indices[6] = 1;
+ } else if (p1Behind) {
+ getXZIntersectionOffsetPoints(p1, p2, u1, q1);
+ getXZIntersectionOffsetPoints(p1, p0, u2, q2);
+
+ indices[0] = 1;
+ indices[3] = 2;
+ indices[4] = 0;
+ indices[6] = 2;
+ } else if (p2Behind) {
+ getXZIntersectionOffsetPoints(p2, p0, u1, q1);
+ getXZIntersectionOffsetPoints(p2, p1, u2, q2);
+
+ indices[0] = 2;
+ indices[3] = 0;
+ indices[4] = 1;
+ indices[6] = 0;
+ }
+ } else if (numBehind === 2) {
+ indices[2] = 4;
+ indices[4] = 4;
+ indices[5] = 3;
+ indices[7] = 5;
+ indices[8] = 6;
+
+ if (!p0Behind) {
+ getXZIntersectionOffsetPoints(p0, p1, u1, q1);
+ getXZIntersectionOffsetPoints(p0, p2, u2, q2);
+
+ indices[0] = 1;
+ indices[1] = 2;
+ indices[3] = 1;
+ indices[6] = 0;
+ } else if (!p1Behind) {
+ getXZIntersectionOffsetPoints(p1, p2, u1, q1);
+ getXZIntersectionOffsetPoints(p1, p0, u2, q2);
+
+ indices[0] = 2;
+ indices[1] = 0;
+ indices[3] = 2;
+ indices[6] = 1;
+ } else if (!p2Behind) {
+ getXZIntersectionOffsetPoints(p2, p0, u1, q1);
+ getXZIntersectionOffsetPoints(p2, p1, u2, q2);
+
+ indices[0] = 0;
+ indices[1] = 1;
+ indices[3] = 0;
+ indices[6] = 2;
+ }
+ }
+
+ const positions = splitTriangleResult.positions;
+ positions[0] = p0;
+ positions[1] = p1;
+ positions[2] = p2;
+ positions.length = 3;
+
+ if (numBehind === 1 || numBehind === 2) {
+ positions[3] = u1;
+ positions[4] = u2;
+ positions[5] = q1;
+ positions[6] = q2;
+ positions.length = 7;
+ }
+
+ return splitTriangleResult;
+ }
+
+ function updateGeometryAfterSplit(geometry, computeBoundingSphere) {
+ const attributes = geometry.attributes;
+
+ if (attributes.position.values.length === 0) {
+ return undefined;
+ }
+
+ for (const property in attributes) {
+ if (
+ attributes.hasOwnProperty(property) &&
+ defaultValue.defined(attributes[property]) &&
+ defaultValue.defined(attributes[property].values)
+ ) {
+ const attribute = attributes[property];
+ attribute.values = ComponentDatatype.ComponentDatatype.createTypedArray(
+ attribute.componentDatatype,
+ attribute.values
+ );
+ }
+ }
+
+ const numberOfVertices = GeometryAttribute.Geometry.computeNumberOfVertices(geometry);
+ geometry.indices = IndexDatatype.IndexDatatype.createTypedArray(
+ numberOfVertices,
+ geometry.indices
+ );
+
+ if (computeBoundingSphere) {
+ geometry.boundingSphere = Transforms.BoundingSphere.fromVertices(
+ attributes.position.values
+ );
+ }
+
+ return geometry;
+ }
+
+ function copyGeometryForSplit(geometry) {
+ const attributes = geometry.attributes;
+ const copiedAttributes = {};
+
+ for (const property in attributes) {
+ if (
+ attributes.hasOwnProperty(property) &&
+ defaultValue.defined(attributes[property]) &&
+ defaultValue.defined(attributes[property].values)
+ ) {
+ const attribute = attributes[property];
+ copiedAttributes[property] = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: attribute.componentDatatype,
+ componentsPerAttribute: attribute.componentsPerAttribute,
+ normalize: attribute.normalize,
+ values: [],
+ });
+ }
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: copiedAttributes,
+ indices: [],
+ primitiveType: geometry.primitiveType,
+ });
+ }
+
+ function updateInstanceAfterSplit(instance, westGeometry, eastGeometry) {
+ const computeBoundingSphere = defaultValue.defined(instance.geometry.boundingSphere);
+
+ westGeometry = updateGeometryAfterSplit(westGeometry, computeBoundingSphere);
+ eastGeometry = updateGeometryAfterSplit(eastGeometry, computeBoundingSphere);
+
+ if (defaultValue.defined(eastGeometry) && !defaultValue.defined(westGeometry)) {
+ instance.geometry = eastGeometry;
+ } else if (!defaultValue.defined(eastGeometry) && defaultValue.defined(westGeometry)) {
+ instance.geometry = westGeometry;
+ } else {
+ instance.westHemisphereGeometry = westGeometry;
+ instance.eastHemisphereGeometry = eastGeometry;
+ instance.geometry = undefined;
+ }
+ }
+
+ function generateBarycentricInterpolateFunction(
+ CartesianType,
+ numberOfComponents
+ ) {
+ const v0Scratch = new CartesianType();
+ const v1Scratch = new CartesianType();
+ const v2Scratch = new CartesianType();
+
+ return function (
+ i0,
+ i1,
+ i2,
+ coords,
+ sourceValues,
+ currentValues,
+ insertedIndex,
+ normalize
+ ) {
+ const v0 = CartesianType.fromArray(
+ sourceValues,
+ i0 * numberOfComponents,
+ v0Scratch
+ );
+ const v1 = CartesianType.fromArray(
+ sourceValues,
+ i1 * numberOfComponents,
+ v1Scratch
+ );
+ const v2 = CartesianType.fromArray(
+ sourceValues,
+ i2 * numberOfComponents,
+ v2Scratch
+ );
+
+ CartesianType.multiplyByScalar(v0, coords.x, v0);
+ CartesianType.multiplyByScalar(v1, coords.y, v1);
+ CartesianType.multiplyByScalar(v2, coords.z, v2);
+
+ const value = CartesianType.add(v0, v1, v0);
+ CartesianType.add(value, v2, value);
+
+ if (normalize) {
+ CartesianType.normalize(value, value);
+ }
+
+ CartesianType.pack(
+ value,
+ currentValues,
+ insertedIndex * numberOfComponents
+ );
+ };
+ }
+
+ const interpolateAndPackCartesian4 = generateBarycentricInterpolateFunction(
+ Matrix2.Cartesian4,
+ 4
+ );
+ const interpolateAndPackCartesian3 = generateBarycentricInterpolateFunction(
+ Matrix3.Cartesian3,
+ 3
+ );
+ const interpolateAndPackCartesian2 = generateBarycentricInterpolateFunction(
+ Matrix2.Cartesian2,
+ 2
+ );
+ const interpolateAndPackBoolean = function (
+ i0,
+ i1,
+ i2,
+ coords,
+ sourceValues,
+ currentValues,
+ insertedIndex
+ ) {
+ const v1 = sourceValues[i0] * coords.x;
+ const v2 = sourceValues[i1] * coords.y;
+ const v3 = sourceValues[i2] * coords.z;
+ currentValues[insertedIndex] = v1 + v2 + v3 > Math$1.CesiumMath.EPSILON6 ? 1 : 0;
+ };
+
+ const p0Scratch = new Matrix3.Cartesian3();
+ const p1Scratch = new Matrix3.Cartesian3();
+ const p2Scratch = new Matrix3.Cartesian3();
+ const barycentricScratch = new Matrix3.Cartesian3();
+
+ function computeTriangleAttributes(
+ i0,
+ i1,
+ i2,
+ point,
+ positions,
+ normals,
+ tangents,
+ bitangents,
+ texCoords,
+ extrudeDirections,
+ applyOffset,
+ currentAttributes,
+ customAttributeNames,
+ customAttributesLength,
+ allAttributes,
+ insertedIndex
+ ) {
+ if (
+ !defaultValue.defined(normals) &&
+ !defaultValue.defined(tangents) &&
+ !defaultValue.defined(bitangents) &&
+ !defaultValue.defined(texCoords) &&
+ !defaultValue.defined(extrudeDirections) &&
+ customAttributesLength === 0
+ ) {
+ return;
+ }
+
+ const p0 = Matrix3.Cartesian3.fromArray(positions, i0 * 3, p0Scratch);
+ const p1 = Matrix3.Cartesian3.fromArray(positions, i1 * 3, p1Scratch);
+ const p2 = Matrix3.Cartesian3.fromArray(positions, i2 * 3, p2Scratch);
+ const coords = barycentricCoordinates(point, p0, p1, p2, barycentricScratch);
+ if (!defaultValue.defined(coords)) {
+ return;
+ }
+
+ if (defaultValue.defined(normals)) {
+ interpolateAndPackCartesian3(
+ i0,
+ i1,
+ i2,
+ coords,
+ normals,
+ currentAttributes.normal.values,
+ insertedIndex,
+ true
+ );
+ }
+
+ if (defaultValue.defined(extrudeDirections)) {
+ const d0 = Matrix3.Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch);
+ const d1 = Matrix3.Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch);
+ const d2 = Matrix3.Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch);
+
+ Matrix3.Cartesian3.multiplyByScalar(d0, coords.x, d0);
+ Matrix3.Cartesian3.multiplyByScalar(d1, coords.y, d1);
+ Matrix3.Cartesian3.multiplyByScalar(d2, coords.z, d2);
+
+ let direction;
+ if (
+ !Matrix3.Cartesian3.equals(d0, Matrix3.Cartesian3.ZERO) ||
+ !Matrix3.Cartesian3.equals(d1, Matrix3.Cartesian3.ZERO) ||
+ !Matrix3.Cartesian3.equals(d2, Matrix3.Cartesian3.ZERO)
+ ) {
+ direction = Matrix3.Cartesian3.add(d0, d1, d0);
+ Matrix3.Cartesian3.add(direction, d2, direction);
+ Matrix3.Cartesian3.normalize(direction, direction);
+ } else {
+ direction = p0Scratch;
+ direction.x = 0;
+ direction.y = 0;
+ direction.z = 0;
+ }
+ Matrix3.Cartesian3.pack(
+ direction,
+ currentAttributes.extrudeDirection.values,
+ insertedIndex * 3
+ );
+ }
+
+ if (defaultValue.defined(applyOffset)) {
+ interpolateAndPackBoolean(
+ i0,
+ i1,
+ i2,
+ coords,
+ applyOffset,
+ currentAttributes.applyOffset.values,
+ insertedIndex
+ );
+ }
+
+ if (defaultValue.defined(tangents)) {
+ interpolateAndPackCartesian3(
+ i0,
+ i1,
+ i2,
+ coords,
+ tangents,
+ currentAttributes.tangent.values,
+ insertedIndex,
+ true
+ );
+ }
+
+ if (defaultValue.defined(bitangents)) {
+ interpolateAndPackCartesian3(
+ i0,
+ i1,
+ i2,
+ coords,
+ bitangents,
+ currentAttributes.bitangent.values,
+ insertedIndex,
+ true
+ );
+ }
+
+ if (defaultValue.defined(texCoords)) {
+ interpolateAndPackCartesian2(
+ i0,
+ i1,
+ i2,
+ coords,
+ texCoords,
+ currentAttributes.st.values,
+ insertedIndex
+ );
+ }
+
+ if (customAttributesLength > 0) {
+ for (let i = 0; i < customAttributesLength; i++) {
+ const attributeName = customAttributeNames[i];
+ genericInterpolate(
+ i0,
+ i1,
+ i2,
+ coords,
+ insertedIndex,
+ allAttributes[attributeName],
+ currentAttributes[attributeName]
+ );
+ }
+ }
+ }
+
+ function genericInterpolate(
+ i0,
+ i1,
+ i2,
+ coords,
+ insertedIndex,
+ sourceAttribute,
+ currentAttribute
+ ) {
+ const componentsPerAttribute = sourceAttribute.componentsPerAttribute;
+ const sourceValues = sourceAttribute.values;
+ const currentValues = currentAttribute.values;
+ switch (componentsPerAttribute) {
+ case 4:
+ interpolateAndPackCartesian4(
+ i0,
+ i1,
+ i2,
+ coords,
+ sourceValues,
+ currentValues,
+ insertedIndex,
+ false
+ );
+ break;
+ case 3:
+ interpolateAndPackCartesian3(
+ i0,
+ i1,
+ i2,
+ coords,
+ sourceValues,
+ currentValues,
+ insertedIndex,
+ false
+ );
+ break;
+ case 2:
+ interpolateAndPackCartesian2(
+ i0,
+ i1,
+ i2,
+ coords,
+ sourceValues,
+ currentValues,
+ insertedIndex,
+ false
+ );
+ break;
+ default:
+ currentValues[insertedIndex] =
+ sourceValues[i0] * coords.x +
+ sourceValues[i1] * coords.y +
+ sourceValues[i2] * coords.z;
+ }
+ }
+
+ function insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices,
+ currentIndex,
+ point
+ ) {
+ const insertIndex = currentAttributes.position.values.length / 3;
+
+ if (currentIndex !== -1) {
+ const prevIndex = indices[currentIndex];
+ const newIndex = currentIndexMap[prevIndex];
+
+ if (newIndex === -1) {
+ currentIndexMap[prevIndex] = insertIndex;
+ currentAttributes.position.values.push(point.x, point.y, point.z);
+ currentIndices.push(insertIndex);
+ return insertIndex;
+ }
+
+ currentIndices.push(newIndex);
+ return newIndex;
+ }
+
+ currentAttributes.position.values.push(point.x, point.y, point.z);
+ currentIndices.push(insertIndex);
+ return insertIndex;
+ }
+
+ const NAMED_ATTRIBUTES = {
+ position: true,
+ normal: true,
+ bitangent: true,
+ tangent: true,
+ st: true,
+ extrudeDirection: true,
+ applyOffset: true,
+ };
+ function splitLongitudeTriangles(instance) {
+ const geometry = instance.geometry;
+ const attributes = geometry.attributes;
+ const positions = attributes.position.values;
+ const normals = defaultValue.defined(attributes.normal)
+ ? attributes.normal.values
+ : undefined;
+ const bitangents = defaultValue.defined(attributes.bitangent)
+ ? attributes.bitangent.values
+ : undefined;
+ const tangents = defaultValue.defined(attributes.tangent)
+ ? attributes.tangent.values
+ : undefined;
+ const texCoords = defaultValue.defined(attributes.st) ? attributes.st.values : undefined;
+ const extrudeDirections = defaultValue.defined(attributes.extrudeDirection)
+ ? attributes.extrudeDirection.values
+ : undefined;
+ const applyOffset = defaultValue.defined(attributes.applyOffset)
+ ? attributes.applyOffset.values
+ : undefined;
+ const indices = geometry.indices;
+
+ const customAttributeNames = [];
+ for (const attributeName in attributes) {
+ if (
+ attributes.hasOwnProperty(attributeName) &&
+ !NAMED_ATTRIBUTES[attributeName] &&
+ defaultValue.defined(attributes[attributeName])
+ ) {
+ customAttributeNames.push(attributeName);
+ }
+ }
+ const customAttributesLength = customAttributeNames.length;
+
+ const eastGeometry = copyGeometryForSplit(geometry);
+ const westGeometry = copyGeometryForSplit(geometry);
+
+ let currentAttributes;
+ let currentIndices;
+ let currentIndexMap;
+ let insertedIndex;
+ let i;
+
+ const westGeometryIndexMap = [];
+ westGeometryIndexMap.length = positions.length / 3;
+
+ const eastGeometryIndexMap = [];
+ eastGeometryIndexMap.length = positions.length / 3;
+
+ for (i = 0; i < westGeometryIndexMap.length; ++i) {
+ westGeometryIndexMap[i] = -1;
+ eastGeometryIndexMap[i] = -1;
+ }
+
+ const len = indices.length;
+ for (i = 0; i < len; i += 3) {
+ const i0 = indices[i];
+ const i1 = indices[i + 1];
+ const i2 = indices[i + 2];
+
+ let p0 = Matrix3.Cartesian3.fromArray(positions, i0 * 3);
+ let p1 = Matrix3.Cartesian3.fromArray(positions, i1 * 3);
+ let p2 = Matrix3.Cartesian3.fromArray(positions, i2 * 3);
+
+ const result = splitTriangle(p0, p1, p2);
+ if (defaultValue.defined(result) && result.positions.length > 3) {
+ const resultPositions = result.positions;
+ const resultIndices = result.indices;
+ const resultLength = resultIndices.length;
+
+ for (let j = 0; j < resultLength; ++j) {
+ const resultIndex = resultIndices[j];
+ const point = resultPositions[resultIndex];
+
+ if (point.y < 0.0) {
+ currentAttributes = westGeometry.attributes;
+ currentIndices = westGeometry.indices;
+ currentIndexMap = westGeometryIndexMap;
+ } else {
+ currentAttributes = eastGeometry.attributes;
+ currentIndices = eastGeometry.indices;
+ currentIndexMap = eastGeometryIndexMap;
+ }
+
+ insertedIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices,
+ resultIndex < 3 ? i + resultIndex : -1,
+ point
+ );
+ computeTriangleAttributes(
+ i0,
+ i1,
+ i2,
+ point,
+ positions,
+ normals,
+ tangents,
+ bitangents,
+ texCoords,
+ extrudeDirections,
+ applyOffset,
+ currentAttributes,
+ customAttributeNames,
+ customAttributesLength,
+ attributes,
+ insertedIndex
+ );
+ }
+ } else {
+ if (defaultValue.defined(result)) {
+ p0 = result.positions[0];
+ p1 = result.positions[1];
+ p2 = result.positions[2];
+ }
+
+ if (p0.y < 0.0) {
+ currentAttributes = westGeometry.attributes;
+ currentIndices = westGeometry.indices;
+ currentIndexMap = westGeometryIndexMap;
+ } else {
+ currentAttributes = eastGeometry.attributes;
+ currentIndices = eastGeometry.indices;
+ currentIndexMap = eastGeometryIndexMap;
+ }
+
+ insertedIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices,
+ i,
+ p0
+ );
+ computeTriangleAttributes(
+ i0,
+ i1,
+ i2,
+ p0,
+ positions,
+ normals,
+ tangents,
+ bitangents,
+ texCoords,
+ extrudeDirections,
+ applyOffset,
+ currentAttributes,
+ customAttributeNames,
+ customAttributesLength,
+ attributes,
+ insertedIndex
+ );
+
+ insertedIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices,
+ i + 1,
+ p1
+ );
+ computeTriangleAttributes(
+ i0,
+ i1,
+ i2,
+ p1,
+ positions,
+ normals,
+ tangents,
+ bitangents,
+ texCoords,
+ extrudeDirections,
+ applyOffset,
+ currentAttributes,
+ customAttributeNames,
+ customAttributesLength,
+ attributes,
+ insertedIndex
+ );
+
+ insertedIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices,
+ i + 2,
+ p2
+ );
+ computeTriangleAttributes(
+ i0,
+ i1,
+ i2,
+ p2,
+ positions,
+ normals,
+ tangents,
+ bitangents,
+ texCoords,
+ extrudeDirections,
+ applyOffset,
+ currentAttributes,
+ customAttributeNames,
+ customAttributesLength,
+ attributes,
+ insertedIndex
+ );
+ }
+ }
+
+ updateInstanceAfterSplit(instance, westGeometry, eastGeometry);
+ }
+
+ const xzPlane = Plane.Plane.fromPointNormal(Matrix3.Cartesian3.ZERO, Matrix3.Cartesian3.UNIT_Y);
+
+ const offsetScratch = new Matrix3.Cartesian3();
+ const offsetPointScratch = new Matrix3.Cartesian3();
+
+ function computeLineAttributes(
+ i0,
+ i1,
+ point,
+ positions,
+ insertIndex,
+ currentAttributes,
+ applyOffset
+ ) {
+ if (!defaultValue.defined(applyOffset)) {
+ return;
+ }
+
+ const p0 = Matrix3.Cartesian3.fromArray(positions, i0 * 3, p0Scratch);
+ if (Matrix3.Cartesian3.equalsEpsilon(p0, point, Math$1.CesiumMath.EPSILON10)) {
+ currentAttributes.applyOffset.values[insertIndex] = applyOffset[i0];
+ } else {
+ currentAttributes.applyOffset.values[insertIndex] = applyOffset[i1];
+ }
+ }
+
+ function splitLongitudeLines(instance) {
+ const geometry = instance.geometry;
+ const attributes = geometry.attributes;
+ const positions = attributes.position.values;
+ const applyOffset = defaultValue.defined(attributes.applyOffset)
+ ? attributes.applyOffset.values
+ : undefined;
+ const indices = geometry.indices;
+
+ const eastGeometry = copyGeometryForSplit(geometry);
+ const westGeometry = copyGeometryForSplit(geometry);
+
+ let i;
+ const length = indices.length;
+
+ const westGeometryIndexMap = [];
+ westGeometryIndexMap.length = positions.length / 3;
+
+ const eastGeometryIndexMap = [];
+ eastGeometryIndexMap.length = positions.length / 3;
+
+ for (i = 0; i < westGeometryIndexMap.length; ++i) {
+ westGeometryIndexMap[i] = -1;
+ eastGeometryIndexMap[i] = -1;
+ }
+
+ for (i = 0; i < length; i += 2) {
+ const i0 = indices[i];
+ const i1 = indices[i + 1];
+
+ const p0 = Matrix3.Cartesian3.fromArray(positions, i0 * 3, p0Scratch);
+ const p1 = Matrix3.Cartesian3.fromArray(positions, i1 * 3, p1Scratch);
+ let insertIndex;
+
+ if (Math.abs(p0.y) < Math$1.CesiumMath.EPSILON6) {
+ if (p0.y < 0.0) {
+ p0.y = -Math$1.CesiumMath.EPSILON6;
+ } else {
+ p0.y = Math$1.CesiumMath.EPSILON6;
+ }
+ }
+
+ if (Math.abs(p1.y) < Math$1.CesiumMath.EPSILON6) {
+ if (p1.y < 0.0) {
+ p1.y = -Math$1.CesiumMath.EPSILON6;
+ } else {
+ p1.y = Math$1.CesiumMath.EPSILON6;
+ }
+ }
+
+ let p0Attributes = eastGeometry.attributes;
+ let p0Indices = eastGeometry.indices;
+ let p0IndexMap = eastGeometryIndexMap;
+ let p1Attributes = westGeometry.attributes;
+ let p1Indices = westGeometry.indices;
+ let p1IndexMap = westGeometryIndexMap;
+
+ const intersection = IntersectionTests.IntersectionTests.lineSegmentPlane(
+ p0,
+ p1,
+ xzPlane,
+ p2Scratch
+ );
+ if (defaultValue.defined(intersection)) {
+ // move point on the xz-plane slightly away from the plane
+ const offset = Matrix3.Cartesian3.multiplyByScalar(
+ Matrix3.Cartesian3.UNIT_Y,
+ 5.0 * Math$1.CesiumMath.EPSILON9,
+ offsetScratch
+ );
+ if (p0.y < 0.0) {
+ Matrix3.Cartesian3.negate(offset, offset);
+
+ p0Attributes = westGeometry.attributes;
+ p0Indices = westGeometry.indices;
+ p0IndexMap = westGeometryIndexMap;
+ p1Attributes = eastGeometry.attributes;
+ p1Indices = eastGeometry.indices;
+ p1IndexMap = eastGeometryIndexMap;
+ }
+
+ const offsetPoint = Matrix3.Cartesian3.add(
+ intersection,
+ offset,
+ offsetPointScratch
+ );
+
+ insertIndex = insertSplitPoint(
+ p0Attributes,
+ p0Indices,
+ p0IndexMap,
+ indices,
+ i,
+ p0
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ p0,
+ positions,
+ insertIndex,
+ p0Attributes,
+ applyOffset
+ );
+
+ insertIndex = insertSplitPoint(
+ p0Attributes,
+ p0Indices,
+ p0IndexMap,
+ indices,
+ -1,
+ offsetPoint
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ offsetPoint,
+ positions,
+ insertIndex,
+ p0Attributes,
+ applyOffset
+ );
+
+ Matrix3.Cartesian3.negate(offset, offset);
+ Matrix3.Cartesian3.add(intersection, offset, offsetPoint);
+ insertIndex = insertSplitPoint(
+ p1Attributes,
+ p1Indices,
+ p1IndexMap,
+ indices,
+ -1,
+ offsetPoint
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ offsetPoint,
+ positions,
+ insertIndex,
+ p1Attributes,
+ applyOffset
+ );
+
+ insertIndex = insertSplitPoint(
+ p1Attributes,
+ p1Indices,
+ p1IndexMap,
+ indices,
+ i + 1,
+ p1
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ p1,
+ positions,
+ insertIndex,
+ p1Attributes,
+ applyOffset
+ );
+ } else {
+ let currentAttributes;
+ let currentIndices;
+ let currentIndexMap;
+
+ if (p0.y < 0.0) {
+ currentAttributes = westGeometry.attributes;
+ currentIndices = westGeometry.indices;
+ currentIndexMap = westGeometryIndexMap;
+ } else {
+ currentAttributes = eastGeometry.attributes;
+ currentIndices = eastGeometry.indices;
+ currentIndexMap = eastGeometryIndexMap;
+ }
+
+ insertIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices,
+ i,
+ p0
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ p0,
+ positions,
+ insertIndex,
+ currentAttributes,
+ applyOffset
+ );
+
+ insertIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices,
+ i + 1,
+ p1
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ p1,
+ positions,
+ insertIndex,
+ currentAttributes,
+ applyOffset
+ );
+ }
+ }
+
+ updateInstanceAfterSplit(instance, westGeometry, eastGeometry);
+ }
+
+ const cartesian2Scratch0 = new Matrix2.Cartesian2();
+ const cartesian2Scratch1 = new Matrix2.Cartesian2();
+
+ const cartesian3Scratch0 = new Matrix3.Cartesian3();
+ const cartesian3Scratch2 = new Matrix3.Cartesian3();
+ const cartesian3Scratch3 = new Matrix3.Cartesian3();
+ const cartesian3Scratch4 = new Matrix3.Cartesian3();
+ const cartesian3Scratch5 = new Matrix3.Cartesian3();
+ const cartesian3Scratch6 = new Matrix3.Cartesian3();
+
+ const cartesian4Scratch0 = new Matrix2.Cartesian4();
+
+ function updateAdjacencyAfterSplit(geometry) {
+ const attributes = geometry.attributes;
+ const positions = attributes.position.values;
+ const prevPositions = attributes.prevPosition.values;
+ const nextPositions = attributes.nextPosition.values;
+
+ const length = positions.length;
+ for (let j = 0; j < length; j += 3) {
+ const position = Matrix3.Cartesian3.unpack(positions, j, cartesian3Scratch0);
+ if (position.x > 0.0) {
+ continue;
+ }
+
+ const prevPosition = Matrix3.Cartesian3.unpack(
+ prevPositions,
+ j,
+ cartesian3Scratch2
+ );
+ if (
+ (position.y < 0.0 && prevPosition.y > 0.0) ||
+ (position.y > 0.0 && prevPosition.y < 0.0)
+ ) {
+ if (j - 3 > 0) {
+ prevPositions[j] = positions[j - 3];
+ prevPositions[j + 1] = positions[j - 2];
+ prevPositions[j + 2] = positions[j - 1];
+ } else {
+ Matrix3.Cartesian3.pack(position, prevPositions, j);
+ }
+ }
+
+ const nextPosition = Matrix3.Cartesian3.unpack(
+ nextPositions,
+ j,
+ cartesian3Scratch3
+ );
+ if (
+ (position.y < 0.0 && nextPosition.y > 0.0) ||
+ (position.y > 0.0 && nextPosition.y < 0.0)
+ ) {
+ if (j + 3 < length) {
+ nextPositions[j] = positions[j + 3];
+ nextPositions[j + 1] = positions[j + 4];
+ nextPositions[j + 2] = positions[j + 5];
+ } else {
+ Matrix3.Cartesian3.pack(position, nextPositions, j);
+ }
+ }
+ }
+ }
+
+ const offsetScalar = 5.0 * Math$1.CesiumMath.EPSILON9;
+ const coplanarOffset = Math$1.CesiumMath.EPSILON6;
+
+ function splitLongitudePolyline(instance) {
+ const geometry = instance.geometry;
+ const attributes = geometry.attributes;
+ const positions = attributes.position.values;
+ const prevPositions = attributes.prevPosition.values;
+ const nextPositions = attributes.nextPosition.values;
+ const expandAndWidths = attributes.expandAndWidth.values;
+
+ const texCoords = defaultValue.defined(attributes.st) ? attributes.st.values : undefined;
+ const colors = defaultValue.defined(attributes.color)
+ ? attributes.color.values
+ : undefined;
+
+ const eastGeometry = copyGeometryForSplit(geometry);
+ const westGeometry = copyGeometryForSplit(geometry);
+
+ let i;
+ let j;
+ let index;
+
+ let intersectionFound = false;
+
+ const length = positions.length / 3;
+ for (i = 0; i < length; i += 4) {
+ const i0 = i;
+ const i2 = i + 2;
+
+ const p0 = Matrix3.Cartesian3.fromArray(positions, i0 * 3, cartesian3Scratch0);
+ const p2 = Matrix3.Cartesian3.fromArray(positions, i2 * 3, cartesian3Scratch2);
+
+ // Offset points that are close to the 180 longitude and change the previous/next point
+ // to be the same offset point so it can be projected to 2D. There is special handling in the
+ // shader for when position == prevPosition || position == nextPosition.
+ if (Math.abs(p0.y) < coplanarOffset) {
+ p0.y = coplanarOffset * (p2.y < 0.0 ? -1.0 : 1.0);
+ positions[i * 3 + 1] = p0.y;
+ positions[(i + 1) * 3 + 1] = p0.y;
+
+ for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {
+ prevPositions[j] = positions[i * 3];
+ prevPositions[j + 1] = positions[i * 3 + 1];
+ prevPositions[j + 2] = positions[i * 3 + 2];
+ }
+ }
+
+ // Do the same but for when the line crosses 180 longitude in the opposite direction.
+ if (Math.abs(p2.y) < coplanarOffset) {
+ p2.y = coplanarOffset * (p0.y < 0.0 ? -1.0 : 1.0);
+ positions[(i + 2) * 3 + 1] = p2.y;
+ positions[(i + 3) * 3 + 1] = p2.y;
+
+ for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {
+ nextPositions[j] = positions[(i + 2) * 3];
+ nextPositions[j + 1] = positions[(i + 2) * 3 + 1];
+ nextPositions[j + 2] = positions[(i + 2) * 3 + 2];
+ }
+ }
+
+ let p0Attributes = eastGeometry.attributes;
+ let p0Indices = eastGeometry.indices;
+ let p2Attributes = westGeometry.attributes;
+ let p2Indices = westGeometry.indices;
+
+ const intersection = IntersectionTests.IntersectionTests.lineSegmentPlane(
+ p0,
+ p2,
+ xzPlane,
+ cartesian3Scratch4
+ );
+ if (defaultValue.defined(intersection)) {
+ intersectionFound = true;
+
+ // move point on the xz-plane slightly away from the plane
+ const offset = Matrix3.Cartesian3.multiplyByScalar(
+ Matrix3.Cartesian3.UNIT_Y,
+ offsetScalar,
+ cartesian3Scratch5
+ );
+ if (p0.y < 0.0) {
+ Matrix3.Cartesian3.negate(offset, offset);
+ p0Attributes = westGeometry.attributes;
+ p0Indices = westGeometry.indices;
+ p2Attributes = eastGeometry.attributes;
+ p2Indices = eastGeometry.indices;
+ }
+
+ const offsetPoint = Matrix3.Cartesian3.add(
+ intersection,
+ offset,
+ cartesian3Scratch6
+ );
+ p0Attributes.position.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);
+ p0Attributes.position.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p0Attributes.position.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+
+ p0Attributes.prevPosition.values.push(
+ prevPositions[i0 * 3],
+ prevPositions[i0 * 3 + 1],
+ prevPositions[i0 * 3 + 2]
+ );
+ p0Attributes.prevPosition.values.push(
+ prevPositions[i0 * 3 + 3],
+ prevPositions[i0 * 3 + 4],
+ prevPositions[i0 * 3 + 5]
+ );
+ p0Attributes.prevPosition.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);
+
+ p0Attributes.nextPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p0Attributes.nextPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p0Attributes.nextPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p0Attributes.nextPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+
+ Matrix3.Cartesian3.negate(offset, offset);
+ Matrix3.Cartesian3.add(intersection, offset, offsetPoint);
+ p2Attributes.position.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.position.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.position.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);
+
+ p2Attributes.prevPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.prevPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.prevPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.prevPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+
+ p2Attributes.nextPosition.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);
+ p2Attributes.nextPosition.values.push(
+ nextPositions[i2 * 3],
+ nextPositions[i2 * 3 + 1],
+ nextPositions[i2 * 3 + 2]
+ );
+ p2Attributes.nextPosition.values.push(
+ nextPositions[i2 * 3 + 3],
+ nextPositions[i2 * 3 + 4],
+ nextPositions[i2 * 3 + 5]
+ );
+
+ const ew0 = Matrix2.Cartesian2.fromArray(
+ expandAndWidths,
+ i0 * 2,
+ cartesian2Scratch0
+ );
+ const width = Math.abs(ew0.y);
+
+ p0Attributes.expandAndWidth.values.push(-1, width, 1, width);
+ p0Attributes.expandAndWidth.values.push(-1, -width, 1, -width);
+ p2Attributes.expandAndWidth.values.push(-1, width, 1, width);
+ p2Attributes.expandAndWidth.values.push(-1, -width, 1, -width);
+
+ let t = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(intersection, p0, cartesian3Scratch3)
+ );
+ t /= Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(p2, p0, cartesian3Scratch3)
+ );
+
+ if (defaultValue.defined(colors)) {
+ const c0 = Matrix2.Cartesian4.fromArray(colors, i0 * 4, cartesian4Scratch0);
+ const c2 = Matrix2.Cartesian4.fromArray(colors, i2 * 4, cartesian4Scratch0);
+
+ const r = Math$1.CesiumMath.lerp(c0.x, c2.x, t);
+ const g = Math$1.CesiumMath.lerp(c0.y, c2.y, t);
+ const b = Math$1.CesiumMath.lerp(c0.z, c2.z, t);
+ const a = Math$1.CesiumMath.lerp(c0.w, c2.w, t);
+
+ for (j = i0 * 4; j < i0 * 4 + 2 * 4; ++j) {
+ p0Attributes.color.values.push(colors[j]);
+ }
+ p0Attributes.color.values.push(r, g, b, a);
+ p0Attributes.color.values.push(r, g, b, a);
+ p2Attributes.color.values.push(r, g, b, a);
+ p2Attributes.color.values.push(r, g, b, a);
+ for (j = i2 * 4; j < i2 * 4 + 2 * 4; ++j) {
+ p2Attributes.color.values.push(colors[j]);
+ }
+ }
+
+ if (defaultValue.defined(texCoords)) {
+ const s0 = Matrix2.Cartesian2.fromArray(texCoords, i0 * 2, cartesian2Scratch0);
+ const s3 = Matrix2.Cartesian2.fromArray(
+ texCoords,
+ (i + 3) * 2,
+ cartesian2Scratch1
+ );
+
+ const sx = Math$1.CesiumMath.lerp(s0.x, s3.x, t);
+
+ for (j = i0 * 2; j < i0 * 2 + 2 * 2; ++j) {
+ p0Attributes.st.values.push(texCoords[j]);
+ }
+ p0Attributes.st.values.push(sx, s0.y);
+ p0Attributes.st.values.push(sx, s3.y);
+ p2Attributes.st.values.push(sx, s0.y);
+ p2Attributes.st.values.push(sx, s3.y);
+ for (j = i2 * 2; j < i2 * 2 + 2 * 2; ++j) {
+ p2Attributes.st.values.push(texCoords[j]);
+ }
+ }
+
+ index = p0Attributes.position.values.length / 3 - 4;
+ p0Indices.push(index, index + 2, index + 1);
+ p0Indices.push(index + 1, index + 2, index + 3);
+
+ index = p2Attributes.position.values.length / 3 - 4;
+ p2Indices.push(index, index + 2, index + 1);
+ p2Indices.push(index + 1, index + 2, index + 3);
+ } else {
+ let currentAttributes;
+ let currentIndices;
+
+ if (p0.y < 0.0) {
+ currentAttributes = westGeometry.attributes;
+ currentIndices = westGeometry.indices;
+ } else {
+ currentAttributes = eastGeometry.attributes;
+ currentIndices = eastGeometry.indices;
+ }
+
+ currentAttributes.position.values.push(p0.x, p0.y, p0.z);
+ currentAttributes.position.values.push(p0.x, p0.y, p0.z);
+ currentAttributes.position.values.push(p2.x, p2.y, p2.z);
+ currentAttributes.position.values.push(p2.x, p2.y, p2.z);
+
+ for (j = i * 3; j < i * 3 + 4 * 3; ++j) {
+ currentAttributes.prevPosition.values.push(prevPositions[j]);
+ currentAttributes.nextPosition.values.push(nextPositions[j]);
+ }
+
+ for (j = i * 2; j < i * 2 + 4 * 2; ++j) {
+ currentAttributes.expandAndWidth.values.push(expandAndWidths[j]);
+ if (defaultValue.defined(texCoords)) {
+ currentAttributes.st.values.push(texCoords[j]);
+ }
+ }
+
+ if (defaultValue.defined(colors)) {
+ for (j = i * 4; j < i * 4 + 4 * 4; ++j) {
+ currentAttributes.color.values.push(colors[j]);
+ }
+ }
+
+ index = currentAttributes.position.values.length / 3 - 4;
+ currentIndices.push(index, index + 2, index + 1);
+ currentIndices.push(index + 1, index + 2, index + 3);
+ }
+ }
+
+ if (intersectionFound) {
+ updateAdjacencyAfterSplit(westGeometry);
+ updateAdjacencyAfterSplit(eastGeometry);
+ }
+
+ updateInstanceAfterSplit(instance, westGeometry, eastGeometry);
+ }
+
+ /**
+ * Splits the instances's geometry, by introducing new vertices and indices,that
+ * intersect the International Date Line and Prime Meridian so that no primitives cross longitude
+ * -180/180 degrees. This is not required for 3D drawing, but is required for
+ * correcting drawing in 2D and Columbus view.
+ *
+ * @private
+ *
+ * @param {GeometryInstance} instance The instance to modify.
+ * @returns {GeometryInstance} The modified instance
argument, with it's geometry split at the International Date Line.
+ *
+ * @example
+ * instance = Cesium.GeometryPipeline.splitLongitude(instance);
+ */
+ GeometryPipeline.splitLongitude = function (instance) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(instance)) {
+ throw new Check.DeveloperError("instance is required.");
+ }
+ //>>includeEnd('debug');
+
+ const geometry = instance.geometry;
+ const boundingSphere = geometry.boundingSphere;
+ if (defaultValue.defined(boundingSphere)) {
+ const minX = boundingSphere.center.x - boundingSphere.radius;
+ if (
+ minX > 0 ||
+ Transforms.BoundingSphere.intersectPlane(boundingSphere, Plane.Plane.ORIGIN_ZX_PLANE) !==
+ Transforms.Intersect.INTERSECTING
+ ) {
+ return instance;
+ }
+ }
+
+ if (geometry.geometryType !== GeometryAttribute.GeometryType.NONE) {
+ switch (geometry.geometryType) {
+ case GeometryAttribute.GeometryType.POLYLINES:
+ splitLongitudePolyline(instance);
+ break;
+ case GeometryAttribute.GeometryType.TRIANGLES:
+ splitLongitudeTriangles(instance);
+ break;
+ case GeometryAttribute.GeometryType.LINES:
+ splitLongitudeLines(instance);
+ break;
+ }
+ } else {
+ indexPrimitive(geometry);
+ if (geometry.primitiveType === GeometryAttribute.PrimitiveType.TRIANGLES) {
+ splitLongitudeTriangles(instance);
+ } else if (geometry.primitiveType === GeometryAttribute.PrimitiveType.LINES) {
+ splitLongitudeLines(instance);
+ }
+ }
+
+ return instance;
+ };
+ var GeometryPipeline$1 = GeometryPipeline;
+
+ exports.GeometryPipeline = GeometryPipeline$1;
+
+}));
+//# sourceMappingURL=GeometryPipeline-f28890f4.js.map
diff --git a/examples/cesium/Workers/GeometryPipeline-f28890f4.js.map b/examples/cesium/Workers/GeometryPipeline-f28890f4.js.map
new file mode 100644
index 0000000..9cf340b
--- /dev/null
+++ b/examples/cesium/Workers/GeometryPipeline-f28890f4.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"GeometryPipeline-f28890f4.js","sources":["../../../Source/Core/barycentricCoordinates.js","../../../Source/Core/Tipsify.js","../../../Source/Core/GeometryPipeline.js"],"sourcesContent":["import Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defined from \"./defined.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\nconst scratchCartesian1 = new Cartesian3();\r\nconst scratchCartesian2 = new Cartesian3();\r\nconst scratchCartesian3 = new Cartesian3();\r\n\r\n/**\r\n * Computes the barycentric coordinates for a point with respect to a triangle.\r\n *\r\n * @function\r\n *\r\n * @param {Cartesian2|Cartesian3} point The point to test.\r\n * @param {Cartesian2|Cartesian3} p0 The first point of the triangle, corresponding to the barycentric x-axis.\r\n * @param {Cartesian2|Cartesian3} p1 The second point of the triangle, corresponding to the barycentric y-axis.\r\n * @param {Cartesian2|Cartesian3} p2 The third point of the triangle, corresponding to the barycentric z-axis.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3|undefined} The modified result parameter or a new Cartesian3 instance if one was not provided. If the triangle is degenerate the function will return undefined.\r\n *\r\n * @example\r\n * // Returns Cartesian3.UNIT_X\r\n * const p = new Cesium.Cartesian3(-1.0, 0.0, 0.0);\r\n * const b = Cesium.barycentricCoordinates(p,\r\n * new Cesium.Cartesian3(-1.0, 0.0, 0.0),\r\n * new Cesium.Cartesian3( 1.0, 0.0, 0.0),\r\n * new Cesium.Cartesian3( 0.0, 1.0, 1.0));\r\n */\r\nfunction barycentricCoordinates(point, p0, p1, p2, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"point\", point);\r\n Check.defined(\"p0\", p0);\r\n Check.defined(\"p1\", p1);\r\n Check.defined(\"p2\", p2);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n // Implementation based on http://www.blackpawn.com/texts/pointinpoly/default.html.\r\n let v0;\r\n let v1;\r\n let v2;\r\n let dot00;\r\n let dot01;\r\n let dot02;\r\n let dot11;\r\n let dot12;\r\n\r\n if (!defined(p0.z)) {\r\n if (Cartesian2.equalsEpsilon(point, p0, CesiumMath.EPSILON14)) {\r\n return Cartesian3.clone(Cartesian3.UNIT_X, result);\r\n }\r\n if (Cartesian2.equalsEpsilon(point, p1, CesiumMath.EPSILON14)) {\r\n return Cartesian3.clone(Cartesian3.UNIT_Y, result);\r\n }\r\n if (Cartesian2.equalsEpsilon(point, p2, CesiumMath.EPSILON14)) {\r\n return Cartesian3.clone(Cartesian3.UNIT_Z, result);\r\n }\r\n\r\n v0 = Cartesian2.subtract(p1, p0, scratchCartesian1);\r\n v1 = Cartesian2.subtract(p2, p0, scratchCartesian2);\r\n v2 = Cartesian2.subtract(point, p0, scratchCartesian3);\r\n\r\n dot00 = Cartesian2.dot(v0, v0);\r\n dot01 = Cartesian2.dot(v0, v1);\r\n dot02 = Cartesian2.dot(v0, v2);\r\n dot11 = Cartesian2.dot(v1, v1);\r\n dot12 = Cartesian2.dot(v1, v2);\r\n } else {\r\n if (Cartesian3.equalsEpsilon(point, p0, CesiumMath.EPSILON14)) {\r\n return Cartesian3.clone(Cartesian3.UNIT_X, result);\r\n }\r\n if (Cartesian3.equalsEpsilon(point, p1, CesiumMath.EPSILON14)) {\r\n return Cartesian3.clone(Cartesian3.UNIT_Y, result);\r\n }\r\n if (Cartesian3.equalsEpsilon(point, p2, CesiumMath.EPSILON14)) {\r\n return Cartesian3.clone(Cartesian3.UNIT_Z, result);\r\n }\r\n\r\n v0 = Cartesian3.subtract(p1, p0, scratchCartesian1);\r\n v1 = Cartesian3.subtract(p2, p0, scratchCartesian2);\r\n v2 = Cartesian3.subtract(point, p0, scratchCartesian3);\r\n\r\n dot00 = Cartesian3.dot(v0, v0);\r\n dot01 = Cartesian3.dot(v0, v1);\r\n dot02 = Cartesian3.dot(v0, v2);\r\n dot11 = Cartesian3.dot(v1, v1);\r\n dot12 = Cartesian3.dot(v1, v2);\r\n }\r\n\r\n result.y = dot11 * dot02 - dot01 * dot12;\r\n result.z = dot00 * dot12 - dot01 * dot02;\r\n const q = dot00 * dot11 - dot01 * dot01;\r\n\r\n // Triangle is degenerate\r\n if (q === 0) {\r\n return undefined;\r\n }\r\n\r\n result.y /= q;\r\n result.z /= q;\r\n result.x = 1.0 - result.y - result.z;\r\n return result;\r\n}\r\nexport default barycentricCoordinates;\r\n","import defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * Encapsulates an algorithm to optimize triangles for the post\r\n * vertex-shader cache. This is based on the 2007 SIGGRAPH paper\r\n * 'Fast Triangle Reordering for Vertex Locality and Reduced Overdraw.'\r\n * The runtime is linear but several passes are made.\r\n *\r\n * @namespace Tipsify\r\n *\r\n * @see \r\n * Fast Triangle Reordering for Vertex Locality and Reduced Overdraw\r\n * by Sander, Nehab, and Barczak\r\n *\r\n * @private\r\n */\r\nconst Tipsify = {};\r\n\r\n/**\r\n * Calculates the average cache miss ratio (ACMR) for a given set of indices.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Number[]} options.indices Lists triads of numbers corresponding to the indices of the vertices\r\n * in the vertex buffer that define the geometry's triangles.\r\n * @param {Number} [options.maximumIndex] The maximum value of the elements in args.indices
.\r\n * If not supplied, this value will be computed.\r\n * @param {Number} [options.cacheSize=24] The number of vertices that can be stored in the cache at any one time.\r\n * @returns {Number} The average cache miss ratio (ACMR).\r\n *\r\n * @exception {DeveloperError} indices length must be a multiple of three.\r\n * @exception {DeveloperError} cacheSize must be greater than two.\r\n *\r\n * @example\r\n * const indices = [0, 1, 2, 3, 4, 5];\r\n * const maxIndex = 5;\r\n * const cacheSize = 3;\r\n * const acmr = Cesium.Tipsify.calculateACMR({indices : indices, maxIndex : maxIndex, cacheSize : cacheSize});\r\n */\r\nTipsify.calculateACMR = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const indices = options.indices;\r\n let maximumIndex = options.maximumIndex;\r\n const cacheSize = defaultValue(options.cacheSize, 24);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(indices)) {\r\n throw new DeveloperError(\"indices is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const numIndices = indices.length;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (numIndices < 3 || numIndices % 3 !== 0) {\r\n throw new DeveloperError(\"indices length must be a multiple of three.\");\r\n }\r\n if (maximumIndex <= 0) {\r\n throw new DeveloperError(\"maximumIndex must be greater than zero.\");\r\n }\r\n if (cacheSize < 3) {\r\n throw new DeveloperError(\"cacheSize must be greater than two.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n // Compute the maximumIndex if not given\r\n if (!defined(maximumIndex)) {\r\n maximumIndex = 0;\r\n let currentIndex = 0;\r\n let intoIndices = indices[currentIndex];\r\n while (currentIndex < numIndices) {\r\n if (intoIndices > maximumIndex) {\r\n maximumIndex = intoIndices;\r\n }\r\n ++currentIndex;\r\n intoIndices = indices[currentIndex];\r\n }\r\n }\r\n\r\n // Vertex time stamps\r\n const vertexTimeStamps = [];\r\n for (let i = 0; i < maximumIndex + 1; i++) {\r\n vertexTimeStamps[i] = 0;\r\n }\r\n\r\n // Cache processing\r\n let s = cacheSize + 1;\r\n for (let j = 0; j < numIndices; ++j) {\r\n if (s - vertexTimeStamps[indices[j]] > cacheSize) {\r\n vertexTimeStamps[indices[j]] = s;\r\n ++s;\r\n }\r\n }\r\n\r\n return (s - cacheSize + 1) / (numIndices / 3);\r\n};\r\n\r\n/**\r\n * Optimizes triangles for the post-vertex shader cache.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Number[]} options.indices Lists triads of numbers corresponding to the indices of the vertices\r\n * in the vertex buffer that define the geometry's triangles.\r\n * @param {Number} [options.maximumIndex] The maximum value of the elements in args.indices
.\r\n * If not supplied, this value will be computed.\r\n * @param {Number} [options.cacheSize=24] The number of vertices that can be stored in the cache at any one time.\r\n * @returns {Number[]} A list of the input indices in an optimized order.\r\n *\r\n * @exception {DeveloperError} indices length must be a multiple of three.\r\n * @exception {DeveloperError} cacheSize must be greater than two.\r\n *\r\n * @example\r\n * const indices = [0, 1, 2, 3, 4, 5];\r\n * const maxIndex = 5;\r\n * const cacheSize = 3;\r\n * const reorderedIndices = Cesium.Tipsify.tipsify({indices : indices, maxIndex : maxIndex, cacheSize : cacheSize});\r\n */\r\nTipsify.tipsify = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const indices = options.indices;\r\n const maximumIndex = options.maximumIndex;\r\n const cacheSize = defaultValue(options.cacheSize, 24);\r\n\r\n let cursor;\r\n\r\n function skipDeadEnd(vertices, deadEnd, indices, maximumIndexPlusOne) {\r\n while (deadEnd.length >= 1) {\r\n // while the stack is not empty\r\n const d = deadEnd[deadEnd.length - 1]; // top of the stack\r\n deadEnd.splice(deadEnd.length - 1, 1); // pop the stack\r\n\r\n if (vertices[d].numLiveTriangles > 0) {\r\n return d;\r\n }\r\n }\r\n\r\n while (cursor < maximumIndexPlusOne) {\r\n if (vertices[cursor].numLiveTriangles > 0) {\r\n ++cursor;\r\n return cursor - 1;\r\n }\r\n ++cursor;\r\n }\r\n return -1;\r\n }\r\n\r\n function getNextVertex(\r\n indices,\r\n cacheSize,\r\n oneRing,\r\n vertices,\r\n s,\r\n deadEnd,\r\n maximumIndexPlusOne\r\n ) {\r\n let n = -1;\r\n let p;\r\n let m = -1;\r\n let itOneRing = 0;\r\n while (itOneRing < oneRing.length) {\r\n const index = oneRing[itOneRing];\r\n if (vertices[index].numLiveTriangles) {\r\n p = 0;\r\n if (\r\n s -\r\n vertices[index].timeStamp +\r\n 2 * vertices[index].numLiveTriangles <=\r\n cacheSize\r\n ) {\r\n p = s - vertices[index].timeStamp;\r\n }\r\n if (p > m || m === -1) {\r\n m = p;\r\n n = index;\r\n }\r\n }\r\n ++itOneRing;\r\n }\r\n if (n === -1) {\r\n return skipDeadEnd(vertices, deadEnd, indices, maximumIndexPlusOne);\r\n }\r\n return n;\r\n }\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(indices)) {\r\n throw new DeveloperError(\"indices is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const numIndices = indices.length;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (numIndices < 3 || numIndices % 3 !== 0) {\r\n throw new DeveloperError(\"indices length must be a multiple of three.\");\r\n }\r\n if (maximumIndex <= 0) {\r\n throw new DeveloperError(\"maximumIndex must be greater than zero.\");\r\n }\r\n if (cacheSize < 3) {\r\n throw new DeveloperError(\"cacheSize must be greater than two.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n // Determine maximum index\r\n let maximumIndexPlusOne = 0;\r\n let currentIndex = 0;\r\n let intoIndices = indices[currentIndex];\r\n const endIndex = numIndices;\r\n if (defined(maximumIndex)) {\r\n maximumIndexPlusOne = maximumIndex + 1;\r\n } else {\r\n while (currentIndex < endIndex) {\r\n if (intoIndices > maximumIndexPlusOne) {\r\n maximumIndexPlusOne = intoIndices;\r\n }\r\n ++currentIndex;\r\n intoIndices = indices[currentIndex];\r\n }\r\n if (maximumIndexPlusOne === -1) {\r\n return 0;\r\n }\r\n ++maximumIndexPlusOne;\r\n }\r\n\r\n // Vertices\r\n const vertices = [];\r\n let i;\r\n for (i = 0; i < maximumIndexPlusOne; i++) {\r\n vertices[i] = {\r\n numLiveTriangles: 0,\r\n timeStamp: 0,\r\n vertexTriangles: [],\r\n };\r\n }\r\n currentIndex = 0;\r\n let triangle = 0;\r\n while (currentIndex < endIndex) {\r\n vertices[indices[currentIndex]].vertexTriangles.push(triangle);\r\n ++vertices[indices[currentIndex]].numLiveTriangles;\r\n vertices[indices[currentIndex + 1]].vertexTriangles.push(triangle);\r\n ++vertices[indices[currentIndex + 1]].numLiveTriangles;\r\n vertices[indices[currentIndex + 2]].vertexTriangles.push(triangle);\r\n ++vertices[indices[currentIndex + 2]].numLiveTriangles;\r\n ++triangle;\r\n currentIndex += 3;\r\n }\r\n\r\n // Starting index\r\n let f = 0;\r\n\r\n // Time Stamp\r\n let s = cacheSize + 1;\r\n cursor = 1;\r\n\r\n // Process\r\n let oneRing = [];\r\n const deadEnd = []; //Stack\r\n let vertex;\r\n let intoVertices;\r\n let currentOutputIndex = 0;\r\n const outputIndices = [];\r\n const numTriangles = numIndices / 3;\r\n const triangleEmitted = [];\r\n for (i = 0; i < numTriangles; i++) {\r\n triangleEmitted[i] = false;\r\n }\r\n let index;\r\n let limit;\r\n while (f !== -1) {\r\n oneRing = [];\r\n intoVertices = vertices[f];\r\n limit = intoVertices.vertexTriangles.length;\r\n for (let k = 0; k < limit; ++k) {\r\n triangle = intoVertices.vertexTriangles[k];\r\n if (!triangleEmitted[triangle]) {\r\n triangleEmitted[triangle] = true;\r\n currentIndex = triangle + triangle + triangle;\r\n for (let j = 0; j < 3; ++j) {\r\n // Set this index as a possible next index\r\n index = indices[currentIndex];\r\n oneRing.push(index);\r\n deadEnd.push(index);\r\n\r\n // Output index\r\n outputIndices[currentOutputIndex] = index;\r\n ++currentOutputIndex;\r\n\r\n // Cache processing\r\n vertex = vertices[index];\r\n --vertex.numLiveTriangles;\r\n if (s - vertex.timeStamp > cacheSize) {\r\n vertex.timeStamp = s;\r\n ++s;\r\n }\r\n ++currentIndex;\r\n }\r\n }\r\n }\r\n f = getNextVertex(\r\n indices,\r\n cacheSize,\r\n oneRing,\r\n vertices,\r\n s,\r\n deadEnd,\r\n maximumIndexPlusOne\r\n );\r\n }\r\n\r\n return outputIndices;\r\n};\r\nexport default Tipsify;\r\n","import AttributeCompression from \"./AttributeCompression.js\";\r\nimport barycentricCoordinates from \"./barycentricCoordinates.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartesian4 from \"./Cartesian4.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport EncodedCartesian3 from \"./EncodedCartesian3.js\";\r\nimport GeographicProjection from \"./GeographicProjection.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryType from \"./GeometryType.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport Intersect from \"./Intersect.js\";\r\nimport IntersectionTests from \"./IntersectionTests.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport Plane from \"./Plane.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport Tipsify from \"./Tipsify.js\";\r\n\r\n/**\r\n * Content pipeline functions for geometries.\r\n *\r\n * @namespace GeometryPipeline\r\n *\r\n * @see Geometry\r\n */\r\nconst GeometryPipeline = {};\r\n\r\nfunction addTriangle(lines, index, i0, i1, i2) {\r\n lines[index++] = i0;\r\n lines[index++] = i1;\r\n\r\n lines[index++] = i1;\r\n lines[index++] = i2;\r\n\r\n lines[index++] = i2;\r\n lines[index] = i0;\r\n}\r\n\r\nfunction trianglesToLines(triangles) {\r\n const count = triangles.length;\r\n const size = (count / 3) * 6;\r\n const lines = IndexDatatype.createTypedArray(count, size);\r\n\r\n let index = 0;\r\n for (let i = 0; i < count; i += 3, index += 6) {\r\n addTriangle(lines, index, triangles[i], triangles[i + 1], triangles[i + 2]);\r\n }\r\n\r\n return lines;\r\n}\r\n\r\nfunction triangleStripToLines(triangles) {\r\n const count = triangles.length;\r\n if (count >= 3) {\r\n const size = (count - 2) * 6;\r\n const lines = IndexDatatype.createTypedArray(count, size);\r\n\r\n addTriangle(lines, 0, triangles[0], triangles[1], triangles[2]);\r\n let index = 6;\r\n\r\n for (let i = 3; i < count; ++i, index += 6) {\r\n addTriangle(\r\n lines,\r\n index,\r\n triangles[i - 1],\r\n triangles[i],\r\n triangles[i - 2]\r\n );\r\n }\r\n\r\n return lines;\r\n }\r\n\r\n return new Uint16Array();\r\n}\r\n\r\nfunction triangleFanToLines(triangles) {\r\n if (triangles.length > 0) {\r\n const count = triangles.length - 1;\r\n const size = (count - 1) * 6;\r\n const lines = IndexDatatype.createTypedArray(count, size);\r\n\r\n const base = triangles[0];\r\n let index = 0;\r\n for (let i = 1; i < count; ++i, index += 6) {\r\n addTriangle(lines, index, base, triangles[i], triangles[i + 1]);\r\n }\r\n\r\n return lines;\r\n }\r\n\r\n return new Uint16Array();\r\n}\r\n\r\n/**\r\n * Converts a geometry's triangle indices to line indices. If the geometry has an indices
\r\n * and its primitiveType
is TRIANGLES
, TRIANGLE_STRIP
,\r\n * TRIANGLE_FAN
, it is converted to LINES
; otherwise, the geometry is not changed.\r\n * \r\n * This is commonly used to create a wireframe geometry for visual debugging.\r\n *
\r\n *\r\n * @param {Geometry} geometry The geometry to modify.\r\n * @returns {Geometry} The modifiedgeometry
argument, with its triangle indices converted to lines.\r\n *\r\n * @exception {DeveloperError} geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.\r\n *\r\n * @example\r\n * geometry = Cesium.GeometryPipeline.toWireframe(geometry);\r\n */\r\nGeometryPipeline.toWireframe = function (geometry) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(geometry)) {\r\n throw new DeveloperError(\"geometry is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const indices = geometry.indices;\r\n if (defined(indices)) {\r\n switch (geometry.primitiveType) {\r\n case PrimitiveType.TRIANGLES:\r\n geometry.indices = trianglesToLines(indices);\r\n break;\r\n case PrimitiveType.TRIANGLE_STRIP:\r\n geometry.indices = triangleStripToLines(indices);\r\n break;\r\n case PrimitiveType.TRIANGLE_FAN:\r\n geometry.indices = triangleFanToLines(indices);\r\n break;\r\n //>>includeStart('debug', pragmas.debug);\r\n default:\r\n throw new DeveloperError(\r\n \"geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.\"\r\n );\r\n //>>includeEnd('debug');\r\n }\r\n\r\n geometry.primitiveType = PrimitiveType.LINES;\r\n }\r\n\r\n return geometry;\r\n};\r\n\r\n/**\r\n * Creates a new {@link Geometry} with LINES
representing the provided\r\n * attribute (attributeName
) for the provided geometry. This is used to\r\n * visualize vector attributes like normals, tangents, and bitangents.\r\n *\r\n * @param {Geometry} geometry The Geometry
instance with the attribute.\r\n * @param {String} [attributeName='normal'] The name of the attribute.\r\n * @param {Number} [length=10000.0] The length of each line segment in meters. This can be negative to point the vector in the opposite direction.\r\n * @returns {Geometry} A new Geometry
instance with line segments for the vector.\r\n *\r\n * @exception {DeveloperError} geometry.attributes must have an attribute with the same name as the attributeName parameter.\r\n *\r\n * @example\r\n * const geometry = Cesium.GeometryPipeline.createLineSegmentsForVectors(instance.geometry, 'bitangent', 100000.0);\r\n */\r\nGeometryPipeline.createLineSegmentsForVectors = function (\r\n geometry,\r\n attributeName,\r\n length\r\n) {\r\n attributeName = defaultValue(attributeName, \"normal\");\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(geometry)) {\r\n throw new DeveloperError(\"geometry is required.\");\r\n }\r\n if (!defined(geometry.attributes.position)) {\r\n throw new DeveloperError(\"geometry.attributes.position is required.\");\r\n }\r\n if (!defined(geometry.attributes[attributeName])) {\r\n throw new DeveloperError(\r\n `geometry.attributes must have an attribute with the same name as the attributeName parameter, ${attributeName}.`\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n length = defaultValue(length, 10000.0);\r\n\r\n const positions = geometry.attributes.position.values;\r\n const vectors = geometry.attributes[attributeName].values;\r\n const positionsLength = positions.length;\r\n\r\n const newPositions = new Float64Array(2 * positionsLength);\r\n\r\n let j = 0;\r\n for (let i = 0; i < positionsLength; i += 3) {\r\n newPositions[j++] = positions[i];\r\n newPositions[j++] = positions[i + 1];\r\n newPositions[j++] = positions[i + 2];\r\n\r\n newPositions[j++] = positions[i] + vectors[i] * length;\r\n newPositions[j++] = positions[i + 1] + vectors[i + 1] * length;\r\n newPositions[j++] = positions[i + 2] + vectors[i + 2] * length;\r\n }\r\n\r\n let newBoundingSphere;\r\n const bs = geometry.boundingSphere;\r\n if (defined(bs)) {\r\n newBoundingSphere = new BoundingSphere(bs.center, bs.radius + length);\r\n }\r\n\r\n return new Geometry({\r\n attributes: {\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: newPositions,\r\n }),\r\n },\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: newBoundingSphere,\r\n });\r\n};\r\n\r\n/**\r\n * Creates an object that maps attribute names to unique locations (indices)\r\n * for matching vertex attributes and shader programs.\r\n *\r\n * @param {Geometry} geometry The geometry, which is not modified, to create the object for.\r\n * @returns {Object} An object with attribute name / index pairs.\r\n *\r\n * @example\r\n * const attributeLocations = Cesium.GeometryPipeline.createAttributeLocations(geometry);\r\n * // Example output\r\n * // {\r\n * // 'position' : 0,\r\n * // 'normal' : 1\r\n * // }\r\n */\r\nGeometryPipeline.createAttributeLocations = function (geometry) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(geometry)) {\r\n throw new DeveloperError(\"geometry is required.\");\r\n }\r\n //>>includeEnd('debug')\r\n\r\n // There can be a WebGL performance hit when attribute 0 is disabled, so\r\n // assign attribute locations to well-known attributes.\r\n const semantics = [\r\n \"position\",\r\n \"positionHigh\",\r\n \"positionLow\",\r\n\r\n // From VertexFormat.position - after 2D projection and high-precision encoding\r\n \"position3DHigh\",\r\n \"position3DLow\",\r\n \"position2DHigh\",\r\n \"position2DLow\",\r\n\r\n // From Primitive\r\n \"pickColor\",\r\n\r\n // From VertexFormat\r\n \"normal\",\r\n \"st\",\r\n \"tangent\",\r\n \"bitangent\",\r\n\r\n // For shadow volumes\r\n \"extrudeDirection\",\r\n\r\n // From compressing texture coordinates and normals\r\n \"compressedAttributes\",\r\n ];\r\n\r\n const attributes = geometry.attributes;\r\n const indices = {};\r\n let j = 0;\r\n let i;\r\n const len = semantics.length;\r\n\r\n // Attribute locations for well-known attributes\r\n for (i = 0; i < len; ++i) {\r\n const semantic = semantics[i];\r\n\r\n if (defined(attributes[semantic])) {\r\n indices[semantic] = j++;\r\n }\r\n }\r\n\r\n // Locations for custom attributes\r\n for (const name in attributes) {\r\n if (attributes.hasOwnProperty(name) && !defined(indices[name])) {\r\n indices[name] = j++;\r\n }\r\n }\r\n\r\n return indices;\r\n};\r\n\r\n/**\r\n * Reorders a geometry's attributes and indices
to achieve better performance from the GPU's pre-vertex-shader cache.\r\n *\r\n * @param {Geometry} geometry The geometry to modify.\r\n * @returns {Geometry} The modified geometry
argument, with its attributes and indices reordered for the GPU's pre-vertex-shader cache.\r\n *\r\n * @exception {DeveloperError} Each attribute array in geometry.attributes must have the same number of attributes.\r\n *\r\n *\r\n * @example\r\n * geometry = Cesium.GeometryPipeline.reorderForPreVertexCache(geometry);\r\n *\r\n * @see GeometryPipeline.reorderForPostVertexCache\r\n */\r\nGeometryPipeline.reorderForPreVertexCache = function (geometry) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(geometry)) {\r\n throw new DeveloperError(\"geometry is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const numVertices = Geometry.computeNumberOfVertices(geometry);\r\n\r\n const indices = geometry.indices;\r\n if (defined(indices)) {\r\n const indexCrossReferenceOldToNew = new Int32Array(numVertices);\r\n for (let i = 0; i < numVertices; i++) {\r\n indexCrossReferenceOldToNew[i] = -1;\r\n }\r\n\r\n // Construct cross reference and reorder indices\r\n const indicesIn = indices;\r\n const numIndices = indicesIn.length;\r\n const indicesOut = IndexDatatype.createTypedArray(numVertices, numIndices);\r\n\r\n let intoIndicesIn = 0;\r\n let intoIndicesOut = 0;\r\n let nextIndex = 0;\r\n let tempIndex;\r\n while (intoIndicesIn < numIndices) {\r\n tempIndex = indexCrossReferenceOldToNew[indicesIn[intoIndicesIn]];\r\n if (tempIndex !== -1) {\r\n indicesOut[intoIndicesOut] = tempIndex;\r\n } else {\r\n tempIndex = indicesIn[intoIndicesIn];\r\n indexCrossReferenceOldToNew[tempIndex] = nextIndex;\r\n\r\n indicesOut[intoIndicesOut] = nextIndex;\r\n ++nextIndex;\r\n }\r\n ++intoIndicesIn;\r\n ++intoIndicesOut;\r\n }\r\n geometry.indices = indicesOut;\r\n\r\n // Reorder attributes\r\n const attributes = geometry.attributes;\r\n for (const property in attributes) {\r\n if (\r\n attributes.hasOwnProperty(property) &&\r\n defined(attributes[property]) &&\r\n defined(attributes[property].values)\r\n ) {\r\n const attribute = attributes[property];\r\n const elementsIn = attribute.values;\r\n let intoElementsIn = 0;\r\n const numComponents = attribute.componentsPerAttribute;\r\n const elementsOut = ComponentDatatype.createTypedArray(\r\n attribute.componentDatatype,\r\n nextIndex * numComponents\r\n );\r\n while (intoElementsIn < numVertices) {\r\n const temp = indexCrossReferenceOldToNew[intoElementsIn];\r\n if (temp !== -1) {\r\n for (let j = 0; j < numComponents; j++) {\r\n elementsOut[numComponents * temp + j] =\r\n elementsIn[numComponents * intoElementsIn + j];\r\n }\r\n }\r\n ++intoElementsIn;\r\n }\r\n attribute.values = elementsOut;\r\n }\r\n }\r\n }\r\n\r\n return geometry;\r\n};\r\n\r\n/**\r\n * Reorders a geometry's indices
to achieve better performance from the GPU's\r\n * post vertex-shader cache by using the Tipsify algorithm. If the geometry primitiveType
\r\n * is not TRIANGLES
or the geometry does not have an indices
, this function has no effect.\r\n *\r\n * @param {Geometry} geometry The geometry to modify.\r\n * @param {Number} [cacheCapacity=24] The number of vertices that can be held in the GPU's vertex cache.\r\n * @returns {Geometry} The modified geometry
argument, with its indices reordered for the post-vertex-shader cache.\r\n *\r\n * @exception {DeveloperError} cacheCapacity must be greater than two.\r\n *\r\n *\r\n * @example\r\n * geometry = Cesium.GeometryPipeline.reorderForPostVertexCache(geometry);\r\n *\r\n * @see GeometryPipeline.reorderForPreVertexCache\r\n * @see {@link http://gfx.cs.princ0eton.edu/pubs/Sander_2007_%3ETR/tipsy.pdf|Fast Triangle Reordering for Vertex Locality and Reduced Overdraw}\r\n * by Sander, Nehab, and Barczak\r\n */\r\nGeometryPipeline.reorderForPostVertexCache = function (\r\n geometry,\r\n cacheCapacity\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(geometry)) {\r\n throw new DeveloperError(\"geometry is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const indices = geometry.indices;\r\n if (geometry.primitiveType === PrimitiveType.TRIANGLES && defined(indices)) {\r\n const numIndices = indices.length;\r\n let maximumIndex = 0;\r\n for (let j = 0; j < numIndices; j++) {\r\n if (indices[j] > maximumIndex) {\r\n maximumIndex = indices[j];\r\n }\r\n }\r\n geometry.indices = Tipsify.tipsify({\r\n indices: indices,\r\n maximumIndex: maximumIndex,\r\n cacheSize: cacheCapacity,\r\n });\r\n }\r\n\r\n return geometry;\r\n};\r\n\r\nfunction copyAttributesDescriptions(attributes) {\r\n const newAttributes = {};\r\n\r\n for (const attribute in attributes) {\r\n if (\r\n attributes.hasOwnProperty(attribute) &&\r\n defined(attributes[attribute]) &&\r\n defined(attributes[attribute].values)\r\n ) {\r\n const attr = attributes[attribute];\r\n newAttributes[attribute] = new GeometryAttribute({\r\n componentDatatype: attr.componentDatatype,\r\n componentsPerAttribute: attr.componentsPerAttribute,\r\n normalize: attr.normalize,\r\n values: [],\r\n });\r\n }\r\n }\r\n\r\n return newAttributes;\r\n}\r\n\r\nfunction copyVertex(destinationAttributes, sourceAttributes, index) {\r\n for (const attribute in sourceAttributes) {\r\n if (\r\n sourceAttributes.hasOwnProperty(attribute) &&\r\n defined(sourceAttributes[attribute]) &&\r\n defined(sourceAttributes[attribute].values)\r\n ) {\r\n const attr = sourceAttributes[attribute];\r\n\r\n for (let k = 0; k < attr.componentsPerAttribute; ++k) {\r\n destinationAttributes[attribute].values.push(\r\n attr.values[index * attr.componentsPerAttribute + k]\r\n );\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Splits a geometry into multiple geometries, if necessary, to ensure that indices in the\r\n * indices
fit into unsigned shorts. This is used to meet the WebGL requirements\r\n * when unsigned int indices are not supported.\r\n * \r\n * If the geometry does not have any indices
, this function has no effect.\r\n *
position
attribute to 2D, replacing the position
\r\n * attribute with separate position3D
and position2D
attributes.\r\n * \r\n * If the geometry does not have a position
, this function has no effect.\r\n *
geometry
argument with position3D
and position2D
attributes.\r\n *\r\n * @exception {DeveloperError} geometry must have attribute matching the attributeName argument.\r\n * @exception {DeveloperError} The attribute componentDatatype must be ComponentDatatype.DOUBLE.\r\n * @exception {DeveloperError} Could not project a point to 2D.\r\n *\r\n * @example\r\n * geometry = Cesium.GeometryPipeline.projectTo2D(geometry, 'position', 'position3D', 'position2D');\r\n */\r\nGeometryPipeline.projectTo2D = function (\r\n geometry,\r\n attributeName,\r\n attributeName3D,\r\n attributeName2D,\r\n projection\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(geometry)) {\r\n throw new DeveloperError(\"geometry is required.\");\r\n }\r\n if (!defined(attributeName)) {\r\n throw new DeveloperError(\"attributeName is required.\");\r\n }\r\n if (!defined(attributeName3D)) {\r\n throw new DeveloperError(\"attributeName3D is required.\");\r\n }\r\n if (!defined(attributeName2D)) {\r\n throw new DeveloperError(\"attributeName2D is required.\");\r\n }\r\n if (!defined(geometry.attributes[attributeName])) {\r\n throw new DeveloperError(\r\n `geometry must have attribute matching the attributeName argument: ${attributeName}.`\r\n );\r\n }\r\n if (\r\n geometry.attributes[attributeName].componentDatatype !==\r\n ComponentDatatype.DOUBLE\r\n ) {\r\n throw new DeveloperError(\r\n \"The attribute componentDatatype must be ComponentDatatype.DOUBLE.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const attribute = geometry.attributes[attributeName];\r\n projection = defined(projection) ? projection : new GeographicProjection();\r\n const ellipsoid = projection.ellipsoid;\r\n\r\n // Project original values to 2D.\r\n const values3D = attribute.values;\r\n const projectedValues = new Float64Array(values3D.length);\r\n let index = 0;\r\n\r\n for (let i = 0; i < values3D.length; i += 3) {\r\n const value = Cartesian3.fromArray(\r\n values3D,\r\n i,\r\n scratchProjectTo2DCartesian3\r\n );\r\n\r\n const lonLat = ellipsoid.cartesianToCartographic(\r\n value,\r\n scratchProjectTo2DCartographic\r\n );\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(lonLat)) {\r\n throw new DeveloperError(\r\n `Could not project point (${value.x}, ${value.y}, ${value.z}) to 2D.`\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const projectedLonLat = projection.project(\r\n lonLat,\r\n scratchProjectTo2DCartesian3\r\n );\r\n\r\n projectedValues[index++] = projectedLonLat.x;\r\n projectedValues[index++] = projectedLonLat.y;\r\n projectedValues[index++] = projectedLonLat.z;\r\n }\r\n\r\n // Rename original cartesians to WGS84 cartesians.\r\n geometry.attributes[attributeName3D] = attribute;\r\n\r\n // Replace original cartesians with 2D projected cartesians\r\n geometry.attributes[attributeName2D] = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: projectedValues,\r\n });\r\n delete geometry.attributes[attributeName];\r\n\r\n return geometry;\r\n};\r\n\r\nconst encodedResult = {\r\n high: 0.0,\r\n low: 0.0,\r\n};\r\n\r\n/**\r\n * Encodes floating-point geometry attribute values as two separate attributes to improve\r\n * rendering precision.\r\n * \r\n * This is commonly used to create high-precision position vertex attributes.\r\n *
\r\n *\r\n * @param {Geometry} geometry The geometry to modify.\r\n * @param {String} attributeName The name of the attribute.\r\n * @param {String} attributeHighName The name of the attribute for the encoded high bits.\r\n * @param {String} attributeLowName The name of the attribute for the encoded low bits.\r\n * @returns {Geometry} The modifiedgeometry
argument, with its encoded attribute.\r\n *\r\n * @exception {DeveloperError} geometry must have attribute matching the attributeName argument.\r\n * @exception {DeveloperError} The attribute componentDatatype must be ComponentDatatype.DOUBLE.\r\n *\r\n * @example\r\n * geometry = Cesium.GeometryPipeline.encodeAttribute(geometry, 'position3D', 'position3DHigh', 'position3DLow');\r\n */\r\nGeometryPipeline.encodeAttribute = function (\r\n geometry,\r\n attributeName,\r\n attributeHighName,\r\n attributeLowName\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(geometry)) {\r\n throw new DeveloperError(\"geometry is required.\");\r\n }\r\n if (!defined(attributeName)) {\r\n throw new DeveloperError(\"attributeName is required.\");\r\n }\r\n if (!defined(attributeHighName)) {\r\n throw new DeveloperError(\"attributeHighName is required.\");\r\n }\r\n if (!defined(attributeLowName)) {\r\n throw new DeveloperError(\"attributeLowName is required.\");\r\n }\r\n if (!defined(geometry.attributes[attributeName])) {\r\n throw new DeveloperError(\r\n `geometry must have attribute matching the attributeName argument: ${attributeName}.`\r\n );\r\n }\r\n if (\r\n geometry.attributes[attributeName].componentDatatype !==\r\n ComponentDatatype.DOUBLE\r\n ) {\r\n throw new DeveloperError(\r\n \"The attribute componentDatatype must be ComponentDatatype.DOUBLE.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const attribute = geometry.attributes[attributeName];\r\n const values = attribute.values;\r\n const length = values.length;\r\n const highValues = new Float32Array(length);\r\n const lowValues = new Float32Array(length);\r\n\r\n for (let i = 0; i < length; ++i) {\r\n EncodedCartesian3.encode(values[i], encodedResult);\r\n highValues[i] = encodedResult.high;\r\n lowValues[i] = encodedResult.low;\r\n }\r\n\r\n const componentsPerAttribute = attribute.componentsPerAttribute;\r\n\r\n geometry.attributes[attributeHighName] = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: componentsPerAttribute,\r\n values: highValues,\r\n });\r\n geometry.attributes[attributeLowName] = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: componentsPerAttribute,\r\n values: lowValues,\r\n });\r\n delete geometry.attributes[attributeName];\r\n\r\n return geometry;\r\n};\r\n\r\nlet scratchCartesian3 = new Cartesian3();\r\n\r\nfunction transformPoint(matrix, attribute) {\r\n if (defined(attribute)) {\r\n const values = attribute.values;\r\n const length = values.length;\r\n for (let i = 0; i < length; i += 3) {\r\n Cartesian3.unpack(values, i, scratchCartesian3);\r\n Matrix4.multiplyByPoint(matrix, scratchCartesian3, scratchCartesian3);\r\n Cartesian3.pack(scratchCartesian3, values, i);\r\n }\r\n }\r\n}\r\n\r\nfunction transformVector(matrix, attribute) {\r\n if (defined(attribute)) {\r\n const values = attribute.values;\r\n const length = values.length;\r\n for (let i = 0; i < length; i += 3) {\r\n Cartesian3.unpack(values, i, scratchCartesian3);\r\n Matrix3.multiplyByVector(matrix, scratchCartesian3, scratchCartesian3);\r\n scratchCartesian3 = Cartesian3.normalize(\r\n scratchCartesian3,\r\n scratchCartesian3\r\n );\r\n Cartesian3.pack(scratchCartesian3, values, i);\r\n }\r\n }\r\n}\r\n\r\nconst inverseTranspose = new Matrix4();\r\nconst normalMatrix = new Matrix3();\r\n\r\n/**\r\n * Transforms a geometry instance to world coordinates. This changes\r\n * the instance's modelMatrix
to {@link Matrix4.IDENTITY} and transforms the\r\n * following attributes if they are present: position
, normal
,\r\n * tangent
, and bitangent
.\r\n *\r\n * @param {GeometryInstance} instance The geometry instance to modify.\r\n * @returns {GeometryInstance} The modified instance
argument, with its attributes transforms to world coordinates.\r\n *\r\n * @example\r\n * Cesium.GeometryPipeline.transformToWorldCoordinates(instance);\r\n */\r\nGeometryPipeline.transformToWorldCoordinates = function (instance) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(instance)) {\r\n throw new DeveloperError(\"instance is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const modelMatrix = instance.modelMatrix;\r\n\r\n if (Matrix4.equals(modelMatrix, Matrix4.IDENTITY)) {\r\n // Already in world coordinates\r\n return instance;\r\n }\r\n\r\n const attributes = instance.geometry.attributes;\r\n\r\n // Transform attributes in known vertex formats\r\n transformPoint(modelMatrix, attributes.position);\r\n transformPoint(modelMatrix, attributes.prevPosition);\r\n transformPoint(modelMatrix, attributes.nextPosition);\r\n\r\n if (\r\n defined(attributes.normal) ||\r\n defined(attributes.tangent) ||\r\n defined(attributes.bitangent)\r\n ) {\r\n Matrix4.inverse(modelMatrix, inverseTranspose);\r\n Matrix4.transpose(inverseTranspose, inverseTranspose);\r\n Matrix4.getMatrix3(inverseTranspose, normalMatrix);\r\n\r\n transformVector(normalMatrix, attributes.normal);\r\n transformVector(normalMatrix, attributes.tangent);\r\n transformVector(normalMatrix, attributes.bitangent);\r\n }\r\n\r\n const boundingSphere = instance.geometry.boundingSphere;\r\n if (defined(boundingSphere)) {\r\n instance.geometry.boundingSphere = BoundingSphere.transform(\r\n boundingSphere,\r\n modelMatrix,\r\n boundingSphere\r\n );\r\n }\r\n\r\n instance.modelMatrix = Matrix4.clone(Matrix4.IDENTITY);\r\n\r\n return instance;\r\n};\r\n\r\nfunction findAttributesInAllGeometries(instances, propertyName) {\r\n const length = instances.length;\r\n\r\n const attributesInAllGeometries = {};\r\n\r\n const attributes0 = instances[0][propertyName].attributes;\r\n let name;\r\n\r\n for (name in attributes0) {\r\n if (\r\n attributes0.hasOwnProperty(name) &&\r\n defined(attributes0[name]) &&\r\n defined(attributes0[name].values)\r\n ) {\r\n const attribute = attributes0[name];\r\n let numberOfComponents = attribute.values.length;\r\n let inAllGeometries = true;\r\n\r\n // Does this same attribute exist in all geometries?\r\n for (let i = 1; i < length; ++i) {\r\n const otherAttribute = instances[i][propertyName].attributes[name];\r\n\r\n if (\r\n !defined(otherAttribute) ||\r\n attribute.componentDatatype !== otherAttribute.componentDatatype ||\r\n attribute.componentsPerAttribute !==\r\n otherAttribute.componentsPerAttribute ||\r\n attribute.normalize !== otherAttribute.normalize\r\n ) {\r\n inAllGeometries = false;\r\n break;\r\n }\r\n\r\n numberOfComponents += otherAttribute.values.length;\r\n }\r\n\r\n if (inAllGeometries) {\r\n attributesInAllGeometries[name] = new GeometryAttribute({\r\n componentDatatype: attribute.componentDatatype,\r\n componentsPerAttribute: attribute.componentsPerAttribute,\r\n normalize: attribute.normalize,\r\n values: ComponentDatatype.createTypedArray(\r\n attribute.componentDatatype,\r\n numberOfComponents\r\n ),\r\n });\r\n }\r\n }\r\n }\r\n\r\n return attributesInAllGeometries;\r\n}\r\n\r\nconst tempScratch = new Cartesian3();\r\n\r\nfunction combineGeometries(instances, propertyName) {\r\n const length = instances.length;\r\n\r\n let name;\r\n let i;\r\n let j;\r\n let k;\r\n\r\n const m = instances[0].modelMatrix;\r\n const haveIndices = defined(instances[0][propertyName].indices);\r\n const primitiveType = instances[0][propertyName].primitiveType;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n for (i = 1; i < length; ++i) {\r\n if (!Matrix4.equals(instances[i].modelMatrix, m)) {\r\n throw new DeveloperError(\"All instances must have the same modelMatrix.\");\r\n }\r\n if (defined(instances[i][propertyName].indices) !== haveIndices) {\r\n throw new DeveloperError(\r\n \"All instance geometries must have an indices or not have one.\"\r\n );\r\n }\r\n if (instances[i][propertyName].primitiveType !== primitiveType) {\r\n throw new DeveloperError(\r\n \"All instance geometries must have the same primitiveType.\"\r\n );\r\n }\r\n }\r\n //>>includeEnd('debug');\r\n\r\n // Find subset of attributes in all geometries\r\n const attributes = findAttributesInAllGeometries(instances, propertyName);\r\n let values;\r\n let sourceValues;\r\n let sourceValuesLength;\r\n\r\n // Combine attributes from each geometry into a single typed array\r\n for (name in attributes) {\r\n if (attributes.hasOwnProperty(name)) {\r\n values = attributes[name].values;\r\n\r\n k = 0;\r\n for (i = 0; i < length; ++i) {\r\n sourceValues = instances[i][propertyName].attributes[name].values;\r\n sourceValuesLength = sourceValues.length;\r\n\r\n for (j = 0; j < sourceValuesLength; ++j) {\r\n values[k++] = sourceValues[j];\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Combine index lists\r\n let indices;\r\n\r\n if (haveIndices) {\r\n let numberOfIndices = 0;\r\n for (i = 0; i < length; ++i) {\r\n numberOfIndices += instances[i][propertyName].indices.length;\r\n }\r\n\r\n const numberOfVertices = Geometry.computeNumberOfVertices(\r\n new Geometry({\r\n attributes: attributes,\r\n primitiveType: PrimitiveType.POINTS,\r\n })\r\n );\r\n const destIndices = IndexDatatype.createTypedArray(\r\n numberOfVertices,\r\n numberOfIndices\r\n );\r\n\r\n let destOffset = 0;\r\n let offset = 0;\r\n\r\n for (i = 0; i < length; ++i) {\r\n const sourceIndices = instances[i][propertyName].indices;\r\n const sourceIndicesLen = sourceIndices.length;\r\n\r\n for (k = 0; k < sourceIndicesLen; ++k) {\r\n destIndices[destOffset++] = offset + sourceIndices[k];\r\n }\r\n\r\n offset += Geometry.computeNumberOfVertices(instances[i][propertyName]);\r\n }\r\n\r\n indices = destIndices;\r\n }\r\n\r\n // Create bounding sphere that includes all instances\r\n let center = new Cartesian3();\r\n let radius = 0.0;\r\n let bs;\r\n\r\n for (i = 0; i < length; ++i) {\r\n bs = instances[i][propertyName].boundingSphere;\r\n if (!defined(bs)) {\r\n // If any geometries have an undefined bounding sphere, then so does the combined geometry\r\n center = undefined;\r\n break;\r\n }\r\n\r\n Cartesian3.add(bs.center, center, center);\r\n }\r\n\r\n if (defined(center)) {\r\n Cartesian3.divideByScalar(center, length, center);\r\n\r\n for (i = 0; i < length; ++i) {\r\n bs = instances[i][propertyName].boundingSphere;\r\n const tempRadius =\r\n Cartesian3.magnitude(\r\n Cartesian3.subtract(bs.center, center, tempScratch)\r\n ) + bs.radius;\r\n\r\n if (tempRadius > radius) {\r\n radius = tempRadius;\r\n }\r\n }\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: primitiveType,\r\n boundingSphere: defined(center)\r\n ? new BoundingSphere(center, radius)\r\n : undefined,\r\n });\r\n}\r\n\r\n/**\r\n * Combines geometry from several {@link GeometryInstance} objects into one geometry.\r\n * This concatenates the attributes, concatenates and adjusts the indices, and creates\r\n * a bounding sphere encompassing all instances.\r\n * \r\n * If the instances do not have the same attributes, a subset of attributes common\r\n * to all instances is used, and the others are ignored.\r\n *
\r\n *\r\n * This is used by {@link Primitive} to efficiently render a large amount of static data.\r\n *
\r\n *\r\n * @private\r\n *\r\n * @param {GeometryInstance[]} [instances] The array of {@link GeometryInstance} objects whose geometry will be combined.\r\n * @returns {Geometry} A single geometry created from the provided geometry instances.\r\n *\r\n * @exception {DeveloperError} All instances must have the same modelMatrix.\r\n * @exception {DeveloperError} All instance geometries must have an indices or not have one.\r\n * @exception {DeveloperError} All instance geometries must have the same primitiveType.\r\n *\r\n *\r\n * @example\r\n * for (let i = 0; i < instances.length; ++i) {\r\n * Cesium.GeometryPipeline.transformToWorldCoordinates(instances[i]);\r\n * }\r\n * const geometries = Cesium.GeometryPipeline.combineInstances(instances);\r\n *\r\n * @see GeometryPipeline.transformToWorldCoordinates\r\n */\r\nGeometryPipeline.combineInstances = function (instances) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(instances) || instances.length < 1) {\r\n throw new DeveloperError(\r\n \"instances is required and must have length greater than zero.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const instanceGeometry = [];\r\n const instanceSplitGeometry = [];\r\n const length = instances.length;\r\n for (let i = 0; i < length; ++i) {\r\n const instance = instances[i];\r\n\r\n if (defined(instance.geometry)) {\r\n instanceGeometry.push(instance);\r\n } else if (\r\n defined(instance.westHemisphereGeometry) &&\r\n defined(instance.eastHemisphereGeometry)\r\n ) {\r\n instanceSplitGeometry.push(instance);\r\n }\r\n }\r\n\r\n const geometries = [];\r\n if (instanceGeometry.length > 0) {\r\n geometries.push(combineGeometries(instanceGeometry, \"geometry\"));\r\n }\r\n\r\n if (instanceSplitGeometry.length > 0) {\r\n geometries.push(\r\n combineGeometries(instanceSplitGeometry, \"westHemisphereGeometry\")\r\n );\r\n geometries.push(\r\n combineGeometries(instanceSplitGeometry, \"eastHemisphereGeometry\")\r\n );\r\n }\r\n\r\n return geometries;\r\n};\r\n\r\nconst normal = new Cartesian3();\r\nconst v0 = new Cartesian3();\r\nconst v1 = new Cartesian3();\r\nconst v2 = new Cartesian3();\r\n\r\n/**\r\n * Computes per-vertex normals for a geometry containingTRIANGLES
by averaging the normals of\r\n * all triangles incident to the vertex. The result is a new normal
attribute added to the geometry.\r\n * This assumes a counter-clockwise winding order.\r\n *\r\n * @param {Geometry} geometry The geometry to modify.\r\n * @returns {Geometry} The modified geometry
argument with the computed normal
attribute.\r\n *\r\n * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3.\r\n * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}.\r\n *\r\n * @example\r\n * Cesium.GeometryPipeline.computeNormal(geometry);\r\n */\r\nGeometryPipeline.computeNormal = function (geometry) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(geometry)) {\r\n throw new DeveloperError(\"geometry is required.\");\r\n }\r\n if (\r\n !defined(geometry.attributes.position) ||\r\n !defined(geometry.attributes.position.values)\r\n ) {\r\n throw new DeveloperError(\r\n \"geometry.attributes.position.values is required.\"\r\n );\r\n }\r\n if (!defined(geometry.indices)) {\r\n throw new DeveloperError(\"geometry.indices is required.\");\r\n }\r\n if (geometry.indices.length < 2 || geometry.indices.length % 3 !== 0) {\r\n throw new DeveloperError(\r\n \"geometry.indices length must be greater than 0 and be a multiple of 3.\"\r\n );\r\n }\r\n if (geometry.primitiveType !== PrimitiveType.TRIANGLES) {\r\n throw new DeveloperError(\r\n \"geometry.primitiveType must be PrimitiveType.TRIANGLES.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const indices = geometry.indices;\r\n const attributes = geometry.attributes;\r\n const vertices = attributes.position.values;\r\n const numVertices = attributes.position.values.length / 3;\r\n const numIndices = indices.length;\r\n const normalsPerVertex = new Array(numVertices);\r\n const normalsPerTriangle = new Array(numIndices / 3);\r\n const normalIndices = new Array(numIndices);\r\n let i;\r\n for (i = 0; i < numVertices; i++) {\r\n normalsPerVertex[i] = {\r\n indexOffset: 0,\r\n count: 0,\r\n currentCount: 0,\r\n };\r\n }\r\n\r\n let j = 0;\r\n for (i = 0; i < numIndices; i += 3) {\r\n const i0 = indices[i];\r\n const i1 = indices[i + 1];\r\n const i2 = indices[i + 2];\r\n const i03 = i0 * 3;\r\n const i13 = i1 * 3;\r\n const i23 = i2 * 3;\r\n\r\n v0.x = vertices[i03];\r\n v0.y = vertices[i03 + 1];\r\n v0.z = vertices[i03 + 2];\r\n v1.x = vertices[i13];\r\n v1.y = vertices[i13 + 1];\r\n v1.z = vertices[i13 + 2];\r\n v2.x = vertices[i23];\r\n v2.y = vertices[i23 + 1];\r\n v2.z = vertices[i23 + 2];\r\n\r\n normalsPerVertex[i0].count++;\r\n normalsPerVertex[i1].count++;\r\n normalsPerVertex[i2].count++;\r\n\r\n Cartesian3.subtract(v1, v0, v1);\r\n Cartesian3.subtract(v2, v0, v2);\r\n normalsPerTriangle[j] = Cartesian3.cross(v1, v2, new Cartesian3());\r\n j++;\r\n }\r\n\r\n let indexOffset = 0;\r\n for (i = 0; i < numVertices; i++) {\r\n normalsPerVertex[i].indexOffset += indexOffset;\r\n indexOffset += normalsPerVertex[i].count;\r\n }\r\n\r\n j = 0;\r\n let vertexNormalData;\r\n for (i = 0; i < numIndices; i += 3) {\r\n vertexNormalData = normalsPerVertex[indices[i]];\r\n let index = vertexNormalData.indexOffset + vertexNormalData.currentCount;\r\n normalIndices[index] = j;\r\n vertexNormalData.currentCount++;\r\n\r\n vertexNormalData = normalsPerVertex[indices[i + 1]];\r\n index = vertexNormalData.indexOffset + vertexNormalData.currentCount;\r\n normalIndices[index] = j;\r\n vertexNormalData.currentCount++;\r\n\r\n vertexNormalData = normalsPerVertex[indices[i + 2]];\r\n index = vertexNormalData.indexOffset + vertexNormalData.currentCount;\r\n normalIndices[index] = j;\r\n vertexNormalData.currentCount++;\r\n\r\n j++;\r\n }\r\n\r\n const normalValues = new Float32Array(numVertices * 3);\r\n for (i = 0; i < numVertices; i++) {\r\n const i3 = i * 3;\r\n vertexNormalData = normalsPerVertex[i];\r\n Cartesian3.clone(Cartesian3.ZERO, normal);\r\n if (vertexNormalData.count > 0) {\r\n for (j = 0; j < vertexNormalData.count; j++) {\r\n Cartesian3.add(\r\n normal,\r\n normalsPerTriangle[normalIndices[vertexNormalData.indexOffset + j]],\r\n normal\r\n );\r\n }\r\n\r\n // We can run into an issue where a vertex is used with 2 primitives that have opposite winding order.\r\n if (\r\n Cartesian3.equalsEpsilon(Cartesian3.ZERO, normal, CesiumMath.EPSILON10)\r\n ) {\r\n Cartesian3.clone(\r\n normalsPerTriangle[normalIndices[vertexNormalData.indexOffset]],\r\n normal\r\n );\r\n }\r\n }\r\n\r\n // We end up with a zero vector probably because of a degenerate triangle\r\n if (\r\n Cartesian3.equalsEpsilon(Cartesian3.ZERO, normal, CesiumMath.EPSILON10)\r\n ) {\r\n // Default to (0,0,1)\r\n normal.z = 1.0;\r\n }\r\n\r\n Cartesian3.normalize(normal, normal);\r\n normalValues[i3] = normal.x;\r\n normalValues[i3 + 1] = normal.y;\r\n normalValues[i3 + 2] = normal.z;\r\n }\r\n\r\n geometry.attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normalValues,\r\n });\r\n\r\n return geometry;\r\n};\r\n\r\nconst normalScratch = new Cartesian3();\r\nconst normalScale = new Cartesian3();\r\nconst tScratch = new Cartesian3();\r\n\r\n/**\r\n * Computes per-vertex tangents and bitangents for a geometry containing TRIANGLES
.\r\n * The result is new tangent
and bitangent
attributes added to the geometry.\r\n * This assumes a counter-clockwise winding order.\r\n * \r\n * Based on Computing Tangent Space Basis Vectors\r\n * for an Arbitrary Mesh by Eric Lengyel.\r\n *
\r\n *\r\n * @param {Geometry} geometry The geometry to modify.\r\n * @returns {Geometry} The modifiedgeometry
argument with the computed tangent
and bitangent
attributes.\r\n *\r\n * @exception {DeveloperError} geometry.indices length must be greater than 0 and be a multiple of 3.\r\n * @exception {DeveloperError} geometry.primitiveType must be {@link PrimitiveType.TRIANGLES}.\r\n *\r\n * @example\r\n * Cesium.GeometryPipeline.computeTangentAndBiTangent(geometry);\r\n */\r\nGeometryPipeline.computeTangentAndBitangent = function (geometry) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(geometry)) {\r\n throw new DeveloperError(\"geometry is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const attributes = geometry.attributes;\r\n const indices = geometry.indices;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(attributes.position) || !defined(attributes.position.values)) {\r\n throw new DeveloperError(\r\n \"geometry.attributes.position.values is required.\"\r\n );\r\n }\r\n if (!defined(attributes.normal) || !defined(attributes.normal.values)) {\r\n throw new DeveloperError(\"geometry.attributes.normal.values is required.\");\r\n }\r\n if (!defined(attributes.st) || !defined(attributes.st.values)) {\r\n throw new DeveloperError(\"geometry.attributes.st.values is required.\");\r\n }\r\n if (!defined(indices)) {\r\n throw new DeveloperError(\"geometry.indices is required.\");\r\n }\r\n if (indices.length < 2 || indices.length % 3 !== 0) {\r\n throw new DeveloperError(\r\n \"geometry.indices length must be greater than 0 and be a multiple of 3.\"\r\n );\r\n }\r\n if (geometry.primitiveType !== PrimitiveType.TRIANGLES) {\r\n throw new DeveloperError(\r\n \"geometry.primitiveType must be PrimitiveType.TRIANGLES.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const vertices = geometry.attributes.position.values;\r\n const normals = geometry.attributes.normal.values;\r\n const st = geometry.attributes.st.values;\r\n\r\n const numVertices = geometry.attributes.position.values.length / 3;\r\n const numIndices = indices.length;\r\n const tan1 = new Array(numVertices * 3);\r\n\r\n let i;\r\n for (i = 0; i < tan1.length; i++) {\r\n tan1[i] = 0;\r\n }\r\n\r\n let i03;\r\n let i13;\r\n let i23;\r\n for (i = 0; i < numIndices; i += 3) {\r\n const i0 = indices[i];\r\n const i1 = indices[i + 1];\r\n const i2 = indices[i + 2];\r\n i03 = i0 * 3;\r\n i13 = i1 * 3;\r\n i23 = i2 * 3;\r\n const i02 = i0 * 2;\r\n const i12 = i1 * 2;\r\n const i22 = i2 * 2;\r\n\r\n const ux = vertices[i03];\r\n const uy = vertices[i03 + 1];\r\n const uz = vertices[i03 + 2];\r\n\r\n const wx = st[i02];\r\n const wy = st[i02 + 1];\r\n const t1 = st[i12 + 1] - wy;\r\n const t2 = st[i22 + 1] - wy;\r\n\r\n const r = 1.0 / ((st[i12] - wx) * t2 - (st[i22] - wx) * t1);\r\n const sdirx = (t2 * (vertices[i13] - ux) - t1 * (vertices[i23] - ux)) * r;\r\n const sdiry =\r\n (t2 * (vertices[i13 + 1] - uy) - t1 * (vertices[i23 + 1] - uy)) * r;\r\n const sdirz =\r\n (t2 * (vertices[i13 + 2] - uz) - t1 * (vertices[i23 + 2] - uz)) * r;\r\n\r\n tan1[i03] += sdirx;\r\n tan1[i03 + 1] += sdiry;\r\n tan1[i03 + 2] += sdirz;\r\n\r\n tan1[i13] += sdirx;\r\n tan1[i13 + 1] += sdiry;\r\n tan1[i13 + 2] += sdirz;\r\n\r\n tan1[i23] += sdirx;\r\n tan1[i23 + 1] += sdiry;\r\n tan1[i23 + 2] += sdirz;\r\n }\r\n\r\n const tangentValues = new Float32Array(numVertices * 3);\r\n const bitangentValues = new Float32Array(numVertices * 3);\r\n\r\n for (i = 0; i < numVertices; i++) {\r\n i03 = i * 3;\r\n i13 = i03 + 1;\r\n i23 = i03 + 2;\r\n\r\n const n = Cartesian3.fromArray(normals, i03, normalScratch);\r\n const t = Cartesian3.fromArray(tan1, i03, tScratch);\r\n const scalar = Cartesian3.dot(n, t);\r\n Cartesian3.multiplyByScalar(n, scalar, normalScale);\r\n Cartesian3.normalize(Cartesian3.subtract(t, normalScale, t), t);\r\n\r\n tangentValues[i03] = t.x;\r\n tangentValues[i13] = t.y;\r\n tangentValues[i23] = t.z;\r\n\r\n Cartesian3.normalize(Cartesian3.cross(n, t, t), t);\r\n\r\n bitangentValues[i03] = t.x;\r\n bitangentValues[i13] = t.y;\r\n bitangentValues[i23] = t.z;\r\n }\r\n\r\n geometry.attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangentValues,\r\n });\r\n\r\n geometry.attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangentValues,\r\n });\r\n\r\n return geometry;\r\n};\r\n\r\nconst scratchCartesian2 = new Cartesian2();\r\nconst toEncode1 = new Cartesian3();\r\nconst toEncode2 = new Cartesian3();\r\nconst toEncode3 = new Cartesian3();\r\nlet encodeResult2 = new Cartesian2();\r\n/**\r\n * Compresses and packs geometry normal attribute values to save memory.\r\n *\r\n * @param {Geometry} geometry The geometry to modify.\r\n * @returns {Geometry} The modified geometry
argument, with its normals compressed and packed.\r\n *\r\n * @example\r\n * geometry = Cesium.GeometryPipeline.compressVertices(geometry);\r\n */\r\nGeometryPipeline.compressVertices = function (geometry) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(geometry)) {\r\n throw new DeveloperError(\"geometry is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const extrudeAttribute = geometry.attributes.extrudeDirection;\r\n let i;\r\n let numVertices;\r\n if (defined(extrudeAttribute)) {\r\n //only shadow volumes use extrudeDirection, and shadow volumes use vertexFormat: POSITION_ONLY so we don't need to check other attributes\r\n const extrudeDirections = extrudeAttribute.values;\r\n numVertices = extrudeDirections.length / 3.0;\r\n const compressedDirections = new Float32Array(numVertices * 2);\r\n\r\n let i2 = 0;\r\n for (i = 0; i < numVertices; ++i) {\r\n Cartesian3.fromArray(extrudeDirections, i * 3.0, toEncode1);\r\n if (Cartesian3.equals(toEncode1, Cartesian3.ZERO)) {\r\n i2 += 2;\r\n continue;\r\n }\r\n encodeResult2 = AttributeCompression.octEncodeInRange(\r\n toEncode1,\r\n 65535,\r\n encodeResult2\r\n );\r\n compressedDirections[i2++] = encodeResult2.x;\r\n compressedDirections[i2++] = encodeResult2.y;\r\n }\r\n\r\n geometry.attributes.compressedAttributes = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: compressedDirections,\r\n });\r\n delete geometry.attributes.extrudeDirection;\r\n return geometry;\r\n }\r\n\r\n const normalAttribute = geometry.attributes.normal;\r\n const stAttribute = geometry.attributes.st;\r\n\r\n const hasNormal = defined(normalAttribute);\r\n const hasSt = defined(stAttribute);\r\n if (!hasNormal && !hasSt) {\r\n return geometry;\r\n }\r\n\r\n const tangentAttribute = geometry.attributes.tangent;\r\n const bitangentAttribute = geometry.attributes.bitangent;\r\n\r\n const hasTangent = defined(tangentAttribute);\r\n const hasBitangent = defined(bitangentAttribute);\r\n\r\n let normals;\r\n let st;\r\n let tangents;\r\n let bitangents;\r\n\r\n if (hasNormal) {\r\n normals = normalAttribute.values;\r\n }\r\n if (hasSt) {\r\n st = stAttribute.values;\r\n }\r\n if (hasTangent) {\r\n tangents = tangentAttribute.values;\r\n }\r\n if (hasBitangent) {\r\n bitangents = bitangentAttribute.values;\r\n }\r\n\r\n const length = hasNormal ? normals.length : st.length;\r\n const numComponents = hasNormal ? 3.0 : 2.0;\r\n numVertices = length / numComponents;\r\n\r\n let compressedLength = numVertices;\r\n let numCompressedComponents = hasSt && hasNormal ? 2.0 : 1.0;\r\n numCompressedComponents += hasTangent || hasBitangent ? 1.0 : 0.0;\r\n compressedLength *= numCompressedComponents;\r\n\r\n const compressedAttributes = new Float32Array(compressedLength);\r\n\r\n let normalIndex = 0;\r\n for (i = 0; i < numVertices; ++i) {\r\n if (hasSt) {\r\n Cartesian2.fromArray(st, i * 2.0, scratchCartesian2);\r\n compressedAttributes[\r\n normalIndex++\r\n ] = AttributeCompression.compressTextureCoordinates(scratchCartesian2);\r\n }\r\n\r\n const index = i * 3.0;\r\n if (hasNormal && defined(tangents) && defined(bitangents)) {\r\n Cartesian3.fromArray(normals, index, toEncode1);\r\n Cartesian3.fromArray(tangents, index, toEncode2);\r\n Cartesian3.fromArray(bitangents, index, toEncode3);\r\n\r\n AttributeCompression.octPack(\r\n toEncode1,\r\n toEncode2,\r\n toEncode3,\r\n scratchCartesian2\r\n );\r\n compressedAttributes[normalIndex++] = scratchCartesian2.x;\r\n compressedAttributes[normalIndex++] = scratchCartesian2.y;\r\n } else {\r\n if (hasNormal) {\r\n Cartesian3.fromArray(normals, index, toEncode1);\r\n compressedAttributes[\r\n normalIndex++\r\n ] = AttributeCompression.octEncodeFloat(toEncode1);\r\n }\r\n\r\n if (hasTangent) {\r\n Cartesian3.fromArray(tangents, index, toEncode1);\r\n compressedAttributes[\r\n normalIndex++\r\n ] = AttributeCompression.octEncodeFloat(toEncode1);\r\n }\r\n\r\n if (hasBitangent) {\r\n Cartesian3.fromArray(bitangents, index, toEncode1);\r\n compressedAttributes[\r\n normalIndex++\r\n ] = AttributeCompression.octEncodeFloat(toEncode1);\r\n }\r\n }\r\n }\r\n\r\n geometry.attributes.compressedAttributes = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: numCompressedComponents,\r\n values: compressedAttributes,\r\n });\r\n\r\n if (hasNormal) {\r\n delete geometry.attributes.normal;\r\n }\r\n if (hasSt) {\r\n delete geometry.attributes.st;\r\n }\r\n if (hasBitangent) {\r\n delete geometry.attributes.bitangent;\r\n }\r\n if (hasTangent) {\r\n delete geometry.attributes.tangent;\r\n }\r\n\r\n return geometry;\r\n};\r\n\r\nfunction indexTriangles(geometry) {\r\n if (defined(geometry.indices)) {\r\n return geometry;\r\n }\r\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (numberOfVertices < 3) {\r\n throw new DeveloperError(\"The number of vertices must be at least three.\");\r\n }\r\n if (numberOfVertices % 3 !== 0) {\r\n throw new DeveloperError(\r\n \"The number of vertices must be a multiple of three.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const indices = IndexDatatype.createTypedArray(\r\n numberOfVertices,\r\n numberOfVertices\r\n );\r\n for (let i = 0; i < numberOfVertices; ++i) {\r\n indices[i] = i;\r\n }\r\n\r\n geometry.indices = indices;\r\n return geometry;\r\n}\r\n\r\nfunction indexTriangleFan(geometry) {\r\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (numberOfVertices < 3) {\r\n throw new DeveloperError(\"The number of vertices must be at least three.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const indices = IndexDatatype.createTypedArray(\r\n numberOfVertices,\r\n (numberOfVertices - 2) * 3\r\n );\r\n indices[0] = 1;\r\n indices[1] = 0;\r\n indices[2] = 2;\r\n\r\n let indicesIndex = 3;\r\n for (let i = 3; i < numberOfVertices; ++i) {\r\n indices[indicesIndex++] = i - 1;\r\n indices[indicesIndex++] = 0;\r\n indices[indicesIndex++] = i;\r\n }\r\n\r\n geometry.indices = indices;\r\n geometry.primitiveType = PrimitiveType.TRIANGLES;\r\n return geometry;\r\n}\r\n\r\nfunction indexTriangleStrip(geometry) {\r\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (numberOfVertices < 3) {\r\n throw new DeveloperError(\"The number of vertices must be at least 3.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const indices = IndexDatatype.createTypedArray(\r\n numberOfVertices,\r\n (numberOfVertices - 2) * 3\r\n );\r\n indices[0] = 0;\r\n indices[1] = 1;\r\n indices[2] = 2;\r\n\r\n if (numberOfVertices > 3) {\r\n indices[3] = 0;\r\n indices[4] = 2;\r\n indices[5] = 3;\r\n }\r\n\r\n let indicesIndex = 6;\r\n for (let i = 3; i < numberOfVertices - 1; i += 2) {\r\n indices[indicesIndex++] = i;\r\n indices[indicesIndex++] = i - 1;\r\n indices[indicesIndex++] = i + 1;\r\n\r\n if (i + 2 < numberOfVertices) {\r\n indices[indicesIndex++] = i;\r\n indices[indicesIndex++] = i + 1;\r\n indices[indicesIndex++] = i + 2;\r\n }\r\n }\r\n\r\n geometry.indices = indices;\r\n geometry.primitiveType = PrimitiveType.TRIANGLES;\r\n return geometry;\r\n}\r\n\r\nfunction indexLines(geometry) {\r\n if (defined(geometry.indices)) {\r\n return geometry;\r\n }\r\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (numberOfVertices < 2) {\r\n throw new DeveloperError(\"The number of vertices must be at least two.\");\r\n }\r\n if (numberOfVertices % 2 !== 0) {\r\n throw new DeveloperError(\"The number of vertices must be a multiple of 2.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const indices = IndexDatatype.createTypedArray(\r\n numberOfVertices,\r\n numberOfVertices\r\n );\r\n for (let i = 0; i < numberOfVertices; ++i) {\r\n indices[i] = i;\r\n }\r\n\r\n geometry.indices = indices;\r\n return geometry;\r\n}\r\n\r\nfunction indexLineStrip(geometry) {\r\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (numberOfVertices < 2) {\r\n throw new DeveloperError(\"The number of vertices must be at least two.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const indices = IndexDatatype.createTypedArray(\r\n numberOfVertices,\r\n (numberOfVertices - 1) * 2\r\n );\r\n indices[0] = 0;\r\n indices[1] = 1;\r\n let indicesIndex = 2;\r\n for (let i = 2; i < numberOfVertices; ++i) {\r\n indices[indicesIndex++] = i - 1;\r\n indices[indicesIndex++] = i;\r\n }\r\n\r\n geometry.indices = indices;\r\n geometry.primitiveType = PrimitiveType.LINES;\r\n return geometry;\r\n}\r\n\r\nfunction indexLineLoop(geometry) {\r\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (numberOfVertices < 2) {\r\n throw new DeveloperError(\"The number of vertices must be at least two.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const indices = IndexDatatype.createTypedArray(\r\n numberOfVertices,\r\n numberOfVertices * 2\r\n );\r\n\r\n indices[0] = 0;\r\n indices[1] = 1;\r\n\r\n let indicesIndex = 2;\r\n for (let i = 2; i < numberOfVertices; ++i) {\r\n indices[indicesIndex++] = i - 1;\r\n indices[indicesIndex++] = i;\r\n }\r\n\r\n indices[indicesIndex++] = numberOfVertices - 1;\r\n indices[indicesIndex] = 0;\r\n\r\n geometry.indices = indices;\r\n geometry.primitiveType = PrimitiveType.LINES;\r\n return geometry;\r\n}\r\n\r\nfunction indexPrimitive(geometry) {\r\n switch (geometry.primitiveType) {\r\n case PrimitiveType.TRIANGLE_FAN:\r\n return indexTriangleFan(geometry);\r\n case PrimitiveType.TRIANGLE_STRIP:\r\n return indexTriangleStrip(geometry);\r\n case PrimitiveType.TRIANGLES:\r\n return indexTriangles(geometry);\r\n case PrimitiveType.LINE_STRIP:\r\n return indexLineStrip(geometry);\r\n case PrimitiveType.LINE_LOOP:\r\n return indexLineLoop(geometry);\r\n case PrimitiveType.LINES:\r\n return indexLines(geometry);\r\n }\r\n\r\n return geometry;\r\n}\r\n\r\nfunction offsetPointFromXZPlane(p, isBehind) {\r\n if (Math.abs(p.y) < CesiumMath.EPSILON6) {\r\n if (isBehind) {\r\n p.y = -CesiumMath.EPSILON6;\r\n } else {\r\n p.y = CesiumMath.EPSILON6;\r\n }\r\n }\r\n}\r\n\r\nfunction offsetTriangleFromXZPlane(p0, p1, p2) {\r\n if (p0.y !== 0.0 && p1.y !== 0.0 && p2.y !== 0.0) {\r\n offsetPointFromXZPlane(p0, p0.y < 0.0);\r\n offsetPointFromXZPlane(p1, p1.y < 0.0);\r\n offsetPointFromXZPlane(p2, p2.y < 0.0);\r\n return;\r\n }\r\n\r\n const p0y = Math.abs(p0.y);\r\n const p1y = Math.abs(p1.y);\r\n const p2y = Math.abs(p2.y);\r\n\r\n let sign;\r\n if (p0y > p1y) {\r\n if (p0y > p2y) {\r\n sign = CesiumMath.sign(p0.y);\r\n } else {\r\n sign = CesiumMath.sign(p2.y);\r\n }\r\n } else if (p1y > p2y) {\r\n sign = CesiumMath.sign(p1.y);\r\n } else {\r\n sign = CesiumMath.sign(p2.y);\r\n }\r\n\r\n const isBehind = sign < 0.0;\r\n offsetPointFromXZPlane(p0, isBehind);\r\n offsetPointFromXZPlane(p1, isBehind);\r\n offsetPointFromXZPlane(p2, isBehind);\r\n}\r\n\r\nconst c3 = new Cartesian3();\r\nfunction getXZIntersectionOffsetPoints(p, p1, u1, v1) {\r\n Cartesian3.add(\r\n p,\r\n Cartesian3.multiplyByScalar(\r\n Cartesian3.subtract(p1, p, c3),\r\n p.y / (p.y - p1.y),\r\n c3\r\n ),\r\n u1\r\n );\r\n Cartesian3.clone(u1, v1);\r\n offsetPointFromXZPlane(u1, true);\r\n offsetPointFromXZPlane(v1, false);\r\n}\r\n\r\nconst u1 = new Cartesian3();\r\nconst u2 = new Cartesian3();\r\nconst q1 = new Cartesian3();\r\nconst q2 = new Cartesian3();\r\n\r\nconst splitTriangleResult = {\r\n positions: new Array(7),\r\n indices: new Array(3 * 3),\r\n};\r\n\r\nfunction splitTriangle(p0, p1, p2) {\r\n // In WGS84 coordinates, for a triangle approximately on the\r\n // ellipsoid to cross the IDL, first it needs to be on the\r\n // negative side of the plane x = 0.\r\n if (p0.x >= 0.0 || p1.x >= 0.0 || p2.x >= 0.0) {\r\n return undefined;\r\n }\r\n\r\n offsetTriangleFromXZPlane(p0, p1, p2);\r\n\r\n const p0Behind = p0.y < 0.0;\r\n const p1Behind = p1.y < 0.0;\r\n const p2Behind = p2.y < 0.0;\r\n\r\n let numBehind = 0;\r\n numBehind += p0Behind ? 1 : 0;\r\n numBehind += p1Behind ? 1 : 0;\r\n numBehind += p2Behind ? 1 : 0;\r\n\r\n const indices = splitTriangleResult.indices;\r\n\r\n if (numBehind === 1) {\r\n indices[1] = 3;\r\n indices[2] = 4;\r\n indices[5] = 6;\r\n indices[7] = 6;\r\n indices[8] = 5;\r\n\r\n if (p0Behind) {\r\n getXZIntersectionOffsetPoints(p0, p1, u1, q1);\r\n getXZIntersectionOffsetPoints(p0, p2, u2, q2);\r\n\r\n indices[0] = 0;\r\n indices[3] = 1;\r\n indices[4] = 2;\r\n indices[6] = 1;\r\n } else if (p1Behind) {\r\n getXZIntersectionOffsetPoints(p1, p2, u1, q1);\r\n getXZIntersectionOffsetPoints(p1, p0, u2, q2);\r\n\r\n indices[0] = 1;\r\n indices[3] = 2;\r\n indices[4] = 0;\r\n indices[6] = 2;\r\n } else if (p2Behind) {\r\n getXZIntersectionOffsetPoints(p2, p0, u1, q1);\r\n getXZIntersectionOffsetPoints(p2, p1, u2, q2);\r\n\r\n indices[0] = 2;\r\n indices[3] = 0;\r\n indices[4] = 1;\r\n indices[6] = 0;\r\n }\r\n } else if (numBehind === 2) {\r\n indices[2] = 4;\r\n indices[4] = 4;\r\n indices[5] = 3;\r\n indices[7] = 5;\r\n indices[8] = 6;\r\n\r\n if (!p0Behind) {\r\n getXZIntersectionOffsetPoints(p0, p1, u1, q1);\r\n getXZIntersectionOffsetPoints(p0, p2, u2, q2);\r\n\r\n indices[0] = 1;\r\n indices[1] = 2;\r\n indices[3] = 1;\r\n indices[6] = 0;\r\n } else if (!p1Behind) {\r\n getXZIntersectionOffsetPoints(p1, p2, u1, q1);\r\n getXZIntersectionOffsetPoints(p1, p0, u2, q2);\r\n\r\n indices[0] = 2;\r\n indices[1] = 0;\r\n indices[3] = 2;\r\n indices[6] = 1;\r\n } else if (!p2Behind) {\r\n getXZIntersectionOffsetPoints(p2, p0, u1, q1);\r\n getXZIntersectionOffsetPoints(p2, p1, u2, q2);\r\n\r\n indices[0] = 0;\r\n indices[1] = 1;\r\n indices[3] = 0;\r\n indices[6] = 2;\r\n }\r\n }\r\n\r\n const positions = splitTriangleResult.positions;\r\n positions[0] = p0;\r\n positions[1] = p1;\r\n positions[2] = p2;\r\n positions.length = 3;\r\n\r\n if (numBehind === 1 || numBehind === 2) {\r\n positions[3] = u1;\r\n positions[4] = u2;\r\n positions[5] = q1;\r\n positions[6] = q2;\r\n positions.length = 7;\r\n }\r\n\r\n return splitTriangleResult;\r\n}\r\n\r\nfunction updateGeometryAfterSplit(geometry, computeBoundingSphere) {\r\n const attributes = geometry.attributes;\r\n\r\n if (attributes.position.values.length === 0) {\r\n return undefined;\r\n }\r\n\r\n for (const property in attributes) {\r\n if (\r\n attributes.hasOwnProperty(property) &&\r\n defined(attributes[property]) &&\r\n defined(attributes[property].values)\r\n ) {\r\n const attribute = attributes[property];\r\n attribute.values = ComponentDatatype.createTypedArray(\r\n attribute.componentDatatype,\r\n attribute.values\r\n );\r\n }\r\n }\r\n\r\n const numberOfVertices = Geometry.computeNumberOfVertices(geometry);\r\n geometry.indices = IndexDatatype.createTypedArray(\r\n numberOfVertices,\r\n geometry.indices\r\n );\r\n\r\n if (computeBoundingSphere) {\r\n geometry.boundingSphere = BoundingSphere.fromVertices(\r\n attributes.position.values\r\n );\r\n }\r\n\r\n return geometry;\r\n}\r\n\r\nfunction copyGeometryForSplit(geometry) {\r\n const attributes = geometry.attributes;\r\n const copiedAttributes = {};\r\n\r\n for (const property in attributes) {\r\n if (\r\n attributes.hasOwnProperty(property) &&\r\n defined(attributes[property]) &&\r\n defined(attributes[property].values)\r\n ) {\r\n const attribute = attributes[property];\r\n copiedAttributes[property] = new GeometryAttribute({\r\n componentDatatype: attribute.componentDatatype,\r\n componentsPerAttribute: attribute.componentsPerAttribute,\r\n normalize: attribute.normalize,\r\n values: [],\r\n });\r\n }\r\n }\r\n\r\n return new Geometry({\r\n attributes: copiedAttributes,\r\n indices: [],\r\n primitiveType: geometry.primitiveType,\r\n });\r\n}\r\n\r\nfunction updateInstanceAfterSplit(instance, westGeometry, eastGeometry) {\r\n const computeBoundingSphere = defined(instance.geometry.boundingSphere);\r\n\r\n westGeometry = updateGeometryAfterSplit(westGeometry, computeBoundingSphere);\r\n eastGeometry = updateGeometryAfterSplit(eastGeometry, computeBoundingSphere);\r\n\r\n if (defined(eastGeometry) && !defined(westGeometry)) {\r\n instance.geometry = eastGeometry;\r\n } else if (!defined(eastGeometry) && defined(westGeometry)) {\r\n instance.geometry = westGeometry;\r\n } else {\r\n instance.westHemisphereGeometry = westGeometry;\r\n instance.eastHemisphereGeometry = eastGeometry;\r\n instance.geometry = undefined;\r\n }\r\n}\r\n\r\nfunction generateBarycentricInterpolateFunction(\r\n CartesianType,\r\n numberOfComponents\r\n) {\r\n const v0Scratch = new CartesianType();\r\n const v1Scratch = new CartesianType();\r\n const v2Scratch = new CartesianType();\r\n\r\n return function (\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n sourceValues,\r\n currentValues,\r\n insertedIndex,\r\n normalize\r\n ) {\r\n const v0 = CartesianType.fromArray(\r\n sourceValues,\r\n i0 * numberOfComponents,\r\n v0Scratch\r\n );\r\n const v1 = CartesianType.fromArray(\r\n sourceValues,\r\n i1 * numberOfComponents,\r\n v1Scratch\r\n );\r\n const v2 = CartesianType.fromArray(\r\n sourceValues,\r\n i2 * numberOfComponents,\r\n v2Scratch\r\n );\r\n\r\n CartesianType.multiplyByScalar(v0, coords.x, v0);\r\n CartesianType.multiplyByScalar(v1, coords.y, v1);\r\n CartesianType.multiplyByScalar(v2, coords.z, v2);\r\n\r\n const value = CartesianType.add(v0, v1, v0);\r\n CartesianType.add(value, v2, value);\r\n\r\n if (normalize) {\r\n CartesianType.normalize(value, value);\r\n }\r\n\r\n CartesianType.pack(\r\n value,\r\n currentValues,\r\n insertedIndex * numberOfComponents\r\n );\r\n };\r\n}\r\n\r\nconst interpolateAndPackCartesian4 = generateBarycentricInterpolateFunction(\r\n Cartesian4,\r\n 4\r\n);\r\nconst interpolateAndPackCartesian3 = generateBarycentricInterpolateFunction(\r\n Cartesian3,\r\n 3\r\n);\r\nconst interpolateAndPackCartesian2 = generateBarycentricInterpolateFunction(\r\n Cartesian2,\r\n 2\r\n);\r\nconst interpolateAndPackBoolean = function (\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n sourceValues,\r\n currentValues,\r\n insertedIndex\r\n) {\r\n const v1 = sourceValues[i0] * coords.x;\r\n const v2 = sourceValues[i1] * coords.y;\r\n const v3 = sourceValues[i2] * coords.z;\r\n currentValues[insertedIndex] = v1 + v2 + v3 > CesiumMath.EPSILON6 ? 1 : 0;\r\n};\r\n\r\nconst p0Scratch = new Cartesian3();\r\nconst p1Scratch = new Cartesian3();\r\nconst p2Scratch = new Cartesian3();\r\nconst barycentricScratch = new Cartesian3();\r\n\r\nfunction computeTriangleAttributes(\r\n i0,\r\n i1,\r\n i2,\r\n point,\r\n positions,\r\n normals,\r\n tangents,\r\n bitangents,\r\n texCoords,\r\n extrudeDirections,\r\n applyOffset,\r\n currentAttributes,\r\n customAttributeNames,\r\n customAttributesLength,\r\n allAttributes,\r\n insertedIndex\r\n) {\r\n if (\r\n !defined(normals) &&\r\n !defined(tangents) &&\r\n !defined(bitangents) &&\r\n !defined(texCoords) &&\r\n !defined(extrudeDirections) &&\r\n customAttributesLength === 0\r\n ) {\r\n return;\r\n }\r\n\r\n const p0 = Cartesian3.fromArray(positions, i0 * 3, p0Scratch);\r\n const p1 = Cartesian3.fromArray(positions, i1 * 3, p1Scratch);\r\n const p2 = Cartesian3.fromArray(positions, i2 * 3, p2Scratch);\r\n const coords = barycentricCoordinates(point, p0, p1, p2, barycentricScratch);\r\n if (!defined(coords)) {\r\n return;\r\n }\r\n\r\n if (defined(normals)) {\r\n interpolateAndPackCartesian3(\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n normals,\r\n currentAttributes.normal.values,\r\n insertedIndex,\r\n true\r\n );\r\n }\r\n\r\n if (defined(extrudeDirections)) {\r\n const d0 = Cartesian3.fromArray(extrudeDirections, i0 * 3, p0Scratch);\r\n const d1 = Cartesian3.fromArray(extrudeDirections, i1 * 3, p1Scratch);\r\n const d2 = Cartesian3.fromArray(extrudeDirections, i2 * 3, p2Scratch);\r\n\r\n Cartesian3.multiplyByScalar(d0, coords.x, d0);\r\n Cartesian3.multiplyByScalar(d1, coords.y, d1);\r\n Cartesian3.multiplyByScalar(d2, coords.z, d2);\r\n\r\n let direction;\r\n if (\r\n !Cartesian3.equals(d0, Cartesian3.ZERO) ||\r\n !Cartesian3.equals(d1, Cartesian3.ZERO) ||\r\n !Cartesian3.equals(d2, Cartesian3.ZERO)\r\n ) {\r\n direction = Cartesian3.add(d0, d1, d0);\r\n Cartesian3.add(direction, d2, direction);\r\n Cartesian3.normalize(direction, direction);\r\n } else {\r\n direction = p0Scratch;\r\n direction.x = 0;\r\n direction.y = 0;\r\n direction.z = 0;\r\n }\r\n Cartesian3.pack(\r\n direction,\r\n currentAttributes.extrudeDirection.values,\r\n insertedIndex * 3\r\n );\r\n }\r\n\r\n if (defined(applyOffset)) {\r\n interpolateAndPackBoolean(\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n applyOffset,\r\n currentAttributes.applyOffset.values,\r\n insertedIndex\r\n );\r\n }\r\n\r\n if (defined(tangents)) {\r\n interpolateAndPackCartesian3(\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n tangents,\r\n currentAttributes.tangent.values,\r\n insertedIndex,\r\n true\r\n );\r\n }\r\n\r\n if (defined(bitangents)) {\r\n interpolateAndPackCartesian3(\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n bitangents,\r\n currentAttributes.bitangent.values,\r\n insertedIndex,\r\n true\r\n );\r\n }\r\n\r\n if (defined(texCoords)) {\r\n interpolateAndPackCartesian2(\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n texCoords,\r\n currentAttributes.st.values,\r\n insertedIndex\r\n );\r\n }\r\n\r\n if (customAttributesLength > 0) {\r\n for (let i = 0; i < customAttributesLength; i++) {\r\n const attributeName = customAttributeNames[i];\r\n genericInterpolate(\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n insertedIndex,\r\n allAttributes[attributeName],\r\n currentAttributes[attributeName]\r\n );\r\n }\r\n }\r\n}\r\n\r\nfunction genericInterpolate(\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n insertedIndex,\r\n sourceAttribute,\r\n currentAttribute\r\n) {\r\n const componentsPerAttribute = sourceAttribute.componentsPerAttribute;\r\n const sourceValues = sourceAttribute.values;\r\n const currentValues = currentAttribute.values;\r\n switch (componentsPerAttribute) {\r\n case 4:\r\n interpolateAndPackCartesian4(\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n sourceValues,\r\n currentValues,\r\n insertedIndex,\r\n false\r\n );\r\n break;\r\n case 3:\r\n interpolateAndPackCartesian3(\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n sourceValues,\r\n currentValues,\r\n insertedIndex,\r\n false\r\n );\r\n break;\r\n case 2:\r\n interpolateAndPackCartesian2(\r\n i0,\r\n i1,\r\n i2,\r\n coords,\r\n sourceValues,\r\n currentValues,\r\n insertedIndex,\r\n false\r\n );\r\n break;\r\n default:\r\n currentValues[insertedIndex] =\r\n sourceValues[i0] * coords.x +\r\n sourceValues[i1] * coords.y +\r\n sourceValues[i2] * coords.z;\r\n }\r\n}\r\n\r\nfunction insertSplitPoint(\r\n currentAttributes,\r\n currentIndices,\r\n currentIndexMap,\r\n indices,\r\n currentIndex,\r\n point\r\n) {\r\n const insertIndex = currentAttributes.position.values.length / 3;\r\n\r\n if (currentIndex !== -1) {\r\n const prevIndex = indices[currentIndex];\r\n const newIndex = currentIndexMap[prevIndex];\r\n\r\n if (newIndex === -1) {\r\n currentIndexMap[prevIndex] = insertIndex;\r\n currentAttributes.position.values.push(point.x, point.y, point.z);\r\n currentIndices.push(insertIndex);\r\n return insertIndex;\r\n }\r\n\r\n currentIndices.push(newIndex);\r\n return newIndex;\r\n }\r\n\r\n currentAttributes.position.values.push(point.x, point.y, point.z);\r\n currentIndices.push(insertIndex);\r\n return insertIndex;\r\n}\r\n\r\nconst NAMED_ATTRIBUTES = {\r\n position: true,\r\n normal: true,\r\n bitangent: true,\r\n tangent: true,\r\n st: true,\r\n extrudeDirection: true,\r\n applyOffset: true,\r\n};\r\nfunction splitLongitudeTriangles(instance) {\r\n const geometry = instance.geometry;\r\n const attributes = geometry.attributes;\r\n const positions = attributes.position.values;\r\n const normals = defined(attributes.normal)\r\n ? attributes.normal.values\r\n : undefined;\r\n const bitangents = defined(attributes.bitangent)\r\n ? attributes.bitangent.values\r\n : undefined;\r\n const tangents = defined(attributes.tangent)\r\n ? attributes.tangent.values\r\n : undefined;\r\n const texCoords = defined(attributes.st) ? attributes.st.values : undefined;\r\n const extrudeDirections = defined(attributes.extrudeDirection)\r\n ? attributes.extrudeDirection.values\r\n : undefined;\r\n const applyOffset = defined(attributes.applyOffset)\r\n ? attributes.applyOffset.values\r\n : undefined;\r\n const indices = geometry.indices;\r\n\r\n const customAttributeNames = [];\r\n for (const attributeName in attributes) {\r\n if (\r\n attributes.hasOwnProperty(attributeName) &&\r\n !NAMED_ATTRIBUTES[attributeName] &&\r\n defined(attributes[attributeName])\r\n ) {\r\n customAttributeNames.push(attributeName);\r\n }\r\n }\r\n const customAttributesLength = customAttributeNames.length;\r\n\r\n const eastGeometry = copyGeometryForSplit(geometry);\r\n const westGeometry = copyGeometryForSplit(geometry);\r\n\r\n let currentAttributes;\r\n let currentIndices;\r\n let currentIndexMap;\r\n let insertedIndex;\r\n let i;\r\n\r\n const westGeometryIndexMap = [];\r\n westGeometryIndexMap.length = positions.length / 3;\r\n\r\n const eastGeometryIndexMap = [];\r\n eastGeometryIndexMap.length = positions.length / 3;\r\n\r\n for (i = 0; i < westGeometryIndexMap.length; ++i) {\r\n westGeometryIndexMap[i] = -1;\r\n eastGeometryIndexMap[i] = -1;\r\n }\r\n\r\n const len = indices.length;\r\n for (i = 0; i < len; i += 3) {\r\n const i0 = indices[i];\r\n const i1 = indices[i + 1];\r\n const i2 = indices[i + 2];\r\n\r\n let p0 = Cartesian3.fromArray(positions, i0 * 3);\r\n let p1 = Cartesian3.fromArray(positions, i1 * 3);\r\n let p2 = Cartesian3.fromArray(positions, i2 * 3);\r\n\r\n const result = splitTriangle(p0, p1, p2);\r\n if (defined(result) && result.positions.length > 3) {\r\n const resultPositions = result.positions;\r\n const resultIndices = result.indices;\r\n const resultLength = resultIndices.length;\r\n\r\n for (let j = 0; j < resultLength; ++j) {\r\n const resultIndex = resultIndices[j];\r\n const point = resultPositions[resultIndex];\r\n\r\n if (point.y < 0.0) {\r\n currentAttributes = westGeometry.attributes;\r\n currentIndices = westGeometry.indices;\r\n currentIndexMap = westGeometryIndexMap;\r\n } else {\r\n currentAttributes = eastGeometry.attributes;\r\n currentIndices = eastGeometry.indices;\r\n currentIndexMap = eastGeometryIndexMap;\r\n }\r\n\r\n insertedIndex = insertSplitPoint(\r\n currentAttributes,\r\n currentIndices,\r\n currentIndexMap,\r\n indices,\r\n resultIndex < 3 ? i + resultIndex : -1,\r\n point\r\n );\r\n computeTriangleAttributes(\r\n i0,\r\n i1,\r\n i2,\r\n point,\r\n positions,\r\n normals,\r\n tangents,\r\n bitangents,\r\n texCoords,\r\n extrudeDirections,\r\n applyOffset,\r\n currentAttributes,\r\n customAttributeNames,\r\n customAttributesLength,\r\n attributes,\r\n insertedIndex\r\n );\r\n }\r\n } else {\r\n if (defined(result)) {\r\n p0 = result.positions[0];\r\n p1 = result.positions[1];\r\n p2 = result.positions[2];\r\n }\r\n\r\n if (p0.y < 0.0) {\r\n currentAttributes = westGeometry.attributes;\r\n currentIndices = westGeometry.indices;\r\n currentIndexMap = westGeometryIndexMap;\r\n } else {\r\n currentAttributes = eastGeometry.attributes;\r\n currentIndices = eastGeometry.indices;\r\n currentIndexMap = eastGeometryIndexMap;\r\n }\r\n\r\n insertedIndex = insertSplitPoint(\r\n currentAttributes,\r\n currentIndices,\r\n currentIndexMap,\r\n indices,\r\n i,\r\n p0\r\n );\r\n computeTriangleAttributes(\r\n i0,\r\n i1,\r\n i2,\r\n p0,\r\n positions,\r\n normals,\r\n tangents,\r\n bitangents,\r\n texCoords,\r\n extrudeDirections,\r\n applyOffset,\r\n currentAttributes,\r\n customAttributeNames,\r\n customAttributesLength,\r\n attributes,\r\n insertedIndex\r\n );\r\n\r\n insertedIndex = insertSplitPoint(\r\n currentAttributes,\r\n currentIndices,\r\n currentIndexMap,\r\n indices,\r\n i + 1,\r\n p1\r\n );\r\n computeTriangleAttributes(\r\n i0,\r\n i1,\r\n i2,\r\n p1,\r\n positions,\r\n normals,\r\n tangents,\r\n bitangents,\r\n texCoords,\r\n extrudeDirections,\r\n applyOffset,\r\n currentAttributes,\r\n customAttributeNames,\r\n customAttributesLength,\r\n attributes,\r\n insertedIndex\r\n );\r\n\r\n insertedIndex = insertSplitPoint(\r\n currentAttributes,\r\n currentIndices,\r\n currentIndexMap,\r\n indices,\r\n i + 2,\r\n p2\r\n );\r\n computeTriangleAttributes(\r\n i0,\r\n i1,\r\n i2,\r\n p2,\r\n positions,\r\n normals,\r\n tangents,\r\n bitangents,\r\n texCoords,\r\n extrudeDirections,\r\n applyOffset,\r\n currentAttributes,\r\n customAttributeNames,\r\n customAttributesLength,\r\n attributes,\r\n insertedIndex\r\n );\r\n }\r\n }\r\n\r\n updateInstanceAfterSplit(instance, westGeometry, eastGeometry);\r\n}\r\n\r\nconst xzPlane = Plane.fromPointNormal(Cartesian3.ZERO, Cartesian3.UNIT_Y);\r\n\r\nconst offsetScratch = new Cartesian3();\r\nconst offsetPointScratch = new Cartesian3();\r\n\r\nfunction computeLineAttributes(\r\n i0,\r\n i1,\r\n point,\r\n positions,\r\n insertIndex,\r\n currentAttributes,\r\n applyOffset\r\n) {\r\n if (!defined(applyOffset)) {\r\n return;\r\n }\r\n\r\n const p0 = Cartesian3.fromArray(positions, i0 * 3, p0Scratch);\r\n if (Cartesian3.equalsEpsilon(p0, point, CesiumMath.EPSILON10)) {\r\n currentAttributes.applyOffset.values[insertIndex] = applyOffset[i0];\r\n } else {\r\n currentAttributes.applyOffset.values[insertIndex] = applyOffset[i1];\r\n }\r\n}\r\n\r\nfunction splitLongitudeLines(instance) {\r\n const geometry = instance.geometry;\r\n const attributes = geometry.attributes;\r\n const positions = attributes.position.values;\r\n const applyOffset = defined(attributes.applyOffset)\r\n ? attributes.applyOffset.values\r\n : undefined;\r\n const indices = geometry.indices;\r\n\r\n const eastGeometry = copyGeometryForSplit(geometry);\r\n const westGeometry = copyGeometryForSplit(geometry);\r\n\r\n let i;\r\n const length = indices.length;\r\n\r\n const westGeometryIndexMap = [];\r\n westGeometryIndexMap.length = positions.length / 3;\r\n\r\n const eastGeometryIndexMap = [];\r\n eastGeometryIndexMap.length = positions.length / 3;\r\n\r\n for (i = 0; i < westGeometryIndexMap.length; ++i) {\r\n westGeometryIndexMap[i] = -1;\r\n eastGeometryIndexMap[i] = -1;\r\n }\r\n\r\n for (i = 0; i < length; i += 2) {\r\n const i0 = indices[i];\r\n const i1 = indices[i + 1];\r\n\r\n const p0 = Cartesian3.fromArray(positions, i0 * 3, p0Scratch);\r\n const p1 = Cartesian3.fromArray(positions, i1 * 3, p1Scratch);\r\n let insertIndex;\r\n\r\n if (Math.abs(p0.y) < CesiumMath.EPSILON6) {\r\n if (p0.y < 0.0) {\r\n p0.y = -CesiumMath.EPSILON6;\r\n } else {\r\n p0.y = CesiumMath.EPSILON6;\r\n }\r\n }\r\n\r\n if (Math.abs(p1.y) < CesiumMath.EPSILON6) {\r\n if (p1.y < 0.0) {\r\n p1.y = -CesiumMath.EPSILON6;\r\n } else {\r\n p1.y = CesiumMath.EPSILON6;\r\n }\r\n }\r\n\r\n let p0Attributes = eastGeometry.attributes;\r\n let p0Indices = eastGeometry.indices;\r\n let p0IndexMap = eastGeometryIndexMap;\r\n let p1Attributes = westGeometry.attributes;\r\n let p1Indices = westGeometry.indices;\r\n let p1IndexMap = westGeometryIndexMap;\r\n\r\n const intersection = IntersectionTests.lineSegmentPlane(\r\n p0,\r\n p1,\r\n xzPlane,\r\n p2Scratch\r\n );\r\n if (defined(intersection)) {\r\n // move point on the xz-plane slightly away from the plane\r\n const offset = Cartesian3.multiplyByScalar(\r\n Cartesian3.UNIT_Y,\r\n 5.0 * CesiumMath.EPSILON9,\r\n offsetScratch\r\n );\r\n if (p0.y < 0.0) {\r\n Cartesian3.negate(offset, offset);\r\n\r\n p0Attributes = westGeometry.attributes;\r\n p0Indices = westGeometry.indices;\r\n p0IndexMap = westGeometryIndexMap;\r\n p1Attributes = eastGeometry.attributes;\r\n p1Indices = eastGeometry.indices;\r\n p1IndexMap = eastGeometryIndexMap;\r\n }\r\n\r\n const offsetPoint = Cartesian3.add(\r\n intersection,\r\n offset,\r\n offsetPointScratch\r\n );\r\n\r\n insertIndex = insertSplitPoint(\r\n p0Attributes,\r\n p0Indices,\r\n p0IndexMap,\r\n indices,\r\n i,\r\n p0\r\n );\r\n computeLineAttributes(\r\n i0,\r\n i1,\r\n p0,\r\n positions,\r\n insertIndex,\r\n p0Attributes,\r\n applyOffset\r\n );\r\n\r\n insertIndex = insertSplitPoint(\r\n p0Attributes,\r\n p0Indices,\r\n p0IndexMap,\r\n indices,\r\n -1,\r\n offsetPoint\r\n );\r\n computeLineAttributes(\r\n i0,\r\n i1,\r\n offsetPoint,\r\n positions,\r\n insertIndex,\r\n p0Attributes,\r\n applyOffset\r\n );\r\n\r\n Cartesian3.negate(offset, offset);\r\n Cartesian3.add(intersection, offset, offsetPoint);\r\n insertIndex = insertSplitPoint(\r\n p1Attributes,\r\n p1Indices,\r\n p1IndexMap,\r\n indices,\r\n -1,\r\n offsetPoint\r\n );\r\n computeLineAttributes(\r\n i0,\r\n i1,\r\n offsetPoint,\r\n positions,\r\n insertIndex,\r\n p1Attributes,\r\n applyOffset\r\n );\r\n\r\n insertIndex = insertSplitPoint(\r\n p1Attributes,\r\n p1Indices,\r\n p1IndexMap,\r\n indices,\r\n i + 1,\r\n p1\r\n );\r\n computeLineAttributes(\r\n i0,\r\n i1,\r\n p1,\r\n positions,\r\n insertIndex,\r\n p1Attributes,\r\n applyOffset\r\n );\r\n } else {\r\n let currentAttributes;\r\n let currentIndices;\r\n let currentIndexMap;\r\n\r\n if (p0.y < 0.0) {\r\n currentAttributes = westGeometry.attributes;\r\n currentIndices = westGeometry.indices;\r\n currentIndexMap = westGeometryIndexMap;\r\n } else {\r\n currentAttributes = eastGeometry.attributes;\r\n currentIndices = eastGeometry.indices;\r\n currentIndexMap = eastGeometryIndexMap;\r\n }\r\n\r\n insertIndex = insertSplitPoint(\r\n currentAttributes,\r\n currentIndices,\r\n currentIndexMap,\r\n indices,\r\n i,\r\n p0\r\n );\r\n computeLineAttributes(\r\n i0,\r\n i1,\r\n p0,\r\n positions,\r\n insertIndex,\r\n currentAttributes,\r\n applyOffset\r\n );\r\n\r\n insertIndex = insertSplitPoint(\r\n currentAttributes,\r\n currentIndices,\r\n currentIndexMap,\r\n indices,\r\n i + 1,\r\n p1\r\n );\r\n computeLineAttributes(\r\n i0,\r\n i1,\r\n p1,\r\n positions,\r\n insertIndex,\r\n currentAttributes,\r\n applyOffset\r\n );\r\n }\r\n }\r\n\r\n updateInstanceAfterSplit(instance, westGeometry, eastGeometry);\r\n}\r\n\r\nconst cartesian2Scratch0 = new Cartesian2();\r\nconst cartesian2Scratch1 = new Cartesian2();\r\n\r\nconst cartesian3Scratch0 = new Cartesian3();\r\nconst cartesian3Scratch2 = new Cartesian3();\r\nconst cartesian3Scratch3 = new Cartesian3();\r\nconst cartesian3Scratch4 = new Cartesian3();\r\nconst cartesian3Scratch5 = new Cartesian3();\r\nconst cartesian3Scratch6 = new Cartesian3();\r\n\r\nconst cartesian4Scratch0 = new Cartesian4();\r\n\r\nfunction updateAdjacencyAfterSplit(geometry) {\r\n const attributes = geometry.attributes;\r\n const positions = attributes.position.values;\r\n const prevPositions = attributes.prevPosition.values;\r\n const nextPositions = attributes.nextPosition.values;\r\n\r\n const length = positions.length;\r\n for (let j = 0; j < length; j += 3) {\r\n const position = Cartesian3.unpack(positions, j, cartesian3Scratch0);\r\n if (position.x > 0.0) {\r\n continue;\r\n }\r\n\r\n const prevPosition = Cartesian3.unpack(\r\n prevPositions,\r\n j,\r\n cartesian3Scratch2\r\n );\r\n if (\r\n (position.y < 0.0 && prevPosition.y > 0.0) ||\r\n (position.y > 0.0 && prevPosition.y < 0.0)\r\n ) {\r\n if (j - 3 > 0) {\r\n prevPositions[j] = positions[j - 3];\r\n prevPositions[j + 1] = positions[j - 2];\r\n prevPositions[j + 2] = positions[j - 1];\r\n } else {\r\n Cartesian3.pack(position, prevPositions, j);\r\n }\r\n }\r\n\r\n const nextPosition = Cartesian3.unpack(\r\n nextPositions,\r\n j,\r\n cartesian3Scratch3\r\n );\r\n if (\r\n (position.y < 0.0 && nextPosition.y > 0.0) ||\r\n (position.y > 0.0 && nextPosition.y < 0.0)\r\n ) {\r\n if (j + 3 < length) {\r\n nextPositions[j] = positions[j + 3];\r\n nextPositions[j + 1] = positions[j + 4];\r\n nextPositions[j + 2] = positions[j + 5];\r\n } else {\r\n Cartesian3.pack(position, nextPositions, j);\r\n }\r\n }\r\n }\r\n}\r\n\r\nconst offsetScalar = 5.0 * CesiumMath.EPSILON9;\r\nconst coplanarOffset = CesiumMath.EPSILON6;\r\n\r\nfunction splitLongitudePolyline(instance) {\r\n const geometry = instance.geometry;\r\n const attributes = geometry.attributes;\r\n const positions = attributes.position.values;\r\n const prevPositions = attributes.prevPosition.values;\r\n const nextPositions = attributes.nextPosition.values;\r\n const expandAndWidths = attributes.expandAndWidth.values;\r\n\r\n const texCoords = defined(attributes.st) ? attributes.st.values : undefined;\r\n const colors = defined(attributes.color)\r\n ? attributes.color.values\r\n : undefined;\r\n\r\n const eastGeometry = copyGeometryForSplit(geometry);\r\n const westGeometry = copyGeometryForSplit(geometry);\r\n\r\n let i;\r\n let j;\r\n let index;\r\n\r\n let intersectionFound = false;\r\n\r\n const length = positions.length / 3;\r\n for (i = 0; i < length; i += 4) {\r\n const i0 = i;\r\n const i2 = i + 2;\r\n\r\n const p0 = Cartesian3.fromArray(positions, i0 * 3, cartesian3Scratch0);\r\n const p2 = Cartesian3.fromArray(positions, i2 * 3, cartesian3Scratch2);\r\n\r\n // Offset points that are close to the 180 longitude and change the previous/next point\r\n // to be the same offset point so it can be projected to 2D. There is special handling in the\r\n // shader for when position == prevPosition || position == nextPosition.\r\n if (Math.abs(p0.y) < coplanarOffset) {\r\n p0.y = coplanarOffset * (p2.y < 0.0 ? -1.0 : 1.0);\r\n positions[i * 3 + 1] = p0.y;\r\n positions[(i + 1) * 3 + 1] = p0.y;\r\n\r\n for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {\r\n prevPositions[j] = positions[i * 3];\r\n prevPositions[j + 1] = positions[i * 3 + 1];\r\n prevPositions[j + 2] = positions[i * 3 + 2];\r\n }\r\n }\r\n\r\n // Do the same but for when the line crosses 180 longitude in the opposite direction.\r\n if (Math.abs(p2.y) < coplanarOffset) {\r\n p2.y = coplanarOffset * (p0.y < 0.0 ? -1.0 : 1.0);\r\n positions[(i + 2) * 3 + 1] = p2.y;\r\n positions[(i + 3) * 3 + 1] = p2.y;\r\n\r\n for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {\r\n nextPositions[j] = positions[(i + 2) * 3];\r\n nextPositions[j + 1] = positions[(i + 2) * 3 + 1];\r\n nextPositions[j + 2] = positions[(i + 2) * 3 + 2];\r\n }\r\n }\r\n\r\n let p0Attributes = eastGeometry.attributes;\r\n let p0Indices = eastGeometry.indices;\r\n let p2Attributes = westGeometry.attributes;\r\n let p2Indices = westGeometry.indices;\r\n\r\n const intersection = IntersectionTests.lineSegmentPlane(\r\n p0,\r\n p2,\r\n xzPlane,\r\n cartesian3Scratch4\r\n );\r\n if (defined(intersection)) {\r\n intersectionFound = true;\r\n\r\n // move point on the xz-plane slightly away from the plane\r\n const offset = Cartesian3.multiplyByScalar(\r\n Cartesian3.UNIT_Y,\r\n offsetScalar,\r\n cartesian3Scratch5\r\n );\r\n if (p0.y < 0.0) {\r\n Cartesian3.negate(offset, offset);\r\n p0Attributes = westGeometry.attributes;\r\n p0Indices = westGeometry.indices;\r\n p2Attributes = eastGeometry.attributes;\r\n p2Indices = eastGeometry.indices;\r\n }\r\n\r\n const offsetPoint = Cartesian3.add(\r\n intersection,\r\n offset,\r\n cartesian3Scratch6\r\n );\r\n p0Attributes.position.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);\r\n p0Attributes.position.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n p0Attributes.position.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n\r\n p0Attributes.prevPosition.values.push(\r\n prevPositions[i0 * 3],\r\n prevPositions[i0 * 3 + 1],\r\n prevPositions[i0 * 3 + 2]\r\n );\r\n p0Attributes.prevPosition.values.push(\r\n prevPositions[i0 * 3 + 3],\r\n prevPositions[i0 * 3 + 4],\r\n prevPositions[i0 * 3 + 5]\r\n );\r\n p0Attributes.prevPosition.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);\r\n\r\n p0Attributes.nextPosition.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n p0Attributes.nextPosition.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n p0Attributes.nextPosition.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n p0Attributes.nextPosition.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n\r\n Cartesian3.negate(offset, offset);\r\n Cartesian3.add(intersection, offset, offsetPoint);\r\n p2Attributes.position.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n p2Attributes.position.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n p2Attributes.position.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);\r\n\r\n p2Attributes.prevPosition.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n p2Attributes.prevPosition.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n p2Attributes.prevPosition.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n p2Attributes.prevPosition.values.push(\r\n offsetPoint.x,\r\n offsetPoint.y,\r\n offsetPoint.z\r\n );\r\n\r\n p2Attributes.nextPosition.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);\r\n p2Attributes.nextPosition.values.push(\r\n nextPositions[i2 * 3],\r\n nextPositions[i2 * 3 + 1],\r\n nextPositions[i2 * 3 + 2]\r\n );\r\n p2Attributes.nextPosition.values.push(\r\n nextPositions[i2 * 3 + 3],\r\n nextPositions[i2 * 3 + 4],\r\n nextPositions[i2 * 3 + 5]\r\n );\r\n\r\n const ew0 = Cartesian2.fromArray(\r\n expandAndWidths,\r\n i0 * 2,\r\n cartesian2Scratch0\r\n );\r\n const width = Math.abs(ew0.y);\r\n\r\n p0Attributes.expandAndWidth.values.push(-1, width, 1, width);\r\n p0Attributes.expandAndWidth.values.push(-1, -width, 1, -width);\r\n p2Attributes.expandAndWidth.values.push(-1, width, 1, width);\r\n p2Attributes.expandAndWidth.values.push(-1, -width, 1, -width);\r\n\r\n let t = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(intersection, p0, cartesian3Scratch3)\r\n );\r\n t /= Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(p2, p0, cartesian3Scratch3)\r\n );\r\n\r\n if (defined(colors)) {\r\n const c0 = Cartesian4.fromArray(colors, i0 * 4, cartesian4Scratch0);\r\n const c2 = Cartesian4.fromArray(colors, i2 * 4, cartesian4Scratch0);\r\n\r\n const r = CesiumMath.lerp(c0.x, c2.x, t);\r\n const g = CesiumMath.lerp(c0.y, c2.y, t);\r\n const b = CesiumMath.lerp(c0.z, c2.z, t);\r\n const a = CesiumMath.lerp(c0.w, c2.w, t);\r\n\r\n for (j = i0 * 4; j < i0 * 4 + 2 * 4; ++j) {\r\n p0Attributes.color.values.push(colors[j]);\r\n }\r\n p0Attributes.color.values.push(r, g, b, a);\r\n p0Attributes.color.values.push(r, g, b, a);\r\n p2Attributes.color.values.push(r, g, b, a);\r\n p2Attributes.color.values.push(r, g, b, a);\r\n for (j = i2 * 4; j < i2 * 4 + 2 * 4; ++j) {\r\n p2Attributes.color.values.push(colors[j]);\r\n }\r\n }\r\n\r\n if (defined(texCoords)) {\r\n const s0 = Cartesian2.fromArray(texCoords, i0 * 2, cartesian2Scratch0);\r\n const s3 = Cartesian2.fromArray(\r\n texCoords,\r\n (i + 3) * 2,\r\n cartesian2Scratch1\r\n );\r\n\r\n const sx = CesiumMath.lerp(s0.x, s3.x, t);\r\n\r\n for (j = i0 * 2; j < i0 * 2 + 2 * 2; ++j) {\r\n p0Attributes.st.values.push(texCoords[j]);\r\n }\r\n p0Attributes.st.values.push(sx, s0.y);\r\n p0Attributes.st.values.push(sx, s3.y);\r\n p2Attributes.st.values.push(sx, s0.y);\r\n p2Attributes.st.values.push(sx, s3.y);\r\n for (j = i2 * 2; j < i2 * 2 + 2 * 2; ++j) {\r\n p2Attributes.st.values.push(texCoords[j]);\r\n }\r\n }\r\n\r\n index = p0Attributes.position.values.length / 3 - 4;\r\n p0Indices.push(index, index + 2, index + 1);\r\n p0Indices.push(index + 1, index + 2, index + 3);\r\n\r\n index = p2Attributes.position.values.length / 3 - 4;\r\n p2Indices.push(index, index + 2, index + 1);\r\n p2Indices.push(index + 1, index + 2, index + 3);\r\n } else {\r\n let currentAttributes;\r\n let currentIndices;\r\n\r\n if (p0.y < 0.0) {\r\n currentAttributes = westGeometry.attributes;\r\n currentIndices = westGeometry.indices;\r\n } else {\r\n currentAttributes = eastGeometry.attributes;\r\n currentIndices = eastGeometry.indices;\r\n }\r\n\r\n currentAttributes.position.values.push(p0.x, p0.y, p0.z);\r\n currentAttributes.position.values.push(p0.x, p0.y, p0.z);\r\n currentAttributes.position.values.push(p2.x, p2.y, p2.z);\r\n currentAttributes.position.values.push(p2.x, p2.y, p2.z);\r\n\r\n for (j = i * 3; j < i * 3 + 4 * 3; ++j) {\r\n currentAttributes.prevPosition.values.push(prevPositions[j]);\r\n currentAttributes.nextPosition.values.push(nextPositions[j]);\r\n }\r\n\r\n for (j = i * 2; j < i * 2 + 4 * 2; ++j) {\r\n currentAttributes.expandAndWidth.values.push(expandAndWidths[j]);\r\n if (defined(texCoords)) {\r\n currentAttributes.st.values.push(texCoords[j]);\r\n }\r\n }\r\n\r\n if (defined(colors)) {\r\n for (j = i * 4; j < i * 4 + 4 * 4; ++j) {\r\n currentAttributes.color.values.push(colors[j]);\r\n }\r\n }\r\n\r\n index = currentAttributes.position.values.length / 3 - 4;\r\n currentIndices.push(index, index + 2, index + 1);\r\n currentIndices.push(index + 1, index + 2, index + 3);\r\n }\r\n }\r\n\r\n if (intersectionFound) {\r\n updateAdjacencyAfterSplit(westGeometry);\r\n updateAdjacencyAfterSplit(eastGeometry);\r\n }\r\n\r\n updateInstanceAfterSplit(instance, westGeometry, eastGeometry);\r\n}\r\n\r\n/**\r\n * Splits the instances's geometry, by introducing new vertices and indices,that\r\n * intersect the International Date Line and Prime Meridian so that no primitives cross longitude\r\n * -180/180 degrees. This is not required for 3D drawing, but is required for\r\n * correcting drawing in 2D and Columbus view.\r\n *\r\n * @private\r\n *\r\n * @param {GeometryInstance} instance The instance to modify.\r\n * @returns {GeometryInstance} The modified instance
argument, with it's geometry split at the International Date Line.\r\n *\r\n * @example\r\n * instance = Cesium.GeometryPipeline.splitLongitude(instance);\r\n */\r\nGeometryPipeline.splitLongitude = function (instance) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(instance)) {\r\n throw new DeveloperError(\"instance is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const geometry = instance.geometry;\r\n const boundingSphere = geometry.boundingSphere;\r\n if (defined(boundingSphere)) {\r\n const minX = boundingSphere.center.x - boundingSphere.radius;\r\n if (\r\n minX > 0 ||\r\n BoundingSphere.intersectPlane(boundingSphere, Plane.ORIGIN_ZX_PLANE) !==\r\n Intersect.INTERSECTING\r\n ) {\r\n return instance;\r\n }\r\n }\r\n\r\n if (geometry.geometryType !== GeometryType.NONE) {\r\n switch (geometry.geometryType) {\r\n case GeometryType.POLYLINES:\r\n splitLongitudePolyline(instance);\r\n break;\r\n case GeometryType.TRIANGLES:\r\n splitLongitudeTriangles(instance);\r\n break;\r\n case GeometryType.LINES:\r\n splitLongitudeLines(instance);\r\n break;\r\n }\r\n } else {\r\n indexPrimitive(geometry);\r\n if (geometry.primitiveType === PrimitiveType.TRIANGLES) {\r\n splitLongitudeTriangles(instance);\r\n } else if (geometry.primitiveType === PrimitiveType.LINES) {\r\n splitLongitudeLines(instance);\r\n }\r\n }\r\n\r\n return instance;\r\n};\r\nexport default GeometryPipeline;\r\n"],"names":["Cartesian3","scratchCartesian2","scratchCartesian3","Check","defined","Cartesian2","CesiumMath","defaultValue","DeveloperError","IndexDatatype","PrimitiveType","BoundingSphere","Geometry","GeometryAttribute","ComponentDatatype","Tipsify","Cartographic","GeographicProjection","EncodedCartesian3","Matrix4","Matrix3","AttributeCompression","Cartesian4","Plane","IntersectionTests","Intersect","GeometryType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,MAAM,iBAAiB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC3C,MAAMC,mBAAiB,GAAG,IAAID,kBAAU,EAAE,CAAC;EAC3C,MAAME,mBAAiB,GAAG,IAAIF,kBAAU,EAAE,CAAC;AAC3C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,sBAAsB,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;EAC3D;EACA,EAAEG,WAAK,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;EAChC,EAAEA,WAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;EAC1B,EAAEA,WAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;EAC1B,EAAEA,WAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;EAC1B;AACA;EACA,EAAE,IAAI,CAACC,oBAAO,CAAC,MAAM,CAAC,EAAE;EACxB,IAAI,MAAM,GAAG,IAAIJ,kBAAU,EAAE,CAAC;EAC9B,GAAG;AACH;EACA;EACA,EAAE,IAAI,EAAE,CAAC;EACT,EAAE,IAAI,EAAE,CAAC;EACT,EAAE,IAAI,EAAE,CAAC;EACT,EAAE,IAAI,KAAK,CAAC;EACZ,EAAE,IAAI,KAAK,CAAC;EACZ,EAAE,IAAI,KAAK,CAAC;EACZ,EAAE,IAAI,KAAK,CAAC;EACZ,EAAE,IAAI,KAAK,CAAC;AACZ;EACA,EAAE,IAAI,CAACI,oBAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;EACtB,IAAI,IAAIC,kBAAU,CAAC,a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AQ,QAAQ,CAAC,YAAY;EACjC,MAAM,KAAKA,8BAAY,CAAC,SAAS;EACjC,QAAQ,sBAAsB,CAAC,QAAQ,CAAC,CAAC;EACzC,QAAQ,MAAM;EACd,MAAM,KAAKA,8BAAY,CAAC,SAAS;EACjC,QAAQ,uBAAuB,CAAC,QAAQ,CAAC,CAAC;EAC1C,QAAQ,MAAM;EACd,MAAM,KAAKA,8BAAY,CAAC,KAAK;EAC7B,QAAQ,mBAAmB,CAAC,QAAQ,CAAC,CAAC;EACtC,QAAQ,MAAM;EACd,KAAK;EACL,GAAG,MAAM;EACT,IAAI,cAAc,CAAC,QAAQ,CAAC,CAAC;EAC7B,IAAI,IAAI,QAAQ,CAAC,aAAa,KAAKhB,+BAAa,CAAC,SAAS,EAAE;EAC5D,MAAM,uBAAuB,CAAC,QAAQ,CAAC,CAAC;EACxC,KAAK,MAAM,IAAI,QAAQ,CAAC,aAAa,KAAKA,+BAAa,CAAC,KAAK,EAAE;EAC/D,MAAM,mBAAmB,CAAC,QAAQ,CAAC,CAAC;EACpC,KAAK;EACL,GAAG;AACH;EACA,EAAE,OAAO,QAAQ,CAAC;EAClB,CAAC,CAAC;AACF,2BAAe,gBAAgB;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/IndexDatatype-b4e5cf89.js b/examples/cesium/Workers/IndexDatatype-b4e5cf89.js
new file mode 100644
index 0000000..6a2fdba
--- /dev/null
+++ b/examples/cesium/Workers/IndexDatatype-b4e5cf89.js
@@ -0,0 +1,226 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './defaultValue-0ab18f7d', './Check-d10e5f2e', './Math-9be8b918', './WebGLConstants-f27a5e29'], (function (exports, defaultValue, Check, Math, WebGLConstants) { 'use strict';
+
+ /**
+ * Constants for WebGL index datatypes. These corresponds to the
+ * type
parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.
+ *
+ * @enum {Number}
+ */
+ const IndexDatatype = {
+ /**
+ * 8-bit unsigned byte corresponding to UNSIGNED_BYTE
and the type
+ * of an element in Uint8Array
.
+ *
+ * @type {Number}
+ * @constant
+ */
+ UNSIGNED_BYTE: WebGLConstants.WebGLConstants.UNSIGNED_BYTE,
+
+ /**
+ * 16-bit unsigned short corresponding to UNSIGNED_SHORT
and the type
+ * of an element in Uint16Array
.
+ *
+ * @type {Number}
+ * @constant
+ */
+ UNSIGNED_SHORT: WebGLConstants.WebGLConstants.UNSIGNED_SHORT,
+
+ /**
+ * 32-bit unsigned int corresponding to UNSIGNED_INT
and the type
+ * of an element in Uint32Array
.
+ *
+ * @type {Number}
+ * @constant
+ */
+ UNSIGNED_INT: WebGLConstants.WebGLConstants.UNSIGNED_INT,
+ };
+
+ /**
+ * Returns the size, in bytes, of the corresponding datatype.
+ *
+ * @param {IndexDatatype} indexDatatype The index datatype to get the size of.
+ * @returns {Number} The size in bytes.
+ *
+ * @example
+ * // Returns 2
+ * const size = Cesium.IndexDatatype.getSizeInBytes(Cesium.IndexDatatype.UNSIGNED_SHORT);
+ */
+ IndexDatatype.getSizeInBytes = function (indexDatatype) {
+ switch (indexDatatype) {
+ case IndexDatatype.UNSIGNED_BYTE:
+ return Uint8Array.BYTES_PER_ELEMENT;
+ case IndexDatatype.UNSIGNED_SHORT:
+ return Uint16Array.BYTES_PER_ELEMENT;
+ case IndexDatatype.UNSIGNED_INT:
+ return Uint32Array.BYTES_PER_ELEMENT;
+ }
+
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(
+ "indexDatatype is required and must be a valid IndexDatatype constant."
+ );
+ //>>includeEnd('debug');
+ };
+
+ /**
+ * Gets the datatype with a given size in bytes.
+ *
+ * @param {Number} sizeInBytes The size of a single index in bytes.
+ * @returns {IndexDatatype} The index datatype with the given size.
+ */
+ IndexDatatype.fromSizeInBytes = function (sizeInBytes) {
+ switch (sizeInBytes) {
+ case 2:
+ return IndexDatatype.UNSIGNED_SHORT;
+ case 4:
+ return IndexDatatype.UNSIGNED_INT;
+ case 1:
+ return IndexDatatype.UNSIGNED_BYTE;
+ //>>includeStart('debug', pragmas.debug);
+ default:
+ throw new Check.DeveloperError(
+ "Size in bytes cannot be mapped to an IndexDatatype"
+ );
+ //>>includeEnd('debug');
+ }
+ };
+
+ /**
+ * Validates that the provided index datatype is a valid {@link IndexDatatype}.
+ *
+ * @param {IndexDatatype} indexDatatype The index datatype to validate.
+ * @returns {Boolean} true
if the provided index datatype is a valid value; otherwise, false
.
+ *
+ * @example
+ * if (!Cesium.IndexDatatype.validate(indexDatatype)) {
+ * throw new Cesium.DeveloperError('indexDatatype must be a valid value.');
+ * }
+ */
+ IndexDatatype.validate = function (indexDatatype) {
+ return (
+ defaultValue.defined(indexDatatype) &&
+ (indexDatatype === IndexDatatype.UNSIGNED_BYTE ||
+ indexDatatype === IndexDatatype.UNSIGNED_SHORT ||
+ indexDatatype === IndexDatatype.UNSIGNED_INT)
+ );
+ };
+
+ /**
+ * Creates a typed array that will store indices, using either
+ * or Uint32Array
depending on the number of vertices.
+ *
+ * @param {Number} numberOfVertices Number of vertices that the indices will reference.
+ * @param {Number|Array} indicesLengthOrArray Passed through to the typed array constructor.
+ * @returns {Uint16Array|Uint32Array} A Uint16Array
or Uint32Array
constructed with indicesLengthOrArray
.
+ *
+ * @example
+ * this.indices = Cesium.IndexDatatype.createTypedArray(positions.length / 3, numberOfIndices);
+ */
+ IndexDatatype.createTypedArray = function (
+ numberOfVertices,
+ indicesLengthOrArray
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(numberOfVertices)) {
+ throw new Check.DeveloperError("numberOfVertices is required.");
+ }
+ //>>includeEnd('debug');
+
+ if (numberOfVertices >= Math.CesiumMath.SIXTY_FOUR_KILOBYTES) {
+ return new Uint32Array(indicesLengthOrArray);
+ }
+
+ return new Uint16Array(indicesLengthOrArray);
+ };
+
+ /**
+ * Creates a typed array from a source array buffer. The resulting typed array will store indices, using either
+ * or Uint32Array
depending on the number of vertices.
+ *
+ * @param {Number} numberOfVertices Number of vertices that the indices will reference.
+ * @param {ArrayBuffer} sourceArray Passed through to the typed array constructor.
+ * @param {Number} byteOffset Passed through to the typed array constructor.
+ * @param {Number} length Passed through to the typed array constructor.
+ * @returns {Uint16Array|Uint32Array} A Uint16Array
or Uint32Array
constructed with sourceArray
, byteOffset
, and length
.
+ *
+ */
+ IndexDatatype.createTypedArrayFromArrayBuffer = function (
+ numberOfVertices,
+ sourceArray,
+ byteOffset,
+ length
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(numberOfVertices)) {
+ throw new Check.DeveloperError("numberOfVertices is required.");
+ }
+ if (!defaultValue.defined(sourceArray)) {
+ throw new Check.DeveloperError("sourceArray is required.");
+ }
+ if (!defaultValue.defined(byteOffset)) {
+ throw new Check.DeveloperError("byteOffset is required.");
+ }
+ //>>includeEnd('debug');
+
+ if (numberOfVertices >= Math.CesiumMath.SIXTY_FOUR_KILOBYTES) {
+ return new Uint32Array(sourceArray, byteOffset, length);
+ }
+
+ return new Uint16Array(sourceArray, byteOffset, length);
+ };
+
+ /**
+ * Gets the {@link IndexDatatype} for the provided TypedArray instance.
+ *
+ * @param {Uint8Array|Uint16Array|Uint32Array} array The typed array.
+ * @returns {IndexDatatype} The IndexDatatype for the provided array, or undefined if the array is not a Uint8Array, Uint16Array, or Uint32Array.
+ */
+ IndexDatatype.fromTypedArray = function (array) {
+ if (array instanceof Uint8Array) {
+ return IndexDatatype.UNSIGNED_BYTE;
+ }
+ if (array instanceof Uint16Array) {
+ return IndexDatatype.UNSIGNED_SHORT;
+ }
+ if (array instanceof Uint32Array) {
+ return IndexDatatype.UNSIGNED_INT;
+ }
+
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(
+ "array must be a Uint8Array, Uint16Array, or Uint32Array."
+ );
+ //>>includeEnd('debug');
+ };
+
+ var IndexDatatype$1 = Object.freeze(IndexDatatype);
+
+ exports.IndexDatatype = IndexDatatype$1;
+
+}));
+//# sourceMappingURL=IndexDatatype-b4e5cf89.js.map
diff --git a/examples/cesium/Workers/IndexDatatype-b4e5cf89.js.map b/examples/cesium/Workers/IndexDatatype-b4e5cf89.js.map
new file mode 100644
index 0000000..dcd0578
--- /dev/null
+++ b/examples/cesium/Workers/IndexDatatype-b4e5cf89.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IndexDatatype-b4e5cf89.js","sources":["../../../Source/Core/IndexDatatype.js"],"sourcesContent":["import defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport WebGLConstants from \"./WebGLConstants.js\";\r\n\r\n/**\r\n * Constants for WebGL index datatypes. These corresponds to the\r\n * type
parameter of {@link http://www.khronos.org/opengles/sdk/docs/man/xhtml/glDrawElements.xml|drawElements}.\r\n *\r\n * @enum {Number}\r\n */\r\nconst IndexDatatype = {\r\n /**\r\n * 8-bit unsigned byte corresponding to UNSIGNED_BYTE
and the type\r\n * of an element in Uint8Array
.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE,\r\n\r\n /**\r\n * 16-bit unsigned short corresponding to UNSIGNED_SHORT
and the type\r\n * of an element in Uint16Array
.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n UNSIGNED_SHORT: WebGLConstants.UNSIGNED_SHORT,\r\n\r\n /**\r\n * 32-bit unsigned int corresponding to UNSIGNED_INT
and the type\r\n * of an element in Uint32Array
.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n UNSIGNED_INT: WebGLConstants.UNSIGNED_INT,\r\n};\r\n\r\n/**\r\n * Returns the size, in bytes, of the corresponding datatype.\r\n *\r\n * @param {IndexDatatype} indexDatatype The index datatype to get the size of.\r\n * @returns {Number} The size in bytes.\r\n *\r\n * @example\r\n * // Returns 2\r\n * const size = Cesium.IndexDatatype.getSizeInBytes(Cesium.IndexDatatype.UNSIGNED_SHORT);\r\n */\r\nIndexDatatype.getSizeInBytes = function (indexDatatype) {\r\n switch (indexDatatype) {\r\n case IndexDatatype.UNSIGNED_BYTE:\r\n return Uint8Array.BYTES_PER_ELEMENT;\r\n case IndexDatatype.UNSIGNED_SHORT:\r\n return Uint16Array.BYTES_PER_ELEMENT;\r\n case IndexDatatype.UNSIGNED_INT:\r\n return Uint32Array.BYTES_PER_ELEMENT;\r\n }\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(\r\n \"indexDatatype is required and must be a valid IndexDatatype constant.\"\r\n );\r\n //>>includeEnd('debug');\r\n};\r\n\r\n/**\r\n * Gets the datatype with a given size in bytes.\r\n *\r\n * @param {Number} sizeInBytes The size of a single index in bytes.\r\n * @returns {IndexDatatype} The index datatype with the given size.\r\n */\r\nIndexDatatype.fromSizeInBytes = function (sizeInBytes) {\r\n switch (sizeInBytes) {\r\n case 2:\r\n return IndexDatatype.UNSIGNED_SHORT;\r\n case 4:\r\n return IndexDatatype.UNSIGNED_INT;\r\n case 1:\r\n return IndexDatatype.UNSIGNED_BYTE;\r\n //>>includeStart('debug', pragmas.debug);\r\n default:\r\n throw new DeveloperError(\r\n \"Size in bytes cannot be mapped to an IndexDatatype\"\r\n );\r\n //>>includeEnd('debug');\r\n }\r\n};\r\n\r\n/**\r\n * Validates that the provided index datatype is a valid {@link IndexDatatype}.\r\n *\r\n * @param {IndexDatatype} indexDatatype The index datatype to validate.\r\n * @returns {Boolean} true
if the provided index datatype is a valid value; otherwise, false
.\r\n *\r\n * @example\r\n * if (!Cesium.IndexDatatype.validate(indexDatatype)) {\r\n * throw new Cesium.DeveloperError('indexDatatype must be a valid value.');\r\n * }\r\n */\r\nIndexDatatype.validate = function (indexDatatype) {\r\n return (\r\n defined(indexDatatype) &&\r\n (indexDatatype === IndexDatatype.UNSIGNED_BYTE ||\r\n indexDatatype === IndexDatatype.UNSIGNED_SHORT ||\r\n indexDatatype === IndexDatatype.UNSIGNED_INT)\r\n );\r\n};\r\n\r\n/**\r\n * Creates a typed array that will store indices, using either \r\n * or Uint32Array
depending on the number of vertices.\r\n *\r\n * @param {Number} numberOfVertices Number of vertices that the indices will reference.\r\n * @param {Number|Array} indicesLengthOrArray Passed through to the typed array constructor.\r\n * @returns {Uint16Array|Uint32Array} A Uint16Array
or Uint32Array
constructed with indicesLengthOrArray
.\r\n *\r\n * @example\r\n * this.indices = Cesium.IndexDatatype.createTypedArray(positions.length / 3, numberOfIndices);\r\n */\r\nIndexDatatype.createTypedArray = function (\r\n numberOfVertices,\r\n indicesLengthOrArray\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(numberOfVertices)) {\r\n throw new DeveloperError(\"numberOfVertices is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (numberOfVertices >= CesiumMath.SIXTY_FOUR_KILOBYTES) {\r\n return new Uint32Array(indicesLengthOrArray);\r\n }\r\n\r\n return new Uint16Array(indicesLengthOrArray);\r\n};\r\n\r\n/**\r\n * Creates a typed array from a source array buffer. The resulting typed array will store indices, using either \r\n * or Uint32Array
depending on the number of vertices.\r\n *\r\n * @param {Number} numberOfVertices Number of vertices that the indices will reference.\r\n * @param {ArrayBuffer} sourceArray Passed through to the typed array constructor.\r\n * @param {Number} byteOffset Passed through to the typed array constructor.\r\n * @param {Number} length Passed through to the typed array constructor.\r\n * @returns {Uint16Array|Uint32Array} A Uint16Array
or Uint32Array
constructed with sourceArray
, byteOffset
, and length
.\r\n *\r\n */\r\nIndexDatatype.createTypedArrayFromArrayBuffer = function (\r\n numberOfVertices,\r\n sourceArray,\r\n byteOffset,\r\n length\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(numberOfVertices)) {\r\n throw new DeveloperError(\"numberOfVertices is required.\");\r\n }\r\n if (!defined(sourceArray)) {\r\n throw new DeveloperError(\"sourceArray is required.\");\r\n }\r\n if (!defined(byteOffset)) {\r\n throw new DeveloperError(\"byteOffset is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (numberOfVertices >= CesiumMath.SIXTY_FOUR_KILOBYTES) {\r\n return new Uint32Array(sourceArray, byteOffset, length);\r\n }\r\n\r\n return new Uint16Array(sourceArray, byteOffset, length);\r\n};\r\n\r\n/**\r\n * Gets the {@link IndexDatatype} for the provided TypedArray instance.\r\n *\r\n * @param {Uint8Array|Uint16Array|Uint32Array} array The typed array.\r\n * @returns {IndexDatatype} The IndexDatatype for the provided array, or undefined if the array is not a Uint8Array, Uint16Array, or Uint32Array.\r\n */\r\nIndexDatatype.fromTypedArray = function (array) {\r\n if (array instanceof Uint8Array) {\r\n return IndexDatatype.UNSIGNED_BYTE;\r\n }\r\n if (array instanceof Uint16Array) {\r\n return IndexDatatype.UNSIGNED_SHORT;\r\n }\r\n if (array instanceof Uint32Array) {\r\n return IndexDatatype.UNSIGNED_INT;\r\n }\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(\r\n \"array must be a Uint8Array, Uint16Array, or Uint32Array.\"\r\n );\r\n //>>includeEnd('debug');\r\n};\r\n\r\nexport default Object.freeze(IndexDatatype);\r\n"],"names":["WebGLConstants","DeveloperError","defined","CesiumMath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,aAAa,GAA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,CAAC,EAAE;EAC5B,IAAI,MAAM,IAAID,oBAAc,CAAC,yBAAyB,CAAC,CAAC;EACxD,GAAG;EACH;AACA;EACA,EAAE,IAAI,gBAAgB,IAAIE,eAAU,CAAC,oBAAoB,EAAE;EAC3D,IAAI,OAAO,IAAI,WAAW,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;EAC5D,GAAG;AACH;EACA,EAAE,OAAO,IAAI,WAAW,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;EAC1D,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA,aAAa,CAAC,cAAc,GAAG,UAAU,KAAK,EAAE;EAChD,EAAE,IAAI,KAAK,YAAY,UAAU,EAAE;EACnC,IAAI,OAAO,aAAa,CAAC,aAAa,CAAC;EACvC,GAAG;EACH,EAAE,IAAI,KAAK,YAAY,WAAW,EAAE;EACpC,IAAI,OAAO,aAAa,CAAC,cAAc,CAAC;EACxC,GAAG;EACH,EAAE,IAAI,KAAK,YAAY,WAAW,EAAE;EACpC,IAAI,OAAO,aAAa,CAAC,YAAY,CAAC;EACtC,GAAG;AACH;EACA;EACA,EAAE,MAAM,IAAIF,oBAAc;EAC1B,IAAI,0DAA0D;EAC9D,GAAG,CAAC;EACJ;EACA,CAAC,CAAC;AACF;AACA,wBAAe,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/IntersectionTests-2c7928de.js b/examples/cesium/Workers/IntersectionTests-2c7928de.js
new file mode 100644
index 0000000..ae38750
--- /dev/null
+++ b/examples/cesium/Workers/IntersectionTests-2c7928de.js
@@ -0,0 +1,1862 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './defaultValue-0ab18f7d', './Check-d10e5f2e', './Transforms-11fb6b0a', './Math-9be8b918'], (function (exports, Matrix3, defaultValue, Check, Transforms, Math$1) { 'use strict';
+
+ /**
+ * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.
+ *
+ * @namespace QuadraticRealPolynomial
+ */
+ const QuadraticRealPolynomial = {};
+
+ /**
+ * Provides the discriminant of the quadratic equation from the supplied coefficients.
+ *
+ * @param {Number} a The coefficient of the 2nd order monomial.
+ * @param {Number} b The coefficient of the 1st order monomial.
+ * @param {Number} c The coefficient of the 0th order monomial.
+ * @returns {Number} The value of the discriminant.
+ */
+ QuadraticRealPolynomial.computeDiscriminant = function (a, b, c) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof a !== "number") {
+ throw new Check.DeveloperError("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new Check.DeveloperError("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new Check.DeveloperError("c is a required number.");
+ }
+ //>>includeEnd('debug');
+
+ const discriminant = b * b - 4.0 * a * c;
+ return discriminant;
+ };
+
+ function addWithCancellationCheck$1(left, right, tolerance) {
+ const difference = left + right;
+ if (
+ Math$1.CesiumMath.sign(left) !== Math$1.CesiumMath.sign(right) &&
+ Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance
+ ) {
+ return 0.0;
+ }
+
+ return difference;
+ }
+
+ /**
+ * Provides the real valued roots of the quadratic polynomial with the provided coefficients.
+ *
+ * @param {Number} a The coefficient of the 2nd order monomial.
+ * @param {Number} b The coefficient of the 1st order monomial.
+ * @param {Number} c The coefficient of the 0th order monomial.
+ * @returns {Number[]} The real valued roots.
+ */
+ QuadraticRealPolynomial.computeRealRoots = function (a, b, c) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof a !== "number") {
+ throw new Check.DeveloperError("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new Check.DeveloperError("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new Check.DeveloperError("c is a required number.");
+ }
+ //>>includeEnd('debug');
+
+ let ratio;
+ if (a === 0.0) {
+ if (b === 0.0) {
+ // Constant function: c = 0.
+ return [];
+ }
+
+ // Linear function: b * x + c = 0.
+ return [-c / b];
+ } else if (b === 0.0) {
+ if (c === 0.0) {
+ // 2nd order monomial: a * x^2 = 0.
+ return [0.0, 0.0];
+ }
+
+ const cMagnitude = Math.abs(c);
+ const aMagnitude = Math.abs(a);
+
+ if (
+ cMagnitude < aMagnitude &&
+ cMagnitude / aMagnitude < Math$1.CesiumMath.EPSILON14
+ ) {
+ // c ~= 0.0.
+ // 2nd order monomial: a * x^2 = 0.
+ return [0.0, 0.0];
+ } else if (
+ cMagnitude > aMagnitude &&
+ aMagnitude / cMagnitude < Math$1.CesiumMath.EPSILON14
+ ) {
+ // a ~= 0.0.
+ // Constant function: c = 0.
+ return [];
+ }
+
+ // a * x^2 + c = 0
+ ratio = -c / a;
+
+ if (ratio < 0.0) {
+ // Both roots are complex.
+ return [];
+ }
+
+ // Both roots are real.
+ const root = Math.sqrt(ratio);
+ return [-root, root];
+ } else if (c === 0.0) {
+ // a * x^2 + b * x = 0
+ ratio = -b / a;
+ if (ratio < 0.0) {
+ return [ratio, 0.0];
+ }
+
+ return [0.0, ratio];
+ }
+
+ // a * x^2 + b * x + c = 0
+ const b2 = b * b;
+ const four_ac = 4.0 * a * c;
+ const radicand = addWithCancellationCheck$1(b2, -four_ac, Math$1.CesiumMath.EPSILON14);
+
+ if (radicand < 0.0) {
+ // Both roots are complex.
+ return [];
+ }
+
+ const q =
+ -0.5 *
+ addWithCancellationCheck$1(
+ b,
+ Math$1.CesiumMath.sign(b) * Math.sqrt(radicand),
+ Math$1.CesiumMath.EPSILON14
+ );
+ if (b > 0.0) {
+ return [q / a, c / q];
+ }
+
+ return [c / q, q / a];
+ };
+ var QuadraticRealPolynomial$1 = QuadraticRealPolynomial;
+
+ /**
+ * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.
+ *
+ * @namespace CubicRealPolynomial
+ */
+ const CubicRealPolynomial = {};
+
+ /**
+ * Provides the discriminant of the cubic equation from the supplied coefficients.
+ *
+ * @param {Number} a The coefficient of the 3rd order monomial.
+ * @param {Number} b The coefficient of the 2nd order monomial.
+ * @param {Number} c The coefficient of the 1st order monomial.
+ * @param {Number} d The coefficient of the 0th order monomial.
+ * @returns {Number} The value of the discriminant.
+ */
+ CubicRealPolynomial.computeDiscriminant = function (a, b, c, d) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof a !== "number") {
+ throw new Check.DeveloperError("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new Check.DeveloperError("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new Check.DeveloperError("c is a required number.");
+ }
+ if (typeof d !== "number") {
+ throw new Check.DeveloperError("d is a required number.");
+ }
+ //>>includeEnd('debug');
+
+ const a2 = a * a;
+ const b2 = b * b;
+ const c2 = c * c;
+ const d2 = d * d;
+
+ const discriminant =
+ 18.0 * a * b * c * d +
+ b2 * c2 -
+ 27.0 * a2 * d2 -
+ 4.0 * (a * c2 * c + b2 * b * d);
+ return discriminant;
+ };
+
+ function computeRealRoots(a, b, c, d) {
+ const A = a;
+ const B = b / 3.0;
+ const C = c / 3.0;
+ const D = d;
+
+ const AC = A * C;
+ const BD = B * D;
+ const B2 = B * B;
+ const C2 = C * C;
+ const delta1 = A * C - B2;
+ const delta2 = A * D - B * C;
+ const delta3 = B * D - C2;
+
+ const discriminant = 4.0 * delta1 * delta3 - delta2 * delta2;
+ let temp;
+ let temp1;
+
+ if (discriminant < 0.0) {
+ let ABar;
+ let CBar;
+ let DBar;
+
+ if (B2 * BD >= AC * C2) {
+ ABar = A;
+ CBar = delta1;
+ DBar = -2.0 * B * delta1 + A * delta2;
+ } else {
+ ABar = D;
+ CBar = delta3;
+ DBar = -D * delta2 + 2.0 * C * delta3;
+ }
+
+ const s = DBar < 0.0 ? -1.0 : 1.0; // This is not Math.Sign()!
+ const temp0 = -s * Math.abs(ABar) * Math.sqrt(-discriminant);
+ temp1 = -DBar + temp0;
+
+ const x = temp1 / 2.0;
+ const p = x < 0.0 ? -Math.pow(-x, 1.0 / 3.0) : Math.pow(x, 1.0 / 3.0);
+ const q = temp1 === temp0 ? -p : -CBar / p;
+
+ temp = CBar <= 0.0 ? p + q : -DBar / (p * p + q * q + CBar);
+
+ if (B2 * BD >= AC * C2) {
+ return [(temp - B) / A];
+ }
+
+ return [-D / (temp + C)];
+ }
+
+ const CBarA = delta1;
+ const DBarA = -2.0 * B * delta1 + A * delta2;
+
+ const CBarD = delta3;
+ const DBarD = -D * delta2 + 2.0 * C * delta3;
+
+ const squareRootOfDiscriminant = Math.sqrt(discriminant);
+ const halfSquareRootOf3 = Math.sqrt(3.0) / 2.0;
+
+ let theta = Math.abs(Math.atan2(A * squareRootOfDiscriminant, -DBarA) / 3.0);
+ temp = 2.0 * Math.sqrt(-CBarA);
+ let cosine = Math.cos(theta);
+ temp1 = temp * cosine;
+ let temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));
+
+ const numeratorLarge = temp1 + temp3 > 2.0 * B ? temp1 - B : temp3 - B;
+ const denominatorLarge = A;
+
+ const root1 = numeratorLarge / denominatorLarge;
+
+ theta = Math.abs(Math.atan2(D * squareRootOfDiscriminant, -DBarD) / 3.0);
+ temp = 2.0 * Math.sqrt(-CBarD);
+ cosine = Math.cos(theta);
+ temp1 = temp * cosine;
+ temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));
+
+ const numeratorSmall = -D;
+ const denominatorSmall = temp1 + temp3 < 2.0 * C ? temp1 + C : temp3 + C;
+
+ const root3 = numeratorSmall / denominatorSmall;
+
+ const E = denominatorLarge * denominatorSmall;
+ const F =
+ -numeratorLarge * denominatorSmall - denominatorLarge * numeratorSmall;
+ const G = numeratorLarge * numeratorSmall;
+
+ const root2 = (C * F - B * G) / (-B * F + C * E);
+
+ if (root1 <= root2) {
+ if (root1 <= root3) {
+ if (root2 <= root3) {
+ return [root1, root2, root3];
+ }
+ return [root1, root3, root2];
+ }
+ return [root3, root1, root2];
+ }
+ if (root1 <= root3) {
+ return [root2, root1, root3];
+ }
+ if (root2 <= root3) {
+ return [root2, root3, root1];
+ }
+ return [root3, root2, root1];
+ }
+
+ /**
+ * Provides the real valued roots of the cubic polynomial with the provided coefficients.
+ *
+ * @param {Number} a The coefficient of the 3rd order monomial.
+ * @param {Number} b The coefficient of the 2nd order monomial.
+ * @param {Number} c The coefficient of the 1st order monomial.
+ * @param {Number} d The coefficient of the 0th order monomial.
+ * @returns {Number[]} The real valued roots.
+ */
+ CubicRealPolynomial.computeRealRoots = function (a, b, c, d) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof a !== "number") {
+ throw new Check.DeveloperError("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new Check.DeveloperError("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new Check.DeveloperError("c is a required number.");
+ }
+ if (typeof d !== "number") {
+ throw new Check.DeveloperError("d is a required number.");
+ }
+ //>>includeEnd('debug');
+
+ let roots;
+ let ratio;
+ if (a === 0.0) {
+ // Quadratic function: b * x^2 + c * x + d = 0.
+ return QuadraticRealPolynomial$1.computeRealRoots(b, c, d);
+ } else if (b === 0.0) {
+ if (c === 0.0) {
+ if (d === 0.0) {
+ // 3rd order monomial: a * x^3 = 0.
+ return [0.0, 0.0, 0.0];
+ }
+
+ // a * x^3 + d = 0
+ ratio = -d / a;
+ const root =
+ ratio < 0.0 ? -Math.pow(-ratio, 1.0 / 3.0) : Math.pow(ratio, 1.0 / 3.0);
+ return [root, root, root];
+ } else if (d === 0.0) {
+ // x * (a * x^2 + c) = 0.
+ roots = QuadraticRealPolynomial$1.computeRealRoots(a, 0, c);
+
+ // Return the roots in ascending order.
+ if (roots.Length === 0) {
+ return [0.0];
+ }
+ return [roots[0], 0.0, roots[1]];
+ }
+
+ // Deflated cubic polynomial: a * x^3 + c * x + d= 0.
+ return computeRealRoots(a, 0, c, d);
+ } else if (c === 0.0) {
+ if (d === 0.0) {
+ // x^2 * (a * x + b) = 0.
+ ratio = -b / a;
+ if (ratio < 0.0) {
+ return [ratio, 0.0, 0.0];
+ }
+ return [0.0, 0.0, ratio];
+ }
+ // a * x^3 + b * x^2 + d = 0.
+ return computeRealRoots(a, b, 0, d);
+ } else if (d === 0.0) {
+ // x * (a * x^2 + b * x + c) = 0
+ roots = QuadraticRealPolynomial$1.computeRealRoots(a, b, c);
+
+ // Return the roots in ascending order.
+ if (roots.length === 0) {
+ return [0.0];
+ } else if (roots[1] <= 0.0) {
+ return [roots[0], roots[1], 0.0];
+ } else if (roots[0] >= 0.0) {
+ return [0.0, roots[0], roots[1]];
+ }
+ return [roots[0], 0.0, roots[1]];
+ }
+
+ return computeRealRoots(a, b, c, d);
+ };
+ var CubicRealPolynomial$1 = CubicRealPolynomial;
+
+ /**
+ * Defines functions for 4th order polynomial functions of one variable with only real coefficients.
+ *
+ * @namespace QuarticRealPolynomial
+ */
+ const QuarticRealPolynomial = {};
+
+ /**
+ * Provides the discriminant of the quartic equation from the supplied coefficients.
+ *
+ * @param {Number} a The coefficient of the 4th order monomial.
+ * @param {Number} b The coefficient of the 3rd order monomial.
+ * @param {Number} c The coefficient of the 2nd order monomial.
+ * @param {Number} d The coefficient of the 1st order monomial.
+ * @param {Number} e The coefficient of the 0th order monomial.
+ * @returns {Number} The value of the discriminant.
+ */
+ QuarticRealPolynomial.computeDiscriminant = function (a, b, c, d, e) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof a !== "number") {
+ throw new Check.DeveloperError("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new Check.DeveloperError("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new Check.DeveloperError("c is a required number.");
+ }
+ if (typeof d !== "number") {
+ throw new Check.DeveloperError("d is a required number.");
+ }
+ if (typeof e !== "number") {
+ throw new Check.DeveloperError("e is a required number.");
+ }
+ //>>includeEnd('debug');
+
+ const a2 = a * a;
+ const a3 = a2 * a;
+ const b2 = b * b;
+ const b3 = b2 * b;
+ const c2 = c * c;
+ const c3 = c2 * c;
+ const d2 = d * d;
+ const d3 = d2 * d;
+ const e2 = e * e;
+ const e3 = e2 * e;
+
+ const discriminant =
+ b2 * c2 * d2 -
+ 4.0 * b3 * d3 -
+ 4.0 * a * c3 * d2 +
+ 18 * a * b * c * d3 -
+ 27.0 * a2 * d2 * d2 +
+ 256.0 * a3 * e3 +
+ e *
+ (18.0 * b3 * c * d -
+ 4.0 * b2 * c3 +
+ 16.0 * a * c2 * c2 -
+ 80.0 * a * b * c2 * d -
+ 6.0 * a * b2 * d2 +
+ 144.0 * a2 * c * d2) +
+ e2 *
+ (144.0 * a * b2 * c -
+ 27.0 * b2 * b2 -
+ 128.0 * a2 * c2 -
+ 192.0 * a2 * b * d);
+ return discriminant;
+ };
+
+ function original(a3, a2, a1, a0) {
+ const a3Squared = a3 * a3;
+
+ const p = a2 - (3.0 * a3Squared) / 8.0;
+ const q = a1 - (a2 * a3) / 2.0 + (a3Squared * a3) / 8.0;
+ const r =
+ a0 -
+ (a1 * a3) / 4.0 +
+ (a2 * a3Squared) / 16.0 -
+ (3.0 * a3Squared * a3Squared) / 256.0;
+
+ // Find the roots of the cubic equations: h^6 + 2 p h^4 + (p^2 - 4 r) h^2 - q^2 = 0.
+ const cubicRoots = CubicRealPolynomial$1.computeRealRoots(
+ 1.0,
+ 2.0 * p,
+ p * p - 4.0 * r,
+ -q * q
+ );
+
+ if (cubicRoots.length > 0) {
+ const temp = -a3 / 4.0;
+
+ // Use the largest positive root.
+ const hSquared = cubicRoots[cubicRoots.length - 1];
+
+ if (Math.abs(hSquared) < Math$1.CesiumMath.EPSILON14) {
+ // y^4 + p y^2 + r = 0.
+ const roots = QuadraticRealPolynomial$1.computeRealRoots(1.0, p, r);
+
+ if (roots.length === 2) {
+ const root0 = roots[0];
+ const root1 = roots[1];
+
+ let y;
+ if (root0 >= 0.0 && root1 >= 0.0) {
+ const y0 = Math.sqrt(root0);
+ const y1 = Math.sqrt(root1);
+
+ return [temp - y1, temp - y0, temp + y0, temp + y1];
+ } else if (root0 >= 0.0 && root1 < 0.0) {
+ y = Math.sqrt(root0);
+ return [temp - y, temp + y];
+ } else if (root0 < 0.0 && root1 >= 0.0) {
+ y = Math.sqrt(root1);
+ return [temp - y, temp + y];
+ }
+ }
+ return [];
+ } else if (hSquared > 0.0) {
+ const h = Math.sqrt(hSquared);
+
+ const m = (p + hSquared - q / h) / 2.0;
+ const n = (p + hSquared + q / h) / 2.0;
+
+ // Now solve the two quadratic factors: (y^2 + h y + m)(y^2 - h y + n);
+ const roots1 = QuadraticRealPolynomial$1.computeRealRoots(1.0, h, m);
+ const roots2 = QuadraticRealPolynomial$1.computeRealRoots(1.0, -h, n);
+
+ if (roots1.length !== 0) {
+ roots1[0] += temp;
+ roots1[1] += temp;
+
+ if (roots2.length !== 0) {
+ roots2[0] += temp;
+ roots2[1] += temp;
+
+ if (roots1[1] <= roots2[0]) {
+ return [roots1[0], roots1[1], roots2[0], roots2[1]];
+ } else if (roots2[1] <= roots1[0]) {
+ return [roots2[0], roots2[1], roots1[0], roots1[1]];
+ } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {
+ return [roots2[0], roots1[0], roots1[1], roots2[1]];
+ } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {
+ return [roots1[0], roots2[0], roots2[1], roots1[1]];
+ } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {
+ return [roots2[0], roots1[0], roots2[1], roots1[1]];
+ }
+ return [roots1[0], roots2[0], roots1[1], roots2[1]];
+ }
+ return roots1;
+ }
+
+ if (roots2.length !== 0) {
+ roots2[0] += temp;
+ roots2[1] += temp;
+
+ return roots2;
+ }
+ return [];
+ }
+ }
+ return [];
+ }
+
+ function neumark(a3, a2, a1, a0) {
+ const a1Squared = a1 * a1;
+ const a2Squared = a2 * a2;
+ const a3Squared = a3 * a3;
+
+ const p = -2.0 * a2;
+ const q = a1 * a3 + a2Squared - 4.0 * a0;
+ const r = a3Squared * a0 - a1 * a2 * a3 + a1Squared;
+
+ const cubicRoots = CubicRealPolynomial$1.computeRealRoots(1.0, p, q, r);
+
+ if (cubicRoots.length > 0) {
+ // Use the most positive root
+ const y = cubicRoots[0];
+
+ const temp = a2 - y;
+ const tempSquared = temp * temp;
+
+ const g1 = a3 / 2.0;
+ const h1 = temp / 2.0;
+
+ const m = tempSquared - 4.0 * a0;
+ const mError = tempSquared + 4.0 * Math.abs(a0);
+
+ const n = a3Squared - 4.0 * y;
+ const nError = a3Squared + 4.0 * Math.abs(y);
+
+ let g2;
+ let h2;
+
+ if (y < 0.0 || m * nError < n * mError) {
+ const squareRootOfN = Math.sqrt(n);
+ g2 = squareRootOfN / 2.0;
+ h2 = squareRootOfN === 0.0 ? 0.0 : (a3 * h1 - a1) / squareRootOfN;
+ } else {
+ const squareRootOfM = Math.sqrt(m);
+ g2 = squareRootOfM === 0.0 ? 0.0 : (a3 * h1 - a1) / squareRootOfM;
+ h2 = squareRootOfM / 2.0;
+ }
+
+ let G;
+ let g;
+ if (g1 === 0.0 && g2 === 0.0) {
+ G = 0.0;
+ g = 0.0;
+ } else if (Math$1.CesiumMath.sign(g1) === Math$1.CesiumMath.sign(g2)) {
+ G = g1 + g2;
+ g = y / G;
+ } else {
+ g = g1 - g2;
+ G = y / g;
+ }
+
+ let H;
+ let h;
+ if (h1 === 0.0 && h2 === 0.0) {
+ H = 0.0;
+ h = 0.0;
+ } else if (Math$1.CesiumMath.sign(h1) === Math$1.CesiumMath.sign(h2)) {
+ H = h1 + h2;
+ h = a0 / H;
+ } else {
+ h = h1 - h2;
+ H = a0 / h;
+ }
+
+ // Now solve the two quadratic factors: (y^2 + G y + H)(y^2 + g y + h);
+ const roots1 = QuadraticRealPolynomial$1.computeRealRoots(1.0, G, H);
+ const roots2 = QuadraticRealPolynomial$1.computeRealRoots(1.0, g, h);
+
+ if (roots1.length !== 0) {
+ if (roots2.length !== 0) {
+ if (roots1[1] <= roots2[0]) {
+ return [roots1[0], roots1[1], roots2[0], roots2[1]];
+ } else if (roots2[1] <= roots1[0]) {
+ return [roots2[0], roots2[1], roots1[0], roots1[1]];
+ } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {
+ return [roots2[0], roots1[0], roots1[1], roots2[1]];
+ } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {
+ return [roots1[0], roots2[0], roots2[1], roots1[1]];
+ } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {
+ return [roots2[0], roots1[0], roots2[1], roots1[1]];
+ }
+ return [roots1[0], roots2[0], roots1[1], roots2[1]];
+ }
+ return roots1;
+ }
+ if (roots2.length !== 0) {
+ return roots2;
+ }
+ }
+ return [];
+ }
+
+ /**
+ * Provides the real valued roots of the quartic polynomial with the provided coefficients.
+ *
+ * @param {Number} a The coefficient of the 4th order monomial.
+ * @param {Number} b The coefficient of the 3rd order monomial.
+ * @param {Number} c The coefficient of the 2nd order monomial.
+ * @param {Number} d The coefficient of the 1st order monomial.
+ * @param {Number} e The coefficient of the 0th order monomial.
+ * @returns {Number[]} The real valued roots.
+ */
+ QuarticRealPolynomial.computeRealRoots = function (a, b, c, d, e) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof a !== "number") {
+ throw new Check.DeveloperError("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new Check.DeveloperError("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new Check.DeveloperError("c is a required number.");
+ }
+ if (typeof d !== "number") {
+ throw new Check.DeveloperError("d is a required number.");
+ }
+ if (typeof e !== "number") {
+ throw new Check.DeveloperError("e is a required number.");
+ }
+ //>>includeEnd('debug');
+
+ if (Math.abs(a) < Math$1.CesiumMath.EPSILON15) {
+ return CubicRealPolynomial$1.computeRealRoots(b, c, d, e);
+ }
+ const a3 = b / a;
+ const a2 = c / a;
+ const a1 = d / a;
+ const a0 = e / a;
+
+ let k = a3 < 0.0 ? 1 : 0;
+ k += a2 < 0.0 ? k + 1 : k;
+ k += a1 < 0.0 ? k + 1 : k;
+ k += a0 < 0.0 ? k + 1 : k;
+
+ switch (k) {
+ case 0:
+ return original(a3, a2, a1, a0);
+ case 1:
+ return neumark(a3, a2, a1, a0);
+ case 2:
+ return neumark(a3, a2, a1, a0);
+ case 3:
+ return original(a3, a2, a1, a0);
+ case 4:
+ return original(a3, a2, a1, a0);
+ case 5:
+ return neumark(a3, a2, a1, a0);
+ case 6:
+ return original(a3, a2, a1, a0);
+ case 7:
+ return original(a3, a2, a1, a0);
+ case 8:
+ return neumark(a3, a2, a1, a0);
+ case 9:
+ return original(a3, a2, a1, a0);
+ case 10:
+ return original(a3, a2, a1, a0);
+ case 11:
+ return neumark(a3, a2, a1, a0);
+ case 12:
+ return original(a3, a2, a1, a0);
+ case 13:
+ return original(a3, a2, a1, a0);
+ case 14:
+ return original(a3, a2, a1, a0);
+ case 15:
+ return original(a3, a2, a1, a0);
+ default:
+ return undefined;
+ }
+ };
+ var QuarticRealPolynomial$1 = QuarticRealPolynomial;
+
+ /**
+ * Represents a ray that extends infinitely from the provided origin in the provided direction.
+ * @alias Ray
+ * @constructor
+ *
+ * @param {Cartesian3} [origin=Cartesian3.ZERO] The origin of the ray.
+ * @param {Cartesian3} [direction=Cartesian3.ZERO] The direction of the ray.
+ */
+ function Ray(origin, direction) {
+ direction = Matrix3.Cartesian3.clone(defaultValue.defaultValue(direction, Matrix3.Cartesian3.ZERO));
+ if (!Matrix3.Cartesian3.equals(direction, Matrix3.Cartesian3.ZERO)) {
+ Matrix3.Cartesian3.normalize(direction, direction);
+ }
+
+ /**
+ * The origin of the ray.
+ * @type {Cartesian3}
+ * @default {@link Cartesian3.ZERO}
+ */
+ this.origin = Matrix3.Cartesian3.clone(defaultValue.defaultValue(origin, Matrix3.Cartesian3.ZERO));
+
+ /**
+ * The direction of the ray.
+ * @type {Cartesian3}
+ */
+ this.direction = direction;
+ }
+
+ /**
+ * Duplicates a Ray instance.
+ *
+ * @param {Ray} ray The ray to duplicate.
+ * @param {Ray} [result] The object onto which to store the result.
+ * @returns {Ray} The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)
+ */
+ Ray.clone = function (ray, result) {
+ if (!defaultValue.defined(ray)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ return new Ray(ray.origin, ray.direction);
+ }
+ result.origin = Matrix3.Cartesian3.clone(ray.origin);
+ result.direction = Matrix3.Cartesian3.clone(ray.direction);
+ return result;
+ };
+
+ /**
+ * Computes the point along the ray given by r(t) = o + t*d,
+ * where o is the origin of the ray and d is the direction.
+ *
+ * @param {Ray} ray The ray.
+ * @param {Number} t A scalar value.
+ * @param {Cartesian3} [result] The object in which the result will be stored.
+ * @returns {Cartesian3} The modified result parameter, or a new instance if none was provided.
+ *
+ * @example
+ * //Get the first intersection point of a ray and an ellipsoid.
+ * const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);
+ * const point = Cesium.Ray.getPoint(ray, intersection.start);
+ */
+ Ray.getPoint = function (ray, t, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("ray", ray);
+ Check.Check.typeOf.number("t", t);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ result = Matrix3.Cartesian3.multiplyByScalar(ray.direction, t, result);
+ return Matrix3.Cartesian3.add(ray.origin, result, result);
+ };
+
+ /**
+ * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.
+ *
+ * @namespace IntersectionTests
+ */
+ const IntersectionTests = {};
+
+ /**
+ * Computes the intersection of a ray and a plane.
+ *
+ * @param {Ray} ray The ray.
+ * @param {Plane} plane The plane.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The intersection point or undefined if there is no intersections.
+ */
+ IntersectionTests.rayPlane = function (ray, plane, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(ray)) {
+ throw new Check.DeveloperError("ray is required.");
+ }
+ if (!defaultValue.defined(plane)) {
+ throw new Check.DeveloperError("plane is required.");
+ }
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ const origin = ray.origin;
+ const direction = ray.direction;
+ const normal = plane.normal;
+ const denominator = Matrix3.Cartesian3.dot(normal, direction);
+
+ if (Math.abs(denominator) < Math$1.CesiumMath.EPSILON15) {
+ // Ray is parallel to plane. The ray may be in the polygon's plane.
+ return undefined;
+ }
+
+ const t = (-plane.distance - Matrix3.Cartesian3.dot(normal, origin)) / denominator;
+
+ if (t < 0) {
+ return undefined;
+ }
+
+ result = Matrix3.Cartesian3.multiplyByScalar(direction, t, result);
+ return Matrix3.Cartesian3.add(origin, result, result);
+ };
+
+ const scratchEdge0 = new Matrix3.Cartesian3();
+ const scratchEdge1 = new Matrix3.Cartesian3();
+ const scratchPVec = new Matrix3.Cartesian3();
+ const scratchTVec = new Matrix3.Cartesian3();
+ const scratchQVec = new Matrix3.Cartesian3();
+
+ /**
+ * Computes the intersection of a ray and a triangle as a parametric distance along the input ray. The result is negative when the triangle is behind the ray.
+ *
+ * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
+ * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
+ *
+ * @memberof IntersectionTests
+ *
+ * @param {Ray} ray The ray.
+ * @param {Cartesian3} p0 The first vertex of the triangle.
+ * @param {Cartesian3} p1 The second vertex of the triangle.
+ * @param {Cartesian3} p2 The third vertex of the triangle.
+ * @param {Boolean} [cullBackFaces=false] If true
, will only compute an intersection with the front face of the triangle
+ * and return undefined for intersections with the back face.
+ * @returns {Number} The intersection as a parametric distance along the ray, or undefined if there is no intersection.
+ */
+ IntersectionTests.rayTriangleParametric = function (
+ ray,
+ p0,
+ p1,
+ p2,
+ cullBackFaces
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(ray)) {
+ throw new Check.DeveloperError("ray is required.");
+ }
+ if (!defaultValue.defined(p0)) {
+ throw new Check.DeveloperError("p0 is required.");
+ }
+ if (!defaultValue.defined(p1)) {
+ throw new Check.DeveloperError("p1 is required.");
+ }
+ if (!defaultValue.defined(p2)) {
+ throw new Check.DeveloperError("p2 is required.");
+ }
+ //>>includeEnd('debug');
+
+ cullBackFaces = defaultValue.defaultValue(cullBackFaces, false);
+
+ const origin = ray.origin;
+ const direction = ray.direction;
+
+ const edge0 = Matrix3.Cartesian3.subtract(p1, p0, scratchEdge0);
+ const edge1 = Matrix3.Cartesian3.subtract(p2, p0, scratchEdge1);
+
+ const p = Matrix3.Cartesian3.cross(direction, edge1, scratchPVec);
+ const det = Matrix3.Cartesian3.dot(edge0, p);
+
+ let tvec;
+ let q;
+
+ let u;
+ let v;
+ let t;
+
+ if (cullBackFaces) {
+ if (det < Math$1.CesiumMath.EPSILON6) {
+ return undefined;
+ }
+
+ tvec = Matrix3.Cartesian3.subtract(origin, p0, scratchTVec);
+ u = Matrix3.Cartesian3.dot(tvec, p);
+ if (u < 0.0 || u > det) {
+ return undefined;
+ }
+
+ q = Matrix3.Cartesian3.cross(tvec, edge0, scratchQVec);
+
+ v = Matrix3.Cartesian3.dot(direction, q);
+ if (v < 0.0 || u + v > det) {
+ return undefined;
+ }
+
+ t = Matrix3.Cartesian3.dot(edge1, q) / det;
+ } else {
+ if (Math.abs(det) < Math$1.CesiumMath.EPSILON6) {
+ return undefined;
+ }
+ const invDet = 1.0 / det;
+
+ tvec = Matrix3.Cartesian3.subtract(origin, p0, scratchTVec);
+ u = Matrix3.Cartesian3.dot(tvec, p) * invDet;
+ if (u < 0.0 || u > 1.0) {
+ return undefined;
+ }
+
+ q = Matrix3.Cartesian3.cross(tvec, edge0, scratchQVec);
+
+ v = Matrix3.Cartesian3.dot(direction, q) * invDet;
+ if (v < 0.0 || u + v > 1.0) {
+ return undefined;
+ }
+
+ t = Matrix3.Cartesian3.dot(edge1, q) * invDet;
+ }
+
+ return t;
+ };
+
+ /**
+ * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.
+ *
+ * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|
+ * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.
+ *
+ * @memberof IntersectionTests
+ *
+ * @param {Ray} ray The ray.
+ * @param {Cartesian3} p0 The first vertex of the triangle.
+ * @param {Cartesian3} p1 The second vertex of the triangle.
+ * @param {Cartesian3} p2 The third vertex of the triangle.
+ * @param {Boolean} [cullBackFaces=false] If true
, will only compute an intersection with the front face of the triangle
+ * and return undefined for intersections with the back face.
+ * @param {Cartesian3} [result] The Cartesian3
onto which to store the result.
+ * @returns {Cartesian3} The intersection point or undefined if there is no intersections.
+ */
+ IntersectionTests.rayTriangle = function (
+ ray,
+ p0,
+ p1,
+ p2,
+ cullBackFaces,
+ result
+ ) {
+ const t = IntersectionTests.rayTriangleParametric(
+ ray,
+ p0,
+ p1,
+ p2,
+ cullBackFaces
+ );
+ if (!defaultValue.defined(t) || t < 0.0) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ Matrix3.Cartesian3.multiplyByScalar(ray.direction, t, result);
+ return Matrix3.Cartesian3.add(ray.origin, result, result);
+ };
+
+ const scratchLineSegmentTriangleRay = new Ray();
+
+ /**
+ * Computes the intersection of a line segment and a triangle.
+ * @memberof IntersectionTests
+ *
+ * @param {Cartesian3} v0 The an end point of the line segment.
+ * @param {Cartesian3} v1 The other end point of the line segment.
+ * @param {Cartesian3} p0 The first vertex of the triangle.
+ * @param {Cartesian3} p1 The second vertex of the triangle.
+ * @param {Cartesian3} p2 The third vertex of the triangle.
+ * @param {Boolean} [cullBackFaces=false] If true
, will only compute an intersection with the front face of the triangle
+ * and return undefined for intersections with the back face.
+ * @param {Cartesian3} [result] The Cartesian3
onto which to store the result.
+ * @returns {Cartesian3} The intersection point or undefined if there is no intersections.
+ */
+ IntersectionTests.lineSegmentTriangle = function (
+ v0,
+ v1,
+ p0,
+ p1,
+ p2,
+ cullBackFaces,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(v0)) {
+ throw new Check.DeveloperError("v0 is required.");
+ }
+ if (!defaultValue.defined(v1)) {
+ throw new Check.DeveloperError("v1 is required.");
+ }
+ if (!defaultValue.defined(p0)) {
+ throw new Check.DeveloperError("p0 is required.");
+ }
+ if (!defaultValue.defined(p1)) {
+ throw new Check.DeveloperError("p1 is required.");
+ }
+ if (!defaultValue.defined(p2)) {
+ throw new Check.DeveloperError("p2 is required.");
+ }
+ //>>includeEnd('debug');
+
+ const ray = scratchLineSegmentTriangleRay;
+ Matrix3.Cartesian3.clone(v0, ray.origin);
+ Matrix3.Cartesian3.subtract(v1, v0, ray.direction);
+ Matrix3.Cartesian3.normalize(ray.direction, ray.direction);
+
+ const t = IntersectionTests.rayTriangleParametric(
+ ray,
+ p0,
+ p1,
+ p2,
+ cullBackFaces
+ );
+ if (!defaultValue.defined(t) || t < 0.0 || t > Matrix3.Cartesian3.distance(v0, v1)) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ Matrix3.Cartesian3.multiplyByScalar(ray.direction, t, result);
+ return Matrix3.Cartesian3.add(ray.origin, result, result);
+ };
+
+ function solveQuadratic(a, b, c, result) {
+ const det = b * b - 4.0 * a * c;
+ if (det < 0.0) {
+ return undefined;
+ } else if (det > 0.0) {
+ const denom = 1.0 / (2.0 * a);
+ const disc = Math.sqrt(det);
+ const root0 = (-b + disc) * denom;
+ const root1 = (-b - disc) * denom;
+
+ if (root0 < root1) {
+ result.root0 = root0;
+ result.root1 = root1;
+ } else {
+ result.root0 = root1;
+ result.root1 = root0;
+ }
+
+ return result;
+ }
+
+ const root = -b / (2.0 * a);
+ if (root === 0.0) {
+ return undefined;
+ }
+
+ result.root0 = result.root1 = root;
+ return result;
+ }
+
+ const raySphereRoots = {
+ root0: 0.0,
+ root1: 0.0,
+ };
+
+ function raySphere(ray, sphere, result) {
+ if (!defaultValue.defined(result)) {
+ result = new Transforms.Interval();
+ }
+
+ const origin = ray.origin;
+ const direction = ray.direction;
+
+ const center = sphere.center;
+ const radiusSquared = sphere.radius * sphere.radius;
+
+ const diff = Matrix3.Cartesian3.subtract(origin, center, scratchPVec);
+
+ const a = Matrix3.Cartesian3.dot(direction, direction);
+ const b = 2.0 * Matrix3.Cartesian3.dot(direction, diff);
+ const c = Matrix3.Cartesian3.magnitudeSquared(diff) - radiusSquared;
+
+ const roots = solveQuadratic(a, b, c, raySphereRoots);
+ if (!defaultValue.defined(roots)) {
+ return undefined;
+ }
+
+ result.start = roots.root0;
+ result.stop = roots.root1;
+ return result;
+ }
+
+ /**
+ * Computes the intersection points of a ray with a sphere.
+ * @memberof IntersectionTests
+ *
+ * @param {Ray} ray The ray.
+ * @param {BoundingSphere} sphere The sphere.
+ * @param {Interval} [result] The result onto which to store the result.
+ * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.
+ */
+ IntersectionTests.raySphere = function (ray, sphere, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(ray)) {
+ throw new Check.DeveloperError("ray is required.");
+ }
+ if (!defaultValue.defined(sphere)) {
+ throw new Check.DeveloperError("sphere is required.");
+ }
+ //>>includeEnd('debug');
+
+ result = raySphere(ray, sphere, result);
+ if (!defaultValue.defined(result) || result.stop < 0.0) {
+ return undefined;
+ }
+
+ result.start = Math.max(result.start, 0.0);
+ return result;
+ };
+
+ const scratchLineSegmentRay = new Ray();
+
+ /**
+ * Computes the intersection points of a line segment with a sphere.
+ * @memberof IntersectionTests
+ *
+ * @param {Cartesian3} p0 An end point of the line segment.
+ * @param {Cartesian3} p1 The other end point of the line segment.
+ * @param {BoundingSphere} sphere The sphere.
+ * @param {Interval} [result] The result onto which to store the result.
+ * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.
+ */
+ IntersectionTests.lineSegmentSphere = function (p0, p1, sphere, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(p0)) {
+ throw new Check.DeveloperError("p0 is required.");
+ }
+ if (!defaultValue.defined(p1)) {
+ throw new Check.DeveloperError("p1 is required.");
+ }
+ if (!defaultValue.defined(sphere)) {
+ throw new Check.DeveloperError("sphere is required.");
+ }
+ //>>includeEnd('debug');
+
+ const ray = scratchLineSegmentRay;
+ Matrix3.Cartesian3.clone(p0, ray.origin);
+ const direction = Matrix3.Cartesian3.subtract(p1, p0, ray.direction);
+
+ const maxT = Matrix3.Cartesian3.magnitude(direction);
+ Matrix3.Cartesian3.normalize(direction, direction);
+
+ result = raySphere(ray, sphere, result);
+ if (!defaultValue.defined(result) || result.stop < 0.0 || result.start > maxT) {
+ return undefined;
+ }
+
+ result.start = Math.max(result.start, 0.0);
+ result.stop = Math.min(result.stop, maxT);
+ return result;
+ };
+
+ const scratchQ = new Matrix3.Cartesian3();
+ const scratchW = new Matrix3.Cartesian3();
+
+ /**
+ * Computes the intersection points of a ray with an ellipsoid.
+ *
+ * @param {Ray} ray The ray.
+ * @param {Ellipsoid} ellipsoid The ellipsoid.
+ * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.
+ */
+ IntersectionTests.rayEllipsoid = function (ray, ellipsoid) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(ray)) {
+ throw new Check.DeveloperError("ray is required.");
+ }
+ if (!defaultValue.defined(ellipsoid)) {
+ throw new Check.DeveloperError("ellipsoid is required.");
+ }
+ //>>includeEnd('debug');
+
+ const inverseRadii = ellipsoid.oneOverRadii;
+ const q = Matrix3.Cartesian3.multiplyComponents(inverseRadii, ray.origin, scratchQ);
+ const w = Matrix3.Cartesian3.multiplyComponents(
+ inverseRadii,
+ ray.direction,
+ scratchW
+ );
+
+ const q2 = Matrix3.Cartesian3.magnitudeSquared(q);
+ const qw = Matrix3.Cartesian3.dot(q, w);
+
+ let difference, w2, product, discriminant, temp;
+
+ if (q2 > 1.0) {
+ // Outside ellipsoid.
+ if (qw >= 0.0) {
+ // Looking outward or tangent (0 intersections).
+ return undefined;
+ }
+
+ // qw < 0.0.
+ const qw2 = qw * qw;
+ difference = q2 - 1.0; // Positively valued.
+ w2 = Matrix3.Cartesian3.magnitudeSquared(w);
+ product = w2 * difference;
+
+ if (qw2 < product) {
+ // Imaginary roots (0 intersections).
+ return undefined;
+ } else if (qw2 > product) {
+ // Distinct roots (2 intersections).
+ discriminant = qw * qw - product;
+ temp = -qw + Math.sqrt(discriminant); // Avoid cancellation.
+ const root0 = temp / w2;
+ const root1 = difference / temp;
+ if (root0 < root1) {
+ return new Transforms.Interval(root0, root1);
+ }
+
+ return {
+ start: root1,
+ stop: root0,
+ };
+ }
+ // qw2 == product. Repeated roots (2 intersections).
+ const root = Math.sqrt(difference / w2);
+ return new Transforms.Interval(root, root);
+ } else if (q2 < 1.0) {
+ // Inside ellipsoid (2 intersections).
+ difference = q2 - 1.0; // Negatively valued.
+ w2 = Matrix3.Cartesian3.magnitudeSquared(w);
+ product = w2 * difference; // Negatively valued.
+
+ discriminant = qw * qw - product;
+ temp = -qw + Math.sqrt(discriminant); // Positively valued.
+ return new Transforms.Interval(0.0, temp / w2);
+ }
+ // q2 == 1.0. On ellipsoid.
+ if (qw < 0.0) {
+ // Looking inward.
+ w2 = Matrix3.Cartesian3.magnitudeSquared(w);
+ return new Transforms.Interval(0.0, -qw / w2);
+ }
+
+ // qw >= 0.0. Looking outward or tangent.
+ return undefined;
+ };
+
+ function addWithCancellationCheck(left, right, tolerance) {
+ const difference = left + right;
+ if (
+ Math$1.CesiumMath.sign(left) !== Math$1.CesiumMath.sign(right) &&
+ Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance
+ ) {
+ return 0.0;
+ }
+
+ return difference;
+ }
+
+ function quadraticVectorExpression(A, b, c, x, w) {
+ const xSquared = x * x;
+ const wSquared = w * w;
+
+ const l2 = (A[Matrix3.Matrix3.COLUMN1ROW1] - A[Matrix3.Matrix3.COLUMN2ROW2]) * wSquared;
+ const l1 =
+ w *
+ (x *
+ addWithCancellationCheck(
+ A[Matrix3.Matrix3.COLUMN1ROW0],
+ A[Matrix3.Matrix3.COLUMN0ROW1],
+ Math$1.CesiumMath.EPSILON15
+ ) +
+ b.y);
+ const l0 =
+ A[Matrix3.Matrix3.COLUMN0ROW0] * xSquared +
+ A[Matrix3.Matrix3.COLUMN2ROW2] * wSquared +
+ x * b.x +
+ c;
+
+ const r1 =
+ wSquared *
+ addWithCancellationCheck(
+ A[Matrix3.Matrix3.COLUMN2ROW1],
+ A[Matrix3.Matrix3.COLUMN1ROW2],
+ Math$1.CesiumMath.EPSILON15
+ );
+ const r0 =
+ w *
+ (x *
+ addWithCancellationCheck(A[Matrix3.Matrix3.COLUMN2ROW0], A[Matrix3.Matrix3.COLUMN0ROW2]) +
+ b.z);
+
+ let cosines;
+ const solutions = [];
+ if (r0 === 0.0 && r1 === 0.0) {
+ cosines = QuadraticRealPolynomial$1.computeRealRoots(l2, l1, l0);
+ if (cosines.length === 0) {
+ return solutions;
+ }
+
+ const cosine0 = cosines[0];
+ const sine0 = Math.sqrt(Math.max(1.0 - cosine0 * cosine0, 0.0));
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine0, w * -sine0));
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine0, w * sine0));
+
+ if (cosines.length === 2) {
+ const cosine1 = cosines[1];
+ const sine1 = Math.sqrt(Math.max(1.0 - cosine1 * cosine1, 0.0));
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine1, w * -sine1));
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine1, w * sine1));
+ }
+
+ return solutions;
+ }
+
+ const r0Squared = r0 * r0;
+ const r1Squared = r1 * r1;
+ const l2Squared = l2 * l2;
+ const r0r1 = r0 * r1;
+
+ const c4 = l2Squared + r1Squared;
+ const c3 = 2.0 * (l1 * l2 + r0r1);
+ const c2 = 2.0 * l0 * l2 + l1 * l1 - r1Squared + r0Squared;
+ const c1 = 2.0 * (l0 * l1 - r0r1);
+ const c0 = l0 * l0 - r0Squared;
+
+ if (c4 === 0.0 && c3 === 0.0 && c2 === 0.0 && c1 === 0.0) {
+ return solutions;
+ }
+
+ cosines = QuarticRealPolynomial$1.computeRealRoots(c4, c3, c2, c1, c0);
+ const length = cosines.length;
+ if (length === 0) {
+ return solutions;
+ }
+
+ for (let i = 0; i < length; ++i) {
+ const cosine = cosines[i];
+ const cosineSquared = cosine * cosine;
+ const sineSquared = Math.max(1.0 - cosineSquared, 0.0);
+ const sine = Math.sqrt(sineSquared);
+
+ //const left = l2 * cosineSquared + l1 * cosine + l0;
+ let left;
+ if (Math$1.CesiumMath.sign(l2) === Math$1.CesiumMath.sign(l0)) {
+ left = addWithCancellationCheck(
+ l2 * cosineSquared + l0,
+ l1 * cosine,
+ Math$1.CesiumMath.EPSILON12
+ );
+ } else if (Math$1.CesiumMath.sign(l0) === Math$1.CesiumMath.sign(l1 * cosine)) {
+ left = addWithCancellationCheck(
+ l2 * cosineSquared,
+ l1 * cosine + l0,
+ Math$1.CesiumMath.EPSILON12
+ );
+ } else {
+ left = addWithCancellationCheck(
+ l2 * cosineSquared + l1 * cosine,
+ l0,
+ Math$1.CesiumMath.EPSILON12
+ );
+ }
+
+ const right = addWithCancellationCheck(
+ r1 * cosine,
+ r0,
+ Math$1.CesiumMath.EPSILON15
+ );
+ const product = left * right;
+
+ if (product < 0.0) {
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine, w * sine));
+ } else if (product > 0.0) {
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine, w * -sine));
+ } else if (sine !== 0.0) {
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine, w * -sine));
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine, w * sine));
+ ++i;
+ } else {
+ solutions.push(new Matrix3.Cartesian3(x, w * cosine, w * sine));
+ }
+ }
+
+ return solutions;
+ }
+
+ const firstAxisScratch = new Matrix3.Cartesian3();
+ const secondAxisScratch = new Matrix3.Cartesian3();
+ const thirdAxisScratch = new Matrix3.Cartesian3();
+ const referenceScratch = new Matrix3.Cartesian3();
+ const bCart = new Matrix3.Cartesian3();
+ const bScratch = new Matrix3.Matrix3();
+ const btScratch = new Matrix3.Matrix3();
+ const diScratch = new Matrix3.Matrix3();
+ const dScratch = new Matrix3.Matrix3();
+ const cScratch = new Matrix3.Matrix3();
+ const tempMatrix = new Matrix3.Matrix3();
+ const aScratch = new Matrix3.Matrix3();
+ const sScratch = new Matrix3.Cartesian3();
+ const closestScratch = new Matrix3.Cartesian3();
+ const surfPointScratch = new Matrix3.Cartographic();
+
+ /**
+ * Provides the point along the ray which is nearest to the ellipsoid.
+ *
+ * @param {Ray} ray The ray.
+ * @param {Ellipsoid} ellipsoid The ellipsoid.
+ * @returns {Cartesian3} The nearest planetodetic point on the ray.
+ */
+ IntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(ray)) {
+ throw new Check.DeveloperError("ray is required.");
+ }
+ if (!defaultValue.defined(ellipsoid)) {
+ throw new Check.DeveloperError("ellipsoid is required.");
+ }
+ //>>includeEnd('debug');
+
+ const position = ray.origin;
+ const direction = ray.direction;
+
+ if (!Matrix3.Cartesian3.equals(position, Matrix3.Cartesian3.ZERO)) {
+ const normal = ellipsoid.geodeticSurfaceNormal(position, firstAxisScratch);
+ if (Matrix3.Cartesian3.dot(direction, normal) >= 0.0) {
+ // The location provided is the closest point in altitude
+ return position;
+ }
+ }
+
+ const intersects = defaultValue.defined(this.rayEllipsoid(ray, ellipsoid));
+
+ // Compute the scaled direction vector.
+ const f = ellipsoid.transformPositionToScaledSpace(
+ direction,
+ firstAxisScratch
+ );
+
+ // Constructs a basis from the unit scaled direction vector. Construct its rotation and transpose.
+ const firstAxis = Matrix3.Cartesian3.normalize(f, f);
+ const reference = Matrix3.Cartesian3.mostOrthogonalAxis(f, referenceScratch);
+ const secondAxis = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(reference, firstAxis, secondAxisScratch),
+ secondAxisScratch
+ );
+ const thirdAxis = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(firstAxis, secondAxis, thirdAxisScratch),
+ thirdAxisScratch
+ );
+ const B = bScratch;
+ B[0] = firstAxis.x;
+ B[1] = firstAxis.y;
+ B[2] = firstAxis.z;
+ B[3] = secondAxis.x;
+ B[4] = secondAxis.y;
+ B[5] = secondAxis.z;
+ B[6] = thirdAxis.x;
+ B[7] = thirdAxis.y;
+ B[8] = thirdAxis.z;
+
+ const B_T = Matrix3.Matrix3.transpose(B, btScratch);
+
+ // Get the scaling matrix and its inverse.
+ const D_I = Matrix3.Matrix3.fromScale(ellipsoid.radii, diScratch);
+ const D = Matrix3.Matrix3.fromScale(ellipsoid.oneOverRadii, dScratch);
+
+ const C = cScratch;
+ C[0] = 0.0;
+ C[1] = -direction.z;
+ C[2] = direction.y;
+ C[3] = direction.z;
+ C[4] = 0.0;
+ C[5] = -direction.x;
+ C[6] = -direction.y;
+ C[7] = direction.x;
+ C[8] = 0.0;
+
+ const temp = Matrix3.Matrix3.multiply(
+ Matrix3.Matrix3.multiply(B_T, D, tempMatrix),
+ C,
+ tempMatrix
+ );
+ const A = Matrix3.Matrix3.multiply(
+ Matrix3.Matrix3.multiply(temp, D_I, aScratch),
+ B,
+ aScratch
+ );
+ const b = Matrix3.Matrix3.multiplyByVector(temp, position, bCart);
+
+ // Solve for the solutions to the expression in standard form:
+ const solutions = quadraticVectorExpression(
+ A,
+ Matrix3.Cartesian3.negate(b, firstAxisScratch),
+ 0.0,
+ 0.0,
+ 1.0
+ );
+
+ let s;
+ let altitude;
+ const length = solutions.length;
+ if (length > 0) {
+ let closest = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, closestScratch);
+ let maximumValue = Number.NEGATIVE_INFINITY;
+
+ for (let i = 0; i < length; ++i) {
+ s = Matrix3.Matrix3.multiplyByVector(
+ D_I,
+ Matrix3.Matrix3.multiplyByVector(B, solutions[i], sScratch),
+ sScratch
+ );
+ const v = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.subtract(s, position, referenceScratch),
+ referenceScratch
+ );
+ const dotProduct = Matrix3.Cartesian3.dot(v, direction);
+
+ if (dotProduct > maximumValue) {
+ maximumValue = dotProduct;
+ closest = Matrix3.Cartesian3.clone(s, closest);
+ }
+ }
+
+ const surfacePoint = ellipsoid.cartesianToCartographic(
+ closest,
+ surfPointScratch
+ );
+ maximumValue = Math$1.CesiumMath.clamp(maximumValue, 0.0, 1.0);
+ altitude =
+ Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.subtract(closest, position, referenceScratch)
+ ) * Math.sqrt(1.0 - maximumValue * maximumValue);
+ altitude = intersects ? -altitude : altitude;
+ surfacePoint.height = altitude;
+ return ellipsoid.cartographicToCartesian(surfacePoint, new Matrix3.Cartesian3());
+ }
+
+ return undefined;
+ };
+
+ const lineSegmentPlaneDifference = new Matrix3.Cartesian3();
+
+ /**
+ * Computes the intersection of a line segment and a plane.
+ *
+ * @param {Cartesian3} endPoint0 An end point of the line segment.
+ * @param {Cartesian3} endPoint1 The other end point of the line segment.
+ * @param {Plane} plane The plane.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The intersection point or undefined if there is no intersection.
+ *
+ * @example
+ * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
+ * const normal = ellipsoid.geodeticSurfaceNormal(origin);
+ * const plane = Cesium.Plane.fromPointNormal(origin, normal);
+ *
+ * const p0 = new Cesium.Cartesian3(...);
+ * const p1 = new Cesium.Cartesian3(...);
+ *
+ * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.
+ * const intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);
+ */
+ IntersectionTests.lineSegmentPlane = function (
+ endPoint0,
+ endPoint1,
+ plane,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(endPoint0)) {
+ throw new Check.DeveloperError("endPoint0 is required.");
+ }
+ if (!defaultValue.defined(endPoint1)) {
+ throw new Check.DeveloperError("endPoint1 is required.");
+ }
+ if (!defaultValue.defined(plane)) {
+ throw new Check.DeveloperError("plane is required.");
+ }
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ const difference = Matrix3.Cartesian3.subtract(
+ endPoint1,
+ endPoint0,
+ lineSegmentPlaneDifference
+ );
+ const normal = plane.normal;
+ const nDotDiff = Matrix3.Cartesian3.dot(normal, difference);
+
+ // check if the segment and plane are parallel
+ if (Math.abs(nDotDiff) < Math$1.CesiumMath.EPSILON6) {
+ return undefined;
+ }
+
+ const nDotP0 = Matrix3.Cartesian3.dot(normal, endPoint0);
+ const t = -(plane.distance + nDotP0) / nDotDiff;
+
+ // intersection only if t is in [0, 1]
+ if (t < 0.0 || t > 1.0) {
+ return undefined;
+ }
+
+ // intersection is endPoint0 + t * (endPoint1 - endPoint0)
+ Matrix3.Cartesian3.multiplyByScalar(difference, t, result);
+ Matrix3.Cartesian3.add(endPoint0, result, result);
+ return result;
+ };
+
+ /**
+ * Computes the intersection of a triangle and a plane
+ *
+ * @param {Cartesian3} p0 First point of the triangle
+ * @param {Cartesian3} p1 Second point of the triangle
+ * @param {Cartesian3} p2 Third point of the triangle
+ * @param {Plane} plane Intersection plane
+ * @returns {Object} An object with properties positions
and indices
, which are arrays that represent three triangles that do not cross the plane. (Undefined if no intersection exists)
+ *
+ * @example
+ * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
+ * const normal = ellipsoid.geodeticSurfaceNormal(origin);
+ * const plane = Cesium.Plane.fromPointNormal(origin, normal);
+ *
+ * const p0 = new Cesium.Cartesian3(...);
+ * const p1 = new Cesium.Cartesian3(...);
+ * const p2 = new Cesium.Cartesian3(...);
+ *
+ * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane
+ * const triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);
+ */
+ IntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(p0) || !defaultValue.defined(p1) || !defaultValue.defined(p2) || !defaultValue.defined(plane)) {
+ throw new Check.DeveloperError("p0, p1, p2, and plane are required.");
+ }
+ //>>includeEnd('debug');
+
+ const planeNormal = plane.normal;
+ const planeD = plane.distance;
+ const p0Behind = Matrix3.Cartesian3.dot(planeNormal, p0) + planeD < 0.0;
+ const p1Behind = Matrix3.Cartesian3.dot(planeNormal, p1) + planeD < 0.0;
+ const p2Behind = Matrix3.Cartesian3.dot(planeNormal, p2) + planeD < 0.0;
+ // Given these dots products, the calls to lineSegmentPlaneIntersection
+ // always have defined results.
+
+ let numBehind = 0;
+ numBehind += p0Behind ? 1 : 0;
+ numBehind += p1Behind ? 1 : 0;
+ numBehind += p2Behind ? 1 : 0;
+
+ let u1, u2;
+ if (numBehind === 1 || numBehind === 2) {
+ u1 = new Matrix3.Cartesian3();
+ u2 = new Matrix3.Cartesian3();
+ }
+
+ if (numBehind === 1) {
+ if (p0Behind) {
+ IntersectionTests.lineSegmentPlane(p0, p1, plane, u1);
+ IntersectionTests.lineSegmentPlane(p0, p2, plane, u2);
+
+ return {
+ positions: [p0, p1, p2, u1, u2],
+ indices: [
+ // Behind
+ 0,
+ 3,
+ 4,
+
+ // In front
+ 1,
+ 2,
+ 4,
+ 1,
+ 4,
+ 3,
+ ],
+ };
+ } else if (p1Behind) {
+ IntersectionTests.lineSegmentPlane(p1, p2, plane, u1);
+ IntersectionTests.lineSegmentPlane(p1, p0, plane, u2);
+
+ return {
+ positions: [p0, p1, p2, u1, u2],
+ indices: [
+ // Behind
+ 1,
+ 3,
+ 4,
+
+ // In front
+ 2,
+ 0,
+ 4,
+ 2,
+ 4,
+ 3,
+ ],
+ };
+ } else if (p2Behind) {
+ IntersectionTests.lineSegmentPlane(p2, p0, plane, u1);
+ IntersectionTests.lineSegmentPlane(p2, p1, plane, u2);
+
+ return {
+ positions: [p0, p1, p2, u1, u2],
+ indices: [
+ // Behind
+ 2,
+ 3,
+ 4,
+
+ // In front
+ 0,
+ 1,
+ 4,
+ 0,
+ 4,
+ 3,
+ ],
+ };
+ }
+ } else if (numBehind === 2) {
+ if (!p0Behind) {
+ IntersectionTests.lineSegmentPlane(p1, p0, plane, u1);
+ IntersectionTests.lineSegmentPlane(p2, p0, plane, u2);
+
+ return {
+ positions: [p0, p1, p2, u1, u2],
+ indices: [
+ // Behind
+ 1,
+ 2,
+ 4,
+ 1,
+ 4,
+ 3,
+
+ // In front
+ 0,
+ 3,
+ 4,
+ ],
+ };
+ } else if (!p1Behind) {
+ IntersectionTests.lineSegmentPlane(p2, p1, plane, u1);
+ IntersectionTests.lineSegmentPlane(p0, p1, plane, u2);
+
+ return {
+ positions: [p0, p1, p2, u1, u2],
+ indices: [
+ // Behind
+ 2,
+ 0,
+ 4,
+ 2,
+ 4,
+ 3,
+
+ // In front
+ 1,
+ 3,
+ 4,
+ ],
+ };
+ } else if (!p2Behind) {
+ IntersectionTests.lineSegmentPlane(p0, p2, plane, u1);
+ IntersectionTests.lineSegmentPlane(p1, p2, plane, u2);
+
+ return {
+ positions: [p0, p1, p2, u1, u2],
+ indices: [
+ // Behind
+ 0,
+ 1,
+ 4,
+ 0,
+ 4,
+ 3,
+
+ // In front
+ 2,
+ 3,
+ 4,
+ ],
+ };
+ }
+ }
+
+ // if numBehind is 3, the triangle is completely behind the plane;
+ // otherwise, it is completely in front (numBehind is 0).
+ return undefined;
+ };
+ var IntersectionTests$1 = IntersectionTests;
+
+ exports.IntersectionTests = IntersectionTests$1;
+ exports.Ray = Ray;
+
+}));
+//# sourceMappingURL=IntersectionTests-2c7928de.js.map
diff --git a/examples/cesium/Workers/IntersectionTests-2c7928de.js.map b/examples/cesium/Workers/IntersectionTests-2c7928de.js.map
new file mode 100644
index 0000000..01357ee
--- /dev/null
+++ b/examples/cesium/Workers/IntersectionTests-2c7928de.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"IntersectionTests-2c7928de.js","sources":["../../../Source/Core/QuadraticRealPolynomial.js","../../../Source/Core/CubicRealPolynomial.js","../../../Source/Core/QuarticRealPolynomial.js","../../../Source/Core/Ray.js","../../../Source/Core/IntersectionTests.js"],"sourcesContent":["import DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\n/**\r\n * Defines functions for 2nd order polynomial functions of one variable with only real coefficients.\r\n *\r\n * @namespace QuadraticRealPolynomial\r\n */\r\nconst QuadraticRealPolynomial = {};\r\n\r\n/**\r\n * Provides the discriminant of the quadratic equation from the supplied coefficients.\r\n *\r\n * @param {Number} a The coefficient of the 2nd order monomial.\r\n * @param {Number} b The coefficient of the 1st order monomial.\r\n * @param {Number} c The coefficient of the 0th order monomial.\r\n * @returns {Number} The value of the discriminant.\r\n */\r\nQuadraticRealPolynomial.computeDiscriminant = function (a, b, c) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof a !== \"number\") {\r\n throw new DeveloperError(\"a is a required number.\");\r\n }\r\n if (typeof b !== \"number\") {\r\n throw new DeveloperError(\"b is a required number.\");\r\n }\r\n if (typeof c !== \"number\") {\r\n throw new DeveloperError(\"c is a required number.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const discriminant = b * b - 4.0 * a * c;\r\n return discriminant;\r\n};\r\n\r\nfunction addWithCancellationCheck(left, right, tolerance) {\r\n const difference = left + right;\r\n if (\r\n CesiumMath.sign(left) !== CesiumMath.sign(right) &&\r\n Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance\r\n ) {\r\n return 0.0;\r\n }\r\n\r\n return difference;\r\n}\r\n\r\n/**\r\n * Provides the real valued roots of the quadratic polynomial with the provided coefficients.\r\n *\r\n * @param {Number} a The coefficient of the 2nd order monomial.\r\n * @param {Number} b The coefficient of the 1st order monomial.\r\n * @param {Number} c The coefficient of the 0th order monomial.\r\n * @returns {Number[]} The real valued roots.\r\n */\r\nQuadraticRealPolynomial.computeRealRoots = function (a, b, c) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof a !== \"number\") {\r\n throw new DeveloperError(\"a is a required number.\");\r\n }\r\n if (typeof b !== \"number\") {\r\n throw new DeveloperError(\"b is a required number.\");\r\n }\r\n if (typeof c !== \"number\") {\r\n throw new DeveloperError(\"c is a required number.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n let ratio;\r\n if (a === 0.0) {\r\n if (b === 0.0) {\r\n // Constant function: c = 0.\r\n return [];\r\n }\r\n\r\n // Linear function: b * x + c = 0.\r\n return [-c / b];\r\n } else if (b === 0.0) {\r\n if (c === 0.0) {\r\n // 2nd order monomial: a * x^2 = 0.\r\n return [0.0, 0.0];\r\n }\r\n\r\n const cMagnitude = Math.abs(c);\r\n const aMagnitude = Math.abs(a);\r\n\r\n if (\r\n cMagnitude < aMagnitude &&\r\n cMagnitude / aMagnitude < CesiumMath.EPSILON14\r\n ) {\r\n // c ~= 0.0.\r\n // 2nd order monomial: a * x^2 = 0.\r\n return [0.0, 0.0];\r\n } else if (\r\n cMagnitude > aMagnitude &&\r\n aMagnitude / cMagnitude < CesiumMath.EPSILON14\r\n ) {\r\n // a ~= 0.0.\r\n // Constant function: c = 0.\r\n return [];\r\n }\r\n\r\n // a * x^2 + c = 0\r\n ratio = -c / a;\r\n\r\n if (ratio < 0.0) {\r\n // Both roots are complex.\r\n return [];\r\n }\r\n\r\n // Both roots are real.\r\n const root = Math.sqrt(ratio);\r\n return [-root, root];\r\n } else if (c === 0.0) {\r\n // a * x^2 + b * x = 0\r\n ratio = -b / a;\r\n if (ratio < 0.0) {\r\n return [ratio, 0.0];\r\n }\r\n\r\n return [0.0, ratio];\r\n }\r\n\r\n // a * x^2 + b * x + c = 0\r\n const b2 = b * b;\r\n const four_ac = 4.0 * a * c;\r\n const radicand = addWithCancellationCheck(b2, -four_ac, CesiumMath.EPSILON14);\r\n\r\n if (radicand < 0.0) {\r\n // Both roots are complex.\r\n return [];\r\n }\r\n\r\n const q =\r\n -0.5 *\r\n addWithCancellationCheck(\r\n b,\r\n CesiumMath.sign(b) * Math.sqrt(radicand),\r\n CesiumMath.EPSILON14\r\n );\r\n if (b > 0.0) {\r\n return [q / a, c / q];\r\n }\r\n\r\n return [c / q, q / a];\r\n};\r\nexport default QuadraticRealPolynomial;\r\n","import DeveloperError from \"./DeveloperError.js\";\r\nimport QuadraticRealPolynomial from \"./QuadraticRealPolynomial.js\";\r\n\r\n/**\r\n * Defines functions for 3rd order polynomial functions of one variable with only real coefficients.\r\n *\r\n * @namespace CubicRealPolynomial\r\n */\r\nconst CubicRealPolynomial = {};\r\n\r\n/**\r\n * Provides the discriminant of the cubic equation from the supplied coefficients.\r\n *\r\n * @param {Number} a The coefficient of the 3rd order monomial.\r\n * @param {Number} b The coefficient of the 2nd order monomial.\r\n * @param {Number} c The coefficient of the 1st order monomial.\r\n * @param {Number} d The coefficient of the 0th order monomial.\r\n * @returns {Number} The value of the discriminant.\r\n */\r\nCubicRealPolynomial.computeDiscriminant = function (a, b, c, d) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof a !== \"number\") {\r\n throw new DeveloperError(\"a is a required number.\");\r\n }\r\n if (typeof b !== \"number\") {\r\n throw new DeveloperError(\"b is a required number.\");\r\n }\r\n if (typeof c !== \"number\") {\r\n throw new DeveloperError(\"c is a required number.\");\r\n }\r\n if (typeof d !== \"number\") {\r\n throw new DeveloperError(\"d is a required number.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const a2 = a * a;\r\n const b2 = b * b;\r\n const c2 = c * c;\r\n const d2 = d * d;\r\n\r\n const discriminant =\r\n 18.0 * a * b * c * d +\r\n b2 * c2 -\r\n 27.0 * a2 * d2 -\r\n 4.0 * (a * c2 * c + b2 * b * d);\r\n return discriminant;\r\n};\r\n\r\nfunction computeRealRoots(a, b, c, d) {\r\n const A = a;\r\n const B = b / 3.0;\r\n const C = c / 3.0;\r\n const D = d;\r\n\r\n const AC = A * C;\r\n const BD = B * D;\r\n const B2 = B * B;\r\n const C2 = C * C;\r\n const delta1 = A * C - B2;\r\n const delta2 = A * D - B * C;\r\n const delta3 = B * D - C2;\r\n\r\n const discriminant = 4.0 * delta1 * delta3 - delta2 * delta2;\r\n let temp;\r\n let temp1;\r\n\r\n if (discriminant < 0.0) {\r\n let ABar;\r\n let CBar;\r\n let DBar;\r\n\r\n if (B2 * BD >= AC * C2) {\r\n ABar = A;\r\n CBar = delta1;\r\n DBar = -2.0 * B * delta1 + A * delta2;\r\n } else {\r\n ABar = D;\r\n CBar = delta3;\r\n DBar = -D * delta2 + 2.0 * C * delta3;\r\n }\r\n\r\n const s = DBar < 0.0 ? -1.0 : 1.0; // This is not Math.Sign()!\r\n const temp0 = -s * Math.abs(ABar) * Math.sqrt(-discriminant);\r\n temp1 = -DBar + temp0;\r\n\r\n const x = temp1 / 2.0;\r\n const p = x < 0.0 ? -Math.pow(-x, 1.0 / 3.0) : Math.pow(x, 1.0 / 3.0);\r\n const q = temp1 === temp0 ? -p : -CBar / p;\r\n\r\n temp = CBar <= 0.0 ? p + q : -DBar / (p * p + q * q + CBar);\r\n\r\n if (B2 * BD >= AC * C2) {\r\n return [(temp - B) / A];\r\n }\r\n\r\n return [-D / (temp + C)];\r\n }\r\n\r\n const CBarA = delta1;\r\n const DBarA = -2.0 * B * delta1 + A * delta2;\r\n\r\n const CBarD = delta3;\r\n const DBarD = -D * delta2 + 2.0 * C * delta3;\r\n\r\n const squareRootOfDiscriminant = Math.sqrt(discriminant);\r\n const halfSquareRootOf3 = Math.sqrt(3.0) / 2.0;\r\n\r\n let theta = Math.abs(Math.atan2(A * squareRootOfDiscriminant, -DBarA) / 3.0);\r\n temp = 2.0 * Math.sqrt(-CBarA);\r\n let cosine = Math.cos(theta);\r\n temp1 = temp * cosine;\r\n let temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));\r\n\r\n const numeratorLarge = temp1 + temp3 > 2.0 * B ? temp1 - B : temp3 - B;\r\n const denominatorLarge = A;\r\n\r\n const root1 = numeratorLarge / denominatorLarge;\r\n\r\n theta = Math.abs(Math.atan2(D * squareRootOfDiscriminant, -DBarD) / 3.0);\r\n temp = 2.0 * Math.sqrt(-CBarD);\r\n cosine = Math.cos(theta);\r\n temp1 = temp * cosine;\r\n temp3 = temp * (-cosine / 2.0 - halfSquareRootOf3 * Math.sin(theta));\r\n\r\n const numeratorSmall = -D;\r\n const denominatorSmall = temp1 + temp3 < 2.0 * C ? temp1 + C : temp3 + C;\r\n\r\n const root3 = numeratorSmall / denominatorSmall;\r\n\r\n const E = denominatorLarge * denominatorSmall;\r\n const F =\r\n -numeratorLarge * denominatorSmall - denominatorLarge * numeratorSmall;\r\n const G = numeratorLarge * numeratorSmall;\r\n\r\n const root2 = (C * F - B * G) / (-B * F + C * E);\r\n\r\n if (root1 <= root2) {\r\n if (root1 <= root3) {\r\n if (root2 <= root3) {\r\n return [root1, root2, root3];\r\n }\r\n return [root1, root3, root2];\r\n }\r\n return [root3, root1, root2];\r\n }\r\n if (root1 <= root3) {\r\n return [root2, root1, root3];\r\n }\r\n if (root2 <= root3) {\r\n return [root2, root3, root1];\r\n }\r\n return [root3, root2, root1];\r\n}\r\n\r\n/**\r\n * Provides the real valued roots of the cubic polynomial with the provided coefficients.\r\n *\r\n * @param {Number} a The coefficient of the 3rd order monomial.\r\n * @param {Number} b The coefficient of the 2nd order monomial.\r\n * @param {Number} c The coefficient of the 1st order monomial.\r\n * @param {Number} d The coefficient of the 0th order monomial.\r\n * @returns {Number[]} The real valued roots.\r\n */\r\nCubicRealPolynomial.computeRealRoots = function (a, b, c, d) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof a !== \"number\") {\r\n throw new DeveloperError(\"a is a required number.\");\r\n }\r\n if (typeof b !== \"number\") {\r\n throw new DeveloperError(\"b is a required number.\");\r\n }\r\n if (typeof c !== \"number\") {\r\n throw new DeveloperError(\"c is a required number.\");\r\n }\r\n if (typeof d !== \"number\") {\r\n throw new DeveloperError(\"d is a required number.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n let roots;\r\n let ratio;\r\n if (a === 0.0) {\r\n // Quadratic function: b * x^2 + c * x + d = 0.\r\n return QuadraticRealPolynomial.computeRealRoots(b, c, d);\r\n } else if (b === 0.0) {\r\n if (c === 0.0) {\r\n if (d === 0.0) {\r\n // 3rd order monomial: a * x^3 = 0.\r\n return [0.0, 0.0, 0.0];\r\n }\r\n\r\n // a * x^3 + d = 0\r\n ratio = -d / a;\r\n const root =\r\n ratio < 0.0 ? -Math.pow(-ratio, 1.0 / 3.0) : Math.pow(ratio, 1.0 / 3.0);\r\n return [root, root, root];\r\n } else if (d === 0.0) {\r\n // x * (a * x^2 + c) = 0.\r\n roots = QuadraticRealPolynomial.computeRealRoots(a, 0, c);\r\n\r\n // Return the roots in ascending order.\r\n if (roots.Length === 0) {\r\n return [0.0];\r\n }\r\n return [roots[0], 0.0, roots[1]];\r\n }\r\n\r\n // Deflated cubic polynomial: a * x^3 + c * x + d= 0.\r\n return computeRealRoots(a, 0, c, d);\r\n } else if (c === 0.0) {\r\n if (d === 0.0) {\r\n // x^2 * (a * x + b) = 0.\r\n ratio = -b / a;\r\n if (ratio < 0.0) {\r\n return [ratio, 0.0, 0.0];\r\n }\r\n return [0.0, 0.0, ratio];\r\n }\r\n // a * x^3 + b * x^2 + d = 0.\r\n return computeRealRoots(a, b, 0, d);\r\n } else if (d === 0.0) {\r\n // x * (a * x^2 + b * x + c) = 0\r\n roots = QuadraticRealPolynomial.computeRealRoots(a, b, c);\r\n\r\n // Return the roots in ascending order.\r\n if (roots.length === 0) {\r\n return [0.0];\r\n } else if (roots[1] <= 0.0) {\r\n return [roots[0], roots[1], 0.0];\r\n } else if (roots[0] >= 0.0) {\r\n return [0.0, roots[0], roots[1]];\r\n }\r\n return [roots[0], 0.0, roots[1]];\r\n }\r\n\r\n return computeRealRoots(a, b, c, d);\r\n};\r\nexport default CubicRealPolynomial;\r\n","import CubicRealPolynomial from \"./CubicRealPolynomial.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport QuadraticRealPolynomial from \"./QuadraticRealPolynomial.js\";\r\n\r\n/**\r\n * Defines functions for 4th order polynomial functions of one variable with only real coefficients.\r\n *\r\n * @namespace QuarticRealPolynomial\r\n */\r\nconst QuarticRealPolynomial = {};\r\n\r\n/**\r\n * Provides the discriminant of the quartic equation from the supplied coefficients.\r\n *\r\n * @param {Number} a The coefficient of the 4th order monomial.\r\n * @param {Number} b The coefficient of the 3rd order monomial.\r\n * @param {Number} c The coefficient of the 2nd order monomial.\r\n * @param {Number} d The coefficient of the 1st order monomial.\r\n * @param {Number} e The coefficient of the 0th order monomial.\r\n * @returns {Number} The value of the discriminant.\r\n */\r\nQuarticRealPolynomial.computeDiscriminant = function (a, b, c, d, e) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof a !== \"number\") {\r\n throw new DeveloperError(\"a is a required number.\");\r\n }\r\n if (typeof b !== \"number\") {\r\n throw new DeveloperError(\"b is a required number.\");\r\n }\r\n if (typeof c !== \"number\") {\r\n throw new DeveloperError(\"c is a required number.\");\r\n }\r\n if (typeof d !== \"number\") {\r\n throw new DeveloperError(\"d is a required number.\");\r\n }\r\n if (typeof e !== \"number\") {\r\n throw new DeveloperError(\"e is a required number.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const a2 = a * a;\r\n const a3 = a2 * a;\r\n const b2 = b * b;\r\n const b3 = b2 * b;\r\n const c2 = c * c;\r\n const c3 = c2 * c;\r\n const d2 = d * d;\r\n const d3 = d2 * d;\r\n const e2 = e * e;\r\n const e3 = e2 * e;\r\n\r\n const discriminant =\r\n b2 * c2 * d2 -\r\n 4.0 * b3 * d3 -\r\n 4.0 * a * c3 * d2 +\r\n 18 * a * b * c * d3 -\r\n 27.0 * a2 * d2 * d2 +\r\n 256.0 * a3 * e3 +\r\n e *\r\n (18.0 * b3 * c * d -\r\n 4.0 * b2 * c3 +\r\n 16.0 * a * c2 * c2 -\r\n 80.0 * a * b * c2 * d -\r\n 6.0 * a * b2 * d2 +\r\n 144.0 * a2 * c * d2) +\r\n e2 *\r\n (144.0 * a * b2 * c -\r\n 27.0 * b2 * b2 -\r\n 128.0 * a2 * c2 -\r\n 192.0 * a2 * b * d);\r\n return discriminant;\r\n};\r\n\r\nfunction original(a3, a2, a1, a0) {\r\n const a3Squared = a3 * a3;\r\n\r\n const p = a2 - (3.0 * a3Squared) / 8.0;\r\n const q = a1 - (a2 * a3) / 2.0 + (a3Squared * a3) / 8.0;\r\n const r =\r\n a0 -\r\n (a1 * a3) / 4.0 +\r\n (a2 * a3Squared) / 16.0 -\r\n (3.0 * a3Squared * a3Squared) / 256.0;\r\n\r\n // Find the roots of the cubic equations: h^6 + 2 p h^4 + (p^2 - 4 r) h^2 - q^2 = 0.\r\n const cubicRoots = CubicRealPolynomial.computeRealRoots(\r\n 1.0,\r\n 2.0 * p,\r\n p * p - 4.0 * r,\r\n -q * q\r\n );\r\n\r\n if (cubicRoots.length > 0) {\r\n const temp = -a3 / 4.0;\r\n\r\n // Use the largest positive root.\r\n const hSquared = cubicRoots[cubicRoots.length - 1];\r\n\r\n if (Math.abs(hSquared) < CesiumMath.EPSILON14) {\r\n // y^4 + p y^2 + r = 0.\r\n const roots = QuadraticRealPolynomial.computeRealRoots(1.0, p, r);\r\n\r\n if (roots.length === 2) {\r\n const root0 = roots[0];\r\n const root1 = roots[1];\r\n\r\n let y;\r\n if (root0 >= 0.0 && root1 >= 0.0) {\r\n const y0 = Math.sqrt(root0);\r\n const y1 = Math.sqrt(root1);\r\n\r\n return [temp - y1, temp - y0, temp + y0, temp + y1];\r\n } else if (root0 >= 0.0 && root1 < 0.0) {\r\n y = Math.sqrt(root0);\r\n return [temp - y, temp + y];\r\n } else if (root0 < 0.0 && root1 >= 0.0) {\r\n y = Math.sqrt(root1);\r\n return [temp - y, temp + y];\r\n }\r\n }\r\n return [];\r\n } else if (hSquared > 0.0) {\r\n const h = Math.sqrt(hSquared);\r\n\r\n const m = (p + hSquared - q / h) / 2.0;\r\n const n = (p + hSquared + q / h) / 2.0;\r\n\r\n // Now solve the two quadratic factors: (y^2 + h y + m)(y^2 - h y + n);\r\n const roots1 = QuadraticRealPolynomial.computeRealRoots(1.0, h, m);\r\n const roots2 = QuadraticRealPolynomial.computeRealRoots(1.0, -h, n);\r\n\r\n if (roots1.length !== 0) {\r\n roots1[0] += temp;\r\n roots1[1] += temp;\r\n\r\n if (roots2.length !== 0) {\r\n roots2[0] += temp;\r\n roots2[1] += temp;\r\n\r\n if (roots1[1] <= roots2[0]) {\r\n return [roots1[0], roots1[1], roots2[0], roots2[1]];\r\n } else if (roots2[1] <= roots1[0]) {\r\n return [roots2[0], roots2[1], roots1[0], roots1[1]];\r\n } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {\r\n return [roots2[0], roots1[0], roots1[1], roots2[1]];\r\n } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {\r\n return [roots1[0], roots2[0], roots2[1], roots1[1]];\r\n } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {\r\n return [roots2[0], roots1[0], roots2[1], roots1[1]];\r\n }\r\n return [roots1[0], roots2[0], roots1[1], roots2[1]];\r\n }\r\n return roots1;\r\n }\r\n\r\n if (roots2.length !== 0) {\r\n roots2[0] += temp;\r\n roots2[1] += temp;\r\n\r\n return roots2;\r\n }\r\n return [];\r\n }\r\n }\r\n return [];\r\n}\r\n\r\nfunction neumark(a3, a2, a1, a0) {\r\n const a1Squared = a1 * a1;\r\n const a2Squared = a2 * a2;\r\n const a3Squared = a3 * a3;\r\n\r\n const p = -2.0 * a2;\r\n const q = a1 * a3 + a2Squared - 4.0 * a0;\r\n const r = a3Squared * a0 - a1 * a2 * a3 + a1Squared;\r\n\r\n const cubicRoots = CubicRealPolynomial.computeRealRoots(1.0, p, q, r);\r\n\r\n if (cubicRoots.length > 0) {\r\n // Use the most positive root\r\n const y = cubicRoots[0];\r\n\r\n const temp = a2 - y;\r\n const tempSquared = temp * temp;\r\n\r\n const g1 = a3 / 2.0;\r\n const h1 = temp / 2.0;\r\n\r\n const m = tempSquared - 4.0 * a0;\r\n const mError = tempSquared + 4.0 * Math.abs(a0);\r\n\r\n const n = a3Squared - 4.0 * y;\r\n const nError = a3Squared + 4.0 * Math.abs(y);\r\n\r\n let g2;\r\n let h2;\r\n\r\n if (y < 0.0 || m * nError < n * mError) {\r\n const squareRootOfN = Math.sqrt(n);\r\n g2 = squareRootOfN / 2.0;\r\n h2 = squareRootOfN === 0.0 ? 0.0 : (a3 * h1 - a1) / squareRootOfN;\r\n } else {\r\n const squareRootOfM = Math.sqrt(m);\r\n g2 = squareRootOfM === 0.0 ? 0.0 : (a3 * h1 - a1) / squareRootOfM;\r\n h2 = squareRootOfM / 2.0;\r\n }\r\n\r\n let G;\r\n let g;\r\n if (g1 === 0.0 && g2 === 0.0) {\r\n G = 0.0;\r\n g = 0.0;\r\n } else if (CesiumMath.sign(g1) === CesiumMath.sign(g2)) {\r\n G = g1 + g2;\r\n g = y / G;\r\n } else {\r\n g = g1 - g2;\r\n G = y / g;\r\n }\r\n\r\n let H;\r\n let h;\r\n if (h1 === 0.0 && h2 === 0.0) {\r\n H = 0.0;\r\n h = 0.0;\r\n } else if (CesiumMath.sign(h1) === CesiumMath.sign(h2)) {\r\n H = h1 + h2;\r\n h = a0 / H;\r\n } else {\r\n h = h1 - h2;\r\n H = a0 / h;\r\n }\r\n\r\n // Now solve the two quadratic factors: (y^2 + G y + H)(y^2 + g y + h);\r\n const roots1 = QuadraticRealPolynomial.computeRealRoots(1.0, G, H);\r\n const roots2 = QuadraticRealPolynomial.computeRealRoots(1.0, g, h);\r\n\r\n if (roots1.length !== 0) {\r\n if (roots2.length !== 0) {\r\n if (roots1[1] <= roots2[0]) {\r\n return [roots1[0], roots1[1], roots2[0], roots2[1]];\r\n } else if (roots2[1] <= roots1[0]) {\r\n return [roots2[0], roots2[1], roots1[0], roots1[1]];\r\n } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {\r\n return [roots2[0], roots1[0], roots1[1], roots2[1]];\r\n } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {\r\n return [roots1[0], roots2[0], roots2[1], roots1[1]];\r\n } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {\r\n return [roots2[0], roots1[0], roots2[1], roots1[1]];\r\n }\r\n return [roots1[0], roots2[0], roots1[1], roots2[1]];\r\n }\r\n return roots1;\r\n }\r\n if (roots2.length !== 0) {\r\n return roots2;\r\n }\r\n }\r\n return [];\r\n}\r\n\r\n/**\r\n * Provides the real valued roots of the quartic polynomial with the provided coefficients.\r\n *\r\n * @param {Number} a The coefficient of the 4th order monomial.\r\n * @param {Number} b The coefficient of the 3rd order monomial.\r\n * @param {Number} c The coefficient of the 2nd order monomial.\r\n * @param {Number} d The coefficient of the 1st order monomial.\r\n * @param {Number} e The coefficient of the 0th order monomial.\r\n * @returns {Number[]} The real valued roots.\r\n */\r\nQuarticRealPolynomial.computeRealRoots = function (a, b, c, d, e) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof a !== \"number\") {\r\n throw new DeveloperError(\"a is a required number.\");\r\n }\r\n if (typeof b !== \"number\") {\r\n throw new DeveloperError(\"b is a required number.\");\r\n }\r\n if (typeof c !== \"number\") {\r\n throw new DeveloperError(\"c is a required number.\");\r\n }\r\n if (typeof d !== \"number\") {\r\n throw new DeveloperError(\"d is a required number.\");\r\n }\r\n if (typeof e !== \"number\") {\r\n throw new DeveloperError(\"e is a required number.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (Math.abs(a) < CesiumMath.EPSILON15) {\r\n return CubicRealPolynomial.computeRealRoots(b, c, d, e);\r\n }\r\n const a3 = b / a;\r\n const a2 = c / a;\r\n const a1 = d / a;\r\n const a0 = e / a;\r\n\r\n let k = a3 < 0.0 ? 1 : 0;\r\n k += a2 < 0.0 ? k + 1 : k;\r\n k += a1 < 0.0 ? k + 1 : k;\r\n k += a0 < 0.0 ? k + 1 : k;\r\n\r\n switch (k) {\r\n case 0:\r\n return original(a3, a2, a1, a0);\r\n case 1:\r\n return neumark(a3, a2, a1, a0);\r\n case 2:\r\n return neumark(a3, a2, a1, a0);\r\n case 3:\r\n return original(a3, a2, a1, a0);\r\n case 4:\r\n return original(a3, a2, a1, a0);\r\n case 5:\r\n return neumark(a3, a2, a1, a0);\r\n case 6:\r\n return original(a3, a2, a1, a0);\r\n case 7:\r\n return original(a3, a2, a1, a0);\r\n case 8:\r\n return neumark(a3, a2, a1, a0);\r\n case 9:\r\n return original(a3, a2, a1, a0);\r\n case 10:\r\n return original(a3, a2, a1, a0);\r\n case 11:\r\n return neumark(a3, a2, a1, a0);\r\n case 12:\r\n return original(a3, a2, a1, a0);\r\n case 13:\r\n return original(a3, a2, a1, a0);\r\n case 14:\r\n return original(a3, a2, a1, a0);\r\n case 15:\r\n return original(a3, a2, a1, a0);\r\n default:\r\n return undefined;\r\n }\r\n};\r\nexport default QuarticRealPolynomial;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\n\r\n/**\r\n * Represents a ray that extends infinitely from the provided origin in the provided direction.\r\n * @alias Ray\r\n * @constructor\r\n *\r\n * @param {Cartesian3} [origin=Cartesian3.ZERO] The origin of the ray.\r\n * @param {Cartesian3} [direction=Cartesian3.ZERO] The direction of the ray.\r\n */\r\nfunction Ray(origin, direction) {\r\n direction = Cartesian3.clone(defaultValue(direction, Cartesian3.ZERO));\r\n if (!Cartesian3.equals(direction, Cartesian3.ZERO)) {\r\n Cartesian3.normalize(direction, direction);\r\n }\r\n\r\n /**\r\n * The origin of the ray.\r\n * @type {Cartesian3}\r\n * @default {@link Cartesian3.ZERO}\r\n */\r\n this.origin = Cartesian3.clone(defaultValue(origin, Cartesian3.ZERO));\r\n\r\n /**\r\n * The direction of the ray.\r\n * @type {Cartesian3}\r\n */\r\n this.direction = direction;\r\n}\r\n\r\n/**\r\n * Duplicates a Ray instance.\r\n *\r\n * @param {Ray} ray The ray to duplicate.\r\n * @param {Ray} [result] The object onto which to store the result.\r\n * @returns {Ray} The modified result parameter or a new Ray instance if one was not provided. (Returns undefined if ray is undefined)\r\n */\r\nRay.clone = function (ray, result) {\r\n if (!defined(ray)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n return new Ray(ray.origin, ray.direction);\r\n }\r\n result.origin = Cartesian3.clone(ray.origin);\r\n result.direction = Cartesian3.clone(ray.direction);\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the point along the ray given by r(t) = o + t*d,\r\n * where o is the origin of the ray and d is the direction.\r\n *\r\n * @param {Ray} ray The ray.\r\n * @param {Number} t A scalar value.\r\n * @param {Cartesian3} [result] The object in which the result will be stored.\r\n * @returns {Cartesian3} The modified result parameter, or a new instance if none was provided.\r\n *\r\n * @example\r\n * //Get the first intersection point of a ray and an ellipsoid.\r\n * const intersection = Cesium.IntersectionTests.rayEllipsoid(ray, ellipsoid);\r\n * const point = Cesium.Ray.getPoint(ray, intersection.start);\r\n */\r\nRay.getPoint = function (ray, t, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"ray\", ray);\r\n Check.typeOf.number(\"t\", t);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n result = Cartesian3.multiplyByScalar(ray.direction, t, result);\r\n return Cartesian3.add(ray.origin, result, result);\r\n};\r\nexport default Ray;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Interval from \"./Interval.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport QuadraticRealPolynomial from \"./QuadraticRealPolynomial.js\";\r\nimport QuarticRealPolynomial from \"./QuarticRealPolynomial.js\";\r\nimport Ray from \"./Ray.js\";\r\n\r\n/**\r\n * Functions for computing the intersection between geometries such as rays, planes, triangles, and ellipsoids.\r\n *\r\n * @namespace IntersectionTests\r\n */\r\nconst IntersectionTests = {};\r\n\r\n/**\r\n * Computes the intersection of a ray and a plane.\r\n *\r\n * @param {Ray} ray The ray.\r\n * @param {Plane} plane The plane.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The intersection point or undefined if there is no intersections.\r\n */\r\nIntersectionTests.rayPlane = function (ray, plane, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(ray)) {\r\n throw new DeveloperError(\"ray is required.\");\r\n }\r\n if (!defined(plane)) {\r\n throw new DeveloperError(\"plane is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n const origin = ray.origin;\r\n const direction = ray.direction;\r\n const normal = plane.normal;\r\n const denominator = Cartesian3.dot(normal, direction);\r\n\r\n if (Math.abs(denominator) < CesiumMath.EPSILON15) {\r\n // Ray is parallel to plane. The ray may be in the polygon's plane.\r\n return undefined;\r\n }\r\n\r\n const t = (-plane.distance - Cartesian3.dot(normal, origin)) / denominator;\r\n\r\n if (t < 0) {\r\n return undefined;\r\n }\r\n\r\n result = Cartesian3.multiplyByScalar(direction, t, result);\r\n return Cartesian3.add(origin, result, result);\r\n};\r\n\r\nconst scratchEdge0 = new Cartesian3();\r\nconst scratchEdge1 = new Cartesian3();\r\nconst scratchPVec = new Cartesian3();\r\nconst scratchTVec = new Cartesian3();\r\nconst scratchQVec = new Cartesian3();\r\n\r\n/**\r\n * Computes the intersection of a ray and a triangle as a parametric distance along the input ray. The result is negative when the triangle is behind the ray.\r\n *\r\n * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|\r\n * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.\r\n *\r\n * @memberof IntersectionTests\r\n *\r\n * @param {Ray} ray The ray.\r\n * @param {Cartesian3} p0 The first vertex of the triangle.\r\n * @param {Cartesian3} p1 The second vertex of the triangle.\r\n * @param {Cartesian3} p2 The third vertex of the triangle.\r\n * @param {Boolean} [cullBackFaces=false] If true
, will only compute an intersection with the front face of the triangle\r\n * and return undefined for intersections with the back face.\r\n * @returns {Number} The intersection as a parametric distance along the ray, or undefined if there is no intersection.\r\n */\r\nIntersectionTests.rayTriangleParametric = function (\r\n ray,\r\n p0,\r\n p1,\r\n p2,\r\n cullBackFaces\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(ray)) {\r\n throw new DeveloperError(\"ray is required.\");\r\n }\r\n if (!defined(p0)) {\r\n throw new DeveloperError(\"p0 is required.\");\r\n }\r\n if (!defined(p1)) {\r\n throw new DeveloperError(\"p1 is required.\");\r\n }\r\n if (!defined(p2)) {\r\n throw new DeveloperError(\"p2 is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n cullBackFaces = defaultValue(cullBackFaces, false);\r\n\r\n const origin = ray.origin;\r\n const direction = ray.direction;\r\n\r\n const edge0 = Cartesian3.subtract(p1, p0, scratchEdge0);\r\n const edge1 = Cartesian3.subtract(p2, p0, scratchEdge1);\r\n\r\n const p = Cartesian3.cross(direction, edge1, scratchPVec);\r\n const det = Cartesian3.dot(edge0, p);\r\n\r\n let tvec;\r\n let q;\r\n\r\n let u;\r\n let v;\r\n let t;\r\n\r\n if (cullBackFaces) {\r\n if (det < CesiumMath.EPSILON6) {\r\n return undefined;\r\n }\r\n\r\n tvec = Cartesian3.subtract(origin, p0, scratchTVec);\r\n u = Cartesian3.dot(tvec, p);\r\n if (u < 0.0 || u > det) {\r\n return undefined;\r\n }\r\n\r\n q = Cartesian3.cross(tvec, edge0, scratchQVec);\r\n\r\n v = Cartesian3.dot(direction, q);\r\n if (v < 0.0 || u + v > det) {\r\n return undefined;\r\n }\r\n\r\n t = Cartesian3.dot(edge1, q) / det;\r\n } else {\r\n if (Math.abs(det) < CesiumMath.EPSILON6) {\r\n return undefined;\r\n }\r\n const invDet = 1.0 / det;\r\n\r\n tvec = Cartesian3.subtract(origin, p0, scratchTVec);\r\n u = Cartesian3.dot(tvec, p) * invDet;\r\n if (u < 0.0 || u > 1.0) {\r\n return undefined;\r\n }\r\n\r\n q = Cartesian3.cross(tvec, edge0, scratchQVec);\r\n\r\n v = Cartesian3.dot(direction, q) * invDet;\r\n if (v < 0.0 || u + v > 1.0) {\r\n return undefined;\r\n }\r\n\r\n t = Cartesian3.dot(edge1, q) * invDet;\r\n }\r\n\r\n return t;\r\n};\r\n\r\n/**\r\n * Computes the intersection of a ray and a triangle as a Cartesian3 coordinate.\r\n *\r\n * Implements {@link https://cadxfem.org/inf/Fast%20MinimumStorage%20RayTriangle%20Intersection.pdf|\r\n * Fast Minimum Storage Ray/Triangle Intersection} by Tomas Moller and Ben Trumbore.\r\n *\r\n * @memberof IntersectionTests\r\n *\r\n * @param {Ray} ray The ray.\r\n * @param {Cartesian3} p0 The first vertex of the triangle.\r\n * @param {Cartesian3} p1 The second vertex of the triangle.\r\n * @param {Cartesian3} p2 The third vertex of the triangle.\r\n * @param {Boolean} [cullBackFaces=false] If true
, will only compute an intersection with the front face of the triangle\r\n * and return undefined for intersections with the back face.\r\n * @param {Cartesian3} [result] The Cartesian3
onto which to store the result.\r\n * @returns {Cartesian3} The intersection point or undefined if there is no intersections.\r\n */\r\nIntersectionTests.rayTriangle = function (\r\n ray,\r\n p0,\r\n p1,\r\n p2,\r\n cullBackFaces,\r\n result\r\n) {\r\n const t = IntersectionTests.rayTriangleParametric(\r\n ray,\r\n p0,\r\n p1,\r\n p2,\r\n cullBackFaces\r\n );\r\n if (!defined(t) || t < 0.0) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n Cartesian3.multiplyByScalar(ray.direction, t, result);\r\n return Cartesian3.add(ray.origin, result, result);\r\n};\r\n\r\nconst scratchLineSegmentTriangleRay = new Ray();\r\n\r\n/**\r\n * Computes the intersection of a line segment and a triangle.\r\n * @memberof IntersectionTests\r\n *\r\n * @param {Cartesian3} v0 The an end point of the line segment.\r\n * @param {Cartesian3} v1 The other end point of the line segment.\r\n * @param {Cartesian3} p0 The first vertex of the triangle.\r\n * @param {Cartesian3} p1 The second vertex of the triangle.\r\n * @param {Cartesian3} p2 The third vertex of the triangle.\r\n * @param {Boolean} [cullBackFaces=false] If true
, will only compute an intersection with the front face of the triangle\r\n * and return undefined for intersections with the back face.\r\n * @param {Cartesian3} [result] The Cartesian3
onto which to store the result.\r\n * @returns {Cartesian3} The intersection point or undefined if there is no intersections.\r\n */\r\nIntersectionTests.lineSegmentTriangle = function (\r\n v0,\r\n v1,\r\n p0,\r\n p1,\r\n p2,\r\n cullBackFaces,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(v0)) {\r\n throw new DeveloperError(\"v0 is required.\");\r\n }\r\n if (!defined(v1)) {\r\n throw new DeveloperError(\"v1 is required.\");\r\n }\r\n if (!defined(p0)) {\r\n throw new DeveloperError(\"p0 is required.\");\r\n }\r\n if (!defined(p1)) {\r\n throw new DeveloperError(\"p1 is required.\");\r\n }\r\n if (!defined(p2)) {\r\n throw new DeveloperError(\"p2 is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const ray = scratchLineSegmentTriangleRay;\r\n Cartesian3.clone(v0, ray.origin);\r\n Cartesian3.subtract(v1, v0, ray.direction);\r\n Cartesian3.normalize(ray.direction, ray.direction);\r\n\r\n const t = IntersectionTests.rayTriangleParametric(\r\n ray,\r\n p0,\r\n p1,\r\n p2,\r\n cullBackFaces\r\n );\r\n if (!defined(t) || t < 0.0 || t > Cartesian3.distance(v0, v1)) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n Cartesian3.multiplyByScalar(ray.direction, t, result);\r\n return Cartesian3.add(ray.origin, result, result);\r\n};\r\n\r\nfunction solveQuadratic(a, b, c, result) {\r\n const det = b * b - 4.0 * a * c;\r\n if (det < 0.0) {\r\n return undefined;\r\n } else if (det > 0.0) {\r\n const denom = 1.0 / (2.0 * a);\r\n const disc = Math.sqrt(det);\r\n const root0 = (-b + disc) * denom;\r\n const root1 = (-b - disc) * denom;\r\n\r\n if (root0 < root1) {\r\n result.root0 = root0;\r\n result.root1 = root1;\r\n } else {\r\n result.root0 = root1;\r\n result.root1 = root0;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n const root = -b / (2.0 * a);\r\n if (root === 0.0) {\r\n return undefined;\r\n }\r\n\r\n result.root0 = result.root1 = root;\r\n return result;\r\n}\r\n\r\nconst raySphereRoots = {\r\n root0: 0.0,\r\n root1: 0.0,\r\n};\r\n\r\nfunction raySphere(ray, sphere, result) {\r\n if (!defined(result)) {\r\n result = new Interval();\r\n }\r\n\r\n const origin = ray.origin;\r\n const direction = ray.direction;\r\n\r\n const center = sphere.center;\r\n const radiusSquared = sphere.radius * sphere.radius;\r\n\r\n const diff = Cartesian3.subtract(origin, center, scratchPVec);\r\n\r\n const a = Cartesian3.dot(direction, direction);\r\n const b = 2.0 * Cartesian3.dot(direction, diff);\r\n const c = Cartesian3.magnitudeSquared(diff) - radiusSquared;\r\n\r\n const roots = solveQuadratic(a, b, c, raySphereRoots);\r\n if (!defined(roots)) {\r\n return undefined;\r\n }\r\n\r\n result.start = roots.root0;\r\n result.stop = roots.root1;\r\n return result;\r\n}\r\n\r\n/**\r\n * Computes the intersection points of a ray with a sphere.\r\n * @memberof IntersectionTests\r\n *\r\n * @param {Ray} ray The ray.\r\n * @param {BoundingSphere} sphere The sphere.\r\n * @param {Interval} [result] The result onto which to store the result.\r\n * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.\r\n */\r\nIntersectionTests.raySphere = function (ray, sphere, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(ray)) {\r\n throw new DeveloperError(\"ray is required.\");\r\n }\r\n if (!defined(sphere)) {\r\n throw new DeveloperError(\"sphere is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n result = raySphere(ray, sphere, result);\r\n if (!defined(result) || result.stop < 0.0) {\r\n return undefined;\r\n }\r\n\r\n result.start = Math.max(result.start, 0.0);\r\n return result;\r\n};\r\n\r\nconst scratchLineSegmentRay = new Ray();\r\n\r\n/**\r\n * Computes the intersection points of a line segment with a sphere.\r\n * @memberof IntersectionTests\r\n *\r\n * @param {Cartesian3} p0 An end point of the line segment.\r\n * @param {Cartesian3} p1 The other end point of the line segment.\r\n * @param {BoundingSphere} sphere The sphere.\r\n * @param {Interval} [result] The result onto which to store the result.\r\n * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.\r\n */\r\nIntersectionTests.lineSegmentSphere = function (p0, p1, sphere, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(p0)) {\r\n throw new DeveloperError(\"p0 is required.\");\r\n }\r\n if (!defined(p1)) {\r\n throw new DeveloperError(\"p1 is required.\");\r\n }\r\n if (!defined(sphere)) {\r\n throw new DeveloperError(\"sphere is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const ray = scratchLineSegmentRay;\r\n Cartesian3.clone(p0, ray.origin);\r\n const direction = Cartesian3.subtract(p1, p0, ray.direction);\r\n\r\n const maxT = Cartesian3.magnitude(direction);\r\n Cartesian3.normalize(direction, direction);\r\n\r\n result = raySphere(ray, sphere, result);\r\n if (!defined(result) || result.stop < 0.0 || result.start > maxT) {\r\n return undefined;\r\n }\r\n\r\n result.start = Math.max(result.start, 0.0);\r\n result.stop = Math.min(result.stop, maxT);\r\n return result;\r\n};\r\n\r\nconst scratchQ = new Cartesian3();\r\nconst scratchW = new Cartesian3();\r\n\r\n/**\r\n * Computes the intersection points of a ray with an ellipsoid.\r\n *\r\n * @param {Ray} ray The ray.\r\n * @param {Ellipsoid} ellipsoid The ellipsoid.\r\n * @returns {Interval} The interval containing scalar points along the ray or undefined if there are no intersections.\r\n */\r\nIntersectionTests.rayEllipsoid = function (ray, ellipsoid) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(ray)) {\r\n throw new DeveloperError(\"ray is required.\");\r\n }\r\n if (!defined(ellipsoid)) {\r\n throw new DeveloperError(\"ellipsoid is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const inverseRadii = ellipsoid.oneOverRadii;\r\n const q = Cartesian3.multiplyComponents(inverseRadii, ray.origin, scratchQ);\r\n const w = Cartesian3.multiplyComponents(\r\n inverseRadii,\r\n ray.direction,\r\n scratchW\r\n );\r\n\r\n const q2 = Cartesian3.magnitudeSquared(q);\r\n const qw = Cartesian3.dot(q, w);\r\n\r\n let difference, w2, product, discriminant, temp;\r\n\r\n if (q2 > 1.0) {\r\n // Outside ellipsoid.\r\n if (qw >= 0.0) {\r\n // Looking outward or tangent (0 intersections).\r\n return undefined;\r\n }\r\n\r\n // qw < 0.0.\r\n const qw2 = qw * qw;\r\n difference = q2 - 1.0; // Positively valued.\r\n w2 = Cartesian3.magnitudeSquared(w);\r\n product = w2 * difference;\r\n\r\n if (qw2 < product) {\r\n // Imaginary roots (0 intersections).\r\n return undefined;\r\n } else if (qw2 > product) {\r\n // Distinct roots (2 intersections).\r\n discriminant = qw * qw - product;\r\n temp = -qw + Math.sqrt(discriminant); // Avoid cancellation.\r\n const root0 = temp / w2;\r\n const root1 = difference / temp;\r\n if (root0 < root1) {\r\n return new Interval(root0, root1);\r\n }\r\n\r\n return {\r\n start: root1,\r\n stop: root0,\r\n };\r\n }\r\n // qw2 == product. Repeated roots (2 intersections).\r\n const root = Math.sqrt(difference / w2);\r\n return new Interval(root, root);\r\n } else if (q2 < 1.0) {\r\n // Inside ellipsoid (2 intersections).\r\n difference = q2 - 1.0; // Negatively valued.\r\n w2 = Cartesian3.magnitudeSquared(w);\r\n product = w2 * difference; // Negatively valued.\r\n\r\n discriminant = qw * qw - product;\r\n temp = -qw + Math.sqrt(discriminant); // Positively valued.\r\n return new Interval(0.0, temp / w2);\r\n }\r\n // q2 == 1.0. On ellipsoid.\r\n if (qw < 0.0) {\r\n // Looking inward.\r\n w2 = Cartesian3.magnitudeSquared(w);\r\n return new Interval(0.0, -qw / w2);\r\n }\r\n\r\n // qw >= 0.0. Looking outward or tangent.\r\n return undefined;\r\n};\r\n\r\nfunction addWithCancellationCheck(left, right, tolerance) {\r\n const difference = left + right;\r\n if (\r\n CesiumMath.sign(left) !== CesiumMath.sign(right) &&\r\n Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance\r\n ) {\r\n return 0.0;\r\n }\r\n\r\n return difference;\r\n}\r\n\r\nfunction quadraticVectorExpression(A, b, c, x, w) {\r\n const xSquared = x * x;\r\n const wSquared = w * w;\r\n\r\n const l2 = (A[Matrix3.COLUMN1ROW1] - A[Matrix3.COLUMN2ROW2]) * wSquared;\r\n const l1 =\r\n w *\r\n (x *\r\n addWithCancellationCheck(\r\n A[Matrix3.COLUMN1ROW0],\r\n A[Matrix3.COLUMN0ROW1],\r\n CesiumMath.EPSILON15\r\n ) +\r\n b.y);\r\n const l0 =\r\n A[Matrix3.COLUMN0ROW0] * xSquared +\r\n A[Matrix3.COLUMN2ROW2] * wSquared +\r\n x * b.x +\r\n c;\r\n\r\n const r1 =\r\n wSquared *\r\n addWithCancellationCheck(\r\n A[Matrix3.COLUMN2ROW1],\r\n A[Matrix3.COLUMN1ROW2],\r\n CesiumMath.EPSILON15\r\n );\r\n const r0 =\r\n w *\r\n (x *\r\n addWithCancellationCheck(A[Matrix3.COLUMN2ROW0], A[Matrix3.COLUMN0ROW2]) +\r\n b.z);\r\n\r\n let cosines;\r\n const solutions = [];\r\n if (r0 === 0.0 && r1 === 0.0) {\r\n cosines = QuadraticRealPolynomial.computeRealRoots(l2, l1, l0);\r\n if (cosines.length === 0) {\r\n return solutions;\r\n }\r\n\r\n const cosine0 = cosines[0];\r\n const sine0 = Math.sqrt(Math.max(1.0 - cosine0 * cosine0, 0.0));\r\n solutions.push(new Cartesian3(x, w * cosine0, w * -sine0));\r\n solutions.push(new Cartesian3(x, w * cosine0, w * sine0));\r\n\r\n if (cosines.length === 2) {\r\n const cosine1 = cosines[1];\r\n const sine1 = Math.sqrt(Math.max(1.0 - cosine1 * cosine1, 0.0));\r\n solutions.push(new Cartesian3(x, w * cosine1, w * -sine1));\r\n solutions.push(new Cartesian3(x, w * cosine1, w * sine1));\r\n }\r\n\r\n return solutions;\r\n }\r\n\r\n const r0Squared = r0 * r0;\r\n const r1Squared = r1 * r1;\r\n const l2Squared = l2 * l2;\r\n const r0r1 = r0 * r1;\r\n\r\n const c4 = l2Squared + r1Squared;\r\n const c3 = 2.0 * (l1 * l2 + r0r1);\r\n const c2 = 2.0 * l0 * l2 + l1 * l1 - r1Squared + r0Squared;\r\n const c1 = 2.0 * (l0 * l1 - r0r1);\r\n const c0 = l0 * l0 - r0Squared;\r\n\r\n if (c4 === 0.0 && c3 === 0.0 && c2 === 0.0 && c1 === 0.0) {\r\n return solutions;\r\n }\r\n\r\n cosines = QuarticRealPolynomial.computeRealRoots(c4, c3, c2, c1, c0);\r\n const length = cosines.length;\r\n if (length === 0) {\r\n return solutions;\r\n }\r\n\r\n for (let i = 0; i < length; ++i) {\r\n const cosine = cosines[i];\r\n const cosineSquared = cosine * cosine;\r\n const sineSquared = Math.max(1.0 - cosineSquared, 0.0);\r\n const sine = Math.sqrt(sineSquared);\r\n\r\n //const left = l2 * cosineSquared + l1 * cosine + l0;\r\n let left;\r\n if (CesiumMath.sign(l2) === CesiumMath.sign(l0)) {\r\n left = addWithCancellationCheck(\r\n l2 * cosineSquared + l0,\r\n l1 * cosine,\r\n CesiumMath.EPSILON12\r\n );\r\n } else if (CesiumMath.sign(l0) === CesiumMath.sign(l1 * cosine)) {\r\n left = addWithCancellationCheck(\r\n l2 * cosineSquared,\r\n l1 * cosine + l0,\r\n CesiumMath.EPSILON12\r\n );\r\n } else {\r\n left = addWithCancellationCheck(\r\n l2 * cosineSquared + l1 * cosine,\r\n l0,\r\n CesiumMath.EPSILON12\r\n );\r\n }\r\n\r\n const right = addWithCancellationCheck(\r\n r1 * cosine,\r\n r0,\r\n CesiumMath.EPSILON15\r\n );\r\n const product = left * right;\r\n\r\n if (product < 0.0) {\r\n solutions.push(new Cartesian3(x, w * cosine, w * sine));\r\n } else if (product > 0.0) {\r\n solutions.push(new Cartesian3(x, w * cosine, w * -sine));\r\n } else if (sine !== 0.0) {\r\n solutions.push(new Cartesian3(x, w * cosine, w * -sine));\r\n solutions.push(new Cartesian3(x, w * cosine, w * sine));\r\n ++i;\r\n } else {\r\n solutions.push(new Cartesian3(x, w * cosine, w * sine));\r\n }\r\n }\r\n\r\n return solutions;\r\n}\r\n\r\nconst firstAxisScratch = new Cartesian3();\r\nconst secondAxisScratch = new Cartesian3();\r\nconst thirdAxisScratch = new Cartesian3();\r\nconst referenceScratch = new Cartesian3();\r\nconst bCart = new Cartesian3();\r\nconst bScratch = new Matrix3();\r\nconst btScratch = new Matrix3();\r\nconst diScratch = new Matrix3();\r\nconst dScratch = new Matrix3();\r\nconst cScratch = new Matrix3();\r\nconst tempMatrix = new Matrix3();\r\nconst aScratch = new Matrix3();\r\nconst sScratch = new Cartesian3();\r\nconst closestScratch = new Cartesian3();\r\nconst surfPointScratch = new Cartographic();\r\n\r\n/**\r\n * Provides the point along the ray which is nearest to the ellipsoid.\r\n *\r\n * @param {Ray} ray The ray.\r\n * @param {Ellipsoid} ellipsoid The ellipsoid.\r\n * @returns {Cartesian3} The nearest planetodetic point on the ray.\r\n */\r\nIntersectionTests.grazingAltitudeLocation = function (ray, ellipsoid) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(ray)) {\r\n throw new DeveloperError(\"ray is required.\");\r\n }\r\n if (!defined(ellipsoid)) {\r\n throw new DeveloperError(\"ellipsoid is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const position = ray.origin;\r\n const direction = ray.direction;\r\n\r\n if (!Cartesian3.equals(position, Cartesian3.ZERO)) {\r\n const normal = ellipsoid.geodeticSurfaceNormal(position, firstAxisScratch);\r\n if (Cartesian3.dot(direction, normal) >= 0.0) {\r\n // The location provided is the closest point in altitude\r\n return position;\r\n }\r\n }\r\n\r\n const intersects = defined(this.rayEllipsoid(ray, ellipsoid));\r\n\r\n // Compute the scaled direction vector.\r\n const f = ellipsoid.transformPositionToScaledSpace(\r\n direction,\r\n firstAxisScratch\r\n );\r\n\r\n // Constructs a basis from the unit scaled direction vector. Construct its rotation and transpose.\r\n const firstAxis = Cartesian3.normalize(f, f);\r\n const reference = Cartesian3.mostOrthogonalAxis(f, referenceScratch);\r\n const secondAxis = Cartesian3.normalize(\r\n Cartesian3.cross(reference, firstAxis, secondAxisScratch),\r\n secondAxisScratch\r\n );\r\n const thirdAxis = Cartesian3.normalize(\r\n Cartesian3.cross(firstAxis, secondAxis, thirdAxisScratch),\r\n thirdAxisScratch\r\n );\r\n const B = bScratch;\r\n B[0] = firstAxis.x;\r\n B[1] = firstAxis.y;\r\n B[2] = firstAxis.z;\r\n B[3] = secondAxis.x;\r\n B[4] = secondAxis.y;\r\n B[5] = secondAxis.z;\r\n B[6] = thirdAxis.x;\r\n B[7] = thirdAxis.y;\r\n B[8] = thirdAxis.z;\r\n\r\n const B_T = Matrix3.transpose(B, btScratch);\r\n\r\n // Get the scaling matrix and its inverse.\r\n const D_I = Matrix3.fromScale(ellipsoid.radii, diScratch);\r\n const D = Matrix3.fromScale(ellipsoid.oneOverRadii, dScratch);\r\n\r\n const C = cScratch;\r\n C[0] = 0.0;\r\n C[1] = -direction.z;\r\n C[2] = direction.y;\r\n C[3] = direction.z;\r\n C[4] = 0.0;\r\n C[5] = -direction.x;\r\n C[6] = -direction.y;\r\n C[7] = direction.x;\r\n C[8] = 0.0;\r\n\r\n const temp = Matrix3.multiply(\r\n Matrix3.multiply(B_T, D, tempMatrix),\r\n C,\r\n tempMatrix\r\n );\r\n const A = Matrix3.multiply(\r\n Matrix3.multiply(temp, D_I, aScratch),\r\n B,\r\n aScratch\r\n );\r\n const b = Matrix3.multiplyByVector(temp, position, bCart);\r\n\r\n // Solve for the solutions to the expression in standard form:\r\n const solutions = quadraticVectorExpression(\r\n A,\r\n Cartesian3.negate(b, firstAxisScratch),\r\n 0.0,\r\n 0.0,\r\n 1.0\r\n );\r\n\r\n let s;\r\n let altitude;\r\n const length = solutions.length;\r\n if (length > 0) {\r\n let closest = Cartesian3.clone(Cartesian3.ZERO, closestScratch);\r\n let maximumValue = Number.NEGATIVE_INFINITY;\r\n\r\n for (let i = 0; i < length; ++i) {\r\n s = Matrix3.multiplyByVector(\r\n D_I,\r\n Matrix3.multiplyByVector(B, solutions[i], sScratch),\r\n sScratch\r\n );\r\n const v = Cartesian3.normalize(\r\n Cartesian3.subtract(s, position, referenceScratch),\r\n referenceScratch\r\n );\r\n const dotProduct = Cartesian3.dot(v, direction);\r\n\r\n if (dotProduct > maximumValue) {\r\n maximumValue = dotProduct;\r\n closest = Cartesian3.clone(s, closest);\r\n }\r\n }\r\n\r\n const surfacePoint = ellipsoid.cartesianToCartographic(\r\n closest,\r\n surfPointScratch\r\n );\r\n maximumValue = CesiumMath.clamp(maximumValue, 0.0, 1.0);\r\n altitude =\r\n Cartesian3.magnitude(\r\n Cartesian3.subtract(closest, position, referenceScratch)\r\n ) * Math.sqrt(1.0 - maximumValue * maximumValue);\r\n altitude = intersects ? -altitude : altitude;\r\n surfacePoint.height = altitude;\r\n return ellipsoid.cartographicToCartesian(surfacePoint, new Cartesian3());\r\n }\r\n\r\n return undefined;\r\n};\r\n\r\nconst lineSegmentPlaneDifference = new Cartesian3();\r\n\r\n/**\r\n * Computes the intersection of a line segment and a plane.\r\n *\r\n * @param {Cartesian3} endPoint0 An end point of the line segment.\r\n * @param {Cartesian3} endPoint1 The other end point of the line segment.\r\n * @param {Plane} plane The plane.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The intersection point or undefined if there is no intersection.\r\n *\r\n * @example\r\n * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\r\n * const normal = ellipsoid.geodeticSurfaceNormal(origin);\r\n * const plane = Cesium.Plane.fromPointNormal(origin, normal);\r\n *\r\n * const p0 = new Cesium.Cartesian3(...);\r\n * const p1 = new Cesium.Cartesian3(...);\r\n *\r\n * // find the intersection of the line segment from p0 to p1 and the tangent plane at origin.\r\n * const intersection = Cesium.IntersectionTests.lineSegmentPlane(p0, p1, plane);\r\n */\r\nIntersectionTests.lineSegmentPlane = function (\r\n endPoint0,\r\n endPoint1,\r\n plane,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(endPoint0)) {\r\n throw new DeveloperError(\"endPoint0 is required.\");\r\n }\r\n if (!defined(endPoint1)) {\r\n throw new DeveloperError(\"endPoint1 is required.\");\r\n }\r\n if (!defined(plane)) {\r\n throw new DeveloperError(\"plane is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n const difference = Cartesian3.subtract(\r\n endPoint1,\r\n endPoint0,\r\n lineSegmentPlaneDifference\r\n );\r\n const normal = plane.normal;\r\n const nDotDiff = Cartesian3.dot(normal, difference);\r\n\r\n // check if the segment and plane are parallel\r\n if (Math.abs(nDotDiff) < CesiumMath.EPSILON6) {\r\n return undefined;\r\n }\r\n\r\n const nDotP0 = Cartesian3.dot(normal, endPoint0);\r\n const t = -(plane.distance + nDotP0) / nDotDiff;\r\n\r\n // intersection only if t is in [0, 1]\r\n if (t < 0.0 || t > 1.0) {\r\n return undefined;\r\n }\r\n\r\n // intersection is endPoint0 + t * (endPoint1 - endPoint0)\r\n Cartesian3.multiplyByScalar(difference, t, result);\r\n Cartesian3.add(endPoint0, result, result);\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the intersection of a triangle and a plane\r\n *\r\n * @param {Cartesian3} p0 First point of the triangle\r\n * @param {Cartesian3} p1 Second point of the triangle\r\n * @param {Cartesian3} p2 Third point of the triangle\r\n * @param {Plane} plane Intersection plane\r\n * @returns {Object} An object with properties positions
and indices
, which are arrays that represent three triangles that do not cross the plane. (Undefined if no intersection exists)\r\n *\r\n * @example\r\n * const origin = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);\r\n * const normal = ellipsoid.geodeticSurfaceNormal(origin);\r\n * const plane = Cesium.Plane.fromPointNormal(origin, normal);\r\n *\r\n * const p0 = new Cesium.Cartesian3(...);\r\n * const p1 = new Cesium.Cartesian3(...);\r\n * const p2 = new Cesium.Cartesian3(...);\r\n *\r\n * // convert the triangle composed of points (p0, p1, p2) to three triangles that don't cross the plane\r\n * const triangles = Cesium.IntersectionTests.trianglePlaneIntersection(p0, p1, p2, plane);\r\n */\r\nIntersectionTests.trianglePlaneIntersection = function (p0, p1, p2, plane) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(p0) || !defined(p1) || !defined(p2) || !defined(plane)) {\r\n throw new DeveloperError(\"p0, p1, p2, and plane are required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const planeNormal = plane.normal;\r\n const planeD = plane.distance;\r\n const p0Behind = Cartesian3.dot(planeNormal, p0) + planeD < 0.0;\r\n const p1Behind = Cartesian3.dot(planeNormal, p1) + planeD < 0.0;\r\n const p2Behind = Cartesian3.dot(planeNormal, p2) + planeD < 0.0;\r\n // Given these dots products, the calls to lineSegmentPlaneIntersection\r\n // always have defined results.\r\n\r\n let numBehind = 0;\r\n numBehind += p0Behind ? 1 : 0;\r\n numBehind += p1Behind ? 1 : 0;\r\n numBehind += p2Behind ? 1 : 0;\r\n\r\n let u1, u2;\r\n if (numBehind === 1 || numBehind === 2) {\r\n u1 = new Cartesian3();\r\n u2 = new Cartesian3();\r\n }\r\n\r\n if (numBehind === 1) {\r\n if (p0Behind) {\r\n IntersectionTests.lineSegmentPlane(p0, p1, plane, u1);\r\n IntersectionTests.lineSegmentPlane(p0, p2, plane, u2);\r\n\r\n return {\r\n positions: [p0, p1, p2, u1, u2],\r\n indices: [\r\n // Behind\r\n 0,\r\n 3,\r\n 4,\r\n\r\n // In front\r\n 1,\r\n 2,\r\n 4,\r\n 1,\r\n 4,\r\n 3,\r\n ],\r\n };\r\n } else if (p1Behind) {\r\n IntersectionTests.lineSegmentPlane(p1, p2, plane, u1);\r\n IntersectionTests.lineSegmentPlane(p1, p0, plane, u2);\r\n\r\n return {\r\n positions: [p0, p1, p2, u1, u2],\r\n indices: [\r\n // Behind\r\n 1,\r\n 3,\r\n 4,\r\n\r\n // In front\r\n 2,\r\n 0,\r\n 4,\r\n 2,\r\n 4,\r\n 3,\r\n ],\r\n };\r\n } else if (p2Behind) {\r\n IntersectionTests.lineSegmentPlane(p2, p0, plane, u1);\r\n IntersectionTests.lineSegmentPlane(p2, p1, plane, u2);\r\n\r\n return {\r\n positions: [p0, p1, p2, u1, u2],\r\n indices: [\r\n // Behind\r\n 2,\r\n 3,\r\n 4,\r\n\r\n // In front\r\n 0,\r\n 1,\r\n 4,\r\n 0,\r\n 4,\r\n 3,\r\n ],\r\n };\r\n }\r\n } else if (numBehind === 2) {\r\n if (!p0Behind) {\r\n IntersectionTests.lineSegmentPlane(p1, p0, plane, u1);\r\n IntersectionTests.lineSegmentPlane(p2, p0, plane, u2);\r\n\r\n return {\r\n positions: [p0, p1, p2, u1, u2],\r\n indices: [\r\n // Behind\r\n 1,\r\n 2,\r\n 4,\r\n 1,\r\n 4,\r\n 3,\r\n\r\n // In front\r\n 0,\r\n 3,\r\n 4,\r\n ],\r\n };\r\n } else if (!p1Behind) {\r\n IntersectionTests.lineSegmentPlane(p2, p1, plane, u1);\r\n IntersectionTests.lineSegmentPlane(p0, p1, plane, u2);\r\n\r\n return {\r\n positions: [p0, p1, p2, u1, u2],\r\n indices: [\r\n // Behind\r\n 2,\r\n 0,\r\n 4,\r\n 2,\r\n 4,\r\n 3,\r\n\r\n // In front\r\n 1,\r\n 3,\r\n 4,\r\n ],\r\n };\r\n } else if (!p2Behind) {\r\n IntersectionTests.lineSegmentPlane(p0, p2, plane, u1);\r\n IntersectionTests.lineSegmentPlane(p1, p2, plane, u2);\r\n\r\n return {\r\n positions: [p0, p1, p2, u1, u2],\r\n indices: [\r\n // Behind\r\n 0,\r\n 1,\r\n 4,\r\n 0,\r\n 4,\r\n 3,\r\n\r\n // In front\r\n 2,\r\n 3,\r\n 4,\r\n ],\r\n };\r\n }\r\n }\r\n\r\n // if numBehind is 3, the triangle is completely behind the plane;\r\n // otherwise, it is completely in front (numBehind is 0).\r\n return undefined;\r\n};\r\nexport default IntersectionTests;\r\n"],"names":["DeveloperError","addWithCancellationCheck","CesiumMath","QuadraticRealPolynomial","CubicRealPolynomial","Cartesian3","defaultValue","defined","Check","Interval","Matrix3","QuarticRealPolynomial","Cartographic"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;EACA;EACA;EACA;EACA;EACA,MAAM,uBAAuB,GAAG,EAAE,CAAC;AACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,uBAAuB,CAAC,mBAAmB,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;EACjE;EACA,EAAE,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;EAC7B,IAAI,MAAM,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U,CAAC;EACX,UAAU,CAAC;EACX,UAAU,CAAC;EACX,SAAS;EACT,OAAO,CAAC;EACR,KAAK,MAAM,IAAI,CAAC,QAAQ,EAAE;EAC1B,MAAM,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;EAC5D,MAAM,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAC5D;EACA,MAAM,OAAO;EACb,QAAQ,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;EACvC,QAAQ,OAAO,EAAE;EACjB;EACA,UAAU,CAAC;EACX,UAAU,CAAC;EACX,UAAU,CAAC;EACX,UAAU,CAAC;EACX,UAAU,CAAC;EACX,UAAU,CAAC;AACX;EACA;EACA,UAAU,CAAC;EACX,UAAU,CAAC;EACX,UAAU,CAAC;EACX,SAAS;EACT,OAAO,CAAC;EACR,KAAK;EACL,GAAG;AACH;EACA;EACA;EACA,EAAE,OAAO,SAAS,CAAC;EACnB,CAAC,CAAC;AACF,4BAAe,iBAAiB;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/Math-9be8b918.js b/examples/cesium/Workers/Math-9be8b918.js
new file mode 100644
index 0000000..f1575e8
--- /dev/null
+++ b/examples/cesium/Workers/Math-9be8b918.js
@@ -0,0 +1,1356 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Check-d10e5f2e', './defaultValue-0ab18f7d'], (function (exports, Check, defaultValue) { 'use strict';
+
+ /*
+ https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
+ so it's better encapsulated. Now you can have multiple random number generators
+ and they won't stomp all over eachother's state.
+
+ If you want to use this as a substitute for Math.random(), use the random()
+ method like so:
+
+ var m = new MersenneTwister();
+ var randomNumber = m.random();
+
+ You can also call the other genrand_{foo}() methods on the instance.
+
+ If you want to use a specific seed in order to get a repeatable random
+ sequence, pass an integer into the constructor:
+
+ var m = new MersenneTwister(123);
+
+ and that will always produce the same random sequence.
+
+ Sean McCullough (banksean@gmail.com)
+ */
+
+ /*
+ A C-program for MT19937, with initialization improved 2002/1/26.
+ Coded by Takuji Nishimura and Makoto Matsumoto.
+
+ Before using, initialize the state by using init_seed(seed)
+ or init_by_array(init_key, key_length).
+
+ 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.
+
+
+ Any feedback is very welcome.
+ http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html
+ email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)
+ */
+
+ var MersenneTwister = function(seed) {
+ if (seed == undefined) {
+ seed = new Date().getTime();
+ }
+
+ /* Period parameters */
+ this.N = 624;
+ this.M = 397;
+ this.MATRIX_A = 0x9908b0df; /* constant vector a */
+ this.UPPER_MASK = 0x80000000; /* most significant w-r bits */
+ this.LOWER_MASK = 0x7fffffff; /* least significant r bits */
+
+ this.mt = new Array(this.N); /* the array for the state vector */
+ this.mti=this.N+1; /* mti==N+1 means mt[N] is not initialized */
+
+ if (seed.constructor == Array) {
+ this.init_by_array(seed, seed.length);
+ }
+ else {
+ this.init_seed(seed);
+ }
+ };
+
+ /* initializes mt[N] with a seed */
+ /* origin name init_genrand */
+ MersenneTwister.prototype.init_seed = function(s) {
+ this.mt[0] = s >>> 0;
+ for (this.mti=1; this.mti>> 30);
+ this.mt[this.mti] = (((((s & 0xffff0000) >>> 16) * 1812433253) << 16) + (s & 0x0000ffff) * 1812433253)
+ + this.mti;
+ /* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */
+ /* In the previous versions, MSBs of the seed affect */
+ /* only MSBs of the array mt[]. */
+ /* 2002/01/09 modified by Makoto Matsumoto */
+ this.mt[this.mti] >>>= 0;
+ /* for >32 bit machines */
+ }
+ };
+
+ /* initialize by an array with array-length */
+ /* init_key is the array for initializing keys */
+ /* key_length is its length */
+ /* slight change for C++, 2004/2/26 */
+ MersenneTwister.prototype.init_by_array = function(init_key, key_length) {
+ var i, j, k;
+ this.init_seed(19650218);
+ i=1; j=0;
+ k = (this.N>key_length ? this.N : key_length);
+ for (; k; k--) {
+ var s = this.mt[i-1] ^ (this.mt[i-1] >>> 30);
+ this.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1664525) << 16) + ((s & 0x0000ffff) * 1664525)))
+ + init_key[j] + j; /* non linear */
+ this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */
+ i++; j++;
+ if (i>=this.N) { this.mt[0] = this.mt[this.N-1]; i=1; }
+ if (j>=key_length) j=0;
+ }
+ for (k=this.N-1; k; k--) {
+ var s = this.mt[i-1] ^ (this.mt[i-1] >>> 30);
+ this.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) + (s & 0x0000ffff) * 1566083941))
+ - i; /* non linear */
+ this.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */
+ i++;
+ if (i>=this.N) { this.mt[0] = this.mt[this.N-1]; i=1; }
+ }
+
+ this.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */
+ };
+
+ /* generates a random number on [0,0xffffffff]-interval */
+ /* origin name genrand_int32 */
+ MersenneTwister.prototype.random_int = function() {
+ var y;
+ var mag01 = new Array(0x0, this.MATRIX_A);
+ /* mag01[x] = x * MATRIX_A for x=0,1 */
+
+ if (this.mti >= this.N) { /* generate N words at one time */
+ var kk;
+
+ if (this.mti == this.N+1) /* if init_seed() has not been called, */
+ this.init_seed(5489); /* a default initial seed is used */
+
+ for (kk=0;kk>> 1) ^ mag01[y & 0x1];
+ }
+ for (;kk>> 1) ^ mag01[y & 0x1];
+ }
+ y = (this.mt[this.N-1]&this.UPPER_MASK)|(this.mt[0]&this.LOWER_MASK);
+ this.mt[this.N-1] = this.mt[this.M-1] ^ (y >>> 1) ^ mag01[y & 0x1];
+
+ this.mti = 0;
+ }
+
+ y = this.mt[this.mti++];
+
+ /* Tempering */
+ y ^= (y >>> 11);
+ y ^= (y << 7) & 0x9d2c5680;
+ y ^= (y << 15) & 0xefc60000;
+ y ^= (y >>> 18);
+
+ return y >>> 0;
+ };
+
+ /* generates a random number on [0,0x7fffffff]-interval */
+ /* origin name genrand_int31 */
+ MersenneTwister.prototype.random_int31 = function() {
+ return (this.random_int()>>>1);
+ };
+
+ /* generates a random number on [0,1]-real-interval */
+ /* origin name genrand_real1 */
+ MersenneTwister.prototype.random_incl = function() {
+ return this.random_int()*(1.0/4294967295.0);
+ /* divided by 2^32-1 */
+ };
+
+ /* generates a random number on [0,1)-real-interval */
+ MersenneTwister.prototype.random = function() {
+ return this.random_int()*(1.0/4294967296.0);
+ /* divided by 2^32 */
+ };
+
+ /* generates a random number on (0,1)-real-interval */
+ /* origin name genrand_real3 */
+ MersenneTwister.prototype.random_excl = function() {
+ return (this.random_int() + 0.5)*(1.0/4294967296.0);
+ /* divided by 2^32 */
+ };
+
+ /* generates a random number on [0,1) with 53-bit resolution*/
+ /* origin name genrand_res53 */
+ MersenneTwister.prototype.random_long = function() {
+ var a=this.random_int()>>>5, b=this.random_int()>>>6;
+ return (a*67108864.0+b)*(1.0/9007199254740992.0);
+ };
+
+ /* These real versions are due to Isaku Wada, 2002/01/09 added */
+
+ var mersenneTwister = MersenneTwister;
+
+ /**
+ * Math functions.
+ *
+ * @exports CesiumMath
+ * @alias Math
+ */
+ const CesiumMath = {};
+
+ /**
+ * 0.1
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON1 = 0.1;
+
+ /**
+ * 0.01
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON2 = 0.01;
+
+ /**
+ * 0.001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON3 = 0.001;
+
+ /**
+ * 0.0001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON4 = 0.0001;
+
+ /**
+ * 0.00001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON5 = 0.00001;
+
+ /**
+ * 0.000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON6 = 0.000001;
+
+ /**
+ * 0.0000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON7 = 0.0000001;
+
+ /**
+ * 0.00000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON8 = 0.00000001;
+
+ /**
+ * 0.000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON9 = 0.000000001;
+
+ /**
+ * 0.0000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON10 = 0.0000000001;
+
+ /**
+ * 0.00000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON11 = 0.00000000001;
+
+ /**
+ * 0.000000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON12 = 0.000000000001;
+
+ /**
+ * 0.0000000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON13 = 0.0000000000001;
+
+ /**
+ * 0.00000000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON14 = 0.00000000000001;
+
+ /**
+ * 0.000000000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON15 = 0.000000000000001;
+
+ /**
+ * 0.0000000000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON16 = 0.0000000000000001;
+
+ /**
+ * 0.00000000000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON17 = 0.00000000000000001;
+
+ /**
+ * 0.000000000000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON18 = 0.000000000000000001;
+
+ /**
+ * 0.0000000000000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON19 = 0.0000000000000000001;
+
+ /**
+ * 0.00000000000000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON20 = 0.00000000000000000001;
+
+ /**
+ * 0.000000000000000000001
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.EPSILON21 = 0.000000000000000000001;
+
+ /**
+ * The gravitational parameter of the Earth in meters cubed
+ * per second squared as defined by the WGS84 model: 3.986004418e14
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.GRAVITATIONALPARAMETER = 3.986004418e14;
+
+ /**
+ * Radius of the sun in meters: 6.955e8
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.SOLAR_RADIUS = 6.955e8;
+
+ /**
+ * The mean radius of the moon, according to the "Report of the IAU/IAG Working Group on
+ * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000",
+ * Celestial Mechanics 82: 83-110, 2002.
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.LUNAR_RADIUS = 1737400.0;
+
+ /**
+ * 64 * 1024
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.SIXTY_FOUR_KILOBYTES = 64 * 1024;
+
+ /**
+ * 4 * 1024 * 1024 * 1024
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.FOUR_GIGABYTES = 4 * 1024 * 1024 * 1024;
+
+ /**
+ * Returns the sign of the value; 1 if the value is positive, -1 if the value is
+ * negative, or 0 if the value is 0.
+ *
+ * @function
+ * @param {Number} value The value to return the sign of.
+ * @returns {Number} The sign of value.
+ */
+ // eslint-disable-next-line es/no-math-sign
+ CesiumMath.sign = defaultValue.defaultValue(Math.sign, function sign(value) {
+ value = +value; // coerce to number
+ if (value === 0 || value !== value) {
+ // zero or NaN
+ return value;
+ }
+ return value > 0 ? 1 : -1;
+ });
+
+ /**
+ * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.
+ * This is similar to {@link CesiumMath#sign} except that returns 1.0 instead of
+ * 0.0 when the input value is 0.0.
+ * @param {Number} value The value to return the sign of.
+ * @returns {Number} The sign of value.
+ */
+ CesiumMath.signNotZero = function (value) {
+ return value < 0.0 ? -1.0 : 1.0;
+ };
+
+ /**
+ * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]
+ * @param {Number} value The scalar value in the range [-1.0, 1.0]
+ * @param {Number} [rangeMaximum=255] The maximum value in the mapped range, 255 by default.
+ * @returns {Number} A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.
+ *
+ * @see CesiumMath.fromSNorm
+ */
+ CesiumMath.toSNorm = function (value, rangeMaximum) {
+ rangeMaximum = defaultValue.defaultValue(rangeMaximum, 255);
+ return Math.round(
+ (CesiumMath.clamp(value, -1.0, 1.0) * 0.5 + 0.5) * rangeMaximum
+ );
+ };
+
+ /**
+ * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].
+ * @param {Number} value SNORM value in the range [0, rangeMaximum]
+ * @param {Number} [rangeMaximum=255] The maximum value in the SNORM range, 255 by default.
+ * @returns {Number} Scalar in the range [-1.0, 1.0].
+ *
+ * @see CesiumMath.toSNorm
+ */
+ CesiumMath.fromSNorm = function (value, rangeMaximum) {
+ rangeMaximum = defaultValue.defaultValue(rangeMaximum, 255);
+ return (
+ (CesiumMath.clamp(value, 0.0, rangeMaximum) / rangeMaximum) * 2.0 - 1.0
+ );
+ };
+
+ /**
+ * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]
+ * @param {Number} value The scalar value in the range [rangeMinimum, rangeMaximum]
+ * @param {Number} rangeMinimum The minimum value in the mapped range.
+ * @param {Number} rangeMaximum The maximum value in the mapped range.
+ * @returns {Number} A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.
+ */
+ CesiumMath.normalize = function (value, rangeMinimum, rangeMaximum) {
+ rangeMaximum = Math.max(rangeMaximum - rangeMinimum, 0.0);
+ return rangeMaximum === 0.0
+ ? 0.0
+ : CesiumMath.clamp((value - rangeMinimum) / rangeMaximum, 0.0, 1.0);
+ };
+
+ /**
+ * Returns the hyperbolic sine of a number.
+ * The hyperbolic sine of value is defined to be
+ * (ex - e-x)/2.0
+ * where e is Euler's number, approximately 2.71828183.
+ *
+ * Special cases:
+ *
+ * - If the argument is NaN, then the result is NaN.
+ *
+ * - If the argument is infinite, then the result is an infinity
+ * with the same sign as the argument.
+ *
+ * - If the argument is zero, then the result is a zero with the
+ * same sign as the argument.
+ *
+ *
+ *
+ * @function
+ * @param {Number} value The number whose hyperbolic sine is to be returned.
+ * @returns {Number} The hyperbolic sine of value
.
+ */
+ // eslint-disable-next-line es/no-math-sinh
+ CesiumMath.sinh = defaultValue.defaultValue(Math.sinh, function sinh(value) {
+ return (Math.exp(value) - Math.exp(-value)) / 2.0;
+ });
+
+ /**
+ * Returns the hyperbolic cosine of a number.
+ * The hyperbolic cosine of value is defined to be
+ * (ex + e-x)/2.0
+ * where e is Euler's number, approximately 2.71828183.
+ *
+ * Special cases:
+ *
+ * - If the argument is NaN, then the result is NaN.
+ *
+ * - If the argument is infinite, then the result is positive infinity.
+ *
+ * - If the argument is zero, then the result is 1.0.
+ *
+ *
+ *
+ * @function
+ * @param {Number} value The number whose hyperbolic cosine is to be returned.
+ * @returns {Number} The hyperbolic cosine of value
.
+ */
+ // eslint-disable-next-line es/no-math-cosh
+ CesiumMath.cosh = defaultValue.defaultValue(Math.cosh, function cosh(value) {
+ return (Math.exp(value) + Math.exp(-value)) / 2.0;
+ });
+
+ /**
+ * Computes the linear interpolation of two values.
+ *
+ * @param {Number} p The start value to interpolate.
+ * @param {Number} q The end value to interpolate.
+ * @param {Number} time The time of interpolation generally in the range [0.0, 1.0]
.
+ * @returns {Number} The linearly interpolated value.
+ *
+ * @example
+ * const n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0
+ */
+ CesiumMath.lerp = function (p, q, time) {
+ return (1.0 - time) * p + time * q;
+ };
+
+ /**
+ * pi
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.PI = Math.PI;
+
+ /**
+ * 1/pi
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.ONE_OVER_PI = 1.0 / Math.PI;
+
+ /**
+ * pi/2
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.PI_OVER_TWO = Math.PI / 2.0;
+
+ /**
+ * pi/3
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.PI_OVER_THREE = Math.PI / 3.0;
+
+ /**
+ * pi/4
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.PI_OVER_FOUR = Math.PI / 4.0;
+
+ /**
+ * pi/6
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.PI_OVER_SIX = Math.PI / 6.0;
+
+ /**
+ * 3pi/2
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.THREE_PI_OVER_TWO = (3.0 * Math.PI) / 2.0;
+
+ /**
+ * 2pi
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.TWO_PI = 2.0 * Math.PI;
+
+ /**
+ * 1/2pi
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.ONE_OVER_TWO_PI = 1.0 / (2.0 * Math.PI);
+
+ /**
+ * The number of radians in a degree.
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.RADIANS_PER_DEGREE = Math.PI / 180.0;
+
+ /**
+ * The number of degrees in a radian.
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.DEGREES_PER_RADIAN = 180.0 / Math.PI;
+
+ /**
+ * The number of radians in an arc second.
+ *
+ * @type {Number}
+ * @constant
+ */
+ CesiumMath.RADIANS_PER_ARCSECOND = CesiumMath.RADIANS_PER_DEGREE / 3600.0;
+
+ /**
+ * Converts degrees to radians.
+ * @param {Number} degrees The angle to convert in degrees.
+ * @returns {Number} The corresponding angle in radians.
+ */
+ CesiumMath.toRadians = function (degrees) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(degrees)) {
+ throw new Check.DeveloperError("degrees is required.");
+ }
+ //>>includeEnd('debug');
+ return degrees * CesiumMath.RADIANS_PER_DEGREE;
+ };
+
+ /**
+ * Converts radians to degrees.
+ * @param {Number} radians The angle to convert in radians.
+ * @returns {Number} The corresponding angle in degrees.
+ */
+ CesiumMath.toDegrees = function (radians) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(radians)) {
+ throw new Check.DeveloperError("radians is required.");
+ }
+ //>>includeEnd('debug');
+ return radians * CesiumMath.DEGREES_PER_RADIAN;
+ };
+
+ /**
+ * Converts a longitude value, in radians, to the range [-Math.PI
, Math.PI
).
+ *
+ * @param {Number} angle The longitude value, in radians, to convert to the range [-Math.PI
, Math.PI
).
+ * @returns {Number} The equivalent longitude value in the range [-Math.PI
, Math.PI
).
+ *
+ * @example
+ * // Convert 270 degrees to -90 degrees longitude
+ * const longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));
+ */
+ CesiumMath.convertLongitudeRange = function (angle) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(angle)) {
+ throw new Check.DeveloperError("angle is required.");
+ }
+ //>>includeEnd('debug');
+ const twoPi = CesiumMath.TWO_PI;
+
+ const simplified = angle - Math.floor(angle / twoPi) * twoPi;
+
+ if (simplified < -Math.PI) {
+ return simplified + twoPi;
+ }
+ if (simplified >= Math.PI) {
+ return simplified - twoPi;
+ }
+
+ return simplified;
+ };
+
+ /**
+ * Convenience function that clamps a latitude value, in radians, to the range [-Math.PI/2
, Math.PI/2
).
+ * Useful for sanitizing data before use in objects requiring correct range.
+ *
+ * @param {Number} angle The latitude value, in radians, to clamp to the range [-Math.PI/2
, Math.PI/2
).
+ * @returns {Number} The latitude value clamped to the range [-Math.PI/2
, Math.PI/2
).
+ *
+ * @example
+ * // Clamp 108 degrees latitude to 90 degrees latitude
+ * const latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));
+ */
+ CesiumMath.clampToLatitudeRange = function (angle) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(angle)) {
+ throw new Check.DeveloperError("angle is required.");
+ }
+ //>>includeEnd('debug');
+
+ return CesiumMath.clamp(
+ angle,
+ -1 * CesiumMath.PI_OVER_TWO,
+ CesiumMath.PI_OVER_TWO
+ );
+ };
+
+ /**
+ * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
+ *
+ * @param {Number} angle in radians
+ * @returns {Number} The angle in the range [-CesiumMath.PI
, CesiumMath.PI
].
+ */
+ CesiumMath.negativePiToPi = function (angle) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(angle)) {
+ throw new Check.DeveloperError("angle is required.");
+ }
+ //>>includeEnd('debug');
+ if (angle >= -CesiumMath.PI && angle <= CesiumMath.PI) {
+ // Early exit if the input is already inside the range. This avoids
+ // unnecessary math which could introduce floating point error.
+ return angle;
+ }
+ return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI;
+ };
+
+ /**
+ * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
+ *
+ * @param {Number} angle in radians
+ * @returns {Number} The angle in the range [0, CesiumMath.TWO_PI
].
+ */
+ CesiumMath.zeroToTwoPi = function (angle) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(angle)) {
+ throw new Check.DeveloperError("angle is required.");
+ }
+ //>>includeEnd('debug');
+ if (angle >= 0 && angle <= CesiumMath.TWO_PI) {
+ // Early exit if the input is already inside the range. This avoids
+ // unnecessary math which could introduce floating point error.
+ return angle;
+ }
+ const mod = CesiumMath.mod(angle, CesiumMath.TWO_PI);
+ if (
+ Math.abs(mod) < CesiumMath.EPSILON14 &&
+ Math.abs(angle) > CesiumMath.EPSILON14
+ ) {
+ return CesiumMath.TWO_PI;
+ }
+ return mod;
+ };
+
+ /**
+ * The modulo operation that also works for negative dividends.
+ *
+ * @param {Number} m The dividend.
+ * @param {Number} n The divisor.
+ * @returns {Number} The remainder.
+ */
+ CesiumMath.mod = function (m, n) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(m)) {
+ throw new Check.DeveloperError("m is required.");
+ }
+ if (!defaultValue.defined(n)) {
+ throw new Check.DeveloperError("n is required.");
+ }
+ if (n === 0.0) {
+ throw new Check.DeveloperError("divisor cannot be 0.");
+ }
+ //>>includeEnd('debug');
+ if (CesiumMath.sign(m) === CesiumMath.sign(n) && Math.abs(m) < Math.abs(n)) {
+ // Early exit if the input does not need to be modded. This avoids
+ // unnecessary math which could introduce floating point error.
+ return m;
+ }
+
+ return ((m % n) + n) % n;
+ };
+
+ /**
+ * Determines if two values are equal using an absolute or relative tolerance test. This is useful
+ * to avoid problems due to roundoff error when comparing floating-point values directly. The values are
+ * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.
+ * Use this test if you are unsure of the magnitudes of left and right.
+ *
+ * @param {Number} left The first value to compare.
+ * @param {Number} right The other value to compare.
+ * @param {Number} [relativeEpsilon=0] The maximum inclusive delta between left
and right
for the relative tolerance test.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The maximum inclusive delta between left
and right
for the absolute tolerance test.
+ * @returns {Boolean} true
if the values are equal within the epsilon; otherwise, false
.
+ *
+ * @example
+ * const a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true
+ * const b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false
+ * const c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true
+ * const d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false
+ */
+ CesiumMath.equalsEpsilon = function (
+ left,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(left)) {
+ throw new Check.DeveloperError("left is required.");
+ }
+ if (!defaultValue.defined(right)) {
+ throw new Check.DeveloperError("right is required.");
+ }
+ //>>includeEnd('debug');
+
+ relativeEpsilon = defaultValue.defaultValue(relativeEpsilon, 0.0);
+ absoluteEpsilon = defaultValue.defaultValue(absoluteEpsilon, relativeEpsilon);
+ const absDiff = Math.abs(left - right);
+ return (
+ absDiff <= absoluteEpsilon ||
+ absDiff <= relativeEpsilon * Math.max(Math.abs(left), Math.abs(right))
+ );
+ };
+
+ /**
+ * Determines if the left value is less than the right value. If the two values are within
+ * absoluteEpsilon
of each other, they are considered equal and this function returns false.
+ *
+ * @param {Number} left The first number to compare.
+ * @param {Number} right The second number to compare.
+ * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.
+ * @returns {Boolean} true
if left
is less than right
by more than
+ * absoluteEpsilon. false
if left
is greater or if the two
+ * values are nearly equal.
+ */
+ CesiumMath.lessThan = function (left, right, absoluteEpsilon) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(left)) {
+ throw new Check.DeveloperError("first is required.");
+ }
+ if (!defaultValue.defined(right)) {
+ throw new Check.DeveloperError("second is required.");
+ }
+ if (!defaultValue.defined(absoluteEpsilon)) {
+ throw new Check.DeveloperError("absoluteEpsilon is required.");
+ }
+ //>>includeEnd('debug');
+ return left - right < -absoluteEpsilon;
+ };
+
+ /**
+ * Determines if the left value is less than or equal to the right value. If the two values are within
+ * absoluteEpsilon
of each other, they are considered equal and this function returns true.
+ *
+ * @param {Number} left The first number to compare.
+ * @param {Number} right The second number to compare.
+ * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.
+ * @returns {Boolean} true
if left
is less than right
or if the
+ * the values are nearly equal.
+ */
+ CesiumMath.lessThanOrEquals = function (left, right, absoluteEpsilon) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(left)) {
+ throw new Check.DeveloperError("first is required.");
+ }
+ if (!defaultValue.defined(right)) {
+ throw new Check.DeveloperError("second is required.");
+ }
+ if (!defaultValue.defined(absoluteEpsilon)) {
+ throw new Check.DeveloperError("absoluteEpsilon is required.");
+ }
+ //>>includeEnd('debug');
+ return left - right < absoluteEpsilon;
+ };
+
+ /**
+ * Determines if the left value is greater the right value. If the two values are within
+ * absoluteEpsilon
of each other, they are considered equal and this function returns false.
+ *
+ * @param {Number} left The first number to compare.
+ * @param {Number} right The second number to compare.
+ * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.
+ * @returns {Boolean} true
if left
is greater than right
by more than
+ * absoluteEpsilon. false
if left
is less or if the two
+ * values are nearly equal.
+ */
+ CesiumMath.greaterThan = function (left, right, absoluteEpsilon) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(left)) {
+ throw new Check.DeveloperError("first is required.");
+ }
+ if (!defaultValue.defined(right)) {
+ throw new Check.DeveloperError("second is required.");
+ }
+ if (!defaultValue.defined(absoluteEpsilon)) {
+ throw new Check.DeveloperError("absoluteEpsilon is required.");
+ }
+ //>>includeEnd('debug');
+ return left - right > absoluteEpsilon;
+ };
+
+ /**
+ * Determines if the left value is greater than or equal to the right value. If the two values are within
+ * absoluteEpsilon
of each other, they are considered equal and this function returns true.
+ *
+ * @param {Number} left The first number to compare.
+ * @param {Number} right The second number to compare.
+ * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.
+ * @returns {Boolean} true
if left
is greater than right
or if the
+ * the values are nearly equal.
+ */
+ CesiumMath.greaterThanOrEquals = function (left, right, absoluteEpsilon) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(left)) {
+ throw new Check.DeveloperError("first is required.");
+ }
+ if (!defaultValue.defined(right)) {
+ throw new Check.DeveloperError("second is required.");
+ }
+ if (!defaultValue.defined(absoluteEpsilon)) {
+ throw new Check.DeveloperError("absoluteEpsilon is required.");
+ }
+ //>>includeEnd('debug');
+ return left - right > -absoluteEpsilon;
+ };
+
+ const factorials = [1];
+
+ /**
+ * Computes the factorial of the provided number.
+ *
+ * @param {Number} n The number whose factorial is to be computed.
+ * @returns {Number} The factorial of the provided number or undefined if the number is less than 0.
+ *
+ * @exception {DeveloperError} A number greater than or equal to 0 is required.
+ *
+ *
+ * @example
+ * //Compute 7!, which is equal to 5040
+ * const computedFactorial = Cesium.Math.factorial(7);
+ *
+ * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia}
+ */
+ CesiumMath.factorial = function (n) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof n !== "number" || n < 0) {
+ throw new Check.DeveloperError(
+ "A number greater than or equal to 0 is required."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const length = factorials.length;
+ if (n >= length) {
+ let sum = factorials[length - 1];
+ for (let i = length; i <= n; i++) {
+ const next = sum * i;
+ factorials.push(next);
+ sum = next;
+ }
+ }
+ return factorials[n];
+ };
+
+ /**
+ * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.
+ *
+ * @param {Number} [n] The number to be incremented.
+ * @param {Number} [maximumValue] The maximum incremented value before rolling over to the minimum value.
+ * @param {Number} [minimumValue=0.0] The number reset to after the maximum value has been exceeded.
+ * @returns {Number} The incremented number.
+ *
+ * @exception {DeveloperError} Maximum value must be greater than minimum value.
+ *
+ * @example
+ * const n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6
+ * const m = Cesium.Math.incrementWrap(10, 10, 0); // returns 0
+ */
+ CesiumMath.incrementWrap = function (n, maximumValue, minimumValue) {
+ minimumValue = defaultValue.defaultValue(minimumValue, 0.0);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(n)) {
+ throw new Check.DeveloperError("n is required.");
+ }
+ if (maximumValue <= minimumValue) {
+ throw new Check.DeveloperError("maximumValue must be greater than minimumValue.");
+ }
+ //>>includeEnd('debug');
+
+ ++n;
+ if (n > maximumValue) {
+ n = minimumValue;
+ }
+ return n;
+ };
+
+ /**
+ * Determines if a non-negative integer is a power of two.
+ * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
+ *
+ * @param {Number} n The integer to test in the range [0, (2^32)-1].
+ * @returns {Boolean} true
if the number if a power of two; otherwise, false
.
+ *
+ * @exception {DeveloperError} A number between 0 and (2^32)-1 is required.
+ *
+ * @example
+ * const t = Cesium.Math.isPowerOfTwo(16); // true
+ * const f = Cesium.Math.isPowerOfTwo(20); // false
+ */
+ CesiumMath.isPowerOfTwo = function (n) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof n !== "number" || n < 0 || n > 4294967295) {
+ throw new Check.DeveloperError("A number between 0 and (2^32)-1 is required.");
+ }
+ //>>includeEnd('debug');
+
+ return n !== 0 && (n & (n - 1)) === 0;
+ };
+
+ /**
+ * Computes the next power-of-two integer greater than or equal to the provided non-negative integer.
+ * The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript.
+ *
+ * @param {Number} n The integer to test in the range [0, 2^31].
+ * @returns {Number} The next power-of-two integer.
+ *
+ * @exception {DeveloperError} A number between 0 and 2^31 is required.
+ *
+ * @example
+ * const n = Cesium.Math.nextPowerOfTwo(29); // 32
+ * const m = Cesium.Math.nextPowerOfTwo(32); // 32
+ */
+ CesiumMath.nextPowerOfTwo = function (n) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof n !== "number" || n < 0 || n > 2147483648) {
+ throw new Check.DeveloperError("A number between 0 and 2^31 is required.");
+ }
+ //>>includeEnd('debug');
+
+ // From http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
+ --n;
+ n |= n >> 1;
+ n |= n >> 2;
+ n |= n >> 4;
+ n |= n >> 8;
+ n |= n >> 16;
+ ++n;
+
+ return n;
+ };
+
+ /**
+ * Computes the previous power-of-two integer less than or equal to the provided non-negative integer.
+ * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.
+ *
+ * @param {Number} n The integer to test in the range [0, (2^32)-1].
+ * @returns {Number} The previous power-of-two integer.
+ *
+ * @exception {DeveloperError} A number between 0 and (2^32)-1 is required.
+ *
+ * @example
+ * const n = Cesium.Math.previousPowerOfTwo(29); // 16
+ * const m = Cesium.Math.previousPowerOfTwo(32); // 32
+ */
+ CesiumMath.previousPowerOfTwo = function (n) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof n !== "number" || n < 0 || n > 4294967295) {
+ throw new Check.DeveloperError("A number between 0 and (2^32)-1 is required.");
+ }
+ //>>includeEnd('debug');
+
+ n |= n >> 1;
+ n |= n >> 2;
+ n |= n >> 4;
+ n |= n >> 8;
+ n |= n >> 16;
+ n |= n >> 32;
+
+ // The previous bitwise operations implicitly convert to signed 32-bit. Use `>>>` to convert to unsigned
+ n = (n >>> 0) - (n >>> 1);
+
+ return n;
+ };
+
+ /**
+ * Constraint a value to lie between two values.
+ *
+ * @param {Number} value The value to clamp.
+ * @param {Number} min The minimum value.
+ * @param {Number} max The maximum value.
+ * @returns {Number} The clamped value such that min <= result <= max.
+ */
+ CesiumMath.clamp = function (value, min, max) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("value", value);
+ Check.Check.typeOf.number("min", min);
+ Check.Check.typeOf.number("max", max);
+ //>>includeEnd('debug');
+
+ return value < min ? min : value > max ? max : value;
+ };
+
+ let randomNumberGenerator = new mersenneTwister();
+
+ /**
+ * Sets the seed used by the random number generator
+ * in {@link CesiumMath#nextRandomNumber}.
+ *
+ * @param {Number} seed An integer used as the seed.
+ */
+ CesiumMath.setRandomNumberSeed = function (seed) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(seed)) {
+ throw new Check.DeveloperError("seed is required.");
+ }
+ //>>includeEnd('debug');
+
+ randomNumberGenerator = new mersenneTwister(seed);
+ };
+
+ /**
+ * Generates a random floating point number in the range of [0.0, 1.0)
+ * using a Mersenne twister.
+ *
+ * @returns {Number} A random number in the range of [0.0, 1.0).
+ *
+ * @see CesiumMath.setRandomNumberSeed
+ * @see {@link http://en.wikipedia.org/wiki/Mersenne_twister|Mersenne twister on Wikipedia}
+ */
+ CesiumMath.nextRandomNumber = function () {
+ return randomNumberGenerator.random();
+ };
+
+ /**
+ * Generates a random number between two numbers.
+ *
+ * @param {Number} min The minimum value.
+ * @param {Number} max The maximum value.
+ * @returns {Number} A random number between the min and max.
+ */
+ CesiumMath.randomBetween = function (min, max) {
+ return CesiumMath.nextRandomNumber() * (max - min) + min;
+ };
+
+ /**
+ * Computes Math.acos(value)
, but first clamps value
to the range [-1.0, 1.0]
+ * so that the function will never return NaN.
+ *
+ * @param {Number} value The value for which to compute acos.
+ * @returns {Number} The acos of the value if the value is in the range [-1.0, 1.0], or the acos of -1.0 or 1.0,
+ * whichever is closer, if the value is outside the range.
+ */
+ CesiumMath.acosClamped = function (value) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required.");
+ }
+ //>>includeEnd('debug');
+ return Math.acos(CesiumMath.clamp(value, -1.0, 1.0));
+ };
+
+ /**
+ * Computes Math.asin(value)
, but first clamps value
to the range [-1.0, 1.0]
+ * so that the function will never return NaN.
+ *
+ * @param {Number} value The value for which to compute asin.
+ * @returns {Number} The asin of the value if the value is in the range [-1.0, 1.0], or the asin of -1.0 or 1.0,
+ * whichever is closer, if the value is outside the range.
+ */
+ CesiumMath.asinClamped = function (value) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required.");
+ }
+ //>>includeEnd('debug');
+ return Math.asin(CesiumMath.clamp(value, -1.0, 1.0));
+ };
+
+ /**
+ * Finds the chord length between two points given the circle's radius and the angle between the points.
+ *
+ * @param {Number} angle The angle between the two points.
+ * @param {Number} radius The radius of the circle.
+ * @returns {Number} The chord length.
+ */
+ CesiumMath.chordLength = function (angle, radius) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(angle)) {
+ throw new Check.DeveloperError("angle is required.");
+ }
+ if (!defaultValue.defined(radius)) {
+ throw new Check.DeveloperError("radius is required.");
+ }
+ //>>includeEnd('debug');
+ return 2.0 * radius * Math.sin(angle * 0.5);
+ };
+
+ /**
+ * Finds the logarithm of a number to a base.
+ *
+ * @param {Number} number The number.
+ * @param {Number} base The base.
+ * @returns {Number} The result.
+ */
+ CesiumMath.logBase = function (number, base) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(number)) {
+ throw new Check.DeveloperError("number is required.");
+ }
+ if (!defaultValue.defined(base)) {
+ throw new Check.DeveloperError("base is required.");
+ }
+ //>>includeEnd('debug');
+ return Math.log(number) / Math.log(base);
+ };
+
+ /**
+ * Finds the cube root of a number.
+ * Returns NaN if number
is not provided.
+ *
+ * @function
+ * @param {Number} [number] The number.
+ * @returns {Number} The result.
+ */
+ // eslint-disable-next-line es/no-math-cbrt
+ CesiumMath.cbrt = defaultValue.defaultValue(Math.cbrt, function cbrt(number) {
+ const result = Math.pow(Math.abs(number), 1.0 / 3.0);
+ return number < 0.0 ? -result : result;
+ });
+
+ /**
+ * Finds the base 2 logarithm of a number.
+ *
+ * @function
+ * @param {Number} number The number.
+ * @returns {Number} The result.
+ */
+ // eslint-disable-next-line es/no-math-log2
+ CesiumMath.log2 = defaultValue.defaultValue(Math.log2, function log2(number) {
+ return Math.log(number) * Math.LOG2E;
+ });
+
+ /**
+ * @private
+ */
+ CesiumMath.fog = function (distanceToCamera, density) {
+ const scalar = distanceToCamera * density;
+ return 1.0 - Math.exp(-(scalar * scalar));
+ };
+
+ /**
+ * Computes a fast approximation of Atan for input in the range [-1, 1].
+ *
+ * Based on Michal Drobot's approximation from ShaderFastLibs,
+ * which in turn is based on "Efficient approximations for the arctangent function,"
+ * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
+ * Adapted from ShaderFastLibs under MIT License.
+ *
+ * @param {Number} x An input number in the range [-1, 1]
+ * @returns {Number} An approximation of atan(x)
+ */
+ CesiumMath.fastApproximateAtan = function (x) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("x", x);
+ //>>includeEnd('debug');
+
+ return x * (-0.1784 * Math.abs(x) - 0.0663 * x * x + 1.0301);
+ };
+
+ /**
+ * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.
+ *
+ * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html
+ *
+ * @param {Number} x An input number that isn't zero if y is zero.
+ * @param {Number} y An input number that isn't zero if x is zero.
+ * @returns {Number} An approximation of atan2(x, y)
+ */
+ CesiumMath.fastApproximateAtan2 = function (x, y) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("x", x);
+ Check.Check.typeOf.number("y", y);
+ //>>includeEnd('debug');
+
+ // atan approximations are usually only reliable over [-1, 1]
+ // So reduce the range by flipping whether x or y is on top based on which is bigger.
+ let opposite;
+ let t = Math.abs(x); // t used as swap and atan result.
+ opposite = Math.abs(y);
+ const adjacent = Math.max(t, opposite);
+ opposite = Math.min(t, opposite);
+
+ const oppositeOverAdjacent = opposite / adjacent;
+ //>>includeStart('debug', pragmas.debug);
+ if (isNaN(oppositeOverAdjacent)) {
+ throw new Check.DeveloperError("either x or y must be nonzero");
+ }
+ //>>includeEnd('debug');
+ t = CesiumMath.fastApproximateAtan(oppositeOverAdjacent);
+
+ // Undo range reduction
+ t = Math.abs(y) > Math.abs(x) ? CesiumMath.PI_OVER_TWO - t : t;
+ t = x < 0.0 ? CesiumMath.PI - t : t;
+ t = y < 0.0 ? -t : t;
+ return t;
+ };
+ var CesiumMath$1 = CesiumMath;
+
+ exports.CesiumMath = CesiumMath$1;
+
+}));
+//# sourceMappingURL=Math-9be8b918.js.map
diff --git a/examples/cesium/Workers/Math-9be8b918.js.map b/examples/cesium/Workers/Math-9be8b918.js.map
new file mode 100644
index 0000000..76c29f1
--- /dev/null
+++ b/examples/cesium/Workers/Math-9be8b918.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Math-9be8b918.js","sources":["../../../node_modules/mersenne-twister/src/mersenne-twister.js","../../../Source/Core/Math.js"],"sourcesContent":["/*\n https://github.com/banksean wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace\n so it's better encapsulated. Now you can have multiple random number generators\n and they won't stomp all over eachother's state.\n\n If you want to use this as a substitute for Math.random(), use the random()\n method like so:\n\n var m = new MersenneTwister();\n var randomNumber = m.random();\n\n You can also call the other genrand_{foo}() methods on the instance.\n\n If you want to use a specific seed in order to get a repeatable random\n sequence, pass an integer into the constructor:\n\n var m = new MersenneTwister(123);\n\n and that will always produce the same random sequence.\n\n Sean McCullough (banksean@gmail.com)\n*/\n\n/*\n A C-program for MT19937, with initialization improved 2002/1/26.\n Coded by Takuji Nishimura and Makoto Matsumoto.\n\n Before using, initialize the state by using init_seed(seed)\n or init_by_array(init_key, key_length).\n\n Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n 3. The names of its contributors may not be used to endorse or promote\n products derived from this software without specific prior written\n permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n Any feedback is very welcome.\n http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html\n email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space)\n*/\n\nvar MersenneTwister = function(seed) {\n\tif (seed == undefined) {\n\t\tseed = new Date().getTime();\n\t}\n\n\t/* Period parameters */\n\tthis.N = 624;\n\tthis.M = 397;\n\tthis.MATRIX_A = 0x9908b0df; /* constant vector a */\n\tthis.UPPER_MASK = 0x80000000; /* most significant w-r bits */\n\tthis.LOWER_MASK = 0x7fffffff; /* least significant r bits */\n\n\tthis.mt = new Array(this.N); /* the array for the state vector */\n\tthis.mti=this.N+1; /* mti==N+1 means mt[N] is not initialized */\n\n\tif (seed.constructor == Array) {\n\t\tthis.init_by_array(seed, seed.length);\n\t}\n\telse {\n\t\tthis.init_seed(seed);\n\t}\n}\n\n/* initializes mt[N] with a seed */\n/* origin name init_genrand */\nMersenneTwister.prototype.init_seed = function(s) {\n\tthis.mt[0] = s >>> 0;\n\tfor (this.mti=1; this.mti>> 30);\n\t\tthis.mt[this.mti] = (((((s & 0xffff0000) >>> 16) * 1812433253) << 16) + (s & 0x0000ffff) * 1812433253)\n\t\t+ this.mti;\n\t\t/* See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier. */\n\t\t/* In the previous versions, MSBs of the seed affect */\n\t\t/* only MSBs of the array mt[]. */\n\t\t/* 2002/01/09 modified by Makoto Matsumoto */\n\t\tthis.mt[this.mti] >>>= 0;\n\t\t/* for >32 bit machines */\n\t}\n}\n\n/* initialize by an array with array-length */\n/* init_key is the array for initializing keys */\n/* key_length is its length */\n/* slight change for C++, 2004/2/26 */\nMersenneTwister.prototype.init_by_array = function(init_key, key_length) {\n\tvar i, j, k;\n\tthis.init_seed(19650218);\n\ti=1; j=0;\n\tk = (this.N>key_length ? this.N : key_length);\n\tfor (; k; k--) {\n\t\tvar s = this.mt[i-1] ^ (this.mt[i-1] >>> 30)\n\t\tthis.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1664525) << 16) + ((s & 0x0000ffff) * 1664525)))\n\t\t+ init_key[j] + j; /* non linear */\n\t\tthis.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n\t\ti++; j++;\n\t\tif (i>=this.N) { this.mt[0] = this.mt[this.N-1]; i=1; }\n\t\tif (j>=key_length) j=0;\n\t}\n\tfor (k=this.N-1; k; k--) {\n\t\tvar s = this.mt[i-1] ^ (this.mt[i-1] >>> 30);\n\t\tthis.mt[i] = (this.mt[i] ^ (((((s & 0xffff0000) >>> 16) * 1566083941) << 16) + (s & 0x0000ffff) * 1566083941))\n\t\t- i; /* non linear */\n\t\tthis.mt[i] >>>= 0; /* for WORDSIZE > 32 machines */\n\t\ti++;\n\t\tif (i>=this.N) { this.mt[0] = this.mt[this.N-1]; i=1; }\n\t}\n\n\tthis.mt[0] = 0x80000000; /* MSB is 1; assuring non-zero initial array */\n}\n\n/* generates a random number on [0,0xffffffff]-interval */\n/* origin name genrand_int32 */\nMersenneTwister.prototype.random_int = function() {\n\tvar y;\n\tvar mag01 = new Array(0x0, this.MATRIX_A);\n\t/* mag01[x] = x * MATRIX_A for x=0,1 */\n\n\tif (this.mti >= this.N) { /* generate N words at one time */\n\t\tvar kk;\n\n\t\tif (this.mti == this.N+1) /* if init_seed() has not been called, */\n\t\t\tthis.init_seed(5489); /* a default initial seed is used */\n\n\t\tfor (kk=0;kk>> 1) ^ mag01[y & 0x1];\n\t\t}\n\t\tfor (;kk>> 1) ^ mag01[y & 0x1];\n\t\t}\n\t\ty = (this.mt[this.N-1]&this.UPPER_MASK)|(this.mt[0]&this.LOWER_MASK);\n\t\tthis.mt[this.N-1] = this.mt[this.M-1] ^ (y >>> 1) ^ mag01[y & 0x1];\n\n\t\tthis.mti = 0;\n\t}\n\n\ty = this.mt[this.mti++];\n\n\t/* Tempering */\n\ty ^= (y >>> 11);\n\ty ^= (y << 7) & 0x9d2c5680;\n\ty ^= (y << 15) & 0xefc60000;\n\ty ^= (y >>> 18);\n\n\treturn y >>> 0;\n}\n\n/* generates a random number on [0,0x7fffffff]-interval */\n/* origin name genrand_int31 */\nMersenneTwister.prototype.random_int31 = function() {\n\treturn (this.random_int()>>>1);\n}\n\n/* generates a random number on [0,1]-real-interval */\n/* origin name genrand_real1 */\nMersenneTwister.prototype.random_incl = function() {\n\treturn this.random_int()*(1.0/4294967295.0);\n\t/* divided by 2^32-1 */\n}\n\n/* generates a random number on [0,1)-real-interval */\nMersenneTwister.prototype.random = function() {\n\treturn this.random_int()*(1.0/4294967296.0);\n\t/* divided by 2^32 */\n}\n\n/* generates a random number on (0,1)-real-interval */\n/* origin name genrand_real3 */\nMersenneTwister.prototype.random_excl = function() {\n\treturn (this.random_int() + 0.5)*(1.0/4294967296.0);\n\t/* divided by 2^32 */\n}\n\n/* generates a random number on [0,1) with 53-bit resolution*/\n/* origin name genrand_res53 */\nMersenneTwister.prototype.random_long = function() {\n\tvar a=this.random_int()>>>5, b=this.random_int()>>>6;\n\treturn(a*67108864.0+b)*(1.0/9007199254740992.0);\n}\n\n/* These real versions are due to Isaku Wada, 2002/01/09 added */\n\nmodule.exports = MersenneTwister;\n","import MersenneTwister from \"mersenne-twister\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * Math functions.\r\n *\r\n * @exports CesiumMath\r\n * @alias Math\r\n */\r\nconst CesiumMath = {};\r\n\r\n/**\r\n * 0.1\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON1 = 0.1;\r\n\r\n/**\r\n * 0.01\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON2 = 0.01;\r\n\r\n/**\r\n * 0.001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON3 = 0.001;\r\n\r\n/**\r\n * 0.0001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON4 = 0.0001;\r\n\r\n/**\r\n * 0.00001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON5 = 0.00001;\r\n\r\n/**\r\n * 0.000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON6 = 0.000001;\r\n\r\n/**\r\n * 0.0000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON7 = 0.0000001;\r\n\r\n/**\r\n * 0.00000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON8 = 0.00000001;\r\n\r\n/**\r\n * 0.000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON9 = 0.000000001;\r\n\r\n/**\r\n * 0.0000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON10 = 0.0000000001;\r\n\r\n/**\r\n * 0.00000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON11 = 0.00000000001;\r\n\r\n/**\r\n * 0.000000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON12 = 0.000000000001;\r\n\r\n/**\r\n * 0.0000000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON13 = 0.0000000000001;\r\n\r\n/**\r\n * 0.00000000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON14 = 0.00000000000001;\r\n\r\n/**\r\n * 0.000000000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON15 = 0.000000000000001;\r\n\r\n/**\r\n * 0.0000000000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON16 = 0.0000000000000001;\r\n\r\n/**\r\n * 0.00000000000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON17 = 0.00000000000000001;\r\n\r\n/**\r\n * 0.000000000000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON18 = 0.000000000000000001;\r\n\r\n/**\r\n * 0.0000000000000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON19 = 0.0000000000000000001;\r\n\r\n/**\r\n * 0.00000000000000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON20 = 0.00000000000000000001;\r\n\r\n/**\r\n * 0.000000000000000000001\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.EPSILON21 = 0.000000000000000000001;\r\n\r\n/**\r\n * The gravitational parameter of the Earth in meters cubed\r\n * per second squared as defined by the WGS84 model: 3.986004418e14\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.GRAVITATIONALPARAMETER = 3.986004418e14;\r\n\r\n/**\r\n * Radius of the sun in meters: 6.955e8\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.SOLAR_RADIUS = 6.955e8;\r\n\r\n/**\r\n * The mean radius of the moon, according to the \"Report of the IAU/IAG Working Group on\r\n * Cartographic Coordinates and Rotational Elements of the Planets and satellites: 2000\",\r\n * Celestial Mechanics 82: 83-110, 2002.\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.LUNAR_RADIUS = 1737400.0;\r\n\r\n/**\r\n * 64 * 1024\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.SIXTY_FOUR_KILOBYTES = 64 * 1024;\r\n\r\n/**\r\n * 4 * 1024 * 1024 * 1024\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.FOUR_GIGABYTES = 4 * 1024 * 1024 * 1024;\r\n\r\n/**\r\n * Returns the sign of the value; 1 if the value is positive, -1 if the value is\r\n * negative, or 0 if the value is 0.\r\n *\r\n * @function\r\n * @param {Number} value The value to return the sign of.\r\n * @returns {Number} The sign of value.\r\n */\r\n// eslint-disable-next-line es/no-math-sign\r\nCesiumMath.sign = defaultValue(Math.sign, function sign(value) {\r\n value = +value; // coerce to number\r\n if (value === 0 || value !== value) {\r\n // zero or NaN\r\n return value;\r\n }\r\n return value > 0 ? 1 : -1;\r\n});\r\n\r\n/**\r\n * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative.\r\n * This is similar to {@link CesiumMath#sign} except that returns 1.0 instead of\r\n * 0.0 when the input value is 0.0.\r\n * @param {Number} value The value to return the sign of.\r\n * @returns {Number} The sign of value.\r\n */\r\nCesiumMath.signNotZero = function (value) {\r\n return value < 0.0 ? -1.0 : 1.0;\r\n};\r\n\r\n/**\r\n * Converts a scalar value in the range [-1.0, 1.0] to a SNORM in the range [0, rangeMaximum]\r\n * @param {Number} value The scalar value in the range [-1.0, 1.0]\r\n * @param {Number} [rangeMaximum=255] The maximum value in the mapped range, 255 by default.\r\n * @returns {Number} A SNORM value, where 0 maps to -1.0 and rangeMaximum maps to 1.0.\r\n *\r\n * @see CesiumMath.fromSNorm\r\n */\r\nCesiumMath.toSNorm = function (value, rangeMaximum) {\r\n rangeMaximum = defaultValue(rangeMaximum, 255);\r\n return Math.round(\r\n (CesiumMath.clamp(value, -1.0, 1.0) * 0.5 + 0.5) * rangeMaximum\r\n );\r\n};\r\n\r\n/**\r\n * Converts a SNORM value in the range [0, rangeMaximum] to a scalar in the range [-1.0, 1.0].\r\n * @param {Number} value SNORM value in the range [0, rangeMaximum]\r\n * @param {Number} [rangeMaximum=255] The maximum value in the SNORM range, 255 by default.\r\n * @returns {Number} Scalar in the range [-1.0, 1.0].\r\n *\r\n * @see CesiumMath.toSNorm\r\n */\r\nCesiumMath.fromSNorm = function (value, rangeMaximum) {\r\n rangeMaximum = defaultValue(rangeMaximum, 255);\r\n return (\r\n (CesiumMath.clamp(value, 0.0, rangeMaximum) / rangeMaximum) * 2.0 - 1.0\r\n );\r\n};\r\n\r\n/**\r\n * Converts a scalar value in the range [rangeMinimum, rangeMaximum] to a scalar in the range [0.0, 1.0]\r\n * @param {Number} value The scalar value in the range [rangeMinimum, rangeMaximum]\r\n * @param {Number} rangeMinimum The minimum value in the mapped range.\r\n * @param {Number} rangeMaximum The maximum value in the mapped range.\r\n * @returns {Number} A scalar value, where rangeMinimum maps to 0.0 and rangeMaximum maps to 1.0.\r\n */\r\nCesiumMath.normalize = function (value, rangeMinimum, rangeMaximum) {\r\n rangeMaximum = Math.max(rangeMaximum - rangeMinimum, 0.0);\r\n return rangeMaximum === 0.0\r\n ? 0.0\r\n : CesiumMath.clamp((value - rangeMinimum) / rangeMaximum, 0.0, 1.0);\r\n};\r\n\r\n/**\r\n * Returns the hyperbolic sine of a number.\r\n * The hyperbolic sine of value is defined to be\r\n * (ex - e-x)/2.0\r\n * where e is Euler's number, approximately 2.71828183.\r\n *\r\n * Special cases:\r\n *
\r\n * - If the argument is NaN, then the result is NaN.
\r\n *\r\n * - If the argument is infinite, then the result is an infinity\r\n * with the same sign as the argument.
\r\n *\r\n * - If the argument is zero, then the result is a zero with the\r\n * same sign as the argument.
\r\n *
\r\n *\r\n *\r\n * @function\r\n * @param {Number} value The number whose hyperbolic sine is to be returned.\r\n * @returns {Number} The hyperbolic sine of value
.\r\n */\r\n// eslint-disable-next-line es/no-math-sinh\r\nCesiumMath.sinh = defaultValue(Math.sinh, function sinh(value) {\r\n return (Math.exp(value) - Math.exp(-value)) / 2.0;\r\n});\r\n\r\n/**\r\n * Returns the hyperbolic cosine of a number.\r\n * The hyperbolic cosine of value is defined to be\r\n * (ex + e-x)/2.0\r\n * where e is Euler's number, approximately 2.71828183.\r\n *\r\n * Special cases:\r\n *
\r\n * - If the argument is NaN, then the result is NaN.
\r\n *\r\n * - If the argument is infinite, then the result is positive infinity.
\r\n *\r\n * - If the argument is zero, then the result is 1.0.
\r\n *
\r\n *\r\n *\r\n * @function\r\n * @param {Number} value The number whose hyperbolic cosine is to be returned.\r\n * @returns {Number} The hyperbolic cosine of value
.\r\n */\r\n// eslint-disable-next-line es/no-math-cosh\r\nCesiumMath.cosh = defaultValue(Math.cosh, function cosh(value) {\r\n return (Math.exp(value) + Math.exp(-value)) / 2.0;\r\n});\r\n\r\n/**\r\n * Computes the linear interpolation of two values.\r\n *\r\n * @param {Number} p The start value to interpolate.\r\n * @param {Number} q The end value to interpolate.\r\n * @param {Number} time The time of interpolation generally in the range [0.0, 1.0]
.\r\n * @returns {Number} The linearly interpolated value.\r\n *\r\n * @example\r\n * const n = Cesium.Math.lerp(0.0, 2.0, 0.5); // returns 1.0\r\n */\r\nCesiumMath.lerp = function (p, q, time) {\r\n return (1.0 - time) * p + time * q;\r\n};\r\n\r\n/**\r\n * pi\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.PI = Math.PI;\r\n\r\n/**\r\n * 1/pi\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.ONE_OVER_PI = 1.0 / Math.PI;\r\n\r\n/**\r\n * pi/2\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.PI_OVER_TWO = Math.PI / 2.0;\r\n\r\n/**\r\n * pi/3\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.PI_OVER_THREE = Math.PI / 3.0;\r\n\r\n/**\r\n * pi/4\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.PI_OVER_FOUR = Math.PI / 4.0;\r\n\r\n/**\r\n * pi/6\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.PI_OVER_SIX = Math.PI / 6.0;\r\n\r\n/**\r\n * 3pi/2\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.THREE_PI_OVER_TWO = (3.0 * Math.PI) / 2.0;\r\n\r\n/**\r\n * 2pi\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.TWO_PI = 2.0 * Math.PI;\r\n\r\n/**\r\n * 1/2pi\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.ONE_OVER_TWO_PI = 1.0 / (2.0 * Math.PI);\r\n\r\n/**\r\n * The number of radians in a degree.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.RADIANS_PER_DEGREE = Math.PI / 180.0;\r\n\r\n/**\r\n * The number of degrees in a radian.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.DEGREES_PER_RADIAN = 180.0 / Math.PI;\r\n\r\n/**\r\n * The number of radians in an arc second.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nCesiumMath.RADIANS_PER_ARCSECOND = CesiumMath.RADIANS_PER_DEGREE / 3600.0;\r\n\r\n/**\r\n * Converts degrees to radians.\r\n * @param {Number} degrees The angle to convert in degrees.\r\n * @returns {Number} The corresponding angle in radians.\r\n */\r\nCesiumMath.toRadians = function (degrees) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(degrees)) {\r\n throw new DeveloperError(\"degrees is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return degrees * CesiumMath.RADIANS_PER_DEGREE;\r\n};\r\n\r\n/**\r\n * Converts radians to degrees.\r\n * @param {Number} radians The angle to convert in radians.\r\n * @returns {Number} The corresponding angle in degrees.\r\n */\r\nCesiumMath.toDegrees = function (radians) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(radians)) {\r\n throw new DeveloperError(\"radians is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return radians * CesiumMath.DEGREES_PER_RADIAN;\r\n};\r\n\r\n/**\r\n * Converts a longitude value, in radians, to the range [-Math.PI
, Math.PI
).\r\n *\r\n * @param {Number} angle The longitude value, in radians, to convert to the range [-Math.PI
, Math.PI
).\r\n * @returns {Number} The equivalent longitude value in the range [-Math.PI
, Math.PI
).\r\n *\r\n * @example\r\n * // Convert 270 degrees to -90 degrees longitude\r\n * const longitude = Cesium.Math.convertLongitudeRange(Cesium.Math.toRadians(270.0));\r\n */\r\nCesiumMath.convertLongitudeRange = function (angle) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(angle)) {\r\n throw new DeveloperError(\"angle is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n const twoPi = CesiumMath.TWO_PI;\r\n\r\n const simplified = angle - Math.floor(angle / twoPi) * twoPi;\r\n\r\n if (simplified < -Math.PI) {\r\n return simplified + twoPi;\r\n }\r\n if (simplified >= Math.PI) {\r\n return simplified - twoPi;\r\n }\r\n\r\n return simplified;\r\n};\r\n\r\n/**\r\n * Convenience function that clamps a latitude value, in radians, to the range [-Math.PI/2
, Math.PI/2
).\r\n * Useful for sanitizing data before use in objects requiring correct range.\r\n *\r\n * @param {Number} angle The latitude value, in radians, to clamp to the range [-Math.PI/2
, Math.PI/2
).\r\n * @returns {Number} The latitude value clamped to the range [-Math.PI/2
, Math.PI/2
).\r\n *\r\n * @example\r\n * // Clamp 108 degrees latitude to 90 degrees latitude\r\n * const latitude = Cesium.Math.clampToLatitudeRange(Cesium.Math.toRadians(108.0));\r\n */\r\nCesiumMath.clampToLatitudeRange = function (angle) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(angle)) {\r\n throw new DeveloperError(\"angle is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n return CesiumMath.clamp(\r\n angle,\r\n -1 * CesiumMath.PI_OVER_TWO,\r\n CesiumMath.PI_OVER_TWO\r\n );\r\n};\r\n\r\n/**\r\n * Produces an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.\r\n *\r\n * @param {Number} angle in radians\r\n * @returns {Number} The angle in the range [-CesiumMath.PI
, CesiumMath.PI
].\r\n */\r\nCesiumMath.negativePiToPi = function (angle) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(angle)) {\r\n throw new DeveloperError(\"angle is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n if (angle >= -CesiumMath.PI && angle <= CesiumMath.PI) {\r\n // Early exit if the input is already inside the range. This avoids\r\n // unnecessary math which could introduce floating point error.\r\n return angle;\r\n }\r\n return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI;\r\n};\r\n\r\n/**\r\n * Produces an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.\r\n *\r\n * @param {Number} angle in radians\r\n * @returns {Number} The angle in the range [0, CesiumMath.TWO_PI
].\r\n */\r\nCesiumMath.zeroToTwoPi = function (angle) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(angle)) {\r\n throw new DeveloperError(\"angle is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n if (angle >= 0 && angle <= CesiumMath.TWO_PI) {\r\n // Early exit if the input is already inside the range. This avoids\r\n // unnecessary math which could introduce floating point error.\r\n return angle;\r\n }\r\n const mod = CesiumMath.mod(angle, CesiumMath.TWO_PI);\r\n if (\r\n Math.abs(mod) < CesiumMath.EPSILON14 &&\r\n Math.abs(angle) > CesiumMath.EPSILON14\r\n ) {\r\n return CesiumMath.TWO_PI;\r\n }\r\n return mod;\r\n};\r\n\r\n/**\r\n * The modulo operation that also works for negative dividends.\r\n *\r\n * @param {Number} m The dividend.\r\n * @param {Number} n The divisor.\r\n * @returns {Number} The remainder.\r\n */\r\nCesiumMath.mod = function (m, n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(m)) {\r\n throw new DeveloperError(\"m is required.\");\r\n }\r\n if (!defined(n)) {\r\n throw new DeveloperError(\"n is required.\");\r\n }\r\n if (n === 0.0) {\r\n throw new DeveloperError(\"divisor cannot be 0.\");\r\n }\r\n //>>includeEnd('debug');\r\n if (CesiumMath.sign(m) === CesiumMath.sign(n) && Math.abs(m) < Math.abs(n)) {\r\n // Early exit if the input does not need to be modded. This avoids\r\n // unnecessary math which could introduce floating point error.\r\n return m;\r\n }\r\n\r\n return ((m % n) + n) % n;\r\n};\r\n\r\n/**\r\n * Determines if two values are equal using an absolute or relative tolerance test. This is useful\r\n * to avoid problems due to roundoff error when comparing floating-point values directly. The values are\r\n * first compared using an absolute tolerance test. If that fails, a relative tolerance test is performed.\r\n * Use this test if you are unsure of the magnitudes of left and right.\r\n *\r\n * @param {Number} left The first value to compare.\r\n * @param {Number} right The other value to compare.\r\n * @param {Number} [relativeEpsilon=0] The maximum inclusive delta between left
and right
for the relative tolerance test.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The maximum inclusive delta between left
and right
for the absolute tolerance test.\r\n * @returns {Boolean} true
if the values are equal within the epsilon; otherwise, false
.\r\n *\r\n * @example\r\n * const a = Cesium.Math.equalsEpsilon(0.0, 0.01, Cesium.Math.EPSILON2); // true\r\n * const b = Cesium.Math.equalsEpsilon(0.0, 0.1, Cesium.Math.EPSILON2); // false\r\n * const c = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON7); // true\r\n * const d = Cesium.Math.equalsEpsilon(3699175.1634344, 3699175.2, Cesium.Math.EPSILON9); // false\r\n */\r\nCesiumMath.equalsEpsilon = function (\r\n left,\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(left)) {\r\n throw new DeveloperError(\"left is required.\");\r\n }\r\n if (!defined(right)) {\r\n throw new DeveloperError(\"right is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n relativeEpsilon = defaultValue(relativeEpsilon, 0.0);\r\n absoluteEpsilon = defaultValue(absoluteEpsilon, relativeEpsilon);\r\n const absDiff = Math.abs(left - right);\r\n return (\r\n absDiff <= absoluteEpsilon ||\r\n absDiff <= relativeEpsilon * Math.max(Math.abs(left), Math.abs(right))\r\n );\r\n};\r\n\r\n/**\r\n * Determines if the left value is less than the right value. If the two values are within\r\n * absoluteEpsilon
of each other, they are considered equal and this function returns false.\r\n *\r\n * @param {Number} left The first number to compare.\r\n * @param {Number} right The second number to compare.\r\n * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.\r\n * @returns {Boolean} true
if left
is less than right
by more than\r\n * absoluteEpsilon. false
if left
is greater or if the two\r\n * values are nearly equal.\r\n */\r\nCesiumMath.lessThan = function (left, right, absoluteEpsilon) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(left)) {\r\n throw new DeveloperError(\"first is required.\");\r\n }\r\n if (!defined(right)) {\r\n throw new DeveloperError(\"second is required.\");\r\n }\r\n if (!defined(absoluteEpsilon)) {\r\n throw new DeveloperError(\"absoluteEpsilon is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return left - right < -absoluteEpsilon;\r\n};\r\n\r\n/**\r\n * Determines if the left value is less than or equal to the right value. If the two values are within\r\n * absoluteEpsilon
of each other, they are considered equal and this function returns true.\r\n *\r\n * @param {Number} left The first number to compare.\r\n * @param {Number} right The second number to compare.\r\n * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.\r\n * @returns {Boolean} true
if left
is less than right
or if the\r\n * the values are nearly equal.\r\n */\r\nCesiumMath.lessThanOrEquals = function (left, right, absoluteEpsilon) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(left)) {\r\n throw new DeveloperError(\"first is required.\");\r\n }\r\n if (!defined(right)) {\r\n throw new DeveloperError(\"second is required.\");\r\n }\r\n if (!defined(absoluteEpsilon)) {\r\n throw new DeveloperError(\"absoluteEpsilon is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return left - right < absoluteEpsilon;\r\n};\r\n\r\n/**\r\n * Determines if the left value is greater the right value. If the two values are within\r\n * absoluteEpsilon
of each other, they are considered equal and this function returns false.\r\n *\r\n * @param {Number} left The first number to compare.\r\n * @param {Number} right The second number to compare.\r\n * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.\r\n * @returns {Boolean} true
if left
is greater than right
by more than\r\n * absoluteEpsilon. false
if left
is less or if the two\r\n * values are nearly equal.\r\n */\r\nCesiumMath.greaterThan = function (left, right, absoluteEpsilon) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(left)) {\r\n throw new DeveloperError(\"first is required.\");\r\n }\r\n if (!defined(right)) {\r\n throw new DeveloperError(\"second is required.\");\r\n }\r\n if (!defined(absoluteEpsilon)) {\r\n throw new DeveloperError(\"absoluteEpsilon is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return left - right > absoluteEpsilon;\r\n};\r\n\r\n/**\r\n * Determines if the left value is greater than or equal to the right value. If the two values are within\r\n * absoluteEpsilon
of each other, they are considered equal and this function returns true.\r\n *\r\n * @param {Number} left The first number to compare.\r\n * @param {Number} right The second number to compare.\r\n * @param {Number} absoluteEpsilon The absolute epsilon to use in comparison.\r\n * @returns {Boolean} true
if left
is greater than right
or if the\r\n * the values are nearly equal.\r\n */\r\nCesiumMath.greaterThanOrEquals = function (left, right, absoluteEpsilon) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(left)) {\r\n throw new DeveloperError(\"first is required.\");\r\n }\r\n if (!defined(right)) {\r\n throw new DeveloperError(\"second is required.\");\r\n }\r\n if (!defined(absoluteEpsilon)) {\r\n throw new DeveloperError(\"absoluteEpsilon is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return left - right > -absoluteEpsilon;\r\n};\r\n\r\nconst factorials = [1];\r\n\r\n/**\r\n * Computes the factorial of the provided number.\r\n *\r\n * @param {Number} n The number whose factorial is to be computed.\r\n * @returns {Number} The factorial of the provided number or undefined if the number is less than 0.\r\n *\r\n * @exception {DeveloperError} A number greater than or equal to 0 is required.\r\n *\r\n *\r\n * @example\r\n * //Compute 7!, which is equal to 5040\r\n * const computedFactorial = Cesium.Math.factorial(7);\r\n *\r\n * @see {@link http://en.wikipedia.org/wiki/Factorial|Factorial on Wikipedia}\r\n */\r\nCesiumMath.factorial = function (n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof n !== \"number\" || n < 0) {\r\n throw new DeveloperError(\r\n \"A number greater than or equal to 0 is required.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = factorials.length;\r\n if (n >= length) {\r\n let sum = factorials[length - 1];\r\n for (let i = length; i <= n; i++) {\r\n const next = sum * i;\r\n factorials.push(next);\r\n sum = next;\r\n }\r\n }\r\n return factorials[n];\r\n};\r\n\r\n/**\r\n * Increments a number with a wrapping to a minimum value if the number exceeds the maximum value.\r\n *\r\n * @param {Number} [n] The number to be incremented.\r\n * @param {Number} [maximumValue] The maximum incremented value before rolling over to the minimum value.\r\n * @param {Number} [minimumValue=0.0] The number reset to after the maximum value has been exceeded.\r\n * @returns {Number} The incremented number.\r\n *\r\n * @exception {DeveloperError} Maximum value must be greater than minimum value.\r\n *\r\n * @example\r\n * const n = Cesium.Math.incrementWrap(5, 10, 0); // returns 6\r\n * const m = Cesium.Math.incrementWrap(10, 10, 0); // returns 0\r\n */\r\nCesiumMath.incrementWrap = function (n, maximumValue, minimumValue) {\r\n minimumValue = defaultValue(minimumValue, 0.0);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(n)) {\r\n throw new DeveloperError(\"n is required.\");\r\n }\r\n if (maximumValue <= minimumValue) {\r\n throw new DeveloperError(\"maximumValue must be greater than minimumValue.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n ++n;\r\n if (n > maximumValue) {\r\n n = minimumValue;\r\n }\r\n return n;\r\n};\r\n\r\n/**\r\n * Determines if a non-negative integer is a power of two.\r\n * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.\r\n *\r\n * @param {Number} n The integer to test in the range [0, (2^32)-1].\r\n * @returns {Boolean} true
if the number if a power of two; otherwise, false
.\r\n *\r\n * @exception {DeveloperError} A number between 0 and (2^32)-1 is required.\r\n *\r\n * @example\r\n * const t = Cesium.Math.isPowerOfTwo(16); // true\r\n * const f = Cesium.Math.isPowerOfTwo(20); // false\r\n */\r\nCesiumMath.isPowerOfTwo = function (n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof n !== \"number\" || n < 0 || n > 4294967295) {\r\n throw new DeveloperError(\"A number between 0 and (2^32)-1 is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n return n !== 0 && (n & (n - 1)) === 0;\r\n};\r\n\r\n/**\r\n * Computes the next power-of-two integer greater than or equal to the provided non-negative integer.\r\n * The maximum allowed input is 2^31 due to 32-bit bitwise operator limitation in Javascript.\r\n *\r\n * @param {Number} n The integer to test in the range [0, 2^31].\r\n * @returns {Number} The next power-of-two integer.\r\n *\r\n * @exception {DeveloperError} A number between 0 and 2^31 is required.\r\n *\r\n * @example\r\n * const n = Cesium.Math.nextPowerOfTwo(29); // 32\r\n * const m = Cesium.Math.nextPowerOfTwo(32); // 32\r\n */\r\nCesiumMath.nextPowerOfTwo = function (n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof n !== \"number\" || n < 0 || n > 2147483648) {\r\n throw new DeveloperError(\"A number between 0 and 2^31 is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n // From http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2\r\n --n;\r\n n |= n >> 1;\r\n n |= n >> 2;\r\n n |= n >> 4;\r\n n |= n >> 8;\r\n n |= n >> 16;\r\n ++n;\r\n\r\n return n;\r\n};\r\n\r\n/**\r\n * Computes the previous power-of-two integer less than or equal to the provided non-negative integer.\r\n * The maximum allowed input is (2^32)-1 due to 32-bit bitwise operator limitation in Javascript.\r\n *\r\n * @param {Number} n The integer to test in the range [0, (2^32)-1].\r\n * @returns {Number} The previous power-of-two integer.\r\n *\r\n * @exception {DeveloperError} A number between 0 and (2^32)-1 is required.\r\n *\r\n * @example\r\n * const n = Cesium.Math.previousPowerOfTwo(29); // 16\r\n * const m = Cesium.Math.previousPowerOfTwo(32); // 32\r\n */\r\nCesiumMath.previousPowerOfTwo = function (n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof n !== \"number\" || n < 0 || n > 4294967295) {\r\n throw new DeveloperError(\"A number between 0 and (2^32)-1 is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n n |= n >> 1;\r\n n |= n >> 2;\r\n n |= n >> 4;\r\n n |= n >> 8;\r\n n |= n >> 16;\r\n n |= n >> 32;\r\n\r\n // The previous bitwise operations implicitly convert to signed 32-bit. Use `>>>` to convert to unsigned\r\n n = (n >>> 0) - (n >>> 1);\r\n\r\n return n;\r\n};\r\n\r\n/**\r\n * Constraint a value to lie between two values.\r\n *\r\n * @param {Number} value The value to clamp.\r\n * @param {Number} min The minimum value.\r\n * @param {Number} max The maximum value.\r\n * @returns {Number} The clamped value such that min <= result <= max.\r\n */\r\nCesiumMath.clamp = function (value, min, max) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"value\", value);\r\n Check.typeOf.number(\"min\", min);\r\n Check.typeOf.number(\"max\", max);\r\n //>>includeEnd('debug');\r\n\r\n return value < min ? min : value > max ? max : value;\r\n};\r\n\r\nlet randomNumberGenerator = new MersenneTwister();\r\n\r\n/**\r\n * Sets the seed used by the random number generator\r\n * in {@link CesiumMath#nextRandomNumber}.\r\n *\r\n * @param {Number} seed An integer used as the seed.\r\n */\r\nCesiumMath.setRandomNumberSeed = function (seed) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(seed)) {\r\n throw new DeveloperError(\"seed is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n randomNumberGenerator = new MersenneTwister(seed);\r\n};\r\n\r\n/**\r\n * Generates a random floating point number in the range of [0.0, 1.0)\r\n * using a Mersenne twister.\r\n *\r\n * @returns {Number} A random number in the range of [0.0, 1.0).\r\n *\r\n * @see CesiumMath.setRandomNumberSeed\r\n * @see {@link http://en.wikipedia.org/wiki/Mersenne_twister|Mersenne twister on Wikipedia}\r\n */\r\nCesiumMath.nextRandomNumber = function () {\r\n return randomNumberGenerator.random();\r\n};\r\n\r\n/**\r\n * Generates a random number between two numbers.\r\n *\r\n * @param {Number} min The minimum value.\r\n * @param {Number} max The maximum value.\r\n * @returns {Number} A random number between the min and max.\r\n */\r\nCesiumMath.randomBetween = function (min, max) {\r\n return CesiumMath.nextRandomNumber() * (max - min) + min;\r\n};\r\n\r\n/**\r\n * Computes Math.acos(value)
, but first clamps value
to the range [-1.0, 1.0]\r\n * so that the function will never return NaN.\r\n *\r\n * @param {Number} value The value for which to compute acos.\r\n * @returns {Number} The acos of the value if the value is in the range [-1.0, 1.0], or the acos of -1.0 or 1.0,\r\n * whichever is closer, if the value is outside the range.\r\n */\r\nCesiumMath.acosClamped = function (value) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return Math.acos(CesiumMath.clamp(value, -1.0, 1.0));\r\n};\r\n\r\n/**\r\n * Computes Math.asin(value)
, but first clamps value
to the range [-1.0, 1.0]\r\n * so that the function will never return NaN.\r\n *\r\n * @param {Number} value The value for which to compute asin.\r\n * @returns {Number} The asin of the value if the value is in the range [-1.0, 1.0], or the asin of -1.0 or 1.0,\r\n * whichever is closer, if the value is outside the range.\r\n */\r\nCesiumMath.asinClamped = function (value) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return Math.asin(CesiumMath.clamp(value, -1.0, 1.0));\r\n};\r\n\r\n/**\r\n * Finds the chord length between two points given the circle's radius and the angle between the points.\r\n *\r\n * @param {Number} angle The angle between the two points.\r\n * @param {Number} radius The radius of the circle.\r\n * @returns {Number} The chord length.\r\n */\r\nCesiumMath.chordLength = function (angle, radius) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(angle)) {\r\n throw new DeveloperError(\"angle is required.\");\r\n }\r\n if (!defined(radius)) {\r\n throw new DeveloperError(\"radius is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return 2.0 * radius * Math.sin(angle * 0.5);\r\n};\r\n\r\n/**\r\n * Finds the logarithm of a number to a base.\r\n *\r\n * @param {Number} number The number.\r\n * @param {Number} base The base.\r\n * @returns {Number} The result.\r\n */\r\nCesiumMath.logBase = function (number, base) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(number)) {\r\n throw new DeveloperError(\"number is required.\");\r\n }\r\n if (!defined(base)) {\r\n throw new DeveloperError(\"base is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return Math.log(number) / Math.log(base);\r\n};\r\n\r\n/**\r\n * Finds the cube root of a number.\r\n * Returns NaN if number
is not provided.\r\n *\r\n * @function\r\n * @param {Number} [number] The number.\r\n * @returns {Number} The result.\r\n */\r\n// eslint-disable-next-line es/no-math-cbrt\r\nCesiumMath.cbrt = defaultValue(Math.cbrt, function cbrt(number) {\r\n const result = Math.pow(Math.abs(number), 1.0 / 3.0);\r\n return number < 0.0 ? -result : result;\r\n});\r\n\r\n/**\r\n * Finds the base 2 logarithm of a number.\r\n *\r\n * @function\r\n * @param {Number} number The number.\r\n * @returns {Number} The result.\r\n */\r\n// eslint-disable-next-line es/no-math-log2\r\nCesiumMath.log2 = defaultValue(Math.log2, function log2(number) {\r\n return Math.log(number) * Math.LOG2E;\r\n});\r\n\r\n/**\r\n * @private\r\n */\r\nCesiumMath.fog = function (distanceToCamera, density) {\r\n const scalar = distanceToCamera * density;\r\n return 1.0 - Math.exp(-(scalar * scalar));\r\n};\r\n\r\n/**\r\n * Computes a fast approximation of Atan for input in the range [-1, 1].\r\n *\r\n * Based on Michal Drobot's approximation from ShaderFastLibs,\r\n * which in turn is based on \"Efficient approximations for the arctangent function,\"\r\n * Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.\r\n * Adapted from ShaderFastLibs under MIT License.\r\n *\r\n * @param {Number} x An input number in the range [-1, 1]\r\n * @returns {Number} An approximation of atan(x)\r\n */\r\nCesiumMath.fastApproximateAtan = function (x) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"x\", x);\r\n //>>includeEnd('debug');\r\n\r\n return x * (-0.1784 * Math.abs(x) - 0.0663 * x * x + 1.0301);\r\n};\r\n\r\n/**\r\n * Computes a fast approximation of Atan2(x, y) for arbitrary input scalars.\r\n *\r\n * Range reduction math based on nvidia's cg reference implementation: http://developer.download.nvidia.com/cg/atan2.html\r\n *\r\n * @param {Number} x An input number that isn't zero if y is zero.\r\n * @param {Number} y An input number that isn't zero if x is zero.\r\n * @returns {Number} An approximation of atan2(x, y)\r\n */\r\nCesiumMath.fastApproximateAtan2 = function (x, y) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"x\", x);\r\n Check.typeOf.number(\"y\", y);\r\n //>>includeEnd('debug');\r\n\r\n // atan approximations are usually only reliable over [-1, 1]\r\n // So reduce the range by flipping whether x or y is on top based on which is bigger.\r\n let opposite;\r\n let t = Math.abs(x); // t used as swap and atan result.\r\n opposite = Math.abs(y);\r\n const adjacent = Math.max(t, opposite);\r\n opposite = Math.min(t, opposite);\r\n\r\n const oppositeOverAdjacent = opposite / adjacent;\r\n //>>includeStart('debug', pragmas.debug);\r\n if (isNaN(oppositeOverAdjacent)) {\r\n throw new DeveloperError(\"either x or y must be nonzero\");\r\n }\r\n //>>includeEnd('debug');\r\n t = CesiumMath.fastApproximateAtan(oppositeOverAdjacent);\r\n\r\n // Undo range reduction\r\n t = Math.abs(y) > Math.abs(x) ? CesiumMath.PI_OVER_TWO - t : t;\r\n t = x < 0.0 ? CesiumMath.PI - t : t;\r\n t = y < 0.0 ? -t : t;\r\n return t;\r\n};\r\nexport default CesiumMath;\r\n"],"names":["defaultValue","defined","DeveloperError","Check","MersenneTwister"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBA;CACA;CACA;AACA;CACA;CACA;AACA;CACA;CACA;AACA;CACA;CACA;CACA;AACA;CACA;CACA;AACA;CACA;CACA;CACA;AACA;CACA;CACA;CACA;AACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACA;AACA;CACA;CACA;CACA;CACA;AACA;CACA,IAAI,eAAe,GAAG,SAAS,IAAI,EAAE;CACrC,CAAC,IAAI,IAAI,IAAI,SAAS,EAAE;CACxB,EAAE,IAAI,GAAG,IA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A;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC/B;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,QAAQ,GAAG,SAAS,CAAC;AAChC;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,QAAQ,GAAG,UAAU,CAAC;AACjC;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,QAAQ,GAAG,WAAW,CAAC;AAClC;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,YAAY,CAAC;AACpC;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,aAAa,CAAC;AACrC;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,cAAc,CAAC;AACtC;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,eAAe,CAAC;AACvC;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,gBAAgB,CAAC;AACxC;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,iBAAiB,CAAC;AACzC;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,kBAAkB,CAAC;AAC1C;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,mBAAmB,CAAC;AAC3C;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,oBAAoB,CAAC;AAC5C;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,qBAAqB,CAAC;AAC7C;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,sBAAsB,CAAC;AAC9C;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,SAAS,GAAG,uBAAuB,CAAC;AAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,sBAAsB,GAAG,cAAc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CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;CACvB,EAAE,OAAO,CAAC,CAAC;CACX,CAAC,CAAC;AACF,oBAAe,UAAU;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/Matrix2-036c77dd.js b/examples/cesium/Workers/Matrix2-036c77dd.js
new file mode 100644
index 0000000..d5e982a
--- /dev/null
+++ b/examples/cesium/Workers/Matrix2-036c77dd.js
@@ -0,0 +1,7110 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Math-9be8b918', './RuntimeError-e5c6a8b9'], (function (exports, Matrix3, Check, defaultValue, Math$1, RuntimeError) { 'use strict';
+
+ /**
+ * A 4D Cartesian point.
+ * @alias Cartesian4
+ * @constructor
+ *
+ * @param {Number} [x=0.0] The X component.
+ * @param {Number} [y=0.0] The Y component.
+ * @param {Number} [z=0.0] The Z component.
+ * @param {Number} [w=0.0] The W component.
+ *
+ * @see Cartesian2
+ * @see Cartesian3
+ * @see Packable
+ */
+ function Cartesian4(x, y, z, w) {
+ /**
+ * The X component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.x = defaultValue.defaultValue(x, 0.0);
+
+ /**
+ * The Y component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.y = defaultValue.defaultValue(y, 0.0);
+
+ /**
+ * The Z component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.z = defaultValue.defaultValue(z, 0.0);
+
+ /**
+ * The W component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.w = defaultValue.defaultValue(w, 0.0);
+ }
+
+ /**
+ * Creates a Cartesian4 instance from x, y, z and w coordinates.
+ *
+ * @param {Number} x The x coordinate.
+ * @param {Number} y The y coordinate.
+ * @param {Number} z The z coordinate.
+ * @param {Number} w The w coordinate.
+ * @param {Cartesian4} [result] The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.
+ */
+ Cartesian4.fromElements = function (x, y, z, w, result) {
+ if (!defaultValue.defined(result)) {
+ return new Cartesian4(x, y, z, w);
+ }
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+ };
+
+ /**
+ * Creates a Cartesian4 instance from a {@link Color}. red
, green
, blue
,
+ * and alpha
map to x
, y
, z
, and w
, respectively.
+ *
+ * @param {Color} color The source color.
+ * @param {Cartesian4} [result] The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.
+ */
+ Cartesian4.fromColor = function (color, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("color", color);
+ //>>includeEnd('debug');
+ if (!defaultValue.defined(result)) {
+ return new Cartesian4(color.red, color.green, color.blue, color.alpha);
+ }
+
+ result.x = color.red;
+ result.y = color.green;
+ result.z = color.blue;
+ result.w = color.alpha;
+ return result;
+ };
+
+ /**
+ * Duplicates a Cartesian4 instance.
+ *
+ * @param {Cartesian4} cartesian The Cartesian to duplicate.
+ * @param {Cartesian4} [result] The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)
+ */
+ Cartesian4.clone = function (cartesian, result) {
+ if (!defaultValue.defined(cartesian)) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Cartesian4(cartesian.x, cartesian.y, cartesian.z, cartesian.w);
+ }
+
+ result.x = cartesian.x;
+ result.y = cartesian.y;
+ result.z = cartesian.z;
+ result.w = cartesian.w;
+ return result;
+ };
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ Cartesian4.packedLength = 4;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {Cartesian4} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ Cartesian4.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value.x;
+ array[startingIndex++] = value.y;
+ array[startingIndex++] = value.z;
+ array[startingIndex] = value.w;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {Cartesian4} [result] The object into which to store the result.
+ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.
+ */
+ Cartesian4.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian4();
+ }
+ result.x = array[startingIndex++];
+ result.y = array[startingIndex++];
+ result.z = array[startingIndex++];
+ result.w = array[startingIndex];
+ return result;
+ };
+
+ /**
+ * Flattens an array of Cartesian4s into an array of components.
+ *
+ * @param {Cartesian4[]} array The array of cartesians to pack.
+ * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.
+ * @returns {Number[]} The packed array.
+ */
+ Cartesian4.packArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ const resultLength = length * 4;
+ if (!defaultValue.defined(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(
+ "If result is a typed array, it must have exactly array.length * 4 elements"
+ );
+ //>>includeEnd('debug');
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+
+ for (let i = 0; i < length; ++i) {
+ Cartesian4.pack(array[i], result, i * 4);
+ }
+ return result;
+ };
+
+ /**
+ * Unpacks an array of cartesian components into an array of Cartesian4s.
+ *
+ * @param {Number[]} array The array of components to unpack.
+ * @param {Cartesian4[]} [result] The array onto which to store the result.
+ * @returns {Cartesian4[]} The unpacked array.
+ */
+ Cartesian4.unpackArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ Check.Check.typeOf.number.greaterThanOrEquals("array.length", array.length, 4);
+ if (array.length % 4 !== 0) {
+ throw new Check.DeveloperError("array length must be a multiple of 4.");
+ }
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length / 4);
+ } else {
+ result.length = length / 4;
+ }
+
+ for (let i = 0; i < length; i += 4) {
+ const index = i / 4;
+ result[index] = Cartesian4.unpack(array, i, result[index]);
+ }
+ return result;
+ };
+
+ /**
+ * Creates a Cartesian4 from four consecutive elements in an array.
+ * @function
+ *
+ * @param {Number[]} array The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.
+ * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.
+ * @param {Cartesian4} [result] The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.
+ *
+ * @example
+ * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)
+ * const v = [1.0, 2.0, 3.0, 4.0];
+ * const p = Cesium.Cartesian4.fromArray(v);
+ *
+ * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array
+ * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];
+ * const p2 = Cesium.Cartesian4.fromArray(v2, 2);
+ */
+ Cartesian4.fromArray = Cartesian4.unpack;
+
+ /**
+ * Computes the value of the maximum component for the supplied Cartesian.
+ *
+ * @param {Cartesian4} cartesian The cartesian to use.
+ * @returns {Number} The value of the maximum component.
+ */
+ Cartesian4.maximumComponent = function (cartesian) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w);
+ };
+
+ /**
+ * Computes the value of the minimum component for the supplied Cartesian.
+ *
+ * @param {Cartesian4} cartesian The cartesian to use.
+ * @returns {Number} The value of the minimum component.
+ */
+ Cartesian4.minimumComponent = function (cartesian) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w);
+ };
+
+ /**
+ * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
+ *
+ * @param {Cartesian4} first A cartesian to compare.
+ * @param {Cartesian4} second A cartesian to compare.
+ * @param {Cartesian4} result The object into which to store the result.
+ * @returns {Cartesian4} A cartesian with the minimum components.
+ */
+ Cartesian4.minimumByComponent = function (first, second, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("first", first);
+ Check.Check.typeOf.object("second", second);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Math.min(first.x, second.x);
+ result.y = Math.min(first.y, second.y);
+ result.z = Math.min(first.z, second.z);
+ result.w = Math.min(first.w, second.w);
+
+ return result;
+ };
+
+ /**
+ * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
+ *
+ * @param {Cartesian4} first A cartesian to compare.
+ * @param {Cartesian4} second A cartesian to compare.
+ * @param {Cartesian4} result The object into which to store the result.
+ * @returns {Cartesian4} A cartesian with the maximum components.
+ */
+ Cartesian4.maximumByComponent = function (first, second, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("first", first);
+ Check.Check.typeOf.object("second", second);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Math.max(first.x, second.x);
+ result.y = Math.max(first.y, second.y);
+ result.z = Math.max(first.z, second.z);
+ result.w = Math.max(first.w, second.w);
+
+ return result;
+ };
+
+ /**
+ * Constrain a value to lie between two values.
+ *
+ * @param {Cartesian4} value The value to clamp.
+ * @param {Cartesian4} min The minimum bound.
+ * @param {Cartesian4} max The maximum bound.
+ * @param {Cartesian4} result The object into which to store the result.
+ * @returns {Cartesian4} The clamped value such that min <= result <= max.
+ */
+ Cartesian4.clamp = function (value, min, max, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.typeOf.object("min", min);
+ Check.Check.typeOf.object("max", max);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const x = Math$1.CesiumMath.clamp(value.x, min.x, max.x);
+ const y = Math$1.CesiumMath.clamp(value.y, min.y, max.y);
+ const z = Math$1.CesiumMath.clamp(value.z, min.z, max.z);
+ const w = Math$1.CesiumMath.clamp(value.w, min.w, max.w);
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+
+ return result;
+ };
+
+ /**
+ * Computes the provided Cartesian's squared magnitude.
+ *
+ * @param {Cartesian4} cartesian The Cartesian instance whose squared magnitude is to be computed.
+ * @returns {Number} The squared magnitude.
+ */
+ Cartesian4.magnitudeSquared = function (cartesian) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ return (
+ cartesian.x * cartesian.x +
+ cartesian.y * cartesian.y +
+ cartesian.z * cartesian.z +
+ cartesian.w * cartesian.w
+ );
+ };
+
+ /**
+ * Computes the Cartesian's magnitude (length).
+ *
+ * @param {Cartesian4} cartesian The Cartesian instance whose magnitude is to be computed.
+ * @returns {Number} The magnitude.
+ */
+ Cartesian4.magnitude = function (cartesian) {
+ return Math.sqrt(Cartesian4.magnitudeSquared(cartesian));
+ };
+
+ const distanceScratch$1 = new Cartesian4();
+
+ /**
+ * Computes the 4-space distance between two points.
+ *
+ * @param {Cartesian4} left The first point to compute the distance from.
+ * @param {Cartesian4} right The second point to compute the distance to.
+ * @returns {Number} The distance between two points.
+ *
+ * @example
+ * // Returns 1.0
+ * const d = Cesium.Cartesian4.distance(
+ * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
+ * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));
+ */
+ Cartesian4.distance = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ Cartesian4.subtract(left, right, distanceScratch$1);
+ return Cartesian4.magnitude(distanceScratch$1);
+ };
+
+ /**
+ * Computes the squared distance between two points. Comparing squared distances
+ * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.
+ *
+ * @param {Cartesian4} left The first point to compute the distance from.
+ * @param {Cartesian4} right The second point to compute the distance to.
+ * @returns {Number} The distance between two points.
+ *
+ * @example
+ * // Returns 4.0, not 2.0
+ * const d = Cesium.Cartesian4.distance(
+ * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),
+ * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));
+ */
+ Cartesian4.distanceSquared = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ Cartesian4.subtract(left, right, distanceScratch$1);
+ return Cartesian4.magnitudeSquared(distanceScratch$1);
+ };
+
+ /**
+ * Computes the normalized form of the supplied Cartesian.
+ *
+ * @param {Cartesian4} cartesian The Cartesian to be normalized.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Cartesian4.normalize = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const magnitude = Cartesian4.magnitude(cartesian);
+
+ result.x = cartesian.x / magnitude;
+ result.y = cartesian.y / magnitude;
+ result.z = cartesian.z / magnitude;
+ result.w = cartesian.w / magnitude;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (
+ isNaN(result.x) ||
+ isNaN(result.y) ||
+ isNaN(result.z) ||
+ isNaN(result.w)
+ ) {
+ throw new Check.DeveloperError("normalized result is not a number");
+ }
+ //>>includeEnd('debug');
+
+ return result;
+ };
+
+ /**
+ * Computes the dot (scalar) product of two Cartesians.
+ *
+ * @param {Cartesian4} left The first Cartesian.
+ * @param {Cartesian4} right The second Cartesian.
+ * @returns {Number} The dot product.
+ */
+ Cartesian4.dot = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ return (
+ left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w
+ );
+ };
+
+ /**
+ * Computes the componentwise product of two Cartesians.
+ *
+ * @param {Cartesian4} left The first Cartesian.
+ * @param {Cartesian4} right The second Cartesian.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Cartesian4.multiplyComponents = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x * right.x;
+ result.y = left.y * right.y;
+ result.z = left.z * right.z;
+ result.w = left.w * right.w;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise quotient of two Cartesians.
+ *
+ * @param {Cartesian4} left The first Cartesian.
+ * @param {Cartesian4} right The second Cartesian.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Cartesian4.divideComponents = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x / right.x;
+ result.y = left.y / right.y;
+ result.z = left.z / right.z;
+ result.w = left.w / right.w;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise sum of two Cartesians.
+ *
+ * @param {Cartesian4} left The first Cartesian.
+ * @param {Cartesian4} right The second Cartesian.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Cartesian4.add = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x + right.x;
+ result.y = left.y + right.y;
+ result.z = left.z + right.z;
+ result.w = left.w + right.w;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise difference of two Cartesians.
+ *
+ * @param {Cartesian4} left The first Cartesian.
+ * @param {Cartesian4} right The second Cartesian.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Cartesian4.subtract = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x - right.x;
+ result.y = left.y - right.y;
+ result.z = left.z - right.z;
+ result.w = left.w - right.w;
+ return result;
+ };
+
+ /**
+ * Multiplies the provided Cartesian componentwise by the provided scalar.
+ *
+ * @param {Cartesian4} cartesian The Cartesian to be scaled.
+ * @param {Number} scalar The scalar to multiply with.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Cartesian4.multiplyByScalar = function (cartesian, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = cartesian.x * scalar;
+ result.y = cartesian.y * scalar;
+ result.z = cartesian.z * scalar;
+ result.w = cartesian.w * scalar;
+ return result;
+ };
+
+ /**
+ * Divides the provided Cartesian componentwise by the provided scalar.
+ *
+ * @param {Cartesian4} cartesian The Cartesian to be divided.
+ * @param {Number} scalar The scalar to divide by.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Cartesian4.divideByScalar = function (cartesian, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = cartesian.x / scalar;
+ result.y = cartesian.y / scalar;
+ result.z = cartesian.z / scalar;
+ result.w = cartesian.w / scalar;
+ return result;
+ };
+
+ /**
+ * Negates the provided Cartesian.
+ *
+ * @param {Cartesian4} cartesian The Cartesian to be negated.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Cartesian4.negate = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = -cartesian.x;
+ result.y = -cartesian.y;
+ result.z = -cartesian.z;
+ result.w = -cartesian.w;
+ return result;
+ };
+
+ /**
+ * Computes the absolute value of the provided Cartesian.
+ *
+ * @param {Cartesian4} cartesian The Cartesian whose absolute value is to be computed.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Cartesian4.abs = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Math.abs(cartesian.x);
+ result.y = Math.abs(cartesian.y);
+ result.z = Math.abs(cartesian.z);
+ result.w = Math.abs(cartesian.w);
+ return result;
+ };
+
+ const lerpScratch$1 = new Cartesian4();
+ /**
+ * Computes the linear interpolation or extrapolation at t using the provided cartesians.
+ *
+ * @param {Cartesian4} start The value corresponding to t at 0.0.
+ * @param {Cartesian4}end The value corresponding to t at 1.0.
+ * @param {Number} t The point along t at which to interpolate.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Cartesian4.lerp = function (start, end, t, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("start", start);
+ Check.Check.typeOf.object("end", end);
+ Check.Check.typeOf.number("t", t);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ Cartesian4.multiplyByScalar(end, t, lerpScratch$1);
+ result = Cartesian4.multiplyByScalar(start, 1.0 - t, result);
+ return Cartesian4.add(lerpScratch$1, result, result);
+ };
+
+ const mostOrthogonalAxisScratch$1 = new Cartesian4();
+ /**
+ * Returns the axis that is most orthogonal to the provided Cartesian.
+ *
+ * @param {Cartesian4} cartesian The Cartesian on which to find the most orthogonal axis.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The most orthogonal axis.
+ */
+ Cartesian4.mostOrthogonalAxis = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch$1);
+ Cartesian4.abs(f, f);
+
+ if (f.x <= f.y) {
+ if (f.x <= f.z) {
+ if (f.x <= f.w) {
+ result = Cartesian4.clone(Cartesian4.UNIT_X, result);
+ } else {
+ result = Cartesian4.clone(Cartesian4.UNIT_W, result);
+ }
+ } else if (f.z <= f.w) {
+ result = Cartesian4.clone(Cartesian4.UNIT_Z, result);
+ } else {
+ result = Cartesian4.clone(Cartesian4.UNIT_W, result);
+ }
+ } else if (f.y <= f.z) {
+ if (f.y <= f.w) {
+ result = Cartesian4.clone(Cartesian4.UNIT_Y, result);
+ } else {
+ result = Cartesian4.clone(Cartesian4.UNIT_W, result);
+ }
+ } else if (f.z <= f.w) {
+ result = Cartesian4.clone(Cartesian4.UNIT_Z, result);
+ } else {
+ result = Cartesian4.clone(Cartesian4.UNIT_W, result);
+ }
+
+ return result;
+ };
+
+ /**
+ * Compares the provided Cartesians componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Cartesian4} [left] The first Cartesian.
+ * @param {Cartesian4} [right] The second Cartesian.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ Cartesian4.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left.x === right.x &&
+ left.y === right.y &&
+ left.z === right.z &&
+ left.w === right.w)
+ );
+ };
+
+ /**
+ * @private
+ */
+ Cartesian4.equalsArray = function (cartesian, array, offset) {
+ return (
+ cartesian.x === array[offset] &&
+ cartesian.y === array[offset + 1] &&
+ cartesian.z === array[offset + 2] &&
+ cartesian.w === array[offset + 3]
+ );
+ };
+
+ /**
+ * Compares the provided Cartesians componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {Cartesian4} [left] The first Cartesian.
+ * @param {Cartesian4} [right] The second Cartesian.
+ * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ Cartesian4.equalsEpsilon = function (
+ left,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.x,
+ right.x,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.y,
+ right.y,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.z,
+ right.z,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.w,
+ right.w,
+ relativeEpsilon,
+ absoluteEpsilon
+ ))
+ );
+ };
+
+ /**
+ * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).
+ *
+ * @type {Cartesian4}
+ * @constant
+ */
+ Cartesian4.ZERO = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 0.0));
+
+ /**
+ * An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).
+ *
+ * @type {Cartesian4}
+ * @constant
+ */
+ Cartesian4.ONE = Object.freeze(new Cartesian4(1.0, 1.0, 1.0, 1.0));
+
+ /**
+ * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).
+ *
+ * @type {Cartesian4}
+ * @constant
+ */
+ Cartesian4.UNIT_X = Object.freeze(new Cartesian4(1.0, 0.0, 0.0, 0.0));
+
+ /**
+ * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).
+ *
+ * @type {Cartesian4}
+ * @constant
+ */
+ Cartesian4.UNIT_Y = Object.freeze(new Cartesian4(0.0, 1.0, 0.0, 0.0));
+
+ /**
+ * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).
+ *
+ * @type {Cartesian4}
+ * @constant
+ */
+ Cartesian4.UNIT_Z = Object.freeze(new Cartesian4(0.0, 0.0, 1.0, 0.0));
+
+ /**
+ * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).
+ *
+ * @type {Cartesian4}
+ * @constant
+ */
+ Cartesian4.UNIT_W = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 1.0));
+
+ /**
+ * Duplicates this Cartesian4 instance.
+ *
+ * @param {Cartesian4} [result] The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.
+ */
+ Cartesian4.prototype.clone = function (result) {
+ return Cartesian4.clone(this, result);
+ };
+
+ /**
+ * Compares this Cartesian against the provided Cartesian componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Cartesian4} [right] The right hand side Cartesian.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ Cartesian4.prototype.equals = function (right) {
+ return Cartesian4.equals(this, right);
+ };
+
+ /**
+ * Compares this Cartesian against the provided Cartesian componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {Cartesian4} [right] The right hand side Cartesian.
+ * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.
+ */
+ Cartesian4.prototype.equalsEpsilon = function (
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ return Cartesian4.equalsEpsilon(
+ this,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+ };
+
+ /**
+ * Creates a string representing this Cartesian in the format '(x, y, z, w)'.
+ *
+ * @returns {String} A string representing the provided Cartesian in the format '(x, y, z, w)'.
+ */
+ Cartesian4.prototype.toString = function () {
+ return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;
+ };
+
+ // scratchU8Array and scratchF32Array are views into the same buffer
+ const scratchF32Array = new Float32Array(1);
+ const scratchU8Array = new Uint8Array(scratchF32Array.buffer);
+
+ const testU32 = new Uint32Array([0x11223344]);
+ const testU8 = new Uint8Array(testU32.buffer);
+ const littleEndian = testU8[0] === 0x44;
+
+ /**
+ * Packs an arbitrary floating point value to 4 values representable using uint8.
+ *
+ * @param {Number} value A floating point number.
+ * @param {Cartesian4} [result] The Cartesian4 that will contain the packed float.
+ * @returns {Cartesian4} A Cartesian4 representing the float packed to values in x, y, z, and w.
+ */
+ Cartesian4.packFloat = function (value, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("value", value);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian4();
+ }
+
+ // scratchU8Array and scratchF32Array are views into the same buffer
+ scratchF32Array[0] = value;
+
+ if (littleEndian) {
+ result.x = scratchU8Array[0];
+ result.y = scratchU8Array[1];
+ result.z = scratchU8Array[2];
+ result.w = scratchU8Array[3];
+ } else {
+ // convert from big-endian to little-endian
+ result.x = scratchU8Array[3];
+ result.y = scratchU8Array[2];
+ result.z = scratchU8Array[1];
+ result.w = scratchU8Array[0];
+ }
+ return result;
+ };
+
+ /**
+ * Unpacks a float packed using Cartesian4.packFloat.
+ *
+ * @param {Cartesian4} packedFloat A Cartesian4 containing a float packed to 4 values representable using uint8.
+ * @returns {Number} The unpacked float.
+ * @private
+ */
+ Cartesian4.unpackFloat = function (packedFloat) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("packedFloat", packedFloat);
+ //>>includeEnd('debug');
+
+ // scratchU8Array and scratchF32Array are views into the same buffer
+ if (littleEndian) {
+ scratchU8Array[0] = packedFloat.x;
+ scratchU8Array[1] = packedFloat.y;
+ scratchU8Array[2] = packedFloat.z;
+ scratchU8Array[3] = packedFloat.w;
+ } else {
+ // convert from little-endian to big-endian
+ scratchU8Array[0] = packedFloat.w;
+ scratchU8Array[1] = packedFloat.z;
+ scratchU8Array[2] = packedFloat.y;
+ scratchU8Array[3] = packedFloat.x;
+ }
+ return scratchF32Array[0];
+ };
+
+ /**
+ * A 4x4 matrix, indexable as a column-major order array.
+ * Constructor parameters are in row-major order for code readability.
+ * @alias Matrix4
+ * @constructor
+ * @implements {ArrayLike}
+ *
+ * @param {Number} [column0Row0=0.0] The value for column 0, row 0.
+ * @param {Number} [column1Row0=0.0] The value for column 1, row 0.
+ * @param {Number} [column2Row0=0.0] The value for column 2, row 0.
+ * @param {Number} [column3Row0=0.0] The value for column 3, row 0.
+ * @param {Number} [column0Row1=0.0] The value for column 0, row 1.
+ * @param {Number} [column1Row1=0.0] The value for column 1, row 1.
+ * @param {Number} [column2Row1=0.0] The value for column 2, row 1.
+ * @param {Number} [column3Row1=0.0] The value for column 3, row 1.
+ * @param {Number} [column0Row2=0.0] The value for column 0, row 2.
+ * @param {Number} [column1Row2=0.0] The value for column 1, row 2.
+ * @param {Number} [column2Row2=0.0] The value for column 2, row 2.
+ * @param {Number} [column3Row2=0.0] The value for column 3, row 2.
+ * @param {Number} [column0Row3=0.0] The value for column 0, row 3.
+ * @param {Number} [column1Row3=0.0] The value for column 1, row 3.
+ * @param {Number} [column2Row3=0.0] The value for column 2, row 3.
+ * @param {Number} [column3Row3=0.0] The value for column 3, row 3.
+ *
+ * @see Matrix4.fromArray
+ * @see Matrix4.fromColumnMajorArray
+ * @see Matrix4.fromRowMajorArray
+ * @see Matrix4.fromRotationTranslation
+ * @see Matrix4.fromTranslationQuaternionRotationScale
+ * @see Matrix4.fromTranslationRotationScale
+ * @see Matrix4.fromTranslation
+ * @see Matrix4.fromScale
+ * @see Matrix4.fromUniformScale
+ * @see Matrix4.fromRotation
+ * @see Matrix4.fromCamera
+ * @see Matrix4.computePerspectiveFieldOfView
+ * @see Matrix4.computeOrthographicOffCenter
+ * @see Matrix4.computePerspectiveOffCenter
+ * @see Matrix4.computeInfinitePerspectiveOffCenter
+ * @see Matrix4.computeViewportTransformation
+ * @see Matrix4.computeView
+ * @see Matrix2
+ * @see Matrix3
+ * @see Packable
+ */
+ function Matrix4(
+ column0Row0,
+ column1Row0,
+ column2Row0,
+ column3Row0,
+ column0Row1,
+ column1Row1,
+ column2Row1,
+ column3Row1,
+ column0Row2,
+ column1Row2,
+ column2Row2,
+ column3Row2,
+ column0Row3,
+ column1Row3,
+ column2Row3,
+ column3Row3
+ ) {
+ this[0] = defaultValue.defaultValue(column0Row0, 0.0);
+ this[1] = defaultValue.defaultValue(column0Row1, 0.0);
+ this[2] = defaultValue.defaultValue(column0Row2, 0.0);
+ this[3] = defaultValue.defaultValue(column0Row3, 0.0);
+ this[4] = defaultValue.defaultValue(column1Row0, 0.0);
+ this[5] = defaultValue.defaultValue(column1Row1, 0.0);
+ this[6] = defaultValue.defaultValue(column1Row2, 0.0);
+ this[7] = defaultValue.defaultValue(column1Row3, 0.0);
+ this[8] = defaultValue.defaultValue(column2Row0, 0.0);
+ this[9] = defaultValue.defaultValue(column2Row1, 0.0);
+ this[10] = defaultValue.defaultValue(column2Row2, 0.0);
+ this[11] = defaultValue.defaultValue(column2Row3, 0.0);
+ this[12] = defaultValue.defaultValue(column3Row0, 0.0);
+ this[13] = defaultValue.defaultValue(column3Row1, 0.0);
+ this[14] = defaultValue.defaultValue(column3Row2, 0.0);
+ this[15] = defaultValue.defaultValue(column3Row3, 0.0);
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ Matrix4.packedLength = 16;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {Matrix4} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ Matrix4.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value[0];
+ array[startingIndex++] = value[1];
+ array[startingIndex++] = value[2];
+ array[startingIndex++] = value[3];
+ array[startingIndex++] = value[4];
+ array[startingIndex++] = value[5];
+ array[startingIndex++] = value[6];
+ array[startingIndex++] = value[7];
+ array[startingIndex++] = value[8];
+ array[startingIndex++] = value[9];
+ array[startingIndex++] = value[10];
+ array[startingIndex++] = value[11];
+ array[startingIndex++] = value[12];
+ array[startingIndex++] = value[13];
+ array[startingIndex++] = value[14];
+ array[startingIndex] = value[15];
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {Matrix4} [result] The object into which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.
+ */
+ Matrix4.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix4();
+ }
+
+ result[0] = array[startingIndex++];
+ result[1] = array[startingIndex++];
+ result[2] = array[startingIndex++];
+ result[3] = array[startingIndex++];
+ result[4] = array[startingIndex++];
+ result[5] = array[startingIndex++];
+ result[6] = array[startingIndex++];
+ result[7] = array[startingIndex++];
+ result[8] = array[startingIndex++];
+ result[9] = array[startingIndex++];
+ result[10] = array[startingIndex++];
+ result[11] = array[startingIndex++];
+ result[12] = array[startingIndex++];
+ result[13] = array[startingIndex++];
+ result[14] = array[startingIndex++];
+ result[15] = array[startingIndex];
+ return result;
+ };
+
+ /**
+ * Flattens an array of Matrix4s into an array of components. The components
+ * are stored in column-major order.
+ *
+ * @param {Matrix4[]} array The array of matrices to pack.
+ * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 16 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 16) elements.
+ * @returns {Number[]} The packed array.
+ */
+ Matrix4.packArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ const resultLength = length * 16;
+ if (!defaultValue.defined(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(
+ "If result is a typed array, it must have exactly array.length * 16 elements"
+ );
+ //>>includeEnd('debug');
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+
+ for (let i = 0; i < length; ++i) {
+ Matrix4.pack(array[i], result, i * 16);
+ }
+ return result;
+ };
+
+ /**
+ * Unpacks an array of column-major matrix components into an array of Matrix4s.
+ *
+ * @param {Number[]} array The array of components to unpack.
+ * @param {Matrix4[]} [result] The array onto which to store the result.
+ * @returns {Matrix4[]} The unpacked array.
+ */
+ Matrix4.unpackArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ Check.Check.typeOf.number.greaterThanOrEquals("array.length", array.length, 16);
+ if (array.length % 16 !== 0) {
+ throw new Check.DeveloperError("array length must be a multiple of 16.");
+ }
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length / 16);
+ } else {
+ result.length = length / 16;
+ }
+
+ for (let i = 0; i < length; i += 16) {
+ const index = i / 16;
+ result[index] = Matrix4.unpack(array, i, result[index]);
+ }
+ return result;
+ };
+
+ /**
+ * Duplicates a Matrix4 instance.
+ *
+ * @param {Matrix4} matrix The matrix to duplicate.
+ * @param {Matrix4} [result] The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)
+ */
+ Matrix4.clone = function (matrix, result) {
+ if (!defaultValue.defined(matrix)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ return new Matrix4(
+ matrix[0],
+ matrix[4],
+ matrix[8],
+ matrix[12],
+ matrix[1],
+ matrix[5],
+ matrix[9],
+ matrix[13],
+ matrix[2],
+ matrix[6],
+ matrix[10],
+ matrix[14],
+ matrix[3],
+ matrix[7],
+ matrix[11],
+ matrix[15]
+ );
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ result[9] = matrix[9];
+ result[10] = matrix[10];
+ result[11] = matrix[11];
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+ };
+
+ /**
+ * Creates a Matrix4 from 16 consecutive elements in an array.
+ * @function
+ *
+ * @param {Number[]} array The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
+ * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.
+ * @param {Matrix4} [result] The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.
+ *
+ * @example
+ * // Create the Matrix4:
+ * // [1.0, 2.0, 3.0, 4.0]
+ * // [1.0, 2.0, 3.0, 4.0]
+ * // [1.0, 2.0, 3.0, 4.0]
+ * // [1.0, 2.0, 3.0, 4.0]
+ *
+ * const v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
+ * const m = Cesium.Matrix4.fromArray(v);
+ *
+ * // Create same Matrix4 with using an offset into an array
+ * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];
+ * const m2 = Cesium.Matrix4.fromArray(v2, 2);
+ */
+ Matrix4.fromArray = Matrix4.unpack;
+
+ /**
+ * Computes a Matrix4 instance from a column-major order array.
+ *
+ * @param {Number[]} values The column-major order array.
+ * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.
+ */
+ Matrix4.fromColumnMajorArray = function (values, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("values", values);
+ //>>includeEnd('debug');
+
+ return Matrix4.clone(values, result);
+ };
+
+ /**
+ * Computes a Matrix4 instance from a row-major order array.
+ * The resulting matrix will be in column-major order.
+ *
+ * @param {Number[]} values The row-major order array.
+ * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.
+ */
+ Matrix4.fromRowMajorArray = function (values, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("values", values);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix4(
+ values[0],
+ values[1],
+ values[2],
+ values[3],
+ values[4],
+ values[5],
+ values[6],
+ values[7],
+ values[8],
+ values[9],
+ values[10],
+ values[11],
+ values[12],
+ values[13],
+ values[14],
+ values[15]
+ );
+ }
+ result[0] = values[0];
+ result[1] = values[4];
+ result[2] = values[8];
+ result[3] = values[12];
+ result[4] = values[1];
+ result[5] = values[5];
+ result[6] = values[9];
+ result[7] = values[13];
+ result[8] = values[2];
+ result[9] = values[6];
+ result[10] = values[10];
+ result[11] = values[14];
+ result[12] = values[3];
+ result[13] = values[7];
+ result[14] = values[11];
+ result[15] = values[15];
+ return result;
+ };
+
+ /**
+ * Computes a Matrix4 instance from a Matrix3 representing the rotation
+ * and a Cartesian3 representing the translation.
+ *
+ * @param {Matrix3} rotation The upper left portion of the matrix representing the rotation.
+ * @param {Cartesian3} [translation=Cartesian3.ZERO] The upper right portion of the matrix representing the translation.
+ * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.
+ */
+ Matrix4.fromRotationTranslation = function (rotation, translation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rotation", rotation);
+ //>>includeEnd('debug');
+
+ translation = defaultValue.defaultValue(translation, Matrix3.Cartesian3.ZERO);
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix4(
+ rotation[0],
+ rotation[3],
+ rotation[6],
+ translation.x,
+ rotation[1],
+ rotation[4],
+ rotation[7],
+ translation.y,
+ rotation[2],
+ rotation[5],
+ rotation[8],
+ translation.z,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ );
+ }
+
+ result[0] = rotation[0];
+ result[1] = rotation[1];
+ result[2] = rotation[2];
+ result[3] = 0.0;
+ result[4] = rotation[3];
+ result[5] = rotation[4];
+ result[6] = rotation[5];
+ result[7] = 0.0;
+ result[8] = rotation[6];
+ result[9] = rotation[7];
+ result[10] = rotation[8];
+ result[11] = 0.0;
+ result[12] = translation.x;
+ result[13] = translation.y;
+ result[14] = translation.z;
+ result[15] = 1.0;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix4 instance from a translation, rotation, and scale (TRS)
+ * representation with the rotation represented as a quaternion.
+ *
+ * @param {Cartesian3} translation The translation transformation.
+ * @param {Quaternion} rotation The rotation transformation.
+ * @param {Cartesian3} scale The non-uniform scale transformation.
+ * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.
+ *
+ * @example
+ * const result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
+ * new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation
+ * Cesium.Quaternion.IDENTITY, // rotation
+ * new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale
+ * result);
+ */
+ Matrix4.fromTranslationQuaternionRotationScale = function (
+ translation,
+ rotation,
+ scale,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("translation", translation);
+ Check.Check.typeOf.object("rotation", rotation);
+ Check.Check.typeOf.object("scale", scale);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix4();
+ }
+
+ const scaleX = scale.x;
+ const scaleY = scale.y;
+ const scaleZ = scale.z;
+
+ const x2 = rotation.x * rotation.x;
+ const xy = rotation.x * rotation.y;
+ const xz = rotation.x * rotation.z;
+ const xw = rotation.x * rotation.w;
+ const y2 = rotation.y * rotation.y;
+ const yz = rotation.y * rotation.z;
+ const yw = rotation.y * rotation.w;
+ const z2 = rotation.z * rotation.z;
+ const zw = rotation.z * rotation.w;
+ const w2 = rotation.w * rotation.w;
+
+ const m00 = x2 - y2 - z2 + w2;
+ const m01 = 2.0 * (xy - zw);
+ const m02 = 2.0 * (xz + yw);
+
+ const m10 = 2.0 * (xy + zw);
+ const m11 = -x2 + y2 - z2 + w2;
+ const m12 = 2.0 * (yz - xw);
+
+ const m20 = 2.0 * (xz - yw);
+ const m21 = 2.0 * (yz + xw);
+ const m22 = -x2 - y2 + z2 + w2;
+
+ result[0] = m00 * scaleX;
+ result[1] = m10 * scaleX;
+ result[2] = m20 * scaleX;
+ result[3] = 0.0;
+ result[4] = m01 * scaleY;
+ result[5] = m11 * scaleY;
+ result[6] = m21 * scaleY;
+ result[7] = 0.0;
+ result[8] = m02 * scaleZ;
+ result[9] = m12 * scaleZ;
+ result[10] = m22 * scaleZ;
+ result[11] = 0.0;
+ result[12] = translation.x;
+ result[13] = translation.y;
+ result[14] = translation.z;
+ result[15] = 1.0;
+
+ return result;
+ };
+
+ /**
+ * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.
+ *
+ * @param {TranslationRotationScale} translationRotationScale The instance.
+ * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.
+ */
+ Matrix4.fromTranslationRotationScale = function (
+ translationRotationScale,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("translationRotationScale", translationRotationScale);
+ //>>includeEnd('debug');
+
+ return Matrix4.fromTranslationQuaternionRotationScale(
+ translationRotationScale.translation,
+ translationRotationScale.rotation,
+ translationRotationScale.scale,
+ result
+ );
+ };
+
+ /**
+ * Creates a Matrix4 instance from a Cartesian3 representing the translation.
+ *
+ * @param {Cartesian3} translation The upper right portion of the matrix representing the translation.
+ * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.
+ *
+ * @see Matrix4.multiplyByTranslation
+ */
+ Matrix4.fromTranslation = function (translation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("translation", translation);
+ //>>includeEnd('debug');
+
+ return Matrix4.fromRotationTranslation(Matrix3.Matrix3.IDENTITY, translation, result);
+ };
+
+ /**
+ * Computes a Matrix4 instance representing a non-uniform scale.
+ *
+ * @param {Cartesian3} scale The x, y, and z scale factors.
+ * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.
+ *
+ * @example
+ * // Creates
+ * // [7.0, 0.0, 0.0, 0.0]
+ * // [0.0, 8.0, 0.0, 0.0]
+ * // [0.0, 0.0, 9.0, 0.0]
+ * // [0.0, 0.0, 0.0, 1.0]
+ * const m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
+ */
+ Matrix4.fromScale = function (scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("scale", scale);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix4(
+ scale.x,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ scale.y,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ scale.z,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ );
+ }
+
+ result[0] = scale.x;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = 0.0;
+ result[5] = scale.y;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = 0.0;
+ result[9] = 0.0;
+ result[10] = scale.z;
+ result[11] = 0.0;
+ result[12] = 0.0;
+ result[13] = 0.0;
+ result[14] = 0.0;
+ result[15] = 1.0;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix4 instance representing a uniform scale.
+ *
+ * @param {Number} scale The uniform scale factor.
+ * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.
+ *
+ * @example
+ * // Creates
+ * // [2.0, 0.0, 0.0, 0.0]
+ * // [0.0, 2.0, 0.0, 0.0]
+ * // [0.0, 0.0, 2.0, 0.0]
+ * // [0.0, 0.0, 0.0, 1.0]
+ * const m = Cesium.Matrix4.fromUniformScale(2.0);
+ */
+ Matrix4.fromUniformScale = function (scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("scale", scale);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix4(
+ scale,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ scale,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ scale,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ );
+ }
+
+ result[0] = scale;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = 0.0;
+ result[5] = scale;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = 0.0;
+ result[9] = 0.0;
+ result[10] = scale;
+ result[11] = 0.0;
+ result[12] = 0.0;
+ result[13] = 0.0;
+ result[14] = 0.0;
+ result[15] = 1.0;
+ return result;
+ };
+
+ /**
+ * Creates a rotation matrix.
+ *
+ * @param {Matrix3} rotation The rotation matrix.
+ * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.
+ */
+ Matrix4.fromRotation = function (rotation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rotation", rotation);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix4();
+ }
+ result[0] = rotation[0];
+ result[1] = rotation[1];
+ result[2] = rotation[2];
+ result[3] = 0.0;
+
+ result[4] = rotation[3];
+ result[5] = rotation[4];
+ result[6] = rotation[5];
+ result[7] = 0.0;
+
+ result[8] = rotation[6];
+ result[9] = rotation[7];
+ result[10] = rotation[8];
+ result[11] = 0.0;
+
+ result[12] = 0.0;
+ result[13] = 0.0;
+ result[14] = 0.0;
+ result[15] = 1.0;
+
+ return result;
+ };
+
+ const fromCameraF = new Matrix3.Cartesian3();
+ const fromCameraR = new Matrix3.Cartesian3();
+ const fromCameraU = new Matrix3.Cartesian3();
+
+ /**
+ * Computes a Matrix4 instance from a Camera.
+ *
+ * @param {Camera} camera The camera to use.
+ * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.
+ */
+ Matrix4.fromCamera = function (camera, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("camera", camera);
+ //>>includeEnd('debug');
+
+ const position = camera.position;
+ const direction = camera.direction;
+ const up = camera.up;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("camera.position", position);
+ Check.Check.typeOf.object("camera.direction", direction);
+ Check.Check.typeOf.object("camera.up", up);
+ //>>includeEnd('debug');
+
+ Matrix3.Cartesian3.normalize(direction, fromCameraF);
+ Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(fromCameraF, up, fromCameraR),
+ fromCameraR
+ );
+ Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(fromCameraR, fromCameraF, fromCameraU),
+ fromCameraU
+ );
+
+ const sX = fromCameraR.x;
+ const sY = fromCameraR.y;
+ const sZ = fromCameraR.z;
+ const fX = fromCameraF.x;
+ const fY = fromCameraF.y;
+ const fZ = fromCameraF.z;
+ const uX = fromCameraU.x;
+ const uY = fromCameraU.y;
+ const uZ = fromCameraU.z;
+ const positionX = position.x;
+ const positionY = position.y;
+ const positionZ = position.z;
+ const t0 = sX * -positionX + sY * -positionY + sZ * -positionZ;
+ const t1 = uX * -positionX + uY * -positionY + uZ * -positionZ;
+ const t2 = fX * positionX + fY * positionY + fZ * positionZ;
+
+ // The code below this comment is an optimized
+ // version of the commented lines.
+ // Rather that create two matrices and then multiply,
+ // we just bake in the multiplcation as part of creation.
+ // const rotation = new Matrix4(
+ // sX, sY, sZ, 0.0,
+ // uX, uY, uZ, 0.0,
+ // -fX, -fY, -fZ, 0.0,
+ // 0.0, 0.0, 0.0, 1.0);
+ // const translation = new Matrix4(
+ // 1.0, 0.0, 0.0, -position.x,
+ // 0.0, 1.0, 0.0, -position.y,
+ // 0.0, 0.0, 1.0, -position.z,
+ // 0.0, 0.0, 0.0, 1.0);
+ // return rotation.multiply(translation);
+ if (!defaultValue.defined(result)) {
+ return new Matrix4(
+ sX,
+ sY,
+ sZ,
+ t0,
+ uX,
+ uY,
+ uZ,
+ t1,
+ -fX,
+ -fY,
+ -fZ,
+ t2,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ );
+ }
+ result[0] = sX;
+ result[1] = uX;
+ result[2] = -fX;
+ result[3] = 0.0;
+ result[4] = sY;
+ result[5] = uY;
+ result[6] = -fY;
+ result[7] = 0.0;
+ result[8] = sZ;
+ result[9] = uZ;
+ result[10] = -fZ;
+ result[11] = 0.0;
+ result[12] = t0;
+ result[13] = t1;
+ result[14] = t2;
+ result[15] = 1.0;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix4 instance representing a perspective transformation matrix.
+ *
+ * @param {Number} fovY The field of view along the Y axis in radians.
+ * @param {Number} aspectRatio The aspect ratio.
+ * @param {Number} near The distance to the near plane in meters.
+ * @param {Number} far The distance to the far plane in meters.
+ * @param {Matrix4} result The object in which the result will be stored.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @exception {DeveloperError} fovY must be in (0, PI].
+ * @exception {DeveloperError} aspectRatio must be greater than zero.
+ * @exception {DeveloperError} near must be greater than zero.
+ * @exception {DeveloperError} far must be greater than zero.
+ */
+ Matrix4.computePerspectiveFieldOfView = function (
+ fovY,
+ aspectRatio,
+ near,
+ far,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.greaterThan("fovY", fovY, 0.0);
+ Check.Check.typeOf.number.lessThan("fovY", fovY, Math.PI);
+ Check.Check.typeOf.number.greaterThan("near", near, 0.0);
+ Check.Check.typeOf.number.greaterThan("far", far, 0.0);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const bottom = Math.tan(fovY * 0.5);
+
+ const column1Row1 = 1.0 / bottom;
+ const column0Row0 = column1Row1 / aspectRatio;
+ const column2Row2 = (far + near) / (near - far);
+ const column3Row2 = (2.0 * far * near) / (near - far);
+
+ result[0] = column0Row0;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = 0.0;
+ result[5] = column1Row1;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = 0.0;
+ result[9] = 0.0;
+ result[10] = column2Row2;
+ result[11] = -1.0;
+ result[12] = 0.0;
+ result[13] = 0.0;
+ result[14] = column3Row2;
+ result[15] = 0.0;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix4 instance representing an orthographic transformation matrix.
+ *
+ * @param {Number} left The number of meters to the left of the camera that will be in view.
+ * @param {Number} right The number of meters to the right of the camera that will be in view.
+ * @param {Number} bottom The number of meters below of the camera that will be in view.
+ * @param {Number} top The number of meters above of the camera that will be in view.
+ * @param {Number} near The distance to the near plane in meters.
+ * @param {Number} far The distance to the far plane in meters.
+ * @param {Matrix4} result The object in which the result will be stored.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.computeOrthographicOffCenter = function (
+ left,
+ right,
+ bottom,
+ top,
+ near,
+ far,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("left", left);
+ Check.Check.typeOf.number("right", right);
+ Check.Check.typeOf.number("bottom", bottom);
+ Check.Check.typeOf.number("top", top);
+ Check.Check.typeOf.number("near", near);
+ Check.Check.typeOf.number("far", far);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ let a = 1.0 / (right - left);
+ let b = 1.0 / (top - bottom);
+ let c = 1.0 / (far - near);
+
+ const tx = -(right + left) * a;
+ const ty = -(top + bottom) * b;
+ const tz = -(far + near) * c;
+ a *= 2.0;
+ b *= 2.0;
+ c *= -2.0;
+
+ result[0] = a;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = 0.0;
+ result[5] = b;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = 0.0;
+ result[9] = 0.0;
+ result[10] = c;
+ result[11] = 0.0;
+ result[12] = tx;
+ result[13] = ty;
+ result[14] = tz;
+ result[15] = 1.0;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix4 instance representing an off center perspective transformation.
+ *
+ * @param {Number} left The number of meters to the left of the camera that will be in view.
+ * @param {Number} right The number of meters to the right of the camera that will be in view.
+ * @param {Number} bottom The number of meters below of the camera that will be in view.
+ * @param {Number} top The number of meters above of the camera that will be in view.
+ * @param {Number} near The distance to the near plane in meters.
+ * @param {Number} far The distance to the far plane in meters.
+ * @param {Matrix4} result The object in which the result will be stored.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.computePerspectiveOffCenter = function (
+ left,
+ right,
+ bottom,
+ top,
+ near,
+ far,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("left", left);
+ Check.Check.typeOf.number("right", right);
+ Check.Check.typeOf.number("bottom", bottom);
+ Check.Check.typeOf.number("top", top);
+ Check.Check.typeOf.number("near", near);
+ Check.Check.typeOf.number("far", far);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const column0Row0 = (2.0 * near) / (right - left);
+ const column1Row1 = (2.0 * near) / (top - bottom);
+ const column2Row0 = (right + left) / (right - left);
+ const column2Row1 = (top + bottom) / (top - bottom);
+ const column2Row2 = -(far + near) / (far - near);
+ const column2Row3 = -1.0;
+ const column3Row2 = (-2.0 * far * near) / (far - near);
+
+ result[0] = column0Row0;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = 0.0;
+ result[5] = column1Row1;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = column2Row0;
+ result[9] = column2Row1;
+ result[10] = column2Row2;
+ result[11] = column2Row3;
+ result[12] = 0.0;
+ result[13] = 0.0;
+ result[14] = column3Row2;
+ result[15] = 0.0;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix4 instance representing an infinite off center perspective transformation.
+ *
+ * @param {Number} left The number of meters to the left of the camera that will be in view.
+ * @param {Number} right The number of meters to the right of the camera that will be in view.
+ * @param {Number} bottom The number of meters below of the camera that will be in view.
+ * @param {Number} top The number of meters above of the camera that will be in view.
+ * @param {Number} near The distance to the near plane in meters.
+ * @param {Matrix4} result The object in which the result will be stored.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.computeInfinitePerspectiveOffCenter = function (
+ left,
+ right,
+ bottom,
+ top,
+ near,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("left", left);
+ Check.Check.typeOf.number("right", right);
+ Check.Check.typeOf.number("bottom", bottom);
+ Check.Check.typeOf.number("top", top);
+ Check.Check.typeOf.number("near", near);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const column0Row0 = (2.0 * near) / (right - left);
+ const column1Row1 = (2.0 * near) / (top - bottom);
+ const column2Row0 = (right + left) / (right - left);
+ const column2Row1 = (top + bottom) / (top - bottom);
+ const column2Row2 = -1.0;
+ const column2Row3 = -1.0;
+ const column3Row2 = -2.0 * near;
+
+ result[0] = column0Row0;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = 0.0;
+ result[5] = column1Row1;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = column2Row0;
+ result[9] = column2Row1;
+ result[10] = column2Row2;
+ result[11] = column2Row3;
+ result[12] = 0.0;
+ result[13] = 0.0;
+ result[14] = column3Row2;
+ result[15] = 0.0;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.
+ *
+ * @param {Object} [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] The viewport's corners as shown in Example 1.
+ * @param {Number} [nearDepthRange=0.0] The near plane distance in window coordinates.
+ * @param {Number} [farDepthRange=1.0] The far plane distance in window coordinates.
+ * @param {Matrix4} [result] The object in which the result will be stored.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @example
+ * // Create viewport transformation using an explicit viewport and depth range.
+ * const m = Cesium.Matrix4.computeViewportTransformation({
+ * x : 0.0,
+ * y : 0.0,
+ * width : 1024.0,
+ * height : 768.0
+ * }, 0.0, 1.0, new Cesium.Matrix4());
+ */
+ Matrix4.computeViewportTransformation = function (
+ viewport,
+ nearDepthRange,
+ farDepthRange,
+ result
+ ) {
+ if (!defaultValue.defined(result)) {
+ result = new Matrix4();
+ }
+
+ viewport = defaultValue.defaultValue(viewport, defaultValue.defaultValue.EMPTY_OBJECT);
+ const x = defaultValue.defaultValue(viewport.x, 0.0);
+ const y = defaultValue.defaultValue(viewport.y, 0.0);
+ const width = defaultValue.defaultValue(viewport.width, 0.0);
+ const height = defaultValue.defaultValue(viewport.height, 0.0);
+ nearDepthRange = defaultValue.defaultValue(nearDepthRange, 0.0);
+ farDepthRange = defaultValue.defaultValue(farDepthRange, 1.0);
+
+ const halfWidth = width * 0.5;
+ const halfHeight = height * 0.5;
+ const halfDepth = (farDepthRange - nearDepthRange) * 0.5;
+
+ const column0Row0 = halfWidth;
+ const column1Row1 = halfHeight;
+ const column2Row2 = halfDepth;
+ const column3Row0 = x + halfWidth;
+ const column3Row1 = y + halfHeight;
+ const column3Row2 = nearDepthRange + halfDepth;
+ const column3Row3 = 1.0;
+
+ result[0] = column0Row0;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = 0.0;
+ result[5] = column1Row1;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = 0.0;
+ result[9] = 0.0;
+ result[10] = column2Row2;
+ result[11] = 0.0;
+ result[12] = column3Row0;
+ result[13] = column3Row1;
+ result[14] = column3Row2;
+ result[15] = column3Row3;
+
+ return result;
+ };
+
+ /**
+ * Computes a Matrix4 instance that transforms from world space to view space.
+ *
+ * @param {Cartesian3} position The position of the camera.
+ * @param {Cartesian3} direction The forward direction.
+ * @param {Cartesian3} up The up direction.
+ * @param {Cartesian3} right The right direction.
+ * @param {Matrix4} result The object in which the result will be stored.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.computeView = function (position, direction, up, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("position", position);
+ Check.Check.typeOf.object("direction", direction);
+ Check.Check.typeOf.object("up", up);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = right.x;
+ result[1] = up.x;
+ result[2] = -direction.x;
+ result[3] = 0.0;
+ result[4] = right.y;
+ result[5] = up.y;
+ result[6] = -direction.y;
+ result[7] = 0.0;
+ result[8] = right.z;
+ result[9] = up.z;
+ result[10] = -direction.z;
+ result[11] = 0.0;
+ result[12] = -Matrix3.Cartesian3.dot(right, position);
+ result[13] = -Matrix3.Cartesian3.dot(up, position);
+ result[14] = Matrix3.Cartesian3.dot(direction, position);
+ result[15] = 1.0;
+ return result;
+ };
+
+ /**
+ * Computes an Array from the provided Matrix4 instance.
+ * The array will be in column-major order.
+ *
+ * @param {Matrix4} matrix The matrix to use..
+ * @param {Number[]} [result] The Array onto which to store the result.
+ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided.
+ *
+ * @example
+ * //create an array from an instance of Matrix4
+ * // m = [10.0, 14.0, 18.0, 22.0]
+ * // [11.0, 15.0, 19.0, 23.0]
+ * // [12.0, 16.0, 20.0, 24.0]
+ * // [13.0, 17.0, 21.0, 25.0]
+ * const a = Cesium.Matrix4.toArray(m);
+ *
+ * // m remains the same
+ * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0]
+ */
+ Matrix4.toArray = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return [
+ matrix[0],
+ matrix[1],
+ matrix[2],
+ matrix[3],
+ matrix[4],
+ matrix[5],
+ matrix[6],
+ matrix[7],
+ matrix[8],
+ matrix[9],
+ matrix[10],
+ matrix[11],
+ matrix[12],
+ matrix[13],
+ matrix[14],
+ matrix[15],
+ ];
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ result[9] = matrix[9];
+ result[10] = matrix[10];
+ result[11] = matrix[11];
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+ };
+
+ /**
+ * Computes the array index of the element at the provided row and column.
+ *
+ * @param {Number} row The zero-based index of the row.
+ * @param {Number} column The zero-based index of the column.
+ * @returns {Number} The index of the element at the provided row and column.
+ *
+ * @exception {DeveloperError} row must be 0, 1, 2, or 3.
+ * @exception {DeveloperError} column must be 0, 1, 2, or 3.
+ *
+ * @example
+ * const myMatrix = new Cesium.Matrix4();
+ * const column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);
+ * const column1Row0 = myMatrix[column1Row0Index];
+ * myMatrix[column1Row0Index] = 10.0;
+ */
+ Matrix4.getElementIndex = function (column, row) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.greaterThanOrEquals("row", row, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("row", row, 3);
+
+ Check.Check.typeOf.number.greaterThanOrEquals("column", column, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("column", column, 3);
+ //>>includeEnd('debug');
+
+ return column * 4 + row;
+ };
+
+ /**
+ * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.
+ *
+ * @param {Matrix4} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the column to retrieve.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0, 1, 2, or 3.
+ *
+ * @example
+ * //returns a Cartesian4 instance with values from the specified column
+ * // m = [10.0, 11.0, 12.0, 13.0]
+ * // [14.0, 15.0, 16.0, 17.0]
+ * // [18.0, 19.0, 20.0, 21.0]
+ * // [22.0, 23.0, 24.0, 25.0]
+ *
+ * //Example 1: Creates an instance of Cartesian
+ * const a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());
+ *
+ * @example
+ * //Example 2: Sets values for Cartesian instance
+ * const a = new Cesium.Cartesian4();
+ * Cesium.Matrix4.getColumn(m, 2, a);
+ *
+ * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;
+ */
+ Matrix4.getColumn = function (matrix, index, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 3);
+
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const startIndex = index * 4;
+ const x = matrix[startIndex];
+ const y = matrix[startIndex + 1];
+ const z = matrix[startIndex + 2];
+ const w = matrix[startIndex + 3];
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+ };
+
+ /**
+ * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.
+ *
+ * @param {Matrix4} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the column to set.
+ * @param {Cartesian4} cartesian The Cartesian whose values will be assigned to the specified column.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0, 1, 2, or 3.
+ *
+ * @example
+ * //creates a new Matrix4 instance with new column values from the Cartesian4 instance
+ * // m = [10.0, 11.0, 12.0, 13.0]
+ * // [14.0, 15.0, 16.0, 17.0]
+ * // [18.0, 19.0, 20.0, 21.0]
+ * // [22.0, 23.0, 24.0, 25.0]
+ *
+ * const a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
+ *
+ * // m remains the same
+ * // a = [10.0, 11.0, 99.0, 13.0]
+ * // [14.0, 15.0, 98.0, 17.0]
+ * // [18.0, 19.0, 97.0, 21.0]
+ * // [22.0, 23.0, 96.0, 25.0]
+ */
+ Matrix4.setColumn = function (matrix, index, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 3);
+
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result = Matrix4.clone(matrix, result);
+ const startIndex = index * 4;
+ result[startIndex] = cartesian.x;
+ result[startIndex + 1] = cartesian.y;
+ result[startIndex + 2] = cartesian.z;
+ result[startIndex + 3] = cartesian.w;
+ return result;
+ };
+
+ /**
+ * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.
+ *
+ * @param {Matrix4} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the row to retrieve.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0, 1, 2, or 3.
+ *
+ * @example
+ * //returns a Cartesian4 instance with values from the specified column
+ * // m = [10.0, 11.0, 12.0, 13.0]
+ * // [14.0, 15.0, 16.0, 17.0]
+ * // [18.0, 19.0, 20.0, 21.0]
+ * // [22.0, 23.0, 24.0, 25.0]
+ *
+ * //Example 1: Returns an instance of Cartesian
+ * const a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());
+ *
+ * @example
+ * //Example 2: Sets values for a Cartesian instance
+ * const a = new Cesium.Cartesian4();
+ * Cesium.Matrix4.getRow(m, 2, a);
+ *
+ * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;
+ */
+ Matrix4.getRow = function (matrix, index, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 3);
+
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const x = matrix[index];
+ const y = matrix[index + 4];
+ const z = matrix[index + 8];
+ const w = matrix[index + 12];
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+ };
+
+ /**
+ * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.
+ *
+ * @param {Matrix4} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the row to set.
+ * @param {Cartesian4} cartesian The Cartesian whose values will be assigned to the specified row.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0, 1, 2, or 3.
+ *
+ * @example
+ * //create a new Matrix4 instance with new row values from the Cartesian4 instance
+ * // m = [10.0, 11.0, 12.0, 13.0]
+ * // [14.0, 15.0, 16.0, 17.0]
+ * // [18.0, 19.0, 20.0, 21.0]
+ * // [22.0, 23.0, 24.0, 25.0]
+ *
+ * const a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());
+ *
+ * // m remains the same
+ * // a = [10.0, 11.0, 12.0, 13.0]
+ * // [14.0, 15.0, 16.0, 17.0]
+ * // [99.0, 98.0, 97.0, 96.0]
+ * // [22.0, 23.0, 24.0, 25.0]
+ */
+ Matrix4.setRow = function (matrix, index, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 3);
+
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result = Matrix4.clone(matrix, result);
+ result[index] = cartesian.x;
+ result[index + 4] = cartesian.y;
+ result[index + 8] = cartesian.z;
+ result[index + 12] = cartesian.w;
+ return result;
+ };
+
+ /**
+ * Computes a new matrix that replaces the translation in the rightmost column of the provided
+ * matrix with the provided translation. This assumes the matrix is an affine transformation.
+ *
+ * @param {Matrix4} matrix The matrix to use.
+ * @param {Cartesian3} translation The translation that replaces the translation of the provided matrix.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.setTranslation = function (matrix, translation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("translation", translation);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+
+ result[8] = matrix[8];
+ result[9] = matrix[9];
+ result[10] = matrix[10];
+ result[11] = matrix[11];
+
+ result[12] = translation.x;
+ result[13] = translation.y;
+ result[14] = translation.z;
+ result[15] = matrix[15];
+
+ return result;
+ };
+
+ const scaleScratch1$1 = new Matrix3.Cartesian3();
+
+ /**
+ * Computes a new matrix that replaces the scale with the provided scale.
+ * This assumes the matrix is an affine transformation.
+ *
+ * @param {Matrix4} matrix The matrix to use.
+ * @param {Cartesian3} scale The scale that replaces the scale of the provided matrix.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @see Matrix4.setUniformScale
+ * @see Matrix4.fromScale
+ * @see Matrix4.fromUniformScale
+ * @see Matrix4.multiplyByScale
+ * @see Matrix4.multiplyByUniformScale
+ * @see Matrix4.getScale
+ */
+ Matrix4.setScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const existingScale = Matrix4.getScale(matrix, scaleScratch1$1);
+ const scaleRatioX = scale.x / existingScale.x;
+ const scaleRatioY = scale.y / existingScale.y;
+ const scaleRatioZ = scale.z / existingScale.z;
+
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioX;
+ result[3] = matrix[3];
+
+ result[4] = matrix[4] * scaleRatioY;
+ result[5] = matrix[5] * scaleRatioY;
+ result[6] = matrix[6] * scaleRatioY;
+ result[7] = matrix[7];
+
+ result[8] = matrix[8] * scaleRatioZ;
+ result[9] = matrix[9] * scaleRatioZ;
+ result[10] = matrix[10] * scaleRatioZ;
+ result[11] = matrix[11];
+
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+
+ return result;
+ };
+
+ const scaleScratch2$1 = new Matrix3.Cartesian3();
+
+ /**
+ * Computes a new matrix that replaces the scale with the provided uniform scale.
+ * This assumes the matrix is an affine transformation.
+ *
+ * @param {Matrix4} matrix The matrix to use.
+ * @param {Number} scale The uniform scale that replaces the scale of the provided matrix.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @see Matrix4.setScale
+ * @see Matrix4.fromScale
+ * @see Matrix4.fromUniformScale
+ * @see Matrix4.multiplyByScale
+ * @see Matrix4.multiplyByUniformScale
+ * @see Matrix4.getScale
+ */
+ Matrix4.setUniformScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const existingScale = Matrix4.getScale(matrix, scaleScratch2$1);
+ const scaleRatioX = scale / existingScale.x;
+ const scaleRatioY = scale / existingScale.y;
+ const scaleRatioZ = scale / existingScale.z;
+
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioX;
+ result[3] = matrix[3];
+
+ result[4] = matrix[4] * scaleRatioY;
+ result[5] = matrix[5] * scaleRatioY;
+ result[6] = matrix[6] * scaleRatioY;
+ result[7] = matrix[7];
+
+ result[8] = matrix[8] * scaleRatioZ;
+ result[9] = matrix[9] * scaleRatioZ;
+ result[10] = matrix[10] * scaleRatioZ;
+ result[11] = matrix[11];
+
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+
+ return result;
+ };
+
+ const scratchColumn$1 = new Matrix3.Cartesian3();
+
+ /**
+ * Extracts the non-uniform scale assuming the matrix is an affine transformation.
+ *
+ * @param {Matrix4} matrix The matrix.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter
+ *
+ * @see Matrix4.multiplyByScale
+ * @see Matrix4.multiplyByUniformScale
+ * @see Matrix4.fromScale
+ * @see Matrix4.fromUniformScale
+ * @see Matrix4.setScale
+ * @see Matrix4.setUniformScale
+ */
+ Matrix4.getScale = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn$1)
+ );
+ result.y = Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn$1)
+ );
+ result.z = Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.fromElements(matrix[8], matrix[9], matrix[10], scratchColumn$1)
+ );
+ return result;
+ };
+
+ const scaleScratch3$1 = new Matrix3.Cartesian3();
+
+ /**
+ * Computes the maximum scale assuming the matrix is an affine transformation.
+ * The maximum scale is the maximum length of the column vectors in the upper-left
+ * 3x3 matrix.
+ *
+ * @param {Matrix4} matrix The matrix.
+ * @returns {Number} The maximum scale.
+ */
+ Matrix4.getMaximumScale = function (matrix) {
+ Matrix4.getScale(matrix, scaleScratch3$1);
+ return Matrix3.Cartesian3.maximumComponent(scaleScratch3$1);
+ };
+
+ const scaleScratch4$1 = new Matrix3.Cartesian3();
+
+ /**
+ * Sets the rotation assuming the matrix is an affine transformation.
+ *
+ * @param {Matrix4} matrix The matrix.
+ * @param {Matrix3} rotation The rotation matrix.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @see Matrix4.fromRotation
+ * @see Matrix4.getRotation
+ */
+ Matrix4.setRotation = function (matrix, rotation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const scale = Matrix4.getScale(matrix, scaleScratch4$1);
+
+ result[0] = rotation[0] * scale.x;
+ result[1] = rotation[1] * scale.x;
+ result[2] = rotation[2] * scale.x;
+ result[3] = matrix[3];
+
+ result[4] = rotation[3] * scale.y;
+ result[5] = rotation[4] * scale.y;
+ result[6] = rotation[5] * scale.y;
+ result[7] = matrix[7];
+
+ result[8] = rotation[6] * scale.z;
+ result[9] = rotation[7] * scale.z;
+ result[10] = rotation[8] * scale.z;
+ result[11] = matrix[11];
+
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+
+ return result;
+ };
+
+ const scaleScratch5$1 = new Matrix3.Cartesian3();
+
+ /**
+ * Extracts the rotation matrix assuming the matrix is an affine transformation.
+ *
+ * @param {Matrix4} matrix The matrix.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ * @see Matrix4.setRotation
+ * @see Matrix4.fromRotation
+ */
+ Matrix4.getRotation = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const scale = Matrix4.getScale(matrix, scaleScratch5$1);
+
+ result[0] = matrix[0] / scale.x;
+ result[1] = matrix[1] / scale.x;
+ result[2] = matrix[2] / scale.x;
+
+ result[3] = matrix[4] / scale.y;
+ result[4] = matrix[5] / scale.y;
+ result[5] = matrix[6] / scale.y;
+
+ result[6] = matrix[8] / scale.z;
+ result[7] = matrix[9] / scale.z;
+ result[8] = matrix[10] / scale.z;
+
+ return result;
+ };
+
+ /**
+ * Computes the product of two matrices.
+ *
+ * @param {Matrix4} left The first matrix.
+ * @param {Matrix4} right The second matrix.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.multiply = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const left0 = left[0];
+ const left1 = left[1];
+ const left2 = left[2];
+ const left3 = left[3];
+ const left4 = left[4];
+ const left5 = left[5];
+ const left6 = left[6];
+ const left7 = left[7];
+ const left8 = left[8];
+ const left9 = left[9];
+ const left10 = left[10];
+ const left11 = left[11];
+ const left12 = left[12];
+ const left13 = left[13];
+ const left14 = left[14];
+ const left15 = left[15];
+
+ const right0 = right[0];
+ const right1 = right[1];
+ const right2 = right[2];
+ const right3 = right[3];
+ const right4 = right[4];
+ const right5 = right[5];
+ const right6 = right[6];
+ const right7 = right[7];
+ const right8 = right[8];
+ const right9 = right[9];
+ const right10 = right[10];
+ const right11 = right[11];
+ const right12 = right[12];
+ const right13 = right[13];
+ const right14 = right[14];
+ const right15 = right[15];
+
+ const column0Row0 =
+ left0 * right0 + left4 * right1 + left8 * right2 + left12 * right3;
+ const column0Row1 =
+ left1 * right0 + left5 * right1 + left9 * right2 + left13 * right3;
+ const column0Row2 =
+ left2 * right0 + left6 * right1 + left10 * right2 + left14 * right3;
+ const column0Row3 =
+ left3 * right0 + left7 * right1 + left11 * right2 + left15 * right3;
+
+ const column1Row0 =
+ left0 * right4 + left4 * right5 + left8 * right6 + left12 * right7;
+ const column1Row1 =
+ left1 * right4 + left5 * right5 + left9 * right6 + left13 * right7;
+ const column1Row2 =
+ left2 * right4 + left6 * right5 + left10 * right6 + left14 * right7;
+ const column1Row3 =
+ left3 * right4 + left7 * right5 + left11 * right6 + left15 * right7;
+
+ const column2Row0 =
+ left0 * right8 + left4 * right9 + left8 * right10 + left12 * right11;
+ const column2Row1 =
+ left1 * right8 + left5 * right9 + left9 * right10 + left13 * right11;
+ const column2Row2 =
+ left2 * right8 + left6 * right9 + left10 * right10 + left14 * right11;
+ const column2Row3 =
+ left3 * right8 + left7 * right9 + left11 * right10 + left15 * right11;
+
+ const column3Row0 =
+ left0 * right12 + left4 * right13 + left8 * right14 + left12 * right15;
+ const column3Row1 =
+ left1 * right12 + left5 * right13 + left9 * right14 + left13 * right15;
+ const column3Row2 =
+ left2 * right12 + left6 * right13 + left10 * right14 + left14 * right15;
+ const column3Row3 =
+ left3 * right12 + left7 * right13 + left11 * right14 + left15 * right15;
+
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column0Row2;
+ result[3] = column0Row3;
+ result[4] = column1Row0;
+ result[5] = column1Row1;
+ result[6] = column1Row2;
+ result[7] = column1Row3;
+ result[8] = column2Row0;
+ result[9] = column2Row1;
+ result[10] = column2Row2;
+ result[11] = column2Row3;
+ result[12] = column3Row0;
+ result[13] = column3Row1;
+ result[14] = column3Row2;
+ result[15] = column3Row3;
+ return result;
+ };
+
+ /**
+ * Computes the sum of two matrices.
+ *
+ * @param {Matrix4} left The first matrix.
+ * @param {Matrix4} right The second matrix.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.add = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = left[0] + right[0];
+ result[1] = left[1] + right[1];
+ result[2] = left[2] + right[2];
+ result[3] = left[3] + right[3];
+ result[4] = left[4] + right[4];
+ result[5] = left[5] + right[5];
+ result[6] = left[6] + right[6];
+ result[7] = left[7] + right[7];
+ result[8] = left[8] + right[8];
+ result[9] = left[9] + right[9];
+ result[10] = left[10] + right[10];
+ result[11] = left[11] + right[11];
+ result[12] = left[12] + right[12];
+ result[13] = left[13] + right[13];
+ result[14] = left[14] + right[14];
+ result[15] = left[15] + right[15];
+ return result;
+ };
+
+ /**
+ * Computes the difference of two matrices.
+ *
+ * @param {Matrix4} left The first matrix.
+ * @param {Matrix4} right The second matrix.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.subtract = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = left[0] - right[0];
+ result[1] = left[1] - right[1];
+ result[2] = left[2] - right[2];
+ result[3] = left[3] - right[3];
+ result[4] = left[4] - right[4];
+ result[5] = left[5] - right[5];
+ result[6] = left[6] - right[6];
+ result[7] = left[7] - right[7];
+ result[8] = left[8] - right[8];
+ result[9] = left[9] - right[9];
+ result[10] = left[10] - right[10];
+ result[11] = left[11] - right[11];
+ result[12] = left[12] - right[12];
+ result[13] = left[13] - right[13];
+ result[14] = left[14] - right[14];
+ result[15] = left[15] - right[15];
+ return result;
+ };
+
+ /**
+ * Computes the product of two matrices assuming the matrices are affine transformation matrices,
+ * where the upper left 3x3 elements are any matrix, and
+ * the upper three elements in the fourth column are the translation.
+ * The bottom row is assumed to be [0, 0, 0, 1].
+ * The matrix is not verified to be in the proper form.
+ * This method is faster than computing the product for general 4x4
+ * matrices using {@link Matrix4.multiply}.
+ *
+ * @param {Matrix4} left The first matrix.
+ * @param {Matrix4} right The second matrix.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @example
+ * const m1 = new Cesium.Matrix4(1.0, 6.0, 7.0, 0.0, 2.0, 5.0, 8.0, 0.0, 3.0, 4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0);
+ * const m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));
+ * const m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());
+ */
+ Matrix4.multiplyTransformation = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const left0 = left[0];
+ const left1 = left[1];
+ const left2 = left[2];
+ const left4 = left[4];
+ const left5 = left[5];
+ const left6 = left[6];
+ const left8 = left[8];
+ const left9 = left[9];
+ const left10 = left[10];
+ const left12 = left[12];
+ const left13 = left[13];
+ const left14 = left[14];
+
+ const right0 = right[0];
+ const right1 = right[1];
+ const right2 = right[2];
+ const right4 = right[4];
+ const right5 = right[5];
+ const right6 = right[6];
+ const right8 = right[8];
+ const right9 = right[9];
+ const right10 = right[10];
+ const right12 = right[12];
+ const right13 = right[13];
+ const right14 = right[14];
+
+ const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;
+ const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;
+ const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;
+
+ const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;
+ const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;
+ const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;
+
+ const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;
+ const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;
+ const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;
+
+ const column3Row0 =
+ left0 * right12 + left4 * right13 + left8 * right14 + left12;
+ const column3Row1 =
+ left1 * right12 + left5 * right13 + left9 * right14 + left13;
+ const column3Row2 =
+ left2 * right12 + left6 * right13 + left10 * right14 + left14;
+
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column0Row2;
+ result[3] = 0.0;
+ result[4] = column1Row0;
+ result[5] = column1Row1;
+ result[6] = column1Row2;
+ result[7] = 0.0;
+ result[8] = column2Row0;
+ result[9] = column2Row1;
+ result[10] = column2Row2;
+ result[11] = 0.0;
+ result[12] = column3Row0;
+ result[13] = column3Row1;
+ result[14] = column3Row2;
+ result[15] = 1.0;
+ return result;
+ };
+
+ /**
+ * Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)
+ * by a 3x3 rotation matrix. This is an optimization
+ * for Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);
with less allocations and arithmetic operations.
+ *
+ * @param {Matrix4} matrix The matrix on the left-hand side.
+ * @param {Matrix3} rotation The 3x3 rotation matrix on the right-hand side.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @example
+ * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);
+ * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);
+ */
+ Matrix4.multiplyByMatrix3 = function (matrix, rotation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("rotation", rotation);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const left0 = matrix[0];
+ const left1 = matrix[1];
+ const left2 = matrix[2];
+ const left4 = matrix[4];
+ const left5 = matrix[5];
+ const left6 = matrix[6];
+ const left8 = matrix[8];
+ const left9 = matrix[9];
+ const left10 = matrix[10];
+
+ const right0 = rotation[0];
+ const right1 = rotation[1];
+ const right2 = rotation[2];
+ const right4 = rotation[3];
+ const right5 = rotation[4];
+ const right6 = rotation[5];
+ const right8 = rotation[6];
+ const right9 = rotation[7];
+ const right10 = rotation[8];
+
+ const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;
+ const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;
+ const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;
+
+ const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;
+ const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;
+ const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;
+
+ const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;
+ const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;
+ const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;
+
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column0Row2;
+ result[3] = 0.0;
+ result[4] = column1Row0;
+ result[5] = column1Row1;
+ result[6] = column1Row2;
+ result[7] = 0.0;
+ result[8] = column2Row0;
+ result[9] = column2Row1;
+ result[10] = column2Row2;
+ result[11] = 0.0;
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+ };
+
+ /**
+ * Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)
+ * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization
+ * for Matrix4.multiply(m, Matrix4.fromTranslation(position), m);
with less allocations and arithmetic operations.
+ *
+ * @param {Matrix4} matrix The matrix on the left-hand side.
+ * @param {Cartesian3} translation The translation on the right-hand side.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @example
+ * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);
+ * Cesium.Matrix4.multiplyByTranslation(m, position, m);
+ */
+ Matrix4.multiplyByTranslation = function (matrix, translation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("translation", translation);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const x = translation.x;
+ const y = translation.y;
+ const z = translation.z;
+
+ const tx = x * matrix[0] + y * matrix[4] + z * matrix[8] + matrix[12];
+ const ty = x * matrix[1] + y * matrix[5] + z * matrix[9] + matrix[13];
+ const tz = x * matrix[2] + y * matrix[6] + z * matrix[10] + matrix[14];
+
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ result[9] = matrix[9];
+ result[10] = matrix[10];
+ result[11] = matrix[11];
+ result[12] = tx;
+ result[13] = ty;
+ result[14] = tz;
+ result[15] = matrix[15];
+ return result;
+ };
+
+ /**
+ * Multiplies an affine transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)
+ * by an implicit non-uniform scale matrix. This is an optimization
+ * for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);
, where
+ * m
must be an affine matrix.
+ * This function performs fewer allocations and arithmetic operations.
+ *
+ * @param {Matrix4} matrix The affine matrix on the left-hand side.
+ * @param {Cartesian3} scale The non-uniform scale on the right-hand side.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ *
+ * @example
+ * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);
+ * Cesium.Matrix4.multiplyByScale(m, scale, m);
+ *
+ * @see Matrix4.multiplyByUniformScale
+ * @see Matrix4.fromScale
+ * @see Matrix4.fromUniformScale
+ * @see Matrix4.setScale
+ * @see Matrix4.setUniformScale
+ * @see Matrix4.getScale
+ */
+ Matrix4.multiplyByScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const scaleX = scale.x;
+ const scaleY = scale.y;
+ const scaleZ = scale.z;
+
+ // Faster than Cartesian3.equals
+ if (scaleX === 1.0 && scaleY === 1.0 && scaleZ === 1.0) {
+ return Matrix4.clone(matrix, result);
+ }
+
+ result[0] = scaleX * matrix[0];
+ result[1] = scaleX * matrix[1];
+ result[2] = scaleX * matrix[2];
+ result[3] = matrix[3];
+
+ result[4] = scaleY * matrix[4];
+ result[5] = scaleY * matrix[5];
+ result[6] = scaleY * matrix[6];
+ result[7] = matrix[7];
+
+ result[8] = scaleZ * matrix[8];
+ result[9] = scaleZ * matrix[9];
+ result[10] = scaleZ * matrix[10];
+ result[11] = matrix[11];
+
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
+ *
+ * @param {Matrix4} matrix The matrix on the left-hand side.
+ * @param {Number} scale The uniform scale on the right-hand side.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @example
+ * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);
+ * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);
+ *
+ * @see Matrix4.multiplyByScale
+ * @see Matrix4.fromScale
+ * @see Matrix4.fromUniformScale
+ * @see Matrix4.setScale
+ * @see Matrix4.setUniformScale
+ * @see Matrix4.getScale
+ */
+ Matrix4.multiplyByUniformScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = matrix[0] * scale;
+ result[1] = matrix[1] * scale;
+ result[2] = matrix[2] * scale;
+ result[3] = matrix[3];
+
+ result[4] = matrix[4] * scale;
+ result[5] = matrix[5] * scale;
+ result[6] = matrix[6] * scale;
+ result[7] = matrix[7];
+
+ result[8] = matrix[8] * scale;
+ result[9] = matrix[9] * scale;
+ result[10] = matrix[10] * scale;
+ result[11] = matrix[11];
+
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix and a column vector.
+ *
+ * @param {Matrix4} matrix The matrix.
+ * @param {Cartesian4} cartesian The vector.
+ * @param {Cartesian4} result The object onto which to store the result.
+ * @returns {Cartesian4} The modified result parameter.
+ */
+ Matrix4.multiplyByVector = function (matrix, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const vX = cartesian.x;
+ const vY = cartesian.y;
+ const vZ = cartesian.z;
+ const vW = cartesian.w;
+
+ const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12] * vW;
+ const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13] * vW;
+ const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14] * vW;
+ const w = matrix[3] * vX + matrix[7] * vY + matrix[11] * vZ + matrix[15] * vW;
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
+ * with a {@link Cartesian4} with a w
component of zero.
+ *
+ * @param {Matrix4} matrix The matrix.
+ * @param {Cartesian3} cartesian The point.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ *
+ * @example
+ * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
+ * const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());
+ * // A shortcut for
+ * // Cartesian3 p = ...
+ * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);
+ */
+ Matrix4.multiplyByPointAsVector = function (matrix, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const vX = cartesian.x;
+ const vY = cartesian.y;
+ const vZ = cartesian.z;
+
+ const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ;
+ const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ;
+ const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ;
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}
+ * with a {@link Cartesian4} with a w
component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.
+ *
+ * @param {Matrix4} matrix The matrix.
+ * @param {Cartesian3} cartesian The point.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ *
+ * @example
+ * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);
+ * const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());
+ */
+ Matrix4.multiplyByPoint = function (matrix, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const vX = cartesian.x;
+ const vY = cartesian.y;
+ const vZ = cartesian.z;
+
+ const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12];
+ const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13];
+ const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14];
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix and a scalar.
+ *
+ * @param {Matrix4} matrix The matrix.
+ * @param {Number} scalar The number to multiply by.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @example
+ * //create a Matrix4 instance which is a scaled version of the supplied Matrix4
+ * // m = [10.0, 11.0, 12.0, 13.0]
+ * // [14.0, 15.0, 16.0, 17.0]
+ * // [18.0, 19.0, 20.0, 21.0]
+ * // [22.0, 23.0, 24.0, 25.0]
+ *
+ * const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());
+ *
+ * // m remains the same
+ * // a = [-20.0, -22.0, -24.0, -26.0]
+ * // [-28.0, -30.0, -32.0, -34.0]
+ * // [-36.0, -38.0, -40.0, -42.0]
+ * // [-44.0, -46.0, -48.0, -50.0]
+ */
+ Matrix4.multiplyByScalar = function (matrix, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = matrix[0] * scalar;
+ result[1] = matrix[1] * scalar;
+ result[2] = matrix[2] * scalar;
+ result[3] = matrix[3] * scalar;
+ result[4] = matrix[4] * scalar;
+ result[5] = matrix[5] * scalar;
+ result[6] = matrix[6] * scalar;
+ result[7] = matrix[7] * scalar;
+ result[8] = matrix[8] * scalar;
+ result[9] = matrix[9] * scalar;
+ result[10] = matrix[10] * scalar;
+ result[11] = matrix[11] * scalar;
+ result[12] = matrix[12] * scalar;
+ result[13] = matrix[13] * scalar;
+ result[14] = matrix[14] * scalar;
+ result[15] = matrix[15] * scalar;
+ return result;
+ };
+
+ /**
+ * Computes a negated copy of the provided matrix.
+ *
+ * @param {Matrix4} matrix The matrix to negate.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @example
+ * //create a new Matrix4 instance which is a negation of a Matrix4
+ * // m = [10.0, 11.0, 12.0, 13.0]
+ * // [14.0, 15.0, 16.0, 17.0]
+ * // [18.0, 19.0, 20.0, 21.0]
+ * // [22.0, 23.0, 24.0, 25.0]
+ *
+ * const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());
+ *
+ * // m remains the same
+ * // a = [-10.0, -11.0, -12.0, -13.0]
+ * // [-14.0, -15.0, -16.0, -17.0]
+ * // [-18.0, -19.0, -20.0, -21.0]
+ * // [-22.0, -23.0, -24.0, -25.0]
+ */
+ Matrix4.negate = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = -matrix[0];
+ result[1] = -matrix[1];
+ result[2] = -matrix[2];
+ result[3] = -matrix[3];
+ result[4] = -matrix[4];
+ result[5] = -matrix[5];
+ result[6] = -matrix[6];
+ result[7] = -matrix[7];
+ result[8] = -matrix[8];
+ result[9] = -matrix[9];
+ result[10] = -matrix[10];
+ result[11] = -matrix[11];
+ result[12] = -matrix[12];
+ result[13] = -matrix[13];
+ result[14] = -matrix[14];
+ result[15] = -matrix[15];
+ return result;
+ };
+
+ /**
+ * Computes the transpose of the provided matrix.
+ *
+ * @param {Matrix4} matrix The matrix to transpose.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @example
+ * //returns transpose of a Matrix4
+ * // m = [10.0, 11.0, 12.0, 13.0]
+ * // [14.0, 15.0, 16.0, 17.0]
+ * // [18.0, 19.0, 20.0, 21.0]
+ * // [22.0, 23.0, 24.0, 25.0]
+ *
+ * const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());
+ *
+ * // m remains the same
+ * // a = [10.0, 14.0, 18.0, 22.0]
+ * // [11.0, 15.0, 19.0, 23.0]
+ * // [12.0, 16.0, 20.0, 24.0]
+ * // [13.0, 17.0, 21.0, 25.0]
+ */
+ Matrix4.transpose = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const matrix1 = matrix[1];
+ const matrix2 = matrix[2];
+ const matrix3 = matrix[3];
+ const matrix6 = matrix[6];
+ const matrix7 = matrix[7];
+ const matrix11 = matrix[11];
+
+ result[0] = matrix[0];
+ result[1] = matrix[4];
+ result[2] = matrix[8];
+ result[3] = matrix[12];
+ result[4] = matrix1;
+ result[5] = matrix[5];
+ result[6] = matrix[9];
+ result[7] = matrix[13];
+ result[8] = matrix2;
+ result[9] = matrix6;
+ result[10] = matrix[10];
+ result[11] = matrix[14];
+ result[12] = matrix3;
+ result[13] = matrix7;
+ result[14] = matrix11;
+ result[15] = matrix[15];
+ return result;
+ };
+
+ /**
+ * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
+ *
+ * @param {Matrix4} matrix The matrix with signed elements.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.abs = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = Math.abs(matrix[0]);
+ result[1] = Math.abs(matrix[1]);
+ result[2] = Math.abs(matrix[2]);
+ result[3] = Math.abs(matrix[3]);
+ result[4] = Math.abs(matrix[4]);
+ result[5] = Math.abs(matrix[5]);
+ result[6] = Math.abs(matrix[6]);
+ result[7] = Math.abs(matrix[7]);
+ result[8] = Math.abs(matrix[8]);
+ result[9] = Math.abs(matrix[9]);
+ result[10] = Math.abs(matrix[10]);
+ result[11] = Math.abs(matrix[11]);
+ result[12] = Math.abs(matrix[12]);
+ result[13] = Math.abs(matrix[13]);
+ result[14] = Math.abs(matrix[14]);
+ result[15] = Math.abs(matrix[15]);
+
+ return result;
+ };
+
+ /**
+ * Compares the provided matrices componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Matrix4} [left] The first matrix.
+ * @param {Matrix4} [right] The second matrix.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ *
+ * @example
+ * //compares two Matrix4 instances
+ *
+ * // a = [10.0, 14.0, 18.0, 22.0]
+ * // [11.0, 15.0, 19.0, 23.0]
+ * // [12.0, 16.0, 20.0, 24.0]
+ * // [13.0, 17.0, 21.0, 25.0]
+ *
+ * // b = [10.0, 14.0, 18.0, 22.0]
+ * // [11.0, 15.0, 19.0, 23.0]
+ * // [12.0, 16.0, 20.0, 24.0]
+ * // [13.0, 17.0, 21.0, 25.0]
+ *
+ * if(Cesium.Matrix4.equals(a,b)) {
+ * console.log("Both matrices are equal");
+ * } else {
+ * console.log("They are not equal");
+ * }
+ *
+ * //Prints "Both matrices are equal" on the console
+ */
+ Matrix4.equals = function (left, right) {
+ // Given that most matrices will be transformation matrices, the elements
+ // are tested in order such that the test is likely to fail as early
+ // as possible. I _think_ this is just as friendly to the L1 cache
+ // as testing in index order. It is certainty faster in practice.
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ // Translation
+ left[12] === right[12] &&
+ left[13] === right[13] &&
+ left[14] === right[14] &&
+ // Rotation/scale
+ left[0] === right[0] &&
+ left[1] === right[1] &&
+ left[2] === right[2] &&
+ left[4] === right[4] &&
+ left[5] === right[5] &&
+ left[6] === right[6] &&
+ left[8] === right[8] &&
+ left[9] === right[9] &&
+ left[10] === right[10] &&
+ // Bottom row
+ left[3] === right[3] &&
+ left[7] === right[7] &&
+ left[11] === right[11] &&
+ left[15] === right[15])
+ );
+ };
+
+ /**
+ * Compares the provided matrices componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Matrix4} [left] The first matrix.
+ * @param {Matrix4} [right] The second matrix.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ *
+ * @example
+ * //compares two Matrix4 instances
+ *
+ * // a = [10.5, 14.5, 18.5, 22.5]
+ * // [11.5, 15.5, 19.5, 23.5]
+ * // [12.5, 16.5, 20.5, 24.5]
+ * // [13.5, 17.5, 21.5, 25.5]
+ *
+ * // b = [10.0, 14.0, 18.0, 22.0]
+ * // [11.0, 15.0, 19.0, 23.0]
+ * // [12.0, 16.0, 20.0, 24.0]
+ * // [13.0, 17.0, 21.0, 25.0]
+ *
+ * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){
+ * console.log("Difference between both the matrices is less than 0.1");
+ * } else {
+ * console.log("Difference between both the matrices is not less than 0.1");
+ * }
+ *
+ * //Prints "Difference between both the matrices is not less than 0.1" on the console
+ */
+ Matrix4.equalsEpsilon = function (left, right, epsilon) {
+ epsilon = defaultValue.defaultValue(epsilon, 0);
+
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math.abs(left[0] - right[0]) <= epsilon &&
+ Math.abs(left[1] - right[1]) <= epsilon &&
+ Math.abs(left[2] - right[2]) <= epsilon &&
+ Math.abs(left[3] - right[3]) <= epsilon &&
+ Math.abs(left[4] - right[4]) <= epsilon &&
+ Math.abs(left[5] - right[5]) <= epsilon &&
+ Math.abs(left[6] - right[6]) <= epsilon &&
+ Math.abs(left[7] - right[7]) <= epsilon &&
+ Math.abs(left[8] - right[8]) <= epsilon &&
+ Math.abs(left[9] - right[9]) <= epsilon &&
+ Math.abs(left[10] - right[10]) <= epsilon &&
+ Math.abs(left[11] - right[11]) <= epsilon &&
+ Math.abs(left[12] - right[12]) <= epsilon &&
+ Math.abs(left[13] - right[13]) <= epsilon &&
+ Math.abs(left[14] - right[14]) <= epsilon &&
+ Math.abs(left[15] - right[15]) <= epsilon)
+ );
+ };
+
+ /**
+ * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.
+ *
+ * @param {Matrix4} matrix The matrix to use.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Matrix4.getTranslation = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = matrix[12];
+ result.y = matrix[13];
+ result.z = matrix[14];
+ return result;
+ };
+
+ /**
+ * Gets the upper left 3x3 matrix of the provided matrix.
+ *
+ * @param {Matrix4} matrix The matrix to use.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ * @example
+ * // returns a Matrix3 instance from a Matrix4 instance
+ *
+ * // m = [10.0, 14.0, 18.0, 22.0]
+ * // [11.0, 15.0, 19.0, 23.0]
+ * // [12.0, 16.0, 20.0, 24.0]
+ * // [13.0, 17.0, 21.0, 25.0]
+ *
+ * const b = new Cesium.Matrix3();
+ * Cesium.Matrix4.getMatrix3(m,b);
+ *
+ * // b = [10.0, 14.0, 18.0]
+ * // [11.0, 15.0, 19.0]
+ * // [12.0, 16.0, 20.0]
+ */
+ Matrix4.getMatrix3 = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[4];
+ result[4] = matrix[5];
+ result[5] = matrix[6];
+ result[6] = matrix[8];
+ result[7] = matrix[9];
+ result[8] = matrix[10];
+ return result;
+ };
+
+ const scratchInverseRotation = new Matrix3.Matrix3();
+ const scratchMatrix3Zero = new Matrix3.Matrix3();
+ const scratchBottomRow = new Cartesian4();
+ const scratchExpectedBottomRow = new Cartesian4(0.0, 0.0, 0.0, 1.0);
+
+ /**
+ * Computes the inverse of the provided matrix using Cramers Rule.
+ * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.
+ * If the matrix is a proper rigid transformation, it is more efficient
+ * to invert it with {@link Matrix4.inverseTransformation}.
+ *
+ * @param {Matrix4} matrix The matrix to invert.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ *
+ * @exception {RuntimeError} matrix is not invertible because its determinate is zero.
+ */
+ Matrix4.inverse = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+ //
+ // Ported from:
+ // ftp://download.intel.com/design/PentiumIII/sml/24504301.pdf
+ //
+ const src0 = matrix[0];
+ const src1 = matrix[4];
+ const src2 = matrix[8];
+ const src3 = matrix[12];
+ const src4 = matrix[1];
+ const src5 = matrix[5];
+ const src6 = matrix[9];
+ const src7 = matrix[13];
+ const src8 = matrix[2];
+ const src9 = matrix[6];
+ const src10 = matrix[10];
+ const src11 = matrix[14];
+ const src12 = matrix[3];
+ const src13 = matrix[7];
+ const src14 = matrix[11];
+ const src15 = matrix[15];
+
+ // calculate pairs for first 8 elements (cofactors)
+ let tmp0 = src10 * src15;
+ let tmp1 = src11 * src14;
+ let tmp2 = src9 * src15;
+ let tmp3 = src11 * src13;
+ let tmp4 = src9 * src14;
+ let tmp5 = src10 * src13;
+ let tmp6 = src8 * src15;
+ let tmp7 = src11 * src12;
+ let tmp8 = src8 * src14;
+ let tmp9 = src10 * src12;
+ let tmp10 = src8 * src13;
+ let tmp11 = src9 * src12;
+
+ // calculate first 8 elements (cofactors)
+ const dst0 =
+ tmp0 * src5 +
+ tmp3 * src6 +
+ tmp4 * src7 -
+ (tmp1 * src5 + tmp2 * src6 + tmp5 * src7);
+ const dst1 =
+ tmp1 * src4 +
+ tmp6 * src6 +
+ tmp9 * src7 -
+ (tmp0 * src4 + tmp7 * src6 + tmp8 * src7);
+ const dst2 =
+ tmp2 * src4 +
+ tmp7 * src5 +
+ tmp10 * src7 -
+ (tmp3 * src4 + tmp6 * src5 + tmp11 * src7);
+ const dst3 =
+ tmp5 * src4 +
+ tmp8 * src5 +
+ tmp11 * src6 -
+ (tmp4 * src4 + tmp9 * src5 + tmp10 * src6);
+ const dst4 =
+ tmp1 * src1 +
+ tmp2 * src2 +
+ tmp5 * src3 -
+ (tmp0 * src1 + tmp3 * src2 + tmp4 * src3);
+ const dst5 =
+ tmp0 * src0 +
+ tmp7 * src2 +
+ tmp8 * src3 -
+ (tmp1 * src0 + tmp6 * src2 + tmp9 * src3);
+ const dst6 =
+ tmp3 * src0 +
+ tmp6 * src1 +
+ tmp11 * src3 -
+ (tmp2 * src0 + tmp7 * src1 + tmp10 * src3);
+ const dst7 =
+ tmp4 * src0 +
+ tmp9 * src1 +
+ tmp10 * src2 -
+ (tmp5 * src0 + tmp8 * src1 + tmp11 * src2);
+
+ // calculate pairs for second 8 elements (cofactors)
+ tmp0 = src2 * src7;
+ tmp1 = src3 * src6;
+ tmp2 = src1 * src7;
+ tmp3 = src3 * src5;
+ tmp4 = src1 * src6;
+ tmp5 = src2 * src5;
+ tmp6 = src0 * src7;
+ tmp7 = src3 * src4;
+ tmp8 = src0 * src6;
+ tmp9 = src2 * src4;
+ tmp10 = src0 * src5;
+ tmp11 = src1 * src4;
+
+ // calculate second 8 elements (cofactors)
+ const dst8 =
+ tmp0 * src13 +
+ tmp3 * src14 +
+ tmp4 * src15 -
+ (tmp1 * src13 + tmp2 * src14 + tmp5 * src15);
+ const dst9 =
+ tmp1 * src12 +
+ tmp6 * src14 +
+ tmp9 * src15 -
+ (tmp0 * src12 + tmp7 * src14 + tmp8 * src15);
+ const dst10 =
+ tmp2 * src12 +
+ tmp7 * src13 +
+ tmp10 * src15 -
+ (tmp3 * src12 + tmp6 * src13 + tmp11 * src15);
+ const dst11 =
+ tmp5 * src12 +
+ tmp8 * src13 +
+ tmp11 * src14 -
+ (tmp4 * src12 + tmp9 * src13 + tmp10 * src14);
+ const dst12 =
+ tmp2 * src10 +
+ tmp5 * src11 +
+ tmp1 * src9 -
+ (tmp4 * src11 + tmp0 * src9 + tmp3 * src10);
+ const dst13 =
+ tmp8 * src11 +
+ tmp0 * src8 +
+ tmp7 * src10 -
+ (tmp6 * src10 + tmp9 * src11 + tmp1 * src8);
+ const dst14 =
+ tmp6 * src9 +
+ tmp11 * src11 +
+ tmp3 * src8 -
+ (tmp10 * src11 + tmp2 * src8 + tmp7 * src9);
+ const dst15 =
+ tmp10 * src10 +
+ tmp4 * src8 +
+ tmp9 * src9 -
+ (tmp8 * src9 + tmp11 * src10 + tmp5 * src8);
+
+ // calculate determinant
+ let det = src0 * dst0 + src1 * dst1 + src2 * dst2 + src3 * dst3;
+
+ if (Math.abs(det) < Math$1.CesiumMath.EPSILON21) {
+ // Special case for a zero scale matrix that can occur, for example,
+ // when a model's node has a [0, 0, 0] scale.
+ if (
+ Matrix3.Matrix3.equalsEpsilon(
+ Matrix4.getMatrix3(matrix, scratchInverseRotation),
+ scratchMatrix3Zero,
+ Math$1.CesiumMath.EPSILON7
+ ) &&
+ Cartesian4.equals(
+ Matrix4.getRow(matrix, 3, scratchBottomRow),
+ scratchExpectedBottomRow
+ )
+ ) {
+ result[0] = 0.0;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = 0.0;
+ result[5] = 0.0;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = 0.0;
+ result[9] = 0.0;
+ result[10] = 0.0;
+ result[11] = 0.0;
+ result[12] = -matrix[12];
+ result[13] = -matrix[13];
+ result[14] = -matrix[14];
+ result[15] = 1.0;
+ return result;
+ }
+
+ throw new RuntimeError.RuntimeError(
+ "matrix is not invertible because its determinate is zero."
+ );
+ }
+
+ // calculate matrix inverse
+ det = 1.0 / det;
+
+ result[0] = dst0 * det;
+ result[1] = dst1 * det;
+ result[2] = dst2 * det;
+ result[3] = dst3 * det;
+ result[4] = dst4 * det;
+ result[5] = dst5 * det;
+ result[6] = dst6 * det;
+ result[7] = dst7 * det;
+ result[8] = dst8 * det;
+ result[9] = dst9 * det;
+ result[10] = dst10 * det;
+ result[11] = dst11 * det;
+ result[12] = dst12 * det;
+ result[13] = dst13 * det;
+ result[14] = dst14 * det;
+ result[15] = dst15 * det;
+ return result;
+ };
+
+ /**
+ * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,
+ * where the upper left 3x3 elements are a rotation matrix,
+ * and the upper three elements in the fourth column are the translation.
+ * The bottom row is assumed to be [0, 0, 0, 1].
+ * The matrix is not verified to be in the proper form.
+ * This method is faster than computing the inverse for a general 4x4
+ * matrix using {@link Matrix4.inverse}.
+ *
+ * @param {Matrix4} matrix The matrix to invert.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.inverseTransformation = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ //This function is an optimized version of the below 4 lines.
+ //const rT = Matrix3.transpose(Matrix4.getMatrix3(matrix));
+ //const rTN = Matrix3.negate(rT);
+ //const rTT = Matrix3.multiplyByVector(rTN, Matrix4.getTranslation(matrix));
+ //return Matrix4.fromRotationTranslation(rT, rTT, result);
+
+ const matrix0 = matrix[0];
+ const matrix1 = matrix[1];
+ const matrix2 = matrix[2];
+ const matrix4 = matrix[4];
+ const matrix5 = matrix[5];
+ const matrix6 = matrix[6];
+ const matrix8 = matrix[8];
+ const matrix9 = matrix[9];
+ const matrix10 = matrix[10];
+
+ const vX = matrix[12];
+ const vY = matrix[13];
+ const vZ = matrix[14];
+
+ const x = -matrix0 * vX - matrix1 * vY - matrix2 * vZ;
+ const y = -matrix4 * vX - matrix5 * vY - matrix6 * vZ;
+ const z = -matrix8 * vX - matrix9 * vY - matrix10 * vZ;
+
+ result[0] = matrix0;
+ result[1] = matrix4;
+ result[2] = matrix8;
+ result[3] = 0.0;
+ result[4] = matrix1;
+ result[5] = matrix5;
+ result[6] = matrix9;
+ result[7] = 0.0;
+ result[8] = matrix2;
+ result[9] = matrix6;
+ result[10] = matrix10;
+ result[11] = 0.0;
+ result[12] = x;
+ result[13] = y;
+ result[14] = z;
+ result[15] = 1.0;
+ return result;
+ };
+
+ const scratchTransposeMatrix = new Matrix4();
+
+ /**
+ * Computes the inverse transpose of a matrix.
+ *
+ * @param {Matrix4} matrix The matrix to transpose and invert.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter.
+ */
+ Matrix4.inverseTranspose = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ return Matrix4.inverse(
+ Matrix4.transpose(matrix, scratchTransposeMatrix),
+ result
+ );
+ };
+
+ /**
+ * An immutable Matrix4 instance initialized to the identity matrix.
+ *
+ * @type {Matrix4}
+ * @constant
+ */
+ Matrix4.IDENTITY = Object.freeze(
+ new Matrix4(
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ )
+ );
+
+ /**
+ * An immutable Matrix4 instance initialized to the zero matrix.
+ *
+ * @type {Matrix4}
+ * @constant
+ */
+ Matrix4.ZERO = Object.freeze(
+ new Matrix4(
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0
+ )
+ );
+
+ /**
+ * The index into Matrix4 for column 0, row 0.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN0ROW0 = 0;
+
+ /**
+ * The index into Matrix4 for column 0, row 1.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN0ROW1 = 1;
+
+ /**
+ * The index into Matrix4 for column 0, row 2.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN0ROW2 = 2;
+
+ /**
+ * The index into Matrix4 for column 0, row 3.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN0ROW3 = 3;
+
+ /**
+ * The index into Matrix4 for column 1, row 0.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN1ROW0 = 4;
+
+ /**
+ * The index into Matrix4 for column 1, row 1.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN1ROW1 = 5;
+
+ /**
+ * The index into Matrix4 for column 1, row 2.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN1ROW2 = 6;
+
+ /**
+ * The index into Matrix4 for column 1, row 3.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN1ROW3 = 7;
+
+ /**
+ * The index into Matrix4 for column 2, row 0.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN2ROW0 = 8;
+
+ /**
+ * The index into Matrix4 for column 2, row 1.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN2ROW1 = 9;
+
+ /**
+ * The index into Matrix4 for column 2, row 2.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN2ROW2 = 10;
+
+ /**
+ * The index into Matrix4 for column 2, row 3.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN2ROW3 = 11;
+
+ /**
+ * The index into Matrix4 for column 3, row 0.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN3ROW0 = 12;
+
+ /**
+ * The index into Matrix4 for column 3, row 1.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN3ROW1 = 13;
+
+ /**
+ * The index into Matrix4 for column 3, row 2.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN3ROW2 = 14;
+
+ /**
+ * The index into Matrix4 for column 3, row 3.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix4.COLUMN3ROW3 = 15;
+
+ Object.defineProperties(Matrix4.prototype, {
+ /**
+ * Gets the number of items in the collection.
+ * @memberof Matrix4.prototype
+ *
+ * @type {Number}
+ */
+ length: {
+ get: function () {
+ return Matrix4.packedLength;
+ },
+ },
+ });
+
+ /**
+ * Duplicates the provided Matrix4 instance.
+ *
+ * @param {Matrix4} [result] The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.
+ */
+ Matrix4.prototype.clone = function (result) {
+ return Matrix4.clone(this, result);
+ };
+
+ /**
+ * Compares this matrix to the provided matrix componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Matrix4} [right] The right hand side matrix.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ Matrix4.prototype.equals = function (right) {
+ return Matrix4.equals(this, right);
+ };
+
+ /**
+ * @private
+ */
+ Matrix4.equalsArray = function (matrix, array, offset) {
+ return (
+ matrix[0] === array[offset] &&
+ matrix[1] === array[offset + 1] &&
+ matrix[2] === array[offset + 2] &&
+ matrix[3] === array[offset + 3] &&
+ matrix[4] === array[offset + 4] &&
+ matrix[5] === array[offset + 5] &&
+ matrix[6] === array[offset + 6] &&
+ matrix[7] === array[offset + 7] &&
+ matrix[8] === array[offset + 8] &&
+ matrix[9] === array[offset + 9] &&
+ matrix[10] === array[offset + 10] &&
+ matrix[11] === array[offset + 11] &&
+ matrix[12] === array[offset + 12] &&
+ matrix[13] === array[offset + 13] &&
+ matrix[14] === array[offset + 14] &&
+ matrix[15] === array[offset + 15]
+ );
+ };
+
+ /**
+ * Compares this matrix to the provided matrix componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Matrix4} [right] The right hand side matrix.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.
+ */
+ Matrix4.prototype.equalsEpsilon = function (right, epsilon) {
+ return Matrix4.equalsEpsilon(this, right, epsilon);
+ };
+
+ /**
+ * Computes a string representing this Matrix with each row being
+ * on a separate line and in the format '(column0, column1, column2, column3)'.
+ *
+ * @returns {String} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.
+ */
+ Matrix4.prototype.toString = function () {
+ return (
+ `(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\n` +
+ `(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\n` +
+ `(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\n` +
+ `(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`
+ );
+ };
+
+ /**
+ * A two dimensional region specified as longitude and latitude coordinates.
+ *
+ * @alias Rectangle
+ * @constructor
+ *
+ * @param {Number} [west=0.0] The westernmost longitude, in radians, in the range [-Pi, Pi].
+ * @param {Number} [south=0.0] The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].
+ * @param {Number} [east=0.0] The easternmost longitude, in radians, in the range [-Pi, Pi].
+ * @param {Number} [north=0.0] The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].
+ *
+ * @see Packable
+ */
+ function Rectangle(west, south, east, north) {
+ /**
+ * The westernmost longitude in radians in the range [-Pi, Pi].
+ *
+ * @type {Number}
+ * @default 0.0
+ */
+ this.west = defaultValue.defaultValue(west, 0.0);
+
+ /**
+ * The southernmost latitude in radians in the range [-Pi/2, Pi/2].
+ *
+ * @type {Number}
+ * @default 0.0
+ */
+ this.south = defaultValue.defaultValue(south, 0.0);
+
+ /**
+ * The easternmost longitude in radians in the range [-Pi, Pi].
+ *
+ * @type {Number}
+ * @default 0.0
+ */
+ this.east = defaultValue.defaultValue(east, 0.0);
+
+ /**
+ * The northernmost latitude in radians in the range [-Pi/2, Pi/2].
+ *
+ * @type {Number}
+ * @default 0.0
+ */
+ this.north = defaultValue.defaultValue(north, 0.0);
+ }
+
+ Object.defineProperties(Rectangle.prototype, {
+ /**
+ * Gets the width of the rectangle in radians.
+ * @memberof Rectangle.prototype
+ * @type {Number}
+ * @readonly
+ */
+ width: {
+ get: function () {
+ return Rectangle.computeWidth(this);
+ },
+ },
+
+ /**
+ * Gets the height of the rectangle in radians.
+ * @memberof Rectangle.prototype
+ * @type {Number}
+ * @readonly
+ */
+ height: {
+ get: function () {
+ return Rectangle.computeHeight(this);
+ },
+ },
+ });
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ Rectangle.packedLength = 4;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {Rectangle} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ Rectangle.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value.west;
+ array[startingIndex++] = value.south;
+ array[startingIndex++] = value.east;
+ array[startingIndex] = value.north;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {Rectangle} [result] The object into which to store the result.
+ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided.
+ */
+ Rectangle.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new Rectangle();
+ }
+
+ result.west = array[startingIndex++];
+ result.south = array[startingIndex++];
+ result.east = array[startingIndex++];
+ result.north = array[startingIndex];
+ return result;
+ };
+
+ /**
+ * Computes the width of a rectangle in radians.
+ * @param {Rectangle} rectangle The rectangle to compute the width of.
+ * @returns {Number} The width.
+ */
+ Rectangle.computeWidth = function (rectangle) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ //>>includeEnd('debug');
+ let east = rectangle.east;
+ const west = rectangle.west;
+ if (east < west) {
+ east += Math$1.CesiumMath.TWO_PI;
+ }
+ return east - west;
+ };
+
+ /**
+ * Computes the height of a rectangle in radians.
+ * @param {Rectangle} rectangle The rectangle to compute the height of.
+ * @returns {Number} The height.
+ */
+ Rectangle.computeHeight = function (rectangle) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ //>>includeEnd('debug');
+ return rectangle.north - rectangle.south;
+ };
+
+ /**
+ * Creates a rectangle given the boundary longitude and latitude in degrees.
+ *
+ * @param {Number} [west=0.0] The westernmost longitude in degrees in the range [-180.0, 180.0].
+ * @param {Number} [south=0.0] The southernmost latitude in degrees in the range [-90.0, 90.0].
+ * @param {Number} [east=0.0] The easternmost longitude in degrees in the range [-180.0, 180.0].
+ * @param {Number} [north=0.0] The northernmost latitude in degrees in the range [-90.0, 90.0].
+ * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.
+ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.
+ *
+ * @example
+ * const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);
+ */
+ Rectangle.fromDegrees = function (west, south, east, north, result) {
+ west = Math$1.CesiumMath.toRadians(defaultValue.defaultValue(west, 0.0));
+ south = Math$1.CesiumMath.toRadians(defaultValue.defaultValue(south, 0.0));
+ east = Math$1.CesiumMath.toRadians(defaultValue.defaultValue(east, 0.0));
+ north = Math$1.CesiumMath.toRadians(defaultValue.defaultValue(north, 0.0));
+
+ if (!defaultValue.defined(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+
+ return result;
+ };
+
+ /**
+ * Creates a rectangle given the boundary longitude and latitude in radians.
+ *
+ * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI].
+ * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
+ * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI].
+ * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].
+ * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.
+ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.
+ *
+ * @example
+ * const rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);
+ */
+ Rectangle.fromRadians = function (west, south, east, north, result) {
+ if (!defaultValue.defined(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+
+ result.west = defaultValue.defaultValue(west, 0.0);
+ result.south = defaultValue.defaultValue(south, 0.0);
+ result.east = defaultValue.defaultValue(east, 0.0);
+ result.north = defaultValue.defaultValue(north, 0.0);
+
+ return result;
+ };
+
+ /**
+ * Creates the smallest possible Rectangle that encloses all positions in the provided array.
+ *
+ * @param {Cartographic[]} cartographics The list of Cartographic instances.
+ * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.
+ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.
+ */
+ Rectangle.fromCartographicArray = function (cartographics, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartographics", cartographics);
+ //>>includeEnd('debug');
+
+ let west = Number.MAX_VALUE;
+ let east = -Number.MAX_VALUE;
+ let westOverIDL = Number.MAX_VALUE;
+ let eastOverIDL = -Number.MAX_VALUE;
+ let south = Number.MAX_VALUE;
+ let north = -Number.MAX_VALUE;
+
+ for (let i = 0, len = cartographics.length; i < len; i++) {
+ const position = cartographics[i];
+ west = Math.min(west, position.longitude);
+ east = Math.max(east, position.longitude);
+ south = Math.min(south, position.latitude);
+ north = Math.max(north, position.latitude);
+
+ const lonAdjusted =
+ position.longitude >= 0
+ ? position.longitude
+ : position.longitude + Math$1.CesiumMath.TWO_PI;
+ westOverIDL = Math.min(westOverIDL, lonAdjusted);
+ eastOverIDL = Math.max(eastOverIDL, lonAdjusted);
+ }
+
+ if (east - west > eastOverIDL - westOverIDL) {
+ west = westOverIDL;
+ east = eastOverIDL;
+
+ if (east > Math$1.CesiumMath.PI) {
+ east = east - Math$1.CesiumMath.TWO_PI;
+ }
+ if (west > Math$1.CesiumMath.PI) {
+ west = west - Math$1.CesiumMath.TWO_PI;
+ }
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+ };
+
+ /**
+ * Creates the smallest possible Rectangle that encloses all positions in the provided array.
+ *
+ * @param {Cartesian3[]} cartesians The list of Cartesian instances.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid the cartesians are on.
+ * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.
+ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.
+ */
+ Rectangle.fromCartesianArray = function (cartesians, ellipsoid, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartesians", cartesians);
+ //>>includeEnd('debug');
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+
+ let west = Number.MAX_VALUE;
+ let east = -Number.MAX_VALUE;
+ let westOverIDL = Number.MAX_VALUE;
+ let eastOverIDL = -Number.MAX_VALUE;
+ let south = Number.MAX_VALUE;
+ let north = -Number.MAX_VALUE;
+
+ for (let i = 0, len = cartesians.length; i < len; i++) {
+ const position = ellipsoid.cartesianToCartographic(cartesians[i]);
+ west = Math.min(west, position.longitude);
+ east = Math.max(east, position.longitude);
+ south = Math.min(south, position.latitude);
+ north = Math.max(north, position.latitude);
+
+ const lonAdjusted =
+ position.longitude >= 0
+ ? position.longitude
+ : position.longitude + Math$1.CesiumMath.TWO_PI;
+ westOverIDL = Math.min(westOverIDL, lonAdjusted);
+ eastOverIDL = Math.max(eastOverIDL, lonAdjusted);
+ }
+
+ if (east - west > eastOverIDL - westOverIDL) {
+ west = westOverIDL;
+ east = eastOverIDL;
+
+ if (east > Math$1.CesiumMath.PI) {
+ east = east - Math$1.CesiumMath.TWO_PI;
+ }
+ if (west > Math$1.CesiumMath.PI) {
+ west = west - Math$1.CesiumMath.TWO_PI;
+ }
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+ };
+
+ /**
+ * Duplicates a Rectangle.
+ *
+ * @param {Rectangle} rectangle The rectangle to clone.
+ * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.
+ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)
+ */
+ Rectangle.clone = function (rectangle, result) {
+ if (!defaultValue.defined(rectangle)) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Rectangle(
+ rectangle.west,
+ rectangle.south,
+ rectangle.east,
+ rectangle.north
+ );
+ }
+
+ result.west = rectangle.west;
+ result.south = rectangle.south;
+ result.east = rectangle.east;
+ result.north = rectangle.north;
+ return result;
+ };
+
+ /**
+ * Compares the provided Rectangles componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {Rectangle} [left] The first Rectangle.
+ * @param {Rectangle} [right] The second Rectangle.
+ * @param {Number} [absoluteEpsilon=0] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ Rectangle.equalsEpsilon = function (left, right, absoluteEpsilon) {
+ absoluteEpsilon = defaultValue.defaultValue(absoluteEpsilon, 0);
+
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math.abs(left.west - right.west) <= absoluteEpsilon &&
+ Math.abs(left.south - right.south) <= absoluteEpsilon &&
+ Math.abs(left.east - right.east) <= absoluteEpsilon &&
+ Math.abs(left.north - right.north) <= absoluteEpsilon)
+ );
+ };
+
+ /**
+ * Duplicates this Rectangle.
+ *
+ * @param {Rectangle} [result] The object onto which to store the result.
+ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.
+ */
+ Rectangle.prototype.clone = function (result) {
+ return Rectangle.clone(this, result);
+ };
+
+ /**
+ * Compares the provided Rectangle with this Rectangle componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Rectangle} [other] The Rectangle to compare.
+ * @returns {Boolean} true
if the Rectangles are equal, false
otherwise.
+ */
+ Rectangle.prototype.equals = function (other) {
+ return Rectangle.equals(this, other);
+ };
+
+ /**
+ * Compares the provided rectangles and returns true
if they are equal,
+ * false
otherwise.
+ *
+ * @param {Rectangle} [left] The first Rectangle.
+ * @param {Rectangle} [right] The second Rectangle.
+ * @returns {Boolean} true
if left and right are equal; otherwise false
.
+ */
+ Rectangle.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left.west === right.west &&
+ left.south === right.south &&
+ left.east === right.east &&
+ left.north === right.north)
+ );
+ };
+
+ /**
+ * Compares the provided Rectangle with this Rectangle componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Rectangle} [other] The Rectangle to compare.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if the Rectangles are within the provided epsilon, false
otherwise.
+ */
+ Rectangle.prototype.equalsEpsilon = function (other, epsilon) {
+ return Rectangle.equalsEpsilon(this, other, epsilon);
+ };
+
+ /**
+ * Checks a Rectangle's properties and throws if they are not in valid ranges.
+ *
+ * @param {Rectangle} rectangle The rectangle to validate
+ *
+ * @exception {DeveloperError} north
must be in the interval [-Pi/2
, Pi/2
].
+ * @exception {DeveloperError} south
must be in the interval [-Pi/2
, Pi/2
].
+ * @exception {DeveloperError} east
must be in the interval [-Pi
, Pi
].
+ * @exception {DeveloperError} west
must be in the interval [-Pi
, Pi
].
+ */
+ Rectangle.validate = function (rectangle) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+
+ const north = rectangle.north;
+ Check.Check.typeOf.number.greaterThanOrEquals(
+ "north",
+ north,
+ -Math$1.CesiumMath.PI_OVER_TWO
+ );
+ Check.Check.typeOf.number.lessThanOrEquals("north", north, Math$1.CesiumMath.PI_OVER_TWO);
+
+ const south = rectangle.south;
+ Check.Check.typeOf.number.greaterThanOrEquals(
+ "south",
+ south,
+ -Math$1.CesiumMath.PI_OVER_TWO
+ );
+ Check.Check.typeOf.number.lessThanOrEquals("south", south, Math$1.CesiumMath.PI_OVER_TWO);
+
+ const west = rectangle.west;
+ Check.Check.typeOf.number.greaterThanOrEquals("west", west, -Math.PI);
+ Check.Check.typeOf.number.lessThanOrEquals("west", west, Math.PI);
+
+ const east = rectangle.east;
+ Check.Check.typeOf.number.greaterThanOrEquals("east", east, -Math.PI);
+ Check.Check.typeOf.number.lessThanOrEquals("east", east, Math.PI);
+ //>>includeEnd('debug');
+ };
+
+ /**
+ * Computes the southwest corner of a rectangle.
+ *
+ * @param {Rectangle} rectangle The rectangle for which to find the corner
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.
+ */
+ Rectangle.southwest = function (rectangle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3.Cartographic(rectangle.west, rectangle.south);
+ }
+ result.longitude = rectangle.west;
+ result.latitude = rectangle.south;
+ result.height = 0.0;
+ return result;
+ };
+
+ /**
+ * Computes the northwest corner of a rectangle.
+ *
+ * @param {Rectangle} rectangle The rectangle for which to find the corner
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.
+ */
+ Rectangle.northwest = function (rectangle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3.Cartographic(rectangle.west, rectangle.north);
+ }
+ result.longitude = rectangle.west;
+ result.latitude = rectangle.north;
+ result.height = 0.0;
+ return result;
+ };
+
+ /**
+ * Computes the northeast corner of a rectangle.
+ *
+ * @param {Rectangle} rectangle The rectangle for which to find the corner
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.
+ */
+ Rectangle.northeast = function (rectangle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3.Cartographic(rectangle.east, rectangle.north);
+ }
+ result.longitude = rectangle.east;
+ result.latitude = rectangle.north;
+ result.height = 0.0;
+ return result;
+ };
+
+ /**
+ * Computes the southeast corner of a rectangle.
+ *
+ * @param {Rectangle} rectangle The rectangle for which to find the corner
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.
+ */
+ Rectangle.southeast = function (rectangle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3.Cartographic(rectangle.east, rectangle.south);
+ }
+ result.longitude = rectangle.east;
+ result.latitude = rectangle.south;
+ result.height = 0.0;
+ return result;
+ };
+
+ /**
+ * Computes the center of a rectangle.
+ *
+ * @param {Rectangle} rectangle The rectangle for which to find the center
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.
+ */
+ Rectangle.center = function (rectangle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ //>>includeEnd('debug');
+
+ let east = rectangle.east;
+ const west = rectangle.west;
+
+ if (east < west) {
+ east += Math$1.CesiumMath.TWO_PI;
+ }
+
+ const longitude = Math$1.CesiumMath.negativePiToPi((west + east) * 0.5);
+ const latitude = (rectangle.south + rectangle.north) * 0.5;
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3.Cartographic(longitude, latitude);
+ }
+
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = 0.0;
+ return result;
+ };
+
+ /**
+ * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are
+ * latitude and longitude in radians and produces a correct intersection, taking into account the fact that
+ * the same angle can be represented with multiple values as well as the wrapping of longitude at the
+ * anti-meridian. For a simple intersection that ignores these factors and can be used with projected
+ * coordinates, see {@link Rectangle.simpleIntersection}.
+ *
+ * @param {Rectangle} rectangle On rectangle to find an intersection
+ * @param {Rectangle} otherRectangle Another rectangle to find an intersection
+ * @param {Rectangle} [result] The object onto which to store the result.
+ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
+ */
+ Rectangle.intersection = function (rectangle, otherRectangle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ Check.Check.typeOf.object("otherRectangle", otherRectangle);
+ //>>includeEnd('debug');
+
+ let rectangleEast = rectangle.east;
+ let rectangleWest = rectangle.west;
+
+ let otherRectangleEast = otherRectangle.east;
+ let otherRectangleWest = otherRectangle.west;
+
+ if (rectangleEast < rectangleWest && otherRectangleEast > 0.0) {
+ rectangleEast += Math$1.CesiumMath.TWO_PI;
+ } else if (otherRectangleEast < otherRectangleWest && rectangleEast > 0.0) {
+ otherRectangleEast += Math$1.CesiumMath.TWO_PI;
+ }
+
+ if (rectangleEast < rectangleWest && otherRectangleWest < 0.0) {
+ otherRectangleWest += Math$1.CesiumMath.TWO_PI;
+ } else if (otherRectangleEast < otherRectangleWest && rectangleWest < 0.0) {
+ rectangleWest += Math$1.CesiumMath.TWO_PI;
+ }
+
+ const west = Math$1.CesiumMath.negativePiToPi(
+ Math.max(rectangleWest, otherRectangleWest)
+ );
+ const east = Math$1.CesiumMath.negativePiToPi(
+ Math.min(rectangleEast, otherRectangleEast)
+ );
+
+ if (
+ (rectangle.west < rectangle.east ||
+ otherRectangle.west < otherRectangle.east) &&
+ east <= west
+ ) {
+ return undefined;
+ }
+
+ const south = Math.max(rectangle.south, otherRectangle.south);
+ const north = Math.min(rectangle.north, otherRectangle.north);
+
+ if (south >= north) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+ };
+
+ /**
+ * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function
+ * does not attempt to put the angular coordinates into a consistent range or to account for crossing the
+ * anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude
+ * and longitude (i.e. projected coordinates).
+ *
+ * @param {Rectangle} rectangle On rectangle to find an intersection
+ * @param {Rectangle} otherRectangle Another rectangle to find an intersection
+ * @param {Rectangle} [result] The object onto which to store the result.
+ * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
+ */
+ Rectangle.simpleIntersection = function (rectangle, otherRectangle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ Check.Check.typeOf.object("otherRectangle", otherRectangle);
+ //>>includeEnd('debug');
+
+ const west = Math.max(rectangle.west, otherRectangle.west);
+ const south = Math.max(rectangle.south, otherRectangle.south);
+ const east = Math.min(rectangle.east, otherRectangle.east);
+ const north = Math.min(rectangle.north, otherRectangle.north);
+
+ if (south >= north || west >= east) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+ };
+
+ /**
+ * Computes a rectangle that is the union of two rectangles.
+ *
+ * @param {Rectangle} rectangle A rectangle to enclose in rectangle.
+ * @param {Rectangle} otherRectangle A rectangle to enclose in a rectangle.
+ * @param {Rectangle} [result] The object onto which to store the result.
+ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.
+ */
+ Rectangle.union = function (rectangle, otherRectangle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ Check.Check.typeOf.object("otherRectangle", otherRectangle);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Rectangle();
+ }
+
+ let rectangleEast = rectangle.east;
+ let rectangleWest = rectangle.west;
+
+ let otherRectangleEast = otherRectangle.east;
+ let otherRectangleWest = otherRectangle.west;
+
+ if (rectangleEast < rectangleWest && otherRectangleEast > 0.0) {
+ rectangleEast += Math$1.CesiumMath.TWO_PI;
+ } else if (otherRectangleEast < otherRectangleWest && rectangleEast > 0.0) {
+ otherRectangleEast += Math$1.CesiumMath.TWO_PI;
+ }
+
+ if (rectangleEast < rectangleWest && otherRectangleWest < 0.0) {
+ otherRectangleWest += Math$1.CesiumMath.TWO_PI;
+ } else if (otherRectangleEast < otherRectangleWest && rectangleWest < 0.0) {
+ rectangleWest += Math$1.CesiumMath.TWO_PI;
+ }
+
+ const west = Math$1.CesiumMath.negativePiToPi(
+ Math.min(rectangleWest, otherRectangleWest)
+ );
+ const east = Math$1.CesiumMath.negativePiToPi(
+ Math.max(rectangleEast, otherRectangleEast)
+ );
+
+ result.west = west;
+ result.south = Math.min(rectangle.south, otherRectangle.south);
+ result.east = east;
+ result.north = Math.max(rectangle.north, otherRectangle.north);
+
+ return result;
+ };
+
+ /**
+ * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.
+ *
+ * @param {Rectangle} rectangle A rectangle to expand.
+ * @param {Cartographic} cartographic A cartographic to enclose in a rectangle.
+ * @param {Rectangle} [result] The object onto which to store the result.
+ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided.
+ */
+ Rectangle.expand = function (rectangle, cartographic, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ Check.Check.typeOf.object("cartographic", cartographic);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Rectangle();
+ }
+
+ result.west = Math.min(rectangle.west, cartographic.longitude);
+ result.south = Math.min(rectangle.south, cartographic.latitude);
+ result.east = Math.max(rectangle.east, cartographic.longitude);
+ result.north = Math.max(rectangle.north, cartographic.latitude);
+
+ return result;
+ };
+
+ /**
+ * Returns true if the cartographic is on or inside the rectangle, false otherwise.
+ *
+ * @param {Rectangle} rectangle The rectangle
+ * @param {Cartographic} cartographic The cartographic to test.
+ * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise.
+ */
+ Rectangle.contains = function (rectangle, cartographic) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ Check.Check.typeOf.object("cartographic", cartographic);
+ //>>includeEnd('debug');
+
+ let longitude = cartographic.longitude;
+ const latitude = cartographic.latitude;
+
+ const west = rectangle.west;
+ let east = rectangle.east;
+
+ if (east < west) {
+ east += Math$1.CesiumMath.TWO_PI;
+ if (longitude < 0.0) {
+ longitude += Math$1.CesiumMath.TWO_PI;
+ }
+ }
+ return (
+ (longitude > west ||
+ Math$1.CesiumMath.equalsEpsilon(longitude, west, Math$1.CesiumMath.EPSILON14)) &&
+ (longitude < east ||
+ Math$1.CesiumMath.equalsEpsilon(longitude, east, Math$1.CesiumMath.EPSILON14)) &&
+ latitude >= rectangle.south &&
+ latitude <= rectangle.north
+ );
+ };
+
+ const subsampleLlaScratch = new Matrix3.Cartographic();
+ /**
+ * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to
+ * {@link BoundingSphere#fromPoints}. Sampling is necessary to account
+ * for rectangles that cover the poles or cross the equator.
+ *
+ * @param {Rectangle} rectangle The rectangle to subsample.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.
+ * @param {Number} [surfaceHeight=0.0] The height of the rectangle above the ellipsoid.
+ * @param {Cartesian3[]} [result] The array of Cartesians onto which to store the result.
+ * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided.
+ */
+ Rectangle.subsample = function (rectangle, ellipsoid, surfaceHeight, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ //>>includeEnd('debug');
+
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+ surfaceHeight = defaultValue.defaultValue(surfaceHeight, 0.0);
+
+ if (!defaultValue.defined(result)) {
+ result = [];
+ }
+ let length = 0;
+
+ const north = rectangle.north;
+ const south = rectangle.south;
+ const east = rectangle.east;
+ const west = rectangle.west;
+
+ const lla = subsampleLlaScratch;
+ lla.height = surfaceHeight;
+
+ lla.longitude = west;
+ lla.latitude = north;
+ result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);
+ length++;
+
+ lla.longitude = east;
+ result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);
+ length++;
+
+ lla.latitude = south;
+ result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);
+ length++;
+
+ lla.longitude = west;
+ result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);
+ length++;
+
+ if (north < 0.0) {
+ lla.latitude = north;
+ } else if (south > 0.0) {
+ lla.latitude = south;
+ } else {
+ lla.latitude = 0.0;
+ }
+
+ for (let i = 1; i < 8; ++i) {
+ lla.longitude = -Math.PI + i * Math$1.CesiumMath.PI_OVER_TWO;
+ if (Rectangle.contains(rectangle, lla)) {
+ result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);
+ length++;
+ }
+ }
+
+ if (lla.latitude === 0.0) {
+ lla.longitude = west;
+ result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);
+ length++;
+ lla.longitude = east;
+ result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);
+ length++;
+ }
+ result.length = length;
+ return result;
+ };
+
+ /**
+ * Computes a subsection of a rectangle from normalized coordinates in the range [0.0, 1.0].
+ *
+ * @param {Rectangle} rectangle The rectangle to subsection.
+ * @param {Number} westLerp The west interpolation factor in the range [0.0, 1.0]. Must be less than or equal to eastLerp.
+ * @param {Number} southLerp The south interpolation factor in the range [0.0, 1.0]. Must be less than or equal to northLerp.
+ * @param {Number} eastLerp The east interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to westLerp.
+ * @param {Number} northLerp The north interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to southLerp.
+ * @param {Rectangle} [result] The object onto which to store the result.
+ * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.
+ */
+ Rectangle.subsection = function (
+ rectangle,
+ westLerp,
+ southLerp,
+ eastLerp,
+ northLerp,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ Check.Check.typeOf.number.greaterThanOrEquals("westLerp", westLerp, 0.0);
+ Check.Check.typeOf.number.lessThanOrEquals("westLerp", westLerp, 1.0);
+ Check.Check.typeOf.number.greaterThanOrEquals("southLerp", southLerp, 0.0);
+ Check.Check.typeOf.number.lessThanOrEquals("southLerp", southLerp, 1.0);
+ Check.Check.typeOf.number.greaterThanOrEquals("eastLerp", eastLerp, 0.0);
+ Check.Check.typeOf.number.lessThanOrEquals("eastLerp", eastLerp, 1.0);
+ Check.Check.typeOf.number.greaterThanOrEquals("northLerp", northLerp, 0.0);
+ Check.Check.typeOf.number.lessThanOrEquals("northLerp", northLerp, 1.0);
+
+ Check.Check.typeOf.number.lessThanOrEquals("westLerp", westLerp, eastLerp);
+ Check.Check.typeOf.number.lessThanOrEquals("southLerp", southLerp, northLerp);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Rectangle();
+ }
+
+ // This function doesn't use CesiumMath.lerp because it has floating point precision problems
+ // when the start and end values are the same but the t changes.
+
+ if (rectangle.west <= rectangle.east) {
+ const width = rectangle.east - rectangle.west;
+ result.west = rectangle.west + westLerp * width;
+ result.east = rectangle.west + eastLerp * width;
+ } else {
+ const width = Math$1.CesiumMath.TWO_PI + rectangle.east - rectangle.west;
+ result.west = Math$1.CesiumMath.negativePiToPi(rectangle.west + westLerp * width);
+ result.east = Math$1.CesiumMath.negativePiToPi(rectangle.west + eastLerp * width);
+ }
+ const height = rectangle.north - rectangle.south;
+ result.south = rectangle.south + southLerp * height;
+ result.north = rectangle.south + northLerp * height;
+
+ // Fix floating point precision problems when t = 1
+ if (westLerp === 1.0) {
+ result.west = rectangle.east;
+ }
+ if (eastLerp === 1.0) {
+ result.east = rectangle.east;
+ }
+ if (southLerp === 1.0) {
+ result.south = rectangle.north;
+ }
+ if (northLerp === 1.0) {
+ result.north = rectangle.north;
+ }
+
+ return result;
+ };
+
+ /**
+ * The largest possible rectangle.
+ *
+ * @type {Rectangle}
+ * @constant
+ */
+ Rectangle.MAX_VALUE = Object.freeze(
+ new Rectangle(
+ -Math.PI,
+ -Math$1.CesiumMath.PI_OVER_TWO,
+ Math.PI,
+ Math$1.CesiumMath.PI_OVER_TWO
+ )
+ );
+
+ /**
+ * A 2D Cartesian point.
+ * @alias Cartesian2
+ * @constructor
+ *
+ * @param {Number} [x=0.0] The X component.
+ * @param {Number} [y=0.0] The Y component.
+ *
+ * @see Cartesian3
+ * @see Cartesian4
+ * @see Packable
+ */
+ function Cartesian2(x, y) {
+ /**
+ * The X component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.x = defaultValue.defaultValue(x, 0.0);
+
+ /**
+ * The Y component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.y = defaultValue.defaultValue(y, 0.0);
+ }
+
+ /**
+ * Creates a Cartesian2 instance from x and y coordinates.
+ *
+ * @param {Number} x The x coordinate.
+ * @param {Number} y The y coordinate.
+ * @param {Cartesian2} [result] The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
+ */
+ Cartesian2.fromElements = function (x, y, result) {
+ if (!defaultValue.defined(result)) {
+ return new Cartesian2(x, y);
+ }
+
+ result.x = x;
+ result.y = y;
+ return result;
+ };
+
+ /**
+ * Duplicates a Cartesian2 instance.
+ *
+ * @param {Cartesian2} cartesian The Cartesian to duplicate.
+ * @param {Cartesian2} [result] The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)
+ */
+ Cartesian2.clone = function (cartesian, result) {
+ if (!defaultValue.defined(cartesian)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ return new Cartesian2(cartesian.x, cartesian.y);
+ }
+
+ result.x = cartesian.x;
+ result.y = cartesian.y;
+ return result;
+ };
+
+ /**
+ * Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the
+ * x and y properties of the Cartesian3 and drops z.
+ * @function
+ *
+ * @param {Cartesian3} cartesian The Cartesian3 instance to create a Cartesian2 instance from.
+ * @param {Cartesian2} [result] The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
+ */
+ Cartesian2.fromCartesian3 = Cartesian2.clone;
+
+ /**
+ * Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the
+ * x and y properties of the Cartesian4 and drops z and w.
+ * @function
+ *
+ * @param {Cartesian4} cartesian The Cartesian4 instance to create a Cartesian2 instance from.
+ * @param {Cartesian2} [result] The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
+ */
+ Cartesian2.fromCartesian4 = Cartesian2.clone;
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ Cartesian2.packedLength = 2;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {Cartesian2} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ Cartesian2.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value.x;
+ array[startingIndex] = value.y;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {Cartesian2} [result] The object into which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
+ */
+ Cartesian2.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian2();
+ }
+ result.x = array[startingIndex++];
+ result.y = array[startingIndex];
+ return result;
+ };
+
+ /**
+ * Flattens an array of Cartesian2s into an array of components.
+ *
+ * @param {Cartesian2[]} array The array of cartesians to pack.
+ * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 2 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 2) elements.
+ * @returns {Number[]} The packed array.
+ */
+ Cartesian2.packArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ const resultLength = length * 2;
+ if (!defaultValue.defined(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(
+ "If result is a typed array, it must have exactly array.length * 2 elements"
+ );
+ //>>includeEnd('debug');
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+
+ for (let i = 0; i < length; ++i) {
+ Cartesian2.pack(array[i], result, i * 2);
+ }
+ return result;
+ };
+
+ /**
+ * Unpacks an array of cartesian components into an array of Cartesian2s.
+ *
+ * @param {Number[]} array The array of components to unpack.
+ * @param {Cartesian2[]} [result] The array onto which to store the result.
+ * @returns {Cartesian2[]} The unpacked array.
+ */
+ Cartesian2.unpackArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ Check.Check.typeOf.number.greaterThanOrEquals("array.length", array.length, 2);
+ if (array.length % 2 !== 0) {
+ throw new Check.DeveloperError("array length must be a multiple of 2.");
+ }
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length / 2);
+ } else {
+ result.length = length / 2;
+ }
+
+ for (let i = 0; i < length; i += 2) {
+ const index = i / 2;
+ result[index] = Cartesian2.unpack(array, i, result[index]);
+ }
+ return result;
+ };
+
+ /**
+ * Creates a Cartesian2 from two consecutive elements in an array.
+ * @function
+ *
+ * @param {Number[]} array The array whose two consecutive elements correspond to the x and y components, respectively.
+ * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.
+ * @param {Cartesian2} [result] The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
+ *
+ * @example
+ * // Create a Cartesian2 with (1.0, 2.0)
+ * const v = [1.0, 2.0];
+ * const p = Cesium.Cartesian2.fromArray(v);
+ *
+ * // Create a Cartesian2 with (1.0, 2.0) using an offset into an array
+ * const v2 = [0.0, 0.0, 1.0, 2.0];
+ * const p2 = Cesium.Cartesian2.fromArray(v2, 2);
+ */
+ Cartesian2.fromArray = Cartesian2.unpack;
+
+ /**
+ * Computes the value of the maximum component for the supplied Cartesian.
+ *
+ * @param {Cartesian2} cartesian The cartesian to use.
+ * @returns {Number} The value of the maximum component.
+ */
+ Cartesian2.maximumComponent = function (cartesian) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ return Math.max(cartesian.x, cartesian.y);
+ };
+
+ /**
+ * Computes the value of the minimum component for the supplied Cartesian.
+ *
+ * @param {Cartesian2} cartesian The cartesian to use.
+ * @returns {Number} The value of the minimum component.
+ */
+ Cartesian2.minimumComponent = function (cartesian) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ return Math.min(cartesian.x, cartesian.y);
+ };
+
+ /**
+ * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
+ *
+ * @param {Cartesian2} first A cartesian to compare.
+ * @param {Cartesian2} second A cartesian to compare.
+ * @param {Cartesian2} result The object into which to store the result.
+ * @returns {Cartesian2} A cartesian with the minimum components.
+ */
+ Cartesian2.minimumByComponent = function (first, second, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("first", first);
+ Check.Check.typeOf.object("second", second);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Math.min(first.x, second.x);
+ result.y = Math.min(first.y, second.y);
+
+ return result;
+ };
+
+ /**
+ * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
+ *
+ * @param {Cartesian2} first A cartesian to compare.
+ * @param {Cartesian2} second A cartesian to compare.
+ * @param {Cartesian2} result The object into which to store the result.
+ * @returns {Cartesian2} A cartesian with the maximum components.
+ */
+ Cartesian2.maximumByComponent = function (first, second, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("first", first);
+ Check.Check.typeOf.object("second", second);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Math.max(first.x, second.x);
+ result.y = Math.max(first.y, second.y);
+ return result;
+ };
+
+ /**
+ * Constrain a value to lie between two values.
+ *
+ * @param {Cartesian2} value The value to clamp.
+ * @param {Cartesian2} min The minimum bound.
+ * @param {Cartesian2} max The maximum bound.
+ * @param {Cartesian2} result The object into which to store the result.
+ * @returns {Cartesian2} The clamped value such that min <= result <= max.
+ */
+ Cartesian2.clamp = function (value, min, max, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.typeOf.object("min", min);
+ Check.Check.typeOf.object("max", max);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const x = Math$1.CesiumMath.clamp(value.x, min.x, max.x);
+ const y = Math$1.CesiumMath.clamp(value.y, min.y, max.y);
+
+ result.x = x;
+ result.y = y;
+
+ return result;
+ };
+
+ /**
+ * Computes the provided Cartesian's squared magnitude.
+ *
+ * @param {Cartesian2} cartesian The Cartesian instance whose squared magnitude is to be computed.
+ * @returns {Number} The squared magnitude.
+ */
+ Cartesian2.magnitudeSquared = function (cartesian) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ return cartesian.x * cartesian.x + cartesian.y * cartesian.y;
+ };
+
+ /**
+ * Computes the Cartesian's magnitude (length).
+ *
+ * @param {Cartesian2} cartesian The Cartesian instance whose magnitude is to be computed.
+ * @returns {Number} The magnitude.
+ */
+ Cartesian2.magnitude = function (cartesian) {
+ return Math.sqrt(Cartesian2.magnitudeSquared(cartesian));
+ };
+
+ const distanceScratch = new Cartesian2();
+
+ /**
+ * Computes the distance between two points.
+ *
+ * @param {Cartesian2} left The first point to compute the distance from.
+ * @param {Cartesian2} right The second point to compute the distance to.
+ * @returns {Number} The distance between two points.
+ *
+ * @example
+ * // Returns 1.0
+ * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));
+ */
+ Cartesian2.distance = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ Cartesian2.subtract(left, right, distanceScratch);
+ return Cartesian2.magnitude(distanceScratch);
+ };
+
+ /**
+ * Computes the squared distance between two points. Comparing squared distances
+ * using this function is more efficient than comparing distances using {@link Cartesian2#distance}.
+ *
+ * @param {Cartesian2} left The first point to compute the distance from.
+ * @param {Cartesian2} right The second point to compute the distance to.
+ * @returns {Number} The distance between two points.
+ *
+ * @example
+ * // Returns 4.0, not 2.0
+ * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));
+ */
+ Cartesian2.distanceSquared = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ Cartesian2.subtract(left, right, distanceScratch);
+ return Cartesian2.magnitudeSquared(distanceScratch);
+ };
+
+ /**
+ * Computes the normalized form of the supplied Cartesian.
+ *
+ * @param {Cartesian2} cartesian The Cartesian to be normalized.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Cartesian2.normalize = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const magnitude = Cartesian2.magnitude(cartesian);
+
+ result.x = cartesian.x / magnitude;
+ result.y = cartesian.y / magnitude;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (isNaN(result.x) || isNaN(result.y)) {
+ throw new Check.DeveloperError("normalized result is not a number");
+ }
+ //>>includeEnd('debug');
+
+ return result;
+ };
+
+ /**
+ * Computes the dot (scalar) product of two Cartesians.
+ *
+ * @param {Cartesian2} left The first Cartesian.
+ * @param {Cartesian2} right The second Cartesian.
+ * @returns {Number} The dot product.
+ */
+ Cartesian2.dot = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ return left.x * right.x + left.y * right.y;
+ };
+
+ /**
+ * Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0
+ *
+ * @param {Cartesian2} left The first Cartesian.
+ * @param {Cartesian2} right The second Cartesian.
+ * @returns {Number} The cross product.
+ */
+ Cartesian2.cross = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ return left.x * right.y - left.y * right.x;
+ };
+
+ /**
+ * Computes the componentwise product of two Cartesians.
+ *
+ * @param {Cartesian2} left The first Cartesian.
+ * @param {Cartesian2} right The second Cartesian.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Cartesian2.multiplyComponents = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x * right.x;
+ result.y = left.y * right.y;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise quotient of two Cartesians.
+ *
+ * @param {Cartesian2} left The first Cartesian.
+ * @param {Cartesian2} right The second Cartesian.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Cartesian2.divideComponents = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x / right.x;
+ result.y = left.y / right.y;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise sum of two Cartesians.
+ *
+ * @param {Cartesian2} left The first Cartesian.
+ * @param {Cartesian2} right The second Cartesian.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Cartesian2.add = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x + right.x;
+ result.y = left.y + right.y;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise difference of two Cartesians.
+ *
+ * @param {Cartesian2} left The first Cartesian.
+ * @param {Cartesian2} right The second Cartesian.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Cartesian2.subtract = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x - right.x;
+ result.y = left.y - right.y;
+ return result;
+ };
+
+ /**
+ * Multiplies the provided Cartesian componentwise by the provided scalar.
+ *
+ * @param {Cartesian2} cartesian The Cartesian to be scaled.
+ * @param {Number} scalar The scalar to multiply with.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Cartesian2.multiplyByScalar = function (cartesian, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = cartesian.x * scalar;
+ result.y = cartesian.y * scalar;
+ return result;
+ };
+
+ /**
+ * Divides the provided Cartesian componentwise by the provided scalar.
+ *
+ * @param {Cartesian2} cartesian The Cartesian to be divided.
+ * @param {Number} scalar The scalar to divide by.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Cartesian2.divideByScalar = function (cartesian, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = cartesian.x / scalar;
+ result.y = cartesian.y / scalar;
+ return result;
+ };
+
+ /**
+ * Negates the provided Cartesian.
+ *
+ * @param {Cartesian2} cartesian The Cartesian to be negated.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Cartesian2.negate = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = -cartesian.x;
+ result.y = -cartesian.y;
+ return result;
+ };
+
+ /**
+ * Computes the absolute value of the provided Cartesian.
+ *
+ * @param {Cartesian2} cartesian The Cartesian whose absolute value is to be computed.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Cartesian2.abs = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Math.abs(cartesian.x);
+ result.y = Math.abs(cartesian.y);
+ return result;
+ };
+
+ const lerpScratch = new Cartesian2();
+ /**
+ * Computes the linear interpolation or extrapolation at t using the provided cartesians.
+ *
+ * @param {Cartesian2} start The value corresponding to t at 0.0.
+ * @param {Cartesian2} end The value corresponding to t at 1.0.
+ * @param {Number} t The point along t at which to interpolate.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Cartesian2.lerp = function (start, end, t, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("start", start);
+ Check.Check.typeOf.object("end", end);
+ Check.Check.typeOf.number("t", t);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ Cartesian2.multiplyByScalar(end, t, lerpScratch);
+ result = Cartesian2.multiplyByScalar(start, 1.0 - t, result);
+ return Cartesian2.add(lerpScratch, result, result);
+ };
+
+ const angleBetweenScratch = new Cartesian2();
+ const angleBetweenScratch2 = new Cartesian2();
+ /**
+ * Returns the angle, in radians, between the provided Cartesians.
+ *
+ * @param {Cartesian2} left The first Cartesian.
+ * @param {Cartesian2} right The second Cartesian.
+ * @returns {Number} The angle between the Cartesians.
+ */
+ Cartesian2.angleBetween = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ Cartesian2.normalize(left, angleBetweenScratch);
+ Cartesian2.normalize(right, angleBetweenScratch2);
+ return Math$1.CesiumMath.acosClamped(
+ Cartesian2.dot(angleBetweenScratch, angleBetweenScratch2)
+ );
+ };
+
+ const mostOrthogonalAxisScratch = new Cartesian2();
+ /**
+ * Returns the axis that is most orthogonal to the provided Cartesian.
+ *
+ * @param {Cartesian2} cartesian The Cartesian on which to find the most orthogonal axis.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The most orthogonal axis.
+ */
+ Cartesian2.mostOrthogonalAxis = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch);
+ Cartesian2.abs(f, f);
+
+ if (f.x <= f.y) {
+ result = Cartesian2.clone(Cartesian2.UNIT_X, result);
+ } else {
+ result = Cartesian2.clone(Cartesian2.UNIT_Y, result);
+ }
+
+ return result;
+ };
+
+ /**
+ * Compares the provided Cartesians componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Cartesian2} [left] The first Cartesian.
+ * @param {Cartesian2} [right] The second Cartesian.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ Cartesian2.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left.x === right.x &&
+ left.y === right.y)
+ );
+ };
+
+ /**
+ * @private
+ */
+ Cartesian2.equalsArray = function (cartesian, array, offset) {
+ return cartesian.x === array[offset] && cartesian.y === array[offset + 1];
+ };
+
+ /**
+ * Compares the provided Cartesians componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {Cartesian2} [left] The first Cartesian.
+ * @param {Cartesian2} [right] The second Cartesian.
+ * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ Cartesian2.equalsEpsilon = function (
+ left,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.x,
+ right.x,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.y,
+ right.y,
+ relativeEpsilon,
+ absoluteEpsilon
+ ))
+ );
+ };
+
+ /**
+ * An immutable Cartesian2 instance initialized to (0.0, 0.0).
+ *
+ * @type {Cartesian2}
+ * @constant
+ */
+ Cartesian2.ZERO = Object.freeze(new Cartesian2(0.0, 0.0));
+
+ /**
+ * An immutable Cartesian2 instance initialized to (1.0, 1.0).
+ *
+ * @type {Cartesian2}
+ * @constant
+ */
+ Cartesian2.ONE = Object.freeze(new Cartesian2(1.0, 1.0));
+
+ /**
+ * An immutable Cartesian2 instance initialized to (1.0, 0.0).
+ *
+ * @type {Cartesian2}
+ * @constant
+ */
+ Cartesian2.UNIT_X = Object.freeze(new Cartesian2(1.0, 0.0));
+
+ /**
+ * An immutable Cartesian2 instance initialized to (0.0, 1.0).
+ *
+ * @type {Cartesian2}
+ * @constant
+ */
+ Cartesian2.UNIT_Y = Object.freeze(new Cartesian2(0.0, 1.0));
+
+ /**
+ * Duplicates this Cartesian2 instance.
+ *
+ * @param {Cartesian2} [result] The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.
+ */
+ Cartesian2.prototype.clone = function (result) {
+ return Cartesian2.clone(this, result);
+ };
+
+ /**
+ * Compares this Cartesian against the provided Cartesian componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Cartesian2} [right] The right hand side Cartesian.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ Cartesian2.prototype.equals = function (right) {
+ return Cartesian2.equals(this, right);
+ };
+
+ /**
+ * Compares this Cartesian against the provided Cartesian componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {Cartesian2} [right] The right hand side Cartesian.
+ * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.
+ */
+ Cartesian2.prototype.equalsEpsilon = function (
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ return Cartesian2.equalsEpsilon(
+ this,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+ };
+
+ /**
+ * Creates a string representing this Cartesian in the format '(x, y)'.
+ *
+ * @returns {String} A string representing the provided Cartesian in the format '(x, y)'.
+ */
+ Cartesian2.prototype.toString = function () {
+ return `(${this.x}, ${this.y})`;
+ };
+
+ /**
+ * A 2x2 matrix, indexable as a column-major order array.
+ * Constructor parameters are in row-major order for code readability.
+ * @alias Matrix2
+ * @constructor
+ * @implements {ArrayLike}
+ *
+ * @param {Number} [column0Row0=0.0] The value for column 0, row 0.
+ * @param {Number} [column1Row0=0.0] The value for column 1, row 0.
+ * @param {Number} [column0Row1=0.0] The value for column 0, row 1.
+ * @param {Number} [column1Row1=0.0] The value for column 1, row 1.
+ *
+ * @see Matrix2.fromArray
+ * @see Matrix2.fromColumnMajorArray
+ * @see Matrix2.fromRowMajorArray
+ * @see Matrix2.fromScale
+ * @see Matrix2.fromUniformScale
+ * @see Matrix2.fromRotation
+ * @see Matrix3
+ * @see Matrix4
+ */
+ function Matrix2(column0Row0, column1Row0, column0Row1, column1Row1) {
+ this[0] = defaultValue.defaultValue(column0Row0, 0.0);
+ this[1] = defaultValue.defaultValue(column0Row1, 0.0);
+ this[2] = defaultValue.defaultValue(column1Row0, 0.0);
+ this[3] = defaultValue.defaultValue(column1Row1, 0.0);
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ Matrix2.packedLength = 4;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {Matrix2} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ Matrix2.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value[0];
+ array[startingIndex++] = value[1];
+ array[startingIndex++] = value[2];
+ array[startingIndex++] = value[3];
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {Matrix2} [result] The object into which to store the result.
+ * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.
+ */
+ Matrix2.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix2();
+ }
+
+ result[0] = array[startingIndex++];
+ result[1] = array[startingIndex++];
+ result[2] = array[startingIndex++];
+ result[3] = array[startingIndex++];
+ return result;
+ };
+
+ /**
+ * Flattens an array of Matrix2s into an array of components. The components
+ * are stored in column-major order.
+ *
+ * @param {Matrix2[]} array The array of matrices to pack.
+ * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.
+ * @returns {Number[]} The packed array.
+ */
+ Matrix2.packArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ const resultLength = length * 4;
+ if (!defaultValue.defined(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(
+ "If result is a typed array, it must have exactly array.length * 4 elements"
+ );
+ //>>includeEnd('debug');
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+
+ for (let i = 0; i < length; ++i) {
+ Matrix2.pack(array[i], result, i * 4);
+ }
+ return result;
+ };
+
+ /**
+ * Unpacks an array of column-major matrix components into an array of Matrix2s.
+ *
+ * @param {Number[]} array The array of components to unpack.
+ * @param {Matrix2[]} [result] The array onto which to store the result.
+ * @returns {Matrix2[]} The unpacked array.
+ */
+ Matrix2.unpackArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ Check.Check.typeOf.number.greaterThanOrEquals("array.length", array.length, 4);
+ if (array.length % 4 !== 0) {
+ throw new Check.DeveloperError("array length must be a multiple of 4.");
+ }
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length / 4);
+ } else {
+ result.length = length / 4;
+ }
+
+ for (let i = 0; i < length; i += 4) {
+ const index = i / 4;
+ result[index] = Matrix2.unpack(array, i, result[index]);
+ }
+ return result;
+ };
+
+ /**
+ * Duplicates a Matrix2 instance.
+ *
+ * @param {Matrix2} matrix The matrix to duplicate.
+ * @param {Matrix2} [result] The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)
+ */
+ Matrix2.clone = function (matrix, result) {
+ if (!defaultValue.defined(matrix)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ return new Matrix2(matrix[0], matrix[2], matrix[1], matrix[3]);
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ return result;
+ };
+
+ /**
+ * Creates a Matrix2 from 4 consecutive elements in an array.
+ *
+ * @function
+ * @param {Number[]} array The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
+ * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.
+ * @param {Matrix2} [result] The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.
+ *
+ * @example
+ * // Create the Matrix2:
+ * // [1.0, 2.0]
+ * // [1.0, 2.0]
+ *
+ * const v = [1.0, 1.0, 2.0, 2.0];
+ * const m = Cesium.Matrix2.fromArray(v);
+ *
+ * // Create same Matrix2 with using an offset into an array
+ * const v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];
+ * const m2 = Cesium.Matrix2.fromArray(v2, 2);
+ */
+ Matrix2.fromArray = Matrix2.unpack;
+ /**
+ * Creates a Matrix2 instance from a column-major order array.
+ *
+ * @param {Number[]} values The column-major order array.
+ * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.
+ */
+ Matrix2.fromColumnMajorArray = function (values, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("values", values);
+ //>>includeEnd('debug');
+
+ return Matrix2.clone(values, result);
+ };
+
+ /**
+ * Creates a Matrix2 instance from a row-major order array.
+ * The resulting matrix will be in column-major order.
+ *
+ * @param {Number[]} values The row-major order array.
+ * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.
+ */
+ Matrix2.fromRowMajorArray = function (values, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("values", values);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix2(values[0], values[1], values[2], values[3]);
+ }
+ result[0] = values[0];
+ result[1] = values[2];
+ result[2] = values[1];
+ result[3] = values[3];
+ return result;
+ };
+
+ /**
+ * Computes a Matrix2 instance representing a non-uniform scale.
+ *
+ * @param {Cartesian2} scale The x and y scale factors.
+ * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.
+ *
+ * @example
+ * // Creates
+ * // [7.0, 0.0]
+ * // [0.0, 8.0]
+ * const m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));
+ */
+ Matrix2.fromScale = function (scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("scale", scale);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix2(scale.x, 0.0, 0.0, scale.y);
+ }
+
+ result[0] = scale.x;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = scale.y;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix2 instance representing a uniform scale.
+ *
+ * @param {Number} scale The uniform scale factor.
+ * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.
+ *
+ * @example
+ * // Creates
+ * // [2.0, 0.0]
+ * // [0.0, 2.0]
+ * const m = Cesium.Matrix2.fromUniformScale(2.0);
+ */
+ Matrix2.fromUniformScale = function (scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("scale", scale);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix2(scale, 0.0, 0.0, scale);
+ }
+
+ result[0] = scale;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = scale;
+ return result;
+ };
+
+ /**
+ * Creates a rotation matrix.
+ *
+ * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.
+ * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.
+ *
+ * @example
+ * // Rotate a point 45 degrees counterclockwise.
+ * const p = new Cesium.Cartesian2(5, 6);
+ * const m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));
+ * const rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());
+ */
+ Matrix2.fromRotation = function (angle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("angle", angle);
+ //>>includeEnd('debug');
+
+ const cosAngle = Math.cos(angle);
+ const sinAngle = Math.sin(angle);
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix2(cosAngle, -sinAngle, sinAngle, cosAngle);
+ }
+ result[0] = cosAngle;
+ result[1] = sinAngle;
+ result[2] = -sinAngle;
+ result[3] = cosAngle;
+ return result;
+ };
+
+ /**
+ * Creates an Array from the provided Matrix2 instance.
+ * The array will be in column-major order.
+ *
+ * @param {Matrix2} matrix The matrix to use..
+ * @param {Number[]} [result] The Array onto which to store the result.
+ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided.
+ */
+ Matrix2.toArray = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return [matrix[0], matrix[1], matrix[2], matrix[3]];
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ return result;
+ };
+
+ /**
+ * Computes the array index of the element at the provided row and column.
+ *
+ * @param {Number} row The zero-based index of the row.
+ * @param {Number} column The zero-based index of the column.
+ * @returns {Number} The index of the element at the provided row and column.
+ *
+ * @exception {DeveloperError} row must be 0 or 1.
+ * @exception {DeveloperError} column must be 0 or 1.
+ *
+ * @example
+ * const myMatrix = new Cesium.Matrix2();
+ * const column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);
+ * const column1Row0 = myMatrix[column1Row0Index]
+ * myMatrix[column1Row0Index] = 10.0;
+ */
+ Matrix2.getElementIndex = function (column, row) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.greaterThanOrEquals("row", row, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("row", row, 1);
+
+ Check.Check.typeOf.number.greaterThanOrEquals("column", column, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("column", column, 1);
+ //>>includeEnd('debug');
+
+ return column * 2 + row;
+ };
+
+ /**
+ * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.
+ *
+ * @param {Matrix2} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the column to retrieve.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0 or 1.
+ */
+ Matrix2.getColumn = function (matrix, index, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 1);
+
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const startIndex = index * 2;
+ const x = matrix[startIndex];
+ const y = matrix[startIndex + 1];
+
+ result.x = x;
+ result.y = y;
+ return result;
+ };
+
+ /**
+ * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.
+ *
+ * @param {Matrix2} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the column to set.
+ * @param {Cartesian2} cartesian The Cartesian whose values will be assigned to the specified column.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0 or 1.
+ */
+ Matrix2.setColumn = function (matrix, index, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 1);
+
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result = Matrix2.clone(matrix, result);
+ const startIndex = index * 2;
+ result[startIndex] = cartesian.x;
+ result[startIndex + 1] = cartesian.y;
+ return result;
+ };
+
+ /**
+ * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.
+ *
+ * @param {Matrix2} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the row to retrieve.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0 or 1.
+ */
+ Matrix2.getRow = function (matrix, index, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 1);
+
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const x = matrix[index];
+ const y = matrix[index + 2];
+
+ result.x = x;
+ result.y = y;
+ return result;
+ };
+
+ /**
+ * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.
+ *
+ * @param {Matrix2} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the row to set.
+ * @param {Cartesian2} cartesian The Cartesian whose values will be assigned to the specified row.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0 or 1.
+ */
+ Matrix2.setRow = function (matrix, index, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 1);
+
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result = Matrix2.clone(matrix, result);
+ result[index] = cartesian.x;
+ result[index + 2] = cartesian.y;
+ return result;
+ };
+
+ const scaleScratch1 = new Cartesian2();
+
+ /**
+ * Computes a new matrix that replaces the scale with the provided scale.
+ * This assumes the matrix is an affine transformation.
+ *
+ * @param {Matrix2} matrix The matrix to use.
+ * @param {Cartesian2} scale The scale that replaces the scale of the provided matrix.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ *
+ * @see Matrix2.setUniformScale
+ * @see Matrix2.fromScale
+ * @see Matrix2.fromUniformScale
+ * @see Matrix2.multiplyByScale
+ * @see Matrix2.multiplyByUniformScale
+ * @see Matrix2.getScale
+ */
+ Matrix2.setScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const existingScale = Matrix2.getScale(matrix, scaleScratch1);
+ const scaleRatioX = scale.x / existingScale.x;
+ const scaleRatioY = scale.y / existingScale.y;
+
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioY;
+ result[3] = matrix[3] * scaleRatioY;
+
+ return result;
+ };
+
+ const scaleScratch2 = new Cartesian2();
+
+ /**
+ * Computes a new matrix that replaces the scale with the provided uniform scale.
+ * This assumes the matrix is an affine transformation.
+ *
+ * @param {Matrix2} matrix The matrix to use.
+ * @param {Number} scale The uniform scale that replaces the scale of the provided matrix.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ *
+ * @see Matrix2.setScale
+ * @see Matrix2.fromScale
+ * @see Matrix2.fromUniformScale
+ * @see Matrix2.multiplyByScale
+ * @see Matrix2.multiplyByUniformScale
+ * @see Matrix2.getScale
+ */
+ Matrix2.setUniformScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const existingScale = Matrix2.getScale(matrix, scaleScratch2);
+ const scaleRatioX = scale / existingScale.x;
+ const scaleRatioY = scale / existingScale.y;
+
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioY;
+ result[3] = matrix[3] * scaleRatioY;
+
+ return result;
+ };
+
+ const scratchColumn = new Cartesian2();
+
+ /**
+ * Extracts the non-uniform scale assuming the matrix is an affine transformation.
+ *
+ * @param {Matrix2} matrix The matrix.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ *
+ * @see Matrix2.multiplyByScale
+ * @see Matrix2.multiplyByUniformScale
+ * @see Matrix2.fromScale
+ * @see Matrix2.fromUniformScale
+ * @see Matrix2.setScale
+ * @see Matrix2.setUniformScale
+ */
+ Matrix2.getScale = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Cartesian2.magnitude(
+ Cartesian2.fromElements(matrix[0], matrix[1], scratchColumn)
+ );
+ result.y = Cartesian2.magnitude(
+ Cartesian2.fromElements(matrix[2], matrix[3], scratchColumn)
+ );
+ return result;
+ };
+
+ const scaleScratch3 = new Cartesian2();
+
+ /**
+ * Computes the maximum scale assuming the matrix is an affine transformation.
+ * The maximum scale is the maximum length of the column vectors.
+ *
+ * @param {Matrix2} matrix The matrix.
+ * @returns {Number} The maximum scale.
+ */
+ Matrix2.getMaximumScale = function (matrix) {
+ Matrix2.getScale(matrix, scaleScratch3);
+ return Cartesian2.maximumComponent(scaleScratch3);
+ };
+
+ const scaleScratch4 = new Cartesian2();
+
+ /**
+ * Sets the rotation assuming the matrix is an affine transformation.
+ *
+ * @param {Matrix2} matrix The matrix.
+ * @param {Matrix2} rotation The rotation matrix.
+ * @returns {Matrix2} The modified result parameter.
+ *
+ * @see Matrix2.fromRotation
+ * @see Matrix2.getRotation
+ */
+ Matrix2.setRotation = function (matrix, rotation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const scale = Matrix2.getScale(matrix, scaleScratch4);
+
+ result[0] = rotation[0] * scale.x;
+ result[1] = rotation[1] * scale.x;
+ result[2] = rotation[2] * scale.y;
+ result[3] = rotation[3] * scale.y;
+
+ return result;
+ };
+
+ const scaleScratch5 = new Cartesian2();
+
+ /**
+ * Extracts the rotation matrix assuming the matrix is an affine transformation.
+ *
+ * @param {Matrix2} matrix The matrix.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ *
+ * @see Matrix2.setRotation
+ * @see Matrix2.fromRotation
+ */
+ Matrix2.getRotation = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const scale = Matrix2.getScale(matrix, scaleScratch5);
+
+ result[0] = matrix[0] / scale.x;
+ result[1] = matrix[1] / scale.x;
+ result[2] = matrix[2] / scale.y;
+ result[3] = matrix[3] / scale.y;
+
+ return result;
+ };
+
+ /**
+ * Computes the product of two matrices.
+ *
+ * @param {Matrix2} left The first matrix.
+ * @param {Matrix2} right The second matrix.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ */
+ Matrix2.multiply = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const column0Row0 = left[0] * right[0] + left[2] * right[1];
+ const column1Row0 = left[0] * right[2] + left[2] * right[3];
+ const column0Row1 = left[1] * right[0] + left[3] * right[1];
+ const column1Row1 = left[1] * right[2] + left[3] * right[3];
+
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column1Row0;
+ result[3] = column1Row1;
+ return result;
+ };
+
+ /**
+ * Computes the sum of two matrices.
+ *
+ * @param {Matrix2} left The first matrix.
+ * @param {Matrix2} right The second matrix.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ */
+ Matrix2.add = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = left[0] + right[0];
+ result[1] = left[1] + right[1];
+ result[2] = left[2] + right[2];
+ result[3] = left[3] + right[3];
+ return result;
+ };
+
+ /**
+ * Computes the difference of two matrices.
+ *
+ * @param {Matrix2} left The first matrix.
+ * @param {Matrix2} right The second matrix.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ */
+ Matrix2.subtract = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = left[0] - right[0];
+ result[1] = left[1] - right[1];
+ result[2] = left[2] - right[2];
+ result[3] = left[3] - right[3];
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix and a column vector.
+ *
+ * @param {Matrix2} matrix The matrix.
+ * @param {Cartesian2} cartesian The column.
+ * @param {Cartesian2} result The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter.
+ */
+ Matrix2.multiplyByVector = function (matrix, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const x = matrix[0] * cartesian.x + matrix[2] * cartesian.y;
+ const y = matrix[1] * cartesian.x + matrix[3] * cartesian.y;
+
+ result.x = x;
+ result.y = y;
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix and a scalar.
+ *
+ * @param {Matrix2} matrix The matrix.
+ * @param {Number} scalar The number to multiply by.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ */
+ Matrix2.multiplyByScalar = function (matrix, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = matrix[0] * scalar;
+ result[1] = matrix[1] * scalar;
+ result[2] = matrix[2] * scalar;
+ result[3] = matrix[3] * scalar;
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
+ *
+ * @param {Matrix2} matrix The matrix on the left-hand side.
+ * @param {Number} scale The non-uniform scale on the right-hand side.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ *
+ *
+ * @example
+ * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);
+ * Cesium.Matrix2.multiplyByScale(m, scale, m);
+ *
+ * @see Matrix2.multiplyByUniformScale
+ * @see Matrix2.fromScale
+ * @see Matrix2.fromUniformScale
+ * @see Matrix2.setScale
+ * @see Matrix2.setUniformScale
+ * @see Matrix2.getScale
+ */
+ Matrix2.multiplyByScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = matrix[0] * scale.x;
+ result[1] = matrix[1] * scale.x;
+ result[2] = matrix[2] * scale.y;
+ result[3] = matrix[3] * scale.y;
+
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
+ *
+ * @param {Matrix2} matrix The matrix on the left-hand side.
+ * @param {Number} scale The uniform scale on the right-hand side.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ *
+ * @example
+ * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromUniformScale(scale), m);
+ * Cesium.Matrix2.multiplyByUniformScale(m, scale, m);
+ *
+ * @see Matrix2.multiplyByScale
+ * @see Matrix2.fromScale
+ * @see Matrix2.fromUniformScale
+ * @see Matrix2.setScale
+ * @see Matrix2.setUniformScale
+ * @see Matrix2.getScale
+ */
+ Matrix2.multiplyByUniformScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = matrix[0] * scale;
+ result[1] = matrix[1] * scale;
+ result[2] = matrix[2] * scale;
+ result[3] = matrix[3] * scale;
+
+ return result;
+ };
+
+ /**
+ * Creates a negated copy of the provided matrix.
+ *
+ * @param {Matrix2} matrix The matrix to negate.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ */
+ Matrix2.negate = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = -matrix[0];
+ result[1] = -matrix[1];
+ result[2] = -matrix[2];
+ result[3] = -matrix[3];
+ return result;
+ };
+
+ /**
+ * Computes the transpose of the provided matrix.
+ *
+ * @param {Matrix2} matrix The matrix to transpose.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ */
+ Matrix2.transpose = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const column0Row0 = matrix[0];
+ const column0Row1 = matrix[2];
+ const column1Row0 = matrix[1];
+ const column1Row1 = matrix[3];
+
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column1Row0;
+ result[3] = column1Row1;
+ return result;
+ };
+
+ /**
+ * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
+ *
+ * @param {Matrix2} matrix The matrix with signed elements.
+ * @param {Matrix2} result The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter.
+ */
+ Matrix2.abs = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = Math.abs(matrix[0]);
+ result[1] = Math.abs(matrix[1]);
+ result[2] = Math.abs(matrix[2]);
+ result[3] = Math.abs(matrix[3]);
+
+ return result;
+ };
+
+ /**
+ * Compares the provided matrices componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Matrix2} [left] The first matrix.
+ * @param {Matrix2} [right] The second matrix.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ Matrix2.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left[0] === right[0] &&
+ left[1] === right[1] &&
+ left[2] === right[2] &&
+ left[3] === right[3])
+ );
+ };
+
+ /**
+ * @private
+ */
+ Matrix2.equalsArray = function (matrix, array, offset) {
+ return (
+ matrix[0] === array[offset] &&
+ matrix[1] === array[offset + 1] &&
+ matrix[2] === array[offset + 2] &&
+ matrix[3] === array[offset + 3]
+ );
+ };
+
+ /**
+ * Compares the provided matrices componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Matrix2} [left] The first matrix.
+ * @param {Matrix2} [right] The second matrix.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ Matrix2.equalsEpsilon = function (left, right, epsilon) {
+ epsilon = defaultValue.defaultValue(epsilon, 0);
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math.abs(left[0] - right[0]) <= epsilon &&
+ Math.abs(left[1] - right[1]) <= epsilon &&
+ Math.abs(left[2] - right[2]) <= epsilon &&
+ Math.abs(left[3] - right[3]) <= epsilon)
+ );
+ };
+
+ /**
+ * An immutable Matrix2 instance initialized to the identity matrix.
+ *
+ * @type {Matrix2}
+ * @constant
+ */
+ Matrix2.IDENTITY = Object.freeze(new Matrix2(1.0, 0.0, 0.0, 1.0));
+
+ /**
+ * An immutable Matrix2 instance initialized to the zero matrix.
+ *
+ * @type {Matrix2}
+ * @constant
+ */
+ Matrix2.ZERO = Object.freeze(new Matrix2(0.0, 0.0, 0.0, 0.0));
+
+ /**
+ * The index into Matrix2 for column 0, row 0.
+ *
+ * @type {Number}
+ * @constant
+ *
+ * @example
+ * const matrix = new Cesium.Matrix2();
+ * matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0
+ */
+ Matrix2.COLUMN0ROW0 = 0;
+
+ /**
+ * The index into Matrix2 for column 0, row 1.
+ *
+ * @type {Number}
+ * @constant
+ *
+ * @example
+ * const matrix = new Cesium.Matrix2();
+ * matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0
+ */
+ Matrix2.COLUMN0ROW1 = 1;
+
+ /**
+ * The index into Matrix2 for column 1, row 0.
+ *
+ * @type {Number}
+ * @constant
+ *
+ * @example
+ * const matrix = new Cesium.Matrix2();
+ * matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0
+ */
+ Matrix2.COLUMN1ROW0 = 2;
+
+ /**
+ * The index into Matrix2 for column 1, row 1.
+ *
+ * @type {Number}
+ * @constant
+ *
+ * @example
+ * const matrix = new Cesium.Matrix2();
+ * matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0
+ */
+ Matrix2.COLUMN1ROW1 = 3;
+
+ Object.defineProperties(Matrix2.prototype, {
+ /**
+ * Gets the number of items in the collection.
+ * @memberof Matrix2.prototype
+ *
+ * @type {Number}
+ */
+ length: {
+ get: function () {
+ return Matrix2.packedLength;
+ },
+ },
+ });
+
+ /**
+ * Duplicates the provided Matrix2 instance.
+ *
+ * @param {Matrix2} [result] The object onto which to store the result.
+ * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.
+ */
+ Matrix2.prototype.clone = function (result) {
+ return Matrix2.clone(this, result);
+ };
+
+ /**
+ * Compares this matrix to the provided matrix componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Matrix2} [right] The right hand side matrix.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ Matrix2.prototype.equals = function (right) {
+ return Matrix2.equals(this, right);
+ };
+
+ /**
+ * Compares this matrix to the provided matrix componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Matrix2} [right] The right hand side matrix.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.
+ */
+ Matrix2.prototype.equalsEpsilon = function (right, epsilon) {
+ return Matrix2.equalsEpsilon(this, right, epsilon);
+ };
+
+ /**
+ * Creates a string representing this Matrix with each row being
+ * on a separate line and in the format '(column0, column1)'.
+ *
+ * @returns {String} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.
+ */
+ Matrix2.prototype.toString = function () {
+ return `(${this[0]}, ${this[2]})\n` + `(${this[1]}, ${this[3]})`;
+ };
+
+ exports.Cartesian2 = Cartesian2;
+ exports.Cartesian4 = Cartesian4;
+ exports.Matrix2 = Matrix2;
+ exports.Matrix4 = Matrix4;
+ exports.Rectangle = Rectangle;
+
+}));
+//# sourceMappingURL=Matrix2-036c77dd.js.map
diff --git a/examples/cesium/Workers/Matrix2-036c77dd.js.map b/examples/cesium/Workers/Matrix2-036c77dd.js.map
new file mode 100644
index 0000000..9dc81a9
--- /dev/null
+++ b/examples/cesium/Workers/Matrix2-036c77dd.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Matrix2-036c77dd.js","sources":["../../../Source/Core/Cartesian4.js","../../../Source/Core/Matrix4.js","../../../Source/Core/Rectangle.js","../../../Source/Core/Cartesian2.js","../../../Source/Core/Matrix2.js"],"sourcesContent":["import Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\n/**\r\n * A 4D Cartesian point.\r\n * @alias Cartesian4\r\n * @constructor\r\n *\r\n * @param {Number} [x=0.0] The X component.\r\n * @param {Number} [y=0.0] The Y component.\r\n * @param {Number} [z=0.0] The Z component.\r\n * @param {Number} [w=0.0] The W component.\r\n *\r\n * @see Cartesian2\r\n * @see Cartesian3\r\n * @see Packable\r\n */\r\nfunction Cartesian4(x, y, z, w) {\r\n /**\r\n * The X component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.x = defaultValue(x, 0.0);\r\n\r\n /**\r\n * The Y component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.y = defaultValue(y, 0.0);\r\n\r\n /**\r\n * The Z component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.z = defaultValue(z, 0.0);\r\n\r\n /**\r\n * The W component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.w = defaultValue(w, 0.0);\r\n}\r\n\r\n/**\r\n * Creates a Cartesian4 instance from x, y, z and w coordinates.\r\n *\r\n * @param {Number} x The x coordinate.\r\n * @param {Number} y The y coordinate.\r\n * @param {Number} z The z coordinate.\r\n * @param {Number} w The w coordinate.\r\n * @param {Cartesian4} [result] The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\r\n */\r\nCartesian4.fromElements = function (x, y, z, w, result) {\r\n if (!defined(result)) {\r\n return new Cartesian4(x, y, z, w);\r\n }\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Cartesian4 instance from a {@link Color}. red
, green
, blue
,\r\n * and alpha
map to x
, y
, z
, and w
, respectively.\r\n *\r\n * @param {Color} color The source color.\r\n * @param {Cartesian4} [result] The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\r\n */\r\nCartesian4.fromColor = function (color, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"color\", color);\r\n //>>includeEnd('debug');\r\n if (!defined(result)) {\r\n return new Cartesian4(color.red, color.green, color.blue, color.alpha);\r\n }\r\n\r\n result.x = color.red;\r\n result.y = color.green;\r\n result.z = color.blue;\r\n result.w = color.alpha;\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a Cartesian4 instance.\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian to duplicate.\r\n * @param {Cartesian4} [result] The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided. (Returns undefined if cartesian is undefined)\r\n */\r\nCartesian4.clone = function (cartesian, result) {\r\n if (!defined(cartesian)) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Cartesian4(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\r\n }\r\n\r\n result.x = cartesian.x;\r\n result.y = cartesian.y;\r\n result.z = cartesian.z;\r\n result.w = cartesian.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nCartesian4.packedLength = 4;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {Cartesian4} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCartesian4.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value.x;\r\n array[startingIndex++] = value.y;\r\n array[startingIndex++] = value.z;\r\n array[startingIndex] = value.w;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {Cartesian4} [result] The object into which to store the result.\r\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\r\n */\r\nCartesian4.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian4();\r\n }\r\n result.x = array[startingIndex++];\r\n result.y = array[startingIndex++];\r\n result.z = array[startingIndex++];\r\n result.w = array[startingIndex];\r\n return result;\r\n};\r\n\r\n/**\r\n * Flattens an array of Cartesian4s into an array of components.\r\n *\r\n * @param {Cartesian4[]} array The array of cartesians to pack.\r\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.\r\n * @returns {Number[]} The packed array.\r\n */\r\nCartesian4.packArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n const resultLength = length * 4;\r\n if (!defined(result)) {\r\n result = new Array(resultLength);\r\n } else if (!Array.isArray(result) && result.length !== resultLength) {\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(\r\n \"If result is a typed array, it must have exactly array.length * 4 elements\"\r\n );\r\n //>>includeEnd('debug');\r\n } else if (result.length !== resultLength) {\r\n result.length = resultLength;\r\n }\r\n\r\n for (let i = 0; i < length; ++i) {\r\n Cartesian4.pack(array[i], result, i * 4);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Unpacks an array of cartesian components into an array of Cartesian4s.\r\n *\r\n * @param {Number[]} array The array of components to unpack.\r\n * @param {Cartesian4[]} [result] The array onto which to store the result.\r\n * @returns {Cartesian4[]} The unpacked array.\r\n */\r\nCartesian4.unpackArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 4);\r\n if (array.length % 4 !== 0) {\r\n throw new DeveloperError(\"array length must be a multiple of 4.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n if (!defined(result)) {\r\n result = new Array(length / 4);\r\n } else {\r\n result.length = length / 4;\r\n }\r\n\r\n for (let i = 0; i < length; i += 4) {\r\n const index = i / 4;\r\n result[index] = Cartesian4.unpack(array, i, result[index]);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Cartesian4 from four consecutive elements in an array.\r\n * @function\r\n *\r\n * @param {Number[]} array The array whose four consecutive elements correspond to the x, y, z, and w components, respectively.\r\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\r\n * @param {Cartesian4} [result] The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\r\n *\r\n * @example\r\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0)\r\n * const v = [1.0, 2.0, 3.0, 4.0];\r\n * const p = Cesium.Cartesian4.fromArray(v);\r\n *\r\n * // Create a Cartesian4 with (1.0, 2.0, 3.0, 4.0) using an offset into an array\r\n * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0, 4.0];\r\n * const p2 = Cesium.Cartesian4.fromArray(v2, 2);\r\n */\r\nCartesian4.fromArray = Cartesian4.unpack;\r\n\r\n/**\r\n * Computes the value of the maximum component for the supplied Cartesian.\r\n *\r\n * @param {Cartesian4} cartesian The cartesian to use.\r\n * @returns {Number} The value of the maximum component.\r\n */\r\nCartesian4.maximumComponent = function (cartesian) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n return Math.max(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\r\n};\r\n\r\n/**\r\n * Computes the value of the minimum component for the supplied Cartesian.\r\n *\r\n * @param {Cartesian4} cartesian The cartesian to use.\r\n * @returns {Number} The value of the minimum component.\r\n */\r\nCartesian4.minimumComponent = function (cartesian) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n return Math.min(cartesian.x, cartesian.y, cartesian.z, cartesian.w);\r\n};\r\n\r\n/**\r\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\r\n *\r\n * @param {Cartesian4} first A cartesian to compare.\r\n * @param {Cartesian4} second A cartesian to compare.\r\n * @param {Cartesian4} result The object into which to store the result.\r\n * @returns {Cartesian4} A cartesian with the minimum components.\r\n */\r\nCartesian4.minimumByComponent = function (first, second, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"first\", first);\r\n Check.typeOf.object(\"second\", second);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Math.min(first.x, second.x);\r\n result.y = Math.min(first.y, second.y);\r\n result.z = Math.min(first.z, second.z);\r\n result.w = Math.min(first.w, second.w);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\r\n *\r\n * @param {Cartesian4} first A cartesian to compare.\r\n * @param {Cartesian4} second A cartesian to compare.\r\n * @param {Cartesian4} result The object into which to store the result.\r\n * @returns {Cartesian4} A cartesian with the maximum components.\r\n */\r\nCartesian4.maximumByComponent = function (first, second, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"first\", first);\r\n Check.typeOf.object(\"second\", second);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Math.max(first.x, second.x);\r\n result.y = Math.max(first.y, second.y);\r\n result.z = Math.max(first.z, second.z);\r\n result.w = Math.max(first.w, second.w);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Constrain a value to lie between two values.\r\n *\r\n * @param {Cartesian4} value The value to clamp.\r\n * @param {Cartesian4} min The minimum bound.\r\n * @param {Cartesian4} max The maximum bound.\r\n * @param {Cartesian4} result The object into which to store the result.\r\n * @returns {Cartesian4} The clamped value such that min <= result <= max.\r\n */\r\nCartesian4.clamp = function (value, min, max, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.typeOf.object(\"min\", min);\r\n Check.typeOf.object(\"max\", max);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const x = CesiumMath.clamp(value.x, min.x, max.x);\r\n const y = CesiumMath.clamp(value.y, min.y, max.y);\r\n const z = CesiumMath.clamp(value.z, min.z, max.z);\r\n const w = CesiumMath.clamp(value.w, min.w, max.w);\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the provided Cartesian's squared magnitude.\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian instance whose squared magnitude is to be computed.\r\n * @returns {Number} The squared magnitude.\r\n */\r\nCartesian4.magnitudeSquared = function (cartesian) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n return (\r\n cartesian.x * cartesian.x +\r\n cartesian.y * cartesian.y +\r\n cartesian.z * cartesian.z +\r\n cartesian.w * cartesian.w\r\n );\r\n};\r\n\r\n/**\r\n * Computes the Cartesian's magnitude (length).\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian instance whose magnitude is to be computed.\r\n * @returns {Number} The magnitude.\r\n */\r\nCartesian4.magnitude = function (cartesian) {\r\n return Math.sqrt(Cartesian4.magnitudeSquared(cartesian));\r\n};\r\n\r\nconst distanceScratch = new Cartesian4();\r\n\r\n/**\r\n * Computes the 4-space distance between two points.\r\n *\r\n * @param {Cartesian4} left The first point to compute the distance from.\r\n * @param {Cartesian4} right The second point to compute the distance to.\r\n * @returns {Number} The distance between two points.\r\n *\r\n * @example\r\n * // Returns 1.0\r\n * const d = Cesium.Cartesian4.distance(\r\n * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\r\n * new Cesium.Cartesian4(2.0, 0.0, 0.0, 0.0));\r\n */\r\nCartesian4.distance = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian4.subtract(left, right, distanceScratch);\r\n return Cartesian4.magnitude(distanceScratch);\r\n};\r\n\r\n/**\r\n * Computes the squared distance between two points. Comparing squared distances\r\n * using this function is more efficient than comparing distances using {@link Cartesian4#distance}.\r\n *\r\n * @param {Cartesian4} left The first point to compute the distance from.\r\n * @param {Cartesian4} right The second point to compute the distance to.\r\n * @returns {Number} The distance between two points.\r\n *\r\n * @example\r\n * // Returns 4.0, not 2.0\r\n * const d = Cesium.Cartesian4.distance(\r\n * new Cesium.Cartesian4(1.0, 0.0, 0.0, 0.0),\r\n * new Cesium.Cartesian4(3.0, 0.0, 0.0, 0.0));\r\n */\r\nCartesian4.distanceSquared = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian4.subtract(left, right, distanceScratch);\r\n return Cartesian4.magnitudeSquared(distanceScratch);\r\n};\r\n\r\n/**\r\n * Computes the normalized form of the supplied Cartesian.\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian to be normalized.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nCartesian4.normalize = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const magnitude = Cartesian4.magnitude(cartesian);\r\n\r\n result.x = cartesian.x / magnitude;\r\n result.y = cartesian.y / magnitude;\r\n result.z = cartesian.z / magnitude;\r\n result.w = cartesian.w / magnitude;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n isNaN(result.x) ||\r\n isNaN(result.y) ||\r\n isNaN(result.z) ||\r\n isNaN(result.w)\r\n ) {\r\n throw new DeveloperError(\"normalized result is not a number\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the dot (scalar) product of two Cartesians.\r\n *\r\n * @param {Cartesian4} left The first Cartesian.\r\n * @param {Cartesian4} right The second Cartesian.\r\n * @returns {Number} The dot product.\r\n */\r\nCartesian4.dot = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n return (\r\n left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w\r\n );\r\n};\r\n\r\n/**\r\n * Computes the componentwise product of two Cartesians.\r\n *\r\n * @param {Cartesian4} left The first Cartesian.\r\n * @param {Cartesian4} right The second Cartesian.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nCartesian4.multiplyComponents = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x * right.x;\r\n result.y = left.y * right.y;\r\n result.z = left.z * right.z;\r\n result.w = left.w * right.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise quotient of two Cartesians.\r\n *\r\n * @param {Cartesian4} left The first Cartesian.\r\n * @param {Cartesian4} right The second Cartesian.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nCartesian4.divideComponents = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x / right.x;\r\n result.y = left.y / right.y;\r\n result.z = left.z / right.z;\r\n result.w = left.w / right.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise sum of two Cartesians.\r\n *\r\n * @param {Cartesian4} left The first Cartesian.\r\n * @param {Cartesian4} right The second Cartesian.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nCartesian4.add = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x + right.x;\r\n result.y = left.y + right.y;\r\n result.z = left.z + right.z;\r\n result.w = left.w + right.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise difference of two Cartesians.\r\n *\r\n * @param {Cartesian4} left The first Cartesian.\r\n * @param {Cartesian4} right The second Cartesian.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nCartesian4.subtract = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x - right.x;\r\n result.y = left.y - right.y;\r\n result.z = left.z - right.z;\r\n result.w = left.w - right.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Multiplies the provided Cartesian componentwise by the provided scalar.\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian to be scaled.\r\n * @param {Number} scalar The scalar to multiply with.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nCartesian4.multiplyByScalar = function (cartesian, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = cartesian.x * scalar;\r\n result.y = cartesian.y * scalar;\r\n result.z = cartesian.z * scalar;\r\n result.w = cartesian.w * scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Divides the provided Cartesian componentwise by the provided scalar.\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian to be divided.\r\n * @param {Number} scalar The scalar to divide by.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nCartesian4.divideByScalar = function (cartesian, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = cartesian.x / scalar;\r\n result.y = cartesian.y / scalar;\r\n result.z = cartesian.z / scalar;\r\n result.w = cartesian.w / scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Negates the provided Cartesian.\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian to be negated.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nCartesian4.negate = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = -cartesian.x;\r\n result.y = -cartesian.y;\r\n result.z = -cartesian.z;\r\n result.w = -cartesian.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the absolute value of the provided Cartesian.\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian whose absolute value is to be computed.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nCartesian4.abs = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Math.abs(cartesian.x);\r\n result.y = Math.abs(cartesian.y);\r\n result.z = Math.abs(cartesian.z);\r\n result.w = Math.abs(cartesian.w);\r\n return result;\r\n};\r\n\r\nconst lerpScratch = new Cartesian4();\r\n/**\r\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\r\n *\r\n * @param {Cartesian4} start The value corresponding to t at 0.0.\r\n * @param {Cartesian4}end The value corresponding to t at 1.0.\r\n * @param {Number} t The point along t at which to interpolate.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nCartesian4.lerp = function (start, end, t, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"start\", start);\r\n Check.typeOf.object(\"end\", end);\r\n Check.typeOf.number(\"t\", t);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian4.multiplyByScalar(end, t, lerpScratch);\r\n result = Cartesian4.multiplyByScalar(start, 1.0 - t, result);\r\n return Cartesian4.add(lerpScratch, result, result);\r\n};\r\n\r\nconst mostOrthogonalAxisScratch = new Cartesian4();\r\n/**\r\n * Returns the axis that is most orthogonal to the provided Cartesian.\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian on which to find the most orthogonal axis.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The most orthogonal axis.\r\n */\r\nCartesian4.mostOrthogonalAxis = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const f = Cartesian4.normalize(cartesian, mostOrthogonalAxisScratch);\r\n Cartesian4.abs(f, f);\r\n\r\n if (f.x <= f.y) {\r\n if (f.x <= f.z) {\r\n if (f.x <= f.w) {\r\n result = Cartesian4.clone(Cartesian4.UNIT_X, result);\r\n } else {\r\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\r\n }\r\n } else if (f.z <= f.w) {\r\n result = Cartesian4.clone(Cartesian4.UNIT_Z, result);\r\n } else {\r\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\r\n }\r\n } else if (f.y <= f.z) {\r\n if (f.y <= f.w) {\r\n result = Cartesian4.clone(Cartesian4.UNIT_Y, result);\r\n } else {\r\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\r\n }\r\n } else if (f.z <= f.w) {\r\n result = Cartesian4.clone(Cartesian4.UNIT_Z, result);\r\n } else {\r\n result = Cartesian4.clone(Cartesian4.UNIT_W, result);\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided Cartesians componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Cartesian4} [left] The first Cartesian.\r\n * @param {Cartesian4} [right] The second Cartesian.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nCartesian4.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left.x === right.x &&\r\n left.y === right.y &&\r\n left.z === right.z &&\r\n left.w === right.w)\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nCartesian4.equalsArray = function (cartesian, array, offset) {\r\n return (\r\n cartesian.x === array[offset] &&\r\n cartesian.y === array[offset + 1] &&\r\n cartesian.z === array[offset + 2] &&\r\n cartesian.w === array[offset + 3]\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided Cartesians componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {Cartesian4} [left] The first Cartesian.\r\n * @param {Cartesian4} [right] The second Cartesian.\r\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nCartesian4.equalsEpsilon = function (\r\n left,\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n CesiumMath.equalsEpsilon(\r\n left.x,\r\n right.x,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n left.y,\r\n right.y,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n left.z,\r\n right.z,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n left.w,\r\n right.w,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ))\r\n );\r\n};\r\n\r\n/**\r\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 0.0).\r\n *\r\n * @type {Cartesian4}\r\n * @constant\r\n */\r\nCartesian4.ZERO = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 0.0));\r\n\r\n/**\r\n * An immutable Cartesian4 instance initialized to (1.0, 1.0, 1.0, 1.0).\r\n *\r\n * @type {Cartesian4}\r\n * @constant\r\n */\r\nCartesian4.ONE = Object.freeze(new Cartesian4(1.0, 1.0, 1.0, 1.0));\r\n\r\n/**\r\n * An immutable Cartesian4 instance initialized to (1.0, 0.0, 0.0, 0.0).\r\n *\r\n * @type {Cartesian4}\r\n * @constant\r\n */\r\nCartesian4.UNIT_X = Object.freeze(new Cartesian4(1.0, 0.0, 0.0, 0.0));\r\n\r\n/**\r\n * An immutable Cartesian4 instance initialized to (0.0, 1.0, 0.0, 0.0).\r\n *\r\n * @type {Cartesian4}\r\n * @constant\r\n */\r\nCartesian4.UNIT_Y = Object.freeze(new Cartesian4(0.0, 1.0, 0.0, 0.0));\r\n\r\n/**\r\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 1.0, 0.0).\r\n *\r\n * @type {Cartesian4}\r\n * @constant\r\n */\r\nCartesian4.UNIT_Z = Object.freeze(new Cartesian4(0.0, 0.0, 1.0, 0.0));\r\n\r\n/**\r\n * An immutable Cartesian4 instance initialized to (0.0, 0.0, 0.0, 1.0).\r\n *\r\n * @type {Cartesian4}\r\n * @constant\r\n */\r\nCartesian4.UNIT_W = Object.freeze(new Cartesian4(0.0, 0.0, 0.0, 1.0));\r\n\r\n/**\r\n * Duplicates this Cartesian4 instance.\r\n *\r\n * @param {Cartesian4} [result] The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter or a new Cartesian4 instance if one was not provided.\r\n */\r\nCartesian4.prototype.clone = function (result) {\r\n return Cartesian4.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares this Cartesian against the provided Cartesian componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Cartesian4} [right] The right hand side Cartesian.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nCartesian4.prototype.equals = function (right) {\r\n return Cartesian4.equals(this, right);\r\n};\r\n\r\n/**\r\n * Compares this Cartesian against the provided Cartesian componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {Cartesian4} [right] The right hand side Cartesian.\r\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.\r\n */\r\nCartesian4.prototype.equalsEpsilon = function (\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n return Cartesian4.equalsEpsilon(\r\n this,\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n );\r\n};\r\n\r\n/**\r\n * Creates a string representing this Cartesian in the format '(x, y, z, w)'.\r\n *\r\n * @returns {String} A string representing the provided Cartesian in the format '(x, y, z, w)'.\r\n */\r\nCartesian4.prototype.toString = function () {\r\n return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\r\n};\r\n\r\n// scratchU8Array and scratchF32Array are views into the same buffer\r\nconst scratchF32Array = new Float32Array(1);\r\nconst scratchU8Array = new Uint8Array(scratchF32Array.buffer);\r\n\r\nconst testU32 = new Uint32Array([0x11223344]);\r\nconst testU8 = new Uint8Array(testU32.buffer);\r\nconst littleEndian = testU8[0] === 0x44;\r\n\r\n/**\r\n * Packs an arbitrary floating point value to 4 values representable using uint8.\r\n *\r\n * @param {Number} value A floating point number.\r\n * @param {Cartesian4} [result] The Cartesian4 that will contain the packed float.\r\n * @returns {Cartesian4} A Cartesian4 representing the float packed to values in x, y, z, and w.\r\n */\r\nCartesian4.packFloat = function (value, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"value\", value);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian4();\r\n }\r\n\r\n // scratchU8Array and scratchF32Array are views into the same buffer\r\n scratchF32Array[0] = value;\r\n\r\n if (littleEndian) {\r\n result.x = scratchU8Array[0];\r\n result.y = scratchU8Array[1];\r\n result.z = scratchU8Array[2];\r\n result.w = scratchU8Array[3];\r\n } else {\r\n // convert from big-endian to little-endian\r\n result.x = scratchU8Array[3];\r\n result.y = scratchU8Array[2];\r\n result.z = scratchU8Array[1];\r\n result.w = scratchU8Array[0];\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Unpacks a float packed using Cartesian4.packFloat.\r\n *\r\n * @param {Cartesian4} packedFloat A Cartesian4 containing a float packed to 4 values representable using uint8.\r\n * @returns {Number} The unpacked float.\r\n * @private\r\n */\r\nCartesian4.unpackFloat = function (packedFloat) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"packedFloat\", packedFloat);\r\n //>>includeEnd('debug');\r\n\r\n // scratchU8Array and scratchF32Array are views into the same buffer\r\n if (littleEndian) {\r\n scratchU8Array[0] = packedFloat.x;\r\n scratchU8Array[1] = packedFloat.y;\r\n scratchU8Array[2] = packedFloat.z;\r\n scratchU8Array[3] = packedFloat.w;\r\n } else {\r\n // convert from little-endian to big-endian\r\n scratchU8Array[0] = packedFloat.w;\r\n scratchU8Array[1] = packedFloat.z;\r\n scratchU8Array[2] = packedFloat.y;\r\n scratchU8Array[3] = packedFloat.x;\r\n }\r\n return scratchF32Array[0];\r\n};\r\nexport default Cartesian4;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartesian4 from \"./Cartesian4.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport RuntimeError from \"./RuntimeError.js\";\r\n\r\n/**\r\n * A 4x4 matrix, indexable as a column-major order array.\r\n * Constructor parameters are in row-major order for code readability.\r\n * @alias Matrix4\r\n * @constructor\r\n * @implements {ArrayLike}\r\n *\r\n * @param {Number} [column0Row0=0.0] The value for column 0, row 0.\r\n * @param {Number} [column1Row0=0.0] The value for column 1, row 0.\r\n * @param {Number} [column2Row0=0.0] The value for column 2, row 0.\r\n * @param {Number} [column3Row0=0.0] The value for column 3, row 0.\r\n * @param {Number} [column0Row1=0.0] The value for column 0, row 1.\r\n * @param {Number} [column1Row1=0.0] The value for column 1, row 1.\r\n * @param {Number} [column2Row1=0.0] The value for column 2, row 1.\r\n * @param {Number} [column3Row1=0.0] The value for column 3, row 1.\r\n * @param {Number} [column0Row2=0.0] The value for column 0, row 2.\r\n * @param {Number} [column1Row2=0.0] The value for column 1, row 2.\r\n * @param {Number} [column2Row2=0.0] The value for column 2, row 2.\r\n * @param {Number} [column3Row2=0.0] The value for column 3, row 2.\r\n * @param {Number} [column0Row3=0.0] The value for column 0, row 3.\r\n * @param {Number} [column1Row3=0.0] The value for column 1, row 3.\r\n * @param {Number} [column2Row3=0.0] The value for column 2, row 3.\r\n * @param {Number} [column3Row3=0.0] The value for column 3, row 3.\r\n *\r\n * @see Matrix4.fromArray\r\n * @see Matrix4.fromColumnMajorArray\r\n * @see Matrix4.fromRowMajorArray\r\n * @see Matrix4.fromRotationTranslation\r\n * @see Matrix4.fromTranslationQuaternionRotationScale\r\n * @see Matrix4.fromTranslationRotationScale\r\n * @see Matrix4.fromTranslation\r\n * @see Matrix4.fromScale\r\n * @see Matrix4.fromUniformScale\r\n * @see Matrix4.fromRotation\r\n * @see Matrix4.fromCamera\r\n * @see Matrix4.computePerspectiveFieldOfView\r\n * @see Matrix4.computeOrthographicOffCenter\r\n * @see Matrix4.computePerspectiveOffCenter\r\n * @see Matrix4.computeInfinitePerspectiveOffCenter\r\n * @see Matrix4.computeViewportTransformation\r\n * @see Matrix4.computeView\r\n * @see Matrix2\r\n * @see Matrix3\r\n * @see Packable\r\n */\r\nfunction Matrix4(\r\n column0Row0,\r\n column1Row0,\r\n column2Row0,\r\n column3Row0,\r\n column0Row1,\r\n column1Row1,\r\n column2Row1,\r\n column3Row1,\r\n column0Row2,\r\n column1Row2,\r\n column2Row2,\r\n column3Row2,\r\n column0Row3,\r\n column1Row3,\r\n column2Row3,\r\n column3Row3\r\n) {\r\n this[0] = defaultValue(column0Row0, 0.0);\r\n this[1] = defaultValue(column0Row1, 0.0);\r\n this[2] = defaultValue(column0Row2, 0.0);\r\n this[3] = defaultValue(column0Row3, 0.0);\r\n this[4] = defaultValue(column1Row0, 0.0);\r\n this[5] = defaultValue(column1Row1, 0.0);\r\n this[6] = defaultValue(column1Row2, 0.0);\r\n this[7] = defaultValue(column1Row3, 0.0);\r\n this[8] = defaultValue(column2Row0, 0.0);\r\n this[9] = defaultValue(column2Row1, 0.0);\r\n this[10] = defaultValue(column2Row2, 0.0);\r\n this[11] = defaultValue(column2Row3, 0.0);\r\n this[12] = defaultValue(column3Row0, 0.0);\r\n this[13] = defaultValue(column3Row1, 0.0);\r\n this[14] = defaultValue(column3Row2, 0.0);\r\n this[15] = defaultValue(column3Row3, 0.0);\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nMatrix4.packedLength = 16;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {Matrix4} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nMatrix4.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value[0];\r\n array[startingIndex++] = value[1];\r\n array[startingIndex++] = value[2];\r\n array[startingIndex++] = value[3];\r\n array[startingIndex++] = value[4];\r\n array[startingIndex++] = value[5];\r\n array[startingIndex++] = value[6];\r\n array[startingIndex++] = value[7];\r\n array[startingIndex++] = value[8];\r\n array[startingIndex++] = value[9];\r\n array[startingIndex++] = value[10];\r\n array[startingIndex++] = value[11];\r\n array[startingIndex++] = value[12];\r\n array[startingIndex++] = value[13];\r\n array[startingIndex++] = value[14];\r\n array[startingIndex] = value[15];\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {Matrix4} [result] The object into which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\r\n */\r\nMatrix4.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new Matrix4();\r\n }\r\n\r\n result[0] = array[startingIndex++];\r\n result[1] = array[startingIndex++];\r\n result[2] = array[startingIndex++];\r\n result[3] = array[startingIndex++];\r\n result[4] = array[startingIndex++];\r\n result[5] = array[startingIndex++];\r\n result[6] = array[startingIndex++];\r\n result[7] = array[startingIndex++];\r\n result[8] = array[startingIndex++];\r\n result[9] = array[startingIndex++];\r\n result[10] = array[startingIndex++];\r\n result[11] = array[startingIndex++];\r\n result[12] = array[startingIndex++];\r\n result[13] = array[startingIndex++];\r\n result[14] = array[startingIndex++];\r\n result[15] = array[startingIndex];\r\n return result;\r\n};\r\n\r\n/**\r\n * Flattens an array of Matrix4s into an array of components. The components\r\n * are stored in column-major order.\r\n *\r\n * @param {Matrix4[]} array The array of matrices to pack.\r\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 16 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 16) elements.\r\n * @returns {Number[]} The packed array.\r\n */\r\nMatrix4.packArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n const resultLength = length * 16;\r\n if (!defined(result)) {\r\n result = new Array(resultLength);\r\n } else if (!Array.isArray(result) && result.length !== resultLength) {\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(\r\n \"If result is a typed array, it must have exactly array.length * 16 elements\"\r\n );\r\n //>>includeEnd('debug');\r\n } else if (result.length !== resultLength) {\r\n result.length = resultLength;\r\n }\r\n\r\n for (let i = 0; i < length; ++i) {\r\n Matrix4.pack(array[i], result, i * 16);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Unpacks an array of column-major matrix components into an array of Matrix4s.\r\n *\r\n * @param {Number[]} array The array of components to unpack.\r\n * @param {Matrix4[]} [result] The array onto which to store the result.\r\n * @returns {Matrix4[]} The unpacked array.\r\n */\r\nMatrix4.unpackArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 16);\r\n if (array.length % 16 !== 0) {\r\n throw new DeveloperError(\"array length must be a multiple of 16.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n if (!defined(result)) {\r\n result = new Array(length / 16);\r\n } else {\r\n result.length = length / 16;\r\n }\r\n\r\n for (let i = 0; i < length; i += 16) {\r\n const index = i / 16;\r\n result[index] = Matrix4.unpack(array, i, result[index]);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a Matrix4 instance.\r\n *\r\n * @param {Matrix4} matrix The matrix to duplicate.\r\n * @param {Matrix4} [result] The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided. (Returns undefined if matrix is undefined)\r\n */\r\nMatrix4.clone = function (matrix, result) {\r\n if (!defined(matrix)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n return new Matrix4(\r\n matrix[0],\r\n matrix[4],\r\n matrix[8],\r\n matrix[12],\r\n matrix[1],\r\n matrix[5],\r\n matrix[9],\r\n matrix[13],\r\n matrix[2],\r\n matrix[6],\r\n matrix[10],\r\n matrix[14],\r\n matrix[3],\r\n matrix[7],\r\n matrix[11],\r\n matrix[15]\r\n );\r\n }\r\n result[0] = matrix[0];\r\n result[1] = matrix[1];\r\n result[2] = matrix[2];\r\n result[3] = matrix[3];\r\n result[4] = matrix[4];\r\n result[5] = matrix[5];\r\n result[6] = matrix[6];\r\n result[7] = matrix[7];\r\n result[8] = matrix[8];\r\n result[9] = matrix[9];\r\n result[10] = matrix[10];\r\n result[11] = matrix[11];\r\n result[12] = matrix[12];\r\n result[13] = matrix[13];\r\n result[14] = matrix[14];\r\n result[15] = matrix[15];\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Matrix4 from 16 consecutive elements in an array.\r\n * @function\r\n *\r\n * @param {Number[]} array The array whose 16 consecutive elements correspond to the positions of the matrix. Assumes column-major order.\r\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.\r\n * @param {Matrix4} [result] The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\r\n *\r\n * @example\r\n * // Create the Matrix4:\r\n * // [1.0, 2.0, 3.0, 4.0]\r\n * // [1.0, 2.0, 3.0, 4.0]\r\n * // [1.0, 2.0, 3.0, 4.0]\r\n * // [1.0, 2.0, 3.0, 4.0]\r\n *\r\n * const v = [1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];\r\n * const m = Cesium.Matrix4.fromArray(v);\r\n *\r\n * // Create same Matrix4 with using an offset into an array\r\n * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0];\r\n * const m2 = Cesium.Matrix4.fromArray(v2, 2);\r\n */\r\nMatrix4.fromArray = Matrix4.unpack;\r\n\r\n/**\r\n * Computes a Matrix4 instance from a column-major order array.\r\n *\r\n * @param {Number[]} values The column-major order array.\r\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\r\n */\r\nMatrix4.fromColumnMajorArray = function (values, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"values\", values);\r\n //>>includeEnd('debug');\r\n\r\n return Matrix4.clone(values, result);\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance from a row-major order array.\r\n * The resulting matrix will be in column-major order.\r\n *\r\n * @param {Number[]} values The row-major order array.\r\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\r\n */\r\nMatrix4.fromRowMajorArray = function (values, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"values\", values);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Matrix4(\r\n values[0],\r\n values[1],\r\n values[2],\r\n values[3],\r\n values[4],\r\n values[5],\r\n values[6],\r\n values[7],\r\n values[8],\r\n values[9],\r\n values[10],\r\n values[11],\r\n values[12],\r\n values[13],\r\n values[14],\r\n values[15]\r\n );\r\n }\r\n result[0] = values[0];\r\n result[1] = values[4];\r\n result[2] = values[8];\r\n result[3] = values[12];\r\n result[4] = values[1];\r\n result[5] = values[5];\r\n result[6] = values[9];\r\n result[7] = values[13];\r\n result[8] = values[2];\r\n result[9] = values[6];\r\n result[10] = values[10];\r\n result[11] = values[14];\r\n result[12] = values[3];\r\n result[13] = values[7];\r\n result[14] = values[11];\r\n result[15] = values[15];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance from a Matrix3 representing the rotation\r\n * and a Cartesian3 representing the translation.\r\n *\r\n * @param {Matrix3} rotation The upper left portion of the matrix representing the rotation.\r\n * @param {Cartesian3} [translation=Cartesian3.ZERO] The upper right portion of the matrix representing the translation.\r\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\r\n */\r\nMatrix4.fromRotationTranslation = function (rotation, translation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rotation\", rotation);\r\n //>>includeEnd('debug');\r\n\r\n translation = defaultValue(translation, Cartesian3.ZERO);\r\n\r\n if (!defined(result)) {\r\n return new Matrix4(\r\n rotation[0],\r\n rotation[3],\r\n rotation[6],\r\n translation.x,\r\n rotation[1],\r\n rotation[4],\r\n rotation[7],\r\n translation.y,\r\n rotation[2],\r\n rotation[5],\r\n rotation[8],\r\n translation.z,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0\r\n );\r\n }\r\n\r\n result[0] = rotation[0];\r\n result[1] = rotation[1];\r\n result[2] = rotation[2];\r\n result[3] = 0.0;\r\n result[4] = rotation[3];\r\n result[5] = rotation[4];\r\n result[6] = rotation[5];\r\n result[7] = 0.0;\r\n result[8] = rotation[6];\r\n result[9] = rotation[7];\r\n result[10] = rotation[8];\r\n result[11] = 0.0;\r\n result[12] = translation.x;\r\n result[13] = translation.y;\r\n result[14] = translation.z;\r\n result[15] = 1.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance from a translation, rotation, and scale (TRS)\r\n * representation with the rotation represented as a quaternion.\r\n *\r\n * @param {Cartesian3} translation The translation transformation.\r\n * @param {Quaternion} rotation The rotation transformation.\r\n * @param {Cartesian3} scale The non-uniform scale transformation.\r\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\r\n *\r\n * @example\r\n * const result = Cesium.Matrix4.fromTranslationQuaternionRotationScale(\r\n * new Cesium.Cartesian3(1.0, 2.0, 3.0), // translation\r\n * Cesium.Quaternion.IDENTITY, // rotation\r\n * new Cesium.Cartesian3(7.0, 8.0, 9.0), // scale\r\n * result);\r\n */\r\nMatrix4.fromTranslationQuaternionRotationScale = function (\r\n translation,\r\n rotation,\r\n scale,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"translation\", translation);\r\n Check.typeOf.object(\"rotation\", rotation);\r\n Check.typeOf.object(\"scale\", scale);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Matrix4();\r\n }\r\n\r\n const scaleX = scale.x;\r\n const scaleY = scale.y;\r\n const scaleZ = scale.z;\r\n\r\n const x2 = rotation.x * rotation.x;\r\n const xy = rotation.x * rotation.y;\r\n const xz = rotation.x * rotation.z;\r\n const xw = rotation.x * rotation.w;\r\n const y2 = rotation.y * rotation.y;\r\n const yz = rotation.y * rotation.z;\r\n const yw = rotation.y * rotation.w;\r\n const z2 = rotation.z * rotation.z;\r\n const zw = rotation.z * rotation.w;\r\n const w2 = rotation.w * rotation.w;\r\n\r\n const m00 = x2 - y2 - z2 + w2;\r\n const m01 = 2.0 * (xy - zw);\r\n const m02 = 2.0 * (xz + yw);\r\n\r\n const m10 = 2.0 * (xy + zw);\r\n const m11 = -x2 + y2 - z2 + w2;\r\n const m12 = 2.0 * (yz - xw);\r\n\r\n const m20 = 2.0 * (xz - yw);\r\n const m21 = 2.0 * (yz + xw);\r\n const m22 = -x2 - y2 + z2 + w2;\r\n\r\n result[0] = m00 * scaleX;\r\n result[1] = m10 * scaleX;\r\n result[2] = m20 * scaleX;\r\n result[3] = 0.0;\r\n result[4] = m01 * scaleY;\r\n result[5] = m11 * scaleY;\r\n result[6] = m21 * scaleY;\r\n result[7] = 0.0;\r\n result[8] = m02 * scaleZ;\r\n result[9] = m12 * scaleZ;\r\n result[10] = m22 * scaleZ;\r\n result[11] = 0.0;\r\n result[12] = translation.x;\r\n result[13] = translation.y;\r\n result[14] = translation.z;\r\n result[15] = 1.0;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Matrix4 instance from a {@link TranslationRotationScale} instance.\r\n *\r\n * @param {TranslationRotationScale} translationRotationScale The instance.\r\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\r\n */\r\nMatrix4.fromTranslationRotationScale = function (\r\n translationRotationScale,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"translationRotationScale\", translationRotationScale);\r\n //>>includeEnd('debug');\r\n\r\n return Matrix4.fromTranslationQuaternionRotationScale(\r\n translationRotationScale.translation,\r\n translationRotationScale.rotation,\r\n translationRotationScale.scale,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Creates a Matrix4 instance from a Cartesian3 representing the translation.\r\n *\r\n * @param {Cartesian3} translation The upper right portion of the matrix representing the translation.\r\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\r\n *\r\n * @see Matrix4.multiplyByTranslation\r\n */\r\nMatrix4.fromTranslation = function (translation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"translation\", translation);\r\n //>>includeEnd('debug');\r\n\r\n return Matrix4.fromRotationTranslation(Matrix3.IDENTITY, translation, result);\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance representing a non-uniform scale.\r\n *\r\n * @param {Cartesian3} scale The x, y, and z scale factors.\r\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\r\n *\r\n * @example\r\n * // Creates\r\n * // [7.0, 0.0, 0.0, 0.0]\r\n * // [0.0, 8.0, 0.0, 0.0]\r\n * // [0.0, 0.0, 9.0, 0.0]\r\n * // [0.0, 0.0, 0.0, 1.0]\r\n * const m = Cesium.Matrix4.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));\r\n */\r\nMatrix4.fromScale = function (scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"scale\", scale);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Matrix4(\r\n scale.x,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n scale.y,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n scale.z,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0\r\n );\r\n }\r\n\r\n result[0] = scale.x;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = 0.0;\r\n result[5] = scale.y;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = 0.0;\r\n result[9] = 0.0;\r\n result[10] = scale.z;\r\n result[11] = 0.0;\r\n result[12] = 0.0;\r\n result[13] = 0.0;\r\n result[14] = 0.0;\r\n result[15] = 1.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance representing a uniform scale.\r\n *\r\n * @param {Number} scale The uniform scale factor.\r\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\r\n *\r\n * @example\r\n * // Creates\r\n * // [2.0, 0.0, 0.0, 0.0]\r\n * // [0.0, 2.0, 0.0, 0.0]\r\n * // [0.0, 0.0, 2.0, 0.0]\r\n * // [0.0, 0.0, 0.0, 1.0]\r\n * const m = Cesium.Matrix4.fromUniformScale(2.0);\r\n */\r\nMatrix4.fromUniformScale = function (scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"scale\", scale);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Matrix4(\r\n scale,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n scale,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n scale,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0\r\n );\r\n }\r\n\r\n result[0] = scale;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = 0.0;\r\n result[5] = scale;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = 0.0;\r\n result[9] = 0.0;\r\n result[10] = scale;\r\n result[11] = 0.0;\r\n result[12] = 0.0;\r\n result[13] = 0.0;\r\n result[14] = 0.0;\r\n result[15] = 1.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a rotation matrix.\r\n *\r\n * @param {Matrix3} rotation The rotation matrix.\r\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\r\n */\r\nMatrix4.fromRotation = function (rotation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rotation\", rotation);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Matrix4();\r\n }\r\n result[0] = rotation[0];\r\n result[1] = rotation[1];\r\n result[2] = rotation[2];\r\n result[3] = 0.0;\r\n\r\n result[4] = rotation[3];\r\n result[5] = rotation[4];\r\n result[6] = rotation[5];\r\n result[7] = 0.0;\r\n\r\n result[8] = rotation[6];\r\n result[9] = rotation[7];\r\n result[10] = rotation[8];\r\n result[11] = 0.0;\r\n\r\n result[12] = 0.0;\r\n result[13] = 0.0;\r\n result[14] = 0.0;\r\n result[15] = 1.0;\r\n\r\n return result;\r\n};\r\n\r\nconst fromCameraF = new Cartesian3();\r\nconst fromCameraR = new Cartesian3();\r\nconst fromCameraU = new Cartesian3();\r\n\r\n/**\r\n * Computes a Matrix4 instance from a Camera.\r\n *\r\n * @param {Camera} camera The camera to use.\r\n * @param {Matrix4} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix4} The modified result parameter, or a new Matrix4 instance if one was not provided.\r\n */\r\nMatrix4.fromCamera = function (camera, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"camera\", camera);\r\n //>>includeEnd('debug');\r\n\r\n const position = camera.position;\r\n const direction = camera.direction;\r\n const up = camera.up;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"camera.position\", position);\r\n Check.typeOf.object(\"camera.direction\", direction);\r\n Check.typeOf.object(\"camera.up\", up);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian3.normalize(direction, fromCameraF);\r\n Cartesian3.normalize(\r\n Cartesian3.cross(fromCameraF, up, fromCameraR),\r\n fromCameraR\r\n );\r\n Cartesian3.normalize(\r\n Cartesian3.cross(fromCameraR, fromCameraF, fromCameraU),\r\n fromCameraU\r\n );\r\n\r\n const sX = fromCameraR.x;\r\n const sY = fromCameraR.y;\r\n const sZ = fromCameraR.z;\r\n const fX = fromCameraF.x;\r\n const fY = fromCameraF.y;\r\n const fZ = fromCameraF.z;\r\n const uX = fromCameraU.x;\r\n const uY = fromCameraU.y;\r\n const uZ = fromCameraU.z;\r\n const positionX = position.x;\r\n const positionY = position.y;\r\n const positionZ = position.z;\r\n const t0 = sX * -positionX + sY * -positionY + sZ * -positionZ;\r\n const t1 = uX * -positionX + uY * -positionY + uZ * -positionZ;\r\n const t2 = fX * positionX + fY * positionY + fZ * positionZ;\r\n\r\n // The code below this comment is an optimized\r\n // version of the commented lines.\r\n // Rather that create two matrices and then multiply,\r\n // we just bake in the multiplcation as part of creation.\r\n // const rotation = new Matrix4(\r\n // sX, sY, sZ, 0.0,\r\n // uX, uY, uZ, 0.0,\r\n // -fX, -fY, -fZ, 0.0,\r\n // 0.0, 0.0, 0.0, 1.0);\r\n // const translation = new Matrix4(\r\n // 1.0, 0.0, 0.0, -position.x,\r\n // 0.0, 1.0, 0.0, -position.y,\r\n // 0.0, 0.0, 1.0, -position.z,\r\n // 0.0, 0.0, 0.0, 1.0);\r\n // return rotation.multiply(translation);\r\n if (!defined(result)) {\r\n return new Matrix4(\r\n sX,\r\n sY,\r\n sZ,\r\n t0,\r\n uX,\r\n uY,\r\n uZ,\r\n t1,\r\n -fX,\r\n -fY,\r\n -fZ,\r\n t2,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0\r\n );\r\n }\r\n result[0] = sX;\r\n result[1] = uX;\r\n result[2] = -fX;\r\n result[3] = 0.0;\r\n result[4] = sY;\r\n result[5] = uY;\r\n result[6] = -fY;\r\n result[7] = 0.0;\r\n result[8] = sZ;\r\n result[9] = uZ;\r\n result[10] = -fZ;\r\n result[11] = 0.0;\r\n result[12] = t0;\r\n result[13] = t1;\r\n result[14] = t2;\r\n result[15] = 1.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance representing a perspective transformation matrix.\r\n *\r\n * @param {Number} fovY The field of view along the Y axis in radians.\r\n * @param {Number} aspectRatio The aspect ratio.\r\n * @param {Number} near The distance to the near plane in meters.\r\n * @param {Number} far The distance to the far plane in meters.\r\n * @param {Matrix4} result The object in which the result will be stored.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} fovY must be in (0, PI].\r\n * @exception {DeveloperError} aspectRatio must be greater than zero.\r\n * @exception {DeveloperError} near must be greater than zero.\r\n * @exception {DeveloperError} far must be greater than zero.\r\n */\r\nMatrix4.computePerspectiveFieldOfView = function (\r\n fovY,\r\n aspectRatio,\r\n near,\r\n far,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.greaterThan(\"fovY\", fovY, 0.0);\r\n Check.typeOf.number.lessThan(\"fovY\", fovY, Math.PI);\r\n Check.typeOf.number.greaterThan(\"near\", near, 0.0);\r\n Check.typeOf.number.greaterThan(\"far\", far, 0.0);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const bottom = Math.tan(fovY * 0.5);\r\n\r\n const column1Row1 = 1.0 / bottom;\r\n const column0Row0 = column1Row1 / aspectRatio;\r\n const column2Row2 = (far + near) / (near - far);\r\n const column3Row2 = (2.0 * far * near) / (near - far);\r\n\r\n result[0] = column0Row0;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = 0.0;\r\n result[5] = column1Row1;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = 0.0;\r\n result[9] = 0.0;\r\n result[10] = column2Row2;\r\n result[11] = -1.0;\r\n result[12] = 0.0;\r\n result[13] = 0.0;\r\n result[14] = column3Row2;\r\n result[15] = 0.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance representing an orthographic transformation matrix.\r\n *\r\n * @param {Number} left The number of meters to the left of the camera that will be in view.\r\n * @param {Number} right The number of meters to the right of the camera that will be in view.\r\n * @param {Number} bottom The number of meters below of the camera that will be in view.\r\n * @param {Number} top The number of meters above of the camera that will be in view.\r\n * @param {Number} near The distance to the near plane in meters.\r\n * @param {Number} far The distance to the far plane in meters.\r\n * @param {Matrix4} result The object in which the result will be stored.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.computeOrthographicOffCenter = function (\r\n left,\r\n right,\r\n bottom,\r\n top,\r\n near,\r\n far,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"left\", left);\r\n Check.typeOf.number(\"right\", right);\r\n Check.typeOf.number(\"bottom\", bottom);\r\n Check.typeOf.number(\"top\", top);\r\n Check.typeOf.number(\"near\", near);\r\n Check.typeOf.number(\"far\", far);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n let a = 1.0 / (right - left);\r\n let b = 1.0 / (top - bottom);\r\n let c = 1.0 / (far - near);\r\n\r\n const tx = -(right + left) * a;\r\n const ty = -(top + bottom) * b;\r\n const tz = -(far + near) * c;\r\n a *= 2.0;\r\n b *= 2.0;\r\n c *= -2.0;\r\n\r\n result[0] = a;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = 0.0;\r\n result[5] = b;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = 0.0;\r\n result[9] = 0.0;\r\n result[10] = c;\r\n result[11] = 0.0;\r\n result[12] = tx;\r\n result[13] = ty;\r\n result[14] = tz;\r\n result[15] = 1.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance representing an off center perspective transformation.\r\n *\r\n * @param {Number} left The number of meters to the left of the camera that will be in view.\r\n * @param {Number} right The number of meters to the right of the camera that will be in view.\r\n * @param {Number} bottom The number of meters below of the camera that will be in view.\r\n * @param {Number} top The number of meters above of the camera that will be in view.\r\n * @param {Number} near The distance to the near plane in meters.\r\n * @param {Number} far The distance to the far plane in meters.\r\n * @param {Matrix4} result The object in which the result will be stored.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.computePerspectiveOffCenter = function (\r\n left,\r\n right,\r\n bottom,\r\n top,\r\n near,\r\n far,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"left\", left);\r\n Check.typeOf.number(\"right\", right);\r\n Check.typeOf.number(\"bottom\", bottom);\r\n Check.typeOf.number(\"top\", top);\r\n Check.typeOf.number(\"near\", near);\r\n Check.typeOf.number(\"far\", far);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const column0Row0 = (2.0 * near) / (right - left);\r\n const column1Row1 = (2.0 * near) / (top - bottom);\r\n const column2Row0 = (right + left) / (right - left);\r\n const column2Row1 = (top + bottom) / (top - bottom);\r\n const column2Row2 = -(far + near) / (far - near);\r\n const column2Row3 = -1.0;\r\n const column3Row2 = (-2.0 * far * near) / (far - near);\r\n\r\n result[0] = column0Row0;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = 0.0;\r\n result[5] = column1Row1;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = column2Row0;\r\n result[9] = column2Row1;\r\n result[10] = column2Row2;\r\n result[11] = column2Row3;\r\n result[12] = 0.0;\r\n result[13] = 0.0;\r\n result[14] = column3Row2;\r\n result[15] = 0.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance representing an infinite off center perspective transformation.\r\n *\r\n * @param {Number} left The number of meters to the left of the camera that will be in view.\r\n * @param {Number} right The number of meters to the right of the camera that will be in view.\r\n * @param {Number} bottom The number of meters below of the camera that will be in view.\r\n * @param {Number} top The number of meters above of the camera that will be in view.\r\n * @param {Number} near The distance to the near plane in meters.\r\n * @param {Matrix4} result The object in which the result will be stored.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.computeInfinitePerspectiveOffCenter = function (\r\n left,\r\n right,\r\n bottom,\r\n top,\r\n near,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"left\", left);\r\n Check.typeOf.number(\"right\", right);\r\n Check.typeOf.number(\"bottom\", bottom);\r\n Check.typeOf.number(\"top\", top);\r\n Check.typeOf.number(\"near\", near);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const column0Row0 = (2.0 * near) / (right - left);\r\n const column1Row1 = (2.0 * near) / (top - bottom);\r\n const column2Row0 = (right + left) / (right - left);\r\n const column2Row1 = (top + bottom) / (top - bottom);\r\n const column2Row2 = -1.0;\r\n const column2Row3 = -1.0;\r\n const column3Row2 = -2.0 * near;\r\n\r\n result[0] = column0Row0;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = 0.0;\r\n result[5] = column1Row1;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = column2Row0;\r\n result[9] = column2Row1;\r\n result[10] = column2Row2;\r\n result[11] = column2Row3;\r\n result[12] = 0.0;\r\n result[13] = 0.0;\r\n result[14] = column3Row2;\r\n result[15] = 0.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance that transforms from normalized device coordinates to window coordinates.\r\n *\r\n * @param {Object} [viewport = { x : 0.0, y : 0.0, width : 0.0, height : 0.0 }] The viewport's corners as shown in Example 1.\r\n * @param {Number} [nearDepthRange=0.0] The near plane distance in window coordinates.\r\n * @param {Number} [farDepthRange=1.0] The far plane distance in window coordinates.\r\n * @param {Matrix4} [result] The object in which the result will be stored.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @example\r\n * // Create viewport transformation using an explicit viewport and depth range.\r\n * const m = Cesium.Matrix4.computeViewportTransformation({\r\n * x : 0.0,\r\n * y : 0.0,\r\n * width : 1024.0,\r\n * height : 768.0\r\n * }, 0.0, 1.0, new Cesium.Matrix4());\r\n */\r\nMatrix4.computeViewportTransformation = function (\r\n viewport,\r\n nearDepthRange,\r\n farDepthRange,\r\n result\r\n) {\r\n if (!defined(result)) {\r\n result = new Matrix4();\r\n }\r\n\r\n viewport = defaultValue(viewport, defaultValue.EMPTY_OBJECT);\r\n const x = defaultValue(viewport.x, 0.0);\r\n const y = defaultValue(viewport.y, 0.0);\r\n const width = defaultValue(viewport.width, 0.0);\r\n const height = defaultValue(viewport.height, 0.0);\r\n nearDepthRange = defaultValue(nearDepthRange, 0.0);\r\n farDepthRange = defaultValue(farDepthRange, 1.0);\r\n\r\n const halfWidth = width * 0.5;\r\n const halfHeight = height * 0.5;\r\n const halfDepth = (farDepthRange - nearDepthRange) * 0.5;\r\n\r\n const column0Row0 = halfWidth;\r\n const column1Row1 = halfHeight;\r\n const column2Row2 = halfDepth;\r\n const column3Row0 = x + halfWidth;\r\n const column3Row1 = y + halfHeight;\r\n const column3Row2 = nearDepthRange + halfDepth;\r\n const column3Row3 = 1.0;\r\n\r\n result[0] = column0Row0;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = 0.0;\r\n result[5] = column1Row1;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = 0.0;\r\n result[9] = 0.0;\r\n result[10] = column2Row2;\r\n result[11] = 0.0;\r\n result[12] = column3Row0;\r\n result[13] = column3Row1;\r\n result[14] = column3Row2;\r\n result[15] = column3Row3;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix4 instance that transforms from world space to view space.\r\n *\r\n * @param {Cartesian3} position The position of the camera.\r\n * @param {Cartesian3} direction The forward direction.\r\n * @param {Cartesian3} up The up direction.\r\n * @param {Cartesian3} right The right direction.\r\n * @param {Matrix4} result The object in which the result will be stored.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.computeView = function (position, direction, up, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"position\", position);\r\n Check.typeOf.object(\"direction\", direction);\r\n Check.typeOf.object(\"up\", up);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = right.x;\r\n result[1] = up.x;\r\n result[2] = -direction.x;\r\n result[3] = 0.0;\r\n result[4] = right.y;\r\n result[5] = up.y;\r\n result[6] = -direction.y;\r\n result[7] = 0.0;\r\n result[8] = right.z;\r\n result[9] = up.z;\r\n result[10] = -direction.z;\r\n result[11] = 0.0;\r\n result[12] = -Cartesian3.dot(right, position);\r\n result[13] = -Cartesian3.dot(up, position);\r\n result[14] = Cartesian3.dot(direction, position);\r\n result[15] = 1.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes an Array from the provided Matrix4 instance.\r\n * The array will be in column-major order.\r\n *\r\n * @param {Matrix4} matrix The matrix to use..\r\n * @param {Number[]} [result] The Array onto which to store the result.\r\n * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided.\r\n *\r\n * @example\r\n * //create an array from an instance of Matrix4\r\n * // m = [10.0, 14.0, 18.0, 22.0]\r\n * // [11.0, 15.0, 19.0, 23.0]\r\n * // [12.0, 16.0, 20.0, 24.0]\r\n * // [13.0, 17.0, 21.0, 25.0]\r\n * const a = Cesium.Matrix4.toArray(m);\r\n *\r\n * // m remains the same\r\n * //creates a = [10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0]\r\n */\r\nMatrix4.toArray = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return [\r\n matrix[0],\r\n matrix[1],\r\n matrix[2],\r\n matrix[3],\r\n matrix[4],\r\n matrix[5],\r\n matrix[6],\r\n matrix[7],\r\n matrix[8],\r\n matrix[9],\r\n matrix[10],\r\n matrix[11],\r\n matrix[12],\r\n matrix[13],\r\n matrix[14],\r\n matrix[15],\r\n ];\r\n }\r\n result[0] = matrix[0];\r\n result[1] = matrix[1];\r\n result[2] = matrix[2];\r\n result[3] = matrix[3];\r\n result[4] = matrix[4];\r\n result[5] = matrix[5];\r\n result[6] = matrix[6];\r\n result[7] = matrix[7];\r\n result[8] = matrix[8];\r\n result[9] = matrix[9];\r\n result[10] = matrix[10];\r\n result[11] = matrix[11];\r\n result[12] = matrix[12];\r\n result[13] = matrix[13];\r\n result[14] = matrix[14];\r\n result[15] = matrix[15];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the array index of the element at the provided row and column.\r\n *\r\n * @param {Number} row The zero-based index of the row.\r\n * @param {Number} column The zero-based index of the column.\r\n * @returns {Number} The index of the element at the provided row and column.\r\n *\r\n * @exception {DeveloperError} row must be 0, 1, 2, or 3.\r\n * @exception {DeveloperError} column must be 0, 1, 2, or 3.\r\n *\r\n * @example\r\n * const myMatrix = new Cesium.Matrix4();\r\n * const column1Row0Index = Cesium.Matrix4.getElementIndex(1, 0);\r\n * const column1Row0 = myMatrix[column1Row0Index];\r\n * myMatrix[column1Row0Index] = 10.0;\r\n */\r\nMatrix4.getElementIndex = function (column, row) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.greaterThanOrEquals(\"row\", row, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"row\", row, 3);\r\n\r\n Check.typeOf.number.greaterThanOrEquals(\"column\", column, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"column\", column, 3);\r\n //>>includeEnd('debug');\r\n\r\n return column * 4 + row;\r\n};\r\n\r\n/**\r\n * Retrieves a copy of the matrix column at the provided index as a Cartesian4 instance.\r\n *\r\n * @param {Matrix4} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the column to retrieve.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\r\n *\r\n * @example\r\n * //returns a Cartesian4 instance with values from the specified column\r\n * // m = [10.0, 11.0, 12.0, 13.0]\r\n * // [14.0, 15.0, 16.0, 17.0]\r\n * // [18.0, 19.0, 20.0, 21.0]\r\n * // [22.0, 23.0, 24.0, 25.0]\r\n *\r\n * //Example 1: Creates an instance of Cartesian\r\n * const a = Cesium.Matrix4.getColumn(m, 2, new Cesium.Cartesian4());\r\n *\r\n * @example\r\n * //Example 2: Sets values for Cartesian instance\r\n * const a = new Cesium.Cartesian4();\r\n * Cesium.Matrix4.getColumn(m, 2, a);\r\n *\r\n * // a.x = 12.0; a.y = 16.0; a.z = 20.0; a.w = 24.0;\r\n */\r\nMatrix4.getColumn = function (matrix, index, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 3);\r\n\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const startIndex = index * 4;\r\n const x = matrix[startIndex];\r\n const y = matrix[startIndex + 1];\r\n const z = matrix[startIndex + 2];\r\n const w = matrix[startIndex + 3];\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian4 instance.\r\n *\r\n * @param {Matrix4} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the column to set.\r\n * @param {Cartesian4} cartesian The Cartesian whose values will be assigned to the specified column.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\r\n *\r\n * @example\r\n * //creates a new Matrix4 instance with new column values from the Cartesian4 instance\r\n * // m = [10.0, 11.0, 12.0, 13.0]\r\n * // [14.0, 15.0, 16.0, 17.0]\r\n * // [18.0, 19.0, 20.0, 21.0]\r\n * // [22.0, 23.0, 24.0, 25.0]\r\n *\r\n * const a = Cesium.Matrix4.setColumn(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());\r\n *\r\n * // m remains the same\r\n * // a = [10.0, 11.0, 99.0, 13.0]\r\n * // [14.0, 15.0, 98.0, 17.0]\r\n * // [18.0, 19.0, 97.0, 21.0]\r\n * // [22.0, 23.0, 96.0, 25.0]\r\n */\r\nMatrix4.setColumn = function (matrix, index, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 3);\r\n\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result = Matrix4.clone(matrix, result);\r\n const startIndex = index * 4;\r\n result[startIndex] = cartesian.x;\r\n result[startIndex + 1] = cartesian.y;\r\n result[startIndex + 2] = cartesian.z;\r\n result[startIndex + 3] = cartesian.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Retrieves a copy of the matrix row at the provided index as a Cartesian4 instance.\r\n *\r\n * @param {Matrix4} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the row to retrieve.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\r\n *\r\n * @example\r\n * //returns a Cartesian4 instance with values from the specified column\r\n * // m = [10.0, 11.0, 12.0, 13.0]\r\n * // [14.0, 15.0, 16.0, 17.0]\r\n * // [18.0, 19.0, 20.0, 21.0]\r\n * // [22.0, 23.0, 24.0, 25.0]\r\n *\r\n * //Example 1: Returns an instance of Cartesian\r\n * const a = Cesium.Matrix4.getRow(m, 2, new Cesium.Cartesian4());\r\n *\r\n * @example\r\n * //Example 2: Sets values for a Cartesian instance\r\n * const a = new Cesium.Cartesian4();\r\n * Cesium.Matrix4.getRow(m, 2, a);\r\n *\r\n * // a.x = 18.0; a.y = 19.0; a.z = 20.0; a.w = 21.0;\r\n */\r\nMatrix4.getRow = function (matrix, index, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 3);\r\n\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const x = matrix[index];\r\n const y = matrix[index + 4];\r\n const z = matrix[index + 8];\r\n const w = matrix[index + 12];\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian4 instance.\r\n *\r\n * @param {Matrix4} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the row to set.\r\n * @param {Cartesian4} cartesian The Cartesian whose values will be assigned to the specified row.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0, 1, 2, or 3.\r\n *\r\n * @example\r\n * //create a new Matrix4 instance with new row values from the Cartesian4 instance\r\n * // m = [10.0, 11.0, 12.0, 13.0]\r\n * // [14.0, 15.0, 16.0, 17.0]\r\n * // [18.0, 19.0, 20.0, 21.0]\r\n * // [22.0, 23.0, 24.0, 25.0]\r\n *\r\n * const a = Cesium.Matrix4.setRow(m, 2, new Cesium.Cartesian4(99.0, 98.0, 97.0, 96.0), new Cesium.Matrix4());\r\n *\r\n * // m remains the same\r\n * // a = [10.0, 11.0, 12.0, 13.0]\r\n * // [14.0, 15.0, 16.0, 17.0]\r\n * // [99.0, 98.0, 97.0, 96.0]\r\n * // [22.0, 23.0, 24.0, 25.0]\r\n */\r\nMatrix4.setRow = function (matrix, index, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 3);\r\n\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result = Matrix4.clone(matrix, result);\r\n result[index] = cartesian.x;\r\n result[index + 4] = cartesian.y;\r\n result[index + 8] = cartesian.z;\r\n result[index + 12] = cartesian.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a new matrix that replaces the translation in the rightmost column of the provided\r\n * matrix with the provided translation. This assumes the matrix is an affine transformation.\r\n *\r\n * @param {Matrix4} matrix The matrix to use.\r\n * @param {Cartesian3} translation The translation that replaces the translation of the provided matrix.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.setTranslation = function (matrix, translation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"translation\", translation);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = matrix[0];\r\n result[1] = matrix[1];\r\n result[2] = matrix[2];\r\n result[3] = matrix[3];\r\n\r\n result[4] = matrix[4];\r\n result[5] = matrix[5];\r\n result[6] = matrix[6];\r\n result[7] = matrix[7];\r\n\r\n result[8] = matrix[8];\r\n result[9] = matrix[9];\r\n result[10] = matrix[10];\r\n result[11] = matrix[11];\r\n\r\n result[12] = translation.x;\r\n result[13] = translation.y;\r\n result[14] = translation.z;\r\n result[15] = matrix[15];\r\n\r\n return result;\r\n};\r\n\r\nconst scaleScratch1 = new Cartesian3();\r\n\r\n/**\r\n * Computes a new matrix that replaces the scale with the provided scale.\r\n * This assumes the matrix is an affine transformation.\r\n *\r\n * @param {Matrix4} matrix The matrix to use.\r\n * @param {Cartesian3} scale The scale that replaces the scale of the provided matrix.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @see Matrix4.setUniformScale\r\n * @see Matrix4.fromScale\r\n * @see Matrix4.fromUniformScale\r\n * @see Matrix4.multiplyByScale\r\n * @see Matrix4.multiplyByUniformScale\r\n * @see Matrix4.getScale\r\n */\r\nMatrix4.setScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const existingScale = Matrix4.getScale(matrix, scaleScratch1);\r\n const scaleRatioX = scale.x / existingScale.x;\r\n const scaleRatioY = scale.y / existingScale.y;\r\n const scaleRatioZ = scale.z / existingScale.z;\r\n\r\n result[0] = matrix[0] * scaleRatioX;\r\n result[1] = matrix[1] * scaleRatioX;\r\n result[2] = matrix[2] * scaleRatioX;\r\n result[3] = matrix[3];\r\n\r\n result[4] = matrix[4] * scaleRatioY;\r\n result[5] = matrix[5] * scaleRatioY;\r\n result[6] = matrix[6] * scaleRatioY;\r\n result[7] = matrix[7];\r\n\r\n result[8] = matrix[8] * scaleRatioZ;\r\n result[9] = matrix[9] * scaleRatioZ;\r\n result[10] = matrix[10] * scaleRatioZ;\r\n result[11] = matrix[11];\r\n\r\n result[12] = matrix[12];\r\n result[13] = matrix[13];\r\n result[14] = matrix[14];\r\n result[15] = matrix[15];\r\n\r\n return result;\r\n};\r\n\r\nconst scaleScratch2 = new Cartesian3();\r\n\r\n/**\r\n * Computes a new matrix that replaces the scale with the provided uniform scale.\r\n * This assumes the matrix is an affine transformation.\r\n *\r\n * @param {Matrix4} matrix The matrix to use.\r\n * @param {Number} scale The uniform scale that replaces the scale of the provided matrix.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @see Matrix4.setScale\r\n * @see Matrix4.fromScale\r\n * @see Matrix4.fromUniformScale\r\n * @see Matrix4.multiplyByScale\r\n * @see Matrix4.multiplyByUniformScale\r\n * @see Matrix4.getScale\r\n */\r\nMatrix4.setUniformScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const existingScale = Matrix4.getScale(matrix, scaleScratch2);\r\n const scaleRatioX = scale / existingScale.x;\r\n const scaleRatioY = scale / existingScale.y;\r\n const scaleRatioZ = scale / existingScale.z;\r\n\r\n result[0] = matrix[0] * scaleRatioX;\r\n result[1] = matrix[1] * scaleRatioX;\r\n result[2] = matrix[2] * scaleRatioX;\r\n result[3] = matrix[3];\r\n\r\n result[4] = matrix[4] * scaleRatioY;\r\n result[5] = matrix[5] * scaleRatioY;\r\n result[6] = matrix[6] * scaleRatioY;\r\n result[7] = matrix[7];\r\n\r\n result[8] = matrix[8] * scaleRatioZ;\r\n result[9] = matrix[9] * scaleRatioZ;\r\n result[10] = matrix[10] * scaleRatioZ;\r\n result[11] = matrix[11];\r\n\r\n result[12] = matrix[12];\r\n result[13] = matrix[13];\r\n result[14] = matrix[14];\r\n result[15] = matrix[15];\r\n\r\n return result;\r\n};\r\n\r\nconst scratchColumn = new Cartesian3();\r\n\r\n/**\r\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\r\n *\r\n * @param {Matrix4} matrix The matrix.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter\r\n *\r\n * @see Matrix4.multiplyByScale\r\n * @see Matrix4.multiplyByUniformScale\r\n * @see Matrix4.fromScale\r\n * @see Matrix4.fromUniformScale\r\n * @see Matrix4.setScale\r\n * @see Matrix4.setUniformScale\r\n */\r\nMatrix4.getScale = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Cartesian3.magnitude(\r\n Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)\r\n );\r\n result.y = Cartesian3.magnitude(\r\n Cartesian3.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn)\r\n );\r\n result.z = Cartesian3.magnitude(\r\n Cartesian3.fromElements(matrix[8], matrix[9], matrix[10], scratchColumn)\r\n );\r\n return result;\r\n};\r\n\r\nconst scaleScratch3 = new Cartesian3();\r\n\r\n/**\r\n * Computes the maximum scale assuming the matrix is an affine transformation.\r\n * The maximum scale is the maximum length of the column vectors in the upper-left\r\n * 3x3 matrix.\r\n *\r\n * @param {Matrix4} matrix The matrix.\r\n * @returns {Number} The maximum scale.\r\n */\r\nMatrix4.getMaximumScale = function (matrix) {\r\n Matrix4.getScale(matrix, scaleScratch3);\r\n return Cartesian3.maximumComponent(scaleScratch3);\r\n};\r\n\r\nconst scaleScratch4 = new Cartesian3();\r\n\r\n/**\r\n * Sets the rotation assuming the matrix is an affine transformation.\r\n *\r\n * @param {Matrix4} matrix The matrix.\r\n * @param {Matrix3} rotation The rotation matrix.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @see Matrix4.fromRotation\r\n * @see Matrix4.getRotation\r\n */\r\nMatrix4.setRotation = function (matrix, rotation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const scale = Matrix4.getScale(matrix, scaleScratch4);\r\n\r\n result[0] = rotation[0] * scale.x;\r\n result[1] = rotation[1] * scale.x;\r\n result[2] = rotation[2] * scale.x;\r\n result[3] = matrix[3];\r\n\r\n result[4] = rotation[3] * scale.y;\r\n result[5] = rotation[4] * scale.y;\r\n result[6] = rotation[5] * scale.y;\r\n result[7] = matrix[7];\r\n\r\n result[8] = rotation[6] * scale.z;\r\n result[9] = rotation[7] * scale.z;\r\n result[10] = rotation[8] * scale.z;\r\n result[11] = matrix[11];\r\n\r\n result[12] = matrix[12];\r\n result[13] = matrix[13];\r\n result[14] = matrix[14];\r\n result[15] = matrix[15];\r\n\r\n return result;\r\n};\r\n\r\nconst scaleScratch5 = new Cartesian3();\r\n\r\n/**\r\n * Extracts the rotation matrix assuming the matrix is an affine transformation.\r\n *\r\n * @param {Matrix4} matrix The matrix.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n * @see Matrix4.setRotation\r\n * @see Matrix4.fromRotation\r\n */\r\nMatrix4.getRotation = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const scale = Matrix4.getScale(matrix, scaleScratch5);\r\n\r\n result[0] = matrix[0] / scale.x;\r\n result[1] = matrix[1] / scale.x;\r\n result[2] = matrix[2] / scale.x;\r\n\r\n result[3] = matrix[4] / scale.y;\r\n result[4] = matrix[5] / scale.y;\r\n result[5] = matrix[6] / scale.y;\r\n\r\n result[6] = matrix[8] / scale.z;\r\n result[7] = matrix[9] / scale.z;\r\n result[8] = matrix[10] / scale.z;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of two matrices.\r\n *\r\n * @param {Matrix4} left The first matrix.\r\n * @param {Matrix4} right The second matrix.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.multiply = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const left0 = left[0];\r\n const left1 = left[1];\r\n const left2 = left[2];\r\n const left3 = left[3];\r\n const left4 = left[4];\r\n const left5 = left[5];\r\n const left6 = left[6];\r\n const left7 = left[7];\r\n const left8 = left[8];\r\n const left9 = left[9];\r\n const left10 = left[10];\r\n const left11 = left[11];\r\n const left12 = left[12];\r\n const left13 = left[13];\r\n const left14 = left[14];\r\n const left15 = left[15];\r\n\r\n const right0 = right[0];\r\n const right1 = right[1];\r\n const right2 = right[2];\r\n const right3 = right[3];\r\n const right4 = right[4];\r\n const right5 = right[5];\r\n const right6 = right[6];\r\n const right7 = right[7];\r\n const right8 = right[8];\r\n const right9 = right[9];\r\n const right10 = right[10];\r\n const right11 = right[11];\r\n const right12 = right[12];\r\n const right13 = right[13];\r\n const right14 = right[14];\r\n const right15 = right[15];\r\n\r\n const column0Row0 =\r\n left0 * right0 + left4 * right1 + left8 * right2 + left12 * right3;\r\n const column0Row1 =\r\n left1 * right0 + left5 * right1 + left9 * right2 + left13 * right3;\r\n const column0Row2 =\r\n left2 * right0 + left6 * right1 + left10 * right2 + left14 * right3;\r\n const column0Row3 =\r\n left3 * right0 + left7 * right1 + left11 * right2 + left15 * right3;\r\n\r\n const column1Row0 =\r\n left0 * right4 + left4 * right5 + left8 * right6 + left12 * right7;\r\n const column1Row1 =\r\n left1 * right4 + left5 * right5 + left9 * right6 + left13 * right7;\r\n const column1Row2 =\r\n left2 * right4 + left6 * right5 + left10 * right6 + left14 * right7;\r\n const column1Row3 =\r\n left3 * right4 + left7 * right5 + left11 * right6 + left15 * right7;\r\n\r\n const column2Row0 =\r\n left0 * right8 + left4 * right9 + left8 * right10 + left12 * right11;\r\n const column2Row1 =\r\n left1 * right8 + left5 * right9 + left9 * right10 + left13 * right11;\r\n const column2Row2 =\r\n left2 * right8 + left6 * right9 + left10 * right10 + left14 * right11;\r\n const column2Row3 =\r\n left3 * right8 + left7 * right9 + left11 * right10 + left15 * right11;\r\n\r\n const column3Row0 =\r\n left0 * right12 + left4 * right13 + left8 * right14 + left12 * right15;\r\n const column3Row1 =\r\n left1 * right12 + left5 * right13 + left9 * right14 + left13 * right15;\r\n const column3Row2 =\r\n left2 * right12 + left6 * right13 + left10 * right14 + left14 * right15;\r\n const column3Row3 =\r\n left3 * right12 + left7 * right13 + left11 * right14 + left15 * right15;\r\n\r\n result[0] = column0Row0;\r\n result[1] = column0Row1;\r\n result[2] = column0Row2;\r\n result[3] = column0Row3;\r\n result[4] = column1Row0;\r\n result[5] = column1Row1;\r\n result[6] = column1Row2;\r\n result[7] = column1Row3;\r\n result[8] = column2Row0;\r\n result[9] = column2Row1;\r\n result[10] = column2Row2;\r\n result[11] = column2Row3;\r\n result[12] = column3Row0;\r\n result[13] = column3Row1;\r\n result[14] = column3Row2;\r\n result[15] = column3Row3;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the sum of two matrices.\r\n *\r\n * @param {Matrix4} left The first matrix.\r\n * @param {Matrix4} right The second matrix.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.add = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = left[0] + right[0];\r\n result[1] = left[1] + right[1];\r\n result[2] = left[2] + right[2];\r\n result[3] = left[3] + right[3];\r\n result[4] = left[4] + right[4];\r\n result[5] = left[5] + right[5];\r\n result[6] = left[6] + right[6];\r\n result[7] = left[7] + right[7];\r\n result[8] = left[8] + right[8];\r\n result[9] = left[9] + right[9];\r\n result[10] = left[10] + right[10];\r\n result[11] = left[11] + right[11];\r\n result[12] = left[12] + right[12];\r\n result[13] = left[13] + right[13];\r\n result[14] = left[14] + right[14];\r\n result[15] = left[15] + right[15];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the difference of two matrices.\r\n *\r\n * @param {Matrix4} left The first matrix.\r\n * @param {Matrix4} right The second matrix.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.subtract = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = left[0] - right[0];\r\n result[1] = left[1] - right[1];\r\n result[2] = left[2] - right[2];\r\n result[3] = left[3] - right[3];\r\n result[4] = left[4] - right[4];\r\n result[5] = left[5] - right[5];\r\n result[6] = left[6] - right[6];\r\n result[7] = left[7] - right[7];\r\n result[8] = left[8] - right[8];\r\n result[9] = left[9] - right[9];\r\n result[10] = left[10] - right[10];\r\n result[11] = left[11] - right[11];\r\n result[12] = left[12] - right[12];\r\n result[13] = left[13] - right[13];\r\n result[14] = left[14] - right[14];\r\n result[15] = left[15] - right[15];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of two matrices assuming the matrices are affine transformation matrices,\r\n * where the upper left 3x3 elements are any matrix, and\r\n * the upper three elements in the fourth column are the translation.\r\n * The bottom row is assumed to be [0, 0, 0, 1].\r\n * The matrix is not verified to be in the proper form.\r\n * This method is faster than computing the product for general 4x4\r\n * matrices using {@link Matrix4.multiply}.\r\n *\r\n * @param {Matrix4} left The first matrix.\r\n * @param {Matrix4} right The second matrix.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @example\r\n * const m1 = new Cesium.Matrix4(1.0, 6.0, 7.0, 0.0, 2.0, 5.0, 8.0, 0.0, 3.0, 4.0, 9.0, 0.0, 0.0, 0.0, 0.0, 1.0);\r\n * const m2 = Cesium.Transforms.eastNorthUpToFixedFrame(new Cesium.Cartesian3(1.0, 1.0, 1.0));\r\n * const m3 = Cesium.Matrix4.multiplyTransformation(m1, m2, new Cesium.Matrix4());\r\n */\r\nMatrix4.multiplyTransformation = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const left0 = left[0];\r\n const left1 = left[1];\r\n const left2 = left[2];\r\n const left4 = left[4];\r\n const left5 = left[5];\r\n const left6 = left[6];\r\n const left8 = left[8];\r\n const left9 = left[9];\r\n const left10 = left[10];\r\n const left12 = left[12];\r\n const left13 = left[13];\r\n const left14 = left[14];\r\n\r\n const right0 = right[0];\r\n const right1 = right[1];\r\n const right2 = right[2];\r\n const right4 = right[4];\r\n const right5 = right[5];\r\n const right6 = right[6];\r\n const right8 = right[8];\r\n const right9 = right[9];\r\n const right10 = right[10];\r\n const right12 = right[12];\r\n const right13 = right[13];\r\n const right14 = right[14];\r\n\r\n const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;\r\n const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;\r\n const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;\r\n\r\n const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;\r\n const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;\r\n const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;\r\n\r\n const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;\r\n const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;\r\n const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;\r\n\r\n const column3Row0 =\r\n left0 * right12 + left4 * right13 + left8 * right14 + left12;\r\n const column3Row1 =\r\n left1 * right12 + left5 * right13 + left9 * right14 + left13;\r\n const column3Row2 =\r\n left2 * right12 + left6 * right13 + left10 * right14 + left14;\r\n\r\n result[0] = column0Row0;\r\n result[1] = column0Row1;\r\n result[2] = column0Row2;\r\n result[3] = 0.0;\r\n result[4] = column1Row0;\r\n result[5] = column1Row1;\r\n result[6] = column1Row2;\r\n result[7] = 0.0;\r\n result[8] = column2Row0;\r\n result[9] = column2Row1;\r\n result[10] = column2Row2;\r\n result[11] = 0.0;\r\n result[12] = column3Row0;\r\n result[13] = column3Row1;\r\n result[14] = column3Row2;\r\n result[15] = 1.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)\r\n * by a 3x3 rotation matrix. This is an optimization\r\n * for Matrix4.multiply(m, Matrix4.fromRotationTranslation(rotation), m);
with less allocations and arithmetic operations.\r\n *\r\n * @param {Matrix4} matrix The matrix on the left-hand side.\r\n * @param {Matrix3} rotation The 3x3 rotation matrix on the right-hand side.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @example\r\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromRotationTranslation(rotation), m);\r\n * Cesium.Matrix4.multiplyByMatrix3(m, rotation, m);\r\n */\r\nMatrix4.multiplyByMatrix3 = function (matrix, rotation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"rotation\", rotation);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const left0 = matrix[0];\r\n const left1 = matrix[1];\r\n const left2 = matrix[2];\r\n const left4 = matrix[4];\r\n const left5 = matrix[5];\r\n const left6 = matrix[6];\r\n const left8 = matrix[8];\r\n const left9 = matrix[9];\r\n const left10 = matrix[10];\r\n\r\n const right0 = rotation[0];\r\n const right1 = rotation[1];\r\n const right2 = rotation[2];\r\n const right4 = rotation[3];\r\n const right5 = rotation[4];\r\n const right6 = rotation[5];\r\n const right8 = rotation[6];\r\n const right9 = rotation[7];\r\n const right10 = rotation[8];\r\n\r\n const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;\r\n const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;\r\n const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;\r\n\r\n const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;\r\n const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;\r\n const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;\r\n\r\n const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;\r\n const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;\r\n const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;\r\n\r\n result[0] = column0Row0;\r\n result[1] = column0Row1;\r\n result[2] = column0Row2;\r\n result[3] = 0.0;\r\n result[4] = column1Row0;\r\n result[5] = column1Row1;\r\n result[6] = column1Row2;\r\n result[7] = 0.0;\r\n result[8] = column2Row0;\r\n result[9] = column2Row1;\r\n result[10] = column2Row2;\r\n result[11] = 0.0;\r\n result[12] = matrix[12];\r\n result[13] = matrix[13];\r\n result[14] = matrix[14];\r\n result[15] = matrix[15];\r\n return result;\r\n};\r\n\r\n/**\r\n * Multiplies a transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)\r\n * by an implicit translation matrix defined by a {@link Cartesian3}. This is an optimization\r\n * for Matrix4.multiply(m, Matrix4.fromTranslation(position), m);
with less allocations and arithmetic operations.\r\n *\r\n * @param {Matrix4} matrix The matrix on the left-hand side.\r\n * @param {Cartesian3} translation The translation on the right-hand side.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @example\r\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromTranslation(position), m);\r\n * Cesium.Matrix4.multiplyByTranslation(m, position, m);\r\n */\r\nMatrix4.multiplyByTranslation = function (matrix, translation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"translation\", translation);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const x = translation.x;\r\n const y = translation.y;\r\n const z = translation.z;\r\n\r\n const tx = x * matrix[0] + y * matrix[4] + z * matrix[8] + matrix[12];\r\n const ty = x * matrix[1] + y * matrix[5] + z * matrix[9] + matrix[13];\r\n const tz = x * matrix[2] + y * matrix[6] + z * matrix[10] + matrix[14];\r\n\r\n result[0] = matrix[0];\r\n result[1] = matrix[1];\r\n result[2] = matrix[2];\r\n result[3] = matrix[3];\r\n result[4] = matrix[4];\r\n result[5] = matrix[5];\r\n result[6] = matrix[6];\r\n result[7] = matrix[7];\r\n result[8] = matrix[8];\r\n result[9] = matrix[9];\r\n result[10] = matrix[10];\r\n result[11] = matrix[11];\r\n result[12] = tx;\r\n result[13] = ty;\r\n result[14] = tz;\r\n result[15] = matrix[15];\r\n return result;\r\n};\r\n\r\n/**\r\n * Multiplies an affine transformation matrix (with a bottom row of [0.0, 0.0, 0.0, 1.0]
)\r\n * by an implicit non-uniform scale matrix. This is an optimization\r\n * for Matrix4.multiply(m, Matrix4.fromUniformScale(scale), m);
, where\r\n * m
must be an affine matrix.\r\n * This function performs fewer allocations and arithmetic operations.\r\n *\r\n * @param {Matrix4} matrix The affine matrix on the left-hand side.\r\n * @param {Cartesian3} scale The non-uniform scale on the right-hand side.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n *\r\n * @example\r\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromScale(scale), m);\r\n * Cesium.Matrix4.multiplyByScale(m, scale, m);\r\n *\r\n * @see Matrix4.multiplyByUniformScale\r\n * @see Matrix4.fromScale\r\n * @see Matrix4.fromUniformScale\r\n * @see Matrix4.setScale\r\n * @see Matrix4.setUniformScale\r\n * @see Matrix4.getScale\r\n */\r\nMatrix4.multiplyByScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const scaleX = scale.x;\r\n const scaleY = scale.y;\r\n const scaleZ = scale.z;\r\n\r\n // Faster than Cartesian3.equals\r\n if (scaleX === 1.0 && scaleY === 1.0 && scaleZ === 1.0) {\r\n return Matrix4.clone(matrix, result);\r\n }\r\n\r\n result[0] = scaleX * matrix[0];\r\n result[1] = scaleX * matrix[1];\r\n result[2] = scaleX * matrix[2];\r\n result[3] = matrix[3];\r\n\r\n result[4] = scaleY * matrix[4];\r\n result[5] = scaleY * matrix[5];\r\n result[6] = scaleY * matrix[6];\r\n result[7] = matrix[7];\r\n\r\n result[8] = scaleZ * matrix[8];\r\n result[9] = scaleZ * matrix[9];\r\n result[10] = scaleZ * matrix[10];\r\n result[11] = matrix[11];\r\n\r\n result[12] = matrix[12];\r\n result[13] = matrix[13];\r\n result[14] = matrix[14];\r\n result[15] = matrix[15];\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\r\n *\r\n * @param {Matrix4} matrix The matrix on the left-hand side.\r\n * @param {Number} scale The uniform scale on the right-hand side.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @example\r\n * // Instead of Cesium.Matrix4.multiply(m, Cesium.Matrix4.fromUniformScale(scale), m);\r\n * Cesium.Matrix4.multiplyByUniformScale(m, scale, m);\r\n *\r\n * @see Matrix4.multiplyByScale\r\n * @see Matrix4.fromScale\r\n * @see Matrix4.fromUniformScale\r\n * @see Matrix4.setScale\r\n * @see Matrix4.setUniformScale\r\n * @see Matrix4.getScale\r\n */\r\nMatrix4.multiplyByUniformScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = matrix[0] * scale;\r\n result[1] = matrix[1] * scale;\r\n result[2] = matrix[2] * scale;\r\n result[3] = matrix[3];\r\n\r\n result[4] = matrix[4] * scale;\r\n result[5] = matrix[5] * scale;\r\n result[6] = matrix[6] * scale;\r\n result[7] = matrix[7];\r\n\r\n result[8] = matrix[8] * scale;\r\n result[9] = matrix[9] * scale;\r\n result[10] = matrix[10] * scale;\r\n result[11] = matrix[11];\r\n\r\n result[12] = matrix[12];\r\n result[13] = matrix[13];\r\n result[14] = matrix[14];\r\n result[15] = matrix[15];\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix and a column vector.\r\n *\r\n * @param {Matrix4} matrix The matrix.\r\n * @param {Cartesian4} cartesian The vector.\r\n * @param {Cartesian4} result The object onto which to store the result.\r\n * @returns {Cartesian4} The modified result parameter.\r\n */\r\nMatrix4.multiplyByVector = function (matrix, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const vX = cartesian.x;\r\n const vY = cartesian.y;\r\n const vZ = cartesian.z;\r\n const vW = cartesian.w;\r\n\r\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12] * vW;\r\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13] * vW;\r\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14] * vW;\r\n const w = matrix[3] * vX + matrix[7] * vY + matrix[11] * vZ + matrix[15] * vW;\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\r\n * with a {@link Cartesian4} with a w
component of zero.\r\n *\r\n * @param {Matrix4} matrix The matrix.\r\n * @param {Cartesian3} cartesian The point.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n *\r\n * @example\r\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\r\n * const result = Cesium.Matrix4.multiplyByPointAsVector(matrix, p, new Cesium.Cartesian3());\r\n * // A shortcut for\r\n * // Cartesian3 p = ...\r\n * // Cesium.Matrix4.multiplyByVector(matrix, new Cesium.Cartesian4(p.x, p.y, p.z, 0.0), result);\r\n */\r\nMatrix4.multiplyByPointAsVector = function (matrix, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const vX = cartesian.x;\r\n const vY = cartesian.y;\r\n const vZ = cartesian.z;\r\n\r\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ;\r\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ;\r\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ;\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix and a {@link Cartesian3}. This is equivalent to calling {@link Matrix4.multiplyByVector}\r\n * with a {@link Cartesian4} with a w
component of 1, but returns a {@link Cartesian3} instead of a {@link Cartesian4}.\r\n *\r\n * @param {Matrix4} matrix The matrix.\r\n * @param {Cartesian3} cartesian The point.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n *\r\n * @example\r\n * const p = new Cesium.Cartesian3(1.0, 2.0, 3.0);\r\n * const result = Cesium.Matrix4.multiplyByPoint(matrix, p, new Cesium.Cartesian3());\r\n */\r\nMatrix4.multiplyByPoint = function (matrix, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const vX = cartesian.x;\r\n const vY = cartesian.y;\r\n const vZ = cartesian.z;\r\n\r\n const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12];\r\n const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13];\r\n const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14];\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix and a scalar.\r\n *\r\n * @param {Matrix4} matrix The matrix.\r\n * @param {Number} scalar The number to multiply by.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @example\r\n * //create a Matrix4 instance which is a scaled version of the supplied Matrix4\r\n * // m = [10.0, 11.0, 12.0, 13.0]\r\n * // [14.0, 15.0, 16.0, 17.0]\r\n * // [18.0, 19.0, 20.0, 21.0]\r\n * // [22.0, 23.0, 24.0, 25.0]\r\n *\r\n * const a = Cesium.Matrix4.multiplyByScalar(m, -2, new Cesium.Matrix4());\r\n *\r\n * // m remains the same\r\n * // a = [-20.0, -22.0, -24.0, -26.0]\r\n * // [-28.0, -30.0, -32.0, -34.0]\r\n * // [-36.0, -38.0, -40.0, -42.0]\r\n * // [-44.0, -46.0, -48.0, -50.0]\r\n */\r\nMatrix4.multiplyByScalar = function (matrix, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = matrix[0] * scalar;\r\n result[1] = matrix[1] * scalar;\r\n result[2] = matrix[2] * scalar;\r\n result[3] = matrix[3] * scalar;\r\n result[4] = matrix[4] * scalar;\r\n result[5] = matrix[5] * scalar;\r\n result[6] = matrix[6] * scalar;\r\n result[7] = matrix[7] * scalar;\r\n result[8] = matrix[8] * scalar;\r\n result[9] = matrix[9] * scalar;\r\n result[10] = matrix[10] * scalar;\r\n result[11] = matrix[11] * scalar;\r\n result[12] = matrix[12] * scalar;\r\n result[13] = matrix[13] * scalar;\r\n result[14] = matrix[14] * scalar;\r\n result[15] = matrix[15] * scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a negated copy of the provided matrix.\r\n *\r\n * @param {Matrix4} matrix The matrix to negate.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @example\r\n * //create a new Matrix4 instance which is a negation of a Matrix4\r\n * // m = [10.0, 11.0, 12.0, 13.0]\r\n * // [14.0, 15.0, 16.0, 17.0]\r\n * // [18.0, 19.0, 20.0, 21.0]\r\n * // [22.0, 23.0, 24.0, 25.0]\r\n *\r\n * const a = Cesium.Matrix4.negate(m, new Cesium.Matrix4());\r\n *\r\n * // m remains the same\r\n * // a = [-10.0, -11.0, -12.0, -13.0]\r\n * // [-14.0, -15.0, -16.0, -17.0]\r\n * // [-18.0, -19.0, -20.0, -21.0]\r\n * // [-22.0, -23.0, -24.0, -25.0]\r\n */\r\nMatrix4.negate = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = -matrix[0];\r\n result[1] = -matrix[1];\r\n result[2] = -matrix[2];\r\n result[3] = -matrix[3];\r\n result[4] = -matrix[4];\r\n result[5] = -matrix[5];\r\n result[6] = -matrix[6];\r\n result[7] = -matrix[7];\r\n result[8] = -matrix[8];\r\n result[9] = -matrix[9];\r\n result[10] = -matrix[10];\r\n result[11] = -matrix[11];\r\n result[12] = -matrix[12];\r\n result[13] = -matrix[13];\r\n result[14] = -matrix[14];\r\n result[15] = -matrix[15];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the transpose of the provided matrix.\r\n *\r\n * @param {Matrix4} matrix The matrix to transpose.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @example\r\n * //returns transpose of a Matrix4\r\n * // m = [10.0, 11.0, 12.0, 13.0]\r\n * // [14.0, 15.0, 16.0, 17.0]\r\n * // [18.0, 19.0, 20.0, 21.0]\r\n * // [22.0, 23.0, 24.0, 25.0]\r\n *\r\n * const a = Cesium.Matrix4.transpose(m, new Cesium.Matrix4());\r\n *\r\n * // m remains the same\r\n * // a = [10.0, 14.0, 18.0, 22.0]\r\n * // [11.0, 15.0, 19.0, 23.0]\r\n * // [12.0, 16.0, 20.0, 24.0]\r\n * // [13.0, 17.0, 21.0, 25.0]\r\n */\r\nMatrix4.transpose = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const matrix1 = matrix[1];\r\n const matrix2 = matrix[2];\r\n const matrix3 = matrix[3];\r\n const matrix6 = matrix[6];\r\n const matrix7 = matrix[7];\r\n const matrix11 = matrix[11];\r\n\r\n result[0] = matrix[0];\r\n result[1] = matrix[4];\r\n result[2] = matrix[8];\r\n result[3] = matrix[12];\r\n result[4] = matrix1;\r\n result[5] = matrix[5];\r\n result[6] = matrix[9];\r\n result[7] = matrix[13];\r\n result[8] = matrix2;\r\n result[9] = matrix6;\r\n result[10] = matrix[10];\r\n result[11] = matrix[14];\r\n result[12] = matrix3;\r\n result[13] = matrix7;\r\n result[14] = matrix11;\r\n result[15] = matrix[15];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\r\n *\r\n * @param {Matrix4} matrix The matrix with signed elements.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.abs = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = Math.abs(matrix[0]);\r\n result[1] = Math.abs(matrix[1]);\r\n result[2] = Math.abs(matrix[2]);\r\n result[3] = Math.abs(matrix[3]);\r\n result[4] = Math.abs(matrix[4]);\r\n result[5] = Math.abs(matrix[5]);\r\n result[6] = Math.abs(matrix[6]);\r\n result[7] = Math.abs(matrix[7]);\r\n result[8] = Math.abs(matrix[8]);\r\n result[9] = Math.abs(matrix[9]);\r\n result[10] = Math.abs(matrix[10]);\r\n result[11] = Math.abs(matrix[11]);\r\n result[12] = Math.abs(matrix[12]);\r\n result[13] = Math.abs(matrix[13]);\r\n result[14] = Math.abs(matrix[14]);\r\n result[15] = Math.abs(matrix[15]);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided matrices componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Matrix4} [left] The first matrix.\r\n * @param {Matrix4} [right] The second matrix.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n *\r\n * @example\r\n * //compares two Matrix4 instances\r\n *\r\n * // a = [10.0, 14.0, 18.0, 22.0]\r\n * // [11.0, 15.0, 19.0, 23.0]\r\n * // [12.0, 16.0, 20.0, 24.0]\r\n * // [13.0, 17.0, 21.0, 25.0]\r\n *\r\n * // b = [10.0, 14.0, 18.0, 22.0]\r\n * // [11.0, 15.0, 19.0, 23.0]\r\n * // [12.0, 16.0, 20.0, 24.0]\r\n * // [13.0, 17.0, 21.0, 25.0]\r\n *\r\n * if(Cesium.Matrix4.equals(a,b)) {\r\n * console.log(\"Both matrices are equal\");\r\n * } else {\r\n * console.log(\"They are not equal\");\r\n * }\r\n *\r\n * //Prints \"Both matrices are equal\" on the console\r\n */\r\nMatrix4.equals = function (left, right) {\r\n // Given that most matrices will be transformation matrices, the elements\r\n // are tested in order such that the test is likely to fail as early\r\n // as possible. I _think_ this is just as friendly to the L1 cache\r\n // as testing in index order. It is certainty faster in practice.\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n // Translation\r\n left[12] === right[12] &&\r\n left[13] === right[13] &&\r\n left[14] === right[14] &&\r\n // Rotation/scale\r\n left[0] === right[0] &&\r\n left[1] === right[1] &&\r\n left[2] === right[2] &&\r\n left[4] === right[4] &&\r\n left[5] === right[5] &&\r\n left[6] === right[6] &&\r\n left[8] === right[8] &&\r\n left[9] === right[9] &&\r\n left[10] === right[10] &&\r\n // Bottom row\r\n left[3] === right[3] &&\r\n left[7] === right[7] &&\r\n left[11] === right[11] &&\r\n left[15] === right[15])\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided matrices componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Matrix4} [left] The first matrix.\r\n * @param {Matrix4} [right] The second matrix.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n *\r\n * @example\r\n * //compares two Matrix4 instances\r\n *\r\n * // a = [10.5, 14.5, 18.5, 22.5]\r\n * // [11.5, 15.5, 19.5, 23.5]\r\n * // [12.5, 16.5, 20.5, 24.5]\r\n * // [13.5, 17.5, 21.5, 25.5]\r\n *\r\n * // b = [10.0, 14.0, 18.0, 22.0]\r\n * // [11.0, 15.0, 19.0, 23.0]\r\n * // [12.0, 16.0, 20.0, 24.0]\r\n * // [13.0, 17.0, 21.0, 25.0]\r\n *\r\n * if(Cesium.Matrix4.equalsEpsilon(a,b,0.1)){\r\n * console.log(\"Difference between both the matrices is less than 0.1\");\r\n * } else {\r\n * console.log(\"Difference between both the matrices is not less than 0.1\");\r\n * }\r\n *\r\n * //Prints \"Difference between both the matrices is not less than 0.1\" on the console\r\n */\r\nMatrix4.equalsEpsilon = function (left, right, epsilon) {\r\n epsilon = defaultValue(epsilon, 0);\r\n\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n Math.abs(left[0] - right[0]) <= epsilon &&\r\n Math.abs(left[1] - right[1]) <= epsilon &&\r\n Math.abs(left[2] - right[2]) <= epsilon &&\r\n Math.abs(left[3] - right[3]) <= epsilon &&\r\n Math.abs(left[4] - right[4]) <= epsilon &&\r\n Math.abs(left[5] - right[5]) <= epsilon &&\r\n Math.abs(left[6] - right[6]) <= epsilon &&\r\n Math.abs(left[7] - right[7]) <= epsilon &&\r\n Math.abs(left[8] - right[8]) <= epsilon &&\r\n Math.abs(left[9] - right[9]) <= epsilon &&\r\n Math.abs(left[10] - right[10]) <= epsilon &&\r\n Math.abs(left[11] - right[11]) <= epsilon &&\r\n Math.abs(left[12] - right[12]) <= epsilon &&\r\n Math.abs(left[13] - right[13]) <= epsilon &&\r\n Math.abs(left[14] - right[14]) <= epsilon &&\r\n Math.abs(left[15] - right[15]) <= epsilon)\r\n );\r\n};\r\n\r\n/**\r\n * Gets the translation portion of the provided matrix, assuming the matrix is an affine transformation matrix.\r\n *\r\n * @param {Matrix4} matrix The matrix to use.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nMatrix4.getTranslation = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = matrix[12];\r\n result.y = matrix[13];\r\n result.z = matrix[14];\r\n return result;\r\n};\r\n\r\n/**\r\n * Gets the upper left 3x3 matrix of the provided matrix.\r\n *\r\n * @param {Matrix4} matrix The matrix to use.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n * @example\r\n * // returns a Matrix3 instance from a Matrix4 instance\r\n *\r\n * // m = [10.0, 14.0, 18.0, 22.0]\r\n * // [11.0, 15.0, 19.0, 23.0]\r\n * // [12.0, 16.0, 20.0, 24.0]\r\n * // [13.0, 17.0, 21.0, 25.0]\r\n *\r\n * const b = new Cesium.Matrix3();\r\n * Cesium.Matrix4.getMatrix3(m,b);\r\n *\r\n * // b = [10.0, 14.0, 18.0]\r\n * // [11.0, 15.0, 19.0]\r\n * // [12.0, 16.0, 20.0]\r\n */\r\nMatrix4.getMatrix3 = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = matrix[0];\r\n result[1] = matrix[1];\r\n result[2] = matrix[2];\r\n result[3] = matrix[4];\r\n result[4] = matrix[5];\r\n result[5] = matrix[6];\r\n result[6] = matrix[8];\r\n result[7] = matrix[9];\r\n result[8] = matrix[10];\r\n return result;\r\n};\r\n\r\nconst scratchInverseRotation = new Matrix3();\r\nconst scratchMatrix3Zero = new Matrix3();\r\nconst scratchBottomRow = new Cartesian4();\r\nconst scratchExpectedBottomRow = new Cartesian4(0.0, 0.0, 0.0, 1.0);\r\n\r\n/**\r\n * Computes the inverse of the provided matrix using Cramers Rule.\r\n * If the determinant is zero, the matrix can not be inverted, and an exception is thrown.\r\n * If the matrix is a proper rigid transformation, it is more efficient\r\n * to invert it with {@link Matrix4.inverseTransformation}.\r\n *\r\n * @param {Matrix4} matrix The matrix to invert.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n *\r\n * @exception {RuntimeError} matrix is not invertible because its determinate is zero.\r\n */\r\nMatrix4.inverse = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n //\r\n // Ported from:\r\n // ftp://download.intel.com/design/PentiumIII/sml/24504301.pdf\r\n //\r\n const src0 = matrix[0];\r\n const src1 = matrix[4];\r\n const src2 = matrix[8];\r\n const src3 = matrix[12];\r\n const src4 = matrix[1];\r\n const src5 = matrix[5];\r\n const src6 = matrix[9];\r\n const src7 = matrix[13];\r\n const src8 = matrix[2];\r\n const src9 = matrix[6];\r\n const src10 = matrix[10];\r\n const src11 = matrix[14];\r\n const src12 = matrix[3];\r\n const src13 = matrix[7];\r\n const src14 = matrix[11];\r\n const src15 = matrix[15];\r\n\r\n // calculate pairs for first 8 elements (cofactors)\r\n let tmp0 = src10 * src15;\r\n let tmp1 = src11 * src14;\r\n let tmp2 = src9 * src15;\r\n let tmp3 = src11 * src13;\r\n let tmp4 = src9 * src14;\r\n let tmp5 = src10 * src13;\r\n let tmp6 = src8 * src15;\r\n let tmp7 = src11 * src12;\r\n let tmp8 = src8 * src14;\r\n let tmp9 = src10 * src12;\r\n let tmp10 = src8 * src13;\r\n let tmp11 = src9 * src12;\r\n\r\n // calculate first 8 elements (cofactors)\r\n const dst0 =\r\n tmp0 * src5 +\r\n tmp3 * src6 +\r\n tmp4 * src7 -\r\n (tmp1 * src5 + tmp2 * src6 + tmp5 * src7);\r\n const dst1 =\r\n tmp1 * src4 +\r\n tmp6 * src6 +\r\n tmp9 * src7 -\r\n (tmp0 * src4 + tmp7 * src6 + tmp8 * src7);\r\n const dst2 =\r\n tmp2 * src4 +\r\n tmp7 * src5 +\r\n tmp10 * src7 -\r\n (tmp3 * src4 + tmp6 * src5 + tmp11 * src7);\r\n const dst3 =\r\n tmp5 * src4 +\r\n tmp8 * src5 +\r\n tmp11 * src6 -\r\n (tmp4 * src4 + tmp9 * src5 + tmp10 * src6);\r\n const dst4 =\r\n tmp1 * src1 +\r\n tmp2 * src2 +\r\n tmp5 * src3 -\r\n (tmp0 * src1 + tmp3 * src2 + tmp4 * src3);\r\n const dst5 =\r\n tmp0 * src0 +\r\n tmp7 * src2 +\r\n tmp8 * src3 -\r\n (tmp1 * src0 + tmp6 * src2 + tmp9 * src3);\r\n const dst6 =\r\n tmp3 * src0 +\r\n tmp6 * src1 +\r\n tmp11 * src3 -\r\n (tmp2 * src0 + tmp7 * src1 + tmp10 * src3);\r\n const dst7 =\r\n tmp4 * src0 +\r\n tmp9 * src1 +\r\n tmp10 * src2 -\r\n (tmp5 * src0 + tmp8 * src1 + tmp11 * src2);\r\n\r\n // calculate pairs for second 8 elements (cofactors)\r\n tmp0 = src2 * src7;\r\n tmp1 = src3 * src6;\r\n tmp2 = src1 * src7;\r\n tmp3 = src3 * src5;\r\n tmp4 = src1 * src6;\r\n tmp5 = src2 * src5;\r\n tmp6 = src0 * src7;\r\n tmp7 = src3 * src4;\r\n tmp8 = src0 * src6;\r\n tmp9 = src2 * src4;\r\n tmp10 = src0 * src5;\r\n tmp11 = src1 * src4;\r\n\r\n // calculate second 8 elements (cofactors)\r\n const dst8 =\r\n tmp0 * src13 +\r\n tmp3 * src14 +\r\n tmp4 * src15 -\r\n (tmp1 * src13 + tmp2 * src14 + tmp5 * src15);\r\n const dst9 =\r\n tmp1 * src12 +\r\n tmp6 * src14 +\r\n tmp9 * src15 -\r\n (tmp0 * src12 + tmp7 * src14 + tmp8 * src15);\r\n const dst10 =\r\n tmp2 * src12 +\r\n tmp7 * src13 +\r\n tmp10 * src15 -\r\n (tmp3 * src12 + tmp6 * src13 + tmp11 * src15);\r\n const dst11 =\r\n tmp5 * src12 +\r\n tmp8 * src13 +\r\n tmp11 * src14 -\r\n (tmp4 * src12 + tmp9 * src13 + tmp10 * src14);\r\n const dst12 =\r\n tmp2 * src10 +\r\n tmp5 * src11 +\r\n tmp1 * src9 -\r\n (tmp4 * src11 + tmp0 * src9 + tmp3 * src10);\r\n const dst13 =\r\n tmp8 * src11 +\r\n tmp0 * src8 +\r\n tmp7 * src10 -\r\n (tmp6 * src10 + tmp9 * src11 + tmp1 * src8);\r\n const dst14 =\r\n tmp6 * src9 +\r\n tmp11 * src11 +\r\n tmp3 * src8 -\r\n (tmp10 * src11 + tmp2 * src8 + tmp7 * src9);\r\n const dst15 =\r\n tmp10 * src10 +\r\n tmp4 * src8 +\r\n tmp9 * src9 -\r\n (tmp8 * src9 + tmp11 * src10 + tmp5 * src8);\r\n\r\n // calculate determinant\r\n let det = src0 * dst0 + src1 * dst1 + src2 * dst2 + src3 * dst3;\r\n\r\n if (Math.abs(det) < CesiumMath.EPSILON21) {\r\n // Special case for a zero scale matrix that can occur, for example,\r\n // when a model's node has a [0, 0, 0] scale.\r\n if (\r\n Matrix3.equalsEpsilon(\r\n Matrix4.getMatrix3(matrix, scratchInverseRotation),\r\n scratchMatrix3Zero,\r\n CesiumMath.EPSILON7\r\n ) &&\r\n Cartesian4.equals(\r\n Matrix4.getRow(matrix, 3, scratchBottomRow),\r\n scratchExpectedBottomRow\r\n )\r\n ) {\r\n result[0] = 0.0;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = 0.0;\r\n result[5] = 0.0;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = 0.0;\r\n result[9] = 0.0;\r\n result[10] = 0.0;\r\n result[11] = 0.0;\r\n result[12] = -matrix[12];\r\n result[13] = -matrix[13];\r\n result[14] = -matrix[14];\r\n result[15] = 1.0;\r\n return result;\r\n }\r\n\r\n throw new RuntimeError(\r\n \"matrix is not invertible because its determinate is zero.\"\r\n );\r\n }\r\n\r\n // calculate matrix inverse\r\n det = 1.0 / det;\r\n\r\n result[0] = dst0 * det;\r\n result[1] = dst1 * det;\r\n result[2] = dst2 * det;\r\n result[3] = dst3 * det;\r\n result[4] = dst4 * det;\r\n result[5] = dst5 * det;\r\n result[6] = dst6 * det;\r\n result[7] = dst7 * det;\r\n result[8] = dst8 * det;\r\n result[9] = dst9 * det;\r\n result[10] = dst10 * det;\r\n result[11] = dst11 * det;\r\n result[12] = dst12 * det;\r\n result[13] = dst13 * det;\r\n result[14] = dst14 * det;\r\n result[15] = dst15 * det;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the inverse of the provided matrix assuming it is a proper rigid matrix,\r\n * where the upper left 3x3 elements are a rotation matrix,\r\n * and the upper three elements in the fourth column are the translation.\r\n * The bottom row is assumed to be [0, 0, 0, 1].\r\n * The matrix is not verified to be in the proper form.\r\n * This method is faster than computing the inverse for a general 4x4\r\n * matrix using {@link Matrix4.inverse}.\r\n *\r\n * @param {Matrix4} matrix The matrix to invert.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.inverseTransformation = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n //This function is an optimized version of the below 4 lines.\r\n //const rT = Matrix3.transpose(Matrix4.getMatrix3(matrix));\r\n //const rTN = Matrix3.negate(rT);\r\n //const rTT = Matrix3.multiplyByVector(rTN, Matrix4.getTranslation(matrix));\r\n //return Matrix4.fromRotationTranslation(rT, rTT, result);\r\n\r\n const matrix0 = matrix[0];\r\n const matrix1 = matrix[1];\r\n const matrix2 = matrix[2];\r\n const matrix4 = matrix[4];\r\n const matrix5 = matrix[5];\r\n const matrix6 = matrix[6];\r\n const matrix8 = matrix[8];\r\n const matrix9 = matrix[9];\r\n const matrix10 = matrix[10];\r\n\r\n const vX = matrix[12];\r\n const vY = matrix[13];\r\n const vZ = matrix[14];\r\n\r\n const x = -matrix0 * vX - matrix1 * vY - matrix2 * vZ;\r\n const y = -matrix4 * vX - matrix5 * vY - matrix6 * vZ;\r\n const z = -matrix8 * vX - matrix9 * vY - matrix10 * vZ;\r\n\r\n result[0] = matrix0;\r\n result[1] = matrix4;\r\n result[2] = matrix8;\r\n result[3] = 0.0;\r\n result[4] = matrix1;\r\n result[5] = matrix5;\r\n result[6] = matrix9;\r\n result[7] = 0.0;\r\n result[8] = matrix2;\r\n result[9] = matrix6;\r\n result[10] = matrix10;\r\n result[11] = 0.0;\r\n result[12] = x;\r\n result[13] = y;\r\n result[14] = z;\r\n result[15] = 1.0;\r\n return result;\r\n};\r\n\r\nconst scratchTransposeMatrix = new Matrix4();\r\n\r\n/**\r\n * Computes the inverse transpose of a matrix.\r\n *\r\n * @param {Matrix4} matrix The matrix to transpose and invert.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter.\r\n */\r\nMatrix4.inverseTranspose = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n return Matrix4.inverse(\r\n Matrix4.transpose(matrix, scratchTransposeMatrix),\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * An immutable Matrix4 instance initialized to the identity matrix.\r\n *\r\n * @type {Matrix4}\r\n * @constant\r\n */\r\nMatrix4.IDENTITY = Object.freeze(\r\n new Matrix4(\r\n 1.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0\r\n )\r\n);\r\n\r\n/**\r\n * An immutable Matrix4 instance initialized to the zero matrix.\r\n *\r\n * @type {Matrix4}\r\n * @constant\r\n */\r\nMatrix4.ZERO = Object.freeze(\r\n new Matrix4(\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0\r\n )\r\n);\r\n\r\n/**\r\n * The index into Matrix4 for column 0, row 0.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN0ROW0 = 0;\r\n\r\n/**\r\n * The index into Matrix4 for column 0, row 1.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN0ROW1 = 1;\r\n\r\n/**\r\n * The index into Matrix4 for column 0, row 2.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN0ROW2 = 2;\r\n\r\n/**\r\n * The index into Matrix4 for column 0, row 3.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN0ROW3 = 3;\r\n\r\n/**\r\n * The index into Matrix4 for column 1, row 0.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN1ROW0 = 4;\r\n\r\n/**\r\n * The index into Matrix4 for column 1, row 1.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN1ROW1 = 5;\r\n\r\n/**\r\n * The index into Matrix4 for column 1, row 2.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN1ROW2 = 6;\r\n\r\n/**\r\n * The index into Matrix4 for column 1, row 3.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN1ROW3 = 7;\r\n\r\n/**\r\n * The index into Matrix4 for column 2, row 0.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN2ROW0 = 8;\r\n\r\n/**\r\n * The index into Matrix4 for column 2, row 1.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN2ROW1 = 9;\r\n\r\n/**\r\n * The index into Matrix4 for column 2, row 2.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN2ROW2 = 10;\r\n\r\n/**\r\n * The index into Matrix4 for column 2, row 3.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN2ROW3 = 11;\r\n\r\n/**\r\n * The index into Matrix4 for column 3, row 0.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN3ROW0 = 12;\r\n\r\n/**\r\n * The index into Matrix4 for column 3, row 1.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN3ROW1 = 13;\r\n\r\n/**\r\n * The index into Matrix4 for column 3, row 2.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN3ROW2 = 14;\r\n\r\n/**\r\n * The index into Matrix4 for column 3, row 3.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix4.COLUMN3ROW3 = 15;\r\n\r\nObject.defineProperties(Matrix4.prototype, {\r\n /**\r\n * Gets the number of items in the collection.\r\n * @memberof Matrix4.prototype\r\n *\r\n * @type {Number}\r\n */\r\n length: {\r\n get: function () {\r\n return Matrix4.packedLength;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Duplicates the provided Matrix4 instance.\r\n *\r\n * @param {Matrix4} [result] The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if one was not provided.\r\n */\r\nMatrix4.prototype.clone = function (result) {\r\n return Matrix4.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares this matrix to the provided matrix componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Matrix4} [right] The right hand side matrix.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nMatrix4.prototype.equals = function (right) {\r\n return Matrix4.equals(this, right);\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nMatrix4.equalsArray = function (matrix, array, offset) {\r\n return (\r\n matrix[0] === array[offset] &&\r\n matrix[1] === array[offset + 1] &&\r\n matrix[2] === array[offset + 2] &&\r\n matrix[3] === array[offset + 3] &&\r\n matrix[4] === array[offset + 4] &&\r\n matrix[5] === array[offset + 5] &&\r\n matrix[6] === array[offset + 6] &&\r\n matrix[7] === array[offset + 7] &&\r\n matrix[8] === array[offset + 8] &&\r\n matrix[9] === array[offset + 9] &&\r\n matrix[10] === array[offset + 10] &&\r\n matrix[11] === array[offset + 11] &&\r\n matrix[12] === array[offset + 12] &&\r\n matrix[13] === array[offset + 13] &&\r\n matrix[14] === array[offset + 14] &&\r\n matrix[15] === array[offset + 15]\r\n );\r\n};\r\n\r\n/**\r\n * Compares this matrix to the provided matrix componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Matrix4} [right] The right hand side matrix.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.\r\n */\r\nMatrix4.prototype.equalsEpsilon = function (right, epsilon) {\r\n return Matrix4.equalsEpsilon(this, right, epsilon);\r\n};\r\n\r\n/**\r\n * Computes a string representing this Matrix with each row being\r\n * on a separate line and in the format '(column0, column1, column2, column3)'.\r\n *\r\n * @returns {String} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2, column3)'.\r\n */\r\nMatrix4.prototype.toString = function () {\r\n return (\r\n `(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\\n` +\r\n `(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\\n` +\r\n `(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\\n` +\r\n `(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`\r\n );\r\n};\r\nexport default Matrix4;\r\n","import Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\n/**\r\n * A two dimensional region specified as longitude and latitude coordinates.\r\n *\r\n * @alias Rectangle\r\n * @constructor\r\n *\r\n * @param {Number} [west=0.0] The westernmost longitude, in radians, in the range [-Pi, Pi].\r\n * @param {Number} [south=0.0] The southernmost latitude, in radians, in the range [-Pi/2, Pi/2].\r\n * @param {Number} [east=0.0] The easternmost longitude, in radians, in the range [-Pi, Pi].\r\n * @param {Number} [north=0.0] The northernmost latitude, in radians, in the range [-Pi/2, Pi/2].\r\n *\r\n * @see Packable\r\n */\r\nfunction Rectangle(west, south, east, north) {\r\n /**\r\n * The westernmost longitude in radians in the range [-Pi, Pi].\r\n *\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.west = defaultValue(west, 0.0);\r\n\r\n /**\r\n * The southernmost latitude in radians in the range [-Pi/2, Pi/2].\r\n *\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.south = defaultValue(south, 0.0);\r\n\r\n /**\r\n * The easternmost longitude in radians in the range [-Pi, Pi].\r\n *\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.east = defaultValue(east, 0.0);\r\n\r\n /**\r\n * The northernmost latitude in radians in the range [-Pi/2, Pi/2].\r\n *\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.north = defaultValue(north, 0.0);\r\n}\r\n\r\nObject.defineProperties(Rectangle.prototype, {\r\n /**\r\n * Gets the width of the rectangle in radians.\r\n * @memberof Rectangle.prototype\r\n * @type {Number}\r\n * @readonly\r\n */\r\n width: {\r\n get: function () {\r\n return Rectangle.computeWidth(this);\r\n },\r\n },\r\n\r\n /**\r\n * Gets the height of the rectangle in radians.\r\n * @memberof Rectangle.prototype\r\n * @type {Number}\r\n * @readonly\r\n */\r\n height: {\r\n get: function () {\r\n return Rectangle.computeHeight(this);\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nRectangle.packedLength = 4;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {Rectangle} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nRectangle.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value.west;\r\n array[startingIndex++] = value.south;\r\n array[startingIndex++] = value.east;\r\n array[startingIndex] = value.north;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {Rectangle} [result] The object into which to store the result.\r\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided.\r\n */\r\nRectangle.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new Rectangle();\r\n }\r\n\r\n result.west = array[startingIndex++];\r\n result.south = array[startingIndex++];\r\n result.east = array[startingIndex++];\r\n result.north = array[startingIndex];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the width of a rectangle in radians.\r\n * @param {Rectangle} rectangle The rectangle to compute the width of.\r\n * @returns {Number} The width.\r\n */\r\nRectangle.computeWidth = function (rectangle) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n let east = rectangle.east;\r\n const west = rectangle.west;\r\n if (east < west) {\r\n east += CesiumMath.TWO_PI;\r\n }\r\n return east - west;\r\n};\r\n\r\n/**\r\n * Computes the height of a rectangle in radians.\r\n * @param {Rectangle} rectangle The rectangle to compute the height of.\r\n * @returns {Number} The height.\r\n */\r\nRectangle.computeHeight = function (rectangle) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n return rectangle.north - rectangle.south;\r\n};\r\n\r\n/**\r\n * Creates a rectangle given the boundary longitude and latitude in degrees.\r\n *\r\n * @param {Number} [west=0.0] The westernmost longitude in degrees in the range [-180.0, 180.0].\r\n * @param {Number} [south=0.0] The southernmost latitude in degrees in the range [-90.0, 90.0].\r\n * @param {Number} [east=0.0] The easternmost longitude in degrees in the range [-180.0, 180.0].\r\n * @param {Number} [north=0.0] The northernmost latitude in degrees in the range [-90.0, 90.0].\r\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\r\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\r\n *\r\n * @example\r\n * const rectangle = Cesium.Rectangle.fromDegrees(0.0, 20.0, 10.0, 30.0);\r\n */\r\nRectangle.fromDegrees = function (west, south, east, north, result) {\r\n west = CesiumMath.toRadians(defaultValue(west, 0.0));\r\n south = CesiumMath.toRadians(defaultValue(south, 0.0));\r\n east = CesiumMath.toRadians(defaultValue(east, 0.0));\r\n north = CesiumMath.toRadians(defaultValue(north, 0.0));\r\n\r\n if (!defined(result)) {\r\n return new Rectangle(west, south, east, north);\r\n }\r\n\r\n result.west = west;\r\n result.south = south;\r\n result.east = east;\r\n result.north = north;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a rectangle given the boundary longitude and latitude in radians.\r\n *\r\n * @param {Number} [west=0.0] The westernmost longitude in radians in the range [-Math.PI, Math.PI].\r\n * @param {Number} [south=0.0] The southernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].\r\n * @param {Number} [east=0.0] The easternmost longitude in radians in the range [-Math.PI, Math.PI].\r\n * @param {Number} [north=0.0] The northernmost latitude in radians in the range [-Math.PI/2, Math.PI/2].\r\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\r\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\r\n *\r\n * @example\r\n * const rectangle = Cesium.Rectangle.fromRadians(0.0, Math.PI/4, Math.PI/8, 3*Math.PI/4);\r\n */\r\nRectangle.fromRadians = function (west, south, east, north, result) {\r\n if (!defined(result)) {\r\n return new Rectangle(west, south, east, north);\r\n }\r\n\r\n result.west = defaultValue(west, 0.0);\r\n result.south = defaultValue(south, 0.0);\r\n result.east = defaultValue(east, 0.0);\r\n result.north = defaultValue(north, 0.0);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates the smallest possible Rectangle that encloses all positions in the provided array.\r\n *\r\n * @param {Cartographic[]} cartographics The list of Cartographic instances.\r\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\r\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\r\n */\r\nRectangle.fromCartographicArray = function (cartographics, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartographics\", cartographics);\r\n //>>includeEnd('debug');\r\n\r\n let west = Number.MAX_VALUE;\r\n let east = -Number.MAX_VALUE;\r\n let westOverIDL = Number.MAX_VALUE;\r\n let eastOverIDL = -Number.MAX_VALUE;\r\n let south = Number.MAX_VALUE;\r\n let north = -Number.MAX_VALUE;\r\n\r\n for (let i = 0, len = cartographics.length; i < len; i++) {\r\n const position = cartographics[i];\r\n west = Math.min(west, position.longitude);\r\n east = Math.max(east, position.longitude);\r\n south = Math.min(south, position.latitude);\r\n north = Math.max(north, position.latitude);\r\n\r\n const lonAdjusted =\r\n position.longitude >= 0\r\n ? position.longitude\r\n : position.longitude + CesiumMath.TWO_PI;\r\n westOverIDL = Math.min(westOverIDL, lonAdjusted);\r\n eastOverIDL = Math.max(eastOverIDL, lonAdjusted);\r\n }\r\n\r\n if (east - west > eastOverIDL - westOverIDL) {\r\n west = westOverIDL;\r\n east = eastOverIDL;\r\n\r\n if (east > CesiumMath.PI) {\r\n east = east - CesiumMath.TWO_PI;\r\n }\r\n if (west > CesiumMath.PI) {\r\n west = west - CesiumMath.TWO_PI;\r\n }\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Rectangle(west, south, east, north);\r\n }\r\n\r\n result.west = west;\r\n result.south = south;\r\n result.east = east;\r\n result.north = north;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates the smallest possible Rectangle that encloses all positions in the provided array.\r\n *\r\n * @param {Cartesian3[]} cartesians The list of Cartesian instances.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid the cartesians are on.\r\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\r\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\r\n */\r\nRectangle.fromCartesianArray = function (cartesians, ellipsoid, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartesians\", cartesians);\r\n //>>includeEnd('debug');\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n\r\n let west = Number.MAX_VALUE;\r\n let east = -Number.MAX_VALUE;\r\n let westOverIDL = Number.MAX_VALUE;\r\n let eastOverIDL = -Number.MAX_VALUE;\r\n let south = Number.MAX_VALUE;\r\n let north = -Number.MAX_VALUE;\r\n\r\n for (let i = 0, len = cartesians.length; i < len; i++) {\r\n const position = ellipsoid.cartesianToCartographic(cartesians[i]);\r\n west = Math.min(west, position.longitude);\r\n east = Math.max(east, position.longitude);\r\n south = Math.min(south, position.latitude);\r\n north = Math.max(north, position.latitude);\r\n\r\n const lonAdjusted =\r\n position.longitude >= 0\r\n ? position.longitude\r\n : position.longitude + CesiumMath.TWO_PI;\r\n westOverIDL = Math.min(westOverIDL, lonAdjusted);\r\n eastOverIDL = Math.max(eastOverIDL, lonAdjusted);\r\n }\r\n\r\n if (east - west > eastOverIDL - westOverIDL) {\r\n west = westOverIDL;\r\n east = eastOverIDL;\r\n\r\n if (east > CesiumMath.PI) {\r\n east = east - CesiumMath.TWO_PI;\r\n }\r\n if (west > CesiumMath.PI) {\r\n west = west - CesiumMath.TWO_PI;\r\n }\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Rectangle(west, south, east, north);\r\n }\r\n\r\n result.west = west;\r\n result.south = south;\r\n result.east = east;\r\n result.north = north;\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a Rectangle.\r\n *\r\n * @param {Rectangle} rectangle The rectangle to clone.\r\n * @param {Rectangle} [result] The object onto which to store the result, or undefined if a new instance should be created.\r\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided. (Returns undefined if rectangle is undefined)\r\n */\r\nRectangle.clone = function (rectangle, result) {\r\n if (!defined(rectangle)) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Rectangle(\r\n rectangle.west,\r\n rectangle.south,\r\n rectangle.east,\r\n rectangle.north\r\n );\r\n }\r\n\r\n result.west = rectangle.west;\r\n result.south = rectangle.south;\r\n result.east = rectangle.east;\r\n result.north = rectangle.north;\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided Rectangles componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {Rectangle} [left] The first Rectangle.\r\n * @param {Rectangle} [right] The second Rectangle.\r\n * @param {Number} [absoluteEpsilon=0] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nRectangle.equalsEpsilon = function (left, right, absoluteEpsilon) {\r\n absoluteEpsilon = defaultValue(absoluteEpsilon, 0);\r\n\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n Math.abs(left.west - right.west) <= absoluteEpsilon &&\r\n Math.abs(left.south - right.south) <= absoluteEpsilon &&\r\n Math.abs(left.east - right.east) <= absoluteEpsilon &&\r\n Math.abs(left.north - right.north) <= absoluteEpsilon)\r\n );\r\n};\r\n\r\n/**\r\n * Duplicates this Rectangle.\r\n *\r\n * @param {Rectangle} [result] The object onto which to store the result.\r\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\r\n */\r\nRectangle.prototype.clone = function (result) {\r\n return Rectangle.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares the provided Rectangle with this Rectangle componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Rectangle} [other] The Rectangle to compare.\r\n * @returns {Boolean} true
if the Rectangles are equal, false
otherwise.\r\n */\r\nRectangle.prototype.equals = function (other) {\r\n return Rectangle.equals(this, other);\r\n};\r\n\r\n/**\r\n * Compares the provided rectangles and returns true
if they are equal,\r\n * false
otherwise.\r\n *\r\n * @param {Rectangle} [left] The first Rectangle.\r\n * @param {Rectangle} [right] The second Rectangle.\r\n * @returns {Boolean} true
if left and right are equal; otherwise false
.\r\n */\r\nRectangle.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left.west === right.west &&\r\n left.south === right.south &&\r\n left.east === right.east &&\r\n left.north === right.north)\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided Rectangle with this Rectangle componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Rectangle} [other] The Rectangle to compare.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if the Rectangles are within the provided epsilon, false
otherwise.\r\n */\r\nRectangle.prototype.equalsEpsilon = function (other, epsilon) {\r\n return Rectangle.equalsEpsilon(this, other, epsilon);\r\n};\r\n\r\n/**\r\n * Checks a Rectangle's properties and throws if they are not in valid ranges.\r\n *\r\n * @param {Rectangle} rectangle The rectangle to validate\r\n *\r\n * @exception {DeveloperError} north
must be in the interval [-Pi/2
, Pi/2
].\r\n * @exception {DeveloperError} south
must be in the interval [-Pi/2
, Pi/2
].\r\n * @exception {DeveloperError} east
must be in the interval [-Pi
, Pi
].\r\n * @exception {DeveloperError} west
must be in the interval [-Pi
, Pi
].\r\n */\r\nRectangle.validate = function (rectangle) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n\r\n const north = rectangle.north;\r\n Check.typeOf.number.greaterThanOrEquals(\r\n \"north\",\r\n north,\r\n -CesiumMath.PI_OVER_TWO\r\n );\r\n Check.typeOf.number.lessThanOrEquals(\"north\", north, CesiumMath.PI_OVER_TWO);\r\n\r\n const south = rectangle.south;\r\n Check.typeOf.number.greaterThanOrEquals(\r\n \"south\",\r\n south,\r\n -CesiumMath.PI_OVER_TWO\r\n );\r\n Check.typeOf.number.lessThanOrEquals(\"south\", south, CesiumMath.PI_OVER_TWO);\r\n\r\n const west = rectangle.west;\r\n Check.typeOf.number.greaterThanOrEquals(\"west\", west, -Math.PI);\r\n Check.typeOf.number.lessThanOrEquals(\"west\", west, Math.PI);\r\n\r\n const east = rectangle.east;\r\n Check.typeOf.number.greaterThanOrEquals(\"east\", east, -Math.PI);\r\n Check.typeOf.number.lessThanOrEquals(\"east\", east, Math.PI);\r\n //>>includeEnd('debug');\r\n};\r\n\r\n/**\r\n * Computes the southwest corner of a rectangle.\r\n *\r\n * @param {Rectangle} rectangle The rectangle for which to find the corner\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\r\n */\r\nRectangle.southwest = function (rectangle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Cartographic(rectangle.west, rectangle.south);\r\n }\r\n result.longitude = rectangle.west;\r\n result.latitude = rectangle.south;\r\n result.height = 0.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the northwest corner of a rectangle.\r\n *\r\n * @param {Rectangle} rectangle The rectangle for which to find the corner\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\r\n */\r\nRectangle.northwest = function (rectangle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Cartographic(rectangle.west, rectangle.north);\r\n }\r\n result.longitude = rectangle.west;\r\n result.latitude = rectangle.north;\r\n result.height = 0.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the northeast corner of a rectangle.\r\n *\r\n * @param {Rectangle} rectangle The rectangle for which to find the corner\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\r\n */\r\nRectangle.northeast = function (rectangle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Cartographic(rectangle.east, rectangle.north);\r\n }\r\n result.longitude = rectangle.east;\r\n result.latitude = rectangle.north;\r\n result.height = 0.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the southeast corner of a rectangle.\r\n *\r\n * @param {Rectangle} rectangle The rectangle for which to find the corner\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\r\n */\r\nRectangle.southeast = function (rectangle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Cartographic(rectangle.east, rectangle.south);\r\n }\r\n result.longitude = rectangle.east;\r\n result.latitude = rectangle.south;\r\n result.height = 0.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the center of a rectangle.\r\n *\r\n * @param {Rectangle} rectangle The rectangle for which to find the center\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if none was provided.\r\n */\r\nRectangle.center = function (rectangle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n\r\n let east = rectangle.east;\r\n const west = rectangle.west;\r\n\r\n if (east < west) {\r\n east += CesiumMath.TWO_PI;\r\n }\r\n\r\n const longitude = CesiumMath.negativePiToPi((west + east) * 0.5);\r\n const latitude = (rectangle.south + rectangle.north) * 0.5;\r\n\r\n if (!defined(result)) {\r\n return new Cartographic(longitude, latitude);\r\n }\r\n\r\n result.longitude = longitude;\r\n result.latitude = latitude;\r\n result.height = 0.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are\r\n * latitude and longitude in radians and produces a correct intersection, taking into account the fact that\r\n * the same angle can be represented with multiple values as well as the wrapping of longitude at the\r\n * anti-meridian. For a simple intersection that ignores these factors and can be used with projected\r\n * coordinates, see {@link Rectangle.simpleIntersection}.\r\n *\r\n * @param {Rectangle} rectangle On rectangle to find an intersection\r\n * @param {Rectangle} otherRectangle Another rectangle to find an intersection\r\n * @param {Rectangle} [result] The object onto which to store the result.\r\n * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.\r\n */\r\nRectangle.intersection = function (rectangle, otherRectangle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n Check.typeOf.object(\"otherRectangle\", otherRectangle);\r\n //>>includeEnd('debug');\r\n\r\n let rectangleEast = rectangle.east;\r\n let rectangleWest = rectangle.west;\r\n\r\n let otherRectangleEast = otherRectangle.east;\r\n let otherRectangleWest = otherRectangle.west;\r\n\r\n if (rectangleEast < rectangleWest && otherRectangleEast > 0.0) {\r\n rectangleEast += CesiumMath.TWO_PI;\r\n } else if (otherRectangleEast < otherRectangleWest && rectangleEast > 0.0) {\r\n otherRectangleEast += CesiumMath.TWO_PI;\r\n }\r\n\r\n if (rectangleEast < rectangleWest && otherRectangleWest < 0.0) {\r\n otherRectangleWest += CesiumMath.TWO_PI;\r\n } else if (otherRectangleEast < otherRectangleWest && rectangleWest < 0.0) {\r\n rectangleWest += CesiumMath.TWO_PI;\r\n }\r\n\r\n const west = CesiumMath.negativePiToPi(\r\n Math.max(rectangleWest, otherRectangleWest)\r\n );\r\n const east = CesiumMath.negativePiToPi(\r\n Math.min(rectangleEast, otherRectangleEast)\r\n );\r\n\r\n if (\r\n (rectangle.west < rectangle.east ||\r\n otherRectangle.west < otherRectangle.east) &&\r\n east <= west\r\n ) {\r\n return undefined;\r\n }\r\n\r\n const south = Math.max(rectangle.south, otherRectangle.south);\r\n const north = Math.min(rectangle.north, otherRectangle.north);\r\n\r\n if (south >= north) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Rectangle(west, south, east, north);\r\n }\r\n result.west = west;\r\n result.south = south;\r\n result.east = east;\r\n result.north = north;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function\r\n * does not attempt to put the angular coordinates into a consistent range or to account for crossing the\r\n * anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude\r\n * and longitude (i.e. projected coordinates).\r\n *\r\n * @param {Rectangle} rectangle On rectangle to find an intersection\r\n * @param {Rectangle} otherRectangle Another rectangle to find an intersection\r\n * @param {Rectangle} [result] The object onto which to store the result.\r\n * @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.\r\n */\r\nRectangle.simpleIntersection = function (rectangle, otherRectangle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n Check.typeOf.object(\"otherRectangle\", otherRectangle);\r\n //>>includeEnd('debug');\r\n\r\n const west = Math.max(rectangle.west, otherRectangle.west);\r\n const south = Math.max(rectangle.south, otherRectangle.south);\r\n const east = Math.min(rectangle.east, otherRectangle.east);\r\n const north = Math.min(rectangle.north, otherRectangle.north);\r\n\r\n if (south >= north || west >= east) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Rectangle(west, south, east, north);\r\n }\r\n\r\n result.west = west;\r\n result.south = south;\r\n result.east = east;\r\n result.north = north;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a rectangle that is the union of two rectangles.\r\n *\r\n * @param {Rectangle} rectangle A rectangle to enclose in rectangle.\r\n * @param {Rectangle} otherRectangle A rectangle to enclose in a rectangle.\r\n * @param {Rectangle} [result] The object onto which to store the result.\r\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\r\n */\r\nRectangle.union = function (rectangle, otherRectangle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n Check.typeOf.object(\"otherRectangle\", otherRectangle);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Rectangle();\r\n }\r\n\r\n let rectangleEast = rectangle.east;\r\n let rectangleWest = rectangle.west;\r\n\r\n let otherRectangleEast = otherRectangle.east;\r\n let otherRectangleWest = otherRectangle.west;\r\n\r\n if (rectangleEast < rectangleWest && otherRectangleEast > 0.0) {\r\n rectangleEast += CesiumMath.TWO_PI;\r\n } else if (otherRectangleEast < otherRectangleWest && rectangleEast > 0.0) {\r\n otherRectangleEast += CesiumMath.TWO_PI;\r\n }\r\n\r\n if (rectangleEast < rectangleWest && otherRectangleWest < 0.0) {\r\n otherRectangleWest += CesiumMath.TWO_PI;\r\n } else if (otherRectangleEast < otherRectangleWest && rectangleWest < 0.0) {\r\n rectangleWest += CesiumMath.TWO_PI;\r\n }\r\n\r\n const west = CesiumMath.negativePiToPi(\r\n Math.min(rectangleWest, otherRectangleWest)\r\n );\r\n const east = CesiumMath.negativePiToPi(\r\n Math.max(rectangleEast, otherRectangleEast)\r\n );\r\n\r\n result.west = west;\r\n result.south = Math.min(rectangle.south, otherRectangle.south);\r\n result.east = east;\r\n result.north = Math.max(rectangle.north, otherRectangle.north);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a rectangle by enlarging the provided rectangle until it contains the provided cartographic.\r\n *\r\n * @param {Rectangle} rectangle A rectangle to expand.\r\n * @param {Cartographic} cartographic A cartographic to enclose in a rectangle.\r\n * @param {Rectangle} [result] The object onto which to store the result.\r\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if one was not provided.\r\n */\r\nRectangle.expand = function (rectangle, cartographic, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n Check.typeOf.object(\"cartographic\", cartographic);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Rectangle();\r\n }\r\n\r\n result.west = Math.min(rectangle.west, cartographic.longitude);\r\n result.south = Math.min(rectangle.south, cartographic.latitude);\r\n result.east = Math.max(rectangle.east, cartographic.longitude);\r\n result.north = Math.max(rectangle.north, cartographic.latitude);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns true if the cartographic is on or inside the rectangle, false otherwise.\r\n *\r\n * @param {Rectangle} rectangle The rectangle\r\n * @param {Cartographic} cartographic The cartographic to test.\r\n * @returns {Boolean} true if the provided cartographic is inside the rectangle, false otherwise.\r\n */\r\nRectangle.contains = function (rectangle, cartographic) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n Check.typeOf.object(\"cartographic\", cartographic);\r\n //>>includeEnd('debug');\r\n\r\n let longitude = cartographic.longitude;\r\n const latitude = cartographic.latitude;\r\n\r\n const west = rectangle.west;\r\n let east = rectangle.east;\r\n\r\n if (east < west) {\r\n east += CesiumMath.TWO_PI;\r\n if (longitude < 0.0) {\r\n longitude += CesiumMath.TWO_PI;\r\n }\r\n }\r\n return (\r\n (longitude > west ||\r\n CesiumMath.equalsEpsilon(longitude, west, CesiumMath.EPSILON14)) &&\r\n (longitude < east ||\r\n CesiumMath.equalsEpsilon(longitude, east, CesiumMath.EPSILON14)) &&\r\n latitude >= rectangle.south &&\r\n latitude <= rectangle.north\r\n );\r\n};\r\n\r\nconst subsampleLlaScratch = new Cartographic();\r\n/**\r\n * Samples a rectangle so that it includes a list of Cartesian points suitable for passing to\r\n * {@link BoundingSphere#fromPoints}. Sampling is necessary to account\r\n * for rectangles that cover the poles or cross the equator.\r\n *\r\n * @param {Rectangle} rectangle The rectangle to subsample.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to use.\r\n * @param {Number} [surfaceHeight=0.0] The height of the rectangle above the ellipsoid.\r\n * @param {Cartesian3[]} [result] The array of Cartesians onto which to store the result.\r\n * @returns {Cartesian3[]} The modified result parameter or a new Array of Cartesians instances if none was provided.\r\n */\r\nRectangle.subsample = function (rectangle, ellipsoid, surfaceHeight, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n surfaceHeight = defaultValue(surfaceHeight, 0.0);\r\n\r\n if (!defined(result)) {\r\n result = [];\r\n }\r\n let length = 0;\r\n\r\n const north = rectangle.north;\r\n const south = rectangle.south;\r\n const east = rectangle.east;\r\n const west = rectangle.west;\r\n\r\n const lla = subsampleLlaScratch;\r\n lla.height = surfaceHeight;\r\n\r\n lla.longitude = west;\r\n lla.latitude = north;\r\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\r\n length++;\r\n\r\n lla.longitude = east;\r\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\r\n length++;\r\n\r\n lla.latitude = south;\r\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\r\n length++;\r\n\r\n lla.longitude = west;\r\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\r\n length++;\r\n\r\n if (north < 0.0) {\r\n lla.latitude = north;\r\n } else if (south > 0.0) {\r\n lla.latitude = south;\r\n } else {\r\n lla.latitude = 0.0;\r\n }\r\n\r\n for (let i = 1; i < 8; ++i) {\r\n lla.longitude = -Math.PI + i * CesiumMath.PI_OVER_TWO;\r\n if (Rectangle.contains(rectangle, lla)) {\r\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\r\n length++;\r\n }\r\n }\r\n\r\n if (lla.latitude === 0.0) {\r\n lla.longitude = west;\r\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\r\n length++;\r\n lla.longitude = east;\r\n result[length] = ellipsoid.cartographicToCartesian(lla, result[length]);\r\n length++;\r\n }\r\n result.length = length;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a subsection of a rectangle from normalized coordinates in the range [0.0, 1.0].\r\n *\r\n * @param {Rectangle} rectangle The rectangle to subsection.\r\n * @param {Number} westLerp The west interpolation factor in the range [0.0, 1.0]. Must be less than or equal to eastLerp.\r\n * @param {Number} southLerp The south interpolation factor in the range [0.0, 1.0]. Must be less than or equal to northLerp.\r\n * @param {Number} eastLerp The east interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to westLerp.\r\n * @param {Number} northLerp The north interpolation factor in the range [0.0, 1.0]. Must be greater than or equal to southLerp.\r\n * @param {Rectangle} [result] The object onto which to store the result.\r\n * @returns {Rectangle} The modified result parameter or a new Rectangle instance if none was provided.\r\n */\r\nRectangle.subsection = function (\r\n rectangle,\r\n westLerp,\r\n southLerp,\r\n eastLerp,\r\n northLerp,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n Check.typeOf.number.greaterThanOrEquals(\"westLerp\", westLerp, 0.0);\r\n Check.typeOf.number.lessThanOrEquals(\"westLerp\", westLerp, 1.0);\r\n Check.typeOf.number.greaterThanOrEquals(\"southLerp\", southLerp, 0.0);\r\n Check.typeOf.number.lessThanOrEquals(\"southLerp\", southLerp, 1.0);\r\n Check.typeOf.number.greaterThanOrEquals(\"eastLerp\", eastLerp, 0.0);\r\n Check.typeOf.number.lessThanOrEquals(\"eastLerp\", eastLerp, 1.0);\r\n Check.typeOf.number.greaterThanOrEquals(\"northLerp\", northLerp, 0.0);\r\n Check.typeOf.number.lessThanOrEquals(\"northLerp\", northLerp, 1.0);\r\n\r\n Check.typeOf.number.lessThanOrEquals(\"westLerp\", westLerp, eastLerp);\r\n Check.typeOf.number.lessThanOrEquals(\"southLerp\", southLerp, northLerp);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Rectangle();\r\n }\r\n\r\n // This function doesn't use CesiumMath.lerp because it has floating point precision problems\r\n // when the start and end values are the same but the t changes.\r\n\r\n if (rectangle.west <= rectangle.east) {\r\n const width = rectangle.east - rectangle.west;\r\n result.west = rectangle.west + westLerp * width;\r\n result.east = rectangle.west + eastLerp * width;\r\n } else {\r\n const width = CesiumMath.TWO_PI + rectangle.east - rectangle.west;\r\n result.west = CesiumMath.negativePiToPi(rectangle.west + westLerp * width);\r\n result.east = CesiumMath.negativePiToPi(rectangle.west + eastLerp * width);\r\n }\r\n const height = rectangle.north - rectangle.south;\r\n result.south = rectangle.south + southLerp * height;\r\n result.north = rectangle.south + northLerp * height;\r\n\r\n // Fix floating point precision problems when t = 1\r\n if (westLerp === 1.0) {\r\n result.west = rectangle.east;\r\n }\r\n if (eastLerp === 1.0) {\r\n result.east = rectangle.east;\r\n }\r\n if (southLerp === 1.0) {\r\n result.south = rectangle.north;\r\n }\r\n if (northLerp === 1.0) {\r\n result.north = rectangle.north;\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * The largest possible rectangle.\r\n *\r\n * @type {Rectangle}\r\n * @constant\r\n */\r\nRectangle.MAX_VALUE = Object.freeze(\r\n new Rectangle(\r\n -Math.PI,\r\n -CesiumMath.PI_OVER_TWO,\r\n Math.PI,\r\n CesiumMath.PI_OVER_TWO\r\n )\r\n);\r\nexport default Rectangle;\r\n","import Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\n/**\r\n * A 2D Cartesian point.\r\n * @alias Cartesian2\r\n * @constructor\r\n *\r\n * @param {Number} [x=0.0] The X component.\r\n * @param {Number} [y=0.0] The Y component.\r\n *\r\n * @see Cartesian3\r\n * @see Cartesian4\r\n * @see Packable\r\n */\r\nfunction Cartesian2(x, y) {\r\n /**\r\n * The X component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.x = defaultValue(x, 0.0);\r\n\r\n /**\r\n * The Y component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.y = defaultValue(y, 0.0);\r\n}\r\n\r\n/**\r\n * Creates a Cartesian2 instance from x and y coordinates.\r\n *\r\n * @param {Number} x The x coordinate.\r\n * @param {Number} y The y coordinate.\r\n * @param {Cartesian2} [result] The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\r\n */\r\nCartesian2.fromElements = function (x, y, result) {\r\n if (!defined(result)) {\r\n return new Cartesian2(x, y);\r\n }\r\n\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a Cartesian2 instance.\r\n *\r\n * @param {Cartesian2} cartesian The Cartesian to duplicate.\r\n * @param {Cartesian2} [result] The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided. (Returns undefined if cartesian is undefined)\r\n */\r\nCartesian2.clone = function (cartesian, result) {\r\n if (!defined(cartesian)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n return new Cartesian2(cartesian.x, cartesian.y);\r\n }\r\n\r\n result.x = cartesian.x;\r\n result.y = cartesian.y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Cartesian2 instance from an existing Cartesian3. This simply takes the\r\n * x and y properties of the Cartesian3 and drops z.\r\n * @function\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian3 instance to create a Cartesian2 instance from.\r\n * @param {Cartesian2} [result] The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\r\n */\r\nCartesian2.fromCartesian3 = Cartesian2.clone;\r\n\r\n/**\r\n * Creates a Cartesian2 instance from an existing Cartesian4. This simply takes the\r\n * x and y properties of the Cartesian4 and drops z and w.\r\n * @function\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian4 instance to create a Cartesian2 instance from.\r\n * @param {Cartesian2} [result] The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\r\n */\r\nCartesian2.fromCartesian4 = Cartesian2.clone;\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nCartesian2.packedLength = 2;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {Cartesian2} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCartesian2.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value.x;\r\n array[startingIndex] = value.y;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {Cartesian2} [result] The object into which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\r\n */\r\nCartesian2.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian2();\r\n }\r\n result.x = array[startingIndex++];\r\n result.y = array[startingIndex];\r\n return result;\r\n};\r\n\r\n/**\r\n * Flattens an array of Cartesian2s into an array of components.\r\n *\r\n * @param {Cartesian2[]} array The array of cartesians to pack.\r\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 2 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 2) elements.\r\n * @returns {Number[]} The packed array.\r\n */\r\nCartesian2.packArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n const resultLength = length * 2;\r\n if (!defined(result)) {\r\n result = new Array(resultLength);\r\n } else if (!Array.isArray(result) && result.length !== resultLength) {\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(\r\n \"If result is a typed array, it must have exactly array.length * 2 elements\"\r\n );\r\n //>>includeEnd('debug');\r\n } else if (result.length !== resultLength) {\r\n result.length = resultLength;\r\n }\r\n\r\n for (let i = 0; i < length; ++i) {\r\n Cartesian2.pack(array[i], result, i * 2);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Unpacks an array of cartesian components into an array of Cartesian2s.\r\n *\r\n * @param {Number[]} array The array of components to unpack.\r\n * @param {Cartesian2[]} [result] The array onto which to store the result.\r\n * @returns {Cartesian2[]} The unpacked array.\r\n */\r\nCartesian2.unpackArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 2);\r\n if (array.length % 2 !== 0) {\r\n throw new DeveloperError(\"array length must be a multiple of 2.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n if (!defined(result)) {\r\n result = new Array(length / 2);\r\n } else {\r\n result.length = length / 2;\r\n }\r\n\r\n for (let i = 0; i < length; i += 2) {\r\n const index = i / 2;\r\n result[index] = Cartesian2.unpack(array, i, result[index]);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Cartesian2 from two consecutive elements in an array.\r\n * @function\r\n *\r\n * @param {Number[]} array The array whose two consecutive elements correspond to the x and y components, respectively.\r\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\r\n * @param {Cartesian2} [result] The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\r\n *\r\n * @example\r\n * // Create a Cartesian2 with (1.0, 2.0)\r\n * const v = [1.0, 2.0];\r\n * const p = Cesium.Cartesian2.fromArray(v);\r\n *\r\n * // Create a Cartesian2 with (1.0, 2.0) using an offset into an array\r\n * const v2 = [0.0, 0.0, 1.0, 2.0];\r\n * const p2 = Cesium.Cartesian2.fromArray(v2, 2);\r\n */\r\nCartesian2.fromArray = Cartesian2.unpack;\r\n\r\n/**\r\n * Computes the value of the maximum component for the supplied Cartesian.\r\n *\r\n * @param {Cartesian2} cartesian The cartesian to use.\r\n * @returns {Number} The value of the maximum component.\r\n */\r\nCartesian2.maximumComponent = function (cartesian) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n return Math.max(cartesian.x, cartesian.y);\r\n};\r\n\r\n/**\r\n * Computes the value of the minimum component for the supplied Cartesian.\r\n *\r\n * @param {Cartesian2} cartesian The cartesian to use.\r\n * @returns {Number} The value of the minimum component.\r\n */\r\nCartesian2.minimumComponent = function (cartesian) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n return Math.min(cartesian.x, cartesian.y);\r\n};\r\n\r\n/**\r\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\r\n *\r\n * @param {Cartesian2} first A cartesian to compare.\r\n * @param {Cartesian2} second A cartesian to compare.\r\n * @param {Cartesian2} result The object into which to store the result.\r\n * @returns {Cartesian2} A cartesian with the minimum components.\r\n */\r\nCartesian2.minimumByComponent = function (first, second, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"first\", first);\r\n Check.typeOf.object(\"second\", second);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Math.min(first.x, second.x);\r\n result.y = Math.min(first.y, second.y);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\r\n *\r\n * @param {Cartesian2} first A cartesian to compare.\r\n * @param {Cartesian2} second A cartesian to compare.\r\n * @param {Cartesian2} result The object into which to store the result.\r\n * @returns {Cartesian2} A cartesian with the maximum components.\r\n */\r\nCartesian2.maximumByComponent = function (first, second, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"first\", first);\r\n Check.typeOf.object(\"second\", second);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Math.max(first.x, second.x);\r\n result.y = Math.max(first.y, second.y);\r\n return result;\r\n};\r\n\r\n/**\r\n * Constrain a value to lie between two values.\r\n *\r\n * @param {Cartesian2} value The value to clamp.\r\n * @param {Cartesian2} min The minimum bound.\r\n * @param {Cartesian2} max The maximum bound.\r\n * @param {Cartesian2} result The object into which to store the result.\r\n * @returns {Cartesian2} The clamped value such that min <= result <= max.\r\n */\r\nCartesian2.clamp = function (value, min, max, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.typeOf.object(\"min\", min);\r\n Check.typeOf.object(\"max\", max);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const x = CesiumMath.clamp(value.x, min.x, max.x);\r\n const y = CesiumMath.clamp(value.y, min.y, max.y);\r\n\r\n result.x = x;\r\n result.y = y;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the provided Cartesian's squared magnitude.\r\n *\r\n * @param {Cartesian2} cartesian The Cartesian instance whose squared magnitude is to be computed.\r\n * @returns {Number} The squared magnitude.\r\n */\r\nCartesian2.magnitudeSquared = function (cartesian) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n return cartesian.x * cartesian.x + cartesian.y * cartesian.y;\r\n};\r\n\r\n/**\r\n * Computes the Cartesian's magnitude (length).\r\n *\r\n * @param {Cartesian2} cartesian The Cartesian instance whose magnitude is to be computed.\r\n * @returns {Number} The magnitude.\r\n */\r\nCartesian2.magnitude = function (cartesian) {\r\n return Math.sqrt(Cartesian2.magnitudeSquared(cartesian));\r\n};\r\n\r\nconst distanceScratch = new Cartesian2();\r\n\r\n/**\r\n * Computes the distance between two points.\r\n *\r\n * @param {Cartesian2} left The first point to compute the distance from.\r\n * @param {Cartesian2} right The second point to compute the distance to.\r\n * @returns {Number} The distance between two points.\r\n *\r\n * @example\r\n * // Returns 1.0\r\n * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(2.0, 0.0));\r\n */\r\nCartesian2.distance = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian2.subtract(left, right, distanceScratch);\r\n return Cartesian2.magnitude(distanceScratch);\r\n};\r\n\r\n/**\r\n * Computes the squared distance between two points. Comparing squared distances\r\n * using this function is more efficient than comparing distances using {@link Cartesian2#distance}.\r\n *\r\n * @param {Cartesian2} left The first point to compute the distance from.\r\n * @param {Cartesian2} right The second point to compute the distance to.\r\n * @returns {Number} The distance between two points.\r\n *\r\n * @example\r\n * // Returns 4.0, not 2.0\r\n * const d = Cesium.Cartesian2.distance(new Cesium.Cartesian2(1.0, 0.0), new Cesium.Cartesian2(3.0, 0.0));\r\n */\r\nCartesian2.distanceSquared = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian2.subtract(left, right, distanceScratch);\r\n return Cartesian2.magnitudeSquared(distanceScratch);\r\n};\r\n\r\n/**\r\n * Computes the normalized form of the supplied Cartesian.\r\n *\r\n * @param {Cartesian2} cartesian The Cartesian to be normalized.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nCartesian2.normalize = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const magnitude = Cartesian2.magnitude(cartesian);\r\n\r\n result.x = cartesian.x / magnitude;\r\n result.y = cartesian.y / magnitude;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (isNaN(result.x) || isNaN(result.y)) {\r\n throw new DeveloperError(\"normalized result is not a number\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the dot (scalar) product of two Cartesians.\r\n *\r\n * @param {Cartesian2} left The first Cartesian.\r\n * @param {Cartesian2} right The second Cartesian.\r\n * @returns {Number} The dot product.\r\n */\r\nCartesian2.dot = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n return left.x * right.x + left.y * right.y;\r\n};\r\n\r\n/**\r\n * Computes the magnitude of the cross product that would result from implicitly setting the Z coordinate of the input vectors to 0\r\n *\r\n * @param {Cartesian2} left The first Cartesian.\r\n * @param {Cartesian2} right The second Cartesian.\r\n * @returns {Number} The cross product.\r\n */\r\nCartesian2.cross = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n return left.x * right.y - left.y * right.x;\r\n};\r\n\r\n/**\r\n * Computes the componentwise product of two Cartesians.\r\n *\r\n * @param {Cartesian2} left The first Cartesian.\r\n * @param {Cartesian2} right The second Cartesian.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nCartesian2.multiplyComponents = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x * right.x;\r\n result.y = left.y * right.y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise quotient of two Cartesians.\r\n *\r\n * @param {Cartesian2} left The first Cartesian.\r\n * @param {Cartesian2} right The second Cartesian.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nCartesian2.divideComponents = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x / right.x;\r\n result.y = left.y / right.y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise sum of two Cartesians.\r\n *\r\n * @param {Cartesian2} left The first Cartesian.\r\n * @param {Cartesian2} right The second Cartesian.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nCartesian2.add = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x + right.x;\r\n result.y = left.y + right.y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise difference of two Cartesians.\r\n *\r\n * @param {Cartesian2} left The first Cartesian.\r\n * @param {Cartesian2} right The second Cartesian.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nCartesian2.subtract = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x - right.x;\r\n result.y = left.y - right.y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Multiplies the provided Cartesian componentwise by the provided scalar.\r\n *\r\n * @param {Cartesian2} cartesian The Cartesian to be scaled.\r\n * @param {Number} scalar The scalar to multiply with.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nCartesian2.multiplyByScalar = function (cartesian, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = cartesian.x * scalar;\r\n result.y = cartesian.y * scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Divides the provided Cartesian componentwise by the provided scalar.\r\n *\r\n * @param {Cartesian2} cartesian The Cartesian to be divided.\r\n * @param {Number} scalar The scalar to divide by.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nCartesian2.divideByScalar = function (cartesian, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = cartesian.x / scalar;\r\n result.y = cartesian.y / scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Negates the provided Cartesian.\r\n *\r\n * @param {Cartesian2} cartesian The Cartesian to be negated.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nCartesian2.negate = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = -cartesian.x;\r\n result.y = -cartesian.y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the absolute value of the provided Cartesian.\r\n *\r\n * @param {Cartesian2} cartesian The Cartesian whose absolute value is to be computed.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nCartesian2.abs = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Math.abs(cartesian.x);\r\n result.y = Math.abs(cartesian.y);\r\n return result;\r\n};\r\n\r\nconst lerpScratch = new Cartesian2();\r\n/**\r\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\r\n *\r\n * @param {Cartesian2} start The value corresponding to t at 0.0.\r\n * @param {Cartesian2} end The value corresponding to t at 1.0.\r\n * @param {Number} t The point along t at which to interpolate.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nCartesian2.lerp = function (start, end, t, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"start\", start);\r\n Check.typeOf.object(\"end\", end);\r\n Check.typeOf.number(\"t\", t);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian2.multiplyByScalar(end, t, lerpScratch);\r\n result = Cartesian2.multiplyByScalar(start, 1.0 - t, result);\r\n return Cartesian2.add(lerpScratch, result, result);\r\n};\r\n\r\nconst angleBetweenScratch = new Cartesian2();\r\nconst angleBetweenScratch2 = new Cartesian2();\r\n/**\r\n * Returns the angle, in radians, between the provided Cartesians.\r\n *\r\n * @param {Cartesian2} left The first Cartesian.\r\n * @param {Cartesian2} right The second Cartesian.\r\n * @returns {Number} The angle between the Cartesians.\r\n */\r\nCartesian2.angleBetween = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian2.normalize(left, angleBetweenScratch);\r\n Cartesian2.normalize(right, angleBetweenScratch2);\r\n return CesiumMath.acosClamped(\r\n Cartesian2.dot(angleBetweenScratch, angleBetweenScratch2)\r\n );\r\n};\r\n\r\nconst mostOrthogonalAxisScratch = new Cartesian2();\r\n/**\r\n * Returns the axis that is most orthogonal to the provided Cartesian.\r\n *\r\n * @param {Cartesian2} cartesian The Cartesian on which to find the most orthogonal axis.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The most orthogonal axis.\r\n */\r\nCartesian2.mostOrthogonalAxis = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const f = Cartesian2.normalize(cartesian, mostOrthogonalAxisScratch);\r\n Cartesian2.abs(f, f);\r\n\r\n if (f.x <= f.y) {\r\n result = Cartesian2.clone(Cartesian2.UNIT_X, result);\r\n } else {\r\n result = Cartesian2.clone(Cartesian2.UNIT_Y, result);\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided Cartesians componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Cartesian2} [left] The first Cartesian.\r\n * @param {Cartesian2} [right] The second Cartesian.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nCartesian2.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left.x === right.x &&\r\n left.y === right.y)\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nCartesian2.equalsArray = function (cartesian, array, offset) {\r\n return cartesian.x === array[offset] && cartesian.y === array[offset + 1];\r\n};\r\n\r\n/**\r\n * Compares the provided Cartesians componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {Cartesian2} [left] The first Cartesian.\r\n * @param {Cartesian2} [right] The second Cartesian.\r\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nCartesian2.equalsEpsilon = function (\r\n left,\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n CesiumMath.equalsEpsilon(\r\n left.x,\r\n right.x,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n left.y,\r\n right.y,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ))\r\n );\r\n};\r\n\r\n/**\r\n * An immutable Cartesian2 instance initialized to (0.0, 0.0).\r\n *\r\n * @type {Cartesian2}\r\n * @constant\r\n */\r\nCartesian2.ZERO = Object.freeze(new Cartesian2(0.0, 0.0));\r\n\r\n/**\r\n * An immutable Cartesian2 instance initialized to (1.0, 1.0).\r\n *\r\n * @type {Cartesian2}\r\n * @constant\r\n */\r\nCartesian2.ONE = Object.freeze(new Cartesian2(1.0, 1.0));\r\n\r\n/**\r\n * An immutable Cartesian2 instance initialized to (1.0, 0.0).\r\n *\r\n * @type {Cartesian2}\r\n * @constant\r\n */\r\nCartesian2.UNIT_X = Object.freeze(new Cartesian2(1.0, 0.0));\r\n\r\n/**\r\n * An immutable Cartesian2 instance initialized to (0.0, 1.0).\r\n *\r\n * @type {Cartesian2}\r\n * @constant\r\n */\r\nCartesian2.UNIT_Y = Object.freeze(new Cartesian2(0.0, 1.0));\r\n\r\n/**\r\n * Duplicates this Cartesian2 instance.\r\n *\r\n * @param {Cartesian2} [result] The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if one was not provided.\r\n */\r\nCartesian2.prototype.clone = function (result) {\r\n return Cartesian2.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares this Cartesian against the provided Cartesian componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Cartesian2} [right] The right hand side Cartesian.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nCartesian2.prototype.equals = function (right) {\r\n return Cartesian2.equals(this, right);\r\n};\r\n\r\n/**\r\n * Compares this Cartesian against the provided Cartesian componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {Cartesian2} [right] The right hand side Cartesian.\r\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.\r\n */\r\nCartesian2.prototype.equalsEpsilon = function (\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n return Cartesian2.equalsEpsilon(\r\n this,\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n );\r\n};\r\n\r\n/**\r\n * Creates a string representing this Cartesian in the format '(x, y)'.\r\n *\r\n * @returns {String} A string representing the provided Cartesian in the format '(x, y)'.\r\n */\r\nCartesian2.prototype.toString = function () {\r\n return `(${this.x}, ${this.y})`;\r\n};\r\nexport default Cartesian2;\r\n","import Cartesian2 from \"./Cartesian2.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * A 2x2 matrix, indexable as a column-major order array.\r\n * Constructor parameters are in row-major order for code readability.\r\n * @alias Matrix2\r\n * @constructor\r\n * @implements {ArrayLike}\r\n *\r\n * @param {Number} [column0Row0=0.0] The value for column 0, row 0.\r\n * @param {Number} [column1Row0=0.0] The value for column 1, row 0.\r\n * @param {Number} [column0Row1=0.0] The value for column 0, row 1.\r\n * @param {Number} [column1Row1=0.0] The value for column 1, row 1.\r\n *\r\n * @see Matrix2.fromArray\r\n * @see Matrix2.fromColumnMajorArray\r\n * @see Matrix2.fromRowMajorArray\r\n * @see Matrix2.fromScale\r\n * @see Matrix2.fromUniformScale\r\n * @see Matrix2.fromRotation\r\n * @see Matrix3\r\n * @see Matrix4\r\n */\r\nfunction Matrix2(column0Row0, column1Row0, column0Row1, column1Row1) {\r\n this[0] = defaultValue(column0Row0, 0.0);\r\n this[1] = defaultValue(column0Row1, 0.0);\r\n this[2] = defaultValue(column1Row0, 0.0);\r\n this[3] = defaultValue(column1Row1, 0.0);\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nMatrix2.packedLength = 4;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {Matrix2} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nMatrix2.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value[0];\r\n array[startingIndex++] = value[1];\r\n array[startingIndex++] = value[2];\r\n array[startingIndex++] = value[3];\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {Matrix2} [result] The object into which to store the result.\r\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.\r\n */\r\nMatrix2.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new Matrix2();\r\n }\r\n\r\n result[0] = array[startingIndex++];\r\n result[1] = array[startingIndex++];\r\n result[2] = array[startingIndex++];\r\n result[3] = array[startingIndex++];\r\n return result;\r\n};\r\n\r\n/**\r\n * Flattens an array of Matrix2s into an array of components. The components\r\n * are stored in column-major order.\r\n *\r\n * @param {Matrix2[]} array The array of matrices to pack.\r\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 4 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 4) elements.\r\n * @returns {Number[]} The packed array.\r\n */\r\nMatrix2.packArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n const resultLength = length * 4;\r\n if (!defined(result)) {\r\n result = new Array(resultLength);\r\n } else if (!Array.isArray(result) && result.length !== resultLength) {\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(\r\n \"If result is a typed array, it must have exactly array.length * 4 elements\"\r\n );\r\n //>>includeEnd('debug');\r\n } else if (result.length !== resultLength) {\r\n result.length = resultLength;\r\n }\r\n\r\n for (let i = 0; i < length; ++i) {\r\n Matrix2.pack(array[i], result, i * 4);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Unpacks an array of column-major matrix components into an array of Matrix2s.\r\n *\r\n * @param {Number[]} array The array of components to unpack.\r\n * @param {Matrix2[]} [result] The array onto which to store the result.\r\n * @returns {Matrix2[]} The unpacked array.\r\n */\r\nMatrix2.unpackArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 4);\r\n if (array.length % 4 !== 0) {\r\n throw new DeveloperError(\"array length must be a multiple of 4.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n if (!defined(result)) {\r\n result = new Array(length / 4);\r\n } else {\r\n result.length = length / 4;\r\n }\r\n\r\n for (let i = 0; i < length; i += 4) {\r\n const index = i / 4;\r\n result[index] = Matrix2.unpack(array, i, result[index]);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a Matrix2 instance.\r\n *\r\n * @param {Matrix2} matrix The matrix to duplicate.\r\n * @param {Matrix2} [result] The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided. (Returns undefined if matrix is undefined)\r\n */\r\nMatrix2.clone = function (matrix, result) {\r\n if (!defined(matrix)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n return new Matrix2(matrix[0], matrix[2], matrix[1], matrix[3]);\r\n }\r\n result[0] = matrix[0];\r\n result[1] = matrix[1];\r\n result[2] = matrix[2];\r\n result[3] = matrix[3];\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Matrix2 from 4 consecutive elements in an array.\r\n *\r\n * @function\r\n * @param {Number[]} array The array whose 4 consecutive elements correspond to the positions of the matrix. Assumes column-major order.\r\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.\r\n * @param {Matrix2} [result] The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.\r\n *\r\n * @example\r\n * // Create the Matrix2:\r\n * // [1.0, 2.0]\r\n * // [1.0, 2.0]\r\n *\r\n * const v = [1.0, 1.0, 2.0, 2.0];\r\n * const m = Cesium.Matrix2.fromArray(v);\r\n *\r\n * // Create same Matrix2 with using an offset into an array\r\n * const v2 = [0.0, 0.0, 1.0, 1.0, 2.0, 2.0];\r\n * const m2 = Cesium.Matrix2.fromArray(v2, 2);\r\n */\r\nMatrix2.fromArray = Matrix2.unpack;\r\n/**\r\n * Creates a Matrix2 instance from a column-major order array.\r\n *\r\n * @param {Number[]} values The column-major order array.\r\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\r\n */\r\nMatrix2.fromColumnMajorArray = function (values, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"values\", values);\r\n //>>includeEnd('debug');\r\n\r\n return Matrix2.clone(values, result);\r\n};\r\n\r\n/**\r\n * Creates a Matrix2 instance from a row-major order array.\r\n * The resulting matrix will be in column-major order.\r\n *\r\n * @param {Number[]} values The row-major order array.\r\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\r\n */\r\nMatrix2.fromRowMajorArray = function (values, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"values\", values);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Matrix2(values[0], values[1], values[2], values[3]);\r\n }\r\n result[0] = values[0];\r\n result[1] = values[2];\r\n result[2] = values[1];\r\n result[3] = values[3];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix2 instance representing a non-uniform scale.\r\n *\r\n * @param {Cartesian2} scale The x and y scale factors.\r\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\r\n *\r\n * @example\r\n * // Creates\r\n * // [7.0, 0.0]\r\n * // [0.0, 8.0]\r\n * const m = Cesium.Matrix2.fromScale(new Cesium.Cartesian2(7.0, 8.0));\r\n */\r\nMatrix2.fromScale = function (scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"scale\", scale);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Matrix2(scale.x, 0.0, 0.0, scale.y);\r\n }\r\n\r\n result[0] = scale.x;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = scale.y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix2 instance representing a uniform scale.\r\n *\r\n * @param {Number} scale The uniform scale factor.\r\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\r\n *\r\n * @example\r\n * // Creates\r\n * // [2.0, 0.0]\r\n * // [0.0, 2.0]\r\n * const m = Cesium.Matrix2.fromUniformScale(2.0);\r\n */\r\nMatrix2.fromUniformScale = function (scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"scale\", scale);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Matrix2(scale, 0.0, 0.0, scale);\r\n }\r\n\r\n result[0] = scale;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = scale;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a rotation matrix.\r\n *\r\n * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.\r\n * @param {Matrix2} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix2} The modified result parameter, or a new Matrix2 instance if one was not provided.\r\n *\r\n * @example\r\n * // Rotate a point 45 degrees counterclockwise.\r\n * const p = new Cesium.Cartesian2(5, 6);\r\n * const m = Cesium.Matrix2.fromRotation(Cesium.Math.toRadians(45.0));\r\n * const rotated = Cesium.Matrix2.multiplyByVector(m, p, new Cesium.Cartesian2());\r\n */\r\nMatrix2.fromRotation = function (angle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"angle\", angle);\r\n //>>includeEnd('debug');\r\n\r\n const cosAngle = Math.cos(angle);\r\n const sinAngle = Math.sin(angle);\r\n\r\n if (!defined(result)) {\r\n return new Matrix2(cosAngle, -sinAngle, sinAngle, cosAngle);\r\n }\r\n result[0] = cosAngle;\r\n result[1] = sinAngle;\r\n result[2] = -sinAngle;\r\n result[3] = cosAngle;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates an Array from the provided Matrix2 instance.\r\n * The array will be in column-major order.\r\n *\r\n * @param {Matrix2} matrix The matrix to use..\r\n * @param {Number[]} [result] The Array onto which to store the result.\r\n * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided.\r\n */\r\nMatrix2.toArray = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return [matrix[0], matrix[1], matrix[2], matrix[3]];\r\n }\r\n result[0] = matrix[0];\r\n result[1] = matrix[1];\r\n result[2] = matrix[2];\r\n result[3] = matrix[3];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the array index of the element at the provided row and column.\r\n *\r\n * @param {Number} row The zero-based index of the row.\r\n * @param {Number} column The zero-based index of the column.\r\n * @returns {Number} The index of the element at the provided row and column.\r\n *\r\n * @exception {DeveloperError} row must be 0 or 1.\r\n * @exception {DeveloperError} column must be 0 or 1.\r\n *\r\n * @example\r\n * const myMatrix = new Cesium.Matrix2();\r\n * const column1Row0Index = Cesium.Matrix2.getElementIndex(1, 0);\r\n * const column1Row0 = myMatrix[column1Row0Index]\r\n * myMatrix[column1Row0Index] = 10.0;\r\n */\r\nMatrix2.getElementIndex = function (column, row) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.greaterThanOrEquals(\"row\", row, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"row\", row, 1);\r\n\r\n Check.typeOf.number.greaterThanOrEquals(\"column\", column, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"column\", column, 1);\r\n //>>includeEnd('debug');\r\n\r\n return column * 2 + row;\r\n};\r\n\r\n/**\r\n * Retrieves a copy of the matrix column at the provided index as a Cartesian2 instance.\r\n *\r\n * @param {Matrix2} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the column to retrieve.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0 or 1.\r\n */\r\nMatrix2.getColumn = function (matrix, index, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 1);\r\n\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const startIndex = index * 2;\r\n const x = matrix[startIndex];\r\n const y = matrix[startIndex + 1];\r\n\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian2 instance.\r\n *\r\n * @param {Matrix2} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the column to set.\r\n * @param {Cartesian2} cartesian The Cartesian whose values will be assigned to the specified column.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0 or 1.\r\n */\r\nMatrix2.setColumn = function (matrix, index, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 1);\r\n\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result = Matrix2.clone(matrix, result);\r\n const startIndex = index * 2;\r\n result[startIndex] = cartesian.x;\r\n result[startIndex + 1] = cartesian.y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Retrieves a copy of the matrix row at the provided index as a Cartesian2 instance.\r\n *\r\n * @param {Matrix2} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the row to retrieve.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0 or 1.\r\n */\r\nMatrix2.getRow = function (matrix, index, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 1);\r\n\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const x = matrix[index];\r\n const y = matrix[index + 2];\r\n\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian2 instance.\r\n *\r\n * @param {Matrix2} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the row to set.\r\n * @param {Cartesian2} cartesian The Cartesian whose values will be assigned to the specified row.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0 or 1.\r\n */\r\nMatrix2.setRow = function (matrix, index, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 1);\r\n\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result = Matrix2.clone(matrix, result);\r\n result[index] = cartesian.x;\r\n result[index + 2] = cartesian.y;\r\n return result;\r\n};\r\n\r\nconst scaleScratch1 = new Cartesian2();\r\n\r\n/**\r\n * Computes a new matrix that replaces the scale with the provided scale.\r\n * This assumes the matrix is an affine transformation.\r\n *\r\n * @param {Matrix2} matrix The matrix to use.\r\n * @param {Cartesian2} scale The scale that replaces the scale of the provided matrix.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n *\r\n * @see Matrix2.setUniformScale\r\n * @see Matrix2.fromScale\r\n * @see Matrix2.fromUniformScale\r\n * @see Matrix2.multiplyByScale\r\n * @see Matrix2.multiplyByUniformScale\r\n * @see Matrix2.getScale\r\n */\r\nMatrix2.setScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const existingScale = Matrix2.getScale(matrix, scaleScratch1);\r\n const scaleRatioX = scale.x / existingScale.x;\r\n const scaleRatioY = scale.y / existingScale.y;\r\n\r\n result[0] = matrix[0] * scaleRatioX;\r\n result[1] = matrix[1] * scaleRatioX;\r\n result[2] = matrix[2] * scaleRatioY;\r\n result[3] = matrix[3] * scaleRatioY;\r\n\r\n return result;\r\n};\r\n\r\nconst scaleScratch2 = new Cartesian2();\r\n\r\n/**\r\n * Computes a new matrix that replaces the scale with the provided uniform scale.\r\n * This assumes the matrix is an affine transformation.\r\n *\r\n * @param {Matrix2} matrix The matrix to use.\r\n * @param {Number} scale The uniform scale that replaces the scale of the provided matrix.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n *\r\n * @see Matrix2.setScale\r\n * @see Matrix2.fromScale\r\n * @see Matrix2.fromUniformScale\r\n * @see Matrix2.multiplyByScale\r\n * @see Matrix2.multiplyByUniformScale\r\n * @see Matrix2.getScale\r\n */\r\nMatrix2.setUniformScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const existingScale = Matrix2.getScale(matrix, scaleScratch2);\r\n const scaleRatioX = scale / existingScale.x;\r\n const scaleRatioY = scale / existingScale.y;\r\n\r\n result[0] = matrix[0] * scaleRatioX;\r\n result[1] = matrix[1] * scaleRatioX;\r\n result[2] = matrix[2] * scaleRatioY;\r\n result[3] = matrix[3] * scaleRatioY;\r\n\r\n return result;\r\n};\r\n\r\nconst scratchColumn = new Cartesian2();\r\n\r\n/**\r\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\r\n *\r\n * @param {Matrix2} matrix The matrix.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n *\r\n * @see Matrix2.multiplyByScale\r\n * @see Matrix2.multiplyByUniformScale\r\n * @see Matrix2.fromScale\r\n * @see Matrix2.fromUniformScale\r\n * @see Matrix2.setScale\r\n * @see Matrix2.setUniformScale\r\n */\r\nMatrix2.getScale = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Cartesian2.magnitude(\r\n Cartesian2.fromElements(matrix[0], matrix[1], scratchColumn)\r\n );\r\n result.y = Cartesian2.magnitude(\r\n Cartesian2.fromElements(matrix[2], matrix[3], scratchColumn)\r\n );\r\n return result;\r\n};\r\n\r\nconst scaleScratch3 = new Cartesian2();\r\n\r\n/**\r\n * Computes the maximum scale assuming the matrix is an affine transformation.\r\n * The maximum scale is the maximum length of the column vectors.\r\n *\r\n * @param {Matrix2} matrix The matrix.\r\n * @returns {Number} The maximum scale.\r\n */\r\nMatrix2.getMaximumScale = function (matrix) {\r\n Matrix2.getScale(matrix, scaleScratch3);\r\n return Cartesian2.maximumComponent(scaleScratch3);\r\n};\r\n\r\nconst scaleScratch4 = new Cartesian2();\r\n\r\n/**\r\n * Sets the rotation assuming the matrix is an affine transformation.\r\n *\r\n * @param {Matrix2} matrix The matrix.\r\n * @param {Matrix2} rotation The rotation matrix.\r\n * @returns {Matrix2} The modified result parameter.\r\n *\r\n * @see Matrix2.fromRotation\r\n * @see Matrix2.getRotation\r\n */\r\nMatrix2.setRotation = function (matrix, rotation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const scale = Matrix2.getScale(matrix, scaleScratch4);\r\n\r\n result[0] = rotation[0] * scale.x;\r\n result[1] = rotation[1] * scale.x;\r\n result[2] = rotation[2] * scale.y;\r\n result[3] = rotation[3] * scale.y;\r\n\r\n return result;\r\n};\r\n\r\nconst scaleScratch5 = new Cartesian2();\r\n\r\n/**\r\n * Extracts the rotation matrix assuming the matrix is an affine transformation.\r\n *\r\n * @param {Matrix2} matrix The matrix.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n *\r\n * @see Matrix2.setRotation\r\n * @see Matrix2.fromRotation\r\n */\r\nMatrix2.getRotation = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const scale = Matrix2.getScale(matrix, scaleScratch5);\r\n\r\n result[0] = matrix[0] / scale.x;\r\n result[1] = matrix[1] / scale.x;\r\n result[2] = matrix[2] / scale.y;\r\n result[3] = matrix[3] / scale.y;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of two matrices.\r\n *\r\n * @param {Matrix2} left The first matrix.\r\n * @param {Matrix2} right The second matrix.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n */\r\nMatrix2.multiply = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const column0Row0 = left[0] * right[0] + left[2] * right[1];\r\n const column1Row0 = left[0] * right[2] + left[2] * right[3];\r\n const column0Row1 = left[1] * right[0] + left[3] * right[1];\r\n const column1Row1 = left[1] * right[2] + left[3] * right[3];\r\n\r\n result[0] = column0Row0;\r\n result[1] = column0Row1;\r\n result[2] = column1Row0;\r\n result[3] = column1Row1;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the sum of two matrices.\r\n *\r\n * @param {Matrix2} left The first matrix.\r\n * @param {Matrix2} right The second matrix.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n */\r\nMatrix2.add = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = left[0] + right[0];\r\n result[1] = left[1] + right[1];\r\n result[2] = left[2] + right[2];\r\n result[3] = left[3] + right[3];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the difference of two matrices.\r\n *\r\n * @param {Matrix2} left The first matrix.\r\n * @param {Matrix2} right The second matrix.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n */\r\nMatrix2.subtract = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = left[0] - right[0];\r\n result[1] = left[1] - right[1];\r\n result[2] = left[2] - right[2];\r\n result[3] = left[3] - right[3];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix and a column vector.\r\n *\r\n * @param {Matrix2} matrix The matrix.\r\n * @param {Cartesian2} cartesian The column.\r\n * @param {Cartesian2} result The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter.\r\n */\r\nMatrix2.multiplyByVector = function (matrix, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const x = matrix[0] * cartesian.x + matrix[2] * cartesian.y;\r\n const y = matrix[1] * cartesian.x + matrix[3] * cartesian.y;\r\n\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix and a scalar.\r\n *\r\n * @param {Matrix2} matrix The matrix.\r\n * @param {Number} scalar The number to multiply by.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n */\r\nMatrix2.multiplyByScalar = function (matrix, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = matrix[0] * scalar;\r\n result[1] = matrix[1] * scalar;\r\n result[2] = matrix[2] * scalar;\r\n result[3] = matrix[3] * scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.\r\n *\r\n * @param {Matrix2} matrix The matrix on the left-hand side.\r\n * @param {Number} scale The non-uniform scale on the right-hand side.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n *\r\n *\r\n * @example\r\n * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromScale(scale), m);\r\n * Cesium.Matrix2.multiplyByScale(m, scale, m);\r\n *\r\n * @see Matrix2.multiplyByUniformScale\r\n * @see Matrix2.fromScale\r\n * @see Matrix2.fromUniformScale\r\n * @see Matrix2.setScale\r\n * @see Matrix2.setUniformScale\r\n * @see Matrix2.getScale\r\n */\r\nMatrix2.multiplyByScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = matrix[0] * scale.x;\r\n result[1] = matrix[1] * scale.x;\r\n result[2] = matrix[2] * scale.y;\r\n result[3] = matrix[3] * scale.y;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\r\n *\r\n * @param {Matrix2} matrix The matrix on the left-hand side.\r\n * @param {Number} scale The uniform scale on the right-hand side.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n *\r\n * @example\r\n * // Instead of Cesium.Matrix2.multiply(m, Cesium.Matrix2.fromUniformScale(scale), m);\r\n * Cesium.Matrix2.multiplyByUniformScale(m, scale, m);\r\n *\r\n * @see Matrix2.multiplyByScale\r\n * @see Matrix2.fromScale\r\n * @see Matrix2.fromUniformScale\r\n * @see Matrix2.setScale\r\n * @see Matrix2.setUniformScale\r\n * @see Matrix2.getScale\r\n */\r\nMatrix2.multiplyByUniformScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = matrix[0] * scale;\r\n result[1] = matrix[1] * scale;\r\n result[2] = matrix[2] * scale;\r\n result[3] = matrix[3] * scale;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a negated copy of the provided matrix.\r\n *\r\n * @param {Matrix2} matrix The matrix to negate.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n */\r\nMatrix2.negate = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = -matrix[0];\r\n result[1] = -matrix[1];\r\n result[2] = -matrix[2];\r\n result[3] = -matrix[3];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the transpose of the provided matrix.\r\n *\r\n * @param {Matrix2} matrix The matrix to transpose.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n */\r\nMatrix2.transpose = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const column0Row0 = matrix[0];\r\n const column0Row1 = matrix[2];\r\n const column1Row0 = matrix[1];\r\n const column1Row1 = matrix[3];\r\n\r\n result[0] = column0Row0;\r\n result[1] = column0Row1;\r\n result[2] = column1Row0;\r\n result[3] = column1Row1;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\r\n *\r\n * @param {Matrix2} matrix The matrix with signed elements.\r\n * @param {Matrix2} result The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter.\r\n */\r\nMatrix2.abs = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = Math.abs(matrix[0]);\r\n result[1] = Math.abs(matrix[1]);\r\n result[2] = Math.abs(matrix[2]);\r\n result[3] = Math.abs(matrix[3]);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided matrices componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Matrix2} [left] The first matrix.\r\n * @param {Matrix2} [right] The second matrix.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nMatrix2.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left[0] === right[0] &&\r\n left[1] === right[1] &&\r\n left[2] === right[2] &&\r\n left[3] === right[3])\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nMatrix2.equalsArray = function (matrix, array, offset) {\r\n return (\r\n matrix[0] === array[offset] &&\r\n matrix[1] === array[offset + 1] &&\r\n matrix[2] === array[offset + 2] &&\r\n matrix[3] === array[offset + 3]\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided matrices componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Matrix2} [left] The first matrix.\r\n * @param {Matrix2} [right] The second matrix.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nMatrix2.equalsEpsilon = function (left, right, epsilon) {\r\n epsilon = defaultValue(epsilon, 0);\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n Math.abs(left[0] - right[0]) <= epsilon &&\r\n Math.abs(left[1] - right[1]) <= epsilon &&\r\n Math.abs(left[2] - right[2]) <= epsilon &&\r\n Math.abs(left[3] - right[3]) <= epsilon)\r\n );\r\n};\r\n\r\n/**\r\n * An immutable Matrix2 instance initialized to the identity matrix.\r\n *\r\n * @type {Matrix2}\r\n * @constant\r\n */\r\nMatrix2.IDENTITY = Object.freeze(new Matrix2(1.0, 0.0, 0.0, 1.0));\r\n\r\n/**\r\n * An immutable Matrix2 instance initialized to the zero matrix.\r\n *\r\n * @type {Matrix2}\r\n * @constant\r\n */\r\nMatrix2.ZERO = Object.freeze(new Matrix2(0.0, 0.0, 0.0, 0.0));\r\n\r\n/**\r\n * The index into Matrix2 for column 0, row 0.\r\n *\r\n * @type {Number}\r\n * @constant\r\n *\r\n * @example\r\n * const matrix = new Cesium.Matrix2();\r\n * matrix[Cesium.Matrix2.COLUMN0ROW0] = 5.0; // set column 0, row 0 to 5.0\r\n */\r\nMatrix2.COLUMN0ROW0 = 0;\r\n\r\n/**\r\n * The index into Matrix2 for column 0, row 1.\r\n *\r\n * @type {Number}\r\n * @constant\r\n *\r\n * @example\r\n * const matrix = new Cesium.Matrix2();\r\n * matrix[Cesium.Matrix2.COLUMN0ROW1] = 5.0; // set column 0, row 1 to 5.0\r\n */\r\nMatrix2.COLUMN0ROW1 = 1;\r\n\r\n/**\r\n * The index into Matrix2 for column 1, row 0.\r\n *\r\n * @type {Number}\r\n * @constant\r\n *\r\n * @example\r\n * const matrix = new Cesium.Matrix2();\r\n * matrix[Cesium.Matrix2.COLUMN1ROW0] = 5.0; // set column 1, row 0 to 5.0\r\n */\r\nMatrix2.COLUMN1ROW0 = 2;\r\n\r\n/**\r\n * The index into Matrix2 for column 1, row 1.\r\n *\r\n * @type {Number}\r\n * @constant\r\n *\r\n * @example\r\n * const matrix = new Cesium.Matrix2();\r\n * matrix[Cesium.Matrix2.COLUMN1ROW1] = 5.0; // set column 1, row 1 to 5.0\r\n */\r\nMatrix2.COLUMN1ROW1 = 3;\r\n\r\nObject.defineProperties(Matrix2.prototype, {\r\n /**\r\n * Gets the number of items in the collection.\r\n * @memberof Matrix2.prototype\r\n *\r\n * @type {Number}\r\n */\r\n length: {\r\n get: function () {\r\n return Matrix2.packedLength;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Duplicates the provided Matrix2 instance.\r\n *\r\n * @param {Matrix2} [result] The object onto which to store the result.\r\n * @returns {Matrix2} The modified result parameter or a new Matrix2 instance if one was not provided.\r\n */\r\nMatrix2.prototype.clone = function (result) {\r\n return Matrix2.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares this matrix to the provided matrix componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Matrix2} [right] The right hand side matrix.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nMatrix2.prototype.equals = function (right) {\r\n return Matrix2.equals(this, right);\r\n};\r\n\r\n/**\r\n * Compares this matrix to the provided matrix componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Matrix2} [right] The right hand side matrix.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.\r\n */\r\nMatrix2.prototype.equalsEpsilon = function (right, epsilon) {\r\n return Matrix2.equalsEpsilon(this, right, epsilon);\r\n};\r\n\r\n/**\r\n * Creates a string representing this Matrix with each row being\r\n * on a separate line and in the format '(column0, column1)'.\r\n *\r\n * @returns {String} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1)'.\r\n */\r\nMatrix2.prototype.toString = function () {\r\n return `(${this[0]}, ${this[2]})\\n` + `(${this[1]}, ${this[3]})`;\r\n};\r\nexport default Matrix2;\r\n"],"names":["defaultValue","defined","Check","DeveloperError","CesiumMath","distanceScratch","lerpScratch","mostOrthogonalAxisScratch","Cartesian3","Matrix3","scaleScratch1","scaleScratch2","scratchColumn","scaleScratch3","scaleScratch4","scaleScratch5","RuntimeError","Ellipsoid","Cartographic"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;EAChC;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,CAAC,GAAGA,yBAAY,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAChC;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,CAAC,GAAGA,yBAAY,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAChC;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,CAAC,GAAGA,yBA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G,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,EAAE,CAAC;AACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,EAAE,CAAC;AACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,EAAE,CAAC;AACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,EAAE,CAAC;AACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,EAAE,CAAC;AACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,EAAE,CAAC;AACzB;EACA,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,SAAS,EAAE;EAC3C;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,MAAM,EAAE;EACV,IAAI,GAAG,EAAE,YAAY;EACrB,MAAM,OAAO,OAAO,CAAC,YAAY,CAAC;EAClC,KAAK;EACL,GAAG;EACH,CAAC,CAAC,CAAC;AACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,MAAM,EAAE;EAC5C,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,MAA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EAAE,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;EACrC,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,SAAS,CAAC,aAAa,GAAG,UAAU,KAAK,EAAE,OAAO,EAAE;EAC5D,EAAE,OAAO,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;EACrD,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,SAAS,CAAC,QAAQ,GAAG,YAAY;EACzC,EAAE,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EACnE,CAAC;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/Matrix3-f22b0303.js b/examples/cesium/Workers/Matrix3-f22b0303.js
new file mode 100644
index 0000000..34f2201
--- /dev/null
+++ b/examples/cesium/Workers/Matrix3-f22b0303.js
@@ -0,0 +1,4308 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Math-9be8b918'], (function (exports, Check, defaultValue, Math$1) { 'use strict';
+
+ /**
+ * A 3D Cartesian point.
+ * @alias Cartesian3
+ * @constructor
+ *
+ * @param {Number} [x=0.0] The X component.
+ * @param {Number} [y=0.0] The Y component.
+ * @param {Number} [z=0.0] The Z component.
+ *
+ * @see Cartesian2
+ * @see Cartesian4
+ * @see Packable
+ */
+ function Cartesian3(x, y, z) {
+ /**
+ * The X component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.x = defaultValue.defaultValue(x, 0.0);
+
+ /**
+ * The Y component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.y = defaultValue.defaultValue(y, 0.0);
+
+ /**
+ * The Z component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.z = defaultValue.defaultValue(z, 0.0);
+ }
+
+ /**
+ * Converts the provided Spherical into Cartesian3 coordinates.
+ *
+ * @param {Spherical} spherical The Spherical to be converted to Cartesian3.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.
+ */
+ Cartesian3.fromSpherical = function (spherical, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("spherical", spherical);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian3();
+ }
+
+ const clock = spherical.clock;
+ const cone = spherical.cone;
+ const magnitude = defaultValue.defaultValue(spherical.magnitude, 1.0);
+ const radial = magnitude * Math.sin(cone);
+ result.x = radial * Math.cos(clock);
+ result.y = radial * Math.sin(clock);
+ result.z = magnitude * Math.cos(cone);
+ return result;
+ };
+
+ /**
+ * Creates a Cartesian3 instance from x, y and z coordinates.
+ *
+ * @param {Number} x The x coordinate.
+ * @param {Number} y The y coordinate.
+ * @param {Number} z The z coordinate.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.
+ */
+ Cartesian3.fromElements = function (x, y, z, result) {
+ if (!defaultValue.defined(result)) {
+ return new Cartesian3(x, y, z);
+ }
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+ };
+
+ /**
+ * Duplicates a Cartesian3 instance.
+ *
+ * @param {Cartesian3} cartesian The Cartesian to duplicate.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)
+ */
+ Cartesian3.clone = function (cartesian, result) {
+ if (!defaultValue.defined(cartesian)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ return new Cartesian3(cartesian.x, cartesian.y, cartesian.z);
+ }
+
+ result.x = cartesian.x;
+ result.y = cartesian.y;
+ result.z = cartesian.z;
+ return result;
+ };
+
+ /**
+ * Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the
+ * x, y, and z properties of the Cartesian4 and drops w.
+ * @function
+ *
+ * @param {Cartesian4} cartesian The Cartesian4 instance to create a Cartesian3 instance from.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.
+ */
+ Cartesian3.fromCartesian4 = Cartesian3.clone;
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ Cartesian3.packedLength = 3;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {Cartesian3} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ Cartesian3.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value.x;
+ array[startingIndex++] = value.y;
+ array[startingIndex] = value.z;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {Cartesian3} [result] The object into which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.
+ */
+ Cartesian3.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian3();
+ }
+ result.x = array[startingIndex++];
+ result.y = array[startingIndex++];
+ result.z = array[startingIndex];
+ return result;
+ };
+
+ /**
+ * Flattens an array of Cartesian3s into an array of components.
+ *
+ * @param {Cartesian3[]} array The array of cartesians to pack.
+ * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 3 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 3) elements.
+ * @returns {Number[]} The packed array.
+ */
+ Cartesian3.packArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ const resultLength = length * 3;
+ if (!defaultValue.defined(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(
+ "If result is a typed array, it must have exactly array.length * 3 elements"
+ );
+ //>>includeEnd('debug');
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+
+ for (let i = 0; i < length; ++i) {
+ Cartesian3.pack(array[i], result, i * 3);
+ }
+ return result;
+ };
+
+ /**
+ * Unpacks an array of cartesian components into an array of Cartesian3s.
+ *
+ * @param {Number[]} array The array of components to unpack.
+ * @param {Cartesian3[]} [result] The array onto which to store the result.
+ * @returns {Cartesian3[]} The unpacked array.
+ */
+ Cartesian3.unpackArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ Check.Check.typeOf.number.greaterThanOrEquals("array.length", array.length, 3);
+ if (array.length % 3 !== 0) {
+ throw new Check.DeveloperError("array length must be a multiple of 3.");
+ }
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length / 3);
+ } else {
+ result.length = length / 3;
+ }
+
+ for (let i = 0; i < length; i += 3) {
+ const index = i / 3;
+ result[index] = Cartesian3.unpack(array, i, result[index]);
+ }
+ return result;
+ };
+
+ /**
+ * Creates a Cartesian3 from three consecutive elements in an array.
+ * @function
+ *
+ * @param {Number[]} array The array whose three consecutive elements correspond to the x, y, and z components, respectively.
+ * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.
+ *
+ * @example
+ * // Create a Cartesian3 with (1.0, 2.0, 3.0)
+ * const v = [1.0, 2.0, 3.0];
+ * const p = Cesium.Cartesian3.fromArray(v);
+ *
+ * // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array
+ * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0];
+ * const p2 = Cesium.Cartesian3.fromArray(v2, 2);
+ */
+ Cartesian3.fromArray = Cartesian3.unpack;
+
+ /**
+ * Computes the value of the maximum component for the supplied Cartesian.
+ *
+ * @param {Cartesian3} cartesian The cartesian to use.
+ * @returns {Number} The value of the maximum component.
+ */
+ Cartesian3.maximumComponent = function (cartesian) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ return Math.max(cartesian.x, cartesian.y, cartesian.z);
+ };
+
+ /**
+ * Computes the value of the minimum component for the supplied Cartesian.
+ *
+ * @param {Cartesian3} cartesian The cartesian to use.
+ * @returns {Number} The value of the minimum component.
+ */
+ Cartesian3.minimumComponent = function (cartesian) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ return Math.min(cartesian.x, cartesian.y, cartesian.z);
+ };
+
+ /**
+ * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.
+ *
+ * @param {Cartesian3} first A cartesian to compare.
+ * @param {Cartesian3} second A cartesian to compare.
+ * @param {Cartesian3} result The object into which to store the result.
+ * @returns {Cartesian3} A cartesian with the minimum components.
+ */
+ Cartesian3.minimumByComponent = function (first, second, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("first", first);
+ Check.Check.typeOf.object("second", second);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Math.min(first.x, second.x);
+ result.y = Math.min(first.y, second.y);
+ result.z = Math.min(first.z, second.z);
+
+ return result;
+ };
+
+ /**
+ * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.
+ *
+ * @param {Cartesian3} first A cartesian to compare.
+ * @param {Cartesian3} second A cartesian to compare.
+ * @param {Cartesian3} result The object into which to store the result.
+ * @returns {Cartesian3} A cartesian with the maximum components.
+ */
+ Cartesian3.maximumByComponent = function (first, second, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("first", first);
+ Check.Check.typeOf.object("second", second);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Math.max(first.x, second.x);
+ result.y = Math.max(first.y, second.y);
+ result.z = Math.max(first.z, second.z);
+ return result;
+ };
+
+ /**
+ * Constrain a value to lie between two values.
+ *
+ * @param {Cartesian3} cartesian The value to clamp.
+ * @param {Cartesian3} min The minimum bound.
+ * @param {Cartesian3} max The maximum bound.
+ * @param {Cartesian3} result The object into which to store the result.
+ * @returns {Cartesian3} The clamped value such that min <= value <= max.
+ */
+ Cartesian3.clamp = function (value, min, max, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.typeOf.object("min", min);
+ Check.Check.typeOf.object("max", max);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const x = Math$1.CesiumMath.clamp(value.x, min.x, max.x);
+ const y = Math$1.CesiumMath.clamp(value.y, min.y, max.y);
+ const z = Math$1.CesiumMath.clamp(value.z, min.z, max.z);
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+
+ return result;
+ };
+
+ /**
+ * Computes the provided Cartesian's squared magnitude.
+ *
+ * @param {Cartesian3} cartesian The Cartesian instance whose squared magnitude is to be computed.
+ * @returns {Number} The squared magnitude.
+ */
+ Cartesian3.magnitudeSquared = function (cartesian) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ return (
+ cartesian.x * cartesian.x +
+ cartesian.y * cartesian.y +
+ cartesian.z * cartesian.z
+ );
+ };
+
+ /**
+ * Computes the Cartesian's magnitude (length).
+ *
+ * @param {Cartesian3} cartesian The Cartesian instance whose magnitude is to be computed.
+ * @returns {Number} The magnitude.
+ */
+ Cartesian3.magnitude = function (cartesian) {
+ return Math.sqrt(Cartesian3.magnitudeSquared(cartesian));
+ };
+
+ const distanceScratch = new Cartesian3();
+
+ /**
+ * Computes the distance between two points.
+ *
+ * @param {Cartesian3} left The first point to compute the distance from.
+ * @param {Cartesian3} right The second point to compute the distance to.
+ * @returns {Number} The distance between two points.
+ *
+ * @example
+ * // Returns 1.0
+ * const d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));
+ */
+ Cartesian3.distance = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ Cartesian3.subtract(left, right, distanceScratch);
+ return Cartesian3.magnitude(distanceScratch);
+ };
+
+ /**
+ * Computes the squared distance between two points. Comparing squared distances
+ * using this function is more efficient than comparing distances using {@link Cartesian3#distance}.
+ *
+ * @param {Cartesian3} left The first point to compute the distance from.
+ * @param {Cartesian3} right The second point to compute the distance to.
+ * @returns {Number} The distance between two points.
+ *
+ * @example
+ * // Returns 4.0, not 2.0
+ * const d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));
+ */
+ Cartesian3.distanceSquared = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ Cartesian3.subtract(left, right, distanceScratch);
+ return Cartesian3.magnitudeSquared(distanceScratch);
+ };
+
+ /**
+ * Computes the normalized form of the supplied Cartesian.
+ *
+ * @param {Cartesian3} cartesian The Cartesian to be normalized.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Cartesian3.normalize = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const magnitude = Cartesian3.magnitude(cartesian);
+
+ result.x = cartesian.x / magnitude;
+ result.y = cartesian.y / magnitude;
+ result.z = cartesian.z / magnitude;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (isNaN(result.x) || isNaN(result.y) || isNaN(result.z)) {
+ throw new Check.DeveloperError("normalized result is not a number");
+ }
+ //>>includeEnd('debug');
+
+ return result;
+ };
+
+ /**
+ * Computes the dot (scalar) product of two Cartesians.
+ *
+ * @param {Cartesian3} left The first Cartesian.
+ * @param {Cartesian3} right The second Cartesian.
+ * @returns {Number} The dot product.
+ */
+ Cartesian3.dot = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ return left.x * right.x + left.y * right.y + left.z * right.z;
+ };
+
+ /**
+ * Computes the componentwise product of two Cartesians.
+ *
+ * @param {Cartesian3} left The first Cartesian.
+ * @param {Cartesian3} right The second Cartesian.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Cartesian3.multiplyComponents = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x * right.x;
+ result.y = left.y * right.y;
+ result.z = left.z * right.z;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise quotient of two Cartesians.
+ *
+ * @param {Cartesian3} left The first Cartesian.
+ * @param {Cartesian3} right The second Cartesian.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Cartesian3.divideComponents = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x / right.x;
+ result.y = left.y / right.y;
+ result.z = left.z / right.z;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise sum of two Cartesians.
+ *
+ * @param {Cartesian3} left The first Cartesian.
+ * @param {Cartesian3} right The second Cartesian.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Cartesian3.add = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x + right.x;
+ result.y = left.y + right.y;
+ result.z = left.z + right.z;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise difference of two Cartesians.
+ *
+ * @param {Cartesian3} left The first Cartesian.
+ * @param {Cartesian3} right The second Cartesian.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Cartesian3.subtract = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x - right.x;
+ result.y = left.y - right.y;
+ result.z = left.z - right.z;
+ return result;
+ };
+
+ /**
+ * Multiplies the provided Cartesian componentwise by the provided scalar.
+ *
+ * @param {Cartesian3} cartesian The Cartesian to be scaled.
+ * @param {Number} scalar The scalar to multiply with.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Cartesian3.multiplyByScalar = function (cartesian, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = cartesian.x * scalar;
+ result.y = cartesian.y * scalar;
+ result.z = cartesian.z * scalar;
+ return result;
+ };
+
+ /**
+ * Divides the provided Cartesian componentwise by the provided scalar.
+ *
+ * @param {Cartesian3} cartesian The Cartesian to be divided.
+ * @param {Number} scalar The scalar to divide by.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Cartesian3.divideByScalar = function (cartesian, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = cartesian.x / scalar;
+ result.y = cartesian.y / scalar;
+ result.z = cartesian.z / scalar;
+ return result;
+ };
+
+ /**
+ * Negates the provided Cartesian.
+ *
+ * @param {Cartesian3} cartesian The Cartesian to be negated.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Cartesian3.negate = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = -cartesian.x;
+ result.y = -cartesian.y;
+ result.z = -cartesian.z;
+ return result;
+ };
+
+ /**
+ * Computes the absolute value of the provided Cartesian.
+ *
+ * @param {Cartesian3} cartesian The Cartesian whose absolute value is to be computed.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Cartesian3.abs = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Math.abs(cartesian.x);
+ result.y = Math.abs(cartesian.y);
+ result.z = Math.abs(cartesian.z);
+ return result;
+ };
+
+ const lerpScratch = new Cartesian3();
+ /**
+ * Computes the linear interpolation or extrapolation at t using the provided cartesians.
+ *
+ * @param {Cartesian3} start The value corresponding to t at 0.0.
+ * @param {Cartesian3} end The value corresponding to t at 1.0.
+ * @param {Number} t The point along t at which to interpolate.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Cartesian3.lerp = function (start, end, t, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("start", start);
+ Check.Check.typeOf.object("end", end);
+ Check.Check.typeOf.number("t", t);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ Cartesian3.multiplyByScalar(end, t, lerpScratch);
+ result = Cartesian3.multiplyByScalar(start, 1.0 - t, result);
+ return Cartesian3.add(lerpScratch, result, result);
+ };
+
+ const angleBetweenScratch = new Cartesian3();
+ const angleBetweenScratch2 = new Cartesian3();
+ /**
+ * Returns the angle, in radians, between the provided Cartesians.
+ *
+ * @param {Cartesian3} left The first Cartesian.
+ * @param {Cartesian3} right The second Cartesian.
+ * @returns {Number} The angle between the Cartesians.
+ */
+ Cartesian3.angleBetween = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ Cartesian3.normalize(left, angleBetweenScratch);
+ Cartesian3.normalize(right, angleBetweenScratch2);
+ const cosine = Cartesian3.dot(angleBetweenScratch, angleBetweenScratch2);
+ const sine = Cartesian3.magnitude(
+ Cartesian3.cross(
+ angleBetweenScratch,
+ angleBetweenScratch2,
+ angleBetweenScratch
+ )
+ );
+ return Math.atan2(sine, cosine);
+ };
+
+ const mostOrthogonalAxisScratch = new Cartesian3();
+ /**
+ * Returns the axis that is most orthogonal to the provided Cartesian.
+ *
+ * @param {Cartesian3} cartesian The Cartesian on which to find the most orthogonal axis.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The most orthogonal axis.
+ */
+ Cartesian3.mostOrthogonalAxis = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch);
+ Cartesian3.abs(f, f);
+
+ if (f.x <= f.y) {
+ if (f.x <= f.z) {
+ result = Cartesian3.clone(Cartesian3.UNIT_X, result);
+ } else {
+ result = Cartesian3.clone(Cartesian3.UNIT_Z, result);
+ }
+ } else if (f.y <= f.z) {
+ result = Cartesian3.clone(Cartesian3.UNIT_Y, result);
+ } else {
+ result = Cartesian3.clone(Cartesian3.UNIT_Z, result);
+ }
+
+ return result;
+ };
+
+ /**
+ * Projects vector a onto vector b
+ * @param {Cartesian3} a The vector that needs projecting
+ * @param {Cartesian3} b The vector to project onto
+ * @param {Cartesian3} result The result cartesian
+ * @returns {Cartesian3} The modified result parameter
+ */
+ Cartesian3.projectVector = function (a, b, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("a", a);
+ Check.Check.defined("b", b);
+ Check.Check.defined("result", result);
+ //>>includeEnd('debug');
+
+ const scalar = Cartesian3.dot(a, b) / Cartesian3.dot(b, b);
+ return Cartesian3.multiplyByScalar(b, scalar, result);
+ };
+
+ /**
+ * Compares the provided Cartesians componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Cartesian3} [left] The first Cartesian.
+ * @param {Cartesian3} [right] The second Cartesian.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ Cartesian3.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left.x === right.x &&
+ left.y === right.y &&
+ left.z === right.z)
+ );
+ };
+
+ /**
+ * @private
+ */
+ Cartesian3.equalsArray = function (cartesian, array, offset) {
+ return (
+ cartesian.x === array[offset] &&
+ cartesian.y === array[offset + 1] &&
+ cartesian.z === array[offset + 2]
+ );
+ };
+
+ /**
+ * Compares the provided Cartesians componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {Cartesian3} [left] The first Cartesian.
+ * @param {Cartesian3} [right] The second Cartesian.
+ * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ Cartesian3.equalsEpsilon = function (
+ left,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.x,
+ right.x,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.y,
+ right.y,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.z,
+ right.z,
+ relativeEpsilon,
+ absoluteEpsilon
+ ))
+ );
+ };
+
+ /**
+ * Computes the cross (outer) product of two Cartesians.
+ *
+ * @param {Cartesian3} left The first Cartesian.
+ * @param {Cartesian3} right The second Cartesian.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The cross product.
+ */
+ Cartesian3.cross = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const leftX = left.x;
+ const leftY = left.y;
+ const leftZ = left.z;
+ const rightX = right.x;
+ const rightY = right.y;
+ const rightZ = right.z;
+
+ const x = leftY * rightZ - leftZ * rightY;
+ const y = leftZ * rightX - leftX * rightZ;
+ const z = leftX * rightY - leftY * rightX;
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+ };
+
+ /**
+ * Computes the midpoint between the right and left Cartesian.
+ * @param {Cartesian3} left The first Cartesian.
+ * @param {Cartesian3} right The second Cartesian.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The midpoint.
+ */
+ Cartesian3.midpoint = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = (left.x + right.x) * 0.5;
+ result.y = (left.y + right.y) * 0.5;
+ result.z = (left.z + right.z) * 0.5;
+
+ return result;
+ };
+
+ /**
+ * Returns a Cartesian3 position from longitude and latitude values given in degrees.
+ *
+ * @param {Number} longitude The longitude, in degrees
+ * @param {Number} latitude The latitude, in degrees
+ * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The position
+ *
+ * @example
+ * const position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);
+ */
+ Cartesian3.fromDegrees = function (
+ longitude,
+ latitude,
+ height,
+ ellipsoid,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("longitude", longitude);
+ Check.Check.typeOf.number("latitude", latitude);
+ //>>includeEnd('debug');
+
+ longitude = Math$1.CesiumMath.toRadians(longitude);
+ latitude = Math$1.CesiumMath.toRadians(latitude);
+ return Cartesian3.fromRadians(longitude, latitude, height, ellipsoid, result);
+ };
+
+ let scratchN = new Cartesian3();
+ let scratchK = new Cartesian3();
+ const wgs84RadiiSquared = new Cartesian3(
+ 6378137.0 * 6378137.0,
+ 6378137.0 * 6378137.0,
+ 6356752.3142451793 * 6356752.3142451793
+ );
+
+ /**
+ * Returns a Cartesian3 position from longitude and latitude values given in radians.
+ *
+ * @param {Number} longitude The longitude, in radians
+ * @param {Number} latitude The latitude, in radians
+ * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The position
+ *
+ * @example
+ * const position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);
+ */
+ Cartesian3.fromRadians = function (
+ longitude,
+ latitude,
+ height,
+ ellipsoid,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("longitude", longitude);
+ Check.Check.typeOf.number("latitude", latitude);
+ //>>includeEnd('debug');
+
+ height = defaultValue.defaultValue(height, 0.0);
+ const radiiSquared = defaultValue.defined(ellipsoid)
+ ? ellipsoid.radiiSquared
+ : wgs84RadiiSquared;
+
+ const cosLatitude = Math.cos(latitude);
+ scratchN.x = cosLatitude * Math.cos(longitude);
+ scratchN.y = cosLatitude * Math.sin(longitude);
+ scratchN.z = Math.sin(latitude);
+ scratchN = Cartesian3.normalize(scratchN, scratchN);
+
+ Cartesian3.multiplyComponents(radiiSquared, scratchN, scratchK);
+ const gamma = Math.sqrt(Cartesian3.dot(scratchN, scratchK));
+ scratchK = Cartesian3.divideByScalar(scratchK, gamma, scratchK);
+ scratchN = Cartesian3.multiplyByScalar(scratchN, height, scratchN);
+
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian3();
+ }
+ return Cartesian3.add(scratchK, scratchN, result);
+ };
+
+ /**
+ * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.
+ *
+ * @param {Number[]} coordinates A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the coordinates lie.
+ * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.
+ * @returns {Cartesian3[]} The array of positions.
+ *
+ * @example
+ * const positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);
+ */
+ Cartesian3.fromDegreesArray = function (coordinates, ellipsoid, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("coordinates", coordinates);
+ if (coordinates.length < 2 || coordinates.length % 2 !== 0) {
+ throw new Check.DeveloperError(
+ "the number of coordinates must be a multiple of 2 and at least 2"
+ );
+ }
+ //>>includeEnd('debug');
+
+ const length = coordinates.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length / 2);
+ } else {
+ result.length = length / 2;
+ }
+
+ for (let i = 0; i < length; i += 2) {
+ const longitude = coordinates[i];
+ const latitude = coordinates[i + 1];
+ const index = i / 2;
+ result[index] = Cartesian3.fromDegrees(
+ longitude,
+ latitude,
+ 0,
+ ellipsoid,
+ result[index]
+ );
+ }
+
+ return result;
+ };
+
+ /**
+ * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.
+ *
+ * @param {Number[]} coordinates A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the coordinates lie.
+ * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.
+ * @returns {Cartesian3[]} The array of positions.
+ *
+ * @example
+ * const positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);
+ */
+ Cartesian3.fromRadiansArray = function (coordinates, ellipsoid, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("coordinates", coordinates);
+ if (coordinates.length < 2 || coordinates.length % 2 !== 0) {
+ throw new Check.DeveloperError(
+ "the number of coordinates must be a multiple of 2 and at least 2"
+ );
+ }
+ //>>includeEnd('debug');
+
+ const length = coordinates.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length / 2);
+ } else {
+ result.length = length / 2;
+ }
+
+ for (let i = 0; i < length; i += 2) {
+ const longitude = coordinates[i];
+ const latitude = coordinates[i + 1];
+ const index = i / 2;
+ result[index] = Cartesian3.fromRadians(
+ longitude,
+ latitude,
+ 0,
+ ellipsoid,
+ result[index]
+ );
+ }
+
+ return result;
+ };
+
+ /**
+ * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.
+ *
+ * @param {Number[]} coordinates A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.
+ * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.
+ * @returns {Cartesian3[]} The array of positions.
+ *
+ * @example
+ * const positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);
+ */
+ Cartesian3.fromDegreesArrayHeights = function (coordinates, ellipsoid, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("coordinates", coordinates);
+ if (coordinates.length < 3 || coordinates.length % 3 !== 0) {
+ throw new Check.DeveloperError(
+ "the number of coordinates must be a multiple of 3 and at least 3"
+ );
+ }
+ //>>includeEnd('debug');
+
+ const length = coordinates.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length / 3);
+ } else {
+ result.length = length / 3;
+ }
+
+ for (let i = 0; i < length; i += 3) {
+ const longitude = coordinates[i];
+ const latitude = coordinates[i + 1];
+ const height = coordinates[i + 2];
+ const index = i / 3;
+ result[index] = Cartesian3.fromDegrees(
+ longitude,
+ latitude,
+ height,
+ ellipsoid,
+ result[index]
+ );
+ }
+
+ return result;
+ };
+
+ /**
+ * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.
+ *
+ * @param {Number[]} coordinates A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.
+ * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.
+ * @returns {Cartesian3[]} The array of positions.
+ *
+ * @example
+ * const positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);
+ */
+ Cartesian3.fromRadiansArrayHeights = function (coordinates, ellipsoid, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("coordinates", coordinates);
+ if (coordinates.length < 3 || coordinates.length % 3 !== 0) {
+ throw new Check.DeveloperError(
+ "the number of coordinates must be a multiple of 3 and at least 3"
+ );
+ }
+ //>>includeEnd('debug');
+
+ const length = coordinates.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length / 3);
+ } else {
+ result.length = length / 3;
+ }
+
+ for (let i = 0; i < length; i += 3) {
+ const longitude = coordinates[i];
+ const latitude = coordinates[i + 1];
+ const height = coordinates[i + 2];
+ const index = i / 3;
+ result[index] = Cartesian3.fromRadians(
+ longitude,
+ latitude,
+ height,
+ ellipsoid,
+ result[index]
+ );
+ }
+
+ return result;
+ };
+
+ /**
+ * An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).
+ *
+ * @type {Cartesian3}
+ * @constant
+ */
+ Cartesian3.ZERO = Object.freeze(new Cartesian3(0.0, 0.0, 0.0));
+
+ /**
+ * An immutable Cartesian3 instance initialized to (1.0, 1.0, 1.0).
+ *
+ * @type {Cartesian3}
+ * @constant
+ */
+ Cartesian3.ONE = Object.freeze(new Cartesian3(1.0, 1.0, 1.0));
+
+ /**
+ * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).
+ *
+ * @type {Cartesian3}
+ * @constant
+ */
+ Cartesian3.UNIT_X = Object.freeze(new Cartesian3(1.0, 0.0, 0.0));
+
+ /**
+ * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).
+ *
+ * @type {Cartesian3}
+ * @constant
+ */
+ Cartesian3.UNIT_Y = Object.freeze(new Cartesian3(0.0, 1.0, 0.0));
+
+ /**
+ * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).
+ *
+ * @type {Cartesian3}
+ * @constant
+ */
+ Cartesian3.UNIT_Z = Object.freeze(new Cartesian3(0.0, 0.0, 1.0));
+
+ /**
+ * Duplicates this Cartesian3 instance.
+ *
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.
+ */
+ Cartesian3.prototype.clone = function (result) {
+ return Cartesian3.clone(this, result);
+ };
+
+ /**
+ * Compares this Cartesian against the provided Cartesian componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Cartesian3} [right] The right hand side Cartesian.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ Cartesian3.prototype.equals = function (right) {
+ return Cartesian3.equals(this, right);
+ };
+
+ /**
+ * Compares this Cartesian against the provided Cartesian componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {Cartesian3} [right] The right hand side Cartesian.
+ * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.
+ */
+ Cartesian3.prototype.equalsEpsilon = function (
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ return Cartesian3.equalsEpsilon(
+ this,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+ };
+
+ /**
+ * Creates a string representing this Cartesian in the format '(x, y, z)'.
+ *
+ * @returns {String} A string representing this Cartesian in the format '(x, y, z)'.
+ */
+ Cartesian3.prototype.toString = function () {
+ return `(${this.x}, ${this.y}, ${this.z})`;
+ };
+
+ const scaleToGeodeticSurfaceIntersection = new Cartesian3();
+ const scaleToGeodeticSurfaceGradient = new Cartesian3();
+
+ /**
+ * Scales the provided Cartesian position along the geodetic surface normal
+ * so that it is on the surface of this ellipsoid. If the position is
+ * at the center of the ellipsoid, this function returns undefined.
+ *
+ * @param {Cartesian3} cartesian The Cartesian position to scale.
+ * @param {Cartesian3} oneOverRadii One over radii of the ellipsoid.
+ * @param {Cartesian3} oneOverRadiiSquared One over radii squared of the ellipsoid.
+ * @param {Number} centerToleranceSquared Tolerance for closeness to the center.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
+ *
+ * @function scaleToGeodeticSurface
+ *
+ * @private
+ */
+ function scaleToGeodeticSurface(
+ cartesian,
+ oneOverRadii,
+ oneOverRadiiSquared,
+ centerToleranceSquared,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(cartesian)) {
+ throw new Check.DeveloperError("cartesian is required.");
+ }
+ if (!defaultValue.defined(oneOverRadii)) {
+ throw new Check.DeveloperError("oneOverRadii is required.");
+ }
+ if (!defaultValue.defined(oneOverRadiiSquared)) {
+ throw new Check.DeveloperError("oneOverRadiiSquared is required.");
+ }
+ if (!defaultValue.defined(centerToleranceSquared)) {
+ throw new Check.DeveloperError("centerToleranceSquared is required.");
+ }
+ //>>includeEnd('debug');
+
+ const positionX = cartesian.x;
+ const positionY = cartesian.y;
+ const positionZ = cartesian.z;
+
+ const oneOverRadiiX = oneOverRadii.x;
+ const oneOverRadiiY = oneOverRadii.y;
+ const oneOverRadiiZ = oneOverRadii.z;
+
+ const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;
+ const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;
+ const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;
+
+ // Compute the squared ellipsoid norm.
+ const squaredNorm = x2 + y2 + z2;
+ const ratio = Math.sqrt(1.0 / squaredNorm);
+
+ // As an initial approximation, assume that the radial intersection is the projection point.
+ const intersection = Cartesian3.multiplyByScalar(
+ cartesian,
+ ratio,
+ scaleToGeodeticSurfaceIntersection
+ );
+
+ // If the position is near the center, the iteration will not converge.
+ if (squaredNorm < centerToleranceSquared) {
+ return !isFinite(ratio)
+ ? undefined
+ : Cartesian3.clone(intersection, result);
+ }
+
+ const oneOverRadiiSquaredX = oneOverRadiiSquared.x;
+ const oneOverRadiiSquaredY = oneOverRadiiSquared.y;
+ const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
+
+ // Use the gradient at the intersection point in place of the true unit normal.
+ // The difference in magnitude will be absorbed in the multiplier.
+ const gradient = scaleToGeodeticSurfaceGradient;
+ gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0;
+ gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0;
+ gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0;
+
+ // Compute the initial guess at the normal vector multiplier, lambda.
+ let lambda =
+ ((1.0 - ratio) * Cartesian3.magnitude(cartesian)) /
+ (0.5 * Cartesian3.magnitude(gradient));
+ let correction = 0.0;
+
+ let func;
+ let denominator;
+ let xMultiplier;
+ let yMultiplier;
+ let zMultiplier;
+ let xMultiplier2;
+ let yMultiplier2;
+ let zMultiplier2;
+ let xMultiplier3;
+ let yMultiplier3;
+ let zMultiplier3;
+
+ do {
+ lambda -= correction;
+
+ xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);
+ yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);
+ zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);
+
+ xMultiplier2 = xMultiplier * xMultiplier;
+ yMultiplier2 = yMultiplier * yMultiplier;
+ zMultiplier2 = zMultiplier * zMultiplier;
+
+ xMultiplier3 = xMultiplier2 * xMultiplier;
+ yMultiplier3 = yMultiplier2 * yMultiplier;
+ zMultiplier3 = zMultiplier2 * zMultiplier;
+
+ func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;
+
+ // "denominator" here refers to the use of this expression in the velocity and acceleration
+ // computations in the sections to follow.
+ denominator =
+ x2 * xMultiplier3 * oneOverRadiiSquaredX +
+ y2 * yMultiplier3 * oneOverRadiiSquaredY +
+ z2 * zMultiplier3 * oneOverRadiiSquaredZ;
+
+ const derivative = -2.0 * denominator;
+
+ correction = func / derivative;
+ } while (Math.abs(func) > Math$1.CesiumMath.EPSILON12);
+
+ if (!defaultValue.defined(result)) {
+ return new Cartesian3(
+ positionX * xMultiplier,
+ positionY * yMultiplier,
+ positionZ * zMultiplier
+ );
+ }
+ result.x = positionX * xMultiplier;
+ result.y = positionY * yMultiplier;
+ result.z = positionZ * zMultiplier;
+ return result;
+ }
+
+ /**
+ * A position defined by longitude, latitude, and height.
+ * @alias Cartographic
+ * @constructor
+ *
+ * @param {Number} [longitude=0.0] The longitude, in radians.
+ * @param {Number} [latitude=0.0] The latitude, in radians.
+ * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.
+ *
+ * @see Ellipsoid
+ */
+ function Cartographic(longitude, latitude, height) {
+ /**
+ * The longitude, in radians.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.longitude = defaultValue.defaultValue(longitude, 0.0);
+
+ /**
+ * The latitude, in radians.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.latitude = defaultValue.defaultValue(latitude, 0.0);
+
+ /**
+ * The height, in meters, above the ellipsoid.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.height = defaultValue.defaultValue(height, 0.0);
+ }
+
+ /**
+ * Creates a new Cartographic instance from longitude and latitude
+ * specified in radians.
+ *
+ * @param {Number} longitude The longitude, in radians.
+ * @param {Number} latitude The latitude, in radians.
+ * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.
+ */
+ Cartographic.fromRadians = function (longitude, latitude, height, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("longitude", longitude);
+ Check.Check.typeOf.number("latitude", latitude);
+ //>>includeEnd('debug');
+
+ height = defaultValue.defaultValue(height, 0.0);
+
+ if (!defaultValue.defined(result)) {
+ return new Cartographic(longitude, latitude, height);
+ }
+
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = height;
+ return result;
+ };
+
+ /**
+ * Creates a new Cartographic instance from longitude and latitude
+ * specified in degrees. The values in the resulting object will
+ * be in radians.
+ *
+ * @param {Number} longitude The longitude, in degrees.
+ * @param {Number} latitude The latitude, in degrees.
+ * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.
+ */
+ Cartographic.fromDegrees = function (longitude, latitude, height, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("longitude", longitude);
+ Check.Check.typeOf.number("latitude", latitude);
+ //>>includeEnd('debug');
+ longitude = Math$1.CesiumMath.toRadians(longitude);
+ latitude = Math$1.CesiumMath.toRadians(latitude);
+
+ return Cartographic.fromRadians(longitude, latitude, height, result);
+ };
+
+ const cartesianToCartographicN$1 = new Cartesian3();
+ const cartesianToCartographicP$1 = new Cartesian3();
+ const cartesianToCartographicH$1 = new Cartesian3();
+ const wgs84OneOverRadii = new Cartesian3(
+ 1.0 / 6378137.0,
+ 1.0 / 6378137.0,
+ 1.0 / 6356752.3142451793
+ );
+ const wgs84OneOverRadiiSquared = new Cartesian3(
+ 1.0 / (6378137.0 * 6378137.0),
+ 1.0 / (6378137.0 * 6378137.0),
+ 1.0 / (6356752.3142451793 * 6356752.3142451793)
+ );
+ const wgs84CenterToleranceSquared = Math$1.CesiumMath.EPSILON1;
+
+ /**
+ * Creates a new Cartographic instance from a Cartesian position. The values in the
+ * resulting object will be in radians.
+ *
+ * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
+ */
+ Cartographic.fromCartesian = function (cartesian, ellipsoid, result) {
+ const oneOverRadii = defaultValue.defined(ellipsoid)
+ ? ellipsoid.oneOverRadii
+ : wgs84OneOverRadii;
+ const oneOverRadiiSquared = defaultValue.defined(ellipsoid)
+ ? ellipsoid.oneOverRadiiSquared
+ : wgs84OneOverRadiiSquared;
+ const centerToleranceSquared = defaultValue.defined(ellipsoid)
+ ? ellipsoid._centerToleranceSquared
+ : wgs84CenterToleranceSquared;
+
+ //`cartesian is required.` is thrown from scaleToGeodeticSurface
+ const p = scaleToGeodeticSurface(
+ cartesian,
+ oneOverRadii,
+ oneOverRadiiSquared,
+ centerToleranceSquared,
+ cartesianToCartographicP$1
+ );
+
+ if (!defaultValue.defined(p)) {
+ return undefined;
+ }
+
+ let n = Cartesian3.multiplyComponents(
+ p,
+ oneOverRadiiSquared,
+ cartesianToCartographicN$1
+ );
+ n = Cartesian3.normalize(n, n);
+
+ const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH$1);
+
+ const longitude = Math.atan2(n.y, n.x);
+ const latitude = Math.asin(n.z);
+ const height =
+ Math$1.CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);
+
+ if (!defaultValue.defined(result)) {
+ return new Cartographic(longitude, latitude, height);
+ }
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = height;
+ return result;
+ };
+
+ /**
+ * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted
+ * object should be in radians.
+ *
+ * @param {Cartographic} cartographic Input to be converted into a Cartesian3 output.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The position
+ */
+ Cartographic.toCartesian = function (cartographic, ellipsoid, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartographic", cartographic);
+ //>>includeEnd('debug');
+
+ return Cartesian3.fromRadians(
+ cartographic.longitude,
+ cartographic.latitude,
+ cartographic.height,
+ ellipsoid,
+ result
+ );
+ };
+
+ /**
+ * Duplicates a Cartographic instance.
+ *
+ * @param {Cartographic} cartographic The cartographic to duplicate.
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)
+ */
+ Cartographic.clone = function (cartographic, result) {
+ if (!defaultValue.defined(cartographic)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ return new Cartographic(
+ cartographic.longitude,
+ cartographic.latitude,
+ cartographic.height
+ );
+ }
+ result.longitude = cartographic.longitude;
+ result.latitude = cartographic.latitude;
+ result.height = cartographic.height;
+ return result;
+ };
+
+ /**
+ * Compares the provided cartographics componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Cartographic} [left] The first cartographic.
+ * @param {Cartographic} [right] The second cartographic.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ Cartographic.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left.longitude === right.longitude &&
+ left.latitude === right.latitude &&
+ left.height === right.height)
+ );
+ };
+
+ /**
+ * Compares the provided cartographics componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Cartographic} [left] The first cartographic.
+ * @param {Cartographic} [right] The second cartographic.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ Cartographic.equalsEpsilon = function (left, right, epsilon) {
+ epsilon = defaultValue.defaultValue(epsilon, 0);
+
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math.abs(left.longitude - right.longitude) <= epsilon &&
+ Math.abs(left.latitude - right.latitude) <= epsilon &&
+ Math.abs(left.height - right.height) <= epsilon)
+ );
+ };
+
+ /**
+ * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).
+ *
+ * @type {Cartographic}
+ * @constant
+ */
+ Cartographic.ZERO = Object.freeze(new Cartographic(0.0, 0.0, 0.0));
+
+ /**
+ * Duplicates this instance.
+ *
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.
+ */
+ Cartographic.prototype.clone = function (result) {
+ return Cartographic.clone(this, result);
+ };
+
+ /**
+ * Compares the provided against this cartographic componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Cartographic} [right] The second cartographic.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ Cartographic.prototype.equals = function (right) {
+ return Cartographic.equals(this, right);
+ };
+
+ /**
+ * Compares the provided against this cartographic componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Cartographic} [right] The second cartographic.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ Cartographic.prototype.equalsEpsilon = function (right, epsilon) {
+ return Cartographic.equalsEpsilon(this, right, epsilon);
+ };
+
+ /**
+ * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.
+ *
+ * @returns {String} A string representing the provided cartographic in the format '(longitude, latitude, height)'.
+ */
+ Cartographic.prototype.toString = function () {
+ return `(${this.longitude}, ${this.latitude}, ${this.height})`;
+ };
+
+ function initialize(ellipsoid, x, y, z) {
+ x = defaultValue.defaultValue(x, 0.0);
+ y = defaultValue.defaultValue(y, 0.0);
+ z = defaultValue.defaultValue(z, 0.0);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.greaterThanOrEquals("x", x, 0.0);
+ Check.Check.typeOf.number.greaterThanOrEquals("y", y, 0.0);
+ Check.Check.typeOf.number.greaterThanOrEquals("z", z, 0.0);
+ //>>includeEnd('debug');
+
+ ellipsoid._radii = new Cartesian3(x, y, z);
+
+ ellipsoid._radiiSquared = new Cartesian3(x * x, y * y, z * z);
+
+ ellipsoid._radiiToTheFourth = new Cartesian3(
+ x * x * x * x,
+ y * y * y * y,
+ z * z * z * z
+ );
+
+ ellipsoid._oneOverRadii = new Cartesian3(
+ x === 0.0 ? 0.0 : 1.0 / x,
+ y === 0.0 ? 0.0 : 1.0 / y,
+ z === 0.0 ? 0.0 : 1.0 / z
+ );
+
+ ellipsoid._oneOverRadiiSquared = new Cartesian3(
+ x === 0.0 ? 0.0 : 1.0 / (x * x),
+ y === 0.0 ? 0.0 : 1.0 / (y * y),
+ z === 0.0 ? 0.0 : 1.0 / (z * z)
+ );
+
+ ellipsoid._minimumRadius = Math.min(x, y, z);
+
+ ellipsoid._maximumRadius = Math.max(x, y, z);
+
+ ellipsoid._centerToleranceSquared = Math$1.CesiumMath.EPSILON1;
+
+ if (ellipsoid._radiiSquared.z !== 0) {
+ ellipsoid._squaredXOverSquaredZ =
+ ellipsoid._radiiSquared.x / ellipsoid._radiiSquared.z;
+ }
+ }
+
+ /**
+ * A quadratic surface defined in Cartesian coordinates by the equation
+ * (x / a)^2 + (y / b)^2 + (z / c)^2 = 1
. Primarily used
+ * by Cesium to represent the shape of planetary bodies.
+ *
+ * Rather than constructing this object directly, one of the provided
+ * constants is normally used.
+ * @alias Ellipsoid
+ * @constructor
+ *
+ * @param {Number} [x=0] The radius in the x direction.
+ * @param {Number} [y=0] The radius in the y direction.
+ * @param {Number} [z=0] The radius in the z direction.
+ *
+ * @exception {DeveloperError} All radii components must be greater than or equal to zero.
+ *
+ * @see Ellipsoid.fromCartesian3
+ * @see Ellipsoid.WGS84
+ * @see Ellipsoid.UNIT_SPHERE
+ */
+ function Ellipsoid(x, y, z) {
+ this._radii = undefined;
+ this._radiiSquared = undefined;
+ this._radiiToTheFourth = undefined;
+ this._oneOverRadii = undefined;
+ this._oneOverRadiiSquared = undefined;
+ this._minimumRadius = undefined;
+ this._maximumRadius = undefined;
+ this._centerToleranceSquared = undefined;
+ this._squaredXOverSquaredZ = undefined;
+
+ initialize(this, x, y, z);
+ }
+
+ Object.defineProperties(Ellipsoid.prototype, {
+ /**
+ * Gets the radii of the ellipsoid.
+ * @memberof Ellipsoid.prototype
+ * @type {Cartesian3}
+ * @readonly
+ */
+ radii: {
+ get: function () {
+ return this._radii;
+ },
+ },
+ /**
+ * Gets the squared radii of the ellipsoid.
+ * @memberof Ellipsoid.prototype
+ * @type {Cartesian3}
+ * @readonly
+ */
+ radiiSquared: {
+ get: function () {
+ return this._radiiSquared;
+ },
+ },
+ /**
+ * Gets the radii of the ellipsoid raise to the fourth power.
+ * @memberof Ellipsoid.prototype
+ * @type {Cartesian3}
+ * @readonly
+ */
+ radiiToTheFourth: {
+ get: function () {
+ return this._radiiToTheFourth;
+ },
+ },
+ /**
+ * Gets one over the radii of the ellipsoid.
+ * @memberof Ellipsoid.prototype
+ * @type {Cartesian3}
+ * @readonly
+ */
+ oneOverRadii: {
+ get: function () {
+ return this._oneOverRadii;
+ },
+ },
+ /**
+ * Gets one over the squared radii of the ellipsoid.
+ * @memberof Ellipsoid.prototype
+ * @type {Cartesian3}
+ * @readonly
+ */
+ oneOverRadiiSquared: {
+ get: function () {
+ return this._oneOverRadiiSquared;
+ },
+ },
+ /**
+ * Gets the minimum radius of the ellipsoid.
+ * @memberof Ellipsoid.prototype
+ * @type {Number}
+ * @readonly
+ */
+ minimumRadius: {
+ get: function () {
+ return this._minimumRadius;
+ },
+ },
+ /**
+ * Gets the maximum radius of the ellipsoid.
+ * @memberof Ellipsoid.prototype
+ * @type {Number}
+ * @readonly
+ */
+ maximumRadius: {
+ get: function () {
+ return this._maximumRadius;
+ },
+ },
+ });
+
+ /**
+ * Duplicates an Ellipsoid instance.
+ *
+ * @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.
+ * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
+ * instance should be created.
+ * @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)
+ */
+ Ellipsoid.clone = function (ellipsoid, result) {
+ if (!defaultValue.defined(ellipsoid)) {
+ return undefined;
+ }
+ const radii = ellipsoid._radii;
+
+ if (!defaultValue.defined(result)) {
+ return new Ellipsoid(radii.x, radii.y, radii.z);
+ }
+
+ Cartesian3.clone(radii, result._radii);
+ Cartesian3.clone(ellipsoid._radiiSquared, result._radiiSquared);
+ Cartesian3.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);
+ Cartesian3.clone(ellipsoid._oneOverRadii, result._oneOverRadii);
+ Cartesian3.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);
+ result._minimumRadius = ellipsoid._minimumRadius;
+ result._maximumRadius = ellipsoid._maximumRadius;
+ result._centerToleranceSquared = ellipsoid._centerToleranceSquared;
+
+ return result;
+ };
+
+ /**
+ * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
+ *
+ * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions.
+ * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
+ * instance should be created.
+ * @returns {Ellipsoid} A new Ellipsoid instance.
+ *
+ * @exception {DeveloperError} All radii components must be greater than or equal to zero.
+ *
+ * @see Ellipsoid.WGS84
+ * @see Ellipsoid.UNIT_SPHERE
+ */
+ Ellipsoid.fromCartesian3 = function (cartesian, result) {
+ if (!defaultValue.defined(result)) {
+ result = new Ellipsoid();
+ }
+
+ if (!defaultValue.defined(cartesian)) {
+ return result;
+ }
+
+ initialize(result, cartesian.x, cartesian.y, cartesian.z);
+ return result;
+ };
+
+ /**
+ * An Ellipsoid instance initialized to the WGS84 standard.
+ *
+ * @type {Ellipsoid}
+ * @constant
+ */
+ Ellipsoid.WGS84 = Object.freeze(
+ new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793)
+ );
+
+ /**
+ * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).
+ *
+ * @type {Ellipsoid}
+ * @constant
+ */
+ Ellipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1.0, 1.0, 1.0));
+
+ /**
+ * An Ellipsoid instance initialized to a sphere with the lunar radius.
+ *
+ * @type {Ellipsoid}
+ * @constant
+ */
+ Ellipsoid.MOON = Object.freeze(
+ new Ellipsoid(
+ Math$1.CesiumMath.LUNAR_RADIUS,
+ Math$1.CesiumMath.LUNAR_RADIUS,
+ Math$1.CesiumMath.LUNAR_RADIUS
+ )
+ );
+
+ /**
+ * Duplicates an Ellipsoid instance.
+ *
+ * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
+ * instance should be created.
+ * @returns {Ellipsoid} The cloned Ellipsoid.
+ */
+ Ellipsoid.prototype.clone = function (result) {
+ return Ellipsoid.clone(this, result);
+ };
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ Ellipsoid.packedLength = Cartesian3.packedLength;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {Ellipsoid} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ Ellipsoid.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ Cartesian3.pack(value._radii, array, startingIndex);
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {Ellipsoid} [result] The object into which to store the result.
+ * @returns {Ellipsoid} The modified result parameter or a new Ellipsoid instance if one was not provided.
+ */
+ Ellipsoid.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const radii = Cartesian3.unpack(array, startingIndex);
+ return Ellipsoid.fromCartesian3(radii, result);
+ };
+
+ /**
+ * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.
+ * @function
+ *
+ * @param {Cartesian3} cartesian The Cartesian for which to to determine the geocentric normal.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
+ */
+ Ellipsoid.prototype.geocentricSurfaceNormal = Cartesian3.normalize;
+
+ /**
+ * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
+ *
+ * @param {Cartographic} cartographic The cartographic position for which to to determine the geodetic normal.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
+ */
+ Ellipsoid.prototype.geodeticSurfaceNormalCartographic = function (
+ cartographic,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartographic", cartographic);
+ //>>includeEnd('debug');
+
+ const longitude = cartographic.longitude;
+ const latitude = cartographic.latitude;
+ const cosLatitude = Math.cos(latitude);
+
+ const x = cosLatitude * Math.cos(longitude);
+ const y = cosLatitude * Math.sin(longitude);
+ const z = Math.sin(latitude);
+
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian3();
+ }
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return Cartesian3.normalize(result, result);
+ };
+
+ /**
+ * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.
+ *
+ * @param {Cartesian3} cartesian The Cartesian position for which to to determine the surface normal.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.
+ */
+ Ellipsoid.prototype.geodeticSurfaceNormal = function (cartesian, result) {
+ if (
+ Cartesian3.equalsEpsilon(cartesian, Cartesian3.ZERO, Math$1.CesiumMath.EPSILON14)
+ ) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian3();
+ }
+ result = Cartesian3.multiplyComponents(
+ cartesian,
+ this._oneOverRadiiSquared,
+ result
+ );
+ return Cartesian3.normalize(result, result);
+ };
+
+ const cartographicToCartesianNormal = new Cartesian3();
+ const cartographicToCartesianK = new Cartesian3();
+
+ /**
+ * Converts the provided cartographic to Cartesian representation.
+ *
+ * @param {Cartographic} cartographic The cartographic position.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
+ *
+ * @example
+ * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.
+ * const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);
+ * const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
+ */
+ Ellipsoid.prototype.cartographicToCartesian = function (cartographic, result) {
+ //`cartographic is required` is thrown from geodeticSurfaceNormalCartographic.
+ const n = cartographicToCartesianNormal;
+ const k = cartographicToCartesianK;
+ this.geodeticSurfaceNormalCartographic(cartographic, n);
+ Cartesian3.multiplyComponents(this._radiiSquared, n, k);
+ const gamma = Math.sqrt(Cartesian3.dot(n, k));
+ Cartesian3.divideByScalar(k, gamma, k);
+ Cartesian3.multiplyByScalar(n, cartographic.height, n);
+
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian3();
+ }
+ return Cartesian3.add(k, n, result);
+ };
+
+ /**
+ * Converts the provided array of cartographics to an array of Cartesians.
+ *
+ * @param {Cartographic[]} cartographics An array of cartographic positions.
+ * @param {Cartesian3[]} [result] The object onto which to store the result.
+ * @returns {Cartesian3[]} The modified result parameter or a new Array instance if none was provided.
+ *
+ * @example
+ * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.
+ * const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),
+ * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),
+ * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];
+ * const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);
+ */
+ Ellipsoid.prototype.cartographicArrayToCartesianArray = function (
+ cartographics,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartographics", cartographics);
+ //>>includeEnd('debug')
+
+ const length = cartographics.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length);
+ } else {
+ result.length = length;
+ }
+ for (let i = 0; i < length; i++) {
+ result[i] = this.cartographicToCartesian(cartographics[i], result[i]);
+ }
+ return result;
+ };
+
+ const cartesianToCartographicN = new Cartesian3();
+ const cartesianToCartographicP = new Cartesian3();
+ const cartesianToCartographicH = new Cartesian3();
+
+ /**
+ * Converts the provided cartesian to cartographic representation.
+ * The cartesian is undefined at the center of the ellipsoid.
+ *
+ * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.
+ * @param {Cartographic} [result] The object onto which to store the result.
+ * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.
+ *
+ * @example
+ * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.
+ * const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);
+ * const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);
+ */
+ Ellipsoid.prototype.cartesianToCartographic = function (cartesian, result) {
+ //`cartesian is required.` is thrown from scaleToGeodeticSurface
+ const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP);
+
+ if (!defaultValue.defined(p)) {
+ return undefined;
+ }
+
+ const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN);
+ const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);
+
+ const longitude = Math.atan2(n.y, n.x);
+ const latitude = Math.asin(n.z);
+ const height =
+ Math$1.CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);
+
+ if (!defaultValue.defined(result)) {
+ return new Cartographic(longitude, latitude, height);
+ }
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = height;
+ return result;
+ };
+
+ /**
+ * Converts the provided array of cartesians to an array of cartographics.
+ *
+ * @param {Cartesian3[]} cartesians An array of Cartesian positions.
+ * @param {Cartographic[]} [result] The object onto which to store the result.
+ * @returns {Cartographic[]} The modified result parameter or a new Array instance if none was provided.
+ *
+ * @example
+ * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.
+ * const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),
+ * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),
+ * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]
+ * const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);
+ */
+ Ellipsoid.prototype.cartesianArrayToCartographicArray = function (
+ cartesians,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("cartesians", cartesians);
+ //>>includeEnd('debug');
+
+ const length = cartesians.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length);
+ } else {
+ result.length = length;
+ }
+ for (let i = 0; i < length; ++i) {
+ result[i] = this.cartesianToCartographic(cartesians[i], result[i]);
+ }
+ return result;
+ };
+
+ /**
+ * Scales the provided Cartesian position along the geodetic surface normal
+ * so that it is on the surface of this ellipsoid. If the position is
+ * at the center of the ellipsoid, this function returns undefined.
+ *
+ * @param {Cartesian3} cartesian The Cartesian position to scale.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.
+ */
+ Ellipsoid.prototype.scaleToGeodeticSurface = function (cartesian, result) {
+ return scaleToGeodeticSurface(
+ cartesian,
+ this._oneOverRadii,
+ this._oneOverRadiiSquared,
+ this._centerToleranceSquared,
+ result
+ );
+ };
+
+ /**
+ * Scales the provided Cartesian position along the geocentric surface normal
+ * so that it is on the surface of this ellipsoid.
+ *
+ * @param {Cartesian3} cartesian The Cartesian position to scale.
+ * @param {Cartesian3} [result] The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.
+ */
+ Ellipsoid.prototype.scaleToGeocentricSurface = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian3();
+ }
+
+ const positionX = cartesian.x;
+ const positionY = cartesian.y;
+ const positionZ = cartesian.z;
+ const oneOverRadiiSquared = this._oneOverRadiiSquared;
+
+ const beta =
+ 1.0 /
+ Math.sqrt(
+ positionX * positionX * oneOverRadiiSquared.x +
+ positionY * positionY * oneOverRadiiSquared.y +
+ positionZ * positionZ * oneOverRadiiSquared.z
+ );
+
+ return Cartesian3.multiplyByScalar(cartesian, beta, result);
+ };
+
+ /**
+ * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying
+ * its components by the result of {@link Ellipsoid#oneOverRadii}.
+ *
+ * @param {Cartesian3} position The position to transform.
+ * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and
+ * return a new instance.
+ * @returns {Cartesian3} The position expressed in the scaled space. The returned instance is the
+ * one passed as the result parameter if it is not undefined, or a new instance of it is.
+ */
+ Ellipsoid.prototype.transformPositionToScaledSpace = function (
+ position,
+ result
+ ) {
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian3();
+ }
+
+ return Cartesian3.multiplyComponents(position, this._oneOverRadii, result);
+ };
+
+ /**
+ * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying
+ * its components by the result of {@link Ellipsoid#radii}.
+ *
+ * @param {Cartesian3} position The position to transform.
+ * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and
+ * return a new instance.
+ * @returns {Cartesian3} The position expressed in the unscaled space. The returned instance is the
+ * one passed as the result parameter if it is not undefined, or a new instance of it is.
+ */
+ Ellipsoid.prototype.transformPositionFromScaledSpace = function (
+ position,
+ result
+ ) {
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian3();
+ }
+
+ return Cartesian3.multiplyComponents(position, this._radii, result);
+ };
+
+ /**
+ * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Ellipsoid} [right] The other Ellipsoid.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ Ellipsoid.prototype.equals = function (right) {
+ return (
+ this === right ||
+ (defaultValue.defined(right) && Cartesian3.equals(this._radii, right._radii))
+ );
+ };
+
+ /**
+ * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.
+ *
+ * @returns {String} A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.
+ */
+ Ellipsoid.prototype.toString = function () {
+ return this._radii.toString();
+ };
+
+ /**
+ * Computes a point which is the intersection of the surface normal with the z-axis.
+ *
+ * @param {Cartesian3} position the position. must be on the surface of the ellipsoid.
+ * @param {Number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.
+ * In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center.
+ * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).
+ * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2
+ * @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and
+ * return a new instance.
+ * @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise
+ *
+ * @exception {DeveloperError} position is required.
+ * @exception {DeveloperError} Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).
+ * @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.
+ */
+ Ellipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function (
+ position,
+ buffer,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("position", position);
+
+ if (
+ !Math$1.CesiumMath.equalsEpsilon(
+ this._radii.x,
+ this._radii.y,
+ Math$1.CesiumMath.EPSILON15
+ )
+ ) {
+ throw new Check.DeveloperError(
+ "Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)"
+ );
+ }
+
+ Check.Check.typeOf.number.greaterThan("Ellipsoid.radii.z", this._radii.z, 0);
+ //>>includeEnd('debug');
+
+ buffer = defaultValue.defaultValue(buffer, 0.0);
+
+ const squaredXOverSquaredZ = this._squaredXOverSquaredZ;
+
+ if (!defaultValue.defined(result)) {
+ result = new Cartesian3();
+ }
+
+ result.x = 0.0;
+ result.y = 0.0;
+ result.z = position.z * (1 - squaredXOverSquaredZ);
+
+ if (Math.abs(result.z) >= this._radii.z - buffer) {
+ return undefined;
+ }
+
+ return result;
+ };
+
+ const abscissas = [
+ 0.14887433898163,
+ 0.43339539412925,
+ 0.67940956829902,
+ 0.86506336668898,
+ 0.97390652851717,
+ 0.0,
+ ];
+ const weights = [
+ 0.29552422471475,
+ 0.26926671930999,
+ 0.21908636251598,
+ 0.14945134915058,
+ 0.066671344308684,
+ 0.0,
+ ];
+
+ /**
+ * Compute the 10th order Gauss-Legendre Quadrature of the given definite integral.
+ *
+ * @param {Number} a The lower bound for the integration.
+ * @param {Number} b The upper bound for the integration.
+ * @param {Ellipsoid~RealValuedScalarFunction} func The function to integrate.
+ * @returns {Number} The value of the integral of the given function over the given domain.
+ *
+ * @private
+ */
+ function gaussLegendreQuadrature(a, b, func) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("a", a);
+ Check.Check.typeOf.number("b", b);
+ Check.Check.typeOf.func("func", func);
+ //>>includeEnd('debug');
+
+ // The range is half of the normal range since the five weights add to one (ten weights add to two).
+ // The values of the abscissas are multiplied by two to account for this.
+ const xMean = 0.5 * (b + a);
+ const xRange = 0.5 * (b - a);
+
+ let sum = 0.0;
+ for (let i = 0; i < 5; i++) {
+ const dx = xRange * abscissas[i];
+ sum += weights[i] * (func(xMean + dx) + func(xMean - dx));
+ }
+
+ // Scale the sum to the range of x.
+ sum *= xRange;
+ return sum;
+ }
+
+ /**
+ * A real valued scalar function.
+ * @callback Ellipsoid~RealValuedScalarFunction
+ *
+ * @param {Number} x The value used to evaluate the function.
+ * @returns {Number} The value of the function at x.
+ *
+ * @private
+ */
+
+ /**
+ * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using
+ * Gauss-Legendre 10th order quadrature.
+ *
+ * @param {Rectangle} rectangle The rectangle used for computing the surface area.
+ * @returns {Number} The approximate area of the rectangle on the surface of this ellipsoid.
+ */
+ Ellipsoid.prototype.surfaceArea = function (rectangle) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ //>>includeEnd('debug');
+ const minLongitude = rectangle.west;
+ let maxLongitude = rectangle.east;
+ const minLatitude = rectangle.south;
+ const maxLatitude = rectangle.north;
+
+ while (maxLongitude < minLongitude) {
+ maxLongitude += Math$1.CesiumMath.TWO_PI;
+ }
+
+ const radiiSquared = this._radiiSquared;
+ const a2 = radiiSquared.x;
+ const b2 = radiiSquared.y;
+ const c2 = radiiSquared.z;
+ const a2b2 = a2 * b2;
+ return gaussLegendreQuadrature(minLatitude, maxLatitude, function (lat) {
+ // phi represents the angle measured from the north pole
+ // sin(phi) = sin(pi / 2 - lat) = cos(lat), cos(phi) is similar
+ const sinPhi = Math.cos(lat);
+ const cosPhi = Math.sin(lat);
+ return (
+ Math.cos(lat) *
+ gaussLegendreQuadrature(minLongitude, maxLongitude, function (lon) {
+ const cosTheta = Math.cos(lon);
+ const sinTheta = Math.sin(lon);
+ return Math.sqrt(
+ a2b2 * cosPhi * cosPhi +
+ c2 *
+ (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) *
+ sinPhi *
+ sinPhi
+ );
+ })
+ );
+ });
+ };
+
+ /**
+ * A 3x3 matrix, indexable as a column-major order array.
+ * Constructor parameters are in row-major order for code readability.
+ * @alias Matrix3
+ * @constructor
+ * @implements {ArrayLike}
+ *
+ * @param {Number} [column0Row0=0.0] The value for column 0, row 0.
+ * @param {Number} [column1Row0=0.0] The value for column 1, row 0.
+ * @param {Number} [column2Row0=0.0] The value for column 2, row 0.
+ * @param {Number} [column0Row1=0.0] The value for column 0, row 1.
+ * @param {Number} [column1Row1=0.0] The value for column 1, row 1.
+ * @param {Number} [column2Row1=0.0] The value for column 2, row 1.
+ * @param {Number} [column0Row2=0.0] The value for column 0, row 2.
+ * @param {Number} [column1Row2=0.0] The value for column 1, row 2.
+ * @param {Number} [column2Row2=0.0] The value for column 2, row 2.
+ *
+ * @see Matrix3.fromArray
+ * @see Matrix3.fromColumnMajorArray
+ * @see Matrix3.fromRowMajorArray
+ * @see Matrix3.fromQuaternion
+ * @see Matrix3.fromHeadingPitchRoll
+ * @see Matrix3.fromScale
+ * @see Matrix3.fromUniformScale
+ * @see Matrix3.fromCrossProduct
+ * @see Matrix3.fromRotationX
+ * @see Matrix3.fromRotationY
+ * @see Matrix3.fromRotationZ
+ * @see Matrix2
+ * @see Matrix4
+ */
+ function Matrix3(
+ column0Row0,
+ column1Row0,
+ column2Row0,
+ column0Row1,
+ column1Row1,
+ column2Row1,
+ column0Row2,
+ column1Row2,
+ column2Row2
+ ) {
+ this[0] = defaultValue.defaultValue(column0Row0, 0.0);
+ this[1] = defaultValue.defaultValue(column0Row1, 0.0);
+ this[2] = defaultValue.defaultValue(column0Row2, 0.0);
+ this[3] = defaultValue.defaultValue(column1Row0, 0.0);
+ this[4] = defaultValue.defaultValue(column1Row1, 0.0);
+ this[5] = defaultValue.defaultValue(column1Row2, 0.0);
+ this[6] = defaultValue.defaultValue(column2Row0, 0.0);
+ this[7] = defaultValue.defaultValue(column2Row1, 0.0);
+ this[8] = defaultValue.defaultValue(column2Row2, 0.0);
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ Matrix3.packedLength = 9;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {Matrix3} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ Matrix3.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value[0];
+ array[startingIndex++] = value[1];
+ array[startingIndex++] = value[2];
+ array[startingIndex++] = value[3];
+ array[startingIndex++] = value[4];
+ array[startingIndex++] = value[5];
+ array[startingIndex++] = value[6];
+ array[startingIndex++] = value[7];
+ array[startingIndex++] = value[8];
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {Matrix3} [result] The object into which to store the result.
+ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.
+ */
+ Matrix3.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3();
+ }
+
+ result[0] = array[startingIndex++];
+ result[1] = array[startingIndex++];
+ result[2] = array[startingIndex++];
+ result[3] = array[startingIndex++];
+ result[4] = array[startingIndex++];
+ result[5] = array[startingIndex++];
+ result[6] = array[startingIndex++];
+ result[7] = array[startingIndex++];
+ result[8] = array[startingIndex++];
+ return result;
+ };
+
+ /**
+ * Flattens an array of Matrix3s into an array of components. The components
+ * are stored in column-major order.
+ *
+ * @param {Matrix3[]} array The array of matrices to pack.
+ * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 9 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 9) elements.
+ * @returns {Number[]} The packed array.
+ */
+ Matrix3.packArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ const resultLength = length * 9;
+ if (!defaultValue.defined(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(
+ "If result is a typed array, it must have exactly array.length * 9 elements"
+ );
+ //>>includeEnd('debug');
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+
+ for (let i = 0; i < length; ++i) {
+ Matrix3.pack(array[i], result, i * 9);
+ }
+ return result;
+ };
+
+ /**
+ * Unpacks an array of column-major matrix components into an array of Matrix3s.
+ *
+ * @param {Number[]} array The array of components to unpack.
+ * @param {Matrix3[]} [result] The array onto which to store the result.
+ * @returns {Matrix3[]} The unpacked array.
+ */
+ Matrix3.unpackArray = function (array, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ Check.Check.typeOf.number.greaterThanOrEquals("array.length", array.length, 9);
+ if (array.length % 9 !== 0) {
+ throw new Check.DeveloperError("array length must be a multiple of 9.");
+ }
+ //>>includeEnd('debug');
+
+ const length = array.length;
+ if (!defaultValue.defined(result)) {
+ result = new Array(length / 9);
+ } else {
+ result.length = length / 9;
+ }
+
+ for (let i = 0; i < length; i += 9) {
+ const index = i / 9;
+ result[index] = Matrix3.unpack(array, i, result[index]);
+ }
+ return result;
+ };
+
+ /**
+ * Duplicates a Matrix3 instance.
+ *
+ * @param {Matrix3} matrix The matrix to duplicate.
+ * @param {Matrix3} [result] The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)
+ */
+ Matrix3.clone = function (matrix, result) {
+ if (!defaultValue.defined(matrix)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ return new Matrix3(
+ matrix[0],
+ matrix[3],
+ matrix[6],
+ matrix[1],
+ matrix[4],
+ matrix[7],
+ matrix[2],
+ matrix[5],
+ matrix[8]
+ );
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ return result;
+ };
+
+ /**
+ * Creates a Matrix3 from 9 consecutive elements in an array.
+ *
+ * @function
+ * @param {Number[]} array The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order.
+ * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.
+ * @param {Matrix3} [result] The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.
+ *
+ * @example
+ * // Create the Matrix3:
+ * // [1.0, 2.0, 3.0]
+ * // [1.0, 2.0, 3.0]
+ * // [1.0, 2.0, 3.0]
+ *
+ * const v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
+ * const m = Cesium.Matrix3.fromArray(v);
+ *
+ * // Create same Matrix3 with using an offset into an array
+ * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];
+ * const m2 = Cesium.Matrix3.fromArray(v2, 2);
+ */
+ Matrix3.fromArray = Matrix3.unpack;
+
+ /**
+ * Creates a Matrix3 instance from a column-major order array.
+ *
+ * @param {Number[]} values The column-major order array.
+ * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.
+ */
+ Matrix3.fromColumnMajorArray = function (values, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("values", values);
+ //>>includeEnd('debug');
+
+ return Matrix3.clone(values, result);
+ };
+
+ /**
+ * Creates a Matrix3 instance from a row-major order array.
+ * The resulting matrix will be in column-major order.
+ *
+ * @param {Number[]} values The row-major order array.
+ * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.
+ */
+ Matrix3.fromRowMajorArray = function (values, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("values", values);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3(
+ values[0],
+ values[1],
+ values[2],
+ values[3],
+ values[4],
+ values[5],
+ values[6],
+ values[7],
+ values[8]
+ );
+ }
+ result[0] = values[0];
+ result[1] = values[3];
+ result[2] = values[6];
+ result[3] = values[1];
+ result[4] = values[4];
+ result[5] = values[7];
+ result[6] = values[2];
+ result[7] = values[5];
+ result[8] = values[8];
+ return result;
+ };
+
+ /**
+ * Computes a 3x3 rotation matrix from the provided quaternion.
+ *
+ * @param {Quaternion} quaternion the quaternion to use.
+ * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix3} The 3x3 rotation matrix from this quaternion.
+ */
+ Matrix3.fromQuaternion = function (quaternion, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("quaternion", quaternion);
+ //>>includeEnd('debug');
+
+ const x2 = quaternion.x * quaternion.x;
+ const xy = quaternion.x * quaternion.y;
+ const xz = quaternion.x * quaternion.z;
+ const xw = quaternion.x * quaternion.w;
+ const y2 = quaternion.y * quaternion.y;
+ const yz = quaternion.y * quaternion.z;
+ const yw = quaternion.y * quaternion.w;
+ const z2 = quaternion.z * quaternion.z;
+ const zw = quaternion.z * quaternion.w;
+ const w2 = quaternion.w * quaternion.w;
+
+ const m00 = x2 - y2 - z2 + w2;
+ const m01 = 2.0 * (xy - zw);
+ const m02 = 2.0 * (xz + yw);
+
+ const m10 = 2.0 * (xy + zw);
+ const m11 = -x2 + y2 - z2 + w2;
+ const m12 = 2.0 * (yz - xw);
+
+ const m20 = 2.0 * (xz - yw);
+ const m21 = 2.0 * (yz + xw);
+ const m22 = -x2 - y2 + z2 + w2;
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);
+ }
+ result[0] = m00;
+ result[1] = m10;
+ result[2] = m20;
+ result[3] = m01;
+ result[4] = m11;
+ result[5] = m21;
+ result[6] = m02;
+ result[7] = m12;
+ result[8] = m22;
+ return result;
+ };
+
+ /**
+ * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
+ *
+ * @param {HeadingPitchRoll} headingPitchRoll the headingPitchRoll to use.
+ * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll.
+ */
+ Matrix3.fromHeadingPitchRoll = function (headingPitchRoll, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("headingPitchRoll", headingPitchRoll);
+ //>>includeEnd('debug');
+
+ const cosTheta = Math.cos(-headingPitchRoll.pitch);
+ const cosPsi = Math.cos(-headingPitchRoll.heading);
+ const cosPhi = Math.cos(headingPitchRoll.roll);
+ const sinTheta = Math.sin(-headingPitchRoll.pitch);
+ const sinPsi = Math.sin(-headingPitchRoll.heading);
+ const sinPhi = Math.sin(headingPitchRoll.roll);
+
+ const m00 = cosTheta * cosPsi;
+ const m01 = -cosPhi * sinPsi + sinPhi * sinTheta * cosPsi;
+ const m02 = sinPhi * sinPsi + cosPhi * sinTheta * cosPsi;
+
+ const m10 = cosTheta * sinPsi;
+ const m11 = cosPhi * cosPsi + sinPhi * sinTheta * sinPsi;
+ const m12 = -sinPhi * cosPsi + cosPhi * sinTheta * sinPsi;
+
+ const m20 = -sinTheta;
+ const m21 = sinPhi * cosTheta;
+ const m22 = cosPhi * cosTheta;
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);
+ }
+ result[0] = m00;
+ result[1] = m10;
+ result[2] = m20;
+ result[3] = m01;
+ result[4] = m11;
+ result[5] = m21;
+ result[6] = m02;
+ result[7] = m12;
+ result[8] = m22;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix3 instance representing a non-uniform scale.
+ *
+ * @param {Cartesian3} scale The x, y, and z scale factors.
+ * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.
+ *
+ * @example
+ * // Creates
+ * // [7.0, 0.0, 0.0]
+ * // [0.0, 8.0, 0.0]
+ * // [0.0, 0.0, 9.0]
+ * const m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));
+ */
+ Matrix3.fromScale = function (scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("scale", scale);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3(scale.x, 0.0, 0.0, 0.0, scale.y, 0.0, 0.0, 0.0, scale.z);
+ }
+
+ result[0] = scale.x;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = scale.y;
+ result[5] = 0.0;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = scale.z;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix3 instance representing a uniform scale.
+ *
+ * @param {Number} scale The uniform scale factor.
+ * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.
+ *
+ * @example
+ * // Creates
+ * // [2.0, 0.0, 0.0]
+ * // [0.0, 2.0, 0.0]
+ * // [0.0, 0.0, 2.0]
+ * const m = Cesium.Matrix3.fromUniformScale(2.0);
+ */
+ Matrix3.fromUniformScale = function (scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("scale", scale);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3(scale, 0.0, 0.0, 0.0, scale, 0.0, 0.0, 0.0, scale);
+ }
+
+ result[0] = scale;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = scale;
+ result[5] = 0.0;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = scale;
+ return result;
+ };
+
+ /**
+ * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.
+ *
+ * @param {Cartesian3} vector the vector on the left hand side of the cross product operation.
+ * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.
+ *
+ * @example
+ * // Creates
+ * // [0.0, -9.0, 8.0]
+ * // [9.0, 0.0, -7.0]
+ * // [-8.0, 7.0, 0.0]
+ * const m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));
+ */
+ Matrix3.fromCrossProduct = function (vector, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("vector", vector);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3(
+ 0.0,
+ -vector.z,
+ vector.y,
+ vector.z,
+ 0.0,
+ -vector.x,
+ -vector.y,
+ vector.x,
+ 0.0
+ );
+ }
+
+ result[0] = 0.0;
+ result[1] = vector.z;
+ result[2] = -vector.y;
+ result[3] = -vector.z;
+ result[4] = 0.0;
+ result[5] = vector.x;
+ result[6] = vector.y;
+ result[7] = -vector.x;
+ result[8] = 0.0;
+ return result;
+ };
+
+ /**
+ * Creates a rotation matrix around the x-axis.
+ *
+ * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.
+ * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.
+ *
+ * @example
+ * // Rotate a point 45 degrees counterclockwise around the x-axis.
+ * const p = new Cesium.Cartesian3(5, 6, 7);
+ * const m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0));
+ * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
+ */
+ Matrix3.fromRotationX = function (angle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("angle", angle);
+ //>>includeEnd('debug');
+
+ const cosAngle = Math.cos(angle);
+ const sinAngle = Math.sin(angle);
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3(
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ cosAngle,
+ -sinAngle,
+ 0.0,
+ sinAngle,
+ cosAngle
+ );
+ }
+
+ result[0] = 1.0;
+ result[1] = 0.0;
+ result[2] = 0.0;
+ result[3] = 0.0;
+ result[4] = cosAngle;
+ result[5] = sinAngle;
+ result[6] = 0.0;
+ result[7] = -sinAngle;
+ result[8] = cosAngle;
+
+ return result;
+ };
+
+ /**
+ * Creates a rotation matrix around the y-axis.
+ *
+ * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.
+ * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.
+ *
+ * @example
+ * // Rotate a point 45 degrees counterclockwise around the y-axis.
+ * const p = new Cesium.Cartesian3(5, 6, 7);
+ * const m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0));
+ * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
+ */
+ Matrix3.fromRotationY = function (angle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("angle", angle);
+ //>>includeEnd('debug');
+
+ const cosAngle = Math.cos(angle);
+ const sinAngle = Math.sin(angle);
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3(
+ cosAngle,
+ 0.0,
+ sinAngle,
+ 0.0,
+ 1.0,
+ 0.0,
+ -sinAngle,
+ 0.0,
+ cosAngle
+ );
+ }
+
+ result[0] = cosAngle;
+ result[1] = 0.0;
+ result[2] = -sinAngle;
+ result[3] = 0.0;
+ result[4] = 1.0;
+ result[5] = 0.0;
+ result[6] = sinAngle;
+ result[7] = 0.0;
+ result[8] = cosAngle;
+
+ return result;
+ };
+
+ /**
+ * Creates a rotation matrix around the z-axis.
+ *
+ * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.
+ * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.
+ * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.
+ *
+ * @example
+ * // Rotate a point 45 degrees counterclockwise around the z-axis.
+ * const p = new Cesium.Cartesian3(5, 6, 7);
+ * const m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0));
+ * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());
+ */
+ Matrix3.fromRotationZ = function (angle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("angle", angle);
+ //>>includeEnd('debug');
+
+ const cosAngle = Math.cos(angle);
+ const sinAngle = Math.sin(angle);
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3(
+ cosAngle,
+ -sinAngle,
+ 0.0,
+ sinAngle,
+ cosAngle,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ );
+ }
+
+ result[0] = cosAngle;
+ result[1] = sinAngle;
+ result[2] = 0.0;
+ result[3] = -sinAngle;
+ result[4] = cosAngle;
+ result[5] = 0.0;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = 1.0;
+
+ return result;
+ };
+
+ /**
+ * Creates an Array from the provided Matrix3 instance.
+ * The array will be in column-major order.
+ *
+ * @param {Matrix3} matrix The matrix to use..
+ * @param {Number[]} [result] The Array onto which to store the result.
+ * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided.
+ */
+ Matrix3.toArray = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return [
+ matrix[0],
+ matrix[1],
+ matrix[2],
+ matrix[3],
+ matrix[4],
+ matrix[5],
+ matrix[6],
+ matrix[7],
+ matrix[8],
+ ];
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ return result;
+ };
+
+ /**
+ * Computes the array index of the element at the provided row and column.
+ *
+ * @param {Number} column The zero-based index of the column.
+ * @param {Number} row The zero-based index of the row.
+ * @returns {Number} The index of the element at the provided row and column.
+ *
+ * @exception {DeveloperError} row must be 0, 1, or 2.
+ * @exception {DeveloperError} column must be 0, 1, or 2.
+ *
+ * @example
+ * const myMatrix = new Cesium.Matrix3();
+ * const column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0);
+ * const column1Row0 = myMatrix[column1Row0Index]
+ * myMatrix[column1Row0Index] = 10.0;
+ */
+ Matrix3.getElementIndex = function (column, row) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.greaterThanOrEquals("row", row, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("row", row, 2);
+ Check.Check.typeOf.number.greaterThanOrEquals("column", column, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("column", column, 2);
+ //>>includeEnd('debug');
+
+ return column * 3 + row;
+ };
+
+ /**
+ * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.
+ *
+ * @param {Matrix3} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the column to retrieve.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0, 1, or 2.
+ */
+ Matrix3.getColumn = function (matrix, index, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 2);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const startIndex = index * 3;
+ const x = matrix[startIndex];
+ const y = matrix[startIndex + 1];
+ const z = matrix[startIndex + 2];
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+ };
+
+ /**
+ * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.
+ *
+ * @param {Matrix3} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the column to set.
+ * @param {Cartesian3} cartesian The Cartesian whose values will be assigned to the specified column.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0, 1, or 2.
+ */
+ Matrix3.setColumn = function (matrix, index, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 2);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result = Matrix3.clone(matrix, result);
+ const startIndex = index * 3;
+ result[startIndex] = cartesian.x;
+ result[startIndex + 1] = cartesian.y;
+ result[startIndex + 2] = cartesian.z;
+ return result;
+ };
+
+ /**
+ * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.
+ *
+ * @param {Matrix3} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the row to retrieve.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0, 1, or 2.
+ */
+ Matrix3.getRow = function (matrix, index, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 2);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const x = matrix[index];
+ const y = matrix[index + 3];
+ const z = matrix[index + 6];
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+ };
+
+ /**
+ * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.
+ *
+ * @param {Matrix3} matrix The matrix to use.
+ * @param {Number} index The zero-based index of the row to set.
+ * @param {Cartesian3} cartesian The Cartesian whose values will be assigned to the specified row.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ * @exception {DeveloperError} index must be 0, 1, or 2.
+ */
+ Matrix3.setRow = function (matrix, index, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check.Check.typeOf.number.lessThanOrEquals("index", index, 2);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result = Matrix3.clone(matrix, result);
+ result[index] = cartesian.x;
+ result[index + 3] = cartesian.y;
+ result[index + 6] = cartesian.z;
+ return result;
+ };
+
+ const scaleScratch1 = new Cartesian3();
+
+ /**
+ * Computes a new matrix that replaces the scale with the provided scale.
+ * This assumes the matrix is an affine transformation.
+ *
+ * @param {Matrix3} matrix The matrix to use.
+ * @param {Cartesian3} scale The scale that replaces the scale of the provided matrix.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ * @see Matrix3.setUniformScale
+ * @see Matrix3.fromScale
+ * @see Matrix3.fromUniformScale
+ * @see Matrix3.multiplyByScale
+ * @see Matrix3.multiplyByUniformScale
+ * @see Matrix3.getScale
+ */
+ Matrix3.setScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const existingScale = Matrix3.getScale(matrix, scaleScratch1);
+ const scaleRatioX = scale.x / existingScale.x;
+ const scaleRatioY = scale.y / existingScale.y;
+ const scaleRatioZ = scale.z / existingScale.z;
+
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioX;
+ result[3] = matrix[3] * scaleRatioY;
+ result[4] = matrix[4] * scaleRatioY;
+ result[5] = matrix[5] * scaleRatioY;
+ result[6] = matrix[6] * scaleRatioZ;
+ result[7] = matrix[7] * scaleRatioZ;
+ result[8] = matrix[8] * scaleRatioZ;
+
+ return result;
+ };
+
+ const scaleScratch2 = new Cartesian3();
+
+ /**
+ * Computes a new matrix that replaces the scale with the provided uniform scale.
+ * This assumes the matrix is an affine transformation.
+ *
+ * @param {Matrix3} matrix The matrix to use.
+ * @param {Number} scale The uniform scale that replaces the scale of the provided matrix.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ * @see Matrix3.setScale
+ * @see Matrix3.fromScale
+ * @see Matrix3.fromUniformScale
+ * @see Matrix3.multiplyByScale
+ * @see Matrix3.multiplyByUniformScale
+ * @see Matrix3.getScale
+ */
+ Matrix3.setUniformScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const existingScale = Matrix3.getScale(matrix, scaleScratch2);
+ const scaleRatioX = scale / existingScale.x;
+ const scaleRatioY = scale / existingScale.y;
+ const scaleRatioZ = scale / existingScale.z;
+
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioX;
+ result[3] = matrix[3] * scaleRatioY;
+ result[4] = matrix[4] * scaleRatioY;
+ result[5] = matrix[5] * scaleRatioY;
+ result[6] = matrix[6] * scaleRatioZ;
+ result[7] = matrix[7] * scaleRatioZ;
+ result[8] = matrix[8] * scaleRatioZ;
+
+ return result;
+ };
+
+ const scratchColumn = new Cartesian3();
+
+ /**
+ * Extracts the non-uniform scale assuming the matrix is an affine transformation.
+ *
+ * @param {Matrix3} matrix The matrix.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ *
+ * @see Matrix3.multiplyByScale
+ * @see Matrix3.multiplyByUniformScale
+ * @see Matrix3.fromScale
+ * @see Matrix3.fromUniformScale
+ * @see Matrix3.setScale
+ * @see Matrix3.setUniformScale
+ */
+ Matrix3.getScale = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = Cartesian3.magnitude(
+ Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)
+ );
+ result.y = Cartesian3.magnitude(
+ Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)
+ );
+ result.z = Cartesian3.magnitude(
+ Cartesian3.fromElements(matrix[6], matrix[7], matrix[8], scratchColumn)
+ );
+ return result;
+ };
+
+ const scaleScratch3 = new Cartesian3();
+
+ /**
+ * Computes the maximum scale assuming the matrix is an affine transformation.
+ * The maximum scale is the maximum length of the column vectors.
+ *
+ * @param {Matrix3} matrix The matrix.
+ * @returns {Number} The maximum scale.
+ */
+ Matrix3.getMaximumScale = function (matrix) {
+ Matrix3.getScale(matrix, scaleScratch3);
+ return Cartesian3.maximumComponent(scaleScratch3);
+ };
+
+ const scaleScratch4 = new Cartesian3();
+
+ /**
+ * Sets the rotation assuming the matrix is an affine transformation.
+ *
+ * @param {Matrix3} matrix The matrix.
+ * @param {Matrix3} rotation The rotation matrix.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ * @see Matrix3.getRotation
+ */
+ Matrix3.setRotation = function (matrix, rotation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const scale = Matrix3.getScale(matrix, scaleScratch4);
+
+ result[0] = rotation[0] * scale.x;
+ result[1] = rotation[1] * scale.x;
+ result[2] = rotation[2] * scale.x;
+ result[3] = rotation[3] * scale.y;
+ result[4] = rotation[4] * scale.y;
+ result[5] = rotation[5] * scale.y;
+ result[6] = rotation[6] * scale.z;
+ result[7] = rotation[7] * scale.z;
+ result[8] = rotation[8] * scale.z;
+
+ return result;
+ };
+
+ const scaleScratch5 = new Cartesian3();
+
+ /**
+ * Extracts the rotation matrix assuming the matrix is an affine transformation.
+ *
+ * @param {Matrix3} matrix The matrix.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ * @see Matrix3.setRotation
+ */
+ Matrix3.getRotation = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const scale = Matrix3.getScale(matrix, scaleScratch5);
+
+ result[0] = matrix[0] / scale.x;
+ result[1] = matrix[1] / scale.x;
+ result[2] = matrix[2] / scale.x;
+ result[3] = matrix[3] / scale.y;
+ result[4] = matrix[4] / scale.y;
+ result[5] = matrix[5] / scale.y;
+ result[6] = matrix[6] / scale.z;
+ result[7] = matrix[7] / scale.z;
+ result[8] = matrix[8] / scale.z;
+
+ return result;
+ };
+
+ /**
+ * Computes the product of two matrices.
+ *
+ * @param {Matrix3} left The first matrix.
+ * @param {Matrix3} right The second matrix.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ */
+ Matrix3.multiply = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const column0Row0 =
+ left[0] * right[0] + left[3] * right[1] + left[6] * right[2];
+ const column0Row1 =
+ left[1] * right[0] + left[4] * right[1] + left[7] * right[2];
+ const column0Row2 =
+ left[2] * right[0] + left[5] * right[1] + left[8] * right[2];
+
+ const column1Row0 =
+ left[0] * right[3] + left[3] * right[4] + left[6] * right[5];
+ const column1Row1 =
+ left[1] * right[3] + left[4] * right[4] + left[7] * right[5];
+ const column1Row2 =
+ left[2] * right[3] + left[5] * right[4] + left[8] * right[5];
+
+ const column2Row0 =
+ left[0] * right[6] + left[3] * right[7] + left[6] * right[8];
+ const column2Row1 =
+ left[1] * right[6] + left[4] * right[7] + left[7] * right[8];
+ const column2Row2 =
+ left[2] * right[6] + left[5] * right[7] + left[8] * right[8];
+
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column0Row2;
+ result[3] = column1Row0;
+ result[4] = column1Row1;
+ result[5] = column1Row2;
+ result[6] = column2Row0;
+ result[7] = column2Row1;
+ result[8] = column2Row2;
+ return result;
+ };
+
+ /**
+ * Computes the sum of two matrices.
+ *
+ * @param {Matrix3} left The first matrix.
+ * @param {Matrix3} right The second matrix.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ */
+ Matrix3.add = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = left[0] + right[0];
+ result[1] = left[1] + right[1];
+ result[2] = left[2] + right[2];
+ result[3] = left[3] + right[3];
+ result[4] = left[4] + right[4];
+ result[5] = left[5] + right[5];
+ result[6] = left[6] + right[6];
+ result[7] = left[7] + right[7];
+ result[8] = left[8] + right[8];
+ return result;
+ };
+
+ /**
+ * Computes the difference of two matrices.
+ *
+ * @param {Matrix3} left The first matrix.
+ * @param {Matrix3} right The second matrix.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ */
+ Matrix3.subtract = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = left[0] - right[0];
+ result[1] = left[1] - right[1];
+ result[2] = left[2] - right[2];
+ result[3] = left[3] - right[3];
+ result[4] = left[4] - right[4];
+ result[5] = left[5] - right[5];
+ result[6] = left[6] - right[6];
+ result[7] = left[7] - right[7];
+ result[8] = left[8] - right[8];
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix and a column vector.
+ *
+ * @param {Matrix3} matrix The matrix.
+ * @param {Cartesian3} cartesian The column.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Matrix3.multiplyByVector = function (matrix, cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const vX = cartesian.x;
+ const vY = cartesian.y;
+ const vZ = cartesian.z;
+
+ const x = matrix[0] * vX + matrix[3] * vY + matrix[6] * vZ;
+ const y = matrix[1] * vX + matrix[4] * vY + matrix[7] * vZ;
+ const z = matrix[2] * vX + matrix[5] * vY + matrix[8] * vZ;
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix and a scalar.
+ *
+ * @param {Matrix3} matrix The matrix.
+ * @param {Number} scalar The number to multiply by.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ */
+ Matrix3.multiplyByScalar = function (matrix, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = matrix[0] * scalar;
+ result[1] = matrix[1] * scalar;
+ result[2] = matrix[2] * scalar;
+ result[3] = matrix[3] * scalar;
+ result[4] = matrix[4] * scalar;
+ result[5] = matrix[5] * scalar;
+ result[6] = matrix[6] * scalar;
+ result[7] = matrix[7] * scalar;
+ result[8] = matrix[8] * scalar;
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.
+ *
+ * @param {Matrix3} matrix The matrix on the left-hand side.
+ * @param {Number} scale The non-uniform scale on the right-hand side.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ *
+ * @example
+ * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m);
+ * Cesium.Matrix3.multiplyByScale(m, scale, m);
+ *
+ * @see Matrix3.multiplyByUniformScale
+ * @see Matrix3.fromScale
+ * @see Matrix3.fromUniformScale
+ * @see Matrix3.setScale
+ * @see Matrix3.setUniformScale
+ * @see Matrix3.getScale
+ */
+ Matrix3.multiplyByScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = matrix[0] * scale.x;
+ result[1] = matrix[1] * scale.x;
+ result[2] = matrix[2] * scale.x;
+ result[3] = matrix[3] * scale.y;
+ result[4] = matrix[4] * scale.y;
+ result[5] = matrix[5] * scale.y;
+ result[6] = matrix[6] * scale.z;
+ result[7] = matrix[7] * scale.z;
+ result[8] = matrix[8] * scale.z;
+
+ return result;
+ };
+
+ /**
+ * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.
+ *
+ * @param {Matrix3} matrix The matrix on the left-hand side.
+ * @param {Number} scale The uniform scale on the right-hand side.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ * @example
+ * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromUniformScale(scale), m);
+ * Cesium.Matrix3.multiplyByUniformScale(m, scale, m);
+ *
+ * @see Matrix3.multiplyByScale
+ * @see Matrix3.fromScale
+ * @see Matrix3.fromUniformScale
+ * @see Matrix3.setScale
+ * @see Matrix3.setUniformScale
+ * @see Matrix3.getScale
+ */
+ Matrix3.multiplyByUniformScale = function (matrix, scale, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.number("scale", scale);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = matrix[0] * scale;
+ result[1] = matrix[1] * scale;
+ result[2] = matrix[2] * scale;
+ result[3] = matrix[3] * scale;
+ result[4] = matrix[4] * scale;
+ result[5] = matrix[5] * scale;
+ result[6] = matrix[6] * scale;
+ result[7] = matrix[7] * scale;
+ result[8] = matrix[8] * scale;
+
+ return result;
+ };
+
+ /**
+ * Creates a negated copy of the provided matrix.
+ *
+ * @param {Matrix3} matrix The matrix to negate.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ */
+ Matrix3.negate = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = -matrix[0];
+ result[1] = -matrix[1];
+ result[2] = -matrix[2];
+ result[3] = -matrix[3];
+ result[4] = -matrix[4];
+ result[5] = -matrix[5];
+ result[6] = -matrix[6];
+ result[7] = -matrix[7];
+ result[8] = -matrix[8];
+ return result;
+ };
+
+ /**
+ * Computes the transpose of the provided matrix.
+ *
+ * @param {Matrix3} matrix The matrix to transpose.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ */
+ Matrix3.transpose = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const column0Row0 = matrix[0];
+ const column0Row1 = matrix[3];
+ const column0Row2 = matrix[6];
+ const column1Row0 = matrix[1];
+ const column1Row1 = matrix[4];
+ const column1Row2 = matrix[7];
+ const column2Row0 = matrix[2];
+ const column2Row1 = matrix[5];
+ const column2Row2 = matrix[8];
+
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column0Row2;
+ result[3] = column1Row0;
+ result[4] = column1Row1;
+ result[5] = column1Row2;
+ result[6] = column2Row0;
+ result[7] = column2Row1;
+ result[8] = column2Row2;
+ return result;
+ };
+
+ function computeFrobeniusNorm(matrix) {
+ let norm = 0.0;
+ for (let i = 0; i < 9; ++i) {
+ const temp = matrix[i];
+ norm += temp * temp;
+ }
+
+ return Math.sqrt(norm);
+ }
+
+ const rowVal = [1, 0, 0];
+ const colVal = [2, 2, 1];
+
+ function offDiagonalFrobeniusNorm(matrix) {
+ // Computes the "off-diagonal" Frobenius norm.
+ // Assumes matrix is symmetric.
+
+ let norm = 0.0;
+ for (let i = 0; i < 3; ++i) {
+ const temp = matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])];
+ norm += 2.0 * temp * temp;
+ }
+
+ return Math.sqrt(norm);
+ }
+
+ function shurDecomposition(matrix, result) {
+ // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,
+ // section 8.4.2 The 2by2 Symmetric Schur Decomposition.
+ //
+ // The routine takes a matrix, which is assumed to be symmetric, and
+ // finds the largest off-diagonal term, and then creates
+ // a matrix (result) which can be used to help reduce it
+
+ const tolerance = Math$1.CesiumMath.EPSILON15;
+
+ let maxDiagonal = 0.0;
+ let rotAxis = 1;
+
+ // find pivot (rotAxis) based on max diagonal of matrix
+ for (let i = 0; i < 3; ++i) {
+ const temp = Math.abs(
+ matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])]
+ );
+ if (temp > maxDiagonal) {
+ rotAxis = i;
+ maxDiagonal = temp;
+ }
+ }
+
+ let c = 1.0;
+ let s = 0.0;
+
+ const p = rowVal[rotAxis];
+ const q = colVal[rotAxis];
+
+ if (Math.abs(matrix[Matrix3.getElementIndex(q, p)]) > tolerance) {
+ const qq = matrix[Matrix3.getElementIndex(q, q)];
+ const pp = matrix[Matrix3.getElementIndex(p, p)];
+ const qp = matrix[Matrix3.getElementIndex(q, p)];
+
+ const tau = (qq - pp) / 2.0 / qp;
+ let t;
+
+ if (tau < 0.0) {
+ t = -1.0 / (-tau + Math.sqrt(1.0 + tau * tau));
+ } else {
+ t = 1.0 / (tau + Math.sqrt(1.0 + tau * tau));
+ }
+
+ c = 1.0 / Math.sqrt(1.0 + t * t);
+ s = t * c;
+ }
+
+ result = Matrix3.clone(Matrix3.IDENTITY, result);
+
+ result[Matrix3.getElementIndex(p, p)] = result[
+ Matrix3.getElementIndex(q, q)
+ ] = c;
+ result[Matrix3.getElementIndex(q, p)] = s;
+ result[Matrix3.getElementIndex(p, q)] = -s;
+
+ return result;
+ }
+
+ const jMatrix = new Matrix3();
+ const jMatrixTranspose = new Matrix3();
+
+ /**
+ * Computes the eigenvectors and eigenvalues of a symmetric matrix.
+ *
+ * Returns a diagonal matrix and unitary matrix such that:
+ * matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)
+ *
+ *
+ * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns
+ * of the unitary matrix are the corresponding eigenvectors.
+ *
+ *
+ * @param {Matrix3} matrix The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.
+ * @param {Object} [result] An object with unitary and diagonal properties which are matrices onto which to store the result.
+ * @returns {Object} An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.
+ *
+ * @example
+ * const a = //... symetric matrix
+ * const result = {
+ * unitary : new Cesium.Matrix3(),
+ * diagonal : new Cesium.Matrix3()
+ * };
+ * Cesium.Matrix3.computeEigenDecomposition(a, result);
+ *
+ * const unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());
+ * const b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());
+ * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a
+ *
+ * const lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue
+ * const v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector
+ * const c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)
+ */
+ Matrix3.computeEigenDecomposition = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ //>>includeEnd('debug');
+
+ // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,
+ // section 8.4.3 The Classical Jacobi Algorithm
+
+ const tolerance = Math$1.CesiumMath.EPSILON20;
+ const maxSweeps = 10;
+
+ let count = 0;
+ let sweep = 0;
+
+ if (!defaultValue.defined(result)) {
+ result = {};
+ }
+
+ const unitaryMatrix = (result.unitary = Matrix3.clone(
+ Matrix3.IDENTITY,
+ result.unitary
+ ));
+ const diagMatrix = (result.diagonal = Matrix3.clone(matrix, result.diagonal));
+
+ const epsilon = tolerance * computeFrobeniusNorm(diagMatrix);
+
+ while (sweep < maxSweeps && offDiagonalFrobeniusNorm(diagMatrix) > epsilon) {
+ shurDecomposition(diagMatrix, jMatrix);
+ Matrix3.transpose(jMatrix, jMatrixTranspose);
+ Matrix3.multiply(diagMatrix, jMatrix, diagMatrix);
+ Matrix3.multiply(jMatrixTranspose, diagMatrix, diagMatrix);
+ Matrix3.multiply(unitaryMatrix, jMatrix, unitaryMatrix);
+
+ if (++count > 2) {
+ ++sweep;
+ count = 0;
+ }
+ }
+
+ return result;
+ };
+
+ /**
+ * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.
+ *
+ * @param {Matrix3} matrix The matrix with signed elements.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ */
+ Matrix3.abs = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result[0] = Math.abs(matrix[0]);
+ result[1] = Math.abs(matrix[1]);
+ result[2] = Math.abs(matrix[2]);
+ result[3] = Math.abs(matrix[3]);
+ result[4] = Math.abs(matrix[4]);
+ result[5] = Math.abs(matrix[5]);
+ result[6] = Math.abs(matrix[6]);
+ result[7] = Math.abs(matrix[7]);
+ result[8] = Math.abs(matrix[8]);
+
+ return result;
+ };
+
+ /**
+ * Computes the determinant of the provided matrix.
+ *
+ * @param {Matrix3} matrix The matrix to use.
+ * @returns {Number} The value of the determinant of the matrix.
+ */
+ Matrix3.determinant = function (matrix) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ //>>includeEnd('debug');
+
+ const m11 = matrix[0];
+ const m21 = matrix[3];
+ const m31 = matrix[6];
+ const m12 = matrix[1];
+ const m22 = matrix[4];
+ const m32 = matrix[7];
+ const m13 = matrix[2];
+ const m23 = matrix[5];
+ const m33 = matrix[8];
+
+ return (
+ m11 * (m22 * m33 - m23 * m32) +
+ m12 * (m23 * m31 - m21 * m33) +
+ m13 * (m21 * m32 - m22 * m31)
+ );
+ };
+
+ /**
+ * Computes the inverse of the provided matrix.
+ *
+ * @param {Matrix3} matrix The matrix to invert.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ *
+ * @exception {DeveloperError} matrix is not invertible.
+ */
+ Matrix3.inverse = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const m11 = matrix[0];
+ const m21 = matrix[1];
+ const m31 = matrix[2];
+ const m12 = matrix[3];
+ const m22 = matrix[4];
+ const m32 = matrix[5];
+ const m13 = matrix[6];
+ const m23 = matrix[7];
+ const m33 = matrix[8];
+
+ const determinant = Matrix3.determinant(matrix);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (Math.abs(determinant) <= Math$1.CesiumMath.EPSILON15) {
+ throw new Check.DeveloperError("matrix is not invertible");
+ }
+ //>>includeEnd('debug');
+
+ result[0] = m22 * m33 - m23 * m32;
+ result[1] = m23 * m31 - m21 * m33;
+ result[2] = m21 * m32 - m22 * m31;
+ result[3] = m13 * m32 - m12 * m33;
+ result[4] = m11 * m33 - m13 * m31;
+ result[5] = m12 * m31 - m11 * m32;
+ result[6] = m12 * m23 - m13 * m22;
+ result[7] = m13 * m21 - m11 * m23;
+ result[8] = m11 * m22 - m12 * m21;
+
+ const scale = 1.0 / determinant;
+ return Matrix3.multiplyByScalar(result, scale, result);
+ };
+
+ const scratchTransposeMatrix = new Matrix3();
+
+ /**
+ * Computes the inverse transpose of a matrix.
+ *
+ * @param {Matrix3} matrix The matrix to transpose and invert.
+ * @param {Matrix3} result The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter.
+ */
+ Matrix3.inverseTranspose = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ return Matrix3.inverse(
+ Matrix3.transpose(matrix, scratchTransposeMatrix),
+ result
+ );
+ };
+
+ /**
+ * Compares the provided matrices componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Matrix3} [left] The first matrix.
+ * @param {Matrix3} [right] The second matrix.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ Matrix3.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left[0] === right[0] &&
+ left[1] === right[1] &&
+ left[2] === right[2] &&
+ left[3] === right[3] &&
+ left[4] === right[4] &&
+ left[5] === right[5] &&
+ left[6] === right[6] &&
+ left[7] === right[7] &&
+ left[8] === right[8])
+ );
+ };
+
+ /**
+ * Compares the provided matrices componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Matrix3} [left] The first matrix.
+ * @param {Matrix3} [right] The second matrix.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ Matrix3.equalsEpsilon = function (left, right, epsilon) {
+ epsilon = defaultValue.defaultValue(epsilon, 0);
+
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math.abs(left[0] - right[0]) <= epsilon &&
+ Math.abs(left[1] - right[1]) <= epsilon &&
+ Math.abs(left[2] - right[2]) <= epsilon &&
+ Math.abs(left[3] - right[3]) <= epsilon &&
+ Math.abs(left[4] - right[4]) <= epsilon &&
+ Math.abs(left[5] - right[5]) <= epsilon &&
+ Math.abs(left[6] - right[6]) <= epsilon &&
+ Math.abs(left[7] - right[7]) <= epsilon &&
+ Math.abs(left[8] - right[8]) <= epsilon)
+ );
+ };
+
+ /**
+ * An immutable Matrix3 instance initialized to the identity matrix.
+ *
+ * @type {Matrix3}
+ * @constant
+ */
+ Matrix3.IDENTITY = Object.freeze(
+ new Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)
+ );
+
+ /**
+ * An immutable Matrix3 instance initialized to the zero matrix.
+ *
+ * @type {Matrix3}
+ * @constant
+ */
+ Matrix3.ZERO = Object.freeze(
+ new Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
+ );
+
+ /**
+ * The index into Matrix3 for column 0, row 0.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix3.COLUMN0ROW0 = 0;
+
+ /**
+ * The index into Matrix3 for column 0, row 1.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix3.COLUMN0ROW1 = 1;
+
+ /**
+ * The index into Matrix3 for column 0, row 2.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix3.COLUMN0ROW2 = 2;
+
+ /**
+ * The index into Matrix3 for column 1, row 0.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix3.COLUMN1ROW0 = 3;
+
+ /**
+ * The index into Matrix3 for column 1, row 1.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix3.COLUMN1ROW1 = 4;
+
+ /**
+ * The index into Matrix3 for column 1, row 2.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix3.COLUMN1ROW2 = 5;
+
+ /**
+ * The index into Matrix3 for column 2, row 0.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix3.COLUMN2ROW0 = 6;
+
+ /**
+ * The index into Matrix3 for column 2, row 1.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix3.COLUMN2ROW1 = 7;
+
+ /**
+ * The index into Matrix3 for column 2, row 2.
+ *
+ * @type {Number}
+ * @constant
+ */
+ Matrix3.COLUMN2ROW2 = 8;
+
+ Object.defineProperties(Matrix3.prototype, {
+ /**
+ * Gets the number of items in the collection.
+ * @memberof Matrix3.prototype
+ *
+ * @type {Number}
+ */
+ length: {
+ get: function () {
+ return Matrix3.packedLength;
+ },
+ },
+ });
+
+ /**
+ * Duplicates the provided Matrix3 instance.
+ *
+ * @param {Matrix3} [result] The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.
+ */
+ Matrix3.prototype.clone = function (result) {
+ return Matrix3.clone(this, result);
+ };
+
+ /**
+ * Compares this matrix to the provided matrix componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Matrix3} [right] The right hand side matrix.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ Matrix3.prototype.equals = function (right) {
+ return Matrix3.equals(this, right);
+ };
+
+ /**
+ * @private
+ */
+ Matrix3.equalsArray = function (matrix, array, offset) {
+ return (
+ matrix[0] === array[offset] &&
+ matrix[1] === array[offset + 1] &&
+ matrix[2] === array[offset + 2] &&
+ matrix[3] === array[offset + 3] &&
+ matrix[4] === array[offset + 4] &&
+ matrix[5] === array[offset + 5] &&
+ matrix[6] === array[offset + 6] &&
+ matrix[7] === array[offset + 7] &&
+ matrix[8] === array[offset + 8]
+ );
+ };
+
+ /**
+ * Compares this matrix to the provided matrix componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Matrix3} [right] The right hand side matrix.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.
+ */
+ Matrix3.prototype.equalsEpsilon = function (right, epsilon) {
+ return Matrix3.equalsEpsilon(this, right, epsilon);
+ };
+
+ /**
+ * Creates a string representing this Matrix with each row being
+ * on a separate line and in the format '(column0, column1, column2)'.
+ *
+ * @returns {String} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.
+ */
+ Matrix3.prototype.toString = function () {
+ return (
+ `(${this[0]}, ${this[3]}, ${this[6]})\n` +
+ `(${this[1]}, ${this[4]}, ${this[7]})\n` +
+ `(${this[2]}, ${this[5]}, ${this[8]})`
+ );
+ };
+
+ exports.Cartesian3 = Cartesian3;
+ exports.Cartographic = Cartographic;
+ exports.Ellipsoid = Ellipsoid;
+ exports.Matrix3 = Matrix3;
+
+}));
+//# sourceMappingURL=Matrix3-f22b0303.js.map
diff --git a/examples/cesium/Workers/Matrix3-f22b0303.js.map b/examples/cesium/Workers/Matrix3-f22b0303.js.map
new file mode 100644
index 0000000..d7973ea
--- /dev/null
+++ b/examples/cesium/Workers/Matrix3-f22b0303.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Matrix3-f22b0303.js","sources":["../../../Source/Core/Cartesian3.js","../../../Source/Core/scaleToGeodeticSurface.js","../../../Source/Core/Cartographic.js","../../../Source/Core/Ellipsoid.js","../../../Source/Core/Matrix3.js"],"sourcesContent":["import Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\n/**\r\n * A 3D Cartesian point.\r\n * @alias Cartesian3\r\n * @constructor\r\n *\r\n * @param {Number} [x=0.0] The X component.\r\n * @param {Number} [y=0.0] The Y component.\r\n * @param {Number} [z=0.0] The Z component.\r\n *\r\n * @see Cartesian2\r\n * @see Cartesian4\r\n * @see Packable\r\n */\r\nfunction Cartesian3(x, y, z) {\r\n /**\r\n * The X component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.x = defaultValue(x, 0.0);\r\n\r\n /**\r\n * The Y component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.y = defaultValue(y, 0.0);\r\n\r\n /**\r\n * The Z component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.z = defaultValue(z, 0.0);\r\n}\r\n\r\n/**\r\n * Converts the provided Spherical into Cartesian3 coordinates.\r\n *\r\n * @param {Spherical} spherical The Spherical to be converted to Cartesian3.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\r\n */\r\nCartesian3.fromSpherical = function (spherical, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"spherical\", spherical);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n const clock = spherical.clock;\r\n const cone = spherical.cone;\r\n const magnitude = defaultValue(spherical.magnitude, 1.0);\r\n const radial = magnitude * Math.sin(cone);\r\n result.x = radial * Math.cos(clock);\r\n result.y = radial * Math.sin(clock);\r\n result.z = magnitude * Math.cos(cone);\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Cartesian3 instance from x, y and z coordinates.\r\n *\r\n * @param {Number} x The x coordinate.\r\n * @param {Number} y The y coordinate.\r\n * @param {Number} z The z coordinate.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\r\n */\r\nCartesian3.fromElements = function (x, y, z, result) {\r\n if (!defined(result)) {\r\n return new Cartesian3(x, y, z);\r\n }\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a Cartesian3 instance.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian to duplicate.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided. (Returns undefined if cartesian is undefined)\r\n */\r\nCartesian3.clone = function (cartesian, result) {\r\n if (!defined(cartesian)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n return new Cartesian3(cartesian.x, cartesian.y, cartesian.z);\r\n }\r\n\r\n result.x = cartesian.x;\r\n result.y = cartesian.y;\r\n result.z = cartesian.z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Cartesian3 instance from an existing Cartesian4. This simply takes the\r\n * x, y, and z properties of the Cartesian4 and drops w.\r\n * @function\r\n *\r\n * @param {Cartesian4} cartesian The Cartesian4 instance to create a Cartesian3 instance from.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\r\n */\r\nCartesian3.fromCartesian4 = Cartesian3.clone;\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nCartesian3.packedLength = 3;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {Cartesian3} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCartesian3.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value.x;\r\n array[startingIndex++] = value.y;\r\n array[startingIndex] = value.z;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {Cartesian3} [result] The object into which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\r\n */\r\nCartesian3.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n result.x = array[startingIndex++];\r\n result.y = array[startingIndex++];\r\n result.z = array[startingIndex];\r\n return result;\r\n};\r\n\r\n/**\r\n * Flattens an array of Cartesian3s into an array of components.\r\n *\r\n * @param {Cartesian3[]} array The array of cartesians to pack.\r\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 3 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 3) elements.\r\n * @returns {Number[]} The packed array.\r\n */\r\nCartesian3.packArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n const resultLength = length * 3;\r\n if (!defined(result)) {\r\n result = new Array(resultLength);\r\n } else if (!Array.isArray(result) && result.length !== resultLength) {\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(\r\n \"If result is a typed array, it must have exactly array.length * 3 elements\"\r\n );\r\n //>>includeEnd('debug');\r\n } else if (result.length !== resultLength) {\r\n result.length = resultLength;\r\n }\r\n\r\n for (let i = 0; i < length; ++i) {\r\n Cartesian3.pack(array[i], result, i * 3);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Unpacks an array of cartesian components into an array of Cartesian3s.\r\n *\r\n * @param {Number[]} array The array of components to unpack.\r\n * @param {Cartesian3[]} [result] The array onto which to store the result.\r\n * @returns {Cartesian3[]} The unpacked array.\r\n */\r\nCartesian3.unpackArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 3);\r\n if (array.length % 3 !== 0) {\r\n throw new DeveloperError(\"array length must be a multiple of 3.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n if (!defined(result)) {\r\n result = new Array(length / 3);\r\n } else {\r\n result.length = length / 3;\r\n }\r\n\r\n for (let i = 0; i < length; i += 3) {\r\n const index = i / 3;\r\n result[index] = Cartesian3.unpack(array, i, result[index]);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Cartesian3 from three consecutive elements in an array.\r\n * @function\r\n *\r\n * @param {Number[]} array The array whose three consecutive elements correspond to the x, y, and z components, respectively.\r\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to the x component.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\r\n *\r\n * @example\r\n * // Create a Cartesian3 with (1.0, 2.0, 3.0)\r\n * const v = [1.0, 2.0, 3.0];\r\n * const p = Cesium.Cartesian3.fromArray(v);\r\n *\r\n * // Create a Cartesian3 with (1.0, 2.0, 3.0) using an offset into an array\r\n * const v2 = [0.0, 0.0, 1.0, 2.0, 3.0];\r\n * const p2 = Cesium.Cartesian3.fromArray(v2, 2);\r\n */\r\nCartesian3.fromArray = Cartesian3.unpack;\r\n\r\n/**\r\n * Computes the value of the maximum component for the supplied Cartesian.\r\n *\r\n * @param {Cartesian3} cartesian The cartesian to use.\r\n * @returns {Number} The value of the maximum component.\r\n */\r\nCartesian3.maximumComponent = function (cartesian) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n return Math.max(cartesian.x, cartesian.y, cartesian.z);\r\n};\r\n\r\n/**\r\n * Computes the value of the minimum component for the supplied Cartesian.\r\n *\r\n * @param {Cartesian3} cartesian The cartesian to use.\r\n * @returns {Number} The value of the minimum component.\r\n */\r\nCartesian3.minimumComponent = function (cartesian) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n return Math.min(cartesian.x, cartesian.y, cartesian.z);\r\n};\r\n\r\n/**\r\n * Compares two Cartesians and computes a Cartesian which contains the minimum components of the supplied Cartesians.\r\n *\r\n * @param {Cartesian3} first A cartesian to compare.\r\n * @param {Cartesian3} second A cartesian to compare.\r\n * @param {Cartesian3} result The object into which to store the result.\r\n * @returns {Cartesian3} A cartesian with the minimum components.\r\n */\r\nCartesian3.minimumByComponent = function (first, second, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"first\", first);\r\n Check.typeOf.object(\"second\", second);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Math.min(first.x, second.x);\r\n result.y = Math.min(first.y, second.y);\r\n result.z = Math.min(first.z, second.z);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares two Cartesians and computes a Cartesian which contains the maximum components of the supplied Cartesians.\r\n *\r\n * @param {Cartesian3} first A cartesian to compare.\r\n * @param {Cartesian3} second A cartesian to compare.\r\n * @param {Cartesian3} result The object into which to store the result.\r\n * @returns {Cartesian3} A cartesian with the maximum components.\r\n */\r\nCartesian3.maximumByComponent = function (first, second, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"first\", first);\r\n Check.typeOf.object(\"second\", second);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Math.max(first.x, second.x);\r\n result.y = Math.max(first.y, second.y);\r\n result.z = Math.max(first.z, second.z);\r\n return result;\r\n};\r\n\r\n/**\r\n * Constrain a value to lie between two values.\r\n *\r\n * @param {Cartesian3} cartesian The value to clamp.\r\n * @param {Cartesian3} min The minimum bound.\r\n * @param {Cartesian3} max The maximum bound.\r\n * @param {Cartesian3} result The object into which to store the result.\r\n * @returns {Cartesian3} The clamped value such that min <= value <= max.\r\n */\r\nCartesian3.clamp = function (value, min, max, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.typeOf.object(\"min\", min);\r\n Check.typeOf.object(\"max\", max);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const x = CesiumMath.clamp(value.x, min.x, max.x);\r\n const y = CesiumMath.clamp(value.y, min.y, max.y);\r\n const z = CesiumMath.clamp(value.z, min.z, max.z);\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the provided Cartesian's squared magnitude.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian instance whose squared magnitude is to be computed.\r\n * @returns {Number} The squared magnitude.\r\n */\r\nCartesian3.magnitudeSquared = function (cartesian) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n return (\r\n cartesian.x * cartesian.x +\r\n cartesian.y * cartesian.y +\r\n cartesian.z * cartesian.z\r\n );\r\n};\r\n\r\n/**\r\n * Computes the Cartesian's magnitude (length).\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian instance whose magnitude is to be computed.\r\n * @returns {Number} The magnitude.\r\n */\r\nCartesian3.magnitude = function (cartesian) {\r\n return Math.sqrt(Cartesian3.magnitudeSquared(cartesian));\r\n};\r\n\r\nconst distanceScratch = new Cartesian3();\r\n\r\n/**\r\n * Computes the distance between two points.\r\n *\r\n * @param {Cartesian3} left The first point to compute the distance from.\r\n * @param {Cartesian3} right The second point to compute the distance to.\r\n * @returns {Number} The distance between two points.\r\n *\r\n * @example\r\n * // Returns 1.0\r\n * const d = Cesium.Cartesian3.distance(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(2.0, 0.0, 0.0));\r\n */\r\nCartesian3.distance = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian3.subtract(left, right, distanceScratch);\r\n return Cartesian3.magnitude(distanceScratch);\r\n};\r\n\r\n/**\r\n * Computes the squared distance between two points. Comparing squared distances\r\n * using this function is more efficient than comparing distances using {@link Cartesian3#distance}.\r\n *\r\n * @param {Cartesian3} left The first point to compute the distance from.\r\n * @param {Cartesian3} right The second point to compute the distance to.\r\n * @returns {Number} The distance between two points.\r\n *\r\n * @example\r\n * // Returns 4.0, not 2.0\r\n * const d = Cesium.Cartesian3.distanceSquared(new Cesium.Cartesian3(1.0, 0.0, 0.0), new Cesium.Cartesian3(3.0, 0.0, 0.0));\r\n */\r\nCartesian3.distanceSquared = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian3.subtract(left, right, distanceScratch);\r\n return Cartesian3.magnitudeSquared(distanceScratch);\r\n};\r\n\r\n/**\r\n * Computes the normalized form of the supplied Cartesian.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian to be normalized.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nCartesian3.normalize = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const magnitude = Cartesian3.magnitude(cartesian);\r\n\r\n result.x = cartesian.x / magnitude;\r\n result.y = cartesian.y / magnitude;\r\n result.z = cartesian.z / magnitude;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (isNaN(result.x) || isNaN(result.y) || isNaN(result.z)) {\r\n throw new DeveloperError(\"normalized result is not a number\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the dot (scalar) product of two Cartesians.\r\n *\r\n * @param {Cartesian3} left The first Cartesian.\r\n * @param {Cartesian3} right The second Cartesian.\r\n * @returns {Number} The dot product.\r\n */\r\nCartesian3.dot = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n return left.x * right.x + left.y * right.y + left.z * right.z;\r\n};\r\n\r\n/**\r\n * Computes the componentwise product of two Cartesians.\r\n *\r\n * @param {Cartesian3} left The first Cartesian.\r\n * @param {Cartesian3} right The second Cartesian.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nCartesian3.multiplyComponents = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x * right.x;\r\n result.y = left.y * right.y;\r\n result.z = left.z * right.z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise quotient of two Cartesians.\r\n *\r\n * @param {Cartesian3} left The first Cartesian.\r\n * @param {Cartesian3} right The second Cartesian.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nCartesian3.divideComponents = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x / right.x;\r\n result.y = left.y / right.y;\r\n result.z = left.z / right.z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise sum of two Cartesians.\r\n *\r\n * @param {Cartesian3} left The first Cartesian.\r\n * @param {Cartesian3} right The second Cartesian.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nCartesian3.add = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x + right.x;\r\n result.y = left.y + right.y;\r\n result.z = left.z + right.z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise difference of two Cartesians.\r\n *\r\n * @param {Cartesian3} left The first Cartesian.\r\n * @param {Cartesian3} right The second Cartesian.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nCartesian3.subtract = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x - right.x;\r\n result.y = left.y - right.y;\r\n result.z = left.z - right.z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Multiplies the provided Cartesian componentwise by the provided scalar.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian to be scaled.\r\n * @param {Number} scalar The scalar to multiply with.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nCartesian3.multiplyByScalar = function (cartesian, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = cartesian.x * scalar;\r\n result.y = cartesian.y * scalar;\r\n result.z = cartesian.z * scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Divides the provided Cartesian componentwise by the provided scalar.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian to be divided.\r\n * @param {Number} scalar The scalar to divide by.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nCartesian3.divideByScalar = function (cartesian, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = cartesian.x / scalar;\r\n result.y = cartesian.y / scalar;\r\n result.z = cartesian.z / scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Negates the provided Cartesian.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian to be negated.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nCartesian3.negate = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = -cartesian.x;\r\n result.y = -cartesian.y;\r\n result.z = -cartesian.z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the absolute value of the provided Cartesian.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian whose absolute value is to be computed.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nCartesian3.abs = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Math.abs(cartesian.x);\r\n result.y = Math.abs(cartesian.y);\r\n result.z = Math.abs(cartesian.z);\r\n return result;\r\n};\r\n\r\nconst lerpScratch = new Cartesian3();\r\n/**\r\n * Computes the linear interpolation or extrapolation at t using the provided cartesians.\r\n *\r\n * @param {Cartesian3} start The value corresponding to t at 0.0.\r\n * @param {Cartesian3} end The value corresponding to t at 1.0.\r\n * @param {Number} t The point along t at which to interpolate.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nCartesian3.lerp = function (start, end, t, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"start\", start);\r\n Check.typeOf.object(\"end\", end);\r\n Check.typeOf.number(\"t\", t);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian3.multiplyByScalar(end, t, lerpScratch);\r\n result = Cartesian3.multiplyByScalar(start, 1.0 - t, result);\r\n return Cartesian3.add(lerpScratch, result, result);\r\n};\r\n\r\nconst angleBetweenScratch = new Cartesian3();\r\nconst angleBetweenScratch2 = new Cartesian3();\r\n/**\r\n * Returns the angle, in radians, between the provided Cartesians.\r\n *\r\n * @param {Cartesian3} left The first Cartesian.\r\n * @param {Cartesian3} right The second Cartesian.\r\n * @returns {Number} The angle between the Cartesians.\r\n */\r\nCartesian3.angleBetween = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n Cartesian3.normalize(left, angleBetweenScratch);\r\n Cartesian3.normalize(right, angleBetweenScratch2);\r\n const cosine = Cartesian3.dot(angleBetweenScratch, angleBetweenScratch2);\r\n const sine = Cartesian3.magnitude(\r\n Cartesian3.cross(\r\n angleBetweenScratch,\r\n angleBetweenScratch2,\r\n angleBetweenScratch\r\n )\r\n );\r\n return Math.atan2(sine, cosine);\r\n};\r\n\r\nconst mostOrthogonalAxisScratch = new Cartesian3();\r\n/**\r\n * Returns the axis that is most orthogonal to the provided Cartesian.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian on which to find the most orthogonal axis.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The most orthogonal axis.\r\n */\r\nCartesian3.mostOrthogonalAxis = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const f = Cartesian3.normalize(cartesian, mostOrthogonalAxisScratch);\r\n Cartesian3.abs(f, f);\r\n\r\n if (f.x <= f.y) {\r\n if (f.x <= f.z) {\r\n result = Cartesian3.clone(Cartesian3.UNIT_X, result);\r\n } else {\r\n result = Cartesian3.clone(Cartesian3.UNIT_Z, result);\r\n }\r\n } else if (f.y <= f.z) {\r\n result = Cartesian3.clone(Cartesian3.UNIT_Y, result);\r\n } else {\r\n result = Cartesian3.clone(Cartesian3.UNIT_Z, result);\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Projects vector a onto vector b\r\n * @param {Cartesian3} a The vector that needs projecting\r\n * @param {Cartesian3} b The vector to project onto\r\n * @param {Cartesian3} result The result cartesian\r\n * @returns {Cartesian3} The modified result parameter\r\n */\r\nCartesian3.projectVector = function (a, b, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"a\", a);\r\n Check.defined(\"b\", b);\r\n Check.defined(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const scalar = Cartesian3.dot(a, b) / Cartesian3.dot(b, b);\r\n return Cartesian3.multiplyByScalar(b, scalar, result);\r\n};\r\n\r\n/**\r\n * Compares the provided Cartesians componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Cartesian3} [left] The first Cartesian.\r\n * @param {Cartesian3} [right] The second Cartesian.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nCartesian3.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left.x === right.x &&\r\n left.y === right.y &&\r\n left.z === right.z)\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nCartesian3.equalsArray = function (cartesian, array, offset) {\r\n return (\r\n cartesian.x === array[offset] &&\r\n cartesian.y === array[offset + 1] &&\r\n cartesian.z === array[offset + 2]\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided Cartesians componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {Cartesian3} [left] The first Cartesian.\r\n * @param {Cartesian3} [right] The second Cartesian.\r\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nCartesian3.equalsEpsilon = function (\r\n left,\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n CesiumMath.equalsEpsilon(\r\n left.x,\r\n right.x,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n left.y,\r\n right.y,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n left.z,\r\n right.z,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ))\r\n );\r\n};\r\n\r\n/**\r\n * Computes the cross (outer) product of two Cartesians.\r\n *\r\n * @param {Cartesian3} left The first Cartesian.\r\n * @param {Cartesian3} right The second Cartesian.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The cross product.\r\n */\r\nCartesian3.cross = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const leftX = left.x;\r\n const leftY = left.y;\r\n const leftZ = left.z;\r\n const rightX = right.x;\r\n const rightY = right.y;\r\n const rightZ = right.z;\r\n\r\n const x = leftY * rightZ - leftZ * rightY;\r\n const y = leftZ * rightX - leftX * rightZ;\r\n const z = leftX * rightY - leftY * rightX;\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the midpoint between the right and left Cartesian.\r\n * @param {Cartesian3} left The first Cartesian.\r\n * @param {Cartesian3} right The second Cartesian.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The midpoint.\r\n */\r\nCartesian3.midpoint = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = (left.x + right.x) * 0.5;\r\n result.y = (left.y + right.y) * 0.5;\r\n result.z = (left.z + right.z) * 0.5;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns a Cartesian3 position from longitude and latitude values given in degrees.\r\n *\r\n * @param {Number} longitude The longitude, in degrees\r\n * @param {Number} latitude The latitude, in degrees\r\n * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The position\r\n *\r\n * @example\r\n * const position = Cesium.Cartesian3.fromDegrees(-115.0, 37.0);\r\n */\r\nCartesian3.fromDegrees = function (\r\n longitude,\r\n latitude,\r\n height,\r\n ellipsoid,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"longitude\", longitude);\r\n Check.typeOf.number(\"latitude\", latitude);\r\n //>>includeEnd('debug');\r\n\r\n longitude = CesiumMath.toRadians(longitude);\r\n latitude = CesiumMath.toRadians(latitude);\r\n return Cartesian3.fromRadians(longitude, latitude, height, ellipsoid, result);\r\n};\r\n\r\nlet scratchN = new Cartesian3();\r\nlet scratchK = new Cartesian3();\r\nconst wgs84RadiiSquared = new Cartesian3(\r\n 6378137.0 * 6378137.0,\r\n 6378137.0 * 6378137.0,\r\n 6356752.3142451793 * 6356752.3142451793\r\n);\r\n\r\n/**\r\n * Returns a Cartesian3 position from longitude and latitude values given in radians.\r\n *\r\n * @param {Number} longitude The longitude, in radians\r\n * @param {Number} latitude The latitude, in radians\r\n * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The position\r\n *\r\n * @example\r\n * const position = Cesium.Cartesian3.fromRadians(-2.007, 0.645);\r\n */\r\nCartesian3.fromRadians = function (\r\n longitude,\r\n latitude,\r\n height,\r\n ellipsoid,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"longitude\", longitude);\r\n Check.typeOf.number(\"latitude\", latitude);\r\n //>>includeEnd('debug');\r\n\r\n height = defaultValue(height, 0.0);\r\n const radiiSquared = defined(ellipsoid)\r\n ? ellipsoid.radiiSquared\r\n : wgs84RadiiSquared;\r\n\r\n const cosLatitude = Math.cos(latitude);\r\n scratchN.x = cosLatitude * Math.cos(longitude);\r\n scratchN.y = cosLatitude * Math.sin(longitude);\r\n scratchN.z = Math.sin(latitude);\r\n scratchN = Cartesian3.normalize(scratchN, scratchN);\r\n\r\n Cartesian3.multiplyComponents(radiiSquared, scratchN, scratchK);\r\n const gamma = Math.sqrt(Cartesian3.dot(scratchN, scratchK));\r\n scratchK = Cartesian3.divideByScalar(scratchK, gamma, scratchK);\r\n scratchN = Cartesian3.multiplyByScalar(scratchN, height, scratchN);\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n return Cartesian3.add(scratchK, scratchN, result);\r\n};\r\n\r\n/**\r\n * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in degrees.\r\n *\r\n * @param {Number[]} coordinates A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the coordinates lie.\r\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\r\n * @returns {Cartesian3[]} The array of positions.\r\n *\r\n * @example\r\n * const positions = Cesium.Cartesian3.fromDegreesArray([-115.0, 37.0, -107.0, 33.0]);\r\n */\r\nCartesian3.fromDegreesArray = function (coordinates, ellipsoid, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"coordinates\", coordinates);\r\n if (coordinates.length < 2 || coordinates.length % 2 !== 0) {\r\n throw new DeveloperError(\r\n \"the number of coordinates must be a multiple of 2 and at least 2\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = coordinates.length;\r\n if (!defined(result)) {\r\n result = new Array(length / 2);\r\n } else {\r\n result.length = length / 2;\r\n }\r\n\r\n for (let i = 0; i < length; i += 2) {\r\n const longitude = coordinates[i];\r\n const latitude = coordinates[i + 1];\r\n const index = i / 2;\r\n result[index] = Cartesian3.fromDegrees(\r\n longitude,\r\n latitude,\r\n 0,\r\n ellipsoid,\r\n result[index]\r\n );\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns an array of Cartesian3 positions given an array of longitude and latitude values given in radians.\r\n *\r\n * @param {Number[]} coordinates A list of longitude and latitude values. Values alternate [longitude, latitude, longitude, latitude...].\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the coordinates lie.\r\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\r\n * @returns {Cartesian3[]} The array of positions.\r\n *\r\n * @example\r\n * const positions = Cesium.Cartesian3.fromRadiansArray([-2.007, 0.645, -1.867, .575]);\r\n */\r\nCartesian3.fromRadiansArray = function (coordinates, ellipsoid, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"coordinates\", coordinates);\r\n if (coordinates.length < 2 || coordinates.length % 2 !== 0) {\r\n throw new DeveloperError(\r\n \"the number of coordinates must be a multiple of 2 and at least 2\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = coordinates.length;\r\n if (!defined(result)) {\r\n result = new Array(length / 2);\r\n } else {\r\n result.length = length / 2;\r\n }\r\n\r\n for (let i = 0; i < length; i += 2) {\r\n const longitude = coordinates[i];\r\n const latitude = coordinates[i + 1];\r\n const index = i / 2;\r\n result[index] = Cartesian3.fromRadians(\r\n longitude,\r\n latitude,\r\n 0,\r\n ellipsoid,\r\n result[index]\r\n );\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in degrees.\r\n *\r\n * @param {Number[]} coordinates A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\r\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\r\n * @returns {Cartesian3[]} The array of positions.\r\n *\r\n * @example\r\n * const positions = Cesium.Cartesian3.fromDegreesArrayHeights([-115.0, 37.0, 100000.0, -107.0, 33.0, 150000.0]);\r\n */\r\nCartesian3.fromDegreesArrayHeights = function (coordinates, ellipsoid, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"coordinates\", coordinates);\r\n if (coordinates.length < 3 || coordinates.length % 3 !== 0) {\r\n throw new DeveloperError(\r\n \"the number of coordinates must be a multiple of 3 and at least 3\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = coordinates.length;\r\n if (!defined(result)) {\r\n result = new Array(length / 3);\r\n } else {\r\n result.length = length / 3;\r\n }\r\n\r\n for (let i = 0; i < length; i += 3) {\r\n const longitude = coordinates[i];\r\n const latitude = coordinates[i + 1];\r\n const height = coordinates[i + 2];\r\n const index = i / 3;\r\n result[index] = Cartesian3.fromDegrees(\r\n longitude,\r\n latitude,\r\n height,\r\n ellipsoid,\r\n result[index]\r\n );\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns an array of Cartesian3 positions given an array of longitude, latitude and height values where longitude and latitude are given in radians.\r\n *\r\n * @param {Number[]} coordinates A list of longitude, latitude and height values. Values alternate [longitude, latitude, height, longitude, latitude, height...].\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\r\n * @param {Cartesian3[]} [result] An array of Cartesian3 objects to store the result.\r\n * @returns {Cartesian3[]} The array of positions.\r\n *\r\n * @example\r\n * const positions = Cesium.Cartesian3.fromRadiansArrayHeights([-2.007, 0.645, 100000.0, -1.867, .575, 150000.0]);\r\n */\r\nCartesian3.fromRadiansArrayHeights = function (coordinates, ellipsoid, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"coordinates\", coordinates);\r\n if (coordinates.length < 3 || coordinates.length % 3 !== 0) {\r\n throw new DeveloperError(\r\n \"the number of coordinates must be a multiple of 3 and at least 3\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = coordinates.length;\r\n if (!defined(result)) {\r\n result = new Array(length / 3);\r\n } else {\r\n result.length = length / 3;\r\n }\r\n\r\n for (let i = 0; i < length; i += 3) {\r\n const longitude = coordinates[i];\r\n const latitude = coordinates[i + 1];\r\n const height = coordinates[i + 2];\r\n const index = i / 3;\r\n result[index] = Cartesian3.fromRadians(\r\n longitude,\r\n latitude,\r\n height,\r\n ellipsoid,\r\n result[index]\r\n );\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * An immutable Cartesian3 instance initialized to (0.0, 0.0, 0.0).\r\n *\r\n * @type {Cartesian3}\r\n * @constant\r\n */\r\nCartesian3.ZERO = Object.freeze(new Cartesian3(0.0, 0.0, 0.0));\r\n\r\n/**\r\n * An immutable Cartesian3 instance initialized to (1.0, 1.0, 1.0).\r\n *\r\n * @type {Cartesian3}\r\n * @constant\r\n */\r\nCartesian3.ONE = Object.freeze(new Cartesian3(1.0, 1.0, 1.0));\r\n\r\n/**\r\n * An immutable Cartesian3 instance initialized to (1.0, 0.0, 0.0).\r\n *\r\n * @type {Cartesian3}\r\n * @constant\r\n */\r\nCartesian3.UNIT_X = Object.freeze(new Cartesian3(1.0, 0.0, 0.0));\r\n\r\n/**\r\n * An immutable Cartesian3 instance initialized to (0.0, 1.0, 0.0).\r\n *\r\n * @type {Cartesian3}\r\n * @constant\r\n */\r\nCartesian3.UNIT_Y = Object.freeze(new Cartesian3(0.0, 1.0, 0.0));\r\n\r\n/**\r\n * An immutable Cartesian3 instance initialized to (0.0, 0.0, 1.0).\r\n *\r\n * @type {Cartesian3}\r\n * @constant\r\n */\r\nCartesian3.UNIT_Z = Object.freeze(new Cartesian3(0.0, 0.0, 1.0));\r\n\r\n/**\r\n * Duplicates this Cartesian3 instance.\r\n *\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\r\n */\r\nCartesian3.prototype.clone = function (result) {\r\n return Cartesian3.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares this Cartesian against the provided Cartesian componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Cartesian3} [right] The right hand side Cartesian.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nCartesian3.prototype.equals = function (right) {\r\n return Cartesian3.equals(this, right);\r\n};\r\n\r\n/**\r\n * Compares this Cartesian against the provided Cartesian componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {Cartesian3} [right] The right hand side Cartesian.\r\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.\r\n */\r\nCartesian3.prototype.equalsEpsilon = function (\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n return Cartesian3.equalsEpsilon(\r\n this,\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n );\r\n};\r\n\r\n/**\r\n * Creates a string representing this Cartesian in the format '(x, y, z)'.\r\n *\r\n * @returns {String} A string representing this Cartesian in the format '(x, y, z)'.\r\n */\r\nCartesian3.prototype.toString = function () {\r\n return `(${this.x}, ${this.y}, ${this.z})`;\r\n};\r\nexport default Cartesian3;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\nconst scaleToGeodeticSurfaceIntersection = new Cartesian3();\r\nconst scaleToGeodeticSurfaceGradient = new Cartesian3();\r\n\r\n/**\r\n * Scales the provided Cartesian position along the geodetic surface normal\r\n * so that it is on the surface of this ellipsoid. If the position is\r\n * at the center of the ellipsoid, this function returns undefined.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian position to scale.\r\n * @param {Cartesian3} oneOverRadii One over radii of the ellipsoid.\r\n * @param {Cartesian3} oneOverRadiiSquared One over radii squared of the ellipsoid.\r\n * @param {Number} centerToleranceSquared Tolerance for closeness to the center.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\r\n *\r\n * @function scaleToGeodeticSurface\r\n *\r\n * @private\r\n */\r\nfunction scaleToGeodeticSurface(\r\n cartesian,\r\n oneOverRadii,\r\n oneOverRadiiSquared,\r\n centerToleranceSquared,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(cartesian)) {\r\n throw new DeveloperError(\"cartesian is required.\");\r\n }\r\n if (!defined(oneOverRadii)) {\r\n throw new DeveloperError(\"oneOverRadii is required.\");\r\n }\r\n if (!defined(oneOverRadiiSquared)) {\r\n throw new DeveloperError(\"oneOverRadiiSquared is required.\");\r\n }\r\n if (!defined(centerToleranceSquared)) {\r\n throw new DeveloperError(\"centerToleranceSquared is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const positionX = cartesian.x;\r\n const positionY = cartesian.y;\r\n const positionZ = cartesian.z;\r\n\r\n const oneOverRadiiX = oneOverRadii.x;\r\n const oneOverRadiiY = oneOverRadii.y;\r\n const oneOverRadiiZ = oneOverRadii.z;\r\n\r\n const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;\r\n const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;\r\n const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;\r\n\r\n // Compute the squared ellipsoid norm.\r\n const squaredNorm = x2 + y2 + z2;\r\n const ratio = Math.sqrt(1.0 / squaredNorm);\r\n\r\n // As an initial approximation, assume that the radial intersection is the projection point.\r\n const intersection = Cartesian3.multiplyByScalar(\r\n cartesian,\r\n ratio,\r\n scaleToGeodeticSurfaceIntersection\r\n );\r\n\r\n // If the position is near the center, the iteration will not converge.\r\n if (squaredNorm < centerToleranceSquared) {\r\n return !isFinite(ratio)\r\n ? undefined\r\n : Cartesian3.clone(intersection, result);\r\n }\r\n\r\n const oneOverRadiiSquaredX = oneOverRadiiSquared.x;\r\n const oneOverRadiiSquaredY = oneOverRadiiSquared.y;\r\n const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;\r\n\r\n // Use the gradient at the intersection point in place of the true unit normal.\r\n // The difference in magnitude will be absorbed in the multiplier.\r\n const gradient = scaleToGeodeticSurfaceGradient;\r\n gradient.x = intersection.x * oneOverRadiiSquaredX * 2.0;\r\n gradient.y = intersection.y * oneOverRadiiSquaredY * 2.0;\r\n gradient.z = intersection.z * oneOverRadiiSquaredZ * 2.0;\r\n\r\n // Compute the initial guess at the normal vector multiplier, lambda.\r\n let lambda =\r\n ((1.0 - ratio) * Cartesian3.magnitude(cartesian)) /\r\n (0.5 * Cartesian3.magnitude(gradient));\r\n let correction = 0.0;\r\n\r\n let func;\r\n let denominator;\r\n let xMultiplier;\r\n let yMultiplier;\r\n let zMultiplier;\r\n let xMultiplier2;\r\n let yMultiplier2;\r\n let zMultiplier2;\r\n let xMultiplier3;\r\n let yMultiplier3;\r\n let zMultiplier3;\r\n\r\n do {\r\n lambda -= correction;\r\n\r\n xMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredX);\r\n yMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredY);\r\n zMultiplier = 1.0 / (1.0 + lambda * oneOverRadiiSquaredZ);\r\n\r\n xMultiplier2 = xMultiplier * xMultiplier;\r\n yMultiplier2 = yMultiplier * yMultiplier;\r\n zMultiplier2 = zMultiplier * zMultiplier;\r\n\r\n xMultiplier3 = xMultiplier2 * xMultiplier;\r\n yMultiplier3 = yMultiplier2 * yMultiplier;\r\n zMultiplier3 = zMultiplier2 * zMultiplier;\r\n\r\n func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1.0;\r\n\r\n // \"denominator\" here refers to the use of this expression in the velocity and acceleration\r\n // computations in the sections to follow.\r\n denominator =\r\n x2 * xMultiplier3 * oneOverRadiiSquaredX +\r\n y2 * yMultiplier3 * oneOverRadiiSquaredY +\r\n z2 * zMultiplier3 * oneOverRadiiSquaredZ;\r\n\r\n const derivative = -2.0 * denominator;\r\n\r\n correction = func / derivative;\r\n } while (Math.abs(func) > CesiumMath.EPSILON12);\r\n\r\n if (!defined(result)) {\r\n return new Cartesian3(\r\n positionX * xMultiplier,\r\n positionY * yMultiplier,\r\n positionZ * zMultiplier\r\n );\r\n }\r\n result.x = positionX * xMultiplier;\r\n result.y = positionY * yMultiplier;\r\n result.z = positionZ * zMultiplier;\r\n return result;\r\n}\r\nexport default scaleToGeodeticSurface;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport scaleToGeodeticSurface from \"./scaleToGeodeticSurface.js\";\r\n\r\n/**\r\n * A position defined by longitude, latitude, and height.\r\n * @alias Cartographic\r\n * @constructor\r\n *\r\n * @param {Number} [longitude=0.0] The longitude, in radians.\r\n * @param {Number} [latitude=0.0] The latitude, in radians.\r\n * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.\r\n *\r\n * @see Ellipsoid\r\n */\r\nfunction Cartographic(longitude, latitude, height) {\r\n /**\r\n * The longitude, in radians.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.longitude = defaultValue(longitude, 0.0);\r\n\r\n /**\r\n * The latitude, in radians.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.latitude = defaultValue(latitude, 0.0);\r\n\r\n /**\r\n * The height, in meters, above the ellipsoid.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.height = defaultValue(height, 0.0);\r\n}\r\n\r\n/**\r\n * Creates a new Cartographic instance from longitude and latitude\r\n * specified in radians.\r\n *\r\n * @param {Number} longitude The longitude, in radians.\r\n * @param {Number} latitude The latitude, in radians.\r\n * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\r\n */\r\nCartographic.fromRadians = function (longitude, latitude, height, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"longitude\", longitude);\r\n Check.typeOf.number(\"latitude\", latitude);\r\n //>>includeEnd('debug');\r\n\r\n height = defaultValue(height, 0.0);\r\n\r\n if (!defined(result)) {\r\n return new Cartographic(longitude, latitude, height);\r\n }\r\n\r\n result.longitude = longitude;\r\n result.latitude = latitude;\r\n result.height = height;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a new Cartographic instance from longitude and latitude\r\n * specified in degrees. The values in the resulting object will\r\n * be in radians.\r\n *\r\n * @param {Number} longitude The longitude, in degrees.\r\n * @param {Number} latitude The latitude, in degrees.\r\n * @param {Number} [height=0.0] The height, in meters, above the ellipsoid.\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\r\n */\r\nCartographic.fromDegrees = function (longitude, latitude, height, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"longitude\", longitude);\r\n Check.typeOf.number(\"latitude\", latitude);\r\n //>>includeEnd('debug');\r\n longitude = CesiumMath.toRadians(longitude);\r\n latitude = CesiumMath.toRadians(latitude);\r\n\r\n return Cartographic.fromRadians(longitude, latitude, height, result);\r\n};\r\n\r\nconst cartesianToCartographicN = new Cartesian3();\r\nconst cartesianToCartographicP = new Cartesian3();\r\nconst cartesianToCartographicH = new Cartesian3();\r\nconst wgs84OneOverRadii = new Cartesian3(\r\n 1.0 / 6378137.0,\r\n 1.0 / 6378137.0,\r\n 1.0 / 6356752.3142451793\r\n);\r\nconst wgs84OneOverRadiiSquared = new Cartesian3(\r\n 1.0 / (6378137.0 * 6378137.0),\r\n 1.0 / (6378137.0 * 6378137.0),\r\n 1.0 / (6356752.3142451793 * 6356752.3142451793)\r\n);\r\nconst wgs84CenterToleranceSquared = CesiumMath.EPSILON1;\r\n\r\n/**\r\n * Creates a new Cartographic instance from a Cartesian position. The values in the\r\n * resulting object will be in radians.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\r\n */\r\nCartographic.fromCartesian = function (cartesian, ellipsoid, result) {\r\n const oneOverRadii = defined(ellipsoid)\r\n ? ellipsoid.oneOverRadii\r\n : wgs84OneOverRadii;\r\n const oneOverRadiiSquared = defined(ellipsoid)\r\n ? ellipsoid.oneOverRadiiSquared\r\n : wgs84OneOverRadiiSquared;\r\n const centerToleranceSquared = defined(ellipsoid)\r\n ? ellipsoid._centerToleranceSquared\r\n : wgs84CenterToleranceSquared;\r\n\r\n //`cartesian is required.` is thrown from scaleToGeodeticSurface\r\n const p = scaleToGeodeticSurface(\r\n cartesian,\r\n oneOverRadii,\r\n oneOverRadiiSquared,\r\n centerToleranceSquared,\r\n cartesianToCartographicP\r\n );\r\n\r\n if (!defined(p)) {\r\n return undefined;\r\n }\r\n\r\n let n = Cartesian3.multiplyComponents(\r\n p,\r\n oneOverRadiiSquared,\r\n cartesianToCartographicN\r\n );\r\n n = Cartesian3.normalize(n, n);\r\n\r\n const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);\r\n\r\n const longitude = Math.atan2(n.y, n.x);\r\n const latitude = Math.asin(n.z);\r\n const height =\r\n CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);\r\n\r\n if (!defined(result)) {\r\n return new Cartographic(longitude, latitude, height);\r\n }\r\n result.longitude = longitude;\r\n result.latitude = latitude;\r\n result.height = height;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a new Cartesian3 instance from a Cartographic input. The values in the inputted\r\n * object should be in radians.\r\n *\r\n * @param {Cartographic} cartographic Input to be converted into a Cartesian3 output.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the position lies.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The position\r\n */\r\nCartographic.toCartesian = function (cartographic, ellipsoid, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartographic\", cartographic);\r\n //>>includeEnd('debug');\r\n\r\n return Cartesian3.fromRadians(\r\n cartographic.longitude,\r\n cartographic.latitude,\r\n cartographic.height,\r\n ellipsoid,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Duplicates a Cartographic instance.\r\n *\r\n * @param {Cartographic} cartographic The cartographic to duplicate.\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided. (Returns undefined if cartographic is undefined)\r\n */\r\nCartographic.clone = function (cartographic, result) {\r\n if (!defined(cartographic)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n return new Cartographic(\r\n cartographic.longitude,\r\n cartographic.latitude,\r\n cartographic.height\r\n );\r\n }\r\n result.longitude = cartographic.longitude;\r\n result.latitude = cartographic.latitude;\r\n result.height = cartographic.height;\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided cartographics componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Cartographic} [left] The first cartographic.\r\n * @param {Cartographic} [right] The second cartographic.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nCartographic.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left.longitude === right.longitude &&\r\n left.latitude === right.latitude &&\r\n left.height === right.height)\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided cartographics componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Cartographic} [left] The first cartographic.\r\n * @param {Cartographic} [right] The second cartographic.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nCartographic.equalsEpsilon = function (left, right, epsilon) {\r\n epsilon = defaultValue(epsilon, 0);\r\n\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n Math.abs(left.longitude - right.longitude) <= epsilon &&\r\n Math.abs(left.latitude - right.latitude) <= epsilon &&\r\n Math.abs(left.height - right.height) <= epsilon)\r\n );\r\n};\r\n\r\n/**\r\n * An immutable Cartographic instance initialized to (0.0, 0.0, 0.0).\r\n *\r\n * @type {Cartographic}\r\n * @constant\r\n */\r\nCartographic.ZERO = Object.freeze(new Cartographic(0.0, 0.0, 0.0));\r\n\r\n/**\r\n * Duplicates this instance.\r\n *\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter or a new Cartographic instance if one was not provided.\r\n */\r\nCartographic.prototype.clone = function (result) {\r\n return Cartographic.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares the provided against this cartographic componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Cartographic} [right] The second cartographic.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nCartographic.prototype.equals = function (right) {\r\n return Cartographic.equals(this, right);\r\n};\r\n\r\n/**\r\n * Compares the provided against this cartographic componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Cartographic} [right] The second cartographic.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nCartographic.prototype.equalsEpsilon = function (right, epsilon) {\r\n return Cartographic.equalsEpsilon(this, right, epsilon);\r\n};\r\n\r\n/**\r\n * Creates a string representing this cartographic in the format '(longitude, latitude, height)'.\r\n *\r\n * @returns {String} A string representing the provided cartographic in the format '(longitude, latitude, height)'.\r\n */\r\nCartographic.prototype.toString = function () {\r\n return `(${this.longitude}, ${this.latitude}, ${this.height})`;\r\n};\r\nexport default Cartographic;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport scaleToGeodeticSurface from \"./scaleToGeodeticSurface.js\";\r\n\r\nfunction initialize(ellipsoid, x, y, z) {\r\n x = defaultValue(x, 0.0);\r\n y = defaultValue(y, 0.0);\r\n z = defaultValue(z, 0.0);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.greaterThanOrEquals(\"x\", x, 0.0);\r\n Check.typeOf.number.greaterThanOrEquals(\"y\", y, 0.0);\r\n Check.typeOf.number.greaterThanOrEquals(\"z\", z, 0.0);\r\n //>>includeEnd('debug');\r\n\r\n ellipsoid._radii = new Cartesian3(x, y, z);\r\n\r\n ellipsoid._radiiSquared = new Cartesian3(x * x, y * y, z * z);\r\n\r\n ellipsoid._radiiToTheFourth = new Cartesian3(\r\n x * x * x * x,\r\n y * y * y * y,\r\n z * z * z * z\r\n );\r\n\r\n ellipsoid._oneOverRadii = new Cartesian3(\r\n x === 0.0 ? 0.0 : 1.0 / x,\r\n y === 0.0 ? 0.0 : 1.0 / y,\r\n z === 0.0 ? 0.0 : 1.0 / z\r\n );\r\n\r\n ellipsoid._oneOverRadiiSquared = new Cartesian3(\r\n x === 0.0 ? 0.0 : 1.0 / (x * x),\r\n y === 0.0 ? 0.0 : 1.0 / (y * y),\r\n z === 0.0 ? 0.0 : 1.0 / (z * z)\r\n );\r\n\r\n ellipsoid._minimumRadius = Math.min(x, y, z);\r\n\r\n ellipsoid._maximumRadius = Math.max(x, y, z);\r\n\r\n ellipsoid._centerToleranceSquared = CesiumMath.EPSILON1;\r\n\r\n if (ellipsoid._radiiSquared.z !== 0) {\r\n ellipsoid._squaredXOverSquaredZ =\r\n ellipsoid._radiiSquared.x / ellipsoid._radiiSquared.z;\r\n }\r\n}\r\n\r\n/**\r\n * A quadratic surface defined in Cartesian coordinates by the equation\r\n * (x / a)^2 + (y / b)^2 + (z / c)^2 = 1
. Primarily used\r\n * by Cesium to represent the shape of planetary bodies.\r\n *\r\n * Rather than constructing this object directly, one of the provided\r\n * constants is normally used.\r\n * @alias Ellipsoid\r\n * @constructor\r\n *\r\n * @param {Number} [x=0] The radius in the x direction.\r\n * @param {Number} [y=0] The radius in the y direction.\r\n * @param {Number} [z=0] The radius in the z direction.\r\n *\r\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\r\n *\r\n * @see Ellipsoid.fromCartesian3\r\n * @see Ellipsoid.WGS84\r\n * @see Ellipsoid.UNIT_SPHERE\r\n */\r\nfunction Ellipsoid(x, y, z) {\r\n this._radii = undefined;\r\n this._radiiSquared = undefined;\r\n this._radiiToTheFourth = undefined;\r\n this._oneOverRadii = undefined;\r\n this._oneOverRadiiSquared = undefined;\r\n this._minimumRadius = undefined;\r\n this._maximumRadius = undefined;\r\n this._centerToleranceSquared = undefined;\r\n this._squaredXOverSquaredZ = undefined;\r\n\r\n initialize(this, x, y, z);\r\n}\r\n\r\nObject.defineProperties(Ellipsoid.prototype, {\r\n /**\r\n * Gets the radii of the ellipsoid.\r\n * @memberof Ellipsoid.prototype\r\n * @type {Cartesian3}\r\n * @readonly\r\n */\r\n radii: {\r\n get: function () {\r\n return this._radii;\r\n },\r\n },\r\n /**\r\n * Gets the squared radii of the ellipsoid.\r\n * @memberof Ellipsoid.prototype\r\n * @type {Cartesian3}\r\n * @readonly\r\n */\r\n radiiSquared: {\r\n get: function () {\r\n return this._radiiSquared;\r\n },\r\n },\r\n /**\r\n * Gets the radii of the ellipsoid raise to the fourth power.\r\n * @memberof Ellipsoid.prototype\r\n * @type {Cartesian3}\r\n * @readonly\r\n */\r\n radiiToTheFourth: {\r\n get: function () {\r\n return this._radiiToTheFourth;\r\n },\r\n },\r\n /**\r\n * Gets one over the radii of the ellipsoid.\r\n * @memberof Ellipsoid.prototype\r\n * @type {Cartesian3}\r\n * @readonly\r\n */\r\n oneOverRadii: {\r\n get: function () {\r\n return this._oneOverRadii;\r\n },\r\n },\r\n /**\r\n * Gets one over the squared radii of the ellipsoid.\r\n * @memberof Ellipsoid.prototype\r\n * @type {Cartesian3}\r\n * @readonly\r\n */\r\n oneOverRadiiSquared: {\r\n get: function () {\r\n return this._oneOverRadiiSquared;\r\n },\r\n },\r\n /**\r\n * Gets the minimum radius of the ellipsoid.\r\n * @memberof Ellipsoid.prototype\r\n * @type {Number}\r\n * @readonly\r\n */\r\n minimumRadius: {\r\n get: function () {\r\n return this._minimumRadius;\r\n },\r\n },\r\n /**\r\n * Gets the maximum radius of the ellipsoid.\r\n * @memberof Ellipsoid.prototype\r\n * @type {Number}\r\n * @readonly\r\n */\r\n maximumRadius: {\r\n get: function () {\r\n return this._maximumRadius;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Duplicates an Ellipsoid instance.\r\n *\r\n * @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.\r\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\r\n * instance should be created.\r\n * @returns {Ellipsoid} The cloned Ellipsoid. (Returns undefined if ellipsoid is undefined)\r\n */\r\nEllipsoid.clone = function (ellipsoid, result) {\r\n if (!defined(ellipsoid)) {\r\n return undefined;\r\n }\r\n const radii = ellipsoid._radii;\r\n\r\n if (!defined(result)) {\r\n return new Ellipsoid(radii.x, radii.y, radii.z);\r\n }\r\n\r\n Cartesian3.clone(radii, result._radii);\r\n Cartesian3.clone(ellipsoid._radiiSquared, result._radiiSquared);\r\n Cartesian3.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);\r\n Cartesian3.clone(ellipsoid._oneOverRadii, result._oneOverRadii);\r\n Cartesian3.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);\r\n result._minimumRadius = ellipsoid._minimumRadius;\r\n result._maximumRadius = ellipsoid._maximumRadius;\r\n result._centerToleranceSquared = ellipsoid._centerToleranceSquared;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.\r\n *\r\n * @param {Cartesian3} [cartesian=Cartesian3.ZERO] The ellipsoid's radius in the x, y, and z directions.\r\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\r\n * instance should be created.\r\n * @returns {Ellipsoid} A new Ellipsoid instance.\r\n *\r\n * @exception {DeveloperError} All radii components must be greater than or equal to zero.\r\n *\r\n * @see Ellipsoid.WGS84\r\n * @see Ellipsoid.UNIT_SPHERE\r\n */\r\nEllipsoid.fromCartesian3 = function (cartesian, result) {\r\n if (!defined(result)) {\r\n result = new Ellipsoid();\r\n }\r\n\r\n if (!defined(cartesian)) {\r\n return result;\r\n }\r\n\r\n initialize(result, cartesian.x, cartesian.y, cartesian.z);\r\n return result;\r\n};\r\n\r\n/**\r\n * An Ellipsoid instance initialized to the WGS84 standard.\r\n *\r\n * @type {Ellipsoid}\r\n * @constant\r\n */\r\nEllipsoid.WGS84 = Object.freeze(\r\n new Ellipsoid(6378137.0, 6378137.0, 6356752.3142451793)\r\n);\r\n\r\n/**\r\n * An Ellipsoid instance initialized to radii of (1.0, 1.0, 1.0).\r\n *\r\n * @type {Ellipsoid}\r\n * @constant\r\n */\r\nEllipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1.0, 1.0, 1.0));\r\n\r\n/**\r\n * An Ellipsoid instance initialized to a sphere with the lunar radius.\r\n *\r\n * @type {Ellipsoid}\r\n * @constant\r\n */\r\nEllipsoid.MOON = Object.freeze(\r\n new Ellipsoid(\r\n CesiumMath.LUNAR_RADIUS,\r\n CesiumMath.LUNAR_RADIUS,\r\n CesiumMath.LUNAR_RADIUS\r\n )\r\n);\r\n\r\n/**\r\n * Duplicates an Ellipsoid instance.\r\n *\r\n * @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new\r\n * instance should be created.\r\n * @returns {Ellipsoid} The cloned Ellipsoid.\r\n */\r\nEllipsoid.prototype.clone = function (result) {\r\n return Ellipsoid.clone(this, result);\r\n};\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nEllipsoid.packedLength = Cartesian3.packedLength;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {Ellipsoid} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nEllipsoid.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n Cartesian3.pack(value._radii, array, startingIndex);\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {Ellipsoid} [result] The object into which to store the result.\r\n * @returns {Ellipsoid} The modified result parameter or a new Ellipsoid instance if one was not provided.\r\n */\r\nEllipsoid.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const radii = Cartesian3.unpack(array, startingIndex);\r\n return Ellipsoid.fromCartesian3(radii, result);\r\n};\r\n\r\n/**\r\n * Computes the unit vector directed from the center of this ellipsoid toward the provided Cartesian position.\r\n * @function\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian for which to to determine the geocentric normal.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\r\n */\r\nEllipsoid.prototype.geocentricSurfaceNormal = Cartesian3.normalize;\r\n\r\n/**\r\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\r\n *\r\n * @param {Cartographic} cartographic The cartographic position for which to to determine the geodetic normal.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\r\n */\r\nEllipsoid.prototype.geodeticSurfaceNormalCartographic = function (\r\n cartographic,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartographic\", cartographic);\r\n //>>includeEnd('debug');\r\n\r\n const longitude = cartographic.longitude;\r\n const latitude = cartographic.latitude;\r\n const cosLatitude = Math.cos(latitude);\r\n\r\n const x = cosLatitude * Math.cos(longitude);\r\n const y = cosLatitude * Math.sin(longitude);\r\n const z = Math.sin(latitude);\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n return Cartesian3.normalize(result, result);\r\n};\r\n\r\n/**\r\n * Computes the normal of the plane tangent to the surface of the ellipsoid at the provided position.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian position for which to to determine the surface normal.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided, or undefined if a normal cannot be found.\r\n */\r\nEllipsoid.prototype.geodeticSurfaceNormal = function (cartesian, result) {\r\n if (\r\n Cartesian3.equalsEpsilon(cartesian, Cartesian3.ZERO, CesiumMath.EPSILON14)\r\n ) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n result = Cartesian3.multiplyComponents(\r\n cartesian,\r\n this._oneOverRadiiSquared,\r\n result\r\n );\r\n return Cartesian3.normalize(result, result);\r\n};\r\n\r\nconst cartographicToCartesianNormal = new Cartesian3();\r\nconst cartographicToCartesianK = new Cartesian3();\r\n\r\n/**\r\n * Converts the provided cartographic to Cartesian representation.\r\n *\r\n * @param {Cartographic} cartographic The cartographic position.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\r\n *\r\n * @example\r\n * //Create a Cartographic and determine it's Cartesian representation on a WGS84 ellipsoid.\r\n * const position = new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 5000);\r\n * const cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);\r\n */\r\nEllipsoid.prototype.cartographicToCartesian = function (cartographic, result) {\r\n //`cartographic is required` is thrown from geodeticSurfaceNormalCartographic.\r\n const n = cartographicToCartesianNormal;\r\n const k = cartographicToCartesianK;\r\n this.geodeticSurfaceNormalCartographic(cartographic, n);\r\n Cartesian3.multiplyComponents(this._radiiSquared, n, k);\r\n const gamma = Math.sqrt(Cartesian3.dot(n, k));\r\n Cartesian3.divideByScalar(k, gamma, k);\r\n Cartesian3.multiplyByScalar(n, cartographic.height, n);\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n return Cartesian3.add(k, n, result);\r\n};\r\n\r\n/**\r\n * Converts the provided array of cartographics to an array of Cartesians.\r\n *\r\n * @param {Cartographic[]} cartographics An array of cartographic positions.\r\n * @param {Cartesian3[]} [result] The object onto which to store the result.\r\n * @returns {Cartesian3[]} The modified result parameter or a new Array instance if none was provided.\r\n *\r\n * @example\r\n * //Convert an array of Cartographics and determine their Cartesian representation on a WGS84 ellipsoid.\r\n * const positions = [new Cesium.Cartographic(Cesium.Math.toRadians(21), Cesium.Math.toRadians(78), 0),\r\n * new Cesium.Cartographic(Cesium.Math.toRadians(21.321), Cesium.Math.toRadians(78.123), 100),\r\n * new Cesium.Cartographic(Cesium.Math.toRadians(21.645), Cesium.Math.toRadians(78.456), 250)];\r\n * const cartesianPositions = Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(positions);\r\n */\r\nEllipsoid.prototype.cartographicArrayToCartesianArray = function (\r\n cartographics,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartographics\", cartographics);\r\n //>>includeEnd('debug')\r\n\r\n const length = cartographics.length;\r\n if (!defined(result)) {\r\n result = new Array(length);\r\n } else {\r\n result.length = length;\r\n }\r\n for (let i = 0; i < length; i++) {\r\n result[i] = this.cartographicToCartesian(cartographics[i], result[i]);\r\n }\r\n return result;\r\n};\r\n\r\nconst cartesianToCartographicN = new Cartesian3();\r\nconst cartesianToCartographicP = new Cartesian3();\r\nconst cartesianToCartographicH = new Cartesian3();\r\n\r\n/**\r\n * Converts the provided cartesian to cartographic representation.\r\n * The cartesian is undefined at the center of the ellipsoid.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian position to convert to cartographic representation.\r\n * @param {Cartographic} [result] The object onto which to store the result.\r\n * @returns {Cartographic} The modified result parameter, new Cartographic instance if none was provided, or undefined if the cartesian is at the center of the ellipsoid.\r\n *\r\n * @example\r\n * //Create a Cartesian and determine it's Cartographic representation on a WGS84 ellipsoid.\r\n * const position = new Cesium.Cartesian3(17832.12, 83234.52, 952313.73);\r\n * const cartographicPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position);\r\n */\r\nEllipsoid.prototype.cartesianToCartographic = function (cartesian, result) {\r\n //`cartesian is required.` is thrown from scaleToGeodeticSurface\r\n const p = this.scaleToGeodeticSurface(cartesian, cartesianToCartographicP);\r\n\r\n if (!defined(p)) {\r\n return undefined;\r\n }\r\n\r\n const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN);\r\n const h = Cartesian3.subtract(cartesian, p, cartesianToCartographicH);\r\n\r\n const longitude = Math.atan2(n.y, n.x);\r\n const latitude = Math.asin(n.z);\r\n const height =\r\n CesiumMath.sign(Cartesian3.dot(h, cartesian)) * Cartesian3.magnitude(h);\r\n\r\n if (!defined(result)) {\r\n return new Cartographic(longitude, latitude, height);\r\n }\r\n result.longitude = longitude;\r\n result.latitude = latitude;\r\n result.height = height;\r\n return result;\r\n};\r\n\r\n/**\r\n * Converts the provided array of cartesians to an array of cartographics.\r\n *\r\n * @param {Cartesian3[]} cartesians An array of Cartesian positions.\r\n * @param {Cartographic[]} [result] The object onto which to store the result.\r\n * @returns {Cartographic[]} The modified result parameter or a new Array instance if none was provided.\r\n *\r\n * @example\r\n * //Create an array of Cartesians and determine their Cartographic representation on a WGS84 ellipsoid.\r\n * const positions = [new Cesium.Cartesian3(17832.12, 83234.52, 952313.73),\r\n * new Cesium.Cartesian3(17832.13, 83234.53, 952313.73),\r\n * new Cesium.Cartesian3(17832.14, 83234.54, 952313.73)]\r\n * const cartographicPositions = Cesium.Ellipsoid.WGS84.cartesianArrayToCartographicArray(positions);\r\n */\r\nEllipsoid.prototype.cartesianArrayToCartographicArray = function (\r\n cartesians,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"cartesians\", cartesians);\r\n //>>includeEnd('debug');\r\n\r\n const length = cartesians.length;\r\n if (!defined(result)) {\r\n result = new Array(length);\r\n } else {\r\n result.length = length;\r\n }\r\n for (let i = 0; i < length; ++i) {\r\n result[i] = this.cartesianToCartographic(cartesians[i], result[i]);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Scales the provided Cartesian position along the geodetic surface normal\r\n * so that it is on the surface of this ellipsoid. If the position is\r\n * at the center of the ellipsoid, this function returns undefined.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian position to scale.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter, a new Cartesian3 instance if none was provided, or undefined if the position is at the center.\r\n */\r\nEllipsoid.prototype.scaleToGeodeticSurface = function (cartesian, result) {\r\n return scaleToGeodeticSurface(\r\n cartesian,\r\n this._oneOverRadii,\r\n this._oneOverRadiiSquared,\r\n this._centerToleranceSquared,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Scales the provided Cartesian position along the geocentric surface normal\r\n * so that it is on the surface of this ellipsoid.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian position to scale.\r\n * @param {Cartesian3} [result] The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if none was provided.\r\n */\r\nEllipsoid.prototype.scaleToGeocentricSurface = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n const positionX = cartesian.x;\r\n const positionY = cartesian.y;\r\n const positionZ = cartesian.z;\r\n const oneOverRadiiSquared = this._oneOverRadiiSquared;\r\n\r\n const beta =\r\n 1.0 /\r\n Math.sqrt(\r\n positionX * positionX * oneOverRadiiSquared.x +\r\n positionY * positionY * oneOverRadiiSquared.y +\r\n positionZ * positionZ * oneOverRadiiSquared.z\r\n );\r\n\r\n return Cartesian3.multiplyByScalar(cartesian, beta, result);\r\n};\r\n\r\n/**\r\n * Transforms a Cartesian X, Y, Z position to the ellipsoid-scaled space by multiplying\r\n * its components by the result of {@link Ellipsoid#oneOverRadii}.\r\n *\r\n * @param {Cartesian3} position The position to transform.\r\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\r\n * return a new instance.\r\n * @returns {Cartesian3} The position expressed in the scaled space. The returned instance is the\r\n * one passed as the result parameter if it is not undefined, or a new instance of it is.\r\n */\r\nEllipsoid.prototype.transformPositionToScaledSpace = function (\r\n position,\r\n result\r\n) {\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n return Cartesian3.multiplyComponents(position, this._oneOverRadii, result);\r\n};\r\n\r\n/**\r\n * Transforms a Cartesian X, Y, Z position from the ellipsoid-scaled space by multiplying\r\n * its components by the result of {@link Ellipsoid#radii}.\r\n *\r\n * @param {Cartesian3} position The position to transform.\r\n * @param {Cartesian3} [result] The position to which to copy the result, or undefined to create and\r\n * return a new instance.\r\n * @returns {Cartesian3} The position expressed in the unscaled space. The returned instance is the\r\n * one passed as the result parameter if it is not undefined, or a new instance of it is.\r\n */\r\nEllipsoid.prototype.transformPositionFromScaledSpace = function (\r\n position,\r\n result\r\n) {\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n return Cartesian3.multiplyComponents(position, this._radii, result);\r\n};\r\n\r\n/**\r\n * Compares this Ellipsoid against the provided Ellipsoid componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Ellipsoid} [right] The other Ellipsoid.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nEllipsoid.prototype.equals = function (right) {\r\n return (\r\n this === right ||\r\n (defined(right) && Cartesian3.equals(this._radii, right._radii))\r\n );\r\n};\r\n\r\n/**\r\n * Creates a string representing this Ellipsoid in the format '(radii.x, radii.y, radii.z)'.\r\n *\r\n * @returns {String} A string representing this ellipsoid in the format '(radii.x, radii.y, radii.z)'.\r\n */\r\nEllipsoid.prototype.toString = function () {\r\n return this._radii.toString();\r\n};\r\n\r\n/**\r\n * Computes a point which is the intersection of the surface normal with the z-axis.\r\n *\r\n * @param {Cartesian3} position the position. must be on the surface of the ellipsoid.\r\n * @param {Number} [buffer = 0.0] A buffer to subtract from the ellipsoid size when checking if the point is inside the ellipsoid.\r\n * In earth case, with common earth datums, there is no need for this buffer since the intersection point is always (relatively) very close to the center.\r\n * In WGS84 datum, intersection point is at max z = +-42841.31151331382 (0.673% of z-axis).\r\n * Intersection point could be outside the ellipsoid if the ratio of MajorAxis / AxisOfRotation is bigger than the square root of 2\r\n * @param {Cartesian3} [result] The cartesian to which to copy the result, or undefined to create and\r\n * return a new instance.\r\n * @returns {Cartesian3 | undefined} the intersection point if it's inside the ellipsoid, undefined otherwise\r\n *\r\n * @exception {DeveloperError} position is required.\r\n * @exception {DeveloperError} Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y).\r\n * @exception {DeveloperError} Ellipsoid.radii.z must be greater than 0.\r\n */\r\nEllipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function (\r\n position,\r\n buffer,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"position\", position);\r\n\r\n if (\r\n !CesiumMath.equalsEpsilon(\r\n this._radii.x,\r\n this._radii.y,\r\n CesiumMath.EPSILON15\r\n )\r\n ) {\r\n throw new DeveloperError(\r\n \"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)\"\r\n );\r\n }\r\n\r\n Check.typeOf.number.greaterThan(\"Ellipsoid.radii.z\", this._radii.z, 0);\r\n //>>includeEnd('debug');\r\n\r\n buffer = defaultValue(buffer, 0.0);\r\n\r\n const squaredXOverSquaredZ = this._squaredXOverSquaredZ;\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n result.x = 0.0;\r\n result.y = 0.0;\r\n result.z = position.z * (1 - squaredXOverSquaredZ);\r\n\r\n if (Math.abs(result.z) >= this._radii.z - buffer) {\r\n return undefined;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nconst abscissas = [\r\n 0.14887433898163,\r\n 0.43339539412925,\r\n 0.67940956829902,\r\n 0.86506336668898,\r\n 0.97390652851717,\r\n 0.0,\r\n];\r\nconst weights = [\r\n 0.29552422471475,\r\n 0.26926671930999,\r\n 0.21908636251598,\r\n 0.14945134915058,\r\n 0.066671344308684,\r\n 0.0,\r\n];\r\n\r\n/**\r\n * Compute the 10th order Gauss-Legendre Quadrature of the given definite integral.\r\n *\r\n * @param {Number} a The lower bound for the integration.\r\n * @param {Number} b The upper bound for the integration.\r\n * @param {Ellipsoid~RealValuedScalarFunction} func The function to integrate.\r\n * @returns {Number} The value of the integral of the given function over the given domain.\r\n *\r\n * @private\r\n */\r\nfunction gaussLegendreQuadrature(a, b, func) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"a\", a);\r\n Check.typeOf.number(\"b\", b);\r\n Check.typeOf.func(\"func\", func);\r\n //>>includeEnd('debug');\r\n\r\n // The range is half of the normal range since the five weights add to one (ten weights add to two).\r\n // The values of the abscissas are multiplied by two to account for this.\r\n const xMean = 0.5 * (b + a);\r\n const xRange = 0.5 * (b - a);\r\n\r\n let sum = 0.0;\r\n for (let i = 0; i < 5; i++) {\r\n const dx = xRange * abscissas[i];\r\n sum += weights[i] * (func(xMean + dx) + func(xMean - dx));\r\n }\r\n\r\n // Scale the sum to the range of x.\r\n sum *= xRange;\r\n return sum;\r\n}\r\n\r\n/**\r\n * A real valued scalar function.\r\n * @callback Ellipsoid~RealValuedScalarFunction\r\n *\r\n * @param {Number} x The value used to evaluate the function.\r\n * @returns {Number} The value of the function at x.\r\n *\r\n * @private\r\n */\r\n\r\n/**\r\n * Computes an approximation of the surface area of a rectangle on the surface of an ellipsoid using\r\n * Gauss-Legendre 10th order quadrature.\r\n *\r\n * @param {Rectangle} rectangle The rectangle used for computing the surface area.\r\n * @returns {Number} The approximate area of the rectangle on the surface of this ellipsoid.\r\n */\r\nEllipsoid.prototype.surfaceArea = function (rectangle) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n const minLongitude = rectangle.west;\r\n let maxLongitude = rectangle.east;\r\n const minLatitude = rectangle.south;\r\n const maxLatitude = rectangle.north;\r\n\r\n while (maxLongitude < minLongitude) {\r\n maxLongitude += CesiumMath.TWO_PI;\r\n }\r\n\r\n const radiiSquared = this._radiiSquared;\r\n const a2 = radiiSquared.x;\r\n const b2 = radiiSquared.y;\r\n const c2 = radiiSquared.z;\r\n const a2b2 = a2 * b2;\r\n return gaussLegendreQuadrature(minLatitude, maxLatitude, function (lat) {\r\n // phi represents the angle measured from the north pole\r\n // sin(phi) = sin(pi / 2 - lat) = cos(lat), cos(phi) is similar\r\n const sinPhi = Math.cos(lat);\r\n const cosPhi = Math.sin(lat);\r\n return (\r\n Math.cos(lat) *\r\n gaussLegendreQuadrature(minLongitude, maxLongitude, function (lon) {\r\n const cosTheta = Math.cos(lon);\r\n const sinTheta = Math.sin(lon);\r\n return Math.sqrt(\r\n a2b2 * cosPhi * cosPhi +\r\n c2 *\r\n (b2 * cosTheta * cosTheta + a2 * sinTheta * sinTheta) *\r\n sinPhi *\r\n sinPhi\r\n );\r\n })\r\n );\r\n });\r\n};\r\n\r\nexport default Ellipsoid;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\n/**\r\n * A 3x3 matrix, indexable as a column-major order array.\r\n * Constructor parameters are in row-major order for code readability.\r\n * @alias Matrix3\r\n * @constructor\r\n * @implements {ArrayLike}\r\n *\r\n * @param {Number} [column0Row0=0.0] The value for column 0, row 0.\r\n * @param {Number} [column1Row0=0.0] The value for column 1, row 0.\r\n * @param {Number} [column2Row0=0.0] The value for column 2, row 0.\r\n * @param {Number} [column0Row1=0.0] The value for column 0, row 1.\r\n * @param {Number} [column1Row1=0.0] The value for column 1, row 1.\r\n * @param {Number} [column2Row1=0.0] The value for column 2, row 1.\r\n * @param {Number} [column0Row2=0.0] The value for column 0, row 2.\r\n * @param {Number} [column1Row2=0.0] The value for column 1, row 2.\r\n * @param {Number} [column2Row2=0.0] The value for column 2, row 2.\r\n *\r\n * @see Matrix3.fromArray\r\n * @see Matrix3.fromColumnMajorArray\r\n * @see Matrix3.fromRowMajorArray\r\n * @see Matrix3.fromQuaternion\r\n * @see Matrix3.fromHeadingPitchRoll\r\n * @see Matrix3.fromScale\r\n * @see Matrix3.fromUniformScale\r\n * @see Matrix3.fromCrossProduct\r\n * @see Matrix3.fromRotationX\r\n * @see Matrix3.fromRotationY\r\n * @see Matrix3.fromRotationZ\r\n * @see Matrix2\r\n * @see Matrix4\r\n */\r\nfunction Matrix3(\r\n column0Row0,\r\n column1Row0,\r\n column2Row0,\r\n column0Row1,\r\n column1Row1,\r\n column2Row1,\r\n column0Row2,\r\n column1Row2,\r\n column2Row2\r\n) {\r\n this[0] = defaultValue(column0Row0, 0.0);\r\n this[1] = defaultValue(column0Row1, 0.0);\r\n this[2] = defaultValue(column0Row2, 0.0);\r\n this[3] = defaultValue(column1Row0, 0.0);\r\n this[4] = defaultValue(column1Row1, 0.0);\r\n this[5] = defaultValue(column1Row2, 0.0);\r\n this[6] = defaultValue(column2Row0, 0.0);\r\n this[7] = defaultValue(column2Row1, 0.0);\r\n this[8] = defaultValue(column2Row2, 0.0);\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nMatrix3.packedLength = 9;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {Matrix3} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nMatrix3.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value[0];\r\n array[startingIndex++] = value[1];\r\n array[startingIndex++] = value[2];\r\n array[startingIndex++] = value[3];\r\n array[startingIndex++] = value[4];\r\n array[startingIndex++] = value[5];\r\n array[startingIndex++] = value[6];\r\n array[startingIndex++] = value[7];\r\n array[startingIndex++] = value[8];\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {Matrix3} [result] The object into which to store the result.\r\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\r\n */\r\nMatrix3.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new Matrix3();\r\n }\r\n\r\n result[0] = array[startingIndex++];\r\n result[1] = array[startingIndex++];\r\n result[2] = array[startingIndex++];\r\n result[3] = array[startingIndex++];\r\n result[4] = array[startingIndex++];\r\n result[5] = array[startingIndex++];\r\n result[6] = array[startingIndex++];\r\n result[7] = array[startingIndex++];\r\n result[8] = array[startingIndex++];\r\n return result;\r\n};\r\n\r\n/**\r\n * Flattens an array of Matrix3s into an array of components. The components\r\n * are stored in column-major order.\r\n *\r\n * @param {Matrix3[]} array The array of matrices to pack.\r\n * @param {Number[]} [result] The array onto which to store the result. If this is a typed array, it must have array.length * 9 components, else a {@link DeveloperError} will be thrown. If it is a regular array, it will be resized to have (array.length * 9) elements.\r\n * @returns {Number[]} The packed array.\r\n */\r\nMatrix3.packArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n const resultLength = length * 9;\r\n if (!defined(result)) {\r\n result = new Array(resultLength);\r\n } else if (!Array.isArray(result) && result.length !== resultLength) {\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(\r\n \"If result is a typed array, it must have exactly array.length * 9 elements\"\r\n );\r\n //>>includeEnd('debug');\r\n } else if (result.length !== resultLength) {\r\n result.length = resultLength;\r\n }\r\n\r\n for (let i = 0; i < length; ++i) {\r\n Matrix3.pack(array[i], result, i * 9);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Unpacks an array of column-major matrix components into an array of Matrix3s.\r\n *\r\n * @param {Number[]} array The array of components to unpack.\r\n * @param {Matrix3[]} [result] The array onto which to store the result.\r\n * @returns {Matrix3[]} The unpacked array.\r\n */\r\nMatrix3.unpackArray = function (array, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n Check.typeOf.number.greaterThanOrEquals(\"array.length\", array.length, 9);\r\n if (array.length % 9 !== 0) {\r\n throw new DeveloperError(\"array length must be a multiple of 9.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = array.length;\r\n if (!defined(result)) {\r\n result = new Array(length / 9);\r\n } else {\r\n result.length = length / 9;\r\n }\r\n\r\n for (let i = 0; i < length; i += 9) {\r\n const index = i / 9;\r\n result[index] = Matrix3.unpack(array, i, result[index]);\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a Matrix3 instance.\r\n *\r\n * @param {Matrix3} matrix The matrix to duplicate.\r\n * @param {Matrix3} [result] The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided. (Returns undefined if matrix is undefined)\r\n */\r\nMatrix3.clone = function (matrix, result) {\r\n if (!defined(matrix)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n return new Matrix3(\r\n matrix[0],\r\n matrix[3],\r\n matrix[6],\r\n matrix[1],\r\n matrix[4],\r\n matrix[7],\r\n matrix[2],\r\n matrix[5],\r\n matrix[8]\r\n );\r\n }\r\n result[0] = matrix[0];\r\n result[1] = matrix[1];\r\n result[2] = matrix[2];\r\n result[3] = matrix[3];\r\n result[4] = matrix[4];\r\n result[5] = matrix[5];\r\n result[6] = matrix[6];\r\n result[7] = matrix[7];\r\n result[8] = matrix[8];\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a Matrix3 from 9 consecutive elements in an array.\r\n *\r\n * @function\r\n * @param {Number[]} array The array whose 9 consecutive elements correspond to the positions of the matrix. Assumes column-major order.\r\n * @param {Number} [startingIndex=0] The offset into the array of the first element, which corresponds to first column first row position in the matrix.\r\n * @param {Matrix3} [result] The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\r\n *\r\n * @example\r\n * // Create the Matrix3:\r\n * // [1.0, 2.0, 3.0]\r\n * // [1.0, 2.0, 3.0]\r\n * // [1.0, 2.0, 3.0]\r\n *\r\n * const v = [1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];\r\n * const m = Cesium.Matrix3.fromArray(v);\r\n *\r\n * // Create same Matrix3 with using an offset into an array\r\n * const v2 = [0.0, 0.0, 1.0, 1.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0];\r\n * const m2 = Cesium.Matrix3.fromArray(v2, 2);\r\n */\r\nMatrix3.fromArray = Matrix3.unpack;\r\n\r\n/**\r\n * Creates a Matrix3 instance from a column-major order array.\r\n *\r\n * @param {Number[]} values The column-major order array.\r\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\r\n */\r\nMatrix3.fromColumnMajorArray = function (values, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"values\", values);\r\n //>>includeEnd('debug');\r\n\r\n return Matrix3.clone(values, result);\r\n};\r\n\r\n/**\r\n * Creates a Matrix3 instance from a row-major order array.\r\n * The resulting matrix will be in column-major order.\r\n *\r\n * @param {Number[]} values The row-major order array.\r\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\r\n */\r\nMatrix3.fromRowMajorArray = function (values, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"values\", values);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Matrix3(\r\n values[0],\r\n values[1],\r\n values[2],\r\n values[3],\r\n values[4],\r\n values[5],\r\n values[6],\r\n values[7],\r\n values[8]\r\n );\r\n }\r\n result[0] = values[0];\r\n result[1] = values[3];\r\n result[2] = values[6];\r\n result[3] = values[1];\r\n result[4] = values[4];\r\n result[5] = values[7];\r\n result[6] = values[2];\r\n result[7] = values[5];\r\n result[8] = values[8];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a 3x3 rotation matrix from the provided quaternion.\r\n *\r\n * @param {Quaternion} quaternion the quaternion to use.\r\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix3} The 3x3 rotation matrix from this quaternion.\r\n */\r\nMatrix3.fromQuaternion = function (quaternion, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"quaternion\", quaternion);\r\n //>>includeEnd('debug');\r\n\r\n const x2 = quaternion.x * quaternion.x;\r\n const xy = quaternion.x * quaternion.y;\r\n const xz = quaternion.x * quaternion.z;\r\n const xw = quaternion.x * quaternion.w;\r\n const y2 = quaternion.y * quaternion.y;\r\n const yz = quaternion.y * quaternion.z;\r\n const yw = quaternion.y * quaternion.w;\r\n const z2 = quaternion.z * quaternion.z;\r\n const zw = quaternion.z * quaternion.w;\r\n const w2 = quaternion.w * quaternion.w;\r\n\r\n const m00 = x2 - y2 - z2 + w2;\r\n const m01 = 2.0 * (xy - zw);\r\n const m02 = 2.0 * (xz + yw);\r\n\r\n const m10 = 2.0 * (xy + zw);\r\n const m11 = -x2 + y2 - z2 + w2;\r\n const m12 = 2.0 * (yz - xw);\r\n\r\n const m20 = 2.0 * (xz - yw);\r\n const m21 = 2.0 * (yz + xw);\r\n const m22 = -x2 - y2 + z2 + w2;\r\n\r\n if (!defined(result)) {\r\n return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);\r\n }\r\n result[0] = m00;\r\n result[1] = m10;\r\n result[2] = m20;\r\n result[3] = m01;\r\n result[4] = m11;\r\n result[5] = m21;\r\n result[6] = m02;\r\n result[7] = m12;\r\n result[8] = m22;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a 3x3 rotation matrix from the provided headingPitchRoll. (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )\r\n *\r\n * @param {HeadingPitchRoll} headingPitchRoll the headingPitchRoll to use.\r\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix3} The 3x3 rotation matrix from this headingPitchRoll.\r\n */\r\nMatrix3.fromHeadingPitchRoll = function (headingPitchRoll, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"headingPitchRoll\", headingPitchRoll);\r\n //>>includeEnd('debug');\r\n\r\n const cosTheta = Math.cos(-headingPitchRoll.pitch);\r\n const cosPsi = Math.cos(-headingPitchRoll.heading);\r\n const cosPhi = Math.cos(headingPitchRoll.roll);\r\n const sinTheta = Math.sin(-headingPitchRoll.pitch);\r\n const sinPsi = Math.sin(-headingPitchRoll.heading);\r\n const sinPhi = Math.sin(headingPitchRoll.roll);\r\n\r\n const m00 = cosTheta * cosPsi;\r\n const m01 = -cosPhi * sinPsi + sinPhi * sinTheta * cosPsi;\r\n const m02 = sinPhi * sinPsi + cosPhi * sinTheta * cosPsi;\r\n\r\n const m10 = cosTheta * sinPsi;\r\n const m11 = cosPhi * cosPsi + sinPhi * sinTheta * sinPsi;\r\n const m12 = -sinPhi * cosPsi + cosPhi * sinTheta * sinPsi;\r\n\r\n const m20 = -sinTheta;\r\n const m21 = sinPhi * cosTheta;\r\n const m22 = cosPhi * cosTheta;\r\n\r\n if (!defined(result)) {\r\n return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);\r\n }\r\n result[0] = m00;\r\n result[1] = m10;\r\n result[2] = m20;\r\n result[3] = m01;\r\n result[4] = m11;\r\n result[5] = m21;\r\n result[6] = m02;\r\n result[7] = m12;\r\n result[8] = m22;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix3 instance representing a non-uniform scale.\r\n *\r\n * @param {Cartesian3} scale The x, y, and z scale factors.\r\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\r\n *\r\n * @example\r\n * // Creates\r\n * // [7.0, 0.0, 0.0]\r\n * // [0.0, 8.0, 0.0]\r\n * // [0.0, 0.0, 9.0]\r\n * const m = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(7.0, 8.0, 9.0));\r\n */\r\nMatrix3.fromScale = function (scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"scale\", scale);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Matrix3(scale.x, 0.0, 0.0, 0.0, scale.y, 0.0, 0.0, 0.0, scale.z);\r\n }\r\n\r\n result[0] = scale.x;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = scale.y;\r\n result[5] = 0.0;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = scale.z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix3 instance representing a uniform scale.\r\n *\r\n * @param {Number} scale The uniform scale factor.\r\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\r\n *\r\n * @example\r\n * // Creates\r\n * // [2.0, 0.0, 0.0]\r\n * // [0.0, 2.0, 0.0]\r\n * // [0.0, 0.0, 2.0]\r\n * const m = Cesium.Matrix3.fromUniformScale(2.0);\r\n */\r\nMatrix3.fromUniformScale = function (scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"scale\", scale);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Matrix3(scale, 0.0, 0.0, 0.0, scale, 0.0, 0.0, 0.0, scale);\r\n }\r\n\r\n result[0] = scale;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = scale;\r\n result[5] = 0.0;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = scale;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a Matrix3 instance representing the cross product equivalent matrix of a Cartesian3 vector.\r\n *\r\n * @param {Cartesian3} vector the vector on the left hand side of the cross product operation.\r\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\r\n *\r\n * @example\r\n * // Creates\r\n * // [0.0, -9.0, 8.0]\r\n * // [9.0, 0.0, -7.0]\r\n * // [-8.0, 7.0, 0.0]\r\n * const m = Cesium.Matrix3.fromCrossProduct(new Cesium.Cartesian3(7.0, 8.0, 9.0));\r\n */\r\nMatrix3.fromCrossProduct = function (vector, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"vector\", vector);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Matrix3(\r\n 0.0,\r\n -vector.z,\r\n vector.y,\r\n vector.z,\r\n 0.0,\r\n -vector.x,\r\n -vector.y,\r\n vector.x,\r\n 0.0\r\n );\r\n }\r\n\r\n result[0] = 0.0;\r\n result[1] = vector.z;\r\n result[2] = -vector.y;\r\n result[3] = -vector.z;\r\n result[4] = 0.0;\r\n result[5] = vector.x;\r\n result[6] = vector.y;\r\n result[7] = -vector.x;\r\n result[8] = 0.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a rotation matrix around the x-axis.\r\n *\r\n * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.\r\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\r\n *\r\n * @example\r\n * // Rotate a point 45 degrees counterclockwise around the x-axis.\r\n * const p = new Cesium.Cartesian3(5, 6, 7);\r\n * const m = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(45.0));\r\n * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());\r\n */\r\nMatrix3.fromRotationX = function (angle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"angle\", angle);\r\n //>>includeEnd('debug');\r\n\r\n const cosAngle = Math.cos(angle);\r\n const sinAngle = Math.sin(angle);\r\n\r\n if (!defined(result)) {\r\n return new Matrix3(\r\n 1.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n cosAngle,\r\n -sinAngle,\r\n 0.0,\r\n sinAngle,\r\n cosAngle\r\n );\r\n }\r\n\r\n result[0] = 1.0;\r\n result[1] = 0.0;\r\n result[2] = 0.0;\r\n result[3] = 0.0;\r\n result[4] = cosAngle;\r\n result[5] = sinAngle;\r\n result[6] = 0.0;\r\n result[7] = -sinAngle;\r\n result[8] = cosAngle;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a rotation matrix around the y-axis.\r\n *\r\n * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.\r\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\r\n *\r\n * @example\r\n * // Rotate a point 45 degrees counterclockwise around the y-axis.\r\n * const p = new Cesium.Cartesian3(5, 6, 7);\r\n * const m = Cesium.Matrix3.fromRotationY(Cesium.Math.toRadians(45.0));\r\n * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());\r\n */\r\nMatrix3.fromRotationY = function (angle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"angle\", angle);\r\n //>>includeEnd('debug');\r\n\r\n const cosAngle = Math.cos(angle);\r\n const sinAngle = Math.sin(angle);\r\n\r\n if (!defined(result)) {\r\n return new Matrix3(\r\n cosAngle,\r\n 0.0,\r\n sinAngle,\r\n 0.0,\r\n 1.0,\r\n 0.0,\r\n -sinAngle,\r\n 0.0,\r\n cosAngle\r\n );\r\n }\r\n\r\n result[0] = cosAngle;\r\n result[1] = 0.0;\r\n result[2] = -sinAngle;\r\n result[3] = 0.0;\r\n result[4] = 1.0;\r\n result[5] = 0.0;\r\n result[6] = sinAngle;\r\n result[7] = 0.0;\r\n result[8] = cosAngle;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a rotation matrix around the z-axis.\r\n *\r\n * @param {Number} angle The angle, in radians, of the rotation. Positive angles are counterclockwise.\r\n * @param {Matrix3} [result] The object in which the result will be stored, if undefined a new instance will be created.\r\n * @returns {Matrix3} The modified result parameter, or a new Matrix3 instance if one was not provided.\r\n *\r\n * @example\r\n * // Rotate a point 45 degrees counterclockwise around the z-axis.\r\n * const p = new Cesium.Cartesian3(5, 6, 7);\r\n * const m = Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(45.0));\r\n * const rotated = Cesium.Matrix3.multiplyByVector(m, p, new Cesium.Cartesian3());\r\n */\r\nMatrix3.fromRotationZ = function (angle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"angle\", angle);\r\n //>>includeEnd('debug');\r\n\r\n const cosAngle = Math.cos(angle);\r\n const sinAngle = Math.sin(angle);\r\n\r\n if (!defined(result)) {\r\n return new Matrix3(\r\n cosAngle,\r\n -sinAngle,\r\n 0.0,\r\n sinAngle,\r\n cosAngle,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0\r\n );\r\n }\r\n\r\n result[0] = cosAngle;\r\n result[1] = sinAngle;\r\n result[2] = 0.0;\r\n result[3] = -sinAngle;\r\n result[4] = cosAngle;\r\n result[5] = 0.0;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = 1.0;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates an Array from the provided Matrix3 instance.\r\n * The array will be in column-major order.\r\n *\r\n * @param {Matrix3} matrix The matrix to use..\r\n * @param {Number[]} [result] The Array onto which to store the result.\r\n * @returns {Number[]} The modified Array parameter or a new Array instance if one was not provided.\r\n */\r\nMatrix3.toArray = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return [\r\n matrix[0],\r\n matrix[1],\r\n matrix[2],\r\n matrix[3],\r\n matrix[4],\r\n matrix[5],\r\n matrix[6],\r\n matrix[7],\r\n matrix[8],\r\n ];\r\n }\r\n result[0] = matrix[0];\r\n result[1] = matrix[1];\r\n result[2] = matrix[2];\r\n result[3] = matrix[3];\r\n result[4] = matrix[4];\r\n result[5] = matrix[5];\r\n result[6] = matrix[6];\r\n result[7] = matrix[7];\r\n result[8] = matrix[8];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the array index of the element at the provided row and column.\r\n *\r\n * @param {Number} column The zero-based index of the column.\r\n * @param {Number} row The zero-based index of the row.\r\n * @returns {Number} The index of the element at the provided row and column.\r\n *\r\n * @exception {DeveloperError} row must be 0, 1, or 2.\r\n * @exception {DeveloperError} column must be 0, 1, or 2.\r\n *\r\n * @example\r\n * const myMatrix = new Cesium.Matrix3();\r\n * const column1Row0Index = Cesium.Matrix3.getElementIndex(1, 0);\r\n * const column1Row0 = myMatrix[column1Row0Index]\r\n * myMatrix[column1Row0Index] = 10.0;\r\n */\r\nMatrix3.getElementIndex = function (column, row) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.greaterThanOrEquals(\"row\", row, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"row\", row, 2);\r\n Check.typeOf.number.greaterThanOrEquals(\"column\", column, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"column\", column, 2);\r\n //>>includeEnd('debug');\r\n\r\n return column * 3 + row;\r\n};\r\n\r\n/**\r\n * Retrieves a copy of the matrix column at the provided index as a Cartesian3 instance.\r\n *\r\n * @param {Matrix3} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the column to retrieve.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0, 1, or 2.\r\n */\r\nMatrix3.getColumn = function (matrix, index, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 2);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const startIndex = index * 3;\r\n const x = matrix[startIndex];\r\n const y = matrix[startIndex + 1];\r\n const z = matrix[startIndex + 2];\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a new matrix that replaces the specified column in the provided matrix with the provided Cartesian3 instance.\r\n *\r\n * @param {Matrix3} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the column to set.\r\n * @param {Cartesian3} cartesian The Cartesian whose values will be assigned to the specified column.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0, 1, or 2.\r\n */\r\nMatrix3.setColumn = function (matrix, index, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 2);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result = Matrix3.clone(matrix, result);\r\n const startIndex = index * 3;\r\n result[startIndex] = cartesian.x;\r\n result[startIndex + 1] = cartesian.y;\r\n result[startIndex + 2] = cartesian.z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Retrieves a copy of the matrix row at the provided index as a Cartesian3 instance.\r\n *\r\n * @param {Matrix3} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the row to retrieve.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0, 1, or 2.\r\n */\r\nMatrix3.getRow = function (matrix, index, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 2);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const x = matrix[index];\r\n const y = matrix[index + 3];\r\n const z = matrix[index + 6];\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a new matrix that replaces the specified row in the provided matrix with the provided Cartesian3 instance.\r\n *\r\n * @param {Matrix3} matrix The matrix to use.\r\n * @param {Number} index The zero-based index of the row to set.\r\n * @param {Cartesian3} cartesian The Cartesian whose values will be assigned to the specified row.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} index must be 0, 1, or 2.\r\n */\r\nMatrix3.setRow = function (matrix, index, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number.greaterThanOrEquals(\"index\", index, 0);\r\n Check.typeOf.number.lessThanOrEquals(\"index\", index, 2);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result = Matrix3.clone(matrix, result);\r\n result[index] = cartesian.x;\r\n result[index + 3] = cartesian.y;\r\n result[index + 6] = cartesian.z;\r\n return result;\r\n};\r\n\r\nconst scaleScratch1 = new Cartesian3();\r\n\r\n/**\r\n * Computes a new matrix that replaces the scale with the provided scale.\r\n * This assumes the matrix is an affine transformation.\r\n *\r\n * @param {Matrix3} matrix The matrix to use.\r\n * @param {Cartesian3} scale The scale that replaces the scale of the provided matrix.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n * @see Matrix3.setUniformScale\r\n * @see Matrix3.fromScale\r\n * @see Matrix3.fromUniformScale\r\n * @see Matrix3.multiplyByScale\r\n * @see Matrix3.multiplyByUniformScale\r\n * @see Matrix3.getScale\r\n */\r\nMatrix3.setScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const existingScale = Matrix3.getScale(matrix, scaleScratch1);\r\n const scaleRatioX = scale.x / existingScale.x;\r\n const scaleRatioY = scale.y / existingScale.y;\r\n const scaleRatioZ = scale.z / existingScale.z;\r\n\r\n result[0] = matrix[0] * scaleRatioX;\r\n result[1] = matrix[1] * scaleRatioX;\r\n result[2] = matrix[2] * scaleRatioX;\r\n result[3] = matrix[3] * scaleRatioY;\r\n result[4] = matrix[4] * scaleRatioY;\r\n result[5] = matrix[5] * scaleRatioY;\r\n result[6] = matrix[6] * scaleRatioZ;\r\n result[7] = matrix[7] * scaleRatioZ;\r\n result[8] = matrix[8] * scaleRatioZ;\r\n\r\n return result;\r\n};\r\n\r\nconst scaleScratch2 = new Cartesian3();\r\n\r\n/**\r\n * Computes a new matrix that replaces the scale with the provided uniform scale.\r\n * This assumes the matrix is an affine transformation.\r\n *\r\n * @param {Matrix3} matrix The matrix to use.\r\n * @param {Number} scale The uniform scale that replaces the scale of the provided matrix.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n * @see Matrix3.setScale\r\n * @see Matrix3.fromScale\r\n * @see Matrix3.fromUniformScale\r\n * @see Matrix3.multiplyByScale\r\n * @see Matrix3.multiplyByUniformScale\r\n * @see Matrix3.getScale\r\n */\r\nMatrix3.setUniformScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const existingScale = Matrix3.getScale(matrix, scaleScratch2);\r\n const scaleRatioX = scale / existingScale.x;\r\n const scaleRatioY = scale / existingScale.y;\r\n const scaleRatioZ = scale / existingScale.z;\r\n\r\n result[0] = matrix[0] * scaleRatioX;\r\n result[1] = matrix[1] * scaleRatioX;\r\n result[2] = matrix[2] * scaleRatioX;\r\n result[3] = matrix[3] * scaleRatioY;\r\n result[4] = matrix[4] * scaleRatioY;\r\n result[5] = matrix[5] * scaleRatioY;\r\n result[6] = matrix[6] * scaleRatioZ;\r\n result[7] = matrix[7] * scaleRatioZ;\r\n result[8] = matrix[8] * scaleRatioZ;\r\n\r\n return result;\r\n};\r\n\r\nconst scratchColumn = new Cartesian3();\r\n\r\n/**\r\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\r\n *\r\n * @param {Matrix3} matrix The matrix.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n *\r\n * @see Matrix3.multiplyByScale\r\n * @see Matrix3.multiplyByUniformScale\r\n * @see Matrix3.fromScale\r\n * @see Matrix3.fromUniformScale\r\n * @see Matrix3.setScale\r\n * @see Matrix3.setUniformScale\r\n */\r\nMatrix3.getScale = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = Cartesian3.magnitude(\r\n Cartesian3.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)\r\n );\r\n result.y = Cartesian3.magnitude(\r\n Cartesian3.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)\r\n );\r\n result.z = Cartesian3.magnitude(\r\n Cartesian3.fromElements(matrix[6], matrix[7], matrix[8], scratchColumn)\r\n );\r\n return result;\r\n};\r\n\r\nconst scaleScratch3 = new Cartesian3();\r\n\r\n/**\r\n * Computes the maximum scale assuming the matrix is an affine transformation.\r\n * The maximum scale is the maximum length of the column vectors.\r\n *\r\n * @param {Matrix3} matrix The matrix.\r\n * @returns {Number} The maximum scale.\r\n */\r\nMatrix3.getMaximumScale = function (matrix) {\r\n Matrix3.getScale(matrix, scaleScratch3);\r\n return Cartesian3.maximumComponent(scaleScratch3);\r\n};\r\n\r\nconst scaleScratch4 = new Cartesian3();\r\n\r\n/**\r\n * Sets the rotation assuming the matrix is an affine transformation.\r\n *\r\n * @param {Matrix3} matrix The matrix.\r\n * @param {Matrix3} rotation The rotation matrix.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n * @see Matrix3.getRotation\r\n */\r\nMatrix3.setRotation = function (matrix, rotation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const scale = Matrix3.getScale(matrix, scaleScratch4);\r\n\r\n result[0] = rotation[0] * scale.x;\r\n result[1] = rotation[1] * scale.x;\r\n result[2] = rotation[2] * scale.x;\r\n result[3] = rotation[3] * scale.y;\r\n result[4] = rotation[4] * scale.y;\r\n result[5] = rotation[5] * scale.y;\r\n result[6] = rotation[6] * scale.z;\r\n result[7] = rotation[7] * scale.z;\r\n result[8] = rotation[8] * scale.z;\r\n\r\n return result;\r\n};\r\n\r\nconst scaleScratch5 = new Cartesian3();\r\n\r\n/**\r\n * Extracts the rotation matrix assuming the matrix is an affine transformation.\r\n *\r\n * @param {Matrix3} matrix The matrix.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n * @see Matrix3.setRotation\r\n */\r\nMatrix3.getRotation = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const scale = Matrix3.getScale(matrix, scaleScratch5);\r\n\r\n result[0] = matrix[0] / scale.x;\r\n result[1] = matrix[1] / scale.x;\r\n result[2] = matrix[2] / scale.x;\r\n result[3] = matrix[3] / scale.y;\r\n result[4] = matrix[4] / scale.y;\r\n result[5] = matrix[5] / scale.y;\r\n result[6] = matrix[6] / scale.z;\r\n result[7] = matrix[7] / scale.z;\r\n result[8] = matrix[8] / scale.z;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of two matrices.\r\n *\r\n * @param {Matrix3} left The first matrix.\r\n * @param {Matrix3} right The second matrix.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n */\r\nMatrix3.multiply = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const column0Row0 =\r\n left[0] * right[0] + left[3] * right[1] + left[6] * right[2];\r\n const column0Row1 =\r\n left[1] * right[0] + left[4] * right[1] + left[7] * right[2];\r\n const column0Row2 =\r\n left[2] * right[0] + left[5] * right[1] + left[8] * right[2];\r\n\r\n const column1Row0 =\r\n left[0] * right[3] + left[3] * right[4] + left[6] * right[5];\r\n const column1Row1 =\r\n left[1] * right[3] + left[4] * right[4] + left[7] * right[5];\r\n const column1Row2 =\r\n left[2] * right[3] + left[5] * right[4] + left[8] * right[5];\r\n\r\n const column2Row0 =\r\n left[0] * right[6] + left[3] * right[7] + left[6] * right[8];\r\n const column2Row1 =\r\n left[1] * right[6] + left[4] * right[7] + left[7] * right[8];\r\n const column2Row2 =\r\n left[2] * right[6] + left[5] * right[7] + left[8] * right[8];\r\n\r\n result[0] = column0Row0;\r\n result[1] = column0Row1;\r\n result[2] = column0Row2;\r\n result[3] = column1Row0;\r\n result[4] = column1Row1;\r\n result[5] = column1Row2;\r\n result[6] = column2Row0;\r\n result[7] = column2Row1;\r\n result[8] = column2Row2;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the sum of two matrices.\r\n *\r\n * @param {Matrix3} left The first matrix.\r\n * @param {Matrix3} right The second matrix.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n */\r\nMatrix3.add = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = left[0] + right[0];\r\n result[1] = left[1] + right[1];\r\n result[2] = left[2] + right[2];\r\n result[3] = left[3] + right[3];\r\n result[4] = left[4] + right[4];\r\n result[5] = left[5] + right[5];\r\n result[6] = left[6] + right[6];\r\n result[7] = left[7] + right[7];\r\n result[8] = left[8] + right[8];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the difference of two matrices.\r\n *\r\n * @param {Matrix3} left The first matrix.\r\n * @param {Matrix3} right The second matrix.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n */\r\nMatrix3.subtract = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = left[0] - right[0];\r\n result[1] = left[1] - right[1];\r\n result[2] = left[2] - right[2];\r\n result[3] = left[3] - right[3];\r\n result[4] = left[4] - right[4];\r\n result[5] = left[5] - right[5];\r\n result[6] = left[6] - right[6];\r\n result[7] = left[7] - right[7];\r\n result[8] = left[8] - right[8];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix and a column vector.\r\n *\r\n * @param {Matrix3} matrix The matrix.\r\n * @param {Cartesian3} cartesian The column.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nMatrix3.multiplyByVector = function (matrix, cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const vX = cartesian.x;\r\n const vY = cartesian.y;\r\n const vZ = cartesian.z;\r\n\r\n const x = matrix[0] * vX + matrix[3] * vY + matrix[6] * vZ;\r\n const y = matrix[1] * vX + matrix[4] * vY + matrix[7] * vZ;\r\n const z = matrix[2] * vX + matrix[5] * vY + matrix[8] * vZ;\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix and a scalar.\r\n *\r\n * @param {Matrix3} matrix The matrix.\r\n * @param {Number} scalar The number to multiply by.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n */\r\nMatrix3.multiplyByScalar = function (matrix, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = matrix[0] * scalar;\r\n result[1] = matrix[1] * scalar;\r\n result[2] = matrix[2] * scalar;\r\n result[3] = matrix[3] * scalar;\r\n result[4] = matrix[4] * scalar;\r\n result[5] = matrix[5] * scalar;\r\n result[6] = matrix[6] * scalar;\r\n result[7] = matrix[7] * scalar;\r\n result[8] = matrix[8] * scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix times a (non-uniform) scale, as if the scale were a scale matrix.\r\n *\r\n * @param {Matrix3} matrix The matrix on the left-hand side.\r\n * @param {Number} scale The non-uniform scale on the right-hand side.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n *\r\n * @example\r\n * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromScale(scale), m);\r\n * Cesium.Matrix3.multiplyByScale(m, scale, m);\r\n *\r\n * @see Matrix3.multiplyByUniformScale\r\n * @see Matrix3.fromScale\r\n * @see Matrix3.fromUniformScale\r\n * @see Matrix3.setScale\r\n * @see Matrix3.setUniformScale\r\n * @see Matrix3.getScale\r\n */\r\nMatrix3.multiplyByScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = matrix[0] * scale.x;\r\n result[1] = matrix[1] * scale.x;\r\n result[2] = matrix[2] * scale.x;\r\n result[3] = matrix[3] * scale.y;\r\n result[4] = matrix[4] * scale.y;\r\n result[5] = matrix[5] * scale.y;\r\n result[6] = matrix[6] * scale.z;\r\n result[7] = matrix[7] * scale.z;\r\n result[8] = matrix[8] * scale.z;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the product of a matrix times a uniform scale, as if the scale were a scale matrix.\r\n *\r\n * @param {Matrix3} matrix The matrix on the left-hand side.\r\n * @param {Number} scale The uniform scale on the right-hand side.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n * @example\r\n * // Instead of Cesium.Matrix3.multiply(m, Cesium.Matrix3.fromUniformScale(scale), m);\r\n * Cesium.Matrix3.multiplyByUniformScale(m, scale, m);\r\n *\r\n * @see Matrix3.multiplyByScale\r\n * @see Matrix3.fromScale\r\n * @see Matrix3.fromUniformScale\r\n * @see Matrix3.setScale\r\n * @see Matrix3.setUniformScale\r\n * @see Matrix3.getScale\r\n */\r\nMatrix3.multiplyByUniformScale = function (matrix, scale, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.number(\"scale\", scale);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = matrix[0] * scale;\r\n result[1] = matrix[1] * scale;\r\n result[2] = matrix[2] * scale;\r\n result[3] = matrix[3] * scale;\r\n result[4] = matrix[4] * scale;\r\n result[5] = matrix[5] * scale;\r\n result[6] = matrix[6] * scale;\r\n result[7] = matrix[7] * scale;\r\n result[8] = matrix[8] * scale;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a negated copy of the provided matrix.\r\n *\r\n * @param {Matrix3} matrix The matrix to negate.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n */\r\nMatrix3.negate = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = -matrix[0];\r\n result[1] = -matrix[1];\r\n result[2] = -matrix[2];\r\n result[3] = -matrix[3];\r\n result[4] = -matrix[4];\r\n result[5] = -matrix[5];\r\n result[6] = -matrix[6];\r\n result[7] = -matrix[7];\r\n result[8] = -matrix[8];\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the transpose of the provided matrix.\r\n *\r\n * @param {Matrix3} matrix The matrix to transpose.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n */\r\nMatrix3.transpose = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const column0Row0 = matrix[0];\r\n const column0Row1 = matrix[3];\r\n const column0Row2 = matrix[6];\r\n const column1Row0 = matrix[1];\r\n const column1Row1 = matrix[4];\r\n const column1Row2 = matrix[7];\r\n const column2Row0 = matrix[2];\r\n const column2Row1 = matrix[5];\r\n const column2Row2 = matrix[8];\r\n\r\n result[0] = column0Row0;\r\n result[1] = column0Row1;\r\n result[2] = column0Row2;\r\n result[3] = column1Row0;\r\n result[4] = column1Row1;\r\n result[5] = column1Row2;\r\n result[6] = column2Row0;\r\n result[7] = column2Row1;\r\n result[8] = column2Row2;\r\n return result;\r\n};\r\n\r\nfunction computeFrobeniusNorm(matrix) {\r\n let norm = 0.0;\r\n for (let i = 0; i < 9; ++i) {\r\n const temp = matrix[i];\r\n norm += temp * temp;\r\n }\r\n\r\n return Math.sqrt(norm);\r\n}\r\n\r\nconst rowVal = [1, 0, 0];\r\nconst colVal = [2, 2, 1];\r\n\r\nfunction offDiagonalFrobeniusNorm(matrix) {\r\n // Computes the \"off-diagonal\" Frobenius norm.\r\n // Assumes matrix is symmetric.\r\n\r\n let norm = 0.0;\r\n for (let i = 0; i < 3; ++i) {\r\n const temp = matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])];\r\n norm += 2.0 * temp * temp;\r\n }\r\n\r\n return Math.sqrt(norm);\r\n}\r\n\r\nfunction shurDecomposition(matrix, result) {\r\n // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,\r\n // section 8.4.2 The 2by2 Symmetric Schur Decomposition.\r\n //\r\n // The routine takes a matrix, which is assumed to be symmetric, and\r\n // finds the largest off-diagonal term, and then creates\r\n // a matrix (result) which can be used to help reduce it\r\n\r\n const tolerance = CesiumMath.EPSILON15;\r\n\r\n let maxDiagonal = 0.0;\r\n let rotAxis = 1;\r\n\r\n // find pivot (rotAxis) based on max diagonal of matrix\r\n for (let i = 0; i < 3; ++i) {\r\n const temp = Math.abs(\r\n matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])]\r\n );\r\n if (temp > maxDiagonal) {\r\n rotAxis = i;\r\n maxDiagonal = temp;\r\n }\r\n }\r\n\r\n let c = 1.0;\r\n let s = 0.0;\r\n\r\n const p = rowVal[rotAxis];\r\n const q = colVal[rotAxis];\r\n\r\n if (Math.abs(matrix[Matrix3.getElementIndex(q, p)]) > tolerance) {\r\n const qq = matrix[Matrix3.getElementIndex(q, q)];\r\n const pp = matrix[Matrix3.getElementIndex(p, p)];\r\n const qp = matrix[Matrix3.getElementIndex(q, p)];\r\n\r\n const tau = (qq - pp) / 2.0 / qp;\r\n let t;\r\n\r\n if (tau < 0.0) {\r\n t = -1.0 / (-tau + Math.sqrt(1.0 + tau * tau));\r\n } else {\r\n t = 1.0 / (tau + Math.sqrt(1.0 + tau * tau));\r\n }\r\n\r\n c = 1.0 / Math.sqrt(1.0 + t * t);\r\n s = t * c;\r\n }\r\n\r\n result = Matrix3.clone(Matrix3.IDENTITY, result);\r\n\r\n result[Matrix3.getElementIndex(p, p)] = result[\r\n Matrix3.getElementIndex(q, q)\r\n ] = c;\r\n result[Matrix3.getElementIndex(q, p)] = s;\r\n result[Matrix3.getElementIndex(p, q)] = -s;\r\n\r\n return result;\r\n}\r\n\r\nconst jMatrix = new Matrix3();\r\nconst jMatrixTranspose = new Matrix3();\r\n\r\n/**\r\n * Computes the eigenvectors and eigenvalues of a symmetric matrix.\r\n * \r\n * Returns a diagonal matrix and unitary matrix such that:\r\n * matrix = unitary matrix * diagonal matrix * transpose(unitary matrix)
\r\n *
\r\n * \r\n * The values along the diagonal of the diagonal matrix are the eigenvalues. The columns\r\n * of the unitary matrix are the corresponding eigenvectors.\r\n *
\r\n *\r\n * @param {Matrix3} matrix The matrix to decompose into diagonal and unitary matrix. Expected to be symmetric.\r\n * @param {Object} [result] An object with unitary and diagonal properties which are matrices onto which to store the result.\r\n * @returns {Object} An object with unitary and diagonal properties which are the unitary and diagonal matrices, respectively.\r\n *\r\n * @example\r\n * const a = //... symetric matrix\r\n * const result = {\r\n * unitary : new Cesium.Matrix3(),\r\n * diagonal : new Cesium.Matrix3()\r\n * };\r\n * Cesium.Matrix3.computeEigenDecomposition(a, result);\r\n *\r\n * const unitaryTranspose = Cesium.Matrix3.transpose(result.unitary, new Cesium.Matrix3());\r\n * const b = Cesium.Matrix3.multiply(result.unitary, result.diagonal, new Cesium.Matrix3());\r\n * Cesium.Matrix3.multiply(b, unitaryTranspose, b); // b is now equal to a\r\n *\r\n * const lambda = Cesium.Matrix3.getColumn(result.diagonal, 0, new Cesium.Cartesian3()).x; // first eigenvalue\r\n * const v = Cesium.Matrix3.getColumn(result.unitary, 0, new Cesium.Cartesian3()); // first eigenvector\r\n * const c = Cesium.Cartesian3.multiplyByScalar(v, lambda, new Cesium.Cartesian3()); // equal to Cesium.Matrix3.multiplyByVector(a, v)\r\n */\r\nMatrix3.computeEigenDecomposition = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n //>>includeEnd('debug');\r\n\r\n // This routine was created based upon Matrix Computations, 3rd ed., by Golub and Van Loan,\r\n // section 8.4.3 The Classical Jacobi Algorithm\r\n\r\n const tolerance = CesiumMath.EPSILON20;\r\n const maxSweeps = 10;\r\n\r\n let count = 0;\r\n let sweep = 0;\r\n\r\n if (!defined(result)) {\r\n result = {};\r\n }\r\n\r\n const unitaryMatrix = (result.unitary = Matrix3.clone(\r\n Matrix3.IDENTITY,\r\n result.unitary\r\n ));\r\n const diagMatrix = (result.diagonal = Matrix3.clone(matrix, result.diagonal));\r\n\r\n const epsilon = tolerance * computeFrobeniusNorm(diagMatrix);\r\n\r\n while (sweep < maxSweeps && offDiagonalFrobeniusNorm(diagMatrix) > epsilon) {\r\n shurDecomposition(diagMatrix, jMatrix);\r\n Matrix3.transpose(jMatrix, jMatrixTranspose);\r\n Matrix3.multiply(diagMatrix, jMatrix, diagMatrix);\r\n Matrix3.multiply(jMatrixTranspose, diagMatrix, diagMatrix);\r\n Matrix3.multiply(unitaryMatrix, jMatrix, unitaryMatrix);\r\n\r\n if (++count > 2) {\r\n ++sweep;\r\n count = 0;\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a matrix, which contains the absolute (unsigned) values of the provided matrix's elements.\r\n *\r\n * @param {Matrix3} matrix The matrix with signed elements.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n */\r\nMatrix3.abs = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result[0] = Math.abs(matrix[0]);\r\n result[1] = Math.abs(matrix[1]);\r\n result[2] = Math.abs(matrix[2]);\r\n result[3] = Math.abs(matrix[3]);\r\n result[4] = Math.abs(matrix[4]);\r\n result[5] = Math.abs(matrix[5]);\r\n result[6] = Math.abs(matrix[6]);\r\n result[7] = Math.abs(matrix[7]);\r\n result[8] = Math.abs(matrix[8]);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the determinant of the provided matrix.\r\n *\r\n * @param {Matrix3} matrix The matrix to use.\r\n * @returns {Number} The value of the determinant of the matrix.\r\n */\r\nMatrix3.determinant = function (matrix) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n //>>includeEnd('debug');\r\n\r\n const m11 = matrix[0];\r\n const m21 = matrix[3];\r\n const m31 = matrix[6];\r\n const m12 = matrix[1];\r\n const m22 = matrix[4];\r\n const m32 = matrix[7];\r\n const m13 = matrix[2];\r\n const m23 = matrix[5];\r\n const m33 = matrix[8];\r\n\r\n return (\r\n m11 * (m22 * m33 - m23 * m32) +\r\n m12 * (m23 * m31 - m21 * m33) +\r\n m13 * (m21 * m32 - m22 * m31)\r\n );\r\n};\r\n\r\n/**\r\n * Computes the inverse of the provided matrix.\r\n *\r\n * @param {Matrix3} matrix The matrix to invert.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n *\r\n * @exception {DeveloperError} matrix is not invertible.\r\n */\r\nMatrix3.inverse = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const m11 = matrix[0];\r\n const m21 = matrix[1];\r\n const m31 = matrix[2];\r\n const m12 = matrix[3];\r\n const m22 = matrix[4];\r\n const m32 = matrix[5];\r\n const m13 = matrix[6];\r\n const m23 = matrix[7];\r\n const m33 = matrix[8];\r\n\r\n const determinant = Matrix3.determinant(matrix);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (Math.abs(determinant) <= CesiumMath.EPSILON15) {\r\n throw new DeveloperError(\"matrix is not invertible\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n result[0] = m22 * m33 - m23 * m32;\r\n result[1] = m23 * m31 - m21 * m33;\r\n result[2] = m21 * m32 - m22 * m31;\r\n result[3] = m13 * m32 - m12 * m33;\r\n result[4] = m11 * m33 - m13 * m31;\r\n result[5] = m12 * m31 - m11 * m32;\r\n result[6] = m12 * m23 - m13 * m22;\r\n result[7] = m13 * m21 - m11 * m23;\r\n result[8] = m11 * m22 - m12 * m21;\r\n\r\n const scale = 1.0 / determinant;\r\n return Matrix3.multiplyByScalar(result, scale, result);\r\n};\r\n\r\nconst scratchTransposeMatrix = new Matrix3();\r\n\r\n/**\r\n * Computes the inverse transpose of a matrix.\r\n *\r\n * @param {Matrix3} matrix The matrix to transpose and invert.\r\n * @param {Matrix3} result The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter.\r\n */\r\nMatrix3.inverseTranspose = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n return Matrix3.inverse(\r\n Matrix3.transpose(matrix, scratchTransposeMatrix),\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided matrices componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Matrix3} [left] The first matrix.\r\n * @param {Matrix3} [right] The second matrix.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nMatrix3.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left[0] === right[0] &&\r\n left[1] === right[1] &&\r\n left[2] === right[2] &&\r\n left[3] === right[3] &&\r\n left[4] === right[4] &&\r\n left[5] === right[5] &&\r\n left[6] === right[6] &&\r\n left[7] === right[7] &&\r\n left[8] === right[8])\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided matrices componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Matrix3} [left] The first matrix.\r\n * @param {Matrix3} [right] The second matrix.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nMatrix3.equalsEpsilon = function (left, right, epsilon) {\r\n epsilon = defaultValue(epsilon, 0);\r\n\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n Math.abs(left[0] - right[0]) <= epsilon &&\r\n Math.abs(left[1] - right[1]) <= epsilon &&\r\n Math.abs(left[2] - right[2]) <= epsilon &&\r\n Math.abs(left[3] - right[3]) <= epsilon &&\r\n Math.abs(left[4] - right[4]) <= epsilon &&\r\n Math.abs(left[5] - right[5]) <= epsilon &&\r\n Math.abs(left[6] - right[6]) <= epsilon &&\r\n Math.abs(left[7] - right[7]) <= epsilon &&\r\n Math.abs(left[8] - right[8]) <= epsilon)\r\n );\r\n};\r\n\r\n/**\r\n * An immutable Matrix3 instance initialized to the identity matrix.\r\n *\r\n * @type {Matrix3}\r\n * @constant\r\n */\r\nMatrix3.IDENTITY = Object.freeze(\r\n new Matrix3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)\r\n);\r\n\r\n/**\r\n * An immutable Matrix3 instance initialized to the zero matrix.\r\n *\r\n * @type {Matrix3}\r\n * @constant\r\n */\r\nMatrix3.ZERO = Object.freeze(\r\n new Matrix3(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)\r\n);\r\n\r\n/**\r\n * The index into Matrix3 for column 0, row 0.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix3.COLUMN0ROW0 = 0;\r\n\r\n/**\r\n * The index into Matrix3 for column 0, row 1.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix3.COLUMN0ROW1 = 1;\r\n\r\n/**\r\n * The index into Matrix3 for column 0, row 2.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix3.COLUMN0ROW2 = 2;\r\n\r\n/**\r\n * The index into Matrix3 for column 1, row 0.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix3.COLUMN1ROW0 = 3;\r\n\r\n/**\r\n * The index into Matrix3 for column 1, row 1.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix3.COLUMN1ROW1 = 4;\r\n\r\n/**\r\n * The index into Matrix3 for column 1, row 2.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix3.COLUMN1ROW2 = 5;\r\n\r\n/**\r\n * The index into Matrix3 for column 2, row 0.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix3.COLUMN2ROW0 = 6;\r\n\r\n/**\r\n * The index into Matrix3 for column 2, row 1.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix3.COLUMN2ROW1 = 7;\r\n\r\n/**\r\n * The index into Matrix3 for column 2, row 2.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\nMatrix3.COLUMN2ROW2 = 8;\r\n\r\nObject.defineProperties(Matrix3.prototype, {\r\n /**\r\n * Gets the number of items in the collection.\r\n * @memberof Matrix3.prototype\r\n *\r\n * @type {Number}\r\n */\r\n length: {\r\n get: function () {\r\n return Matrix3.packedLength;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Duplicates the provided Matrix3 instance.\r\n *\r\n * @param {Matrix3} [result] The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if one was not provided.\r\n */\r\nMatrix3.prototype.clone = function (result) {\r\n return Matrix3.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares this matrix to the provided matrix componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Matrix3} [right] The right hand side matrix.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nMatrix3.prototype.equals = function (right) {\r\n return Matrix3.equals(this, right);\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nMatrix3.equalsArray = function (matrix, array, offset) {\r\n return (\r\n matrix[0] === array[offset] &&\r\n matrix[1] === array[offset + 1] &&\r\n matrix[2] === array[offset + 2] &&\r\n matrix[3] === array[offset + 3] &&\r\n matrix[4] === array[offset + 4] &&\r\n matrix[5] === array[offset + 5] &&\r\n matrix[6] === array[offset + 6] &&\r\n matrix[7] === array[offset + 7] &&\r\n matrix[8] === array[offset + 8]\r\n );\r\n};\r\n\r\n/**\r\n * Compares this matrix to the provided matrix componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Matrix3} [right] The right hand side matrix.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.\r\n */\r\nMatrix3.prototype.equalsEpsilon = function (right, epsilon) {\r\n return Matrix3.equalsEpsilon(this, right, epsilon);\r\n};\r\n\r\n/**\r\n * Creates a string representing this Matrix with each row being\r\n * on a separate line and in the format '(column0, column1, column2)'.\r\n *\r\n * @returns {String} A string representing the provided Matrix with each row being on a separate line and in the format '(column0, column1, column2)'.\r\n */\r\nMatrix3.prototype.toString = function () {\r\n return (\r\n `(${this[0]}, ${this[3]}, ${this[6]})\\n` +\r\n `(${this[1]}, ${this[4]}, ${this[7]})\\n` +\r\n `(${this[2]}, ${this[5]}, ${this[8]})`\r\n );\r\n};\r\nexport default Matrix3;\r\n"],"names":["defaultValue","Check","defined","DeveloperError","CesiumMath","cartesianToCartographicN","cartesianToCartographicP","cartesianToCartographicH"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,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EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;EAC1D,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC;AACxB;EACA,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,SAAS,EAAE;EAC3C;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,MAAM,EAAE;EACV,IAAI,GAAG,EAAE,YAAY;EACrB,MAAM,OAAO,OAAO,CAAC,YAAY,CAAC;EAClC,KAAK;EACL,GAAG;EACH,CAAC,CAAC,CAAC;AACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,MAAM,EAAE;EAC5C,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;EACrC,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,CAAC,SAAS,CAAC,MAAM,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GAAG,YAAY;EACzC,EAAE;EACF,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;EAC5C,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;EAC5C,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;EAC1C,IAAI;EACJ,CAAC;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/OrientedBoundingBox-7e2eebab.js b/examples/cesium/Workers/OrientedBoundingBox-7e2eebab.js
new file mode 100644
index 0000000..f4893d0
--- /dev/null
+++ b/examples/cesium/Workers/OrientedBoundingBox-7e2eebab.js
@@ -0,0 +1,1283 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Transforms-11fb6b0a', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './EllipsoidTangentPlane-c421b2cb', './Math-9be8b918', './Plane-c9f1487d'], (function (exports, Transforms, Matrix2, Matrix3, Check, defaultValue, EllipsoidTangentPlane, Math$1, Plane) { 'use strict';
+
+ /**
+ * Creates an instance of an OrientedBoundingBox.
+ * An OrientedBoundingBox of some object is a closed and convex cuboid. It can provide a tighter bounding volume than {@link BoundingSphere} or {@link AxisAlignedBoundingBox} in many cases.
+ * @alias OrientedBoundingBox
+ * @constructor
+ *
+ * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the box.
+ * @param {Matrix3} [halfAxes=Matrix3.ZERO] The three orthogonal half-axes of the bounding box.
+ * Equivalently, the transformation matrix, to rotate and scale a 0x0x0
+ * cube centered at the origin.
+ *
+ *
+ * @example
+ * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.
+ * const center = new Cesium.Cartesian3(1.0, 0.0, 0.0);
+ * const halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());
+ *
+ * const obb = new Cesium.OrientedBoundingBox(center, halfAxes);
+ *
+ * @see BoundingSphere
+ * @see BoundingRectangle
+ */
+ function OrientedBoundingBox(center, halfAxes) {
+ /**
+ * The center of the box.
+ * @type {Cartesian3}
+ * @default {@link Cartesian3.ZERO}
+ */
+ this.center = Matrix3.Cartesian3.clone(defaultValue.defaultValue(center, Matrix3.Cartesian3.ZERO));
+ /**
+ * The transformation matrix, to rotate the box to the right position.
+ * @type {Matrix3}
+ * @default {@link Matrix3.ZERO}
+ */
+ this.halfAxes = Matrix3.Matrix3.clone(defaultValue.defaultValue(halfAxes, Matrix3.Matrix3.ZERO));
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ OrientedBoundingBox.packedLength =
+ Matrix3.Cartesian3.packedLength + Matrix3.Matrix3.packedLength;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {OrientedBoundingBox} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ OrientedBoundingBox.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ Matrix3.Cartesian3.pack(value.center, array, startingIndex);
+ Matrix3.Matrix3.pack(value.halfAxes, array, startingIndex + Matrix3.Cartesian3.packedLength);
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {OrientedBoundingBox} [result] The object into which to store the result.
+ * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
+ */
+ OrientedBoundingBox.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new OrientedBoundingBox();
+ }
+
+ Matrix3.Cartesian3.unpack(array, startingIndex, result.center);
+ Matrix3.Matrix3.unpack(
+ array,
+ startingIndex + Matrix3.Cartesian3.packedLength,
+ result.halfAxes
+ );
+ return result;
+ };
+
+ const scratchCartesian1 = new Matrix3.Cartesian3();
+ const scratchCartesian2 = new Matrix3.Cartesian3();
+ const scratchCartesian3 = new Matrix3.Cartesian3();
+ const scratchCartesian4 = new Matrix3.Cartesian3();
+ const scratchCartesian5 = new Matrix3.Cartesian3();
+ const scratchCartesian6 = new Matrix3.Cartesian3();
+ const scratchCovarianceResult = new Matrix3.Matrix3();
+ const scratchEigenResult = {
+ unitary: new Matrix3.Matrix3(),
+ diagonal: new Matrix3.Matrix3(),
+ };
+
+ /**
+ * Computes an instance of an OrientedBoundingBox of the given positions.
+ * This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).
+ * Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf
+ *
+ * @param {Cartesian3[]} [positions] List of {@link Cartesian3} points that the bounding box will enclose.
+ * @param {OrientedBoundingBox} [result] The object onto which to store the result.
+ * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
+ *
+ * @example
+ * // Compute an object oriented bounding box enclosing two points.
+ * const box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);
+ */
+ OrientedBoundingBox.fromPoints = function (positions, result) {
+ if (!defaultValue.defined(result)) {
+ result = new OrientedBoundingBox();
+ }
+
+ if (!defaultValue.defined(positions) || positions.length === 0) {
+ result.halfAxes = Matrix3.Matrix3.ZERO;
+ result.center = Matrix3.Cartesian3.ZERO;
+ return result;
+ }
+
+ let i;
+ const length = positions.length;
+
+ const meanPoint = Matrix3.Cartesian3.clone(positions[0], scratchCartesian1);
+ for (i = 1; i < length; i++) {
+ Matrix3.Cartesian3.add(meanPoint, positions[i], meanPoint);
+ }
+ const invLength = 1.0 / length;
+ Matrix3.Cartesian3.multiplyByScalar(meanPoint, invLength, meanPoint);
+
+ let exx = 0.0;
+ let exy = 0.0;
+ let exz = 0.0;
+ let eyy = 0.0;
+ let eyz = 0.0;
+ let ezz = 0.0;
+ let p;
+
+ for (i = 0; i < length; i++) {
+ p = Matrix3.Cartesian3.subtract(positions[i], meanPoint, scratchCartesian2);
+ exx += p.x * p.x;
+ exy += p.x * p.y;
+ exz += p.x * p.z;
+ eyy += p.y * p.y;
+ eyz += p.y * p.z;
+ ezz += p.z * p.z;
+ }
+
+ exx *= invLength;
+ exy *= invLength;
+ exz *= invLength;
+ eyy *= invLength;
+ eyz *= invLength;
+ ezz *= invLength;
+
+ const covarianceMatrix = scratchCovarianceResult;
+ covarianceMatrix[0] = exx;
+ covarianceMatrix[1] = exy;
+ covarianceMatrix[2] = exz;
+ covarianceMatrix[3] = exy;
+ covarianceMatrix[4] = eyy;
+ covarianceMatrix[5] = eyz;
+ covarianceMatrix[6] = exz;
+ covarianceMatrix[7] = eyz;
+ covarianceMatrix[8] = ezz;
+
+ const eigenDecomposition = Matrix3.Matrix3.computeEigenDecomposition(
+ covarianceMatrix,
+ scratchEigenResult
+ );
+ const rotation = Matrix3.Matrix3.clone(eigenDecomposition.unitary, result.halfAxes);
+
+ let v1 = Matrix3.Matrix3.getColumn(rotation, 0, scratchCartesian4);
+ let v2 = Matrix3.Matrix3.getColumn(rotation, 1, scratchCartesian5);
+ let v3 = Matrix3.Matrix3.getColumn(rotation, 2, scratchCartesian6);
+
+ let u1 = -Number.MAX_VALUE;
+ let u2 = -Number.MAX_VALUE;
+ let u3 = -Number.MAX_VALUE;
+ let l1 = Number.MAX_VALUE;
+ let l2 = Number.MAX_VALUE;
+ let l3 = Number.MAX_VALUE;
+
+ for (i = 0; i < length; i++) {
+ p = positions[i];
+ u1 = Math.max(Matrix3.Cartesian3.dot(v1, p), u1);
+ u2 = Math.max(Matrix3.Cartesian3.dot(v2, p), u2);
+ u3 = Math.max(Matrix3.Cartesian3.dot(v3, p), u3);
+
+ l1 = Math.min(Matrix3.Cartesian3.dot(v1, p), l1);
+ l2 = Math.min(Matrix3.Cartesian3.dot(v2, p), l2);
+ l3 = Math.min(Matrix3.Cartesian3.dot(v3, p), l3);
+ }
+
+ v1 = Matrix3.Cartesian3.multiplyByScalar(v1, 0.5 * (l1 + u1), v1);
+ v2 = Matrix3.Cartesian3.multiplyByScalar(v2, 0.5 * (l2 + u2), v2);
+ v3 = Matrix3.Cartesian3.multiplyByScalar(v3, 0.5 * (l3 + u3), v3);
+
+ const center = Matrix3.Cartesian3.add(v1, v2, result.center);
+ Matrix3.Cartesian3.add(center, v3, center);
+
+ const scale = scratchCartesian3;
+ scale.x = u1 - l1;
+ scale.y = u2 - l2;
+ scale.z = u3 - l3;
+ Matrix3.Cartesian3.multiplyByScalar(scale, 0.5, scale);
+ Matrix3.Matrix3.multiplyByScale(result.halfAxes, scale, result.halfAxes);
+
+ return result;
+ };
+
+ const scratchOffset = new Matrix3.Cartesian3();
+ const scratchScale = new Matrix3.Cartesian3();
+ function fromPlaneExtents(
+ planeOrigin,
+ planeXAxis,
+ planeYAxis,
+ planeZAxis,
+ minimumX,
+ maximumX,
+ minimumY,
+ maximumY,
+ minimumZ,
+ maximumZ,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (
+ !defaultValue.defined(minimumX) ||
+ !defaultValue.defined(maximumX) ||
+ !defaultValue.defined(minimumY) ||
+ !defaultValue.defined(maximumY) ||
+ !defaultValue.defined(minimumZ) ||
+ !defaultValue.defined(maximumZ)
+ ) {
+ throw new Check.DeveloperError(
+ "all extents (minimum/maximum X/Y/Z) are required."
+ );
+ }
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new OrientedBoundingBox();
+ }
+
+ const halfAxes = result.halfAxes;
+ Matrix3.Matrix3.setColumn(halfAxes, 0, planeXAxis, halfAxes);
+ Matrix3.Matrix3.setColumn(halfAxes, 1, planeYAxis, halfAxes);
+ Matrix3.Matrix3.setColumn(halfAxes, 2, planeZAxis, halfAxes);
+
+ let centerOffset = scratchOffset;
+ centerOffset.x = (minimumX + maximumX) / 2.0;
+ centerOffset.y = (minimumY + maximumY) / 2.0;
+ centerOffset.z = (minimumZ + maximumZ) / 2.0;
+
+ const scale = scratchScale;
+ scale.x = (maximumX - minimumX) / 2.0;
+ scale.y = (maximumY - minimumY) / 2.0;
+ scale.z = (maximumZ - minimumZ) / 2.0;
+
+ const center = result.center;
+ centerOffset = Matrix3.Matrix3.multiplyByVector(halfAxes, centerOffset, centerOffset);
+ Matrix3.Cartesian3.add(planeOrigin, centerOffset, center);
+ Matrix3.Matrix3.multiplyByScale(halfAxes, scale, halfAxes);
+
+ return result;
+ }
+
+ const scratchRectangleCenterCartographic = new Matrix3.Cartographic();
+ const scratchRectangleCenter = new Matrix3.Cartesian3();
+ const scratchPerimeterCartographicNC = new Matrix3.Cartographic();
+ const scratchPerimeterCartographicNW = new Matrix3.Cartographic();
+ const scratchPerimeterCartographicCW = new Matrix3.Cartographic();
+ const scratchPerimeterCartographicSW = new Matrix3.Cartographic();
+ const scratchPerimeterCartographicSC = new Matrix3.Cartographic();
+ const scratchPerimeterCartesianNC = new Matrix3.Cartesian3();
+ const scratchPerimeterCartesianNW = new Matrix3.Cartesian3();
+ const scratchPerimeterCartesianCW = new Matrix3.Cartesian3();
+ const scratchPerimeterCartesianSW = new Matrix3.Cartesian3();
+ const scratchPerimeterCartesianSC = new Matrix3.Cartesian3();
+ const scratchPerimeterProjectedNC = new Matrix2.Cartesian2();
+ const scratchPerimeterProjectedNW = new Matrix2.Cartesian2();
+ const scratchPerimeterProjectedCW = new Matrix2.Cartesian2();
+ const scratchPerimeterProjectedSW = new Matrix2.Cartesian2();
+ const scratchPerimeterProjectedSC = new Matrix2.Cartesian2();
+
+ const scratchPlaneOrigin = new Matrix3.Cartesian3();
+ const scratchPlaneNormal = new Matrix3.Cartesian3();
+ const scratchPlaneXAxis = new Matrix3.Cartesian3();
+ const scratchHorizonCartesian = new Matrix3.Cartesian3();
+ const scratchHorizonProjected = new Matrix2.Cartesian2();
+ const scratchMaxY = new Matrix3.Cartesian3();
+ const scratchMinY = new Matrix3.Cartesian3();
+ const scratchZ = new Matrix3.Cartesian3();
+ const scratchPlane = new Plane.Plane(Matrix3.Cartesian3.UNIT_X, 0.0);
+
+ /**
+ * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.
+ * There are no guarantees about the orientation of the bounding box.
+ *
+ * @param {Rectangle} rectangle The cartographic rectangle on the surface of the ellipsoid.
+ * @param {Number} [minimumHeight=0.0] The minimum height (elevation) within the tile.
+ * @param {Number} [maximumHeight=0.0] The maximum height (elevation) within the tile.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle is defined.
+ * @param {OrientedBoundingBox} [result] The object onto which to store the result.
+ * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided.
+ *
+ * @exception {DeveloperError} rectangle.width must be between 0 and pi.
+ * @exception {DeveloperError} rectangle.height must be between 0 and pi.
+ * @exception {DeveloperError} ellipsoid must be an ellipsoid of revolution (radii.x == radii.y
)
+ */
+ OrientedBoundingBox.fromRectangle = function (
+ rectangle,
+ minimumHeight,
+ maximumHeight,
+ ellipsoid,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(rectangle)) {
+ throw new Check.DeveloperError("rectangle is required");
+ }
+ if (rectangle.width < 0.0 || rectangle.width > Math$1.CesiumMath.TWO_PI) {
+ throw new Check.DeveloperError("Rectangle width must be between 0 and 2*pi");
+ }
+ if (rectangle.height < 0.0 || rectangle.height > Math$1.CesiumMath.PI) {
+ throw new Check.DeveloperError("Rectangle height must be between 0 and pi");
+ }
+ if (
+ defaultValue.defined(ellipsoid) &&
+ !Math$1.CesiumMath.equalsEpsilon(
+ ellipsoid.radii.x,
+ ellipsoid.radii.y,
+ Math$1.CesiumMath.EPSILON15
+ )
+ ) {
+ throw new Check.DeveloperError(
+ "Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)"
+ );
+ }
+ //>>includeEnd('debug');
+
+ minimumHeight = defaultValue.defaultValue(minimumHeight, 0.0);
+ maximumHeight = defaultValue.defaultValue(maximumHeight, 0.0);
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+
+ let minX, maxX, minY, maxY, minZ, maxZ, plane;
+
+ if (rectangle.width <= Math$1.CesiumMath.PI) {
+ // The bounding box will be aligned with the tangent plane at the center of the rectangle.
+ const tangentPointCartographic = Matrix2.Rectangle.center(
+ rectangle,
+ scratchRectangleCenterCartographic
+ );
+ const tangentPoint = ellipsoid.cartographicToCartesian(
+ tangentPointCartographic,
+ scratchRectangleCenter
+ );
+ const tangentPlane = new EllipsoidTangentPlane.EllipsoidTangentPlane(tangentPoint, ellipsoid);
+ plane = tangentPlane.plane;
+
+ // If the rectangle spans the equator, CW is instead aligned with the equator (because it sticks out the farthest at the equator).
+ const lonCenter = tangentPointCartographic.longitude;
+ const latCenter =
+ rectangle.south < 0.0 && rectangle.north > 0.0
+ ? 0.0
+ : tangentPointCartographic.latitude;
+
+ // Compute XY extents using the rectangle at maximum height
+ const perimeterCartographicNC = Matrix3.Cartographic.fromRadians(
+ lonCenter,
+ rectangle.north,
+ maximumHeight,
+ scratchPerimeterCartographicNC
+ );
+ const perimeterCartographicNW = Matrix3.Cartographic.fromRadians(
+ rectangle.west,
+ rectangle.north,
+ maximumHeight,
+ scratchPerimeterCartographicNW
+ );
+ const perimeterCartographicCW = Matrix3.Cartographic.fromRadians(
+ rectangle.west,
+ latCenter,
+ maximumHeight,
+ scratchPerimeterCartographicCW
+ );
+ const perimeterCartographicSW = Matrix3.Cartographic.fromRadians(
+ rectangle.west,
+ rectangle.south,
+ maximumHeight,
+ scratchPerimeterCartographicSW
+ );
+ const perimeterCartographicSC = Matrix3.Cartographic.fromRadians(
+ lonCenter,
+ rectangle.south,
+ maximumHeight,
+ scratchPerimeterCartographicSC
+ );
+
+ const perimeterCartesianNC = ellipsoid.cartographicToCartesian(
+ perimeterCartographicNC,
+ scratchPerimeterCartesianNC
+ );
+ let perimeterCartesianNW = ellipsoid.cartographicToCartesian(
+ perimeterCartographicNW,
+ scratchPerimeterCartesianNW
+ );
+ const perimeterCartesianCW = ellipsoid.cartographicToCartesian(
+ perimeterCartographicCW,
+ scratchPerimeterCartesianCW
+ );
+ let perimeterCartesianSW = ellipsoid.cartographicToCartesian(
+ perimeterCartographicSW,
+ scratchPerimeterCartesianSW
+ );
+ const perimeterCartesianSC = ellipsoid.cartographicToCartesian(
+ perimeterCartographicSC,
+ scratchPerimeterCartesianSC
+ );
+
+ const perimeterProjectedNC = tangentPlane.projectPointToNearestOnPlane(
+ perimeterCartesianNC,
+ scratchPerimeterProjectedNC
+ );
+ const perimeterProjectedNW = tangentPlane.projectPointToNearestOnPlane(
+ perimeterCartesianNW,
+ scratchPerimeterProjectedNW
+ );
+ const perimeterProjectedCW = tangentPlane.projectPointToNearestOnPlane(
+ perimeterCartesianCW,
+ scratchPerimeterProjectedCW
+ );
+ const perimeterProjectedSW = tangentPlane.projectPointToNearestOnPlane(
+ perimeterCartesianSW,
+ scratchPerimeterProjectedSW
+ );
+ const perimeterProjectedSC = tangentPlane.projectPointToNearestOnPlane(
+ perimeterCartesianSC,
+ scratchPerimeterProjectedSC
+ );
+
+ minX = Math.min(
+ perimeterProjectedNW.x,
+ perimeterProjectedCW.x,
+ perimeterProjectedSW.x
+ );
+ maxX = -minX; // symmetrical
+
+ maxY = Math.max(perimeterProjectedNW.y, perimeterProjectedNC.y);
+ minY = Math.min(perimeterProjectedSW.y, perimeterProjectedSC.y);
+
+ // Compute minimum Z using the rectangle at minimum height, since it will be deeper than the maximum height
+ perimeterCartographicNW.height = perimeterCartographicSW.height = minimumHeight;
+ perimeterCartesianNW = ellipsoid.cartographicToCartesian(
+ perimeterCartographicNW,
+ scratchPerimeterCartesianNW
+ );
+ perimeterCartesianSW = ellipsoid.cartographicToCartesian(
+ perimeterCartographicSW,
+ scratchPerimeterCartesianSW
+ );
+
+ minZ = Math.min(
+ Plane.Plane.getPointDistance(plane, perimeterCartesianNW),
+ Plane.Plane.getPointDistance(plane, perimeterCartesianSW)
+ );
+ maxZ = maximumHeight; // Since the tangent plane touches the surface at height = 0, this is okay
+
+ return fromPlaneExtents(
+ tangentPlane.origin,
+ tangentPlane.xAxis,
+ tangentPlane.yAxis,
+ tangentPlane.zAxis,
+ minX,
+ maxX,
+ minY,
+ maxY,
+ minZ,
+ maxZ,
+ result
+ );
+ }
+
+ // Handle the case where rectangle width is greater than PI (wraps around more than half the ellipsoid).
+ const fullyAboveEquator = rectangle.south > 0.0;
+ const fullyBelowEquator = rectangle.north < 0.0;
+ const latitudeNearestToEquator = fullyAboveEquator
+ ? rectangle.south
+ : fullyBelowEquator
+ ? rectangle.north
+ : 0.0;
+ const centerLongitude = Matrix2.Rectangle.center(
+ rectangle,
+ scratchRectangleCenterCartographic
+ ).longitude;
+
+ // Plane is located at the rectangle's center longitude and the rectangle's latitude that is closest to the equator. It rotates around the Z axis.
+ // This results in a better fit than the obb approach for smaller rectangles, which orients with the rectangle's center normal.
+ const planeOrigin = Matrix3.Cartesian3.fromRadians(
+ centerLongitude,
+ latitudeNearestToEquator,
+ maximumHeight,
+ ellipsoid,
+ scratchPlaneOrigin
+ );
+ planeOrigin.z = 0.0; // center the plane on the equator to simpify plane normal calculation
+ const isPole =
+ Math.abs(planeOrigin.x) < Math$1.CesiumMath.EPSILON10 &&
+ Math.abs(planeOrigin.y) < Math$1.CesiumMath.EPSILON10;
+ const planeNormal = !isPole
+ ? Matrix3.Cartesian3.normalize(planeOrigin, scratchPlaneNormal)
+ : Matrix3.Cartesian3.UNIT_X;
+ const planeYAxis = Matrix3.Cartesian3.UNIT_Z;
+ const planeXAxis = Matrix3.Cartesian3.cross(
+ planeNormal,
+ planeYAxis,
+ scratchPlaneXAxis
+ );
+ plane = Plane.Plane.fromPointNormal(planeOrigin, planeNormal, scratchPlane);
+
+ // Get the horizon point relative to the center. This will be the farthest extent in the plane's X dimension.
+ const horizonCartesian = Matrix3.Cartesian3.fromRadians(
+ centerLongitude + Math$1.CesiumMath.PI_OVER_TWO,
+ latitudeNearestToEquator,
+ maximumHeight,
+ ellipsoid,
+ scratchHorizonCartesian
+ );
+ maxX = Matrix3.Cartesian3.dot(
+ Plane.Plane.projectPointOntoPlane(
+ plane,
+ horizonCartesian,
+ scratchHorizonProjected
+ ),
+ planeXAxis
+ );
+ minX = -maxX; // symmetrical
+
+ // Get the min and max Y, using the height that will give the largest extent
+ maxY = Matrix3.Cartesian3.fromRadians(
+ 0.0,
+ rectangle.north,
+ fullyBelowEquator ? minimumHeight : maximumHeight,
+ ellipsoid,
+ scratchMaxY
+ ).z;
+ minY = Matrix3.Cartesian3.fromRadians(
+ 0.0,
+ rectangle.south,
+ fullyAboveEquator ? minimumHeight : maximumHeight,
+ ellipsoid,
+ scratchMinY
+ ).z;
+
+ const farZ = Matrix3.Cartesian3.fromRadians(
+ rectangle.east,
+ latitudeNearestToEquator,
+ maximumHeight,
+ ellipsoid,
+ scratchZ
+ );
+ minZ = Plane.Plane.getPointDistance(plane, farZ);
+ maxZ = 0.0; // plane origin starts at maxZ already
+
+ // min and max are local to the plane axes
+ return fromPlaneExtents(
+ planeOrigin,
+ planeXAxis,
+ planeYAxis,
+ planeNormal,
+ minX,
+ maxX,
+ minY,
+ maxY,
+ minZ,
+ maxZ,
+ result
+ );
+ };
+
+ /**
+ * Computes an OrientedBoundingBox that bounds an affine transformation.
+ *
+ * @param {Matrix4} transformation The affine transformation.
+ * @param {OrientedBoundingBox} [result] The object onto which to store the result.
+ * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided.
+ */
+ OrientedBoundingBox.fromTransformation = function (transformation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("transformation", transformation);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new OrientedBoundingBox();
+ }
+
+ result.center = Matrix2.Matrix4.getTranslation(transformation, result.center);
+ result.halfAxes = Matrix2.Matrix4.getMatrix3(transformation, result.halfAxes);
+ result.halfAxes = Matrix3.Matrix3.multiplyByScalar(
+ result.halfAxes,
+ 0.5,
+ result.halfAxes
+ );
+ return result;
+ };
+
+ /**
+ * Duplicates a OrientedBoundingBox instance.
+ *
+ * @param {OrientedBoundingBox} box The bounding box to duplicate.
+ * @param {OrientedBoundingBox} [result] The object onto which to store the result.
+ * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)
+ */
+ OrientedBoundingBox.clone = function (box, result) {
+ if (!defaultValue.defined(box)) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new OrientedBoundingBox(box.center, box.halfAxes);
+ }
+
+ Matrix3.Cartesian3.clone(box.center, result.center);
+ Matrix3.Matrix3.clone(box.halfAxes, result.halfAxes);
+
+ return result;
+ };
+
+ /**
+ * Determines which side of a plane the oriented bounding box is located.
+ *
+ * @param {OrientedBoundingBox} box The oriented bounding box to test.
+ * @param {Plane} plane The plane to test against.
+ * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
+ * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
+ * on the opposite side, and {@link Intersect.INTERSECTING} if the box
+ * intersects the plane.
+ */
+ OrientedBoundingBox.intersectPlane = function (box, plane) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(box)) {
+ throw new Check.DeveloperError("box is required.");
+ }
+
+ if (!defaultValue.defined(plane)) {
+ throw new Check.DeveloperError("plane is required.");
+ }
+ //>>includeEnd('debug');
+
+ const center = box.center;
+ const normal = plane.normal;
+ const halfAxes = box.halfAxes;
+ const normalX = normal.x,
+ normalY = normal.y,
+ normalZ = normal.z;
+ // plane is used as if it is its normal; the first three components are assumed to be normalized
+ const radEffective =
+ Math.abs(
+ normalX * halfAxes[Matrix3.Matrix3.COLUMN0ROW0] +
+ normalY * halfAxes[Matrix3.Matrix3.COLUMN0ROW1] +
+ normalZ * halfAxes[Matrix3.Matrix3.COLUMN0ROW2]
+ ) +
+ Math.abs(
+ normalX * halfAxes[Matrix3.Matrix3.COLUMN1ROW0] +
+ normalY * halfAxes[Matrix3.Matrix3.COLUMN1ROW1] +
+ normalZ * halfAxes[Matrix3.Matrix3.COLUMN1ROW2]
+ ) +
+ Math.abs(
+ normalX * halfAxes[Matrix3.Matrix3.COLUMN2ROW0] +
+ normalY * halfAxes[Matrix3.Matrix3.COLUMN2ROW1] +
+ normalZ * halfAxes[Matrix3.Matrix3.COLUMN2ROW2]
+ );
+ const distanceToPlane = Matrix3.Cartesian3.dot(normal, center) + plane.distance;
+
+ if (distanceToPlane <= -radEffective) {
+ // The entire box is on the negative side of the plane normal
+ return Transforms.Intersect.OUTSIDE;
+ } else if (distanceToPlane >= radEffective) {
+ // The entire box is on the positive side of the plane normal
+ return Transforms.Intersect.INSIDE;
+ }
+ return Transforms.Intersect.INTERSECTING;
+ };
+
+ const scratchCartesianU = new Matrix3.Cartesian3();
+ const scratchCartesianV = new Matrix3.Cartesian3();
+ const scratchCartesianW = new Matrix3.Cartesian3();
+ const scratchValidAxis2 = new Matrix3.Cartesian3();
+ const scratchValidAxis3 = new Matrix3.Cartesian3();
+ const scratchPPrime = new Matrix3.Cartesian3();
+
+ /**
+ * Computes the estimated distance squared from the closest point on a bounding box to a point.
+ *
+ * @param {OrientedBoundingBox} box The box.
+ * @param {Cartesian3} cartesian The point
+ * @returns {Number} The distance squared from the oriented bounding box to the point. Returns 0 if the point is inside the box.
+ *
+ * @example
+ * // Sort bounding boxes from back to front
+ * boxes.sort(function(a, b) {
+ * return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);
+ * });
+ */
+ OrientedBoundingBox.distanceSquaredTo = function (box, cartesian) {
+ // See Geometric Tools for Computer Graphics 10.4.2
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(box)) {
+ throw new Check.DeveloperError("box is required.");
+ }
+ if (!defaultValue.defined(cartesian)) {
+ throw new Check.DeveloperError("cartesian is required.");
+ }
+ //>>includeEnd('debug');
+
+ const offset = Matrix3.Cartesian3.subtract(cartesian, box.center, scratchOffset);
+
+ const halfAxes = box.halfAxes;
+ let u = Matrix3.Matrix3.getColumn(halfAxes, 0, scratchCartesianU);
+ let v = Matrix3.Matrix3.getColumn(halfAxes, 1, scratchCartesianV);
+ let w = Matrix3.Matrix3.getColumn(halfAxes, 2, scratchCartesianW);
+
+ const uHalf = Matrix3.Cartesian3.magnitude(u);
+ const vHalf = Matrix3.Cartesian3.magnitude(v);
+ const wHalf = Matrix3.Cartesian3.magnitude(w);
+
+ let uValid = true;
+ let vValid = true;
+ let wValid = true;
+
+ if (uHalf > 0) {
+ Matrix3.Cartesian3.divideByScalar(u, uHalf, u);
+ } else {
+ uValid = false;
+ }
+
+ if (vHalf > 0) {
+ Matrix3.Cartesian3.divideByScalar(v, vHalf, v);
+ } else {
+ vValid = false;
+ }
+
+ if (wHalf > 0) {
+ Matrix3.Cartesian3.divideByScalar(w, wHalf, w);
+ } else {
+ wValid = false;
+ }
+
+ const numberOfDegenerateAxes = !uValid + !vValid + !wValid;
+ let validAxis1;
+ let validAxis2;
+ let validAxis3;
+
+ if (numberOfDegenerateAxes === 1) {
+ let degenerateAxis = u;
+ validAxis1 = v;
+ validAxis2 = w;
+ if (!vValid) {
+ degenerateAxis = v;
+ validAxis1 = u;
+ } else if (!wValid) {
+ degenerateAxis = w;
+ validAxis2 = u;
+ }
+
+ validAxis3 = Matrix3.Cartesian3.cross(validAxis1, validAxis2, scratchValidAxis3);
+
+ if (degenerateAxis === u) {
+ u = validAxis3;
+ } else if (degenerateAxis === v) {
+ v = validAxis3;
+ } else if (degenerateAxis === w) {
+ w = validAxis3;
+ }
+ } else if (numberOfDegenerateAxes === 2) {
+ validAxis1 = u;
+ if (vValid) {
+ validAxis1 = v;
+ } else if (wValid) {
+ validAxis1 = w;
+ }
+
+ let crossVector = Matrix3.Cartesian3.UNIT_Y;
+ if (crossVector.equalsEpsilon(validAxis1, Math$1.CesiumMath.EPSILON3)) {
+ crossVector = Matrix3.Cartesian3.UNIT_X;
+ }
+
+ validAxis2 = Matrix3.Cartesian3.cross(validAxis1, crossVector, scratchValidAxis2);
+ Matrix3.Cartesian3.normalize(validAxis2, validAxis2);
+ validAxis3 = Matrix3.Cartesian3.cross(validAxis1, validAxis2, scratchValidAxis3);
+ Matrix3.Cartesian3.normalize(validAxis3, validAxis3);
+
+ if (validAxis1 === u) {
+ v = validAxis2;
+ w = validAxis3;
+ } else if (validAxis1 === v) {
+ w = validAxis2;
+ u = validAxis3;
+ } else if (validAxis1 === w) {
+ u = validAxis2;
+ v = validAxis3;
+ }
+ } else if (numberOfDegenerateAxes === 3) {
+ u = Matrix3.Cartesian3.UNIT_X;
+ v = Matrix3.Cartesian3.UNIT_Y;
+ w = Matrix3.Cartesian3.UNIT_Z;
+ }
+
+ const pPrime = scratchPPrime;
+ pPrime.x = Matrix3.Cartesian3.dot(offset, u);
+ pPrime.y = Matrix3.Cartesian3.dot(offset, v);
+ pPrime.z = Matrix3.Cartesian3.dot(offset, w);
+
+ let distanceSquared = 0.0;
+ let d;
+
+ if (pPrime.x < -uHalf) {
+ d = pPrime.x + uHalf;
+ distanceSquared += d * d;
+ } else if (pPrime.x > uHalf) {
+ d = pPrime.x - uHalf;
+ distanceSquared += d * d;
+ }
+
+ if (pPrime.y < -vHalf) {
+ d = pPrime.y + vHalf;
+ distanceSquared += d * d;
+ } else if (pPrime.y > vHalf) {
+ d = pPrime.y - vHalf;
+ distanceSquared += d * d;
+ }
+
+ if (pPrime.z < -wHalf) {
+ d = pPrime.z + wHalf;
+ distanceSquared += d * d;
+ } else if (pPrime.z > wHalf) {
+ d = pPrime.z - wHalf;
+ distanceSquared += d * d;
+ }
+
+ return distanceSquared;
+ };
+
+ const scratchCorner = new Matrix3.Cartesian3();
+ const scratchToCenter = new Matrix3.Cartesian3();
+
+ /**
+ * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
+ *
+ * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
+ * closest and farthest planes from position that intersect the bounding box.
+ *
+ * @param {OrientedBoundingBox} box The bounding box to calculate the distance to.
+ * @param {Cartesian3} position The position to calculate the distance from.
+ * @param {Cartesian3} direction The direction from position.
+ * @param {Interval} [result] A Interval to store the nearest and farthest distances.
+ * @returns {Interval} The nearest and farthest distances on the bounding box from position in direction.
+ */
+ OrientedBoundingBox.computePlaneDistances = function (
+ box,
+ position,
+ direction,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(box)) {
+ throw new Check.DeveloperError("box is required.");
+ }
+
+ if (!defaultValue.defined(position)) {
+ throw new Check.DeveloperError("position is required.");
+ }
+
+ if (!defaultValue.defined(direction)) {
+ throw new Check.DeveloperError("direction is required.");
+ }
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Transforms.Interval();
+ }
+
+ let minDist = Number.POSITIVE_INFINITY;
+ let maxDist = Number.NEGATIVE_INFINITY;
+
+ const center = box.center;
+ const halfAxes = box.halfAxes;
+
+ const u = Matrix3.Matrix3.getColumn(halfAxes, 0, scratchCartesianU);
+ const v = Matrix3.Matrix3.getColumn(halfAxes, 1, scratchCartesianV);
+ const w = Matrix3.Matrix3.getColumn(halfAxes, 2, scratchCartesianW);
+
+ // project first corner
+ const corner = Matrix3.Cartesian3.add(u, v, scratchCorner);
+ Matrix3.Cartesian3.add(corner, w, corner);
+ Matrix3.Cartesian3.add(corner, center, corner);
+
+ const toCenter = Matrix3.Cartesian3.subtract(corner, position, scratchToCenter);
+ let mag = Matrix3.Cartesian3.dot(direction, toCenter);
+
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+
+ // project second corner
+ Matrix3.Cartesian3.add(center, u, corner);
+ Matrix3.Cartesian3.add(corner, v, corner);
+ Matrix3.Cartesian3.subtract(corner, w, corner);
+
+ Matrix3.Cartesian3.subtract(corner, position, toCenter);
+ mag = Matrix3.Cartesian3.dot(direction, toCenter);
+
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+
+ // project third corner
+ Matrix3.Cartesian3.add(center, u, corner);
+ Matrix3.Cartesian3.subtract(corner, v, corner);
+ Matrix3.Cartesian3.add(corner, w, corner);
+
+ Matrix3.Cartesian3.subtract(corner, position, toCenter);
+ mag = Matrix3.Cartesian3.dot(direction, toCenter);
+
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+
+ // project fourth corner
+ Matrix3.Cartesian3.add(center, u, corner);
+ Matrix3.Cartesian3.subtract(corner, v, corner);
+ Matrix3.Cartesian3.subtract(corner, w, corner);
+
+ Matrix3.Cartesian3.subtract(corner, position, toCenter);
+ mag = Matrix3.Cartesian3.dot(direction, toCenter);
+
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+
+ // project fifth corner
+ Matrix3.Cartesian3.subtract(center, u, corner);
+ Matrix3.Cartesian3.add(corner, v, corner);
+ Matrix3.Cartesian3.add(corner, w, corner);
+
+ Matrix3.Cartesian3.subtract(corner, position, toCenter);
+ mag = Matrix3.Cartesian3.dot(direction, toCenter);
+
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+
+ // project sixth corner
+ Matrix3.Cartesian3.subtract(center, u, corner);
+ Matrix3.Cartesian3.add(corner, v, corner);
+ Matrix3.Cartesian3.subtract(corner, w, corner);
+
+ Matrix3.Cartesian3.subtract(corner, position, toCenter);
+ mag = Matrix3.Cartesian3.dot(direction, toCenter);
+
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+
+ // project seventh corner
+ Matrix3.Cartesian3.subtract(center, u, corner);
+ Matrix3.Cartesian3.subtract(corner, v, corner);
+ Matrix3.Cartesian3.add(corner, w, corner);
+
+ Matrix3.Cartesian3.subtract(corner, position, toCenter);
+ mag = Matrix3.Cartesian3.dot(direction, toCenter);
+
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+
+ // project eighth corner
+ Matrix3.Cartesian3.subtract(center, u, corner);
+ Matrix3.Cartesian3.subtract(corner, v, corner);
+ Matrix3.Cartesian3.subtract(corner, w, corner);
+
+ Matrix3.Cartesian3.subtract(corner, position, toCenter);
+ mag = Matrix3.Cartesian3.dot(direction, toCenter);
+
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+
+ result.start = minDist;
+ result.stop = maxDist;
+ return result;
+ };
+
+ const scratchXAxis = new Matrix3.Cartesian3();
+ const scratchYAxis = new Matrix3.Cartesian3();
+ const scratchZAxis = new Matrix3.Cartesian3();
+
+ /**
+ * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).
+ *
+ * @param {OrientedBoundingBox} box The oriented bounding box.
+ * @param {Cartesian3[]} [result] An array of eight {@link Cartesian3} instances onto which to store the corners.
+ * @returns {Cartesian3[]} The modified result parameter or a new array if none was provided.
+ */
+ OrientedBoundingBox.computeCorners = function (box, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("box", box);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = [
+ new Matrix3.Cartesian3(),
+ new Matrix3.Cartesian3(),
+ new Matrix3.Cartesian3(),
+ new Matrix3.Cartesian3(),
+ new Matrix3.Cartesian3(),
+ new Matrix3.Cartesian3(),
+ new Matrix3.Cartesian3(),
+ new Matrix3.Cartesian3(),
+ ];
+ }
+
+ const center = box.center;
+ const halfAxes = box.halfAxes;
+ const xAxis = Matrix3.Matrix3.getColumn(halfAxes, 0, scratchXAxis);
+ const yAxis = Matrix3.Matrix3.getColumn(halfAxes, 1, scratchYAxis);
+ const zAxis = Matrix3.Matrix3.getColumn(halfAxes, 2, scratchZAxis);
+
+ Matrix3.Cartesian3.clone(center, result[0]);
+ Matrix3.Cartesian3.subtract(result[0], xAxis, result[0]);
+ Matrix3.Cartesian3.subtract(result[0], yAxis, result[0]);
+ Matrix3.Cartesian3.subtract(result[0], zAxis, result[0]);
+
+ Matrix3.Cartesian3.clone(center, result[1]);
+ Matrix3.Cartesian3.subtract(result[1], xAxis, result[1]);
+ Matrix3.Cartesian3.subtract(result[1], yAxis, result[1]);
+ Matrix3.Cartesian3.add(result[1], zAxis, result[1]);
+
+ Matrix3.Cartesian3.clone(center, result[2]);
+ Matrix3.Cartesian3.subtract(result[2], xAxis, result[2]);
+ Matrix3.Cartesian3.add(result[2], yAxis, result[2]);
+ Matrix3.Cartesian3.subtract(result[2], zAxis, result[2]);
+
+ Matrix3.Cartesian3.clone(center, result[3]);
+ Matrix3.Cartesian3.subtract(result[3], xAxis, result[3]);
+ Matrix3.Cartesian3.add(result[3], yAxis, result[3]);
+ Matrix3.Cartesian3.add(result[3], zAxis, result[3]);
+
+ Matrix3.Cartesian3.clone(center, result[4]);
+ Matrix3.Cartesian3.add(result[4], xAxis, result[4]);
+ Matrix3.Cartesian3.subtract(result[4], yAxis, result[4]);
+ Matrix3.Cartesian3.subtract(result[4], zAxis, result[4]);
+
+ Matrix3.Cartesian3.clone(center, result[5]);
+ Matrix3.Cartesian3.add(result[5], xAxis, result[5]);
+ Matrix3.Cartesian3.subtract(result[5], yAxis, result[5]);
+ Matrix3.Cartesian3.add(result[5], zAxis, result[5]);
+
+ Matrix3.Cartesian3.clone(center, result[6]);
+ Matrix3.Cartesian3.add(result[6], xAxis, result[6]);
+ Matrix3.Cartesian3.add(result[6], yAxis, result[6]);
+ Matrix3.Cartesian3.subtract(result[6], zAxis, result[6]);
+
+ Matrix3.Cartesian3.clone(center, result[7]);
+ Matrix3.Cartesian3.add(result[7], xAxis, result[7]);
+ Matrix3.Cartesian3.add(result[7], yAxis, result[7]);
+ Matrix3.Cartesian3.add(result[7], zAxis, result[7]);
+
+ return result;
+ };
+
+ const scratchRotationScale = new Matrix3.Matrix3();
+
+ /**
+ * Computes a transformation matrix from an oriented bounding box.
+ *
+ * @param {OrientedBoundingBox} box The oriented bounding box.
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new {@link Matrix4} instance if none was provided.
+ */
+ OrientedBoundingBox.computeTransformation = function (box, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("box", box);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix2.Matrix4();
+ }
+
+ const translation = box.center;
+ const rotationScale = Matrix3.Matrix3.multiplyByUniformScale(
+ box.halfAxes,
+ 2.0,
+ scratchRotationScale
+ );
+ return Matrix2.Matrix4.fromRotationTranslation(rotationScale, translation, result);
+ };
+
+ const scratchBoundingSphere = new Transforms.BoundingSphere();
+
+ /**
+ * Determines whether or not a bounding box is hidden from view by the occluder.
+ *
+ * @param {OrientedBoundingBox} box The bounding box surrounding the occludee object.
+ * @param {Occluder} occluder The occluder.
+ * @returns {Boolean} true
if the box is not visible; otherwise false
.
+ */
+ OrientedBoundingBox.isOccluded = function (box, occluder) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(box)) {
+ throw new Check.DeveloperError("box is required.");
+ }
+ if (!defaultValue.defined(occluder)) {
+ throw new Check.DeveloperError("occluder is required.");
+ }
+ //>>includeEnd('debug');
+
+ const sphere = Transforms.BoundingSphere.fromOrientedBoundingBox(
+ box,
+ scratchBoundingSphere
+ );
+
+ return !occluder.isBoundingSphereVisible(sphere);
+ };
+
+ /**
+ * Determines which side of a plane the oriented bounding box is located.
+ *
+ * @param {Plane} plane The plane to test against.
+ * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
+ * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
+ * on the opposite side, and {@link Intersect.INTERSECTING} if the box
+ * intersects the plane.
+ */
+ OrientedBoundingBox.prototype.intersectPlane = function (plane) {
+ return OrientedBoundingBox.intersectPlane(this, plane);
+ };
+
+ /**
+ * Computes the estimated distance squared from the closest point on a bounding box to a point.
+ *
+ * @param {Cartesian3} cartesian The point
+ * @returns {Number} The estimated distance squared from the bounding sphere to the point.
+ *
+ * @example
+ * // Sort bounding boxes from back to front
+ * boxes.sort(function(a, b) {
+ * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
+ * });
+ */
+ OrientedBoundingBox.prototype.distanceSquaredTo = function (cartesian) {
+ return OrientedBoundingBox.distanceSquaredTo(this, cartesian);
+ };
+
+ /**
+ * The distances calculated by the vector from the center of the bounding box to position projected onto direction.
+ *
+ * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
+ * closest and farthest planes from position that intersect the bounding box.
+ *
+ * @param {Cartesian3} position The position to calculate the distance from.
+ * @param {Cartesian3} direction The direction from position.
+ * @param {Interval} [result] A Interval to store the nearest and farthest distances.
+ * @returns {Interval} The nearest and farthest distances on the bounding box from position in direction.
+ */
+ OrientedBoundingBox.prototype.computePlaneDistances = function (
+ position,
+ direction,
+ result
+ ) {
+ return OrientedBoundingBox.computePlaneDistances(
+ this,
+ position,
+ direction,
+ result
+ );
+ };
+
+ /**
+ * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).
+ *
+ * @param {Cartesian3[]} [result] An array of eight {@link Cartesian3} instances onto which to store the corners.
+ * @returns {Cartesian3[]} The modified result parameter or a new array if none was provided.
+ */
+ OrientedBoundingBox.prototype.computeCorners = function (result) {
+ return OrientedBoundingBox.computeCorners(this, result);
+ };
+
+ /**
+ * Computes a transformation matrix from an oriented bounding box.
+ *
+ * @param {Matrix4} result The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new {@link Matrix4} instance if none was provided.
+ */
+ OrientedBoundingBox.prototype.computeTransformation = function (result) {
+ return OrientedBoundingBox.computeTransformation(this, result);
+ };
+
+ /**
+ * Determines whether or not a bounding box is hidden from view by the occluder.
+ *
+ * @param {Occluder} occluder The occluder.
+ * @returns {Boolean} true
if the sphere is not visible; otherwise false
.
+ */
+ OrientedBoundingBox.prototype.isOccluded = function (occluder) {
+ return OrientedBoundingBox.isOccluded(this, occluder);
+ };
+
+ /**
+ * Compares the provided OrientedBoundingBox componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {OrientedBoundingBox} left The first OrientedBoundingBox.
+ * @param {OrientedBoundingBox} right The second OrientedBoundingBox.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ OrientedBoundingBox.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Matrix3.Cartesian3.equals(left.center, right.center) &&
+ Matrix3.Matrix3.equals(left.halfAxes, right.halfAxes))
+ );
+ };
+
+ /**
+ * Duplicates this OrientedBoundingBox instance.
+ *
+ * @param {OrientedBoundingBox} [result] The object onto which to store the result.
+ * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.
+ */
+ OrientedBoundingBox.prototype.clone = function (result) {
+ return OrientedBoundingBox.clone(this, result);
+ };
+
+ /**
+ * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {OrientedBoundingBox} [right] The right hand side OrientedBoundingBox.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ OrientedBoundingBox.prototype.equals = function (right) {
+ return OrientedBoundingBox.equals(this, right);
+ };
+
+ exports.OrientedBoundingBox = OrientedBoundingBox;
+
+}));
+//# sourceMappingURL=OrientedBoundingBox-7e2eebab.js.map
diff --git a/examples/cesium/Workers/OrientedBoundingBox-7e2eebab.js.map b/examples/cesium/Workers/OrientedBoundingBox-7e2eebab.js.map
new file mode 100644
index 0000000..a7e856a
--- /dev/null
+++ b/examples/cesium/Workers/OrientedBoundingBox-7e2eebab.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"OrientedBoundingBox-7e2eebab.js","sources":["../../../Source/Core/OrientedBoundingBox.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\r\nimport Intersect from \"./Intersect.js\";\r\nimport Interval from \"./Interval.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport Plane from \"./Plane.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\n\r\n/**\r\n * Creates an instance of an OrientedBoundingBox.\r\n * An OrientedBoundingBox of some object is a closed and convex cuboid. It can provide a tighter bounding volume than {@link BoundingSphere} or {@link AxisAlignedBoundingBox} in many cases.\r\n * @alias OrientedBoundingBox\r\n * @constructor\r\n *\r\n * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the box.\r\n * @param {Matrix3} [halfAxes=Matrix3.ZERO] The three orthogonal half-axes of the bounding box.\r\n * Equivalently, the transformation matrix, to rotate and scale a 0x0x0\r\n * cube centered at the origin.\r\n *\r\n *\r\n * @example\r\n * // Create an OrientedBoundingBox using a transformation matrix, a position where the box will be translated, and a scale.\r\n * const center = new Cesium.Cartesian3(1.0, 0.0, 0.0);\r\n * const halfAxes = Cesium.Matrix3.fromScale(new Cesium.Cartesian3(1.0, 3.0, 2.0), new Cesium.Matrix3());\r\n *\r\n * const obb = new Cesium.OrientedBoundingBox(center, halfAxes);\r\n *\r\n * @see BoundingSphere\r\n * @see BoundingRectangle\r\n */\r\nfunction OrientedBoundingBox(center, halfAxes) {\r\n /**\r\n * The center of the box.\r\n * @type {Cartesian3}\r\n * @default {@link Cartesian3.ZERO}\r\n */\r\n this.center = Cartesian3.clone(defaultValue(center, Cartesian3.ZERO));\r\n /**\r\n * The transformation matrix, to rotate the box to the right position.\r\n * @type {Matrix3}\r\n * @default {@link Matrix3.ZERO}\r\n */\r\n this.halfAxes = Matrix3.clone(defaultValue(halfAxes, Matrix3.ZERO));\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nOrientedBoundingBox.packedLength =\r\n Cartesian3.packedLength + Matrix3.packedLength;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {OrientedBoundingBox} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nOrientedBoundingBox.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n Cartesian3.pack(value.center, array, startingIndex);\r\n Matrix3.pack(value.halfAxes, array, startingIndex + Cartesian3.packedLength);\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {OrientedBoundingBox} [result] The object into which to store the result.\r\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.\r\n */\r\nOrientedBoundingBox.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new OrientedBoundingBox();\r\n }\r\n\r\n Cartesian3.unpack(array, startingIndex, result.center);\r\n Matrix3.unpack(\r\n array,\r\n startingIndex + Cartesian3.packedLength,\r\n result.halfAxes\r\n );\r\n return result;\r\n};\r\n\r\nconst scratchCartesian1 = new Cartesian3();\r\nconst scratchCartesian2 = new Cartesian3();\r\nconst scratchCartesian3 = new Cartesian3();\r\nconst scratchCartesian4 = new Cartesian3();\r\nconst scratchCartesian5 = new Cartesian3();\r\nconst scratchCartesian6 = new Cartesian3();\r\nconst scratchCovarianceResult = new Matrix3();\r\nconst scratchEigenResult = {\r\n unitary: new Matrix3(),\r\n diagonal: new Matrix3(),\r\n};\r\n\r\n/**\r\n * Computes an instance of an OrientedBoundingBox of the given positions.\r\n * This is an implementation of Stefan Gottschalk's Collision Queries using Oriented Bounding Boxes solution (PHD thesis).\r\n * Reference: http://gamma.cs.unc.edu/users/gottschalk/main.pdf\r\n *\r\n * @param {Cartesian3[]} [positions] List of {@link Cartesian3} points that the bounding box will enclose.\r\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\r\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.\r\n *\r\n * @example\r\n * // Compute an object oriented bounding box enclosing two points.\r\n * const box = Cesium.OrientedBoundingBox.fromPoints([new Cesium.Cartesian3(2, 0, 0), new Cesium.Cartesian3(-2, 0, 0)]);\r\n */\r\nOrientedBoundingBox.fromPoints = function (positions, result) {\r\n if (!defined(result)) {\r\n result = new OrientedBoundingBox();\r\n }\r\n\r\n if (!defined(positions) || positions.length === 0) {\r\n result.halfAxes = Matrix3.ZERO;\r\n result.center = Cartesian3.ZERO;\r\n return result;\r\n }\r\n\r\n let i;\r\n const length = positions.length;\r\n\r\n const meanPoint = Cartesian3.clone(positions[0], scratchCartesian1);\r\n for (i = 1; i < length; i++) {\r\n Cartesian3.add(meanPoint, positions[i], meanPoint);\r\n }\r\n const invLength = 1.0 / length;\r\n Cartesian3.multiplyByScalar(meanPoint, invLength, meanPoint);\r\n\r\n let exx = 0.0;\r\n let exy = 0.0;\r\n let exz = 0.0;\r\n let eyy = 0.0;\r\n let eyz = 0.0;\r\n let ezz = 0.0;\r\n let p;\r\n\r\n for (i = 0; i < length; i++) {\r\n p = Cartesian3.subtract(positions[i], meanPoint, scratchCartesian2);\r\n exx += p.x * p.x;\r\n exy += p.x * p.y;\r\n exz += p.x * p.z;\r\n eyy += p.y * p.y;\r\n eyz += p.y * p.z;\r\n ezz += p.z * p.z;\r\n }\r\n\r\n exx *= invLength;\r\n exy *= invLength;\r\n exz *= invLength;\r\n eyy *= invLength;\r\n eyz *= invLength;\r\n ezz *= invLength;\r\n\r\n const covarianceMatrix = scratchCovarianceResult;\r\n covarianceMatrix[0] = exx;\r\n covarianceMatrix[1] = exy;\r\n covarianceMatrix[2] = exz;\r\n covarianceMatrix[3] = exy;\r\n covarianceMatrix[4] = eyy;\r\n covarianceMatrix[5] = eyz;\r\n covarianceMatrix[6] = exz;\r\n covarianceMatrix[7] = eyz;\r\n covarianceMatrix[8] = ezz;\r\n\r\n const eigenDecomposition = Matrix3.computeEigenDecomposition(\r\n covarianceMatrix,\r\n scratchEigenResult\r\n );\r\n const rotation = Matrix3.clone(eigenDecomposition.unitary, result.halfAxes);\r\n\r\n let v1 = Matrix3.getColumn(rotation, 0, scratchCartesian4);\r\n let v2 = Matrix3.getColumn(rotation, 1, scratchCartesian5);\r\n let v3 = Matrix3.getColumn(rotation, 2, scratchCartesian6);\r\n\r\n let u1 = -Number.MAX_VALUE;\r\n let u2 = -Number.MAX_VALUE;\r\n let u3 = -Number.MAX_VALUE;\r\n let l1 = Number.MAX_VALUE;\r\n let l2 = Number.MAX_VALUE;\r\n let l3 = Number.MAX_VALUE;\r\n\r\n for (i = 0; i < length; i++) {\r\n p = positions[i];\r\n u1 = Math.max(Cartesian3.dot(v1, p), u1);\r\n u2 = Math.max(Cartesian3.dot(v2, p), u2);\r\n u3 = Math.max(Cartesian3.dot(v3, p), u3);\r\n\r\n l1 = Math.min(Cartesian3.dot(v1, p), l1);\r\n l2 = Math.min(Cartesian3.dot(v2, p), l2);\r\n l3 = Math.min(Cartesian3.dot(v3, p), l3);\r\n }\r\n\r\n v1 = Cartesian3.multiplyByScalar(v1, 0.5 * (l1 + u1), v1);\r\n v2 = Cartesian3.multiplyByScalar(v2, 0.5 * (l2 + u2), v2);\r\n v3 = Cartesian3.multiplyByScalar(v3, 0.5 * (l3 + u3), v3);\r\n\r\n const center = Cartesian3.add(v1, v2, result.center);\r\n Cartesian3.add(center, v3, center);\r\n\r\n const scale = scratchCartesian3;\r\n scale.x = u1 - l1;\r\n scale.y = u2 - l2;\r\n scale.z = u3 - l3;\r\n Cartesian3.multiplyByScalar(scale, 0.5, scale);\r\n Matrix3.multiplyByScale(result.halfAxes, scale, result.halfAxes);\r\n\r\n return result;\r\n};\r\n\r\nconst scratchOffset = new Cartesian3();\r\nconst scratchScale = new Cartesian3();\r\nfunction fromPlaneExtents(\r\n planeOrigin,\r\n planeXAxis,\r\n planeYAxis,\r\n planeZAxis,\r\n minimumX,\r\n maximumX,\r\n minimumY,\r\n maximumY,\r\n minimumZ,\r\n maximumZ,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n !defined(minimumX) ||\r\n !defined(maximumX) ||\r\n !defined(minimumY) ||\r\n !defined(maximumY) ||\r\n !defined(minimumZ) ||\r\n !defined(maximumZ)\r\n ) {\r\n throw new DeveloperError(\r\n \"all extents (minimum/maximum X/Y/Z) are required.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new OrientedBoundingBox();\r\n }\r\n\r\n const halfAxes = result.halfAxes;\r\n Matrix3.setColumn(halfAxes, 0, planeXAxis, halfAxes);\r\n Matrix3.setColumn(halfAxes, 1, planeYAxis, halfAxes);\r\n Matrix3.setColumn(halfAxes, 2, planeZAxis, halfAxes);\r\n\r\n let centerOffset = scratchOffset;\r\n centerOffset.x = (minimumX + maximumX) / 2.0;\r\n centerOffset.y = (minimumY + maximumY) / 2.0;\r\n centerOffset.z = (minimumZ + maximumZ) / 2.0;\r\n\r\n const scale = scratchScale;\r\n scale.x = (maximumX - minimumX) / 2.0;\r\n scale.y = (maximumY - minimumY) / 2.0;\r\n scale.z = (maximumZ - minimumZ) / 2.0;\r\n\r\n const center = result.center;\r\n centerOffset = Matrix3.multiplyByVector(halfAxes, centerOffset, centerOffset);\r\n Cartesian3.add(planeOrigin, centerOffset, center);\r\n Matrix3.multiplyByScale(halfAxes, scale, halfAxes);\r\n\r\n return result;\r\n}\r\n\r\nconst scratchRectangleCenterCartographic = new Cartographic();\r\nconst scratchRectangleCenter = new Cartesian3();\r\nconst scratchPerimeterCartographicNC = new Cartographic();\r\nconst scratchPerimeterCartographicNW = new Cartographic();\r\nconst scratchPerimeterCartographicCW = new Cartographic();\r\nconst scratchPerimeterCartographicSW = new Cartographic();\r\nconst scratchPerimeterCartographicSC = new Cartographic();\r\nconst scratchPerimeterCartesianNC = new Cartesian3();\r\nconst scratchPerimeterCartesianNW = new Cartesian3();\r\nconst scratchPerimeterCartesianCW = new Cartesian3();\r\nconst scratchPerimeterCartesianSW = new Cartesian3();\r\nconst scratchPerimeterCartesianSC = new Cartesian3();\r\nconst scratchPerimeterProjectedNC = new Cartesian2();\r\nconst scratchPerimeterProjectedNW = new Cartesian2();\r\nconst scratchPerimeterProjectedCW = new Cartesian2();\r\nconst scratchPerimeterProjectedSW = new Cartesian2();\r\nconst scratchPerimeterProjectedSC = new Cartesian2();\r\n\r\nconst scratchPlaneOrigin = new Cartesian3();\r\nconst scratchPlaneNormal = new Cartesian3();\r\nconst scratchPlaneXAxis = new Cartesian3();\r\nconst scratchHorizonCartesian = new Cartesian3();\r\nconst scratchHorizonProjected = new Cartesian2();\r\nconst scratchMaxY = new Cartesian3();\r\nconst scratchMinY = new Cartesian3();\r\nconst scratchZ = new Cartesian3();\r\nconst scratchPlane = new Plane(Cartesian3.UNIT_X, 0.0);\r\n\r\n/**\r\n * Computes an OrientedBoundingBox that bounds a {@link Rectangle} on the surface of an {@link Ellipsoid}.\r\n * There are no guarantees about the orientation of the bounding box.\r\n *\r\n * @param {Rectangle} rectangle The cartographic rectangle on the surface of the ellipsoid.\r\n * @param {Number} [minimumHeight=0.0] The minimum height (elevation) within the tile.\r\n * @param {Number} [maximumHeight=0.0] The maximum height (elevation) within the tile.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle is defined.\r\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\r\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided.\r\n *\r\n * @exception {DeveloperError} rectangle.width must be between 0 and pi.\r\n * @exception {DeveloperError} rectangle.height must be between 0 and pi.\r\n * @exception {DeveloperError} ellipsoid must be an ellipsoid of revolution (radii.x == radii.y
)\r\n */\r\nOrientedBoundingBox.fromRectangle = function (\r\n rectangle,\r\n minimumHeight,\r\n maximumHeight,\r\n ellipsoid,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(rectangle)) {\r\n throw new DeveloperError(\"rectangle is required\");\r\n }\r\n if (rectangle.width < 0.0 || rectangle.width > CesiumMath.TWO_PI) {\r\n throw new DeveloperError(\"Rectangle width must be between 0 and 2*pi\");\r\n }\r\n if (rectangle.height < 0.0 || rectangle.height > CesiumMath.PI) {\r\n throw new DeveloperError(\"Rectangle height must be between 0 and pi\");\r\n }\r\n if (\r\n defined(ellipsoid) &&\r\n !CesiumMath.equalsEpsilon(\r\n ellipsoid.radii.x,\r\n ellipsoid.radii.y,\r\n CesiumMath.EPSILON15\r\n )\r\n ) {\r\n throw new DeveloperError(\r\n \"Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n minimumHeight = defaultValue(minimumHeight, 0.0);\r\n maximumHeight = defaultValue(maximumHeight, 0.0);\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n\r\n let minX, maxX, minY, maxY, minZ, maxZ, plane;\r\n\r\n if (rectangle.width <= CesiumMath.PI) {\r\n // The bounding box will be aligned with the tangent plane at the center of the rectangle.\r\n const tangentPointCartographic = Rectangle.center(\r\n rectangle,\r\n scratchRectangleCenterCartographic\r\n );\r\n const tangentPoint = ellipsoid.cartographicToCartesian(\r\n tangentPointCartographic,\r\n scratchRectangleCenter\r\n );\r\n const tangentPlane = new EllipsoidTangentPlane(tangentPoint, ellipsoid);\r\n plane = tangentPlane.plane;\r\n\r\n // If the rectangle spans the equator, CW is instead aligned with the equator (because it sticks out the farthest at the equator).\r\n const lonCenter = tangentPointCartographic.longitude;\r\n const latCenter =\r\n rectangle.south < 0.0 && rectangle.north > 0.0\r\n ? 0.0\r\n : tangentPointCartographic.latitude;\r\n\r\n // Compute XY extents using the rectangle at maximum height\r\n const perimeterCartographicNC = Cartographic.fromRadians(\r\n lonCenter,\r\n rectangle.north,\r\n maximumHeight,\r\n scratchPerimeterCartographicNC\r\n );\r\n const perimeterCartographicNW = Cartographic.fromRadians(\r\n rectangle.west,\r\n rectangle.north,\r\n maximumHeight,\r\n scratchPerimeterCartographicNW\r\n );\r\n const perimeterCartographicCW = Cartographic.fromRadians(\r\n rectangle.west,\r\n latCenter,\r\n maximumHeight,\r\n scratchPerimeterCartographicCW\r\n );\r\n const perimeterCartographicSW = Cartographic.fromRadians(\r\n rectangle.west,\r\n rectangle.south,\r\n maximumHeight,\r\n scratchPerimeterCartographicSW\r\n );\r\n const perimeterCartographicSC = Cartographic.fromRadians(\r\n lonCenter,\r\n rectangle.south,\r\n maximumHeight,\r\n scratchPerimeterCartographicSC\r\n );\r\n\r\n const perimeterCartesianNC = ellipsoid.cartographicToCartesian(\r\n perimeterCartographicNC,\r\n scratchPerimeterCartesianNC\r\n );\r\n let perimeterCartesianNW = ellipsoid.cartographicToCartesian(\r\n perimeterCartographicNW,\r\n scratchPerimeterCartesianNW\r\n );\r\n const perimeterCartesianCW = ellipsoid.cartographicToCartesian(\r\n perimeterCartographicCW,\r\n scratchPerimeterCartesianCW\r\n );\r\n let perimeterCartesianSW = ellipsoid.cartographicToCartesian(\r\n perimeterCartographicSW,\r\n scratchPerimeterCartesianSW\r\n );\r\n const perimeterCartesianSC = ellipsoid.cartographicToCartesian(\r\n perimeterCartographicSC,\r\n scratchPerimeterCartesianSC\r\n );\r\n\r\n const perimeterProjectedNC = tangentPlane.projectPointToNearestOnPlane(\r\n perimeterCartesianNC,\r\n scratchPerimeterProjectedNC\r\n );\r\n const perimeterProjectedNW = tangentPlane.projectPointToNearestOnPlane(\r\n perimeterCartesianNW,\r\n scratchPerimeterProjectedNW\r\n );\r\n const perimeterProjectedCW = tangentPlane.projectPointToNearestOnPlane(\r\n perimeterCartesianCW,\r\n scratchPerimeterProjectedCW\r\n );\r\n const perimeterProjectedSW = tangentPlane.projectPointToNearestOnPlane(\r\n perimeterCartesianSW,\r\n scratchPerimeterProjectedSW\r\n );\r\n const perimeterProjectedSC = tangentPlane.projectPointToNearestOnPlane(\r\n perimeterCartesianSC,\r\n scratchPerimeterProjectedSC\r\n );\r\n\r\n minX = Math.min(\r\n perimeterProjectedNW.x,\r\n perimeterProjectedCW.x,\r\n perimeterProjectedSW.x\r\n );\r\n maxX = -minX; // symmetrical\r\n\r\n maxY = Math.max(perimeterProjectedNW.y, perimeterProjectedNC.y);\r\n minY = Math.min(perimeterProjectedSW.y, perimeterProjectedSC.y);\r\n\r\n // Compute minimum Z using the rectangle at minimum height, since it will be deeper than the maximum height\r\n perimeterCartographicNW.height = perimeterCartographicSW.height = minimumHeight;\r\n perimeterCartesianNW = ellipsoid.cartographicToCartesian(\r\n perimeterCartographicNW,\r\n scratchPerimeterCartesianNW\r\n );\r\n perimeterCartesianSW = ellipsoid.cartographicToCartesian(\r\n perimeterCartographicSW,\r\n scratchPerimeterCartesianSW\r\n );\r\n\r\n minZ = Math.min(\r\n Plane.getPointDistance(plane, perimeterCartesianNW),\r\n Plane.getPointDistance(plane, perimeterCartesianSW)\r\n );\r\n maxZ = maximumHeight; // Since the tangent plane touches the surface at height = 0, this is okay\r\n\r\n return fromPlaneExtents(\r\n tangentPlane.origin,\r\n tangentPlane.xAxis,\r\n tangentPlane.yAxis,\r\n tangentPlane.zAxis,\r\n minX,\r\n maxX,\r\n minY,\r\n maxY,\r\n minZ,\r\n maxZ,\r\n result\r\n );\r\n }\r\n\r\n // Handle the case where rectangle width is greater than PI (wraps around more than half the ellipsoid).\r\n const fullyAboveEquator = rectangle.south > 0.0;\r\n const fullyBelowEquator = rectangle.north < 0.0;\r\n const latitudeNearestToEquator = fullyAboveEquator\r\n ? rectangle.south\r\n : fullyBelowEquator\r\n ? rectangle.north\r\n : 0.0;\r\n const centerLongitude = Rectangle.center(\r\n rectangle,\r\n scratchRectangleCenterCartographic\r\n ).longitude;\r\n\r\n // Plane is located at the rectangle's center longitude and the rectangle's latitude that is closest to the equator. It rotates around the Z axis.\r\n // This results in a better fit than the obb approach for smaller rectangles, which orients with the rectangle's center normal.\r\n const planeOrigin = Cartesian3.fromRadians(\r\n centerLongitude,\r\n latitudeNearestToEquator,\r\n maximumHeight,\r\n ellipsoid,\r\n scratchPlaneOrigin\r\n );\r\n planeOrigin.z = 0.0; // center the plane on the equator to simpify plane normal calculation\r\n const isPole =\r\n Math.abs(planeOrigin.x) < CesiumMath.EPSILON10 &&\r\n Math.abs(planeOrigin.y) < CesiumMath.EPSILON10;\r\n const planeNormal = !isPole\r\n ? Cartesian3.normalize(planeOrigin, scratchPlaneNormal)\r\n : Cartesian3.UNIT_X;\r\n const planeYAxis = Cartesian3.UNIT_Z;\r\n const planeXAxis = Cartesian3.cross(\r\n planeNormal,\r\n planeYAxis,\r\n scratchPlaneXAxis\r\n );\r\n plane = Plane.fromPointNormal(planeOrigin, planeNormal, scratchPlane);\r\n\r\n // Get the horizon point relative to the center. This will be the farthest extent in the plane's X dimension.\r\n const horizonCartesian = Cartesian3.fromRadians(\r\n centerLongitude + CesiumMath.PI_OVER_TWO,\r\n latitudeNearestToEquator,\r\n maximumHeight,\r\n ellipsoid,\r\n scratchHorizonCartesian\r\n );\r\n maxX = Cartesian3.dot(\r\n Plane.projectPointOntoPlane(\r\n plane,\r\n horizonCartesian,\r\n scratchHorizonProjected\r\n ),\r\n planeXAxis\r\n );\r\n minX = -maxX; // symmetrical\r\n\r\n // Get the min and max Y, using the height that will give the largest extent\r\n maxY = Cartesian3.fromRadians(\r\n 0.0,\r\n rectangle.north,\r\n fullyBelowEquator ? minimumHeight : maximumHeight,\r\n ellipsoid,\r\n scratchMaxY\r\n ).z;\r\n minY = Cartesian3.fromRadians(\r\n 0.0,\r\n rectangle.south,\r\n fullyAboveEquator ? minimumHeight : maximumHeight,\r\n ellipsoid,\r\n scratchMinY\r\n ).z;\r\n\r\n const farZ = Cartesian3.fromRadians(\r\n rectangle.east,\r\n latitudeNearestToEquator,\r\n maximumHeight,\r\n ellipsoid,\r\n scratchZ\r\n );\r\n minZ = Plane.getPointDistance(plane, farZ);\r\n maxZ = 0.0; // plane origin starts at maxZ already\r\n\r\n // min and max are local to the plane axes\r\n return fromPlaneExtents(\r\n planeOrigin,\r\n planeXAxis,\r\n planeYAxis,\r\n planeNormal,\r\n minX,\r\n maxX,\r\n minY,\r\n maxY,\r\n minZ,\r\n maxZ,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Computes an OrientedBoundingBox that bounds an affine transformation.\r\n *\r\n * @param {Matrix4} transformation The affine transformation.\r\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\r\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided.\r\n */\r\nOrientedBoundingBox.fromTransformation = function (transformation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"transformation\", transformation);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new OrientedBoundingBox();\r\n }\r\n\r\n result.center = Matrix4.getTranslation(transformation, result.center);\r\n result.halfAxes = Matrix4.getMatrix3(transformation, result.halfAxes);\r\n result.halfAxes = Matrix3.multiplyByScalar(\r\n result.halfAxes,\r\n 0.5,\r\n result.halfAxes\r\n );\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a OrientedBoundingBox instance.\r\n *\r\n * @param {OrientedBoundingBox} box The bounding box to duplicate.\r\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\r\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if none was provided. (Returns undefined if box is undefined)\r\n */\r\nOrientedBoundingBox.clone = function (box, result) {\r\n if (!defined(box)) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new OrientedBoundingBox(box.center, box.halfAxes);\r\n }\r\n\r\n Cartesian3.clone(box.center, result.center);\r\n Matrix3.clone(box.halfAxes, result.halfAxes);\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Determines which side of a plane the oriented bounding box is located.\r\n *\r\n * @param {OrientedBoundingBox} box The oriented bounding box to test.\r\n * @param {Plane} plane The plane to test against.\r\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\r\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\r\n * on the opposite side, and {@link Intersect.INTERSECTING} if the box\r\n * intersects the plane.\r\n */\r\nOrientedBoundingBox.intersectPlane = function (box, plane) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(box)) {\r\n throw new DeveloperError(\"box is required.\");\r\n }\r\n\r\n if (!defined(plane)) {\r\n throw new DeveloperError(\"plane is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const center = box.center;\r\n const normal = plane.normal;\r\n const halfAxes = box.halfAxes;\r\n const normalX = normal.x,\r\n normalY = normal.y,\r\n normalZ = normal.z;\r\n // plane is used as if it is its normal; the first three components are assumed to be normalized\r\n const radEffective =\r\n Math.abs(\r\n normalX * halfAxes[Matrix3.COLUMN0ROW0] +\r\n normalY * halfAxes[Matrix3.COLUMN0ROW1] +\r\n normalZ * halfAxes[Matrix3.COLUMN0ROW2]\r\n ) +\r\n Math.abs(\r\n normalX * halfAxes[Matrix3.COLUMN1ROW0] +\r\n normalY * halfAxes[Matrix3.COLUMN1ROW1] +\r\n normalZ * halfAxes[Matrix3.COLUMN1ROW2]\r\n ) +\r\n Math.abs(\r\n normalX * halfAxes[Matrix3.COLUMN2ROW0] +\r\n normalY * halfAxes[Matrix3.COLUMN2ROW1] +\r\n normalZ * halfAxes[Matrix3.COLUMN2ROW2]\r\n );\r\n const distanceToPlane = Cartesian3.dot(normal, center) + plane.distance;\r\n\r\n if (distanceToPlane <= -radEffective) {\r\n // The entire box is on the negative side of the plane normal\r\n return Intersect.OUTSIDE;\r\n } else if (distanceToPlane >= radEffective) {\r\n // The entire box is on the positive side of the plane normal\r\n return Intersect.INSIDE;\r\n }\r\n return Intersect.INTERSECTING;\r\n};\r\n\r\nconst scratchCartesianU = new Cartesian3();\r\nconst scratchCartesianV = new Cartesian3();\r\nconst scratchCartesianW = new Cartesian3();\r\nconst scratchValidAxis2 = new Cartesian3();\r\nconst scratchValidAxis3 = new Cartesian3();\r\nconst scratchPPrime = new Cartesian3();\r\n\r\n/**\r\n * Computes the estimated distance squared from the closest point on a bounding box to a point.\r\n *\r\n * @param {OrientedBoundingBox} box The box.\r\n * @param {Cartesian3} cartesian The point\r\n * @returns {Number} The distance squared from the oriented bounding box to the point. Returns 0 if the point is inside the box.\r\n *\r\n * @example\r\n * // Sort bounding boxes from back to front\r\n * boxes.sort(function(a, b) {\r\n * return Cesium.OrientedBoundingBox.distanceSquaredTo(b, camera.positionWC) - Cesium.OrientedBoundingBox.distanceSquaredTo(a, camera.positionWC);\r\n * });\r\n */\r\nOrientedBoundingBox.distanceSquaredTo = function (box, cartesian) {\r\n // See Geometric Tools for Computer Graphics 10.4.2\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(box)) {\r\n throw new DeveloperError(\"box is required.\");\r\n }\r\n if (!defined(cartesian)) {\r\n throw new DeveloperError(\"cartesian is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const offset = Cartesian3.subtract(cartesian, box.center, scratchOffset);\r\n\r\n const halfAxes = box.halfAxes;\r\n let u = Matrix3.getColumn(halfAxes, 0, scratchCartesianU);\r\n let v = Matrix3.getColumn(halfAxes, 1, scratchCartesianV);\r\n let w = Matrix3.getColumn(halfAxes, 2, scratchCartesianW);\r\n\r\n const uHalf = Cartesian3.magnitude(u);\r\n const vHalf = Cartesian3.magnitude(v);\r\n const wHalf = Cartesian3.magnitude(w);\r\n\r\n let uValid = true;\r\n let vValid = true;\r\n let wValid = true;\r\n\r\n if (uHalf > 0) {\r\n Cartesian3.divideByScalar(u, uHalf, u);\r\n } else {\r\n uValid = false;\r\n }\r\n\r\n if (vHalf > 0) {\r\n Cartesian3.divideByScalar(v, vHalf, v);\r\n } else {\r\n vValid = false;\r\n }\r\n\r\n if (wHalf > 0) {\r\n Cartesian3.divideByScalar(w, wHalf, w);\r\n } else {\r\n wValid = false;\r\n }\r\n\r\n const numberOfDegenerateAxes = !uValid + !vValid + !wValid;\r\n let validAxis1;\r\n let validAxis2;\r\n let validAxis3;\r\n\r\n if (numberOfDegenerateAxes === 1) {\r\n let degenerateAxis = u;\r\n validAxis1 = v;\r\n validAxis2 = w;\r\n if (!vValid) {\r\n degenerateAxis = v;\r\n validAxis1 = u;\r\n } else if (!wValid) {\r\n degenerateAxis = w;\r\n validAxis2 = u;\r\n }\r\n\r\n validAxis3 = Cartesian3.cross(validAxis1, validAxis2, scratchValidAxis3);\r\n\r\n if (degenerateAxis === u) {\r\n u = validAxis3;\r\n } else if (degenerateAxis === v) {\r\n v = validAxis3;\r\n } else if (degenerateAxis === w) {\r\n w = validAxis3;\r\n }\r\n } else if (numberOfDegenerateAxes === 2) {\r\n validAxis1 = u;\r\n if (vValid) {\r\n validAxis1 = v;\r\n } else if (wValid) {\r\n validAxis1 = w;\r\n }\r\n\r\n let crossVector = Cartesian3.UNIT_Y;\r\n if (crossVector.equalsEpsilon(validAxis1, CesiumMath.EPSILON3)) {\r\n crossVector = Cartesian3.UNIT_X;\r\n }\r\n\r\n validAxis2 = Cartesian3.cross(validAxis1, crossVector, scratchValidAxis2);\r\n Cartesian3.normalize(validAxis2, validAxis2);\r\n validAxis3 = Cartesian3.cross(validAxis1, validAxis2, scratchValidAxis3);\r\n Cartesian3.normalize(validAxis3, validAxis3);\r\n\r\n if (validAxis1 === u) {\r\n v = validAxis2;\r\n w = validAxis3;\r\n } else if (validAxis1 === v) {\r\n w = validAxis2;\r\n u = validAxis3;\r\n } else if (validAxis1 === w) {\r\n u = validAxis2;\r\n v = validAxis3;\r\n }\r\n } else if (numberOfDegenerateAxes === 3) {\r\n u = Cartesian3.UNIT_X;\r\n v = Cartesian3.UNIT_Y;\r\n w = Cartesian3.UNIT_Z;\r\n }\r\n\r\n const pPrime = scratchPPrime;\r\n pPrime.x = Cartesian3.dot(offset, u);\r\n pPrime.y = Cartesian3.dot(offset, v);\r\n pPrime.z = Cartesian3.dot(offset, w);\r\n\r\n let distanceSquared = 0.0;\r\n let d;\r\n\r\n if (pPrime.x < -uHalf) {\r\n d = pPrime.x + uHalf;\r\n distanceSquared += d * d;\r\n } else if (pPrime.x > uHalf) {\r\n d = pPrime.x - uHalf;\r\n distanceSquared += d * d;\r\n }\r\n\r\n if (pPrime.y < -vHalf) {\r\n d = pPrime.y + vHalf;\r\n distanceSquared += d * d;\r\n } else if (pPrime.y > vHalf) {\r\n d = pPrime.y - vHalf;\r\n distanceSquared += d * d;\r\n }\r\n\r\n if (pPrime.z < -wHalf) {\r\n d = pPrime.z + wHalf;\r\n distanceSquared += d * d;\r\n } else if (pPrime.z > wHalf) {\r\n d = pPrime.z - wHalf;\r\n distanceSquared += d * d;\r\n }\r\n\r\n return distanceSquared;\r\n};\r\n\r\nconst scratchCorner = new Cartesian3();\r\nconst scratchToCenter = new Cartesian3();\r\n\r\n/**\r\n * The distances calculated by the vector from the center of the bounding box to position projected onto direction.\r\n *
\r\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\r\n * closest and farthest planes from position that intersect the bounding box.\r\n *\r\n * @param {OrientedBoundingBox} box The bounding box to calculate the distance to.\r\n * @param {Cartesian3} position The position to calculate the distance from.\r\n * @param {Cartesian3} direction The direction from position.\r\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\r\n * @returns {Interval} The nearest and farthest distances on the bounding box from position in direction.\r\n */\r\nOrientedBoundingBox.computePlaneDistances = function (\r\n box,\r\n position,\r\n direction,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(box)) {\r\n throw new DeveloperError(\"box is required.\");\r\n }\r\n\r\n if (!defined(position)) {\r\n throw new DeveloperError(\"position is required.\");\r\n }\r\n\r\n if (!defined(direction)) {\r\n throw new DeveloperError(\"direction is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Interval();\r\n }\r\n\r\n let minDist = Number.POSITIVE_INFINITY;\r\n let maxDist = Number.NEGATIVE_INFINITY;\r\n\r\n const center = box.center;\r\n const halfAxes = box.halfAxes;\r\n\r\n const u = Matrix3.getColumn(halfAxes, 0, scratchCartesianU);\r\n const v = Matrix3.getColumn(halfAxes, 1, scratchCartesianV);\r\n const w = Matrix3.getColumn(halfAxes, 2, scratchCartesianW);\r\n\r\n // project first corner\r\n const corner = Cartesian3.add(u, v, scratchCorner);\r\n Cartesian3.add(corner, w, corner);\r\n Cartesian3.add(corner, center, corner);\r\n\r\n const toCenter = Cartesian3.subtract(corner, position, scratchToCenter);\r\n let mag = Cartesian3.dot(direction, toCenter);\r\n\r\n minDist = Math.min(mag, minDist);\r\n maxDist = Math.max(mag, maxDist);\r\n\r\n // project second corner\r\n Cartesian3.add(center, u, corner);\r\n Cartesian3.add(corner, v, corner);\r\n Cartesian3.subtract(corner, w, corner);\r\n\r\n Cartesian3.subtract(corner, position, toCenter);\r\n mag = Cartesian3.dot(direction, toCenter);\r\n\r\n minDist = Math.min(mag, minDist);\r\n maxDist = Math.max(mag, maxDist);\r\n\r\n // project third corner\r\n Cartesian3.add(center, u, corner);\r\n Cartesian3.subtract(corner, v, corner);\r\n Cartesian3.add(corner, w, corner);\r\n\r\n Cartesian3.subtract(corner, position, toCenter);\r\n mag = Cartesian3.dot(direction, toCenter);\r\n\r\n minDist = Math.min(mag, minDist);\r\n maxDist = Math.max(mag, maxDist);\r\n\r\n // project fourth corner\r\n Cartesian3.add(center, u, corner);\r\n Cartesian3.subtract(corner, v, corner);\r\n Cartesian3.subtract(corner, w, corner);\r\n\r\n Cartesian3.subtract(corner, position, toCenter);\r\n mag = Cartesian3.dot(direction, toCenter);\r\n\r\n minDist = Math.min(mag, minDist);\r\n maxDist = Math.max(mag, maxDist);\r\n\r\n // project fifth corner\r\n Cartesian3.subtract(center, u, corner);\r\n Cartesian3.add(corner, v, corner);\r\n Cartesian3.add(corner, w, corner);\r\n\r\n Cartesian3.subtract(corner, position, toCenter);\r\n mag = Cartesian3.dot(direction, toCenter);\r\n\r\n minDist = Math.min(mag, minDist);\r\n maxDist = Math.max(mag, maxDist);\r\n\r\n // project sixth corner\r\n Cartesian3.subtract(center, u, corner);\r\n Cartesian3.add(corner, v, corner);\r\n Cartesian3.subtract(corner, w, corner);\r\n\r\n Cartesian3.subtract(corner, position, toCenter);\r\n mag = Cartesian3.dot(direction, toCenter);\r\n\r\n minDist = Math.min(mag, minDist);\r\n maxDist = Math.max(mag, maxDist);\r\n\r\n // project seventh corner\r\n Cartesian3.subtract(center, u, corner);\r\n Cartesian3.subtract(corner, v, corner);\r\n Cartesian3.add(corner, w, corner);\r\n\r\n Cartesian3.subtract(corner, position, toCenter);\r\n mag = Cartesian3.dot(direction, toCenter);\r\n\r\n minDist = Math.min(mag, minDist);\r\n maxDist = Math.max(mag, maxDist);\r\n\r\n // project eighth corner\r\n Cartesian3.subtract(center, u, corner);\r\n Cartesian3.subtract(corner, v, corner);\r\n Cartesian3.subtract(corner, w, corner);\r\n\r\n Cartesian3.subtract(corner, position, toCenter);\r\n mag = Cartesian3.dot(direction, toCenter);\r\n\r\n minDist = Math.min(mag, minDist);\r\n maxDist = Math.max(mag, maxDist);\r\n\r\n result.start = minDist;\r\n result.stop = maxDist;\r\n return result;\r\n};\r\n\r\nconst scratchXAxis = new Cartesian3();\r\nconst scratchYAxis = new Cartesian3();\r\nconst scratchZAxis = new Cartesian3();\r\n\r\n/**\r\n * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).\r\n *\r\n * @param {OrientedBoundingBox} box The oriented bounding box.\r\n * @param {Cartesian3[]} [result] An array of eight {@link Cartesian3} instances onto which to store the corners.\r\n * @returns {Cartesian3[]} The modified result parameter or a new array if none was provided.\r\n */\r\nOrientedBoundingBox.computeCorners = function (box, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"box\", box);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = [\r\n new Cartesian3(),\r\n new Cartesian3(),\r\n new Cartesian3(),\r\n new Cartesian3(),\r\n new Cartesian3(),\r\n new Cartesian3(),\r\n new Cartesian3(),\r\n new Cartesian3(),\r\n ];\r\n }\r\n\r\n const center = box.center;\r\n const halfAxes = box.halfAxes;\r\n const xAxis = Matrix3.getColumn(halfAxes, 0, scratchXAxis);\r\n const yAxis = Matrix3.getColumn(halfAxes, 1, scratchYAxis);\r\n const zAxis = Matrix3.getColumn(halfAxes, 2, scratchZAxis);\r\n\r\n Cartesian3.clone(center, result[0]);\r\n Cartesian3.subtract(result[0], xAxis, result[0]);\r\n Cartesian3.subtract(result[0], yAxis, result[0]);\r\n Cartesian3.subtract(result[0], zAxis, result[0]);\r\n\r\n Cartesian3.clone(center, result[1]);\r\n Cartesian3.subtract(result[1], xAxis, result[1]);\r\n Cartesian3.subtract(result[1], yAxis, result[1]);\r\n Cartesian3.add(result[1], zAxis, result[1]);\r\n\r\n Cartesian3.clone(center, result[2]);\r\n Cartesian3.subtract(result[2], xAxis, result[2]);\r\n Cartesian3.add(result[2], yAxis, result[2]);\r\n Cartesian3.subtract(result[2], zAxis, result[2]);\r\n\r\n Cartesian3.clone(center, result[3]);\r\n Cartesian3.subtract(result[3], xAxis, result[3]);\r\n Cartesian3.add(result[3], yAxis, result[3]);\r\n Cartesian3.add(result[3], zAxis, result[3]);\r\n\r\n Cartesian3.clone(center, result[4]);\r\n Cartesian3.add(result[4], xAxis, result[4]);\r\n Cartesian3.subtract(result[4], yAxis, result[4]);\r\n Cartesian3.subtract(result[4], zAxis, result[4]);\r\n\r\n Cartesian3.clone(center, result[5]);\r\n Cartesian3.add(result[5], xAxis, result[5]);\r\n Cartesian3.subtract(result[5], yAxis, result[5]);\r\n Cartesian3.add(result[5], zAxis, result[5]);\r\n\r\n Cartesian3.clone(center, result[6]);\r\n Cartesian3.add(result[6], xAxis, result[6]);\r\n Cartesian3.add(result[6], yAxis, result[6]);\r\n Cartesian3.subtract(result[6], zAxis, result[6]);\r\n\r\n Cartesian3.clone(center, result[7]);\r\n Cartesian3.add(result[7], xAxis, result[7]);\r\n Cartesian3.add(result[7], yAxis, result[7]);\r\n Cartesian3.add(result[7], zAxis, result[7]);\r\n\r\n return result;\r\n};\r\n\r\nconst scratchRotationScale = new Matrix3();\r\n\r\n/**\r\n * Computes a transformation matrix from an oriented bounding box.\r\n *\r\n * @param {OrientedBoundingBox} box The oriented bounding box.\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new {@link Matrix4} instance if none was provided.\r\n */\r\nOrientedBoundingBox.computeTransformation = function (box, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"box\", box);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Matrix4();\r\n }\r\n\r\n const translation = box.center;\r\n const rotationScale = Matrix3.multiplyByUniformScale(\r\n box.halfAxes,\r\n 2.0,\r\n scratchRotationScale\r\n );\r\n return Matrix4.fromRotationTranslation(rotationScale, translation, result);\r\n};\r\n\r\nconst scratchBoundingSphere = new BoundingSphere();\r\n\r\n/**\r\n * Determines whether or not a bounding box is hidden from view by the occluder.\r\n *\r\n * @param {OrientedBoundingBox} box The bounding box surrounding the occludee object.\r\n * @param {Occluder} occluder The occluder.\r\n * @returns {Boolean} true
if the box is not visible; otherwise false
.\r\n */\r\nOrientedBoundingBox.isOccluded = function (box, occluder) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(box)) {\r\n throw new DeveloperError(\"box is required.\");\r\n }\r\n if (!defined(occluder)) {\r\n throw new DeveloperError(\"occluder is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const sphere = BoundingSphere.fromOrientedBoundingBox(\r\n box,\r\n scratchBoundingSphere\r\n );\r\n\r\n return !occluder.isBoundingSphereVisible(sphere);\r\n};\r\n\r\n/**\r\n * Determines which side of a plane the oriented bounding box is located.\r\n *\r\n * @param {Plane} plane The plane to test against.\r\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane\r\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is\r\n * on the opposite side, and {@link Intersect.INTERSECTING} if the box\r\n * intersects the plane.\r\n */\r\nOrientedBoundingBox.prototype.intersectPlane = function (plane) {\r\n return OrientedBoundingBox.intersectPlane(this, plane);\r\n};\r\n\r\n/**\r\n * Computes the estimated distance squared from the closest point on a bounding box to a point.\r\n *\r\n * @param {Cartesian3} cartesian The point\r\n * @returns {Number} The estimated distance squared from the bounding sphere to the point.\r\n *\r\n * @example\r\n * // Sort bounding boxes from back to front\r\n * boxes.sort(function(a, b) {\r\n * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);\r\n * });\r\n */\r\nOrientedBoundingBox.prototype.distanceSquaredTo = function (cartesian) {\r\n return OrientedBoundingBox.distanceSquaredTo(this, cartesian);\r\n};\r\n\r\n/**\r\n * The distances calculated by the vector from the center of the bounding box to position projected onto direction.\r\n *
\r\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\r\n * closest and farthest planes from position that intersect the bounding box.\r\n *\r\n * @param {Cartesian3} position The position to calculate the distance from.\r\n * @param {Cartesian3} direction The direction from position.\r\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\r\n * @returns {Interval} The nearest and farthest distances on the bounding box from position in direction.\r\n */\r\nOrientedBoundingBox.prototype.computePlaneDistances = function (\r\n position,\r\n direction,\r\n result\r\n) {\r\n return OrientedBoundingBox.computePlaneDistances(\r\n this,\r\n position,\r\n direction,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Computes the eight corners of an oriented bounding box. The corners are ordered by (-X, -Y, -Z), (-X, -Y, +Z), (-X, +Y, -Z), (-X, +Y, +Z), (+X, -Y, -Z), (+X, -Y, +Z), (+X, +Y, -Z), (+X, +Y, +Z).\r\n *\r\n * @param {Cartesian3[]} [result] An array of eight {@link Cartesian3} instances onto which to store the corners.\r\n * @returns {Cartesian3[]} The modified result parameter or a new array if none was provided.\r\n */\r\nOrientedBoundingBox.prototype.computeCorners = function (result) {\r\n return OrientedBoundingBox.computeCorners(this, result);\r\n};\r\n\r\n/**\r\n * Computes a transformation matrix from an oriented bounding box.\r\n *\r\n * @param {Matrix4} result The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new {@link Matrix4} instance if none was provided.\r\n */\r\nOrientedBoundingBox.prototype.computeTransformation = function (result) {\r\n return OrientedBoundingBox.computeTransformation(this, result);\r\n};\r\n\r\n/**\r\n * Determines whether or not a bounding box is hidden from view by the occluder.\r\n *\r\n * @param {Occluder} occluder The occluder.\r\n * @returns {Boolean} true
if the sphere is not visible; otherwise false
.\r\n */\r\nOrientedBoundingBox.prototype.isOccluded = function (occluder) {\r\n return OrientedBoundingBox.isOccluded(this, occluder);\r\n};\r\n\r\n/**\r\n * Compares the provided OrientedBoundingBox componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {OrientedBoundingBox} left The first OrientedBoundingBox.\r\n * @param {OrientedBoundingBox} right The second OrientedBoundingBox.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nOrientedBoundingBox.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n Cartesian3.equals(left.center, right.center) &&\r\n Matrix3.equals(left.halfAxes, right.halfAxes))\r\n );\r\n};\r\n\r\n/**\r\n * Duplicates this OrientedBoundingBox instance.\r\n *\r\n * @param {OrientedBoundingBox} [result] The object onto which to store the result.\r\n * @returns {OrientedBoundingBox} The modified result parameter or a new OrientedBoundingBox instance if one was not provided.\r\n */\r\nOrientedBoundingBox.prototype.clone = function (result) {\r\n return OrientedBoundingBox.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares this OrientedBoundingBox against the provided OrientedBoundingBox componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {OrientedBoundingBox} [right] The right hand side OrientedBoundingBox.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nOrientedBoundingBox.prototype.equals = function (right) {\r\n return OrientedBoundingBox.equals(this, right);\r\n};\r\nexport default OrientedBoundingBox;\r\n"],"names":["Cartesian3","defaultValue","Matrix3","Check","defined","DeveloperError","Cartographic","Cartesian2","Plane","CesiumMath","Ellipsoid","Rectangle","EllipsoidTangentPlane","Matrix4","Intersect","Interval","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE;EAC/C;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,MAAM,GAAGA,kBAAU,CAAC,KAAK,CAACC,yBAAY,CAAC,MAAM,EAAED,kBAAU,CAAC,IAAI,CAAC,CAAC,CAAC;EACxE;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,QAAQ,GAAGE,eAAO,CAAC,KAAK,CAACD,yBAAY,CAAC,QAAQ,EAAEC,eAAO,CAAC,IAAI,CAAC,CAAC,CAAC;EACtE,CAAC;AACD;EACA;EACA;EACA;EACA;EACA,mBAAmB,CAAC,YAAY;EAChC,EAAEF,kBAAU,CAAC,YAAY,GAAGE,e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,KAAK,CAAC,MAAM,CAAC;EAClD,MAAME,eAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;EACpD,IAAI;EACJ,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA,mBAAmB,CAAC,SAAS,CAAC,KAAK,GAAG,UAAU,MAAM,EAAE;EACxD,EAAE,OAAO,mBAAmB,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;EACjD,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,mBAAmB,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,KAAK,EAAE;EACxD,EAAE,OAAO,mBAAmB,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;EACjD,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/Plane-c9f1487d.js b/examples/cesium/Workers/Plane-c9f1487d.js
new file mode 100644
index 0000000..0edb36c
--- /dev/null
+++ b/examples/cesium/Workers/Plane-c9f1487d.js
@@ -0,0 +1,335 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './Matrix2-036c77dd', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Math-9be8b918'], (function (exports, Matrix3, Matrix2, Check, defaultValue, Math) { 'use strict';
+
+ /**
+ * A plane in Hessian Normal Form defined by
+ *
+ * ax + by + cz + d = 0
+ *
+ * where (a, b, c) is the plane's normal
, d is the signed
+ * distance
to the plane, and (x, y, z) is any point on
+ * the plane.
+ *
+ * @alias Plane
+ * @constructor
+ *
+ * @param {Cartesian3} normal The plane's normal (normalized).
+ * @param {Number} distance The shortest distance from the origin to the plane. The sign of
+ * distance
determines which side of the plane the origin
+ * is on. If distance
is positive, the origin is in the half-space
+ * in the direction of the normal; if negative, the origin is in the half-space
+ * opposite to the normal; if zero, the plane passes through the origin.
+ *
+ * @example
+ * // The plane x=0
+ * const plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);
+ *
+ * @exception {DeveloperError} Normal must be normalized
+ */
+ function Plane(normal, distance) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("normal", normal);
+ if (
+ !Math.CesiumMath.equalsEpsilon(
+ Matrix3.Cartesian3.magnitude(normal),
+ 1.0,
+ Math.CesiumMath.EPSILON6
+ )
+ ) {
+ throw new Check.DeveloperError("normal must be normalized.");
+ }
+ Check.Check.typeOf.number("distance", distance);
+ //>>includeEnd('debug');
+
+ /**
+ * The plane's normal.
+ *
+ * @type {Cartesian3}
+ */
+ this.normal = Matrix3.Cartesian3.clone(normal);
+
+ /**
+ * The shortest distance from the origin to the plane. The sign of
+ * distance
determines which side of the plane the origin
+ * is on. If distance
is positive, the origin is in the half-space
+ * in the direction of the normal; if negative, the origin is in the half-space
+ * opposite to the normal; if zero, the plane passes through the origin.
+ *
+ * @type {Number}
+ */
+ this.distance = distance;
+ }
+
+ /**
+ * Creates a plane from a normal and a point on the plane.
+ *
+ * @param {Cartesian3} point The point on the plane.
+ * @param {Cartesian3} normal The plane's normal (normalized).
+ * @param {Plane} [result] The object onto which to store the result.
+ * @returns {Plane} A new plane instance or the modified result parameter.
+ *
+ * @example
+ * const point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
+ * const normal = ellipsoid.geodeticSurfaceNormal(point);
+ * const tangentPlane = Cesium.Plane.fromPointNormal(point, normal);
+ *
+ * @exception {DeveloperError} Normal must be normalized
+ */
+ Plane.fromPointNormal = function (point, normal, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("point", point);
+ Check.Check.typeOf.object("normal", normal);
+ if (
+ !Math.CesiumMath.equalsEpsilon(
+ Matrix3.Cartesian3.magnitude(normal),
+ 1.0,
+ Math.CesiumMath.EPSILON6
+ )
+ ) {
+ throw new Check.DeveloperError("normal must be normalized.");
+ }
+ //>>includeEnd('debug');
+
+ const distance = -Matrix3.Cartesian3.dot(normal, point);
+
+ if (!defaultValue.defined(result)) {
+ return new Plane(normal, distance);
+ }
+
+ Matrix3.Cartesian3.clone(normal, result.normal);
+ result.distance = distance;
+ return result;
+ };
+
+ const scratchNormal = new Matrix3.Cartesian3();
+ /**
+ * Creates a plane from the general equation
+ *
+ * @param {Cartesian4} coefficients The plane's normal (normalized).
+ * @param {Plane} [result] The object onto which to store the result.
+ * @returns {Plane} A new plane instance or the modified result parameter.
+ *
+ * @exception {DeveloperError} Normal must be normalized
+ */
+ Plane.fromCartesian4 = function (coefficients, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("coefficients", coefficients);
+ //>>includeEnd('debug');
+
+ const normal = Matrix3.Cartesian3.fromCartesian4(coefficients, scratchNormal);
+ const distance = coefficients.w;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (
+ !Math.CesiumMath.equalsEpsilon(
+ Matrix3.Cartesian3.magnitude(normal),
+ 1.0,
+ Math.CesiumMath.EPSILON6
+ )
+ ) {
+ throw new Check.DeveloperError("normal must be normalized.");
+ }
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Plane(normal, distance);
+ }
+ Matrix3.Cartesian3.clone(normal, result.normal);
+ result.distance = distance;
+ return result;
+ };
+
+ /**
+ * Computes the signed shortest distance of a point to a plane.
+ * The sign of the distance determines which side of the plane the point
+ * is on. If the distance is positive, the point is in the half-space
+ * in the direction of the normal; if negative, the point is in the half-space
+ * opposite to the normal; if zero, the plane passes through the point.
+ *
+ * @param {Plane} plane The plane.
+ * @param {Cartesian3} point The point.
+ * @returns {Number} The signed shortest distance of the point to the plane.
+ */
+ Plane.getPointDistance = function (plane, point) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("plane", plane);
+ Check.Check.typeOf.object("point", point);
+ //>>includeEnd('debug');
+
+ return Matrix3.Cartesian3.dot(plane.normal, point) + plane.distance;
+ };
+
+ const scratchCartesian = new Matrix3.Cartesian3();
+ /**
+ * Projects a point onto the plane.
+ * @param {Plane} plane The plane to project the point onto
+ * @param {Cartesian3} point The point to project onto the plane
+ * @param {Cartesian3} [result] The result point. If undefined, a new Cartesian3 will be created.
+ * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.
+ */
+ Plane.projectPointOntoPlane = function (plane, point, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("plane", plane);
+ Check.Check.typeOf.object("point", point);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ // projectedPoint = point - (normal.point + scale) * normal
+ const pointDistance = Plane.getPointDistance(plane, point);
+ const scaledNormal = Matrix3.Cartesian3.multiplyByScalar(
+ plane.normal,
+ pointDistance,
+ scratchCartesian
+ );
+
+ return Matrix3.Cartesian3.subtract(point, scaledNormal, result);
+ };
+
+ const scratchInverseTranspose = new Matrix2.Matrix4();
+ const scratchPlaneCartesian4 = new Matrix2.Cartesian4();
+ const scratchTransformNormal = new Matrix3.Cartesian3();
+ /**
+ * Transforms the plane by the given transformation matrix.
+ *
+ * @param {Plane} plane The plane.
+ * @param {Matrix4} transform The transformation matrix.
+ * @param {Plane} [result] The object into which to store the result.
+ * @returns {Plane} The plane transformed by the given transformation matrix.
+ */
+ Plane.transform = function (plane, transform, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("plane", plane);
+ Check.Check.typeOf.object("transform", transform);
+ //>>includeEnd('debug');
+
+ const normal = plane.normal;
+ const distance = plane.distance;
+ const inverseTranspose = Matrix2.Matrix4.inverseTranspose(
+ transform,
+ scratchInverseTranspose
+ );
+ let planeAsCartesian4 = Matrix2.Cartesian4.fromElements(
+ normal.x,
+ normal.y,
+ normal.z,
+ distance,
+ scratchPlaneCartesian4
+ );
+ planeAsCartesian4 = Matrix2.Matrix4.multiplyByVector(
+ inverseTranspose,
+ planeAsCartesian4,
+ planeAsCartesian4
+ );
+
+ // Convert the transformed plane to Hessian Normal Form
+ const transformedNormal = Matrix3.Cartesian3.fromCartesian4(
+ planeAsCartesian4,
+ scratchTransformNormal
+ );
+
+ planeAsCartesian4 = Matrix2.Cartesian4.divideByScalar(
+ planeAsCartesian4,
+ Matrix3.Cartesian3.magnitude(transformedNormal),
+ planeAsCartesian4
+ );
+
+ return Plane.fromCartesian4(planeAsCartesian4, result);
+ };
+
+ /**
+ * Duplicates a Plane instance.
+ *
+ * @param {Plane} plane The plane to duplicate.
+ * @param {Plane} [result] The object onto which to store the result.
+ * @returns {Plane} The modified result parameter or a new Plane instance if one was not provided.
+ */
+ Plane.clone = function (plane, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("plane", plane);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new Plane(plane.normal, plane.distance);
+ }
+
+ Matrix3.Cartesian3.clone(plane.normal, result.normal);
+ result.distance = plane.distance;
+
+ return result;
+ };
+
+ /**
+ * Compares the provided Planes by normal and distance and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Plane} left The first plane.
+ * @param {Plane} right The second plane.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ Plane.equals = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ return (
+ left.distance === right.distance &&
+ Matrix3.Cartesian3.equals(left.normal, right.normal)
+ );
+ };
+
+ /**
+ * A constant initialized to the XY plane passing through the origin, with normal in positive Z.
+ *
+ * @type {Plane}
+ * @constant
+ */
+ Plane.ORIGIN_XY_PLANE = Object.freeze(new Plane(Matrix3.Cartesian3.UNIT_Z, 0.0));
+
+ /**
+ * A constant initialized to the YZ plane passing through the origin, with normal in positive X.
+ *
+ * @type {Plane}
+ * @constant
+ */
+ Plane.ORIGIN_YZ_PLANE = Object.freeze(new Plane(Matrix3.Cartesian3.UNIT_X, 0.0));
+
+ /**
+ * A constant initialized to the ZX plane passing through the origin, with normal in positive Y.
+ *
+ * @type {Plane}
+ * @constant
+ */
+ Plane.ORIGIN_ZX_PLANE = Object.freeze(new Plane(Matrix3.Cartesian3.UNIT_Y, 0.0));
+
+ exports.Plane = Plane;
+
+}));
+//# sourceMappingURL=Plane-c9f1487d.js.map
diff --git a/examples/cesium/Workers/Plane-c9f1487d.js.map b/examples/cesium/Workers/Plane-c9f1487d.js.map
new file mode 100644
index 0000000..4c13bcf
--- /dev/null
+++ b/examples/cesium/Workers/Plane-c9f1487d.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Plane-c9f1487d.js","sources":["../../../Source/Core/Plane.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartesian4 from \"./Cartesian4.js\";\r\nimport Check from \"./Check.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\n\r\n/**\r\n * A plane in Hessian Normal Form defined by\r\n * \r\n * ax + by + cz + d = 0\r\n *
\r\n * where (a, b, c) is the plane's normal
, d is the signed\r\n * distance
to the plane, and (x, y, z) is any point on\r\n * the plane.\r\n *\r\n * @alias Plane\r\n * @constructor\r\n *\r\n * @param {Cartesian3} normal The plane's normal (normalized).\r\n * @param {Number} distance The shortest distance from the origin to the plane. The sign of\r\n * distance
determines which side of the plane the origin\r\n * is on. If distance
is positive, the origin is in the half-space\r\n * in the direction of the normal; if negative, the origin is in the half-space\r\n * opposite to the normal; if zero, the plane passes through the origin.\r\n *\r\n * @example\r\n * // The plane x=0\r\n * const plane = new Cesium.Plane(Cesium.Cartesian3.UNIT_X, 0.0);\r\n *\r\n * @exception {DeveloperError} Normal must be normalized\r\n */\r\nfunction Plane(normal, distance) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"normal\", normal);\r\n if (\r\n !CesiumMath.equalsEpsilon(\r\n Cartesian3.magnitude(normal),\r\n 1.0,\r\n CesiumMath.EPSILON6\r\n )\r\n ) {\r\n throw new DeveloperError(\"normal must be normalized.\");\r\n }\r\n Check.typeOf.number(\"distance\", distance);\r\n //>>includeEnd('debug');\r\n\r\n /**\r\n * The plane's normal.\r\n *\r\n * @type {Cartesian3}\r\n */\r\n this.normal = Cartesian3.clone(normal);\r\n\r\n /**\r\n * The shortest distance from the origin to the plane. The sign of\r\n * distance
determines which side of the plane the origin\r\n * is on. If distance
is positive, the origin is in the half-space\r\n * in the direction of the normal; if negative, the origin is in the half-space\r\n * opposite to the normal; if zero, the plane passes through the origin.\r\n *\r\n * @type {Number}\r\n */\r\n this.distance = distance;\r\n}\r\n\r\n/**\r\n * Creates a plane from a normal and a point on the plane.\r\n *\r\n * @param {Cartesian3} point The point on the plane.\r\n * @param {Cartesian3} normal The plane's normal (normalized).\r\n * @param {Plane} [result] The object onto which to store the result.\r\n * @returns {Plane} A new plane instance or the modified result parameter.\r\n *\r\n * @example\r\n * const point = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);\r\n * const normal = ellipsoid.geodeticSurfaceNormal(point);\r\n * const tangentPlane = Cesium.Plane.fromPointNormal(point, normal);\r\n *\r\n * @exception {DeveloperError} Normal must be normalized\r\n */\r\nPlane.fromPointNormal = function (point, normal, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"point\", point);\r\n Check.typeOf.object(\"normal\", normal);\r\n if (\r\n !CesiumMath.equalsEpsilon(\r\n Cartesian3.magnitude(normal),\r\n 1.0,\r\n CesiumMath.EPSILON6\r\n )\r\n ) {\r\n throw new DeveloperError(\"normal must be normalized.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const distance = -Cartesian3.dot(normal, point);\r\n\r\n if (!defined(result)) {\r\n return new Plane(normal, distance);\r\n }\r\n\r\n Cartesian3.clone(normal, result.normal);\r\n result.distance = distance;\r\n return result;\r\n};\r\n\r\nconst scratchNormal = new Cartesian3();\r\n/**\r\n * Creates a plane from the general equation\r\n *\r\n * @param {Cartesian4} coefficients The plane's normal (normalized).\r\n * @param {Plane} [result] The object onto which to store the result.\r\n * @returns {Plane} A new plane instance or the modified result parameter.\r\n *\r\n * @exception {DeveloperError} Normal must be normalized\r\n */\r\nPlane.fromCartesian4 = function (coefficients, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"coefficients\", coefficients);\r\n //>>includeEnd('debug');\r\n\r\n const normal = Cartesian3.fromCartesian4(coefficients, scratchNormal);\r\n const distance = coefficients.w;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n !CesiumMath.equalsEpsilon(\r\n Cartesian3.magnitude(normal),\r\n 1.0,\r\n CesiumMath.EPSILON6\r\n )\r\n ) {\r\n throw new DeveloperError(\"normal must be normalized.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Plane(normal, distance);\r\n }\r\n Cartesian3.clone(normal, result.normal);\r\n result.distance = distance;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the signed shortest distance of a point to a plane.\r\n * The sign of the distance determines which side of the plane the point\r\n * is on. If the distance is positive, the point is in the half-space\r\n * in the direction of the normal; if negative, the point is in the half-space\r\n * opposite to the normal; if zero, the plane passes through the point.\r\n *\r\n * @param {Plane} plane The plane.\r\n * @param {Cartesian3} point The point.\r\n * @returns {Number} The signed shortest distance of the point to the plane.\r\n */\r\nPlane.getPointDistance = function (plane, point) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"plane\", plane);\r\n Check.typeOf.object(\"point\", point);\r\n //>>includeEnd('debug');\r\n\r\n return Cartesian3.dot(plane.normal, point) + plane.distance;\r\n};\r\n\r\nconst scratchCartesian = new Cartesian3();\r\n/**\r\n * Projects a point onto the plane.\r\n * @param {Plane} plane The plane to project the point onto\r\n * @param {Cartesian3} point The point to project onto the plane\r\n * @param {Cartesian3} [result] The result point. If undefined, a new Cartesian3 will be created.\r\n * @returns {Cartesian3} The modified result parameter or a new Cartesian3 instance if one was not provided.\r\n */\r\nPlane.projectPointOntoPlane = function (plane, point, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"plane\", plane);\r\n Check.typeOf.object(\"point\", point);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n // projectedPoint = point - (normal.point + scale) * normal\r\n const pointDistance = Plane.getPointDistance(plane, point);\r\n const scaledNormal = Cartesian3.multiplyByScalar(\r\n plane.normal,\r\n pointDistance,\r\n scratchCartesian\r\n );\r\n\r\n return Cartesian3.subtract(point, scaledNormal, result);\r\n};\r\n\r\nconst scratchInverseTranspose = new Matrix4();\r\nconst scratchPlaneCartesian4 = new Cartesian4();\r\nconst scratchTransformNormal = new Cartesian3();\r\n/**\r\n * Transforms the plane by the given transformation matrix.\r\n *\r\n * @param {Plane} plane The plane.\r\n * @param {Matrix4} transform The transformation matrix.\r\n * @param {Plane} [result] The object into which to store the result.\r\n * @returns {Plane} The plane transformed by the given transformation matrix.\r\n */\r\nPlane.transform = function (plane, transform, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"plane\", plane);\r\n Check.typeOf.object(\"transform\", transform);\r\n //>>includeEnd('debug');\r\n\r\n const normal = plane.normal;\r\n const distance = plane.distance;\r\n const inverseTranspose = Matrix4.inverseTranspose(\r\n transform,\r\n scratchInverseTranspose\r\n );\r\n let planeAsCartesian4 = Cartesian4.fromElements(\r\n normal.x,\r\n normal.y,\r\n normal.z,\r\n distance,\r\n scratchPlaneCartesian4\r\n );\r\n planeAsCartesian4 = Matrix4.multiplyByVector(\r\n inverseTranspose,\r\n planeAsCartesian4,\r\n planeAsCartesian4\r\n );\r\n\r\n // Convert the transformed plane to Hessian Normal Form\r\n const transformedNormal = Cartesian3.fromCartesian4(\r\n planeAsCartesian4,\r\n scratchTransformNormal\r\n );\r\n\r\n planeAsCartesian4 = Cartesian4.divideByScalar(\r\n planeAsCartesian4,\r\n Cartesian3.magnitude(transformedNormal),\r\n planeAsCartesian4\r\n );\r\n\r\n return Plane.fromCartesian4(planeAsCartesian4, result);\r\n};\r\n\r\n/**\r\n * Duplicates a Plane instance.\r\n *\r\n * @param {Plane} plane The plane to duplicate.\r\n * @param {Plane} [result] The object onto which to store the result.\r\n * @returns {Plane} The modified result parameter or a new Plane instance if one was not provided.\r\n */\r\nPlane.clone = function (plane, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"plane\", plane);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new Plane(plane.normal, plane.distance);\r\n }\r\n\r\n Cartesian3.clone(plane.normal, result.normal);\r\n result.distance = plane.distance;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided Planes by normal and distance and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Plane} left The first plane.\r\n * @param {Plane} right The second plane.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nPlane.equals = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n return (\r\n left.distance === right.distance &&\r\n Cartesian3.equals(left.normal, right.normal)\r\n );\r\n};\r\n\r\n/**\r\n * A constant initialized to the XY plane passing through the origin, with normal in positive Z.\r\n *\r\n * @type {Plane}\r\n * @constant\r\n */\r\nPlane.ORIGIN_XY_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_Z, 0.0));\r\n\r\n/**\r\n * A constant initialized to the YZ plane passing through the origin, with normal in positive X.\r\n *\r\n * @type {Plane}\r\n * @constant\r\n */\r\nPlane.ORIGIN_YZ_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_X, 0.0));\r\n\r\n/**\r\n * A constant initialized to the ZX plane passing through the origin, with normal in positive Y.\r\n *\r\n * @type {Plane}\r\n * @constant\r\n */\r\nPlane.ORIGIN_ZX_PLANE = Object.freeze(new Plane(Cartesian3.UNIT_Y, 0.0));\r\nexport default Plane;\r\n"],"names":["Check","CesiumMath","Cartesian3","DeveloperError","defined","Matrix4","Cartesian4"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE;EACjC;EACA,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;EACxC,EAAE;EACF,IAAI,CAACC,eAAU,CAAC,aAAa;EAC7B,MAAMC,kBAAU,CAAC,SAAS,CAAC,MAAM,CAAC;EAClC,MAAM,GAAG;EACT,MAAMD,eAAU,CAAC,QAAQ;EACzB,KAAK;EACL,IAAI;EACJ,IAAI,MAAM,IAAIE,oBAAc,CAAC,4BAA4B,CAAC,CAAC;EAC3D,GAAG;EACH,EAAEH,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;EAC5C;AACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,MAAM,GA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K,CAACA,kBAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/PolygonGeometryLibrary-62266ab5.js b/examples/cesium/Workers/PolygonGeometryLibrary-62266ab5.js
new file mode 100644
index 0000000..4e5e7dd
--- /dev/null
+++ b/examples/cesium/Workers/PolygonGeometryLibrary-62266ab5.js
@@ -0,0 +1,1100 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './ArcType-d608b872', './arrayRemoveDuplicates-c3526030', './Matrix2-036c77dd', './Matrix3-f22b0303', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './EllipsoidRhumbLine-48b4507b', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryPipeline-f28890f4', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolygonPipeline-313487c3', './Transforms-11fb6b0a'], (function (exports, ArcType, arrayRemoveDuplicates, Matrix2, Matrix3, ComponentDatatype, defaultValue, EllipsoidRhumbLine, GeometryAttribute, GeometryAttributes, GeometryPipeline, IndexDatatype, Math$1, PolygonPipeline, Transforms) { 'use strict';
+
+ /**
+ * A queue that can enqueue items at the end, and dequeue items from the front.
+ *
+ * @alias Queue
+ * @constructor
+ */
+ function Queue() {
+ this._array = [];
+ this._offset = 0;
+ this._length = 0;
+ }
+
+ Object.defineProperties(Queue.prototype, {
+ /**
+ * The length of the queue.
+ *
+ * @memberof Queue.prototype
+ *
+ * @type {Number}
+ * @readonly
+ */
+ length: {
+ get: function () {
+ return this._length;
+ },
+ },
+ });
+
+ /**
+ * Enqueues the specified item.
+ *
+ * @param {*} item The item to enqueue.
+ */
+ Queue.prototype.enqueue = function (item) {
+ this._array.push(item);
+ this._length++;
+ };
+
+ /**
+ * Dequeues an item. Returns undefined if the queue is empty.
+ *
+ * @returns {*} The the dequeued item.
+ */
+ Queue.prototype.dequeue = function () {
+ if (this._length === 0) {
+ return undefined;
+ }
+
+ const array = this._array;
+ let offset = this._offset;
+ const item = array[offset];
+ array[offset] = undefined;
+
+ offset++;
+ if (offset > 10 && offset * 2 > array.length) {
+ //compact array
+ this._array = array.slice(offset);
+ offset = 0;
+ }
+
+ this._offset = offset;
+ this._length--;
+
+ return item;
+ };
+
+ /**
+ * Returns the item at the front of the queue. Returns undefined if the queue is empty.
+ *
+ * @returns {*} The item at the front of the queue.
+ */
+ Queue.prototype.peek = function () {
+ if (this._length === 0) {
+ return undefined;
+ }
+
+ return this._array[this._offset];
+ };
+
+ /**
+ * Check whether this queue contains the specified item.
+ *
+ * @param {*} item The item to search for.
+ */
+ Queue.prototype.contains = function (item) {
+ return this._array.indexOf(item) !== -1;
+ };
+
+ /**
+ * Remove all items from the queue.
+ */
+ Queue.prototype.clear = function () {
+ this._array.length = this._offset = this._length = 0;
+ };
+
+ /**
+ * Sort the items in the queue in-place.
+ *
+ * @param {Queue.Comparator} compareFunction A function that defines the sort order.
+ */
+ Queue.prototype.sort = function (compareFunction) {
+ if (this._offset > 0) {
+ //compact array
+ this._array = this._array.slice(this._offset);
+ this._offset = 0;
+ }
+
+ this._array.sort(compareFunction);
+ };
+
+ /**
+ * @private
+ */
+ const PolygonGeometryLibrary = {};
+
+ PolygonGeometryLibrary.computeHierarchyPackedLength = function (
+ polygonHierarchy,
+ CartesianX
+ ) {
+ let numComponents = 0;
+ const stack = [polygonHierarchy];
+ while (stack.length > 0) {
+ const hierarchy = stack.pop();
+ if (!defaultValue.defined(hierarchy)) {
+ continue;
+ }
+
+ numComponents += 2;
+
+ const positions = hierarchy.positions;
+ const holes = hierarchy.holes;
+
+ if (defaultValue.defined(positions) && positions.length > 0) {
+ numComponents += positions.length * CartesianX.packedLength;
+ }
+
+ if (defaultValue.defined(holes)) {
+ const length = holes.length;
+ for (let i = 0; i < length; ++i) {
+ stack.push(holes[i]);
+ }
+ }
+ }
+
+ return numComponents;
+ };
+
+ PolygonGeometryLibrary.packPolygonHierarchy = function (
+ polygonHierarchy,
+ array,
+ startingIndex,
+ CartesianX
+ ) {
+ const stack = [polygonHierarchy];
+ while (stack.length > 0) {
+ const hierarchy = stack.pop();
+ if (!defaultValue.defined(hierarchy)) {
+ continue;
+ }
+
+ const positions = hierarchy.positions;
+ const holes = hierarchy.holes;
+
+ array[startingIndex++] = defaultValue.defined(positions) ? positions.length : 0;
+ array[startingIndex++] = defaultValue.defined(holes) ? holes.length : 0;
+
+ if (defaultValue.defined(positions)) {
+ const positionsLength = positions.length;
+ for (
+ let i = 0;
+ i < positionsLength;
+ ++i, startingIndex += CartesianX.packedLength
+ ) {
+ CartesianX.pack(positions[i], array, startingIndex);
+ }
+ }
+
+ if (defaultValue.defined(holes)) {
+ const holesLength = holes.length;
+ for (let j = 0; j < holesLength; ++j) {
+ stack.push(holes[j]);
+ }
+ }
+ }
+
+ return startingIndex;
+ };
+
+ PolygonGeometryLibrary.unpackPolygonHierarchy = function (
+ array,
+ startingIndex,
+ CartesianX
+ ) {
+ const positionsLength = array[startingIndex++];
+ const holesLength = array[startingIndex++];
+
+ const positions = new Array(positionsLength);
+ const holes = holesLength > 0 ? new Array(holesLength) : undefined;
+
+ for (
+ let i = 0;
+ i < positionsLength;
+ ++i, startingIndex += CartesianX.packedLength
+ ) {
+ positions[i] = CartesianX.unpack(array, startingIndex);
+ }
+
+ for (let j = 0; j < holesLength; ++j) {
+ holes[j] = PolygonGeometryLibrary.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ CartesianX
+ );
+ startingIndex = holes[j].startingIndex;
+ delete holes[j].startingIndex;
+ }
+
+ return {
+ positions: positions,
+ holes: holes,
+ startingIndex: startingIndex,
+ };
+ };
+
+ const distance2DScratch = new Matrix2.Cartesian2();
+ function getPointAtDistance2D(p0, p1, distance, length) {
+ Matrix2.Cartesian2.subtract(p1, p0, distance2DScratch);
+ Matrix2.Cartesian2.multiplyByScalar(
+ distance2DScratch,
+ distance / length,
+ distance2DScratch
+ );
+ Matrix2.Cartesian2.add(p0, distance2DScratch, distance2DScratch);
+ return [distance2DScratch.x, distance2DScratch.y];
+ }
+
+ const distanceScratch = new Matrix3.Cartesian3();
+ function getPointAtDistance(p0, p1, distance, length) {
+ Matrix3.Cartesian3.subtract(p1, p0, distanceScratch);
+ Matrix3.Cartesian3.multiplyByScalar(
+ distanceScratch,
+ distance / length,
+ distanceScratch
+ );
+ Matrix3.Cartesian3.add(p0, distanceScratch, distanceScratch);
+ return [distanceScratch.x, distanceScratch.y, distanceScratch.z];
+ }
+
+ PolygonGeometryLibrary.subdivideLineCount = function (p0, p1, minDistance) {
+ const distance = Matrix3.Cartesian3.distance(p0, p1);
+ const n = distance / minDistance;
+ const countDivide = Math.max(0, Math.ceil(Math$1.CesiumMath.log2(n)));
+ return Math.pow(2, countDivide);
+ };
+
+ const scratchCartographic0 = new Matrix3.Cartographic();
+ const scratchCartographic1 = new Matrix3.Cartographic();
+ const scratchCartographic2 = new Matrix3.Cartographic();
+ const scratchCartesian0 = new Matrix3.Cartesian3();
+ const scratchRhumbLine = new EllipsoidRhumbLine.EllipsoidRhumbLine();
+ PolygonGeometryLibrary.subdivideRhumbLineCount = function (
+ ellipsoid,
+ p0,
+ p1,
+ minDistance
+ ) {
+ const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
+ const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
+ const rhumb = new EllipsoidRhumbLine.EllipsoidRhumbLine(c0, c1, ellipsoid);
+ const n = rhumb.surfaceDistance / minDistance;
+ const countDivide = Math.max(0, Math.ceil(Math$1.CesiumMath.log2(n)));
+ return Math.pow(2, countDivide);
+ };
+
+ /**
+ * Subdivides texture coordinates based on the subdivision of the associated world positions.
+ *
+ * @param {Cartesian2} t0 First texture coordinate.
+ * @param {Cartesian2} t1 Second texture coordinate.
+ * @param {Cartesian3} p0 First world position.
+ * @param {Cartesian3} p1 Second world position.
+ * @param {Number} minDistance Minimum distance for a segment.
+ * @param {Array} result The subdivided texture coordinates.
+ *
+ * @private
+ */
+ PolygonGeometryLibrary.subdivideTexcoordLine = function (
+ t0,
+ t1,
+ p0,
+ p1,
+ minDistance,
+ result
+ ) {
+ // Compute the number of subdivisions.
+ const subdivisions = PolygonGeometryLibrary.subdivideLineCount(
+ p0,
+ p1,
+ minDistance
+ );
+
+ // Compute the distance between each subdivided point.
+ const length2D = Matrix2.Cartesian2.distance(t0, t1);
+ const distanceBetweenCoords = length2D / subdivisions;
+
+ // Resize the result array.
+ const texcoords = result;
+ texcoords.length = subdivisions * 2;
+
+ // Compute texture coordinates using linear interpolation.
+ let index = 0;
+ for (let i = 0; i < subdivisions; i++) {
+ const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);
+ texcoords[index++] = t[0];
+ texcoords[index++] = t[1];
+ }
+
+ return texcoords;
+ };
+
+ PolygonGeometryLibrary.subdivideLine = function (p0, p1, minDistance, result) {
+ const numVertices = PolygonGeometryLibrary.subdivideLineCount(
+ p0,
+ p1,
+ minDistance
+ );
+ const length = Matrix3.Cartesian3.distance(p0, p1);
+ const distanceBetweenVertices = length / numVertices;
+
+ if (!defaultValue.defined(result)) {
+ result = [];
+ }
+
+ const positions = result;
+ positions.length = numVertices * 3;
+
+ let index = 0;
+ for (let i = 0; i < numVertices; i++) {
+ const p = getPointAtDistance(p0, p1, i * distanceBetweenVertices, length);
+ positions[index++] = p[0];
+ positions[index++] = p[1];
+ positions[index++] = p[2];
+ }
+
+ return positions;
+ };
+
+ /**
+ * Subdivides texture coordinates based on the subdivision of the associated world positions using a rhumb line.
+ *
+ * @param {Cartesian2} t0 First texture coordinate.
+ * @param {Cartesian2} t1 Second texture coordinate.
+ * @param {Ellipsoid} ellipsoid The ellipsoid.
+ * @param {Cartesian3} p0 First world position.
+ * @param {Cartesian3} p1 Second world position.
+ * @param {Number} minDistance Minimum distance for a segment.
+ * @param {Array} result The subdivided texture coordinates.
+ *
+ * @private
+ */
+ PolygonGeometryLibrary.subdivideTexcoordRhumbLine = function (
+ t0,
+ t1,
+ ellipsoid,
+ p0,
+ p1,
+ minDistance,
+ result
+ ) {
+ // Compute the surface distance.
+ const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
+ const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
+ scratchRhumbLine.setEndPoints(c0, c1);
+ const n = scratchRhumbLine.surfaceDistance / minDistance;
+
+ // Compute the number of subdivisions.
+ const countDivide = Math.max(0, Math.ceil(Math$1.CesiumMath.log2(n)));
+ const subdivisions = Math.pow(2, countDivide);
+
+ // Compute the distance between each subdivided point.
+ const length2D = Matrix2.Cartesian2.distance(t0, t1);
+ const distanceBetweenCoords = length2D / subdivisions;
+
+ // Resize the result array.
+ const texcoords = result;
+ texcoords.length = subdivisions * 2;
+
+ // Compute texture coordinates using linear interpolation.
+ let index = 0;
+ for (let i = 0; i < subdivisions; i++) {
+ const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);
+ texcoords[index++] = t[0];
+ texcoords[index++] = t[1];
+ }
+
+ return texcoords;
+ };
+
+ PolygonGeometryLibrary.subdivideRhumbLine = function (
+ ellipsoid,
+ p0,
+ p1,
+ minDistance,
+ result
+ ) {
+ const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);
+ const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);
+ const rhumb = new EllipsoidRhumbLine.EllipsoidRhumbLine(c0, c1, ellipsoid);
+
+ const n = rhumb.surfaceDistance / minDistance;
+ const countDivide = Math.max(0, Math.ceil(Math$1.CesiumMath.log2(n)));
+ const numVertices = Math.pow(2, countDivide);
+ const distanceBetweenVertices = rhumb.surfaceDistance / numVertices;
+
+ if (!defaultValue.defined(result)) {
+ result = [];
+ }
+
+ const positions = result;
+ positions.length = numVertices * 3;
+
+ let index = 0;
+ for (let i = 0; i < numVertices; i++) {
+ const c = rhumb.interpolateUsingSurfaceDistance(
+ i * distanceBetweenVertices,
+ scratchCartographic2
+ );
+ const p = ellipsoid.cartographicToCartesian(c, scratchCartesian0);
+ positions[index++] = p.x;
+ positions[index++] = p.y;
+ positions[index++] = p.z;
+ }
+
+ return positions;
+ };
+
+ const scaleToGeodeticHeightN1 = new Matrix3.Cartesian3();
+ const scaleToGeodeticHeightN2 = new Matrix3.Cartesian3();
+ const scaleToGeodeticHeightP1 = new Matrix3.Cartesian3();
+ const scaleToGeodeticHeightP2 = new Matrix3.Cartesian3();
+
+ PolygonGeometryLibrary.scaleToGeodeticHeightExtruded = function (
+ geometry,
+ maxHeight,
+ minHeight,
+ ellipsoid,
+ perPositionHeight
+ ) {
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+
+ const n1 = scaleToGeodeticHeightN1;
+ let n2 = scaleToGeodeticHeightN2;
+ const p = scaleToGeodeticHeightP1;
+ let p2 = scaleToGeodeticHeightP2;
+
+ if (
+ defaultValue.defined(geometry) &&
+ defaultValue.defined(geometry.attributes) &&
+ defaultValue.defined(geometry.attributes.position)
+ ) {
+ const positions = geometry.attributes.position.values;
+ const length = positions.length / 2;
+
+ for (let i = 0; i < length; i += 3) {
+ Matrix3.Cartesian3.fromArray(positions, i, p);
+
+ ellipsoid.geodeticSurfaceNormal(p, n1);
+ p2 = ellipsoid.scaleToGeodeticSurface(p, p2);
+ n2 = Matrix3.Cartesian3.multiplyByScalar(n1, minHeight, n2);
+ n2 = Matrix3.Cartesian3.add(p2, n2, n2);
+ positions[i + length] = n2.x;
+ positions[i + 1 + length] = n2.y;
+ positions[i + 2 + length] = n2.z;
+
+ if (perPositionHeight) {
+ p2 = Matrix3.Cartesian3.clone(p, p2);
+ }
+ n2 = Matrix3.Cartesian3.multiplyByScalar(n1, maxHeight, n2);
+ n2 = Matrix3.Cartesian3.add(p2, n2, n2);
+ positions[i] = n2.x;
+ positions[i + 1] = n2.y;
+ positions[i + 2] = n2.z;
+ }
+ }
+ return geometry;
+ };
+
+ PolygonGeometryLibrary.polygonOutlinesFromHierarchy = function (
+ polygonHierarchy,
+ scaleToEllipsoidSurface,
+ ellipsoid
+ ) {
+ // create from a polygon hierarchy
+ // Algorithm adapted from http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf
+ const polygons = [];
+ const queue = new Queue();
+ queue.enqueue(polygonHierarchy);
+ let i;
+ let j;
+ let length;
+ while (queue.length !== 0) {
+ const outerNode = queue.dequeue();
+ let outerRing = outerNode.positions;
+ if (scaleToEllipsoidSurface) {
+ length = outerRing.length;
+ for (i = 0; i < length; i++) {
+ ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
+ }
+ }
+ outerRing = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ outerRing,
+ Matrix3.Cartesian3.equalsEpsilon,
+ true
+ );
+ if (outerRing.length < 3) {
+ continue;
+ }
+
+ const numChildren = outerNode.holes ? outerNode.holes.length : 0;
+ // The outer polygon contains inner polygons
+ for (i = 0; i < numChildren; i++) {
+ const hole = outerNode.holes[i];
+ let holePositions = hole.positions;
+ if (scaleToEllipsoidSurface) {
+ length = holePositions.length;
+ for (j = 0; j < length; ++j) {
+ ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
+ }
+ }
+ holePositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ holePositions,
+ Matrix3.Cartesian3.equalsEpsilon,
+ true
+ );
+ if (holePositions.length < 3) {
+ continue;
+ }
+ polygons.push(holePositions);
+
+ let numGrandchildren = 0;
+ if (defaultValue.defined(hole.holes)) {
+ numGrandchildren = hole.holes.length;
+ }
+
+ for (j = 0; j < numGrandchildren; j++) {
+ queue.enqueue(hole.holes[j]);
+ }
+ }
+
+ polygons.push(outerRing);
+ }
+
+ return polygons;
+ };
+
+ PolygonGeometryLibrary.polygonsFromHierarchy = function (
+ polygonHierarchy,
+ keepDuplicates,
+ projectPointsTo2D,
+ scaleToEllipsoidSurface,
+ ellipsoid
+ ) {
+ // create from a polygon hierarchy
+ // Algorithm adapted from http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf
+ const hierarchy = [];
+ const polygons = [];
+
+ const queue = new Queue();
+ queue.enqueue(polygonHierarchy);
+
+ while (queue.length !== 0) {
+ const outerNode = queue.dequeue();
+ let outerRing = outerNode.positions;
+ const holes = outerNode.holes;
+
+ let i;
+ let length;
+ if (scaleToEllipsoidSurface) {
+ length = outerRing.length;
+ for (i = 0; i < length; i++) {
+ ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
+ }
+ }
+
+ if (!keepDuplicates) {
+ outerRing = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ outerRing,
+ Matrix3.Cartesian3.equalsEpsilon,
+ true
+ );
+ }
+ if (outerRing.length < 3) {
+ continue;
+ }
+
+ let positions2D = projectPointsTo2D(outerRing);
+ if (!defaultValue.defined(positions2D)) {
+ continue;
+ }
+ const holeIndices = [];
+
+ let originalWindingOrder = PolygonPipeline.PolygonPipeline.computeWindingOrder2D(
+ positions2D
+ );
+ if (originalWindingOrder === PolygonPipeline.WindingOrder.CLOCKWISE) {
+ positions2D.reverse();
+ outerRing = outerRing.slice().reverse();
+ }
+
+ let positions = outerRing.slice();
+ const numChildren = defaultValue.defined(holes) ? holes.length : 0;
+ const polygonHoles = [];
+ let j;
+
+ for (i = 0; i < numChildren; i++) {
+ const hole = holes[i];
+ let holePositions = hole.positions;
+ if (scaleToEllipsoidSurface) {
+ length = holePositions.length;
+ for (j = 0; j < length; ++j) {
+ ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
+ }
+ }
+
+ if (!keepDuplicates) {
+ holePositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ holePositions,
+ Matrix3.Cartesian3.equalsEpsilon,
+ true
+ );
+ }
+ if (holePositions.length < 3) {
+ continue;
+ }
+
+ const holePositions2D = projectPointsTo2D(holePositions);
+ if (!defaultValue.defined(holePositions2D)) {
+ continue;
+ }
+
+ originalWindingOrder = PolygonPipeline.PolygonPipeline.computeWindingOrder2D(
+ holePositions2D
+ );
+ if (originalWindingOrder === PolygonPipeline.WindingOrder.CLOCKWISE) {
+ holePositions2D.reverse();
+ holePositions = holePositions.slice().reverse();
+ }
+
+ polygonHoles.push(holePositions);
+ holeIndices.push(positions.length);
+ positions = positions.concat(holePositions);
+ positions2D = positions2D.concat(holePositions2D);
+
+ let numGrandchildren = 0;
+ if (defaultValue.defined(hole.holes)) {
+ numGrandchildren = hole.holes.length;
+ }
+
+ for (j = 0; j < numGrandchildren; j++) {
+ queue.enqueue(hole.holes[j]);
+ }
+ }
+
+ hierarchy.push({
+ outerRing: outerRing,
+ holes: polygonHoles,
+ });
+ polygons.push({
+ positions: positions,
+ positions2D: positions2D,
+ holes: holeIndices,
+ });
+ }
+
+ return {
+ hierarchy: hierarchy,
+ polygons: polygons,
+ };
+ };
+
+ const computeBoundingRectangleCartesian2 = new Matrix2.Cartesian2();
+ const computeBoundingRectangleCartesian3 = new Matrix3.Cartesian3();
+ const computeBoundingRectangleQuaternion = new Transforms.Quaternion();
+ const computeBoundingRectangleMatrix3 = new Matrix3.Matrix3();
+ PolygonGeometryLibrary.computeBoundingRectangle = function (
+ planeNormal,
+ projectPointTo2D,
+ positions,
+ angle,
+ result
+ ) {
+ const rotation = Transforms.Quaternion.fromAxisAngle(
+ planeNormal,
+ angle,
+ computeBoundingRectangleQuaternion
+ );
+ const textureMatrix = Matrix3.Matrix3.fromQuaternion(
+ rotation,
+ computeBoundingRectangleMatrix3
+ );
+
+ let minX = Number.POSITIVE_INFINITY;
+ let maxX = Number.NEGATIVE_INFINITY;
+ let minY = Number.POSITIVE_INFINITY;
+ let maxY = Number.NEGATIVE_INFINITY;
+
+ const length = positions.length;
+ for (let i = 0; i < length; ++i) {
+ const p = Matrix3.Cartesian3.clone(
+ positions[i],
+ computeBoundingRectangleCartesian3
+ );
+ Matrix3.Matrix3.multiplyByVector(textureMatrix, p, p);
+ const st = projectPointTo2D(p, computeBoundingRectangleCartesian2);
+
+ if (defaultValue.defined(st)) {
+ minX = Math.min(minX, st.x);
+ maxX = Math.max(maxX, st.x);
+
+ minY = Math.min(minY, st.y);
+ maxY = Math.max(maxY, st.y);
+ }
+ }
+
+ result.x = minX;
+ result.y = minY;
+ result.width = maxX - minX;
+ result.height = maxY - minY;
+ return result;
+ };
+
+ PolygonGeometryLibrary.createGeometryFromPositions = function (
+ ellipsoid,
+ polygon,
+ textureCoordinates,
+ granularity,
+ perPositionHeight,
+ vertexFormat,
+ arcType
+ ) {
+ let indices = PolygonPipeline.PolygonPipeline.triangulate(polygon.positions2D, polygon.holes);
+
+ /* If polygon is completely unrenderable, just use the first three vertices */
+ if (indices.length < 3) {
+ indices = [0, 1, 2];
+ }
+
+ const positions = polygon.positions;
+
+ const hasTexcoords = defaultValue.defined(textureCoordinates);
+ const texcoords = hasTexcoords ? textureCoordinates.positions : undefined;
+
+ if (perPositionHeight) {
+ const length = positions.length;
+ const flattenedPositions = new Array(length * 3);
+ let index = 0;
+ for (let i = 0; i < length; i++) {
+ const p = positions[i];
+ flattenedPositions[index++] = p.x;
+ flattenedPositions[index++] = p.y;
+ flattenedPositions[index++] = p.z;
+ }
+
+ const geometryOptions = {
+ attributes: {
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: flattenedPositions,
+ }),
+ },
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ };
+
+ if (hasTexcoords) {
+ geometryOptions.attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: Matrix2.Cartesian2.packArray(texcoords),
+ });
+ }
+
+ const geometry = new GeometryAttribute.Geometry(geometryOptions);
+
+ if (vertexFormat.normal) {
+ return GeometryPipeline.GeometryPipeline.computeNormal(geometry);
+ }
+
+ return geometry;
+ }
+
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ return PolygonPipeline.PolygonPipeline.computeSubdivision(
+ ellipsoid,
+ positions,
+ indices,
+ texcoords,
+ granularity
+ );
+ } else if (arcType === ArcType.ArcType.RHUMB) {
+ return PolygonPipeline.PolygonPipeline.computeRhumbLineSubdivision(
+ ellipsoid,
+ positions,
+ indices,
+ texcoords,
+ granularity
+ );
+ }
+ };
+
+ const computeWallTexcoordsSubdivided = [];
+ const computeWallIndicesSubdivided = [];
+ const p1Scratch = new Matrix3.Cartesian3();
+ const p2Scratch = new Matrix3.Cartesian3();
+
+ PolygonGeometryLibrary.computeWallGeometry = function (
+ positions,
+ textureCoordinates,
+ ellipsoid,
+ granularity,
+ perPositionHeight,
+ arcType
+ ) {
+ let edgePositions;
+ let topEdgeLength;
+ let i;
+ let p1;
+ let p2;
+ let t1;
+ let t2;
+ let edgeTexcoords;
+ let topEdgeTexcoordLength;
+
+ let length = positions.length;
+ let index = 0;
+ let textureIndex = 0;
+
+ const hasTexcoords = defaultValue.defined(textureCoordinates);
+ const texcoords = hasTexcoords ? textureCoordinates.positions : undefined;
+
+ if (!perPositionHeight) {
+ const minDistance = Math$1.CesiumMath.chordLength(
+ granularity,
+ ellipsoid.maximumRadius
+ );
+
+ let numVertices = 0;
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ for (i = 0; i < length; i++) {
+ numVertices += PolygonGeometryLibrary.subdivideLineCount(
+ positions[i],
+ positions[(i + 1) % length],
+ minDistance
+ );
+ }
+ } else if (arcType === ArcType.ArcType.RHUMB) {
+ for (i = 0; i < length; i++) {
+ numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(
+ ellipsoid,
+ positions[i],
+ positions[(i + 1) % length],
+ minDistance
+ );
+ }
+ }
+
+ topEdgeLength = (numVertices + length) * 3;
+ edgePositions = new Array(topEdgeLength * 2);
+
+ if (hasTexcoords) {
+ topEdgeTexcoordLength = (numVertices + length) * 2;
+ edgeTexcoords = new Array(topEdgeTexcoordLength * 2);
+ }
+
+ for (i = 0; i < length; i++) {
+ p1 = positions[i];
+ p2 = positions[(i + 1) % length];
+
+ let tempPositions;
+ let tempTexcoords;
+
+ if (hasTexcoords) {
+ t1 = texcoords[i];
+ t2 = texcoords[(i + 1) % length];
+ }
+
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ tempPositions = PolygonGeometryLibrary.subdivideLine(
+ p1,
+ p2,
+ minDistance,
+ computeWallIndicesSubdivided
+ );
+ if (hasTexcoords) {
+ tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordLine(
+ t1,
+ t2,
+ p1,
+ p2,
+ minDistance,
+ computeWallTexcoordsSubdivided
+ );
+ }
+ } else if (arcType === ArcType.ArcType.RHUMB) {
+ tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(
+ ellipsoid,
+ p1,
+ p2,
+ minDistance,
+ computeWallIndicesSubdivided
+ );
+ if (hasTexcoords) {
+ tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordRhumbLine(
+ t1,
+ t2,
+ ellipsoid,
+ p1,
+ p2,
+ minDistance,
+ computeWallTexcoordsSubdivided
+ );
+ }
+ }
+ const tempPositionsLength = tempPositions.length;
+ for (let j = 0; j < tempPositionsLength; ++j, ++index) {
+ edgePositions[index] = tempPositions[j];
+ edgePositions[index + topEdgeLength] = tempPositions[j];
+ }
+
+ edgePositions[index] = p2.x;
+ edgePositions[index + topEdgeLength] = p2.x;
+ ++index;
+
+ edgePositions[index] = p2.y;
+ edgePositions[index + topEdgeLength] = p2.y;
+ ++index;
+
+ edgePositions[index] = p2.z;
+ edgePositions[index + topEdgeLength] = p2.z;
+ ++index;
+
+ if (hasTexcoords) {
+ const tempTexcoordsLength = tempTexcoords.length;
+ for (let k = 0; k < tempTexcoordsLength; ++k, ++textureIndex) {
+ edgeTexcoords[textureIndex] = tempTexcoords[k];
+ edgeTexcoords[textureIndex + topEdgeTexcoordLength] =
+ tempTexcoords[k];
+ }
+
+ edgeTexcoords[textureIndex] = t2.x;
+ edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;
+ ++textureIndex;
+
+ edgeTexcoords[textureIndex] = t2.y;
+ edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;
+ ++textureIndex;
+ }
+ }
+ } else {
+ topEdgeLength = length * 3 * 2;
+ edgePositions = new Array(topEdgeLength * 2);
+
+ if (hasTexcoords) {
+ topEdgeTexcoordLength = length * 2 * 2;
+ edgeTexcoords = new Array(topEdgeTexcoordLength * 2);
+ }
+
+ for (i = 0; i < length; i++) {
+ p1 = positions[i];
+ p2 = positions[(i + 1) % length];
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p1.x;
+ ++index;
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p1.y;
+ ++index;
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p1.z;
+ ++index;
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p2.x;
+ ++index;
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p2.y;
+ ++index;
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p2.z;
+ ++index;
+
+ if (hasTexcoords) {
+ t1 = texcoords[i];
+ t2 = texcoords[(i + 1) % length];
+ edgeTexcoords[textureIndex] = edgeTexcoords[
+ textureIndex + topEdgeTexcoordLength
+ ] = t1.x;
+ ++textureIndex;
+ edgeTexcoords[textureIndex] = edgeTexcoords[
+ textureIndex + topEdgeTexcoordLength
+ ] = t1.y;
+ ++textureIndex;
+ edgeTexcoords[textureIndex] = edgeTexcoords[
+ textureIndex + topEdgeTexcoordLength
+ ] = t2.x;
+ ++textureIndex;
+ edgeTexcoords[textureIndex] = edgeTexcoords[
+ textureIndex + topEdgeTexcoordLength
+ ] = t2.y;
+ ++textureIndex;
+ }
+ }
+ }
+
+ length = edgePositions.length;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ length / 3,
+ length - positions.length * 6
+ );
+ let edgeIndex = 0;
+ length /= 6;
+
+ for (i = 0; i < length; i++) {
+ const UL = i;
+ const UR = UL + 1;
+ const LL = UL + length;
+ const LR = LL + 1;
+
+ p1 = Matrix3.Cartesian3.fromArray(edgePositions, UL * 3, p1Scratch);
+ p2 = Matrix3.Cartesian3.fromArray(edgePositions, UR * 3, p2Scratch);
+ if (
+ Matrix3.Cartesian3.equalsEpsilon(
+ p1,
+ p2,
+ Math$1.CesiumMath.EPSILON10,
+ Math$1.CesiumMath.EPSILON10
+ )
+ ) {
+ //skip corner
+ continue;
+ }
+
+ indices[edgeIndex++] = UL;
+ indices[edgeIndex++] = LL;
+ indices[edgeIndex++] = UR;
+ indices[edgeIndex++] = UR;
+ indices[edgeIndex++] = LL;
+ indices[edgeIndex++] = LR;
+ }
+
+ const geometryOptions = {
+ attributes: new GeometryAttributes.GeometryAttributes({
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: edgePositions,
+ }),
+ }),
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ };
+
+ if (hasTexcoords) {
+ geometryOptions.attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: edgeTexcoords,
+ });
+ }
+
+ const geometry = new GeometryAttribute.Geometry(geometryOptions);
+
+ return geometry;
+ };
+ var PolygonGeometryLibrary$1 = PolygonGeometryLibrary;
+
+ exports.PolygonGeometryLibrary = PolygonGeometryLibrary$1;
+
+}));
+//# sourceMappingURL=PolygonGeometryLibrary-62266ab5.js.map
diff --git a/examples/cesium/Workers/PolygonGeometryLibrary-62266ab5.js.map b/examples/cesium/Workers/PolygonGeometryLibrary-62266ab5.js.map
new file mode 100644
index 0000000..6266beb
--- /dev/null
+++ b/examples/cesium/Workers/PolygonGeometryLibrary-62266ab5.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PolygonGeometryLibrary-62266ab5.js","sources":["../../../Source/Core/Queue.js","../../../Source/Core/PolygonGeometryLibrary.js"],"sourcesContent":["/**\r\n * A queue that can enqueue items at the end, and dequeue items from the front.\r\n *\r\n * @alias Queue\r\n * @constructor\r\n */\r\nfunction Queue() {\r\n this._array = [];\r\n this._offset = 0;\r\n this._length = 0;\r\n}\r\n\r\nObject.defineProperties(Queue.prototype, {\r\n /**\r\n * The length of the queue.\r\n *\r\n * @memberof Queue.prototype\r\n *\r\n * @type {Number}\r\n * @readonly\r\n */\r\n length: {\r\n get: function () {\r\n return this._length;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Enqueues the specified item.\r\n *\r\n * @param {*} item The item to enqueue.\r\n */\r\nQueue.prototype.enqueue = function (item) {\r\n this._array.push(item);\r\n this._length++;\r\n};\r\n\r\n/**\r\n * Dequeues an item. Returns undefined if the queue is empty.\r\n *\r\n * @returns {*} The the dequeued item.\r\n */\r\nQueue.prototype.dequeue = function () {\r\n if (this._length === 0) {\r\n return undefined;\r\n }\r\n\r\n const array = this._array;\r\n let offset = this._offset;\r\n const item = array[offset];\r\n array[offset] = undefined;\r\n\r\n offset++;\r\n if (offset > 10 && offset * 2 > array.length) {\r\n //compact array\r\n this._array = array.slice(offset);\r\n offset = 0;\r\n }\r\n\r\n this._offset = offset;\r\n this._length--;\r\n\r\n return item;\r\n};\r\n\r\n/**\r\n * Returns the item at the front of the queue. Returns undefined if the queue is empty.\r\n *\r\n * @returns {*} The item at the front of the queue.\r\n */\r\nQueue.prototype.peek = function () {\r\n if (this._length === 0) {\r\n return undefined;\r\n }\r\n\r\n return this._array[this._offset];\r\n};\r\n\r\n/**\r\n * Check whether this queue contains the specified item.\r\n *\r\n * @param {*} item The item to search for.\r\n */\r\nQueue.prototype.contains = function (item) {\r\n return this._array.indexOf(item) !== -1;\r\n};\r\n\r\n/**\r\n * Remove all items from the queue.\r\n */\r\nQueue.prototype.clear = function () {\r\n this._array.length = this._offset = this._length = 0;\r\n};\r\n\r\n/**\r\n * Sort the items in the queue in-place.\r\n *\r\n * @param {Queue.Comparator} compareFunction A function that defines the sort order.\r\n */\r\nQueue.prototype.sort = function (compareFunction) {\r\n if (this._offset > 0) {\r\n //compact array\r\n this._array = this._array.slice(this._offset);\r\n this._offset = 0;\r\n }\r\n\r\n this._array.sort(compareFunction);\r\n};\r\n\r\n/**\r\n * A function used to compare two items while sorting a queue.\r\n * @callback Queue.Comparator\r\n *\r\n * @param {*} a An item in the array.\r\n * @param {*} b An item in the array.\r\n * @returns {Number} Returns a negative value if a
is less than b
,\r\n * a positive value if a
is greater than b
, or\r\n * 0 if a
is equal to b
.\r\n *\r\n * @example\r\n * function compareNumbers(a, b) {\r\n * return a - b;\r\n * }\r\n */\r\nexport default Queue;\r\n","import ArcType from \"./ArcType.js\";\r\nimport arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryPipeline from \"./GeometryPipeline.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport PolygonPipeline from \"./PolygonPipeline.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\nimport Queue from \"./Queue.js\";\r\nimport WindingOrder from \"./WindingOrder.js\";\r\n\r\n/**\r\n * @private\r\n */\r\nconst PolygonGeometryLibrary = {};\r\n\r\nPolygonGeometryLibrary.computeHierarchyPackedLength = function (\r\n polygonHierarchy,\r\n CartesianX\r\n) {\r\n let numComponents = 0;\r\n const stack = [polygonHierarchy];\r\n while (stack.length > 0) {\r\n const hierarchy = stack.pop();\r\n if (!defined(hierarchy)) {\r\n continue;\r\n }\r\n\r\n numComponents += 2;\r\n\r\n const positions = hierarchy.positions;\r\n const holes = hierarchy.holes;\r\n\r\n if (defined(positions) && positions.length > 0) {\r\n numComponents += positions.length * CartesianX.packedLength;\r\n }\r\n\r\n if (defined(holes)) {\r\n const length = holes.length;\r\n for (let i = 0; i < length; ++i) {\r\n stack.push(holes[i]);\r\n }\r\n }\r\n }\r\n\r\n return numComponents;\r\n};\r\n\r\nPolygonGeometryLibrary.packPolygonHierarchy = function (\r\n polygonHierarchy,\r\n array,\r\n startingIndex,\r\n CartesianX\r\n) {\r\n const stack = [polygonHierarchy];\r\n while (stack.length > 0) {\r\n const hierarchy = stack.pop();\r\n if (!defined(hierarchy)) {\r\n continue;\r\n }\r\n\r\n const positions = hierarchy.positions;\r\n const holes = hierarchy.holes;\r\n\r\n array[startingIndex++] = defined(positions) ? positions.length : 0;\r\n array[startingIndex++] = defined(holes) ? holes.length : 0;\r\n\r\n if (defined(positions)) {\r\n const positionsLength = positions.length;\r\n for (\r\n let i = 0;\r\n i < positionsLength;\r\n ++i, startingIndex += CartesianX.packedLength\r\n ) {\r\n CartesianX.pack(positions[i], array, startingIndex);\r\n }\r\n }\r\n\r\n if (defined(holes)) {\r\n const holesLength = holes.length;\r\n for (let j = 0; j < holesLength; ++j) {\r\n stack.push(holes[j]);\r\n }\r\n }\r\n }\r\n\r\n return startingIndex;\r\n};\r\n\r\nPolygonGeometryLibrary.unpackPolygonHierarchy = function (\r\n array,\r\n startingIndex,\r\n CartesianX\r\n) {\r\n const positionsLength = array[startingIndex++];\r\n const holesLength = array[startingIndex++];\r\n\r\n const positions = new Array(positionsLength);\r\n const holes = holesLength > 0 ? new Array(holesLength) : undefined;\r\n\r\n for (\r\n let i = 0;\r\n i < positionsLength;\r\n ++i, startingIndex += CartesianX.packedLength\r\n ) {\r\n positions[i] = CartesianX.unpack(array, startingIndex);\r\n }\r\n\r\n for (let j = 0; j < holesLength; ++j) {\r\n holes[j] = PolygonGeometryLibrary.unpackPolygonHierarchy(\r\n array,\r\n startingIndex,\r\n CartesianX\r\n );\r\n startingIndex = holes[j].startingIndex;\r\n delete holes[j].startingIndex;\r\n }\r\n\r\n return {\r\n positions: positions,\r\n holes: holes,\r\n startingIndex: startingIndex,\r\n };\r\n};\r\n\r\nconst distance2DScratch = new Cartesian2();\r\nfunction getPointAtDistance2D(p0, p1, distance, length) {\r\n Cartesian2.subtract(p1, p0, distance2DScratch);\r\n Cartesian2.multiplyByScalar(\r\n distance2DScratch,\r\n distance / length,\r\n distance2DScratch\r\n );\r\n Cartesian2.add(p0, distance2DScratch, distance2DScratch);\r\n return [distance2DScratch.x, distance2DScratch.y];\r\n}\r\n\r\nconst distanceScratch = new Cartesian3();\r\nfunction getPointAtDistance(p0, p1, distance, length) {\r\n Cartesian3.subtract(p1, p0, distanceScratch);\r\n Cartesian3.multiplyByScalar(\r\n distanceScratch,\r\n distance / length,\r\n distanceScratch\r\n );\r\n Cartesian3.add(p0, distanceScratch, distanceScratch);\r\n return [distanceScratch.x, distanceScratch.y, distanceScratch.z];\r\n}\r\n\r\nPolygonGeometryLibrary.subdivideLineCount = function (p0, p1, minDistance) {\r\n const distance = Cartesian3.distance(p0, p1);\r\n const n = distance / minDistance;\r\n const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\r\n return Math.pow(2, countDivide);\r\n};\r\n\r\nconst scratchCartographic0 = new Cartographic();\r\nconst scratchCartographic1 = new Cartographic();\r\nconst scratchCartographic2 = new Cartographic();\r\nconst scratchCartesian0 = new Cartesian3();\r\nconst scratchRhumbLine = new EllipsoidRhumbLine();\r\nPolygonGeometryLibrary.subdivideRhumbLineCount = function (\r\n ellipsoid,\r\n p0,\r\n p1,\r\n minDistance\r\n) {\r\n const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);\r\n const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);\r\n const rhumb = new EllipsoidRhumbLine(c0, c1, ellipsoid);\r\n const n = rhumb.surfaceDistance / minDistance;\r\n const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\r\n return Math.pow(2, countDivide);\r\n};\r\n\r\n/**\r\n * Subdivides texture coordinates based on the subdivision of the associated world positions.\r\n *\r\n * @param {Cartesian2} t0 First texture coordinate.\r\n * @param {Cartesian2} t1 Second texture coordinate.\r\n * @param {Cartesian3} p0 First world position.\r\n * @param {Cartesian3} p1 Second world position.\r\n * @param {Number} minDistance Minimum distance for a segment.\r\n * @param {Array} result The subdivided texture coordinates.\r\n *\r\n * @private\r\n */\r\nPolygonGeometryLibrary.subdivideTexcoordLine = function (\r\n t0,\r\n t1,\r\n p0,\r\n p1,\r\n minDistance,\r\n result\r\n) {\r\n // Compute the number of subdivisions.\r\n const subdivisions = PolygonGeometryLibrary.subdivideLineCount(\r\n p0,\r\n p1,\r\n minDistance\r\n );\r\n\r\n // Compute the distance between each subdivided point.\r\n const length2D = Cartesian2.distance(t0, t1);\r\n const distanceBetweenCoords = length2D / subdivisions;\r\n\r\n // Resize the result array.\r\n const texcoords = result;\r\n texcoords.length = subdivisions * 2;\r\n\r\n // Compute texture coordinates using linear interpolation.\r\n let index = 0;\r\n for (let i = 0; i < subdivisions; i++) {\r\n const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);\r\n texcoords[index++] = t[0];\r\n texcoords[index++] = t[1];\r\n }\r\n\r\n return texcoords;\r\n};\r\n\r\nPolygonGeometryLibrary.subdivideLine = function (p0, p1, minDistance, result) {\r\n const numVertices = PolygonGeometryLibrary.subdivideLineCount(\r\n p0,\r\n p1,\r\n minDistance\r\n );\r\n const length = Cartesian3.distance(p0, p1);\r\n const distanceBetweenVertices = length / numVertices;\r\n\r\n if (!defined(result)) {\r\n result = [];\r\n }\r\n\r\n const positions = result;\r\n positions.length = numVertices * 3;\r\n\r\n let index = 0;\r\n for (let i = 0; i < numVertices; i++) {\r\n const p = getPointAtDistance(p0, p1, i * distanceBetweenVertices, length);\r\n positions[index++] = p[0];\r\n positions[index++] = p[1];\r\n positions[index++] = p[2];\r\n }\r\n\r\n return positions;\r\n};\r\n\r\n/**\r\n * Subdivides texture coordinates based on the subdivision of the associated world positions using a rhumb line.\r\n *\r\n * @param {Cartesian2} t0 First texture coordinate.\r\n * @param {Cartesian2} t1 Second texture coordinate.\r\n * @param {Ellipsoid} ellipsoid The ellipsoid.\r\n * @param {Cartesian3} p0 First world position.\r\n * @param {Cartesian3} p1 Second world position.\r\n * @param {Number} minDistance Minimum distance for a segment.\r\n * @param {Array} result The subdivided texture coordinates.\r\n *\r\n * @private\r\n */\r\nPolygonGeometryLibrary.subdivideTexcoordRhumbLine = function (\r\n t0,\r\n t1,\r\n ellipsoid,\r\n p0,\r\n p1,\r\n minDistance,\r\n result\r\n) {\r\n // Compute the surface distance.\r\n const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);\r\n const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);\r\n scratchRhumbLine.setEndPoints(c0, c1);\r\n const n = scratchRhumbLine.surfaceDistance / minDistance;\r\n\r\n // Compute the number of subdivisions.\r\n const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\r\n const subdivisions = Math.pow(2, countDivide);\r\n\r\n // Compute the distance between each subdivided point.\r\n const length2D = Cartesian2.distance(t0, t1);\r\n const distanceBetweenCoords = length2D / subdivisions;\r\n\r\n // Resize the result array.\r\n const texcoords = result;\r\n texcoords.length = subdivisions * 2;\r\n\r\n // Compute texture coordinates using linear interpolation.\r\n let index = 0;\r\n for (let i = 0; i < subdivisions; i++) {\r\n const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);\r\n texcoords[index++] = t[0];\r\n texcoords[index++] = t[1];\r\n }\r\n\r\n return texcoords;\r\n};\r\n\r\nPolygonGeometryLibrary.subdivideRhumbLine = function (\r\n ellipsoid,\r\n p0,\r\n p1,\r\n minDistance,\r\n result\r\n) {\r\n const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic0);\r\n const c1 = ellipsoid.cartesianToCartographic(p1, scratchCartographic1);\r\n const rhumb = new EllipsoidRhumbLine(c0, c1, ellipsoid);\r\n\r\n const n = rhumb.surfaceDistance / minDistance;\r\n const countDivide = Math.max(0, Math.ceil(CesiumMath.log2(n)));\r\n const numVertices = Math.pow(2, countDivide);\r\n const distanceBetweenVertices = rhumb.surfaceDistance / numVertices;\r\n\r\n if (!defined(result)) {\r\n result = [];\r\n }\r\n\r\n const positions = result;\r\n positions.length = numVertices * 3;\r\n\r\n let index = 0;\r\n for (let i = 0; i < numVertices; i++) {\r\n const c = rhumb.interpolateUsingSurfaceDistance(\r\n i * distanceBetweenVertices,\r\n scratchCartographic2\r\n );\r\n const p = ellipsoid.cartographicToCartesian(c, scratchCartesian0);\r\n positions[index++] = p.x;\r\n positions[index++] = p.y;\r\n positions[index++] = p.z;\r\n }\r\n\r\n return positions;\r\n};\r\n\r\nconst scaleToGeodeticHeightN1 = new Cartesian3();\r\nconst scaleToGeodeticHeightN2 = new Cartesian3();\r\nconst scaleToGeodeticHeightP1 = new Cartesian3();\r\nconst scaleToGeodeticHeightP2 = new Cartesian3();\r\n\r\nPolygonGeometryLibrary.scaleToGeodeticHeightExtruded = function (\r\n geometry,\r\n maxHeight,\r\n minHeight,\r\n ellipsoid,\r\n perPositionHeight\r\n) {\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n\r\n const n1 = scaleToGeodeticHeightN1;\r\n let n2 = scaleToGeodeticHeightN2;\r\n const p = scaleToGeodeticHeightP1;\r\n let p2 = scaleToGeodeticHeightP2;\r\n\r\n if (\r\n defined(geometry) &&\r\n defined(geometry.attributes) &&\r\n defined(geometry.attributes.position)\r\n ) {\r\n const positions = geometry.attributes.position.values;\r\n const length = positions.length / 2;\r\n\r\n for (let i = 0; i < length; i += 3) {\r\n Cartesian3.fromArray(positions, i, p);\r\n\r\n ellipsoid.geodeticSurfaceNormal(p, n1);\r\n p2 = ellipsoid.scaleToGeodeticSurface(p, p2);\r\n n2 = Cartesian3.multiplyByScalar(n1, minHeight, n2);\r\n n2 = Cartesian3.add(p2, n2, n2);\r\n positions[i + length] = n2.x;\r\n positions[i + 1 + length] = n2.y;\r\n positions[i + 2 + length] = n2.z;\r\n\r\n if (perPositionHeight) {\r\n p2 = Cartesian3.clone(p, p2);\r\n }\r\n n2 = Cartesian3.multiplyByScalar(n1, maxHeight, n2);\r\n n2 = Cartesian3.add(p2, n2, n2);\r\n positions[i] = n2.x;\r\n positions[i + 1] = n2.y;\r\n positions[i + 2] = n2.z;\r\n }\r\n }\r\n return geometry;\r\n};\r\n\r\nPolygonGeometryLibrary.polygonOutlinesFromHierarchy = function (\r\n polygonHierarchy,\r\n scaleToEllipsoidSurface,\r\n ellipsoid\r\n) {\r\n // create from a polygon hierarchy\r\n // Algorithm adapted from http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf\r\n const polygons = [];\r\n const queue = new Queue();\r\n queue.enqueue(polygonHierarchy);\r\n let i;\r\n let j;\r\n let length;\r\n while (queue.length !== 0) {\r\n const outerNode = queue.dequeue();\r\n let outerRing = outerNode.positions;\r\n if (scaleToEllipsoidSurface) {\r\n length = outerRing.length;\r\n for (i = 0; i < length; i++) {\r\n ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);\r\n }\r\n }\r\n outerRing = arrayRemoveDuplicates(\r\n outerRing,\r\n Cartesian3.equalsEpsilon,\r\n true\r\n );\r\n if (outerRing.length < 3) {\r\n continue;\r\n }\r\n\r\n const numChildren = outerNode.holes ? outerNode.holes.length : 0;\r\n // The outer polygon contains inner polygons\r\n for (i = 0; i < numChildren; i++) {\r\n const hole = outerNode.holes[i];\r\n let holePositions = hole.positions;\r\n if (scaleToEllipsoidSurface) {\r\n length = holePositions.length;\r\n for (j = 0; j < length; ++j) {\r\n ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);\r\n }\r\n }\r\n holePositions = arrayRemoveDuplicates(\r\n holePositions,\r\n Cartesian3.equalsEpsilon,\r\n true\r\n );\r\n if (holePositions.length < 3) {\r\n continue;\r\n }\r\n polygons.push(holePositions);\r\n\r\n let numGrandchildren = 0;\r\n if (defined(hole.holes)) {\r\n numGrandchildren = hole.holes.length;\r\n }\r\n\r\n for (j = 0; j < numGrandchildren; j++) {\r\n queue.enqueue(hole.holes[j]);\r\n }\r\n }\r\n\r\n polygons.push(outerRing);\r\n }\r\n\r\n return polygons;\r\n};\r\n\r\nPolygonGeometryLibrary.polygonsFromHierarchy = function (\r\n polygonHierarchy,\r\n keepDuplicates,\r\n projectPointsTo2D,\r\n scaleToEllipsoidSurface,\r\n ellipsoid\r\n) {\r\n // create from a polygon hierarchy\r\n // Algorithm adapted from http://www.geometrictools.com/Documentation/TriangulationByEarClipping.pdf\r\n const hierarchy = [];\r\n const polygons = [];\r\n\r\n const queue = new Queue();\r\n queue.enqueue(polygonHierarchy);\r\n\r\n while (queue.length !== 0) {\r\n const outerNode = queue.dequeue();\r\n let outerRing = outerNode.positions;\r\n const holes = outerNode.holes;\r\n\r\n let i;\r\n let length;\r\n if (scaleToEllipsoidSurface) {\r\n length = outerRing.length;\r\n for (i = 0; i < length; i++) {\r\n ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);\r\n }\r\n }\r\n\r\n if (!keepDuplicates) {\r\n outerRing = arrayRemoveDuplicates(\r\n outerRing,\r\n Cartesian3.equalsEpsilon,\r\n true\r\n );\r\n }\r\n if (outerRing.length < 3) {\r\n continue;\r\n }\r\n\r\n let positions2D = projectPointsTo2D(outerRing);\r\n if (!defined(positions2D)) {\r\n continue;\r\n }\r\n const holeIndices = [];\r\n\r\n let originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\r\n positions2D\r\n );\r\n if (originalWindingOrder === WindingOrder.CLOCKWISE) {\r\n positions2D.reverse();\r\n outerRing = outerRing.slice().reverse();\r\n }\r\n\r\n let positions = outerRing.slice();\r\n const numChildren = defined(holes) ? holes.length : 0;\r\n const polygonHoles = [];\r\n let j;\r\n\r\n for (i = 0; i < numChildren; i++) {\r\n const hole = holes[i];\r\n let holePositions = hole.positions;\r\n if (scaleToEllipsoidSurface) {\r\n length = holePositions.length;\r\n for (j = 0; j < length; ++j) {\r\n ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);\r\n }\r\n }\r\n\r\n if (!keepDuplicates) {\r\n holePositions = arrayRemoveDuplicates(\r\n holePositions,\r\n Cartesian3.equalsEpsilon,\r\n true\r\n );\r\n }\r\n if (holePositions.length < 3) {\r\n continue;\r\n }\r\n\r\n const holePositions2D = projectPointsTo2D(holePositions);\r\n if (!defined(holePositions2D)) {\r\n continue;\r\n }\r\n\r\n originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\r\n holePositions2D\r\n );\r\n if (originalWindingOrder === WindingOrder.CLOCKWISE) {\r\n holePositions2D.reverse();\r\n holePositions = holePositions.slice().reverse();\r\n }\r\n\r\n polygonHoles.push(holePositions);\r\n holeIndices.push(positions.length);\r\n positions = positions.concat(holePositions);\r\n positions2D = positions2D.concat(holePositions2D);\r\n\r\n let numGrandchildren = 0;\r\n if (defined(hole.holes)) {\r\n numGrandchildren = hole.holes.length;\r\n }\r\n\r\n for (j = 0; j < numGrandchildren; j++) {\r\n queue.enqueue(hole.holes[j]);\r\n }\r\n }\r\n\r\n hierarchy.push({\r\n outerRing: outerRing,\r\n holes: polygonHoles,\r\n });\r\n polygons.push({\r\n positions: positions,\r\n positions2D: positions2D,\r\n holes: holeIndices,\r\n });\r\n }\r\n\r\n return {\r\n hierarchy: hierarchy,\r\n polygons: polygons,\r\n };\r\n};\r\n\r\nconst computeBoundingRectangleCartesian2 = new Cartesian2();\r\nconst computeBoundingRectangleCartesian3 = new Cartesian3();\r\nconst computeBoundingRectangleQuaternion = new Quaternion();\r\nconst computeBoundingRectangleMatrix3 = new Matrix3();\r\nPolygonGeometryLibrary.computeBoundingRectangle = function (\r\n planeNormal,\r\n projectPointTo2D,\r\n positions,\r\n angle,\r\n result\r\n) {\r\n const rotation = Quaternion.fromAxisAngle(\r\n planeNormal,\r\n angle,\r\n computeBoundingRectangleQuaternion\r\n );\r\n const textureMatrix = Matrix3.fromQuaternion(\r\n rotation,\r\n computeBoundingRectangleMatrix3\r\n );\r\n\r\n let minX = Number.POSITIVE_INFINITY;\r\n let maxX = Number.NEGATIVE_INFINITY;\r\n let minY = Number.POSITIVE_INFINITY;\r\n let maxY = Number.NEGATIVE_INFINITY;\r\n\r\n const length = positions.length;\r\n for (let i = 0; i < length; ++i) {\r\n const p = Cartesian3.clone(\r\n positions[i],\r\n computeBoundingRectangleCartesian3\r\n );\r\n Matrix3.multiplyByVector(textureMatrix, p, p);\r\n const st = projectPointTo2D(p, computeBoundingRectangleCartesian2);\r\n\r\n if (defined(st)) {\r\n minX = Math.min(minX, st.x);\r\n maxX = Math.max(maxX, st.x);\r\n\r\n minY = Math.min(minY, st.y);\r\n maxY = Math.max(maxY, st.y);\r\n }\r\n }\r\n\r\n result.x = minX;\r\n result.y = minY;\r\n result.width = maxX - minX;\r\n result.height = maxY - minY;\r\n return result;\r\n};\r\n\r\nPolygonGeometryLibrary.createGeometryFromPositions = function (\r\n ellipsoid,\r\n polygon,\r\n textureCoordinates,\r\n granularity,\r\n perPositionHeight,\r\n vertexFormat,\r\n arcType\r\n) {\r\n let indices = PolygonPipeline.triangulate(polygon.positions2D, polygon.holes);\r\n\r\n /* If polygon is completely unrenderable, just use the first three vertices */\r\n if (indices.length < 3) {\r\n indices = [0, 1, 2];\r\n }\r\n\r\n const positions = polygon.positions;\r\n\r\n const hasTexcoords = defined(textureCoordinates);\r\n const texcoords = hasTexcoords ? textureCoordinates.positions : undefined;\r\n\r\n if (perPositionHeight) {\r\n const length = positions.length;\r\n const flattenedPositions = new Array(length * 3);\r\n let index = 0;\r\n for (let i = 0; i < length; i++) {\r\n const p = positions[i];\r\n flattenedPositions[index++] = p.x;\r\n flattenedPositions[index++] = p.y;\r\n flattenedPositions[index++] = p.z;\r\n }\r\n\r\n const geometryOptions = {\r\n attributes: {\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: flattenedPositions,\r\n }),\r\n },\r\n indices: indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n };\r\n\r\n if (hasTexcoords) {\r\n geometryOptions.attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: Cartesian2.packArray(texcoords),\r\n });\r\n }\r\n\r\n const geometry = new Geometry(geometryOptions);\r\n\r\n if (vertexFormat.normal) {\r\n return GeometryPipeline.computeNormal(geometry);\r\n }\r\n\r\n return geometry;\r\n }\r\n\r\n if (arcType === ArcType.GEODESIC) {\r\n return PolygonPipeline.computeSubdivision(\r\n ellipsoid,\r\n positions,\r\n indices,\r\n texcoords,\r\n granularity\r\n );\r\n } else if (arcType === ArcType.RHUMB) {\r\n return PolygonPipeline.computeRhumbLineSubdivision(\r\n ellipsoid,\r\n positions,\r\n indices,\r\n texcoords,\r\n granularity\r\n );\r\n }\r\n};\r\n\r\nconst computeWallTexcoordsSubdivided = [];\r\nconst computeWallIndicesSubdivided = [];\r\nconst p1Scratch = new Cartesian3();\r\nconst p2Scratch = new Cartesian3();\r\n\r\nPolygonGeometryLibrary.computeWallGeometry = function (\r\n positions,\r\n textureCoordinates,\r\n ellipsoid,\r\n granularity,\r\n perPositionHeight,\r\n arcType\r\n) {\r\n let edgePositions;\r\n let topEdgeLength;\r\n let i;\r\n let p1;\r\n let p2;\r\n let t1;\r\n let t2;\r\n let edgeTexcoords;\r\n let topEdgeTexcoordLength;\r\n\r\n let length = positions.length;\r\n let index = 0;\r\n let textureIndex = 0;\r\n\r\n const hasTexcoords = defined(textureCoordinates);\r\n const texcoords = hasTexcoords ? textureCoordinates.positions : undefined;\r\n\r\n if (!perPositionHeight) {\r\n const minDistance = CesiumMath.chordLength(\r\n granularity,\r\n ellipsoid.maximumRadius\r\n );\r\n\r\n let numVertices = 0;\r\n if (arcType === ArcType.GEODESIC) {\r\n for (i = 0; i < length; i++) {\r\n numVertices += PolygonGeometryLibrary.subdivideLineCount(\r\n positions[i],\r\n positions[(i + 1) % length],\r\n minDistance\r\n );\r\n }\r\n } else if (arcType === ArcType.RHUMB) {\r\n for (i = 0; i < length; i++) {\r\n numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(\r\n ellipsoid,\r\n positions[i],\r\n positions[(i + 1) % length],\r\n minDistance\r\n );\r\n }\r\n }\r\n\r\n topEdgeLength = (numVertices + length) * 3;\r\n edgePositions = new Array(topEdgeLength * 2);\r\n\r\n if (hasTexcoords) {\r\n topEdgeTexcoordLength = (numVertices + length) * 2;\r\n edgeTexcoords = new Array(topEdgeTexcoordLength * 2);\r\n }\r\n\r\n for (i = 0; i < length; i++) {\r\n p1 = positions[i];\r\n p2 = positions[(i + 1) % length];\r\n\r\n let tempPositions;\r\n let tempTexcoords;\r\n\r\n if (hasTexcoords) {\r\n t1 = texcoords[i];\r\n t2 = texcoords[(i + 1) % length];\r\n }\r\n\r\n if (arcType === ArcType.GEODESIC) {\r\n tempPositions = PolygonGeometryLibrary.subdivideLine(\r\n p1,\r\n p2,\r\n minDistance,\r\n computeWallIndicesSubdivided\r\n );\r\n if (hasTexcoords) {\r\n tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordLine(\r\n t1,\r\n t2,\r\n p1,\r\n p2,\r\n minDistance,\r\n computeWallTexcoordsSubdivided\r\n );\r\n }\r\n } else if (arcType === ArcType.RHUMB) {\r\n tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(\r\n ellipsoid,\r\n p1,\r\n p2,\r\n minDistance,\r\n computeWallIndicesSubdivided\r\n );\r\n if (hasTexcoords) {\r\n tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordRhumbLine(\r\n t1,\r\n t2,\r\n ellipsoid,\r\n p1,\r\n p2,\r\n minDistance,\r\n computeWallTexcoordsSubdivided\r\n );\r\n }\r\n }\r\n const tempPositionsLength = tempPositions.length;\r\n for (let j = 0; j < tempPositionsLength; ++j, ++index) {\r\n edgePositions[index] = tempPositions[j];\r\n edgePositions[index + topEdgeLength] = tempPositions[j];\r\n }\r\n\r\n edgePositions[index] = p2.x;\r\n edgePositions[index + topEdgeLength] = p2.x;\r\n ++index;\r\n\r\n edgePositions[index] = p2.y;\r\n edgePositions[index + topEdgeLength] = p2.y;\r\n ++index;\r\n\r\n edgePositions[index] = p2.z;\r\n edgePositions[index + topEdgeLength] = p2.z;\r\n ++index;\r\n\r\n if (hasTexcoords) {\r\n const tempTexcoordsLength = tempTexcoords.length;\r\n for (let k = 0; k < tempTexcoordsLength; ++k, ++textureIndex) {\r\n edgeTexcoords[textureIndex] = tempTexcoords[k];\r\n edgeTexcoords[textureIndex + topEdgeTexcoordLength] =\r\n tempTexcoords[k];\r\n }\r\n\r\n edgeTexcoords[textureIndex] = t2.x;\r\n edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;\r\n ++textureIndex;\r\n\r\n edgeTexcoords[textureIndex] = t2.y;\r\n edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;\r\n ++textureIndex;\r\n }\r\n }\r\n } else {\r\n topEdgeLength = length * 3 * 2;\r\n edgePositions = new Array(topEdgeLength * 2);\r\n\r\n if (hasTexcoords) {\r\n topEdgeTexcoordLength = length * 2 * 2;\r\n edgeTexcoords = new Array(topEdgeTexcoordLength * 2);\r\n }\r\n\r\n for (i = 0; i < length; i++) {\r\n p1 = positions[i];\r\n p2 = positions[(i + 1) % length];\r\n edgePositions[index] = edgePositions[index + topEdgeLength] = p1.x;\r\n ++index;\r\n edgePositions[index] = edgePositions[index + topEdgeLength] = p1.y;\r\n ++index;\r\n edgePositions[index] = edgePositions[index + topEdgeLength] = p1.z;\r\n ++index;\r\n edgePositions[index] = edgePositions[index + topEdgeLength] = p2.x;\r\n ++index;\r\n edgePositions[index] = edgePositions[index + topEdgeLength] = p2.y;\r\n ++index;\r\n edgePositions[index] = edgePositions[index + topEdgeLength] = p2.z;\r\n ++index;\r\n\r\n if (hasTexcoords) {\r\n t1 = texcoords[i];\r\n t2 = texcoords[(i + 1) % length];\r\n edgeTexcoords[textureIndex] = edgeTexcoords[\r\n textureIndex + topEdgeTexcoordLength\r\n ] = t1.x;\r\n ++textureIndex;\r\n edgeTexcoords[textureIndex] = edgeTexcoords[\r\n textureIndex + topEdgeTexcoordLength\r\n ] = t1.y;\r\n ++textureIndex;\r\n edgeTexcoords[textureIndex] = edgeTexcoords[\r\n textureIndex + topEdgeTexcoordLength\r\n ] = t2.x;\r\n ++textureIndex;\r\n edgeTexcoords[textureIndex] = edgeTexcoords[\r\n textureIndex + topEdgeTexcoordLength\r\n ] = t2.y;\r\n ++textureIndex;\r\n }\r\n }\r\n }\r\n\r\n length = edgePositions.length;\r\n const indices = IndexDatatype.createTypedArray(\r\n length / 3,\r\n length - positions.length * 6\r\n );\r\n let edgeIndex = 0;\r\n length /= 6;\r\n\r\n for (i = 0; i < length; i++) {\r\n const UL = i;\r\n const UR = UL + 1;\r\n const LL = UL + length;\r\n const LR = LL + 1;\r\n\r\n p1 = Cartesian3.fromArray(edgePositions, UL * 3, p1Scratch);\r\n p2 = Cartesian3.fromArray(edgePositions, UR * 3, p2Scratch);\r\n if (\r\n Cartesian3.equalsEpsilon(\r\n p1,\r\n p2,\r\n CesiumMath.EPSILON10,\r\n CesiumMath.EPSILON10\r\n )\r\n ) {\r\n //skip corner\r\n continue;\r\n }\r\n\r\n indices[edgeIndex++] = UL;\r\n indices[edgeIndex++] = LL;\r\n indices[edgeIndex++] = UR;\r\n indices[edgeIndex++] = UR;\r\n indices[edgeIndex++] = LL;\r\n indices[edgeIndex++] = LR;\r\n }\r\n\r\n const geometryOptions = {\r\n attributes: new GeometryAttributes({\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: edgePositions,\r\n }),\r\n }),\r\n indices: indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n };\r\n\r\n if (hasTexcoords) {\r\n geometryOptions.attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: edgeTexcoords,\r\n });\r\n }\r\n\r\n const geometry = new Geometry(geometryOptions);\r\n\r\n return geometry;\r\n};\r\nexport default PolygonGeometryLibrary;\r\n"],"names":["defined","Cartesian2","Cartesian3","CesiumMath","Cartographic","EllipsoidRhumbLine","defaultValue","Ellipsoid","arrayRemoveDuplicates","PolygonPipeline","WindingOrder","Quaternion","Matrix3","GeometryAttribute","ComponentDatatype","PrimitiveType","Geometry","GeometryPipeline","ArcType","IndexDatatype","GeometryAttributes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,KAAK,GAAG;EACjB,EAAE,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;EACnB,EAAE,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;EACnB,EAAE,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;EACnB,CAAC;AACD;EACA,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,EAAE;EACzC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,MAAM,EAAE;EACV,IAAI,GAAG,EAAE,YAAY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,CAAC;EAC9B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,GAAG;AACH;EACA,EAAE,MAAM,eAAe,GAAG;EAC1B,IAAI,UAAU,EAAE,IAAIiB,qCAAkB,CAAC;EACvC,MAAM,QAAQ,EAAE,IAAIP,mCAAiB,CAAC;EACtC,QAAQ,iBAAiB,EAAEC,mCAAiB,CAAC,MAAM;EACnD,QAAQ,sBAAsB,EAAE,CAAC;EACjC,QAAQ,MAAM,EAAE,aAAa;EAC7B,OAAO,CAAC;EACR,KAAK,CAAC;EACN,IAAI,OAAO,EAAE,OAAO;EACpB,IAAI,aAAa,EAAEC,+BAAa,CAAC,SAAS;EAC1C,GAAG,CAAC;AACJ;EACA,EAAE,IAAI,YAAY,EAAE;EACpB,IAAI,eAAe,CAAC,UAAU,CAAC,EAAE,GAAG,IAAIF,mCAAiB,CAAC;EAC1D,MAAM,iBAAiB,EAAEC,mCAAiB,CAAC,KAAK;EAChD,MAAM,sBAAsB,EAAE,CAAC;EAC/B,MAAM,MAAM,EAAE,aAAa;EAC3B,KAAK,CAAC,CAAC;EACP,GAAG;AACH;EACA,EAAE,MAAM,QAAQ,GAAG,IAAIE,0BAAQ,CAAC,eAAe,CAAC,CAAC;AACjD;EACA,EAAE,OAAO,QAAQ,CAAC;EAClB,CAAC,CAAC;AACF,iCAAe,sBAAsB;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/PolygonPipeline-313487c3.js b/examples/cesium/Workers/PolygonPipeline-313487c3.js
new file mode 100644
index 0000000..c4f9794
--- /dev/null
+++ b/examples/cesium/Workers/PolygonPipeline-313487c3.js
@@ -0,0 +1,1367 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './EllipsoidRhumbLine-48b4507b', './GeometryAttribute-f2746b95', './Math-9be8b918', './WebGLConstants-f27a5e29'], (function (exports, Matrix2, Matrix3, Check, ComponentDatatype, defaultValue, EllipsoidRhumbLine, GeometryAttribute, Math$1, WebGLConstants) { 'use strict';
+
+ var earcut$1 = {exports: {}};
+
+ earcut$1.exports = earcut;
+ earcut$1.exports.default = earcut;
+
+ function earcut(data, holeIndices, dim) {
+
+ dim = dim || 2;
+
+ var hasHoles = holeIndices && holeIndices.length,
+ outerLen = hasHoles ? holeIndices[0] * dim : data.length,
+ outerNode = linkedList(data, 0, outerLen, dim, true),
+ triangles = [];
+
+ if (!outerNode || outerNode.next === outerNode.prev) return triangles;
+
+ var minX, minY, maxX, maxY, x, y, invSize;
+
+ if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);
+
+ // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
+ if (data.length > 80 * dim) {
+ minX = maxX = data[0];
+ minY = maxY = data[1];
+
+ for (var i = dim; i < outerLen; i += dim) {
+ x = data[i];
+ y = data[i + 1];
+ if (x < minX) minX = x;
+ if (y < minY) minY = y;
+ if (x > maxX) maxX = x;
+ if (y > maxY) maxY = y;
+ }
+
+ // minX, minY and invSize are later used to transform coords into integers for z-order calculation
+ invSize = Math.max(maxX - minX, maxY - minY);
+ invSize = invSize !== 0 ? 32767 / invSize : 0;
+ }
+
+ earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);
+
+ return triangles;
+ }
+
+ // create a circular doubly linked list from polygon points in the specified winding order
+ function linkedList(data, start, end, dim, clockwise) {
+ var i, last;
+
+ if (clockwise === (signedArea(data, start, end, dim) > 0)) {
+ for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);
+ } else {
+ for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);
+ }
+
+ if (last && equals(last, last.next)) {
+ removeNode(last);
+ last = last.next;
+ }
+
+ return last;
+ }
+
+ // eliminate colinear or duplicate points
+ function filterPoints(start, end) {
+ if (!start) return start;
+ if (!end) end = start;
+
+ var p = start,
+ again;
+ do {
+ again = false;
+
+ if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
+ removeNode(p);
+ p = end = p.prev;
+ if (p === p.next) break;
+ again = true;
+
+ } else {
+ p = p.next;
+ }
+ } while (again || p !== end);
+
+ return end;
+ }
+
+ // main ear slicing loop which triangulates a polygon (given as a linked list)
+ function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {
+ if (!ear) return;
+
+ // interlink polygon nodes in z-order
+ if (!pass && invSize) indexCurve(ear, minX, minY, invSize);
+
+ var stop = ear,
+ prev, next;
+
+ // iterate through ears, slicing them one by one
+ while (ear.prev !== ear.next) {
+ prev = ear.prev;
+ next = ear.next;
+
+ if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
+ // cut off the triangle
+ triangles.push(prev.i / dim | 0);
+ triangles.push(ear.i / dim | 0);
+ triangles.push(next.i / dim | 0);
+
+ removeNode(ear);
+
+ // skipping the next vertex leads to less sliver triangles
+ ear = next.next;
+ stop = next.next;
+
+ continue;
+ }
+
+ ear = next;
+
+ // if we looped through the whole remaining polygon and can't find any more ears
+ if (ear === stop) {
+ // try filtering points and slicing again
+ if (!pass) {
+ earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);
+
+ // if this didn't work, try curing all small self-intersections locally
+ } else if (pass === 1) {
+ ear = cureLocalIntersections(filterPoints(ear), triangles, dim);
+ earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);
+
+ // as a last resort, try splitting the remaining polygon into two
+ } else if (pass === 2) {
+ splitEarcut(ear, triangles, dim, minX, minY, invSize);
+ }
+
+ break;
+ }
+ }
+ }
+
+ // check whether a polygon node forms a valid ear with adjacent nodes
+ function isEar(ear) {
+ var a = ear.prev,
+ b = ear,
+ c = ear.next;
+
+ if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
+
+ // now make sure we don't have other points inside the potential ear
+ var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
+
+ // triangle bbox; min & max are calculated like this for speed
+ var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),
+ y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),
+ x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),
+ y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);
+
+ var p = c.next;
+ while (p !== a) {
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&
+ pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&
+ area(p.prev, p, p.next) >= 0) return false;
+ p = p.next;
+ }
+
+ return true;
+ }
+
+ function isEarHashed(ear, minX, minY, invSize) {
+ var a = ear.prev,
+ b = ear,
+ c = ear.next;
+
+ if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
+
+ var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
+
+ // triangle bbox; min & max are calculated like this for speed
+ var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),
+ y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),
+ x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),
+ y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);
+
+ // z-order range for the current triangle bbox;
+ var minZ = zOrder(x0, y0, minX, minY, invSize),
+ maxZ = zOrder(x1, y1, minX, minY, invSize);
+
+ var p = ear.prevZ,
+ n = ear.nextZ;
+
+ // look for points inside the triangle in both directions
+ while (p && p.z >= minZ && n && n.z <= maxZ) {
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
+ pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
+ p = p.prevZ;
+
+ if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
+ pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
+ n = n.nextZ;
+ }
+
+ // look for remaining points in decreasing z-order
+ while (p && p.z >= minZ) {
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
+ pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
+ p = p.prevZ;
+ }
+
+ // look for remaining points in increasing z-order
+ while (n && n.z <= maxZ) {
+ if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
+ pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
+ n = n.nextZ;
+ }
+
+ return true;
+ }
+
+ // go through all polygon nodes and cure small local self-intersections
+ function cureLocalIntersections(start, triangles, dim) {
+ var p = start;
+ do {
+ var a = p.prev,
+ b = p.next.next;
+
+ if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
+
+ triangles.push(a.i / dim | 0);
+ triangles.push(p.i / dim | 0);
+ triangles.push(b.i / dim | 0);
+
+ // remove two nodes involved
+ removeNode(p);
+ removeNode(p.next);
+
+ p = start = b;
+ }
+ p = p.next;
+ } while (p !== start);
+
+ return filterPoints(p);
+ }
+
+ // try splitting polygon into two and triangulate them independently
+ function splitEarcut(start, triangles, dim, minX, minY, invSize) {
+ // look for a valid diagonal that divides the polygon into two
+ var a = start;
+ do {
+ var b = a.next.next;
+ while (b !== a.prev) {
+ if (a.i !== b.i && isValidDiagonal(a, b)) {
+ // split the polygon in two by the diagonal
+ var c = splitPolygon(a, b);
+
+ // filter colinear points around the cuts
+ a = filterPoints(a, a.next);
+ c = filterPoints(c, c.next);
+
+ // run earcut on each half
+ earcutLinked(a, triangles, dim, minX, minY, invSize, 0);
+ earcutLinked(c, triangles, dim, minX, minY, invSize, 0);
+ return;
+ }
+ b = b.next;
+ }
+ a = a.next;
+ } while (a !== start);
+ }
+
+ // link every hole into the outer loop, producing a single-ring polygon without holes
+ function eliminateHoles(data, holeIndices, outerNode, dim) {
+ var queue = [],
+ i, len, start, end, list;
+
+ for (i = 0, len = holeIndices.length; i < len; i++) {
+ start = holeIndices[i] * dim;
+ end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
+ list = linkedList(data, start, end, dim, false);
+ if (list === list.next) list.steiner = true;
+ queue.push(getLeftmost(list));
+ }
+
+ queue.sort(compareX);
+
+ // process holes from left to right
+ for (i = 0; i < queue.length; i++) {
+ outerNode = eliminateHole(queue[i], outerNode);
+ }
+
+ return outerNode;
+ }
+
+ function compareX(a, b) {
+ return a.x - b.x;
+ }
+
+ // find a bridge between vertices that connects hole with an outer ring and and link it
+ function eliminateHole(hole, outerNode) {
+ var bridge = findHoleBridge(hole, outerNode);
+ if (!bridge) {
+ return outerNode;
+ }
+
+ var bridgeReverse = splitPolygon(bridge, hole);
+
+ // filter collinear points around the cuts
+ filterPoints(bridgeReverse, bridgeReverse.next);
+ return filterPoints(bridge, bridge.next);
+ }
+
+ // David Eberly's algorithm for finding a bridge between hole and outer polygon
+ function findHoleBridge(hole, outerNode) {
+ var p = outerNode,
+ hx = hole.x,
+ hy = hole.y,
+ qx = -Infinity,
+ m;
+
+ // find a segment intersected by a ray from the hole's leftmost point to the left;
+ // segment's endpoint with lesser x will be potential connection point
+ do {
+ if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {
+ var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
+ if (x <= hx && x > qx) {
+ qx = x;
+ m = p.x < p.next.x ? p : p.next;
+ if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint
+ }
+ }
+ p = p.next;
+ } while (p !== outerNode);
+
+ if (!m) return null;
+
+ // look for points inside the triangle of hole point, segment intersection and endpoint;
+ // if there are no points found, we have a valid connection;
+ // otherwise choose the point of the minimum angle with the ray as connection point
+
+ var stop = m,
+ mx = m.x,
+ my = m.y,
+ tanMin = Infinity,
+ tan;
+
+ p = m;
+
+ do {
+ if (hx >= p.x && p.x >= mx && hx !== p.x &&
+ pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {
+
+ tan = Math.abs(hy - p.y) / (hx - p.x); // tangential
+
+ if (locallyInside(p, hole) &&
+ (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {
+ m = p;
+ tanMin = tan;
+ }
+ }
+
+ p = p.next;
+ } while (p !== stop);
+
+ return m;
+ }
+
+ // whether sector in vertex m contains sector in vertex p in the same coordinates
+ function sectorContainsSector(m, p) {
+ return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;
+ }
+
+ // interlink polygon nodes in z-order
+ function indexCurve(start, minX, minY, invSize) {
+ var p = start;
+ do {
+ if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);
+ p.prevZ = p.prev;
+ p.nextZ = p.next;
+ p = p.next;
+ } while (p !== start);
+
+ p.prevZ.nextZ = null;
+ p.prevZ = null;
+
+ sortLinked(p);
+ }
+
+ // Simon Tatham's linked list merge sort algorithm
+ // http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
+ function sortLinked(list) {
+ var i, p, q, e, tail, numMerges, pSize, qSize,
+ inSize = 1;
+
+ do {
+ p = list;
+ list = null;
+ tail = null;
+ numMerges = 0;
+
+ while (p) {
+ numMerges++;
+ q = p;
+ pSize = 0;
+ for (i = 0; i < inSize; i++) {
+ pSize++;
+ q = q.nextZ;
+ if (!q) break;
+ }
+ qSize = inSize;
+
+ while (pSize > 0 || (qSize > 0 && q)) {
+
+ if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {
+ e = p;
+ p = p.nextZ;
+ pSize--;
+ } else {
+ e = q;
+ q = q.nextZ;
+ qSize--;
+ }
+
+ if (tail) tail.nextZ = e;
+ else list = e;
+
+ e.prevZ = tail;
+ tail = e;
+ }
+
+ p = q;
+ }
+
+ tail.nextZ = null;
+ inSize *= 2;
+
+ } while (numMerges > 1);
+
+ return list;
+ }
+
+ // z-order of a point given coords and inverse of the longer side of data bbox
+ function zOrder(x, y, minX, minY, invSize) {
+ // coords are transformed into non-negative 15-bit integer range
+ x = (x - minX) * invSize | 0;
+ y = (y - minY) * invSize | 0;
+
+ x = (x | (x << 8)) & 0x00FF00FF;
+ x = (x | (x << 4)) & 0x0F0F0F0F;
+ x = (x | (x << 2)) & 0x33333333;
+ x = (x | (x << 1)) & 0x55555555;
+
+ y = (y | (y << 8)) & 0x00FF00FF;
+ y = (y | (y << 4)) & 0x0F0F0F0F;
+ y = (y | (y << 2)) & 0x33333333;
+ y = (y | (y << 1)) & 0x55555555;
+
+ return x | (y << 1);
+ }
+
+ // find the leftmost node of a polygon ring
+ function getLeftmost(start) {
+ var p = start,
+ leftmost = start;
+ do {
+ if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;
+ p = p.next;
+ } while (p !== start);
+
+ return leftmost;
+ }
+
+ // check if a point lies within a convex triangle
+ function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
+ return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&
+ (ax - px) * (by - py) >= (bx - px) * (ay - py) &&
+ (bx - px) * (cy - py) >= (cx - px) * (by - py);
+ }
+
+ // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
+ function isValidDiagonal(a, b) {
+ return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges
+ (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
+ (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
+ equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case
+ }
+
+ // signed area of a triangle
+ function area(p, q, r) {
+ return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
+ }
+
+ // check if two points are equal
+ function equals(p1, p2) {
+ return p1.x === p2.x && p1.y === p2.y;
+ }
+
+ // check if two segments intersect
+ function intersects(p1, q1, p2, q2) {
+ var o1 = sign(area(p1, q1, p2));
+ var o2 = sign(area(p1, q1, q2));
+ var o3 = sign(area(p2, q2, p1));
+ var o4 = sign(area(p2, q2, q1));
+
+ if (o1 !== o2 && o3 !== o4) return true; // general case
+
+ if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1
+ if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1
+ if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2
+ if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2
+
+ return false;
+ }
+
+ // for collinear points p, q, r, check if point q lies on segment pr
+ function onSegment(p, q, r) {
+ return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);
+ }
+
+ function sign(num) {
+ return num > 0 ? 1 : num < 0 ? -1 : 0;
+ }
+
+ // check if a polygon diagonal intersects any polygon segments
+ function intersectsPolygon(a, b) {
+ var p = a;
+ do {
+ if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&
+ intersects(p, p.next, a, b)) return true;
+ p = p.next;
+ } while (p !== a);
+
+ return false;
+ }
+
+ // check if a polygon diagonal is locally inside the polygon
+ function locallyInside(a, b) {
+ return area(a.prev, a, a.next) < 0 ?
+ area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :
+ area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;
+ }
+
+ // check if the middle point of a polygon diagonal is inside the polygon
+ function middleInside(a, b) {
+ var p = a,
+ inside = false,
+ px = (a.x + b.x) / 2,
+ py = (a.y + b.y) / 2;
+ do {
+ if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&
+ (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))
+ inside = !inside;
+ p = p.next;
+ } while (p !== a);
+
+ return inside;
+ }
+
+ // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;
+ // if one belongs to the outer ring and another to a hole, it merges it into a single ring
+ function splitPolygon(a, b) {
+ var a2 = new Node(a.i, a.x, a.y),
+ b2 = new Node(b.i, b.x, b.y),
+ an = a.next,
+ bp = b.prev;
+
+ a.next = b;
+ b.prev = a;
+
+ a2.next = an;
+ an.prev = a2;
+
+ b2.next = a2;
+ a2.prev = b2;
+
+ bp.next = b2;
+ b2.prev = bp;
+
+ return b2;
+ }
+
+ // create a node and optionally link it with previous one (in a circular doubly linked list)
+ function insertNode(i, x, y, last) {
+ var p = new Node(i, x, y);
+
+ if (!last) {
+ p.prev = p;
+ p.next = p;
+
+ } else {
+ p.next = last.next;
+ p.prev = last;
+ last.next.prev = p;
+ last.next = p;
+ }
+ return p;
+ }
+
+ function removeNode(p) {
+ p.next.prev = p.prev;
+ p.prev.next = p.next;
+
+ if (p.prevZ) p.prevZ.nextZ = p.nextZ;
+ if (p.nextZ) p.nextZ.prevZ = p.prevZ;
+ }
+
+ function Node(i, x, y) {
+ // vertex index in coordinates array
+ this.i = i;
+
+ // vertex coordinates
+ this.x = x;
+ this.y = y;
+
+ // previous and next vertex nodes in a polygon ring
+ this.prev = null;
+ this.next = null;
+
+ // z-order curve value
+ this.z = 0;
+
+ // previous and next nodes in z-order
+ this.prevZ = null;
+ this.nextZ = null;
+
+ // indicates whether this is a steiner point
+ this.steiner = false;
+ }
+
+ // return a percentage difference between the polygon area and its triangulation area;
+ // used to verify correctness of triangulation
+ earcut.deviation = function (data, holeIndices, dim, triangles) {
+ var hasHoles = holeIndices && holeIndices.length;
+ var outerLen = hasHoles ? holeIndices[0] * dim : data.length;
+
+ var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));
+ if (hasHoles) {
+ for (var i = 0, len = holeIndices.length; i < len; i++) {
+ var start = holeIndices[i] * dim;
+ var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
+ polygonArea -= Math.abs(signedArea(data, start, end, dim));
+ }
+ }
+
+ var trianglesArea = 0;
+ for (i = 0; i < triangles.length; i += 3) {
+ var a = triangles[i] * dim;
+ var b = triangles[i + 1] * dim;
+ var c = triangles[i + 2] * dim;
+ trianglesArea += Math.abs(
+ (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -
+ (data[a] - data[b]) * (data[c + 1] - data[a + 1]));
+ }
+
+ return polygonArea === 0 && trianglesArea === 0 ? 0 :
+ Math.abs((trianglesArea - polygonArea) / polygonArea);
+ };
+
+ function signedArea(data, start, end, dim) {
+ var sum = 0;
+ for (var i = start, j = end - dim; i < end; i += dim) {
+ sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
+ j = i;
+ }
+ return sum;
+ }
+
+ // turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts
+ earcut.flatten = function (data) {
+ var dim = data[0][0].length,
+ result = {vertices: [], holes: [], dimensions: dim},
+ holeIndex = 0;
+
+ for (var i = 0; i < data.length; i++) {
+ for (var j = 0; j < data[i].length; j++) {
+ for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);
+ }
+ if (i > 0) {
+ holeIndex += data[i - 1].length;
+ result.holes.push(holeIndex);
+ }
+ }
+ return result;
+ };
+
+ /**
+ * Winding order defines the order of vertices for a triangle to be considered front-facing.
+ *
+ * @enum {Number}
+ */
+ const WindingOrder = {
+ /**
+ * Vertices are in clockwise order.
+ *
+ * @type {Number}
+ * @constant
+ */
+ CLOCKWISE: WebGLConstants.WebGLConstants.CW,
+
+ /**
+ * Vertices are in counter-clockwise order.
+ *
+ * @type {Number}
+ * @constant
+ */
+ COUNTER_CLOCKWISE: WebGLConstants.WebGLConstants.CCW,
+ };
+
+ /**
+ * @private
+ */
+ WindingOrder.validate = function (windingOrder) {
+ return (
+ windingOrder === WindingOrder.CLOCKWISE ||
+ windingOrder === WindingOrder.COUNTER_CLOCKWISE
+ );
+ };
+
+ var WindingOrder$1 = Object.freeze(WindingOrder);
+
+ const scaleToGeodeticHeightN = new Matrix3.Cartesian3();
+ const scaleToGeodeticHeightP = new Matrix3.Cartesian3();
+
+ /**
+ * @private
+ */
+ const PolygonPipeline = {};
+
+ /**
+ * @exception {DeveloperError} At least three positions are required.
+ */
+ PolygonPipeline.computeArea2D = function (positions) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("positions", positions);
+ Check.Check.typeOf.number.greaterThanOrEquals(
+ "positions.length",
+ positions.length,
+ 3
+ );
+ //>>includeEnd('debug');
+
+ const length = positions.length;
+ let area = 0.0;
+
+ for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {
+ const v0 = positions[i0];
+ const v1 = positions[i1];
+
+ area += v0.x * v1.y - v1.x * v0.y;
+ }
+
+ return area * 0.5;
+ };
+
+ /**
+ * @returns {WindingOrder} The winding order.
+ *
+ * @exception {DeveloperError} At least three positions are required.
+ */
+ PolygonPipeline.computeWindingOrder2D = function (positions) {
+ const area = PolygonPipeline.computeArea2D(positions);
+ return area > 0.0 ? WindingOrder$1.COUNTER_CLOCKWISE : WindingOrder$1.CLOCKWISE;
+ };
+
+ /**
+ * Triangulate a polygon.
+ *
+ * @param {Cartesian2[]} positions Cartesian2 array containing the vertices of the polygon
+ * @param {Number[]} [holes] An array of the staring indices of the holes.
+ * @returns {Number[]} Index array representing triangles that fill the polygon
+ */
+ PolygonPipeline.triangulate = function (positions, holes) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("positions", positions);
+ //>>includeEnd('debug');
+
+ const flattenedPositions = Matrix2.Cartesian2.packArray(positions);
+ return earcut$1.exports(flattenedPositions, holes, 2);
+ };
+
+ const subdivisionV0Scratch = new Matrix3.Cartesian3();
+ const subdivisionV1Scratch = new Matrix3.Cartesian3();
+ const subdivisionV2Scratch = new Matrix3.Cartesian3();
+ const subdivisionS0Scratch = new Matrix3.Cartesian3();
+ const subdivisionS1Scratch = new Matrix3.Cartesian3();
+ const subdivisionS2Scratch = new Matrix3.Cartesian3();
+ const subdivisionMidScratch = new Matrix3.Cartesian3();
+ const subdivisionT0Scratch = new Matrix2.Cartesian2();
+ const subdivisionT1Scratch = new Matrix2.Cartesian2();
+ const subdivisionT2Scratch = new Matrix2.Cartesian2();
+ const subdivisionTexcoordMidScratch = new Matrix2.Cartesian2();
+
+ /**
+ * Subdivides positions and raises points to the surface of the ellipsoid.
+ *
+ * @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.
+ * @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.
+ * @param {Number[]} indices An array of indices that determines the triangles in the polygon.
+ * @param {Cartesian2[]} texcoords An optional array of {@link Cartesian2} texture coordinates of the polygon.
+ * @param {Number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ *
+ * @exception {DeveloperError} At least three indices are required.
+ * @exception {DeveloperError} The number of indices must be divisable by three.
+ * @exception {DeveloperError} Granularity must be greater than zero.
+ */
+ PolygonPipeline.computeSubdivision = function (
+ ellipsoid,
+ positions,
+ indices,
+ texcoords,
+ granularity
+ ) {
+ granularity = defaultValue.defaultValue(granularity, Math$1.CesiumMath.RADIANS_PER_DEGREE);
+
+ const hasTexcoords = defaultValue.defined(texcoords);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("ellipsoid", ellipsoid);
+ Check.Check.defined("positions", positions);
+ Check.Check.defined("indices", indices);
+ Check.Check.typeOf.number.greaterThanOrEquals("indices.length", indices.length, 3);
+ Check.Check.typeOf.number.equals("indices.length % 3", "0", indices.length % 3, 0);
+ Check.Check.typeOf.number.greaterThan("granularity", granularity, 0.0);
+ //>>includeEnd('debug');
+
+ // triangles that need (or might need) to be subdivided.
+ const triangles = indices.slice(0);
+
+ // New positions due to edge splits are appended to the positions list.
+ let i;
+ const length = positions.length;
+ const subdividedPositions = new Array(length * 3);
+ const subdividedTexcoords = new Array(length * 2);
+ let q = 0;
+ let p = 0;
+ for (i = 0; i < length; i++) {
+ const item = positions[i];
+ subdividedPositions[q++] = item.x;
+ subdividedPositions[q++] = item.y;
+ subdividedPositions[q++] = item.z;
+
+ if (hasTexcoords) {
+ const texcoordItem = texcoords[i];
+ subdividedTexcoords[p++] = texcoordItem.x;
+ subdividedTexcoords[p++] = texcoordItem.y;
+ }
+ }
+
+ const subdividedIndices = [];
+
+ // Used to make sure shared edges are not split more than once.
+ const edges = {};
+
+ const radius = ellipsoid.maximumRadius;
+ const minDistance = Math$1.CesiumMath.chordLength(granularity, radius);
+ const minDistanceSqrd = minDistance * minDistance;
+
+ while (triangles.length > 0) {
+ const i2 = triangles.pop();
+ const i1 = triangles.pop();
+ const i0 = triangles.pop();
+
+ const v0 = Matrix3.Cartesian3.fromArray(
+ subdividedPositions,
+ i0 * 3,
+ subdivisionV0Scratch
+ );
+ const v1 = Matrix3.Cartesian3.fromArray(
+ subdividedPositions,
+ i1 * 3,
+ subdivisionV1Scratch
+ );
+ const v2 = Matrix3.Cartesian3.fromArray(
+ subdividedPositions,
+ i2 * 3,
+ subdivisionV2Scratch
+ );
+
+ let t0, t1, t2;
+ if (hasTexcoords) {
+ t0 = Matrix2.Cartesian2.fromArray(
+ subdividedTexcoords,
+ i0 * 2,
+ subdivisionT0Scratch
+ );
+ t1 = Matrix2.Cartesian2.fromArray(
+ subdividedTexcoords,
+ i1 * 2,
+ subdivisionT1Scratch
+ );
+ t2 = Matrix2.Cartesian2.fromArray(
+ subdividedTexcoords,
+ i2 * 2,
+ subdivisionT2Scratch
+ );
+ }
+
+ const s0 = Matrix3.Cartesian3.multiplyByScalar(
+ Matrix3.Cartesian3.normalize(v0, subdivisionS0Scratch),
+ radius,
+ subdivisionS0Scratch
+ );
+ const s1 = Matrix3.Cartesian3.multiplyByScalar(
+ Matrix3.Cartesian3.normalize(v1, subdivisionS1Scratch),
+ radius,
+ subdivisionS1Scratch
+ );
+ const s2 = Matrix3.Cartesian3.multiplyByScalar(
+ Matrix3.Cartesian3.normalize(v2, subdivisionS2Scratch),
+ radius,
+ subdivisionS2Scratch
+ );
+
+ const g0 = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(s0, s1, subdivisionMidScratch)
+ );
+ const g1 = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(s1, s2, subdivisionMidScratch)
+ );
+ const g2 = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(s2, s0, subdivisionMidScratch)
+ );
+
+ const max = Math.max(g0, g1, g2);
+ let edge;
+ let mid;
+ let midTexcoord;
+
+ // if the max length squared of a triangle edge is greater than the chord length of squared
+ // of the granularity, subdivide the triangle
+ if (max > minDistanceSqrd) {
+ if (g0 === max) {
+ edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;
+
+ i = edges[edge];
+ if (!defaultValue.defined(i)) {
+ mid = Matrix3.Cartesian3.add(v0, v1, subdivisionMidScratch);
+ Matrix3.Cartesian3.multiplyByScalar(mid, 0.5, mid);
+ subdividedPositions.push(mid.x, mid.y, mid.z);
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+
+ if (hasTexcoords) {
+ midTexcoord = Matrix2.Cartesian2.add(t0, t1, subdivisionTexcoordMidScratch);
+ Matrix2.Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+
+ triangles.push(i0, i, i2);
+ triangles.push(i, i1, i2);
+ } else if (g1 === max) {
+ edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;
+
+ i = edges[edge];
+ if (!defaultValue.defined(i)) {
+ mid = Matrix3.Cartesian3.add(v1, v2, subdivisionMidScratch);
+ Matrix3.Cartesian3.multiplyByScalar(mid, 0.5, mid);
+ subdividedPositions.push(mid.x, mid.y, mid.z);
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+
+ if (hasTexcoords) {
+ midTexcoord = Matrix2.Cartesian2.add(t1, t2, subdivisionTexcoordMidScratch);
+ Matrix2.Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+
+ triangles.push(i1, i, i0);
+ triangles.push(i, i2, i0);
+ } else if (g2 === max) {
+ edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;
+
+ i = edges[edge];
+ if (!defaultValue.defined(i)) {
+ mid = Matrix3.Cartesian3.add(v2, v0, subdivisionMidScratch);
+ Matrix3.Cartesian3.multiplyByScalar(mid, 0.5, mid);
+ subdividedPositions.push(mid.x, mid.y, mid.z);
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+
+ if (hasTexcoords) {
+ midTexcoord = Matrix2.Cartesian2.add(t2, t0, subdivisionTexcoordMidScratch);
+ Matrix2.Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+
+ triangles.push(i2, i, i1);
+ triangles.push(i, i0, i1);
+ }
+ } else {
+ subdividedIndices.push(i0);
+ subdividedIndices.push(i1);
+ subdividedIndices.push(i2);
+ }
+ }
+
+ const geometryOptions = {
+ attributes: {
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: subdividedPositions,
+ }),
+ },
+ indices: subdividedIndices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ };
+
+ if (hasTexcoords) {
+ geometryOptions.attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: subdividedTexcoords,
+ });
+ }
+
+ return new GeometryAttribute.Geometry(geometryOptions);
+ };
+
+ const subdivisionC0Scratch = new Matrix3.Cartographic();
+ const subdivisionC1Scratch = new Matrix3.Cartographic();
+ const subdivisionC2Scratch = new Matrix3.Cartographic();
+ const subdivisionCartographicScratch = new Matrix3.Cartographic();
+
+ /**
+ * Subdivides positions on rhumb lines and raises points to the surface of the ellipsoid.
+ *
+ * @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.
+ * @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.
+ * @param {Number[]} indices An array of indices that determines the triangles in the polygon.
+ * @param {Cartesian2[]} texcoords An optional array of {@link Cartesian2} texture coordinates of the polygon.
+ * @param {Number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ *
+ * @exception {DeveloperError} At least three indices are required.
+ * @exception {DeveloperError} The number of indices must be divisable by three.
+ * @exception {DeveloperError} Granularity must be greater than zero.
+ */
+ PolygonPipeline.computeRhumbLineSubdivision = function (
+ ellipsoid,
+ positions,
+ indices,
+ texcoords,
+ granularity
+ ) {
+ granularity = defaultValue.defaultValue(granularity, Math$1.CesiumMath.RADIANS_PER_DEGREE);
+
+ const hasTexcoords = defaultValue.defined(texcoords);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("ellipsoid", ellipsoid);
+ Check.Check.defined("positions", positions);
+ Check.Check.defined("indices", indices);
+ Check.Check.typeOf.number.greaterThanOrEquals("indices.length", indices.length, 3);
+ Check.Check.typeOf.number.equals("indices.length % 3", "0", indices.length % 3, 0);
+ Check.Check.typeOf.number.greaterThan("granularity", granularity, 0.0);
+ //>>includeEnd('debug');
+
+ // triangles that need (or might need) to be subdivided.
+ const triangles = indices.slice(0);
+
+ // New positions due to edge splits are appended to the positions list.
+ let i;
+ const length = positions.length;
+ const subdividedPositions = new Array(length * 3);
+ const subdividedTexcoords = new Array(length * 2);
+ let q = 0;
+ let p = 0;
+ for (i = 0; i < length; i++) {
+ const item = positions[i];
+ subdividedPositions[q++] = item.x;
+ subdividedPositions[q++] = item.y;
+ subdividedPositions[q++] = item.z;
+
+ if (hasTexcoords) {
+ const texcoordItem = texcoords[i];
+ subdividedTexcoords[p++] = texcoordItem.x;
+ subdividedTexcoords[p++] = texcoordItem.y;
+ }
+ }
+
+ const subdividedIndices = [];
+
+ // Used to make sure shared edges are not split more than once.
+ const edges = {};
+
+ const radius = ellipsoid.maximumRadius;
+ const minDistance = Math$1.CesiumMath.chordLength(granularity, radius);
+
+ const rhumb0 = new EllipsoidRhumbLine.EllipsoidRhumbLine(undefined, undefined, ellipsoid);
+ const rhumb1 = new EllipsoidRhumbLine.EllipsoidRhumbLine(undefined, undefined, ellipsoid);
+ const rhumb2 = new EllipsoidRhumbLine.EllipsoidRhumbLine(undefined, undefined, ellipsoid);
+
+ while (triangles.length > 0) {
+ const i2 = triangles.pop();
+ const i1 = triangles.pop();
+ const i0 = triangles.pop();
+
+ const v0 = Matrix3.Cartesian3.fromArray(
+ subdividedPositions,
+ i0 * 3,
+ subdivisionV0Scratch
+ );
+ const v1 = Matrix3.Cartesian3.fromArray(
+ subdividedPositions,
+ i1 * 3,
+ subdivisionV1Scratch
+ );
+ const v2 = Matrix3.Cartesian3.fromArray(
+ subdividedPositions,
+ i2 * 3,
+ subdivisionV2Scratch
+ );
+
+ let t0, t1, t2;
+ if (hasTexcoords) {
+ t0 = Matrix2.Cartesian2.fromArray(
+ subdividedTexcoords,
+ i0 * 2,
+ subdivisionT0Scratch
+ );
+ t1 = Matrix2.Cartesian2.fromArray(
+ subdividedTexcoords,
+ i1 * 2,
+ subdivisionT1Scratch
+ );
+ t2 = Matrix2.Cartesian2.fromArray(
+ subdividedTexcoords,
+ i2 * 2,
+ subdivisionT2Scratch
+ );
+ }
+
+ const c0 = ellipsoid.cartesianToCartographic(v0, subdivisionC0Scratch);
+ const c1 = ellipsoid.cartesianToCartographic(v1, subdivisionC1Scratch);
+ const c2 = ellipsoid.cartesianToCartographic(v2, subdivisionC2Scratch);
+
+ rhumb0.setEndPoints(c0, c1);
+ const g0 = rhumb0.surfaceDistance;
+ rhumb1.setEndPoints(c1, c2);
+ const g1 = rhumb1.surfaceDistance;
+ rhumb2.setEndPoints(c2, c0);
+ const g2 = rhumb2.surfaceDistance;
+
+ const max = Math.max(g0, g1, g2);
+ let edge;
+ let mid;
+ let midHeight;
+ let midCartesian3;
+ let midTexcoord;
+
+ // if the max length squared of a triangle edge is greater than granularity, subdivide the triangle
+ if (max > minDistance) {
+ if (g0 === max) {
+ edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;
+
+ i = edges[edge];
+ if (!defaultValue.defined(i)) {
+ mid = rhumb0.interpolateUsingFraction(
+ 0.5,
+ subdivisionCartographicScratch
+ );
+ midHeight = (c0.height + c1.height) * 0.5;
+ midCartesian3 = Matrix3.Cartesian3.fromRadians(
+ mid.longitude,
+ mid.latitude,
+ midHeight,
+ ellipsoid,
+ subdivisionMidScratch
+ );
+ subdividedPositions.push(
+ midCartesian3.x,
+ midCartesian3.y,
+ midCartesian3.z
+ );
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+
+ if (hasTexcoords) {
+ midTexcoord = Matrix2.Cartesian2.add(t0, t1, subdivisionTexcoordMidScratch);
+ Matrix2.Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+
+ triangles.push(i0, i, i2);
+ triangles.push(i, i1, i2);
+ } else if (g1 === max) {
+ edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;
+
+ i = edges[edge];
+ if (!defaultValue.defined(i)) {
+ mid = rhumb1.interpolateUsingFraction(
+ 0.5,
+ subdivisionCartographicScratch
+ );
+ midHeight = (c1.height + c2.height) * 0.5;
+ midCartesian3 = Matrix3.Cartesian3.fromRadians(
+ mid.longitude,
+ mid.latitude,
+ midHeight,
+ ellipsoid,
+ subdivisionMidScratch
+ );
+ subdividedPositions.push(
+ midCartesian3.x,
+ midCartesian3.y,
+ midCartesian3.z
+ );
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+
+ if (hasTexcoords) {
+ midTexcoord = Matrix2.Cartesian2.add(t1, t2, subdivisionTexcoordMidScratch);
+ Matrix2.Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+
+ triangles.push(i1, i, i0);
+ triangles.push(i, i2, i0);
+ } else if (g2 === max) {
+ edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;
+
+ i = edges[edge];
+ if (!defaultValue.defined(i)) {
+ mid = rhumb2.interpolateUsingFraction(
+ 0.5,
+ subdivisionCartographicScratch
+ );
+ midHeight = (c2.height + c0.height) * 0.5;
+ midCartesian3 = Matrix3.Cartesian3.fromRadians(
+ mid.longitude,
+ mid.latitude,
+ midHeight,
+ ellipsoid,
+ subdivisionMidScratch
+ );
+ subdividedPositions.push(
+ midCartesian3.x,
+ midCartesian3.y,
+ midCartesian3.z
+ );
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+
+ if (hasTexcoords) {
+ midTexcoord = Matrix2.Cartesian2.add(t2, t0, subdivisionTexcoordMidScratch);
+ Matrix2.Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+
+ triangles.push(i2, i, i1);
+ triangles.push(i, i0, i1);
+ }
+ } else {
+ subdividedIndices.push(i0);
+ subdividedIndices.push(i1);
+ subdividedIndices.push(i2);
+ }
+ }
+
+ const geometryOptions = {
+ attributes: {
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: subdividedPositions,
+ }),
+ },
+ indices: subdividedIndices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ };
+
+ if (hasTexcoords) {
+ geometryOptions.attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: subdividedTexcoords,
+ });
+ }
+
+ return new GeometryAttribute.Geometry(geometryOptions);
+ };
+
+ /**
+ * Scales each position of a geometry's position attribute to a height, in place.
+ *
+ * @param {Number[]} positions The array of numbers representing the positions to be scaled
+ * @param {Number} [height=0.0] The desired height to add to the positions
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
+ * @param {Boolean} [scaleToSurface=true] true
if the positions need to be scaled to the surface before the height is added.
+ * @returns {Number[]} The input array of positions, scaled to height
+ */
+ PolygonPipeline.scaleToGeodeticHeight = function (
+ positions,
+ height,
+ ellipsoid,
+ scaleToSurface
+ ) {
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+
+ let n = scaleToGeodeticHeightN;
+ let p = scaleToGeodeticHeightP;
+
+ height = defaultValue.defaultValue(height, 0.0);
+ scaleToSurface = defaultValue.defaultValue(scaleToSurface, true);
+
+ if (defaultValue.defined(positions)) {
+ const length = positions.length;
+
+ for (let i = 0; i < length; i += 3) {
+ Matrix3.Cartesian3.fromArray(positions, i, p);
+
+ if (scaleToSurface) {
+ p = ellipsoid.scaleToGeodeticSurface(p, p);
+ }
+
+ if (height !== 0) {
+ n = ellipsoid.geodeticSurfaceNormal(p, n);
+
+ Matrix3.Cartesian3.multiplyByScalar(n, height, n);
+ Matrix3.Cartesian3.add(p, n, p);
+ }
+
+ positions[i] = p.x;
+ positions[i + 1] = p.y;
+ positions[i + 2] = p.z;
+ }
+ }
+
+ return positions;
+ };
+ var PolygonPipeline$1 = PolygonPipeline;
+
+ exports.PolygonPipeline = PolygonPipeline$1;
+ exports.WindingOrder = WindingOrder$1;
+
+}));
+//# sourceMappingURL=PolygonPipeline-313487c3.js.map
diff --git a/examples/cesium/Workers/PolygonPipeline-313487c3.js.map b/examples/cesium/Workers/PolygonPipeline-313487c3.js.map
new file mode 100644
index 0000000..7998139
--- /dev/null
+++ b/examples/cesium/Workers/PolygonPipeline-313487c3.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PolygonPipeline-313487c3.js","sources":["../../../node_modules/earcut/src/earcut.js","../../../Source/Core/WindingOrder.js","../../../Source/Core/PolygonPipeline.js"],"sourcesContent":["'use strict';\n\nmodule.exports = earcut;\nmodule.exports.default = earcut;\n\nfunction earcut(data, holeIndices, dim) {\n\n dim = dim || 2;\n\n var hasHoles = holeIndices && holeIndices.length,\n outerLen = hasHoles ? holeIndices[0] * dim : data.length,\n outerNode = linkedList(data, 0, outerLen, dim, true),\n triangles = [];\n\n if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n var minX, minY, maxX, maxY, x, y, invSize;\n\n if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n if (data.length > 80 * dim) {\n minX = maxX = data[0];\n minY = maxY = data[1];\n\n for (var i = dim; i < outerLen; i += dim) {\n x = data[i];\n y = data[i + 1];\n if (x < minX) minX = x;\n if (y < minY) minY = y;\n if (x > maxX) maxX = x;\n if (y > maxY) maxY = y;\n }\n\n // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n invSize = Math.max(maxX - minX, maxY - minY);\n invSize = invSize !== 0 ? 32767 / invSize : 0;\n }\n\n earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n var i, last;\n\n if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n } else {\n for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n }\n\n if (last && equals(last, last.next)) {\n removeNode(last);\n last = last.next;\n }\n\n return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n if (!start) return start;\n if (!end) end = start;\n\n var p = start,\n again;\n do {\n again = false;\n\n if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n removeNode(p);\n p = end = p.prev;\n if (p === p.next) break;\n again = true;\n\n } else {\n p = p.next;\n }\n } while (again || p !== end);\n\n return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n if (!ear) return;\n\n // interlink polygon nodes in z-order\n if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n var stop = ear,\n prev, next;\n\n // iterate through ears, slicing them one by one\n while (ear.prev !== ear.next) {\n prev = ear.prev;\n next = ear.next;\n\n if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n // cut off the triangle\n triangles.push(prev.i / dim | 0);\n triangles.push(ear.i / dim | 0);\n triangles.push(next.i / dim | 0);\n\n removeNode(ear);\n\n // skipping the next vertex leads to less sliver triangles\n ear = next.next;\n stop = next.next;\n\n continue;\n }\n\n ear = next;\n\n // if we looped through the whole remaining polygon and can't find any more ears\n if (ear === stop) {\n // try filtering points and slicing again\n if (!pass) {\n earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n // if this didn't work, try curing all small self-intersections locally\n } else if (pass === 1) {\n ear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n // as a last resort, try splitting the remaining polygon into two\n } else if (pass === 2) {\n splitEarcut(ear, triangles, dim, minX, minY, invSize);\n }\n\n break;\n }\n }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n // now make sure we don't have other points inside the potential ear\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n var p = c.next;\n while (p !== a) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n area(p.prev, p, p.next) >= 0) return false;\n p = p.next;\n }\n\n return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n var a = ear.prev,\n b = ear,\n c = ear.next;\n\n if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n // triangle bbox; min & max are calculated like this for speed\n var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n // z-order range for the current triangle bbox;\n var minZ = zOrder(x0, y0, minX, minY, invSize),\n maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n var p = ear.prevZ,\n n = ear.nextZ;\n\n // look for points inside the triangle in both directions\n while (p && p.z >= minZ && n && n.z <= maxZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n // look for remaining points in decreasing z-order\n while (p && p.z >= minZ) {\n if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n p = p.prevZ;\n }\n\n // look for remaining points in increasing z-order\n while (n && n.z <= maxZ) {\n if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n n = n.nextZ;\n }\n\n return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles, dim) {\n var p = start;\n do {\n var a = p.prev,\n b = p.next.next;\n\n if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n triangles.push(a.i / dim | 0);\n triangles.push(p.i / dim | 0);\n triangles.push(b.i / dim | 0);\n\n // remove two nodes involved\n removeNode(p);\n removeNode(p.next);\n\n p = start = b;\n }\n p = p.next;\n } while (p !== start);\n\n return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n // look for a valid diagonal that divides the polygon into two\n var a = start;\n do {\n var b = a.next.next;\n while (b !== a.prev) {\n if (a.i !== b.i && isValidDiagonal(a, b)) {\n // split the polygon in two by the diagonal\n var c = splitPolygon(a, b);\n\n // filter colinear points around the cuts\n a = filterPoints(a, a.next);\n c = filterPoints(c, c.next);\n\n // run earcut on each half\n earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n return;\n }\n b = b.next;\n }\n a = a.next;\n } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n var queue = [],\n i, len, start, end, list;\n\n for (i = 0, len = holeIndices.length; i < len; i++) {\n start = holeIndices[i] * dim;\n end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n list = linkedList(data, start, end, dim, false);\n if (list === list.next) list.steiner = true;\n queue.push(getLeftmost(list));\n }\n\n queue.sort(compareX);\n\n // process holes from left to right\n for (i = 0; i < queue.length; i++) {\n outerNode = eliminateHole(queue[i], outerNode);\n }\n\n return outerNode;\n}\n\nfunction compareX(a, b) {\n return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n var bridge = findHoleBridge(hole, outerNode);\n if (!bridge) {\n return outerNode;\n }\n\n var bridgeReverse = splitPolygon(bridge, hole);\n\n // filter collinear points around the cuts\n filterPoints(bridgeReverse, bridgeReverse.next);\n return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n var p = outerNode,\n hx = hole.x,\n hy = hole.y,\n qx = -Infinity,\n m;\n\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n if (x <= hx && x > qx) {\n qx = x;\n m = p.x < p.next.x ? p : p.next;\n if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n }\n }\n p = p.next;\n } while (p !== outerNode);\n\n if (!m) return null;\n\n // look for points inside the triangle of hole point, segment intersection and endpoint;\n // if there are no points found, we have a valid connection;\n // otherwise choose the point of the minimum angle with the ray as connection point\n\n var stop = m,\n mx = m.x,\n my = m.y,\n tanMin = Infinity,\n tan;\n\n p = m;\n\n do {\n if (hx >= p.x && p.x >= mx && hx !== p.x &&\n pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n if (locallyInside(p, hole) &&\n (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n m = p;\n tanMin = tan;\n }\n }\n\n p = p.next;\n } while (p !== stop);\n\n return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n var p = start;\n do {\n if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n p.prevZ = p.prev;\n p.nextZ = p.next;\n p = p.next;\n } while (p !== start);\n\n p.prevZ.nextZ = null;\n p.prevZ = null;\n\n sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n var i, p, q, e, tail, numMerges, pSize, qSize,\n inSize = 1;\n\n do {\n p = list;\n list = null;\n tail = null;\n numMerges = 0;\n\n while (p) {\n numMerges++;\n q = p;\n pSize = 0;\n for (i = 0; i < inSize; i++) {\n pSize++;\n q = q.nextZ;\n if (!q) break;\n }\n qSize = inSize;\n\n while (pSize > 0 || (qSize > 0 && q)) {\n\n if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n e = p;\n p = p.nextZ;\n pSize--;\n } else {\n e = q;\n q = q.nextZ;\n qSize--;\n }\n\n if (tail) tail.nextZ = e;\n else list = e;\n\n e.prevZ = tail;\n tail = e;\n }\n\n p = q;\n }\n\n tail.nextZ = null;\n inSize *= 2;\n\n } while (numMerges > 1);\n\n return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n // coords are transformed into non-negative 15-bit integer range\n x = (x - minX) * invSize | 0;\n y = (y - minY) * invSize | 0;\n\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = (y | (y << 8)) & 0x00FF00FF;\n y = (y | (y << 4)) & 0x0F0F0F0F;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n\n return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n var p = start,\n leftmost = start;\n do {\n if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n p = p.next;\n } while (p !== start);\n\n return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n var o1 = sign(area(p1, q1, p2));\n var o2 = sign(area(p1, q1, q2));\n var o3 = sign(area(p2, q2, p1));\n var o4 = sign(area(p2, q2, q1));\n\n if (o1 !== o2 && o3 !== o4) return true; // general case\n\n if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n var p = a;\n do {\n if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n intersects(p, p.next, a, b)) return true;\n p = p.next;\n } while (p !== a);\n\n return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n return area(a.prev, a, a.next) < 0 ?\n area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n var p = a,\n inside = false,\n px = (a.x + b.x) / 2,\n py = (a.y + b.y) / 2;\n do {\n if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n inside = !inside;\n p = p.next;\n } while (p !== a);\n\n return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n var a2 = new Node(a.i, a.x, a.y),\n b2 = new Node(b.i, b.x, b.y),\n an = a.next,\n bp = b.prev;\n\n a.next = b;\n b.prev = a;\n\n a2.next = an;\n an.prev = a2;\n\n b2.next = a2;\n a2.prev = b2;\n\n bp.next = b2;\n b2.prev = bp;\n\n return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n var p = new Node(i, x, y);\n\n if (!last) {\n p.prev = p;\n p.next = p;\n\n } else {\n p.next = last.next;\n p.prev = last;\n last.next.prev = p;\n last.next = p;\n }\n return p;\n}\n\nfunction removeNode(p) {\n p.next.prev = p.prev;\n p.prev.next = p.next;\n\n if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction Node(i, x, y) {\n // vertex index in coordinates array\n this.i = i;\n\n // vertex coordinates\n this.x = x;\n this.y = y;\n\n // previous and next vertex nodes in a polygon ring\n this.prev = null;\n this.next = null;\n\n // z-order curve value\n this.z = 0;\n\n // previous and next nodes in z-order\n this.prevZ = null;\n this.nextZ = null;\n\n // indicates whether this is a steiner point\n this.steiner = false;\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nearcut.deviation = function (data, holeIndices, dim, triangles) {\n var hasHoles = holeIndices && holeIndices.length;\n var outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n if (hasHoles) {\n for (var i = 0, len = holeIndices.length; i < len; i++) {\n var start = holeIndices[i] * dim;\n var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n polygonArea -= Math.abs(signedArea(data, start, end, dim));\n }\n }\n\n var trianglesArea = 0;\n for (i = 0; i < triangles.length; i += 3) {\n var a = triangles[i] * dim;\n var b = triangles[i + 1] * dim;\n var c = triangles[i + 2] * dim;\n trianglesArea += Math.abs(\n (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n }\n\n return polygonArea === 0 && trianglesArea === 0 ? 0 :\n Math.abs((trianglesArea - polygonArea) / polygonArea);\n};\n\nfunction signedArea(data, start, end, dim) {\n var sum = 0;\n for (var i = start, j = end - dim; i < end; i += dim) {\n sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n j = i;\n }\n return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nearcut.flatten = function (data) {\n var dim = data[0][0].length,\n result = {vertices: [], holes: [], dimensions: dim},\n holeIndex = 0;\n\n for (var i = 0; i < data.length; i++) {\n for (var j = 0; j < data[i].length; j++) {\n for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);\n }\n if (i > 0) {\n holeIndex += data[i - 1].length;\n result.holes.push(holeIndex);\n }\n }\n return result;\n};\n","import WebGLConstants from \"./WebGLConstants.js\";\r\n\r\n/**\r\n * Winding order defines the order of vertices for a triangle to be considered front-facing.\r\n *\r\n * @enum {Number}\r\n */\r\nconst WindingOrder = {\r\n /**\r\n * Vertices are in clockwise order.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n CLOCKWISE: WebGLConstants.CW,\r\n\r\n /**\r\n * Vertices are in counter-clockwise order.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n COUNTER_CLOCKWISE: WebGLConstants.CCW,\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nWindingOrder.validate = function (windingOrder) {\r\n return (\r\n windingOrder === WindingOrder.CLOCKWISE ||\r\n windingOrder === WindingOrder.COUNTER_CLOCKWISE\r\n );\r\n};\r\n\r\nexport default Object.freeze(WindingOrder);\r\n","import earcut from \"earcut\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport WindingOrder from \"./WindingOrder.js\";\r\n\r\nconst scaleToGeodeticHeightN = new Cartesian3();\r\nconst scaleToGeodeticHeightP = new Cartesian3();\r\n\r\n/**\r\n * @private\r\n */\r\nconst PolygonPipeline = {};\r\n\r\n/**\r\n * @exception {DeveloperError} At least three positions are required.\r\n */\r\nPolygonPipeline.computeArea2D = function (positions) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"positions\", positions);\r\n Check.typeOf.number.greaterThanOrEquals(\r\n \"positions.length\",\r\n positions.length,\r\n 3\r\n );\r\n //>>includeEnd('debug');\r\n\r\n const length = positions.length;\r\n let area = 0.0;\r\n\r\n for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {\r\n const v0 = positions[i0];\r\n const v1 = positions[i1];\r\n\r\n area += v0.x * v1.y - v1.x * v0.y;\r\n }\r\n\r\n return area * 0.5;\r\n};\r\n\r\n/**\r\n * @returns {WindingOrder} The winding order.\r\n *\r\n * @exception {DeveloperError} At least three positions are required.\r\n */\r\nPolygonPipeline.computeWindingOrder2D = function (positions) {\r\n const area = PolygonPipeline.computeArea2D(positions);\r\n return area > 0.0 ? WindingOrder.COUNTER_CLOCKWISE : WindingOrder.CLOCKWISE;\r\n};\r\n\r\n/**\r\n * Triangulate a polygon.\r\n *\r\n * @param {Cartesian2[]} positions Cartesian2 array containing the vertices of the polygon\r\n * @param {Number[]} [holes] An array of the staring indices of the holes.\r\n * @returns {Number[]} Index array representing triangles that fill the polygon\r\n */\r\nPolygonPipeline.triangulate = function (positions, holes) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"positions\", positions);\r\n //>>includeEnd('debug');\r\n\r\n const flattenedPositions = Cartesian2.packArray(positions);\r\n return earcut(flattenedPositions, holes, 2);\r\n};\r\n\r\nconst subdivisionV0Scratch = new Cartesian3();\r\nconst subdivisionV1Scratch = new Cartesian3();\r\nconst subdivisionV2Scratch = new Cartesian3();\r\nconst subdivisionS0Scratch = new Cartesian3();\r\nconst subdivisionS1Scratch = new Cartesian3();\r\nconst subdivisionS2Scratch = new Cartesian3();\r\nconst subdivisionMidScratch = new Cartesian3();\r\nconst subdivisionT0Scratch = new Cartesian2();\r\nconst subdivisionT1Scratch = new Cartesian2();\r\nconst subdivisionT2Scratch = new Cartesian2();\r\nconst subdivisionTexcoordMidScratch = new Cartesian2();\r\n\r\n/**\r\n * Subdivides positions and raises points to the surface of the ellipsoid.\r\n *\r\n * @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.\r\n * @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.\r\n * @param {Number[]} indices An array of indices that determines the triangles in the polygon.\r\n * @param {Cartesian2[]} texcoords An optional array of {@link Cartesian2} texture coordinates of the polygon.\r\n * @param {Number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n *\r\n * @exception {DeveloperError} At least three indices are required.\r\n * @exception {DeveloperError} The number of indices must be divisable by three.\r\n * @exception {DeveloperError} Granularity must be greater than zero.\r\n */\r\nPolygonPipeline.computeSubdivision = function (\r\n ellipsoid,\r\n positions,\r\n indices,\r\n texcoords,\r\n granularity\r\n) {\r\n granularity = defaultValue(granularity, CesiumMath.RADIANS_PER_DEGREE);\r\n\r\n const hasTexcoords = defined(texcoords);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"ellipsoid\", ellipsoid);\r\n Check.defined(\"positions\", positions);\r\n Check.defined(\"indices\", indices);\r\n Check.typeOf.number.greaterThanOrEquals(\"indices.length\", indices.length, 3);\r\n Check.typeOf.number.equals(\"indices.length % 3\", \"0\", indices.length % 3, 0);\r\n Check.typeOf.number.greaterThan(\"granularity\", granularity, 0.0);\r\n //>>includeEnd('debug');\r\n\r\n // triangles that need (or might need) to be subdivided.\r\n const triangles = indices.slice(0);\r\n\r\n // New positions due to edge splits are appended to the positions list.\r\n let i;\r\n const length = positions.length;\r\n const subdividedPositions = new Array(length * 3);\r\n const subdividedTexcoords = new Array(length * 2);\r\n let q = 0;\r\n let p = 0;\r\n for (i = 0; i < length; i++) {\r\n const item = positions[i];\r\n subdividedPositions[q++] = item.x;\r\n subdividedPositions[q++] = item.y;\r\n subdividedPositions[q++] = item.z;\r\n\r\n if (hasTexcoords) {\r\n const texcoordItem = texcoords[i];\r\n subdividedTexcoords[p++] = texcoordItem.x;\r\n subdividedTexcoords[p++] = texcoordItem.y;\r\n }\r\n }\r\n\r\n const subdividedIndices = [];\r\n\r\n // Used to make sure shared edges are not split more than once.\r\n const edges = {};\r\n\r\n const radius = ellipsoid.maximumRadius;\r\n const minDistance = CesiumMath.chordLength(granularity, radius);\r\n const minDistanceSqrd = minDistance * minDistance;\r\n\r\n while (triangles.length > 0) {\r\n const i2 = triangles.pop();\r\n const i1 = triangles.pop();\r\n const i0 = triangles.pop();\r\n\r\n const v0 = Cartesian3.fromArray(\r\n subdividedPositions,\r\n i0 * 3,\r\n subdivisionV0Scratch\r\n );\r\n const v1 = Cartesian3.fromArray(\r\n subdividedPositions,\r\n i1 * 3,\r\n subdivisionV1Scratch\r\n );\r\n const v2 = Cartesian3.fromArray(\r\n subdividedPositions,\r\n i2 * 3,\r\n subdivisionV2Scratch\r\n );\r\n\r\n let t0, t1, t2;\r\n if (hasTexcoords) {\r\n t0 = Cartesian2.fromArray(\r\n subdividedTexcoords,\r\n i0 * 2,\r\n subdivisionT0Scratch\r\n );\r\n t1 = Cartesian2.fromArray(\r\n subdividedTexcoords,\r\n i1 * 2,\r\n subdivisionT1Scratch\r\n );\r\n t2 = Cartesian2.fromArray(\r\n subdividedTexcoords,\r\n i2 * 2,\r\n subdivisionT2Scratch\r\n );\r\n }\r\n\r\n const s0 = Cartesian3.multiplyByScalar(\r\n Cartesian3.normalize(v0, subdivisionS0Scratch),\r\n radius,\r\n subdivisionS0Scratch\r\n );\r\n const s1 = Cartesian3.multiplyByScalar(\r\n Cartesian3.normalize(v1, subdivisionS1Scratch),\r\n radius,\r\n subdivisionS1Scratch\r\n );\r\n const s2 = Cartesian3.multiplyByScalar(\r\n Cartesian3.normalize(v2, subdivisionS2Scratch),\r\n radius,\r\n subdivisionS2Scratch\r\n );\r\n\r\n const g0 = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(s0, s1, subdivisionMidScratch)\r\n );\r\n const g1 = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(s1, s2, subdivisionMidScratch)\r\n );\r\n const g2 = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(s2, s0, subdivisionMidScratch)\r\n );\r\n\r\n const max = Math.max(g0, g1, g2);\r\n let edge;\r\n let mid;\r\n let midTexcoord;\r\n\r\n // if the max length squared of a triangle edge is greater than the chord length of squared\r\n // of the granularity, subdivide the triangle\r\n if (max > minDistanceSqrd) {\r\n if (g0 === max) {\r\n edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;\r\n\r\n i = edges[edge];\r\n if (!defined(i)) {\r\n mid = Cartesian3.add(v0, v1, subdivisionMidScratch);\r\n Cartesian3.multiplyByScalar(mid, 0.5, mid);\r\n subdividedPositions.push(mid.x, mid.y, mid.z);\r\n i = subdividedPositions.length / 3 - 1;\r\n edges[edge] = i;\r\n\r\n if (hasTexcoords) {\r\n midTexcoord = Cartesian2.add(t0, t1, subdivisionTexcoordMidScratch);\r\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\r\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\r\n }\r\n }\r\n\r\n triangles.push(i0, i, i2);\r\n triangles.push(i, i1, i2);\r\n } else if (g1 === max) {\r\n edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;\r\n\r\n i = edges[edge];\r\n if (!defined(i)) {\r\n mid = Cartesian3.add(v1, v2, subdivisionMidScratch);\r\n Cartesian3.multiplyByScalar(mid, 0.5, mid);\r\n subdividedPositions.push(mid.x, mid.y, mid.z);\r\n i = subdividedPositions.length / 3 - 1;\r\n edges[edge] = i;\r\n\r\n if (hasTexcoords) {\r\n midTexcoord = Cartesian2.add(t1, t2, subdivisionTexcoordMidScratch);\r\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\r\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\r\n }\r\n }\r\n\r\n triangles.push(i1, i, i0);\r\n triangles.push(i, i2, i0);\r\n } else if (g2 === max) {\r\n edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;\r\n\r\n i = edges[edge];\r\n if (!defined(i)) {\r\n mid = Cartesian3.add(v2, v0, subdivisionMidScratch);\r\n Cartesian3.multiplyByScalar(mid, 0.5, mid);\r\n subdividedPositions.push(mid.x, mid.y, mid.z);\r\n i = subdividedPositions.length / 3 - 1;\r\n edges[edge] = i;\r\n\r\n if (hasTexcoords) {\r\n midTexcoord = Cartesian2.add(t2, t0, subdivisionTexcoordMidScratch);\r\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\r\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\r\n }\r\n }\r\n\r\n triangles.push(i2, i, i1);\r\n triangles.push(i, i0, i1);\r\n }\r\n } else {\r\n subdividedIndices.push(i0);\r\n subdividedIndices.push(i1);\r\n subdividedIndices.push(i2);\r\n }\r\n }\r\n\r\n const geometryOptions = {\r\n attributes: {\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: subdividedPositions,\r\n }),\r\n },\r\n indices: subdividedIndices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n };\r\n\r\n if (hasTexcoords) {\r\n geometryOptions.attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: subdividedTexcoords,\r\n });\r\n }\r\n\r\n return new Geometry(geometryOptions);\r\n};\r\n\r\nconst subdivisionC0Scratch = new Cartographic();\r\nconst subdivisionC1Scratch = new Cartographic();\r\nconst subdivisionC2Scratch = new Cartographic();\r\nconst subdivisionCartographicScratch = new Cartographic();\r\n\r\n/**\r\n * Subdivides positions on rhumb lines and raises points to the surface of the ellipsoid.\r\n *\r\n * @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.\r\n * @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.\r\n * @param {Number[]} indices An array of indices that determines the triangles in the polygon.\r\n * @param {Cartesian2[]} texcoords An optional array of {@link Cartesian2} texture coordinates of the polygon.\r\n * @param {Number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n *\r\n * @exception {DeveloperError} At least three indices are required.\r\n * @exception {DeveloperError} The number of indices must be divisable by three.\r\n * @exception {DeveloperError} Granularity must be greater than zero.\r\n */\r\nPolygonPipeline.computeRhumbLineSubdivision = function (\r\n ellipsoid,\r\n positions,\r\n indices,\r\n texcoords,\r\n granularity\r\n) {\r\n granularity = defaultValue(granularity, CesiumMath.RADIANS_PER_DEGREE);\r\n\r\n const hasTexcoords = defined(texcoords);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"ellipsoid\", ellipsoid);\r\n Check.defined(\"positions\", positions);\r\n Check.defined(\"indices\", indices);\r\n Check.typeOf.number.greaterThanOrEquals(\"indices.length\", indices.length, 3);\r\n Check.typeOf.number.equals(\"indices.length % 3\", \"0\", indices.length % 3, 0);\r\n Check.typeOf.number.greaterThan(\"granularity\", granularity, 0.0);\r\n //>>includeEnd('debug');\r\n\r\n // triangles that need (or might need) to be subdivided.\r\n const triangles = indices.slice(0);\r\n\r\n // New positions due to edge splits are appended to the positions list.\r\n let i;\r\n const length = positions.length;\r\n const subdividedPositions = new Array(length * 3);\r\n const subdividedTexcoords = new Array(length * 2);\r\n let q = 0;\r\n let p = 0;\r\n for (i = 0; i < length; i++) {\r\n const item = positions[i];\r\n subdividedPositions[q++] = item.x;\r\n subdividedPositions[q++] = item.y;\r\n subdividedPositions[q++] = item.z;\r\n\r\n if (hasTexcoords) {\r\n const texcoordItem = texcoords[i];\r\n subdividedTexcoords[p++] = texcoordItem.x;\r\n subdividedTexcoords[p++] = texcoordItem.y;\r\n }\r\n }\r\n\r\n const subdividedIndices = [];\r\n\r\n // Used to make sure shared edges are not split more than once.\r\n const edges = {};\r\n\r\n const radius = ellipsoid.maximumRadius;\r\n const minDistance = CesiumMath.chordLength(granularity, radius);\r\n\r\n const rhumb0 = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\r\n const rhumb1 = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\r\n const rhumb2 = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\r\n\r\n while (triangles.length > 0) {\r\n const i2 = triangles.pop();\r\n const i1 = triangles.pop();\r\n const i0 = triangles.pop();\r\n\r\n const v0 = Cartesian3.fromArray(\r\n subdividedPositions,\r\n i0 * 3,\r\n subdivisionV0Scratch\r\n );\r\n const v1 = Cartesian3.fromArray(\r\n subdividedPositions,\r\n i1 * 3,\r\n subdivisionV1Scratch\r\n );\r\n const v2 = Cartesian3.fromArray(\r\n subdividedPositions,\r\n i2 * 3,\r\n subdivisionV2Scratch\r\n );\r\n\r\n let t0, t1, t2;\r\n if (hasTexcoords) {\r\n t0 = Cartesian2.fromArray(\r\n subdividedTexcoords,\r\n i0 * 2,\r\n subdivisionT0Scratch\r\n );\r\n t1 = Cartesian2.fromArray(\r\n subdividedTexcoords,\r\n i1 * 2,\r\n subdivisionT1Scratch\r\n );\r\n t2 = Cartesian2.fromArray(\r\n subdividedTexcoords,\r\n i2 * 2,\r\n subdivisionT2Scratch\r\n );\r\n }\r\n\r\n const c0 = ellipsoid.cartesianToCartographic(v0, subdivisionC0Scratch);\r\n const c1 = ellipsoid.cartesianToCartographic(v1, subdivisionC1Scratch);\r\n const c2 = ellipsoid.cartesianToCartographic(v2, subdivisionC2Scratch);\r\n\r\n rhumb0.setEndPoints(c0, c1);\r\n const g0 = rhumb0.surfaceDistance;\r\n rhumb1.setEndPoints(c1, c2);\r\n const g1 = rhumb1.surfaceDistance;\r\n rhumb2.setEndPoints(c2, c0);\r\n const g2 = rhumb2.surfaceDistance;\r\n\r\n const max = Math.max(g0, g1, g2);\r\n let edge;\r\n let mid;\r\n let midHeight;\r\n let midCartesian3;\r\n let midTexcoord;\r\n\r\n // if the max length squared of a triangle edge is greater than granularity, subdivide the triangle\r\n if (max > minDistance) {\r\n if (g0 === max) {\r\n edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;\r\n\r\n i = edges[edge];\r\n if (!defined(i)) {\r\n mid = rhumb0.interpolateUsingFraction(\r\n 0.5,\r\n subdivisionCartographicScratch\r\n );\r\n midHeight = (c0.height + c1.height) * 0.5;\r\n midCartesian3 = Cartesian3.fromRadians(\r\n mid.longitude,\r\n mid.latitude,\r\n midHeight,\r\n ellipsoid,\r\n subdivisionMidScratch\r\n );\r\n subdividedPositions.push(\r\n midCartesian3.x,\r\n midCartesian3.y,\r\n midCartesian3.z\r\n );\r\n i = subdividedPositions.length / 3 - 1;\r\n edges[edge] = i;\r\n\r\n if (hasTexcoords) {\r\n midTexcoord = Cartesian2.add(t0, t1, subdivisionTexcoordMidScratch);\r\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\r\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\r\n }\r\n }\r\n\r\n triangles.push(i0, i, i2);\r\n triangles.push(i, i1, i2);\r\n } else if (g1 === max) {\r\n edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;\r\n\r\n i = edges[edge];\r\n if (!defined(i)) {\r\n mid = rhumb1.interpolateUsingFraction(\r\n 0.5,\r\n subdivisionCartographicScratch\r\n );\r\n midHeight = (c1.height + c2.height) * 0.5;\r\n midCartesian3 = Cartesian3.fromRadians(\r\n mid.longitude,\r\n mid.latitude,\r\n midHeight,\r\n ellipsoid,\r\n subdivisionMidScratch\r\n );\r\n subdividedPositions.push(\r\n midCartesian3.x,\r\n midCartesian3.y,\r\n midCartesian3.z\r\n );\r\n i = subdividedPositions.length / 3 - 1;\r\n edges[edge] = i;\r\n\r\n if (hasTexcoords) {\r\n midTexcoord = Cartesian2.add(t1, t2, subdivisionTexcoordMidScratch);\r\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\r\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\r\n }\r\n }\r\n\r\n triangles.push(i1, i, i0);\r\n triangles.push(i, i2, i0);\r\n } else if (g2 === max) {\r\n edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;\r\n\r\n i = edges[edge];\r\n if (!defined(i)) {\r\n mid = rhumb2.interpolateUsingFraction(\r\n 0.5,\r\n subdivisionCartographicScratch\r\n );\r\n midHeight = (c2.height + c0.height) * 0.5;\r\n midCartesian3 = Cartesian3.fromRadians(\r\n mid.longitude,\r\n mid.latitude,\r\n midHeight,\r\n ellipsoid,\r\n subdivisionMidScratch\r\n );\r\n subdividedPositions.push(\r\n midCartesian3.x,\r\n midCartesian3.y,\r\n midCartesian3.z\r\n );\r\n i = subdividedPositions.length / 3 - 1;\r\n edges[edge] = i;\r\n\r\n if (hasTexcoords) {\r\n midTexcoord = Cartesian2.add(t2, t0, subdivisionTexcoordMidScratch);\r\n Cartesian2.multiplyByScalar(midTexcoord, 0.5, midTexcoord);\r\n subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);\r\n }\r\n }\r\n\r\n triangles.push(i2, i, i1);\r\n triangles.push(i, i0, i1);\r\n }\r\n } else {\r\n subdividedIndices.push(i0);\r\n subdividedIndices.push(i1);\r\n subdividedIndices.push(i2);\r\n }\r\n }\r\n\r\n const geometryOptions = {\r\n attributes: {\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: subdividedPositions,\r\n }),\r\n },\r\n indices: subdividedIndices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n };\r\n\r\n if (hasTexcoords) {\r\n geometryOptions.attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: subdividedTexcoords,\r\n });\r\n }\r\n\r\n return new Geometry(geometryOptions);\r\n};\r\n\r\n/**\r\n * Scales each position of a geometry's position attribute to a height, in place.\r\n *\r\n * @param {Number[]} positions The array of numbers representing the positions to be scaled\r\n * @param {Number} [height=0.0] The desired height to add to the positions\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\r\n * @param {Boolean} [scaleToSurface=true] true
if the positions need to be scaled to the surface before the height is added.\r\n * @returns {Number[]} The input array of positions, scaled to height\r\n */\r\nPolygonPipeline.scaleToGeodeticHeight = function (\r\n positions,\r\n height,\r\n ellipsoid,\r\n scaleToSurface\r\n) {\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n\r\n let n = scaleToGeodeticHeightN;\r\n let p = scaleToGeodeticHeightP;\r\n\r\n height = defaultValue(height, 0.0);\r\n scaleToSurface = defaultValue(scaleToSurface, true);\r\n\r\n if (defined(positions)) {\r\n const length = positions.length;\r\n\r\n for (let i = 0; i < length; i += 3) {\r\n Cartesian3.fromArray(positions, i, p);\r\n\r\n if (scaleToSurface) {\r\n p = ellipsoid.scaleToGeodeticSurface(p, p);\r\n }\r\n\r\n if (height !== 0) {\r\n n = ellipsoid.geodeticSurfaceNormal(p, n);\r\n\r\n Cartesian3.multiplyByScalar(n, height, n);\r\n Cartesian3.add(p, n, p);\r\n }\r\n\r\n positions[i] = p.x;\r\n positions[i + 1] = p.y;\r\n positions[i + 2] = p.z;\r\n }\r\n }\r\n\r\n return positions;\r\n};\r\nexport default PolygonPipeline;\r\n"],"names":["earcutModule","earcut_1","WebGLConstants","Cartesian3","Check","WindingOrder","Cartesian2","earcut","defaultValue","CesiumMath","defined","GeometryAttribute","ComponentDatatype","PrimitiveType","Geometry","Cartographic","EllipsoidRhumbLine","Ellipsoid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEAA,YAAc,CAAA,OAAA,GAAG,MAAM,CAAC;AACFC,oBAAA,CAAA,OAAA,GAAG,OAAO;AAChC;IACA,SAAS,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE;AACxC;IACA,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC;AACnB;IACA,IAAI,IAAI,QAAQ,GAAG,WAAW,IAAI,WAAW,CAAC,MAAM;IACpD,QAAQ,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM;IAChE,QAAQ,SAAS,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC;IAC5D,QAAQ,SAAS,GAAG,EAAE,CAAC;AACvB;I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,cAAc,GAAGA,yBAAY,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AACtD;IACA,EAAE,IAAIE,oBAAO,CAAC,SAAS,CAAC,EAAE;IAC1B,IAAI,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;AACpC;IACA,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;IACxC,MAAMP,kBAAU,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C;IACA,MAAM,IAAI,cAAc,EAAE;IAC1B,QAAQ,CAAC,GAAG,SAAS,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnD,OAAO;AACP;IACA,MAAM,IAAI,MAAM,KAAK,CAAC,EAAE;IACxB,QAAQ,CAAC,GAAG,SAAS,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAClD;IACA,QAAQA,kBAAU,CAAC,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAClD,QAAQA,kBAAU,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChC,OAAO;AACP;IACA,MAAM,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7B,KAAK;IACL,GAAG;AACH;IACA,EAAE,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC;AACF,4BAAe,eAAe;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/PolylinePipeline-3c021236.js b/examples/cesium/Workers/PolylinePipeline-3c021236.js
new file mode 100644
index 0000000..d5a5a92
--- /dev/null
+++ b/examples/cesium/Workers/PolylinePipeline-3c021236.js
@@ -0,0 +1,599 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './defaultValue-0ab18f7d', './Check-d10e5f2e', './EllipsoidGeodesic-38d0ed4a', './EllipsoidRhumbLine-48b4507b', './IntersectionTests-2c7928de', './Math-9be8b918', './Matrix2-036c77dd', './Plane-c9f1487d'], (function (exports, Matrix3, defaultValue, Check, EllipsoidGeodesic, EllipsoidRhumbLine, IntersectionTests, Math$1, Matrix2, Plane) { 'use strict';
+
+ /**
+ * @private
+ */
+ const PolylinePipeline = {};
+
+ PolylinePipeline.numberOfPoints = function (p0, p1, minDistance) {
+ const distance = Matrix3.Cartesian3.distance(p0, p1);
+ return Math.ceil(distance / minDistance);
+ };
+
+ PolylinePipeline.numberOfPointsRhumbLine = function (p0, p1, granularity) {
+ const radiansDistanceSquared =
+ Math.pow(p0.longitude - p1.longitude, 2) +
+ Math.pow(p0.latitude - p1.latitude, 2);
+
+ return Math.max(
+ 1,
+ Math.ceil(Math.sqrt(radiansDistanceSquared / (granularity * granularity)))
+ );
+ };
+
+ const cartoScratch = new Matrix3.Cartographic();
+ PolylinePipeline.extractHeights = function (positions, ellipsoid) {
+ const length = positions.length;
+ const heights = new Array(length);
+ for (let i = 0; i < length; i++) {
+ const p = positions[i];
+ heights[i] = ellipsoid.cartesianToCartographic(p, cartoScratch).height;
+ }
+ return heights;
+ };
+
+ const wrapLongitudeInversMatrix = new Matrix2.Matrix4();
+ const wrapLongitudeOrigin = new Matrix3.Cartesian3();
+ const wrapLongitudeXZNormal = new Matrix3.Cartesian3();
+ const wrapLongitudeXZPlane = new Plane.Plane(Matrix3.Cartesian3.UNIT_X, 0.0);
+ const wrapLongitudeYZNormal = new Matrix3.Cartesian3();
+ const wrapLongitudeYZPlane = new Plane.Plane(Matrix3.Cartesian3.UNIT_X, 0.0);
+ const wrapLongitudeIntersection = new Matrix3.Cartesian3();
+ const wrapLongitudeOffset = new Matrix3.Cartesian3();
+
+ const subdivideHeightsScratchArray = [];
+
+ function subdivideHeights(numPoints, h0, h1) {
+ const heights = subdivideHeightsScratchArray;
+ heights.length = numPoints;
+
+ let i;
+ if (h0 === h1) {
+ for (i = 0; i < numPoints; i++) {
+ heights[i] = h0;
+ }
+ return heights;
+ }
+
+ const dHeight = h1 - h0;
+ const heightPerVertex = dHeight / numPoints;
+
+ for (i = 0; i < numPoints; i++) {
+ const h = h0 + i * heightPerVertex;
+ heights[i] = h;
+ }
+
+ return heights;
+ }
+
+ const carto1 = new Matrix3.Cartographic();
+ const carto2 = new Matrix3.Cartographic();
+ const cartesian = new Matrix3.Cartesian3();
+ const scaleFirst = new Matrix3.Cartesian3();
+ const scaleLast = new Matrix3.Cartesian3();
+ const ellipsoidGeodesic = new EllipsoidGeodesic.EllipsoidGeodesic();
+ let ellipsoidRhumb = new EllipsoidRhumbLine.EllipsoidRhumbLine();
+
+ //Returns subdivided line scaled to ellipsoid surface starting at p1 and ending at p2.
+ //Result includes p1, but not include p2. This function is called for a sequence of line segments,
+ //and this prevents duplication of end point.
+ function generateCartesianArc(
+ p0,
+ p1,
+ minDistance,
+ ellipsoid,
+ h0,
+ h1,
+ array,
+ offset
+ ) {
+ const first = ellipsoid.scaleToGeodeticSurface(p0, scaleFirst);
+ const last = ellipsoid.scaleToGeodeticSurface(p1, scaleLast);
+ const numPoints = PolylinePipeline.numberOfPoints(p0, p1, minDistance);
+ const start = ellipsoid.cartesianToCartographic(first, carto1);
+ const end = ellipsoid.cartesianToCartographic(last, carto2);
+ const heights = subdivideHeights(numPoints, h0, h1);
+
+ ellipsoidGeodesic.setEndPoints(start, end);
+ const surfaceDistanceBetweenPoints =
+ ellipsoidGeodesic.surfaceDistance / numPoints;
+
+ let index = offset;
+ start.height = h0;
+ let cart = ellipsoid.cartographicToCartesian(start, cartesian);
+ Matrix3.Cartesian3.pack(cart, array, index);
+ index += 3;
+
+ for (let i = 1; i < numPoints; i++) {
+ const carto = ellipsoidGeodesic.interpolateUsingSurfaceDistance(
+ i * surfaceDistanceBetweenPoints,
+ carto2
+ );
+ carto.height = heights[i];
+ cart = ellipsoid.cartographicToCartesian(carto, cartesian);
+ Matrix3.Cartesian3.pack(cart, array, index);
+ index += 3;
+ }
+
+ return index;
+ }
+
+ //Returns subdivided line scaled to ellipsoid surface starting at p1 and ending at p2.
+ //Result includes p1, but not include p2. This function is called for a sequence of line segments,
+ //and this prevents duplication of end point.
+ function generateCartesianRhumbArc(
+ p0,
+ p1,
+ granularity,
+ ellipsoid,
+ h0,
+ h1,
+ array,
+ offset
+ ) {
+ const start = ellipsoid.cartesianToCartographic(p0, carto1);
+ const end = ellipsoid.cartesianToCartographic(p1, carto2);
+ const numPoints = PolylinePipeline.numberOfPointsRhumbLine(
+ start,
+ end,
+ granularity
+ );
+ start.height = 0.0;
+ end.height = 0.0;
+ const heights = subdivideHeights(numPoints, h0, h1);
+
+ if (!ellipsoidRhumb.ellipsoid.equals(ellipsoid)) {
+ ellipsoidRhumb = new EllipsoidRhumbLine.EllipsoidRhumbLine(undefined, undefined, ellipsoid);
+ }
+ ellipsoidRhumb.setEndPoints(start, end);
+ const surfaceDistanceBetweenPoints =
+ ellipsoidRhumb.surfaceDistance / numPoints;
+
+ let index = offset;
+ start.height = h0;
+ let cart = ellipsoid.cartographicToCartesian(start, cartesian);
+ Matrix3.Cartesian3.pack(cart, array, index);
+ index += 3;
+
+ for (let i = 1; i < numPoints; i++) {
+ const carto = ellipsoidRhumb.interpolateUsingSurfaceDistance(
+ i * surfaceDistanceBetweenPoints,
+ carto2
+ );
+ carto.height = heights[i];
+ cart = ellipsoid.cartographicToCartesian(carto, cartesian);
+ Matrix3.Cartesian3.pack(cart, array, index);
+ index += 3;
+ }
+
+ return index;
+ }
+
+ /**
+ * Breaks a {@link Polyline} into segments such that it does not cross the ±180 degree meridian of an ellipsoid.
+ *
+ * @param {Cartesian3[]} positions The polyline's Cartesian positions.
+ * @param {Matrix4} [modelMatrix=Matrix4.IDENTITY] The polyline's model matrix. Assumed to be an affine
+ * transformation matrix, where the upper left 3x3 elements are a rotation matrix, and
+ * the upper three elements in the fourth column are the translation. The bottom row is assumed to be [0, 0, 0, 1].
+ * The matrix is not verified to be in the proper form.
+ * @returns {Object} An object with a positions
property that is an array of positions and a
+ * segments
property.
+ *
+ *
+ * @example
+ * const polylines = new Cesium.PolylineCollection();
+ * const polyline = polylines.add(...);
+ * const positions = polyline.positions;
+ * const modelMatrix = polylines.modelMatrix;
+ * const segments = Cesium.PolylinePipeline.wrapLongitude(positions, modelMatrix);
+ *
+ * @see PolygonPipeline.wrapLongitude
+ * @see Polyline
+ * @see PolylineCollection
+ */
+ PolylinePipeline.wrapLongitude = function (positions, modelMatrix) {
+ const cartesians = [];
+ const segments = [];
+
+ if (defaultValue.defined(positions) && positions.length > 0) {
+ modelMatrix = defaultValue.defaultValue(modelMatrix, Matrix2.Matrix4.IDENTITY);
+ const inverseModelMatrix = Matrix2.Matrix4.inverseTransformation(
+ modelMatrix,
+ wrapLongitudeInversMatrix
+ );
+
+ const origin = Matrix2.Matrix4.multiplyByPoint(
+ inverseModelMatrix,
+ Matrix3.Cartesian3.ZERO,
+ wrapLongitudeOrigin
+ );
+ const xzNormal = Matrix3.Cartesian3.normalize(
+ Matrix2.Matrix4.multiplyByPointAsVector(
+ inverseModelMatrix,
+ Matrix3.Cartesian3.UNIT_Y,
+ wrapLongitudeXZNormal
+ ),
+ wrapLongitudeXZNormal
+ );
+ const xzPlane = Plane.Plane.fromPointNormal(
+ origin,
+ xzNormal,
+ wrapLongitudeXZPlane
+ );
+ const yzNormal = Matrix3.Cartesian3.normalize(
+ Matrix2.Matrix4.multiplyByPointAsVector(
+ inverseModelMatrix,
+ Matrix3.Cartesian3.UNIT_X,
+ wrapLongitudeYZNormal
+ ),
+ wrapLongitudeYZNormal
+ );
+ const yzPlane = Plane.Plane.fromPointNormal(
+ origin,
+ yzNormal,
+ wrapLongitudeYZPlane
+ );
+
+ let count = 1;
+ cartesians.push(Matrix3.Cartesian3.clone(positions[0]));
+ let prev = cartesians[0];
+
+ const length = positions.length;
+ for (let i = 1; i < length; ++i) {
+ const cur = positions[i];
+
+ // intersects the IDL if either endpoint is on the negative side of the yz-plane
+ if (
+ Plane.Plane.getPointDistance(yzPlane, prev) < 0.0 ||
+ Plane.Plane.getPointDistance(yzPlane, cur) < 0.0
+ ) {
+ // and intersects the xz-plane
+ const intersection = IntersectionTests.IntersectionTests.lineSegmentPlane(
+ prev,
+ cur,
+ xzPlane,
+ wrapLongitudeIntersection
+ );
+ if (defaultValue.defined(intersection)) {
+ // move point on the xz-plane slightly away from the plane
+ const offset = Matrix3.Cartesian3.multiplyByScalar(
+ xzNormal,
+ 5.0e-9,
+ wrapLongitudeOffset
+ );
+ if (Plane.Plane.getPointDistance(xzPlane, prev) < 0.0) {
+ Matrix3.Cartesian3.negate(offset, offset);
+ }
+
+ cartesians.push(
+ Matrix3.Cartesian3.add(intersection, offset, new Matrix3.Cartesian3())
+ );
+ segments.push(count + 1);
+
+ Matrix3.Cartesian3.negate(offset, offset);
+ cartesians.push(
+ Matrix3.Cartesian3.add(intersection, offset, new Matrix3.Cartesian3())
+ );
+ count = 1;
+ }
+ }
+
+ cartesians.push(Matrix3.Cartesian3.clone(positions[i]));
+ count++;
+
+ prev = cur;
+ }
+
+ segments.push(count);
+ }
+
+ return {
+ positions: cartesians,
+ lengths: segments,
+ };
+ };
+
+ /**
+ * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions.
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.
+ * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.
+ * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
+ * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid.
+ *
+ * @example
+ * const positions = Cesium.Cartesian3.fromDegreesArray([
+ * -105.0, 40.0,
+ * -100.0, 38.0,
+ * -105.0, 35.0,
+ * -100.0, 32.0
+ * ]);
+ * const surfacePositions = Cesium.PolylinePipeline.generateArc({
+ * positons: positions
+ * });
+ */
+ PolylinePipeline.generateArc = function (options) {
+ if (!defaultValue.defined(options)) {
+ options = {};
+ }
+ const positions = options.positions;
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(positions)) {
+ throw new Check.DeveloperError("options.positions is required.");
+ }
+ //>>includeEnd('debug');
+
+ const length = positions.length;
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ let height = defaultValue.defaultValue(options.height, 0);
+ const hasHeightArray = Array.isArray(height);
+
+ if (length < 1) {
+ return [];
+ } else if (length === 1) {
+ const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);
+ height = hasHeightArray ? height[0] : height;
+ if (height !== 0) {
+ const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);
+ Matrix3.Cartesian3.multiplyByScalar(n, height, n);
+ Matrix3.Cartesian3.add(p, n, p);
+ }
+
+ return [p.x, p.y, p.z];
+ }
+
+ let minDistance = options.minDistance;
+ if (!defaultValue.defined(minDistance)) {
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ minDistance = Math$1.CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);
+ }
+
+ let numPoints = 0;
+ let i;
+
+ for (i = 0; i < length - 1; i++) {
+ numPoints += PolylinePipeline.numberOfPoints(
+ positions[i],
+ positions[i + 1],
+ minDistance
+ );
+ }
+
+ const arrayLength = (numPoints + 1) * 3;
+ const newPositions = new Array(arrayLength);
+ let offset = 0;
+
+ for (i = 0; i < length - 1; i++) {
+ const p0 = positions[i];
+ const p1 = positions[i + 1];
+
+ const h0 = hasHeightArray ? height[i] : height;
+ const h1 = hasHeightArray ? height[i + 1] : height;
+
+ offset = generateCartesianArc(
+ p0,
+ p1,
+ minDistance,
+ ellipsoid,
+ h0,
+ h1,
+ newPositions,
+ offset
+ );
+ }
+
+ subdivideHeightsScratchArray.length = 0;
+
+ const lastPoint = positions[length - 1];
+ const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);
+ carto.height = hasHeightArray ? height[length - 1] : height;
+ const cart = ellipsoid.cartographicToCartesian(carto, cartesian);
+ Matrix3.Cartesian3.pack(cart, newPositions, arrayLength - 3);
+
+ return newPositions;
+ };
+
+ const scratchCartographic0 = new Matrix3.Cartographic();
+ const scratchCartographic1 = new Matrix3.Cartographic();
+
+ /**
+ * Subdivides polyline and raises all points to the specified height using Rhumb lines. Returns an array of numbers to represent the positions.
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.
+ * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.
+ * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
+ * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid.
+ *
+ * @example
+ * const positions = Cesium.Cartesian3.fromDegreesArray([
+ * -105.0, 40.0,
+ * -100.0, 38.0,
+ * -105.0, 35.0,
+ * -100.0, 32.0
+ * ]);
+ * const surfacePositions = Cesium.PolylinePipeline.generateRhumbArc({
+ * positons: positions
+ * });
+ */
+ PolylinePipeline.generateRhumbArc = function (options) {
+ if (!defaultValue.defined(options)) {
+ options = {};
+ }
+ const positions = options.positions;
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(positions)) {
+ throw new Check.DeveloperError("options.positions is required.");
+ }
+ //>>includeEnd('debug');
+
+ const length = positions.length;
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ let height = defaultValue.defaultValue(options.height, 0);
+ const hasHeightArray = Array.isArray(height);
+
+ if (length < 1) {
+ return [];
+ } else if (length === 1) {
+ const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);
+ height = hasHeightArray ? height[0] : height;
+ if (height !== 0) {
+ const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);
+ Matrix3.Cartesian3.multiplyByScalar(n, height, n);
+ Matrix3.Cartesian3.add(p, n, p);
+ }
+
+ return [p.x, p.y, p.z];
+ }
+
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+
+ let numPoints = 0;
+ let i;
+
+ let c0 = ellipsoid.cartesianToCartographic(
+ positions[0],
+ scratchCartographic0
+ );
+ let c1;
+ for (i = 0; i < length - 1; i++) {
+ c1 = ellipsoid.cartesianToCartographic(
+ positions[i + 1],
+ scratchCartographic1
+ );
+ numPoints += PolylinePipeline.numberOfPointsRhumbLine(c0, c1, granularity);
+ c0 = Matrix3.Cartographic.clone(c1, scratchCartographic0);
+ }
+
+ const arrayLength = (numPoints + 1) * 3;
+ const newPositions = new Array(arrayLength);
+ let offset = 0;
+
+ for (i = 0; i < length - 1; i++) {
+ const p0 = positions[i];
+ const p1 = positions[i + 1];
+
+ const h0 = hasHeightArray ? height[i] : height;
+ const h1 = hasHeightArray ? height[i + 1] : height;
+
+ offset = generateCartesianRhumbArc(
+ p0,
+ p1,
+ granularity,
+ ellipsoid,
+ h0,
+ h1,
+ newPositions,
+ offset
+ );
+ }
+
+ subdivideHeightsScratchArray.length = 0;
+
+ const lastPoint = positions[length - 1];
+ const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);
+ carto.height = hasHeightArray ? height[length - 1] : height;
+ const cart = ellipsoid.cartographicToCartesian(carto, cartesian);
+ Matrix3.Cartesian3.pack(cart, newPositions, arrayLength - 3);
+
+ return newPositions;
+ };
+
+ /**
+ * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions.
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.
+ * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.
+ * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
+ * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.
+ *
+ * @example
+ * const positions = Cesium.Cartesian3.fromDegreesArray([
+ * -105.0, 40.0,
+ * -100.0, 38.0,
+ * -105.0, 35.0,
+ * -100.0, 32.0
+ * ]);
+ * const surfacePositions = Cesium.PolylinePipeline.generateCartesianArc({
+ * positons: positions
+ * });
+ */
+ PolylinePipeline.generateCartesianArc = function (options) {
+ const numberArray = PolylinePipeline.generateArc(options);
+ const size = numberArray.length / 3;
+ const newPositions = new Array(size);
+ for (let i = 0; i < size; i++) {
+ newPositions[i] = Matrix3.Cartesian3.unpack(numberArray, i * 3);
+ }
+ return newPositions;
+ };
+
+ /**
+ * Subdivides polyline and raises all points to the specified height using Rhumb Lines. Returns an array of new {Cartesian3} positions.
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.
+ * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.
+ * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
+ * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.
+ *
+ * @example
+ * const positions = Cesium.Cartesian3.fromDegreesArray([
+ * -105.0, 40.0,
+ * -100.0, 38.0,
+ * -105.0, 35.0,
+ * -100.0, 32.0
+ * ]);
+ * const surfacePositions = Cesium.PolylinePipeline.generateCartesianRhumbArc({
+ * positons: positions
+ * });
+ */
+ PolylinePipeline.generateCartesianRhumbArc = function (options) {
+ const numberArray = PolylinePipeline.generateRhumbArc(options);
+ const size = numberArray.length / 3;
+ const newPositions = new Array(size);
+ for (let i = 0; i < size; i++) {
+ newPositions[i] = Matrix3.Cartesian3.unpack(numberArray, i * 3);
+ }
+ return newPositions;
+ };
+ var PolylinePipeline$1 = PolylinePipeline;
+
+ exports.PolylinePipeline = PolylinePipeline$1;
+
+}));
+//# sourceMappingURL=PolylinePipeline-3c021236.js.map
diff --git a/examples/cesium/Workers/PolylinePipeline-3c021236.js.map b/examples/cesium/Workers/PolylinePipeline-3c021236.js.map
new file mode 100644
index 0000000..ff5b099
--- /dev/null
+++ b/examples/cesium/Workers/PolylinePipeline-3c021236.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PolylinePipeline-3c021236.js","sources":["../../../Source/Core/PolylinePipeline.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport EllipsoidGeodesic from \"./EllipsoidGeodesic.js\";\r\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\r\nimport IntersectionTests from \"./IntersectionTests.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport Plane from \"./Plane.js\";\r\n\r\n/**\r\n * @private\r\n */\r\nconst PolylinePipeline = {};\r\n\r\nPolylinePipeline.numberOfPoints = function (p0, p1, minDistance) {\r\n const distance = Cartesian3.distance(p0, p1);\r\n return Math.ceil(distance / minDistance);\r\n};\r\n\r\nPolylinePipeline.numberOfPointsRhumbLine = function (p0, p1, granularity) {\r\n const radiansDistanceSquared =\r\n Math.pow(p0.longitude - p1.longitude, 2) +\r\n Math.pow(p0.latitude - p1.latitude, 2);\r\n\r\n return Math.max(\r\n 1,\r\n Math.ceil(Math.sqrt(radiansDistanceSquared / (granularity * granularity)))\r\n );\r\n};\r\n\r\nconst cartoScratch = new Cartographic();\r\nPolylinePipeline.extractHeights = function (positions, ellipsoid) {\r\n const length = positions.length;\r\n const heights = new Array(length);\r\n for (let i = 0; i < length; i++) {\r\n const p = positions[i];\r\n heights[i] = ellipsoid.cartesianToCartographic(p, cartoScratch).height;\r\n }\r\n return heights;\r\n};\r\n\r\nconst wrapLongitudeInversMatrix = new Matrix4();\r\nconst wrapLongitudeOrigin = new Cartesian3();\r\nconst wrapLongitudeXZNormal = new Cartesian3();\r\nconst wrapLongitudeXZPlane = new Plane(Cartesian3.UNIT_X, 0.0);\r\nconst wrapLongitudeYZNormal = new Cartesian3();\r\nconst wrapLongitudeYZPlane = new Plane(Cartesian3.UNIT_X, 0.0);\r\nconst wrapLongitudeIntersection = new Cartesian3();\r\nconst wrapLongitudeOffset = new Cartesian3();\r\n\r\nconst subdivideHeightsScratchArray = [];\r\n\r\nfunction subdivideHeights(numPoints, h0, h1) {\r\n const heights = subdivideHeightsScratchArray;\r\n heights.length = numPoints;\r\n\r\n let i;\r\n if (h0 === h1) {\r\n for (i = 0; i < numPoints; i++) {\r\n heights[i] = h0;\r\n }\r\n return heights;\r\n }\r\n\r\n const dHeight = h1 - h0;\r\n const heightPerVertex = dHeight / numPoints;\r\n\r\n for (i = 0; i < numPoints; i++) {\r\n const h = h0 + i * heightPerVertex;\r\n heights[i] = h;\r\n }\r\n\r\n return heights;\r\n}\r\n\r\nconst carto1 = new Cartographic();\r\nconst carto2 = new Cartographic();\r\nconst cartesian = new Cartesian3();\r\nconst scaleFirst = new Cartesian3();\r\nconst scaleLast = new Cartesian3();\r\nconst ellipsoidGeodesic = new EllipsoidGeodesic();\r\nlet ellipsoidRhumb = new EllipsoidRhumbLine();\r\n\r\n//Returns subdivided line scaled to ellipsoid surface starting at p1 and ending at p2.\r\n//Result includes p1, but not include p2. This function is called for a sequence of line segments,\r\n//and this prevents duplication of end point.\r\nfunction generateCartesianArc(\r\n p0,\r\n p1,\r\n minDistance,\r\n ellipsoid,\r\n h0,\r\n h1,\r\n array,\r\n offset\r\n) {\r\n const first = ellipsoid.scaleToGeodeticSurface(p0, scaleFirst);\r\n const last = ellipsoid.scaleToGeodeticSurface(p1, scaleLast);\r\n const numPoints = PolylinePipeline.numberOfPoints(p0, p1, minDistance);\r\n const start = ellipsoid.cartesianToCartographic(first, carto1);\r\n const end = ellipsoid.cartesianToCartographic(last, carto2);\r\n const heights = subdivideHeights(numPoints, h0, h1);\r\n\r\n ellipsoidGeodesic.setEndPoints(start, end);\r\n const surfaceDistanceBetweenPoints =\r\n ellipsoidGeodesic.surfaceDistance / numPoints;\r\n\r\n let index = offset;\r\n start.height = h0;\r\n let cart = ellipsoid.cartographicToCartesian(start, cartesian);\r\n Cartesian3.pack(cart, array, index);\r\n index += 3;\r\n\r\n for (let i = 1; i < numPoints; i++) {\r\n const carto = ellipsoidGeodesic.interpolateUsingSurfaceDistance(\r\n i * surfaceDistanceBetweenPoints,\r\n carto2\r\n );\r\n carto.height = heights[i];\r\n cart = ellipsoid.cartographicToCartesian(carto, cartesian);\r\n Cartesian3.pack(cart, array, index);\r\n index += 3;\r\n }\r\n\r\n return index;\r\n}\r\n\r\n//Returns subdivided line scaled to ellipsoid surface starting at p1 and ending at p2.\r\n//Result includes p1, but not include p2. This function is called for a sequence of line segments,\r\n//and this prevents duplication of end point.\r\nfunction generateCartesianRhumbArc(\r\n p0,\r\n p1,\r\n granularity,\r\n ellipsoid,\r\n h0,\r\n h1,\r\n array,\r\n offset\r\n) {\r\n const start = ellipsoid.cartesianToCartographic(p0, carto1);\r\n const end = ellipsoid.cartesianToCartographic(p1, carto2);\r\n const numPoints = PolylinePipeline.numberOfPointsRhumbLine(\r\n start,\r\n end,\r\n granularity\r\n );\r\n start.height = 0.0;\r\n end.height = 0.0;\r\n const heights = subdivideHeights(numPoints, h0, h1);\r\n\r\n if (!ellipsoidRhumb.ellipsoid.equals(ellipsoid)) {\r\n ellipsoidRhumb = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\r\n }\r\n ellipsoidRhumb.setEndPoints(start, end);\r\n const surfaceDistanceBetweenPoints =\r\n ellipsoidRhumb.surfaceDistance / numPoints;\r\n\r\n let index = offset;\r\n start.height = h0;\r\n let cart = ellipsoid.cartographicToCartesian(start, cartesian);\r\n Cartesian3.pack(cart, array, index);\r\n index += 3;\r\n\r\n for (let i = 1; i < numPoints; i++) {\r\n const carto = ellipsoidRhumb.interpolateUsingSurfaceDistance(\r\n i * surfaceDistanceBetweenPoints,\r\n carto2\r\n );\r\n carto.height = heights[i];\r\n cart = ellipsoid.cartographicToCartesian(carto, cartesian);\r\n Cartesian3.pack(cart, array, index);\r\n index += 3;\r\n }\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * Breaks a {@link Polyline} into segments such that it does not cross the ±180 degree meridian of an ellipsoid.\r\n *\r\n * @param {Cartesian3[]} positions The polyline's Cartesian positions.\r\n * @param {Matrix4} [modelMatrix=Matrix4.IDENTITY] The polyline's model matrix. Assumed to be an affine\r\n * transformation matrix, where the upper left 3x3 elements are a rotation matrix, and\r\n * the upper three elements in the fourth column are the translation. The bottom row is assumed to be [0, 0, 0, 1].\r\n * The matrix is not verified to be in the proper form.\r\n * @returns {Object} An object with a positions
property that is an array of positions and a\r\n * segments
property.\r\n *\r\n *\r\n * @example\r\n * const polylines = new Cesium.PolylineCollection();\r\n * const polyline = polylines.add(...);\r\n * const positions = polyline.positions;\r\n * const modelMatrix = polylines.modelMatrix;\r\n * const segments = Cesium.PolylinePipeline.wrapLongitude(positions, modelMatrix);\r\n *\r\n * @see PolygonPipeline.wrapLongitude\r\n * @see Polyline\r\n * @see PolylineCollection\r\n */\r\nPolylinePipeline.wrapLongitude = function (positions, modelMatrix) {\r\n const cartesians = [];\r\n const segments = [];\r\n\r\n if (defined(positions) && positions.length > 0) {\r\n modelMatrix = defaultValue(modelMatrix, Matrix4.IDENTITY);\r\n const inverseModelMatrix = Matrix4.inverseTransformation(\r\n modelMatrix,\r\n wrapLongitudeInversMatrix\r\n );\r\n\r\n const origin = Matrix4.multiplyByPoint(\r\n inverseModelMatrix,\r\n Cartesian3.ZERO,\r\n wrapLongitudeOrigin\r\n );\r\n const xzNormal = Cartesian3.normalize(\r\n Matrix4.multiplyByPointAsVector(\r\n inverseModelMatrix,\r\n Cartesian3.UNIT_Y,\r\n wrapLongitudeXZNormal\r\n ),\r\n wrapLongitudeXZNormal\r\n );\r\n const xzPlane = Plane.fromPointNormal(\r\n origin,\r\n xzNormal,\r\n wrapLongitudeXZPlane\r\n );\r\n const yzNormal = Cartesian3.normalize(\r\n Matrix4.multiplyByPointAsVector(\r\n inverseModelMatrix,\r\n Cartesian3.UNIT_X,\r\n wrapLongitudeYZNormal\r\n ),\r\n wrapLongitudeYZNormal\r\n );\r\n const yzPlane = Plane.fromPointNormal(\r\n origin,\r\n yzNormal,\r\n wrapLongitudeYZPlane\r\n );\r\n\r\n let count = 1;\r\n cartesians.push(Cartesian3.clone(positions[0]));\r\n let prev = cartesians[0];\r\n\r\n const length = positions.length;\r\n for (let i = 1; i < length; ++i) {\r\n const cur = positions[i];\r\n\r\n // intersects the IDL if either endpoint is on the negative side of the yz-plane\r\n if (\r\n Plane.getPointDistance(yzPlane, prev) < 0.0 ||\r\n Plane.getPointDistance(yzPlane, cur) < 0.0\r\n ) {\r\n // and intersects the xz-plane\r\n const intersection = IntersectionTests.lineSegmentPlane(\r\n prev,\r\n cur,\r\n xzPlane,\r\n wrapLongitudeIntersection\r\n );\r\n if (defined(intersection)) {\r\n // move point on the xz-plane slightly away from the plane\r\n const offset = Cartesian3.multiplyByScalar(\r\n xzNormal,\r\n 5.0e-9,\r\n wrapLongitudeOffset\r\n );\r\n if (Plane.getPointDistance(xzPlane, prev) < 0.0) {\r\n Cartesian3.negate(offset, offset);\r\n }\r\n\r\n cartesians.push(\r\n Cartesian3.add(intersection, offset, new Cartesian3())\r\n );\r\n segments.push(count + 1);\r\n\r\n Cartesian3.negate(offset, offset);\r\n cartesians.push(\r\n Cartesian3.add(intersection, offset, new Cartesian3())\r\n );\r\n count = 1;\r\n }\r\n }\r\n\r\n cartesians.push(Cartesian3.clone(positions[i]));\r\n count++;\r\n\r\n prev = cur;\r\n }\r\n\r\n segments.push(count);\r\n }\r\n\r\n return {\r\n positions: cartesians,\r\n lengths: segments,\r\n };\r\n};\r\n\r\n/**\r\n * Subdivides polyline and raises all points to the specified height. Returns an array of numbers to represent the positions.\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\r\n * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\r\n * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\r\n * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid.\r\n *\r\n * @example\r\n * const positions = Cesium.Cartesian3.fromDegreesArray([\r\n * -105.0, 40.0,\r\n * -100.0, 38.0,\r\n * -105.0, 35.0,\r\n * -100.0, 32.0\r\n * ]);\r\n * const surfacePositions = Cesium.PolylinePipeline.generateArc({\r\n * positons: positions\r\n * });\r\n */\r\nPolylinePipeline.generateArc = function (options) {\r\n if (!defined(options)) {\r\n options = {};\r\n }\r\n const positions = options.positions;\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(positions)) {\r\n throw new DeveloperError(\"options.positions is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = positions.length;\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n let height = defaultValue(options.height, 0);\r\n const hasHeightArray = Array.isArray(height);\r\n\r\n if (length < 1) {\r\n return [];\r\n } else if (length === 1) {\r\n const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);\r\n height = hasHeightArray ? height[0] : height;\r\n if (height !== 0) {\r\n const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);\r\n Cartesian3.multiplyByScalar(n, height, n);\r\n Cartesian3.add(p, n, p);\r\n }\r\n\r\n return [p.x, p.y, p.z];\r\n }\r\n\r\n let minDistance = options.minDistance;\r\n if (!defined(minDistance)) {\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n minDistance = CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);\r\n }\r\n\r\n let numPoints = 0;\r\n let i;\r\n\r\n for (i = 0; i < length - 1; i++) {\r\n numPoints += PolylinePipeline.numberOfPoints(\r\n positions[i],\r\n positions[i + 1],\r\n minDistance\r\n );\r\n }\r\n\r\n const arrayLength = (numPoints + 1) * 3;\r\n const newPositions = new Array(arrayLength);\r\n let offset = 0;\r\n\r\n for (i = 0; i < length - 1; i++) {\r\n const p0 = positions[i];\r\n const p1 = positions[i + 1];\r\n\r\n const h0 = hasHeightArray ? height[i] : height;\r\n const h1 = hasHeightArray ? height[i + 1] : height;\r\n\r\n offset = generateCartesianArc(\r\n p0,\r\n p1,\r\n minDistance,\r\n ellipsoid,\r\n h0,\r\n h1,\r\n newPositions,\r\n offset\r\n );\r\n }\r\n\r\n subdivideHeightsScratchArray.length = 0;\r\n\r\n const lastPoint = positions[length - 1];\r\n const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);\r\n carto.height = hasHeightArray ? height[length - 1] : height;\r\n const cart = ellipsoid.cartographicToCartesian(carto, cartesian);\r\n Cartesian3.pack(cart, newPositions, arrayLength - 3);\r\n\r\n return newPositions;\r\n};\r\n\r\nconst scratchCartographic0 = new Cartographic();\r\nconst scratchCartographic1 = new Cartographic();\r\n\r\n/**\r\n * Subdivides polyline and raises all points to the specified height using Rhumb lines. Returns an array of numbers to represent the positions.\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\r\n * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\r\n * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\r\n * @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid.\r\n *\r\n * @example\r\n * const positions = Cesium.Cartesian3.fromDegreesArray([\r\n * -105.0, 40.0,\r\n * -100.0, 38.0,\r\n * -105.0, 35.0,\r\n * -100.0, 32.0\r\n * ]);\r\n * const surfacePositions = Cesium.PolylinePipeline.generateRhumbArc({\r\n * positons: positions\r\n * });\r\n */\r\nPolylinePipeline.generateRhumbArc = function (options) {\r\n if (!defined(options)) {\r\n options = {};\r\n }\r\n const positions = options.positions;\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(positions)) {\r\n throw new DeveloperError(\"options.positions is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const length = positions.length;\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n let height = defaultValue(options.height, 0);\r\n const hasHeightArray = Array.isArray(height);\r\n\r\n if (length < 1) {\r\n return [];\r\n } else if (length === 1) {\r\n const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);\r\n height = hasHeightArray ? height[0] : height;\r\n if (height !== 0) {\r\n const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);\r\n Cartesian3.multiplyByScalar(n, height, n);\r\n Cartesian3.add(p, n, p);\r\n }\r\n\r\n return [p.x, p.y, p.z];\r\n }\r\n\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n\r\n let numPoints = 0;\r\n let i;\r\n\r\n let c0 = ellipsoid.cartesianToCartographic(\r\n positions[0],\r\n scratchCartographic0\r\n );\r\n let c1;\r\n for (i = 0; i < length - 1; i++) {\r\n c1 = ellipsoid.cartesianToCartographic(\r\n positions[i + 1],\r\n scratchCartographic1\r\n );\r\n numPoints += PolylinePipeline.numberOfPointsRhumbLine(c0, c1, granularity);\r\n c0 = Cartographic.clone(c1, scratchCartographic0);\r\n }\r\n\r\n const arrayLength = (numPoints + 1) * 3;\r\n const newPositions = new Array(arrayLength);\r\n let offset = 0;\r\n\r\n for (i = 0; i < length - 1; i++) {\r\n const p0 = positions[i];\r\n const p1 = positions[i + 1];\r\n\r\n const h0 = hasHeightArray ? height[i] : height;\r\n const h1 = hasHeightArray ? height[i + 1] : height;\r\n\r\n offset = generateCartesianRhumbArc(\r\n p0,\r\n p1,\r\n granularity,\r\n ellipsoid,\r\n h0,\r\n h1,\r\n newPositions,\r\n offset\r\n );\r\n }\r\n\r\n subdivideHeightsScratchArray.length = 0;\r\n\r\n const lastPoint = positions[length - 1];\r\n const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);\r\n carto.height = hasHeightArray ? height[length - 1] : height;\r\n const cart = ellipsoid.cartographicToCartesian(carto, cartesian);\r\n Cartesian3.pack(cart, newPositions, arrayLength - 3);\r\n\r\n return newPositions;\r\n};\r\n\r\n/**\r\n * Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions.\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\r\n * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\r\n * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\r\n * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.\r\n *\r\n * @example\r\n * const positions = Cesium.Cartesian3.fromDegreesArray([\r\n * -105.0, 40.0,\r\n * -100.0, 38.0,\r\n * -105.0, 35.0,\r\n * -100.0, 32.0\r\n * ]);\r\n * const surfacePositions = Cesium.PolylinePipeline.generateCartesianArc({\r\n * positons: positions\r\n * });\r\n */\r\nPolylinePipeline.generateCartesianArc = function (options) {\r\n const numberArray = PolylinePipeline.generateArc(options);\r\n const size = numberArray.length / 3;\r\n const newPositions = new Array(size);\r\n for (let i = 0; i < size; i++) {\r\n newPositions[i] = Cartesian3.unpack(numberArray, i * 3);\r\n }\r\n return newPositions;\r\n};\r\n\r\n/**\r\n * Subdivides polyline and raises all points to the specified height using Rhumb Lines. Returns an array of new {Cartesian3} positions.\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.\r\n * @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.\r\n * @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.\r\n * @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.\r\n *\r\n * @example\r\n * const positions = Cesium.Cartesian3.fromDegreesArray([\r\n * -105.0, 40.0,\r\n * -100.0, 38.0,\r\n * -105.0, 35.0,\r\n * -100.0, 32.0\r\n * ]);\r\n * const surfacePositions = Cesium.PolylinePipeline.generateCartesianRhumbArc({\r\n * positons: positions\r\n * });\r\n */\r\nPolylinePipeline.generateCartesianRhumbArc = function (options) {\r\n const numberArray = PolylinePipeline.generateRhumbArc(options);\r\n const size = numberArray.length / 3;\r\n const newPositions = new Array(size);\r\n for (let i = 0; i < size; i++) {\r\n newPositions[i] = Cartesian3.unpack(numberArray, i * 3);\r\n }\r\n return newPositions;\r\n};\r\nexport default PolylinePipeline;\r\n"],"names":["Cartesian3","Cartographic","Matrix4","Plane","EllipsoidGeodesic","EllipsoidRhumbLine","defined","defaultValue","IntersectionTests","DeveloperError","Ellipsoid","CesiumMath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA;EACA;EACA;EACA,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAC5B;EACA,gBAAgB,CAAC,cAAc,GAAG,UAAU,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE;EACjE,EAAE,MAAM,QAAQ,GAAGA,kBAAU,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;EAC/C,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,CAAC;EAC3C,CAAC,CAAC;AACF;EACA,gBAAgB,CAAC,uBAAuB,GAAG,UAAU,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE;EAC1E,EAAE,MAAM,sBAAsB;EAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC;EAC5C,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;AAC3C;EACA,EAAE,OAAO,IAAI,CAAC,G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ACtB,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,gBAAgB,CAAC,yBAAyB,GAAG,UAAU,OAAO,EAAE;EAChE,EAAE,MAAM,WAAW,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;EACjE,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;EACtC,EAAE,MAAM,YAAY,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;EACvC,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;EACjC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAGA,kBAAU,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;EAC5D,GAAG;EACH,EAAE,OAAO,YAAY,CAAC;EACtB,CAAC,CAAC;AACF,2BAAe,gBAAgB;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/PolylineVolumeGeometryLibrary-eed2bdf7.js b/examples/cesium/Workers/PolylineVolumeGeometryLibrary-eed2bdf7.js
new file mode 100644
index 0000000..56dfbed
--- /dev/null
+++ b/examples/cesium/Workers/PolylineVolumeGeometryLibrary-eed2bdf7.js
@@ -0,0 +1,807 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix2-036c77dd', './Matrix3-f22b0303', './EllipsoidTangentPlane-c421b2cb', './Math-9be8b918', './PolylinePipeline-3c021236', './Transforms-11fb6b0a', './defaultValue-0ab18f7d', './Check-d10e5f2e'], (function (exports, Matrix2, Matrix3, EllipsoidTangentPlane, Math$1, PolylinePipeline, Transforms, defaultValue, Check) { 'use strict';
+
+ /**
+ * Style options for corners.
+ *
+ * @demo The {@link https://sandcastle.cesium.com/index.html?src=Corridor.html&label=Geometries|Corridor Demo}
+ * demonstrates the three corner types, as used by {@link CorridorGraphics}.
+ *
+ * @enum {Number}
+ */
+ const CornerType = {
+ /**
+ *
+ *
+ * Corner has a smooth edge.
+ * @type {Number}
+ * @constant
+ */
+ ROUNDED: 0,
+
+ /**
+ *
+ *
+ * Corner point is the intersection of adjacent edges.
+ * @type {Number}
+ * @constant
+ */
+ MITERED: 1,
+
+ /**
+ *
+ *
+ * Corner is clipped.
+ * @type {Number}
+ * @constant
+ */
+ BEVELED: 2,
+ };
+ var CornerType$1 = Object.freeze(CornerType);
+
+ const warnings = {};
+
+ /**
+ * Logs a one time message to the console. Use this function instead of
+ * console.log
directly since this does not log duplicate messages
+ * unless it is called from multiple workers.
+ *
+ * @function oneTimeWarning
+ *
+ * @param {String} identifier The unique identifier for this warning.
+ * @param {String} [message=identifier] The message to log to the console.
+ *
+ * @example
+ * for(let i=0;i >includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(identifier)) {
+ throw new Check.DeveloperError("identifier is required.");
+ }
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(warnings[identifier])) {
+ warnings[identifier] = true;
+ console.warn(defaultValue.defaultValue(message, identifier));
+ }
+ }
+
+ oneTimeWarning.geometryOutlines =
+ "Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";
+
+ oneTimeWarning.geometryZIndex =
+ "Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";
+
+ oneTimeWarning.geometryHeightReference =
+ "Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";
+ oneTimeWarning.geometryExtrudedHeightReference =
+ "Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";
+
+ const scratch2Array = [new Matrix3.Cartesian3(), new Matrix3.Cartesian3()];
+ const scratchCartesian1 = new Matrix3.Cartesian3();
+ const scratchCartesian2 = new Matrix3.Cartesian3();
+ const scratchCartesian3 = new Matrix3.Cartesian3();
+ const scratchCartesian4 = new Matrix3.Cartesian3();
+ const scratchCartesian5 = new Matrix3.Cartesian3();
+ const scratchCartesian6 = new Matrix3.Cartesian3();
+ const scratchCartesian7 = new Matrix3.Cartesian3();
+ const scratchCartesian8 = new Matrix3.Cartesian3();
+ const scratchCartesian9 = new Matrix3.Cartesian3();
+
+ const scratch1 = new Matrix3.Cartesian3();
+ const scratch2 = new Matrix3.Cartesian3();
+
+ /**
+ * @private
+ */
+ const PolylineVolumeGeometryLibrary = {};
+
+ let cartographic = new Matrix3.Cartographic();
+ function scaleToSurface(positions, ellipsoid) {
+ const heights = new Array(positions.length);
+ for (let i = 0; i < positions.length; i++) {
+ const pos = positions[i];
+ cartographic = ellipsoid.cartesianToCartographic(pos, cartographic);
+ heights[i] = cartographic.height;
+ positions[i] = ellipsoid.scaleToGeodeticSurface(pos, pos);
+ }
+ return heights;
+ }
+
+ function subdivideHeights(points, h0, h1, granularity) {
+ const p0 = points[0];
+ const p1 = points[1];
+ const angleBetween = Matrix3.Cartesian3.angleBetween(p0, p1);
+ const numPoints = Math.ceil(angleBetween / granularity);
+ const heights = new Array(numPoints);
+ let i;
+ if (h0 === h1) {
+ for (i = 0; i < numPoints; i++) {
+ heights[i] = h0;
+ }
+ heights.push(h1);
+ return heights;
+ }
+
+ const dHeight = h1 - h0;
+ const heightPerVertex = dHeight / numPoints;
+
+ for (i = 1; i < numPoints; i++) {
+ const h = h0 + i * heightPerVertex;
+ heights[i] = h;
+ }
+
+ heights[0] = h0;
+ heights.push(h1);
+ return heights;
+ }
+
+ const nextScratch = new Matrix3.Cartesian3();
+ const prevScratch = new Matrix3.Cartesian3();
+
+ function computeRotationAngle(start, end, position, ellipsoid) {
+ const tangentPlane = new EllipsoidTangentPlane.EllipsoidTangentPlane(position, ellipsoid);
+ const next = tangentPlane.projectPointOntoPlane(
+ Matrix3.Cartesian3.add(position, start, nextScratch),
+ nextScratch
+ );
+ const prev = tangentPlane.projectPointOntoPlane(
+ Matrix3.Cartesian3.add(position, end, prevScratch),
+ prevScratch
+ );
+ const angle = Matrix2.Cartesian2.angleBetween(next, prev);
+
+ return prev.x * next.y - prev.y * next.x >= 0.0 ? -angle : angle;
+ }
+
+ const negativeX = new Matrix3.Cartesian3(-1, 0, 0);
+ let transform = new Matrix2.Matrix4();
+ const translation = new Matrix2.Matrix4();
+ let rotationZ = new Matrix3.Matrix3();
+ const scaleMatrix = Matrix3.Matrix3.IDENTITY.clone();
+ const westScratch = new Matrix3.Cartesian3();
+ const finalPosScratch = new Matrix2.Cartesian4();
+ const heightCartesian = new Matrix3.Cartesian3();
+ function addPosition(
+ center,
+ left,
+ shape,
+ finalPositions,
+ ellipsoid,
+ height,
+ xScalar,
+ repeat
+ ) {
+ let west = westScratch;
+ let finalPosition = finalPosScratch;
+ transform = Transforms.Transforms.eastNorthUpToFixedFrame(center, ellipsoid, transform);
+
+ west = Matrix2.Matrix4.multiplyByPointAsVector(transform, negativeX, west);
+ west = Matrix3.Cartesian3.normalize(west, west);
+ const angle = computeRotationAngle(west, left, center, ellipsoid);
+ rotationZ = Matrix3.Matrix3.fromRotationZ(angle, rotationZ);
+
+ heightCartesian.z = height;
+ transform = Matrix2.Matrix4.multiplyTransformation(
+ transform,
+ Matrix2.Matrix4.fromRotationTranslation(rotationZ, heightCartesian, translation),
+ transform
+ );
+ const scale = scaleMatrix;
+ scale[0] = xScalar;
+
+ for (let j = 0; j < repeat; j++) {
+ for (let i = 0; i < shape.length; i += 3) {
+ finalPosition = Matrix3.Cartesian3.fromArray(shape, i, finalPosition);
+ finalPosition = Matrix3.Matrix3.multiplyByVector(
+ scale,
+ finalPosition,
+ finalPosition
+ );
+ finalPosition = Matrix2.Matrix4.multiplyByPoint(
+ transform,
+ finalPosition,
+ finalPosition
+ );
+ finalPositions.push(finalPosition.x, finalPosition.y, finalPosition.z);
+ }
+ }
+
+ return finalPositions;
+ }
+
+ const centerScratch = new Matrix3.Cartesian3();
+ function addPositions(
+ centers,
+ left,
+ shape,
+ finalPositions,
+ ellipsoid,
+ heights,
+ xScalar
+ ) {
+ for (let i = 0; i < centers.length; i += 3) {
+ const center = Matrix3.Cartesian3.fromArray(centers, i, centerScratch);
+ finalPositions = addPosition(
+ center,
+ left,
+ shape,
+ finalPositions,
+ ellipsoid,
+ heights[i / 3],
+ xScalar,
+ 1
+ );
+ }
+ return finalPositions;
+ }
+
+ function convertShapeTo3DDuplicate(shape2D, boundingRectangle) {
+ //orientate 2D shape to XZ plane center at (0, 0, 0), duplicate points
+ const length = shape2D.length;
+ const shape = new Array(length * 6);
+ let index = 0;
+ const xOffset = boundingRectangle.x + boundingRectangle.width / 2;
+ const yOffset = boundingRectangle.y + boundingRectangle.height / 2;
+
+ let point = shape2D[0];
+ shape[index++] = point.x - xOffset;
+ shape[index++] = 0.0;
+ shape[index++] = point.y - yOffset;
+ for (let i = 1; i < length; i++) {
+ point = shape2D[i];
+ const x = point.x - xOffset;
+ const z = point.y - yOffset;
+ shape[index++] = x;
+ shape[index++] = 0.0;
+ shape[index++] = z;
+
+ shape[index++] = x;
+ shape[index++] = 0.0;
+ shape[index++] = z;
+ }
+ point = shape2D[0];
+ shape[index++] = point.x - xOffset;
+ shape[index++] = 0.0;
+ shape[index++] = point.y - yOffset;
+
+ return shape;
+ }
+
+ function convertShapeTo3D(shape2D, boundingRectangle) {
+ //orientate 2D shape to XZ plane center at (0, 0, 0)
+ const length = shape2D.length;
+ const shape = new Array(length * 3);
+ let index = 0;
+ const xOffset = boundingRectangle.x + boundingRectangle.width / 2;
+ const yOffset = boundingRectangle.y + boundingRectangle.height / 2;
+
+ for (let i = 0; i < length; i++) {
+ shape[index++] = shape2D[i].x - xOffset;
+ shape[index++] = 0;
+ shape[index++] = shape2D[i].y - yOffset;
+ }
+
+ return shape;
+ }
+
+ const quaterion = new Transforms.Quaternion();
+ const startPointScratch = new Matrix3.Cartesian3();
+ const rotMatrix = new Matrix3.Matrix3();
+ function computeRoundCorner(
+ pivot,
+ startPoint,
+ endPoint,
+ cornerType,
+ leftIsOutside,
+ ellipsoid,
+ finalPositions,
+ shape,
+ height,
+ duplicatePoints
+ ) {
+ const angle = Matrix3.Cartesian3.angleBetween(
+ Matrix3.Cartesian3.subtract(startPoint, pivot, scratch1),
+ Matrix3.Cartesian3.subtract(endPoint, pivot, scratch2)
+ );
+ const granularity =
+ cornerType === CornerType$1.BEVELED
+ ? 0
+ : Math.ceil(angle / Math$1.CesiumMath.toRadians(5));
+
+ let m;
+ if (leftIsOutside) {
+ m = Matrix3.Matrix3.fromQuaternion(
+ Transforms.Quaternion.fromAxisAngle(
+ Matrix3.Cartesian3.negate(pivot, scratch1),
+ angle / (granularity + 1),
+ quaterion
+ ),
+ rotMatrix
+ );
+ } else {
+ m = Matrix3.Matrix3.fromQuaternion(
+ Transforms.Quaternion.fromAxisAngle(pivot, angle / (granularity + 1), quaterion),
+ rotMatrix
+ );
+ }
+
+ let left;
+ let surfacePoint;
+ startPoint = Matrix3.Cartesian3.clone(startPoint, startPointScratch);
+ if (granularity > 0) {
+ const repeat = duplicatePoints ? 2 : 1;
+ for (let i = 0; i < granularity; i++) {
+ startPoint = Matrix3.Matrix3.multiplyByVector(m, startPoint, startPoint);
+ left = Matrix3.Cartesian3.subtract(startPoint, pivot, scratch1);
+ left = Matrix3.Cartesian3.normalize(left, left);
+ if (!leftIsOutside) {
+ left = Matrix3.Cartesian3.negate(left, left);
+ }
+ surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);
+ finalPositions = addPosition(
+ surfacePoint,
+ left,
+ shape,
+ finalPositions,
+ ellipsoid,
+ height,
+ 1,
+ repeat
+ );
+ }
+ } else {
+ left = Matrix3.Cartesian3.subtract(startPoint, pivot, scratch1);
+ left = Matrix3.Cartesian3.normalize(left, left);
+ if (!leftIsOutside) {
+ left = Matrix3.Cartesian3.negate(left, left);
+ }
+ surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);
+ finalPositions = addPosition(
+ surfacePoint,
+ left,
+ shape,
+ finalPositions,
+ ellipsoid,
+ height,
+ 1,
+ 1
+ );
+
+ endPoint = Matrix3.Cartesian3.clone(endPoint, startPointScratch);
+ left = Matrix3.Cartesian3.subtract(endPoint, pivot, scratch1);
+ left = Matrix3.Cartesian3.normalize(left, left);
+ if (!leftIsOutside) {
+ left = Matrix3.Cartesian3.negate(left, left);
+ }
+ surfacePoint = ellipsoid.scaleToGeodeticSurface(endPoint, scratch2);
+ finalPositions = addPosition(
+ surfacePoint,
+ left,
+ shape,
+ finalPositions,
+ ellipsoid,
+ height,
+ 1,
+ 1
+ );
+ }
+
+ return finalPositions;
+ }
+
+ PolylineVolumeGeometryLibrary.removeDuplicatesFromShape = function (
+ shapePositions
+ ) {
+ const length = shapePositions.length;
+ const cleanedPositions = [];
+ for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {
+ const v0 = shapePositions[i0];
+ const v1 = shapePositions[i1];
+
+ if (!Matrix2.Cartesian2.equals(v0, v1)) {
+ cleanedPositions.push(v1); // Shallow copy!
+ }
+ }
+
+ return cleanedPositions;
+ };
+
+ PolylineVolumeGeometryLibrary.angleIsGreaterThanPi = function (
+ forward,
+ backward,
+ position,
+ ellipsoid
+ ) {
+ const tangentPlane = new EllipsoidTangentPlane.EllipsoidTangentPlane(position, ellipsoid);
+ const next = tangentPlane.projectPointOntoPlane(
+ Matrix3.Cartesian3.add(position, forward, nextScratch),
+ nextScratch
+ );
+ const prev = tangentPlane.projectPointOntoPlane(
+ Matrix3.Cartesian3.add(position, backward, prevScratch),
+ prevScratch
+ );
+
+ return prev.x * next.y - prev.y * next.x >= 0.0;
+ };
+
+ const scratchForwardProjection = new Matrix3.Cartesian3();
+ const scratchBackwardProjection = new Matrix3.Cartesian3();
+
+ PolylineVolumeGeometryLibrary.computePositions = function (
+ positions,
+ shape2D,
+ boundingRectangle,
+ geometry,
+ duplicatePoints
+ ) {
+ const ellipsoid = geometry._ellipsoid;
+ const heights = scaleToSurface(positions, ellipsoid);
+ const granularity = geometry._granularity;
+ const cornerType = geometry._cornerType;
+ const shapeForSides = duplicatePoints
+ ? convertShapeTo3DDuplicate(shape2D, boundingRectangle)
+ : convertShapeTo3D(shape2D, boundingRectangle);
+ const shapeForEnds = duplicatePoints
+ ? convertShapeTo3D(shape2D, boundingRectangle)
+ : undefined;
+ const heightOffset = boundingRectangle.height / 2;
+ const width = boundingRectangle.width / 2;
+ let length = positions.length;
+ let finalPositions = [];
+ let ends = duplicatePoints ? [] : undefined;
+
+ let forward = scratchCartesian1;
+ let backward = scratchCartesian2;
+ let cornerDirection = scratchCartesian3;
+ let surfaceNormal = scratchCartesian4;
+ let pivot = scratchCartesian5;
+ let start = scratchCartesian6;
+ let end = scratchCartesian7;
+ let left = scratchCartesian8;
+ let previousPosition = scratchCartesian9;
+
+ let position = positions[0];
+ let nextPosition = positions[1];
+ surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);
+ forward = Matrix3.Cartesian3.subtract(nextPosition, position, forward);
+ forward = Matrix3.Cartesian3.normalize(forward, forward);
+ left = Matrix3.Cartesian3.cross(surfaceNormal, forward, left);
+ left = Matrix3.Cartesian3.normalize(left, left);
+ let h0 = heights[0];
+ let h1 = heights[1];
+ if (duplicatePoints) {
+ ends = addPosition(
+ position,
+ left,
+ shapeForEnds,
+ ends,
+ ellipsoid,
+ h0 + heightOffset,
+ 1,
+ 1
+ );
+ }
+ previousPosition = Matrix3.Cartesian3.clone(position, previousPosition);
+ position = nextPosition;
+ backward = Matrix3.Cartesian3.negate(forward, backward);
+ let subdividedHeights;
+ let subdividedPositions;
+ for (let i = 1; i < length - 1; i++) {
+ const repeat = duplicatePoints ? 2 : 1;
+ nextPosition = positions[i + 1];
+ if (position.equals(nextPosition)) {
+ oneTimeWarning(
+ "Positions are too close and are considered equivalent with rounding error."
+ );
+ continue;
+ }
+ forward = Matrix3.Cartesian3.subtract(nextPosition, position, forward);
+ forward = Matrix3.Cartesian3.normalize(forward, forward);
+ cornerDirection = Matrix3.Cartesian3.add(forward, backward, cornerDirection);
+ cornerDirection = Matrix3.Cartesian3.normalize(cornerDirection, cornerDirection);
+ surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);
+
+ const forwardProjection = Matrix3.Cartesian3.multiplyByScalar(
+ surfaceNormal,
+ Matrix3.Cartesian3.dot(forward, surfaceNormal),
+ scratchForwardProjection
+ );
+ Matrix3.Cartesian3.subtract(forward, forwardProjection, forwardProjection);
+ Matrix3.Cartesian3.normalize(forwardProjection, forwardProjection);
+
+ const backwardProjection = Matrix3.Cartesian3.multiplyByScalar(
+ surfaceNormal,
+ Matrix3.Cartesian3.dot(backward, surfaceNormal),
+ scratchBackwardProjection
+ );
+ Matrix3.Cartesian3.subtract(backward, backwardProjection, backwardProjection);
+ Matrix3.Cartesian3.normalize(backwardProjection, backwardProjection);
+
+ const doCorner = !Math$1.CesiumMath.equalsEpsilon(
+ Math.abs(Matrix3.Cartesian3.dot(forwardProjection, backwardProjection)),
+ 1.0,
+ Math$1.CesiumMath.EPSILON7
+ );
+
+ if (doCorner) {
+ cornerDirection = Matrix3.Cartesian3.cross(
+ cornerDirection,
+ surfaceNormal,
+ cornerDirection
+ );
+ cornerDirection = Matrix3.Cartesian3.cross(
+ surfaceNormal,
+ cornerDirection,
+ cornerDirection
+ );
+ cornerDirection = Matrix3.Cartesian3.normalize(cornerDirection, cornerDirection);
+ const scalar =
+ 1 /
+ Math.max(
+ 0.25,
+ Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.cross(cornerDirection, backward, scratch1)
+ )
+ );
+ const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(
+ forward,
+ backward,
+ position,
+ ellipsoid
+ );
+ if (leftIsOutside) {
+ pivot = Matrix3.Cartesian3.add(
+ position,
+ Matrix3.Cartesian3.multiplyByScalar(
+ cornerDirection,
+ scalar * width,
+ cornerDirection
+ ),
+ pivot
+ );
+ start = Matrix3.Cartesian3.add(
+ pivot,
+ Matrix3.Cartesian3.multiplyByScalar(left, width, start),
+ start
+ );
+ scratch2Array[0] = Matrix3.Cartesian3.clone(previousPosition, scratch2Array[0]);
+ scratch2Array[1] = Matrix3.Cartesian3.clone(start, scratch2Array[1]);
+ subdividedHeights = subdivideHeights(
+ scratch2Array,
+ h0 + heightOffset,
+ h1 + heightOffset,
+ granularity
+ );
+ subdividedPositions = PolylinePipeline.PolylinePipeline.generateArc({
+ positions: scratch2Array,
+ granularity: granularity,
+ ellipsoid: ellipsoid,
+ });
+ finalPositions = addPositions(
+ subdividedPositions,
+ left,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ subdividedHeights,
+ 1
+ );
+ left = Matrix3.Cartesian3.cross(surfaceNormal, forward, left);
+ left = Matrix3.Cartesian3.normalize(left, left);
+ end = Matrix3.Cartesian3.add(
+ pivot,
+ Matrix3.Cartesian3.multiplyByScalar(left, width, end),
+ end
+ );
+ if (
+ cornerType === CornerType$1.ROUNDED ||
+ cornerType === CornerType$1.BEVELED
+ ) {
+ computeRoundCorner(
+ pivot,
+ start,
+ end,
+ cornerType,
+ leftIsOutside,
+ ellipsoid,
+ finalPositions,
+ shapeForSides,
+ h1 + heightOffset,
+ duplicatePoints
+ );
+ } else {
+ cornerDirection = Matrix3.Cartesian3.negate(cornerDirection, cornerDirection);
+ finalPositions = addPosition(
+ position,
+ cornerDirection,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ h1 + heightOffset,
+ scalar,
+ repeat
+ );
+ }
+ previousPosition = Matrix3.Cartesian3.clone(end, previousPosition);
+ } else {
+ pivot = Matrix3.Cartesian3.add(
+ position,
+ Matrix3.Cartesian3.multiplyByScalar(
+ cornerDirection,
+ scalar * width,
+ cornerDirection
+ ),
+ pivot
+ );
+ start = Matrix3.Cartesian3.add(
+ pivot,
+ Matrix3.Cartesian3.multiplyByScalar(left, -width, start),
+ start
+ );
+ scratch2Array[0] = Matrix3.Cartesian3.clone(previousPosition, scratch2Array[0]);
+ scratch2Array[1] = Matrix3.Cartesian3.clone(start, scratch2Array[1]);
+ subdividedHeights = subdivideHeights(
+ scratch2Array,
+ h0 + heightOffset,
+ h1 + heightOffset,
+ granularity
+ );
+ subdividedPositions = PolylinePipeline.PolylinePipeline.generateArc({
+ positions: scratch2Array,
+ granularity: granularity,
+ ellipsoid: ellipsoid,
+ });
+ finalPositions = addPositions(
+ subdividedPositions,
+ left,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ subdividedHeights,
+ 1
+ );
+ left = Matrix3.Cartesian3.cross(surfaceNormal, forward, left);
+ left = Matrix3.Cartesian3.normalize(left, left);
+ end = Matrix3.Cartesian3.add(
+ pivot,
+ Matrix3.Cartesian3.multiplyByScalar(left, -width, end),
+ end
+ );
+ if (
+ cornerType === CornerType$1.ROUNDED ||
+ cornerType === CornerType$1.BEVELED
+ ) {
+ computeRoundCorner(
+ pivot,
+ start,
+ end,
+ cornerType,
+ leftIsOutside,
+ ellipsoid,
+ finalPositions,
+ shapeForSides,
+ h1 + heightOffset,
+ duplicatePoints
+ );
+ } else {
+ finalPositions = addPosition(
+ position,
+ cornerDirection,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ h1 + heightOffset,
+ scalar,
+ repeat
+ );
+ }
+ previousPosition = Matrix3.Cartesian3.clone(end, previousPosition);
+ }
+ backward = Matrix3.Cartesian3.negate(forward, backward);
+ } else {
+ finalPositions = addPosition(
+ previousPosition,
+ left,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ h0 + heightOffset,
+ 1,
+ 1
+ );
+ previousPosition = position;
+ }
+ h0 = h1;
+ h1 = heights[i + 1];
+ position = nextPosition;
+ }
+
+ scratch2Array[0] = Matrix3.Cartesian3.clone(previousPosition, scratch2Array[0]);
+ scratch2Array[1] = Matrix3.Cartesian3.clone(position, scratch2Array[1]);
+ subdividedHeights = subdivideHeights(
+ scratch2Array,
+ h0 + heightOffset,
+ h1 + heightOffset,
+ granularity
+ );
+ subdividedPositions = PolylinePipeline.PolylinePipeline.generateArc({
+ positions: scratch2Array,
+ granularity: granularity,
+ ellipsoid: ellipsoid,
+ });
+ finalPositions = addPositions(
+ subdividedPositions,
+ left,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ subdividedHeights,
+ 1
+ );
+ if (duplicatePoints) {
+ ends = addPosition(
+ position,
+ left,
+ shapeForEnds,
+ ends,
+ ellipsoid,
+ h1 + heightOffset,
+ 1,
+ 1
+ );
+ }
+
+ length = finalPositions.length;
+ const posLength = duplicatePoints ? length + ends.length : length;
+ const combinedPositions = new Float64Array(posLength);
+ combinedPositions.set(finalPositions);
+ if (duplicatePoints) {
+ combinedPositions.set(ends, length);
+ }
+
+ return combinedPositions;
+ };
+ var PolylineVolumeGeometryLibrary$1 = PolylineVolumeGeometryLibrary;
+
+ exports.CornerType = CornerType$1;
+ exports.PolylineVolumeGeometryLibrary = PolylineVolumeGeometryLibrary$1;
+ exports.oneTimeWarning = oneTimeWarning;
+
+}));
+//# sourceMappingURL=PolylineVolumeGeometryLibrary-eed2bdf7.js.map
diff --git a/examples/cesium/Workers/PolylineVolumeGeometryLibrary-eed2bdf7.js.map b/examples/cesium/Workers/PolylineVolumeGeometryLibrary-eed2bdf7.js.map
new file mode 100644
index 0000000..8684eb1
--- /dev/null
+++ b/examples/cesium/Workers/PolylineVolumeGeometryLibrary-eed2bdf7.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PolylineVolumeGeometryLibrary-eed2bdf7.js","sources":["../../../Source/Core/CornerType.js","../../../Source/Core/oneTimeWarning.js","../../../Source/Core/PolylineVolumeGeometryLibrary.js"],"sourcesContent":["/**\r\n * Style options for corners.\r\n *\r\n * @demo The {@link https://sandcastle.cesium.com/index.html?src=Corridor.html&label=Geometries|Corridor Demo}\r\n * demonstrates the three corner types, as used by {@link CorridorGraphics}.\r\n *\r\n * @enum {Number}\r\n */\r\nconst CornerType = {\r\n /**\r\n *
\r\n *\r\n * Corner has a smooth edge.\r\n * @type {Number}\r\n * @constant\r\n */\r\n ROUNDED: 0,\r\n\r\n /**\r\n *
\r\n *\r\n * Corner point is the intersection of adjacent edges.\r\n * @type {Number}\r\n * @constant\r\n */\r\n MITERED: 1,\r\n\r\n /**\r\n *
\r\n *\r\n * Corner is clipped.\r\n * @type {Number}\r\n * @constant\r\n */\r\n BEVELED: 2,\r\n};\r\nexport default Object.freeze(CornerType);\r\n","import defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\nconst warnings = {};\r\n\r\n/**\r\n * Logs a one time message to the console. Use this function instead of\r\n * console.log
directly since this does not log duplicate messages\r\n * unless it is called from multiple workers.\r\n *\r\n * @function oneTimeWarning\r\n *\r\n * @param {String} identifier The unique identifier for this warning.\r\n * @param {String} [message=identifier] The message to log to the console.\r\n *\r\n * @example\r\n * for(let i=0;i >includeStart('debug', pragmas.debug);\r\n if (!defined(identifier)) {\r\n throw new DeveloperError(\"identifier is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(warnings[identifier])) {\r\n warnings[identifier] = true;\r\n console.warn(defaultValue(message, identifier));\r\n }\r\n}\r\n\r\noneTimeWarning.geometryOutlines =\r\n \"Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.\";\r\n\r\noneTimeWarning.geometryZIndex =\r\n \"Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored\";\r\n\r\noneTimeWarning.geometryHeightReference =\r\n \"Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored\";\r\noneTimeWarning.geometryExtrudedHeightReference =\r\n \"Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored\";\r\nexport default oneTimeWarning;\r\n","import Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartesian4 from \"./Cartesian4.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport CornerType from \"./CornerType.js\";\r\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport PolylinePipeline from \"./PolylinePipeline.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\nimport Transforms from \"./Transforms.js\";\r\nimport oneTimeWarning from \"../Core/oneTimeWarning.js\";\r\n\r\nconst scratch2Array = [new Cartesian3(), new Cartesian3()];\r\nconst scratchCartesian1 = new Cartesian3();\r\nconst scratchCartesian2 = new Cartesian3();\r\nconst scratchCartesian3 = new Cartesian3();\r\nconst scratchCartesian4 = new Cartesian3();\r\nconst scratchCartesian5 = new Cartesian3();\r\nconst scratchCartesian6 = new Cartesian3();\r\nconst scratchCartesian7 = new Cartesian3();\r\nconst scratchCartesian8 = new Cartesian3();\r\nconst scratchCartesian9 = new Cartesian3();\r\n\r\nconst scratch1 = new Cartesian3();\r\nconst scratch2 = new Cartesian3();\r\n\r\n/**\r\n * @private\r\n */\r\nconst PolylineVolumeGeometryLibrary = {};\r\n\r\nlet cartographic = new Cartographic();\r\nfunction scaleToSurface(positions, ellipsoid) {\r\n const heights = new Array(positions.length);\r\n for (let i = 0; i < positions.length; i++) {\r\n const pos = positions[i];\r\n cartographic = ellipsoid.cartesianToCartographic(pos, cartographic);\r\n heights[i] = cartographic.height;\r\n positions[i] = ellipsoid.scaleToGeodeticSurface(pos, pos);\r\n }\r\n return heights;\r\n}\r\n\r\nfunction subdivideHeights(points, h0, h1, granularity) {\r\n const p0 = points[0];\r\n const p1 = points[1];\r\n const angleBetween = Cartesian3.angleBetween(p0, p1);\r\n const numPoints = Math.ceil(angleBetween / granularity);\r\n const heights = new Array(numPoints);\r\n let i;\r\n if (h0 === h1) {\r\n for (i = 0; i < numPoints; i++) {\r\n heights[i] = h0;\r\n }\r\n heights.push(h1);\r\n return heights;\r\n }\r\n\r\n const dHeight = h1 - h0;\r\n const heightPerVertex = dHeight / numPoints;\r\n\r\n for (i = 1; i < numPoints; i++) {\r\n const h = h0 + i * heightPerVertex;\r\n heights[i] = h;\r\n }\r\n\r\n heights[0] = h0;\r\n heights.push(h1);\r\n return heights;\r\n}\r\n\r\nconst nextScratch = new Cartesian3();\r\nconst prevScratch = new Cartesian3();\r\n\r\nfunction computeRotationAngle(start, end, position, ellipsoid) {\r\n const tangentPlane = new EllipsoidTangentPlane(position, ellipsoid);\r\n const next = tangentPlane.projectPointOntoPlane(\r\n Cartesian3.add(position, start, nextScratch),\r\n nextScratch\r\n );\r\n const prev = tangentPlane.projectPointOntoPlane(\r\n Cartesian3.add(position, end, prevScratch),\r\n prevScratch\r\n );\r\n const angle = Cartesian2.angleBetween(next, prev);\r\n\r\n return prev.x * next.y - prev.y * next.x >= 0.0 ? -angle : angle;\r\n}\r\n\r\nconst negativeX = new Cartesian3(-1, 0, 0);\r\nlet transform = new Matrix4();\r\nconst translation = new Matrix4();\r\nlet rotationZ = new Matrix3();\r\nconst scaleMatrix = Matrix3.IDENTITY.clone();\r\nconst westScratch = new Cartesian3();\r\nconst finalPosScratch = new Cartesian4();\r\nconst heightCartesian = new Cartesian3();\r\nfunction addPosition(\r\n center,\r\n left,\r\n shape,\r\n finalPositions,\r\n ellipsoid,\r\n height,\r\n xScalar,\r\n repeat\r\n) {\r\n let west = westScratch;\r\n let finalPosition = finalPosScratch;\r\n transform = Transforms.eastNorthUpToFixedFrame(center, ellipsoid, transform);\r\n\r\n west = Matrix4.multiplyByPointAsVector(transform, negativeX, west);\r\n west = Cartesian3.normalize(west, west);\r\n const angle = computeRotationAngle(west, left, center, ellipsoid);\r\n rotationZ = Matrix3.fromRotationZ(angle, rotationZ);\r\n\r\n heightCartesian.z = height;\r\n transform = Matrix4.multiplyTransformation(\r\n transform,\r\n Matrix4.fromRotationTranslation(rotationZ, heightCartesian, translation),\r\n transform\r\n );\r\n const scale = scaleMatrix;\r\n scale[0] = xScalar;\r\n\r\n for (let j = 0; j < repeat; j++) {\r\n for (let i = 0; i < shape.length; i += 3) {\r\n finalPosition = Cartesian3.fromArray(shape, i, finalPosition);\r\n finalPosition = Matrix3.multiplyByVector(\r\n scale,\r\n finalPosition,\r\n finalPosition\r\n );\r\n finalPosition = Matrix4.multiplyByPoint(\r\n transform,\r\n finalPosition,\r\n finalPosition\r\n );\r\n finalPositions.push(finalPosition.x, finalPosition.y, finalPosition.z);\r\n }\r\n }\r\n\r\n return finalPositions;\r\n}\r\n\r\nconst centerScratch = new Cartesian3();\r\nfunction addPositions(\r\n centers,\r\n left,\r\n shape,\r\n finalPositions,\r\n ellipsoid,\r\n heights,\r\n xScalar\r\n) {\r\n for (let i = 0; i < centers.length; i += 3) {\r\n const center = Cartesian3.fromArray(centers, i, centerScratch);\r\n finalPositions = addPosition(\r\n center,\r\n left,\r\n shape,\r\n finalPositions,\r\n ellipsoid,\r\n heights[i / 3],\r\n xScalar,\r\n 1\r\n );\r\n }\r\n return finalPositions;\r\n}\r\n\r\nfunction convertShapeTo3DDuplicate(shape2D, boundingRectangle) {\r\n //orientate 2D shape to XZ plane center at (0, 0, 0), duplicate points\r\n const length = shape2D.length;\r\n const shape = new Array(length * 6);\r\n let index = 0;\r\n const xOffset = boundingRectangle.x + boundingRectangle.width / 2;\r\n const yOffset = boundingRectangle.y + boundingRectangle.height / 2;\r\n\r\n let point = shape2D[0];\r\n shape[index++] = point.x - xOffset;\r\n shape[index++] = 0.0;\r\n shape[index++] = point.y - yOffset;\r\n for (let i = 1; i < length; i++) {\r\n point = shape2D[i];\r\n const x = point.x - xOffset;\r\n const z = point.y - yOffset;\r\n shape[index++] = x;\r\n shape[index++] = 0.0;\r\n shape[index++] = z;\r\n\r\n shape[index++] = x;\r\n shape[index++] = 0.0;\r\n shape[index++] = z;\r\n }\r\n point = shape2D[0];\r\n shape[index++] = point.x - xOffset;\r\n shape[index++] = 0.0;\r\n shape[index++] = point.y - yOffset;\r\n\r\n return shape;\r\n}\r\n\r\nfunction convertShapeTo3D(shape2D, boundingRectangle) {\r\n //orientate 2D shape to XZ plane center at (0, 0, 0)\r\n const length = shape2D.length;\r\n const shape = new Array(length * 3);\r\n let index = 0;\r\n const xOffset = boundingRectangle.x + boundingRectangle.width / 2;\r\n const yOffset = boundingRectangle.y + boundingRectangle.height / 2;\r\n\r\n for (let i = 0; i < length; i++) {\r\n shape[index++] = shape2D[i].x - xOffset;\r\n shape[index++] = 0;\r\n shape[index++] = shape2D[i].y - yOffset;\r\n }\r\n\r\n return shape;\r\n}\r\n\r\nconst quaterion = new Quaternion();\r\nconst startPointScratch = new Cartesian3();\r\nconst rotMatrix = new Matrix3();\r\nfunction computeRoundCorner(\r\n pivot,\r\n startPoint,\r\n endPoint,\r\n cornerType,\r\n leftIsOutside,\r\n ellipsoid,\r\n finalPositions,\r\n shape,\r\n height,\r\n duplicatePoints\r\n) {\r\n const angle = Cartesian3.angleBetween(\r\n Cartesian3.subtract(startPoint, pivot, scratch1),\r\n Cartesian3.subtract(endPoint, pivot, scratch2)\r\n );\r\n const granularity =\r\n cornerType === CornerType.BEVELED\r\n ? 0\r\n : Math.ceil(angle / CesiumMath.toRadians(5));\r\n\r\n let m;\r\n if (leftIsOutside) {\r\n m = Matrix3.fromQuaternion(\r\n Quaternion.fromAxisAngle(\r\n Cartesian3.negate(pivot, scratch1),\r\n angle / (granularity + 1),\r\n quaterion\r\n ),\r\n rotMatrix\r\n );\r\n } else {\r\n m = Matrix3.fromQuaternion(\r\n Quaternion.fromAxisAngle(pivot, angle / (granularity + 1), quaterion),\r\n rotMatrix\r\n );\r\n }\r\n\r\n let left;\r\n let surfacePoint;\r\n startPoint = Cartesian3.clone(startPoint, startPointScratch);\r\n if (granularity > 0) {\r\n const repeat = duplicatePoints ? 2 : 1;\r\n for (let i = 0; i < granularity; i++) {\r\n startPoint = Matrix3.multiplyByVector(m, startPoint, startPoint);\r\n left = Cartesian3.subtract(startPoint, pivot, scratch1);\r\n left = Cartesian3.normalize(left, left);\r\n if (!leftIsOutside) {\r\n left = Cartesian3.negate(left, left);\r\n }\r\n surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);\r\n finalPositions = addPosition(\r\n surfacePoint,\r\n left,\r\n shape,\r\n finalPositions,\r\n ellipsoid,\r\n height,\r\n 1,\r\n repeat\r\n );\r\n }\r\n } else {\r\n left = Cartesian3.subtract(startPoint, pivot, scratch1);\r\n left = Cartesian3.normalize(left, left);\r\n if (!leftIsOutside) {\r\n left = Cartesian3.negate(left, left);\r\n }\r\n surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);\r\n finalPositions = addPosition(\r\n surfacePoint,\r\n left,\r\n shape,\r\n finalPositions,\r\n ellipsoid,\r\n height,\r\n 1,\r\n 1\r\n );\r\n\r\n endPoint = Cartesian3.clone(endPoint, startPointScratch);\r\n left = Cartesian3.subtract(endPoint, pivot, scratch1);\r\n left = Cartesian3.normalize(left, left);\r\n if (!leftIsOutside) {\r\n left = Cartesian3.negate(left, left);\r\n }\r\n surfacePoint = ellipsoid.scaleToGeodeticSurface(endPoint, scratch2);\r\n finalPositions = addPosition(\r\n surfacePoint,\r\n left,\r\n shape,\r\n finalPositions,\r\n ellipsoid,\r\n height,\r\n 1,\r\n 1\r\n );\r\n }\r\n\r\n return finalPositions;\r\n}\r\n\r\nPolylineVolumeGeometryLibrary.removeDuplicatesFromShape = function (\r\n shapePositions\r\n) {\r\n const length = shapePositions.length;\r\n const cleanedPositions = [];\r\n for (let i0 = length - 1, i1 = 0; i1 < length; i0 = i1++) {\r\n const v0 = shapePositions[i0];\r\n const v1 = shapePositions[i1];\r\n\r\n if (!Cartesian2.equals(v0, v1)) {\r\n cleanedPositions.push(v1); // Shallow copy!\r\n }\r\n }\r\n\r\n return cleanedPositions;\r\n};\r\n\r\nPolylineVolumeGeometryLibrary.angleIsGreaterThanPi = function (\r\n forward,\r\n backward,\r\n position,\r\n ellipsoid\r\n) {\r\n const tangentPlane = new EllipsoidTangentPlane(position, ellipsoid);\r\n const next = tangentPlane.projectPointOntoPlane(\r\n Cartesian3.add(position, forward, nextScratch),\r\n nextScratch\r\n );\r\n const prev = tangentPlane.projectPointOntoPlane(\r\n Cartesian3.add(position, backward, prevScratch),\r\n prevScratch\r\n );\r\n\r\n return prev.x * next.y - prev.y * next.x >= 0.0;\r\n};\r\n\r\nconst scratchForwardProjection = new Cartesian3();\r\nconst scratchBackwardProjection = new Cartesian3();\r\n\r\nPolylineVolumeGeometryLibrary.computePositions = function (\r\n positions,\r\n shape2D,\r\n boundingRectangle,\r\n geometry,\r\n duplicatePoints\r\n) {\r\n const ellipsoid = geometry._ellipsoid;\r\n const heights = scaleToSurface(positions, ellipsoid);\r\n const granularity = geometry._granularity;\r\n const cornerType = geometry._cornerType;\r\n const shapeForSides = duplicatePoints\r\n ? convertShapeTo3DDuplicate(shape2D, boundingRectangle)\r\n : convertShapeTo3D(shape2D, boundingRectangle);\r\n const shapeForEnds = duplicatePoints\r\n ? convertShapeTo3D(shape2D, boundingRectangle)\r\n : undefined;\r\n const heightOffset = boundingRectangle.height / 2;\r\n const width = boundingRectangle.width / 2;\r\n let length = positions.length;\r\n let finalPositions = [];\r\n let ends = duplicatePoints ? [] : undefined;\r\n\r\n let forward = scratchCartesian1;\r\n let backward = scratchCartesian2;\r\n let cornerDirection = scratchCartesian3;\r\n let surfaceNormal = scratchCartesian4;\r\n let pivot = scratchCartesian5;\r\n let start = scratchCartesian6;\r\n let end = scratchCartesian7;\r\n let left = scratchCartesian8;\r\n let previousPosition = scratchCartesian9;\r\n\r\n let position = positions[0];\r\n let nextPosition = positions[1];\r\n surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);\r\n forward = Cartesian3.subtract(nextPosition, position, forward);\r\n forward = Cartesian3.normalize(forward, forward);\r\n left = Cartesian3.cross(surfaceNormal, forward, left);\r\n left = Cartesian3.normalize(left, left);\r\n let h0 = heights[0];\r\n let h1 = heights[1];\r\n if (duplicatePoints) {\r\n ends = addPosition(\r\n position,\r\n left,\r\n shapeForEnds,\r\n ends,\r\n ellipsoid,\r\n h0 + heightOffset,\r\n 1,\r\n 1\r\n );\r\n }\r\n previousPosition = Cartesian3.clone(position, previousPosition);\r\n position = nextPosition;\r\n backward = Cartesian3.negate(forward, backward);\r\n let subdividedHeights;\r\n let subdividedPositions;\r\n for (let i = 1; i < length - 1; i++) {\r\n const repeat = duplicatePoints ? 2 : 1;\r\n nextPosition = positions[i + 1];\r\n if (position.equals(nextPosition)) {\r\n oneTimeWarning(\r\n \"Positions are too close and are considered equivalent with rounding error.\"\r\n );\r\n continue;\r\n }\r\n forward = Cartesian3.subtract(nextPosition, position, forward);\r\n forward = Cartesian3.normalize(forward, forward);\r\n cornerDirection = Cartesian3.add(forward, backward, cornerDirection);\r\n cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection);\r\n surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);\r\n\r\n const forwardProjection = Cartesian3.multiplyByScalar(\r\n surfaceNormal,\r\n Cartesian3.dot(forward, surfaceNormal),\r\n scratchForwardProjection\r\n );\r\n Cartesian3.subtract(forward, forwardProjection, forwardProjection);\r\n Cartesian3.normalize(forwardProjection, forwardProjection);\r\n\r\n const backwardProjection = Cartesian3.multiplyByScalar(\r\n surfaceNormal,\r\n Cartesian3.dot(backward, surfaceNormal),\r\n scratchBackwardProjection\r\n );\r\n Cartesian3.subtract(backward, backwardProjection, backwardProjection);\r\n Cartesian3.normalize(backwardProjection, backwardProjection);\r\n\r\n const doCorner = !CesiumMath.equalsEpsilon(\r\n Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)),\r\n 1.0,\r\n CesiumMath.EPSILON7\r\n );\r\n\r\n if (doCorner) {\r\n cornerDirection = Cartesian3.cross(\r\n cornerDirection,\r\n surfaceNormal,\r\n cornerDirection\r\n );\r\n cornerDirection = Cartesian3.cross(\r\n surfaceNormal,\r\n cornerDirection,\r\n cornerDirection\r\n );\r\n cornerDirection = Cartesian3.normalize(cornerDirection, cornerDirection);\r\n const scalar =\r\n 1 /\r\n Math.max(\r\n 0.25,\r\n Cartesian3.magnitude(\r\n Cartesian3.cross(cornerDirection, backward, scratch1)\r\n )\r\n );\r\n const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(\r\n forward,\r\n backward,\r\n position,\r\n ellipsoid\r\n );\r\n if (leftIsOutside) {\r\n pivot = Cartesian3.add(\r\n position,\r\n Cartesian3.multiplyByScalar(\r\n cornerDirection,\r\n scalar * width,\r\n cornerDirection\r\n ),\r\n pivot\r\n );\r\n start = Cartesian3.add(\r\n pivot,\r\n Cartesian3.multiplyByScalar(left, width, start),\r\n start\r\n );\r\n scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]);\r\n scratch2Array[1] = Cartesian3.clone(start, scratch2Array[1]);\r\n subdividedHeights = subdivideHeights(\r\n scratch2Array,\r\n h0 + heightOffset,\r\n h1 + heightOffset,\r\n granularity\r\n );\r\n subdividedPositions = PolylinePipeline.generateArc({\r\n positions: scratch2Array,\r\n granularity: granularity,\r\n ellipsoid: ellipsoid,\r\n });\r\n finalPositions = addPositions(\r\n subdividedPositions,\r\n left,\r\n shapeForSides,\r\n finalPositions,\r\n ellipsoid,\r\n subdividedHeights,\r\n 1\r\n );\r\n left = Cartesian3.cross(surfaceNormal, forward, left);\r\n left = Cartesian3.normalize(left, left);\r\n end = Cartesian3.add(\r\n pivot,\r\n Cartesian3.multiplyByScalar(left, width, end),\r\n end\r\n );\r\n if (\r\n cornerType === CornerType.ROUNDED ||\r\n cornerType === CornerType.BEVELED\r\n ) {\r\n computeRoundCorner(\r\n pivot,\r\n start,\r\n end,\r\n cornerType,\r\n leftIsOutside,\r\n ellipsoid,\r\n finalPositions,\r\n shapeForSides,\r\n h1 + heightOffset,\r\n duplicatePoints\r\n );\r\n } else {\r\n cornerDirection = Cartesian3.negate(cornerDirection, cornerDirection);\r\n finalPositions = addPosition(\r\n position,\r\n cornerDirection,\r\n shapeForSides,\r\n finalPositions,\r\n ellipsoid,\r\n h1 + heightOffset,\r\n scalar,\r\n repeat\r\n );\r\n }\r\n previousPosition = Cartesian3.clone(end, previousPosition);\r\n } else {\r\n pivot = Cartesian3.add(\r\n position,\r\n Cartesian3.multiplyByScalar(\r\n cornerDirection,\r\n scalar * width,\r\n cornerDirection\r\n ),\r\n pivot\r\n );\r\n start = Cartesian3.add(\r\n pivot,\r\n Cartesian3.multiplyByScalar(left, -width, start),\r\n start\r\n );\r\n scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]);\r\n scratch2Array[1] = Cartesian3.clone(start, scratch2Array[1]);\r\n subdividedHeights = subdivideHeights(\r\n scratch2Array,\r\n h0 + heightOffset,\r\n h1 + heightOffset,\r\n granularity\r\n );\r\n subdividedPositions = PolylinePipeline.generateArc({\r\n positions: scratch2Array,\r\n granularity: granularity,\r\n ellipsoid: ellipsoid,\r\n });\r\n finalPositions = addPositions(\r\n subdividedPositions,\r\n left,\r\n shapeForSides,\r\n finalPositions,\r\n ellipsoid,\r\n subdividedHeights,\r\n 1\r\n );\r\n left = Cartesian3.cross(surfaceNormal, forward, left);\r\n left = Cartesian3.normalize(left, left);\r\n end = Cartesian3.add(\r\n pivot,\r\n Cartesian3.multiplyByScalar(left, -width, end),\r\n end\r\n );\r\n if (\r\n cornerType === CornerType.ROUNDED ||\r\n cornerType === CornerType.BEVELED\r\n ) {\r\n computeRoundCorner(\r\n pivot,\r\n start,\r\n end,\r\n cornerType,\r\n leftIsOutside,\r\n ellipsoid,\r\n finalPositions,\r\n shapeForSides,\r\n h1 + heightOffset,\r\n duplicatePoints\r\n );\r\n } else {\r\n finalPositions = addPosition(\r\n position,\r\n cornerDirection,\r\n shapeForSides,\r\n finalPositions,\r\n ellipsoid,\r\n h1 + heightOffset,\r\n scalar,\r\n repeat\r\n );\r\n }\r\n previousPosition = Cartesian3.clone(end, previousPosition);\r\n }\r\n backward = Cartesian3.negate(forward, backward);\r\n } else {\r\n finalPositions = addPosition(\r\n previousPosition,\r\n left,\r\n shapeForSides,\r\n finalPositions,\r\n ellipsoid,\r\n h0 + heightOffset,\r\n 1,\r\n 1\r\n );\r\n previousPosition = position;\r\n }\r\n h0 = h1;\r\n h1 = heights[i + 1];\r\n position = nextPosition;\r\n }\r\n\r\n scratch2Array[0] = Cartesian3.clone(previousPosition, scratch2Array[0]);\r\n scratch2Array[1] = Cartesian3.clone(position, scratch2Array[1]);\r\n subdividedHeights = subdivideHeights(\r\n scratch2Array,\r\n h0 + heightOffset,\r\n h1 + heightOffset,\r\n granularity\r\n );\r\n subdividedPositions = PolylinePipeline.generateArc({\r\n positions: scratch2Array,\r\n granularity: granularity,\r\n ellipsoid: ellipsoid,\r\n });\r\n finalPositions = addPositions(\r\n subdividedPositions,\r\n left,\r\n shapeForSides,\r\n finalPositions,\r\n ellipsoid,\r\n subdividedHeights,\r\n 1\r\n );\r\n if (duplicatePoints) {\r\n ends = addPosition(\r\n position,\r\n left,\r\n shapeForEnds,\r\n ends,\r\n ellipsoid,\r\n h1 + heightOffset,\r\n 1,\r\n 1\r\n );\r\n }\r\n\r\n length = finalPositions.length;\r\n const posLength = duplicatePoints ? length + ends.length : length;\r\n const combinedPositions = new Float64Array(posLength);\r\n combinedPositions.set(finalPositions);\r\n if (duplicatePoints) {\r\n combinedPositions.set(ends, length);\r\n }\r\n\r\n return combinedPositions;\r\n};\r\nexport default PolylineVolumeGeometryLibrary;\r\n"],"names":["defined","DeveloperError","defaultValue","Cartesian3","Cartographic","EllipsoidTangentPlane","Cartesian2","Matrix4","Matrix3","Cartesian4","Transforms","Quaternion","CornerType","CesiumMath","PolylinePipeline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,UAAU,GAAG;EACnB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,OAAO,EAAE,CAAC;AACZ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,OAAO,EAAE,CAAC;AACZ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,OAAO,EAAE,CAAC;EACZ,CAAC,CAAC;AACF,qBAAe,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;;EChCxC,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE;EAC7C;EACA,EAAE,IAAI,CAACA,oBAAO,CAAC,UAAU,CAAC,EAAE;EAC5B,IAAI,MAAM,IAAIC,oBAAc,CAAC,yBAAyB,CAAC,CAAC;EACxD,GAAG;EACH;AACA;EACA,EAAE,IAAI,CAACD,oBAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE;EACtC,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;EAChC,IAAI,OAAO,CAAC,IAAI,CAACE,yBAAY,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;EACpD,GAAG;EACH,CAAC;AACD;EACA,cAAc,CAAC,gBAAgB;EAC/B,EAAE,0KAA0K,CAAC;AAC7K;EACA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S,EAAE,aAAa;EAC5B,IAAI,WAAW,EAAE,WAAW;EAC5B,IAAI,SAAS,EAAE,SAAS;EACxB,GAAG,CAAC,CAAC;EACL,EAAE,cAAc,GAAG,YAAY;EAC/B,IAAI,mBAAmB;EACvB,IAAI,IAAI;EACR,IAAI,aAAa;EACjB,IAAI,cAAc;EAClB,IAAI,SAAS;EACb,IAAI,iBAAiB;EACrB,IAAI,CAAC;EACL,GAAG,CAAC;EACJ,EAAE,IAAI,eAAe,EAAE;EACvB,IAAI,IAAI,GAAG,WAAW;EACtB,MAAM,QAAQ;EACd,MAAM,IAAI;EACV,MAAM,YAAY;EAClB,MAAM,IAAI;EACV,MAAM,SAAS;EACf,MAAM,EAAE,GAAG,YAAY;EACvB,MAAM,CAAC;EACP,MAAM,CAAC;EACP,KAAK,CAAC;EACN,GAAG;AACH;EACA,EAAE,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC;EACjC,EAAE,MAAM,SAAS,GAAG,eAAe,GAAG,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;EACpE,EAAE,MAAM,iBAAiB,GAAG,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;EACxD,EAAE,iBAAiB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;EACxC,EAAE,IAAI,eAAe,EAAE;EACvB,IAAI,iBAAiB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;EACxC,GAAG;AACH;EACA,EAAE,OAAO,iBAAiB,CAAC;EAC3B,CAAC,CAAC;AACF,wCAAe,6BAA6B;;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/PrimitivePipeline-f6d2b3b0.js b/examples/cesium/Workers/PrimitivePipeline-f6d2b3b0.js
new file mode 100644
index 0000000..342e5e8
--- /dev/null
+++ b/examples/cesium/Workers/PrimitivePipeline-f6d2b3b0.js
@@ -0,0 +1,992 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Transforms-11fb6b0a', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './Check-d10e5f2e', './Matrix3-f22b0303', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryPipeline-f28890f4', './IndexDatatype-b4e5cf89', './Matrix2-036c77dd', './WebMercatorProjection-306f7acc'], (function (exports, Transforms, ComponentDatatype, defaultValue, Check, Matrix3, GeometryAttribute, GeometryAttributes, GeometryPipeline, IndexDatatype, Matrix2, WebMercatorProjection) { 'use strict';
+
+ /**
+ * Value and type information for per-instance geometry attribute that determines the geometry instance offset
+ *
+ * @alias OffsetGeometryInstanceAttribute
+ * @constructor
+ *
+ * @param {Number} [x=0] The x translation
+ * @param {Number} [y=0] The y translation
+ * @param {Number} [z=0] The z translation
+ *
+ * @private
+ *
+ * @see GeometryInstance
+ * @see GeometryInstanceAttribute
+ */
+ function OffsetGeometryInstanceAttribute(x, y, z) {
+ x = defaultValue.defaultValue(x, 0);
+ y = defaultValue.defaultValue(y, 0);
+ z = defaultValue.defaultValue(z, 0);
+
+ /**
+ * The values for the attributes stored in a typed array.
+ *
+ * @type Float32Array
+ */
+ this.value = new Float32Array([x, y, z]);
+ }
+
+ Object.defineProperties(OffsetGeometryInstanceAttribute.prototype, {
+ /**
+ * The datatype of each component in the attribute, e.g., individual elements in
+ * {@link OffsetGeometryInstanceAttribute#value}.
+ *
+ * @memberof OffsetGeometryInstanceAttribute.prototype
+ *
+ * @type {ComponentDatatype}
+ * @readonly
+ *
+ * @default {@link ComponentDatatype.FLOAT}
+ */
+ componentDatatype: {
+ get: function () {
+ return ComponentDatatype.ComponentDatatype.FLOAT;
+ },
+ },
+
+ /**
+ * The number of components in the attributes, i.e., {@link OffsetGeometryInstanceAttribute#value}.
+ *
+ * @memberof OffsetGeometryInstanceAttribute.prototype
+ *
+ * @type {Number}
+ * @readonly
+ *
+ * @default 3
+ */
+ componentsPerAttribute: {
+ get: function () {
+ return 3;
+ },
+ },
+
+ /**
+ * When true
and componentDatatype
is an integer format,
+ * indicate that the components should be mapped to the range [0, 1] (unsigned)
+ * or [-1, 1] (signed) when they are accessed as floating-point for rendering.
+ *
+ * @memberof OffsetGeometryInstanceAttribute.prototype
+ *
+ * @type {Boolean}
+ * @readonly
+ *
+ * @default false
+ */
+ normalize: {
+ get: function () {
+ return false;
+ },
+ },
+ });
+
+ /**
+ * Creates a new {@link OffsetGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.
+ *
+ * @param {Cartesian3} offset The cartesian offset
+ * @returns {OffsetGeometryInstanceAttribute} The new {@link OffsetGeometryInstanceAttribute} instance.
+ */
+ OffsetGeometryInstanceAttribute.fromCartesian3 = function (offset) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("offset", offset);
+ //>>includeEnd('debug');
+
+ return new OffsetGeometryInstanceAttribute(offset.x, offset.y, offset.z);
+ };
+
+ /**
+ * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.
+ *
+ * @param {Cartesian3} offset The cartesian offset
+ * @param {Float32Array} [result] The array to store the result in, if undefined a new instance will be created.
+ * @returns {Float32Array} The modified result parameter or a new instance if result was undefined.
+ *
+ * @example
+ * const attributes = primitive.getGeometryInstanceAttributes('an id');
+ * attributes.modelMatrix = Cesium.OffsetGeometryInstanceAttribute.toValue(modelMatrix, attributes.modelMatrix);
+ */
+ OffsetGeometryInstanceAttribute.toValue = function (offset, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("offset", offset);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Float32Array([offset.x, offset.y, offset.z]);
+ }
+
+ result[0] = offset.x;
+ result[1] = offset.y;
+ result[2] = offset.z;
+ return result;
+ };
+
+ function transformToWorldCoordinates(
+ instances,
+ primitiveModelMatrix,
+ scene3DOnly
+ ) {
+ let toWorld = !scene3DOnly;
+ const length = instances.length;
+ let i;
+
+ if (!toWorld && length > 1) {
+ const modelMatrix = instances[0].modelMatrix;
+
+ for (i = 1; i < length; ++i) {
+ if (!Matrix2.Matrix4.equals(modelMatrix, instances[i].modelMatrix)) {
+ toWorld = true;
+ break;
+ }
+ }
+ }
+
+ if (toWorld) {
+ for (i = 0; i < length; ++i) {
+ if (defaultValue.defined(instances[i].geometry)) {
+ GeometryPipeline.GeometryPipeline.transformToWorldCoordinates(instances[i]);
+ }
+ }
+ } else {
+ // Leave geometry in local coordinate system; auto update model-matrix.
+ Matrix2.Matrix4.multiplyTransformation(
+ primitiveModelMatrix,
+ instances[0].modelMatrix,
+ primitiveModelMatrix
+ );
+ }
+ }
+
+ function addGeometryBatchId(geometry, batchId) {
+ const attributes = geometry.attributes;
+ const positionAttr = attributes.position;
+ const numberOfComponents =
+ positionAttr.values.length / positionAttr.componentsPerAttribute;
+
+ attributes.batchId = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 1,
+ values: new Float32Array(numberOfComponents),
+ });
+
+ const values = attributes.batchId.values;
+ for (let j = 0; j < numberOfComponents; ++j) {
+ values[j] = batchId;
+ }
+ }
+
+ function addBatchIds(instances) {
+ const length = instances.length;
+
+ for (let i = 0; i < length; ++i) {
+ const instance = instances[i];
+ if (defaultValue.defined(instance.geometry)) {
+ addGeometryBatchId(instance.geometry, i);
+ } else if (
+ defaultValue.defined(instance.westHemisphereGeometry) &&
+ defaultValue.defined(instance.eastHemisphereGeometry)
+ ) {
+ addGeometryBatchId(instance.westHemisphereGeometry, i);
+ addGeometryBatchId(instance.eastHemisphereGeometry, i);
+ }
+ }
+ }
+
+ function geometryPipeline(parameters) {
+ const instances = parameters.instances;
+ const projection = parameters.projection;
+ const uintIndexSupport = parameters.elementIndexUintSupported;
+ const scene3DOnly = parameters.scene3DOnly;
+ const vertexCacheOptimize = parameters.vertexCacheOptimize;
+ const compressVertices = parameters.compressVertices;
+ const modelMatrix = parameters.modelMatrix;
+
+ let i;
+ let geometry;
+ let primitiveType;
+ let length = instances.length;
+
+ for (i = 0; i < length; ++i) {
+ if (defaultValue.defined(instances[i].geometry)) {
+ primitiveType = instances[i].geometry.primitiveType;
+ break;
+ }
+ }
+
+ //>>includeStart('debug', pragmas.debug);
+ for (i = 1; i < length; ++i) {
+ if (
+ defaultValue.defined(instances[i].geometry) &&
+ instances[i].geometry.primitiveType !== primitiveType
+ ) {
+ throw new Check.DeveloperError(
+ "All instance geometries must have the same primitiveType."
+ );
+ }
+ }
+ //>>includeEnd('debug');
+
+ // Unify to world coordinates before combining.
+ transformToWorldCoordinates(instances, modelMatrix, scene3DOnly);
+
+ // Clip to IDL
+ if (!scene3DOnly) {
+ for (i = 0; i < length; ++i) {
+ if (defaultValue.defined(instances[i].geometry)) {
+ GeometryPipeline.GeometryPipeline.splitLongitude(instances[i]);
+ }
+ }
+ }
+
+ addBatchIds(instances);
+
+ // Optimize for vertex shader caches
+ if (vertexCacheOptimize) {
+ for (i = 0; i < length; ++i) {
+ const instance = instances[i];
+ if (defaultValue.defined(instance.geometry)) {
+ GeometryPipeline.GeometryPipeline.reorderForPostVertexCache(instance.geometry);
+ GeometryPipeline.GeometryPipeline.reorderForPreVertexCache(instance.geometry);
+ } else if (
+ defaultValue.defined(instance.westHemisphereGeometry) &&
+ defaultValue.defined(instance.eastHemisphereGeometry)
+ ) {
+ GeometryPipeline.GeometryPipeline.reorderForPostVertexCache(
+ instance.westHemisphereGeometry
+ );
+ GeometryPipeline.GeometryPipeline.reorderForPreVertexCache(
+ instance.westHemisphereGeometry
+ );
+
+ GeometryPipeline.GeometryPipeline.reorderForPostVertexCache(
+ instance.eastHemisphereGeometry
+ );
+ GeometryPipeline.GeometryPipeline.reorderForPreVertexCache(
+ instance.eastHemisphereGeometry
+ );
+ }
+ }
+ }
+
+ // Combine into single geometry for better rendering performance.
+ let geometries = GeometryPipeline.GeometryPipeline.combineInstances(instances);
+
+ length = geometries.length;
+ for (i = 0; i < length; ++i) {
+ geometry = geometries[i];
+
+ // Split positions for GPU RTE
+ const attributes = geometry.attributes;
+ if (!scene3DOnly) {
+ for (const name in attributes) {
+ if (
+ attributes.hasOwnProperty(name) &&
+ attributes[name].componentDatatype === ComponentDatatype.ComponentDatatype.DOUBLE
+ ) {
+ const name3D = `${name}3D`;
+ const name2D = `${name}2D`;
+
+ // Compute 2D positions
+ GeometryPipeline.GeometryPipeline.projectTo2D(
+ geometry,
+ name,
+ name3D,
+ name2D,
+ projection
+ );
+ if (defaultValue.defined(geometry.boundingSphere) && name === "position") {
+ geometry.boundingSphereCV = Transforms.BoundingSphere.fromVertices(
+ geometry.attributes.position2D.values
+ );
+ }
+
+ GeometryPipeline.GeometryPipeline.encodeAttribute(
+ geometry,
+ name3D,
+ `${name3D}High`,
+ `${name3D}Low`
+ );
+ GeometryPipeline.GeometryPipeline.encodeAttribute(
+ geometry,
+ name2D,
+ `${name2D}High`,
+ `${name2D}Low`
+ );
+ }
+ }
+ } else {
+ for (const name in attributes) {
+ if (
+ attributes.hasOwnProperty(name) &&
+ attributes[name].componentDatatype === ComponentDatatype.ComponentDatatype.DOUBLE
+ ) {
+ GeometryPipeline.GeometryPipeline.encodeAttribute(
+ geometry,
+ name,
+ `${name}3DHigh`,
+ `${name}3DLow`
+ );
+ }
+ }
+ }
+
+ // oct encode and pack normals, compress texture coordinates
+ if (compressVertices) {
+ GeometryPipeline.GeometryPipeline.compressVertices(geometry);
+ }
+ }
+
+ if (!uintIndexSupport) {
+ // Break into multiple geometries to fit within unsigned short indices if needed
+ let splitGeometries = [];
+ length = geometries.length;
+ for (i = 0; i < length; ++i) {
+ geometry = geometries[i];
+ splitGeometries = splitGeometries.concat(
+ GeometryPipeline.GeometryPipeline.fitToUnsignedShortIndices(geometry)
+ );
+ }
+
+ geometries = splitGeometries;
+ }
+
+ return geometries;
+ }
+
+ function createPickOffsets(instances, geometryName, geometries, pickOffsets) {
+ let offset;
+ let indexCount;
+ let geometryIndex;
+
+ const offsetIndex = pickOffsets.length - 1;
+ if (offsetIndex >= 0) {
+ const pickOffset = pickOffsets[offsetIndex];
+ offset = pickOffset.offset + pickOffset.count;
+ geometryIndex = pickOffset.index;
+ indexCount = geometries[geometryIndex].indices.length;
+ } else {
+ offset = 0;
+ geometryIndex = 0;
+ indexCount = geometries[geometryIndex].indices.length;
+ }
+
+ const length = instances.length;
+ for (let i = 0; i < length; ++i) {
+ const instance = instances[i];
+ const geometry = instance[geometryName];
+ if (!defaultValue.defined(geometry)) {
+ continue;
+ }
+
+ const count = geometry.indices.length;
+
+ if (offset + count > indexCount) {
+ offset = 0;
+ indexCount = geometries[++geometryIndex].indices.length;
+ }
+
+ pickOffsets.push({
+ index: geometryIndex,
+ offset: offset,
+ count: count,
+ });
+ offset += count;
+ }
+ }
+
+ function createInstancePickOffsets(instances, geometries) {
+ const pickOffsets = [];
+ createPickOffsets(instances, "geometry", geometries, pickOffsets);
+ createPickOffsets(
+ instances,
+ "westHemisphereGeometry",
+ geometries,
+ pickOffsets
+ );
+ createPickOffsets(
+ instances,
+ "eastHemisphereGeometry",
+ geometries,
+ pickOffsets
+ );
+ return pickOffsets;
+ }
+
+ /**
+ * @private
+ */
+ const PrimitivePipeline = {};
+
+ /**
+ * @private
+ */
+ PrimitivePipeline.combineGeometry = function (parameters) {
+ let geometries;
+ let attributeLocations;
+ const instances = parameters.instances;
+ const length = instances.length;
+ let pickOffsets;
+
+ let offsetInstanceExtend;
+ let hasOffset = false;
+ if (length > 0) {
+ geometries = geometryPipeline(parameters);
+ if (geometries.length > 0) {
+ attributeLocations = GeometryPipeline.GeometryPipeline.createAttributeLocations(
+ geometries[0]
+ );
+ if (parameters.createPickOffsets) {
+ pickOffsets = createInstancePickOffsets(instances, geometries);
+ }
+ }
+ if (
+ defaultValue.defined(instances[0].attributes) &&
+ defaultValue.defined(instances[0].attributes.offset)
+ ) {
+ offsetInstanceExtend = new Array(length);
+ hasOffset = true;
+ }
+ }
+
+ const boundingSpheres = new Array(length);
+ const boundingSpheresCV = new Array(length);
+ for (let i = 0; i < length; ++i) {
+ const instance = instances[i];
+ const geometry = instance.geometry;
+ if (defaultValue.defined(geometry)) {
+ boundingSpheres[i] = geometry.boundingSphere;
+ boundingSpheresCV[i] = geometry.boundingSphereCV;
+ if (hasOffset) {
+ offsetInstanceExtend[i] = instance.geometry.offsetAttribute;
+ }
+ }
+
+ const eastHemisphereGeometry = instance.eastHemisphereGeometry;
+ const westHemisphereGeometry = instance.westHemisphereGeometry;
+ if (defaultValue.defined(eastHemisphereGeometry) && defaultValue.defined(westHemisphereGeometry)) {
+ if (
+ defaultValue.defined(eastHemisphereGeometry.boundingSphere) &&
+ defaultValue.defined(westHemisphereGeometry.boundingSphere)
+ ) {
+ boundingSpheres[i] = Transforms.BoundingSphere.union(
+ eastHemisphereGeometry.boundingSphere,
+ westHemisphereGeometry.boundingSphere
+ );
+ }
+ if (
+ defaultValue.defined(eastHemisphereGeometry.boundingSphereCV) &&
+ defaultValue.defined(westHemisphereGeometry.boundingSphereCV)
+ ) {
+ boundingSpheresCV[i] = Transforms.BoundingSphere.union(
+ eastHemisphereGeometry.boundingSphereCV,
+ westHemisphereGeometry.boundingSphereCV
+ );
+ }
+ }
+ }
+
+ return {
+ geometries: geometries,
+ modelMatrix: parameters.modelMatrix,
+ attributeLocations: attributeLocations,
+ pickOffsets: pickOffsets,
+ offsetInstanceExtend: offsetInstanceExtend,
+ boundingSpheres: boundingSpheres,
+ boundingSpheresCV: boundingSpheresCV,
+ };
+ };
+
+ function transferGeometry(geometry, transferableObjects) {
+ const attributes = geometry.attributes;
+ for (const name in attributes) {
+ if (attributes.hasOwnProperty(name)) {
+ const attribute = attributes[name];
+
+ if (defaultValue.defined(attribute) && defaultValue.defined(attribute.values)) {
+ transferableObjects.push(attribute.values.buffer);
+ }
+ }
+ }
+
+ if (defaultValue.defined(geometry.indices)) {
+ transferableObjects.push(geometry.indices.buffer);
+ }
+ }
+
+ function transferGeometries(geometries, transferableObjects) {
+ const length = geometries.length;
+ for (let i = 0; i < length; ++i) {
+ transferGeometry(geometries[i], transferableObjects);
+ }
+ }
+
+ // This function was created by simplifying packCreateGeometryResults into a count-only operation.
+ function countCreateGeometryResults(items) {
+ let count = 1;
+ const length = items.length;
+ for (let i = 0; i < length; i++) {
+ const geometry = items[i];
+ ++count;
+
+ if (!defaultValue.defined(geometry)) {
+ continue;
+ }
+
+ const attributes = geometry.attributes;
+
+ count +=
+ 7 +
+ 2 * Transforms.BoundingSphere.packedLength +
+ (defaultValue.defined(geometry.indices) ? geometry.indices.length : 0);
+
+ for (const property in attributes) {
+ if (
+ attributes.hasOwnProperty(property) &&
+ defaultValue.defined(attributes[property])
+ ) {
+ const attribute = attributes[property];
+ count += 5 + attribute.values.length;
+ }
+ }
+ }
+
+ return count;
+ }
+
+ /**
+ * @private
+ */
+ PrimitivePipeline.packCreateGeometryResults = function (
+ items,
+ transferableObjects
+ ) {
+ const packedData = new Float64Array(countCreateGeometryResults(items));
+ const stringTable = [];
+ const stringHash = {};
+
+ const length = items.length;
+ let count = 0;
+ packedData[count++] = length;
+ for (let i = 0; i < length; i++) {
+ const geometry = items[i];
+
+ const validGeometry = defaultValue.defined(geometry);
+ packedData[count++] = validGeometry ? 1.0 : 0.0;
+
+ if (!validGeometry) {
+ continue;
+ }
+
+ packedData[count++] = geometry.primitiveType;
+ packedData[count++] = geometry.geometryType;
+ packedData[count++] = defaultValue.defaultValue(geometry.offsetAttribute, -1);
+
+ const validBoundingSphere = defaultValue.defined(geometry.boundingSphere) ? 1.0 : 0.0;
+ packedData[count++] = validBoundingSphere;
+ if (validBoundingSphere) {
+ Transforms.BoundingSphere.pack(geometry.boundingSphere, packedData, count);
+ }
+
+ count += Transforms.BoundingSphere.packedLength;
+
+ const validBoundingSphereCV = defaultValue.defined(geometry.boundingSphereCV)
+ ? 1.0
+ : 0.0;
+ packedData[count++] = validBoundingSphereCV;
+ if (validBoundingSphereCV) {
+ Transforms.BoundingSphere.pack(geometry.boundingSphereCV, packedData, count);
+ }
+
+ count += Transforms.BoundingSphere.packedLength;
+
+ const attributes = geometry.attributes;
+ const attributesToWrite = [];
+ for (const property in attributes) {
+ if (
+ attributes.hasOwnProperty(property) &&
+ defaultValue.defined(attributes[property])
+ ) {
+ attributesToWrite.push(property);
+ if (!defaultValue.defined(stringHash[property])) {
+ stringHash[property] = stringTable.length;
+ stringTable.push(property);
+ }
+ }
+ }
+
+ packedData[count++] = attributesToWrite.length;
+ for (let q = 0; q < attributesToWrite.length; q++) {
+ const name = attributesToWrite[q];
+ const attribute = attributes[name];
+ packedData[count++] = stringHash[name];
+ packedData[count++] = attribute.componentDatatype;
+ packedData[count++] = attribute.componentsPerAttribute;
+ packedData[count++] = attribute.normalize ? 1 : 0;
+ packedData[count++] = attribute.values.length;
+ packedData.set(attribute.values, count);
+ count += attribute.values.length;
+ }
+
+ const indicesLength = defaultValue.defined(geometry.indices)
+ ? geometry.indices.length
+ : 0;
+ packedData[count++] = indicesLength;
+
+ if (indicesLength > 0) {
+ packedData.set(geometry.indices, count);
+ count += indicesLength;
+ }
+ }
+
+ transferableObjects.push(packedData.buffer);
+
+ return {
+ stringTable: stringTable,
+ packedData: packedData,
+ };
+ };
+
+ /**
+ * @private
+ */
+ PrimitivePipeline.unpackCreateGeometryResults = function (
+ createGeometryResult
+ ) {
+ const stringTable = createGeometryResult.stringTable;
+ const packedGeometry = createGeometryResult.packedData;
+
+ let i;
+ const result = new Array(packedGeometry[0]);
+ let resultIndex = 0;
+
+ let packedGeometryIndex = 1;
+ while (packedGeometryIndex < packedGeometry.length) {
+ const valid = packedGeometry[packedGeometryIndex++] === 1.0;
+ if (!valid) {
+ result[resultIndex++] = undefined;
+ continue;
+ }
+
+ const primitiveType = packedGeometry[packedGeometryIndex++];
+ const geometryType = packedGeometry[packedGeometryIndex++];
+ let offsetAttribute = packedGeometry[packedGeometryIndex++];
+ if (offsetAttribute === -1) {
+ offsetAttribute = undefined;
+ }
+
+ let boundingSphere;
+ let boundingSphereCV;
+
+ const validBoundingSphere = packedGeometry[packedGeometryIndex++] === 1.0;
+ if (validBoundingSphere) {
+ boundingSphere = Transforms.BoundingSphere.unpack(
+ packedGeometry,
+ packedGeometryIndex
+ );
+ }
+
+ packedGeometryIndex += Transforms.BoundingSphere.packedLength;
+
+ const validBoundingSphereCV = packedGeometry[packedGeometryIndex++] === 1.0;
+ if (validBoundingSphereCV) {
+ boundingSphereCV = Transforms.BoundingSphere.unpack(
+ packedGeometry,
+ packedGeometryIndex
+ );
+ }
+
+ packedGeometryIndex += Transforms.BoundingSphere.packedLength;
+
+ let length;
+ let values;
+ let componentsPerAttribute;
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ const numAttributes = packedGeometry[packedGeometryIndex++];
+ for (i = 0; i < numAttributes; i++) {
+ const name = stringTable[packedGeometry[packedGeometryIndex++]];
+ const componentDatatype = packedGeometry[packedGeometryIndex++];
+ componentsPerAttribute = packedGeometry[packedGeometryIndex++];
+ const normalize = packedGeometry[packedGeometryIndex++] !== 0;
+
+ length = packedGeometry[packedGeometryIndex++];
+ values = ComponentDatatype.ComponentDatatype.createTypedArray(componentDatatype, length);
+ for (let valuesIndex = 0; valuesIndex < length; valuesIndex++) {
+ values[valuesIndex] = packedGeometry[packedGeometryIndex++];
+ }
+
+ attributes[name] = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: componentDatatype,
+ componentsPerAttribute: componentsPerAttribute,
+ normalize: normalize,
+ values: values,
+ });
+ }
+
+ let indices;
+ length = packedGeometry[packedGeometryIndex++];
+
+ if (length > 0) {
+ const numberOfVertices = values.length / componentsPerAttribute;
+ indices = IndexDatatype.IndexDatatype.createTypedArray(numberOfVertices, length);
+ for (i = 0; i < length; i++) {
+ indices[i] = packedGeometry[packedGeometryIndex++];
+ }
+ }
+
+ result[resultIndex++] = new GeometryAttribute.Geometry({
+ primitiveType: primitiveType,
+ geometryType: geometryType,
+ boundingSphere: boundingSphere,
+ boundingSphereCV: boundingSphereCV,
+ indices: indices,
+ attributes: attributes,
+ offsetAttribute: offsetAttribute,
+ });
+ }
+
+ return result;
+ };
+
+ function packInstancesForCombine(instances, transferableObjects) {
+ const length = instances.length;
+ const packedData = new Float64Array(1 + length * 19);
+ let count = 0;
+ packedData[count++] = length;
+ for (let i = 0; i < length; i++) {
+ const instance = instances[i];
+ Matrix2.Matrix4.pack(instance.modelMatrix, packedData, count);
+ count += Matrix2.Matrix4.packedLength;
+ if (defaultValue.defined(instance.attributes) && defaultValue.defined(instance.attributes.offset)) {
+ const values = instance.attributes.offset.value;
+ packedData[count] = values[0];
+ packedData[count + 1] = values[1];
+ packedData[count + 2] = values[2];
+ }
+ count += 3;
+ }
+ transferableObjects.push(packedData.buffer);
+
+ return packedData;
+ }
+
+ function unpackInstancesForCombine(data) {
+ const packedInstances = data;
+ const result = new Array(packedInstances[0]);
+ let count = 0;
+
+ let i = 1;
+ while (i < packedInstances.length) {
+ const modelMatrix = Matrix2.Matrix4.unpack(packedInstances, i);
+ let attributes;
+ i += Matrix2.Matrix4.packedLength;
+ if (defaultValue.defined(packedInstances[i])) {
+ attributes = {
+ offset: new OffsetGeometryInstanceAttribute(
+ packedInstances[i],
+ packedInstances[i + 1],
+ packedInstances[i + 2]
+ ),
+ };
+ }
+ i += 3;
+
+ result[count++] = {
+ modelMatrix: modelMatrix,
+ attributes: attributes,
+ };
+ }
+
+ return result;
+ }
+
+ /**
+ * @private
+ */
+ PrimitivePipeline.packCombineGeometryParameters = function (
+ parameters,
+ transferableObjects
+ ) {
+ const createGeometryResults = parameters.createGeometryResults;
+ const length = createGeometryResults.length;
+
+ for (let i = 0; i < length; i++) {
+ transferableObjects.push(createGeometryResults[i].packedData.buffer);
+ }
+
+ return {
+ createGeometryResults: parameters.createGeometryResults,
+ packedInstances: packInstancesForCombine(
+ parameters.instances,
+ transferableObjects
+ ),
+ ellipsoid: parameters.ellipsoid,
+ isGeographic: parameters.projection instanceof Transforms.GeographicProjection,
+ elementIndexUintSupported: parameters.elementIndexUintSupported,
+ scene3DOnly: parameters.scene3DOnly,
+ vertexCacheOptimize: parameters.vertexCacheOptimize,
+ compressVertices: parameters.compressVertices,
+ modelMatrix: parameters.modelMatrix,
+ createPickOffsets: parameters.createPickOffsets,
+ };
+ };
+
+ /**
+ * @private
+ */
+ PrimitivePipeline.unpackCombineGeometryParameters = function (
+ packedParameters
+ ) {
+ const instances = unpackInstancesForCombine(packedParameters.packedInstances);
+ const createGeometryResults = packedParameters.createGeometryResults;
+ const length = createGeometryResults.length;
+ let instanceIndex = 0;
+
+ for (let resultIndex = 0; resultIndex < length; resultIndex++) {
+ const geometries = PrimitivePipeline.unpackCreateGeometryResults(
+ createGeometryResults[resultIndex]
+ );
+ const geometriesLength = geometries.length;
+ for (
+ let geometryIndex = 0;
+ geometryIndex < geometriesLength;
+ geometryIndex++
+ ) {
+ const geometry = geometries[geometryIndex];
+ const instance = instances[instanceIndex];
+ instance.geometry = geometry;
+ ++instanceIndex;
+ }
+ }
+
+ const ellipsoid = Matrix3.Ellipsoid.clone(packedParameters.ellipsoid);
+ const projection = packedParameters.isGeographic
+ ? new Transforms.GeographicProjection(ellipsoid)
+ : new WebMercatorProjection.WebMercatorProjection(ellipsoid);
+
+ return {
+ instances: instances,
+ ellipsoid: ellipsoid,
+ projection: projection,
+ elementIndexUintSupported: packedParameters.elementIndexUintSupported,
+ scene3DOnly: packedParameters.scene3DOnly,
+ vertexCacheOptimize: packedParameters.vertexCacheOptimize,
+ compressVertices: packedParameters.compressVertices,
+ modelMatrix: Matrix2.Matrix4.clone(packedParameters.modelMatrix),
+ createPickOffsets: packedParameters.createPickOffsets,
+ };
+ };
+
+ function packBoundingSpheres(boundingSpheres) {
+ const length = boundingSpheres.length;
+ const bufferLength = 1 + (Transforms.BoundingSphere.packedLength + 1) * length;
+ const buffer = new Float32Array(bufferLength);
+
+ let bufferIndex = 0;
+ buffer[bufferIndex++] = length;
+
+ for (let i = 0; i < length; ++i) {
+ const bs = boundingSpheres[i];
+ if (!defaultValue.defined(bs)) {
+ buffer[bufferIndex++] = 0.0;
+ } else {
+ buffer[bufferIndex++] = 1.0;
+ Transforms.BoundingSphere.pack(boundingSpheres[i], buffer, bufferIndex);
+ }
+ bufferIndex += Transforms.BoundingSphere.packedLength;
+ }
+
+ return buffer;
+ }
+
+ function unpackBoundingSpheres(buffer) {
+ const result = new Array(buffer[0]);
+ let count = 0;
+
+ let i = 1;
+ while (i < buffer.length) {
+ if (buffer[i++] === 1.0) {
+ result[count] = Transforms.BoundingSphere.unpack(buffer, i);
+ }
+ ++count;
+ i += Transforms.BoundingSphere.packedLength;
+ }
+
+ return result;
+ }
+
+ /**
+ * @private
+ */
+ PrimitivePipeline.packCombineGeometryResults = function (
+ results,
+ transferableObjects
+ ) {
+ if (defaultValue.defined(results.geometries)) {
+ transferGeometries(results.geometries, transferableObjects);
+ }
+
+ const packedBoundingSpheres = packBoundingSpheres(results.boundingSpheres);
+ const packedBoundingSpheresCV = packBoundingSpheres(
+ results.boundingSpheresCV
+ );
+ transferableObjects.push(
+ packedBoundingSpheres.buffer,
+ packedBoundingSpheresCV.buffer
+ );
+
+ return {
+ geometries: results.geometries,
+ attributeLocations: results.attributeLocations,
+ modelMatrix: results.modelMatrix,
+ pickOffsets: results.pickOffsets,
+ offsetInstanceExtend: results.offsetInstanceExtend,
+ boundingSpheres: packedBoundingSpheres,
+ boundingSpheresCV: packedBoundingSpheresCV,
+ };
+ };
+
+ /**
+ * @private
+ */
+ PrimitivePipeline.unpackCombineGeometryResults = function (packedResult) {
+ return {
+ geometries: packedResult.geometries,
+ attributeLocations: packedResult.attributeLocations,
+ modelMatrix: packedResult.modelMatrix,
+ pickOffsets: packedResult.pickOffsets,
+ offsetInstanceExtend: packedResult.offsetInstanceExtend,
+ boundingSpheres: unpackBoundingSpheres(packedResult.boundingSpheres),
+ boundingSpheresCV: unpackBoundingSpheres(packedResult.boundingSpheresCV),
+ };
+ };
+ var PrimitivePipeline$1 = PrimitivePipeline;
+
+ exports.PrimitivePipeline = PrimitivePipeline$1;
+
+}));
+//# sourceMappingURL=PrimitivePipeline-f6d2b3b0.js.map
diff --git a/examples/cesium/Workers/PrimitivePipeline-f6d2b3b0.js.map b/examples/cesium/Workers/PrimitivePipeline-f6d2b3b0.js.map
new file mode 100644
index 0000000..8573f7e
--- /dev/null
+++ b/examples/cesium/Workers/PrimitivePipeline-f6d2b3b0.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"PrimitivePipeline-f6d2b3b0.js","sources":["../../../Source/Core/OffsetGeometryInstanceAttribute.js","../../../Source/Scene/PrimitivePipeline.js"],"sourcesContent":["import Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\n\r\n/**\r\n * Value and type information for per-instance geometry attribute that determines the geometry instance offset\r\n *\r\n * @alias OffsetGeometryInstanceAttribute\r\n * @constructor\r\n *\r\n * @param {Number} [x=0] The x translation\r\n * @param {Number} [y=0] The y translation\r\n * @param {Number} [z=0] The z translation\r\n *\r\n * @private\r\n *\r\n * @see GeometryInstance\r\n * @see GeometryInstanceAttribute\r\n */\r\nfunction OffsetGeometryInstanceAttribute(x, y, z) {\r\n x = defaultValue(x, 0);\r\n y = defaultValue(y, 0);\r\n z = defaultValue(z, 0);\r\n\r\n /**\r\n * The values for the attributes stored in a typed array.\r\n *\r\n * @type Float32Array\r\n */\r\n this.value = new Float32Array([x, y, z]);\r\n}\r\n\r\nObject.defineProperties(OffsetGeometryInstanceAttribute.prototype, {\r\n /**\r\n * The datatype of each component in the attribute, e.g., individual elements in\r\n * {@link OffsetGeometryInstanceAttribute#value}.\r\n *\r\n * @memberof OffsetGeometryInstanceAttribute.prototype\r\n *\r\n * @type {ComponentDatatype}\r\n * @readonly\r\n *\r\n * @default {@link ComponentDatatype.FLOAT}\r\n */\r\n componentDatatype: {\r\n get: function () {\r\n return ComponentDatatype.FLOAT;\r\n },\r\n },\r\n\r\n /**\r\n * The number of components in the attributes, i.e., {@link OffsetGeometryInstanceAttribute#value}.\r\n *\r\n * @memberof OffsetGeometryInstanceAttribute.prototype\r\n *\r\n * @type {Number}\r\n * @readonly\r\n *\r\n * @default 3\r\n */\r\n componentsPerAttribute: {\r\n get: function () {\r\n return 3;\r\n },\r\n },\r\n\r\n /**\r\n * When true
and componentDatatype
is an integer format,\r\n * indicate that the components should be mapped to the range [0, 1] (unsigned)\r\n * or [-1, 1] (signed) when they are accessed as floating-point for rendering.\r\n *\r\n * @memberof OffsetGeometryInstanceAttribute.prototype\r\n *\r\n * @type {Boolean}\r\n * @readonly\r\n *\r\n * @default false\r\n */\r\n normalize: {\r\n get: function () {\r\n return false;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Creates a new {@link OffsetGeometryInstanceAttribute} instance given the provided an enabled flag and {@link DistanceDisplayCondition}.\r\n *\r\n * @param {Cartesian3} offset The cartesian offset\r\n * @returns {OffsetGeometryInstanceAttribute} The new {@link OffsetGeometryInstanceAttribute} instance.\r\n */\r\nOffsetGeometryInstanceAttribute.fromCartesian3 = function (offset) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"offset\", offset);\r\n //>>includeEnd('debug');\r\n\r\n return new OffsetGeometryInstanceAttribute(offset.x, offset.y, offset.z);\r\n};\r\n\r\n/**\r\n * Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.\r\n *\r\n * @param {Cartesian3} offset The cartesian offset\r\n * @param {Float32Array} [result] The array to store the result in, if undefined a new instance will be created.\r\n * @returns {Float32Array} The modified result parameter or a new instance if result was undefined.\r\n *\r\n * @example\r\n * const attributes = primitive.getGeometryInstanceAttributes('an id');\r\n * attributes.modelMatrix = Cesium.OffsetGeometryInstanceAttribute.toValue(modelMatrix, attributes.modelMatrix);\r\n */\r\nOffsetGeometryInstanceAttribute.toValue = function (offset, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"offset\", offset);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Float32Array([offset.x, offset.y, offset.z]);\r\n }\r\n\r\n result[0] = offset.x;\r\n result[1] = offset.y;\r\n result[2] = offset.z;\r\n return result;\r\n};\r\nexport default OffsetGeometryInstanceAttribute;\r\n","import BoundingSphere from \"../Core/BoundingSphere.js\";\r\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\r\nimport defaultValue from \"../Core/defaultValue.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport DeveloperError from \"../Core/DeveloperError.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport GeographicProjection from \"../Core/GeographicProjection.js\";\r\nimport Geometry from \"../Core/Geometry.js\";\r\nimport GeometryAttribute from \"../Core/GeometryAttribute.js\";\r\nimport GeometryAttributes from \"../Core/GeometryAttributes.js\";\r\nimport GeometryPipeline from \"../Core/GeometryPipeline.js\";\r\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\r\nimport Matrix4 from \"../Core/Matrix4.js\";\r\nimport OffsetGeometryInstanceAttribute from \"../Core/OffsetGeometryInstanceAttribute.js\";\r\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\r\n\r\nfunction transformToWorldCoordinates(\r\n instances,\r\n primitiveModelMatrix,\r\n scene3DOnly\r\n) {\r\n let toWorld = !scene3DOnly;\r\n const length = instances.length;\r\n let i;\r\n\r\n if (!toWorld && length > 1) {\r\n const modelMatrix = instances[0].modelMatrix;\r\n\r\n for (i = 1; i < length; ++i) {\r\n if (!Matrix4.equals(modelMatrix, instances[i].modelMatrix)) {\r\n toWorld = true;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n if (toWorld) {\r\n for (i = 0; i < length; ++i) {\r\n if (defined(instances[i].geometry)) {\r\n GeometryPipeline.transformToWorldCoordinates(instances[i]);\r\n }\r\n }\r\n } else {\r\n // Leave geometry in local coordinate system; auto update model-matrix.\r\n Matrix4.multiplyTransformation(\r\n primitiveModelMatrix,\r\n instances[0].modelMatrix,\r\n primitiveModelMatrix\r\n );\r\n }\r\n}\r\n\r\nfunction addGeometryBatchId(geometry, batchId) {\r\n const attributes = geometry.attributes;\r\n const positionAttr = attributes.position;\r\n const numberOfComponents =\r\n positionAttr.values.length / positionAttr.componentsPerAttribute;\r\n\r\n attributes.batchId = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 1,\r\n values: new Float32Array(numberOfComponents),\r\n });\r\n\r\n const values = attributes.batchId.values;\r\n for (let j = 0; j < numberOfComponents; ++j) {\r\n values[j] = batchId;\r\n }\r\n}\r\n\r\nfunction addBatchIds(instances) {\r\n const length = instances.length;\r\n\r\n for (let i = 0; i < length; ++i) {\r\n const instance = instances[i];\r\n if (defined(instance.geometry)) {\r\n addGeometryBatchId(instance.geometry, i);\r\n } else if (\r\n defined(instance.westHemisphereGeometry) &&\r\n defined(instance.eastHemisphereGeometry)\r\n ) {\r\n addGeometryBatchId(instance.westHemisphereGeometry, i);\r\n addGeometryBatchId(instance.eastHemisphereGeometry, i);\r\n }\r\n }\r\n}\r\n\r\nfunction geometryPipeline(parameters) {\r\n const instances = parameters.instances;\r\n const projection = parameters.projection;\r\n const uintIndexSupport = parameters.elementIndexUintSupported;\r\n const scene3DOnly = parameters.scene3DOnly;\r\n const vertexCacheOptimize = parameters.vertexCacheOptimize;\r\n const compressVertices = parameters.compressVertices;\r\n const modelMatrix = parameters.modelMatrix;\r\n\r\n let i;\r\n let geometry;\r\n let primitiveType;\r\n let length = instances.length;\r\n\r\n for (i = 0; i < length; ++i) {\r\n if (defined(instances[i].geometry)) {\r\n primitiveType = instances[i].geometry.primitiveType;\r\n break;\r\n }\r\n }\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n for (i = 1; i < length; ++i) {\r\n if (\r\n defined(instances[i].geometry) &&\r\n instances[i].geometry.primitiveType !== primitiveType\r\n ) {\r\n throw new DeveloperError(\r\n \"All instance geometries must have the same primitiveType.\"\r\n );\r\n }\r\n }\r\n //>>includeEnd('debug');\r\n\r\n // Unify to world coordinates before combining.\r\n transformToWorldCoordinates(instances, modelMatrix, scene3DOnly);\r\n\r\n // Clip to IDL\r\n if (!scene3DOnly) {\r\n for (i = 0; i < length; ++i) {\r\n if (defined(instances[i].geometry)) {\r\n GeometryPipeline.splitLongitude(instances[i]);\r\n }\r\n }\r\n }\r\n\r\n addBatchIds(instances);\r\n\r\n // Optimize for vertex shader caches\r\n if (vertexCacheOptimize) {\r\n for (i = 0; i < length; ++i) {\r\n const instance = instances[i];\r\n if (defined(instance.geometry)) {\r\n GeometryPipeline.reorderForPostVertexCache(instance.geometry);\r\n GeometryPipeline.reorderForPreVertexCache(instance.geometry);\r\n } else if (\r\n defined(instance.westHemisphereGeometry) &&\r\n defined(instance.eastHemisphereGeometry)\r\n ) {\r\n GeometryPipeline.reorderForPostVertexCache(\r\n instance.westHemisphereGeometry\r\n );\r\n GeometryPipeline.reorderForPreVertexCache(\r\n instance.westHemisphereGeometry\r\n );\r\n\r\n GeometryPipeline.reorderForPostVertexCache(\r\n instance.eastHemisphereGeometry\r\n );\r\n GeometryPipeline.reorderForPreVertexCache(\r\n instance.eastHemisphereGeometry\r\n );\r\n }\r\n }\r\n }\r\n\r\n // Combine into single geometry for better rendering performance.\r\n let geometries = GeometryPipeline.combineInstances(instances);\r\n\r\n length = geometries.length;\r\n for (i = 0; i < length; ++i) {\r\n geometry = geometries[i];\r\n\r\n // Split positions for GPU RTE\r\n const attributes = geometry.attributes;\r\n if (!scene3DOnly) {\r\n for (const name in attributes) {\r\n if (\r\n attributes.hasOwnProperty(name) &&\r\n attributes[name].componentDatatype === ComponentDatatype.DOUBLE\r\n ) {\r\n const name3D = `${name}3D`;\r\n const name2D = `${name}2D`;\r\n\r\n // Compute 2D positions\r\n GeometryPipeline.projectTo2D(\r\n geometry,\r\n name,\r\n name3D,\r\n name2D,\r\n projection\r\n );\r\n if (defined(geometry.boundingSphere) && name === \"position\") {\r\n geometry.boundingSphereCV = BoundingSphere.fromVertices(\r\n geometry.attributes.position2D.values\r\n );\r\n }\r\n\r\n GeometryPipeline.encodeAttribute(\r\n geometry,\r\n name3D,\r\n `${name3D}High`,\r\n `${name3D}Low`\r\n );\r\n GeometryPipeline.encodeAttribute(\r\n geometry,\r\n name2D,\r\n `${name2D}High`,\r\n `${name2D}Low`\r\n );\r\n }\r\n }\r\n } else {\r\n for (const name in attributes) {\r\n if (\r\n attributes.hasOwnProperty(name) &&\r\n attributes[name].componentDatatype === ComponentDatatype.DOUBLE\r\n ) {\r\n GeometryPipeline.encodeAttribute(\r\n geometry,\r\n name,\r\n `${name}3DHigh`,\r\n `${name}3DLow`\r\n );\r\n }\r\n }\r\n }\r\n\r\n // oct encode and pack normals, compress texture coordinates\r\n if (compressVertices) {\r\n GeometryPipeline.compressVertices(geometry);\r\n }\r\n }\r\n\r\n if (!uintIndexSupport) {\r\n // Break into multiple geometries to fit within unsigned short indices if needed\r\n let splitGeometries = [];\r\n length = geometries.length;\r\n for (i = 0; i < length; ++i) {\r\n geometry = geometries[i];\r\n splitGeometries = splitGeometries.concat(\r\n GeometryPipeline.fitToUnsignedShortIndices(geometry)\r\n );\r\n }\r\n\r\n geometries = splitGeometries;\r\n }\r\n\r\n return geometries;\r\n}\r\n\r\nfunction createPickOffsets(instances, geometryName, geometries, pickOffsets) {\r\n let offset;\r\n let indexCount;\r\n let geometryIndex;\r\n\r\n const offsetIndex = pickOffsets.length - 1;\r\n if (offsetIndex >= 0) {\r\n const pickOffset = pickOffsets[offsetIndex];\r\n offset = pickOffset.offset + pickOffset.count;\r\n geometryIndex = pickOffset.index;\r\n indexCount = geometries[geometryIndex].indices.length;\r\n } else {\r\n offset = 0;\r\n geometryIndex = 0;\r\n indexCount = geometries[geometryIndex].indices.length;\r\n }\r\n\r\n const length = instances.length;\r\n for (let i = 0; i < length; ++i) {\r\n const instance = instances[i];\r\n const geometry = instance[geometryName];\r\n if (!defined(geometry)) {\r\n continue;\r\n }\r\n\r\n const count = geometry.indices.length;\r\n\r\n if (offset + count > indexCount) {\r\n offset = 0;\r\n indexCount = geometries[++geometryIndex].indices.length;\r\n }\r\n\r\n pickOffsets.push({\r\n index: geometryIndex,\r\n offset: offset,\r\n count: count,\r\n });\r\n offset += count;\r\n }\r\n}\r\n\r\nfunction createInstancePickOffsets(instances, geometries) {\r\n const pickOffsets = [];\r\n createPickOffsets(instances, \"geometry\", geometries, pickOffsets);\r\n createPickOffsets(\r\n instances,\r\n \"westHemisphereGeometry\",\r\n geometries,\r\n pickOffsets\r\n );\r\n createPickOffsets(\r\n instances,\r\n \"eastHemisphereGeometry\",\r\n geometries,\r\n pickOffsets\r\n );\r\n return pickOffsets;\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nconst PrimitivePipeline = {};\r\n\r\n/**\r\n * @private\r\n */\r\nPrimitivePipeline.combineGeometry = function (parameters) {\r\n let geometries;\r\n let attributeLocations;\r\n const instances = parameters.instances;\r\n const length = instances.length;\r\n let pickOffsets;\r\n\r\n let offsetInstanceExtend;\r\n let hasOffset = false;\r\n if (length > 0) {\r\n geometries = geometryPipeline(parameters);\r\n if (geometries.length > 0) {\r\n attributeLocations = GeometryPipeline.createAttributeLocations(\r\n geometries[0]\r\n );\r\n if (parameters.createPickOffsets) {\r\n pickOffsets = createInstancePickOffsets(instances, geometries);\r\n }\r\n }\r\n if (\r\n defined(instances[0].attributes) &&\r\n defined(instances[0].attributes.offset)\r\n ) {\r\n offsetInstanceExtend = new Array(length);\r\n hasOffset = true;\r\n }\r\n }\r\n\r\n const boundingSpheres = new Array(length);\r\n const boundingSpheresCV = new Array(length);\r\n for (let i = 0; i < length; ++i) {\r\n const instance = instances[i];\r\n const geometry = instance.geometry;\r\n if (defined(geometry)) {\r\n boundingSpheres[i] = geometry.boundingSphere;\r\n boundingSpheresCV[i] = geometry.boundingSphereCV;\r\n if (hasOffset) {\r\n offsetInstanceExtend[i] = instance.geometry.offsetAttribute;\r\n }\r\n }\r\n\r\n const eastHemisphereGeometry = instance.eastHemisphereGeometry;\r\n const westHemisphereGeometry = instance.westHemisphereGeometry;\r\n if (defined(eastHemisphereGeometry) && defined(westHemisphereGeometry)) {\r\n if (\r\n defined(eastHemisphereGeometry.boundingSphere) &&\r\n defined(westHemisphereGeometry.boundingSphere)\r\n ) {\r\n boundingSpheres[i] = BoundingSphere.union(\r\n eastHemisphereGeometry.boundingSphere,\r\n westHemisphereGeometry.boundingSphere\r\n );\r\n }\r\n if (\r\n defined(eastHemisphereGeometry.boundingSphereCV) &&\r\n defined(westHemisphereGeometry.boundingSphereCV)\r\n ) {\r\n boundingSpheresCV[i] = BoundingSphere.union(\r\n eastHemisphereGeometry.boundingSphereCV,\r\n westHemisphereGeometry.boundingSphereCV\r\n );\r\n }\r\n }\r\n }\r\n\r\n return {\r\n geometries: geometries,\r\n modelMatrix: parameters.modelMatrix,\r\n attributeLocations: attributeLocations,\r\n pickOffsets: pickOffsets,\r\n offsetInstanceExtend: offsetInstanceExtend,\r\n boundingSpheres: boundingSpheres,\r\n boundingSpheresCV: boundingSpheresCV,\r\n };\r\n};\r\n\r\nfunction transferGeometry(geometry, transferableObjects) {\r\n const attributes = geometry.attributes;\r\n for (const name in attributes) {\r\n if (attributes.hasOwnProperty(name)) {\r\n const attribute = attributes[name];\r\n\r\n if (defined(attribute) && defined(attribute.values)) {\r\n transferableObjects.push(attribute.values.buffer);\r\n }\r\n }\r\n }\r\n\r\n if (defined(geometry.indices)) {\r\n transferableObjects.push(geometry.indices.buffer);\r\n }\r\n}\r\n\r\nfunction transferGeometries(geometries, transferableObjects) {\r\n const length = geometries.length;\r\n for (let i = 0; i < length; ++i) {\r\n transferGeometry(geometries[i], transferableObjects);\r\n }\r\n}\r\n\r\n// This function was created by simplifying packCreateGeometryResults into a count-only operation.\r\nfunction countCreateGeometryResults(items) {\r\n let count = 1;\r\n const length = items.length;\r\n for (let i = 0; i < length; i++) {\r\n const geometry = items[i];\r\n ++count;\r\n\r\n if (!defined(geometry)) {\r\n continue;\r\n }\r\n\r\n const attributes = geometry.attributes;\r\n\r\n count +=\r\n 7 +\r\n 2 * BoundingSphere.packedLength +\r\n (defined(geometry.indices) ? geometry.indices.length : 0);\r\n\r\n for (const property in attributes) {\r\n if (\r\n attributes.hasOwnProperty(property) &&\r\n defined(attributes[property])\r\n ) {\r\n const attribute = attributes[property];\r\n count += 5 + attribute.values.length;\r\n }\r\n }\r\n }\r\n\r\n return count;\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nPrimitivePipeline.packCreateGeometryResults = function (\r\n items,\r\n transferableObjects\r\n) {\r\n const packedData = new Float64Array(countCreateGeometryResults(items));\r\n const stringTable = [];\r\n const stringHash = {};\r\n\r\n const length = items.length;\r\n let count = 0;\r\n packedData[count++] = length;\r\n for (let i = 0; i < length; i++) {\r\n const geometry = items[i];\r\n\r\n const validGeometry = defined(geometry);\r\n packedData[count++] = validGeometry ? 1.0 : 0.0;\r\n\r\n if (!validGeometry) {\r\n continue;\r\n }\r\n\r\n packedData[count++] = geometry.primitiveType;\r\n packedData[count++] = geometry.geometryType;\r\n packedData[count++] = defaultValue(geometry.offsetAttribute, -1);\r\n\r\n const validBoundingSphere = defined(geometry.boundingSphere) ? 1.0 : 0.0;\r\n packedData[count++] = validBoundingSphere;\r\n if (validBoundingSphere) {\r\n BoundingSphere.pack(geometry.boundingSphere, packedData, count);\r\n }\r\n\r\n count += BoundingSphere.packedLength;\r\n\r\n const validBoundingSphereCV = defined(geometry.boundingSphereCV)\r\n ? 1.0\r\n : 0.0;\r\n packedData[count++] = validBoundingSphereCV;\r\n if (validBoundingSphereCV) {\r\n BoundingSphere.pack(geometry.boundingSphereCV, packedData, count);\r\n }\r\n\r\n count += BoundingSphere.packedLength;\r\n\r\n const attributes = geometry.attributes;\r\n const attributesToWrite = [];\r\n for (const property in attributes) {\r\n if (\r\n attributes.hasOwnProperty(property) &&\r\n defined(attributes[property])\r\n ) {\r\n attributesToWrite.push(property);\r\n if (!defined(stringHash[property])) {\r\n stringHash[property] = stringTable.length;\r\n stringTable.push(property);\r\n }\r\n }\r\n }\r\n\r\n packedData[count++] = attributesToWrite.length;\r\n for (let q = 0; q < attributesToWrite.length; q++) {\r\n const name = attributesToWrite[q];\r\n const attribute = attributes[name];\r\n packedData[count++] = stringHash[name];\r\n packedData[count++] = attribute.componentDatatype;\r\n packedData[count++] = attribute.componentsPerAttribute;\r\n packedData[count++] = attribute.normalize ? 1 : 0;\r\n packedData[count++] = attribute.values.length;\r\n packedData.set(attribute.values, count);\r\n count += attribute.values.length;\r\n }\r\n\r\n const indicesLength = defined(geometry.indices)\r\n ? geometry.indices.length\r\n : 0;\r\n packedData[count++] = indicesLength;\r\n\r\n if (indicesLength > 0) {\r\n packedData.set(geometry.indices, count);\r\n count += indicesLength;\r\n }\r\n }\r\n\r\n transferableObjects.push(packedData.buffer);\r\n\r\n return {\r\n stringTable: stringTable,\r\n packedData: packedData,\r\n };\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPrimitivePipeline.unpackCreateGeometryResults = function (\r\n createGeometryResult\r\n) {\r\n const stringTable = createGeometryResult.stringTable;\r\n const packedGeometry = createGeometryResult.packedData;\r\n\r\n let i;\r\n const result = new Array(packedGeometry[0]);\r\n let resultIndex = 0;\r\n\r\n let packedGeometryIndex = 1;\r\n while (packedGeometryIndex < packedGeometry.length) {\r\n const valid = packedGeometry[packedGeometryIndex++] === 1.0;\r\n if (!valid) {\r\n result[resultIndex++] = undefined;\r\n continue;\r\n }\r\n\r\n const primitiveType = packedGeometry[packedGeometryIndex++];\r\n const geometryType = packedGeometry[packedGeometryIndex++];\r\n let offsetAttribute = packedGeometry[packedGeometryIndex++];\r\n if (offsetAttribute === -1) {\r\n offsetAttribute = undefined;\r\n }\r\n\r\n let boundingSphere;\r\n let boundingSphereCV;\r\n\r\n const validBoundingSphere = packedGeometry[packedGeometryIndex++] === 1.0;\r\n if (validBoundingSphere) {\r\n boundingSphere = BoundingSphere.unpack(\r\n packedGeometry,\r\n packedGeometryIndex\r\n );\r\n }\r\n\r\n packedGeometryIndex += BoundingSphere.packedLength;\r\n\r\n const validBoundingSphereCV = packedGeometry[packedGeometryIndex++] === 1.0;\r\n if (validBoundingSphereCV) {\r\n boundingSphereCV = BoundingSphere.unpack(\r\n packedGeometry,\r\n packedGeometryIndex\r\n );\r\n }\r\n\r\n packedGeometryIndex += BoundingSphere.packedLength;\r\n\r\n let length;\r\n let values;\r\n let componentsPerAttribute;\r\n const attributes = new GeometryAttributes();\r\n const numAttributes = packedGeometry[packedGeometryIndex++];\r\n for (i = 0; i < numAttributes; i++) {\r\n const name = stringTable[packedGeometry[packedGeometryIndex++]];\r\n const componentDatatype = packedGeometry[packedGeometryIndex++];\r\n componentsPerAttribute = packedGeometry[packedGeometryIndex++];\r\n const normalize = packedGeometry[packedGeometryIndex++] !== 0;\r\n\r\n length = packedGeometry[packedGeometryIndex++];\r\n values = ComponentDatatype.createTypedArray(componentDatatype, length);\r\n for (let valuesIndex = 0; valuesIndex < length; valuesIndex++) {\r\n values[valuesIndex] = packedGeometry[packedGeometryIndex++];\r\n }\r\n\r\n attributes[name] = new GeometryAttribute({\r\n componentDatatype: componentDatatype,\r\n componentsPerAttribute: componentsPerAttribute,\r\n normalize: normalize,\r\n values: values,\r\n });\r\n }\r\n\r\n let indices;\r\n length = packedGeometry[packedGeometryIndex++];\r\n\r\n if (length > 0) {\r\n const numberOfVertices = values.length / componentsPerAttribute;\r\n indices = IndexDatatype.createTypedArray(numberOfVertices, length);\r\n for (i = 0; i < length; i++) {\r\n indices[i] = packedGeometry[packedGeometryIndex++];\r\n }\r\n }\r\n\r\n result[resultIndex++] = new Geometry({\r\n primitiveType: primitiveType,\r\n geometryType: geometryType,\r\n boundingSphere: boundingSphere,\r\n boundingSphereCV: boundingSphereCV,\r\n indices: indices,\r\n attributes: attributes,\r\n offsetAttribute: offsetAttribute,\r\n });\r\n }\r\n\r\n return result;\r\n};\r\n\r\nfunction packInstancesForCombine(instances, transferableObjects) {\r\n const length = instances.length;\r\n const packedData = new Float64Array(1 + length * 19);\r\n let count = 0;\r\n packedData[count++] = length;\r\n for (let i = 0; i < length; i++) {\r\n const instance = instances[i];\r\n Matrix4.pack(instance.modelMatrix, packedData, count);\r\n count += Matrix4.packedLength;\r\n if (defined(instance.attributes) && defined(instance.attributes.offset)) {\r\n const values = instance.attributes.offset.value;\r\n packedData[count] = values[0];\r\n packedData[count + 1] = values[1];\r\n packedData[count + 2] = values[2];\r\n }\r\n count += 3;\r\n }\r\n transferableObjects.push(packedData.buffer);\r\n\r\n return packedData;\r\n}\r\n\r\nfunction unpackInstancesForCombine(data) {\r\n const packedInstances = data;\r\n const result = new Array(packedInstances[0]);\r\n let count = 0;\r\n\r\n let i = 1;\r\n while (i < packedInstances.length) {\r\n const modelMatrix = Matrix4.unpack(packedInstances, i);\r\n let attributes;\r\n i += Matrix4.packedLength;\r\n if (defined(packedInstances[i])) {\r\n attributes = {\r\n offset: new OffsetGeometryInstanceAttribute(\r\n packedInstances[i],\r\n packedInstances[i + 1],\r\n packedInstances[i + 2]\r\n ),\r\n };\r\n }\r\n i += 3;\r\n\r\n result[count++] = {\r\n modelMatrix: modelMatrix,\r\n attributes: attributes,\r\n };\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nPrimitivePipeline.packCombineGeometryParameters = function (\r\n parameters,\r\n transferableObjects\r\n) {\r\n const createGeometryResults = parameters.createGeometryResults;\r\n const length = createGeometryResults.length;\r\n\r\n for (let i = 0; i < length; i++) {\r\n transferableObjects.push(createGeometryResults[i].packedData.buffer);\r\n }\r\n\r\n return {\r\n createGeometryResults: parameters.createGeometryResults,\r\n packedInstances: packInstancesForCombine(\r\n parameters.instances,\r\n transferableObjects\r\n ),\r\n ellipsoid: parameters.ellipsoid,\r\n isGeographic: parameters.projection instanceof GeographicProjection,\r\n elementIndexUintSupported: parameters.elementIndexUintSupported,\r\n scene3DOnly: parameters.scene3DOnly,\r\n vertexCacheOptimize: parameters.vertexCacheOptimize,\r\n compressVertices: parameters.compressVertices,\r\n modelMatrix: parameters.modelMatrix,\r\n createPickOffsets: parameters.createPickOffsets,\r\n };\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPrimitivePipeline.unpackCombineGeometryParameters = function (\r\n packedParameters\r\n) {\r\n const instances = unpackInstancesForCombine(packedParameters.packedInstances);\r\n const createGeometryResults = packedParameters.createGeometryResults;\r\n const length = createGeometryResults.length;\r\n let instanceIndex = 0;\r\n\r\n for (let resultIndex = 0; resultIndex < length; resultIndex++) {\r\n const geometries = PrimitivePipeline.unpackCreateGeometryResults(\r\n createGeometryResults[resultIndex]\r\n );\r\n const geometriesLength = geometries.length;\r\n for (\r\n let geometryIndex = 0;\r\n geometryIndex < geometriesLength;\r\n geometryIndex++\r\n ) {\r\n const geometry = geometries[geometryIndex];\r\n const instance = instances[instanceIndex];\r\n instance.geometry = geometry;\r\n ++instanceIndex;\r\n }\r\n }\r\n\r\n const ellipsoid = Ellipsoid.clone(packedParameters.ellipsoid);\r\n const projection = packedParameters.isGeographic\r\n ? new GeographicProjection(ellipsoid)\r\n : new WebMercatorProjection(ellipsoid);\r\n\r\n return {\r\n instances: instances,\r\n ellipsoid: ellipsoid,\r\n projection: projection,\r\n elementIndexUintSupported: packedParameters.elementIndexUintSupported,\r\n scene3DOnly: packedParameters.scene3DOnly,\r\n vertexCacheOptimize: packedParameters.vertexCacheOptimize,\r\n compressVertices: packedParameters.compressVertices,\r\n modelMatrix: Matrix4.clone(packedParameters.modelMatrix),\r\n createPickOffsets: packedParameters.createPickOffsets,\r\n };\r\n};\r\n\r\nfunction packBoundingSpheres(boundingSpheres) {\r\n const length = boundingSpheres.length;\r\n const bufferLength = 1 + (BoundingSphere.packedLength + 1) * length;\r\n const buffer = new Float32Array(bufferLength);\r\n\r\n let bufferIndex = 0;\r\n buffer[bufferIndex++] = length;\r\n\r\n for (let i = 0; i < length; ++i) {\r\n const bs = boundingSpheres[i];\r\n if (!defined(bs)) {\r\n buffer[bufferIndex++] = 0.0;\r\n } else {\r\n buffer[bufferIndex++] = 1.0;\r\n BoundingSphere.pack(boundingSpheres[i], buffer, bufferIndex);\r\n }\r\n bufferIndex += BoundingSphere.packedLength;\r\n }\r\n\r\n return buffer;\r\n}\r\n\r\nfunction unpackBoundingSpheres(buffer) {\r\n const result = new Array(buffer[0]);\r\n let count = 0;\r\n\r\n let i = 1;\r\n while (i < buffer.length) {\r\n if (buffer[i++] === 1.0) {\r\n result[count] = BoundingSphere.unpack(buffer, i);\r\n }\r\n ++count;\r\n i += BoundingSphere.packedLength;\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nPrimitivePipeline.packCombineGeometryResults = function (\r\n results,\r\n transferableObjects\r\n) {\r\n if (defined(results.geometries)) {\r\n transferGeometries(results.geometries, transferableObjects);\r\n }\r\n\r\n const packedBoundingSpheres = packBoundingSpheres(results.boundingSpheres);\r\n const packedBoundingSpheresCV = packBoundingSpheres(\r\n results.boundingSpheresCV\r\n );\r\n transferableObjects.push(\r\n packedBoundingSpheres.buffer,\r\n packedBoundingSpheresCV.buffer\r\n );\r\n\r\n return {\r\n geometries: results.geometries,\r\n attributeLocations: results.attributeLocations,\r\n modelMatrix: results.modelMatrix,\r\n pickOffsets: results.pickOffsets,\r\n offsetInstanceExtend: results.offsetInstanceExtend,\r\n boundingSpheres: packedBoundingSpheres,\r\n boundingSpheresCV: packedBoundingSpheresCV,\r\n };\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPrimitivePipeline.unpackCombineGeometryResults = function (packedResult) {\r\n return {\r\n geometries: packedResult.geometries,\r\n attributeLocations: packedResult.attributeLocations,\r\n modelMatrix: packedResult.modelMatrix,\r\n pickOffsets: packedResult.pickOffsets,\r\n offsetInstanceExtend: packedResult.offsetInstanceExtend,\r\n boundingSpheres: unpackBoundingSpheres(packedResult.boundingSpheres),\r\n boundingSpheresCV: unpackBoundingSpheres(packedResult.boundingSpheresCV),\r\n };\r\n};\r\nexport default PrimitivePipeline;\r\n"],"names":["defaultValue","ComponentDatatype","Check","defined","Matrix4","GeometryPipeline","GeometryAttribute","DeveloperError","BoundingSphere","GeometryAttributes","IndexDatatype","Geometry","GeographicProjection","Ellipsoid","WebMercatorProjection"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,+BAA+B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;EAClD,EAAE,CAAC,GAAGA,yBAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACzB,EAAE,CAAC,GAAGA,yBAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EACzB,EAAE,CAAC,GAAGA,yBAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACzB;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;EAC3C,CAAC;AACD;EACA,MAAM,CAAC,gBAAgB,CAAC,+BAA+B,CAAC,SAAS,EAAE;EACnE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,iBAAiB,EAAE;EACrB,IAAI,GAAG,EAAE,YAAY;EACrB,MAAM,OAAOC,mCAAiB,CAAC,KAAK,CAAC;EACrC,KAAK;EACL,GAAG;AACH;EACA;EACA;EACA;EAC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AG,CAAC;EACJ,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA,iBAAiB,CAAC,4BAA4B,GAAG,UAAU,YAAY,EAAE;EACzE,EAAE,OAAO;EACT,IAAI,UAAU,EAAE,YAAY,CAAC,UAAU;EACvC,IAAI,kBAAkB,EAAE,YAAY,CAAC,kBAAkB;EACvD,IAAI,WAAW,EAAE,YAAY,CAAC,WAAW;EACzC,IAAI,WAAW,EAAE,YAAY,CAAC,WAAW;EACzC,IAAI,oBAAoB,EAAE,YAAY,CAAC,oBAAoB;EAC3D,IAAI,eAAe,EAAE,qBAAqB,CAAC,YAAY,CAAC,eAAe,CAAC;EACxE,IAAI,iBAAiB,EAAE,qBAAqB,CAAC,YAAY,CAAC,iBAAiB,CAAC;EAC5E,GAAG,CAAC;EACJ,CAAC,CAAC;AACF,4BAAe,iBAAiB;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/RectangleGeometryLibrary-94f83a5a.js b/examples/cesium/Workers/RectangleGeometryLibrary-94f83a5a.js
new file mode 100644
index 0000000..32807ce
--- /dev/null
+++ b/examples/cesium/Workers/RectangleGeometryLibrary-94f83a5a.js
@@ -0,0 +1,306 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './defaultValue-0ab18f7d', './Check-d10e5f2e', './Transforms-11fb6b0a', './Math-9be8b918', './Matrix2-036c77dd'], (function (exports, Matrix3, defaultValue, Check, Transforms, Math$1, Matrix2) { 'use strict';
+
+ const cos = Math.cos;
+ const sin = Math.sin;
+ const sqrt = Math.sqrt;
+
+ /**
+ * @private
+ */
+ const RectangleGeometryLibrary = {};
+
+ /**
+ * @private
+ */
+ RectangleGeometryLibrary.computePosition = function (
+ computedOptions,
+ ellipsoid,
+ computeST,
+ row,
+ col,
+ position,
+ st
+ ) {
+ const radiiSquared = ellipsoid.radiiSquared;
+ const nwCorner = computedOptions.nwCorner;
+ const rectangle = computedOptions.boundingRectangle;
+
+ let stLatitude =
+ nwCorner.latitude -
+ computedOptions.granYCos * row +
+ col * computedOptions.granXSin;
+ const cosLatitude = cos(stLatitude);
+ const nZ = sin(stLatitude);
+ const kZ = radiiSquared.z * nZ;
+
+ let stLongitude =
+ nwCorner.longitude +
+ row * computedOptions.granYSin +
+ col * computedOptions.granXCos;
+ const nX = cosLatitude * cos(stLongitude);
+ const nY = cosLatitude * sin(stLongitude);
+
+ const kX = radiiSquared.x * nX;
+ const kY = radiiSquared.y * nY;
+
+ const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);
+
+ position.x = kX / gamma;
+ position.y = kY / gamma;
+ position.z = kZ / gamma;
+
+ if (computeST) {
+ const stNwCorner = computedOptions.stNwCorner;
+ if (defaultValue.defined(stNwCorner)) {
+ stLatitude =
+ stNwCorner.latitude -
+ computedOptions.stGranYCos * row +
+ col * computedOptions.stGranXSin;
+ stLongitude =
+ stNwCorner.longitude +
+ row * computedOptions.stGranYSin +
+ col * computedOptions.stGranXCos;
+
+ st.x = (stLongitude - computedOptions.stWest) * computedOptions.lonScalar;
+ st.y = (stLatitude - computedOptions.stSouth) * computedOptions.latScalar;
+ } else {
+ st.x = (stLongitude - rectangle.west) * computedOptions.lonScalar;
+ st.y = (stLatitude - rectangle.south) * computedOptions.latScalar;
+ }
+ }
+ };
+
+ const rotationMatrixScratch = new Matrix2.Matrix2();
+ let nwCartesian = new Matrix3.Cartesian3();
+ const centerScratch = new Matrix3.Cartographic();
+ let centerCartesian = new Matrix3.Cartesian3();
+ const proj = new Transforms.GeographicProjection();
+
+ function getRotationOptions(
+ nwCorner,
+ rotation,
+ granularityX,
+ granularityY,
+ center,
+ width,
+ height
+ ) {
+ const cosRotation = Math.cos(rotation);
+ const granYCos = granularityY * cosRotation;
+ const granXCos = granularityX * cosRotation;
+
+ const sinRotation = Math.sin(rotation);
+ const granYSin = granularityY * sinRotation;
+ const granXSin = granularityX * sinRotation;
+
+ nwCartesian = proj.project(nwCorner, nwCartesian);
+
+ nwCartesian = Matrix3.Cartesian3.subtract(nwCartesian, centerCartesian, nwCartesian);
+ const rotationMatrix = Matrix2.Matrix2.fromRotation(rotation, rotationMatrixScratch);
+ nwCartesian = Matrix2.Matrix2.multiplyByVector(
+ rotationMatrix,
+ nwCartesian,
+ nwCartesian
+ );
+ nwCartesian = Matrix3.Cartesian3.add(nwCartesian, centerCartesian, nwCartesian);
+ nwCorner = proj.unproject(nwCartesian, nwCorner);
+
+ width -= 1;
+ height -= 1;
+
+ const latitude = nwCorner.latitude;
+ const latitude0 = latitude + width * granXSin;
+ const latitude1 = latitude - granYCos * height;
+ const latitude2 = latitude - granYCos * height + width * granXSin;
+
+ const north = Math.max(latitude, latitude0, latitude1, latitude2);
+ const south = Math.min(latitude, latitude0, latitude1, latitude2);
+
+ const longitude = nwCorner.longitude;
+ const longitude0 = longitude + width * granXCos;
+ const longitude1 = longitude + height * granYSin;
+ const longitude2 = longitude + height * granYSin + width * granXCos;
+
+ const east = Math.max(longitude, longitude0, longitude1, longitude2);
+ const west = Math.min(longitude, longitude0, longitude1, longitude2);
+
+ return {
+ north: north,
+ south: south,
+ east: east,
+ west: west,
+ granYCos: granYCos,
+ granYSin: granYSin,
+ granXCos: granXCos,
+ granXSin: granXSin,
+ nwCorner: nwCorner,
+ };
+ }
+
+ /**
+ * @private
+ */
+ RectangleGeometryLibrary.computeOptions = function (
+ rectangle,
+ granularity,
+ rotation,
+ stRotation,
+ boundingRectangleScratch,
+ nwCornerResult,
+ stNwCornerResult
+ ) {
+ let east = rectangle.east;
+ let west = rectangle.west;
+ let north = rectangle.north;
+ let south = rectangle.south;
+
+ let northCap = false;
+ let southCap = false;
+
+ if (north === Math$1.CesiumMath.PI_OVER_TWO) {
+ northCap = true;
+ }
+ if (south === -Math$1.CesiumMath.PI_OVER_TWO) {
+ southCap = true;
+ }
+
+ let dx;
+ const dy = north - south;
+ if (west > east) {
+ dx = Math$1.CesiumMath.TWO_PI - west + east;
+ } else {
+ dx = east - west;
+ }
+
+ const width = Math.ceil(dx / granularity) + 1;
+ const height = Math.ceil(dy / granularity) + 1;
+ const granularityX = dx / (width - 1);
+ const granularityY = dy / (height - 1);
+
+ const nwCorner = Matrix2.Rectangle.northwest(rectangle, nwCornerResult);
+ const center = Matrix2.Rectangle.center(rectangle, centerScratch);
+ if (rotation !== 0 || stRotation !== 0) {
+ if (center.longitude < nwCorner.longitude) {
+ center.longitude += Math$1.CesiumMath.TWO_PI;
+ }
+ centerCartesian = proj.project(center, centerCartesian);
+ }
+
+ const granYCos = granularityY;
+ const granXCos = granularityX;
+ const granYSin = 0.0;
+ const granXSin = 0.0;
+
+ const boundingRectangle = Matrix2.Rectangle.clone(
+ rectangle,
+ boundingRectangleScratch
+ );
+
+ const computedOptions = {
+ granYCos: granYCos,
+ granYSin: granYSin,
+ granXCos: granXCos,
+ granXSin: granXSin,
+ nwCorner: nwCorner,
+ boundingRectangle: boundingRectangle,
+ width: width,
+ height: height,
+ northCap: northCap,
+ southCap: southCap,
+ };
+
+ if (rotation !== 0) {
+ const rotationOptions = getRotationOptions(
+ nwCorner,
+ rotation,
+ granularityX,
+ granularityY,
+ center,
+ width,
+ height
+ );
+ north = rotationOptions.north;
+ south = rotationOptions.south;
+ east = rotationOptions.east;
+ west = rotationOptions.west;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (
+ north < -Math$1.CesiumMath.PI_OVER_TWO ||
+ north > Math$1.CesiumMath.PI_OVER_TWO ||
+ south < -Math$1.CesiumMath.PI_OVER_TWO ||
+ south > Math$1.CesiumMath.PI_OVER_TWO
+ ) {
+ throw new Check.DeveloperError(
+ "Rotated rectangle is invalid. It crosses over either the north or south pole."
+ );
+ }
+ //>>includeEnd('debug')
+
+ computedOptions.granYCos = rotationOptions.granYCos;
+ computedOptions.granYSin = rotationOptions.granYSin;
+ computedOptions.granXCos = rotationOptions.granXCos;
+ computedOptions.granXSin = rotationOptions.granXSin;
+
+ boundingRectangle.north = north;
+ boundingRectangle.south = south;
+ boundingRectangle.east = east;
+ boundingRectangle.west = west;
+ }
+
+ if (stRotation !== 0) {
+ rotation = rotation - stRotation;
+ const stNwCorner = Matrix2.Rectangle.northwest(boundingRectangle, stNwCornerResult);
+
+ const stRotationOptions = getRotationOptions(
+ stNwCorner,
+ rotation,
+ granularityX,
+ granularityY,
+ center,
+ width,
+ height
+ );
+
+ computedOptions.stGranYCos = stRotationOptions.granYCos;
+ computedOptions.stGranXCos = stRotationOptions.granXCos;
+ computedOptions.stGranYSin = stRotationOptions.granYSin;
+ computedOptions.stGranXSin = stRotationOptions.granXSin;
+ computedOptions.stNwCorner = stNwCorner;
+ computedOptions.stWest = stRotationOptions.west;
+ computedOptions.stSouth = stRotationOptions.south;
+ }
+
+ return computedOptions;
+ };
+ var RectangleGeometryLibrary$1 = RectangleGeometryLibrary;
+
+ exports.RectangleGeometryLibrary = RectangleGeometryLibrary$1;
+
+}));
+//# sourceMappingURL=RectangleGeometryLibrary-94f83a5a.js.map
diff --git a/examples/cesium/Workers/RectangleGeometryLibrary-94f83a5a.js.map b/examples/cesium/Workers/RectangleGeometryLibrary-94f83a5a.js.map
new file mode 100644
index 0000000..24afd6c
--- /dev/null
+++ b/examples/cesium/Workers/RectangleGeometryLibrary-94f83a5a.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"RectangleGeometryLibrary-94f83a5a.js","sources":["../../../Source/Core/RectangleGeometryLibrary.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport GeographicProjection from \"./GeographicProjection.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix2 from \"./Matrix2.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\n\r\nconst cos = Math.cos;\r\nconst sin = Math.sin;\r\nconst sqrt = Math.sqrt;\r\n\r\n/**\r\n * @private\r\n */\r\nconst RectangleGeometryLibrary = {};\r\n\r\n/**\r\n * @private\r\n */\r\nRectangleGeometryLibrary.computePosition = function (\r\n computedOptions,\r\n ellipsoid,\r\n computeST,\r\n row,\r\n col,\r\n position,\r\n st\r\n) {\r\n const radiiSquared = ellipsoid.radiiSquared;\r\n const nwCorner = computedOptions.nwCorner;\r\n const rectangle = computedOptions.boundingRectangle;\r\n\r\n let stLatitude =\r\n nwCorner.latitude -\r\n computedOptions.granYCos * row +\r\n col * computedOptions.granXSin;\r\n const cosLatitude = cos(stLatitude);\r\n const nZ = sin(stLatitude);\r\n const kZ = radiiSquared.z * nZ;\r\n\r\n let stLongitude =\r\n nwCorner.longitude +\r\n row * computedOptions.granYSin +\r\n col * computedOptions.granXCos;\r\n const nX = cosLatitude * cos(stLongitude);\r\n const nY = cosLatitude * sin(stLongitude);\r\n\r\n const kX = radiiSquared.x * nX;\r\n const kY = radiiSquared.y * nY;\r\n\r\n const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);\r\n\r\n position.x = kX / gamma;\r\n position.y = kY / gamma;\r\n position.z = kZ / gamma;\r\n\r\n if (computeST) {\r\n const stNwCorner = computedOptions.stNwCorner;\r\n if (defined(stNwCorner)) {\r\n stLatitude =\r\n stNwCorner.latitude -\r\n computedOptions.stGranYCos * row +\r\n col * computedOptions.stGranXSin;\r\n stLongitude =\r\n stNwCorner.longitude +\r\n row * computedOptions.stGranYSin +\r\n col * computedOptions.stGranXCos;\r\n\r\n st.x = (stLongitude - computedOptions.stWest) * computedOptions.lonScalar;\r\n st.y = (stLatitude - computedOptions.stSouth) * computedOptions.latScalar;\r\n } else {\r\n st.x = (stLongitude - rectangle.west) * computedOptions.lonScalar;\r\n st.y = (stLatitude - rectangle.south) * computedOptions.latScalar;\r\n }\r\n }\r\n};\r\n\r\nconst rotationMatrixScratch = new Matrix2();\r\nlet nwCartesian = new Cartesian3();\r\nconst centerScratch = new Cartographic();\r\nlet centerCartesian = new Cartesian3();\r\nconst proj = new GeographicProjection();\r\n\r\nfunction getRotationOptions(\r\n nwCorner,\r\n rotation,\r\n granularityX,\r\n granularityY,\r\n center,\r\n width,\r\n height\r\n) {\r\n const cosRotation = Math.cos(rotation);\r\n const granYCos = granularityY * cosRotation;\r\n const granXCos = granularityX * cosRotation;\r\n\r\n const sinRotation = Math.sin(rotation);\r\n const granYSin = granularityY * sinRotation;\r\n const granXSin = granularityX * sinRotation;\r\n\r\n nwCartesian = proj.project(nwCorner, nwCartesian);\r\n\r\n nwCartesian = Cartesian3.subtract(nwCartesian, centerCartesian, nwCartesian);\r\n const rotationMatrix = Matrix2.fromRotation(rotation, rotationMatrixScratch);\r\n nwCartesian = Matrix2.multiplyByVector(\r\n rotationMatrix,\r\n nwCartesian,\r\n nwCartesian\r\n );\r\n nwCartesian = Cartesian3.add(nwCartesian, centerCartesian, nwCartesian);\r\n nwCorner = proj.unproject(nwCartesian, nwCorner);\r\n\r\n width -= 1;\r\n height -= 1;\r\n\r\n const latitude = nwCorner.latitude;\r\n const latitude0 = latitude + width * granXSin;\r\n const latitude1 = latitude - granYCos * height;\r\n const latitude2 = latitude - granYCos * height + width * granXSin;\r\n\r\n const north = Math.max(latitude, latitude0, latitude1, latitude2);\r\n const south = Math.min(latitude, latitude0, latitude1, latitude2);\r\n\r\n const longitude = nwCorner.longitude;\r\n const longitude0 = longitude + width * granXCos;\r\n const longitude1 = longitude + height * granYSin;\r\n const longitude2 = longitude + height * granYSin + width * granXCos;\r\n\r\n const east = Math.max(longitude, longitude0, longitude1, longitude2);\r\n const west = Math.min(longitude, longitude0, longitude1, longitude2);\r\n\r\n return {\r\n north: north,\r\n south: south,\r\n east: east,\r\n west: west,\r\n granYCos: granYCos,\r\n granYSin: granYSin,\r\n granXCos: granXCos,\r\n granXSin: granXSin,\r\n nwCorner: nwCorner,\r\n };\r\n}\r\n\r\n/**\r\n * @private\r\n */\r\nRectangleGeometryLibrary.computeOptions = function (\r\n rectangle,\r\n granularity,\r\n rotation,\r\n stRotation,\r\n boundingRectangleScratch,\r\n nwCornerResult,\r\n stNwCornerResult\r\n) {\r\n let east = rectangle.east;\r\n let west = rectangle.west;\r\n let north = rectangle.north;\r\n let south = rectangle.south;\r\n\r\n let northCap = false;\r\n let southCap = false;\r\n\r\n if (north === CesiumMath.PI_OVER_TWO) {\r\n northCap = true;\r\n }\r\n if (south === -CesiumMath.PI_OVER_TWO) {\r\n southCap = true;\r\n }\r\n\r\n let dx;\r\n const dy = north - south;\r\n if (west > east) {\r\n dx = CesiumMath.TWO_PI - west + east;\r\n } else {\r\n dx = east - west;\r\n }\r\n\r\n const width = Math.ceil(dx / granularity) + 1;\r\n const height = Math.ceil(dy / granularity) + 1;\r\n const granularityX = dx / (width - 1);\r\n const granularityY = dy / (height - 1);\r\n\r\n const nwCorner = Rectangle.northwest(rectangle, nwCornerResult);\r\n const center = Rectangle.center(rectangle, centerScratch);\r\n if (rotation !== 0 || stRotation !== 0) {\r\n if (center.longitude < nwCorner.longitude) {\r\n center.longitude += CesiumMath.TWO_PI;\r\n }\r\n centerCartesian = proj.project(center, centerCartesian);\r\n }\r\n\r\n const granYCos = granularityY;\r\n const granXCos = granularityX;\r\n const granYSin = 0.0;\r\n const granXSin = 0.0;\r\n\r\n const boundingRectangle = Rectangle.clone(\r\n rectangle,\r\n boundingRectangleScratch\r\n );\r\n\r\n const computedOptions = {\r\n granYCos: granYCos,\r\n granYSin: granYSin,\r\n granXCos: granXCos,\r\n granXSin: granXSin,\r\n nwCorner: nwCorner,\r\n boundingRectangle: boundingRectangle,\r\n width: width,\r\n height: height,\r\n northCap: northCap,\r\n southCap: southCap,\r\n };\r\n\r\n if (rotation !== 0) {\r\n const rotationOptions = getRotationOptions(\r\n nwCorner,\r\n rotation,\r\n granularityX,\r\n granularityY,\r\n center,\r\n width,\r\n height\r\n );\r\n north = rotationOptions.north;\r\n south = rotationOptions.south;\r\n east = rotationOptions.east;\r\n west = rotationOptions.west;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n north < -CesiumMath.PI_OVER_TWO ||\r\n north > CesiumMath.PI_OVER_TWO ||\r\n south < -CesiumMath.PI_OVER_TWO ||\r\n south > CesiumMath.PI_OVER_TWO\r\n ) {\r\n throw new DeveloperError(\r\n \"Rotated rectangle is invalid. It crosses over either the north or south pole.\"\r\n );\r\n }\r\n //>>includeEnd('debug')\r\n\r\n computedOptions.granYCos = rotationOptions.granYCos;\r\n computedOptions.granYSin = rotationOptions.granYSin;\r\n computedOptions.granXCos = rotationOptions.granXCos;\r\n computedOptions.granXSin = rotationOptions.granXSin;\r\n\r\n boundingRectangle.north = north;\r\n boundingRectangle.south = south;\r\n boundingRectangle.east = east;\r\n boundingRectangle.west = west;\r\n }\r\n\r\n if (stRotation !== 0) {\r\n rotation = rotation - stRotation;\r\n const stNwCorner = Rectangle.northwest(boundingRectangle, stNwCornerResult);\r\n\r\n const stRotationOptions = getRotationOptions(\r\n stNwCorner,\r\n rotation,\r\n granularityX,\r\n granularityY,\r\n center,\r\n width,\r\n height\r\n );\r\n\r\n computedOptions.stGranYCos = stRotationOptions.granYCos;\r\n computedOptions.stGranXCos = stRotationOptions.granXCos;\r\n computedOptions.stGranYSin = stRotationOptions.granYSin;\r\n computedOptions.stGranXSin = stRotationOptions.granXSin;\r\n computedOptions.stNwCorner = stNwCorner;\r\n computedOptions.stWest = stRotationOptions.west;\r\n computedOptions.stSouth = stRotationOptions.south;\r\n }\r\n\r\n return computedOptions;\r\n};\r\nexport default RectangleGeometryLibrary;\r\n"],"names":["defined","Matrix2","Cartesian3","Cartographic","GeographicProjection","CesiumMath","Rectangle","DeveloperError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EASA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;EACrB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;EACrB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AACvB;EACA;EACA;EACA;EACA,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACpC;EACA;EACA;EACA;EACA,wBAAwB,CAAC,eAAe,GAAG;EAC3C,EAAE,eAAe;EACjB,EAAE,SAAS;EACX,EAAE,SAAS;EACX,EAAE,GAAG;EACL,EAAE,GAAG;EACL,EAAE,QAAQ;EACV,EAAE,EAAE;EACJ,EAAE;EACF,EAAE,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;EAC9C,EAAE,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC;EAC5C,EAAE,MAAM,SAAS,GAAG,eAAe,CAAC,iBAAiB,CAAC;AACtD;EACA,EAAE,IAAI,UAAU;EAChB,IAAI,QAAQ,CAAC,QAAQ;EACrB,IAAI,eAAe,CAAC,QAAQ,GAAG,GAAG;EAClC,IAAI,GAAG,GAAG,eAAe,CAAC,QAAQ,CAAC;EACnC,EAAE,MAAM,WAAW,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;EACtC,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;EAC7B,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC;AACjC;EACA,EAAE,IAAI,WAAW;EACjB,IAAI,QAAQ,CAAC,SAAS;EACtB,IAAI,GAAG,GAAG,eAAe,CAAC,QAAQ;EAClC,IAAI,GAAG,GAAG,eAAe,CAAC,QAAQ,CAAC;EACnC,EAAE,MAAM,EAAE,GAAG,W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AC,UAAU,GAAG,UAAU,CAAC;EAC5C,IAAI,eAAe,CAAC,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC;EACpD,IAAI,eAAe,CAAC,OAAO,GAAG,iBAAiB,CAAC,KAAK,CAAC;EACtD,GAAG;AACH;EACA,EAAE,OAAO,eAAe,CAAC;EACzB,CAAC,CAAC;AACF,mCAAe,wBAAwB;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/RuntimeError-e5c6a8b9.js b/examples/cesium/Workers/RuntimeError-e5c6a8b9.js
new file mode 100644
index 0000000..26679bb
--- /dev/null
+++ b/examples/cesium/Workers/RuntimeError-e5c6a8b9.js
@@ -0,0 +1,94 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './defaultValue-0ab18f7d'], (function (exports, defaultValue) { 'use strict';
+
+ /**
+ * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,
+ * out of memory, could not compile shader, etc. If a function may throw this
+ * exception, the calling code should be prepared to catch it.
+ *
+ * On the other hand, a {@link DeveloperError} indicates an exception due
+ * to a developer error, e.g., invalid argument, that usually indicates a bug in the
+ * calling code.
+ *
+ * @alias RuntimeError
+ * @constructor
+ * @extends Error
+ *
+ * @param {String} [message] The error message for this exception.
+ *
+ * @see DeveloperError
+ */
+ function RuntimeError(message) {
+ /**
+ * 'RuntimeError' indicating that this exception was thrown due to a runtime error.
+ * @type {String}
+ * @readonly
+ */
+ this.name = "RuntimeError";
+
+ /**
+ * The explanation for why this exception was thrown.
+ * @type {String}
+ * @readonly
+ */
+ this.message = message;
+
+ //Browsers such as IE don't have a stack property until you actually throw the error.
+ let stack;
+ try {
+ throw new Error();
+ } catch (e) {
+ stack = e.stack;
+ }
+
+ /**
+ * The stack trace of this exception, if available.
+ * @type {String}
+ * @readonly
+ */
+ this.stack = stack;
+ }
+
+ if (defaultValue.defined(Object.create)) {
+ RuntimeError.prototype = Object.create(Error.prototype);
+ RuntimeError.prototype.constructor = RuntimeError;
+ }
+
+ RuntimeError.prototype.toString = function () {
+ let str = `${this.name}: ${this.message}`;
+
+ if (defaultValue.defined(this.stack)) {
+ str += `\n${this.stack.toString()}`;
+ }
+
+ return str;
+ };
+
+ exports.RuntimeError = RuntimeError;
+
+}));
+//# sourceMappingURL=RuntimeError-e5c6a8b9.js.map
diff --git a/examples/cesium/Workers/RuntimeError-e5c6a8b9.js.map b/examples/cesium/Workers/RuntimeError-e5c6a8b9.js.map
new file mode 100644
index 0000000..a061f06
--- /dev/null
+++ b/examples/cesium/Workers/RuntimeError-e5c6a8b9.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"RuntimeError-e5c6a8b9.js","sources":["../../../Source/Core/RuntimeError.js"],"sourcesContent":["import defined from \"./defined.js\";\r\n\r\n/**\r\n * Constructs an exception object that is thrown due to an error that can occur at runtime, e.g.,\r\n * out of memory, could not compile shader, etc. If a function may throw this\r\n * exception, the calling code should be prepared to catch it.\r\n *
\r\n * On the other hand, a {@link DeveloperError} indicates an exception due\r\n * to a developer error, e.g., invalid argument, that usually indicates a bug in the\r\n * calling code.\r\n *\r\n * @alias RuntimeError\r\n * @constructor\r\n * @extends Error\r\n *\r\n * @param {String} [message] The error message for this exception.\r\n *\r\n * @see DeveloperError\r\n */\r\nfunction RuntimeError(message) {\r\n /**\r\n * 'RuntimeError' indicating that this exception was thrown due to a runtime error.\r\n * @type {String}\r\n * @readonly\r\n */\r\n this.name = \"RuntimeError\";\r\n\r\n /**\r\n * The explanation for why this exception was thrown.\r\n * @type {String}\r\n * @readonly\r\n */\r\n this.message = message;\r\n\r\n //Browsers such as IE don't have a stack property until you actually throw the error.\r\n let stack;\r\n try {\r\n throw new Error();\r\n } catch (e) {\r\n stack = e.stack;\r\n }\r\n\r\n /**\r\n * The stack trace of this exception, if available.\r\n * @type {String}\r\n * @readonly\r\n */\r\n this.stack = stack;\r\n}\r\n\r\nif (defined(Object.create)) {\r\n RuntimeError.prototype = Object.create(Error.prototype);\r\n RuntimeError.prototype.constructor = RuntimeError;\r\n}\r\n\r\nRuntimeError.prototype.toString = function () {\r\n let str = `${this.name}: ${this.message}`;\r\n\r\n if (defined(this.stack)) {\r\n str += `\\n${this.stack.toString()}`;\r\n }\r\n\r\n return str;\r\n};\r\nexport default RuntimeError;\r\n"],"names":["defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,YAAY,CAAC,OAAO,EAAE;EAC/B;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;AAC7B;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACzB;EACA;EACA,EAAE,IAAI,KAAK,CAAC;EACZ,EAAE,IAAI;EACN,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;EACtB,GAAG,CAAC,OAAO,CAAC,EAAE;EACd,IAAI,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;EACpB,GAAG;AACH;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;EACrB,CAAC;AACD;EACA,IAAIA,oBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;EAC5B,EAAE,YAAY,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;EAC1D,EAAE,YAAY,CAAC,SAAS,CAAC,WAAW,GAAG,YAAY,CAAC;EACpD,CAAC;AACD;EACA,YAAY,CAAC,SAAS,CAAC,QAAQ,GAAG,YAAY;EAC9C,EAAE,IAAI,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5C;EACA,EAAE,IAAIA,oBAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;EAC3B,IAAI,GAAG,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;EACxC,GAAG;AACH;EACA,EAAE,OAAO,GAAG,CAAC;EACb,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/TerrainEncoding-c7d764e4.js b/examples/cesium/Workers/TerrainEncoding-c7d764e4.js
new file mode 100644
index 0000000..51bfae5
--- /dev/null
+++ b/examples/cesium/Workers/TerrainEncoding-c7d764e4.js
@@ -0,0 +1,1253 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Matrix2-036c77dd', './AttributeCompression-e9888cb8', './ComponentDatatype-13a5630b', './Math-9be8b918'], (function (exports, Transforms, Matrix3, Check, defaultValue, Matrix2, AttributeCompression, ComponentDatatype, Math$1) { 'use strict';
+
+ /**
+ * Determine whether or not other objects are visible or hidden behind the visible horizon defined by
+ * an {@link Ellipsoid} and a camera position. The ellipsoid is assumed to be located at the
+ * origin of the coordinate system. This class uses the algorithm described in the
+ * {@link https://cesium.com/blog/2013/04/25/Horizon-culling/|Horizon Culling} blog post.
+ *
+ * @alias EllipsoidalOccluder
+ *
+ * @param {Ellipsoid} ellipsoid The ellipsoid to use as an occluder.
+ * @param {Cartesian3} [cameraPosition] The coordinate of the viewer/camera. If this parameter is not
+ * specified, {@link EllipsoidalOccluder#cameraPosition} must be called before
+ * testing visibility.
+ *
+ * @constructor
+ *
+ * @example
+ * // Construct an ellipsoidal occluder with radii 1.0, 1.1, and 0.9.
+ * const cameraPosition = new Cesium.Cartesian3(5.0, 6.0, 7.0);
+ * const occluderEllipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);
+ * const occluder = new Cesium.EllipsoidalOccluder(occluderEllipsoid, cameraPosition);
+ *
+ * @private
+ */
+ function EllipsoidalOccluder(ellipsoid, cameraPosition) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("ellipsoid", ellipsoid);
+ //>>includeEnd('debug');
+
+ this._ellipsoid = ellipsoid;
+ this._cameraPosition = new Matrix3.Cartesian3();
+ this._cameraPositionInScaledSpace = new Matrix3.Cartesian3();
+ this._distanceToLimbInScaledSpaceSquared = 0.0;
+
+ // cameraPosition fills in the above values
+ if (defaultValue.defined(cameraPosition)) {
+ this.cameraPosition = cameraPosition;
+ }
+ }
+
+ Object.defineProperties(EllipsoidalOccluder.prototype, {
+ /**
+ * Gets the occluding ellipsoid.
+ * @memberof EllipsoidalOccluder.prototype
+ * @type {Ellipsoid}
+ */
+ ellipsoid: {
+ get: function () {
+ return this._ellipsoid;
+ },
+ },
+ /**
+ * Gets or sets the position of the camera.
+ * @memberof EllipsoidalOccluder.prototype
+ * @type {Cartesian3}
+ */
+ cameraPosition: {
+ get: function () {
+ return this._cameraPosition;
+ },
+ set: function (cameraPosition) {
+ // See https://cesium.com/blog/2013/04/25/Horizon-culling/
+ const ellipsoid = this._ellipsoid;
+ const cv = ellipsoid.transformPositionToScaledSpace(
+ cameraPosition,
+ this._cameraPositionInScaledSpace
+ );
+ const vhMagnitudeSquared = Matrix3.Cartesian3.magnitudeSquared(cv) - 1.0;
+
+ Matrix3.Cartesian3.clone(cameraPosition, this._cameraPosition);
+ this._cameraPositionInScaledSpace = cv;
+ this._distanceToLimbInScaledSpaceSquared = vhMagnitudeSquared;
+ },
+ },
+ });
+
+ const scratchCartesian = new Matrix3.Cartesian3();
+
+ /**
+ * Determines whether or not a point, the occludee
, is hidden from view by the occluder.
+ *
+ * @param {Cartesian3} occludee The point to test for visibility.
+ * @returns {Boolean} true
if the occludee is visible; otherwise false
.
+ *
+ * @example
+ * const cameraPosition = new Cesium.Cartesian3(0, 0, 2.5);
+ * const ellipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);
+ * const occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);
+ * const point = new Cesium.Cartesian3(0, -3, -3);
+ * occluder.isPointVisible(point); //returns true
+ */
+ EllipsoidalOccluder.prototype.isPointVisible = function (occludee) {
+ const ellipsoid = this._ellipsoid;
+ const occludeeScaledSpacePosition = ellipsoid.transformPositionToScaledSpace(
+ occludee,
+ scratchCartesian
+ );
+ return isScaledSpacePointVisible(
+ occludeeScaledSpacePosition,
+ this._cameraPositionInScaledSpace,
+ this._distanceToLimbInScaledSpaceSquared
+ );
+ };
+
+ /**
+ * Determines whether or not a point expressed in the ellipsoid scaled space, is hidden from view by the
+ * occluder. To transform a Cartesian X, Y, Z position in the coordinate system aligned with the ellipsoid
+ * into the scaled space, call {@link Ellipsoid#transformPositionToScaledSpace}.
+ *
+ * @param {Cartesian3} occludeeScaledSpacePosition The point to test for visibility, represented in the scaled space.
+ * @returns {Boolean} true
if the occludee is visible; otherwise false
.
+ *
+ * @example
+ * const cameraPosition = new Cesium.Cartesian3(0, 0, 2.5);
+ * const ellipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);
+ * const occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);
+ * const point = new Cesium.Cartesian3(0, -3, -3);
+ * const scaledSpacePoint = ellipsoid.transformPositionToScaledSpace(point);
+ * occluder.isScaledSpacePointVisible(scaledSpacePoint); //returns true
+ */
+ EllipsoidalOccluder.prototype.isScaledSpacePointVisible = function (
+ occludeeScaledSpacePosition
+ ) {
+ return isScaledSpacePointVisible(
+ occludeeScaledSpacePosition,
+ this._cameraPositionInScaledSpace,
+ this._distanceToLimbInScaledSpaceSquared
+ );
+ };
+
+ const scratchCameraPositionInScaledSpaceShrunk = new Matrix3.Cartesian3();
+
+ /**
+ * Similar to {@link EllipsoidalOccluder#isScaledSpacePointVisible} except tests against an
+ * ellipsoid that has been shrunk by the minimum height when the minimum height is below
+ * the ellipsoid. This is intended to be used with points generated by
+ * {@link EllipsoidalOccluder#computeHorizonCullingPointPossiblyUnderEllipsoid} or
+ * {@link EllipsoidalOccluder#computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid}.
+ *
+ * @param {Cartesian3} occludeeScaledSpacePosition The point to test for visibility, represented in the scaled space of the possibly-shrunk ellipsoid.
+ * @returns {Boolean} true
if the occludee is visible; otherwise false
.
+ */
+ EllipsoidalOccluder.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid = function (
+ occludeeScaledSpacePosition,
+ minimumHeight
+ ) {
+ const ellipsoid = this._ellipsoid;
+ let vhMagnitudeSquared;
+ let cv;
+
+ if (
+ defaultValue.defined(minimumHeight) &&
+ minimumHeight < 0.0 &&
+ ellipsoid.minimumRadius > -minimumHeight
+ ) {
+ // This code is similar to the cameraPosition setter, but unrolled for performance because it will be called a lot.
+ cv = scratchCameraPositionInScaledSpaceShrunk;
+ cv.x = this._cameraPosition.x / (ellipsoid.radii.x + minimumHeight);
+ cv.y = this._cameraPosition.y / (ellipsoid.radii.y + minimumHeight);
+ cv.z = this._cameraPosition.z / (ellipsoid.radii.z + minimumHeight);
+ vhMagnitudeSquared = cv.x * cv.x + cv.y * cv.y + cv.z * cv.z - 1.0;
+ } else {
+ cv = this._cameraPositionInScaledSpace;
+ vhMagnitudeSquared = this._distanceToLimbInScaledSpaceSquared;
+ }
+
+ return isScaledSpacePointVisible(
+ occludeeScaledSpacePosition,
+ cv,
+ vhMagnitudeSquared
+ );
+ };
+
+ /**
+ * Computes a point that can be used for horizon culling from a list of positions. If the point is below
+ * the horizon, all of the positions are guaranteed to be below the horizon as well. The returned point
+ * is expressed in the ellipsoid-scaled space and is suitable for use with
+ * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.
+ *
+ * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.
+ * A reasonable direction to use is the direction from the center of the ellipsoid to
+ * the center of the bounding sphere computed from the positions. The direction need not
+ * be normalized.
+ * @param {Cartesian3[]} positions The positions from which to compute the horizon culling point. The positions
+ * must be expressed in a reference frame centered at the ellipsoid and aligned with the
+ * ellipsoid's axes.
+ * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.
+ * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.
+ */
+ EllipsoidalOccluder.prototype.computeHorizonCullingPoint = function (
+ directionToPoint,
+ positions,
+ result
+ ) {
+ return computeHorizonCullingPointFromPositions(
+ this._ellipsoid,
+ directionToPoint,
+ positions,
+ result
+ );
+ };
+
+ const scratchEllipsoidShrunk = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+
+ /**
+ * Similar to {@link EllipsoidalOccluder#computeHorizonCullingPoint} except computes the culling
+ * point relative to an ellipsoid that has been shrunk by the minimum height when the minimum height is below
+ * the ellipsoid. The returned point is expressed in the possibly-shrunk ellipsoid-scaled space and is suitable
+ * for use with {@link EllipsoidalOccluder#isScaledSpacePointVisiblePossiblyUnderEllipsoid}.
+ *
+ * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.
+ * A reasonable direction to use is the direction from the center of the ellipsoid to
+ * the center of the bounding sphere computed from the positions. The direction need not
+ * be normalized.
+ * @param {Cartesian3[]} positions The positions from which to compute the horizon culling point. The positions
+ * must be expressed in a reference frame centered at the ellipsoid and aligned with the
+ * ellipsoid's axes.
+ * @param {Number} [minimumHeight] The minimum height of all positions. If this value is undefined, all positions are assumed to be above the ellipsoid.
+ * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.
+ * @returns {Cartesian3} The computed horizon culling point, expressed in the possibly-shrunk ellipsoid-scaled space.
+ */
+ EllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid = function (
+ directionToPoint,
+ positions,
+ minimumHeight,
+ result
+ ) {
+ const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid(
+ this._ellipsoid,
+ minimumHeight,
+ scratchEllipsoidShrunk
+ );
+ return computeHorizonCullingPointFromPositions(
+ possiblyShrunkEllipsoid,
+ directionToPoint,
+ positions,
+ result
+ );
+ };
+ /**
+ * Computes a point that can be used for horizon culling from a list of positions. If the point is below
+ * the horizon, all of the positions are guaranteed to be below the horizon as well. The returned point
+ * is expressed in the ellipsoid-scaled space and is suitable for use with
+ * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.
+ *
+ * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.
+ * A reasonable direction to use is the direction from the center of the ellipsoid to
+ * the center of the bounding sphere computed from the positions. The direction need not
+ * be normalized.
+ * @param {Number[]} vertices The vertices from which to compute the horizon culling point. The positions
+ * must be expressed in a reference frame centered at the ellipsoid and aligned with the
+ * ellipsoid's axes.
+ * @param {Number} [stride=3]
+ * @param {Cartesian3} [center=Cartesian3.ZERO]
+ * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.
+ * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.
+ */
+ EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices = function (
+ directionToPoint,
+ vertices,
+ stride,
+ center,
+ result
+ ) {
+ return computeHorizonCullingPointFromVertices(
+ this._ellipsoid,
+ directionToPoint,
+ vertices,
+ stride,
+ center,
+ result
+ );
+ };
+
+ /**
+ * Similar to {@link EllipsoidalOccluder#computeHorizonCullingPointFromVertices} except computes the culling
+ * point relative to an ellipsoid that has been shrunk by the minimum height when the minimum height is below
+ * the ellipsoid. The returned point is expressed in the possibly-shrunk ellipsoid-scaled space and is suitable
+ * for use with {@link EllipsoidalOccluder#isScaledSpacePointVisiblePossiblyUnderEllipsoid}.
+ *
+ * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.
+ * A reasonable direction to use is the direction from the center of the ellipsoid to
+ * the center of the bounding sphere computed from the positions. The direction need not
+ * be normalized.
+ * @param {Number[]} vertices The vertices from which to compute the horizon culling point. The positions
+ * must be expressed in a reference frame centered at the ellipsoid and aligned with the
+ * ellipsoid's axes.
+ * @param {Number} [stride=3]
+ * @param {Cartesian3} [center=Cartesian3.ZERO]
+ * @param {Number} [minimumHeight] The minimum height of all vertices. If this value is undefined, all vertices are assumed to be above the ellipsoid.
+ * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.
+ * @returns {Cartesian3} The computed horizon culling point, expressed in the possibly-shrunk ellipsoid-scaled space.
+ */
+ EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid = function (
+ directionToPoint,
+ vertices,
+ stride,
+ center,
+ minimumHeight,
+ result
+ ) {
+ const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid(
+ this._ellipsoid,
+ minimumHeight,
+ scratchEllipsoidShrunk
+ );
+ return computeHorizonCullingPointFromVertices(
+ possiblyShrunkEllipsoid,
+ directionToPoint,
+ vertices,
+ stride,
+ center,
+ result
+ );
+ };
+
+ const subsampleScratch = [];
+
+ /**
+ * Computes a point that can be used for horizon culling of a rectangle. If the point is below
+ * the horizon, the ellipsoid-conforming rectangle is guaranteed to be below the horizon as well.
+ * The returned point is expressed in the ellipsoid-scaled space and is suitable for use with
+ * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.
+ *
+ * @param {Rectangle} rectangle The rectangle for which to compute the horizon culling point.
+ * @param {Ellipsoid} ellipsoid The ellipsoid on which the rectangle is defined. This may be different from
+ * the ellipsoid used by this instance for occlusion testing.
+ * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.
+ * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.
+ */
+ EllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle = function (
+ rectangle,
+ ellipsoid,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ //>>includeEnd('debug');
+
+ const positions = Matrix2.Rectangle.subsample(
+ rectangle,
+ ellipsoid,
+ 0.0,
+ subsampleScratch
+ );
+ const bs = Transforms.BoundingSphere.fromPoints(positions);
+
+ // If the bounding sphere center is too close to the center of the occluder, it doesn't make
+ // sense to try to horizon cull it.
+ if (Matrix3.Cartesian3.magnitude(bs.center) < 0.1 * ellipsoid.minimumRadius) {
+ return undefined;
+ }
+
+ return this.computeHorizonCullingPoint(bs.center, positions, result);
+ };
+
+ const scratchEllipsoidShrunkRadii = new Matrix3.Cartesian3();
+
+ function getPossiblyShrunkEllipsoid(ellipsoid, minimumHeight, result) {
+ if (
+ defaultValue.defined(minimumHeight) &&
+ minimumHeight < 0.0 &&
+ ellipsoid.minimumRadius > -minimumHeight
+ ) {
+ const ellipsoidShrunkRadii = Matrix3.Cartesian3.fromElements(
+ ellipsoid.radii.x + minimumHeight,
+ ellipsoid.radii.y + minimumHeight,
+ ellipsoid.radii.z + minimumHeight,
+ scratchEllipsoidShrunkRadii
+ );
+ ellipsoid = Matrix3.Ellipsoid.fromCartesian3(ellipsoidShrunkRadii, result);
+ }
+ return ellipsoid;
+ }
+
+ function computeHorizonCullingPointFromPositions(
+ ellipsoid,
+ directionToPoint,
+ positions,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("directionToPoint", directionToPoint);
+ Check.Check.defined("positions", positions);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(
+ ellipsoid,
+ directionToPoint
+ );
+ let resultMagnitude = 0.0;
+
+ for (let i = 0, len = positions.length; i < len; ++i) {
+ const position = positions[i];
+ const candidateMagnitude = computeMagnitude(
+ ellipsoid,
+ position,
+ scaledSpaceDirectionToPoint
+ );
+ if (candidateMagnitude < 0.0) {
+ // all points should face the same direction, but this one doesn't, so return undefined
+ return undefined;
+ }
+ resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);
+ }
+
+ return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);
+ }
+
+ const positionScratch = new Matrix3.Cartesian3();
+
+ function computeHorizonCullingPointFromVertices(
+ ellipsoid,
+ directionToPoint,
+ vertices,
+ stride,
+ center,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("directionToPoint", directionToPoint);
+ Check.Check.defined("vertices", vertices);
+ Check.Check.typeOf.number("stride", stride);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ stride = defaultValue.defaultValue(stride, 3);
+ center = defaultValue.defaultValue(center, Matrix3.Cartesian3.ZERO);
+ const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(
+ ellipsoid,
+ directionToPoint
+ );
+ let resultMagnitude = 0.0;
+
+ for (let i = 0, len = vertices.length; i < len; i += stride) {
+ positionScratch.x = vertices[i] + center.x;
+ positionScratch.y = vertices[i + 1] + center.y;
+ positionScratch.z = vertices[i + 2] + center.z;
+
+ const candidateMagnitude = computeMagnitude(
+ ellipsoid,
+ positionScratch,
+ scaledSpaceDirectionToPoint
+ );
+ if (candidateMagnitude < 0.0) {
+ // all points should face the same direction, but this one doesn't, so return undefined
+ return undefined;
+ }
+ resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);
+ }
+
+ return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);
+ }
+
+ function isScaledSpacePointVisible(
+ occludeeScaledSpacePosition,
+ cameraPositionInScaledSpace,
+ distanceToLimbInScaledSpaceSquared
+ ) {
+ // See https://cesium.com/blog/2013/04/25/Horizon-culling/
+ const cv = cameraPositionInScaledSpace;
+ const vhMagnitudeSquared = distanceToLimbInScaledSpaceSquared;
+ const vt = Matrix3.Cartesian3.subtract(
+ occludeeScaledSpacePosition,
+ cv,
+ scratchCartesian
+ );
+ const vtDotVc = -Matrix3.Cartesian3.dot(vt, cv);
+ // If vhMagnitudeSquared < 0 then we are below the surface of the ellipsoid and
+ // in this case, set the culling plane to be on V.
+ const isOccluded =
+ vhMagnitudeSquared < 0
+ ? vtDotVc > 0
+ : vtDotVc > vhMagnitudeSquared &&
+ (vtDotVc * vtDotVc) / Matrix3.Cartesian3.magnitudeSquared(vt) >
+ vhMagnitudeSquared;
+ return !isOccluded;
+ }
+
+ const scaledSpaceScratch = new Matrix3.Cartesian3();
+ const directionScratch = new Matrix3.Cartesian3();
+
+ function computeMagnitude(ellipsoid, position, scaledSpaceDirectionToPoint) {
+ const scaledSpacePosition = ellipsoid.transformPositionToScaledSpace(
+ position,
+ scaledSpaceScratch
+ );
+ let magnitudeSquared = Matrix3.Cartesian3.magnitudeSquared(scaledSpacePosition);
+ let magnitude = Math.sqrt(magnitudeSquared);
+ const direction = Matrix3.Cartesian3.divideByScalar(
+ scaledSpacePosition,
+ magnitude,
+ directionScratch
+ );
+
+ // For the purpose of this computation, points below the ellipsoid are consider to be on it instead.
+ magnitudeSquared = Math.max(1.0, magnitudeSquared);
+ magnitude = Math.max(1.0, magnitude);
+
+ const cosAlpha = Matrix3.Cartesian3.dot(direction, scaledSpaceDirectionToPoint);
+ const sinAlpha = Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.cross(direction, scaledSpaceDirectionToPoint, direction)
+ );
+ const cosBeta = 1.0 / magnitude;
+ const sinBeta = Math.sqrt(magnitudeSquared - 1.0) * cosBeta;
+
+ return 1.0 / (cosAlpha * cosBeta - sinAlpha * sinBeta);
+ }
+
+ function magnitudeToPoint(
+ scaledSpaceDirectionToPoint,
+ resultMagnitude,
+ result
+ ) {
+ // The horizon culling point is undefined if there were no positions from which to compute it,
+ // the directionToPoint is pointing opposite all of the positions, or if we computed NaN or infinity.
+ if (
+ resultMagnitude <= 0.0 ||
+ resultMagnitude === 1.0 / 0.0 ||
+ resultMagnitude !== resultMagnitude
+ ) {
+ return undefined;
+ }
+
+ return Matrix3.Cartesian3.multiplyByScalar(
+ scaledSpaceDirectionToPoint,
+ resultMagnitude,
+ result
+ );
+ }
+
+ const directionToPointScratch = new Matrix3.Cartesian3();
+
+ function computeScaledSpaceDirectionToPoint(ellipsoid, directionToPoint) {
+ if (Matrix3.Cartesian3.equals(directionToPoint, Matrix3.Cartesian3.ZERO)) {
+ return directionToPoint;
+ }
+
+ ellipsoid.transformPositionToScaledSpace(
+ directionToPoint,
+ directionToPointScratch
+ );
+ return Matrix3.Cartesian3.normalize(directionToPointScratch, directionToPointScratch);
+ }
+
+ /**
+ * @private
+ */
+ const TerrainExaggeration = {};
+
+ /**
+ * Scales a height relative to an offset.
+ *
+ * @param {Number} height The height.
+ * @param {Number} scale A scalar used to exaggerate the terrain. If the value is 1.0 there will be no effect.
+ * @param {Number} relativeHeight The height relative to which terrain is exaggerated. If the value is 0.0 terrain will be exaggerated relative to the ellipsoid surface.
+ */
+ TerrainExaggeration.getHeight = function (height, scale, relativeHeight) {
+ return (height - relativeHeight) * scale + relativeHeight;
+ };
+
+ const scratchCartographic = new Matrix3.Cartesian3();
+
+ /**
+ * Scales a position by exaggeration.
+ */
+ TerrainExaggeration.getPosition = function (
+ position,
+ ellipsoid,
+ terrainExaggeration,
+ terrainExaggerationRelativeHeight,
+ result
+ ) {
+ const cartographic = ellipsoid.cartesianToCartographic(
+ position,
+ scratchCartographic
+ );
+ const newHeight = TerrainExaggeration.getHeight(
+ cartographic.height,
+ terrainExaggeration,
+ terrainExaggerationRelativeHeight
+ );
+ return Matrix3.Cartesian3.fromRadians(
+ cartographic.longitude,
+ cartographic.latitude,
+ newHeight,
+ ellipsoid,
+ result
+ );
+ };
+
+ var TerrainExaggeration$1 = TerrainExaggeration;
+
+ /**
+ * This enumerated type is used to determine how the vertices of the terrain mesh are compressed.
+ *
+ * @enum {Number}
+ *
+ * @private
+ */
+ const TerrainQuantization = {
+ /**
+ * The vertices are not compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ NONE: 0,
+
+ /**
+ * The vertices are compressed to 12 bits.
+ *
+ * @type {Number}
+ * @constant
+ */
+ BITS12: 1,
+ };
+ var TerrainQuantization$1 = Object.freeze(TerrainQuantization);
+
+ const cartesian3Scratch = new Matrix3.Cartesian3();
+ const cartesian3DimScratch = new Matrix3.Cartesian3();
+ const cartesian2Scratch = new Matrix2.Cartesian2();
+ const matrix4Scratch = new Matrix2.Matrix4();
+ const matrix4Scratch2 = new Matrix2.Matrix4();
+
+ const SHIFT_LEFT_12 = Math.pow(2.0, 12.0);
+
+ /**
+ * Data used to quantize and pack the terrain mesh. The position can be unpacked for picking and all attributes
+ * are unpacked in the vertex shader.
+ *
+ * @alias TerrainEncoding
+ * @constructor
+ *
+ * @param {Cartesian3} center The center point of the vertices.
+ * @param {AxisAlignedBoundingBox} axisAlignedBoundingBox The bounds of the tile in the east-north-up coordinates at the tiles center.
+ * @param {Number} minimumHeight The minimum height.
+ * @param {Number} maximumHeight The maximum height.
+ * @param {Matrix4} fromENU The east-north-up to fixed frame matrix at the center of the terrain mesh.
+ * @param {Boolean} hasVertexNormals If the mesh has vertex normals.
+ * @param {Boolean} [hasWebMercatorT=false] true if the terrain data includes a Web Mercator texture coordinate; otherwise, false.
+ * @param {Boolean} [hasGeodeticSurfaceNormals=false] true if the terrain data includes geodetic surface normals; otherwise, false.
+ * @param {Number} [exaggeration=1.0] A scalar used to exaggerate terrain.
+ * @param {Number} [exaggerationRelativeHeight=0.0] The relative height from which terrain is exaggerated.
+ *
+ * @private
+ */
+ function TerrainEncoding(
+ center,
+ axisAlignedBoundingBox,
+ minimumHeight,
+ maximumHeight,
+ fromENU,
+ hasVertexNormals,
+ hasWebMercatorT,
+ hasGeodeticSurfaceNormals,
+ exaggeration,
+ exaggerationRelativeHeight
+ ) {
+ let quantization = TerrainQuantization$1.NONE;
+ let toENU;
+ let matrix;
+
+ if (
+ defaultValue.defined(axisAlignedBoundingBox) &&
+ defaultValue.defined(minimumHeight) &&
+ defaultValue.defined(maximumHeight) &&
+ defaultValue.defined(fromENU)
+ ) {
+ const minimum = axisAlignedBoundingBox.minimum;
+ const maximum = axisAlignedBoundingBox.maximum;
+
+ const dimensions = Matrix3.Cartesian3.subtract(
+ maximum,
+ minimum,
+ cartesian3DimScratch
+ );
+ const hDim = maximumHeight - minimumHeight;
+ const maxDim = Math.max(Matrix3.Cartesian3.maximumComponent(dimensions), hDim);
+
+ if (maxDim < SHIFT_LEFT_12 - 1.0) {
+ quantization = TerrainQuantization$1.BITS12;
+ } else {
+ quantization = TerrainQuantization$1.NONE;
+ }
+
+ toENU = Matrix2.Matrix4.inverseTransformation(fromENU, new Matrix2.Matrix4());
+
+ const translation = Matrix3.Cartesian3.negate(minimum, cartesian3Scratch);
+ Matrix2.Matrix4.multiply(
+ Matrix2.Matrix4.fromTranslation(translation, matrix4Scratch),
+ toENU,
+ toENU
+ );
+
+ const scale = cartesian3Scratch;
+ scale.x = 1.0 / dimensions.x;
+ scale.y = 1.0 / dimensions.y;
+ scale.z = 1.0 / dimensions.z;
+ Matrix2.Matrix4.multiply(Matrix2.Matrix4.fromScale(scale, matrix4Scratch), toENU, toENU);
+
+ matrix = Matrix2.Matrix4.clone(fromENU);
+ Matrix2.Matrix4.setTranslation(matrix, Matrix3.Cartesian3.ZERO, matrix);
+
+ fromENU = Matrix2.Matrix4.clone(fromENU, new Matrix2.Matrix4());
+
+ const translationMatrix = Matrix2.Matrix4.fromTranslation(minimum, matrix4Scratch);
+ const scaleMatrix = Matrix2.Matrix4.fromScale(dimensions, matrix4Scratch2);
+ const st = Matrix2.Matrix4.multiply(translationMatrix, scaleMatrix, matrix4Scratch);
+
+ Matrix2.Matrix4.multiply(fromENU, st, fromENU);
+ Matrix2.Matrix4.multiply(matrix, st, matrix);
+ }
+
+ /**
+ * How the vertices of the mesh were compressed.
+ * @type {TerrainQuantization}
+ */
+ this.quantization = quantization;
+
+ /**
+ * The minimum height of the tile including the skirts.
+ * @type {Number}
+ */
+ this.minimumHeight = minimumHeight;
+
+ /**
+ * The maximum height of the tile.
+ * @type {Number}
+ */
+ this.maximumHeight = maximumHeight;
+
+ /**
+ * The center of the tile.
+ * @type {Cartesian3}
+ */
+ this.center = Matrix3.Cartesian3.clone(center);
+
+ /**
+ * A matrix that takes a vertex from the tile, transforms it to east-north-up at the center and scales
+ * it so each component is in the [0, 1] range.
+ * @type {Matrix4}
+ */
+ this.toScaledENU = toENU;
+
+ /**
+ * A matrix that restores a vertex transformed with toScaledENU back to the earth fixed reference frame
+ * @type {Matrix4}
+ */
+ this.fromScaledENU = fromENU;
+
+ /**
+ * The matrix used to decompress the terrain vertices in the shader for RTE rendering.
+ * @type {Matrix4}
+ */
+ this.matrix = matrix;
+
+ /**
+ * The terrain mesh contains normals.
+ * @type {Boolean}
+ */
+ this.hasVertexNormals = hasVertexNormals;
+
+ /**
+ * The terrain mesh contains a vertical texture coordinate following the Web Mercator projection.
+ * @type {Boolean}
+ */
+ this.hasWebMercatorT = defaultValue.defaultValue(hasWebMercatorT, false);
+
+ /**
+ * The terrain mesh contains geodetic surface normals, used for terrain exaggeration.
+ * @type {Boolean}
+ */
+ this.hasGeodeticSurfaceNormals = defaultValue.defaultValue(
+ hasGeodeticSurfaceNormals,
+ false
+ );
+
+ /**
+ * A scalar used to exaggerate terrain.
+ * @type {Number}
+ */
+ this.exaggeration = defaultValue.defaultValue(exaggeration, 1.0);
+
+ /**
+ * The relative height from which terrain is exaggerated.
+ */
+ this.exaggerationRelativeHeight = defaultValue.defaultValue(
+ exaggerationRelativeHeight,
+ 0.0
+ );
+
+ /**
+ * The number of components in each vertex. This value can differ with different quantizations.
+ * @type {Number}
+ */
+ this.stride = 0;
+
+ this._offsetGeodeticSurfaceNormal = 0;
+ this._offsetVertexNormal = 0;
+
+ // Calculate the stride and offsets declared above
+ this._calculateStrideAndOffsets();
+ }
+
+ TerrainEncoding.prototype.encode = function (
+ vertexBuffer,
+ bufferIndex,
+ position,
+ uv,
+ height,
+ normalToPack,
+ webMercatorT,
+ geodeticSurfaceNormal
+ ) {
+ const u = uv.x;
+ const v = uv.y;
+
+ if (this.quantization === TerrainQuantization$1.BITS12) {
+ position = Matrix2.Matrix4.multiplyByPoint(
+ this.toScaledENU,
+ position,
+ cartesian3Scratch
+ );
+
+ position.x = Math$1.CesiumMath.clamp(position.x, 0.0, 1.0);
+ position.y = Math$1.CesiumMath.clamp(position.y, 0.0, 1.0);
+ position.z = Math$1.CesiumMath.clamp(position.z, 0.0, 1.0);
+
+ const hDim = this.maximumHeight - this.minimumHeight;
+ const h = Math$1.CesiumMath.clamp((height - this.minimumHeight) / hDim, 0.0, 1.0);
+
+ Matrix2.Cartesian2.fromElements(position.x, position.y, cartesian2Scratch);
+ const compressed0 = AttributeCompression.AttributeCompression.compressTextureCoordinates(
+ cartesian2Scratch
+ );
+
+ Matrix2.Cartesian2.fromElements(position.z, h, cartesian2Scratch);
+ const compressed1 = AttributeCompression.AttributeCompression.compressTextureCoordinates(
+ cartesian2Scratch
+ );
+
+ Matrix2.Cartesian2.fromElements(u, v, cartesian2Scratch);
+ const compressed2 = AttributeCompression.AttributeCompression.compressTextureCoordinates(
+ cartesian2Scratch
+ );
+
+ vertexBuffer[bufferIndex++] = compressed0;
+ vertexBuffer[bufferIndex++] = compressed1;
+ vertexBuffer[bufferIndex++] = compressed2;
+
+ if (this.hasWebMercatorT) {
+ Matrix2.Cartesian2.fromElements(webMercatorT, 0.0, cartesian2Scratch);
+ const compressed3 = AttributeCompression.AttributeCompression.compressTextureCoordinates(
+ cartesian2Scratch
+ );
+ vertexBuffer[bufferIndex++] = compressed3;
+ }
+ } else {
+ Matrix3.Cartesian3.subtract(position, this.center, cartesian3Scratch);
+
+ vertexBuffer[bufferIndex++] = cartesian3Scratch.x;
+ vertexBuffer[bufferIndex++] = cartesian3Scratch.y;
+ vertexBuffer[bufferIndex++] = cartesian3Scratch.z;
+ vertexBuffer[bufferIndex++] = height;
+ vertexBuffer[bufferIndex++] = u;
+ vertexBuffer[bufferIndex++] = v;
+
+ if (this.hasWebMercatorT) {
+ vertexBuffer[bufferIndex++] = webMercatorT;
+ }
+ }
+
+ if (this.hasVertexNormals) {
+ vertexBuffer[bufferIndex++] = AttributeCompression.AttributeCompression.octPackFloat(
+ normalToPack
+ );
+ }
+
+ if (this.hasGeodeticSurfaceNormals) {
+ vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.x;
+ vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.y;
+ vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.z;
+ }
+
+ return bufferIndex;
+ };
+
+ const scratchPosition = new Matrix3.Cartesian3();
+ const scratchGeodeticSurfaceNormal = new Matrix3.Cartesian3();
+
+ TerrainEncoding.prototype.addGeodeticSurfaceNormals = function (
+ oldBuffer,
+ newBuffer,
+ ellipsoid
+ ) {
+ if (this.hasGeodeticSurfaceNormals) {
+ return;
+ }
+
+ const oldStride = this.stride;
+ const vertexCount = oldBuffer.length / oldStride;
+ this.hasGeodeticSurfaceNormals = true;
+ this._calculateStrideAndOffsets();
+ const newStride = this.stride;
+
+ for (let index = 0; index < vertexCount; index++) {
+ for (let offset = 0; offset < oldStride; offset++) {
+ const oldIndex = index * oldStride + offset;
+ const newIndex = index * newStride + offset;
+ newBuffer[newIndex] = oldBuffer[oldIndex];
+ }
+ const position = this.decodePosition(newBuffer, index, scratchPosition);
+ const geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal(
+ position,
+ scratchGeodeticSurfaceNormal
+ );
+
+ const bufferIndex = index * newStride + this._offsetGeodeticSurfaceNormal;
+ newBuffer[bufferIndex] = geodeticSurfaceNormal.x;
+ newBuffer[bufferIndex + 1] = geodeticSurfaceNormal.y;
+ newBuffer[bufferIndex + 2] = geodeticSurfaceNormal.z;
+ }
+ };
+
+ TerrainEncoding.prototype.removeGeodeticSurfaceNormals = function (
+ oldBuffer,
+ newBuffer
+ ) {
+ if (!this.hasGeodeticSurfaceNormals) {
+ return;
+ }
+
+ const oldStride = this.stride;
+ const vertexCount = oldBuffer.length / oldStride;
+ this.hasGeodeticSurfaceNormals = false;
+ this._calculateStrideAndOffsets();
+ const newStride = this.stride;
+
+ for (let index = 0; index < vertexCount; index++) {
+ for (let offset = 0; offset < newStride; offset++) {
+ const oldIndex = index * oldStride + offset;
+ const newIndex = index * newStride + offset;
+ newBuffer[newIndex] = oldBuffer[oldIndex];
+ }
+ }
+ };
+
+ TerrainEncoding.prototype.decodePosition = function (buffer, index, result) {
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Cartesian3();
+ }
+
+ index *= this.stride;
+
+ if (this.quantization === TerrainQuantization$1.BITS12) {
+ const xy = AttributeCompression.AttributeCompression.decompressTextureCoordinates(
+ buffer[index],
+ cartesian2Scratch
+ );
+ result.x = xy.x;
+ result.y = xy.y;
+
+ const zh = AttributeCompression.AttributeCompression.decompressTextureCoordinates(
+ buffer[index + 1],
+ cartesian2Scratch
+ );
+ result.z = zh.x;
+
+ return Matrix2.Matrix4.multiplyByPoint(this.fromScaledENU, result, result);
+ }
+
+ result.x = buffer[index];
+ result.y = buffer[index + 1];
+ result.z = buffer[index + 2];
+ return Matrix3.Cartesian3.add(result, this.center, result);
+ };
+
+ TerrainEncoding.prototype.getExaggeratedPosition = function (
+ buffer,
+ index,
+ result
+ ) {
+ result = this.decodePosition(buffer, index, result);
+
+ const exaggeration = this.exaggeration;
+ const exaggerationRelativeHeight = this.exaggerationRelativeHeight;
+ const hasExaggeration = exaggeration !== 1.0;
+ if (hasExaggeration && this.hasGeodeticSurfaceNormals) {
+ const geodeticSurfaceNormal = this.decodeGeodeticSurfaceNormal(
+ buffer,
+ index,
+ scratchGeodeticSurfaceNormal
+ );
+ const rawHeight = this.decodeHeight(buffer, index);
+ const heightDifference =
+ TerrainExaggeration$1.getHeight(
+ rawHeight,
+ exaggeration,
+ exaggerationRelativeHeight
+ ) - rawHeight;
+
+ // some math is unrolled for better performance
+ result.x += geodeticSurfaceNormal.x * heightDifference;
+ result.y += geodeticSurfaceNormal.y * heightDifference;
+ result.z += geodeticSurfaceNormal.z * heightDifference;
+ }
+
+ return result;
+ };
+
+ TerrainEncoding.prototype.decodeTextureCoordinates = function (
+ buffer,
+ index,
+ result
+ ) {
+ if (!defaultValue.defined(result)) {
+ result = new Matrix2.Cartesian2();
+ }
+
+ index *= this.stride;
+
+ if (this.quantization === TerrainQuantization$1.BITS12) {
+ return AttributeCompression.AttributeCompression.decompressTextureCoordinates(
+ buffer[index + 2],
+ result
+ );
+ }
+
+ return Matrix2.Cartesian2.fromElements(buffer[index + 4], buffer[index + 5], result);
+ };
+
+ TerrainEncoding.prototype.decodeHeight = function (buffer, index) {
+ index *= this.stride;
+
+ if (this.quantization === TerrainQuantization$1.BITS12) {
+ const zh = AttributeCompression.AttributeCompression.decompressTextureCoordinates(
+ buffer[index + 1],
+ cartesian2Scratch
+ );
+ return (
+ zh.y * (this.maximumHeight - this.minimumHeight) + this.minimumHeight
+ );
+ }
+
+ return buffer[index + 3];
+ };
+
+ TerrainEncoding.prototype.decodeWebMercatorT = function (buffer, index) {
+ index *= this.stride;
+
+ if (this.quantization === TerrainQuantization$1.BITS12) {
+ return AttributeCompression.AttributeCompression.decompressTextureCoordinates(
+ buffer[index + 3],
+ cartesian2Scratch
+ ).x;
+ }
+
+ return buffer[index + 6];
+ };
+
+ TerrainEncoding.prototype.getOctEncodedNormal = function (
+ buffer,
+ index,
+ result
+ ) {
+ index = index * this.stride + this._offsetVertexNormal;
+
+ const temp = buffer[index] / 256.0;
+ const x = Math.floor(temp);
+ const y = (temp - x) * 256.0;
+
+ return Matrix2.Cartesian2.fromElements(x, y, result);
+ };
+
+ TerrainEncoding.prototype.decodeGeodeticSurfaceNormal = function (
+ buffer,
+ index,
+ result
+ ) {
+ index = index * this.stride + this._offsetGeodeticSurfaceNormal;
+
+ result.x = buffer[index];
+ result.y = buffer[index + 1];
+ result.z = buffer[index + 2];
+ return result;
+ };
+
+ TerrainEncoding.prototype._calculateStrideAndOffsets = function () {
+ let vertexStride = 0;
+
+ switch (this.quantization) {
+ case TerrainQuantization$1.BITS12:
+ vertexStride += 3;
+ break;
+ default:
+ vertexStride += 6;
+ }
+ if (this.hasWebMercatorT) {
+ vertexStride += 1;
+ }
+ if (this.hasVertexNormals) {
+ this._offsetVertexNormal = vertexStride;
+ vertexStride += 1;
+ }
+ if (this.hasGeodeticSurfaceNormals) {
+ this._offsetGeodeticSurfaceNormal = vertexStride;
+ vertexStride += 3;
+ }
+
+ this.stride = vertexStride;
+ };
+
+ const attributesIndicesNone = {
+ position3DAndHeight: 0,
+ textureCoordAndEncodedNormals: 1,
+ geodeticSurfaceNormal: 2,
+ };
+ const attributesIndicesBits12 = {
+ compressed0: 0,
+ compressed1: 1,
+ geodeticSurfaceNormal: 2,
+ };
+
+ TerrainEncoding.prototype.getAttributes = function (buffer) {
+ const datatype = ComponentDatatype.ComponentDatatype.FLOAT;
+ const sizeInBytes = ComponentDatatype.ComponentDatatype.getSizeInBytes(datatype);
+ const strideInBytes = this.stride * sizeInBytes;
+ let offsetInBytes = 0;
+
+ const attributes = [];
+ function addAttribute(index, componentsPerAttribute) {
+ attributes.push({
+ index: index,
+ vertexBuffer: buffer,
+ componentDatatype: datatype,
+ componentsPerAttribute: componentsPerAttribute,
+ offsetInBytes: offsetInBytes,
+ strideInBytes: strideInBytes,
+ });
+ offsetInBytes += componentsPerAttribute * sizeInBytes;
+ }
+
+ if (this.quantization === TerrainQuantization$1.NONE) {
+ addAttribute(attributesIndicesNone.position3DAndHeight, 4);
+
+ let componentsTexCoordAndNormals = 2;
+ componentsTexCoordAndNormals += this.hasWebMercatorT ? 1 : 0;
+ componentsTexCoordAndNormals += this.hasVertexNormals ? 1 : 0;
+ addAttribute(
+ attributesIndicesNone.textureCoordAndEncodedNormals,
+ componentsTexCoordAndNormals
+ );
+
+ if (this.hasGeodeticSurfaceNormals) {
+ addAttribute(attributesIndicesNone.geodeticSurfaceNormal, 3);
+ }
+ } else {
+ // When there is no webMercatorT or vertex normals, the attribute only needs 3 components: x/y, z/h, u/v.
+ // WebMercatorT and vertex normals each take up one component, so if only one of them is present the first
+ // attribute gets a 4th component. If both are present, we need an additional attribute that has 1 component.
+ const usingAttribute0Component4 =
+ this.hasWebMercatorT || this.hasVertexNormals;
+ const usingAttribute1Component1 =
+ this.hasWebMercatorT && this.hasVertexNormals;
+ addAttribute(
+ attributesIndicesBits12.compressed0,
+ usingAttribute0Component4 ? 4 : 3
+ );
+
+ if (usingAttribute1Component1) {
+ addAttribute(attributesIndicesBits12.compressed1, 1);
+ }
+
+ if (this.hasGeodeticSurfaceNormals) {
+ addAttribute(attributesIndicesBits12.geodeticSurfaceNormal, 3);
+ }
+ }
+
+ return attributes;
+ };
+
+ TerrainEncoding.prototype.getAttributeLocations = function () {
+ if (this.quantization === TerrainQuantization$1.NONE) {
+ return attributesIndicesNone;
+ }
+ return attributesIndicesBits12;
+ };
+
+ TerrainEncoding.clone = function (encoding, result) {
+ if (!defaultValue.defined(encoding)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ result = new TerrainEncoding();
+ }
+
+ result.quantization = encoding.quantization;
+ result.minimumHeight = encoding.minimumHeight;
+ result.maximumHeight = encoding.maximumHeight;
+ result.center = Matrix3.Cartesian3.clone(encoding.center);
+ result.toScaledENU = Matrix2.Matrix4.clone(encoding.toScaledENU);
+ result.fromScaledENU = Matrix2.Matrix4.clone(encoding.fromScaledENU);
+ result.matrix = Matrix2.Matrix4.clone(encoding.matrix);
+ result.hasVertexNormals = encoding.hasVertexNormals;
+ result.hasWebMercatorT = encoding.hasWebMercatorT;
+ result.hasGeodeticSurfaceNormals = encoding.hasGeodeticSurfaceNormals;
+ result.exaggeration = encoding.exaggeration;
+ result.exaggerationRelativeHeight = encoding.exaggerationRelativeHeight;
+
+ result._calculateStrideAndOffsets();
+
+ return result;
+ };
+
+ exports.EllipsoidalOccluder = EllipsoidalOccluder;
+ exports.TerrainEncoding = TerrainEncoding;
+
+}));
+//# sourceMappingURL=TerrainEncoding-c7d764e4.js.map
diff --git a/examples/cesium/Workers/TerrainEncoding-c7d764e4.js.map b/examples/cesium/Workers/TerrainEncoding-c7d764e4.js.map
new file mode 100644
index 0000000..b0e4a36
--- /dev/null
+++ b/examples/cesium/Workers/TerrainEncoding-c7d764e4.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"TerrainEncoding-c7d764e4.js","sources":["../../../Source/Core/EllipsoidalOccluder.js","../../../Source/Core/TerrainExaggeration.js","../../../Source/Core/TerrainQuantization.js","../../../Source/Core/TerrainEncoding.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\n\r\n/**\r\n * Determine whether or not other objects are visible or hidden behind the visible horizon defined by\r\n * an {@link Ellipsoid} and a camera position. The ellipsoid is assumed to be located at the\r\n * origin of the coordinate system. This class uses the algorithm described in the\r\n * {@link https://cesium.com/blog/2013/04/25/Horizon-culling/|Horizon Culling} blog post.\r\n *\r\n * @alias EllipsoidalOccluder\r\n *\r\n * @param {Ellipsoid} ellipsoid The ellipsoid to use as an occluder.\r\n * @param {Cartesian3} [cameraPosition] The coordinate of the viewer/camera. If this parameter is not\r\n * specified, {@link EllipsoidalOccluder#cameraPosition} must be called before\r\n * testing visibility.\r\n *\r\n * @constructor\r\n *\r\n * @example\r\n * // Construct an ellipsoidal occluder with radii 1.0, 1.1, and 0.9.\r\n * const cameraPosition = new Cesium.Cartesian3(5.0, 6.0, 7.0);\r\n * const occluderEllipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);\r\n * const occluder = new Cesium.EllipsoidalOccluder(occluderEllipsoid, cameraPosition);\r\n *\r\n * @private\r\n */\r\nfunction EllipsoidalOccluder(ellipsoid, cameraPosition) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"ellipsoid\", ellipsoid);\r\n //>>includeEnd('debug');\r\n\r\n this._ellipsoid = ellipsoid;\r\n this._cameraPosition = new Cartesian3();\r\n this._cameraPositionInScaledSpace = new Cartesian3();\r\n this._distanceToLimbInScaledSpaceSquared = 0.0;\r\n\r\n // cameraPosition fills in the above values\r\n if (defined(cameraPosition)) {\r\n this.cameraPosition = cameraPosition;\r\n }\r\n}\r\n\r\nObject.defineProperties(EllipsoidalOccluder.prototype, {\r\n /**\r\n * Gets the occluding ellipsoid.\r\n * @memberof EllipsoidalOccluder.prototype\r\n * @type {Ellipsoid}\r\n */\r\n ellipsoid: {\r\n get: function () {\r\n return this._ellipsoid;\r\n },\r\n },\r\n /**\r\n * Gets or sets the position of the camera.\r\n * @memberof EllipsoidalOccluder.prototype\r\n * @type {Cartesian3}\r\n */\r\n cameraPosition: {\r\n get: function () {\r\n return this._cameraPosition;\r\n },\r\n set: function (cameraPosition) {\r\n // See https://cesium.com/blog/2013/04/25/Horizon-culling/\r\n const ellipsoid = this._ellipsoid;\r\n const cv = ellipsoid.transformPositionToScaledSpace(\r\n cameraPosition,\r\n this._cameraPositionInScaledSpace\r\n );\r\n const vhMagnitudeSquared = Cartesian3.magnitudeSquared(cv) - 1.0;\r\n\r\n Cartesian3.clone(cameraPosition, this._cameraPosition);\r\n this._cameraPositionInScaledSpace = cv;\r\n this._distanceToLimbInScaledSpaceSquared = vhMagnitudeSquared;\r\n },\r\n },\r\n});\r\n\r\nconst scratchCartesian = new Cartesian3();\r\n\r\n/**\r\n * Determines whether or not a point, the occludee
, is hidden from view by the occluder.\r\n *\r\n * @param {Cartesian3} occludee The point to test for visibility.\r\n * @returns {Boolean} true
if the occludee is visible; otherwise false
.\r\n *\r\n * @example\r\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 2.5);\r\n * const ellipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);\r\n * const occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);\r\n * const point = new Cesium.Cartesian3(0, -3, -3);\r\n * occluder.isPointVisible(point); //returns true\r\n */\r\nEllipsoidalOccluder.prototype.isPointVisible = function (occludee) {\r\n const ellipsoid = this._ellipsoid;\r\n const occludeeScaledSpacePosition = ellipsoid.transformPositionToScaledSpace(\r\n occludee,\r\n scratchCartesian\r\n );\r\n return isScaledSpacePointVisible(\r\n occludeeScaledSpacePosition,\r\n this._cameraPositionInScaledSpace,\r\n this._distanceToLimbInScaledSpaceSquared\r\n );\r\n};\r\n\r\n/**\r\n * Determines whether or not a point expressed in the ellipsoid scaled space, is hidden from view by the\r\n * occluder. To transform a Cartesian X, Y, Z position in the coordinate system aligned with the ellipsoid\r\n * into the scaled space, call {@link Ellipsoid#transformPositionToScaledSpace}.\r\n *\r\n * @param {Cartesian3} occludeeScaledSpacePosition The point to test for visibility, represented in the scaled space.\r\n * @returns {Boolean} true
if the occludee is visible; otherwise false
.\r\n *\r\n * @example\r\n * const cameraPosition = new Cesium.Cartesian3(0, 0, 2.5);\r\n * const ellipsoid = new Cesium.Ellipsoid(1.0, 1.1, 0.9);\r\n * const occluder = new Cesium.EllipsoidalOccluder(ellipsoid, cameraPosition);\r\n * const point = new Cesium.Cartesian3(0, -3, -3);\r\n * const scaledSpacePoint = ellipsoid.transformPositionToScaledSpace(point);\r\n * occluder.isScaledSpacePointVisible(scaledSpacePoint); //returns true\r\n */\r\nEllipsoidalOccluder.prototype.isScaledSpacePointVisible = function (\r\n occludeeScaledSpacePosition\r\n) {\r\n return isScaledSpacePointVisible(\r\n occludeeScaledSpacePosition,\r\n this._cameraPositionInScaledSpace,\r\n this._distanceToLimbInScaledSpaceSquared\r\n );\r\n};\r\n\r\nconst scratchCameraPositionInScaledSpaceShrunk = new Cartesian3();\r\n\r\n/**\r\n * Similar to {@link EllipsoidalOccluder#isScaledSpacePointVisible} except tests against an\r\n * ellipsoid that has been shrunk by the minimum height when the minimum height is below\r\n * the ellipsoid. This is intended to be used with points generated by\r\n * {@link EllipsoidalOccluder#computeHorizonCullingPointPossiblyUnderEllipsoid} or\r\n * {@link EllipsoidalOccluder#computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid}.\r\n *\r\n * @param {Cartesian3} occludeeScaledSpacePosition The point to test for visibility, represented in the scaled space of the possibly-shrunk ellipsoid.\r\n * @returns {Boolean} true
if the occludee is visible; otherwise false
.\r\n */\r\nEllipsoidalOccluder.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid = function (\r\n occludeeScaledSpacePosition,\r\n minimumHeight\r\n) {\r\n const ellipsoid = this._ellipsoid;\r\n let vhMagnitudeSquared;\r\n let cv;\r\n\r\n if (\r\n defined(minimumHeight) &&\r\n minimumHeight < 0.0 &&\r\n ellipsoid.minimumRadius > -minimumHeight\r\n ) {\r\n // This code is similar to the cameraPosition setter, but unrolled for performance because it will be called a lot.\r\n cv = scratchCameraPositionInScaledSpaceShrunk;\r\n cv.x = this._cameraPosition.x / (ellipsoid.radii.x + minimumHeight);\r\n cv.y = this._cameraPosition.y / (ellipsoid.radii.y + minimumHeight);\r\n cv.z = this._cameraPosition.z / (ellipsoid.radii.z + minimumHeight);\r\n vhMagnitudeSquared = cv.x * cv.x + cv.y * cv.y + cv.z * cv.z - 1.0;\r\n } else {\r\n cv = this._cameraPositionInScaledSpace;\r\n vhMagnitudeSquared = this._distanceToLimbInScaledSpaceSquared;\r\n }\r\n\r\n return isScaledSpacePointVisible(\r\n occludeeScaledSpacePosition,\r\n cv,\r\n vhMagnitudeSquared\r\n );\r\n};\r\n\r\n/**\r\n * Computes a point that can be used for horizon culling from a list of positions. If the point is below\r\n * the horizon, all of the positions are guaranteed to be below the horizon as well. The returned point\r\n * is expressed in the ellipsoid-scaled space and is suitable for use with\r\n * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.\r\n *\r\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\r\n * A reasonable direction to use is the direction from the center of the ellipsoid to\r\n * the center of the bounding sphere computed from the positions. The direction need not\r\n * be normalized.\r\n * @param {Cartesian3[]} positions The positions from which to compute the horizon culling point. The positions\r\n * must be expressed in a reference frame centered at the ellipsoid and aligned with the\r\n * ellipsoid's axes.\r\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\r\n * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.\r\n */\r\nEllipsoidalOccluder.prototype.computeHorizonCullingPoint = function (\r\n directionToPoint,\r\n positions,\r\n result\r\n) {\r\n return computeHorizonCullingPointFromPositions(\r\n this._ellipsoid,\r\n directionToPoint,\r\n positions,\r\n result\r\n );\r\n};\r\n\r\nconst scratchEllipsoidShrunk = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\n\r\n/**\r\n * Similar to {@link EllipsoidalOccluder#computeHorizonCullingPoint} except computes the culling\r\n * point relative to an ellipsoid that has been shrunk by the minimum height when the minimum height is below\r\n * the ellipsoid. The returned point is expressed in the possibly-shrunk ellipsoid-scaled space and is suitable\r\n * for use with {@link EllipsoidalOccluder#isScaledSpacePointVisiblePossiblyUnderEllipsoid}.\r\n *\r\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\r\n * A reasonable direction to use is the direction from the center of the ellipsoid to\r\n * the center of the bounding sphere computed from the positions. The direction need not\r\n * be normalized.\r\n * @param {Cartesian3[]} positions The positions from which to compute the horizon culling point. The positions\r\n * must be expressed in a reference frame centered at the ellipsoid and aligned with the\r\n * ellipsoid's axes.\r\n * @param {Number} [minimumHeight] The minimum height of all positions. If this value is undefined, all positions are assumed to be above the ellipsoid.\r\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\r\n * @returns {Cartesian3} The computed horizon culling point, expressed in the possibly-shrunk ellipsoid-scaled space.\r\n */\r\nEllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid = function (\r\n directionToPoint,\r\n positions,\r\n minimumHeight,\r\n result\r\n) {\r\n const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid(\r\n this._ellipsoid,\r\n minimumHeight,\r\n scratchEllipsoidShrunk\r\n );\r\n return computeHorizonCullingPointFromPositions(\r\n possiblyShrunkEllipsoid,\r\n directionToPoint,\r\n positions,\r\n result\r\n );\r\n};\r\n/**\r\n * Computes a point that can be used for horizon culling from a list of positions. If the point is below\r\n * the horizon, all of the positions are guaranteed to be below the horizon as well. The returned point\r\n * is expressed in the ellipsoid-scaled space and is suitable for use with\r\n * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.\r\n *\r\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\r\n * A reasonable direction to use is the direction from the center of the ellipsoid to\r\n * the center of the bounding sphere computed from the positions. The direction need not\r\n * be normalized.\r\n * @param {Number[]} vertices The vertices from which to compute the horizon culling point. The positions\r\n * must be expressed in a reference frame centered at the ellipsoid and aligned with the\r\n * ellipsoid's axes.\r\n * @param {Number} [stride=3]\r\n * @param {Cartesian3} [center=Cartesian3.ZERO]\r\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\r\n * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.\r\n */\r\nEllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices = function (\r\n directionToPoint,\r\n vertices,\r\n stride,\r\n center,\r\n result\r\n) {\r\n return computeHorizonCullingPointFromVertices(\r\n this._ellipsoid,\r\n directionToPoint,\r\n vertices,\r\n stride,\r\n center,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Similar to {@link EllipsoidalOccluder#computeHorizonCullingPointFromVertices} except computes the culling\r\n * point relative to an ellipsoid that has been shrunk by the minimum height when the minimum height is below\r\n * the ellipsoid. The returned point is expressed in the possibly-shrunk ellipsoid-scaled space and is suitable\r\n * for use with {@link EllipsoidalOccluder#isScaledSpacePointVisiblePossiblyUnderEllipsoid}.\r\n *\r\n * @param {Cartesian3} directionToPoint The direction that the computed point will lie along.\r\n * A reasonable direction to use is the direction from the center of the ellipsoid to\r\n * the center of the bounding sphere computed from the positions. The direction need not\r\n * be normalized.\r\n * @param {Number[]} vertices The vertices from which to compute the horizon culling point. The positions\r\n * must be expressed in a reference frame centered at the ellipsoid and aligned with the\r\n * ellipsoid's axes.\r\n * @param {Number} [stride=3]\r\n * @param {Cartesian3} [center=Cartesian3.ZERO]\r\n * @param {Number} [minimumHeight] The minimum height of all vertices. If this value is undefined, all vertices are assumed to be above the ellipsoid.\r\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\r\n * @returns {Cartesian3} The computed horizon culling point, expressed in the possibly-shrunk ellipsoid-scaled space.\r\n */\r\nEllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid = function (\r\n directionToPoint,\r\n vertices,\r\n stride,\r\n center,\r\n minimumHeight,\r\n result\r\n) {\r\n const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid(\r\n this._ellipsoid,\r\n minimumHeight,\r\n scratchEllipsoidShrunk\r\n );\r\n return computeHorizonCullingPointFromVertices(\r\n possiblyShrunkEllipsoid,\r\n directionToPoint,\r\n vertices,\r\n stride,\r\n center,\r\n result\r\n );\r\n};\r\n\r\nconst subsampleScratch = [];\r\n\r\n/**\r\n * Computes a point that can be used for horizon culling of a rectangle. If the point is below\r\n * the horizon, the ellipsoid-conforming rectangle is guaranteed to be below the horizon as well.\r\n * The returned point is expressed in the ellipsoid-scaled space and is suitable for use with\r\n * {@link EllipsoidalOccluder#isScaledSpacePointVisible}.\r\n *\r\n * @param {Rectangle} rectangle The rectangle for which to compute the horizon culling point.\r\n * @param {Ellipsoid} ellipsoid The ellipsoid on which the rectangle is defined. This may be different from\r\n * the ellipsoid used by this instance for occlusion testing.\r\n * @param {Cartesian3} [result] The instance on which to store the result instead of allocating a new instance.\r\n * @returns {Cartesian3} The computed horizon culling point, expressed in the ellipsoid-scaled space.\r\n */\r\nEllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle = function (\r\n rectangle,\r\n ellipsoid,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n\r\n const positions = Rectangle.subsample(\r\n rectangle,\r\n ellipsoid,\r\n 0.0,\r\n subsampleScratch\r\n );\r\n const bs = BoundingSphere.fromPoints(positions);\r\n\r\n // If the bounding sphere center is too close to the center of the occluder, it doesn't make\r\n // sense to try to horizon cull it.\r\n if (Cartesian3.magnitude(bs.center) < 0.1 * ellipsoid.minimumRadius) {\r\n return undefined;\r\n }\r\n\r\n return this.computeHorizonCullingPoint(bs.center, positions, result);\r\n};\r\n\r\nconst scratchEllipsoidShrunkRadii = new Cartesian3();\r\n\r\nfunction getPossiblyShrunkEllipsoid(ellipsoid, minimumHeight, result) {\r\n if (\r\n defined(minimumHeight) &&\r\n minimumHeight < 0.0 &&\r\n ellipsoid.minimumRadius > -minimumHeight\r\n ) {\r\n const ellipsoidShrunkRadii = Cartesian3.fromElements(\r\n ellipsoid.radii.x + minimumHeight,\r\n ellipsoid.radii.y + minimumHeight,\r\n ellipsoid.radii.z + minimumHeight,\r\n scratchEllipsoidShrunkRadii\r\n );\r\n ellipsoid = Ellipsoid.fromCartesian3(ellipsoidShrunkRadii, result);\r\n }\r\n return ellipsoid;\r\n}\r\n\r\nfunction computeHorizonCullingPointFromPositions(\r\n ellipsoid,\r\n directionToPoint,\r\n positions,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"directionToPoint\", directionToPoint);\r\n Check.defined(\"positions\", positions);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(\r\n ellipsoid,\r\n directionToPoint\r\n );\r\n let resultMagnitude = 0.0;\r\n\r\n for (let i = 0, len = positions.length; i < len; ++i) {\r\n const position = positions[i];\r\n const candidateMagnitude = computeMagnitude(\r\n ellipsoid,\r\n position,\r\n scaledSpaceDirectionToPoint\r\n );\r\n if (candidateMagnitude < 0.0) {\r\n // all points should face the same direction, but this one doesn't, so return undefined\r\n return undefined;\r\n }\r\n resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);\r\n }\r\n\r\n return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);\r\n}\r\n\r\nconst positionScratch = new Cartesian3();\r\n\r\nfunction computeHorizonCullingPointFromVertices(\r\n ellipsoid,\r\n directionToPoint,\r\n vertices,\r\n stride,\r\n center,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"directionToPoint\", directionToPoint);\r\n Check.defined(\"vertices\", vertices);\r\n Check.typeOf.number(\"stride\", stride);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n stride = defaultValue(stride, 3);\r\n center = defaultValue(center, Cartesian3.ZERO);\r\n const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(\r\n ellipsoid,\r\n directionToPoint\r\n );\r\n let resultMagnitude = 0.0;\r\n\r\n for (let i = 0, len = vertices.length; i < len; i += stride) {\r\n positionScratch.x = vertices[i] + center.x;\r\n positionScratch.y = vertices[i + 1] + center.y;\r\n positionScratch.z = vertices[i + 2] + center.z;\r\n\r\n const candidateMagnitude = computeMagnitude(\r\n ellipsoid,\r\n positionScratch,\r\n scaledSpaceDirectionToPoint\r\n );\r\n if (candidateMagnitude < 0.0) {\r\n // all points should face the same direction, but this one doesn't, so return undefined\r\n return undefined;\r\n }\r\n resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);\r\n }\r\n\r\n return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);\r\n}\r\n\r\nfunction isScaledSpacePointVisible(\r\n occludeeScaledSpacePosition,\r\n cameraPositionInScaledSpace,\r\n distanceToLimbInScaledSpaceSquared\r\n) {\r\n // See https://cesium.com/blog/2013/04/25/Horizon-culling/\r\n const cv = cameraPositionInScaledSpace;\r\n const vhMagnitudeSquared = distanceToLimbInScaledSpaceSquared;\r\n const vt = Cartesian3.subtract(\r\n occludeeScaledSpacePosition,\r\n cv,\r\n scratchCartesian\r\n );\r\n const vtDotVc = -Cartesian3.dot(vt, cv);\r\n // If vhMagnitudeSquared < 0 then we are below the surface of the ellipsoid and\r\n // in this case, set the culling plane to be on V.\r\n const isOccluded =\r\n vhMagnitudeSquared < 0\r\n ? vtDotVc > 0\r\n : vtDotVc > vhMagnitudeSquared &&\r\n (vtDotVc * vtDotVc) / Cartesian3.magnitudeSquared(vt) >\r\n vhMagnitudeSquared;\r\n return !isOccluded;\r\n}\r\n\r\nconst scaledSpaceScratch = new Cartesian3();\r\nconst directionScratch = new Cartesian3();\r\n\r\nfunction computeMagnitude(ellipsoid, position, scaledSpaceDirectionToPoint) {\r\n const scaledSpacePosition = ellipsoid.transformPositionToScaledSpace(\r\n position,\r\n scaledSpaceScratch\r\n );\r\n let magnitudeSquared = Cartesian3.magnitudeSquared(scaledSpacePosition);\r\n let magnitude = Math.sqrt(magnitudeSquared);\r\n const direction = Cartesian3.divideByScalar(\r\n scaledSpacePosition,\r\n magnitude,\r\n directionScratch\r\n );\r\n\r\n // For the purpose of this computation, points below the ellipsoid are consider to be on it instead.\r\n magnitudeSquared = Math.max(1.0, magnitudeSquared);\r\n magnitude = Math.max(1.0, magnitude);\r\n\r\n const cosAlpha = Cartesian3.dot(direction, scaledSpaceDirectionToPoint);\r\n const sinAlpha = Cartesian3.magnitude(\r\n Cartesian3.cross(direction, scaledSpaceDirectionToPoint, direction)\r\n );\r\n const cosBeta = 1.0 / magnitude;\r\n const sinBeta = Math.sqrt(magnitudeSquared - 1.0) * cosBeta;\r\n\r\n return 1.0 / (cosAlpha * cosBeta - sinAlpha * sinBeta);\r\n}\r\n\r\nfunction magnitudeToPoint(\r\n scaledSpaceDirectionToPoint,\r\n resultMagnitude,\r\n result\r\n) {\r\n // The horizon culling point is undefined if there were no positions from which to compute it,\r\n // the directionToPoint is pointing opposite all of the positions, or if we computed NaN or infinity.\r\n if (\r\n resultMagnitude <= 0.0 ||\r\n resultMagnitude === 1.0 / 0.0 ||\r\n resultMagnitude !== resultMagnitude\r\n ) {\r\n return undefined;\r\n }\r\n\r\n return Cartesian3.multiplyByScalar(\r\n scaledSpaceDirectionToPoint,\r\n resultMagnitude,\r\n result\r\n );\r\n}\r\n\r\nconst directionToPointScratch = new Cartesian3();\r\n\r\nfunction computeScaledSpaceDirectionToPoint(ellipsoid, directionToPoint) {\r\n if (Cartesian3.equals(directionToPoint, Cartesian3.ZERO)) {\r\n return directionToPoint;\r\n }\r\n\r\n ellipsoid.transformPositionToScaledSpace(\r\n directionToPoint,\r\n directionToPointScratch\r\n );\r\n return Cartesian3.normalize(directionToPointScratch, directionToPointScratch);\r\n}\r\nexport default EllipsoidalOccluder;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\n\r\n/**\r\n * @private\r\n */\r\nconst TerrainExaggeration = {};\r\n\r\n/**\r\n * Scales a height relative to an offset.\r\n *\r\n * @param {Number} height The height.\r\n * @param {Number} scale A scalar used to exaggerate the terrain. If the value is 1.0 there will be no effect.\r\n * @param {Number} relativeHeight The height relative to which terrain is exaggerated. If the value is 0.0 terrain will be exaggerated relative to the ellipsoid surface.\r\n */\r\nTerrainExaggeration.getHeight = function (height, scale, relativeHeight) {\r\n return (height - relativeHeight) * scale + relativeHeight;\r\n};\r\n\r\nconst scratchCartographic = new Cartesian3();\r\n\r\n/**\r\n * Scales a position by exaggeration.\r\n */\r\nTerrainExaggeration.getPosition = function (\r\n position,\r\n ellipsoid,\r\n terrainExaggeration,\r\n terrainExaggerationRelativeHeight,\r\n result\r\n) {\r\n const cartographic = ellipsoid.cartesianToCartographic(\r\n position,\r\n scratchCartographic\r\n );\r\n const newHeight = TerrainExaggeration.getHeight(\r\n cartographic.height,\r\n terrainExaggeration,\r\n terrainExaggerationRelativeHeight\r\n );\r\n return Cartesian3.fromRadians(\r\n cartographic.longitude,\r\n cartographic.latitude,\r\n newHeight,\r\n ellipsoid,\r\n result\r\n );\r\n};\r\n\r\nexport default TerrainExaggeration;\r\n","/**\r\n * This enumerated type is used to determine how the vertices of the terrain mesh are compressed.\r\n *\r\n * @enum {Number}\r\n *\r\n * @private\r\n */\r\nconst TerrainQuantization = {\r\n /**\r\n * The vertices are not compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n NONE: 0,\r\n\r\n /**\r\n * The vertices are compressed to 12 bits.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n BITS12: 1,\r\n};\r\nexport default Object.freeze(TerrainQuantization);\r\n","import AttributeCompression from \"./AttributeCompression.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport TerrainExaggeration from \"./TerrainExaggeration.js\";\r\nimport TerrainQuantization from \"./TerrainQuantization.js\";\r\n\r\nconst cartesian3Scratch = new Cartesian3();\r\nconst cartesian3DimScratch = new Cartesian3();\r\nconst cartesian2Scratch = new Cartesian2();\r\nconst matrix4Scratch = new Matrix4();\r\nconst matrix4Scratch2 = new Matrix4();\r\n\r\nconst SHIFT_LEFT_12 = Math.pow(2.0, 12.0);\r\n\r\n/**\r\n * Data used to quantize and pack the terrain mesh. The position can be unpacked for picking and all attributes\r\n * are unpacked in the vertex shader.\r\n *\r\n * @alias TerrainEncoding\r\n * @constructor\r\n *\r\n * @param {Cartesian3} center The center point of the vertices.\r\n * @param {AxisAlignedBoundingBox} axisAlignedBoundingBox The bounds of the tile in the east-north-up coordinates at the tiles center.\r\n * @param {Number} minimumHeight The minimum height.\r\n * @param {Number} maximumHeight The maximum height.\r\n * @param {Matrix4} fromENU The east-north-up to fixed frame matrix at the center of the terrain mesh.\r\n * @param {Boolean} hasVertexNormals If the mesh has vertex normals.\r\n * @param {Boolean} [hasWebMercatorT=false] true if the terrain data includes a Web Mercator texture coordinate; otherwise, false.\r\n * @param {Boolean} [hasGeodeticSurfaceNormals=false] true if the terrain data includes geodetic surface normals; otherwise, false.\r\n * @param {Number} [exaggeration=1.0] A scalar used to exaggerate terrain.\r\n * @param {Number} [exaggerationRelativeHeight=0.0] The relative height from which terrain is exaggerated.\r\n *\r\n * @private\r\n */\r\nfunction TerrainEncoding(\r\n center,\r\n axisAlignedBoundingBox,\r\n minimumHeight,\r\n maximumHeight,\r\n fromENU,\r\n hasVertexNormals,\r\n hasWebMercatorT,\r\n hasGeodeticSurfaceNormals,\r\n exaggeration,\r\n exaggerationRelativeHeight\r\n) {\r\n let quantization = TerrainQuantization.NONE;\r\n let toENU;\r\n let matrix;\r\n\r\n if (\r\n defined(axisAlignedBoundingBox) &&\r\n defined(minimumHeight) &&\r\n defined(maximumHeight) &&\r\n defined(fromENU)\r\n ) {\r\n const minimum = axisAlignedBoundingBox.minimum;\r\n const maximum = axisAlignedBoundingBox.maximum;\r\n\r\n const dimensions = Cartesian3.subtract(\r\n maximum,\r\n minimum,\r\n cartesian3DimScratch\r\n );\r\n const hDim = maximumHeight - minimumHeight;\r\n const maxDim = Math.max(Cartesian3.maximumComponent(dimensions), hDim);\r\n\r\n if (maxDim < SHIFT_LEFT_12 - 1.0) {\r\n quantization = TerrainQuantization.BITS12;\r\n } else {\r\n quantization = TerrainQuantization.NONE;\r\n }\r\n\r\n toENU = Matrix4.inverseTransformation(fromENU, new Matrix4());\r\n\r\n const translation = Cartesian3.negate(minimum, cartesian3Scratch);\r\n Matrix4.multiply(\r\n Matrix4.fromTranslation(translation, matrix4Scratch),\r\n toENU,\r\n toENU\r\n );\r\n\r\n const scale = cartesian3Scratch;\r\n scale.x = 1.0 / dimensions.x;\r\n scale.y = 1.0 / dimensions.y;\r\n scale.z = 1.0 / dimensions.z;\r\n Matrix4.multiply(Matrix4.fromScale(scale, matrix4Scratch), toENU, toENU);\r\n\r\n matrix = Matrix4.clone(fromENU);\r\n Matrix4.setTranslation(matrix, Cartesian3.ZERO, matrix);\r\n\r\n fromENU = Matrix4.clone(fromENU, new Matrix4());\r\n\r\n const translationMatrix = Matrix4.fromTranslation(minimum, matrix4Scratch);\r\n const scaleMatrix = Matrix4.fromScale(dimensions, matrix4Scratch2);\r\n const st = Matrix4.multiply(translationMatrix, scaleMatrix, matrix4Scratch);\r\n\r\n Matrix4.multiply(fromENU, st, fromENU);\r\n Matrix4.multiply(matrix, st, matrix);\r\n }\r\n\r\n /**\r\n * How the vertices of the mesh were compressed.\r\n * @type {TerrainQuantization}\r\n */\r\n this.quantization = quantization;\r\n\r\n /**\r\n * The minimum height of the tile including the skirts.\r\n * @type {Number}\r\n */\r\n this.minimumHeight = minimumHeight;\r\n\r\n /**\r\n * The maximum height of the tile.\r\n * @type {Number}\r\n */\r\n this.maximumHeight = maximumHeight;\r\n\r\n /**\r\n * The center of the tile.\r\n * @type {Cartesian3}\r\n */\r\n this.center = Cartesian3.clone(center);\r\n\r\n /**\r\n * A matrix that takes a vertex from the tile, transforms it to east-north-up at the center and scales\r\n * it so each component is in the [0, 1] range.\r\n * @type {Matrix4}\r\n */\r\n this.toScaledENU = toENU;\r\n\r\n /**\r\n * A matrix that restores a vertex transformed with toScaledENU back to the earth fixed reference frame\r\n * @type {Matrix4}\r\n */\r\n this.fromScaledENU = fromENU;\r\n\r\n /**\r\n * The matrix used to decompress the terrain vertices in the shader for RTE rendering.\r\n * @type {Matrix4}\r\n */\r\n this.matrix = matrix;\r\n\r\n /**\r\n * The terrain mesh contains normals.\r\n * @type {Boolean}\r\n */\r\n this.hasVertexNormals = hasVertexNormals;\r\n\r\n /**\r\n * The terrain mesh contains a vertical texture coordinate following the Web Mercator projection.\r\n * @type {Boolean}\r\n */\r\n this.hasWebMercatorT = defaultValue(hasWebMercatorT, false);\r\n\r\n /**\r\n * The terrain mesh contains geodetic surface normals, used for terrain exaggeration.\r\n * @type {Boolean}\r\n */\r\n this.hasGeodeticSurfaceNormals = defaultValue(\r\n hasGeodeticSurfaceNormals,\r\n false\r\n );\r\n\r\n /**\r\n * A scalar used to exaggerate terrain.\r\n * @type {Number}\r\n */\r\n this.exaggeration = defaultValue(exaggeration, 1.0);\r\n\r\n /**\r\n * The relative height from which terrain is exaggerated.\r\n */\r\n this.exaggerationRelativeHeight = defaultValue(\r\n exaggerationRelativeHeight,\r\n 0.0\r\n );\r\n\r\n /**\r\n * The number of components in each vertex. This value can differ with different quantizations.\r\n * @type {Number}\r\n */\r\n this.stride = 0;\r\n\r\n this._offsetGeodeticSurfaceNormal = 0;\r\n this._offsetVertexNormal = 0;\r\n\r\n // Calculate the stride and offsets declared above\r\n this._calculateStrideAndOffsets();\r\n}\r\n\r\nTerrainEncoding.prototype.encode = function (\r\n vertexBuffer,\r\n bufferIndex,\r\n position,\r\n uv,\r\n height,\r\n normalToPack,\r\n webMercatorT,\r\n geodeticSurfaceNormal\r\n) {\r\n const u = uv.x;\r\n const v = uv.y;\r\n\r\n if (this.quantization === TerrainQuantization.BITS12) {\r\n position = Matrix4.multiplyByPoint(\r\n this.toScaledENU,\r\n position,\r\n cartesian3Scratch\r\n );\r\n\r\n position.x = CesiumMath.clamp(position.x, 0.0, 1.0);\r\n position.y = CesiumMath.clamp(position.y, 0.0, 1.0);\r\n position.z = CesiumMath.clamp(position.z, 0.0, 1.0);\r\n\r\n const hDim = this.maximumHeight - this.minimumHeight;\r\n const h = CesiumMath.clamp((height - this.minimumHeight) / hDim, 0.0, 1.0);\r\n\r\n Cartesian2.fromElements(position.x, position.y, cartesian2Scratch);\r\n const compressed0 = AttributeCompression.compressTextureCoordinates(\r\n cartesian2Scratch\r\n );\r\n\r\n Cartesian2.fromElements(position.z, h, cartesian2Scratch);\r\n const compressed1 = AttributeCompression.compressTextureCoordinates(\r\n cartesian2Scratch\r\n );\r\n\r\n Cartesian2.fromElements(u, v, cartesian2Scratch);\r\n const compressed2 = AttributeCompression.compressTextureCoordinates(\r\n cartesian2Scratch\r\n );\r\n\r\n vertexBuffer[bufferIndex++] = compressed0;\r\n vertexBuffer[bufferIndex++] = compressed1;\r\n vertexBuffer[bufferIndex++] = compressed2;\r\n\r\n if (this.hasWebMercatorT) {\r\n Cartesian2.fromElements(webMercatorT, 0.0, cartesian2Scratch);\r\n const compressed3 = AttributeCompression.compressTextureCoordinates(\r\n cartesian2Scratch\r\n );\r\n vertexBuffer[bufferIndex++] = compressed3;\r\n }\r\n } else {\r\n Cartesian3.subtract(position, this.center, cartesian3Scratch);\r\n\r\n vertexBuffer[bufferIndex++] = cartesian3Scratch.x;\r\n vertexBuffer[bufferIndex++] = cartesian3Scratch.y;\r\n vertexBuffer[bufferIndex++] = cartesian3Scratch.z;\r\n vertexBuffer[bufferIndex++] = height;\r\n vertexBuffer[bufferIndex++] = u;\r\n vertexBuffer[bufferIndex++] = v;\r\n\r\n if (this.hasWebMercatorT) {\r\n vertexBuffer[bufferIndex++] = webMercatorT;\r\n }\r\n }\r\n\r\n if (this.hasVertexNormals) {\r\n vertexBuffer[bufferIndex++] = AttributeCompression.octPackFloat(\r\n normalToPack\r\n );\r\n }\r\n\r\n if (this.hasGeodeticSurfaceNormals) {\r\n vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.x;\r\n vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.y;\r\n vertexBuffer[bufferIndex++] = geodeticSurfaceNormal.z;\r\n }\r\n\r\n return bufferIndex;\r\n};\r\n\r\nconst scratchPosition = new Cartesian3();\r\nconst scratchGeodeticSurfaceNormal = new Cartesian3();\r\n\r\nTerrainEncoding.prototype.addGeodeticSurfaceNormals = function (\r\n oldBuffer,\r\n newBuffer,\r\n ellipsoid\r\n) {\r\n if (this.hasGeodeticSurfaceNormals) {\r\n return;\r\n }\r\n\r\n const oldStride = this.stride;\r\n const vertexCount = oldBuffer.length / oldStride;\r\n this.hasGeodeticSurfaceNormals = true;\r\n this._calculateStrideAndOffsets();\r\n const newStride = this.stride;\r\n\r\n for (let index = 0; index < vertexCount; index++) {\r\n for (let offset = 0; offset < oldStride; offset++) {\r\n const oldIndex = index * oldStride + offset;\r\n const newIndex = index * newStride + offset;\r\n newBuffer[newIndex] = oldBuffer[oldIndex];\r\n }\r\n const position = this.decodePosition(newBuffer, index, scratchPosition);\r\n const geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal(\r\n position,\r\n scratchGeodeticSurfaceNormal\r\n );\r\n\r\n const bufferIndex = index * newStride + this._offsetGeodeticSurfaceNormal;\r\n newBuffer[bufferIndex] = geodeticSurfaceNormal.x;\r\n newBuffer[bufferIndex + 1] = geodeticSurfaceNormal.y;\r\n newBuffer[bufferIndex + 2] = geodeticSurfaceNormal.z;\r\n }\r\n};\r\n\r\nTerrainEncoding.prototype.removeGeodeticSurfaceNormals = function (\r\n oldBuffer,\r\n newBuffer\r\n) {\r\n if (!this.hasGeodeticSurfaceNormals) {\r\n return;\r\n }\r\n\r\n const oldStride = this.stride;\r\n const vertexCount = oldBuffer.length / oldStride;\r\n this.hasGeodeticSurfaceNormals = false;\r\n this._calculateStrideAndOffsets();\r\n const newStride = this.stride;\r\n\r\n for (let index = 0; index < vertexCount; index++) {\r\n for (let offset = 0; offset < newStride; offset++) {\r\n const oldIndex = index * oldStride + offset;\r\n const newIndex = index * newStride + offset;\r\n newBuffer[newIndex] = oldBuffer[oldIndex];\r\n }\r\n }\r\n};\r\n\r\nTerrainEncoding.prototype.decodePosition = function (buffer, index, result) {\r\n if (!defined(result)) {\r\n result = new Cartesian3();\r\n }\r\n\r\n index *= this.stride;\r\n\r\n if (this.quantization === TerrainQuantization.BITS12) {\r\n const xy = AttributeCompression.decompressTextureCoordinates(\r\n buffer[index],\r\n cartesian2Scratch\r\n );\r\n result.x = xy.x;\r\n result.y = xy.y;\r\n\r\n const zh = AttributeCompression.decompressTextureCoordinates(\r\n buffer[index + 1],\r\n cartesian2Scratch\r\n );\r\n result.z = zh.x;\r\n\r\n return Matrix4.multiplyByPoint(this.fromScaledENU, result, result);\r\n }\r\n\r\n result.x = buffer[index];\r\n result.y = buffer[index + 1];\r\n result.z = buffer[index + 2];\r\n return Cartesian3.add(result, this.center, result);\r\n};\r\n\r\nTerrainEncoding.prototype.getExaggeratedPosition = function (\r\n buffer,\r\n index,\r\n result\r\n) {\r\n result = this.decodePosition(buffer, index, result);\r\n\r\n const exaggeration = this.exaggeration;\r\n const exaggerationRelativeHeight = this.exaggerationRelativeHeight;\r\n const hasExaggeration = exaggeration !== 1.0;\r\n if (hasExaggeration && this.hasGeodeticSurfaceNormals) {\r\n const geodeticSurfaceNormal = this.decodeGeodeticSurfaceNormal(\r\n buffer,\r\n index,\r\n scratchGeodeticSurfaceNormal\r\n );\r\n const rawHeight = this.decodeHeight(buffer, index);\r\n const heightDifference =\r\n TerrainExaggeration.getHeight(\r\n rawHeight,\r\n exaggeration,\r\n exaggerationRelativeHeight\r\n ) - rawHeight;\r\n\r\n // some math is unrolled for better performance\r\n result.x += geodeticSurfaceNormal.x * heightDifference;\r\n result.y += geodeticSurfaceNormal.y * heightDifference;\r\n result.z += geodeticSurfaceNormal.z * heightDifference;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nTerrainEncoding.prototype.decodeTextureCoordinates = function (\r\n buffer,\r\n index,\r\n result\r\n) {\r\n if (!defined(result)) {\r\n result = new Cartesian2();\r\n }\r\n\r\n index *= this.stride;\r\n\r\n if (this.quantization === TerrainQuantization.BITS12) {\r\n return AttributeCompression.decompressTextureCoordinates(\r\n buffer[index + 2],\r\n result\r\n );\r\n }\r\n\r\n return Cartesian2.fromElements(buffer[index + 4], buffer[index + 5], result);\r\n};\r\n\r\nTerrainEncoding.prototype.decodeHeight = function (buffer, index) {\r\n index *= this.stride;\r\n\r\n if (this.quantization === TerrainQuantization.BITS12) {\r\n const zh = AttributeCompression.decompressTextureCoordinates(\r\n buffer[index + 1],\r\n cartesian2Scratch\r\n );\r\n return (\r\n zh.y * (this.maximumHeight - this.minimumHeight) + this.minimumHeight\r\n );\r\n }\r\n\r\n return buffer[index + 3];\r\n};\r\n\r\nTerrainEncoding.prototype.decodeWebMercatorT = function (buffer, index) {\r\n index *= this.stride;\r\n\r\n if (this.quantization === TerrainQuantization.BITS12) {\r\n return AttributeCompression.decompressTextureCoordinates(\r\n buffer[index + 3],\r\n cartesian2Scratch\r\n ).x;\r\n }\r\n\r\n return buffer[index + 6];\r\n};\r\n\r\nTerrainEncoding.prototype.getOctEncodedNormal = function (\r\n buffer,\r\n index,\r\n result\r\n) {\r\n index = index * this.stride + this._offsetVertexNormal;\r\n\r\n const temp = buffer[index] / 256.0;\r\n const x = Math.floor(temp);\r\n const y = (temp - x) * 256.0;\r\n\r\n return Cartesian2.fromElements(x, y, result);\r\n};\r\n\r\nTerrainEncoding.prototype.decodeGeodeticSurfaceNormal = function (\r\n buffer,\r\n index,\r\n result\r\n) {\r\n index = index * this.stride + this._offsetGeodeticSurfaceNormal;\r\n\r\n result.x = buffer[index];\r\n result.y = buffer[index + 1];\r\n result.z = buffer[index + 2];\r\n return result;\r\n};\r\n\r\nTerrainEncoding.prototype._calculateStrideAndOffsets = function () {\r\n let vertexStride = 0;\r\n\r\n switch (this.quantization) {\r\n case TerrainQuantization.BITS12:\r\n vertexStride += 3;\r\n break;\r\n default:\r\n vertexStride += 6;\r\n }\r\n if (this.hasWebMercatorT) {\r\n vertexStride += 1;\r\n }\r\n if (this.hasVertexNormals) {\r\n this._offsetVertexNormal = vertexStride;\r\n vertexStride += 1;\r\n }\r\n if (this.hasGeodeticSurfaceNormals) {\r\n this._offsetGeodeticSurfaceNormal = vertexStride;\r\n vertexStride += 3;\r\n }\r\n\r\n this.stride = vertexStride;\r\n};\r\n\r\nconst attributesIndicesNone = {\r\n position3DAndHeight: 0,\r\n textureCoordAndEncodedNormals: 1,\r\n geodeticSurfaceNormal: 2,\r\n};\r\nconst attributesIndicesBits12 = {\r\n compressed0: 0,\r\n compressed1: 1,\r\n geodeticSurfaceNormal: 2,\r\n};\r\n\r\nTerrainEncoding.prototype.getAttributes = function (buffer) {\r\n const datatype = ComponentDatatype.FLOAT;\r\n const sizeInBytes = ComponentDatatype.getSizeInBytes(datatype);\r\n const strideInBytes = this.stride * sizeInBytes;\r\n let offsetInBytes = 0;\r\n\r\n const attributes = [];\r\n function addAttribute(index, componentsPerAttribute) {\r\n attributes.push({\r\n index: index,\r\n vertexBuffer: buffer,\r\n componentDatatype: datatype,\r\n componentsPerAttribute: componentsPerAttribute,\r\n offsetInBytes: offsetInBytes,\r\n strideInBytes: strideInBytes,\r\n });\r\n offsetInBytes += componentsPerAttribute * sizeInBytes;\r\n }\r\n\r\n if (this.quantization === TerrainQuantization.NONE) {\r\n addAttribute(attributesIndicesNone.position3DAndHeight, 4);\r\n\r\n let componentsTexCoordAndNormals = 2;\r\n componentsTexCoordAndNormals += this.hasWebMercatorT ? 1 : 0;\r\n componentsTexCoordAndNormals += this.hasVertexNormals ? 1 : 0;\r\n addAttribute(\r\n attributesIndicesNone.textureCoordAndEncodedNormals,\r\n componentsTexCoordAndNormals\r\n );\r\n\r\n if (this.hasGeodeticSurfaceNormals) {\r\n addAttribute(attributesIndicesNone.geodeticSurfaceNormal, 3);\r\n }\r\n } else {\r\n // When there is no webMercatorT or vertex normals, the attribute only needs 3 components: x/y, z/h, u/v.\r\n // WebMercatorT and vertex normals each take up one component, so if only one of them is present the first\r\n // attribute gets a 4th component. If both are present, we need an additional attribute that has 1 component.\r\n const usingAttribute0Component4 =\r\n this.hasWebMercatorT || this.hasVertexNormals;\r\n const usingAttribute1Component1 =\r\n this.hasWebMercatorT && this.hasVertexNormals;\r\n addAttribute(\r\n attributesIndicesBits12.compressed0,\r\n usingAttribute0Component4 ? 4 : 3\r\n );\r\n\r\n if (usingAttribute1Component1) {\r\n addAttribute(attributesIndicesBits12.compressed1, 1);\r\n }\r\n\r\n if (this.hasGeodeticSurfaceNormals) {\r\n addAttribute(attributesIndicesBits12.geodeticSurfaceNormal, 3);\r\n }\r\n }\r\n\r\n return attributes;\r\n};\r\n\r\nTerrainEncoding.prototype.getAttributeLocations = function () {\r\n if (this.quantization === TerrainQuantization.NONE) {\r\n return attributesIndicesNone;\r\n }\r\n return attributesIndicesBits12;\r\n};\r\n\r\nTerrainEncoding.clone = function (encoding, result) {\r\n if (!defined(encoding)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n result = new TerrainEncoding();\r\n }\r\n\r\n result.quantization = encoding.quantization;\r\n result.minimumHeight = encoding.minimumHeight;\r\n result.maximumHeight = encoding.maximumHeight;\r\n result.center = Cartesian3.clone(encoding.center);\r\n result.toScaledENU = Matrix4.clone(encoding.toScaledENU);\r\n result.fromScaledENU = Matrix4.clone(encoding.fromScaledENU);\r\n result.matrix = Matrix4.clone(encoding.matrix);\r\n result.hasVertexNormals = encoding.hasVertexNormals;\r\n result.hasWebMercatorT = encoding.hasWebMercatorT;\r\n result.hasGeodeticSurfaceNormals = encoding.hasGeodeticSurfaceNormals;\r\n result.exaggeration = encoding.exaggeration;\r\n result.exaggerationRelativeHeight = encoding.exaggerationRelativeHeight;\r\n\r\n result._calculateStrideAndOffsets();\r\n\r\n return result;\r\n};\r\nexport default TerrainEncoding;\r\n"],"names":["Check","Cartesian3","defined","Ellipsoid","Rectangle","BoundingSphere","defaultValue","Cartesian2","Matrix4","TerrainQuantization","CesiumMath","AttributeCompression","TerrainExaggeration","ComponentDatatype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,mBAAmB,CAAC,SAAS,EAAE,cAAc,EAAE;EACxD;EACA,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;EAC9C;AACA;EACA,EAAE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;EAC9B,EAAE,IAAI,CAAC,eAAe,GAAG,IAAIC,kBAAU,EAAE,CAAC;EAC1C,EAAE,IAAI,CAAC,4BAA4B,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACvD,EAAE,IAAI,CAAC,mCAAmC,GAAG,GAAG,CAAC;AACjD;EACA;EACA,EAAE,IAAIC,oBAAO,CAAC,cAAc,CAAC,EAAE;EAC/B,IAAI,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;EACzC,GAAG;EACH,CAAC;AACD;EACA,MAAM,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,SAAS,EAAE;EACvD;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,EAAE;EACb,IAAI,GAAG,EAAE,YAAY;EACrB,MAAM,OAAO,IAAI,CAAC,UAAU,CAAC;EAC7B,KAAK;EACL,GAAG;EACH;EACA;EACA;EACA;EACA;EACA,EAAE,cAAc,EAAE;EAClB,IAAI,GAAG,EAAE,YAAY;EACrB,MAAM,OAAO,IAAI,CAAC,eAAe,CAAC;EAClC,KAAK;EACL,IAAI,GAAG,EAAE,UAAU,cAAc,EAAE;EACnC;EACA,MAAM,MAAM,SAAS,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C;EACpD,EAAE,MAAM,CAAC,yBAAyB,GAAG,QAAQ,CAAC,yBAAyB,CAAC;EACxE,EAAE,MAAM,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;EAC9C,EAAE,MAAM,CAAC,0BAA0B,GAAG,QAAQ,CAAC,0BAA0B,CAAC;AAC1E;EACA,EAAE,MAAM,CAAC,0BAA0B,EAAE,CAAC;AACtC;EACA,EAAE,OAAO,MAAM,CAAC;EAChB,CAAC;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/Transforms-11fb6b0a.js b/examples/cesium/Workers/Transforms-11fb6b0a.js
new file mode 100644
index 0000000..4e79f0b
--- /dev/null
+++ b/examples/cesium/Workers/Transforms-11fb6b0a.js
@@ -0,0 +1,14709 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['require', 'exports', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Math-9be8b918', './Matrix2-036c77dd', './combine-4598d225', './RuntimeError-e5c6a8b9'], (function (require, exports, Matrix3, Check, defaultValue, Math$1, Matrix2, combine, RuntimeError) { 'use strict';
+
+ function _interopNamespace(e) {
+ if (e && e.__esModule) return e;
+ var n = Object.create(null);
+ if (e) {
+ Object.keys(e).forEach(function (k) {
+ if (k !== 'default') {
+ var d = Object.getOwnPropertyDescriptor(e, k);
+ Object.defineProperty(n, k, d.get ? d : {
+ enumerable: true,
+ get: function () { return e[k]; }
+ });
+ }
+ });
+ }
+ n["default"] = e;
+ return Object.freeze(n);
+ }
+
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
+
+ /**
+ * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying
+ * them by the {@link Ellipsoid#maximumRadius}. This projection
+ * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It
+ * is also known as EPSG:4326.
+ *
+ * @alias GeographicProjection
+ * @constructor
+ *
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.
+ *
+ * @see WebMercatorProjection
+ */
+ function GeographicProjection(ellipsoid) {
+ this._ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+ this._semimajorAxis = this._ellipsoid.maximumRadius;
+ this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;
+ }
+
+ Object.defineProperties(GeographicProjection.prototype, {
+ /**
+ * Gets the {@link Ellipsoid}.
+ *
+ * @memberof GeographicProjection.prototype
+ *
+ * @type {Ellipsoid}
+ * @readonly
+ */
+ ellipsoid: {
+ get: function () {
+ return this._ellipsoid;
+ },
+ },
+ });
+
+ /**
+ * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.
+ * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the
+ * ellipsoid. Z is the unmodified height.
+ *
+ * @param {Cartographic} cartographic The coordinates to project.
+ * @param {Cartesian3} [result] An instance into which to copy the result. If this parameter is
+ * undefined, a new instance is created and returned.
+ * @returns {Cartesian3} The projected coordinates. If the result parameter is not undefined, the
+ * coordinates are copied there and that instance is returned. Otherwise, a new instance is
+ * created and returned.
+ */
+ GeographicProjection.prototype.project = function (cartographic, result) {
+ // Actually this is the special case of equidistant cylindrical called the plate carree
+ const semimajorAxis = this._semimajorAxis;
+ const x = cartographic.longitude * semimajorAxis;
+ const y = cartographic.latitude * semimajorAxis;
+ const z = cartographic.height;
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3.Cartesian3(x, y, z);
+ }
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+ };
+
+ /**
+ * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}
+ * coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively,
+ * divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate.
+ *
+ * @param {Cartesian3} cartesian The Cartesian position to unproject with height (z) in meters.
+ * @param {Cartographic} [result] An instance into which to copy the result. If this parameter is
+ * undefined, a new instance is created and returned.
+ * @returns {Cartographic} The unprojected coordinates. If the result parameter is not undefined, the
+ * coordinates are copied there and that instance is returned. Otherwise, a new instance is
+ * created and returned.
+ */
+ GeographicProjection.prototype.unproject = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(cartesian)) {
+ throw new Check.DeveloperError("cartesian is required");
+ }
+ //>>includeEnd('debug');
+
+ const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;
+ const longitude = cartesian.x * oneOverEarthSemimajorAxis;
+ const latitude = cartesian.y * oneOverEarthSemimajorAxis;
+ const height = cartesian.z;
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3.Cartographic(longitude, latitude, height);
+ }
+
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = height;
+ return result;
+ };
+
+ /**
+ * This enumerated type is used in determining where, relative to the frustum, an
+ * object is located. The object can either be fully contained within the frustum (INSIDE),
+ * partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely
+ * outside of the frustum's 6 planes (OUTSIDE).
+ *
+ * @enum {Number}
+ */
+ const Intersect = {
+ /**
+ * Represents that an object is not contained within the frustum.
+ *
+ * @type {Number}
+ * @constant
+ */
+ OUTSIDE: -1,
+
+ /**
+ * Represents that an object intersects one of the frustum's planes.
+ *
+ * @type {Number}
+ * @constant
+ */
+ INTERSECTING: 0,
+
+ /**
+ * Represents that an object is fully within the frustum.
+ *
+ * @type {Number}
+ * @constant
+ */
+ INSIDE: 1,
+ };
+ var Intersect$1 = Object.freeze(Intersect);
+
+ /**
+ * Represents the closed interval [start, stop].
+ * @alias Interval
+ * @constructor
+ *
+ * @param {Number} [start=0.0] The beginning of the interval.
+ * @param {Number} [stop=0.0] The end of the interval.
+ */
+ function Interval(start, stop) {
+ /**
+ * The beginning of the interval.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.start = defaultValue.defaultValue(start, 0.0);
+ /**
+ * The end of the interval.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.stop = defaultValue.defaultValue(stop, 0.0);
+ }
+
+ /**
+ * A bounding sphere with a center and a radius.
+ * @alias BoundingSphere
+ * @constructor
+ *
+ * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the bounding sphere.
+ * @param {Number} [radius=0.0] The radius of the bounding sphere.
+ *
+ * @see AxisAlignedBoundingBox
+ * @see BoundingRectangle
+ * @see Packable
+ */
+ function BoundingSphere(center, radius) {
+ /**
+ * The center point of the sphere.
+ * @type {Cartesian3}
+ * @default {@link Cartesian3.ZERO}
+ */
+ this.center = Matrix3.Cartesian3.clone(defaultValue.defaultValue(center, Matrix3.Cartesian3.ZERO));
+
+ /**
+ * The radius of the sphere.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.radius = defaultValue.defaultValue(radius, 0.0);
+ }
+
+ const fromPointsXMin = new Matrix3.Cartesian3();
+ const fromPointsYMin = new Matrix3.Cartesian3();
+ const fromPointsZMin = new Matrix3.Cartesian3();
+ const fromPointsXMax = new Matrix3.Cartesian3();
+ const fromPointsYMax = new Matrix3.Cartesian3();
+ const fromPointsZMax = new Matrix3.Cartesian3();
+ const fromPointsCurrentPos = new Matrix3.Cartesian3();
+ const fromPointsScratch = new Matrix3.Cartesian3();
+ const fromPointsRitterCenter = new Matrix3.Cartesian3();
+ const fromPointsMinBoxPt = new Matrix3.Cartesian3();
+ const fromPointsMaxBoxPt = new Matrix3.Cartesian3();
+ const fromPointsNaiveCenterScratch = new Matrix3.Cartesian3();
+ const volumeConstant = (4.0 / 3.0) * Math$1.CesiumMath.PI;
+
+ /**
+ * Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points.
+ * The bounding sphere is computed by running two algorithms, a naive algorithm and
+ * Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.
+ *
+ * @param {Cartesian3[]} [positions] An array of points that the bounding sphere will enclose. Each point must have x
, y
, and z
properties.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.
+ *
+ * @see {@link http://help.agi.com/AGIComponents/html/BlogBoundingSphere.htm|Bounding Sphere computation article}
+ */
+ BoundingSphere.fromPoints = function (positions, result) {
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ if (!defaultValue.defined(positions) || positions.length === 0) {
+ result.center = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.center);
+ result.radius = 0.0;
+ return result;
+ }
+
+ const currentPos = Matrix3.Cartesian3.clone(positions[0], fromPointsCurrentPos);
+
+ const xMin = Matrix3.Cartesian3.clone(currentPos, fromPointsXMin);
+ const yMin = Matrix3.Cartesian3.clone(currentPos, fromPointsYMin);
+ const zMin = Matrix3.Cartesian3.clone(currentPos, fromPointsZMin);
+
+ const xMax = Matrix3.Cartesian3.clone(currentPos, fromPointsXMax);
+ const yMax = Matrix3.Cartesian3.clone(currentPos, fromPointsYMax);
+ const zMax = Matrix3.Cartesian3.clone(currentPos, fromPointsZMax);
+
+ const numPositions = positions.length;
+ let i;
+ for (i = 1; i < numPositions; i++) {
+ Matrix3.Cartesian3.clone(positions[i], currentPos);
+
+ const x = currentPos.x;
+ const y = currentPos.y;
+ const z = currentPos.z;
+
+ // Store points containing the the smallest and largest components
+ if (x < xMin.x) {
+ Matrix3.Cartesian3.clone(currentPos, xMin);
+ }
+
+ if (x > xMax.x) {
+ Matrix3.Cartesian3.clone(currentPos, xMax);
+ }
+
+ if (y < yMin.y) {
+ Matrix3.Cartesian3.clone(currentPos, yMin);
+ }
+
+ if (y > yMax.y) {
+ Matrix3.Cartesian3.clone(currentPos, yMax);
+ }
+
+ if (z < zMin.z) {
+ Matrix3.Cartesian3.clone(currentPos, zMin);
+ }
+
+ if (z > zMax.z) {
+ Matrix3.Cartesian3.clone(currentPos, zMax);
+ }
+ }
+
+ // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).
+ const xSpan = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(xMax, xMin, fromPointsScratch)
+ );
+ const ySpan = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(yMax, yMin, fromPointsScratch)
+ );
+ const zSpan = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(zMax, zMin, fromPointsScratch)
+ );
+
+ // Set the diameter endpoints to the largest span.
+ let diameter1 = xMin;
+ let diameter2 = xMax;
+ let maxSpan = xSpan;
+ if (ySpan > maxSpan) {
+ maxSpan = ySpan;
+ diameter1 = yMin;
+ diameter2 = yMax;
+ }
+ if (zSpan > maxSpan) {
+ maxSpan = zSpan;
+ diameter1 = zMin;
+ diameter2 = zMax;
+ }
+
+ // Calculate the center of the initial sphere found by Ritter's algorithm
+ const ritterCenter = fromPointsRitterCenter;
+ ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
+ ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
+ ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
+
+ // Calculate the radius of the initial sphere found by Ritter's algorithm
+ let radiusSquared = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)
+ );
+ let ritterRadius = Math.sqrt(radiusSquared);
+
+ // Find the center of the sphere found using the Naive method.
+ const minBoxPt = fromPointsMinBoxPt;
+ minBoxPt.x = xMin.x;
+ minBoxPt.y = yMin.y;
+ minBoxPt.z = zMin.z;
+
+ const maxBoxPt = fromPointsMaxBoxPt;
+ maxBoxPt.x = xMax.x;
+ maxBoxPt.y = yMax.y;
+ maxBoxPt.z = zMax.z;
+
+ const naiveCenter = Matrix3.Cartesian3.midpoint(
+ minBoxPt,
+ maxBoxPt,
+ fromPointsNaiveCenterScratch
+ );
+
+ // Begin 2nd pass to find naive radius and modify the ritter sphere.
+ let naiveRadius = 0;
+ for (i = 0; i < numPositions; i++) {
+ Matrix3.Cartesian3.clone(positions[i], currentPos);
+
+ // Find the furthest point from the naive center to calculate the naive radius.
+ const r = Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)
+ );
+ if (r > naiveRadius) {
+ naiveRadius = r;
+ }
+
+ // Make adjustments to the Ritter Sphere to include all points.
+ const oldCenterToPointSquared = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)
+ );
+ if (oldCenterToPointSquared > radiusSquared) {
+ const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
+ // Calculate new radius to include the point that lies outside
+ ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
+ radiusSquared = ritterRadius * ritterRadius;
+ // Calculate center of new Ritter sphere
+ const oldToNew = oldCenterToPoint - ritterRadius;
+ ritterCenter.x =
+ (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /
+ oldCenterToPoint;
+ ritterCenter.y =
+ (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /
+ oldCenterToPoint;
+ ritterCenter.z =
+ (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /
+ oldCenterToPoint;
+ }
+ }
+
+ if (ritterRadius < naiveRadius) {
+ Matrix3.Cartesian3.clone(ritterCenter, result.center);
+ result.radius = ritterRadius;
+ } else {
+ Matrix3.Cartesian3.clone(naiveCenter, result.center);
+ result.radius = naiveRadius;
+ }
+
+ return result;
+ };
+
+ const defaultProjection = new GeographicProjection();
+ const fromRectangle2DLowerLeft = new Matrix3.Cartesian3();
+ const fromRectangle2DUpperRight = new Matrix3.Cartesian3();
+ const fromRectangle2DSouthwest = new Matrix3.Cartographic();
+ const fromRectangle2DNortheast = new Matrix3.Cartographic();
+
+ /**
+ * Computes a bounding sphere from a rectangle projected in 2D.
+ *
+ * @param {Rectangle} [rectangle] The rectangle around which to create a bounding sphere.
+ * @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.fromRectangle2D = function (rectangle, projection, result) {
+ return BoundingSphere.fromRectangleWithHeights2D(
+ rectangle,
+ projection,
+ 0.0,
+ 0.0,
+ result
+ );
+ };
+
+ /**
+ * Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the
+ * object's minimum and maximum heights over the rectangle.
+ *
+ * @param {Rectangle} [rectangle] The rectangle around which to create a bounding sphere.
+ * @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.
+ * @param {Number} [minimumHeight=0.0] The minimum height over the rectangle.
+ * @param {Number} [maximumHeight=0.0] The maximum height over the rectangle.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.fromRectangleWithHeights2D = function (
+ rectangle,
+ projection,
+ minimumHeight,
+ maximumHeight,
+ result
+ ) {
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ if (!defaultValue.defined(rectangle)) {
+ result.center = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.center);
+ result.radius = 0.0;
+ return result;
+ }
+
+ projection = defaultValue.defaultValue(projection, defaultProjection);
+
+ Matrix2.Rectangle.southwest(rectangle, fromRectangle2DSouthwest);
+ fromRectangle2DSouthwest.height = minimumHeight;
+ Matrix2.Rectangle.northeast(rectangle, fromRectangle2DNortheast);
+ fromRectangle2DNortheast.height = maximumHeight;
+
+ const lowerLeft = projection.project(
+ fromRectangle2DSouthwest,
+ fromRectangle2DLowerLeft
+ );
+ const upperRight = projection.project(
+ fromRectangle2DNortheast,
+ fromRectangle2DUpperRight
+ );
+
+ const width = upperRight.x - lowerLeft.x;
+ const height = upperRight.y - lowerLeft.y;
+ const elevation = upperRight.z - lowerLeft.z;
+
+ result.radius =
+ Math.sqrt(width * width + height * height + elevation * elevation) * 0.5;
+ const center = result.center;
+ center.x = lowerLeft.x + width * 0.5;
+ center.y = lowerLeft.y + height * 0.5;
+ center.z = lowerLeft.z + elevation * 0.5;
+ return result;
+ };
+
+ const fromRectangle3DScratch = [];
+
+ /**
+ * Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points
+ * on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.
+ *
+ * @param {Rectangle} [rectangle] The valid rectangle used to create a bounding sphere.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine positions of the rectangle.
+ * @param {Number} [surfaceHeight=0.0] The height above the surface of the ellipsoid.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.fromRectangle3D = function (
+ rectangle,
+ ellipsoid,
+ surfaceHeight,
+ result
+ ) {
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+ surfaceHeight = defaultValue.defaultValue(surfaceHeight, 0.0);
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ if (!defaultValue.defined(rectangle)) {
+ result.center = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.center);
+ result.radius = 0.0;
+ return result;
+ }
+
+ const positions = Matrix2.Rectangle.subsample(
+ rectangle,
+ ellipsoid,
+ surfaceHeight,
+ fromRectangle3DScratch
+ );
+ return BoundingSphere.fromPoints(positions, result);
+ };
+
+ /**
+ * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are
+ * stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two
+ * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
+ * ensure a tight fit.
+ *
+ * @param {Number[]} [positions] An array of points that the bounding sphere will enclose. Each point
+ * is formed from three elements in the array in the order X, Y, Z.
+ * @param {Cartesian3} [center=Cartesian3.ZERO] The position to which the positions are relative, which need not be the
+ * origin of the coordinate system. This is useful when the positions are to be used for
+ * relative-to-center (RTC) rendering.
+ * @param {Number} [stride=3] The number of array elements per vertex. It must be at least 3, but it may
+ * be higher. Regardless of the value of this parameter, the X coordinate of the first position
+ * is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index
+ * 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If
+ * the stride is 5, however, two array elements are skipped and the next position begins at array
+ * index 5.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.
+ *
+ * @example
+ * // Compute the bounding sphere from 3 positions, each specified relative to a center.
+ * // In addition to the X, Y, and Z coordinates, the points array contains two additional
+ * // elements per point which are ignored for the purpose of computing the bounding sphere.
+ * const center = new Cesium.Cartesian3(1.0, 2.0, 3.0);
+ * const points = [1.0, 2.0, 3.0, 0.1, 0.2,
+ * 4.0, 5.0, 6.0, 0.1, 0.2,
+ * 7.0, 8.0, 9.0, 0.1, 0.2];
+ * const sphere = Cesium.BoundingSphere.fromVertices(points, center, 5);
+ *
+ * @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}
+ */
+ BoundingSphere.fromVertices = function (positions, center, stride, result) {
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ if (!defaultValue.defined(positions) || positions.length === 0) {
+ result.center = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.center);
+ result.radius = 0.0;
+ return result;
+ }
+
+ center = defaultValue.defaultValue(center, Matrix3.Cartesian3.ZERO);
+
+ stride = defaultValue.defaultValue(stride, 3);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.greaterThanOrEquals("stride", stride, 3);
+ //>>includeEnd('debug');
+
+ const currentPos = fromPointsCurrentPos;
+ currentPos.x = positions[0] + center.x;
+ currentPos.y = positions[1] + center.y;
+ currentPos.z = positions[2] + center.z;
+
+ const xMin = Matrix3.Cartesian3.clone(currentPos, fromPointsXMin);
+ const yMin = Matrix3.Cartesian3.clone(currentPos, fromPointsYMin);
+ const zMin = Matrix3.Cartesian3.clone(currentPos, fromPointsZMin);
+
+ const xMax = Matrix3.Cartesian3.clone(currentPos, fromPointsXMax);
+ const yMax = Matrix3.Cartesian3.clone(currentPos, fromPointsYMax);
+ const zMax = Matrix3.Cartesian3.clone(currentPos, fromPointsZMax);
+
+ const numElements = positions.length;
+ let i;
+ for (i = 0; i < numElements; i += stride) {
+ const x = positions[i] + center.x;
+ const y = positions[i + 1] + center.y;
+ const z = positions[i + 2] + center.z;
+
+ currentPos.x = x;
+ currentPos.y = y;
+ currentPos.z = z;
+
+ // Store points containing the the smallest and largest components
+ if (x < xMin.x) {
+ Matrix3.Cartesian3.clone(currentPos, xMin);
+ }
+
+ if (x > xMax.x) {
+ Matrix3.Cartesian3.clone(currentPos, xMax);
+ }
+
+ if (y < yMin.y) {
+ Matrix3.Cartesian3.clone(currentPos, yMin);
+ }
+
+ if (y > yMax.y) {
+ Matrix3.Cartesian3.clone(currentPos, yMax);
+ }
+
+ if (z < zMin.z) {
+ Matrix3.Cartesian3.clone(currentPos, zMin);
+ }
+
+ if (z > zMax.z) {
+ Matrix3.Cartesian3.clone(currentPos, zMax);
+ }
+ }
+
+ // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).
+ const xSpan = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(xMax, xMin, fromPointsScratch)
+ );
+ const ySpan = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(yMax, yMin, fromPointsScratch)
+ );
+ const zSpan = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(zMax, zMin, fromPointsScratch)
+ );
+
+ // Set the diameter endpoints to the largest span.
+ let diameter1 = xMin;
+ let diameter2 = xMax;
+ let maxSpan = xSpan;
+ if (ySpan > maxSpan) {
+ maxSpan = ySpan;
+ diameter1 = yMin;
+ diameter2 = yMax;
+ }
+ if (zSpan > maxSpan) {
+ maxSpan = zSpan;
+ diameter1 = zMin;
+ diameter2 = zMax;
+ }
+
+ // Calculate the center of the initial sphere found by Ritter's algorithm
+ const ritterCenter = fromPointsRitterCenter;
+ ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
+ ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
+ ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
+
+ // Calculate the radius of the initial sphere found by Ritter's algorithm
+ let radiusSquared = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)
+ );
+ let ritterRadius = Math.sqrt(radiusSquared);
+
+ // Find the center of the sphere found using the Naive method.
+ const minBoxPt = fromPointsMinBoxPt;
+ minBoxPt.x = xMin.x;
+ minBoxPt.y = yMin.y;
+ minBoxPt.z = zMin.z;
+
+ const maxBoxPt = fromPointsMaxBoxPt;
+ maxBoxPt.x = xMax.x;
+ maxBoxPt.y = yMax.y;
+ maxBoxPt.z = zMax.z;
+
+ const naiveCenter = Matrix3.Cartesian3.midpoint(
+ minBoxPt,
+ maxBoxPt,
+ fromPointsNaiveCenterScratch
+ );
+
+ // Begin 2nd pass to find naive radius and modify the ritter sphere.
+ let naiveRadius = 0;
+ for (i = 0; i < numElements; i += stride) {
+ currentPos.x = positions[i] + center.x;
+ currentPos.y = positions[i + 1] + center.y;
+ currentPos.z = positions[i + 2] + center.z;
+
+ // Find the furthest point from the naive center to calculate the naive radius.
+ const r = Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)
+ );
+ if (r > naiveRadius) {
+ naiveRadius = r;
+ }
+
+ // Make adjustments to the Ritter Sphere to include all points.
+ const oldCenterToPointSquared = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)
+ );
+ if (oldCenterToPointSquared > radiusSquared) {
+ const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
+ // Calculate new radius to include the point that lies outside
+ ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
+ radiusSquared = ritterRadius * ritterRadius;
+ // Calculate center of new Ritter sphere
+ const oldToNew = oldCenterToPoint - ritterRadius;
+ ritterCenter.x =
+ (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /
+ oldCenterToPoint;
+ ritterCenter.y =
+ (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /
+ oldCenterToPoint;
+ ritterCenter.z =
+ (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /
+ oldCenterToPoint;
+ }
+ }
+
+ if (ritterRadius < naiveRadius) {
+ Matrix3.Cartesian3.clone(ritterCenter, result.center);
+ result.radius = ritterRadius;
+ } else {
+ Matrix3.Cartesian3.clone(naiveCenter, result.center);
+ result.radius = naiveRadius;
+ }
+
+ return result;
+ };
+
+ /**
+ * Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are
+ * stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two
+ * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to
+ * ensure a tight fit.
+ *
+ * @param {Number[]} [positionsHigh] An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point
+ * is formed from three elements in the array in the order X, Y, Z.
+ * @param {Number[]} [positionsLow] An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point
+ * is formed from three elements in the array in the order X, Y, Z.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.
+ *
+ * @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}
+ */
+ BoundingSphere.fromEncodedCartesianVertices = function (
+ positionsHigh,
+ positionsLow,
+ result
+ ) {
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ if (
+ !defaultValue.defined(positionsHigh) ||
+ !defaultValue.defined(positionsLow) ||
+ positionsHigh.length !== positionsLow.length ||
+ positionsHigh.length === 0
+ ) {
+ result.center = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.center);
+ result.radius = 0.0;
+ return result;
+ }
+
+ const currentPos = fromPointsCurrentPos;
+ currentPos.x = positionsHigh[0] + positionsLow[0];
+ currentPos.y = positionsHigh[1] + positionsLow[1];
+ currentPos.z = positionsHigh[2] + positionsLow[2];
+
+ const xMin = Matrix3.Cartesian3.clone(currentPos, fromPointsXMin);
+ const yMin = Matrix3.Cartesian3.clone(currentPos, fromPointsYMin);
+ const zMin = Matrix3.Cartesian3.clone(currentPos, fromPointsZMin);
+
+ const xMax = Matrix3.Cartesian3.clone(currentPos, fromPointsXMax);
+ const yMax = Matrix3.Cartesian3.clone(currentPos, fromPointsYMax);
+ const zMax = Matrix3.Cartesian3.clone(currentPos, fromPointsZMax);
+
+ const numElements = positionsHigh.length;
+ let i;
+ for (i = 0; i < numElements; i += 3) {
+ const x = positionsHigh[i] + positionsLow[i];
+ const y = positionsHigh[i + 1] + positionsLow[i + 1];
+ const z = positionsHigh[i + 2] + positionsLow[i + 2];
+
+ currentPos.x = x;
+ currentPos.y = y;
+ currentPos.z = z;
+
+ // Store points containing the the smallest and largest components
+ if (x < xMin.x) {
+ Matrix3.Cartesian3.clone(currentPos, xMin);
+ }
+
+ if (x > xMax.x) {
+ Matrix3.Cartesian3.clone(currentPos, xMax);
+ }
+
+ if (y < yMin.y) {
+ Matrix3.Cartesian3.clone(currentPos, yMin);
+ }
+
+ if (y > yMax.y) {
+ Matrix3.Cartesian3.clone(currentPos, yMax);
+ }
+
+ if (z < zMin.z) {
+ Matrix3.Cartesian3.clone(currentPos, zMin);
+ }
+
+ if (z > zMax.z) {
+ Matrix3.Cartesian3.clone(currentPos, zMax);
+ }
+ }
+
+ // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).
+ const xSpan = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(xMax, xMin, fromPointsScratch)
+ );
+ const ySpan = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(yMax, yMin, fromPointsScratch)
+ );
+ const zSpan = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(zMax, zMin, fromPointsScratch)
+ );
+
+ // Set the diameter endpoints to the largest span.
+ let diameter1 = xMin;
+ let diameter2 = xMax;
+ let maxSpan = xSpan;
+ if (ySpan > maxSpan) {
+ maxSpan = ySpan;
+ diameter1 = yMin;
+ diameter2 = yMax;
+ }
+ if (zSpan > maxSpan) {
+ maxSpan = zSpan;
+ diameter1 = zMin;
+ diameter2 = zMax;
+ }
+
+ // Calculate the center of the initial sphere found by Ritter's algorithm
+ const ritterCenter = fromPointsRitterCenter;
+ ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
+ ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
+ ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
+
+ // Calculate the radius of the initial sphere found by Ritter's algorithm
+ let radiusSquared = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)
+ );
+ let ritterRadius = Math.sqrt(radiusSquared);
+
+ // Find the center of the sphere found using the Naive method.
+ const minBoxPt = fromPointsMinBoxPt;
+ minBoxPt.x = xMin.x;
+ minBoxPt.y = yMin.y;
+ minBoxPt.z = zMin.z;
+
+ const maxBoxPt = fromPointsMaxBoxPt;
+ maxBoxPt.x = xMax.x;
+ maxBoxPt.y = yMax.y;
+ maxBoxPt.z = zMax.z;
+
+ const naiveCenter = Matrix3.Cartesian3.midpoint(
+ minBoxPt,
+ maxBoxPt,
+ fromPointsNaiveCenterScratch
+ );
+
+ // Begin 2nd pass to find naive radius and modify the ritter sphere.
+ let naiveRadius = 0;
+ for (i = 0; i < numElements; i += 3) {
+ currentPos.x = positionsHigh[i] + positionsLow[i];
+ currentPos.y = positionsHigh[i + 1] + positionsLow[i + 1];
+ currentPos.z = positionsHigh[i + 2] + positionsLow[i + 2];
+
+ // Find the furthest point from the naive center to calculate the naive radius.
+ const r = Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)
+ );
+ if (r > naiveRadius) {
+ naiveRadius = r;
+ }
+
+ // Make adjustments to the Ritter Sphere to include all points.
+ const oldCenterToPointSquared = Matrix3.Cartesian3.magnitudeSquared(
+ Matrix3.Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)
+ );
+ if (oldCenterToPointSquared > radiusSquared) {
+ const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
+ // Calculate new radius to include the point that lies outside
+ ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
+ radiusSquared = ritterRadius * ritterRadius;
+ // Calculate center of new Ritter sphere
+ const oldToNew = oldCenterToPoint - ritterRadius;
+ ritterCenter.x =
+ (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /
+ oldCenterToPoint;
+ ritterCenter.y =
+ (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /
+ oldCenterToPoint;
+ ritterCenter.z =
+ (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /
+ oldCenterToPoint;
+ }
+ }
+
+ if (ritterRadius < naiveRadius) {
+ Matrix3.Cartesian3.clone(ritterCenter, result.center);
+ result.radius = ritterRadius;
+ } else {
+ Matrix3.Cartesian3.clone(naiveCenter, result.center);
+ result.radius = naiveRadius;
+ }
+
+ return result;
+ };
+
+ /**
+ * Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere
+ * tightly and fully encompasses the box.
+ *
+ * @param {Cartesian3} [corner] The minimum height over the rectangle.
+ * @param {Cartesian3} [oppositeCorner] The maximum height over the rectangle.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ *
+ * @example
+ * // Create a bounding sphere around the unit cube
+ * const sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5));
+ */
+ BoundingSphere.fromCornerPoints = function (corner, oppositeCorner, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("corner", corner);
+ Check.Check.typeOf.object("oppositeCorner", oppositeCorner);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ const center = Matrix3.Cartesian3.midpoint(corner, oppositeCorner, result.center);
+ result.radius = Matrix3.Cartesian3.distance(center, oppositeCorner);
+ return result;
+ };
+
+ /**
+ * Creates a bounding sphere encompassing an ellipsoid.
+ *
+ * @param {Ellipsoid} ellipsoid The ellipsoid around which to create a bounding sphere.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ *
+ * @example
+ * const boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);
+ */
+ BoundingSphere.fromEllipsoid = function (ellipsoid, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("ellipsoid", ellipsoid);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.center);
+ result.radius = ellipsoid.maximumRadius;
+ return result;
+ };
+
+ const fromBoundingSpheresScratch = new Matrix3.Cartesian3();
+
+ /**
+ * Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.
+ *
+ * @param {BoundingSphere[]} [boundingSpheres] The array of bounding spheres.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.fromBoundingSpheres = function (boundingSpheres, result) {
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ if (!defaultValue.defined(boundingSpheres) || boundingSpheres.length === 0) {
+ result.center = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, result.center);
+ result.radius = 0.0;
+ return result;
+ }
+
+ const length = boundingSpheres.length;
+ if (length === 1) {
+ return BoundingSphere.clone(boundingSpheres[0], result);
+ }
+
+ if (length === 2) {
+ return BoundingSphere.union(boundingSpheres[0], boundingSpheres[1], result);
+ }
+
+ const positions = [];
+ let i;
+ for (i = 0; i < length; i++) {
+ positions.push(boundingSpheres[i].center);
+ }
+
+ result = BoundingSphere.fromPoints(positions, result);
+
+ const center = result.center;
+ let radius = result.radius;
+ for (i = 0; i < length; i++) {
+ const tmp = boundingSpheres[i];
+ radius = Math.max(
+ radius,
+ Matrix3.Cartesian3.distance(center, tmp.center, fromBoundingSpheresScratch) +
+ tmp.radius
+ );
+ }
+ result.radius = radius;
+
+ return result;
+ };
+
+ const fromOrientedBoundingBoxScratchU = new Matrix3.Cartesian3();
+ const fromOrientedBoundingBoxScratchV = new Matrix3.Cartesian3();
+ const fromOrientedBoundingBoxScratchW = new Matrix3.Cartesian3();
+
+ /**
+ * Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.
+ *
+ * @param {OrientedBoundingBox} orientedBoundingBox The oriented bounding box.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.fromOrientedBoundingBox = function (
+ orientedBoundingBox,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("orientedBoundingBox", orientedBoundingBox);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ const halfAxes = orientedBoundingBox.halfAxes;
+ const u = Matrix3.Matrix3.getColumn(halfAxes, 0, fromOrientedBoundingBoxScratchU);
+ const v = Matrix3.Matrix3.getColumn(halfAxes, 1, fromOrientedBoundingBoxScratchV);
+ const w = Matrix3.Matrix3.getColumn(halfAxes, 2, fromOrientedBoundingBoxScratchW);
+
+ Matrix3.Cartesian3.add(u, v, u);
+ Matrix3.Cartesian3.add(u, w, u);
+
+ result.center = Matrix3.Cartesian3.clone(orientedBoundingBox.center, result.center);
+ result.radius = Matrix3.Cartesian3.magnitude(u);
+
+ return result;
+ };
+
+ const scratchFromTransformationCenter = new Matrix3.Cartesian3();
+ const scratchFromTransformationScale = new Matrix3.Cartesian3();
+
+ /**
+ * Computes a tight-fitting bounding sphere enclosing the provided affine transformation.
+ *
+ * @param {Matrix4} transformation The affine transformation.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.fromTransformation = function (transformation, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("transformation", transformation);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ const center = Matrix2.Matrix4.getTranslation(
+ transformation,
+ scratchFromTransformationCenter
+ );
+ const scale = Matrix2.Matrix4.getScale(
+ transformation,
+ scratchFromTransformationScale
+ );
+ const radius = 0.5 * Matrix3.Cartesian3.magnitude(scale);
+ result.center = Matrix3.Cartesian3.clone(center, result.center);
+ result.radius = radius;
+
+ return result;
+ };
+
+ /**
+ * Duplicates a BoundingSphere instance.
+ *
+ * @param {BoundingSphere} sphere The bounding sphere to duplicate.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined)
+ */
+ BoundingSphere.clone = function (sphere, result) {
+ if (!defaultValue.defined(sphere)) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new BoundingSphere(sphere.center, sphere.radius);
+ }
+
+ result.center = Matrix3.Cartesian3.clone(sphere.center, result.center);
+ result.radius = sphere.radius;
+ return result;
+ };
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ BoundingSphere.packedLength = 4;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {BoundingSphere} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ BoundingSphere.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const center = value.center;
+ array[startingIndex++] = center.x;
+ array[startingIndex++] = center.y;
+ array[startingIndex++] = center.z;
+ array[startingIndex] = value.radius;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {BoundingSphere} [result] The object into which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.
+ */
+ BoundingSphere.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ const center = result.center;
+ center.x = array[startingIndex++];
+ center.y = array[startingIndex++];
+ center.z = array[startingIndex++];
+ result.radius = array[startingIndex];
+ return result;
+ };
+
+ const unionScratch = new Matrix3.Cartesian3();
+ const unionScratchCenter = new Matrix3.Cartesian3();
+ /**
+ * Computes a bounding sphere that contains both the left and right bounding spheres.
+ *
+ * @param {BoundingSphere} left A sphere to enclose in a bounding sphere.
+ * @param {BoundingSphere} right A sphere to enclose in a bounding sphere.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.union = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ const leftCenter = left.center;
+ const leftRadius = left.radius;
+ const rightCenter = right.center;
+ const rightRadius = right.radius;
+
+ const toRightCenter = Matrix3.Cartesian3.subtract(
+ rightCenter,
+ leftCenter,
+ unionScratch
+ );
+ const centerSeparation = Matrix3.Cartesian3.magnitude(toRightCenter);
+
+ if (leftRadius >= centerSeparation + rightRadius) {
+ // Left sphere wins.
+ left.clone(result);
+ return result;
+ }
+
+ if (rightRadius >= centerSeparation + leftRadius) {
+ // Right sphere wins.
+ right.clone(result);
+ return result;
+ }
+
+ // There are two tangent points, one on far side of each sphere.
+ const halfDistanceBetweenTangentPoints =
+ (leftRadius + centerSeparation + rightRadius) * 0.5;
+
+ // Compute the center point halfway between the two tangent points.
+ const center = Matrix3.Cartesian3.multiplyByScalar(
+ toRightCenter,
+ (-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation,
+ unionScratchCenter
+ );
+ Matrix3.Cartesian3.add(center, leftCenter, center);
+ Matrix3.Cartesian3.clone(center, result.center);
+ result.radius = halfDistanceBetweenTangentPoints;
+
+ return result;
+ };
+
+ const expandScratch = new Matrix3.Cartesian3();
+ /**
+ * Computes a bounding sphere by enlarging the provided sphere to contain the provided point.
+ *
+ * @param {BoundingSphere} sphere A sphere to expand.
+ * @param {Cartesian3} point A point to enclose in a bounding sphere.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.expand = function (sphere, point, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("sphere", sphere);
+ Check.Check.typeOf.object("point", point);
+ //>>includeEnd('debug');
+
+ result = BoundingSphere.clone(sphere, result);
+
+ const radius = Matrix3.Cartesian3.magnitude(
+ Matrix3.Cartesian3.subtract(point, result.center, expandScratch)
+ );
+ if (radius > result.radius) {
+ result.radius = radius;
+ }
+
+ return result;
+ };
+
+ /**
+ * Determines which side of a plane a sphere is located.
+ *
+ * @param {BoundingSphere} sphere The bounding sphere to test.
+ * @param {Plane} plane The plane to test against.
+ * @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
+ * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
+ * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
+ * intersects the plane.
+ */
+ BoundingSphere.intersectPlane = function (sphere, plane) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("sphere", sphere);
+ Check.Check.typeOf.object("plane", plane);
+ //>>includeEnd('debug');
+
+ const center = sphere.center;
+ const radius = sphere.radius;
+ const normal = plane.normal;
+ const distanceToPlane = Matrix3.Cartesian3.dot(normal, center) + plane.distance;
+
+ if (distanceToPlane < -radius) {
+ // The center point is negative side of the plane normal
+ return Intersect$1.OUTSIDE;
+ } else if (distanceToPlane < radius) {
+ // The center point is positive side of the plane, but radius extends beyond it; partial overlap
+ return Intersect$1.INTERSECTING;
+ }
+ return Intersect$1.INSIDE;
+ };
+
+ /**
+ * Applies a 4x4 affine transformation matrix to a bounding sphere.
+ *
+ * @param {BoundingSphere} sphere The bounding sphere to apply the transformation to.
+ * @param {Matrix4} transform The transformation matrix to apply to the bounding sphere.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.transform = function (sphere, transform, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("sphere", sphere);
+ Check.Check.typeOf.object("transform", transform);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ result.center = Matrix2.Matrix4.multiplyByPoint(
+ transform,
+ sphere.center,
+ result.center
+ );
+ result.radius = Matrix2.Matrix4.getMaximumScale(transform) * sphere.radius;
+
+ return result;
+ };
+
+ const distanceSquaredToScratch = new Matrix3.Cartesian3();
+
+ /**
+ * Computes the estimated distance squared from the closest point on a bounding sphere to a point.
+ *
+ * @param {BoundingSphere} sphere The sphere.
+ * @param {Cartesian3} cartesian The point
+ * @returns {Number} The distance squared from the bounding sphere to the point. Returns 0 if the point is inside the sphere.
+ *
+ * @example
+ * // Sort bounding spheres from back to front
+ * spheres.sort(function(a, b) {
+ * return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC);
+ * });
+ */
+ BoundingSphere.distanceSquaredTo = function (sphere, cartesian) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("sphere", sphere);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ //>>includeEnd('debug');
+
+ const diff = Matrix3.Cartesian3.subtract(
+ sphere.center,
+ cartesian,
+ distanceSquaredToScratch
+ );
+
+ const distance = Matrix3.Cartesian3.magnitude(diff) - sphere.radius;
+ if (distance <= 0.0) {
+ return 0.0;
+ }
+
+ return distance * distance;
+ };
+
+ /**
+ * Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale
+ * The transformation matrix is not verified to have a uniform scale of 1.
+ * This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}.
+ *
+ * @param {BoundingSphere} sphere The bounding sphere to apply the transformation to.
+ * @param {Matrix4} transform The transformation matrix to apply to the bounding sphere.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ *
+ * @example
+ * const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid);
+ * const boundingSphere = new Cesium.BoundingSphere();
+ * const newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix);
+ */
+ BoundingSphere.transformWithoutScale = function (sphere, transform, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("sphere", sphere);
+ Check.Check.typeOf.object("transform", transform);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new BoundingSphere();
+ }
+
+ result.center = Matrix2.Matrix4.multiplyByPoint(
+ transform,
+ sphere.center,
+ result.center
+ );
+ result.radius = sphere.radius;
+
+ return result;
+ };
+
+ const scratchCartesian3 = new Matrix3.Cartesian3();
+ /**
+ * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
+ * plus/minus the radius of the bounding sphere.
+ *
+ * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
+ * closest and farthest planes from position that intersect the bounding sphere.
+ *
+ * @param {BoundingSphere} sphere The bounding sphere to calculate the distance to.
+ * @param {Cartesian3} position The position to calculate the distance from.
+ * @param {Cartesian3} direction The direction from position.
+ * @param {Interval} [result] A Interval to store the nearest and farthest distances.
+ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction.
+ */
+ BoundingSphere.computePlaneDistances = function (
+ sphere,
+ position,
+ direction,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("sphere", sphere);
+ Check.Check.typeOf.object("position", position);
+ Check.Check.typeOf.object("direction", direction);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Interval();
+ }
+
+ const toCenter = Matrix3.Cartesian3.subtract(
+ sphere.center,
+ position,
+ scratchCartesian3
+ );
+ const mag = Matrix3.Cartesian3.dot(direction, toCenter);
+
+ result.start = mag - sphere.radius;
+ result.stop = mag + sphere.radius;
+ return result;
+ };
+
+ const projectTo2DNormalScratch = new Matrix3.Cartesian3();
+ const projectTo2DEastScratch = new Matrix3.Cartesian3();
+ const projectTo2DNorthScratch = new Matrix3.Cartesian3();
+ const projectTo2DWestScratch = new Matrix3.Cartesian3();
+ const projectTo2DSouthScratch = new Matrix3.Cartesian3();
+ const projectTo2DCartographicScratch = new Matrix3.Cartographic();
+ const projectTo2DPositionsScratch = new Array(8);
+ for (let n = 0; n < 8; ++n) {
+ projectTo2DPositionsScratch[n] = new Matrix3.Cartesian3();
+ }
+
+ const projectTo2DProjection = new GeographicProjection();
+ /**
+ * Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.
+ *
+ * @param {BoundingSphere} sphere The bounding sphere to transform to 2D.
+ * @param {Object} [projection=GeographicProjection] The projection to 2D.
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.projectTo2D = function (sphere, projection, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("sphere", sphere);
+ //>>includeEnd('debug');
+
+ projection = defaultValue.defaultValue(projection, projectTo2DProjection);
+
+ const ellipsoid = projection.ellipsoid;
+ let center = sphere.center;
+ const radius = sphere.radius;
+
+ let normal;
+ if (Matrix3.Cartesian3.equals(center, Matrix3.Cartesian3.ZERO)) {
+ // Bounding sphere is at the center. The geodetic surface normal is not
+ // defined here so pick the x-axis as a fallback.
+ normal = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_X, projectTo2DNormalScratch);
+ } else {
+ normal = ellipsoid.geodeticSurfaceNormal(center, projectTo2DNormalScratch);
+ }
+ const east = Matrix3.Cartesian3.cross(
+ Matrix3.Cartesian3.UNIT_Z,
+ normal,
+ projectTo2DEastScratch
+ );
+ Matrix3.Cartesian3.normalize(east, east);
+ const north = Matrix3.Cartesian3.cross(normal, east, projectTo2DNorthScratch);
+ Matrix3.Cartesian3.normalize(north, north);
+
+ Matrix3.Cartesian3.multiplyByScalar(normal, radius, normal);
+ Matrix3.Cartesian3.multiplyByScalar(north, radius, north);
+ Matrix3.Cartesian3.multiplyByScalar(east, radius, east);
+
+ const south = Matrix3.Cartesian3.negate(north, projectTo2DSouthScratch);
+ const west = Matrix3.Cartesian3.negate(east, projectTo2DWestScratch);
+
+ const positions = projectTo2DPositionsScratch;
+
+ // top NE corner
+ let corner = positions[0];
+ Matrix3.Cartesian3.add(normal, north, corner);
+ Matrix3.Cartesian3.add(corner, east, corner);
+
+ // top NW corner
+ corner = positions[1];
+ Matrix3.Cartesian3.add(normal, north, corner);
+ Matrix3.Cartesian3.add(corner, west, corner);
+
+ // top SW corner
+ corner = positions[2];
+ Matrix3.Cartesian3.add(normal, south, corner);
+ Matrix3.Cartesian3.add(corner, west, corner);
+
+ // top SE corner
+ corner = positions[3];
+ Matrix3.Cartesian3.add(normal, south, corner);
+ Matrix3.Cartesian3.add(corner, east, corner);
+
+ Matrix3.Cartesian3.negate(normal, normal);
+
+ // bottom NE corner
+ corner = positions[4];
+ Matrix3.Cartesian3.add(normal, north, corner);
+ Matrix3.Cartesian3.add(corner, east, corner);
+
+ // bottom NW corner
+ corner = positions[5];
+ Matrix3.Cartesian3.add(normal, north, corner);
+ Matrix3.Cartesian3.add(corner, west, corner);
+
+ // bottom SW corner
+ corner = positions[6];
+ Matrix3.Cartesian3.add(normal, south, corner);
+ Matrix3.Cartesian3.add(corner, west, corner);
+
+ // bottom SE corner
+ corner = positions[7];
+ Matrix3.Cartesian3.add(normal, south, corner);
+ Matrix3.Cartesian3.add(corner, east, corner);
+
+ const length = positions.length;
+ for (let i = 0; i < length; ++i) {
+ const position = positions[i];
+ Matrix3.Cartesian3.add(center, position, position);
+ const cartographic = ellipsoid.cartesianToCartographic(
+ position,
+ projectTo2DCartographicScratch
+ );
+ projection.project(cartographic, position);
+ }
+
+ result = BoundingSphere.fromPoints(positions, result);
+
+ // swizzle center components
+ center = result.center;
+ const x = center.x;
+ const y = center.y;
+ const z = center.z;
+ center.x = z;
+ center.y = x;
+ center.z = y;
+
+ return result;
+ };
+
+ /**
+ * Determines whether or not a sphere is hidden from view by the occluder.
+ *
+ * @param {BoundingSphere} sphere The bounding sphere surrounding the occludee object.
+ * @param {Occluder} occluder The occluder.
+ * @returns {Boolean} true
if the sphere is not visible; otherwise false
.
+ */
+ BoundingSphere.isOccluded = function (sphere, occluder) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("sphere", sphere);
+ Check.Check.typeOf.object("occluder", occluder);
+ //>>includeEnd('debug');
+ return !occluder.isBoundingSphereVisible(sphere);
+ };
+
+ /**
+ * Compares the provided BoundingSphere componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {BoundingSphere} [left] The first BoundingSphere.
+ * @param {BoundingSphere} [right] The second BoundingSphere.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ BoundingSphere.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Matrix3.Cartesian3.equals(left.center, right.center) &&
+ left.radius === right.radius)
+ );
+ };
+
+ /**
+ * Determines which side of a plane the sphere is located.
+ *
+ * @param {Plane} plane The plane to test against.
+ * @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
+ * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
+ * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
+ * intersects the plane.
+ */
+ BoundingSphere.prototype.intersectPlane = function (plane) {
+ return BoundingSphere.intersectPlane(this, plane);
+ };
+
+ /**
+ * Computes the estimated distance squared from the closest point on a bounding sphere to a point.
+ *
+ * @param {Cartesian3} cartesian The point
+ * @returns {Number} The estimated distance squared from the bounding sphere to the point.
+ *
+ * @example
+ * // Sort bounding spheres from back to front
+ * spheres.sort(function(a, b) {
+ * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);
+ * });
+ */
+ BoundingSphere.prototype.distanceSquaredTo = function (cartesian) {
+ return BoundingSphere.distanceSquaredTo(this, cartesian);
+ };
+
+ /**
+ * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction
+ * plus/minus the radius of the bounding sphere.
+ *
+ * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the
+ * closest and farthest planes from position that intersect the bounding sphere.
+ *
+ * @param {Cartesian3} position The position to calculate the distance from.
+ * @param {Cartesian3} direction The direction from position.
+ * @param {Interval} [result] A Interval to store the nearest and farthest distances.
+ * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction.
+ */
+ BoundingSphere.prototype.computePlaneDistances = function (
+ position,
+ direction,
+ result
+ ) {
+ return BoundingSphere.computePlaneDistances(
+ this,
+ position,
+ direction,
+ result
+ );
+ };
+
+ /**
+ * Determines whether or not a sphere is hidden from view by the occluder.
+ *
+ * @param {Occluder} occluder The occluder.
+ * @returns {Boolean} true
if the sphere is not visible; otherwise false
.
+ */
+ BoundingSphere.prototype.isOccluded = function (occluder) {
+ return BoundingSphere.isOccluded(this, occluder);
+ };
+
+ /**
+ * Compares this BoundingSphere against the provided BoundingSphere componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {BoundingSphere} [right] The right hand side BoundingSphere.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ BoundingSphere.prototype.equals = function (right) {
+ return BoundingSphere.equals(this, right);
+ };
+
+ /**
+ * Duplicates this BoundingSphere instance.
+ *
+ * @param {BoundingSphere} [result] The object onto which to store the result.
+ * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.
+ */
+ BoundingSphere.prototype.clone = function (result) {
+ return BoundingSphere.clone(this, result);
+ };
+
+ /**
+ * Computes the radius of the BoundingSphere.
+ * @returns {Number} The radius of the BoundingSphere.
+ */
+ BoundingSphere.prototype.volume = function () {
+ const radius = this.radius;
+ return volumeConstant * radius * radius * radius;
+ };
+
+ let _supportsFullscreen;
+ const _names = {
+ requestFullscreen: undefined,
+ exitFullscreen: undefined,
+ fullscreenEnabled: undefined,
+ fullscreenElement: undefined,
+ fullscreenchange: undefined,
+ fullscreenerror: undefined,
+ };
+
+ /**
+ * Browser-independent functions for working with the standard fullscreen API.
+ *
+ * @namespace Fullscreen
+ *
+ * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}
+ */
+ const Fullscreen = {};
+
+ Object.defineProperties(Fullscreen, {
+ /**
+ * The element that is currently fullscreen, if any. To simply check if the
+ * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.
+ * @memberof Fullscreen
+ * @type {Object}
+ * @readonly
+ */
+ element: {
+ get: function () {
+ if (!Fullscreen.supportsFullscreen()) {
+ return undefined;
+ }
+
+ return document[_names.fullscreenElement];
+ },
+ },
+
+ /**
+ * The name of the event on the document that is fired when fullscreen is
+ * entered or exited. This event name is intended for use with addEventListener.
+ * In your event handler, to determine if the browser is in fullscreen mode or not,
+ * use {@link Fullscreen#fullscreen}.
+ * @memberof Fullscreen
+ * @type {String}
+ * @readonly
+ */
+ changeEventName: {
+ get: function () {
+ if (!Fullscreen.supportsFullscreen()) {
+ return undefined;
+ }
+
+ return _names.fullscreenchange;
+ },
+ },
+
+ /**
+ * The name of the event that is fired when a fullscreen error
+ * occurs. This event name is intended for use with addEventListener.
+ * @memberof Fullscreen
+ * @type {String}
+ * @readonly
+ */
+ errorEventName: {
+ get: function () {
+ if (!Fullscreen.supportsFullscreen()) {
+ return undefined;
+ }
+
+ return _names.fullscreenerror;
+ },
+ },
+
+ /**
+ * Determine whether the browser will allow an element to be made fullscreen, or not.
+ * For example, by default, iframes cannot go fullscreen unless the containing page
+ * adds an "allowfullscreen" attribute (or prefixed equivalent).
+ * @memberof Fullscreen
+ * @type {Boolean}
+ * @readonly
+ */
+ enabled: {
+ get: function () {
+ if (!Fullscreen.supportsFullscreen()) {
+ return undefined;
+ }
+
+ return document[_names.fullscreenEnabled];
+ },
+ },
+
+ /**
+ * Determines if the browser is currently in fullscreen mode.
+ * @memberof Fullscreen
+ * @type {Boolean}
+ * @readonly
+ */
+ fullscreen: {
+ get: function () {
+ if (!Fullscreen.supportsFullscreen()) {
+ return undefined;
+ }
+
+ return Fullscreen.element !== null;
+ },
+ },
+ });
+
+ /**
+ * Detects whether the browser supports the standard fullscreen API.
+ *
+ * @returns {Boolean} true
if the browser supports the standard fullscreen API,
+ * false
otherwise.
+ */
+ Fullscreen.supportsFullscreen = function () {
+ if (defaultValue.defined(_supportsFullscreen)) {
+ return _supportsFullscreen;
+ }
+
+ _supportsFullscreen = false;
+
+ const body = document.body;
+ if (typeof body.requestFullscreen === "function") {
+ // go with the unprefixed, standard set of names
+ _names.requestFullscreen = "requestFullscreen";
+ _names.exitFullscreen = "exitFullscreen";
+ _names.fullscreenEnabled = "fullscreenEnabled";
+ _names.fullscreenElement = "fullscreenElement";
+ _names.fullscreenchange = "fullscreenchange";
+ _names.fullscreenerror = "fullscreenerror";
+ _supportsFullscreen = true;
+ return _supportsFullscreen;
+ }
+
+ //check for the correct combination of prefix plus the various names that browsers use
+ const prefixes = ["webkit", "moz", "o", "ms", "khtml"];
+ let name;
+ for (let i = 0, len = prefixes.length; i < len; ++i) {
+ const prefix = prefixes[i];
+
+ // casing of Fullscreen differs across browsers
+ name = `${prefix}RequestFullscreen`;
+ if (typeof body[name] === "function") {
+ _names.requestFullscreen = name;
+ _supportsFullscreen = true;
+ } else {
+ name = `${prefix}RequestFullScreen`;
+ if (typeof body[name] === "function") {
+ _names.requestFullscreen = name;
+ _supportsFullscreen = true;
+ }
+ }
+
+ // disagreement about whether it's "exit" as per spec, or "cancel"
+ name = `${prefix}ExitFullscreen`;
+ if (typeof document[name] === "function") {
+ _names.exitFullscreen = name;
+ } else {
+ name = `${prefix}CancelFullScreen`;
+ if (typeof document[name] === "function") {
+ _names.exitFullscreen = name;
+ }
+ }
+
+ // casing of Fullscreen differs across browsers
+ name = `${prefix}FullscreenEnabled`;
+ if (document[name] !== undefined) {
+ _names.fullscreenEnabled = name;
+ } else {
+ name = `${prefix}FullScreenEnabled`;
+ if (document[name] !== undefined) {
+ _names.fullscreenEnabled = name;
+ }
+ }
+
+ // casing of Fullscreen differs across browsers
+ name = `${prefix}FullscreenElement`;
+ if (document[name] !== undefined) {
+ _names.fullscreenElement = name;
+ } else {
+ name = `${prefix}FullScreenElement`;
+ if (document[name] !== undefined) {
+ _names.fullscreenElement = name;
+ }
+ }
+
+ // thankfully, event names are all lowercase per spec
+ name = `${prefix}fullscreenchange`;
+ // event names do not have 'on' in the front, but the property on the document does
+ if (document[`on${name}`] !== undefined) {
+ //except on IE
+ if (prefix === "ms") {
+ name = "MSFullscreenChange";
+ }
+ _names.fullscreenchange = name;
+ }
+
+ name = `${prefix}fullscreenerror`;
+ if (document[`on${name}`] !== undefined) {
+ //except on IE
+ if (prefix === "ms") {
+ name = "MSFullscreenError";
+ }
+ _names.fullscreenerror = name;
+ }
+ }
+
+ return _supportsFullscreen;
+ };
+
+ /**
+ * Asynchronously requests the browser to enter fullscreen mode on the given element.
+ * If fullscreen mode is not supported by the browser, does nothing.
+ *
+ * @param {Object} element The HTML element which will be placed into fullscreen mode.
+ * @param {Object} [vrDevice] The HMDVRDevice device.
+ *
+ * @example
+ * // Put the entire page into fullscreen.
+ * Cesium.Fullscreen.requestFullscreen(document.body)
+ *
+ * // Place only the Cesium canvas into fullscreen.
+ * Cesium.Fullscreen.requestFullscreen(scene.canvas)
+ */
+ Fullscreen.requestFullscreen = function (element, vrDevice) {
+ if (!Fullscreen.supportsFullscreen()) {
+ return;
+ }
+
+ element[_names.requestFullscreen]({ vrDisplay: vrDevice });
+ };
+
+ /**
+ * Asynchronously exits fullscreen mode. If the browser is not currently
+ * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.
+ */
+ Fullscreen.exitFullscreen = function () {
+ if (!Fullscreen.supportsFullscreen()) {
+ return;
+ }
+
+ document[_names.exitFullscreen]();
+ };
+
+ //For unit tests
+ Fullscreen._names = _names;
+ var Fullscreen$1 = Fullscreen;
+
+ let theNavigator;
+ if (typeof navigator !== "undefined") {
+ theNavigator = navigator;
+ } else {
+ theNavigator = {};
+ }
+
+ function extractVersion(versionString) {
+ const parts = versionString.split(".");
+ for (let i = 0, len = parts.length; i < len; ++i) {
+ parts[i] = parseInt(parts[i], 10);
+ }
+ return parts;
+ }
+
+ let isChromeResult;
+ let chromeVersionResult;
+ function isChrome() {
+ if (!defaultValue.defined(isChromeResult)) {
+ isChromeResult = false;
+ // Edge contains Chrome in the user agent too
+ if (!isEdge()) {
+ const fields = / Chrome\/([\.0-9]+)/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isChromeResult = true;
+ chromeVersionResult = extractVersion(fields[1]);
+ }
+ }
+ }
+
+ return isChromeResult;
+ }
+
+ function chromeVersion() {
+ return isChrome() && chromeVersionResult;
+ }
+
+ let isSafariResult;
+ let safariVersionResult;
+ function isSafari() {
+ if (!defaultValue.defined(isSafariResult)) {
+ isSafariResult = false;
+
+ // Chrome and Edge contain Safari in the user agent too
+ if (
+ !isChrome() &&
+ !isEdge() &&
+ / Safari\/[\.0-9]+/.test(theNavigator.userAgent)
+ ) {
+ const fields = / Version\/([\.0-9]+)/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isSafariResult = true;
+ safariVersionResult = extractVersion(fields[1]);
+ }
+ }
+ }
+
+ return isSafariResult;
+ }
+
+ function safariVersion() {
+ return isSafari() && safariVersionResult;
+ }
+
+ let isWebkitResult;
+ let webkitVersionResult;
+ function isWebkit() {
+ if (!defaultValue.defined(isWebkitResult)) {
+ isWebkitResult = false;
+
+ const fields = / AppleWebKit\/([\.0-9]+)(\+?)/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isWebkitResult = true;
+ webkitVersionResult = extractVersion(fields[1]);
+ webkitVersionResult.isNightly = !!fields[2];
+ }
+ }
+
+ return isWebkitResult;
+ }
+
+ function webkitVersion() {
+ return isWebkit() && webkitVersionResult;
+ }
+
+ let isInternetExplorerResult;
+ let internetExplorerVersionResult;
+ function isInternetExplorer() {
+ if (!defaultValue.defined(isInternetExplorerResult)) {
+ isInternetExplorerResult = false;
+
+ let fields;
+ if (theNavigator.appName === "Microsoft Internet Explorer") {
+ fields = /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isInternetExplorerResult = true;
+ internetExplorerVersionResult = extractVersion(fields[1]);
+ }
+ } else if (theNavigator.appName === "Netscape") {
+ fields = /Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(
+ theNavigator.userAgent
+ );
+ if (fields !== null) {
+ isInternetExplorerResult = true;
+ internetExplorerVersionResult = extractVersion(fields[1]);
+ }
+ }
+ }
+ return isInternetExplorerResult;
+ }
+
+ function internetExplorerVersion() {
+ return isInternetExplorer() && internetExplorerVersionResult;
+ }
+
+ let isEdgeResult;
+ let edgeVersionResult;
+ function isEdge() {
+ if (!defaultValue.defined(isEdgeResult)) {
+ isEdgeResult = false;
+ const fields = / Edg\/([\.0-9]+)/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isEdgeResult = true;
+ edgeVersionResult = extractVersion(fields[1]);
+ }
+ }
+ return isEdgeResult;
+ }
+
+ function edgeVersion() {
+ return isEdge() && edgeVersionResult;
+ }
+
+ let isFirefoxResult;
+ let firefoxVersionResult;
+ function isFirefox() {
+ if (!defaultValue.defined(isFirefoxResult)) {
+ isFirefoxResult = false;
+
+ const fields = /Firefox\/([\.0-9]+)/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isFirefoxResult = true;
+ firefoxVersionResult = extractVersion(fields[1]);
+ }
+ }
+ return isFirefoxResult;
+ }
+
+ let isWindowsResult;
+ function isWindows() {
+ if (!defaultValue.defined(isWindowsResult)) {
+ isWindowsResult = /Windows/i.test(theNavigator.appVersion);
+ }
+ return isWindowsResult;
+ }
+
+ let isIPadOrIOSResult;
+ function isIPadOrIOS() {
+ if (!defaultValue.defined(isIPadOrIOSResult)) {
+ isIPadOrIOSResult =
+ navigator.platform === "iPhone" ||
+ navigator.platform === "iPod" ||
+ navigator.platform === "iPad";
+ }
+
+ return isIPadOrIOSResult;
+ }
+
+ function firefoxVersion() {
+ return isFirefox() && firefoxVersionResult;
+ }
+
+ let hasPointerEvents;
+ function supportsPointerEvents() {
+ if (!defaultValue.defined(hasPointerEvents)) {
+ //While navigator.pointerEnabled is deprecated in the W3C specification
+ //we still need to use it if it exists in order to support browsers
+ //that rely on it, such as the Windows WebBrowser control which defines
+ //PointerEvent but sets navigator.pointerEnabled to false.
+
+ //Firefox disabled because of https://github.com/CesiumGS/cesium/issues/6372
+ hasPointerEvents =
+ !isFirefox() &&
+ typeof PointerEvent !== "undefined" &&
+ (!defaultValue.defined(theNavigator.pointerEnabled) || theNavigator.pointerEnabled);
+ }
+ return hasPointerEvents;
+ }
+
+ let imageRenderingValueResult;
+ let supportsImageRenderingPixelatedResult;
+ function supportsImageRenderingPixelated() {
+ if (!defaultValue.defined(supportsImageRenderingPixelatedResult)) {
+ const canvas = document.createElement("canvas");
+ canvas.setAttribute(
+ "style",
+ "image-rendering: -moz-crisp-edges;" + "image-rendering: pixelated;"
+ );
+ //canvas.style.imageRendering will be undefined, null or an empty string on unsupported browsers.
+ const tmp = canvas.style.imageRendering;
+ supportsImageRenderingPixelatedResult = defaultValue.defined(tmp) && tmp !== "";
+ if (supportsImageRenderingPixelatedResult) {
+ imageRenderingValueResult = tmp;
+ }
+ }
+ return supportsImageRenderingPixelatedResult;
+ }
+
+ function imageRenderingValue() {
+ return supportsImageRenderingPixelated()
+ ? imageRenderingValueResult
+ : undefined;
+ }
+
+ function supportsWebP() {
+ //>>includeStart('debug', pragmas.debug);
+ if (!supportsWebP.initialized) {
+ throw new Check.DeveloperError(
+ "You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP"
+ );
+ }
+ //>>includeEnd('debug');
+ return supportsWebP._result;
+ }
+ supportsWebP._promise = undefined;
+ supportsWebP._result = undefined;
+ supportsWebP.initialize = function () {
+ // From https://developers.google.com/speed/webp/faq#how_can_i_detect_browser_support_for_webp
+ if (defaultValue.defined(supportsWebP._promise)) {
+ return supportsWebP._promise;
+ }
+
+ supportsWebP._promise = new Promise((resolve) => {
+ const image = new Image();
+ image.onload = function () {
+ supportsWebP._result = image.width > 0 && image.height > 0;
+ resolve(supportsWebP._result);
+ };
+
+ image.onerror = function () {
+ supportsWebP._result = false;
+ resolve(supportsWebP._result);
+ };
+ image.src =
+ "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA";
+ });
+
+ return supportsWebP._promise;
+ };
+ Object.defineProperties(supportsWebP, {
+ initialized: {
+ get: function () {
+ return defaultValue.defined(supportsWebP._result);
+ },
+ },
+ });
+
+ const typedArrayTypes = [];
+ if (typeof ArrayBuffer !== "undefined") {
+ typedArrayTypes.push(
+ Int8Array,
+ Uint8Array,
+ Int16Array,
+ Uint16Array,
+ Int32Array,
+ Uint32Array,
+ Float32Array,
+ Float64Array
+ );
+
+ if (typeof Uint8ClampedArray !== "undefined") {
+ typedArrayTypes.push(Uint8ClampedArray);
+ }
+
+ if (typeof Uint8ClampedArray !== "undefined") {
+ typedArrayTypes.push(Uint8ClampedArray);
+ }
+
+ if (typeof BigInt64Array !== "undefined") {
+ // eslint-disable-next-line no-undef
+ typedArrayTypes.push(BigInt64Array);
+ }
+
+ if (typeof BigUint64Array !== "undefined") {
+ // eslint-disable-next-line no-undef
+ typedArrayTypes.push(BigUint64Array);
+ }
+ }
+
+ /**
+ * A set of functions to detect whether the current browser supports
+ * various features.
+ *
+ * @namespace FeatureDetection
+ */
+ const FeatureDetection = {
+ isChrome: isChrome,
+ chromeVersion: chromeVersion,
+ isSafari: isSafari,
+ safariVersion: safariVersion,
+ isWebkit: isWebkit,
+ webkitVersion: webkitVersion,
+ isInternetExplorer: isInternetExplorer,
+ internetExplorerVersion: internetExplorerVersion,
+ isEdge: isEdge,
+ edgeVersion: edgeVersion,
+ isFirefox: isFirefox,
+ firefoxVersion: firefoxVersion,
+ isWindows: isWindows,
+ isIPadOrIOS: isIPadOrIOS,
+ hardwareConcurrency: defaultValue.defaultValue(theNavigator.hardwareConcurrency, 3),
+ supportsPointerEvents: supportsPointerEvents,
+ supportsImageRenderingPixelated: supportsImageRenderingPixelated,
+ supportsWebP: supportsWebP,
+ imageRenderingValue: imageRenderingValue,
+ typedArrayTypes: typedArrayTypes,
+ };
+
+ /**
+ * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.
+ *
+ * @param {Scene} scene
+ * @returns {Boolean} true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.
+ */
+ FeatureDetection.supportsBasis = function (scene) {
+ return FeatureDetection.supportsWebAssembly() && scene.context.supportsBasis;
+ };
+
+ /**
+ * Detects whether the current browser supports the full screen standard.
+ *
+ * @returns {Boolean} true if the browser supports the full screen standard, false if not.
+ *
+ * @see Fullscreen
+ * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}
+ */
+ FeatureDetection.supportsFullscreen = function () {
+ return Fullscreen$1.supportsFullscreen();
+ };
+
+ /**
+ * Detects whether the current browser supports typed arrays.
+ *
+ * @returns {Boolean} true if the browser supports typed arrays, false if not.
+ *
+ * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}
+ */
+ FeatureDetection.supportsTypedArrays = function () {
+ return typeof ArrayBuffer !== "undefined";
+ };
+
+ /**
+ * Detects whether the current browser supports BigInt64Array typed arrays.
+ *
+ * @returns {Boolean} true if the browser supports BigInt64Array typed arrays, false if not.
+ *
+ * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}
+ */
+ FeatureDetection.supportsBigInt64Array = function () {
+ return typeof BigInt64Array !== "undefined";
+ };
+
+ /**
+ * Detects whether the current browser supports BigUint64Array typed arrays.
+ *
+ * @returns {Boolean} true if the browser supports BigUint64Array typed arrays, false if not.
+ *
+ * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}
+ */
+ FeatureDetection.supportsBigUint64Array = function () {
+ return typeof BigUint64Array !== "undefined";
+ };
+
+ /**
+ * Detects whether the current browser supports BigInt.
+ *
+ * @returns {Boolean} true if the browser supports BigInt, false if not.
+ *
+ * @see {@link https://tc39.es/ecma262/#sec-bigint-objects|BigInt Specification}
+ */
+ FeatureDetection.supportsBigInt = function () {
+ return typeof BigInt !== "undefined";
+ };
+
+ /**
+ * Detects whether the current browser supports Web Workers.
+ *
+ * @returns {Boolean} true if the browsers supports Web Workers, false if not.
+ *
+ * @see {@link http://www.w3.org/TR/workers/}
+ */
+ FeatureDetection.supportsWebWorkers = function () {
+ return typeof Worker !== "undefined";
+ };
+
+ /**
+ * Detects whether the current browser supports Web Assembly.
+ *
+ * @returns {Boolean} true if the browsers supports Web Assembly, false if not.
+ *
+ * @see {@link https://developer.mozilla.org/en-US/docs/WebAssembly}
+ */
+ FeatureDetection.supportsWebAssembly = function () {
+ return typeof WebAssembly !== "undefined";
+ };
+ var FeatureDetection$1 = FeatureDetection;
+
+ /**
+ * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
+ * @alias Quaternion
+ * @constructor
+ *
+ * @param {Number} [x=0.0] The X component.
+ * @param {Number} [y=0.0] The Y component.
+ * @param {Number} [z=0.0] The Z component.
+ * @param {Number} [w=0.0] The W component.
+ *
+ * @see PackableForInterpolation
+ */
+ function Quaternion(x, y, z, w) {
+ /**
+ * The X component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.x = defaultValue.defaultValue(x, 0.0);
+
+ /**
+ * The Y component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.y = defaultValue.defaultValue(y, 0.0);
+
+ /**
+ * The Z component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.z = defaultValue.defaultValue(z, 0.0);
+
+ /**
+ * The W component.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.w = defaultValue.defaultValue(w, 0.0);
+ }
+
+ let fromAxisAngleScratch = new Matrix3.Cartesian3();
+
+ /**
+ * Computes a quaternion representing a rotation around an axis.
+ *
+ * @param {Cartesian3} axis The axis of rotation.
+ * @param {Number} angle The angle in radians to rotate around the axis.
+ * @param {Quaternion} [result] The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.
+ */
+ Quaternion.fromAxisAngle = function (axis, angle, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("axis", axis);
+ Check.Check.typeOf.number("angle", angle);
+ //>>includeEnd('debug');
+
+ const halfAngle = angle / 2.0;
+ const s = Math.sin(halfAngle);
+ fromAxisAngleScratch = Matrix3.Cartesian3.normalize(axis, fromAxisAngleScratch);
+
+ const x = fromAxisAngleScratch.x * s;
+ const y = fromAxisAngleScratch.y * s;
+ const z = fromAxisAngleScratch.z * s;
+ const w = Math.cos(halfAngle);
+ if (!defaultValue.defined(result)) {
+ return new Quaternion(x, y, z, w);
+ }
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+ };
+
+ const fromRotationMatrixNext = [1, 2, 0];
+ const fromRotationMatrixQuat = new Array(3);
+ /**
+ * Computes a Quaternion from the provided Matrix3 instance.
+ *
+ * @param {Matrix3} matrix The rotation matrix.
+ * @param {Quaternion} [result] The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.
+ *
+ * @see Matrix3.fromQuaternion
+ */
+ Quaternion.fromRotationMatrix = function (matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("matrix", matrix);
+ //>>includeEnd('debug');
+
+ let root;
+ let x;
+ let y;
+ let z;
+ let w;
+
+ const m00 = matrix[Matrix3.Matrix3.COLUMN0ROW0];
+ const m11 = matrix[Matrix3.Matrix3.COLUMN1ROW1];
+ const m22 = matrix[Matrix3.Matrix3.COLUMN2ROW2];
+ const trace = m00 + m11 + m22;
+
+ if (trace > 0.0) {
+ // |w| > 1/2, may as well choose w > 1/2
+ root = Math.sqrt(trace + 1.0); // 2w
+ w = 0.5 * root;
+ root = 0.5 / root; // 1/(4w)
+
+ x = (matrix[Matrix3.Matrix3.COLUMN1ROW2] - matrix[Matrix3.Matrix3.COLUMN2ROW1]) * root;
+ y = (matrix[Matrix3.Matrix3.COLUMN2ROW0] - matrix[Matrix3.Matrix3.COLUMN0ROW2]) * root;
+ z = (matrix[Matrix3.Matrix3.COLUMN0ROW1] - matrix[Matrix3.Matrix3.COLUMN1ROW0]) * root;
+ } else {
+ // |w| <= 1/2
+ const next = fromRotationMatrixNext;
+
+ let i = 0;
+ if (m11 > m00) {
+ i = 1;
+ }
+ if (m22 > m00 && m22 > m11) {
+ i = 2;
+ }
+ const j = next[i];
+ const k = next[j];
+
+ root = Math.sqrt(
+ matrix[Matrix3.Matrix3.getElementIndex(i, i)] -
+ matrix[Matrix3.Matrix3.getElementIndex(j, j)] -
+ matrix[Matrix3.Matrix3.getElementIndex(k, k)] +
+ 1.0
+ );
+
+ const quat = fromRotationMatrixQuat;
+ quat[i] = 0.5 * root;
+ root = 0.5 / root;
+ w =
+ (matrix[Matrix3.Matrix3.getElementIndex(k, j)] -
+ matrix[Matrix3.Matrix3.getElementIndex(j, k)]) *
+ root;
+ quat[j] =
+ (matrix[Matrix3.Matrix3.getElementIndex(j, i)] +
+ matrix[Matrix3.Matrix3.getElementIndex(i, j)]) *
+ root;
+ quat[k] =
+ (matrix[Matrix3.Matrix3.getElementIndex(k, i)] +
+ matrix[Matrix3.Matrix3.getElementIndex(i, k)]) *
+ root;
+
+ x = -quat[0];
+ y = -quat[1];
+ z = -quat[2];
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Quaternion(x, y, z, w);
+ }
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+ };
+
+ const scratchHPRQuaternion$1 = new Quaternion();
+ let scratchHeadingQuaternion = new Quaternion();
+ let scratchPitchQuaternion = new Quaternion();
+ let scratchRollQuaternion = new Quaternion();
+
+ /**
+ * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the
+ * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
+ * the positive x axis.
+ *
+ * @param {HeadingPitchRoll} headingPitchRoll The rotation expressed as a heading, pitch and roll.
+ * @param {Quaternion} [result] The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided.
+ */
+ Quaternion.fromHeadingPitchRoll = function (headingPitchRoll, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("headingPitchRoll", headingPitchRoll);
+ //>>includeEnd('debug');
+
+ scratchRollQuaternion = Quaternion.fromAxisAngle(
+ Matrix3.Cartesian3.UNIT_X,
+ headingPitchRoll.roll,
+ scratchHPRQuaternion$1
+ );
+ scratchPitchQuaternion = Quaternion.fromAxisAngle(
+ Matrix3.Cartesian3.UNIT_Y,
+ -headingPitchRoll.pitch,
+ result
+ );
+ result = Quaternion.multiply(
+ scratchPitchQuaternion,
+ scratchRollQuaternion,
+ scratchPitchQuaternion
+ );
+ scratchHeadingQuaternion = Quaternion.fromAxisAngle(
+ Matrix3.Cartesian3.UNIT_Z,
+ -headingPitchRoll.heading,
+ scratchHPRQuaternion$1
+ );
+ return Quaternion.multiply(scratchHeadingQuaternion, result, result);
+ };
+
+ const sampledQuaternionAxis = new Matrix3.Cartesian3();
+ const sampledQuaternionRotation = new Matrix3.Cartesian3();
+ const sampledQuaternionTempQuaternion = new Quaternion();
+ const sampledQuaternionQuaternion0 = new Quaternion();
+ const sampledQuaternionQuaternion0Conjugate = new Quaternion();
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ Quaternion.packedLength = 4;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {Quaternion} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ Quaternion.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value.x;
+ array[startingIndex++] = value.y;
+ array[startingIndex++] = value.z;
+ array[startingIndex] = value.w;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {Quaternion} [result] The object into which to store the result.
+ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.
+ */
+ Quaternion.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new Quaternion();
+ }
+ result.x = array[startingIndex];
+ result.y = array[startingIndex + 1];
+ result.z = array[startingIndex + 2];
+ result.w = array[startingIndex + 3];
+ return result;
+ };
+
+ /**
+ * The number of elements used to store the object into an array in its interpolatable form.
+ * @type {Number}
+ */
+ Quaternion.packedInterpolationLength = 3;
+
+ /**
+ * Converts a packed array into a form suitable for interpolation.
+ *
+ * @param {Number[]} packedArray The packed array.
+ * @param {Number} [startingIndex=0] The index of the first element to be converted.
+ * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted.
+ * @param {Number[]} [result] The object into which to store the result.
+ */
+ Quaternion.convertPackedArrayForInterpolation = function (
+ packedArray,
+ startingIndex,
+ lastIndex,
+ result
+ ) {
+ Quaternion.unpack(
+ packedArray,
+ lastIndex * 4,
+ sampledQuaternionQuaternion0Conjugate
+ );
+ Quaternion.conjugate(
+ sampledQuaternionQuaternion0Conjugate,
+ sampledQuaternionQuaternion0Conjugate
+ );
+
+ for (let i = 0, len = lastIndex - startingIndex + 1; i < len; i++) {
+ const offset = i * 3;
+ Quaternion.unpack(
+ packedArray,
+ (startingIndex + i) * 4,
+ sampledQuaternionTempQuaternion
+ );
+
+ Quaternion.multiply(
+ sampledQuaternionTempQuaternion,
+ sampledQuaternionQuaternion0Conjugate,
+ sampledQuaternionTempQuaternion
+ );
+
+ if (sampledQuaternionTempQuaternion.w < 0) {
+ Quaternion.negate(
+ sampledQuaternionTempQuaternion,
+ sampledQuaternionTempQuaternion
+ );
+ }
+
+ Quaternion.computeAxis(
+ sampledQuaternionTempQuaternion,
+ sampledQuaternionAxis
+ );
+ const angle = Quaternion.computeAngle(sampledQuaternionTempQuaternion);
+ if (!defaultValue.defined(result)) {
+ result = [];
+ }
+ result[offset] = sampledQuaternionAxis.x * angle;
+ result[offset + 1] = sampledQuaternionAxis.y * angle;
+ result[offset + 2] = sampledQuaternionAxis.z * angle;
+ }
+ };
+
+ /**
+ * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.
+ *
+ * @param {Number[]} array The array previously packed for interpolation.
+ * @param {Number[]} sourceArray The original packed array.
+ * @param {Number} [firstIndex=0] The firstIndex used to convert the array.
+ * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array.
+ * @param {Quaternion} [result] The object into which to store the result.
+ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.
+ */
+ Quaternion.unpackInterpolationResult = function (
+ array,
+ sourceArray,
+ firstIndex,
+ lastIndex,
+ result
+ ) {
+ if (!defaultValue.defined(result)) {
+ result = new Quaternion();
+ }
+ Matrix3.Cartesian3.fromArray(array, 0, sampledQuaternionRotation);
+ const magnitude = Matrix3.Cartesian3.magnitude(sampledQuaternionRotation);
+
+ Quaternion.unpack(sourceArray, lastIndex * 4, sampledQuaternionQuaternion0);
+
+ if (magnitude === 0) {
+ Quaternion.clone(Quaternion.IDENTITY, sampledQuaternionTempQuaternion);
+ } else {
+ Quaternion.fromAxisAngle(
+ sampledQuaternionRotation,
+ magnitude,
+ sampledQuaternionTempQuaternion
+ );
+ }
+
+ return Quaternion.multiply(
+ sampledQuaternionTempQuaternion,
+ sampledQuaternionQuaternion0,
+ result
+ );
+ };
+
+ /**
+ * Duplicates a Quaternion instance.
+ *
+ * @param {Quaternion} quaternion The quaternion to duplicate.
+ * @param {Quaternion} [result] The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)
+ */
+ Quaternion.clone = function (quaternion, result) {
+ if (!defaultValue.defined(quaternion)) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Quaternion(
+ quaternion.x,
+ quaternion.y,
+ quaternion.z,
+ quaternion.w
+ );
+ }
+
+ result.x = quaternion.x;
+ result.y = quaternion.y;
+ result.z = quaternion.z;
+ result.w = quaternion.w;
+ return result;
+ };
+
+ /**
+ * Computes the conjugate of the provided quaternion.
+ *
+ * @param {Quaternion} quaternion The quaternion to conjugate.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.conjugate = function (quaternion, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("quaternion", quaternion);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = -quaternion.x;
+ result.y = -quaternion.y;
+ result.z = -quaternion.z;
+ result.w = quaternion.w;
+ return result;
+ };
+
+ /**
+ * Computes magnitude squared for the provided quaternion.
+ *
+ * @param {Quaternion} quaternion The quaternion to conjugate.
+ * @returns {Number} The magnitude squared.
+ */
+ Quaternion.magnitudeSquared = function (quaternion) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("quaternion", quaternion);
+ //>>includeEnd('debug');
+
+ return (
+ quaternion.x * quaternion.x +
+ quaternion.y * quaternion.y +
+ quaternion.z * quaternion.z +
+ quaternion.w * quaternion.w
+ );
+ };
+
+ /**
+ * Computes magnitude for the provided quaternion.
+ *
+ * @param {Quaternion} quaternion The quaternion to conjugate.
+ * @returns {Number} The magnitude.
+ */
+ Quaternion.magnitude = function (quaternion) {
+ return Math.sqrt(Quaternion.magnitudeSquared(quaternion));
+ };
+
+ /**
+ * Computes the normalized form of the provided quaternion.
+ *
+ * @param {Quaternion} quaternion The quaternion to normalize.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.normalize = function (quaternion, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion);
+ const x = quaternion.x * inverseMagnitude;
+ const y = quaternion.y * inverseMagnitude;
+ const z = quaternion.z * inverseMagnitude;
+ const w = quaternion.w * inverseMagnitude;
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+ };
+
+ /**
+ * Computes the inverse of the provided quaternion.
+ *
+ * @param {Quaternion} quaternion The quaternion to normalize.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.inverse = function (quaternion, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const magnitudeSquared = Quaternion.magnitudeSquared(quaternion);
+ result = Quaternion.conjugate(quaternion, result);
+ return Quaternion.multiplyByScalar(result, 1.0 / magnitudeSquared, result);
+ };
+
+ /**
+ * Computes the componentwise sum of two quaternions.
+ *
+ * @param {Quaternion} left The first quaternion.
+ * @param {Quaternion} right The second quaternion.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.add = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x + right.x;
+ result.y = left.y + right.y;
+ result.z = left.z + right.z;
+ result.w = left.w + right.w;
+ return result;
+ };
+
+ /**
+ * Computes the componentwise difference of two quaternions.
+ *
+ * @param {Quaternion} left The first quaternion.
+ * @param {Quaternion} right The second quaternion.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.subtract = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = left.x - right.x;
+ result.y = left.y - right.y;
+ result.z = left.z - right.z;
+ result.w = left.w - right.w;
+ return result;
+ };
+
+ /**
+ * Negates the provided quaternion.
+ *
+ * @param {Quaternion} quaternion The quaternion to be negated.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.negate = function (quaternion, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("quaternion", quaternion);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = -quaternion.x;
+ result.y = -quaternion.y;
+ result.z = -quaternion.z;
+ result.w = -quaternion.w;
+ return result;
+ };
+
+ /**
+ * Computes the dot (scalar) product of two quaternions.
+ *
+ * @param {Quaternion} left The first quaternion.
+ * @param {Quaternion} right The second quaternion.
+ * @returns {Number} The dot product.
+ */
+ Quaternion.dot = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ //>>includeEnd('debug');
+
+ return (
+ left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w
+ );
+ };
+
+ /**
+ * Computes the product of two quaternions.
+ *
+ * @param {Quaternion} left The first quaternion.
+ * @param {Quaternion} right The second quaternion.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.multiply = function (left, right, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("left", left);
+ Check.Check.typeOf.object("right", right);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const leftX = left.x;
+ const leftY = left.y;
+ const leftZ = left.z;
+ const leftW = left.w;
+
+ const rightX = right.x;
+ const rightY = right.y;
+ const rightZ = right.z;
+ const rightW = right.w;
+
+ const x = leftW * rightX + leftX * rightW + leftY * rightZ - leftZ * rightY;
+ const y = leftW * rightY - leftX * rightZ + leftY * rightW + leftZ * rightX;
+ const z = leftW * rightZ + leftX * rightY - leftY * rightX + leftZ * rightW;
+ const w = leftW * rightW - leftX * rightX - leftY * rightY - leftZ * rightZ;
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+ };
+
+ /**
+ * Multiplies the provided quaternion componentwise by the provided scalar.
+ *
+ * @param {Quaternion} quaternion The quaternion to be scaled.
+ * @param {Number} scalar The scalar to multiply with.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.multiplyByScalar = function (quaternion, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("quaternion", quaternion);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = quaternion.x * scalar;
+ result.y = quaternion.y * scalar;
+ result.z = quaternion.z * scalar;
+ result.w = quaternion.w * scalar;
+ return result;
+ };
+
+ /**
+ * Divides the provided quaternion componentwise by the provided scalar.
+ *
+ * @param {Quaternion} quaternion The quaternion to be divided.
+ * @param {Number} scalar The scalar to divide by.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.divideByScalar = function (quaternion, scalar, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("quaternion", quaternion);
+ Check.Check.typeOf.number("scalar", scalar);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ result.x = quaternion.x / scalar;
+ result.y = quaternion.y / scalar;
+ result.z = quaternion.z / scalar;
+ result.w = quaternion.w / scalar;
+ return result;
+ };
+
+ /**
+ * Computes the axis of rotation of the provided quaternion.
+ *
+ * @param {Quaternion} quaternion The quaternion to use.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Quaternion.computeAxis = function (quaternion, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("quaternion", quaternion);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const w = quaternion.w;
+ if (Math.abs(w - 1.0) < Math$1.CesiumMath.EPSILON6) {
+ result.x = result.y = result.z = 0;
+ return result;
+ }
+
+ const scalar = 1.0 / Math.sqrt(1.0 - w * w);
+
+ result.x = quaternion.x * scalar;
+ result.y = quaternion.y * scalar;
+ result.z = quaternion.z * scalar;
+ return result;
+ };
+
+ /**
+ * Computes the angle of rotation of the provided quaternion.
+ *
+ * @param {Quaternion} quaternion The quaternion to use.
+ * @returns {Number} The angle of rotation.
+ */
+ Quaternion.computeAngle = function (quaternion) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("quaternion", quaternion);
+ //>>includeEnd('debug');
+
+ if (Math.abs(quaternion.w - 1.0) < Math$1.CesiumMath.EPSILON6) {
+ return 0.0;
+ }
+ return 2.0 * Math.acos(quaternion.w);
+ };
+
+ let lerpScratch = new Quaternion();
+ /**
+ * Computes the linear interpolation or extrapolation at t using the provided quaternions.
+ *
+ * @param {Quaternion} start The value corresponding to t at 0.0.
+ * @param {Quaternion} end The value corresponding to t at 1.0.
+ * @param {Number} t The point along t at which to interpolate.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.lerp = function (start, end, t, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("start", start);
+ Check.Check.typeOf.object("end", end);
+ Check.Check.typeOf.number("t", t);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch);
+ result = Quaternion.multiplyByScalar(start, 1.0 - t, result);
+ return Quaternion.add(lerpScratch, result, result);
+ };
+
+ let slerpEndNegated = new Quaternion();
+ let slerpScaledP = new Quaternion();
+ let slerpScaledR = new Quaternion();
+ /**
+ * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
+ *
+ * @param {Quaternion} start The value corresponding to t at 0.0.
+ * @param {Quaternion} end The value corresponding to t at 1.0.
+ * @param {Number} t The point along t at which to interpolate.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ *
+ * @see Quaternion#fastSlerp
+ */
+ Quaternion.slerp = function (start, end, t, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("start", start);
+ Check.Check.typeOf.object("end", end);
+ Check.Check.typeOf.number("t", t);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ let dot = Quaternion.dot(start, end);
+
+ // The angle between start must be acute. Since q and -q represent
+ // the same rotation, negate q to get the acute angle.
+ let r = end;
+ if (dot < 0.0) {
+ dot = -dot;
+ r = slerpEndNegated = Quaternion.negate(end, slerpEndNegated);
+ }
+
+ // dot > 0, as the dot product approaches 1, the angle between the
+ // quaternions vanishes. use linear interpolation.
+ if (1.0 - dot < Math$1.CesiumMath.EPSILON6) {
+ return Quaternion.lerp(start, r, t, result);
+ }
+
+ const theta = Math.acos(dot);
+ slerpScaledP = Quaternion.multiplyByScalar(
+ start,
+ Math.sin((1 - t) * theta),
+ slerpScaledP
+ );
+ slerpScaledR = Quaternion.multiplyByScalar(
+ r,
+ Math.sin(t * theta),
+ slerpScaledR
+ );
+ result = Quaternion.add(slerpScaledP, slerpScaledR, result);
+ return Quaternion.multiplyByScalar(result, 1.0 / Math.sin(theta), result);
+ };
+
+ /**
+ * The logarithmic quaternion function.
+ *
+ * @param {Quaternion} quaternion The unit quaternion.
+ * @param {Cartesian3} result The object onto which to store the result.
+ * @returns {Cartesian3} The modified result parameter.
+ */
+ Quaternion.log = function (quaternion, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("quaternion", quaternion);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const theta = Math$1.CesiumMath.acosClamped(quaternion.w);
+ let thetaOverSinTheta = 0.0;
+
+ if (theta !== 0.0) {
+ thetaOverSinTheta = theta / Math.sin(theta);
+ }
+
+ return Matrix3.Cartesian3.multiplyByScalar(quaternion, thetaOverSinTheta, result);
+ };
+
+ /**
+ * The exponential quaternion function.
+ *
+ * @param {Cartesian3} cartesian The cartesian.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ */
+ Quaternion.exp = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("cartesian", cartesian);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const theta = Matrix3.Cartesian3.magnitude(cartesian);
+ let sinThetaOverTheta = 0.0;
+
+ if (theta !== 0.0) {
+ sinThetaOverTheta = Math.sin(theta) / theta;
+ }
+
+ result.x = cartesian.x * sinThetaOverTheta;
+ result.y = cartesian.y * sinThetaOverTheta;
+ result.z = cartesian.z * sinThetaOverTheta;
+ result.w = Math.cos(theta);
+
+ return result;
+ };
+
+ const squadScratchCartesian0 = new Matrix3.Cartesian3();
+ const squadScratchCartesian1 = new Matrix3.Cartesian3();
+ const squadScratchQuaternion0 = new Quaternion();
+ const squadScratchQuaternion1 = new Quaternion();
+
+ /**
+ * Computes an inner quadrangle point.
+ * This will compute quaternions that ensure a squad curve is C1.
+ *
+ * @param {Quaternion} q0 The first quaternion.
+ * @param {Quaternion} q1 The second quaternion.
+ * @param {Quaternion} q2 The third quaternion.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ *
+ * @see Quaternion#squad
+ */
+ Quaternion.computeInnerQuadrangle = function (q0, q1, q2, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("q0", q0);
+ Check.Check.typeOf.object("q1", q1);
+ Check.Check.typeOf.object("q2", q2);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const qInv = Quaternion.conjugate(q1, squadScratchQuaternion0);
+ Quaternion.multiply(qInv, q2, squadScratchQuaternion1);
+ const cart0 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian0);
+
+ Quaternion.multiply(qInv, q0, squadScratchQuaternion1);
+ const cart1 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian1);
+
+ Matrix3.Cartesian3.add(cart0, cart1, cart0);
+ Matrix3.Cartesian3.multiplyByScalar(cart0, 0.25, cart0);
+ Matrix3.Cartesian3.negate(cart0, cart0);
+ Quaternion.exp(cart0, squadScratchQuaternion0);
+
+ return Quaternion.multiply(q1, squadScratchQuaternion0, result);
+ };
+
+ /**
+ * Computes the spherical quadrangle interpolation between quaternions.
+ *
+ * @param {Quaternion} q0 The first quaternion.
+ * @param {Quaternion} q1 The second quaternion.
+ * @param {Quaternion} s0 The first inner quadrangle.
+ * @param {Quaternion} s1 The second inner quadrangle.
+ * @param {Number} t The time in [0,1] used to interpolate.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ *
+ *
+ * @example
+ * // 1. compute the squad interpolation between two quaternions on a curve
+ * const s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());
+ * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());
+ * const q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());
+ *
+ * // 2. compute the squad interpolation as above but where the first quaternion is a end point.
+ * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());
+ * const q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());
+ *
+ * @see Quaternion#computeInnerQuadrangle
+ */
+ Quaternion.squad = function (q0, q1, s0, s1, t, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("q0", q0);
+ Check.Check.typeOf.object("q1", q1);
+ Check.Check.typeOf.object("s0", s0);
+ Check.Check.typeOf.object("s1", s1);
+ Check.Check.typeOf.number("t", t);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0);
+ const slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1);
+ return Quaternion.slerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);
+ };
+
+ const fastSlerpScratchQuaternion = new Quaternion();
+ // eslint-disable-next-line no-loss-of-precision
+ const opmu = 1.90110745351730037;
+ const u = FeatureDetection$1.supportsTypedArrays() ? new Float32Array(8) : [];
+ const v = FeatureDetection$1.supportsTypedArrays() ? new Float32Array(8) : [];
+ const bT = FeatureDetection$1.supportsTypedArrays() ? new Float32Array(8) : [];
+ const bD = FeatureDetection$1.supportsTypedArrays() ? new Float32Array(8) : [];
+
+ for (let i = 0; i < 7; ++i) {
+ const s = i + 1.0;
+ const t = 2.0 * s + 1.0;
+ u[i] = 1.0 / (s * t);
+ v[i] = s / t;
+ }
+
+ u[7] = opmu / (8.0 * 17.0);
+ v[7] = (opmu * 8.0) / 17.0;
+
+ /**
+ * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.
+ * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10-6.
+ *
+ * @param {Quaternion} start The value corresponding to t at 0.0.
+ * @param {Quaternion} end The value corresponding to t at 1.0.
+ * @param {Number} t The point along t at which to interpolate.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter.
+ *
+ * @see Quaternion#slerp
+ */
+ Quaternion.fastSlerp = function (start, end, t, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("start", start);
+ Check.Check.typeOf.object("end", end);
+ Check.Check.typeOf.number("t", t);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ let x = Quaternion.dot(start, end);
+
+ let sign;
+ if (x >= 0) {
+ sign = 1.0;
+ } else {
+ sign = -1.0;
+ x = -x;
+ }
+
+ const xm1 = x - 1.0;
+ const d = 1.0 - t;
+ const sqrT = t * t;
+ const sqrD = d * d;
+
+ for (let i = 7; i >= 0; --i) {
+ bT[i] = (u[i] * sqrT - v[i]) * xm1;
+ bD[i] = (u[i] * sqrD - v[i]) * xm1;
+ }
+
+ const cT =
+ sign *
+ t *
+ (1.0 +
+ bT[0] *
+ (1.0 +
+ bT[1] *
+ (1.0 +
+ bT[2] *
+ (1.0 +
+ bT[3] *
+ (1.0 +
+ bT[4] *
+ (1.0 + bT[5] * (1.0 + bT[6] * (1.0 + bT[7]))))))));
+ const cD =
+ d *
+ (1.0 +
+ bD[0] *
+ (1.0 +
+ bD[1] *
+ (1.0 +
+ bD[2] *
+ (1.0 +
+ bD[3] *
+ (1.0 +
+ bD[4] *
+ (1.0 + bD[5] * (1.0 + bD[6] * (1.0 + bD[7]))))))));
+
+ const temp = Quaternion.multiplyByScalar(
+ start,
+ cD,
+ fastSlerpScratchQuaternion
+ );
+ Quaternion.multiplyByScalar(end, cT, result);
+ return Quaternion.add(temp, result, result);
+ };
+
+ /**
+ * Computes the spherical quadrangle interpolation between quaternions.
+ * An implementation that is faster than {@link Quaternion#squad}, but less accurate.
+ *
+ * @param {Quaternion} q0 The first quaternion.
+ * @param {Quaternion} q1 The second quaternion.
+ * @param {Quaternion} s0 The first inner quadrangle.
+ * @param {Quaternion} s1 The second inner quadrangle.
+ * @param {Number} t The time in [0,1] used to interpolate.
+ * @param {Quaternion} result The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter or a new instance if none was provided.
+ *
+ * @see Quaternion#squad
+ */
+ Quaternion.fastSquad = function (q0, q1, s0, s1, t, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("q0", q0);
+ Check.Check.typeOf.object("q1", q1);
+ Check.Check.typeOf.object("s0", s0);
+ Check.Check.typeOf.object("s1", s1);
+ Check.Check.typeOf.number("t", t);
+ Check.Check.typeOf.object("result", result);
+ //>>includeEnd('debug');
+
+ const slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0);
+ const slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1);
+ return Quaternion.fastSlerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);
+ };
+
+ /**
+ * Compares the provided quaternions componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Quaternion} [left] The first quaternion.
+ * @param {Quaternion} [right] The second quaternion.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ Quaternion.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left.x === right.x &&
+ left.y === right.y &&
+ left.z === right.z &&
+ left.w === right.w)
+ );
+ };
+
+ /**
+ * Compares the provided quaternions componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Quaternion} [left] The first quaternion.
+ * @param {Quaternion} [right] The second quaternion.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ Quaternion.equalsEpsilon = function (left, right, epsilon) {
+ epsilon = defaultValue.defaultValue(epsilon, 0);
+
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math.abs(left.x - right.x) <= epsilon &&
+ Math.abs(left.y - right.y) <= epsilon &&
+ Math.abs(left.z - right.z) <= epsilon &&
+ Math.abs(left.w - right.w) <= epsilon)
+ );
+ };
+
+ /**
+ * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).
+ *
+ * @type {Quaternion}
+ * @constant
+ */
+ Quaternion.ZERO = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 0.0));
+
+ /**
+ * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).
+ *
+ * @type {Quaternion}
+ * @constant
+ */
+ Quaternion.IDENTITY = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 1.0));
+
+ /**
+ * Duplicates this Quaternion instance.
+ *
+ * @param {Quaternion} [result] The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.
+ */
+ Quaternion.prototype.clone = function (result) {
+ return Quaternion.clone(this, result);
+ };
+
+ /**
+ * Compares this and the provided quaternion componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {Quaternion} [right] The right hand side quaternion.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ Quaternion.prototype.equals = function (right) {
+ return Quaternion.equals(this, right);
+ };
+
+ /**
+ * Compares this and the provided quaternion componentwise and returns
+ * true
if they are within the provided epsilon,
+ * false
otherwise.
+ *
+ * @param {Quaternion} [right] The right hand side quaternion.
+ * @param {Number} [epsilon=0] The epsilon to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ Quaternion.prototype.equalsEpsilon = function (right, epsilon) {
+ return Quaternion.equalsEpsilon(this, right, epsilon);
+ };
+
+ /**
+ * Returns a string representing this quaternion in the format (x, y, z, w).
+ *
+ * @returns {String} A string representing this Quaternion.
+ */
+ Quaternion.prototype.toString = function () {
+ return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;
+ };
+
+ /**
+ * Finds an item in a sorted array.
+ *
+ * @function
+ * @param {Array} array The sorted array to search.
+ * @param {*} itemToFind The item to find in the array.
+ * @param {binarySearchComparator} comparator The function to use to compare the item to
+ * elements in the array.
+ * @returns {Number} The index of itemToFind
in the array, if it exists. If itemToFind
+ * does not exist, the return value is a negative number which is the bitwise complement (~)
+ * of the index before which the itemToFind should be inserted in order to maintain the
+ * sorted order of the array.
+ *
+ * @example
+ * // Create a comparator function to search through an array of numbers.
+ * function comparator(a, b) {
+ * return a - b;
+ * };
+ * const numbers = [0, 2, 4, 6, 8];
+ * const index = Cesium.binarySearch(numbers, 6, comparator); // 3
+ */
+ function binarySearch(array, itemToFind, comparator) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ Check.Check.defined("itemToFind", itemToFind);
+ Check.Check.defined("comparator", comparator);
+ //>>includeEnd('debug');
+
+ let low = 0;
+ let high = array.length - 1;
+ let i;
+ let comparison;
+
+ while (low <= high) {
+ i = ~~((low + high) / 2);
+ comparison = comparator(array[i], itemToFind);
+ if (comparison < 0) {
+ low = i + 1;
+ continue;
+ }
+ if (comparison > 0) {
+ high = i - 1;
+ continue;
+ }
+ return i;
+ }
+ return ~(high + 1);
+ }
+
+ /**
+ * A set of Earth Orientation Parameters (EOP) sampled at a time.
+ *
+ * @alias EarthOrientationParametersSample
+ * @constructor
+ *
+ * @param {Number} xPoleWander The pole wander about the X axis, in radians.
+ * @param {Number} yPoleWander The pole wander about the Y axis, in radians.
+ * @param {Number} xPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.
+ * @param {Number} yPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.
+ * @param {Number} ut1MinusUtc The difference in time standards, UT1 - UTC, in seconds.
+ *
+ * @private
+ */
+ function EarthOrientationParametersSample(
+ xPoleWander,
+ yPoleWander,
+ xPoleOffset,
+ yPoleOffset,
+ ut1MinusUtc
+ ) {
+ /**
+ * The pole wander about the X axis, in radians.
+ * @type {Number}
+ */
+ this.xPoleWander = xPoleWander;
+
+ /**
+ * The pole wander about the Y axis, in radians.
+ * @type {Number}
+ */
+ this.yPoleWander = yPoleWander;
+
+ /**
+ * The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.
+ * @type {Number}
+ */
+ this.xPoleOffset = xPoleOffset;
+
+ /**
+ * The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.
+ * @type {Number}
+ */
+ this.yPoleOffset = yPoleOffset;
+
+ /**
+ * The difference in time standards, UT1 - UTC, in seconds.
+ * @type {Number}
+ */
+ this.ut1MinusUtc = ut1MinusUtc;
+ }
+
+ /**
+ * Represents a Gregorian date in a more precise format than the JavaScript Date object.
+ * In addition to submillisecond precision, this object can also represent leap seconds.
+ * @alias GregorianDate
+ * @constructor
+ *
+ * @param {Number} [year] The year as a whole number.
+ * @param {Number} [month] The month as a whole number with range [1, 12].
+ * @param {Number} [day] The day of the month as a whole number starting at 1.
+ * @param {Number} [hour] The hour as a whole number with range [0, 23].
+ * @param {Number} [minute] The minute of the hour as a whole number with range [0, 59].
+ * @param {Number} [second] The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
+ * @param {Number} [millisecond] The millisecond of the second as a floating point number with range [0.0, 1000.0).
+ * @param {Boolean} [isLeapSecond] Whether this time is during a leap second.
+ *
+ * @see JulianDate#toGregorianDate
+ */
+ function GregorianDate(
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second,
+ millisecond,
+ isLeapSecond
+ ) {
+ /**
+ * Gets or sets the year as a whole number.
+ * @type {Number}
+ */
+ this.year = year;
+ /**
+ * Gets or sets the month as a whole number with range [1, 12].
+ * @type {Number}
+ */
+ this.month = month;
+ /**
+ * Gets or sets the day of the month as a whole number starting at 1.
+ * @type {Number}
+ */
+ this.day = day;
+ /**
+ * Gets or sets the hour as a whole number with range [0, 23].
+ * @type {Number}
+ */
+ this.hour = hour;
+ /**
+ * Gets or sets the minute of the hour as a whole number with range [0, 59].
+ * @type {Number}
+ */
+ this.minute = minute;
+ /**
+ * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.
+ * @type {Number}
+ */
+ this.second = second;
+ /**
+ * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).
+ * @type {Number}
+ */
+ this.millisecond = millisecond;
+ /**
+ * Gets or sets whether this time is during a leap second.
+ * @type {Boolean}
+ */
+ this.isLeapSecond = isLeapSecond;
+ }
+
+ /**
+ * Determines if a given date is a leap year.
+ *
+ * @function isLeapYear
+ *
+ * @param {Number} year The year to be tested.
+ * @returns {Boolean} True if year
is a leap year.
+ *
+ * @example
+ * const leapYear = Cesium.isLeapYear(2000); // true
+ */
+ function isLeapYear(year) {
+ //>>includeStart('debug', pragmas.debug);
+ if (year === null || isNaN(year)) {
+ throw new Check.DeveloperError("year is required and must be a number.");
+ }
+ //>>includeEnd('debug');
+
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+ }
+
+ /**
+ * Describes a single leap second, which is constructed from a {@link JulianDate} and a
+ * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.
+ * @alias LeapSecond
+ * @constructor
+ *
+ * @param {JulianDate} [date] A Julian date representing the time of the leap second.
+ * @param {Number} [offset] The cumulative number of seconds that TAI is ahead of UTC at the provided date.
+ */
+ function LeapSecond(date, offset) {
+ /**
+ * Gets or sets the date at which this leap second occurs.
+ * @type {JulianDate}
+ */
+ this.julianDate = date;
+
+ /**
+ * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time
+ * of this leap second.
+ * @type {Number}
+ */
+ this.offset = offset;
+ }
+
+ /**
+ * Constants for time conversions like those done by {@link JulianDate}.
+ *
+ * @namespace TimeConstants
+ *
+ * @see JulianDate
+ *
+ * @private
+ */
+ const TimeConstants = {
+ /**
+ * The number of seconds in one millisecond: 0.001
+ * @type {Number}
+ * @constant
+ */
+ SECONDS_PER_MILLISECOND: 0.001,
+
+ /**
+ * The number of seconds in one minute: 60
.
+ * @type {Number}
+ * @constant
+ */
+ SECONDS_PER_MINUTE: 60.0,
+
+ /**
+ * The number of minutes in one hour: 60
.
+ * @type {Number}
+ * @constant
+ */
+ MINUTES_PER_HOUR: 60.0,
+
+ /**
+ * The number of hours in one day: 24
.
+ * @type {Number}
+ * @constant
+ */
+ HOURS_PER_DAY: 24.0,
+
+ /**
+ * The number of seconds in one hour: 3600
.
+ * @type {Number}
+ * @constant
+ */
+ SECONDS_PER_HOUR: 3600.0,
+
+ /**
+ * The number of minutes in one day: 1440
.
+ * @type {Number}
+ * @constant
+ */
+ MINUTES_PER_DAY: 1440.0,
+
+ /**
+ * The number of seconds in one day, ignoring leap seconds: 86400
.
+ * @type {Number}
+ * @constant
+ */
+ SECONDS_PER_DAY: 86400.0,
+
+ /**
+ * The number of days in one Julian century: 36525
.
+ * @type {Number}
+ * @constant
+ */
+ DAYS_PER_JULIAN_CENTURY: 36525.0,
+
+ /**
+ * One trillionth of a second.
+ * @type {Number}
+ * @constant
+ */
+ PICOSECOND: 0.000000001,
+
+ /**
+ * The number of days to subtract from a Julian date to determine the
+ * modified Julian date, which gives the number of days since midnight
+ * on November 17, 1858.
+ * @type {Number}
+ * @constant
+ */
+ MODIFIED_JULIAN_DATE_DIFFERENCE: 2400000.5,
+ };
+ var TimeConstants$1 = Object.freeze(TimeConstants);
+
+ /**
+ * Provides the type of time standards which JulianDate can take as input.
+ *
+ * @enum {Number}
+ *
+ * @see JulianDate
+ */
+ const TimeStandard = {
+ /**
+ * Represents the coordinated Universal Time (UTC) time standard.
+ *
+ * UTC is related to TAI according to the relationship
+ * UTC = TAI - deltaT
where deltaT
is the number of leap
+ * seconds which have been introduced as of the time in TAI.
+ *
+ * @type {Number}
+ * @constant
+ */
+ UTC: 0,
+
+ /**
+ * Represents the International Atomic Time (TAI) time standard.
+ * TAI is the principal time standard to which the other time standards are related.
+ *
+ * @type {Number}
+ * @constant
+ */
+ TAI: 1,
+ };
+ var TimeStandard$1 = Object.freeze(TimeStandard);
+
+ const gregorianDateScratch = new GregorianDate();
+ const daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+ const daysInLeapFeburary = 29;
+
+ function compareLeapSecondDates$1(leapSecond, dateToFind) {
+ return JulianDate.compare(leapSecond.julianDate, dateToFind.julianDate);
+ }
+
+ // we don't really need a leap second instance, anything with a julianDate property will do
+ const binarySearchScratchLeapSecond = new LeapSecond();
+
+ function convertUtcToTai(julianDate) {
+ //Even though julianDate is in UTC, we'll treat it as TAI and
+ //search the leap second table for it.
+ binarySearchScratchLeapSecond.julianDate = julianDate;
+ const leapSeconds = JulianDate.leapSeconds;
+ let index = binarySearch(
+ leapSeconds,
+ binarySearchScratchLeapSecond,
+ compareLeapSecondDates$1
+ );
+
+ if (index < 0) {
+ index = ~index;
+ }
+
+ if (index >= leapSeconds.length) {
+ index = leapSeconds.length - 1;
+ }
+
+ let offset = leapSeconds[index].offset;
+ if (index > 0) {
+ //Now we have the index of the closest leap second that comes on or after our UTC time.
+ //However, if the difference between the UTC date being converted and the TAI
+ //defined leap second is greater than the offset, we are off by one and need to use
+ //the previous leap second.
+ const difference = JulianDate.secondsDifference(
+ leapSeconds[index].julianDate,
+ julianDate
+ );
+ if (difference > offset) {
+ index--;
+ offset = leapSeconds[index].offset;
+ }
+ }
+
+ JulianDate.addSeconds(julianDate, offset, julianDate);
+ }
+
+ function convertTaiToUtc(julianDate, result) {
+ binarySearchScratchLeapSecond.julianDate = julianDate;
+ const leapSeconds = JulianDate.leapSeconds;
+ let index = binarySearch(
+ leapSeconds,
+ binarySearchScratchLeapSecond,
+ compareLeapSecondDates$1
+ );
+ if (index < 0) {
+ index = ~index;
+ }
+
+ //All times before our first leap second get the first offset.
+ if (index === 0) {
+ return JulianDate.addSeconds(julianDate, -leapSeconds[0].offset, result);
+ }
+
+ //All times after our leap second get the last offset.
+ if (index >= leapSeconds.length) {
+ return JulianDate.addSeconds(
+ julianDate,
+ -leapSeconds[index - 1].offset,
+ result
+ );
+ }
+
+ //Compute the difference between the found leap second and the time we are converting.
+ const difference = JulianDate.secondsDifference(
+ leapSeconds[index].julianDate,
+ julianDate
+ );
+
+ if (difference === 0) {
+ //The date is in our leap second table.
+ return JulianDate.addSeconds(
+ julianDate,
+ -leapSeconds[index].offset,
+ result
+ );
+ }
+
+ if (difference <= 1.0) {
+ //The requested date is during the moment of a leap second, then we cannot convert to UTC
+ return undefined;
+ }
+
+ //The time is in between two leap seconds, index is the leap second after the date
+ //we're converting, so we subtract one to get the correct LeapSecond instance.
+ return JulianDate.addSeconds(
+ julianDate,
+ -leapSeconds[--index].offset,
+ result
+ );
+ }
+
+ function setComponents(wholeDays, secondsOfDay, julianDate) {
+ const extraDays = (secondsOfDay / TimeConstants$1.SECONDS_PER_DAY) | 0;
+ wholeDays += extraDays;
+ secondsOfDay -= TimeConstants$1.SECONDS_PER_DAY * extraDays;
+
+ if (secondsOfDay < 0) {
+ wholeDays--;
+ secondsOfDay += TimeConstants$1.SECONDS_PER_DAY;
+ }
+
+ julianDate.dayNumber = wholeDays;
+ julianDate.secondsOfDay = secondsOfDay;
+ return julianDate;
+ }
+
+ function computeJulianDateComponents(
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second,
+ millisecond
+ ) {
+ // Algorithm from page 604 of the Explanatory Supplement to the
+ // Astronomical Almanac (Seidelmann 1992).
+
+ const a = ((month - 14) / 12) | 0;
+ const b = year + 4800 + a;
+ let dayNumber =
+ (((1461 * b) / 4) | 0) +
+ (((367 * (month - 2 - 12 * a)) / 12) | 0) -
+ (((3 * (((b + 100) / 100) | 0)) / 4) | 0) +
+ day -
+ 32075;
+
+ // JulianDates are noon-based
+ hour = hour - 12;
+ if (hour < 0) {
+ hour += 24;
+ }
+
+ const secondsOfDay =
+ second +
+ (hour * TimeConstants$1.SECONDS_PER_HOUR +
+ minute * TimeConstants$1.SECONDS_PER_MINUTE +
+ millisecond * TimeConstants$1.SECONDS_PER_MILLISECOND);
+
+ if (secondsOfDay >= 43200.0) {
+ dayNumber -= 1;
+ }
+
+ return [dayNumber, secondsOfDay];
+ }
+
+ //Regular expressions used for ISO8601 date parsing.
+ //YYYY
+ const matchCalendarYear = /^(\d{4})$/;
+ //YYYY-MM (YYYYMM is invalid)
+ const matchCalendarMonth = /^(\d{4})-(\d{2})$/;
+ //YYYY-DDD or YYYYDDD
+ const matchOrdinalDate = /^(\d{4})-?(\d{3})$/;
+ //YYYY-Www or YYYYWww or YYYY-Www-D or YYYYWwwD
+ const matchWeekDate = /^(\d{4})-?W(\d{2})-?(\d{1})?$/;
+ //YYYY-MM-DD or YYYYMMDD
+ const matchCalendarDate = /^(\d{4})-?(\d{2})-?(\d{2})$/;
+ // Match utc offset
+ const utcOffset = /([Z+\-])?(\d{2})?:?(\d{2})?$/;
+ // Match hours HH or HH.xxxxx
+ const matchHours = /^(\d{2})(\.\d+)?/.source + utcOffset.source;
+ // Match hours/minutes HH:MM HHMM.xxxxx
+ const matchHoursMinutes = /^(\d{2}):?(\d{2})(\.\d+)?/.source + utcOffset.source;
+ // Match hours/minutes HH:MM:SS HHMMSS.xxxxx
+ const matchHoursMinutesSeconds =
+ /^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source + utcOffset.source;
+
+ const iso8601ErrorMessage = "Invalid ISO 8601 date.";
+
+ /**
+ * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).
+ * For increased precision, this class stores the whole number part of the date and the seconds
+ * part of the date in separate components. In order to be safe for arithmetic and represent
+ * leap seconds, the date is always stored in the International Atomic Time standard
+ * {@link TimeStandard.TAI}.
+ * @alias JulianDate
+ * @constructor
+ *
+ * @param {Number} [julianDayNumber=0.0] The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.
+ * @param {Number} [secondsOfDay=0.0] The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly.
+ * @param {TimeStandard} [timeStandard=TimeStandard.UTC] The time standard in which the first two parameters are defined.
+ */
+ function JulianDate(julianDayNumber, secondsOfDay, timeStandard) {
+ /**
+ * Gets or sets the number of whole days.
+ * @type {Number}
+ */
+ this.dayNumber = undefined;
+
+ /**
+ * Gets or sets the number of seconds into the current day.
+ * @type {Number}
+ */
+ this.secondsOfDay = undefined;
+
+ julianDayNumber = defaultValue.defaultValue(julianDayNumber, 0.0);
+ secondsOfDay = defaultValue.defaultValue(secondsOfDay, 0.0);
+ timeStandard = defaultValue.defaultValue(timeStandard, TimeStandard$1.UTC);
+
+ //If julianDayNumber is fractional, make it an integer and add the number of seconds the fraction represented.
+ const wholeDays = julianDayNumber | 0;
+ secondsOfDay =
+ secondsOfDay +
+ (julianDayNumber - wholeDays) * TimeConstants$1.SECONDS_PER_DAY;
+
+ setComponents(wholeDays, secondsOfDay, this);
+
+ if (timeStandard === TimeStandard$1.UTC) {
+ convertUtcToTai(this);
+ }
+ }
+
+ /**
+ * Creates a new instance from a GregorianDate.
+ *
+ * @param {GregorianDate} date A GregorianDate.
+ * @param {JulianDate} [result] An existing instance to use for the result.
+ * @returns {JulianDate} The modified result parameter or a new instance if none was provided.
+ *
+ * @exception {DeveloperError} date must be a valid GregorianDate.
+ */
+ JulianDate.fromGregorianDate = function (date, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!(date instanceof GregorianDate)) {
+ throw new Check.DeveloperError("date must be a valid GregorianDate.");
+ }
+ //>>includeEnd('debug');
+
+ const components = computeJulianDateComponents(
+ date.year,
+ date.month,
+ date.day,
+ date.hour,
+ date.minute,
+ date.second,
+ date.millisecond
+ );
+ if (!defaultValue.defined(result)) {
+ return new JulianDate(components[0], components[1], TimeStandard$1.UTC);
+ }
+ setComponents(components[0], components[1], result);
+ convertUtcToTai(result);
+ return result;
+ };
+
+ /**
+ * Creates a new instance from a JavaScript Date.
+ *
+ * @param {Date} date A JavaScript Date.
+ * @param {JulianDate} [result] An existing instance to use for the result.
+ * @returns {JulianDate} The modified result parameter or a new instance if none was provided.
+ *
+ * @exception {DeveloperError} date must be a valid JavaScript Date.
+ */
+ JulianDate.fromDate = function (date, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!(date instanceof Date) || isNaN(date.getTime())) {
+ throw new Check.DeveloperError("date must be a valid JavaScript Date.");
+ }
+ //>>includeEnd('debug');
+
+ const components = computeJulianDateComponents(
+ date.getUTCFullYear(),
+ date.getUTCMonth() + 1,
+ date.getUTCDate(),
+ date.getUTCHours(),
+ date.getUTCMinutes(),
+ date.getUTCSeconds(),
+ date.getUTCMilliseconds()
+ );
+ if (!defaultValue.defined(result)) {
+ return new JulianDate(components[0], components[1], TimeStandard$1.UTC);
+ }
+ setComponents(components[0], components[1], result);
+ convertUtcToTai(result);
+ return result;
+ };
+
+ /**
+ * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.
+ * This method is superior to Date.parse
because it will handle all valid formats defined by the ISO 8601
+ * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.
+ *
+ * @param {String} iso8601String An ISO 8601 date.
+ * @param {JulianDate} [result] An existing instance to use for the result.
+ * @returns {JulianDate} The modified result parameter or a new instance if none was provided.
+ *
+ * @exception {DeveloperError} Invalid ISO 8601 date.
+ */
+ JulianDate.fromIso8601 = function (iso8601String, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (typeof iso8601String !== "string") {
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ }
+ //>>includeEnd('debug');
+
+ //Comma and decimal point both indicate a fractional number according to ISO 8601,
+ //start out by blanket replacing , with . which is the only valid such symbol in JS.
+ iso8601String = iso8601String.replace(",", ".");
+
+ //Split the string into its date and time components, denoted by a mandatory T
+ let tokens = iso8601String.split("T");
+ let year;
+ let month = 1;
+ let day = 1;
+ let hour = 0;
+ let minute = 0;
+ let second = 0;
+ let millisecond = 0;
+
+ //Lacking a time is okay, but a missing date is illegal.
+ const date = tokens[0];
+ const time = tokens[1];
+ let tmp;
+ let inLeapYear;
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(date)) {
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ }
+
+ let dashCount;
+ //>>includeEnd('debug');
+
+ //First match the date against possible regular expressions.
+ tokens = date.match(matchCalendarDate);
+ if (tokens !== null) {
+ //>>includeStart('debug', pragmas.debug);
+ dashCount = date.split("-").length - 1;
+ if (dashCount > 0 && dashCount !== 2) {
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ }
+ //>>includeEnd('debug');
+ year = +tokens[1];
+ month = +tokens[2];
+ day = +tokens[3];
+ } else {
+ tokens = date.match(matchCalendarMonth);
+ if (tokens !== null) {
+ year = +tokens[1];
+ month = +tokens[2];
+ } else {
+ tokens = date.match(matchCalendarYear);
+ if (tokens !== null) {
+ year = +tokens[1];
+ } else {
+ //Not a year/month/day so it must be an ordinal date.
+ let dayOfYear;
+ tokens = date.match(matchOrdinalDate);
+ if (tokens !== null) {
+ year = +tokens[1];
+ dayOfYear = +tokens[2];
+ inLeapYear = isLeapYear(year);
+
+ //This validation is only applicable for this format.
+ //>>includeStart('debug', pragmas.debug);
+ if (
+ dayOfYear < 1 ||
+ (inLeapYear && dayOfYear > 366) ||
+ (!inLeapYear && dayOfYear > 365)
+ ) {
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ }
+ //>>includeEnd('debug')
+ } else {
+ tokens = date.match(matchWeekDate);
+ if (tokens !== null) {
+ //ISO week date to ordinal date from
+ //http://en.wikipedia.org/w/index.php?title=ISO_week_date&oldid=474176775
+ year = +tokens[1];
+ const weekNumber = +tokens[2];
+ const dayOfWeek = +tokens[3] || 0;
+
+ //>>includeStart('debug', pragmas.debug);
+ dashCount = date.split("-").length - 1;
+ if (
+ dashCount > 0 &&
+ ((!defaultValue.defined(tokens[3]) && dashCount !== 1) ||
+ (defaultValue.defined(tokens[3]) && dashCount !== 2))
+ ) {
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ }
+ //>>includeEnd('debug')
+
+ const january4 = new Date(Date.UTC(year, 0, 4));
+ dayOfYear = weekNumber * 7 + dayOfWeek - january4.getUTCDay() - 3;
+ } else {
+ //None of our regular expressions succeeded in parsing the date properly.
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ //>>includeEnd('debug')
+ }
+ }
+ //Split an ordinal date into month/day.
+ tmp = new Date(Date.UTC(year, 0, 1));
+ tmp.setUTCDate(dayOfYear);
+ month = tmp.getUTCMonth() + 1;
+ day = tmp.getUTCDate();
+ }
+ }
+ }
+
+ //Now that we have all of the date components, validate them to make sure nothing is out of range.
+ inLeapYear = isLeapYear(year);
+ //>>includeStart('debug', pragmas.debug);
+ if (
+ month < 1 ||
+ month > 12 ||
+ day < 1 ||
+ ((month !== 2 || !inLeapYear) && day > daysInMonth[month - 1]) ||
+ (inLeapYear && month === 2 && day > daysInLeapFeburary)
+ ) {
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ }
+ //>>includeEnd('debug')
+
+ //Now move onto the time string, which is much simpler.
+ //If no time is specified, it is considered the beginning of the day, UTC to match Javascript's implementation.
+ let offsetIndex;
+ if (defaultValue.defined(time)) {
+ tokens = time.match(matchHoursMinutesSeconds);
+ if (tokens !== null) {
+ //>>includeStart('debug', pragmas.debug);
+ dashCount = time.split(":").length - 1;
+ if (dashCount > 0 && dashCount !== 2 && dashCount !== 3) {
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ }
+ //>>includeEnd('debug')
+
+ hour = +tokens[1];
+ minute = +tokens[2];
+ second = +tokens[3];
+ millisecond = +(tokens[4] || 0) * 1000.0;
+ offsetIndex = 5;
+ } else {
+ tokens = time.match(matchHoursMinutes);
+ if (tokens !== null) {
+ //>>includeStart('debug', pragmas.debug);
+ dashCount = time.split(":").length - 1;
+ if (dashCount > 2) {
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ }
+ //>>includeEnd('debug')
+
+ hour = +tokens[1];
+ minute = +tokens[2];
+ second = +(tokens[3] || 0) * 60.0;
+ offsetIndex = 4;
+ } else {
+ tokens = time.match(matchHours);
+ if (tokens !== null) {
+ hour = +tokens[1];
+ minute = +(tokens[2] || 0) * 60.0;
+ offsetIndex = 3;
+ } else {
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ //>>includeEnd('debug')
+ }
+ }
+ }
+
+ //Validate that all values are in proper range. Minutes and hours have special cases at 60 and 24.
+ //>>includeStart('debug', pragmas.debug);
+ if (
+ minute >= 60 ||
+ second >= 61 ||
+ hour > 24 ||
+ (hour === 24 && (minute > 0 || second > 0 || millisecond > 0))
+ ) {
+ throw new Check.DeveloperError(iso8601ErrorMessage);
+ }
+ //>>includeEnd('debug');
+
+ //Check the UTC offset value, if no value exists, use local time
+ //a Z indicates UTC, + or - are offsets.
+ const offset = tokens[offsetIndex];
+ const offsetHours = +tokens[offsetIndex + 1];
+ const offsetMinutes = +(tokens[offsetIndex + 2] || 0);
+ switch (offset) {
+ case "+":
+ hour = hour - offsetHours;
+ minute = minute - offsetMinutes;
+ break;
+ case "-":
+ hour = hour + offsetHours;
+ minute = minute + offsetMinutes;
+ break;
+ case "Z":
+ break;
+ default:
+ minute =
+ minute +
+ new Date(
+ Date.UTC(year, month - 1, day, hour, minute)
+ ).getTimezoneOffset();
+ break;
+ }
+ }
+
+ //ISO8601 denotes a leap second by any time having a seconds component of 60 seconds.
+ //If that's the case, we need to temporarily subtract a second in order to build a UTC date.
+ //Then we add it back in after converting to TAI.
+ const isLeapSecond = second === 60;
+ if (isLeapSecond) {
+ second--;
+ }
+
+ //Even if we successfully parsed the string into its components, after applying UTC offset or
+ //special cases like 24:00:00 denoting midnight, we need to normalize the data appropriately.
+
+ //milliseconds can never be greater than 1000, and seconds can't be above 60, so we start with minutes
+ while (minute >= 60) {
+ minute -= 60;
+ hour++;
+ }
+
+ while (hour >= 24) {
+ hour -= 24;
+ day++;
+ }
+
+ tmp = inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];
+ while (day > tmp) {
+ day -= tmp;
+ month++;
+
+ if (month > 12) {
+ month -= 12;
+ year++;
+ }
+
+ tmp =
+ inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];
+ }
+
+ //If UTC offset is at the beginning/end of the day, minutes can be negative.
+ while (minute < 0) {
+ minute += 60;
+ hour--;
+ }
+
+ while (hour < 0) {
+ hour += 24;
+ day--;
+ }
+
+ while (day < 1) {
+ month--;
+ if (month < 1) {
+ month += 12;
+ year--;
+ }
+
+ tmp =
+ inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];
+ day += tmp;
+ }
+
+ //Now create the JulianDate components from the Gregorian date and actually create our instance.
+ const components = computeJulianDateComponents(
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second,
+ millisecond
+ );
+
+ if (!defaultValue.defined(result)) {
+ result = new JulianDate(components[0], components[1], TimeStandard$1.UTC);
+ } else {
+ setComponents(components[0], components[1], result);
+ convertUtcToTai(result);
+ }
+
+ //If we were on a leap second, add it back.
+ if (isLeapSecond) {
+ JulianDate.addSeconds(result, 1, result);
+ }
+
+ return result;
+ };
+
+ /**
+ * Creates a new instance that represents the current system time.
+ * This is equivalent to calling JulianDate.fromDate(new Date());
.
+ *
+ * @param {JulianDate} [result] An existing instance to use for the result.
+ * @returns {JulianDate} The modified result parameter or a new instance if none was provided.
+ */
+ JulianDate.now = function (result) {
+ return JulianDate.fromDate(new Date(), result);
+ };
+
+ const toGregorianDateScratch = new JulianDate(0, 0, TimeStandard$1.TAI);
+
+ /**
+ * Creates a {@link GregorianDate} from the provided instance.
+ *
+ * @param {JulianDate} julianDate The date to be converted.
+ * @param {GregorianDate} [result] An existing instance to use for the result.
+ * @returns {GregorianDate} The modified result parameter or a new instance if none was provided.
+ */
+ JulianDate.toGregorianDate = function (julianDate, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(julianDate)) {
+ throw new Check.DeveloperError("julianDate is required.");
+ }
+ //>>includeEnd('debug');
+
+ let isLeapSecond = false;
+ let thisUtc = convertTaiToUtc(julianDate, toGregorianDateScratch);
+ if (!defaultValue.defined(thisUtc)) {
+ //Conversion to UTC will fail if we are during a leap second.
+ //If that's the case, subtract a second and convert again.
+ //JavaScript doesn't support leap seconds, so this results in second 59 being repeated twice.
+ JulianDate.addSeconds(julianDate, -1, toGregorianDateScratch);
+ thisUtc = convertTaiToUtc(toGregorianDateScratch, toGregorianDateScratch);
+ isLeapSecond = true;
+ }
+
+ let julianDayNumber = thisUtc.dayNumber;
+ const secondsOfDay = thisUtc.secondsOfDay;
+
+ if (secondsOfDay >= 43200.0) {
+ julianDayNumber += 1;
+ }
+
+ // Algorithm from page 604 of the Explanatory Supplement to the
+ // Astronomical Almanac (Seidelmann 1992).
+ let L = (julianDayNumber + 68569) | 0;
+ const N = ((4 * L) / 146097) | 0;
+ L = (L - (((146097 * N + 3) / 4) | 0)) | 0;
+ const I = ((4000 * (L + 1)) / 1461001) | 0;
+ L = (L - (((1461 * I) / 4) | 0) + 31) | 0;
+ const J = ((80 * L) / 2447) | 0;
+ const day = (L - (((2447 * J) / 80) | 0)) | 0;
+ L = (J / 11) | 0;
+ const month = (J + 2 - 12 * L) | 0;
+ const year = (100 * (N - 49) + I + L) | 0;
+
+ let hour = (secondsOfDay / TimeConstants$1.SECONDS_PER_HOUR) | 0;
+ let remainingSeconds = secondsOfDay - hour * TimeConstants$1.SECONDS_PER_HOUR;
+ const minute = (remainingSeconds / TimeConstants$1.SECONDS_PER_MINUTE) | 0;
+ remainingSeconds =
+ remainingSeconds - minute * TimeConstants$1.SECONDS_PER_MINUTE;
+ let second = remainingSeconds | 0;
+ const millisecond =
+ (remainingSeconds - second) / TimeConstants$1.SECONDS_PER_MILLISECOND;
+
+ // JulianDates are noon-based
+ hour += 12;
+ if (hour > 23) {
+ hour -= 24;
+ }
+
+ //If we were on a leap second, add it back.
+ if (isLeapSecond) {
+ second += 1;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new GregorianDate(
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second,
+ millisecond,
+ isLeapSecond
+ );
+ }
+
+ result.year = year;
+ result.month = month;
+ result.day = day;
+ result.hour = hour;
+ result.minute = minute;
+ result.second = second;
+ result.millisecond = millisecond;
+ result.isLeapSecond = isLeapSecond;
+ return result;
+ };
+
+ /**
+ * Creates a JavaScript Date from the provided instance.
+ * Since JavaScript dates are only accurate to the nearest millisecond and
+ * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.
+ * If the provided JulianDate is during a leap second, the previous second is used.
+ *
+ * @param {JulianDate} julianDate The date to be converted.
+ * @returns {Date} A new instance representing the provided date.
+ */
+ JulianDate.toDate = function (julianDate) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(julianDate)) {
+ throw new Check.DeveloperError("julianDate is required.");
+ }
+ //>>includeEnd('debug');
+
+ const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);
+ let second = gDate.second;
+ if (gDate.isLeapSecond) {
+ second -= 1;
+ }
+ return new Date(
+ Date.UTC(
+ gDate.year,
+ gDate.month - 1,
+ gDate.day,
+ gDate.hour,
+ gDate.minute,
+ second,
+ gDate.millisecond
+ )
+ );
+ };
+
+ /**
+ * Creates an ISO8601 representation of the provided date.
+ *
+ * @param {JulianDate} julianDate The date to be converted.
+ * @param {Number} [precision] The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.
+ * @returns {String} The ISO8601 representation of the provided date.
+ */
+ JulianDate.toIso8601 = function (julianDate, precision) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(julianDate)) {
+ throw new Check.DeveloperError("julianDate is required.");
+ }
+ //>>includeEnd('debug');
+
+ const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);
+ let year = gDate.year;
+ let month = gDate.month;
+ let day = gDate.day;
+ let hour = gDate.hour;
+ const minute = gDate.minute;
+ const second = gDate.second;
+ const millisecond = gDate.millisecond;
+
+ // special case - Iso8601.MAXIMUM_VALUE produces a string which we can't parse unless we adjust.
+ // 10000-01-01T00:00:00 is the same instant as 9999-12-31T24:00:00
+ if (
+ year === 10000 &&
+ month === 1 &&
+ day === 1 &&
+ hour === 0 &&
+ minute === 0 &&
+ second === 0 &&
+ millisecond === 0
+ ) {
+ year = 9999;
+ month = 12;
+ day = 31;
+ hour = 24;
+ }
+
+ let millisecondStr;
+
+ if (!defaultValue.defined(precision) && millisecond !== 0) {
+ //Forces milliseconds into a number with at least 3 digits to whatever the default toString() precision is.
+ millisecondStr = (millisecond * 0.01).toString().replace(".", "");
+ return `${year.toString().padStart(4, "0")}-${month
+ .toString()
+ .padStart(2, "0")}-${day
+ .toString()
+ .padStart(2, "0")}T${hour
+ .toString()
+ .padStart(2, "0")}:${minute
+ .toString()
+ .padStart(2, "0")}:${second
+ .toString()
+ .padStart(2, "0")}.${millisecondStr}Z`;
+ }
+
+ //Precision is either 0 or milliseconds is 0 with undefined precision, in either case, leave off milliseconds entirely
+ if (!defaultValue.defined(precision) || precision === 0) {
+ return `${year.toString().padStart(4, "0")}-${month
+ .toString()
+ .padStart(2, "0")}-${day
+ .toString()
+ .padStart(2, "0")}T${hour
+ .toString()
+ .padStart(2, "0")}:${minute
+ .toString()
+ .padStart(2, "0")}:${second.toString().padStart(2, "0")}Z`;
+ }
+
+ //Forces milliseconds into a number with at least 3 digits to whatever the specified precision is.
+ millisecondStr = (millisecond * 0.01)
+ .toFixed(precision)
+ .replace(".", "")
+ .slice(0, precision);
+ return `${year.toString().padStart(4, "0")}-${month
+ .toString()
+ .padStart(2, "0")}-${day
+ .toString()
+ .padStart(2, "0")}T${hour
+ .toString()
+ .padStart(2, "0")}:${minute
+ .toString()
+ .padStart(2, "0")}:${second
+ .toString()
+ .padStart(2, "0")}.${millisecondStr}Z`;
+ };
+
+ /**
+ * Duplicates a JulianDate instance.
+ *
+ * @param {JulianDate} julianDate The date to duplicate.
+ * @param {JulianDate} [result] An existing instance to use for the result.
+ * @returns {JulianDate} The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.
+ */
+ JulianDate.clone = function (julianDate, result) {
+ if (!defaultValue.defined(julianDate)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ return new JulianDate(
+ julianDate.dayNumber,
+ julianDate.secondsOfDay,
+ TimeStandard$1.TAI
+ );
+ }
+ result.dayNumber = julianDate.dayNumber;
+ result.secondsOfDay = julianDate.secondsOfDay;
+ return result;
+ };
+
+ /**
+ * Compares two instances.
+ *
+ * @param {JulianDate} left The first instance.
+ * @param {JulianDate} right The second instance.
+ * @returns {Number} A negative value if left is less than right, a positive value if left is greater than right, or zero if left and right are equal.
+ */
+ JulianDate.compare = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(left)) {
+ throw new Check.DeveloperError("left is required.");
+ }
+ if (!defaultValue.defined(right)) {
+ throw new Check.DeveloperError("right is required.");
+ }
+ //>>includeEnd('debug');
+
+ const julianDayNumberDifference = left.dayNumber - right.dayNumber;
+ if (julianDayNumberDifference !== 0) {
+ return julianDayNumberDifference;
+ }
+ return left.secondsOfDay - right.secondsOfDay;
+ };
+
+ /**
+ * Compares two instances and returns true
if they are equal, false
otherwise.
+ *
+ * @param {JulianDate} [left] The first instance.
+ * @param {JulianDate} [right] The second instance.
+ * @returns {Boolean} true
if the dates are equal; otherwise, false
.
+ */
+ JulianDate.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left.dayNumber === right.dayNumber &&
+ left.secondsOfDay === right.secondsOfDay)
+ );
+ };
+
+ /**
+ * Compares two instances and returns true
if they are within epsilon
seconds of
+ * each other. That is, in order for the dates to be considered equal (and for
+ * this function to return true
), the absolute value of the difference between them, in
+ * seconds, must be less than epsilon
.
+ *
+ * @param {JulianDate} [left] The first instance.
+ * @param {JulianDate} [right] The second instance.
+ * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances.
+ * @returns {Boolean} true
if the two dates are within epsilon
seconds of each other; otherwise false
.
+ */
+ JulianDate.equalsEpsilon = function (left, right, epsilon) {
+ epsilon = defaultValue.defaultValue(epsilon, 0);
+
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math.abs(JulianDate.secondsDifference(left, right)) <= epsilon)
+ );
+ };
+
+ /**
+ * Computes the total number of whole and fractional days represented by the provided instance.
+ *
+ * @param {JulianDate} julianDate The date.
+ * @returns {Number} The Julian date as single floating point number.
+ */
+ JulianDate.totalDays = function (julianDate) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(julianDate)) {
+ throw new Check.DeveloperError("julianDate is required.");
+ }
+ //>>includeEnd('debug');
+ return (
+ julianDate.dayNumber +
+ julianDate.secondsOfDay / TimeConstants$1.SECONDS_PER_DAY
+ );
+ };
+
+ /**
+ * Computes the difference in seconds between the provided instance.
+ *
+ * @param {JulianDate} left The first instance.
+ * @param {JulianDate} right The second instance.
+ * @returns {Number} The difference, in seconds, when subtracting right
from left
.
+ */
+ JulianDate.secondsDifference = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(left)) {
+ throw new Check.DeveloperError("left is required.");
+ }
+ if (!defaultValue.defined(right)) {
+ throw new Check.DeveloperError("right is required.");
+ }
+ //>>includeEnd('debug');
+
+ const dayDifference =
+ (left.dayNumber - right.dayNumber) * TimeConstants$1.SECONDS_PER_DAY;
+ return dayDifference + (left.secondsOfDay - right.secondsOfDay);
+ };
+
+ /**
+ * Computes the difference in days between the provided instance.
+ *
+ * @param {JulianDate} left The first instance.
+ * @param {JulianDate} right The second instance.
+ * @returns {Number} The difference, in days, when subtracting right
from left
.
+ */
+ JulianDate.daysDifference = function (left, right) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(left)) {
+ throw new Check.DeveloperError("left is required.");
+ }
+ if (!defaultValue.defined(right)) {
+ throw new Check.DeveloperError("right is required.");
+ }
+ //>>includeEnd('debug');
+
+ const dayDifference = left.dayNumber - right.dayNumber;
+ const secondDifference =
+ (left.secondsOfDay - right.secondsOfDay) / TimeConstants$1.SECONDS_PER_DAY;
+ return dayDifference + secondDifference;
+ };
+
+ /**
+ * Computes the number of seconds the provided instance is ahead of UTC.
+ *
+ * @param {JulianDate} julianDate The date.
+ * @returns {Number} The number of seconds the provided instance is ahead of UTC
+ */
+ JulianDate.computeTaiMinusUtc = function (julianDate) {
+ binarySearchScratchLeapSecond.julianDate = julianDate;
+ const leapSeconds = JulianDate.leapSeconds;
+ let index = binarySearch(
+ leapSeconds,
+ binarySearchScratchLeapSecond,
+ compareLeapSecondDates$1
+ );
+ if (index < 0) {
+ index = ~index;
+ --index;
+ if (index < 0) {
+ index = 0;
+ }
+ }
+ return leapSeconds[index].offset;
+ };
+
+ /**
+ * Adds the provided number of seconds to the provided date instance.
+ *
+ * @param {JulianDate} julianDate The date.
+ * @param {Number} seconds The number of seconds to add or subtract.
+ * @param {JulianDate} result An existing instance to use for the result.
+ * @returns {JulianDate} The modified result parameter.
+ */
+ JulianDate.addSeconds = function (julianDate, seconds, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(julianDate)) {
+ throw new Check.DeveloperError("julianDate is required.");
+ }
+ if (!defaultValue.defined(seconds)) {
+ throw new Check.DeveloperError("seconds is required.");
+ }
+ if (!defaultValue.defined(result)) {
+ throw new Check.DeveloperError("result is required.");
+ }
+ //>>includeEnd('debug');
+
+ return setComponents(
+ julianDate.dayNumber,
+ julianDate.secondsOfDay + seconds,
+ result
+ );
+ };
+
+ /**
+ * Adds the provided number of minutes to the provided date instance.
+ *
+ * @param {JulianDate} julianDate The date.
+ * @param {Number} minutes The number of minutes to add or subtract.
+ * @param {JulianDate} result An existing instance to use for the result.
+ * @returns {JulianDate} The modified result parameter.
+ */
+ JulianDate.addMinutes = function (julianDate, minutes, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(julianDate)) {
+ throw new Check.DeveloperError("julianDate is required.");
+ }
+ if (!defaultValue.defined(minutes)) {
+ throw new Check.DeveloperError("minutes is required.");
+ }
+ if (!defaultValue.defined(result)) {
+ throw new Check.DeveloperError("result is required.");
+ }
+ //>>includeEnd('debug');
+
+ const newSecondsOfDay =
+ julianDate.secondsOfDay + minutes * TimeConstants$1.SECONDS_PER_MINUTE;
+ return setComponents(julianDate.dayNumber, newSecondsOfDay, result);
+ };
+
+ /**
+ * Adds the provided number of hours to the provided date instance.
+ *
+ * @param {JulianDate} julianDate The date.
+ * @param {Number} hours The number of hours to add or subtract.
+ * @param {JulianDate} result An existing instance to use for the result.
+ * @returns {JulianDate} The modified result parameter.
+ */
+ JulianDate.addHours = function (julianDate, hours, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(julianDate)) {
+ throw new Check.DeveloperError("julianDate is required.");
+ }
+ if (!defaultValue.defined(hours)) {
+ throw new Check.DeveloperError("hours is required.");
+ }
+ if (!defaultValue.defined(result)) {
+ throw new Check.DeveloperError("result is required.");
+ }
+ //>>includeEnd('debug');
+
+ const newSecondsOfDay =
+ julianDate.secondsOfDay + hours * TimeConstants$1.SECONDS_PER_HOUR;
+ return setComponents(julianDate.dayNumber, newSecondsOfDay, result);
+ };
+
+ /**
+ * Adds the provided number of days to the provided date instance.
+ *
+ * @param {JulianDate} julianDate The date.
+ * @param {Number} days The number of days to add or subtract.
+ * @param {JulianDate} result An existing instance to use for the result.
+ * @returns {JulianDate} The modified result parameter.
+ */
+ JulianDate.addDays = function (julianDate, days, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(julianDate)) {
+ throw new Check.DeveloperError("julianDate is required.");
+ }
+ if (!defaultValue.defined(days)) {
+ throw new Check.DeveloperError("days is required.");
+ }
+ if (!defaultValue.defined(result)) {
+ throw new Check.DeveloperError("result is required.");
+ }
+ //>>includeEnd('debug');
+
+ const newJulianDayNumber = julianDate.dayNumber + days;
+ return setComponents(newJulianDayNumber, julianDate.secondsOfDay, result);
+ };
+
+ /**
+ * Compares the provided instances and returns true
if left
is earlier than right
, false
otherwise.
+ *
+ * @param {JulianDate} left The first instance.
+ * @param {JulianDate} right The second instance.
+ * @returns {Boolean} true
if left
is earlier than right
, false
otherwise.
+ */
+ JulianDate.lessThan = function (left, right) {
+ return JulianDate.compare(left, right) < 0;
+ };
+
+ /**
+ * Compares the provided instances and returns true
if left
is earlier than or equal to right
, false
otherwise.
+ *
+ * @param {JulianDate} left The first instance.
+ * @param {JulianDate} right The second instance.
+ * @returns {Boolean} true
if left
is earlier than or equal to right
, false
otherwise.
+ */
+ JulianDate.lessThanOrEquals = function (left, right) {
+ return JulianDate.compare(left, right) <= 0;
+ };
+
+ /**
+ * Compares the provided instances and returns true
if left
is later than right
, false
otherwise.
+ *
+ * @param {JulianDate} left The first instance.
+ * @param {JulianDate} right The second instance.
+ * @returns {Boolean} true
if left
is later than right
, false
otherwise.
+ */
+ JulianDate.greaterThan = function (left, right) {
+ return JulianDate.compare(left, right) > 0;
+ };
+
+ /**
+ * Compares the provided instances and returns true
if left
is later than or equal to right
, false
otherwise.
+ *
+ * @param {JulianDate} left The first instance.
+ * @param {JulianDate} right The second instance.
+ * @returns {Boolean} true
if left
is later than or equal to right
, false
otherwise.
+ */
+ JulianDate.greaterThanOrEquals = function (left, right) {
+ return JulianDate.compare(left, right) >= 0;
+ };
+
+ /**
+ * Duplicates this instance.
+ *
+ * @param {JulianDate} [result] An existing instance to use for the result.
+ * @returns {JulianDate} The modified result parameter or a new instance if none was provided.
+ */
+ JulianDate.prototype.clone = function (result) {
+ return JulianDate.clone(this, result);
+ };
+
+ /**
+ * Compares this and the provided instance and returns true
if they are equal, false
otherwise.
+ *
+ * @param {JulianDate} [right] The second instance.
+ * @returns {Boolean} true
if the dates are equal; otherwise, false
.
+ */
+ JulianDate.prototype.equals = function (right) {
+ return JulianDate.equals(this, right);
+ };
+
+ /**
+ * Compares this and the provided instance and returns true
if they are within epsilon
seconds of
+ * each other. That is, in order for the dates to be considered equal (and for
+ * this function to return true
), the absolute value of the difference between them, in
+ * seconds, must be less than epsilon
.
+ *
+ * @param {JulianDate} [right] The second instance.
+ * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances.
+ * @returns {Boolean} true
if the two dates are within epsilon
seconds of each other; otherwise false
.
+ */
+ JulianDate.prototype.equalsEpsilon = function (right, epsilon) {
+ return JulianDate.equalsEpsilon(this, right, epsilon);
+ };
+
+ /**
+ * Creates a string representing this date in ISO8601 format.
+ *
+ * @returns {String} A string representing this date in ISO8601 format.
+ */
+ JulianDate.prototype.toString = function () {
+ return JulianDate.toIso8601(this);
+ };
+
+ /**
+ * Gets or sets the list of leap seconds used throughout Cesium.
+ * @memberof JulianDate
+ * @type {LeapSecond[]}
+ */
+ JulianDate.leapSeconds = [
+ new LeapSecond(new JulianDate(2441317, 43210.0, TimeStandard$1.TAI), 10), // January 1, 1972 00:00:00 UTC
+ new LeapSecond(new JulianDate(2441499, 43211.0, TimeStandard$1.TAI), 11), // July 1, 1972 00:00:00 UTC
+ new LeapSecond(new JulianDate(2441683, 43212.0, TimeStandard$1.TAI), 12), // January 1, 1973 00:00:00 UTC
+ new LeapSecond(new JulianDate(2442048, 43213.0, TimeStandard$1.TAI), 13), // January 1, 1974 00:00:00 UTC
+ new LeapSecond(new JulianDate(2442413, 43214.0, TimeStandard$1.TAI), 14), // January 1, 1975 00:00:00 UTC
+ new LeapSecond(new JulianDate(2442778, 43215.0, TimeStandard$1.TAI), 15), // January 1, 1976 00:00:00 UTC
+ new LeapSecond(new JulianDate(2443144, 43216.0, TimeStandard$1.TAI), 16), // January 1, 1977 00:00:00 UTC
+ new LeapSecond(new JulianDate(2443509, 43217.0, TimeStandard$1.TAI), 17), // January 1, 1978 00:00:00 UTC
+ new LeapSecond(new JulianDate(2443874, 43218.0, TimeStandard$1.TAI), 18), // January 1, 1979 00:00:00 UTC
+ new LeapSecond(new JulianDate(2444239, 43219.0, TimeStandard$1.TAI), 19), // January 1, 1980 00:00:00 UTC
+ new LeapSecond(new JulianDate(2444786, 43220.0, TimeStandard$1.TAI), 20), // July 1, 1981 00:00:00 UTC
+ new LeapSecond(new JulianDate(2445151, 43221.0, TimeStandard$1.TAI), 21), // July 1, 1982 00:00:00 UTC
+ new LeapSecond(new JulianDate(2445516, 43222.0, TimeStandard$1.TAI), 22), // July 1, 1983 00:00:00 UTC
+ new LeapSecond(new JulianDate(2446247, 43223.0, TimeStandard$1.TAI), 23), // July 1, 1985 00:00:00 UTC
+ new LeapSecond(new JulianDate(2447161, 43224.0, TimeStandard$1.TAI), 24), // January 1, 1988 00:00:00 UTC
+ new LeapSecond(new JulianDate(2447892, 43225.0, TimeStandard$1.TAI), 25), // January 1, 1990 00:00:00 UTC
+ new LeapSecond(new JulianDate(2448257, 43226.0, TimeStandard$1.TAI), 26), // January 1, 1991 00:00:00 UTC
+ new LeapSecond(new JulianDate(2448804, 43227.0, TimeStandard$1.TAI), 27), // July 1, 1992 00:00:00 UTC
+ new LeapSecond(new JulianDate(2449169, 43228.0, TimeStandard$1.TAI), 28), // July 1, 1993 00:00:00 UTC
+ new LeapSecond(new JulianDate(2449534, 43229.0, TimeStandard$1.TAI), 29), // July 1, 1994 00:00:00 UTC
+ new LeapSecond(new JulianDate(2450083, 43230.0, TimeStandard$1.TAI), 30), // January 1, 1996 00:00:00 UTC
+ new LeapSecond(new JulianDate(2450630, 43231.0, TimeStandard$1.TAI), 31), // July 1, 1997 00:00:00 UTC
+ new LeapSecond(new JulianDate(2451179, 43232.0, TimeStandard$1.TAI), 32), // January 1, 1999 00:00:00 UTC
+ new LeapSecond(new JulianDate(2453736, 43233.0, TimeStandard$1.TAI), 33), // January 1, 2006 00:00:00 UTC
+ new LeapSecond(new JulianDate(2454832, 43234.0, TimeStandard$1.TAI), 34), // January 1, 2009 00:00:00 UTC
+ new LeapSecond(new JulianDate(2456109, 43235.0, TimeStandard$1.TAI), 35), // July 1, 2012 00:00:00 UTC
+ new LeapSecond(new JulianDate(2457204, 43236.0, TimeStandard$1.TAI), 36), // July 1, 2015 00:00:00 UTC
+ new LeapSecond(new JulianDate(2457754, 43237.0, TimeStandard$1.TAI), 37), // January 1, 2017 00:00:00 UTC
+ ];
+
+ var URI = {exports: {}};
+
+ var punycode = {exports: {}};
+
+ /*! https://mths.be/punycode v1.4.0 by @mathias */
+
+ var hasRequiredPunycode;
+
+ function requirePunycode () {
+ if (hasRequiredPunycode) return punycode.exports;
+ hasRequiredPunycode = 1;
+ (function (module, exports) {
+ (function(root) {
+
+ /** Detect free variables */
+ var freeExports = exports &&
+ !exports.nodeType && exports;
+ var freeModule = module &&
+ !module.nodeType && module;
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal;
+ if (
+ freeGlobal.global === freeGlobal ||
+ freeGlobal.window === freeGlobal ||
+ freeGlobal.self === freeGlobal
+ ) {
+ root = freeGlobal;
+ }
+
+ /**
+ * The `punycode` object.
+ * @name punycode
+ * @type Object
+ */
+ var punycode,
+
+ /** Highest positive signed 32-bit float value */
+ maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
+
+ /** Bootstring parameters */
+ base = 36,
+ tMin = 1,
+ tMax = 26,
+ skew = 38,
+ damp = 700,
+ initialBias = 72,
+ initialN = 128, // 0x80
+ delimiter = '-', // '\x2D'
+
+ /** Regular expressions */
+ regexPunycode = /^xn--/,
+ regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
+ regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
+
+ /** Error messages */
+ errors = {
+ 'overflow': 'Overflow: input needs wider integers to process',
+ 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
+ 'invalid-input': 'Invalid input'
+ },
+
+ /** Convenience shortcuts */
+ baseMinusTMin = base - tMin,
+ floor = Math.floor,
+ stringFromCharCode = String.fromCharCode,
+
+ /** Temporary variable */
+ key;
+
+ /*--------------------------------------------------------------------------*/
+
+ /**
+ * A generic error utility function.
+ * @private
+ * @param {String} type The error type.
+ * @returns {Error} Throws a `RangeError` with the applicable error message.
+ */
+ function error(type) {
+ throw new RangeError(errors[type]);
+ }
+
+ /**
+ * A generic `Array#map` utility function.
+ * @private
+ * @param {Array} array The array to iterate over.
+ * @param {Function} callback The function that gets called for every array
+ * item.
+ * @returns {Array} A new array of values returned by the callback function.
+ */
+ function map(array, fn) {
+ var length = array.length;
+ var result = [];
+ while (length--) {
+ result[length] = fn(array[length]);
+ }
+ return result;
+ }
+
+ /**
+ * A simple `Array#map`-like wrapper to work with domain name strings or email
+ * addresses.
+ * @private
+ * @param {String} domain The domain name or email address.
+ * @param {Function} callback The function that gets called for every
+ * character.
+ * @returns {Array} A new string of characters returned by the callback
+ * function.
+ */
+ function mapDomain(string, fn) {
+ var parts = string.split('@');
+ var result = '';
+ if (parts.length > 1) {
+ // In email addresses, only the domain name should be punycoded. Leave
+ // the local part (i.e. everything up to `@`) intact.
+ result = parts[0] + '@';
+ string = parts[1];
+ }
+ // Avoid `split(regex)` for IE8 compatibility. See #17.
+ string = string.replace(regexSeparators, '\x2E');
+ var labels = string.split('.');
+ var encoded = map(labels, fn).join('.');
+ return result + encoded;
+ }
+
+ /**
+ * Creates an array containing the numeric code points of each Unicode
+ * character in the string. While JavaScript uses UCS-2 internally,
+ * this function will convert a pair of surrogate halves (each of which
+ * UCS-2 exposes as separate characters) into a single code point,
+ * matching UTF-16.
+ * @see `punycode.ucs2.encode`
+ * @see
+ * @memberOf punycode.ucs2
+ * @name decode
+ * @param {String} string The Unicode input string (UCS-2).
+ * @returns {Array} The new array of code points.
+ */
+ function ucs2decode(string) {
+ var output = [],
+ counter = 0,
+ length = string.length,
+ value,
+ extra;
+ while (counter < length) {
+ value = string.charCodeAt(counter++);
+ if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
+ // high surrogate, and there is a next character
+ extra = string.charCodeAt(counter++);
+ if ((extra & 0xFC00) == 0xDC00) { // low surrogate
+ output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
+ } else {
+ // unmatched surrogate; only append this code unit, in case the next
+ // code unit is the high surrogate of a surrogate pair
+ output.push(value);
+ counter--;
+ }
+ } else {
+ output.push(value);
+ }
+ }
+ return output;
+ }
+
+ /**
+ * Creates a string based on an array of numeric code points.
+ * @see `punycode.ucs2.decode`
+ * @memberOf punycode.ucs2
+ * @name encode
+ * @param {Array} codePoints The array of numeric code points.
+ * @returns {String} The new Unicode string (UCS-2).
+ */
+ function ucs2encode(array) {
+ return map(array, function(value) {
+ var output = '';
+ if (value > 0xFFFF) {
+ value -= 0x10000;
+ output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
+ value = 0xDC00 | value & 0x3FF;
+ }
+ output += stringFromCharCode(value);
+ return output;
+ }).join('');
+ }
+
+ /**
+ * Converts a basic code point into a digit/integer.
+ * @see `digitToBasic()`
+ * @private
+ * @param {Number} codePoint The basic numeric code point value.
+ * @returns {Number} The numeric value of a basic code point (for use in
+ * representing integers) in the range `0` to `base - 1`, or `base` if
+ * the code point does not represent a value.
+ */
+ function basicToDigit(codePoint) {
+ if (codePoint - 48 < 10) {
+ return codePoint - 22;
+ }
+ if (codePoint - 65 < 26) {
+ return codePoint - 65;
+ }
+ if (codePoint - 97 < 26) {
+ return codePoint - 97;
+ }
+ return base;
+ }
+
+ /**
+ * Converts a digit/integer into a basic code point.
+ * @see `basicToDigit()`
+ * @private
+ * @param {Number} digit The numeric value of a basic code point.
+ * @returns {Number} The basic code point whose value (when used for
+ * representing integers) is `digit`, which needs to be in the range
+ * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
+ * used; else, the lowercase form is used. The behavior is undefined
+ * if `flag` is non-zero and `digit` has no uppercase form.
+ */
+ function digitToBasic(digit, flag) {
+ // 0..25 map to ASCII a..z or A..Z
+ // 26..35 map to ASCII 0..9
+ return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
+ }
+
+ /**
+ * Bias adaptation function as per section 3.4 of RFC 3492.
+ * https://tools.ietf.org/html/rfc3492#section-3.4
+ * @private
+ */
+ function adapt(delta, numPoints, firstTime) {
+ var k = 0;
+ delta = firstTime ? floor(delta / damp) : delta >> 1;
+ delta += floor(delta / numPoints);
+ for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
+ delta = floor(delta / baseMinusTMin);
+ }
+ return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
+ }
+
+ /**
+ * Converts a Punycode string of ASCII-only symbols to a string of Unicode
+ * symbols.
+ * @memberOf punycode
+ * @param {String} input The Punycode string of ASCII-only symbols.
+ * @returns {String} The resulting string of Unicode symbols.
+ */
+ function decode(input) {
+ // Don't use UCS-2
+ var output = [],
+ inputLength = input.length,
+ out,
+ i = 0,
+ n = initialN,
+ bias = initialBias,
+ basic,
+ j,
+ index,
+ oldi,
+ w,
+ k,
+ digit,
+ t,
+ /** Cached calculation results */
+ baseMinusT;
+
+ // Handle the basic code points: let `basic` be the number of input code
+ // points before the last delimiter, or `0` if there is none, then copy
+ // the first basic code points to the output.
+
+ basic = input.lastIndexOf(delimiter);
+ if (basic < 0) {
+ basic = 0;
+ }
+
+ for (j = 0; j < basic; ++j) {
+ // if it's not a basic code point
+ if (input.charCodeAt(j) >= 0x80) {
+ error('not-basic');
+ }
+ output.push(input.charCodeAt(j));
+ }
+
+ // Main decoding loop: start just after the last delimiter if any basic code
+ // points were copied; start at the beginning otherwise.
+
+ for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
+
+ // `index` is the index of the next character to be consumed.
+ // Decode a generalized variable-length integer into `delta`,
+ // which gets added to `i`. The overflow checking is easier
+ // if we increase `i` as we go, then subtract off its starting
+ // value at the end to obtain `delta`.
+ for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
+
+ if (index >= inputLength) {
+ error('invalid-input');
+ }
+
+ digit = basicToDigit(input.charCodeAt(index++));
+
+ if (digit >= base || digit > floor((maxInt - i) / w)) {
+ error('overflow');
+ }
+
+ i += digit * w;
+ t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
+
+ if (digit < t) {
+ break;
+ }
+
+ baseMinusT = base - t;
+ if (w > floor(maxInt / baseMinusT)) {
+ error('overflow');
+ }
+
+ w *= baseMinusT;
+
+ }
+
+ out = output.length + 1;
+ bias = adapt(i - oldi, out, oldi == 0);
+
+ // `i` was supposed to wrap around from `out` to `0`,
+ // incrementing `n` each time, so we'll fix that now:
+ if (floor(i / out) > maxInt - n) {
+ error('overflow');
+ }
+
+ n += floor(i / out);
+ i %= out;
+
+ // Insert `n` at position `i` of the output
+ output.splice(i++, 0, n);
+
+ }
+
+ return ucs2encode(output);
+ }
+
+ /**
+ * Converts a string of Unicode symbols (e.g. a domain name label) to a
+ * Punycode string of ASCII-only symbols.
+ * @memberOf punycode
+ * @param {String} input The string of Unicode symbols.
+ * @returns {String} The resulting Punycode string of ASCII-only symbols.
+ */
+ function encode(input) {
+ var n,
+ delta,
+ handledCPCount,
+ basicLength,
+ bias,
+ j,
+ m,
+ q,
+ k,
+ t,
+ currentValue,
+ output = [],
+ /** `inputLength` will hold the number of code points in `input`. */
+ inputLength,
+ /** Cached calculation results */
+ handledCPCountPlusOne,
+ baseMinusT,
+ qMinusT;
+
+ // Convert the input in UCS-2 to Unicode
+ input = ucs2decode(input);
+
+ // Cache the length
+ inputLength = input.length;
+
+ // Initialize the state
+ n = initialN;
+ delta = 0;
+ bias = initialBias;
+
+ // Handle the basic code points
+ for (j = 0; j < inputLength; ++j) {
+ currentValue = input[j];
+ if (currentValue < 0x80) {
+ output.push(stringFromCharCode(currentValue));
+ }
+ }
+
+ handledCPCount = basicLength = output.length;
+
+ // `handledCPCount` is the number of code points that have been handled;
+ // `basicLength` is the number of basic code points.
+
+ // Finish the basic string - if it is not empty - with a delimiter
+ if (basicLength) {
+ output.push(delimiter);
+ }
+
+ // Main encoding loop:
+ while (handledCPCount < inputLength) {
+
+ // All non-basic code points < n have been handled already. Find the next
+ // larger one:
+ for (m = maxInt, j = 0; j < inputLength; ++j) {
+ currentValue = input[j];
+ if (currentValue >= n && currentValue < m) {
+ m = currentValue;
+ }
+ }
+
+ // Increase `delta` enough to advance the decoder's state to ,
+ // but guard against overflow
+ handledCPCountPlusOne = handledCPCount + 1;
+ if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
+ error('overflow');
+ }
+
+ delta += (m - n) * handledCPCountPlusOne;
+ n = m;
+
+ for (j = 0; j < inputLength; ++j) {
+ currentValue = input[j];
+
+ if (currentValue < n && ++delta > maxInt) {
+ error('overflow');
+ }
+
+ if (currentValue == n) {
+ // Represent delta as a generalized variable-length integer
+ for (q = delta, k = base; /* no condition */; k += base) {
+ t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
+ if (q < t) {
+ break;
+ }
+ qMinusT = q - t;
+ baseMinusT = base - t;
+ output.push(
+ stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
+ );
+ q = floor(qMinusT / baseMinusT);
+ }
+
+ output.push(stringFromCharCode(digitToBasic(q, 0)));
+ bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
+ delta = 0;
+ ++handledCPCount;
+ }
+ }
+
+ ++delta;
+ ++n;
+
+ }
+ return output.join('');
+ }
+
+ /**
+ * Converts a Punycode string representing a domain name or an email address
+ * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
+ * it doesn't matter if you call it on a string that has already been
+ * converted to Unicode.
+ * @memberOf punycode
+ * @param {String} input The Punycoded domain name or email address to
+ * convert to Unicode.
+ * @returns {String} The Unicode representation of the given Punycode
+ * string.
+ */
+ function toUnicode(input) {
+ return mapDomain(input, function(string) {
+ return regexPunycode.test(string)
+ ? decode(string.slice(4).toLowerCase())
+ : string;
+ });
+ }
+
+ /**
+ * Converts a Unicode string representing a domain name or an email address to
+ * Punycode. Only the non-ASCII parts of the domain name will be converted,
+ * i.e. it doesn't matter if you call it with a domain that's already in
+ * ASCII.
+ * @memberOf punycode
+ * @param {String} input The domain name or email address to convert, as a
+ * Unicode string.
+ * @returns {String} The Punycode representation of the given domain name or
+ * email address.
+ */
+ function toASCII(input) {
+ return mapDomain(input, function(string) {
+ return regexNonASCII.test(string)
+ ? 'xn--' + encode(string)
+ : string;
+ });
+ }
+
+ /*--------------------------------------------------------------------------*/
+
+ /** Define the public API */
+ punycode = {
+ /**
+ * A string representing the current Punycode.js version number.
+ * @memberOf punycode
+ * @type String
+ */
+ 'version': '1.3.2',
+ /**
+ * An object of methods to convert from JavaScript's internal character
+ * representation (UCS-2) to Unicode code points, and back.
+ * @see
+ * @memberOf punycode
+ * @type Object
+ */
+ 'ucs2': {
+ 'decode': ucs2decode,
+ 'encode': ucs2encode
+ },
+ 'decode': decode,
+ 'encode': encode,
+ 'toASCII': toASCII,
+ 'toUnicode': toUnicode
+ };
+
+ /** Expose `punycode` */
+ // Some AMD build optimizers, like r.js, check for specific condition patterns
+ // like the following:
+ if (freeExports && freeModule) {
+ if (module.exports == freeExports) {
+ // in Node.js, io.js, or RingoJS v0.8.0+
+ freeModule.exports = punycode;
+ } else {
+ // in Narwhal or RingoJS v0.7.0-
+ for (key in punycode) {
+ punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
+ }
+ }
+ } else {
+ // in Rhino or a web browser
+ root.punycode = punycode;
+ }
+
+ }(commonjsGlobal));
+ } (punycode, punycode.exports));
+ return punycode.exports;
+ }
+
+ var IPv6 = {exports: {}};
+
+ /*!
+ * URI.js - Mutating URLs
+ * IPv6 Support
+ *
+ * Version: 1.19.11
+ *
+ * Author: Rodney Rehm
+ * Web: http://medialize.github.io/URI.js/
+ *
+ * Licensed under
+ * MIT License http://www.opensource.org/licenses/mit-license
+ *
+ */
+
+ var hasRequiredIPv6;
+
+ function requireIPv6 () {
+ if (hasRequiredIPv6) return IPv6.exports;
+ hasRequiredIPv6 = 1;
+ (function (module) {
+ (function (root, factory) {
+ // https://github.com/umdjs/umd/blob/master/returnExports.js
+ if (module.exports) {
+ // Node
+ module.exports = factory();
+ } else {
+ // Browser globals (root is window)
+ root.IPv6 = factory(root);
+ }
+ }(commonjsGlobal, function (root) {
+
+ /*
+ var _in = "fe80:0000:0000:0000:0204:61ff:fe9d:f156";
+ var _out = IPv6.best(_in);
+ var _expected = "fe80::204:61ff:fe9d:f156";
+
+ console.log(_in, _out, _expected, _out === _expected);
+ */
+
+ // save current IPv6 variable, if any
+ var _IPv6 = root && root.IPv6;
+
+ function bestPresentation(address) {
+ // based on:
+ // Javascript to test an IPv6 address for proper format, and to
+ // present the "best text representation" according to IETF Draft RFC at
+ // http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04
+ // 8 Feb 2010 Rich Brown, Dartware, LLC
+ // Please feel free to use this code as long as you provide a link to
+ // http://www.intermapper.com
+ // http://intermapper.com/support/tools/IPV6-Validator.aspx
+ // http://download.dartware.com/thirdparty/ipv6validator.js
+
+ var _address = address.toLowerCase();
+ var segments = _address.split(':');
+ var length = segments.length;
+ var total = 8;
+
+ // trim colons (:: or ::a:b:c… or …a:b:c::)
+ if (segments[0] === '' && segments[1] === '' && segments[2] === '') {
+ // must have been ::
+ // remove first two items
+ segments.shift();
+ segments.shift();
+ } else if (segments[0] === '' && segments[1] === '') {
+ // must have been ::xxxx
+ // remove the first item
+ segments.shift();
+ } else if (segments[length - 1] === '' && segments[length - 2] === '') {
+ // must have been xxxx::
+ segments.pop();
+ }
+
+ length = segments.length;
+
+ // adjust total segments for IPv4 trailer
+ if (segments[length - 1].indexOf('.') !== -1) {
+ // found a "." which means IPv4
+ total = 7;
+ }
+
+ // fill empty segments them with "0000"
+ var pos;
+ for (pos = 0; pos < length; pos++) {
+ if (segments[pos] === '') {
+ break;
+ }
+ }
+
+ if (pos < total) {
+ segments.splice(pos, 1, '0000');
+ while (segments.length < total) {
+ segments.splice(pos, 0, '0000');
+ }
+ }
+
+ // strip leading zeros
+ var _segments;
+ for (var i = 0; i < total; i++) {
+ _segments = segments[i].split('');
+ for (var j = 0; j < 3 ; j++) {
+ if (_segments[0] === '0' && _segments.length > 1) {
+ _segments.splice(0,1);
+ } else {
+ break;
+ }
+ }
+
+ segments[i] = _segments.join('');
+ }
+
+ // find longest sequence of zeroes and coalesce them into one segment
+ var best = -1;
+ var _best = 0;
+ var _current = 0;
+ var current = -1;
+ var inzeroes = false;
+ // i; already declared
+
+ for (i = 0; i < total; i++) {
+ if (inzeroes) {
+ if (segments[i] === '0') {
+ _current += 1;
+ } else {
+ inzeroes = false;
+ if (_current > _best) {
+ best = current;
+ _best = _current;
+ }
+ }
+ } else {
+ if (segments[i] === '0') {
+ inzeroes = true;
+ current = i;
+ _current = 1;
+ }
+ }
+ }
+
+ if (_current > _best) {
+ best = current;
+ _best = _current;
+ }
+
+ if (_best > 1) {
+ segments.splice(best, _best, '');
+ }
+
+ length = segments.length;
+
+ // assemble remaining segments
+ var result = '';
+ if (segments[0] === '') {
+ result = ':';
+ }
+
+ for (i = 0; i < length; i++) {
+ result += segments[i];
+ if (i === length - 1) {
+ break;
+ }
+
+ result += ':';
+ }
+
+ if (segments[length - 1] === '') {
+ result += ':';
+ }
+
+ return result;
+ }
+
+ function noConflict() {
+ /*jshint validthis: true */
+ if (root.IPv6 === this) {
+ root.IPv6 = _IPv6;
+ }
+
+ return this;
+ }
+
+ return {
+ best: bestPresentation,
+ noConflict: noConflict
+ };
+ }));
+ } (IPv6));
+ return IPv6.exports;
+ }
+
+ var SecondLevelDomains = {exports: {}};
+
+ /*!
+ * URI.js - Mutating URLs
+ * Second Level Domain (SLD) Support
+ *
+ * Version: 1.19.11
+ *
+ * Author: Rodney Rehm
+ * Web: http://medialize.github.io/URI.js/
+ *
+ * Licensed under
+ * MIT License http://www.opensource.org/licenses/mit-license
+ *
+ */
+
+ var hasRequiredSecondLevelDomains;
+
+ function requireSecondLevelDomains () {
+ if (hasRequiredSecondLevelDomains) return SecondLevelDomains.exports;
+ hasRequiredSecondLevelDomains = 1;
+ (function (module) {
+ (function (root, factory) {
+ // https://github.com/umdjs/umd/blob/master/returnExports.js
+ if (module.exports) {
+ // Node
+ module.exports = factory();
+ } else {
+ // Browser globals (root is window)
+ root.SecondLevelDomains = factory(root);
+ }
+ }(commonjsGlobal, function (root) {
+
+ // save current SecondLevelDomains variable, if any
+ var _SecondLevelDomains = root && root.SecondLevelDomains;
+
+ var SLD = {
+ // list of known Second Level Domains
+ // converted list of SLDs from https://github.com/gavingmiller/second-level-domains
+ // ----
+ // publicsuffix.org is more current and actually used by a couple of browsers internally.
+ // downside is it also contains domains like "dyndns.org" - which is fine for the security
+ // issues browser have to deal with (SOP for cookies, etc) - but is way overboard for URI.js
+ // ----
+ list: {
+ 'ac':' com gov mil net org ',
+ 'ae':' ac co gov mil name net org pro sch ',
+ 'af':' com edu gov net org ',
+ 'al':' com edu gov mil net org ',
+ 'ao':' co ed gv it og pb ',
+ 'ar':' com edu gob gov int mil net org tur ',
+ 'at':' ac co gv or ',
+ 'au':' asn com csiro edu gov id net org ',
+ 'ba':' co com edu gov mil net org rs unbi unmo unsa untz unze ',
+ 'bb':' biz co com edu gov info net org store tv ',
+ 'bh':' biz cc com edu gov info net org ',
+ 'bn':' com edu gov net org ',
+ 'bo':' com edu gob gov int mil net org tv ',
+ 'br':' adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ',
+ 'bs':' com edu gov net org ',
+ 'bz':' du et om ov rg ',
+ 'ca':' ab bc mb nb nf nl ns nt nu on pe qc sk yk ',
+ 'ck':' biz co edu gen gov info net org ',
+ 'cn':' ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ',
+ 'co':' com edu gov mil net nom org ',
+ 'cr':' ac c co ed fi go or sa ',
+ 'cy':' ac biz com ekloges gov ltd name net org parliament press pro tm ',
+ 'do':' art com edu gob gov mil net org sld web ',
+ 'dz':' art asso com edu gov net org pol ',
+ 'ec':' com edu fin gov info med mil net org pro ',
+ 'eg':' com edu eun gov mil name net org sci ',
+ 'er':' com edu gov ind mil net org rochest w ',
+ 'es':' com edu gob nom org ',
+ 'et':' biz com edu gov info name net org ',
+ 'fj':' ac biz com info mil name net org pro ',
+ 'fk':' ac co gov net nom org ',
+ 'fr':' asso com f gouv nom prd presse tm ',
+ 'gg':' co net org ',
+ 'gh':' com edu gov mil org ',
+ 'gn':' ac com gov net org ',
+ 'gr':' com edu gov mil net org ',
+ 'gt':' com edu gob ind mil net org ',
+ 'gu':' com edu gov net org ',
+ 'hk':' com edu gov idv net org ',
+ 'hu':' 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ',
+ 'id':' ac co go mil net or sch web ',
+ 'il':' ac co gov idf k12 muni net org ',
+ 'in':' ac co edu ernet firm gen gov i ind mil net nic org res ',
+ 'iq':' com edu gov i mil net org ',
+ 'ir':' ac co dnssec gov i id net org sch ',
+ 'it':' edu gov ',
+ 'je':' co net org ',
+ 'jo':' com edu gov mil name net org sch ',
+ 'jp':' ac ad co ed go gr lg ne or ',
+ 'ke':' ac co go info me mobi ne or sc ',
+ 'kh':' com edu gov mil net org per ',
+ 'ki':' biz com de edu gov info mob net org tel ',
+ 'km':' asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ',
+ 'kn':' edu gov net org ',
+ 'kr':' ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ',
+ 'kw':' com edu gov net org ',
+ 'ky':' com edu gov net org ',
+ 'kz':' com edu gov mil net org ',
+ 'lb':' com edu gov net org ',
+ 'lk':' assn com edu gov grp hotel int ltd net ngo org sch soc web ',
+ 'lr':' com edu gov net org ',
+ 'lv':' asn com conf edu gov id mil net org ',
+ 'ly':' com edu gov id med net org plc sch ',
+ 'ma':' ac co gov m net org press ',
+ 'mc':' asso tm ',
+ 'me':' ac co edu gov its net org priv ',
+ 'mg':' com edu gov mil nom org prd tm ',
+ 'mk':' com edu gov inf name net org pro ',
+ 'ml':' com edu gov net org presse ',
+ 'mn':' edu gov org ',
+ 'mo':' com edu gov net org ',
+ 'mt':' com edu gov net org ',
+ 'mv':' aero biz com coop edu gov info int mil museum name net org pro ',
+ 'mw':' ac co com coop edu gov int museum net org ',
+ 'mx':' com edu gob net org ',
+ 'my':' com edu gov mil name net org sch ',
+ 'nf':' arts com firm info net other per rec store web ',
+ 'ng':' biz com edu gov mil mobi name net org sch ',
+ 'ni':' ac co com edu gob mil net nom org ',
+ 'np':' com edu gov mil net org ',
+ 'nr':' biz com edu gov info net org ',
+ 'om':' ac biz co com edu gov med mil museum net org pro sch ',
+ 'pe':' com edu gob mil net nom org sld ',
+ 'ph':' com edu gov i mil net ngo org ',
+ 'pk':' biz com edu fam gob gok gon gop gos gov net org web ',
+ 'pl':' art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ',
+ 'pr':' ac biz com edu est gov info isla name net org pro prof ',
+ 'ps':' com edu gov net org plo sec ',
+ 'pw':' belau co ed go ne or ',
+ 'ro':' arts com firm info nom nt org rec store tm www ',
+ 'rs':' ac co edu gov in org ',
+ 'sb':' com edu gov net org ',
+ 'sc':' com edu gov net org ',
+ 'sh':' co com edu gov net nom org ',
+ 'sl':' com edu gov net org ',
+ 'st':' co com consulado edu embaixada gov mil net org principe saotome store ',
+ 'sv':' com edu gob org red ',
+ 'sz':' ac co org ',
+ 'tr':' av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ',
+ 'tt':' aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ',
+ 'tw':' club com ebiz edu game gov idv mil net org ',
+ 'mu':' ac co com gov net or org ',
+ 'mz':' ac co edu gov org ',
+ 'na':' co com ',
+ 'nz':' ac co cri geek gen govt health iwi maori mil net org parliament school ',
+ 'pa':' abo ac com edu gob ing med net nom org sld ',
+ 'pt':' com edu gov int net nome org publ ',
+ 'py':' com edu gov mil net org ',
+ 'qa':' com edu gov mil net org ',
+ 're':' asso com nom ',
+ 'ru':' ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ',
+ 'rw':' ac co com edu gouv gov int mil net ',
+ 'sa':' com edu gov med net org pub sch ',
+ 'sd':' com edu gov info med net org tv ',
+ 'se':' a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ',
+ 'sg':' com edu gov idn net org per ',
+ 'sn':' art com edu gouv org perso univ ',
+ 'sy':' com edu gov mil net news org ',
+ 'th':' ac co go in mi net or ',
+ 'tj':' ac biz co com edu go gov info int mil name net nic org test web ',
+ 'tn':' agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ',
+ 'tz':' ac co go ne or ',
+ 'ua':' biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ',
+ 'ug':' ac co go ne or org sc ',
+ 'uk':' ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ',
+ 'us':' dni fed isa kids nsn ',
+ 'uy':' com edu gub mil net org ',
+ 've':' co com edu gob info mil net org web ',
+ 'vi':' co com k12 net org ',
+ 'vn':' ac biz com edu gov health info int name net org pro ',
+ 'ye':' co com gov ltd me net org plc ',
+ 'yu':' ac co edu gov org ',
+ 'za':' ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ',
+ 'zm':' ac co com edu gov net org sch ',
+ // https://en.wikipedia.org/wiki/CentralNic#Second-level_domains
+ 'com': 'ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ',
+ 'net': 'gb jp se uk ',
+ 'org': 'ae',
+ 'de': 'com '
+ },
+ // gorhill 2013-10-25: Using indexOf() instead Regexp(). Significant boost
+ // in both performance and memory footprint. No initialization required.
+ // http://jsperf.com/uri-js-sld-regex-vs-binary-search/4
+ // Following methods use lastIndexOf() rather than array.split() in order
+ // to avoid any memory allocations.
+ has: function(domain) {
+ var tldOffset = domain.lastIndexOf('.');
+ if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {
+ return false;
+ }
+ var sldOffset = domain.lastIndexOf('.', tldOffset-1);
+ if (sldOffset <= 0 || sldOffset >= (tldOffset-1)) {
+ return false;
+ }
+ var sldList = SLD.list[domain.slice(tldOffset+1)];
+ if (!sldList) {
+ return false;
+ }
+ return sldList.indexOf(' ' + domain.slice(sldOffset+1, tldOffset) + ' ') >= 0;
+ },
+ is: function(domain) {
+ var tldOffset = domain.lastIndexOf('.');
+ if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {
+ return false;
+ }
+ var sldOffset = domain.lastIndexOf('.', tldOffset-1);
+ if (sldOffset >= 0) {
+ return false;
+ }
+ var sldList = SLD.list[domain.slice(tldOffset+1)];
+ if (!sldList) {
+ return false;
+ }
+ return sldList.indexOf(' ' + domain.slice(0, tldOffset) + ' ') >= 0;
+ },
+ get: function(domain) {
+ var tldOffset = domain.lastIndexOf('.');
+ if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {
+ return null;
+ }
+ var sldOffset = domain.lastIndexOf('.', tldOffset-1);
+ if (sldOffset <= 0 || sldOffset >= (tldOffset-1)) {
+ return null;
+ }
+ var sldList = SLD.list[domain.slice(tldOffset+1)];
+ if (!sldList) {
+ return null;
+ }
+ if (sldList.indexOf(' ' + domain.slice(sldOffset+1, tldOffset) + ' ') < 0) {
+ return null;
+ }
+ return domain.slice(sldOffset+1);
+ },
+ noConflict: function(){
+ if (root.SecondLevelDomains === this) {
+ root.SecondLevelDomains = _SecondLevelDomains;
+ }
+ return this;
+ }
+ };
+
+ return SLD;
+ }));
+ } (SecondLevelDomains));
+ return SecondLevelDomains.exports;
+ }
+
+ /*!
+ * URI.js - Mutating URLs
+ *
+ * Version: 1.19.11
+ *
+ * Author: Rodney Rehm
+ * Web: http://medialize.github.io/URI.js/
+ *
+ * Licensed under
+ * MIT License http://www.opensource.org/licenses/mit-license
+ *
+ */
+
+ (function (module) {
+ (function (root, factory) {
+ // https://github.com/umdjs/umd/blob/master/returnExports.js
+ if (module.exports) {
+ // Node
+ module.exports = factory(requirePunycode(), requireIPv6(), requireSecondLevelDomains());
+ } else {
+ // Browser globals (root is window)
+ root.URI = factory(root.punycode, root.IPv6, root.SecondLevelDomains, root);
+ }
+ }(commonjsGlobal, function (punycode, IPv6, SLD, root) {
+ /*global location, escape, unescape */
+ // FIXME: v2.0.0 renamce non-camelCase properties to uppercase
+ /*jshint camelcase: false */
+
+ // save current URI variable, if any
+ var _URI = root && root.URI;
+
+ function URI(url, base) {
+ var _urlSupplied = arguments.length >= 1;
+ var _baseSupplied = arguments.length >= 2;
+
+ // Allow instantiation without the 'new' keyword
+ if (!(this instanceof URI)) {
+ if (_urlSupplied) {
+ if (_baseSupplied) {
+ return new URI(url, base);
+ }
+
+ return new URI(url);
+ }
+
+ return new URI();
+ }
+
+ if (url === undefined) {
+ if (_urlSupplied) {
+ throw new TypeError('undefined is not a valid argument for URI');
+ }
+
+ if (typeof location !== 'undefined') {
+ url = location.href + '';
+ } else {
+ url = '';
+ }
+ }
+
+ if (url === null) {
+ if (_urlSupplied) {
+ throw new TypeError('null is not a valid argument for URI');
+ }
+ }
+
+ this.href(url);
+
+ // resolve to base according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#constructor
+ if (base !== undefined) {
+ return this.absoluteTo(base);
+ }
+
+ return this;
+ }
+
+ function isInteger(value) {
+ return /^[0-9]+$/.test(value);
+ }
+
+ URI.version = '1.19.11';
+
+ var p = URI.prototype;
+ var hasOwn = Object.prototype.hasOwnProperty;
+
+ function escapeRegEx(string) {
+ // https://github.com/medialize/URI.js/commit/85ac21783c11f8ccab06106dba9735a31a86924d#commitcomment-821963
+ return string.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+ }
+
+ function getType(value) {
+ // IE8 doesn't return [Object Undefined] but [Object Object] for undefined value
+ if (value === undefined) {
+ return 'Undefined';
+ }
+
+ return String(Object.prototype.toString.call(value)).slice(8, -1);
+ }
+
+ function isArray(obj) {
+ return getType(obj) === 'Array';
+ }
+
+ function filterArrayValues(data, value) {
+ var lookup = {};
+ var i, length;
+
+ if (getType(value) === 'RegExp') {
+ lookup = null;
+ } else if (isArray(value)) {
+ for (i = 0, length = value.length; i < length; i++) {
+ lookup[value[i]] = true;
+ }
+ } else {
+ lookup[value] = true;
+ }
+
+ for (i = 0, length = data.length; i < length; i++) {
+ /*jshint laxbreak: true */
+ var _match = lookup && lookup[data[i]] !== undefined
+ || !lookup && value.test(data[i]);
+ /*jshint laxbreak: false */
+ if (_match) {
+ data.splice(i, 1);
+ length--;
+ i--;
+ }
+ }
+
+ return data;
+ }
+
+ function arrayContains(list, value) {
+ var i, length;
+
+ // value may be string, number, array, regexp
+ if (isArray(value)) {
+ // Note: this can be optimized to O(n) (instead of current O(m * n))
+ for (i = 0, length = value.length; i < length; i++) {
+ if (!arrayContains(list, value[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ var _type = getType(value);
+ for (i = 0, length = list.length; i < length; i++) {
+ if (_type === 'RegExp') {
+ if (typeof list[i] === 'string' && list[i].match(value)) {
+ return true;
+ }
+ } else if (list[i] === value) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ function arraysEqual(one, two) {
+ if (!isArray(one) || !isArray(two)) {
+ return false;
+ }
+
+ // arrays can't be equal if they have different amount of content
+ if (one.length !== two.length) {
+ return false;
+ }
+
+ one.sort();
+ two.sort();
+
+ for (var i = 0, l = one.length; i < l; i++) {
+ if (one[i] !== two[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ function trimSlashes(text) {
+ var trim_expression = /^\/+|\/+$/g;
+ return text.replace(trim_expression, '');
+ }
+
+ URI._parts = function() {
+ return {
+ protocol: null,
+ username: null,
+ password: null,
+ hostname: null,
+ urn: null,
+ port: null,
+ path: null,
+ query: null,
+ fragment: null,
+ // state
+ preventInvalidHostname: URI.preventInvalidHostname,
+ duplicateQueryParameters: URI.duplicateQueryParameters,
+ escapeQuerySpace: URI.escapeQuerySpace
+ };
+ };
+ // state: throw on invalid hostname
+ // see https://github.com/medialize/URI.js/pull/345
+ // and https://github.com/medialize/URI.js/issues/354
+ URI.preventInvalidHostname = false;
+ // state: allow duplicate query parameters (a=1&a=1)
+ URI.duplicateQueryParameters = false;
+ // state: replaces + with %20 (space in query strings)
+ URI.escapeQuerySpace = true;
+ // static properties
+ URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i;
+ URI.idn_expression = /[^a-z0-9\._-]/i;
+ URI.punycode_expression = /(xn--)/i;
+ // well, 333.444.555.666 matches, but it sure ain't no IPv4 - do we care?
+ URI.ip4_expression = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
+ // credits to Rich Brown
+ // source: http://forums.intermapper.com/viewtopic.php?p=1096#1096
+ // specification: http://www.ietf.org/rfc/rfc4291.txt
+ URI.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
+ // expression used is "gruber revised" (@gruber v2) determined to be the
+ // best solution in a regex-golf we did a couple of ages ago at
+ // * http://mathiasbynens.be/demo/url-regex
+ // * http://rodneyrehm.de/t/url-regex.html
+ URI.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig;
+ URI.findUri = {
+ // valid "scheme://" or "www."
+ start: /\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,
+ // everything up to the next whitespace
+ end: /[\s\r\n]|$/,
+ // trim trailing punctuation captured by end RegExp
+ trim: /[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,
+ // balanced parens inclusion (), [], {}, <>
+ parens: /(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g,
+ };
+ URI.leading_whitespace_expression = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;
+ // https://infra.spec.whatwg.org/#ascii-tab-or-newline
+ URI.ascii_tab_whitespace = /[\u0009\u000A\u000D]+/g;
+ // http://www.iana.org/assignments/uri-schemes.html
+ // http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports
+ URI.defaultPorts = {
+ http: '80',
+ https: '443',
+ ftp: '21',
+ gopher: '70',
+ ws: '80',
+ wss: '443'
+ };
+ // list of protocols which always require a hostname
+ URI.hostProtocols = [
+ 'http',
+ 'https'
+ ];
+
+ // allowed hostname characters according to RFC 3986
+ // ALPHA DIGIT "-" "." "_" "~" "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" %encoded
+ // I've never seen a (non-IDN) hostname other than: ALPHA DIGIT . - _
+ URI.invalid_hostname_characters = /[^a-zA-Z0-9\.\-:_]/;
+ // map DOM Elements to their URI attribute
+ URI.domAttributes = {
+ 'a': 'href',
+ 'blockquote': 'cite',
+ 'link': 'href',
+ 'base': 'href',
+ 'script': 'src',
+ 'form': 'action',
+ 'img': 'src',
+ 'area': 'href',
+ 'iframe': 'src',
+ 'embed': 'src',
+ 'source': 'src',
+ 'track': 'src',
+ 'input': 'src', // but only if type="image"
+ 'audio': 'src',
+ 'video': 'src'
+ };
+ URI.getDomAttribute = function(node) {
+ if (!node || !node.nodeName) {
+ return undefined;
+ }
+
+ var nodeName = node.nodeName.toLowerCase();
+ // should only expose src for type="image"
+ if (nodeName === 'input' && node.type !== 'image') {
+ return undefined;
+ }
+
+ return URI.domAttributes[nodeName];
+ };
+
+ function escapeForDumbFirefox36(value) {
+ // https://github.com/medialize/URI.js/issues/91
+ return escape(value);
+ }
+
+ // encoding / decoding according to RFC3986
+ function strictEncodeURIComponent(string) {
+ // see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent
+ return encodeURIComponent(string)
+ .replace(/[!'()*]/g, escapeForDumbFirefox36)
+ .replace(/\*/g, '%2A');
+ }
+ URI.encode = strictEncodeURIComponent;
+ URI.decode = decodeURIComponent;
+ URI.iso8859 = function() {
+ URI.encode = escape;
+ URI.decode = unescape;
+ };
+ URI.unicode = function() {
+ URI.encode = strictEncodeURIComponent;
+ URI.decode = decodeURIComponent;
+ };
+ URI.characters = {
+ pathname: {
+ encode: {
+ // RFC3986 2.1: For consistency, URI producers and normalizers should
+ // use uppercase hexadecimal digits for all percent-encodings.
+ expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig,
+ map: {
+ // -._~!'()*
+ '%24': '$',
+ '%26': '&',
+ '%2B': '+',
+ '%2C': ',',
+ '%3B': ';',
+ '%3D': '=',
+ '%3A': ':',
+ '%40': '@'
+ }
+ },
+ decode: {
+ expression: /[\/\?#]/g,
+ map: {
+ '/': '%2F',
+ '?': '%3F',
+ '#': '%23'
+ }
+ }
+ },
+ reserved: {
+ encode: {
+ // RFC3986 2.1: For consistency, URI producers and normalizers should
+ // use uppercase hexadecimal digits for all percent-encodings.
+ expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,
+ map: {
+ // gen-delims
+ '%3A': ':',
+ '%2F': '/',
+ '%3F': '?',
+ '%23': '#',
+ '%5B': '[',
+ '%5D': ']',
+ '%40': '@',
+ // sub-delims
+ '%21': '!',
+ '%24': '$',
+ '%26': '&',
+ '%27': '\'',
+ '%28': '(',
+ '%29': ')',
+ '%2A': '*',
+ '%2B': '+',
+ '%2C': ',',
+ '%3B': ';',
+ '%3D': '='
+ }
+ }
+ },
+ urnpath: {
+ // The characters under `encode` are the characters called out by RFC 2141 as being acceptable
+ // for usage in a URN. RFC2141 also calls out "-", ".", and "_" as acceptable characters, but
+ // these aren't encoded by encodeURIComponent, so we don't have to call them out here. Also
+ // note that the colon character is not featured in the encoding map; this is because URI.js
+ // gives the colons in URNs semantic meaning as the delimiters of path segements, and so it
+ // should not appear unencoded in a segment itself.
+ // See also the note above about RFC3986 and capitalalized hex digits.
+ encode: {
+ expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,
+ map: {
+ '%21': '!',
+ '%24': '$',
+ '%27': '\'',
+ '%28': '(',
+ '%29': ')',
+ '%2A': '*',
+ '%2B': '+',
+ '%2C': ',',
+ '%3B': ';',
+ '%3D': '=',
+ '%40': '@'
+ }
+ },
+ // These characters are the characters called out by RFC2141 as "reserved" characters that
+ // should never appear in a URN, plus the colon character (see note above).
+ decode: {
+ expression: /[\/\?#:]/g,
+ map: {
+ '/': '%2F',
+ '?': '%3F',
+ '#': '%23',
+ ':': '%3A'
+ }
+ }
+ }
+ };
+ URI.encodeQuery = function(string, escapeQuerySpace) {
+ var escaped = URI.encode(string + '');
+ if (escapeQuerySpace === undefined) {
+ escapeQuerySpace = URI.escapeQuerySpace;
+ }
+
+ return escapeQuerySpace ? escaped.replace(/%20/g, '+') : escaped;
+ };
+ URI.decodeQuery = function(string, escapeQuerySpace) {
+ string += '';
+ if (escapeQuerySpace === undefined) {
+ escapeQuerySpace = URI.escapeQuerySpace;
+ }
+
+ try {
+ return URI.decode(escapeQuerySpace ? string.replace(/\+/g, '%20') : string);
+ } catch(e) {
+ // we're not going to mess with weird encodings,
+ // give up and return the undecoded original string
+ // see https://github.com/medialize/URI.js/issues/87
+ // see https://github.com/medialize/URI.js/issues/92
+ return string;
+ }
+ };
+ // generate encode/decode path functions
+ var _parts = {'encode':'encode', 'decode':'decode'};
+ var _part;
+ var generateAccessor = function(_group, _part) {
+ return function(string) {
+ try {
+ return URI[_part](string + '').replace(URI.characters[_group][_part].expression, function(c) {
+ return URI.characters[_group][_part].map[c];
+ });
+ } catch (e) {
+ // we're not going to mess with weird encodings,
+ // give up and return the undecoded original string
+ // see https://github.com/medialize/URI.js/issues/87
+ // see https://github.com/medialize/URI.js/issues/92
+ return string;
+ }
+ };
+ };
+
+ for (_part in _parts) {
+ URI[_part + 'PathSegment'] = generateAccessor('pathname', _parts[_part]);
+ URI[_part + 'UrnPathSegment'] = generateAccessor('urnpath', _parts[_part]);
+ }
+
+ var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) {
+ return function(string) {
+ // Why pass in names of functions, rather than the function objects themselves? The
+ // definitions of some functions (but in particular, URI.decode) will occasionally change due
+ // to URI.js having ISO8859 and Unicode modes. Passing in the name and getting it will ensure
+ // that the functions we use here are "fresh".
+ var actualCodingFunc;
+ if (!_innerCodingFuncName) {
+ actualCodingFunc = URI[_codingFuncName];
+ } else {
+ actualCodingFunc = function(string) {
+ return URI[_codingFuncName](URI[_innerCodingFuncName](string));
+ };
+ }
+
+ var segments = (string + '').split(_sep);
+
+ for (var i = 0, length = segments.length; i < length; i++) {
+ segments[i] = actualCodingFunc(segments[i]);
+ }
+
+ return segments.join(_sep);
+ };
+ };
+
+ // This takes place outside the above loop because we don't want, e.g., encodeUrnPath functions.
+ URI.decodePath = generateSegmentedPathFunction('/', 'decodePathSegment');
+ URI.decodeUrnPath = generateSegmentedPathFunction(':', 'decodeUrnPathSegment');
+ URI.recodePath = generateSegmentedPathFunction('/', 'encodePathSegment', 'decode');
+ URI.recodeUrnPath = generateSegmentedPathFunction(':', 'encodeUrnPathSegment', 'decode');
+
+ URI.encodeReserved = generateAccessor('reserved', 'encode');
+
+ URI.parse = function(string, parts) {
+ var pos;
+ if (!parts) {
+ parts = {
+ preventInvalidHostname: URI.preventInvalidHostname
+ };
+ }
+
+ string = string.replace(URI.leading_whitespace_expression, '');
+ // https://infra.spec.whatwg.org/#ascii-tab-or-newline
+ string = string.replace(URI.ascii_tab_whitespace, '');
+
+ // [protocol"://"[username[":"password]"@"]hostname[":"port]"/"?][path]["?"querystring]["#"fragment]
+
+ // extract fragment
+ pos = string.indexOf('#');
+ if (pos > -1) {
+ // escaping?
+ parts.fragment = string.substring(pos + 1) || null;
+ string = string.substring(0, pos);
+ }
+
+ // extract query
+ pos = string.indexOf('?');
+ if (pos > -1) {
+ // escaping?
+ parts.query = string.substring(pos + 1) || null;
+ string = string.substring(0, pos);
+ }
+
+ // slashes and backslashes have lost all meaning for the web protocols (https, http, wss, ws)
+ string = string.replace(/^(https?|ftp|wss?)?:+[/\\]*/i, '$1://');
+ // slashes and backslashes have lost all meaning for scheme relative URLs
+ string = string.replace(/^[/\\]{2,}/i, '//');
+
+ // extract protocol
+ if (string.substring(0, 2) === '//') {
+ // relative-scheme
+ parts.protocol = null;
+ string = string.substring(2);
+ // extract "user:pass@host:port"
+ string = URI.parseAuthority(string, parts);
+ } else {
+ pos = string.indexOf(':');
+ if (pos > -1) {
+ parts.protocol = string.substring(0, pos) || null;
+ if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {
+ // : may be within the path
+ parts.protocol = undefined;
+ } else if (string.substring(pos + 1, pos + 3).replace(/\\/g, '/') === '//') {
+ string = string.substring(pos + 3);
+
+ // extract "user:pass@host:port"
+ string = URI.parseAuthority(string, parts);
+ } else {
+ string = string.substring(pos + 1);
+ parts.urn = true;
+ }
+ }
+ }
+
+ // what's left must be the path
+ parts.path = string;
+
+ // and we're done
+ return parts;
+ };
+ URI.parseHost = function(string, parts) {
+ if (!string) {
+ string = '';
+ }
+
+ // Copy chrome, IE, opera backslash-handling behavior.
+ // Back slashes before the query string get converted to forward slashes
+ // See: https://github.com/joyent/node/blob/386fd24f49b0e9d1a8a076592a404168faeecc34/lib/url.js#L115-L124
+ // See: https://code.google.com/p/chromium/issues/detail?id=25916
+ // https://github.com/medialize/URI.js/pull/233
+ string = string.replace(/\\/g, '/');
+
+ // extract host:port
+ var pos = string.indexOf('/');
+ var bracketPos;
+ var t;
+
+ if (pos === -1) {
+ pos = string.length;
+ }
+
+ if (string.charAt(0) === '[') {
+ // IPv6 host - http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04#section-6
+ // I claim most client software breaks on IPv6 anyways. To simplify things, URI only accepts
+ // IPv6+port in the format [2001:db8::1]:80 (for the time being)
+ bracketPos = string.indexOf(']');
+ parts.hostname = string.substring(1, bracketPos) || null;
+ parts.port = string.substring(bracketPos + 2, pos) || null;
+ if (parts.port === '/') {
+ parts.port = null;
+ }
+ } else {
+ var firstColon = string.indexOf(':');
+ var firstSlash = string.indexOf('/');
+ var nextColon = string.indexOf(':', firstColon + 1);
+ if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) {
+ // IPv6 host contains multiple colons - but no port
+ // this notation is actually not allowed by RFC 3986, but we're a liberal parser
+ parts.hostname = string.substring(0, pos) || null;
+ parts.port = null;
+ } else {
+ t = string.substring(0, pos).split(':');
+ parts.hostname = t[0] || null;
+ parts.port = t[1] || null;
+ }
+ }
+
+ if (parts.hostname && string.substring(pos).charAt(0) !== '/') {
+ pos++;
+ string = '/' + string;
+ }
+
+ if (parts.preventInvalidHostname) {
+ URI.ensureValidHostname(parts.hostname, parts.protocol);
+ }
+
+ if (parts.port) {
+ URI.ensureValidPort(parts.port);
+ }
+
+ return string.substring(pos) || '/';
+ };
+ URI.parseAuthority = function(string, parts) {
+ string = URI.parseUserinfo(string, parts);
+ return URI.parseHost(string, parts);
+ };
+ URI.parseUserinfo = function(string, parts) {
+ // extract username:password
+ var _string = string;
+ var firstBackSlash = string.indexOf('\\');
+ if (firstBackSlash !== -1) {
+ string = string.replace(/\\/g, '/');
+ }
+ var firstSlash = string.indexOf('/');
+ var pos = string.lastIndexOf('@', firstSlash > -1 ? firstSlash : string.length - 1);
+ var t;
+
+ // authority@ must come before /path or \path
+ if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) {
+ t = string.substring(0, pos).split(':');
+ parts.username = t[0] ? URI.decode(t[0]) : null;
+ t.shift();
+ parts.password = t[0] ? URI.decode(t.join(':')) : null;
+ string = _string.substring(pos + 1);
+ } else {
+ parts.username = null;
+ parts.password = null;
+ }
+
+ return string;
+ };
+ URI.parseQuery = function(string, escapeQuerySpace) {
+ if (!string) {
+ return {};
+ }
+
+ // throw out the funky business - "?"[name"="value"&"]+
+ string = string.replace(/&+/g, '&').replace(/^\?*&*|&+$/g, '');
+
+ if (!string) {
+ return {};
+ }
+
+ var items = {};
+ var splits = string.split('&');
+ var length = splits.length;
+ var v, name, value;
+
+ for (var i = 0; i < length; i++) {
+ v = splits[i].split('=');
+ name = URI.decodeQuery(v.shift(), escapeQuerySpace);
+ // no "=" is null according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#collect-url-parameters
+ value = v.length ? URI.decodeQuery(v.join('='), escapeQuerySpace) : null;
+
+ if (name === '__proto__') {
+ // ignore attempt at exploiting JavaScript internals
+ continue;
+ } else if (hasOwn.call(items, name)) {
+ if (typeof items[name] === 'string' || items[name] === null) {
+ items[name] = [items[name]];
+ }
+
+ items[name].push(value);
+ } else {
+ items[name] = value;
+ }
+ }
+
+ return items;
+ };
+
+ URI.build = function(parts) {
+ var t = '';
+ var requireAbsolutePath = false;
+
+ if (parts.protocol) {
+ t += parts.protocol + ':';
+ }
+
+ if (!parts.urn && (t || parts.hostname)) {
+ t += '//';
+ requireAbsolutePath = true;
+ }
+
+ t += (URI.buildAuthority(parts) || '');
+
+ if (typeof parts.path === 'string') {
+ if (parts.path.charAt(0) !== '/' && requireAbsolutePath) {
+ t += '/';
+ }
+
+ t += parts.path;
+ }
+
+ if (typeof parts.query === 'string' && parts.query) {
+ t += '?' + parts.query;
+ }
+
+ if (typeof parts.fragment === 'string' && parts.fragment) {
+ t += '#' + parts.fragment;
+ }
+ return t;
+ };
+ URI.buildHost = function(parts) {
+ var t = '';
+
+ if (!parts.hostname) {
+ return '';
+ } else if (URI.ip6_expression.test(parts.hostname)) {
+ t += '[' + parts.hostname + ']';
+ } else {
+ t += parts.hostname;
+ }
+
+ if (parts.port) {
+ t += ':' + parts.port;
+ }
+
+ return t;
+ };
+ URI.buildAuthority = function(parts) {
+ return URI.buildUserinfo(parts) + URI.buildHost(parts);
+ };
+ URI.buildUserinfo = function(parts) {
+ var t = '';
+
+ if (parts.username) {
+ t += URI.encode(parts.username);
+ }
+
+ if (parts.password) {
+ t += ':' + URI.encode(parts.password);
+ }
+
+ if (t) {
+ t += '@';
+ }
+
+ return t;
+ };
+ URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) {
+ // according to http://tools.ietf.org/html/rfc3986 or http://labs.apache.org/webarch/uri/rfc/rfc3986.html
+ // being »-._~!$&'()*+,;=:@/?« %HEX and alnum are allowed
+ // the RFC explicitly states ?/foo being a valid use case, no mention of parameter syntax!
+ // URI.js treats the query string as being application/x-www-form-urlencoded
+ // see http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type
+
+ var t = '';
+ var unique, key, i, length;
+ for (key in data) {
+ if (key === '__proto__') {
+ // ignore attempt at exploiting JavaScript internals
+ continue;
+ } else if (hasOwn.call(data, key)) {
+ if (isArray(data[key])) {
+ unique = {};
+ for (i = 0, length = data[key].length; i < length; i++) {
+ if (data[key][i] !== undefined && unique[data[key][i] + ''] === undefined) {
+ t += '&' + URI.buildQueryParameter(key, data[key][i], escapeQuerySpace);
+ if (duplicateQueryParameters !== true) {
+ unique[data[key][i] + ''] = true;
+ }
+ }
+ }
+ } else if (data[key] !== undefined) {
+ t += '&' + URI.buildQueryParameter(key, data[key], escapeQuerySpace);
+ }
+ }
+ }
+
+ return t.substring(1);
+ };
+ URI.buildQueryParameter = function(name, value, escapeQuerySpace) {
+ // http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type -- application/x-www-form-urlencoded
+ // don't append "=" for null values, according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#url-parameter-serialization
+ return URI.encodeQuery(name, escapeQuerySpace) + (value !== null ? '=' + URI.encodeQuery(value, escapeQuerySpace) : '');
+ };
+
+ URI.addQuery = function(data, name, value) {
+ if (typeof name === 'object') {
+ for (var key in name) {
+ if (hasOwn.call(name, key)) {
+ URI.addQuery(data, key, name[key]);
+ }
+ }
+ } else if (typeof name === 'string') {
+ if (data[name] === undefined) {
+ data[name] = value;
+ return;
+ } else if (typeof data[name] === 'string') {
+ data[name] = [data[name]];
+ }
+
+ if (!isArray(value)) {
+ value = [value];
+ }
+
+ data[name] = (data[name] || []).concat(value);
+ } else {
+ throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');
+ }
+ };
+
+ URI.setQuery = function(data, name, value) {
+ if (typeof name === 'object') {
+ for (var key in name) {
+ if (hasOwn.call(name, key)) {
+ URI.setQuery(data, key, name[key]);
+ }
+ }
+ } else if (typeof name === 'string') {
+ data[name] = value === undefined ? null : value;
+ } else {
+ throw new TypeError('URI.setQuery() accepts an object, string as the name parameter');
+ }
+ };
+
+ URI.removeQuery = function(data, name, value) {
+ var i, length, key;
+
+ if (isArray(name)) {
+ for (i = 0, length = name.length; i < length; i++) {
+ data[name[i]] = undefined;
+ }
+ } else if (getType(name) === 'RegExp') {
+ for (key in data) {
+ if (name.test(key)) {
+ data[key] = undefined;
+ }
+ }
+ } else if (typeof name === 'object') {
+ for (key in name) {
+ if (hasOwn.call(name, key)) {
+ URI.removeQuery(data, key, name[key]);
+ }
+ }
+ } else if (typeof name === 'string') {
+ if (value !== undefined) {
+ if (getType(value) === 'RegExp') {
+ if (!isArray(data[name]) && value.test(data[name])) {
+ data[name] = undefined;
+ } else {
+ data[name] = filterArrayValues(data[name], value);
+ }
+ } else if (data[name] === String(value) && (!isArray(value) || value.length === 1)) {
+ data[name] = undefined;
+ } else if (isArray(data[name])) {
+ data[name] = filterArrayValues(data[name], value);
+ }
+ } else {
+ data[name] = undefined;
+ }
+ } else {
+ throw new TypeError('URI.removeQuery() accepts an object, string, RegExp as the first parameter');
+ }
+ };
+ URI.hasQuery = function(data, name, value, withinArray) {
+ switch (getType(name)) {
+ case 'String':
+ // Nothing to do here
+ break;
+
+ case 'RegExp':
+ for (var key in data) {
+ if (hasOwn.call(data, key)) {
+ if (name.test(key) && (value === undefined || URI.hasQuery(data, key, value))) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+
+ case 'Object':
+ for (var _key in name) {
+ if (hasOwn.call(name, _key)) {
+ if (!URI.hasQuery(data, _key, name[_key])) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+
+ default:
+ throw new TypeError('URI.hasQuery() accepts a string, regular expression or object as the name parameter');
+ }
+
+ switch (getType(value)) {
+ case 'Undefined':
+ // true if exists (but may be empty)
+ return name in data; // data[name] !== undefined;
+
+ case 'Boolean':
+ // true if exists and non-empty
+ var _booly = Boolean(isArray(data[name]) ? data[name].length : data[name]);
+ return value === _booly;
+
+ case 'Function':
+ // allow complex comparison
+ return !!value(data[name], name, data);
+
+ case 'Array':
+ if (!isArray(data[name])) {
+ return false;
+ }
+
+ var op = withinArray ? arrayContains : arraysEqual;
+ return op(data[name], value);
+
+ case 'RegExp':
+ if (!isArray(data[name])) {
+ return Boolean(data[name] && data[name].match(value));
+ }
+
+ if (!withinArray) {
+ return false;
+ }
+
+ return arrayContains(data[name], value);
+
+ case 'Number':
+ value = String(value);
+ /* falls through */
+ case 'String':
+ if (!isArray(data[name])) {
+ return data[name] === value;
+ }
+
+ if (!withinArray) {
+ return false;
+ }
+
+ return arrayContains(data[name], value);
+
+ default:
+ throw new TypeError('URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter');
+ }
+ };
+
+
+ URI.joinPaths = function() {
+ var input = [];
+ var segments = [];
+ var nonEmptySegments = 0;
+
+ for (var i = 0; i < arguments.length; i++) {
+ var url = new URI(arguments[i]);
+ input.push(url);
+ var _segments = url.segment();
+ for (var s = 0; s < _segments.length; s++) {
+ if (typeof _segments[s] === 'string') {
+ segments.push(_segments[s]);
+ }
+
+ if (_segments[s]) {
+ nonEmptySegments++;
+ }
+ }
+ }
+
+ if (!segments.length || !nonEmptySegments) {
+ return new URI('');
+ }
+
+ var uri = new URI('').segment(segments);
+
+ if (input[0].path() === '' || input[0].path().slice(0, 1) === '/') {
+ uri.path('/' + uri.path());
+ }
+
+ return uri.normalize();
+ };
+
+ URI.commonPath = function(one, two) {
+ var length = Math.min(one.length, two.length);
+ var pos;
+
+ // find first non-matching character
+ for (pos = 0; pos < length; pos++) {
+ if (one.charAt(pos) !== two.charAt(pos)) {
+ pos--;
+ break;
+ }
+ }
+
+ if (pos < 1) {
+ return one.charAt(0) === two.charAt(0) && one.charAt(0) === '/' ? '/' : '';
+ }
+
+ // revert to last /
+ if (one.charAt(pos) !== '/' || two.charAt(pos) !== '/') {
+ pos = one.substring(0, pos).lastIndexOf('/');
+ }
+
+ return one.substring(0, pos + 1);
+ };
+
+ URI.withinString = function(string, callback, options) {
+ options || (options = {});
+ var _start = options.start || URI.findUri.start;
+ var _end = options.end || URI.findUri.end;
+ var _trim = options.trim || URI.findUri.trim;
+ var _parens = options.parens || URI.findUri.parens;
+ var _attributeOpen = /[a-z0-9-]=["']?$/i;
+
+ _start.lastIndex = 0;
+ while (true) {
+ var match = _start.exec(string);
+ if (!match) {
+ break;
+ }
+
+ var start = match.index;
+ if (options.ignoreHtml) {
+ // attribut(e=["']?$)
+ var attributeOpen = string.slice(Math.max(start - 3, 0), start);
+ if (attributeOpen && _attributeOpen.test(attributeOpen)) {
+ continue;
+ }
+ }
+
+ var end = start + string.slice(start).search(_end);
+ var slice = string.slice(start, end);
+ // make sure we include well balanced parens
+ var parensEnd = -1;
+ while (true) {
+ var parensMatch = _parens.exec(slice);
+ if (!parensMatch) {
+ break;
+ }
+
+ var parensMatchEnd = parensMatch.index + parensMatch[0].length;
+ parensEnd = Math.max(parensEnd, parensMatchEnd);
+ }
+
+ if (parensEnd > -1) {
+ slice = slice.slice(0, parensEnd) + slice.slice(parensEnd).replace(_trim, '');
+ } else {
+ slice = slice.replace(_trim, '');
+ }
+
+ if (slice.length <= match[0].length) {
+ // the extract only contains the starting marker of a URI,
+ // e.g. "www" or "http://"
+ continue;
+ }
+
+ if (options.ignore && options.ignore.test(slice)) {
+ continue;
+ }
+
+ end = start + slice.length;
+ var result = callback(slice, start, end, string);
+ if (result === undefined) {
+ _start.lastIndex = end;
+ continue;
+ }
+
+ result = String(result);
+ string = string.slice(0, start) + result + string.slice(end);
+ _start.lastIndex = start + result.length;
+ }
+
+ _start.lastIndex = 0;
+ return string;
+ };
+
+ URI.ensureValidHostname = function(v, protocol) {
+ // Theoretically URIs allow percent-encoding in Hostnames (according to RFC 3986)
+ // they are not part of DNS and therefore ignored by URI.js
+
+ var hasHostname = !!v; // not null and not an empty string
+ var hasProtocol = !!protocol;
+ var rejectEmptyHostname = false;
+
+ if (hasProtocol) {
+ rejectEmptyHostname = arrayContains(URI.hostProtocols, protocol);
+ }
+
+ if (rejectEmptyHostname && !hasHostname) {
+ throw new TypeError('Hostname cannot be empty, if protocol is ' + protocol);
+ } else if (v && v.match(URI.invalid_hostname_characters)) {
+ // test punycode
+ if (!punycode) {
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');
+ }
+ if (punycode.toASCII(v).match(URI.invalid_hostname_characters)) {
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-:_]');
+ }
+ }
+ };
+
+ URI.ensureValidPort = function (v) {
+ if (!v) {
+ return;
+ }
+
+ var port = Number(v);
+ if (isInteger(port) && (port > 0) && (port < 65536)) {
+ return;
+ }
+
+ throw new TypeError('Port "' + v + '" is not a valid port');
+ };
+
+ // noConflict
+ URI.noConflict = function(removeAll) {
+ if (removeAll) {
+ var unconflicted = {
+ URI: this.noConflict()
+ };
+
+ if (root.URITemplate && typeof root.URITemplate.noConflict === 'function') {
+ unconflicted.URITemplate = root.URITemplate.noConflict();
+ }
+
+ if (root.IPv6 && typeof root.IPv6.noConflict === 'function') {
+ unconflicted.IPv6 = root.IPv6.noConflict();
+ }
+
+ if (root.SecondLevelDomains && typeof root.SecondLevelDomains.noConflict === 'function') {
+ unconflicted.SecondLevelDomains = root.SecondLevelDomains.noConflict();
+ }
+
+ return unconflicted;
+ } else if (root.URI === this) {
+ root.URI = _URI;
+ }
+
+ return this;
+ };
+
+ p.build = function(deferBuild) {
+ if (deferBuild === true) {
+ this._deferred_build = true;
+ } else if (deferBuild === undefined || this._deferred_build) {
+ this._string = URI.build(this._parts);
+ this._deferred_build = false;
+ }
+
+ return this;
+ };
+
+ p.clone = function() {
+ return new URI(this);
+ };
+
+ p.valueOf = p.toString = function() {
+ return this.build(false)._string;
+ };
+
+
+ function generateSimpleAccessor(_part){
+ return function(v, build) {
+ if (v === undefined) {
+ return this._parts[_part] || '';
+ } else {
+ this._parts[_part] = v || null;
+ this.build(!build);
+ return this;
+ }
+ };
+ }
+
+ function generatePrefixAccessor(_part, _key){
+ return function(v, build) {
+ if (v === undefined) {
+ return this._parts[_part] || '';
+ } else {
+ if (v !== null) {
+ v = v + '';
+ if (v.charAt(0) === _key) {
+ v = v.substring(1);
+ }
+ }
+
+ this._parts[_part] = v;
+ this.build(!build);
+ return this;
+ }
+ };
+ }
+
+ p.protocol = generateSimpleAccessor('protocol');
+ p.username = generateSimpleAccessor('username');
+ p.password = generateSimpleAccessor('password');
+ p.hostname = generateSimpleAccessor('hostname');
+ p.port = generateSimpleAccessor('port');
+ p.query = generatePrefixAccessor('query', '?');
+ p.fragment = generatePrefixAccessor('fragment', '#');
+
+ p.search = function(v, build) {
+ var t = this.query(v, build);
+ return typeof t === 'string' && t.length ? ('?' + t) : t;
+ };
+ p.hash = function(v, build) {
+ var t = this.fragment(v, build);
+ return typeof t === 'string' && t.length ? ('#' + t) : t;
+ };
+
+ p.pathname = function(v, build) {
+ if (v === undefined || v === true) {
+ var res = this._parts.path || (this._parts.hostname ? '/' : '');
+ return v ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res;
+ } else {
+ if (this._parts.urn) {
+ this._parts.path = v ? URI.recodeUrnPath(v) : '';
+ } else {
+ this._parts.path = v ? URI.recodePath(v) : '/';
+ }
+ this.build(!build);
+ return this;
+ }
+ };
+ p.path = p.pathname;
+ p.href = function(href, build) {
+ var key;
+
+ if (href === undefined) {
+ return this.toString();
+ }
+
+ this._string = '';
+ this._parts = URI._parts();
+
+ var _URI = href instanceof URI;
+ var _object = typeof href === 'object' && (href.hostname || href.path || href.pathname);
+ if (href.nodeName) {
+ var attribute = URI.getDomAttribute(href);
+ href = href[attribute] || '';
+ _object = false;
+ }
+
+ // window.location is reported to be an object, but it's not the sort
+ // of object we're looking for:
+ // * location.protocol ends with a colon
+ // * location.query != object.search
+ // * location.hash != object.fragment
+ // simply serializing the unknown object should do the trick
+ // (for location, not for everything...)
+ if (!_URI && _object && href.pathname !== undefined) {
+ href = href.toString();
+ }
+
+ if (typeof href === 'string' || href instanceof String) {
+ this._parts = URI.parse(String(href), this._parts);
+ } else if (_URI || _object) {
+ var src = _URI ? href._parts : href;
+ for (key in src) {
+ if (key === 'query') { continue; }
+ if (hasOwn.call(this._parts, key)) {
+ this._parts[key] = src[key];
+ }
+ }
+ if (src.query) {
+ this.query(src.query, false);
+ }
+ } else {
+ throw new TypeError('invalid input');
+ }
+
+ this.build(!build);
+ return this;
+ };
+
+ // identification accessors
+ p.is = function(what) {
+ var ip = false;
+ var ip4 = false;
+ var ip6 = false;
+ var name = false;
+ var sld = false;
+ var idn = false;
+ var punycode = false;
+ var relative = !this._parts.urn;
+
+ if (this._parts.hostname) {
+ relative = false;
+ ip4 = URI.ip4_expression.test(this._parts.hostname);
+ ip6 = URI.ip6_expression.test(this._parts.hostname);
+ ip = ip4 || ip6;
+ name = !ip;
+ sld = name && SLD && SLD.has(this._parts.hostname);
+ idn = name && URI.idn_expression.test(this._parts.hostname);
+ punycode = name && URI.punycode_expression.test(this._parts.hostname);
+ }
+
+ switch (what.toLowerCase()) {
+ case 'relative':
+ return relative;
+
+ case 'absolute':
+ return !relative;
+
+ // hostname identification
+ case 'domain':
+ case 'name':
+ return name;
+
+ case 'sld':
+ return sld;
+
+ case 'ip':
+ return ip;
+
+ case 'ip4':
+ case 'ipv4':
+ case 'inet4':
+ return ip4;
+
+ case 'ip6':
+ case 'ipv6':
+ case 'inet6':
+ return ip6;
+
+ case 'idn':
+ return idn;
+
+ case 'url':
+ return !this._parts.urn;
+
+ case 'urn':
+ return !!this._parts.urn;
+
+ case 'punycode':
+ return punycode;
+ }
+
+ return null;
+ };
+
+ // component specific input validation
+ var _protocol = p.protocol;
+ var _port = p.port;
+ var _hostname = p.hostname;
+
+ p.protocol = function(v, build) {
+ if (v) {
+ // accept trailing ://
+ v = v.replace(/:(\/\/)?$/, '');
+
+ if (!v.match(URI.protocol_expression)) {
+ throw new TypeError('Protocol "' + v + '" contains characters other than [A-Z0-9.+-] or doesn\'t start with [A-Z]');
+ }
+ }
+
+ return _protocol.call(this, v, build);
+ };
+ p.scheme = p.protocol;
+ p.port = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v !== undefined) {
+ if (v === 0) {
+ v = null;
+ }
+
+ if (v) {
+ v += '';
+ if (v.charAt(0) === ':') {
+ v = v.substring(1);
+ }
+
+ URI.ensureValidPort(v);
+ }
+ }
+ return _port.call(this, v, build);
+ };
+ p.hostname = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v !== undefined) {
+ var x = { preventInvalidHostname: this._parts.preventInvalidHostname };
+ var res = URI.parseHost(v, x);
+ if (res !== '/') {
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
+ }
+
+ v = x.hostname;
+ if (this._parts.preventInvalidHostname) {
+ URI.ensureValidHostname(v, this._parts.protocol);
+ }
+ }
+
+ return _hostname.call(this, v, build);
+ };
+
+ // compound accessors
+ p.origin = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined) {
+ var protocol = this.protocol();
+ var authority = this.authority();
+ if (!authority) {
+ return '';
+ }
+
+ return (protocol ? protocol + '://' : '') + this.authority();
+ } else {
+ var origin = URI(v);
+ this
+ .protocol(origin.protocol())
+ .authority(origin.authority())
+ .build(!build);
+ return this;
+ }
+ };
+ p.host = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined) {
+ return this._parts.hostname ? URI.buildHost(this._parts) : '';
+ } else {
+ var res = URI.parseHost(v, this._parts);
+ if (res !== '/') {
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
+ }
+
+ this.build(!build);
+ return this;
+ }
+ };
+ p.authority = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined) {
+ return this._parts.hostname ? URI.buildAuthority(this._parts) : '';
+ } else {
+ var res = URI.parseAuthority(v, this._parts);
+ if (res !== '/') {
+ throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]');
+ }
+
+ this.build(!build);
+ return this;
+ }
+ };
+ p.userinfo = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined) {
+ var t = URI.buildUserinfo(this._parts);
+ return t ? t.substring(0, t.length -1) : t;
+ } else {
+ if (v[v.length-1] !== '@') {
+ v += '@';
+ }
+
+ URI.parseUserinfo(v, this._parts);
+ this.build(!build);
+ return this;
+ }
+ };
+ p.resource = function(v, build) {
+ var parts;
+
+ if (v === undefined) {
+ return this.path() + this.search() + this.hash();
+ }
+
+ parts = URI.parse(v);
+ this._parts.path = parts.path;
+ this._parts.query = parts.query;
+ this._parts.fragment = parts.fragment;
+ this.build(!build);
+ return this;
+ };
+
+ // fraction accessors
+ p.subdomain = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ // convenience, return "www" from "www.example.org"
+ if (v === undefined) {
+ if (!this._parts.hostname || this.is('IP')) {
+ return '';
+ }
+
+ // grab domain and add another segment
+ var end = this._parts.hostname.length - this.domain().length - 1;
+ return this._parts.hostname.substring(0, end) || '';
+ } else {
+ var e = this._parts.hostname.length - this.domain().length;
+ var sub = this._parts.hostname.substring(0, e);
+ var replace = new RegExp('^' + escapeRegEx(sub));
+
+ if (v && v.charAt(v.length - 1) !== '.') {
+ v += '.';
+ }
+
+ if (v.indexOf(':') !== -1) {
+ throw new TypeError('Domains cannot contain colons');
+ }
+
+ if (v) {
+ URI.ensureValidHostname(v, this._parts.protocol);
+ }
+
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
+ this.build(!build);
+ return this;
+ }
+ };
+ p.domain = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (typeof v === 'boolean') {
+ build = v;
+ v = undefined;
+ }
+
+ // convenience, return "example.org" from "www.example.org"
+ if (v === undefined) {
+ if (!this._parts.hostname || this.is('IP')) {
+ return '';
+ }
+
+ // if hostname consists of 1 or 2 segments, it must be the domain
+ var t = this._parts.hostname.match(/\./g);
+ if (t && t.length < 2) {
+ return this._parts.hostname;
+ }
+
+ // grab tld and add another segment
+ var end = this._parts.hostname.length - this.tld(build).length - 1;
+ end = this._parts.hostname.lastIndexOf('.', end -1) + 1;
+ return this._parts.hostname.substring(end) || '';
+ } else {
+ if (!v) {
+ throw new TypeError('cannot set domain empty');
+ }
+
+ if (v.indexOf(':') !== -1) {
+ throw new TypeError('Domains cannot contain colons');
+ }
+
+ URI.ensureValidHostname(v, this._parts.protocol);
+
+ if (!this._parts.hostname || this.is('IP')) {
+ this._parts.hostname = v;
+ } else {
+ var replace = new RegExp(escapeRegEx(this.domain()) + '$');
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
+ }
+
+ this.build(!build);
+ return this;
+ }
+ };
+ p.tld = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (typeof v === 'boolean') {
+ build = v;
+ v = undefined;
+ }
+
+ // return "org" from "www.example.org"
+ if (v === undefined) {
+ if (!this._parts.hostname || this.is('IP')) {
+ return '';
+ }
+
+ var pos = this._parts.hostname.lastIndexOf('.');
+ var tld = this._parts.hostname.substring(pos + 1);
+
+ if (build !== true && SLD && SLD.list[tld.toLowerCase()]) {
+ return SLD.get(this._parts.hostname) || tld;
+ }
+
+ return tld;
+ } else {
+ var replace;
+
+ if (!v) {
+ throw new TypeError('cannot set TLD empty');
+ } else if (v.match(/[^a-zA-Z0-9-]/)) {
+ if (SLD && SLD.is(v)) {
+ replace = new RegExp(escapeRegEx(this.tld()) + '$');
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
+ } else {
+ throw new TypeError('TLD "' + v + '" contains characters other than [A-Z0-9]');
+ }
+ } else if (!this._parts.hostname || this.is('IP')) {
+ throw new ReferenceError('cannot set TLD on non-domain host');
+ } else {
+ replace = new RegExp(escapeRegEx(this.tld()) + '$');
+ this._parts.hostname = this._parts.hostname.replace(replace, v);
+ }
+
+ this.build(!build);
+ return this;
+ }
+ };
+ p.directory = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined || v === true) {
+ if (!this._parts.path && !this._parts.hostname) {
+ return '';
+ }
+
+ if (this._parts.path === '/') {
+ return '/';
+ }
+
+ var end = this._parts.path.length - this.filename().length - 1;
+ var res = this._parts.path.substring(0, end) || (this._parts.hostname ? '/' : '');
+
+ return v ? URI.decodePath(res) : res;
+
+ } else {
+ var e = this._parts.path.length - this.filename().length;
+ var directory = this._parts.path.substring(0, e);
+ var replace = new RegExp('^' + escapeRegEx(directory));
+
+ // fully qualifier directories begin with a slash
+ if (!this.is('relative')) {
+ if (!v) {
+ v = '/';
+ }
+
+ if (v.charAt(0) !== '/') {
+ v = '/' + v;
+ }
+ }
+
+ // directories always end with a slash
+ if (v && v.charAt(v.length - 1) !== '/') {
+ v += '/';
+ }
+
+ v = URI.recodePath(v);
+ this._parts.path = this._parts.path.replace(replace, v);
+ this.build(!build);
+ return this;
+ }
+ };
+ p.filename = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (typeof v !== 'string') {
+ if (!this._parts.path || this._parts.path === '/') {
+ return '';
+ }
+
+ var pos = this._parts.path.lastIndexOf('/');
+ var res = this._parts.path.substring(pos+1);
+
+ return v ? URI.decodePathSegment(res) : res;
+ } else {
+ var mutatedDirectory = false;
+
+ if (v.charAt(0) === '/') {
+ v = v.substring(1);
+ }
+
+ if (v.match(/\.?\//)) {
+ mutatedDirectory = true;
+ }
+
+ var replace = new RegExp(escapeRegEx(this.filename()) + '$');
+ v = URI.recodePath(v);
+ this._parts.path = this._parts.path.replace(replace, v);
+
+ if (mutatedDirectory) {
+ this.normalizePath(build);
+ } else {
+ this.build(!build);
+ }
+
+ return this;
+ }
+ };
+ p.suffix = function(v, build) {
+ if (this._parts.urn) {
+ return v === undefined ? '' : this;
+ }
+
+ if (v === undefined || v === true) {
+ if (!this._parts.path || this._parts.path === '/') {
+ return '';
+ }
+
+ var filename = this.filename();
+ var pos = filename.lastIndexOf('.');
+ var s, res;
+
+ if (pos === -1) {
+ return '';
+ }
+
+ // suffix may only contain alnum characters (yup, I made this up.)
+ s = filename.substring(pos+1);
+ res = (/^[a-z0-9%]+$/i).test(s) ? s : '';
+ return v ? URI.decodePathSegment(res) : res;
+ } else {
+ if (v.charAt(0) === '.') {
+ v = v.substring(1);
+ }
+
+ var suffix = this.suffix();
+ var replace;
+
+ if (!suffix) {
+ if (!v) {
+ return this;
+ }
+
+ this._parts.path += '.' + URI.recodePath(v);
+ } else if (!v) {
+ replace = new RegExp(escapeRegEx('.' + suffix) + '$');
+ } else {
+ replace = new RegExp(escapeRegEx(suffix) + '$');
+ }
+
+ if (replace) {
+ v = URI.recodePath(v);
+ this._parts.path = this._parts.path.replace(replace, v);
+ }
+
+ this.build(!build);
+ return this;
+ }
+ };
+ p.segment = function(segment, v, build) {
+ var separator = this._parts.urn ? ':' : '/';
+ var path = this.path();
+ var absolute = path.substring(0, 1) === '/';
+ var segments = path.split(separator);
+
+ if (segment !== undefined && typeof segment !== 'number') {
+ build = v;
+ v = segment;
+ segment = undefined;
+ }
+
+ if (segment !== undefined && typeof segment !== 'number') {
+ throw new Error('Bad segment "' + segment + '", must be 0-based integer');
+ }
+
+ if (absolute) {
+ segments.shift();
+ }
+
+ if (segment < 0) {
+ // allow negative indexes to address from the end
+ segment = Math.max(segments.length + segment, 0);
+ }
+
+ if (v === undefined) {
+ /*jshint laxbreak: true */
+ return segment === undefined
+ ? segments
+ : segments[segment];
+ /*jshint laxbreak: false */
+ } else if (segment === null || segments[segment] === undefined) {
+ if (isArray(v)) {
+ segments = [];
+ // collapse empty elements within array
+ for (var i=0, l=v.length; i < l; i++) {
+ if (!v[i].length && (!segments.length || !segments[segments.length -1].length)) {
+ continue;
+ }
+
+ if (segments.length && !segments[segments.length -1].length) {
+ segments.pop();
+ }
+
+ segments.push(trimSlashes(v[i]));
+ }
+ } else if (v || typeof v === 'string') {
+ v = trimSlashes(v);
+ if (segments[segments.length -1] === '') {
+ // empty trailing elements have to be overwritten
+ // to prevent results such as /foo//bar
+ segments[segments.length -1] = v;
+ } else {
+ segments.push(v);
+ }
+ }
+ } else {
+ if (v) {
+ segments[segment] = trimSlashes(v);
+ } else {
+ segments.splice(segment, 1);
+ }
+ }
+
+ if (absolute) {
+ segments.unshift('');
+ }
+
+ return this.path(segments.join(separator), build);
+ };
+ p.segmentCoded = function(segment, v, build) {
+ var segments, i, l;
+
+ if (typeof segment !== 'number') {
+ build = v;
+ v = segment;
+ segment = undefined;
+ }
+
+ if (v === undefined) {
+ segments = this.segment(segment, v, build);
+ if (!isArray(segments)) {
+ segments = segments !== undefined ? URI.decode(segments) : undefined;
+ } else {
+ for (i = 0, l = segments.length; i < l; i++) {
+ segments[i] = URI.decode(segments[i]);
+ }
+ }
+
+ return segments;
+ }
+
+ if (!isArray(v)) {
+ v = (typeof v === 'string' || v instanceof String) ? URI.encode(v) : v;
+ } else {
+ for (i = 0, l = v.length; i < l; i++) {
+ v[i] = URI.encode(v[i]);
+ }
+ }
+
+ return this.segment(segment, v, build);
+ };
+
+ // mutating query string
+ var q = p.query;
+ p.query = function(v, build) {
+ if (v === true) {
+ return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ } else if (typeof v === 'function') {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ var result = v.call(this, data);
+ this._parts.query = URI.buildQuery(result || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ this.build(!build);
+ return this;
+ } else if (v !== undefined && typeof v !== 'string') {
+ this._parts.query = URI.buildQuery(v, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ this.build(!build);
+ return this;
+ } else {
+ return q.call(this, v, build);
+ }
+ };
+ p.setQuery = function(name, value, build) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+
+ if (typeof name === 'string' || name instanceof String) {
+ data[name] = value !== undefined ? value : null;
+ } else if (typeof name === 'object') {
+ for (var key in name) {
+ if (hasOwn.call(name, key)) {
+ data[key] = name[key];
+ }
+ }
+ } else {
+ throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');
+ }
+
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ if (typeof name !== 'string') {
+ build = value;
+ }
+
+ this.build(!build);
+ return this;
+ };
+ p.addQuery = function(name, value, build) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ URI.addQuery(data, name, value === undefined ? null : value);
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ if (typeof name !== 'string') {
+ build = value;
+ }
+
+ this.build(!build);
+ return this;
+ };
+ p.removeQuery = function(name, value, build) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ URI.removeQuery(data, name, value);
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ if (typeof name !== 'string') {
+ build = value;
+ }
+
+ this.build(!build);
+ return this;
+ };
+ p.hasQuery = function(name, value, withinArray) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ return URI.hasQuery(data, name, value, withinArray);
+ };
+ p.setSearch = p.setQuery;
+ p.addSearch = p.addQuery;
+ p.removeSearch = p.removeQuery;
+ p.hasSearch = p.hasQuery;
+
+ // sanitizing URLs
+ p.normalize = function() {
+ if (this._parts.urn) {
+ return this
+ .normalizeProtocol(false)
+ .normalizePath(false)
+ .normalizeQuery(false)
+ .normalizeFragment(false)
+ .build();
+ }
+
+ return this
+ .normalizeProtocol(false)
+ .normalizeHostname(false)
+ .normalizePort(false)
+ .normalizePath(false)
+ .normalizeQuery(false)
+ .normalizeFragment(false)
+ .build();
+ };
+ p.normalizeProtocol = function(build) {
+ if (typeof this._parts.protocol === 'string') {
+ this._parts.protocol = this._parts.protocol.toLowerCase();
+ this.build(!build);
+ }
+
+ return this;
+ };
+ p.normalizeHostname = function(build) {
+ if (this._parts.hostname) {
+ if (this.is('IDN') && punycode) {
+ this._parts.hostname = punycode.toASCII(this._parts.hostname);
+ } else if (this.is('IPv6') && IPv6) {
+ this._parts.hostname = IPv6.best(this._parts.hostname);
+ }
+
+ this._parts.hostname = this._parts.hostname.toLowerCase();
+ this.build(!build);
+ }
+
+ return this;
+ };
+ p.normalizePort = function(build) {
+ // remove port of it's the protocol's default
+ if (typeof this._parts.protocol === 'string' && this._parts.port === URI.defaultPorts[this._parts.protocol]) {
+ this._parts.port = null;
+ this.build(!build);
+ }
+
+ return this;
+ };
+ p.normalizePath = function(build) {
+ var _path = this._parts.path;
+ if (!_path) {
+ return this;
+ }
+
+ if (this._parts.urn) {
+ this._parts.path = URI.recodeUrnPath(this._parts.path);
+ this.build(!build);
+ return this;
+ }
+
+ if (this._parts.path === '/') {
+ return this;
+ }
+
+ _path = URI.recodePath(_path);
+
+ var _was_relative;
+ var _leadingParents = '';
+ var _parent, _pos;
+
+ // handle relative paths
+ if (_path.charAt(0) !== '/') {
+ _was_relative = true;
+ _path = '/' + _path;
+ }
+
+ // handle relative files (as opposed to directories)
+ if (_path.slice(-3) === '/..' || _path.slice(-2) === '/.') {
+ _path += '/';
+ }
+
+ // resolve simples
+ _path = _path
+ .replace(/(\/(\.\/)+)|(\/\.$)/g, '/')
+ .replace(/\/{2,}/g, '/');
+
+ // remember leading parents
+ if (_was_relative) {
+ _leadingParents = _path.substring(1).match(/^(\.\.\/)+/) || '';
+ if (_leadingParents) {
+ _leadingParents = _leadingParents[0];
+ }
+ }
+
+ // resolve parents
+ while (true) {
+ _parent = _path.search(/\/\.\.(\/|$)/);
+ if (_parent === -1) {
+ // no more ../ to resolve
+ break;
+ } else if (_parent === 0) {
+ // top level cannot be relative, skip it
+ _path = _path.substring(3);
+ continue;
+ }
+
+ _pos = _path.substring(0, _parent).lastIndexOf('/');
+ if (_pos === -1) {
+ _pos = _parent;
+ }
+ _path = _path.substring(0, _pos) + _path.substring(_parent + 3);
+ }
+
+ // revert to relative
+ if (_was_relative && this.is('relative')) {
+ _path = _leadingParents + _path.substring(1);
+ }
+
+ this._parts.path = _path;
+ this.build(!build);
+ return this;
+ };
+ p.normalizePathname = p.normalizePath;
+ p.normalizeQuery = function(build) {
+ if (typeof this._parts.query === 'string') {
+ if (!this._parts.query.length) {
+ this._parts.query = null;
+ } else {
+ this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace));
+ }
+
+ this.build(!build);
+ }
+
+ return this;
+ };
+ p.normalizeFragment = function(build) {
+ if (!this._parts.fragment) {
+ this._parts.fragment = null;
+ this.build(!build);
+ }
+
+ return this;
+ };
+ p.normalizeSearch = p.normalizeQuery;
+ p.normalizeHash = p.normalizeFragment;
+
+ p.iso8859 = function() {
+ // expect unicode input, iso8859 output
+ var e = URI.encode;
+ var d = URI.decode;
+
+ URI.encode = escape;
+ URI.decode = decodeURIComponent;
+ try {
+ this.normalize();
+ } finally {
+ URI.encode = e;
+ URI.decode = d;
+ }
+ return this;
+ };
+
+ p.unicode = function() {
+ // expect iso8859 input, unicode output
+ var e = URI.encode;
+ var d = URI.decode;
+
+ URI.encode = strictEncodeURIComponent;
+ URI.decode = unescape;
+ try {
+ this.normalize();
+ } finally {
+ URI.encode = e;
+ URI.decode = d;
+ }
+ return this;
+ };
+
+ p.readable = function() {
+ var uri = this.clone();
+ // removing username, password, because they shouldn't be displayed according to RFC 3986
+ uri.username('').password('').normalize();
+ var t = '';
+ if (uri._parts.protocol) {
+ t += uri._parts.protocol + '://';
+ }
+
+ if (uri._parts.hostname) {
+ if (uri.is('punycode') && punycode) {
+ t += punycode.toUnicode(uri._parts.hostname);
+ if (uri._parts.port) {
+ t += ':' + uri._parts.port;
+ }
+ } else {
+ t += uri.host();
+ }
+ }
+
+ if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== '/') {
+ t += '/';
+ }
+
+ t += uri.path(true);
+ if (uri._parts.query) {
+ var q = '';
+ for (var i = 0, qp = uri._parts.query.split('&'), l = qp.length; i < l; i++) {
+ var kv = (qp[i] || '').split('=');
+ q += '&' + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace)
+ .replace(/&/g, '%26');
+
+ if (kv[1] !== undefined) {
+ q += '=' + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace)
+ .replace(/&/g, '%26');
+ }
+ }
+ t += '?' + q.substring(1);
+ }
+
+ t += URI.decodeQuery(uri.hash(), true);
+ return t;
+ };
+
+ // resolving relative and absolute URLs
+ p.absoluteTo = function(base) {
+ var resolved = this.clone();
+ var properties = ['protocol', 'username', 'password', 'hostname', 'port'];
+ var basedir, i, p;
+
+ if (this._parts.urn) {
+ throw new Error('URNs do not have any generally defined hierarchical components');
+ }
+
+ if (!(base instanceof URI)) {
+ base = new URI(base);
+ }
+
+ if (resolved._parts.protocol) {
+ // Directly returns even if this._parts.hostname is empty.
+ return resolved;
+ } else {
+ resolved._parts.protocol = base._parts.protocol;
+ }
+
+ if (this._parts.hostname) {
+ return resolved;
+ }
+
+ for (i = 0; (p = properties[i]); i++) {
+ resolved._parts[p] = base._parts[p];
+ }
+
+ if (!resolved._parts.path) {
+ resolved._parts.path = base._parts.path;
+ if (!resolved._parts.query) {
+ resolved._parts.query = base._parts.query;
+ }
+ } else {
+ if (resolved._parts.path.substring(-2) === '..') {
+ resolved._parts.path += '/';
+ }
+
+ if (resolved.path().charAt(0) !== '/') {
+ basedir = base.directory();
+ basedir = basedir ? basedir : base.path().indexOf('/') === 0 ? '/' : '';
+ resolved._parts.path = (basedir ? (basedir + '/') : '') + resolved._parts.path;
+ resolved.normalizePath();
+ }
+ }
+
+ resolved.build();
+ return resolved;
+ };
+ p.relativeTo = function(base) {
+ var relative = this.clone().normalize();
+ var relativeParts, baseParts, common, relativePath, basePath;
+
+ if (relative._parts.urn) {
+ throw new Error('URNs do not have any generally defined hierarchical components');
+ }
+
+ base = new URI(base).normalize();
+ relativeParts = relative._parts;
+ baseParts = base._parts;
+ relativePath = relative.path();
+ basePath = base.path();
+
+ if (relativePath.charAt(0) !== '/') {
+ throw new Error('URI is already relative');
+ }
+
+ if (basePath.charAt(0) !== '/') {
+ throw new Error('Cannot calculate a URI relative to another relative URI');
+ }
+
+ if (relativeParts.protocol === baseParts.protocol) {
+ relativeParts.protocol = null;
+ }
+
+ if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) {
+ return relative.build();
+ }
+
+ if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) {
+ return relative.build();
+ }
+
+ if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) {
+ relativeParts.hostname = null;
+ relativeParts.port = null;
+ } else {
+ return relative.build();
+ }
+
+ if (relativePath === basePath) {
+ relativeParts.path = '';
+ return relative.build();
+ }
+
+ // determine common sub path
+ common = URI.commonPath(relativePath, basePath);
+
+ // If the paths have nothing in common, return a relative URL with the absolute path.
+ if (!common) {
+ return relative.build();
+ }
+
+ var parents = baseParts.path
+ .substring(common.length)
+ .replace(/[^\/]*$/, '')
+ .replace(/.*?\//g, '../');
+
+ relativeParts.path = (parents + relativeParts.path.substring(common.length)) || './';
+
+ return relative.build();
+ };
+
+ // comparing URIs
+ p.equals = function(uri) {
+ var one = this.clone();
+ var two = new URI(uri);
+ var one_map = {};
+ var two_map = {};
+ var checked = {};
+ var one_query, two_query, key;
+
+ one.normalize();
+ two.normalize();
+
+ // exact match
+ if (one.toString() === two.toString()) {
+ return true;
+ }
+
+ // extract query string
+ one_query = one.query();
+ two_query = two.query();
+ one.query('');
+ two.query('');
+
+ // definitely not equal if not even non-query parts match
+ if (one.toString() !== two.toString()) {
+ return false;
+ }
+
+ // query parameters have the same length, even if they're permuted
+ if (one_query.length !== two_query.length) {
+ return false;
+ }
+
+ one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace);
+ two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace);
+
+ for (key in one_map) {
+ if (hasOwn.call(one_map, key)) {
+ if (!isArray(one_map[key])) {
+ if (one_map[key] !== two_map[key]) {
+ return false;
+ }
+ } else if (!arraysEqual(one_map[key], two_map[key])) {
+ return false;
+ }
+
+ checked[key] = true;
+ }
+ }
+
+ for (key in two_map) {
+ if (hasOwn.call(two_map, key)) {
+ if (!checked[key]) {
+ // two contains a parameter not present in one
+ return false;
+ }
+ }
+ }
+
+ return true;
+ };
+
+ // state
+ p.preventInvalidHostname = function(v) {
+ this._parts.preventInvalidHostname = !!v;
+ return this;
+ };
+
+ p.duplicateQueryParameters = function(v) {
+ this._parts.duplicateQueryParameters = !!v;
+ return this;
+ };
+
+ p.escapeQuerySpace = function(v) {
+ this._parts.escapeQuerySpace = !!v;
+ return this;
+ };
+
+ return URI;
+ }));
+ } (URI));
+
+ var Uri = URI.exports;
+
+ /**
+ * @private
+ */
+ function appendForwardSlash(url) {
+ if (url.length === 0 || url[url.length - 1] !== "/") {
+ url = `${url}/`;
+ }
+ return url;
+ }
+
+ /**
+ * Clones an object, returning a new object containing the same properties.
+ *
+ * @function
+ *
+ * @param {Object} object The object to clone.
+ * @param {Boolean} [deep=false] If true, all properties will be deep cloned recursively.
+ * @returns {Object} The cloned object.
+ */
+ function clone(object, deep) {
+ if (object === null || typeof object !== "object") {
+ return object;
+ }
+
+ deep = defaultValue.defaultValue(deep, false);
+
+ const result = new object.constructor();
+ for (const propertyName in object) {
+ if (object.hasOwnProperty(propertyName)) {
+ let value = object[propertyName];
+ if (deep) {
+ value = clone(value, deep);
+ }
+ result[propertyName] = value;
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * A function used to resolve a promise upon completion .
+ * @callback defer.resolve
+ *
+ * @param {*} value The resulting value.
+ */
+
+ /**
+ * A function used to reject a promise upon failure.
+ * @callback defer.reject
+ *
+ * @param {*} error The error.
+ */
+
+ /**
+ * An object which contains a promise object, and functions to resolve or reject the promise.
+ *
+ * @typedef {Object} defer.deferred
+ * @property {defer.resolve} resolve Resolves the promise when called.
+ * @property {defer.reject} reject Rejects the promise when called.
+ * @property {Promise} promise Promise object.
+ */
+
+ /**
+ * Creates a deferred object, containing a promise object, and functions to resolve or reject the promise.
+ * @returns {defer.deferred}
+ * @private
+ */
+ function defer() {
+ let resolve;
+ let reject;
+ const promise = new Promise(function (res, rej) {
+ resolve = res;
+ reject = rej;
+ });
+
+ return {
+ resolve: resolve,
+ reject: reject,
+ promise: promise,
+ };
+ }
+
+ /**
+ * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.
+ * @function
+ *
+ * @param {String} relative The relative Uri.
+ * @param {String} [base] The base Uri.
+ * @returns {String} The absolute Uri of the given relative Uri.
+ *
+ * @example
+ * //absolute Uri will be "https://test.com/awesome.png";
+ * const absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');
+ */
+ function getAbsoluteUri(relative, base) {
+ let documentObject;
+ if (typeof document !== "undefined") {
+ documentObject = document;
+ }
+
+ return getAbsoluteUri._implementation(relative, base, documentObject);
+ }
+
+ getAbsoluteUri._implementation = function (relative, base, documentObject) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(relative)) {
+ throw new Check.DeveloperError("relative uri is required.");
+ }
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(base)) {
+ if (typeof documentObject === "undefined") {
+ return relative;
+ }
+ base = defaultValue.defaultValue(documentObject.baseURI, documentObject.location.href);
+ }
+
+ const relativeUri = new Uri(relative);
+ if (relativeUri.scheme() !== "") {
+ return relativeUri.toString();
+ }
+ return relativeUri.absoluteTo(base).toString();
+ };
+
+ /**
+ * Given a URI, returns the base path of the URI.
+ * @function
+ *
+ * @param {String} uri The Uri.
+ * @param {Boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri
+ * @returns {String} The base path of the Uri.
+ *
+ * @example
+ * // basePath will be "/Gallery/";
+ * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false');
+ *
+ * // basePath will be "/Gallery/?value=true&example=false";
+ * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);
+ */
+ function getBaseUri(uri, includeQuery) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(uri)) {
+ throw new Check.DeveloperError("uri is required.");
+ }
+ //>>includeEnd('debug');
+
+ let basePath = "";
+ const i = uri.lastIndexOf("/");
+ if (i !== -1) {
+ basePath = uri.substring(0, i + 1);
+ }
+
+ if (!includeQuery) {
+ return basePath;
+ }
+
+ uri = new Uri(uri);
+ if (uri.query().length !== 0) {
+ basePath += `?${uri.query()}`;
+ }
+ if (uri.fragment().length !== 0) {
+ basePath += `#${uri.fragment()}`;
+ }
+
+ return basePath;
+ }
+
+ /**
+ * Given a URI, returns the extension of the URI.
+ * @function getExtensionFromUri
+ *
+ * @param {String} uri The Uri.
+ * @returns {String} The extension of the Uri.
+ *
+ * @example
+ * //extension will be "czml";
+ * const extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');
+ */
+ function getExtensionFromUri(uri) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(uri)) {
+ throw new Check.DeveloperError("uri is required.");
+ }
+ //>>includeEnd('debug');
+
+ const uriObject = new Uri(uri);
+ uriObject.normalize();
+ let path = uriObject.path();
+ let index = path.lastIndexOf("/");
+ if (index !== -1) {
+ path = path.substr(index + 1);
+ }
+ index = path.lastIndexOf(".");
+ if (index === -1) {
+ path = "";
+ } else {
+ path = path.substr(index + 1);
+ }
+ return path;
+ }
+
+ const context2DsByWidthAndHeight = {};
+
+ /**
+ * Extract a pixel array from a loaded image. Draws the image
+ * into a canvas so it can read the pixels back.
+ *
+ * @function getImagePixels
+ *
+ * @param {HTMLImageElement|ImageBitmap} image The image to extract pixels from.
+ * @param {Number} width The width of the image. If not defined, then image.width is assigned.
+ * @param {Number} height The height of the image. If not defined, then image.height is assigned.
+ * @returns {ImageData} The pixels of the image.
+ */
+ function getImagePixels(image, width, height) {
+ if (!defaultValue.defined(width)) {
+ width = image.width;
+ }
+ if (!defaultValue.defined(height)) {
+ height = image.height;
+ }
+
+ let context2DsByHeight = context2DsByWidthAndHeight[width];
+ if (!defaultValue.defined(context2DsByHeight)) {
+ context2DsByHeight = {};
+ context2DsByWidthAndHeight[width] = context2DsByHeight;
+ }
+
+ let context2d = context2DsByHeight[height];
+ if (!defaultValue.defined(context2d)) {
+ const canvas = document.createElement("canvas");
+ canvas.width = width;
+ canvas.height = height;
+ context2d = canvas.getContext("2d");
+ context2d.globalCompositeOperation = "copy";
+ context2DsByHeight[height] = context2d;
+ }
+
+ context2d.drawImage(image, 0, 0, width, height);
+ return context2d.getImageData(0, 0, width, height).data;
+ }
+
+ const blobUriRegex = /^blob:/i;
+
+ /**
+ * Determines if the specified uri is a blob uri.
+ *
+ * @function isBlobUri
+ *
+ * @param {String} uri The uri to test.
+ * @returns {Boolean} true when the uri is a blob uri; otherwise, false.
+ *
+ * @private
+ */
+ function isBlobUri(uri) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.string("uri", uri);
+ //>>includeEnd('debug');
+
+ return blobUriRegex.test(uri);
+ }
+
+ let a$1;
+
+ /**
+ * Given a URL, determine whether that URL is considered cross-origin to the current page.
+ *
+ * @private
+ */
+ function isCrossOriginUrl(url) {
+ if (!defaultValue.defined(a$1)) {
+ a$1 = document.createElement("a");
+ }
+
+ // copy window location into the anchor to get consistent results
+ // when the port is default for the protocol (e.g. 80 for HTTP)
+ a$1.href = window.location.href;
+
+ // host includes both hostname and port if the port is not standard
+ const host = a$1.host;
+ const protocol = a$1.protocol;
+
+ a$1.href = url;
+ // IE only absolutizes href on get, not set
+ // eslint-disable-next-line no-self-assign
+ a$1.href = a$1.href;
+
+ return protocol !== a$1.protocol || host !== a$1.host;
+ }
+
+ const dataUriRegex$1 = /^data:/i;
+
+ /**
+ * Determines if the specified uri is a data uri.
+ *
+ * @function isDataUri
+ *
+ * @param {String} uri The uri to test.
+ * @returns {Boolean} true when the uri is a data uri; otherwise, false.
+ *
+ * @private
+ */
+ function isDataUri(uri) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.string("uri", uri);
+ //>>includeEnd('debug');
+
+ return dataUriRegex$1.test(uri);
+ }
+
+ /**
+ * @private
+ */
+ function loadAndExecuteScript(url) {
+ const script = document.createElement("script");
+ script.async = true;
+ script.src = url;
+
+ return new Promise((resolve, reject) => {
+ if (window.crossOriginIsolated) {
+ script.setAttribute("crossorigin", "anonymous");
+ }
+
+ const head = document.getElementsByTagName("head")[0];
+ script.onload = function () {
+ script.onload = undefined;
+ head.removeChild(script);
+ resolve();
+ };
+ script.onerror = function (e) {
+ reject(e);
+ };
+
+ head.appendChild(script);
+ });
+ }
+
+ /**
+ * Converts an object representing a set of name/value pairs into a query string,
+ * with names and values encoded properly for use in a URL. Values that are arrays
+ * will produce multiple values with the same name.
+ * @function objectToQuery
+ *
+ * @param {Object} obj The object containing data to encode.
+ * @returns {String} An encoded query string.
+ *
+ *
+ * @example
+ * const str = Cesium.objectToQuery({
+ * key1 : 'some value',
+ * key2 : 'a/b',
+ * key3 : ['x', 'y']
+ * });
+ *
+ * @see queryToObject
+ * // str will be:
+ * // 'key1=some%20value&key2=a%2Fb&key3=x&key3=y'
+ */
+ function objectToQuery(obj) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(obj)) {
+ throw new Check.DeveloperError("obj is required.");
+ }
+ //>>includeEnd('debug');
+
+ let result = "";
+ for (const propName in obj) {
+ if (obj.hasOwnProperty(propName)) {
+ const value = obj[propName];
+
+ const part = `${encodeURIComponent(propName)}=`;
+ if (Array.isArray(value)) {
+ for (let i = 0, len = value.length; i < len; ++i) {
+ result += `${part + encodeURIComponent(value[i])}&`;
+ }
+ } else {
+ result += `${part + encodeURIComponent(value)}&`;
+ }
+ }
+ }
+
+ // trim last &
+ result = result.slice(0, -1);
+
+ // This function used to replace %20 with + which is more compact and readable.
+ // However, some servers didn't properly handle + as a space.
+ // https://github.com/CesiumGS/cesium/issues/2192
+
+ return result;
+ }
+
+ /**
+ * Parses a query string into an object, where the keys and values of the object are the
+ * name/value pairs from the query string, decoded. If a name appears multiple times,
+ * the value in the object will be an array of values.
+ * @function queryToObject
+ *
+ * @param {String} queryString The query string.
+ * @returns {Object} An object containing the parameters parsed from the query string.
+ *
+ *
+ * @example
+ * const obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');
+ * // obj will be:
+ * // {
+ * // key1 : 'some value',
+ * // key2 : 'a/b',
+ * // key3 : ['x', 'y']
+ * // }
+ *
+ * @see objectToQuery
+ */
+ function queryToObject(queryString) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(queryString)) {
+ throw new Check.DeveloperError("queryString is required.");
+ }
+ //>>includeEnd('debug');
+
+ const result = {};
+ if (queryString === "") {
+ return result;
+ }
+ const parts = queryString.replace(/\+/g, "%20").split(/[&;]/);
+ for (let i = 0, len = parts.length; i < len; ++i) {
+ const subparts = parts[i].split("=");
+
+ const name = decodeURIComponent(subparts[0]);
+ let value = subparts[1];
+ if (defaultValue.defined(value)) {
+ value = decodeURIComponent(value);
+ } else {
+ value = "";
+ }
+
+ const resultValue = result[name];
+ if (typeof resultValue === "string") {
+ // expand the single value to an array
+ result[name] = [resultValue, value];
+ } else if (Array.isArray(resultValue)) {
+ resultValue.push(value);
+ } else {
+ result[name] = value;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * State of the request.
+ *
+ * @enum {Number}
+ */
+ const RequestState = {
+ /**
+ * Initial unissued state.
+ *
+ * @type Number
+ * @constant
+ */
+ UNISSUED: 0,
+
+ /**
+ * Issued but not yet active. Will become active when open slots are available.
+ *
+ * @type Number
+ * @constant
+ */
+ ISSUED: 1,
+
+ /**
+ * Actual http request has been sent.
+ *
+ * @type Number
+ * @constant
+ */
+ ACTIVE: 2,
+
+ /**
+ * Request completed successfully.
+ *
+ * @type Number
+ * @constant
+ */
+ RECEIVED: 3,
+
+ /**
+ * Request was cancelled, either explicitly or automatically because of low priority.
+ *
+ * @type Number
+ * @constant
+ */
+ CANCELLED: 4,
+
+ /**
+ * Request failed.
+ *
+ * @type Number
+ * @constant
+ */
+ FAILED: 5,
+ };
+ var RequestState$1 = Object.freeze(RequestState);
+
+ /**
+ * An enum identifying the type of request. Used for finer grained logging and priority sorting.
+ *
+ * @enum {Number}
+ */
+ const RequestType = {
+ /**
+ * Terrain request.
+ *
+ * @type Number
+ * @constant
+ */
+ TERRAIN: 0,
+
+ /**
+ * Imagery request.
+ *
+ * @type Number
+ * @constant
+ */
+ IMAGERY: 1,
+
+ /**
+ * 3D Tiles request.
+ *
+ * @type Number
+ * @constant
+ */
+ TILES3D: 2,
+
+ /**
+ * Other request.
+ *
+ * @type Number
+ * @constant
+ */
+ OTHER: 3,
+ };
+ var RequestType$1 = Object.freeze(RequestType);
+
+ /**
+ * Stores information for making a request. In general this does not need to be constructed directly.
+ *
+ * @alias Request
+ * @constructor
+
+ * @param {Object} [options] An object with the following properties:
+ * @param {String} [options.url] The url to request.
+ * @param {Request.RequestCallback} [options.requestFunction] The function that makes the actual data request.
+ * @param {Request.CancelCallback} [options.cancelFunction] The function that is called when the request is cancelled.
+ * @param {Request.PriorityCallback} [options.priorityFunction] The function that is called to update the request's priority, which occurs once per frame.
+ * @param {Number} [options.priority=0.0] The initial priority of the request.
+ * @param {Boolean} [options.throttle=false] Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority.
+ * @param {Boolean} [options.throttleByServer=false] Whether to throttle the request by server.
+ * @param {RequestType} [options.type=RequestType.OTHER] The type of request.
+ */
+ function Request(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const throttleByServer = defaultValue.defaultValue(options.throttleByServer, false);
+ const throttle = defaultValue.defaultValue(options.throttle, false);
+
+ /**
+ * The URL to request.
+ *
+ * @type {String}
+ */
+ this.url = options.url;
+
+ /**
+ * The function that makes the actual data request.
+ *
+ * @type {Request.RequestCallback}
+ */
+ this.requestFunction = options.requestFunction;
+
+ /**
+ * The function that is called when the request is cancelled.
+ *
+ * @type {Request.CancelCallback}
+ */
+ this.cancelFunction = options.cancelFunction;
+
+ /**
+ * The function that is called to update the request's priority, which occurs once per frame.
+ *
+ * @type {Request.PriorityCallback}
+ */
+ this.priorityFunction = options.priorityFunction;
+
+ /**
+ * Priority is a unit-less value where lower values represent higher priority.
+ * For world-based objects, this is usually the distance from the camera.
+ * A request that does not have a priority function defaults to a priority of 0.
+ *
+ * If priorityFunction is defined, this value is updated every frame with the result of that call.
+ *
+ * @type {Number}
+ * @default 0.0
+ */
+ this.priority = defaultValue.defaultValue(options.priority, 0.0);
+
+ /**
+ * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the
+ * request will be throttled and sent based on priority.
+ *
+ * @type {Boolean}
+ * @readonly
+ *
+ * @default false
+ */
+ this.throttle = throttle;
+
+ /**
+ * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections
+ * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value
+ * to true
is preferable for requests going through HTTP/1 servers.
+ *
+ * @type {Boolean}
+ * @readonly
+ *
+ * @default false
+ */
+ this.throttleByServer = throttleByServer;
+
+ /**
+ * Type of request.
+ *
+ * @type {RequestType}
+ * @readonly
+ *
+ * @default RequestType.OTHER
+ */
+ this.type = defaultValue.defaultValue(options.type, RequestType$1.OTHER);
+
+ /**
+ * A key used to identify the server that a request is going to. It is derived from the url's authority and scheme.
+ *
+ * @type {String}
+ *
+ * @private
+ */
+ this.serverKey = undefined;
+
+ /**
+ * The current state of the request.
+ *
+ * @type {RequestState}
+ * @readonly
+ */
+ this.state = RequestState$1.UNISSUED;
+
+ /**
+ * The requests's deferred promise.
+ *
+ * @type {Object}
+ *
+ * @private
+ */
+ this.deferred = undefined;
+
+ /**
+ * Whether the request was explicitly cancelled.
+ *
+ * @type {Boolean}
+ *
+ * @private
+ */
+ this.cancelled = false;
+ }
+
+ /**
+ * Mark the request as cancelled.
+ *
+ * @private
+ */
+ Request.prototype.cancel = function () {
+ this.cancelled = true;
+ };
+
+ /**
+ * Duplicates a Request instance.
+ *
+ * @param {Request} [result] The object onto which to store the result.
+ *
+ * @returns {Request} The modified result parameter or a new Resource instance if one was not provided.
+ */
+ Request.prototype.clone = function (result) {
+ if (!defaultValue.defined(result)) {
+ return new Request(this);
+ }
+
+ result.url = this.url;
+ result.requestFunction = this.requestFunction;
+ result.cancelFunction = this.cancelFunction;
+ result.priorityFunction = this.priorityFunction;
+ result.priority = this.priority;
+ result.throttle = this.throttle;
+ result.throttleByServer = this.throttleByServer;
+ result.type = this.type;
+ result.serverKey = this.serverKey;
+
+ // These get defaulted because the cloned request hasn't been issued
+ result.state = this.RequestState.UNISSUED;
+ result.deferred = undefined;
+ result.cancelled = false;
+
+ return result;
+ };
+
+ /**
+ * Parses the result of XMLHttpRequest's getAllResponseHeaders() method into
+ * a dictionary.
+ *
+ * @function parseResponseHeaders
+ *
+ * @param {String} headerString The header string returned by getAllResponseHeaders(). The format is
+ * described here: http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method
+ * @returns {Object} A dictionary of key/value pairs, where each key is the name of a header and the corresponding value
+ * is that header's value.
+ *
+ * @private
+ */
+ function parseResponseHeaders(headerString) {
+ const headers = {};
+
+ if (!headerString) {
+ return headers;
+ }
+
+ const headerPairs = headerString.split("\u000d\u000a");
+
+ for (let i = 0; i < headerPairs.length; ++i) {
+ const headerPair = headerPairs[i];
+ // Can't use split() here because it does the wrong thing
+ // if the header value has the string ": " in it.
+ const index = headerPair.indexOf("\u003a\u0020");
+ if (index > 0) {
+ const key = headerPair.substring(0, index);
+ const val = headerPair.substring(index + 2);
+ headers[key] = val;
+ }
+ }
+
+ return headers;
+ }
+
+ /**
+ * An event that is raised when a request encounters an error.
+ *
+ * @constructor
+ * @alias RequestErrorEvent
+ *
+ * @param {Number} [statusCode] The HTTP error status code, such as 404.
+ * @param {Object} [response] The response included along with the error.
+ * @param {String|Object} [responseHeaders] The response headers, represented either as an object literal or as a
+ * string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.
+ */
+ function RequestErrorEvent(statusCode, response, responseHeaders) {
+ /**
+ * The HTTP error status code, such as 404. If the error does not have a particular
+ * HTTP code, this property will be undefined.
+ *
+ * @type {Number}
+ */
+ this.statusCode = statusCode;
+
+ /**
+ * The response included along with the error. If the error does not include a response,
+ * this property will be undefined.
+ *
+ * @type {Object}
+ */
+ this.response = response;
+
+ /**
+ * The headers included in the response, represented as an object literal of key/value pairs.
+ * If the error does not include any headers, this property will be undefined.
+ *
+ * @type {Object}
+ */
+ this.responseHeaders = responseHeaders;
+
+ if (typeof this.responseHeaders === "string") {
+ this.responseHeaders = parseResponseHeaders(this.responseHeaders);
+ }
+ }
+
+ /**
+ * Creates a string representing this RequestErrorEvent.
+ * @memberof RequestErrorEvent
+ *
+ * @returns {String} A string representing the provided RequestErrorEvent.
+ */
+ RequestErrorEvent.prototype.toString = function () {
+ let str = "Request has failed.";
+ if (defaultValue.defined(this.statusCode)) {
+ str += ` Status Code: ${this.statusCode}`;
+ }
+ return str;
+ };
+
+ /**
+ * A generic utility class for managing subscribers for a particular event.
+ * This class is usually instantiated inside of a container class and
+ * exposed as a property for others to subscribe to.
+ *
+ * @alias Event
+ * @template Listener extends (...args: any[]) => void = (...args: any[]) => void
+ * @constructor
+ * @example
+ * MyObject.prototype.myListener = function(arg1, arg2) {
+ * this.myArg1Copy = arg1;
+ * this.myArg2Copy = arg2;
+ * }
+ *
+ * const myObjectInstance = new MyObject();
+ * const evt = new Cesium.Event();
+ * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);
+ * evt.raiseEvent('1', '2');
+ * evt.removeEventListener(MyObject.prototype.myListener);
+ */
+ function Event() {
+ this._listeners = [];
+ this._scopes = [];
+ this._toRemove = [];
+ this._insideRaiseEvent = false;
+ }
+
+ Object.defineProperties(Event.prototype, {
+ /**
+ * The number of listeners currently subscribed to the event.
+ * @memberof Event.prototype
+ * @type {Number}
+ * @readonly
+ */
+ numberOfListeners: {
+ get: function () {
+ return this._listeners.length - this._toRemove.length;
+ },
+ },
+ });
+
+ /**
+ * Registers a callback function to be executed whenever the event is raised.
+ * An optional scope can be provided to serve as the this
pointer
+ * in which the function will execute.
+ *
+ * @param {Listener} listener The function to be executed when the event is raised.
+ * @param {Object} [scope] An optional object scope to serve as the this
+ * pointer in which the listener function will execute.
+ * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked.
+ *
+ * @see Event#raiseEvent
+ * @see Event#removeEventListener
+ */
+ Event.prototype.addEventListener = function (listener, scope) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.func("listener", listener);
+ //>>includeEnd('debug');
+
+ this._listeners.push(listener);
+ this._scopes.push(scope);
+
+ const event = this;
+ return function () {
+ event.removeEventListener(listener, scope);
+ };
+ };
+
+ /**
+ * Unregisters a previously registered callback.
+ *
+ * @param {Listener} listener The function to be unregistered.
+ * @param {Object} [scope] The scope that was originally passed to addEventListener.
+ * @returns {Boolean} true
if the listener was removed; false
if the listener and scope are not registered with the event.
+ *
+ * @see Event#addEventListener
+ * @see Event#raiseEvent
+ */
+ Event.prototype.removeEventListener = function (listener, scope) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.func("listener", listener);
+ //>>includeEnd('debug');
+
+ const listeners = this._listeners;
+ const scopes = this._scopes;
+
+ let index = -1;
+ for (let i = 0; i < listeners.length; i++) {
+ if (listeners[i] === listener && scopes[i] === scope) {
+ index = i;
+ break;
+ }
+ }
+
+ if (index !== -1) {
+ if (this._insideRaiseEvent) {
+ //In order to allow removing an event subscription from within
+ //a callback, we don't actually remove the items here. Instead
+ //remember the index they are at and undefined their value.
+ this._toRemove.push(index);
+ listeners[index] = undefined;
+ scopes[index] = undefined;
+ } else {
+ listeners.splice(index, 1);
+ scopes.splice(index, 1);
+ }
+ return true;
+ }
+
+ return false;
+ };
+
+ function compareNumber(a, b) {
+ return b - a;
+ }
+
+ /**
+ * Raises the event by calling each registered listener with all supplied arguments.
+ *
+ * @param {...Parameters} arguments This method takes any number of parameters and passes them through to the listener functions.
+ *
+ * @see Event#addEventListener
+ * @see Event#removeEventListener
+ */
+ Event.prototype.raiseEvent = function () {
+ this._insideRaiseEvent = true;
+
+ let i;
+ const listeners = this._listeners;
+ const scopes = this._scopes;
+ let length = listeners.length;
+
+ for (i = 0; i < length; i++) {
+ const listener = listeners[i];
+ if (defaultValue.defined(listener)) {
+ listeners[i].apply(scopes[i], arguments);
+ }
+ }
+
+ //Actually remove items removed in removeEventListener.
+ const toRemove = this._toRemove;
+ length = toRemove.length;
+ if (length > 0) {
+ toRemove.sort(compareNumber);
+ for (i = 0; i < length; i++) {
+ const index = toRemove[i];
+ listeners.splice(index, 1);
+ scopes.splice(index, 1);
+ }
+ toRemove.length = 0;
+ }
+
+ this._insideRaiseEvent = false;
+ };
+
+ /**
+ * Array implementation of a heap.
+ *
+ * @alias Heap
+ * @constructor
+ * @private
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Heap.ComparatorCallback} options.comparator The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.
+ */
+ function Heap(options) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("options", options);
+ Check.Check.defined("options.comparator", options.comparator);
+ //>>includeEnd('debug');
+
+ this._comparator = options.comparator;
+ this._array = [];
+ this._length = 0;
+ this._maximumLength = undefined;
+ }
+
+ Object.defineProperties(Heap.prototype, {
+ /**
+ * Gets the length of the heap.
+ *
+ * @memberof Heap.prototype
+ *
+ * @type {Number}
+ * @readonly
+ */
+ length: {
+ get: function () {
+ return this._length;
+ },
+ },
+
+ /**
+ * Gets the internal array.
+ *
+ * @memberof Heap.prototype
+ *
+ * @type {Array}
+ * @readonly
+ */
+ internalArray: {
+ get: function () {
+ return this._array;
+ },
+ },
+
+ /**
+ * Gets and sets the maximum length of the heap.
+ *
+ * @memberof Heap.prototype
+ *
+ * @type {Number}
+ */
+ maximumLength: {
+ get: function () {
+ return this._maximumLength;
+ },
+ set: function (value) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.greaterThanOrEquals("maximumLength", value, 0);
+ //>>includeEnd('debug');
+ const originalLength = this._length;
+ if (value < originalLength) {
+ const array = this._array;
+ // Remove trailing references
+ for (let i = value; i < originalLength; ++i) {
+ array[i] = undefined;
+ }
+ this._length = value;
+ array.length = value;
+ }
+ this._maximumLength = value;
+ },
+ },
+
+ /**
+ * The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.
+ *
+ * @memberof Heap.prototype
+ *
+ * @type {Heap.ComparatorCallback}
+ */
+ comparator: {
+ get: function () {
+ return this._comparator;
+ },
+ },
+ });
+
+ function swap(array, a, b) {
+ const temp = array[a];
+ array[a] = array[b];
+ array[b] = temp;
+ }
+
+ /**
+ * Resizes the internal array of the heap.
+ *
+ * @param {Number} [length] The length to resize internal array to. Defaults to the current length of the heap.
+ */
+ Heap.prototype.reserve = function (length) {
+ length = defaultValue.defaultValue(length, this._length);
+ this._array.length = length;
+ };
+
+ /**
+ * Update the heap so that index and all descendants satisfy the heap property.
+ *
+ * @param {Number} [index=0] The starting index to heapify from.
+ */
+ Heap.prototype.heapify = function (index) {
+ index = defaultValue.defaultValue(index, 0);
+ const length = this._length;
+ const comparator = this._comparator;
+ const array = this._array;
+ let candidate = -1;
+ let inserting = true;
+
+ while (inserting) {
+ const right = 2 * (index + 1);
+ const left = right - 1;
+
+ if (left < length && comparator(array[left], array[index]) < 0) {
+ candidate = left;
+ } else {
+ candidate = index;
+ }
+
+ if (right < length && comparator(array[right], array[candidate]) < 0) {
+ candidate = right;
+ }
+ if (candidate !== index) {
+ swap(array, candidate, index);
+ index = candidate;
+ } else {
+ inserting = false;
+ }
+ }
+ };
+
+ /**
+ * Resort the heap.
+ */
+ Heap.prototype.resort = function () {
+ const length = this._length;
+ for (let i = Math.ceil(length / 2); i >= 0; --i) {
+ this.heapify(i);
+ }
+ };
+
+ /**
+ * Insert an element into the heap. If the length would grow greater than maximumLength
+ * of the heap, extra elements are removed.
+ *
+ * @param {*} element The element to insert
+ *
+ * @return {*} The element that was removed from the heap if the heap is at full capacity.
+ */
+ Heap.prototype.insert = function (element) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("element", element);
+ //>>includeEnd('debug');
+
+ const array = this._array;
+ const comparator = this._comparator;
+ const maximumLength = this._maximumLength;
+
+ let index = this._length++;
+ if (index < array.length) {
+ array[index] = element;
+ } else {
+ array.push(element);
+ }
+
+ while (index !== 0) {
+ const parent = Math.floor((index - 1) / 2);
+ if (comparator(array[index], array[parent]) < 0) {
+ swap(array, index, parent);
+ index = parent;
+ } else {
+ break;
+ }
+ }
+
+ let removedElement;
+
+ if (defaultValue.defined(maximumLength) && this._length > maximumLength) {
+ removedElement = array[maximumLength];
+ this._length = maximumLength;
+ }
+
+ return removedElement;
+ };
+
+ /**
+ * Remove the element specified by index from the heap and return it.
+ *
+ * @param {Number} [index=0] The index to remove.
+ * @returns {*} The specified element of the heap.
+ */
+ Heap.prototype.pop = function (index) {
+ index = defaultValue.defaultValue(index, 0);
+ if (this._length === 0) {
+ return undefined;
+ }
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number.lessThan("index", index, this._length);
+ //>>includeEnd('debug');
+
+ const array = this._array;
+ const root = array[index];
+ swap(array, index, --this._length);
+ this.heapify(index);
+ array[this._length] = undefined; // Remove trailing reference
+ return root;
+ };
+
+ function sortRequests(a, b) {
+ return a.priority - b.priority;
+ }
+
+ const statistics = {
+ numberOfAttemptedRequests: 0,
+ numberOfActiveRequests: 0,
+ numberOfCancelledRequests: 0,
+ numberOfCancelledActiveRequests: 0,
+ numberOfFailedRequests: 0,
+ numberOfActiveRequestsEver: 0,
+ lastNumberOfActiveRequests: 0,
+ };
+
+ let priorityHeapLength = 20;
+ const requestHeap = new Heap({
+ comparator: sortRequests,
+ });
+ requestHeap.maximumLength = priorityHeapLength;
+ requestHeap.reserve(priorityHeapLength);
+
+ const activeRequests = [];
+ let numberOfActiveRequestsByServer = {};
+
+ const pageUri =
+ typeof document !== "undefined" ? new Uri(document.location.href) : new Uri();
+
+ const requestCompletedEvent = new Event();
+
+ /**
+ * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability
+ * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,
+ * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the
+ * number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired.
+ *
+ * @namespace RequestScheduler
+ *
+ */
+ function RequestScheduler() {}
+
+ /**
+ * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.
+ * @type {Number}
+ * @default 50
+ */
+ RequestScheduler.maximumRequests = 50;
+
+ /**
+ * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically
+ * listed in {@link requestsByServer} do not observe this limit.
+ * @type {Number}
+ * @default 6
+ */
+ RequestScheduler.maximumRequestsPerServer = 6;
+
+ /**
+ * A per server key list of overrides to use for throttling instead of maximumRequestsPerServer
+ * @type {Object}
+ *
+ * @example
+ * RequestScheduler.requestsByServer = {
+ * 'api.cesium.com:443': 18,
+ * 'assets.cesium.com:443': 18
+ * };
+ */
+ RequestScheduler.requestsByServer = {
+ "api.cesium.com:443": 18,
+ "assets.cesium.com:443": 18,
+ };
+
+ /**
+ * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.
+ * @type {Boolean}
+ * @default true
+ */
+ RequestScheduler.throttleRequests = true;
+
+ /**
+ * When true, log statistics to the console every frame
+ * @type {Boolean}
+ * @default false
+ * @private
+ */
+ RequestScheduler.debugShowStatistics = false;
+
+ /**
+ * An event that's raised when a request is completed. Event handlers are passed
+ * the error object if the request fails.
+ *
+ * @type {Event}
+ * @default Event()
+ * @private
+ */
+ RequestScheduler.requestCompletedEvent = requestCompletedEvent;
+
+ Object.defineProperties(RequestScheduler, {
+ /**
+ * Returns the statistics used by the request scheduler.
+ *
+ * @memberof RequestScheduler
+ *
+ * @type Object
+ * @readonly
+ * @private
+ */
+ statistics: {
+ get: function () {
+ return statistics;
+ },
+ },
+
+ /**
+ * The maximum size of the priority heap. This limits the number of requests that are sorted by priority. Only applies to requests that are not yet active.
+ *
+ * @memberof RequestScheduler
+ *
+ * @type {Number}
+ * @default 20
+ * @private
+ */
+ priorityHeapLength: {
+ get: function () {
+ return priorityHeapLength;
+ },
+ set: function (value) {
+ // If the new length shrinks the heap, need to cancel some of the requests.
+ // Since this value is not intended to be tweaked regularly it is fine to just cancel the high priority requests.
+ if (value < priorityHeapLength) {
+ while (requestHeap.length > value) {
+ const request = requestHeap.pop();
+ cancelRequest(request);
+ }
+ }
+ priorityHeapLength = value;
+ requestHeap.maximumLength = value;
+ requestHeap.reserve(value);
+ },
+ },
+ });
+
+ function updatePriority(request) {
+ if (defaultValue.defined(request.priorityFunction)) {
+ request.priority = request.priorityFunction();
+ }
+ }
+
+ /**
+ * Check if there are open slots for a particular server key. If desiredRequests is greater than 1, this checks if the queue has room for scheduling multiple requests.
+ * @param {String} serverKey The server key returned by {@link RequestScheduler.getServerKey}.
+ * @param {Number} [desiredRequests=1] How many requests the caller plans to request
+ * @return {Boolean} True if there are enough open slots for desiredRequests
more requests.
+ * @private
+ */
+ RequestScheduler.serverHasOpenSlots = function (serverKey, desiredRequests) {
+ desiredRequests = defaultValue.defaultValue(desiredRequests, 1);
+
+ const maxRequests = defaultValue.defaultValue(
+ RequestScheduler.requestsByServer[serverKey],
+ RequestScheduler.maximumRequestsPerServer
+ );
+ const hasOpenSlotsServer =
+ numberOfActiveRequestsByServer[serverKey] + desiredRequests <= maxRequests;
+
+ return hasOpenSlotsServer;
+ };
+
+ /**
+ * Check if the priority heap has open slots, regardless of which server they
+ * are from. This is used in {@link Multiple3DTileContent} for determining when
+ * all requests can be scheduled
+ * @param {Number} desiredRequests The number of requests the caller intends to make
+ * @return {Boolean} true
if the heap has enough available slots to meet the desiredRequests. false
otherwise.
+ *
+ * @private
+ */
+ RequestScheduler.heapHasOpenSlots = function (desiredRequests) {
+ const hasOpenSlotsHeap =
+ requestHeap.length + desiredRequests <= priorityHeapLength;
+ return hasOpenSlotsHeap;
+ };
+
+ function issueRequest(request) {
+ if (request.state === RequestState$1.UNISSUED) {
+ request.state = RequestState$1.ISSUED;
+ request.deferred = defer();
+ }
+ return request.deferred.promise;
+ }
+
+ function getRequestReceivedFunction(request) {
+ return function (results) {
+ if (request.state === RequestState$1.CANCELLED) {
+ // If the data request comes back but the request is cancelled, ignore it.
+ return;
+ }
+ // explicitly set to undefined to ensure GC of request response data. See #8843
+ const deferred = request.deferred;
+
+ --statistics.numberOfActiveRequests;
+ --numberOfActiveRequestsByServer[request.serverKey];
+ requestCompletedEvent.raiseEvent();
+ request.state = RequestState$1.RECEIVED;
+ request.deferred = undefined;
+
+ deferred.resolve(results);
+ };
+ }
+
+ function getRequestFailedFunction(request) {
+ return function (error) {
+ if (request.state === RequestState$1.CANCELLED) {
+ // If the data request comes back but the request is cancelled, ignore it.
+ return;
+ }
+ ++statistics.numberOfFailedRequests;
+ --statistics.numberOfActiveRequests;
+ --numberOfActiveRequestsByServer[request.serverKey];
+ requestCompletedEvent.raiseEvent(error);
+ request.state = RequestState$1.FAILED;
+ request.deferred.reject(error);
+ };
+ }
+
+ function startRequest(request) {
+ const promise = issueRequest(request);
+ request.state = RequestState$1.ACTIVE;
+ activeRequests.push(request);
+ ++statistics.numberOfActiveRequests;
+ ++statistics.numberOfActiveRequestsEver;
+ ++numberOfActiveRequestsByServer[request.serverKey];
+ request
+ .requestFunction()
+ .then(getRequestReceivedFunction(request))
+ .catch(getRequestFailedFunction(request));
+ return promise;
+ }
+
+ function cancelRequest(request) {
+ const active = request.state === RequestState$1.ACTIVE;
+ request.state = RequestState$1.CANCELLED;
+ ++statistics.numberOfCancelledRequests;
+ // check that deferred has not been cleared since cancelRequest can be called
+ // on a finished request, e.g. by clearForSpecs during tests
+ if (defaultValue.defined(request.deferred)) {
+ const deferred = request.deferred;
+ request.deferred = undefined;
+ deferred.reject();
+ }
+
+ if (active) {
+ --statistics.numberOfActiveRequests;
+ --numberOfActiveRequestsByServer[request.serverKey];
+ ++statistics.numberOfCancelledActiveRequests;
+ }
+
+ if (defaultValue.defined(request.cancelFunction)) {
+ request.cancelFunction();
+ }
+ }
+
+ /**
+ * Sort requests by priority and start requests.
+ * @private
+ */
+ RequestScheduler.update = function () {
+ let i;
+ let request;
+
+ // Loop over all active requests. Cancelled, failed, or received requests are removed from the array to make room for new requests.
+ let removeCount = 0;
+ const activeLength = activeRequests.length;
+ for (i = 0; i < activeLength; ++i) {
+ request = activeRequests[i];
+ if (request.cancelled) {
+ // Request was explicitly cancelled
+ cancelRequest(request);
+ }
+ if (request.state !== RequestState$1.ACTIVE) {
+ // Request is no longer active, remove from array
+ ++removeCount;
+ continue;
+ }
+ if (removeCount > 0) {
+ // Shift back to fill in vacated slots from completed requests
+ activeRequests[i - removeCount] = request;
+ }
+ }
+ activeRequests.length -= removeCount;
+
+ // Update priority of issued requests and resort the heap
+ const issuedRequests = requestHeap.internalArray;
+ const issuedLength = requestHeap.length;
+ for (i = 0; i < issuedLength; ++i) {
+ updatePriority(issuedRequests[i]);
+ }
+ requestHeap.resort();
+
+ // Get the number of open slots and fill with the highest priority requests.
+ // Un-throttled requests are automatically added to activeRequests, so activeRequests.length may exceed maximumRequests
+ const openSlots = Math.max(
+ RequestScheduler.maximumRequests - activeRequests.length,
+ 0
+ );
+ let filledSlots = 0;
+ while (filledSlots < openSlots && requestHeap.length > 0) {
+ // Loop until all open slots are filled or the heap becomes empty
+ request = requestHeap.pop();
+ if (request.cancelled) {
+ // Request was explicitly cancelled
+ cancelRequest(request);
+ continue;
+ }
+
+ if (
+ request.throttleByServer &&
+ !RequestScheduler.serverHasOpenSlots(request.serverKey)
+ ) {
+ // Open slots are available, but the request is throttled by its server. Cancel and try again later.
+ cancelRequest(request);
+ continue;
+ }
+
+ startRequest(request);
+ ++filledSlots;
+ }
+
+ updateStatistics();
+ };
+
+ /**
+ * Get the server key from a given url.
+ *
+ * @param {String} url The url.
+ * @returns {String} The server key.
+ * @private
+ */
+ RequestScheduler.getServerKey = function (url) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.string("url", url);
+ //>>includeEnd('debug');
+
+ let uri = new Uri(url);
+ if (uri.scheme() === "") {
+ uri = new Uri(url).absoluteTo(pageUri);
+ uri.normalize();
+ }
+
+ let serverKey = uri.authority();
+ if (!/:/.test(serverKey)) {
+ // If the authority does not contain a port number, add port 443 for https or port 80 for http
+ serverKey = `${serverKey}:${uri.scheme() === "https" ? "443" : "80"}`;
+ }
+
+ const length = numberOfActiveRequestsByServer[serverKey];
+ if (!defaultValue.defined(length)) {
+ numberOfActiveRequestsByServer[serverKey] = 0;
+ }
+
+ return serverKey;
+ };
+
+ /**
+ * Issue a request. If request.throttle is false, the request is sent immediately. Otherwise the request will be
+ * queued and sorted by priority before being sent.
+ *
+ * @param {Request} request The request object.
+ *
+ * @returns {Promise|undefined} A Promise for the requested data, or undefined if this request does not have high enough priority to be issued.
+ *
+ * @private
+ */
+ RequestScheduler.request = function (request) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("request", request);
+ Check.Check.typeOf.string("request.url", request.url);
+ Check.Check.typeOf.func("request.requestFunction", request.requestFunction);
+ //>>includeEnd('debug');
+
+ if (isDataUri(request.url) || isBlobUri(request.url)) {
+ requestCompletedEvent.raiseEvent();
+ request.state = RequestState$1.RECEIVED;
+ return request.requestFunction();
+ }
+
+ ++statistics.numberOfAttemptedRequests;
+
+ if (!defaultValue.defined(request.serverKey)) {
+ request.serverKey = RequestScheduler.getServerKey(request.url);
+ }
+
+ if (
+ RequestScheduler.throttleRequests &&
+ request.throttleByServer &&
+ !RequestScheduler.serverHasOpenSlots(request.serverKey)
+ ) {
+ // Server is saturated. Try again later.
+ return undefined;
+ }
+
+ if (!RequestScheduler.throttleRequests || !request.throttle) {
+ return startRequest(request);
+ }
+
+ if (activeRequests.length >= RequestScheduler.maximumRequests) {
+ // Active requests are saturated. Try again later.
+ return undefined;
+ }
+
+ // Insert into the priority heap and see if a request was bumped off. If this request is the lowest
+ // priority it will be returned.
+ updatePriority(request);
+ const removedRequest = requestHeap.insert(request);
+
+ if (defaultValue.defined(removedRequest)) {
+ if (removedRequest === request) {
+ // Request does not have high enough priority to be issued
+ return undefined;
+ }
+ // A previously issued request has been bumped off the priority heap, so cancel it
+ cancelRequest(removedRequest);
+ }
+
+ return issueRequest(request);
+ };
+
+ function updateStatistics() {
+ if (!RequestScheduler.debugShowStatistics) {
+ return;
+ }
+
+ if (
+ statistics.numberOfActiveRequests === 0 &&
+ statistics.lastNumberOfActiveRequests > 0
+ ) {
+ if (statistics.numberOfAttemptedRequests > 0) {
+ console.log(
+ `Number of attempted requests: ${statistics.numberOfAttemptedRequests}`
+ );
+ statistics.numberOfAttemptedRequests = 0;
+ }
+
+ if (statistics.numberOfCancelledRequests > 0) {
+ console.log(
+ `Number of cancelled requests: ${statistics.numberOfCancelledRequests}`
+ );
+ statistics.numberOfCancelledRequests = 0;
+ }
+
+ if (statistics.numberOfCancelledActiveRequests > 0) {
+ console.log(
+ `Number of cancelled active requests: ${statistics.numberOfCancelledActiveRequests}`
+ );
+ statistics.numberOfCancelledActiveRequests = 0;
+ }
+
+ if (statistics.numberOfFailedRequests > 0) {
+ console.log(
+ `Number of failed requests: ${statistics.numberOfFailedRequests}`
+ );
+ statistics.numberOfFailedRequests = 0;
+ }
+ }
+
+ statistics.lastNumberOfActiveRequests = statistics.numberOfActiveRequests;
+ }
+
+ /**
+ * For testing only. Clears any requests that may not have completed from previous tests.
+ *
+ * @private
+ */
+ RequestScheduler.clearForSpecs = function () {
+ while (requestHeap.length > 0) {
+ const request = requestHeap.pop();
+ cancelRequest(request);
+ }
+ const length = activeRequests.length;
+ for (let i = 0; i < length; ++i) {
+ cancelRequest(activeRequests[i]);
+ }
+ activeRequests.length = 0;
+ numberOfActiveRequestsByServer = {};
+
+ // Clear stats
+ statistics.numberOfAttemptedRequests = 0;
+ statistics.numberOfActiveRequests = 0;
+ statistics.numberOfCancelledRequests = 0;
+ statistics.numberOfCancelledActiveRequests = 0;
+ statistics.numberOfFailedRequests = 0;
+ statistics.numberOfActiveRequestsEver = 0;
+ statistics.lastNumberOfActiveRequests = 0;
+ };
+
+ /**
+ * For testing only.
+ *
+ * @private
+ */
+ RequestScheduler.numberOfActiveRequestsByServer = function (serverKey) {
+ return numberOfActiveRequestsByServer[serverKey];
+ };
+
+ /**
+ * For testing only.
+ *
+ * @private
+ */
+ RequestScheduler.requestHeap = requestHeap;
+
+ /**
+ * A singleton that contains all of the servers that are trusted. Credentials will be sent with
+ * any requests to these servers.
+ *
+ * @namespace TrustedServers
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ */
+ const TrustedServers = {};
+ let _servers = {};
+
+ /**
+ * Adds a trusted server to the registry
+ *
+ * @param {String} host The host to be added.
+ * @param {Number} port The port used to access the host.
+ *
+ * @example
+ * // Add a trusted server
+ * TrustedServers.add('my.server.com', 80);
+ */
+ TrustedServers.add = function (host, port) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(host)) {
+ throw new Check.DeveloperError("host is required.");
+ }
+ if (!defaultValue.defined(port) || port <= 0) {
+ throw new Check.DeveloperError("port is required to be greater than 0.");
+ }
+ //>>includeEnd('debug');
+
+ const authority = `${host.toLowerCase()}:${port}`;
+ if (!defaultValue.defined(_servers[authority])) {
+ _servers[authority] = true;
+ }
+ };
+
+ /**
+ * Removes a trusted server from the registry
+ *
+ * @param {String} host The host to be removed.
+ * @param {Number} port The port used to access the host.
+ *
+ * @example
+ * // Remove a trusted server
+ * TrustedServers.remove('my.server.com', 80);
+ */
+ TrustedServers.remove = function (host, port) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(host)) {
+ throw new Check.DeveloperError("host is required.");
+ }
+ if (!defaultValue.defined(port) || port <= 0) {
+ throw new Check.DeveloperError("port is required to be greater than 0.");
+ }
+ //>>includeEnd('debug');
+
+ const authority = `${host.toLowerCase()}:${port}`;
+ if (defaultValue.defined(_servers[authority])) {
+ delete _servers[authority];
+ }
+ };
+
+ function getAuthority(url) {
+ const uri = new Uri(url);
+ uri.normalize();
+
+ // Removes username:password@ so we just have host[:port]
+ let authority = uri.authority();
+ if (authority.length === 0) {
+ return undefined; // Relative URL
+ }
+ uri.authority(authority);
+
+ if (authority.indexOf("@") !== -1) {
+ const parts = authority.split("@");
+ authority = parts[1];
+ }
+
+ // If the port is missing add one based on the scheme
+ if (authority.indexOf(":") === -1) {
+ let scheme = uri.scheme();
+ if (scheme.length === 0) {
+ scheme = window.location.protocol;
+ scheme = scheme.substring(0, scheme.length - 1);
+ }
+ if (scheme === "http") {
+ authority += ":80";
+ } else if (scheme === "https") {
+ authority += ":443";
+ } else {
+ return undefined;
+ }
+ }
+
+ return authority;
+ }
+
+ /**
+ * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.
+ *
+ * @param {String} url The url to be tested against the trusted list
+ *
+ * @returns {boolean} Returns true if url is trusted, false otherwise.
+ *
+ * @example
+ * // Add server
+ * TrustedServers.add('my.server.com', 81);
+ *
+ * // Check if server is trusted
+ * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {
+ * // my.server.com:81 is trusted
+ * }
+ * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {
+ * // my.server.com isn't trusted
+ * }
+ */
+ TrustedServers.contains = function (url) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(url)) {
+ throw new Check.DeveloperError("url is required.");
+ }
+ //>>includeEnd('debug');
+ const authority = getAuthority(url);
+ if (defaultValue.defined(authority) && defaultValue.defined(_servers[authority])) {
+ return true;
+ }
+
+ return false;
+ };
+
+ /**
+ * Clears the registry
+ *
+ * @example
+ * // Remove a trusted server
+ * TrustedServers.clear();
+ */
+ TrustedServers.clear = function () {
+ _servers = {};
+ };
+ var TrustedServers$1 = TrustedServers;
+
+ const xhrBlobSupported = (function () {
+ try {
+ const xhr = new XMLHttpRequest();
+ xhr.open("GET", "#", true);
+ xhr.responseType = "blob";
+ return xhr.responseType === "blob";
+ } catch (e) {
+ return false;
+ }
+ })();
+
+ /**
+ * Parses a query string and returns the object equivalent.
+ *
+ * @param {Uri} uri The Uri with a query object.
+ * @param {Resource} resource The Resource that will be assigned queryParameters.
+ * @param {Boolean} merge If true, we'll merge with the resource's existing queryParameters. Otherwise they will be replaced.
+ * @param {Boolean} preserveQueryParameters If true duplicate parameters will be concatenated into an array. If false, keys in uri will take precedence.
+ *
+ * @private
+ */
+ function parseQuery(uri, resource, merge, preserveQueryParameters) {
+ const queryString = uri.query();
+ if (queryString.length === 0) {
+ return {};
+ }
+
+ let query;
+ // Special case we run into where the querystring is just a string, not key/value pairs
+ if (queryString.indexOf("=") === -1) {
+ const result = {};
+ result[queryString] = undefined;
+ query = result;
+ } else {
+ query = queryToObject(queryString);
+ }
+
+ if (merge) {
+ resource._queryParameters = combineQueryParameters(
+ query,
+ resource._queryParameters,
+ preserveQueryParameters
+ );
+ } else {
+ resource._queryParameters = query;
+ }
+ uri.search("");
+ }
+
+ /**
+ * Converts a query object into a string.
+ *
+ * @param {Uri} uri The Uri object that will have the query object set.
+ * @param {Resource} resource The resource that has queryParameters
+ *
+ * @private
+ */
+ function stringifyQuery(uri, resource) {
+ const queryObject = resource._queryParameters;
+
+ const keys = Object.keys(queryObject);
+
+ // We have 1 key with an undefined value, so this is just a string, not key/value pairs
+ if (keys.length === 1 && !defaultValue.defined(queryObject[keys[0]])) {
+ uri.search(keys[0]);
+ } else {
+ uri.search(objectToQuery(queryObject));
+ }
+ }
+
+ /**
+ * Clones a value if it is defined, otherwise returns the default value
+ *
+ * @param {*} [val] The value to clone.
+ * @param {*} [defaultVal] The default value.
+ *
+ * @returns {*} A clone of val or the defaultVal.
+ *
+ * @private
+ */
+ function defaultClone(val, defaultVal) {
+ if (!defaultValue.defined(val)) {
+ return defaultVal;
+ }
+
+ return defaultValue.defined(val.clone) ? val.clone() : clone(val);
+ }
+
+ /**
+ * Checks to make sure the Resource isn't already being requested.
+ *
+ * @param {Request} request The request to check.
+ *
+ * @private
+ */
+ function checkAndResetRequest(request) {
+ if (
+ request.state === RequestState$1.ISSUED ||
+ request.state === RequestState$1.ACTIVE
+ ) {
+ throw new RuntimeError.RuntimeError("The Resource is already being fetched.");
+ }
+
+ request.state = RequestState$1.UNISSUED;
+ request.deferred = undefined;
+ }
+
+ /**
+ * This combines a map of query parameters.
+ *
+ * @param {Object} q1 The first map of query parameters. Values in this map will take precedence if preserveQueryParameters is false.
+ * @param {Object} q2 The second map of query parameters.
+ * @param {Boolean} preserveQueryParameters If true duplicate parameters will be concatenated into an array. If false, keys in q1 will take precedence.
+ *
+ * @returns {Object} The combined map of query parameters.
+ *
+ * @example
+ * const q1 = {
+ * a: 1,
+ * b: 2
+ * };
+ * const q2 = {
+ * a: 3,
+ * c: 4
+ * };
+ * const q3 = {
+ * b: [5, 6],
+ * d: 7
+ * }
+ *
+ * // Returns
+ * // {
+ * // a: [1, 3],
+ * // b: 2,
+ * // c: 4
+ * // };
+ * combineQueryParameters(q1, q2, true);
+ *
+ * // Returns
+ * // {
+ * // a: 1,
+ * // b: 2,
+ * // c: 4
+ * // };
+ * combineQueryParameters(q1, q2, false);
+ *
+ * // Returns
+ * // {
+ * // a: 1,
+ * // b: [2, 5, 6],
+ * // d: 7
+ * // };
+ * combineQueryParameters(q1, q3, true);
+ *
+ * // Returns
+ * // {
+ * // a: 1,
+ * // b: 2,
+ * // d: 7
+ * // };
+ * combineQueryParameters(q1, q3, false);
+ *
+ * @private
+ */
+ function combineQueryParameters(q1, q2, preserveQueryParameters) {
+ if (!preserveQueryParameters) {
+ return combine.combine(q1, q2);
+ }
+
+ const result = clone(q1, true);
+ for (const param in q2) {
+ if (q2.hasOwnProperty(param)) {
+ let value = result[param];
+ const q2Value = q2[param];
+ if (defaultValue.defined(value)) {
+ if (!Array.isArray(value)) {
+ value = result[param] = [value];
+ }
+
+ result[param] = value.concat(q2Value);
+ } else {
+ result[param] = Array.isArray(q2Value) ? q2Value.slice() : q2Value;
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * @typedef {Object} Resource.ConstructorOptions
+ *
+ * Initialization options for the Resource constructor
+ *
+ * @property {String} url The url of the resource.
+ * @property {Object} [queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @property {Object} [templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @property {Object} [headers={}] Additional HTTP headers that will be sent.
+ * @property {Proxy} [proxy] A proxy to be used when loading the resource.
+ * @property {Resource.RetryCallback} [retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @property {Number} [retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @property {Request} [request] A Request object that will be used. Intended for internal use only.
+ */
+
+ /**
+ * A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests.
+ *
+ * @alias Resource
+ * @constructor
+ *
+ * @param {String|Resource.ConstructorOptions} options A url or an object describing initialization options
+ *
+ * @example
+ * function refreshTokenRetryCallback(resource, error) {
+ * if (error.statusCode === 403) {
+ * // 403 status code means a new token should be generated
+ * return getNewAccessToken()
+ * .then(function(token) {
+ * resource.queryParameters.access_token = token;
+ * return true;
+ * })
+ * .catch(function() {
+ * return false;
+ * });
+ * }
+ *
+ * return false;
+ * }
+ *
+ * const resource = new Resource({
+ * url: 'http://server.com/path/to/resource.json',
+ * proxy: new DefaultProxy('/proxy/'),
+ * headers: {
+ * 'X-My-Header': 'valueOfHeader'
+ * },
+ * queryParameters: {
+ * 'access_token': '123-435-456-000'
+ * },
+ * retryCallback: refreshTokenRetryCallback,
+ * retryAttempts: 1
+ * });
+ */
+ function Resource(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ if (typeof options === "string") {
+ options = {
+ url: options,
+ };
+ }
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.string("options.url", options.url);
+ //>>includeEnd('debug');
+
+ this._url = undefined;
+ this._templateValues = defaultClone(options.templateValues, {});
+ this._queryParameters = defaultClone(options.queryParameters, {});
+
+ /**
+ * Additional HTTP headers that will be sent with the request.
+ *
+ * @type {Object}
+ */
+ this.headers = defaultClone(options.headers, {});
+
+ /**
+ * A Request object that will be used. Intended for internal use only.
+ *
+ * @type {Request}
+ */
+ this.request = defaultValue.defaultValue(options.request, new Request());
+
+ /**
+ * A proxy to be used when loading the resource.
+ *
+ * @type {Proxy}
+ */
+ this.proxy = options.proxy;
+
+ /**
+ * Function to call when a request for this resource fails. If it returns true or a Promise that resolves to true, the request will be retried.
+ *
+ * @type {Function}
+ */
+ this.retryCallback = options.retryCallback;
+
+ /**
+ * The number of times the retryCallback should be called before giving up.
+ *
+ * @type {Number}
+ */
+ this.retryAttempts = defaultValue.defaultValue(options.retryAttempts, 0);
+ this._retryCount = 0;
+
+ const uri = new Uri(options.url);
+ parseQuery(uri, this, true, true);
+
+ // Remove the fragment as it's not sent with a request
+ uri.fragment("");
+
+ this._url = uri.toString();
+ }
+
+ /**
+ * A helper function to create a resource depending on whether we have a String or a Resource
+ *
+ * @param {Resource|String} resource A Resource or a String to use when creating a new Resource.
+ *
+ * @returns {Resource} If resource is a String, a Resource constructed with the url and options. Otherwise the resource parameter is returned.
+ *
+ * @private
+ */
+ Resource.createIfNeeded = function (resource) {
+ if (resource instanceof Resource) {
+ // Keep existing request object. This function is used internally to duplicate a Resource, so that it can't
+ // be modified outside of a class that holds it (eg. an imagery or terrain provider). Since the Request objects
+ // are managed outside of the providers, by the tile loading code, we want to keep the request property the same so if it is changed
+ // in the underlying tiling code the requests for this resource will use it.
+ return resource.getDerivedResource({
+ request: resource.request,
+ });
+ }
+
+ if (typeof resource !== "string") {
+ return resource;
+ }
+
+ return new Resource({
+ url: resource,
+ });
+ };
+
+ let supportsImageBitmapOptionsPromise;
+ /**
+ * A helper function to check whether createImageBitmap supports passing ImageBitmapOptions.
+ *
+ * @returns {Promise} A promise that resolves to true if this browser supports creating an ImageBitmap with options.
+ *
+ * @private
+ */
+ Resource.supportsImageBitmapOptions = function () {
+ // Until the HTML folks figure out what to do about this, we need to actually try loading an image to
+ // know if this browser supports passing options to the createImageBitmap function.
+ // https://github.com/whatwg/html/pull/4248
+ //
+ // We also need to check whether the colorSpaceConversion option is supported.
+ // We do this by loading a PNG with an embedded color profile, first with
+ // colorSpaceConversion: "none" and then with colorSpaceConversion: "default".
+ // If the pixel color is different then we know the option is working.
+ // As of Webkit 17612.3.6.1.6 the createImageBitmap promise resolves but the
+ // option is not actually supported.
+ if (defaultValue.defined(supportsImageBitmapOptionsPromise)) {
+ return supportsImageBitmapOptionsPromise;
+ }
+
+ if (typeof createImageBitmap !== "function") {
+ supportsImageBitmapOptionsPromise = Promise.resolve(false);
+ return supportsImageBitmapOptionsPromise;
+ }
+
+ const imageDataUri =
+ "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC";
+
+ supportsImageBitmapOptionsPromise = Resource.fetchBlob({
+ url: imageDataUri,
+ })
+ .then(function (blob) {
+ const imageBitmapOptions = {
+ imageOrientation: "flipY", // default is "none"
+ premultiplyAlpha: "none", // default is "default"
+ colorSpaceConversion: "none", // default is "default"
+ };
+ return Promise.all([
+ createImageBitmap(blob, imageBitmapOptions),
+ createImageBitmap(blob),
+ ]);
+ })
+ .then(function (imageBitmaps) {
+ // Check whether the colorSpaceConversion option had any effect on the green channel
+ const colorWithOptions = getImagePixels(imageBitmaps[0]);
+ const colorWithDefaults = getImagePixels(imageBitmaps[1]);
+ return colorWithOptions[1] !== colorWithDefaults[1];
+ })
+ .catch(function () {
+ return false;
+ });
+
+ return supportsImageBitmapOptionsPromise;
+ };
+
+ Object.defineProperties(Resource, {
+ /**
+ * Returns true if blobs are supported.
+ *
+ * @memberof Resource
+ * @type {Boolean}
+ *
+ * @readonly
+ */
+ isBlobSupported: {
+ get: function () {
+ return xhrBlobSupported;
+ },
+ },
+ });
+
+ Object.defineProperties(Resource.prototype, {
+ /**
+ * Query parameters appended to the url.
+ *
+ * @memberof Resource.prototype
+ * @type {Object}
+ *
+ * @readonly
+ */
+ queryParameters: {
+ get: function () {
+ return this._queryParameters;
+ },
+ },
+
+ /**
+ * The key/value pairs used to replace template parameters in the url.
+ *
+ * @memberof Resource.prototype
+ * @type {Object}
+ *
+ * @readonly
+ */
+ templateValues: {
+ get: function () {
+ return this._templateValues;
+ },
+ },
+
+ /**
+ * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.
+ *
+ * @memberof Resource.prototype
+ * @type {String}
+ */
+ url: {
+ get: function () {
+ return this.getUrlComponent(true, true);
+ },
+ set: function (value) {
+ const uri = new Uri(value);
+
+ parseQuery(uri, this, false);
+
+ // Remove the fragment as it's not sent with a request
+ uri.fragment("");
+
+ this._url = uri.toString();
+ },
+ },
+
+ /**
+ * The file extension of the resource.
+ *
+ * @memberof Resource.prototype
+ * @type {String}
+ *
+ * @readonly
+ */
+ extension: {
+ get: function () {
+ return getExtensionFromUri(this._url);
+ },
+ },
+
+ /**
+ * True if the Resource refers to a data URI.
+ *
+ * @memberof Resource.prototype
+ * @type {Boolean}
+ */
+ isDataUri: {
+ get: function () {
+ return isDataUri(this._url);
+ },
+ },
+
+ /**
+ * True if the Resource refers to a blob URI.
+ *
+ * @memberof Resource.prototype
+ * @type {Boolean}
+ */
+ isBlobUri: {
+ get: function () {
+ return isBlobUri(this._url);
+ },
+ },
+
+ /**
+ * True if the Resource refers to a cross origin URL.
+ *
+ * @memberof Resource.prototype
+ * @type {Boolean}
+ */
+ isCrossOriginUrl: {
+ get: function () {
+ return isCrossOriginUrl(this._url);
+ },
+ },
+
+ /**
+ * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.
+ *
+ * @memberof Resource.prototype
+ * @type {Boolean}
+ */
+ hasHeaders: {
+ get: function () {
+ return Object.keys(this.headers).length > 0;
+ },
+ },
+ });
+
+ /**
+ * Override Object#toString so that implicit string conversion gives the
+ * complete URL represented by this Resource.
+ *
+ * @returns {String} The URL represented by this Resource
+ */
+ Resource.prototype.toString = function () {
+ return this.getUrlComponent(true, true);
+ };
+
+ /**
+ * Returns the url, optional with the query string and processed by a proxy.
+ *
+ * @param {Boolean} [query=false] If true, the query string is included.
+ * @param {Boolean} [proxy=false] If true, the url is processed by the proxy object, if defined.
+ *
+ * @returns {String} The url with all the requested components.
+ */
+ Resource.prototype.getUrlComponent = function (query, proxy) {
+ if (this.isDataUri) {
+ return this._url;
+ }
+
+ const uri = new Uri(this._url);
+
+ if (query) {
+ stringifyQuery(uri, this);
+ }
+
+ // objectToQuery escapes the placeholders. Undo that.
+ let url = uri.toString().replace(/%7B/g, "{").replace(/%7D/g, "}");
+
+ const templateValues = this._templateValues;
+ url = url.replace(/{(.*?)}/g, function (match, key) {
+ const replacement = templateValues[key];
+ if (defaultValue.defined(replacement)) {
+ // use the replacement value from templateValues if there is one...
+ return encodeURIComponent(replacement);
+ }
+ // otherwise leave it unchanged
+ return match;
+ });
+
+ if (proxy && defaultValue.defined(this.proxy)) {
+ url = this.proxy.getURL(url);
+ }
+ return url;
+ };
+
+ /**
+ * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
+ * as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value.
+ *
+ * @param {Object} params The query parameters
+ * @param {Boolean} [useAsDefault=false] If true the params will be used as the default values, so they will only be set if they are undefined.
+ */
+ Resource.prototype.setQueryParameters = function (params, useAsDefault) {
+ if (useAsDefault) {
+ this._queryParameters = combineQueryParameters(
+ this._queryParameters,
+ params,
+ false
+ );
+ } else {
+ this._queryParameters = combineQueryParameters(
+ params,
+ this._queryParameters,
+ false
+ );
+ }
+ };
+
+ /**
+ * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
+ * as opposed to adding them one at a time to the queryParameters property.
+ *
+ * @param {Object} params The query parameters
+ */
+ Resource.prototype.appendQueryParameters = function (params) {
+ this._queryParameters = combineQueryParameters(
+ params,
+ this._queryParameters,
+ true
+ );
+ };
+
+ /**
+ * Combines the specified object and the existing template values. This allows you to add many values at once,
+ * as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended.
+ *
+ * @param {Object} template The template values
+ * @param {Boolean} [useAsDefault=false] If true the values will be used as the default values, so they will only be set if they are undefined.
+ */
+ Resource.prototype.setTemplateValues = function (template, useAsDefault) {
+ if (useAsDefault) {
+ this._templateValues = combine.combine(this._templateValues, template);
+ } else {
+ this._templateValues = combine.combine(template, this._templateValues);
+ }
+ };
+
+ /**
+ * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.
+ *
+ * @param {Object} options An object with the following properties
+ * @param {String} [options.url] The url that will be resolved relative to the url of the current instance.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be combined with those of the current instance.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance.
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The function to call when loading the resource fails.
+ * @param {Number} [options.retryAttempts] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @param {Boolean} [options.preserveQueryParameters=false] If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource.
+ *
+ * @returns {Resource} The resource derived from the current one.
+ */
+ Resource.prototype.getDerivedResource = function (options) {
+ const resource = this.clone();
+ resource._retryCount = 0;
+
+ if (defaultValue.defined(options.url)) {
+ const uri = new Uri(options.url);
+
+ const preserveQueryParameters = defaultValue.defaultValue(
+ options.preserveQueryParameters,
+ false
+ );
+ parseQuery(uri, resource, true, preserveQueryParameters);
+
+ // Remove the fragment as it's not sent with a request
+ uri.fragment("");
+
+ if (uri.scheme() !== "") {
+ resource._url = uri.toString();
+ } else {
+ resource._url = uri
+ .absoluteTo(new Uri(getAbsoluteUri(this._url)))
+ .toString();
+ }
+ }
+
+ if (defaultValue.defined(options.queryParameters)) {
+ resource._queryParameters = combine.combine(
+ options.queryParameters,
+ resource._queryParameters
+ );
+ }
+ if (defaultValue.defined(options.templateValues)) {
+ resource._templateValues = combine.combine(
+ options.templateValues,
+ resource.templateValues
+ );
+ }
+ if (defaultValue.defined(options.headers)) {
+ resource.headers = combine.combine(options.headers, resource.headers);
+ }
+ if (defaultValue.defined(options.proxy)) {
+ resource.proxy = options.proxy;
+ }
+ if (defaultValue.defined(options.request)) {
+ resource.request = options.request;
+ }
+ if (defaultValue.defined(options.retryCallback)) {
+ resource.retryCallback = options.retryCallback;
+ }
+ if (defaultValue.defined(options.retryAttempts)) {
+ resource.retryAttempts = options.retryAttempts;
+ }
+
+ return resource;
+ };
+
+ /**
+ * Called when a resource fails to load. This will call the retryCallback function if defined until retryAttempts is reached.
+ *
+ * @param {Error} [error] The error that was encountered.
+ *
+ * @returns {Promise} A promise to a boolean, that if true will cause the resource request to be retried.
+ *
+ * @private
+ */
+ Resource.prototype.retryOnError = function (error) {
+ const retryCallback = this.retryCallback;
+ if (
+ typeof retryCallback !== "function" ||
+ this._retryCount >= this.retryAttempts
+ ) {
+ return Promise.resolve(false);
+ }
+
+ const that = this;
+ return Promise.resolve(retryCallback(this, error)).then(function (result) {
+ ++that._retryCount;
+
+ return result;
+ });
+ };
+
+ /**
+ * Duplicates a Resource instance.
+ *
+ * @param {Resource} [result] The object onto which to store the result.
+ *
+ * @returns {Resource} The modified result parameter or a new Resource instance if one was not provided.
+ */
+ Resource.prototype.clone = function (result) {
+ if (!defaultValue.defined(result)) {
+ result = new Resource({
+ url: this._url,
+ });
+ }
+
+ result._url = this._url;
+ result._queryParameters = clone(this._queryParameters);
+ result._templateValues = clone(this._templateValues);
+ result.headers = clone(this.headers);
+ result.proxy = this.proxy;
+ result.retryCallback = this.retryCallback;
+ result.retryAttempts = this.retryAttempts;
+ result._retryCount = 0;
+ result.request = this.request.clone();
+
+ return result;
+ };
+
+ /**
+ * Returns the base path of the Resource.
+ *
+ * @param {Boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri
+ *
+ * @returns {String} The base URI of the resource
+ */
+ Resource.prototype.getBaseUri = function (includeQuery) {
+ return getBaseUri(this.getUrlComponent(includeQuery), includeQuery);
+ };
+
+ /**
+ * Appends a forward slash to the URL.
+ */
+ Resource.prototype.appendForwardSlash = function () {
+ this._url = appendForwardSlash(this._url);
+ };
+
+ /**
+ * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to
+ * an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
+ *
+ * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ * @example
+ * // load a single URL asynchronously
+ * resource.fetchArrayBuffer().then(function(arrayBuffer) {
+ * // use the data
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.fetchArrayBuffer = function () {
+ return this.fetch({
+ responseType: "arraybuffer",
+ });
+ };
+
+ /**
+ * Creates a Resource and calls fetchArrayBuffer() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.fetchArrayBuffer = function (options) {
+ const resource = new Resource(options);
+ return resource.fetchArrayBuffer();
+ };
+
+ /**
+ * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to
+ * a Blob once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
+ *
+ * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ * @example
+ * // load a single URL asynchronously
+ * resource.fetchBlob().then(function(blob) {
+ * // use the data
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.fetchBlob = function () {
+ return this.fetch({
+ responseType: "blob",
+ });
+ };
+
+ /**
+ * Creates a Resource and calls fetchBlob() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.fetchBlob = function (options) {
+ const resource = new Resource(options);
+ return resource.fetchBlob();
+ };
+
+ /**
+ * Asynchronously loads the given image resource. Returns a promise that will resolve to
+ * an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if preferImageBitmap
is true and the browser supports createImageBitmap
or otherwise an
+ * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.
+ *
+ * @param {Object} [options] An object with the following properties.
+ * @param {Boolean} [options.preferBlob=false] If true, we will load the image via a blob.
+ * @param {Boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap
is returned.
+ * @param {Boolean} [options.flipY=false] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap
.
+ * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap
.
+ * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * // load a single image asynchronously
+ * resource.fetchImage().then(function(image) {
+ * // use the loaded image
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * // load several images in parallel
+ * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
+ * // images is an array containing all the loaded images
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.fetchImage = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const preferImageBitmap = defaultValue.defaultValue(options.preferImageBitmap, false);
+ const preferBlob = defaultValue.defaultValue(options.preferBlob, false);
+ const flipY = defaultValue.defaultValue(options.flipY, false);
+ const skipColorSpaceConversion = defaultValue.defaultValue(
+ options.skipColorSpaceConversion,
+ false
+ );
+
+ checkAndResetRequest(this.request);
+ // We try to load the image normally if
+ // 1. Blobs aren't supported
+ // 2. It's a data URI
+ // 3. It's a blob URI
+ // 4. It doesn't have request headers and we preferBlob is false
+ if (
+ !xhrBlobSupported ||
+ this.isDataUri ||
+ this.isBlobUri ||
+ (!this.hasHeaders && !preferBlob)
+ ) {
+ return fetchImage({
+ resource: this,
+ flipY: flipY,
+ skipColorSpaceConversion: skipColorSpaceConversion,
+ preferImageBitmap: preferImageBitmap,
+ });
+ }
+
+ const blobPromise = this.fetchBlob();
+ if (!defaultValue.defined(blobPromise)) {
+ return;
+ }
+
+ let supportsImageBitmap;
+ let useImageBitmap;
+ let generatedBlobResource;
+ let generatedBlob;
+ return Resource.supportsImageBitmapOptions()
+ .then(function (result) {
+ supportsImageBitmap = result;
+ useImageBitmap = supportsImageBitmap && preferImageBitmap;
+ return blobPromise;
+ })
+ .then(function (blob) {
+ if (!defaultValue.defined(blob)) {
+ return;
+ }
+ generatedBlob = blob;
+ if (useImageBitmap) {
+ return Resource.createImageBitmapFromBlob(blob, {
+ flipY: flipY,
+ premultiplyAlpha: false,
+ skipColorSpaceConversion: skipColorSpaceConversion,
+ });
+ }
+ const blobUrl = window.URL.createObjectURL(blob);
+ generatedBlobResource = new Resource({
+ url: blobUrl,
+ });
+
+ return fetchImage({
+ resource: generatedBlobResource,
+ flipY: flipY,
+ skipColorSpaceConversion: skipColorSpaceConversion,
+ preferImageBitmap: false,
+ });
+ })
+ .then(function (image) {
+ if (!defaultValue.defined(image)) {
+ return;
+ }
+
+ // The blob object may be needed for use by a TileDiscardPolicy,
+ // so attach it to the image.
+ image.blob = generatedBlob;
+
+ if (useImageBitmap) {
+ return image;
+ }
+
+ window.URL.revokeObjectURL(generatedBlobResource.url);
+ return image;
+ })
+ .catch(function (error) {
+ if (defaultValue.defined(generatedBlobResource)) {
+ window.URL.revokeObjectURL(generatedBlobResource.url);
+ }
+
+ // If the blob load succeeded but the image decode failed, attach the blob
+ // to the error object for use by a TileDiscardPolicy.
+ // In particular, BingMapsImageryProvider uses this to detect the
+ // zero-length response that is returned when a tile is not available.
+ error.blob = generatedBlob;
+
+ return Promise.reject(error);
+ });
+ };
+
+ /**
+ * Fetches an image and returns a promise to it.
+ *
+ * @param {Object} [options] An object with the following properties.
+ * @param {Resource} [options.resource] Resource object that points to an image to fetch.
+ * @param {Boolean} [options.preferImageBitmap] If true, image will be decoded during fetch and an ImageBitmap
is returned.
+ * @param {Boolean} [options.flipY] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap
.
+ * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap
.
+ * @private
+ */
+ function fetchImage(options) {
+ const resource = options.resource;
+ const flipY = options.flipY;
+ const skipColorSpaceConversion = options.skipColorSpaceConversion;
+ const preferImageBitmap = options.preferImageBitmap;
+
+ const request = resource.request;
+ request.url = resource.url;
+ request.requestFunction = function () {
+ let crossOrigin = false;
+
+ // data URIs can't have crossorigin set.
+ if (!resource.isDataUri && !resource.isBlobUri) {
+ crossOrigin = resource.isCrossOriginUrl;
+ }
+
+ const deferred = defer();
+ Resource._Implementations.createImage(
+ request,
+ crossOrigin,
+ deferred,
+ flipY,
+ skipColorSpaceConversion,
+ preferImageBitmap
+ );
+
+ return deferred.promise;
+ };
+
+ const promise = RequestScheduler.request(request);
+ if (!defaultValue.defined(promise)) {
+ return;
+ }
+
+ return promise.catch(function (e) {
+ // Don't retry cancelled or otherwise aborted requests
+ if (request.state !== RequestState$1.FAILED) {
+ return Promise.reject(e);
+ }
+ return resource.retryOnError(e).then(function (retry) {
+ if (retry) {
+ // Reset request so it can try again
+ request.state = RequestState$1.UNISSUED;
+ request.deferred = undefined;
+
+ return fetchImage({
+ resource: resource,
+ flipY: flipY,
+ skipColorSpaceConversion: skipColorSpaceConversion,
+ preferImageBitmap: preferImageBitmap,
+ });
+ }
+ return Promise.reject(e);
+ });
+ });
+ }
+
+ /**
+ * Creates a Resource and calls fetchImage() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Boolean} [options.flipY=false] Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports createImageBitmap
.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @param {Boolean} [options.preferBlob=false] If true, we will load the image via a blob.
+ * @param {Boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap
is returned.
+ * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports createImageBitmap
.
+ * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.fetchImage = function (options) {
+ const resource = new Resource(options);
+ return resource.fetchImage({
+ flipY: options.flipY,
+ skipColorSpaceConversion: options.skipColorSpaceConversion,
+ preferBlob: options.preferBlob,
+ preferImageBitmap: options.preferImageBitmap,
+ });
+ };
+
+ /**
+ * Asynchronously loads the given resource as text. Returns a promise that will resolve to
+ * a String once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
+ *
+ * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ * @example
+ * // load text from a URL, setting a custom header
+ * const resource = new Resource({
+ * url: 'http://someUrl.com/someJson.txt',
+ * headers: {
+ * 'X-Custom-Header' : 'some value'
+ * }
+ * });
+ * resource.fetchText().then(function(text) {
+ * // Do something with the text
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.fetchText = function () {
+ return this.fetch({
+ responseType: "text",
+ });
+ };
+
+ /**
+ * Creates a Resource and calls fetchText() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.fetchText = function (options) {
+ const resource = new Resource(options);
+ return resource.fetchText();
+ };
+
+ // note: */* below is */* but that ends the comment block early
+ /**
+ * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to
+ * a JSON object once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function
+ * adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not
+ * already specified.
+ *
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * resource.fetchJson().then(function(jsonData) {
+ * // Do something with the JSON object
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.fetchJson = function () {
+ const promise = this.fetch({
+ responseType: "text",
+ headers: {
+ Accept: "application/json,*/*;q=0.01",
+ },
+ });
+
+ if (!defaultValue.defined(promise)) {
+ return undefined;
+ }
+
+ return promise.then(function (value) {
+ if (!defaultValue.defined(value)) {
+ return;
+ }
+ return JSON.parse(value);
+ });
+ };
+
+ /**
+ * Creates a Resource and calls fetchJson() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.fetchJson = function (options) {
+ const resource = new Resource(options);
+ return resource.fetchJson();
+ };
+
+ /**
+ * Asynchronously loads the given resource as XML. Returns a promise that will resolve to
+ * an XML Document once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
+ *
+ * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * // load XML from a URL, setting a custom header
+ * Cesium.loadXML('http://someUrl.com/someXML.xml', {
+ * 'X-Custom-Header' : 'some value'
+ * }).then(function(document) {
+ * // Do something with the document
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.fetchXML = function () {
+ return this.fetch({
+ responseType: "document",
+ overrideMimeType: "text/xml",
+ });
+ };
+
+ /**
+ * Creates a Resource and calls fetchXML() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.fetchXML = function (options) {
+ const resource = new Resource(options);
+ return resource.fetchXML();
+ };
+
+ /**
+ * Requests a resource using JSONP.
+ *
+ * @param {String} [callbackParameterName='callback'] The callback parameter name that the server expects.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * // load a data asynchronously
+ * resource.fetchJsonp().then(function(data) {
+ * // use the loaded data
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.fetchJsonp = function (callbackParameterName) {
+ callbackParameterName = defaultValue.defaultValue(callbackParameterName, "callback");
+
+ checkAndResetRequest(this.request);
+
+ //generate a unique function name
+ let functionName;
+ do {
+ functionName = `loadJsonp${Math$1.CesiumMath.nextRandomNumber()
+ .toString()
+ .substring(2, 8)}`;
+ } while (defaultValue.defined(window[functionName]));
+
+ return fetchJsonp(this, callbackParameterName, functionName);
+ };
+
+ function fetchJsonp(resource, callbackParameterName, functionName) {
+ const callbackQuery = {};
+ callbackQuery[callbackParameterName] = functionName;
+ resource.setQueryParameters(callbackQuery);
+
+ const request = resource.request;
+ request.url = resource.url;
+ request.requestFunction = function () {
+ const deferred = defer();
+
+ //assign a function with that name in the global scope
+ window[functionName] = function (data) {
+ deferred.resolve(data);
+
+ try {
+ delete window[functionName];
+ } catch (e) {
+ window[functionName] = undefined;
+ }
+ };
+
+ Resource._Implementations.loadAndExecuteScript(
+ resource.url,
+ functionName,
+ deferred
+ );
+ return deferred.promise;
+ };
+
+ const promise = RequestScheduler.request(request);
+ if (!defaultValue.defined(promise)) {
+ return;
+ }
+
+ return promise.catch(function (e) {
+ if (request.state !== RequestState$1.FAILED) {
+ return Promise.reject(e);
+ }
+
+ return resource.retryOnError(e).then(function (retry) {
+ if (retry) {
+ // Reset request so it can try again
+ request.state = RequestState$1.UNISSUED;
+ request.deferred = undefined;
+
+ return fetchJsonp(resource, callbackParameterName, functionName);
+ }
+
+ return Promise.reject(e);
+ });
+ });
+ }
+
+ /**
+ * Creates a Resource from a URL and calls fetchJsonp() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @param {String} [options.callbackParameterName='callback'] The callback parameter name that the server expects.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.fetchJsonp = function (options) {
+ const resource = new Resource(options);
+ return resource.fetchJsonp(options.callbackParameterName);
+ };
+
+ /**
+ * @private
+ */
+ Resource.prototype._makeRequest = function (options) {
+ const resource = this;
+ checkAndResetRequest(resource.request);
+
+ const request = resource.request;
+ request.url = resource.url;
+
+ request.requestFunction = function () {
+ const responseType = options.responseType;
+ const headers = combine.combine(options.headers, resource.headers);
+ const overrideMimeType = options.overrideMimeType;
+ const method = options.method;
+ const data = options.data;
+ const deferred = defer();
+ const xhr = Resource._Implementations.loadWithXhr(
+ resource.url,
+ responseType,
+ method,
+ data,
+ headers,
+ deferred,
+ overrideMimeType
+ );
+ if (defaultValue.defined(xhr) && defaultValue.defined(xhr.abort)) {
+ request.cancelFunction = function () {
+ xhr.abort();
+ };
+ }
+ return deferred.promise;
+ };
+
+ const promise = RequestScheduler.request(request);
+ if (!defaultValue.defined(promise)) {
+ return;
+ }
+
+ return promise
+ .then(function (data) {
+ // explicitly set to undefined to ensure GC of request response data. See #8843
+ request.cancelFunction = undefined;
+ return data;
+ })
+ .catch(function (e) {
+ request.cancelFunction = undefined;
+ if (request.state !== RequestState$1.FAILED) {
+ return Promise.reject(e);
+ }
+
+ return resource.retryOnError(e).then(function (retry) {
+ if (retry) {
+ // Reset request so it can try again
+ request.state = RequestState$1.UNISSUED;
+ request.deferred = undefined;
+
+ return resource.fetch(options);
+ }
+
+ return Promise.reject(e);
+ });
+ });
+ };
+
+ const dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;
+
+ function decodeDataUriText(isBase64, data) {
+ const result = decodeURIComponent(data);
+ if (isBase64) {
+ return atob(result);
+ }
+ return result;
+ }
+
+ function decodeDataUriArrayBuffer(isBase64, data) {
+ const byteString = decodeDataUriText(isBase64, data);
+ const buffer = new ArrayBuffer(byteString.length);
+ const view = new Uint8Array(buffer);
+ for (let i = 0; i < byteString.length; i++) {
+ view[i] = byteString.charCodeAt(i);
+ }
+ return buffer;
+ }
+
+ function decodeDataUri(dataUriRegexResult, responseType) {
+ responseType = defaultValue.defaultValue(responseType, "");
+ const mimeType = dataUriRegexResult[1];
+ const isBase64 = !!dataUriRegexResult[2];
+ const data = dataUriRegexResult[3];
+ let buffer;
+ let parser;
+
+ switch (responseType) {
+ case "":
+ case "text":
+ return decodeDataUriText(isBase64, data);
+ case "arraybuffer":
+ return decodeDataUriArrayBuffer(isBase64, data);
+ case "blob":
+ buffer = decodeDataUriArrayBuffer(isBase64, data);
+ return new Blob([buffer], {
+ type: mimeType,
+ });
+ case "document":
+ parser = new DOMParser();
+ return parser.parseFromString(
+ decodeDataUriText(isBase64, data),
+ mimeType
+ );
+ case "json":
+ return JSON.parse(decodeDataUriText(isBase64, data));
+ default:
+ //>>includeStart('debug', pragmas.debug);
+ throw new Check.DeveloperError(`Unhandled responseType: ${responseType}`);
+ //>>includeEnd('debug');
+ }
+ }
+
+ /**
+ * Asynchronously loads the given resource. Returns a promise that will resolve to
+ * the result once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use
+ * the more specific functions eg. fetchJson, fetchBlob, etc.
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * resource.fetch()
+ * .then(function(body) {
+ * // use the data
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.fetch = function (options) {
+ options = defaultClone(options, {});
+ options.method = "GET";
+
+ return this._makeRequest(options);
+ };
+
+ /**
+ * Creates a Resource from a URL and calls fetch() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.fetch = function (options) {
+ const resource = new Resource(options);
+ return resource.fetch({
+ // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType,
+ });
+ };
+
+ /**
+ * Asynchronously deletes the given resource. Returns a promise that will resolve to
+ * the result once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * resource.delete()
+ * .then(function(body) {
+ * // use the data
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.delete = function (options) {
+ options = defaultClone(options, {});
+ options.method = "DELETE";
+
+ return this._makeRequest(options);
+ };
+
+ /**
+ * Creates a Resource from a URL and calls delete() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.data] Data that is posted with the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.delete = function (options) {
+ const resource = new Resource(options);
+ return resource.delete({
+ // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType,
+ data: options.data,
+ });
+ };
+
+ /**
+ * Asynchronously gets headers the given resource. Returns a promise that will resolve to
+ * the result once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * resource.head()
+ * .then(function(headers) {
+ * // use the data
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.head = function (options) {
+ options = defaultClone(options, {});
+ options.method = "HEAD";
+
+ return this._makeRequest(options);
+ };
+
+ /**
+ * Creates a Resource from a URL and calls head() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.head = function (options) {
+ const resource = new Resource(options);
+ return resource.head({
+ // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType,
+ });
+ };
+
+ /**
+ * Asynchronously gets options the given resource. Returns a promise that will resolve to
+ * the result once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * resource.options()
+ * .then(function(headers) {
+ * // use the data
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.options = function (options) {
+ options = defaultClone(options, {});
+ options.method = "OPTIONS";
+
+ return this._makeRequest(options);
+ };
+
+ /**
+ * Creates a Resource from a URL and calls options() on it.
+ *
+ * @param {String|Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.options = function (options) {
+ const resource = new Resource(options);
+ return resource.options({
+ // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType,
+ });
+ };
+
+ /**
+ * Asynchronously posts data to the given resource. Returns a promise that will resolve to
+ * the result once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
+ *
+ * @param {Object} data Data that is posted with the resource.
+ * @param {Object} [options] Object with the following properties:
+ * @param {Object} [options.data] Data that is posted with the resource.
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * resource.post(data)
+ * .then(function(result) {
+ * // use the result
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.post = function (data, options) {
+ Check.Check.defined("data", data);
+
+ options = defaultClone(options, {});
+ options.method = "POST";
+ options.data = data;
+
+ return this._makeRequest(options);
+ };
+
+ /**
+ * Creates a Resource from a URL and calls post() on it.
+ *
+ * @param {Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} options.data Data that is posted with the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.post = function (options) {
+ const resource = new Resource(options);
+ return resource.post(options.data, {
+ // Make copy of just the needed fields because headers can be passed to both the constructor and to post
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType,
+ });
+ };
+
+ /**
+ * Asynchronously puts data to the given resource. Returns a promise that will resolve to
+ * the result once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
+ *
+ * @param {Object} data Data that is posted with the resource.
+ * @param {Object} [options] Object with the following properties:
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * resource.put(data)
+ * .then(function(result) {
+ * // use the result
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.put = function (data, options) {
+ Check.Check.defined("data", data);
+
+ options = defaultClone(options, {});
+ options.method = "PUT";
+ options.data = data;
+
+ return this._makeRequest(options);
+ };
+
+ /**
+ * Creates a Resource from a URL and calls put() on it.
+ *
+ * @param {Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} options.data Data that is posted with the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.put = function (options) {
+ const resource = new Resource(options);
+ return resource.put(options.data, {
+ // Make copy of just the needed fields because headers can be passed to both the constructor and to post
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType,
+ });
+ };
+
+ /**
+ * Asynchronously patches data to the given resource. Returns a promise that will resolve to
+ * the result once loaded, or reject if the resource failed to load. The data is loaded
+ * using XMLHttpRequest, which means that in order to make requests to another origin,
+ * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
+ *
+ * @param {Object} data Data that is posted with the resource.
+ * @param {Object} [options] Object with the following properties:
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ *
+ *
+ * @example
+ * resource.patch(data)
+ * .then(function(result) {
+ * // use the result
+ * }).catch(function(error) {
+ * // an error occurred
+ * });
+ *
+ * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
+ * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}
+ */
+ Resource.prototype.patch = function (data, options) {
+ Check.Check.defined("data", data);
+
+ options = defaultClone(options, {});
+ options.method = "PATCH";
+ options.data = data;
+
+ return this._makeRequest(options);
+ };
+
+ /**
+ * Creates a Resource from a URL and calls patch() on it.
+ *
+ * @param {Object} options A url or an object with the following properties
+ * @param {String} options.url The url of the resource.
+ * @param {Object} options.data Data that is posted with the resource.
+ * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.
+ * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).
+ * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.
+ * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.
+ * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.
+ * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.
+ * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.
+ * @param {String} [options.responseType] The type of response. This controls the type of item returned.
+ * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.
+ * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.
+ */
+ Resource.patch = function (options) {
+ const resource = new Resource(options);
+ return resource.patch(options.data, {
+ // Make copy of just the needed fields because headers can be passed to both the constructor and to post
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType,
+ });
+ };
+
+ /**
+ * Contains implementations of functions that can be replaced for testing
+ *
+ * @private
+ */
+ Resource._Implementations = {};
+
+ Resource._Implementations.loadImageElement = function (
+ url,
+ crossOrigin,
+ deferred
+ ) {
+ const image = new Image();
+
+ image.onload = function () {
+ // work-around a known issue with Firefox and dimensionless SVG, see:
+ // - https://github.com/whatwg/html/issues/3510
+ // - https://bugzilla.mozilla.org/show_bug.cgi?id=700533
+ if (
+ image.naturalWidth === 0 &&
+ image.naturalHeight === 0 &&
+ image.width === 0 &&
+ image.height === 0
+ ) {
+ // these values affect rasterization and will likely mar the content
+ // until Firefox takes a stance on the issue, marred content is better than no content
+ // Chromium uses a more refined heuristic about its choice given nil viewBox, and a better stance and solution is
+ // proposed later in the original issue thread:
+ // - Chromium behavior: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-704400825
+ // - Cesium's stance/solve: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-720645777
+ image.width = 300;
+ image.height = 150;
+ }
+ deferred.resolve(image);
+ };
+
+ image.onerror = function (e) {
+ deferred.reject(e);
+ };
+
+ if (crossOrigin) {
+ if (TrustedServers$1.contains(url)) {
+ image.crossOrigin = "use-credentials";
+ } else {
+ image.crossOrigin = "";
+ }
+ }
+
+ image.src = url;
+ };
+
+ Resource._Implementations.createImage = function (
+ request,
+ crossOrigin,
+ deferred,
+ flipY,
+ skipColorSpaceConversion,
+ preferImageBitmap
+ ) {
+ const url = request.url;
+ // Passing an Image to createImageBitmap will force it to run on the main thread
+ // since DOM elements don't exist on workers. We convert it to a blob so it's non-blocking.
+ // See:
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1044102#c38
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=580202#c10
+ Resource.supportsImageBitmapOptions()
+ .then(function (supportsImageBitmap) {
+ // We can only use ImageBitmap if we can flip on decode.
+ // See: https://github.com/CesiumGS/cesium/pull/7579#issuecomment-466146898
+ if (!(supportsImageBitmap && preferImageBitmap)) {
+ Resource._Implementations.loadImageElement(url, crossOrigin, deferred);
+ return;
+ }
+ const responseType = "blob";
+ const method = "GET";
+ const xhrDeferred = defer();
+ const xhr = Resource._Implementations.loadWithXhr(
+ url,
+ responseType,
+ method,
+ undefined,
+ undefined,
+ xhrDeferred,
+ undefined,
+ undefined,
+ undefined
+ );
+
+ if (defaultValue.defined(xhr) && defaultValue.defined(xhr.abort)) {
+ request.cancelFunction = function () {
+ xhr.abort();
+ };
+ }
+ return xhrDeferred.promise
+ .then(function (blob) {
+ if (!defaultValue.defined(blob)) {
+ deferred.reject(
+ new RuntimeError.RuntimeError(
+ `Successfully retrieved ${url} but it contained no content.`
+ )
+ );
+ return;
+ }
+
+ return Resource.createImageBitmapFromBlob(blob, {
+ flipY: flipY,
+ premultiplyAlpha: false,
+ skipColorSpaceConversion: skipColorSpaceConversion,
+ });
+ })
+ .then(function (image) {
+ deferred.resolve(image);
+ });
+ })
+ .catch(function (e) {
+ deferred.reject(e);
+ });
+ };
+
+ /**
+ * Wrapper for createImageBitmap
+ *
+ * @private
+ */
+ Resource.createImageBitmapFromBlob = function (blob, options) {
+ Check.Check.defined("options", options);
+ Check.Check.typeOf.bool("options.flipY", options.flipY);
+ Check.Check.typeOf.bool("options.premultiplyAlpha", options.premultiplyAlpha);
+ Check.Check.typeOf.bool(
+ "options.skipColorSpaceConversion",
+ options.skipColorSpaceConversion
+ );
+
+ return createImageBitmap(blob, {
+ imageOrientation: options.flipY ? "flipY" : "none",
+ premultiplyAlpha: options.premultiplyAlpha ? "premultiply" : "none",
+ colorSpaceConversion: options.skipColorSpaceConversion ? "none" : "default",
+ });
+ };
+
+ function decodeResponse(loadWithHttpResponse, responseType) {
+ switch (responseType) {
+ case "text":
+ return loadWithHttpResponse.toString("utf8");
+ case "json":
+ return JSON.parse(loadWithHttpResponse.toString("utf8"));
+ default:
+ return new Uint8Array(loadWithHttpResponse).buffer;
+ }
+ }
+
+ function loadWithHttpRequest(
+ url,
+ responseType,
+ method,
+ data,
+ headers,
+ deferred,
+ overrideMimeType
+ ) {
+ // Note: only the 'json' and 'text' responseTypes transforms the loaded buffer
+ let URL;
+ let zlib;
+ Promise.all([new Promise(function (resolve, reject) { require(['url'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }), new Promise(function (resolve, reject) { require(['zlib'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); })])
+ .then(([urlImport, zlibImport]) => {
+ URL = urlImport.parse(url);
+ zlib = zlibImport;
+
+ return URL.protocol === "https:" ? new Promise(function (resolve, reject) { require(['https'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); }) : new Promise(function (resolve, reject) { require(['http'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject); });
+ })
+ .then((http) => {
+ const options = {
+ protocol: URL.protocol,
+ hostname: URL.hostname,
+ port: URL.port,
+ path: URL.path,
+ query: URL.query,
+ method: method,
+ headers: headers,
+ };
+ http
+ .request(options)
+ .on("response", function (res) {
+ if (res.statusCode < 200 || res.statusCode >= 300) {
+ deferred.reject(
+ new RequestErrorEvent(res.statusCode, res, res.headers)
+ );
+ return;
+ }
+
+ const chunkArray = [];
+ res.on("data", function (chunk) {
+ chunkArray.push(chunk);
+ });
+
+ res.on("end", function () {
+ // eslint-disable-next-line no-undef
+ const result = Buffer.concat(chunkArray);
+ if (res.headers["content-encoding"] === "gzip") {
+ zlib.gunzip(result, function (error, resultUnzipped) {
+ if (error) {
+ deferred.reject(
+ new RuntimeError.RuntimeError("Error decompressing response.")
+ );
+ } else {
+ deferred.resolve(
+ decodeResponse(resultUnzipped, responseType)
+ );
+ }
+ });
+ } else {
+ deferred.resolve(decodeResponse(result, responseType));
+ }
+ });
+ })
+ .on("error", function (e) {
+ deferred.reject(new RequestErrorEvent());
+ })
+ .end();
+ });
+ }
+
+ const noXMLHttpRequest = typeof XMLHttpRequest === "undefined";
+ Resource._Implementations.loadWithXhr = function (
+ url,
+ responseType,
+ method,
+ data,
+ headers,
+ deferred,
+ overrideMimeType
+ ) {
+ const dataUriRegexResult = dataUriRegex.exec(url);
+ if (dataUriRegexResult !== null) {
+ deferred.resolve(decodeDataUri(dataUriRegexResult, responseType));
+ return;
+ }
+
+ if (noXMLHttpRequest) {
+ loadWithHttpRequest(
+ url,
+ responseType,
+ method,
+ data,
+ headers,
+ deferred);
+ return;
+ }
+
+ const xhr = new XMLHttpRequest();
+
+ if (TrustedServers$1.contains(url)) {
+ xhr.withCredentials = true;
+ }
+
+ xhr.open(method, url, true);
+
+ if (defaultValue.defined(overrideMimeType) && defaultValue.defined(xhr.overrideMimeType)) {
+ xhr.overrideMimeType(overrideMimeType);
+ }
+
+ if (defaultValue.defined(headers)) {
+ for (const key in headers) {
+ if (headers.hasOwnProperty(key)) {
+ xhr.setRequestHeader(key, headers[key]);
+ }
+ }
+ }
+
+ if (defaultValue.defined(responseType)) {
+ xhr.responseType = responseType;
+ }
+
+ // While non-standard, file protocol always returns a status of 0 on success
+ let localFile = false;
+ if (typeof url === "string") {
+ localFile =
+ url.indexOf("file://") === 0 ||
+ (typeof window !== "undefined" && window.location.origin === "file://");
+ }
+
+ xhr.onload = function () {
+ if (
+ (xhr.status < 200 || xhr.status >= 300) &&
+ !(localFile && xhr.status === 0)
+ ) {
+ deferred.reject(
+ new RequestErrorEvent(
+ xhr.status,
+ xhr.response,
+ xhr.getAllResponseHeaders()
+ )
+ );
+ return;
+ }
+
+ const response = xhr.response;
+ const browserResponseType = xhr.responseType;
+
+ if (method === "HEAD" || method === "OPTIONS") {
+ const responseHeaderString = xhr.getAllResponseHeaders();
+ const splitHeaders = responseHeaderString.trim().split(/[\r\n]+/);
+
+ const responseHeaders = {};
+ splitHeaders.forEach(function (line) {
+ const parts = line.split(": ");
+ const header = parts.shift();
+ responseHeaders[header] = parts.join(": ");
+ });
+
+ deferred.resolve(responseHeaders);
+ return;
+ }
+
+ //All modern browsers will go into either the first or second if block or last else block.
+ //Other code paths support older browsers that either do not support the supplied responseType
+ //or do not support the xhr.response property.
+ if (xhr.status === 204) {
+ // accept no content
+ deferred.resolve();
+ } else if (
+ defaultValue.defined(response) &&
+ (!defaultValue.defined(responseType) || browserResponseType === responseType)
+ ) {
+ deferred.resolve(response);
+ } else if (responseType === "json" && typeof response === "string") {
+ try {
+ deferred.resolve(JSON.parse(response));
+ } catch (e) {
+ deferred.reject(e);
+ }
+ } else if (
+ (browserResponseType === "" || browserResponseType === "document") &&
+ defaultValue.defined(xhr.responseXML) &&
+ xhr.responseXML.hasChildNodes()
+ ) {
+ deferred.resolve(xhr.responseXML);
+ } else if (
+ (browserResponseType === "" || browserResponseType === "text") &&
+ defaultValue.defined(xhr.responseText)
+ ) {
+ deferred.resolve(xhr.responseText);
+ } else {
+ deferred.reject(
+ new RuntimeError.RuntimeError("Invalid XMLHttpRequest response type.")
+ );
+ }
+ };
+
+ xhr.onerror = function (e) {
+ deferred.reject(new RequestErrorEvent());
+ };
+
+ xhr.send(data);
+
+ return xhr;
+ };
+
+ Resource._Implementations.loadAndExecuteScript = function (
+ url,
+ functionName,
+ deferred
+ ) {
+ return loadAndExecuteScript(url).catch(function (e) {
+ deferred.reject(e);
+ });
+ };
+
+ /**
+ * The default implementations
+ *
+ * @private
+ */
+ Resource._DefaultImplementations = {};
+ Resource._DefaultImplementations.createImage =
+ Resource._Implementations.createImage;
+ Resource._DefaultImplementations.loadWithXhr =
+ Resource._Implementations.loadWithXhr;
+ Resource._DefaultImplementations.loadAndExecuteScript =
+ Resource._Implementations.loadAndExecuteScript;
+
+ /**
+ * A resource instance initialized to the current browser location
+ *
+ * @type {Resource}
+ * @constant
+ */
+ Resource.DEFAULT = Object.freeze(
+ new Resource({
+ url:
+ typeof document === "undefined"
+ ? ""
+ : document.location.href.split("?")[0],
+ })
+ );
+
+ /**
+ * Specifies Earth polar motion coordinates and the difference between UT1 and UTC.
+ * These Earth Orientation Parameters (EOP) are primarily used in the transformation from
+ * the International Celestial Reference Frame (ICRF) to the International Terrestrial
+ * Reference Frame (ITRF).
+ *
+ * @alias EarthOrientationParameters
+ * @constructor
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {Resource|String} [options.url] The URL from which to obtain EOP data. If neither this
+ * parameter nor options.data is specified, all EOP values are assumed
+ * to be 0.0. If options.data is specified, this parameter is
+ * ignored.
+ * @param {Object} [options.data] The actual EOP data. If neither this
+ * parameter nor options.data is specified, all EOP values are assumed
+ * to be 0.0.
+ * @param {Boolean} [options.addNewLeapSeconds=true] True if leap seconds that
+ * are specified in the EOP data but not in {@link JulianDate.leapSeconds}
+ * should be added to {@link JulianDate.leapSeconds}. False if
+ * new leap seconds should be handled correctly in the context
+ * of the EOP data but otherwise ignored.
+ *
+ * @example
+ * // An example EOP data file, EOP.json:
+ * {
+ * "columnNames" : ["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],
+ * "samples" : [
+ * "2011-07-01T00:00:00Z",55743.0,2.117957047295119e-7,2.111518721609984e-6,-0.2908948,-2.956e-4,3.393695767766752e-11,3.3452143996557983e-10,34.0,
+ * "2011-07-02T00:00:00Z",55744.0,2.193297093339541e-7,2.115460256837405e-6,-0.29065,-1.824e-4,-8.241832578862112e-11,5.623838700870617e-10,34.0,
+ * "2011-07-03T00:00:00Z",55745.0,2.262286080161428e-7,2.1191157519929706e-6,-0.2905572,1.9e-6,-3.490658503988659e-10,6.981317007977318e-10,34.0
+ * ]
+ * }
+ *
+ * @example
+ * // Loading the EOP data
+ * const eop = new Cesium.EarthOrientationParameters({ url : 'Data/EOP.json' });
+ * Cesium.Transforms.earthOrientationParameters = eop;
+ *
+ * @private
+ */
+ function EarthOrientationParameters(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ this._dates = undefined;
+ this._samples = undefined;
+
+ this._dateColumn = -1;
+ this._xPoleWanderRadiansColumn = -1;
+ this._yPoleWanderRadiansColumn = -1;
+ this._ut1MinusUtcSecondsColumn = -1;
+ this._xCelestialPoleOffsetRadiansColumn = -1;
+ this._yCelestialPoleOffsetRadiansColumn = -1;
+ this._taiMinusUtcSecondsColumn = -1;
+
+ this._columnCount = 0;
+ this._lastIndex = -1;
+
+ this._downloadPromise = undefined;
+ this._dataError = undefined;
+
+ this._addNewLeapSeconds = defaultValue.defaultValue(options.addNewLeapSeconds, true);
+
+ if (defaultValue.defined(options.data)) {
+ // Use supplied EOP data.
+ onDataReady(this, options.data);
+ } else if (defaultValue.defined(options.url)) {
+ const resource = Resource.createIfNeeded(options.url);
+
+ // Download EOP data.
+ const that = this;
+ this._downloadPromise = resource
+ .fetchJson()
+ .then(function (eopData) {
+ onDataReady(that, eopData);
+ })
+ .catch(function () {
+ that._dataError = `An error occurred while retrieving the EOP data from the URL ${resource.url}.`;
+ });
+ } else {
+ // Use all zeros for EOP data.
+ onDataReady(this, {
+ columnNames: [
+ "dateIso8601",
+ "modifiedJulianDateUtc",
+ "xPoleWanderRadians",
+ "yPoleWanderRadians",
+ "ut1MinusUtcSeconds",
+ "lengthOfDayCorrectionSeconds",
+ "xCelestialPoleOffsetRadians",
+ "yCelestialPoleOffsetRadians",
+ "taiMinusUtcSeconds",
+ ],
+ samples: [],
+ });
+ }
+ }
+
+ /**
+ * A default {@link EarthOrientationParameters} instance that returns zero for all EOP values.
+ */
+ EarthOrientationParameters.NONE = Object.freeze({
+ getPromiseToLoad: function () {
+ return Promise.resolve();
+ },
+ compute: function (date, result) {
+ if (!defaultValue.defined(result)) {
+ result = new EarthOrientationParametersSample(0.0, 0.0, 0.0, 0.0, 0.0);
+ } else {
+ result.xPoleWander = 0.0;
+ result.yPoleWander = 0.0;
+ result.xPoleOffset = 0.0;
+ result.yPoleOffset = 0.0;
+ result.ut1MinusUtc = 0.0;
+ }
+ return result;
+ },
+ });
+
+ /**
+ * Gets a promise that, when resolved, indicates that the EOP data has been loaded and is
+ * ready to use.
+ *
+ * @returns {Promise} The promise.
+ */
+ EarthOrientationParameters.prototype.getPromiseToLoad = function () {
+ return Promise.resolve(this._downloadPromise);
+ };
+
+ /**
+ * Computes the Earth Orientation Parameters (EOP) for a given date by interpolating.
+ * If the EOP data has not yet been download, this method returns undefined.
+ *
+ * @param {JulianDate} date The date for each to evaluate the EOP.
+ * @param {EarthOrientationParametersSample} [result] The instance to which to copy the result.
+ * If this parameter is undefined, a new instance is created and returned.
+ * @returns {EarthOrientationParametersSample} The EOP evaluated at the given date, or
+ * undefined if the data necessary to evaluate EOP at the date has not yet been
+ * downloaded.
+ *
+ * @exception {RuntimeError} The loaded EOP data has an error and cannot be used.
+ *
+ * @see EarthOrientationParameters#getPromiseToLoad
+ */
+ EarthOrientationParameters.prototype.compute = function (date, result) {
+ // We cannot compute until the samples are available.
+ if (!defaultValue.defined(this._samples)) {
+ if (defaultValue.defined(this._dataError)) {
+ throw new RuntimeError.RuntimeError(this._dataError);
+ }
+
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ result = new EarthOrientationParametersSample(0.0, 0.0, 0.0, 0.0, 0.0);
+ }
+
+ if (this._samples.length === 0) {
+ result.xPoleWander = 0.0;
+ result.yPoleWander = 0.0;
+ result.xPoleOffset = 0.0;
+ result.yPoleOffset = 0.0;
+ result.ut1MinusUtc = 0.0;
+ return result;
+ }
+
+ const dates = this._dates;
+ const lastIndex = this._lastIndex;
+
+ let before = 0;
+ let after = 0;
+ if (defaultValue.defined(lastIndex)) {
+ const previousIndexDate = dates[lastIndex];
+ const nextIndexDate = dates[lastIndex + 1];
+ const isAfterPrevious = JulianDate.lessThanOrEquals(
+ previousIndexDate,
+ date
+ );
+ const isAfterLastSample = !defaultValue.defined(nextIndexDate);
+ const isBeforeNext =
+ isAfterLastSample || JulianDate.greaterThanOrEquals(nextIndexDate, date);
+
+ if (isAfterPrevious && isBeforeNext) {
+ before = lastIndex;
+
+ if (!isAfterLastSample && nextIndexDate.equals(date)) {
+ ++before;
+ }
+ after = before + 1;
+
+ interpolate(this, dates, this._samples, date, before, after, result);
+ return result;
+ }
+ }
+
+ let index = binarySearch(dates, date, JulianDate.compare, this._dateColumn);
+ if (index >= 0) {
+ // If the next entry is the same date, use the later entry. This way, if two entries
+ // describe the same moment, one before a leap second and the other after, then we will use
+ // the post-leap second data.
+ if (index < dates.length - 1 && dates[index + 1].equals(date)) {
+ ++index;
+ }
+ before = index;
+ after = index;
+ } else {
+ after = ~index;
+ before = after - 1;
+
+ // Use the first entry if the date requested is before the beginning of the data.
+ if (before < 0) {
+ before = 0;
+ }
+ }
+
+ this._lastIndex = before;
+
+ interpolate(this, dates, this._samples, date, before, after, result);
+ return result;
+ };
+
+ function compareLeapSecondDates(leapSecond, dateToFind) {
+ return JulianDate.compare(leapSecond.julianDate, dateToFind);
+ }
+
+ function onDataReady(eop, eopData) {
+ if (!defaultValue.defined(eopData.columnNames)) {
+ eop._dataError =
+ "Error in loaded EOP data: The columnNames property is required.";
+ return;
+ }
+
+ if (!defaultValue.defined(eopData.samples)) {
+ eop._dataError =
+ "Error in loaded EOP data: The samples property is required.";
+ return;
+ }
+
+ const dateColumn = eopData.columnNames.indexOf("modifiedJulianDateUtc");
+ const xPoleWanderRadiansColumn = eopData.columnNames.indexOf(
+ "xPoleWanderRadians"
+ );
+ const yPoleWanderRadiansColumn = eopData.columnNames.indexOf(
+ "yPoleWanderRadians"
+ );
+ const ut1MinusUtcSecondsColumn = eopData.columnNames.indexOf(
+ "ut1MinusUtcSeconds"
+ );
+ const xCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf(
+ "xCelestialPoleOffsetRadians"
+ );
+ const yCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf(
+ "yCelestialPoleOffsetRadians"
+ );
+ const taiMinusUtcSecondsColumn = eopData.columnNames.indexOf(
+ "taiMinusUtcSeconds"
+ );
+
+ if (
+ dateColumn < 0 ||
+ xPoleWanderRadiansColumn < 0 ||
+ yPoleWanderRadiansColumn < 0 ||
+ ut1MinusUtcSecondsColumn < 0 ||
+ xCelestialPoleOffsetRadiansColumn < 0 ||
+ yCelestialPoleOffsetRadiansColumn < 0 ||
+ taiMinusUtcSecondsColumn < 0
+ ) {
+ eop._dataError =
+ "Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns";
+ return;
+ }
+
+ const samples = (eop._samples = eopData.samples);
+ const dates = (eop._dates = []);
+
+ eop._dateColumn = dateColumn;
+ eop._xPoleWanderRadiansColumn = xPoleWanderRadiansColumn;
+ eop._yPoleWanderRadiansColumn = yPoleWanderRadiansColumn;
+ eop._ut1MinusUtcSecondsColumn = ut1MinusUtcSecondsColumn;
+ eop._xCelestialPoleOffsetRadiansColumn = xCelestialPoleOffsetRadiansColumn;
+ eop._yCelestialPoleOffsetRadiansColumn = yCelestialPoleOffsetRadiansColumn;
+ eop._taiMinusUtcSecondsColumn = taiMinusUtcSecondsColumn;
+
+ eop._columnCount = eopData.columnNames.length;
+ eop._lastIndex = undefined;
+
+ let lastTaiMinusUtc;
+
+ const addNewLeapSeconds = eop._addNewLeapSeconds;
+
+ // Convert the ISO8601 dates to JulianDates.
+ for (let i = 0, len = samples.length; i < len; i += eop._columnCount) {
+ const mjd = samples[i + dateColumn];
+ const taiMinusUtc = samples[i + taiMinusUtcSecondsColumn];
+ const day = mjd + TimeConstants$1.MODIFIED_JULIAN_DATE_DIFFERENCE;
+ const date = new JulianDate(day, taiMinusUtc, TimeStandard$1.TAI);
+ dates.push(date);
+
+ if (addNewLeapSeconds) {
+ if (taiMinusUtc !== lastTaiMinusUtc && defaultValue.defined(lastTaiMinusUtc)) {
+ // We crossed a leap second boundary, so add the leap second
+ // if it does not already exist.
+ const leapSeconds = JulianDate.leapSeconds;
+ const leapSecondIndex = binarySearch(
+ leapSeconds,
+ date,
+ compareLeapSecondDates
+ );
+ if (leapSecondIndex < 0) {
+ const leapSecond = new LeapSecond(date, taiMinusUtc);
+ leapSeconds.splice(~leapSecondIndex, 0, leapSecond);
+ }
+ }
+ lastTaiMinusUtc = taiMinusUtc;
+ }
+ }
+ }
+
+ function fillResultFromIndex(eop, samples, index, columnCount, result) {
+ const start = index * columnCount;
+ result.xPoleWander = samples[start + eop._xPoleWanderRadiansColumn];
+ result.yPoleWander = samples[start + eop._yPoleWanderRadiansColumn];
+ result.xPoleOffset = samples[start + eop._xCelestialPoleOffsetRadiansColumn];
+ result.yPoleOffset = samples[start + eop._yCelestialPoleOffsetRadiansColumn];
+ result.ut1MinusUtc = samples[start + eop._ut1MinusUtcSecondsColumn];
+ }
+
+ function linearInterp(dx, y1, y2) {
+ return y1 + dx * (y2 - y1);
+ }
+
+ function interpolate(eop, dates, samples, date, before, after, result) {
+ const columnCount = eop._columnCount;
+
+ // First check the bounds on the EOP data
+ // If we are after the bounds of the data, return zeros.
+ // The 'before' index should never be less than zero.
+ if (after > dates.length - 1) {
+ result.xPoleWander = 0;
+ result.yPoleWander = 0;
+ result.xPoleOffset = 0;
+ result.yPoleOffset = 0;
+ result.ut1MinusUtc = 0;
+ return result;
+ }
+
+ const beforeDate = dates[before];
+ const afterDate = dates[after];
+ if (beforeDate.equals(afterDate) || date.equals(beforeDate)) {
+ fillResultFromIndex(eop, samples, before, columnCount, result);
+ return result;
+ } else if (date.equals(afterDate)) {
+ fillResultFromIndex(eop, samples, after, columnCount, result);
+ return result;
+ }
+
+ const factor =
+ JulianDate.secondsDifference(date, beforeDate) /
+ JulianDate.secondsDifference(afterDate, beforeDate);
+
+ const startBefore = before * columnCount;
+ const startAfter = after * columnCount;
+
+ // Handle UT1 leap second edge case
+ let beforeUt1MinusUtc = samples[startBefore + eop._ut1MinusUtcSecondsColumn];
+ let afterUt1MinusUtc = samples[startAfter + eop._ut1MinusUtcSecondsColumn];
+
+ const offsetDifference = afterUt1MinusUtc - beforeUt1MinusUtc;
+ if (offsetDifference > 0.5 || offsetDifference < -0.5) {
+ // The absolute difference between the values is more than 0.5, so we may have
+ // crossed a leap second. Check if this is the case and, if so, adjust the
+ // afterValue to account for the leap second. This way, our interpolation will
+ // produce reasonable results.
+ const beforeTaiMinusUtc =
+ samples[startBefore + eop._taiMinusUtcSecondsColumn];
+ const afterTaiMinusUtc =
+ samples[startAfter + eop._taiMinusUtcSecondsColumn];
+ if (beforeTaiMinusUtc !== afterTaiMinusUtc) {
+ if (afterDate.equals(date)) {
+ // If we are at the end of the leap second interval, take the second value
+ // Otherwise, the interpolation below will yield the wrong side of the
+ // discontinuity
+ // At the end of the leap second, we need to start accounting for the jump
+ beforeUt1MinusUtc = afterUt1MinusUtc;
+ } else {
+ // Otherwise, remove the leap second so that the interpolation is correct
+ afterUt1MinusUtc -= afterTaiMinusUtc - beforeTaiMinusUtc;
+ }
+ }
+ }
+
+ result.xPoleWander = linearInterp(
+ factor,
+ samples[startBefore + eop._xPoleWanderRadiansColumn],
+ samples[startAfter + eop._xPoleWanderRadiansColumn]
+ );
+ result.yPoleWander = linearInterp(
+ factor,
+ samples[startBefore + eop._yPoleWanderRadiansColumn],
+ samples[startAfter + eop._yPoleWanderRadiansColumn]
+ );
+ result.xPoleOffset = linearInterp(
+ factor,
+ samples[startBefore + eop._xCelestialPoleOffsetRadiansColumn],
+ samples[startAfter + eop._xCelestialPoleOffsetRadiansColumn]
+ );
+ result.yPoleOffset = linearInterp(
+ factor,
+ samples[startBefore + eop._yCelestialPoleOffsetRadiansColumn],
+ samples[startAfter + eop._yCelestialPoleOffsetRadiansColumn]
+ );
+ result.ut1MinusUtc = linearInterp(
+ factor,
+ beforeUt1MinusUtc,
+ afterUt1MinusUtc
+ );
+ return result;
+ }
+
+ /**
+ * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the
+ * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about
+ * the positive x axis.
+ * @alias HeadingPitchRoll
+ * @constructor
+ *
+ * @param {Number} [heading=0.0] The heading component in radians.
+ * @param {Number} [pitch=0.0] The pitch component in radians.
+ * @param {Number} [roll=0.0] The roll component in radians.
+ */
+ function HeadingPitchRoll(heading, pitch, roll) {
+ /**
+ * Gets or sets the heading.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.heading = defaultValue.defaultValue(heading, 0.0);
+ /**
+ * Gets or sets the pitch.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.pitch = defaultValue.defaultValue(pitch, 0.0);
+ /**
+ * Gets or sets the roll.
+ * @type {Number}
+ * @default 0.0
+ */
+ this.roll = defaultValue.defaultValue(roll, 0.0);
+ }
+
+ /**
+ * Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )
+ *
+ * @param {Quaternion} quaternion The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.
+ * @param {HeadingPitchRoll} [result] The object in which to store the result. If not provided, a new instance is created and returned.
+ * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
+ */
+ HeadingPitchRoll.fromQuaternion = function (quaternion, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(quaternion)) {
+ throw new Check.DeveloperError("quaternion is required");
+ }
+ //>>includeEnd('debug');
+ if (!defaultValue.defined(result)) {
+ result = new HeadingPitchRoll();
+ }
+ const test = 2 * (quaternion.w * quaternion.y - quaternion.z * quaternion.x);
+ const denominatorRoll =
+ 1 - 2 * (quaternion.x * quaternion.x + quaternion.y * quaternion.y);
+ const numeratorRoll =
+ 2 * (quaternion.w * quaternion.x + quaternion.y * quaternion.z);
+ const denominatorHeading =
+ 1 - 2 * (quaternion.y * quaternion.y + quaternion.z * quaternion.z);
+ const numeratorHeading =
+ 2 * (quaternion.w * quaternion.z + quaternion.x * quaternion.y);
+ result.heading = -Math.atan2(numeratorHeading, denominatorHeading);
+ result.roll = Math.atan2(numeratorRoll, denominatorRoll);
+ result.pitch = -Math$1.CesiumMath.asinClamped(test);
+ return result;
+ };
+
+ /**
+ * Returns a new HeadingPitchRoll instance from angles given in degrees.
+ *
+ * @param {Number} heading the heading in degrees
+ * @param {Number} pitch the pitch in degrees
+ * @param {Number} roll the heading in degrees
+ * @param {HeadingPitchRoll} [result] The object in which to store the result. If not provided, a new instance is created and returned.
+ * @returns {HeadingPitchRoll} A new HeadingPitchRoll instance
+ */
+ HeadingPitchRoll.fromDegrees = function (heading, pitch, roll, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(heading)) {
+ throw new Check.DeveloperError("heading is required");
+ }
+ if (!defaultValue.defined(pitch)) {
+ throw new Check.DeveloperError("pitch is required");
+ }
+ if (!defaultValue.defined(roll)) {
+ throw new Check.DeveloperError("roll is required");
+ }
+ //>>includeEnd('debug');
+ if (!defaultValue.defined(result)) {
+ result = new HeadingPitchRoll();
+ }
+ result.heading = heading * Math$1.CesiumMath.RADIANS_PER_DEGREE;
+ result.pitch = pitch * Math$1.CesiumMath.RADIANS_PER_DEGREE;
+ result.roll = roll * Math$1.CesiumMath.RADIANS_PER_DEGREE;
+ return result;
+ };
+
+ /**
+ * Duplicates a HeadingPitchRoll instance.
+ *
+ * @param {HeadingPitchRoll} headingPitchRoll The HeadingPitchRoll to duplicate.
+ * @param {HeadingPitchRoll} [result] The object onto which to store the result.
+ * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)
+ */
+ HeadingPitchRoll.clone = function (headingPitchRoll, result) {
+ if (!defaultValue.defined(headingPitchRoll)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ return new HeadingPitchRoll(
+ headingPitchRoll.heading,
+ headingPitchRoll.pitch,
+ headingPitchRoll.roll
+ );
+ }
+ result.heading = headingPitchRoll.heading;
+ result.pitch = headingPitchRoll.pitch;
+ result.roll = headingPitchRoll.roll;
+ return result;
+ };
+
+ /**
+ * Compares the provided HeadingPitchRolls componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.
+ * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.
+ * @returns {Boolean} true
if left and right are equal, false
otherwise.
+ */
+ HeadingPitchRoll.equals = function (left, right) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ left.heading === right.heading &&
+ left.pitch === right.pitch &&
+ left.roll === right.roll)
+ );
+ };
+
+ /**
+ * Compares the provided HeadingPitchRolls componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.
+ * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.
+ * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.
+ */
+ HeadingPitchRoll.equalsEpsilon = function (
+ left,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ return (
+ left === right ||
+ (defaultValue.defined(left) &&
+ defaultValue.defined(right) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.heading,
+ right.heading,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.pitch,
+ right.pitch,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) &&
+ Math$1.CesiumMath.equalsEpsilon(
+ left.roll,
+ right.roll,
+ relativeEpsilon,
+ absoluteEpsilon
+ ))
+ );
+ };
+
+ /**
+ * Duplicates this HeadingPitchRoll instance.
+ *
+ * @param {HeadingPitchRoll} [result] The object onto which to store the result.
+ * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.
+ */
+ HeadingPitchRoll.prototype.clone = function (result) {
+ return HeadingPitchRoll.clone(this, result);
+ };
+
+ /**
+ * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
+ * true
if they are equal, false
otherwise.
+ *
+ * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.
+ * @returns {Boolean} true
if they are equal, false
otherwise.
+ */
+ HeadingPitchRoll.prototype.equals = function (right) {
+ return HeadingPitchRoll.equals(this, right);
+ };
+
+ /**
+ * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns
+ * true
if they pass an absolute or relative tolerance test,
+ * false
otherwise.
+ *
+ * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.
+ * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.
+ * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.
+ * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.
+ */
+ HeadingPitchRoll.prototype.equalsEpsilon = function (
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) {
+ return HeadingPitchRoll.equalsEpsilon(
+ this,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+ };
+
+ /**
+ * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.
+ *
+ * @returns {String} A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.
+ */
+ HeadingPitchRoll.prototype.toString = function () {
+ return `(${this.heading}, ${this.pitch}, ${this.roll})`;
+ };
+
+ /*global CESIUM_BASE_URL,define,require*/
+
+ const cesiumScriptRegex = /((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;
+ function getBaseUrlFromCesiumScript() {
+ const scripts = document.getElementsByTagName("script");
+ for (let i = 0, len = scripts.length; i < len; ++i) {
+ const src = scripts[i].getAttribute("src");
+ const result = cesiumScriptRegex.exec(src);
+ if (result !== null) {
+ return result[1];
+ }
+ }
+ return undefined;
+ }
+
+ let a;
+ function tryMakeAbsolute(url) {
+ if (typeof document === "undefined") {
+ //Node.js and Web Workers. In both cases, the URL will already be absolute.
+ return url;
+ }
+
+ if (!defaultValue.defined(a)) {
+ a = document.createElement("a");
+ }
+ a.href = url;
+
+ // IE only absolutizes href on get, not set
+ // eslint-disable-next-line no-self-assign
+ a.href = a.href;
+ return a.href;
+ }
+
+ let baseResource;
+ function getCesiumBaseUrl() {
+ if (defaultValue.defined(baseResource)) {
+ return baseResource;
+ }
+
+ let baseUrlString;
+ if (typeof CESIUM_BASE_URL !== "undefined") {
+ baseUrlString = CESIUM_BASE_URL;
+ } else if (
+ typeof define === "object" &&
+ defaultValue.defined(define.amd) &&
+ !define.amd.toUrlUndefined &&
+ defaultValue.defined(require.toUrl)
+ ) {
+ baseUrlString = getAbsoluteUri(
+ "..",
+ buildModuleUrl("Core/buildModuleUrl.js")
+ );
+ } else {
+ baseUrlString = getBaseUrlFromCesiumScript();
+ }
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(baseUrlString)) {
+ throw new Check.DeveloperError(
+ "Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL."
+ );
+ }
+ //>>includeEnd('debug');
+
+ baseResource = new Resource({
+ url: tryMakeAbsolute(baseUrlString),
+ });
+ baseResource.appendForwardSlash();
+
+ return baseResource;
+ }
+
+ function buildModuleUrlFromRequireToUrl(moduleID) {
+ //moduleID will be non-relative, so require it relative to this module, in Core.
+ return tryMakeAbsolute(require.toUrl(`../${moduleID}`));
+ }
+
+ function buildModuleUrlFromBaseUrl(moduleID) {
+ const resource = getCesiumBaseUrl().getDerivedResource({
+ url: moduleID,
+ });
+ return resource.url;
+ }
+
+ let implementation;
+
+ /**
+ * Given a relative URL under the Cesium base URL, returns an absolute URL.
+ * @function
+ *
+ * @param {String} relativeUrl The relative path.
+ * @returns {String} The absolutely URL representation of the provided path.
+ *
+ * @example
+ * const viewer = new Cesium.Viewer("cesiumContainer", {
+ * imageryProvider: new Cesium.TileMapServiceImageryProvider({
+ * url: Cesium.buildModuleUrl("Assets/Textures/NaturalEarthII"),
+ * }),
+ * baseLayerPicker: false,
+ * });
+ */
+ function buildModuleUrl(relativeUrl) {
+ if (!defaultValue.defined(implementation)) {
+ //select implementation
+ if (
+ typeof define === "object" &&
+ defaultValue.defined(define.amd) &&
+ !define.amd.toUrlUndefined &&
+ defaultValue.defined(require.toUrl)
+ ) {
+ implementation = buildModuleUrlFromRequireToUrl;
+ } else {
+ implementation = buildModuleUrlFromBaseUrl;
+ }
+ }
+
+ const url = implementation(relativeUrl);
+ return url;
+ }
+
+ // exposed for testing
+ buildModuleUrl._cesiumScriptRegex = cesiumScriptRegex;
+ buildModuleUrl._buildModuleUrlFromBaseUrl = buildModuleUrlFromBaseUrl;
+ buildModuleUrl._clearBaseResource = function () {
+ baseResource = undefined;
+ };
+
+ /**
+ * Sets the base URL for resolving modules.
+ * @param {String} value The new base URL.
+ */
+ buildModuleUrl.setBaseUrl = function (value) {
+ baseResource = Resource.DEFAULT.getDerivedResource({
+ url: value,
+ });
+ };
+
+ /**
+ * Gets the base URL for resolving modules.
+ *
+ * @function
+ * @returns {String} The configured base URL
+ */
+ buildModuleUrl.getCesiumBaseUrl = getCesiumBaseUrl;
+
+ /**
+ * An IAU 2006 XYS value sampled at a particular time.
+ *
+ * @alias Iau2006XysSample
+ * @constructor
+ *
+ * @param {Number} x The X value.
+ * @param {Number} y The Y value.
+ * @param {Number} s The S value.
+ *
+ * @private
+ */
+ function Iau2006XysSample(x, y, s) {
+ /**
+ * The X value.
+ * @type {Number}
+ */
+ this.x = x;
+
+ /**
+ * The Y value.
+ * @type {Number}
+ */
+ this.y = y;
+
+ /**
+ * The S value.
+ * @type {Number}
+ */
+ this.s = s;
+ }
+
+ /**
+ * A set of IAU2006 XYS data that is used to evaluate the transformation between the International
+ * Celestial Reference Frame (ICRF) and the International Terrestrial Reference Frame (ITRF).
+ *
+ * @alias Iau2006XysData
+ * @constructor
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {Resource|String} [options.xysFileUrlTemplate='Assets/IAU2006_XYS/IAU2006_XYS_{0}.json'] A template URL for obtaining the XYS data. In the template,
+ * `{0}` will be replaced with the file index.
+ * @param {Number} [options.interpolationOrder=9] The order of interpolation to perform on the XYS data.
+ * @param {Number} [options.sampleZeroJulianEphemerisDate=2442396.5] The Julian ephemeris date (JED) of the
+ * first XYS sample.
+ * @param {Number} [options.stepSizeDays=1.0] The step size, in days, between successive XYS samples.
+ * @param {Number} [options.samplesPerXysFile=1000] The number of samples in each XYS file.
+ * @param {Number} [options.totalSamples=27426] The total number of samples in all XYS files.
+ *
+ * @private
+ */
+ function Iau2006XysData(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ this._xysFileUrlTemplate = Resource.createIfNeeded(
+ options.xysFileUrlTemplate
+ );
+ this._interpolationOrder = defaultValue.defaultValue(options.interpolationOrder, 9);
+ this._sampleZeroJulianEphemerisDate = defaultValue.defaultValue(
+ options.sampleZeroJulianEphemerisDate,
+ 2442396.5
+ );
+ this._sampleZeroDateTT = new JulianDate(
+ this._sampleZeroJulianEphemerisDate,
+ 0.0,
+ TimeStandard$1.TAI
+ );
+ this._stepSizeDays = defaultValue.defaultValue(options.stepSizeDays, 1.0);
+ this._samplesPerXysFile = defaultValue.defaultValue(options.samplesPerXysFile, 1000);
+ this._totalSamples = defaultValue.defaultValue(options.totalSamples, 27426);
+ this._samples = new Array(this._totalSamples * 3);
+ this._chunkDownloadsInProgress = [];
+
+ const order = this._interpolationOrder;
+
+ // Compute denominators and X values for interpolation.
+ const denom = (this._denominators = new Array(order + 1));
+ const xTable = (this._xTable = new Array(order + 1));
+
+ const stepN = Math.pow(this._stepSizeDays, order);
+
+ for (let i = 0; i <= order; ++i) {
+ denom[i] = stepN;
+ xTable[i] = i * this._stepSizeDays;
+
+ for (let j = 0; j <= order; ++j) {
+ if (j !== i) {
+ denom[i] *= i - j;
+ }
+ }
+
+ denom[i] = 1.0 / denom[i];
+ }
+
+ // Allocate scratch arrays for interpolation.
+ this._work = new Array(order + 1);
+ this._coef = new Array(order + 1);
+ }
+
+ const julianDateScratch = new JulianDate(0, 0.0, TimeStandard$1.TAI);
+
+ function getDaysSinceEpoch(xys, dayTT, secondTT) {
+ const dateTT = julianDateScratch;
+ dateTT.dayNumber = dayTT;
+ dateTT.secondsOfDay = secondTT;
+ return JulianDate.daysDifference(dateTT, xys._sampleZeroDateTT);
+ }
+
+ /**
+ * Preloads XYS data for a specified date range.
+ *
+ * @param {Number} startDayTT The Julian day number of the beginning of the interval to preload, expressed in
+ * the Terrestrial Time (TT) time standard.
+ * @param {Number} startSecondTT The seconds past noon of the beginning of the interval to preload, expressed in
+ * the Terrestrial Time (TT) time standard.
+ * @param {Number} stopDayTT The Julian day number of the end of the interval to preload, expressed in
+ * the Terrestrial Time (TT) time standard.
+ * @param {Number} stopSecondTT The seconds past noon of the end of the interval to preload, expressed in
+ * the Terrestrial Time (TT) time standard.
+ * @returns {Promise} A promise that, when resolved, indicates that the requested interval has been
+ * preloaded.
+ */
+ Iau2006XysData.prototype.preload = function (
+ startDayTT,
+ startSecondTT,
+ stopDayTT,
+ stopSecondTT
+ ) {
+ const startDaysSinceEpoch = getDaysSinceEpoch(
+ this,
+ startDayTT,
+ startSecondTT
+ );
+ const stopDaysSinceEpoch = getDaysSinceEpoch(this, stopDayTT, stopSecondTT);
+
+ let startIndex =
+ (startDaysSinceEpoch / this._stepSizeDays - this._interpolationOrder / 2) |
+ 0;
+ if (startIndex < 0) {
+ startIndex = 0;
+ }
+
+ let stopIndex =
+ (stopDaysSinceEpoch / this._stepSizeDays - this._interpolationOrder / 2) |
+ (0 + this._interpolationOrder);
+ if (stopIndex >= this._totalSamples) {
+ stopIndex = this._totalSamples - 1;
+ }
+
+ const startChunk = (startIndex / this._samplesPerXysFile) | 0;
+ const stopChunk = (stopIndex / this._samplesPerXysFile) | 0;
+
+ const promises = [];
+ for (let i = startChunk; i <= stopChunk; ++i) {
+ promises.push(requestXysChunk(this, i));
+ }
+
+ return Promise.all(promises);
+ };
+
+ /**
+ * Computes the XYS values for a given date by interpolating. If the required data is not yet downloaded,
+ * this method will return undefined.
+ *
+ * @param {Number} dayTT The Julian day number for which to compute the XYS value, expressed in
+ * the Terrestrial Time (TT) time standard.
+ * @param {Number} secondTT The seconds past noon of the date for which to compute the XYS value, expressed in
+ * the Terrestrial Time (TT) time standard.
+ * @param {Iau2006XysSample} [result] The instance to which to copy the interpolated result. If this parameter
+ * is undefined, a new instance is allocated and returned.
+ * @returns {Iau2006XysSample} The interpolated XYS values, or undefined if the required data for this
+ * computation has not yet been downloaded.
+ *
+ * @see Iau2006XysData#preload
+ */
+ Iau2006XysData.prototype.computeXysRadians = function (
+ dayTT,
+ secondTT,
+ result
+ ) {
+ const daysSinceEpoch = getDaysSinceEpoch(this, dayTT, secondTT);
+ if (daysSinceEpoch < 0.0) {
+ // Can't evaluate prior to the epoch of the data.
+ return undefined;
+ }
+
+ const centerIndex = (daysSinceEpoch / this._stepSizeDays) | 0;
+ if (centerIndex >= this._totalSamples) {
+ // Can't evaluate after the last sample in the data.
+ return undefined;
+ }
+
+ const degree = this._interpolationOrder;
+
+ let firstIndex = centerIndex - ((degree / 2) | 0);
+ if (firstIndex < 0) {
+ firstIndex = 0;
+ }
+ let lastIndex = firstIndex + degree;
+ if (lastIndex >= this._totalSamples) {
+ lastIndex = this._totalSamples - 1;
+ firstIndex = lastIndex - degree;
+ if (firstIndex < 0) {
+ firstIndex = 0;
+ }
+ }
+
+ // Are all the samples we need present?
+ // We can assume so if the first and last are present
+ let isDataMissing = false;
+ const samples = this._samples;
+ if (!defaultValue.defined(samples[firstIndex * 3])) {
+ requestXysChunk(this, (firstIndex / this._samplesPerXysFile) | 0);
+ isDataMissing = true;
+ }
+
+ if (!defaultValue.defined(samples[lastIndex * 3])) {
+ requestXysChunk(this, (lastIndex / this._samplesPerXysFile) | 0);
+ isDataMissing = true;
+ }
+
+ if (isDataMissing) {
+ return undefined;
+ }
+
+ if (!defaultValue.defined(result)) {
+ result = new Iau2006XysSample(0.0, 0.0, 0.0);
+ } else {
+ result.x = 0.0;
+ result.y = 0.0;
+ result.s = 0.0;
+ }
+
+ const x = daysSinceEpoch - firstIndex * this._stepSizeDays;
+
+ const work = this._work;
+ const denom = this._denominators;
+ const coef = this._coef;
+ const xTable = this._xTable;
+
+ let i, j;
+ for (i = 0; i <= degree; ++i) {
+ work[i] = x - xTable[i];
+ }
+
+ for (i = 0; i <= degree; ++i) {
+ coef[i] = 1.0;
+
+ for (j = 0; j <= degree; ++j) {
+ if (j !== i) {
+ coef[i] *= work[j];
+ }
+ }
+
+ coef[i] *= denom[i];
+
+ let sampleIndex = (firstIndex + i) * 3;
+ result.x += coef[i] * samples[sampleIndex++];
+ result.y += coef[i] * samples[sampleIndex++];
+ result.s += coef[i] * samples[sampleIndex];
+ }
+
+ return result;
+ };
+
+ function requestXysChunk(xysData, chunkIndex) {
+ if (xysData._chunkDownloadsInProgress[chunkIndex]) {
+ // Chunk has already been requested.
+ return xysData._chunkDownloadsInProgress[chunkIndex];
+ }
+
+ let chunkUrl;
+ const xysFileUrlTemplate = xysData._xysFileUrlTemplate;
+ if (defaultValue.defined(xysFileUrlTemplate)) {
+ chunkUrl = xysFileUrlTemplate.getDerivedResource({
+ templateValues: {
+ 0: chunkIndex,
+ },
+ });
+ } else {
+ chunkUrl = new Resource({
+ url: buildModuleUrl(`Assets/IAU2006_XYS/IAU2006_XYS_${chunkIndex}.json`),
+ });
+ }
+
+ const promise = chunkUrl.fetchJson().then(function (chunk) {
+ xysData._chunkDownloadsInProgress[chunkIndex] = false;
+
+ const samples = xysData._samples;
+ const newSamples = chunk.samples;
+ const startIndex = chunkIndex * xysData._samplesPerXysFile * 3;
+
+ for (let i = 0, len = newSamples.length; i < len; ++i) {
+ samples[startIndex + i] = newSamples[i];
+ }
+ });
+ xysData._chunkDownloadsInProgress[chunkIndex] = promise;
+
+ return promise;
+ }
+
+ /**
+ * Contains functions for transforming positions to various reference frames.
+ *
+ * @namespace Transforms
+ */
+ const Transforms = {};
+
+ const vectorProductLocalFrame = {
+ up: {
+ south: "east",
+ north: "west",
+ west: "south",
+ east: "north",
+ },
+ down: {
+ south: "west",
+ north: "east",
+ west: "north",
+ east: "south",
+ },
+ south: {
+ up: "west",
+ down: "east",
+ west: "down",
+ east: "up",
+ },
+ north: {
+ up: "east",
+ down: "west",
+ west: "up",
+ east: "down",
+ },
+ west: {
+ up: "north",
+ down: "south",
+ north: "down",
+ south: "up",
+ },
+ east: {
+ up: "south",
+ down: "north",
+ north: "up",
+ south: "down",
+ },
+ };
+
+ const degeneratePositionLocalFrame = {
+ north: [-1, 0, 0],
+ east: [0, 1, 0],
+ up: [0, 0, 1],
+ south: [1, 0, 0],
+ west: [0, -1, 0],
+ down: [0, 0, -1],
+ };
+
+ const localFrameToFixedFrameCache = {};
+
+ const scratchCalculateCartesian = {
+ east: new Matrix3.Cartesian3(),
+ north: new Matrix3.Cartesian3(),
+ up: new Matrix3.Cartesian3(),
+ west: new Matrix3.Cartesian3(),
+ south: new Matrix3.Cartesian3(),
+ down: new Matrix3.Cartesian3(),
+ };
+ let scratchFirstCartesian = new Matrix3.Cartesian3();
+ let scratchSecondCartesian = new Matrix3.Cartesian3();
+ let scratchThirdCartesian = new Matrix3.Cartesian3();
+ /**
+ * Generates a function that computes a 4x4 transformation matrix from a reference frame
+ * centered at the provided origin to the provided ellipsoid's fixed reference frame.
+ * @param {String} firstAxis name of the first axis of the local reference frame. Must be
+ * 'east', 'north', 'up', 'west', 'south' or 'down'.
+ * @param {String} secondAxis name of the second axis of the local reference frame. Must be
+ * 'east', 'north', 'up', 'west', 'south' or 'down'.
+ * @return {Transforms.LocalFrameToFixedFrame} The function that will computes a
+ * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,
+ */
+ Transforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) {
+ if (
+ !vectorProductLocalFrame.hasOwnProperty(firstAxis) ||
+ !vectorProductLocalFrame[firstAxis].hasOwnProperty(secondAxis)
+ ) {
+ throw new Check.DeveloperError(
+ "firstAxis and secondAxis must be east, north, up, west, south or down."
+ );
+ }
+ const thirdAxis = vectorProductLocalFrame[firstAxis][secondAxis];
+
+ /**
+ * Computes a 4x4 transformation matrix from a reference frame
+ * centered at the provided origin to the provided ellipsoid's fixed reference frame.
+ * @callback Transforms.LocalFrameToFixedFrame
+ * @param {Cartesian3} origin The center point of the local reference frame.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.
+ * @param {Matrix4} [result] The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.
+ */
+ let resultat;
+ const hashAxis = firstAxis + secondAxis;
+ if (defaultValue.defined(localFrameToFixedFrameCache[hashAxis])) {
+ resultat = localFrameToFixedFrameCache[hashAxis];
+ } else {
+ resultat = function (origin, ellipsoid, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(origin)) {
+ throw new Check.DeveloperError("origin is required.");
+ }
+ //>>includeEnd('debug');
+ if (!defaultValue.defined(result)) {
+ result = new Matrix2.Matrix4();
+ }
+ if (
+ Matrix3.Cartesian3.equalsEpsilon(origin, Matrix3.Cartesian3.ZERO, Math$1.CesiumMath.EPSILON14)
+ ) {
+ // If x, y, and z are zero, use the degenerate local frame, which is a special case
+ Matrix3.Cartesian3.unpack(
+ degeneratePositionLocalFrame[firstAxis],
+ 0,
+ scratchFirstCartesian
+ );
+ Matrix3.Cartesian3.unpack(
+ degeneratePositionLocalFrame[secondAxis],
+ 0,
+ scratchSecondCartesian
+ );
+ Matrix3.Cartesian3.unpack(
+ degeneratePositionLocalFrame[thirdAxis],
+ 0,
+ scratchThirdCartesian
+ );
+ } else if (
+ Math$1.CesiumMath.equalsEpsilon(origin.x, 0.0, Math$1.CesiumMath.EPSILON14) &&
+ Math$1.CesiumMath.equalsEpsilon(origin.y, 0.0, Math$1.CesiumMath.EPSILON14)
+ ) {
+ // If x and y are zero, assume origin is at a pole, which is a special case.
+ const sign = Math$1.CesiumMath.sign(origin.z);
+
+ Matrix3.Cartesian3.unpack(
+ degeneratePositionLocalFrame[firstAxis],
+ 0,
+ scratchFirstCartesian
+ );
+ if (firstAxis !== "east" && firstAxis !== "west") {
+ Matrix3.Cartesian3.multiplyByScalar(
+ scratchFirstCartesian,
+ sign,
+ scratchFirstCartesian
+ );
+ }
+
+ Matrix3.Cartesian3.unpack(
+ degeneratePositionLocalFrame[secondAxis],
+ 0,
+ scratchSecondCartesian
+ );
+ if (secondAxis !== "east" && secondAxis !== "west") {
+ Matrix3.Cartesian3.multiplyByScalar(
+ scratchSecondCartesian,
+ sign,
+ scratchSecondCartesian
+ );
+ }
+
+ Matrix3.Cartesian3.unpack(
+ degeneratePositionLocalFrame[thirdAxis],
+ 0,
+ scratchThirdCartesian
+ );
+ if (thirdAxis !== "east" && thirdAxis !== "west") {
+ Matrix3.Cartesian3.multiplyByScalar(
+ scratchThirdCartesian,
+ sign,
+ scratchThirdCartesian
+ );
+ }
+ } else {
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+ ellipsoid.geodeticSurfaceNormal(origin, scratchCalculateCartesian.up);
+
+ const up = scratchCalculateCartesian.up;
+ const east = scratchCalculateCartesian.east;
+ east.x = -origin.y;
+ east.y = origin.x;
+ east.z = 0.0;
+ Matrix3.Cartesian3.normalize(east, scratchCalculateCartesian.east);
+ Matrix3.Cartesian3.cross(up, east, scratchCalculateCartesian.north);
+
+ Matrix3.Cartesian3.multiplyByScalar(
+ scratchCalculateCartesian.up,
+ -1,
+ scratchCalculateCartesian.down
+ );
+ Matrix3.Cartesian3.multiplyByScalar(
+ scratchCalculateCartesian.east,
+ -1,
+ scratchCalculateCartesian.west
+ );
+ Matrix3.Cartesian3.multiplyByScalar(
+ scratchCalculateCartesian.north,
+ -1,
+ scratchCalculateCartesian.south
+ );
+
+ scratchFirstCartesian = scratchCalculateCartesian[firstAxis];
+ scratchSecondCartesian = scratchCalculateCartesian[secondAxis];
+ scratchThirdCartesian = scratchCalculateCartesian[thirdAxis];
+ }
+ result[0] = scratchFirstCartesian.x;
+ result[1] = scratchFirstCartesian.y;
+ result[2] = scratchFirstCartesian.z;
+ result[3] = 0.0;
+ result[4] = scratchSecondCartesian.x;
+ result[5] = scratchSecondCartesian.y;
+ result[6] = scratchSecondCartesian.z;
+ result[7] = 0.0;
+ result[8] = scratchThirdCartesian.x;
+ result[9] = scratchThirdCartesian.y;
+ result[10] = scratchThirdCartesian.z;
+ result[11] = 0.0;
+ result[12] = origin.x;
+ result[13] = origin.y;
+ result[14] = origin.z;
+ result[15] = 1.0;
+ return result;
+ };
+ localFrameToFixedFrameCache[hashAxis] = resultat;
+ }
+ return resultat;
+ };
+
+ /**
+ * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes
+ * centered at the provided origin to the provided ellipsoid's fixed reference frame.
+ * The local axes are defined as:
+ *
+ * - The
x
axis points in the local east direction.
+ * - The
y
axis points in the local north direction.
+ * - The
z
axis points in the direction of the ellipsoid surface normal which passes through the position.
+ *
+ *
+ * @function
+ * @param {Cartesian3} origin The center point of the local reference frame.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.
+ * @param {Matrix4} [result] The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.
+ *
+ * @example
+ * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.
+ * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
+ * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);
+ */
+ Transforms.eastNorthUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator(
+ "east",
+ "north"
+ );
+
+ /**
+ * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes
+ * centered at the provided origin to the provided ellipsoid's fixed reference frame.
+ * The local axes are defined as:
+ *
+ * - The
x
axis points in the local north direction.
+ * - The
y
axis points in the local east direction.
+ * - The
z
axis points in the opposite direction of the ellipsoid surface normal which passes through the position.
+ *
+ *
+ * @function
+ * @param {Cartesian3} origin The center point of the local reference frame.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.
+ * @param {Matrix4} [result] The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.
+ *
+ * @example
+ * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.
+ * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
+ * const transform = Cesium.Transforms.northEastDownToFixedFrame(center);
+ */
+ Transforms.northEastDownToFixedFrame = Transforms.localFrameToFixedFrameGenerator(
+ "north",
+ "east"
+ );
+
+ /**
+ * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes
+ * centered at the provided origin to the provided ellipsoid's fixed reference frame.
+ * The local axes are defined as:
+ *
+ * - The
x
axis points in the local north direction.
+ * - The
y
axis points in the direction of the ellipsoid surface normal which passes through the position.
+ * - The
z
axis points in the local east direction.
+ *
+ *
+ * @function
+ * @param {Cartesian3} origin The center point of the local reference frame.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.
+ * @param {Matrix4} [result] The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.
+ *
+ * @example
+ * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.
+ * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
+ * const transform = Cesium.Transforms.northUpEastToFixedFrame(center);
+ */
+ Transforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator(
+ "north",
+ "up"
+ );
+
+ /**
+ * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes
+ * centered at the provided origin to the provided ellipsoid's fixed reference frame.
+ * The local axes are defined as:
+ *
+ * - The
x
axis points in the local north direction.
+ * - The
y
axis points in the local west direction.
+ * - The
z
axis points in the direction of the ellipsoid surface normal which passes through the position.
+ *
+ *
+ * @function
+ * @param {Cartesian3} origin The center point of the local reference frame.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.
+ * @param {Matrix4} [result] The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.
+ *
+ * @example
+ * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.
+ * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
+ * const transform = Cesium.Transforms.northWestUpToFixedFrame(center);
+ */
+ Transforms.northWestUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator(
+ "north",
+ "west"
+ );
+
+ const scratchHPRQuaternion = new Quaternion();
+ const scratchScale = new Matrix3.Cartesian3(1.0, 1.0, 1.0);
+ const scratchHPRMatrix4 = new Matrix2.Matrix4();
+
+ /**
+ * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles
+ * centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north
+ * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
+ * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
+ *
+ * @param {Cartesian3} origin The center point of the local reference frame.
+ * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.
+ * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation
+ * matrix from a reference frame to the provided ellipsoid's fixed reference frame
+ * @param {Matrix4} [result] The object onto which to store the result.
+ * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.
+ *
+ * @example
+ * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
+ * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
+ * const heading = -Cesium.Math.PI_OVER_TWO;
+ * const pitch = Cesium.Math.PI_OVER_FOUR;
+ * const roll = 0.0;
+ * const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
+ * const transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr);
+ */
+ Transforms.headingPitchRollToFixedFrame = function (
+ origin,
+ headingPitchRoll,
+ ellipsoid,
+ fixedFrameTransform,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("HeadingPitchRoll", headingPitchRoll);
+ //>>includeEnd('debug');
+
+ fixedFrameTransform = defaultValue.defaultValue(
+ fixedFrameTransform,
+ Transforms.eastNorthUpToFixedFrame
+ );
+ const hprQuaternion = Quaternion.fromHeadingPitchRoll(
+ headingPitchRoll,
+ scratchHPRQuaternion
+ );
+ const hprMatrix = Matrix2.Matrix4.fromTranslationQuaternionRotationScale(
+ Matrix3.Cartesian3.ZERO,
+ hprQuaternion,
+ scratchScale,
+ scratchHPRMatrix4
+ );
+ result = fixedFrameTransform(origin, ellipsoid, result);
+ return Matrix2.Matrix4.multiply(result, hprMatrix, result);
+ };
+
+ const scratchENUMatrix4 = new Matrix2.Matrix4();
+ const scratchHPRMatrix3 = new Matrix3.Matrix3();
+
+ /**
+ * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles
+ * centered at the provided origin. Heading is the rotation from the local north
+ * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
+ * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
+ *
+ * @param {Cartesian3} origin The center point of the local reference frame.
+ * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.
+ * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation
+ * matrix from a reference frame to the provided ellipsoid's fixed reference frame
+ * @param {Quaternion} [result] The object onto which to store the result.
+ * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided.
+ *
+ * @example
+ * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.
+ * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
+ * const heading = -Cesium.Math.PI_OVER_TWO;
+ * const pitch = Cesium.Math.PI_OVER_FOUR;
+ * const roll = 0.0;
+ * const hpr = new HeadingPitchRoll(heading, pitch, roll);
+ * const quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr);
+ */
+ Transforms.headingPitchRollQuaternion = function (
+ origin,
+ headingPitchRoll,
+ ellipsoid,
+ fixedFrameTransform,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("HeadingPitchRoll", headingPitchRoll);
+ //>>includeEnd('debug');
+
+ const transform = Transforms.headingPitchRollToFixedFrame(
+ origin,
+ headingPitchRoll,
+ ellipsoid,
+ fixedFrameTransform,
+ scratchENUMatrix4
+ );
+ const rotation = Matrix2.Matrix4.getMatrix3(transform, scratchHPRMatrix3);
+ return Quaternion.fromRotationMatrix(rotation, result);
+ };
+
+ const noScale = new Matrix3.Cartesian3(1.0, 1.0, 1.0);
+ const hprCenterScratch = new Matrix3.Cartesian3();
+ const ffScratch = new Matrix2.Matrix4();
+ const hprTransformScratch = new Matrix2.Matrix4();
+ const hprRotationScratch = new Matrix3.Matrix3();
+ const hprQuaternionScratch = new Quaternion();
+ /**
+ * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north
+ * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
+ * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
+ *
+ * @param {Matrix4} transform The transform
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.
+ * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation
+ * matrix from a reference frame to the provided ellipsoid's fixed reference frame
+ * @param {HeadingPitchRoll} [result] The object onto which to store the result.
+ * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if none was provided.
+ */
+ Transforms.fixedFrameToHeadingPitchRoll = function (
+ transform,
+ ellipsoid,
+ fixedFrameTransform,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("transform", transform);
+ //>>includeEnd('debug');
+
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+ fixedFrameTransform = defaultValue.defaultValue(
+ fixedFrameTransform,
+ Transforms.eastNorthUpToFixedFrame
+ );
+ if (!defaultValue.defined(result)) {
+ result = new HeadingPitchRoll();
+ }
+
+ const center = Matrix2.Matrix4.getTranslation(transform, hprCenterScratch);
+ if (Matrix3.Cartesian3.equals(center, Matrix3.Cartesian3.ZERO)) {
+ result.heading = 0;
+ result.pitch = 0;
+ result.roll = 0;
+ return result;
+ }
+ let toFixedFrame = Matrix2.Matrix4.inverseTransformation(
+ fixedFrameTransform(center, ellipsoid, ffScratch),
+ ffScratch
+ );
+ let transformCopy = Matrix2.Matrix4.setScale(transform, noScale, hprTransformScratch);
+ transformCopy = Matrix2.Matrix4.setTranslation(
+ transformCopy,
+ Matrix3.Cartesian3.ZERO,
+ transformCopy
+ );
+
+ toFixedFrame = Matrix2.Matrix4.multiply(toFixedFrame, transformCopy, toFixedFrame);
+ let quaternionRotation = Quaternion.fromRotationMatrix(
+ Matrix2.Matrix4.getMatrix3(toFixedFrame, hprRotationScratch),
+ hprQuaternionScratch
+ );
+ quaternionRotation = Quaternion.normalize(
+ quaternionRotation,
+ quaternionRotation
+ );
+
+ return HeadingPitchRoll.fromQuaternion(quaternionRotation, result);
+ };
+
+ const gmstConstant0 = 6 * 3600 + 41 * 60 + 50.54841;
+ const gmstConstant1 = 8640184.812866;
+ const gmstConstant2 = 0.093104;
+ const gmstConstant3 = -6.2e-6;
+ const rateCoef = 1.1772758384668e-19;
+ const wgs84WRPrecessing = 7.2921158553e-5;
+ const twoPiOverSecondsInDay = Math$1.CesiumMath.TWO_PI / 86400.0;
+ let dateInUtc = new JulianDate();
+
+ /**
+ * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the
+ * pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC.
+ *
+ * @param {JulianDate} date The time at which to compute the rotation matrix.
+ * @param {Matrix3} [result] The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if none was provided.
+ *
+ * @example
+ * //Set the view to the inertial frame.
+ * scene.postUpdate.addEventListener(function(scene, time) {
+ * const now = Cesium.JulianDate.now();
+ * const offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3());
+ * const transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now));
+ * const inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4());
+ * Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset);
+ * camera.lookAtTransform(transform, offset);
+ * });
+ */
+ Transforms.computeTemeToPseudoFixedMatrix = function (date, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(date)) {
+ throw new Check.DeveloperError("date is required.");
+ }
+ //>>includeEnd('debug');
+
+ // GMST is actually computed using UT1. We're using UTC as an approximation of UT1.
+ // We do not want to use the function like convertTaiToUtc in JulianDate because
+ // we explicitly do not want to fail when inside the leap second.
+
+ dateInUtc = JulianDate.addSeconds(
+ date,
+ -JulianDate.computeTaiMinusUtc(date),
+ dateInUtc
+ );
+ const utcDayNumber = dateInUtc.dayNumber;
+ const utcSecondsIntoDay = dateInUtc.secondsOfDay;
+
+ let t;
+ const diffDays = utcDayNumber - 2451545;
+ if (utcSecondsIntoDay >= 43200.0) {
+ t = (diffDays + 0.5) / TimeConstants$1.DAYS_PER_JULIAN_CENTURY;
+ } else {
+ t = (diffDays - 0.5) / TimeConstants$1.DAYS_PER_JULIAN_CENTURY;
+ }
+
+ const gmst0 =
+ gmstConstant0 +
+ t * (gmstConstant1 + t * (gmstConstant2 + t * gmstConstant3));
+ const angle = (gmst0 * twoPiOverSecondsInDay) % Math$1.CesiumMath.TWO_PI;
+ const ratio = wgs84WRPrecessing + rateCoef * (utcDayNumber - 2451545.5);
+ const secondsSinceMidnight =
+ (utcSecondsIntoDay + TimeConstants$1.SECONDS_PER_DAY * 0.5) %
+ TimeConstants$1.SECONDS_PER_DAY;
+ const gha = angle + ratio * secondsSinceMidnight;
+ const cosGha = Math.cos(gha);
+ const sinGha = Math.sin(gha);
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3.Matrix3(
+ cosGha,
+ sinGha,
+ 0.0,
+ -sinGha,
+ cosGha,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ );
+ }
+ result[0] = cosGha;
+ result[1] = -sinGha;
+ result[2] = 0.0;
+ result[3] = sinGha;
+ result[4] = cosGha;
+ result[5] = 0.0;
+ result[6] = 0.0;
+ result[7] = 0.0;
+ result[8] = 1.0;
+ return result;
+ };
+
+ /**
+ * The source of IAU 2006 XYS data, used for computing the transformation between the
+ * Fixed and ICRF axes.
+ * @type {Iau2006XysData}
+ *
+ * @see Transforms.computeIcrfToFixedMatrix
+ * @see Transforms.computeFixedToIcrfMatrix
+ *
+ * @private
+ */
+ Transforms.iau2006XysData = new Iau2006XysData();
+
+ /**
+ * The source of Earth Orientation Parameters (EOP) data, used for computing the transformation
+ * between the Fixed and ICRF axes. By default, zero values are used for all EOP values,
+ * yielding a reasonable but not completely accurate representation of the ICRF axes.
+ * @type {EarthOrientationParameters}
+ *
+ * @see Transforms.computeIcrfToFixedMatrix
+ * @see Transforms.computeFixedToIcrfMatrix
+ *
+ * @private
+ */
+ Transforms.earthOrientationParameters = EarthOrientationParameters.NONE;
+
+ const ttMinusTai = 32.184;
+ const j2000ttDays = 2451545.0;
+
+ /**
+ * Preloads the data necessary to transform between the ICRF and Fixed axes, in either
+ * direction, over a given interval. This function returns a promise that, when resolved,
+ * indicates that the preload has completed.
+ *
+ * @param {TimeInterval} timeInterval The interval to preload.
+ * @returns {Promise} A promise that, when resolved, indicates that the preload has completed
+ * and evaluation of the transformation between the fixed and ICRF axes will
+ * no longer return undefined for a time inside the interval.
+ *
+ *
+ * @example
+ * const interval = new Cesium.TimeInterval(...);
+ * Promise.resolve(Cesium.Transforms.preloadIcrfFixed(interval)).then(function() {
+ * // the data is now loaded
+ * });
+ *
+ * @see Transforms.computeIcrfToFixedMatrix
+ * @see Transforms.computeFixedToIcrfMatrix
+ */
+ Transforms.preloadIcrfFixed = function (timeInterval) {
+ const startDayTT = timeInterval.start.dayNumber;
+ const startSecondTT = timeInterval.start.secondsOfDay + ttMinusTai;
+ const stopDayTT = timeInterval.stop.dayNumber;
+ const stopSecondTT = timeInterval.stop.secondsOfDay + ttMinusTai;
+
+ const xysPromise = Transforms.iau2006XysData.preload(
+ startDayTT,
+ startSecondTT,
+ stopDayTT,
+ stopSecondTT
+ );
+ const eopPromise = Transforms.earthOrientationParameters.getPromiseToLoad();
+
+ return Promise.all([xysPromise, eopPromise]);
+ };
+
+ /**
+ * Computes a rotation matrix to transform a point or vector from the International Celestial
+ * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF)
+ * at a given time. This function may return undefined if the data necessary to
+ * do the transformation is not yet loaded.
+ *
+ * @param {JulianDate} date The time at which to compute the rotation matrix.
+ * @param {Matrix3} [result] The object onto which to store the result. If this parameter is
+ * not specified, a new instance is created and returned.
+ * @returns {Matrix3} The rotation matrix, or undefined if the data necessary to do the
+ * transformation is not yet loaded.
+ *
+ *
+ * @example
+ * scene.postUpdate.addEventListener(function(scene, time) {
+ * // View in ICRF.
+ * const icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);
+ * if (Cesium.defined(icrfToFixed)) {
+ * const offset = Cesium.Cartesian3.clone(camera.position);
+ * const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);
+ * camera.lookAtTransform(transform, offset);
+ * }
+ * });
+ *
+ * @see Transforms.preloadIcrfFixed
+ */
+ Transforms.computeIcrfToFixedMatrix = function (date, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(date)) {
+ throw new Check.DeveloperError("date is required.");
+ }
+ //>>includeEnd('debug');
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Matrix3();
+ }
+
+ const fixedToIcrfMtx = Transforms.computeFixedToIcrfMatrix(date, result);
+ if (!defaultValue.defined(fixedToIcrfMtx)) {
+ return undefined;
+ }
+
+ return Matrix3.Matrix3.transpose(fixedToIcrfMtx, result);
+ };
+
+ const xysScratch = new Iau2006XysSample(0.0, 0.0, 0.0);
+ const eopScratch = new EarthOrientationParametersSample(
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0);
+ const rotation1Scratch = new Matrix3.Matrix3();
+ const rotation2Scratch = new Matrix3.Matrix3();
+
+ /**
+ * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF)
+ * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes
+ * at a given time. This function may return undefined if the data necessary to
+ * do the transformation is not yet loaded.
+ *
+ * @param {JulianDate} date The time at which to compute the rotation matrix.
+ * @param {Matrix3} [result] The object onto which to store the result. If this parameter is
+ * not specified, a new instance is created and returned.
+ * @returns {Matrix3} The rotation matrix, or undefined if the data necessary to do the
+ * transformation is not yet loaded.
+ *
+ *
+ * @example
+ * // Transform a point from the ICRF axes to the Fixed axes.
+ * const now = Cesium.JulianDate.now();
+ * const pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);
+ * const fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now);
+ * let pointInInertial = new Cesium.Cartesian3();
+ * if (Cesium.defined(fixedToIcrf)) {
+ * pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);
+ * }
+ *
+ * @see Transforms.preloadIcrfFixed
+ */
+ Transforms.computeFixedToIcrfMatrix = function (date, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(date)) {
+ throw new Check.DeveloperError("date is required.");
+ }
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Matrix3();
+ }
+
+ // Compute pole wander
+ const eop = Transforms.earthOrientationParameters.compute(date, eopScratch);
+ if (!defaultValue.defined(eop)) {
+ return undefined;
+ }
+
+ // There is no external conversion to Terrestrial Time (TT).
+ // So use International Atomic Time (TAI) and convert using offsets.
+ // Here we are assuming that dayTT and secondTT are positive
+ const dayTT = date.dayNumber;
+ // It's possible here that secondTT could roll over 86400
+ // This does not seem to affect the precision (unit tests check for this)
+ const secondTT = date.secondsOfDay + ttMinusTai;
+
+ const xys = Transforms.iau2006XysData.computeXysRadians(
+ dayTT,
+ secondTT,
+ xysScratch
+ );
+ if (!defaultValue.defined(xys)) {
+ return undefined;
+ }
+
+ const x = xys.x + eop.xPoleOffset;
+ const y = xys.y + eop.yPoleOffset;
+
+ // Compute XYS rotation
+ const a = 1.0 / (1.0 + Math.sqrt(1.0 - x * x - y * y));
+
+ const rotation1 = rotation1Scratch;
+ rotation1[0] = 1.0 - a * x * x;
+ rotation1[3] = -a * x * y;
+ rotation1[6] = x;
+ rotation1[1] = -a * x * y;
+ rotation1[4] = 1 - a * y * y;
+ rotation1[7] = y;
+ rotation1[2] = -x;
+ rotation1[5] = -y;
+ rotation1[8] = 1 - a * (x * x + y * y);
+
+ const rotation2 = Matrix3.Matrix3.fromRotationZ(-xys.s, rotation2Scratch);
+ const matrixQ = Matrix3.Matrix3.multiply(rotation1, rotation2, rotation1Scratch);
+
+ // Similar to TT conversions above
+ // It's possible here that secondTT could roll over 86400
+ // This does not seem to affect the precision (unit tests check for this)
+ const dateUt1day = date.dayNumber;
+ const dateUt1sec =
+ date.secondsOfDay - JulianDate.computeTaiMinusUtc(date) + eop.ut1MinusUtc;
+
+ // Compute Earth rotation angle
+ // The IERS standard for era is
+ // era = 0.7790572732640 + 1.00273781191135448 * Tu
+ // where
+ // Tu = JulianDateInUt1 - 2451545.0
+ // However, you get much more precision if you make the following simplification
+ // era = a + (1 + b) * (JulianDayNumber + FractionOfDay - 2451545)
+ // era = a + (JulianDayNumber - 2451545) + FractionOfDay + b (JulianDayNumber - 2451545 + FractionOfDay)
+ // era = a + FractionOfDay + b (JulianDayNumber - 2451545 + FractionOfDay)
+ // since (JulianDayNumber - 2451545) represents an integer number of revolutions which will be discarded anyway.
+ const daysSinceJ2000 = dateUt1day - 2451545;
+ const fractionOfDay = dateUt1sec / TimeConstants$1.SECONDS_PER_DAY;
+ let era =
+ 0.779057273264 +
+ fractionOfDay +
+ 0.00273781191135448 * (daysSinceJ2000 + fractionOfDay);
+ era = (era % 1.0) * Math$1.CesiumMath.TWO_PI;
+
+ const earthRotation = Matrix3.Matrix3.fromRotationZ(era, rotation2Scratch);
+
+ // pseudoFixed to ICRF
+ const pfToIcrf = Matrix3.Matrix3.multiply(matrixQ, earthRotation, rotation1Scratch);
+
+ // Compute pole wander matrix
+ const cosxp = Math.cos(eop.xPoleWander);
+ const cosyp = Math.cos(eop.yPoleWander);
+ const sinxp = Math.sin(eop.xPoleWander);
+ const sinyp = Math.sin(eop.yPoleWander);
+
+ let ttt = dayTT - j2000ttDays + secondTT / TimeConstants$1.SECONDS_PER_DAY;
+ ttt /= 36525.0;
+
+ // approximate sp value in rad
+ const sp = (-47.0e-6 * ttt * Math$1.CesiumMath.RADIANS_PER_DEGREE) / 3600.0;
+ const cossp = Math.cos(sp);
+ const sinsp = Math.sin(sp);
+
+ const fToPfMtx = rotation2Scratch;
+ fToPfMtx[0] = cosxp * cossp;
+ fToPfMtx[1] = cosxp * sinsp;
+ fToPfMtx[2] = sinxp;
+ fToPfMtx[3] = -cosyp * sinsp + sinyp * sinxp * cossp;
+ fToPfMtx[4] = cosyp * cossp + sinyp * sinxp * sinsp;
+ fToPfMtx[5] = -sinyp * cosxp;
+ fToPfMtx[6] = -sinyp * sinsp - cosyp * sinxp * cossp;
+ fToPfMtx[7] = sinyp * cossp - cosyp * sinxp * sinsp;
+ fToPfMtx[8] = cosyp * cosxp;
+
+ return Matrix3.Matrix3.multiply(pfToIcrf, fToPfMtx, result);
+ };
+
+ const pointToWindowCoordinatesTemp = new Matrix2.Cartesian4();
+
+ /**
+ * Transform a point from model coordinates to window coordinates.
+ *
+ * @param {Matrix4} modelViewProjectionMatrix The 4x4 model-view-projection matrix.
+ * @param {Matrix4} viewportTransformation The 4x4 viewport transformation.
+ * @param {Cartesian3} point The point to transform.
+ * @param {Cartesian2} [result] The object onto which to store the result.
+ * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided.
+ */
+ Transforms.pointToWindowCoordinates = function (
+ modelViewProjectionMatrix,
+ viewportTransformation,
+ point,
+ result
+ ) {
+ result = Transforms.pointToGLWindowCoordinates(
+ modelViewProjectionMatrix,
+ viewportTransformation,
+ point,
+ result
+ );
+ result.y = 2.0 * viewportTransformation[5] - result.y;
+ return result;
+ };
+
+ /**
+ * @private
+ */
+ Transforms.pointToGLWindowCoordinates = function (
+ modelViewProjectionMatrix,
+ viewportTransformation,
+ point,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(modelViewProjectionMatrix)) {
+ throw new Check.DeveloperError("modelViewProjectionMatrix is required.");
+ }
+
+ if (!defaultValue.defined(viewportTransformation)) {
+ throw new Check.DeveloperError("viewportTransformation is required.");
+ }
+
+ if (!defaultValue.defined(point)) {
+ throw new Check.DeveloperError("point is required.");
+ }
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix2.Cartesian2();
+ }
+
+ const tmp = pointToWindowCoordinatesTemp;
+
+ Matrix2.Matrix4.multiplyByVector(
+ modelViewProjectionMatrix,
+ Matrix2.Cartesian4.fromElements(point.x, point.y, point.z, 1, tmp),
+ tmp
+ );
+ Matrix2.Cartesian4.multiplyByScalar(tmp, 1.0 / tmp.w, tmp);
+ Matrix2.Matrix4.multiplyByVector(viewportTransformation, tmp, tmp);
+ return Matrix2.Cartesian2.fromCartesian4(tmp, result);
+ };
+
+ const normalScratch = new Matrix3.Cartesian3();
+ const rightScratch = new Matrix3.Cartesian3();
+ const upScratch = new Matrix3.Cartesian3();
+
+ /**
+ * Transform a position and velocity to a rotation matrix.
+ *
+ * @param {Cartesian3} position The position to transform.
+ * @param {Cartesian3} velocity The velocity vector to transform.
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.
+ * @param {Matrix3} [result] The object onto which to store the result.
+ * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if none was provided.
+ */
+ Transforms.rotationMatrixFromPositionVelocity = function (
+ position,
+ velocity,
+ ellipsoid,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(position)) {
+ throw new Check.DeveloperError("position is required.");
+ }
+
+ if (!defaultValue.defined(velocity)) {
+ throw new Check.DeveloperError("velocity is required.");
+ }
+ //>>includeEnd('debug');
+
+ const normal = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84).geodeticSurfaceNormal(
+ position,
+ normalScratch
+ );
+ let right = Matrix3.Cartesian3.cross(velocity, normal, rightScratch);
+
+ if (Matrix3.Cartesian3.equalsEpsilon(right, Matrix3.Cartesian3.ZERO, Math$1.CesiumMath.EPSILON6)) {
+ right = Matrix3.Cartesian3.clone(Matrix3.Cartesian3.UNIT_X, right);
+ }
+
+ const up = Matrix3.Cartesian3.cross(right, velocity, upScratch);
+ Matrix3.Cartesian3.normalize(up, up);
+ Matrix3.Cartesian3.cross(velocity, up, right);
+ Matrix3.Cartesian3.negate(right, right);
+ Matrix3.Cartesian3.normalize(right, right);
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix3.Matrix3();
+ }
+
+ result[0] = velocity.x;
+ result[1] = velocity.y;
+ result[2] = velocity.z;
+ result[3] = right.x;
+ result[4] = right.y;
+ result[5] = right.z;
+ result[6] = up.x;
+ result[7] = up.y;
+ result[8] = up.z;
+
+ return result;
+ };
+
+ const swizzleMatrix = new Matrix2.Matrix4(
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 1.0
+ );
+
+ const scratchCartographic = new Matrix3.Cartographic();
+ const scratchCartesian3Projection = new Matrix3.Cartesian3();
+ const scratchCenter = new Matrix3.Cartesian3();
+ const scratchRotation = new Matrix3.Matrix3();
+ const scratchFromENU = new Matrix2.Matrix4();
+ const scratchToENU = new Matrix2.Matrix4();
+
+ /**
+ * @private
+ */
+ Transforms.basisTo2D = function (projection, matrix, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(projection)) {
+ throw new Check.DeveloperError("projection is required.");
+ }
+ if (!defaultValue.defined(matrix)) {
+ throw new Check.DeveloperError("matrix is required.");
+ }
+ if (!defaultValue.defined(result)) {
+ throw new Check.DeveloperError("result is required.");
+ }
+ //>>includeEnd('debug');
+
+ const rtcCenter = Matrix2.Matrix4.getTranslation(matrix, scratchCenter);
+ const ellipsoid = projection.ellipsoid;
+
+ // Get the 2D Center
+ const cartographic = ellipsoid.cartesianToCartographic(
+ rtcCenter,
+ scratchCartographic
+ );
+ const projectedPosition = projection.project(
+ cartographic,
+ scratchCartesian3Projection
+ );
+ Matrix3.Cartesian3.fromElements(
+ projectedPosition.z,
+ projectedPosition.x,
+ projectedPosition.y,
+ projectedPosition
+ );
+
+ // Assuming the instance are positioned in WGS84, invert the WGS84 transform to get the local transform and then convert to 2D
+ const fromENU = Transforms.eastNorthUpToFixedFrame(
+ rtcCenter,
+ ellipsoid,
+ scratchFromENU
+ );
+ const toENU = Matrix2.Matrix4.inverseTransformation(fromENU, scratchToENU);
+ const rotation = Matrix2.Matrix4.getMatrix3(matrix, scratchRotation);
+ const local = Matrix2.Matrix4.multiplyByMatrix3(toENU, rotation, result);
+ Matrix2.Matrix4.multiply(swizzleMatrix, local, result); // Swap x, y, z for 2D
+ Matrix2.Matrix4.setTranslation(result, projectedPosition, result); // Use the projected center
+
+ return result;
+ };
+
+ /**
+ * @private
+ */
+ Transforms.wgs84To2DModelMatrix = function (projection, center, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(projection)) {
+ throw new Check.DeveloperError("projection is required.");
+ }
+ if (!defaultValue.defined(center)) {
+ throw new Check.DeveloperError("center is required.");
+ }
+ if (!defaultValue.defined(result)) {
+ throw new Check.DeveloperError("result is required.");
+ }
+ //>>includeEnd('debug');
+
+ const ellipsoid = projection.ellipsoid;
+
+ const fromENU = Transforms.eastNorthUpToFixedFrame(
+ center,
+ ellipsoid,
+ scratchFromENU
+ );
+ const toENU = Matrix2.Matrix4.inverseTransformation(fromENU, scratchToENU);
+
+ const cartographic = ellipsoid.cartesianToCartographic(
+ center,
+ scratchCartographic
+ );
+ const projectedPosition = projection.project(
+ cartographic,
+ scratchCartesian3Projection
+ );
+ Matrix3.Cartesian3.fromElements(
+ projectedPosition.z,
+ projectedPosition.x,
+ projectedPosition.y,
+ projectedPosition
+ );
+
+ const translation = Matrix2.Matrix4.fromTranslation(
+ projectedPosition,
+ scratchFromENU
+ );
+ Matrix2.Matrix4.multiply(swizzleMatrix, toENU, result);
+ Matrix2.Matrix4.multiply(translation, result, result);
+
+ return result;
+ };
+ var Transforms$1 = Transforms;
+
+ exports.BoundingSphere = BoundingSphere;
+ exports.FeatureDetection = FeatureDetection$1;
+ exports.GeographicProjection = GeographicProjection;
+ exports.Intersect = Intersect$1;
+ exports.Interval = Interval;
+ exports.Quaternion = Quaternion;
+ exports.Resource = Resource;
+ exports.Transforms = Transforms$1;
+ exports.buildModuleUrl = buildModuleUrl;
+
+}));
+//# sourceMappingURL=Transforms-11fb6b0a.js.map
diff --git a/examples/cesium/Workers/Transforms-11fb6b0a.js.map b/examples/cesium/Workers/Transforms-11fb6b0a.js.map
new file mode 100644
index 0000000..487fecd
--- /dev/null
+++ b/examples/cesium/Workers/Transforms-11fb6b0a.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"Transforms-11fb6b0a.js","sources":["../../../Source/Core/GeographicProjection.js","../../../Source/Core/Intersect.js","../../../Source/Core/Interval.js","../../../Source/Core/BoundingSphere.js","../../../Source/Core/Fullscreen.js","../../../Source/Core/FeatureDetection.js","../../../Source/Core/Quaternion.js","../../../Source/Core/binarySearch.js","../../../Source/Core/EarthOrientationParametersSample.js","../../../Source/Core/GregorianDate.js","../../../Source/Core/isLeapYear.js","../../../Source/Core/LeapSecond.js","../../../Source/Core/TimeConstants.js","../../../Source/Core/TimeStandard.js","../../../Source/Core/JulianDate.js","../../../node_modules/urijs/src/punycode.js","../../../node_modules/urijs/src/IPv6.js","../../../node_modules/urijs/src/SecondLevelDomains.js","../../../node_modules/urijs/src/URI.js","../../../Source/Core/appendForwardSlash.js","../../../Source/Core/clone.js","../../../Source/Core/defer.js","../../../Source/Core/getAbsoluteUri.js","../../../Source/Core/getBaseUri.js","../../../Source/Core/getExtensionFromUri.js","../../../Source/Core/getImagePixels.js","../../../Source/Core/isBlobUri.js","../../../Source/Core/isCrossOriginUrl.js","../../../Source/Core/isDataUri.js","../../../Source/Core/loadAndExecuteScript.js","../../../Source/Core/objectToQuery.js","../../../Source/Core/queryToObject.js","../../../Source/Core/RequestState.js","../../../Source/Core/RequestType.js","../../../Source/Core/Request.js","../../../Source/Core/parseResponseHeaders.js","../../../Source/Core/RequestErrorEvent.js","../../../Source/Core/Event.js","../../../Source/Core/Heap.js","../../../Source/Core/RequestScheduler.js","../../../Source/Core/TrustedServers.js","../../../Source/Core/Resource.js","../../../Source/Core/EarthOrientationParameters.js","../../../Source/Core/HeadingPitchRoll.js","../../../Source/Core/buildModuleUrl.js","../../../Source/Core/Iau2006XysSample.js","../../../Source/Core/Iau2006XysData.js","../../../Source/Core/Transforms.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\n\r\n/**\r\n * A simple map projection where longitude and latitude are linearly mapped to X and Y by multiplying\r\n * them by the {@link Ellipsoid#maximumRadius}. This projection\r\n * is commonly known as geographic, equirectangular, equidistant cylindrical, or plate carrée. It\r\n * is also known as EPSG:4326.\r\n *\r\n * @alias GeographicProjection\r\n * @constructor\r\n *\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.\r\n *\r\n * @see WebMercatorProjection\r\n */\r\nfunction GeographicProjection(ellipsoid) {\r\n this._ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n this._semimajorAxis = this._ellipsoid.maximumRadius;\r\n this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;\r\n}\r\n\r\nObject.defineProperties(GeographicProjection.prototype, {\r\n /**\r\n * Gets the {@link Ellipsoid}.\r\n *\r\n * @memberof GeographicProjection.prototype\r\n *\r\n * @type {Ellipsoid}\r\n * @readonly\r\n */\r\n ellipsoid: {\r\n get: function () {\r\n return this._ellipsoid;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Projects a set of {@link Cartographic} coordinates, in radians, to map coordinates, in meters.\r\n * X and Y are the longitude and latitude, respectively, multiplied by the maximum radius of the\r\n * ellipsoid. Z is the unmodified height.\r\n *\r\n * @param {Cartographic} cartographic The coordinates to project.\r\n * @param {Cartesian3} [result] An instance into which to copy the result. If this parameter is\r\n * undefined, a new instance is created and returned.\r\n * @returns {Cartesian3} The projected coordinates. If the result parameter is not undefined, the\r\n * coordinates are copied there and that instance is returned. Otherwise, a new instance is\r\n * created and returned.\r\n */\r\nGeographicProjection.prototype.project = function (cartographic, result) {\r\n // Actually this is the special case of equidistant cylindrical called the plate carree\r\n const semimajorAxis = this._semimajorAxis;\r\n const x = cartographic.longitude * semimajorAxis;\r\n const y = cartographic.latitude * semimajorAxis;\r\n const z = cartographic.height;\r\n\r\n if (!defined(result)) {\r\n return new Cartesian3(x, y, z);\r\n }\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Unprojects a set of projected {@link Cartesian3} coordinates, in meters, to {@link Cartographic}\r\n * coordinates, in radians. Longitude and Latitude are the X and Y coordinates, respectively,\r\n * divided by the maximum radius of the ellipsoid. Height is the unmodified Z coordinate.\r\n *\r\n * @param {Cartesian3} cartesian The Cartesian position to unproject with height (z) in meters.\r\n * @param {Cartographic} [result] An instance into which to copy the result. If this parameter is\r\n * undefined, a new instance is created and returned.\r\n * @returns {Cartographic} The unprojected coordinates. If the result parameter is not undefined, the\r\n * coordinates are copied there and that instance is returned. Otherwise, a new instance is\r\n * created and returned.\r\n */\r\nGeographicProjection.prototype.unproject = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(cartesian)) {\r\n throw new DeveloperError(\"cartesian is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;\r\n const longitude = cartesian.x * oneOverEarthSemimajorAxis;\r\n const latitude = cartesian.y * oneOverEarthSemimajorAxis;\r\n const height = cartesian.z;\r\n\r\n if (!defined(result)) {\r\n return new Cartographic(longitude, latitude, height);\r\n }\r\n\r\n result.longitude = longitude;\r\n result.latitude = latitude;\r\n result.height = height;\r\n return result;\r\n};\r\nexport default GeographicProjection;\r\n","/**\r\n * This enumerated type is used in determining where, relative to the frustum, an\r\n * object is located. The object can either be fully contained within the frustum (INSIDE),\r\n * partially inside the frustum and partially outside (INTERSECTING), or somewhere entirely\r\n * outside of the frustum's 6 planes (OUTSIDE).\r\n *\r\n * @enum {Number}\r\n */\r\nconst Intersect = {\r\n /**\r\n * Represents that an object is not contained within the frustum.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n OUTSIDE: -1,\r\n\r\n /**\r\n * Represents that an object intersects one of the frustum's planes.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n INTERSECTING: 0,\r\n\r\n /**\r\n * Represents that an object is fully within the frustum.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n INSIDE: 1,\r\n};\r\nexport default Object.freeze(Intersect);\r\n","import defaultValue from \"./defaultValue.js\";\r\n\r\n/**\r\n * Represents the closed interval [start, stop].\r\n * @alias Interval\r\n * @constructor\r\n *\r\n * @param {Number} [start=0.0] The beginning of the interval.\r\n * @param {Number} [stop=0.0] The end of the interval.\r\n */\r\nfunction Interval(start, stop) {\r\n /**\r\n * The beginning of the interval.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.start = defaultValue(start, 0.0);\r\n /**\r\n * The end of the interval.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.stop = defaultValue(stop, 0.0);\r\n}\r\nexport default Interval;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport GeographicProjection from \"./GeographicProjection.js\";\r\nimport Intersect from \"./Intersect.js\";\r\nimport Interval from \"./Interval.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\n\r\n/**\r\n * A bounding sphere with a center and a radius.\r\n * @alias BoundingSphere\r\n * @constructor\r\n *\r\n * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the bounding sphere.\r\n * @param {Number} [radius=0.0] The radius of the bounding sphere.\r\n *\r\n * @see AxisAlignedBoundingBox\r\n * @see BoundingRectangle\r\n * @see Packable\r\n */\r\nfunction BoundingSphere(center, radius) {\r\n /**\r\n * The center point of the sphere.\r\n * @type {Cartesian3}\r\n * @default {@link Cartesian3.ZERO}\r\n */\r\n this.center = Cartesian3.clone(defaultValue(center, Cartesian3.ZERO));\r\n\r\n /**\r\n * The radius of the sphere.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.radius = defaultValue(radius, 0.0);\r\n}\r\n\r\nconst fromPointsXMin = new Cartesian3();\r\nconst fromPointsYMin = new Cartesian3();\r\nconst fromPointsZMin = new Cartesian3();\r\nconst fromPointsXMax = new Cartesian3();\r\nconst fromPointsYMax = new Cartesian3();\r\nconst fromPointsZMax = new Cartesian3();\r\nconst fromPointsCurrentPos = new Cartesian3();\r\nconst fromPointsScratch = new Cartesian3();\r\nconst fromPointsRitterCenter = new Cartesian3();\r\nconst fromPointsMinBoxPt = new Cartesian3();\r\nconst fromPointsMaxBoxPt = new Cartesian3();\r\nconst fromPointsNaiveCenterScratch = new Cartesian3();\r\nconst volumeConstant = (4.0 / 3.0) * CesiumMath.PI;\r\n\r\n/**\r\n * Computes a tight-fitting bounding sphere enclosing a list of 3D Cartesian points.\r\n * The bounding sphere is computed by running two algorithms, a naive algorithm and\r\n * Ritter's algorithm. The smaller of the two spheres is used to ensure a tight fit.\r\n *\r\n * @param {Cartesian3[]} [positions] An array of points that the bounding sphere will enclose. Each point must have x
, y
, and z
properties.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\r\n *\r\n * @see {@link http://help.agi.com/AGIComponents/html/BlogBoundingSphere.htm|Bounding Sphere computation article}\r\n */\r\nBoundingSphere.fromPoints = function (positions, result) {\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n if (!defined(positions) || positions.length === 0) {\r\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\r\n result.radius = 0.0;\r\n return result;\r\n }\r\n\r\n const currentPos = Cartesian3.clone(positions[0], fromPointsCurrentPos);\r\n\r\n const xMin = Cartesian3.clone(currentPos, fromPointsXMin);\r\n const yMin = Cartesian3.clone(currentPos, fromPointsYMin);\r\n const zMin = Cartesian3.clone(currentPos, fromPointsZMin);\r\n\r\n const xMax = Cartesian3.clone(currentPos, fromPointsXMax);\r\n const yMax = Cartesian3.clone(currentPos, fromPointsYMax);\r\n const zMax = Cartesian3.clone(currentPos, fromPointsZMax);\r\n\r\n const numPositions = positions.length;\r\n let i;\r\n for (i = 1; i < numPositions; i++) {\r\n Cartesian3.clone(positions[i], currentPos);\r\n\r\n const x = currentPos.x;\r\n const y = currentPos.y;\r\n const z = currentPos.z;\r\n\r\n // Store points containing the the smallest and largest components\r\n if (x < xMin.x) {\r\n Cartesian3.clone(currentPos, xMin);\r\n }\r\n\r\n if (x > xMax.x) {\r\n Cartesian3.clone(currentPos, xMax);\r\n }\r\n\r\n if (y < yMin.y) {\r\n Cartesian3.clone(currentPos, yMin);\r\n }\r\n\r\n if (y > yMax.y) {\r\n Cartesian3.clone(currentPos, yMax);\r\n }\r\n\r\n if (z < zMin.z) {\r\n Cartesian3.clone(currentPos, zMin);\r\n }\r\n\r\n if (z > zMax.z) {\r\n Cartesian3.clone(currentPos, zMax);\r\n }\r\n }\r\n\r\n // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).\r\n const xSpan = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(xMax, xMin, fromPointsScratch)\r\n );\r\n const ySpan = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(yMax, yMin, fromPointsScratch)\r\n );\r\n const zSpan = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(zMax, zMin, fromPointsScratch)\r\n );\r\n\r\n // Set the diameter endpoints to the largest span.\r\n let diameter1 = xMin;\r\n let diameter2 = xMax;\r\n let maxSpan = xSpan;\r\n if (ySpan > maxSpan) {\r\n maxSpan = ySpan;\r\n diameter1 = yMin;\r\n diameter2 = yMax;\r\n }\r\n if (zSpan > maxSpan) {\r\n maxSpan = zSpan;\r\n diameter1 = zMin;\r\n diameter2 = zMax;\r\n }\r\n\r\n // Calculate the center of the initial sphere found by Ritter's algorithm\r\n const ritterCenter = fromPointsRitterCenter;\r\n ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;\r\n ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;\r\n ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;\r\n\r\n // Calculate the radius of the initial sphere found by Ritter's algorithm\r\n let radiusSquared = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)\r\n );\r\n let ritterRadius = Math.sqrt(radiusSquared);\r\n\r\n // Find the center of the sphere found using the Naive method.\r\n const minBoxPt = fromPointsMinBoxPt;\r\n minBoxPt.x = xMin.x;\r\n minBoxPt.y = yMin.y;\r\n minBoxPt.z = zMin.z;\r\n\r\n const maxBoxPt = fromPointsMaxBoxPt;\r\n maxBoxPt.x = xMax.x;\r\n maxBoxPt.y = yMax.y;\r\n maxBoxPt.z = zMax.z;\r\n\r\n const naiveCenter = Cartesian3.midpoint(\r\n minBoxPt,\r\n maxBoxPt,\r\n fromPointsNaiveCenterScratch\r\n );\r\n\r\n // Begin 2nd pass to find naive radius and modify the ritter sphere.\r\n let naiveRadius = 0;\r\n for (i = 0; i < numPositions; i++) {\r\n Cartesian3.clone(positions[i], currentPos);\r\n\r\n // Find the furthest point from the naive center to calculate the naive radius.\r\n const r = Cartesian3.magnitude(\r\n Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)\r\n );\r\n if (r > naiveRadius) {\r\n naiveRadius = r;\r\n }\r\n\r\n // Make adjustments to the Ritter Sphere to include all points.\r\n const oldCenterToPointSquared = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)\r\n );\r\n if (oldCenterToPointSquared > radiusSquared) {\r\n const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);\r\n // Calculate new radius to include the point that lies outside\r\n ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;\r\n radiusSquared = ritterRadius * ritterRadius;\r\n // Calculate center of new Ritter sphere\r\n const oldToNew = oldCenterToPoint - ritterRadius;\r\n ritterCenter.x =\r\n (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /\r\n oldCenterToPoint;\r\n ritterCenter.y =\r\n (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /\r\n oldCenterToPoint;\r\n ritterCenter.z =\r\n (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /\r\n oldCenterToPoint;\r\n }\r\n }\r\n\r\n if (ritterRadius < naiveRadius) {\r\n Cartesian3.clone(ritterCenter, result.center);\r\n result.radius = ritterRadius;\r\n } else {\r\n Cartesian3.clone(naiveCenter, result.center);\r\n result.radius = naiveRadius;\r\n }\r\n\r\n return result;\r\n};\r\n\r\nconst defaultProjection = new GeographicProjection();\r\nconst fromRectangle2DLowerLeft = new Cartesian3();\r\nconst fromRectangle2DUpperRight = new Cartesian3();\r\nconst fromRectangle2DSouthwest = new Cartographic();\r\nconst fromRectangle2DNortheast = new Cartographic();\r\n\r\n/**\r\n * Computes a bounding sphere from a rectangle projected in 2D.\r\n *\r\n * @param {Rectangle} [rectangle] The rectangle around which to create a bounding sphere.\r\n * @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.fromRectangle2D = function (rectangle, projection, result) {\r\n return BoundingSphere.fromRectangleWithHeights2D(\r\n rectangle,\r\n projection,\r\n 0.0,\r\n 0.0,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Computes a bounding sphere from a rectangle projected in 2D. The bounding sphere accounts for the\r\n * object's minimum and maximum heights over the rectangle.\r\n *\r\n * @param {Rectangle} [rectangle] The rectangle around which to create a bounding sphere.\r\n * @param {Object} [projection=GeographicProjection] The projection used to project the rectangle into 2D.\r\n * @param {Number} [minimumHeight=0.0] The minimum height over the rectangle.\r\n * @param {Number} [maximumHeight=0.0] The maximum height over the rectangle.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.fromRectangleWithHeights2D = function (\r\n rectangle,\r\n projection,\r\n minimumHeight,\r\n maximumHeight,\r\n result\r\n) {\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n if (!defined(rectangle)) {\r\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\r\n result.radius = 0.0;\r\n return result;\r\n }\r\n\r\n projection = defaultValue(projection, defaultProjection);\r\n\r\n Rectangle.southwest(rectangle, fromRectangle2DSouthwest);\r\n fromRectangle2DSouthwest.height = minimumHeight;\r\n Rectangle.northeast(rectangle, fromRectangle2DNortheast);\r\n fromRectangle2DNortheast.height = maximumHeight;\r\n\r\n const lowerLeft = projection.project(\r\n fromRectangle2DSouthwest,\r\n fromRectangle2DLowerLeft\r\n );\r\n const upperRight = projection.project(\r\n fromRectangle2DNortheast,\r\n fromRectangle2DUpperRight\r\n );\r\n\r\n const width = upperRight.x - lowerLeft.x;\r\n const height = upperRight.y - lowerLeft.y;\r\n const elevation = upperRight.z - lowerLeft.z;\r\n\r\n result.radius =\r\n Math.sqrt(width * width + height * height + elevation * elevation) * 0.5;\r\n const center = result.center;\r\n center.x = lowerLeft.x + width * 0.5;\r\n center.y = lowerLeft.y + height * 0.5;\r\n center.z = lowerLeft.z + elevation * 0.5;\r\n return result;\r\n};\r\n\r\nconst fromRectangle3DScratch = [];\r\n\r\n/**\r\n * Computes a bounding sphere from a rectangle in 3D. The bounding sphere is created using a subsample of points\r\n * on the ellipsoid and contained in the rectangle. It may not be accurate for all rectangles on all types of ellipsoids.\r\n *\r\n * @param {Rectangle} [rectangle] The valid rectangle used to create a bounding sphere.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid used to determine positions of the rectangle.\r\n * @param {Number} [surfaceHeight=0.0] The height above the surface of the ellipsoid.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.fromRectangle3D = function (\r\n rectangle,\r\n ellipsoid,\r\n surfaceHeight,\r\n result\r\n) {\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n surfaceHeight = defaultValue(surfaceHeight, 0.0);\r\n\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n if (!defined(rectangle)) {\r\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\r\n result.radius = 0.0;\r\n return result;\r\n }\r\n\r\n const positions = Rectangle.subsample(\r\n rectangle,\r\n ellipsoid,\r\n surfaceHeight,\r\n fromRectangle3DScratch\r\n );\r\n return BoundingSphere.fromPoints(positions, result);\r\n};\r\n\r\n/**\r\n * Computes a tight-fitting bounding sphere enclosing a list of 3D points, where the points are\r\n * stored in a flat array in X, Y, Z, order. The bounding sphere is computed by running two\r\n * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to\r\n * ensure a tight fit.\r\n *\r\n * @param {Number[]} [positions] An array of points that the bounding sphere will enclose. Each point\r\n * is formed from three elements in the array in the order X, Y, Z.\r\n * @param {Cartesian3} [center=Cartesian3.ZERO] The position to which the positions are relative, which need not be the\r\n * origin of the coordinate system. This is useful when the positions are to be used for\r\n * relative-to-center (RTC) rendering.\r\n * @param {Number} [stride=3] The number of array elements per vertex. It must be at least 3, but it may\r\n * be higher. Regardless of the value of this parameter, the X coordinate of the first position\r\n * is at array index 0, the Y coordinate is at array index 1, and the Z coordinate is at array index\r\n * 2. When stride is 3, the X coordinate of the next position then begins at array index 3. If\r\n * the stride is 5, however, two array elements are skipped and the next position begins at array\r\n * index 5.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\r\n *\r\n * @example\r\n * // Compute the bounding sphere from 3 positions, each specified relative to a center.\r\n * // In addition to the X, Y, and Z coordinates, the points array contains two additional\r\n * // elements per point which are ignored for the purpose of computing the bounding sphere.\r\n * const center = new Cesium.Cartesian3(1.0, 2.0, 3.0);\r\n * const points = [1.0, 2.0, 3.0, 0.1, 0.2,\r\n * 4.0, 5.0, 6.0, 0.1, 0.2,\r\n * 7.0, 8.0, 9.0, 0.1, 0.2];\r\n * const sphere = Cesium.BoundingSphere.fromVertices(points, center, 5);\r\n *\r\n * @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}\r\n */\r\nBoundingSphere.fromVertices = function (positions, center, stride, result) {\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n if (!defined(positions) || positions.length === 0) {\r\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\r\n result.radius = 0.0;\r\n return result;\r\n }\r\n\r\n center = defaultValue(center, Cartesian3.ZERO);\r\n\r\n stride = defaultValue(stride, 3);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.greaterThanOrEquals(\"stride\", stride, 3);\r\n //>>includeEnd('debug');\r\n\r\n const currentPos = fromPointsCurrentPos;\r\n currentPos.x = positions[0] + center.x;\r\n currentPos.y = positions[1] + center.y;\r\n currentPos.z = positions[2] + center.z;\r\n\r\n const xMin = Cartesian3.clone(currentPos, fromPointsXMin);\r\n const yMin = Cartesian3.clone(currentPos, fromPointsYMin);\r\n const zMin = Cartesian3.clone(currentPos, fromPointsZMin);\r\n\r\n const xMax = Cartesian3.clone(currentPos, fromPointsXMax);\r\n const yMax = Cartesian3.clone(currentPos, fromPointsYMax);\r\n const zMax = Cartesian3.clone(currentPos, fromPointsZMax);\r\n\r\n const numElements = positions.length;\r\n let i;\r\n for (i = 0; i < numElements; i += stride) {\r\n const x = positions[i] + center.x;\r\n const y = positions[i + 1] + center.y;\r\n const z = positions[i + 2] + center.z;\r\n\r\n currentPos.x = x;\r\n currentPos.y = y;\r\n currentPos.z = z;\r\n\r\n // Store points containing the the smallest and largest components\r\n if (x < xMin.x) {\r\n Cartesian3.clone(currentPos, xMin);\r\n }\r\n\r\n if (x > xMax.x) {\r\n Cartesian3.clone(currentPos, xMax);\r\n }\r\n\r\n if (y < yMin.y) {\r\n Cartesian3.clone(currentPos, yMin);\r\n }\r\n\r\n if (y > yMax.y) {\r\n Cartesian3.clone(currentPos, yMax);\r\n }\r\n\r\n if (z < zMin.z) {\r\n Cartesian3.clone(currentPos, zMin);\r\n }\r\n\r\n if (z > zMax.z) {\r\n Cartesian3.clone(currentPos, zMax);\r\n }\r\n }\r\n\r\n // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).\r\n const xSpan = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(xMax, xMin, fromPointsScratch)\r\n );\r\n const ySpan = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(yMax, yMin, fromPointsScratch)\r\n );\r\n const zSpan = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(zMax, zMin, fromPointsScratch)\r\n );\r\n\r\n // Set the diameter endpoints to the largest span.\r\n let diameter1 = xMin;\r\n let diameter2 = xMax;\r\n let maxSpan = xSpan;\r\n if (ySpan > maxSpan) {\r\n maxSpan = ySpan;\r\n diameter1 = yMin;\r\n diameter2 = yMax;\r\n }\r\n if (zSpan > maxSpan) {\r\n maxSpan = zSpan;\r\n diameter1 = zMin;\r\n diameter2 = zMax;\r\n }\r\n\r\n // Calculate the center of the initial sphere found by Ritter's algorithm\r\n const ritterCenter = fromPointsRitterCenter;\r\n ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;\r\n ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;\r\n ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;\r\n\r\n // Calculate the radius of the initial sphere found by Ritter's algorithm\r\n let radiusSquared = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)\r\n );\r\n let ritterRadius = Math.sqrt(radiusSquared);\r\n\r\n // Find the center of the sphere found using the Naive method.\r\n const minBoxPt = fromPointsMinBoxPt;\r\n minBoxPt.x = xMin.x;\r\n minBoxPt.y = yMin.y;\r\n minBoxPt.z = zMin.z;\r\n\r\n const maxBoxPt = fromPointsMaxBoxPt;\r\n maxBoxPt.x = xMax.x;\r\n maxBoxPt.y = yMax.y;\r\n maxBoxPt.z = zMax.z;\r\n\r\n const naiveCenter = Cartesian3.midpoint(\r\n minBoxPt,\r\n maxBoxPt,\r\n fromPointsNaiveCenterScratch\r\n );\r\n\r\n // Begin 2nd pass to find naive radius and modify the ritter sphere.\r\n let naiveRadius = 0;\r\n for (i = 0; i < numElements; i += stride) {\r\n currentPos.x = positions[i] + center.x;\r\n currentPos.y = positions[i + 1] + center.y;\r\n currentPos.z = positions[i + 2] + center.z;\r\n\r\n // Find the furthest point from the naive center to calculate the naive radius.\r\n const r = Cartesian3.magnitude(\r\n Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)\r\n );\r\n if (r > naiveRadius) {\r\n naiveRadius = r;\r\n }\r\n\r\n // Make adjustments to the Ritter Sphere to include all points.\r\n const oldCenterToPointSquared = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)\r\n );\r\n if (oldCenterToPointSquared > radiusSquared) {\r\n const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);\r\n // Calculate new radius to include the point that lies outside\r\n ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;\r\n radiusSquared = ritterRadius * ritterRadius;\r\n // Calculate center of new Ritter sphere\r\n const oldToNew = oldCenterToPoint - ritterRadius;\r\n ritterCenter.x =\r\n (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /\r\n oldCenterToPoint;\r\n ritterCenter.y =\r\n (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /\r\n oldCenterToPoint;\r\n ritterCenter.z =\r\n (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /\r\n oldCenterToPoint;\r\n }\r\n }\r\n\r\n if (ritterRadius < naiveRadius) {\r\n Cartesian3.clone(ritterCenter, result.center);\r\n result.radius = ritterRadius;\r\n } else {\r\n Cartesian3.clone(naiveCenter, result.center);\r\n result.radius = naiveRadius;\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a tight-fitting bounding sphere enclosing a list of EncodedCartesian3s, where the points are\r\n * stored in parallel flat arrays in X, Y, Z, order. The bounding sphere is computed by running two\r\n * algorithms, a naive algorithm and Ritter's algorithm. The smaller of the two spheres is used to\r\n * ensure a tight fit.\r\n *\r\n * @param {Number[]} [positionsHigh] An array of high bits of the encoded cartesians that the bounding sphere will enclose. Each point\r\n * is formed from three elements in the array in the order X, Y, Z.\r\n * @param {Number[]} [positionsLow] An array of low bits of the encoded cartesians that the bounding sphere will enclose. Each point\r\n * is formed from three elements in the array in the order X, Y, Z.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\r\n *\r\n * @see {@link http://blogs.agi.com/insight3d/index.php/2008/02/04/a-bounding/|Bounding Sphere computation article}\r\n */\r\nBoundingSphere.fromEncodedCartesianVertices = function (\r\n positionsHigh,\r\n positionsLow,\r\n result\r\n) {\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n if (\r\n !defined(positionsHigh) ||\r\n !defined(positionsLow) ||\r\n positionsHigh.length !== positionsLow.length ||\r\n positionsHigh.length === 0\r\n ) {\r\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\r\n result.radius = 0.0;\r\n return result;\r\n }\r\n\r\n const currentPos = fromPointsCurrentPos;\r\n currentPos.x = positionsHigh[0] + positionsLow[0];\r\n currentPos.y = positionsHigh[1] + positionsLow[1];\r\n currentPos.z = positionsHigh[2] + positionsLow[2];\r\n\r\n const xMin = Cartesian3.clone(currentPos, fromPointsXMin);\r\n const yMin = Cartesian3.clone(currentPos, fromPointsYMin);\r\n const zMin = Cartesian3.clone(currentPos, fromPointsZMin);\r\n\r\n const xMax = Cartesian3.clone(currentPos, fromPointsXMax);\r\n const yMax = Cartesian3.clone(currentPos, fromPointsYMax);\r\n const zMax = Cartesian3.clone(currentPos, fromPointsZMax);\r\n\r\n const numElements = positionsHigh.length;\r\n let i;\r\n for (i = 0; i < numElements; i += 3) {\r\n const x = positionsHigh[i] + positionsLow[i];\r\n const y = positionsHigh[i + 1] + positionsLow[i + 1];\r\n const z = positionsHigh[i + 2] + positionsLow[i + 2];\r\n\r\n currentPos.x = x;\r\n currentPos.y = y;\r\n currentPos.z = z;\r\n\r\n // Store points containing the the smallest and largest components\r\n if (x < xMin.x) {\r\n Cartesian3.clone(currentPos, xMin);\r\n }\r\n\r\n if (x > xMax.x) {\r\n Cartesian3.clone(currentPos, xMax);\r\n }\r\n\r\n if (y < yMin.y) {\r\n Cartesian3.clone(currentPos, yMin);\r\n }\r\n\r\n if (y > yMax.y) {\r\n Cartesian3.clone(currentPos, yMax);\r\n }\r\n\r\n if (z < zMin.z) {\r\n Cartesian3.clone(currentPos, zMin);\r\n }\r\n\r\n if (z > zMax.z) {\r\n Cartesian3.clone(currentPos, zMax);\r\n }\r\n }\r\n\r\n // Compute x-, y-, and z-spans (Squared distances b/n each component's min. and max.).\r\n const xSpan = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(xMax, xMin, fromPointsScratch)\r\n );\r\n const ySpan = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(yMax, yMin, fromPointsScratch)\r\n );\r\n const zSpan = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(zMax, zMin, fromPointsScratch)\r\n );\r\n\r\n // Set the diameter endpoints to the largest span.\r\n let diameter1 = xMin;\r\n let diameter2 = xMax;\r\n let maxSpan = xSpan;\r\n if (ySpan > maxSpan) {\r\n maxSpan = ySpan;\r\n diameter1 = yMin;\r\n diameter2 = yMax;\r\n }\r\n if (zSpan > maxSpan) {\r\n maxSpan = zSpan;\r\n diameter1 = zMin;\r\n diameter2 = zMax;\r\n }\r\n\r\n // Calculate the center of the initial sphere found by Ritter's algorithm\r\n const ritterCenter = fromPointsRitterCenter;\r\n ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;\r\n ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;\r\n ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;\r\n\r\n // Calculate the radius of the initial sphere found by Ritter's algorithm\r\n let radiusSquared = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(diameter2, ritterCenter, fromPointsScratch)\r\n );\r\n let ritterRadius = Math.sqrt(radiusSquared);\r\n\r\n // Find the center of the sphere found using the Naive method.\r\n const minBoxPt = fromPointsMinBoxPt;\r\n minBoxPt.x = xMin.x;\r\n minBoxPt.y = yMin.y;\r\n minBoxPt.z = zMin.z;\r\n\r\n const maxBoxPt = fromPointsMaxBoxPt;\r\n maxBoxPt.x = xMax.x;\r\n maxBoxPt.y = yMax.y;\r\n maxBoxPt.z = zMax.z;\r\n\r\n const naiveCenter = Cartesian3.midpoint(\r\n minBoxPt,\r\n maxBoxPt,\r\n fromPointsNaiveCenterScratch\r\n );\r\n\r\n // Begin 2nd pass to find naive radius and modify the ritter sphere.\r\n let naiveRadius = 0;\r\n for (i = 0; i < numElements; i += 3) {\r\n currentPos.x = positionsHigh[i] + positionsLow[i];\r\n currentPos.y = positionsHigh[i + 1] + positionsLow[i + 1];\r\n currentPos.z = positionsHigh[i + 2] + positionsLow[i + 2];\r\n\r\n // Find the furthest point from the naive center to calculate the naive radius.\r\n const r = Cartesian3.magnitude(\r\n Cartesian3.subtract(currentPos, naiveCenter, fromPointsScratch)\r\n );\r\n if (r > naiveRadius) {\r\n naiveRadius = r;\r\n }\r\n\r\n // Make adjustments to the Ritter Sphere to include all points.\r\n const oldCenterToPointSquared = Cartesian3.magnitudeSquared(\r\n Cartesian3.subtract(currentPos, ritterCenter, fromPointsScratch)\r\n );\r\n if (oldCenterToPointSquared > radiusSquared) {\r\n const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);\r\n // Calculate new radius to include the point that lies outside\r\n ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;\r\n radiusSquared = ritterRadius * ritterRadius;\r\n // Calculate center of new Ritter sphere\r\n const oldToNew = oldCenterToPoint - ritterRadius;\r\n ritterCenter.x =\r\n (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) /\r\n oldCenterToPoint;\r\n ritterCenter.y =\r\n (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) /\r\n oldCenterToPoint;\r\n ritterCenter.z =\r\n (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) /\r\n oldCenterToPoint;\r\n }\r\n }\r\n\r\n if (ritterRadius < naiveRadius) {\r\n Cartesian3.clone(ritterCenter, result.center);\r\n result.radius = ritterRadius;\r\n } else {\r\n Cartesian3.clone(naiveCenter, result.center);\r\n result.radius = naiveRadius;\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes a bounding sphere from the corner points of an axis-aligned bounding box. The sphere\r\n * tightly and fully encompasses the box.\r\n *\r\n * @param {Cartesian3} [corner] The minimum height over the rectangle.\r\n * @param {Cartesian3} [oppositeCorner] The maximum height over the rectangle.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n *\r\n * @example\r\n * // Create a bounding sphere around the unit cube\r\n * const sphere = Cesium.BoundingSphere.fromCornerPoints(new Cesium.Cartesian3(-0.5, -0.5, -0.5), new Cesium.Cartesian3(0.5, 0.5, 0.5));\r\n */\r\nBoundingSphere.fromCornerPoints = function (corner, oppositeCorner, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"corner\", corner);\r\n Check.typeOf.object(\"oppositeCorner\", oppositeCorner);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n const center = Cartesian3.midpoint(corner, oppositeCorner, result.center);\r\n result.radius = Cartesian3.distance(center, oppositeCorner);\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a bounding sphere encompassing an ellipsoid.\r\n *\r\n * @param {Ellipsoid} ellipsoid The ellipsoid around which to create a bounding sphere.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n *\r\n * @example\r\n * const boundingSphere = Cesium.BoundingSphere.fromEllipsoid(ellipsoid);\r\n */\r\nBoundingSphere.fromEllipsoid = function (ellipsoid, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"ellipsoid\", ellipsoid);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n Cartesian3.clone(Cartesian3.ZERO, result.center);\r\n result.radius = ellipsoid.maximumRadius;\r\n return result;\r\n};\r\n\r\nconst fromBoundingSpheresScratch = new Cartesian3();\r\n\r\n/**\r\n * Computes a tight-fitting bounding sphere enclosing the provided array of bounding spheres.\r\n *\r\n * @param {BoundingSphere[]} [boundingSpheres] The array of bounding spheres.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.fromBoundingSpheres = function (boundingSpheres, result) {\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n if (!defined(boundingSpheres) || boundingSpheres.length === 0) {\r\n result.center = Cartesian3.clone(Cartesian3.ZERO, result.center);\r\n result.radius = 0.0;\r\n return result;\r\n }\r\n\r\n const length = boundingSpheres.length;\r\n if (length === 1) {\r\n return BoundingSphere.clone(boundingSpheres[0], result);\r\n }\r\n\r\n if (length === 2) {\r\n return BoundingSphere.union(boundingSpheres[0], boundingSpheres[1], result);\r\n }\r\n\r\n const positions = [];\r\n let i;\r\n for (i = 0; i < length; i++) {\r\n positions.push(boundingSpheres[i].center);\r\n }\r\n\r\n result = BoundingSphere.fromPoints(positions, result);\r\n\r\n const center = result.center;\r\n let radius = result.radius;\r\n for (i = 0; i < length; i++) {\r\n const tmp = boundingSpheres[i];\r\n radius = Math.max(\r\n radius,\r\n Cartesian3.distance(center, tmp.center, fromBoundingSpheresScratch) +\r\n tmp.radius\r\n );\r\n }\r\n result.radius = radius;\r\n\r\n return result;\r\n};\r\n\r\nconst fromOrientedBoundingBoxScratchU = new Cartesian3();\r\nconst fromOrientedBoundingBoxScratchV = new Cartesian3();\r\nconst fromOrientedBoundingBoxScratchW = new Cartesian3();\r\n\r\n/**\r\n * Computes a tight-fitting bounding sphere enclosing the provided oriented bounding box.\r\n *\r\n * @param {OrientedBoundingBox} orientedBoundingBox The oriented bounding box.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.fromOrientedBoundingBox = function (\r\n orientedBoundingBox,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"orientedBoundingBox\", orientedBoundingBox);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n const halfAxes = orientedBoundingBox.halfAxes;\r\n const u = Matrix3.getColumn(halfAxes, 0, fromOrientedBoundingBoxScratchU);\r\n const v = Matrix3.getColumn(halfAxes, 1, fromOrientedBoundingBoxScratchV);\r\n const w = Matrix3.getColumn(halfAxes, 2, fromOrientedBoundingBoxScratchW);\r\n\r\n Cartesian3.add(u, v, u);\r\n Cartesian3.add(u, w, u);\r\n\r\n result.center = Cartesian3.clone(orientedBoundingBox.center, result.center);\r\n result.radius = Cartesian3.magnitude(u);\r\n\r\n return result;\r\n};\r\n\r\nconst scratchFromTransformationCenter = new Cartesian3();\r\nconst scratchFromTransformationScale = new Cartesian3();\r\n\r\n/**\r\n * Computes a tight-fitting bounding sphere enclosing the provided affine transformation.\r\n *\r\n * @param {Matrix4} transformation The affine transformation.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.fromTransformation = function (transformation, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"transformation\", transformation);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n const center = Matrix4.getTranslation(\r\n transformation,\r\n scratchFromTransformationCenter\r\n );\r\n const scale = Matrix4.getScale(\r\n transformation,\r\n scratchFromTransformationScale\r\n );\r\n const radius = 0.5 * Cartesian3.magnitude(scale);\r\n result.center = Cartesian3.clone(center, result.center);\r\n result.radius = radius;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a BoundingSphere instance.\r\n *\r\n * @param {BoundingSphere} sphere The bounding sphere to duplicate.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided. (Returns undefined if sphere is undefined)\r\n */\r\nBoundingSphere.clone = function (sphere, result) {\r\n if (!defined(sphere)) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new BoundingSphere(sphere.center, sphere.radius);\r\n }\r\n\r\n result.center = Cartesian3.clone(sphere.center, result.center);\r\n result.radius = sphere.radius;\r\n return result;\r\n};\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nBoundingSphere.packedLength = 4;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {BoundingSphere} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nBoundingSphere.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const center = value.center;\r\n array[startingIndex++] = center.x;\r\n array[startingIndex++] = center.y;\r\n array[startingIndex++] = center.z;\r\n array[startingIndex] = value.radius;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {BoundingSphere} [result] The object into which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if one was not provided.\r\n */\r\nBoundingSphere.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n const center = result.center;\r\n center.x = array[startingIndex++];\r\n center.y = array[startingIndex++];\r\n center.z = array[startingIndex++];\r\n result.radius = array[startingIndex];\r\n return result;\r\n};\r\n\r\nconst unionScratch = new Cartesian3();\r\nconst unionScratchCenter = new Cartesian3();\r\n/**\r\n * Computes a bounding sphere that contains both the left and right bounding spheres.\r\n *\r\n * @param {BoundingSphere} left A sphere to enclose in a bounding sphere.\r\n * @param {BoundingSphere} right A sphere to enclose in a bounding sphere.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.union = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n const leftCenter = left.center;\r\n const leftRadius = left.radius;\r\n const rightCenter = right.center;\r\n const rightRadius = right.radius;\r\n\r\n const toRightCenter = Cartesian3.subtract(\r\n rightCenter,\r\n leftCenter,\r\n unionScratch\r\n );\r\n const centerSeparation = Cartesian3.magnitude(toRightCenter);\r\n\r\n if (leftRadius >= centerSeparation + rightRadius) {\r\n // Left sphere wins.\r\n left.clone(result);\r\n return result;\r\n }\r\n\r\n if (rightRadius >= centerSeparation + leftRadius) {\r\n // Right sphere wins.\r\n right.clone(result);\r\n return result;\r\n }\r\n\r\n // There are two tangent points, one on far side of each sphere.\r\n const halfDistanceBetweenTangentPoints =\r\n (leftRadius + centerSeparation + rightRadius) * 0.5;\r\n\r\n // Compute the center point halfway between the two tangent points.\r\n const center = Cartesian3.multiplyByScalar(\r\n toRightCenter,\r\n (-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation,\r\n unionScratchCenter\r\n );\r\n Cartesian3.add(center, leftCenter, center);\r\n Cartesian3.clone(center, result.center);\r\n result.radius = halfDistanceBetweenTangentPoints;\r\n\r\n return result;\r\n};\r\n\r\nconst expandScratch = new Cartesian3();\r\n/**\r\n * Computes a bounding sphere by enlarging the provided sphere to contain the provided point.\r\n *\r\n * @param {BoundingSphere} sphere A sphere to expand.\r\n * @param {Cartesian3} point A point to enclose in a bounding sphere.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.expand = function (sphere, point, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"sphere\", sphere);\r\n Check.typeOf.object(\"point\", point);\r\n //>>includeEnd('debug');\r\n\r\n result = BoundingSphere.clone(sphere, result);\r\n\r\n const radius = Cartesian3.magnitude(\r\n Cartesian3.subtract(point, result.center, expandScratch)\r\n );\r\n if (radius > result.radius) {\r\n result.radius = radius;\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Determines which side of a plane a sphere is located.\r\n *\r\n * @param {BoundingSphere} sphere The bounding sphere to test.\r\n * @param {Plane} plane The plane to test against.\r\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane\r\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is\r\n * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere\r\n * intersects the plane.\r\n */\r\nBoundingSphere.intersectPlane = function (sphere, plane) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"sphere\", sphere);\r\n Check.typeOf.object(\"plane\", plane);\r\n //>>includeEnd('debug');\r\n\r\n const center = sphere.center;\r\n const radius = sphere.radius;\r\n const normal = plane.normal;\r\n const distanceToPlane = Cartesian3.dot(normal, center) + plane.distance;\r\n\r\n if (distanceToPlane < -radius) {\r\n // The center point is negative side of the plane normal\r\n return Intersect.OUTSIDE;\r\n } else if (distanceToPlane < radius) {\r\n // The center point is positive side of the plane, but radius extends beyond it; partial overlap\r\n return Intersect.INTERSECTING;\r\n }\r\n return Intersect.INSIDE;\r\n};\r\n\r\n/**\r\n * Applies a 4x4 affine transformation matrix to a bounding sphere.\r\n *\r\n * @param {BoundingSphere} sphere The bounding sphere to apply the transformation to.\r\n * @param {Matrix4} transform The transformation matrix to apply to the bounding sphere.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.transform = function (sphere, transform, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"sphere\", sphere);\r\n Check.typeOf.object(\"transform\", transform);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n result.center = Matrix4.multiplyByPoint(\r\n transform,\r\n sphere.center,\r\n result.center\r\n );\r\n result.radius = Matrix4.getMaximumScale(transform) * sphere.radius;\r\n\r\n return result;\r\n};\r\n\r\nconst distanceSquaredToScratch = new Cartesian3();\r\n\r\n/**\r\n * Computes the estimated distance squared from the closest point on a bounding sphere to a point.\r\n *\r\n * @param {BoundingSphere} sphere The sphere.\r\n * @param {Cartesian3} cartesian The point\r\n * @returns {Number} The distance squared from the bounding sphere to the point. Returns 0 if the point is inside the sphere.\r\n *\r\n * @example\r\n * // Sort bounding spheres from back to front\r\n * spheres.sort(function(a, b) {\r\n * return Cesium.BoundingSphere.distanceSquaredTo(b, camera.positionWC) - Cesium.BoundingSphere.distanceSquaredTo(a, camera.positionWC);\r\n * });\r\n */\r\nBoundingSphere.distanceSquaredTo = function (sphere, cartesian) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"sphere\", sphere);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n //>>includeEnd('debug');\r\n\r\n const diff = Cartesian3.subtract(\r\n sphere.center,\r\n cartesian,\r\n distanceSquaredToScratch\r\n );\r\n\r\n const distance = Cartesian3.magnitude(diff) - sphere.radius;\r\n if (distance <= 0.0) {\r\n return 0.0;\r\n }\r\n\r\n return distance * distance;\r\n};\r\n\r\n/**\r\n * Applies a 4x4 affine transformation matrix to a bounding sphere where there is no scale\r\n * The transformation matrix is not verified to have a uniform scale of 1.\r\n * This method is faster than computing the general bounding sphere transform using {@link BoundingSphere.transform}.\r\n *\r\n * @param {BoundingSphere} sphere The bounding sphere to apply the transformation to.\r\n * @param {Matrix4} transform The transformation matrix to apply to the bounding sphere.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n *\r\n * @example\r\n * const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(positionOnEllipsoid);\r\n * const boundingSphere = new Cesium.BoundingSphere();\r\n * const newBoundingSphere = Cesium.BoundingSphere.transformWithoutScale(boundingSphere, modelMatrix);\r\n */\r\nBoundingSphere.transformWithoutScale = function (sphere, transform, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"sphere\", sphere);\r\n Check.typeOf.object(\"transform\", transform);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new BoundingSphere();\r\n }\r\n\r\n result.center = Matrix4.multiplyByPoint(\r\n transform,\r\n sphere.center,\r\n result.center\r\n );\r\n result.radius = sphere.radius;\r\n\r\n return result;\r\n};\r\n\r\nconst scratchCartesian3 = new Cartesian3();\r\n/**\r\n * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction\r\n * plus/minus the radius of the bounding sphere.\r\n *
\r\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\r\n * closest and farthest planes from position that intersect the bounding sphere.\r\n *\r\n * @param {BoundingSphere} sphere The bounding sphere to calculate the distance to.\r\n * @param {Cartesian3} position The position to calculate the distance from.\r\n * @param {Cartesian3} direction The direction from position.\r\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\r\n * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction.\r\n */\r\nBoundingSphere.computePlaneDistances = function (\r\n sphere,\r\n position,\r\n direction,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"sphere\", sphere);\r\n Check.typeOf.object(\"position\", position);\r\n Check.typeOf.object(\"direction\", direction);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Interval();\r\n }\r\n\r\n const toCenter = Cartesian3.subtract(\r\n sphere.center,\r\n position,\r\n scratchCartesian3\r\n );\r\n const mag = Cartesian3.dot(direction, toCenter);\r\n\r\n result.start = mag - sphere.radius;\r\n result.stop = mag + sphere.radius;\r\n return result;\r\n};\r\n\r\nconst projectTo2DNormalScratch = new Cartesian3();\r\nconst projectTo2DEastScratch = new Cartesian3();\r\nconst projectTo2DNorthScratch = new Cartesian3();\r\nconst projectTo2DWestScratch = new Cartesian3();\r\nconst projectTo2DSouthScratch = new Cartesian3();\r\nconst projectTo2DCartographicScratch = new Cartographic();\r\nconst projectTo2DPositionsScratch = new Array(8);\r\nfor (let n = 0; n < 8; ++n) {\r\n projectTo2DPositionsScratch[n] = new Cartesian3();\r\n}\r\n\r\nconst projectTo2DProjection = new GeographicProjection();\r\n/**\r\n * Creates a bounding sphere in 2D from a bounding sphere in 3D world coordinates.\r\n *\r\n * @param {BoundingSphere} sphere The bounding sphere to transform to 2D.\r\n * @param {Object} [projection=GeographicProjection] The projection to 2D.\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.projectTo2D = function (sphere, projection, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"sphere\", sphere);\r\n //>>includeEnd('debug');\r\n\r\n projection = defaultValue(projection, projectTo2DProjection);\r\n\r\n const ellipsoid = projection.ellipsoid;\r\n let center = sphere.center;\r\n const radius = sphere.radius;\r\n\r\n let normal;\r\n if (Cartesian3.equals(center, Cartesian3.ZERO)) {\r\n // Bounding sphere is at the center. The geodetic surface normal is not\r\n // defined here so pick the x-axis as a fallback.\r\n normal = Cartesian3.clone(Cartesian3.UNIT_X, projectTo2DNormalScratch);\r\n } else {\r\n normal = ellipsoid.geodeticSurfaceNormal(center, projectTo2DNormalScratch);\r\n }\r\n const east = Cartesian3.cross(\r\n Cartesian3.UNIT_Z,\r\n normal,\r\n projectTo2DEastScratch\r\n );\r\n Cartesian3.normalize(east, east);\r\n const north = Cartesian3.cross(normal, east, projectTo2DNorthScratch);\r\n Cartesian3.normalize(north, north);\r\n\r\n Cartesian3.multiplyByScalar(normal, radius, normal);\r\n Cartesian3.multiplyByScalar(north, radius, north);\r\n Cartesian3.multiplyByScalar(east, radius, east);\r\n\r\n const south = Cartesian3.negate(north, projectTo2DSouthScratch);\r\n const west = Cartesian3.negate(east, projectTo2DWestScratch);\r\n\r\n const positions = projectTo2DPositionsScratch;\r\n\r\n // top NE corner\r\n let corner = positions[0];\r\n Cartesian3.add(normal, north, corner);\r\n Cartesian3.add(corner, east, corner);\r\n\r\n // top NW corner\r\n corner = positions[1];\r\n Cartesian3.add(normal, north, corner);\r\n Cartesian3.add(corner, west, corner);\r\n\r\n // top SW corner\r\n corner = positions[2];\r\n Cartesian3.add(normal, south, corner);\r\n Cartesian3.add(corner, west, corner);\r\n\r\n // top SE corner\r\n corner = positions[3];\r\n Cartesian3.add(normal, south, corner);\r\n Cartesian3.add(corner, east, corner);\r\n\r\n Cartesian3.negate(normal, normal);\r\n\r\n // bottom NE corner\r\n corner = positions[4];\r\n Cartesian3.add(normal, north, corner);\r\n Cartesian3.add(corner, east, corner);\r\n\r\n // bottom NW corner\r\n corner = positions[5];\r\n Cartesian3.add(normal, north, corner);\r\n Cartesian3.add(corner, west, corner);\r\n\r\n // bottom SW corner\r\n corner = positions[6];\r\n Cartesian3.add(normal, south, corner);\r\n Cartesian3.add(corner, west, corner);\r\n\r\n // bottom SE corner\r\n corner = positions[7];\r\n Cartesian3.add(normal, south, corner);\r\n Cartesian3.add(corner, east, corner);\r\n\r\n const length = positions.length;\r\n for (let i = 0; i < length; ++i) {\r\n const position = positions[i];\r\n Cartesian3.add(center, position, position);\r\n const cartographic = ellipsoid.cartesianToCartographic(\r\n position,\r\n projectTo2DCartographicScratch\r\n );\r\n projection.project(cartographic, position);\r\n }\r\n\r\n result = BoundingSphere.fromPoints(positions, result);\r\n\r\n // swizzle center components\r\n center = result.center;\r\n const x = center.x;\r\n const y = center.y;\r\n const z = center.z;\r\n center.x = z;\r\n center.y = x;\r\n center.z = y;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Determines whether or not a sphere is hidden from view by the occluder.\r\n *\r\n * @param {BoundingSphere} sphere The bounding sphere surrounding the occludee object.\r\n * @param {Occluder} occluder The occluder.\r\n * @returns {Boolean} true
if the sphere is not visible; otherwise false
.\r\n */\r\nBoundingSphere.isOccluded = function (sphere, occluder) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"sphere\", sphere);\r\n Check.typeOf.object(\"occluder\", occluder);\r\n //>>includeEnd('debug');\r\n return !occluder.isBoundingSphereVisible(sphere);\r\n};\r\n\r\n/**\r\n * Compares the provided BoundingSphere componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {BoundingSphere} [left] The first BoundingSphere.\r\n * @param {BoundingSphere} [right] The second BoundingSphere.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nBoundingSphere.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n Cartesian3.equals(left.center, right.center) &&\r\n left.radius === right.radius)\r\n );\r\n};\r\n\r\n/**\r\n * Determines which side of a plane the sphere is located.\r\n *\r\n * @param {Plane} plane The plane to test against.\r\n * @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane\r\n * the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is\r\n * on the opposite side, and {@link Intersect.INTERSECTING} if the sphere\r\n * intersects the plane.\r\n */\r\nBoundingSphere.prototype.intersectPlane = function (plane) {\r\n return BoundingSphere.intersectPlane(this, plane);\r\n};\r\n\r\n/**\r\n * Computes the estimated distance squared from the closest point on a bounding sphere to a point.\r\n *\r\n * @param {Cartesian3} cartesian The point\r\n * @returns {Number} The estimated distance squared from the bounding sphere to the point.\r\n *\r\n * @example\r\n * // Sort bounding spheres from back to front\r\n * spheres.sort(function(a, b) {\r\n * return b.distanceSquaredTo(camera.positionWC) - a.distanceSquaredTo(camera.positionWC);\r\n * });\r\n */\r\nBoundingSphere.prototype.distanceSquaredTo = function (cartesian) {\r\n return BoundingSphere.distanceSquaredTo(this, cartesian);\r\n};\r\n\r\n/**\r\n * The distances calculated by the vector from the center of the bounding sphere to position projected onto direction\r\n * plus/minus the radius of the bounding sphere.\r\n *
\r\n * If you imagine the infinite number of planes with normal direction, this computes the smallest distance to the\r\n * closest and farthest planes from position that intersect the bounding sphere.\r\n *\r\n * @param {Cartesian3} position The position to calculate the distance from.\r\n * @param {Cartesian3} direction The direction from position.\r\n * @param {Interval} [result] A Interval to store the nearest and farthest distances.\r\n * @returns {Interval} The nearest and farthest distances on the bounding sphere from position in direction.\r\n */\r\nBoundingSphere.prototype.computePlaneDistances = function (\r\n position,\r\n direction,\r\n result\r\n) {\r\n return BoundingSphere.computePlaneDistances(\r\n this,\r\n position,\r\n direction,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Determines whether or not a sphere is hidden from view by the occluder.\r\n *\r\n * @param {Occluder} occluder The occluder.\r\n * @returns {Boolean} true
if the sphere is not visible; otherwise false
.\r\n */\r\nBoundingSphere.prototype.isOccluded = function (occluder) {\r\n return BoundingSphere.isOccluded(this, occluder);\r\n};\r\n\r\n/**\r\n * Compares this BoundingSphere against the provided BoundingSphere componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {BoundingSphere} [right] The right hand side BoundingSphere.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nBoundingSphere.prototype.equals = function (right) {\r\n return BoundingSphere.equals(this, right);\r\n};\r\n\r\n/**\r\n * Duplicates this BoundingSphere instance.\r\n *\r\n * @param {BoundingSphere} [result] The object onto which to store the result.\r\n * @returns {BoundingSphere} The modified result parameter or a new BoundingSphere instance if none was provided.\r\n */\r\nBoundingSphere.prototype.clone = function (result) {\r\n return BoundingSphere.clone(this, result);\r\n};\r\n\r\n/**\r\n * Computes the radius of the BoundingSphere.\r\n * @returns {Number} The radius of the BoundingSphere.\r\n */\r\nBoundingSphere.prototype.volume = function () {\r\n const radius = this.radius;\r\n return volumeConstant * radius * radius * radius;\r\n};\r\nexport default BoundingSphere;\r\n","import defined from \"./defined.js\";\r\n\r\nlet _supportsFullscreen;\r\nconst _names = {\r\n requestFullscreen: undefined,\r\n exitFullscreen: undefined,\r\n fullscreenEnabled: undefined,\r\n fullscreenElement: undefined,\r\n fullscreenchange: undefined,\r\n fullscreenerror: undefined,\r\n};\r\n\r\n/**\r\n * Browser-independent functions for working with the standard fullscreen API.\r\n *\r\n * @namespace Fullscreen\r\n *\r\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\r\n */\r\nconst Fullscreen = {};\r\n\r\nObject.defineProperties(Fullscreen, {\r\n /**\r\n * The element that is currently fullscreen, if any. To simply check if the\r\n * browser is in fullscreen mode or not, use {@link Fullscreen#fullscreen}.\r\n * @memberof Fullscreen\r\n * @type {Object}\r\n * @readonly\r\n */\r\n element: {\r\n get: function () {\r\n if (!Fullscreen.supportsFullscreen()) {\r\n return undefined;\r\n }\r\n\r\n return document[_names.fullscreenElement];\r\n },\r\n },\r\n\r\n /**\r\n * The name of the event on the document that is fired when fullscreen is\r\n * entered or exited. This event name is intended for use with addEventListener.\r\n * In your event handler, to determine if the browser is in fullscreen mode or not,\r\n * use {@link Fullscreen#fullscreen}.\r\n * @memberof Fullscreen\r\n * @type {String}\r\n * @readonly\r\n */\r\n changeEventName: {\r\n get: function () {\r\n if (!Fullscreen.supportsFullscreen()) {\r\n return undefined;\r\n }\r\n\r\n return _names.fullscreenchange;\r\n },\r\n },\r\n\r\n /**\r\n * The name of the event that is fired when a fullscreen error\r\n * occurs. This event name is intended for use with addEventListener.\r\n * @memberof Fullscreen\r\n * @type {String}\r\n * @readonly\r\n */\r\n errorEventName: {\r\n get: function () {\r\n if (!Fullscreen.supportsFullscreen()) {\r\n return undefined;\r\n }\r\n\r\n return _names.fullscreenerror;\r\n },\r\n },\r\n\r\n /**\r\n * Determine whether the browser will allow an element to be made fullscreen, or not.\r\n * For example, by default, iframes cannot go fullscreen unless the containing page\r\n * adds an \"allowfullscreen\" attribute (or prefixed equivalent).\r\n * @memberof Fullscreen\r\n * @type {Boolean}\r\n * @readonly\r\n */\r\n enabled: {\r\n get: function () {\r\n if (!Fullscreen.supportsFullscreen()) {\r\n return undefined;\r\n }\r\n\r\n return document[_names.fullscreenEnabled];\r\n },\r\n },\r\n\r\n /**\r\n * Determines if the browser is currently in fullscreen mode.\r\n * @memberof Fullscreen\r\n * @type {Boolean}\r\n * @readonly\r\n */\r\n fullscreen: {\r\n get: function () {\r\n if (!Fullscreen.supportsFullscreen()) {\r\n return undefined;\r\n }\r\n\r\n return Fullscreen.element !== null;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Detects whether the browser supports the standard fullscreen API.\r\n *\r\n * @returns {Boolean} true
if the browser supports the standard fullscreen API,\r\n * false
otherwise.\r\n */\r\nFullscreen.supportsFullscreen = function () {\r\n if (defined(_supportsFullscreen)) {\r\n return _supportsFullscreen;\r\n }\r\n\r\n _supportsFullscreen = false;\r\n\r\n const body = document.body;\r\n if (typeof body.requestFullscreen === \"function\") {\r\n // go with the unprefixed, standard set of names\r\n _names.requestFullscreen = \"requestFullscreen\";\r\n _names.exitFullscreen = \"exitFullscreen\";\r\n _names.fullscreenEnabled = \"fullscreenEnabled\";\r\n _names.fullscreenElement = \"fullscreenElement\";\r\n _names.fullscreenchange = \"fullscreenchange\";\r\n _names.fullscreenerror = \"fullscreenerror\";\r\n _supportsFullscreen = true;\r\n return _supportsFullscreen;\r\n }\r\n\r\n //check for the correct combination of prefix plus the various names that browsers use\r\n const prefixes = [\"webkit\", \"moz\", \"o\", \"ms\", \"khtml\"];\r\n let name;\r\n for (let i = 0, len = prefixes.length; i < len; ++i) {\r\n const prefix = prefixes[i];\r\n\r\n // casing of Fullscreen differs across browsers\r\n name = `${prefix}RequestFullscreen`;\r\n if (typeof body[name] === \"function\") {\r\n _names.requestFullscreen = name;\r\n _supportsFullscreen = true;\r\n } else {\r\n name = `${prefix}RequestFullScreen`;\r\n if (typeof body[name] === \"function\") {\r\n _names.requestFullscreen = name;\r\n _supportsFullscreen = true;\r\n }\r\n }\r\n\r\n // disagreement about whether it's \"exit\" as per spec, or \"cancel\"\r\n name = `${prefix}ExitFullscreen`;\r\n if (typeof document[name] === \"function\") {\r\n _names.exitFullscreen = name;\r\n } else {\r\n name = `${prefix}CancelFullScreen`;\r\n if (typeof document[name] === \"function\") {\r\n _names.exitFullscreen = name;\r\n }\r\n }\r\n\r\n // casing of Fullscreen differs across browsers\r\n name = `${prefix}FullscreenEnabled`;\r\n if (document[name] !== undefined) {\r\n _names.fullscreenEnabled = name;\r\n } else {\r\n name = `${prefix}FullScreenEnabled`;\r\n if (document[name] !== undefined) {\r\n _names.fullscreenEnabled = name;\r\n }\r\n }\r\n\r\n // casing of Fullscreen differs across browsers\r\n name = `${prefix}FullscreenElement`;\r\n if (document[name] !== undefined) {\r\n _names.fullscreenElement = name;\r\n } else {\r\n name = `${prefix}FullScreenElement`;\r\n if (document[name] !== undefined) {\r\n _names.fullscreenElement = name;\r\n }\r\n }\r\n\r\n // thankfully, event names are all lowercase per spec\r\n name = `${prefix}fullscreenchange`;\r\n // event names do not have 'on' in the front, but the property on the document does\r\n if (document[`on${name}`] !== undefined) {\r\n //except on IE\r\n if (prefix === \"ms\") {\r\n name = \"MSFullscreenChange\";\r\n }\r\n _names.fullscreenchange = name;\r\n }\r\n\r\n name = `${prefix}fullscreenerror`;\r\n if (document[`on${name}`] !== undefined) {\r\n //except on IE\r\n if (prefix === \"ms\") {\r\n name = \"MSFullscreenError\";\r\n }\r\n _names.fullscreenerror = name;\r\n }\r\n }\r\n\r\n return _supportsFullscreen;\r\n};\r\n\r\n/**\r\n * Asynchronously requests the browser to enter fullscreen mode on the given element.\r\n * If fullscreen mode is not supported by the browser, does nothing.\r\n *\r\n * @param {Object} element The HTML element which will be placed into fullscreen mode.\r\n * @param {Object} [vrDevice] The HMDVRDevice device.\r\n *\r\n * @example\r\n * // Put the entire page into fullscreen.\r\n * Cesium.Fullscreen.requestFullscreen(document.body)\r\n *\r\n * // Place only the Cesium canvas into fullscreen.\r\n * Cesium.Fullscreen.requestFullscreen(scene.canvas)\r\n */\r\nFullscreen.requestFullscreen = function (element, vrDevice) {\r\n if (!Fullscreen.supportsFullscreen()) {\r\n return;\r\n }\r\n\r\n element[_names.requestFullscreen]({ vrDisplay: vrDevice });\r\n};\r\n\r\n/**\r\n * Asynchronously exits fullscreen mode. If the browser is not currently\r\n * in fullscreen, or if fullscreen mode is not supported by the browser, does nothing.\r\n */\r\nFullscreen.exitFullscreen = function () {\r\n if (!Fullscreen.supportsFullscreen()) {\r\n return;\r\n }\r\n\r\n document[_names.exitFullscreen]();\r\n};\r\n\r\n//For unit tests\r\nFullscreen._names = _names;\r\nexport default Fullscreen;\r\n","import defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Fullscreen from \"./Fullscreen.js\";\r\n\r\nlet theNavigator;\r\nif (typeof navigator !== \"undefined\") {\r\n theNavigator = navigator;\r\n} else {\r\n theNavigator = {};\r\n}\r\n\r\nfunction extractVersion(versionString) {\r\n const parts = versionString.split(\".\");\r\n for (let i = 0, len = parts.length; i < len; ++i) {\r\n parts[i] = parseInt(parts[i], 10);\r\n }\r\n return parts;\r\n}\r\n\r\nlet isChromeResult;\r\nlet chromeVersionResult;\r\nfunction isChrome() {\r\n if (!defined(isChromeResult)) {\r\n isChromeResult = false;\r\n // Edge contains Chrome in the user agent too\r\n if (!isEdge()) {\r\n const fields = / Chrome\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\r\n if (fields !== null) {\r\n isChromeResult = true;\r\n chromeVersionResult = extractVersion(fields[1]);\r\n }\r\n }\r\n }\r\n\r\n return isChromeResult;\r\n}\r\n\r\nfunction chromeVersion() {\r\n return isChrome() && chromeVersionResult;\r\n}\r\n\r\nlet isSafariResult;\r\nlet safariVersionResult;\r\nfunction isSafari() {\r\n if (!defined(isSafariResult)) {\r\n isSafariResult = false;\r\n\r\n // Chrome and Edge contain Safari in the user agent too\r\n if (\r\n !isChrome() &&\r\n !isEdge() &&\r\n / Safari\\/[\\.0-9]+/.test(theNavigator.userAgent)\r\n ) {\r\n const fields = / Version\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\r\n if (fields !== null) {\r\n isSafariResult = true;\r\n safariVersionResult = extractVersion(fields[1]);\r\n }\r\n }\r\n }\r\n\r\n return isSafariResult;\r\n}\r\n\r\nfunction safariVersion() {\r\n return isSafari() && safariVersionResult;\r\n}\r\n\r\nlet isWebkitResult;\r\nlet webkitVersionResult;\r\nfunction isWebkit() {\r\n if (!defined(isWebkitResult)) {\r\n isWebkitResult = false;\r\n\r\n const fields = / AppleWebKit\\/([\\.0-9]+)(\\+?)/.exec(theNavigator.userAgent);\r\n if (fields !== null) {\r\n isWebkitResult = true;\r\n webkitVersionResult = extractVersion(fields[1]);\r\n webkitVersionResult.isNightly = !!fields[2];\r\n }\r\n }\r\n\r\n return isWebkitResult;\r\n}\r\n\r\nfunction webkitVersion() {\r\n return isWebkit() && webkitVersionResult;\r\n}\r\n\r\nlet isInternetExplorerResult;\r\nlet internetExplorerVersionResult;\r\nfunction isInternetExplorer() {\r\n if (!defined(isInternetExplorerResult)) {\r\n isInternetExplorerResult = false;\r\n\r\n let fields;\r\n if (theNavigator.appName === \"Microsoft Internet Explorer\") {\r\n fields = /MSIE ([0-9]{1,}[\\.0-9]{0,})/.exec(theNavigator.userAgent);\r\n if (fields !== null) {\r\n isInternetExplorerResult = true;\r\n internetExplorerVersionResult = extractVersion(fields[1]);\r\n }\r\n } else if (theNavigator.appName === \"Netscape\") {\r\n fields = /Trident\\/.*rv:([0-9]{1,}[\\.0-9]{0,})/.exec(\r\n theNavigator.userAgent\r\n );\r\n if (fields !== null) {\r\n isInternetExplorerResult = true;\r\n internetExplorerVersionResult = extractVersion(fields[1]);\r\n }\r\n }\r\n }\r\n return isInternetExplorerResult;\r\n}\r\n\r\nfunction internetExplorerVersion() {\r\n return isInternetExplorer() && internetExplorerVersionResult;\r\n}\r\n\r\nlet isEdgeResult;\r\nlet edgeVersionResult;\r\nfunction isEdge() {\r\n if (!defined(isEdgeResult)) {\r\n isEdgeResult = false;\r\n const fields = / Edg\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\r\n if (fields !== null) {\r\n isEdgeResult = true;\r\n edgeVersionResult = extractVersion(fields[1]);\r\n }\r\n }\r\n return isEdgeResult;\r\n}\r\n\r\nfunction edgeVersion() {\r\n return isEdge() && edgeVersionResult;\r\n}\r\n\r\nlet isFirefoxResult;\r\nlet firefoxVersionResult;\r\nfunction isFirefox() {\r\n if (!defined(isFirefoxResult)) {\r\n isFirefoxResult = false;\r\n\r\n const fields = /Firefox\\/([\\.0-9]+)/.exec(theNavigator.userAgent);\r\n if (fields !== null) {\r\n isFirefoxResult = true;\r\n firefoxVersionResult = extractVersion(fields[1]);\r\n }\r\n }\r\n return isFirefoxResult;\r\n}\r\n\r\nlet isWindowsResult;\r\nfunction isWindows() {\r\n if (!defined(isWindowsResult)) {\r\n isWindowsResult = /Windows/i.test(theNavigator.appVersion);\r\n }\r\n return isWindowsResult;\r\n}\r\n\r\nlet isIPadOrIOSResult;\r\nfunction isIPadOrIOS() {\r\n if (!defined(isIPadOrIOSResult)) {\r\n isIPadOrIOSResult =\r\n navigator.platform === \"iPhone\" ||\r\n navigator.platform === \"iPod\" ||\r\n navigator.platform === \"iPad\";\r\n }\r\n\r\n return isIPadOrIOSResult;\r\n}\r\n\r\nfunction firefoxVersion() {\r\n return isFirefox() && firefoxVersionResult;\r\n}\r\n\r\nlet hasPointerEvents;\r\nfunction supportsPointerEvents() {\r\n if (!defined(hasPointerEvents)) {\r\n //While navigator.pointerEnabled is deprecated in the W3C specification\r\n //we still need to use it if it exists in order to support browsers\r\n //that rely on it, such as the Windows WebBrowser control which defines\r\n //PointerEvent but sets navigator.pointerEnabled to false.\r\n\r\n //Firefox disabled because of https://github.com/CesiumGS/cesium/issues/6372\r\n hasPointerEvents =\r\n !isFirefox() &&\r\n typeof PointerEvent !== \"undefined\" &&\r\n (!defined(theNavigator.pointerEnabled) || theNavigator.pointerEnabled);\r\n }\r\n return hasPointerEvents;\r\n}\r\n\r\nlet imageRenderingValueResult;\r\nlet supportsImageRenderingPixelatedResult;\r\nfunction supportsImageRenderingPixelated() {\r\n if (!defined(supportsImageRenderingPixelatedResult)) {\r\n const canvas = document.createElement(\"canvas\");\r\n canvas.setAttribute(\r\n \"style\",\r\n \"image-rendering: -moz-crisp-edges;\" + \"image-rendering: pixelated;\"\r\n );\r\n //canvas.style.imageRendering will be undefined, null or an empty string on unsupported browsers.\r\n const tmp = canvas.style.imageRendering;\r\n supportsImageRenderingPixelatedResult = defined(tmp) && tmp !== \"\";\r\n if (supportsImageRenderingPixelatedResult) {\r\n imageRenderingValueResult = tmp;\r\n }\r\n }\r\n return supportsImageRenderingPixelatedResult;\r\n}\r\n\r\nfunction imageRenderingValue() {\r\n return supportsImageRenderingPixelated()\r\n ? imageRenderingValueResult\r\n : undefined;\r\n}\r\n\r\nfunction supportsWebP() {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!supportsWebP.initialized) {\r\n throw new DeveloperError(\r\n \"You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n return supportsWebP._result;\r\n}\r\nsupportsWebP._promise = undefined;\r\nsupportsWebP._result = undefined;\r\nsupportsWebP.initialize = function () {\r\n // From https://developers.google.com/speed/webp/faq#how_can_i_detect_browser_support_for_webp\r\n if (defined(supportsWebP._promise)) {\r\n return supportsWebP._promise;\r\n }\r\n\r\n supportsWebP._promise = new Promise((resolve) => {\r\n const image = new Image();\r\n image.onload = function () {\r\n supportsWebP._result = image.width > 0 && image.height > 0;\r\n resolve(supportsWebP._result);\r\n };\r\n\r\n image.onerror = function () {\r\n supportsWebP._result = false;\r\n resolve(supportsWebP._result);\r\n };\r\n image.src =\r\n \"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA\";\r\n });\r\n\r\n return supportsWebP._promise;\r\n};\r\nObject.defineProperties(supportsWebP, {\r\n initialized: {\r\n get: function () {\r\n return defined(supportsWebP._result);\r\n },\r\n },\r\n});\r\n\r\nconst typedArrayTypes = [];\r\nif (typeof ArrayBuffer !== \"undefined\") {\r\n typedArrayTypes.push(\r\n Int8Array,\r\n Uint8Array,\r\n Int16Array,\r\n Uint16Array,\r\n Int32Array,\r\n Uint32Array,\r\n Float32Array,\r\n Float64Array\r\n );\r\n\r\n if (typeof Uint8ClampedArray !== \"undefined\") {\r\n typedArrayTypes.push(Uint8ClampedArray);\r\n }\r\n\r\n if (typeof Uint8ClampedArray !== \"undefined\") {\r\n typedArrayTypes.push(Uint8ClampedArray);\r\n }\r\n\r\n if (typeof BigInt64Array !== \"undefined\") {\r\n // eslint-disable-next-line no-undef\r\n typedArrayTypes.push(BigInt64Array);\r\n }\r\n\r\n if (typeof BigUint64Array !== \"undefined\") {\r\n // eslint-disable-next-line no-undef\r\n typedArrayTypes.push(BigUint64Array);\r\n }\r\n}\r\n\r\n/**\r\n * A set of functions to detect whether the current browser supports\r\n * various features.\r\n *\r\n * @namespace FeatureDetection\r\n */\r\nconst FeatureDetection = {\r\n isChrome: isChrome,\r\n chromeVersion: chromeVersion,\r\n isSafari: isSafari,\r\n safariVersion: safariVersion,\r\n isWebkit: isWebkit,\r\n webkitVersion: webkitVersion,\r\n isInternetExplorer: isInternetExplorer,\r\n internetExplorerVersion: internetExplorerVersion,\r\n isEdge: isEdge,\r\n edgeVersion: edgeVersion,\r\n isFirefox: isFirefox,\r\n firefoxVersion: firefoxVersion,\r\n isWindows: isWindows,\r\n isIPadOrIOS: isIPadOrIOS,\r\n hardwareConcurrency: defaultValue(theNavigator.hardwareConcurrency, 3),\r\n supportsPointerEvents: supportsPointerEvents,\r\n supportsImageRenderingPixelated: supportsImageRenderingPixelated,\r\n supportsWebP: supportsWebP,\r\n imageRenderingValue: imageRenderingValue,\r\n typedArrayTypes: typedArrayTypes,\r\n};\r\n\r\n/**\r\n * Detects whether the current browser supports Basis Universal textures and the web assembly modules needed to transcode them.\r\n *\r\n * @param {Scene} scene\r\n * @returns {Boolean} true if the browser supports web assembly modules and the scene supports Basis Universal textures, false if not.\r\n */\r\nFeatureDetection.supportsBasis = function (scene) {\r\n return FeatureDetection.supportsWebAssembly() && scene.context.supportsBasis;\r\n};\r\n\r\n/**\r\n * Detects whether the current browser supports the full screen standard.\r\n *\r\n * @returns {Boolean} true if the browser supports the full screen standard, false if not.\r\n *\r\n * @see Fullscreen\r\n * @see {@link http://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html|W3C Fullscreen Living Specification}\r\n */\r\nFeatureDetection.supportsFullscreen = function () {\r\n return Fullscreen.supportsFullscreen();\r\n};\r\n\r\n/**\r\n * Detects whether the current browser supports typed arrays.\r\n *\r\n * @returns {Boolean} true if the browser supports typed arrays, false if not.\r\n *\r\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\r\n */\r\nFeatureDetection.supportsTypedArrays = function () {\r\n return typeof ArrayBuffer !== \"undefined\";\r\n};\r\n\r\n/**\r\n * Detects whether the current browser supports BigInt64Array typed arrays.\r\n *\r\n * @returns {Boolean} true if the browser supports BigInt64Array typed arrays, false if not.\r\n *\r\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\r\n */\r\nFeatureDetection.supportsBigInt64Array = function () {\r\n return typeof BigInt64Array !== \"undefined\";\r\n};\r\n\r\n/**\r\n * Detects whether the current browser supports BigUint64Array typed arrays.\r\n *\r\n * @returns {Boolean} true if the browser supports BigUint64Array typed arrays, false if not.\r\n *\r\n * @see {@link https://tc39.es/ecma262/#sec-typedarray-objects|Typed Array Specification}\r\n */\r\nFeatureDetection.supportsBigUint64Array = function () {\r\n return typeof BigUint64Array !== \"undefined\";\r\n};\r\n\r\n/**\r\n * Detects whether the current browser supports BigInt.\r\n *\r\n * @returns {Boolean} true if the browser supports BigInt, false if not.\r\n *\r\n * @see {@link https://tc39.es/ecma262/#sec-bigint-objects|BigInt Specification}\r\n */\r\nFeatureDetection.supportsBigInt = function () {\r\n return typeof BigInt !== \"undefined\";\r\n};\r\n\r\n/**\r\n * Detects whether the current browser supports Web Workers.\r\n *\r\n * @returns {Boolean} true if the browsers supports Web Workers, false if not.\r\n *\r\n * @see {@link http://www.w3.org/TR/workers/}\r\n */\r\nFeatureDetection.supportsWebWorkers = function () {\r\n return typeof Worker !== \"undefined\";\r\n};\r\n\r\n/**\r\n * Detects whether the current browser supports Web Assembly.\r\n *\r\n * @returns {Boolean} true if the browsers supports Web Assembly, false if not.\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/WebAssembly}\r\n */\r\nFeatureDetection.supportsWebAssembly = function () {\r\n return typeof WebAssembly !== \"undefined\";\r\n};\r\nexport default FeatureDetection;\r\n","import Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport FeatureDetection from \"./FeatureDetection.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\n\r\n/**\r\n * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.\r\n * @alias Quaternion\r\n * @constructor\r\n *\r\n * @param {Number} [x=0.0] The X component.\r\n * @param {Number} [y=0.0] The Y component.\r\n * @param {Number} [z=0.0] The Z component.\r\n * @param {Number} [w=0.0] The W component.\r\n *\r\n * @see PackableForInterpolation\r\n */\r\nfunction Quaternion(x, y, z, w) {\r\n /**\r\n * The X component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.x = defaultValue(x, 0.0);\r\n\r\n /**\r\n * The Y component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.y = defaultValue(y, 0.0);\r\n\r\n /**\r\n * The Z component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.z = defaultValue(z, 0.0);\r\n\r\n /**\r\n * The W component.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.w = defaultValue(w, 0.0);\r\n}\r\n\r\nlet fromAxisAngleScratch = new Cartesian3();\r\n\r\n/**\r\n * Computes a quaternion representing a rotation around an axis.\r\n *\r\n * @param {Cartesian3} axis The axis of rotation.\r\n * @param {Number} angle The angle in radians to rotate around the axis.\r\n * @param {Quaternion} [result] The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\r\n */\r\nQuaternion.fromAxisAngle = function (axis, angle, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"axis\", axis);\r\n Check.typeOf.number(\"angle\", angle);\r\n //>>includeEnd('debug');\r\n\r\n const halfAngle = angle / 2.0;\r\n const s = Math.sin(halfAngle);\r\n fromAxisAngleScratch = Cartesian3.normalize(axis, fromAxisAngleScratch);\r\n\r\n const x = fromAxisAngleScratch.x * s;\r\n const y = fromAxisAngleScratch.y * s;\r\n const z = fromAxisAngleScratch.z * s;\r\n const w = Math.cos(halfAngle);\r\n if (!defined(result)) {\r\n return new Quaternion(x, y, z, w);\r\n }\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n return result;\r\n};\r\n\r\nconst fromRotationMatrixNext = [1, 2, 0];\r\nconst fromRotationMatrixQuat = new Array(3);\r\n/**\r\n * Computes a Quaternion from the provided Matrix3 instance.\r\n *\r\n * @param {Matrix3} matrix The rotation matrix.\r\n * @param {Quaternion} [result] The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\r\n *\r\n * @see Matrix3.fromQuaternion\r\n */\r\nQuaternion.fromRotationMatrix = function (matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"matrix\", matrix);\r\n //>>includeEnd('debug');\r\n\r\n let root;\r\n let x;\r\n let y;\r\n let z;\r\n let w;\r\n\r\n const m00 = matrix[Matrix3.COLUMN0ROW0];\r\n const m11 = matrix[Matrix3.COLUMN1ROW1];\r\n const m22 = matrix[Matrix3.COLUMN2ROW2];\r\n const trace = m00 + m11 + m22;\r\n\r\n if (trace > 0.0) {\r\n // |w| > 1/2, may as well choose w > 1/2\r\n root = Math.sqrt(trace + 1.0); // 2w\r\n w = 0.5 * root;\r\n root = 0.5 / root; // 1/(4w)\r\n\r\n x = (matrix[Matrix3.COLUMN1ROW2] - matrix[Matrix3.COLUMN2ROW1]) * root;\r\n y = (matrix[Matrix3.COLUMN2ROW0] - matrix[Matrix3.COLUMN0ROW2]) * root;\r\n z = (matrix[Matrix3.COLUMN0ROW1] - matrix[Matrix3.COLUMN1ROW0]) * root;\r\n } else {\r\n // |w| <= 1/2\r\n const next = fromRotationMatrixNext;\r\n\r\n let i = 0;\r\n if (m11 > m00) {\r\n i = 1;\r\n }\r\n if (m22 > m00 && m22 > m11) {\r\n i = 2;\r\n }\r\n const j = next[i];\r\n const k = next[j];\r\n\r\n root = Math.sqrt(\r\n matrix[Matrix3.getElementIndex(i, i)] -\r\n matrix[Matrix3.getElementIndex(j, j)] -\r\n matrix[Matrix3.getElementIndex(k, k)] +\r\n 1.0\r\n );\r\n\r\n const quat = fromRotationMatrixQuat;\r\n quat[i] = 0.5 * root;\r\n root = 0.5 / root;\r\n w =\r\n (matrix[Matrix3.getElementIndex(k, j)] -\r\n matrix[Matrix3.getElementIndex(j, k)]) *\r\n root;\r\n quat[j] =\r\n (matrix[Matrix3.getElementIndex(j, i)] +\r\n matrix[Matrix3.getElementIndex(i, j)]) *\r\n root;\r\n quat[k] =\r\n (matrix[Matrix3.getElementIndex(k, i)] +\r\n matrix[Matrix3.getElementIndex(i, k)]) *\r\n root;\r\n\r\n x = -quat[0];\r\n y = -quat[1];\r\n z = -quat[2];\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Quaternion(x, y, z, w);\r\n }\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n return result;\r\n};\r\n\r\nconst scratchHPRQuaternion = new Quaternion();\r\nlet scratchHeadingQuaternion = new Quaternion();\r\nlet scratchPitchQuaternion = new Quaternion();\r\nlet scratchRollQuaternion = new Quaternion();\r\n\r\n/**\r\n * Computes a rotation from the given heading, pitch and roll angles. Heading is the rotation about the\r\n * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about\r\n * the positive x axis.\r\n *\r\n * @param {HeadingPitchRoll} headingPitchRoll The rotation expressed as a heading, pitch and roll.\r\n * @param {Quaternion} [result] The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided.\r\n */\r\nQuaternion.fromHeadingPitchRoll = function (headingPitchRoll, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"headingPitchRoll\", headingPitchRoll);\r\n //>>includeEnd('debug');\r\n\r\n scratchRollQuaternion = Quaternion.fromAxisAngle(\r\n Cartesian3.UNIT_X,\r\n headingPitchRoll.roll,\r\n scratchHPRQuaternion\r\n );\r\n scratchPitchQuaternion = Quaternion.fromAxisAngle(\r\n Cartesian3.UNIT_Y,\r\n -headingPitchRoll.pitch,\r\n result\r\n );\r\n result = Quaternion.multiply(\r\n scratchPitchQuaternion,\r\n scratchRollQuaternion,\r\n scratchPitchQuaternion\r\n );\r\n scratchHeadingQuaternion = Quaternion.fromAxisAngle(\r\n Cartesian3.UNIT_Z,\r\n -headingPitchRoll.heading,\r\n scratchHPRQuaternion\r\n );\r\n return Quaternion.multiply(scratchHeadingQuaternion, result, result);\r\n};\r\n\r\nconst sampledQuaternionAxis = new Cartesian3();\r\nconst sampledQuaternionRotation = new Cartesian3();\r\nconst sampledQuaternionTempQuaternion = new Quaternion();\r\nconst sampledQuaternionQuaternion0 = new Quaternion();\r\nconst sampledQuaternionQuaternion0Conjugate = new Quaternion();\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nQuaternion.packedLength = 4;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {Quaternion} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nQuaternion.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value.x;\r\n array[startingIndex++] = value.y;\r\n array[startingIndex++] = value.z;\r\n array[startingIndex] = value.w;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {Quaternion} [result] The object into which to store the result.\r\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\r\n */\r\nQuaternion.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new Quaternion();\r\n }\r\n result.x = array[startingIndex];\r\n result.y = array[startingIndex + 1];\r\n result.z = array[startingIndex + 2];\r\n result.w = array[startingIndex + 3];\r\n return result;\r\n};\r\n\r\n/**\r\n * The number of elements used to store the object into an array in its interpolatable form.\r\n * @type {Number}\r\n */\r\nQuaternion.packedInterpolationLength = 3;\r\n\r\n/**\r\n * Converts a packed array into a form suitable for interpolation.\r\n *\r\n * @param {Number[]} packedArray The packed array.\r\n * @param {Number} [startingIndex=0] The index of the first element to be converted.\r\n * @param {Number} [lastIndex=packedArray.length] The index of the last element to be converted.\r\n * @param {Number[]} [result] The object into which to store the result.\r\n */\r\nQuaternion.convertPackedArrayForInterpolation = function (\r\n packedArray,\r\n startingIndex,\r\n lastIndex,\r\n result\r\n) {\r\n Quaternion.unpack(\r\n packedArray,\r\n lastIndex * 4,\r\n sampledQuaternionQuaternion0Conjugate\r\n );\r\n Quaternion.conjugate(\r\n sampledQuaternionQuaternion0Conjugate,\r\n sampledQuaternionQuaternion0Conjugate\r\n );\r\n\r\n for (let i = 0, len = lastIndex - startingIndex + 1; i < len; i++) {\r\n const offset = i * 3;\r\n Quaternion.unpack(\r\n packedArray,\r\n (startingIndex + i) * 4,\r\n sampledQuaternionTempQuaternion\r\n );\r\n\r\n Quaternion.multiply(\r\n sampledQuaternionTempQuaternion,\r\n sampledQuaternionQuaternion0Conjugate,\r\n sampledQuaternionTempQuaternion\r\n );\r\n\r\n if (sampledQuaternionTempQuaternion.w < 0) {\r\n Quaternion.negate(\r\n sampledQuaternionTempQuaternion,\r\n sampledQuaternionTempQuaternion\r\n );\r\n }\r\n\r\n Quaternion.computeAxis(\r\n sampledQuaternionTempQuaternion,\r\n sampledQuaternionAxis\r\n );\r\n const angle = Quaternion.computeAngle(sampledQuaternionTempQuaternion);\r\n if (!defined(result)) {\r\n result = [];\r\n }\r\n result[offset] = sampledQuaternionAxis.x * angle;\r\n result[offset + 1] = sampledQuaternionAxis.y * angle;\r\n result[offset + 2] = sampledQuaternionAxis.z * angle;\r\n }\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array converted with {@link convertPackedArrayForInterpolation}.\r\n *\r\n * @param {Number[]} array The array previously packed for interpolation.\r\n * @param {Number[]} sourceArray The original packed array.\r\n * @param {Number} [firstIndex=0] The firstIndex used to convert the array.\r\n * @param {Number} [lastIndex=packedArray.length] The lastIndex used to convert the array.\r\n * @param {Quaternion} [result] The object into which to store the result.\r\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\r\n */\r\nQuaternion.unpackInterpolationResult = function (\r\n array,\r\n sourceArray,\r\n firstIndex,\r\n lastIndex,\r\n result\r\n) {\r\n if (!defined(result)) {\r\n result = new Quaternion();\r\n }\r\n Cartesian3.fromArray(array, 0, sampledQuaternionRotation);\r\n const magnitude = Cartesian3.magnitude(sampledQuaternionRotation);\r\n\r\n Quaternion.unpack(sourceArray, lastIndex * 4, sampledQuaternionQuaternion0);\r\n\r\n if (magnitude === 0) {\r\n Quaternion.clone(Quaternion.IDENTITY, sampledQuaternionTempQuaternion);\r\n } else {\r\n Quaternion.fromAxisAngle(\r\n sampledQuaternionRotation,\r\n magnitude,\r\n sampledQuaternionTempQuaternion\r\n );\r\n }\r\n\r\n return Quaternion.multiply(\r\n sampledQuaternionTempQuaternion,\r\n sampledQuaternionQuaternion0,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Duplicates a Quaternion instance.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to duplicate.\r\n * @param {Quaternion} [result] The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided. (Returns undefined if quaternion is undefined)\r\n */\r\nQuaternion.clone = function (quaternion, result) {\r\n if (!defined(quaternion)) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Quaternion(\r\n quaternion.x,\r\n quaternion.y,\r\n quaternion.z,\r\n quaternion.w\r\n );\r\n }\r\n\r\n result.x = quaternion.x;\r\n result.y = quaternion.y;\r\n result.z = quaternion.z;\r\n result.w = quaternion.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the conjugate of the provided quaternion.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to conjugate.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.conjugate = function (quaternion, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"quaternion\", quaternion);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = -quaternion.x;\r\n result.y = -quaternion.y;\r\n result.z = -quaternion.z;\r\n result.w = quaternion.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes magnitude squared for the provided quaternion.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to conjugate.\r\n * @returns {Number} The magnitude squared.\r\n */\r\nQuaternion.magnitudeSquared = function (quaternion) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"quaternion\", quaternion);\r\n //>>includeEnd('debug');\r\n\r\n return (\r\n quaternion.x * quaternion.x +\r\n quaternion.y * quaternion.y +\r\n quaternion.z * quaternion.z +\r\n quaternion.w * quaternion.w\r\n );\r\n};\r\n\r\n/**\r\n * Computes magnitude for the provided quaternion.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to conjugate.\r\n * @returns {Number} The magnitude.\r\n */\r\nQuaternion.magnitude = function (quaternion) {\r\n return Math.sqrt(Quaternion.magnitudeSquared(quaternion));\r\n};\r\n\r\n/**\r\n * Computes the normalized form of the provided quaternion.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to normalize.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.normalize = function (quaternion, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const inverseMagnitude = 1.0 / Quaternion.magnitude(quaternion);\r\n const x = quaternion.x * inverseMagnitude;\r\n const y = quaternion.y * inverseMagnitude;\r\n const z = quaternion.z * inverseMagnitude;\r\n const w = quaternion.w * inverseMagnitude;\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the inverse of the provided quaternion.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to normalize.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.inverse = function (quaternion, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const magnitudeSquared = Quaternion.magnitudeSquared(quaternion);\r\n result = Quaternion.conjugate(quaternion, result);\r\n return Quaternion.multiplyByScalar(result, 1.0 / magnitudeSquared, result);\r\n};\r\n\r\n/**\r\n * Computes the componentwise sum of two quaternions.\r\n *\r\n * @param {Quaternion} left The first quaternion.\r\n * @param {Quaternion} right The second quaternion.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.add = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x + right.x;\r\n result.y = left.y + right.y;\r\n result.z = left.z + right.z;\r\n result.w = left.w + right.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the componentwise difference of two quaternions.\r\n *\r\n * @param {Quaternion} left The first quaternion.\r\n * @param {Quaternion} right The second quaternion.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.subtract = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = left.x - right.x;\r\n result.y = left.y - right.y;\r\n result.z = left.z - right.z;\r\n result.w = left.w - right.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Negates the provided quaternion.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to be negated.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.negate = function (quaternion, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"quaternion\", quaternion);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = -quaternion.x;\r\n result.y = -quaternion.y;\r\n result.z = -quaternion.z;\r\n result.w = -quaternion.w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the dot (scalar) product of two quaternions.\r\n *\r\n * @param {Quaternion} left The first quaternion.\r\n * @param {Quaternion} right The second quaternion.\r\n * @returns {Number} The dot product.\r\n */\r\nQuaternion.dot = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n //>>includeEnd('debug');\r\n\r\n return (\r\n left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w\r\n );\r\n};\r\n\r\n/**\r\n * Computes the product of two quaternions.\r\n *\r\n * @param {Quaternion} left The first quaternion.\r\n * @param {Quaternion} right The second quaternion.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.multiply = function (left, right, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"left\", left);\r\n Check.typeOf.object(\"right\", right);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const leftX = left.x;\r\n const leftY = left.y;\r\n const leftZ = left.z;\r\n const leftW = left.w;\r\n\r\n const rightX = right.x;\r\n const rightY = right.y;\r\n const rightZ = right.z;\r\n const rightW = right.w;\r\n\r\n const x = leftW * rightX + leftX * rightW + leftY * rightZ - leftZ * rightY;\r\n const y = leftW * rightY - leftX * rightZ + leftY * rightW + leftZ * rightX;\r\n const z = leftW * rightZ + leftX * rightY - leftY * rightX + leftZ * rightW;\r\n const w = leftW * rightW - leftX * rightX - leftY * rightY - leftZ * rightZ;\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n return result;\r\n};\r\n\r\n/**\r\n * Multiplies the provided quaternion componentwise by the provided scalar.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to be scaled.\r\n * @param {Number} scalar The scalar to multiply with.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.multiplyByScalar = function (quaternion, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"quaternion\", quaternion);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = quaternion.x * scalar;\r\n result.y = quaternion.y * scalar;\r\n result.z = quaternion.z * scalar;\r\n result.w = quaternion.w * scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Divides the provided quaternion componentwise by the provided scalar.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to be divided.\r\n * @param {Number} scalar The scalar to divide by.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.divideByScalar = function (quaternion, scalar, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"quaternion\", quaternion);\r\n Check.typeOf.number(\"scalar\", scalar);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n result.x = quaternion.x / scalar;\r\n result.y = quaternion.y / scalar;\r\n result.z = quaternion.z / scalar;\r\n result.w = quaternion.w / scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the axis of rotation of the provided quaternion.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to use.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nQuaternion.computeAxis = function (quaternion, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"quaternion\", quaternion);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const w = quaternion.w;\r\n if (Math.abs(w - 1.0) < CesiumMath.EPSILON6) {\r\n result.x = result.y = result.z = 0;\r\n return result;\r\n }\r\n\r\n const scalar = 1.0 / Math.sqrt(1.0 - w * w);\r\n\r\n result.x = quaternion.x * scalar;\r\n result.y = quaternion.y * scalar;\r\n result.z = quaternion.z * scalar;\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the angle of rotation of the provided quaternion.\r\n *\r\n * @param {Quaternion} quaternion The quaternion to use.\r\n * @returns {Number} The angle of rotation.\r\n */\r\nQuaternion.computeAngle = function (quaternion) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"quaternion\", quaternion);\r\n //>>includeEnd('debug');\r\n\r\n if (Math.abs(quaternion.w - 1.0) < CesiumMath.EPSILON6) {\r\n return 0.0;\r\n }\r\n return 2.0 * Math.acos(quaternion.w);\r\n};\r\n\r\nlet lerpScratch = new Quaternion();\r\n/**\r\n * Computes the linear interpolation or extrapolation at t using the provided quaternions.\r\n *\r\n * @param {Quaternion} start The value corresponding to t at 0.0.\r\n * @param {Quaternion} end The value corresponding to t at 1.0.\r\n * @param {Number} t The point along t at which to interpolate.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.lerp = function (start, end, t, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"start\", start);\r\n Check.typeOf.object(\"end\", end);\r\n Check.typeOf.number(\"t\", t);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n lerpScratch = Quaternion.multiplyByScalar(end, t, lerpScratch);\r\n result = Quaternion.multiplyByScalar(start, 1.0 - t, result);\r\n return Quaternion.add(lerpScratch, result, result);\r\n};\r\n\r\nlet slerpEndNegated = new Quaternion();\r\nlet slerpScaledP = new Quaternion();\r\nlet slerpScaledR = new Quaternion();\r\n/**\r\n * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.\r\n *\r\n * @param {Quaternion} start The value corresponding to t at 0.0.\r\n * @param {Quaternion} end The value corresponding to t at 1.0.\r\n * @param {Number} t The point along t at which to interpolate.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n *\r\n * @see Quaternion#fastSlerp\r\n */\r\nQuaternion.slerp = function (start, end, t, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"start\", start);\r\n Check.typeOf.object(\"end\", end);\r\n Check.typeOf.number(\"t\", t);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n let dot = Quaternion.dot(start, end);\r\n\r\n // The angle between start must be acute. Since q and -q represent\r\n // the same rotation, negate q to get the acute angle.\r\n let r = end;\r\n if (dot < 0.0) {\r\n dot = -dot;\r\n r = slerpEndNegated = Quaternion.negate(end, slerpEndNegated);\r\n }\r\n\r\n // dot > 0, as the dot product approaches 1, the angle between the\r\n // quaternions vanishes. use linear interpolation.\r\n if (1.0 - dot < CesiumMath.EPSILON6) {\r\n return Quaternion.lerp(start, r, t, result);\r\n }\r\n\r\n const theta = Math.acos(dot);\r\n slerpScaledP = Quaternion.multiplyByScalar(\r\n start,\r\n Math.sin((1 - t) * theta),\r\n slerpScaledP\r\n );\r\n slerpScaledR = Quaternion.multiplyByScalar(\r\n r,\r\n Math.sin(t * theta),\r\n slerpScaledR\r\n );\r\n result = Quaternion.add(slerpScaledP, slerpScaledR, result);\r\n return Quaternion.multiplyByScalar(result, 1.0 / Math.sin(theta), result);\r\n};\r\n\r\n/**\r\n * The logarithmic quaternion function.\r\n *\r\n * @param {Quaternion} quaternion The unit quaternion.\r\n * @param {Cartesian3} result The object onto which to store the result.\r\n * @returns {Cartesian3} The modified result parameter.\r\n */\r\nQuaternion.log = function (quaternion, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"quaternion\", quaternion);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const theta = CesiumMath.acosClamped(quaternion.w);\r\n let thetaOverSinTheta = 0.0;\r\n\r\n if (theta !== 0.0) {\r\n thetaOverSinTheta = theta / Math.sin(theta);\r\n }\r\n\r\n return Cartesian3.multiplyByScalar(quaternion, thetaOverSinTheta, result);\r\n};\r\n\r\n/**\r\n * The exponential quaternion function.\r\n *\r\n * @param {Cartesian3} cartesian The cartesian.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n */\r\nQuaternion.exp = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"cartesian\", cartesian);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const theta = Cartesian3.magnitude(cartesian);\r\n let sinThetaOverTheta = 0.0;\r\n\r\n if (theta !== 0.0) {\r\n sinThetaOverTheta = Math.sin(theta) / theta;\r\n }\r\n\r\n result.x = cartesian.x * sinThetaOverTheta;\r\n result.y = cartesian.y * sinThetaOverTheta;\r\n result.z = cartesian.z * sinThetaOverTheta;\r\n result.w = Math.cos(theta);\r\n\r\n return result;\r\n};\r\n\r\nconst squadScratchCartesian0 = new Cartesian3();\r\nconst squadScratchCartesian1 = new Cartesian3();\r\nconst squadScratchQuaternion0 = new Quaternion();\r\nconst squadScratchQuaternion1 = new Quaternion();\r\n\r\n/**\r\n * Computes an inner quadrangle point.\r\n * This will compute quaternions that ensure a squad curve is C1.
\r\n *\r\n * @param {Quaternion} q0 The first quaternion.\r\n * @param {Quaternion} q1 The second quaternion.\r\n * @param {Quaternion} q2 The third quaternion.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n *\r\n * @see Quaternion#squad\r\n */\r\nQuaternion.computeInnerQuadrangle = function (q0, q1, q2, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"q0\", q0);\r\n Check.typeOf.object(\"q1\", q1);\r\n Check.typeOf.object(\"q2\", q2);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const qInv = Quaternion.conjugate(q1, squadScratchQuaternion0);\r\n Quaternion.multiply(qInv, q2, squadScratchQuaternion1);\r\n const cart0 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian0);\r\n\r\n Quaternion.multiply(qInv, q0, squadScratchQuaternion1);\r\n const cart1 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian1);\r\n\r\n Cartesian3.add(cart0, cart1, cart0);\r\n Cartesian3.multiplyByScalar(cart0, 0.25, cart0);\r\n Cartesian3.negate(cart0, cart0);\r\n Quaternion.exp(cart0, squadScratchQuaternion0);\r\n\r\n return Quaternion.multiply(q1, squadScratchQuaternion0, result);\r\n};\r\n\r\n/**\r\n * Computes the spherical quadrangle interpolation between quaternions.\r\n *\r\n * @param {Quaternion} q0 The first quaternion.\r\n * @param {Quaternion} q1 The second quaternion.\r\n * @param {Quaternion} s0 The first inner quadrangle.\r\n * @param {Quaternion} s1 The second inner quadrangle.\r\n * @param {Number} t The time in [0,1] used to interpolate.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n *\r\n *\r\n * @example\r\n * // 1. compute the squad interpolation between two quaternions on a curve\r\n * const s0 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i - 1], quaternions[i], quaternions[i + 1], new Cesium.Quaternion());\r\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[i], quaternions[i + 1], quaternions[i + 2], new Cesium.Quaternion());\r\n * const q = Cesium.Quaternion.squad(quaternions[i], quaternions[i + 1], s0, s1, t, new Cesium.Quaternion());\r\n *\r\n * // 2. compute the squad interpolation as above but where the first quaternion is a end point.\r\n * const s1 = Cesium.Quaternion.computeInnerQuadrangle(quaternions[0], quaternions[1], quaternions[2], new Cesium.Quaternion());\r\n * const q = Cesium.Quaternion.squad(quaternions[0], quaternions[1], quaternions[0], s1, t, new Cesium.Quaternion());\r\n *\r\n * @see Quaternion#computeInnerQuadrangle\r\n */\r\nQuaternion.squad = function (q0, q1, s0, s1, t, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"q0\", q0);\r\n Check.typeOf.object(\"q1\", q1);\r\n Check.typeOf.object(\"s0\", s0);\r\n Check.typeOf.object(\"s1\", s1);\r\n Check.typeOf.number(\"t\", t);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const slerp0 = Quaternion.slerp(q0, q1, t, squadScratchQuaternion0);\r\n const slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1);\r\n return Quaternion.slerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\r\n};\r\n\r\nconst fastSlerpScratchQuaternion = new Quaternion();\r\n// eslint-disable-next-line no-loss-of-precision\r\nconst opmu = 1.90110745351730037;\r\nconst u = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\r\nconst v = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\r\nconst bT = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\r\nconst bD = FeatureDetection.supportsTypedArrays() ? new Float32Array(8) : [];\r\n\r\nfor (let i = 0; i < 7; ++i) {\r\n const s = i + 1.0;\r\n const t = 2.0 * s + 1.0;\r\n u[i] = 1.0 / (s * t);\r\n v[i] = s / t;\r\n}\r\n\r\nu[7] = opmu / (8.0 * 17.0);\r\nv[7] = (opmu * 8.0) / 17.0;\r\n\r\n/**\r\n * Computes the spherical linear interpolation or extrapolation at t using the provided quaternions.\r\n * This implementation is faster than {@link Quaternion#slerp}, but is only accurate up to 10-6.\r\n *\r\n * @param {Quaternion} start The value corresponding to t at 0.0.\r\n * @param {Quaternion} end The value corresponding to t at 1.0.\r\n * @param {Number} t The point along t at which to interpolate.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter.\r\n *\r\n * @see Quaternion#slerp\r\n */\r\nQuaternion.fastSlerp = function (start, end, t, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"start\", start);\r\n Check.typeOf.object(\"end\", end);\r\n Check.typeOf.number(\"t\", t);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n let x = Quaternion.dot(start, end);\r\n\r\n let sign;\r\n if (x >= 0) {\r\n sign = 1.0;\r\n } else {\r\n sign = -1.0;\r\n x = -x;\r\n }\r\n\r\n const xm1 = x - 1.0;\r\n const d = 1.0 - t;\r\n const sqrT = t * t;\r\n const sqrD = d * d;\r\n\r\n for (let i = 7; i >= 0; --i) {\r\n bT[i] = (u[i] * sqrT - v[i]) * xm1;\r\n bD[i] = (u[i] * sqrD - v[i]) * xm1;\r\n }\r\n\r\n const cT =\r\n sign *\r\n t *\r\n (1.0 +\r\n bT[0] *\r\n (1.0 +\r\n bT[1] *\r\n (1.0 +\r\n bT[2] *\r\n (1.0 +\r\n bT[3] *\r\n (1.0 +\r\n bT[4] *\r\n (1.0 + bT[5] * (1.0 + bT[6] * (1.0 + bT[7]))))))));\r\n const cD =\r\n d *\r\n (1.0 +\r\n bD[0] *\r\n (1.0 +\r\n bD[1] *\r\n (1.0 +\r\n bD[2] *\r\n (1.0 +\r\n bD[3] *\r\n (1.0 +\r\n bD[4] *\r\n (1.0 + bD[5] * (1.0 + bD[6] * (1.0 + bD[7]))))))));\r\n\r\n const temp = Quaternion.multiplyByScalar(\r\n start,\r\n cD,\r\n fastSlerpScratchQuaternion\r\n );\r\n Quaternion.multiplyByScalar(end, cT, result);\r\n return Quaternion.add(temp, result, result);\r\n};\r\n\r\n/**\r\n * Computes the spherical quadrangle interpolation between quaternions.\r\n * An implementation that is faster than {@link Quaternion#squad}, but less accurate.\r\n *\r\n * @param {Quaternion} q0 The first quaternion.\r\n * @param {Quaternion} q1 The second quaternion.\r\n * @param {Quaternion} s0 The first inner quadrangle.\r\n * @param {Quaternion} s1 The second inner quadrangle.\r\n * @param {Number} t The time in [0,1] used to interpolate.\r\n * @param {Quaternion} result The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter or a new instance if none was provided.\r\n *\r\n * @see Quaternion#squad\r\n */\r\nQuaternion.fastSquad = function (q0, q1, s0, s1, t, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"q0\", q0);\r\n Check.typeOf.object(\"q1\", q1);\r\n Check.typeOf.object(\"s0\", s0);\r\n Check.typeOf.object(\"s1\", s1);\r\n Check.typeOf.number(\"t\", t);\r\n Check.typeOf.object(\"result\", result);\r\n //>>includeEnd('debug');\r\n\r\n const slerp0 = Quaternion.fastSlerp(q0, q1, t, squadScratchQuaternion0);\r\n const slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1);\r\n return Quaternion.fastSlerp(slerp0, slerp1, 2.0 * t * (1.0 - t), result);\r\n};\r\n\r\n/**\r\n * Compares the provided quaternions componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Quaternion} [left] The first quaternion.\r\n * @param {Quaternion} [right] The second quaternion.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nQuaternion.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left.x === right.x &&\r\n left.y === right.y &&\r\n left.z === right.z &&\r\n left.w === right.w)\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided quaternions componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Quaternion} [left] The first quaternion.\r\n * @param {Quaternion} [right] The second quaternion.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nQuaternion.equalsEpsilon = function (left, right, epsilon) {\r\n epsilon = defaultValue(epsilon, 0);\r\n\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n Math.abs(left.x - right.x) <= epsilon &&\r\n Math.abs(left.y - right.y) <= epsilon &&\r\n Math.abs(left.z - right.z) <= epsilon &&\r\n Math.abs(left.w - right.w) <= epsilon)\r\n );\r\n};\r\n\r\n/**\r\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 0.0).\r\n *\r\n * @type {Quaternion}\r\n * @constant\r\n */\r\nQuaternion.ZERO = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 0.0));\r\n\r\n/**\r\n * An immutable Quaternion instance initialized to (0.0, 0.0, 0.0, 1.0).\r\n *\r\n * @type {Quaternion}\r\n * @constant\r\n */\r\nQuaternion.IDENTITY = Object.freeze(new Quaternion(0.0, 0.0, 0.0, 1.0));\r\n\r\n/**\r\n * Duplicates this Quaternion instance.\r\n *\r\n * @param {Quaternion} [result] The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if one was not provided.\r\n */\r\nQuaternion.prototype.clone = function (result) {\r\n return Quaternion.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares this and the provided quaternion componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {Quaternion} [right] The right hand side quaternion.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nQuaternion.prototype.equals = function (right) {\r\n return Quaternion.equals(this, right);\r\n};\r\n\r\n/**\r\n * Compares this and the provided quaternion componentwise and returns\r\n * true
if they are within the provided epsilon,\r\n * false
otherwise.\r\n *\r\n * @param {Quaternion} [right] The right hand side quaternion.\r\n * @param {Number} [epsilon=0] The epsilon to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nQuaternion.prototype.equalsEpsilon = function (right, epsilon) {\r\n return Quaternion.equalsEpsilon(this, right, epsilon);\r\n};\r\n\r\n/**\r\n * Returns a string representing this quaternion in the format (x, y, z, w).\r\n *\r\n * @returns {String} A string representing this Quaternion.\r\n */\r\nQuaternion.prototype.toString = function () {\r\n return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;\r\n};\r\nexport default Quaternion;\r\n","import Check from \"./Check.js\";\r\n\r\n/**\r\n * Finds an item in a sorted array.\r\n *\r\n * @function\r\n * @param {Array} array The sorted array to search.\r\n * @param {*} itemToFind The item to find in the array.\r\n * @param {binarySearchComparator} comparator The function to use to compare the item to\r\n * elements in the array.\r\n * @returns {Number} The index of itemToFind
in the array, if it exists. If itemToFind
\r\n * does not exist, the return value is a negative number which is the bitwise complement (~)\r\n * of the index before which the itemToFind should be inserted in order to maintain the\r\n * sorted order of the array.\r\n *\r\n * @example\r\n * // Create a comparator function to search through an array of numbers.\r\n * function comparator(a, b) {\r\n * return a - b;\r\n * };\r\n * const numbers = [0, 2, 4, 6, 8];\r\n * const index = Cesium.binarySearch(numbers, 6, comparator); // 3\r\n */\r\nfunction binarySearch(array, itemToFind, comparator) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n Check.defined(\"itemToFind\", itemToFind);\r\n Check.defined(\"comparator\", comparator);\r\n //>>includeEnd('debug');\r\n\r\n let low = 0;\r\n let high = array.length - 1;\r\n let i;\r\n let comparison;\r\n\r\n while (low <= high) {\r\n i = ~~((low + high) / 2);\r\n comparison = comparator(array[i], itemToFind);\r\n if (comparison < 0) {\r\n low = i + 1;\r\n continue;\r\n }\r\n if (comparison > 0) {\r\n high = i - 1;\r\n continue;\r\n }\r\n return i;\r\n }\r\n return ~(high + 1);\r\n}\r\n\r\n/**\r\n * A function used to compare two items while performing a binary search.\r\n * @callback binarySearchComparator\r\n *\r\n * @param {*} a An item in the array.\r\n * @param {*} b The item being searched for.\r\n * @returns {Number} Returns a negative value if a
is less than b
,\r\n * a positive value if a
is greater than b
, or\r\n * 0 if a
is equal to b
.\r\n *\r\n * @example\r\n * function compareNumbers(a, b) {\r\n * return a - b;\r\n * }\r\n */\r\nexport default binarySearch;\r\n","/**\r\n * A set of Earth Orientation Parameters (EOP) sampled at a time.\r\n *\r\n * @alias EarthOrientationParametersSample\r\n * @constructor\r\n *\r\n * @param {Number} xPoleWander The pole wander about the X axis, in radians.\r\n * @param {Number} yPoleWander The pole wander about the Y axis, in radians.\r\n * @param {Number} xPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\r\n * @param {Number} yPoleOffset The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\r\n * @param {Number} ut1MinusUtc The difference in time standards, UT1 - UTC, in seconds.\r\n *\r\n * @private\r\n */\r\nfunction EarthOrientationParametersSample(\r\n xPoleWander,\r\n yPoleWander,\r\n xPoleOffset,\r\n yPoleOffset,\r\n ut1MinusUtc\r\n) {\r\n /**\r\n * The pole wander about the X axis, in radians.\r\n * @type {Number}\r\n */\r\n this.xPoleWander = xPoleWander;\r\n\r\n /**\r\n * The pole wander about the Y axis, in radians.\r\n * @type {Number}\r\n */\r\n this.yPoleWander = yPoleWander;\r\n\r\n /**\r\n * The offset to the Celestial Intermediate Pole (CIP) about the X axis, in radians.\r\n * @type {Number}\r\n */\r\n this.xPoleOffset = xPoleOffset;\r\n\r\n /**\r\n * The offset to the Celestial Intermediate Pole (CIP) about the Y axis, in radians.\r\n * @type {Number}\r\n */\r\n this.yPoleOffset = yPoleOffset;\r\n\r\n /**\r\n * The difference in time standards, UT1 - UTC, in seconds.\r\n * @type {Number}\r\n */\r\n this.ut1MinusUtc = ut1MinusUtc;\r\n}\r\nexport default EarthOrientationParametersSample;\r\n","/**\r\n * Represents a Gregorian date in a more precise format than the JavaScript Date object.\r\n * In addition to submillisecond precision, this object can also represent leap seconds.\r\n * @alias GregorianDate\r\n * @constructor\r\n *\r\n * @param {Number} [year] The year as a whole number.\r\n * @param {Number} [month] The month as a whole number with range [1, 12].\r\n * @param {Number} [day] The day of the month as a whole number starting at 1.\r\n * @param {Number} [hour] The hour as a whole number with range [0, 23].\r\n * @param {Number} [minute] The minute of the hour as a whole number with range [0, 59].\r\n * @param {Number} [second] The second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\r\n * @param {Number} [millisecond] The millisecond of the second as a floating point number with range [0.0, 1000.0).\r\n * @param {Boolean} [isLeapSecond] Whether this time is during a leap second.\r\n *\r\n * @see JulianDate#toGregorianDate\r\n */\r\nfunction GregorianDate(\r\n year,\r\n month,\r\n day,\r\n hour,\r\n minute,\r\n second,\r\n millisecond,\r\n isLeapSecond\r\n) {\r\n /**\r\n * Gets or sets the year as a whole number.\r\n * @type {Number}\r\n */\r\n this.year = year;\r\n /**\r\n * Gets or sets the month as a whole number with range [1, 12].\r\n * @type {Number}\r\n */\r\n this.month = month;\r\n /**\r\n * Gets or sets the day of the month as a whole number starting at 1.\r\n * @type {Number}\r\n */\r\n this.day = day;\r\n /**\r\n * Gets or sets the hour as a whole number with range [0, 23].\r\n * @type {Number}\r\n */\r\n this.hour = hour;\r\n /**\r\n * Gets or sets the minute of the hour as a whole number with range [0, 59].\r\n * @type {Number}\r\n */\r\n this.minute = minute;\r\n /**\r\n * Gets or sets the second of the minute as a whole number with range [0, 60], with 60 representing a leap second.\r\n * @type {Number}\r\n */\r\n this.second = second;\r\n /**\r\n * Gets or sets the millisecond of the second as a floating point number with range [0.0, 1000.0).\r\n * @type {Number}\r\n */\r\n this.millisecond = millisecond;\r\n /**\r\n * Gets or sets whether this time is during a leap second.\r\n * @type {Boolean}\r\n */\r\n this.isLeapSecond = isLeapSecond;\r\n}\r\nexport default GregorianDate;\r\n","import DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * Determines if a given date is a leap year.\r\n *\r\n * @function isLeapYear\r\n *\r\n * @param {Number} year The year to be tested.\r\n * @returns {Boolean} True if year
is a leap year.\r\n *\r\n * @example\r\n * const leapYear = Cesium.isLeapYear(2000); // true\r\n */\r\nfunction isLeapYear(year) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (year === null || isNaN(year)) {\r\n throw new DeveloperError(\"year is required and must be a number.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\r\n}\r\nexport default isLeapYear;\r\n","/**\r\n * Describes a single leap second, which is constructed from a {@link JulianDate} and a\r\n * numerical offset representing the number of seconds TAI is ahead of the UTC time standard.\r\n * @alias LeapSecond\r\n * @constructor\r\n *\r\n * @param {JulianDate} [date] A Julian date representing the time of the leap second.\r\n * @param {Number} [offset] The cumulative number of seconds that TAI is ahead of UTC at the provided date.\r\n */\r\nfunction LeapSecond(date, offset) {\r\n /**\r\n * Gets or sets the date at which this leap second occurs.\r\n * @type {JulianDate}\r\n */\r\n this.julianDate = date;\r\n\r\n /**\r\n * Gets or sets the cumulative number of seconds between the UTC and TAI time standards at the time\r\n * of this leap second.\r\n * @type {Number}\r\n */\r\n this.offset = offset;\r\n}\r\nexport default LeapSecond;\r\n","/**\r\n * Constants for time conversions like those done by {@link JulianDate}.\r\n *\r\n * @namespace TimeConstants\r\n *\r\n * @see JulianDate\r\n *\r\n * @private\r\n */\r\nconst TimeConstants = {\r\n /**\r\n * The number of seconds in one millisecond: 0.001
\r\n * @type {Number}\r\n * @constant\r\n */\r\n SECONDS_PER_MILLISECOND: 0.001,\r\n\r\n /**\r\n * The number of seconds in one minute: 60
.\r\n * @type {Number}\r\n * @constant\r\n */\r\n SECONDS_PER_MINUTE: 60.0,\r\n\r\n /**\r\n * The number of minutes in one hour: 60
.\r\n * @type {Number}\r\n * @constant\r\n */\r\n MINUTES_PER_HOUR: 60.0,\r\n\r\n /**\r\n * The number of hours in one day: 24
.\r\n * @type {Number}\r\n * @constant\r\n */\r\n HOURS_PER_DAY: 24.0,\r\n\r\n /**\r\n * The number of seconds in one hour: 3600
.\r\n * @type {Number}\r\n * @constant\r\n */\r\n SECONDS_PER_HOUR: 3600.0,\r\n\r\n /**\r\n * The number of minutes in one day: 1440
.\r\n * @type {Number}\r\n * @constant\r\n */\r\n MINUTES_PER_DAY: 1440.0,\r\n\r\n /**\r\n * The number of seconds in one day, ignoring leap seconds: 86400
.\r\n * @type {Number}\r\n * @constant\r\n */\r\n SECONDS_PER_DAY: 86400.0,\r\n\r\n /**\r\n * The number of days in one Julian century: 36525
.\r\n * @type {Number}\r\n * @constant\r\n */\r\n DAYS_PER_JULIAN_CENTURY: 36525.0,\r\n\r\n /**\r\n * One trillionth of a second.\r\n * @type {Number}\r\n * @constant\r\n */\r\n PICOSECOND: 0.000000001,\r\n\r\n /**\r\n * The number of days to subtract from a Julian date to determine the\r\n * modified Julian date, which gives the number of days since midnight\r\n * on November 17, 1858.\r\n * @type {Number}\r\n * @constant\r\n */\r\n MODIFIED_JULIAN_DATE_DIFFERENCE: 2400000.5,\r\n};\r\nexport default Object.freeze(TimeConstants);\r\n","/**\r\n * Provides the type of time standards which JulianDate can take as input.\r\n *\r\n * @enum {Number}\r\n *\r\n * @see JulianDate\r\n */\r\nconst TimeStandard = {\r\n /**\r\n * Represents the coordinated Universal Time (UTC) time standard.\r\n *\r\n * UTC is related to TAI according to the relationship\r\n * UTC = TAI - deltaT
where deltaT
is the number of leap\r\n * seconds which have been introduced as of the time in TAI.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n UTC: 0,\r\n\r\n /**\r\n * Represents the International Atomic Time (TAI) time standard.\r\n * TAI is the principal time standard to which the other time standards are related.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n TAI: 1,\r\n};\r\nexport default Object.freeze(TimeStandard);\r\n","import binarySearch from \"./binarySearch.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport GregorianDate from \"./GregorianDate.js\";\r\nimport isLeapYear from \"./isLeapYear.js\";\r\nimport LeapSecond from \"./LeapSecond.js\";\r\nimport TimeConstants from \"./TimeConstants.js\";\r\nimport TimeStandard from \"./TimeStandard.js\";\r\n\r\nconst gregorianDateScratch = new GregorianDate();\r\nconst daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\r\nconst daysInLeapFeburary = 29;\r\n\r\nfunction compareLeapSecondDates(leapSecond, dateToFind) {\r\n return JulianDate.compare(leapSecond.julianDate, dateToFind.julianDate);\r\n}\r\n\r\n// we don't really need a leap second instance, anything with a julianDate property will do\r\nconst binarySearchScratchLeapSecond = new LeapSecond();\r\n\r\nfunction convertUtcToTai(julianDate) {\r\n //Even though julianDate is in UTC, we'll treat it as TAI and\r\n //search the leap second table for it.\r\n binarySearchScratchLeapSecond.julianDate = julianDate;\r\n const leapSeconds = JulianDate.leapSeconds;\r\n let index = binarySearch(\r\n leapSeconds,\r\n binarySearchScratchLeapSecond,\r\n compareLeapSecondDates\r\n );\r\n\r\n if (index < 0) {\r\n index = ~index;\r\n }\r\n\r\n if (index >= leapSeconds.length) {\r\n index = leapSeconds.length - 1;\r\n }\r\n\r\n let offset = leapSeconds[index].offset;\r\n if (index > 0) {\r\n //Now we have the index of the closest leap second that comes on or after our UTC time.\r\n //However, if the difference between the UTC date being converted and the TAI\r\n //defined leap second is greater than the offset, we are off by one and need to use\r\n //the previous leap second.\r\n const difference = JulianDate.secondsDifference(\r\n leapSeconds[index].julianDate,\r\n julianDate\r\n );\r\n if (difference > offset) {\r\n index--;\r\n offset = leapSeconds[index].offset;\r\n }\r\n }\r\n\r\n JulianDate.addSeconds(julianDate, offset, julianDate);\r\n}\r\n\r\nfunction convertTaiToUtc(julianDate, result) {\r\n binarySearchScratchLeapSecond.julianDate = julianDate;\r\n const leapSeconds = JulianDate.leapSeconds;\r\n let index = binarySearch(\r\n leapSeconds,\r\n binarySearchScratchLeapSecond,\r\n compareLeapSecondDates\r\n );\r\n if (index < 0) {\r\n index = ~index;\r\n }\r\n\r\n //All times before our first leap second get the first offset.\r\n if (index === 0) {\r\n return JulianDate.addSeconds(julianDate, -leapSeconds[0].offset, result);\r\n }\r\n\r\n //All times after our leap second get the last offset.\r\n if (index >= leapSeconds.length) {\r\n return JulianDate.addSeconds(\r\n julianDate,\r\n -leapSeconds[index - 1].offset,\r\n result\r\n );\r\n }\r\n\r\n //Compute the difference between the found leap second and the time we are converting.\r\n const difference = JulianDate.secondsDifference(\r\n leapSeconds[index].julianDate,\r\n julianDate\r\n );\r\n\r\n if (difference === 0) {\r\n //The date is in our leap second table.\r\n return JulianDate.addSeconds(\r\n julianDate,\r\n -leapSeconds[index].offset,\r\n result\r\n );\r\n }\r\n\r\n if (difference <= 1.0) {\r\n //The requested date is during the moment of a leap second, then we cannot convert to UTC\r\n return undefined;\r\n }\r\n\r\n //The time is in between two leap seconds, index is the leap second after the date\r\n //we're converting, so we subtract one to get the correct LeapSecond instance.\r\n return JulianDate.addSeconds(\r\n julianDate,\r\n -leapSeconds[--index].offset,\r\n result\r\n );\r\n}\r\n\r\nfunction setComponents(wholeDays, secondsOfDay, julianDate) {\r\n const extraDays = (secondsOfDay / TimeConstants.SECONDS_PER_DAY) | 0;\r\n wholeDays += extraDays;\r\n secondsOfDay -= TimeConstants.SECONDS_PER_DAY * extraDays;\r\n\r\n if (secondsOfDay < 0) {\r\n wholeDays--;\r\n secondsOfDay += TimeConstants.SECONDS_PER_DAY;\r\n }\r\n\r\n julianDate.dayNumber = wholeDays;\r\n julianDate.secondsOfDay = secondsOfDay;\r\n return julianDate;\r\n}\r\n\r\nfunction computeJulianDateComponents(\r\n year,\r\n month,\r\n day,\r\n hour,\r\n minute,\r\n second,\r\n millisecond\r\n) {\r\n // Algorithm from page 604 of the Explanatory Supplement to the\r\n // Astronomical Almanac (Seidelmann 1992).\r\n\r\n const a = ((month - 14) / 12) | 0;\r\n const b = year + 4800 + a;\r\n let dayNumber =\r\n (((1461 * b) / 4) | 0) +\r\n (((367 * (month - 2 - 12 * a)) / 12) | 0) -\r\n (((3 * (((b + 100) / 100) | 0)) / 4) | 0) +\r\n day -\r\n 32075;\r\n\r\n // JulianDates are noon-based\r\n hour = hour - 12;\r\n if (hour < 0) {\r\n hour += 24;\r\n }\r\n\r\n const secondsOfDay =\r\n second +\r\n (hour * TimeConstants.SECONDS_PER_HOUR +\r\n minute * TimeConstants.SECONDS_PER_MINUTE +\r\n millisecond * TimeConstants.SECONDS_PER_MILLISECOND);\r\n\r\n if (secondsOfDay >= 43200.0) {\r\n dayNumber -= 1;\r\n }\r\n\r\n return [dayNumber, secondsOfDay];\r\n}\r\n\r\n//Regular expressions used for ISO8601 date parsing.\r\n//YYYY\r\nconst matchCalendarYear = /^(\\d{4})$/;\r\n//YYYY-MM (YYYYMM is invalid)\r\nconst matchCalendarMonth = /^(\\d{4})-(\\d{2})$/;\r\n//YYYY-DDD or YYYYDDD\r\nconst matchOrdinalDate = /^(\\d{4})-?(\\d{3})$/;\r\n//YYYY-Www or YYYYWww or YYYY-Www-D or YYYYWwwD\r\nconst matchWeekDate = /^(\\d{4})-?W(\\d{2})-?(\\d{1})?$/;\r\n//YYYY-MM-DD or YYYYMMDD\r\nconst matchCalendarDate = /^(\\d{4})-?(\\d{2})-?(\\d{2})$/;\r\n// Match utc offset\r\nconst utcOffset = /([Z+\\-])?(\\d{2})?:?(\\d{2})?$/;\r\n// Match hours HH or HH.xxxxx\r\nconst matchHours = /^(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\r\n// Match hours/minutes HH:MM HHMM.xxxxx\r\nconst matchHoursMinutes = /^(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\r\n// Match hours/minutes HH:MM:SS HHMMSS.xxxxx\r\nconst matchHoursMinutesSeconds =\r\n /^(\\d{2}):?(\\d{2}):?(\\d{2})(\\.\\d+)?/.source + utcOffset.source;\r\n\r\nconst iso8601ErrorMessage = \"Invalid ISO 8601 date.\";\r\n\r\n/**\r\n * Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC).\r\n * For increased precision, this class stores the whole number part of the date and the seconds\r\n * part of the date in separate components. In order to be safe for arithmetic and represent\r\n * leap seconds, the date is always stored in the International Atomic Time standard\r\n * {@link TimeStandard.TAI}.\r\n * @alias JulianDate\r\n * @constructor\r\n *\r\n * @param {Number} [julianDayNumber=0.0] The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly.\r\n * @param {Number} [secondsOfDay=0.0] The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly.\r\n * @param {TimeStandard} [timeStandard=TimeStandard.UTC] The time standard in which the first two parameters are defined.\r\n */\r\nfunction JulianDate(julianDayNumber, secondsOfDay, timeStandard) {\r\n /**\r\n * Gets or sets the number of whole days.\r\n * @type {Number}\r\n */\r\n this.dayNumber = undefined;\r\n\r\n /**\r\n * Gets or sets the number of seconds into the current day.\r\n * @type {Number}\r\n */\r\n this.secondsOfDay = undefined;\r\n\r\n julianDayNumber = defaultValue(julianDayNumber, 0.0);\r\n secondsOfDay = defaultValue(secondsOfDay, 0.0);\r\n timeStandard = defaultValue(timeStandard, TimeStandard.UTC);\r\n\r\n //If julianDayNumber is fractional, make it an integer and add the number of seconds the fraction represented.\r\n const wholeDays = julianDayNumber | 0;\r\n secondsOfDay =\r\n secondsOfDay +\r\n (julianDayNumber - wholeDays) * TimeConstants.SECONDS_PER_DAY;\r\n\r\n setComponents(wholeDays, secondsOfDay, this);\r\n\r\n if (timeStandard === TimeStandard.UTC) {\r\n convertUtcToTai(this);\r\n }\r\n}\r\n\r\n/**\r\n * Creates a new instance from a GregorianDate.\r\n *\r\n * @param {GregorianDate} date A GregorianDate.\r\n * @param {JulianDate} [result] An existing instance to use for the result.\r\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\r\n *\r\n * @exception {DeveloperError} date must be a valid GregorianDate.\r\n */\r\nJulianDate.fromGregorianDate = function (date, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!(date instanceof GregorianDate)) {\r\n throw new DeveloperError(\"date must be a valid GregorianDate.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const components = computeJulianDateComponents(\r\n date.year,\r\n date.month,\r\n date.day,\r\n date.hour,\r\n date.minute,\r\n date.second,\r\n date.millisecond\r\n );\r\n if (!defined(result)) {\r\n return new JulianDate(components[0], components[1], TimeStandard.UTC);\r\n }\r\n setComponents(components[0], components[1], result);\r\n convertUtcToTai(result);\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a new instance from a JavaScript Date.\r\n *\r\n * @param {Date} date A JavaScript Date.\r\n * @param {JulianDate} [result] An existing instance to use for the result.\r\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\r\n *\r\n * @exception {DeveloperError} date must be a valid JavaScript Date.\r\n */\r\nJulianDate.fromDate = function (date, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!(date instanceof Date) || isNaN(date.getTime())) {\r\n throw new DeveloperError(\"date must be a valid JavaScript Date.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const components = computeJulianDateComponents(\r\n date.getUTCFullYear(),\r\n date.getUTCMonth() + 1,\r\n date.getUTCDate(),\r\n date.getUTCHours(),\r\n date.getUTCMinutes(),\r\n date.getUTCSeconds(),\r\n date.getUTCMilliseconds()\r\n );\r\n if (!defined(result)) {\r\n return new JulianDate(components[0], components[1], TimeStandard.UTC);\r\n }\r\n setComponents(components[0], components[1], result);\r\n convertUtcToTai(result);\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a new instance from a from an {@link http://en.wikipedia.org/wiki/ISO_8601|ISO 8601} date.\r\n * This method is superior to Date.parse
because it will handle all valid formats defined by the ISO 8601\r\n * specification, including leap seconds and sub-millisecond times, which discarded by most JavaScript implementations.\r\n *\r\n * @param {String} iso8601String An ISO 8601 date.\r\n * @param {JulianDate} [result] An existing instance to use for the result.\r\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\r\n *\r\n * @exception {DeveloperError} Invalid ISO 8601 date.\r\n */\r\nJulianDate.fromIso8601 = function (iso8601String, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (typeof iso8601String !== \"string\") {\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n }\r\n //>>includeEnd('debug');\r\n\r\n //Comma and decimal point both indicate a fractional number according to ISO 8601,\r\n //start out by blanket replacing , with . which is the only valid such symbol in JS.\r\n iso8601String = iso8601String.replace(\",\", \".\");\r\n\r\n //Split the string into its date and time components, denoted by a mandatory T\r\n let tokens = iso8601String.split(\"T\");\r\n let year;\r\n let month = 1;\r\n let day = 1;\r\n let hour = 0;\r\n let minute = 0;\r\n let second = 0;\r\n let millisecond = 0;\r\n\r\n //Lacking a time is okay, but a missing date is illegal.\r\n const date = tokens[0];\r\n const time = tokens[1];\r\n let tmp;\r\n let inLeapYear;\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(date)) {\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n }\r\n\r\n let dashCount;\r\n //>>includeEnd('debug');\r\n\r\n //First match the date against possible regular expressions.\r\n tokens = date.match(matchCalendarDate);\r\n if (tokens !== null) {\r\n //>>includeStart('debug', pragmas.debug);\r\n dashCount = date.split(\"-\").length - 1;\r\n if (dashCount > 0 && dashCount !== 2) {\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n }\r\n //>>includeEnd('debug');\r\n year = +tokens[1];\r\n month = +tokens[2];\r\n day = +tokens[3];\r\n } else {\r\n tokens = date.match(matchCalendarMonth);\r\n if (tokens !== null) {\r\n year = +tokens[1];\r\n month = +tokens[2];\r\n } else {\r\n tokens = date.match(matchCalendarYear);\r\n if (tokens !== null) {\r\n year = +tokens[1];\r\n } else {\r\n //Not a year/month/day so it must be an ordinal date.\r\n let dayOfYear;\r\n tokens = date.match(matchOrdinalDate);\r\n if (tokens !== null) {\r\n year = +tokens[1];\r\n dayOfYear = +tokens[2];\r\n inLeapYear = isLeapYear(year);\r\n\r\n //This validation is only applicable for this format.\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n dayOfYear < 1 ||\r\n (inLeapYear && dayOfYear > 366) ||\r\n (!inLeapYear && dayOfYear > 365)\r\n ) {\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n }\r\n //>>includeEnd('debug')\r\n } else {\r\n tokens = date.match(matchWeekDate);\r\n if (tokens !== null) {\r\n //ISO week date to ordinal date from\r\n //http://en.wikipedia.org/w/index.php?title=ISO_week_date&oldid=474176775\r\n year = +tokens[1];\r\n const weekNumber = +tokens[2];\r\n const dayOfWeek = +tokens[3] || 0;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n dashCount = date.split(\"-\").length - 1;\r\n if (\r\n dashCount > 0 &&\r\n ((!defined(tokens[3]) && dashCount !== 1) ||\r\n (defined(tokens[3]) && dashCount !== 2))\r\n ) {\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n }\r\n //>>includeEnd('debug')\r\n\r\n const january4 = new Date(Date.UTC(year, 0, 4));\r\n dayOfYear = weekNumber * 7 + dayOfWeek - january4.getUTCDay() - 3;\r\n } else {\r\n //None of our regular expressions succeeded in parsing the date properly.\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n //>>includeEnd('debug')\r\n }\r\n }\r\n //Split an ordinal date into month/day.\r\n tmp = new Date(Date.UTC(year, 0, 1));\r\n tmp.setUTCDate(dayOfYear);\r\n month = tmp.getUTCMonth() + 1;\r\n day = tmp.getUTCDate();\r\n }\r\n }\r\n }\r\n\r\n //Now that we have all of the date components, validate them to make sure nothing is out of range.\r\n inLeapYear = isLeapYear(year);\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n month < 1 ||\r\n month > 12 ||\r\n day < 1 ||\r\n ((month !== 2 || !inLeapYear) && day > daysInMonth[month - 1]) ||\r\n (inLeapYear && month === 2 && day > daysInLeapFeburary)\r\n ) {\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n }\r\n //>>includeEnd('debug')\r\n\r\n //Now move onto the time string, which is much simpler.\r\n //If no time is specified, it is considered the beginning of the day, UTC to match Javascript's implementation.\r\n let offsetIndex;\r\n if (defined(time)) {\r\n tokens = time.match(matchHoursMinutesSeconds);\r\n if (tokens !== null) {\r\n //>>includeStart('debug', pragmas.debug);\r\n dashCount = time.split(\":\").length - 1;\r\n if (dashCount > 0 && dashCount !== 2 && dashCount !== 3) {\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n }\r\n //>>includeEnd('debug')\r\n\r\n hour = +tokens[1];\r\n minute = +tokens[2];\r\n second = +tokens[3];\r\n millisecond = +(tokens[4] || 0) * 1000.0;\r\n offsetIndex = 5;\r\n } else {\r\n tokens = time.match(matchHoursMinutes);\r\n if (tokens !== null) {\r\n //>>includeStart('debug', pragmas.debug);\r\n dashCount = time.split(\":\").length - 1;\r\n if (dashCount > 2) {\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n }\r\n //>>includeEnd('debug')\r\n\r\n hour = +tokens[1];\r\n minute = +tokens[2];\r\n second = +(tokens[3] || 0) * 60.0;\r\n offsetIndex = 4;\r\n } else {\r\n tokens = time.match(matchHours);\r\n if (tokens !== null) {\r\n hour = +tokens[1];\r\n minute = +(tokens[2] || 0) * 60.0;\r\n offsetIndex = 3;\r\n } else {\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n //>>includeEnd('debug')\r\n }\r\n }\r\n }\r\n\r\n //Validate that all values are in proper range. Minutes and hours have special cases at 60 and 24.\r\n //>>includeStart('debug', pragmas.debug);\r\n if (\r\n minute >= 60 ||\r\n second >= 61 ||\r\n hour > 24 ||\r\n (hour === 24 && (minute > 0 || second > 0 || millisecond > 0))\r\n ) {\r\n throw new DeveloperError(iso8601ErrorMessage);\r\n }\r\n //>>includeEnd('debug');\r\n\r\n //Check the UTC offset value, if no value exists, use local time\r\n //a Z indicates UTC, + or - are offsets.\r\n const offset = tokens[offsetIndex];\r\n const offsetHours = +tokens[offsetIndex + 1];\r\n const offsetMinutes = +(tokens[offsetIndex + 2] || 0);\r\n switch (offset) {\r\n case \"+\":\r\n hour = hour - offsetHours;\r\n minute = minute - offsetMinutes;\r\n break;\r\n case \"-\":\r\n hour = hour + offsetHours;\r\n minute = minute + offsetMinutes;\r\n break;\r\n case \"Z\":\r\n break;\r\n default:\r\n minute =\r\n minute +\r\n new Date(\r\n Date.UTC(year, month - 1, day, hour, minute)\r\n ).getTimezoneOffset();\r\n break;\r\n }\r\n }\r\n\r\n //ISO8601 denotes a leap second by any time having a seconds component of 60 seconds.\r\n //If that's the case, we need to temporarily subtract a second in order to build a UTC date.\r\n //Then we add it back in after converting to TAI.\r\n const isLeapSecond = second === 60;\r\n if (isLeapSecond) {\r\n second--;\r\n }\r\n\r\n //Even if we successfully parsed the string into its components, after applying UTC offset or\r\n //special cases like 24:00:00 denoting midnight, we need to normalize the data appropriately.\r\n\r\n //milliseconds can never be greater than 1000, and seconds can't be above 60, so we start with minutes\r\n while (minute >= 60) {\r\n minute -= 60;\r\n hour++;\r\n }\r\n\r\n while (hour >= 24) {\r\n hour -= 24;\r\n day++;\r\n }\r\n\r\n tmp = inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\r\n while (day > tmp) {\r\n day -= tmp;\r\n month++;\r\n\r\n if (month > 12) {\r\n month -= 12;\r\n year++;\r\n }\r\n\r\n tmp =\r\n inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\r\n }\r\n\r\n //If UTC offset is at the beginning/end of the day, minutes can be negative.\r\n while (minute < 0) {\r\n minute += 60;\r\n hour--;\r\n }\r\n\r\n while (hour < 0) {\r\n hour += 24;\r\n day--;\r\n }\r\n\r\n while (day < 1) {\r\n month--;\r\n if (month < 1) {\r\n month += 12;\r\n year--;\r\n }\r\n\r\n tmp =\r\n inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];\r\n day += tmp;\r\n }\r\n\r\n //Now create the JulianDate components from the Gregorian date and actually create our instance.\r\n const components = computeJulianDateComponents(\r\n year,\r\n month,\r\n day,\r\n hour,\r\n minute,\r\n second,\r\n millisecond\r\n );\r\n\r\n if (!defined(result)) {\r\n result = new JulianDate(components[0], components[1], TimeStandard.UTC);\r\n } else {\r\n setComponents(components[0], components[1], result);\r\n convertUtcToTai(result);\r\n }\r\n\r\n //If we were on a leap second, add it back.\r\n if (isLeapSecond) {\r\n JulianDate.addSeconds(result, 1, result);\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a new instance that represents the current system time.\r\n * This is equivalent to calling JulianDate.fromDate(new Date());
.\r\n *\r\n * @param {JulianDate} [result] An existing instance to use for the result.\r\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\r\n */\r\nJulianDate.now = function (result) {\r\n return JulianDate.fromDate(new Date(), result);\r\n};\r\n\r\nconst toGregorianDateScratch = new JulianDate(0, 0, TimeStandard.TAI);\r\n\r\n/**\r\n * Creates a {@link GregorianDate} from the provided instance.\r\n *\r\n * @param {JulianDate} julianDate The date to be converted.\r\n * @param {GregorianDate} [result] An existing instance to use for the result.\r\n * @returns {GregorianDate} The modified result parameter or a new instance if none was provided.\r\n */\r\nJulianDate.toGregorianDate = function (julianDate, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(julianDate)) {\r\n throw new DeveloperError(\"julianDate is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n let isLeapSecond = false;\r\n let thisUtc = convertTaiToUtc(julianDate, toGregorianDateScratch);\r\n if (!defined(thisUtc)) {\r\n //Conversion to UTC will fail if we are during a leap second.\r\n //If that's the case, subtract a second and convert again.\r\n //JavaScript doesn't support leap seconds, so this results in second 59 being repeated twice.\r\n JulianDate.addSeconds(julianDate, -1, toGregorianDateScratch);\r\n thisUtc = convertTaiToUtc(toGregorianDateScratch, toGregorianDateScratch);\r\n isLeapSecond = true;\r\n }\r\n\r\n let julianDayNumber = thisUtc.dayNumber;\r\n const secondsOfDay = thisUtc.secondsOfDay;\r\n\r\n if (secondsOfDay >= 43200.0) {\r\n julianDayNumber += 1;\r\n }\r\n\r\n // Algorithm from page 604 of the Explanatory Supplement to the\r\n // Astronomical Almanac (Seidelmann 1992).\r\n let L = (julianDayNumber + 68569) | 0;\r\n const N = ((4 * L) / 146097) | 0;\r\n L = (L - (((146097 * N + 3) / 4) | 0)) | 0;\r\n const I = ((4000 * (L + 1)) / 1461001) | 0;\r\n L = (L - (((1461 * I) / 4) | 0) + 31) | 0;\r\n const J = ((80 * L) / 2447) | 0;\r\n const day = (L - (((2447 * J) / 80) | 0)) | 0;\r\n L = (J / 11) | 0;\r\n const month = (J + 2 - 12 * L) | 0;\r\n const year = (100 * (N - 49) + I + L) | 0;\r\n\r\n let hour = (secondsOfDay / TimeConstants.SECONDS_PER_HOUR) | 0;\r\n let remainingSeconds = secondsOfDay - hour * TimeConstants.SECONDS_PER_HOUR;\r\n const minute = (remainingSeconds / TimeConstants.SECONDS_PER_MINUTE) | 0;\r\n remainingSeconds =\r\n remainingSeconds - minute * TimeConstants.SECONDS_PER_MINUTE;\r\n let second = remainingSeconds | 0;\r\n const millisecond =\r\n (remainingSeconds - second) / TimeConstants.SECONDS_PER_MILLISECOND;\r\n\r\n // JulianDates are noon-based\r\n hour += 12;\r\n if (hour > 23) {\r\n hour -= 24;\r\n }\r\n\r\n //If we were on a leap second, add it back.\r\n if (isLeapSecond) {\r\n second += 1;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new GregorianDate(\r\n year,\r\n month,\r\n day,\r\n hour,\r\n minute,\r\n second,\r\n millisecond,\r\n isLeapSecond\r\n );\r\n }\r\n\r\n result.year = year;\r\n result.month = month;\r\n result.day = day;\r\n result.hour = hour;\r\n result.minute = minute;\r\n result.second = second;\r\n result.millisecond = millisecond;\r\n result.isLeapSecond = isLeapSecond;\r\n return result;\r\n};\r\n\r\n/**\r\n * Creates a JavaScript Date from the provided instance.\r\n * Since JavaScript dates are only accurate to the nearest millisecond and\r\n * cannot represent a leap second, consider using {@link JulianDate.toGregorianDate} instead.\r\n * If the provided JulianDate is during a leap second, the previous second is used.\r\n *\r\n * @param {JulianDate} julianDate The date to be converted.\r\n * @returns {Date} A new instance representing the provided date.\r\n */\r\nJulianDate.toDate = function (julianDate) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(julianDate)) {\r\n throw new DeveloperError(\"julianDate is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);\r\n let second = gDate.second;\r\n if (gDate.isLeapSecond) {\r\n second -= 1;\r\n }\r\n return new Date(\r\n Date.UTC(\r\n gDate.year,\r\n gDate.month - 1,\r\n gDate.day,\r\n gDate.hour,\r\n gDate.minute,\r\n second,\r\n gDate.millisecond\r\n )\r\n );\r\n};\r\n\r\n/**\r\n * Creates an ISO8601 representation of the provided date.\r\n *\r\n * @param {JulianDate} julianDate The date to be converted.\r\n * @param {Number} [precision] The number of fractional digits used to represent the seconds component. By default, the most precise representation is used.\r\n * @returns {String} The ISO8601 representation of the provided date.\r\n */\r\nJulianDate.toIso8601 = function (julianDate, precision) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(julianDate)) {\r\n throw new DeveloperError(\"julianDate is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);\r\n let year = gDate.year;\r\n let month = gDate.month;\r\n let day = gDate.day;\r\n let hour = gDate.hour;\r\n const minute = gDate.minute;\r\n const second = gDate.second;\r\n const millisecond = gDate.millisecond;\r\n\r\n // special case - Iso8601.MAXIMUM_VALUE produces a string which we can't parse unless we adjust.\r\n // 10000-01-01T00:00:00 is the same instant as 9999-12-31T24:00:00\r\n if (\r\n year === 10000 &&\r\n month === 1 &&\r\n day === 1 &&\r\n hour === 0 &&\r\n minute === 0 &&\r\n second === 0 &&\r\n millisecond === 0\r\n ) {\r\n year = 9999;\r\n month = 12;\r\n day = 31;\r\n hour = 24;\r\n }\r\n\r\n let millisecondStr;\r\n\r\n if (!defined(precision) && millisecond !== 0) {\r\n //Forces milliseconds into a number with at least 3 digits to whatever the default toString() precision is.\r\n millisecondStr = (millisecond * 0.01).toString().replace(\".\", \"\");\r\n return `${year.toString().padStart(4, \"0\")}-${month\r\n .toString()\r\n .padStart(2, \"0\")}-${day\r\n .toString()\r\n .padStart(2, \"0\")}T${hour\r\n .toString()\r\n .padStart(2, \"0\")}:${minute\r\n .toString()\r\n .padStart(2, \"0\")}:${second\r\n .toString()\r\n .padStart(2, \"0\")}.${millisecondStr}Z`;\r\n }\r\n\r\n //Precision is either 0 or milliseconds is 0 with undefined precision, in either case, leave off milliseconds entirely\r\n if (!defined(precision) || precision === 0) {\r\n return `${year.toString().padStart(4, \"0\")}-${month\r\n .toString()\r\n .padStart(2, \"0\")}-${day\r\n .toString()\r\n .padStart(2, \"0\")}T${hour\r\n .toString()\r\n .padStart(2, \"0\")}:${minute\r\n .toString()\r\n .padStart(2, \"0\")}:${second.toString().padStart(2, \"0\")}Z`;\r\n }\r\n\r\n //Forces milliseconds into a number with at least 3 digits to whatever the specified precision is.\r\n millisecondStr = (millisecond * 0.01)\r\n .toFixed(precision)\r\n .replace(\".\", \"\")\r\n .slice(0, precision);\r\n return `${year.toString().padStart(4, \"0\")}-${month\r\n .toString()\r\n .padStart(2, \"0\")}-${day\r\n .toString()\r\n .padStart(2, \"0\")}T${hour\r\n .toString()\r\n .padStart(2, \"0\")}:${minute\r\n .toString()\r\n .padStart(2, \"0\")}:${second\r\n .toString()\r\n .padStart(2, \"0\")}.${millisecondStr}Z`;\r\n};\r\n\r\n/**\r\n * Duplicates a JulianDate instance.\r\n *\r\n * @param {JulianDate} julianDate The date to duplicate.\r\n * @param {JulianDate} [result] An existing instance to use for the result.\r\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided. Returns undefined if julianDate is undefined.\r\n */\r\nJulianDate.clone = function (julianDate, result) {\r\n if (!defined(julianDate)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n return new JulianDate(\r\n julianDate.dayNumber,\r\n julianDate.secondsOfDay,\r\n TimeStandard.TAI\r\n );\r\n }\r\n result.dayNumber = julianDate.dayNumber;\r\n result.secondsOfDay = julianDate.secondsOfDay;\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares two instances.\r\n *\r\n * @param {JulianDate} left The first instance.\r\n * @param {JulianDate} right The second instance.\r\n * @returns {Number} A negative value if left is less than right, a positive value if left is greater than right, or zero if left and right are equal.\r\n */\r\nJulianDate.compare = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(left)) {\r\n throw new DeveloperError(\"left is required.\");\r\n }\r\n if (!defined(right)) {\r\n throw new DeveloperError(\"right is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const julianDayNumberDifference = left.dayNumber - right.dayNumber;\r\n if (julianDayNumberDifference !== 0) {\r\n return julianDayNumberDifference;\r\n }\r\n return left.secondsOfDay - right.secondsOfDay;\r\n};\r\n\r\n/**\r\n * Compares two instances and returns true
if they are equal, false
otherwise.\r\n *\r\n * @param {JulianDate} [left] The first instance.\r\n * @param {JulianDate} [right] The second instance.\r\n * @returns {Boolean} true
if the dates are equal; otherwise, false
.\r\n */\r\nJulianDate.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left.dayNumber === right.dayNumber &&\r\n left.secondsOfDay === right.secondsOfDay)\r\n );\r\n};\r\n\r\n/**\r\n * Compares two instances and returns true
if they are within epsilon
seconds of\r\n * each other. That is, in order for the dates to be considered equal (and for\r\n * this function to return true
), the absolute value of the difference between them, in\r\n * seconds, must be less than epsilon
.\r\n *\r\n * @param {JulianDate} [left] The first instance.\r\n * @param {JulianDate} [right] The second instance.\r\n * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances.\r\n * @returns {Boolean} true
if the two dates are within epsilon
seconds of each other; otherwise false
.\r\n */\r\nJulianDate.equalsEpsilon = function (left, right, epsilon) {\r\n epsilon = defaultValue(epsilon, 0);\r\n\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n Math.abs(JulianDate.secondsDifference(left, right)) <= epsilon)\r\n );\r\n};\r\n\r\n/**\r\n * Computes the total number of whole and fractional days represented by the provided instance.\r\n *\r\n * @param {JulianDate} julianDate The date.\r\n * @returns {Number} The Julian date as single floating point number.\r\n */\r\nJulianDate.totalDays = function (julianDate) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(julianDate)) {\r\n throw new DeveloperError(\"julianDate is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n return (\r\n julianDate.dayNumber +\r\n julianDate.secondsOfDay / TimeConstants.SECONDS_PER_DAY\r\n );\r\n};\r\n\r\n/**\r\n * Computes the difference in seconds between the provided instance.\r\n *\r\n * @param {JulianDate} left The first instance.\r\n * @param {JulianDate} right The second instance.\r\n * @returns {Number} The difference, in seconds, when subtracting right
from left
.\r\n */\r\nJulianDate.secondsDifference = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(left)) {\r\n throw new DeveloperError(\"left is required.\");\r\n }\r\n if (!defined(right)) {\r\n throw new DeveloperError(\"right is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const dayDifference =\r\n (left.dayNumber - right.dayNumber) * TimeConstants.SECONDS_PER_DAY;\r\n return dayDifference + (left.secondsOfDay - right.secondsOfDay);\r\n};\r\n\r\n/**\r\n * Computes the difference in days between the provided instance.\r\n *\r\n * @param {JulianDate} left The first instance.\r\n * @param {JulianDate} right The second instance.\r\n * @returns {Number} The difference, in days, when subtracting right
from left
.\r\n */\r\nJulianDate.daysDifference = function (left, right) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(left)) {\r\n throw new DeveloperError(\"left is required.\");\r\n }\r\n if (!defined(right)) {\r\n throw new DeveloperError(\"right is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const dayDifference = left.dayNumber - right.dayNumber;\r\n const secondDifference =\r\n (left.secondsOfDay - right.secondsOfDay) / TimeConstants.SECONDS_PER_DAY;\r\n return dayDifference + secondDifference;\r\n};\r\n\r\n/**\r\n * Computes the number of seconds the provided instance is ahead of UTC.\r\n *\r\n * @param {JulianDate} julianDate The date.\r\n * @returns {Number} The number of seconds the provided instance is ahead of UTC\r\n */\r\nJulianDate.computeTaiMinusUtc = function (julianDate) {\r\n binarySearchScratchLeapSecond.julianDate = julianDate;\r\n const leapSeconds = JulianDate.leapSeconds;\r\n let index = binarySearch(\r\n leapSeconds,\r\n binarySearchScratchLeapSecond,\r\n compareLeapSecondDates\r\n );\r\n if (index < 0) {\r\n index = ~index;\r\n --index;\r\n if (index < 0) {\r\n index = 0;\r\n }\r\n }\r\n return leapSeconds[index].offset;\r\n};\r\n\r\n/**\r\n * Adds the provided number of seconds to the provided date instance.\r\n *\r\n * @param {JulianDate} julianDate The date.\r\n * @param {Number} seconds The number of seconds to add or subtract.\r\n * @param {JulianDate} result An existing instance to use for the result.\r\n * @returns {JulianDate} The modified result parameter.\r\n */\r\nJulianDate.addSeconds = function (julianDate, seconds, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(julianDate)) {\r\n throw new DeveloperError(\"julianDate is required.\");\r\n }\r\n if (!defined(seconds)) {\r\n throw new DeveloperError(\"seconds is required.\");\r\n }\r\n if (!defined(result)) {\r\n throw new DeveloperError(\"result is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n return setComponents(\r\n julianDate.dayNumber,\r\n julianDate.secondsOfDay + seconds,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Adds the provided number of minutes to the provided date instance.\r\n *\r\n * @param {JulianDate} julianDate The date.\r\n * @param {Number} minutes The number of minutes to add or subtract.\r\n * @param {JulianDate} result An existing instance to use for the result.\r\n * @returns {JulianDate} The modified result parameter.\r\n */\r\nJulianDate.addMinutes = function (julianDate, minutes, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(julianDate)) {\r\n throw new DeveloperError(\"julianDate is required.\");\r\n }\r\n if (!defined(minutes)) {\r\n throw new DeveloperError(\"minutes is required.\");\r\n }\r\n if (!defined(result)) {\r\n throw new DeveloperError(\"result is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const newSecondsOfDay =\r\n julianDate.secondsOfDay + minutes * TimeConstants.SECONDS_PER_MINUTE;\r\n return setComponents(julianDate.dayNumber, newSecondsOfDay, result);\r\n};\r\n\r\n/**\r\n * Adds the provided number of hours to the provided date instance.\r\n *\r\n * @param {JulianDate} julianDate The date.\r\n * @param {Number} hours The number of hours to add or subtract.\r\n * @param {JulianDate} result An existing instance to use for the result.\r\n * @returns {JulianDate} The modified result parameter.\r\n */\r\nJulianDate.addHours = function (julianDate, hours, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(julianDate)) {\r\n throw new DeveloperError(\"julianDate is required.\");\r\n }\r\n if (!defined(hours)) {\r\n throw new DeveloperError(\"hours is required.\");\r\n }\r\n if (!defined(result)) {\r\n throw new DeveloperError(\"result is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const newSecondsOfDay =\r\n julianDate.secondsOfDay + hours * TimeConstants.SECONDS_PER_HOUR;\r\n return setComponents(julianDate.dayNumber, newSecondsOfDay, result);\r\n};\r\n\r\n/**\r\n * Adds the provided number of days to the provided date instance.\r\n *\r\n * @param {JulianDate} julianDate The date.\r\n * @param {Number} days The number of days to add or subtract.\r\n * @param {JulianDate} result An existing instance to use for the result.\r\n * @returns {JulianDate} The modified result parameter.\r\n */\r\nJulianDate.addDays = function (julianDate, days, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(julianDate)) {\r\n throw new DeveloperError(\"julianDate is required.\");\r\n }\r\n if (!defined(days)) {\r\n throw new DeveloperError(\"days is required.\");\r\n }\r\n if (!defined(result)) {\r\n throw new DeveloperError(\"result is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const newJulianDayNumber = julianDate.dayNumber + days;\r\n return setComponents(newJulianDayNumber, julianDate.secondsOfDay, result);\r\n};\r\n\r\n/**\r\n * Compares the provided instances and returns true
if left
is earlier than right
, false
otherwise.\r\n *\r\n * @param {JulianDate} left The first instance.\r\n * @param {JulianDate} right The second instance.\r\n * @returns {Boolean} true
if left
is earlier than right
, false
otherwise.\r\n */\r\nJulianDate.lessThan = function (left, right) {\r\n return JulianDate.compare(left, right) < 0;\r\n};\r\n\r\n/**\r\n * Compares the provided instances and returns true
if left
is earlier than or equal to right
, false
otherwise.\r\n *\r\n * @param {JulianDate} left The first instance.\r\n * @param {JulianDate} right The second instance.\r\n * @returns {Boolean} true
if left
is earlier than or equal to right
, false
otherwise.\r\n */\r\nJulianDate.lessThanOrEquals = function (left, right) {\r\n return JulianDate.compare(left, right) <= 0;\r\n};\r\n\r\n/**\r\n * Compares the provided instances and returns true
if left
is later than right
, false
otherwise.\r\n *\r\n * @param {JulianDate} left The first instance.\r\n * @param {JulianDate} right The second instance.\r\n * @returns {Boolean} true
if left
is later than right
, false
otherwise.\r\n */\r\nJulianDate.greaterThan = function (left, right) {\r\n return JulianDate.compare(left, right) > 0;\r\n};\r\n\r\n/**\r\n * Compares the provided instances and returns true
if left
is later than or equal to right
, false
otherwise.\r\n *\r\n * @param {JulianDate} left The first instance.\r\n * @param {JulianDate} right The second instance.\r\n * @returns {Boolean} true
if left
is later than or equal to right
, false
otherwise.\r\n */\r\nJulianDate.greaterThanOrEquals = function (left, right) {\r\n return JulianDate.compare(left, right) >= 0;\r\n};\r\n\r\n/**\r\n * Duplicates this instance.\r\n *\r\n * @param {JulianDate} [result] An existing instance to use for the result.\r\n * @returns {JulianDate} The modified result parameter or a new instance if none was provided.\r\n */\r\nJulianDate.prototype.clone = function (result) {\r\n return JulianDate.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares this and the provided instance and returns true
if they are equal, false
otherwise.\r\n *\r\n * @param {JulianDate} [right] The second instance.\r\n * @returns {Boolean} true
if the dates are equal; otherwise, false
.\r\n */\r\nJulianDate.prototype.equals = function (right) {\r\n return JulianDate.equals(this, right);\r\n};\r\n\r\n/**\r\n * Compares this and the provided instance and returns true
if they are within epsilon
seconds of\r\n * each other. That is, in order for the dates to be considered equal (and for\r\n * this function to return true
), the absolute value of the difference between them, in\r\n * seconds, must be less than epsilon
.\r\n *\r\n * @param {JulianDate} [right] The second instance.\r\n * @param {Number} [epsilon=0] The maximum number of seconds that should separate the two instances.\r\n * @returns {Boolean} true
if the two dates are within epsilon
seconds of each other; otherwise false
.\r\n */\r\nJulianDate.prototype.equalsEpsilon = function (right, epsilon) {\r\n return JulianDate.equalsEpsilon(this, right, epsilon);\r\n};\r\n\r\n/**\r\n * Creates a string representing this date in ISO8601 format.\r\n *\r\n * @returns {String} A string representing this date in ISO8601 format.\r\n */\r\nJulianDate.prototype.toString = function () {\r\n return JulianDate.toIso8601(this);\r\n};\r\n\r\n/**\r\n * Gets or sets the list of leap seconds used throughout Cesium.\r\n * @memberof JulianDate\r\n * @type {LeapSecond[]}\r\n */\r\nJulianDate.leapSeconds = [\r\n new LeapSecond(new JulianDate(2441317, 43210.0, TimeStandard.TAI), 10), // January 1, 1972 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2441499, 43211.0, TimeStandard.TAI), 11), // July 1, 1972 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2441683, 43212.0, TimeStandard.TAI), 12), // January 1, 1973 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2442048, 43213.0, TimeStandard.TAI), 13), // January 1, 1974 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2442413, 43214.0, TimeStandard.TAI), 14), // January 1, 1975 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2442778, 43215.0, TimeStandard.TAI), 15), // January 1, 1976 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2443144, 43216.0, TimeStandard.TAI), 16), // January 1, 1977 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2443509, 43217.0, TimeStandard.TAI), 17), // January 1, 1978 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2443874, 43218.0, TimeStandard.TAI), 18), // January 1, 1979 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2444239, 43219.0, TimeStandard.TAI), 19), // January 1, 1980 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2444786, 43220.0, TimeStandard.TAI), 20), // July 1, 1981 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2445151, 43221.0, TimeStandard.TAI), 21), // July 1, 1982 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2445516, 43222.0, TimeStandard.TAI), 22), // July 1, 1983 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2446247, 43223.0, TimeStandard.TAI), 23), // July 1, 1985 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2447161, 43224.0, TimeStandard.TAI), 24), // January 1, 1988 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2447892, 43225.0, TimeStandard.TAI), 25), // January 1, 1990 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2448257, 43226.0, TimeStandard.TAI), 26), // January 1, 1991 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2448804, 43227.0, TimeStandard.TAI), 27), // July 1, 1992 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2449169, 43228.0, TimeStandard.TAI), 28), // July 1, 1993 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2449534, 43229.0, TimeStandard.TAI), 29), // July 1, 1994 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2450083, 43230.0, TimeStandard.TAI), 30), // January 1, 1996 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2450630, 43231.0, TimeStandard.TAI), 31), // July 1, 1997 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2451179, 43232.0, TimeStandard.TAI), 32), // January 1, 1999 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2453736, 43233.0, TimeStandard.TAI), 33), // January 1, 2006 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2454832, 43234.0, TimeStandard.TAI), 34), // January 1, 2009 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2456109, 43235.0, TimeStandard.TAI), 35), // July 1, 2012 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2457204, 43236.0, TimeStandard.TAI), 36), // July 1, 2015 00:00:00 UTC\r\n new LeapSecond(new JulianDate(2457754, 43237.0, TimeStandard.TAI), 37), // January 1, 2017 00:00:00 UTC\r\n];\r\nexport default JulianDate;\r\n","/*! https://mths.be/punycode v1.4.0 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see \n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.3.2',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see \n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n","/*!\n * URI.js - Mutating URLs\n * IPv6 Support\n *\n * Version: 1.19.11\n *\n * Author: Rodney Rehm\n * Web: http://medialize.github.io/URI.js/\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n *\n */\n\n(function (root, factory) {\n 'use strict';\n // https://github.com/umdjs/umd/blob/master/returnExports.js\n if (typeof module === 'object' && module.exports) {\n // Node\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(factory);\n } else {\n // Browser globals (root is window)\n root.IPv6 = factory(root);\n }\n}(this, function (root) {\n 'use strict';\n\n /*\n var _in = \"fe80:0000:0000:0000:0204:61ff:fe9d:f156\";\n var _out = IPv6.best(_in);\n var _expected = \"fe80::204:61ff:fe9d:f156\";\n\n console.log(_in, _out, _expected, _out === _expected);\n */\n\n // save current IPv6 variable, if any\n var _IPv6 = root && root.IPv6;\n\n function bestPresentation(address) {\n // based on:\n // Javascript to test an IPv6 address for proper format, and to\n // present the \"best text representation\" according to IETF Draft RFC at\n // http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04\n // 8 Feb 2010 Rich Brown, Dartware, LLC\n // Please feel free to use this code as long as you provide a link to\n // http://www.intermapper.com\n // http://intermapper.com/support/tools/IPV6-Validator.aspx\n // http://download.dartware.com/thirdparty/ipv6validator.js\n\n var _address = address.toLowerCase();\n var segments = _address.split(':');\n var length = segments.length;\n var total = 8;\n\n // trim colons (:: or ::a:b:c… or …a:b:c::)\n if (segments[0] === '' && segments[1] === '' && segments[2] === '') {\n // must have been ::\n // remove first two items\n segments.shift();\n segments.shift();\n } else if (segments[0] === '' && segments[1] === '') {\n // must have been ::xxxx\n // remove the first item\n segments.shift();\n } else if (segments[length - 1] === '' && segments[length - 2] === '') {\n // must have been xxxx::\n segments.pop();\n }\n\n length = segments.length;\n\n // adjust total segments for IPv4 trailer\n if (segments[length - 1].indexOf('.') !== -1) {\n // found a \".\" which means IPv4\n total = 7;\n }\n\n // fill empty segments them with \"0000\"\n var pos;\n for (pos = 0; pos < length; pos++) {\n if (segments[pos] === '') {\n break;\n }\n }\n\n if (pos < total) {\n segments.splice(pos, 1, '0000');\n while (segments.length < total) {\n segments.splice(pos, 0, '0000');\n }\n }\n\n // strip leading zeros\n var _segments;\n for (var i = 0; i < total; i++) {\n _segments = segments[i].split('');\n for (var j = 0; j < 3 ; j++) {\n if (_segments[0] === '0' && _segments.length > 1) {\n _segments.splice(0,1);\n } else {\n break;\n }\n }\n\n segments[i] = _segments.join('');\n }\n\n // find longest sequence of zeroes and coalesce them into one segment\n var best = -1;\n var _best = 0;\n var _current = 0;\n var current = -1;\n var inzeroes = false;\n // i; already declared\n\n for (i = 0; i < total; i++) {\n if (inzeroes) {\n if (segments[i] === '0') {\n _current += 1;\n } else {\n inzeroes = false;\n if (_current > _best) {\n best = current;\n _best = _current;\n }\n }\n } else {\n if (segments[i] === '0') {\n inzeroes = true;\n current = i;\n _current = 1;\n }\n }\n }\n\n if (_current > _best) {\n best = current;\n _best = _current;\n }\n\n if (_best > 1) {\n segments.splice(best, _best, '');\n }\n\n length = segments.length;\n\n // assemble remaining segments\n var result = '';\n if (segments[0] === '') {\n result = ':';\n }\n\n for (i = 0; i < length; i++) {\n result += segments[i];\n if (i === length - 1) {\n break;\n }\n\n result += ':';\n }\n\n if (segments[length - 1] === '') {\n result += ':';\n }\n\n return result;\n }\n\n function noConflict() {\n /*jshint validthis: true */\n if (root.IPv6 === this) {\n root.IPv6 = _IPv6;\n }\n\n return this;\n }\n\n return {\n best: bestPresentation,\n noConflict: noConflict\n };\n}));\n","/*!\n * URI.js - Mutating URLs\n * Second Level Domain (SLD) Support\n *\n * Version: 1.19.11\n *\n * Author: Rodney Rehm\n * Web: http://medialize.github.io/URI.js/\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n *\n */\n\n(function (root, factory) {\n 'use strict';\n // https://github.com/umdjs/umd/blob/master/returnExports.js\n if (typeof module === 'object' && module.exports) {\n // Node\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(factory);\n } else {\n // Browser globals (root is window)\n root.SecondLevelDomains = factory(root);\n }\n}(this, function (root) {\n 'use strict';\n\n // save current SecondLevelDomains variable, if any\n var _SecondLevelDomains = root && root.SecondLevelDomains;\n\n var SLD = {\n // list of known Second Level Domains\n // converted list of SLDs from https://github.com/gavingmiller/second-level-domains\n // ----\n // publicsuffix.org is more current and actually used by a couple of browsers internally.\n // downside is it also contains domains like \"dyndns.org\" - which is fine for the security\n // issues browser have to deal with (SOP for cookies, etc) - but is way overboard for URI.js\n // ----\n list: {\n 'ac':' com gov mil net org ',\n 'ae':' ac co gov mil name net org pro sch ',\n 'af':' com edu gov net org ',\n 'al':' com edu gov mil net org ',\n 'ao':' co ed gv it og pb ',\n 'ar':' com edu gob gov int mil net org tur ',\n 'at':' ac co gv or ',\n 'au':' asn com csiro edu gov id net org ',\n 'ba':' co com edu gov mil net org rs unbi unmo unsa untz unze ',\n 'bb':' biz co com edu gov info net org store tv ',\n 'bh':' biz cc com edu gov info net org ',\n 'bn':' com edu gov net org ',\n 'bo':' com edu gob gov int mil net org tv ',\n 'br':' adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ',\n 'bs':' com edu gov net org ',\n 'bz':' du et om ov rg ',\n 'ca':' ab bc mb nb nf nl ns nt nu on pe qc sk yk ',\n 'ck':' biz co edu gen gov info net org ',\n 'cn':' ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ',\n 'co':' com edu gov mil net nom org ',\n 'cr':' ac c co ed fi go or sa ',\n 'cy':' ac biz com ekloges gov ltd name net org parliament press pro tm ',\n 'do':' art com edu gob gov mil net org sld web ',\n 'dz':' art asso com edu gov net org pol ',\n 'ec':' com edu fin gov info med mil net org pro ',\n 'eg':' com edu eun gov mil name net org sci ',\n 'er':' com edu gov ind mil net org rochest w ',\n 'es':' com edu gob nom org ',\n 'et':' biz com edu gov info name net org ',\n 'fj':' ac biz com info mil name net org pro ',\n 'fk':' ac co gov net nom org ',\n 'fr':' asso com f gouv nom prd presse tm ',\n 'gg':' co net org ',\n 'gh':' com edu gov mil org ',\n 'gn':' ac com gov net org ',\n 'gr':' com edu gov mil net org ',\n 'gt':' com edu gob ind mil net org ',\n 'gu':' com edu gov net org ',\n 'hk':' com edu gov idv net org ',\n 'hu':' 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ',\n 'id':' ac co go mil net or sch web ',\n 'il':' ac co gov idf k12 muni net org ',\n 'in':' ac co edu ernet firm gen gov i ind mil net nic org res ',\n 'iq':' com edu gov i mil net org ',\n 'ir':' ac co dnssec gov i id net org sch ',\n 'it':' edu gov ',\n 'je':' co net org ',\n 'jo':' com edu gov mil name net org sch ',\n 'jp':' ac ad co ed go gr lg ne or ',\n 'ke':' ac co go info me mobi ne or sc ',\n 'kh':' com edu gov mil net org per ',\n 'ki':' biz com de edu gov info mob net org tel ',\n 'km':' asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ',\n 'kn':' edu gov net org ',\n 'kr':' ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ',\n 'kw':' com edu gov net org ',\n 'ky':' com edu gov net org ',\n 'kz':' com edu gov mil net org ',\n 'lb':' com edu gov net org ',\n 'lk':' assn com edu gov grp hotel int ltd net ngo org sch soc web ',\n 'lr':' com edu gov net org ',\n 'lv':' asn com conf edu gov id mil net org ',\n 'ly':' com edu gov id med net org plc sch ',\n 'ma':' ac co gov m net org press ',\n 'mc':' asso tm ',\n 'me':' ac co edu gov its net org priv ',\n 'mg':' com edu gov mil nom org prd tm ',\n 'mk':' com edu gov inf name net org pro ',\n 'ml':' com edu gov net org presse ',\n 'mn':' edu gov org ',\n 'mo':' com edu gov net org ',\n 'mt':' com edu gov net org ',\n 'mv':' aero biz com coop edu gov info int mil museum name net org pro ',\n 'mw':' ac co com coop edu gov int museum net org ',\n 'mx':' com edu gob net org ',\n 'my':' com edu gov mil name net org sch ',\n 'nf':' arts com firm info net other per rec store web ',\n 'ng':' biz com edu gov mil mobi name net org sch ',\n 'ni':' ac co com edu gob mil net nom org ',\n 'np':' com edu gov mil net org ',\n 'nr':' biz com edu gov info net org ',\n 'om':' ac biz co com edu gov med mil museum net org pro sch ',\n 'pe':' com edu gob mil net nom org sld ',\n 'ph':' com edu gov i mil net ngo org ',\n 'pk':' biz com edu fam gob gok gon gop gos gov net org web ',\n 'pl':' art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ',\n 'pr':' ac biz com edu est gov info isla name net org pro prof ',\n 'ps':' com edu gov net org plo sec ',\n 'pw':' belau co ed go ne or ',\n 'ro':' arts com firm info nom nt org rec store tm www ',\n 'rs':' ac co edu gov in org ',\n 'sb':' com edu gov net org ',\n 'sc':' com edu gov net org ',\n 'sh':' co com edu gov net nom org ',\n 'sl':' com edu gov net org ',\n 'st':' co com consulado edu embaixada gov mil net org principe saotome store ',\n 'sv':' com edu gob org red ',\n 'sz':' ac co org ',\n 'tr':' av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ',\n 'tt':' aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ',\n 'tw':' club com ebiz edu game gov idv mil net org ',\n 'mu':' ac co com gov net or org ',\n 'mz':' ac co edu gov org ',\n 'na':' co com ',\n 'nz':' ac co cri geek gen govt health iwi maori mil net org parliament school ',\n 'pa':' abo ac com edu gob ing med net nom org sld ',\n 'pt':' com edu gov int net nome org publ ',\n 'py':' com edu gov mil net org ',\n 'qa':' com edu gov mil net org ',\n 're':' asso com nom ',\n 'ru':' ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ',\n 'rw':' ac co com edu gouv gov int mil net ',\n 'sa':' com edu gov med net org pub sch ',\n 'sd':' com edu gov info med net org tv ',\n 'se':' a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ',\n 'sg':' com edu gov idn net org per ',\n 'sn':' art com edu gouv org perso univ ',\n 'sy':' com edu gov mil net news org ',\n 'th':' ac co go in mi net or ',\n 'tj':' ac biz co com edu go gov info int mil name net nic org test web ',\n 'tn':' agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ',\n 'tz':' ac co go ne or ',\n 'ua':' biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ',\n 'ug':' ac co go ne or org sc ',\n 'uk':' ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ',\n 'us':' dni fed isa kids nsn ',\n 'uy':' com edu gub mil net org ',\n 've':' co com edu gob info mil net org web ',\n 'vi':' co com k12 net org ',\n 'vn':' ac biz com edu gov health info int name net org pro ',\n 'ye':' co com gov ltd me net org plc ',\n 'yu':' ac co edu gov org ',\n 'za':' ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ',\n 'zm':' ac co com edu gov net org sch ',\n // https://en.wikipedia.org/wiki/CentralNic#Second-level_domains\n 'com': 'ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ',\n 'net': 'gb jp se uk ',\n 'org': 'ae',\n 'de': 'com '\n },\n // gorhill 2013-10-25: Using indexOf() instead Regexp(). Significant boost\n // in both performance and memory footprint. No initialization required.\n // http://jsperf.com/uri-js-sld-regex-vs-binary-search/4\n // Following methods use lastIndexOf() rather than array.split() in order\n // to avoid any memory allocations.\n has: function(domain) {\n var tldOffset = domain.lastIndexOf('.');\n if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {\n return false;\n }\n var sldOffset = domain.lastIndexOf('.', tldOffset-1);\n if (sldOffset <= 0 || sldOffset >= (tldOffset-1)) {\n return false;\n }\n var sldList = SLD.list[domain.slice(tldOffset+1)];\n if (!sldList) {\n return false;\n }\n return sldList.indexOf(' ' + domain.slice(sldOffset+1, tldOffset) + ' ') >= 0;\n },\n is: function(domain) {\n var tldOffset = domain.lastIndexOf('.');\n if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {\n return false;\n }\n var sldOffset = domain.lastIndexOf('.', tldOffset-1);\n if (sldOffset >= 0) {\n return false;\n }\n var sldList = SLD.list[domain.slice(tldOffset+1)];\n if (!sldList) {\n return false;\n }\n return sldList.indexOf(' ' + domain.slice(0, tldOffset) + ' ') >= 0;\n },\n get: function(domain) {\n var tldOffset = domain.lastIndexOf('.');\n if (tldOffset <= 0 || tldOffset >= (domain.length-1)) {\n return null;\n }\n var sldOffset = domain.lastIndexOf('.', tldOffset-1);\n if (sldOffset <= 0 || sldOffset >= (tldOffset-1)) {\n return null;\n }\n var sldList = SLD.list[domain.slice(tldOffset+1)];\n if (!sldList) {\n return null;\n }\n if (sldList.indexOf(' ' + domain.slice(sldOffset+1, tldOffset) + ' ') < 0) {\n return null;\n }\n return domain.slice(sldOffset+1);\n },\n noConflict: function(){\n if (root.SecondLevelDomains === this) {\n root.SecondLevelDomains = _SecondLevelDomains;\n }\n return this;\n }\n };\n\n return SLD;\n}));\n","/*!\n * URI.js - Mutating URLs\n *\n * Version: 1.19.11\n *\n * Author: Rodney Rehm\n * Web: http://medialize.github.io/URI.js/\n *\n * Licensed under\n * MIT License http://www.opensource.org/licenses/mit-license\n *\n */\n(function (root, factory) {\n 'use strict';\n // https://github.com/umdjs/umd/blob/master/returnExports.js\n if (typeof module === 'object' && module.exports) {\n // Node\n module.exports = factory(require('./punycode'), require('./IPv6'), require('./SecondLevelDomains'));\n } else if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['./punycode', './IPv6', './SecondLevelDomains'], factory);\n } else {\n // Browser globals (root is window)\n root.URI = factory(root.punycode, root.IPv6, root.SecondLevelDomains, root);\n }\n}(this, function (punycode, IPv6, SLD, root) {\n 'use strict';\n /*global location, escape, unescape */\n // FIXME: v2.0.0 renamce non-camelCase properties to uppercase\n /*jshint camelcase: false */\n\n // save current URI variable, if any\n var _URI = root && root.URI;\n\n function URI(url, base) {\n var _urlSupplied = arguments.length >= 1;\n var _baseSupplied = arguments.length >= 2;\n\n // Allow instantiation without the 'new' keyword\n if (!(this instanceof URI)) {\n if (_urlSupplied) {\n if (_baseSupplied) {\n return new URI(url, base);\n }\n\n return new URI(url);\n }\n\n return new URI();\n }\n\n if (url === undefined) {\n if (_urlSupplied) {\n throw new TypeError('undefined is not a valid argument for URI');\n }\n\n if (typeof location !== 'undefined') {\n url = location.href + '';\n } else {\n url = '';\n }\n }\n\n if (url === null) {\n if (_urlSupplied) {\n throw new TypeError('null is not a valid argument for URI');\n }\n }\n\n this.href(url);\n\n // resolve to base according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#constructor\n if (base !== undefined) {\n return this.absoluteTo(base);\n }\n\n return this;\n }\n\n function isInteger(value) {\n return /^[0-9]+$/.test(value);\n }\n\n URI.version = '1.19.11';\n\n var p = URI.prototype;\n var hasOwn = Object.prototype.hasOwnProperty;\n\n function escapeRegEx(string) {\n // https://github.com/medialize/URI.js/commit/85ac21783c11f8ccab06106dba9735a31a86924d#commitcomment-821963\n return string.replace(/([.*+?^=!:${}()|[\\]\\/\\\\])/g, '\\\\$1');\n }\n\n function getType(value) {\n // IE8 doesn't return [Object Undefined] but [Object Object] for undefined value\n if (value === undefined) {\n return 'Undefined';\n }\n\n return String(Object.prototype.toString.call(value)).slice(8, -1);\n }\n\n function isArray(obj) {\n return getType(obj) === 'Array';\n }\n\n function filterArrayValues(data, value) {\n var lookup = {};\n var i, length;\n\n if (getType(value) === 'RegExp') {\n lookup = null;\n } else if (isArray(value)) {\n for (i = 0, length = value.length; i < length; i++) {\n lookup[value[i]] = true;\n }\n } else {\n lookup[value] = true;\n }\n\n for (i = 0, length = data.length; i < length; i++) {\n /*jshint laxbreak: true */\n var _match = lookup && lookup[data[i]] !== undefined\n || !lookup && value.test(data[i]);\n /*jshint laxbreak: false */\n if (_match) {\n data.splice(i, 1);\n length--;\n i--;\n }\n }\n\n return data;\n }\n\n function arrayContains(list, value) {\n var i, length;\n\n // value may be string, number, array, regexp\n if (isArray(value)) {\n // Note: this can be optimized to O(n) (instead of current O(m * n))\n for (i = 0, length = value.length; i < length; i++) {\n if (!arrayContains(list, value[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n var _type = getType(value);\n for (i = 0, length = list.length; i < length; i++) {\n if (_type === 'RegExp') {\n if (typeof list[i] === 'string' && list[i].match(value)) {\n return true;\n }\n } else if (list[i] === value) {\n return true;\n }\n }\n\n return false;\n }\n\n function arraysEqual(one, two) {\n if (!isArray(one) || !isArray(two)) {\n return false;\n }\n\n // arrays can't be equal if they have different amount of content\n if (one.length !== two.length) {\n return false;\n }\n\n one.sort();\n two.sort();\n\n for (var i = 0, l = one.length; i < l; i++) {\n if (one[i] !== two[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n function trimSlashes(text) {\n var trim_expression = /^\\/+|\\/+$/g;\n return text.replace(trim_expression, '');\n }\n\n URI._parts = function() {\n return {\n protocol: null,\n username: null,\n password: null,\n hostname: null,\n urn: null,\n port: null,\n path: null,\n query: null,\n fragment: null,\n // state\n preventInvalidHostname: URI.preventInvalidHostname,\n duplicateQueryParameters: URI.duplicateQueryParameters,\n escapeQuerySpace: URI.escapeQuerySpace\n };\n };\n // state: throw on invalid hostname\n // see https://github.com/medialize/URI.js/pull/345\n // and https://github.com/medialize/URI.js/issues/354\n URI.preventInvalidHostname = false;\n // state: allow duplicate query parameters (a=1&a=1)\n URI.duplicateQueryParameters = false;\n // state: replaces + with %20 (space in query strings)\n URI.escapeQuerySpace = true;\n // static properties\n URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i;\n URI.idn_expression = /[^a-z0-9\\._-]/i;\n URI.punycode_expression = /(xn--)/i;\n // well, 333.444.555.666 matches, but it sure ain't no IPv4 - do we care?\n URI.ip4_expression = /^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/;\n // credits to Rich Brown\n // source: http://forums.intermapper.com/viewtopic.php?p=1096#1096\n // specification: http://www.ietf.org/rfc/rfc4291.txt\n URI.ip6_expression = /^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$/;\n // expression used is \"gruber revised\" (@gruber v2) determined to be the\n // best solution in a regex-golf we did a couple of ages ago at\n // * http://mathiasbynens.be/demo/url-regex\n // * http://rodneyrehm.de/t/url-regex.html\n URI.find_uri_expression = /\\b((?:[a-z][\\w-]+:(?:\\/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}\\/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’]))/ig;\n URI.findUri = {\n // valid \"scheme://\" or \"www.\"\n start: /\\b(?:([a-z][a-z0-9.+-]*:\\/\\/)|www\\.)/gi,\n // everything up to the next whitespace\n end: /[\\s\\r\\n]|$/,\n // trim trailing punctuation captured by end RegExp\n trim: /[`!()\\[\\]{};:'\".,<>?«»“”„‘’]+$/,\n // balanced parens inclusion (), [], {}, <>\n parens: /(\\([^\\)]*\\)|\\[[^\\]]*\\]|\\{[^}]*\\}|<[^>]*>)/g,\n };\n URI.leading_whitespace_expression = /^[\\x00-\\x20\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]+/\n // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n URI.ascii_tab_whitespace = /[\\u0009\\u000A\\u000D]+/g\n // http://www.iana.org/assignments/uri-schemes.html\n // http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports\n URI.defaultPorts = {\n http: '80',\n https: '443',\n ftp: '21',\n gopher: '70',\n ws: '80',\n wss: '443'\n };\n // list of protocols which always require a hostname\n URI.hostProtocols = [\n 'http',\n 'https'\n ];\n\n // allowed hostname characters according to RFC 3986\n // ALPHA DIGIT \"-\" \".\" \"_\" \"~\" \"!\" \"$\" \"&\" \"'\" \"(\" \")\" \"*\" \"+\" \",\" \";\" \"=\" %encoded\n // I've never seen a (non-IDN) hostname other than: ALPHA DIGIT . - _\n URI.invalid_hostname_characters = /[^a-zA-Z0-9\\.\\-:_]/;\n // map DOM Elements to their URI attribute\n URI.domAttributes = {\n 'a': 'href',\n 'blockquote': 'cite',\n 'link': 'href',\n 'base': 'href',\n 'script': 'src',\n 'form': 'action',\n 'img': 'src',\n 'area': 'href',\n 'iframe': 'src',\n 'embed': 'src',\n 'source': 'src',\n 'track': 'src',\n 'input': 'src', // but only if type=\"image\"\n 'audio': 'src',\n 'video': 'src'\n };\n URI.getDomAttribute = function(node) {\n if (!node || !node.nodeName) {\n return undefined;\n }\n\n var nodeName = node.nodeName.toLowerCase();\n // should only expose src for type=\"image\"\n if (nodeName === 'input' && node.type !== 'image') {\n return undefined;\n }\n\n return URI.domAttributes[nodeName];\n };\n\n function escapeForDumbFirefox36(value) {\n // https://github.com/medialize/URI.js/issues/91\n return escape(value);\n }\n\n // encoding / decoding according to RFC3986\n function strictEncodeURIComponent(string) {\n // see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURIComponent\n return encodeURIComponent(string)\n .replace(/[!'()*]/g, escapeForDumbFirefox36)\n .replace(/\\*/g, '%2A');\n }\n URI.encode = strictEncodeURIComponent;\n URI.decode = decodeURIComponent;\n URI.iso8859 = function() {\n URI.encode = escape;\n URI.decode = unescape;\n };\n URI.unicode = function() {\n URI.encode = strictEncodeURIComponent;\n URI.decode = decodeURIComponent;\n };\n URI.characters = {\n pathname: {\n encode: {\n // RFC3986 2.1: For consistency, URI producers and normalizers should\n // use uppercase hexadecimal digits for all percent-encodings.\n expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig,\n map: {\n // -._~!'()*\n '%24': '$',\n '%26': '&',\n '%2B': '+',\n '%2C': ',',\n '%3B': ';',\n '%3D': '=',\n '%3A': ':',\n '%40': '@'\n }\n },\n decode: {\n expression: /[\\/\\?#]/g,\n map: {\n '/': '%2F',\n '?': '%3F',\n '#': '%23'\n }\n }\n },\n reserved: {\n encode: {\n // RFC3986 2.1: For consistency, URI producers and normalizers should\n // use uppercase hexadecimal digits for all percent-encodings.\n expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,\n map: {\n // gen-delims\n '%3A': ':',\n '%2F': '/',\n '%3F': '?',\n '%23': '#',\n '%5B': '[',\n '%5D': ']',\n '%40': '@',\n // sub-delims\n '%21': '!',\n '%24': '$',\n '%26': '&',\n '%27': '\\'',\n '%28': '(',\n '%29': ')',\n '%2A': '*',\n '%2B': '+',\n '%2C': ',',\n '%3B': ';',\n '%3D': '='\n }\n }\n },\n urnpath: {\n // The characters under `encode` are the characters called out by RFC 2141 as being acceptable\n // for usage in a URN. RFC2141 also calls out \"-\", \".\", and \"_\" as acceptable characters, but\n // these aren't encoded by encodeURIComponent, so we don't have to call them out here. Also\n // note that the colon character is not featured in the encoding map; this is because URI.js\n // gives the colons in URNs semantic meaning as the delimiters of path segements, and so it\n // should not appear unencoded in a segment itself.\n // See also the note above about RFC3986 and capitalalized hex digits.\n encode: {\n expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,\n map: {\n '%21': '!',\n '%24': '$',\n '%27': '\\'',\n '%28': '(',\n '%29': ')',\n '%2A': '*',\n '%2B': '+',\n '%2C': ',',\n '%3B': ';',\n '%3D': '=',\n '%40': '@'\n }\n },\n // These characters are the characters called out by RFC2141 as \"reserved\" characters that\n // should never appear in a URN, plus the colon character (see note above).\n decode: {\n expression: /[\\/\\?#:]/g,\n map: {\n '/': '%2F',\n '?': '%3F',\n '#': '%23',\n ':': '%3A'\n }\n }\n }\n };\n URI.encodeQuery = function(string, escapeQuerySpace) {\n var escaped = URI.encode(string + '');\n if (escapeQuerySpace === undefined) {\n escapeQuerySpace = URI.escapeQuerySpace;\n }\n\n return escapeQuerySpace ? escaped.replace(/%20/g, '+') : escaped;\n };\n URI.decodeQuery = function(string, escapeQuerySpace) {\n string += '';\n if (escapeQuerySpace === undefined) {\n escapeQuerySpace = URI.escapeQuerySpace;\n }\n\n try {\n return URI.decode(escapeQuerySpace ? string.replace(/\\+/g, '%20') : string);\n } catch(e) {\n // we're not going to mess with weird encodings,\n // give up and return the undecoded original string\n // see https://github.com/medialize/URI.js/issues/87\n // see https://github.com/medialize/URI.js/issues/92\n return string;\n }\n };\n // generate encode/decode path functions\n var _parts = {'encode':'encode', 'decode':'decode'};\n var _part;\n var generateAccessor = function(_group, _part) {\n return function(string) {\n try {\n return URI[_part](string + '').replace(URI.characters[_group][_part].expression, function(c) {\n return URI.characters[_group][_part].map[c];\n });\n } catch (e) {\n // we're not going to mess with weird encodings,\n // give up and return the undecoded original string\n // see https://github.com/medialize/URI.js/issues/87\n // see https://github.com/medialize/URI.js/issues/92\n return string;\n }\n };\n };\n\n for (_part in _parts) {\n URI[_part + 'PathSegment'] = generateAccessor('pathname', _parts[_part]);\n URI[_part + 'UrnPathSegment'] = generateAccessor('urnpath', _parts[_part]);\n }\n\n var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) {\n return function(string) {\n // Why pass in names of functions, rather than the function objects themselves? The\n // definitions of some functions (but in particular, URI.decode) will occasionally change due\n // to URI.js having ISO8859 and Unicode modes. Passing in the name and getting it will ensure\n // that the functions we use here are \"fresh\".\n var actualCodingFunc;\n if (!_innerCodingFuncName) {\n actualCodingFunc = URI[_codingFuncName];\n } else {\n actualCodingFunc = function(string) {\n return URI[_codingFuncName](URI[_innerCodingFuncName](string));\n };\n }\n\n var segments = (string + '').split(_sep);\n\n for (var i = 0, length = segments.length; i < length; i++) {\n segments[i] = actualCodingFunc(segments[i]);\n }\n\n return segments.join(_sep);\n };\n };\n\n // This takes place outside the above loop because we don't want, e.g., encodeUrnPath functions.\n URI.decodePath = generateSegmentedPathFunction('/', 'decodePathSegment');\n URI.decodeUrnPath = generateSegmentedPathFunction(':', 'decodeUrnPathSegment');\n URI.recodePath = generateSegmentedPathFunction('/', 'encodePathSegment', 'decode');\n URI.recodeUrnPath = generateSegmentedPathFunction(':', 'encodeUrnPathSegment', 'decode');\n\n URI.encodeReserved = generateAccessor('reserved', 'encode');\n\n URI.parse = function(string, parts) {\n var pos;\n if (!parts) {\n parts = {\n preventInvalidHostname: URI.preventInvalidHostname\n };\n }\n\n string = string.replace(URI.leading_whitespace_expression, '')\n // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n string = string.replace(URI.ascii_tab_whitespace, '')\n\n // [protocol\"://\"[username[\":\"password]\"@\"]hostname[\":\"port]\"/\"?][path][\"?\"querystring][\"#\"fragment]\n\n // extract fragment\n pos = string.indexOf('#');\n if (pos > -1) {\n // escaping?\n parts.fragment = string.substring(pos + 1) || null;\n string = string.substring(0, pos);\n }\n\n // extract query\n pos = string.indexOf('?');\n if (pos > -1) {\n // escaping?\n parts.query = string.substring(pos + 1) || null;\n string = string.substring(0, pos);\n }\n\n // slashes and backslashes have lost all meaning for the web protocols (https, http, wss, ws)\n string = string.replace(/^(https?|ftp|wss?)?:+[/\\\\]*/i, '$1://');\n // slashes and backslashes have lost all meaning for scheme relative URLs\n string = string.replace(/^[/\\\\]{2,}/i, '//');\n\n // extract protocol\n if (string.substring(0, 2) === '//') {\n // relative-scheme\n parts.protocol = null;\n string = string.substring(2);\n // extract \"user:pass@host:port\"\n string = URI.parseAuthority(string, parts);\n } else {\n pos = string.indexOf(':');\n if (pos > -1) {\n parts.protocol = string.substring(0, pos) || null;\n if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {\n // : may be within the path\n parts.protocol = undefined;\n } else if (string.substring(pos + 1, pos + 3).replace(/\\\\/g, '/') === '//') {\n string = string.substring(pos + 3);\n\n // extract \"user:pass@host:port\"\n string = URI.parseAuthority(string, parts);\n } else {\n string = string.substring(pos + 1);\n parts.urn = true;\n }\n }\n }\n\n // what's left must be the path\n parts.path = string;\n\n // and we're done\n return parts;\n };\n URI.parseHost = function(string, parts) {\n if (!string) {\n string = '';\n }\n\n // Copy chrome, IE, opera backslash-handling behavior.\n // Back slashes before the query string get converted to forward slashes\n // See: https://github.com/joyent/node/blob/386fd24f49b0e9d1a8a076592a404168faeecc34/lib/url.js#L115-L124\n // See: https://code.google.com/p/chromium/issues/detail?id=25916\n // https://github.com/medialize/URI.js/pull/233\n string = string.replace(/\\\\/g, '/');\n\n // extract host:port\n var pos = string.indexOf('/');\n var bracketPos;\n var t;\n\n if (pos === -1) {\n pos = string.length;\n }\n\n if (string.charAt(0) === '[') {\n // IPv6 host - http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04#section-6\n // I claim most client software breaks on IPv6 anyways. To simplify things, URI only accepts\n // IPv6+port in the format [2001:db8::1]:80 (for the time being)\n bracketPos = string.indexOf(']');\n parts.hostname = string.substring(1, bracketPos) || null;\n parts.port = string.substring(bracketPos + 2, pos) || null;\n if (parts.port === '/') {\n parts.port = null;\n }\n } else {\n var firstColon = string.indexOf(':');\n var firstSlash = string.indexOf('/');\n var nextColon = string.indexOf(':', firstColon + 1);\n if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) {\n // IPv6 host contains multiple colons - but no port\n // this notation is actually not allowed by RFC 3986, but we're a liberal parser\n parts.hostname = string.substring(0, pos) || null;\n parts.port = null;\n } else {\n t = string.substring(0, pos).split(':');\n parts.hostname = t[0] || null;\n parts.port = t[1] || null;\n }\n }\n\n if (parts.hostname && string.substring(pos).charAt(0) !== '/') {\n pos++;\n string = '/' + string;\n }\n\n if (parts.preventInvalidHostname) {\n URI.ensureValidHostname(parts.hostname, parts.protocol);\n }\n\n if (parts.port) {\n URI.ensureValidPort(parts.port);\n }\n\n return string.substring(pos) || '/';\n };\n URI.parseAuthority = function(string, parts) {\n string = URI.parseUserinfo(string, parts);\n return URI.parseHost(string, parts);\n };\n URI.parseUserinfo = function(string, parts) {\n // extract username:password\n var _string = string\n var firstBackSlash = string.indexOf('\\\\');\n if (firstBackSlash !== -1) {\n string = string.replace(/\\\\/g, '/')\n }\n var firstSlash = string.indexOf('/');\n var pos = string.lastIndexOf('@', firstSlash > -1 ? firstSlash : string.length - 1);\n var t;\n\n // authority@ must come before /path or \\path\n if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) {\n t = string.substring(0, pos).split(':');\n parts.username = t[0] ? URI.decode(t[0]) : null;\n t.shift();\n parts.password = t[0] ? URI.decode(t.join(':')) : null;\n string = _string.substring(pos + 1);\n } else {\n parts.username = null;\n parts.password = null;\n }\n\n return string;\n };\n URI.parseQuery = function(string, escapeQuerySpace) {\n if (!string) {\n return {};\n }\n\n // throw out the funky business - \"?\"[name\"=\"value\"&\"]+\n string = string.replace(/&+/g, '&').replace(/^\\?*&*|&+$/g, '');\n\n if (!string) {\n return {};\n }\n\n var items = {};\n var splits = string.split('&');\n var length = splits.length;\n var v, name, value;\n\n for (var i = 0; i < length; i++) {\n v = splits[i].split('=');\n name = URI.decodeQuery(v.shift(), escapeQuerySpace);\n // no \"=\" is null according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#collect-url-parameters\n value = v.length ? URI.decodeQuery(v.join('='), escapeQuerySpace) : null;\n\n if (name === '__proto__') {\n // ignore attempt at exploiting JavaScript internals\n continue;\n } else if (hasOwn.call(items, name)) {\n if (typeof items[name] === 'string' || items[name] === null) {\n items[name] = [items[name]];\n }\n\n items[name].push(value);\n } else {\n items[name] = value;\n }\n }\n\n return items;\n };\n\n URI.build = function(parts) {\n var t = '';\n var requireAbsolutePath = false\n\n if (parts.protocol) {\n t += parts.protocol + ':';\n }\n\n if (!parts.urn && (t || parts.hostname)) {\n t += '//';\n requireAbsolutePath = true\n }\n\n t += (URI.buildAuthority(parts) || '');\n\n if (typeof parts.path === 'string') {\n if (parts.path.charAt(0) !== '/' && requireAbsolutePath) {\n t += '/';\n }\n\n t += parts.path;\n }\n\n if (typeof parts.query === 'string' && parts.query) {\n t += '?' + parts.query;\n }\n\n if (typeof parts.fragment === 'string' && parts.fragment) {\n t += '#' + parts.fragment;\n }\n return t;\n };\n URI.buildHost = function(parts) {\n var t = '';\n\n if (!parts.hostname) {\n return '';\n } else if (URI.ip6_expression.test(parts.hostname)) {\n t += '[' + parts.hostname + ']';\n } else {\n t += parts.hostname;\n }\n\n if (parts.port) {\n t += ':' + parts.port;\n }\n\n return t;\n };\n URI.buildAuthority = function(parts) {\n return URI.buildUserinfo(parts) + URI.buildHost(parts);\n };\n URI.buildUserinfo = function(parts) {\n var t = '';\n\n if (parts.username) {\n t += URI.encode(parts.username);\n }\n\n if (parts.password) {\n t += ':' + URI.encode(parts.password);\n }\n\n if (t) {\n t += '@';\n }\n\n return t;\n };\n URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) {\n // according to http://tools.ietf.org/html/rfc3986 or http://labs.apache.org/webarch/uri/rfc/rfc3986.html\n // being »-._~!$&'()*+,;=:@/?« %HEX and alnum are allowed\n // the RFC explicitly states ?/foo being a valid use case, no mention of parameter syntax!\n // URI.js treats the query string as being application/x-www-form-urlencoded\n // see http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type\n\n var t = '';\n var unique, key, i, length;\n for (key in data) {\n if (key === '__proto__') {\n // ignore attempt at exploiting JavaScript internals\n continue;\n } else if (hasOwn.call(data, key)) {\n if (isArray(data[key])) {\n unique = {};\n for (i = 0, length = data[key].length; i < length; i++) {\n if (data[key][i] !== undefined && unique[data[key][i] + ''] === undefined) {\n t += '&' + URI.buildQueryParameter(key, data[key][i], escapeQuerySpace);\n if (duplicateQueryParameters !== true) {\n unique[data[key][i] + ''] = true;\n }\n }\n }\n } else if (data[key] !== undefined) {\n t += '&' + URI.buildQueryParameter(key, data[key], escapeQuerySpace);\n }\n }\n }\n\n return t.substring(1);\n };\n URI.buildQueryParameter = function(name, value, escapeQuerySpace) {\n // http://www.w3.org/TR/REC-html40/interact/forms.html#form-content-type -- application/x-www-form-urlencoded\n // don't append \"=\" for null values, according to http://dvcs.w3.org/hg/url/raw-file/tip/Overview.html#url-parameter-serialization\n return URI.encodeQuery(name, escapeQuerySpace) + (value !== null ? '=' + URI.encodeQuery(value, escapeQuerySpace) : '');\n };\n\n URI.addQuery = function(data, name, value) {\n if (typeof name === 'object') {\n for (var key in name) {\n if (hasOwn.call(name, key)) {\n URI.addQuery(data, key, name[key]);\n }\n }\n } else if (typeof name === 'string') {\n if (data[name] === undefined) {\n data[name] = value;\n return;\n } else if (typeof data[name] === 'string') {\n data[name] = [data[name]];\n }\n\n if (!isArray(value)) {\n value = [value];\n }\n\n data[name] = (data[name] || []).concat(value);\n } else {\n throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');\n }\n };\n\n URI.setQuery = function(data, name, value) {\n if (typeof name === 'object') {\n for (var key in name) {\n if (hasOwn.call(name, key)) {\n URI.setQuery(data, key, name[key]);\n }\n }\n } else if (typeof name === 'string') {\n data[name] = value === undefined ? null : value;\n } else {\n throw new TypeError('URI.setQuery() accepts an object, string as the name parameter');\n }\n };\n\n URI.removeQuery = function(data, name, value) {\n var i, length, key;\n\n if (isArray(name)) {\n for (i = 0, length = name.length; i < length; i++) {\n data[name[i]] = undefined;\n }\n } else if (getType(name) === 'RegExp') {\n for (key in data) {\n if (name.test(key)) {\n data[key] = undefined;\n }\n }\n } else if (typeof name === 'object') {\n for (key in name) {\n if (hasOwn.call(name, key)) {\n URI.removeQuery(data, key, name[key]);\n }\n }\n } else if (typeof name === 'string') {\n if (value !== undefined) {\n if (getType(value) === 'RegExp') {\n if (!isArray(data[name]) && value.test(data[name])) {\n data[name] = undefined;\n } else {\n data[name] = filterArrayValues(data[name], value);\n }\n } else if (data[name] === String(value) && (!isArray(value) || value.length === 1)) {\n data[name] = undefined;\n } else if (isArray(data[name])) {\n data[name] = filterArrayValues(data[name], value);\n }\n } else {\n data[name] = undefined;\n }\n } else {\n throw new TypeError('URI.removeQuery() accepts an object, string, RegExp as the first parameter');\n }\n };\n URI.hasQuery = function(data, name, value, withinArray) {\n switch (getType(name)) {\n case 'String':\n // Nothing to do here\n break;\n\n case 'RegExp':\n for (var key in data) {\n if (hasOwn.call(data, key)) {\n if (name.test(key) && (value === undefined || URI.hasQuery(data, key, value))) {\n return true;\n }\n }\n }\n\n return false;\n\n case 'Object':\n for (var _key in name) {\n if (hasOwn.call(name, _key)) {\n if (!URI.hasQuery(data, _key, name[_key])) {\n return false;\n }\n }\n }\n\n return true;\n\n default:\n throw new TypeError('URI.hasQuery() accepts a string, regular expression or object as the name parameter');\n }\n\n switch (getType(value)) {\n case 'Undefined':\n // true if exists (but may be empty)\n return name in data; // data[name] !== undefined;\n\n case 'Boolean':\n // true if exists and non-empty\n var _booly = Boolean(isArray(data[name]) ? data[name].length : data[name]);\n return value === _booly;\n\n case 'Function':\n // allow complex comparison\n return !!value(data[name], name, data);\n\n case 'Array':\n if (!isArray(data[name])) {\n return false;\n }\n\n var op = withinArray ? arrayContains : arraysEqual;\n return op(data[name], value);\n\n case 'RegExp':\n if (!isArray(data[name])) {\n return Boolean(data[name] && data[name].match(value));\n }\n\n if (!withinArray) {\n return false;\n }\n\n return arrayContains(data[name], value);\n\n case 'Number':\n value = String(value);\n /* falls through */\n case 'String':\n if (!isArray(data[name])) {\n return data[name] === value;\n }\n\n if (!withinArray) {\n return false;\n }\n\n return arrayContains(data[name], value);\n\n default:\n throw new TypeError('URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter');\n }\n };\n\n\n URI.joinPaths = function() {\n var input = [];\n var segments = [];\n var nonEmptySegments = 0;\n\n for (var i = 0; i < arguments.length; i++) {\n var url = new URI(arguments[i]);\n input.push(url);\n var _segments = url.segment();\n for (var s = 0; s < _segments.length; s++) {\n if (typeof _segments[s] === 'string') {\n segments.push(_segments[s]);\n }\n\n if (_segments[s]) {\n nonEmptySegments++;\n }\n }\n }\n\n if (!segments.length || !nonEmptySegments) {\n return new URI('');\n }\n\n var uri = new URI('').segment(segments);\n\n if (input[0].path() === '' || input[0].path().slice(0, 1) === '/') {\n uri.path('/' + uri.path());\n }\n\n return uri.normalize();\n };\n\n URI.commonPath = function(one, two) {\n var length = Math.min(one.length, two.length);\n var pos;\n\n // find first non-matching character\n for (pos = 0; pos < length; pos++) {\n if (one.charAt(pos) !== two.charAt(pos)) {\n pos--;\n break;\n }\n }\n\n if (pos < 1) {\n return one.charAt(0) === two.charAt(0) && one.charAt(0) === '/' ? '/' : '';\n }\n\n // revert to last /\n if (one.charAt(pos) !== '/' || two.charAt(pos) !== '/') {\n pos = one.substring(0, pos).lastIndexOf('/');\n }\n\n return one.substring(0, pos + 1);\n };\n\n URI.withinString = function(string, callback, options) {\n options || (options = {});\n var _start = options.start || URI.findUri.start;\n var _end = options.end || URI.findUri.end;\n var _trim = options.trim || URI.findUri.trim;\n var _parens = options.parens || URI.findUri.parens;\n var _attributeOpen = /[a-z0-9-]=[\"']?$/i;\n\n _start.lastIndex = 0;\n while (true) {\n var match = _start.exec(string);\n if (!match) {\n break;\n }\n\n var start = match.index;\n if (options.ignoreHtml) {\n // attribut(e=[\"']?$)\n var attributeOpen = string.slice(Math.max(start - 3, 0), start);\n if (attributeOpen && _attributeOpen.test(attributeOpen)) {\n continue;\n }\n }\n\n var end = start + string.slice(start).search(_end);\n var slice = string.slice(start, end);\n // make sure we include well balanced parens\n var parensEnd = -1;\n while (true) {\n var parensMatch = _parens.exec(slice);\n if (!parensMatch) {\n break;\n }\n\n var parensMatchEnd = parensMatch.index + parensMatch[0].length;\n parensEnd = Math.max(parensEnd, parensMatchEnd);\n }\n\n if (parensEnd > -1) {\n slice = slice.slice(0, parensEnd) + slice.slice(parensEnd).replace(_trim, '');\n } else {\n slice = slice.replace(_trim, '');\n }\n\n if (slice.length <= match[0].length) {\n // the extract only contains the starting marker of a URI,\n // e.g. \"www\" or \"http://\"\n continue;\n }\n\n if (options.ignore && options.ignore.test(slice)) {\n continue;\n }\n\n end = start + slice.length;\n var result = callback(slice, start, end, string);\n if (result === undefined) {\n _start.lastIndex = end;\n continue;\n }\n\n result = String(result);\n string = string.slice(0, start) + result + string.slice(end);\n _start.lastIndex = start + result.length;\n }\n\n _start.lastIndex = 0;\n return string;\n };\n\n URI.ensureValidHostname = function(v, protocol) {\n // Theoretically URIs allow percent-encoding in Hostnames (according to RFC 3986)\n // they are not part of DNS and therefore ignored by URI.js\n\n var hasHostname = !!v; // not null and not an empty string\n var hasProtocol = !!protocol;\n var rejectEmptyHostname = false;\n\n if (hasProtocol) {\n rejectEmptyHostname = arrayContains(URI.hostProtocols, protocol);\n }\n\n if (rejectEmptyHostname && !hasHostname) {\n throw new TypeError('Hostname cannot be empty, if protocol is ' + protocol);\n } else if (v && v.match(URI.invalid_hostname_characters)) {\n // test punycode\n if (!punycode) {\n throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');\n }\n if (punycode.toASCII(v).match(URI.invalid_hostname_characters)) {\n throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-:_]');\n }\n }\n };\n\n URI.ensureValidPort = function (v) {\n if (!v) {\n return;\n }\n\n var port = Number(v);\n if (isInteger(port) && (port > 0) && (port < 65536)) {\n return;\n }\n\n throw new TypeError('Port \"' + v + '\" is not a valid port');\n };\n\n // noConflict\n URI.noConflict = function(removeAll) {\n if (removeAll) {\n var unconflicted = {\n URI: this.noConflict()\n };\n\n if (root.URITemplate && typeof root.URITemplate.noConflict === 'function') {\n unconflicted.URITemplate = root.URITemplate.noConflict();\n }\n\n if (root.IPv6 && typeof root.IPv6.noConflict === 'function') {\n unconflicted.IPv6 = root.IPv6.noConflict();\n }\n\n if (root.SecondLevelDomains && typeof root.SecondLevelDomains.noConflict === 'function') {\n unconflicted.SecondLevelDomains = root.SecondLevelDomains.noConflict();\n }\n\n return unconflicted;\n } else if (root.URI === this) {\n root.URI = _URI;\n }\n\n return this;\n };\n\n p.build = function(deferBuild) {\n if (deferBuild === true) {\n this._deferred_build = true;\n } else if (deferBuild === undefined || this._deferred_build) {\n this._string = URI.build(this._parts);\n this._deferred_build = false;\n }\n\n return this;\n };\n\n p.clone = function() {\n return new URI(this);\n };\n\n p.valueOf = p.toString = function() {\n return this.build(false)._string;\n };\n\n\n function generateSimpleAccessor(_part){\n return function(v, build) {\n if (v === undefined) {\n return this._parts[_part] || '';\n } else {\n this._parts[_part] = v || null;\n this.build(!build);\n return this;\n }\n };\n }\n\n function generatePrefixAccessor(_part, _key){\n return function(v, build) {\n if (v === undefined) {\n return this._parts[_part] || '';\n } else {\n if (v !== null) {\n v = v + '';\n if (v.charAt(0) === _key) {\n v = v.substring(1);\n }\n }\n\n this._parts[_part] = v;\n this.build(!build);\n return this;\n }\n };\n }\n\n p.protocol = generateSimpleAccessor('protocol');\n p.username = generateSimpleAccessor('username');\n p.password = generateSimpleAccessor('password');\n p.hostname = generateSimpleAccessor('hostname');\n p.port = generateSimpleAccessor('port');\n p.query = generatePrefixAccessor('query', '?');\n p.fragment = generatePrefixAccessor('fragment', '#');\n\n p.search = function(v, build) {\n var t = this.query(v, build);\n return typeof t === 'string' && t.length ? ('?' + t) : t;\n };\n p.hash = function(v, build) {\n var t = this.fragment(v, build);\n return typeof t === 'string' && t.length ? ('#' + t) : t;\n };\n\n p.pathname = function(v, build) {\n if (v === undefined || v === true) {\n var res = this._parts.path || (this._parts.hostname ? '/' : '');\n return v ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res;\n } else {\n if (this._parts.urn) {\n this._parts.path = v ? URI.recodeUrnPath(v) : '';\n } else {\n this._parts.path = v ? URI.recodePath(v) : '/';\n }\n this.build(!build);\n return this;\n }\n };\n p.path = p.pathname;\n p.href = function(href, build) {\n var key;\n\n if (href === undefined) {\n return this.toString();\n }\n\n this._string = '';\n this._parts = URI._parts();\n\n var _URI = href instanceof URI;\n var _object = typeof href === 'object' && (href.hostname || href.path || href.pathname);\n if (href.nodeName) {\n var attribute = URI.getDomAttribute(href);\n href = href[attribute] || '';\n _object = false;\n }\n\n // window.location is reported to be an object, but it's not the sort\n // of object we're looking for:\n // * location.protocol ends with a colon\n // * location.query != object.search\n // * location.hash != object.fragment\n // simply serializing the unknown object should do the trick\n // (for location, not for everything...)\n if (!_URI && _object && href.pathname !== undefined) {\n href = href.toString();\n }\n\n if (typeof href === 'string' || href instanceof String) {\n this._parts = URI.parse(String(href), this._parts);\n } else if (_URI || _object) {\n var src = _URI ? href._parts : href;\n for (key in src) {\n if (key === 'query') { continue; }\n if (hasOwn.call(this._parts, key)) {\n this._parts[key] = src[key];\n }\n }\n if (src.query) {\n this.query(src.query, false);\n }\n } else {\n throw new TypeError('invalid input');\n }\n\n this.build(!build);\n return this;\n };\n\n // identification accessors\n p.is = function(what) {\n var ip = false;\n var ip4 = false;\n var ip6 = false;\n var name = false;\n var sld = false;\n var idn = false;\n var punycode = false;\n var relative = !this._parts.urn;\n\n if (this._parts.hostname) {\n relative = false;\n ip4 = URI.ip4_expression.test(this._parts.hostname);\n ip6 = URI.ip6_expression.test(this._parts.hostname);\n ip = ip4 || ip6;\n name = !ip;\n sld = name && SLD && SLD.has(this._parts.hostname);\n idn = name && URI.idn_expression.test(this._parts.hostname);\n punycode = name && URI.punycode_expression.test(this._parts.hostname);\n }\n\n switch (what.toLowerCase()) {\n case 'relative':\n return relative;\n\n case 'absolute':\n return !relative;\n\n // hostname identification\n case 'domain':\n case 'name':\n return name;\n\n case 'sld':\n return sld;\n\n case 'ip':\n return ip;\n\n case 'ip4':\n case 'ipv4':\n case 'inet4':\n return ip4;\n\n case 'ip6':\n case 'ipv6':\n case 'inet6':\n return ip6;\n\n case 'idn':\n return idn;\n\n case 'url':\n return !this._parts.urn;\n\n case 'urn':\n return !!this._parts.urn;\n\n case 'punycode':\n return punycode;\n }\n\n return null;\n };\n\n // component specific input validation\n var _protocol = p.protocol;\n var _port = p.port;\n var _hostname = p.hostname;\n\n p.protocol = function(v, build) {\n if (v) {\n // accept trailing ://\n v = v.replace(/:(\\/\\/)?$/, '');\n\n if (!v.match(URI.protocol_expression)) {\n throw new TypeError('Protocol \"' + v + '\" contains characters other than [A-Z0-9.+-] or doesn\\'t start with [A-Z]');\n }\n }\n\n return _protocol.call(this, v, build);\n };\n p.scheme = p.protocol;\n p.port = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v !== undefined) {\n if (v === 0) {\n v = null;\n }\n\n if (v) {\n v += '';\n if (v.charAt(0) === ':') {\n v = v.substring(1);\n }\n\n URI.ensureValidPort(v);\n }\n }\n return _port.call(this, v, build);\n };\n p.hostname = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v !== undefined) {\n var x = { preventInvalidHostname: this._parts.preventInvalidHostname };\n var res = URI.parseHost(v, x);\n if (res !== '/') {\n throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n }\n\n v = x.hostname;\n if (this._parts.preventInvalidHostname) {\n URI.ensureValidHostname(v, this._parts.protocol);\n }\n }\n\n return _hostname.call(this, v, build);\n };\n\n // compound accessors\n p.origin = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined) {\n var protocol = this.protocol();\n var authority = this.authority();\n if (!authority) {\n return '';\n }\n\n return (protocol ? protocol + '://' : '') + this.authority();\n } else {\n var origin = URI(v);\n this\n .protocol(origin.protocol())\n .authority(origin.authority())\n .build(!build);\n return this;\n }\n };\n p.host = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined) {\n return this._parts.hostname ? URI.buildHost(this._parts) : '';\n } else {\n var res = URI.parseHost(v, this._parts);\n if (res !== '/') {\n throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n }\n\n this.build(!build);\n return this;\n }\n };\n p.authority = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined) {\n return this._parts.hostname ? URI.buildAuthority(this._parts) : '';\n } else {\n var res = URI.parseAuthority(v, this._parts);\n if (res !== '/') {\n throw new TypeError('Hostname \"' + v + '\" contains characters other than [A-Z0-9.-]');\n }\n\n this.build(!build);\n return this;\n }\n };\n p.userinfo = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined) {\n var t = URI.buildUserinfo(this._parts);\n return t ? t.substring(0, t.length -1) : t;\n } else {\n if (v[v.length-1] !== '@') {\n v += '@';\n }\n\n URI.parseUserinfo(v, this._parts);\n this.build(!build);\n return this;\n }\n };\n p.resource = function(v, build) {\n var parts;\n\n if (v === undefined) {\n return this.path() + this.search() + this.hash();\n }\n\n parts = URI.parse(v);\n this._parts.path = parts.path;\n this._parts.query = parts.query;\n this._parts.fragment = parts.fragment;\n this.build(!build);\n return this;\n };\n\n // fraction accessors\n p.subdomain = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n // convenience, return \"www\" from \"www.example.org\"\n if (v === undefined) {\n if (!this._parts.hostname || this.is('IP')) {\n return '';\n }\n\n // grab domain and add another segment\n var end = this._parts.hostname.length - this.domain().length - 1;\n return this._parts.hostname.substring(0, end) || '';\n } else {\n var e = this._parts.hostname.length - this.domain().length;\n var sub = this._parts.hostname.substring(0, e);\n var replace = new RegExp('^' + escapeRegEx(sub));\n\n if (v && v.charAt(v.length - 1) !== '.') {\n v += '.';\n }\n\n if (v.indexOf(':') !== -1) {\n throw new TypeError('Domains cannot contain colons');\n }\n\n if (v) {\n URI.ensureValidHostname(v, this._parts.protocol);\n }\n\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n this.build(!build);\n return this;\n }\n };\n p.domain = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (typeof v === 'boolean') {\n build = v;\n v = undefined;\n }\n\n // convenience, return \"example.org\" from \"www.example.org\"\n if (v === undefined) {\n if (!this._parts.hostname || this.is('IP')) {\n return '';\n }\n\n // if hostname consists of 1 or 2 segments, it must be the domain\n var t = this._parts.hostname.match(/\\./g);\n if (t && t.length < 2) {\n return this._parts.hostname;\n }\n\n // grab tld and add another segment\n var end = this._parts.hostname.length - this.tld(build).length - 1;\n end = this._parts.hostname.lastIndexOf('.', end -1) + 1;\n return this._parts.hostname.substring(end) || '';\n } else {\n if (!v) {\n throw new TypeError('cannot set domain empty');\n }\n\n if (v.indexOf(':') !== -1) {\n throw new TypeError('Domains cannot contain colons');\n }\n\n URI.ensureValidHostname(v, this._parts.protocol);\n\n if (!this._parts.hostname || this.is('IP')) {\n this._parts.hostname = v;\n } else {\n var replace = new RegExp(escapeRegEx(this.domain()) + '$');\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n }\n\n this.build(!build);\n return this;\n }\n };\n p.tld = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (typeof v === 'boolean') {\n build = v;\n v = undefined;\n }\n\n // return \"org\" from \"www.example.org\"\n if (v === undefined) {\n if (!this._parts.hostname || this.is('IP')) {\n return '';\n }\n\n var pos = this._parts.hostname.lastIndexOf('.');\n var tld = this._parts.hostname.substring(pos + 1);\n\n if (build !== true && SLD && SLD.list[tld.toLowerCase()]) {\n return SLD.get(this._parts.hostname) || tld;\n }\n\n return tld;\n } else {\n var replace;\n\n if (!v) {\n throw new TypeError('cannot set TLD empty');\n } else if (v.match(/[^a-zA-Z0-9-]/)) {\n if (SLD && SLD.is(v)) {\n replace = new RegExp(escapeRegEx(this.tld()) + '$');\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n } else {\n throw new TypeError('TLD \"' + v + '\" contains characters other than [A-Z0-9]');\n }\n } else if (!this._parts.hostname || this.is('IP')) {\n throw new ReferenceError('cannot set TLD on non-domain host');\n } else {\n replace = new RegExp(escapeRegEx(this.tld()) + '$');\n this._parts.hostname = this._parts.hostname.replace(replace, v);\n }\n\n this.build(!build);\n return this;\n }\n };\n p.directory = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined || v === true) {\n if (!this._parts.path && !this._parts.hostname) {\n return '';\n }\n\n if (this._parts.path === '/') {\n return '/';\n }\n\n var end = this._parts.path.length - this.filename().length - 1;\n var res = this._parts.path.substring(0, end) || (this._parts.hostname ? '/' : '');\n\n return v ? URI.decodePath(res) : res;\n\n } else {\n var e = this._parts.path.length - this.filename().length;\n var directory = this._parts.path.substring(0, e);\n var replace = new RegExp('^' + escapeRegEx(directory));\n\n // fully qualifier directories begin with a slash\n if (!this.is('relative')) {\n if (!v) {\n v = '/';\n }\n\n if (v.charAt(0) !== '/') {\n v = '/' + v;\n }\n }\n\n // directories always end with a slash\n if (v && v.charAt(v.length - 1) !== '/') {\n v += '/';\n }\n\n v = URI.recodePath(v);\n this._parts.path = this._parts.path.replace(replace, v);\n this.build(!build);\n return this;\n }\n };\n p.filename = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (typeof v !== 'string') {\n if (!this._parts.path || this._parts.path === '/') {\n return '';\n }\n\n var pos = this._parts.path.lastIndexOf('/');\n var res = this._parts.path.substring(pos+1);\n\n return v ? URI.decodePathSegment(res) : res;\n } else {\n var mutatedDirectory = false;\n\n if (v.charAt(0) === '/') {\n v = v.substring(1);\n }\n\n if (v.match(/\\.?\\//)) {\n mutatedDirectory = true;\n }\n\n var replace = new RegExp(escapeRegEx(this.filename()) + '$');\n v = URI.recodePath(v);\n this._parts.path = this._parts.path.replace(replace, v);\n\n if (mutatedDirectory) {\n this.normalizePath(build);\n } else {\n this.build(!build);\n }\n\n return this;\n }\n };\n p.suffix = function(v, build) {\n if (this._parts.urn) {\n return v === undefined ? '' : this;\n }\n\n if (v === undefined || v === true) {\n if (!this._parts.path || this._parts.path === '/') {\n return '';\n }\n\n var filename = this.filename();\n var pos = filename.lastIndexOf('.');\n var s, res;\n\n if (pos === -1) {\n return '';\n }\n\n // suffix may only contain alnum characters (yup, I made this up.)\n s = filename.substring(pos+1);\n res = (/^[a-z0-9%]+$/i).test(s) ? s : '';\n return v ? URI.decodePathSegment(res) : res;\n } else {\n if (v.charAt(0) === '.') {\n v = v.substring(1);\n }\n\n var suffix = this.suffix();\n var replace;\n\n if (!suffix) {\n if (!v) {\n return this;\n }\n\n this._parts.path += '.' + URI.recodePath(v);\n } else if (!v) {\n replace = new RegExp(escapeRegEx('.' + suffix) + '$');\n } else {\n replace = new RegExp(escapeRegEx(suffix) + '$');\n }\n\n if (replace) {\n v = URI.recodePath(v);\n this._parts.path = this._parts.path.replace(replace, v);\n }\n\n this.build(!build);\n return this;\n }\n };\n p.segment = function(segment, v, build) {\n var separator = this._parts.urn ? ':' : '/';\n var path = this.path();\n var absolute = path.substring(0, 1) === '/';\n var segments = path.split(separator);\n\n if (segment !== undefined && typeof segment !== 'number') {\n build = v;\n v = segment;\n segment = undefined;\n }\n\n if (segment !== undefined && typeof segment !== 'number') {\n throw new Error('Bad segment \"' + segment + '\", must be 0-based integer');\n }\n\n if (absolute) {\n segments.shift();\n }\n\n if (segment < 0) {\n // allow negative indexes to address from the end\n segment = Math.max(segments.length + segment, 0);\n }\n\n if (v === undefined) {\n /*jshint laxbreak: true */\n return segment === undefined\n ? segments\n : segments[segment];\n /*jshint laxbreak: false */\n } else if (segment === null || segments[segment] === undefined) {\n if (isArray(v)) {\n segments = [];\n // collapse empty elements within array\n for (var i=0, l=v.length; i < l; i++) {\n if (!v[i].length && (!segments.length || !segments[segments.length -1].length)) {\n continue;\n }\n\n if (segments.length && !segments[segments.length -1].length) {\n segments.pop();\n }\n\n segments.push(trimSlashes(v[i]));\n }\n } else if (v || typeof v === 'string') {\n v = trimSlashes(v);\n if (segments[segments.length -1] === '') {\n // empty trailing elements have to be overwritten\n // to prevent results such as /foo//bar\n segments[segments.length -1] = v;\n } else {\n segments.push(v);\n }\n }\n } else {\n if (v) {\n segments[segment] = trimSlashes(v);\n } else {\n segments.splice(segment, 1);\n }\n }\n\n if (absolute) {\n segments.unshift('');\n }\n\n return this.path(segments.join(separator), build);\n };\n p.segmentCoded = function(segment, v, build) {\n var segments, i, l;\n\n if (typeof segment !== 'number') {\n build = v;\n v = segment;\n segment = undefined;\n }\n\n if (v === undefined) {\n segments = this.segment(segment, v, build);\n if (!isArray(segments)) {\n segments = segments !== undefined ? URI.decode(segments) : undefined;\n } else {\n for (i = 0, l = segments.length; i < l; i++) {\n segments[i] = URI.decode(segments[i]);\n }\n }\n\n return segments;\n }\n\n if (!isArray(v)) {\n v = (typeof v === 'string' || v instanceof String) ? URI.encode(v) : v;\n } else {\n for (i = 0, l = v.length; i < l; i++) {\n v[i] = URI.encode(v[i]);\n }\n }\n\n return this.segment(segment, v, build);\n };\n\n // mutating query string\n var q = p.query;\n p.query = function(v, build) {\n if (v === true) {\n return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n } else if (typeof v === 'function') {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n var result = v.call(this, data);\n this._parts.query = URI.buildQuery(result || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n this.build(!build);\n return this;\n } else if (v !== undefined && typeof v !== 'string') {\n this._parts.query = URI.buildQuery(v, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n this.build(!build);\n return this;\n } else {\n return q.call(this, v, build);\n }\n };\n p.setQuery = function(name, value, build) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n\n if (typeof name === 'string' || name instanceof String) {\n data[name] = value !== undefined ? value : null;\n } else if (typeof name === 'object') {\n for (var key in name) {\n if (hasOwn.call(name, key)) {\n data[key] = name[key];\n }\n }\n } else {\n throw new TypeError('URI.addQuery() accepts an object, string as the name parameter');\n }\n\n this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n if (typeof name !== 'string') {\n build = value;\n }\n\n this.build(!build);\n return this;\n };\n p.addQuery = function(name, value, build) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n URI.addQuery(data, name, value === undefined ? null : value);\n this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n if (typeof name !== 'string') {\n build = value;\n }\n\n this.build(!build);\n return this;\n };\n p.removeQuery = function(name, value, build) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n URI.removeQuery(data, name, value);\n this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);\n if (typeof name !== 'string') {\n build = value;\n }\n\n this.build(!build);\n return this;\n };\n p.hasQuery = function(name, value, withinArray) {\n var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);\n return URI.hasQuery(data, name, value, withinArray);\n };\n p.setSearch = p.setQuery;\n p.addSearch = p.addQuery;\n p.removeSearch = p.removeQuery;\n p.hasSearch = p.hasQuery;\n\n // sanitizing URLs\n p.normalize = function() {\n if (this._parts.urn) {\n return this\n .normalizeProtocol(false)\n .normalizePath(false)\n .normalizeQuery(false)\n .normalizeFragment(false)\n .build();\n }\n\n return this\n .normalizeProtocol(false)\n .normalizeHostname(false)\n .normalizePort(false)\n .normalizePath(false)\n .normalizeQuery(false)\n .normalizeFragment(false)\n .build();\n };\n p.normalizeProtocol = function(build) {\n if (typeof this._parts.protocol === 'string') {\n this._parts.protocol = this._parts.protocol.toLowerCase();\n this.build(!build);\n }\n\n return this;\n };\n p.normalizeHostname = function(build) {\n if (this._parts.hostname) {\n if (this.is('IDN') && punycode) {\n this._parts.hostname = punycode.toASCII(this._parts.hostname);\n } else if (this.is('IPv6') && IPv6) {\n this._parts.hostname = IPv6.best(this._parts.hostname);\n }\n\n this._parts.hostname = this._parts.hostname.toLowerCase();\n this.build(!build);\n }\n\n return this;\n };\n p.normalizePort = function(build) {\n // remove port of it's the protocol's default\n if (typeof this._parts.protocol === 'string' && this._parts.port === URI.defaultPorts[this._parts.protocol]) {\n this._parts.port = null;\n this.build(!build);\n }\n\n return this;\n };\n p.normalizePath = function(build) {\n var _path = this._parts.path;\n if (!_path) {\n return this;\n }\n\n if (this._parts.urn) {\n this._parts.path = URI.recodeUrnPath(this._parts.path);\n this.build(!build);\n return this;\n }\n\n if (this._parts.path === '/') {\n return this;\n }\n\n _path = URI.recodePath(_path);\n\n var _was_relative;\n var _leadingParents = '';\n var _parent, _pos;\n\n // handle relative paths\n if (_path.charAt(0) !== '/') {\n _was_relative = true;\n _path = '/' + _path;\n }\n\n // handle relative files (as opposed to directories)\n if (_path.slice(-3) === '/..' || _path.slice(-2) === '/.') {\n _path += '/';\n }\n\n // resolve simples\n _path = _path\n .replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g, '/')\n .replace(/\\/{2,}/g, '/');\n\n // remember leading parents\n if (_was_relative) {\n _leadingParents = _path.substring(1).match(/^(\\.\\.\\/)+/) || '';\n if (_leadingParents) {\n _leadingParents = _leadingParents[0];\n }\n }\n\n // resolve parents\n while (true) {\n _parent = _path.search(/\\/\\.\\.(\\/|$)/);\n if (_parent === -1) {\n // no more ../ to resolve\n break;\n } else if (_parent === 0) {\n // top level cannot be relative, skip it\n _path = _path.substring(3);\n continue;\n }\n\n _pos = _path.substring(0, _parent).lastIndexOf('/');\n if (_pos === -1) {\n _pos = _parent;\n }\n _path = _path.substring(0, _pos) + _path.substring(_parent + 3);\n }\n\n // revert to relative\n if (_was_relative && this.is('relative')) {\n _path = _leadingParents + _path.substring(1);\n }\n\n this._parts.path = _path;\n this.build(!build);\n return this;\n };\n p.normalizePathname = p.normalizePath;\n p.normalizeQuery = function(build) {\n if (typeof this._parts.query === 'string') {\n if (!this._parts.query.length) {\n this._parts.query = null;\n } else {\n this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace));\n }\n\n this.build(!build);\n }\n\n return this;\n };\n p.normalizeFragment = function(build) {\n if (!this._parts.fragment) {\n this._parts.fragment = null;\n this.build(!build);\n }\n\n return this;\n };\n p.normalizeSearch = p.normalizeQuery;\n p.normalizeHash = p.normalizeFragment;\n\n p.iso8859 = function() {\n // expect unicode input, iso8859 output\n var e = URI.encode;\n var d = URI.decode;\n\n URI.encode = escape;\n URI.decode = decodeURIComponent;\n try {\n this.normalize();\n } finally {\n URI.encode = e;\n URI.decode = d;\n }\n return this;\n };\n\n p.unicode = function() {\n // expect iso8859 input, unicode output\n var e = URI.encode;\n var d = URI.decode;\n\n URI.encode = strictEncodeURIComponent;\n URI.decode = unescape;\n try {\n this.normalize();\n } finally {\n URI.encode = e;\n URI.decode = d;\n }\n return this;\n };\n\n p.readable = function() {\n var uri = this.clone();\n // removing username, password, because they shouldn't be displayed according to RFC 3986\n uri.username('').password('').normalize();\n var t = '';\n if (uri._parts.protocol) {\n t += uri._parts.protocol + '://';\n }\n\n if (uri._parts.hostname) {\n if (uri.is('punycode') && punycode) {\n t += punycode.toUnicode(uri._parts.hostname);\n if (uri._parts.port) {\n t += ':' + uri._parts.port;\n }\n } else {\n t += uri.host();\n }\n }\n\n if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== '/') {\n t += '/';\n }\n\n t += uri.path(true);\n if (uri._parts.query) {\n var q = '';\n for (var i = 0, qp = uri._parts.query.split('&'), l = qp.length; i < l; i++) {\n var kv = (qp[i] || '').split('=');\n q += '&' + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace)\n .replace(/&/g, '%26');\n\n if (kv[1] !== undefined) {\n q += '=' + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace)\n .replace(/&/g, '%26');\n }\n }\n t += '?' + q.substring(1);\n }\n\n t += URI.decodeQuery(uri.hash(), true);\n return t;\n };\n\n // resolving relative and absolute URLs\n p.absoluteTo = function(base) {\n var resolved = this.clone();\n var properties = ['protocol', 'username', 'password', 'hostname', 'port'];\n var basedir, i, p;\n\n if (this._parts.urn) {\n throw new Error('URNs do not have any generally defined hierarchical components');\n }\n\n if (!(base instanceof URI)) {\n base = new URI(base);\n }\n\n if (resolved._parts.protocol) {\n // Directly returns even if this._parts.hostname is empty.\n return resolved;\n } else {\n resolved._parts.protocol = base._parts.protocol;\n }\n\n if (this._parts.hostname) {\n return resolved;\n }\n\n for (i = 0; (p = properties[i]); i++) {\n resolved._parts[p] = base._parts[p];\n }\n\n if (!resolved._parts.path) {\n resolved._parts.path = base._parts.path;\n if (!resolved._parts.query) {\n resolved._parts.query = base._parts.query;\n }\n } else {\n if (resolved._parts.path.substring(-2) === '..') {\n resolved._parts.path += '/';\n }\n\n if (resolved.path().charAt(0) !== '/') {\n basedir = base.directory();\n basedir = basedir ? basedir : base.path().indexOf('/') === 0 ? '/' : '';\n resolved._parts.path = (basedir ? (basedir + '/') : '') + resolved._parts.path;\n resolved.normalizePath();\n }\n }\n\n resolved.build();\n return resolved;\n };\n p.relativeTo = function(base) {\n var relative = this.clone().normalize();\n var relativeParts, baseParts, common, relativePath, basePath;\n\n if (relative._parts.urn) {\n throw new Error('URNs do not have any generally defined hierarchical components');\n }\n\n base = new URI(base).normalize();\n relativeParts = relative._parts;\n baseParts = base._parts;\n relativePath = relative.path();\n basePath = base.path();\n\n if (relativePath.charAt(0) !== '/') {\n throw new Error('URI is already relative');\n }\n\n if (basePath.charAt(0) !== '/') {\n throw new Error('Cannot calculate a URI relative to another relative URI');\n }\n\n if (relativeParts.protocol === baseParts.protocol) {\n relativeParts.protocol = null;\n }\n\n if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) {\n return relative.build();\n }\n\n if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) {\n return relative.build();\n }\n\n if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) {\n relativeParts.hostname = null;\n relativeParts.port = null;\n } else {\n return relative.build();\n }\n\n if (relativePath === basePath) {\n relativeParts.path = '';\n return relative.build();\n }\n\n // determine common sub path\n common = URI.commonPath(relativePath, basePath);\n\n // If the paths have nothing in common, return a relative URL with the absolute path.\n if (!common) {\n return relative.build();\n }\n\n var parents = baseParts.path\n .substring(common.length)\n .replace(/[^\\/]*$/, '')\n .replace(/.*?\\//g, '../');\n\n relativeParts.path = (parents + relativeParts.path.substring(common.length)) || './';\n\n return relative.build();\n };\n\n // comparing URIs\n p.equals = function(uri) {\n var one = this.clone();\n var two = new URI(uri);\n var one_map = {};\n var two_map = {};\n var checked = {};\n var one_query, two_query, key;\n\n one.normalize();\n two.normalize();\n\n // exact match\n if (one.toString() === two.toString()) {\n return true;\n }\n\n // extract query string\n one_query = one.query();\n two_query = two.query();\n one.query('');\n two.query('');\n\n // definitely not equal if not even non-query parts match\n if (one.toString() !== two.toString()) {\n return false;\n }\n\n // query parameters have the same length, even if they're permuted\n if (one_query.length !== two_query.length) {\n return false;\n }\n\n one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace);\n two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace);\n\n for (key in one_map) {\n if (hasOwn.call(one_map, key)) {\n if (!isArray(one_map[key])) {\n if (one_map[key] !== two_map[key]) {\n return false;\n }\n } else if (!arraysEqual(one_map[key], two_map[key])) {\n return false;\n }\n\n checked[key] = true;\n }\n }\n\n for (key in two_map) {\n if (hasOwn.call(two_map, key)) {\n if (!checked[key]) {\n // two contains a parameter not present in one\n return false;\n }\n }\n }\n\n return true;\n };\n\n // state\n p.preventInvalidHostname = function(v) {\n this._parts.preventInvalidHostname = !!v;\n return this;\n };\n\n p.duplicateQueryParameters = function(v) {\n this._parts.duplicateQueryParameters = !!v;\n return this;\n };\n\n p.escapeQuerySpace = function(v) {\n this._parts.escapeQuerySpace = !!v;\n return this;\n };\n\n return URI;\n}));\n","/**\r\n * @private\r\n */\r\nfunction appendForwardSlash(url) {\r\n if (url.length === 0 || url[url.length - 1] !== \"/\") {\r\n url = `${url}/`;\r\n }\r\n return url;\r\n}\r\nexport default appendForwardSlash;\r\n","import defaultValue from \"./defaultValue.js\";\r\n\r\n/**\r\n * Clones an object, returning a new object containing the same properties.\r\n *\r\n * @function\r\n *\r\n * @param {Object} object The object to clone.\r\n * @param {Boolean} [deep=false] If true, all properties will be deep cloned recursively.\r\n * @returns {Object} The cloned object.\r\n */\r\nfunction clone(object, deep) {\r\n if (object === null || typeof object !== \"object\") {\r\n return object;\r\n }\r\n\r\n deep = defaultValue(deep, false);\r\n\r\n const result = new object.constructor();\r\n for (const propertyName in object) {\r\n if (object.hasOwnProperty(propertyName)) {\r\n let value = object[propertyName];\r\n if (deep) {\r\n value = clone(value, deep);\r\n }\r\n result[propertyName] = value;\r\n }\r\n }\r\n\r\n return result;\r\n}\r\nexport default clone;\r\n","/**\r\n * A function used to resolve a promise upon completion .\r\n * @callback defer.resolve\r\n *\r\n * @param {*} value The resulting value.\r\n */\r\n\r\n/**\r\n * A function used to reject a promise upon failure.\r\n * @callback defer.reject\r\n *\r\n * @param {*} error The error.\r\n */\r\n\r\n/**\r\n * An object which contains a promise object, and functions to resolve or reject the promise.\r\n *\r\n * @typedef {Object} defer.deferred\r\n * @property {defer.resolve} resolve Resolves the promise when called.\r\n * @property {defer.reject} reject Rejects the promise when called.\r\n * @property {Promise} promise Promise object.\r\n */\r\n\r\n/**\r\n * Creates a deferred object, containing a promise object, and functions to resolve or reject the promise.\r\n * @returns {defer.deferred}\r\n * @private\r\n */\r\nfunction defer() {\r\n let resolve;\r\n let reject;\r\n const promise = new Promise(function (res, rej) {\r\n resolve = res;\r\n reject = rej;\r\n });\r\n\r\n return {\r\n resolve: resolve,\r\n reject: reject,\r\n promise: promise,\r\n };\r\n}\r\n\r\nexport default defer;\r\n","import Uri from \"urijs\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * Given a relative Uri and a base Uri, returns the absolute Uri of the relative Uri.\r\n * @function\r\n *\r\n * @param {String} relative The relative Uri.\r\n * @param {String} [base] The base Uri.\r\n * @returns {String} The absolute Uri of the given relative Uri.\r\n *\r\n * @example\r\n * //absolute Uri will be \"https://test.com/awesome.png\";\r\n * const absoluteUri = Cesium.getAbsoluteUri('awesome.png', 'https://test.com');\r\n */\r\nfunction getAbsoluteUri(relative, base) {\r\n let documentObject;\r\n if (typeof document !== \"undefined\") {\r\n documentObject = document;\r\n }\r\n\r\n return getAbsoluteUri._implementation(relative, base, documentObject);\r\n}\r\n\r\ngetAbsoluteUri._implementation = function (relative, base, documentObject) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(relative)) {\r\n throw new DeveloperError(\"relative uri is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(base)) {\r\n if (typeof documentObject === \"undefined\") {\r\n return relative;\r\n }\r\n base = defaultValue(documentObject.baseURI, documentObject.location.href);\r\n }\r\n\r\n const relativeUri = new Uri(relative);\r\n if (relativeUri.scheme() !== \"\") {\r\n return relativeUri.toString();\r\n }\r\n return relativeUri.absoluteTo(base).toString();\r\n};\r\nexport default getAbsoluteUri;\r\n","import Uri from \"urijs\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * Given a URI, returns the base path of the URI.\r\n * @function\r\n *\r\n * @param {String} uri The Uri.\r\n * @param {Boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri\r\n * @returns {String} The base path of the Uri.\r\n *\r\n * @example\r\n * // basePath will be \"/Gallery/\";\r\n * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false');\r\n *\r\n * // basePath will be \"/Gallery/?value=true&example=false\";\r\n * const basePath = Cesium.getBaseUri('/Gallery/simple.czml?value=true&example=false', true);\r\n */\r\nfunction getBaseUri(uri, includeQuery) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(uri)) {\r\n throw new DeveloperError(\"uri is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n let basePath = \"\";\r\n const i = uri.lastIndexOf(\"/\");\r\n if (i !== -1) {\r\n basePath = uri.substring(0, i + 1);\r\n }\r\n\r\n if (!includeQuery) {\r\n return basePath;\r\n }\r\n\r\n uri = new Uri(uri);\r\n if (uri.query().length !== 0) {\r\n basePath += `?${uri.query()}`;\r\n }\r\n if (uri.fragment().length !== 0) {\r\n basePath += `#${uri.fragment()}`;\r\n }\r\n\r\n return basePath;\r\n}\r\nexport default getBaseUri;\r\n","import Uri from \"urijs\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * Given a URI, returns the extension of the URI.\r\n * @function getExtensionFromUri\r\n *\r\n * @param {String} uri The Uri.\r\n * @returns {String} The extension of the Uri.\r\n *\r\n * @example\r\n * //extension will be \"czml\";\r\n * const extension = Cesium.getExtensionFromUri('/Gallery/simple.czml?value=true&example=false');\r\n */\r\nfunction getExtensionFromUri(uri) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(uri)) {\r\n throw new DeveloperError(\"uri is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const uriObject = new Uri(uri);\r\n uriObject.normalize();\r\n let path = uriObject.path();\r\n let index = path.lastIndexOf(\"/\");\r\n if (index !== -1) {\r\n path = path.substr(index + 1);\r\n }\r\n index = path.lastIndexOf(\".\");\r\n if (index === -1) {\r\n path = \"\";\r\n } else {\r\n path = path.substr(index + 1);\r\n }\r\n return path;\r\n}\r\nexport default getExtensionFromUri;\r\n","import defined from \"./defined.js\";\r\n\r\nconst context2DsByWidthAndHeight = {};\r\n\r\n/**\r\n * Extract a pixel array from a loaded image. Draws the image\r\n * into a canvas so it can read the pixels back.\r\n *\r\n * @function getImagePixels\r\n *\r\n * @param {HTMLImageElement|ImageBitmap} image The image to extract pixels from.\r\n * @param {Number} width The width of the image. If not defined, then image.width is assigned.\r\n * @param {Number} height The height of the image. If not defined, then image.height is assigned.\r\n * @returns {ImageData} The pixels of the image.\r\n */\r\nfunction getImagePixels(image, width, height) {\r\n if (!defined(width)) {\r\n width = image.width;\r\n }\r\n if (!defined(height)) {\r\n height = image.height;\r\n }\r\n\r\n let context2DsByHeight = context2DsByWidthAndHeight[width];\r\n if (!defined(context2DsByHeight)) {\r\n context2DsByHeight = {};\r\n context2DsByWidthAndHeight[width] = context2DsByHeight;\r\n }\r\n\r\n let context2d = context2DsByHeight[height];\r\n if (!defined(context2d)) {\r\n const canvas = document.createElement(\"canvas\");\r\n canvas.width = width;\r\n canvas.height = height;\r\n context2d = canvas.getContext(\"2d\");\r\n context2d.globalCompositeOperation = \"copy\";\r\n context2DsByHeight[height] = context2d;\r\n }\r\n\r\n context2d.drawImage(image, 0, 0, width, height);\r\n return context2d.getImageData(0, 0, width, height).data;\r\n}\r\nexport default getImagePixels;\r\n","import Check from \"./Check.js\";\r\n\r\nconst blobUriRegex = /^blob:/i;\r\n\r\n/**\r\n * Determines if the specified uri is a blob uri.\r\n *\r\n * @function isBlobUri\r\n *\r\n * @param {String} uri The uri to test.\r\n * @returns {Boolean} true when the uri is a blob uri; otherwise, false.\r\n *\r\n * @private\r\n */\r\nfunction isBlobUri(uri) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.string(\"uri\", uri);\r\n //>>includeEnd('debug');\r\n\r\n return blobUriRegex.test(uri);\r\n}\r\nexport default isBlobUri;\r\n","import defined from \"./defined.js\";\r\n\r\nlet a;\r\n\r\n/**\r\n * Given a URL, determine whether that URL is considered cross-origin to the current page.\r\n *\r\n * @private\r\n */\r\nfunction isCrossOriginUrl(url) {\r\n if (!defined(a)) {\r\n a = document.createElement(\"a\");\r\n }\r\n\r\n // copy window location into the anchor to get consistent results\r\n // when the port is default for the protocol (e.g. 80 for HTTP)\r\n a.href = window.location.href;\r\n\r\n // host includes both hostname and port if the port is not standard\r\n const host = a.host;\r\n const protocol = a.protocol;\r\n\r\n a.href = url;\r\n // IE only absolutizes href on get, not set\r\n // eslint-disable-next-line no-self-assign\r\n a.href = a.href;\r\n\r\n return protocol !== a.protocol || host !== a.host;\r\n}\r\nexport default isCrossOriginUrl;\r\n","import Check from \"./Check.js\";\r\n\r\nconst dataUriRegex = /^data:/i;\r\n\r\n/**\r\n * Determines if the specified uri is a data uri.\r\n *\r\n * @function isDataUri\r\n *\r\n * @param {String} uri The uri to test.\r\n * @returns {Boolean} true when the uri is a data uri; otherwise, false.\r\n *\r\n * @private\r\n */\r\nfunction isDataUri(uri) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.string(\"uri\", uri);\r\n //>>includeEnd('debug');\r\n\r\n return dataUriRegex.test(uri);\r\n}\r\nexport default isDataUri;\r\n","/**\r\n * @private\r\n */\r\nfunction loadAndExecuteScript(url) {\r\n const script = document.createElement(\"script\");\r\n script.async = true;\r\n script.src = url;\r\n\r\n return new Promise((resolve, reject) => {\r\n if (window.crossOriginIsolated) {\r\n script.setAttribute(\"crossorigin\", \"anonymous\");\r\n }\r\n\r\n const head = document.getElementsByTagName(\"head\")[0];\r\n script.onload = function () {\r\n script.onload = undefined;\r\n head.removeChild(script);\r\n resolve();\r\n };\r\n script.onerror = function (e) {\r\n reject(e);\r\n };\r\n\r\n head.appendChild(script);\r\n });\r\n}\r\nexport default loadAndExecuteScript;\r\n","import defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * Converts an object representing a set of name/value pairs into a query string,\r\n * with names and values encoded properly for use in a URL. Values that are arrays\r\n * will produce multiple values with the same name.\r\n * @function objectToQuery\r\n *\r\n * @param {Object} obj The object containing data to encode.\r\n * @returns {String} An encoded query string.\r\n *\r\n *\r\n * @example\r\n * const str = Cesium.objectToQuery({\r\n * key1 : 'some value',\r\n * key2 : 'a/b',\r\n * key3 : ['x', 'y']\r\n * });\r\n *\r\n * @see queryToObject\r\n * // str will be:\r\n * // 'key1=some%20value&key2=a%2Fb&key3=x&key3=y'\r\n */\r\nfunction objectToQuery(obj) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(obj)) {\r\n throw new DeveloperError(\"obj is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n let result = \"\";\r\n for (const propName in obj) {\r\n if (obj.hasOwnProperty(propName)) {\r\n const value = obj[propName];\r\n\r\n const part = `${encodeURIComponent(propName)}=`;\r\n if (Array.isArray(value)) {\r\n for (let i = 0, len = value.length; i < len; ++i) {\r\n result += `${part + encodeURIComponent(value[i])}&`;\r\n }\r\n } else {\r\n result += `${part + encodeURIComponent(value)}&`;\r\n }\r\n }\r\n }\r\n\r\n // trim last &\r\n result = result.slice(0, -1);\r\n\r\n // This function used to replace %20 with + which is more compact and readable.\r\n // However, some servers didn't properly handle + as a space.\r\n // https://github.com/CesiumGS/cesium/issues/2192\r\n\r\n return result;\r\n}\r\nexport default objectToQuery;\r\n","import defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * Parses a query string into an object, where the keys and values of the object are the\r\n * name/value pairs from the query string, decoded. If a name appears multiple times,\r\n * the value in the object will be an array of values.\r\n * @function queryToObject\r\n *\r\n * @param {String} queryString The query string.\r\n * @returns {Object} An object containing the parameters parsed from the query string.\r\n *\r\n *\r\n * @example\r\n * const obj = Cesium.queryToObject('key1=some%20value&key2=a%2Fb&key3=x&key3=y');\r\n * // obj will be:\r\n * // {\r\n * // key1 : 'some value',\r\n * // key2 : 'a/b',\r\n * // key3 : ['x', 'y']\r\n * // }\r\n *\r\n * @see objectToQuery\r\n */\r\nfunction queryToObject(queryString) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(queryString)) {\r\n throw new DeveloperError(\"queryString is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const result = {};\r\n if (queryString === \"\") {\r\n return result;\r\n }\r\n const parts = queryString.replace(/\\+/g, \"%20\").split(/[&;]/);\r\n for (let i = 0, len = parts.length; i < len; ++i) {\r\n const subparts = parts[i].split(\"=\");\r\n\r\n const name = decodeURIComponent(subparts[0]);\r\n let value = subparts[1];\r\n if (defined(value)) {\r\n value = decodeURIComponent(value);\r\n } else {\r\n value = \"\";\r\n }\r\n\r\n const resultValue = result[name];\r\n if (typeof resultValue === \"string\") {\r\n // expand the single value to an array\r\n result[name] = [resultValue, value];\r\n } else if (Array.isArray(resultValue)) {\r\n resultValue.push(value);\r\n } else {\r\n result[name] = value;\r\n }\r\n }\r\n return result;\r\n}\r\nexport default queryToObject;\r\n","/**\r\n * State of the request.\r\n *\r\n * @enum {Number}\r\n */\r\nconst RequestState = {\r\n /**\r\n * Initial unissued state.\r\n *\r\n * @type Number\r\n * @constant\r\n */\r\n UNISSUED: 0,\r\n\r\n /**\r\n * Issued but not yet active. Will become active when open slots are available.\r\n *\r\n * @type Number\r\n * @constant\r\n */\r\n ISSUED: 1,\r\n\r\n /**\r\n * Actual http request has been sent.\r\n *\r\n * @type Number\r\n * @constant\r\n */\r\n ACTIVE: 2,\r\n\r\n /**\r\n * Request completed successfully.\r\n *\r\n * @type Number\r\n * @constant\r\n */\r\n RECEIVED: 3,\r\n\r\n /**\r\n * Request was cancelled, either explicitly or automatically because of low priority.\r\n *\r\n * @type Number\r\n * @constant\r\n */\r\n CANCELLED: 4,\r\n\r\n /**\r\n * Request failed.\r\n *\r\n * @type Number\r\n * @constant\r\n */\r\n FAILED: 5,\r\n};\r\nexport default Object.freeze(RequestState);\r\n","/**\r\n * An enum identifying the type of request. Used for finer grained logging and priority sorting.\r\n *\r\n * @enum {Number}\r\n */\r\nconst RequestType = {\r\n /**\r\n * Terrain request.\r\n *\r\n * @type Number\r\n * @constant\r\n */\r\n TERRAIN: 0,\r\n\r\n /**\r\n * Imagery request.\r\n *\r\n * @type Number\r\n * @constant\r\n */\r\n IMAGERY: 1,\r\n\r\n /**\r\n * 3D Tiles request.\r\n *\r\n * @type Number\r\n * @constant\r\n */\r\n TILES3D: 2,\r\n\r\n /**\r\n * Other request.\r\n *\r\n * @type Number\r\n * @constant\r\n */\r\n OTHER: 3,\r\n};\r\nexport default Object.freeze(RequestType);\r\n","import defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport RequestState from \"./RequestState.js\";\r\nimport RequestType from \"./RequestType.js\";\r\n\r\n/**\r\n * Stores information for making a request. In general this does not need to be constructed directly.\r\n *\r\n * @alias Request\r\n * @constructor\r\n\r\n * @param {Object} [options] An object with the following properties:\r\n * @param {String} [options.url] The url to request.\r\n * @param {Request.RequestCallback} [options.requestFunction] The function that makes the actual data request.\r\n * @param {Request.CancelCallback} [options.cancelFunction] The function that is called when the request is cancelled.\r\n * @param {Request.PriorityCallback} [options.priorityFunction] The function that is called to update the request's priority, which occurs once per frame.\r\n * @param {Number} [options.priority=0.0] The initial priority of the request.\r\n * @param {Boolean} [options.throttle=false] Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority.\r\n * @param {Boolean} [options.throttleByServer=false] Whether to throttle the request by server.\r\n * @param {RequestType} [options.type=RequestType.OTHER] The type of request.\r\n */\r\nfunction Request(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const throttleByServer = defaultValue(options.throttleByServer, false);\r\n const throttle = defaultValue(options.throttle, false);\r\n\r\n /**\r\n * The URL to request.\r\n *\r\n * @type {String}\r\n */\r\n this.url = options.url;\r\n\r\n /**\r\n * The function that makes the actual data request.\r\n *\r\n * @type {Request.RequestCallback}\r\n */\r\n this.requestFunction = options.requestFunction;\r\n\r\n /**\r\n * The function that is called when the request is cancelled.\r\n *\r\n * @type {Request.CancelCallback}\r\n */\r\n this.cancelFunction = options.cancelFunction;\r\n\r\n /**\r\n * The function that is called to update the request's priority, which occurs once per frame.\r\n *\r\n * @type {Request.PriorityCallback}\r\n */\r\n this.priorityFunction = options.priorityFunction;\r\n\r\n /**\r\n * Priority is a unit-less value where lower values represent higher priority.\r\n * For world-based objects, this is usually the distance from the camera.\r\n * A request that does not have a priority function defaults to a priority of 0.\r\n *\r\n * If priorityFunction is defined, this value is updated every frame with the result of that call.\r\n *\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.priority = defaultValue(options.priority, 0.0);\r\n\r\n /**\r\n * Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the\r\n * request will be throttled and sent based on priority.\r\n *\r\n * @type {Boolean}\r\n * @readonly\r\n *\r\n * @default false\r\n */\r\n this.throttle = throttle;\r\n\r\n /**\r\n * Whether to throttle the request by server. Browsers typically support about 6-8 parallel connections\r\n * for HTTP/1 servers, and an unlimited amount of connections for HTTP/2 servers. Setting this value\r\n * to true
is preferable for requests going through HTTP/1 servers.\r\n *\r\n * @type {Boolean}\r\n * @readonly\r\n *\r\n * @default false\r\n */\r\n this.throttleByServer = throttleByServer;\r\n\r\n /**\r\n * Type of request.\r\n *\r\n * @type {RequestType}\r\n * @readonly\r\n *\r\n * @default RequestType.OTHER\r\n */\r\n this.type = defaultValue(options.type, RequestType.OTHER);\r\n\r\n /**\r\n * A key used to identify the server that a request is going to. It is derived from the url's authority and scheme.\r\n *\r\n * @type {String}\r\n *\r\n * @private\r\n */\r\n this.serverKey = undefined;\r\n\r\n /**\r\n * The current state of the request.\r\n *\r\n * @type {RequestState}\r\n * @readonly\r\n */\r\n this.state = RequestState.UNISSUED;\r\n\r\n /**\r\n * The requests's deferred promise.\r\n *\r\n * @type {Object}\r\n *\r\n * @private\r\n */\r\n this.deferred = undefined;\r\n\r\n /**\r\n * Whether the request was explicitly cancelled.\r\n *\r\n * @type {Boolean}\r\n *\r\n * @private\r\n */\r\n this.cancelled = false;\r\n}\r\n\r\n/**\r\n * Mark the request as cancelled.\r\n *\r\n * @private\r\n */\r\nRequest.prototype.cancel = function () {\r\n this.cancelled = true;\r\n};\r\n\r\n/**\r\n * Duplicates a Request instance.\r\n *\r\n * @param {Request} [result] The object onto which to store the result.\r\n *\r\n * @returns {Request} The modified result parameter or a new Resource instance if one was not provided.\r\n */\r\nRequest.prototype.clone = function (result) {\r\n if (!defined(result)) {\r\n return new Request(this);\r\n }\r\n\r\n result.url = this.url;\r\n result.requestFunction = this.requestFunction;\r\n result.cancelFunction = this.cancelFunction;\r\n result.priorityFunction = this.priorityFunction;\r\n result.priority = this.priority;\r\n result.throttle = this.throttle;\r\n result.throttleByServer = this.throttleByServer;\r\n result.type = this.type;\r\n result.serverKey = this.serverKey;\r\n\r\n // These get defaulted because the cloned request hasn't been issued\r\n result.state = this.RequestState.UNISSUED;\r\n result.deferred = undefined;\r\n result.cancelled = false;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * The function that makes the actual data request.\r\n * @callback Request.RequestCallback\r\n * @returns {Promise} A promise for the requested data.\r\n */\r\n\r\n/**\r\n * The function that is called when the request is cancelled.\r\n * @callback Request.CancelCallback\r\n */\r\n\r\n/**\r\n * The function that is called to update the request's priority, which occurs once per frame.\r\n * @callback Request.PriorityCallback\r\n * @returns {Number} The updated priority value.\r\n */\r\nexport default Request;\r\n","/**\r\n * Parses the result of XMLHttpRequest's getAllResponseHeaders() method into\r\n * a dictionary.\r\n *\r\n * @function parseResponseHeaders\r\n *\r\n * @param {String} headerString The header string returned by getAllResponseHeaders(). The format is\r\n * described here: http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders()-method\r\n * @returns {Object} A dictionary of key/value pairs, where each key is the name of a header and the corresponding value\r\n * is that header's value.\r\n *\r\n * @private\r\n */\r\nfunction parseResponseHeaders(headerString) {\r\n const headers = {};\r\n\r\n if (!headerString) {\r\n return headers;\r\n }\r\n\r\n const headerPairs = headerString.split(\"\\u000d\\u000a\");\r\n\r\n for (let i = 0; i < headerPairs.length; ++i) {\r\n const headerPair = headerPairs[i];\r\n // Can't use split() here because it does the wrong thing\r\n // if the header value has the string \": \" in it.\r\n const index = headerPair.indexOf(\"\\u003a\\u0020\");\r\n if (index > 0) {\r\n const key = headerPair.substring(0, index);\r\n const val = headerPair.substring(index + 2);\r\n headers[key] = val;\r\n }\r\n }\r\n\r\n return headers;\r\n}\r\nexport default parseResponseHeaders;\r\n","import defined from \"./defined.js\";\r\nimport parseResponseHeaders from \"./parseResponseHeaders.js\";\r\n\r\n/**\r\n * An event that is raised when a request encounters an error.\r\n *\r\n * @constructor\r\n * @alias RequestErrorEvent\r\n *\r\n * @param {Number} [statusCode] The HTTP error status code, such as 404.\r\n * @param {Object} [response] The response included along with the error.\r\n * @param {String|Object} [responseHeaders] The response headers, represented either as an object literal or as a\r\n * string in the format returned by XMLHttpRequest's getAllResponseHeaders() function.\r\n */\r\nfunction RequestErrorEvent(statusCode, response, responseHeaders) {\r\n /**\r\n * The HTTP error status code, such as 404. If the error does not have a particular\r\n * HTTP code, this property will be undefined.\r\n *\r\n * @type {Number}\r\n */\r\n this.statusCode = statusCode;\r\n\r\n /**\r\n * The response included along with the error. If the error does not include a response,\r\n * this property will be undefined.\r\n *\r\n * @type {Object}\r\n */\r\n this.response = response;\r\n\r\n /**\r\n * The headers included in the response, represented as an object literal of key/value pairs.\r\n * If the error does not include any headers, this property will be undefined.\r\n *\r\n * @type {Object}\r\n */\r\n this.responseHeaders = responseHeaders;\r\n\r\n if (typeof this.responseHeaders === \"string\") {\r\n this.responseHeaders = parseResponseHeaders(this.responseHeaders);\r\n }\r\n}\r\n\r\n/**\r\n * Creates a string representing this RequestErrorEvent.\r\n * @memberof RequestErrorEvent\r\n *\r\n * @returns {String} A string representing the provided RequestErrorEvent.\r\n */\r\nRequestErrorEvent.prototype.toString = function () {\r\n let str = \"Request has failed.\";\r\n if (defined(this.statusCode)) {\r\n str += ` Status Code: ${this.statusCode}`;\r\n }\r\n return str;\r\n};\r\nexport default RequestErrorEvent;\r\n","import Check from \"./Check.js\";\r\nimport defined from \"./defined.js\";\r\n\r\n/**\r\n * A generic utility class for managing subscribers for a particular event.\r\n * This class is usually instantiated inside of a container class and\r\n * exposed as a property for others to subscribe to.\r\n *\r\n * @alias Event\r\n * @template Listener extends (...args: any[]) => void = (...args: any[]) => void\r\n * @constructor\r\n * @example\r\n * MyObject.prototype.myListener = function(arg1, arg2) {\r\n * this.myArg1Copy = arg1;\r\n * this.myArg2Copy = arg2;\r\n * }\r\n *\r\n * const myObjectInstance = new MyObject();\r\n * const evt = new Cesium.Event();\r\n * evt.addEventListener(MyObject.prototype.myListener, myObjectInstance);\r\n * evt.raiseEvent('1', '2');\r\n * evt.removeEventListener(MyObject.prototype.myListener);\r\n */\r\nfunction Event() {\r\n this._listeners = [];\r\n this._scopes = [];\r\n this._toRemove = [];\r\n this._insideRaiseEvent = false;\r\n}\r\n\r\nObject.defineProperties(Event.prototype, {\r\n /**\r\n * The number of listeners currently subscribed to the event.\r\n * @memberof Event.prototype\r\n * @type {Number}\r\n * @readonly\r\n */\r\n numberOfListeners: {\r\n get: function () {\r\n return this._listeners.length - this._toRemove.length;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Registers a callback function to be executed whenever the event is raised.\r\n * An optional scope can be provided to serve as the this
pointer\r\n * in which the function will execute.\r\n *\r\n * @param {Listener} listener The function to be executed when the event is raised.\r\n * @param {Object} [scope] An optional object scope to serve as the this
\r\n * pointer in which the listener function will execute.\r\n * @returns {Event.RemoveCallback} A function that will remove this event listener when invoked.\r\n *\r\n * @see Event#raiseEvent\r\n * @see Event#removeEventListener\r\n */\r\nEvent.prototype.addEventListener = function (listener, scope) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.func(\"listener\", listener);\r\n //>>includeEnd('debug');\r\n\r\n this._listeners.push(listener);\r\n this._scopes.push(scope);\r\n\r\n const event = this;\r\n return function () {\r\n event.removeEventListener(listener, scope);\r\n };\r\n};\r\n\r\n/**\r\n * Unregisters a previously registered callback.\r\n *\r\n * @param {Listener} listener The function to be unregistered.\r\n * @param {Object} [scope] The scope that was originally passed to addEventListener.\r\n * @returns {Boolean} true
if the listener was removed; false
if the listener and scope are not registered with the event.\r\n *\r\n * @see Event#addEventListener\r\n * @see Event#raiseEvent\r\n */\r\nEvent.prototype.removeEventListener = function (listener, scope) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.func(\"listener\", listener);\r\n //>>includeEnd('debug');\r\n\r\n const listeners = this._listeners;\r\n const scopes = this._scopes;\r\n\r\n let index = -1;\r\n for (let i = 0; i < listeners.length; i++) {\r\n if (listeners[i] === listener && scopes[i] === scope) {\r\n index = i;\r\n break;\r\n }\r\n }\r\n\r\n if (index !== -1) {\r\n if (this._insideRaiseEvent) {\r\n //In order to allow removing an event subscription from within\r\n //a callback, we don't actually remove the items here. Instead\r\n //remember the index they are at and undefined their value.\r\n this._toRemove.push(index);\r\n listeners[index] = undefined;\r\n scopes[index] = undefined;\r\n } else {\r\n listeners.splice(index, 1);\r\n scopes.splice(index, 1);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nfunction compareNumber(a, b) {\r\n return b - a;\r\n}\r\n\r\n/**\r\n * Raises the event by calling each registered listener with all supplied arguments.\r\n *\r\n * @param {...Parameters} arguments This method takes any number of parameters and passes them through to the listener functions.\r\n *\r\n * @see Event#addEventListener\r\n * @see Event#removeEventListener\r\n */\r\nEvent.prototype.raiseEvent = function () {\r\n this._insideRaiseEvent = true;\r\n\r\n let i;\r\n const listeners = this._listeners;\r\n const scopes = this._scopes;\r\n let length = listeners.length;\r\n\r\n for (i = 0; i < length; i++) {\r\n const listener = listeners[i];\r\n if (defined(listener)) {\r\n listeners[i].apply(scopes[i], arguments);\r\n }\r\n }\r\n\r\n //Actually remove items removed in removeEventListener.\r\n const toRemove = this._toRemove;\r\n length = toRemove.length;\r\n if (length > 0) {\r\n toRemove.sort(compareNumber);\r\n for (i = 0; i < length; i++) {\r\n const index = toRemove[i];\r\n listeners.splice(index, 1);\r\n scopes.splice(index, 1);\r\n }\r\n toRemove.length = 0;\r\n }\r\n\r\n this._insideRaiseEvent = false;\r\n};\r\n\r\n/**\r\n * A function that removes a listener.\r\n * @callback Event.RemoveCallback\r\n */\r\n\r\nexport default Event;\r\n","import Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\n\r\n/**\r\n * Array implementation of a heap.\r\n *\r\n * @alias Heap\r\n * @constructor\r\n * @private\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Heap.ComparatorCallback} options.comparator The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.\r\n */\r\nfunction Heap(options) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"options\", options);\r\n Check.defined(\"options.comparator\", options.comparator);\r\n //>>includeEnd('debug');\r\n\r\n this._comparator = options.comparator;\r\n this._array = [];\r\n this._length = 0;\r\n this._maximumLength = undefined;\r\n}\r\n\r\nObject.defineProperties(Heap.prototype, {\r\n /**\r\n * Gets the length of the heap.\r\n *\r\n * @memberof Heap.prototype\r\n *\r\n * @type {Number}\r\n * @readonly\r\n */\r\n length: {\r\n get: function () {\r\n return this._length;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the internal array.\r\n *\r\n * @memberof Heap.prototype\r\n *\r\n * @type {Array}\r\n * @readonly\r\n */\r\n internalArray: {\r\n get: function () {\r\n return this._array;\r\n },\r\n },\r\n\r\n /**\r\n * Gets and sets the maximum length of the heap.\r\n *\r\n * @memberof Heap.prototype\r\n *\r\n * @type {Number}\r\n */\r\n maximumLength: {\r\n get: function () {\r\n return this._maximumLength;\r\n },\r\n set: function (value) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.greaterThanOrEquals(\"maximumLength\", value, 0);\r\n //>>includeEnd('debug');\r\n const originalLength = this._length;\r\n if (value < originalLength) {\r\n const array = this._array;\r\n // Remove trailing references\r\n for (let i = value; i < originalLength; ++i) {\r\n array[i] = undefined;\r\n }\r\n this._length = value;\r\n array.length = value;\r\n }\r\n this._maximumLength = value;\r\n },\r\n },\r\n\r\n /**\r\n * The comparator to use for the heap. If comparator(a, b) is less than 0, sort a to a lower index than b, otherwise sort to a higher index.\r\n *\r\n * @memberof Heap.prototype\r\n *\r\n * @type {Heap.ComparatorCallback}\r\n */\r\n comparator: {\r\n get: function () {\r\n return this._comparator;\r\n },\r\n },\r\n});\r\n\r\nfunction swap(array, a, b) {\r\n const temp = array[a];\r\n array[a] = array[b];\r\n array[b] = temp;\r\n}\r\n\r\n/**\r\n * Resizes the internal array of the heap.\r\n *\r\n * @param {Number} [length] The length to resize internal array to. Defaults to the current length of the heap.\r\n */\r\nHeap.prototype.reserve = function (length) {\r\n length = defaultValue(length, this._length);\r\n this._array.length = length;\r\n};\r\n\r\n/**\r\n * Update the heap so that index and all descendants satisfy the heap property.\r\n *\r\n * @param {Number} [index=0] The starting index to heapify from.\r\n */\r\nHeap.prototype.heapify = function (index) {\r\n index = defaultValue(index, 0);\r\n const length = this._length;\r\n const comparator = this._comparator;\r\n const array = this._array;\r\n let candidate = -1;\r\n let inserting = true;\r\n\r\n while (inserting) {\r\n const right = 2 * (index + 1);\r\n const left = right - 1;\r\n\r\n if (left < length && comparator(array[left], array[index]) < 0) {\r\n candidate = left;\r\n } else {\r\n candidate = index;\r\n }\r\n\r\n if (right < length && comparator(array[right], array[candidate]) < 0) {\r\n candidate = right;\r\n }\r\n if (candidate !== index) {\r\n swap(array, candidate, index);\r\n index = candidate;\r\n } else {\r\n inserting = false;\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Resort the heap.\r\n */\r\nHeap.prototype.resort = function () {\r\n const length = this._length;\r\n for (let i = Math.ceil(length / 2); i >= 0; --i) {\r\n this.heapify(i);\r\n }\r\n};\r\n\r\n/**\r\n * Insert an element into the heap. If the length would grow greater than maximumLength\r\n * of the heap, extra elements are removed.\r\n *\r\n * @param {*} element The element to insert\r\n *\r\n * @return {*} The element that was removed from the heap if the heap is at full capacity.\r\n */\r\nHeap.prototype.insert = function (element) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"element\", element);\r\n //>>includeEnd('debug');\r\n\r\n const array = this._array;\r\n const comparator = this._comparator;\r\n const maximumLength = this._maximumLength;\r\n\r\n let index = this._length++;\r\n if (index < array.length) {\r\n array[index] = element;\r\n } else {\r\n array.push(element);\r\n }\r\n\r\n while (index !== 0) {\r\n const parent = Math.floor((index - 1) / 2);\r\n if (comparator(array[index], array[parent]) < 0) {\r\n swap(array, index, parent);\r\n index = parent;\r\n } else {\r\n break;\r\n }\r\n }\r\n\r\n let removedElement;\r\n\r\n if (defined(maximumLength) && this._length > maximumLength) {\r\n removedElement = array[maximumLength];\r\n this._length = maximumLength;\r\n }\r\n\r\n return removedElement;\r\n};\r\n\r\n/**\r\n * Remove the element specified by index from the heap and return it.\r\n *\r\n * @param {Number} [index=0] The index to remove.\r\n * @returns {*} The specified element of the heap.\r\n */\r\nHeap.prototype.pop = function (index) {\r\n index = defaultValue(index, 0);\r\n if (this._length === 0) {\r\n return undefined;\r\n }\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number.lessThan(\"index\", index, this._length);\r\n //>>includeEnd('debug');\r\n\r\n const array = this._array;\r\n const root = array[index];\r\n swap(array, index, --this._length);\r\n this.heapify(index);\r\n array[this._length] = undefined; // Remove trailing reference\r\n return root;\r\n};\r\n\r\n/**\r\n * The comparator to use for the heap.\r\n * @callback Heap.ComparatorCallback\r\n * @param {*} a An element in the heap.\r\n * @param {*} b An element in the heap.\r\n * @returns {Number} If the result of the comparison is less than 0, sort a to a lower index than b, otherwise sort to a higher index.\r\n */\r\nexport default Heap;\r\n","import Uri from \"urijs\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defer from \"./defer.js\";\r\nimport defined from \"./defined.js\";\r\nimport Event from \"./Event.js\";\r\nimport Heap from \"./Heap.js\";\r\nimport isBlobUri from \"./isBlobUri.js\";\r\nimport isDataUri from \"./isDataUri.js\";\r\nimport RequestState from \"./RequestState.js\";\r\n\r\nfunction sortRequests(a, b) {\r\n return a.priority - b.priority;\r\n}\r\n\r\nconst statistics = {\r\n numberOfAttemptedRequests: 0,\r\n numberOfActiveRequests: 0,\r\n numberOfCancelledRequests: 0,\r\n numberOfCancelledActiveRequests: 0,\r\n numberOfFailedRequests: 0,\r\n numberOfActiveRequestsEver: 0,\r\n lastNumberOfActiveRequests: 0,\r\n};\r\n\r\nlet priorityHeapLength = 20;\r\nconst requestHeap = new Heap({\r\n comparator: sortRequests,\r\n});\r\nrequestHeap.maximumLength = priorityHeapLength;\r\nrequestHeap.reserve(priorityHeapLength);\r\n\r\nconst activeRequests = [];\r\nlet numberOfActiveRequestsByServer = {};\r\n\r\nconst pageUri =\r\n typeof document !== \"undefined\" ? new Uri(document.location.href) : new Uri();\r\n\r\nconst requestCompletedEvent = new Event();\r\n\r\n/**\r\n * The request scheduler is used to track and constrain the number of active requests in order to prioritize incoming requests. The ability\r\n * to retain control over the number of requests in CesiumJS is important because due to events such as changes in the camera position,\r\n * a lot of new requests may be generated and a lot of in-flight requests may become redundant. The request scheduler manually constrains the\r\n * number of requests so that newer requests wait in a shorter queue and don't have to compete for bandwidth with requests that have expired.\r\n *\r\n * @namespace RequestScheduler\r\n *\r\n */\r\nfunction RequestScheduler() {}\r\n\r\n/**\r\n * The maximum number of simultaneous active requests. Un-throttled requests do not observe this limit.\r\n * @type {Number}\r\n * @default 50\r\n */\r\nRequestScheduler.maximumRequests = 50;\r\n\r\n/**\r\n * The maximum number of simultaneous active requests per server. Un-throttled requests or servers specifically\r\n * listed in {@link requestsByServer} do not observe this limit.\r\n * @type {Number}\r\n * @default 6\r\n */\r\nRequestScheduler.maximumRequestsPerServer = 6;\r\n\r\n/**\r\n * A per server key list of overrides to use for throttling instead of maximumRequestsPerServer
\r\n * @type {Object}\r\n *\r\n * @example\r\n * RequestScheduler.requestsByServer = {\r\n * 'api.cesium.com:443': 18,\r\n * 'assets.cesium.com:443': 18\r\n * };\r\n */\r\nRequestScheduler.requestsByServer = {\r\n \"api.cesium.com:443\": 18,\r\n \"assets.cesium.com:443\": 18,\r\n};\r\n\r\n/**\r\n * Specifies if the request scheduler should throttle incoming requests, or let the browser queue requests under its control.\r\n * @type {Boolean}\r\n * @default true\r\n */\r\nRequestScheduler.throttleRequests = true;\r\n\r\n/**\r\n * When true, log statistics to the console every frame\r\n * @type {Boolean}\r\n * @default false\r\n * @private\r\n */\r\nRequestScheduler.debugShowStatistics = false;\r\n\r\n/**\r\n * An event that's raised when a request is completed. Event handlers are passed\r\n * the error object if the request fails.\r\n *\r\n * @type {Event}\r\n * @default Event()\r\n * @private\r\n */\r\nRequestScheduler.requestCompletedEvent = requestCompletedEvent;\r\n\r\nObject.defineProperties(RequestScheduler, {\r\n /**\r\n * Returns the statistics used by the request scheduler.\r\n *\r\n * @memberof RequestScheduler\r\n *\r\n * @type Object\r\n * @readonly\r\n * @private\r\n */\r\n statistics: {\r\n get: function () {\r\n return statistics;\r\n },\r\n },\r\n\r\n /**\r\n * The maximum size of the priority heap. This limits the number of requests that are sorted by priority. Only applies to requests that are not yet active.\r\n *\r\n * @memberof RequestScheduler\r\n *\r\n * @type {Number}\r\n * @default 20\r\n * @private\r\n */\r\n priorityHeapLength: {\r\n get: function () {\r\n return priorityHeapLength;\r\n },\r\n set: function (value) {\r\n // If the new length shrinks the heap, need to cancel some of the requests.\r\n // Since this value is not intended to be tweaked regularly it is fine to just cancel the high priority requests.\r\n if (value < priorityHeapLength) {\r\n while (requestHeap.length > value) {\r\n const request = requestHeap.pop();\r\n cancelRequest(request);\r\n }\r\n }\r\n priorityHeapLength = value;\r\n requestHeap.maximumLength = value;\r\n requestHeap.reserve(value);\r\n },\r\n },\r\n});\r\n\r\nfunction updatePriority(request) {\r\n if (defined(request.priorityFunction)) {\r\n request.priority = request.priorityFunction();\r\n }\r\n}\r\n\r\n/**\r\n * Check if there are open slots for a particular server key. If desiredRequests is greater than 1, this checks if the queue has room for scheduling multiple requests.\r\n * @param {String} serverKey The server key returned by {@link RequestScheduler.getServerKey}.\r\n * @param {Number} [desiredRequests=1] How many requests the caller plans to request\r\n * @return {Boolean} True if there are enough open slots for desiredRequests
more requests.\r\n * @private\r\n */\r\nRequestScheduler.serverHasOpenSlots = function (serverKey, desiredRequests) {\r\n desiredRequests = defaultValue(desiredRequests, 1);\r\n\r\n const maxRequests = defaultValue(\r\n RequestScheduler.requestsByServer[serverKey],\r\n RequestScheduler.maximumRequestsPerServer\r\n );\r\n const hasOpenSlotsServer =\r\n numberOfActiveRequestsByServer[serverKey] + desiredRequests <= maxRequests;\r\n\r\n return hasOpenSlotsServer;\r\n};\r\n\r\n/**\r\n * Check if the priority heap has open slots, regardless of which server they\r\n * are from. This is used in {@link Multiple3DTileContent} for determining when\r\n * all requests can be scheduled\r\n * @param {Number} desiredRequests The number of requests the caller intends to make\r\n * @return {Boolean} true
if the heap has enough available slots to meet the desiredRequests. false
otherwise.\r\n *\r\n * @private\r\n */\r\nRequestScheduler.heapHasOpenSlots = function (desiredRequests) {\r\n const hasOpenSlotsHeap =\r\n requestHeap.length + desiredRequests <= priorityHeapLength;\r\n return hasOpenSlotsHeap;\r\n};\r\n\r\nfunction issueRequest(request) {\r\n if (request.state === RequestState.UNISSUED) {\r\n request.state = RequestState.ISSUED;\r\n request.deferred = defer();\r\n }\r\n return request.deferred.promise;\r\n}\r\n\r\nfunction getRequestReceivedFunction(request) {\r\n return function (results) {\r\n if (request.state === RequestState.CANCELLED) {\r\n // If the data request comes back but the request is cancelled, ignore it.\r\n return;\r\n }\r\n // explicitly set to undefined to ensure GC of request response data. See #8843\r\n const deferred = request.deferred;\r\n\r\n --statistics.numberOfActiveRequests;\r\n --numberOfActiveRequestsByServer[request.serverKey];\r\n requestCompletedEvent.raiseEvent();\r\n request.state = RequestState.RECEIVED;\r\n request.deferred = undefined;\r\n\r\n deferred.resolve(results);\r\n };\r\n}\r\n\r\nfunction getRequestFailedFunction(request) {\r\n return function (error) {\r\n if (request.state === RequestState.CANCELLED) {\r\n // If the data request comes back but the request is cancelled, ignore it.\r\n return;\r\n }\r\n ++statistics.numberOfFailedRequests;\r\n --statistics.numberOfActiveRequests;\r\n --numberOfActiveRequestsByServer[request.serverKey];\r\n requestCompletedEvent.raiseEvent(error);\r\n request.state = RequestState.FAILED;\r\n request.deferred.reject(error);\r\n };\r\n}\r\n\r\nfunction startRequest(request) {\r\n const promise = issueRequest(request);\r\n request.state = RequestState.ACTIVE;\r\n activeRequests.push(request);\r\n ++statistics.numberOfActiveRequests;\r\n ++statistics.numberOfActiveRequestsEver;\r\n ++numberOfActiveRequestsByServer[request.serverKey];\r\n request\r\n .requestFunction()\r\n .then(getRequestReceivedFunction(request))\r\n .catch(getRequestFailedFunction(request));\r\n return promise;\r\n}\r\n\r\nfunction cancelRequest(request) {\r\n const active = request.state === RequestState.ACTIVE;\r\n request.state = RequestState.CANCELLED;\r\n ++statistics.numberOfCancelledRequests;\r\n // check that deferred has not been cleared since cancelRequest can be called\r\n // on a finished request, e.g. by clearForSpecs during tests\r\n if (defined(request.deferred)) {\r\n const deferred = request.deferred;\r\n request.deferred = undefined;\r\n deferred.reject();\r\n }\r\n\r\n if (active) {\r\n --statistics.numberOfActiveRequests;\r\n --numberOfActiveRequestsByServer[request.serverKey];\r\n ++statistics.numberOfCancelledActiveRequests;\r\n }\r\n\r\n if (defined(request.cancelFunction)) {\r\n request.cancelFunction();\r\n }\r\n}\r\n\r\n/**\r\n * Sort requests by priority and start requests.\r\n * @private\r\n */\r\nRequestScheduler.update = function () {\r\n let i;\r\n let request;\r\n\r\n // Loop over all active requests. Cancelled, failed, or received requests are removed from the array to make room for new requests.\r\n let removeCount = 0;\r\n const activeLength = activeRequests.length;\r\n for (i = 0; i < activeLength; ++i) {\r\n request = activeRequests[i];\r\n if (request.cancelled) {\r\n // Request was explicitly cancelled\r\n cancelRequest(request);\r\n }\r\n if (request.state !== RequestState.ACTIVE) {\r\n // Request is no longer active, remove from array\r\n ++removeCount;\r\n continue;\r\n }\r\n if (removeCount > 0) {\r\n // Shift back to fill in vacated slots from completed requests\r\n activeRequests[i - removeCount] = request;\r\n }\r\n }\r\n activeRequests.length -= removeCount;\r\n\r\n // Update priority of issued requests and resort the heap\r\n const issuedRequests = requestHeap.internalArray;\r\n const issuedLength = requestHeap.length;\r\n for (i = 0; i < issuedLength; ++i) {\r\n updatePriority(issuedRequests[i]);\r\n }\r\n requestHeap.resort();\r\n\r\n // Get the number of open slots and fill with the highest priority requests.\r\n // Un-throttled requests are automatically added to activeRequests, so activeRequests.length may exceed maximumRequests\r\n const openSlots = Math.max(\r\n RequestScheduler.maximumRequests - activeRequests.length,\r\n 0\r\n );\r\n let filledSlots = 0;\r\n while (filledSlots < openSlots && requestHeap.length > 0) {\r\n // Loop until all open slots are filled or the heap becomes empty\r\n request = requestHeap.pop();\r\n if (request.cancelled) {\r\n // Request was explicitly cancelled\r\n cancelRequest(request);\r\n continue;\r\n }\r\n\r\n if (\r\n request.throttleByServer &&\r\n !RequestScheduler.serverHasOpenSlots(request.serverKey)\r\n ) {\r\n // Open slots are available, but the request is throttled by its server. Cancel and try again later.\r\n cancelRequest(request);\r\n continue;\r\n }\r\n\r\n startRequest(request);\r\n ++filledSlots;\r\n }\r\n\r\n updateStatistics();\r\n};\r\n\r\n/**\r\n * Get the server key from a given url.\r\n *\r\n * @param {String} url The url.\r\n * @returns {String} The server key.\r\n * @private\r\n */\r\nRequestScheduler.getServerKey = function (url) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.string(\"url\", url);\r\n //>>includeEnd('debug');\r\n\r\n let uri = new Uri(url);\r\n if (uri.scheme() === \"\") {\r\n uri = new Uri(url).absoluteTo(pageUri);\r\n uri.normalize();\r\n }\r\n\r\n let serverKey = uri.authority();\r\n if (!/:/.test(serverKey)) {\r\n // If the authority does not contain a port number, add port 443 for https or port 80 for http\r\n serverKey = `${serverKey}:${uri.scheme() === \"https\" ? \"443\" : \"80\"}`;\r\n }\r\n\r\n const length = numberOfActiveRequestsByServer[serverKey];\r\n if (!defined(length)) {\r\n numberOfActiveRequestsByServer[serverKey] = 0;\r\n }\r\n\r\n return serverKey;\r\n};\r\n\r\n/**\r\n * Issue a request. If request.throttle is false, the request is sent immediately. Otherwise the request will be\r\n * queued and sorted by priority before being sent.\r\n *\r\n * @param {Request} request The request object.\r\n *\r\n * @returns {Promise|undefined} A Promise for the requested data, or undefined if this request does not have high enough priority to be issued.\r\n *\r\n * @private\r\n */\r\nRequestScheduler.request = function (request) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"request\", request);\r\n Check.typeOf.string(\"request.url\", request.url);\r\n Check.typeOf.func(\"request.requestFunction\", request.requestFunction);\r\n //>>includeEnd('debug');\r\n\r\n if (isDataUri(request.url) || isBlobUri(request.url)) {\r\n requestCompletedEvent.raiseEvent();\r\n request.state = RequestState.RECEIVED;\r\n return request.requestFunction();\r\n }\r\n\r\n ++statistics.numberOfAttemptedRequests;\r\n\r\n if (!defined(request.serverKey)) {\r\n request.serverKey = RequestScheduler.getServerKey(request.url);\r\n }\r\n\r\n if (\r\n RequestScheduler.throttleRequests &&\r\n request.throttleByServer &&\r\n !RequestScheduler.serverHasOpenSlots(request.serverKey)\r\n ) {\r\n // Server is saturated. Try again later.\r\n return undefined;\r\n }\r\n\r\n if (!RequestScheduler.throttleRequests || !request.throttle) {\r\n return startRequest(request);\r\n }\r\n\r\n if (activeRequests.length >= RequestScheduler.maximumRequests) {\r\n // Active requests are saturated. Try again later.\r\n return undefined;\r\n }\r\n\r\n // Insert into the priority heap and see if a request was bumped off. If this request is the lowest\r\n // priority it will be returned.\r\n updatePriority(request);\r\n const removedRequest = requestHeap.insert(request);\r\n\r\n if (defined(removedRequest)) {\r\n if (removedRequest === request) {\r\n // Request does not have high enough priority to be issued\r\n return undefined;\r\n }\r\n // A previously issued request has been bumped off the priority heap, so cancel it\r\n cancelRequest(removedRequest);\r\n }\r\n\r\n return issueRequest(request);\r\n};\r\n\r\nfunction updateStatistics() {\r\n if (!RequestScheduler.debugShowStatistics) {\r\n return;\r\n }\r\n\r\n if (\r\n statistics.numberOfActiveRequests === 0 &&\r\n statistics.lastNumberOfActiveRequests > 0\r\n ) {\r\n if (statistics.numberOfAttemptedRequests > 0) {\r\n console.log(\r\n `Number of attempted requests: ${statistics.numberOfAttemptedRequests}`\r\n );\r\n statistics.numberOfAttemptedRequests = 0;\r\n }\r\n\r\n if (statistics.numberOfCancelledRequests > 0) {\r\n console.log(\r\n `Number of cancelled requests: ${statistics.numberOfCancelledRequests}`\r\n );\r\n statistics.numberOfCancelledRequests = 0;\r\n }\r\n\r\n if (statistics.numberOfCancelledActiveRequests > 0) {\r\n console.log(\r\n `Number of cancelled active requests: ${statistics.numberOfCancelledActiveRequests}`\r\n );\r\n statistics.numberOfCancelledActiveRequests = 0;\r\n }\r\n\r\n if (statistics.numberOfFailedRequests > 0) {\r\n console.log(\r\n `Number of failed requests: ${statistics.numberOfFailedRequests}`\r\n );\r\n statistics.numberOfFailedRequests = 0;\r\n }\r\n }\r\n\r\n statistics.lastNumberOfActiveRequests = statistics.numberOfActiveRequests;\r\n}\r\n\r\n/**\r\n * For testing only. Clears any requests that may not have completed from previous tests.\r\n *\r\n * @private\r\n */\r\nRequestScheduler.clearForSpecs = function () {\r\n while (requestHeap.length > 0) {\r\n const request = requestHeap.pop();\r\n cancelRequest(request);\r\n }\r\n const length = activeRequests.length;\r\n for (let i = 0; i < length; ++i) {\r\n cancelRequest(activeRequests[i]);\r\n }\r\n activeRequests.length = 0;\r\n numberOfActiveRequestsByServer = {};\r\n\r\n // Clear stats\r\n statistics.numberOfAttemptedRequests = 0;\r\n statistics.numberOfActiveRequests = 0;\r\n statistics.numberOfCancelledRequests = 0;\r\n statistics.numberOfCancelledActiveRequests = 0;\r\n statistics.numberOfFailedRequests = 0;\r\n statistics.numberOfActiveRequestsEver = 0;\r\n statistics.lastNumberOfActiveRequests = 0;\r\n};\r\n\r\n/**\r\n * For testing only.\r\n *\r\n * @private\r\n */\r\nRequestScheduler.numberOfActiveRequestsByServer = function (serverKey) {\r\n return numberOfActiveRequestsByServer[serverKey];\r\n};\r\n\r\n/**\r\n * For testing only.\r\n *\r\n * @private\r\n */\r\nRequestScheduler.requestHeap = requestHeap;\r\nexport default RequestScheduler;\r\n","import Uri from \"urijs\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * A singleton that contains all of the servers that are trusted. Credentials will be sent with\r\n * any requests to these servers.\r\n *\r\n * @namespace TrustedServers\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n */\r\nconst TrustedServers = {};\r\nlet _servers = {};\r\n\r\n/**\r\n * Adds a trusted server to the registry\r\n *\r\n * @param {String} host The host to be added.\r\n * @param {Number} port The port used to access the host.\r\n *\r\n * @example\r\n * // Add a trusted server\r\n * TrustedServers.add('my.server.com', 80);\r\n */\r\nTrustedServers.add = function (host, port) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(host)) {\r\n throw new DeveloperError(\"host is required.\");\r\n }\r\n if (!defined(port) || port <= 0) {\r\n throw new DeveloperError(\"port is required to be greater than 0.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const authority = `${host.toLowerCase()}:${port}`;\r\n if (!defined(_servers[authority])) {\r\n _servers[authority] = true;\r\n }\r\n};\r\n\r\n/**\r\n * Removes a trusted server from the registry\r\n *\r\n * @param {String} host The host to be removed.\r\n * @param {Number} port The port used to access the host.\r\n *\r\n * @example\r\n * // Remove a trusted server\r\n * TrustedServers.remove('my.server.com', 80);\r\n */\r\nTrustedServers.remove = function (host, port) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(host)) {\r\n throw new DeveloperError(\"host is required.\");\r\n }\r\n if (!defined(port) || port <= 0) {\r\n throw new DeveloperError(\"port is required to be greater than 0.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const authority = `${host.toLowerCase()}:${port}`;\r\n if (defined(_servers[authority])) {\r\n delete _servers[authority];\r\n }\r\n};\r\n\r\nfunction getAuthority(url) {\r\n const uri = new Uri(url);\r\n uri.normalize();\r\n\r\n // Removes username:password@ so we just have host[:port]\r\n let authority = uri.authority();\r\n if (authority.length === 0) {\r\n return undefined; // Relative URL\r\n }\r\n uri.authority(authority);\r\n\r\n if (authority.indexOf(\"@\") !== -1) {\r\n const parts = authority.split(\"@\");\r\n authority = parts[1];\r\n }\r\n\r\n // If the port is missing add one based on the scheme\r\n if (authority.indexOf(\":\") === -1) {\r\n let scheme = uri.scheme();\r\n if (scheme.length === 0) {\r\n scheme = window.location.protocol;\r\n scheme = scheme.substring(0, scheme.length - 1);\r\n }\r\n if (scheme === \"http\") {\r\n authority += \":80\";\r\n } else if (scheme === \"https\") {\r\n authority += \":443\";\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n\r\n return authority;\r\n}\r\n\r\n/**\r\n * Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.\r\n *\r\n * @param {String} url The url to be tested against the trusted list\r\n *\r\n * @returns {boolean} Returns true if url is trusted, false otherwise.\r\n *\r\n * @example\r\n * // Add server\r\n * TrustedServers.add('my.server.com', 81);\r\n *\r\n * // Check if server is trusted\r\n * if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {\r\n * // my.server.com:81 is trusted\r\n * }\r\n * if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {\r\n * // my.server.com isn't trusted\r\n * }\r\n */\r\nTrustedServers.contains = function (url) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(url)) {\r\n throw new DeveloperError(\"url is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n const authority = getAuthority(url);\r\n if (defined(authority) && defined(_servers[authority])) {\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n\r\n/**\r\n * Clears the registry\r\n *\r\n * @example\r\n * // Remove a trusted server\r\n * TrustedServers.clear();\r\n */\r\nTrustedServers.clear = function () {\r\n _servers = {};\r\n};\r\nexport default TrustedServers;\r\n","import Uri from \"urijs\";\r\nimport appendForwardSlash from \"./appendForwardSlash.js\";\r\nimport Check from \"./Check.js\";\r\nimport clone from \"./clone.js\";\r\nimport combine from \"./combine.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defer from \"./defer.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport getAbsoluteUri from \"./getAbsoluteUri.js\";\r\nimport getBaseUri from \"./getBaseUri.js\";\r\nimport getExtensionFromUri from \"./getExtensionFromUri.js\";\r\nimport getImagePixels from \"./getImagePixels.js\";\r\nimport isBlobUri from \"./isBlobUri.js\";\r\nimport isCrossOriginUrl from \"./isCrossOriginUrl.js\";\r\nimport isDataUri from \"./isDataUri.js\";\r\nimport loadAndExecuteScript from \"./loadAndExecuteScript.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport objectToQuery from \"./objectToQuery.js\";\r\nimport queryToObject from \"./queryToObject.js\";\r\nimport Request from \"./Request.js\";\r\nimport RequestErrorEvent from \"./RequestErrorEvent.js\";\r\nimport RequestScheduler from \"./RequestScheduler.js\";\r\nimport RequestState from \"./RequestState.js\";\r\nimport RuntimeError from \"./RuntimeError.js\";\r\nimport TrustedServers from \"./TrustedServers.js\";\r\n\r\nconst xhrBlobSupported = (function () {\r\n try {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", \"#\", true);\r\n xhr.responseType = \"blob\";\r\n return xhr.responseType === \"blob\";\r\n } catch (e) {\r\n return false;\r\n }\r\n})();\r\n\r\n/**\r\n * Parses a query string and returns the object equivalent.\r\n *\r\n * @param {Uri} uri The Uri with a query object.\r\n * @param {Resource} resource The Resource that will be assigned queryParameters.\r\n * @param {Boolean} merge If true, we'll merge with the resource's existing queryParameters. Otherwise they will be replaced.\r\n * @param {Boolean} preserveQueryParameters If true duplicate parameters will be concatenated into an array. If false, keys in uri will take precedence.\r\n *\r\n * @private\r\n */\r\nfunction parseQuery(uri, resource, merge, preserveQueryParameters) {\r\n const queryString = uri.query();\r\n if (queryString.length === 0) {\r\n return {};\r\n }\r\n\r\n let query;\r\n // Special case we run into where the querystring is just a string, not key/value pairs\r\n if (queryString.indexOf(\"=\") === -1) {\r\n const result = {};\r\n result[queryString] = undefined;\r\n query = result;\r\n } else {\r\n query = queryToObject(queryString);\r\n }\r\n\r\n if (merge) {\r\n resource._queryParameters = combineQueryParameters(\r\n query,\r\n resource._queryParameters,\r\n preserveQueryParameters\r\n );\r\n } else {\r\n resource._queryParameters = query;\r\n }\r\n uri.search(\"\");\r\n}\r\n\r\n/**\r\n * Converts a query object into a string.\r\n *\r\n * @param {Uri} uri The Uri object that will have the query object set.\r\n * @param {Resource} resource The resource that has queryParameters\r\n *\r\n * @private\r\n */\r\nfunction stringifyQuery(uri, resource) {\r\n const queryObject = resource._queryParameters;\r\n\r\n const keys = Object.keys(queryObject);\r\n\r\n // We have 1 key with an undefined value, so this is just a string, not key/value pairs\r\n if (keys.length === 1 && !defined(queryObject[keys[0]])) {\r\n uri.search(keys[0]);\r\n } else {\r\n uri.search(objectToQuery(queryObject));\r\n }\r\n}\r\n\r\n/**\r\n * Clones a value if it is defined, otherwise returns the default value\r\n *\r\n * @param {*} [val] The value to clone.\r\n * @param {*} [defaultVal] The default value.\r\n *\r\n * @returns {*} A clone of val or the defaultVal.\r\n *\r\n * @private\r\n */\r\nfunction defaultClone(val, defaultVal) {\r\n if (!defined(val)) {\r\n return defaultVal;\r\n }\r\n\r\n return defined(val.clone) ? val.clone() : clone(val);\r\n}\r\n\r\n/**\r\n * Checks to make sure the Resource isn't already being requested.\r\n *\r\n * @param {Request} request The request to check.\r\n *\r\n * @private\r\n */\r\nfunction checkAndResetRequest(request) {\r\n if (\r\n request.state === RequestState.ISSUED ||\r\n request.state === RequestState.ACTIVE\r\n ) {\r\n throw new RuntimeError(\"The Resource is already being fetched.\");\r\n }\r\n\r\n request.state = RequestState.UNISSUED;\r\n request.deferred = undefined;\r\n}\r\n\r\n/**\r\n * This combines a map of query parameters.\r\n *\r\n * @param {Object} q1 The first map of query parameters. Values in this map will take precedence if preserveQueryParameters is false.\r\n * @param {Object} q2 The second map of query parameters.\r\n * @param {Boolean} preserveQueryParameters If true duplicate parameters will be concatenated into an array. If false, keys in q1 will take precedence.\r\n *\r\n * @returns {Object} The combined map of query parameters.\r\n *\r\n * @example\r\n * const q1 = {\r\n * a: 1,\r\n * b: 2\r\n * };\r\n * const q2 = {\r\n * a: 3,\r\n * c: 4\r\n * };\r\n * const q3 = {\r\n * b: [5, 6],\r\n * d: 7\r\n * }\r\n *\r\n * // Returns\r\n * // {\r\n * // a: [1, 3],\r\n * // b: 2,\r\n * // c: 4\r\n * // };\r\n * combineQueryParameters(q1, q2, true);\r\n *\r\n * // Returns\r\n * // {\r\n * // a: 1,\r\n * // b: 2,\r\n * // c: 4\r\n * // };\r\n * combineQueryParameters(q1, q2, false);\r\n *\r\n * // Returns\r\n * // {\r\n * // a: 1,\r\n * // b: [2, 5, 6],\r\n * // d: 7\r\n * // };\r\n * combineQueryParameters(q1, q3, true);\r\n *\r\n * // Returns\r\n * // {\r\n * // a: 1,\r\n * // b: 2,\r\n * // d: 7\r\n * // };\r\n * combineQueryParameters(q1, q3, false);\r\n *\r\n * @private\r\n */\r\nfunction combineQueryParameters(q1, q2, preserveQueryParameters) {\r\n if (!preserveQueryParameters) {\r\n return combine(q1, q2);\r\n }\r\n\r\n const result = clone(q1, true);\r\n for (const param in q2) {\r\n if (q2.hasOwnProperty(param)) {\r\n let value = result[param];\r\n const q2Value = q2[param];\r\n if (defined(value)) {\r\n if (!Array.isArray(value)) {\r\n value = result[param] = [value];\r\n }\r\n\r\n result[param] = value.concat(q2Value);\r\n } else {\r\n result[param] = Array.isArray(q2Value) ? q2Value.slice() : q2Value;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * @typedef {Object} Resource.ConstructorOptions\r\n *\r\n * Initialization options for the Resource constructor\r\n *\r\n * @property {String} url The url of the resource.\r\n * @property {Object} [queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @property {Object} [templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @property {Object} [headers={}] Additional HTTP headers that will be sent.\r\n * @property {Proxy} [proxy] A proxy to be used when loading the resource.\r\n * @property {Resource.RetryCallback} [retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @property {Number} [retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @property {Request} [request] A Request object that will be used. Intended for internal use only.\r\n */\r\n\r\n/**\r\n * A resource that includes the location and any other parameters we need to retrieve it or create derived resources. It also provides the ability to retry requests.\r\n *\r\n * @alias Resource\r\n * @constructor\r\n *\r\n * @param {String|Resource.ConstructorOptions} options A url or an object describing initialization options\r\n *\r\n * @example\r\n * function refreshTokenRetryCallback(resource, error) {\r\n * if (error.statusCode === 403) {\r\n * // 403 status code means a new token should be generated\r\n * return getNewAccessToken()\r\n * .then(function(token) {\r\n * resource.queryParameters.access_token = token;\r\n * return true;\r\n * })\r\n * .catch(function() {\r\n * return false;\r\n * });\r\n * }\r\n *\r\n * return false;\r\n * }\r\n *\r\n * const resource = new Resource({\r\n * url: 'http://server.com/path/to/resource.json',\r\n * proxy: new DefaultProxy('/proxy/'),\r\n * headers: {\r\n * 'X-My-Header': 'valueOfHeader'\r\n * },\r\n * queryParameters: {\r\n * 'access_token': '123-435-456-000'\r\n * },\r\n * retryCallback: refreshTokenRetryCallback,\r\n * retryAttempts: 1\r\n * });\r\n */\r\nfunction Resource(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n if (typeof options === \"string\") {\r\n options = {\r\n url: options,\r\n };\r\n }\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.string(\"options.url\", options.url);\r\n //>>includeEnd('debug');\r\n\r\n this._url = undefined;\r\n this._templateValues = defaultClone(options.templateValues, {});\r\n this._queryParameters = defaultClone(options.queryParameters, {});\r\n\r\n /**\r\n * Additional HTTP headers that will be sent with the request.\r\n *\r\n * @type {Object}\r\n */\r\n this.headers = defaultClone(options.headers, {});\r\n\r\n /**\r\n * A Request object that will be used. Intended for internal use only.\r\n *\r\n * @type {Request}\r\n */\r\n this.request = defaultValue(options.request, new Request());\r\n\r\n /**\r\n * A proxy to be used when loading the resource.\r\n *\r\n * @type {Proxy}\r\n */\r\n this.proxy = options.proxy;\r\n\r\n /**\r\n * Function to call when a request for this resource fails. If it returns true or a Promise that resolves to true, the request will be retried.\r\n *\r\n * @type {Function}\r\n */\r\n this.retryCallback = options.retryCallback;\r\n\r\n /**\r\n * The number of times the retryCallback should be called before giving up.\r\n *\r\n * @type {Number}\r\n */\r\n this.retryAttempts = defaultValue(options.retryAttempts, 0);\r\n this._retryCount = 0;\r\n\r\n const uri = new Uri(options.url);\r\n parseQuery(uri, this, true, true);\r\n\r\n // Remove the fragment as it's not sent with a request\r\n uri.fragment(\"\");\r\n\r\n this._url = uri.toString();\r\n}\r\n\r\n/**\r\n * A helper function to create a resource depending on whether we have a String or a Resource\r\n *\r\n * @param {Resource|String} resource A Resource or a String to use when creating a new Resource.\r\n *\r\n * @returns {Resource} If resource is a String, a Resource constructed with the url and options. Otherwise the resource parameter is returned.\r\n *\r\n * @private\r\n */\r\nResource.createIfNeeded = function (resource) {\r\n if (resource instanceof Resource) {\r\n // Keep existing request object. This function is used internally to duplicate a Resource, so that it can't\r\n // be modified outside of a class that holds it (eg. an imagery or terrain provider). Since the Request objects\r\n // are managed outside of the providers, by the tile loading code, we want to keep the request property the same so if it is changed\r\n // in the underlying tiling code the requests for this resource will use it.\r\n return resource.getDerivedResource({\r\n request: resource.request,\r\n });\r\n }\r\n\r\n if (typeof resource !== \"string\") {\r\n return resource;\r\n }\r\n\r\n return new Resource({\r\n url: resource,\r\n });\r\n};\r\n\r\nlet supportsImageBitmapOptionsPromise;\r\n/**\r\n * A helper function to check whether createImageBitmap supports passing ImageBitmapOptions.\r\n *\r\n * @returns {Promise} A promise that resolves to true if this browser supports creating an ImageBitmap with options.\r\n *\r\n * @private\r\n */\r\nResource.supportsImageBitmapOptions = function () {\r\n // Until the HTML folks figure out what to do about this, we need to actually try loading an image to\r\n // know if this browser supports passing options to the createImageBitmap function.\r\n // https://github.com/whatwg/html/pull/4248\r\n //\r\n // We also need to check whether the colorSpaceConversion option is supported.\r\n // We do this by loading a PNG with an embedded color profile, first with\r\n // colorSpaceConversion: \"none\" and then with colorSpaceConversion: \"default\".\r\n // If the pixel color is different then we know the option is working.\r\n // As of Webkit 17612.3.6.1.6 the createImageBitmap promise resolves but the\r\n // option is not actually supported.\r\n if (defined(supportsImageBitmapOptionsPromise)) {\r\n return supportsImageBitmapOptionsPromise;\r\n }\r\n\r\n if (typeof createImageBitmap !== \"function\") {\r\n supportsImageBitmapOptionsPromise = Promise.resolve(false);\r\n return supportsImageBitmapOptionsPromise;\r\n }\r\n\r\n const imageDataUri =\r\n \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC\";\r\n\r\n supportsImageBitmapOptionsPromise = Resource.fetchBlob({\r\n url: imageDataUri,\r\n })\r\n .then(function (blob) {\r\n const imageBitmapOptions = {\r\n imageOrientation: \"flipY\", // default is \"none\"\r\n premultiplyAlpha: \"none\", // default is \"default\"\r\n colorSpaceConversion: \"none\", // default is \"default\"\r\n };\r\n return Promise.all([\r\n createImageBitmap(blob, imageBitmapOptions),\r\n createImageBitmap(blob),\r\n ]);\r\n })\r\n .then(function (imageBitmaps) {\r\n // Check whether the colorSpaceConversion option had any effect on the green channel\r\n const colorWithOptions = getImagePixels(imageBitmaps[0]);\r\n const colorWithDefaults = getImagePixels(imageBitmaps[1]);\r\n return colorWithOptions[1] !== colorWithDefaults[1];\r\n })\r\n .catch(function () {\r\n return false;\r\n });\r\n\r\n return supportsImageBitmapOptionsPromise;\r\n};\r\n\r\nObject.defineProperties(Resource, {\r\n /**\r\n * Returns true if blobs are supported.\r\n *\r\n * @memberof Resource\r\n * @type {Boolean}\r\n *\r\n * @readonly\r\n */\r\n isBlobSupported: {\r\n get: function () {\r\n return xhrBlobSupported;\r\n },\r\n },\r\n});\r\n\r\nObject.defineProperties(Resource.prototype, {\r\n /**\r\n * Query parameters appended to the url.\r\n *\r\n * @memberof Resource.prototype\r\n * @type {Object}\r\n *\r\n * @readonly\r\n */\r\n queryParameters: {\r\n get: function () {\r\n return this._queryParameters;\r\n },\r\n },\r\n\r\n /**\r\n * The key/value pairs used to replace template parameters in the url.\r\n *\r\n * @memberof Resource.prototype\r\n * @type {Object}\r\n *\r\n * @readonly\r\n */\r\n templateValues: {\r\n get: function () {\r\n return this._templateValues;\r\n },\r\n },\r\n\r\n /**\r\n * The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.\r\n *\r\n * @memberof Resource.prototype\r\n * @type {String}\r\n */\r\n url: {\r\n get: function () {\r\n return this.getUrlComponent(true, true);\r\n },\r\n set: function (value) {\r\n const uri = new Uri(value);\r\n\r\n parseQuery(uri, this, false);\r\n\r\n // Remove the fragment as it's not sent with a request\r\n uri.fragment(\"\");\r\n\r\n this._url = uri.toString();\r\n },\r\n },\r\n\r\n /**\r\n * The file extension of the resource.\r\n *\r\n * @memberof Resource.prototype\r\n * @type {String}\r\n *\r\n * @readonly\r\n */\r\n extension: {\r\n get: function () {\r\n return getExtensionFromUri(this._url);\r\n },\r\n },\r\n\r\n /**\r\n * True if the Resource refers to a data URI.\r\n *\r\n * @memberof Resource.prototype\r\n * @type {Boolean}\r\n */\r\n isDataUri: {\r\n get: function () {\r\n return isDataUri(this._url);\r\n },\r\n },\r\n\r\n /**\r\n * True if the Resource refers to a blob URI.\r\n *\r\n * @memberof Resource.prototype\r\n * @type {Boolean}\r\n */\r\n isBlobUri: {\r\n get: function () {\r\n return isBlobUri(this._url);\r\n },\r\n },\r\n\r\n /**\r\n * True if the Resource refers to a cross origin URL.\r\n *\r\n * @memberof Resource.prototype\r\n * @type {Boolean}\r\n */\r\n isCrossOriginUrl: {\r\n get: function () {\r\n return isCrossOriginUrl(this._url);\r\n },\r\n },\r\n\r\n /**\r\n * True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.\r\n *\r\n * @memberof Resource.prototype\r\n * @type {Boolean}\r\n */\r\n hasHeaders: {\r\n get: function () {\r\n return Object.keys(this.headers).length > 0;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Override Object#toString so that implicit string conversion gives the\r\n * complete URL represented by this Resource.\r\n *\r\n * @returns {String} The URL represented by this Resource\r\n */\r\nResource.prototype.toString = function () {\r\n return this.getUrlComponent(true, true);\r\n};\r\n\r\n/**\r\n * Returns the url, optional with the query string and processed by a proxy.\r\n *\r\n * @param {Boolean} [query=false] If true, the query string is included.\r\n * @param {Boolean} [proxy=false] If true, the url is processed by the proxy object, if defined.\r\n *\r\n * @returns {String} The url with all the requested components.\r\n */\r\nResource.prototype.getUrlComponent = function (query, proxy) {\r\n if (this.isDataUri) {\r\n return this._url;\r\n }\r\n\r\n const uri = new Uri(this._url);\r\n\r\n if (query) {\r\n stringifyQuery(uri, this);\r\n }\r\n\r\n // objectToQuery escapes the placeholders. Undo that.\r\n let url = uri.toString().replace(/%7B/g, \"{\").replace(/%7D/g, \"}\");\r\n\r\n const templateValues = this._templateValues;\r\n url = url.replace(/{(.*?)}/g, function (match, key) {\r\n const replacement = templateValues[key];\r\n if (defined(replacement)) {\r\n // use the replacement value from templateValues if there is one...\r\n return encodeURIComponent(replacement);\r\n }\r\n // otherwise leave it unchanged\r\n return match;\r\n });\r\n\r\n if (proxy && defined(this.proxy)) {\r\n url = this.proxy.getURL(url);\r\n }\r\n return url;\r\n};\r\n\r\n/**\r\n * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,\r\n * as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value.\r\n *\r\n * @param {Object} params The query parameters\r\n * @param {Boolean} [useAsDefault=false] If true the params will be used as the default values, so they will only be set if they are undefined.\r\n */\r\nResource.prototype.setQueryParameters = function (params, useAsDefault) {\r\n if (useAsDefault) {\r\n this._queryParameters = combineQueryParameters(\r\n this._queryParameters,\r\n params,\r\n false\r\n );\r\n } else {\r\n this._queryParameters = combineQueryParameters(\r\n params,\r\n this._queryParameters,\r\n false\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Combines the specified object and the existing query parameters. This allows you to add many parameters at once,\r\n * as opposed to adding them one at a time to the queryParameters property.\r\n *\r\n * @param {Object} params The query parameters\r\n */\r\nResource.prototype.appendQueryParameters = function (params) {\r\n this._queryParameters = combineQueryParameters(\r\n params,\r\n this._queryParameters,\r\n true\r\n );\r\n};\r\n\r\n/**\r\n * Combines the specified object and the existing template values. This allows you to add many values at once,\r\n * as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended.\r\n *\r\n * @param {Object} template The template values\r\n * @param {Boolean} [useAsDefault=false] If true the values will be used as the default values, so they will only be set if they are undefined.\r\n */\r\nResource.prototype.setTemplateValues = function (template, useAsDefault) {\r\n if (useAsDefault) {\r\n this._templateValues = combine(this._templateValues, template);\r\n } else {\r\n this._templateValues = combine(template, this._templateValues);\r\n }\r\n};\r\n\r\n/**\r\n * Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.\r\n *\r\n * @param {Object} options An object with the following properties\r\n * @param {String} [options.url] The url that will be resolved relative to the url of the current instance.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be combined with those of the current instance.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance.\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The function to call when loading the resource fails.\r\n * @param {Number} [options.retryAttempts] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @param {Boolean} [options.preserveQueryParameters=false] If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource.\r\n *\r\n * @returns {Resource} The resource derived from the current one.\r\n */\r\nResource.prototype.getDerivedResource = function (options) {\r\n const resource = this.clone();\r\n resource._retryCount = 0;\r\n\r\n if (defined(options.url)) {\r\n const uri = new Uri(options.url);\r\n\r\n const preserveQueryParameters = defaultValue(\r\n options.preserveQueryParameters,\r\n false\r\n );\r\n parseQuery(uri, resource, true, preserveQueryParameters);\r\n\r\n // Remove the fragment as it's not sent with a request\r\n uri.fragment(\"\");\r\n\r\n if (uri.scheme() !== \"\") {\r\n resource._url = uri.toString();\r\n } else {\r\n resource._url = uri\r\n .absoluteTo(new Uri(getAbsoluteUri(this._url)))\r\n .toString();\r\n }\r\n }\r\n\r\n if (defined(options.queryParameters)) {\r\n resource._queryParameters = combine(\r\n options.queryParameters,\r\n resource._queryParameters\r\n );\r\n }\r\n if (defined(options.templateValues)) {\r\n resource._templateValues = combine(\r\n options.templateValues,\r\n resource.templateValues\r\n );\r\n }\r\n if (defined(options.headers)) {\r\n resource.headers = combine(options.headers, resource.headers);\r\n }\r\n if (defined(options.proxy)) {\r\n resource.proxy = options.proxy;\r\n }\r\n if (defined(options.request)) {\r\n resource.request = options.request;\r\n }\r\n if (defined(options.retryCallback)) {\r\n resource.retryCallback = options.retryCallback;\r\n }\r\n if (defined(options.retryAttempts)) {\r\n resource.retryAttempts = options.retryAttempts;\r\n }\r\n\r\n return resource;\r\n};\r\n\r\n/**\r\n * Called when a resource fails to load. This will call the retryCallback function if defined until retryAttempts is reached.\r\n *\r\n * @param {Error} [error] The error that was encountered.\r\n *\r\n * @returns {Promise} A promise to a boolean, that if true will cause the resource request to be retried.\r\n *\r\n * @private\r\n */\r\nResource.prototype.retryOnError = function (error) {\r\n const retryCallback = this.retryCallback;\r\n if (\r\n typeof retryCallback !== \"function\" ||\r\n this._retryCount >= this.retryAttempts\r\n ) {\r\n return Promise.resolve(false);\r\n }\r\n\r\n const that = this;\r\n return Promise.resolve(retryCallback(this, error)).then(function (result) {\r\n ++that._retryCount;\r\n\r\n return result;\r\n });\r\n};\r\n\r\n/**\r\n * Duplicates a Resource instance.\r\n *\r\n * @param {Resource} [result] The object onto which to store the result.\r\n *\r\n * @returns {Resource} The modified result parameter or a new Resource instance if one was not provided.\r\n */\r\nResource.prototype.clone = function (result) {\r\n if (!defined(result)) {\r\n result = new Resource({\r\n url: this._url,\r\n });\r\n }\r\n\r\n result._url = this._url;\r\n result._queryParameters = clone(this._queryParameters);\r\n result._templateValues = clone(this._templateValues);\r\n result.headers = clone(this.headers);\r\n result.proxy = this.proxy;\r\n result.retryCallback = this.retryCallback;\r\n result.retryAttempts = this.retryAttempts;\r\n result._retryCount = 0;\r\n result.request = this.request.clone();\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns the base path of the Resource.\r\n *\r\n * @param {Boolean} [includeQuery = false] Whether or not to include the query string and fragment form the uri\r\n *\r\n * @returns {String} The base URI of the resource\r\n */\r\nResource.prototype.getBaseUri = function (includeQuery) {\r\n return getBaseUri(this.getUrlComponent(includeQuery), includeQuery);\r\n};\r\n\r\n/**\r\n * Appends a forward slash to the URL.\r\n */\r\nResource.prototype.appendForwardSlash = function () {\r\n this._url = appendForwardSlash(this._url);\r\n};\r\n\r\n/**\r\n * Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to\r\n * an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\r\n *\r\n * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n * @example\r\n * // load a single URL asynchronously\r\n * resource.fetchArrayBuffer().then(function(arrayBuffer) {\r\n * // use the data\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.fetchArrayBuffer = function () {\r\n return this.fetch({\r\n responseType: \"arraybuffer\",\r\n });\r\n};\r\n\r\n/**\r\n * Creates a Resource and calls fetchArrayBuffer() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.fetchArrayBuffer = function (options) {\r\n const resource = new Resource(options);\r\n return resource.fetchArrayBuffer();\r\n};\r\n\r\n/**\r\n * Asynchronously loads the given resource as a blob. Returns a promise that will resolve to\r\n * a Blob once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\r\n *\r\n * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n * @example\r\n * // load a single URL asynchronously\r\n * resource.fetchBlob().then(function(blob) {\r\n * // use the data\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.fetchBlob = function () {\r\n return this.fetch({\r\n responseType: \"blob\",\r\n });\r\n};\r\n\r\n/**\r\n * Creates a Resource and calls fetchBlob() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.fetchBlob = function (options) {\r\n const resource = new Resource(options);\r\n return resource.fetchBlob();\r\n};\r\n\r\n/**\r\n * Asynchronously loads the given image resource. Returns a promise that will resolve to\r\n * an {@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap|ImageBitmap} if preferImageBitmap
is true and the browser supports createImageBitmap
or otherwise an\r\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement|Image} once loaded, or reject if the image failed to load.\r\n *\r\n * @param {Object} [options] An object with the following properties.\r\n * @param {Boolean} [options.preferBlob=false] If true, we will load the image via a blob.\r\n * @param {Boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap
is returned.\r\n * @param {Boolean} [options.flipY=false] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap
.\r\n * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap
.\r\n * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * // load a single image asynchronously\r\n * resource.fetchImage().then(function(image) {\r\n * // use the loaded image\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * // load several images in parallel\r\n * Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {\r\n * // images is an array containing all the loaded images\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.fetchImage = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const preferImageBitmap = defaultValue(options.preferImageBitmap, false);\r\n const preferBlob = defaultValue(options.preferBlob, false);\r\n const flipY = defaultValue(options.flipY, false);\r\n const skipColorSpaceConversion = defaultValue(\r\n options.skipColorSpaceConversion,\r\n false\r\n );\r\n\r\n checkAndResetRequest(this.request);\r\n // We try to load the image normally if\r\n // 1. Blobs aren't supported\r\n // 2. It's a data URI\r\n // 3. It's a blob URI\r\n // 4. It doesn't have request headers and we preferBlob is false\r\n if (\r\n !xhrBlobSupported ||\r\n this.isDataUri ||\r\n this.isBlobUri ||\r\n (!this.hasHeaders && !preferBlob)\r\n ) {\r\n return fetchImage({\r\n resource: this,\r\n flipY: flipY,\r\n skipColorSpaceConversion: skipColorSpaceConversion,\r\n preferImageBitmap: preferImageBitmap,\r\n });\r\n }\r\n\r\n const blobPromise = this.fetchBlob();\r\n if (!defined(blobPromise)) {\r\n return;\r\n }\r\n\r\n let supportsImageBitmap;\r\n let useImageBitmap;\r\n let generatedBlobResource;\r\n let generatedBlob;\r\n return Resource.supportsImageBitmapOptions()\r\n .then(function (result) {\r\n supportsImageBitmap = result;\r\n useImageBitmap = supportsImageBitmap && preferImageBitmap;\r\n return blobPromise;\r\n })\r\n .then(function (blob) {\r\n if (!defined(blob)) {\r\n return;\r\n }\r\n generatedBlob = blob;\r\n if (useImageBitmap) {\r\n return Resource.createImageBitmapFromBlob(blob, {\r\n flipY: flipY,\r\n premultiplyAlpha: false,\r\n skipColorSpaceConversion: skipColorSpaceConversion,\r\n });\r\n }\r\n const blobUrl = window.URL.createObjectURL(blob);\r\n generatedBlobResource = new Resource({\r\n url: blobUrl,\r\n });\r\n\r\n return fetchImage({\r\n resource: generatedBlobResource,\r\n flipY: flipY,\r\n skipColorSpaceConversion: skipColorSpaceConversion,\r\n preferImageBitmap: false,\r\n });\r\n })\r\n .then(function (image) {\r\n if (!defined(image)) {\r\n return;\r\n }\r\n\r\n // The blob object may be needed for use by a TileDiscardPolicy,\r\n // so attach it to the image.\r\n image.blob = generatedBlob;\r\n\r\n if (useImageBitmap) {\r\n return image;\r\n }\r\n\r\n window.URL.revokeObjectURL(generatedBlobResource.url);\r\n return image;\r\n })\r\n .catch(function (error) {\r\n if (defined(generatedBlobResource)) {\r\n window.URL.revokeObjectURL(generatedBlobResource.url);\r\n }\r\n\r\n // If the blob load succeeded but the image decode failed, attach the blob\r\n // to the error object for use by a TileDiscardPolicy.\r\n // In particular, BingMapsImageryProvider uses this to detect the\r\n // zero-length response that is returned when a tile is not available.\r\n error.blob = generatedBlob;\r\n\r\n return Promise.reject(error);\r\n });\r\n};\r\n\r\n/**\r\n * Fetches an image and returns a promise to it.\r\n *\r\n * @param {Object} [options] An object with the following properties.\r\n * @param {Resource} [options.resource] Resource object that points to an image to fetch.\r\n * @param {Boolean} [options.preferImageBitmap] If true, image will be decoded during fetch and an ImageBitmap
is returned.\r\n * @param {Boolean} [options.flipY] If true, image will be vertically flipped during decode. Only applies if the browser supports createImageBitmap
.\r\n * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports createImageBitmap
.\r\n * @private\r\n */\r\nfunction fetchImage(options) {\r\n const resource = options.resource;\r\n const flipY = options.flipY;\r\n const skipColorSpaceConversion = options.skipColorSpaceConversion;\r\n const preferImageBitmap = options.preferImageBitmap;\r\n\r\n const request = resource.request;\r\n request.url = resource.url;\r\n request.requestFunction = function () {\r\n let crossOrigin = false;\r\n\r\n // data URIs can't have crossorigin set.\r\n if (!resource.isDataUri && !resource.isBlobUri) {\r\n crossOrigin = resource.isCrossOriginUrl;\r\n }\r\n\r\n const deferred = defer();\r\n Resource._Implementations.createImage(\r\n request,\r\n crossOrigin,\r\n deferred,\r\n flipY,\r\n skipColorSpaceConversion,\r\n preferImageBitmap\r\n );\r\n\r\n return deferred.promise;\r\n };\r\n\r\n const promise = RequestScheduler.request(request);\r\n if (!defined(promise)) {\r\n return;\r\n }\r\n\r\n return promise.catch(function (e) {\r\n // Don't retry cancelled or otherwise aborted requests\r\n if (request.state !== RequestState.FAILED) {\r\n return Promise.reject(e);\r\n }\r\n return resource.retryOnError(e).then(function (retry) {\r\n if (retry) {\r\n // Reset request so it can try again\r\n request.state = RequestState.UNISSUED;\r\n request.deferred = undefined;\r\n\r\n return fetchImage({\r\n resource: resource,\r\n flipY: flipY,\r\n skipColorSpaceConversion: skipColorSpaceConversion,\r\n preferImageBitmap: preferImageBitmap,\r\n });\r\n }\r\n return Promise.reject(e);\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Creates a Resource and calls fetchImage() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Boolean} [options.flipY=false] Whether to vertically flip the image during fetch and decode. Only applies when requesting an image and the browser supports createImageBitmap
.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @param {Boolean} [options.preferBlob=false] If true, we will load the image via a blob.\r\n * @param {Boolean} [options.preferImageBitmap=false] If true, image will be decoded during fetch and an ImageBitmap
is returned.\r\n * @param {Boolean} [options.skipColorSpaceConversion=false] If true, any custom gamma or color profiles in the image will be ignored. Only applies when requesting an image and the browser supports createImageBitmap
.\r\n * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.fetchImage = function (options) {\r\n const resource = new Resource(options);\r\n return resource.fetchImage({\r\n flipY: options.flipY,\r\n skipColorSpaceConversion: options.skipColorSpaceConversion,\r\n preferBlob: options.preferBlob,\r\n preferImageBitmap: options.preferImageBitmap,\r\n });\r\n};\r\n\r\n/**\r\n * Asynchronously loads the given resource as text. Returns a promise that will resolve to\r\n * a String once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\r\n *\r\n * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n * @example\r\n * // load text from a URL, setting a custom header\r\n * const resource = new Resource({\r\n * url: 'http://someUrl.com/someJson.txt',\r\n * headers: {\r\n * 'X-Custom-Header' : 'some value'\r\n * }\r\n * });\r\n * resource.fetchText().then(function(text) {\r\n * // Do something with the text\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.fetchText = function () {\r\n return this.fetch({\r\n responseType: \"text\",\r\n });\r\n};\r\n\r\n/**\r\n * Creates a Resource and calls fetchText() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.fetchText = function (options) {\r\n const resource = new Resource(options);\r\n return resource.fetchText();\r\n};\r\n\r\n// note: */* below is */* but that ends the comment block early\r\n/**\r\n * Asynchronously loads the given resource as JSON. Returns a promise that will resolve to\r\n * a JSON object once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function\r\n * adds 'Accept: application/json,*/*;q=0.01' to the request headers, if not\r\n * already specified.\r\n *\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * resource.fetchJson().then(function(jsonData) {\r\n * // Do something with the JSON object\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.fetchJson = function () {\r\n const promise = this.fetch({\r\n responseType: \"text\",\r\n headers: {\r\n Accept: \"application/json,*/*;q=0.01\",\r\n },\r\n });\r\n\r\n if (!defined(promise)) {\r\n return undefined;\r\n }\r\n\r\n return promise.then(function (value) {\r\n if (!defined(value)) {\r\n return;\r\n }\r\n return JSON.parse(value);\r\n });\r\n};\r\n\r\n/**\r\n * Creates a Resource and calls fetchJson() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.fetchJson = function (options) {\r\n const resource = new Resource(options);\r\n return resource.fetchJson();\r\n};\r\n\r\n/**\r\n * Asynchronously loads the given resource as XML. Returns a promise that will resolve to\r\n * an XML Document once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\r\n *\r\n * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * // load XML from a URL, setting a custom header\r\n * Cesium.loadXML('http://someUrl.com/someXML.xml', {\r\n * 'X-Custom-Header' : 'some value'\r\n * }).then(function(document) {\r\n * // Do something with the document\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest|XMLHttpRequest}\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.fetchXML = function () {\r\n return this.fetch({\r\n responseType: \"document\",\r\n overrideMimeType: \"text/xml\",\r\n });\r\n};\r\n\r\n/**\r\n * Creates a Resource and calls fetchXML() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @returns {Promise.|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.fetchXML = function (options) {\r\n const resource = new Resource(options);\r\n return resource.fetchXML();\r\n};\r\n\r\n/**\r\n * Requests a resource using JSONP.\r\n *\r\n * @param {String} [callbackParameterName='callback'] The callback parameter name that the server expects.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * // load a data asynchronously\r\n * resource.fetchJsonp().then(function(data) {\r\n * // use the loaded data\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.fetchJsonp = function (callbackParameterName) {\r\n callbackParameterName = defaultValue(callbackParameterName, \"callback\");\r\n\r\n checkAndResetRequest(this.request);\r\n\r\n //generate a unique function name\r\n let functionName;\r\n do {\r\n functionName = `loadJsonp${CesiumMath.nextRandomNumber()\r\n .toString()\r\n .substring(2, 8)}`;\r\n } while (defined(window[functionName]));\r\n\r\n return fetchJsonp(this, callbackParameterName, functionName);\r\n};\r\n\r\nfunction fetchJsonp(resource, callbackParameterName, functionName) {\r\n const callbackQuery = {};\r\n callbackQuery[callbackParameterName] = functionName;\r\n resource.setQueryParameters(callbackQuery);\r\n\r\n const request = resource.request;\r\n request.url = resource.url;\r\n request.requestFunction = function () {\r\n const deferred = defer();\r\n\r\n //assign a function with that name in the global scope\r\n window[functionName] = function (data) {\r\n deferred.resolve(data);\r\n\r\n try {\r\n delete window[functionName];\r\n } catch (e) {\r\n window[functionName] = undefined;\r\n }\r\n };\r\n\r\n Resource._Implementations.loadAndExecuteScript(\r\n resource.url,\r\n functionName,\r\n deferred\r\n );\r\n return deferred.promise;\r\n };\r\n\r\n const promise = RequestScheduler.request(request);\r\n if (!defined(promise)) {\r\n return;\r\n }\r\n\r\n return promise.catch(function (e) {\r\n if (request.state !== RequestState.FAILED) {\r\n return Promise.reject(e);\r\n }\r\n\r\n return resource.retryOnError(e).then(function (retry) {\r\n if (retry) {\r\n // Reset request so it can try again\r\n request.state = RequestState.UNISSUED;\r\n request.deferred = undefined;\r\n\r\n return fetchJsonp(resource, callbackParameterName, functionName);\r\n }\r\n\r\n return Promise.reject(e);\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Creates a Resource from a URL and calls fetchJsonp() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @param {String} [options.callbackParameterName='callback'] The callback parameter name that the server expects.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.fetchJsonp = function (options) {\r\n const resource = new Resource(options);\r\n return resource.fetchJsonp(options.callbackParameterName);\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nResource.prototype._makeRequest = function (options) {\r\n const resource = this;\r\n checkAndResetRequest(resource.request);\r\n\r\n const request = resource.request;\r\n request.url = resource.url;\r\n\r\n request.requestFunction = function () {\r\n const responseType = options.responseType;\r\n const headers = combine(options.headers, resource.headers);\r\n const overrideMimeType = options.overrideMimeType;\r\n const method = options.method;\r\n const data = options.data;\r\n const deferred = defer();\r\n const xhr = Resource._Implementations.loadWithXhr(\r\n resource.url,\r\n responseType,\r\n method,\r\n data,\r\n headers,\r\n deferred,\r\n overrideMimeType\r\n );\r\n if (defined(xhr) && defined(xhr.abort)) {\r\n request.cancelFunction = function () {\r\n xhr.abort();\r\n };\r\n }\r\n return deferred.promise;\r\n };\r\n\r\n const promise = RequestScheduler.request(request);\r\n if (!defined(promise)) {\r\n return;\r\n }\r\n\r\n return promise\r\n .then(function (data) {\r\n // explicitly set to undefined to ensure GC of request response data. See #8843\r\n request.cancelFunction = undefined;\r\n return data;\r\n })\r\n .catch(function (e) {\r\n request.cancelFunction = undefined;\r\n if (request.state !== RequestState.FAILED) {\r\n return Promise.reject(e);\r\n }\r\n\r\n return resource.retryOnError(e).then(function (retry) {\r\n if (retry) {\r\n // Reset request so it can try again\r\n request.state = RequestState.UNISSUED;\r\n request.deferred = undefined;\r\n\r\n return resource.fetch(options);\r\n }\r\n\r\n return Promise.reject(e);\r\n });\r\n });\r\n};\r\n\r\nconst dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;\r\n\r\nfunction decodeDataUriText(isBase64, data) {\r\n const result = decodeURIComponent(data);\r\n if (isBase64) {\r\n return atob(result);\r\n }\r\n return result;\r\n}\r\n\r\nfunction decodeDataUriArrayBuffer(isBase64, data) {\r\n const byteString = decodeDataUriText(isBase64, data);\r\n const buffer = new ArrayBuffer(byteString.length);\r\n const view = new Uint8Array(buffer);\r\n for (let i = 0; i < byteString.length; i++) {\r\n view[i] = byteString.charCodeAt(i);\r\n }\r\n return buffer;\r\n}\r\n\r\nfunction decodeDataUri(dataUriRegexResult, responseType) {\r\n responseType = defaultValue(responseType, \"\");\r\n const mimeType = dataUriRegexResult[1];\r\n const isBase64 = !!dataUriRegexResult[2];\r\n const data = dataUriRegexResult[3];\r\n let buffer;\r\n let parser;\r\n\r\n switch (responseType) {\r\n case \"\":\r\n case \"text\":\r\n return decodeDataUriText(isBase64, data);\r\n case \"arraybuffer\":\r\n return decodeDataUriArrayBuffer(isBase64, data);\r\n case \"blob\":\r\n buffer = decodeDataUriArrayBuffer(isBase64, data);\r\n return new Blob([buffer], {\r\n type: mimeType,\r\n });\r\n case \"document\":\r\n parser = new DOMParser();\r\n return parser.parseFromString(\r\n decodeDataUriText(isBase64, data),\r\n mimeType\r\n );\r\n case \"json\":\r\n return JSON.parse(decodeDataUriText(isBase64, data));\r\n default:\r\n //>>includeStart('debug', pragmas.debug);\r\n throw new DeveloperError(`Unhandled responseType: ${responseType}`);\r\n //>>includeEnd('debug');\r\n }\r\n}\r\n\r\n/**\r\n * Asynchronously loads the given resource. Returns a promise that will resolve to\r\n * the result once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use\r\n * the more specific functions eg. fetchJson, fetchBlob, etc.\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * resource.fetch()\r\n * .then(function(body) {\r\n * // use the data\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.fetch = function (options) {\r\n options = defaultClone(options, {});\r\n options.method = \"GET\";\r\n\r\n return this._makeRequest(options);\r\n};\r\n\r\n/**\r\n * Creates a Resource from a URL and calls fetch() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.fetch = function (options) {\r\n const resource = new Resource(options);\r\n return resource.fetch({\r\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\r\n responseType: options.responseType,\r\n overrideMimeType: options.overrideMimeType,\r\n });\r\n};\r\n\r\n/**\r\n * Asynchronously deletes the given resource. Returns a promise that will resolve to\r\n * the result once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * resource.delete()\r\n * .then(function(body) {\r\n * // use the data\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.delete = function (options) {\r\n options = defaultClone(options, {});\r\n options.method = \"DELETE\";\r\n\r\n return this._makeRequest(options);\r\n};\r\n\r\n/**\r\n * Creates a Resource from a URL and calls delete() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.data] Data that is posted with the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.delete = function (options) {\r\n const resource = new Resource(options);\r\n return resource.delete({\r\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\r\n responseType: options.responseType,\r\n overrideMimeType: options.overrideMimeType,\r\n data: options.data,\r\n });\r\n};\r\n\r\n/**\r\n * Asynchronously gets headers the given resource. Returns a promise that will resolve to\r\n * the result once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * resource.head()\r\n * .then(function(headers) {\r\n * // use the data\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.head = function (options) {\r\n options = defaultClone(options, {});\r\n options.method = \"HEAD\";\r\n\r\n return this._makeRequest(options);\r\n};\r\n\r\n/**\r\n * Creates a Resource from a URL and calls head() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.head = function (options) {\r\n const resource = new Resource(options);\r\n return resource.head({\r\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\r\n responseType: options.responseType,\r\n overrideMimeType: options.overrideMimeType,\r\n });\r\n};\r\n\r\n/**\r\n * Asynchronously gets options the given resource. Returns a promise that will resolve to\r\n * the result once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * resource.options()\r\n * .then(function(headers) {\r\n * // use the data\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.options = function (options) {\r\n options = defaultClone(options, {});\r\n options.method = \"OPTIONS\";\r\n\r\n return this._makeRequest(options);\r\n};\r\n\r\n/**\r\n * Creates a Resource from a URL and calls options() on it.\r\n *\r\n * @param {String|Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.options = function (options) {\r\n const resource = new Resource(options);\r\n return resource.options({\r\n // Make copy of just the needed fields because headers can be passed to both the constructor and to fetch\r\n responseType: options.responseType,\r\n overrideMimeType: options.overrideMimeType,\r\n });\r\n};\r\n\r\n/**\r\n * Asynchronously posts data to the given resource. Returns a promise that will resolve to\r\n * the result once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\r\n *\r\n * @param {Object} data Data that is posted with the resource.\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {Object} [options.data] Data that is posted with the resource.\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * resource.post(data)\r\n * .then(function(result) {\r\n * // use the result\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.post = function (data, options) {\r\n Check.defined(\"data\", data);\r\n\r\n options = defaultClone(options, {});\r\n options.method = \"POST\";\r\n options.data = data;\r\n\r\n return this._makeRequest(options);\r\n};\r\n\r\n/**\r\n * Creates a Resource from a URL and calls post() on it.\r\n *\r\n * @param {Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} options.data Data that is posted with the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.post = function (options) {\r\n const resource = new Resource(options);\r\n return resource.post(options.data, {\r\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\r\n responseType: options.responseType,\r\n overrideMimeType: options.overrideMimeType,\r\n });\r\n};\r\n\r\n/**\r\n * Asynchronously puts data to the given resource. Returns a promise that will resolve to\r\n * the result once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\r\n *\r\n * @param {Object} data Data that is posted with the resource.\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * resource.put(data)\r\n * .then(function(result) {\r\n * // use the result\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.put = function (data, options) {\r\n Check.defined(\"data\", data);\r\n\r\n options = defaultClone(options, {});\r\n options.method = \"PUT\";\r\n options.data = data;\r\n\r\n return this._makeRequest(options);\r\n};\r\n\r\n/**\r\n * Creates a Resource from a URL and calls put() on it.\r\n *\r\n * @param {Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} options.data Data that is posted with the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.put = function (options) {\r\n const resource = new Resource(options);\r\n return resource.put(options.data, {\r\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\r\n responseType: options.responseType,\r\n overrideMimeType: options.overrideMimeType,\r\n });\r\n};\r\n\r\n/**\r\n * Asynchronously patches data to the given resource. Returns a promise that will resolve to\r\n * the result once loaded, or reject if the resource failed to load. The data is loaded\r\n * using XMLHttpRequest, which means that in order to make requests to another origin,\r\n * the server must have Cross-Origin Resource Sharing (CORS) headers enabled.\r\n *\r\n * @param {Object} data Data that is posted with the resource.\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {Object} [options.headers] Additional HTTP headers to send with the request, if any.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n *\r\n *\r\n * @example\r\n * resource.patch(data)\r\n * .then(function(result) {\r\n * // use the result\r\n * }).catch(function(error) {\r\n * // an error occurred\r\n * });\r\n *\r\n * @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}\r\n * @see {@link http://wiki.commonjs.org/wiki/Promises/A|CommonJS Promises/A}\r\n */\r\nResource.prototype.patch = function (data, options) {\r\n Check.defined(\"data\", data);\r\n\r\n options = defaultClone(options, {});\r\n options.method = \"PATCH\";\r\n options.data = data;\r\n\r\n return this._makeRequest(options);\r\n};\r\n\r\n/**\r\n * Creates a Resource from a URL and calls patch() on it.\r\n *\r\n * @param {Object} options A url or an object with the following properties\r\n * @param {String} options.url The url of the resource.\r\n * @param {Object} options.data Data that is posted with the resource.\r\n * @param {Object} [options.queryParameters] An object containing query parameters that will be sent when retrieving the resource.\r\n * @param {Object} [options.templateValues] Key/Value pairs that are used to replace template values (eg. {x}).\r\n * @param {Object} [options.headers={}] Additional HTTP headers that will be sent.\r\n * @param {Proxy} [options.proxy] A proxy to be used when loading the resource.\r\n * @param {Resource.RetryCallback} [options.retryCallback] The Function to call when a request for this resource fails. If it returns true, the request will be retried.\r\n * @param {Number} [options.retryAttempts=0] The number of times the retryCallback should be called before giving up.\r\n * @param {Request} [options.request] A Request object that will be used. Intended for internal use only.\r\n * @param {String} [options.responseType] The type of response. This controls the type of item returned.\r\n * @param {String} [options.overrideMimeType] Overrides the MIME type returned by the server.\r\n * @returns {Promise.<*>|undefined} a promise that will resolve to the requested data when loaded. Returns undefined if request.throttle
is true and the request does not have high enough priority.\r\n */\r\nResource.patch = function (options) {\r\n const resource = new Resource(options);\r\n return resource.patch(options.data, {\r\n // Make copy of just the needed fields because headers can be passed to both the constructor and to post\r\n responseType: options.responseType,\r\n overrideMimeType: options.overrideMimeType,\r\n });\r\n};\r\n\r\n/**\r\n * Contains implementations of functions that can be replaced for testing\r\n *\r\n * @private\r\n */\r\nResource._Implementations = {};\r\n\r\nResource._Implementations.loadImageElement = function (\r\n url,\r\n crossOrigin,\r\n deferred\r\n) {\r\n const image = new Image();\r\n\r\n image.onload = function () {\r\n // work-around a known issue with Firefox and dimensionless SVG, see:\r\n // - https://github.com/whatwg/html/issues/3510\r\n // - https://bugzilla.mozilla.org/show_bug.cgi?id=700533\r\n if (\r\n image.naturalWidth === 0 &&\r\n image.naturalHeight === 0 &&\r\n image.width === 0 &&\r\n image.height === 0\r\n ) {\r\n // these values affect rasterization and will likely mar the content\r\n // until Firefox takes a stance on the issue, marred content is better than no content\r\n // Chromium uses a more refined heuristic about its choice given nil viewBox, and a better stance and solution is\r\n // proposed later in the original issue thread:\r\n // - Chromium behavior: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-704400825\r\n // - Cesium's stance/solve: https://github.com/CesiumGS/cesium/issues/9188#issuecomment-720645777\r\n image.width = 300;\r\n image.height = 150;\r\n }\r\n deferred.resolve(image);\r\n };\r\n\r\n image.onerror = function (e) {\r\n deferred.reject(e);\r\n };\r\n\r\n if (crossOrigin) {\r\n if (TrustedServers.contains(url)) {\r\n image.crossOrigin = \"use-credentials\";\r\n } else {\r\n image.crossOrigin = \"\";\r\n }\r\n }\r\n\r\n image.src = url;\r\n};\r\n\r\nResource._Implementations.createImage = function (\r\n request,\r\n crossOrigin,\r\n deferred,\r\n flipY,\r\n skipColorSpaceConversion,\r\n preferImageBitmap\r\n) {\r\n const url = request.url;\r\n // Passing an Image to createImageBitmap will force it to run on the main thread\r\n // since DOM elements don't exist on workers. We convert it to a blob so it's non-blocking.\r\n // See:\r\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1044102#c38\r\n // https://bugs.chromium.org/p/chromium/issues/detail?id=580202#c10\r\n Resource.supportsImageBitmapOptions()\r\n .then(function (supportsImageBitmap) {\r\n // We can only use ImageBitmap if we can flip on decode.\r\n // See: https://github.com/CesiumGS/cesium/pull/7579#issuecomment-466146898\r\n if (!(supportsImageBitmap && preferImageBitmap)) {\r\n Resource._Implementations.loadImageElement(url, crossOrigin, deferred);\r\n return;\r\n }\r\n const responseType = \"blob\";\r\n const method = \"GET\";\r\n const xhrDeferred = defer();\r\n const xhr = Resource._Implementations.loadWithXhr(\r\n url,\r\n responseType,\r\n method,\r\n undefined,\r\n undefined,\r\n xhrDeferred,\r\n undefined,\r\n undefined,\r\n undefined\r\n );\r\n\r\n if (defined(xhr) && defined(xhr.abort)) {\r\n request.cancelFunction = function () {\r\n xhr.abort();\r\n };\r\n }\r\n return xhrDeferred.promise\r\n .then(function (blob) {\r\n if (!defined(blob)) {\r\n deferred.reject(\r\n new RuntimeError(\r\n `Successfully retrieved ${url} but it contained no content.`\r\n )\r\n );\r\n return;\r\n }\r\n\r\n return Resource.createImageBitmapFromBlob(blob, {\r\n flipY: flipY,\r\n premultiplyAlpha: false,\r\n skipColorSpaceConversion: skipColorSpaceConversion,\r\n });\r\n })\r\n .then(function (image) {\r\n deferred.resolve(image);\r\n });\r\n })\r\n .catch(function (e) {\r\n deferred.reject(e);\r\n });\r\n};\r\n\r\n/**\r\n * Wrapper for createImageBitmap\r\n *\r\n * @private\r\n */\r\nResource.createImageBitmapFromBlob = function (blob, options) {\r\n Check.defined(\"options\", options);\r\n Check.typeOf.bool(\"options.flipY\", options.flipY);\r\n Check.typeOf.bool(\"options.premultiplyAlpha\", options.premultiplyAlpha);\r\n Check.typeOf.bool(\r\n \"options.skipColorSpaceConversion\",\r\n options.skipColorSpaceConversion\r\n );\r\n\r\n return createImageBitmap(blob, {\r\n imageOrientation: options.flipY ? \"flipY\" : \"none\",\r\n premultiplyAlpha: options.premultiplyAlpha ? \"premultiply\" : \"none\",\r\n colorSpaceConversion: options.skipColorSpaceConversion ? \"none\" : \"default\",\r\n });\r\n};\r\n\r\nfunction decodeResponse(loadWithHttpResponse, responseType) {\r\n switch (responseType) {\r\n case \"text\":\r\n return loadWithHttpResponse.toString(\"utf8\");\r\n case \"json\":\r\n return JSON.parse(loadWithHttpResponse.toString(\"utf8\"));\r\n default:\r\n return new Uint8Array(loadWithHttpResponse).buffer;\r\n }\r\n}\r\n\r\nfunction loadWithHttpRequest(\r\n url,\r\n responseType,\r\n method,\r\n data,\r\n headers,\r\n deferred,\r\n overrideMimeType\r\n) {\r\n // Note: only the 'json' and 'text' responseTypes transforms the loaded buffer\r\n let URL;\r\n let zlib;\r\n Promise.all([import(\"url\"), import(\"zlib\")])\r\n .then(([urlImport, zlibImport]) => {\r\n URL = urlImport.parse(url);\r\n zlib = zlibImport;\r\n\r\n return URL.protocol === \"https:\" ? import(\"https\") : import(\"http\");\r\n })\r\n .then((http) => {\r\n const options = {\r\n protocol: URL.protocol,\r\n hostname: URL.hostname,\r\n port: URL.port,\r\n path: URL.path,\r\n query: URL.query,\r\n method: method,\r\n headers: headers,\r\n };\r\n http\r\n .request(options)\r\n .on(\"response\", function (res) {\r\n if (res.statusCode < 200 || res.statusCode >= 300) {\r\n deferred.reject(\r\n new RequestErrorEvent(res.statusCode, res, res.headers)\r\n );\r\n return;\r\n }\r\n\r\n const chunkArray = [];\r\n res.on(\"data\", function (chunk) {\r\n chunkArray.push(chunk);\r\n });\r\n\r\n res.on(\"end\", function () {\r\n // eslint-disable-next-line no-undef\r\n const result = Buffer.concat(chunkArray);\r\n if (res.headers[\"content-encoding\"] === \"gzip\") {\r\n zlib.gunzip(result, function (error, resultUnzipped) {\r\n if (error) {\r\n deferred.reject(\r\n new RuntimeError(\"Error decompressing response.\")\r\n );\r\n } else {\r\n deferred.resolve(\r\n decodeResponse(resultUnzipped, responseType)\r\n );\r\n }\r\n });\r\n } else {\r\n deferred.resolve(decodeResponse(result, responseType));\r\n }\r\n });\r\n })\r\n .on(\"error\", function (e) {\r\n deferred.reject(new RequestErrorEvent());\r\n })\r\n .end();\r\n });\r\n}\r\n\r\nconst noXMLHttpRequest = typeof XMLHttpRequest === \"undefined\";\r\nResource._Implementations.loadWithXhr = function (\r\n url,\r\n responseType,\r\n method,\r\n data,\r\n headers,\r\n deferred,\r\n overrideMimeType\r\n) {\r\n const dataUriRegexResult = dataUriRegex.exec(url);\r\n if (dataUriRegexResult !== null) {\r\n deferred.resolve(decodeDataUri(dataUriRegexResult, responseType));\r\n return;\r\n }\r\n\r\n if (noXMLHttpRequest) {\r\n loadWithHttpRequest(\r\n url,\r\n responseType,\r\n method,\r\n data,\r\n headers,\r\n deferred,\r\n overrideMimeType\r\n );\r\n return;\r\n }\r\n\r\n const xhr = new XMLHttpRequest();\r\n\r\n if (TrustedServers.contains(url)) {\r\n xhr.withCredentials = true;\r\n }\r\n\r\n xhr.open(method, url, true);\r\n\r\n if (defined(overrideMimeType) && defined(xhr.overrideMimeType)) {\r\n xhr.overrideMimeType(overrideMimeType);\r\n }\r\n\r\n if (defined(headers)) {\r\n for (const key in headers) {\r\n if (headers.hasOwnProperty(key)) {\r\n xhr.setRequestHeader(key, headers[key]);\r\n }\r\n }\r\n }\r\n\r\n if (defined(responseType)) {\r\n xhr.responseType = responseType;\r\n }\r\n\r\n // While non-standard, file protocol always returns a status of 0 on success\r\n let localFile = false;\r\n if (typeof url === \"string\") {\r\n localFile =\r\n url.indexOf(\"file://\") === 0 ||\r\n (typeof window !== \"undefined\" && window.location.origin === \"file://\");\r\n }\r\n\r\n xhr.onload = function () {\r\n if (\r\n (xhr.status < 200 || xhr.status >= 300) &&\r\n !(localFile && xhr.status === 0)\r\n ) {\r\n deferred.reject(\r\n new RequestErrorEvent(\r\n xhr.status,\r\n xhr.response,\r\n xhr.getAllResponseHeaders()\r\n )\r\n );\r\n return;\r\n }\r\n\r\n const response = xhr.response;\r\n const browserResponseType = xhr.responseType;\r\n\r\n if (method === \"HEAD\" || method === \"OPTIONS\") {\r\n const responseHeaderString = xhr.getAllResponseHeaders();\r\n const splitHeaders = responseHeaderString.trim().split(/[\\r\\n]+/);\r\n\r\n const responseHeaders = {};\r\n splitHeaders.forEach(function (line) {\r\n const parts = line.split(\": \");\r\n const header = parts.shift();\r\n responseHeaders[header] = parts.join(\": \");\r\n });\r\n\r\n deferred.resolve(responseHeaders);\r\n return;\r\n }\r\n\r\n //All modern browsers will go into either the first or second if block or last else block.\r\n //Other code paths support older browsers that either do not support the supplied responseType\r\n //or do not support the xhr.response property.\r\n if (xhr.status === 204) {\r\n // accept no content\r\n deferred.resolve();\r\n } else if (\r\n defined(response) &&\r\n (!defined(responseType) || browserResponseType === responseType)\r\n ) {\r\n deferred.resolve(response);\r\n } else if (responseType === \"json\" && typeof response === \"string\") {\r\n try {\r\n deferred.resolve(JSON.parse(response));\r\n } catch (e) {\r\n deferred.reject(e);\r\n }\r\n } else if (\r\n (browserResponseType === \"\" || browserResponseType === \"document\") &&\r\n defined(xhr.responseXML) &&\r\n xhr.responseXML.hasChildNodes()\r\n ) {\r\n deferred.resolve(xhr.responseXML);\r\n } else if (\r\n (browserResponseType === \"\" || browserResponseType === \"text\") &&\r\n defined(xhr.responseText)\r\n ) {\r\n deferred.resolve(xhr.responseText);\r\n } else {\r\n deferred.reject(\r\n new RuntimeError(\"Invalid XMLHttpRequest response type.\")\r\n );\r\n }\r\n };\r\n\r\n xhr.onerror = function (e) {\r\n deferred.reject(new RequestErrorEvent());\r\n };\r\n\r\n xhr.send(data);\r\n\r\n return xhr;\r\n};\r\n\r\nResource._Implementations.loadAndExecuteScript = function (\r\n url,\r\n functionName,\r\n deferred\r\n) {\r\n return loadAndExecuteScript(url, functionName).catch(function (e) {\r\n deferred.reject(e);\r\n });\r\n};\r\n\r\n/**\r\n * The default implementations\r\n *\r\n * @private\r\n */\r\nResource._DefaultImplementations = {};\r\nResource._DefaultImplementations.createImage =\r\n Resource._Implementations.createImage;\r\nResource._DefaultImplementations.loadWithXhr =\r\n Resource._Implementations.loadWithXhr;\r\nResource._DefaultImplementations.loadAndExecuteScript =\r\n Resource._Implementations.loadAndExecuteScript;\r\n\r\n/**\r\n * A resource instance initialized to the current browser location\r\n *\r\n * @type {Resource}\r\n * @constant\r\n */\r\nResource.DEFAULT = Object.freeze(\r\n new Resource({\r\n url:\r\n typeof document === \"undefined\"\r\n ? \"\"\r\n : document.location.href.split(\"?\")[0],\r\n })\r\n);\r\n\r\n/**\r\n * A function that returns the value of the property.\r\n * @callback Resource.RetryCallback\r\n *\r\n * @param {Resource} [resource] The resource that failed to load.\r\n * @param {Error} [error] The error that occurred during the loading of the resource.\r\n * @returns {Boolean|Promise} If true or a promise that resolved to true, the resource will be retried. Otherwise the failure will be returned.\r\n */\r\nexport default Resource;\r\n","import binarySearch from \"./binarySearch.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport EarthOrientationParametersSample from \"./EarthOrientationParametersSample.js\";\r\nimport JulianDate from \"./JulianDate.js\";\r\nimport LeapSecond from \"./LeapSecond.js\";\r\nimport Resource from \"./Resource.js\";\r\nimport RuntimeError from \"./RuntimeError.js\";\r\nimport TimeConstants from \"./TimeConstants.js\";\r\nimport TimeStandard from \"./TimeStandard.js\";\r\n\r\n/**\r\n * Specifies Earth polar motion coordinates and the difference between UT1 and UTC.\r\n * These Earth Orientation Parameters (EOP) are primarily used in the transformation from\r\n * the International Celestial Reference Frame (ICRF) to the International Terrestrial\r\n * Reference Frame (ITRF).\r\n *\r\n * @alias EarthOrientationParameters\r\n * @constructor\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {Resource|String} [options.url] The URL from which to obtain EOP data. If neither this\r\n * parameter nor options.data is specified, all EOP values are assumed\r\n * to be 0.0. If options.data is specified, this parameter is\r\n * ignored.\r\n * @param {Object} [options.data] The actual EOP data. If neither this\r\n * parameter nor options.data is specified, all EOP values are assumed\r\n * to be 0.0.\r\n * @param {Boolean} [options.addNewLeapSeconds=true] True if leap seconds that\r\n * are specified in the EOP data but not in {@link JulianDate.leapSeconds}\r\n * should be added to {@link JulianDate.leapSeconds}. False if\r\n * new leap seconds should be handled correctly in the context\r\n * of the EOP data but otherwise ignored.\r\n *\r\n * @example\r\n * // An example EOP data file, EOP.json:\r\n * {\r\n * \"columnNames\" : [\"dateIso8601\",\"modifiedJulianDateUtc\",\"xPoleWanderRadians\",\"yPoleWanderRadians\",\"ut1MinusUtcSeconds\",\"lengthOfDayCorrectionSeconds\",\"xCelestialPoleOffsetRadians\",\"yCelestialPoleOffsetRadians\",\"taiMinusUtcSeconds\"],\r\n * \"samples\" : [\r\n * \"2011-07-01T00:00:00Z\",55743.0,2.117957047295119e-7,2.111518721609984e-6,-0.2908948,-2.956e-4,3.393695767766752e-11,3.3452143996557983e-10,34.0,\r\n * \"2011-07-02T00:00:00Z\",55744.0,2.193297093339541e-7,2.115460256837405e-6,-0.29065,-1.824e-4,-8.241832578862112e-11,5.623838700870617e-10,34.0,\r\n * \"2011-07-03T00:00:00Z\",55745.0,2.262286080161428e-7,2.1191157519929706e-6,-0.2905572,1.9e-6,-3.490658503988659e-10,6.981317007977318e-10,34.0\r\n * ]\r\n * }\r\n *\r\n * @example\r\n * // Loading the EOP data\r\n * const eop = new Cesium.EarthOrientationParameters({ url : 'Data/EOP.json' });\r\n * Cesium.Transforms.earthOrientationParameters = eop;\r\n *\r\n * @private\r\n */\r\nfunction EarthOrientationParameters(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n this._dates = undefined;\r\n this._samples = undefined;\r\n\r\n this._dateColumn = -1;\r\n this._xPoleWanderRadiansColumn = -1;\r\n this._yPoleWanderRadiansColumn = -1;\r\n this._ut1MinusUtcSecondsColumn = -1;\r\n this._xCelestialPoleOffsetRadiansColumn = -1;\r\n this._yCelestialPoleOffsetRadiansColumn = -1;\r\n this._taiMinusUtcSecondsColumn = -1;\r\n\r\n this._columnCount = 0;\r\n this._lastIndex = -1;\r\n\r\n this._downloadPromise = undefined;\r\n this._dataError = undefined;\r\n\r\n this._addNewLeapSeconds = defaultValue(options.addNewLeapSeconds, true);\r\n\r\n if (defined(options.data)) {\r\n // Use supplied EOP data.\r\n onDataReady(this, options.data);\r\n } else if (defined(options.url)) {\r\n const resource = Resource.createIfNeeded(options.url);\r\n\r\n // Download EOP data.\r\n const that = this;\r\n this._downloadPromise = resource\r\n .fetchJson()\r\n .then(function (eopData) {\r\n onDataReady(that, eopData);\r\n })\r\n .catch(function () {\r\n that._dataError = `An error occurred while retrieving the EOP data from the URL ${resource.url}.`;\r\n });\r\n } else {\r\n // Use all zeros for EOP data.\r\n onDataReady(this, {\r\n columnNames: [\r\n \"dateIso8601\",\r\n \"modifiedJulianDateUtc\",\r\n \"xPoleWanderRadians\",\r\n \"yPoleWanderRadians\",\r\n \"ut1MinusUtcSeconds\",\r\n \"lengthOfDayCorrectionSeconds\",\r\n \"xCelestialPoleOffsetRadians\",\r\n \"yCelestialPoleOffsetRadians\",\r\n \"taiMinusUtcSeconds\",\r\n ],\r\n samples: [],\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * A default {@link EarthOrientationParameters} instance that returns zero for all EOP values.\r\n */\r\nEarthOrientationParameters.NONE = Object.freeze({\r\n getPromiseToLoad: function () {\r\n return Promise.resolve();\r\n },\r\n compute: function (date, result) {\r\n if (!defined(result)) {\r\n result = new EarthOrientationParametersSample(0.0, 0.0, 0.0, 0.0, 0.0);\r\n } else {\r\n result.xPoleWander = 0.0;\r\n result.yPoleWander = 0.0;\r\n result.xPoleOffset = 0.0;\r\n result.yPoleOffset = 0.0;\r\n result.ut1MinusUtc = 0.0;\r\n }\r\n return result;\r\n },\r\n});\r\n\r\n/**\r\n * Gets a promise that, when resolved, indicates that the EOP data has been loaded and is\r\n * ready to use.\r\n *\r\n * @returns {Promise} The promise.\r\n */\r\nEarthOrientationParameters.prototype.getPromiseToLoad = function () {\r\n return Promise.resolve(this._downloadPromise);\r\n};\r\n\r\n/**\r\n * Computes the Earth Orientation Parameters (EOP) for a given date by interpolating.\r\n * If the EOP data has not yet been download, this method returns undefined.\r\n *\r\n * @param {JulianDate} date The date for each to evaluate the EOP.\r\n * @param {EarthOrientationParametersSample} [result] The instance to which to copy the result.\r\n * If this parameter is undefined, a new instance is created and returned.\r\n * @returns {EarthOrientationParametersSample} The EOP evaluated at the given date, or\r\n * undefined if the data necessary to evaluate EOP at the date has not yet been\r\n * downloaded.\r\n *\r\n * @exception {RuntimeError} The loaded EOP data has an error and cannot be used.\r\n *\r\n * @see EarthOrientationParameters#getPromiseToLoad\r\n */\r\nEarthOrientationParameters.prototype.compute = function (date, result) {\r\n // We cannot compute until the samples are available.\r\n if (!defined(this._samples)) {\r\n if (defined(this._dataError)) {\r\n throw new RuntimeError(this._dataError);\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n result = new EarthOrientationParametersSample(0.0, 0.0, 0.0, 0.0, 0.0);\r\n }\r\n\r\n if (this._samples.length === 0) {\r\n result.xPoleWander = 0.0;\r\n result.yPoleWander = 0.0;\r\n result.xPoleOffset = 0.0;\r\n result.yPoleOffset = 0.0;\r\n result.ut1MinusUtc = 0.0;\r\n return result;\r\n }\r\n\r\n const dates = this._dates;\r\n const lastIndex = this._lastIndex;\r\n\r\n let before = 0;\r\n let after = 0;\r\n if (defined(lastIndex)) {\r\n const previousIndexDate = dates[lastIndex];\r\n const nextIndexDate = dates[lastIndex + 1];\r\n const isAfterPrevious = JulianDate.lessThanOrEquals(\r\n previousIndexDate,\r\n date\r\n );\r\n const isAfterLastSample = !defined(nextIndexDate);\r\n const isBeforeNext =\r\n isAfterLastSample || JulianDate.greaterThanOrEquals(nextIndexDate, date);\r\n\r\n if (isAfterPrevious && isBeforeNext) {\r\n before = lastIndex;\r\n\r\n if (!isAfterLastSample && nextIndexDate.equals(date)) {\r\n ++before;\r\n }\r\n after = before + 1;\r\n\r\n interpolate(this, dates, this._samples, date, before, after, result);\r\n return result;\r\n }\r\n }\r\n\r\n let index = binarySearch(dates, date, JulianDate.compare, this._dateColumn);\r\n if (index >= 0) {\r\n // If the next entry is the same date, use the later entry. This way, if two entries\r\n // describe the same moment, one before a leap second and the other after, then we will use\r\n // the post-leap second data.\r\n if (index < dates.length - 1 && dates[index + 1].equals(date)) {\r\n ++index;\r\n }\r\n before = index;\r\n after = index;\r\n } else {\r\n after = ~index;\r\n before = after - 1;\r\n\r\n // Use the first entry if the date requested is before the beginning of the data.\r\n if (before < 0) {\r\n before = 0;\r\n }\r\n }\r\n\r\n this._lastIndex = before;\r\n\r\n interpolate(this, dates, this._samples, date, before, after, result);\r\n return result;\r\n};\r\n\r\nfunction compareLeapSecondDates(leapSecond, dateToFind) {\r\n return JulianDate.compare(leapSecond.julianDate, dateToFind);\r\n}\r\n\r\nfunction onDataReady(eop, eopData) {\r\n if (!defined(eopData.columnNames)) {\r\n eop._dataError =\r\n \"Error in loaded EOP data: The columnNames property is required.\";\r\n return;\r\n }\r\n\r\n if (!defined(eopData.samples)) {\r\n eop._dataError =\r\n \"Error in loaded EOP data: The samples property is required.\";\r\n return;\r\n }\r\n\r\n const dateColumn = eopData.columnNames.indexOf(\"modifiedJulianDateUtc\");\r\n const xPoleWanderRadiansColumn = eopData.columnNames.indexOf(\r\n \"xPoleWanderRadians\"\r\n );\r\n const yPoleWanderRadiansColumn = eopData.columnNames.indexOf(\r\n \"yPoleWanderRadians\"\r\n );\r\n const ut1MinusUtcSecondsColumn = eopData.columnNames.indexOf(\r\n \"ut1MinusUtcSeconds\"\r\n );\r\n const xCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf(\r\n \"xCelestialPoleOffsetRadians\"\r\n );\r\n const yCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf(\r\n \"yCelestialPoleOffsetRadians\"\r\n );\r\n const taiMinusUtcSecondsColumn = eopData.columnNames.indexOf(\r\n \"taiMinusUtcSeconds\"\r\n );\r\n\r\n if (\r\n dateColumn < 0 ||\r\n xPoleWanderRadiansColumn < 0 ||\r\n yPoleWanderRadiansColumn < 0 ||\r\n ut1MinusUtcSecondsColumn < 0 ||\r\n xCelestialPoleOffsetRadiansColumn < 0 ||\r\n yCelestialPoleOffsetRadiansColumn < 0 ||\r\n taiMinusUtcSecondsColumn < 0\r\n ) {\r\n eop._dataError =\r\n \"Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns\";\r\n return;\r\n }\r\n\r\n const samples = (eop._samples = eopData.samples);\r\n const dates = (eop._dates = []);\r\n\r\n eop._dateColumn = dateColumn;\r\n eop._xPoleWanderRadiansColumn = xPoleWanderRadiansColumn;\r\n eop._yPoleWanderRadiansColumn = yPoleWanderRadiansColumn;\r\n eop._ut1MinusUtcSecondsColumn = ut1MinusUtcSecondsColumn;\r\n eop._xCelestialPoleOffsetRadiansColumn = xCelestialPoleOffsetRadiansColumn;\r\n eop._yCelestialPoleOffsetRadiansColumn = yCelestialPoleOffsetRadiansColumn;\r\n eop._taiMinusUtcSecondsColumn = taiMinusUtcSecondsColumn;\r\n\r\n eop._columnCount = eopData.columnNames.length;\r\n eop._lastIndex = undefined;\r\n\r\n let lastTaiMinusUtc;\r\n\r\n const addNewLeapSeconds = eop._addNewLeapSeconds;\r\n\r\n // Convert the ISO8601 dates to JulianDates.\r\n for (let i = 0, len = samples.length; i < len; i += eop._columnCount) {\r\n const mjd = samples[i + dateColumn];\r\n const taiMinusUtc = samples[i + taiMinusUtcSecondsColumn];\r\n const day = mjd + TimeConstants.MODIFIED_JULIAN_DATE_DIFFERENCE;\r\n const date = new JulianDate(day, taiMinusUtc, TimeStandard.TAI);\r\n dates.push(date);\r\n\r\n if (addNewLeapSeconds) {\r\n if (taiMinusUtc !== lastTaiMinusUtc && defined(lastTaiMinusUtc)) {\r\n // We crossed a leap second boundary, so add the leap second\r\n // if it does not already exist.\r\n const leapSeconds = JulianDate.leapSeconds;\r\n const leapSecondIndex = binarySearch(\r\n leapSeconds,\r\n date,\r\n compareLeapSecondDates\r\n );\r\n if (leapSecondIndex < 0) {\r\n const leapSecond = new LeapSecond(date, taiMinusUtc);\r\n leapSeconds.splice(~leapSecondIndex, 0, leapSecond);\r\n }\r\n }\r\n lastTaiMinusUtc = taiMinusUtc;\r\n }\r\n }\r\n}\r\n\r\nfunction fillResultFromIndex(eop, samples, index, columnCount, result) {\r\n const start = index * columnCount;\r\n result.xPoleWander = samples[start + eop._xPoleWanderRadiansColumn];\r\n result.yPoleWander = samples[start + eop._yPoleWanderRadiansColumn];\r\n result.xPoleOffset = samples[start + eop._xCelestialPoleOffsetRadiansColumn];\r\n result.yPoleOffset = samples[start + eop._yCelestialPoleOffsetRadiansColumn];\r\n result.ut1MinusUtc = samples[start + eop._ut1MinusUtcSecondsColumn];\r\n}\r\n\r\nfunction linearInterp(dx, y1, y2) {\r\n return y1 + dx * (y2 - y1);\r\n}\r\n\r\nfunction interpolate(eop, dates, samples, date, before, after, result) {\r\n const columnCount = eop._columnCount;\r\n\r\n // First check the bounds on the EOP data\r\n // If we are after the bounds of the data, return zeros.\r\n // The 'before' index should never be less than zero.\r\n if (after > dates.length - 1) {\r\n result.xPoleWander = 0;\r\n result.yPoleWander = 0;\r\n result.xPoleOffset = 0;\r\n result.yPoleOffset = 0;\r\n result.ut1MinusUtc = 0;\r\n return result;\r\n }\r\n\r\n const beforeDate = dates[before];\r\n const afterDate = dates[after];\r\n if (beforeDate.equals(afterDate) || date.equals(beforeDate)) {\r\n fillResultFromIndex(eop, samples, before, columnCount, result);\r\n return result;\r\n } else if (date.equals(afterDate)) {\r\n fillResultFromIndex(eop, samples, after, columnCount, result);\r\n return result;\r\n }\r\n\r\n const factor =\r\n JulianDate.secondsDifference(date, beforeDate) /\r\n JulianDate.secondsDifference(afterDate, beforeDate);\r\n\r\n const startBefore = before * columnCount;\r\n const startAfter = after * columnCount;\r\n\r\n // Handle UT1 leap second edge case\r\n let beforeUt1MinusUtc = samples[startBefore + eop._ut1MinusUtcSecondsColumn];\r\n let afterUt1MinusUtc = samples[startAfter + eop._ut1MinusUtcSecondsColumn];\r\n\r\n const offsetDifference = afterUt1MinusUtc - beforeUt1MinusUtc;\r\n if (offsetDifference > 0.5 || offsetDifference < -0.5) {\r\n // The absolute difference between the values is more than 0.5, so we may have\r\n // crossed a leap second. Check if this is the case and, if so, adjust the\r\n // afterValue to account for the leap second. This way, our interpolation will\r\n // produce reasonable results.\r\n const beforeTaiMinusUtc =\r\n samples[startBefore + eop._taiMinusUtcSecondsColumn];\r\n const afterTaiMinusUtc =\r\n samples[startAfter + eop._taiMinusUtcSecondsColumn];\r\n if (beforeTaiMinusUtc !== afterTaiMinusUtc) {\r\n if (afterDate.equals(date)) {\r\n // If we are at the end of the leap second interval, take the second value\r\n // Otherwise, the interpolation below will yield the wrong side of the\r\n // discontinuity\r\n // At the end of the leap second, we need to start accounting for the jump\r\n beforeUt1MinusUtc = afterUt1MinusUtc;\r\n } else {\r\n // Otherwise, remove the leap second so that the interpolation is correct\r\n afterUt1MinusUtc -= afterTaiMinusUtc - beforeTaiMinusUtc;\r\n }\r\n }\r\n }\r\n\r\n result.xPoleWander = linearInterp(\r\n factor,\r\n samples[startBefore + eop._xPoleWanderRadiansColumn],\r\n samples[startAfter + eop._xPoleWanderRadiansColumn]\r\n );\r\n result.yPoleWander = linearInterp(\r\n factor,\r\n samples[startBefore + eop._yPoleWanderRadiansColumn],\r\n samples[startAfter + eop._yPoleWanderRadiansColumn]\r\n );\r\n result.xPoleOffset = linearInterp(\r\n factor,\r\n samples[startBefore + eop._xCelestialPoleOffsetRadiansColumn],\r\n samples[startAfter + eop._xCelestialPoleOffsetRadiansColumn]\r\n );\r\n result.yPoleOffset = linearInterp(\r\n factor,\r\n samples[startBefore + eop._yCelestialPoleOffsetRadiansColumn],\r\n samples[startAfter + eop._yCelestialPoleOffsetRadiansColumn]\r\n );\r\n result.ut1MinusUtc = linearInterp(\r\n factor,\r\n beforeUt1MinusUtc,\r\n afterUt1MinusUtc\r\n );\r\n return result;\r\n}\r\nexport default EarthOrientationParameters;\r\n","import defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\n/**\r\n * A rotation expressed as a heading, pitch, and roll. Heading is the rotation about the\r\n * negative z axis. Pitch is the rotation about the negative y axis. Roll is the rotation about\r\n * the positive x axis.\r\n * @alias HeadingPitchRoll\r\n * @constructor\r\n *\r\n * @param {Number} [heading=0.0] The heading component in radians.\r\n * @param {Number} [pitch=0.0] The pitch component in radians.\r\n * @param {Number} [roll=0.0] The roll component in radians.\r\n */\r\nfunction HeadingPitchRoll(heading, pitch, roll) {\r\n /**\r\n * Gets or sets the heading.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.heading = defaultValue(heading, 0.0);\r\n /**\r\n * Gets or sets the pitch.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.pitch = defaultValue(pitch, 0.0);\r\n /**\r\n * Gets or sets the roll.\r\n * @type {Number}\r\n * @default 0.0\r\n */\r\n this.roll = defaultValue(roll, 0.0);\r\n}\r\n\r\n/**\r\n * Computes the heading, pitch and roll from a quaternion (see http://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles )\r\n *\r\n * @param {Quaternion} quaternion The quaternion from which to retrieve heading, pitch, and roll, all expressed in radians.\r\n * @param {HeadingPitchRoll} [result] The object in which to store the result. If not provided, a new instance is created and returned.\r\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.\r\n */\r\nHeadingPitchRoll.fromQuaternion = function (quaternion, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(quaternion)) {\r\n throw new DeveloperError(\"quaternion is required\");\r\n }\r\n //>>includeEnd('debug');\r\n if (!defined(result)) {\r\n result = new HeadingPitchRoll();\r\n }\r\n const test = 2 * (quaternion.w * quaternion.y - quaternion.z * quaternion.x);\r\n const denominatorRoll =\r\n 1 - 2 * (quaternion.x * quaternion.x + quaternion.y * quaternion.y);\r\n const numeratorRoll =\r\n 2 * (quaternion.w * quaternion.x + quaternion.y * quaternion.z);\r\n const denominatorHeading =\r\n 1 - 2 * (quaternion.y * quaternion.y + quaternion.z * quaternion.z);\r\n const numeratorHeading =\r\n 2 * (quaternion.w * quaternion.z + quaternion.x * quaternion.y);\r\n result.heading = -Math.atan2(numeratorHeading, denominatorHeading);\r\n result.roll = Math.atan2(numeratorRoll, denominatorRoll);\r\n result.pitch = -CesiumMath.asinClamped(test);\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns a new HeadingPitchRoll instance from angles given in degrees.\r\n *\r\n * @param {Number} heading the heading in degrees\r\n * @param {Number} pitch the pitch in degrees\r\n * @param {Number} roll the heading in degrees\r\n * @param {HeadingPitchRoll} [result] The object in which to store the result. If not provided, a new instance is created and returned.\r\n * @returns {HeadingPitchRoll} A new HeadingPitchRoll instance\r\n */\r\nHeadingPitchRoll.fromDegrees = function (heading, pitch, roll, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(heading)) {\r\n throw new DeveloperError(\"heading is required\");\r\n }\r\n if (!defined(pitch)) {\r\n throw new DeveloperError(\"pitch is required\");\r\n }\r\n if (!defined(roll)) {\r\n throw new DeveloperError(\"roll is required\");\r\n }\r\n //>>includeEnd('debug');\r\n if (!defined(result)) {\r\n result = new HeadingPitchRoll();\r\n }\r\n result.heading = heading * CesiumMath.RADIANS_PER_DEGREE;\r\n result.pitch = pitch * CesiumMath.RADIANS_PER_DEGREE;\r\n result.roll = roll * CesiumMath.RADIANS_PER_DEGREE;\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a HeadingPitchRoll instance.\r\n *\r\n * @param {HeadingPitchRoll} headingPitchRoll The HeadingPitchRoll to duplicate.\r\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\r\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided. (Returns undefined if headingPitchRoll is undefined)\r\n */\r\nHeadingPitchRoll.clone = function (headingPitchRoll, result) {\r\n if (!defined(headingPitchRoll)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n return new HeadingPitchRoll(\r\n headingPitchRoll.heading,\r\n headingPitchRoll.pitch,\r\n headingPitchRoll.roll\r\n );\r\n }\r\n result.heading = headingPitchRoll.heading;\r\n result.pitch = headingPitchRoll.pitch;\r\n result.roll = headingPitchRoll.roll;\r\n return result;\r\n};\r\n\r\n/**\r\n * Compares the provided HeadingPitchRolls componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\r\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\r\n * @returns {Boolean} true
if left and right are equal, false
otherwise.\r\n */\r\nHeadingPitchRoll.equals = function (left, right) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n left.heading === right.heading &&\r\n left.pitch === right.pitch &&\r\n left.roll === right.roll)\r\n );\r\n};\r\n\r\n/**\r\n * Compares the provided HeadingPitchRolls componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {HeadingPitchRoll} [left] The first HeadingPitchRoll.\r\n * @param {HeadingPitchRoll} [right] The second HeadingPitchRoll.\r\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if left and right are within the provided epsilon, false
otherwise.\r\n */\r\nHeadingPitchRoll.equalsEpsilon = function (\r\n left,\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n return (\r\n left === right ||\r\n (defined(left) &&\r\n defined(right) &&\r\n CesiumMath.equalsEpsilon(\r\n left.heading,\r\n right.heading,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n left.pitch,\r\n right.pitch,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ) &&\r\n CesiumMath.equalsEpsilon(\r\n left.roll,\r\n right.roll,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n ))\r\n );\r\n};\r\n\r\n/**\r\n * Duplicates this HeadingPitchRoll instance.\r\n *\r\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\r\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if one was not provided.\r\n */\r\nHeadingPitchRoll.prototype.clone = function (result) {\r\n return HeadingPitchRoll.clone(this, result);\r\n};\r\n\r\n/**\r\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\r\n * true
if they are equal, false
otherwise.\r\n *\r\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\r\n * @returns {Boolean} true
if they are equal, false
otherwise.\r\n */\r\nHeadingPitchRoll.prototype.equals = function (right) {\r\n return HeadingPitchRoll.equals(this, right);\r\n};\r\n\r\n/**\r\n * Compares this HeadingPitchRoll against the provided HeadingPitchRoll componentwise and returns\r\n * true
if they pass an absolute or relative tolerance test,\r\n * false
otherwise.\r\n *\r\n * @param {HeadingPitchRoll} [right] The right hand side HeadingPitchRoll.\r\n * @param {Number} [relativeEpsilon=0] The relative epsilon tolerance to use for equality testing.\r\n * @param {Number} [absoluteEpsilon=relativeEpsilon] The absolute epsilon tolerance to use for equality testing.\r\n * @returns {Boolean} true
if they are within the provided epsilon, false
otherwise.\r\n */\r\nHeadingPitchRoll.prototype.equalsEpsilon = function (\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n) {\r\n return HeadingPitchRoll.equalsEpsilon(\r\n this,\r\n right,\r\n relativeEpsilon,\r\n absoluteEpsilon\r\n );\r\n};\r\n\r\n/**\r\n * Creates a string representing this HeadingPitchRoll in the format '(heading, pitch, roll)' in radians.\r\n *\r\n * @returns {String} A string representing the provided HeadingPitchRoll in the format '(heading, pitch, roll)'.\r\n */\r\nHeadingPitchRoll.prototype.toString = function () {\r\n return `(${this.heading}, ${this.pitch}, ${this.roll})`;\r\n};\r\nexport default HeadingPitchRoll;\r\n","import defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport getAbsoluteUri from \"./getAbsoluteUri.js\";\r\nimport Resource from \"./Resource.js\";\r\n\r\n/*global CESIUM_BASE_URL,define,require*/\r\n\r\nconst cesiumScriptRegex = /((?:.*\\/)|^)Cesium\\.js(?:\\?|\\#|$)/;\r\nfunction getBaseUrlFromCesiumScript() {\r\n const scripts = document.getElementsByTagName(\"script\");\r\n for (let i = 0, len = scripts.length; i < len; ++i) {\r\n const src = scripts[i].getAttribute(\"src\");\r\n const result = cesiumScriptRegex.exec(src);\r\n if (result !== null) {\r\n return result[1];\r\n }\r\n }\r\n return undefined;\r\n}\r\n\r\nlet a;\r\nfunction tryMakeAbsolute(url) {\r\n if (typeof document === \"undefined\") {\r\n //Node.js and Web Workers. In both cases, the URL will already be absolute.\r\n return url;\r\n }\r\n\r\n if (!defined(a)) {\r\n a = document.createElement(\"a\");\r\n }\r\n a.href = url;\r\n\r\n // IE only absolutizes href on get, not set\r\n // eslint-disable-next-line no-self-assign\r\n a.href = a.href;\r\n return a.href;\r\n}\r\n\r\nlet baseResource;\r\nfunction getCesiumBaseUrl() {\r\n if (defined(baseResource)) {\r\n return baseResource;\r\n }\r\n\r\n let baseUrlString;\r\n if (typeof CESIUM_BASE_URL !== \"undefined\") {\r\n baseUrlString = CESIUM_BASE_URL;\r\n } else if (\r\n typeof define === \"object\" &&\r\n defined(define.amd) &&\r\n !define.amd.toUrlUndefined &&\r\n defined(require.toUrl)\r\n ) {\r\n baseUrlString = getAbsoluteUri(\r\n \"..\",\r\n buildModuleUrl(\"Core/buildModuleUrl.js\")\r\n );\r\n } else {\r\n baseUrlString = getBaseUrlFromCesiumScript();\r\n }\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(baseUrlString)) {\r\n throw new DeveloperError(\r\n \"Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n baseResource = new Resource({\r\n url: tryMakeAbsolute(baseUrlString),\r\n });\r\n baseResource.appendForwardSlash();\r\n\r\n return baseResource;\r\n}\r\n\r\nfunction buildModuleUrlFromRequireToUrl(moduleID) {\r\n //moduleID will be non-relative, so require it relative to this module, in Core.\r\n return tryMakeAbsolute(require.toUrl(`../${moduleID}`));\r\n}\r\n\r\nfunction buildModuleUrlFromBaseUrl(moduleID) {\r\n const resource = getCesiumBaseUrl().getDerivedResource({\r\n url: moduleID,\r\n });\r\n return resource.url;\r\n}\r\n\r\nlet implementation;\r\n\r\n/**\r\n * Given a relative URL under the Cesium base URL, returns an absolute URL.\r\n * @function\r\n *\r\n * @param {String} relativeUrl The relative path.\r\n * @returns {String} The absolutely URL representation of the provided path.\r\n *\r\n * @example\r\n * const viewer = new Cesium.Viewer(\"cesiumContainer\", {\r\n * imageryProvider: new Cesium.TileMapServiceImageryProvider({\r\n * url: Cesium.buildModuleUrl(\"Assets/Textures/NaturalEarthII\"),\r\n * }),\r\n * baseLayerPicker: false,\r\n * });\r\n */\r\nfunction buildModuleUrl(relativeUrl) {\r\n if (!defined(implementation)) {\r\n //select implementation\r\n if (\r\n typeof define === \"object\" &&\r\n defined(define.amd) &&\r\n !define.amd.toUrlUndefined &&\r\n defined(require.toUrl)\r\n ) {\r\n implementation = buildModuleUrlFromRequireToUrl;\r\n } else {\r\n implementation = buildModuleUrlFromBaseUrl;\r\n }\r\n }\r\n\r\n const url = implementation(relativeUrl);\r\n return url;\r\n}\r\n\r\n// exposed for testing\r\nbuildModuleUrl._cesiumScriptRegex = cesiumScriptRegex;\r\nbuildModuleUrl._buildModuleUrlFromBaseUrl = buildModuleUrlFromBaseUrl;\r\nbuildModuleUrl._clearBaseResource = function () {\r\n baseResource = undefined;\r\n};\r\n\r\n/**\r\n * Sets the base URL for resolving modules.\r\n * @param {String} value The new base URL.\r\n */\r\nbuildModuleUrl.setBaseUrl = function (value) {\r\n baseResource = Resource.DEFAULT.getDerivedResource({\r\n url: value,\r\n });\r\n};\r\n\r\n/**\r\n * Gets the base URL for resolving modules.\r\n *\r\n * @function\r\n * @returns {String} The configured base URL\r\n */\r\nbuildModuleUrl.getCesiumBaseUrl = getCesiumBaseUrl;\r\n\r\nexport default buildModuleUrl;\r\n","/**\r\n * An IAU 2006 XYS value sampled at a particular time.\r\n *\r\n * @alias Iau2006XysSample\r\n * @constructor\r\n *\r\n * @param {Number} x The X value.\r\n * @param {Number} y The Y value.\r\n * @param {Number} s The S value.\r\n *\r\n * @private\r\n */\r\nfunction Iau2006XysSample(x, y, s) {\r\n /**\r\n * The X value.\r\n * @type {Number}\r\n */\r\n this.x = x;\r\n\r\n /**\r\n * The Y value.\r\n * @type {Number}\r\n */\r\n this.y = y;\r\n\r\n /**\r\n * The S value.\r\n * @type {Number}\r\n */\r\n this.s = s;\r\n}\r\nexport default Iau2006XysSample;\r\n","import buildModuleUrl from \"./buildModuleUrl.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Iau2006XysSample from \"./Iau2006XysSample.js\";\r\nimport JulianDate from \"./JulianDate.js\";\r\nimport Resource from \"./Resource.js\";\r\nimport TimeStandard from \"./TimeStandard.js\";\r\n\r\n/**\r\n * A set of IAU2006 XYS data that is used to evaluate the transformation between the International\r\n * Celestial Reference Frame (ICRF) and the International Terrestrial Reference Frame (ITRF).\r\n *\r\n * @alias Iau2006XysData\r\n * @constructor\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {Resource|String} [options.xysFileUrlTemplate='Assets/IAU2006_XYS/IAU2006_XYS_{0}.json'] A template URL for obtaining the XYS data. In the template,\r\n * `{0}` will be replaced with the file index.\r\n * @param {Number} [options.interpolationOrder=9] The order of interpolation to perform on the XYS data.\r\n * @param {Number} [options.sampleZeroJulianEphemerisDate=2442396.5] The Julian ephemeris date (JED) of the\r\n * first XYS sample.\r\n * @param {Number} [options.stepSizeDays=1.0] The step size, in days, between successive XYS samples.\r\n * @param {Number} [options.samplesPerXysFile=1000] The number of samples in each XYS file.\r\n * @param {Number} [options.totalSamples=27426] The total number of samples in all XYS files.\r\n *\r\n * @private\r\n */\r\nfunction Iau2006XysData(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n this._xysFileUrlTemplate = Resource.createIfNeeded(\r\n options.xysFileUrlTemplate\r\n );\r\n this._interpolationOrder = defaultValue(options.interpolationOrder, 9);\r\n this._sampleZeroJulianEphemerisDate = defaultValue(\r\n options.sampleZeroJulianEphemerisDate,\r\n 2442396.5\r\n );\r\n this._sampleZeroDateTT = new JulianDate(\r\n this._sampleZeroJulianEphemerisDate,\r\n 0.0,\r\n TimeStandard.TAI\r\n );\r\n this._stepSizeDays = defaultValue(options.stepSizeDays, 1.0);\r\n this._samplesPerXysFile = defaultValue(options.samplesPerXysFile, 1000);\r\n this._totalSamples = defaultValue(options.totalSamples, 27426);\r\n this._samples = new Array(this._totalSamples * 3);\r\n this._chunkDownloadsInProgress = [];\r\n\r\n const order = this._interpolationOrder;\r\n\r\n // Compute denominators and X values for interpolation.\r\n const denom = (this._denominators = new Array(order + 1));\r\n const xTable = (this._xTable = new Array(order + 1));\r\n\r\n const stepN = Math.pow(this._stepSizeDays, order);\r\n\r\n for (let i = 0; i <= order; ++i) {\r\n denom[i] = stepN;\r\n xTable[i] = i * this._stepSizeDays;\r\n\r\n for (let j = 0; j <= order; ++j) {\r\n if (j !== i) {\r\n denom[i] *= i - j;\r\n }\r\n }\r\n\r\n denom[i] = 1.0 / denom[i];\r\n }\r\n\r\n // Allocate scratch arrays for interpolation.\r\n this._work = new Array(order + 1);\r\n this._coef = new Array(order + 1);\r\n}\r\n\r\nconst julianDateScratch = new JulianDate(0, 0.0, TimeStandard.TAI);\r\n\r\nfunction getDaysSinceEpoch(xys, dayTT, secondTT) {\r\n const dateTT = julianDateScratch;\r\n dateTT.dayNumber = dayTT;\r\n dateTT.secondsOfDay = secondTT;\r\n return JulianDate.daysDifference(dateTT, xys._sampleZeroDateTT);\r\n}\r\n\r\n/**\r\n * Preloads XYS data for a specified date range.\r\n *\r\n * @param {Number} startDayTT The Julian day number of the beginning of the interval to preload, expressed in\r\n * the Terrestrial Time (TT) time standard.\r\n * @param {Number} startSecondTT The seconds past noon of the beginning of the interval to preload, expressed in\r\n * the Terrestrial Time (TT) time standard.\r\n * @param {Number} stopDayTT The Julian day number of the end of the interval to preload, expressed in\r\n * the Terrestrial Time (TT) time standard.\r\n * @param {Number} stopSecondTT The seconds past noon of the end of the interval to preload, expressed in\r\n * the Terrestrial Time (TT) time standard.\r\n * @returns {Promise} A promise that, when resolved, indicates that the requested interval has been\r\n * preloaded.\r\n */\r\nIau2006XysData.prototype.preload = function (\r\n startDayTT,\r\n startSecondTT,\r\n stopDayTT,\r\n stopSecondTT\r\n) {\r\n const startDaysSinceEpoch = getDaysSinceEpoch(\r\n this,\r\n startDayTT,\r\n startSecondTT\r\n );\r\n const stopDaysSinceEpoch = getDaysSinceEpoch(this, stopDayTT, stopSecondTT);\r\n\r\n let startIndex =\r\n (startDaysSinceEpoch / this._stepSizeDays - this._interpolationOrder / 2) |\r\n 0;\r\n if (startIndex < 0) {\r\n startIndex = 0;\r\n }\r\n\r\n let stopIndex =\r\n (stopDaysSinceEpoch / this._stepSizeDays - this._interpolationOrder / 2) |\r\n (0 + this._interpolationOrder);\r\n if (stopIndex >= this._totalSamples) {\r\n stopIndex = this._totalSamples - 1;\r\n }\r\n\r\n const startChunk = (startIndex / this._samplesPerXysFile) | 0;\r\n const stopChunk = (stopIndex / this._samplesPerXysFile) | 0;\r\n\r\n const promises = [];\r\n for (let i = startChunk; i <= stopChunk; ++i) {\r\n promises.push(requestXysChunk(this, i));\r\n }\r\n\r\n return Promise.all(promises);\r\n};\r\n\r\n/**\r\n * Computes the XYS values for a given date by interpolating. If the required data is not yet downloaded,\r\n * this method will return undefined.\r\n *\r\n * @param {Number} dayTT The Julian day number for which to compute the XYS value, expressed in\r\n * the Terrestrial Time (TT) time standard.\r\n * @param {Number} secondTT The seconds past noon of the date for which to compute the XYS value, expressed in\r\n * the Terrestrial Time (TT) time standard.\r\n * @param {Iau2006XysSample} [result] The instance to which to copy the interpolated result. If this parameter\r\n * is undefined, a new instance is allocated and returned.\r\n * @returns {Iau2006XysSample} The interpolated XYS values, or undefined if the required data for this\r\n * computation has not yet been downloaded.\r\n *\r\n * @see Iau2006XysData#preload\r\n */\r\nIau2006XysData.prototype.computeXysRadians = function (\r\n dayTT,\r\n secondTT,\r\n result\r\n) {\r\n const daysSinceEpoch = getDaysSinceEpoch(this, dayTT, secondTT);\r\n if (daysSinceEpoch < 0.0) {\r\n // Can't evaluate prior to the epoch of the data.\r\n return undefined;\r\n }\r\n\r\n const centerIndex = (daysSinceEpoch / this._stepSizeDays) | 0;\r\n if (centerIndex >= this._totalSamples) {\r\n // Can't evaluate after the last sample in the data.\r\n return undefined;\r\n }\r\n\r\n const degree = this._interpolationOrder;\r\n\r\n let firstIndex = centerIndex - ((degree / 2) | 0);\r\n if (firstIndex < 0) {\r\n firstIndex = 0;\r\n }\r\n let lastIndex = firstIndex + degree;\r\n if (lastIndex >= this._totalSamples) {\r\n lastIndex = this._totalSamples - 1;\r\n firstIndex = lastIndex - degree;\r\n if (firstIndex < 0) {\r\n firstIndex = 0;\r\n }\r\n }\r\n\r\n // Are all the samples we need present?\r\n // We can assume so if the first and last are present\r\n let isDataMissing = false;\r\n const samples = this._samples;\r\n if (!defined(samples[firstIndex * 3])) {\r\n requestXysChunk(this, (firstIndex / this._samplesPerXysFile) | 0);\r\n isDataMissing = true;\r\n }\r\n\r\n if (!defined(samples[lastIndex * 3])) {\r\n requestXysChunk(this, (lastIndex / this._samplesPerXysFile) | 0);\r\n isDataMissing = true;\r\n }\r\n\r\n if (isDataMissing) {\r\n return undefined;\r\n }\r\n\r\n if (!defined(result)) {\r\n result = new Iau2006XysSample(0.0, 0.0, 0.0);\r\n } else {\r\n result.x = 0.0;\r\n result.y = 0.0;\r\n result.s = 0.0;\r\n }\r\n\r\n const x = daysSinceEpoch - firstIndex * this._stepSizeDays;\r\n\r\n const work = this._work;\r\n const denom = this._denominators;\r\n const coef = this._coef;\r\n const xTable = this._xTable;\r\n\r\n let i, j;\r\n for (i = 0; i <= degree; ++i) {\r\n work[i] = x - xTable[i];\r\n }\r\n\r\n for (i = 0; i <= degree; ++i) {\r\n coef[i] = 1.0;\r\n\r\n for (j = 0; j <= degree; ++j) {\r\n if (j !== i) {\r\n coef[i] *= work[j];\r\n }\r\n }\r\n\r\n coef[i] *= denom[i];\r\n\r\n let sampleIndex = (firstIndex + i) * 3;\r\n result.x += coef[i] * samples[sampleIndex++];\r\n result.y += coef[i] * samples[sampleIndex++];\r\n result.s += coef[i] * samples[sampleIndex];\r\n }\r\n\r\n return result;\r\n};\r\n\r\nfunction requestXysChunk(xysData, chunkIndex) {\r\n if (xysData._chunkDownloadsInProgress[chunkIndex]) {\r\n // Chunk has already been requested.\r\n return xysData._chunkDownloadsInProgress[chunkIndex];\r\n }\r\n\r\n let chunkUrl;\r\n const xysFileUrlTemplate = xysData._xysFileUrlTemplate;\r\n if (defined(xysFileUrlTemplate)) {\r\n chunkUrl = xysFileUrlTemplate.getDerivedResource({\r\n templateValues: {\r\n 0: chunkIndex,\r\n },\r\n });\r\n } else {\r\n chunkUrl = new Resource({\r\n url: buildModuleUrl(`Assets/IAU2006_XYS/IAU2006_XYS_${chunkIndex}.json`),\r\n });\r\n }\r\n\r\n const promise = chunkUrl.fetchJson().then(function (chunk) {\r\n xysData._chunkDownloadsInProgress[chunkIndex] = false;\r\n\r\n const samples = xysData._samples;\r\n const newSamples = chunk.samples;\r\n const startIndex = chunkIndex * xysData._samplesPerXysFile * 3;\r\n\r\n for (let i = 0, len = newSamples.length; i < len; ++i) {\r\n samples[startIndex + i] = newSamples[i];\r\n }\r\n });\r\n xysData._chunkDownloadsInProgress[chunkIndex] = promise;\r\n\r\n return promise;\r\n}\r\nexport default Iau2006XysData;\r\n","import Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartesian4 from \"./Cartesian4.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport EarthOrientationParameters from \"./EarthOrientationParameters.js\";\r\nimport EarthOrientationParametersSample from \"./EarthOrientationParametersSample.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport HeadingPitchRoll from \"./HeadingPitchRoll.js\";\r\nimport Iau2006XysData from \"./Iau2006XysData.js\";\r\nimport Iau2006XysSample from \"./Iau2006XysSample.js\";\r\nimport JulianDate from \"./JulianDate.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\nimport TimeConstants from \"./TimeConstants.js\";\r\n\r\n/**\r\n * Contains functions for transforming positions to various reference frames.\r\n *\r\n * @namespace Transforms\r\n */\r\nconst Transforms = {};\r\n\r\nconst vectorProductLocalFrame = {\r\n up: {\r\n south: \"east\",\r\n north: \"west\",\r\n west: \"south\",\r\n east: \"north\",\r\n },\r\n down: {\r\n south: \"west\",\r\n north: \"east\",\r\n west: \"north\",\r\n east: \"south\",\r\n },\r\n south: {\r\n up: \"west\",\r\n down: \"east\",\r\n west: \"down\",\r\n east: \"up\",\r\n },\r\n north: {\r\n up: \"east\",\r\n down: \"west\",\r\n west: \"up\",\r\n east: \"down\",\r\n },\r\n west: {\r\n up: \"north\",\r\n down: \"south\",\r\n north: \"down\",\r\n south: \"up\",\r\n },\r\n east: {\r\n up: \"south\",\r\n down: \"north\",\r\n north: \"up\",\r\n south: \"down\",\r\n },\r\n};\r\n\r\nconst degeneratePositionLocalFrame = {\r\n north: [-1, 0, 0],\r\n east: [0, 1, 0],\r\n up: [0, 0, 1],\r\n south: [1, 0, 0],\r\n west: [0, -1, 0],\r\n down: [0, 0, -1],\r\n};\r\n\r\nconst localFrameToFixedFrameCache = {};\r\n\r\nconst scratchCalculateCartesian = {\r\n east: new Cartesian3(),\r\n north: new Cartesian3(),\r\n up: new Cartesian3(),\r\n west: new Cartesian3(),\r\n south: new Cartesian3(),\r\n down: new Cartesian3(),\r\n};\r\nlet scratchFirstCartesian = new Cartesian3();\r\nlet scratchSecondCartesian = new Cartesian3();\r\nlet scratchThirdCartesian = new Cartesian3();\r\n/**\r\n * Generates a function that computes a 4x4 transformation matrix from a reference frame\r\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\r\n * @param {String} firstAxis name of the first axis of the local reference frame. Must be\r\n * 'east', 'north', 'up', 'west', 'south' or 'down'.\r\n * @param {String} secondAxis name of the second axis of the local reference frame. Must be\r\n * 'east', 'north', 'up', 'west', 'south' or 'down'.\r\n * @return {Transforms.LocalFrameToFixedFrame} The function that will computes a\r\n * 4x4 transformation matrix from a reference frame, with first axis and second axis compliant with the parameters,\r\n */\r\nTransforms.localFrameToFixedFrameGenerator = function (firstAxis, secondAxis) {\r\n if (\r\n !vectorProductLocalFrame.hasOwnProperty(firstAxis) ||\r\n !vectorProductLocalFrame[firstAxis].hasOwnProperty(secondAxis)\r\n ) {\r\n throw new DeveloperError(\r\n \"firstAxis and secondAxis must be east, north, up, west, south or down.\"\r\n );\r\n }\r\n const thirdAxis = vectorProductLocalFrame[firstAxis][secondAxis];\r\n\r\n /**\r\n * Computes a 4x4 transformation matrix from a reference frame\r\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\r\n * @callback Transforms.LocalFrameToFixedFrame\r\n * @param {Cartesian3} origin The center point of the local reference frame.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\r\n * @param {Matrix4} [result] The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\r\n */\r\n let resultat;\r\n const hashAxis = firstAxis + secondAxis;\r\n if (defined(localFrameToFixedFrameCache[hashAxis])) {\r\n resultat = localFrameToFixedFrameCache[hashAxis];\r\n } else {\r\n resultat = function (origin, ellipsoid, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(origin)) {\r\n throw new DeveloperError(\"origin is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n if (!defined(result)) {\r\n result = new Matrix4();\r\n }\r\n if (\r\n Cartesian3.equalsEpsilon(origin, Cartesian3.ZERO, CesiumMath.EPSILON14)\r\n ) {\r\n // If x, y, and z are zero, use the degenerate local frame, which is a special case\r\n Cartesian3.unpack(\r\n degeneratePositionLocalFrame[firstAxis],\r\n 0,\r\n scratchFirstCartesian\r\n );\r\n Cartesian3.unpack(\r\n degeneratePositionLocalFrame[secondAxis],\r\n 0,\r\n scratchSecondCartesian\r\n );\r\n Cartesian3.unpack(\r\n degeneratePositionLocalFrame[thirdAxis],\r\n 0,\r\n scratchThirdCartesian\r\n );\r\n } else if (\r\n CesiumMath.equalsEpsilon(origin.x, 0.0, CesiumMath.EPSILON14) &&\r\n CesiumMath.equalsEpsilon(origin.y, 0.0, CesiumMath.EPSILON14)\r\n ) {\r\n // If x and y are zero, assume origin is at a pole, which is a special case.\r\n const sign = CesiumMath.sign(origin.z);\r\n\r\n Cartesian3.unpack(\r\n degeneratePositionLocalFrame[firstAxis],\r\n 0,\r\n scratchFirstCartesian\r\n );\r\n if (firstAxis !== \"east\" && firstAxis !== \"west\") {\r\n Cartesian3.multiplyByScalar(\r\n scratchFirstCartesian,\r\n sign,\r\n scratchFirstCartesian\r\n );\r\n }\r\n\r\n Cartesian3.unpack(\r\n degeneratePositionLocalFrame[secondAxis],\r\n 0,\r\n scratchSecondCartesian\r\n );\r\n if (secondAxis !== \"east\" && secondAxis !== \"west\") {\r\n Cartesian3.multiplyByScalar(\r\n scratchSecondCartesian,\r\n sign,\r\n scratchSecondCartesian\r\n );\r\n }\r\n\r\n Cartesian3.unpack(\r\n degeneratePositionLocalFrame[thirdAxis],\r\n 0,\r\n scratchThirdCartesian\r\n );\r\n if (thirdAxis !== \"east\" && thirdAxis !== \"west\") {\r\n Cartesian3.multiplyByScalar(\r\n scratchThirdCartesian,\r\n sign,\r\n scratchThirdCartesian\r\n );\r\n }\r\n } else {\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n ellipsoid.geodeticSurfaceNormal(origin, scratchCalculateCartesian.up);\r\n\r\n const up = scratchCalculateCartesian.up;\r\n const east = scratchCalculateCartesian.east;\r\n east.x = -origin.y;\r\n east.y = origin.x;\r\n east.z = 0.0;\r\n Cartesian3.normalize(east, scratchCalculateCartesian.east);\r\n Cartesian3.cross(up, east, scratchCalculateCartesian.north);\r\n\r\n Cartesian3.multiplyByScalar(\r\n scratchCalculateCartesian.up,\r\n -1,\r\n scratchCalculateCartesian.down\r\n );\r\n Cartesian3.multiplyByScalar(\r\n scratchCalculateCartesian.east,\r\n -1,\r\n scratchCalculateCartesian.west\r\n );\r\n Cartesian3.multiplyByScalar(\r\n scratchCalculateCartesian.north,\r\n -1,\r\n scratchCalculateCartesian.south\r\n );\r\n\r\n scratchFirstCartesian = scratchCalculateCartesian[firstAxis];\r\n scratchSecondCartesian = scratchCalculateCartesian[secondAxis];\r\n scratchThirdCartesian = scratchCalculateCartesian[thirdAxis];\r\n }\r\n result[0] = scratchFirstCartesian.x;\r\n result[1] = scratchFirstCartesian.y;\r\n result[2] = scratchFirstCartesian.z;\r\n result[3] = 0.0;\r\n result[4] = scratchSecondCartesian.x;\r\n result[5] = scratchSecondCartesian.y;\r\n result[6] = scratchSecondCartesian.z;\r\n result[7] = 0.0;\r\n result[8] = scratchThirdCartesian.x;\r\n result[9] = scratchThirdCartesian.y;\r\n result[10] = scratchThirdCartesian.z;\r\n result[11] = 0.0;\r\n result[12] = origin.x;\r\n result[13] = origin.y;\r\n result[14] = origin.z;\r\n result[15] = 1.0;\r\n return result;\r\n };\r\n localFrameToFixedFrameCache[hashAxis] = resultat;\r\n }\r\n return resultat;\r\n};\r\n\r\n/**\r\n * Computes a 4x4 transformation matrix from a reference frame with an east-north-up axes\r\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\r\n * The local axes are defined as:\r\n * \r\n * - The
x
axis points in the local east direction. \r\n * - The
y
axis points in the local north direction. \r\n * - The
z
axis points in the direction of the ellipsoid surface normal which passes through the position. \r\n *
\r\n *\r\n * @function\r\n * @param {Cartesian3} origin The center point of the local reference frame.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\r\n * @param {Matrix4} [result] The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\r\n *\r\n * @example\r\n * // Get the transform from local east-north-up at cartographic (0.0, 0.0) to Earth's fixed frame.\r\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\r\n * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(center);\r\n */\r\nTransforms.eastNorthUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\r\n \"east\",\r\n \"north\"\r\n);\r\n\r\n/**\r\n * Computes a 4x4 transformation matrix from a reference frame with an north-east-down axes\r\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\r\n * The local axes are defined as:\r\n * \r\n * - The
x
axis points in the local north direction. \r\n * - The
y
axis points in the local east direction. \r\n * - The
z
axis points in the opposite direction of the ellipsoid surface normal which passes through the position. \r\n *
\r\n *\r\n * @function\r\n * @param {Cartesian3} origin The center point of the local reference frame.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\r\n * @param {Matrix4} [result] The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\r\n *\r\n * @example\r\n * // Get the transform from local north-east-down at cartographic (0.0, 0.0) to Earth's fixed frame.\r\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\r\n * const transform = Cesium.Transforms.northEastDownToFixedFrame(center);\r\n */\r\nTransforms.northEastDownToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\r\n \"north\",\r\n \"east\"\r\n);\r\n\r\n/**\r\n * Computes a 4x4 transformation matrix from a reference frame with an north-up-east axes\r\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\r\n * The local axes are defined as:\r\n * \r\n * - The
x
axis points in the local north direction. \r\n * - The
y
axis points in the direction of the ellipsoid surface normal which passes through the position. \r\n * - The
z
axis points in the local east direction. \r\n *
\r\n *\r\n * @function\r\n * @param {Cartesian3} origin The center point of the local reference frame.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\r\n * @param {Matrix4} [result] The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\r\n *\r\n * @example\r\n * // Get the transform from local north-up-east at cartographic (0.0, 0.0) to Earth's fixed frame.\r\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\r\n * const transform = Cesium.Transforms.northUpEastToFixedFrame(center);\r\n */\r\nTransforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\r\n \"north\",\r\n \"up\"\r\n);\r\n\r\n/**\r\n * Computes a 4x4 transformation matrix from a reference frame with an north-west-up axes\r\n * centered at the provided origin to the provided ellipsoid's fixed reference frame.\r\n * The local axes are defined as:\r\n * \r\n * - The
x
axis points in the local north direction. \r\n * - The
y
axis points in the local west direction. \r\n * - The
z
axis points in the direction of the ellipsoid surface normal which passes through the position. \r\n *
\r\n *\r\n * @function\r\n * @param {Cartesian3} origin The center point of the local reference frame.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\r\n * @param {Matrix4} [result] The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\r\n *\r\n * @example\r\n * // Get the transform from local north-West-Up at cartographic (0.0, 0.0) to Earth's fixed frame.\r\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\r\n * const transform = Cesium.Transforms.northWestUpToFixedFrame(center);\r\n */\r\nTransforms.northWestUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator(\r\n \"north\",\r\n \"west\"\r\n);\r\n\r\nconst scratchHPRQuaternion = new Quaternion();\r\nconst scratchScale = new Cartesian3(1.0, 1.0, 1.0);\r\nconst scratchHPRMatrix4 = new Matrix4();\r\n\r\n/**\r\n * Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles\r\n * centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local north\r\n * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles\r\n * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.\r\n *\r\n * @param {Cartesian3} origin The center point of the local reference frame.\r\n * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\r\n * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation\r\n * matrix from a reference frame to the provided ellipsoid's fixed reference frame\r\n * @param {Matrix4} [result] The object onto which to store the result.\r\n * @returns {Matrix4} The modified result parameter or a new Matrix4 instance if none was provided.\r\n *\r\n * @example\r\n * // Get the transform from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.\r\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\r\n * const heading = -Cesium.Math.PI_OVER_TWO;\r\n * const pitch = Cesium.Math.PI_OVER_FOUR;\r\n * const roll = 0.0;\r\n * const hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);\r\n * const transform = Cesium.Transforms.headingPitchRollToFixedFrame(center, hpr);\r\n */\r\nTransforms.headingPitchRollToFixedFrame = function (\r\n origin,\r\n headingPitchRoll,\r\n ellipsoid,\r\n fixedFrameTransform,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"HeadingPitchRoll\", headingPitchRoll);\r\n //>>includeEnd('debug');\r\n\r\n fixedFrameTransform = defaultValue(\r\n fixedFrameTransform,\r\n Transforms.eastNorthUpToFixedFrame\r\n );\r\n const hprQuaternion = Quaternion.fromHeadingPitchRoll(\r\n headingPitchRoll,\r\n scratchHPRQuaternion\r\n );\r\n const hprMatrix = Matrix4.fromTranslationQuaternionRotationScale(\r\n Cartesian3.ZERO,\r\n hprQuaternion,\r\n scratchScale,\r\n scratchHPRMatrix4\r\n );\r\n result = fixedFrameTransform(origin, ellipsoid, result);\r\n return Matrix4.multiply(result, hprMatrix, result);\r\n};\r\n\r\nconst scratchENUMatrix4 = new Matrix4();\r\nconst scratchHPRMatrix3 = new Matrix3();\r\n\r\n/**\r\n * Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles\r\n * centered at the provided origin. Heading is the rotation from the local north\r\n * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles\r\n * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.\r\n *\r\n * @param {Cartesian3} origin The center point of the local reference frame.\r\n * @param {HeadingPitchRoll} headingPitchRoll The heading, pitch, and roll.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\r\n * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation\r\n * matrix from a reference frame to the provided ellipsoid's fixed reference frame\r\n * @param {Quaternion} [result] The object onto which to store the result.\r\n * @returns {Quaternion} The modified result parameter or a new Quaternion instance if none was provided.\r\n *\r\n * @example\r\n * // Get the quaternion from local heading-pitch-roll at cartographic (0.0, 0.0) to Earth's fixed frame.\r\n * const center = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\r\n * const heading = -Cesium.Math.PI_OVER_TWO;\r\n * const pitch = Cesium.Math.PI_OVER_FOUR;\r\n * const roll = 0.0;\r\n * const hpr = new HeadingPitchRoll(heading, pitch, roll);\r\n * const quaternion = Cesium.Transforms.headingPitchRollQuaternion(center, hpr);\r\n */\r\nTransforms.headingPitchRollQuaternion = function (\r\n origin,\r\n headingPitchRoll,\r\n ellipsoid,\r\n fixedFrameTransform,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"HeadingPitchRoll\", headingPitchRoll);\r\n //>>includeEnd('debug');\r\n\r\n const transform = Transforms.headingPitchRollToFixedFrame(\r\n origin,\r\n headingPitchRoll,\r\n ellipsoid,\r\n fixedFrameTransform,\r\n scratchENUMatrix4\r\n );\r\n const rotation = Matrix4.getMatrix3(transform, scratchHPRMatrix3);\r\n return Quaternion.fromRotationMatrix(rotation, result);\r\n};\r\n\r\nconst noScale = new Cartesian3(1.0, 1.0, 1.0);\r\nconst hprCenterScratch = new Cartesian3();\r\nconst ffScratch = new Matrix4();\r\nconst hprTransformScratch = new Matrix4();\r\nconst hprRotationScratch = new Matrix3();\r\nconst hprQuaternionScratch = new Quaternion();\r\n/**\r\n * Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local north\r\n * direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles\r\n * are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.\r\n *\r\n * @param {Matrix4} transform The transform\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\r\n * @param {Transforms.LocalFrameToFixedFrame} [fixedFrameTransform=Transforms.eastNorthUpToFixedFrame] A 4x4 transformation\r\n * matrix from a reference frame to the provided ellipsoid's fixed reference frame\r\n * @param {HeadingPitchRoll} [result] The object onto which to store the result.\r\n * @returns {HeadingPitchRoll} The modified result parameter or a new HeadingPitchRoll instance if none was provided.\r\n */\r\nTransforms.fixedFrameToHeadingPitchRoll = function (\r\n transform,\r\n ellipsoid,\r\n fixedFrameTransform,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"transform\", transform);\r\n //>>includeEnd('debug');\r\n\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n fixedFrameTransform = defaultValue(\r\n fixedFrameTransform,\r\n Transforms.eastNorthUpToFixedFrame\r\n );\r\n if (!defined(result)) {\r\n result = new HeadingPitchRoll();\r\n }\r\n\r\n const center = Matrix4.getTranslation(transform, hprCenterScratch);\r\n if (Cartesian3.equals(center, Cartesian3.ZERO)) {\r\n result.heading = 0;\r\n result.pitch = 0;\r\n result.roll = 0;\r\n return result;\r\n }\r\n let toFixedFrame = Matrix4.inverseTransformation(\r\n fixedFrameTransform(center, ellipsoid, ffScratch),\r\n ffScratch\r\n );\r\n let transformCopy = Matrix4.setScale(transform, noScale, hprTransformScratch);\r\n transformCopy = Matrix4.setTranslation(\r\n transformCopy,\r\n Cartesian3.ZERO,\r\n transformCopy\r\n );\r\n\r\n toFixedFrame = Matrix4.multiply(toFixedFrame, transformCopy, toFixedFrame);\r\n let quaternionRotation = Quaternion.fromRotationMatrix(\r\n Matrix4.getMatrix3(toFixedFrame, hprRotationScratch),\r\n hprQuaternionScratch\r\n );\r\n quaternionRotation = Quaternion.normalize(\r\n quaternionRotation,\r\n quaternionRotation\r\n );\r\n\r\n return HeadingPitchRoll.fromQuaternion(quaternionRotation, result);\r\n};\r\n\r\nconst gmstConstant0 = 6 * 3600 + 41 * 60 + 50.54841;\r\nconst gmstConstant1 = 8640184.812866;\r\nconst gmstConstant2 = 0.093104;\r\nconst gmstConstant3 = -6.2e-6;\r\nconst rateCoef = 1.1772758384668e-19;\r\nconst wgs84WRPrecessing = 7.2921158553e-5;\r\nconst twoPiOverSecondsInDay = CesiumMath.TWO_PI / 86400.0;\r\nlet dateInUtc = new JulianDate();\r\n\r\n/**\r\n * Computes a rotation matrix to transform a point or vector from True Equator Mean Equinox (TEME) axes to the\r\n * pseudo-fixed axes at a given time. This method treats the UT1 time standard as equivalent to UTC.\r\n *\r\n * @param {JulianDate} date The time at which to compute the rotation matrix.\r\n * @param {Matrix3} [result] The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if none was provided.\r\n *\r\n * @example\r\n * //Set the view to the inertial frame.\r\n * scene.postUpdate.addEventListener(function(scene, time) {\r\n * const now = Cesium.JulianDate.now();\r\n * const offset = Cesium.Matrix4.multiplyByPoint(camera.transform, camera.position, new Cesium.Cartesian3());\r\n * const transform = Cesium.Matrix4.fromRotationTranslation(Cesium.Transforms.computeTemeToPseudoFixedMatrix(now));\r\n * const inverseTransform = Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4());\r\n * Cesium.Matrix4.multiplyByPoint(inverseTransform, offset, offset);\r\n * camera.lookAtTransform(transform, offset);\r\n * });\r\n */\r\nTransforms.computeTemeToPseudoFixedMatrix = function (date, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(date)) {\r\n throw new DeveloperError(\"date is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n // GMST is actually computed using UT1. We're using UTC as an approximation of UT1.\r\n // We do not want to use the function like convertTaiToUtc in JulianDate because\r\n // we explicitly do not want to fail when inside the leap second.\r\n\r\n dateInUtc = JulianDate.addSeconds(\r\n date,\r\n -JulianDate.computeTaiMinusUtc(date),\r\n dateInUtc\r\n );\r\n const utcDayNumber = dateInUtc.dayNumber;\r\n const utcSecondsIntoDay = dateInUtc.secondsOfDay;\r\n\r\n let t;\r\n const diffDays = utcDayNumber - 2451545;\r\n if (utcSecondsIntoDay >= 43200.0) {\r\n t = (diffDays + 0.5) / TimeConstants.DAYS_PER_JULIAN_CENTURY;\r\n } else {\r\n t = (diffDays - 0.5) / TimeConstants.DAYS_PER_JULIAN_CENTURY;\r\n }\r\n\r\n const gmst0 =\r\n gmstConstant0 +\r\n t * (gmstConstant1 + t * (gmstConstant2 + t * gmstConstant3));\r\n const angle = (gmst0 * twoPiOverSecondsInDay) % CesiumMath.TWO_PI;\r\n const ratio = wgs84WRPrecessing + rateCoef * (utcDayNumber - 2451545.5);\r\n const secondsSinceMidnight =\r\n (utcSecondsIntoDay + TimeConstants.SECONDS_PER_DAY * 0.5) %\r\n TimeConstants.SECONDS_PER_DAY;\r\n const gha = angle + ratio * secondsSinceMidnight;\r\n const cosGha = Math.cos(gha);\r\n const sinGha = Math.sin(gha);\r\n\r\n if (!defined(result)) {\r\n return new Matrix3(\r\n cosGha,\r\n sinGha,\r\n 0.0,\r\n -sinGha,\r\n cosGha,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0\r\n );\r\n }\r\n result[0] = cosGha;\r\n result[1] = -sinGha;\r\n result[2] = 0.0;\r\n result[3] = sinGha;\r\n result[4] = cosGha;\r\n result[5] = 0.0;\r\n result[6] = 0.0;\r\n result[7] = 0.0;\r\n result[8] = 1.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * The source of IAU 2006 XYS data, used for computing the transformation between the\r\n * Fixed and ICRF axes.\r\n * @type {Iau2006XysData}\r\n *\r\n * @see Transforms.computeIcrfToFixedMatrix\r\n * @see Transforms.computeFixedToIcrfMatrix\r\n *\r\n * @private\r\n */\r\nTransforms.iau2006XysData = new Iau2006XysData();\r\n\r\n/**\r\n * The source of Earth Orientation Parameters (EOP) data, used for computing the transformation\r\n * between the Fixed and ICRF axes. By default, zero values are used for all EOP values,\r\n * yielding a reasonable but not completely accurate representation of the ICRF axes.\r\n * @type {EarthOrientationParameters}\r\n *\r\n * @see Transforms.computeIcrfToFixedMatrix\r\n * @see Transforms.computeFixedToIcrfMatrix\r\n *\r\n * @private\r\n */\r\nTransforms.earthOrientationParameters = EarthOrientationParameters.NONE;\r\n\r\nconst ttMinusTai = 32.184;\r\nconst j2000ttDays = 2451545.0;\r\n\r\n/**\r\n * Preloads the data necessary to transform between the ICRF and Fixed axes, in either\r\n * direction, over a given interval. This function returns a promise that, when resolved,\r\n * indicates that the preload has completed.\r\n *\r\n * @param {TimeInterval} timeInterval The interval to preload.\r\n * @returns {Promise} A promise that, when resolved, indicates that the preload has completed\r\n * and evaluation of the transformation between the fixed and ICRF axes will\r\n * no longer return undefined for a time inside the interval.\r\n *\r\n *\r\n * @example\r\n * const interval = new Cesium.TimeInterval(...);\r\n * Promise.resolve(Cesium.Transforms.preloadIcrfFixed(interval)).then(function() {\r\n * // the data is now loaded\r\n * });\r\n *\r\n * @see Transforms.computeIcrfToFixedMatrix\r\n * @see Transforms.computeFixedToIcrfMatrix\r\n */\r\nTransforms.preloadIcrfFixed = function (timeInterval) {\r\n const startDayTT = timeInterval.start.dayNumber;\r\n const startSecondTT = timeInterval.start.secondsOfDay + ttMinusTai;\r\n const stopDayTT = timeInterval.stop.dayNumber;\r\n const stopSecondTT = timeInterval.stop.secondsOfDay + ttMinusTai;\r\n\r\n const xysPromise = Transforms.iau2006XysData.preload(\r\n startDayTT,\r\n startSecondTT,\r\n stopDayTT,\r\n stopSecondTT\r\n );\r\n const eopPromise = Transforms.earthOrientationParameters.getPromiseToLoad();\r\n\r\n return Promise.all([xysPromise, eopPromise]);\r\n};\r\n\r\n/**\r\n * Computes a rotation matrix to transform a point or vector from the International Celestial\r\n * Reference Frame (GCRF/ICRF) inertial frame axes to the Earth-Fixed frame axes (ITRF)\r\n * at a given time. This function may return undefined if the data necessary to\r\n * do the transformation is not yet loaded.\r\n *\r\n * @param {JulianDate} date The time at which to compute the rotation matrix.\r\n * @param {Matrix3} [result] The object onto which to store the result. If this parameter is\r\n * not specified, a new instance is created and returned.\r\n * @returns {Matrix3} The rotation matrix, or undefined if the data necessary to do the\r\n * transformation is not yet loaded.\r\n *\r\n *\r\n * @example\r\n * scene.postUpdate.addEventListener(function(scene, time) {\r\n * // View in ICRF.\r\n * const icrfToFixed = Cesium.Transforms.computeIcrfToFixedMatrix(time);\r\n * if (Cesium.defined(icrfToFixed)) {\r\n * const offset = Cesium.Cartesian3.clone(camera.position);\r\n * const transform = Cesium.Matrix4.fromRotationTranslation(icrfToFixed);\r\n * camera.lookAtTransform(transform, offset);\r\n * }\r\n * });\r\n *\r\n * @see Transforms.preloadIcrfFixed\r\n */\r\nTransforms.computeIcrfToFixedMatrix = function (date, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(date)) {\r\n throw new DeveloperError(\"date is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n if (!defined(result)) {\r\n result = new Matrix3();\r\n }\r\n\r\n const fixedToIcrfMtx = Transforms.computeFixedToIcrfMatrix(date, result);\r\n if (!defined(fixedToIcrfMtx)) {\r\n return undefined;\r\n }\r\n\r\n return Matrix3.transpose(fixedToIcrfMtx, result);\r\n};\r\n\r\nconst xysScratch = new Iau2006XysSample(0.0, 0.0, 0.0);\r\nconst eopScratch = new EarthOrientationParametersSample(\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0\r\n);\r\nconst rotation1Scratch = new Matrix3();\r\nconst rotation2Scratch = new Matrix3();\r\n\r\n/**\r\n * Computes a rotation matrix to transform a point or vector from the Earth-Fixed frame axes (ITRF)\r\n * to the International Celestial Reference Frame (GCRF/ICRF) inertial frame axes\r\n * at a given time. This function may return undefined if the data necessary to\r\n * do the transformation is not yet loaded.\r\n *\r\n * @param {JulianDate} date The time at which to compute the rotation matrix.\r\n * @param {Matrix3} [result] The object onto which to store the result. If this parameter is\r\n * not specified, a new instance is created and returned.\r\n * @returns {Matrix3} The rotation matrix, or undefined if the data necessary to do the\r\n * transformation is not yet loaded.\r\n *\r\n *\r\n * @example\r\n * // Transform a point from the ICRF axes to the Fixed axes.\r\n * const now = Cesium.JulianDate.now();\r\n * const pointInFixed = Cesium.Cartesian3.fromDegrees(0.0, 0.0);\r\n * const fixedToIcrf = Cesium.Transforms.computeIcrfToFixedMatrix(now);\r\n * let pointInInertial = new Cesium.Cartesian3();\r\n * if (Cesium.defined(fixedToIcrf)) {\r\n * pointInInertial = Cesium.Matrix3.multiplyByVector(fixedToIcrf, pointInFixed, pointInInertial);\r\n * }\r\n *\r\n * @see Transforms.preloadIcrfFixed\r\n */\r\nTransforms.computeFixedToIcrfMatrix = function (date, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(date)) {\r\n throw new DeveloperError(\"date is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Matrix3();\r\n }\r\n\r\n // Compute pole wander\r\n const eop = Transforms.earthOrientationParameters.compute(date, eopScratch);\r\n if (!defined(eop)) {\r\n return undefined;\r\n }\r\n\r\n // There is no external conversion to Terrestrial Time (TT).\r\n // So use International Atomic Time (TAI) and convert using offsets.\r\n // Here we are assuming that dayTT and secondTT are positive\r\n const dayTT = date.dayNumber;\r\n // It's possible here that secondTT could roll over 86400\r\n // This does not seem to affect the precision (unit tests check for this)\r\n const secondTT = date.secondsOfDay + ttMinusTai;\r\n\r\n const xys = Transforms.iau2006XysData.computeXysRadians(\r\n dayTT,\r\n secondTT,\r\n xysScratch\r\n );\r\n if (!defined(xys)) {\r\n return undefined;\r\n }\r\n\r\n const x = xys.x + eop.xPoleOffset;\r\n const y = xys.y + eop.yPoleOffset;\r\n\r\n // Compute XYS rotation\r\n const a = 1.0 / (1.0 + Math.sqrt(1.0 - x * x - y * y));\r\n\r\n const rotation1 = rotation1Scratch;\r\n rotation1[0] = 1.0 - a * x * x;\r\n rotation1[3] = -a * x * y;\r\n rotation1[6] = x;\r\n rotation1[1] = -a * x * y;\r\n rotation1[4] = 1 - a * y * y;\r\n rotation1[7] = y;\r\n rotation1[2] = -x;\r\n rotation1[5] = -y;\r\n rotation1[8] = 1 - a * (x * x + y * y);\r\n\r\n const rotation2 = Matrix3.fromRotationZ(-xys.s, rotation2Scratch);\r\n const matrixQ = Matrix3.multiply(rotation1, rotation2, rotation1Scratch);\r\n\r\n // Similar to TT conversions above\r\n // It's possible here that secondTT could roll over 86400\r\n // This does not seem to affect the precision (unit tests check for this)\r\n const dateUt1day = date.dayNumber;\r\n const dateUt1sec =\r\n date.secondsOfDay - JulianDate.computeTaiMinusUtc(date) + eop.ut1MinusUtc;\r\n\r\n // Compute Earth rotation angle\r\n // The IERS standard for era is\r\n // era = 0.7790572732640 + 1.00273781191135448 * Tu\r\n // where\r\n // Tu = JulianDateInUt1 - 2451545.0\r\n // However, you get much more precision if you make the following simplification\r\n // era = a + (1 + b) * (JulianDayNumber + FractionOfDay - 2451545)\r\n // era = a + (JulianDayNumber - 2451545) + FractionOfDay + b (JulianDayNumber - 2451545 + FractionOfDay)\r\n // era = a + FractionOfDay + b (JulianDayNumber - 2451545 + FractionOfDay)\r\n // since (JulianDayNumber - 2451545) represents an integer number of revolutions which will be discarded anyway.\r\n const daysSinceJ2000 = dateUt1day - 2451545;\r\n const fractionOfDay = dateUt1sec / TimeConstants.SECONDS_PER_DAY;\r\n let era =\r\n 0.779057273264 +\r\n fractionOfDay +\r\n 0.00273781191135448 * (daysSinceJ2000 + fractionOfDay);\r\n era = (era % 1.0) * CesiumMath.TWO_PI;\r\n\r\n const earthRotation = Matrix3.fromRotationZ(era, rotation2Scratch);\r\n\r\n // pseudoFixed to ICRF\r\n const pfToIcrf = Matrix3.multiply(matrixQ, earthRotation, rotation1Scratch);\r\n\r\n // Compute pole wander matrix\r\n const cosxp = Math.cos(eop.xPoleWander);\r\n const cosyp = Math.cos(eop.yPoleWander);\r\n const sinxp = Math.sin(eop.xPoleWander);\r\n const sinyp = Math.sin(eop.yPoleWander);\r\n\r\n let ttt = dayTT - j2000ttDays + secondTT / TimeConstants.SECONDS_PER_DAY;\r\n ttt /= 36525.0;\r\n\r\n // approximate sp value in rad\r\n const sp = (-47.0e-6 * ttt * CesiumMath.RADIANS_PER_DEGREE) / 3600.0;\r\n const cossp = Math.cos(sp);\r\n const sinsp = Math.sin(sp);\r\n\r\n const fToPfMtx = rotation2Scratch;\r\n fToPfMtx[0] = cosxp * cossp;\r\n fToPfMtx[1] = cosxp * sinsp;\r\n fToPfMtx[2] = sinxp;\r\n fToPfMtx[3] = -cosyp * sinsp + sinyp * sinxp * cossp;\r\n fToPfMtx[4] = cosyp * cossp + sinyp * sinxp * sinsp;\r\n fToPfMtx[5] = -sinyp * cosxp;\r\n fToPfMtx[6] = -sinyp * sinsp - cosyp * sinxp * cossp;\r\n fToPfMtx[7] = sinyp * cossp - cosyp * sinxp * sinsp;\r\n fToPfMtx[8] = cosyp * cosxp;\r\n\r\n return Matrix3.multiply(pfToIcrf, fToPfMtx, result);\r\n};\r\n\r\nconst pointToWindowCoordinatesTemp = new Cartesian4();\r\n\r\n/**\r\n * Transform a point from model coordinates to window coordinates.\r\n *\r\n * @param {Matrix4} modelViewProjectionMatrix The 4x4 model-view-projection matrix.\r\n * @param {Matrix4} viewportTransformation The 4x4 viewport transformation.\r\n * @param {Cartesian3} point The point to transform.\r\n * @param {Cartesian2} [result] The object onto which to store the result.\r\n * @returns {Cartesian2} The modified result parameter or a new Cartesian2 instance if none was provided.\r\n */\r\nTransforms.pointToWindowCoordinates = function (\r\n modelViewProjectionMatrix,\r\n viewportTransformation,\r\n point,\r\n result\r\n) {\r\n result = Transforms.pointToGLWindowCoordinates(\r\n modelViewProjectionMatrix,\r\n viewportTransformation,\r\n point,\r\n result\r\n );\r\n result.y = 2.0 * viewportTransformation[5] - result.y;\r\n return result;\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nTransforms.pointToGLWindowCoordinates = function (\r\n modelViewProjectionMatrix,\r\n viewportTransformation,\r\n point,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(modelViewProjectionMatrix)) {\r\n throw new DeveloperError(\"modelViewProjectionMatrix is required.\");\r\n }\r\n\r\n if (!defined(viewportTransformation)) {\r\n throw new DeveloperError(\"viewportTransformation is required.\");\r\n }\r\n\r\n if (!defined(point)) {\r\n throw new DeveloperError(\"point is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = new Cartesian2();\r\n }\r\n\r\n const tmp = pointToWindowCoordinatesTemp;\r\n\r\n Matrix4.multiplyByVector(\r\n modelViewProjectionMatrix,\r\n Cartesian4.fromElements(point.x, point.y, point.z, 1, tmp),\r\n tmp\r\n );\r\n Cartesian4.multiplyByScalar(tmp, 1.0 / tmp.w, tmp);\r\n Matrix4.multiplyByVector(viewportTransformation, tmp, tmp);\r\n return Cartesian2.fromCartesian4(tmp, result);\r\n};\r\n\r\nconst normalScratch = new Cartesian3();\r\nconst rightScratch = new Cartesian3();\r\nconst upScratch = new Cartesian3();\r\n\r\n/**\r\n * Transform a position and velocity to a rotation matrix.\r\n *\r\n * @param {Cartesian3} position The position to transform.\r\n * @param {Cartesian3} velocity The velocity vector to transform.\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid whose fixed frame is used in the transformation.\r\n * @param {Matrix3} [result] The object onto which to store the result.\r\n * @returns {Matrix3} The modified result parameter or a new Matrix3 instance if none was provided.\r\n */\r\nTransforms.rotationMatrixFromPositionVelocity = function (\r\n position,\r\n velocity,\r\n ellipsoid,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(position)) {\r\n throw new DeveloperError(\"position is required.\");\r\n }\r\n\r\n if (!defined(velocity)) {\r\n throw new DeveloperError(\"velocity is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const normal = defaultValue(ellipsoid, Ellipsoid.WGS84).geodeticSurfaceNormal(\r\n position,\r\n normalScratch\r\n );\r\n let right = Cartesian3.cross(velocity, normal, rightScratch);\r\n\r\n if (Cartesian3.equalsEpsilon(right, Cartesian3.ZERO, CesiumMath.EPSILON6)) {\r\n right = Cartesian3.clone(Cartesian3.UNIT_X, right);\r\n }\r\n\r\n const up = Cartesian3.cross(right, velocity, upScratch);\r\n Cartesian3.normalize(up, up);\r\n Cartesian3.cross(velocity, up, right);\r\n Cartesian3.negate(right, right);\r\n Cartesian3.normalize(right, right);\r\n\r\n if (!defined(result)) {\r\n result = new Matrix3();\r\n }\r\n\r\n result[0] = velocity.x;\r\n result[1] = velocity.y;\r\n result[2] = velocity.z;\r\n result[3] = right.x;\r\n result[4] = right.y;\r\n result[5] = right.z;\r\n result[6] = up.x;\r\n result[7] = up.y;\r\n result[8] = up.z;\r\n\r\n return result;\r\n};\r\n\r\nconst swizzleMatrix = new Matrix4(\r\n 0.0,\r\n 0.0,\r\n 1.0,\r\n 0.0,\r\n 1.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0\r\n);\r\n\r\nconst scratchCartographic = new Cartographic();\r\nconst scratchCartesian3Projection = new Cartesian3();\r\nconst scratchCenter = new Cartesian3();\r\nconst scratchRotation = new Matrix3();\r\nconst scratchFromENU = new Matrix4();\r\nconst scratchToENU = new Matrix4();\r\n\r\n/**\r\n * @private\r\n */\r\nTransforms.basisTo2D = function (projection, matrix, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(projection)) {\r\n throw new DeveloperError(\"projection is required.\");\r\n }\r\n if (!defined(matrix)) {\r\n throw new DeveloperError(\"matrix is required.\");\r\n }\r\n if (!defined(result)) {\r\n throw new DeveloperError(\"result is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const rtcCenter = Matrix4.getTranslation(matrix, scratchCenter);\r\n const ellipsoid = projection.ellipsoid;\r\n\r\n // Get the 2D Center\r\n const cartographic = ellipsoid.cartesianToCartographic(\r\n rtcCenter,\r\n scratchCartographic\r\n );\r\n const projectedPosition = projection.project(\r\n cartographic,\r\n scratchCartesian3Projection\r\n );\r\n Cartesian3.fromElements(\r\n projectedPosition.z,\r\n projectedPosition.x,\r\n projectedPosition.y,\r\n projectedPosition\r\n );\r\n\r\n // Assuming the instance are positioned in WGS84, invert the WGS84 transform to get the local transform and then convert to 2D\r\n const fromENU = Transforms.eastNorthUpToFixedFrame(\r\n rtcCenter,\r\n ellipsoid,\r\n scratchFromENU\r\n );\r\n const toENU = Matrix4.inverseTransformation(fromENU, scratchToENU);\r\n const rotation = Matrix4.getMatrix3(matrix, scratchRotation);\r\n const local = Matrix4.multiplyByMatrix3(toENU, rotation, result);\r\n Matrix4.multiply(swizzleMatrix, local, result); // Swap x, y, z for 2D\r\n Matrix4.setTranslation(result, projectedPosition, result); // Use the projected center\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nTransforms.wgs84To2DModelMatrix = function (projection, center, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(projection)) {\r\n throw new DeveloperError(\"projection is required.\");\r\n }\r\n if (!defined(center)) {\r\n throw new DeveloperError(\"center is required.\");\r\n }\r\n if (!defined(result)) {\r\n throw new DeveloperError(\"result is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const ellipsoid = projection.ellipsoid;\r\n\r\n const fromENU = Transforms.eastNorthUpToFixedFrame(\r\n center,\r\n ellipsoid,\r\n scratchFromENU\r\n );\r\n const toENU = Matrix4.inverseTransformation(fromENU, scratchToENU);\r\n\r\n const cartographic = ellipsoid.cartesianToCartographic(\r\n center,\r\n scratchCartographic\r\n );\r\n const projectedPosition = projection.project(\r\n cartographic,\r\n scratchCartesian3Projection\r\n );\r\n Cartesian3.fromElements(\r\n projectedPosition.z,\r\n projectedPosition.x,\r\n projectedPosition.y,\r\n projectedPosition\r\n );\r\n\r\n const translation = Matrix4.fromTranslation(\r\n projectedPosition,\r\n scratchFromENU\r\n );\r\n Matrix4.multiply(swizzleMatrix, toENU, result);\r\n Matrix4.multiply(translation, result, result);\r\n\r\n return result;\r\n};\r\nexport default Transforms;\r\n"],"names":["defaultValue","Ellipsoid","defined","Cartesian3","DeveloperError","Cartographic","CesiumMath","Rectangle","Check","Matrix3","Matrix4","Intersect","Fullscreen","scratchHPRQuaternion","FeatureDetection","compareLeapSecondDates","TimeConstants","TimeStandard","global","this","require$$0","require$$1","require$$2","a","dataUriRegex","RequestType","RequestState","RuntimeError","combine","TrustedServers","Cartesian4","Cartesian2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,SAAS,oBAAoB,CAAC,SAAS,EAAE;CACzC,EAAE,IAAI,CAAC,UAAU,GAAGA,yBAAY,CAAC,SAAS,EAAEC,iBAAS,CAAC,KAAK,CAAC,CAAC;CAC7D,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;CACtD,EAAE,IAAI,CAAC,qBAAqB,GAAG,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC;CACzD,CAAC;AACD;CACA,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,CAAC,SAAS,EAAE;CACxD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,SAAS,EAAE;CACb,IAAI,GAAG,EAAE,YAAY;CACrB,MAAM,OAAO,IAAI,CAAC,UAAU,CAAC;CAC7B,KAAK;CACL,GAAG;CACH,CAAC,CAAC,CAAC;AACH;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,oBAAoB,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,YAAY,EAAE,MAAM,EAAE;CACzE;CACA,EAAE,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC;CAC5C,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC,SAAS,GAAG,aAAa,CAAC;CACnD,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC,QAAQ,GAAG,aAAa,CAAC;CAClD,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC;AAChC;CACA,EAAE,IAAI,CAACC,oBAAO,CAAC,MAAM,CAAC,EAAE;CACxB,IAAI,OAAO,IAAIC,kBAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,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CACH,EAAE,OAAO,MAAM,CAAC;CAChB;;CC1DA;CACA;CACA;CACA;CACA;CACA,MAAM,YAAY,GAAG;CACrB;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,QAAQ,EAAE,CAAC;AACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,MAAM,EAAE,CAAC;AACX;CACA;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,MAAM,EAAE,CAAC;AACX;CACA;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,QAAQ,EAAE,CAAC;AACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,SAAS,EAAE,CAAC;AACd;CACA;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,MAAM,EAAE,CAAC;CACX,CAAC,CAAC;AACF,sBAAe,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;;CCtD1C;CACA;CACA;CACA;CACA;CACA,MAAM,WAAW,GAAG;CACpB;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,OAAO,EAAE,CAAC;AACZ;CACA;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,OAAO,EAAE,CAAC;AACZ;CACA;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,OAAO,EAAE,CAAC;AACZ;CACA;CACA;CACA;CACA;CACA;CACA;CACA,EAAE,KAAK,EAAE,CAAC;CACV,CAAC,CAAC;AACF,qBAAe,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;;CCjCzC;CACA;CACA;CACA;CACA;AACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,SAAS,OAAO,CAAC,OAAO,EAAE;CAC1B,EAAE,OAAO,GAAGF,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;CACA,EAAE,MAAM,gBAAgB,GAAGA,yBAAY,CAAC,OAAO,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;CACzE,EAAE,MAAM,QAAQ,GAAGA,yBAAY,CA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,CAAC;CACvB,MAAM,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;CAC5B,MAAM,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;CAC5B,MAAM,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;CAC5B,MAAM,MAAM,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;CACvB,MAAM,OAAO,MAAM,CAAC;CACpB,KAAK,CAAC;CACN,IAAI,2BAA2B,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;CACrD,GAAG;CACH,EAAE,OAAO,QAAQ,CAAC;CAClB,CAAC,CAAC;AACF;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,uBAAuB,GAAG,UAAU,CAAC,+BAA+B;CAC/E,EAAE,MAAM;CACR,EAAE,OAAO;CACT,CAAC,CAAC;AACF;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,yBAAyB,GAAG,UAAU,CAAC,+BAA+B;CACjF,EAAE,OAAO;CACT,EAAE,MAAM;CACR,CAAC,CAAC;AACF;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,uBAAuB,GAAG,UAAU,CAAC,+BAA+B;CAC/E,EAAE,OAAO;CACT,EAAE,IAAI;CACN,CAAC,CAAC;AACF;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,UAAU,CAAC,uBAAuB,GAAG,UAAU,CAAC,+BAA+B;CAC/E,EAAE,O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,GAAG,UAAU,CAAC,OAAO;CAC9C,IAAI,YAAY;CAChB,IAAI,2BAA2B;CAC/B,GAAG,CAAC;CACJ,EAAEP,kBAAU,CAAC,YAAY;CACzB,IAAI,iBAAiB,CAAC,CAAC;CACvB,IAAI,iBAAiB,CAAC,CAAC;CACvB,IAAI,iBAAiB,CAAC,CAAC;CACvB,IAAI,iBAAiB;CACrB,GAAG,CAAC;AACJ;CACA,EAAE,MAAM,WAAW,GAAGO,eAAO,CAAC,eAAe;CAC7C,IAAI,iBAAiB;CACrB,IAAI,cAAc;CAClB,GAAG,CAAC;CACJ,EAAEA,eAAO,CAAC,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;CACjD,EAAEA,eAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAChD;CACA,EAAE,OAAO,MAAM,CAAC;CAChB,CAAC,CAAC;AACF,oBAAe,UAAU;;;;;;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/VertexFormat-f2d74c96.js b/examples/cesium/Workers/VertexFormat-f2d74c96.js
new file mode 100644
index 0000000..aaa725b
--- /dev/null
+++ b/examples/cesium/Workers/VertexFormat-f2d74c96.js
@@ -0,0 +1,338 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './defaultValue-0ab18f7d', './Check-d10e5f2e'], (function (exports, defaultValue, Check) { 'use strict';
+
+ /**
+ * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided
+ * to a {@link Geometry} to request that certain properties be computed, e.g., just position,
+ * position and normal, etc.
+ *
+ * @param {Object} [options] An object with boolean properties corresponding to VertexFormat properties as shown in the code example.
+ *
+ * @alias VertexFormat
+ * @constructor
+ *
+ * @example
+ * // Create a vertex format with position and 2D texture coordinate attributes.
+ * const format = new Cesium.VertexFormat({
+ * position : true,
+ * st : true
+ * });
+ *
+ * @see Geometry#attributes
+ * @see Packable
+ */
+ function VertexFormat(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ /**
+ * When true
, the vertex has a 3D position attribute.
+ *
+ * 64-bit floating-point (for precision). 3 components per attribute.
+ *
+ *
+ * @type Boolean
+ *
+ * @default false
+ */
+ this.position = defaultValue.defaultValue(options.position, false);
+
+ /**
+ * When true
, the vertex has a normal attribute (normalized), which is commonly used for lighting.
+ *
+ * 32-bit floating-point. 3 components per attribute.
+ *
+ *
+ * @type Boolean
+ *
+ * @default false
+ */
+ this.normal = defaultValue.defaultValue(options.normal, false);
+
+ /**
+ * When true
, the vertex has a 2D texture coordinate attribute.
+ *
+ * 32-bit floating-point. 2 components per attribute
+ *
+ *
+ * @type Boolean
+ *
+ * @default false
+ */
+ this.st = defaultValue.defaultValue(options.st, false);
+
+ /**
+ * When true
, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.
+ *
+ * 32-bit floating-point. 3 components per attribute.
+ *
+ *
+ * @type Boolean
+ *
+ * @default false
+ */
+ this.bitangent = defaultValue.defaultValue(options.bitangent, false);
+
+ /**
+ * When true
, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.
+ *
+ * 32-bit floating-point. 3 components per attribute.
+ *
+ *
+ * @type Boolean
+ *
+ * @default false
+ */
+ this.tangent = defaultValue.defaultValue(options.tangent, false);
+
+ /**
+ * When true
, the vertex has an RGB color attribute.
+ *
+ * 8-bit unsigned byte. 3 components per attribute.
+ *
+ *
+ * @type Boolean
+ *
+ * @default false
+ */
+ this.color = defaultValue.defaultValue(options.color, false);
+ }
+
+ /**
+ * An immutable vertex format with only a position attribute.
+ *
+ * @type {VertexFormat}
+ * @constant
+ *
+ * @see VertexFormat#position
+ */
+ VertexFormat.POSITION_ONLY = Object.freeze(
+ new VertexFormat({
+ position: true,
+ })
+ );
+
+ /**
+ * An immutable vertex format with position and normal attributes.
+ * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.
+ *
+ * @type {VertexFormat}
+ * @constant
+ *
+ * @see VertexFormat#position
+ * @see VertexFormat#normal
+ */
+ VertexFormat.POSITION_AND_NORMAL = Object.freeze(
+ new VertexFormat({
+ position: true,
+ normal: true,
+ })
+ );
+
+ /**
+ * An immutable vertex format with position, normal, and st attributes.
+ * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}
+ * is TEXTURED/code>.
+ *
+ * @type {VertexFormat}
+ * @constant
+ *
+ * @see VertexFormat#position
+ * @see VertexFormat#normal
+ * @see VertexFormat#st
+ */
+ VertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(
+ new VertexFormat({
+ position: true,
+ normal: true,
+ st: true,
+ })
+ );
+
+ /**
+ * An immutable vertex format with position and st attributes.
+ * This is compatible with {@link EllipsoidSurfaceAppearance}.
+ *
+ * @type {VertexFormat}
+ * @constant
+ *
+ * @see VertexFormat#position
+ * @see VertexFormat#st
+ */
+ VertexFormat.POSITION_AND_ST = Object.freeze(
+ new VertexFormat({
+ position: true,
+ st: true,
+ })
+ );
+
+ /**
+ * An immutable vertex format with position and color attributes.
+ *
+ * @type {VertexFormat}
+ * @constant
+ *
+ * @see VertexFormat#position
+ * @see VertexFormat#color
+ */
+ VertexFormat.POSITION_AND_COLOR = Object.freeze(
+ new VertexFormat({
+ position: true,
+ color: true,
+ })
+ );
+
+ /**
+ * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.
+ *
+ * @type {VertexFormat}
+ * @constant
+ *
+ * @see VertexFormat#position
+ * @see VertexFormat#normal
+ * @see VertexFormat#st
+ * @see VertexFormat#tangent
+ * @see VertexFormat#bitangent
+ */
+ VertexFormat.ALL = Object.freeze(
+ new VertexFormat({
+ position: true,
+ normal: true,
+ st: true,
+ tangent: true,
+ bitangent: true,
+ })
+ );
+
+ /**
+ * An immutable vertex format with position, normal, and st attributes.
+ * This is compatible with most appearances and materials; however
+ * normal and st attributes are not always required. When this is
+ * known in advance, another VertexFormat
should be used.
+ *
+ * @type {VertexFormat}
+ * @constant
+ *
+ * @see VertexFormat#position
+ * @see VertexFormat#normal
+ */
+ VertexFormat.DEFAULT = VertexFormat.POSITION_NORMAL_AND_ST;
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ VertexFormat.packedLength = 6;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {VertexFormat} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ VertexFormat.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value.position ? 1.0 : 0.0;
+ array[startingIndex++] = value.normal ? 1.0 : 0.0;
+ array[startingIndex++] = value.st ? 1.0 : 0.0;
+ array[startingIndex++] = value.tangent ? 1.0 : 0.0;
+ array[startingIndex++] = value.bitangent ? 1.0 : 0.0;
+ array[startingIndex] = value.color ? 1.0 : 0.0;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {VertexFormat} [result] The object into which to store the result.
+ * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided.
+ */
+ VertexFormat.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ if (!defaultValue.defined(result)) {
+ result = new VertexFormat();
+ }
+
+ result.position = array[startingIndex++] === 1.0;
+ result.normal = array[startingIndex++] === 1.0;
+ result.st = array[startingIndex++] === 1.0;
+ result.tangent = array[startingIndex++] === 1.0;
+ result.bitangent = array[startingIndex++] === 1.0;
+ result.color = array[startingIndex] === 1.0;
+ return result;
+ };
+
+ /**
+ * Duplicates a VertexFormat instance.
+ *
+ * @param {VertexFormat} vertexFormat The vertex format to duplicate.
+ * @param {VertexFormat} [result] The object onto which to store the result.
+ * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)
+ */
+ VertexFormat.clone = function (vertexFormat, result) {
+ if (!defaultValue.defined(vertexFormat)) {
+ return undefined;
+ }
+ if (!defaultValue.defined(result)) {
+ result = new VertexFormat();
+ }
+
+ result.position = vertexFormat.position;
+ result.normal = vertexFormat.normal;
+ result.st = vertexFormat.st;
+ result.tangent = vertexFormat.tangent;
+ result.bitangent = vertexFormat.bitangent;
+ result.color = vertexFormat.color;
+ return result;
+ };
+
+ exports.VertexFormat = VertexFormat;
+
+}));
+//# sourceMappingURL=VertexFormat-f2d74c96.js.map
diff --git a/examples/cesium/Workers/VertexFormat-f2d74c96.js.map b/examples/cesium/Workers/VertexFormat-f2d74c96.js.map
new file mode 100644
index 0000000..6d4f398
--- /dev/null
+++ b/examples/cesium/Workers/VertexFormat-f2d74c96.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"VertexFormat-f2d74c96.js","sources":["../../../Source/Core/VertexFormat.js"],"sourcesContent":["import defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * A vertex format defines what attributes make up a vertex. A VertexFormat can be provided\r\n * to a {@link Geometry} to request that certain properties be computed, e.g., just position,\r\n * position and normal, etc.\r\n *\r\n * @param {Object} [options] An object with boolean properties corresponding to VertexFormat properties as shown in the code example.\r\n *\r\n * @alias VertexFormat\r\n * @constructor\r\n *\r\n * @example\r\n * // Create a vertex format with position and 2D texture coordinate attributes.\r\n * const format = new Cesium.VertexFormat({\r\n * position : true,\r\n * st : true\r\n * });\r\n *\r\n * @see Geometry#attributes\r\n * @see Packable\r\n */\r\nfunction VertexFormat(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n /**\r\n * When true
, the vertex has a 3D position attribute.\r\n * \r\n * 64-bit floating-point (for precision). 3 components per attribute.\r\n *
\r\n *\r\n * @type Boolean\r\n *\r\n * @default false\r\n */\r\n this.position = defaultValue(options.position, false);\r\n\r\n /**\r\n * When true
, the vertex has a normal attribute (normalized), which is commonly used for lighting.\r\n * \r\n * 32-bit floating-point. 3 components per attribute.\r\n *
\r\n *\r\n * @type Boolean\r\n *\r\n * @default false\r\n */\r\n this.normal = defaultValue(options.normal, false);\r\n\r\n /**\r\n * When true
, the vertex has a 2D texture coordinate attribute.\r\n * \r\n * 32-bit floating-point. 2 components per attribute\r\n *
\r\n *\r\n * @type Boolean\r\n *\r\n * @default false\r\n */\r\n this.st = defaultValue(options.st, false);\r\n\r\n /**\r\n * When true
, the vertex has a bitangent attribute (normalized), which is used for tangent-space effects like bump mapping.\r\n * \r\n * 32-bit floating-point. 3 components per attribute.\r\n *
\r\n *\r\n * @type Boolean\r\n *\r\n * @default false\r\n */\r\n this.bitangent = defaultValue(options.bitangent, false);\r\n\r\n /**\r\n * When true
, the vertex has a tangent attribute (normalized), which is used for tangent-space effects like bump mapping.\r\n * \r\n * 32-bit floating-point. 3 components per attribute.\r\n *
\r\n *\r\n * @type Boolean\r\n *\r\n * @default false\r\n */\r\n this.tangent = defaultValue(options.tangent, false);\r\n\r\n /**\r\n * When true
, the vertex has an RGB color attribute.\r\n * \r\n * 8-bit unsigned byte. 3 components per attribute.\r\n *
\r\n *\r\n * @type Boolean\r\n *\r\n * @default false\r\n */\r\n this.color = defaultValue(options.color, false);\r\n}\r\n\r\n/**\r\n * An immutable vertex format with only a position attribute.\r\n *\r\n * @type {VertexFormat}\r\n * @constant\r\n *\r\n * @see VertexFormat#position\r\n */\r\nVertexFormat.POSITION_ONLY = Object.freeze(\r\n new VertexFormat({\r\n position: true,\r\n })\r\n);\r\n\r\n/**\r\n * An immutable vertex format with position and normal attributes.\r\n * This is compatible with per-instance color appearances like {@link PerInstanceColorAppearance}.\r\n *\r\n * @type {VertexFormat}\r\n * @constant\r\n *\r\n * @see VertexFormat#position\r\n * @see VertexFormat#normal\r\n */\r\nVertexFormat.POSITION_AND_NORMAL = Object.freeze(\r\n new VertexFormat({\r\n position: true,\r\n normal: true,\r\n })\r\n);\r\n\r\n/**\r\n * An immutable vertex format with position, normal, and st attributes.\r\n * This is compatible with {@link MaterialAppearance} when {@link MaterialAppearance#materialSupport}\r\n * is TEXTURED/code>.\r\n *\r\n * @type {VertexFormat}\r\n * @constant\r\n *\r\n * @see VertexFormat#position\r\n * @see VertexFormat#normal\r\n * @see VertexFormat#st\r\n */\r\nVertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(\r\n new VertexFormat({\r\n position: true,\r\n normal: true,\r\n st: true,\r\n })\r\n);\r\n\r\n/**\r\n * An immutable vertex format with position and st attributes.\r\n * This is compatible with {@link EllipsoidSurfaceAppearance}.\r\n *\r\n * @type {VertexFormat}\r\n * @constant\r\n *\r\n * @see VertexFormat#position\r\n * @see VertexFormat#st\r\n */\r\nVertexFormat.POSITION_AND_ST = Object.freeze(\r\n new VertexFormat({\r\n position: true,\r\n st: true,\r\n })\r\n);\r\n\r\n/**\r\n * An immutable vertex format with position and color attributes.\r\n *\r\n * @type {VertexFormat}\r\n * @constant\r\n *\r\n * @see VertexFormat#position\r\n * @see VertexFormat#color\r\n */\r\nVertexFormat.POSITION_AND_COLOR = Object.freeze(\r\n new VertexFormat({\r\n position: true,\r\n color: true,\r\n })\r\n);\r\n\r\n/**\r\n * An immutable vertex format with well-known attributes: position, normal, st, tangent, and bitangent.\r\n *\r\n * @type {VertexFormat}\r\n * @constant\r\n *\r\n * @see VertexFormat#position\r\n * @see VertexFormat#normal\r\n * @see VertexFormat#st\r\n * @see VertexFormat#tangent\r\n * @see VertexFormat#bitangent\r\n */\r\nVertexFormat.ALL = Object.freeze(\r\n new VertexFormat({\r\n position: true,\r\n normal: true,\r\n st: true,\r\n tangent: true,\r\n bitangent: true,\r\n })\r\n);\r\n\r\n/**\r\n * An immutable vertex format with position, normal, and st attributes.\r\n * This is compatible with most appearances and materials; however\r\n * normal and st attributes are not always required. When this is\r\n * known in advance, another VertexFormat
should be used.\r\n *\r\n * @type {VertexFormat}\r\n * @constant\r\n *\r\n * @see VertexFormat#position\r\n * @see VertexFormat#normal\r\n */\r\nVertexFormat.DEFAULT = VertexFormat.POSITION_NORMAL_AND_ST;\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nVertexFormat.packedLength = 6;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {VertexFormat} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nVertexFormat.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value.position ? 1.0 : 0.0;\r\n array[startingIndex++] = value.normal ? 1.0 : 0.0;\r\n array[startingIndex++] = value.st ? 1.0 : 0.0;\r\n array[startingIndex++] = value.tangent ? 1.0 : 0.0;\r\n array[startingIndex++] = value.bitangent ? 1.0 : 0.0;\r\n array[startingIndex] = value.color ? 1.0 : 0.0;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {VertexFormat} [result] The object into which to store the result.\r\n * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided.\r\n */\r\nVertexFormat.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n if (!defined(result)) {\r\n result = new VertexFormat();\r\n }\r\n\r\n result.position = array[startingIndex++] === 1.0;\r\n result.normal = array[startingIndex++] === 1.0;\r\n result.st = array[startingIndex++] === 1.0;\r\n result.tangent = array[startingIndex++] === 1.0;\r\n result.bitangent = array[startingIndex++] === 1.0;\r\n result.color = array[startingIndex] === 1.0;\r\n return result;\r\n};\r\n\r\n/**\r\n * Duplicates a VertexFormat instance.\r\n *\r\n * @param {VertexFormat} vertexFormat The vertex format to duplicate.\r\n * @param {VertexFormat} [result] The object onto which to store the result.\r\n * @returns {VertexFormat} The modified result parameter or a new VertexFormat instance if one was not provided. (Returns undefined if vertexFormat is undefined)\r\n */\r\nVertexFormat.clone = function (vertexFormat, result) {\r\n if (!defined(vertexFormat)) {\r\n return undefined;\r\n }\r\n if (!defined(result)) {\r\n result = new VertexFormat();\r\n }\r\n\r\n result.position = vertexFormat.position;\r\n result.normal = vertexFormat.normal;\r\n result.st = vertexFormat.st;\r\n result.tangent = vertexFormat.tangent;\r\n result.bitangent = vertexFormat.bitangent;\r\n result.color = vertexFormat.color;\r\n return result;\r\n};\r\nexport default VertexFormat;\r\n"],"names":["defaultValue","defined","DeveloperError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAIA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,YAAY,CAAC,OAAO,EAAE;EAC/B,EAAE,OAAO,GAAGA,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,QAAQ,GAAGA,yBAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACxD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,MAAM,GAAGA,yBAAY,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AACpD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,EAAE,GAAGA,yBAAY,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAC5C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,SAAS,GAAGA,yBAAY,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;AAC1D;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,OAAO,GAAGA,yBAAY,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AACtD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,KAAK,GAAGA,yBAAY,CAAC,OAAO,CAAC,KA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C,aAAa,CAAC,KAAK,GAAG,CAAC;EAC9C,EAAE,OAAO,MAAM,CAAC;EAChB,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY,CAAC,KAAK,GAAG,UAAU,YAAY,EAAE,MAAM,EAAE;EACrD,EAAE,IAAI,CAACA,oBAAO,CAAC,YAAY,CAAC,EAAE;EAC9B,IAAI,OAAO,SAAS,CAAC;EACrB,GAAG;EACH,EAAE,IAAI,CAACA,oBAAO,CAAC,MAAM,CAAC,EAAE;EACxB,IAAI,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;EAChC,GAAG;AACH;EACA,EAAE,MAAM,CAAC,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC;EAC1C,EAAE,MAAM,CAAC,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC;EACtC,EAAE,MAAM,CAAC,EAAE,GAAG,YAAY,CAAC,EAAE,CAAC;EAC9B,EAAE,MAAM,CAAC,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC;EACxC,EAAE,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC;EAC5C,EAAE,MAAM,CAAC,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;EACpC,EAAE,OAAO,MAAM,CAAC;EAChB,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/WallGeometryLibrary-4f405b12.js b/examples/cesium/Workers/WallGeometryLibrary-4f405b12.js
new file mode 100644
index 0000000..33bcd7d
--- /dev/null
+++ b/examples/cesium/Workers/WallGeometryLibrary-4f405b12.js
@@ -0,0 +1,237 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './arrayRemoveDuplicates-c3526030', './Matrix3-f22b0303', './defaultValue-0ab18f7d', './Math-9be8b918', './PolylinePipeline-3c021236'], (function (exports, arrayRemoveDuplicates, Matrix3, defaultValue, Math, PolylinePipeline) { 'use strict';
+
+ /**
+ * @private
+ */
+ const WallGeometryLibrary = {};
+
+ function latLonEquals(c0, c1) {
+ return (
+ Math.CesiumMath.equalsEpsilon(c0.latitude, c1.latitude, Math.CesiumMath.EPSILON10) &&
+ Math.CesiumMath.equalsEpsilon(c0.longitude, c1.longitude, Math.CesiumMath.EPSILON10)
+ );
+ }
+
+ const scratchCartographic1 = new Matrix3.Cartographic();
+ const scratchCartographic2 = new Matrix3.Cartographic();
+ function removeDuplicates(ellipsoid, positions, topHeights, bottomHeights) {
+ positions = arrayRemoveDuplicates.arrayRemoveDuplicates(positions, Matrix3.Cartesian3.equalsEpsilon);
+
+ const length = positions.length;
+ if (length < 2) {
+ return;
+ }
+
+ const hasBottomHeights = defaultValue.defined(bottomHeights);
+ const hasTopHeights = defaultValue.defined(topHeights);
+
+ const cleanedPositions = new Array(length);
+ const cleanedTopHeights = new Array(length);
+ const cleanedBottomHeights = new Array(length);
+
+ const v0 = positions[0];
+ cleanedPositions[0] = v0;
+
+ const c0 = ellipsoid.cartesianToCartographic(v0, scratchCartographic1);
+ if (hasTopHeights) {
+ c0.height = topHeights[0];
+ }
+
+ cleanedTopHeights[0] = c0.height;
+
+ if (hasBottomHeights) {
+ cleanedBottomHeights[0] = bottomHeights[0];
+ } else {
+ cleanedBottomHeights[0] = 0.0;
+ }
+
+ const startTopHeight = cleanedTopHeights[0];
+ const startBottomHeight = cleanedBottomHeights[0];
+ let hasAllSameHeights = startTopHeight === startBottomHeight;
+
+ let index = 1;
+ for (let i = 1; i < length; ++i) {
+ const v1 = positions[i];
+ const c1 = ellipsoid.cartesianToCartographic(v1, scratchCartographic2);
+ if (hasTopHeights) {
+ c1.height = topHeights[i];
+ }
+ hasAllSameHeights = hasAllSameHeights && c1.height === 0;
+
+ if (!latLonEquals(c0, c1)) {
+ cleanedPositions[index] = v1; // Shallow copy!
+ cleanedTopHeights[index] = c1.height;
+
+ if (hasBottomHeights) {
+ cleanedBottomHeights[index] = bottomHeights[i];
+ } else {
+ cleanedBottomHeights[index] = 0.0;
+ }
+ hasAllSameHeights =
+ hasAllSameHeights &&
+ cleanedTopHeights[index] === cleanedBottomHeights[index];
+
+ Matrix3.Cartographic.clone(c1, c0);
+ ++index;
+ } else if (c0.height < c1.height) {
+ // two adjacent positions are the same, so use whichever has the greater height
+ cleanedTopHeights[index - 1] = c1.height;
+ }
+ }
+
+ if (hasAllSameHeights || index < 2) {
+ return;
+ }
+
+ cleanedPositions.length = index;
+ cleanedTopHeights.length = index;
+ cleanedBottomHeights.length = index;
+
+ return {
+ positions: cleanedPositions,
+ topHeights: cleanedTopHeights,
+ bottomHeights: cleanedBottomHeights,
+ };
+ }
+
+ const positionsArrayScratch = new Array(2);
+ const heightsArrayScratch = new Array(2);
+ const generateArcOptionsScratch = {
+ positions: undefined,
+ height: undefined,
+ granularity: undefined,
+ ellipsoid: undefined,
+ };
+
+ /**
+ * @private
+ */
+ WallGeometryLibrary.computePositions = function (
+ ellipsoid,
+ wallPositions,
+ maximumHeights,
+ minimumHeights,
+ granularity,
+ duplicateCorners
+ ) {
+ const o = removeDuplicates(
+ ellipsoid,
+ wallPositions,
+ maximumHeights,
+ minimumHeights
+ );
+
+ if (!defaultValue.defined(o)) {
+ return;
+ }
+
+ wallPositions = o.positions;
+ maximumHeights = o.topHeights;
+ minimumHeights = o.bottomHeights;
+
+ const length = wallPositions.length;
+ const numCorners = length - 2;
+ let topPositions;
+ let bottomPositions;
+
+ const minDistance = Math.CesiumMath.chordLength(
+ granularity,
+ ellipsoid.maximumRadius
+ );
+
+ const generateArcOptions = generateArcOptionsScratch;
+ generateArcOptions.minDistance = minDistance;
+ generateArcOptions.ellipsoid = ellipsoid;
+
+ if (duplicateCorners) {
+ let count = 0;
+ let i;
+
+ for (i = 0; i < length - 1; i++) {
+ count +=
+ PolylinePipeline.PolylinePipeline.numberOfPoints(
+ wallPositions[i],
+ wallPositions[i + 1],
+ minDistance
+ ) + 1;
+ }
+
+ topPositions = new Float64Array(count * 3);
+ bottomPositions = new Float64Array(count * 3);
+
+ const generateArcPositions = positionsArrayScratch;
+ const generateArcHeights = heightsArrayScratch;
+ generateArcOptions.positions = generateArcPositions;
+ generateArcOptions.height = generateArcHeights;
+
+ let offset = 0;
+ for (i = 0; i < length - 1; i++) {
+ generateArcPositions[0] = wallPositions[i];
+ generateArcPositions[1] = wallPositions[i + 1];
+
+ generateArcHeights[0] = maximumHeights[i];
+ generateArcHeights[1] = maximumHeights[i + 1];
+
+ const pos = PolylinePipeline.PolylinePipeline.generateArc(generateArcOptions);
+ topPositions.set(pos, offset);
+
+ generateArcHeights[0] = minimumHeights[i];
+ generateArcHeights[1] = minimumHeights[i + 1];
+
+ bottomPositions.set(
+ PolylinePipeline.PolylinePipeline.generateArc(generateArcOptions),
+ offset
+ );
+
+ offset += pos.length;
+ }
+ } else {
+ generateArcOptions.positions = wallPositions;
+ generateArcOptions.height = maximumHeights;
+ topPositions = new Float64Array(
+ PolylinePipeline.PolylinePipeline.generateArc(generateArcOptions)
+ );
+
+ generateArcOptions.height = minimumHeights;
+ bottomPositions = new Float64Array(
+ PolylinePipeline.PolylinePipeline.generateArc(generateArcOptions)
+ );
+ }
+
+ return {
+ bottomPositions: bottomPositions,
+ topPositions: topPositions,
+ numCorners: numCorners,
+ };
+ };
+ var WallGeometryLibrary$1 = WallGeometryLibrary;
+
+ exports.WallGeometryLibrary = WallGeometryLibrary$1;
+
+}));
+//# sourceMappingURL=WallGeometryLibrary-4f405b12.js.map
diff --git a/examples/cesium/Workers/WallGeometryLibrary-4f405b12.js.map b/examples/cesium/Workers/WallGeometryLibrary-4f405b12.js.map
new file mode 100644
index 0000000..2adc665
--- /dev/null
+++ b/examples/cesium/Workers/WallGeometryLibrary-4f405b12.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"WallGeometryLibrary-4f405b12.js","sources":["../../../Source/Core/WallGeometryLibrary.js"],"sourcesContent":["import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport defined from \"./defined.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PolylinePipeline from \"./PolylinePipeline.js\";\r\n\r\n/**\r\n * @private\r\n */\r\nconst WallGeometryLibrary = {};\r\n\r\nfunction latLonEquals(c0, c1) {\r\n return (\r\n CesiumMath.equalsEpsilon(c0.latitude, c1.latitude, CesiumMath.EPSILON10) &&\r\n CesiumMath.equalsEpsilon(c0.longitude, c1.longitude, CesiumMath.EPSILON10)\r\n );\r\n}\r\n\r\nconst scratchCartographic1 = new Cartographic();\r\nconst scratchCartographic2 = new Cartographic();\r\nfunction removeDuplicates(ellipsoid, positions, topHeights, bottomHeights) {\r\n positions = arrayRemoveDuplicates(positions, Cartesian3.equalsEpsilon);\r\n\r\n const length = positions.length;\r\n if (length < 2) {\r\n return;\r\n }\r\n\r\n const hasBottomHeights = defined(bottomHeights);\r\n const hasTopHeights = defined(topHeights);\r\n\r\n const cleanedPositions = new Array(length);\r\n const cleanedTopHeights = new Array(length);\r\n const cleanedBottomHeights = new Array(length);\r\n\r\n const v0 = positions[0];\r\n cleanedPositions[0] = v0;\r\n\r\n const c0 = ellipsoid.cartesianToCartographic(v0, scratchCartographic1);\r\n if (hasTopHeights) {\r\n c0.height = topHeights[0];\r\n }\r\n\r\n cleanedTopHeights[0] = c0.height;\r\n\r\n if (hasBottomHeights) {\r\n cleanedBottomHeights[0] = bottomHeights[0];\r\n } else {\r\n cleanedBottomHeights[0] = 0.0;\r\n }\r\n\r\n const startTopHeight = cleanedTopHeights[0];\r\n const startBottomHeight = cleanedBottomHeights[0];\r\n let hasAllSameHeights = startTopHeight === startBottomHeight;\r\n\r\n let index = 1;\r\n for (let i = 1; i < length; ++i) {\r\n const v1 = positions[i];\r\n const c1 = ellipsoid.cartesianToCartographic(v1, scratchCartographic2);\r\n if (hasTopHeights) {\r\n c1.height = topHeights[i];\r\n }\r\n hasAllSameHeights = hasAllSameHeights && c1.height === 0;\r\n\r\n if (!latLonEquals(c0, c1)) {\r\n cleanedPositions[index] = v1; // Shallow copy!\r\n cleanedTopHeights[index] = c1.height;\r\n\r\n if (hasBottomHeights) {\r\n cleanedBottomHeights[index] = bottomHeights[i];\r\n } else {\r\n cleanedBottomHeights[index] = 0.0;\r\n }\r\n hasAllSameHeights =\r\n hasAllSameHeights &&\r\n cleanedTopHeights[index] === cleanedBottomHeights[index];\r\n\r\n Cartographic.clone(c1, c0);\r\n ++index;\r\n } else if (c0.height < c1.height) {\r\n // two adjacent positions are the same, so use whichever has the greater height\r\n cleanedTopHeights[index - 1] = c1.height;\r\n }\r\n }\r\n\r\n if (hasAllSameHeights || index < 2) {\r\n return;\r\n }\r\n\r\n cleanedPositions.length = index;\r\n cleanedTopHeights.length = index;\r\n cleanedBottomHeights.length = index;\r\n\r\n return {\r\n positions: cleanedPositions,\r\n topHeights: cleanedTopHeights,\r\n bottomHeights: cleanedBottomHeights,\r\n };\r\n}\r\n\r\nconst positionsArrayScratch = new Array(2);\r\nconst heightsArrayScratch = new Array(2);\r\nconst generateArcOptionsScratch = {\r\n positions: undefined,\r\n height: undefined,\r\n granularity: undefined,\r\n ellipsoid: undefined,\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nWallGeometryLibrary.computePositions = function (\r\n ellipsoid,\r\n wallPositions,\r\n maximumHeights,\r\n minimumHeights,\r\n granularity,\r\n duplicateCorners\r\n) {\r\n const o = removeDuplicates(\r\n ellipsoid,\r\n wallPositions,\r\n maximumHeights,\r\n minimumHeights\r\n );\r\n\r\n if (!defined(o)) {\r\n return;\r\n }\r\n\r\n wallPositions = o.positions;\r\n maximumHeights = o.topHeights;\r\n minimumHeights = o.bottomHeights;\r\n\r\n const length = wallPositions.length;\r\n const numCorners = length - 2;\r\n let topPositions;\r\n let bottomPositions;\r\n\r\n const minDistance = CesiumMath.chordLength(\r\n granularity,\r\n ellipsoid.maximumRadius\r\n );\r\n\r\n const generateArcOptions = generateArcOptionsScratch;\r\n generateArcOptions.minDistance = minDistance;\r\n generateArcOptions.ellipsoid = ellipsoid;\r\n\r\n if (duplicateCorners) {\r\n let count = 0;\r\n let i;\r\n\r\n for (i = 0; i < length - 1; i++) {\r\n count +=\r\n PolylinePipeline.numberOfPoints(\r\n wallPositions[i],\r\n wallPositions[i + 1],\r\n minDistance\r\n ) + 1;\r\n }\r\n\r\n topPositions = new Float64Array(count * 3);\r\n bottomPositions = new Float64Array(count * 3);\r\n\r\n const generateArcPositions = positionsArrayScratch;\r\n const generateArcHeights = heightsArrayScratch;\r\n generateArcOptions.positions = generateArcPositions;\r\n generateArcOptions.height = generateArcHeights;\r\n\r\n let offset = 0;\r\n for (i = 0; i < length - 1; i++) {\r\n generateArcPositions[0] = wallPositions[i];\r\n generateArcPositions[1] = wallPositions[i + 1];\r\n\r\n generateArcHeights[0] = maximumHeights[i];\r\n generateArcHeights[1] = maximumHeights[i + 1];\r\n\r\n const pos = PolylinePipeline.generateArc(generateArcOptions);\r\n topPositions.set(pos, offset);\r\n\r\n generateArcHeights[0] = minimumHeights[i];\r\n generateArcHeights[1] = minimumHeights[i + 1];\r\n\r\n bottomPositions.set(\r\n PolylinePipeline.generateArc(generateArcOptions),\r\n offset\r\n );\r\n\r\n offset += pos.length;\r\n }\r\n } else {\r\n generateArcOptions.positions = wallPositions;\r\n generateArcOptions.height = maximumHeights;\r\n topPositions = new Float64Array(\r\n PolylinePipeline.generateArc(generateArcOptions)\r\n );\r\n\r\n generateArcOptions.height = minimumHeights;\r\n bottomPositions = new Float64Array(\r\n PolylinePipeline.generateArc(generateArcOptions)\r\n );\r\n }\r\n\r\n return {\r\n bottomPositions: bottomPositions,\r\n topPositions: topPositions,\r\n numCorners: numCorners,\r\n };\r\n};\r\nexport default WallGeometryLibrary;\r\n"],"names":["CesiumMath","Cartographic","arrayRemoveDuplicates","Cartesian3","defined","PolylinePipeline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAOA;EACA;EACA;EACA,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B;EACA,SAAS,YAAY,CAAC,EAAE,EAAE,EAAE,EAAE;EAC9B,EAAE;EACF,IAAIA,eAAU,CAAC,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAEA,eAAU,CAAC,SAAS,CAAC;EAC5E,IAAIA,eAAU,CAAC,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,EAAEA,eAAU,CAAC,SAAS,CAAC;EAC9E,IAAI;EACJ,CAAC;AACD;EACA,MAAM,oBAAoB,GAAG,IAAIC,oBAAY,EAAE,CAAC;EAChD,MAAM,oBAAoB,GAAG,IAAIA,oBAAY,EAAE,CAAC;EAChD,SAAS,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE;EAC3E,EAAE,SAAS,GAAGC,2CAAqB,CAAC,SAAS,EAAEC,kBAAU,CAAC,aAAa,CAAC,CAAC;AACzE;EACA,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;EAClC,EAAE,IAAI,MAAM,GAAG,CAAC,EAAE;EAClB,IAAI,OAAO;EACX,GAAG;AACH;EACA,EAAE,MAAM,gBAAgB,GAAGC,oBAAO,CAAC,aAAa,CAAC,CAAC;EAClD,EAAE,MAAM,aAAa,GAAGA,oBAAO,CAAC,UAAU,CAA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,IAAI,YAAY,EAAE,YAAY;EAC9B,IAAI,UAAU,EAAE,UAAU;EAC1B,GAAG,CAAC;EACJ,CAAC,CAAC;AACF,8BAAe,mBAAmB;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/WebGLConstants-f27a5e29.js b/examples/cesium/Workers/WebGLConstants-f27a5e29.js
new file mode 100644
index 0000000..e2fa6e8
--- /dev/null
+++ b/examples/cesium/Workers/WebGLConstants-f27a5e29.js
@@ -0,0 +1,646 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports'], (function (exports) { 'use strict';
+
+ /**
+ * Enum containing WebGL Constant values by name.
+ * for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context
+ * (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}).
+ *
+ * These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/}
+ * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/}
+ * specifications.
+ *
+ * @enum {Number}
+ */
+ const WebGLConstants = {
+ DEPTH_BUFFER_BIT: 0x00000100,
+ STENCIL_BUFFER_BIT: 0x00000400,
+ COLOR_BUFFER_BIT: 0x00004000,
+ POINTS: 0x0000,
+ LINES: 0x0001,
+ LINE_LOOP: 0x0002,
+ LINE_STRIP: 0x0003,
+ TRIANGLES: 0x0004,
+ TRIANGLE_STRIP: 0x0005,
+ TRIANGLE_FAN: 0x0006,
+ ZERO: 0,
+ ONE: 1,
+ SRC_COLOR: 0x0300,
+ ONE_MINUS_SRC_COLOR: 0x0301,
+ SRC_ALPHA: 0x0302,
+ ONE_MINUS_SRC_ALPHA: 0x0303,
+ DST_ALPHA: 0x0304,
+ ONE_MINUS_DST_ALPHA: 0x0305,
+ DST_COLOR: 0x0306,
+ ONE_MINUS_DST_COLOR: 0x0307,
+ SRC_ALPHA_SATURATE: 0x0308,
+ FUNC_ADD: 0x8006,
+ BLEND_EQUATION: 0x8009,
+ BLEND_EQUATION_RGB: 0x8009, // same as BLEND_EQUATION
+ BLEND_EQUATION_ALPHA: 0x883d,
+ FUNC_SUBTRACT: 0x800a,
+ FUNC_REVERSE_SUBTRACT: 0x800b,
+ BLEND_DST_RGB: 0x80c8,
+ BLEND_SRC_RGB: 0x80c9,
+ BLEND_DST_ALPHA: 0x80ca,
+ BLEND_SRC_ALPHA: 0x80cb,
+ CONSTANT_COLOR: 0x8001,
+ ONE_MINUS_CONSTANT_COLOR: 0x8002,
+ CONSTANT_ALPHA: 0x8003,
+ ONE_MINUS_CONSTANT_ALPHA: 0x8004,
+ BLEND_COLOR: 0x8005,
+ ARRAY_BUFFER: 0x8892,
+ ELEMENT_ARRAY_BUFFER: 0x8893,
+ ARRAY_BUFFER_BINDING: 0x8894,
+ ELEMENT_ARRAY_BUFFER_BINDING: 0x8895,
+ STREAM_DRAW: 0x88e0,
+ STATIC_DRAW: 0x88e4,
+ DYNAMIC_DRAW: 0x88e8,
+ BUFFER_SIZE: 0x8764,
+ BUFFER_USAGE: 0x8765,
+ CURRENT_VERTEX_ATTRIB: 0x8626,
+ FRONT: 0x0404,
+ BACK: 0x0405,
+ FRONT_AND_BACK: 0x0408,
+ CULL_FACE: 0x0b44,
+ BLEND: 0x0be2,
+ DITHER: 0x0bd0,
+ STENCIL_TEST: 0x0b90,
+ DEPTH_TEST: 0x0b71,
+ SCISSOR_TEST: 0x0c11,
+ POLYGON_OFFSET_FILL: 0x8037,
+ SAMPLE_ALPHA_TO_COVERAGE: 0x809e,
+ SAMPLE_COVERAGE: 0x80a0,
+ NO_ERROR: 0,
+ INVALID_ENUM: 0x0500,
+ INVALID_VALUE: 0x0501,
+ INVALID_OPERATION: 0x0502,
+ OUT_OF_MEMORY: 0x0505,
+ CW: 0x0900,
+ CCW: 0x0901,
+ LINE_WIDTH: 0x0b21,
+ ALIASED_POINT_SIZE_RANGE: 0x846d,
+ ALIASED_LINE_WIDTH_RANGE: 0x846e,
+ CULL_FACE_MODE: 0x0b45,
+ FRONT_FACE: 0x0b46,
+ DEPTH_RANGE: 0x0b70,
+ DEPTH_WRITEMASK: 0x0b72,
+ DEPTH_CLEAR_VALUE: 0x0b73,
+ DEPTH_FUNC: 0x0b74,
+ STENCIL_CLEAR_VALUE: 0x0b91,
+ STENCIL_FUNC: 0x0b92,
+ STENCIL_FAIL: 0x0b94,
+ STENCIL_PASS_DEPTH_FAIL: 0x0b95,
+ STENCIL_PASS_DEPTH_PASS: 0x0b96,
+ STENCIL_REF: 0x0b97,
+ STENCIL_VALUE_MASK: 0x0b93,
+ STENCIL_WRITEMASK: 0x0b98,
+ STENCIL_BACK_FUNC: 0x8800,
+ STENCIL_BACK_FAIL: 0x8801,
+ STENCIL_BACK_PASS_DEPTH_FAIL: 0x8802,
+ STENCIL_BACK_PASS_DEPTH_PASS: 0x8803,
+ STENCIL_BACK_REF: 0x8ca3,
+ STENCIL_BACK_VALUE_MASK: 0x8ca4,
+ STENCIL_BACK_WRITEMASK: 0x8ca5,
+ VIEWPORT: 0x0ba2,
+ SCISSOR_BOX: 0x0c10,
+ COLOR_CLEAR_VALUE: 0x0c22,
+ COLOR_WRITEMASK: 0x0c23,
+ UNPACK_ALIGNMENT: 0x0cf5,
+ PACK_ALIGNMENT: 0x0d05,
+ MAX_TEXTURE_SIZE: 0x0d33,
+ MAX_VIEWPORT_DIMS: 0x0d3a,
+ SUBPIXEL_BITS: 0x0d50,
+ RED_BITS: 0x0d52,
+ GREEN_BITS: 0x0d53,
+ BLUE_BITS: 0x0d54,
+ ALPHA_BITS: 0x0d55,
+ DEPTH_BITS: 0x0d56,
+ STENCIL_BITS: 0x0d57,
+ POLYGON_OFFSET_UNITS: 0x2a00,
+ POLYGON_OFFSET_FACTOR: 0x8038,
+ TEXTURE_BINDING_2D: 0x8069,
+ SAMPLE_BUFFERS: 0x80a8,
+ SAMPLES: 0x80a9,
+ SAMPLE_COVERAGE_VALUE: 0x80aa,
+ SAMPLE_COVERAGE_INVERT: 0x80ab,
+ COMPRESSED_TEXTURE_FORMATS: 0x86a3,
+ DONT_CARE: 0x1100,
+ FASTEST: 0x1101,
+ NICEST: 0x1102,
+ GENERATE_MIPMAP_HINT: 0x8192,
+ BYTE: 0x1400,
+ UNSIGNED_BYTE: 0x1401,
+ SHORT: 0x1402,
+ UNSIGNED_SHORT: 0x1403,
+ INT: 0x1404,
+ UNSIGNED_INT: 0x1405,
+ FLOAT: 0x1406,
+ DEPTH_COMPONENT: 0x1902,
+ ALPHA: 0x1906,
+ RGB: 0x1907,
+ RGBA: 0x1908,
+ LUMINANCE: 0x1909,
+ LUMINANCE_ALPHA: 0x190a,
+ UNSIGNED_SHORT_4_4_4_4: 0x8033,
+ UNSIGNED_SHORT_5_5_5_1: 0x8034,
+ UNSIGNED_SHORT_5_6_5: 0x8363,
+ FRAGMENT_SHADER: 0x8b30,
+ VERTEX_SHADER: 0x8b31,
+ MAX_VERTEX_ATTRIBS: 0x8869,
+ MAX_VERTEX_UNIFORM_VECTORS: 0x8dfb,
+ MAX_VARYING_VECTORS: 0x8dfc,
+ MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0x8b4d,
+ MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0x8b4c,
+ MAX_TEXTURE_IMAGE_UNITS: 0x8872,
+ MAX_FRAGMENT_UNIFORM_VECTORS: 0x8dfd,
+ SHADER_TYPE: 0x8b4f,
+ DELETE_STATUS: 0x8b80,
+ LINK_STATUS: 0x8b82,
+ VALIDATE_STATUS: 0x8b83,
+ ATTACHED_SHADERS: 0x8b85,
+ ACTIVE_UNIFORMS: 0x8b86,
+ ACTIVE_ATTRIBUTES: 0x8b89,
+ SHADING_LANGUAGE_VERSION: 0x8b8c,
+ CURRENT_PROGRAM: 0x8b8d,
+ NEVER: 0x0200,
+ LESS: 0x0201,
+ EQUAL: 0x0202,
+ LEQUAL: 0x0203,
+ GREATER: 0x0204,
+ NOTEQUAL: 0x0205,
+ GEQUAL: 0x0206,
+ ALWAYS: 0x0207,
+ KEEP: 0x1e00,
+ REPLACE: 0x1e01,
+ INCR: 0x1e02,
+ DECR: 0x1e03,
+ INVERT: 0x150a,
+ INCR_WRAP: 0x8507,
+ DECR_WRAP: 0x8508,
+ VENDOR: 0x1f00,
+ RENDERER: 0x1f01,
+ VERSION: 0x1f02,
+ NEAREST: 0x2600,
+ LINEAR: 0x2601,
+ NEAREST_MIPMAP_NEAREST: 0x2700,
+ LINEAR_MIPMAP_NEAREST: 0x2701,
+ NEAREST_MIPMAP_LINEAR: 0x2702,
+ LINEAR_MIPMAP_LINEAR: 0x2703,
+ TEXTURE_MAG_FILTER: 0x2800,
+ TEXTURE_MIN_FILTER: 0x2801,
+ TEXTURE_WRAP_S: 0x2802,
+ TEXTURE_WRAP_T: 0x2803,
+ TEXTURE_2D: 0x0de1,
+ TEXTURE: 0x1702,
+ TEXTURE_CUBE_MAP: 0x8513,
+ TEXTURE_BINDING_CUBE_MAP: 0x8514,
+ TEXTURE_CUBE_MAP_POSITIVE_X: 0x8515,
+ TEXTURE_CUBE_MAP_NEGATIVE_X: 0x8516,
+ TEXTURE_CUBE_MAP_POSITIVE_Y: 0x8517,
+ TEXTURE_CUBE_MAP_NEGATIVE_Y: 0x8518,
+ TEXTURE_CUBE_MAP_POSITIVE_Z: 0x8519,
+ TEXTURE_CUBE_MAP_NEGATIVE_Z: 0x851a,
+ MAX_CUBE_MAP_TEXTURE_SIZE: 0x851c,
+ TEXTURE0: 0x84c0,
+ TEXTURE1: 0x84c1,
+ TEXTURE2: 0x84c2,
+ TEXTURE3: 0x84c3,
+ TEXTURE4: 0x84c4,
+ TEXTURE5: 0x84c5,
+ TEXTURE6: 0x84c6,
+ TEXTURE7: 0x84c7,
+ TEXTURE8: 0x84c8,
+ TEXTURE9: 0x84c9,
+ TEXTURE10: 0x84ca,
+ TEXTURE11: 0x84cb,
+ TEXTURE12: 0x84cc,
+ TEXTURE13: 0x84cd,
+ TEXTURE14: 0x84ce,
+ TEXTURE15: 0x84cf,
+ TEXTURE16: 0x84d0,
+ TEXTURE17: 0x84d1,
+ TEXTURE18: 0x84d2,
+ TEXTURE19: 0x84d3,
+ TEXTURE20: 0x84d4,
+ TEXTURE21: 0x84d5,
+ TEXTURE22: 0x84d6,
+ TEXTURE23: 0x84d7,
+ TEXTURE24: 0x84d8,
+ TEXTURE25: 0x84d9,
+ TEXTURE26: 0x84da,
+ TEXTURE27: 0x84db,
+ TEXTURE28: 0x84dc,
+ TEXTURE29: 0x84dd,
+ TEXTURE30: 0x84de,
+ TEXTURE31: 0x84df,
+ ACTIVE_TEXTURE: 0x84e0,
+ REPEAT: 0x2901,
+ CLAMP_TO_EDGE: 0x812f,
+ MIRRORED_REPEAT: 0x8370,
+ FLOAT_VEC2: 0x8b50,
+ FLOAT_VEC3: 0x8b51,
+ FLOAT_VEC4: 0x8b52,
+ INT_VEC2: 0x8b53,
+ INT_VEC3: 0x8b54,
+ INT_VEC4: 0x8b55,
+ BOOL: 0x8b56,
+ BOOL_VEC2: 0x8b57,
+ BOOL_VEC3: 0x8b58,
+ BOOL_VEC4: 0x8b59,
+ FLOAT_MAT2: 0x8b5a,
+ FLOAT_MAT3: 0x8b5b,
+ FLOAT_MAT4: 0x8b5c,
+ SAMPLER_2D: 0x8b5e,
+ SAMPLER_CUBE: 0x8b60,
+ VERTEX_ATTRIB_ARRAY_ENABLED: 0x8622,
+ VERTEX_ATTRIB_ARRAY_SIZE: 0x8623,
+ VERTEX_ATTRIB_ARRAY_STRIDE: 0x8624,
+ VERTEX_ATTRIB_ARRAY_TYPE: 0x8625,
+ VERTEX_ATTRIB_ARRAY_NORMALIZED: 0x886a,
+ VERTEX_ATTRIB_ARRAY_POINTER: 0x8645,
+ VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 0x889f,
+ IMPLEMENTATION_COLOR_READ_TYPE: 0x8b9a,
+ IMPLEMENTATION_COLOR_READ_FORMAT: 0x8b9b,
+ COMPILE_STATUS: 0x8b81,
+ LOW_FLOAT: 0x8df0,
+ MEDIUM_FLOAT: 0x8df1,
+ HIGH_FLOAT: 0x8df2,
+ LOW_INT: 0x8df3,
+ MEDIUM_INT: 0x8df4,
+ HIGH_INT: 0x8df5,
+ FRAMEBUFFER: 0x8d40,
+ RENDERBUFFER: 0x8d41,
+ RGBA4: 0x8056,
+ RGB5_A1: 0x8057,
+ RGB565: 0x8d62,
+ DEPTH_COMPONENT16: 0x81a5,
+ STENCIL_INDEX: 0x1901,
+ STENCIL_INDEX8: 0x8d48,
+ DEPTH_STENCIL: 0x84f9,
+ RENDERBUFFER_WIDTH: 0x8d42,
+ RENDERBUFFER_HEIGHT: 0x8d43,
+ RENDERBUFFER_INTERNAL_FORMAT: 0x8d44,
+ RENDERBUFFER_RED_SIZE: 0x8d50,
+ RENDERBUFFER_GREEN_SIZE: 0x8d51,
+ RENDERBUFFER_BLUE_SIZE: 0x8d52,
+ RENDERBUFFER_ALPHA_SIZE: 0x8d53,
+ RENDERBUFFER_DEPTH_SIZE: 0x8d54,
+ RENDERBUFFER_STENCIL_SIZE: 0x8d55,
+ FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 0x8cd0,
+ FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 0x8cd1,
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 0x8cd2,
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 0x8cd3,
+ COLOR_ATTACHMENT0: 0x8ce0,
+ DEPTH_ATTACHMENT: 0x8d00,
+ STENCIL_ATTACHMENT: 0x8d20,
+ DEPTH_STENCIL_ATTACHMENT: 0x821a,
+ NONE: 0,
+ FRAMEBUFFER_COMPLETE: 0x8cd5,
+ FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 0x8cd6,
+ FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 0x8cd7,
+ FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 0x8cd9,
+ FRAMEBUFFER_UNSUPPORTED: 0x8cdd,
+ FRAMEBUFFER_BINDING: 0x8ca6,
+ RENDERBUFFER_BINDING: 0x8ca7,
+ MAX_RENDERBUFFER_SIZE: 0x84e8,
+ INVALID_FRAMEBUFFER_OPERATION: 0x0506,
+ UNPACK_FLIP_Y_WEBGL: 0x9240,
+ UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241,
+ CONTEXT_LOST_WEBGL: 0x9242,
+ UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243,
+ BROWSER_DEFAULT_WEBGL: 0x9244,
+
+ // WEBGL_compressed_texture_s3tc
+ COMPRESSED_RGB_S3TC_DXT1_EXT: 0x83f0,
+ COMPRESSED_RGBA_S3TC_DXT1_EXT: 0x83f1,
+ COMPRESSED_RGBA_S3TC_DXT3_EXT: 0x83f2,
+ COMPRESSED_RGBA_S3TC_DXT5_EXT: 0x83f3,
+
+ // WEBGL_compressed_texture_pvrtc
+ COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 0x8c00,
+ COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 0x8c01,
+ COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 0x8c02,
+ COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 0x8c03,
+
+ // WEBGL_compressed_texture_astc
+ COMPRESSED_RGBA_ASTC_4x4_WEBGL: 0x93b0,
+
+ // WEBGL_compressed_texture_etc1
+ COMPRESSED_RGB_ETC1_WEBGL: 0x8d64,
+
+ // EXT_texture_compression_bptc
+ COMPRESSED_RGBA_BPTC_UNORM: 0x8e8c,
+
+ // EXT_color_buffer_half_float
+ HALF_FLOAT_OES: 0x8d61,
+
+ // Desktop OpenGL
+ DOUBLE: 0x140a,
+
+ // WebGL 2
+ READ_BUFFER: 0x0c02,
+ UNPACK_ROW_LENGTH: 0x0cf2,
+ UNPACK_SKIP_ROWS: 0x0cf3,
+ UNPACK_SKIP_PIXELS: 0x0cf4,
+ PACK_ROW_LENGTH: 0x0d02,
+ PACK_SKIP_ROWS: 0x0d03,
+ PACK_SKIP_PIXELS: 0x0d04,
+ COLOR: 0x1800,
+ DEPTH: 0x1801,
+ STENCIL: 0x1802,
+ RED: 0x1903,
+ RGB8: 0x8051,
+ RGBA8: 0x8058,
+ RGB10_A2: 0x8059,
+ TEXTURE_BINDING_3D: 0x806a,
+ UNPACK_SKIP_IMAGES: 0x806d,
+ UNPACK_IMAGE_HEIGHT: 0x806e,
+ TEXTURE_3D: 0x806f,
+ TEXTURE_WRAP_R: 0x8072,
+ MAX_3D_TEXTURE_SIZE: 0x8073,
+ UNSIGNED_INT_2_10_10_10_REV: 0x8368,
+ MAX_ELEMENTS_VERTICES: 0x80e8,
+ MAX_ELEMENTS_INDICES: 0x80e9,
+ TEXTURE_MIN_LOD: 0x813a,
+ TEXTURE_MAX_LOD: 0x813b,
+ TEXTURE_BASE_LEVEL: 0x813c,
+ TEXTURE_MAX_LEVEL: 0x813d,
+ MIN: 0x8007,
+ MAX: 0x8008,
+ DEPTH_COMPONENT24: 0x81a6,
+ MAX_TEXTURE_LOD_BIAS: 0x84fd,
+ TEXTURE_COMPARE_MODE: 0x884c,
+ TEXTURE_COMPARE_FUNC: 0x884d,
+ CURRENT_QUERY: 0x8865,
+ QUERY_RESULT: 0x8866,
+ QUERY_RESULT_AVAILABLE: 0x8867,
+ STREAM_READ: 0x88e1,
+ STREAM_COPY: 0x88e2,
+ STATIC_READ: 0x88e5,
+ STATIC_COPY: 0x88e6,
+ DYNAMIC_READ: 0x88e9,
+ DYNAMIC_COPY: 0x88ea,
+ MAX_DRAW_BUFFERS: 0x8824,
+ DRAW_BUFFER0: 0x8825,
+ DRAW_BUFFER1: 0x8826,
+ DRAW_BUFFER2: 0x8827,
+ DRAW_BUFFER3: 0x8828,
+ DRAW_BUFFER4: 0x8829,
+ DRAW_BUFFER5: 0x882a,
+ DRAW_BUFFER6: 0x882b,
+ DRAW_BUFFER7: 0x882c,
+ DRAW_BUFFER8: 0x882d,
+ DRAW_BUFFER9: 0x882e,
+ DRAW_BUFFER10: 0x882f,
+ DRAW_BUFFER11: 0x8830,
+ DRAW_BUFFER12: 0x8831,
+ DRAW_BUFFER13: 0x8832,
+ DRAW_BUFFER14: 0x8833,
+ DRAW_BUFFER15: 0x8834,
+ MAX_FRAGMENT_UNIFORM_COMPONENTS: 0x8b49,
+ MAX_VERTEX_UNIFORM_COMPONENTS: 0x8b4a,
+ SAMPLER_3D: 0x8b5f,
+ SAMPLER_2D_SHADOW: 0x8b62,
+ FRAGMENT_SHADER_DERIVATIVE_HINT: 0x8b8b,
+ PIXEL_PACK_BUFFER: 0x88eb,
+ PIXEL_UNPACK_BUFFER: 0x88ec,
+ PIXEL_PACK_BUFFER_BINDING: 0x88ed,
+ PIXEL_UNPACK_BUFFER_BINDING: 0x88ef,
+ FLOAT_MAT2x3: 0x8b65,
+ FLOAT_MAT2x4: 0x8b66,
+ FLOAT_MAT3x2: 0x8b67,
+ FLOAT_MAT3x4: 0x8b68,
+ FLOAT_MAT4x2: 0x8b69,
+ FLOAT_MAT4x3: 0x8b6a,
+ SRGB: 0x8c40,
+ SRGB8: 0x8c41,
+ SRGB8_ALPHA8: 0x8c43,
+ COMPARE_REF_TO_TEXTURE: 0x884e,
+ RGBA32F: 0x8814,
+ RGB32F: 0x8815,
+ RGBA16F: 0x881a,
+ RGB16F: 0x881b,
+ VERTEX_ATTRIB_ARRAY_INTEGER: 0x88fd,
+ MAX_ARRAY_TEXTURE_LAYERS: 0x88ff,
+ MIN_PROGRAM_TEXEL_OFFSET: 0x8904,
+ MAX_PROGRAM_TEXEL_OFFSET: 0x8905,
+ MAX_VARYING_COMPONENTS: 0x8b4b,
+ TEXTURE_2D_ARRAY: 0x8c1a,
+ TEXTURE_BINDING_2D_ARRAY: 0x8c1d,
+ R11F_G11F_B10F: 0x8c3a,
+ UNSIGNED_INT_10F_11F_11F_REV: 0x8c3b,
+ RGB9_E5: 0x8c3d,
+ UNSIGNED_INT_5_9_9_9_REV: 0x8c3e,
+ TRANSFORM_FEEDBACK_BUFFER_MODE: 0x8c7f,
+ MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: 0x8c80,
+ TRANSFORM_FEEDBACK_VARYINGS: 0x8c83,
+ TRANSFORM_FEEDBACK_BUFFER_START: 0x8c84,
+ TRANSFORM_FEEDBACK_BUFFER_SIZE: 0x8c85,
+ TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 0x8c88,
+ RASTERIZER_DISCARD: 0x8c89,
+ MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: 0x8c8a,
+ MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: 0x8c8b,
+ INTERLEAVED_ATTRIBS: 0x8c8c,
+ SEPARATE_ATTRIBS: 0x8c8d,
+ TRANSFORM_FEEDBACK_BUFFER: 0x8c8e,
+ TRANSFORM_FEEDBACK_BUFFER_BINDING: 0x8c8f,
+ RGBA32UI: 0x8d70,
+ RGB32UI: 0x8d71,
+ RGBA16UI: 0x8d76,
+ RGB16UI: 0x8d77,
+ RGBA8UI: 0x8d7c,
+ RGB8UI: 0x8d7d,
+ RGBA32I: 0x8d82,
+ RGB32I: 0x8d83,
+ RGBA16I: 0x8d88,
+ RGB16I: 0x8d89,
+ RGBA8I: 0x8d8e,
+ RGB8I: 0x8d8f,
+ RED_INTEGER: 0x8d94,
+ RGB_INTEGER: 0x8d98,
+ RGBA_INTEGER: 0x8d99,
+ SAMPLER_2D_ARRAY: 0x8dc1,
+ SAMPLER_2D_ARRAY_SHADOW: 0x8dc4,
+ SAMPLER_CUBE_SHADOW: 0x8dc5,
+ UNSIGNED_INT_VEC2: 0x8dc6,
+ UNSIGNED_INT_VEC3: 0x8dc7,
+ UNSIGNED_INT_VEC4: 0x8dc8,
+ INT_SAMPLER_2D: 0x8dca,
+ INT_SAMPLER_3D: 0x8dcb,
+ INT_SAMPLER_CUBE: 0x8dcc,
+ INT_SAMPLER_2D_ARRAY: 0x8dcf,
+ UNSIGNED_INT_SAMPLER_2D: 0x8dd2,
+ UNSIGNED_INT_SAMPLER_3D: 0x8dd3,
+ UNSIGNED_INT_SAMPLER_CUBE: 0x8dd4,
+ UNSIGNED_INT_SAMPLER_2D_ARRAY: 0x8dd7,
+ DEPTH_COMPONENT32F: 0x8cac,
+ DEPTH32F_STENCIL8: 0x8cad,
+ FLOAT_32_UNSIGNED_INT_24_8_REV: 0x8dad,
+ FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: 0x8210,
+ FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: 0x8211,
+ FRAMEBUFFER_ATTACHMENT_RED_SIZE: 0x8212,
+ FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: 0x8213,
+ FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 0x8214,
+ FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 0x8215,
+ FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: 0x8216,
+ FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 0x8217,
+ FRAMEBUFFER_DEFAULT: 0x8218,
+ UNSIGNED_INT_24_8: 0x84fa,
+ DEPTH24_STENCIL8: 0x88f0,
+ UNSIGNED_NORMALIZED: 0x8c17,
+ DRAW_FRAMEBUFFER_BINDING: 0x8ca6, // Same as FRAMEBUFFER_BINDING
+ READ_FRAMEBUFFER: 0x8ca8,
+ DRAW_FRAMEBUFFER: 0x8ca9,
+ READ_FRAMEBUFFER_BINDING: 0x8caa,
+ RENDERBUFFER_SAMPLES: 0x8cab,
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: 0x8cd4,
+ MAX_COLOR_ATTACHMENTS: 0x8cdf,
+ COLOR_ATTACHMENT1: 0x8ce1,
+ COLOR_ATTACHMENT2: 0x8ce2,
+ COLOR_ATTACHMENT3: 0x8ce3,
+ COLOR_ATTACHMENT4: 0x8ce4,
+ COLOR_ATTACHMENT5: 0x8ce5,
+ COLOR_ATTACHMENT6: 0x8ce6,
+ COLOR_ATTACHMENT7: 0x8ce7,
+ COLOR_ATTACHMENT8: 0x8ce8,
+ COLOR_ATTACHMENT9: 0x8ce9,
+ COLOR_ATTACHMENT10: 0x8cea,
+ COLOR_ATTACHMENT11: 0x8ceb,
+ COLOR_ATTACHMENT12: 0x8cec,
+ COLOR_ATTACHMENT13: 0x8ced,
+ COLOR_ATTACHMENT14: 0x8cee,
+ COLOR_ATTACHMENT15: 0x8cef,
+ FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 0x8d56,
+ MAX_SAMPLES: 0x8d57,
+ HALF_FLOAT: 0x140b,
+ RG: 0x8227,
+ RG_INTEGER: 0x8228,
+ R8: 0x8229,
+ RG8: 0x822b,
+ R16F: 0x822d,
+ R32F: 0x822e,
+ RG16F: 0x822f,
+ RG32F: 0x8230,
+ R8I: 0x8231,
+ R8UI: 0x8232,
+ R16I: 0x8233,
+ R16UI: 0x8234,
+ R32I: 0x8235,
+ R32UI: 0x8236,
+ RG8I: 0x8237,
+ RG8UI: 0x8238,
+ RG16I: 0x8239,
+ RG16UI: 0x823a,
+ RG32I: 0x823b,
+ RG32UI: 0x823c,
+ VERTEX_ARRAY_BINDING: 0x85b5,
+ R8_SNORM: 0x8f94,
+ RG8_SNORM: 0x8f95,
+ RGB8_SNORM: 0x8f96,
+ RGBA8_SNORM: 0x8f97,
+ SIGNED_NORMALIZED: 0x8f9c,
+ COPY_READ_BUFFER: 0x8f36,
+ COPY_WRITE_BUFFER: 0x8f37,
+ COPY_READ_BUFFER_BINDING: 0x8f36, // Same as COPY_READ_BUFFER
+ COPY_WRITE_BUFFER_BINDING: 0x8f37, // Same as COPY_WRITE_BUFFER
+ UNIFORM_BUFFER: 0x8a11,
+ UNIFORM_BUFFER_BINDING: 0x8a28,
+ UNIFORM_BUFFER_START: 0x8a29,
+ UNIFORM_BUFFER_SIZE: 0x8a2a,
+ MAX_VERTEX_UNIFORM_BLOCKS: 0x8a2b,
+ MAX_FRAGMENT_UNIFORM_BLOCKS: 0x8a2d,
+ MAX_COMBINED_UNIFORM_BLOCKS: 0x8a2e,
+ MAX_UNIFORM_BUFFER_BINDINGS: 0x8a2f,
+ MAX_UNIFORM_BLOCK_SIZE: 0x8a30,
+ MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: 0x8a31,
+ MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: 0x8a33,
+ UNIFORM_BUFFER_OFFSET_ALIGNMENT: 0x8a34,
+ ACTIVE_UNIFORM_BLOCKS: 0x8a36,
+ UNIFORM_TYPE: 0x8a37,
+ UNIFORM_SIZE: 0x8a38,
+ UNIFORM_BLOCK_INDEX: 0x8a3a,
+ UNIFORM_OFFSET: 0x8a3b,
+ UNIFORM_ARRAY_STRIDE: 0x8a3c,
+ UNIFORM_MATRIX_STRIDE: 0x8a3d,
+ UNIFORM_IS_ROW_MAJOR: 0x8a3e,
+ UNIFORM_BLOCK_BINDING: 0x8a3f,
+ UNIFORM_BLOCK_DATA_SIZE: 0x8a40,
+ UNIFORM_BLOCK_ACTIVE_UNIFORMS: 0x8a42,
+ UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: 0x8a43,
+ UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: 0x8a44,
+ UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: 0x8a46,
+ INVALID_INDEX: 0xffffffff,
+ MAX_VERTEX_OUTPUT_COMPONENTS: 0x9122,
+ MAX_FRAGMENT_INPUT_COMPONENTS: 0x9125,
+ MAX_SERVER_WAIT_TIMEOUT: 0x9111,
+ OBJECT_TYPE: 0x9112,
+ SYNC_CONDITION: 0x9113,
+ SYNC_STATUS: 0x9114,
+ SYNC_FLAGS: 0x9115,
+ SYNC_FENCE: 0x9116,
+ SYNC_GPU_COMMANDS_COMPLETE: 0x9117,
+ UNSIGNALED: 0x9118,
+ SIGNALED: 0x9119,
+ ALREADY_SIGNALED: 0x911a,
+ TIMEOUT_EXPIRED: 0x911b,
+ CONDITION_SATISFIED: 0x911c,
+ WAIT_FAILED: 0x911d,
+ SYNC_FLUSH_COMMANDS_BIT: 0x00000001,
+ VERTEX_ATTRIB_ARRAY_DIVISOR: 0x88fe,
+ ANY_SAMPLES_PASSED: 0x8c2f,
+ ANY_SAMPLES_PASSED_CONSERVATIVE: 0x8d6a,
+ SAMPLER_BINDING: 0x8919,
+ RGB10_A2UI: 0x906f,
+ INT_2_10_10_10_REV: 0x8d9f,
+ TRANSFORM_FEEDBACK: 0x8e22,
+ TRANSFORM_FEEDBACK_PAUSED: 0x8e23,
+ TRANSFORM_FEEDBACK_ACTIVE: 0x8e24,
+ TRANSFORM_FEEDBACK_BINDING: 0x8e25,
+ COMPRESSED_R11_EAC: 0x9270,
+ COMPRESSED_SIGNED_R11_EAC: 0x9271,
+ COMPRESSED_RG11_EAC: 0x9272,
+ COMPRESSED_SIGNED_RG11_EAC: 0x9273,
+ COMPRESSED_RGB8_ETC2: 0x9274,
+ COMPRESSED_SRGB8_ETC2: 0x9275,
+ COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9276,
+ COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9277,
+ COMPRESSED_RGBA8_ETC2_EAC: 0x9278,
+ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 0x9279,
+ TEXTURE_IMMUTABLE_FORMAT: 0x912f,
+ MAX_ELEMENT_INDEX: 0x8d6b,
+ TEXTURE_IMMUTABLE_LEVELS: 0x82df,
+
+ // Extensions
+ MAX_TEXTURE_MAX_ANISOTROPY_EXT: 0x84ff,
+ };
+ var WebGLConstants$1 = Object.freeze(WebGLConstants);
+
+ exports.WebGLConstants = WebGLConstants$1;
+
+}));
+//# sourceMappingURL=WebGLConstants-f27a5e29.js.map
diff --git a/examples/cesium/Workers/WebGLConstants-f27a5e29.js.map b/examples/cesium/Workers/WebGLConstants-f27a5e29.js.map
new file mode 100644
index 0000000..c769158
--- /dev/null
+++ b/examples/cesium/Workers/WebGLConstants-f27a5e29.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"WebGLConstants-f27a5e29.js","sources":["../../../Source/Core/WebGLConstants.js"],"sourcesContent":["/**\r\n * Enum containing WebGL Constant values by name.\r\n * for use without an active WebGL context, or in cases where certain constants are unavailable using the WebGL context\r\n * (For example, in [Safari 9]{@link https://github.com/CesiumGS/cesium/issues/2989}).\r\n *\r\n * These match the constants from the [WebGL 1.0]{@link https://www.khronos.org/registry/webgl/specs/latest/1.0/}\r\n * and [WebGL 2.0]{@link https://www.khronos.org/registry/webgl/specs/latest/2.0/}\r\n * specifications.\r\n *\r\n * @enum {Number}\r\n */\r\nconst WebGLConstants = {\r\n DEPTH_BUFFER_BIT: 0x00000100,\r\n STENCIL_BUFFER_BIT: 0x00000400,\r\n COLOR_BUFFER_BIT: 0x00004000,\r\n POINTS: 0x0000,\r\n LINES: 0x0001,\r\n LINE_LOOP: 0x0002,\r\n LINE_STRIP: 0x0003,\r\n TRIANGLES: 0x0004,\r\n TRIANGLE_STRIP: 0x0005,\r\n TRIANGLE_FAN: 0x0006,\r\n ZERO: 0,\r\n ONE: 1,\r\n SRC_COLOR: 0x0300,\r\n ONE_MINUS_SRC_COLOR: 0x0301,\r\n SRC_ALPHA: 0x0302,\r\n ONE_MINUS_SRC_ALPHA: 0x0303,\r\n DST_ALPHA: 0x0304,\r\n ONE_MINUS_DST_ALPHA: 0x0305,\r\n DST_COLOR: 0x0306,\r\n ONE_MINUS_DST_COLOR: 0x0307,\r\n SRC_ALPHA_SATURATE: 0x0308,\r\n FUNC_ADD: 0x8006,\r\n BLEND_EQUATION: 0x8009,\r\n BLEND_EQUATION_RGB: 0x8009, // same as BLEND_EQUATION\r\n BLEND_EQUATION_ALPHA: 0x883d,\r\n FUNC_SUBTRACT: 0x800a,\r\n FUNC_REVERSE_SUBTRACT: 0x800b,\r\n BLEND_DST_RGB: 0x80c8,\r\n BLEND_SRC_RGB: 0x80c9,\r\n BLEND_DST_ALPHA: 0x80ca,\r\n BLEND_SRC_ALPHA: 0x80cb,\r\n CONSTANT_COLOR: 0x8001,\r\n ONE_MINUS_CONSTANT_COLOR: 0x8002,\r\n CONSTANT_ALPHA: 0x8003,\r\n ONE_MINUS_CONSTANT_ALPHA: 0x8004,\r\n BLEND_COLOR: 0x8005,\r\n ARRAY_BUFFER: 0x8892,\r\n ELEMENT_ARRAY_BUFFER: 0x8893,\r\n ARRAY_BUFFER_BINDING: 0x8894,\r\n ELEMENT_ARRAY_BUFFER_BINDING: 0x8895,\r\n STREAM_DRAW: 0x88e0,\r\n STATIC_DRAW: 0x88e4,\r\n DYNAMIC_DRAW: 0x88e8,\r\n BUFFER_SIZE: 0x8764,\r\n BUFFER_USAGE: 0x8765,\r\n CURRENT_VERTEX_ATTRIB: 0x8626,\r\n FRONT: 0x0404,\r\n BACK: 0x0405,\r\n FRONT_AND_BACK: 0x0408,\r\n CULL_FACE: 0x0b44,\r\n BLEND: 0x0be2,\r\n DITHER: 0x0bd0,\r\n STENCIL_TEST: 0x0b90,\r\n DEPTH_TEST: 0x0b71,\r\n SCISSOR_TEST: 0x0c11,\r\n POLYGON_OFFSET_FILL: 0x8037,\r\n SAMPLE_ALPHA_TO_COVERAGE: 0x809e,\r\n SAMPLE_COVERAGE: 0x80a0,\r\n NO_ERROR: 0,\r\n INVALID_ENUM: 0x0500,\r\n INVALID_VALUE: 0x0501,\r\n INVALID_OPERATION: 0x0502,\r\n OUT_OF_MEMORY: 0x0505,\r\n CW: 0x0900,\r\n CCW: 0x0901,\r\n LINE_WIDTH: 0x0b21,\r\n ALIASED_POINT_SIZE_RANGE: 0x846d,\r\n ALIASED_LINE_WIDTH_RANGE: 0x846e,\r\n CULL_FACE_MODE: 0x0b45,\r\n FRONT_FACE: 0x0b46,\r\n DEPTH_RANGE: 0x0b70,\r\n DEPTH_WRITEMASK: 0x0b72,\r\n DEPTH_CLEAR_VALUE: 0x0b73,\r\n DEPTH_FUNC: 0x0b74,\r\n STENCIL_CLEAR_VALUE: 0x0b91,\r\n STENCIL_FUNC: 0x0b92,\r\n STENCIL_FAIL: 0x0b94,\r\n STENCIL_PASS_DEPTH_FAIL: 0x0b95,\r\n STENCIL_PASS_DEPTH_PASS: 0x0b96,\r\n STENCIL_REF: 0x0b97,\r\n STENCIL_VALUE_MASK: 0x0b93,\r\n STENCIL_WRITEMASK: 0x0b98,\r\n STENCIL_BACK_FUNC: 0x8800,\r\n STENCIL_BACK_FAIL: 0x8801,\r\n STENCIL_BACK_PASS_DEPTH_FAIL: 0x8802,\r\n STENCIL_BACK_PASS_DEPTH_PASS: 0x8803,\r\n STENCIL_BACK_REF: 0x8ca3,\r\n STENCIL_BACK_VALUE_MASK: 0x8ca4,\r\n STENCIL_BACK_WRITEMASK: 0x8ca5,\r\n VIEWPORT: 0x0ba2,\r\n SCISSOR_BOX: 0x0c10,\r\n COLOR_CLEAR_VALUE: 0x0c22,\r\n COLOR_WRITEMASK: 0x0c23,\r\n UNPACK_ALIGNMENT: 0x0cf5,\r\n PACK_ALIGNMENT: 0x0d05,\r\n MAX_TEXTURE_SIZE: 0x0d33,\r\n MAX_VIEWPORT_DIMS: 0x0d3a,\r\n SUBPIXEL_BITS: 0x0d50,\r\n RED_BITS: 0x0d52,\r\n GREEN_BITS: 0x0d53,\r\n BLUE_BITS: 0x0d54,\r\n ALPHA_BITS: 0x0d55,\r\n DEPTH_BITS: 0x0d56,\r\n STENCIL_BITS: 0x0d57,\r\n POLYGON_OFFSET_UNITS: 0x2a00,\r\n POLYGON_OFFSET_FACTOR: 0x8038,\r\n TEXTURE_BINDING_2D: 0x8069,\r\n SAMPLE_BUFFERS: 0x80a8,\r\n SAMPLES: 0x80a9,\r\n SAMPLE_COVERAGE_VALUE: 0x80aa,\r\n SAMPLE_COVERAGE_INVERT: 0x80ab,\r\n COMPRESSED_TEXTURE_FORMATS: 0x86a3,\r\n DONT_CARE: 0x1100,\r\n FASTEST: 0x1101,\r\n NICEST: 0x1102,\r\n GENERATE_MIPMAP_HINT: 0x8192,\r\n BYTE: 0x1400,\r\n UNSIGNED_BYTE: 0x1401,\r\n SHORT: 0x1402,\r\n UNSIGNED_SHORT: 0x1403,\r\n INT: 0x1404,\r\n UNSIGNED_INT: 0x1405,\r\n FLOAT: 0x1406,\r\n DEPTH_COMPONENT: 0x1902,\r\n ALPHA: 0x1906,\r\n RGB: 0x1907,\r\n RGBA: 0x1908,\r\n LUMINANCE: 0x1909,\r\n LUMINANCE_ALPHA: 0x190a,\r\n UNSIGNED_SHORT_4_4_4_4: 0x8033,\r\n UNSIGNED_SHORT_5_5_5_1: 0x8034,\r\n UNSIGNED_SHORT_5_6_5: 0x8363,\r\n FRAGMENT_SHADER: 0x8b30,\r\n VERTEX_SHADER: 0x8b31,\r\n MAX_VERTEX_ATTRIBS: 0x8869,\r\n MAX_VERTEX_UNIFORM_VECTORS: 0x8dfb,\r\n MAX_VARYING_VECTORS: 0x8dfc,\r\n MAX_COMBINED_TEXTURE_IMAGE_UNITS: 0x8b4d,\r\n MAX_VERTEX_TEXTURE_IMAGE_UNITS: 0x8b4c,\r\n MAX_TEXTURE_IMAGE_UNITS: 0x8872,\r\n MAX_FRAGMENT_UNIFORM_VECTORS: 0x8dfd,\r\n SHADER_TYPE: 0x8b4f,\r\n DELETE_STATUS: 0x8b80,\r\n LINK_STATUS: 0x8b82,\r\n VALIDATE_STATUS: 0x8b83,\r\n ATTACHED_SHADERS: 0x8b85,\r\n ACTIVE_UNIFORMS: 0x8b86,\r\n ACTIVE_ATTRIBUTES: 0x8b89,\r\n SHADING_LANGUAGE_VERSION: 0x8b8c,\r\n CURRENT_PROGRAM: 0x8b8d,\r\n NEVER: 0x0200,\r\n LESS: 0x0201,\r\n EQUAL: 0x0202,\r\n LEQUAL: 0x0203,\r\n GREATER: 0x0204,\r\n NOTEQUAL: 0x0205,\r\n GEQUAL: 0x0206,\r\n ALWAYS: 0x0207,\r\n KEEP: 0x1e00,\r\n REPLACE: 0x1e01,\r\n INCR: 0x1e02,\r\n DECR: 0x1e03,\r\n INVERT: 0x150a,\r\n INCR_WRAP: 0x8507,\r\n DECR_WRAP: 0x8508,\r\n VENDOR: 0x1f00,\r\n RENDERER: 0x1f01,\r\n VERSION: 0x1f02,\r\n NEAREST: 0x2600,\r\n LINEAR: 0x2601,\r\n NEAREST_MIPMAP_NEAREST: 0x2700,\r\n LINEAR_MIPMAP_NEAREST: 0x2701,\r\n NEAREST_MIPMAP_LINEAR: 0x2702,\r\n LINEAR_MIPMAP_LINEAR: 0x2703,\r\n TEXTURE_MAG_FILTER: 0x2800,\r\n TEXTURE_MIN_FILTER: 0x2801,\r\n TEXTURE_WRAP_S: 0x2802,\r\n TEXTURE_WRAP_T: 0x2803,\r\n TEXTURE_2D: 0x0de1,\r\n TEXTURE: 0x1702,\r\n TEXTURE_CUBE_MAP: 0x8513,\r\n TEXTURE_BINDING_CUBE_MAP: 0x8514,\r\n TEXTURE_CUBE_MAP_POSITIVE_X: 0x8515,\r\n TEXTURE_CUBE_MAP_NEGATIVE_X: 0x8516,\r\n TEXTURE_CUBE_MAP_POSITIVE_Y: 0x8517,\r\n TEXTURE_CUBE_MAP_NEGATIVE_Y: 0x8518,\r\n TEXTURE_CUBE_MAP_POSITIVE_Z: 0x8519,\r\n TEXTURE_CUBE_MAP_NEGATIVE_Z: 0x851a,\r\n MAX_CUBE_MAP_TEXTURE_SIZE: 0x851c,\r\n TEXTURE0: 0x84c0,\r\n TEXTURE1: 0x84c1,\r\n TEXTURE2: 0x84c2,\r\n TEXTURE3: 0x84c3,\r\n TEXTURE4: 0x84c4,\r\n TEXTURE5: 0x84c5,\r\n TEXTURE6: 0x84c6,\r\n TEXTURE7: 0x84c7,\r\n TEXTURE8: 0x84c8,\r\n TEXTURE9: 0x84c9,\r\n TEXTURE10: 0x84ca,\r\n TEXTURE11: 0x84cb,\r\n TEXTURE12: 0x84cc,\r\n TEXTURE13: 0x84cd,\r\n TEXTURE14: 0x84ce,\r\n TEXTURE15: 0x84cf,\r\n TEXTURE16: 0x84d0,\r\n TEXTURE17: 0x84d1,\r\n TEXTURE18: 0x84d2,\r\n TEXTURE19: 0x84d3,\r\n TEXTURE20: 0x84d4,\r\n TEXTURE21: 0x84d5,\r\n TEXTURE22: 0x84d6,\r\n TEXTURE23: 0x84d7,\r\n TEXTURE24: 0x84d8,\r\n TEXTURE25: 0x84d9,\r\n TEXTURE26: 0x84da,\r\n TEXTURE27: 0x84db,\r\n TEXTURE28: 0x84dc,\r\n TEXTURE29: 0x84dd,\r\n TEXTURE30: 0x84de,\r\n TEXTURE31: 0x84df,\r\n ACTIVE_TEXTURE: 0x84e0,\r\n REPEAT: 0x2901,\r\n CLAMP_TO_EDGE: 0x812f,\r\n MIRRORED_REPEAT: 0x8370,\r\n FLOAT_VEC2: 0x8b50,\r\n FLOAT_VEC3: 0x8b51,\r\n FLOAT_VEC4: 0x8b52,\r\n INT_VEC2: 0x8b53,\r\n INT_VEC3: 0x8b54,\r\n INT_VEC4: 0x8b55,\r\n BOOL: 0x8b56,\r\n BOOL_VEC2: 0x8b57,\r\n BOOL_VEC3: 0x8b58,\r\n BOOL_VEC4: 0x8b59,\r\n FLOAT_MAT2: 0x8b5a,\r\n FLOAT_MAT3: 0x8b5b,\r\n FLOAT_MAT4: 0x8b5c,\r\n SAMPLER_2D: 0x8b5e,\r\n SAMPLER_CUBE: 0x8b60,\r\n VERTEX_ATTRIB_ARRAY_ENABLED: 0x8622,\r\n VERTEX_ATTRIB_ARRAY_SIZE: 0x8623,\r\n VERTEX_ATTRIB_ARRAY_STRIDE: 0x8624,\r\n VERTEX_ATTRIB_ARRAY_TYPE: 0x8625,\r\n VERTEX_ATTRIB_ARRAY_NORMALIZED: 0x886a,\r\n VERTEX_ATTRIB_ARRAY_POINTER: 0x8645,\r\n VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 0x889f,\r\n IMPLEMENTATION_COLOR_READ_TYPE: 0x8b9a,\r\n IMPLEMENTATION_COLOR_READ_FORMAT: 0x8b9b,\r\n COMPILE_STATUS: 0x8b81,\r\n LOW_FLOAT: 0x8df0,\r\n MEDIUM_FLOAT: 0x8df1,\r\n HIGH_FLOAT: 0x8df2,\r\n LOW_INT: 0x8df3,\r\n MEDIUM_INT: 0x8df4,\r\n HIGH_INT: 0x8df5,\r\n FRAMEBUFFER: 0x8d40,\r\n RENDERBUFFER: 0x8d41,\r\n RGBA4: 0x8056,\r\n RGB5_A1: 0x8057,\r\n RGB565: 0x8d62,\r\n DEPTH_COMPONENT16: 0x81a5,\r\n STENCIL_INDEX: 0x1901,\r\n STENCIL_INDEX8: 0x8d48,\r\n DEPTH_STENCIL: 0x84f9,\r\n RENDERBUFFER_WIDTH: 0x8d42,\r\n RENDERBUFFER_HEIGHT: 0x8d43,\r\n RENDERBUFFER_INTERNAL_FORMAT: 0x8d44,\r\n RENDERBUFFER_RED_SIZE: 0x8d50,\r\n RENDERBUFFER_GREEN_SIZE: 0x8d51,\r\n RENDERBUFFER_BLUE_SIZE: 0x8d52,\r\n RENDERBUFFER_ALPHA_SIZE: 0x8d53,\r\n RENDERBUFFER_DEPTH_SIZE: 0x8d54,\r\n RENDERBUFFER_STENCIL_SIZE: 0x8d55,\r\n FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 0x8cd0,\r\n FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 0x8cd1,\r\n FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 0x8cd2,\r\n FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 0x8cd3,\r\n COLOR_ATTACHMENT0: 0x8ce0,\r\n DEPTH_ATTACHMENT: 0x8d00,\r\n STENCIL_ATTACHMENT: 0x8d20,\r\n DEPTH_STENCIL_ATTACHMENT: 0x821a,\r\n NONE: 0,\r\n FRAMEBUFFER_COMPLETE: 0x8cd5,\r\n FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 0x8cd6,\r\n FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 0x8cd7,\r\n FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 0x8cd9,\r\n FRAMEBUFFER_UNSUPPORTED: 0x8cdd,\r\n FRAMEBUFFER_BINDING: 0x8ca6,\r\n RENDERBUFFER_BINDING: 0x8ca7,\r\n MAX_RENDERBUFFER_SIZE: 0x84e8,\r\n INVALID_FRAMEBUFFER_OPERATION: 0x0506,\r\n UNPACK_FLIP_Y_WEBGL: 0x9240,\r\n UNPACK_PREMULTIPLY_ALPHA_WEBGL: 0x9241,\r\n CONTEXT_LOST_WEBGL: 0x9242,\r\n UNPACK_COLORSPACE_CONVERSION_WEBGL: 0x9243,\r\n BROWSER_DEFAULT_WEBGL: 0x9244,\r\n\r\n // WEBGL_compressed_texture_s3tc\r\n COMPRESSED_RGB_S3TC_DXT1_EXT: 0x83f0,\r\n COMPRESSED_RGBA_S3TC_DXT1_EXT: 0x83f1,\r\n COMPRESSED_RGBA_S3TC_DXT3_EXT: 0x83f2,\r\n COMPRESSED_RGBA_S3TC_DXT5_EXT: 0x83f3,\r\n\r\n // WEBGL_compressed_texture_pvrtc\r\n COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 0x8c00,\r\n COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 0x8c01,\r\n COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 0x8c02,\r\n COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 0x8c03,\r\n\r\n // WEBGL_compressed_texture_astc\r\n COMPRESSED_RGBA_ASTC_4x4_WEBGL: 0x93b0,\r\n\r\n // WEBGL_compressed_texture_etc1\r\n COMPRESSED_RGB_ETC1_WEBGL: 0x8d64,\r\n\r\n // EXT_texture_compression_bptc\r\n COMPRESSED_RGBA_BPTC_UNORM: 0x8e8c,\r\n\r\n // EXT_color_buffer_half_float\r\n HALF_FLOAT_OES: 0x8d61,\r\n\r\n // Desktop OpenGL\r\n DOUBLE: 0x140a,\r\n\r\n // WebGL 2\r\n READ_BUFFER: 0x0c02,\r\n UNPACK_ROW_LENGTH: 0x0cf2,\r\n UNPACK_SKIP_ROWS: 0x0cf3,\r\n UNPACK_SKIP_PIXELS: 0x0cf4,\r\n PACK_ROW_LENGTH: 0x0d02,\r\n PACK_SKIP_ROWS: 0x0d03,\r\n PACK_SKIP_PIXELS: 0x0d04,\r\n COLOR: 0x1800,\r\n DEPTH: 0x1801,\r\n STENCIL: 0x1802,\r\n RED: 0x1903,\r\n RGB8: 0x8051,\r\n RGBA8: 0x8058,\r\n RGB10_A2: 0x8059,\r\n TEXTURE_BINDING_3D: 0x806a,\r\n UNPACK_SKIP_IMAGES: 0x806d,\r\n UNPACK_IMAGE_HEIGHT: 0x806e,\r\n TEXTURE_3D: 0x806f,\r\n TEXTURE_WRAP_R: 0x8072,\r\n MAX_3D_TEXTURE_SIZE: 0x8073,\r\n UNSIGNED_INT_2_10_10_10_REV: 0x8368,\r\n MAX_ELEMENTS_VERTICES: 0x80e8,\r\n MAX_ELEMENTS_INDICES: 0x80e9,\r\n TEXTURE_MIN_LOD: 0x813a,\r\n TEXTURE_MAX_LOD: 0x813b,\r\n TEXTURE_BASE_LEVEL: 0x813c,\r\n TEXTURE_MAX_LEVEL: 0x813d,\r\n MIN: 0x8007,\r\n MAX: 0x8008,\r\n DEPTH_COMPONENT24: 0x81a6,\r\n MAX_TEXTURE_LOD_BIAS: 0x84fd,\r\n TEXTURE_COMPARE_MODE: 0x884c,\r\n TEXTURE_COMPARE_FUNC: 0x884d,\r\n CURRENT_QUERY: 0x8865,\r\n QUERY_RESULT: 0x8866,\r\n QUERY_RESULT_AVAILABLE: 0x8867,\r\n STREAM_READ: 0x88e1,\r\n STREAM_COPY: 0x88e2,\r\n STATIC_READ: 0x88e5,\r\n STATIC_COPY: 0x88e6,\r\n DYNAMIC_READ: 0x88e9,\r\n DYNAMIC_COPY: 0x88ea,\r\n MAX_DRAW_BUFFERS: 0x8824,\r\n DRAW_BUFFER0: 0x8825,\r\n DRAW_BUFFER1: 0x8826,\r\n DRAW_BUFFER2: 0x8827,\r\n DRAW_BUFFER3: 0x8828,\r\n DRAW_BUFFER4: 0x8829,\r\n DRAW_BUFFER5: 0x882a,\r\n DRAW_BUFFER6: 0x882b,\r\n DRAW_BUFFER7: 0x882c,\r\n DRAW_BUFFER8: 0x882d,\r\n DRAW_BUFFER9: 0x882e,\r\n DRAW_BUFFER10: 0x882f,\r\n DRAW_BUFFER11: 0x8830,\r\n DRAW_BUFFER12: 0x8831,\r\n DRAW_BUFFER13: 0x8832,\r\n DRAW_BUFFER14: 0x8833,\r\n DRAW_BUFFER15: 0x8834,\r\n MAX_FRAGMENT_UNIFORM_COMPONENTS: 0x8b49,\r\n MAX_VERTEX_UNIFORM_COMPONENTS: 0x8b4a,\r\n SAMPLER_3D: 0x8b5f,\r\n SAMPLER_2D_SHADOW: 0x8b62,\r\n FRAGMENT_SHADER_DERIVATIVE_HINT: 0x8b8b,\r\n PIXEL_PACK_BUFFER: 0x88eb,\r\n PIXEL_UNPACK_BUFFER: 0x88ec,\r\n PIXEL_PACK_BUFFER_BINDING: 0x88ed,\r\n PIXEL_UNPACK_BUFFER_BINDING: 0x88ef,\r\n FLOAT_MAT2x3: 0x8b65,\r\n FLOAT_MAT2x4: 0x8b66,\r\n FLOAT_MAT3x2: 0x8b67,\r\n FLOAT_MAT3x4: 0x8b68,\r\n FLOAT_MAT4x2: 0x8b69,\r\n FLOAT_MAT4x3: 0x8b6a,\r\n SRGB: 0x8c40,\r\n SRGB8: 0x8c41,\r\n SRGB8_ALPHA8: 0x8c43,\r\n COMPARE_REF_TO_TEXTURE: 0x884e,\r\n RGBA32F: 0x8814,\r\n RGB32F: 0x8815,\r\n RGBA16F: 0x881a,\r\n RGB16F: 0x881b,\r\n VERTEX_ATTRIB_ARRAY_INTEGER: 0x88fd,\r\n MAX_ARRAY_TEXTURE_LAYERS: 0x88ff,\r\n MIN_PROGRAM_TEXEL_OFFSET: 0x8904,\r\n MAX_PROGRAM_TEXEL_OFFSET: 0x8905,\r\n MAX_VARYING_COMPONENTS: 0x8b4b,\r\n TEXTURE_2D_ARRAY: 0x8c1a,\r\n TEXTURE_BINDING_2D_ARRAY: 0x8c1d,\r\n R11F_G11F_B10F: 0x8c3a,\r\n UNSIGNED_INT_10F_11F_11F_REV: 0x8c3b,\r\n RGB9_E5: 0x8c3d,\r\n UNSIGNED_INT_5_9_9_9_REV: 0x8c3e,\r\n TRANSFORM_FEEDBACK_BUFFER_MODE: 0x8c7f,\r\n MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: 0x8c80,\r\n TRANSFORM_FEEDBACK_VARYINGS: 0x8c83,\r\n TRANSFORM_FEEDBACK_BUFFER_START: 0x8c84,\r\n TRANSFORM_FEEDBACK_BUFFER_SIZE: 0x8c85,\r\n TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 0x8c88,\r\n RASTERIZER_DISCARD: 0x8c89,\r\n MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: 0x8c8a,\r\n MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: 0x8c8b,\r\n INTERLEAVED_ATTRIBS: 0x8c8c,\r\n SEPARATE_ATTRIBS: 0x8c8d,\r\n TRANSFORM_FEEDBACK_BUFFER: 0x8c8e,\r\n TRANSFORM_FEEDBACK_BUFFER_BINDING: 0x8c8f,\r\n RGBA32UI: 0x8d70,\r\n RGB32UI: 0x8d71,\r\n RGBA16UI: 0x8d76,\r\n RGB16UI: 0x8d77,\r\n RGBA8UI: 0x8d7c,\r\n RGB8UI: 0x8d7d,\r\n RGBA32I: 0x8d82,\r\n RGB32I: 0x8d83,\r\n RGBA16I: 0x8d88,\r\n RGB16I: 0x8d89,\r\n RGBA8I: 0x8d8e,\r\n RGB8I: 0x8d8f,\r\n RED_INTEGER: 0x8d94,\r\n RGB_INTEGER: 0x8d98,\r\n RGBA_INTEGER: 0x8d99,\r\n SAMPLER_2D_ARRAY: 0x8dc1,\r\n SAMPLER_2D_ARRAY_SHADOW: 0x8dc4,\r\n SAMPLER_CUBE_SHADOW: 0x8dc5,\r\n UNSIGNED_INT_VEC2: 0x8dc6,\r\n UNSIGNED_INT_VEC3: 0x8dc7,\r\n UNSIGNED_INT_VEC4: 0x8dc8,\r\n INT_SAMPLER_2D: 0x8dca,\r\n INT_SAMPLER_3D: 0x8dcb,\r\n INT_SAMPLER_CUBE: 0x8dcc,\r\n INT_SAMPLER_2D_ARRAY: 0x8dcf,\r\n UNSIGNED_INT_SAMPLER_2D: 0x8dd2,\r\n UNSIGNED_INT_SAMPLER_3D: 0x8dd3,\r\n UNSIGNED_INT_SAMPLER_CUBE: 0x8dd4,\r\n UNSIGNED_INT_SAMPLER_2D_ARRAY: 0x8dd7,\r\n DEPTH_COMPONENT32F: 0x8cac,\r\n DEPTH32F_STENCIL8: 0x8cad,\r\n FLOAT_32_UNSIGNED_INT_24_8_REV: 0x8dad,\r\n FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: 0x8210,\r\n FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: 0x8211,\r\n FRAMEBUFFER_ATTACHMENT_RED_SIZE: 0x8212,\r\n FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: 0x8213,\r\n FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 0x8214,\r\n FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 0x8215,\r\n FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: 0x8216,\r\n FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 0x8217,\r\n FRAMEBUFFER_DEFAULT: 0x8218,\r\n UNSIGNED_INT_24_8: 0x84fa,\r\n DEPTH24_STENCIL8: 0x88f0,\r\n UNSIGNED_NORMALIZED: 0x8c17,\r\n DRAW_FRAMEBUFFER_BINDING: 0x8ca6, // Same as FRAMEBUFFER_BINDING\r\n READ_FRAMEBUFFER: 0x8ca8,\r\n DRAW_FRAMEBUFFER: 0x8ca9,\r\n READ_FRAMEBUFFER_BINDING: 0x8caa,\r\n RENDERBUFFER_SAMPLES: 0x8cab,\r\n FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: 0x8cd4,\r\n MAX_COLOR_ATTACHMENTS: 0x8cdf,\r\n COLOR_ATTACHMENT1: 0x8ce1,\r\n COLOR_ATTACHMENT2: 0x8ce2,\r\n COLOR_ATTACHMENT3: 0x8ce3,\r\n COLOR_ATTACHMENT4: 0x8ce4,\r\n COLOR_ATTACHMENT5: 0x8ce5,\r\n COLOR_ATTACHMENT6: 0x8ce6,\r\n COLOR_ATTACHMENT7: 0x8ce7,\r\n COLOR_ATTACHMENT8: 0x8ce8,\r\n COLOR_ATTACHMENT9: 0x8ce9,\r\n COLOR_ATTACHMENT10: 0x8cea,\r\n COLOR_ATTACHMENT11: 0x8ceb,\r\n COLOR_ATTACHMENT12: 0x8cec,\r\n COLOR_ATTACHMENT13: 0x8ced,\r\n COLOR_ATTACHMENT14: 0x8cee,\r\n COLOR_ATTACHMENT15: 0x8cef,\r\n FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 0x8d56,\r\n MAX_SAMPLES: 0x8d57,\r\n HALF_FLOAT: 0x140b,\r\n RG: 0x8227,\r\n RG_INTEGER: 0x8228,\r\n R8: 0x8229,\r\n RG8: 0x822b,\r\n R16F: 0x822d,\r\n R32F: 0x822e,\r\n RG16F: 0x822f,\r\n RG32F: 0x8230,\r\n R8I: 0x8231,\r\n R8UI: 0x8232,\r\n R16I: 0x8233,\r\n R16UI: 0x8234,\r\n R32I: 0x8235,\r\n R32UI: 0x8236,\r\n RG8I: 0x8237,\r\n RG8UI: 0x8238,\r\n RG16I: 0x8239,\r\n RG16UI: 0x823a,\r\n RG32I: 0x823b,\r\n RG32UI: 0x823c,\r\n VERTEX_ARRAY_BINDING: 0x85b5,\r\n R8_SNORM: 0x8f94,\r\n RG8_SNORM: 0x8f95,\r\n RGB8_SNORM: 0x8f96,\r\n RGBA8_SNORM: 0x8f97,\r\n SIGNED_NORMALIZED: 0x8f9c,\r\n COPY_READ_BUFFER: 0x8f36,\r\n COPY_WRITE_BUFFER: 0x8f37,\r\n COPY_READ_BUFFER_BINDING: 0x8f36, // Same as COPY_READ_BUFFER\r\n COPY_WRITE_BUFFER_BINDING: 0x8f37, // Same as COPY_WRITE_BUFFER\r\n UNIFORM_BUFFER: 0x8a11,\r\n UNIFORM_BUFFER_BINDING: 0x8a28,\r\n UNIFORM_BUFFER_START: 0x8a29,\r\n UNIFORM_BUFFER_SIZE: 0x8a2a,\r\n MAX_VERTEX_UNIFORM_BLOCKS: 0x8a2b,\r\n MAX_FRAGMENT_UNIFORM_BLOCKS: 0x8a2d,\r\n MAX_COMBINED_UNIFORM_BLOCKS: 0x8a2e,\r\n MAX_UNIFORM_BUFFER_BINDINGS: 0x8a2f,\r\n MAX_UNIFORM_BLOCK_SIZE: 0x8a30,\r\n MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: 0x8a31,\r\n MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: 0x8a33,\r\n UNIFORM_BUFFER_OFFSET_ALIGNMENT: 0x8a34,\r\n ACTIVE_UNIFORM_BLOCKS: 0x8a36,\r\n UNIFORM_TYPE: 0x8a37,\r\n UNIFORM_SIZE: 0x8a38,\r\n UNIFORM_BLOCK_INDEX: 0x8a3a,\r\n UNIFORM_OFFSET: 0x8a3b,\r\n UNIFORM_ARRAY_STRIDE: 0x8a3c,\r\n UNIFORM_MATRIX_STRIDE: 0x8a3d,\r\n UNIFORM_IS_ROW_MAJOR: 0x8a3e,\r\n UNIFORM_BLOCK_BINDING: 0x8a3f,\r\n UNIFORM_BLOCK_DATA_SIZE: 0x8a40,\r\n UNIFORM_BLOCK_ACTIVE_UNIFORMS: 0x8a42,\r\n UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: 0x8a43,\r\n UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: 0x8a44,\r\n UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: 0x8a46,\r\n INVALID_INDEX: 0xffffffff,\r\n MAX_VERTEX_OUTPUT_COMPONENTS: 0x9122,\r\n MAX_FRAGMENT_INPUT_COMPONENTS: 0x9125,\r\n MAX_SERVER_WAIT_TIMEOUT: 0x9111,\r\n OBJECT_TYPE: 0x9112,\r\n SYNC_CONDITION: 0x9113,\r\n SYNC_STATUS: 0x9114,\r\n SYNC_FLAGS: 0x9115,\r\n SYNC_FENCE: 0x9116,\r\n SYNC_GPU_COMMANDS_COMPLETE: 0x9117,\r\n UNSIGNALED: 0x9118,\r\n SIGNALED: 0x9119,\r\n ALREADY_SIGNALED: 0x911a,\r\n TIMEOUT_EXPIRED: 0x911b,\r\n CONDITION_SATISFIED: 0x911c,\r\n WAIT_FAILED: 0x911d,\r\n SYNC_FLUSH_COMMANDS_BIT: 0x00000001,\r\n VERTEX_ATTRIB_ARRAY_DIVISOR: 0x88fe,\r\n ANY_SAMPLES_PASSED: 0x8c2f,\r\n ANY_SAMPLES_PASSED_CONSERVATIVE: 0x8d6a,\r\n SAMPLER_BINDING: 0x8919,\r\n RGB10_A2UI: 0x906f,\r\n INT_2_10_10_10_REV: 0x8d9f,\r\n TRANSFORM_FEEDBACK: 0x8e22,\r\n TRANSFORM_FEEDBACK_PAUSED: 0x8e23,\r\n TRANSFORM_FEEDBACK_ACTIVE: 0x8e24,\r\n TRANSFORM_FEEDBACK_BINDING: 0x8e25,\r\n COMPRESSED_R11_EAC: 0x9270,\r\n COMPRESSED_SIGNED_R11_EAC: 0x9271,\r\n COMPRESSED_RG11_EAC: 0x9272,\r\n COMPRESSED_SIGNED_RG11_EAC: 0x9273,\r\n COMPRESSED_RGB8_ETC2: 0x9274,\r\n COMPRESSED_SRGB8_ETC2: 0x9275,\r\n COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9276,\r\n COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9277,\r\n COMPRESSED_RGBA8_ETC2_EAC: 0x9278,\r\n COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 0x9279,\r\n TEXTURE_IMMUTABLE_FORMAT: 0x912f,\r\n MAX_ELEMENT_INDEX: 0x8d6b,\r\n TEXTURE_IMMUTABLE_LEVELS: 0x82df,\r\n\r\n // Extensions\r\n MAX_TEXTURE_MAX_ANISOTROPY_EXT: 0x84ff,\r\n};\r\nexport default Object.freeze(WebGLConstants);\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,cAAc,GAAG;EACvB,EAAE,gBAAgB,EAAE,UAAU;EAC9B,EAAE,kBAAkB,EAAE,UAAU;EAChC,EAAE,gBAAgB,EAAE,UAAU;EAC9B,EAAE,MAAM,EAAE,MAAM;EAChB,EAAE,KAAK,EAAE,MAAM;EACf,EAAE,SAAS,EAAE,MAAM;EACnB,EAAE,UAAU,EAAE,MAAM;EACpB,EAAE,SAAS,EAAE,MAAM;EACnB,EAAE,cAAc,EAAE,MAAM;EACxB,EAAE,YAAY,EAAE,MAAM;EACtB,EAAE,IAAI,EAAE,CAAC;EACT,EAAE,GAAG,EAAE,CAAC;EACR,EAAE,SAAS,EAAE,MAAM;EACnB,EAAE,mBAAmB,EAAE,MAAM;EAC7B,EAAE,SAAS,EAAE,MAAM;EACnB,EAAE,mBAAmB,EAAE,MAAM;EAC7B,EAAE,SAAS,EAAE,MAAM;EACnB,EAAE,mBAAmB,EAAE,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EACpB,EAAE,kBAAkB,EAAE,MAAM;EAC5B,EAAE,kBAAkB,EAAE,MAAM;EAC5B,EAAE,yBAAyB,EAAE,MAAM;EACnC,EAAE,yBAAyB,EAAE,MAAM;EACnC,EAAE,0BAA0B,EAAE,MAAM;EACpC,EAAE,kBAAkB,EAAE,MAAM;EAC5B,EAAE,yBAAyB,EAAE,MAAM;EACnC,EAAE,mBAAmB,EAAE,MAAM;EAC7B,EAAE,0BAA0B,EAAE,MAAM;EACpC,EAAE,oBAAoB,EAAE,MAAM;EAC9B,EAAE,qBAAqB,EAAE,MAAM;EAC/B,EAAE,wCAAwC,EAAE,MAAM;EAClD,EAAE,yCAAyC,EAAE,MAAM;EACnD,EAAE,yBAAyB,EAAE,MAAM;EACnC,EAAE,gCAAgC,EAAE,MAAM;EAC1C,EAAE,wBAAwB,EAAE,MAAM;EAClC,EAAE,iBAAiB,EAAE,MAAM;EAC3B,EAAE,wBAAwB,EAAE,MAAM;AAClC;EACA;EACA,EAAE,8BAA8B,EAAE,MAAM;EACxC,CAAC,CAAC;AACF,yBAAe,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/WebMercatorProjection-306f7acc.js b/examples/cesium/Workers/WebMercatorProjection-306f7acc.js
new file mode 100644
index 0000000..158322b
--- /dev/null
+++ b/examples/cesium/Workers/WebMercatorProjection-306f7acc.js
@@ -0,0 +1,177 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Matrix3-f22b0303', './defaultValue-0ab18f7d', './Check-d10e5f2e', './Math-9be8b918'], (function (exports, Matrix3, defaultValue, Check, Math$1) { 'use strict';
+
+ /**
+ * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This
+ * projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using
+ * the spherical (rather than ellipsoidal) equations.
+ *
+ * @alias WebMercatorProjection
+ * @constructor
+ *
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.
+ *
+ * @see GeographicProjection
+ */
+ function WebMercatorProjection(ellipsoid) {
+ this._ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+ this._semimajorAxis = this._ellipsoid.maximumRadius;
+ this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;
+ }
+
+ Object.defineProperties(WebMercatorProjection.prototype, {
+ /**
+ * Gets the {@link Ellipsoid}.
+ *
+ * @memberof WebMercatorProjection.prototype
+ *
+ * @type {Ellipsoid}
+ * @readonly
+ */
+ ellipsoid: {
+ get: function () {
+ return this._ellipsoid;
+ },
+ },
+ });
+
+ /**
+ * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude
+ * in the range -PI/2 to PI/2.
+ *
+ * @param {Number} mercatorAngle The angle to convert.
+ * @returns {Number} The geodetic latitude in radians.
+ */
+ WebMercatorProjection.mercatorAngleToGeodeticLatitude = function (
+ mercatorAngle
+ ) {
+ return Math$1.CesiumMath.PI_OVER_TWO - 2.0 * Math.atan(Math.exp(-mercatorAngle));
+ };
+
+ /**
+ * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator
+ * angle in the range -PI to PI.
+ *
+ * @param {Number} latitude The geodetic latitude in radians.
+ * @returns {Number} The Mercator angle.
+ */
+ WebMercatorProjection.geodeticLatitudeToMercatorAngle = function (latitude) {
+ // Clamp the latitude coordinate to the valid Mercator bounds.
+ if (latitude > WebMercatorProjection.MaximumLatitude) {
+ latitude = WebMercatorProjection.MaximumLatitude;
+ } else if (latitude < -WebMercatorProjection.MaximumLatitude) {
+ latitude = -WebMercatorProjection.MaximumLatitude;
+ }
+ const sinLatitude = Math.sin(latitude);
+ return 0.5 * Math.log((1.0 + sinLatitude) / (1.0 - sinLatitude));
+ };
+
+ /**
+ * The maximum latitude (both North and South) supported by a Web Mercator
+ * (EPSG:3857) projection. Technically, the Mercator projection is defined
+ * for any latitude up to (but not including) 90 degrees, but it makes sense
+ * to cut it off sooner because it grows exponentially with increasing latitude.
+ * The logic behind this particular cutoff value, which is the one used by
+ * Google Maps, Bing Maps, and Esri, is that it makes the projection
+ * square. That is, the rectangle is equal in the X and Y directions.
+ *
+ * The constant value is computed by calling:
+ * WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)
+ *
+ * @type {Number}
+ */
+ WebMercatorProjection.MaximumLatitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(
+ Math.PI
+ );
+
+ /**
+ * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator
+ * X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height
+ * is copied unmodified to the Z coordinate.
+ *
+ * @param {Cartographic} cartographic The cartographic coordinates in radians.
+ * @param {Cartesian3} [result] The instance to which to copy the result, or undefined if a
+ * new instance should be created.
+ * @returns {Cartesian3} The equivalent web mercator X, Y, Z coordinates, in meters.
+ */
+ WebMercatorProjection.prototype.project = function (cartographic, result) {
+ const semimajorAxis = this._semimajorAxis;
+ const x = cartographic.longitude * semimajorAxis;
+ const y =
+ WebMercatorProjection.geodeticLatitudeToMercatorAngle(
+ cartographic.latitude
+ ) * semimajorAxis;
+ const z = cartographic.height;
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3.Cartesian3(x, y, z);
+ }
+
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+ };
+
+ /**
+ * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}
+ * containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the
+ * height.
+ *
+ * @param {Cartesian3} cartesian The web mercator Cartesian position to unrproject with height (z) in meters.
+ * @param {Cartographic} [result] The instance to which to copy the result, or undefined if a
+ * new instance should be created.
+ * @returns {Cartographic} The equivalent cartographic coordinates.
+ */
+ WebMercatorProjection.prototype.unproject = function (cartesian, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(cartesian)) {
+ throw new Check.DeveloperError("cartesian is required");
+ }
+ //>>includeEnd('debug');
+
+ const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;
+ const longitude = cartesian.x * oneOverEarthSemimajorAxis;
+ const latitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(
+ cartesian.y * oneOverEarthSemimajorAxis
+ );
+ const height = cartesian.z;
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix3.Cartographic(longitude, latitude, height);
+ }
+
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = height;
+ return result;
+ };
+
+ exports.WebMercatorProjection = WebMercatorProjection;
+
+}));
+//# sourceMappingURL=WebMercatorProjection-306f7acc.js.map
diff --git a/examples/cesium/Workers/WebMercatorProjection-306f7acc.js.map b/examples/cesium/Workers/WebMercatorProjection-306f7acc.js.map
new file mode 100644
index 0000000..eb06b30
--- /dev/null
+++ b/examples/cesium/Workers/WebMercatorProjection-306f7acc.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"WebMercatorProjection-306f7acc.js","sources":["../../../Source/Core/WebMercatorProjection.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\n/**\r\n * The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. This\r\n * projection use longitude and latitude expressed with the WGS84 and transforms them to Mercator using\r\n * the spherical (rather than ellipsoidal) equations.\r\n *\r\n * @alias WebMercatorProjection\r\n * @constructor\r\n *\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.\r\n *\r\n * @see GeographicProjection\r\n */\r\nfunction WebMercatorProjection(ellipsoid) {\r\n this._ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n this._semimajorAxis = this._ellipsoid.maximumRadius;\r\n this._oneOverSemimajorAxis = 1.0 / this._semimajorAxis;\r\n}\r\n\r\nObject.defineProperties(WebMercatorProjection.prototype, {\r\n /**\r\n * Gets the {@link Ellipsoid}.\r\n *\r\n * @memberof WebMercatorProjection.prototype\r\n *\r\n * @type {Ellipsoid}\r\n * @readonly\r\n */\r\n ellipsoid: {\r\n get: function () {\r\n return this._ellipsoid;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude\r\n * in the range -PI/2 to PI/2.\r\n *\r\n * @param {Number} mercatorAngle The angle to convert.\r\n * @returns {Number} The geodetic latitude in radians.\r\n */\r\nWebMercatorProjection.mercatorAngleToGeodeticLatitude = function (\r\n mercatorAngle\r\n) {\r\n return CesiumMath.PI_OVER_TWO - 2.0 * Math.atan(Math.exp(-mercatorAngle));\r\n};\r\n\r\n/**\r\n * Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator\r\n * angle in the range -PI to PI.\r\n *\r\n * @param {Number} latitude The geodetic latitude in radians.\r\n * @returns {Number} The Mercator angle.\r\n */\r\nWebMercatorProjection.geodeticLatitudeToMercatorAngle = function (latitude) {\r\n // Clamp the latitude coordinate to the valid Mercator bounds.\r\n if (latitude > WebMercatorProjection.MaximumLatitude) {\r\n latitude = WebMercatorProjection.MaximumLatitude;\r\n } else if (latitude < -WebMercatorProjection.MaximumLatitude) {\r\n latitude = -WebMercatorProjection.MaximumLatitude;\r\n }\r\n const sinLatitude = Math.sin(latitude);\r\n return 0.5 * Math.log((1.0 + sinLatitude) / (1.0 - sinLatitude));\r\n};\r\n\r\n/**\r\n * The maximum latitude (both North and South) supported by a Web Mercator\r\n * (EPSG:3857) projection. Technically, the Mercator projection is defined\r\n * for any latitude up to (but not including) 90 degrees, but it makes sense\r\n * to cut it off sooner because it grows exponentially with increasing latitude.\r\n * The logic behind this particular cutoff value, which is the one used by\r\n * Google Maps, Bing Maps, and Esri, is that it makes the projection\r\n * square. That is, the rectangle is equal in the X and Y directions.\r\n *\r\n * The constant value is computed by calling:\r\n * WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI)\r\n *\r\n * @type {Number}\r\n */\r\nWebMercatorProjection.MaximumLatitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(\r\n Math.PI\r\n);\r\n\r\n/**\r\n * Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator\r\n * X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height\r\n * is copied unmodified to the Z coordinate.\r\n *\r\n * @param {Cartographic} cartographic The cartographic coordinates in radians.\r\n * @param {Cartesian3} [result] The instance to which to copy the result, or undefined if a\r\n * new instance should be created.\r\n * @returns {Cartesian3} The equivalent web mercator X, Y, Z coordinates, in meters.\r\n */\r\nWebMercatorProjection.prototype.project = function (cartographic, result) {\r\n const semimajorAxis = this._semimajorAxis;\r\n const x = cartographic.longitude * semimajorAxis;\r\n const y =\r\n WebMercatorProjection.geodeticLatitudeToMercatorAngle(\r\n cartographic.latitude\r\n ) * semimajorAxis;\r\n const z = cartographic.height;\r\n\r\n if (!defined(result)) {\r\n return new Cartesian3(x, y, z);\r\n }\r\n\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n return result;\r\n};\r\n\r\n/**\r\n * Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}\r\n * containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the\r\n * height.\r\n *\r\n * @param {Cartesian3} cartesian The web mercator Cartesian position to unrproject with height (z) in meters.\r\n * @param {Cartographic} [result] The instance to which to copy the result, or undefined if a\r\n * new instance should be created.\r\n * @returns {Cartographic} The equivalent cartographic coordinates.\r\n */\r\nWebMercatorProjection.prototype.unproject = function (cartesian, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(cartesian)) {\r\n throw new DeveloperError(\"cartesian is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;\r\n const longitude = cartesian.x * oneOverEarthSemimajorAxis;\r\n const latitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(\r\n cartesian.y * oneOverEarthSemimajorAxis\r\n );\r\n const height = cartesian.z;\r\n\r\n if (!defined(result)) {\r\n return new Cartographic(longitude, latitude, height);\r\n }\r\n\r\n result.longitude = longitude;\r\n result.latitude = latitude;\r\n result.height = height;\r\n return result;\r\n};\r\nexport default WebMercatorProjection;\r\n"],"names":["defaultValue","Ellipsoid","CesiumMath","defined","Cartesian3","DeveloperError","Cartographic"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,qBAAqB,CAAC,SAAS,EAAE;EAC1C,EAAE,IAAI,CAAC,UAAU,GAAGA,yBAAY,CAAC,SAAS,EAAEC,iBAAS,CAAC,KAAK,CAAC,CAAC;EAC7D,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;EACtD,EAAE,IAAI,CAAC,qBAAqB,GAAG,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC;EACzD,CAAC;AACD;EACA,MAAM,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,SAAS,EAAE;EACzD;EACA;EACA;EACA;EACA;EACA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AAC,CAAC;AAC7B;EACA,EAAE,IAAI,CAACF,oBAAO,CAAC,MAAM,CAAC,EAAE;EACxB,IAAI,OAAO,IAAIG,oBAAY,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;EACzD,GAAG;AACH;EACA,EAAE,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;EAC/B,EAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;EAC7B,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;EACzB,EAAE,OAAO,MAAM,CAAC;EAChB,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/arrayRemoveDuplicates-c3526030.js b/examples/cesium/Workers/arrayRemoveDuplicates-c3526030.js
new file mode 100644
index 0000000..14326ed
--- /dev/null
+++ b/examples/cesium/Workers/arrayRemoveDuplicates-c3526030.js
@@ -0,0 +1,155 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Math-9be8b918'], (function (exports, Check, defaultValue, Math) { 'use strict';
+
+ const removeDuplicatesEpsilon = Math.CesiumMath.EPSILON10;
+
+ /**
+ * Removes adjacent duplicate values in an array of values.
+ *
+ * @param {Array.<*>} [values] The array of values.
+ * @param {Function} equalsEpsilon Function to compare values with an epsilon. Boolean equalsEpsilon(left, right, epsilon).
+ * @param {Boolean} [wrapAround=false] Compare the last value in the array against the first value. If they are equal, the last value is removed.
+ * @param {Array.} [removedIndices=undefined] Store the indices that correspond to the duplicate items removed from the array, if there were any.
+ * @returns {Array.<*>|undefined} A new array of values with no adjacent duplicate values or the input array if no duplicates were found.
+ *
+ * @example
+ * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0), (1.0, 1.0, 1.0)]
+ * const values = [
+ * new Cesium.Cartesian3(1.0, 1.0, 1.0),
+ * new Cesium.Cartesian3(1.0, 1.0, 1.0),
+ * new Cesium.Cartesian3(2.0, 2.0, 2.0),
+ * new Cesium.Cartesian3(3.0, 3.0, 3.0),
+ * new Cesium.Cartesian3(1.0, 1.0, 1.0)];
+ * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon);
+ *
+ * @example
+ * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0)]
+ * const values = [
+ * new Cesium.Cartesian3(1.0, 1.0, 1.0),
+ * new Cesium.Cartesian3(1.0, 1.0, 1.0),
+ * new Cesium.Cartesian3(2.0, 2.0, 2.0),
+ * new Cesium.Cartesian3(3.0, 3.0, 3.0),
+ * new Cesium.Cartesian3(1.0, 1.0, 1.0)];
+ * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon, true);
+ *
+ * @example
+ * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0)]
+ * // removedIndices will be equal to [1, 3, 5]
+ * const values = [
+ * new Cesium.Cartesian3(1.0, 1.0, 1.0),
+ * new Cesium.Cartesian3(1.0, 1.0, 1.0),
+ * new Cesium.Cartesian3(2.0, 2.0, 2.0),
+ * new Cesium.Cartesian3(2.0, 2.0, 2.0),
+ * new Cesium.Cartesian3(3.0, 3.0, 3.0),
+ * new Cesium.Cartesian3(1.0, 1.0, 1.0)];
+ * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon, true);
+ * @private
+ */
+ function arrayRemoveDuplicates(
+ values,
+ equalsEpsilon,
+ wrapAround,
+ removedIndices
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("equalsEpsilon", equalsEpsilon);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(values)) {
+ return undefined;
+ }
+
+ wrapAround = defaultValue.defaultValue(wrapAround, false);
+ const storeRemovedIndices = defaultValue.defined(removedIndices);
+
+ const length = values.length;
+ if (length < 2) {
+ return values;
+ }
+
+ let i;
+ let v0 = values[0];
+ let v1;
+
+ // We only want to create a new array if there are duplicates in the array.
+ // As such, cleanedValues is undefined until it encounters the first duplicate, if it exists.
+ let cleanedValues;
+ let lastCleanIndex = 0;
+
+ // removedIndexLCI keeps track of where lastCleanIndex would be if it were sorted into the removedIndices array.
+ // In case of arrays such as [A, B, C, ..., A, A, A], removedIndices will not be sorted properly without this.
+ let removedIndexLCI = -1;
+
+ for (i = 1; i < length; ++i) {
+ v1 = values[i];
+ if (equalsEpsilon(v0, v1, removeDuplicatesEpsilon)) {
+ if (!defaultValue.defined(cleanedValues)) {
+ cleanedValues = values.slice(0, i);
+ lastCleanIndex = i - 1;
+ removedIndexLCI = 0;
+ }
+ if (storeRemovedIndices) {
+ removedIndices.push(i);
+ }
+ } else {
+ if (defaultValue.defined(cleanedValues)) {
+ cleanedValues.push(v1);
+ lastCleanIndex = i;
+ if (storeRemovedIndices) {
+ removedIndexLCI = removedIndices.length;
+ }
+ }
+ v0 = v1;
+ }
+ }
+
+ if (
+ wrapAround &&
+ equalsEpsilon(values[0], values[length - 1], removeDuplicatesEpsilon)
+ ) {
+ if (storeRemovedIndices) {
+ if (defaultValue.defined(cleanedValues)) {
+ removedIndices.splice(removedIndexLCI, 0, lastCleanIndex);
+ } else {
+ removedIndices.push(length - 1);
+ }
+ }
+
+ if (defaultValue.defined(cleanedValues)) {
+ cleanedValues.length -= 1;
+ } else {
+ cleanedValues = values.slice(0, -1);
+ }
+ }
+
+ return defaultValue.defined(cleanedValues) ? cleanedValues : values;
+ }
+
+ exports.arrayRemoveDuplicates = arrayRemoveDuplicates;
+
+}));
+//# sourceMappingURL=arrayRemoveDuplicates-c3526030.js.map
diff --git a/examples/cesium/Workers/arrayRemoveDuplicates-c3526030.js.map b/examples/cesium/Workers/arrayRemoveDuplicates-c3526030.js.map
new file mode 100644
index 0000000..8161fbb
--- /dev/null
+++ b/examples/cesium/Workers/arrayRemoveDuplicates-c3526030.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"arrayRemoveDuplicates-c3526030.js","sources":["../../../Source/Core/arrayRemoveDuplicates.js"],"sourcesContent":["import Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\nconst removeDuplicatesEpsilon = CesiumMath.EPSILON10;\r\n\r\n/**\r\n * Removes adjacent duplicate values in an array of values.\r\n *\r\n * @param {Array.<*>} [values] The array of values.\r\n * @param {Function} equalsEpsilon Function to compare values with an epsilon. Boolean equalsEpsilon(left, right, epsilon).\r\n * @param {Boolean} [wrapAround=false] Compare the last value in the array against the first value. If they are equal, the last value is removed.\r\n * @param {Array.} [removedIndices=undefined] Store the indices that correspond to the duplicate items removed from the array, if there were any.\r\n * @returns {Array.<*>|undefined} A new array of values with no adjacent duplicate values or the input array if no duplicates were found.\r\n *\r\n * @example\r\n * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0), (1.0, 1.0, 1.0)]\r\n * const values = [\r\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\r\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\r\n * new Cesium.Cartesian3(2.0, 2.0, 2.0),\r\n * new Cesium.Cartesian3(3.0, 3.0, 3.0),\r\n * new Cesium.Cartesian3(1.0, 1.0, 1.0)];\r\n * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon);\r\n *\r\n * @example\r\n * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0)]\r\n * const values = [\r\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\r\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\r\n * new Cesium.Cartesian3(2.0, 2.0, 2.0),\r\n * new Cesium.Cartesian3(3.0, 3.0, 3.0),\r\n * new Cesium.Cartesian3(1.0, 1.0, 1.0)];\r\n * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon, true);\r\n *\r\n * @example\r\n * // Returns [(1.0, 1.0, 1.0), (2.0, 2.0, 2.0), (3.0, 3.0, 3.0)]\r\n * // removedIndices will be equal to [1, 3, 5]\r\n * const values = [\r\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\r\n * new Cesium.Cartesian3(1.0, 1.0, 1.0),\r\n * new Cesium.Cartesian3(2.0, 2.0, 2.0),\r\n * new Cesium.Cartesian3(2.0, 2.0, 2.0),\r\n * new Cesium.Cartesian3(3.0, 3.0, 3.0),\r\n * new Cesium.Cartesian3(1.0, 1.0, 1.0)];\r\n * const nonDuplicatevalues = Cesium.PolylinePipeline.removeDuplicates(values, Cartesian3.equalsEpsilon, true);\r\n * @private\r\n */\r\nfunction arrayRemoveDuplicates(\r\n values,\r\n equalsEpsilon,\r\n wrapAround,\r\n removedIndices\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"equalsEpsilon\", equalsEpsilon);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(values)) {\r\n return undefined;\r\n }\r\n\r\n wrapAround = defaultValue(wrapAround, false);\r\n const storeRemovedIndices = defined(removedIndices);\r\n\r\n const length = values.length;\r\n if (length < 2) {\r\n return values;\r\n }\r\n\r\n let i;\r\n let v0 = values[0];\r\n let v1;\r\n\r\n // We only want to create a new array if there are duplicates in the array.\r\n // As such, cleanedValues is undefined until it encounters the first duplicate, if it exists.\r\n let cleanedValues;\r\n let lastCleanIndex = 0;\r\n\r\n // removedIndexLCI keeps track of where lastCleanIndex would be if it were sorted into the removedIndices array.\r\n // In case of arrays such as [A, B, C, ..., A, A, A], removedIndices will not be sorted properly without this.\r\n let removedIndexLCI = -1;\r\n\r\n for (i = 1; i < length; ++i) {\r\n v1 = values[i];\r\n if (equalsEpsilon(v0, v1, removeDuplicatesEpsilon)) {\r\n if (!defined(cleanedValues)) {\r\n cleanedValues = values.slice(0, i);\r\n lastCleanIndex = i - 1;\r\n removedIndexLCI = 0;\r\n }\r\n if (storeRemovedIndices) {\r\n removedIndices.push(i);\r\n }\r\n } else {\r\n if (defined(cleanedValues)) {\r\n cleanedValues.push(v1);\r\n lastCleanIndex = i;\r\n if (storeRemovedIndices) {\r\n removedIndexLCI = removedIndices.length;\r\n }\r\n }\r\n v0 = v1;\r\n }\r\n }\r\n\r\n if (\r\n wrapAround &&\r\n equalsEpsilon(values[0], values[length - 1], removeDuplicatesEpsilon)\r\n ) {\r\n if (storeRemovedIndices) {\r\n if (defined(cleanedValues)) {\r\n removedIndices.splice(removedIndexLCI, 0, lastCleanIndex);\r\n } else {\r\n removedIndices.push(length - 1);\r\n }\r\n }\r\n\r\n if (defined(cleanedValues)) {\r\n cleanedValues.length -= 1;\r\n } else {\r\n cleanedValues = values.slice(0, -1);\r\n }\r\n }\r\n\r\n return defined(cleanedValues) ? cleanedValues : values;\r\n}\r\n\r\nexport default arrayRemoveDuplicates;\r\n"],"names":["CesiumMath","Check","defined","defaultValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,uBAAuB,GAAGA,eAAU,CAAC,SAAS,CAAC;AACrD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAC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;EACA,EAAE,OAAOA,oBAAO,CAAC,aAAa,CAAC,GAAG,aAAa,GAAG,MAAM,CAAC;EACzD;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/cesiumWorkerBootstrapper.js b/examples/cesium/Workers/cesiumWorkerBootstrapper.js
new file mode 100644
index 0000000..0bf17f5
--- /dev/null
+++ b/examples/cesium/Workers/cesiumWorkerBootstrapper.js
@@ -0,0 +1,1297 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+if (typeof self === "undefined") {
+ self = {};
+}
+self.onmessage = function(event) {
+ var data = event.data;
+ require(data.loaderConfig, [data.workerModule], function(workerModule) {
+ self.onmessage = workerModule;
+ self.CESIUM_BASE_URL = data.loaderConfig.baseUrl;
+ });
+};
+function setTimeout(fn) {
+ fn();
+}
+/** vim: et:ts=4:sw=4:sts=4
+ * @license RequireJS 2.1.20 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+var requirejs, require, define;
+(function(global) {
+ var req, s, head, baseElement, dataMain, src, interactiveScript, currentlyAddingScript, mainScript, subPath, version = "2.1.20", commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm, cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, jsSuffixRegExp = /\.js$/, currDirRegExp = /^\.\//, op = Object.prototype, ostring = op.toString, hasOwn = op.hasOwnProperty, ap = Array.prototype, isBrowser = !!(typeof window !== "undefined" && typeof navigator !== "undefined" && window.document), isWebWorker = !isBrowser && typeof importScripts !== "undefined", readyRegExp = isBrowser && navigator.platform === "PLAYSTATION 3" ? /^complete$/ : /^(complete|loaded)$/, defContextName = "_", isOpera = typeof opera !== "undefined" && opera.toString() === "[object Opera]", contexts = {}, cfg = {}, globalDefQueue = [], useInteractive = false;
+ function isFunction(it) {
+ return ostring.call(it) === "[object Function]";
+ }
+ function isArray(it) {
+ return ostring.call(it) === "[object Array]";
+ }
+ function each(ary, func) {
+ if (ary) {
+ var i;
+ for (i = 0; i < ary.length; i += 1) {
+ if (ary[i] && func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ }
+ function eachReverse(ary, func) {
+ if (ary) {
+ var i;
+ for (i = ary.length - 1; i > -1; i -= 1) {
+ if (ary[i] && func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ }
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+ function getOwn(obj, prop) {
+ return hasProp(obj, prop) && obj[prop];
+ }
+ function eachProp(obj, func) {
+ var prop;
+ for (prop in obj) {
+ if (hasProp(obj, prop)) {
+ if (func(obj[prop], prop)) {
+ break;
+ }
+ }
+ }
+ }
+ function mixin(target, source, force, deepStringMixin) {
+ if (source) {
+ eachProp(source, function(value, prop) {
+ if (force || !hasProp(target, prop)) {
+ if (deepStringMixin && typeof value === "object" && value && !isArray(value) && !isFunction(value) && !(value instanceof RegExp)) {
+ if (!target[prop]) {
+ target[prop] = {};
+ }
+ mixin(target[prop], value, force, deepStringMixin);
+ } else {
+ target[prop] = value;
+ }
+ }
+ });
+ }
+ return target;
+ }
+ function bind(obj, fn) {
+ return function() {
+ return fn.apply(obj, arguments);
+ };
+ }
+ function scripts() {
+ return document.getElementsByTagName("script");
+ }
+ function defaultOnError(err) {
+ throw err;
+ }
+ function getGlobal(value) {
+ if (!value) {
+ return value;
+ }
+ var g = global;
+ each(value.split("."), function(part) {
+ g = g[part];
+ });
+ return g;
+ }
+ function makeError(id, msg, err, requireModules) {
+ var e = new Error(msg + "\nhttp://requirejs.org/docs/errors.html#" + id);
+ e.requireType = id;
+ e.requireModules = requireModules;
+ if (err) {
+ e.originalError = err;
+ }
+ return e;
+ }
+ if (typeof define !== "undefined") {
+ return;
+ }
+ if (typeof requirejs !== "undefined") {
+ if (isFunction(requirejs)) {
+ return;
+ }
+ cfg = requirejs;
+ requirejs = void 0;
+ }
+ if (typeof require !== "undefined" && !isFunction(require)) {
+ cfg = require;
+ require = void 0;
+ }
+ function newContext(contextName) {
+ var inCheckLoaded, Module, context, handlers, checkLoadedTimeoutId, config = {
+ waitSeconds: 7,
+ baseUrl: "./",
+ paths: {},
+ bundles: {},
+ pkgs: {},
+ shim: {},
+ config: {}
+ }, registry = {}, enabledRegistry = {}, undefEvents = {}, defQueue = [], defined = {}, urlFetched = {}, bundlesMap = {}, requireCounter = 1, unnormalizedCounter = 1;
+ function trimDots(ary) {
+ var i, part;
+ for (i = 0; i < ary.length; i++) {
+ part = ary[i];
+ if (part === ".") {
+ ary.splice(i, 1);
+ i -= 1;
+ } else if (part === "..") {
+ if (i === 0 || i === 1 && ary[2] === ".." || ary[i - 1] === "..") {
+ continue;
+ } else if (i > 0) {
+ ary.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ }
+ function normalize(name, baseName, applyMap) {
+ var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex, foundMap, foundI, foundStarMap, starI, normalizedBaseParts, baseParts = baseName && baseName.split("/"), map = config.map, starMap = map && map["*"];
+ if (name) {
+ name = name.split("/");
+ lastIndex = name.length - 1;
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, "");
+ }
+ if (name[0].charAt(0) === "." && baseParts) {
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+ name = normalizedBaseParts.concat(name);
+ }
+ trimDots(name);
+ name = name.join("/");
+ }
+ if (applyMap && map && (baseParts || starMap)) {
+ nameParts = name.split("/");
+ outerLoop:
+ for (i = nameParts.length; i > 0; i -= 1) {
+ nameSegment = nameParts.slice(0, i).join("/");
+ if (baseParts) {
+ for (j = baseParts.length; j > 0; j -= 1) {
+ mapValue = getOwn(map, baseParts.slice(0, j).join("/"));
+ if (mapValue) {
+ mapValue = getOwn(mapValue, nameSegment);
+ if (mapValue) {
+ foundMap = mapValue;
+ foundI = i;
+ break outerLoop;
+ }
+ }
+ }
+ }
+ if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
+ foundStarMap = getOwn(starMap, nameSegment);
+ starI = i;
+ }
+ }
+ if (!foundMap && foundStarMap) {
+ foundMap = foundStarMap;
+ foundI = starI;
+ }
+ if (foundMap) {
+ nameParts.splice(0, foundI, foundMap);
+ name = nameParts.join("/");
+ }
+ }
+ pkgMain = getOwn(config.pkgs, name);
+ return pkgMain ? pkgMain : name;
+ }
+ function removeScript(name) {
+ if (isBrowser) {
+ each(scripts(), function(scriptNode) {
+ if (scriptNode.getAttribute("data-requiremodule") === name && scriptNode.getAttribute("data-requirecontext") === context.contextName) {
+ scriptNode.parentNode.removeChild(scriptNode);
+ return true;
+ }
+ });
+ }
+ }
+ function hasPathFallback(id) {
+ var pathConfig = getOwn(config.paths, id);
+ if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
+ pathConfig.shift();
+ context.require.undef(id);
+ context.makeRequire(null, {
+ skipMap: true
+ })([id]);
+ return true;
+ }
+ }
+ function splitPrefix(name) {
+ var prefix, index = name ? name.indexOf("!") : -1;
+ if (index > -1) {
+ prefix = name.substring(0, index);
+ name = name.substring(index + 1, name.length);
+ }
+ return [prefix, name];
+ }
+ function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
+ var url, pluginModule, suffix, nameParts, prefix = null, parentName = parentModuleMap ? parentModuleMap.name : null, originalName = name, isDefine = true, normalizedName = "";
+ if (!name) {
+ isDefine = false;
+ name = "_@r" + (requireCounter += 1);
+ }
+ nameParts = splitPrefix(name);
+ prefix = nameParts[0];
+ name = nameParts[1];
+ if (prefix) {
+ prefix = normalize(prefix, parentName, applyMap);
+ pluginModule = getOwn(defined, prefix);
+ }
+ if (name) {
+ if (prefix) {
+ if (pluginModule && pluginModule.normalize) {
+ normalizedName = pluginModule.normalize(name, function(name2) {
+ return normalize(name2, parentName, applyMap);
+ });
+ } else {
+ normalizedName = name.indexOf("!") === -1 ? normalize(name, parentName, applyMap) : name;
+ }
+ } else {
+ normalizedName = normalize(name, parentName, applyMap);
+ nameParts = splitPrefix(normalizedName);
+ prefix = nameParts[0];
+ normalizedName = nameParts[1];
+ isNormalized = true;
+ url = context.nameToUrl(normalizedName);
+ }
+ }
+ suffix = prefix && !pluginModule && !isNormalized ? "_unnormalized" + (unnormalizedCounter += 1) : "";
+ return {
+ prefix,
+ name: normalizedName,
+ parentMap: parentModuleMap,
+ unnormalized: !!suffix,
+ url,
+ originalName,
+ isDefine,
+ id: (prefix ? prefix + "!" + normalizedName : normalizedName) + suffix
+ };
+ }
+ function getModule(depMap) {
+ var id = depMap.id, mod = getOwn(registry, id);
+ if (!mod) {
+ mod = registry[id] = new context.Module(depMap);
+ }
+ return mod;
+ }
+ function on(depMap, name, fn) {
+ var id = depMap.id, mod = getOwn(registry, id);
+ if (hasProp(defined, id) && (!mod || mod.defineEmitComplete)) {
+ if (name === "defined") {
+ fn(defined[id]);
+ }
+ } else {
+ mod = getModule(depMap);
+ if (mod.error && name === "error") {
+ fn(mod.error);
+ } else {
+ mod.on(name, fn);
+ }
+ }
+ }
+ function onError(err, errback) {
+ var ids = err.requireModules, notified = false;
+ if (errback) {
+ errback(err);
+ } else {
+ each(ids, function(id) {
+ var mod = getOwn(registry, id);
+ if (mod) {
+ mod.error = err;
+ if (mod.events.error) {
+ notified = true;
+ mod.emit("error", err);
+ }
+ }
+ });
+ if (!notified) {
+ req.onError(err);
+ }
+ }
+ }
+ function takeGlobalQueue() {
+ if (globalDefQueue.length) {
+ each(globalDefQueue, function(queueItem) {
+ var id = queueItem[0];
+ if (typeof id === "string") {
+ context.defQueueMap[id] = true;
+ }
+ defQueue.push(queueItem);
+ });
+ globalDefQueue = [];
+ }
+ }
+ handlers = {
+ require: function(mod) {
+ if (mod.require) {
+ return mod.require;
+ } else {
+ return mod.require = context.makeRequire(mod.map);
+ }
+ },
+ exports: function(mod) {
+ mod.usingExports = true;
+ if (mod.map.isDefine) {
+ if (mod.exports) {
+ return defined[mod.map.id] = mod.exports;
+ } else {
+ return mod.exports = defined[mod.map.id] = {};
+ }
+ }
+ },
+ module: function(mod) {
+ if (mod.module) {
+ return mod.module;
+ } else {
+ return mod.module = {
+ id: mod.map.id,
+ uri: mod.map.url,
+ config: function() {
+ return getOwn(config.config, mod.map.id) || {};
+ },
+ exports: mod.exports || (mod.exports = {})
+ };
+ }
+ }
+ };
+ function cleanRegistry(id) {
+ delete registry[id];
+ delete enabledRegistry[id];
+ }
+ function breakCycle(mod, traced, processed) {
+ var id = mod.map.id;
+ if (mod.error) {
+ mod.emit("error", mod.error);
+ } else {
+ traced[id] = true;
+ each(mod.depMaps, function(depMap, i) {
+ var depId = depMap.id, dep = getOwn(registry, depId);
+ if (dep && !mod.depMatched[i] && !processed[depId]) {
+ if (getOwn(traced, depId)) {
+ mod.defineDep(i, defined[depId]);
+ mod.check();
+ } else {
+ breakCycle(dep, traced, processed);
+ }
+ }
+ });
+ processed[id] = true;
+ }
+ }
+ function checkLoaded() {
+ var err, usingPathFallback, waitInterval = config.waitSeconds * 1e3, expired = waitInterval && context.startTime + waitInterval < new Date().getTime(), noLoads = [], reqCalls = [], stillLoading = false, needCycleCheck = true;
+ if (inCheckLoaded) {
+ return;
+ }
+ inCheckLoaded = true;
+ eachProp(enabledRegistry, function(mod) {
+ var map = mod.map, modId = map.id;
+ if (!mod.enabled) {
+ return;
+ }
+ if (!map.isDefine) {
+ reqCalls.push(mod);
+ }
+ if (!mod.error) {
+ if (!mod.inited && expired) {
+ if (hasPathFallback(modId)) {
+ usingPathFallback = true;
+ stillLoading = true;
+ } else {
+ noLoads.push(modId);
+ removeScript(modId);
+ }
+ } else if (!mod.inited && mod.fetched && map.isDefine) {
+ stillLoading = true;
+ if (!map.prefix) {
+ return needCycleCheck = false;
+ }
+ }
+ }
+ });
+ if (expired && noLoads.length) {
+ err = makeError(
+ "timeout",
+ "Load timeout for modules: " + noLoads,
+ null,
+ noLoads
+ );
+ err.contextName = context.contextName;
+ return onError(err);
+ }
+ if (needCycleCheck) {
+ each(reqCalls, function(mod) {
+ breakCycle(mod, {}, {});
+ });
+ }
+ if ((!expired || usingPathFallback) && stillLoading) {
+ if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
+ checkLoadedTimeoutId = setTimeout(function() {
+ checkLoadedTimeoutId = 0;
+ checkLoaded();
+ }, 50);
+ }
+ }
+ inCheckLoaded = false;
+ }
+ Module = function(map) {
+ this.events = getOwn(undefEvents, map.id) || {};
+ this.map = map;
+ this.shim = getOwn(config.shim, map.id);
+ this.depExports = [];
+ this.depMaps = [];
+ this.depMatched = [];
+ this.pluginMaps = {};
+ this.depCount = 0;
+ };
+ Module.prototype = {
+ init: function(depMaps, factory, errback, options) {
+ options = options || {};
+ if (this.inited) {
+ return;
+ }
+ this.factory = factory;
+ if (errback) {
+ this.on("error", errback);
+ } else if (this.events.error) {
+ errback = bind(this, function(err) {
+ this.emit("error", err);
+ });
+ }
+ this.depMaps = depMaps && depMaps.slice(0);
+ this.errback = errback;
+ this.inited = true;
+ this.ignore = options.ignore;
+ if (options.enabled || this.enabled) {
+ this.enable();
+ } else {
+ this.check();
+ }
+ },
+ defineDep: function(i, depExports) {
+ if (!this.depMatched[i]) {
+ this.depMatched[i] = true;
+ this.depCount -= 1;
+ this.depExports[i] = depExports;
+ }
+ },
+ fetch: function() {
+ if (this.fetched) {
+ return;
+ }
+ this.fetched = true;
+ context.startTime = new Date().getTime();
+ var map = this.map;
+ if (this.shim) {
+ context.makeRequire(this.map, {
+ enableBuildCallback: true
+ })(
+ this.shim.deps || [],
+ bind(this, function() {
+ return map.prefix ? this.callPlugin() : this.load();
+ })
+ );
+ } else {
+ return map.prefix ? this.callPlugin() : this.load();
+ }
+ },
+ load: function() {
+ var url = this.map.url;
+ if (!urlFetched[url]) {
+ urlFetched[url] = true;
+ context.load(this.map.id, url);
+ }
+ },
+ check: function() {
+ if (!this.enabled || this.enabling) {
+ return;
+ }
+ var err, cjsModule, id = this.map.id, depExports = this.depExports, exports = this.exports, factory = this.factory;
+ if (!this.inited) {
+ if (!hasProp(context.defQueueMap, id)) {
+ this.fetch();
+ }
+ } else if (this.error) {
+ this.emit("error", this.error);
+ } else if (!this.defining) {
+ this.defining = true;
+ if (this.depCount < 1 && !this.defined) {
+ if (isFunction(factory)) {
+ if (this.events.error && this.map.isDefine || req.onError !== defaultOnError) {
+ try {
+ exports = context.execCb(id, factory, depExports, exports);
+ } catch (e) {
+ err = e;
+ }
+ } else {
+ exports = context.execCb(id, factory, depExports, exports);
+ }
+ if (this.map.isDefine && exports === void 0) {
+ cjsModule = this.module;
+ if (cjsModule) {
+ exports = cjsModule.exports;
+ } else if (this.usingExports) {
+ exports = this.exports;
+ }
+ }
+ if (err) {
+ err.requireMap = this.map;
+ err.requireModules = this.map.isDefine ? [this.map.id] : null;
+ err.requireType = this.map.isDefine ? "define" : "require";
+ return onError(this.error = err);
+ }
+ } else {
+ exports = factory;
+ }
+ this.exports = exports;
+ if (this.map.isDefine && !this.ignore) {
+ defined[id] = exports;
+ if (req.onResourceLoad) {
+ req.onResourceLoad(context, this.map, this.depMaps);
+ }
+ }
+ cleanRegistry(id);
+ this.defined = true;
+ }
+ this.defining = false;
+ if (this.defined && !this.defineEmitted) {
+ this.defineEmitted = true;
+ this.emit("defined", this.exports);
+ this.defineEmitComplete = true;
+ }
+ }
+ },
+ callPlugin: function() {
+ var map = this.map, id = map.id, pluginMap = makeModuleMap(map.prefix);
+ this.depMaps.push(pluginMap);
+ on(
+ pluginMap,
+ "defined",
+ bind(this, function(plugin) {
+ var load, normalizedMap, normalizedMod, bundleId = getOwn(bundlesMap, this.map.id), name = this.map.name, parentName = this.map.parentMap ? this.map.parentMap.name : null, localRequire = context.makeRequire(map.parentMap, {
+ enableBuildCallback: true
+ });
+ if (this.map.unnormalized) {
+ if (plugin.normalize) {
+ name = plugin.normalize(name, function(name2) {
+ return normalize(name2, parentName, true);
+ }) || "";
+ }
+ normalizedMap = makeModuleMap(
+ map.prefix + "!" + name,
+ this.map.parentMap
+ );
+ on(
+ normalizedMap,
+ "defined",
+ bind(this, function(value) {
+ this.init(
+ [],
+ function() {
+ return value;
+ },
+ null,
+ {
+ enabled: true,
+ ignore: true
+ }
+ );
+ })
+ );
+ normalizedMod = getOwn(registry, normalizedMap.id);
+ if (normalizedMod) {
+ this.depMaps.push(normalizedMap);
+ if (this.events.error) {
+ normalizedMod.on(
+ "error",
+ bind(this, function(err) {
+ this.emit("error", err);
+ })
+ );
+ }
+ normalizedMod.enable();
+ }
+ return;
+ }
+ if (bundleId) {
+ this.map.url = context.nameToUrl(bundleId);
+ this.load();
+ return;
+ }
+ load = bind(this, function(value) {
+ this.init(
+ [],
+ function() {
+ return value;
+ },
+ null,
+ {
+ enabled: true
+ }
+ );
+ });
+ load.error = bind(this, function(err) {
+ this.inited = true;
+ this.error = err;
+ err.requireModules = [id];
+ eachProp(registry, function(mod) {
+ if (mod.map.id.indexOf(id + "_unnormalized") === 0) {
+ cleanRegistry(mod.map.id);
+ }
+ });
+ onError(err);
+ });
+ load.fromText = bind(this, function(text2, textAlt) {
+ var moduleName = map.name, moduleMap = makeModuleMap(moduleName), hasInteractive = useInteractive;
+ if (textAlt) {
+ text2 = textAlt;
+ }
+ if (hasInteractive) {
+ useInteractive = false;
+ }
+ getModule(moduleMap);
+ if (hasProp(config.config, id)) {
+ config.config[moduleName] = config.config[id];
+ }
+ try {
+ req.exec(text2);
+ } catch (e) {
+ return onError(
+ makeError(
+ "fromtexteval",
+ "fromText eval for " + id + " failed: " + e,
+ e,
+ [id]
+ )
+ );
+ }
+ if (hasInteractive) {
+ useInteractive = true;
+ }
+ this.depMaps.push(moduleMap);
+ context.completeLoad(moduleName);
+ localRequire([moduleName], load);
+ });
+ plugin.load(map.name, localRequire, load, config);
+ })
+ );
+ context.enable(pluginMap, this);
+ this.pluginMaps[pluginMap.id] = pluginMap;
+ },
+ enable: function() {
+ enabledRegistry[this.map.id] = this;
+ this.enabled = true;
+ this.enabling = true;
+ each(
+ this.depMaps,
+ bind(this, function(depMap, i) {
+ var id, mod, handler;
+ if (typeof depMap === "string") {
+ depMap = makeModuleMap(
+ depMap,
+ this.map.isDefine ? this.map : this.map.parentMap,
+ false,
+ !this.skipMap
+ );
+ this.depMaps[i] = depMap;
+ handler = getOwn(handlers, depMap.id);
+ if (handler) {
+ this.depExports[i] = handler(this);
+ return;
+ }
+ this.depCount += 1;
+ on(
+ depMap,
+ "defined",
+ bind(this, function(depExports) {
+ if (this.undefed) {
+ return;
+ }
+ this.defineDep(i, depExports);
+ this.check();
+ })
+ );
+ if (this.errback) {
+ on(depMap, "error", bind(this, this.errback));
+ } else if (this.events.error) {
+ on(
+ depMap,
+ "error",
+ bind(this, function(err) {
+ this.emit("error", err);
+ })
+ );
+ }
+ }
+ id = depMap.id;
+ mod = registry[id];
+ if (!hasProp(handlers, id) && mod && !mod.enabled) {
+ context.enable(depMap, this);
+ }
+ })
+ );
+ eachProp(
+ this.pluginMaps,
+ bind(this, function(pluginMap) {
+ var mod = getOwn(registry, pluginMap.id);
+ if (mod && !mod.enabled) {
+ context.enable(pluginMap, this);
+ }
+ })
+ );
+ this.enabling = false;
+ this.check();
+ },
+ on: function(name, cb) {
+ var cbs = this.events[name];
+ if (!cbs) {
+ cbs = this.events[name] = [];
+ }
+ cbs.push(cb);
+ },
+ emit: function(name, evt) {
+ each(this.events[name], function(cb) {
+ cb(evt);
+ });
+ if (name === "error") {
+ delete this.events[name];
+ }
+ }
+ };
+ function callGetModule(args) {
+ if (!hasProp(defined, args[0])) {
+ getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
+ }
+ }
+ function removeListener(node, func, name, ieName) {
+ if (node.detachEvent && !isOpera) {
+ if (ieName) {
+ node.detachEvent(ieName, func);
+ }
+ } else {
+ node.removeEventListener(name, func, false);
+ }
+ }
+ function getScriptData(evt) {
+ var node = evt.currentTarget || evt.srcElement;
+ removeListener(node, context.onScriptLoad, "load", "onreadystatechange");
+ removeListener(node, context.onScriptError, "error");
+ return {
+ node,
+ id: node && node.getAttribute("data-requiremodule")
+ };
+ }
+ function intakeDefines() {
+ var args;
+ takeGlobalQueue();
+ while (defQueue.length) {
+ args = defQueue.shift();
+ if (args[0] === null) {
+ return onError(
+ makeError(
+ "mismatch",
+ "Mismatched anonymous define() module: " + args[args.length - 1]
+ )
+ );
+ } else {
+ callGetModule(args);
+ }
+ }
+ context.defQueueMap = {};
+ }
+ context = {
+ config,
+ contextName,
+ registry,
+ defined,
+ urlFetched,
+ defQueue,
+ defQueueMap: {},
+ Module,
+ makeModuleMap,
+ nextTick: req.nextTick,
+ onError,
+ configure: function(cfg2) {
+ if (cfg2.baseUrl) {
+ if (cfg2.baseUrl.charAt(cfg2.baseUrl.length - 1) !== "/") {
+ cfg2.baseUrl += "/";
+ }
+ }
+ var shim = config.shim, objs = {
+ paths: true,
+ bundles: true,
+ config: true,
+ map: true
+ };
+ eachProp(cfg2, function(value, prop) {
+ if (objs[prop]) {
+ if (!config[prop]) {
+ config[prop] = {};
+ }
+ mixin(config[prop], value, true, true);
+ } else {
+ config[prop] = value;
+ }
+ });
+ if (cfg2.bundles) {
+ eachProp(cfg2.bundles, function(value, prop) {
+ each(value, function(v) {
+ if (v !== prop) {
+ bundlesMap[v] = prop;
+ }
+ });
+ });
+ }
+ if (cfg2.shim) {
+ eachProp(cfg2.shim, function(value, id) {
+ if (isArray(value)) {
+ value = {
+ deps: value
+ };
+ }
+ if ((value.exports || value.init) && !value.exportsFn) {
+ value.exportsFn = context.makeShimExports(value);
+ }
+ shim[id] = value;
+ });
+ config.shim = shim;
+ }
+ if (cfg2.packages) {
+ each(cfg2.packages, function(pkgObj) {
+ var location, name;
+ pkgObj = typeof pkgObj === "string" ? { name: pkgObj } : pkgObj;
+ name = pkgObj.name;
+ location = pkgObj.location;
+ if (location) {
+ config.paths[name] = pkgObj.location;
+ }
+ config.pkgs[name] = pkgObj.name + "/" + (pkgObj.main || "main").replace(currDirRegExp, "").replace(jsSuffixRegExp, "");
+ });
+ }
+ eachProp(registry, function(mod, id) {
+ if (!mod.inited && !mod.map.unnormalized) {
+ mod.map = makeModuleMap(id, null, true);
+ }
+ });
+ if (cfg2.deps || cfg2.callback) {
+ context.require(cfg2.deps || [], cfg2.callback);
+ }
+ },
+ makeShimExports: function(value) {
+ function fn() {
+ var ret;
+ if (value.init) {
+ ret = value.init.apply(global, arguments);
+ }
+ return ret || value.exports && getGlobal(value.exports);
+ }
+ return fn;
+ },
+ makeRequire: function(relMap, options) {
+ options = options || {};
+ function localRequire(deps, callback, errback) {
+ var id, map, requireMod;
+ if (options.enableBuildCallback && callback && isFunction(callback)) {
+ callback.__requireJsBuild = true;
+ }
+ if (typeof deps === "string") {
+ if (isFunction(callback)) {
+ return onError(
+ makeError("requireargs", "Invalid require call"),
+ errback
+ );
+ }
+ if (relMap && hasProp(handlers, deps)) {
+ return handlers[deps](registry[relMap.id]);
+ }
+ if (req.get) {
+ return req.get(context, deps, relMap, localRequire);
+ }
+ map = makeModuleMap(deps, relMap, false, true);
+ id = map.id;
+ if (!hasProp(defined, id)) {
+ return onError(
+ makeError(
+ "notloaded",
+ 'Module name "' + id + '" has not been loaded yet for context: ' + contextName + (relMap ? "" : ". Use require([])")
+ )
+ );
+ }
+ return defined[id];
+ }
+ intakeDefines();
+ context.nextTick(function() {
+ intakeDefines();
+ requireMod = getModule(makeModuleMap(null, relMap));
+ requireMod.skipMap = options.skipMap;
+ requireMod.init(deps, callback, errback, {
+ enabled: true
+ });
+ checkLoaded();
+ });
+ return localRequire;
+ }
+ mixin(localRequire, {
+ isBrowser,
+ toUrl: function(moduleNamePlusExt) {
+ var ext, index = moduleNamePlusExt.lastIndexOf("."), segment = moduleNamePlusExt.split("/")[0], isRelative = segment === "." || segment === "..";
+ if (index !== -1 && (!isRelative || index > 1)) {
+ ext = moduleNamePlusExt.substring(
+ index,
+ moduleNamePlusExt.length
+ );
+ moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
+ }
+ return context.nameToUrl(
+ normalize(moduleNamePlusExt, relMap && relMap.id, true),
+ ext,
+ true
+ );
+ },
+ defined: function(id) {
+ return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
+ },
+ specified: function(id) {
+ id = makeModuleMap(id, relMap, false, true).id;
+ return hasProp(defined, id) || hasProp(registry, id);
+ }
+ });
+ if (!relMap) {
+ localRequire.undef = function(id) {
+ takeGlobalQueue();
+ var map = makeModuleMap(id, relMap, true), mod = getOwn(registry, id);
+ mod.undefed = true;
+ removeScript(id);
+ delete defined[id];
+ delete urlFetched[map.url];
+ delete undefEvents[id];
+ eachReverse(defQueue, function(args, i) {
+ if (args[0] === id) {
+ defQueue.splice(i, 1);
+ }
+ });
+ delete context.defQueueMap[id];
+ if (mod) {
+ if (mod.events.defined) {
+ undefEvents[id] = mod.events;
+ }
+ cleanRegistry(id);
+ }
+ };
+ }
+ return localRequire;
+ },
+ enable: function(depMap) {
+ var mod = getOwn(registry, depMap.id);
+ if (mod) {
+ getModule(depMap).enable();
+ }
+ },
+ completeLoad: function(moduleName) {
+ var found, args, mod, shim = getOwn(config.shim, moduleName) || {}, shExports = shim.exports;
+ takeGlobalQueue();
+ while (defQueue.length) {
+ args = defQueue.shift();
+ if (args[0] === null) {
+ args[0] = moduleName;
+ if (found) {
+ break;
+ }
+ found = true;
+ } else if (args[0] === moduleName) {
+ found = true;
+ }
+ callGetModule(args);
+ }
+ context.defQueueMap = {};
+ mod = getOwn(registry, moduleName);
+ if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
+ if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
+ if (hasPathFallback(moduleName)) {
+ return;
+ } else {
+ return onError(
+ makeError(
+ "nodefine",
+ "No define call for " + moduleName,
+ null,
+ [moduleName]
+ )
+ );
+ }
+ } else {
+ callGetModule([moduleName, shim.deps || [], shim.exportsFn]);
+ }
+ }
+ checkLoaded();
+ },
+ nameToUrl: function(moduleName, ext, skipExt) {
+ var paths, syms, i, parentModule, url, parentPath, bundleId, pkgMain = getOwn(config.pkgs, moduleName);
+ if (pkgMain) {
+ moduleName = pkgMain;
+ }
+ bundleId = getOwn(bundlesMap, moduleName);
+ if (bundleId) {
+ return context.nameToUrl(bundleId, ext, skipExt);
+ }
+ if (req.jsExtRegExp.test(moduleName)) {
+ url = moduleName + (ext || "");
+ } else {
+ paths = config.paths;
+ syms = moduleName.split("/");
+ for (i = syms.length; i > 0; i -= 1) {
+ parentModule = syms.slice(0, i).join("/");
+ parentPath = getOwn(paths, parentModule);
+ if (parentPath) {
+ if (isArray(parentPath)) {
+ parentPath = parentPath[0];
+ }
+ syms.splice(0, i, parentPath);
+ break;
+ }
+ }
+ url = syms.join("/");
+ url += ext || (/^data\:|\?/.test(url) || skipExt ? "" : ".js");
+ url = (url.charAt(0) === "/" || url.match(/^[\w\+\.\-]+:/) ? "" : config.baseUrl) + url;
+ }
+ return config.urlArgs ? url + ((url.indexOf("?") === -1 ? "?" : "&") + config.urlArgs) : url;
+ },
+ load: function(id, url) {
+ req.load(context, id, url);
+ },
+ execCb: function(name, callback, args, exports) {
+ return callback.apply(exports, args);
+ },
+ onScriptLoad: function(evt) {
+ if (evt.type === "load" || readyRegExp.test((evt.currentTarget || evt.srcElement).readyState)) {
+ interactiveScript = null;
+ var data = getScriptData(evt);
+ context.completeLoad(data.id);
+ }
+ },
+ onScriptError: function(evt) {
+ var data = getScriptData(evt);
+ if (!hasPathFallback(data.id)) {
+ return onError(
+ makeError("scripterror", "Script error for: " + data.id, evt, [
+ data.id
+ ])
+ );
+ }
+ }
+ };
+ context.require = context.makeRequire();
+ return context;
+ }
+ req = requirejs = function(deps, callback, errback, optional) {
+ var context, config, contextName = defContextName;
+ if (!isArray(deps) && typeof deps !== "string") {
+ config = deps;
+ if (isArray(callback)) {
+ deps = callback;
+ callback = errback;
+ errback = optional;
+ } else {
+ deps = [];
+ }
+ }
+ if (config && config.context) {
+ contextName = config.context;
+ }
+ context = getOwn(contexts, contextName);
+ if (!context) {
+ context = contexts[contextName] = req.s.newContext(contextName);
+ }
+ if (config) {
+ context.configure(config);
+ }
+ return context.require(deps, callback, errback);
+ };
+ req.config = function(config) {
+ return req(config);
+ };
+ req.nextTick = typeof setTimeout !== "undefined" ? function(fn) {
+ setTimeout(fn, 4);
+ } : function(fn) {
+ fn();
+ };
+ if (!require) {
+ require = req;
+ }
+ req.version = version;
+ req.jsExtRegExp = /^\/|:|\?|\.js$/;
+ req.isBrowser = isBrowser;
+ s = req.s = {
+ contexts,
+ newContext
+ };
+ req({});
+ each(["toUrl", "undef", "defined", "specified"], function(prop) {
+ req[prop] = function() {
+ var ctx = contexts[defContextName];
+ return ctx.require[prop].apply(ctx, arguments);
+ };
+ });
+ if (isBrowser) {
+ head = s.head = document.getElementsByTagName("head")[0];
+ baseElement = document.getElementsByTagName("base")[0];
+ if (baseElement) {
+ head = s.head = baseElement.parentNode;
+ }
+ }
+ req.onError = defaultOnError;
+ req.createNode = function(config, moduleName, url) {
+ var node = config.xhtml ? document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") : document.createElement("script");
+ node.type = config.scriptType || "text/javascript";
+ node.charset = "utf-8";
+ node.async = true;
+ return node;
+ };
+ req.load = function(context, moduleName, url) {
+ var config = context && context.config || {}, node;
+ if (isBrowser) {
+ node = req.createNode(config, moduleName, url);
+ if (config.onNodeCreated) {
+ config.onNodeCreated(node, config, moduleName, url);
+ }
+ node.setAttribute("data-requirecontext", context.contextName);
+ node.setAttribute("data-requiremodule", moduleName);
+ if (node.attachEvent && !(node.attachEvent.toString && node.attachEvent.toString().indexOf("[native code") < 0) && !isOpera) {
+ useInteractive = true;
+ node.attachEvent("onreadystatechange", context.onScriptLoad);
+ } else {
+ node.addEventListener("load", context.onScriptLoad, false);
+ node.addEventListener("error", context.onScriptError, false);
+ }
+ node.src = url;
+ currentlyAddingScript = node;
+ if (baseElement) {
+ head.insertBefore(node, baseElement);
+ } else {
+ head.appendChild(node);
+ }
+ currentlyAddingScript = null;
+ return node;
+ } else if (isWebWorker) {
+ try {
+ importScripts(url);
+ context.completeLoad(moduleName);
+ } catch (e) {
+ context.onError(
+ makeError(
+ "importscripts",
+ "importScripts failed for " + moduleName + " at " + url,
+ e,
+ [moduleName]
+ )
+ );
+ }
+ }
+ };
+ function getInteractiveScript() {
+ if (interactiveScript && interactiveScript.readyState === "interactive") {
+ return interactiveScript;
+ }
+ eachReverse(scripts(), function(script) {
+ if (script.readyState === "interactive") {
+ return interactiveScript = script;
+ }
+ });
+ return interactiveScript;
+ }
+ if (isBrowser && !cfg.skipDataMain) {
+ eachReverse(scripts(), function(script) {
+ if (!head) {
+ head = script.parentNode;
+ }
+ dataMain = script.getAttribute("data-main");
+ if (dataMain) {
+ mainScript = dataMain;
+ if (!cfg.baseUrl) {
+ src = mainScript.split("/");
+ mainScript = src.pop();
+ subPath = src.length ? src.join("/") + "/" : "./";
+ cfg.baseUrl = subPath;
+ }
+ mainScript = mainScript.replace(jsSuffixRegExp, "");
+ if (req.jsExtRegExp.test(mainScript)) {
+ mainScript = dataMain;
+ }
+ cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];
+ return true;
+ }
+ });
+ }
+ define = function(name, deps, callback) {
+ var node, context;
+ if (typeof name !== "string") {
+ callback = deps;
+ deps = name;
+ name = null;
+ }
+ if (!isArray(deps)) {
+ callback = deps;
+ deps = null;
+ }
+ if (!deps && isFunction(callback)) {
+ deps = [];
+ if (callback.length) {
+ callback.toString().replace(commentRegExp, "").replace(cjsRequireRegExp, function(match, dep) {
+ deps.push(dep);
+ });
+ deps = (callback.length === 1 ? ["require"] : ["require", "exports", "module"]).concat(deps);
+ }
+ }
+ if (useInteractive) {
+ node = currentlyAddingScript || getInteractiveScript();
+ if (node) {
+ if (!name) {
+ name = node.getAttribute("data-requiremodule");
+ }
+ context = contexts[node.getAttribute("data-requirecontext")];
+ }
+ }
+ if (context) {
+ context.defQueue.push([name, deps, callback]);
+ context.defQueueMap[name] = true;
+ } else {
+ globalDefQueue.push([name, deps, callback]);
+ }
+ };
+ define.amd = {
+ jQuery: true
+ };
+ req.exec = function(text) {
+ return eval(text);
+ };
+ req(cfg);
+})(this);
diff --git a/examples/cesium/Workers/combine-4598d225.js b/examples/cesium/Workers/combine-4598d225.js
new file mode 100644
index 0000000..478cd8e
--- /dev/null
+++ b/examples/cesium/Workers/combine-4598d225.js
@@ -0,0 +1,108 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports', './defaultValue-0ab18f7d'], (function (exports, defaultValue) { 'use strict';
+
+ /**
+ * Merges two objects, copying their properties onto a new combined object. When two objects have the same
+ * property, the value of the property on the first object is used. If either object is undefined,
+ * it will be treated as an empty object.
+ *
+ * @example
+ * const object1 = {
+ * propOne : 1,
+ * propTwo : {
+ * value1 : 10
+ * }
+ * }
+ * const object2 = {
+ * propTwo : 2
+ * }
+ * const final = Cesium.combine(object1, object2);
+ *
+ * // final === {
+ * // propOne : 1,
+ * // propTwo : {
+ * // value1 : 10
+ * // }
+ * // }
+ *
+ * @param {Object} [object1] The first object to merge.
+ * @param {Object} [object2] The second object to merge.
+ * @param {Boolean} [deep=false] Perform a recursive merge.
+ * @returns {Object} The combined object containing all properties from both objects.
+ *
+ * @function
+ */
+ function combine(object1, object2, deep) {
+ deep = defaultValue.defaultValue(deep, false);
+
+ const result = {};
+
+ const object1Defined = defaultValue.defined(object1);
+ const object2Defined = defaultValue.defined(object2);
+ let property;
+ let object1Value;
+ let object2Value;
+ if (object1Defined) {
+ for (property in object1) {
+ if (object1.hasOwnProperty(property)) {
+ object1Value = object1[property];
+ if (
+ object2Defined &&
+ deep &&
+ typeof object1Value === "object" &&
+ object2.hasOwnProperty(property)
+ ) {
+ object2Value = object2[property];
+ if (typeof object2Value === "object") {
+ result[property] = combine(object1Value, object2Value, deep);
+ } else {
+ result[property] = object1Value;
+ }
+ } else {
+ result[property] = object1Value;
+ }
+ }
+ }
+ }
+ if (object2Defined) {
+ for (property in object2) {
+ if (
+ object2.hasOwnProperty(property) &&
+ !result.hasOwnProperty(property)
+ ) {
+ object2Value = object2[property];
+ result[property] = object2Value;
+ }
+ }
+ }
+ return result;
+ }
+
+ exports.combine = combine;
+
+}));
+//# sourceMappingURL=combine-4598d225.js.map
diff --git a/examples/cesium/Workers/combine-4598d225.js.map b/examples/cesium/Workers/combine-4598d225.js.map
new file mode 100644
index 0000000..86b9668
--- /dev/null
+++ b/examples/cesium/Workers/combine-4598d225.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"combine-4598d225.js","sources":["../../../Source/Core/combine.js"],"sourcesContent":["import defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\n\r\n/**\r\n * Merges two objects, copying their properties onto a new combined object. When two objects have the same\r\n * property, the value of the property on the first object is used. If either object is undefined,\r\n * it will be treated as an empty object.\r\n *\r\n * @example\r\n * const object1 = {\r\n * propOne : 1,\r\n * propTwo : {\r\n * value1 : 10\r\n * }\r\n * }\r\n * const object2 = {\r\n * propTwo : 2\r\n * }\r\n * const final = Cesium.combine(object1, object2);\r\n *\r\n * // final === {\r\n * // propOne : 1,\r\n * // propTwo : {\r\n * // value1 : 10\r\n * // }\r\n * // }\r\n *\r\n * @param {Object} [object1] The first object to merge.\r\n * @param {Object} [object2] The second object to merge.\r\n * @param {Boolean} [deep=false] Perform a recursive merge.\r\n * @returns {Object} The combined object containing all properties from both objects.\r\n *\r\n * @function\r\n */\r\nfunction combine(object1, object2, deep) {\r\n deep = defaultValue(deep, false);\r\n\r\n const result = {};\r\n\r\n const object1Defined = defined(object1);\r\n const object2Defined = defined(object2);\r\n let property;\r\n let object1Value;\r\n let object2Value;\r\n if (object1Defined) {\r\n for (property in object1) {\r\n if (object1.hasOwnProperty(property)) {\r\n object1Value = object1[property];\r\n if (\r\n object2Defined &&\r\n deep &&\r\n typeof object1Value === \"object\" &&\r\n object2.hasOwnProperty(property)\r\n ) {\r\n object2Value = object2[property];\r\n if (typeof object2Value === \"object\") {\r\n result[property] = combine(object1Value, object2Value, deep);\r\n } else {\r\n result[property] = object1Value;\r\n }\r\n } else {\r\n result[property] = object1Value;\r\n }\r\n }\r\n }\r\n }\r\n if (object2Defined) {\r\n for (property in object2) {\r\n if (\r\n object2.hasOwnProperty(property) &&\r\n !result.hasOwnProperty(property)\r\n ) {\r\n object2Value = object2[property];\r\n result[property] = object2Value;\r\n }\r\n }\r\n }\r\n return result;\r\n}\r\nexport default combine;\r\n"],"names":["defaultValue","defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;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O,EAAE;EAC9B,MAAM;EACN,QAAQ,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC;EACxC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;EACxC,QAAQ;EACR,QAAQ,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;EACzC,QAAQ,MAAM,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC;EACxC,OAAO;EACP,KAAK;EACL,GAAG;EACH,EAAE,OAAO,MAAM,CAAC;EAChB;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/combineGeometry.js b/examples/cesium/Workers/combineGeometry.js
new file mode 100644
index 0000000..e032c6e
--- /dev/null
+++ b/examples/cesium/Workers/combineGeometry.js
@@ -0,0 +1,43 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./PrimitivePipeline-f6d2b3b0', './createTaskProcessorWorker', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryPipeline-f28890f4', './AttributeCompression-e9888cb8', './EncodedCartesian3-38e2691f', './IndexDatatype-b4e5cf89', './IntersectionTests-2c7928de', './Plane-c9f1487d', './WebMercatorProjection-306f7acc'], (function (PrimitivePipeline, createTaskProcessorWorker, Transforms, Matrix3, Check, defaultValue, Math, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, GeometryAttribute, GeometryAttributes, GeometryPipeline, AttributeCompression, EncodedCartesian3, IndexDatatype, IntersectionTests, Plane, WebMercatorProjection) { 'use strict';
+
+ function combineGeometry(packedParameters, transferableObjects) {
+ const parameters = PrimitivePipeline.PrimitivePipeline.unpackCombineGeometryParameters(
+ packedParameters
+ );
+ const results = PrimitivePipeline.PrimitivePipeline.combineGeometry(parameters);
+ return PrimitivePipeline.PrimitivePipeline.packCombineGeometryResults(
+ results,
+ transferableObjects
+ );
+ }
+ var combineGeometry$1 = createTaskProcessorWorker(combineGeometry);
+
+ return combineGeometry$1;
+
+}));
+//# sourceMappingURL=combineGeometry.js.map
diff --git a/examples/cesium/Workers/combineGeometry.js.map b/examples/cesium/Workers/combineGeometry.js.map
new file mode 100644
index 0000000..18f73cc
--- /dev/null
+++ b/examples/cesium/Workers/combineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"combineGeometry.js","sources":["../../../Source/WorkersES6/combineGeometry.js"],"sourcesContent":["import PrimitivePipeline from \"../Scene/PrimitivePipeline.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nfunction combineGeometry(packedParameters, transferableObjects) {\r\n const parameters = PrimitivePipeline.unpackCombineGeometryParameters(\r\n packedParameters\r\n );\r\n const results = PrimitivePipeline.combineGeometry(parameters);\r\n return PrimitivePipeline.packCombineGeometryResults(\r\n results,\r\n transferableObjects\r\n );\r\n}\r\nexport default createTaskProcessorWorker(combineGeometry);\r\n"],"names":["PrimitivePipeline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,SAAS,eAAe,CAAC,gBAAgB,EAAE,mBAAmB,EAAE;EAChE,EAAE,MAAM,UAAU,GAAGA,mCAAiB,CAAC,+BAA+B;EACtE,IAAI,gBAAgB;EACpB,GAAG,CAAC;EACJ,EAAE,MAAM,OAAO,GAAGA,mCAAiB,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;EAChE,EAAE,OAAOA,mCAAiB,CAAC,0BAA0B;EACrD,IAAI,OAAO;EACX,IAAI,mBAAmB;EACvB,GAAG,CAAC;EACJ,CAAC;AACD,0BAAe,yBAAyB,CAAC,eAAe,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createBoxGeometry.js b/examples/cesium/Workers/createBoxGeometry.js
new file mode 100644
index 0000000..4f0c99f
--- /dev/null
+++ b/examples/cesium/Workers/createBoxGeometry.js
@@ -0,0 +1,38 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./BoxGeometry-2c7f2d2d', './defaultValue-0ab18f7d', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './VertexFormat-f2d74c96'], (function (BoxGeometry, defaultValue, Transforms, Matrix3, Check, Math, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, VertexFormat) { 'use strict';
+
+ function createBoxGeometry(boxGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ boxGeometry = BoxGeometry.BoxGeometry.unpack(boxGeometry, offset);
+ }
+ return BoxGeometry.BoxGeometry.createGeometry(boxGeometry);
+ }
+
+ return createBoxGeometry;
+
+}));
+//# sourceMappingURL=createBoxGeometry.js.map
diff --git a/examples/cesium/Workers/createBoxGeometry.js.map b/examples/cesium/Workers/createBoxGeometry.js.map
new file mode 100644
index 0000000..0c7d199
--- /dev/null
+++ b/examples/cesium/Workers/createBoxGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createBoxGeometry.js","sources":["../../../Source/WorkersES6/createBoxGeometry.js"],"sourcesContent":["import BoxGeometry from \"../Core/BoxGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\n\r\nfunction createBoxGeometry(boxGeometry, offset) {\r\n if (defined(offset)) {\r\n boxGeometry = BoxGeometry.unpack(boxGeometry, offset);\r\n }\r\n return BoxGeometry.createGeometry(boxGeometry);\r\n}\r\nexport default createBoxGeometry;\r\n"],"names":["defined","BoxGeometry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,SAAS,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE;EAChD,EAAE,IAAIA,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,WAAW,GAAGC,uBAAW,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;EAC1D,GAAG;EACH,EAAE,OAAOA,uBAAW,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;EACjD;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createBoxOutlineGeometry.js b/examples/cesium/Workers/createBoxOutlineGeometry.js
new file mode 100644
index 0000000..e3cf5f1
--- /dev/null
+++ b/examples/cesium/Workers/createBoxOutlineGeometry.js
@@ -0,0 +1,339 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29'], (function (Transforms, Matrix3, Check, ComponentDatatype, defaultValue, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, Math, Matrix2, RuntimeError, combine, WebGLConstants) { 'use strict';
+
+ const diffScratch = new Matrix3.Cartesian3();
+
+ /**
+ * A description of the outline of a cube centered at the origin.
+ *
+ * @alias BoxOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.
+ * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.
+ *
+ * @see BoxOutlineGeometry.fromDimensions
+ * @see BoxOutlineGeometry.createGeometry
+ * @see Packable
+ *
+ * @example
+ * const box = new Cesium.BoxOutlineGeometry({
+ * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),
+ * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)
+ * });
+ * const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
+ */
+ function BoxOutlineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const min = options.minimum;
+ const max = options.maximum;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("min", min);
+ Check.Check.typeOf.object("max", max);
+ if (
+ defaultValue.defined(options.offsetAttribute) &&
+ options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP
+ ) {
+ throw new Check.DeveloperError(
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
+ );
+ }
+ //>>includeEnd('debug');
+
+ this._min = Matrix3.Cartesian3.clone(min);
+ this._max = Matrix3.Cartesian3.clone(max);
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createBoxOutlineGeometry";
+ }
+
+ /**
+ * Creates an outline of a cube centered at the origin given its dimensions.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3
, respectively.
+ * @returns {BoxOutlineGeometry}
+ *
+ * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.
+ *
+ *
+ * @example
+ * const box = Cesium.BoxOutlineGeometry.fromDimensions({
+ * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)
+ * });
+ * const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);
+ *
+ * @see BoxOutlineGeometry.createGeometry
+ */
+ BoxOutlineGeometry.fromDimensions = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const dimensions = options.dimensions;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("dimensions", dimensions);
+ Check.Check.typeOf.number.greaterThanOrEquals("dimensions.x", dimensions.x, 0);
+ Check.Check.typeOf.number.greaterThanOrEquals("dimensions.y", dimensions.y, 0);
+ Check.Check.typeOf.number.greaterThanOrEquals("dimensions.z", dimensions.z, 0);
+ //>>includeEnd('debug');
+
+ const corner = Matrix3.Cartesian3.multiplyByScalar(dimensions, 0.5, new Matrix3.Cartesian3());
+
+ return new BoxOutlineGeometry({
+ minimum: Matrix3.Cartesian3.negate(corner, new Matrix3.Cartesian3()),
+ maximum: corner,
+ offsetAttribute: options.offsetAttribute,
+ });
+ };
+
+ /**
+ * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox.
+ *
+ * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.
+ * @returns {BoxOutlineGeometry}
+ *
+ *
+ *
+ * @example
+ * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0,
+ * -75.0, 30.0,
+ * -70.0, 30.0,
+ * -68.0, 40.0
+ * ]));
+ * const box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb);
+ *
+ * @see BoxOutlineGeometry.createGeometry
+ */
+ BoxOutlineGeometry.fromAxisAlignedBoundingBox = function (boundingBox) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("boundindBox", boundingBox);
+ //>>includeEnd('debug');
+
+ return new BoxOutlineGeometry({
+ minimum: boundingBox.minimum,
+ maximum: boundingBox.maximum,
+ });
+ };
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ BoxOutlineGeometry.packedLength = 2 * Matrix3.Cartesian3.packedLength + 1;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {BoxOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ BoxOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ Matrix3.Cartesian3.pack(value._min, array, startingIndex);
+ Matrix3.Cartesian3.pack(value._max, array, startingIndex + Matrix3.Cartesian3.packedLength);
+ array[startingIndex + Matrix3.Cartesian3.packedLength * 2] = defaultValue.defaultValue(
+ value._offsetAttribute,
+ -1
+ );
+
+ return array;
+ };
+
+ const scratchMin = new Matrix3.Cartesian3();
+ const scratchMax = new Matrix3.Cartesian3();
+ const scratchOptions = {
+ minimum: scratchMin,
+ maximum: scratchMax,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {BoxOutlineGeometry} [result] The object into which to store the result.
+ * @returns {BoxOutlineGeometry} The modified result parameter or a new BoxOutlineGeometry instance if one was not provided.
+ */
+ BoxOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const min = Matrix3.Cartesian3.unpack(array, startingIndex, scratchMin);
+ const max = Matrix3.Cartesian3.unpack(
+ array,
+ startingIndex + Matrix3.Cartesian3.packedLength,
+ scratchMax
+ );
+ const offsetAttribute = array[startingIndex + Matrix3.Cartesian3.packedLength * 2];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+ return new BoxOutlineGeometry(scratchOptions);
+ }
+
+ result._min = Matrix3.Cartesian3.clone(min, result._min);
+ result._max = Matrix3.Cartesian3.clone(max, result._max);
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {BoxOutlineGeometry} boxGeometry A description of the box outline.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ BoxOutlineGeometry.createGeometry = function (boxGeometry) {
+ const min = boxGeometry._min;
+ const max = boxGeometry._max;
+
+ if (Matrix3.Cartesian3.equals(min, max)) {
+ return;
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ const indices = new Uint16Array(12 * 2);
+ const positions = new Float64Array(8 * 3);
+
+ positions[0] = min.x;
+ positions[1] = min.y;
+ positions[2] = min.z;
+ positions[3] = max.x;
+ positions[4] = min.y;
+ positions[5] = min.z;
+ positions[6] = max.x;
+ positions[7] = max.y;
+ positions[8] = min.z;
+ positions[9] = min.x;
+ positions[10] = max.y;
+ positions[11] = min.z;
+
+ positions[12] = min.x;
+ positions[13] = min.y;
+ positions[14] = max.z;
+ positions[15] = max.x;
+ positions[16] = min.y;
+ positions[17] = max.z;
+ positions[18] = max.x;
+ positions[19] = max.y;
+ positions[20] = max.z;
+ positions[21] = min.x;
+ positions[22] = max.y;
+ positions[23] = max.z;
+
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+
+ // top
+ indices[0] = 4;
+ indices[1] = 5;
+ indices[2] = 5;
+ indices[3] = 6;
+ indices[4] = 6;
+ indices[5] = 7;
+ indices[6] = 7;
+ indices[7] = 4;
+
+ // bottom
+ indices[8] = 0;
+ indices[9] = 1;
+ indices[10] = 1;
+ indices[11] = 2;
+ indices[12] = 2;
+ indices[13] = 3;
+ indices[14] = 3;
+ indices[15] = 0;
+
+ // left
+ indices[16] = 0;
+ indices[17] = 4;
+ indices[18] = 1;
+ indices[19] = 5;
+
+ //right
+ indices[20] = 2;
+ indices[21] = 6;
+ indices[22] = 3;
+ indices[23] = 7;
+
+ const diff = Matrix3.Cartesian3.subtract(max, min, diffScratch);
+ const radius = Matrix3.Cartesian3.magnitude(diff) * 0.5;
+
+ if (defaultValue.defined(boxGeometry._offsetAttribute)) {
+ const length = positions.length;
+ const offsetValue =
+ boxGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: new Transforms.BoundingSphere(Matrix3.Cartesian3.ZERO, radius),
+ offsetAttribute: boxGeometry._offsetAttribute,
+ });
+ };
+
+ function createBoxOutlineGeometry(boxGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ boxGeometry = BoxOutlineGeometry.unpack(boxGeometry, offset);
+ }
+ return BoxOutlineGeometry.createGeometry(boxGeometry);
+ }
+
+ return createBoxOutlineGeometry;
+
+}));
+//# sourceMappingURL=createBoxOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createBoxOutlineGeometry.js.map b/examples/cesium/Workers/createBoxOutlineGeometry.js.map
new file mode 100644
index 0000000..146b99f
--- /dev/null
+++ b/examples/cesium/Workers/createBoxOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createBoxOutlineGeometry.js","sources":["../../../Source/Core/BoxOutlineGeometry.js","../../../Source/WorkersES6/createBoxOutlineGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\n\r\nconst diffScratch = new Cartesian3();\r\n\r\n/**\r\n * A description of the outline of a cube centered at the origin.\r\n *\r\n * @alias BoxOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3} options.minimum The minimum x, y, and z coordinates of the box.\r\n * @param {Cartesian3} options.maximum The maximum x, y, and z coordinates of the box.\r\n *\r\n * @see BoxOutlineGeometry.fromDimensions\r\n * @see BoxOutlineGeometry.createGeometry\r\n * @see Packable\r\n *\r\n * @example\r\n * const box = new Cesium.BoxOutlineGeometry({\r\n * maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0),\r\n * minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0)\r\n * });\r\n * const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);\r\n */\r\nfunction BoxOutlineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const min = options.minimum;\r\n const max = options.maximum;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"min\", min);\r\n Check.typeOf.object(\"max\", max);\r\n if (\r\n defined(options.offsetAttribute) &&\r\n options.offsetAttribute === GeometryOffsetAttribute.TOP\r\n ) {\r\n throw new DeveloperError(\r\n \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n this._min = Cartesian3.clone(min);\r\n this._max = Cartesian3.clone(max);\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._workerName = \"createBoxOutlineGeometry\";\r\n}\r\n\r\n/**\r\n * Creates an outline of a cube centered at the origin given its dimensions.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3} options.dimensions The width, depth, and height of the box stored in the x, y, and z coordinates of the Cartesian3
, respectively.\r\n * @returns {BoxOutlineGeometry}\r\n *\r\n * @exception {DeveloperError} All dimensions components must be greater than or equal to zero.\r\n *\r\n *\r\n * @example\r\n * const box = Cesium.BoxOutlineGeometry.fromDimensions({\r\n * dimensions : new Cesium.Cartesian3(500000.0, 500000.0, 500000.0)\r\n * });\r\n * const geometry = Cesium.BoxOutlineGeometry.createGeometry(box);\r\n *\r\n * @see BoxOutlineGeometry.createGeometry\r\n */\r\nBoxOutlineGeometry.fromDimensions = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const dimensions = options.dimensions;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"dimensions\", dimensions);\r\n Check.typeOf.number.greaterThanOrEquals(\"dimensions.x\", dimensions.x, 0);\r\n Check.typeOf.number.greaterThanOrEquals(\"dimensions.y\", dimensions.y, 0);\r\n Check.typeOf.number.greaterThanOrEquals(\"dimensions.z\", dimensions.z, 0);\r\n //>>includeEnd('debug');\r\n\r\n const corner = Cartesian3.multiplyByScalar(dimensions, 0.5, new Cartesian3());\r\n\r\n return new BoxOutlineGeometry({\r\n minimum: Cartesian3.negate(corner, new Cartesian3()),\r\n maximum: corner,\r\n offsetAttribute: options.offsetAttribute,\r\n });\r\n};\r\n\r\n/**\r\n * Creates an outline of a cube from the dimensions of an AxisAlignedBoundingBox.\r\n *\r\n * @param {AxisAlignedBoundingBox} boundingBox A description of the AxisAlignedBoundingBox.\r\n * @returns {BoxOutlineGeometry}\r\n *\r\n *\r\n *\r\n * @example\r\n * const aabb = Cesium.AxisAlignedBoundingBox.fromPoints(Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0,\r\n * -75.0, 30.0,\r\n * -70.0, 30.0,\r\n * -68.0, 40.0\r\n * ]));\r\n * const box = Cesium.BoxOutlineGeometry.fromAxisAlignedBoundingBox(aabb);\r\n *\r\n * @see BoxOutlineGeometry.createGeometry\r\n */\r\nBoxOutlineGeometry.fromAxisAlignedBoundingBox = function (boundingBox) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"boundindBox\", boundingBox);\r\n //>>includeEnd('debug');\r\n\r\n return new BoxOutlineGeometry({\r\n minimum: boundingBox.minimum,\r\n maximum: boundingBox.maximum,\r\n });\r\n};\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nBoxOutlineGeometry.packedLength = 2 * Cartesian3.packedLength + 1;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {BoxOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nBoxOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n Cartesian3.pack(value._min, array, startingIndex);\r\n Cartesian3.pack(value._max, array, startingIndex + Cartesian3.packedLength);\r\n array[startingIndex + Cartesian3.packedLength * 2] = defaultValue(\r\n value._offsetAttribute,\r\n -1\r\n );\r\n\r\n return array;\r\n};\r\n\r\nconst scratchMin = new Cartesian3();\r\nconst scratchMax = new Cartesian3();\r\nconst scratchOptions = {\r\n minimum: scratchMin,\r\n maximum: scratchMax,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {BoxOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {BoxOutlineGeometry} The modified result parameter or a new BoxOutlineGeometry instance if one was not provided.\r\n */\r\nBoxOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const min = Cartesian3.unpack(array, startingIndex, scratchMin);\r\n const max = Cartesian3.unpack(\r\n array,\r\n startingIndex + Cartesian3.packedLength,\r\n scratchMax\r\n );\r\n const offsetAttribute = array[startingIndex + Cartesian3.packedLength * 2];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n return new BoxOutlineGeometry(scratchOptions);\r\n }\r\n\r\n result._min = Cartesian3.clone(min, result._min);\r\n result._max = Cartesian3.clone(max, result._max);\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of an outline of a box, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {BoxOutlineGeometry} boxGeometry A description of the box outline.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nBoxOutlineGeometry.createGeometry = function (boxGeometry) {\r\n const min = boxGeometry._min;\r\n const max = boxGeometry._max;\r\n\r\n if (Cartesian3.equals(min, max)) {\r\n return;\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n const indices = new Uint16Array(12 * 2);\r\n const positions = new Float64Array(8 * 3);\r\n\r\n positions[0] = min.x;\r\n positions[1] = min.y;\r\n positions[2] = min.z;\r\n positions[3] = max.x;\r\n positions[4] = min.y;\r\n positions[5] = min.z;\r\n positions[6] = max.x;\r\n positions[7] = max.y;\r\n positions[8] = min.z;\r\n positions[9] = min.x;\r\n positions[10] = max.y;\r\n positions[11] = min.z;\r\n\r\n positions[12] = min.x;\r\n positions[13] = min.y;\r\n positions[14] = max.z;\r\n positions[15] = max.x;\r\n positions[16] = min.y;\r\n positions[17] = max.z;\r\n positions[18] = max.x;\r\n positions[19] = max.y;\r\n positions[20] = max.z;\r\n positions[21] = min.x;\r\n positions[22] = max.y;\r\n positions[23] = max.z;\r\n\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n\r\n // top\r\n indices[0] = 4;\r\n indices[1] = 5;\r\n indices[2] = 5;\r\n indices[3] = 6;\r\n indices[4] = 6;\r\n indices[5] = 7;\r\n indices[6] = 7;\r\n indices[7] = 4;\r\n\r\n // bottom\r\n indices[8] = 0;\r\n indices[9] = 1;\r\n indices[10] = 1;\r\n indices[11] = 2;\r\n indices[12] = 2;\r\n indices[13] = 3;\r\n indices[14] = 3;\r\n indices[15] = 0;\r\n\r\n // left\r\n indices[16] = 0;\r\n indices[17] = 4;\r\n indices[18] = 1;\r\n indices[19] = 5;\r\n\r\n //right\r\n indices[20] = 2;\r\n indices[21] = 6;\r\n indices[22] = 3;\r\n indices[23] = 7;\r\n\r\n const diff = Cartesian3.subtract(max, min, diffScratch);\r\n const radius = Cartesian3.magnitude(diff) * 0.5;\r\n\r\n if (defined(boxGeometry._offsetAttribute)) {\r\n const length = positions.length;\r\n const offsetValue =\r\n boxGeometry._offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: new BoundingSphere(Cartesian3.ZERO, radius),\r\n offsetAttribute: boxGeometry._offsetAttribute,\r\n });\r\n};\r\nexport default BoxOutlineGeometry;\r\n","import BoxOutlineGeometry from \"../Core/BoxOutlineGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\n\r\nfunction createBoxOutlineGeometry(boxGeometry, offset) {\r\n if (defined(offset)) {\r\n boxGeometry = BoxOutlineGeometry.unpack(boxGeometry, offset);\r\n }\r\n return BoxOutlineGeometry.createGeometry(boxGeometry);\r\n}\r\nexport default createBoxOutlineGeometry;\r\n"],"names":["Cartesian3","defaultValue","Check","defined","GeometryOffsetAttribute","DeveloperError","GeometryAttributes","GeometryAttribute","ComponentDatatype","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAaA,MAAM,WAAW,GAAG,IAAIA,kBAAU,EAAE,CAAC;AACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,kBAAkB,CAAC,OAAO,EAAE;EACrC,EAAE,OAAO,GAAGC,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA,EAAE,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;EAC9B,EAAE,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;AAC9B;EACA;EACA,EAAEC,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;EAClC,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;EAClC,EAAE;EACF,IAAIC,oBAAO,CAAC,OAAO,CAAC,eAAe,CAAC;EACpC,IAAI,OAAO,CAAC,eAAe,KAAKC,+CAAuB,CAAC,GAAG;EAC3D,IAAI;EACJ,IAAI,MAAM,IAAIC,oBAAc;EAC5B,MAAM,2FAA2F;EACjG,KAAK,CAAC;EACN,GAAG;EACH;AACA;EACA,EAAE,IAAI,CAAC,IAAI,GAAGL,kBAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;EACpC,EAAE,IAAI,CAAC,IAAI,GAAGA,kBAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;EACpC,EAAE,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAA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AAC;;ECrTD,SAAS,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE;EACvD,EAAE,IAAIG,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,WAAW,GAAG,kBAAkB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;EACjE,GAAG;EACH,EAAE,OAAO,kBAAkB,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;EACxD;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createCircleGeometry.js b/examples/cesium/Workers/createCircleGeometry.js
new file mode 100644
index 0000000..e5adf7a
--- /dev/null
+++ b/examples/cesium/Workers/createCircleGeometry.js
@@ -0,0 +1,239 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './EllipseGeometry-6f0c1448', './VertexFormat-f2d74c96', './Math-9be8b918', './Transforms-11fb6b0a', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './EllipseGeometryLibrary-d3f88cc2', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryInstance-b2be3e5a', './GeometryOffsetAttribute-cc320d7d', './GeometryPipeline-f28890f4', './AttributeCompression-e9888cb8', './EncodedCartesian3-38e2691f', './IndexDatatype-b4e5cf89', './IntersectionTests-2c7928de', './Plane-c9f1487d'], (function (Matrix3, Check, defaultValue, EllipseGeometry, VertexFormat, Math, Transforms, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, EllipseGeometryLibrary, GeometryAttribute, GeometryAttributes, GeometryInstance, GeometryOffsetAttribute, GeometryPipeline, AttributeCompression, EncodedCartesian3, IndexDatatype, IntersectionTests, Plane) { 'use strict';
+
+ /**
+ * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
+ *
+ * @alias CircleGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3} options.center The circle's center point in the fixed frame.
+ * @param {Number} options.radius The radius in meters.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.
+ * @param {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.
+ * @param {Number} [options.granularity=0.02] The angular distance between points on the circle in radians.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @param {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.
+ * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
+ *
+ * @exception {DeveloperError} radius must be greater than zero.
+ * @exception {DeveloperError} granularity must be greater than zero.
+ *
+ * @see CircleGeometry.createGeometry
+ * @see Packable
+ *
+ * @example
+ * // Create a circle.
+ * const circle = new Cesium.CircleGeometry({
+ * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
+ * radius : 100000.0
+ * });
+ * const geometry = Cesium.CircleGeometry.createGeometry(circle);
+ */
+ function CircleGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const radius = options.radius;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("radius", radius);
+ //>>includeEnd('debug');
+
+ const ellipseGeometryOptions = {
+ center: options.center,
+ semiMajorAxis: radius,
+ semiMinorAxis: radius,
+ ellipsoid: options.ellipsoid,
+ height: options.height,
+ extrudedHeight: options.extrudedHeight,
+ granularity: options.granularity,
+ vertexFormat: options.vertexFormat,
+ stRotation: options.stRotation,
+ shadowVolume: options.shadowVolume,
+ };
+ this._ellipseGeometry = new EllipseGeometry.EllipseGeometry(ellipseGeometryOptions);
+ this._workerName = "createCircleGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ CircleGeometry.packedLength = EllipseGeometry.EllipseGeometry.packedLength;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {CircleGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ CircleGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ //>>includeEnd('debug');
+ return EllipseGeometry.EllipseGeometry.pack(value._ellipseGeometry, array, startingIndex);
+ };
+
+ const scratchEllipseGeometry = new EllipseGeometry.EllipseGeometry({
+ center: new Matrix3.Cartesian3(),
+ semiMajorAxis: 1.0,
+ semiMinorAxis: 1.0,
+ });
+ const scratchOptions = {
+ center: new Matrix3.Cartesian3(),
+ radius: undefined,
+ ellipsoid: Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE),
+ height: undefined,
+ extrudedHeight: undefined,
+ granularity: undefined,
+ vertexFormat: new VertexFormat.VertexFormat(),
+ stRotation: undefined,
+ semiMajorAxis: undefined,
+ semiMinorAxis: undefined,
+ shadowVolume: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {CircleGeometry} [result] The object into which to store the result.
+ * @returns {CircleGeometry} The modified result parameter or a new CircleGeometry instance if one was not provided.
+ */
+ CircleGeometry.unpack = function (array, startingIndex, result) {
+ const ellipseGeometry = EllipseGeometry.EllipseGeometry.unpack(
+ array,
+ startingIndex,
+ scratchEllipseGeometry
+ );
+ scratchOptions.center = Matrix3.Cartesian3.clone(
+ ellipseGeometry._center,
+ scratchOptions.center
+ );
+ scratchOptions.ellipsoid = Matrix3.Ellipsoid.clone(
+ ellipseGeometry._ellipsoid,
+ scratchOptions.ellipsoid
+ );
+ scratchOptions.height = ellipseGeometry._height;
+ scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;
+ scratchOptions.granularity = ellipseGeometry._granularity;
+ scratchOptions.vertexFormat = VertexFormat.VertexFormat.clone(
+ ellipseGeometry._vertexFormat,
+ scratchOptions.vertexFormat
+ );
+ scratchOptions.stRotation = ellipseGeometry._stRotation;
+ scratchOptions.shadowVolume = ellipseGeometry._shadowVolume;
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.radius = ellipseGeometry._semiMajorAxis;
+ return new CircleGeometry(scratchOptions);
+ }
+
+ scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;
+ scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;
+ result._ellipseGeometry = new EllipseGeometry.EllipseGeometry(scratchOptions);
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {CircleGeometry} circleGeometry A description of the circle.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ CircleGeometry.createGeometry = function (circleGeometry) {
+ return EllipseGeometry.EllipseGeometry.createGeometry(circleGeometry._ellipseGeometry);
+ };
+
+ /**
+ * @private
+ */
+ CircleGeometry.createShadowVolume = function (
+ circleGeometry,
+ minHeightFunc,
+ maxHeightFunc
+ ) {
+ const granularity = circleGeometry._ellipseGeometry._granularity;
+ const ellipsoid = circleGeometry._ellipseGeometry._ellipsoid;
+
+ const minHeight = minHeightFunc(granularity, ellipsoid);
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
+
+ return new CircleGeometry({
+ center: circleGeometry._ellipseGeometry._center,
+ radius: circleGeometry._ellipseGeometry._semiMajorAxis,
+ ellipsoid: ellipsoid,
+ stRotation: circleGeometry._ellipseGeometry._stRotation,
+ granularity: granularity,
+ extrudedHeight: minHeight,
+ height: maxHeight,
+ vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
+ shadowVolume: true,
+ });
+ };
+
+ Object.defineProperties(CircleGeometry.prototype, {
+ /**
+ * @private
+ */
+ rectangle: {
+ get: function () {
+ return this._ellipseGeometry.rectangle;
+ },
+ },
+ /**
+ * For remapping texture coordinates when rendering CircleGeometries as GroundPrimitives.
+ * @private
+ */
+ textureCoordinateRotationPoints: {
+ get: function () {
+ return this._ellipseGeometry.textureCoordinateRotationPoints;
+ },
+ },
+ });
+
+ function createCircleGeometry(circleGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ circleGeometry = CircleGeometry.unpack(circleGeometry, offset);
+ }
+ circleGeometry._ellipseGeometry._center = Matrix3.Cartesian3.clone(
+ circleGeometry._ellipseGeometry._center
+ );
+ circleGeometry._ellipseGeometry._ellipsoid = Matrix3.Ellipsoid.clone(
+ circleGeometry._ellipseGeometry._ellipsoid
+ );
+ return CircleGeometry.createGeometry(circleGeometry);
+ }
+
+ return createCircleGeometry;
+
+}));
+//# sourceMappingURL=createCircleGeometry.js.map
diff --git a/examples/cesium/Workers/createCircleGeometry.js.map b/examples/cesium/Workers/createCircleGeometry.js.map
new file mode 100644
index 0000000..4c21c95
--- /dev/null
+++ b/examples/cesium/Workers/createCircleGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createCircleGeometry.js","sources":["../../../Source/Core/CircleGeometry.js","../../../Source/WorkersES6/createCircleGeometry.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport EllipseGeometry from \"./EllipseGeometry.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\n/**\r\n * A description of a circle on the ellipsoid. Circle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\r\n *\r\n * @alias CircleGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3} options.center The circle's center point in the fixed frame.\r\n * @param {Number} options.radius The radius in meters.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.\r\n * @param {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.\r\n * @param {Number} [options.granularity=0.02] The angular distance between points on the circle in radians.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @param {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.\r\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\r\n *\r\n * @exception {DeveloperError} radius must be greater than zero.\r\n * @exception {DeveloperError} granularity must be greater than zero.\r\n *\r\n * @see CircleGeometry.createGeometry\r\n * @see Packable\r\n *\r\n * @example\r\n * // Create a circle.\r\n * const circle = new Cesium.CircleGeometry({\r\n * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\r\n * radius : 100000.0\r\n * });\r\n * const geometry = Cesium.CircleGeometry.createGeometry(circle);\r\n */\r\nfunction CircleGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const radius = options.radius;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"radius\", radius);\r\n //>>includeEnd('debug');\r\n\r\n const ellipseGeometryOptions = {\r\n center: options.center,\r\n semiMajorAxis: radius,\r\n semiMinorAxis: radius,\r\n ellipsoid: options.ellipsoid,\r\n height: options.height,\r\n extrudedHeight: options.extrudedHeight,\r\n granularity: options.granularity,\r\n vertexFormat: options.vertexFormat,\r\n stRotation: options.stRotation,\r\n shadowVolume: options.shadowVolume,\r\n };\r\n this._ellipseGeometry = new EllipseGeometry(ellipseGeometryOptions);\r\n this._workerName = \"createCircleGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nCircleGeometry.packedLength = EllipseGeometry.packedLength;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {CircleGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCircleGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n //>>includeEnd('debug');\r\n return EllipseGeometry.pack(value._ellipseGeometry, array, startingIndex);\r\n};\r\n\r\nconst scratchEllipseGeometry = new EllipseGeometry({\r\n center: new Cartesian3(),\r\n semiMajorAxis: 1.0,\r\n semiMinorAxis: 1.0,\r\n});\r\nconst scratchOptions = {\r\n center: new Cartesian3(),\r\n radius: undefined,\r\n ellipsoid: Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),\r\n height: undefined,\r\n extrudedHeight: undefined,\r\n granularity: undefined,\r\n vertexFormat: new VertexFormat(),\r\n stRotation: undefined,\r\n semiMajorAxis: undefined,\r\n semiMinorAxis: undefined,\r\n shadowVolume: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {CircleGeometry} [result] The object into which to store the result.\r\n * @returns {CircleGeometry} The modified result parameter or a new CircleGeometry instance if one was not provided.\r\n */\r\nCircleGeometry.unpack = function (array, startingIndex, result) {\r\n const ellipseGeometry = EllipseGeometry.unpack(\r\n array,\r\n startingIndex,\r\n scratchEllipseGeometry\r\n );\r\n scratchOptions.center = Cartesian3.clone(\r\n ellipseGeometry._center,\r\n scratchOptions.center\r\n );\r\n scratchOptions.ellipsoid = Ellipsoid.clone(\r\n ellipseGeometry._ellipsoid,\r\n scratchOptions.ellipsoid\r\n );\r\n scratchOptions.height = ellipseGeometry._height;\r\n scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;\r\n scratchOptions.granularity = ellipseGeometry._granularity;\r\n scratchOptions.vertexFormat = VertexFormat.clone(\r\n ellipseGeometry._vertexFormat,\r\n scratchOptions.vertexFormat\r\n );\r\n scratchOptions.stRotation = ellipseGeometry._stRotation;\r\n scratchOptions.shadowVolume = ellipseGeometry._shadowVolume;\r\n\r\n if (!defined(result)) {\r\n scratchOptions.radius = ellipseGeometry._semiMajorAxis;\r\n return new CircleGeometry(scratchOptions);\r\n }\r\n\r\n scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;\r\n scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;\r\n result._ellipseGeometry = new EllipseGeometry(scratchOptions);\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {CircleGeometry} circleGeometry A description of the circle.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nCircleGeometry.createGeometry = function (circleGeometry) {\r\n return EllipseGeometry.createGeometry(circleGeometry._ellipseGeometry);\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nCircleGeometry.createShadowVolume = function (\r\n circleGeometry,\r\n minHeightFunc,\r\n maxHeightFunc\r\n) {\r\n const granularity = circleGeometry._ellipseGeometry._granularity;\r\n const ellipsoid = circleGeometry._ellipseGeometry._ellipsoid;\r\n\r\n const minHeight = minHeightFunc(granularity, ellipsoid);\r\n const maxHeight = maxHeightFunc(granularity, ellipsoid);\r\n\r\n return new CircleGeometry({\r\n center: circleGeometry._ellipseGeometry._center,\r\n radius: circleGeometry._ellipseGeometry._semiMajorAxis,\r\n ellipsoid: ellipsoid,\r\n stRotation: circleGeometry._ellipseGeometry._stRotation,\r\n granularity: granularity,\r\n extrudedHeight: minHeight,\r\n height: maxHeight,\r\n vertexFormat: VertexFormat.POSITION_ONLY,\r\n shadowVolume: true,\r\n });\r\n};\r\n\r\nObject.defineProperties(CircleGeometry.prototype, {\r\n /**\r\n * @private\r\n */\r\n rectangle: {\r\n get: function () {\r\n return this._ellipseGeometry.rectangle;\r\n },\r\n },\r\n /**\r\n * For remapping texture coordinates when rendering CircleGeometries as GroundPrimitives.\r\n * @private\r\n */\r\n textureCoordinateRotationPoints: {\r\n get: function () {\r\n return this._ellipseGeometry.textureCoordinateRotationPoints;\r\n },\r\n },\r\n});\r\nexport default CircleGeometry;\r\n","import Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport CircleGeometry from \"../Core/CircleGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\n\r\nfunction createCircleGeometry(circleGeometry, offset) {\r\n if (defined(offset)) {\r\n circleGeometry = CircleGeometry.unpack(circleGeometry, offset);\r\n }\r\n circleGeometry._ellipseGeometry._center = Cartesian3.clone(\r\n circleGeometry._ellipseGeometry._center\r\n );\r\n circleGeometry._ellipseGeometry._ellipsoid = Ellipsoid.clone(\r\n circleGeometry._ellipseGeometry._ellipsoid\r\n );\r\n return CircleGeometry.createGeometry(circleGeometry);\r\n}\r\nexport default createCircleGeometry;\r\n"],"names":["defaultValue","Check","EllipseGeometry","Cartesian3","Ellipsoid","VertexFormat","defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,cAAc,C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AC,OAAO,GAAGH,kBAAU,CAAC,KAAK;EAC5D,IAAI,cAAc,CAAC,gBAAgB,CAAC,OAAO;EAC3C,GAAG,CAAC;EACJ,EAAE,cAAc,CAAC,gBAAgB,CAAC,UAAU,GAAGC,iBAAS,CAAC,KAAK;EAC9D,IAAI,cAAc,CAAC,gBAAgB,CAAC,UAAU;EAC9C,GAAG,CAAC;EACJ,EAAE,OAAO,cAAc,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;EACvD;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createCircleOutlineGeometry.js b/examples/cesium/Workers/createCircleOutlineGeometry.js
new file mode 100644
index 0000000..8e372bc
--- /dev/null
+++ b/examples/cesium/Workers/createCircleOutlineGeometry.js
@@ -0,0 +1,186 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './EllipseOutlineGeometry-ea3faee0', './Math-9be8b918', './Transforms-11fb6b0a', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './EllipseGeometryLibrary-d3f88cc2', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89'], (function (Matrix3, Check, defaultValue, EllipseOutlineGeometry, Math, Transforms, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, EllipseGeometryLibrary, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype) { 'use strict';
+
+ /**
+ * A description of the outline of a circle on the ellipsoid.
+ *
+ * @alias CircleOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3} options.center The circle's center point in the fixed frame.
+ * @param {Number} options.radius The radius in meters.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.
+ * @param {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.
+ * @param {Number} [options.granularity=0.02] The angular distance between points on the circle in radians.
+ * @param {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.
+ * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom of an extruded circle.
+ *
+ * @exception {DeveloperError} radius must be greater than zero.
+ * @exception {DeveloperError} granularity must be greater than zero.
+ *
+ * @see CircleOutlineGeometry.createGeometry
+ * @see Packable
+ *
+ * @example
+ * // Create a circle.
+ * const circle = new Cesium.CircleOutlineGeometry({
+ * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
+ * radius : 100000.0
+ * });
+ * const geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);
+ */
+ function CircleOutlineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const radius = options.radius;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("radius", radius);
+ //>>includeEnd('debug');
+
+ const ellipseGeometryOptions = {
+ center: options.center,
+ semiMajorAxis: radius,
+ semiMinorAxis: radius,
+ ellipsoid: options.ellipsoid,
+ height: options.height,
+ extrudedHeight: options.extrudedHeight,
+ granularity: options.granularity,
+ numberOfVerticalLines: options.numberOfVerticalLines,
+ };
+ this._ellipseGeometry = new EllipseOutlineGeometry.EllipseOutlineGeometry(ellipseGeometryOptions);
+ this._workerName = "createCircleOutlineGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ CircleOutlineGeometry.packedLength = EllipseOutlineGeometry.EllipseOutlineGeometry.packedLength;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {CircleOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ CircleOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ //>>includeEnd('debug');
+ return EllipseOutlineGeometry.EllipseOutlineGeometry.pack(
+ value._ellipseGeometry,
+ array,
+ startingIndex
+ );
+ };
+
+ const scratchEllipseGeometry = new EllipseOutlineGeometry.EllipseOutlineGeometry({
+ center: new Matrix3.Cartesian3(),
+ semiMajorAxis: 1.0,
+ semiMinorAxis: 1.0,
+ });
+ const scratchOptions = {
+ center: new Matrix3.Cartesian3(),
+ radius: undefined,
+ ellipsoid: Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE),
+ height: undefined,
+ extrudedHeight: undefined,
+ granularity: undefined,
+ numberOfVerticalLines: undefined,
+ semiMajorAxis: undefined,
+ semiMinorAxis: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {CircleOutlineGeometry} [result] The object into which to store the result.
+ * @returns {CircleOutlineGeometry} The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.
+ */
+ CircleOutlineGeometry.unpack = function (array, startingIndex, result) {
+ const ellipseGeometry = EllipseOutlineGeometry.EllipseOutlineGeometry.unpack(
+ array,
+ startingIndex,
+ scratchEllipseGeometry
+ );
+ scratchOptions.center = Matrix3.Cartesian3.clone(
+ ellipseGeometry._center,
+ scratchOptions.center
+ );
+ scratchOptions.ellipsoid = Matrix3.Ellipsoid.clone(
+ ellipseGeometry._ellipsoid,
+ scratchOptions.ellipsoid
+ );
+ scratchOptions.height = ellipseGeometry._height;
+ scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;
+ scratchOptions.granularity = ellipseGeometry._granularity;
+ scratchOptions.numberOfVerticalLines = ellipseGeometry._numberOfVerticalLines;
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.radius = ellipseGeometry._semiMajorAxis;
+ return new CircleOutlineGeometry(scratchOptions);
+ }
+
+ scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;
+ scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;
+ result._ellipseGeometry = new EllipseOutlineGeometry.EllipseOutlineGeometry(scratchOptions);
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {CircleOutlineGeometry} circleGeometry A description of the circle.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ CircleOutlineGeometry.createGeometry = function (circleGeometry) {
+ return EllipseOutlineGeometry.EllipseOutlineGeometry.createGeometry(circleGeometry._ellipseGeometry);
+ };
+
+ function createCircleOutlineGeometry(circleGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ circleGeometry = CircleOutlineGeometry.unpack(circleGeometry, offset);
+ }
+ circleGeometry._ellipseGeometry._center = Matrix3.Cartesian3.clone(
+ circleGeometry._ellipseGeometry._center
+ );
+ circleGeometry._ellipseGeometry._ellipsoid = Matrix3.Ellipsoid.clone(
+ circleGeometry._ellipseGeometry._ellipsoid
+ );
+ return CircleOutlineGeometry.createGeometry(circleGeometry);
+ }
+
+ return createCircleOutlineGeometry;
+
+}));
+//# sourceMappingURL=createCircleOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createCircleOutlineGeometry.js.map b/examples/cesium/Workers/createCircleOutlineGeometry.js.map
new file mode 100644
index 0000000..2e27efb
--- /dev/null
+++ b/examples/cesium/Workers/createCircleOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createCircleOutlineGeometry.js","sources":["../../../Source/Core/CircleOutlineGeometry.js","../../../Source/WorkersES6/createCircleOutlineGeometry.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport EllipseOutlineGeometry from \"./EllipseOutlineGeometry.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\n\r\n/**\r\n * A description of the outline of a circle on the ellipsoid.\r\n *\r\n * @alias CircleOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3} options.center The circle's center point in the fixed frame.\r\n * @param {Number} options.radius The radius in meters.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the circle will be on.\r\n * @param {Number} [options.height=0.0] The distance in meters between the circle and the ellipsoid surface.\r\n * @param {Number} [options.granularity=0.02] The angular distance between points on the circle in radians.\r\n * @param {Number} [options.extrudedHeight=0.0] The distance in meters between the circle's extruded face and the ellipsoid surface.\r\n * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom of an extruded circle.\r\n *\r\n * @exception {DeveloperError} radius must be greater than zero.\r\n * @exception {DeveloperError} granularity must be greater than zero.\r\n *\r\n * @see CircleOutlineGeometry.createGeometry\r\n * @see Packable\r\n *\r\n * @example\r\n * // Create a circle.\r\n * const circle = new Cesium.CircleOutlineGeometry({\r\n * center : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),\r\n * radius : 100000.0\r\n * });\r\n * const geometry = Cesium.CircleOutlineGeometry.createGeometry(circle);\r\n */\r\nfunction CircleOutlineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const radius = options.radius;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"radius\", radius);\r\n //>>includeEnd('debug');\r\n\r\n const ellipseGeometryOptions = {\r\n center: options.center,\r\n semiMajorAxis: radius,\r\n semiMinorAxis: radius,\r\n ellipsoid: options.ellipsoid,\r\n height: options.height,\r\n extrudedHeight: options.extrudedHeight,\r\n granularity: options.granularity,\r\n numberOfVerticalLines: options.numberOfVerticalLines,\r\n };\r\n this._ellipseGeometry = new EllipseOutlineGeometry(ellipseGeometryOptions);\r\n this._workerName = \"createCircleOutlineGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nCircleOutlineGeometry.packedLength = EllipseOutlineGeometry.packedLength;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {CircleOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCircleOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n //>>includeEnd('debug');\r\n return EllipseOutlineGeometry.pack(\r\n value._ellipseGeometry,\r\n array,\r\n startingIndex\r\n );\r\n};\r\n\r\nconst scratchEllipseGeometry = new EllipseOutlineGeometry({\r\n center: new Cartesian3(),\r\n semiMajorAxis: 1.0,\r\n semiMinorAxis: 1.0,\r\n});\r\nconst scratchOptions = {\r\n center: new Cartesian3(),\r\n radius: undefined,\r\n ellipsoid: Ellipsoid.clone(Ellipsoid.UNIT_SPHERE),\r\n height: undefined,\r\n extrudedHeight: undefined,\r\n granularity: undefined,\r\n numberOfVerticalLines: undefined,\r\n semiMajorAxis: undefined,\r\n semiMinorAxis: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {CircleOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {CircleOutlineGeometry} The modified result parameter or a new CircleOutlineGeometry instance if one was not provided.\r\n */\r\nCircleOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n const ellipseGeometry = EllipseOutlineGeometry.unpack(\r\n array,\r\n startingIndex,\r\n scratchEllipseGeometry\r\n );\r\n scratchOptions.center = Cartesian3.clone(\r\n ellipseGeometry._center,\r\n scratchOptions.center\r\n );\r\n scratchOptions.ellipsoid = Ellipsoid.clone(\r\n ellipseGeometry._ellipsoid,\r\n scratchOptions.ellipsoid\r\n );\r\n scratchOptions.height = ellipseGeometry._height;\r\n scratchOptions.extrudedHeight = ellipseGeometry._extrudedHeight;\r\n scratchOptions.granularity = ellipseGeometry._granularity;\r\n scratchOptions.numberOfVerticalLines = ellipseGeometry._numberOfVerticalLines;\r\n\r\n if (!defined(result)) {\r\n scratchOptions.radius = ellipseGeometry._semiMajorAxis;\r\n return new CircleOutlineGeometry(scratchOptions);\r\n }\r\n\r\n scratchOptions.semiMajorAxis = ellipseGeometry._semiMajorAxis;\r\n scratchOptions.semiMinorAxis = ellipseGeometry._semiMinorAxis;\r\n result._ellipseGeometry = new EllipseOutlineGeometry(scratchOptions);\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of an outline of a circle on an ellipsoid, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {CircleOutlineGeometry} circleGeometry A description of the circle.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nCircleOutlineGeometry.createGeometry = function (circleGeometry) {\r\n return EllipseOutlineGeometry.createGeometry(circleGeometry._ellipseGeometry);\r\n};\r\nexport default CircleOutlineGeometry;\r\n","import Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport CircleOutlineGeometry from \"../Core/CircleOutlineGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\n\r\nfunction createCircleOutlineGeometry(circleGeometry, offset) {\r\n if (defined(offset)) {\r\n circleGeometry = CircleOutlineGeometry.unpack(circleGeometry, offset);\r\n }\r\n circleGeometry._ellipseGeometry._center = Cartesian3.clone(\r\n circleGeometry._ellipseGeometry._center\r\n );\r\n circleGeometry._ellipseGeometry._ellipsoid = Ellipsoid.clone(\r\n circleGeometry._ellipseGeometry._ellipsoid\r\n );\r\n return CircleOutlineGeometry.createGeometry(circleGeometry);\r\n}\r\nexport default createCircleOutlineGeometry;\r\n"],"names":["defaultValue","Check","EllipseOutlineGeometry","Cartesian3","Ellipsoid","defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAOA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,qBAAqB,CAAC,OAAO,EAAE;EACxC,EAAE,OAAO,GAAGA,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;EAC7D,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAChC;EACA;EACA,EAAEC,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;EACxC;AACA;EACA,EAAE,MAAM,sBAAsB,GAAG;EACjC,IAAI,MAAM,EAAE,OAAO,CAAC,MAAM;EAC1B,IAAI,aAAa,EAAE,MAAM;EACzB,IAAI,aAAa,EAAE,MAAM;EACzB,IAAI,SAAS,EAAE,OAAO,CAAC,SAAS;EAChC,IAAI,MAAM,EAAE,OAAO,CAAC,MAAM;EAC1B,IAAI,cAAc,EAAE,OAAO,CAAC,cAAc;EAC1C,IAAI,WAAW,EAAE,OAAO,CAAC,WAAW;EACpC,IAAI,qBAAqB,EAAE,OAAO,CAAC,qBAAqB;EACxD,GAAG,CAAC;EACJ,EAAE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AC,cAAc,CAAC,gBAAgB,CAAC,CAAC;EAChF,CAAC;;EC9ID,SAAS,2BAA2B,CAAC,cAAc,EAAE,MAAM,EAAE;EAC7D,EAAE,IAAIG,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,cAAc,GAAG,qBAAqB,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;EAC1E,GAAG;EACH,EAAE,cAAc,CAAC,gBAAgB,CAAC,OAAO,GAAGF,kBAAU,CAAC,KAAK;EAC5D,IAAI,cAAc,CAAC,gBAAgB,CAAC,OAAO;EAC3C,GAAG,CAAC;EACJ,EAAE,cAAc,CAAC,gBAAgB,CAAC,UAAU,GAAGC,iBAAS,CAAC,KAAK;EAC9D,IAAI,cAAc,CAAC,gBAAgB,CAAC,UAAU;EAC9C,GAAG,CAAC;EACJ,EAAE,OAAO,qBAAqB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;EAC9D;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createCoplanarPolygonGeometry.js b/examples/cesium/Workers/createCoplanarPolygonGeometry.js
new file mode 100644
index 0000000..c7a5581
--- /dev/null
+++ b/examples/cesium/Workers/createCoplanarPolygonGeometry.js
@@ -0,0 +1,612 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./arrayRemoveDuplicates-c3526030', './BoundingRectangle-6617ed83', './Transforms-11fb6b0a', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './CoplanarPolygonGeometryLibrary-dfba6465', './defaultValue-0ab18f7d', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryInstance-b2be3e5a', './GeometryPipeline-f28890f4', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolygonGeometryLibrary-62266ab5', './PolygonPipeline-313487c3', './VertexFormat-f2d74c96', './combine-4598d225', './RuntimeError-e5c6a8b9', './WebGLConstants-f27a5e29', './OrientedBoundingBox-7e2eebab', './EllipsoidTangentPlane-c421b2cb', './AxisAlignedBoundingBox-50342d27', './IntersectionTests-2c7928de', './Plane-c9f1487d', './AttributeCompression-e9888cb8', './EncodedCartesian3-38e2691f', './ArcType-d608b872', './EllipsoidRhumbLine-48b4507b'], (function (arrayRemoveDuplicates, BoundingRectangle, Transforms, Matrix2, Matrix3, Check, ComponentDatatype, CoplanarPolygonGeometryLibrary, defaultValue, GeometryAttribute, GeometryAttributes, GeometryInstance, GeometryPipeline, IndexDatatype, Math, PolygonGeometryLibrary, PolygonPipeline, VertexFormat, combine, RuntimeError, WebGLConstants, OrientedBoundingBox, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane, AttributeCompression, EncodedCartesian3, ArcType, EllipsoidRhumbLine) { 'use strict';
+
+ const scratchPosition = new Matrix3.Cartesian3();
+ const scratchBR = new BoundingRectangle.BoundingRectangle();
+ const stScratch = new Matrix2.Cartesian2();
+ const textureCoordinatesOrigin = new Matrix2.Cartesian2();
+ const scratchNormal = new Matrix3.Cartesian3();
+ const scratchTangent = new Matrix3.Cartesian3();
+ const scratchBitangent = new Matrix3.Cartesian3();
+ const centerScratch = new Matrix3.Cartesian3();
+ const axis1Scratch = new Matrix3.Cartesian3();
+ const axis2Scratch = new Matrix3.Cartesian3();
+ const quaternionScratch = new Transforms.Quaternion();
+ const textureMatrixScratch = new Matrix3.Matrix3();
+ const tangentRotationScratch = new Matrix3.Matrix3();
+ const surfaceNormalScratch = new Matrix3.Cartesian3();
+
+ function createGeometryFromPolygon(
+ polygon,
+ vertexFormat,
+ boundingRectangle,
+ stRotation,
+ hardcodedTextureCoordinates,
+ projectPointTo2D,
+ normal,
+ tangent,
+ bitangent
+ ) {
+ const positions = polygon.positions;
+ let indices = PolygonPipeline.PolygonPipeline.triangulate(polygon.positions2D, polygon.holes);
+
+ /* If polygon is completely unrenderable, just use the first three vertices */
+ if (indices.length < 3) {
+ indices = [0, 1, 2];
+ }
+
+ const newIndices = IndexDatatype.IndexDatatype.createTypedArray(
+ positions.length,
+ indices.length
+ );
+ newIndices.set(indices);
+
+ let textureMatrix = textureMatrixScratch;
+ if (stRotation !== 0.0) {
+ let rotation = Transforms.Quaternion.fromAxisAngle(
+ normal,
+ stRotation,
+ quaternionScratch
+ );
+ textureMatrix = Matrix3.Matrix3.fromQuaternion(rotation, textureMatrix);
+
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ rotation = Transforms.Quaternion.fromAxisAngle(
+ normal,
+ -stRotation,
+ quaternionScratch
+ );
+ const tangentRotation = Matrix3.Matrix3.fromQuaternion(
+ rotation,
+ tangentRotationScratch
+ );
+
+ tangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Matrix3.multiplyByVector(tangentRotation, tangent, tangent),
+ tangent
+ );
+ if (vertexFormat.bitangent) {
+ bitangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(normal, tangent, bitangent),
+ bitangent
+ );
+ }
+ }
+ } else {
+ textureMatrix = Matrix3.Matrix3.clone(Matrix3.Matrix3.IDENTITY, textureMatrix);
+ }
+
+ const stOrigin = textureCoordinatesOrigin;
+ if (vertexFormat.st) {
+ stOrigin.x = boundingRectangle.x;
+ stOrigin.y = boundingRectangle.y;
+ }
+
+ const length = positions.length;
+ const size = length * 3;
+ const flatPositions = new Float64Array(size);
+ const normals = vertexFormat.normal ? new Float32Array(size) : undefined;
+ const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(size)
+ : undefined;
+ const textureCoordinates = vertexFormat.st
+ ? new Float32Array(length * 2)
+ : undefined;
+
+ let positionIndex = 0;
+ let normalIndex = 0;
+ let bitangentIndex = 0;
+ let tangentIndex = 0;
+ let stIndex = 0;
+
+ for (let i = 0; i < length; i++) {
+ const position = positions[i];
+ flatPositions[positionIndex++] = position.x;
+ flatPositions[positionIndex++] = position.y;
+ flatPositions[positionIndex++] = position.z;
+
+ if (vertexFormat.st) {
+ if (
+ defaultValue.defined(hardcodedTextureCoordinates) &&
+ hardcodedTextureCoordinates.positions.length === length
+ ) {
+ textureCoordinates[stIndex++] =
+ hardcodedTextureCoordinates.positions[i].x;
+ textureCoordinates[stIndex++] =
+ hardcodedTextureCoordinates.positions[i].y;
+ } else {
+ const p = Matrix3.Matrix3.multiplyByVector(
+ textureMatrix,
+ position,
+ scratchPosition
+ );
+ const st = projectPointTo2D(p, stScratch);
+ Matrix2.Cartesian2.subtract(st, stOrigin, st);
+
+ const stx = Math.CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);
+ const sty = Math.CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);
+ textureCoordinates[stIndex++] = stx;
+ textureCoordinates[stIndex++] = sty;
+ }
+ }
+
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = normal.x;
+ normals[normalIndex++] = normal.y;
+ normals[normalIndex++] = normal.z;
+ }
+
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ }
+
+ if (vertexFormat.bitangent) {
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ }
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: flatPositions,
+ });
+ }
+
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents,
+ });
+ }
+
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents,
+ });
+ }
+
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates,
+ });
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: newIndices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ });
+ }
+
+ /**
+ * A description of a polygon composed of arbitrary coplanar positions.
+ *
+ * @alias CoplanarPolygonGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
+ * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.
+ *
+ * @example
+ * const polygonGeometry = new Cesium.CoplanarPolygonGeometry({
+ * polygonHierarchy: new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArrayHeights([
+ * -90.0, 30.0, 0.0,
+ * -90.0, 30.0, 300000.0,
+ * -80.0, 30.0, 300000.0,
+ * -80.0, 30.0, 0.0
+ * ]))
+ * });
+ *
+ */
+ function CoplanarPolygonGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const polygonHierarchy = options.polygonHierarchy;
+ const textureCoordinates = options.textureCoordinates;
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("options.polygonHierarchy", polygonHierarchy);
+ //>>includeEnd('debug');
+
+ const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
+ this._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat);
+ this._polygonHierarchy = polygonHierarchy;
+ this._stRotation = defaultValue.defaultValue(options.stRotation, 0.0);
+ this._ellipsoid = Matrix3.Ellipsoid.clone(
+ defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
+ );
+ this._workerName = "createCoplanarPolygonGeometry";
+ this._textureCoordinates = textureCoordinates;
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ PolygonGeometryLibrary.PolygonGeometryLibrary.computeHierarchyPackedLength(
+ polygonHierarchy,
+ Matrix3.Cartesian3
+ ) +
+ VertexFormat.VertexFormat.packedLength +
+ Matrix3.Ellipsoid.packedLength +
+ (defaultValue.defined(textureCoordinates)
+ ? PolygonGeometryLibrary.PolygonGeometryLibrary.computeHierarchyPackedLength(
+ textureCoordinates,
+ Matrix2.Cartesian2
+ )
+ : 1) +
+ 2;
+ }
+
+ /**
+ * A description of a coplanar polygon from an array of positions.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.
+ * @returns {CoplanarPolygonGeometry}
+ *
+ * @example
+ * // create a polygon from points
+ * const polygon = Cesium.CoplanarPolygonGeometry.fromPositions({
+ * positions : Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0,
+ * -75.0, 30.0,
+ * -70.0, 30.0,
+ * -68.0, 40.0
+ * ])
+ * });
+ * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
+ *
+ * @see PolygonGeometry#createGeometry
+ */
+ CoplanarPolygonGeometry.fromPositions = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("options.positions", options.positions);
+ //>>includeEnd('debug');
+
+ const newOptions = {
+ polygonHierarchy: {
+ positions: options.positions,
+ },
+ vertexFormat: options.vertexFormat,
+ stRotation: options.stRotation,
+ ellipsoid: options.ellipsoid,
+ textureCoordinates: options.textureCoordinates,
+ };
+ return new CoplanarPolygonGeometry(newOptions);
+ };
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {CoplanarPolygonGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ CoplanarPolygonGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ startingIndex = PolygonGeometryLibrary.PolygonGeometryLibrary.packPolygonHierarchy(
+ value._polygonHierarchy,
+ array,
+ startingIndex,
+ Matrix3.Cartesian3
+ );
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ array[startingIndex++] = value._stRotation;
+ if (defaultValue.defined(value._textureCoordinates)) {
+ startingIndex = PolygonGeometryLibrary.PolygonGeometryLibrary.packPolygonHierarchy(
+ value._textureCoordinates,
+ array,
+ startingIndex,
+ Matrix2.Cartesian2
+ );
+ } else {
+ array[startingIndex++] = -1.0;
+ }
+ array[startingIndex++] = value.packedLength;
+
+ return array;
+ };
+
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+ const scratchOptions = {
+ polygonHierarchy: {},
+ };
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {CoplanarPolygonGeometry} [result] The object into which to store the result.
+ * @returns {CoplanarPolygonGeometry} The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.
+ */
+ CoplanarPolygonGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const polygonHierarchy = PolygonGeometryLibrary.PolygonGeometryLibrary.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Matrix3.Cartesian3
+ );
+ startingIndex = polygonHierarchy.startingIndex;
+ delete polygonHierarchy.startingIndex;
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ const stRotation = array[startingIndex++];
+ const textureCoordinates =
+ array[startingIndex] === -1.0
+ ? undefined
+ : PolygonGeometryLibrary.PolygonGeometryLibrary.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Matrix2.Cartesian2
+ );
+ if (defaultValue.defined(textureCoordinates)) {
+ startingIndex = textureCoordinates.startingIndex;
+ delete textureCoordinates.startingIndex;
+ } else {
+ startingIndex++;
+ }
+ const packedLength = array[startingIndex++];
+
+ if (!defaultValue.defined(result)) {
+ result = new CoplanarPolygonGeometry(scratchOptions);
+ }
+
+ result._polygonHierarchy = polygonHierarchy;
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._stRotation = stRotation;
+ result._textureCoordinates = textureCoordinates;
+ result.packedLength = packedLength;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {CoplanarPolygonGeometry} polygonGeometry A description of the polygon.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ CoplanarPolygonGeometry.createGeometry = function (polygonGeometry) {
+ const vertexFormat = polygonGeometry._vertexFormat;
+ const polygonHierarchy = polygonGeometry._polygonHierarchy;
+ const stRotation = polygonGeometry._stRotation;
+ const textureCoordinates = polygonGeometry._textureCoordinates;
+ const hasTextureCoordinates = defaultValue.defined(textureCoordinates);
+
+ let outerPositions = polygonHierarchy.positions;
+ outerPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ outerPositions,
+ Matrix3.Cartesian3.equalsEpsilon,
+ true
+ );
+ if (outerPositions.length < 3) {
+ return;
+ }
+
+ let normal = scratchNormal;
+ let tangent = scratchTangent;
+ let bitangent = scratchBitangent;
+ let axis1 = axis1Scratch;
+ const axis2 = axis2Scratch;
+
+ const validGeometry = CoplanarPolygonGeometryLibrary.CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(
+ outerPositions,
+ centerScratch,
+ axis1,
+ axis2
+ );
+ if (!validGeometry) {
+ return undefined;
+ }
+
+ normal = Matrix3.Cartesian3.cross(axis1, axis2, normal);
+ normal = Matrix3.Cartesian3.normalize(normal, normal);
+
+ if (
+ !Matrix3.Cartesian3.equalsEpsilon(
+ centerScratch,
+ Matrix3.Cartesian3.ZERO,
+ Math.CesiumMath.EPSILON6
+ )
+ ) {
+ const surfaceNormal = polygonGeometry._ellipsoid.geodeticSurfaceNormal(
+ centerScratch,
+ surfaceNormalScratch
+ );
+ if (Matrix3.Cartesian3.dot(normal, surfaceNormal) < 0) {
+ normal = Matrix3.Cartesian3.negate(normal, normal);
+ axis1 = Matrix3.Cartesian3.negate(axis1, axis1);
+ }
+ }
+
+ const projectPoints = CoplanarPolygonGeometryLibrary.CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(
+ centerScratch,
+ axis1,
+ axis2
+ );
+ const projectPoint = CoplanarPolygonGeometryLibrary.CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(
+ centerScratch,
+ axis1,
+ axis2
+ );
+
+ if (vertexFormat.tangent) {
+ tangent = Matrix3.Cartesian3.clone(axis1, tangent);
+ }
+ if (vertexFormat.bitangent) {
+ bitangent = Matrix3.Cartesian3.clone(axis2, bitangent);
+ }
+
+ const results = PolygonGeometryLibrary.PolygonGeometryLibrary.polygonsFromHierarchy(
+ polygonHierarchy,
+ hasTextureCoordinates,
+ projectPoints,
+ false
+ );
+ const hierarchy = results.hierarchy;
+ const polygons = results.polygons;
+
+ const dummyFunction = function (identity) {
+ return identity;
+ };
+
+ const textureCoordinatePolygons = hasTextureCoordinates
+ ? PolygonGeometryLibrary.PolygonGeometryLibrary.polygonsFromHierarchy(
+ textureCoordinates,
+ true,
+ dummyFunction,
+ false
+ ).polygons
+ : undefined;
+
+ if (hierarchy.length === 0) {
+ return;
+ }
+ outerPositions = hierarchy[0].outerRing;
+
+ const boundingSphere = Transforms.BoundingSphere.fromPoints(outerPositions);
+ const boundingRectangle = PolygonGeometryLibrary.PolygonGeometryLibrary.computeBoundingRectangle(
+ normal,
+ projectPoint,
+ outerPositions,
+ stRotation,
+ scratchBR
+ );
+
+ const geometries = [];
+ for (let i = 0; i < polygons.length; i++) {
+ const geometryInstance = new GeometryInstance.GeometryInstance({
+ geometry: createGeometryFromPolygon(
+ polygons[i],
+ vertexFormat,
+ boundingRectangle,
+ stRotation,
+ hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,
+ projectPoint,
+ normal,
+ tangent,
+ bitangent
+ ),
+ });
+
+ geometries.push(geometryInstance);
+ }
+
+ const geometry = GeometryPipeline.GeometryPipeline.combineInstances(geometries)[0];
+ geometry.attributes.position.values = new Float64Array(
+ geometry.attributes.position.values
+ );
+ geometry.indices = IndexDatatype.IndexDatatype.createTypedArray(
+ geometry.attributes.position.values.length / 3,
+ geometry.indices
+ );
+
+ const attributes = geometry.attributes;
+ if (!vertexFormat.position) {
+ delete attributes.position;
+ }
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: geometry.indices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere: boundingSphere,
+ });
+ };
+
+ function createCoplanarPolygonGeometry(polygonGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ polygonGeometry = CoplanarPolygonGeometry.unpack(polygonGeometry, offset);
+ }
+ return CoplanarPolygonGeometry.createGeometry(polygonGeometry);
+ }
+
+ return createCoplanarPolygonGeometry;
+
+}));
+//# sourceMappingURL=createCoplanarPolygonGeometry.js.map
diff --git a/examples/cesium/Workers/createCoplanarPolygonGeometry.js.map b/examples/cesium/Workers/createCoplanarPolygonGeometry.js.map
new file mode 100644
index 0000000..745c696
--- /dev/null
+++ b/examples/cesium/Workers/createCoplanarPolygonGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createCoplanarPolygonGeometry.js","sources":["../../../Source/Core/CoplanarPolygonGeometry.js","../../../Source/WorkersES6/createCoplanarPolygonGeometry.js"],"sourcesContent":["import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\r\nimport BoundingRectangle from \"./BoundingRectangle.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport CoplanarPolygonGeometryLibrary from \"./CoplanarPolygonGeometryLibrary.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryInstance from \"./GeometryInstance.js\";\r\nimport GeometryPipeline from \"./GeometryPipeline.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\r\nimport PolygonPipeline from \"./PolygonPipeline.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\nconst scratchPosition = new Cartesian3();\r\nconst scratchBR = new BoundingRectangle();\r\nconst stScratch = new Cartesian2();\r\nconst textureCoordinatesOrigin = new Cartesian2();\r\nconst scratchNormal = new Cartesian3();\r\nconst scratchTangent = new Cartesian3();\r\nconst scratchBitangent = new Cartesian3();\r\nconst centerScratch = new Cartesian3();\r\nconst axis1Scratch = new Cartesian3();\r\nconst axis2Scratch = new Cartesian3();\r\nconst quaternionScratch = new Quaternion();\r\nconst textureMatrixScratch = new Matrix3();\r\nconst tangentRotationScratch = new Matrix3();\r\nconst surfaceNormalScratch = new Cartesian3();\r\n\r\nfunction createGeometryFromPolygon(\r\n polygon,\r\n vertexFormat,\r\n boundingRectangle,\r\n stRotation,\r\n hardcodedTextureCoordinates,\r\n projectPointTo2D,\r\n normal,\r\n tangent,\r\n bitangent\r\n) {\r\n const positions = polygon.positions;\r\n let indices = PolygonPipeline.triangulate(polygon.positions2D, polygon.holes);\r\n\r\n /* If polygon is completely unrenderable, just use the first three vertices */\r\n if (indices.length < 3) {\r\n indices = [0, 1, 2];\r\n }\r\n\r\n const newIndices = IndexDatatype.createTypedArray(\r\n positions.length,\r\n indices.length\r\n );\r\n newIndices.set(indices);\r\n\r\n let textureMatrix = textureMatrixScratch;\r\n if (stRotation !== 0.0) {\r\n let rotation = Quaternion.fromAxisAngle(\r\n normal,\r\n stRotation,\r\n quaternionScratch\r\n );\r\n textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);\r\n\r\n if (vertexFormat.tangent || vertexFormat.bitangent) {\r\n rotation = Quaternion.fromAxisAngle(\r\n normal,\r\n -stRotation,\r\n quaternionScratch\r\n );\r\n const tangentRotation = Matrix3.fromQuaternion(\r\n rotation,\r\n tangentRotationScratch\r\n );\r\n\r\n tangent = Cartesian3.normalize(\r\n Matrix3.multiplyByVector(tangentRotation, tangent, tangent),\r\n tangent\r\n );\r\n if (vertexFormat.bitangent) {\r\n bitangent = Cartesian3.normalize(\r\n Cartesian3.cross(normal, tangent, bitangent),\r\n bitangent\r\n );\r\n }\r\n }\r\n } else {\r\n textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix);\r\n }\r\n\r\n const stOrigin = textureCoordinatesOrigin;\r\n if (vertexFormat.st) {\r\n stOrigin.x = boundingRectangle.x;\r\n stOrigin.y = boundingRectangle.y;\r\n }\r\n\r\n const length = positions.length;\r\n const size = length * 3;\r\n const flatPositions = new Float64Array(size);\r\n const normals = vertexFormat.normal ? new Float32Array(size) : undefined;\r\n const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(size)\r\n : undefined;\r\n const textureCoordinates = vertexFormat.st\r\n ? new Float32Array(length * 2)\r\n : undefined;\r\n\r\n let positionIndex = 0;\r\n let normalIndex = 0;\r\n let bitangentIndex = 0;\r\n let tangentIndex = 0;\r\n let stIndex = 0;\r\n\r\n for (let i = 0; i < length; i++) {\r\n const position = positions[i];\r\n flatPositions[positionIndex++] = position.x;\r\n flatPositions[positionIndex++] = position.y;\r\n flatPositions[positionIndex++] = position.z;\r\n\r\n if (vertexFormat.st) {\r\n if (\r\n defined(hardcodedTextureCoordinates) &&\r\n hardcodedTextureCoordinates.positions.length === length\r\n ) {\r\n textureCoordinates[stIndex++] =\r\n hardcodedTextureCoordinates.positions[i].x;\r\n textureCoordinates[stIndex++] =\r\n hardcodedTextureCoordinates.positions[i].y;\r\n } else {\r\n const p = Matrix3.multiplyByVector(\r\n textureMatrix,\r\n position,\r\n scratchPosition\r\n );\r\n const st = projectPointTo2D(p, stScratch);\r\n Cartesian2.subtract(st, stOrigin, st);\r\n\r\n const stx = CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);\r\n const sty = CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);\r\n textureCoordinates[stIndex++] = stx;\r\n textureCoordinates[stIndex++] = sty;\r\n }\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n normals[normalIndex++] = normal.x;\r\n normals[normalIndex++] = normal.y;\r\n normals[normalIndex++] = normal.z;\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n tangents[tangentIndex++] = tangent.x;\r\n tangents[tangentIndex++] = tangent.y;\r\n tangents[tangentIndex++] = tangent.z;\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n bitangents[bitangentIndex++] = bitangent.x;\r\n bitangents[bitangentIndex++] = bitangent.y;\r\n bitangents[bitangentIndex++] = bitangent.z;\r\n }\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n\r\n if (vertexFormat.position) {\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: flatPositions,\r\n });\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normals,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.st) {\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: textureCoordinates,\r\n });\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: newIndices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n });\r\n}\r\n\r\n/**\r\n * A description of a polygon composed of arbitrary coplanar positions.\r\n *\r\n * @alias CoplanarPolygonGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\r\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.\r\n *\r\n * @example\r\n * const polygonGeometry = new Cesium.CoplanarPolygonGeometry({\r\n * polygonHierarchy: new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArrayHeights([\r\n * -90.0, 30.0, 0.0,\r\n * -90.0, 30.0, 300000.0,\r\n * -80.0, 30.0, 300000.0,\r\n * -80.0, 30.0, 0.0\r\n * ]))\r\n * });\r\n *\r\n */\r\nfunction CoplanarPolygonGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const polygonHierarchy = options.polygonHierarchy;\r\n const textureCoordinates = options.textureCoordinates;\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"options.polygonHierarchy\", polygonHierarchy);\r\n //>>includeEnd('debug');\r\n\r\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\r\n this._vertexFormat = VertexFormat.clone(vertexFormat);\r\n this._polygonHierarchy = polygonHierarchy;\r\n this._stRotation = defaultValue(options.stRotation, 0.0);\r\n this._ellipsoid = Ellipsoid.clone(\r\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\r\n );\r\n this._workerName = \"createCoplanarPolygonGeometry\";\r\n this._textureCoordinates = textureCoordinates;\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n PolygonGeometryLibrary.computeHierarchyPackedLength(\r\n polygonHierarchy,\r\n Cartesian3\r\n ) +\r\n VertexFormat.packedLength +\r\n Ellipsoid.packedLength +\r\n (defined(textureCoordinates)\r\n ? PolygonGeometryLibrary.computeHierarchyPackedLength(\r\n textureCoordinates,\r\n Cartesian2\r\n )\r\n : 1) +\r\n 2;\r\n}\r\n\r\n/**\r\n * A description of a coplanar polygon from an array of positions.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points.\r\n * @returns {CoplanarPolygonGeometry}\r\n *\r\n * @example\r\n * // create a polygon from points\r\n * const polygon = Cesium.CoplanarPolygonGeometry.fromPositions({\r\n * positions : Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0,\r\n * -75.0, 30.0,\r\n * -70.0, 30.0,\r\n * -68.0, 40.0\r\n * ])\r\n * });\r\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);\r\n *\r\n * @see PolygonGeometry#createGeometry\r\n */\r\nCoplanarPolygonGeometry.fromPositions = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"options.positions\", options.positions);\r\n //>>includeEnd('debug');\r\n\r\n const newOptions = {\r\n polygonHierarchy: {\r\n positions: options.positions,\r\n },\r\n vertexFormat: options.vertexFormat,\r\n stRotation: options.stRotation,\r\n ellipsoid: options.ellipsoid,\r\n textureCoordinates: options.textureCoordinates,\r\n };\r\n return new CoplanarPolygonGeometry(newOptions);\r\n};\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {CoplanarPolygonGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCoplanarPolygonGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\r\n value._polygonHierarchy,\r\n array,\r\n startingIndex,\r\n Cartesian3\r\n );\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n array[startingIndex++] = value._stRotation;\r\n if (defined(value._textureCoordinates)) {\r\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\r\n value._textureCoordinates,\r\n array,\r\n startingIndex,\r\n Cartesian2\r\n );\r\n } else {\r\n array[startingIndex++] = -1.0;\r\n }\r\n array[startingIndex++] = value.packedLength;\r\n\r\n return array;\r\n};\r\n\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchVertexFormat = new VertexFormat();\r\nconst scratchOptions = {\r\n polygonHierarchy: {},\r\n};\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {CoplanarPolygonGeometry} [result] The object into which to store the result.\r\n * @returns {CoplanarPolygonGeometry} The modified result parameter or a new CoplanarPolygonGeometry instance if one was not provided.\r\n */\r\nCoplanarPolygonGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\r\n array,\r\n startingIndex,\r\n Cartesian3\r\n );\r\n startingIndex = polygonHierarchy.startingIndex;\r\n delete polygonHierarchy.startingIndex;\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n const stRotation = array[startingIndex++];\r\n const textureCoordinates =\r\n array[startingIndex] === -1.0\r\n ? undefined\r\n : PolygonGeometryLibrary.unpackPolygonHierarchy(\r\n array,\r\n startingIndex,\r\n Cartesian2\r\n );\r\n if (defined(textureCoordinates)) {\r\n startingIndex = textureCoordinates.startingIndex;\r\n delete textureCoordinates.startingIndex;\r\n } else {\r\n startingIndex++;\r\n }\r\n const packedLength = array[startingIndex++];\r\n\r\n if (!defined(result)) {\r\n result = new CoplanarPolygonGeometry(scratchOptions);\r\n }\r\n\r\n result._polygonHierarchy = polygonHierarchy;\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._stRotation = stRotation;\r\n result._textureCoordinates = textureCoordinates;\r\n result.packedLength = packedLength;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {CoplanarPolygonGeometry} polygonGeometry A description of the polygon.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nCoplanarPolygonGeometry.createGeometry = function (polygonGeometry) {\r\n const vertexFormat = polygonGeometry._vertexFormat;\r\n const polygonHierarchy = polygonGeometry._polygonHierarchy;\r\n const stRotation = polygonGeometry._stRotation;\r\n const textureCoordinates = polygonGeometry._textureCoordinates;\r\n const hasTextureCoordinates = defined(textureCoordinates);\r\n\r\n let outerPositions = polygonHierarchy.positions;\r\n outerPositions = arrayRemoveDuplicates(\r\n outerPositions,\r\n Cartesian3.equalsEpsilon,\r\n true\r\n );\r\n if (outerPositions.length < 3) {\r\n return;\r\n }\r\n\r\n let normal = scratchNormal;\r\n let tangent = scratchTangent;\r\n let bitangent = scratchBitangent;\r\n let axis1 = axis1Scratch;\r\n const axis2 = axis2Scratch;\r\n\r\n const validGeometry = CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments(\r\n outerPositions,\r\n centerScratch,\r\n axis1,\r\n axis2\r\n );\r\n if (!validGeometry) {\r\n return undefined;\r\n }\r\n\r\n normal = Cartesian3.cross(axis1, axis2, normal);\r\n normal = Cartesian3.normalize(normal, normal);\r\n\r\n if (\r\n !Cartesian3.equalsEpsilon(\r\n centerScratch,\r\n Cartesian3.ZERO,\r\n CesiumMath.EPSILON6\r\n )\r\n ) {\r\n const surfaceNormal = polygonGeometry._ellipsoid.geodeticSurfaceNormal(\r\n centerScratch,\r\n surfaceNormalScratch\r\n );\r\n if (Cartesian3.dot(normal, surfaceNormal) < 0) {\r\n normal = Cartesian3.negate(normal, normal);\r\n axis1 = Cartesian3.negate(axis1, axis1);\r\n }\r\n }\r\n\r\n const projectPoints = CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction(\r\n centerScratch,\r\n axis1,\r\n axis2\r\n );\r\n const projectPoint = CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction(\r\n centerScratch,\r\n axis1,\r\n axis2\r\n );\r\n\r\n if (vertexFormat.tangent) {\r\n tangent = Cartesian3.clone(axis1, tangent);\r\n }\r\n if (vertexFormat.bitangent) {\r\n bitangent = Cartesian3.clone(axis2, bitangent);\r\n }\r\n\r\n const results = PolygonGeometryLibrary.polygonsFromHierarchy(\r\n polygonHierarchy,\r\n hasTextureCoordinates,\r\n projectPoints,\r\n false\r\n );\r\n const hierarchy = results.hierarchy;\r\n const polygons = results.polygons;\r\n\r\n const dummyFunction = function (identity) {\r\n return identity;\r\n };\r\n\r\n const textureCoordinatePolygons = hasTextureCoordinates\r\n ? PolygonGeometryLibrary.polygonsFromHierarchy(\r\n textureCoordinates,\r\n true,\r\n dummyFunction,\r\n false\r\n ).polygons\r\n : undefined;\r\n\r\n if (hierarchy.length === 0) {\r\n return;\r\n }\r\n outerPositions = hierarchy[0].outerRing;\r\n\r\n const boundingSphere = BoundingSphere.fromPoints(outerPositions);\r\n const boundingRectangle = PolygonGeometryLibrary.computeBoundingRectangle(\r\n normal,\r\n projectPoint,\r\n outerPositions,\r\n stRotation,\r\n scratchBR\r\n );\r\n\r\n const geometries = [];\r\n for (let i = 0; i < polygons.length; i++) {\r\n const geometryInstance = new GeometryInstance({\r\n geometry: createGeometryFromPolygon(\r\n polygons[i],\r\n vertexFormat,\r\n boundingRectangle,\r\n stRotation,\r\n hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,\r\n projectPoint,\r\n normal,\r\n tangent,\r\n bitangent\r\n ),\r\n });\r\n\r\n geometries.push(geometryInstance);\r\n }\r\n\r\n const geometry = GeometryPipeline.combineInstances(geometries)[0];\r\n geometry.attributes.position.values = new Float64Array(\r\n geometry.attributes.position.values\r\n );\r\n geometry.indices = IndexDatatype.createTypedArray(\r\n geometry.attributes.position.values.length / 3,\r\n geometry.indices\r\n );\r\n\r\n const attributes = geometry.attributes;\r\n if (!vertexFormat.position) {\r\n delete attributes.position;\r\n }\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: geometry.indices,\r\n primitiveType: geometry.primitiveType,\r\n boundingSphere: boundingSphere,\r\n });\r\n};\r\nexport default CoplanarPolygonGeometry;\r\n","import CoplanarPolygonGeometry from \"../Core/CoplanarPolygonGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\n\r\nfunction createCoplanarPolygonGeometry(polygonGeometry, offset) {\r\n if (defined(offset)) {\r\n polygonGeometry = CoplanarPolygonGeometry.unpack(polygonGeometry, offset);\r\n }\r\n return CoplanarPolygonGeometry.createGeometry(polygonGeometry);\r\n}\r\nexport default createCoplanarPolygonGeometry;\r\n"],"names":["Cartesian3","BoundingRectangle","Cartesian2","Quaternion","Matrix3","PolygonPipeline","IndexDatatype","defined","CesiumMath","GeometryAttributes","GeometryAttribute","ComponentDatatype","Geometry","PrimitiveType","defaultValue","Check","VertexFormat","Ellipsoid","PolygonGeometryLibrary","arrayRemoveDuplicates","CoplanarPolygonGeometryLibrary","BoundingSphere","GeometryInstance","GeometryPipeline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;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,EAAE,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,YAAY;EACxD,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM;EACvC,GAAG,CAAC;EACJ,EAAE,QAAQ,CAAC,OAAO,GAAGjB,2BAAa,CAAC,gBAAgB;EACnD,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;EAClD,IAAI,QAAQ,CAAC,OAAO;EACpB,GAAG,CAAC;AACJ;EACA,EAAE,MAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;EACzC,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE;EAC9B,IAAI,OAAO,UAAU,CAAC,QAAQ,CAAC;EAC/B,GAAG;EACH,EAAE,OAAO,IAAIM,0BAAQ,CAAC;EACtB,IAAI,UAAU,EAAE,UAAU;EAC1B,IAAI,OAAO,EAAE,QAAQ,CAAC,OAAO;EAC7B,IAAI,aAAa,EAAE,QAAQ,CAAC,aAAa;EACzC,IAAI,cAAc,EAAE,cAAc;EAClC,GAAG,CAAC,CAAC;EACL,CAAC;;ECllBD,SAAS,6BAA6B,CAAC,eAAe,EAAE,MAAM,EAAE;EAChE,EAAE,IAAIL,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,eAAe,GAAG,uBAAuB,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;EAC9E,GAAG;EACH,EAAE,OAAO,uBAAuB,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;EACjE;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createCoplanarPolygonOutlineGeometry.js b/examples/cesium/Workers/createCoplanarPolygonOutlineGeometry.js
new file mode 100644
index 0000000..5d4c5db
--- /dev/null
+++ b/examples/cesium/Workers/createCoplanarPolygonOutlineGeometry.js
@@ -0,0 +1,262 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./arrayRemoveDuplicates-c3526030', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './CoplanarPolygonGeometryLibrary-dfba6465', './defaultValue-0ab18f7d', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryInstance-b2be3e5a', './GeometryPipeline-f28890f4', './IndexDatatype-b4e5cf89', './PolygonGeometryLibrary-62266ab5', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29', './OrientedBoundingBox-7e2eebab', './EllipsoidTangentPlane-c421b2cb', './AxisAlignedBoundingBox-50342d27', './IntersectionTests-2c7928de', './Plane-c9f1487d', './AttributeCompression-e9888cb8', './EncodedCartesian3-38e2691f', './ArcType-d608b872', './EllipsoidRhumbLine-48b4507b', './PolygonPipeline-313487c3'], (function (arrayRemoveDuplicates, Transforms, Matrix3, Check, ComponentDatatype, CoplanarPolygonGeometryLibrary, defaultValue, GeometryAttribute, GeometryAttributes, GeometryInstance, GeometryPipeline, IndexDatatype, PolygonGeometryLibrary, Math, Matrix2, RuntimeError, combine, WebGLConstants, OrientedBoundingBox, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane, AttributeCompression, EncodedCartesian3, ArcType, EllipsoidRhumbLine, PolygonPipeline) { 'use strict';
+
+ function createGeometryFromPositions(positions) {
+ const length = positions.length;
+ const flatPositions = new Float64Array(length * 3);
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(length, length * 2);
+
+ let positionIndex = 0;
+ let index = 0;
+
+ for (let i = 0; i < length; i++) {
+ const position = positions[i];
+ flatPositions[positionIndex++] = position.x;
+ flatPositions[positionIndex++] = position.y;
+ flatPositions[positionIndex++] = position.z;
+
+ indices[index++] = i;
+ indices[index++] = (i + 1) % length;
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes({
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: flatPositions,
+ }),
+ });
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ });
+ }
+
+ /**
+ * A description of the outline of a polygon composed of arbitrary coplanar positions.
+ *
+ * @alias CoplanarPolygonOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
+ *
+ * @see CoplanarPolygonOutlineGeometry.createGeometry
+ *
+ * @example
+ * const polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({
+ * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
+ * -90.0, 30.0, 0.0,
+ * -90.0, 30.0, 1000.0,
+ * -80.0, 30.0, 1000.0,
+ * -80.0, 30.0, 0.0
+ * ])
+ * });
+ * const geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);
+ */
+ function CoplanarPolygonOutlineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const polygonHierarchy = options.polygonHierarchy;
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("options.polygonHierarchy", polygonHierarchy);
+ //>>includeEnd('debug');
+
+ this._polygonHierarchy = polygonHierarchy;
+ this._workerName = "createCoplanarPolygonOutlineGeometry";
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ PolygonGeometryLibrary.PolygonGeometryLibrary.computeHierarchyPackedLength(
+ polygonHierarchy,
+ Matrix3.Cartesian3
+ ) + 1;
+ }
+
+ /**
+ * A description of a coplanar polygon outline from an array of positions.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.
+ * @returns {CoplanarPolygonOutlineGeometry}
+ */
+ CoplanarPolygonOutlineGeometry.fromPositions = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("options.positions", options.positions);
+ //>>includeEnd('debug');
+
+ const newOptions = {
+ polygonHierarchy: {
+ positions: options.positions,
+ },
+ };
+ return new CoplanarPolygonOutlineGeometry(newOptions);
+ };
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {CoplanarPolygonOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ CoplanarPolygonOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ startingIndex = PolygonGeometryLibrary.PolygonGeometryLibrary.packPolygonHierarchy(
+ value._polygonHierarchy,
+ array,
+ startingIndex,
+ Matrix3.Cartesian3
+ );
+
+ array[startingIndex] = value.packedLength;
+
+ return array;
+ };
+
+ const scratchOptions = {
+ polygonHierarchy: {},
+ };
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {CoplanarPolygonOutlineGeometry} [result] The object into which to store the result.
+ * @returns {CoplanarPolygonOutlineGeometry} The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.
+ */
+ CoplanarPolygonOutlineGeometry.unpack = function (
+ array,
+ startingIndex,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const polygonHierarchy = PolygonGeometryLibrary.PolygonGeometryLibrary.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Matrix3.Cartesian3
+ );
+ startingIndex = polygonHierarchy.startingIndex;
+ delete polygonHierarchy.startingIndex;
+ const packedLength = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ result = new CoplanarPolygonOutlineGeometry(scratchOptions);
+ }
+
+ result._polygonHierarchy = polygonHierarchy;
+ result.packedLength = packedLength;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {CoplanarPolygonOutlineGeometry} polygonGeometry A description of the polygon.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ CoplanarPolygonOutlineGeometry.createGeometry = function (polygonGeometry) {
+ const polygonHierarchy = polygonGeometry._polygonHierarchy;
+
+ let outerPositions = polygonHierarchy.positions;
+ outerPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ outerPositions,
+ Matrix3.Cartesian3.equalsEpsilon,
+ true
+ );
+ if (outerPositions.length < 3) {
+ return;
+ }
+ const isValid = CoplanarPolygonGeometryLibrary.CoplanarPolygonGeometryLibrary.validOutline(outerPositions);
+ if (!isValid) {
+ return undefined;
+ }
+
+ const polygons = PolygonGeometryLibrary.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(
+ polygonHierarchy,
+ false
+ );
+
+ if (polygons.length === 0) {
+ return undefined;
+ }
+
+ const geometries = [];
+
+ for (let i = 0; i < polygons.length; i++) {
+ const geometryInstance = new GeometryInstance.GeometryInstance({
+ geometry: createGeometryFromPositions(polygons[i]),
+ });
+ geometries.push(geometryInstance);
+ }
+
+ const geometry = GeometryPipeline.GeometryPipeline.combineInstances(geometries)[0];
+ const boundingSphere = Transforms.BoundingSphere.fromPoints(polygonHierarchy.positions);
+
+ return new GeometryAttribute.Geometry({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere: boundingSphere,
+ });
+ };
+
+ function createCoplanarPolygonOutlineGeometry(polygonGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ polygonGeometry = CoplanarPolygonOutlineGeometry.unpack(
+ polygonGeometry,
+ offset
+ );
+ }
+ polygonGeometry._ellipsoid = Matrix3.Ellipsoid.clone(polygonGeometry._ellipsoid);
+ return CoplanarPolygonOutlineGeometry.createGeometry(polygonGeometry);
+ }
+
+ return createCoplanarPolygonOutlineGeometry;
+
+}));
+//# sourceMappingURL=createCoplanarPolygonOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createCoplanarPolygonOutlineGeometry.js.map b/examples/cesium/Workers/createCoplanarPolygonOutlineGeometry.js.map
new file mode 100644
index 0000000..74c1789
--- /dev/null
+++ b/examples/cesium/Workers/createCoplanarPolygonOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createCoplanarPolygonOutlineGeometry.js","sources":["../../../Source/Core/CoplanarPolygonOutlineGeometry.js","../../../Source/WorkersES6/createCoplanarPolygonOutlineGeometry.js"],"sourcesContent":["import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport CoplanarPolygonGeometryLibrary from \"./CoplanarPolygonGeometryLibrary.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryInstance from \"./GeometryInstance.js\";\r\nimport GeometryPipeline from \"./GeometryPipeline.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\n\r\nfunction createGeometryFromPositions(positions) {\r\n const length = positions.length;\r\n const flatPositions = new Float64Array(length * 3);\r\n const indices = IndexDatatype.createTypedArray(length, length * 2);\r\n\r\n let positionIndex = 0;\r\n let index = 0;\r\n\r\n for (let i = 0; i < length; i++) {\r\n const position = positions[i];\r\n flatPositions[positionIndex++] = position.x;\r\n flatPositions[positionIndex++] = position.y;\r\n flatPositions[positionIndex++] = position.z;\r\n\r\n indices[index++] = i;\r\n indices[index++] = (i + 1) % length;\r\n }\r\n\r\n const attributes = new GeometryAttributes({\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: flatPositions,\r\n }),\r\n });\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.LINES,\r\n });\r\n}\r\n\r\n/**\r\n * A description of the outline of a polygon composed of arbitrary coplanar positions.\r\n *\r\n * @alias CoplanarPolygonOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\r\n *\r\n * @see CoplanarPolygonOutlineGeometry.createGeometry\r\n *\r\n * @example\r\n * const polygonOutline = new Cesium.CoplanarPolygonOutlineGeometry({\r\n * positions : Cesium.Cartesian3.fromDegreesArrayHeights([\r\n * -90.0, 30.0, 0.0,\r\n * -90.0, 30.0, 1000.0,\r\n * -80.0, 30.0, 1000.0,\r\n * -80.0, 30.0, 0.0\r\n * ])\r\n * });\r\n * const geometry = Cesium.CoplanarPolygonOutlineGeometry.createGeometry(polygonOutline);\r\n */\r\nfunction CoplanarPolygonOutlineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const polygonHierarchy = options.polygonHierarchy;\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"options.polygonHierarchy\", polygonHierarchy);\r\n //>>includeEnd('debug');\r\n\r\n this._polygonHierarchy = polygonHierarchy;\r\n this._workerName = \"createCoplanarPolygonOutlineGeometry\";\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n PolygonGeometryLibrary.computeHierarchyPackedLength(\r\n polygonHierarchy,\r\n Cartesian3\r\n ) + 1;\r\n}\r\n\r\n/**\r\n * A description of a coplanar polygon outline from an array of positions.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\r\n * @returns {CoplanarPolygonOutlineGeometry}\r\n */\r\nCoplanarPolygonOutlineGeometry.fromPositions = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"options.positions\", options.positions);\r\n //>>includeEnd('debug');\r\n\r\n const newOptions = {\r\n polygonHierarchy: {\r\n positions: options.positions,\r\n },\r\n };\r\n return new CoplanarPolygonOutlineGeometry(newOptions);\r\n};\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {CoplanarPolygonOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCoplanarPolygonOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\r\n value._polygonHierarchy,\r\n array,\r\n startingIndex,\r\n Cartesian3\r\n );\r\n\r\n array[startingIndex] = value.packedLength;\r\n\r\n return array;\r\n};\r\n\r\nconst scratchOptions = {\r\n polygonHierarchy: {},\r\n};\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {CoplanarPolygonOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {CoplanarPolygonOutlineGeometry} The modified result parameter or a new CoplanarPolygonOutlineGeometry instance if one was not provided.\r\n */\r\nCoplanarPolygonOutlineGeometry.unpack = function (\r\n array,\r\n startingIndex,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\r\n array,\r\n startingIndex,\r\n Cartesian3\r\n );\r\n startingIndex = polygonHierarchy.startingIndex;\r\n delete polygonHierarchy.startingIndex;\r\n const packedLength = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n result = new CoplanarPolygonOutlineGeometry(scratchOptions);\r\n }\r\n\r\n result._polygonHierarchy = polygonHierarchy;\r\n result.packedLength = packedLength;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of an arbitrary coplanar polygon, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {CoplanarPolygonOutlineGeometry} polygonGeometry A description of the polygon.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nCoplanarPolygonOutlineGeometry.createGeometry = function (polygonGeometry) {\r\n const polygonHierarchy = polygonGeometry._polygonHierarchy;\r\n\r\n let outerPositions = polygonHierarchy.positions;\r\n outerPositions = arrayRemoveDuplicates(\r\n outerPositions,\r\n Cartesian3.equalsEpsilon,\r\n true\r\n );\r\n if (outerPositions.length < 3) {\r\n return;\r\n }\r\n const isValid = CoplanarPolygonGeometryLibrary.validOutline(outerPositions);\r\n if (!isValid) {\r\n return undefined;\r\n }\r\n\r\n const polygons = PolygonGeometryLibrary.polygonOutlinesFromHierarchy(\r\n polygonHierarchy,\r\n false\r\n );\r\n\r\n if (polygons.length === 0) {\r\n return undefined;\r\n }\r\n\r\n const geometries = [];\r\n\r\n for (let i = 0; i < polygons.length; i++) {\r\n const geometryInstance = new GeometryInstance({\r\n geometry: createGeometryFromPositions(polygons[i]),\r\n });\r\n geometries.push(geometryInstance);\r\n }\r\n\r\n const geometry = GeometryPipeline.combineInstances(geometries)[0];\r\n const boundingSphere = BoundingSphere.fromPoints(polygonHierarchy.positions);\r\n\r\n return new Geometry({\r\n attributes: geometry.attributes,\r\n indices: geometry.indices,\r\n primitiveType: geometry.primitiveType,\r\n boundingSphere: boundingSphere,\r\n });\r\n};\r\nexport default CoplanarPolygonOutlineGeometry;\r\n","import CoplanarPolygonOutlineGeometry from \"../Core/CoplanarPolygonOutlineGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\n\r\nfunction createCoplanarPolygonOutlineGeometry(polygonGeometry, offset) {\r\n if (defined(offset)) {\r\n polygonGeometry = CoplanarPolygonOutlineGeometry.unpack(\r\n polygonGeometry,\r\n offset\r\n );\r\n }\r\n polygonGeometry._ellipsoid = Ellipsoid.clone(polygonGeometry._ellipsoid);\r\n return CoplanarPolygonOutlineGeometry.createGeometry(polygonGeometry);\r\n}\r\nexport default createCoplanarPolygonOutlineGeometry;\r\n"],"names":["IndexDatatype","GeometryAttributes","GeometryAttribute","ComponentDatatype","Geometry","PrimitiveType","defaultValue","Check","PolygonGeometryLibrary","Cartesian3","defined","arrayRemoveDuplicates","CoplanarPolygonGeometryLibrary","GeometryInstance","Geometry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CorridorGeometry.js
new file mode 100644
index 0000000..ee1dbb0
--- /dev/null
+++ b/examples/cesium/Workers/createCorridorGeometry.js
@@ -0,0 +1,1433 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./arrayRemoveDuplicates-c3526030', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './PolylineVolumeGeometryLibrary-eed2bdf7', './CorridorGeometryLibrary-152d0356', './defaultValue-0ab18f7d', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolygonPipeline-313487c3', './Matrix2-036c77dd', './VertexFormat-f2d74c96', './combine-4598d225', './RuntimeError-e5c6a8b9', './WebGLConstants-f27a5e29', './EllipsoidTangentPlane-c421b2cb', './AxisAlignedBoundingBox-50342d27', './IntersectionTests-2c7928de', './Plane-c9f1487d', './PolylinePipeline-3c021236', './EllipsoidGeodesic-38d0ed4a', './EllipsoidRhumbLine-48b4507b'], (function (arrayRemoveDuplicates, Transforms, Matrix3, Check, ComponentDatatype, PolylineVolumeGeometryLibrary, CorridorGeometryLibrary, defaultValue, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1, PolygonPipeline, Matrix2, VertexFormat, combine$1, RuntimeError, WebGLConstants, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane, PolylinePipeline, EllipsoidGeodesic, EllipsoidRhumbLine) { 'use strict';
+
+ const cartesian1 = new Matrix3.Cartesian3();
+ const cartesian2 = new Matrix3.Cartesian3();
+ const cartesian3 = new Matrix3.Cartesian3();
+ const cartesian4 = new Matrix3.Cartesian3();
+ const cartesian5 = new Matrix3.Cartesian3();
+ const cartesian6 = new Matrix3.Cartesian3();
+
+ const scratch1 = new Matrix3.Cartesian3();
+ const scratch2 = new Matrix3.Cartesian3();
+
+ function scaleToSurface(positions, ellipsoid) {
+ for (let i = 0; i < positions.length; i++) {
+ positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
+ }
+ return positions;
+ }
+
+ function addNormals(attr, normal, left, front, back, vertexFormat) {
+ const normals = attr.normals;
+ const tangents = attr.tangents;
+ const bitangents = attr.bitangents;
+ const forward = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(left, normal, scratch1),
+ scratch1
+ );
+ if (vertexFormat.normal) {
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, front, back);
+ }
+ if (vertexFormat.tangent) {
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(tangents, forward, front, back);
+ }
+ if (vertexFormat.bitangent) {
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(bitangents, left, front, back);
+ }
+ }
+
+ function combine(computedPositions, vertexFormat, ellipsoid) {
+ const positions = computedPositions.positions;
+ const corners = computedPositions.corners;
+ const endPositions = computedPositions.endPositions;
+ const computedLefts = computedPositions.lefts;
+ const computedNormals = computedPositions.normals;
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ let corner;
+ let leftCount = 0;
+ let rightCount = 0;
+ let i;
+ let indicesLength = 0;
+ let length;
+ for (i = 0; i < positions.length; i += 2) {
+ length = positions[i].length - 3;
+ leftCount += length; //subtracting 3 to account for duplicate points at corners
+ indicesLength += length * 2;
+ rightCount += positions[i + 1].length - 3;
+ }
+ leftCount += 3; //add back count for end positions
+ rightCount += 3;
+ for (i = 0; i < corners.length; i++) {
+ corner = corners[i];
+ const leftSide = corners[i].leftPositions;
+ if (defaultValue.defined(leftSide)) {
+ length = leftSide.length;
+ leftCount += length;
+ indicesLength += length;
+ } else {
+ length = corners[i].rightPositions.length;
+ rightCount += length;
+ indicesLength += length;
+ }
+ }
+
+ const addEndPositions = defaultValue.defined(endPositions);
+ let endPositionLength;
+ if (addEndPositions) {
+ endPositionLength = endPositions[0].length - 3;
+ leftCount += endPositionLength;
+ rightCount += endPositionLength;
+ endPositionLength /= 3;
+ indicesLength += endPositionLength * 6;
+ }
+ const size = leftCount + rightCount;
+ const finalPositions = new Float64Array(size);
+ const normals = vertexFormat.normal ? new Float32Array(size) : undefined;
+ const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(size)
+ : undefined;
+ const attr = {
+ normals: normals,
+ tangents: tangents,
+ bitangents: bitangents,
+ };
+ let front = 0;
+ let back = size - 1;
+ let UL, LL, UR, LR;
+ let normal = cartesian1;
+ let left = cartesian2;
+ let rightPos, leftPos;
+ const halfLength = endPositionLength / 2;
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(size / 3, indicesLength);
+ let index = 0;
+ if (addEndPositions) {
+ // add rounded end
+ leftPos = cartesian3;
+ rightPos = cartesian4;
+ const firstEndPositions = endPositions[0];
+ normal = Matrix3.Cartesian3.fromArray(computedNormals, 0, normal);
+ left = Matrix3.Cartesian3.fromArray(computedLefts, 0, left);
+ for (i = 0; i < halfLength; i++) {
+ leftPos = Matrix3.Cartesian3.fromArray(
+ firstEndPositions,
+ (halfLength - 1 - i) * 3,
+ leftPos
+ );
+ rightPos = Matrix3.Cartesian3.fromArray(
+ firstEndPositions,
+ (halfLength + i) * 3,
+ rightPos
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ finalPositions,
+ leftPos,
+ undefined,
+ back
+ );
+ addNormals(attr, normal, left, front, back, vertexFormat);
+
+ LL = front / 3;
+ LR = LL + 1;
+ UL = (back - 2) / 3;
+ UR = UL - 1;
+ indices[index++] = UL;
+ indices[index++] = LL;
+ indices[index++] = UR;
+ indices[index++] = UR;
+ indices[index++] = LL;
+ indices[index++] = LR;
+
+ front += 3;
+ back -= 3;
+ }
+ }
+
+ let posIndex = 0;
+ let compIndex = 0;
+ let rightEdge = positions[posIndex++]; //add first two edges
+ let leftEdge = positions[posIndex++];
+ finalPositions.set(rightEdge, front);
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
+
+ left = Matrix3.Cartesian3.fromArray(computedLefts, compIndex, left);
+ let rightNormal;
+ let leftNormal;
+ length = leftEdge.length - 3;
+ for (i = 0; i < length; i += 3) {
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
+ Matrix3.Cartesian3.fromArray(rightEdge, i, scratch1),
+ scratch1
+ );
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
+ Matrix3.Cartesian3.fromArray(leftEdge, length - i, scratch2),
+ scratch2
+ );
+ normal = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.add(rightNormal, leftNormal, normal),
+ normal
+ );
+ addNormals(attr, normal, left, front, back, vertexFormat);
+
+ LL = front / 3;
+ LR = LL + 1;
+ UL = (back - 2) / 3;
+ UR = UL - 1;
+ indices[index++] = UL;
+ indices[index++] = LL;
+ indices[index++] = UR;
+ indices[index++] = UR;
+ indices[index++] = LL;
+ indices[index++] = LR;
+
+ front += 3;
+ back -= 3;
+ }
+
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
+ Matrix3.Cartesian3.fromArray(rightEdge, length, scratch1),
+ scratch1
+ );
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
+ Matrix3.Cartesian3.fromArray(leftEdge, length, scratch2),
+ scratch2
+ );
+ normal = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.add(rightNormal, leftNormal, normal),
+ normal
+ );
+ compIndex += 3;
+ for (i = 0; i < corners.length; i++) {
+ let j;
+ corner = corners[i];
+ const l = corner.leftPositions;
+ const r = corner.rightPositions;
+ let pivot;
+ let start;
+ let outsidePoint = cartesian6;
+ let previousPoint = cartesian3;
+ let nextPoint = cartesian4;
+ normal = Matrix3.Cartesian3.fromArray(computedNormals, compIndex, normal);
+ if (defaultValue.defined(l)) {
+ addNormals(attr, normal, left, undefined, back, vertexFormat);
+ back -= 3;
+ pivot = LR;
+ start = UR;
+ for (j = 0; j < l.length / 3; j++) {
+ outsidePoint = Matrix3.Cartesian3.fromArray(l, j * 3, outsidePoint);
+ indices[index++] = pivot;
+ indices[index++] = start - j - 1;
+ indices[index++] = start - j;
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ finalPositions,
+ outsidePoint,
+ undefined,
+ back
+ );
+ previousPoint = Matrix3.Cartesian3.fromArray(
+ finalPositions,
+ (start - j - 1) * 3,
+ previousPoint
+ );
+ nextPoint = Matrix3.Cartesian3.fromArray(finalPositions, pivot * 3, nextPoint);
+ left = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.subtract(previousPoint, nextPoint, left),
+ left
+ );
+ addNormals(attr, normal, left, undefined, back, vertexFormat);
+ back -= 3;
+ }
+ outsidePoint = Matrix3.Cartesian3.fromArray(
+ finalPositions,
+ pivot * 3,
+ outsidePoint
+ );
+ previousPoint = Matrix3.Cartesian3.subtract(
+ Matrix3.Cartesian3.fromArray(finalPositions, start * 3, previousPoint),
+ outsidePoint,
+ previousPoint
+ );
+ nextPoint = Matrix3.Cartesian3.subtract(
+ Matrix3.Cartesian3.fromArray(finalPositions, (start - j) * 3, nextPoint),
+ outsidePoint,
+ nextPoint
+ );
+ left = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.add(previousPoint, nextPoint, left),
+ left
+ );
+ addNormals(attr, normal, left, front, undefined, vertexFormat);
+ front += 3;
+ } else {
+ addNormals(attr, normal, left, front, undefined, vertexFormat);
+ front += 3;
+ pivot = UR;
+ start = LR;
+ for (j = 0; j < r.length / 3; j++) {
+ outsidePoint = Matrix3.Cartesian3.fromArray(r, j * 3, outsidePoint);
+ indices[index++] = pivot;
+ indices[index++] = start + j;
+ indices[index++] = start + j + 1;
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ finalPositions,
+ outsidePoint,
+ front
+ );
+ previousPoint = Matrix3.Cartesian3.fromArray(
+ finalPositions,
+ pivot * 3,
+ previousPoint
+ );
+ nextPoint = Matrix3.Cartesian3.fromArray(
+ finalPositions,
+ (start + j) * 3,
+ nextPoint
+ );
+ left = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.subtract(previousPoint, nextPoint, left),
+ left
+ );
+ addNormals(attr, normal, left, front, undefined, vertexFormat);
+ front += 3;
+ }
+ outsidePoint = Matrix3.Cartesian3.fromArray(
+ finalPositions,
+ pivot * 3,
+ outsidePoint
+ );
+ previousPoint = Matrix3.Cartesian3.subtract(
+ Matrix3.Cartesian3.fromArray(finalPositions, (start + j) * 3, previousPoint),
+ outsidePoint,
+ previousPoint
+ );
+ nextPoint = Matrix3.Cartesian3.subtract(
+ Matrix3.Cartesian3.fromArray(finalPositions, start * 3, nextPoint),
+ outsidePoint,
+ nextPoint
+ );
+ left = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.negate(Matrix3.Cartesian3.add(nextPoint, previousPoint, left), left),
+ left
+ );
+ addNormals(attr, normal, left, undefined, back, vertexFormat);
+ back -= 3;
+ }
+ rightEdge = positions[posIndex++];
+ leftEdge = positions[posIndex++];
+ rightEdge.splice(0, 3); //remove duplicate points added by corner
+ leftEdge.splice(leftEdge.length - 3, 3);
+ finalPositions.set(rightEdge, front);
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
+ length = leftEdge.length - 3;
+
+ compIndex += 3;
+ left = Matrix3.Cartesian3.fromArray(computedLefts, compIndex, left);
+ for (j = 0; j < leftEdge.length; j += 3) {
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
+ Matrix3.Cartesian3.fromArray(rightEdge, j, scratch1),
+ scratch1
+ );
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
+ Matrix3.Cartesian3.fromArray(leftEdge, length - j, scratch2),
+ scratch2
+ );
+ normal = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.add(rightNormal, leftNormal, normal),
+ normal
+ );
+ addNormals(attr, normal, left, front, back, vertexFormat);
+
+ LR = front / 3;
+ LL = LR - 1;
+ UR = (back - 2) / 3;
+ UL = UR + 1;
+ indices[index++] = UL;
+ indices[index++] = LL;
+ indices[index++] = UR;
+ indices[index++] = UR;
+ indices[index++] = LL;
+ indices[index++] = LR;
+
+ front += 3;
+ back -= 3;
+ }
+ front -= 3;
+ back += 3;
+ }
+ normal = Matrix3.Cartesian3.fromArray(
+ computedNormals,
+ computedNormals.length - 3,
+ normal
+ );
+ addNormals(attr, normal, left, front, back, vertexFormat);
+
+ if (addEndPositions) {
+ // add rounded end
+ front += 3;
+ back -= 3;
+ leftPos = cartesian3;
+ rightPos = cartesian4;
+ const lastEndPositions = endPositions[1];
+ for (i = 0; i < halfLength; i++) {
+ leftPos = Matrix3.Cartesian3.fromArray(
+ lastEndPositions,
+ (endPositionLength - i - 1) * 3,
+ leftPos
+ );
+ rightPos = Matrix3.Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ finalPositions,
+ leftPos,
+ undefined,
+ back
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
+ addNormals(attr, normal, left, front, back, vertexFormat);
+
+ LR = front / 3;
+ LL = LR - 1;
+ UR = (back - 2) / 3;
+ UL = UR + 1;
+ indices[index++] = UL;
+ indices[index++] = LL;
+ indices[index++] = UR;
+ indices[index++] = UR;
+ indices[index++] = LL;
+ indices[index++] = LR;
+
+ front += 3;
+ back -= 3;
+ }
+ }
+
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: finalPositions,
+ });
+
+ if (vertexFormat.st) {
+ const st = new Float32Array((size / 3) * 2);
+ let rightSt;
+ let leftSt;
+ let stIndex = 0;
+ if (addEndPositions) {
+ leftCount /= 3;
+ rightCount /= 3;
+ const theta = Math.PI / (endPositionLength + 1);
+ leftSt = 1 / (leftCount - endPositionLength + 1);
+ rightSt = 1 / (rightCount - endPositionLength + 1);
+ let a;
+ const halfEndPos = endPositionLength / 2;
+ for (i = halfEndPos + 1; i < endPositionLength + 1; i++) {
+ // lower left rounded end
+ a = Math$1.CesiumMath.PI_OVER_TWO + theta * i;
+ st[stIndex++] = rightSt * (1 + Math.cos(a));
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
+ }
+ for (i = 1; i < rightCount - endPositionLength + 1; i++) {
+ // bottom edge
+ st[stIndex++] = i * rightSt;
+ st[stIndex++] = 0;
+ }
+ for (i = endPositionLength; i > halfEndPos; i--) {
+ // lower right rounded end
+ a = Math$1.CesiumMath.PI_OVER_TWO - i * theta;
+ st[stIndex++] = 1 - rightSt * (1 + Math.cos(a));
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
+ }
+ for (i = halfEndPos; i > 0; i--) {
+ // upper right rounded end
+ a = Math$1.CesiumMath.PI_OVER_TWO - theta * i;
+ st[stIndex++] = 1 - leftSt * (1 + Math.cos(a));
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
+ }
+ for (i = leftCount - endPositionLength; i > 0; i--) {
+ // top edge
+ st[stIndex++] = i * leftSt;
+ st[stIndex++] = 1;
+ }
+ for (i = 1; i < halfEndPos + 1; i++) {
+ // upper left rounded end
+ a = Math$1.CesiumMath.PI_OVER_TWO + theta * i;
+ st[stIndex++] = leftSt * (1 + Math.cos(a));
+ st[stIndex++] = 0.5 * (1 + Math.sin(a));
+ }
+ } else {
+ leftCount /= 3;
+ rightCount /= 3;
+ leftSt = 1 / (leftCount - 1);
+ rightSt = 1 / (rightCount - 1);
+ for (i = 0; i < rightCount; i++) {
+ // bottom edge
+ st[stIndex++] = i * rightSt;
+ st[stIndex++] = 0;
+ }
+ for (i = leftCount; i > 0; i--) {
+ // top edge
+ st[stIndex++] = (i - 1) * leftSt;
+ st[stIndex++] = 1;
+ }
+ }
+
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: st,
+ });
+ }
+
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: attr.normals,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: attr.tangents,
+ });
+ }
+
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: attr.bitangents,
+ });
+ }
+
+ return {
+ attributes: attributes,
+ indices: indices,
+ };
+ }
+
+ function extrudedAttributes(attributes, vertexFormat) {
+ if (
+ !vertexFormat.normal &&
+ !vertexFormat.tangent &&
+ !vertexFormat.bitangent &&
+ !vertexFormat.st
+ ) {
+ return attributes;
+ }
+ const positions = attributes.position.values;
+ let topNormals;
+ let topBitangents;
+ if (vertexFormat.normal || vertexFormat.bitangent) {
+ topNormals = attributes.normal.values;
+ topBitangents = attributes.bitangent.values;
+ }
+ const size = attributes.position.values.length / 18;
+ const threeSize = size * 3;
+ const twoSize = size * 2;
+ const sixSize = threeSize * 2;
+ let i;
+ if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) {
+ const normals = vertexFormat.normal
+ ? new Float32Array(threeSize * 6)
+ : undefined;
+ const tangents = vertexFormat.tangent
+ ? new Float32Array(threeSize * 6)
+ : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(threeSize * 6)
+ : undefined;
+ let topPosition = cartesian1;
+ let bottomPosition = cartesian2;
+ let previousPosition = cartesian3;
+ let normal = cartesian4;
+ let tangent = cartesian5;
+ let bitangent = cartesian6;
+ let attrIndex = sixSize;
+ for (i = 0; i < threeSize; i += 3) {
+ const attrIndexOffset = attrIndex + sixSize;
+ topPosition = Matrix3.Cartesian3.fromArray(positions, i, topPosition);
+ bottomPosition = Matrix3.Cartesian3.fromArray(
+ positions,
+ i + threeSize,
+ bottomPosition
+ );
+ previousPosition = Matrix3.Cartesian3.fromArray(
+ positions,
+ (i + 3) % threeSize,
+ previousPosition
+ );
+ bottomPosition = Matrix3.Cartesian3.subtract(
+ bottomPosition,
+ topPosition,
+ bottomPosition
+ );
+ previousPosition = Matrix3.Cartesian3.subtract(
+ previousPosition,
+ topPosition,
+ previousPosition
+ );
+ normal = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(bottomPosition, previousPosition, normal),
+ normal
+ );
+ if (vertexFormat.normal) {
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, attrIndexOffset);
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ normals,
+ normal,
+ attrIndexOffset + 3
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex);
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex + 3);
+ }
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ bitangent = Matrix3.Cartesian3.fromArray(topNormals, i, bitangent);
+ if (vertexFormat.bitangent) {
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ bitangents,
+ bitangent,
+ attrIndexOffset
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ bitangents,
+ bitangent,
+ attrIndexOffset + 3
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ bitangents,
+ bitangent,
+ attrIndex
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ bitangents,
+ bitangent,
+ attrIndex + 3
+ );
+ }
+
+ if (vertexFormat.tangent) {
+ tangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(bitangent, normal, tangent),
+ tangent
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ tangents,
+ tangent,
+ attrIndexOffset
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ tangents,
+ tangent,
+ attrIndexOffset + 3
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndex);
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ tangents,
+ tangent,
+ attrIndex + 3
+ );
+ }
+ }
+ attrIndex += 6;
+ }
+
+ if (vertexFormat.normal) {
+ normals.set(topNormals); //top
+ for (i = 0; i < threeSize; i += 3) {
+ //bottom normals
+ normals[i + threeSize] = -topNormals[i];
+ normals[i + threeSize + 1] = -topNormals[i + 1];
+ normals[i + threeSize + 2] = -topNormals[i + 2];
+ }
+ attributes.normal.values = normals;
+ } else {
+ attributes.normal = undefined;
+ }
+
+ if (vertexFormat.bitangent) {
+ bitangents.set(topBitangents); //top
+ bitangents.set(topBitangents, threeSize); //bottom
+ attributes.bitangent.values = bitangents;
+ } else {
+ attributes.bitangent = undefined;
+ }
+
+ if (vertexFormat.tangent) {
+ const topTangents = attributes.tangent.values;
+ tangents.set(topTangents); //top
+ tangents.set(topTangents, threeSize); //bottom
+ attributes.tangent.values = tangents;
+ }
+ }
+ if (vertexFormat.st) {
+ const topSt = attributes.st.values;
+ const st = new Float32Array(twoSize * 6);
+ st.set(topSt); //top
+ st.set(topSt, twoSize); //bottom
+ let index = twoSize * 2;
+
+ for (let j = 0; j < 2; j++) {
+ st[index++] = topSt[0];
+ st[index++] = topSt[1];
+ for (i = 2; i < twoSize; i += 2) {
+ const s = topSt[i];
+ const t = topSt[i + 1];
+ st[index++] = s;
+ st[index++] = t;
+ st[index++] = s;
+ st[index++] = t;
+ }
+ st[index++] = topSt[0];
+ st[index++] = topSt[1];
+ }
+ attributes.st.values = st;
+ }
+
+ return attributes;
+ }
+
+ function addWallPositions(positions, index, wallPositions) {
+ wallPositions[index++] = positions[0];
+ wallPositions[index++] = positions[1];
+ wallPositions[index++] = positions[2];
+ for (let i = 3; i < positions.length; i += 3) {
+ const x = positions[i];
+ const y = positions[i + 1];
+ const z = positions[i + 2];
+ wallPositions[index++] = x;
+ wallPositions[index++] = y;
+ wallPositions[index++] = z;
+ wallPositions[index++] = x;
+ wallPositions[index++] = y;
+ wallPositions[index++] = z;
+ }
+ wallPositions[index++] = positions[0];
+ wallPositions[index++] = positions[1];
+ wallPositions[index++] = positions[2];
+
+ return wallPositions;
+ }
+
+ function computePositionsExtruded(params, vertexFormat) {
+ const topVertexFormat = new VertexFormat.VertexFormat({
+ position: vertexFormat.position,
+ normal:
+ vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume,
+ tangent: vertexFormat.tangent,
+ bitangent: vertexFormat.normal || vertexFormat.bitangent,
+ st: vertexFormat.st,
+ });
+ const ellipsoid = params.ellipsoid;
+ const computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
+ const attr = combine(computedPositions, topVertexFormat, ellipsoid);
+ const height = params.height;
+ const extrudedHeight = params.extrudedHeight;
+ let attributes = attr.attributes;
+ const indices = attr.indices;
+ let positions = attributes.position.values;
+ let length = positions.length;
+ const newPositions = new Float64Array(length * 6);
+ let extrudedPositions = new Float64Array(length);
+ extrudedPositions.set(positions);
+ let wallPositions = new Float64Array(length * 4);
+
+ positions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ positions,
+ height,
+ ellipsoid
+ );
+ wallPositions = addWallPositions(positions, 0, wallPositions);
+ extrudedPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ extrudedPositions,
+ extrudedHeight,
+ ellipsoid
+ );
+ wallPositions = addWallPositions(
+ extrudedPositions,
+ length * 2,
+ wallPositions
+ );
+ newPositions.set(positions);
+ newPositions.set(extrudedPositions, length);
+ newPositions.set(wallPositions, length * 2);
+ attributes.position.values = newPositions;
+
+ attributes = extrudedAttributes(attributes, vertexFormat);
+ let i;
+ const size = length / 3;
+ if (params.shadowVolume) {
+ const topNormals = attributes.normal.values;
+ length = topNormals.length;
+
+ let extrudeNormals = new Float32Array(length * 6);
+ for (i = 0; i < length; i++) {
+ topNormals[i] = -topNormals[i];
+ }
+ //only get normals for bottom layer that's going to be pushed down
+ extrudeNormals.set(topNormals, length); //bottom face
+ extrudeNormals = addWallPositions(topNormals, length * 4, extrudeNormals); //bottom wall
+ attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: extrudeNormals,
+ });
+ if (!vertexFormat.normal) {
+ attributes.normal = undefined;
+ }
+ }
+ if (defaultValue.defined(params.offsetAttribute)) {
+ let applyOffset = new Uint8Array(size * 6);
+ if (params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
+ applyOffset = applyOffset
+ .fill(1, 0, size) // top face
+ .fill(1, size * 2, size * 4); // top wall
+ } else {
+ const applyOffsetValue =
+ params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
+ applyOffset = applyOffset.fill(applyOffsetValue);
+ }
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ const iLength = indices.length;
+ const twoSize = size + size;
+ const newIndices = IndexDatatype.IndexDatatype.createTypedArray(
+ newPositions.length / 3,
+ iLength * 2 + twoSize * 3
+ );
+ newIndices.set(indices);
+ let index = iLength;
+ for (i = 0; i < iLength; i += 3) {
+ // bottom indices
+ const v0 = indices[i];
+ const v1 = indices[i + 1];
+ const v2 = indices[i + 2];
+ newIndices[index++] = v2 + size;
+ newIndices[index++] = v1 + size;
+ newIndices[index++] = v0 + size;
+ }
+
+ let UL, LL, UR, LR;
+
+ for (i = 0; i < twoSize; i += 2) {
+ //wall indices
+ UL = i + twoSize;
+ LL = UL + twoSize;
+ UR = UL + 1;
+ LR = LL + 1;
+ newIndices[index++] = UL;
+ newIndices[index++] = LL;
+ newIndices[index++] = UR;
+ newIndices[index++] = UR;
+ newIndices[index++] = LL;
+ newIndices[index++] = LR;
+ }
+
+ return {
+ attributes: attributes,
+ indices: newIndices,
+ };
+ }
+
+ const scratchCartesian1 = new Matrix3.Cartesian3();
+ const scratchCartesian2 = new Matrix3.Cartesian3();
+ const scratchCartographic = new Matrix3.Cartographic();
+
+ function computeOffsetPoints(
+ position1,
+ position2,
+ ellipsoid,
+ halfWidth,
+ min,
+ max
+ ) {
+ // Compute direction of offset the point
+ const direction = Matrix3.Cartesian3.subtract(
+ position2,
+ position1,
+ scratchCartesian1
+ );
+ Matrix3.Cartesian3.normalize(direction, direction);
+ const normal = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian2);
+ const offsetDirection = Matrix3.Cartesian3.cross(
+ direction,
+ normal,
+ scratchCartesian1
+ );
+ Matrix3.Cartesian3.multiplyByScalar(offsetDirection, halfWidth, offsetDirection);
+
+ let minLat = min.latitude;
+ let minLon = min.longitude;
+ let maxLat = max.latitude;
+ let maxLon = max.longitude;
+
+ // Compute 2 offset points
+ Matrix3.Cartesian3.add(position1, offsetDirection, scratchCartesian2);
+ ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
+
+ let lat = scratchCartographic.latitude;
+ let lon = scratchCartographic.longitude;
+ minLat = Math.min(minLat, lat);
+ minLon = Math.min(minLon, lon);
+ maxLat = Math.max(maxLat, lat);
+ maxLon = Math.max(maxLon, lon);
+
+ Matrix3.Cartesian3.subtract(position1, offsetDirection, scratchCartesian2);
+ ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);
+
+ lat = scratchCartographic.latitude;
+ lon = scratchCartographic.longitude;
+ minLat = Math.min(minLat, lat);
+ minLon = Math.min(minLon, lon);
+ maxLat = Math.max(maxLat, lat);
+ maxLon = Math.max(maxLon, lon);
+
+ min.latitude = minLat;
+ min.longitude = minLon;
+ max.latitude = maxLat;
+ max.longitude = maxLon;
+ }
+
+ const scratchCartesianOffset = new Matrix3.Cartesian3();
+ const scratchCartesianEnds = new Matrix3.Cartesian3();
+ const scratchCartographicMin = new Matrix3.Cartographic();
+ const scratchCartographicMax = new Matrix3.Cartographic();
+
+ function computeRectangle(positions, ellipsoid, width, cornerType, result) {
+ positions = scaleToSurface(positions, ellipsoid);
+ const cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ positions,
+ Matrix3.Cartesian3.equalsEpsilon
+ );
+ const length = cleanPositions.length;
+ if (length < 2 || width <= 0) {
+ return new Matrix2.Rectangle();
+ }
+ const halfWidth = width * 0.5;
+
+ scratchCartographicMin.latitude = Number.POSITIVE_INFINITY;
+ scratchCartographicMin.longitude = Number.POSITIVE_INFINITY;
+ scratchCartographicMax.latitude = Number.NEGATIVE_INFINITY;
+ scratchCartographicMax.longitude = Number.NEGATIVE_INFINITY;
+
+ let lat, lon;
+ if (cornerType === PolylineVolumeGeometryLibrary.CornerType.ROUNDED) {
+ // Compute start cap
+ const first = cleanPositions[0];
+ Matrix3.Cartesian3.subtract(first, cleanPositions[1], scratchCartesianOffset);
+ Matrix3.Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);
+ Matrix3.Cartesian3.multiplyByScalar(
+ scratchCartesianOffset,
+ halfWidth,
+ scratchCartesianOffset
+ );
+ Matrix3.Cartesian3.add(first, scratchCartesianOffset, scratchCartesianEnds);
+
+ ellipsoid.cartesianToCartographic(
+ scratchCartesianEnds,
+ scratchCartographic
+ );
+ lat = scratchCartographic.latitude;
+ lon = scratchCartographic.longitude;
+ scratchCartographicMin.latitude = Math.min(
+ scratchCartographicMin.latitude,
+ lat
+ );
+ scratchCartographicMin.longitude = Math.min(
+ scratchCartographicMin.longitude,
+ lon
+ );
+ scratchCartographicMax.latitude = Math.max(
+ scratchCartographicMax.latitude,
+ lat
+ );
+ scratchCartographicMax.longitude = Math.max(
+ scratchCartographicMax.longitude,
+ lon
+ );
+ }
+
+ // Compute the rest
+ for (let i = 0; i < length - 1; ++i) {
+ computeOffsetPoints(
+ cleanPositions[i],
+ cleanPositions[i + 1],
+ ellipsoid,
+ halfWidth,
+ scratchCartographicMin,
+ scratchCartographicMax
+ );
+ }
+
+ // Compute ending point
+ const last = cleanPositions[length - 1];
+ Matrix3.Cartesian3.subtract(last, cleanPositions[length - 2], scratchCartesianOffset);
+ Matrix3.Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);
+ Matrix3.Cartesian3.multiplyByScalar(
+ scratchCartesianOffset,
+ halfWidth,
+ scratchCartesianOffset
+ );
+ Matrix3.Cartesian3.add(last, scratchCartesianOffset, scratchCartesianEnds);
+ computeOffsetPoints(
+ last,
+ scratchCartesianEnds,
+ ellipsoid,
+ halfWidth,
+ scratchCartographicMin,
+ scratchCartographicMax
+ );
+
+ if (cornerType === PolylineVolumeGeometryLibrary.CornerType.ROUNDED) {
+ // Compute end cap
+ ellipsoid.cartesianToCartographic(
+ scratchCartesianEnds,
+ scratchCartographic
+ );
+ lat = scratchCartographic.latitude;
+ lon = scratchCartographic.longitude;
+ scratchCartographicMin.latitude = Math.min(
+ scratchCartographicMin.latitude,
+ lat
+ );
+ scratchCartographicMin.longitude = Math.min(
+ scratchCartographicMin.longitude,
+ lon
+ );
+ scratchCartographicMax.latitude = Math.max(
+ scratchCartographicMax.latitude,
+ lat
+ );
+ scratchCartographicMax.longitude = Math.max(
+ scratchCartographicMax.longitude,
+ lon
+ );
+ }
+
+ const rectangle = defaultValue.defined(result) ? result : new Matrix2.Rectangle();
+ rectangle.north = scratchCartographicMax.latitude;
+ rectangle.south = scratchCartographicMin.latitude;
+ rectangle.east = scratchCartographicMax.longitude;
+ rectangle.west = scratchCartographicMin.longitude;
+
+ return rectangle;
+ }
+
+ /**
+ * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
+ *
+ * @alias CorridorGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.
+ * @param {Number} options.width The distance between the edges of the corridor in meters.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Number} [options.height=0] The distance in meters between the ellipsoid surface and the positions.
+ * @param {Number} [options.extrudedHeight] The distance in meters between the ellipsoid surface and the extruded face.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
+ *
+ * @see CorridorGeometry.createGeometry
+ * @see Packable
+ *
+ * @demo {@link https://sandcastle.cesium.com/index.html?src=Corridor.html|Cesium Sandcastle Corridor Demo}
+ *
+ * @example
+ * const corridor = new Cesium.CorridorGeometry({
+ * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
+ * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
+ * width : 100000
+ * });
+ */
+ function CorridorGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const positions = options.positions;
+ const width = options.width;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("options.positions", positions);
+ Check.Check.defined("options.width", width);
+ //>>includeEnd('debug');
+
+ const height = defaultValue.defaultValue(options.height, 0.0);
+ const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
+
+ this._positions = positions;
+ this._ellipsoid = Matrix3.Ellipsoid.clone(
+ defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
+ );
+ this._vertexFormat = VertexFormat.VertexFormat.clone(
+ defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT)
+ );
+ this._width = width;
+ this._height = Math.max(height, extrudedHeight);
+ this._extrudedHeight = Math.min(height, extrudedHeight);
+ this._cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
+ this._granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ this._shadowVolume = defaultValue.defaultValue(options.shadowVolume, false);
+ this._workerName = "createCorridorGeometry";
+ this._offsetAttribute = options.offsetAttribute;
+ this._rectangle = undefined;
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ 1 +
+ positions.length * Matrix3.Cartesian3.packedLength +
+ Matrix3.Ellipsoid.packedLength +
+ VertexFormat.VertexFormat.packedLength +
+ 7;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {CorridorGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ CorridorGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const positions = value._positions;
+ const length = positions.length;
+ array[startingIndex++] = length;
+
+ for (let i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
+ }
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ array[startingIndex++] = value._width;
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._cornerType;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;
+ array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+ const scratchOptions = {
+ positions: undefined,
+ ellipsoid: scratchEllipsoid,
+ vertexFormat: scratchVertexFormat,
+ width: undefined,
+ height: undefined,
+ extrudedHeight: undefined,
+ cornerType: undefined,
+ granularity: undefined,
+ shadowVolume: undefined,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {CorridorGeometry} [result] The object into which to store the result.
+ * @returns {CorridorGeometry} The modified result parameter or a new CorridorGeometry instance if one was not provided.
+ */
+ CorridorGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const length = array[startingIndex++];
+ const positions = new Array(length);
+
+ for (let i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
+ }
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ const width = array[startingIndex++];
+ const height = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const cornerType = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const shadowVolume = array[startingIndex++] === 1.0;
+ const offsetAttribute = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.positions = positions;
+ scratchOptions.width = width;
+ scratchOptions.height = height;
+ scratchOptions.extrudedHeight = extrudedHeight;
+ scratchOptions.cornerType = cornerType;
+ scratchOptions.granularity = granularity;
+ scratchOptions.shadowVolume = shadowVolume;
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return new CorridorGeometry(scratchOptions);
+ }
+
+ result._positions = positions;
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._width = width;
+ result._height = height;
+ result._extrudedHeight = extrudedHeight;
+ result._cornerType = cornerType;
+ result._granularity = granularity;
+ result._shadowVolume = shadowVolume;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the bounding rectangle given the provided options
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.
+ * @param {Number} options.width The distance between the edges of the corridor in meters.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
+ * @param {Rectangle} [result] An object in which to store the result.
+ *
+ * @returns {Rectangle} The result rectangle.
+ */
+ CorridorGeometry.computeRectangle = function (options, result) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const positions = options.positions;
+ const width = options.width;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("options.positions", positions);
+ Check.Check.defined("options.width", width);
+ //>>includeEnd('debug');
+
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ const cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
+
+ return computeRectangle(positions, ellipsoid, width, cornerType, result);
+ };
+
+ /**
+ * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {CorridorGeometry} corridorGeometry A description of the corridor.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ CorridorGeometry.createGeometry = function (corridorGeometry) {
+ let positions = corridorGeometry._positions;
+ const width = corridorGeometry._width;
+ const ellipsoid = corridorGeometry._ellipsoid;
+
+ positions = scaleToSurface(positions, ellipsoid);
+ const cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ positions,
+ Matrix3.Cartesian3.equalsEpsilon
+ );
+
+ if (cleanPositions.length < 2 || width <= 0) {
+ return;
+ }
+
+ const height = corridorGeometry._height;
+ const extrudedHeight = corridorGeometry._extrudedHeight;
+ const extrude = !Math$1.CesiumMath.equalsEpsilon(
+ height,
+ extrudedHeight,
+ 0,
+ Math$1.CesiumMath.EPSILON2
+ );
+
+ const vertexFormat = corridorGeometry._vertexFormat;
+ const params = {
+ ellipsoid: ellipsoid,
+ positions: cleanPositions,
+ width: width,
+ cornerType: corridorGeometry._cornerType,
+ granularity: corridorGeometry._granularity,
+ saveAttributes: true,
+ };
+ let attr;
+ if (extrude) {
+ params.height = height;
+ params.extrudedHeight = extrudedHeight;
+ params.shadowVolume = corridorGeometry._shadowVolume;
+ params.offsetAttribute = corridorGeometry._offsetAttribute;
+ attr = computePositionsExtruded(params, vertexFormat);
+ } else {
+ const computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
+ attr = combine(computedPositions, vertexFormat, ellipsoid);
+ attr.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ attr.attributes.position.values,
+ height,
+ ellipsoid
+ );
+
+ if (defaultValue.defined(corridorGeometry._offsetAttribute)) {
+ const applyOffsetValue =
+ corridorGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const length = attr.attributes.position.values.length;
+ const applyOffset = new Uint8Array(length / 3).fill(applyOffsetValue);
+ attr.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+ }
+ const attributes = attr.attributes;
+ const boundingSphere = Transforms.BoundingSphere.fromVertices(
+ attributes.position.values,
+ undefined,
+ 3
+ );
+ if (!vertexFormat.position) {
+ attr.attributes.position.values = undefined;
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: attr.indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ boundingSphere: boundingSphere,
+ offsetAttribute: corridorGeometry._offsetAttribute,
+ });
+ };
+
+ /**
+ * @private
+ */
+ CorridorGeometry.createShadowVolume = function (
+ corridorGeometry,
+ minHeightFunc,
+ maxHeightFunc
+ ) {
+ const granularity = corridorGeometry._granularity;
+ const ellipsoid = corridorGeometry._ellipsoid;
+
+ const minHeight = minHeightFunc(granularity, ellipsoid);
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
+
+ return new CorridorGeometry({
+ positions: corridorGeometry._positions,
+ width: corridorGeometry._width,
+ cornerType: corridorGeometry._cornerType,
+ ellipsoid: ellipsoid,
+ granularity: granularity,
+ extrudedHeight: minHeight,
+ height: maxHeight,
+ vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
+ shadowVolume: true,
+ });
+ };
+
+ Object.defineProperties(CorridorGeometry.prototype, {
+ /**
+ * @private
+ */
+ rectangle: {
+ get: function () {
+ if (!defaultValue.defined(this._rectangle)) {
+ this._rectangle = computeRectangle(
+ this._positions,
+ this._ellipsoid,
+ this._width,
+ this._cornerType
+ );
+ }
+ return this._rectangle;
+ },
+ },
+ /**
+ * For remapping texture coordinates when rendering CorridorGeometries as GroundPrimitives.
+ *
+ * Corridors don't support stRotation,
+ * so just return the corners of the original system.
+ * @private
+ */
+ textureCoordinateRotationPoints: {
+ get: function () {
+ return [0, 0, 0, 1, 1, 0];
+ },
+ },
+ });
+
+ function createCorridorGeometry(corridorGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ corridorGeometry = CorridorGeometry.unpack(corridorGeometry, offset);
+ }
+ corridorGeometry._ellipsoid = Matrix3.Ellipsoid.clone(corridorGeometry._ellipsoid);
+ return CorridorGeometry.createGeometry(corridorGeometry);
+ }
+
+ return createCorridorGeometry;
+
+}));
+//# sourceMappingURL=createCorridorGeometry.js.map
diff --git a/examples/cesium/Workers/createCorridorGeometry.js.map b/examples/cesium/Workers/createCorridorGeometry.js.map
new file mode 100644
index 0000000..a09cf03
--- /dev/null
+++ b/examples/cesium/Workers/createCorridorGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createCorridorGeometry.js","sources":["../../../Source/Core/CorridorGeometry.js","../../../Source/WorkersES6/createCorridorGeometry.js"],"sourcesContent":["import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport CornerType from \"./CornerType.js\";\r\nimport CorridorGeometryLibrary from \"./CorridorGeometryLibrary.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PolygonPipeline from \"./PolygonPipeline.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\nconst cartesian1 = new Cartesian3();\r\nconst cartesian2 = new Cartesian3();\r\nconst cartesian3 = new Cartesian3();\r\nconst cartesian4 = new Cartesian3();\r\nconst cartesian5 = new Cartesian3();\r\nconst cartesian6 = new Cartesian3();\r\n\r\nconst scratch1 = new Cartesian3();\r\nconst scratch2 = new Cartesian3();\r\n\r\nfunction scaleToSurface(positions, ellipsoid) {\r\n for (let i = 0; i < positions.length; i++) {\r\n positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);\r\n }\r\n return positions;\r\n}\r\n\r\nfunction addNormals(attr, normal, left, front, back, vertexFormat) {\r\n const normals = attr.normals;\r\n const tangents = attr.tangents;\r\n const bitangents = attr.bitangents;\r\n const forward = Cartesian3.normalize(\r\n Cartesian3.cross(left, normal, scratch1),\r\n scratch1\r\n );\r\n if (vertexFormat.normal) {\r\n CorridorGeometryLibrary.addAttribute(normals, normal, front, back);\r\n }\r\n if (vertexFormat.tangent) {\r\n CorridorGeometryLibrary.addAttribute(tangents, forward, front, back);\r\n }\r\n if (vertexFormat.bitangent) {\r\n CorridorGeometryLibrary.addAttribute(bitangents, left, front, back);\r\n }\r\n}\r\n\r\nfunction combine(computedPositions, vertexFormat, ellipsoid) {\r\n const positions = computedPositions.positions;\r\n const corners = computedPositions.corners;\r\n const endPositions = computedPositions.endPositions;\r\n const computedLefts = computedPositions.lefts;\r\n const computedNormals = computedPositions.normals;\r\n const attributes = new GeometryAttributes();\r\n let corner;\r\n let leftCount = 0;\r\n let rightCount = 0;\r\n let i;\r\n let indicesLength = 0;\r\n let length;\r\n for (i = 0; i < positions.length; i += 2) {\r\n length = positions[i].length - 3;\r\n leftCount += length; //subtracting 3 to account for duplicate points at corners\r\n indicesLength += length * 2;\r\n rightCount += positions[i + 1].length - 3;\r\n }\r\n leftCount += 3; //add back count for end positions\r\n rightCount += 3;\r\n for (i = 0; i < corners.length; i++) {\r\n corner = corners[i];\r\n const leftSide = corners[i].leftPositions;\r\n if (defined(leftSide)) {\r\n length = leftSide.length;\r\n leftCount += length;\r\n indicesLength += length;\r\n } else {\r\n length = corners[i].rightPositions.length;\r\n rightCount += length;\r\n indicesLength += length;\r\n }\r\n }\r\n\r\n const addEndPositions = defined(endPositions);\r\n let endPositionLength;\r\n if (addEndPositions) {\r\n endPositionLength = endPositions[0].length - 3;\r\n leftCount += endPositionLength;\r\n rightCount += endPositionLength;\r\n endPositionLength /= 3;\r\n indicesLength += endPositionLength * 6;\r\n }\r\n const size = leftCount + rightCount;\r\n const finalPositions = new Float64Array(size);\r\n const normals = vertexFormat.normal ? new Float32Array(size) : undefined;\r\n const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(size)\r\n : undefined;\r\n const attr = {\r\n normals: normals,\r\n tangents: tangents,\r\n bitangents: bitangents,\r\n };\r\n let front = 0;\r\n let back = size - 1;\r\n let UL, LL, UR, LR;\r\n let normal = cartesian1;\r\n let left = cartesian2;\r\n let rightPos, leftPos;\r\n const halfLength = endPositionLength / 2;\r\n\r\n const indices = IndexDatatype.createTypedArray(size / 3, indicesLength);\r\n let index = 0;\r\n if (addEndPositions) {\r\n // add rounded end\r\n leftPos = cartesian3;\r\n rightPos = cartesian4;\r\n const firstEndPositions = endPositions[0];\r\n normal = Cartesian3.fromArray(computedNormals, 0, normal);\r\n left = Cartesian3.fromArray(computedLefts, 0, left);\r\n for (i = 0; i < halfLength; i++) {\r\n leftPos = Cartesian3.fromArray(\r\n firstEndPositions,\r\n (halfLength - 1 - i) * 3,\r\n leftPos\r\n );\r\n rightPos = Cartesian3.fromArray(\r\n firstEndPositions,\r\n (halfLength + i) * 3,\r\n rightPos\r\n );\r\n CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\r\n CorridorGeometryLibrary.addAttribute(\r\n finalPositions,\r\n leftPos,\r\n undefined,\r\n back\r\n );\r\n addNormals(attr, normal, left, front, back, vertexFormat);\r\n\r\n LL = front / 3;\r\n LR = LL + 1;\r\n UL = (back - 2) / 3;\r\n UR = UL - 1;\r\n indices[index++] = UL;\r\n indices[index++] = LL;\r\n indices[index++] = UR;\r\n indices[index++] = UR;\r\n indices[index++] = LL;\r\n indices[index++] = LR;\r\n\r\n front += 3;\r\n back -= 3;\r\n }\r\n }\r\n\r\n let posIndex = 0;\r\n let compIndex = 0;\r\n let rightEdge = positions[posIndex++]; //add first two edges\r\n let leftEdge = positions[posIndex++];\r\n finalPositions.set(rightEdge, front);\r\n finalPositions.set(leftEdge, back - leftEdge.length + 1);\r\n\r\n left = Cartesian3.fromArray(computedLefts, compIndex, left);\r\n let rightNormal;\r\n let leftNormal;\r\n length = leftEdge.length - 3;\r\n for (i = 0; i < length; i += 3) {\r\n rightNormal = ellipsoid.geodeticSurfaceNormal(\r\n Cartesian3.fromArray(rightEdge, i, scratch1),\r\n scratch1\r\n );\r\n leftNormal = ellipsoid.geodeticSurfaceNormal(\r\n Cartesian3.fromArray(leftEdge, length - i, scratch2),\r\n scratch2\r\n );\r\n normal = Cartesian3.normalize(\r\n Cartesian3.add(rightNormal, leftNormal, normal),\r\n normal\r\n );\r\n addNormals(attr, normal, left, front, back, vertexFormat);\r\n\r\n LL = front / 3;\r\n LR = LL + 1;\r\n UL = (back - 2) / 3;\r\n UR = UL - 1;\r\n indices[index++] = UL;\r\n indices[index++] = LL;\r\n indices[index++] = UR;\r\n indices[index++] = UR;\r\n indices[index++] = LL;\r\n indices[index++] = LR;\r\n\r\n front += 3;\r\n back -= 3;\r\n }\r\n\r\n rightNormal = ellipsoid.geodeticSurfaceNormal(\r\n Cartesian3.fromArray(rightEdge, length, scratch1),\r\n scratch1\r\n );\r\n leftNormal = ellipsoid.geodeticSurfaceNormal(\r\n Cartesian3.fromArray(leftEdge, length, scratch2),\r\n scratch2\r\n );\r\n normal = Cartesian3.normalize(\r\n Cartesian3.add(rightNormal, leftNormal, normal),\r\n normal\r\n );\r\n compIndex += 3;\r\n for (i = 0; i < corners.length; i++) {\r\n let j;\r\n corner = corners[i];\r\n const l = corner.leftPositions;\r\n const r = corner.rightPositions;\r\n let pivot;\r\n let start;\r\n let outsidePoint = cartesian6;\r\n let previousPoint = cartesian3;\r\n let nextPoint = cartesian4;\r\n normal = Cartesian3.fromArray(computedNormals, compIndex, normal);\r\n if (defined(l)) {\r\n addNormals(attr, normal, left, undefined, back, vertexFormat);\r\n back -= 3;\r\n pivot = LR;\r\n start = UR;\r\n for (j = 0; j < l.length / 3; j++) {\r\n outsidePoint = Cartesian3.fromArray(l, j * 3, outsidePoint);\r\n indices[index++] = pivot;\r\n indices[index++] = start - j - 1;\r\n indices[index++] = start - j;\r\n CorridorGeometryLibrary.addAttribute(\r\n finalPositions,\r\n outsidePoint,\r\n undefined,\r\n back\r\n );\r\n previousPoint = Cartesian3.fromArray(\r\n finalPositions,\r\n (start - j - 1) * 3,\r\n previousPoint\r\n );\r\n nextPoint = Cartesian3.fromArray(finalPositions, pivot * 3, nextPoint);\r\n left = Cartesian3.normalize(\r\n Cartesian3.subtract(previousPoint, nextPoint, left),\r\n left\r\n );\r\n addNormals(attr, normal, left, undefined, back, vertexFormat);\r\n back -= 3;\r\n }\r\n outsidePoint = Cartesian3.fromArray(\r\n finalPositions,\r\n pivot * 3,\r\n outsidePoint\r\n );\r\n previousPoint = Cartesian3.subtract(\r\n Cartesian3.fromArray(finalPositions, start * 3, previousPoint),\r\n outsidePoint,\r\n previousPoint\r\n );\r\n nextPoint = Cartesian3.subtract(\r\n Cartesian3.fromArray(finalPositions, (start - j) * 3, nextPoint),\r\n outsidePoint,\r\n nextPoint\r\n );\r\n left = Cartesian3.normalize(\r\n Cartesian3.add(previousPoint, nextPoint, left),\r\n left\r\n );\r\n addNormals(attr, normal, left, front, undefined, vertexFormat);\r\n front += 3;\r\n } else {\r\n addNormals(attr, normal, left, front, undefined, vertexFormat);\r\n front += 3;\r\n pivot = UR;\r\n start = LR;\r\n for (j = 0; j < r.length / 3; j++) {\r\n outsidePoint = Cartesian3.fromArray(r, j * 3, outsidePoint);\r\n indices[index++] = pivot;\r\n indices[index++] = start + j;\r\n indices[index++] = start + j + 1;\r\n CorridorGeometryLibrary.addAttribute(\r\n finalPositions,\r\n outsidePoint,\r\n front\r\n );\r\n previousPoint = Cartesian3.fromArray(\r\n finalPositions,\r\n pivot * 3,\r\n previousPoint\r\n );\r\n nextPoint = Cartesian3.fromArray(\r\n finalPositions,\r\n (start + j) * 3,\r\n nextPoint\r\n );\r\n left = Cartesian3.normalize(\r\n Cartesian3.subtract(previousPoint, nextPoint, left),\r\n left\r\n );\r\n addNormals(attr, normal, left, front, undefined, vertexFormat);\r\n front += 3;\r\n }\r\n outsidePoint = Cartesian3.fromArray(\r\n finalPositions,\r\n pivot * 3,\r\n outsidePoint\r\n );\r\n previousPoint = Cartesian3.subtract(\r\n Cartesian3.fromArray(finalPositions, (start + j) * 3, previousPoint),\r\n outsidePoint,\r\n previousPoint\r\n );\r\n nextPoint = Cartesian3.subtract(\r\n Cartesian3.fromArray(finalPositions, start * 3, nextPoint),\r\n outsidePoint,\r\n nextPoint\r\n );\r\n left = Cartesian3.normalize(\r\n Cartesian3.negate(Cartesian3.add(nextPoint, previousPoint, left), left),\r\n left\r\n );\r\n addNormals(attr, normal, left, undefined, back, vertexFormat);\r\n back -= 3;\r\n }\r\n rightEdge = positions[posIndex++];\r\n leftEdge = positions[posIndex++];\r\n rightEdge.splice(0, 3); //remove duplicate points added by corner\r\n leftEdge.splice(leftEdge.length - 3, 3);\r\n finalPositions.set(rightEdge, front);\r\n finalPositions.set(leftEdge, back - leftEdge.length + 1);\r\n length = leftEdge.length - 3;\r\n\r\n compIndex += 3;\r\n left = Cartesian3.fromArray(computedLefts, compIndex, left);\r\n for (j = 0; j < leftEdge.length; j += 3) {\r\n rightNormal = ellipsoid.geodeticSurfaceNormal(\r\n Cartesian3.fromArray(rightEdge, j, scratch1),\r\n scratch1\r\n );\r\n leftNormal = ellipsoid.geodeticSurfaceNormal(\r\n Cartesian3.fromArray(leftEdge, length - j, scratch2),\r\n scratch2\r\n );\r\n normal = Cartesian3.normalize(\r\n Cartesian3.add(rightNormal, leftNormal, normal),\r\n normal\r\n );\r\n addNormals(attr, normal, left, front, back, vertexFormat);\r\n\r\n LR = front / 3;\r\n LL = LR - 1;\r\n UR = (back - 2) / 3;\r\n UL = UR + 1;\r\n indices[index++] = UL;\r\n indices[index++] = LL;\r\n indices[index++] = UR;\r\n indices[index++] = UR;\r\n indices[index++] = LL;\r\n indices[index++] = LR;\r\n\r\n front += 3;\r\n back -= 3;\r\n }\r\n front -= 3;\r\n back += 3;\r\n }\r\n normal = Cartesian3.fromArray(\r\n computedNormals,\r\n computedNormals.length - 3,\r\n normal\r\n );\r\n addNormals(attr, normal, left, front, back, vertexFormat);\r\n\r\n if (addEndPositions) {\r\n // add rounded end\r\n front += 3;\r\n back -= 3;\r\n leftPos = cartesian3;\r\n rightPos = cartesian4;\r\n const lastEndPositions = endPositions[1];\r\n for (i = 0; i < halfLength; i++) {\r\n leftPos = Cartesian3.fromArray(\r\n lastEndPositions,\r\n (endPositionLength - i - 1) * 3,\r\n leftPos\r\n );\r\n rightPos = Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);\r\n CorridorGeometryLibrary.addAttribute(\r\n finalPositions,\r\n leftPos,\r\n undefined,\r\n back\r\n );\r\n CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\r\n addNormals(attr, normal, left, front, back, vertexFormat);\r\n\r\n LR = front / 3;\r\n LL = LR - 1;\r\n UR = (back - 2) / 3;\r\n UL = UR + 1;\r\n indices[index++] = UL;\r\n indices[index++] = LL;\r\n indices[index++] = UR;\r\n indices[index++] = UR;\r\n indices[index++] = LL;\r\n indices[index++] = LR;\r\n\r\n front += 3;\r\n back -= 3;\r\n }\r\n }\r\n\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: finalPositions,\r\n });\r\n\r\n if (vertexFormat.st) {\r\n const st = new Float32Array((size / 3) * 2);\r\n let rightSt;\r\n let leftSt;\r\n let stIndex = 0;\r\n if (addEndPositions) {\r\n leftCount /= 3;\r\n rightCount /= 3;\r\n const theta = Math.PI / (endPositionLength + 1);\r\n leftSt = 1 / (leftCount - endPositionLength + 1);\r\n rightSt = 1 / (rightCount - endPositionLength + 1);\r\n let a;\r\n const halfEndPos = endPositionLength / 2;\r\n for (i = halfEndPos + 1; i < endPositionLength + 1; i++) {\r\n // lower left rounded end\r\n a = CesiumMath.PI_OVER_TWO + theta * i;\r\n st[stIndex++] = rightSt * (1 + Math.cos(a));\r\n st[stIndex++] = 0.5 * (1 + Math.sin(a));\r\n }\r\n for (i = 1; i < rightCount - endPositionLength + 1; i++) {\r\n // bottom edge\r\n st[stIndex++] = i * rightSt;\r\n st[stIndex++] = 0;\r\n }\r\n for (i = endPositionLength; i > halfEndPos; i--) {\r\n // lower right rounded end\r\n a = CesiumMath.PI_OVER_TWO - i * theta;\r\n st[stIndex++] = 1 - rightSt * (1 + Math.cos(a));\r\n st[stIndex++] = 0.5 * (1 + Math.sin(a));\r\n }\r\n for (i = halfEndPos; i > 0; i--) {\r\n // upper right rounded end\r\n a = CesiumMath.PI_OVER_TWO - theta * i;\r\n st[stIndex++] = 1 - leftSt * (1 + Math.cos(a));\r\n st[stIndex++] = 0.5 * (1 + Math.sin(a));\r\n }\r\n for (i = leftCount - endPositionLength; i > 0; i--) {\r\n // top edge\r\n st[stIndex++] = i * leftSt;\r\n st[stIndex++] = 1;\r\n }\r\n for (i = 1; i < halfEndPos + 1; i++) {\r\n // upper left rounded end\r\n a = CesiumMath.PI_OVER_TWO + theta * i;\r\n st[stIndex++] = leftSt * (1 + Math.cos(a));\r\n st[stIndex++] = 0.5 * (1 + Math.sin(a));\r\n }\r\n } else {\r\n leftCount /= 3;\r\n rightCount /= 3;\r\n leftSt = 1 / (leftCount - 1);\r\n rightSt = 1 / (rightCount - 1);\r\n for (i = 0; i < rightCount; i++) {\r\n // bottom edge\r\n st[stIndex++] = i * rightSt;\r\n st[stIndex++] = 0;\r\n }\r\n for (i = leftCount; i > 0; i--) {\r\n // top edge\r\n st[stIndex++] = (i - 1) * leftSt;\r\n st[stIndex++] = 1;\r\n }\r\n }\r\n\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: st,\r\n });\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: attr.normals,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: attr.tangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: attr.bitangents,\r\n });\r\n }\r\n\r\n return {\r\n attributes: attributes,\r\n indices: indices,\r\n };\r\n}\r\n\r\nfunction extrudedAttributes(attributes, vertexFormat) {\r\n if (\r\n !vertexFormat.normal &&\r\n !vertexFormat.tangent &&\r\n !vertexFormat.bitangent &&\r\n !vertexFormat.st\r\n ) {\r\n return attributes;\r\n }\r\n const positions = attributes.position.values;\r\n let topNormals;\r\n let topBitangents;\r\n if (vertexFormat.normal || vertexFormat.bitangent) {\r\n topNormals = attributes.normal.values;\r\n topBitangents = attributes.bitangent.values;\r\n }\r\n const size = attributes.position.values.length / 18;\r\n const threeSize = size * 3;\r\n const twoSize = size * 2;\r\n const sixSize = threeSize * 2;\r\n let i;\r\n if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) {\r\n const normals = vertexFormat.normal\r\n ? new Float32Array(threeSize * 6)\r\n : undefined;\r\n const tangents = vertexFormat.tangent\r\n ? new Float32Array(threeSize * 6)\r\n : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(threeSize * 6)\r\n : undefined;\r\n let topPosition = cartesian1;\r\n let bottomPosition = cartesian2;\r\n let previousPosition = cartesian3;\r\n let normal = cartesian4;\r\n let tangent = cartesian5;\r\n let bitangent = cartesian6;\r\n let attrIndex = sixSize;\r\n for (i = 0; i < threeSize; i += 3) {\r\n const attrIndexOffset = attrIndex + sixSize;\r\n topPosition = Cartesian3.fromArray(positions, i, topPosition);\r\n bottomPosition = Cartesian3.fromArray(\r\n positions,\r\n i + threeSize,\r\n bottomPosition\r\n );\r\n previousPosition = Cartesian3.fromArray(\r\n positions,\r\n (i + 3) % threeSize,\r\n previousPosition\r\n );\r\n bottomPosition = Cartesian3.subtract(\r\n bottomPosition,\r\n topPosition,\r\n bottomPosition\r\n );\r\n previousPosition = Cartesian3.subtract(\r\n previousPosition,\r\n topPosition,\r\n previousPosition\r\n );\r\n normal = Cartesian3.normalize(\r\n Cartesian3.cross(bottomPosition, previousPosition, normal),\r\n normal\r\n );\r\n if (vertexFormat.normal) {\r\n CorridorGeometryLibrary.addAttribute(normals, normal, attrIndexOffset);\r\n CorridorGeometryLibrary.addAttribute(\r\n normals,\r\n normal,\r\n attrIndexOffset + 3\r\n );\r\n CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex);\r\n CorridorGeometryLibrary.addAttribute(normals, normal, attrIndex + 3);\r\n }\r\n if (vertexFormat.tangent || vertexFormat.bitangent) {\r\n bitangent = Cartesian3.fromArray(topNormals, i, bitangent);\r\n if (vertexFormat.bitangent) {\r\n CorridorGeometryLibrary.addAttribute(\r\n bitangents,\r\n bitangent,\r\n attrIndexOffset\r\n );\r\n CorridorGeometryLibrary.addAttribute(\r\n bitangents,\r\n bitangent,\r\n attrIndexOffset + 3\r\n );\r\n CorridorGeometryLibrary.addAttribute(\r\n bitangents,\r\n bitangent,\r\n attrIndex\r\n );\r\n CorridorGeometryLibrary.addAttribute(\r\n bitangents,\r\n bitangent,\r\n attrIndex + 3\r\n );\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n tangent = Cartesian3.normalize(\r\n Cartesian3.cross(bitangent, normal, tangent),\r\n tangent\r\n );\r\n CorridorGeometryLibrary.addAttribute(\r\n tangents,\r\n tangent,\r\n attrIndexOffset\r\n );\r\n CorridorGeometryLibrary.addAttribute(\r\n tangents,\r\n tangent,\r\n attrIndexOffset + 3\r\n );\r\n CorridorGeometryLibrary.addAttribute(tangents, tangent, attrIndex);\r\n CorridorGeometryLibrary.addAttribute(\r\n tangents,\r\n tangent,\r\n attrIndex + 3\r\n );\r\n }\r\n }\r\n attrIndex += 6;\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n normals.set(topNormals); //top\r\n for (i = 0; i < threeSize; i += 3) {\r\n //bottom normals\r\n normals[i + threeSize] = -topNormals[i];\r\n normals[i + threeSize + 1] = -topNormals[i + 1];\r\n normals[i + threeSize + 2] = -topNormals[i + 2];\r\n }\r\n attributes.normal.values = normals;\r\n } else {\r\n attributes.normal = undefined;\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n bitangents.set(topBitangents); //top\r\n bitangents.set(topBitangents, threeSize); //bottom\r\n attributes.bitangent.values = bitangents;\r\n } else {\r\n attributes.bitangent = undefined;\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n const topTangents = attributes.tangent.values;\r\n tangents.set(topTangents); //top\r\n tangents.set(topTangents, threeSize); //bottom\r\n attributes.tangent.values = tangents;\r\n }\r\n }\r\n if (vertexFormat.st) {\r\n const topSt = attributes.st.values;\r\n const st = new Float32Array(twoSize * 6);\r\n st.set(topSt); //top\r\n st.set(topSt, twoSize); //bottom\r\n let index = twoSize * 2;\r\n\r\n for (let j = 0; j < 2; j++) {\r\n st[index++] = topSt[0];\r\n st[index++] = topSt[1];\r\n for (i = 2; i < twoSize; i += 2) {\r\n const s = topSt[i];\r\n const t = topSt[i + 1];\r\n st[index++] = s;\r\n st[index++] = t;\r\n st[index++] = s;\r\n st[index++] = t;\r\n }\r\n st[index++] = topSt[0];\r\n st[index++] = topSt[1];\r\n }\r\n attributes.st.values = st;\r\n }\r\n\r\n return attributes;\r\n}\r\n\r\nfunction addWallPositions(positions, index, wallPositions) {\r\n wallPositions[index++] = positions[0];\r\n wallPositions[index++] = positions[1];\r\n wallPositions[index++] = positions[2];\r\n for (let i = 3; i < positions.length; i += 3) {\r\n const x = positions[i];\r\n const y = positions[i + 1];\r\n const z = positions[i + 2];\r\n wallPositions[index++] = x;\r\n wallPositions[index++] = y;\r\n wallPositions[index++] = z;\r\n wallPositions[index++] = x;\r\n wallPositions[index++] = y;\r\n wallPositions[index++] = z;\r\n }\r\n wallPositions[index++] = positions[0];\r\n wallPositions[index++] = positions[1];\r\n wallPositions[index++] = positions[2];\r\n\r\n return wallPositions;\r\n}\r\n\r\nfunction computePositionsExtruded(params, vertexFormat) {\r\n const topVertexFormat = new VertexFormat({\r\n position: vertexFormat.position,\r\n normal:\r\n vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume,\r\n tangent: vertexFormat.tangent,\r\n bitangent: vertexFormat.normal || vertexFormat.bitangent,\r\n st: vertexFormat.st,\r\n });\r\n const ellipsoid = params.ellipsoid;\r\n const computedPositions = CorridorGeometryLibrary.computePositions(params);\r\n const attr = combine(computedPositions, topVertexFormat, ellipsoid);\r\n const height = params.height;\r\n const extrudedHeight = params.extrudedHeight;\r\n let attributes = attr.attributes;\r\n const indices = attr.indices;\r\n let positions = attributes.position.values;\r\n let length = positions.length;\r\n const newPositions = new Float64Array(length * 6);\r\n let extrudedPositions = new Float64Array(length);\r\n extrudedPositions.set(positions);\r\n let wallPositions = new Float64Array(length * 4);\r\n\r\n positions = PolygonPipeline.scaleToGeodeticHeight(\r\n positions,\r\n height,\r\n ellipsoid\r\n );\r\n wallPositions = addWallPositions(positions, 0, wallPositions);\r\n extrudedPositions = PolygonPipeline.scaleToGeodeticHeight(\r\n extrudedPositions,\r\n extrudedHeight,\r\n ellipsoid\r\n );\r\n wallPositions = addWallPositions(\r\n extrudedPositions,\r\n length * 2,\r\n wallPositions\r\n );\r\n newPositions.set(positions);\r\n newPositions.set(extrudedPositions, length);\r\n newPositions.set(wallPositions, length * 2);\r\n attributes.position.values = newPositions;\r\n\r\n attributes = extrudedAttributes(attributes, vertexFormat);\r\n let i;\r\n const size = length / 3;\r\n if (params.shadowVolume) {\r\n const topNormals = attributes.normal.values;\r\n length = topNormals.length;\r\n\r\n let extrudeNormals = new Float32Array(length * 6);\r\n for (i = 0; i < length; i++) {\r\n topNormals[i] = -topNormals[i];\r\n }\r\n //only get normals for bottom layer that's going to be pushed down\r\n extrudeNormals.set(topNormals, length); //bottom face\r\n extrudeNormals = addWallPositions(topNormals, length * 4, extrudeNormals); //bottom wall\r\n attributes.extrudeDirection = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: extrudeNormals,\r\n });\r\n if (!vertexFormat.normal) {\r\n attributes.normal = undefined;\r\n }\r\n }\r\n if (defined(params.offsetAttribute)) {\r\n let applyOffset = new Uint8Array(size * 6);\r\n if (params.offsetAttribute === GeometryOffsetAttribute.TOP) {\r\n applyOffset = applyOffset\r\n .fill(1, 0, size) // top face\r\n .fill(1, size * 2, size * 4); // top wall\r\n } else {\r\n const applyOffsetValue =\r\n params.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\r\n applyOffset = applyOffset.fill(applyOffsetValue);\r\n }\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n const iLength = indices.length;\r\n const twoSize = size + size;\r\n const newIndices = IndexDatatype.createTypedArray(\r\n newPositions.length / 3,\r\n iLength * 2 + twoSize * 3\r\n );\r\n newIndices.set(indices);\r\n let index = iLength;\r\n for (i = 0; i < iLength; i += 3) {\r\n // bottom indices\r\n const v0 = indices[i];\r\n const v1 = indices[i + 1];\r\n const v2 = indices[i + 2];\r\n newIndices[index++] = v2 + size;\r\n newIndices[index++] = v1 + size;\r\n newIndices[index++] = v0 + size;\r\n }\r\n\r\n let UL, LL, UR, LR;\r\n\r\n for (i = 0; i < twoSize; i += 2) {\r\n //wall indices\r\n UL = i + twoSize;\r\n LL = UL + twoSize;\r\n UR = UL + 1;\r\n LR = LL + 1;\r\n newIndices[index++] = UL;\r\n newIndices[index++] = LL;\r\n newIndices[index++] = UR;\r\n newIndices[index++] = UR;\r\n newIndices[index++] = LL;\r\n newIndices[index++] = LR;\r\n }\r\n\r\n return {\r\n attributes: attributes,\r\n indices: newIndices,\r\n };\r\n}\r\n\r\nconst scratchCartesian1 = new Cartesian3();\r\nconst scratchCartesian2 = new Cartesian3();\r\nconst scratchCartographic = new Cartographic();\r\n\r\nfunction computeOffsetPoints(\r\n position1,\r\n position2,\r\n ellipsoid,\r\n halfWidth,\r\n min,\r\n max\r\n) {\r\n // Compute direction of offset the point\r\n const direction = Cartesian3.subtract(\r\n position2,\r\n position1,\r\n scratchCartesian1\r\n );\r\n Cartesian3.normalize(direction, direction);\r\n const normal = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian2);\r\n const offsetDirection = Cartesian3.cross(\r\n direction,\r\n normal,\r\n scratchCartesian1\r\n );\r\n Cartesian3.multiplyByScalar(offsetDirection, halfWidth, offsetDirection);\r\n\r\n let minLat = min.latitude;\r\n let minLon = min.longitude;\r\n let maxLat = max.latitude;\r\n let maxLon = max.longitude;\r\n\r\n // Compute 2 offset points\r\n Cartesian3.add(position1, offsetDirection, scratchCartesian2);\r\n ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);\r\n\r\n let lat = scratchCartographic.latitude;\r\n let lon = scratchCartographic.longitude;\r\n minLat = Math.min(minLat, lat);\r\n minLon = Math.min(minLon, lon);\r\n maxLat = Math.max(maxLat, lat);\r\n maxLon = Math.max(maxLon, lon);\r\n\r\n Cartesian3.subtract(position1, offsetDirection, scratchCartesian2);\r\n ellipsoid.cartesianToCartographic(scratchCartesian2, scratchCartographic);\r\n\r\n lat = scratchCartographic.latitude;\r\n lon = scratchCartographic.longitude;\r\n minLat = Math.min(minLat, lat);\r\n minLon = Math.min(minLon, lon);\r\n maxLat = Math.max(maxLat, lat);\r\n maxLon = Math.max(maxLon, lon);\r\n\r\n min.latitude = minLat;\r\n min.longitude = minLon;\r\n max.latitude = maxLat;\r\n max.longitude = maxLon;\r\n}\r\n\r\nconst scratchCartesianOffset = new Cartesian3();\r\nconst scratchCartesianEnds = new Cartesian3();\r\nconst scratchCartographicMin = new Cartographic();\r\nconst scratchCartographicMax = new Cartographic();\r\n\r\nfunction computeRectangle(positions, ellipsoid, width, cornerType, result) {\r\n positions = scaleToSurface(positions, ellipsoid);\r\n const cleanPositions = arrayRemoveDuplicates(\r\n positions,\r\n Cartesian3.equalsEpsilon\r\n );\r\n const length = cleanPositions.length;\r\n if (length < 2 || width <= 0) {\r\n return new Rectangle();\r\n }\r\n const halfWidth = width * 0.5;\r\n\r\n scratchCartographicMin.latitude = Number.POSITIVE_INFINITY;\r\n scratchCartographicMin.longitude = Number.POSITIVE_INFINITY;\r\n scratchCartographicMax.latitude = Number.NEGATIVE_INFINITY;\r\n scratchCartographicMax.longitude = Number.NEGATIVE_INFINITY;\r\n\r\n let lat, lon;\r\n if (cornerType === CornerType.ROUNDED) {\r\n // Compute start cap\r\n const first = cleanPositions[0];\r\n Cartesian3.subtract(first, cleanPositions[1], scratchCartesianOffset);\r\n Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);\r\n Cartesian3.multiplyByScalar(\r\n scratchCartesianOffset,\r\n halfWidth,\r\n scratchCartesianOffset\r\n );\r\n Cartesian3.add(first, scratchCartesianOffset, scratchCartesianEnds);\r\n\r\n ellipsoid.cartesianToCartographic(\r\n scratchCartesianEnds,\r\n scratchCartographic\r\n );\r\n lat = scratchCartographic.latitude;\r\n lon = scratchCartographic.longitude;\r\n scratchCartographicMin.latitude = Math.min(\r\n scratchCartographicMin.latitude,\r\n lat\r\n );\r\n scratchCartographicMin.longitude = Math.min(\r\n scratchCartographicMin.longitude,\r\n lon\r\n );\r\n scratchCartographicMax.latitude = Math.max(\r\n scratchCartographicMax.latitude,\r\n lat\r\n );\r\n scratchCartographicMax.longitude = Math.max(\r\n scratchCartographicMax.longitude,\r\n lon\r\n );\r\n }\r\n\r\n // Compute the rest\r\n for (let i = 0; i < length - 1; ++i) {\r\n computeOffsetPoints(\r\n cleanPositions[i],\r\n cleanPositions[i + 1],\r\n ellipsoid,\r\n halfWidth,\r\n scratchCartographicMin,\r\n scratchCartographicMax\r\n );\r\n }\r\n\r\n // Compute ending point\r\n const last = cleanPositions[length - 1];\r\n Cartesian3.subtract(last, cleanPositions[length - 2], scratchCartesianOffset);\r\n Cartesian3.normalize(scratchCartesianOffset, scratchCartesianOffset);\r\n Cartesian3.multiplyByScalar(\r\n scratchCartesianOffset,\r\n halfWidth,\r\n scratchCartesianOffset\r\n );\r\n Cartesian3.add(last, scratchCartesianOffset, scratchCartesianEnds);\r\n computeOffsetPoints(\r\n last,\r\n scratchCartesianEnds,\r\n ellipsoid,\r\n halfWidth,\r\n scratchCartographicMin,\r\n scratchCartographicMax\r\n );\r\n\r\n if (cornerType === CornerType.ROUNDED) {\r\n // Compute end cap\r\n ellipsoid.cartesianToCartographic(\r\n scratchCartesianEnds,\r\n scratchCartographic\r\n );\r\n lat = scratchCartographic.latitude;\r\n lon = scratchCartographic.longitude;\r\n scratchCartographicMin.latitude = Math.min(\r\n scratchCartographicMin.latitude,\r\n lat\r\n );\r\n scratchCartographicMin.longitude = Math.min(\r\n scratchCartographicMin.longitude,\r\n lon\r\n );\r\n scratchCartographicMax.latitude = Math.max(\r\n scratchCartographicMax.latitude,\r\n lat\r\n );\r\n scratchCartographicMax.longitude = Math.max(\r\n scratchCartographicMax.longitude,\r\n lon\r\n );\r\n }\r\n\r\n const rectangle = defined(result) ? result : new Rectangle();\r\n rectangle.north = scratchCartographicMax.latitude;\r\n rectangle.south = scratchCartographicMin.latitude;\r\n rectangle.east = scratchCartographicMax.longitude;\r\n rectangle.west = scratchCartographicMin.longitude;\r\n\r\n return rectangle;\r\n}\r\n\r\n/**\r\n * A description of a corridor. Corridor geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\r\n *\r\n * @alias CorridorGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.\r\n * @param {Number} options.width The distance between the edges of the corridor in meters.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Number} [options.height=0] The distance in meters between the ellipsoid surface and the positions.\r\n * @param {Number} [options.extrudedHeight] The distance in meters between the ellipsoid surface and the extruded face.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\r\n *\r\n * @see CorridorGeometry.createGeometry\r\n * @see Packable\r\n *\r\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Corridor.html|Cesium Sandcastle Corridor Demo}\r\n *\r\n * @example\r\n * const corridor = new Cesium.CorridorGeometry({\r\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\r\n * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),\r\n * width : 100000\r\n * });\r\n */\r\nfunction CorridorGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const positions = options.positions;\r\n const width = options.width;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"options.positions\", positions);\r\n Check.defined(\"options.width\", width);\r\n //>>includeEnd('debug');\r\n\r\n const height = defaultValue(options.height, 0.0);\r\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\r\n\r\n this._positions = positions;\r\n this._ellipsoid = Ellipsoid.clone(\r\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\r\n );\r\n this._vertexFormat = VertexFormat.clone(\r\n defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\r\n );\r\n this._width = width;\r\n this._height = Math.max(height, extrudedHeight);\r\n this._extrudedHeight = Math.min(height, extrudedHeight);\r\n this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\r\n this._granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n this._shadowVolume = defaultValue(options.shadowVolume, false);\r\n this._workerName = \"createCorridorGeometry\";\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._rectangle = undefined;\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n 1 +\r\n positions.length * Cartesian3.packedLength +\r\n Ellipsoid.packedLength +\r\n VertexFormat.packedLength +\r\n 7;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {CorridorGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCorridorGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const positions = value._positions;\r\n const length = positions.length;\r\n array[startingIndex++] = length;\r\n\r\n for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n Cartesian3.pack(positions[i], array, startingIndex);\r\n }\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n array[startingIndex++] = value._width;\r\n array[startingIndex++] = value._height;\r\n array[startingIndex++] = value._extrudedHeight;\r\n array[startingIndex++] = value._cornerType;\r\n array[startingIndex++] = value._granularity;\r\n array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\r\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchVertexFormat = new VertexFormat();\r\nconst scratchOptions = {\r\n positions: undefined,\r\n ellipsoid: scratchEllipsoid,\r\n vertexFormat: scratchVertexFormat,\r\n width: undefined,\r\n height: undefined,\r\n extrudedHeight: undefined,\r\n cornerType: undefined,\r\n granularity: undefined,\r\n shadowVolume: undefined,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {CorridorGeometry} [result] The object into which to store the result.\r\n * @returns {CorridorGeometry} The modified result parameter or a new CorridorGeometry instance if one was not provided.\r\n */\r\nCorridorGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const length = array[startingIndex++];\r\n const positions = new Array(length);\r\n\r\n for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n positions[i] = Cartesian3.unpack(array, startingIndex);\r\n }\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n const width = array[startingIndex++];\r\n const height = array[startingIndex++];\r\n const extrudedHeight = array[startingIndex++];\r\n const cornerType = array[startingIndex++];\r\n const granularity = array[startingIndex++];\r\n const shadowVolume = array[startingIndex++] === 1.0;\r\n const offsetAttribute = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.positions = positions;\r\n scratchOptions.width = width;\r\n scratchOptions.height = height;\r\n scratchOptions.extrudedHeight = extrudedHeight;\r\n scratchOptions.cornerType = cornerType;\r\n scratchOptions.granularity = granularity;\r\n scratchOptions.shadowVolume = shadowVolume;\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return new CorridorGeometry(scratchOptions);\r\n }\r\n\r\n result._positions = positions;\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._width = width;\r\n result._height = height;\r\n result._extrudedHeight = extrudedHeight;\r\n result._cornerType = cornerType;\r\n result._granularity = granularity;\r\n result._shadowVolume = shadowVolume;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the bounding rectangle given the provided options\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor.\r\n * @param {Number} options.width The distance between the edges of the corridor in meters.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\r\n * @param {Rectangle} [result] An object in which to store the result.\r\n *\r\n * @returns {Rectangle} The result rectangle.\r\n */\r\nCorridorGeometry.computeRectangle = function (options, result) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const positions = options.positions;\r\n const width = options.width;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"options.positions\", positions);\r\n Check.defined(\"options.width\", width);\r\n //>>includeEnd('debug');\r\n\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n const cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\r\n\r\n return computeRectangle(positions, ellipsoid, width, cornerType, result);\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {CorridorGeometry} corridorGeometry A description of the corridor.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nCorridorGeometry.createGeometry = function (corridorGeometry) {\r\n let positions = corridorGeometry._positions;\r\n const width = corridorGeometry._width;\r\n const ellipsoid = corridorGeometry._ellipsoid;\r\n\r\n positions = scaleToSurface(positions, ellipsoid);\r\n const cleanPositions = arrayRemoveDuplicates(\r\n positions,\r\n Cartesian3.equalsEpsilon\r\n );\r\n\r\n if (cleanPositions.length < 2 || width <= 0) {\r\n return;\r\n }\r\n\r\n const height = corridorGeometry._height;\r\n const extrudedHeight = corridorGeometry._extrudedHeight;\r\n const extrude = !CesiumMath.equalsEpsilon(\r\n height,\r\n extrudedHeight,\r\n 0,\r\n CesiumMath.EPSILON2\r\n );\r\n\r\n const vertexFormat = corridorGeometry._vertexFormat;\r\n const params = {\r\n ellipsoid: ellipsoid,\r\n positions: cleanPositions,\r\n width: width,\r\n cornerType: corridorGeometry._cornerType,\r\n granularity: corridorGeometry._granularity,\r\n saveAttributes: true,\r\n };\r\n let attr;\r\n if (extrude) {\r\n params.height = height;\r\n params.extrudedHeight = extrudedHeight;\r\n params.shadowVolume = corridorGeometry._shadowVolume;\r\n params.offsetAttribute = corridorGeometry._offsetAttribute;\r\n attr = computePositionsExtruded(params, vertexFormat);\r\n } else {\r\n const computedPositions = CorridorGeometryLibrary.computePositions(params);\r\n attr = combine(computedPositions, vertexFormat, ellipsoid);\r\n attr.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\r\n attr.attributes.position.values,\r\n height,\r\n ellipsoid\r\n );\r\n\r\n if (defined(corridorGeometry._offsetAttribute)) {\r\n const applyOffsetValue =\r\n corridorGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const length = attr.attributes.position.values.length;\r\n const applyOffset = new Uint8Array(length / 3).fill(applyOffsetValue);\r\n attr.attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n }\r\n const attributes = attr.attributes;\r\n const boundingSphere = BoundingSphere.fromVertices(\r\n attributes.position.values,\r\n undefined,\r\n 3\r\n );\r\n if (!vertexFormat.position) {\r\n attr.attributes.position.values = undefined;\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: attr.indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n boundingSphere: boundingSphere,\r\n offsetAttribute: corridorGeometry._offsetAttribute,\r\n });\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nCorridorGeometry.createShadowVolume = function (\r\n corridorGeometry,\r\n minHeightFunc,\r\n maxHeightFunc\r\n) {\r\n const granularity = corridorGeometry._granularity;\r\n const ellipsoid = corridorGeometry._ellipsoid;\r\n\r\n const minHeight = minHeightFunc(granularity, ellipsoid);\r\n const maxHeight = maxHeightFunc(granularity, ellipsoid);\r\n\r\n return new CorridorGeometry({\r\n positions: corridorGeometry._positions,\r\n width: corridorGeometry._width,\r\n cornerType: corridorGeometry._cornerType,\r\n ellipsoid: ellipsoid,\r\n granularity: granularity,\r\n extrudedHeight: minHeight,\r\n height: maxHeight,\r\n vertexFormat: VertexFormat.POSITION_ONLY,\r\n shadowVolume: true,\r\n });\r\n};\r\n\r\nObject.defineProperties(CorridorGeometry.prototype, {\r\n /**\r\n * @private\r\n */\r\n rectangle: {\r\n get: function () {\r\n if (!defined(this._rectangle)) {\r\n this._rectangle = computeRectangle(\r\n this._positions,\r\n this._ellipsoid,\r\n this._width,\r\n this._cornerType\r\n );\r\n }\r\n return this._rectangle;\r\n },\r\n },\r\n /**\r\n * For remapping texture coordinates when rendering CorridorGeometries as GroundPrimitives.\r\n *\r\n * Corridors don't support stRotation,\r\n * so just return the corners of the original system.\r\n * @private\r\n */\r\n textureCoordinateRotationPoints: {\r\n get: function () {\r\n return [0, 0, 0, 1, 1, 0];\r\n },\r\n },\r\n});\r\nexport default CorridorGeometry;\r\n","import CorridorGeometry from \"../Core/CorridorGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\n\r\nfunction createCorridorGeometry(corridorGeometry, offset) {\r\n if (defined(offset)) {\r\n corridorGeometry = CorridorGeometry.unpack(corridorGeometry, offset);\r\n }\r\n corridorGeometry._ellipsoid = Ellipsoid.clone(corridorGeometry._ellipsoid);\r\n return CorridorGeometry.createGeometry(corridorGeometry);\r\n}\r\nexport default createCorridorGeometry;\r\n"],"names":["Cartesian3","CorridorGeometryLibrary","GeometryAttributes","defined","IndexDatatype","GeometryAttribute","ComponentDatatype","CesiumMath","VertexFormat","PolygonPipeline","GeometryOffsetAttribute","Cartographic","arrayRemoveDuplicates","Rectangle","CornerType","defaultValue","Check","Ellipsoid","BoundingSphere","Geometry","PrimitiveType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBA,MAAM,UAAU,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACpC,MAAM,UAAU,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACpC,MAAM,UAAU,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACpC,MAAM,UAAU,GAAG,IAAIA,k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,GAAG,gBAAgB;EAC1C,UAAU,IAAI,CAAC,UAAU;EACzB,UAAU,IAAI,CAAC,UAAU;EACzB,UAAU,IAAI,CAAC,MAAM;EACrB,UAAU,IAAI,CAAC,WAAW;EAC1B,SAAS,CAAC;EACV,OAAO;EACP,MAAM,OAAO,IAAI,CAAC,UAAU,CAAC;EAC7B,KAAK;EACL,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,+BAA+B,EAAE;EACnC,IAAI,GAAG,EAAE,YAAY;EACrB,MAAM,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;EAChC,KAAK;EACL,GAAG;EACH,CAAC,CAAC;;ECl4CF,SAAS,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,EAAE;EAC1D,EAAE,IAAIA,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;EACzE,GAAG;EACH,EAAE,gBAAgB,CAAC,UAAU,GAAGc,iBAAS,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;EAC7E,EAAE,OAAO,gBAAgB,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;EAC3D;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createCorridorOutlineGeometry.js b/examples/cesium/Workers/createCorridorOutlineGeometry.js
new file mode 100644
index 0000000..b6fecf5
--- /dev/null
+++ b/examples/cesium/Workers/createCorridorOutlineGeometry.js
@@ -0,0 +1,629 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./arrayRemoveDuplicates-c3526030', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './PolylineVolumeGeometryLibrary-eed2bdf7', './CorridorGeometryLibrary-152d0356', './defaultValue-0ab18f7d', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolygonPipeline-313487c3', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29', './EllipsoidTangentPlane-c421b2cb', './AxisAlignedBoundingBox-50342d27', './IntersectionTests-2c7928de', './Plane-c9f1487d', './PolylinePipeline-3c021236', './EllipsoidGeodesic-38d0ed4a', './EllipsoidRhumbLine-48b4507b'], (function (arrayRemoveDuplicates, Transforms, Matrix3, Check, ComponentDatatype, PolylineVolumeGeometryLibrary, CorridorGeometryLibrary, defaultValue, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1, PolygonPipeline, Matrix2, RuntimeError, combine$1, WebGLConstants, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane, PolylinePipeline, EllipsoidGeodesic, EllipsoidRhumbLine) { 'use strict';
+
+ const cartesian1 = new Matrix3.Cartesian3();
+ const cartesian2 = new Matrix3.Cartesian3();
+ const cartesian3 = new Matrix3.Cartesian3();
+
+ function scaleToSurface(positions, ellipsoid) {
+ for (let i = 0; i < positions.length; i++) {
+ positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
+ }
+ return positions;
+ }
+
+ function combine(computedPositions, cornerType) {
+ const wallIndices = [];
+ const positions = computedPositions.positions;
+ const corners = computedPositions.corners;
+ const endPositions = computedPositions.endPositions;
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ let corner;
+ let leftCount = 0;
+ let rightCount = 0;
+ let i;
+ let indicesLength = 0;
+ let length;
+ for (i = 0; i < positions.length; i += 2) {
+ length = positions[i].length - 3;
+ leftCount += length; //subtracting 3 to account for duplicate points at corners
+ indicesLength += (length / 3) * 4;
+ rightCount += positions[i + 1].length - 3;
+ }
+ leftCount += 3; //add back count for end positions
+ rightCount += 3;
+ for (i = 0; i < corners.length; i++) {
+ corner = corners[i];
+ const leftSide = corners[i].leftPositions;
+ if (defaultValue.defined(leftSide)) {
+ length = leftSide.length;
+ leftCount += length;
+ indicesLength += (length / 3) * 2;
+ } else {
+ length = corners[i].rightPositions.length;
+ rightCount += length;
+ indicesLength += (length / 3) * 2;
+ }
+ }
+
+ const addEndPositions = defaultValue.defined(endPositions);
+ let endPositionLength;
+ if (addEndPositions) {
+ endPositionLength = endPositions[0].length - 3;
+ leftCount += endPositionLength;
+ rightCount += endPositionLength;
+ endPositionLength /= 3;
+ indicesLength += endPositionLength * 4;
+ }
+ const size = leftCount + rightCount;
+ const finalPositions = new Float64Array(size);
+ let front = 0;
+ let back = size - 1;
+ let UL, LL, UR, LR;
+ let rightPos, leftPos;
+ const halfLength = endPositionLength / 2;
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(size / 3, indicesLength + 4);
+ let index = 0;
+
+ indices[index++] = front / 3;
+ indices[index++] = (back - 2) / 3;
+ if (addEndPositions) {
+ // add rounded end
+ wallIndices.push(front / 3);
+ leftPos = cartesian1;
+ rightPos = cartesian2;
+ const firstEndPositions = endPositions[0];
+ for (i = 0; i < halfLength; i++) {
+ leftPos = Matrix3.Cartesian3.fromArray(
+ firstEndPositions,
+ (halfLength - 1 - i) * 3,
+ leftPos
+ );
+ rightPos = Matrix3.Cartesian3.fromArray(
+ firstEndPositions,
+ (halfLength + i) * 3,
+ rightPos
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ finalPositions,
+ leftPos,
+ undefined,
+ back
+ );
+
+ LL = front / 3;
+ LR = LL + 1;
+ UL = (back - 2) / 3;
+ UR = UL - 1;
+ indices[index++] = UL;
+ indices[index++] = UR;
+ indices[index++] = LL;
+ indices[index++] = LR;
+
+ front += 3;
+ back -= 3;
+ }
+ }
+
+ let posIndex = 0;
+ let rightEdge = positions[posIndex++]; //add first two edges
+ let leftEdge = positions[posIndex++];
+ finalPositions.set(rightEdge, front);
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
+
+ length = leftEdge.length - 3;
+ wallIndices.push(front / 3, (back - 2) / 3);
+ for (i = 0; i < length; i += 3) {
+ LL = front / 3;
+ LR = LL + 1;
+ UL = (back - 2) / 3;
+ UR = UL - 1;
+ indices[index++] = UL;
+ indices[index++] = UR;
+ indices[index++] = LL;
+ indices[index++] = LR;
+
+ front += 3;
+ back -= 3;
+ }
+
+ for (i = 0; i < corners.length; i++) {
+ let j;
+ corner = corners[i];
+ const l = corner.leftPositions;
+ const r = corner.rightPositions;
+ let start;
+ let outsidePoint = cartesian3;
+ if (defaultValue.defined(l)) {
+ back -= 3;
+ start = UR;
+ wallIndices.push(LR);
+ for (j = 0; j < l.length / 3; j++) {
+ outsidePoint = Matrix3.Cartesian3.fromArray(l, j * 3, outsidePoint);
+ indices[index++] = start - j - 1;
+ indices[index++] = start - j;
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ finalPositions,
+ outsidePoint,
+ undefined,
+ back
+ );
+ back -= 3;
+ }
+ wallIndices.push(start - Math.floor(l.length / 6));
+ if (cornerType === PolylineVolumeGeometryLibrary.CornerType.BEVELED) {
+ wallIndices.push((back - 2) / 3 + 1);
+ }
+ front += 3;
+ } else {
+ front += 3;
+ start = LR;
+ wallIndices.push(UR);
+ for (j = 0; j < r.length / 3; j++) {
+ outsidePoint = Matrix3.Cartesian3.fromArray(r, j * 3, outsidePoint);
+ indices[index++] = start + j;
+ indices[index++] = start + j + 1;
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ finalPositions,
+ outsidePoint,
+ front
+ );
+ front += 3;
+ }
+ wallIndices.push(start + Math.floor(r.length / 6));
+ if (cornerType === PolylineVolumeGeometryLibrary.CornerType.BEVELED) {
+ wallIndices.push(front / 3 - 1);
+ }
+ back -= 3;
+ }
+ rightEdge = positions[posIndex++];
+ leftEdge = positions[posIndex++];
+ rightEdge.splice(0, 3); //remove duplicate points added by corner
+ leftEdge.splice(leftEdge.length - 3, 3);
+ finalPositions.set(rightEdge, front);
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
+ length = leftEdge.length - 3;
+
+ for (j = 0; j < leftEdge.length; j += 3) {
+ LR = front / 3;
+ LL = LR - 1;
+ UR = (back - 2) / 3;
+ UL = UR + 1;
+ indices[index++] = UL;
+ indices[index++] = UR;
+ indices[index++] = LL;
+ indices[index++] = LR;
+ front += 3;
+ back -= 3;
+ }
+ front -= 3;
+ back += 3;
+ wallIndices.push(front / 3, (back - 2) / 3);
+ }
+
+ if (addEndPositions) {
+ // add rounded end
+ front += 3;
+ back -= 3;
+ leftPos = cartesian1;
+ rightPos = cartesian2;
+ const lastEndPositions = endPositions[1];
+ for (i = 0; i < halfLength; i++) {
+ leftPos = Matrix3.Cartesian3.fromArray(
+ lastEndPositions,
+ (endPositionLength - i - 1) * 3,
+ leftPos
+ );
+ rightPos = Matrix3.Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(
+ finalPositions,
+ leftPos,
+ undefined,
+ back
+ );
+ CorridorGeometryLibrary.CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);
+
+ LR = front / 3;
+ LL = LR - 1;
+ UR = (back - 2) / 3;
+ UL = UR + 1;
+ indices[index++] = UL;
+ indices[index++] = UR;
+ indices[index++] = LL;
+ indices[index++] = LR;
+
+ front += 3;
+ back -= 3;
+ }
+
+ wallIndices.push(front / 3);
+ } else {
+ wallIndices.push(front / 3, (back - 2) / 3);
+ }
+ indices[index++] = front / 3;
+ indices[index++] = (back - 2) / 3;
+
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: finalPositions,
+ });
+
+ return {
+ attributes: attributes,
+ indices: indices,
+ wallIndices: wallIndices,
+ };
+ }
+
+ function computePositionsExtruded(params) {
+ const ellipsoid = params.ellipsoid;
+ const computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
+ const attr = combine(computedPositions, params.cornerType);
+ const wallIndices = attr.wallIndices;
+ const height = params.height;
+ const extrudedHeight = params.extrudedHeight;
+ const attributes = attr.attributes;
+ const indices = attr.indices;
+ let positions = attributes.position.values;
+ let length = positions.length;
+ let extrudedPositions = new Float64Array(length);
+ extrudedPositions.set(positions);
+ const newPositions = new Float64Array(length * 2);
+
+ positions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ positions,
+ height,
+ ellipsoid
+ );
+ extrudedPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ extrudedPositions,
+ extrudedHeight,
+ ellipsoid
+ );
+ newPositions.set(positions);
+ newPositions.set(extrudedPositions, length);
+ attributes.position.values = newPositions;
+
+ length /= 3;
+ if (defaultValue.defined(params.offsetAttribute)) {
+ let applyOffset = new Uint8Array(length * 2);
+ if (params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
+ applyOffset = applyOffset.fill(1, 0, length);
+ } else {
+ const applyOffsetValue =
+ params.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
+ applyOffset = applyOffset.fill(applyOffsetValue);
+ }
+
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ let i;
+ const iLength = indices.length;
+ const newIndices = IndexDatatype.IndexDatatype.createTypedArray(
+ newPositions.length / 3,
+ (iLength + wallIndices.length) * 2
+ );
+ newIndices.set(indices);
+ let index = iLength;
+ for (i = 0; i < iLength; i += 2) {
+ // bottom indices
+ const v0 = indices[i];
+ const v1 = indices[i + 1];
+ newIndices[index++] = v0 + length;
+ newIndices[index++] = v1 + length;
+ }
+
+ let UL, LL;
+ for (i = 0; i < wallIndices.length; i++) {
+ //wall indices
+ UL = wallIndices[i];
+ LL = UL + length;
+ newIndices[index++] = UL;
+ newIndices[index++] = LL;
+ }
+
+ return {
+ attributes: attributes,
+ indices: newIndices,
+ };
+ }
+
+ /**
+ * A description of a corridor outline.
+ *
+ * @alias CorridorOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor outline.
+ * @param {Number} options.width The distance between the edges of the corridor outline.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Number} [options.height=0] The distance in meters between the positions and the ellipsoid surface.
+ * @param {Number} [options.extrudedHeight] The distance in meters between the extruded face and the ellipsoid surface.
+ * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
+ *
+ * @see CorridorOutlineGeometry.createGeometry
+ *
+ * @example
+ * const corridor = new Cesium.CorridorOutlineGeometry({
+ * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),
+ * width : 100000
+ * });
+ */
+ function CorridorOutlineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const positions = options.positions;
+ const width = options.width;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("options.positions", positions);
+ Check.Check.typeOf.number("options.width", width);
+ //>>includeEnd('debug');
+
+ const height = defaultValue.defaultValue(options.height, 0.0);
+ const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
+
+ this._positions = positions;
+ this._ellipsoid = Matrix3.Ellipsoid.clone(
+ defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
+ );
+ this._width = width;
+ this._height = Math.max(height, extrudedHeight);
+ this._extrudedHeight = Math.min(height, extrudedHeight);
+ this._cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
+ this._granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createCorridorOutlineGeometry";
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ 1 + positions.length * Matrix3.Cartesian3.packedLength + Matrix3.Ellipsoid.packedLength + 6;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {CorridorOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ CorridorOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.typeOf.object("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const positions = value._positions;
+ const length = positions.length;
+ array[startingIndex++] = length;
+
+ for (let i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
+ }
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ array[startingIndex++] = value._width;
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._cornerType;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchOptions = {
+ positions: undefined,
+ ellipsoid: scratchEllipsoid,
+ width: undefined,
+ height: undefined,
+ extrudedHeight: undefined,
+ cornerType: undefined,
+ granularity: undefined,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {CorridorOutlineGeometry} [result] The object into which to store the result.
+ * @returns {CorridorOutlineGeometry} The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.
+ */
+ CorridorOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const length = array[startingIndex++];
+ const positions = new Array(length);
+
+ for (let i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
+ }
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const width = array[startingIndex++];
+ const height = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const cornerType = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.positions = positions;
+ scratchOptions.width = width;
+ scratchOptions.height = height;
+ scratchOptions.extrudedHeight = extrudedHeight;
+ scratchOptions.cornerType = cornerType;
+ scratchOptions.granularity = granularity;
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+ return new CorridorOutlineGeometry(scratchOptions);
+ }
+
+ result._positions = positions;
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._width = width;
+ result._height = height;
+ result._extrudedHeight = extrudedHeight;
+ result._cornerType = cornerType;
+ result._granularity = granularity;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {CorridorOutlineGeometry} corridorOutlineGeometry A description of the corridor.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ CorridorOutlineGeometry.createGeometry = function (corridorOutlineGeometry) {
+ let positions = corridorOutlineGeometry._positions;
+ const width = corridorOutlineGeometry._width;
+ const ellipsoid = corridorOutlineGeometry._ellipsoid;
+
+ positions = scaleToSurface(positions, ellipsoid);
+ const cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ positions,
+ Matrix3.Cartesian3.equalsEpsilon
+ );
+
+ if (cleanPositions.length < 2 || width <= 0) {
+ return;
+ }
+
+ const height = corridorOutlineGeometry._height;
+ const extrudedHeight = corridorOutlineGeometry._extrudedHeight;
+ const extrude = !Math$1.CesiumMath.equalsEpsilon(
+ height,
+ extrudedHeight,
+ 0,
+ Math$1.CesiumMath.EPSILON2
+ );
+
+ const params = {
+ ellipsoid: ellipsoid,
+ positions: cleanPositions,
+ width: width,
+ cornerType: corridorOutlineGeometry._cornerType,
+ granularity: corridorOutlineGeometry._granularity,
+ saveAttributes: false,
+ };
+ let attr;
+ if (extrude) {
+ params.height = height;
+ params.extrudedHeight = extrudedHeight;
+ params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;
+ attr = computePositionsExtruded(params);
+ } else {
+ const computedPositions = CorridorGeometryLibrary.CorridorGeometryLibrary.computePositions(params);
+ attr = combine(computedPositions, params.cornerType);
+ attr.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ attr.attributes.position.values,
+ height,
+ ellipsoid
+ );
+
+ if (defaultValue.defined(corridorOutlineGeometry._offsetAttribute)) {
+ const length = attr.attributes.position.values.length;
+ const offsetValue =
+ corridorOutlineGeometry._offsetAttribute ===
+ GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ attr.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+ }
+ const attributes = attr.attributes;
+ const boundingSphere = Transforms.BoundingSphere.fromVertices(
+ attributes.position.values,
+ undefined,
+ 3
+ );
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: attr.indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: boundingSphere,
+ offsetAttribute: corridorOutlineGeometry._offsetAttribute,
+ });
+ };
+
+ function createCorridorOutlineGeometry(corridorOutlineGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ corridorOutlineGeometry = CorridorOutlineGeometry.unpack(
+ corridorOutlineGeometry,
+ offset
+ );
+ }
+ corridorOutlineGeometry._ellipsoid = Matrix3.Ellipsoid.clone(
+ corridorOutlineGeometry._ellipsoid
+ );
+ return CorridorOutlineGeometry.createGeometry(corridorOutlineGeometry);
+ }
+
+ return createCorridorOutlineGeometry;
+
+}));
+//# sourceMappingURL=createCorridorOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createCorridorOutlineGeometry.js.map b/examples/cesium/Workers/createCorridorOutlineGeometry.js.map
new file mode 100644
index 0000000..5456931
--- /dev/null
+++ b/examples/cesium/Workers/createCorridorOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createCorridorOutlineGeometry.js","sources":["../../../Source/Core/CorridorOutlineGeometry.js","../../../Source/WorkersES6/createCorridorOutlineGeometry.js"],"sourcesContent":["import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport CornerType from \"./CornerType.js\";\r\nimport CorridorGeometryLibrary from \"./CorridorGeometryLibrary.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PolygonPipeline from \"./PolygonPipeline.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\n\r\nconst cartesian1 = new Cartesian3();\r\nconst cartesian2 = new Cartesian3();\r\nconst cartesian3 = new Cartesian3();\r\n\r\nfunction scaleToSurface(positions, ellipsoid) {\r\n for (let i = 0; i < positions.length; i++) {\r\n positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);\r\n }\r\n return positions;\r\n}\r\n\r\nfunction combine(computedPositions, cornerType) {\r\n const wallIndices = [];\r\n const positions = computedPositions.positions;\r\n const corners = computedPositions.corners;\r\n const endPositions = computedPositions.endPositions;\r\n const attributes = new GeometryAttributes();\r\n let corner;\r\n let leftCount = 0;\r\n let rightCount = 0;\r\n let i;\r\n let indicesLength = 0;\r\n let length;\r\n for (i = 0; i < positions.length; i += 2) {\r\n length = positions[i].length - 3;\r\n leftCount += length; //subtracting 3 to account for duplicate points at corners\r\n indicesLength += (length / 3) * 4;\r\n rightCount += positions[i + 1].length - 3;\r\n }\r\n leftCount += 3; //add back count for end positions\r\n rightCount += 3;\r\n for (i = 0; i < corners.length; i++) {\r\n corner = corners[i];\r\n const leftSide = corners[i].leftPositions;\r\n if (defined(leftSide)) {\r\n length = leftSide.length;\r\n leftCount += length;\r\n indicesLength += (length / 3) * 2;\r\n } else {\r\n length = corners[i].rightPositions.length;\r\n rightCount += length;\r\n indicesLength += (length / 3) * 2;\r\n }\r\n }\r\n\r\n const addEndPositions = defined(endPositions);\r\n let endPositionLength;\r\n if (addEndPositions) {\r\n endPositionLength = endPositions[0].length - 3;\r\n leftCount += endPositionLength;\r\n rightCount += endPositionLength;\r\n endPositionLength /= 3;\r\n indicesLength += endPositionLength * 4;\r\n }\r\n const size = leftCount + rightCount;\r\n const finalPositions = new Float64Array(size);\r\n let front = 0;\r\n let back = size - 1;\r\n let UL, LL, UR, LR;\r\n let rightPos, leftPos;\r\n const halfLength = endPositionLength / 2;\r\n\r\n const indices = IndexDatatype.createTypedArray(size / 3, indicesLength + 4);\r\n let index = 0;\r\n\r\n indices[index++] = front / 3;\r\n indices[index++] = (back - 2) / 3;\r\n if (addEndPositions) {\r\n // add rounded end\r\n wallIndices.push(front / 3);\r\n leftPos = cartesian1;\r\n rightPos = cartesian2;\r\n const firstEndPositions = endPositions[0];\r\n for (i = 0; i < halfLength; i++) {\r\n leftPos = Cartesian3.fromArray(\r\n firstEndPositions,\r\n (halfLength - 1 - i) * 3,\r\n leftPos\r\n );\r\n rightPos = Cartesian3.fromArray(\r\n firstEndPositions,\r\n (halfLength + i) * 3,\r\n rightPos\r\n );\r\n CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\r\n CorridorGeometryLibrary.addAttribute(\r\n finalPositions,\r\n leftPos,\r\n undefined,\r\n back\r\n );\r\n\r\n LL = front / 3;\r\n LR = LL + 1;\r\n UL = (back - 2) / 3;\r\n UR = UL - 1;\r\n indices[index++] = UL;\r\n indices[index++] = UR;\r\n indices[index++] = LL;\r\n indices[index++] = LR;\r\n\r\n front += 3;\r\n back -= 3;\r\n }\r\n }\r\n\r\n let posIndex = 0;\r\n let rightEdge = positions[posIndex++]; //add first two edges\r\n let leftEdge = positions[posIndex++];\r\n finalPositions.set(rightEdge, front);\r\n finalPositions.set(leftEdge, back - leftEdge.length + 1);\r\n\r\n length = leftEdge.length - 3;\r\n wallIndices.push(front / 3, (back - 2) / 3);\r\n for (i = 0; i < length; i += 3) {\r\n LL = front / 3;\r\n LR = LL + 1;\r\n UL = (back - 2) / 3;\r\n UR = UL - 1;\r\n indices[index++] = UL;\r\n indices[index++] = UR;\r\n indices[index++] = LL;\r\n indices[index++] = LR;\r\n\r\n front += 3;\r\n back -= 3;\r\n }\r\n\r\n for (i = 0; i < corners.length; i++) {\r\n let j;\r\n corner = corners[i];\r\n const l = corner.leftPositions;\r\n const r = corner.rightPositions;\r\n let start;\r\n let outsidePoint = cartesian3;\r\n if (defined(l)) {\r\n back -= 3;\r\n start = UR;\r\n wallIndices.push(LR);\r\n for (j = 0; j < l.length / 3; j++) {\r\n outsidePoint = Cartesian3.fromArray(l, j * 3, outsidePoint);\r\n indices[index++] = start - j - 1;\r\n indices[index++] = start - j;\r\n CorridorGeometryLibrary.addAttribute(\r\n finalPositions,\r\n outsidePoint,\r\n undefined,\r\n back\r\n );\r\n back -= 3;\r\n }\r\n wallIndices.push(start - Math.floor(l.length / 6));\r\n if (cornerType === CornerType.BEVELED) {\r\n wallIndices.push((back - 2) / 3 + 1);\r\n }\r\n front += 3;\r\n } else {\r\n front += 3;\r\n start = LR;\r\n wallIndices.push(UR);\r\n for (j = 0; j < r.length / 3; j++) {\r\n outsidePoint = Cartesian3.fromArray(r, j * 3, outsidePoint);\r\n indices[index++] = start + j;\r\n indices[index++] = start + j + 1;\r\n CorridorGeometryLibrary.addAttribute(\r\n finalPositions,\r\n outsidePoint,\r\n front\r\n );\r\n front += 3;\r\n }\r\n wallIndices.push(start + Math.floor(r.length / 6));\r\n if (cornerType === CornerType.BEVELED) {\r\n wallIndices.push(front / 3 - 1);\r\n }\r\n back -= 3;\r\n }\r\n rightEdge = positions[posIndex++];\r\n leftEdge = positions[posIndex++];\r\n rightEdge.splice(0, 3); //remove duplicate points added by corner\r\n leftEdge.splice(leftEdge.length - 3, 3);\r\n finalPositions.set(rightEdge, front);\r\n finalPositions.set(leftEdge, back - leftEdge.length + 1);\r\n length = leftEdge.length - 3;\r\n\r\n for (j = 0; j < leftEdge.length; j += 3) {\r\n LR = front / 3;\r\n LL = LR - 1;\r\n UR = (back - 2) / 3;\r\n UL = UR + 1;\r\n indices[index++] = UL;\r\n indices[index++] = UR;\r\n indices[index++] = LL;\r\n indices[index++] = LR;\r\n front += 3;\r\n back -= 3;\r\n }\r\n front -= 3;\r\n back += 3;\r\n wallIndices.push(front / 3, (back - 2) / 3);\r\n }\r\n\r\n if (addEndPositions) {\r\n // add rounded end\r\n front += 3;\r\n back -= 3;\r\n leftPos = cartesian1;\r\n rightPos = cartesian2;\r\n const lastEndPositions = endPositions[1];\r\n for (i = 0; i < halfLength; i++) {\r\n leftPos = Cartesian3.fromArray(\r\n lastEndPositions,\r\n (endPositionLength - i - 1) * 3,\r\n leftPos\r\n );\r\n rightPos = Cartesian3.fromArray(lastEndPositions, i * 3, rightPos);\r\n CorridorGeometryLibrary.addAttribute(\r\n finalPositions,\r\n leftPos,\r\n undefined,\r\n back\r\n );\r\n CorridorGeometryLibrary.addAttribute(finalPositions, rightPos, front);\r\n\r\n LR = front / 3;\r\n LL = LR - 1;\r\n UR = (back - 2) / 3;\r\n UL = UR + 1;\r\n indices[index++] = UL;\r\n indices[index++] = UR;\r\n indices[index++] = LL;\r\n indices[index++] = LR;\r\n\r\n front += 3;\r\n back -= 3;\r\n }\r\n\r\n wallIndices.push(front / 3);\r\n } else {\r\n wallIndices.push(front / 3, (back - 2) / 3);\r\n }\r\n indices[index++] = front / 3;\r\n indices[index++] = (back - 2) / 3;\r\n\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: finalPositions,\r\n });\r\n\r\n return {\r\n attributes: attributes,\r\n indices: indices,\r\n wallIndices: wallIndices,\r\n };\r\n}\r\n\r\nfunction computePositionsExtruded(params) {\r\n const ellipsoid = params.ellipsoid;\r\n const computedPositions = CorridorGeometryLibrary.computePositions(params);\r\n const attr = combine(computedPositions, params.cornerType);\r\n const wallIndices = attr.wallIndices;\r\n const height = params.height;\r\n const extrudedHeight = params.extrudedHeight;\r\n const attributes = attr.attributes;\r\n const indices = attr.indices;\r\n let positions = attributes.position.values;\r\n let length = positions.length;\r\n let extrudedPositions = new Float64Array(length);\r\n extrudedPositions.set(positions);\r\n const newPositions = new Float64Array(length * 2);\r\n\r\n positions = PolygonPipeline.scaleToGeodeticHeight(\r\n positions,\r\n height,\r\n ellipsoid\r\n );\r\n extrudedPositions = PolygonPipeline.scaleToGeodeticHeight(\r\n extrudedPositions,\r\n extrudedHeight,\r\n ellipsoid\r\n );\r\n newPositions.set(positions);\r\n newPositions.set(extrudedPositions, length);\r\n attributes.position.values = newPositions;\r\n\r\n length /= 3;\r\n if (defined(params.offsetAttribute)) {\r\n let applyOffset = new Uint8Array(length * 2);\r\n if (params.offsetAttribute === GeometryOffsetAttribute.TOP) {\r\n applyOffset = applyOffset.fill(1, 0, length);\r\n } else {\r\n const applyOffsetValue =\r\n params.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\r\n applyOffset = applyOffset.fill(applyOffsetValue);\r\n }\r\n\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n let i;\r\n const iLength = indices.length;\r\n const newIndices = IndexDatatype.createTypedArray(\r\n newPositions.length / 3,\r\n (iLength + wallIndices.length) * 2\r\n );\r\n newIndices.set(indices);\r\n let index = iLength;\r\n for (i = 0; i < iLength; i += 2) {\r\n // bottom indices\r\n const v0 = indices[i];\r\n const v1 = indices[i + 1];\r\n newIndices[index++] = v0 + length;\r\n newIndices[index++] = v1 + length;\r\n }\r\n\r\n let UL, LL;\r\n for (i = 0; i < wallIndices.length; i++) {\r\n //wall indices\r\n UL = wallIndices[i];\r\n LL = UL + length;\r\n newIndices[index++] = UL;\r\n newIndices[index++] = LL;\r\n }\r\n\r\n return {\r\n attributes: attributes,\r\n indices: newIndices,\r\n };\r\n}\r\n\r\n/**\r\n * A description of a corridor outline.\r\n *\r\n * @alias CorridorOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of positions that define the center of the corridor outline.\r\n * @param {Number} options.width The distance between the edges of the corridor outline.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Number} [options.height=0] The distance in meters between the positions and the ellipsoid surface.\r\n * @param {Number} [options.extrudedHeight] The distance in meters between the extruded face and the ellipsoid surface.\r\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\r\n *\r\n * @see CorridorOutlineGeometry.createGeometry\r\n *\r\n * @example\r\n * const corridor = new Cesium.CorridorOutlineGeometry({\r\n * positions : Cesium.Cartesian3.fromDegreesArray([-72.0, 40.0, -70.0, 35.0]),\r\n * width : 100000\r\n * });\r\n */\r\nfunction CorridorOutlineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const positions = options.positions;\r\n const width = options.width;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"options.positions\", positions);\r\n Check.typeOf.number(\"options.width\", width);\r\n //>>includeEnd('debug');\r\n\r\n const height = defaultValue(options.height, 0.0);\r\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\r\n\r\n this._positions = positions;\r\n this._ellipsoid = Ellipsoid.clone(\r\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\r\n );\r\n this._width = width;\r\n this._height = Math.max(height, extrudedHeight);\r\n this._extrudedHeight = Math.min(height, extrudedHeight);\r\n this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\r\n this._granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._workerName = \"createCorridorOutlineGeometry\";\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n 1 + positions.length * Cartesian3.packedLength + Ellipsoid.packedLength + 6;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {CorridorOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCorridorOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.typeOf.object(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const positions = value._positions;\r\n const length = positions.length;\r\n array[startingIndex++] = length;\r\n\r\n for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n Cartesian3.pack(positions[i], array, startingIndex);\r\n }\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n array[startingIndex++] = value._width;\r\n array[startingIndex++] = value._height;\r\n array[startingIndex++] = value._extrudedHeight;\r\n array[startingIndex++] = value._cornerType;\r\n array[startingIndex++] = value._granularity;\r\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchOptions = {\r\n positions: undefined,\r\n ellipsoid: scratchEllipsoid,\r\n width: undefined,\r\n height: undefined,\r\n extrudedHeight: undefined,\r\n cornerType: undefined,\r\n granularity: undefined,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {CorridorOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {CorridorOutlineGeometry} The modified result parameter or a new CorridorOutlineGeometry instance if one was not provided.\r\n */\r\nCorridorOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const length = array[startingIndex++];\r\n const positions = new Array(length);\r\n\r\n for (let i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n positions[i] = Cartesian3.unpack(array, startingIndex);\r\n }\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const width = array[startingIndex++];\r\n const height = array[startingIndex++];\r\n const extrudedHeight = array[startingIndex++];\r\n const cornerType = array[startingIndex++];\r\n const granularity = array[startingIndex++];\r\n const offsetAttribute = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.positions = positions;\r\n scratchOptions.width = width;\r\n scratchOptions.height = height;\r\n scratchOptions.extrudedHeight = extrudedHeight;\r\n scratchOptions.cornerType = cornerType;\r\n scratchOptions.granularity = granularity;\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n return new CorridorOutlineGeometry(scratchOptions);\r\n }\r\n\r\n result._positions = positions;\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._width = width;\r\n result._height = height;\r\n result._extrudedHeight = extrudedHeight;\r\n result._cornerType = cornerType;\r\n result._granularity = granularity;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a corridor, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {CorridorOutlineGeometry} corridorOutlineGeometry A description of the corridor.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nCorridorOutlineGeometry.createGeometry = function (corridorOutlineGeometry) {\r\n let positions = corridorOutlineGeometry._positions;\r\n const width = corridorOutlineGeometry._width;\r\n const ellipsoid = corridorOutlineGeometry._ellipsoid;\r\n\r\n positions = scaleToSurface(positions, ellipsoid);\r\n const cleanPositions = arrayRemoveDuplicates(\r\n positions,\r\n Cartesian3.equalsEpsilon\r\n );\r\n\r\n if (cleanPositions.length < 2 || width <= 0) {\r\n return;\r\n }\r\n\r\n const height = corridorOutlineGeometry._height;\r\n const extrudedHeight = corridorOutlineGeometry._extrudedHeight;\r\n const extrude = !CesiumMath.equalsEpsilon(\r\n height,\r\n extrudedHeight,\r\n 0,\r\n CesiumMath.EPSILON2\r\n );\r\n\r\n const params = {\r\n ellipsoid: ellipsoid,\r\n positions: cleanPositions,\r\n width: width,\r\n cornerType: corridorOutlineGeometry._cornerType,\r\n granularity: corridorOutlineGeometry._granularity,\r\n saveAttributes: false,\r\n };\r\n let attr;\r\n if (extrude) {\r\n params.height = height;\r\n params.extrudedHeight = extrudedHeight;\r\n params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;\r\n attr = computePositionsExtruded(params);\r\n } else {\r\n const computedPositions = CorridorGeometryLibrary.computePositions(params);\r\n attr = combine(computedPositions, params.cornerType);\r\n attr.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\r\n attr.attributes.position.values,\r\n height,\r\n ellipsoid\r\n );\r\n\r\n if (defined(corridorOutlineGeometry._offsetAttribute)) {\r\n const length = attr.attributes.position.values.length;\r\n const offsetValue =\r\n corridorOutlineGeometry._offsetAttribute ===\r\n GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n attr.attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n }\r\n const attributes = attr.attributes;\r\n const boundingSphere = BoundingSphere.fromVertices(\r\n attributes.position.values,\r\n undefined,\r\n 3\r\n );\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: attr.indices,\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: boundingSphere,\r\n offsetAttribute: corridorOutlineGeometry._offsetAttribute,\r\n });\r\n};\r\nexport default CorridorOutlineGeometry;\r\n","import CorridorOutlineGeometry from \"../Core/CorridorOutlineGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\n\r\nfunction createCorridorOutlineGeometry(corridorOutlineGeometry, offset) {\r\n if (defined(offset)) {\r\n corridorOutlineGeometry = CorridorOutlineGeometry.unpack(\r\n corridorOutlineGeometry,\r\n offset\r\n );\r\n }\r\n corridorOutlineGeometry._ellipsoid = Ellipsoid.clone(\r\n corridorOutlineGeometry._ellipsoid\r\n );\r\n return CorridorOutlineGeometry.createGeometry(corridorOutlineGeometry);\r\n}\r\nexport default createCorridorOutlineGeometry;\r\n"],"names":["Cartesian3","GeometryAttributes","defined","IndexDatatype","CorridorGeometryLibrary","CornerType","GeometryAttribute","ComponentDatatype","PolygonPipeline","GeometryOffsetAttribute","defaultValue","Check","Ellipsoid","CesiumMath","arrayRemoveDuplicates","BoundingSphere","Geometry","PrimitiveType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBA,MAAM,UAAU,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACpC,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I,aAAa,EAAEC,+BAAa,CAAC,KAAK;EACtC,IAAI,cAAc,EAAE,cAAc;EAClC,IAAI,eAAe,EAAE,uBAAuB,CAAC,gBAAgB;EAC7D,GAAG,CAAC,CAAC;EACL,CAAC;;ECtlBD,SAAS,6BAA6B,CAAC,uBAAuB,EAAE,MAAM,EAAE;EACxE,EAAE,IAAIf,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,uBAAuB,GAAG,uBAAuB,CAAC,MAAM;EAC5D,MAAM,uBAAuB;EAC7B,MAAM,MAAM;EACZ,KAAK,CAAC;EACN,GAAG;EACH,EAAE,uBAAuB,CAAC,UAAU,GAAGU,iBAAS,CAAC,KAAK;EACtD,IAAI,uBAAuB,CAAC,UAAU;EACtC,GAAG,CAAC;EACJ,EAAE,OAAO,uBAAuB,CAAC,cAAc,CAAC,uBAAuB,CAAC,CAAC;EACzE;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createCylinderGeometry.js b/examples/cesium/Workers/createCylinderGeometry.js
new file mode 100644
index 0000000..5f40e78
--- /dev/null
+++ b/examples/cesium/Workers/createCylinderGeometry.js
@@ -0,0 +1,38 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./CylinderGeometry-2b94e575', './defaultValue-0ab18f7d', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './CylinderGeometryLibrary-d951e1d0', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89', './VertexFormat-f2d74c96'], (function (CylinderGeometry, defaultValue, Transforms, Matrix3, Check, Math, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, CylinderGeometryLibrary, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, VertexFormat) { 'use strict';
+
+ function createCylinderGeometry(cylinderGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ cylinderGeometry = CylinderGeometry.CylinderGeometry.unpack(cylinderGeometry, offset);
+ }
+ return CylinderGeometry.CylinderGeometry.createGeometry(cylinderGeometry);
+ }
+
+ return createCylinderGeometry;
+
+}));
+//# sourceMappingURL=createCylinderGeometry.js.map
diff --git a/examples/cesium/Workers/createCylinderGeometry.js.map b/examples/cesium/Workers/createCylinderGeometry.js.map
new file mode 100644
index 0000000..49d49c4
--- /dev/null
+++ b/examples/cesium/Workers/createCylinderGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createCylinderGeometry.js","sources":["../../../Source/WorkersES6/createCylinderGeometry.js"],"sourcesContent":["import CylinderGeometry from \"../Core/CylinderGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\n\r\nfunction createCylinderGeometry(cylinderGeometry, offset) {\r\n if (defined(offset)) {\r\n cylinderGeometry = CylinderGeometry.unpack(cylinderGeometry, offset);\r\n }\r\n return CylinderGeometry.createGeometry(cylinderGeometry);\r\n}\r\nexport default createCylinderGeometry;\r\n"],"names":["defined","CylinderGeometry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,SAAS,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,EAAE;EAC1D,EAAE,IAAIA,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,gBAAgB,GAAGC,iCAAgB,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;EACzE,GAAG;EACH,EAAE,OAAOA,iCAAgB,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;EAC3D;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createCylinderOutlineGeometry.js b/examples/cesium/Workers/createCylinderOutlineGeometry.js
new file mode 100644
index 0000000..f4cfe53
--- /dev/null
+++ b/examples/cesium/Workers/createCylinderOutlineGeometry.js
@@ -0,0 +1,291 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Transforms-11fb6b0a', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './CylinderGeometryLibrary-d951e1d0', './defaultValue-0ab18f7d', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89', './Math-9be8b918', './combine-4598d225', './RuntimeError-e5c6a8b9', './WebGLConstants-f27a5e29'], (function (Transforms, Matrix2, Matrix3, Check, ComponentDatatype, CylinderGeometryLibrary, defaultValue, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1, combine, RuntimeError, WebGLConstants) { 'use strict';
+
+ const radiusScratch = new Matrix2.Cartesian2();
+
+ /**
+ * A description of the outline of a cylinder.
+ *
+ * @alias CylinderOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Number} options.length The length of the cylinder.
+ * @param {Number} options.topRadius The radius of the top of the cylinder.
+ * @param {Number} options.bottomRadius The radius of the bottom of the cylinder.
+ * @param {Number} [options.slices=128] The number of edges around the perimeter of the cylinder.
+ * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surfaces of the cylinder.
+ *
+ * @exception {DeveloperError} options.length must be greater than 0.
+ * @exception {DeveloperError} options.topRadius must be greater than 0.
+ * @exception {DeveloperError} options.bottomRadius must be greater than 0.
+ * @exception {DeveloperError} bottomRadius and topRadius cannot both equal 0.
+ * @exception {DeveloperError} options.slices must be greater than or equal to 3.
+ *
+ * @see CylinderOutlineGeometry.createGeometry
+ *
+ * @example
+ * // create cylinder geometry
+ * const cylinder = new Cesium.CylinderOutlineGeometry({
+ * length: 200000,
+ * topRadius: 80000,
+ * bottomRadius: 200000,
+ * });
+ * const geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);
+ */
+ function CylinderOutlineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const length = options.length;
+ const topRadius = options.topRadius;
+ const bottomRadius = options.bottomRadius;
+ const slices = defaultValue.defaultValue(options.slices, 128);
+ const numberOfVerticalLines = Math.max(
+ defaultValue.defaultValue(options.numberOfVerticalLines, 16),
+ 0
+ );
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("options.positions", length);
+ Check.Check.typeOf.number("options.topRadius", topRadius);
+ Check.Check.typeOf.number("options.bottomRadius", bottomRadius);
+ Check.Check.typeOf.number.greaterThanOrEquals("options.slices", slices, 3);
+ if (
+ defaultValue.defined(options.offsetAttribute) &&
+ options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP
+ ) {
+ throw new Check.DeveloperError(
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
+ );
+ }
+ //>>includeEnd('debug');
+
+ this._length = length;
+ this._topRadius = topRadius;
+ this._bottomRadius = bottomRadius;
+ this._slices = slices;
+ this._numberOfVerticalLines = numberOfVerticalLines;
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createCylinderOutlineGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ CylinderOutlineGeometry.packedLength = 6;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {CylinderOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ CylinderOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ array[startingIndex++] = value._length;
+ array[startingIndex++] = value._topRadius;
+ array[startingIndex++] = value._bottomRadius;
+ array[startingIndex++] = value._slices;
+ array[startingIndex++] = value._numberOfVerticalLines;
+ array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchOptions = {
+ length: undefined,
+ topRadius: undefined,
+ bottomRadius: undefined,
+ slices: undefined,
+ numberOfVerticalLines: undefined,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {CylinderOutlineGeometry} [result] The object into which to store the result.
+ * @returns {CylinderOutlineGeometry} The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.
+ */
+ CylinderOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const length = array[startingIndex++];
+ const topRadius = array[startingIndex++];
+ const bottomRadius = array[startingIndex++];
+ const slices = array[startingIndex++];
+ const numberOfVerticalLines = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.length = length;
+ scratchOptions.topRadius = topRadius;
+ scratchOptions.bottomRadius = bottomRadius;
+ scratchOptions.slices = slices;
+ scratchOptions.numberOfVerticalLines = numberOfVerticalLines;
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+ return new CylinderOutlineGeometry(scratchOptions);
+ }
+
+ result._length = length;
+ result._topRadius = topRadius;
+ result._bottomRadius = bottomRadius;
+ result._slices = slices;
+ result._numberOfVerticalLines = numberOfVerticalLines;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {CylinderOutlineGeometry} cylinderGeometry A description of the cylinder outline.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ CylinderOutlineGeometry.createGeometry = function (cylinderGeometry) {
+ let length = cylinderGeometry._length;
+ const topRadius = cylinderGeometry._topRadius;
+ const bottomRadius = cylinderGeometry._bottomRadius;
+ const slices = cylinderGeometry._slices;
+ const numberOfVerticalLines = cylinderGeometry._numberOfVerticalLines;
+
+ if (
+ length <= 0 ||
+ topRadius < 0 ||
+ bottomRadius < 0 ||
+ (topRadius === 0 && bottomRadius === 0)
+ ) {
+ return;
+ }
+
+ const numVertices = slices * 2;
+
+ const positions = CylinderGeometryLibrary.CylinderGeometryLibrary.computePositions(
+ length,
+ topRadius,
+ bottomRadius,
+ slices,
+ false
+ );
+ let numIndices = slices * 2;
+ let numSide;
+ if (numberOfVerticalLines > 0) {
+ const numSideLines = Math.min(numberOfVerticalLines, slices);
+ numSide = Math.round(slices / numSideLines);
+ numIndices += numSideLines;
+ }
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(numVertices, numIndices * 2);
+ let index = 0;
+ let i;
+ for (i = 0; i < slices - 1; i++) {
+ indices[index++] = i;
+ indices[index++] = i + 1;
+ indices[index++] = i + slices;
+ indices[index++] = i + 1 + slices;
+ }
+
+ indices[index++] = slices - 1;
+ indices[index++] = 0;
+ indices[index++] = slices + slices - 1;
+ indices[index++] = slices;
+
+ if (numberOfVerticalLines > 0) {
+ for (i = 0; i < slices; i += numSide) {
+ indices[index++] = i;
+ indices[index++] = i + slices;
+ }
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+
+ radiusScratch.x = length * 0.5;
+ radiusScratch.y = Math.max(bottomRadius, topRadius);
+
+ const boundingSphere = new Transforms.BoundingSphere(
+ Matrix3.Cartesian3.ZERO,
+ Matrix2.Cartesian2.magnitude(radiusScratch)
+ );
+
+ if (defaultValue.defined(cylinderGeometry._offsetAttribute)) {
+ length = positions.length;
+ const offsetValue =
+ cylinderGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: boundingSphere,
+ offsetAttribute: cylinderGeometry._offsetAttribute,
+ });
+ };
+
+ function createCylinderOutlineGeometry(cylinderGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ cylinderGeometry = CylinderOutlineGeometry.unpack(cylinderGeometry, offset);
+ }
+ return CylinderOutlineGeometry.createGeometry(cylinderGeometry);
+ }
+
+ return createCylinderOutlineGeometry;
+
+}));
+//# sourceMappingURL=createCylinderOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createCylinderOutlineGeometry.js.map b/examples/cesium/Workers/createCylinderOutlineGeometry.js.map
new file mode 100644
index 0000000..64bfca3
--- /dev/null
+++ b/examples/cesium/Workers/createCylinderOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createCylinderOutlineGeometry.js","sources":["../../../Source/Core/CylinderOutlineGeometry.js","../../../Source/WorkersES6/createCylinderOutlineGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport CylinderGeometryLibrary from \"./CylinderGeometryLibrary.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\n\r\nconst radiusScratch = new Cartesian2();\r\n\r\n/**\r\n * A description of the outline of a cylinder.\r\n *\r\n * @alias CylinderOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Number} options.length The length of the cylinder.\r\n * @param {Number} options.topRadius The radius of the top of the cylinder.\r\n * @param {Number} options.bottomRadius The radius of the bottom of the cylinder.\r\n * @param {Number} [options.slices=128] The number of edges around the perimeter of the cylinder.\r\n * @param {Number} [options.numberOfVerticalLines=16] Number of lines to draw between the top and bottom surfaces of the cylinder.\r\n *\r\n * @exception {DeveloperError} options.length must be greater than 0.\r\n * @exception {DeveloperError} options.topRadius must be greater than 0.\r\n * @exception {DeveloperError} options.bottomRadius must be greater than 0.\r\n * @exception {DeveloperError} bottomRadius and topRadius cannot both equal 0.\r\n * @exception {DeveloperError} options.slices must be greater than or equal to 3.\r\n *\r\n * @see CylinderOutlineGeometry.createGeometry\r\n *\r\n * @example\r\n * // create cylinder geometry\r\n * const cylinder = new Cesium.CylinderOutlineGeometry({\r\n * length: 200000,\r\n * topRadius: 80000,\r\n * bottomRadius: 200000,\r\n * });\r\n * const geometry = Cesium.CylinderOutlineGeometry.createGeometry(cylinder);\r\n */\r\nfunction CylinderOutlineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const length = options.length;\r\n const topRadius = options.topRadius;\r\n const bottomRadius = options.bottomRadius;\r\n const slices = defaultValue(options.slices, 128);\r\n const numberOfVerticalLines = Math.max(\r\n defaultValue(options.numberOfVerticalLines, 16),\r\n 0\r\n );\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"options.positions\", length);\r\n Check.typeOf.number(\"options.topRadius\", topRadius);\r\n Check.typeOf.number(\"options.bottomRadius\", bottomRadius);\r\n Check.typeOf.number.greaterThanOrEquals(\"options.slices\", slices, 3);\r\n if (\r\n defined(options.offsetAttribute) &&\r\n options.offsetAttribute === GeometryOffsetAttribute.TOP\r\n ) {\r\n throw new DeveloperError(\r\n \"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n this._length = length;\r\n this._topRadius = topRadius;\r\n this._bottomRadius = bottomRadius;\r\n this._slices = slices;\r\n this._numberOfVerticalLines = numberOfVerticalLines;\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._workerName = \"createCylinderOutlineGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nCylinderOutlineGeometry.packedLength = 6;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {CylinderOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nCylinderOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n array[startingIndex++] = value._length;\r\n array[startingIndex++] = value._topRadius;\r\n array[startingIndex++] = value._bottomRadius;\r\n array[startingIndex++] = value._slices;\r\n array[startingIndex++] = value._numberOfVerticalLines;\r\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchOptions = {\r\n length: undefined,\r\n topRadius: undefined,\r\n bottomRadius: undefined,\r\n slices: undefined,\r\n numberOfVerticalLines: undefined,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {CylinderOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {CylinderOutlineGeometry} The modified result parameter or a new CylinderOutlineGeometry instance if one was not provided.\r\n */\r\nCylinderOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const length = array[startingIndex++];\r\n const topRadius = array[startingIndex++];\r\n const bottomRadius = array[startingIndex++];\r\n const slices = array[startingIndex++];\r\n const numberOfVerticalLines = array[startingIndex++];\r\n const offsetAttribute = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.length = length;\r\n scratchOptions.topRadius = topRadius;\r\n scratchOptions.bottomRadius = bottomRadius;\r\n scratchOptions.slices = slices;\r\n scratchOptions.numberOfVerticalLines = numberOfVerticalLines;\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n return new CylinderOutlineGeometry(scratchOptions);\r\n }\r\n\r\n result._length = length;\r\n result._topRadius = topRadius;\r\n result._bottomRadius = bottomRadius;\r\n result._slices = slices;\r\n result._numberOfVerticalLines = numberOfVerticalLines;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of an outline of a cylinder, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {CylinderOutlineGeometry} cylinderGeometry A description of the cylinder outline.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nCylinderOutlineGeometry.createGeometry = function (cylinderGeometry) {\r\n let length = cylinderGeometry._length;\r\n const topRadius = cylinderGeometry._topRadius;\r\n const bottomRadius = cylinderGeometry._bottomRadius;\r\n const slices = cylinderGeometry._slices;\r\n const numberOfVerticalLines = cylinderGeometry._numberOfVerticalLines;\r\n\r\n if (\r\n length <= 0 ||\r\n topRadius < 0 ||\r\n bottomRadius < 0 ||\r\n (topRadius === 0 && bottomRadius === 0)\r\n ) {\r\n return;\r\n }\r\n\r\n const numVertices = slices * 2;\r\n\r\n const positions = CylinderGeometryLibrary.computePositions(\r\n length,\r\n topRadius,\r\n bottomRadius,\r\n slices,\r\n false\r\n );\r\n let numIndices = slices * 2;\r\n let numSide;\r\n if (numberOfVerticalLines > 0) {\r\n const numSideLines = Math.min(numberOfVerticalLines, slices);\r\n numSide = Math.round(slices / numSideLines);\r\n numIndices += numSideLines;\r\n }\r\n\r\n const indices = IndexDatatype.createTypedArray(numVertices, numIndices * 2);\r\n let index = 0;\r\n let i;\r\n for (i = 0; i < slices - 1; i++) {\r\n indices[index++] = i;\r\n indices[index++] = i + 1;\r\n indices[index++] = i + slices;\r\n indices[index++] = i + 1 + slices;\r\n }\r\n\r\n indices[index++] = slices - 1;\r\n indices[index++] = 0;\r\n indices[index++] = slices + slices - 1;\r\n indices[index++] = slices;\r\n\r\n if (numberOfVerticalLines > 0) {\r\n for (i = 0; i < slices; i += numSide) {\r\n indices[index++] = i;\r\n indices[index++] = i + slices;\r\n }\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n\r\n radiusScratch.x = length * 0.5;\r\n radiusScratch.y = Math.max(bottomRadius, topRadius);\r\n\r\n const boundingSphere = new BoundingSphere(\r\n Cartesian3.ZERO,\r\n Cartesian2.magnitude(radiusScratch)\r\n );\r\n\r\n if (defined(cylinderGeometry._offsetAttribute)) {\r\n length = positions.length;\r\n const offsetValue =\r\n cylinderGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: boundingSphere,\r\n offsetAttribute: cylinderGeometry._offsetAttribute,\r\n });\r\n};\r\nexport default CylinderOutlineGeometry;\r\n","import CylinderOutlineGeometry from \"../Core/CylinderOutlineGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\n\r\nfunction createCylinderOutlineGeometry(cylinderGeometry, offset) {\r\n if (defined(offset)) {\r\n cylinderGeometry = CylinderOutlineGeometry.unpack(cylinderGeometry, offset);\r\n }\r\n return CylinderOutlineGeometry.createGeometry(cylinderGeometry);\r\n}\r\nexport default createCylinderOutlineGeometry;\r\n"],"names":["Cartesian2","defaultValue","Check","defined","GeometryOffsetAttribute","DeveloperError","CylinderGeometryLibrary","IndexDatatype","GeometryAttributes","GeometryAttribute","ComponentDatatype","BoundingSphere","Cartesian3","Geometry","PrimitiveType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,aAAa,GAAG,IAAIA,kBAAU,EAAE,CAAC;AACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,uBAAuB,CAAC,OAAO,EAAE;EAC1C,EAAE,OAAO,GAAGC,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;EAChC,EAAE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;EACtC,EAAE,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;EAC5C,EAAE,MAAM,MAAM,GAAGA,yBAAY,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;EACnD,EAAE,MAAM,qBAAqB,GAAG,IAAI,CAAC,GAAG;EACxC,IAAIA,yBAAY,CAAC,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC;EACnD,IAAI,CAAC;EACL,GAAG,CAAC;AACJ;EACA;EACA,EAAEC,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;EACnD,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;EACtD,EAAEA,WAAK,CAAC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AO,uBAAuB,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;EAClE;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createEllipseGeometry.js b/examples/cesium/Workers/createEllipseGeometry.js
new file mode 100644
index 0000000..2bafa44
--- /dev/null
+++ b/examples/cesium/Workers/createEllipseGeometry.js
@@ -0,0 +1,40 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Matrix3-f22b0303', './defaultValue-0ab18f7d', './EllipseGeometry-6f0c1448', './Check-d10e5f2e', './Math-9be8b918', './Transforms-11fb6b0a', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './EllipseGeometryLibrary-d3f88cc2', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryInstance-b2be3e5a', './GeometryOffsetAttribute-cc320d7d', './GeometryPipeline-f28890f4', './AttributeCompression-e9888cb8', './EncodedCartesian3-38e2691f', './IndexDatatype-b4e5cf89', './IntersectionTests-2c7928de', './Plane-c9f1487d', './VertexFormat-f2d74c96'], (function (Matrix3, defaultValue, EllipseGeometry, Check, Math, Transforms, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, EllipseGeometryLibrary, GeometryAttribute, GeometryAttributes, GeometryInstance, GeometryOffsetAttribute, GeometryPipeline, AttributeCompression, EncodedCartesian3, IndexDatatype, IntersectionTests, Plane, VertexFormat) { 'use strict';
+
+ function createEllipseGeometry(ellipseGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ ellipseGeometry = EllipseGeometry.EllipseGeometry.unpack(ellipseGeometry, offset);
+ }
+ ellipseGeometry._center = Matrix3.Cartesian3.clone(ellipseGeometry._center);
+ ellipseGeometry._ellipsoid = Matrix3.Ellipsoid.clone(ellipseGeometry._ellipsoid);
+ return EllipseGeometry.EllipseGeometry.createGeometry(ellipseGeometry);
+ }
+
+ return createEllipseGeometry;
+
+}));
+//# sourceMappingURL=createEllipseGeometry.js.map
diff --git a/examples/cesium/Workers/createEllipseGeometry.js.map b/examples/cesium/Workers/createEllipseGeometry.js.map
new file mode 100644
index 0000000..6bc7ae4
--- /dev/null
+++ b/examples/cesium/Workers/createEllipseGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createEllipseGeometry.js","sources":["../../../Source/WorkersES6/createEllipseGeometry.js"],"sourcesContent":["import Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport EllipseGeometry from \"../Core/EllipseGeometry.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\n\r\nfunction createEllipseGeometry(ellipseGeometry, offset) {\r\n if (defined(offset)) {\r\n ellipseGeometry = EllipseGeometry.unpack(ellipseGeometry, offset);\r\n }\r\n ellipseGeometry._center = Cartesian3.clone(ellipseGeometry._center);\r\n ellipseGeometry._ellipsoid = Ellipsoid.clone(ellipseGeometry._ellipsoid);\r\n return EllipseGeometry.createGeometry(ellipseGeometry);\r\n}\r\nexport default createEllipseGeometry;\r\n"],"names":["defined","EllipseGeometry","Cartesian3","Ellipsoid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA,SAAS,qBAAqB,CAAC,eAAe,EAAE,MAAM,EAAE;EACxD,EAAE,IAAIA,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,eAAe,GAAGC,+BAAe,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;EACtE,GAAG;EACH,EAAE,eAAe,CAAC,OAAO,GAAGC,kBAAU,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;EACtE,EAAE,eAAe,CAAC,UAAU,GAAGC,iBAAS,CAAC,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;EAC3E,EAAE,OAAOF,+BAAe,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;EACzD;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createEllipseOutlineGeometry.js b/examples/cesium/Workers/createEllipseOutlineGeometry.js
new file mode 100644
index 0000000..765ce75
--- /dev/null
+++ b/examples/cesium/Workers/createEllipseOutlineGeometry.js
@@ -0,0 +1,40 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Matrix3-f22b0303', './defaultValue-0ab18f7d', './EllipseOutlineGeometry-ea3faee0', './Check-d10e5f2e', './Math-9be8b918', './Transforms-11fb6b0a', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './EllipseGeometryLibrary-d3f88cc2', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89'], (function (Matrix3, defaultValue, EllipseOutlineGeometry, Check, Math, Transforms, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, EllipseGeometryLibrary, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype) { 'use strict';
+
+ function createEllipseOutlineGeometry(ellipseGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ ellipseGeometry = EllipseOutlineGeometry.EllipseOutlineGeometry.unpack(ellipseGeometry, offset);
+ }
+ ellipseGeometry._center = Matrix3.Cartesian3.clone(ellipseGeometry._center);
+ ellipseGeometry._ellipsoid = Matrix3.Ellipsoid.clone(ellipseGeometry._ellipsoid);
+ return EllipseOutlineGeometry.EllipseOutlineGeometry.createGeometry(ellipseGeometry);
+ }
+
+ return createEllipseOutlineGeometry;
+
+}));
+//# sourceMappingURL=createEllipseOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createEllipseOutlineGeometry.js.map b/examples/cesium/Workers/createEllipseOutlineGeometry.js.map
new file mode 100644
index 0000000..56a9dda
--- /dev/null
+++ b/examples/cesium/Workers/createEllipseOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createEllipseOutlineGeometry.js","sources":["../../../Source/WorkersES6/createEllipseOutlineGeometry.js"],"sourcesContent":["import Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport EllipseOutlineGeometry from \"../Core/EllipseOutlineGeometry.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\n\r\nfunction createEllipseOutlineGeometry(ellipseGeometry, offset) {\r\n if (defined(offset)) {\r\n ellipseGeometry = EllipseOutlineGeometry.unpack(ellipseGeometry, offset);\r\n }\r\n ellipseGeometry._center = Cartesian3.clone(ellipseGeometry._center);\r\n ellipseGeometry._ellipsoid = Ellipsoid.clone(ellipseGeometry._ellipsoid);\r\n return EllipseOutlineGeometry.createGeometry(ellipseGeometry);\r\n}\r\nexport default createEllipseOutlineGeometry;\r\n"],"names":["defined","EllipseOutlineGeometry","Cartesian3","Ellipsoid"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA,SAAS,4BAA4B,CAAC,eAAe,EAAE,MAAM,EAAE;EAC/D,EAAE,IAAIA,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,eAAe,GAAGC,6CAAsB,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;EAC7E,GAAG;EACH,EAAE,eAAe,CAAC,OAAO,GAAGC,kBAAU,CAAC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;EACtE,EAAE,eAAe,CAAC,UAAU,GAAGC,iBAAS,CAAC,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;EAC3E,EAAE,OAAOF,6CAAsB,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;EAChE;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createEllipsoidGeometry.js b/examples/cesium/Workers/createEllipsoidGeometry.js
new file mode 100644
index 0000000..552d04b
--- /dev/null
+++ b/examples/cesium/Workers/createEllipsoidGeometry.js
@@ -0,0 +1,38 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './EllipsoidGeometry-66510462', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89', './VertexFormat-f2d74c96'], (function (defaultValue, EllipsoidGeometry, Transforms, Matrix3, Check, Math, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, VertexFormat) { 'use strict';
+
+ function createEllipsoidGeometry(ellipsoidGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ ellipsoidGeometry = EllipsoidGeometry.EllipsoidGeometry.unpack(ellipsoidGeometry, offset);
+ }
+ return EllipsoidGeometry.EllipsoidGeometry.createGeometry(ellipsoidGeometry);
+ }
+
+ return createEllipsoidGeometry;
+
+}));
+//# sourceMappingURL=createEllipsoidGeometry.js.map
diff --git a/examples/cesium/Workers/createEllipsoidGeometry.js.map b/examples/cesium/Workers/createEllipsoidGeometry.js.map
new file mode 100644
index 0000000..7b239bb
--- /dev/null
+++ b/examples/cesium/Workers/createEllipsoidGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createEllipsoidGeometry.js","sources":["../../../Source/WorkersES6/createEllipsoidGeometry.js"],"sourcesContent":["import defined from \"../Core/defined.js\";\r\nimport EllipsoidGeometry from \"../Core/EllipsoidGeometry.js\";\r\n\r\nfunction createEllipsoidGeometry(ellipsoidGeometry, offset) {\r\n if (defined(offset)) {\r\n ellipsoidGeometry = EllipsoidGeometry.unpack(ellipsoidGeometry, offset);\r\n }\r\n return EllipsoidGeometry.createGeometry(ellipsoidGeometry);\r\n}\r\nexport default createEllipsoidGeometry;\r\n"],"names":["defined","EllipsoidGeometry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,SAAS,uBAAuB,CAAC,iBAAiB,EAAE,MAAM,EAAE;EAC5D,EAAE,IAAIA,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,iBAAiB,GAAGC,mCAAiB,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;EAC5E,GAAG;EACH,EAAE,OAAOA,mCAAiB,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;EAC7D;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createEllipsoidOutlineGeometry.js b/examples/cesium/Workers/createEllipsoidOutlineGeometry.js
new file mode 100644
index 0000000..04c7ea3
--- /dev/null
+++ b/examples/cesium/Workers/createEllipsoidOutlineGeometry.js
@@ -0,0 +1,41 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './EllipsoidOutlineGeometry-c18e3c42', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89'], (function (defaultValue, EllipsoidOutlineGeometry, Transforms, Matrix3, Check, Math, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype) { 'use strict';
+
+ function createEllipsoidOutlineGeometry(ellipsoidGeometry, offset) {
+ if (defaultValue.defined(ellipsoidGeometry.buffer)) {
+ ellipsoidGeometry = EllipsoidOutlineGeometry.EllipsoidOutlineGeometry.unpack(
+ ellipsoidGeometry,
+ offset
+ );
+ }
+ return EllipsoidOutlineGeometry.EllipsoidOutlineGeometry.createGeometry(ellipsoidGeometry);
+ }
+
+ return createEllipsoidOutlineGeometry;
+
+}));
+//# sourceMappingURL=createEllipsoidOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createEllipsoidOutlineGeometry.js.map b/examples/cesium/Workers/createEllipsoidOutlineGeometry.js.map
new file mode 100644
index 0000000..98c90a7
--- /dev/null
+++ b/examples/cesium/Workers/createEllipsoidOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createEllipsoidOutlineGeometry.js","sources":["../../../Source/WorkersES6/createEllipsoidOutlineGeometry.js"],"sourcesContent":["import defined from \"../Core/defined.js\";\r\nimport EllipsoidOutlineGeometry from \"../Core/EllipsoidOutlineGeometry.js\";\r\n\r\nfunction createEllipsoidOutlineGeometry(ellipsoidGeometry, offset) {\r\n if (defined(ellipsoidGeometry.buffer, offset)) {\r\n ellipsoidGeometry = EllipsoidOutlineGeometry.unpack(\r\n ellipsoidGeometry,\r\n offset\r\n );\r\n }\r\n return EllipsoidOutlineGeometry.createGeometry(ellipsoidGeometry);\r\n}\r\nexport default createEllipsoidOutlineGeometry;\r\n"],"names":["defined","EllipsoidOutlineGeometry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,SAAS,8BAA8B,CAAC,iBAAiB,EAAE,MAAM,EAAE;EACnE,EAAE,IAAIA,oBAAO,CAAC,iBAAiB,CAAC,MAAc,CAAC,EAAE;EACjD,IAAI,iBAAiB,GAAGC,iDAAwB,CAAC,MAAM;EACvD,MAAM,iBAAiB;EACvB,MAAM,MAAM;EACZ,KAAK,CAAC;EACN,GAAG;EACH,EAAE,OAAOA,iDAAwB,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;EACpE;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createFrustumGeometry.js b/examples/cesium/Workers/createFrustumGeometry.js
new file mode 100644
index 0000000..9b6ba79
--- /dev/null
+++ b/examples/cesium/Workers/createFrustumGeometry.js
@@ -0,0 +1,38 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './FrustumGeometry-f3f058a2', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './Plane-c9f1487d', './VertexFormat-f2d74c96'], (function (defaultValue, FrustumGeometry, Transforms, Matrix3, Check, Math, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, GeometryAttribute, GeometryAttributes, Plane, VertexFormat) { 'use strict';
+
+ function createFrustumGeometry(frustumGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ frustumGeometry = FrustumGeometry.FrustumGeometry.unpack(frustumGeometry, offset);
+ }
+ return FrustumGeometry.FrustumGeometry.createGeometry(frustumGeometry);
+ }
+
+ return createFrustumGeometry;
+
+}));
+//# sourceMappingURL=createFrustumGeometry.js.map
diff --git a/examples/cesium/Workers/createFrustumGeometry.js.map b/examples/cesium/Workers/createFrustumGeometry.js.map
new file mode 100644
index 0000000..574112f
--- /dev/null
+++ b/examples/cesium/Workers/createFrustumGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createFrustumGeometry.js","sources":["../../../Source/WorkersES6/createFrustumGeometry.js"],"sourcesContent":["import defined from \"../Core/defined.js\";\r\nimport FrustumGeometry from \"../Core/FrustumGeometry.js\";\r\n\r\nfunction createFrustumGeometry(frustumGeometry, offset) {\r\n if (defined(offset)) {\r\n frustumGeometry = FrustumGeometry.unpack(frustumGeometry, offset);\r\n }\r\n return FrustumGeometry.createGeometry(frustumGeometry);\r\n}\r\nexport default createFrustumGeometry;\r\n"],"names":["defined","FrustumGeometry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,SAAS,qBAAqB,CAAC,eAAe,EAAE,MAAM,EAAE;EACxD,EAAE,IAAIA,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,eAAe,GAAGC,+BAAe,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;EACtE,GAAG;EACH,EAAE,OAAOA,+BAAe,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;EACzD;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createFrustumOutlineGeometry.js b/examples/cesium/Workers/createFrustumOutlineGeometry.js
new file mode 100644
index 0000000..d323d71
--- /dev/null
+++ b/examples/cesium/Workers/createFrustumOutlineGeometry.js
@@ -0,0 +1,277 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './FrustumGeometry-f3f058a2', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29', './Plane-c9f1487d', './VertexFormat-f2d74c96'], (function (defaultValue, Transforms, Matrix3, Check, ComponentDatatype, FrustumGeometry, GeometryAttribute, GeometryAttributes, Math, Matrix2, RuntimeError, combine, WebGLConstants, Plane, VertexFormat) { 'use strict';
+
+ const PERSPECTIVE = 0;
+ const ORTHOGRAPHIC = 1;
+
+ /**
+ * A description of the outline of a frustum with the given the origin and orientation.
+ *
+ * @alias FrustumOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.
+ * @param {Cartesian3} options.origin The origin of the frustum.
+ * @param {Quaternion} options.orientation The orientation of the frustum.
+ */
+ function FrustumOutlineGeometry(options) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("options", options);
+ Check.Check.typeOf.object("options.frustum", options.frustum);
+ Check.Check.typeOf.object("options.origin", options.origin);
+ Check.Check.typeOf.object("options.orientation", options.orientation);
+ //>>includeEnd('debug');
+
+ const frustum = options.frustum;
+ const orientation = options.orientation;
+ const origin = options.origin;
+
+ // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by
+ // creating multiple FrustumOutlineGeometrys. This way the near plane of one frustum doesn't overlap
+ // the far plane of another.
+ const drawNearPlane = defaultValue.defaultValue(options._drawNearPlane, true);
+
+ let frustumType;
+ let frustumPackedLength;
+ if (frustum instanceof FrustumGeometry.PerspectiveFrustum) {
+ frustumType = PERSPECTIVE;
+ frustumPackedLength = FrustumGeometry.PerspectiveFrustum.packedLength;
+ } else if (frustum instanceof FrustumGeometry.OrthographicFrustum) {
+ frustumType = ORTHOGRAPHIC;
+ frustumPackedLength = FrustumGeometry.OrthographicFrustum.packedLength;
+ }
+
+ this._frustumType = frustumType;
+ this._frustum = frustum.clone();
+ this._origin = Matrix3.Cartesian3.clone(origin);
+ this._orientation = Transforms.Quaternion.clone(orientation);
+ this._drawNearPlane = drawNearPlane;
+ this._workerName = "createFrustumOutlineGeometry";
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ 2 + frustumPackedLength + Matrix3.Cartesian3.packedLength + Transforms.Quaternion.packedLength;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {FrustumOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ FrustumOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const frustumType = value._frustumType;
+ const frustum = value._frustum;
+
+ array[startingIndex++] = frustumType;
+
+ if (frustumType === PERSPECTIVE) {
+ FrustumGeometry.PerspectiveFrustum.pack(frustum, array, startingIndex);
+ startingIndex += FrustumGeometry.PerspectiveFrustum.packedLength;
+ } else {
+ FrustumGeometry.OrthographicFrustum.pack(frustum, array, startingIndex);
+ startingIndex += FrustumGeometry.OrthographicFrustum.packedLength;
+ }
+
+ Matrix3.Cartesian3.pack(value._origin, array, startingIndex);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+ Transforms.Quaternion.pack(value._orientation, array, startingIndex);
+ startingIndex += Transforms.Quaternion.packedLength;
+ array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;
+
+ return array;
+ };
+
+ const scratchPackPerspective = new FrustumGeometry.PerspectiveFrustum();
+ const scratchPackOrthographic = new FrustumGeometry.OrthographicFrustum();
+ const scratchPackQuaternion = new Transforms.Quaternion();
+ const scratchPackorigin = new Matrix3.Cartesian3();
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {FrustumOutlineGeometry} [result] The object into which to store the result.
+ */
+ FrustumOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const frustumType = array[startingIndex++];
+
+ let frustum;
+ if (frustumType === PERSPECTIVE) {
+ frustum = FrustumGeometry.PerspectiveFrustum.unpack(
+ array,
+ startingIndex,
+ scratchPackPerspective
+ );
+ startingIndex += FrustumGeometry.PerspectiveFrustum.packedLength;
+ } else {
+ frustum = FrustumGeometry.OrthographicFrustum.unpack(
+ array,
+ startingIndex,
+ scratchPackOrthographic
+ );
+ startingIndex += FrustumGeometry.OrthographicFrustum.packedLength;
+ }
+
+ const origin = Matrix3.Cartesian3.unpack(array, startingIndex, scratchPackorigin);
+ startingIndex += Matrix3.Cartesian3.packedLength;
+ const orientation = Transforms.Quaternion.unpack(
+ array,
+ startingIndex,
+ scratchPackQuaternion
+ );
+ startingIndex += Transforms.Quaternion.packedLength;
+ const drawNearPlane = array[startingIndex] === 1.0;
+
+ if (!defaultValue.defined(result)) {
+ return new FrustumOutlineGeometry({
+ frustum: frustum,
+ origin: origin,
+ orientation: orientation,
+ _drawNearPlane: drawNearPlane,
+ });
+ }
+
+ const frustumResult =
+ frustumType === result._frustumType ? result._frustum : undefined;
+ result._frustum = frustum.clone(frustumResult);
+
+ result._frustumType = frustumType;
+ result._origin = Matrix3.Cartesian3.clone(origin, result._origin);
+ result._orientation = Transforms.Quaternion.clone(orientation, result._orientation);
+ result._drawNearPlane = drawNearPlane;
+
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {FrustumOutlineGeometry} frustumGeometry A description of the frustum.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ FrustumOutlineGeometry.createGeometry = function (frustumGeometry) {
+ const frustumType = frustumGeometry._frustumType;
+ const frustum = frustumGeometry._frustum;
+ const origin = frustumGeometry._origin;
+ const orientation = frustumGeometry._orientation;
+ const drawNearPlane = frustumGeometry._drawNearPlane;
+
+ const positions = new Float64Array(3 * 4 * 2);
+ FrustumGeometry.FrustumGeometry._computeNearFarPlanes(
+ origin,
+ orientation,
+ frustumType,
+ frustum,
+ positions
+ );
+
+ const attributes = new GeometryAttributes.GeometryAttributes({
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ }),
+ });
+
+ let offset;
+ let index;
+
+ const numberOfPlanes = drawNearPlane ? 2 : 1;
+ const indices = new Uint16Array(8 * (numberOfPlanes + 1));
+
+ // Build the near/far planes
+ let i = drawNearPlane ? 0 : 1;
+ for (; i < 2; ++i) {
+ offset = drawNearPlane ? i * 8 : 0;
+ index = i * 4;
+
+ indices[offset] = index;
+ indices[offset + 1] = index + 1;
+ indices[offset + 2] = index + 1;
+ indices[offset + 3] = index + 2;
+ indices[offset + 4] = index + 2;
+ indices[offset + 5] = index + 3;
+ indices[offset + 6] = index + 3;
+ indices[offset + 7] = index;
+ }
+
+ // Build the sides of the frustums
+ for (i = 0; i < 2; ++i) {
+ offset = (numberOfPlanes + i) * 8;
+ index = i * 4;
+
+ indices[offset] = index;
+ indices[offset + 1] = index + 4;
+ indices[offset + 2] = index + 1;
+ indices[offset + 3] = index + 5;
+ indices[offset + 4] = index + 2;
+ indices[offset + 5] = index + 6;
+ indices[offset + 6] = index + 3;
+ indices[offset + 7] = index + 7;
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: Transforms.BoundingSphere.fromVertices(positions),
+ });
+ };
+
+ function createFrustumOutlineGeometry(frustumGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ frustumGeometry = FrustumOutlineGeometry.unpack(frustumGeometry, offset);
+ }
+ return FrustumOutlineGeometry.createGeometry(frustumGeometry);
+ }
+
+ return createFrustumOutlineGeometry;
+
+}));
+//# sourceMappingURL=createFrustumOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createFrustumOutlineGeometry.js.map b/examples/cesium/Workers/createFrustumOutlineGeometry.js.map
new file mode 100644
index 0000000..ae29413
--- /dev/null
+++ b/examples/cesium/Workers/createFrustumOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createFrustumOutlineGeometry.js","sources":["../../../Source/Core/FrustumOutlineGeometry.js","../../../Source/WorkersES6/createFrustumOutlineGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport FrustumGeometry from \"./FrustumGeometry.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport OrthographicFrustum from \"./OrthographicFrustum.js\";\r\nimport PerspectiveFrustum from \"./PerspectiveFrustum.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\n\r\nconst PERSPECTIVE = 0;\r\nconst ORTHOGRAPHIC = 1;\r\n\r\n/**\r\n * A description of the outline of a frustum with the given the origin and orientation.\r\n *\r\n * @alias FrustumOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {PerspectiveFrustum|OrthographicFrustum} options.frustum The frustum.\r\n * @param {Cartesian3} options.origin The origin of the frustum.\r\n * @param {Quaternion} options.orientation The orientation of the frustum.\r\n */\r\nfunction FrustumOutlineGeometry(options) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"options\", options);\r\n Check.typeOf.object(\"options.frustum\", options.frustum);\r\n Check.typeOf.object(\"options.origin\", options.origin);\r\n Check.typeOf.object(\"options.orientation\", options.orientation);\r\n //>>includeEnd('debug');\r\n\r\n const frustum = options.frustum;\r\n const orientation = options.orientation;\r\n const origin = options.origin;\r\n\r\n // This is private because it is used by DebugCameraPrimitive to draw a multi-frustum by\r\n // creating multiple FrustumOutlineGeometrys. This way the near plane of one frustum doesn't overlap\r\n // the far plane of another.\r\n const drawNearPlane = defaultValue(options._drawNearPlane, true);\r\n\r\n let frustumType;\r\n let frustumPackedLength;\r\n if (frustum instanceof PerspectiveFrustum) {\r\n frustumType = PERSPECTIVE;\r\n frustumPackedLength = PerspectiveFrustum.packedLength;\r\n } else if (frustum instanceof OrthographicFrustum) {\r\n frustumType = ORTHOGRAPHIC;\r\n frustumPackedLength = OrthographicFrustum.packedLength;\r\n }\r\n\r\n this._frustumType = frustumType;\r\n this._frustum = frustum.clone();\r\n this._origin = Cartesian3.clone(origin);\r\n this._orientation = Quaternion.clone(orientation);\r\n this._drawNearPlane = drawNearPlane;\r\n this._workerName = \"createFrustumOutlineGeometry\";\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n 2 + frustumPackedLength + Cartesian3.packedLength + Quaternion.packedLength;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {FrustumOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nFrustumOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const frustumType = value._frustumType;\r\n const frustum = value._frustum;\r\n\r\n array[startingIndex++] = frustumType;\r\n\r\n if (frustumType === PERSPECTIVE) {\r\n PerspectiveFrustum.pack(frustum, array, startingIndex);\r\n startingIndex += PerspectiveFrustum.packedLength;\r\n } else {\r\n OrthographicFrustum.pack(frustum, array, startingIndex);\r\n startingIndex += OrthographicFrustum.packedLength;\r\n }\r\n\r\n Cartesian3.pack(value._origin, array, startingIndex);\r\n startingIndex += Cartesian3.packedLength;\r\n Quaternion.pack(value._orientation, array, startingIndex);\r\n startingIndex += Quaternion.packedLength;\r\n array[startingIndex] = value._drawNearPlane ? 1.0 : 0.0;\r\n\r\n return array;\r\n};\r\n\r\nconst scratchPackPerspective = new PerspectiveFrustum();\r\nconst scratchPackOrthographic = new OrthographicFrustum();\r\nconst scratchPackQuaternion = new Quaternion();\r\nconst scratchPackorigin = new Cartesian3();\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {FrustumOutlineGeometry} [result] The object into which to store the result.\r\n */\r\nFrustumOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const frustumType = array[startingIndex++];\r\n\r\n let frustum;\r\n if (frustumType === PERSPECTIVE) {\r\n frustum = PerspectiveFrustum.unpack(\r\n array,\r\n startingIndex,\r\n scratchPackPerspective\r\n );\r\n startingIndex += PerspectiveFrustum.packedLength;\r\n } else {\r\n frustum = OrthographicFrustum.unpack(\r\n array,\r\n startingIndex,\r\n scratchPackOrthographic\r\n );\r\n startingIndex += OrthographicFrustum.packedLength;\r\n }\r\n\r\n const origin = Cartesian3.unpack(array, startingIndex, scratchPackorigin);\r\n startingIndex += Cartesian3.packedLength;\r\n const orientation = Quaternion.unpack(\r\n array,\r\n startingIndex,\r\n scratchPackQuaternion\r\n );\r\n startingIndex += Quaternion.packedLength;\r\n const drawNearPlane = array[startingIndex] === 1.0;\r\n\r\n if (!defined(result)) {\r\n return new FrustumOutlineGeometry({\r\n frustum: frustum,\r\n origin: origin,\r\n orientation: orientation,\r\n _drawNearPlane: drawNearPlane,\r\n });\r\n }\r\n\r\n const frustumResult =\r\n frustumType === result._frustumType ? result._frustum : undefined;\r\n result._frustum = frustum.clone(frustumResult);\r\n\r\n result._frustumType = frustumType;\r\n result._origin = Cartesian3.clone(origin, result._origin);\r\n result._orientation = Quaternion.clone(orientation, result._orientation);\r\n result._drawNearPlane = drawNearPlane;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a frustum outline, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {FrustumOutlineGeometry} frustumGeometry A description of the frustum.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nFrustumOutlineGeometry.createGeometry = function (frustumGeometry) {\r\n const frustumType = frustumGeometry._frustumType;\r\n const frustum = frustumGeometry._frustum;\r\n const origin = frustumGeometry._origin;\r\n const orientation = frustumGeometry._orientation;\r\n const drawNearPlane = frustumGeometry._drawNearPlane;\r\n\r\n const positions = new Float64Array(3 * 4 * 2);\r\n FrustumGeometry._computeNearFarPlanes(\r\n origin,\r\n orientation,\r\n frustumType,\r\n frustum,\r\n positions\r\n );\r\n\r\n const attributes = new GeometryAttributes({\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n }),\r\n });\r\n\r\n let offset;\r\n let index;\r\n\r\n const numberOfPlanes = drawNearPlane ? 2 : 1;\r\n const indices = new Uint16Array(8 * (numberOfPlanes + 1));\r\n\r\n // Build the near/far planes\r\n let i = drawNearPlane ? 0 : 1;\r\n for (; i < 2; ++i) {\r\n offset = drawNearPlane ? i * 8 : 0;\r\n index = i * 4;\r\n\r\n indices[offset] = index;\r\n indices[offset + 1] = index + 1;\r\n indices[offset + 2] = index + 1;\r\n indices[offset + 3] = index + 2;\r\n indices[offset + 4] = index + 2;\r\n indices[offset + 5] = index + 3;\r\n indices[offset + 6] = index + 3;\r\n indices[offset + 7] = index;\r\n }\r\n\r\n // Build the sides of the frustums\r\n for (i = 0; i < 2; ++i) {\r\n offset = (numberOfPlanes + i) * 8;\r\n index = i * 4;\r\n\r\n indices[offset] = index;\r\n indices[offset + 1] = index + 4;\r\n indices[offset + 2] = index + 1;\r\n indices[offset + 3] = index + 5;\r\n indices[offset + 4] = index + 2;\r\n indices[offset + 5] = index + 6;\r\n indices[offset + 6] = index + 3;\r\n indices[offset + 7] = index + 7;\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: BoundingSphere.fromVertices(positions),\r\n });\r\n};\r\nexport default FrustumOutlineGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport FrustumOutlineGeometry from \"../Core/FrustumOutlineGeometry.js\";\r\n\r\nfunction createFrustumOutlineGeometry(frustumGeometry, offset) {\r\n if (defined(offset)) {\r\n frustumGeometry = FrustumOutlineGeometry.unpack(frustumGeometry, offset);\r\n }\r\n return FrustumOutlineGeometry.createGeometry(frustumGeometry);\r\n}\r\nexport default createFrustumOutlineGeometry;\r\n"],"names":["Check","defaultValue","PerspectiveFrustum","OrthographicFrustum","Cartesian3","Quaternion","defined","FrustumGeometry","GeometryAttributes","GeometryAttribute","ComponentDatatype","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,WAAW,GAAG,CAAC,CAAC;EACtB,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,sBAAsB,CAAC,OAAO,EAAE;EACzC;EACA,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;EAC1C,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;EAC1D,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;EACxD,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;EAClE;AACA;EACA,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;EAClC,EAAE,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;EAC1C,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;AAChC;EACA;EACA;EACA;EACA,EAAE,MAAM,aAAa,GAAGC,yBAAY,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AACnE;EACA,EAAE,IAAI,WAAW,CAAC;EAClB,EAAE,IAAI,mBAAmB,CAAC;EAC1B,EAAE,IAAI,OAAO,YAAYC,kCAAkB,EAAE;EAC7C,IAAI,WAAW,GAAG,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AO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,eAAe,GAAG,sBAAsB,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;EAC7E,GAAG;EACH,EAAE,OAAO,sBAAsB,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;EAChE;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createGeometry.js b/examples/cesium/Workers/createGeometry.js
new file mode 100644
index 0000000..fe6827b
--- /dev/null
+++ b/examples/cesium/Workers/createGeometry.js
@@ -0,0 +1,81 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './PrimitivePipeline-f6d2b3b0', './createTaskProcessorWorker', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryPipeline-f28890f4', './AttributeCompression-e9888cb8', './EncodedCartesian3-38e2691f', './IndexDatatype-b4e5cf89', './IntersectionTests-2c7928de', './Plane-c9f1487d', './WebMercatorProjection-306f7acc'], (function (defaultValue, PrimitivePipeline, createTaskProcessorWorker, Transforms, Matrix3, Check, Math, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, GeometryAttribute, GeometryAttributes, GeometryPipeline, AttributeCompression, EncodedCartesian3, IndexDatatype, IntersectionTests, Plane, WebMercatorProjection) { 'use strict';
+
+ /* global require */
+
+ const moduleCache = {};
+
+ function getModule(moduleName) {
+ let module = moduleCache[moduleName];
+ if (!defaultValue.defined(module)) {
+ if (typeof exports === "object") {
+ // Use CommonJS-style require.
+ moduleCache[module] = module = require(`Workers/${moduleName}`);
+ } else {
+ // Use AMD-style require.
+ // in web workers, require is synchronous
+ require([`Workers/${moduleName}`], function (f) {
+ module = f;
+ moduleCache[module] = f;
+ });
+ }
+ }
+ return module;
+ }
+
+ function createGeometry(parameters, transferableObjects) {
+ const subTasks = parameters.subTasks;
+ const length = subTasks.length;
+ const resultsOrPromises = new Array(length);
+
+ for (let i = 0; i < length; i++) {
+ const task = subTasks[i];
+ const geometry = task.geometry;
+ const moduleName = task.moduleName;
+
+ if (defaultValue.defined(moduleName)) {
+ const createFunction = getModule(moduleName);
+ resultsOrPromises[i] = createFunction(geometry, task.offset);
+ } else {
+ //Already created geometry
+ resultsOrPromises[i] = geometry;
+ }
+ }
+
+ return Promise.all(resultsOrPromises).then(function (results) {
+ return PrimitivePipeline.PrimitivePipeline.packCreateGeometryResults(
+ results,
+ transferableObjects
+ );
+ });
+ }
+ var createGeometry$1 = createTaskProcessorWorker(createGeometry);
+
+ return createGeometry$1;
+
+}));
+//# sourceMappingURL=createGeometry.js.map
diff --git a/examples/cesium/Workers/createGeometry.js.map b/examples/cesium/Workers/createGeometry.js.map
new file mode 100644
index 0000000..37aec37
--- /dev/null
+++ b/examples/cesium/Workers/createGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createGeometry.js","sources":["../../../Source/WorkersES6/createGeometry.js"],"sourcesContent":["/* global require */\r\nimport defined from \"../Core/defined.js\";\r\nimport PrimitivePipeline from \"../Scene/PrimitivePipeline.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nconst moduleCache = {};\r\n\r\nfunction getModule(moduleName) {\r\n let module = moduleCache[moduleName];\r\n if (!defined(module)) {\r\n if (typeof exports === \"object\") {\r\n // Use CommonJS-style require.\r\n moduleCache[module] = module = require(`Workers/${moduleName}`);\r\n } else {\r\n // Use AMD-style require.\r\n // in web workers, require is synchronous\r\n require([`Workers/${moduleName}`], function (f) {\r\n module = f;\r\n moduleCache[module] = f;\r\n });\r\n }\r\n }\r\n return module;\r\n}\r\n\r\nfunction createGeometry(parameters, transferableObjects) {\r\n const subTasks = parameters.subTasks;\r\n const length = subTasks.length;\r\n const resultsOrPromises = new Array(length);\r\n\r\n for (let i = 0; i < length; i++) {\r\n const task = subTasks[i];\r\n const geometry = task.geometry;\r\n const moduleName = task.moduleName;\r\n\r\n if (defined(moduleName)) {\r\n const createFunction = getModule(moduleName);\r\n resultsOrPromises[i] = createFunction(geometry, task.offset);\r\n } else {\r\n //Already created geometry\r\n resultsOrPromises[i] = geometry;\r\n }\r\n }\r\n\r\n return Promise.all(resultsOrPromises).then(function (results) {\r\n return PrimitivePipeline.packCreateGeometryResults(\r\n results,\r\n transferableObjects\r\n );\r\n });\r\n}\r\nexport default createTaskProcessorWorker(createGeometry);\r\n"],"names":["defined","PrimitivePipeline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;AAIA;EACA,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB;EACA,SAAS,SAAS,CAAC,UAAU,EAAE;EAC/B,EAAE,IAAI,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;EACvC,EAAE,IAAI,CAACA,oBAAO,CAAC,MAAM,CAAC,EAAE;EACxB,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;EACrC;EACA,MAAM,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;EACtE,KAAK,MA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iB,CAAC,yBAAyB;EACtD,MAAM,OAAO;EACb,MAAM,mBAAmB;EACzB,KAAK,CAAC;EACN,GAAG,CAAC,CAAC;EACL,CAAC;AACD,yBAAe,yBAAyB,CAAC,cAAc,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createGroundPolylineGeometry.js b/examples/cesium/Workers/createGroundPolylineGeometry.js
new file mode 100644
index 0000000..e65c221
--- /dev/null
+++ b/examples/cesium/Workers/createGroundPolylineGeometry.js
@@ -0,0 +1,2161 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Transforms-11fb6b0a', './Matrix2-036c77dd', './Matrix3-f22b0303', './Check-d10e5f2e', './defaultValue-0ab18f7d', './Math-9be8b918', './ArcType-d608b872', './arrayRemoveDuplicates-c3526030', './ComponentDatatype-13a5630b', './EllipsoidGeodesic-38d0ed4a', './EllipsoidRhumbLine-48b4507b', './EncodedCartesian3-38e2691f', './GeometryAttribute-f2746b95', './IntersectionTests-2c7928de', './Plane-c9f1487d', './WebMercatorProjection-306f7acc', './combine-4598d225', './RuntimeError-e5c6a8b9', './WebGLConstants-f27a5e29'], (function (Transforms, Matrix2, Matrix3, Check, defaultValue, Math$1, ArcType, arrayRemoveDuplicates, ComponentDatatype, EllipsoidGeodesic, EllipsoidRhumbLine, EncodedCartesian3, GeometryAttribute, IntersectionTests, Plane, WebMercatorProjection, combine, RuntimeError, WebGLConstants) { 'use strict';
+
+ /**
+ * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where
+ * longitude and latitude are directly mapped to X and Y. This projection is commonly
+ * known as geographic, equirectangular, equidistant cylindrical, or plate carrée.
+ *
+ * @alias GeographicTilingScheme
+ * @constructor
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to
+ * the WGS84 ellipsoid.
+ * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the tiling scheme.
+ * @param {Number} [options.numberOfLevelZeroTilesX=2] The number of tiles in the X direction at level zero of
+ * the tile tree.
+ * @param {Number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of
+ * the tile tree.
+ */
+ function GeographicTilingScheme(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ this._ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ this._rectangle = defaultValue.defaultValue(options.rectangle, Matrix2.Rectangle.MAX_VALUE);
+ this._projection = new Transforms.GeographicProjection(this._ellipsoid);
+ this._numberOfLevelZeroTilesX = defaultValue.defaultValue(
+ options.numberOfLevelZeroTilesX,
+ 2
+ );
+ this._numberOfLevelZeroTilesY = defaultValue.defaultValue(
+ options.numberOfLevelZeroTilesY,
+ 1
+ );
+ }
+
+ Object.defineProperties(GeographicTilingScheme.prototype, {
+ /**
+ * Gets the ellipsoid that is tiled by this tiling scheme.
+ * @memberof GeographicTilingScheme.prototype
+ * @type {Ellipsoid}
+ */
+ ellipsoid: {
+ get: function () {
+ return this._ellipsoid;
+ },
+ },
+
+ /**
+ * Gets the rectangle, in radians, covered by this tiling scheme.
+ * @memberof GeographicTilingScheme.prototype
+ * @type {Rectangle}
+ */
+ rectangle: {
+ get: function () {
+ return this._rectangle;
+ },
+ },
+
+ /**
+ * Gets the map projection used by this tiling scheme.
+ * @memberof GeographicTilingScheme.prototype
+ * @type {MapProjection}
+ */
+ projection: {
+ get: function () {
+ return this._projection;
+ },
+ },
+ });
+
+ /**
+ * Gets the total number of tiles in the X direction at a specified level-of-detail.
+ *
+ * @param {Number} level The level-of-detail.
+ * @returns {Number} The number of tiles in the X direction at the given level.
+ */
+ GeographicTilingScheme.prototype.getNumberOfXTilesAtLevel = function (level) {
+ return this._numberOfLevelZeroTilesX << level;
+ };
+
+ /**
+ * Gets the total number of tiles in the Y direction at a specified level-of-detail.
+ *
+ * @param {Number} level The level-of-detail.
+ * @returns {Number} The number of tiles in the Y direction at the given level.
+ */
+ GeographicTilingScheme.prototype.getNumberOfYTilesAtLevel = function (level) {
+ return this._numberOfLevelZeroTilesY << level;
+ };
+
+ /**
+ * Transforms a rectangle specified in geodetic radians to the native coordinate system
+ * of this tiling scheme.
+ *
+ * @param {Rectangle} rectangle The rectangle to transform.
+ * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance
+ * should be created.
+ * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result'
+ * is undefined.
+ */
+ GeographicTilingScheme.prototype.rectangleToNativeRectangle = function (
+ rectangle,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("rectangle", rectangle);
+ //>>includeEnd('debug');
+
+ const west = Math$1.CesiumMath.toDegrees(rectangle.west);
+ const south = Math$1.CesiumMath.toDegrees(rectangle.south);
+ const east = Math$1.CesiumMath.toDegrees(rectangle.east);
+ const north = Math$1.CesiumMath.toDegrees(rectangle.north);
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix2.Rectangle(west, south, east, north);
+ }
+
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+ };
+
+ /**
+ * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates
+ * of the tiling scheme.
+ *
+ * @param {Number} x The integer x coordinate of the tile.
+ * @param {Number} y The integer y coordinate of the tile.
+ * @param {Number} level The tile level-of-detail. Zero is the least detailed.
+ * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance
+ * should be created.
+ * @returns {Rectangle} The specified 'result', or a new object containing the rectangle
+ * if 'result' is undefined.
+ */
+ GeographicTilingScheme.prototype.tileXYToNativeRectangle = function (
+ x,
+ y,
+ level,
+ result
+ ) {
+ const rectangleRadians = this.tileXYToRectangle(x, y, level, result);
+ rectangleRadians.west = Math$1.CesiumMath.toDegrees(rectangleRadians.west);
+ rectangleRadians.south = Math$1.CesiumMath.toDegrees(rectangleRadians.south);
+ rectangleRadians.east = Math$1.CesiumMath.toDegrees(rectangleRadians.east);
+ rectangleRadians.north = Math$1.CesiumMath.toDegrees(rectangleRadians.north);
+ return rectangleRadians;
+ };
+
+ /**
+ * Converts tile x, y coordinates and level to a cartographic rectangle in radians.
+ *
+ * @param {Number} x The integer x coordinate of the tile.
+ * @param {Number} y The integer y coordinate of the tile.
+ * @param {Number} level The tile level-of-detail. Zero is the least detailed.
+ * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance
+ * should be created.
+ * @returns {Rectangle} The specified 'result', or a new object containing the rectangle
+ * if 'result' is undefined.
+ */
+ GeographicTilingScheme.prototype.tileXYToRectangle = function (
+ x,
+ y,
+ level,
+ result
+ ) {
+ const rectangle = this._rectangle;
+
+ const xTiles = this.getNumberOfXTilesAtLevel(level);
+ const yTiles = this.getNumberOfYTilesAtLevel(level);
+
+ const xTileWidth = rectangle.width / xTiles;
+ const west = x * xTileWidth + rectangle.west;
+ const east = (x + 1) * xTileWidth + rectangle.west;
+
+ const yTileHeight = rectangle.height / yTiles;
+ const north = rectangle.north - y * yTileHeight;
+ const south = rectangle.north - (y + 1) * yTileHeight;
+
+ if (!defaultValue.defined(result)) {
+ result = new Matrix2.Rectangle(west, south, east, north);
+ }
+
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+ };
+
+ /**
+ * Calculates the tile x, y coordinates of the tile containing
+ * a given cartographic position.
+ *
+ * @param {Cartographic} position The position.
+ * @param {Number} level The tile level-of-detail. Zero is the least detailed.
+ * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance
+ * should be created.
+ * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates
+ * if 'result' is undefined.
+ */
+ GeographicTilingScheme.prototype.positionToTileXY = function (
+ position,
+ level,
+ result
+ ) {
+ const rectangle = this._rectangle;
+ if (!Matrix2.Rectangle.contains(rectangle, position)) {
+ // outside the bounds of the tiling scheme
+ return undefined;
+ }
+
+ const xTiles = this.getNumberOfXTilesAtLevel(level);
+ const yTiles = this.getNumberOfYTilesAtLevel(level);
+
+ const xTileWidth = rectangle.width / xTiles;
+ const yTileHeight = rectangle.height / yTiles;
+
+ let longitude = position.longitude;
+ if (rectangle.east < rectangle.west) {
+ longitude += Math$1.CesiumMath.TWO_PI;
+ }
+
+ let xTileCoordinate = ((longitude - rectangle.west) / xTileWidth) | 0;
+ if (xTileCoordinate >= xTiles) {
+ xTileCoordinate = xTiles - 1;
+ }
+
+ let yTileCoordinate =
+ ((rectangle.north - position.latitude) / yTileHeight) | 0;
+ if (yTileCoordinate >= yTiles) {
+ yTileCoordinate = yTiles - 1;
+ }
+
+ if (!defaultValue.defined(result)) {
+ return new Matrix2.Cartesian2(xTileCoordinate, yTileCoordinate);
+ }
+
+ result.x = xTileCoordinate;
+ result.y = yTileCoordinate;
+ return result;
+ };
+
+ const scratchDiagonalCartesianNE = new Matrix3.Cartesian3();
+ const scratchDiagonalCartesianSW = new Matrix3.Cartesian3();
+ const scratchDiagonalCartographic = new Matrix3.Cartographic();
+ const scratchCenterCartesian = new Matrix3.Cartesian3();
+ const scratchSurfaceCartesian = new Matrix3.Cartesian3();
+
+ const scratchBoundingSphere = new Transforms.BoundingSphere();
+ const tilingScheme = new GeographicTilingScheme();
+ const scratchCorners = [
+ new Matrix3.Cartographic(),
+ new Matrix3.Cartographic(),
+ new Matrix3.Cartographic(),
+ new Matrix3.Cartographic(),
+ ];
+ const scratchTileXY = new Matrix2.Cartesian2();
+
+ /**
+ * A collection of functions for approximating terrain height
+ * @private
+ */
+ const ApproximateTerrainHeights = {};
+
+ /**
+ * Initializes the minimum and maximum terrain heights
+ * @return {Promise.}
+ */
+ ApproximateTerrainHeights.initialize = function () {
+ let initPromise = ApproximateTerrainHeights._initPromise;
+ if (defaultValue.defined(initPromise)) {
+ return initPromise;
+ }
+
+ initPromise = Transforms.Resource.fetchJson(
+ Transforms.buildModuleUrl("Assets/approximateTerrainHeights.json")
+ ).then(function (json) {
+ ApproximateTerrainHeights._terrainHeights = json;
+ });
+ ApproximateTerrainHeights._initPromise = initPromise;
+
+ return initPromise;
+ };
+
+ /**
+ * Computes the minimum and maximum terrain heights for a given rectangle
+ * @param {Rectangle} rectangle The bounding rectangle
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid
+ * @return {{minimumTerrainHeight: Number, maximumTerrainHeight: Number}}
+ */
+ ApproximateTerrainHeights.getMinimumMaximumHeights = function (
+ rectangle,
+ ellipsoid
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("rectangle", rectangle);
+ if (!defaultValue.defined(ApproximateTerrainHeights._terrainHeights)) {
+ throw new Check.DeveloperError(
+ "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function"
+ );
+ }
+ //>>includeEnd('debug');
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+
+ const xyLevel = getTileXYLevel(rectangle);
+
+ // Get the terrain min/max for that tile
+ let minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;
+ let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;
+ if (defaultValue.defined(xyLevel)) {
+ const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;
+ const heights = ApproximateTerrainHeights._terrainHeights[key];
+ if (defaultValue.defined(heights)) {
+ minTerrainHeight = heights[0];
+ maxTerrainHeight = heights[1];
+ }
+
+ // Compute min by taking the center of the NE->SW diagonal and finding distance to the surface
+ ellipsoid.cartographicToCartesian(
+ Matrix2.Rectangle.northeast(rectangle, scratchDiagonalCartographic),
+ scratchDiagonalCartesianNE
+ );
+ ellipsoid.cartographicToCartesian(
+ Matrix2.Rectangle.southwest(rectangle, scratchDiagonalCartographic),
+ scratchDiagonalCartesianSW
+ );
+
+ Matrix3.Cartesian3.midpoint(
+ scratchDiagonalCartesianSW,
+ scratchDiagonalCartesianNE,
+ scratchCenterCartesian
+ );
+ const surfacePosition = ellipsoid.scaleToGeodeticSurface(
+ scratchCenterCartesian,
+ scratchSurfaceCartesian
+ );
+ if (defaultValue.defined(surfacePosition)) {
+ const distance = Matrix3.Cartesian3.distance(
+ scratchCenterCartesian,
+ surfacePosition
+ );
+ minTerrainHeight = Math.min(minTerrainHeight, -distance);
+ } else {
+ minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;
+ }
+ }
+
+ minTerrainHeight = Math.max(
+ ApproximateTerrainHeights._defaultMinTerrainHeight,
+ minTerrainHeight
+ );
+
+ return {
+ minimumTerrainHeight: minTerrainHeight,
+ maximumTerrainHeight: maxTerrainHeight,
+ };
+ };
+
+ /**
+ * Computes the bounding sphere based on the tile heights in the rectangle
+ * @param {Rectangle} rectangle The bounding rectangle
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid
+ * @return {BoundingSphere} The result bounding sphere
+ */
+ ApproximateTerrainHeights.getBoundingSphere = function (rectangle, ellipsoid) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("rectangle", rectangle);
+ if (!defaultValue.defined(ApproximateTerrainHeights._terrainHeights)) {
+ throw new Check.DeveloperError(
+ "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function"
+ );
+ }
+ //>>includeEnd('debug');
+ ellipsoid = defaultValue.defaultValue(ellipsoid, Matrix3.Ellipsoid.WGS84);
+
+ const xyLevel = getTileXYLevel(rectangle);
+
+ // Get the terrain max for that tile
+ let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;
+ if (defaultValue.defined(xyLevel)) {
+ const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;
+ const heights = ApproximateTerrainHeights._terrainHeights[key];
+ if (defaultValue.defined(heights)) {
+ maxTerrainHeight = heights[1];
+ }
+ }
+
+ const result = Transforms.BoundingSphere.fromRectangle3D(rectangle, ellipsoid, 0.0);
+ Transforms.BoundingSphere.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ maxTerrainHeight,
+ scratchBoundingSphere
+ );
+
+ return Transforms.BoundingSphere.union(result, scratchBoundingSphere, result);
+ };
+
+ function getTileXYLevel(rectangle) {
+ Matrix3.Cartographic.fromRadians(
+ rectangle.east,
+ rectangle.north,
+ 0.0,
+ scratchCorners[0]
+ );
+ Matrix3.Cartographic.fromRadians(
+ rectangle.west,
+ rectangle.north,
+ 0.0,
+ scratchCorners[1]
+ );
+ Matrix3.Cartographic.fromRadians(
+ rectangle.east,
+ rectangle.south,
+ 0.0,
+ scratchCorners[2]
+ );
+ Matrix3.Cartographic.fromRadians(
+ rectangle.west,
+ rectangle.south,
+ 0.0,
+ scratchCorners[3]
+ );
+
+ // Determine which tile the bounding rectangle is in
+ let lastLevelX = 0,
+ lastLevelY = 0;
+ let currentX = 0,
+ currentY = 0;
+ const maxLevel = ApproximateTerrainHeights._terrainHeightsMaxLevel;
+ let i;
+ for (i = 0; i <= maxLevel; ++i) {
+ let failed = false;
+ for (let j = 0; j < 4; ++j) {
+ const corner = scratchCorners[j];
+ tilingScheme.positionToTileXY(corner, i, scratchTileXY);
+ if (j === 0) {
+ currentX = scratchTileXY.x;
+ currentY = scratchTileXY.y;
+ } else if (currentX !== scratchTileXY.x || currentY !== scratchTileXY.y) {
+ failed = true;
+ break;
+ }
+ }
+
+ if (failed) {
+ break;
+ }
+
+ lastLevelX = currentX;
+ lastLevelY = currentY;
+ }
+
+ if (i === 0) {
+ return undefined;
+ }
+
+ return {
+ x: lastLevelX,
+ y: lastLevelY,
+ level: i > maxLevel ? maxLevel : i - 1,
+ };
+ }
+
+ ApproximateTerrainHeights._terrainHeightsMaxLevel = 6;
+ ApproximateTerrainHeights._defaultMaxTerrainHeight = 9000.0;
+ ApproximateTerrainHeights._defaultMinTerrainHeight = -100000.0;
+ ApproximateTerrainHeights._terrainHeights = undefined;
+ ApproximateTerrainHeights._initPromise = undefined;
+
+ Object.defineProperties(ApproximateTerrainHeights, {
+ /**
+ * Determines if the terrain heights are initialized and ready to use. To initialize the terrain heights,
+ * call {@link ApproximateTerrainHeights#initialize} and wait for the returned promise to resolve.
+ * @type {Boolean}
+ * @readonly
+ * @memberof ApproximateTerrainHeights
+ */
+ initialized: {
+ get: function () {
+ return defaultValue.defined(ApproximateTerrainHeights._terrainHeights);
+ },
+ },
+ });
+ var ApproximateTerrainHeights$1 = ApproximateTerrainHeights;
+
+ const PROJECTIONS = [Transforms.GeographicProjection, WebMercatorProjection.WebMercatorProjection];
+ const PROJECTION_COUNT = PROJECTIONS.length;
+
+ const MITER_BREAK_SMALL = Math.cos(Math$1.CesiumMath.toRadians(30.0));
+ const MITER_BREAK_LARGE = Math.cos(Math$1.CesiumMath.toRadians(150.0));
+
+ // Initial heights for constructing the wall.
+ // Keeping WALL_INITIAL_MIN_HEIGHT near the ellipsoid surface helps
+ // prevent precision problems with planes in the shader.
+ // Putting the start point of a plane at ApproximateTerrainHeights._defaultMinTerrainHeight,
+ // which is a highly conservative bound, usually puts the plane origin several thousands
+ // of meters away from the actual terrain, causing floating point problems when checking
+ // fragments on terrain against the plane.
+ // Ellipsoid height is generally much closer.
+ // The initial max height is arbitrary.
+ // Both heights are corrected using ApproximateTerrainHeights for computing the actual volume geometry.
+ const WALL_INITIAL_MIN_HEIGHT = 0.0;
+ const WALL_INITIAL_MAX_HEIGHT = 1000.0;
+
+ /**
+ * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.
+ *
+ * @alias GroundPolylineGeometry
+ * @constructor
+ *
+ * @param {Object} options Options with the following properties:
+ * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.
+ * @param {Number} [options.width=1.0] The screen space width in pixels.
+ * @param {Number} [options.granularity=9999.0] The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
+ * @param {Boolean} [options.loop=false] Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
+ * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
+ *
+ * @exception {DeveloperError} At least two positions are required.
+ *
+ * @see GroundPolylinePrimitive
+ *
+ * @example
+ * const positions = Cesium.Cartesian3.fromDegreesArray([
+ * -112.1340164450331, 36.05494287836128,
+ * -112.08821010582645, 36.097804071380715,
+ * -112.13296079730024, 36.168769146801104
+ * ]);
+ *
+ * const geometry = new Cesium.GroundPolylineGeometry({
+ * positions : positions
+ * });
+ */
+ function GroundPolylineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const positions = options.positions;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(positions) || positions.length < 2) {
+ throw new Check.DeveloperError("At least two positions are required.");
+ }
+ if (
+ defaultValue.defined(options.arcType) &&
+ options.arcType !== ArcType.ArcType.GEODESIC &&
+ options.arcType !== ArcType.ArcType.RHUMB
+ ) {
+ throw new Check.DeveloperError(
+ "Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB."
+ );
+ }
+ //>>includeEnd('debug');
+
+ /**
+ * The screen space width in pixels.
+ * @type {Number}
+ */
+ this.width = defaultValue.defaultValue(options.width, 1.0); // Doesn't get packed, not necessary for computing geometry.
+
+ this._positions = positions;
+
+ /**
+ * The distance interval used for interpolating options.points. Zero indicates no interpolation.
+ * Default of 9999.0 allows centimeter accuracy with 32 bit floating point.
+ * @type {Boolean}
+ * @default 9999.0
+ */
+ this.granularity = defaultValue.defaultValue(options.granularity, 9999.0);
+
+ /**
+ * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
+ * If the geometry has two positions this parameter will be ignored.
+ * @type {Boolean}
+ * @default false
+ */
+ this.loop = defaultValue.defaultValue(options.loop, false);
+
+ /**
+ * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
+ * @type {ArcType}
+ * @default ArcType.GEODESIC
+ */
+ this.arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
+
+ this._ellipsoid = Matrix3.Ellipsoid.WGS84;
+
+ // MapProjections can't be packed, so store the index to a known MapProjection.
+ this._projectionIndex = 0;
+ this._workerName = "createGroundPolylineGeometry";
+
+ // Used by GroundPolylinePrimitive to signal worker that scenemode is 3D only.
+ this._scene3DOnly = false;
+ }
+
+ Object.defineProperties(GroundPolylineGeometry.prototype, {
+ /**
+ * The number of elements used to pack the object into an array.
+ * @memberof GroundPolylineGeometry.prototype
+ * @type {Number}
+ * @readonly
+ * @private
+ */
+ packedLength: {
+ get: function () {
+ return (
+ 1.0 +
+ this._positions.length * 3 +
+ 1.0 +
+ 1.0 +
+ 1.0 +
+ Matrix3.Ellipsoid.packedLength +
+ 1.0 +
+ 1.0
+ );
+ },
+ },
+ });
+
+ /**
+ * Set the GroundPolylineGeometry's projection and ellipsoid.
+ * Used by GroundPolylinePrimitive to signal scene information to the geometry for generating 2D attributes.
+ *
+ * @param {GroundPolylineGeometry} groundPolylineGeometry GroundPolylinGeometry describing a polyline on terrain or 3D Tiles.
+ * @param {Projection} mapProjection A MapProjection used for projecting cartographic coordinates to 2D.
+ * @private
+ */
+ GroundPolylineGeometry.setProjectionAndEllipsoid = function (
+ groundPolylineGeometry,
+ mapProjection
+ ) {
+ let projectionIndex = 0;
+ for (let i = 0; i < PROJECTION_COUNT; i++) {
+ if (mapProjection instanceof PROJECTIONS[i]) {
+ projectionIndex = i;
+ break;
+ }
+ }
+
+ groundPolylineGeometry._projectionIndex = projectionIndex;
+ groundPolylineGeometry._ellipsoid = mapProjection.ellipsoid;
+ };
+
+ const cart3Scratch1 = new Matrix3.Cartesian3();
+ const cart3Scratch2 = new Matrix3.Cartesian3();
+ const cart3Scratch3 = new Matrix3.Cartesian3();
+ function computeRightNormal(start, end, maxHeight, ellipsoid, result) {
+ const startBottom = getPosition(ellipsoid, start, 0.0, cart3Scratch1);
+ const startTop = getPosition(ellipsoid, start, maxHeight, cart3Scratch2);
+ const endBottom = getPosition(ellipsoid, end, 0.0, cart3Scratch3);
+
+ const up = direction(startTop, startBottom, cart3Scratch2);
+ const forward = direction(endBottom, startBottom, cart3Scratch3);
+
+ Matrix3.Cartesian3.cross(forward, up, result);
+ return Matrix3.Cartesian3.normalize(result, result);
+ }
+
+ const interpolatedCartographicScratch = new Matrix3.Cartographic();
+ const interpolatedBottomScratch = new Matrix3.Cartesian3();
+ const interpolatedTopScratch = new Matrix3.Cartesian3();
+ const interpolatedNormalScratch = new Matrix3.Cartesian3();
+ function interpolateSegment(
+ start,
+ end,
+ minHeight,
+ maxHeight,
+ granularity,
+ arcType,
+ ellipsoid,
+ normalsArray,
+ bottomPositionsArray,
+ topPositionsArray,
+ cartographicsArray
+ ) {
+ if (granularity === 0.0) {
+ return;
+ }
+
+ let ellipsoidLine;
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ ellipsoidLine = new EllipsoidGeodesic.EllipsoidGeodesic(start, end, ellipsoid);
+ } else if (arcType === ArcType.ArcType.RHUMB) {
+ ellipsoidLine = new EllipsoidRhumbLine.EllipsoidRhumbLine(start, end, ellipsoid);
+ }
+
+ const surfaceDistance = ellipsoidLine.surfaceDistance;
+ if (surfaceDistance < granularity) {
+ return;
+ }
+
+ // Compute rightwards normal applicable at all interpolated points
+ const interpolatedNormal = computeRightNormal(
+ start,
+ end,
+ maxHeight,
+ ellipsoid,
+ interpolatedNormalScratch
+ );
+
+ const segments = Math.ceil(surfaceDistance / granularity);
+ const interpointDistance = surfaceDistance / segments;
+ let distanceFromStart = interpointDistance;
+ const pointsToAdd = segments - 1;
+ let packIndex = normalsArray.length;
+ for (let i = 0; i < pointsToAdd; i++) {
+ const interpolatedCartographic = ellipsoidLine.interpolateUsingSurfaceDistance(
+ distanceFromStart,
+ interpolatedCartographicScratch
+ );
+ const interpolatedBottom = getPosition(
+ ellipsoid,
+ interpolatedCartographic,
+ minHeight,
+ interpolatedBottomScratch
+ );
+ const interpolatedTop = getPosition(
+ ellipsoid,
+ interpolatedCartographic,
+ maxHeight,
+ interpolatedTopScratch
+ );
+
+ Matrix3.Cartesian3.pack(interpolatedNormal, normalsArray, packIndex);
+ Matrix3.Cartesian3.pack(interpolatedBottom, bottomPositionsArray, packIndex);
+ Matrix3.Cartesian3.pack(interpolatedTop, topPositionsArray, packIndex);
+ cartographicsArray.push(interpolatedCartographic.latitude);
+ cartographicsArray.push(interpolatedCartographic.longitude);
+
+ packIndex += 3;
+ distanceFromStart += interpointDistance;
+ }
+ }
+
+ const heightlessCartographicScratch = new Matrix3.Cartographic();
+ function getPosition(ellipsoid, cartographic, height, result) {
+ Matrix3.Cartographic.clone(cartographic, heightlessCartographicScratch);
+ heightlessCartographicScratch.height = height;
+ return Matrix3.Cartographic.toCartesian(
+ heightlessCartographicScratch,
+ ellipsoid,
+ result
+ );
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {PolygonGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ GroundPolylineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ let index = defaultValue.defaultValue(startingIndex, 0);
+
+ const positions = value._positions;
+ const positionsLength = positions.length;
+
+ array[index++] = positionsLength;
+
+ for (let i = 0; i < positionsLength; ++i) {
+ const cartesian = positions[i];
+ Matrix3.Cartesian3.pack(cartesian, array, index);
+ index += 3;
+ }
+
+ array[index++] = value.granularity;
+ array[index++] = value.loop ? 1.0 : 0.0;
+ array[index++] = value.arcType;
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, index);
+ index += Matrix3.Ellipsoid.packedLength;
+
+ array[index++] = value._projectionIndex;
+ array[index++] = value._scene3DOnly ? 1.0 : 0.0;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {PolygonGeometry} [result] The object into which to store the result.
+ */
+ GroundPolylineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ let index = defaultValue.defaultValue(startingIndex, 0);
+ const positionsLength = array[index++];
+ const positions = new Array(positionsLength);
+
+ for (let i = 0; i < positionsLength; i++) {
+ positions[i] = Matrix3.Cartesian3.unpack(array, index);
+ index += 3;
+ }
+
+ const granularity = array[index++];
+ const loop = array[index++] === 1.0;
+ const arcType = array[index++];
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, index);
+ index += Matrix3.Ellipsoid.packedLength;
+
+ const projectionIndex = array[index++];
+ const scene3DOnly = array[index++] === 1.0;
+
+ if (!defaultValue.defined(result)) {
+ result = new GroundPolylineGeometry({
+ positions: positions,
+ });
+ }
+
+ result._positions = positions;
+ result.granularity = granularity;
+ result.loop = loop;
+ result.arcType = arcType;
+ result._ellipsoid = ellipsoid;
+ result._projectionIndex = projectionIndex;
+ result._scene3DOnly = scene3DOnly;
+
+ return result;
+ };
+
+ function direction(target, origin, result) {
+ Matrix3.Cartesian3.subtract(target, origin, result);
+ Matrix3.Cartesian3.normalize(result, result);
+ return result;
+ }
+
+ function tangentDirection(target, origin, up, result) {
+ result = direction(target, origin, result);
+
+ // orthogonalize
+ result = Matrix3.Cartesian3.cross(result, up, result);
+ result = Matrix3.Cartesian3.normalize(result, result);
+ result = Matrix3.Cartesian3.cross(up, result, result);
+ return result;
+ }
+
+ const toPreviousScratch = new Matrix3.Cartesian3();
+ const toNextScratch = new Matrix3.Cartesian3();
+ const forwardScratch = new Matrix3.Cartesian3();
+ const vertexUpScratch = new Matrix3.Cartesian3();
+ const cosine90 = 0.0;
+ const cosine180 = -1.0;
+ function computeVertexMiterNormal(
+ previousBottom,
+ vertexBottom,
+ vertexTop,
+ nextBottom,
+ result
+ ) {
+ const up = direction(vertexTop, vertexBottom, vertexUpScratch);
+
+ // Compute vectors pointing towards neighboring points but tangent to this point on the ellipsoid
+ const toPrevious = tangentDirection(
+ previousBottom,
+ vertexBottom,
+ up,
+ toPreviousScratch
+ );
+ const toNext = tangentDirection(nextBottom, vertexBottom, up, toNextScratch);
+
+ // Check if tangents are almost opposite - if so, no need to miter.
+ if (
+ Math$1.CesiumMath.equalsEpsilon(
+ Matrix3.Cartesian3.dot(toPrevious, toNext),
+ cosine180,
+ Math$1.CesiumMath.EPSILON5
+ )
+ ) {
+ result = Matrix3.Cartesian3.cross(up, toPrevious, result);
+ result = Matrix3.Cartesian3.normalize(result, result);
+ return result;
+ }
+
+ // Average directions to previous and to next in the plane of Up
+ result = Matrix3.Cartesian3.add(toNext, toPrevious, result);
+ result = Matrix3.Cartesian3.normalize(result, result);
+
+ // Flip the normal if it isn't pointing roughly bound right (aka if forward is pointing more "backwards")
+ const forward = Matrix3.Cartesian3.cross(up, result, forwardScratch);
+ if (Matrix3.Cartesian3.dot(toNext, forward) < cosine90) {
+ result = Matrix3.Cartesian3.negate(result, result);
+ }
+
+ return result;
+ }
+
+ const XZ_PLANE = Plane.Plane.fromPointNormal(Matrix3.Cartesian3.ZERO, Matrix3.Cartesian3.UNIT_Y);
+
+ const previousBottomScratch = new Matrix3.Cartesian3();
+ const vertexBottomScratch = new Matrix3.Cartesian3();
+ const vertexTopScratch = new Matrix3.Cartesian3();
+ const nextBottomScratch = new Matrix3.Cartesian3();
+ const vertexNormalScratch = new Matrix3.Cartesian3();
+ const intersectionScratch = new Matrix3.Cartesian3();
+ const cartographicScratch0 = new Matrix3.Cartographic();
+ const cartographicScratch1 = new Matrix3.Cartographic();
+ const cartographicIntersectionScratch = new Matrix3.Cartographic();
+ /**
+ * Computes shadow volumes for the ground polyline, consisting of its vertices, indices, and a bounding sphere.
+ * Vertices are "fat," packing all the data needed in each volume to describe a line on terrain or 3D Tiles.
+ * Should not be called independent of {@link GroundPolylinePrimitive}.
+ *
+ * @param {GroundPolylineGeometry} groundPolylineGeometry
+ * @private
+ */
+ GroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) {
+ const compute2dAttributes = !groundPolylineGeometry._scene3DOnly;
+ let loop = groundPolylineGeometry.loop;
+ const ellipsoid = groundPolylineGeometry._ellipsoid;
+ const granularity = groundPolylineGeometry.granularity;
+ const arcType = groundPolylineGeometry.arcType;
+ const projection = new PROJECTIONS[groundPolylineGeometry._projectionIndex](
+ ellipsoid
+ );
+
+ const minHeight = WALL_INITIAL_MIN_HEIGHT;
+ const maxHeight = WALL_INITIAL_MAX_HEIGHT;
+
+ let index;
+ let i;
+
+ const positions = groundPolylineGeometry._positions;
+ const positionsLength = positions.length;
+
+ if (positionsLength === 2) {
+ loop = false;
+ }
+
+ // Split positions across the IDL and the Prime Meridian as well.
+ // Split across prime meridian because very large geometries crossing the Prime Meridian but not the IDL
+ // may get split by the plane of IDL + Prime Meridian.
+ let p0;
+ let p1;
+ let c0;
+ let c1;
+ const rhumbLine = new EllipsoidRhumbLine.EllipsoidRhumbLine(undefined, undefined, ellipsoid);
+ let intersection;
+ let intersectionCartographic;
+ let intersectionLongitude;
+ const splitPositions = [positions[0]];
+ for (i = 0; i < positionsLength - 1; i++) {
+ p0 = positions[i];
+ p1 = positions[i + 1];
+ intersection = IntersectionTests.IntersectionTests.lineSegmentPlane(
+ p0,
+ p1,
+ XZ_PLANE,
+ intersectionScratch
+ );
+ if (
+ defaultValue.defined(intersection) &&
+ !Matrix3.Cartesian3.equalsEpsilon(intersection, p0, Math$1.CesiumMath.EPSILON7) &&
+ !Matrix3.Cartesian3.equalsEpsilon(intersection, p1, Math$1.CesiumMath.EPSILON7)
+ ) {
+ if (groundPolylineGeometry.arcType === ArcType.ArcType.GEODESIC) {
+ splitPositions.push(Matrix3.Cartesian3.clone(intersection));
+ } else if (groundPolylineGeometry.arcType === ArcType.ArcType.RHUMB) {
+ intersectionLongitude = ellipsoid.cartesianToCartographic(
+ intersection,
+ cartographicScratch0
+ ).longitude;
+ c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);
+ c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);
+ rhumbLine.setEndPoints(c0, c1);
+ intersectionCartographic = rhumbLine.findIntersectionWithLongitude(
+ intersectionLongitude,
+ cartographicIntersectionScratch
+ );
+ intersection = ellipsoid.cartographicToCartesian(
+ intersectionCartographic,
+ intersectionScratch
+ );
+ if (
+ defaultValue.defined(intersection) &&
+ !Matrix3.Cartesian3.equalsEpsilon(intersection, p0, Math$1.CesiumMath.EPSILON7) &&
+ !Matrix3.Cartesian3.equalsEpsilon(intersection, p1, Math$1.CesiumMath.EPSILON7)
+ ) {
+ splitPositions.push(Matrix3.Cartesian3.clone(intersection));
+ }
+ }
+ }
+ splitPositions.push(p1);
+ }
+
+ if (loop) {
+ p0 = positions[positionsLength - 1];
+ p1 = positions[0];
+ intersection = IntersectionTests.IntersectionTests.lineSegmentPlane(
+ p0,
+ p1,
+ XZ_PLANE,
+ intersectionScratch
+ );
+ if (
+ defaultValue.defined(intersection) &&
+ !Matrix3.Cartesian3.equalsEpsilon(intersection, p0, Math$1.CesiumMath.EPSILON7) &&
+ !Matrix3.Cartesian3.equalsEpsilon(intersection, p1, Math$1.CesiumMath.EPSILON7)
+ ) {
+ if (groundPolylineGeometry.arcType === ArcType.ArcType.GEODESIC) {
+ splitPositions.push(Matrix3.Cartesian3.clone(intersection));
+ } else if (groundPolylineGeometry.arcType === ArcType.ArcType.RHUMB) {
+ intersectionLongitude = ellipsoid.cartesianToCartographic(
+ intersection,
+ cartographicScratch0
+ ).longitude;
+ c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);
+ c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);
+ rhumbLine.setEndPoints(c0, c1);
+ intersectionCartographic = rhumbLine.findIntersectionWithLongitude(
+ intersectionLongitude,
+ cartographicIntersectionScratch
+ );
+ intersection = ellipsoid.cartographicToCartesian(
+ intersectionCartographic,
+ intersectionScratch
+ );
+ if (
+ defaultValue.defined(intersection) &&
+ !Matrix3.Cartesian3.equalsEpsilon(intersection, p0, Math$1.CesiumMath.EPSILON7) &&
+ !Matrix3.Cartesian3.equalsEpsilon(intersection, p1, Math$1.CesiumMath.EPSILON7)
+ ) {
+ splitPositions.push(Matrix3.Cartesian3.clone(intersection));
+ }
+ }
+ }
+ }
+ let cartographicsLength = splitPositions.length;
+
+ let cartographics = new Array(cartographicsLength);
+ for (i = 0; i < cartographicsLength; i++) {
+ const cartographic = Matrix3.Cartographic.fromCartesian(
+ splitPositions[i],
+ ellipsoid
+ );
+ cartographic.height = 0.0;
+ cartographics[i] = cartographic;
+ }
+
+ cartographics = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ cartographics,
+ Matrix3.Cartographic.equalsEpsilon
+ );
+ cartographicsLength = cartographics.length;
+
+ if (cartographicsLength < 2) {
+ return undefined;
+ }
+
+ /**** Build heap-side arrays for positions, interpolated cartographics, and normals from which to compute vertices ****/
+ // We build a "wall" and then decompose it into separately connected component "volumes" because we need a lot
+ // of information about the wall. Also, this simplifies interpolation.
+ // Convention: "next" and "end" are locally forward to each segment of the wall,
+ // and we are computing normals pointing towards the local right side of the vertices in each segment.
+ const cartographicsArray = [];
+ const normalsArray = [];
+ const bottomPositionsArray = [];
+ const topPositionsArray = [];
+
+ let previousBottom = previousBottomScratch;
+ let vertexBottom = vertexBottomScratch;
+ let vertexTop = vertexTopScratch;
+ let nextBottom = nextBottomScratch;
+ let vertexNormal = vertexNormalScratch;
+
+ // First point - either loop or attach a "perpendicular" normal
+ const startCartographic = cartographics[0];
+ const nextCartographic = cartographics[1];
+
+ const prestartCartographic = cartographics[cartographicsLength - 1];
+ previousBottom = getPosition(
+ ellipsoid,
+ prestartCartographic,
+ minHeight,
+ previousBottom
+ );
+ nextBottom = getPosition(ellipsoid, nextCartographic, minHeight, nextBottom);
+ vertexBottom = getPosition(
+ ellipsoid,
+ startCartographic,
+ minHeight,
+ vertexBottom
+ );
+ vertexTop = getPosition(ellipsoid, startCartographic, maxHeight, vertexTop);
+
+ if (loop) {
+ vertexNormal = computeVertexMiterNormal(
+ previousBottom,
+ vertexBottom,
+ vertexTop,
+ nextBottom,
+ vertexNormal
+ );
+ } else {
+ vertexNormal = computeRightNormal(
+ startCartographic,
+ nextCartographic,
+ maxHeight,
+ ellipsoid,
+ vertexNormal
+ );
+ }
+
+ Matrix3.Cartesian3.pack(vertexNormal, normalsArray, 0);
+ Matrix3.Cartesian3.pack(vertexBottom, bottomPositionsArray, 0);
+ Matrix3.Cartesian3.pack(vertexTop, topPositionsArray, 0);
+ cartographicsArray.push(startCartographic.latitude);
+ cartographicsArray.push(startCartographic.longitude);
+
+ interpolateSegment(
+ startCartographic,
+ nextCartographic,
+ minHeight,
+ maxHeight,
+ granularity,
+ arcType,
+ ellipsoid,
+ normalsArray,
+ bottomPositionsArray,
+ topPositionsArray,
+ cartographicsArray
+ );
+
+ // All inbetween points
+ for (i = 1; i < cartographicsLength - 1; ++i) {
+ previousBottom = Matrix3.Cartesian3.clone(vertexBottom, previousBottom);
+ vertexBottom = Matrix3.Cartesian3.clone(nextBottom, vertexBottom);
+ const vertexCartographic = cartographics[i];
+ getPosition(ellipsoid, vertexCartographic, maxHeight, vertexTop);
+ getPosition(ellipsoid, cartographics[i + 1], minHeight, nextBottom);
+
+ computeVertexMiterNormal(
+ previousBottom,
+ vertexBottom,
+ vertexTop,
+ nextBottom,
+ vertexNormal
+ );
+
+ index = normalsArray.length;
+ Matrix3.Cartesian3.pack(vertexNormal, normalsArray, index);
+ Matrix3.Cartesian3.pack(vertexBottom, bottomPositionsArray, index);
+ Matrix3.Cartesian3.pack(vertexTop, topPositionsArray, index);
+ cartographicsArray.push(vertexCartographic.latitude);
+ cartographicsArray.push(vertexCartographic.longitude);
+
+ interpolateSegment(
+ cartographics[i],
+ cartographics[i + 1],
+ minHeight,
+ maxHeight,
+ granularity,
+ arcType,
+ ellipsoid,
+ normalsArray,
+ bottomPositionsArray,
+ topPositionsArray,
+ cartographicsArray
+ );
+ }
+
+ // Last point - either loop or attach a normal "perpendicular" to the wall.
+ const endCartographic = cartographics[cartographicsLength - 1];
+ const preEndCartographic = cartographics[cartographicsLength - 2];
+
+ vertexBottom = getPosition(
+ ellipsoid,
+ endCartographic,
+ minHeight,
+ vertexBottom
+ );
+ vertexTop = getPosition(ellipsoid, endCartographic, maxHeight, vertexTop);
+
+ if (loop) {
+ const postEndCartographic = cartographics[0];
+ previousBottom = getPosition(
+ ellipsoid,
+ preEndCartographic,
+ minHeight,
+ previousBottom
+ );
+ nextBottom = getPosition(
+ ellipsoid,
+ postEndCartographic,
+ minHeight,
+ nextBottom
+ );
+
+ vertexNormal = computeVertexMiterNormal(
+ previousBottom,
+ vertexBottom,
+ vertexTop,
+ nextBottom,
+ vertexNormal
+ );
+ } else {
+ vertexNormal = computeRightNormal(
+ preEndCartographic,
+ endCartographic,
+ maxHeight,
+ ellipsoid,
+ vertexNormal
+ );
+ }
+
+ index = normalsArray.length;
+ Matrix3.Cartesian3.pack(vertexNormal, normalsArray, index);
+ Matrix3.Cartesian3.pack(vertexBottom, bottomPositionsArray, index);
+ Matrix3.Cartesian3.pack(vertexTop, topPositionsArray, index);
+ cartographicsArray.push(endCartographic.latitude);
+ cartographicsArray.push(endCartographic.longitude);
+
+ if (loop) {
+ interpolateSegment(
+ endCartographic,
+ startCartographic,
+ minHeight,
+ maxHeight,
+ granularity,
+ arcType,
+ ellipsoid,
+ normalsArray,
+ bottomPositionsArray,
+ topPositionsArray,
+ cartographicsArray
+ );
+ index = normalsArray.length;
+ for (i = 0; i < 3; ++i) {
+ normalsArray[index + i] = normalsArray[i];
+ bottomPositionsArray[index + i] = bottomPositionsArray[i];
+ topPositionsArray[index + i] = topPositionsArray[i];
+ }
+ cartographicsArray.push(startCartographic.latitude);
+ cartographicsArray.push(startCartographic.longitude);
+ }
+
+ return generateGeometryAttributes(
+ loop,
+ projection,
+ bottomPositionsArray,
+ topPositionsArray,
+ normalsArray,
+ cartographicsArray,
+ compute2dAttributes
+ );
+ };
+
+ // If the end normal angle is too steep compared to the direction of the line segment,
+ // "break" the miter by rotating the normal 90 degrees around the "up" direction at the point
+ // For ultra precision we would want to project into a plane, but in practice this is sufficient.
+ const lineDirectionScratch = new Matrix3.Cartesian3();
+ const matrix3Scratch = new Matrix3.Matrix3();
+ const quaternionScratch = new Transforms.Quaternion();
+ function breakMiter(endGeometryNormal, startBottom, endBottom, endTop) {
+ const lineDirection = direction(endBottom, startBottom, lineDirectionScratch);
+
+ const dot = Matrix3.Cartesian3.dot(lineDirection, endGeometryNormal);
+ if (dot > MITER_BREAK_SMALL || dot < MITER_BREAK_LARGE) {
+ const vertexUp = direction(endTop, endBottom, vertexUpScratch);
+ const angle =
+ dot < MITER_BREAK_LARGE
+ ? Math$1.CesiumMath.PI_OVER_TWO
+ : -Math$1.CesiumMath.PI_OVER_TWO;
+ const quaternion = Transforms.Quaternion.fromAxisAngle(
+ vertexUp,
+ angle,
+ quaternionScratch
+ );
+ const rotationMatrix = Matrix3.Matrix3.fromQuaternion(quaternion, matrix3Scratch);
+ Matrix3.Matrix3.multiplyByVector(
+ rotationMatrix,
+ endGeometryNormal,
+ endGeometryNormal
+ );
+ return true;
+ }
+ return false;
+ }
+
+ const endPosCartographicScratch = new Matrix3.Cartographic();
+ const normalStartpointScratch = new Matrix3.Cartesian3();
+ const normalEndpointScratch = new Matrix3.Cartesian3();
+ function projectNormal(
+ projection,
+ cartographic,
+ normal,
+ projectedPosition,
+ result
+ ) {
+ const position = Matrix3.Cartographic.toCartesian(
+ cartographic,
+ projection._ellipsoid,
+ normalStartpointScratch
+ );
+ let normalEndpoint = Matrix3.Cartesian3.add(position, normal, normalEndpointScratch);
+ let flipNormal = false;
+
+ const ellipsoid = projection._ellipsoid;
+ let normalEndpointCartographic = ellipsoid.cartesianToCartographic(
+ normalEndpoint,
+ endPosCartographicScratch
+ );
+ // If normal crosses the IDL, go the other way and flip the result.
+ // In practice this almost never happens because the cartographic start
+ // and end points of each segment are "nudged" to be on the same side
+ // of the IDL and slightly away from the IDL.
+ if (
+ Math.abs(cartographic.longitude - normalEndpointCartographic.longitude) >
+ Math$1.CesiumMath.PI_OVER_TWO
+ ) {
+ flipNormal = true;
+ normalEndpoint = Matrix3.Cartesian3.subtract(
+ position,
+ normal,
+ normalEndpointScratch
+ );
+ normalEndpointCartographic = ellipsoid.cartesianToCartographic(
+ normalEndpoint,
+ endPosCartographicScratch
+ );
+ }
+
+ normalEndpointCartographic.height = 0.0;
+ const normalEndpointProjected = projection.project(
+ normalEndpointCartographic,
+ result
+ );
+ result = Matrix3.Cartesian3.subtract(
+ normalEndpointProjected,
+ projectedPosition,
+ result
+ );
+ result.z = 0.0;
+ result = Matrix3.Cartesian3.normalize(result, result);
+ if (flipNormal) {
+ Matrix3.Cartesian3.negate(result, result);
+ }
+ return result;
+ }
+
+ const adjustHeightNormalScratch = new Matrix3.Cartesian3();
+ const adjustHeightOffsetScratch = new Matrix3.Cartesian3();
+ function adjustHeights(
+ bottom,
+ top,
+ minHeight,
+ maxHeight,
+ adjustHeightBottom,
+ adjustHeightTop
+ ) {
+ // bottom and top should be at WALL_INITIAL_MIN_HEIGHT and WALL_INITIAL_MAX_HEIGHT, respectively
+ const adjustHeightNormal = Matrix3.Cartesian3.subtract(
+ top,
+ bottom,
+ adjustHeightNormalScratch
+ );
+ Matrix3.Cartesian3.normalize(adjustHeightNormal, adjustHeightNormal);
+
+ const distanceForBottom = minHeight - WALL_INITIAL_MIN_HEIGHT;
+ let adjustHeightOffset = Matrix3.Cartesian3.multiplyByScalar(
+ adjustHeightNormal,
+ distanceForBottom,
+ adjustHeightOffsetScratch
+ );
+ Matrix3.Cartesian3.add(bottom, adjustHeightOffset, adjustHeightBottom);
+
+ const distanceForTop = maxHeight - WALL_INITIAL_MAX_HEIGHT;
+ adjustHeightOffset = Matrix3.Cartesian3.multiplyByScalar(
+ adjustHeightNormal,
+ distanceForTop,
+ adjustHeightOffsetScratch
+ );
+ Matrix3.Cartesian3.add(top, adjustHeightOffset, adjustHeightTop);
+ }
+
+ const nudgeDirectionScratch = new Matrix3.Cartesian3();
+ function nudgeXZ(start, end) {
+ const startToXZdistance = Plane.Plane.getPointDistance(XZ_PLANE, start);
+ const endToXZdistance = Plane.Plane.getPointDistance(XZ_PLANE, end);
+ let offset = nudgeDirectionScratch;
+ // Larger epsilon than what's used in GeometryPipeline, a centimeter in world space
+ if (Math$1.CesiumMath.equalsEpsilon(startToXZdistance, 0.0, Math$1.CesiumMath.EPSILON2)) {
+ offset = direction(end, start, offset);
+ Matrix3.Cartesian3.multiplyByScalar(offset, Math$1.CesiumMath.EPSILON2, offset);
+ Matrix3.Cartesian3.add(start, offset, start);
+ } else if (
+ Math$1.CesiumMath.equalsEpsilon(endToXZdistance, 0.0, Math$1.CesiumMath.EPSILON2)
+ ) {
+ offset = direction(start, end, offset);
+ Matrix3.Cartesian3.multiplyByScalar(offset, Math$1.CesiumMath.EPSILON2, offset);
+ Matrix3.Cartesian3.add(end, offset, end);
+ }
+ }
+
+ // "Nudge" cartographic coordinates so start and end are on the same side of the IDL.
+ // Nudge amounts are tiny, basically just an IDL flip.
+ // Only used for 2D/CV.
+ function nudgeCartographic(start, end) {
+ const absStartLon = Math.abs(start.longitude);
+ const absEndLon = Math.abs(end.longitude);
+ if (
+ Math$1.CesiumMath.equalsEpsilon(absStartLon, Math$1.CesiumMath.PI, Math$1.CesiumMath.EPSILON11)
+ ) {
+ const endSign = Math$1.CesiumMath.sign(end.longitude);
+ start.longitude = endSign * (absStartLon - Math$1.CesiumMath.EPSILON11);
+ return 1;
+ } else if (
+ Math$1.CesiumMath.equalsEpsilon(absEndLon, Math$1.CesiumMath.PI, Math$1.CesiumMath.EPSILON11)
+ ) {
+ const startSign = Math$1.CesiumMath.sign(start.longitude);
+ end.longitude = startSign * (absEndLon - Math$1.CesiumMath.EPSILON11);
+ return 2;
+ }
+ return 0;
+ }
+
+ const startCartographicScratch = new Matrix3.Cartographic();
+ const endCartographicScratch = new Matrix3.Cartographic();
+
+ const segmentStartTopScratch = new Matrix3.Cartesian3();
+ const segmentEndTopScratch = new Matrix3.Cartesian3();
+ const segmentStartBottomScratch = new Matrix3.Cartesian3();
+ const segmentEndBottomScratch = new Matrix3.Cartesian3();
+ const segmentStartNormalScratch = new Matrix3.Cartesian3();
+ const segmentEndNormalScratch = new Matrix3.Cartesian3();
+
+ const getHeightCartographics = [
+ startCartographicScratch,
+ endCartographicScratch,
+ ];
+ const getHeightRectangleScratch = new Matrix2.Rectangle();
+
+ const adjustHeightStartTopScratch = new Matrix3.Cartesian3();
+ const adjustHeightEndTopScratch = new Matrix3.Cartesian3();
+ const adjustHeightStartBottomScratch = new Matrix3.Cartesian3();
+ const adjustHeightEndBottomScratch = new Matrix3.Cartesian3();
+
+ const segmentStart2DScratch = new Matrix3.Cartesian3();
+ const segmentEnd2DScratch = new Matrix3.Cartesian3();
+ const segmentStartNormal2DScratch = new Matrix3.Cartesian3();
+ const segmentEndNormal2DScratch = new Matrix3.Cartesian3();
+
+ const offsetScratch = new Matrix3.Cartesian3();
+ const startUpScratch = new Matrix3.Cartesian3();
+ const endUpScratch = new Matrix3.Cartesian3();
+ const rightScratch = new Matrix3.Cartesian3();
+ const startPlaneNormalScratch = new Matrix3.Cartesian3();
+ const endPlaneNormalScratch = new Matrix3.Cartesian3();
+ const encodeScratch = new EncodedCartesian3.EncodedCartesian3();
+
+ const encodeScratch2D = new EncodedCartesian3.EncodedCartesian3();
+ const forwardOffset2DScratch = new Matrix3.Cartesian3();
+ const right2DScratch = new Matrix3.Cartesian3();
+
+ const normalNudgeScratch = new Matrix3.Cartesian3();
+
+ const scratchBoundingSpheres = [new Transforms.BoundingSphere(), new Transforms.BoundingSphere()];
+
+ // Winding order is reversed so each segment's volume is inside-out
+ const REFERENCE_INDICES = [
+ 0,
+ 2,
+ 1,
+ 0,
+ 3,
+ 2, // right
+ 0,
+ 7,
+ 3,
+ 0,
+ 4,
+ 7, // start
+ 0,
+ 5,
+ 4,
+ 0,
+ 1,
+ 5, // bottom
+ 5,
+ 7,
+ 4,
+ 5,
+ 6,
+ 7, // left
+ 5,
+ 2,
+ 6,
+ 5,
+ 1,
+ 2, // end
+ 3,
+ 6,
+ 2,
+ 3,
+ 7,
+ 6, // top
+ ];
+ const REFERENCE_INDICES_LENGTH = REFERENCE_INDICES.length;
+
+ // Decompose the "wall" into a series of shadow volumes.
+ // Each shadow volume's vertices encode a description of the line it contains,
+ // including mitering planes at the end points, a plane along the line itself,
+ // and attributes for computing length-wise texture coordinates.
+ function generateGeometryAttributes(
+ loop,
+ projection,
+ bottomPositionsArray,
+ topPositionsArray,
+ normalsArray,
+ cartographicsArray,
+ compute2dAttributes
+ ) {
+ let i;
+ let index;
+ const ellipsoid = projection._ellipsoid;
+
+ // Each segment will have 8 vertices
+ const segmentCount = bottomPositionsArray.length / 3 - 1;
+ const vertexCount = segmentCount * 8;
+ const arraySizeVec4 = vertexCount * 4;
+ const indexCount = segmentCount * 36;
+
+ const indices =
+ vertexCount > 65535
+ ? new Uint32Array(indexCount)
+ : new Uint16Array(indexCount);
+ const positionsArray = new Float64Array(vertexCount * 3);
+
+ const startHiAndForwardOffsetX = new Float32Array(arraySizeVec4);
+ const startLoAndForwardOffsetY = new Float32Array(arraySizeVec4);
+ const startNormalAndForwardOffsetZ = new Float32Array(arraySizeVec4);
+ const endNormalAndTextureCoordinateNormalizationX = new Float32Array(
+ arraySizeVec4
+ );
+ const rightNormalAndTextureCoordinateNormalizationY = new Float32Array(
+ arraySizeVec4
+ );
+
+ let startHiLo2D;
+ let offsetAndRight2D;
+ let startEndNormals2D;
+ let texcoordNormalization2D;
+
+ if (compute2dAttributes) {
+ startHiLo2D = new Float32Array(arraySizeVec4);
+ offsetAndRight2D = new Float32Array(arraySizeVec4);
+ startEndNormals2D = new Float32Array(arraySizeVec4);
+ texcoordNormalization2D = new Float32Array(vertexCount * 2);
+ }
+
+ /*** Compute total lengths for texture coordinate normalization ***/
+ // 2D
+ const cartographicsLength = cartographicsArray.length / 2;
+ let length2D = 0.0;
+
+ const startCartographic = startCartographicScratch;
+ startCartographic.height = 0.0;
+ const endCartographic = endCartographicScratch;
+ endCartographic.height = 0.0;
+
+ let segmentStartCartesian = segmentStartTopScratch;
+ let segmentEndCartesian = segmentEndTopScratch;
+
+ if (compute2dAttributes) {
+ index = 0;
+ for (i = 1; i < cartographicsLength; i++) {
+ // Don't clone anything from previous segment b/c possible IDL touch
+ startCartographic.latitude = cartographicsArray[index];
+ startCartographic.longitude = cartographicsArray[index + 1];
+ endCartographic.latitude = cartographicsArray[index + 2];
+ endCartographic.longitude = cartographicsArray[index + 3];
+
+ segmentStartCartesian = projection.project(
+ startCartographic,
+ segmentStartCartesian
+ );
+ segmentEndCartesian = projection.project(
+ endCartographic,
+ segmentEndCartesian
+ );
+ length2D += Matrix3.Cartesian3.distance(
+ segmentStartCartesian,
+ segmentEndCartesian
+ );
+ index += 2;
+ }
+ }
+
+ // 3D
+ const positionsLength = topPositionsArray.length / 3;
+ segmentEndCartesian = Matrix3.Cartesian3.unpack(
+ topPositionsArray,
+ 0,
+ segmentEndCartesian
+ );
+ let length3D = 0.0;
+
+ index = 3;
+ for (i = 1; i < positionsLength; i++) {
+ segmentStartCartesian = Matrix3.Cartesian3.clone(
+ segmentEndCartesian,
+ segmentStartCartesian
+ );
+ segmentEndCartesian = Matrix3.Cartesian3.unpack(
+ topPositionsArray,
+ index,
+ segmentEndCartesian
+ );
+ length3D += Matrix3.Cartesian3.distance(segmentStartCartesian, segmentEndCartesian);
+ index += 3;
+ }
+
+ /*** Generate segments ***/
+ let j;
+ index = 3;
+ let cartographicsIndex = 0;
+ let vec2sWriteIndex = 0;
+ let vec3sWriteIndex = 0;
+ let vec4sWriteIndex = 0;
+ let miterBroken = false;
+
+ let endBottom = Matrix3.Cartesian3.unpack(
+ bottomPositionsArray,
+ 0,
+ segmentEndBottomScratch
+ );
+ let endTop = Matrix3.Cartesian3.unpack(topPositionsArray, 0, segmentEndTopScratch);
+ let endGeometryNormal = Matrix3.Cartesian3.unpack(
+ normalsArray,
+ 0,
+ segmentEndNormalScratch
+ );
+
+ if (loop) {
+ const preEndBottom = Matrix3.Cartesian3.unpack(
+ bottomPositionsArray,
+ bottomPositionsArray.length - 6,
+ segmentStartBottomScratch
+ );
+ if (breakMiter(endGeometryNormal, preEndBottom, endBottom, endTop)) {
+ // Miter broken as if for the last point in the loop, needs to be inverted for first point (clone of endBottom)
+ endGeometryNormal = Matrix3.Cartesian3.negate(
+ endGeometryNormal,
+ endGeometryNormal
+ );
+ }
+ }
+
+ let lengthSoFar3D = 0.0;
+ let lengthSoFar2D = 0.0;
+
+ // For translating bounding volume
+ let sumHeights = 0.0;
+
+ for (i = 0; i < segmentCount; i++) {
+ const startBottom = Matrix3.Cartesian3.clone(endBottom, segmentStartBottomScratch);
+ const startTop = Matrix3.Cartesian3.clone(endTop, segmentStartTopScratch);
+ let startGeometryNormal = Matrix3.Cartesian3.clone(
+ endGeometryNormal,
+ segmentStartNormalScratch
+ );
+
+ if (miterBroken) {
+ startGeometryNormal = Matrix3.Cartesian3.negate(
+ startGeometryNormal,
+ startGeometryNormal
+ );
+ }
+
+ endBottom = Matrix3.Cartesian3.unpack(
+ bottomPositionsArray,
+ index,
+ segmentEndBottomScratch
+ );
+ endTop = Matrix3.Cartesian3.unpack(topPositionsArray, index, segmentEndTopScratch);
+ endGeometryNormal = Matrix3.Cartesian3.unpack(
+ normalsArray,
+ index,
+ segmentEndNormalScratch
+ );
+
+ miterBroken = breakMiter(endGeometryNormal, startBottom, endBottom, endTop);
+
+ // 2D - don't clone anything from previous segment b/c possible IDL touch
+ startCartographic.latitude = cartographicsArray[cartographicsIndex];
+ startCartographic.longitude = cartographicsArray[cartographicsIndex + 1];
+ endCartographic.latitude = cartographicsArray[cartographicsIndex + 2];
+ endCartographic.longitude = cartographicsArray[cartographicsIndex + 3];
+ let start2D;
+ let end2D;
+ let startGeometryNormal2D;
+ let endGeometryNormal2D;
+
+ if (compute2dAttributes) {
+ const nudgeResult = nudgeCartographic(startCartographic, endCartographic);
+ start2D = projection.project(startCartographic, segmentStart2DScratch);
+ end2D = projection.project(endCartographic, segmentEnd2DScratch);
+ const direction2D = direction(end2D, start2D, forwardOffset2DScratch);
+ direction2D.y = Math.abs(direction2D.y);
+
+ startGeometryNormal2D = segmentStartNormal2DScratch;
+ endGeometryNormal2D = segmentEndNormal2DScratch;
+ if (
+ nudgeResult === 0 ||
+ Matrix3.Cartesian3.dot(direction2D, Matrix3.Cartesian3.UNIT_Y) > MITER_BREAK_SMALL
+ ) {
+ // No nudge - project the original normal
+ // Or, if the line's angle relative to the IDL is very acute,
+ // in which case snapping will produce oddly shaped volumes.
+ startGeometryNormal2D = projectNormal(
+ projection,
+ startCartographic,
+ startGeometryNormal,
+ start2D,
+ segmentStartNormal2DScratch
+ );
+ endGeometryNormal2D = projectNormal(
+ projection,
+ endCartographic,
+ endGeometryNormal,
+ end2D,
+ segmentEndNormal2DScratch
+ );
+ } else if (nudgeResult === 1) {
+ // Start is close to IDL - snap start normal to align with IDL
+ endGeometryNormal2D = projectNormal(
+ projection,
+ endCartographic,
+ endGeometryNormal,
+ end2D,
+ segmentEndNormal2DScratch
+ );
+ startGeometryNormal2D.x = 0.0;
+ // If start longitude is negative and end longitude is less negative, relative right is unit -Y
+ // If start longitude is positive and end longitude is less positive, relative right is unit +Y
+ startGeometryNormal2D.y = Math$1.CesiumMath.sign(
+ startCartographic.longitude - Math.abs(endCartographic.longitude)
+ );
+ startGeometryNormal2D.z = 0.0;
+ } else {
+ // End is close to IDL - snap end normal to align with IDL
+ startGeometryNormal2D = projectNormal(
+ projection,
+ startCartographic,
+ startGeometryNormal,
+ start2D,
+ segmentStartNormal2DScratch
+ );
+ endGeometryNormal2D.x = 0.0;
+ // If end longitude is negative and start longitude is less negative, relative right is unit Y
+ // If end longitude is positive and start longitude is less positive, relative right is unit -Y
+ endGeometryNormal2D.y = Math$1.CesiumMath.sign(
+ startCartographic.longitude - endCartographic.longitude
+ );
+ endGeometryNormal2D.z = 0.0;
+ }
+ }
+
+ /****************************************
+ * Geometry descriptors of a "line on terrain,"
+ * as opposed to the "shadow volume used to draw
+ * the line on terrain":
+ * - position of start + offset to end
+ * - start, end, and right-facing planes
+ * - encoded texture coordinate offsets
+ ****************************************/
+
+ /* 3D */
+ const segmentLength3D = Matrix3.Cartesian3.distance(startTop, endTop);
+
+ const encodedStart = EncodedCartesian3.EncodedCartesian3.fromCartesian(
+ startBottom,
+ encodeScratch
+ );
+ const forwardOffset = Matrix3.Cartesian3.subtract(
+ endBottom,
+ startBottom,
+ offsetScratch
+ );
+ const forward = Matrix3.Cartesian3.normalize(forwardOffset, rightScratch);
+
+ let startUp = Matrix3.Cartesian3.subtract(startTop, startBottom, startUpScratch);
+ startUp = Matrix3.Cartesian3.normalize(startUp, startUp);
+ let rightNormal = Matrix3.Cartesian3.cross(forward, startUp, rightScratch);
+ rightNormal = Matrix3.Cartesian3.normalize(rightNormal, rightNormal);
+
+ let startPlaneNormal = Matrix3.Cartesian3.cross(
+ startUp,
+ startGeometryNormal,
+ startPlaneNormalScratch
+ );
+ startPlaneNormal = Matrix3.Cartesian3.normalize(startPlaneNormal, startPlaneNormal);
+
+ let endUp = Matrix3.Cartesian3.subtract(endTop, endBottom, endUpScratch);
+ endUp = Matrix3.Cartesian3.normalize(endUp, endUp);
+ let endPlaneNormal = Matrix3.Cartesian3.cross(
+ endGeometryNormal,
+ endUp,
+ endPlaneNormalScratch
+ );
+ endPlaneNormal = Matrix3.Cartesian3.normalize(endPlaneNormal, endPlaneNormal);
+
+ const texcoordNormalization3DX = segmentLength3D / length3D;
+ const texcoordNormalization3DY = lengthSoFar3D / length3D;
+
+ /* 2D */
+ let segmentLength2D = 0.0;
+ let encodedStart2D;
+ let forwardOffset2D;
+ let right2D;
+ let texcoordNormalization2DX = 0.0;
+ let texcoordNormalization2DY = 0.0;
+ if (compute2dAttributes) {
+ segmentLength2D = Matrix3.Cartesian3.distance(start2D, end2D);
+
+ encodedStart2D = EncodedCartesian3.EncodedCartesian3.fromCartesian(
+ start2D,
+ encodeScratch2D
+ );
+ forwardOffset2D = Matrix3.Cartesian3.subtract(
+ end2D,
+ start2D,
+ forwardOffset2DScratch
+ );
+
+ // Right direction is just forward direction rotated by -90 degrees around Z
+ // Similarly with plane normals
+ right2D = Matrix3.Cartesian3.normalize(forwardOffset2D, right2DScratch);
+ const swap = right2D.x;
+ right2D.x = right2D.y;
+ right2D.y = -swap;
+
+ texcoordNormalization2DX = segmentLength2D / length2D;
+ texcoordNormalization2DY = lengthSoFar2D / length2D;
+ }
+ /** Pack **/
+ for (j = 0; j < 8; j++) {
+ const vec4Index = vec4sWriteIndex + j * 4;
+ const vec2Index = vec2sWriteIndex + j * 2;
+ const wIndex = vec4Index + 3;
+
+ // Encode sidedness of vertex relative to right plane in texture coordinate normalization X,
+ // whether vertex is top or bottom of volume in sign/magnitude of normalization Y.
+ const rightPlaneSide = j < 4 ? 1.0 : -1.0;
+ const topBottomSide =
+ j === 2 || j === 3 || j === 6 || j === 7 ? 1.0 : -1.0;
+
+ // 3D
+ Matrix3.Cartesian3.pack(encodedStart.high, startHiAndForwardOffsetX, vec4Index);
+ startHiAndForwardOffsetX[wIndex] = forwardOffset.x;
+
+ Matrix3.Cartesian3.pack(encodedStart.low, startLoAndForwardOffsetY, vec4Index);
+ startLoAndForwardOffsetY[wIndex] = forwardOffset.y;
+
+ Matrix3.Cartesian3.pack(
+ startPlaneNormal,
+ startNormalAndForwardOffsetZ,
+ vec4Index
+ );
+ startNormalAndForwardOffsetZ[wIndex] = forwardOffset.z;
+
+ Matrix3.Cartesian3.pack(
+ endPlaneNormal,
+ endNormalAndTextureCoordinateNormalizationX,
+ vec4Index
+ );
+ endNormalAndTextureCoordinateNormalizationX[wIndex] =
+ texcoordNormalization3DX * rightPlaneSide;
+
+ Matrix3.Cartesian3.pack(
+ rightNormal,
+ rightNormalAndTextureCoordinateNormalizationY,
+ vec4Index
+ );
+
+ let texcoordNormalization = texcoordNormalization3DY * topBottomSide;
+ if (texcoordNormalization === 0.0 && topBottomSide < 0.0) {
+ texcoordNormalization = 9.0; // some value greater than 1.0
+ }
+ rightNormalAndTextureCoordinateNormalizationY[
+ wIndex
+ ] = texcoordNormalization;
+
+ // 2D
+ if (compute2dAttributes) {
+ startHiLo2D[vec4Index] = encodedStart2D.high.x;
+ startHiLo2D[vec4Index + 1] = encodedStart2D.high.y;
+ startHiLo2D[vec4Index + 2] = encodedStart2D.low.x;
+ startHiLo2D[vec4Index + 3] = encodedStart2D.low.y;
+
+ startEndNormals2D[vec4Index] = -startGeometryNormal2D.y;
+ startEndNormals2D[vec4Index + 1] = startGeometryNormal2D.x;
+ startEndNormals2D[vec4Index + 2] = endGeometryNormal2D.y;
+ startEndNormals2D[vec4Index + 3] = -endGeometryNormal2D.x;
+
+ offsetAndRight2D[vec4Index] = forwardOffset2D.x;
+ offsetAndRight2D[vec4Index + 1] = forwardOffset2D.y;
+ offsetAndRight2D[vec4Index + 2] = right2D.x;
+ offsetAndRight2D[vec4Index + 3] = right2D.y;
+
+ texcoordNormalization2D[vec2Index] =
+ texcoordNormalization2DX * rightPlaneSide;
+
+ texcoordNormalization = texcoordNormalization2DY * topBottomSide;
+ if (texcoordNormalization === 0.0 && topBottomSide < 0.0) {
+ texcoordNormalization = 9.0; // some value greater than 1.0
+ }
+ texcoordNormalization2D[vec2Index + 1] = texcoordNormalization;
+ }
+ }
+
+ // Adjust height of volume in 3D
+ const adjustHeightStartBottom = adjustHeightStartBottomScratch;
+ const adjustHeightEndBottom = adjustHeightEndBottomScratch;
+ const adjustHeightStartTop = adjustHeightStartTopScratch;
+ const adjustHeightEndTop = adjustHeightEndTopScratch;
+
+ const getHeightsRectangle = Matrix2.Rectangle.fromCartographicArray(
+ getHeightCartographics,
+ getHeightRectangleScratch
+ );
+ const minMaxHeights = ApproximateTerrainHeights$1.getMinimumMaximumHeights(
+ getHeightsRectangle,
+ ellipsoid
+ );
+ const minHeight = minMaxHeights.minimumTerrainHeight;
+ const maxHeight = minMaxHeights.maximumTerrainHeight;
+
+ sumHeights += minHeight;
+ sumHeights += maxHeight;
+
+ adjustHeights(
+ startBottom,
+ startTop,
+ minHeight,
+ maxHeight,
+ adjustHeightStartBottom,
+ adjustHeightStartTop
+ );
+ adjustHeights(
+ endBottom,
+ endTop,
+ minHeight,
+ maxHeight,
+ adjustHeightEndBottom,
+ adjustHeightEndTop
+ );
+
+ // Nudge the positions away from the "polyline" a little bit to prevent errors in GeometryPipeline
+ let normalNudge = Matrix3.Cartesian3.multiplyByScalar(
+ rightNormal,
+ Math$1.CesiumMath.EPSILON5,
+ normalNudgeScratch
+ );
+ Matrix3.Cartesian3.add(
+ adjustHeightStartBottom,
+ normalNudge,
+ adjustHeightStartBottom
+ );
+ Matrix3.Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);
+ Matrix3.Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);
+ Matrix3.Cartesian3.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);
+
+ // If the segment is very close to the XZ plane, nudge the vertices slightly to avoid touching it.
+ nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);
+ nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);
+
+ Matrix3.Cartesian3.pack(adjustHeightStartBottom, positionsArray, vec3sWriteIndex);
+ Matrix3.Cartesian3.pack(adjustHeightEndBottom, positionsArray, vec3sWriteIndex + 3);
+ Matrix3.Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 6);
+ Matrix3.Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 9);
+
+ normalNudge = Matrix3.Cartesian3.multiplyByScalar(
+ rightNormal,
+ -2.0 * Math$1.CesiumMath.EPSILON5,
+ normalNudgeScratch
+ );
+ Matrix3.Cartesian3.add(
+ adjustHeightStartBottom,
+ normalNudge,
+ adjustHeightStartBottom
+ );
+ Matrix3.Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);
+ Matrix3.Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);
+ Matrix3.Cartesian3.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);
+
+ nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);
+ nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);
+
+ Matrix3.Cartesian3.pack(
+ adjustHeightStartBottom,
+ positionsArray,
+ vec3sWriteIndex + 12
+ );
+ Matrix3.Cartesian3.pack(
+ adjustHeightEndBottom,
+ positionsArray,
+ vec3sWriteIndex + 15
+ );
+ Matrix3.Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 18);
+ Matrix3.Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 21);
+
+ cartographicsIndex += 2;
+ index += 3;
+
+ vec2sWriteIndex += 16;
+ vec3sWriteIndex += 24;
+ vec4sWriteIndex += 32;
+
+ lengthSoFar3D += segmentLength3D;
+ lengthSoFar2D += segmentLength2D;
+ }
+
+ index = 0;
+ let indexOffset = 0;
+ for (i = 0; i < segmentCount; i++) {
+ for (j = 0; j < REFERENCE_INDICES_LENGTH; j++) {
+ indices[index + j] = REFERENCE_INDICES[j] + indexOffset;
+ }
+ indexOffset += 8;
+ index += REFERENCE_INDICES_LENGTH;
+ }
+
+ const boundingSpheres = scratchBoundingSpheres;
+ Transforms.BoundingSphere.fromVertices(
+ bottomPositionsArray,
+ Matrix3.Cartesian3.ZERO,
+ 3,
+ boundingSpheres[0]
+ );
+ Transforms.BoundingSphere.fromVertices(
+ topPositionsArray,
+ Matrix3.Cartesian3.ZERO,
+ 3,
+ boundingSpheres[1]
+ );
+ const boundingSphere = Transforms.BoundingSphere.fromBoundingSpheres(boundingSpheres);
+
+ // Adjust bounding sphere height and radius to cover more of the volume
+ boundingSphere.radius += sumHeights / (segmentCount * 2.0);
+
+ const attributes = {
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ normalize: false,
+ values: positionsArray,
+ }),
+ startHiAndForwardOffsetX: getVec4GeometryAttribute(
+ startHiAndForwardOffsetX
+ ),
+ startLoAndForwardOffsetY: getVec4GeometryAttribute(
+ startLoAndForwardOffsetY
+ ),
+ startNormalAndForwardOffsetZ: getVec4GeometryAttribute(
+ startNormalAndForwardOffsetZ
+ ),
+ endNormalAndTextureCoordinateNormalizationX: getVec4GeometryAttribute(
+ endNormalAndTextureCoordinateNormalizationX
+ ),
+ rightNormalAndTextureCoordinateNormalizationY: getVec4GeometryAttribute(
+ rightNormalAndTextureCoordinateNormalizationY
+ ),
+ };
+
+ if (compute2dAttributes) {
+ attributes.startHiLo2D = getVec4GeometryAttribute(startHiLo2D);
+ attributes.offsetAndRight2D = getVec4GeometryAttribute(offsetAndRight2D);
+ attributes.startEndNormals2D = getVec4GeometryAttribute(startEndNormals2D);
+ attributes.texcoordNormalization2D = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ normalize: false,
+ values: texcoordNormalization2D,
+ });
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ boundingSphere: boundingSphere,
+ });
+ }
+
+ function getVec4GeometryAttribute(typedArray) {
+ return new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 4,
+ normalize: false,
+ values: typedArray,
+ });
+ }
+
+ /**
+ * Approximates an ellipsoid-tangent vector in 2D by projecting the end point into 2D.
+ * Exposed for testing.
+ *
+ * @param {MapProjection} projection Map Projection for projecting coordinates to 2D.
+ * @param {Cartographic} cartographic The cartographic origin point of the normal.
+ * Used to check if the normal crosses the IDL during projection.
+ * @param {Cartesian3} normal The normal in 3D.
+ * @param {Cartesian3} projectedPosition The projected origin point of the normal in 2D.
+ * @param {Cartesian3} result Result parameter on which to store the projected normal.
+ * @private
+ */
+ GroundPolylineGeometry._projectNormal = projectNormal;
+
+ function createGroundPolylineGeometry(groundPolylineGeometry, offset) {
+ return ApproximateTerrainHeights$1.initialize().then(function () {
+ if (defaultValue.defined(offset)) {
+ groundPolylineGeometry = GroundPolylineGeometry.unpack(
+ groundPolylineGeometry,
+ offset
+ );
+ }
+ return GroundPolylineGeometry.createGeometry(groundPolylineGeometry);
+ });
+ }
+
+ return createGroundPolylineGeometry;
+
+}));
+//# sourceMappingURL=createGroundPolylineGeometry.js.map
diff --git a/examples/cesium/Workers/createGroundPolylineGeometry.js.map b/examples/cesium/Workers/createGroundPolylineGeometry.js.map
new file mode 100644
index 0000000..7a3e1de
--- /dev/null
+++ b/examples/cesium/Workers/createGroundPolylineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createGroundPolylineGeometry.js","sources":["../../../Source/Core/GeographicTilingScheme.js","../../../Source/Core/ApproximateTerrainHeights.js","../../../Source/Core/GroundPolylineGeometry.js","../../../Source/WorkersES6/createGroundPolylineGeometry.js"],"sourcesContent":["import Cartesian2 from \"./Cartesian2.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport GeographicProjection from \"./GeographicProjection.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\n\r\n/**\r\n * A tiling scheme for geometry referenced to a simple {@link GeographicProjection} where\r\n * longitude and latitude are directly mapped to X and Y. This projection is commonly\r\n * known as geographic, equirectangular, equidistant cylindrical, or plate carrée.\r\n *\r\n * @alias GeographicTilingScheme\r\n * @constructor\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid whose surface is being tiled. Defaults to\r\n * the WGS84 ellipsoid.\r\n * @param {Rectangle} [options.rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the tiling scheme.\r\n * @param {Number} [options.numberOfLevelZeroTilesX=2] The number of tiles in the X direction at level zero of\r\n * the tile tree.\r\n * @param {Number} [options.numberOfLevelZeroTilesY=1] The number of tiles in the Y direction at level zero of\r\n * the tile tree.\r\n */\r\nfunction GeographicTilingScheme(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n this._rectangle = defaultValue(options.rectangle, Rectangle.MAX_VALUE);\r\n this._projection = new GeographicProjection(this._ellipsoid);\r\n this._numberOfLevelZeroTilesX = defaultValue(\r\n options.numberOfLevelZeroTilesX,\r\n 2\r\n );\r\n this._numberOfLevelZeroTilesY = defaultValue(\r\n options.numberOfLevelZeroTilesY,\r\n 1\r\n );\r\n}\r\n\r\nObject.defineProperties(GeographicTilingScheme.prototype, {\r\n /**\r\n * Gets the ellipsoid that is tiled by this tiling scheme.\r\n * @memberof GeographicTilingScheme.prototype\r\n * @type {Ellipsoid}\r\n */\r\n ellipsoid: {\r\n get: function () {\r\n return this._ellipsoid;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the rectangle, in radians, covered by this tiling scheme.\r\n * @memberof GeographicTilingScheme.prototype\r\n * @type {Rectangle}\r\n */\r\n rectangle: {\r\n get: function () {\r\n return this._rectangle;\r\n },\r\n },\r\n\r\n /**\r\n * Gets the map projection used by this tiling scheme.\r\n * @memberof GeographicTilingScheme.prototype\r\n * @type {MapProjection}\r\n */\r\n projection: {\r\n get: function () {\r\n return this._projection;\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Gets the total number of tiles in the X direction at a specified level-of-detail.\r\n *\r\n * @param {Number} level The level-of-detail.\r\n * @returns {Number} The number of tiles in the X direction at the given level.\r\n */\r\nGeographicTilingScheme.prototype.getNumberOfXTilesAtLevel = function (level) {\r\n return this._numberOfLevelZeroTilesX << level;\r\n};\r\n\r\n/**\r\n * Gets the total number of tiles in the Y direction at a specified level-of-detail.\r\n *\r\n * @param {Number} level The level-of-detail.\r\n * @returns {Number} The number of tiles in the Y direction at the given level.\r\n */\r\nGeographicTilingScheme.prototype.getNumberOfYTilesAtLevel = function (level) {\r\n return this._numberOfLevelZeroTilesY << level;\r\n};\r\n\r\n/**\r\n * Transforms a rectangle specified in geodetic radians to the native coordinate system\r\n * of this tiling scheme.\r\n *\r\n * @param {Rectangle} rectangle The rectangle to transform.\r\n * @param {Rectangle} [result] The instance to which to copy the result, or undefined if a new instance\r\n * should be created.\r\n * @returns {Rectangle} The specified 'result', or a new object containing the native rectangle if 'result'\r\n * is undefined.\r\n */\r\nGeographicTilingScheme.prototype.rectangleToNativeRectangle = function (\r\n rectangle,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"rectangle\", rectangle);\r\n //>>includeEnd('debug');\r\n\r\n const west = CesiumMath.toDegrees(rectangle.west);\r\n const south = CesiumMath.toDegrees(rectangle.south);\r\n const east = CesiumMath.toDegrees(rectangle.east);\r\n const north = CesiumMath.toDegrees(rectangle.north);\r\n\r\n if (!defined(result)) {\r\n return new Rectangle(west, south, east, north);\r\n }\r\n\r\n result.west = west;\r\n result.south = south;\r\n result.east = east;\r\n result.north = north;\r\n return result;\r\n};\r\n\r\n/**\r\n * Converts tile x, y coordinates and level to a rectangle expressed in the native coordinates\r\n * of the tiling scheme.\r\n *\r\n * @param {Number} x The integer x coordinate of the tile.\r\n * @param {Number} y The integer y coordinate of the tile.\r\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\r\n * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance\r\n * should be created.\r\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\r\n * if 'result' is undefined.\r\n */\r\nGeographicTilingScheme.prototype.tileXYToNativeRectangle = function (\r\n x,\r\n y,\r\n level,\r\n result\r\n) {\r\n const rectangleRadians = this.tileXYToRectangle(x, y, level, result);\r\n rectangleRadians.west = CesiumMath.toDegrees(rectangleRadians.west);\r\n rectangleRadians.south = CesiumMath.toDegrees(rectangleRadians.south);\r\n rectangleRadians.east = CesiumMath.toDegrees(rectangleRadians.east);\r\n rectangleRadians.north = CesiumMath.toDegrees(rectangleRadians.north);\r\n return rectangleRadians;\r\n};\r\n\r\n/**\r\n * Converts tile x, y coordinates and level to a cartographic rectangle in radians.\r\n *\r\n * @param {Number} x The integer x coordinate of the tile.\r\n * @param {Number} y The integer y coordinate of the tile.\r\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\r\n * @param {Object} [result] The instance to which to copy the result, or undefined if a new instance\r\n * should be created.\r\n * @returns {Rectangle} The specified 'result', or a new object containing the rectangle\r\n * if 'result' is undefined.\r\n */\r\nGeographicTilingScheme.prototype.tileXYToRectangle = function (\r\n x,\r\n y,\r\n level,\r\n result\r\n) {\r\n const rectangle = this._rectangle;\r\n\r\n const xTiles = this.getNumberOfXTilesAtLevel(level);\r\n const yTiles = this.getNumberOfYTilesAtLevel(level);\r\n\r\n const xTileWidth = rectangle.width / xTiles;\r\n const west = x * xTileWidth + rectangle.west;\r\n const east = (x + 1) * xTileWidth + rectangle.west;\r\n\r\n const yTileHeight = rectangle.height / yTiles;\r\n const north = rectangle.north - y * yTileHeight;\r\n const south = rectangle.north - (y + 1) * yTileHeight;\r\n\r\n if (!defined(result)) {\r\n result = new Rectangle(west, south, east, north);\r\n }\r\n\r\n result.west = west;\r\n result.south = south;\r\n result.east = east;\r\n result.north = north;\r\n return result;\r\n};\r\n\r\n/**\r\n * Calculates the tile x, y coordinates of the tile containing\r\n * a given cartographic position.\r\n *\r\n * @param {Cartographic} position The position.\r\n * @param {Number} level The tile level-of-detail. Zero is the least detailed.\r\n * @param {Cartesian2} [result] The instance to which to copy the result, or undefined if a new instance\r\n * should be created.\r\n * @returns {Cartesian2} The specified 'result', or a new object containing the tile x, y coordinates\r\n * if 'result' is undefined.\r\n */\r\nGeographicTilingScheme.prototype.positionToTileXY = function (\r\n position,\r\n level,\r\n result\r\n) {\r\n const rectangle = this._rectangle;\r\n if (!Rectangle.contains(rectangle, position)) {\r\n // outside the bounds of the tiling scheme\r\n return undefined;\r\n }\r\n\r\n const xTiles = this.getNumberOfXTilesAtLevel(level);\r\n const yTiles = this.getNumberOfYTilesAtLevel(level);\r\n\r\n const xTileWidth = rectangle.width / xTiles;\r\n const yTileHeight = rectangle.height / yTiles;\r\n\r\n let longitude = position.longitude;\r\n if (rectangle.east < rectangle.west) {\r\n longitude += CesiumMath.TWO_PI;\r\n }\r\n\r\n let xTileCoordinate = ((longitude - rectangle.west) / xTileWidth) | 0;\r\n if (xTileCoordinate >= xTiles) {\r\n xTileCoordinate = xTiles - 1;\r\n }\r\n\r\n let yTileCoordinate =\r\n ((rectangle.north - position.latitude) / yTileHeight) | 0;\r\n if (yTileCoordinate >= yTiles) {\r\n yTileCoordinate = yTiles - 1;\r\n }\r\n\r\n if (!defined(result)) {\r\n return new Cartesian2(xTileCoordinate, yTileCoordinate);\r\n }\r\n\r\n result.x = xTileCoordinate;\r\n result.y = yTileCoordinate;\r\n return result;\r\n};\r\nexport default GeographicTilingScheme;\r\n","import BoundingSphere from \"./BoundingSphere.js\";\r\nimport buildModuleUrl from \"./buildModuleUrl.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport GeographicTilingScheme from \"./GeographicTilingScheme.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\nimport Resource from \"./Resource.js\";\r\n\r\nconst scratchDiagonalCartesianNE = new Cartesian3();\r\nconst scratchDiagonalCartesianSW = new Cartesian3();\r\nconst scratchDiagonalCartographic = new Cartographic();\r\nconst scratchCenterCartesian = new Cartesian3();\r\nconst scratchSurfaceCartesian = new Cartesian3();\r\n\r\nconst scratchBoundingSphere = new BoundingSphere();\r\nconst tilingScheme = new GeographicTilingScheme();\r\nconst scratchCorners = [\r\n new Cartographic(),\r\n new Cartographic(),\r\n new Cartographic(),\r\n new Cartographic(),\r\n];\r\nconst scratchTileXY = new Cartesian2();\r\n\r\n/**\r\n * A collection of functions for approximating terrain height\r\n * @private\r\n */\r\nconst ApproximateTerrainHeights = {};\r\n\r\n/**\r\n * Initializes the minimum and maximum terrain heights\r\n * @return {Promise.}\r\n */\r\nApproximateTerrainHeights.initialize = function () {\r\n let initPromise = ApproximateTerrainHeights._initPromise;\r\n if (defined(initPromise)) {\r\n return initPromise;\r\n }\r\n\r\n initPromise = Resource.fetchJson(\r\n buildModuleUrl(\"Assets/approximateTerrainHeights.json\")\r\n ).then(function (json) {\r\n ApproximateTerrainHeights._terrainHeights = json;\r\n });\r\n ApproximateTerrainHeights._initPromise = initPromise;\r\n\r\n return initPromise;\r\n};\r\n\r\n/**\r\n * Computes the minimum and maximum terrain heights for a given rectangle\r\n * @param {Rectangle} rectangle The bounding rectangle\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid\r\n * @return {{minimumTerrainHeight: Number, maximumTerrainHeight: Number}}\r\n */\r\nApproximateTerrainHeights.getMinimumMaximumHeights = function (\r\n rectangle,\r\n ellipsoid\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"rectangle\", rectangle);\r\n if (!defined(ApproximateTerrainHeights._terrainHeights)) {\r\n throw new DeveloperError(\r\n \"You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n\r\n const xyLevel = getTileXYLevel(rectangle);\r\n\r\n // Get the terrain min/max for that tile\r\n let minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;\r\n let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;\r\n if (defined(xyLevel)) {\r\n const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;\r\n const heights = ApproximateTerrainHeights._terrainHeights[key];\r\n if (defined(heights)) {\r\n minTerrainHeight = heights[0];\r\n maxTerrainHeight = heights[1];\r\n }\r\n\r\n // Compute min by taking the center of the NE->SW diagonal and finding distance to the surface\r\n ellipsoid.cartographicToCartesian(\r\n Rectangle.northeast(rectangle, scratchDiagonalCartographic),\r\n scratchDiagonalCartesianNE\r\n );\r\n ellipsoid.cartographicToCartesian(\r\n Rectangle.southwest(rectangle, scratchDiagonalCartographic),\r\n scratchDiagonalCartesianSW\r\n );\r\n\r\n Cartesian3.midpoint(\r\n scratchDiagonalCartesianSW,\r\n scratchDiagonalCartesianNE,\r\n scratchCenterCartesian\r\n );\r\n const surfacePosition = ellipsoid.scaleToGeodeticSurface(\r\n scratchCenterCartesian,\r\n scratchSurfaceCartesian\r\n );\r\n if (defined(surfacePosition)) {\r\n const distance = Cartesian3.distance(\r\n scratchCenterCartesian,\r\n surfacePosition\r\n );\r\n minTerrainHeight = Math.min(minTerrainHeight, -distance);\r\n } else {\r\n minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;\r\n }\r\n }\r\n\r\n minTerrainHeight = Math.max(\r\n ApproximateTerrainHeights._defaultMinTerrainHeight,\r\n minTerrainHeight\r\n );\r\n\r\n return {\r\n minimumTerrainHeight: minTerrainHeight,\r\n maximumTerrainHeight: maxTerrainHeight,\r\n };\r\n};\r\n\r\n/**\r\n * Computes the bounding sphere based on the tile heights in the rectangle\r\n * @param {Rectangle} rectangle The bounding rectangle\r\n * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid\r\n * @return {BoundingSphere} The result bounding sphere\r\n */\r\nApproximateTerrainHeights.getBoundingSphere = function (rectangle, ellipsoid) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"rectangle\", rectangle);\r\n if (!defined(ApproximateTerrainHeights._terrainHeights)) {\r\n throw new DeveloperError(\r\n \"You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);\r\n\r\n const xyLevel = getTileXYLevel(rectangle);\r\n\r\n // Get the terrain max for that tile\r\n let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;\r\n if (defined(xyLevel)) {\r\n const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;\r\n const heights = ApproximateTerrainHeights._terrainHeights[key];\r\n if (defined(heights)) {\r\n maxTerrainHeight = heights[1];\r\n }\r\n }\r\n\r\n const result = BoundingSphere.fromRectangle3D(rectangle, ellipsoid, 0.0);\r\n BoundingSphere.fromRectangle3D(\r\n rectangle,\r\n ellipsoid,\r\n maxTerrainHeight,\r\n scratchBoundingSphere\r\n );\r\n\r\n return BoundingSphere.union(result, scratchBoundingSphere, result);\r\n};\r\n\r\nfunction getTileXYLevel(rectangle) {\r\n Cartographic.fromRadians(\r\n rectangle.east,\r\n rectangle.north,\r\n 0.0,\r\n scratchCorners[0]\r\n );\r\n Cartographic.fromRadians(\r\n rectangle.west,\r\n rectangle.north,\r\n 0.0,\r\n scratchCorners[1]\r\n );\r\n Cartographic.fromRadians(\r\n rectangle.east,\r\n rectangle.south,\r\n 0.0,\r\n scratchCorners[2]\r\n );\r\n Cartographic.fromRadians(\r\n rectangle.west,\r\n rectangle.south,\r\n 0.0,\r\n scratchCorners[3]\r\n );\r\n\r\n // Determine which tile the bounding rectangle is in\r\n let lastLevelX = 0,\r\n lastLevelY = 0;\r\n let currentX = 0,\r\n currentY = 0;\r\n const maxLevel = ApproximateTerrainHeights._terrainHeightsMaxLevel;\r\n let i;\r\n for (i = 0; i <= maxLevel; ++i) {\r\n let failed = false;\r\n for (let j = 0; j < 4; ++j) {\r\n const corner = scratchCorners[j];\r\n tilingScheme.positionToTileXY(corner, i, scratchTileXY);\r\n if (j === 0) {\r\n currentX = scratchTileXY.x;\r\n currentY = scratchTileXY.y;\r\n } else if (currentX !== scratchTileXY.x || currentY !== scratchTileXY.y) {\r\n failed = true;\r\n break;\r\n }\r\n }\r\n\r\n if (failed) {\r\n break;\r\n }\r\n\r\n lastLevelX = currentX;\r\n lastLevelY = currentY;\r\n }\r\n\r\n if (i === 0) {\r\n return undefined;\r\n }\r\n\r\n return {\r\n x: lastLevelX,\r\n y: lastLevelY,\r\n level: i > maxLevel ? maxLevel : i - 1,\r\n };\r\n}\r\n\r\nApproximateTerrainHeights._terrainHeightsMaxLevel = 6;\r\nApproximateTerrainHeights._defaultMaxTerrainHeight = 9000.0;\r\nApproximateTerrainHeights._defaultMinTerrainHeight = -100000.0;\r\nApproximateTerrainHeights._terrainHeights = undefined;\r\nApproximateTerrainHeights._initPromise = undefined;\r\n\r\nObject.defineProperties(ApproximateTerrainHeights, {\r\n /**\r\n * Determines if the terrain heights are initialized and ready to use. To initialize the terrain heights,\r\n * call {@link ApproximateTerrainHeights#initialize} and wait for the returned promise to resolve.\r\n * @type {Boolean}\r\n * @readonly\r\n * @memberof ApproximateTerrainHeights\r\n */\r\n initialized: {\r\n get: function () {\r\n return defined(ApproximateTerrainHeights._terrainHeights);\r\n },\r\n },\r\n});\r\nexport default ApproximateTerrainHeights;\r\n","import ApproximateTerrainHeights from \"./ApproximateTerrainHeights.js\";\r\nimport ArcType from \"./ArcType.js\";\r\nimport arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport EllipsoidGeodesic from \"./EllipsoidGeodesic.js\";\r\nimport EllipsoidRhumbLine from \"./EllipsoidRhumbLine.js\";\r\nimport EncodedCartesian3 from \"./EncodedCartesian3.js\";\r\nimport GeographicProjection from \"./GeographicProjection.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport IntersectionTests from \"./IntersectionTests.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport Plane from \"./Plane.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\nimport WebMercatorProjection from \"./WebMercatorProjection.js\";\r\n\r\nconst PROJECTIONS = [GeographicProjection, WebMercatorProjection];\r\nconst PROJECTION_COUNT = PROJECTIONS.length;\r\n\r\nconst MITER_BREAK_SMALL = Math.cos(CesiumMath.toRadians(30.0));\r\nconst MITER_BREAK_LARGE = Math.cos(CesiumMath.toRadians(150.0));\r\n\r\n// Initial heights for constructing the wall.\r\n// Keeping WALL_INITIAL_MIN_HEIGHT near the ellipsoid surface helps\r\n// prevent precision problems with planes in the shader.\r\n// Putting the start point of a plane at ApproximateTerrainHeights._defaultMinTerrainHeight,\r\n// which is a highly conservative bound, usually puts the plane origin several thousands\r\n// of meters away from the actual terrain, causing floating point problems when checking\r\n// fragments on terrain against the plane.\r\n// Ellipsoid height is generally much closer.\r\n// The initial max height is arbitrary.\r\n// Both heights are corrected using ApproximateTerrainHeights for computing the actual volume geometry.\r\nconst WALL_INITIAL_MIN_HEIGHT = 0.0;\r\nconst WALL_INITIAL_MAX_HEIGHT = 1000.0;\r\n\r\n/**\r\n * A description of a polyline on terrain or 3D Tiles. Only to be used with {@link GroundPolylinePrimitive}.\r\n *\r\n * @alias GroundPolylineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Options with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the polyline's points. Heights above the ellipsoid will be ignored.\r\n * @param {Number} [options.width=1.0] The screen space width in pixels.\r\n * @param {Number} [options.granularity=9999.0] The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.\r\n * @param {Boolean} [options.loop=false] Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.\r\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\r\n *\r\n * @exception {DeveloperError} At least two positions are required.\r\n *\r\n * @see GroundPolylinePrimitive\r\n *\r\n * @example\r\n * const positions = Cesium.Cartesian3.fromDegreesArray([\r\n * -112.1340164450331, 36.05494287836128,\r\n * -112.08821010582645, 36.097804071380715,\r\n * -112.13296079730024, 36.168769146801104\r\n * ]);\r\n *\r\n * const geometry = new Cesium.GroundPolylineGeometry({\r\n * positions : positions\r\n * });\r\n */\r\nfunction GroundPolylineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const positions = options.positions;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(positions) || positions.length < 2) {\r\n throw new DeveloperError(\"At least two positions are required.\");\r\n }\r\n if (\r\n defined(options.arcType) &&\r\n options.arcType !== ArcType.GEODESIC &&\r\n options.arcType !== ArcType.RHUMB\r\n ) {\r\n throw new DeveloperError(\r\n \"Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n /**\r\n * The screen space width in pixels.\r\n * @type {Number}\r\n */\r\n this.width = defaultValue(options.width, 1.0); // Doesn't get packed, not necessary for computing geometry.\r\n\r\n this._positions = positions;\r\n\r\n /**\r\n * The distance interval used for interpolating options.points. Zero indicates no interpolation.\r\n * Default of 9999.0 allows centimeter accuracy with 32 bit floating point.\r\n * @type {Boolean}\r\n * @default 9999.0\r\n */\r\n this.granularity = defaultValue(options.granularity, 9999.0);\r\n\r\n /**\r\n * Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.\r\n * If the geometry has two positions this parameter will be ignored.\r\n * @type {Boolean}\r\n * @default false\r\n */\r\n this.loop = defaultValue(options.loop, false);\r\n\r\n /**\r\n * The type of path the polyline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\r\n * @type {ArcType}\r\n * @default ArcType.GEODESIC\r\n */\r\n this.arcType = defaultValue(options.arcType, ArcType.GEODESIC);\r\n\r\n this._ellipsoid = Ellipsoid.WGS84;\r\n\r\n // MapProjections can't be packed, so store the index to a known MapProjection.\r\n this._projectionIndex = 0;\r\n this._workerName = \"createGroundPolylineGeometry\";\r\n\r\n // Used by GroundPolylinePrimitive to signal worker that scenemode is 3D only.\r\n this._scene3DOnly = false;\r\n}\r\n\r\nObject.defineProperties(GroundPolylineGeometry.prototype, {\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @memberof GroundPolylineGeometry.prototype\r\n * @type {Number}\r\n * @readonly\r\n * @private\r\n */\r\n packedLength: {\r\n get: function () {\r\n return (\r\n 1.0 +\r\n this._positions.length * 3 +\r\n 1.0 +\r\n 1.0 +\r\n 1.0 +\r\n Ellipsoid.packedLength +\r\n 1.0 +\r\n 1.0\r\n );\r\n },\r\n },\r\n});\r\n\r\n/**\r\n * Set the GroundPolylineGeometry's projection and ellipsoid.\r\n * Used by GroundPolylinePrimitive to signal scene information to the geometry for generating 2D attributes.\r\n *\r\n * @param {GroundPolylineGeometry} groundPolylineGeometry GroundPolylinGeometry describing a polyline on terrain or 3D Tiles.\r\n * @param {Projection} mapProjection A MapProjection used for projecting cartographic coordinates to 2D.\r\n * @private\r\n */\r\nGroundPolylineGeometry.setProjectionAndEllipsoid = function (\r\n groundPolylineGeometry,\r\n mapProjection\r\n) {\r\n let projectionIndex = 0;\r\n for (let i = 0; i < PROJECTION_COUNT; i++) {\r\n if (mapProjection instanceof PROJECTIONS[i]) {\r\n projectionIndex = i;\r\n break;\r\n }\r\n }\r\n\r\n groundPolylineGeometry._projectionIndex = projectionIndex;\r\n groundPolylineGeometry._ellipsoid = mapProjection.ellipsoid;\r\n};\r\n\r\nconst cart3Scratch1 = new Cartesian3();\r\nconst cart3Scratch2 = new Cartesian3();\r\nconst cart3Scratch3 = new Cartesian3();\r\nfunction computeRightNormal(start, end, maxHeight, ellipsoid, result) {\r\n const startBottom = getPosition(ellipsoid, start, 0.0, cart3Scratch1);\r\n const startTop = getPosition(ellipsoid, start, maxHeight, cart3Scratch2);\r\n const endBottom = getPosition(ellipsoid, end, 0.0, cart3Scratch3);\r\n\r\n const up = direction(startTop, startBottom, cart3Scratch2);\r\n const forward = direction(endBottom, startBottom, cart3Scratch3);\r\n\r\n Cartesian3.cross(forward, up, result);\r\n return Cartesian3.normalize(result, result);\r\n}\r\n\r\nconst interpolatedCartographicScratch = new Cartographic();\r\nconst interpolatedBottomScratch = new Cartesian3();\r\nconst interpolatedTopScratch = new Cartesian3();\r\nconst interpolatedNormalScratch = new Cartesian3();\r\nfunction interpolateSegment(\r\n start,\r\n end,\r\n minHeight,\r\n maxHeight,\r\n granularity,\r\n arcType,\r\n ellipsoid,\r\n normalsArray,\r\n bottomPositionsArray,\r\n topPositionsArray,\r\n cartographicsArray\r\n) {\r\n if (granularity === 0.0) {\r\n return;\r\n }\r\n\r\n let ellipsoidLine;\r\n if (arcType === ArcType.GEODESIC) {\r\n ellipsoidLine = new EllipsoidGeodesic(start, end, ellipsoid);\r\n } else if (arcType === ArcType.RHUMB) {\r\n ellipsoidLine = new EllipsoidRhumbLine(start, end, ellipsoid);\r\n }\r\n\r\n const surfaceDistance = ellipsoidLine.surfaceDistance;\r\n if (surfaceDistance < granularity) {\r\n return;\r\n }\r\n\r\n // Compute rightwards normal applicable at all interpolated points\r\n const interpolatedNormal = computeRightNormal(\r\n start,\r\n end,\r\n maxHeight,\r\n ellipsoid,\r\n interpolatedNormalScratch\r\n );\r\n\r\n const segments = Math.ceil(surfaceDistance / granularity);\r\n const interpointDistance = surfaceDistance / segments;\r\n let distanceFromStart = interpointDistance;\r\n const pointsToAdd = segments - 1;\r\n let packIndex = normalsArray.length;\r\n for (let i = 0; i < pointsToAdd; i++) {\r\n const interpolatedCartographic = ellipsoidLine.interpolateUsingSurfaceDistance(\r\n distanceFromStart,\r\n interpolatedCartographicScratch\r\n );\r\n const interpolatedBottom = getPosition(\r\n ellipsoid,\r\n interpolatedCartographic,\r\n minHeight,\r\n interpolatedBottomScratch\r\n );\r\n const interpolatedTop = getPosition(\r\n ellipsoid,\r\n interpolatedCartographic,\r\n maxHeight,\r\n interpolatedTopScratch\r\n );\r\n\r\n Cartesian3.pack(interpolatedNormal, normalsArray, packIndex);\r\n Cartesian3.pack(interpolatedBottom, bottomPositionsArray, packIndex);\r\n Cartesian3.pack(interpolatedTop, topPositionsArray, packIndex);\r\n cartographicsArray.push(interpolatedCartographic.latitude);\r\n cartographicsArray.push(interpolatedCartographic.longitude);\r\n\r\n packIndex += 3;\r\n distanceFromStart += interpointDistance;\r\n }\r\n}\r\n\r\nconst heightlessCartographicScratch = new Cartographic();\r\nfunction getPosition(ellipsoid, cartographic, height, result) {\r\n Cartographic.clone(cartographic, heightlessCartographicScratch);\r\n heightlessCartographicScratch.height = height;\r\n return Cartographic.toCartesian(\r\n heightlessCartographicScratch,\r\n ellipsoid,\r\n result\r\n );\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {PolygonGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nGroundPolylineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n let index = defaultValue(startingIndex, 0);\r\n\r\n const positions = value._positions;\r\n const positionsLength = positions.length;\r\n\r\n array[index++] = positionsLength;\r\n\r\n for (let i = 0; i < positionsLength; ++i) {\r\n const cartesian = positions[i];\r\n Cartesian3.pack(cartesian, array, index);\r\n index += 3;\r\n }\r\n\r\n array[index++] = value.granularity;\r\n array[index++] = value.loop ? 1.0 : 0.0;\r\n array[index++] = value.arcType;\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, index);\r\n index += Ellipsoid.packedLength;\r\n\r\n array[index++] = value._projectionIndex;\r\n array[index++] = value._scene3DOnly ? 1.0 : 0.0;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {PolygonGeometry} [result] The object into which to store the result.\r\n */\r\nGroundPolylineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n let index = defaultValue(startingIndex, 0);\r\n const positionsLength = array[index++];\r\n const positions = new Array(positionsLength);\r\n\r\n for (let i = 0; i < positionsLength; i++) {\r\n positions[i] = Cartesian3.unpack(array, index);\r\n index += 3;\r\n }\r\n\r\n const granularity = array[index++];\r\n const loop = array[index++] === 1.0;\r\n const arcType = array[index++];\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, index);\r\n index += Ellipsoid.packedLength;\r\n\r\n const projectionIndex = array[index++];\r\n const scene3DOnly = array[index++] === 1.0;\r\n\r\n if (!defined(result)) {\r\n result = new GroundPolylineGeometry({\r\n positions: positions,\r\n });\r\n }\r\n\r\n result._positions = positions;\r\n result.granularity = granularity;\r\n result.loop = loop;\r\n result.arcType = arcType;\r\n result._ellipsoid = ellipsoid;\r\n result._projectionIndex = projectionIndex;\r\n result._scene3DOnly = scene3DOnly;\r\n\r\n return result;\r\n};\r\n\r\nfunction direction(target, origin, result) {\r\n Cartesian3.subtract(target, origin, result);\r\n Cartesian3.normalize(result, result);\r\n return result;\r\n}\r\n\r\nfunction tangentDirection(target, origin, up, result) {\r\n result = direction(target, origin, result);\r\n\r\n // orthogonalize\r\n result = Cartesian3.cross(result, up, result);\r\n result = Cartesian3.normalize(result, result);\r\n result = Cartesian3.cross(up, result, result);\r\n return result;\r\n}\r\n\r\nconst toPreviousScratch = new Cartesian3();\r\nconst toNextScratch = new Cartesian3();\r\nconst forwardScratch = new Cartesian3();\r\nconst vertexUpScratch = new Cartesian3();\r\nconst cosine90 = 0.0;\r\nconst cosine180 = -1.0;\r\nfunction computeVertexMiterNormal(\r\n previousBottom,\r\n vertexBottom,\r\n vertexTop,\r\n nextBottom,\r\n result\r\n) {\r\n const up = direction(vertexTop, vertexBottom, vertexUpScratch);\r\n\r\n // Compute vectors pointing towards neighboring points but tangent to this point on the ellipsoid\r\n const toPrevious = tangentDirection(\r\n previousBottom,\r\n vertexBottom,\r\n up,\r\n toPreviousScratch\r\n );\r\n const toNext = tangentDirection(nextBottom, vertexBottom, up, toNextScratch);\r\n\r\n // Check if tangents are almost opposite - if so, no need to miter.\r\n if (\r\n CesiumMath.equalsEpsilon(\r\n Cartesian3.dot(toPrevious, toNext),\r\n cosine180,\r\n CesiumMath.EPSILON5\r\n )\r\n ) {\r\n result = Cartesian3.cross(up, toPrevious, result);\r\n result = Cartesian3.normalize(result, result);\r\n return result;\r\n }\r\n\r\n // Average directions to previous and to next in the plane of Up\r\n result = Cartesian3.add(toNext, toPrevious, result);\r\n result = Cartesian3.normalize(result, result);\r\n\r\n // Flip the normal if it isn't pointing roughly bound right (aka if forward is pointing more \"backwards\")\r\n const forward = Cartesian3.cross(up, result, forwardScratch);\r\n if (Cartesian3.dot(toNext, forward) < cosine90) {\r\n result = Cartesian3.negate(result, result);\r\n }\r\n\r\n return result;\r\n}\r\n\r\nconst XZ_PLANE = Plane.fromPointNormal(Cartesian3.ZERO, Cartesian3.UNIT_Y);\r\n\r\nconst previousBottomScratch = new Cartesian3();\r\nconst vertexBottomScratch = new Cartesian3();\r\nconst vertexTopScratch = new Cartesian3();\r\nconst nextBottomScratch = new Cartesian3();\r\nconst vertexNormalScratch = new Cartesian3();\r\nconst intersectionScratch = new Cartesian3();\r\nconst cartographicScratch0 = new Cartographic();\r\nconst cartographicScratch1 = new Cartographic();\r\nconst cartographicIntersectionScratch = new Cartographic();\r\n/**\r\n * Computes shadow volumes for the ground polyline, consisting of its vertices, indices, and a bounding sphere.\r\n * Vertices are \"fat,\" packing all the data needed in each volume to describe a line on terrain or 3D Tiles.\r\n * Should not be called independent of {@link GroundPolylinePrimitive}.\r\n *\r\n * @param {GroundPolylineGeometry} groundPolylineGeometry\r\n * @private\r\n */\r\nGroundPolylineGeometry.createGeometry = function (groundPolylineGeometry) {\r\n const compute2dAttributes = !groundPolylineGeometry._scene3DOnly;\r\n let loop = groundPolylineGeometry.loop;\r\n const ellipsoid = groundPolylineGeometry._ellipsoid;\r\n const granularity = groundPolylineGeometry.granularity;\r\n const arcType = groundPolylineGeometry.arcType;\r\n const projection = new PROJECTIONS[groundPolylineGeometry._projectionIndex](\r\n ellipsoid\r\n );\r\n\r\n const minHeight = WALL_INITIAL_MIN_HEIGHT;\r\n const maxHeight = WALL_INITIAL_MAX_HEIGHT;\r\n\r\n let index;\r\n let i;\r\n\r\n const positions = groundPolylineGeometry._positions;\r\n const positionsLength = positions.length;\r\n\r\n if (positionsLength === 2) {\r\n loop = false;\r\n }\r\n\r\n // Split positions across the IDL and the Prime Meridian as well.\r\n // Split across prime meridian because very large geometries crossing the Prime Meridian but not the IDL\r\n // may get split by the plane of IDL + Prime Meridian.\r\n let p0;\r\n let p1;\r\n let c0;\r\n let c1;\r\n const rhumbLine = new EllipsoidRhumbLine(undefined, undefined, ellipsoid);\r\n let intersection;\r\n let intersectionCartographic;\r\n let intersectionLongitude;\r\n const splitPositions = [positions[0]];\r\n for (i = 0; i < positionsLength - 1; i++) {\r\n p0 = positions[i];\r\n p1 = positions[i + 1];\r\n intersection = IntersectionTests.lineSegmentPlane(\r\n p0,\r\n p1,\r\n XZ_PLANE,\r\n intersectionScratch\r\n );\r\n if (\r\n defined(intersection) &&\r\n !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\r\n !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\r\n ) {\r\n if (groundPolylineGeometry.arcType === ArcType.GEODESIC) {\r\n splitPositions.push(Cartesian3.clone(intersection));\r\n } else if (groundPolylineGeometry.arcType === ArcType.RHUMB) {\r\n intersectionLongitude = ellipsoid.cartesianToCartographic(\r\n intersection,\r\n cartographicScratch0\r\n ).longitude;\r\n c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);\r\n c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);\r\n rhumbLine.setEndPoints(c0, c1);\r\n intersectionCartographic = rhumbLine.findIntersectionWithLongitude(\r\n intersectionLongitude,\r\n cartographicIntersectionScratch\r\n );\r\n intersection = ellipsoid.cartographicToCartesian(\r\n intersectionCartographic,\r\n intersectionScratch\r\n );\r\n if (\r\n defined(intersection) &&\r\n !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\r\n !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\r\n ) {\r\n splitPositions.push(Cartesian3.clone(intersection));\r\n }\r\n }\r\n }\r\n splitPositions.push(p1);\r\n }\r\n\r\n if (loop) {\r\n p0 = positions[positionsLength - 1];\r\n p1 = positions[0];\r\n intersection = IntersectionTests.lineSegmentPlane(\r\n p0,\r\n p1,\r\n XZ_PLANE,\r\n intersectionScratch\r\n );\r\n if (\r\n defined(intersection) &&\r\n !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\r\n !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\r\n ) {\r\n if (groundPolylineGeometry.arcType === ArcType.GEODESIC) {\r\n splitPositions.push(Cartesian3.clone(intersection));\r\n } else if (groundPolylineGeometry.arcType === ArcType.RHUMB) {\r\n intersectionLongitude = ellipsoid.cartesianToCartographic(\r\n intersection,\r\n cartographicScratch0\r\n ).longitude;\r\n c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);\r\n c1 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);\r\n rhumbLine.setEndPoints(c0, c1);\r\n intersectionCartographic = rhumbLine.findIntersectionWithLongitude(\r\n intersectionLongitude,\r\n cartographicIntersectionScratch\r\n );\r\n intersection = ellipsoid.cartographicToCartesian(\r\n intersectionCartographic,\r\n intersectionScratch\r\n );\r\n if (\r\n defined(intersection) &&\r\n !Cartesian3.equalsEpsilon(intersection, p0, CesiumMath.EPSILON7) &&\r\n !Cartesian3.equalsEpsilon(intersection, p1, CesiumMath.EPSILON7)\r\n ) {\r\n splitPositions.push(Cartesian3.clone(intersection));\r\n }\r\n }\r\n }\r\n }\r\n let cartographicsLength = splitPositions.length;\r\n\r\n let cartographics = new Array(cartographicsLength);\r\n for (i = 0; i < cartographicsLength; i++) {\r\n const cartographic = Cartographic.fromCartesian(\r\n splitPositions[i],\r\n ellipsoid\r\n );\r\n cartographic.height = 0.0;\r\n cartographics[i] = cartographic;\r\n }\r\n\r\n cartographics = arrayRemoveDuplicates(\r\n cartographics,\r\n Cartographic.equalsEpsilon\r\n );\r\n cartographicsLength = cartographics.length;\r\n\r\n if (cartographicsLength < 2) {\r\n return undefined;\r\n }\r\n\r\n /**** Build heap-side arrays for positions, interpolated cartographics, and normals from which to compute vertices ****/\r\n // We build a \"wall\" and then decompose it into separately connected component \"volumes\" because we need a lot\r\n // of information about the wall. Also, this simplifies interpolation.\r\n // Convention: \"next\" and \"end\" are locally forward to each segment of the wall,\r\n // and we are computing normals pointing towards the local right side of the vertices in each segment.\r\n const cartographicsArray = [];\r\n const normalsArray = [];\r\n const bottomPositionsArray = [];\r\n const topPositionsArray = [];\r\n\r\n let previousBottom = previousBottomScratch;\r\n let vertexBottom = vertexBottomScratch;\r\n let vertexTop = vertexTopScratch;\r\n let nextBottom = nextBottomScratch;\r\n let vertexNormal = vertexNormalScratch;\r\n\r\n // First point - either loop or attach a \"perpendicular\" normal\r\n const startCartographic = cartographics[0];\r\n const nextCartographic = cartographics[1];\r\n\r\n const prestartCartographic = cartographics[cartographicsLength - 1];\r\n previousBottom = getPosition(\r\n ellipsoid,\r\n prestartCartographic,\r\n minHeight,\r\n previousBottom\r\n );\r\n nextBottom = getPosition(ellipsoid, nextCartographic, minHeight, nextBottom);\r\n vertexBottom = getPosition(\r\n ellipsoid,\r\n startCartographic,\r\n minHeight,\r\n vertexBottom\r\n );\r\n vertexTop = getPosition(ellipsoid, startCartographic, maxHeight, vertexTop);\r\n\r\n if (loop) {\r\n vertexNormal = computeVertexMiterNormal(\r\n previousBottom,\r\n vertexBottom,\r\n vertexTop,\r\n nextBottom,\r\n vertexNormal\r\n );\r\n } else {\r\n vertexNormal = computeRightNormal(\r\n startCartographic,\r\n nextCartographic,\r\n maxHeight,\r\n ellipsoid,\r\n vertexNormal\r\n );\r\n }\r\n\r\n Cartesian3.pack(vertexNormal, normalsArray, 0);\r\n Cartesian3.pack(vertexBottom, bottomPositionsArray, 0);\r\n Cartesian3.pack(vertexTop, topPositionsArray, 0);\r\n cartographicsArray.push(startCartographic.latitude);\r\n cartographicsArray.push(startCartographic.longitude);\r\n\r\n interpolateSegment(\r\n startCartographic,\r\n nextCartographic,\r\n minHeight,\r\n maxHeight,\r\n granularity,\r\n arcType,\r\n ellipsoid,\r\n normalsArray,\r\n bottomPositionsArray,\r\n topPositionsArray,\r\n cartographicsArray\r\n );\r\n\r\n // All inbetween points\r\n for (i = 1; i < cartographicsLength - 1; ++i) {\r\n previousBottom = Cartesian3.clone(vertexBottom, previousBottom);\r\n vertexBottom = Cartesian3.clone(nextBottom, vertexBottom);\r\n const vertexCartographic = cartographics[i];\r\n getPosition(ellipsoid, vertexCartographic, maxHeight, vertexTop);\r\n getPosition(ellipsoid, cartographics[i + 1], minHeight, nextBottom);\r\n\r\n computeVertexMiterNormal(\r\n previousBottom,\r\n vertexBottom,\r\n vertexTop,\r\n nextBottom,\r\n vertexNormal\r\n );\r\n\r\n index = normalsArray.length;\r\n Cartesian3.pack(vertexNormal, normalsArray, index);\r\n Cartesian3.pack(vertexBottom, bottomPositionsArray, index);\r\n Cartesian3.pack(vertexTop, topPositionsArray, index);\r\n cartographicsArray.push(vertexCartographic.latitude);\r\n cartographicsArray.push(vertexCartographic.longitude);\r\n\r\n interpolateSegment(\r\n cartographics[i],\r\n cartographics[i + 1],\r\n minHeight,\r\n maxHeight,\r\n granularity,\r\n arcType,\r\n ellipsoid,\r\n normalsArray,\r\n bottomPositionsArray,\r\n topPositionsArray,\r\n cartographicsArray\r\n );\r\n }\r\n\r\n // Last point - either loop or attach a normal \"perpendicular\" to the wall.\r\n const endCartographic = cartographics[cartographicsLength - 1];\r\n const preEndCartographic = cartographics[cartographicsLength - 2];\r\n\r\n vertexBottom = getPosition(\r\n ellipsoid,\r\n endCartographic,\r\n minHeight,\r\n vertexBottom\r\n );\r\n vertexTop = getPosition(ellipsoid, endCartographic, maxHeight, vertexTop);\r\n\r\n if (loop) {\r\n const postEndCartographic = cartographics[0];\r\n previousBottom = getPosition(\r\n ellipsoid,\r\n preEndCartographic,\r\n minHeight,\r\n previousBottom\r\n );\r\n nextBottom = getPosition(\r\n ellipsoid,\r\n postEndCartographic,\r\n minHeight,\r\n nextBottom\r\n );\r\n\r\n vertexNormal = computeVertexMiterNormal(\r\n previousBottom,\r\n vertexBottom,\r\n vertexTop,\r\n nextBottom,\r\n vertexNormal\r\n );\r\n } else {\r\n vertexNormal = computeRightNormal(\r\n preEndCartographic,\r\n endCartographic,\r\n maxHeight,\r\n ellipsoid,\r\n vertexNormal\r\n );\r\n }\r\n\r\n index = normalsArray.length;\r\n Cartesian3.pack(vertexNormal, normalsArray, index);\r\n Cartesian3.pack(vertexBottom, bottomPositionsArray, index);\r\n Cartesian3.pack(vertexTop, topPositionsArray, index);\r\n cartographicsArray.push(endCartographic.latitude);\r\n cartographicsArray.push(endCartographic.longitude);\r\n\r\n if (loop) {\r\n interpolateSegment(\r\n endCartographic,\r\n startCartographic,\r\n minHeight,\r\n maxHeight,\r\n granularity,\r\n arcType,\r\n ellipsoid,\r\n normalsArray,\r\n bottomPositionsArray,\r\n topPositionsArray,\r\n cartographicsArray\r\n );\r\n index = normalsArray.length;\r\n for (i = 0; i < 3; ++i) {\r\n normalsArray[index + i] = normalsArray[i];\r\n bottomPositionsArray[index + i] = bottomPositionsArray[i];\r\n topPositionsArray[index + i] = topPositionsArray[i];\r\n }\r\n cartographicsArray.push(startCartographic.latitude);\r\n cartographicsArray.push(startCartographic.longitude);\r\n }\r\n\r\n return generateGeometryAttributes(\r\n loop,\r\n projection,\r\n bottomPositionsArray,\r\n topPositionsArray,\r\n normalsArray,\r\n cartographicsArray,\r\n compute2dAttributes\r\n );\r\n};\r\n\r\n// If the end normal angle is too steep compared to the direction of the line segment,\r\n// \"break\" the miter by rotating the normal 90 degrees around the \"up\" direction at the point\r\n// For ultra precision we would want to project into a plane, but in practice this is sufficient.\r\nconst lineDirectionScratch = new Cartesian3();\r\nconst matrix3Scratch = new Matrix3();\r\nconst quaternionScratch = new Quaternion();\r\nfunction breakMiter(endGeometryNormal, startBottom, endBottom, endTop) {\r\n const lineDirection = direction(endBottom, startBottom, lineDirectionScratch);\r\n\r\n const dot = Cartesian3.dot(lineDirection, endGeometryNormal);\r\n if (dot > MITER_BREAK_SMALL || dot < MITER_BREAK_LARGE) {\r\n const vertexUp = direction(endTop, endBottom, vertexUpScratch);\r\n const angle =\r\n dot < MITER_BREAK_LARGE\r\n ? CesiumMath.PI_OVER_TWO\r\n : -CesiumMath.PI_OVER_TWO;\r\n const quaternion = Quaternion.fromAxisAngle(\r\n vertexUp,\r\n angle,\r\n quaternionScratch\r\n );\r\n const rotationMatrix = Matrix3.fromQuaternion(quaternion, matrix3Scratch);\r\n Matrix3.multiplyByVector(\r\n rotationMatrix,\r\n endGeometryNormal,\r\n endGeometryNormal\r\n );\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nconst endPosCartographicScratch = new Cartographic();\r\nconst normalStartpointScratch = new Cartesian3();\r\nconst normalEndpointScratch = new Cartesian3();\r\nfunction projectNormal(\r\n projection,\r\n cartographic,\r\n normal,\r\n projectedPosition,\r\n result\r\n) {\r\n const position = Cartographic.toCartesian(\r\n cartographic,\r\n projection._ellipsoid,\r\n normalStartpointScratch\r\n );\r\n let normalEndpoint = Cartesian3.add(position, normal, normalEndpointScratch);\r\n let flipNormal = false;\r\n\r\n const ellipsoid = projection._ellipsoid;\r\n let normalEndpointCartographic = ellipsoid.cartesianToCartographic(\r\n normalEndpoint,\r\n endPosCartographicScratch\r\n );\r\n // If normal crosses the IDL, go the other way and flip the result.\r\n // In practice this almost never happens because the cartographic start\r\n // and end points of each segment are \"nudged\" to be on the same side\r\n // of the IDL and slightly away from the IDL.\r\n if (\r\n Math.abs(cartographic.longitude - normalEndpointCartographic.longitude) >\r\n CesiumMath.PI_OVER_TWO\r\n ) {\r\n flipNormal = true;\r\n normalEndpoint = Cartesian3.subtract(\r\n position,\r\n normal,\r\n normalEndpointScratch\r\n );\r\n normalEndpointCartographic = ellipsoid.cartesianToCartographic(\r\n normalEndpoint,\r\n endPosCartographicScratch\r\n );\r\n }\r\n\r\n normalEndpointCartographic.height = 0.0;\r\n const normalEndpointProjected = projection.project(\r\n normalEndpointCartographic,\r\n result\r\n );\r\n result = Cartesian3.subtract(\r\n normalEndpointProjected,\r\n projectedPosition,\r\n result\r\n );\r\n result.z = 0.0;\r\n result = Cartesian3.normalize(result, result);\r\n if (flipNormal) {\r\n Cartesian3.negate(result, result);\r\n }\r\n return result;\r\n}\r\n\r\nconst adjustHeightNormalScratch = new Cartesian3();\r\nconst adjustHeightOffsetScratch = new Cartesian3();\r\nfunction adjustHeights(\r\n bottom,\r\n top,\r\n minHeight,\r\n maxHeight,\r\n adjustHeightBottom,\r\n adjustHeightTop\r\n) {\r\n // bottom and top should be at WALL_INITIAL_MIN_HEIGHT and WALL_INITIAL_MAX_HEIGHT, respectively\r\n const adjustHeightNormal = Cartesian3.subtract(\r\n top,\r\n bottom,\r\n adjustHeightNormalScratch\r\n );\r\n Cartesian3.normalize(adjustHeightNormal, adjustHeightNormal);\r\n\r\n const distanceForBottom = minHeight - WALL_INITIAL_MIN_HEIGHT;\r\n let adjustHeightOffset = Cartesian3.multiplyByScalar(\r\n adjustHeightNormal,\r\n distanceForBottom,\r\n adjustHeightOffsetScratch\r\n );\r\n Cartesian3.add(bottom, adjustHeightOffset, adjustHeightBottom);\r\n\r\n const distanceForTop = maxHeight - WALL_INITIAL_MAX_HEIGHT;\r\n adjustHeightOffset = Cartesian3.multiplyByScalar(\r\n adjustHeightNormal,\r\n distanceForTop,\r\n adjustHeightOffsetScratch\r\n );\r\n Cartesian3.add(top, adjustHeightOffset, adjustHeightTop);\r\n}\r\n\r\nconst nudgeDirectionScratch = new Cartesian3();\r\nfunction nudgeXZ(start, end) {\r\n const startToXZdistance = Plane.getPointDistance(XZ_PLANE, start);\r\n const endToXZdistance = Plane.getPointDistance(XZ_PLANE, end);\r\n let offset = nudgeDirectionScratch;\r\n // Larger epsilon than what's used in GeometryPipeline, a centimeter in world space\r\n if (CesiumMath.equalsEpsilon(startToXZdistance, 0.0, CesiumMath.EPSILON2)) {\r\n offset = direction(end, start, offset);\r\n Cartesian3.multiplyByScalar(offset, CesiumMath.EPSILON2, offset);\r\n Cartesian3.add(start, offset, start);\r\n } else if (\r\n CesiumMath.equalsEpsilon(endToXZdistance, 0.0, CesiumMath.EPSILON2)\r\n ) {\r\n offset = direction(start, end, offset);\r\n Cartesian3.multiplyByScalar(offset, CesiumMath.EPSILON2, offset);\r\n Cartesian3.add(end, offset, end);\r\n }\r\n}\r\n\r\n// \"Nudge\" cartographic coordinates so start and end are on the same side of the IDL.\r\n// Nudge amounts are tiny, basically just an IDL flip.\r\n// Only used for 2D/CV.\r\nfunction nudgeCartographic(start, end) {\r\n const absStartLon = Math.abs(start.longitude);\r\n const absEndLon = Math.abs(end.longitude);\r\n if (\r\n CesiumMath.equalsEpsilon(absStartLon, CesiumMath.PI, CesiumMath.EPSILON11)\r\n ) {\r\n const endSign = CesiumMath.sign(end.longitude);\r\n start.longitude = endSign * (absStartLon - CesiumMath.EPSILON11);\r\n return 1;\r\n } else if (\r\n CesiumMath.equalsEpsilon(absEndLon, CesiumMath.PI, CesiumMath.EPSILON11)\r\n ) {\r\n const startSign = CesiumMath.sign(start.longitude);\r\n end.longitude = startSign * (absEndLon - CesiumMath.EPSILON11);\r\n return 2;\r\n }\r\n return 0;\r\n}\r\n\r\nconst startCartographicScratch = new Cartographic();\r\nconst endCartographicScratch = new Cartographic();\r\n\r\nconst segmentStartTopScratch = new Cartesian3();\r\nconst segmentEndTopScratch = new Cartesian3();\r\nconst segmentStartBottomScratch = new Cartesian3();\r\nconst segmentEndBottomScratch = new Cartesian3();\r\nconst segmentStartNormalScratch = new Cartesian3();\r\nconst segmentEndNormalScratch = new Cartesian3();\r\n\r\nconst getHeightCartographics = [\r\n startCartographicScratch,\r\n endCartographicScratch,\r\n];\r\nconst getHeightRectangleScratch = new Rectangle();\r\n\r\nconst adjustHeightStartTopScratch = new Cartesian3();\r\nconst adjustHeightEndTopScratch = new Cartesian3();\r\nconst adjustHeightStartBottomScratch = new Cartesian3();\r\nconst adjustHeightEndBottomScratch = new Cartesian3();\r\n\r\nconst segmentStart2DScratch = new Cartesian3();\r\nconst segmentEnd2DScratch = new Cartesian3();\r\nconst segmentStartNormal2DScratch = new Cartesian3();\r\nconst segmentEndNormal2DScratch = new Cartesian3();\r\n\r\nconst offsetScratch = new Cartesian3();\r\nconst startUpScratch = new Cartesian3();\r\nconst endUpScratch = new Cartesian3();\r\nconst rightScratch = new Cartesian3();\r\nconst startPlaneNormalScratch = new Cartesian3();\r\nconst endPlaneNormalScratch = new Cartesian3();\r\nconst encodeScratch = new EncodedCartesian3();\r\n\r\nconst encodeScratch2D = new EncodedCartesian3();\r\nconst forwardOffset2DScratch = new Cartesian3();\r\nconst right2DScratch = new Cartesian3();\r\n\r\nconst normalNudgeScratch = new Cartesian3();\r\n\r\nconst scratchBoundingSpheres = [new BoundingSphere(), new BoundingSphere()];\r\n\r\n// Winding order is reversed so each segment's volume is inside-out\r\nconst REFERENCE_INDICES = [\r\n 0,\r\n 2,\r\n 1,\r\n 0,\r\n 3,\r\n 2, // right\r\n 0,\r\n 7,\r\n 3,\r\n 0,\r\n 4,\r\n 7, // start\r\n 0,\r\n 5,\r\n 4,\r\n 0,\r\n 1,\r\n 5, // bottom\r\n 5,\r\n 7,\r\n 4,\r\n 5,\r\n 6,\r\n 7, // left\r\n 5,\r\n 2,\r\n 6,\r\n 5,\r\n 1,\r\n 2, // end\r\n 3,\r\n 6,\r\n 2,\r\n 3,\r\n 7,\r\n 6, // top\r\n];\r\nconst REFERENCE_INDICES_LENGTH = REFERENCE_INDICES.length;\r\n\r\n// Decompose the \"wall\" into a series of shadow volumes.\r\n// Each shadow volume's vertices encode a description of the line it contains,\r\n// including mitering planes at the end points, a plane along the line itself,\r\n// and attributes for computing length-wise texture coordinates.\r\nfunction generateGeometryAttributes(\r\n loop,\r\n projection,\r\n bottomPositionsArray,\r\n topPositionsArray,\r\n normalsArray,\r\n cartographicsArray,\r\n compute2dAttributes\r\n) {\r\n let i;\r\n let index;\r\n const ellipsoid = projection._ellipsoid;\r\n\r\n // Each segment will have 8 vertices\r\n const segmentCount = bottomPositionsArray.length / 3 - 1;\r\n const vertexCount = segmentCount * 8;\r\n const arraySizeVec4 = vertexCount * 4;\r\n const indexCount = segmentCount * 36;\r\n\r\n const indices =\r\n vertexCount > 65535\r\n ? new Uint32Array(indexCount)\r\n : new Uint16Array(indexCount);\r\n const positionsArray = new Float64Array(vertexCount * 3);\r\n\r\n const startHiAndForwardOffsetX = new Float32Array(arraySizeVec4);\r\n const startLoAndForwardOffsetY = new Float32Array(arraySizeVec4);\r\n const startNormalAndForwardOffsetZ = new Float32Array(arraySizeVec4);\r\n const endNormalAndTextureCoordinateNormalizationX = new Float32Array(\r\n arraySizeVec4\r\n );\r\n const rightNormalAndTextureCoordinateNormalizationY = new Float32Array(\r\n arraySizeVec4\r\n );\r\n\r\n let startHiLo2D;\r\n let offsetAndRight2D;\r\n let startEndNormals2D;\r\n let texcoordNormalization2D;\r\n\r\n if (compute2dAttributes) {\r\n startHiLo2D = new Float32Array(arraySizeVec4);\r\n offsetAndRight2D = new Float32Array(arraySizeVec4);\r\n startEndNormals2D = new Float32Array(arraySizeVec4);\r\n texcoordNormalization2D = new Float32Array(vertexCount * 2);\r\n }\r\n\r\n /*** Compute total lengths for texture coordinate normalization ***/\r\n // 2D\r\n const cartographicsLength = cartographicsArray.length / 2;\r\n let length2D = 0.0;\r\n\r\n const startCartographic = startCartographicScratch;\r\n startCartographic.height = 0.0;\r\n const endCartographic = endCartographicScratch;\r\n endCartographic.height = 0.0;\r\n\r\n let segmentStartCartesian = segmentStartTopScratch;\r\n let segmentEndCartesian = segmentEndTopScratch;\r\n\r\n if (compute2dAttributes) {\r\n index = 0;\r\n for (i = 1; i < cartographicsLength; i++) {\r\n // Don't clone anything from previous segment b/c possible IDL touch\r\n startCartographic.latitude = cartographicsArray[index];\r\n startCartographic.longitude = cartographicsArray[index + 1];\r\n endCartographic.latitude = cartographicsArray[index + 2];\r\n endCartographic.longitude = cartographicsArray[index + 3];\r\n\r\n segmentStartCartesian = projection.project(\r\n startCartographic,\r\n segmentStartCartesian\r\n );\r\n segmentEndCartesian = projection.project(\r\n endCartographic,\r\n segmentEndCartesian\r\n );\r\n length2D += Cartesian3.distance(\r\n segmentStartCartesian,\r\n segmentEndCartesian\r\n );\r\n index += 2;\r\n }\r\n }\r\n\r\n // 3D\r\n const positionsLength = topPositionsArray.length / 3;\r\n segmentEndCartesian = Cartesian3.unpack(\r\n topPositionsArray,\r\n 0,\r\n segmentEndCartesian\r\n );\r\n let length3D = 0.0;\r\n\r\n index = 3;\r\n for (i = 1; i < positionsLength; i++) {\r\n segmentStartCartesian = Cartesian3.clone(\r\n segmentEndCartesian,\r\n segmentStartCartesian\r\n );\r\n segmentEndCartesian = Cartesian3.unpack(\r\n topPositionsArray,\r\n index,\r\n segmentEndCartesian\r\n );\r\n length3D += Cartesian3.distance(segmentStartCartesian, segmentEndCartesian);\r\n index += 3;\r\n }\r\n\r\n /*** Generate segments ***/\r\n let j;\r\n index = 3;\r\n let cartographicsIndex = 0;\r\n let vec2sWriteIndex = 0;\r\n let vec3sWriteIndex = 0;\r\n let vec4sWriteIndex = 0;\r\n let miterBroken = false;\r\n\r\n let endBottom = Cartesian3.unpack(\r\n bottomPositionsArray,\r\n 0,\r\n segmentEndBottomScratch\r\n );\r\n let endTop = Cartesian3.unpack(topPositionsArray, 0, segmentEndTopScratch);\r\n let endGeometryNormal = Cartesian3.unpack(\r\n normalsArray,\r\n 0,\r\n segmentEndNormalScratch\r\n );\r\n\r\n if (loop) {\r\n const preEndBottom = Cartesian3.unpack(\r\n bottomPositionsArray,\r\n bottomPositionsArray.length - 6,\r\n segmentStartBottomScratch\r\n );\r\n if (breakMiter(endGeometryNormal, preEndBottom, endBottom, endTop)) {\r\n // Miter broken as if for the last point in the loop, needs to be inverted for first point (clone of endBottom)\r\n endGeometryNormal = Cartesian3.negate(\r\n endGeometryNormal,\r\n endGeometryNormal\r\n );\r\n }\r\n }\r\n\r\n let lengthSoFar3D = 0.0;\r\n let lengthSoFar2D = 0.0;\r\n\r\n // For translating bounding volume\r\n let sumHeights = 0.0;\r\n\r\n for (i = 0; i < segmentCount; i++) {\r\n const startBottom = Cartesian3.clone(endBottom, segmentStartBottomScratch);\r\n const startTop = Cartesian3.clone(endTop, segmentStartTopScratch);\r\n let startGeometryNormal = Cartesian3.clone(\r\n endGeometryNormal,\r\n segmentStartNormalScratch\r\n );\r\n\r\n if (miterBroken) {\r\n startGeometryNormal = Cartesian3.negate(\r\n startGeometryNormal,\r\n startGeometryNormal\r\n );\r\n }\r\n\r\n endBottom = Cartesian3.unpack(\r\n bottomPositionsArray,\r\n index,\r\n segmentEndBottomScratch\r\n );\r\n endTop = Cartesian3.unpack(topPositionsArray, index, segmentEndTopScratch);\r\n endGeometryNormal = Cartesian3.unpack(\r\n normalsArray,\r\n index,\r\n segmentEndNormalScratch\r\n );\r\n\r\n miterBroken = breakMiter(endGeometryNormal, startBottom, endBottom, endTop);\r\n\r\n // 2D - don't clone anything from previous segment b/c possible IDL touch\r\n startCartographic.latitude = cartographicsArray[cartographicsIndex];\r\n startCartographic.longitude = cartographicsArray[cartographicsIndex + 1];\r\n endCartographic.latitude = cartographicsArray[cartographicsIndex + 2];\r\n endCartographic.longitude = cartographicsArray[cartographicsIndex + 3];\r\n let start2D;\r\n let end2D;\r\n let startGeometryNormal2D;\r\n let endGeometryNormal2D;\r\n\r\n if (compute2dAttributes) {\r\n const nudgeResult = nudgeCartographic(startCartographic, endCartographic);\r\n start2D = projection.project(startCartographic, segmentStart2DScratch);\r\n end2D = projection.project(endCartographic, segmentEnd2DScratch);\r\n const direction2D = direction(end2D, start2D, forwardOffset2DScratch);\r\n direction2D.y = Math.abs(direction2D.y);\r\n\r\n startGeometryNormal2D = segmentStartNormal2DScratch;\r\n endGeometryNormal2D = segmentEndNormal2DScratch;\r\n if (\r\n nudgeResult === 0 ||\r\n Cartesian3.dot(direction2D, Cartesian3.UNIT_Y) > MITER_BREAK_SMALL\r\n ) {\r\n // No nudge - project the original normal\r\n // Or, if the line's angle relative to the IDL is very acute,\r\n // in which case snapping will produce oddly shaped volumes.\r\n startGeometryNormal2D = projectNormal(\r\n projection,\r\n startCartographic,\r\n startGeometryNormal,\r\n start2D,\r\n segmentStartNormal2DScratch\r\n );\r\n endGeometryNormal2D = projectNormal(\r\n projection,\r\n endCartographic,\r\n endGeometryNormal,\r\n end2D,\r\n segmentEndNormal2DScratch\r\n );\r\n } else if (nudgeResult === 1) {\r\n // Start is close to IDL - snap start normal to align with IDL\r\n endGeometryNormal2D = projectNormal(\r\n projection,\r\n endCartographic,\r\n endGeometryNormal,\r\n end2D,\r\n segmentEndNormal2DScratch\r\n );\r\n startGeometryNormal2D.x = 0.0;\r\n // If start longitude is negative and end longitude is less negative, relative right is unit -Y\r\n // If start longitude is positive and end longitude is less positive, relative right is unit +Y\r\n startGeometryNormal2D.y = CesiumMath.sign(\r\n startCartographic.longitude - Math.abs(endCartographic.longitude)\r\n );\r\n startGeometryNormal2D.z = 0.0;\r\n } else {\r\n // End is close to IDL - snap end normal to align with IDL\r\n startGeometryNormal2D = projectNormal(\r\n projection,\r\n startCartographic,\r\n startGeometryNormal,\r\n start2D,\r\n segmentStartNormal2DScratch\r\n );\r\n endGeometryNormal2D.x = 0.0;\r\n // If end longitude is negative and start longitude is less negative, relative right is unit Y\r\n // If end longitude is positive and start longitude is less positive, relative right is unit -Y\r\n endGeometryNormal2D.y = CesiumMath.sign(\r\n startCartographic.longitude - endCartographic.longitude\r\n );\r\n endGeometryNormal2D.z = 0.0;\r\n }\r\n }\r\n\r\n /****************************************\r\n * Geometry descriptors of a \"line on terrain,\"\r\n * as opposed to the \"shadow volume used to draw\r\n * the line on terrain\":\r\n * - position of start + offset to end\r\n * - start, end, and right-facing planes\r\n * - encoded texture coordinate offsets\r\n ****************************************/\r\n\r\n /* 3D */\r\n const segmentLength3D = Cartesian3.distance(startTop, endTop);\r\n\r\n const encodedStart = EncodedCartesian3.fromCartesian(\r\n startBottom,\r\n encodeScratch\r\n );\r\n const forwardOffset = Cartesian3.subtract(\r\n endBottom,\r\n startBottom,\r\n offsetScratch\r\n );\r\n const forward = Cartesian3.normalize(forwardOffset, rightScratch);\r\n\r\n let startUp = Cartesian3.subtract(startTop, startBottom, startUpScratch);\r\n startUp = Cartesian3.normalize(startUp, startUp);\r\n let rightNormal = Cartesian3.cross(forward, startUp, rightScratch);\r\n rightNormal = Cartesian3.normalize(rightNormal, rightNormal);\r\n\r\n let startPlaneNormal = Cartesian3.cross(\r\n startUp,\r\n startGeometryNormal,\r\n startPlaneNormalScratch\r\n );\r\n startPlaneNormal = Cartesian3.normalize(startPlaneNormal, startPlaneNormal);\r\n\r\n let endUp = Cartesian3.subtract(endTop, endBottom, endUpScratch);\r\n endUp = Cartesian3.normalize(endUp, endUp);\r\n let endPlaneNormal = Cartesian3.cross(\r\n endGeometryNormal,\r\n endUp,\r\n endPlaneNormalScratch\r\n );\r\n endPlaneNormal = Cartesian3.normalize(endPlaneNormal, endPlaneNormal);\r\n\r\n const texcoordNormalization3DX = segmentLength3D / length3D;\r\n const texcoordNormalization3DY = lengthSoFar3D / length3D;\r\n\r\n /* 2D */\r\n let segmentLength2D = 0.0;\r\n let encodedStart2D;\r\n let forwardOffset2D;\r\n let right2D;\r\n let texcoordNormalization2DX = 0.0;\r\n let texcoordNormalization2DY = 0.0;\r\n if (compute2dAttributes) {\r\n segmentLength2D = Cartesian3.distance(start2D, end2D);\r\n\r\n encodedStart2D = EncodedCartesian3.fromCartesian(\r\n start2D,\r\n encodeScratch2D\r\n );\r\n forwardOffset2D = Cartesian3.subtract(\r\n end2D,\r\n start2D,\r\n forwardOffset2DScratch\r\n );\r\n\r\n // Right direction is just forward direction rotated by -90 degrees around Z\r\n // Similarly with plane normals\r\n right2D = Cartesian3.normalize(forwardOffset2D, right2DScratch);\r\n const swap = right2D.x;\r\n right2D.x = right2D.y;\r\n right2D.y = -swap;\r\n\r\n texcoordNormalization2DX = segmentLength2D / length2D;\r\n texcoordNormalization2DY = lengthSoFar2D / length2D;\r\n }\r\n /** Pack **/\r\n for (j = 0; j < 8; j++) {\r\n const vec4Index = vec4sWriteIndex + j * 4;\r\n const vec2Index = vec2sWriteIndex + j * 2;\r\n const wIndex = vec4Index + 3;\r\n\r\n // Encode sidedness of vertex relative to right plane in texture coordinate normalization X,\r\n // whether vertex is top or bottom of volume in sign/magnitude of normalization Y.\r\n const rightPlaneSide = j < 4 ? 1.0 : -1.0;\r\n const topBottomSide =\r\n j === 2 || j === 3 || j === 6 || j === 7 ? 1.0 : -1.0;\r\n\r\n // 3D\r\n Cartesian3.pack(encodedStart.high, startHiAndForwardOffsetX, vec4Index);\r\n startHiAndForwardOffsetX[wIndex] = forwardOffset.x;\r\n\r\n Cartesian3.pack(encodedStart.low, startLoAndForwardOffsetY, vec4Index);\r\n startLoAndForwardOffsetY[wIndex] = forwardOffset.y;\r\n\r\n Cartesian3.pack(\r\n startPlaneNormal,\r\n startNormalAndForwardOffsetZ,\r\n vec4Index\r\n );\r\n startNormalAndForwardOffsetZ[wIndex] = forwardOffset.z;\r\n\r\n Cartesian3.pack(\r\n endPlaneNormal,\r\n endNormalAndTextureCoordinateNormalizationX,\r\n vec4Index\r\n );\r\n endNormalAndTextureCoordinateNormalizationX[wIndex] =\r\n texcoordNormalization3DX * rightPlaneSide;\r\n\r\n Cartesian3.pack(\r\n rightNormal,\r\n rightNormalAndTextureCoordinateNormalizationY,\r\n vec4Index\r\n );\r\n\r\n let texcoordNormalization = texcoordNormalization3DY * topBottomSide;\r\n if (texcoordNormalization === 0.0 && topBottomSide < 0.0) {\r\n texcoordNormalization = 9.0; // some value greater than 1.0\r\n }\r\n rightNormalAndTextureCoordinateNormalizationY[\r\n wIndex\r\n ] = texcoordNormalization;\r\n\r\n // 2D\r\n if (compute2dAttributes) {\r\n startHiLo2D[vec4Index] = encodedStart2D.high.x;\r\n startHiLo2D[vec4Index + 1] = encodedStart2D.high.y;\r\n startHiLo2D[vec4Index + 2] = encodedStart2D.low.x;\r\n startHiLo2D[vec4Index + 3] = encodedStart2D.low.y;\r\n\r\n startEndNormals2D[vec4Index] = -startGeometryNormal2D.y;\r\n startEndNormals2D[vec4Index + 1] = startGeometryNormal2D.x;\r\n startEndNormals2D[vec4Index + 2] = endGeometryNormal2D.y;\r\n startEndNormals2D[vec4Index + 3] = -endGeometryNormal2D.x;\r\n\r\n offsetAndRight2D[vec4Index] = forwardOffset2D.x;\r\n offsetAndRight2D[vec4Index + 1] = forwardOffset2D.y;\r\n offsetAndRight2D[vec4Index + 2] = right2D.x;\r\n offsetAndRight2D[vec4Index + 3] = right2D.y;\r\n\r\n texcoordNormalization2D[vec2Index] =\r\n texcoordNormalization2DX * rightPlaneSide;\r\n\r\n texcoordNormalization = texcoordNormalization2DY * topBottomSide;\r\n if (texcoordNormalization === 0.0 && topBottomSide < 0.0) {\r\n texcoordNormalization = 9.0; // some value greater than 1.0\r\n }\r\n texcoordNormalization2D[vec2Index + 1] = texcoordNormalization;\r\n }\r\n }\r\n\r\n // Adjust height of volume in 3D\r\n const adjustHeightStartBottom = adjustHeightStartBottomScratch;\r\n const adjustHeightEndBottom = adjustHeightEndBottomScratch;\r\n const adjustHeightStartTop = adjustHeightStartTopScratch;\r\n const adjustHeightEndTop = adjustHeightEndTopScratch;\r\n\r\n const getHeightsRectangle = Rectangle.fromCartographicArray(\r\n getHeightCartographics,\r\n getHeightRectangleScratch\r\n );\r\n const minMaxHeights = ApproximateTerrainHeights.getMinimumMaximumHeights(\r\n getHeightsRectangle,\r\n ellipsoid\r\n );\r\n const minHeight = minMaxHeights.minimumTerrainHeight;\r\n const maxHeight = minMaxHeights.maximumTerrainHeight;\r\n\r\n sumHeights += minHeight;\r\n sumHeights += maxHeight;\r\n\r\n adjustHeights(\r\n startBottom,\r\n startTop,\r\n minHeight,\r\n maxHeight,\r\n adjustHeightStartBottom,\r\n adjustHeightStartTop\r\n );\r\n adjustHeights(\r\n endBottom,\r\n endTop,\r\n minHeight,\r\n maxHeight,\r\n adjustHeightEndBottom,\r\n adjustHeightEndTop\r\n );\r\n\r\n // Nudge the positions away from the \"polyline\" a little bit to prevent errors in GeometryPipeline\r\n let normalNudge = Cartesian3.multiplyByScalar(\r\n rightNormal,\r\n CesiumMath.EPSILON5,\r\n normalNudgeScratch\r\n );\r\n Cartesian3.add(\r\n adjustHeightStartBottom,\r\n normalNudge,\r\n adjustHeightStartBottom\r\n );\r\n Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);\r\n Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);\r\n Cartesian3.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);\r\n\r\n // If the segment is very close to the XZ plane, nudge the vertices slightly to avoid touching it.\r\n nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);\r\n nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);\r\n\r\n Cartesian3.pack(adjustHeightStartBottom, positionsArray, vec3sWriteIndex);\r\n Cartesian3.pack(adjustHeightEndBottom, positionsArray, vec3sWriteIndex + 3);\r\n Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 6);\r\n Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 9);\r\n\r\n normalNudge = Cartesian3.multiplyByScalar(\r\n rightNormal,\r\n -2.0 * CesiumMath.EPSILON5,\r\n normalNudgeScratch\r\n );\r\n Cartesian3.add(\r\n adjustHeightStartBottom,\r\n normalNudge,\r\n adjustHeightStartBottom\r\n );\r\n Cartesian3.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);\r\n Cartesian3.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);\r\n Cartesian3.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);\r\n\r\n nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);\r\n nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);\r\n\r\n Cartesian3.pack(\r\n adjustHeightStartBottom,\r\n positionsArray,\r\n vec3sWriteIndex + 12\r\n );\r\n Cartesian3.pack(\r\n adjustHeightEndBottom,\r\n positionsArray,\r\n vec3sWriteIndex + 15\r\n );\r\n Cartesian3.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 18);\r\n Cartesian3.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 21);\r\n\r\n cartographicsIndex += 2;\r\n index += 3;\r\n\r\n vec2sWriteIndex += 16;\r\n vec3sWriteIndex += 24;\r\n vec4sWriteIndex += 32;\r\n\r\n lengthSoFar3D += segmentLength3D;\r\n lengthSoFar2D += segmentLength2D;\r\n }\r\n\r\n index = 0;\r\n let indexOffset = 0;\r\n for (i = 0; i < segmentCount; i++) {\r\n for (j = 0; j < REFERENCE_INDICES_LENGTH; j++) {\r\n indices[index + j] = REFERENCE_INDICES[j] + indexOffset;\r\n }\r\n indexOffset += 8;\r\n index += REFERENCE_INDICES_LENGTH;\r\n }\r\n\r\n const boundingSpheres = scratchBoundingSpheres;\r\n BoundingSphere.fromVertices(\r\n bottomPositionsArray,\r\n Cartesian3.ZERO,\r\n 3,\r\n boundingSpheres[0]\r\n );\r\n BoundingSphere.fromVertices(\r\n topPositionsArray,\r\n Cartesian3.ZERO,\r\n 3,\r\n boundingSpheres[1]\r\n );\r\n const boundingSphere = BoundingSphere.fromBoundingSpheres(boundingSpheres);\r\n\r\n // Adjust bounding sphere height and radius to cover more of the volume\r\n boundingSphere.radius += sumHeights / (segmentCount * 2.0);\r\n\r\n const attributes = {\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n normalize: false,\r\n values: positionsArray,\r\n }),\r\n startHiAndForwardOffsetX: getVec4GeometryAttribute(\r\n startHiAndForwardOffsetX\r\n ),\r\n startLoAndForwardOffsetY: getVec4GeometryAttribute(\r\n startLoAndForwardOffsetY\r\n ),\r\n startNormalAndForwardOffsetZ: getVec4GeometryAttribute(\r\n startNormalAndForwardOffsetZ\r\n ),\r\n endNormalAndTextureCoordinateNormalizationX: getVec4GeometryAttribute(\r\n endNormalAndTextureCoordinateNormalizationX\r\n ),\r\n rightNormalAndTextureCoordinateNormalizationY: getVec4GeometryAttribute(\r\n rightNormalAndTextureCoordinateNormalizationY\r\n ),\r\n };\r\n\r\n if (compute2dAttributes) {\r\n attributes.startHiLo2D = getVec4GeometryAttribute(startHiLo2D);\r\n attributes.offsetAndRight2D = getVec4GeometryAttribute(offsetAndRight2D);\r\n attributes.startEndNormals2D = getVec4GeometryAttribute(startEndNormals2D);\r\n attributes.texcoordNormalization2D = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n normalize: false,\r\n values: texcoordNormalization2D,\r\n });\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n boundingSphere: boundingSphere,\r\n });\r\n}\r\n\r\nfunction getVec4GeometryAttribute(typedArray) {\r\n return new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 4,\r\n normalize: false,\r\n values: typedArray,\r\n });\r\n}\r\n\r\n/**\r\n * Approximates an ellipsoid-tangent vector in 2D by projecting the end point into 2D.\r\n * Exposed for testing.\r\n *\r\n * @param {MapProjection} projection Map Projection for projecting coordinates to 2D.\r\n * @param {Cartographic} cartographic The cartographic origin point of the normal.\r\n * Used to check if the normal crosses the IDL during projection.\r\n * @param {Cartesian3} normal The normal in 3D.\r\n * @param {Cartesian3} projectedPosition The projected origin point of the normal in 2D.\r\n * @param {Cartesian3} result Result parameter on which to store the projected normal.\r\n * @private\r\n */\r\nGroundPolylineGeometry._projectNormal = projectNormal;\r\nexport default GroundPolylineGeometry;\r\n","import ApproximateTerrainHeights from \"../Core/ApproximateTerrainHeights.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport GroundPolylineGeometry from \"../Core/GroundPolylineGeometry.js\";\r\n\r\nfunction createGroundPolylineGeometry(groundPolylineGeometry, offset) {\r\n return ApproximateTerrainHeights.initialize().then(function () {\r\n if (defined(offset)) {\r\n groundPolylineGeometry = GroundPolylineGeometry.unpack(\r\n groundPolylineGeometry,\r\n offset\r\n );\r\n }\r\n return GroundPolylineGeometry.createGeometry(groundPolylineGeometry);\r\n });\r\n}\r\nexport default createGroundPolylineGeometry;\r\n"],"names":["defaultValue","Ellipsoid","Rectangle","GeographicProjection","Check","CesiumMath","defined","Cartesian2","Cartesian3","Cartographic","BoundingSphere","Resource","buildModuleUrl","DeveloperError","WebMercatorProjection","ArcType","EllipsoidGeodesic","EllipsoidRhumbLine","Plane","IntersectionTests","arrayRemoveDuplicates","Matrix3","Quaternion","EncodedCartesian3","ApproximateTerrainHeights","GeometryAttribute","ComponentDatatype","Geometry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EASA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,sBAAsB,CAAC,OAAO,EAAE;EACzC,EAAE,OAAO,GAAGA,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA,EAAE,IAAI,CAAC,UAAU,GAAGA,yBAAY,CAAC,OAAO,CAAC,SAAS,EAAEC,iBAAS,CAAC,KAAK,CAAC,CAAC;EACrE,EAAE,IAAI,CAAC,UAAU,GAAGD,yBAAY,CAAC,OAAO,CAAC,SAAS,EAAEE,iBAAS,CAAC,SAAS,CAAC,CAAC;EACzE,EAAE,IAAI,CAAC,WAAW,GAAG,IAAIC,+BAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;EAC/D,EAAE,IAAI,CAAC,wBAAwB,GAAGH,yBAAY;EAC9C,IAAI,OAAO,CAAC,uBAAuB;EACnC,IAAI,CAAC;EACL,GAAG,CAAC;EACJ,EAAE,IAAI,CAAC,wBAAwB,GAAGA,yBAAY;EAC9C,IAAI,OAAO,CAAC,uBAAuB;EACnC,IAAI,CAAC;EACL,GAAG,CAAC;EACJ,CAAC;AACD;EACA,MAAM,CAAC,gBAAgB,CAAC,sBAAsB,C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M,sBAAsB,GAAG,sBAAsB,CAAC,MAAM;EAC5D,QAAQ,sBAAsB;EAC9B,QAAQ,MAAM;EACd,OAAO,CAAC;EACR,KAAK;EACL,IAAI,OAAO,sBAAsB,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;EACzE,GAAG,CAAC,CAAC;EACL;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createPlaneGeometry.js b/examples/cesium/Workers/createPlaneGeometry.js
new file mode 100644
index 0000000..eda36e7
--- /dev/null
+++ b/examples/cesium/Workers/createPlaneGeometry.js
@@ -0,0 +1,276 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './VertexFormat-f2d74c96', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29'], (function (defaultValue, Transforms, Matrix3, Check, ComponentDatatype, GeometryAttribute, GeometryAttributes, VertexFormat, Math$1, Matrix2, RuntimeError, combine, WebGLConstants) { 'use strict';
+
+ /**
+ * Describes geometry representing a plane centered at the origin, with a unit width and length.
+ *
+ * @alias PlaneGeometry
+ * @constructor
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ *
+ * @example
+ * const planeGeometry = new Cesium.PlaneGeometry({
+ * vertexFormat : Cesium.VertexFormat.POSITION_ONLY
+ * });
+ */
+ function PlaneGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
+
+ this._vertexFormat = vertexFormat;
+ this._workerName = "createPlaneGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ PlaneGeometry.packedLength = VertexFormat.VertexFormat.packedLength;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {PlaneGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ PlaneGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+
+ return array;
+ };
+
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+ const scratchOptions = {
+ vertexFormat: scratchVertexFormat,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {PlaneGeometry} [result] The object into which to store the result.
+ * @returns {PlaneGeometry} The modified result parameter or a new PlaneGeometry instance if one was not provided.
+ */
+ PlaneGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+
+ if (!defaultValue.defined(result)) {
+ return new PlaneGeometry(scratchOptions);
+ }
+
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+
+ return result;
+ };
+
+ const min = new Matrix3.Cartesian3(-0.5, -0.5, 0.0);
+ const max = new Matrix3.Cartesian3(0.5, 0.5, 0.0);
+
+ /**
+ * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {PlaneGeometry} planeGeometry A description of the plane.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ PlaneGeometry.createGeometry = function (planeGeometry) {
+ const vertexFormat = planeGeometry._vertexFormat;
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ let indices;
+ let positions;
+
+ if (vertexFormat.position) {
+ // 4 corner points. Duplicated 3 times each for each incident edge/face.
+ positions = new Float64Array(4 * 3);
+
+ // +z face
+ positions[0] = min.x;
+ positions[1] = min.y;
+ positions[2] = 0.0;
+ positions[3] = max.x;
+ positions[4] = min.y;
+ positions[5] = 0.0;
+ positions[6] = max.x;
+ positions[7] = max.y;
+ positions[8] = 0.0;
+ positions[9] = min.x;
+ positions[10] = max.y;
+ positions[11] = 0.0;
+
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+
+ if (vertexFormat.normal) {
+ const normals = new Float32Array(4 * 3);
+
+ // +z face
+ normals[0] = 0.0;
+ normals[1] = 0.0;
+ normals[2] = 1.0;
+ normals[3] = 0.0;
+ normals[4] = 0.0;
+ normals[5] = 1.0;
+ normals[6] = 0.0;
+ normals[7] = 0.0;
+ normals[8] = 1.0;
+ normals[9] = 0.0;
+ normals[10] = 0.0;
+ normals[11] = 1.0;
+
+ attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals,
+ });
+ }
+
+ if (vertexFormat.st) {
+ const texCoords = new Float32Array(4 * 2);
+
+ // +z face
+ texCoords[0] = 0.0;
+ texCoords[1] = 0.0;
+ texCoords[2] = 1.0;
+ texCoords[3] = 0.0;
+ texCoords[4] = 1.0;
+ texCoords[5] = 1.0;
+ texCoords[6] = 0.0;
+ texCoords[7] = 1.0;
+
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: texCoords,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ const tangents = new Float32Array(4 * 3);
+
+ // +z face
+ tangents[0] = 1.0;
+ tangents[1] = 0.0;
+ tangents[2] = 0.0;
+ tangents[3] = 1.0;
+ tangents[4] = 0.0;
+ tangents[5] = 0.0;
+ tangents[6] = 1.0;
+ tangents[7] = 0.0;
+ tangents[8] = 0.0;
+ tangents[9] = 1.0;
+ tangents[10] = 0.0;
+ tangents[11] = 0.0;
+
+ attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents,
+ });
+ }
+
+ if (vertexFormat.bitangent) {
+ const bitangents = new Float32Array(4 * 3);
+
+ // +z face
+ bitangents[0] = 0.0;
+ bitangents[1] = 1.0;
+ bitangents[2] = 0.0;
+ bitangents[3] = 0.0;
+ bitangents[4] = 1.0;
+ bitangents[5] = 0.0;
+ bitangents[6] = 0.0;
+ bitangents[7] = 1.0;
+ bitangents[8] = 0.0;
+ bitangents[9] = 0.0;
+ bitangents[10] = 1.0;
+ bitangents[11] = 0.0;
+
+ attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents,
+ });
+ }
+
+ // 2 triangles
+ indices = new Uint16Array(2 * 3);
+
+ // +z face
+ indices[0] = 0;
+ indices[1] = 1;
+ indices[2] = 2;
+ indices[3] = 0;
+ indices[4] = 2;
+ indices[5] = 3;
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ boundingSphere: new Transforms.BoundingSphere(Matrix3.Cartesian3.ZERO, Math.sqrt(2.0)),
+ });
+ };
+
+ function createPlaneGeometry(planeGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ planeGeometry = PlaneGeometry.unpack(planeGeometry, offset);
+ }
+ return PlaneGeometry.createGeometry(planeGeometry);
+ }
+
+ return createPlaneGeometry;
+
+}));
+//# sourceMappingURL=createPlaneGeometry.js.map
diff --git a/examples/cesium/Workers/createPlaneGeometry.js.map b/examples/cesium/Workers/createPlaneGeometry.js.map
new file mode 100644
index 0000000..6523dbd
--- /dev/null
+++ b/examples/cesium/Workers/createPlaneGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createPlaneGeometry.js","sources":["../../../Source/Core/PlaneGeometry.js","../../../Source/WorkersES6/createPlaneGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\n/**\r\n * Describes geometry representing a plane centered at the origin, with a unit width and length.\r\n *\r\n * @alias PlaneGeometry\r\n * @constructor\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n *\r\n * @example\r\n * const planeGeometry = new Cesium.PlaneGeometry({\r\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY\r\n * });\r\n */\r\nfunction PlaneGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\r\n\r\n this._vertexFormat = vertexFormat;\r\n this._workerName = \"createPlaneGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nPlaneGeometry.packedLength = VertexFormat.packedLength;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {PlaneGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nPlaneGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchVertexFormat = new VertexFormat();\r\nconst scratchOptions = {\r\n vertexFormat: scratchVertexFormat,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {PlaneGeometry} [result] The object into which to store the result.\r\n * @returns {PlaneGeometry} The modified result parameter or a new PlaneGeometry instance if one was not provided.\r\n */\r\nPlaneGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n\r\n if (!defined(result)) {\r\n return new PlaneGeometry(scratchOptions);\r\n }\r\n\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n\r\n return result;\r\n};\r\n\r\nconst min = new Cartesian3(-0.5, -0.5, 0.0);\r\nconst max = new Cartesian3(0.5, 0.5, 0.0);\r\n\r\n/**\r\n * Computes the geometric representation of a plane, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {PlaneGeometry} planeGeometry A description of the plane.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nPlaneGeometry.createGeometry = function (planeGeometry) {\r\n const vertexFormat = planeGeometry._vertexFormat;\r\n\r\n const attributes = new GeometryAttributes();\r\n let indices;\r\n let positions;\r\n\r\n if (vertexFormat.position) {\r\n // 4 corner points. Duplicated 3 times each for each incident edge/face.\r\n positions = new Float64Array(4 * 3);\r\n\r\n // +z face\r\n positions[0] = min.x;\r\n positions[1] = min.y;\r\n positions[2] = 0.0;\r\n positions[3] = max.x;\r\n positions[4] = min.y;\r\n positions[5] = 0.0;\r\n positions[6] = max.x;\r\n positions[7] = max.y;\r\n positions[8] = 0.0;\r\n positions[9] = min.x;\r\n positions[10] = max.y;\r\n positions[11] = 0.0;\r\n\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n\r\n if (vertexFormat.normal) {\r\n const normals = new Float32Array(4 * 3);\r\n\r\n // +z face\r\n normals[0] = 0.0;\r\n normals[1] = 0.0;\r\n normals[2] = 1.0;\r\n normals[3] = 0.0;\r\n normals[4] = 0.0;\r\n normals[5] = 1.0;\r\n normals[6] = 0.0;\r\n normals[7] = 0.0;\r\n normals[8] = 1.0;\r\n normals[9] = 0.0;\r\n normals[10] = 0.0;\r\n normals[11] = 1.0;\r\n\r\n attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normals,\r\n });\r\n }\r\n\r\n if (vertexFormat.st) {\r\n const texCoords = new Float32Array(4 * 2);\r\n\r\n // +z face\r\n texCoords[0] = 0.0;\r\n texCoords[1] = 0.0;\r\n texCoords[2] = 1.0;\r\n texCoords[3] = 0.0;\r\n texCoords[4] = 1.0;\r\n texCoords[5] = 1.0;\r\n texCoords[6] = 0.0;\r\n texCoords[7] = 1.0;\r\n\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: texCoords,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n const tangents = new Float32Array(4 * 3);\r\n\r\n // +z face\r\n tangents[0] = 1.0;\r\n tangents[1] = 0.0;\r\n tangents[2] = 0.0;\r\n tangents[3] = 1.0;\r\n tangents[4] = 0.0;\r\n tangents[5] = 0.0;\r\n tangents[6] = 1.0;\r\n tangents[7] = 0.0;\r\n tangents[8] = 0.0;\r\n tangents[9] = 1.0;\r\n tangents[10] = 0.0;\r\n tangents[11] = 0.0;\r\n\r\n attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n const bitangents = new Float32Array(4 * 3);\r\n\r\n // +z face\r\n bitangents[0] = 0.0;\r\n bitangents[1] = 1.0;\r\n bitangents[2] = 0.0;\r\n bitangents[3] = 0.0;\r\n bitangents[4] = 1.0;\r\n bitangents[5] = 0.0;\r\n bitangents[6] = 0.0;\r\n bitangents[7] = 1.0;\r\n bitangents[8] = 0.0;\r\n bitangents[9] = 0.0;\r\n bitangents[10] = 1.0;\r\n bitangents[11] = 0.0;\r\n\r\n attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangents,\r\n });\r\n }\r\n\r\n // 2 triangles\r\n indices = new Uint16Array(2 * 3);\r\n\r\n // +z face\r\n indices[0] = 0;\r\n indices[1] = 1;\r\n indices[2] = 2;\r\n indices[3] = 0;\r\n indices[4] = 2;\r\n indices[5] = 3;\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n boundingSphere: new BoundingSphere(Cartesian3.ZERO, Math.sqrt(2.0)),\r\n });\r\n};\r\nexport default PlaneGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport PlaneGeometry from \"../Core/PlaneGeometry.js\";\r\n\r\nfunction createPlaneGeometry(planeGeometry, offset) {\r\n if (defined(offset)) {\r\n planeGeometry = PlaneGeometry.unpack(planeGeometry, offset);\r\n }\r\n return PlaneGeometry.createGeometry(planeGeometry);\r\n}\r\nexport default createPlaneGeometry;\r\n"],"names":["defaultValue","VertexFormat","Check","defined","Cartesian3","GeometryAttributes","GeometryAttribute","ComponentDatatype","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAYA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,aAAa,CAAC,OAAO,EAAE;EAChC,EAAE,OAAO,GAAGA,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA,EAAE,MAAM,YAAY,GAAGA,yBAAY,CAAC,OAAO,CAAC,YAAY,EAAEC,yBAAY,CAAC,OAAO,CAAC,CAAC;AAChF;EACA,EAAE,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;EACpC,EAAE,IAAI,CAAC,WAAW,GAAG,qBAAqB,CAAC;EAC3C,CAAC;AACD;EACA;EACA;EACA;EACA;EACA,aAAa,CAAC,YAAY,GAAGA,yBAAY,CAAC,YAAY,CAAC;AACvD;EACA;EACA;EACA;EACA;EACA;EAC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;EACpD,EAAE,IAAID,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;EAChE,GAAG;EACH,EAAE,OAAO,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;EACrD;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createPlaneOutlineGeometry.js b/examples/cesium/Workers/createPlaneOutlineGeometry.js
new file mode 100644
index 0000000..9eb19e4
--- /dev/null
+++ b/examples/cesium/Workers/createPlaneOutlineGeometry.js
@@ -0,0 +1,141 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Transforms-11fb6b0a', './Matrix3-f22b0303', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './Math-9be8b918', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29'], (function (defaultValue, Transforms, Matrix3, Check, ComponentDatatype, GeometryAttribute, GeometryAttributes, Math$1, Matrix2, RuntimeError, combine, WebGLConstants) { 'use strict';
+
+ /**
+ * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.
+ *
+ * @alias PlaneOutlineGeometry
+ * @constructor
+ *
+ */
+ function PlaneOutlineGeometry() {
+ this._workerName = "createPlaneOutlineGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ PlaneOutlineGeometry.packedLength = 0;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {PlaneOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ PlaneOutlineGeometry.pack = function (value, array) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {PlaneOutlineGeometry} [result] The object into which to store the result.
+ * @returns {PlaneOutlineGeometry} The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.
+ */
+ PlaneOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ return new PlaneOutlineGeometry();
+ }
+
+ return result;
+ };
+
+ const min = new Matrix3.Cartesian3(-0.5, -0.5, 0.0);
+ const max = new Matrix3.Cartesian3(0.5, 0.5, 0.0);
+
+ /**
+ * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.
+ *
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ PlaneOutlineGeometry.createGeometry = function () {
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ const indices = new Uint16Array(4 * 2);
+ const positions = new Float64Array(4 * 3);
+
+ positions[0] = min.x;
+ positions[1] = min.y;
+ positions[2] = min.z;
+ positions[3] = max.x;
+ positions[4] = min.y;
+ positions[5] = min.z;
+ positions[6] = max.x;
+ positions[7] = max.y;
+ positions[8] = min.z;
+ positions[9] = min.x;
+ positions[10] = max.y;
+ positions[11] = min.z;
+
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+
+ indices[0] = 0;
+ indices[1] = 1;
+ indices[2] = 1;
+ indices[3] = 2;
+ indices[4] = 2;
+ indices[5] = 3;
+ indices[6] = 3;
+ indices[7] = 0;
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: new Transforms.BoundingSphere(Matrix3.Cartesian3.ZERO, Math.sqrt(2.0)),
+ });
+ };
+
+ function createPlaneOutlineGeometry(planeGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ planeGeometry = PlaneOutlineGeometry.unpack(planeGeometry, offset);
+ }
+ return PlaneOutlineGeometry.createGeometry(planeGeometry);
+ }
+
+ return createPlaneOutlineGeometry;
+
+}));
+//# sourceMappingURL=createPlaneOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createPlaneOutlineGeometry.js.map b/examples/cesium/Workers/createPlaneOutlineGeometry.js.map
new file mode 100644
index 0000000..88b5a1d
--- /dev/null
+++ b/examples/cesium/Workers/createPlaneOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createPlaneOutlineGeometry.js","sources":["../../../Source/Core/PlaneOutlineGeometry.js","../../../Source/WorkersES6/createPlaneOutlineGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defined from \"./defined.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\n\r\n/**\r\n * Describes geometry representing the outline of a plane centered at the origin, with a unit width and length.\r\n *\r\n * @alias PlaneOutlineGeometry\r\n * @constructor\r\n *\r\n */\r\nfunction PlaneOutlineGeometry() {\r\n this._workerName = \"createPlaneOutlineGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nPlaneOutlineGeometry.packedLength = 0;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {PlaneOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nPlaneOutlineGeometry.pack = function (value, array) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {PlaneOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {PlaneOutlineGeometry} The modified result parameter or a new PlaneOutlineGeometry instance if one was not provided.\r\n */\r\nPlaneOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n return new PlaneOutlineGeometry();\r\n }\r\n\r\n return result;\r\n};\r\n\r\nconst min = new Cartesian3(-0.5, -0.5, 0.0);\r\nconst max = new Cartesian3(0.5, 0.5, 0.0);\r\n\r\n/**\r\n * Computes the geometric representation of an outline of a plane, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nPlaneOutlineGeometry.createGeometry = function () {\r\n const attributes = new GeometryAttributes();\r\n const indices = new Uint16Array(4 * 2);\r\n const positions = new Float64Array(4 * 3);\r\n\r\n positions[0] = min.x;\r\n positions[1] = min.y;\r\n positions[2] = min.z;\r\n positions[3] = max.x;\r\n positions[4] = min.y;\r\n positions[5] = min.z;\r\n positions[6] = max.x;\r\n positions[7] = max.y;\r\n positions[8] = min.z;\r\n positions[9] = min.x;\r\n positions[10] = max.y;\r\n positions[11] = min.z;\r\n\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n\r\n indices[0] = 0;\r\n indices[1] = 1;\r\n indices[2] = 1;\r\n indices[3] = 2;\r\n indices[4] = 2;\r\n indices[5] = 3;\r\n indices[6] = 3;\r\n indices[7] = 0;\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: new BoundingSphere(Cartesian3.ZERO, Math.sqrt(2.0)),\r\n });\r\n};\r\nexport default PlaneOutlineGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport PlaneOutlineGeometry from \"../Core/PlaneOutlineGeometry.js\";\r\n\r\nfunction createPlaneOutlineGeometry(planeGeometry, offset) {\r\n if (defined(offset)) {\r\n planeGeometry = PlaneOutlineGeometry.unpack(planeGeometry, offset);\r\n }\r\n return PlaneOutlineGeometry.createGeometry(planeGeometry);\r\n}\r\nexport default createPlaneOutlineGeometry;\r\n"],"names":["Check","defined","Cartesian3","GeometryAttributes","GeometryAttribute","ComponentDatatype","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,oBAAoB,GAAG;EAChC,EAAE,IAAI,CAAC,WAAW,GAAG,4BAA4B,CAAC;EAClD,CAAC;AACD;EACA;EACA;EACA;EACA;EACA,oBAAoB,CAAC,YAAY,GAAG,CAAC,CAAC;AACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,oBAAoB,CAAC,IAAI,GAAG,UAAU,KAAK,EAAE,KAAK,EAAE;E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CAAC;AACjB;EACA,EAAE,OAAO,IAAIC,0BAAQ,CAAC;EACtB,IAAI,UAAU,EAAE,UAAU;EAC1B,IAAI,OAAO,EAAE,OAAO;EACpB,IAAI,aAAa,EAAEC,+BAAa,CAAC,KAAK;EACtC,IAAI,cAAc,EAAE,IAAIC,yBAAc,CAACN,kBAAU,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;EACvE,GAAG,CAAC,CAAC;EACL,CAAC;;EC5GD,SAAS,0BAA0B,CAAC,aAAa,EAAE,MAAM,EAAE;EAC3D,EAAE,IAAID,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,aAAa,GAAG,oBAAoB,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;EACvE,GAAG;EACH,EAAE,OAAO,oBAAoB,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;EAC5D;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createPolygonGeometry.js b/examples/cesium/Workers/createPolygonGeometry.js
new file mode 100644
index 0000000..002e113
--- /dev/null
+++ b/examples/cesium/Workers/createPolygonGeometry.js
@@ -0,0 +1,1446 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './ArcType-d608b872', './BoundingRectangle-6617ed83', './Transforms-11fb6b0a', './Matrix2-036c77dd', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './EllipsoidGeodesic-38d0ed4a', './EllipsoidTangentPlane-c421b2cb', './GeometryAttribute-f2746b95', './GeometryInstance-b2be3e5a', './GeometryOffsetAttribute-cc320d7d', './GeometryPipeline-f28890f4', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolygonGeometryLibrary-62266ab5', './PolygonPipeline-313487c3', './VertexFormat-f2d74c96', './combine-4598d225', './RuntimeError-e5c6a8b9', './WebGLConstants-f27a5e29', './AxisAlignedBoundingBox-50342d27', './IntersectionTests-2c7928de', './Plane-c9f1487d', './AttributeCompression-e9888cb8', './EncodedCartesian3-38e2691f', './arrayRemoveDuplicates-c3526030', './EllipsoidRhumbLine-48b4507b', './GeometryAttributes-eb2609b7'], (function (defaultValue, Matrix3, ArcType, BoundingRectangle, Transforms, Matrix2, Check, ComponentDatatype, EllipsoidGeodesic, EllipsoidTangentPlane, GeometryAttribute, GeometryInstance, GeometryOffsetAttribute, GeometryPipeline, IndexDatatype, Math$1, PolygonGeometryLibrary, PolygonPipeline, VertexFormat, combine, RuntimeError, WebGLConstants, AxisAlignedBoundingBox, IntersectionTests, Plane, AttributeCompression, EncodedCartesian3, arrayRemoveDuplicates, EllipsoidRhumbLine, GeometryAttributes) { 'use strict';
+
+ const scratchCarto1 = new Matrix3.Cartographic();
+ const scratchCarto2 = new Matrix3.Cartographic();
+ function adjustPosHeightsForNormal(position, p1, p2, ellipsoid) {
+ const carto1 = ellipsoid.cartesianToCartographic(position, scratchCarto1);
+ const height = carto1.height;
+ const p1Carto = ellipsoid.cartesianToCartographic(p1, scratchCarto2);
+ p1Carto.height = height;
+ ellipsoid.cartographicToCartesian(p1Carto, p1);
+
+ const p2Carto = ellipsoid.cartesianToCartographic(p2, scratchCarto2);
+ p2Carto.height = height - 100;
+ ellipsoid.cartographicToCartesian(p2Carto, p2);
+ }
+
+ const scratchBoundingRectangle = new BoundingRectangle.BoundingRectangle();
+ const scratchPosition = new Matrix3.Cartesian3();
+ const scratchNormal = new Matrix3.Cartesian3();
+ const scratchTangent = new Matrix3.Cartesian3();
+ const scratchBitangent = new Matrix3.Cartesian3();
+ const p1Scratch = new Matrix3.Cartesian3();
+ const p2Scratch = new Matrix3.Cartesian3();
+ let scratchPerPosNormal = new Matrix3.Cartesian3();
+ let scratchPerPosTangent = new Matrix3.Cartesian3();
+ let scratchPerPosBitangent = new Matrix3.Cartesian3();
+
+ const appendTextureCoordinatesOrigin = new Matrix2.Cartesian2();
+ const appendTextureCoordinatesCartesian2 = new Matrix2.Cartesian2();
+ const appendTextureCoordinatesCartesian3 = new Matrix3.Cartesian3();
+ const appendTextureCoordinatesQuaternion = new Transforms.Quaternion();
+ const appendTextureCoordinatesMatrix3 = new Matrix3.Matrix3();
+ const tangentMatrixScratch = new Matrix3.Matrix3();
+
+ function computeAttributes(options) {
+ const vertexFormat = options.vertexFormat;
+ const geometry = options.geometry;
+ const shadowVolume = options.shadowVolume;
+ const flatPositions = geometry.attributes.position.values;
+ const flatTexcoords = defaultValue.defined(geometry.attributes.st)
+ ? geometry.attributes.st.values
+ : undefined;
+
+ let length = flatPositions.length;
+ const wall = options.wall;
+ const top = options.top || wall;
+ const bottom = options.bottom || wall;
+ if (
+ vertexFormat.st ||
+ vertexFormat.normal ||
+ vertexFormat.tangent ||
+ vertexFormat.bitangent ||
+ shadowVolume
+ ) {
+ // PERFORMANCE_IDEA: Compute before subdivision, then just interpolate during subdivision.
+ // PERFORMANCE_IDEA: Compute with createGeometryFromPositions() for fast path when there's no holes.
+ const boundingRectangle = options.boundingRectangle;
+ const tangentPlane = options.tangentPlane;
+ const ellipsoid = options.ellipsoid;
+ const stRotation = options.stRotation;
+ const perPositionHeight = options.perPositionHeight;
+
+ const origin = appendTextureCoordinatesOrigin;
+ origin.x = boundingRectangle.x;
+ origin.y = boundingRectangle.y;
+
+ const textureCoordinates = vertexFormat.st
+ ? new Float32Array(2 * (length / 3))
+ : undefined;
+ let normals;
+ if (vertexFormat.normal) {
+ if (perPositionHeight && top && !wall) {
+ normals = geometry.attributes.normal.values;
+ } else {
+ normals = new Float32Array(length);
+ }
+ }
+ const tangents = vertexFormat.tangent
+ ? new Float32Array(length)
+ : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(length)
+ : undefined;
+ const extrudeNormals = shadowVolume ? new Float32Array(length) : undefined;
+
+ let textureCoordIndex = 0;
+ let attrIndex = 0;
+
+ let normal = scratchNormal;
+ let tangent = scratchTangent;
+ let bitangent = scratchBitangent;
+ let recomputeNormal = true;
+
+ let textureMatrix = appendTextureCoordinatesMatrix3;
+ let tangentRotationMatrix = tangentMatrixScratch;
+ if (stRotation !== 0.0) {
+ let rotation = Transforms.Quaternion.fromAxisAngle(
+ tangentPlane._plane.normal,
+ stRotation,
+ appendTextureCoordinatesQuaternion
+ );
+ textureMatrix = Matrix3.Matrix3.fromQuaternion(rotation, textureMatrix);
+
+ rotation = Transforms.Quaternion.fromAxisAngle(
+ tangentPlane._plane.normal,
+ -stRotation,
+ appendTextureCoordinatesQuaternion
+ );
+ tangentRotationMatrix = Matrix3.Matrix3.fromQuaternion(
+ rotation,
+ tangentRotationMatrix
+ );
+ } else {
+ textureMatrix = Matrix3.Matrix3.clone(Matrix3.Matrix3.IDENTITY, textureMatrix);
+ tangentRotationMatrix = Matrix3.Matrix3.clone(
+ Matrix3.Matrix3.IDENTITY,
+ tangentRotationMatrix
+ );
+ }
+
+ let bottomOffset = 0;
+ let bottomOffset2 = 0;
+
+ if (top && bottom) {
+ bottomOffset = length / 2;
+ bottomOffset2 = length / 3;
+
+ length /= 2;
+ }
+
+ for (let i = 0; i < length; i += 3) {
+ const position = Matrix3.Cartesian3.fromArray(
+ flatPositions,
+ i,
+ appendTextureCoordinatesCartesian3
+ );
+
+ if (vertexFormat.st) {
+ if (!defaultValue.defined(flatTexcoords)) {
+ let p = Matrix3.Matrix3.multiplyByVector(
+ textureMatrix,
+ position,
+ scratchPosition
+ );
+ p = ellipsoid.scaleToGeodeticSurface(p, p);
+ const st = tangentPlane.projectPointOntoPlane(
+ p,
+ appendTextureCoordinatesCartesian2
+ );
+ Matrix2.Cartesian2.subtract(st, origin, st);
+
+ const stx = Math$1.CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);
+ const sty = Math$1.CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);
+ if (bottom) {
+ textureCoordinates[textureCoordIndex + bottomOffset2] = stx;
+ textureCoordinates[textureCoordIndex + 1 + bottomOffset2] = sty;
+ }
+ if (top) {
+ textureCoordinates[textureCoordIndex] = stx;
+ textureCoordinates[textureCoordIndex + 1] = sty;
+ }
+
+ textureCoordIndex += 2;
+ }
+ }
+
+ if (
+ vertexFormat.normal ||
+ vertexFormat.tangent ||
+ vertexFormat.bitangent ||
+ shadowVolume
+ ) {
+ const attrIndex1 = attrIndex + 1;
+ const attrIndex2 = attrIndex + 2;
+
+ if (wall) {
+ if (i + 3 < length) {
+ const p1 = Matrix3.Cartesian3.fromArray(flatPositions, i + 3, p1Scratch);
+
+ if (recomputeNormal) {
+ const p2 = Matrix3.Cartesian3.fromArray(
+ flatPositions,
+ i + length,
+ p2Scratch
+ );
+ if (perPositionHeight) {
+ adjustPosHeightsForNormal(position, p1, p2, ellipsoid);
+ }
+ Matrix3.Cartesian3.subtract(p1, position, p1);
+ Matrix3.Cartesian3.subtract(p2, position, p2);
+ normal = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(p2, p1, normal),
+ normal
+ );
+ recomputeNormal = false;
+ }
+
+ if (Matrix3.Cartesian3.equalsEpsilon(p1, position, Math$1.CesiumMath.EPSILON10)) {
+ // if we've reached a corner
+ recomputeNormal = true;
+ }
+ }
+
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent);
+ if (vertexFormat.tangent) {
+ tangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(bitangent, normal, tangent),
+ tangent
+ );
+ }
+ }
+ } else {
+ normal = ellipsoid.geodeticSurfaceNormal(position, normal);
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ if (perPositionHeight) {
+ scratchPerPosNormal = Matrix3.Cartesian3.fromArray(
+ normals,
+ attrIndex,
+ scratchPerPosNormal
+ );
+ scratchPerPosTangent = Matrix3.Cartesian3.cross(
+ Matrix3.Cartesian3.UNIT_Z,
+ scratchPerPosNormal,
+ scratchPerPosTangent
+ );
+ scratchPerPosTangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Matrix3.multiplyByVector(
+ tangentRotationMatrix,
+ scratchPerPosTangent,
+ scratchPerPosTangent
+ ),
+ scratchPerPosTangent
+ );
+ if (vertexFormat.bitangent) {
+ scratchPerPosBitangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(
+ scratchPerPosNormal,
+ scratchPerPosTangent,
+ scratchPerPosBitangent
+ ),
+ scratchPerPosBitangent
+ );
+ }
+ }
+
+ tangent = Matrix3.Cartesian3.cross(Matrix3.Cartesian3.UNIT_Z, normal, tangent);
+ tangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent),
+ tangent
+ );
+ if (vertexFormat.bitangent) {
+ bitangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(normal, tangent, bitangent),
+ bitangent
+ );
+ }
+ }
+ }
+
+ if (vertexFormat.normal) {
+ if (options.wall) {
+ normals[attrIndex + bottomOffset] = normal.x;
+ normals[attrIndex1 + bottomOffset] = normal.y;
+ normals[attrIndex2 + bottomOffset] = normal.z;
+ } else if (bottom) {
+ normals[attrIndex + bottomOffset] = -normal.x;
+ normals[attrIndex1 + bottomOffset] = -normal.y;
+ normals[attrIndex2 + bottomOffset] = -normal.z;
+ }
+
+ if ((top && !perPositionHeight) || wall) {
+ normals[attrIndex] = normal.x;
+ normals[attrIndex1] = normal.y;
+ normals[attrIndex2] = normal.z;
+ }
+ }
+
+ if (shadowVolume) {
+ if (wall) {
+ normal = ellipsoid.geodeticSurfaceNormal(position, normal);
+ }
+ extrudeNormals[attrIndex + bottomOffset] = -normal.x;
+ extrudeNormals[attrIndex1 + bottomOffset] = -normal.y;
+ extrudeNormals[attrIndex2 + bottomOffset] = -normal.z;
+ }
+
+ if (vertexFormat.tangent) {
+ if (options.wall) {
+ tangents[attrIndex + bottomOffset] = tangent.x;
+ tangents[attrIndex1 + bottomOffset] = tangent.y;
+ tangents[attrIndex2 + bottomOffset] = tangent.z;
+ } else if (bottom) {
+ tangents[attrIndex + bottomOffset] = -tangent.x;
+ tangents[attrIndex1 + bottomOffset] = -tangent.y;
+ tangents[attrIndex2 + bottomOffset] = -tangent.z;
+ }
+
+ if (top) {
+ if (perPositionHeight) {
+ tangents[attrIndex] = scratchPerPosTangent.x;
+ tangents[attrIndex1] = scratchPerPosTangent.y;
+ tangents[attrIndex2] = scratchPerPosTangent.z;
+ } else {
+ tangents[attrIndex] = tangent.x;
+ tangents[attrIndex1] = tangent.y;
+ tangents[attrIndex2] = tangent.z;
+ }
+ }
+ }
+
+ if (vertexFormat.bitangent) {
+ if (bottom) {
+ bitangents[attrIndex + bottomOffset] = bitangent.x;
+ bitangents[attrIndex1 + bottomOffset] = bitangent.y;
+ bitangents[attrIndex2 + bottomOffset] = bitangent.z;
+ }
+ if (top) {
+ if (perPositionHeight) {
+ bitangents[attrIndex] = scratchPerPosBitangent.x;
+ bitangents[attrIndex1] = scratchPerPosBitangent.y;
+ bitangents[attrIndex2] = scratchPerPosBitangent.z;
+ } else {
+ bitangents[attrIndex] = bitangent.x;
+ bitangents[attrIndex1] = bitangent.y;
+ bitangents[attrIndex2] = bitangent.z;
+ }
+ }
+ }
+ attrIndex += 3;
+ }
+ }
+
+ if (vertexFormat.st && !defaultValue.defined(flatTexcoords)) {
+ geometry.attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates,
+ });
+ }
+
+ if (vertexFormat.normal) {
+ geometry.attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ geometry.attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents,
+ });
+ }
+
+ if (vertexFormat.bitangent) {
+ geometry.attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents,
+ });
+ }
+
+ if (shadowVolume) {
+ geometry.attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: extrudeNormals,
+ });
+ }
+ }
+
+ if (options.extrude && defaultValue.defined(options.offsetAttribute)) {
+ const size = flatPositions.length / 3;
+ let offsetAttribute = new Uint8Array(size);
+
+ if (options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
+ if ((top && bottom) || wall) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else if (top) {
+ offsetAttribute = offsetAttribute.fill(1);
+ }
+ } else {
+ const offsetValue =
+ options.offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+
+ geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute,
+ });
+ }
+
+ return geometry;
+ }
+
+ const startCartographicScratch = new Matrix3.Cartographic();
+ const endCartographicScratch = new Matrix3.Cartographic();
+ const idlCross = {
+ westOverIDL: 0.0,
+ eastOverIDL: 0.0,
+ };
+ let ellipsoidGeodesic = new EllipsoidGeodesic.EllipsoidGeodesic();
+ function computeRectangle(positions, ellipsoid, arcType, granularity, result) {
+ result = defaultValue.defaultValue(result, new Matrix2.Rectangle());
+ if (!defaultValue.defined(positions) || positions.length < 3) {
+ result.west = 0.0;
+ result.north = 0.0;
+ result.south = 0.0;
+ result.east = 0.0;
+ return result;
+ }
+
+ if (arcType === ArcType.ArcType.RHUMB) {
+ return Matrix2.Rectangle.fromCartesianArray(positions, ellipsoid, result);
+ }
+
+ if (!ellipsoidGeodesic.ellipsoid.equals(ellipsoid)) {
+ ellipsoidGeodesic = new EllipsoidGeodesic.EllipsoidGeodesic(undefined, undefined, ellipsoid);
+ }
+
+ result.west = Number.POSITIVE_INFINITY;
+ result.east = Number.NEGATIVE_INFINITY;
+ result.south = Number.POSITIVE_INFINITY;
+ result.north = Number.NEGATIVE_INFINITY;
+
+ idlCross.westOverIDL = Number.POSITIVE_INFINITY;
+ idlCross.eastOverIDL = Number.NEGATIVE_INFINITY;
+
+ const inverseChordLength =
+ 1.0 / Math$1.CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);
+ const positionsLength = positions.length;
+ let endCartographic = ellipsoid.cartesianToCartographic(
+ positions[0],
+ endCartographicScratch
+ );
+ let startCartographic = startCartographicScratch;
+ let swap;
+
+ for (let i = 1; i < positionsLength; i++) {
+ swap = startCartographic;
+ startCartographic = endCartographic;
+ endCartographic = ellipsoid.cartesianToCartographic(positions[i], swap);
+ ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
+ interpolateAndGrowRectangle(
+ ellipsoidGeodesic,
+ inverseChordLength,
+ result,
+ idlCross
+ );
+ }
+
+ swap = startCartographic;
+ startCartographic = endCartographic;
+ endCartographic = ellipsoid.cartesianToCartographic(positions[0], swap);
+ ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
+ interpolateAndGrowRectangle(
+ ellipsoidGeodesic,
+ inverseChordLength,
+ result,
+ idlCross
+ );
+
+ if (result.east - result.west > idlCross.eastOverIDL - idlCross.westOverIDL) {
+ result.west = idlCross.westOverIDL;
+ result.east = idlCross.eastOverIDL;
+
+ if (result.east > Math$1.CesiumMath.PI) {
+ result.east = result.east - Math$1.CesiumMath.TWO_PI;
+ }
+ if (result.west > Math$1.CesiumMath.PI) {
+ result.west = result.west - Math$1.CesiumMath.TWO_PI;
+ }
+ }
+
+ return result;
+ }
+
+ const interpolatedCartographicScratch = new Matrix3.Cartographic();
+ function interpolateAndGrowRectangle(
+ ellipsoidGeodesic,
+ inverseChordLength,
+ result,
+ idlCross
+ ) {
+ const segmentLength = ellipsoidGeodesic.surfaceDistance;
+
+ const numPoints = Math.ceil(segmentLength * inverseChordLength);
+ const subsegmentDistance =
+ numPoints > 0 ? segmentLength / (numPoints - 1) : Number.POSITIVE_INFINITY;
+ let interpolationDistance = 0.0;
+
+ for (let i = 0; i < numPoints; i++) {
+ const interpolatedCartographic = ellipsoidGeodesic.interpolateUsingSurfaceDistance(
+ interpolationDistance,
+ interpolatedCartographicScratch
+ );
+ interpolationDistance += subsegmentDistance;
+ const longitude = interpolatedCartographic.longitude;
+ const latitude = interpolatedCartographic.latitude;
+
+ result.west = Math.min(result.west, longitude);
+ result.east = Math.max(result.east, longitude);
+ result.south = Math.min(result.south, latitude);
+ result.north = Math.max(result.north, latitude);
+
+ const lonAdjusted =
+ longitude >= 0 ? longitude : longitude + Math$1.CesiumMath.TWO_PI;
+ idlCross.westOverIDL = Math.min(idlCross.westOverIDL, lonAdjusted);
+ idlCross.eastOverIDL = Math.max(idlCross.eastOverIDL, lonAdjusted);
+ }
+ }
+
+ const createGeometryFromPositionsExtrudedPositions = [];
+
+ function createGeometryFromPositionsExtruded(
+ ellipsoid,
+ polygon,
+ textureCoordinates,
+ granularity,
+ hierarchy,
+ perPositionHeight,
+ closeTop,
+ closeBottom,
+ vertexFormat,
+ arcType
+ ) {
+ const geos = {
+ walls: [],
+ };
+ let i;
+
+ if (closeTop || closeBottom) {
+ const topGeo = PolygonGeometryLibrary.PolygonGeometryLibrary.createGeometryFromPositions(
+ ellipsoid,
+ polygon,
+ textureCoordinates,
+ granularity,
+ perPositionHeight,
+ vertexFormat,
+ arcType
+ );
+
+ const edgePoints = topGeo.attributes.position.values;
+ const indices = topGeo.indices;
+ let numPositions;
+ let newIndices;
+
+ if (closeTop && closeBottom) {
+ const topBottomPositions = edgePoints.concat(edgePoints);
+
+ numPositions = topBottomPositions.length / 3;
+
+ newIndices = IndexDatatype.IndexDatatype.createTypedArray(
+ numPositions,
+ indices.length * 2
+ );
+ newIndices.set(indices);
+ const ilength = indices.length;
+
+ const length = numPositions / 2;
+
+ for (i = 0; i < ilength; i += 3) {
+ const i0 = newIndices[i] + length;
+ const i1 = newIndices[i + 1] + length;
+ const i2 = newIndices[i + 2] + length;
+
+ newIndices[i + ilength] = i2;
+ newIndices[i + 1 + ilength] = i1;
+ newIndices[i + 2 + ilength] = i0;
+ }
+
+ topGeo.attributes.position.values = topBottomPositions;
+ if (perPositionHeight && vertexFormat.normal) {
+ const normals = topGeo.attributes.normal.values;
+ topGeo.attributes.normal.values = new Float32Array(
+ topBottomPositions.length
+ );
+ topGeo.attributes.normal.values.set(normals);
+ }
+
+ if (vertexFormat.st && defaultValue.defined(textureCoordinates)) {
+ const texcoords = topGeo.attributes.st.values;
+ topGeo.attributes.st.values = new Float32Array(numPositions * 2);
+ topGeo.attributes.st.values = texcoords.concat(texcoords);
+ }
+
+ topGeo.indices = newIndices;
+ } else if (closeBottom) {
+ numPositions = edgePoints.length / 3;
+ newIndices = IndexDatatype.IndexDatatype.createTypedArray(numPositions, indices.length);
+
+ for (i = 0; i < indices.length; i += 3) {
+ newIndices[i] = indices[i + 2];
+ newIndices[i + 1] = indices[i + 1];
+ newIndices[i + 2] = indices[i];
+ }
+
+ topGeo.indices = newIndices;
+ }
+
+ geos.topAndBottom = new GeometryInstance.GeometryInstance({
+ geometry: topGeo,
+ });
+ }
+
+ let outerRing = hierarchy.outerRing;
+ let tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(outerRing, ellipsoid);
+ let positions2D = tangentPlane.projectPointsOntoPlane(
+ outerRing,
+ createGeometryFromPositionsExtrudedPositions
+ );
+
+ let windingOrder = PolygonPipeline.PolygonPipeline.computeWindingOrder2D(positions2D);
+ if (windingOrder === PolygonPipeline.WindingOrder.CLOCKWISE) {
+ outerRing = outerRing.slice().reverse();
+ }
+
+ let wallGeo = PolygonGeometryLibrary.PolygonGeometryLibrary.computeWallGeometry(
+ outerRing,
+ textureCoordinates,
+ ellipsoid,
+ granularity,
+ perPositionHeight,
+ arcType
+ );
+ geos.walls.push(
+ new GeometryInstance.GeometryInstance({
+ geometry: wallGeo,
+ })
+ );
+
+ const holes = hierarchy.holes;
+ for (i = 0; i < holes.length; i++) {
+ let hole = holes[i];
+
+ tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(hole, ellipsoid);
+ positions2D = tangentPlane.projectPointsOntoPlane(
+ hole,
+ createGeometryFromPositionsExtrudedPositions
+ );
+
+ windingOrder = PolygonPipeline.PolygonPipeline.computeWindingOrder2D(positions2D);
+ if (windingOrder === PolygonPipeline.WindingOrder.COUNTER_CLOCKWISE) {
+ hole = hole.slice().reverse();
+ }
+
+ wallGeo = PolygonGeometryLibrary.PolygonGeometryLibrary.computeWallGeometry(
+ hole,
+ textureCoordinates,
+ ellipsoid,
+ granularity,
+ perPositionHeight,
+ arcType
+ );
+ geos.walls.push(
+ new GeometryInstance.GeometryInstance({
+ geometry: wallGeo,
+ })
+ );
+ }
+
+ return geos;
+ }
+
+ /**
+ * A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
+ *
+ * @alias PolygonGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
+ * @param {Number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface.
+ * @param {Number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
+ * @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.
+ * @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.
+ * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
+ * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
+ *
+ * @see PolygonGeometry#createGeometry
+ * @see PolygonGeometry#fromPositions
+ *
+ * @demo {@link https://sandcastle.cesium.com/index.html?src=Polygon.html|Cesium Sandcastle Polygon Demo}
+ *
+ * @example
+ * // 1. create a polygon from points
+ * const polygon = new Cesium.PolygonGeometry({
+ * polygonHierarchy : new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0,
+ * -75.0, 30.0,
+ * -70.0, 30.0,
+ * -68.0, 40.0
+ * ])
+ * )
+ * });
+ * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
+ *
+ * // 2. create a nested polygon with holes
+ * const polygonWithHole = new Cesium.PolygonGeometry({
+ * polygonHierarchy : new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -109.0, 30.0,
+ * -95.0, 30.0,
+ * -95.0, 40.0,
+ * -109.0, 40.0
+ * ]),
+ * [new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -107.0, 31.0,
+ * -107.0, 39.0,
+ * -97.0, 39.0,
+ * -97.0, 31.0
+ * ]),
+ * [new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -105.0, 33.0,
+ * -99.0, 33.0,
+ * -99.0, 37.0,
+ * -105.0, 37.0
+ * ]),
+ * [new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -103.0, 34.0,
+ * -101.0, 34.0,
+ * -101.0, 36.0,
+ * -103.0, 36.0
+ * ])
+ * )]
+ * )]
+ * )]
+ * )
+ * });
+ * const geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);
+ *
+ * // 3. create extruded polygon
+ * const extrudedPolygon = new Cesium.PolygonGeometry({
+ * polygonHierarchy : new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0,
+ * -75.0, 30.0,
+ * -70.0, 30.0,
+ * -68.0, 40.0
+ * ])
+ * ),
+ * extrudedHeight: 300000
+ * });
+ * const geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);
+ */
+ function PolygonGeometry(options) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("options", options);
+ Check.Check.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
+ if (
+ defaultValue.defined(options.perPositionHeight) &&
+ options.perPositionHeight &&
+ defaultValue.defined(options.height)
+ ) {
+ throw new Check.DeveloperError(
+ "Cannot use both options.perPositionHeight and options.height"
+ );
+ }
+ if (
+ defaultValue.defined(options.arcType) &&
+ options.arcType !== ArcType.ArcType.GEODESIC &&
+ options.arcType !== ArcType.ArcType.RHUMB
+ ) {
+ throw new Check.DeveloperError(
+ "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const polygonHierarchy = options.polygonHierarchy;
+ const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ const stRotation = defaultValue.defaultValue(options.stRotation, 0.0);
+ const textureCoordinates = options.textureCoordinates;
+ const perPositionHeight = defaultValue.defaultValue(options.perPositionHeight, false);
+ const perPositionHeightExtrude =
+ perPositionHeight && defaultValue.defined(options.extrudedHeight);
+ let height = defaultValue.defaultValue(options.height, 0.0);
+ let extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
+
+ if (!perPositionHeightExtrude) {
+ const h = Math.max(height, extrudedHeight);
+ extrudedHeight = Math.min(height, extrudedHeight);
+ height = h;
+ }
+
+ this._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat);
+ this._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid);
+ this._granularity = granularity;
+ this._stRotation = stRotation;
+ this._height = height;
+ this._extrudedHeight = extrudedHeight;
+ this._closeTop = defaultValue.defaultValue(options.closeTop, true);
+ this._closeBottom = defaultValue.defaultValue(options.closeBottom, true);
+ this._polygonHierarchy = polygonHierarchy;
+ this._perPositionHeight = perPositionHeight;
+ this._perPositionHeightExtrude = perPositionHeightExtrude;
+ this._shadowVolume = defaultValue.defaultValue(options.shadowVolume, false);
+ this._workerName = "createPolygonGeometry";
+ this._offsetAttribute = options.offsetAttribute;
+ this._arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
+
+ this._rectangle = undefined;
+ this._textureCoordinateRotationPoints = undefined;
+ this._textureCoordinates = textureCoordinates;
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ PolygonGeometryLibrary.PolygonGeometryLibrary.computeHierarchyPackedLength(
+ polygonHierarchy,
+ Matrix3.Cartesian3
+ ) +
+ Matrix3.Ellipsoid.packedLength +
+ VertexFormat.VertexFormat.packedLength +
+ (textureCoordinates
+ ? PolygonGeometryLibrary.PolygonGeometryLibrary.computeHierarchyPackedLength(
+ textureCoordinates,
+ Matrix2.Cartesian2
+ )
+ : 1) +
+ 12;
+ }
+
+ /**
+ * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.
+ * @param {Number} [options.height=0.0] The height of the polygon.
+ * @param {Number} [options.extrudedHeight] The height of the polygon extrusion.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
+ * @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.
+ * @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.
+ * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
+ * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.
+ * @returns {PolygonGeometry}
+ *
+ * @example
+ * // create a polygon from points
+ * const polygon = Cesium.PolygonGeometry.fromPositions({
+ * positions : Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0,
+ * -75.0, 30.0,
+ * -70.0, 30.0,
+ * -68.0, 40.0
+ * ])
+ * });
+ * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);
+ *
+ * @see PolygonGeometry#createGeometry
+ */
+ PolygonGeometry.fromPositions = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("options.positions", options.positions);
+ //>>includeEnd('debug');
+
+ const newOptions = {
+ polygonHierarchy: {
+ positions: options.positions,
+ },
+ height: options.height,
+ extrudedHeight: options.extrudedHeight,
+ vertexFormat: options.vertexFormat,
+ stRotation: options.stRotation,
+ ellipsoid: options.ellipsoid,
+ granularity: options.granularity,
+ perPositionHeight: options.perPositionHeight,
+ closeTop: options.closeTop,
+ closeBottom: options.closeBottom,
+ offsetAttribute: options.offsetAttribute,
+ arcType: options.arcType,
+ textureCoordinates: options.textureCoordinates,
+ };
+ return new PolygonGeometry(newOptions);
+ };
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {PolygonGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ PolygonGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ startingIndex = PolygonGeometryLibrary.PolygonGeometryLibrary.packPolygonHierarchy(
+ value._polygonHierarchy,
+ array,
+ startingIndex,
+ Matrix3.Cartesian3
+ );
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._stRotation;
+ array[startingIndex++] = value._perPositionHeightExtrude ? 1.0 : 0.0;
+ array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0;
+ array[startingIndex++] = value._closeTop ? 1.0 : 0.0;
+ array[startingIndex++] = value._closeBottom ? 1.0 : 0.0;
+ array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;
+ array[startingIndex++] = defaultValue.defaultValue(value._offsetAttribute, -1);
+ array[startingIndex++] = value._arcType;
+ if (defaultValue.defined(value._textureCoordinates)) {
+ startingIndex = PolygonGeometryLibrary.PolygonGeometryLibrary.packPolygonHierarchy(
+ value._textureCoordinates,
+ array,
+ startingIndex,
+ Matrix2.Cartesian2
+ );
+ } else {
+ array[startingIndex++] = -1.0;
+ }
+ array[startingIndex++] = value.packedLength;
+ return array;
+ };
+
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+
+ //Only used to avoid inability to default construct.
+ const dummyOptions = {
+ polygonHierarchy: {},
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {PolygonGeometry} [result] The object into which to store the result.
+ */
+ PolygonGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const polygonHierarchy = PolygonGeometryLibrary.PolygonGeometryLibrary.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Matrix3.Cartesian3
+ );
+ startingIndex = polygonHierarchy.startingIndex;
+ delete polygonHierarchy.startingIndex;
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ const height = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const stRotation = array[startingIndex++];
+ const perPositionHeightExtrude = array[startingIndex++] === 1.0;
+ const perPositionHeight = array[startingIndex++] === 1.0;
+ const closeTop = array[startingIndex++] === 1.0;
+ const closeBottom = array[startingIndex++] === 1.0;
+ const shadowVolume = array[startingIndex++] === 1.0;
+ const offsetAttribute = array[startingIndex++];
+ const arcType = array[startingIndex++];
+ const textureCoordinates =
+ array[startingIndex] === -1.0
+ ? undefined
+ : PolygonGeometryLibrary.PolygonGeometryLibrary.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Matrix2.Cartesian2
+ );
+ if (defaultValue.defined(textureCoordinates)) {
+ startingIndex = textureCoordinates.startingIndex;
+ delete textureCoordinates.startingIndex;
+ } else {
+ startingIndex++;
+ }
+ const packedLength = array[startingIndex++];
+
+ if (!defaultValue.defined(result)) {
+ result = new PolygonGeometry(dummyOptions);
+ }
+
+ result._polygonHierarchy = polygonHierarchy;
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._height = height;
+ result._extrudedHeight = extrudedHeight;
+ result._granularity = granularity;
+ result._stRotation = stRotation;
+ result._perPositionHeightExtrude = perPositionHeightExtrude;
+ result._perPositionHeight = perPositionHeight;
+ result._closeTop = closeTop;
+ result._closeBottom = closeBottom;
+ result._shadowVolume = shadowVolume;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+ result._arcType = arcType;
+ result._textureCoordinates = textureCoordinates;
+ result.packedLength = packedLength;
+
+ return result;
+ };
+
+ /**
+ * Returns the bounding rectangle given the provided options
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
+ * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {Rectangle} [result] An object in which to store the result.
+ *
+ * @returns {Rectangle} The result rectangle
+ */
+ PolygonGeometry.computeRectangle = function (options, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("options", options);
+ Check.Check.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
+ //>>includeEnd('debug');
+
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ const arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
+ //>>includeStart('debug', pragmas.debug);
+ if (arcType !== ArcType.ArcType.GEODESIC && arcType !== ArcType.ArcType.RHUMB) {
+ throw new Check.DeveloperError(
+ "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const polygonHierarchy = options.polygonHierarchy;
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+
+ return computeRectangle(
+ polygonHierarchy.positions,
+ ellipsoid,
+ arcType,
+ granularity,
+ result
+ );
+ };
+
+ /**
+ * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {PolygonGeometry} polygonGeometry A description of the polygon.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ PolygonGeometry.createGeometry = function (polygonGeometry) {
+ const vertexFormat = polygonGeometry._vertexFormat;
+ const ellipsoid = polygonGeometry._ellipsoid;
+ const granularity = polygonGeometry._granularity;
+ const stRotation = polygonGeometry._stRotation;
+ const polygonHierarchy = polygonGeometry._polygonHierarchy;
+ const perPositionHeight = polygonGeometry._perPositionHeight;
+ const closeTop = polygonGeometry._closeTop;
+ const closeBottom = polygonGeometry._closeBottom;
+ const arcType = polygonGeometry._arcType;
+ const textureCoordinates = polygonGeometry._textureCoordinates;
+
+ const hasTextureCoordinates = defaultValue.defined(textureCoordinates);
+
+ let outerPositions = polygonHierarchy.positions;
+ if (outerPositions.length < 3) {
+ return;
+ }
+
+ const tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(
+ outerPositions,
+ ellipsoid
+ );
+
+ const results = PolygonGeometryLibrary.PolygonGeometryLibrary.polygonsFromHierarchy(
+ polygonHierarchy,
+ hasTextureCoordinates,
+ tangentPlane.projectPointsOntoPlane.bind(tangentPlane),
+ !perPositionHeight,
+ ellipsoid
+ );
+
+ const hierarchy = results.hierarchy;
+ const polygons = results.polygons;
+
+ const dummyFunction = function (identity) {
+ return identity;
+ };
+
+ const textureCoordinatePolygons = hasTextureCoordinates
+ ? PolygonGeometryLibrary.PolygonGeometryLibrary.polygonsFromHierarchy(
+ textureCoordinates,
+ true,
+ dummyFunction,
+ false
+ ).polygons
+ : undefined;
+
+ if (hierarchy.length === 0) {
+ return;
+ }
+
+ outerPositions = hierarchy[0].outerRing;
+ const boundingRectangle = PolygonGeometryLibrary.PolygonGeometryLibrary.computeBoundingRectangle(
+ tangentPlane.plane.normal,
+ tangentPlane.projectPointOntoPlane.bind(tangentPlane),
+ outerPositions,
+ stRotation,
+ scratchBoundingRectangle
+ );
+
+ const geometries = [];
+
+ const height = polygonGeometry._height;
+ const extrudedHeight = polygonGeometry._extrudedHeight;
+ const extrude =
+ polygonGeometry._perPositionHeightExtrude ||
+ !Math$1.CesiumMath.equalsEpsilon(height, extrudedHeight, 0, Math$1.CesiumMath.EPSILON2);
+
+ const options = {
+ perPositionHeight: perPositionHeight,
+ vertexFormat: vertexFormat,
+ geometry: undefined,
+ tangentPlane: tangentPlane,
+ boundingRectangle: boundingRectangle,
+ ellipsoid: ellipsoid,
+ stRotation: stRotation,
+ textureCoordinates: undefined,
+ bottom: false,
+ top: true,
+ wall: false,
+ extrude: false,
+ arcType: arcType,
+ };
+
+ let i;
+
+ if (extrude) {
+ options.extrude = true;
+ options.top = closeTop;
+ options.bottom = closeBottom;
+ options.shadowVolume = polygonGeometry._shadowVolume;
+ options.offsetAttribute = polygonGeometry._offsetAttribute;
+ for (i = 0; i < polygons.length; i++) {
+ const splitGeometry = createGeometryFromPositionsExtruded(
+ ellipsoid,
+ polygons[i],
+ hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,
+ granularity,
+ hierarchy[i],
+ perPositionHeight,
+ closeTop,
+ closeBottom,
+ vertexFormat,
+ arcType
+ );
+
+ let topAndBottom;
+ if (closeTop && closeBottom) {
+ topAndBottom = splitGeometry.topAndBottom;
+ options.geometry = PolygonGeometryLibrary.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(
+ topAndBottom.geometry,
+ height,
+ extrudedHeight,
+ ellipsoid,
+ perPositionHeight
+ );
+ } else if (closeTop) {
+ topAndBottom = splitGeometry.topAndBottom;
+ topAndBottom.geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ topAndBottom.geometry.attributes.position.values,
+ height,
+ ellipsoid,
+ !perPositionHeight
+ );
+ options.geometry = topAndBottom.geometry;
+ } else if (closeBottom) {
+ topAndBottom = splitGeometry.topAndBottom;
+ topAndBottom.geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ topAndBottom.geometry.attributes.position.values,
+ extrudedHeight,
+ ellipsoid,
+ true
+ );
+ options.geometry = topAndBottom.geometry;
+ }
+ if (closeTop || closeBottom) {
+ options.wall = false;
+ topAndBottom.geometry = computeAttributes(options);
+ geometries.push(topAndBottom);
+ }
+
+ const walls = splitGeometry.walls;
+ options.wall = true;
+ for (let k = 0; k < walls.length; k++) {
+ const wall = walls[k];
+ options.geometry = PolygonGeometryLibrary.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(
+ wall.geometry,
+ height,
+ extrudedHeight,
+ ellipsoid,
+ perPositionHeight
+ );
+ wall.geometry = computeAttributes(options);
+ geometries.push(wall);
+ }
+ }
+ } else {
+ for (i = 0; i < polygons.length; i++) {
+ const geometryInstance = new GeometryInstance.GeometryInstance({
+ geometry: PolygonGeometryLibrary.PolygonGeometryLibrary.createGeometryFromPositions(
+ ellipsoid,
+ polygons[i],
+ hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,
+ granularity,
+ perPositionHeight,
+ vertexFormat,
+ arcType
+ ),
+ });
+ geometryInstance.geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ geometryInstance.geometry.attributes.position.values,
+ height,
+ ellipsoid,
+ !perPositionHeight
+ );
+ options.geometry = geometryInstance.geometry;
+
+ geometryInstance.geometry = computeAttributes(options);
+
+ if (defaultValue.defined(polygonGeometry._offsetAttribute)) {
+ const length =
+ geometryInstance.geometry.attributes.position.values.length;
+ const offsetValue =
+ polygonGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute(
+ {
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ }
+ );
+ }
+
+ geometries.push(geometryInstance);
+ }
+ }
+
+ const geometry = GeometryPipeline.GeometryPipeline.combineInstances(geometries)[0];
+ geometry.attributes.position.values = new Float64Array(
+ geometry.attributes.position.values
+ );
+ geometry.indices = IndexDatatype.IndexDatatype.createTypedArray(
+ geometry.attributes.position.values.length / 3,
+ geometry.indices
+ );
+
+ const attributes = geometry.attributes;
+ const boundingSphere = Transforms.BoundingSphere.fromVertices(
+ attributes.position.values
+ );
+
+ if (!vertexFormat.position) {
+ delete attributes.position;
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: geometry.indices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere: boundingSphere,
+ offsetAttribute: polygonGeometry._offsetAttribute,
+ });
+ };
+
+ /**
+ * @private
+ */
+ PolygonGeometry.createShadowVolume = function (
+ polygonGeometry,
+ minHeightFunc,
+ maxHeightFunc
+ ) {
+ const granularity = polygonGeometry._granularity;
+ const ellipsoid = polygonGeometry._ellipsoid;
+
+ const minHeight = minHeightFunc(granularity, ellipsoid);
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
+
+ return new PolygonGeometry({
+ polygonHierarchy: polygonGeometry._polygonHierarchy,
+ ellipsoid: ellipsoid,
+ stRotation: polygonGeometry._stRotation,
+ granularity: granularity,
+ perPositionHeight: false,
+ extrudedHeight: minHeight,
+ height: maxHeight,
+ vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
+ shadowVolume: true,
+ arcType: polygonGeometry._arcType,
+ });
+ };
+
+ function textureCoordinateRotationPoints(polygonGeometry) {
+ const stRotation = -polygonGeometry._stRotation;
+ if (stRotation === 0.0) {
+ return [0, 0, 0, 1, 1, 0];
+ }
+ const ellipsoid = polygonGeometry._ellipsoid;
+ const positions = polygonGeometry._polygonHierarchy.positions;
+ const boundingRectangle = polygonGeometry.rectangle;
+ return GeometryAttribute.Geometry._textureCoordinateRotationPoints(
+ positions,
+ stRotation,
+ ellipsoid,
+ boundingRectangle
+ );
+ }
+
+ Object.defineProperties(PolygonGeometry.prototype, {
+ /**
+ * @private
+ */
+ rectangle: {
+ get: function () {
+ if (!defaultValue.defined(this._rectangle)) {
+ const positions = this._polygonHierarchy.positions;
+ this._rectangle = computeRectangle(
+ positions,
+ this._ellipsoid,
+ this._arcType,
+ this._granularity
+ );
+ }
+
+ return this._rectangle;
+ },
+ },
+ /**
+ * For remapping texture coordinates when rendering PolygonGeometries as GroundPrimitives.
+ * @private
+ */
+ textureCoordinateRotationPoints: {
+ get: function () {
+ if (!defaultValue.defined(this._textureCoordinateRotationPoints)) {
+ this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(
+ this
+ );
+ }
+ return this._textureCoordinateRotationPoints;
+ },
+ },
+ });
+
+ function createPolygonGeometry(polygonGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ polygonGeometry = PolygonGeometry.unpack(polygonGeometry, offset);
+ }
+ polygonGeometry._ellipsoid = Matrix3.Ellipsoid.clone(polygonGeometry._ellipsoid);
+ return PolygonGeometry.createGeometry(polygonGeometry);
+ }
+
+ return createPolygonGeometry;
+
+}));
+//# sourceMappingURL=createPolygonGeometry.js.map
diff --git a/examples/cesium/Workers/createPolygonGeometry.js.map b/examples/cesium/Workers/createPolygonGeometry.js.map
new file mode 100644
index 0000000..206cbfd
--- /dev/null
+++ b/examples/cesium/Workers/createPolygonGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createPolygonGeometry.js","sources":["../../../Source/Core/PolygonGeometry.js","../../../Source/WorkersES6/createPolygonGeometry.js"],"sourcesContent":["import ArcType from \"./ArcType.js\";\r\nimport BoundingRectangle from \"./BoundingRectangle.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport EllipsoidGeodesic from \"./EllipsoidGeodesic.js\";\r\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryInstance from \"./GeometryInstance.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport GeometryPipeline from \"./GeometryPipeline.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\r\nimport PolygonPipeline from \"./PolygonPipeline.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\nimport WindingOrder from \"./WindingOrder.js\";\r\n\r\nconst scratchCarto1 = new Cartographic();\r\nconst scratchCarto2 = new Cartographic();\r\nfunction adjustPosHeightsForNormal(position, p1, p2, ellipsoid) {\r\n const carto1 = ellipsoid.cartesianToCartographic(position, scratchCarto1);\r\n const height = carto1.height;\r\n const p1Carto = ellipsoid.cartesianToCartographic(p1, scratchCarto2);\r\n p1Carto.height = height;\r\n ellipsoid.cartographicToCartesian(p1Carto, p1);\r\n\r\n const p2Carto = ellipsoid.cartesianToCartographic(p2, scratchCarto2);\r\n p2Carto.height = height - 100;\r\n ellipsoid.cartographicToCartesian(p2Carto, p2);\r\n}\r\n\r\nconst scratchBoundingRectangle = new BoundingRectangle();\r\nconst scratchPosition = new Cartesian3();\r\nconst scratchNormal = new Cartesian3();\r\nconst scratchTangent = new Cartesian3();\r\nconst scratchBitangent = new Cartesian3();\r\nconst p1Scratch = new Cartesian3();\r\nconst p2Scratch = new Cartesian3();\r\nlet scratchPerPosNormal = new Cartesian3();\r\nlet scratchPerPosTangent = new Cartesian3();\r\nlet scratchPerPosBitangent = new Cartesian3();\r\n\r\nconst appendTextureCoordinatesOrigin = new Cartesian2();\r\nconst appendTextureCoordinatesCartesian2 = new Cartesian2();\r\nconst appendTextureCoordinatesCartesian3 = new Cartesian3();\r\nconst appendTextureCoordinatesQuaternion = new Quaternion();\r\nconst appendTextureCoordinatesMatrix3 = new Matrix3();\r\nconst tangentMatrixScratch = new Matrix3();\r\n\r\nfunction computeAttributes(options) {\r\n const vertexFormat = options.vertexFormat;\r\n const geometry = options.geometry;\r\n const shadowVolume = options.shadowVolume;\r\n const flatPositions = geometry.attributes.position.values;\r\n const flatTexcoords = defined(geometry.attributes.st)\r\n ? geometry.attributes.st.values\r\n : undefined;\r\n\r\n let length = flatPositions.length;\r\n const wall = options.wall;\r\n const top = options.top || wall;\r\n const bottom = options.bottom || wall;\r\n if (\r\n vertexFormat.st ||\r\n vertexFormat.normal ||\r\n vertexFormat.tangent ||\r\n vertexFormat.bitangent ||\r\n shadowVolume\r\n ) {\r\n // PERFORMANCE_IDEA: Compute before subdivision, then just interpolate during subdivision.\r\n // PERFORMANCE_IDEA: Compute with createGeometryFromPositions() for fast path when there's no holes.\r\n const boundingRectangle = options.boundingRectangle;\r\n const tangentPlane = options.tangentPlane;\r\n const ellipsoid = options.ellipsoid;\r\n const stRotation = options.stRotation;\r\n const perPositionHeight = options.perPositionHeight;\r\n\r\n const origin = appendTextureCoordinatesOrigin;\r\n origin.x = boundingRectangle.x;\r\n origin.y = boundingRectangle.y;\r\n\r\n const textureCoordinates = vertexFormat.st\r\n ? new Float32Array(2 * (length / 3))\r\n : undefined;\r\n let normals;\r\n if (vertexFormat.normal) {\r\n if (perPositionHeight && top && !wall) {\r\n normals = geometry.attributes.normal.values;\r\n } else {\r\n normals = new Float32Array(length);\r\n }\r\n }\r\n const tangents = vertexFormat.tangent\r\n ? new Float32Array(length)\r\n : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(length)\r\n : undefined;\r\n const extrudeNormals = shadowVolume ? new Float32Array(length) : undefined;\r\n\r\n let textureCoordIndex = 0;\r\n let attrIndex = 0;\r\n\r\n let normal = scratchNormal;\r\n let tangent = scratchTangent;\r\n let bitangent = scratchBitangent;\r\n let recomputeNormal = true;\r\n\r\n let textureMatrix = appendTextureCoordinatesMatrix3;\r\n let tangentRotationMatrix = tangentMatrixScratch;\r\n if (stRotation !== 0.0) {\r\n let rotation = Quaternion.fromAxisAngle(\r\n tangentPlane._plane.normal,\r\n stRotation,\r\n appendTextureCoordinatesQuaternion\r\n );\r\n textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);\r\n\r\n rotation = Quaternion.fromAxisAngle(\r\n tangentPlane._plane.normal,\r\n -stRotation,\r\n appendTextureCoordinatesQuaternion\r\n );\r\n tangentRotationMatrix = Matrix3.fromQuaternion(\r\n rotation,\r\n tangentRotationMatrix\r\n );\r\n } else {\r\n textureMatrix = Matrix3.clone(Matrix3.IDENTITY, textureMatrix);\r\n tangentRotationMatrix = Matrix3.clone(\r\n Matrix3.IDENTITY,\r\n tangentRotationMatrix\r\n );\r\n }\r\n\r\n let bottomOffset = 0;\r\n let bottomOffset2 = 0;\r\n\r\n if (top && bottom) {\r\n bottomOffset = length / 2;\r\n bottomOffset2 = length / 3;\r\n\r\n length /= 2;\r\n }\r\n\r\n for (let i = 0; i < length; i += 3) {\r\n const position = Cartesian3.fromArray(\r\n flatPositions,\r\n i,\r\n appendTextureCoordinatesCartesian3\r\n );\r\n\r\n if (vertexFormat.st) {\r\n if (!defined(flatTexcoords)) {\r\n let p = Matrix3.multiplyByVector(\r\n textureMatrix,\r\n position,\r\n scratchPosition\r\n );\r\n p = ellipsoid.scaleToGeodeticSurface(p, p);\r\n const st = tangentPlane.projectPointOntoPlane(\r\n p,\r\n appendTextureCoordinatesCartesian2\r\n );\r\n Cartesian2.subtract(st, origin, st);\r\n\r\n const stx = CesiumMath.clamp(st.x / boundingRectangle.width, 0, 1);\r\n const sty = CesiumMath.clamp(st.y / boundingRectangle.height, 0, 1);\r\n if (bottom) {\r\n textureCoordinates[textureCoordIndex + bottomOffset2] = stx;\r\n textureCoordinates[textureCoordIndex + 1 + bottomOffset2] = sty;\r\n }\r\n if (top) {\r\n textureCoordinates[textureCoordIndex] = stx;\r\n textureCoordinates[textureCoordIndex + 1] = sty;\r\n }\r\n\r\n textureCoordIndex += 2;\r\n }\r\n }\r\n\r\n if (\r\n vertexFormat.normal ||\r\n vertexFormat.tangent ||\r\n vertexFormat.bitangent ||\r\n shadowVolume\r\n ) {\r\n const attrIndex1 = attrIndex + 1;\r\n const attrIndex2 = attrIndex + 2;\r\n\r\n if (wall) {\r\n if (i + 3 < length) {\r\n const p1 = Cartesian3.fromArray(flatPositions, i + 3, p1Scratch);\r\n\r\n if (recomputeNormal) {\r\n const p2 = Cartesian3.fromArray(\r\n flatPositions,\r\n i + length,\r\n p2Scratch\r\n );\r\n if (perPositionHeight) {\r\n adjustPosHeightsForNormal(position, p1, p2, ellipsoid);\r\n }\r\n Cartesian3.subtract(p1, position, p1);\r\n Cartesian3.subtract(p2, position, p2);\r\n normal = Cartesian3.normalize(\r\n Cartesian3.cross(p2, p1, normal),\r\n normal\r\n );\r\n recomputeNormal = false;\r\n }\r\n\r\n if (Cartesian3.equalsEpsilon(p1, position, CesiumMath.EPSILON10)) {\r\n // if we've reached a corner\r\n recomputeNormal = true;\r\n }\r\n }\r\n\r\n if (vertexFormat.tangent || vertexFormat.bitangent) {\r\n bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent);\r\n if (vertexFormat.tangent) {\r\n tangent = Cartesian3.normalize(\r\n Cartesian3.cross(bitangent, normal, tangent),\r\n tangent\r\n );\r\n }\r\n }\r\n } else {\r\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\r\n if (vertexFormat.tangent || vertexFormat.bitangent) {\r\n if (perPositionHeight) {\r\n scratchPerPosNormal = Cartesian3.fromArray(\r\n normals,\r\n attrIndex,\r\n scratchPerPosNormal\r\n );\r\n scratchPerPosTangent = Cartesian3.cross(\r\n Cartesian3.UNIT_Z,\r\n scratchPerPosNormal,\r\n scratchPerPosTangent\r\n );\r\n scratchPerPosTangent = Cartesian3.normalize(\r\n Matrix3.multiplyByVector(\r\n tangentRotationMatrix,\r\n scratchPerPosTangent,\r\n scratchPerPosTangent\r\n ),\r\n scratchPerPosTangent\r\n );\r\n if (vertexFormat.bitangent) {\r\n scratchPerPosBitangent = Cartesian3.normalize(\r\n Cartesian3.cross(\r\n scratchPerPosNormal,\r\n scratchPerPosTangent,\r\n scratchPerPosBitangent\r\n ),\r\n scratchPerPosBitangent\r\n );\r\n }\r\n }\r\n\r\n tangent = Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent);\r\n tangent = Cartesian3.normalize(\r\n Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent),\r\n tangent\r\n );\r\n if (vertexFormat.bitangent) {\r\n bitangent = Cartesian3.normalize(\r\n Cartesian3.cross(normal, tangent, bitangent),\r\n bitangent\r\n );\r\n }\r\n }\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n if (options.wall) {\r\n normals[attrIndex + bottomOffset] = normal.x;\r\n normals[attrIndex1 + bottomOffset] = normal.y;\r\n normals[attrIndex2 + bottomOffset] = normal.z;\r\n } else if (bottom) {\r\n normals[attrIndex + bottomOffset] = -normal.x;\r\n normals[attrIndex1 + bottomOffset] = -normal.y;\r\n normals[attrIndex2 + bottomOffset] = -normal.z;\r\n }\r\n\r\n if ((top && !perPositionHeight) || wall) {\r\n normals[attrIndex] = normal.x;\r\n normals[attrIndex1] = normal.y;\r\n normals[attrIndex2] = normal.z;\r\n }\r\n }\r\n\r\n if (shadowVolume) {\r\n if (wall) {\r\n normal = ellipsoid.geodeticSurfaceNormal(position, normal);\r\n }\r\n extrudeNormals[attrIndex + bottomOffset] = -normal.x;\r\n extrudeNormals[attrIndex1 + bottomOffset] = -normal.y;\r\n extrudeNormals[attrIndex2 + bottomOffset] = -normal.z;\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n if (options.wall) {\r\n tangents[attrIndex + bottomOffset] = tangent.x;\r\n tangents[attrIndex1 + bottomOffset] = tangent.y;\r\n tangents[attrIndex2 + bottomOffset] = tangent.z;\r\n } else if (bottom) {\r\n tangents[attrIndex + bottomOffset] = -tangent.x;\r\n tangents[attrIndex1 + bottomOffset] = -tangent.y;\r\n tangents[attrIndex2 + bottomOffset] = -tangent.z;\r\n }\r\n\r\n if (top) {\r\n if (perPositionHeight) {\r\n tangents[attrIndex] = scratchPerPosTangent.x;\r\n tangents[attrIndex1] = scratchPerPosTangent.y;\r\n tangents[attrIndex2] = scratchPerPosTangent.z;\r\n } else {\r\n tangents[attrIndex] = tangent.x;\r\n tangents[attrIndex1] = tangent.y;\r\n tangents[attrIndex2] = tangent.z;\r\n }\r\n }\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n if (bottom) {\r\n bitangents[attrIndex + bottomOffset] = bitangent.x;\r\n bitangents[attrIndex1 + bottomOffset] = bitangent.y;\r\n bitangents[attrIndex2 + bottomOffset] = bitangent.z;\r\n }\r\n if (top) {\r\n if (perPositionHeight) {\r\n bitangents[attrIndex] = scratchPerPosBitangent.x;\r\n bitangents[attrIndex1] = scratchPerPosBitangent.y;\r\n bitangents[attrIndex2] = scratchPerPosBitangent.z;\r\n } else {\r\n bitangents[attrIndex] = bitangent.x;\r\n bitangents[attrIndex1] = bitangent.y;\r\n bitangents[attrIndex2] = bitangent.z;\r\n }\r\n }\r\n }\r\n attrIndex += 3;\r\n }\r\n }\r\n\r\n if (vertexFormat.st && !defined(flatTexcoords)) {\r\n geometry.attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: textureCoordinates,\r\n });\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n geometry.attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normals,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n geometry.attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n geometry.attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangents,\r\n });\r\n }\r\n\r\n if (shadowVolume) {\r\n geometry.attributes.extrudeDirection = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: extrudeNormals,\r\n });\r\n }\r\n }\r\n\r\n if (options.extrude && defined(options.offsetAttribute)) {\r\n const size = flatPositions.length / 3;\r\n let offsetAttribute = new Uint8Array(size);\r\n\r\n if (options.offsetAttribute === GeometryOffsetAttribute.TOP) {\r\n if ((top && bottom) || wall) {\r\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\r\n } else if (top) {\r\n offsetAttribute = offsetAttribute.fill(1);\r\n }\r\n } else {\r\n const offsetValue =\r\n options.offsetAttribute === GeometryOffsetAttribute.NONE ? 0 : 1;\r\n offsetAttribute = offsetAttribute.fill(offsetValue);\r\n }\r\n\r\n geometry.attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: offsetAttribute,\r\n });\r\n }\r\n\r\n return geometry;\r\n}\r\n\r\nconst startCartographicScratch = new Cartographic();\r\nconst endCartographicScratch = new Cartographic();\r\nconst idlCross = {\r\n westOverIDL: 0.0,\r\n eastOverIDL: 0.0,\r\n};\r\nlet ellipsoidGeodesic = new EllipsoidGeodesic();\r\nfunction computeRectangle(positions, ellipsoid, arcType, granularity, result) {\r\n result = defaultValue(result, new Rectangle());\r\n if (!defined(positions) || positions.length < 3) {\r\n result.west = 0.0;\r\n result.north = 0.0;\r\n result.south = 0.0;\r\n result.east = 0.0;\r\n return result;\r\n }\r\n\r\n if (arcType === ArcType.RHUMB) {\r\n return Rectangle.fromCartesianArray(positions, ellipsoid, result);\r\n }\r\n\r\n if (!ellipsoidGeodesic.ellipsoid.equals(ellipsoid)) {\r\n ellipsoidGeodesic = new EllipsoidGeodesic(undefined, undefined, ellipsoid);\r\n }\r\n\r\n result.west = Number.POSITIVE_INFINITY;\r\n result.east = Number.NEGATIVE_INFINITY;\r\n result.south = Number.POSITIVE_INFINITY;\r\n result.north = Number.NEGATIVE_INFINITY;\r\n\r\n idlCross.westOverIDL = Number.POSITIVE_INFINITY;\r\n idlCross.eastOverIDL = Number.NEGATIVE_INFINITY;\r\n\r\n const inverseChordLength =\r\n 1.0 / CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);\r\n const positionsLength = positions.length;\r\n let endCartographic = ellipsoid.cartesianToCartographic(\r\n positions[0],\r\n endCartographicScratch\r\n );\r\n let startCartographic = startCartographicScratch;\r\n let swap;\r\n\r\n for (let i = 1; i < positionsLength; i++) {\r\n swap = startCartographic;\r\n startCartographic = endCartographic;\r\n endCartographic = ellipsoid.cartesianToCartographic(positions[i], swap);\r\n ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);\r\n interpolateAndGrowRectangle(\r\n ellipsoidGeodesic,\r\n inverseChordLength,\r\n result,\r\n idlCross\r\n );\r\n }\r\n\r\n swap = startCartographic;\r\n startCartographic = endCartographic;\r\n endCartographic = ellipsoid.cartesianToCartographic(positions[0], swap);\r\n ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);\r\n interpolateAndGrowRectangle(\r\n ellipsoidGeodesic,\r\n inverseChordLength,\r\n result,\r\n idlCross\r\n );\r\n\r\n if (result.east - result.west > idlCross.eastOverIDL - idlCross.westOverIDL) {\r\n result.west = idlCross.westOverIDL;\r\n result.east = idlCross.eastOverIDL;\r\n\r\n if (result.east > CesiumMath.PI) {\r\n result.east = result.east - CesiumMath.TWO_PI;\r\n }\r\n if (result.west > CesiumMath.PI) {\r\n result.west = result.west - CesiumMath.TWO_PI;\r\n }\r\n }\r\n\r\n return result;\r\n}\r\n\r\nconst interpolatedCartographicScratch = new Cartographic();\r\nfunction interpolateAndGrowRectangle(\r\n ellipsoidGeodesic,\r\n inverseChordLength,\r\n result,\r\n idlCross\r\n) {\r\n const segmentLength = ellipsoidGeodesic.surfaceDistance;\r\n\r\n const numPoints = Math.ceil(segmentLength * inverseChordLength);\r\n const subsegmentDistance =\r\n numPoints > 0 ? segmentLength / (numPoints - 1) : Number.POSITIVE_INFINITY;\r\n let interpolationDistance = 0.0;\r\n\r\n for (let i = 0; i < numPoints; i++) {\r\n const interpolatedCartographic = ellipsoidGeodesic.interpolateUsingSurfaceDistance(\r\n interpolationDistance,\r\n interpolatedCartographicScratch\r\n );\r\n interpolationDistance += subsegmentDistance;\r\n const longitude = interpolatedCartographic.longitude;\r\n const latitude = interpolatedCartographic.latitude;\r\n\r\n result.west = Math.min(result.west, longitude);\r\n result.east = Math.max(result.east, longitude);\r\n result.south = Math.min(result.south, latitude);\r\n result.north = Math.max(result.north, latitude);\r\n\r\n const lonAdjusted =\r\n longitude >= 0 ? longitude : longitude + CesiumMath.TWO_PI;\r\n idlCross.westOverIDL = Math.min(idlCross.westOverIDL, lonAdjusted);\r\n idlCross.eastOverIDL = Math.max(idlCross.eastOverIDL, lonAdjusted);\r\n }\r\n}\r\n\r\nconst createGeometryFromPositionsExtrudedPositions = [];\r\n\r\nfunction createGeometryFromPositionsExtruded(\r\n ellipsoid,\r\n polygon,\r\n textureCoordinates,\r\n granularity,\r\n hierarchy,\r\n perPositionHeight,\r\n closeTop,\r\n closeBottom,\r\n vertexFormat,\r\n arcType\r\n) {\r\n const geos = {\r\n walls: [],\r\n };\r\n let i;\r\n\r\n if (closeTop || closeBottom) {\r\n const topGeo = PolygonGeometryLibrary.createGeometryFromPositions(\r\n ellipsoid,\r\n polygon,\r\n textureCoordinates,\r\n granularity,\r\n perPositionHeight,\r\n vertexFormat,\r\n arcType\r\n );\r\n\r\n const edgePoints = topGeo.attributes.position.values;\r\n const indices = topGeo.indices;\r\n let numPositions;\r\n let newIndices;\r\n\r\n if (closeTop && closeBottom) {\r\n const topBottomPositions = edgePoints.concat(edgePoints);\r\n\r\n numPositions = topBottomPositions.length / 3;\r\n\r\n newIndices = IndexDatatype.createTypedArray(\r\n numPositions,\r\n indices.length * 2\r\n );\r\n newIndices.set(indices);\r\n const ilength = indices.length;\r\n\r\n const length = numPositions / 2;\r\n\r\n for (i = 0; i < ilength; i += 3) {\r\n const i0 = newIndices[i] + length;\r\n const i1 = newIndices[i + 1] + length;\r\n const i2 = newIndices[i + 2] + length;\r\n\r\n newIndices[i + ilength] = i2;\r\n newIndices[i + 1 + ilength] = i1;\r\n newIndices[i + 2 + ilength] = i0;\r\n }\r\n\r\n topGeo.attributes.position.values = topBottomPositions;\r\n if (perPositionHeight && vertexFormat.normal) {\r\n const normals = topGeo.attributes.normal.values;\r\n topGeo.attributes.normal.values = new Float32Array(\r\n topBottomPositions.length\r\n );\r\n topGeo.attributes.normal.values.set(normals);\r\n }\r\n\r\n if (vertexFormat.st && defined(textureCoordinates)) {\r\n const texcoords = topGeo.attributes.st.values;\r\n topGeo.attributes.st.values = new Float32Array(numPositions * 2);\r\n topGeo.attributes.st.values = texcoords.concat(texcoords);\r\n }\r\n\r\n topGeo.indices = newIndices;\r\n } else if (closeBottom) {\r\n numPositions = edgePoints.length / 3;\r\n newIndices = IndexDatatype.createTypedArray(numPositions, indices.length);\r\n\r\n for (i = 0; i < indices.length; i += 3) {\r\n newIndices[i] = indices[i + 2];\r\n newIndices[i + 1] = indices[i + 1];\r\n newIndices[i + 2] = indices[i];\r\n }\r\n\r\n topGeo.indices = newIndices;\r\n }\r\n\r\n geos.topAndBottom = new GeometryInstance({\r\n geometry: topGeo,\r\n });\r\n }\r\n\r\n let outerRing = hierarchy.outerRing;\r\n let tangentPlane = EllipsoidTangentPlane.fromPoints(outerRing, ellipsoid);\r\n let positions2D = tangentPlane.projectPointsOntoPlane(\r\n outerRing,\r\n createGeometryFromPositionsExtrudedPositions\r\n );\r\n\r\n let windingOrder = PolygonPipeline.computeWindingOrder2D(positions2D);\r\n if (windingOrder === WindingOrder.CLOCKWISE) {\r\n outerRing = outerRing.slice().reverse();\r\n }\r\n\r\n let wallGeo = PolygonGeometryLibrary.computeWallGeometry(\r\n outerRing,\r\n textureCoordinates,\r\n ellipsoid,\r\n granularity,\r\n perPositionHeight,\r\n arcType\r\n );\r\n geos.walls.push(\r\n new GeometryInstance({\r\n geometry: wallGeo,\r\n })\r\n );\r\n\r\n const holes = hierarchy.holes;\r\n for (i = 0; i < holes.length; i++) {\r\n let hole = holes[i];\r\n\r\n tangentPlane = EllipsoidTangentPlane.fromPoints(hole, ellipsoid);\r\n positions2D = tangentPlane.projectPointsOntoPlane(\r\n hole,\r\n createGeometryFromPositionsExtrudedPositions\r\n );\r\n\r\n windingOrder = PolygonPipeline.computeWindingOrder2D(positions2D);\r\n if (windingOrder === WindingOrder.COUNTER_CLOCKWISE) {\r\n hole = hole.slice().reverse();\r\n }\r\n\r\n wallGeo = PolygonGeometryLibrary.computeWallGeometry(\r\n hole,\r\n textureCoordinates,\r\n ellipsoid,\r\n granularity,\r\n perPositionHeight,\r\n arcType\r\n );\r\n geos.walls.push(\r\n new GeometryInstance({\r\n geometry: wallGeo,\r\n })\r\n );\r\n }\r\n\r\n return geos;\r\n}\r\n\r\n/**\r\n * A description of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\r\n *\r\n * @alias PolygonGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\r\n * @param {Number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface.\r\n * @param {Number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\r\n * @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.\r\n * @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.\r\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\r\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.\r\n *\r\n * @see PolygonGeometry#createGeometry\r\n * @see PolygonGeometry#fromPositions\r\n *\r\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polygon.html|Cesium Sandcastle Polygon Demo}\r\n *\r\n * @example\r\n * // 1. create a polygon from points\r\n * const polygon = new Cesium.PolygonGeometry({\r\n * polygonHierarchy : new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0,\r\n * -75.0, 30.0,\r\n * -70.0, 30.0,\r\n * -68.0, 40.0\r\n * ])\r\n * )\r\n * });\r\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);\r\n *\r\n * // 2. create a nested polygon with holes\r\n * const polygonWithHole = new Cesium.PolygonGeometry({\r\n * polygonHierarchy : new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -109.0, 30.0,\r\n * -95.0, 30.0,\r\n * -95.0, 40.0,\r\n * -109.0, 40.0\r\n * ]),\r\n * [new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -107.0, 31.0,\r\n * -107.0, 39.0,\r\n * -97.0, 39.0,\r\n * -97.0, 31.0\r\n * ]),\r\n * [new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -105.0, 33.0,\r\n * -99.0, 33.0,\r\n * -99.0, 37.0,\r\n * -105.0, 37.0\r\n * ]),\r\n * [new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -103.0, 34.0,\r\n * -101.0, 34.0,\r\n * -101.0, 36.0,\r\n * -103.0, 36.0\r\n * ])\r\n * )]\r\n * )]\r\n * )]\r\n * )\r\n * });\r\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygonWithHole);\r\n *\r\n * // 3. create extruded polygon\r\n * const extrudedPolygon = new Cesium.PolygonGeometry({\r\n * polygonHierarchy : new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0,\r\n * -75.0, 30.0,\r\n * -70.0, 30.0,\r\n * -68.0, 40.0\r\n * ])\r\n * ),\r\n * extrudedHeight: 300000\r\n * });\r\n * const geometry = Cesium.PolygonGeometry.createGeometry(extrudedPolygon);\r\n */\r\nfunction PolygonGeometry(options) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"options\", options);\r\n Check.typeOf.object(\"options.polygonHierarchy\", options.polygonHierarchy);\r\n if (\r\n defined(options.perPositionHeight) &&\r\n options.perPositionHeight &&\r\n defined(options.height)\r\n ) {\r\n throw new DeveloperError(\r\n \"Cannot use both options.perPositionHeight and options.height\"\r\n );\r\n }\r\n if (\r\n defined(options.arcType) &&\r\n options.arcType !== ArcType.GEODESIC &&\r\n options.arcType !== ArcType.RHUMB\r\n ) {\r\n throw new DeveloperError(\r\n \"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const polygonHierarchy = options.polygonHierarchy;\r\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n const stRotation = defaultValue(options.stRotation, 0.0);\r\n const textureCoordinates = options.textureCoordinates;\r\n const perPositionHeight = defaultValue(options.perPositionHeight, false);\r\n const perPositionHeightExtrude =\r\n perPositionHeight && defined(options.extrudedHeight);\r\n let height = defaultValue(options.height, 0.0);\r\n let extrudedHeight = defaultValue(options.extrudedHeight, height);\r\n\r\n if (!perPositionHeightExtrude) {\r\n const h = Math.max(height, extrudedHeight);\r\n extrudedHeight = Math.min(height, extrudedHeight);\r\n height = h;\r\n }\r\n\r\n this._vertexFormat = VertexFormat.clone(vertexFormat);\r\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\r\n this._granularity = granularity;\r\n this._stRotation = stRotation;\r\n this._height = height;\r\n this._extrudedHeight = extrudedHeight;\r\n this._closeTop = defaultValue(options.closeTop, true);\r\n this._closeBottom = defaultValue(options.closeBottom, true);\r\n this._polygonHierarchy = polygonHierarchy;\r\n this._perPositionHeight = perPositionHeight;\r\n this._perPositionHeightExtrude = perPositionHeightExtrude;\r\n this._shadowVolume = defaultValue(options.shadowVolume, false);\r\n this._workerName = \"createPolygonGeometry\";\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._arcType = defaultValue(options.arcType, ArcType.GEODESIC);\r\n\r\n this._rectangle = undefined;\r\n this._textureCoordinateRotationPoints = undefined;\r\n this._textureCoordinates = textureCoordinates;\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n PolygonGeometryLibrary.computeHierarchyPackedLength(\r\n polygonHierarchy,\r\n Cartesian3\r\n ) +\r\n Ellipsoid.packedLength +\r\n VertexFormat.packedLength +\r\n (textureCoordinates\r\n ? PolygonGeometryLibrary.computeHierarchyPackedLength(\r\n textureCoordinates,\r\n Cartesian2\r\n )\r\n : 1) +\r\n 12;\r\n}\r\n\r\n/**\r\n * A description of a polygon from an array of positions. Polygon geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\r\n * @param {Number} [options.height=0.0] The height of the polygon.\r\n * @param {Number} [options.extrudedHeight] The height of the polygon extrusion.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\r\n * @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.\r\n * @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.\r\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\r\n * @param {PolygonHierarchy} [options.textureCoordinates] Texture coordinates as a {@link PolygonHierarchy} of {@link Cartesian2} points. Has no effect for ground primitives.\r\n * @returns {PolygonGeometry}\r\n *\r\n * @example\r\n * // create a polygon from points\r\n * const polygon = Cesium.PolygonGeometry.fromPositions({\r\n * positions : Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0,\r\n * -75.0, 30.0,\r\n * -70.0, 30.0,\r\n * -68.0, 40.0\r\n * ])\r\n * });\r\n * const geometry = Cesium.PolygonGeometry.createGeometry(polygon);\r\n *\r\n * @see PolygonGeometry#createGeometry\r\n */\r\nPolygonGeometry.fromPositions = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"options.positions\", options.positions);\r\n //>>includeEnd('debug');\r\n\r\n const newOptions = {\r\n polygonHierarchy: {\r\n positions: options.positions,\r\n },\r\n height: options.height,\r\n extrudedHeight: options.extrudedHeight,\r\n vertexFormat: options.vertexFormat,\r\n stRotation: options.stRotation,\r\n ellipsoid: options.ellipsoid,\r\n granularity: options.granularity,\r\n perPositionHeight: options.perPositionHeight,\r\n closeTop: options.closeTop,\r\n closeBottom: options.closeBottom,\r\n offsetAttribute: options.offsetAttribute,\r\n arcType: options.arcType,\r\n textureCoordinates: options.textureCoordinates,\r\n };\r\n return new PolygonGeometry(newOptions);\r\n};\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {PolygonGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nPolygonGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\r\n value._polygonHierarchy,\r\n array,\r\n startingIndex,\r\n Cartesian3\r\n );\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n array[startingIndex++] = value._height;\r\n array[startingIndex++] = value._extrudedHeight;\r\n array[startingIndex++] = value._granularity;\r\n array[startingIndex++] = value._stRotation;\r\n array[startingIndex++] = value._perPositionHeightExtrude ? 1.0 : 0.0;\r\n array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0;\r\n array[startingIndex++] = value._closeTop ? 1.0 : 0.0;\r\n array[startingIndex++] = value._closeBottom ? 1.0 : 0.0;\r\n array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\r\n array[startingIndex++] = defaultValue(value._offsetAttribute, -1);\r\n array[startingIndex++] = value._arcType;\r\n if (defined(value._textureCoordinates)) {\r\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\r\n value._textureCoordinates,\r\n array,\r\n startingIndex,\r\n Cartesian2\r\n );\r\n } else {\r\n array[startingIndex++] = -1.0;\r\n }\r\n array[startingIndex++] = value.packedLength;\r\n return array;\r\n};\r\n\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchVertexFormat = new VertexFormat();\r\n\r\n//Only used to avoid inability to default construct.\r\nconst dummyOptions = {\r\n polygonHierarchy: {},\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {PolygonGeometry} [result] The object into which to store the result.\r\n */\r\nPolygonGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\r\n array,\r\n startingIndex,\r\n Cartesian3\r\n );\r\n startingIndex = polygonHierarchy.startingIndex;\r\n delete polygonHierarchy.startingIndex;\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n const height = array[startingIndex++];\r\n const extrudedHeight = array[startingIndex++];\r\n const granularity = array[startingIndex++];\r\n const stRotation = array[startingIndex++];\r\n const perPositionHeightExtrude = array[startingIndex++] === 1.0;\r\n const perPositionHeight = array[startingIndex++] === 1.0;\r\n const closeTop = array[startingIndex++] === 1.0;\r\n const closeBottom = array[startingIndex++] === 1.0;\r\n const shadowVolume = array[startingIndex++] === 1.0;\r\n const offsetAttribute = array[startingIndex++];\r\n const arcType = array[startingIndex++];\r\n const textureCoordinates =\r\n array[startingIndex] === -1.0\r\n ? undefined\r\n : PolygonGeometryLibrary.unpackPolygonHierarchy(\r\n array,\r\n startingIndex,\r\n Cartesian2\r\n );\r\n if (defined(textureCoordinates)) {\r\n startingIndex = textureCoordinates.startingIndex;\r\n delete textureCoordinates.startingIndex;\r\n } else {\r\n startingIndex++;\r\n }\r\n const packedLength = array[startingIndex++];\r\n\r\n if (!defined(result)) {\r\n result = new PolygonGeometry(dummyOptions);\r\n }\r\n\r\n result._polygonHierarchy = polygonHierarchy;\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._height = height;\r\n result._extrudedHeight = extrudedHeight;\r\n result._granularity = granularity;\r\n result._stRotation = stRotation;\r\n result._perPositionHeightExtrude = perPositionHeightExtrude;\r\n result._perPositionHeight = perPositionHeight;\r\n result._closeTop = closeTop;\r\n result._closeBottom = closeBottom;\r\n result._shadowVolume = shadowVolume;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n result._arcType = arcType;\r\n result._textureCoordinates = textureCoordinates;\r\n result.packedLength = packedLength;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Returns the bounding rectangle given the provided options\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.\r\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {Rectangle} [result] An object in which to store the result.\r\n *\r\n * @returns {Rectangle} The result rectangle\r\n */\r\nPolygonGeometry.computeRectangle = function (options, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"options\", options);\r\n Check.typeOf.object(\"options.polygonHierarchy\", options.polygonHierarchy);\r\n //>>includeEnd('debug');\r\n\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n const arcType = defaultValue(options.arcType, ArcType.GEODESIC);\r\n //>>includeStart('debug', pragmas.debug);\r\n if (arcType !== ArcType.GEODESIC && arcType !== ArcType.RHUMB) {\r\n throw new DeveloperError(\r\n \"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const polygonHierarchy = options.polygonHierarchy;\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n\r\n return computeRectangle(\r\n polygonHierarchy.positions,\r\n ellipsoid,\r\n arcType,\r\n granularity,\r\n result\r\n );\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a polygon, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {PolygonGeometry} polygonGeometry A description of the polygon.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nPolygonGeometry.createGeometry = function (polygonGeometry) {\r\n const vertexFormat = polygonGeometry._vertexFormat;\r\n const ellipsoid = polygonGeometry._ellipsoid;\r\n const granularity = polygonGeometry._granularity;\r\n const stRotation = polygonGeometry._stRotation;\r\n const polygonHierarchy = polygonGeometry._polygonHierarchy;\r\n const perPositionHeight = polygonGeometry._perPositionHeight;\r\n const closeTop = polygonGeometry._closeTop;\r\n const closeBottom = polygonGeometry._closeBottom;\r\n const arcType = polygonGeometry._arcType;\r\n const textureCoordinates = polygonGeometry._textureCoordinates;\r\n\r\n const hasTextureCoordinates = defined(textureCoordinates);\r\n\r\n let outerPositions = polygonHierarchy.positions;\r\n if (outerPositions.length < 3) {\r\n return;\r\n }\r\n\r\n const tangentPlane = EllipsoidTangentPlane.fromPoints(\r\n outerPositions,\r\n ellipsoid\r\n );\r\n\r\n const results = PolygonGeometryLibrary.polygonsFromHierarchy(\r\n polygonHierarchy,\r\n hasTextureCoordinates,\r\n tangentPlane.projectPointsOntoPlane.bind(tangentPlane),\r\n !perPositionHeight,\r\n ellipsoid\r\n );\r\n\r\n const hierarchy = results.hierarchy;\r\n const polygons = results.polygons;\r\n\r\n const dummyFunction = function (identity) {\r\n return identity;\r\n };\r\n\r\n const textureCoordinatePolygons = hasTextureCoordinates\r\n ? PolygonGeometryLibrary.polygonsFromHierarchy(\r\n textureCoordinates,\r\n true,\r\n dummyFunction,\r\n false\r\n ).polygons\r\n : undefined;\r\n\r\n if (hierarchy.length === 0) {\r\n return;\r\n }\r\n\r\n outerPositions = hierarchy[0].outerRing;\r\n const boundingRectangle = PolygonGeometryLibrary.computeBoundingRectangle(\r\n tangentPlane.plane.normal,\r\n tangentPlane.projectPointOntoPlane.bind(tangentPlane),\r\n outerPositions,\r\n stRotation,\r\n scratchBoundingRectangle\r\n );\r\n\r\n const geometries = [];\r\n\r\n const height = polygonGeometry._height;\r\n const extrudedHeight = polygonGeometry._extrudedHeight;\r\n const extrude =\r\n polygonGeometry._perPositionHeightExtrude ||\r\n !CesiumMath.equalsEpsilon(height, extrudedHeight, 0, CesiumMath.EPSILON2);\r\n\r\n const options = {\r\n perPositionHeight: perPositionHeight,\r\n vertexFormat: vertexFormat,\r\n geometry: undefined,\r\n tangentPlane: tangentPlane,\r\n boundingRectangle: boundingRectangle,\r\n ellipsoid: ellipsoid,\r\n stRotation: stRotation,\r\n textureCoordinates: undefined,\r\n bottom: false,\r\n top: true,\r\n wall: false,\r\n extrude: false,\r\n arcType: arcType,\r\n };\r\n\r\n let i;\r\n\r\n if (extrude) {\r\n options.extrude = true;\r\n options.top = closeTop;\r\n options.bottom = closeBottom;\r\n options.shadowVolume = polygonGeometry._shadowVolume;\r\n options.offsetAttribute = polygonGeometry._offsetAttribute;\r\n for (i = 0; i < polygons.length; i++) {\r\n const splitGeometry = createGeometryFromPositionsExtruded(\r\n ellipsoid,\r\n polygons[i],\r\n hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,\r\n granularity,\r\n hierarchy[i],\r\n perPositionHeight,\r\n closeTop,\r\n closeBottom,\r\n vertexFormat,\r\n arcType\r\n );\r\n\r\n let topAndBottom;\r\n if (closeTop && closeBottom) {\r\n topAndBottom = splitGeometry.topAndBottom;\r\n options.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(\r\n topAndBottom.geometry,\r\n height,\r\n extrudedHeight,\r\n ellipsoid,\r\n perPositionHeight\r\n );\r\n } else if (closeTop) {\r\n topAndBottom = splitGeometry.topAndBottom;\r\n topAndBottom.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\r\n topAndBottom.geometry.attributes.position.values,\r\n height,\r\n ellipsoid,\r\n !perPositionHeight\r\n );\r\n options.geometry = topAndBottom.geometry;\r\n } else if (closeBottom) {\r\n topAndBottom = splitGeometry.topAndBottom;\r\n topAndBottom.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\r\n topAndBottom.geometry.attributes.position.values,\r\n extrudedHeight,\r\n ellipsoid,\r\n true\r\n );\r\n options.geometry = topAndBottom.geometry;\r\n }\r\n if (closeTop || closeBottom) {\r\n options.wall = false;\r\n topAndBottom.geometry = computeAttributes(options);\r\n geometries.push(topAndBottom);\r\n }\r\n\r\n const walls = splitGeometry.walls;\r\n options.wall = true;\r\n for (let k = 0; k < walls.length; k++) {\r\n const wall = walls[k];\r\n options.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(\r\n wall.geometry,\r\n height,\r\n extrudedHeight,\r\n ellipsoid,\r\n perPositionHeight\r\n );\r\n wall.geometry = computeAttributes(options);\r\n geometries.push(wall);\r\n }\r\n }\r\n } else {\r\n for (i = 0; i < polygons.length; i++) {\r\n const geometryInstance = new GeometryInstance({\r\n geometry: PolygonGeometryLibrary.createGeometryFromPositions(\r\n ellipsoid,\r\n polygons[i],\r\n hasTextureCoordinates ? textureCoordinatePolygons[i] : undefined,\r\n granularity,\r\n perPositionHeight,\r\n vertexFormat,\r\n arcType\r\n ),\r\n });\r\n geometryInstance.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\r\n geometryInstance.geometry.attributes.position.values,\r\n height,\r\n ellipsoid,\r\n !perPositionHeight\r\n );\r\n options.geometry = geometryInstance.geometry;\r\n\r\n geometryInstance.geometry = computeAttributes(options);\r\n\r\n if (defined(polygonGeometry._offsetAttribute)) {\r\n const length =\r\n geometryInstance.geometry.attributes.position.values.length;\r\n const offsetValue =\r\n polygonGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute(\r\n {\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n }\r\n );\r\n }\r\n\r\n geometries.push(geometryInstance);\r\n }\r\n }\r\n\r\n const geometry = GeometryPipeline.combineInstances(geometries)[0];\r\n geometry.attributes.position.values = new Float64Array(\r\n geometry.attributes.position.values\r\n );\r\n geometry.indices = IndexDatatype.createTypedArray(\r\n geometry.attributes.position.values.length / 3,\r\n geometry.indices\r\n );\r\n\r\n const attributes = geometry.attributes;\r\n const boundingSphere = BoundingSphere.fromVertices(\r\n attributes.position.values\r\n );\r\n\r\n if (!vertexFormat.position) {\r\n delete attributes.position;\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: geometry.indices,\r\n primitiveType: geometry.primitiveType,\r\n boundingSphere: boundingSphere,\r\n offsetAttribute: polygonGeometry._offsetAttribute,\r\n });\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPolygonGeometry.createShadowVolume = function (\r\n polygonGeometry,\r\n minHeightFunc,\r\n maxHeightFunc\r\n) {\r\n const granularity = polygonGeometry._granularity;\r\n const ellipsoid = polygonGeometry._ellipsoid;\r\n\r\n const minHeight = minHeightFunc(granularity, ellipsoid);\r\n const maxHeight = maxHeightFunc(granularity, ellipsoid);\r\n\r\n return new PolygonGeometry({\r\n polygonHierarchy: polygonGeometry._polygonHierarchy,\r\n ellipsoid: ellipsoid,\r\n stRotation: polygonGeometry._stRotation,\r\n granularity: granularity,\r\n perPositionHeight: false,\r\n extrudedHeight: minHeight,\r\n height: maxHeight,\r\n vertexFormat: VertexFormat.POSITION_ONLY,\r\n shadowVolume: true,\r\n arcType: polygonGeometry._arcType,\r\n });\r\n};\r\n\r\nfunction textureCoordinateRotationPoints(polygonGeometry) {\r\n const stRotation = -polygonGeometry._stRotation;\r\n if (stRotation === 0.0) {\r\n return [0, 0, 0, 1, 1, 0];\r\n }\r\n const ellipsoid = polygonGeometry._ellipsoid;\r\n const positions = polygonGeometry._polygonHierarchy.positions;\r\n const boundingRectangle = polygonGeometry.rectangle;\r\n return Geometry._textureCoordinateRotationPoints(\r\n positions,\r\n stRotation,\r\n ellipsoid,\r\n boundingRectangle\r\n );\r\n}\r\n\r\nObject.defineProperties(PolygonGeometry.prototype, {\r\n /**\r\n * @private\r\n */\r\n rectangle: {\r\n get: function () {\r\n if (!defined(this._rectangle)) {\r\n const positions = this._polygonHierarchy.positions;\r\n this._rectangle = computeRectangle(\r\n positions,\r\n this._ellipsoid,\r\n this._arcType,\r\n this._granularity\r\n );\r\n }\r\n\r\n return this._rectangle;\r\n },\r\n },\r\n /**\r\n * For remapping texture coordinates when rendering PolygonGeometries as GroundPrimitives.\r\n * @private\r\n */\r\n textureCoordinateRotationPoints: {\r\n get: function () {\r\n if (!defined(this._textureCoordinateRotationPoints)) {\r\n this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(\r\n this\r\n );\r\n }\r\n return this._textureCoordinateRotationPoints;\r\n },\r\n },\r\n});\r\nexport default PolygonGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport PolygonGeometry from \"../Core/PolygonGeometry.js\";\r\n\r\nfunction createPolygonGeometry(polygonGeometry, offset) {\r\n if (defined(offset)) {\r\n polygonGeometry = PolygonGeometry.unpack(polygonGeometry, offset);\r\n }\r\n polygonGeometry._ellipsoid = Ellipsoid.clone(polygonGeometry._ellipsoid);\r\n return PolygonGeometry.createGeometry(polygonGeometry);\r\n}\r\nexport default createPolygonGeometry;\r\n"],"names":["Cartographic","BoundingRectangle","Cartesian3","Cartesian2","Quaternion","Matrix3","defined","CesiumMath","GeometryAttribute","ComponentDatatype","GeometryOffsetAttribute","EllipsoidGeodesic","defaultValue","Rectangle","ArcType","PolygonGeometryLibrary","IndexDatatype","GeometryInstance","EllipsoidTangentPlane","PolygonPipeline","WindingOrder","Check","DeveloperError","VertexFormat","Ellipsoid","GeometryPipeline","BoundingSphere","Geometry"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,aAAa,GAAG,IAAIA,oBAAY,EAAE,CAAC;EACzC,MAAM,aAAa,GAAG,IAAIA,oBAAY,EAAE,CAAC;EACzC,SAAS,yBAAyB,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE;EAChE,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC,uBAAuB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;EAC5E,EAAE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;EAC/B,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC,uBAAuB,CAAC,EAAE,EAAE,aAAa,CAAC,CAAC;EACvE,EAAE,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;EAC1B,EAAE,SAAS,CAAC,uBAAuB,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AACjD;EACA,EAAE,MAAM,OAAO,GAAG,SAAS,CAA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,IAAI,YAAY,GAAGC,2CAAqB,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;EACrE,IAAI,WAAW,GAAG,YAAY,CAAC,sBAAsB;EACrD,MAAM,IAAI;EACV,MAAM,4CAA4C;EAClD,KAAK,CAAC;AACN;EACA,IAAI,YAAY,GAAGC,+BAAe,CAAC,qBAAqB,CAAC,WAAW,CAAC,CAAC;EACtE,IAAI,IAAI,YAAY,KAAKC,4BAAY,CAAC,iBAAiB,EAAE;EACzD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,CAAC;EACpC,KAAK;AACL;EACA,IAAI,OAAO,GAAGL,6CAAsB,CAAC,mBAAmB;EACxD,MAAM,IAAI;EACV,MAAM,kBAAkB;EACxB,MAAM,SAAS;EACf,MAAM,WAAW;EACjB,MAAM,iBAAiB;EACvB,MAAM,OAAO;EACb,KAAK,CAAC;EACN,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI;EACnB,MAAM,IAAIE,iCAAgB,CAAC;EAC3B,QAAQ,QAAQ,EAAE,OAAO;EACzB,OAAO,CAAC;EACR,KAAK,CAAC;EACN,GAAG;AACH;EACA,EAAE,OAAO,IAAI,CAAC;EACd,CAAC;AACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,e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esium/Workers/createPolygonOutlineGeometry.js
new file mode 100644
index 0000000..78aa525
--- /dev/null
+++ b/examples/cesium/Workers/createPolygonOutlineGeometry.js
@@ -0,0 +1,709 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './ArcType-d608b872', './Transforms-11fb6b0a', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './EllipsoidTangentPlane-c421b2cb', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryInstance-b2be3e5a', './GeometryOffsetAttribute-cc320d7d', './GeometryPipeline-f28890f4', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolygonGeometryLibrary-62266ab5', './PolygonPipeline-313487c3', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29', './AxisAlignedBoundingBox-50342d27', './IntersectionTests-2c7928de', './Plane-c9f1487d', './AttributeCompression-e9888cb8', './EncodedCartesian3-38e2691f', './arrayRemoveDuplicates-c3526030', './EllipsoidRhumbLine-48b4507b'], (function (defaultValue, Matrix3, ArcType, Transforms, Check, ComponentDatatype, EllipsoidTangentPlane, GeometryAttribute, GeometryAttributes, GeometryInstance, GeometryOffsetAttribute, GeometryPipeline, IndexDatatype, Math$1, PolygonGeometryLibrary, PolygonPipeline, Matrix2, RuntimeError, combine, WebGLConstants, AxisAlignedBoundingBox, IntersectionTests, Plane, AttributeCompression, EncodedCartesian3, arrayRemoveDuplicates, EllipsoidRhumbLine) { 'use strict';
+
+ const createGeometryFromPositionsPositions = [];
+ const createGeometryFromPositionsSubdivided = [];
+
+ function createGeometryFromPositions(
+ ellipsoid,
+ positions,
+ minDistance,
+ perPositionHeight,
+ arcType
+ ) {
+ const tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(positions, ellipsoid);
+ const positions2D = tangentPlane.projectPointsOntoPlane(
+ positions,
+ createGeometryFromPositionsPositions
+ );
+
+ const originalWindingOrder = PolygonPipeline.PolygonPipeline.computeWindingOrder2D(
+ positions2D
+ );
+ if (originalWindingOrder === PolygonPipeline.WindingOrder.CLOCKWISE) {
+ positions2D.reverse();
+ positions = positions.slice().reverse();
+ }
+
+ let subdividedPositions;
+ let i;
+
+ let length = positions.length;
+ let index = 0;
+
+ if (!perPositionHeight) {
+ let numVertices = 0;
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ for (i = 0; i < length; i++) {
+ numVertices += PolygonGeometryLibrary.PolygonGeometryLibrary.subdivideLineCount(
+ positions[i],
+ positions[(i + 1) % length],
+ minDistance
+ );
+ }
+ } else if (arcType === ArcType.ArcType.RHUMB) {
+ for (i = 0; i < length; i++) {
+ numVertices += PolygonGeometryLibrary.PolygonGeometryLibrary.subdivideRhumbLineCount(
+ ellipsoid,
+ positions[i],
+ positions[(i + 1) % length],
+ minDistance
+ );
+ }
+ }
+ subdividedPositions = new Float64Array(numVertices * 3);
+ for (i = 0; i < length; i++) {
+ let tempPositions;
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ tempPositions = PolygonGeometryLibrary.PolygonGeometryLibrary.subdivideLine(
+ positions[i],
+ positions[(i + 1) % length],
+ minDistance,
+ createGeometryFromPositionsSubdivided
+ );
+ } else if (arcType === ArcType.ArcType.RHUMB) {
+ tempPositions = PolygonGeometryLibrary.PolygonGeometryLibrary.subdivideRhumbLine(
+ ellipsoid,
+ positions[i],
+ positions[(i + 1) % length],
+ minDistance,
+ createGeometryFromPositionsSubdivided
+ );
+ }
+ const tempPositionsLength = tempPositions.length;
+ for (let j = 0; j < tempPositionsLength; ++j) {
+ subdividedPositions[index++] = tempPositions[j];
+ }
+ }
+ } else {
+ subdividedPositions = new Float64Array(length * 2 * 3);
+ for (i = 0; i < length; i++) {
+ const p0 = positions[i];
+ const p1 = positions[(i + 1) % length];
+ subdividedPositions[index++] = p0.x;
+ subdividedPositions[index++] = p0.y;
+ subdividedPositions[index++] = p0.z;
+ subdividedPositions[index++] = p1.x;
+ subdividedPositions[index++] = p1.y;
+ subdividedPositions[index++] = p1.z;
+ }
+ }
+
+ length = subdividedPositions.length / 3;
+ const indicesSize = length * 2;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(length, indicesSize);
+ index = 0;
+ for (i = 0; i < length - 1; i++) {
+ indices[index++] = i;
+ indices[index++] = i + 1;
+ }
+ indices[index++] = length - 1;
+ indices[index++] = 0;
+
+ return new GeometryInstance.GeometryInstance({
+ geometry: new GeometryAttribute.Geometry({
+ attributes: new GeometryAttributes.GeometryAttributes({
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: subdividedPositions,
+ }),
+ }),
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ }),
+ });
+ }
+
+ function createGeometryFromPositionsExtruded(
+ ellipsoid,
+ positions,
+ minDistance,
+ perPositionHeight,
+ arcType
+ ) {
+ const tangentPlane = EllipsoidTangentPlane.EllipsoidTangentPlane.fromPoints(positions, ellipsoid);
+ const positions2D = tangentPlane.projectPointsOntoPlane(
+ positions,
+ createGeometryFromPositionsPositions
+ );
+
+ const originalWindingOrder = PolygonPipeline.PolygonPipeline.computeWindingOrder2D(
+ positions2D
+ );
+ if (originalWindingOrder === PolygonPipeline.WindingOrder.CLOCKWISE) {
+ positions2D.reverse();
+ positions = positions.slice().reverse();
+ }
+
+ let subdividedPositions;
+ let i;
+
+ let length = positions.length;
+ const corners = new Array(length);
+ let index = 0;
+
+ if (!perPositionHeight) {
+ let numVertices = 0;
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ for (i = 0; i < length; i++) {
+ numVertices += PolygonGeometryLibrary.PolygonGeometryLibrary.subdivideLineCount(
+ positions[i],
+ positions[(i + 1) % length],
+ minDistance
+ );
+ }
+ } else if (arcType === ArcType.ArcType.RHUMB) {
+ for (i = 0; i < length; i++) {
+ numVertices += PolygonGeometryLibrary.PolygonGeometryLibrary.subdivideRhumbLineCount(
+ ellipsoid,
+ positions[i],
+ positions[(i + 1) % length],
+ minDistance
+ );
+ }
+ }
+
+ subdividedPositions = new Float64Array(numVertices * 3 * 2);
+ for (i = 0; i < length; ++i) {
+ corners[i] = index / 3;
+ let tempPositions;
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ tempPositions = PolygonGeometryLibrary.PolygonGeometryLibrary.subdivideLine(
+ positions[i],
+ positions[(i + 1) % length],
+ minDistance,
+ createGeometryFromPositionsSubdivided
+ );
+ } else if (arcType === ArcType.ArcType.RHUMB) {
+ tempPositions = PolygonGeometryLibrary.PolygonGeometryLibrary.subdivideRhumbLine(
+ ellipsoid,
+ positions[i],
+ positions[(i + 1) % length],
+ minDistance,
+ createGeometryFromPositionsSubdivided
+ );
+ }
+ const tempPositionsLength = tempPositions.length;
+ for (let j = 0; j < tempPositionsLength; ++j) {
+ subdividedPositions[index++] = tempPositions[j];
+ }
+ }
+ } else {
+ subdividedPositions = new Float64Array(length * 2 * 3 * 2);
+ for (i = 0; i < length; ++i) {
+ corners[i] = index / 3;
+ const p0 = positions[i];
+ const p1 = positions[(i + 1) % length];
+
+ subdividedPositions[index++] = p0.x;
+ subdividedPositions[index++] = p0.y;
+ subdividedPositions[index++] = p0.z;
+ subdividedPositions[index++] = p1.x;
+ subdividedPositions[index++] = p1.y;
+ subdividedPositions[index++] = p1.z;
+ }
+ }
+
+ length = subdividedPositions.length / (3 * 2);
+ const cornersLength = corners.length;
+
+ const indicesSize = (length * 2 + cornersLength) * 2;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ length + cornersLength,
+ indicesSize
+ );
+
+ index = 0;
+ for (i = 0; i < length; ++i) {
+ indices[index++] = i;
+ indices[index++] = (i + 1) % length;
+ indices[index++] = i + length;
+ indices[index++] = ((i + 1) % length) + length;
+ }
+
+ for (i = 0; i < cornersLength; i++) {
+ const corner = corners[i];
+ indices[index++] = corner;
+ indices[index++] = corner + length;
+ }
+
+ return new GeometryInstance.GeometryInstance({
+ geometry: new GeometryAttribute.Geometry({
+ attributes: new GeometryAttributes.GeometryAttributes({
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: subdividedPositions,
+ }),
+ }),
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ }),
+ });
+ }
+
+ /**
+ * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.
+ *
+ * @alias PolygonOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
+ * @param {Number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface.
+ * @param {Number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
+ * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
+ *
+ * @see PolygonOutlineGeometry#createGeometry
+ * @see PolygonOutlineGeometry#fromPositions
+ *
+ * @example
+ * // 1. create a polygon outline from points
+ * const polygon = new Cesium.PolygonOutlineGeometry({
+ * polygonHierarchy : new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0,
+ * -75.0, 30.0,
+ * -70.0, 30.0,
+ * -68.0, 40.0
+ * ])
+ * )
+ * });
+ * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
+ *
+ * // 2. create a nested polygon with holes outline
+ * const polygonWithHole = new Cesium.PolygonOutlineGeometry({
+ * polygonHierarchy : new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -109.0, 30.0,
+ * -95.0, 30.0,
+ * -95.0, 40.0,
+ * -109.0, 40.0
+ * ]),
+ * [new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -107.0, 31.0,
+ * -107.0, 39.0,
+ * -97.0, 39.0,
+ * -97.0, 31.0
+ * ]),
+ * [new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -105.0, 33.0,
+ * -99.0, 33.0,
+ * -99.0, 37.0,
+ * -105.0, 37.0
+ * ]),
+ * [new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -103.0, 34.0,
+ * -101.0, 34.0,
+ * -101.0, 36.0,
+ * -103.0, 36.0
+ * ])
+ * )]
+ * )]
+ * )]
+ * )
+ * });
+ * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole);
+ *
+ * // 3. create extruded polygon outline
+ * const extrudedPolygon = new Cesium.PolygonOutlineGeometry({
+ * polygonHierarchy : new Cesium.PolygonHierarchy(
+ * Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0,
+ * -75.0, 30.0,
+ * -70.0, 30.0,
+ * -68.0, 40.0
+ * ])
+ * ),
+ * extrudedHeight: 300000
+ * });
+ * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);
+ */
+ function PolygonOutlineGeometry(options) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("options", options);
+ Check.Check.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
+
+ if (options.perPositionHeight && defaultValue.defined(options.height)) {
+ throw new Check.DeveloperError(
+ "Cannot use both options.perPositionHeight and options.height"
+ );
+ }
+ if (
+ defaultValue.defined(options.arcType) &&
+ options.arcType !== ArcType.ArcType.GEODESIC &&
+ options.arcType !== ArcType.ArcType.RHUMB
+ ) {
+ throw new Check.DeveloperError(
+ "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const polygonHierarchy = options.polygonHierarchy;
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ const perPositionHeight = defaultValue.defaultValue(options.perPositionHeight, false);
+ const perPositionHeightExtrude =
+ perPositionHeight && defaultValue.defined(options.extrudedHeight);
+ const arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
+
+ let height = defaultValue.defaultValue(options.height, 0.0);
+ let extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
+
+ if (!perPositionHeightExtrude) {
+ const h = Math.max(height, extrudedHeight);
+ extrudedHeight = Math.min(height, extrudedHeight);
+ height = h;
+ }
+
+ this._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid);
+ this._granularity = granularity;
+ this._height = height;
+ this._extrudedHeight = extrudedHeight;
+ this._arcType = arcType;
+ this._polygonHierarchy = polygonHierarchy;
+ this._perPositionHeight = perPositionHeight;
+ this._perPositionHeightExtrude = perPositionHeightExtrude;
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createPolygonOutlineGeometry";
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ PolygonGeometryLibrary.PolygonGeometryLibrary.computeHierarchyPackedLength(
+ polygonHierarchy,
+ Matrix3.Cartesian3
+ ) +
+ Matrix3.Ellipsoid.packedLength +
+ 8;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {PolygonOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ PolygonOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ startingIndex = PolygonGeometryLibrary.PolygonGeometryLibrary.packPolygonHierarchy(
+ value._polygonHierarchy,
+ array,
+ startingIndex,
+ Matrix3.Cartesian3
+ );
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._perPositionHeightExtrude ? 1.0 : 0.0;
+ array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0;
+ array[startingIndex++] = value._arcType;
+ array[startingIndex++] = defaultValue.defaultValue(value._offsetAttribute, -1);
+ array[startingIndex] = value.packedLength;
+
+ return array;
+ };
+
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const dummyOptions = {
+ polygonHierarchy: {},
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {PolygonOutlineGeometry} [result] The object into which to store the result.
+ * @returns {PolygonOutlineGeometry} The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.
+ */
+ PolygonOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const polygonHierarchy = PolygonGeometryLibrary.PolygonGeometryLibrary.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Matrix3.Cartesian3
+ );
+ startingIndex = polygonHierarchy.startingIndex;
+ delete polygonHierarchy.startingIndex;
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const height = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const perPositionHeightExtrude = array[startingIndex++] === 1.0;
+ const perPositionHeight = array[startingIndex++] === 1.0;
+ const arcType = array[startingIndex++];
+ const offsetAttribute = array[startingIndex++];
+ const packedLength = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ result = new PolygonOutlineGeometry(dummyOptions);
+ }
+
+ result._polygonHierarchy = polygonHierarchy;
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._height = height;
+ result._extrudedHeight = extrudedHeight;
+ result._granularity = granularity;
+ result._perPositionHeight = perPositionHeight;
+ result._perPositionHeightExtrude = perPositionHeightExtrude;
+ result._arcType = arcType;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+ result.packedLength = packedLength;
+
+ return result;
+ };
+
+ /**
+ * A description of a polygon outline from an array of positions.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.
+ * @param {Number} [options.height=0.0] The height of the polygon.
+ * @param {Number} [options.extrudedHeight] The height of the polygon extrusion.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
+ * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.
+ * @returns {PolygonOutlineGeometry}
+ *
+ *
+ * @example
+ * // create a polygon from points
+ * const polygon = Cesium.PolygonOutlineGeometry.fromPositions({
+ * positions : Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0,
+ * -75.0, 30.0,
+ * -70.0, 30.0,
+ * -68.0, 40.0
+ * ])
+ * });
+ * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);
+ *
+ * @see PolygonOutlineGeometry#createGeometry
+ */
+ PolygonOutlineGeometry.fromPositions = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("options.positions", options.positions);
+ //>>includeEnd('debug');
+
+ const newOptions = {
+ polygonHierarchy: {
+ positions: options.positions,
+ },
+ height: options.height,
+ extrudedHeight: options.extrudedHeight,
+ ellipsoid: options.ellipsoid,
+ granularity: options.granularity,
+ perPositionHeight: options.perPositionHeight,
+ arcType: options.arcType,
+ offsetAttribute: options.offsetAttribute,
+ };
+ return new PolygonOutlineGeometry(newOptions);
+ };
+
+ /**
+ * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {PolygonOutlineGeometry} polygonGeometry A description of the polygon outline.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ PolygonOutlineGeometry.createGeometry = function (polygonGeometry) {
+ const ellipsoid = polygonGeometry._ellipsoid;
+ const granularity = polygonGeometry._granularity;
+ const polygonHierarchy = polygonGeometry._polygonHierarchy;
+ const perPositionHeight = polygonGeometry._perPositionHeight;
+ const arcType = polygonGeometry._arcType;
+
+ const polygons = PolygonGeometryLibrary.PolygonGeometryLibrary.polygonOutlinesFromHierarchy(
+ polygonHierarchy,
+ !perPositionHeight,
+ ellipsoid
+ );
+
+ if (polygons.length === 0) {
+ return undefined;
+ }
+
+ let geometryInstance;
+ const geometries = [];
+ const minDistance = Math$1.CesiumMath.chordLength(
+ granularity,
+ ellipsoid.maximumRadius
+ );
+
+ const height = polygonGeometry._height;
+ const extrudedHeight = polygonGeometry._extrudedHeight;
+ const extrude =
+ polygonGeometry._perPositionHeightExtrude ||
+ !Math$1.CesiumMath.equalsEpsilon(height, extrudedHeight, 0, Math$1.CesiumMath.EPSILON2);
+ let offsetValue;
+ let i;
+ if (extrude) {
+ for (i = 0; i < polygons.length; i++) {
+ geometryInstance = createGeometryFromPositionsExtruded(
+ ellipsoid,
+ polygons[i],
+ minDistance,
+ perPositionHeight,
+ arcType
+ );
+ geometryInstance.geometry = PolygonGeometryLibrary.PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(
+ geometryInstance.geometry,
+ height,
+ extrudedHeight,
+ ellipsoid,
+ perPositionHeight
+ );
+ if (defaultValue.defined(polygonGeometry._offsetAttribute)) {
+ const size =
+ geometryInstance.geometry.attributes.position.values.length / 3;
+ let offsetAttribute = new Uint8Array(size);
+ if (polygonGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else {
+ offsetValue =
+ polygonGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+
+ geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute(
+ {
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute,
+ }
+ );
+ }
+ geometries.push(geometryInstance);
+ }
+ } else {
+ for (i = 0; i < polygons.length; i++) {
+ geometryInstance = createGeometryFromPositions(
+ ellipsoid,
+ polygons[i],
+ minDistance,
+ perPositionHeight,
+ arcType
+ );
+ geometryInstance.geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ geometryInstance.geometry.attributes.position.values,
+ height,
+ ellipsoid,
+ !perPositionHeight
+ );
+
+ if (defaultValue.defined(polygonGeometry._offsetAttribute)) {
+ const length =
+ geometryInstance.geometry.attributes.position.values.length;
+ offsetValue =
+ polygonGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute(
+ {
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ }
+ );
+ }
+
+ geometries.push(geometryInstance);
+ }
+ }
+
+ const geometry = GeometryPipeline.GeometryPipeline.combineInstances(geometries)[0];
+ const boundingSphere = Transforms.BoundingSphere.fromVertices(
+ geometry.attributes.position.values
+ );
+
+ return new GeometryAttribute.Geometry({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere: boundingSphere,
+ offsetAttribute: polygonGeometry._offsetAttribute,
+ });
+ };
+
+ function createPolygonOutlineGeometry(polygonGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ polygonGeometry = PolygonOutlineGeometry.unpack(polygonGeometry, offset);
+ }
+ polygonGeometry._ellipsoid = Matrix3.Ellipsoid.clone(polygonGeometry._ellipsoid);
+ return PolygonOutlineGeometry.createGeometry(polygonGeometry);
+ }
+
+ return createPolygonOutlineGeometry;
+
+}));
+//# sourceMappingURL=createPolygonOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createPolygonOutlineGeometry.js.map b/examples/cesium/Workers/createPolygonOutlineGeometry.js.map
new file mode 100644
index 0000000..d03bba2
--- /dev/null
+++ b/examples/cesium/Workers/createPolygonOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createPolygonOutlineGeometry.js","sources":["../../../Source/Core/PolygonOutlineGeometry.js","../../../Source/WorkersES6/createPolygonOutlineGeometry.js"],"sourcesContent":["import ArcType from \"./ArcType.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport EllipsoidTangentPlane from \"./EllipsoidTangentPlane.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryInstance from \"./GeometryInstance.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport GeometryPipeline from \"./GeometryPipeline.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PolygonGeometryLibrary from \"./PolygonGeometryLibrary.js\";\r\nimport PolygonPipeline from \"./PolygonPipeline.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport WindingOrder from \"./WindingOrder.js\";\r\nconst createGeometryFromPositionsPositions = [];\r\nconst createGeometryFromPositionsSubdivided = [];\r\n\r\nfunction createGeometryFromPositions(\r\n ellipsoid,\r\n positions,\r\n minDistance,\r\n perPositionHeight,\r\n arcType\r\n) {\r\n const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid);\r\n const positions2D = tangentPlane.projectPointsOntoPlane(\r\n positions,\r\n createGeometryFromPositionsPositions\r\n );\r\n\r\n const originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\r\n positions2D\r\n );\r\n if (originalWindingOrder === WindingOrder.CLOCKWISE) {\r\n positions2D.reverse();\r\n positions = positions.slice().reverse();\r\n }\r\n\r\n let subdividedPositions;\r\n let i;\r\n\r\n let length = positions.length;\r\n let index = 0;\r\n\r\n if (!perPositionHeight) {\r\n let numVertices = 0;\r\n if (arcType === ArcType.GEODESIC) {\r\n for (i = 0; i < length; i++) {\r\n numVertices += PolygonGeometryLibrary.subdivideLineCount(\r\n positions[i],\r\n positions[(i + 1) % length],\r\n minDistance\r\n );\r\n }\r\n } else if (arcType === ArcType.RHUMB) {\r\n for (i = 0; i < length; i++) {\r\n numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(\r\n ellipsoid,\r\n positions[i],\r\n positions[(i + 1) % length],\r\n minDistance\r\n );\r\n }\r\n }\r\n subdividedPositions = new Float64Array(numVertices * 3);\r\n for (i = 0; i < length; i++) {\r\n let tempPositions;\r\n if (arcType === ArcType.GEODESIC) {\r\n tempPositions = PolygonGeometryLibrary.subdivideLine(\r\n positions[i],\r\n positions[(i + 1) % length],\r\n minDistance,\r\n createGeometryFromPositionsSubdivided\r\n );\r\n } else if (arcType === ArcType.RHUMB) {\r\n tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(\r\n ellipsoid,\r\n positions[i],\r\n positions[(i + 1) % length],\r\n minDistance,\r\n createGeometryFromPositionsSubdivided\r\n );\r\n }\r\n const tempPositionsLength = tempPositions.length;\r\n for (let j = 0; j < tempPositionsLength; ++j) {\r\n subdividedPositions[index++] = tempPositions[j];\r\n }\r\n }\r\n } else {\r\n subdividedPositions = new Float64Array(length * 2 * 3);\r\n for (i = 0; i < length; i++) {\r\n const p0 = positions[i];\r\n const p1 = positions[(i + 1) % length];\r\n subdividedPositions[index++] = p0.x;\r\n subdividedPositions[index++] = p0.y;\r\n subdividedPositions[index++] = p0.z;\r\n subdividedPositions[index++] = p1.x;\r\n subdividedPositions[index++] = p1.y;\r\n subdividedPositions[index++] = p1.z;\r\n }\r\n }\r\n\r\n length = subdividedPositions.length / 3;\r\n const indicesSize = length * 2;\r\n const indices = IndexDatatype.createTypedArray(length, indicesSize);\r\n index = 0;\r\n for (i = 0; i < length - 1; i++) {\r\n indices[index++] = i;\r\n indices[index++] = i + 1;\r\n }\r\n indices[index++] = length - 1;\r\n indices[index++] = 0;\r\n\r\n return new GeometryInstance({\r\n geometry: new Geometry({\r\n attributes: new GeometryAttributes({\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: subdividedPositions,\r\n }),\r\n }),\r\n indices: indices,\r\n primitiveType: PrimitiveType.LINES,\r\n }),\r\n });\r\n}\r\n\r\nfunction createGeometryFromPositionsExtruded(\r\n ellipsoid,\r\n positions,\r\n minDistance,\r\n perPositionHeight,\r\n arcType\r\n) {\r\n const tangentPlane = EllipsoidTangentPlane.fromPoints(positions, ellipsoid);\r\n const positions2D = tangentPlane.projectPointsOntoPlane(\r\n positions,\r\n createGeometryFromPositionsPositions\r\n );\r\n\r\n const originalWindingOrder = PolygonPipeline.computeWindingOrder2D(\r\n positions2D\r\n );\r\n if (originalWindingOrder === WindingOrder.CLOCKWISE) {\r\n positions2D.reverse();\r\n positions = positions.slice().reverse();\r\n }\r\n\r\n let subdividedPositions;\r\n let i;\r\n\r\n let length = positions.length;\r\n const corners = new Array(length);\r\n let index = 0;\r\n\r\n if (!perPositionHeight) {\r\n let numVertices = 0;\r\n if (arcType === ArcType.GEODESIC) {\r\n for (i = 0; i < length; i++) {\r\n numVertices += PolygonGeometryLibrary.subdivideLineCount(\r\n positions[i],\r\n positions[(i + 1) % length],\r\n minDistance\r\n );\r\n }\r\n } else if (arcType === ArcType.RHUMB) {\r\n for (i = 0; i < length; i++) {\r\n numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(\r\n ellipsoid,\r\n positions[i],\r\n positions[(i + 1) % length],\r\n minDistance\r\n );\r\n }\r\n }\r\n\r\n subdividedPositions = new Float64Array(numVertices * 3 * 2);\r\n for (i = 0; i < length; ++i) {\r\n corners[i] = index / 3;\r\n let tempPositions;\r\n if (arcType === ArcType.GEODESIC) {\r\n tempPositions = PolygonGeometryLibrary.subdivideLine(\r\n positions[i],\r\n positions[(i + 1) % length],\r\n minDistance,\r\n createGeometryFromPositionsSubdivided\r\n );\r\n } else if (arcType === ArcType.RHUMB) {\r\n tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(\r\n ellipsoid,\r\n positions[i],\r\n positions[(i + 1) % length],\r\n minDistance,\r\n createGeometryFromPositionsSubdivided\r\n );\r\n }\r\n const tempPositionsLength = tempPositions.length;\r\n for (let j = 0; j < tempPositionsLength; ++j) {\r\n subdividedPositions[index++] = tempPositions[j];\r\n }\r\n }\r\n } else {\r\n subdividedPositions = new Float64Array(length * 2 * 3 * 2);\r\n for (i = 0; i < length; ++i) {\r\n corners[i] = index / 3;\r\n const p0 = positions[i];\r\n const p1 = positions[(i + 1) % length];\r\n\r\n subdividedPositions[index++] = p0.x;\r\n subdividedPositions[index++] = p0.y;\r\n subdividedPositions[index++] = p0.z;\r\n subdividedPositions[index++] = p1.x;\r\n subdividedPositions[index++] = p1.y;\r\n subdividedPositions[index++] = p1.z;\r\n }\r\n }\r\n\r\n length = subdividedPositions.length / (3 * 2);\r\n const cornersLength = corners.length;\r\n\r\n const indicesSize = (length * 2 + cornersLength) * 2;\r\n const indices = IndexDatatype.createTypedArray(\r\n length + cornersLength,\r\n indicesSize\r\n );\r\n\r\n index = 0;\r\n for (i = 0; i < length; ++i) {\r\n indices[index++] = i;\r\n indices[index++] = (i + 1) % length;\r\n indices[index++] = i + length;\r\n indices[index++] = ((i + 1) % length) + length;\r\n }\r\n\r\n for (i = 0; i < cornersLength; i++) {\r\n const corner = corners[i];\r\n indices[index++] = corner;\r\n indices[index++] = corner + length;\r\n }\r\n\r\n return new GeometryInstance({\r\n geometry: new Geometry({\r\n attributes: new GeometryAttributes({\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: subdividedPositions,\r\n }),\r\n }),\r\n indices: indices,\r\n primitiveType: PrimitiveType.LINES,\r\n }),\r\n });\r\n}\r\n\r\n/**\r\n * A description of the outline of a polygon on the ellipsoid. The polygon is defined by a polygon hierarchy.\r\n *\r\n * @alias PolygonOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.\r\n * @param {Number} [options.height=0.0] The distance in meters between the polygon and the ellipsoid surface.\r\n * @param {Number} [options.extrudedHeight] The distance in meters between the polygon's extruded face and the ellipsoid surface.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\r\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.\r\n *\r\n * @see PolygonOutlineGeometry#createGeometry\r\n * @see PolygonOutlineGeometry#fromPositions\r\n *\r\n * @example\r\n * // 1. create a polygon outline from points\r\n * const polygon = new Cesium.PolygonOutlineGeometry({\r\n * polygonHierarchy : new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0,\r\n * -75.0, 30.0,\r\n * -70.0, 30.0,\r\n * -68.0, 40.0\r\n * ])\r\n * )\r\n * });\r\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);\r\n *\r\n * // 2. create a nested polygon with holes outline\r\n * const polygonWithHole = new Cesium.PolygonOutlineGeometry({\r\n * polygonHierarchy : new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -109.0, 30.0,\r\n * -95.0, 30.0,\r\n * -95.0, 40.0,\r\n * -109.0, 40.0\r\n * ]),\r\n * [new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -107.0, 31.0,\r\n * -107.0, 39.0,\r\n * -97.0, 39.0,\r\n * -97.0, 31.0\r\n * ]),\r\n * [new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -105.0, 33.0,\r\n * -99.0, 33.0,\r\n * -99.0, 37.0,\r\n * -105.0, 37.0\r\n * ]),\r\n * [new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -103.0, 34.0,\r\n * -101.0, 34.0,\r\n * -101.0, 36.0,\r\n * -103.0, 36.0\r\n * ])\r\n * )]\r\n * )]\r\n * )]\r\n * )\r\n * });\r\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygonWithHole);\r\n *\r\n * // 3. create extruded polygon outline\r\n * const extrudedPolygon = new Cesium.PolygonOutlineGeometry({\r\n * polygonHierarchy : new Cesium.PolygonHierarchy(\r\n * Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0,\r\n * -75.0, 30.0,\r\n * -70.0, 30.0,\r\n * -68.0, 40.0\r\n * ])\r\n * ),\r\n * extrudedHeight: 300000\r\n * });\r\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(extrudedPolygon);\r\n */\r\nfunction PolygonOutlineGeometry(options) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"options\", options);\r\n Check.typeOf.object(\"options.polygonHierarchy\", options.polygonHierarchy);\r\n\r\n if (options.perPositionHeight && defined(options.height)) {\r\n throw new DeveloperError(\r\n \"Cannot use both options.perPositionHeight and options.height\"\r\n );\r\n }\r\n if (\r\n defined(options.arcType) &&\r\n options.arcType !== ArcType.GEODESIC &&\r\n options.arcType !== ArcType.RHUMB\r\n ) {\r\n throw new DeveloperError(\r\n \"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const polygonHierarchy = options.polygonHierarchy;\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n const perPositionHeight = defaultValue(options.perPositionHeight, false);\r\n const perPositionHeightExtrude =\r\n perPositionHeight && defined(options.extrudedHeight);\r\n const arcType = defaultValue(options.arcType, ArcType.GEODESIC);\r\n\r\n let height = defaultValue(options.height, 0.0);\r\n let extrudedHeight = defaultValue(options.extrudedHeight, height);\r\n\r\n if (!perPositionHeightExtrude) {\r\n const h = Math.max(height, extrudedHeight);\r\n extrudedHeight = Math.min(height, extrudedHeight);\r\n height = h;\r\n }\r\n\r\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\r\n this._granularity = granularity;\r\n this._height = height;\r\n this._extrudedHeight = extrudedHeight;\r\n this._arcType = arcType;\r\n this._polygonHierarchy = polygonHierarchy;\r\n this._perPositionHeight = perPositionHeight;\r\n this._perPositionHeightExtrude = perPositionHeightExtrude;\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._workerName = \"createPolygonOutlineGeometry\";\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n PolygonGeometryLibrary.computeHierarchyPackedLength(\r\n polygonHierarchy,\r\n Cartesian3\r\n ) +\r\n Ellipsoid.packedLength +\r\n 8;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {PolygonOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nPolygonOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n startingIndex = PolygonGeometryLibrary.packPolygonHierarchy(\r\n value._polygonHierarchy,\r\n array,\r\n startingIndex,\r\n Cartesian3\r\n );\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n array[startingIndex++] = value._height;\r\n array[startingIndex++] = value._extrudedHeight;\r\n array[startingIndex++] = value._granularity;\r\n array[startingIndex++] = value._perPositionHeightExtrude ? 1.0 : 0.0;\r\n array[startingIndex++] = value._perPositionHeight ? 1.0 : 0.0;\r\n array[startingIndex++] = value._arcType;\r\n array[startingIndex++] = defaultValue(value._offsetAttribute, -1);\r\n array[startingIndex] = value.packedLength;\r\n\r\n return array;\r\n};\r\n\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst dummyOptions = {\r\n polygonHierarchy: {},\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {PolygonOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {PolygonOutlineGeometry} The modified result parameter or a new PolygonOutlineGeometry instance if one was not provided.\r\n */\r\nPolygonOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const polygonHierarchy = PolygonGeometryLibrary.unpackPolygonHierarchy(\r\n array,\r\n startingIndex,\r\n Cartesian3\r\n );\r\n startingIndex = polygonHierarchy.startingIndex;\r\n delete polygonHierarchy.startingIndex;\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const height = array[startingIndex++];\r\n const extrudedHeight = array[startingIndex++];\r\n const granularity = array[startingIndex++];\r\n const perPositionHeightExtrude = array[startingIndex++] === 1.0;\r\n const perPositionHeight = array[startingIndex++] === 1.0;\r\n const arcType = array[startingIndex++];\r\n const offsetAttribute = array[startingIndex++];\r\n const packedLength = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n result = new PolygonOutlineGeometry(dummyOptions);\r\n }\r\n\r\n result._polygonHierarchy = polygonHierarchy;\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._height = height;\r\n result._extrudedHeight = extrudedHeight;\r\n result._granularity = granularity;\r\n result._perPositionHeight = perPositionHeight;\r\n result._perPositionHeightExtrude = perPositionHeightExtrude;\r\n result._arcType = arcType;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n result.packedLength = packedLength;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * A description of a polygon outline from an array of positions.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of positions that defined the corner points of the polygon.\r\n * @param {Number} [options.height=0.0] The height of the polygon.\r\n * @param {Number} [options.extrudedHeight] The height of the polygon extrusion.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.\r\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.\r\n * @returns {PolygonOutlineGeometry}\r\n *\r\n *\r\n * @example\r\n * // create a polygon from points\r\n * const polygon = Cesium.PolygonOutlineGeometry.fromPositions({\r\n * positions : Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0,\r\n * -75.0, 30.0,\r\n * -70.0, 30.0,\r\n * -68.0, 40.0\r\n * ])\r\n * });\r\n * const geometry = Cesium.PolygonOutlineGeometry.createGeometry(polygon);\r\n *\r\n * @see PolygonOutlineGeometry#createGeometry\r\n */\r\nPolygonOutlineGeometry.fromPositions = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"options.positions\", options.positions);\r\n //>>includeEnd('debug');\r\n\r\n const newOptions = {\r\n polygonHierarchy: {\r\n positions: options.positions,\r\n },\r\n height: options.height,\r\n extrudedHeight: options.extrudedHeight,\r\n ellipsoid: options.ellipsoid,\r\n granularity: options.granularity,\r\n perPositionHeight: options.perPositionHeight,\r\n arcType: options.arcType,\r\n offsetAttribute: options.offsetAttribute,\r\n };\r\n return new PolygonOutlineGeometry(newOptions);\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a polygon outline, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {PolygonOutlineGeometry} polygonGeometry A description of the polygon outline.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nPolygonOutlineGeometry.createGeometry = function (polygonGeometry) {\r\n const ellipsoid = polygonGeometry._ellipsoid;\r\n const granularity = polygonGeometry._granularity;\r\n const polygonHierarchy = polygonGeometry._polygonHierarchy;\r\n const perPositionHeight = polygonGeometry._perPositionHeight;\r\n const arcType = polygonGeometry._arcType;\r\n\r\n const polygons = PolygonGeometryLibrary.polygonOutlinesFromHierarchy(\r\n polygonHierarchy,\r\n !perPositionHeight,\r\n ellipsoid\r\n );\r\n\r\n if (polygons.length === 0) {\r\n return undefined;\r\n }\r\n\r\n let geometryInstance;\r\n const geometries = [];\r\n const minDistance = CesiumMath.chordLength(\r\n granularity,\r\n ellipsoid.maximumRadius\r\n );\r\n\r\n const height = polygonGeometry._height;\r\n const extrudedHeight = polygonGeometry._extrudedHeight;\r\n const extrude =\r\n polygonGeometry._perPositionHeightExtrude ||\r\n !CesiumMath.equalsEpsilon(height, extrudedHeight, 0, CesiumMath.EPSILON2);\r\n let offsetValue;\r\n let i;\r\n if (extrude) {\r\n for (i = 0; i < polygons.length; i++) {\r\n geometryInstance = createGeometryFromPositionsExtruded(\r\n ellipsoid,\r\n polygons[i],\r\n minDistance,\r\n perPositionHeight,\r\n arcType\r\n );\r\n geometryInstance.geometry = PolygonGeometryLibrary.scaleToGeodeticHeightExtruded(\r\n geometryInstance.geometry,\r\n height,\r\n extrudedHeight,\r\n ellipsoid,\r\n perPositionHeight\r\n );\r\n if (defined(polygonGeometry._offsetAttribute)) {\r\n const size =\r\n geometryInstance.geometry.attributes.position.values.length / 3;\r\n let offsetAttribute = new Uint8Array(size);\r\n if (polygonGeometry._offsetAttribute === GeometryOffsetAttribute.TOP) {\r\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\r\n } else {\r\n offsetValue =\r\n polygonGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n offsetAttribute = offsetAttribute.fill(offsetValue);\r\n }\r\n\r\n geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute(\r\n {\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: offsetAttribute,\r\n }\r\n );\r\n }\r\n geometries.push(geometryInstance);\r\n }\r\n } else {\r\n for (i = 0; i < polygons.length; i++) {\r\n geometryInstance = createGeometryFromPositions(\r\n ellipsoid,\r\n polygons[i],\r\n minDistance,\r\n perPositionHeight,\r\n arcType\r\n );\r\n geometryInstance.geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\r\n geometryInstance.geometry.attributes.position.values,\r\n height,\r\n ellipsoid,\r\n !perPositionHeight\r\n );\r\n\r\n if (defined(polygonGeometry._offsetAttribute)) {\r\n const length =\r\n geometryInstance.geometry.attributes.position.values.length;\r\n offsetValue =\r\n polygonGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute(\r\n {\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n }\r\n );\r\n }\r\n\r\n geometries.push(geometryInstance);\r\n }\r\n }\r\n\r\n const geometry = GeometryPipeline.combineInstances(geometries)[0];\r\n const boundingSphere = BoundingSphere.fromVertices(\r\n geometry.attributes.position.values\r\n );\r\n\r\n return new Geometry({\r\n attributes: geometry.attributes,\r\n indices: geometry.indices,\r\n primitiveType: geometry.primitiveType,\r\n boundingSphere: boundingSphere,\r\n offsetAttribute: polygonGeometry._offsetAttribute,\r\n });\r\n};\r\nexport default PolygonOutlineGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport PolygonOutlineGeometry from \"../Core/PolygonOutlineGeometry.js\";\r\n\r\nfunction createPolygonOutlineGeometry(polygonGeometry, offset) {\r\n if (defined(offset)) {\r\n polygonGeometry = PolygonOutlineGeometry.unpack(polygonGeometry, offset);\r\n }\r\n polygonGeometry._ellipsoid = Ellipsoid.clone(polygonGeometry._ellipsoid);\r\n return PolygonOutlineGeometry.createGeometry(polygonGeometry);\r\n}\r\nexport default createPolygonOutlineGeometry;\r\n"],"names":["EllipsoidTangentPlane","PolygonPipeline","WindingOrder","ArcType","PolygonGeometryLibrary","IndexDatatype","GeometryInstance","Geometry","GeometryAttributes","GeometryAttribute","ComponentDatatype","PrimitiveType","Check","defined","DeveloperError","defaultValue","Ellipsoid","CesiumMath","Cartes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S,CAAC;EACV,OAAO;AACP;EACA,MAAM,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;EACxC,KAAK;EACL,GAAG;AACH;EACA,EAAE,MAAM,QAAQ,GAAGU,iCAAgB,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;EACpE,EAAE,MAAM,cAAc,GAAGC,yBAAc,CAAC,YAAY;EACpD,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM;EACvC,GAAG,CAAC;AACJ;EACA,EAAE,OAAO,IAAId,0BAAQ,CAAC;EACtB,IAAI,UAAU,EAAE,QAAQ,CAAC,UAAU;EACnC,IAAI,OAAO,EAAE,QAAQ,CAAC,OAAO;EAC7B,IAAI,aAAa,EAAE,QAAQ,CAAC,aAAa;EACzC,IAAI,cAAc,EAAE,cAAc;EAClC,IAAI,eAAe,EAAE,eAAe,CAAC,gBAAgB;EACrD,GAAG,CAAC,CAAC;EACL,CAAC;;EC9qBD,SAAS,4BAA4B,CAAC,eAAe,EAAE,MAAM,EAAE;EAC/D,EAAE,IAAIM,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,eAAe,GAAG,sBAAsB,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;EAC7E,GAAG;EACH,EAAE,eAAe,CAAC,UAAU,GAAGG,iBAAS,CAAC,KAAK,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;EAC3E,EAAE,OAAO,sBAAsB,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;EAChE;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createPolylineGeometry.js b/examples/cesium/Workers/createPolylineGeometry.js
new file mode 100644
index 0000000..bd27a03
--- /dev/null
+++ b/examples/cesium/Workers/createPolylineGeometry.js
@@ -0,0 +1,597 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './ArcType-d608b872', './arrayRemoveDuplicates-c3526030', './Transforms-11fb6b0a', './Color-c019c34b', './ComponentDatatype-13a5630b', './Check-d10e5f2e', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolylinePipeline-3c021236', './VertexFormat-f2d74c96', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29', './EllipsoidGeodesic-38d0ed4a', './EllipsoidRhumbLine-48b4507b', './IntersectionTests-2c7928de', './Plane-c9f1487d'], (function (defaultValue, Matrix3, ArcType, arrayRemoveDuplicates, Transforms, Color, ComponentDatatype, Check, GeometryAttribute, GeometryAttributes, IndexDatatype, Math$1, PolylinePipeline, VertexFormat, Matrix2, RuntimeError, combine, WebGLConstants, EllipsoidGeodesic, EllipsoidRhumbLine, IntersectionTests, Plane) { 'use strict';
+
+ const scratchInterpolateColorsArray = [];
+
+ function interpolateColors(p0, p1, color0, color1, numPoints) {
+ const colors = scratchInterpolateColorsArray;
+ colors.length = numPoints;
+ let i;
+
+ const r0 = color0.red;
+ const g0 = color0.green;
+ const b0 = color0.blue;
+ const a0 = color0.alpha;
+
+ const r1 = color1.red;
+ const g1 = color1.green;
+ const b1 = color1.blue;
+ const a1 = color1.alpha;
+
+ if (Color.Color.equals(color0, color1)) {
+ for (i = 0; i < numPoints; i++) {
+ colors[i] = Color.Color.clone(color0);
+ }
+ return colors;
+ }
+
+ const redPerVertex = (r1 - r0) / numPoints;
+ const greenPerVertex = (g1 - g0) / numPoints;
+ const bluePerVertex = (b1 - b0) / numPoints;
+ const alphaPerVertex = (a1 - a0) / numPoints;
+
+ for (i = 0; i < numPoints; i++) {
+ colors[i] = new Color.Color(
+ r0 + i * redPerVertex,
+ g0 + i * greenPerVertex,
+ b0 + i * bluePerVertex,
+ a0 + i * alphaPerVertex
+ );
+ }
+
+ return colors;
+ }
+
+ /**
+ * A description of a polyline modeled as a line strip; the first two positions define a line segment,
+ * and each additional position defines a line segment from the previous position. The polyline is capable of
+ * displaying with a material.
+ *
+ * @alias PolylineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
+ * @param {Number} [options.width=1.0] The width in pixels.
+ * @param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.
+ * @param {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
+ * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ *
+ * @exception {DeveloperError} At least two positions are required.
+ * @exception {DeveloperError} width must be greater than or equal to one.
+ * @exception {DeveloperError} colors has an invalid length.
+ *
+ * @see PolylineGeometry#createGeometry
+ *
+ * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline.html|Cesium Sandcastle Polyline Demo}
+ *
+ * @example
+ * // A polyline with two connected line segments
+ * const polyline = new Cesium.PolylineGeometry({
+ * positions : Cesium.Cartesian3.fromDegreesArray([
+ * 0.0, 0.0,
+ * 5.0, 0.0,
+ * 5.0, 5.0
+ * ]),
+ * width : 10.0
+ * });
+ * const geometry = Cesium.PolylineGeometry.createGeometry(polyline);
+ */
+ function PolylineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const positions = options.positions;
+ const colors = options.colors;
+ const width = defaultValue.defaultValue(options.width, 1.0);
+ const colorsPerVertex = defaultValue.defaultValue(options.colorsPerVertex, false);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(positions) || positions.length < 2) {
+ throw new Check.DeveloperError("At least two positions are required.");
+ }
+ if (typeof width !== "number") {
+ throw new Check.DeveloperError("width must be a number");
+ }
+ if (
+ defaultValue.defined(colors) &&
+ ((colorsPerVertex && colors.length < positions.length) ||
+ (!colorsPerVertex && colors.length < positions.length - 1))
+ ) {
+ throw new Check.DeveloperError("colors has an invalid length.");
+ }
+ //>>includeEnd('debug');
+
+ this._positions = positions;
+ this._colors = colors;
+ this._width = width;
+ this._colorsPerVertex = colorsPerVertex;
+ this._vertexFormat = VertexFormat.VertexFormat.clone(
+ defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT)
+ );
+
+ this._arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
+ this._granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ this._ellipsoid = Matrix3.Ellipsoid.clone(
+ defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
+ );
+ this._workerName = "createPolylineGeometry";
+
+ let numComponents = 1 + positions.length * Matrix3.Cartesian3.packedLength;
+ numComponents += defaultValue.defined(colors) ? 1 + colors.length * Color.Color.packedLength : 1;
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ numComponents + Matrix3.Ellipsoid.packedLength + VertexFormat.VertexFormat.packedLength + 4;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {PolylineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ PolylineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ const positions = value._positions;
+ let length = positions.length;
+ array[startingIndex++] = length;
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
+ }
+
+ const colors = value._colors;
+ length = defaultValue.defined(colors) ? colors.length : 0.0;
+ array[startingIndex++] = length;
+
+ for (i = 0; i < length; ++i, startingIndex += Color.Color.packedLength) {
+ Color.Color.pack(colors[i], array, startingIndex);
+ }
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ array[startingIndex++] = value._width;
+ array[startingIndex++] = value._colorsPerVertex ? 1.0 : 0.0;
+ array[startingIndex++] = value._arcType;
+ array[startingIndex] = value._granularity;
+
+ return array;
+ };
+
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+ const scratchOptions = {
+ positions: undefined,
+ colors: undefined,
+ ellipsoid: scratchEllipsoid,
+ vertexFormat: scratchVertexFormat,
+ width: undefined,
+ colorsPerVertex: undefined,
+ arcType: undefined,
+ granularity: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {PolylineGeometry} [result] The object into which to store the result.
+ * @returns {PolylineGeometry} The modified result parameter or a new PolylineGeometry instance if one was not provided.
+ */
+ PolylineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ let length = array[startingIndex++];
+ const positions = new Array(length);
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
+ }
+
+ length = array[startingIndex++];
+ const colors = length > 0 ? new Array(length) : undefined;
+
+ for (i = 0; i < length; ++i, startingIndex += Color.Color.packedLength) {
+ colors[i] = Color.Color.unpack(array, startingIndex);
+ }
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ const width = array[startingIndex++];
+ const colorsPerVertex = array[startingIndex++] === 1.0;
+ const arcType = array[startingIndex++];
+ const granularity = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.positions = positions;
+ scratchOptions.colors = colors;
+ scratchOptions.width = width;
+ scratchOptions.colorsPerVertex = colorsPerVertex;
+ scratchOptions.arcType = arcType;
+ scratchOptions.granularity = granularity;
+ return new PolylineGeometry(scratchOptions);
+ }
+
+ result._positions = positions;
+ result._colors = colors;
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._width = width;
+ result._colorsPerVertex = colorsPerVertex;
+ result._arcType = arcType;
+ result._granularity = granularity;
+
+ return result;
+ };
+
+ const scratchCartesian3 = new Matrix3.Cartesian3();
+ const scratchPosition = new Matrix3.Cartesian3();
+ const scratchPrevPosition = new Matrix3.Cartesian3();
+ const scratchNextPosition = new Matrix3.Cartesian3();
+
+ /**
+ * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {PolylineGeometry} polylineGeometry A description of the polyline.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ PolylineGeometry.createGeometry = function (polylineGeometry) {
+ const width = polylineGeometry._width;
+ const vertexFormat = polylineGeometry._vertexFormat;
+ let colors = polylineGeometry._colors;
+ const colorsPerVertex = polylineGeometry._colorsPerVertex;
+ const arcType = polylineGeometry._arcType;
+ const granularity = polylineGeometry._granularity;
+ const ellipsoid = polylineGeometry._ellipsoid;
+
+ let i;
+ let j;
+ let k;
+
+ const removedIndices = [];
+ let positions = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ polylineGeometry._positions,
+ Matrix3.Cartesian3.equalsEpsilon,
+ false,
+ removedIndices
+ );
+
+ if (defaultValue.defined(colors) && removedIndices.length > 0) {
+ let removedArrayIndex = 0;
+ let nextRemovedIndex = removedIndices[0];
+ colors = colors.filter(function (color, index) {
+ let remove = false;
+ if (colorsPerVertex) {
+ remove =
+ index === nextRemovedIndex || (index === 0 && nextRemovedIndex === 1);
+ } else {
+ remove = index + 1 === nextRemovedIndex;
+ }
+
+ if (remove) {
+ removedArrayIndex++;
+ nextRemovedIndex = removedIndices[removedArrayIndex];
+ return false;
+ }
+ return true;
+ });
+ }
+
+ let positionsLength = positions.length;
+
+ // A width of a pixel or less is not a valid geometry, but in order to support external data
+ // that may have errors we treat this as an empty geometry.
+ if (positionsLength < 2 || width <= 0.0) {
+ return undefined;
+ }
+
+ if (arcType === ArcType.ArcType.GEODESIC || arcType === ArcType.ArcType.RHUMB) {
+ let subdivisionSize;
+ let numberOfPointsFunction;
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ subdivisionSize = Math$1.CesiumMath.chordLength(
+ granularity,
+ ellipsoid.maximumRadius
+ );
+ numberOfPointsFunction = PolylinePipeline.PolylinePipeline.numberOfPoints;
+ } else {
+ subdivisionSize = granularity;
+ numberOfPointsFunction = PolylinePipeline.PolylinePipeline.numberOfPointsRhumbLine;
+ }
+
+ const heights = PolylinePipeline.PolylinePipeline.extractHeights(positions, ellipsoid);
+
+ if (defaultValue.defined(colors)) {
+ let colorLength = 1;
+ for (i = 0; i < positionsLength - 1; ++i) {
+ colorLength += numberOfPointsFunction(
+ positions[i],
+ positions[i + 1],
+ subdivisionSize
+ );
+ }
+
+ const newColors = new Array(colorLength);
+ let newColorIndex = 0;
+
+ for (i = 0; i < positionsLength - 1; ++i) {
+ const p0 = positions[i];
+ const p1 = positions[i + 1];
+ const c0 = colors[i];
+
+ const numColors = numberOfPointsFunction(p0, p1, subdivisionSize);
+ if (colorsPerVertex && i < colorLength) {
+ const c1 = colors[i + 1];
+ const interpolatedColors = interpolateColors(
+ p0,
+ p1,
+ c0,
+ c1,
+ numColors
+ );
+ const interpolatedColorsLength = interpolatedColors.length;
+ for (j = 0; j < interpolatedColorsLength; ++j) {
+ newColors[newColorIndex++] = interpolatedColors[j];
+ }
+ } else {
+ for (j = 0; j < numColors; ++j) {
+ newColors[newColorIndex++] = Color.Color.clone(c0);
+ }
+ }
+ }
+
+ newColors[newColorIndex] = Color.Color.clone(colors[colors.length - 1]);
+ colors = newColors;
+
+ scratchInterpolateColorsArray.length = 0;
+ }
+
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ positions = PolylinePipeline.PolylinePipeline.generateCartesianArc({
+ positions: positions,
+ minDistance: subdivisionSize,
+ ellipsoid: ellipsoid,
+ height: heights,
+ });
+ } else {
+ positions = PolylinePipeline.PolylinePipeline.generateCartesianRhumbArc({
+ positions: positions,
+ granularity: subdivisionSize,
+ ellipsoid: ellipsoid,
+ height: heights,
+ });
+ }
+ }
+
+ positionsLength = positions.length;
+ const size = positionsLength * 4.0 - 4.0;
+
+ const finalPositions = new Float64Array(size * 3);
+ const prevPositions = new Float64Array(size * 3);
+ const nextPositions = new Float64Array(size * 3);
+ const expandAndWidth = new Float32Array(size * 2);
+ const st = vertexFormat.st ? new Float32Array(size * 2) : undefined;
+ const finalColors = defaultValue.defined(colors) ? new Uint8Array(size * 4) : undefined;
+
+ let positionIndex = 0;
+ let expandAndWidthIndex = 0;
+ let stIndex = 0;
+ let colorIndex = 0;
+ let position;
+
+ for (j = 0; j < positionsLength; ++j) {
+ if (j === 0) {
+ position = scratchCartesian3;
+ Matrix3.Cartesian3.subtract(positions[0], positions[1], position);
+ Matrix3.Cartesian3.add(positions[0], position, position);
+ } else {
+ position = positions[j - 1];
+ }
+
+ Matrix3.Cartesian3.clone(position, scratchPrevPosition);
+ Matrix3.Cartesian3.clone(positions[j], scratchPosition);
+
+ if (j === positionsLength - 1) {
+ position = scratchCartesian3;
+ Matrix3.Cartesian3.subtract(
+ positions[positionsLength - 1],
+ positions[positionsLength - 2],
+ position
+ );
+ Matrix3.Cartesian3.add(positions[positionsLength - 1], position, position);
+ } else {
+ position = positions[j + 1];
+ }
+
+ Matrix3.Cartesian3.clone(position, scratchNextPosition);
+
+ let color0, color1;
+ if (defaultValue.defined(finalColors)) {
+ if (j !== 0 && !colorsPerVertex) {
+ color0 = colors[j - 1];
+ } else {
+ color0 = colors[j];
+ }
+
+ if (j !== positionsLength - 1) {
+ color1 = colors[j];
+ }
+ }
+
+ const startK = j === 0 ? 2 : 0;
+ const endK = j === positionsLength - 1 ? 2 : 4;
+
+ for (k = startK; k < endK; ++k) {
+ Matrix3.Cartesian3.pack(scratchPosition, finalPositions, positionIndex);
+ Matrix3.Cartesian3.pack(scratchPrevPosition, prevPositions, positionIndex);
+ Matrix3.Cartesian3.pack(scratchNextPosition, nextPositions, positionIndex);
+ positionIndex += 3;
+
+ const direction = k - 2 < 0 ? -1.0 : 1.0;
+ expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1; // expand direction
+ expandAndWidth[expandAndWidthIndex++] = direction * width;
+
+ if (vertexFormat.st) {
+ st[stIndex++] = j / (positionsLength - 1);
+ st[stIndex++] = Math.max(expandAndWidth[expandAndWidthIndex - 2], 0.0);
+ }
+
+ if (defaultValue.defined(finalColors)) {
+ const color = k < 2 ? color0 : color1;
+
+ finalColors[colorIndex++] = Color.Color.floatToByte(color.red);
+ finalColors[colorIndex++] = Color.Color.floatToByte(color.green);
+ finalColors[colorIndex++] = Color.Color.floatToByte(color.blue);
+ finalColors[colorIndex++] = Color.Color.floatToByte(color.alpha);
+ }
+ }
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: finalPositions,
+ });
+
+ attributes.prevPosition = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: prevPositions,
+ });
+
+ attributes.nextPosition = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: nextPositions,
+ });
+
+ attributes.expandAndWidth = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: expandAndWidth,
+ });
+
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: st,
+ });
+ }
+
+ if (defaultValue.defined(finalColors)) {
+ attributes.color = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 4,
+ values: finalColors,
+ normalize: true,
+ });
+ }
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(size, positionsLength * 6 - 6);
+ let index = 0;
+ let indicesIndex = 0;
+ const length = positionsLength - 1.0;
+ for (j = 0; j < length; ++j) {
+ indices[indicesIndex++] = index;
+ indices[indicesIndex++] = index + 2;
+ indices[indicesIndex++] = index + 1;
+
+ indices[indicesIndex++] = index + 1;
+ indices[indicesIndex++] = index + 2;
+ indices[indicesIndex++] = index + 3;
+
+ index += 4;
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ boundingSphere: Transforms.BoundingSphere.fromPoints(positions),
+ geometryType: GeometryAttribute.GeometryType.POLYLINES,
+ });
+ };
+
+ function createPolylineGeometry(polylineGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ polylineGeometry = PolylineGeometry.unpack(polylineGeometry, offset);
+ }
+ polylineGeometry._ellipsoid = Matrix3.Ellipsoid.clone(polylineGeometry._ellipsoid);
+ return PolylineGeometry.createGeometry(polylineGeometry);
+ }
+
+ return createPolylineGeometry;
+
+}));
+//# sourceMappingURL=createPolylineGeometry.js.map
diff --git a/examples/cesium/Workers/createPolylineGeometry.js.map b/examples/cesium/Workers/createPolylineGeometry.js.map
new file mode 100644
index 0000000..57b0f72
--- /dev/null
+++ b/examples/cesium/Workers/createPolylineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createPolylineGeometry.js","sources":["../../../Source/Core/PolylineGeometry.js","../../../Source/WorkersES6/createPolylineGeometry.js"],"sourcesContent":["import ArcType from \"./ArcType.js\";\r\nimport arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Color from \"./Color.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryType from \"./GeometryType.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PolylinePipeline from \"./PolylinePipeline.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\nconst scratchInterpolateColorsArray = [];\r\n\r\nfunction interpolateColors(p0, p1, color0, color1, numPoints) {\r\n const colors = scratchInterpolateColorsArray;\r\n colors.length = numPoints;\r\n let i;\r\n\r\n const r0 = color0.red;\r\n const g0 = color0.green;\r\n const b0 = color0.blue;\r\n const a0 = color0.alpha;\r\n\r\n const r1 = color1.red;\r\n const g1 = color1.green;\r\n const b1 = color1.blue;\r\n const a1 = color1.alpha;\r\n\r\n if (Color.equals(color0, color1)) {\r\n for (i = 0; i < numPoints; i++) {\r\n colors[i] = Color.clone(color0);\r\n }\r\n return colors;\r\n }\r\n\r\n const redPerVertex = (r1 - r0) / numPoints;\r\n const greenPerVertex = (g1 - g0) / numPoints;\r\n const bluePerVertex = (b1 - b0) / numPoints;\r\n const alphaPerVertex = (a1 - a0) / numPoints;\r\n\r\n for (i = 0; i < numPoints; i++) {\r\n colors[i] = new Color(\r\n r0 + i * redPerVertex,\r\n g0 + i * greenPerVertex,\r\n b0 + i * bluePerVertex,\r\n a0 + i * alphaPerVertex\r\n );\r\n }\r\n\r\n return colors;\r\n}\r\n\r\n/**\r\n * A description of a polyline modeled as a line strip; the first two positions define a line segment,\r\n * and each additional position defines a line segment from the previous position. The polyline is capable of\r\n * displaying with a material.\r\n *\r\n * @alias PolylineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the positions in the polyline as a line strip.\r\n * @param {Number} [options.width=1.0] The width in pixels.\r\n * @param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.\r\n * @param {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.\r\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n *\r\n * @exception {DeveloperError} At least two positions are required.\r\n * @exception {DeveloperError} width must be greater than or equal to one.\r\n * @exception {DeveloperError} colors has an invalid length.\r\n *\r\n * @see PolylineGeometry#createGeometry\r\n *\r\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline.html|Cesium Sandcastle Polyline Demo}\r\n *\r\n * @example\r\n * // A polyline with two connected line segments\r\n * const polyline = new Cesium.PolylineGeometry({\r\n * positions : Cesium.Cartesian3.fromDegreesArray([\r\n * 0.0, 0.0,\r\n * 5.0, 0.0,\r\n * 5.0, 5.0\r\n * ]),\r\n * width : 10.0\r\n * });\r\n * const geometry = Cesium.PolylineGeometry.createGeometry(polyline);\r\n */\r\nfunction PolylineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const positions = options.positions;\r\n const colors = options.colors;\r\n const width = defaultValue(options.width, 1.0);\r\n const colorsPerVertex = defaultValue(options.colorsPerVertex, false);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(positions) || positions.length < 2) {\r\n throw new DeveloperError(\"At least two positions are required.\");\r\n }\r\n if (typeof width !== \"number\") {\r\n throw new DeveloperError(\"width must be a number\");\r\n }\r\n if (\r\n defined(colors) &&\r\n ((colorsPerVertex && colors.length < positions.length) ||\r\n (!colorsPerVertex && colors.length < positions.length - 1))\r\n ) {\r\n throw new DeveloperError(\"colors has an invalid length.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n this._positions = positions;\r\n this._colors = colors;\r\n this._width = width;\r\n this._colorsPerVertex = colorsPerVertex;\r\n this._vertexFormat = VertexFormat.clone(\r\n defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\r\n );\r\n\r\n this._arcType = defaultValue(options.arcType, ArcType.GEODESIC);\r\n this._granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n this._ellipsoid = Ellipsoid.clone(\r\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\r\n );\r\n this._workerName = \"createPolylineGeometry\";\r\n\r\n let numComponents = 1 + positions.length * Cartesian3.packedLength;\r\n numComponents += defined(colors) ? 1 + colors.length * Color.packedLength : 1;\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 4;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {PolylineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nPolylineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n const positions = value._positions;\r\n let length = positions.length;\r\n array[startingIndex++] = length;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n Cartesian3.pack(positions[i], array, startingIndex);\r\n }\r\n\r\n const colors = value._colors;\r\n length = defined(colors) ? colors.length : 0.0;\r\n array[startingIndex++] = length;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\r\n Color.pack(colors[i], array, startingIndex);\r\n }\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n array[startingIndex++] = value._width;\r\n array[startingIndex++] = value._colorsPerVertex ? 1.0 : 0.0;\r\n array[startingIndex++] = value._arcType;\r\n array[startingIndex] = value._granularity;\r\n\r\n return array;\r\n};\r\n\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchVertexFormat = new VertexFormat();\r\nconst scratchOptions = {\r\n positions: undefined,\r\n colors: undefined,\r\n ellipsoid: scratchEllipsoid,\r\n vertexFormat: scratchVertexFormat,\r\n width: undefined,\r\n colorsPerVertex: undefined,\r\n arcType: undefined,\r\n granularity: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {PolylineGeometry} [result] The object into which to store the result.\r\n * @returns {PolylineGeometry} The modified result parameter or a new PolylineGeometry instance if one was not provided.\r\n */\r\nPolylineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n let length = array[startingIndex++];\r\n const positions = new Array(length);\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n positions[i] = Cartesian3.unpack(array, startingIndex);\r\n }\r\n\r\n length = array[startingIndex++];\r\n const colors = length > 0 ? new Array(length) : undefined;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\r\n colors[i] = Color.unpack(array, startingIndex);\r\n }\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n const width = array[startingIndex++];\r\n const colorsPerVertex = array[startingIndex++] === 1.0;\r\n const arcType = array[startingIndex++];\r\n const granularity = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.positions = positions;\r\n scratchOptions.colors = colors;\r\n scratchOptions.width = width;\r\n scratchOptions.colorsPerVertex = colorsPerVertex;\r\n scratchOptions.arcType = arcType;\r\n scratchOptions.granularity = granularity;\r\n return new PolylineGeometry(scratchOptions);\r\n }\r\n\r\n result._positions = positions;\r\n result._colors = colors;\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._width = width;\r\n result._colorsPerVertex = colorsPerVertex;\r\n result._arcType = arcType;\r\n result._granularity = granularity;\r\n\r\n return result;\r\n};\r\n\r\nconst scratchCartesian3 = new Cartesian3();\r\nconst scratchPosition = new Cartesian3();\r\nconst scratchPrevPosition = new Cartesian3();\r\nconst scratchNextPosition = new Cartesian3();\r\n\r\n/**\r\n * Computes the geometric representation of a polyline, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {PolylineGeometry} polylineGeometry A description of the polyline.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nPolylineGeometry.createGeometry = function (polylineGeometry) {\r\n const width = polylineGeometry._width;\r\n const vertexFormat = polylineGeometry._vertexFormat;\r\n let colors = polylineGeometry._colors;\r\n const colorsPerVertex = polylineGeometry._colorsPerVertex;\r\n const arcType = polylineGeometry._arcType;\r\n const granularity = polylineGeometry._granularity;\r\n const ellipsoid = polylineGeometry._ellipsoid;\r\n\r\n let i;\r\n let j;\r\n let k;\r\n\r\n const removedIndices = [];\r\n let positions = arrayRemoveDuplicates(\r\n polylineGeometry._positions,\r\n Cartesian3.equalsEpsilon,\r\n false,\r\n removedIndices\r\n );\r\n\r\n if (defined(colors) && removedIndices.length > 0) {\r\n let removedArrayIndex = 0;\r\n let nextRemovedIndex = removedIndices[0];\r\n colors = colors.filter(function (color, index) {\r\n let remove = false;\r\n if (colorsPerVertex) {\r\n remove =\r\n index === nextRemovedIndex || (index === 0 && nextRemovedIndex === 1);\r\n } else {\r\n remove = index + 1 === nextRemovedIndex;\r\n }\r\n\r\n if (remove) {\r\n removedArrayIndex++;\r\n nextRemovedIndex = removedIndices[removedArrayIndex];\r\n return false;\r\n }\r\n return true;\r\n });\r\n }\r\n\r\n let positionsLength = positions.length;\r\n\r\n // A width of a pixel or less is not a valid geometry, but in order to support external data\r\n // that may have errors we treat this as an empty geometry.\r\n if (positionsLength < 2 || width <= 0.0) {\r\n return undefined;\r\n }\r\n\r\n if (arcType === ArcType.GEODESIC || arcType === ArcType.RHUMB) {\r\n let subdivisionSize;\r\n let numberOfPointsFunction;\r\n if (arcType === ArcType.GEODESIC) {\r\n subdivisionSize = CesiumMath.chordLength(\r\n granularity,\r\n ellipsoid.maximumRadius\r\n );\r\n numberOfPointsFunction = PolylinePipeline.numberOfPoints;\r\n } else {\r\n subdivisionSize = granularity;\r\n numberOfPointsFunction = PolylinePipeline.numberOfPointsRhumbLine;\r\n }\r\n\r\n const heights = PolylinePipeline.extractHeights(positions, ellipsoid);\r\n\r\n if (defined(colors)) {\r\n let colorLength = 1;\r\n for (i = 0; i < positionsLength - 1; ++i) {\r\n colorLength += numberOfPointsFunction(\r\n positions[i],\r\n positions[i + 1],\r\n subdivisionSize\r\n );\r\n }\r\n\r\n const newColors = new Array(colorLength);\r\n let newColorIndex = 0;\r\n\r\n for (i = 0; i < positionsLength - 1; ++i) {\r\n const p0 = positions[i];\r\n const p1 = positions[i + 1];\r\n const c0 = colors[i];\r\n\r\n const numColors = numberOfPointsFunction(p0, p1, subdivisionSize);\r\n if (colorsPerVertex && i < colorLength) {\r\n const c1 = colors[i + 1];\r\n const interpolatedColors = interpolateColors(\r\n p0,\r\n p1,\r\n c0,\r\n c1,\r\n numColors\r\n );\r\n const interpolatedColorsLength = interpolatedColors.length;\r\n for (j = 0; j < interpolatedColorsLength; ++j) {\r\n newColors[newColorIndex++] = interpolatedColors[j];\r\n }\r\n } else {\r\n for (j = 0; j < numColors; ++j) {\r\n newColors[newColorIndex++] = Color.clone(c0);\r\n }\r\n }\r\n }\r\n\r\n newColors[newColorIndex] = Color.clone(colors[colors.length - 1]);\r\n colors = newColors;\r\n\r\n scratchInterpolateColorsArray.length = 0;\r\n }\r\n\r\n if (arcType === ArcType.GEODESIC) {\r\n positions = PolylinePipeline.generateCartesianArc({\r\n positions: positions,\r\n minDistance: subdivisionSize,\r\n ellipsoid: ellipsoid,\r\n height: heights,\r\n });\r\n } else {\r\n positions = PolylinePipeline.generateCartesianRhumbArc({\r\n positions: positions,\r\n granularity: subdivisionSize,\r\n ellipsoid: ellipsoid,\r\n height: heights,\r\n });\r\n }\r\n }\r\n\r\n positionsLength = positions.length;\r\n const size = positionsLength * 4.0 - 4.0;\r\n\r\n const finalPositions = new Float64Array(size * 3);\r\n const prevPositions = new Float64Array(size * 3);\r\n const nextPositions = new Float64Array(size * 3);\r\n const expandAndWidth = new Float32Array(size * 2);\r\n const st = vertexFormat.st ? new Float32Array(size * 2) : undefined;\r\n const finalColors = defined(colors) ? new Uint8Array(size * 4) : undefined;\r\n\r\n let positionIndex = 0;\r\n let expandAndWidthIndex = 0;\r\n let stIndex = 0;\r\n let colorIndex = 0;\r\n let position;\r\n\r\n for (j = 0; j < positionsLength; ++j) {\r\n if (j === 0) {\r\n position = scratchCartesian3;\r\n Cartesian3.subtract(positions[0], positions[1], position);\r\n Cartesian3.add(positions[0], position, position);\r\n } else {\r\n position = positions[j - 1];\r\n }\r\n\r\n Cartesian3.clone(position, scratchPrevPosition);\r\n Cartesian3.clone(positions[j], scratchPosition);\r\n\r\n if (j === positionsLength - 1) {\r\n position = scratchCartesian3;\r\n Cartesian3.subtract(\r\n positions[positionsLength - 1],\r\n positions[positionsLength - 2],\r\n position\r\n );\r\n Cartesian3.add(positions[positionsLength - 1], position, position);\r\n } else {\r\n position = positions[j + 1];\r\n }\r\n\r\n Cartesian3.clone(position, scratchNextPosition);\r\n\r\n let color0, color1;\r\n if (defined(finalColors)) {\r\n if (j !== 0 && !colorsPerVertex) {\r\n color0 = colors[j - 1];\r\n } else {\r\n color0 = colors[j];\r\n }\r\n\r\n if (j !== positionsLength - 1) {\r\n color1 = colors[j];\r\n }\r\n }\r\n\r\n const startK = j === 0 ? 2 : 0;\r\n const endK = j === positionsLength - 1 ? 2 : 4;\r\n\r\n for (k = startK; k < endK; ++k) {\r\n Cartesian3.pack(scratchPosition, finalPositions, positionIndex);\r\n Cartesian3.pack(scratchPrevPosition, prevPositions, positionIndex);\r\n Cartesian3.pack(scratchNextPosition, nextPositions, positionIndex);\r\n positionIndex += 3;\r\n\r\n const direction = k - 2 < 0 ? -1.0 : 1.0;\r\n expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1; // expand direction\r\n expandAndWidth[expandAndWidthIndex++] = direction * width;\r\n\r\n if (vertexFormat.st) {\r\n st[stIndex++] = j / (positionsLength - 1);\r\n st[stIndex++] = Math.max(expandAndWidth[expandAndWidthIndex - 2], 0.0);\r\n }\r\n\r\n if (defined(finalColors)) {\r\n const color = k < 2 ? color0 : color1;\r\n\r\n finalColors[colorIndex++] = Color.floatToByte(color.red);\r\n finalColors[colorIndex++] = Color.floatToByte(color.green);\r\n finalColors[colorIndex++] = Color.floatToByte(color.blue);\r\n finalColors[colorIndex++] = Color.floatToByte(color.alpha);\r\n }\r\n }\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: finalPositions,\r\n });\r\n\r\n attributes.prevPosition = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: prevPositions,\r\n });\r\n\r\n attributes.nextPosition = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: nextPositions,\r\n });\r\n\r\n attributes.expandAndWidth = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: expandAndWidth,\r\n });\r\n\r\n if (vertexFormat.st) {\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: st,\r\n });\r\n }\r\n\r\n if (defined(finalColors)) {\r\n attributes.color = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 4,\r\n values: finalColors,\r\n normalize: true,\r\n });\r\n }\r\n\r\n const indices = IndexDatatype.createTypedArray(size, positionsLength * 6 - 6);\r\n let index = 0;\r\n let indicesIndex = 0;\r\n const length = positionsLength - 1.0;\r\n for (j = 0; j < length; ++j) {\r\n indices[indicesIndex++] = index;\r\n indices[indicesIndex++] = index + 2;\r\n indices[indicesIndex++] = index + 1;\r\n\r\n indices[indicesIndex++] = index + 1;\r\n indices[indicesIndex++] = index + 2;\r\n indices[indicesIndex++] = index + 3;\r\n\r\n index += 4;\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n boundingSphere: BoundingSphere.fromPoints(positions),\r\n geometryType: GeometryType.POLYLINES,\r\n });\r\n};\r\nexport default PolylineGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport PolylineGeometry from \"../Core/PolylineGeometry.js\";\r\n\r\nfunction createPolylineGeometry(polylineGeometry, offset) {\r\n if (defined(offset)) {\r\n polylineGeometry = PolylineGeometry.unpack(polylineGeometry, offset);\r\n }\r\n polylineGeometry._ellipsoid = Ellipsoid.clone(polylineGeometry._ellipsoid);\r\n return PolylineGeometry.createGeometry(polylineGeometry);\r\n}\r\nexport default createPolylineGeometry;\r\n"],"names":["Color","defaultValue","defined","DeveloperError","VertexFormat","ArcType","CesiumMath","Ellipsoid","Cartesian3","arrayRemoveDuplicates","PolylinePipeline","GeometryAttributes","GeometryAttribute","ComponentDatatype","IndexDatatype","Geometry","PrimitiveType","BoundingSphere","GeometryType"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,6BAA6B,GAAG,EAAE,CAAC;AACzC;EACA,SAAS,iBAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE;EAC9D,EAAE,MAAM,MAAM,GAAG,6BAA6B,CAAC;EAC/C,EAAE,MAAM,CAAC,MAAM,GAAG,SAAS,CAAC;EAC5B,EAAE,IAAI,CAAC,CAAC;AACR;EACA,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC;EACxB,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;EAC1B,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;EACzB,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;AAC1B;EACA,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC;EACxB,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC;EAC1B,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC;EACzB,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,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,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;EACxC,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;EACxC,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;AACxC;EACA,IAAI,KAAK,IAAI,CAAC,CAAC;EACf,GAAG;AACH;EACA,EAAE,OAAO,IAAIC,0BAAQ,CAAC;EACtB,IAAI,UAAU,EAAE,UAAU;EAC1B,IAAI,OAAO,EAAE,OAAO;EACpB,IAAI,aAAa,EAAEC,+BAAa,CAAC,SAAS;EAC1C,IAAI,cAAc,EAAEC,yBAAc,CAAC,UAAU,CAAC,SAAS,CAAC;EACxD,IAAI,YAAY,EAAEC,8BAAY,CAAC,SAAS;EACxC,GAAG,CAAC,CAAC;EACL,CAAC;;EC5jBD,SAAS,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,EAAE;EAC1D,EAAE,IAAIhB,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;EACzE,GAAG;EACH,EAAE,gBAAgB,CAAC,UAAU,GAAGK,iBAAS,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;EAC7E,EAAE,OAAO,gBAAgB,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;EAC3D;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createPolylineVolumeGeometry.js b/examples/cesium/Workers/createPolylineVolumeGeometry.js
new file mode 100644
index 0000000..d41d5e8
--- /dev/null
+++ b/examples/cesium/Workers/createPolylineVolumeGeometry.js
@@ -0,0 +1,437 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './arrayRemoveDuplicates-c3526030', './BoundingRectangle-6617ed83', './Transforms-11fb6b0a', './Matrix2-036c77dd', './ComponentDatatype-13a5630b', './PolylineVolumeGeometryLibrary-eed2bdf7', './Check-d10e5f2e', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryPipeline-f28890f4', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolygonPipeline-313487c3', './VertexFormat-f2d74c96', './combine-4598d225', './RuntimeError-e5c6a8b9', './WebGLConstants-f27a5e29', './EllipsoidTangentPlane-c421b2cb', './AxisAlignedBoundingBox-50342d27', './IntersectionTests-2c7928de', './Plane-c9f1487d', './PolylinePipeline-3c021236', './EllipsoidGeodesic-38d0ed4a', './EllipsoidRhumbLine-48b4507b', './AttributeCompression-e9888cb8', './EncodedCartesian3-38e2691f'], (function (defaultValue, Matrix3, arrayRemoveDuplicates, BoundingRectangle, Transforms, Matrix2, ComponentDatatype, PolylineVolumeGeometryLibrary, Check, GeometryAttribute, GeometryAttributes, GeometryPipeline, IndexDatatype, Math, PolygonPipeline, VertexFormat, combine, RuntimeError, WebGLConstants, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane, PolylinePipeline, EllipsoidGeodesic, EllipsoidRhumbLine, AttributeCompression, EncodedCartesian3) { 'use strict';
+
+ function computeAttributes(
+ combinedPositions,
+ shape,
+ boundingRectangle,
+ vertexFormat
+ ) {
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: combinedPositions,
+ });
+ }
+ const shapeLength = shape.length;
+ const vertexCount = combinedPositions.length / 3;
+ const length = (vertexCount - shapeLength * 2) / (shapeLength * 2);
+ const firstEndIndices = PolygonPipeline.PolygonPipeline.triangulate(shape);
+
+ const indicesCount =
+ (length - 1) * shapeLength * 6 + firstEndIndices.length * 2;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(vertexCount, indicesCount);
+ let i, j;
+ let ll, ul, ur, lr;
+ const offset = shapeLength * 2;
+ let index = 0;
+ for (i = 0; i < length - 1; i++) {
+ for (j = 0; j < shapeLength - 1; j++) {
+ ll = j * 2 + i * shapeLength * 2;
+ lr = ll + offset;
+ ul = ll + 1;
+ ur = ul + offset;
+
+ indices[index++] = ul;
+ indices[index++] = ll;
+ indices[index++] = ur;
+ indices[index++] = ur;
+ indices[index++] = ll;
+ indices[index++] = lr;
+ }
+ ll = shapeLength * 2 - 2 + i * shapeLength * 2;
+ ul = ll + 1;
+ ur = ul + offset;
+ lr = ll + offset;
+
+ indices[index++] = ul;
+ indices[index++] = ll;
+ indices[index++] = ur;
+ indices[index++] = ur;
+ indices[index++] = ll;
+ indices[index++] = lr;
+ }
+
+ if (vertexFormat.st || vertexFormat.tangent || vertexFormat.bitangent) {
+ // st required for tangent/bitangent calculation
+ const st = new Float32Array(vertexCount * 2);
+ const lengthSt = 1 / (length - 1);
+ const heightSt = 1 / boundingRectangle.height;
+ const heightOffset = boundingRectangle.height / 2;
+ let s, t;
+ let stindex = 0;
+ for (i = 0; i < length; i++) {
+ s = i * lengthSt;
+ t = heightSt * (shape[0].y + heightOffset);
+ st[stindex++] = s;
+ st[stindex++] = t;
+ for (j = 1; j < shapeLength; j++) {
+ t = heightSt * (shape[j].y + heightOffset);
+ st[stindex++] = s;
+ st[stindex++] = t;
+ st[stindex++] = s;
+ st[stindex++] = t;
+ }
+ t = heightSt * (shape[0].y + heightOffset);
+ st[stindex++] = s;
+ st[stindex++] = t;
+ }
+ for (j = 0; j < shapeLength; j++) {
+ s = 0;
+ t = heightSt * (shape[j].y + heightOffset);
+ st[stindex++] = s;
+ st[stindex++] = t;
+ }
+ for (j = 0; j < shapeLength; j++) {
+ s = (length - 1) * lengthSt;
+ t = heightSt * (shape[j].y + heightOffset);
+ st[stindex++] = s;
+ st[stindex++] = t;
+ }
+
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: new Float32Array(st),
+ });
+ }
+
+ const endOffset = vertexCount - shapeLength * 2;
+ for (i = 0; i < firstEndIndices.length; i += 3) {
+ const v0 = firstEndIndices[i] + endOffset;
+ const v1 = firstEndIndices[i + 1] + endOffset;
+ const v2 = firstEndIndices[i + 2] + endOffset;
+
+ indices[index++] = v0;
+ indices[index++] = v1;
+ indices[index++] = v2;
+ indices[index++] = v2 + shapeLength;
+ indices[index++] = v1 + shapeLength;
+ indices[index++] = v0 + shapeLength;
+ }
+
+ let geometry = new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ boundingSphere: Transforms.BoundingSphere.fromVertices(combinedPositions),
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ });
+
+ if (vertexFormat.normal) {
+ geometry = GeometryPipeline.GeometryPipeline.computeNormal(geometry);
+ }
+
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ try {
+ geometry = GeometryPipeline.GeometryPipeline.computeTangentAndBitangent(geometry);
+ } catch (e) {
+ PolylineVolumeGeometryLibrary.oneTimeWarning(
+ "polyline-volume-tangent-bitangent",
+ "Unable to compute tangents and bitangents for polyline volume geometry"
+ );
+ //TODO https://github.com/CesiumGS/cesium/issues/3609
+ }
+
+ if (!vertexFormat.tangent) {
+ geometry.attributes.tangent = undefined;
+ }
+ if (!vertexFormat.bitangent) {
+ geometry.attributes.bitangent = undefined;
+ }
+ if (!vertexFormat.st) {
+ geometry.attributes.st = undefined;
+ }
+ }
+
+ return geometry;
+ }
+
+ /**
+ * A description of a polyline with a volume (a 2D shape extruded along a polyline).
+ *
+ * @alias PolylineVolumeGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.polylinePositions An array of {@link Cartesian3} positions that define the center of the polyline volume.
+ * @param {Cartesian2[]} options.shapePositions An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
+ *
+ * @see PolylineVolumeGeometry#createGeometry
+ *
+ * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline%20Volume.html|Cesium Sandcastle Polyline Volume Demo}
+ *
+ * @example
+ * function computeCircle(radius) {
+ * const positions = [];
+ * for (let i = 0; i < 360; i++) {
+ * const radians = Cesium.Math.toRadians(i);
+ * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
+ * }
+ * return positions;
+ * }
+ *
+ * const volume = new Cesium.PolylineVolumeGeometry({
+ * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,
+ * polylinePositions : Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0
+ * ]),
+ * shapePositions : computeCircle(100000.0)
+ * });
+ */
+ function PolylineVolumeGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const positions = options.polylinePositions;
+ const shape = options.shapePositions;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(positions)) {
+ throw new Check.DeveloperError("options.polylinePositions is required.");
+ }
+ if (!defaultValue.defined(shape)) {
+ throw new Check.DeveloperError("options.shapePositions is required.");
+ }
+ //>>includeEnd('debug');
+
+ this._positions = positions;
+ this._shape = shape;
+ this._ellipsoid = Matrix3.Ellipsoid.clone(
+ defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
+ );
+ this._cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
+ this._vertexFormat = VertexFormat.VertexFormat.clone(
+ defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT)
+ );
+ this._granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math.CesiumMath.RADIANS_PER_DEGREE
+ );
+ this._workerName = "createPolylineVolumeGeometry";
+
+ let numComponents = 1 + positions.length * Matrix3.Cartesian3.packedLength;
+ numComponents += 1 + shape.length * Matrix2.Cartesian2.packedLength;
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ numComponents + Matrix3.Ellipsoid.packedLength + VertexFormat.VertexFormat.packedLength + 2;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {PolylineVolumeGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ PolylineVolumeGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ const positions = value._positions;
+ let length = positions.length;
+ array[startingIndex++] = length;
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
+ }
+
+ const shape = value._shape;
+ length = shape.length;
+ array[startingIndex++] = length;
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix2.Cartesian2.packedLength) {
+ Matrix2.Cartesian2.pack(shape[i], array, startingIndex);
+ }
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ array[startingIndex++] = value._cornerType;
+ array[startingIndex] = value._granularity;
+
+ return array;
+ };
+
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+ const scratchOptions = {
+ polylinePositions: undefined,
+ shapePositions: undefined,
+ ellipsoid: scratchEllipsoid,
+ vertexFormat: scratchVertexFormat,
+ cornerType: undefined,
+ granularity: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {PolylineVolumeGeometry} [result] The object into which to store the result.
+ * @returns {PolylineVolumeGeometry} The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.
+ */
+ PolylineVolumeGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ let length = array[startingIndex++];
+ const positions = new Array(length);
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
+ }
+
+ length = array[startingIndex++];
+ const shape = new Array(length);
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix2.Cartesian2.packedLength) {
+ shape[i] = Matrix2.Cartesian2.unpack(array, startingIndex);
+ }
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ const cornerType = array[startingIndex++];
+ const granularity = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.polylinePositions = positions;
+ scratchOptions.shapePositions = shape;
+ scratchOptions.cornerType = cornerType;
+ scratchOptions.granularity = granularity;
+ return new PolylineVolumeGeometry(scratchOptions);
+ }
+
+ result._positions = positions;
+ result._shape = shape;
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._cornerType = cornerType;
+ result._granularity = granularity;
+
+ return result;
+ };
+
+ const brScratch = new BoundingRectangle.BoundingRectangle();
+
+ /**
+ * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {PolylineVolumeGeometry} polylineVolumeGeometry A description of the polyline volume.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ PolylineVolumeGeometry.createGeometry = function (polylineVolumeGeometry) {
+ const positions = polylineVolumeGeometry._positions;
+ const cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ positions,
+ Matrix3.Cartesian3.equalsEpsilon
+ );
+ let shape2D = polylineVolumeGeometry._shape;
+ shape2D = PolylineVolumeGeometryLibrary.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(shape2D);
+
+ if (cleanPositions.length < 2 || shape2D.length < 3) {
+ return undefined;
+ }
+
+ if (
+ PolygonPipeline.PolygonPipeline.computeWindingOrder2D(shape2D) === PolygonPipeline.WindingOrder.CLOCKWISE
+ ) {
+ shape2D.reverse();
+ }
+ const boundingRectangle = BoundingRectangle.BoundingRectangle.fromPoints(shape2D, brScratch);
+
+ const computedPositions = PolylineVolumeGeometryLibrary.PolylineVolumeGeometryLibrary.computePositions(
+ cleanPositions,
+ shape2D,
+ boundingRectangle,
+ polylineVolumeGeometry,
+ true
+ );
+ return computeAttributes(
+ computedPositions,
+ shape2D,
+ boundingRectangle,
+ polylineVolumeGeometry._vertexFormat
+ );
+ };
+
+ function createPolylineVolumeGeometry(polylineVolumeGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ polylineVolumeGeometry = PolylineVolumeGeometry.unpack(
+ polylineVolumeGeometry,
+ offset
+ );
+ }
+ polylineVolumeGeometry._ellipsoid = Matrix3.Ellipsoid.clone(
+ polylineVolumeGeometry._ellipsoid
+ );
+ return PolylineVolumeGeometry.createGeometry(polylineVolumeGeometry);
+ }
+
+ return createPolylineVolumeGeometry;
+
+}));
+//# sourceMappingURL=createPolylineVolumeGeometry.js.map
diff --git a/examples/cesium/Workers/createPolylineVolumeGeometry.js.map b/examples/cesium/Workers/createPolylineVolumeGeometry.js.map
new file mode 100644
index 0000000..4a975c9
--- /dev/null
+++ b/examples/cesium/Workers/createPolylineVolumeGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createPolylineVolumeGeometry.js","sources":["../../../Source/Core/PolylineVolumeGeometry.js","../../../Source/WorkersES6/createPolylineVolumeGeometry.js"],"sourcesContent":["import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\r\nimport BoundingRectangle from \"./BoundingRectangle.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport CornerType from \"./CornerType.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryPipeline from \"./GeometryPipeline.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport oneTimeWarning from \"./oneTimeWarning.js\";\r\nimport PolygonPipeline from \"./PolygonPipeline.js\";\r\nimport PolylineVolumeGeometryLibrary from \"./PolylineVolumeGeometryLibrary.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\nimport WindingOrder from \"./WindingOrder.js\";\r\n\r\nfunction computeAttributes(\r\n combinedPositions,\r\n shape,\r\n boundingRectangle,\r\n vertexFormat\r\n) {\r\n const attributes = new GeometryAttributes();\r\n if (vertexFormat.position) {\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: combinedPositions,\r\n });\r\n }\r\n const shapeLength = shape.length;\r\n const vertexCount = combinedPositions.length / 3;\r\n const length = (vertexCount - shapeLength * 2) / (shapeLength * 2);\r\n const firstEndIndices = PolygonPipeline.triangulate(shape);\r\n\r\n const indicesCount =\r\n (length - 1) * shapeLength * 6 + firstEndIndices.length * 2;\r\n const indices = IndexDatatype.createTypedArray(vertexCount, indicesCount);\r\n let i, j;\r\n let ll, ul, ur, lr;\r\n const offset = shapeLength * 2;\r\n let index = 0;\r\n for (i = 0; i < length - 1; i++) {\r\n for (j = 0; j < shapeLength - 1; j++) {\r\n ll = j * 2 + i * shapeLength * 2;\r\n lr = ll + offset;\r\n ul = ll + 1;\r\n ur = ul + offset;\r\n\r\n indices[index++] = ul;\r\n indices[index++] = ll;\r\n indices[index++] = ur;\r\n indices[index++] = ur;\r\n indices[index++] = ll;\r\n indices[index++] = lr;\r\n }\r\n ll = shapeLength * 2 - 2 + i * shapeLength * 2;\r\n ul = ll + 1;\r\n ur = ul + offset;\r\n lr = ll + offset;\r\n\r\n indices[index++] = ul;\r\n indices[index++] = ll;\r\n indices[index++] = ur;\r\n indices[index++] = ur;\r\n indices[index++] = ll;\r\n indices[index++] = lr;\r\n }\r\n\r\n if (vertexFormat.st || vertexFormat.tangent || vertexFormat.bitangent) {\r\n // st required for tangent/bitangent calculation\r\n const st = new Float32Array(vertexCount * 2);\r\n const lengthSt = 1 / (length - 1);\r\n const heightSt = 1 / boundingRectangle.height;\r\n const heightOffset = boundingRectangle.height / 2;\r\n let s, t;\r\n let stindex = 0;\r\n for (i = 0; i < length; i++) {\r\n s = i * lengthSt;\r\n t = heightSt * (shape[0].y + heightOffset);\r\n st[stindex++] = s;\r\n st[stindex++] = t;\r\n for (j = 1; j < shapeLength; j++) {\r\n t = heightSt * (shape[j].y + heightOffset);\r\n st[stindex++] = s;\r\n st[stindex++] = t;\r\n st[stindex++] = s;\r\n st[stindex++] = t;\r\n }\r\n t = heightSt * (shape[0].y + heightOffset);\r\n st[stindex++] = s;\r\n st[stindex++] = t;\r\n }\r\n for (j = 0; j < shapeLength; j++) {\r\n s = 0;\r\n t = heightSt * (shape[j].y + heightOffset);\r\n st[stindex++] = s;\r\n st[stindex++] = t;\r\n }\r\n for (j = 0; j < shapeLength; j++) {\r\n s = (length - 1) * lengthSt;\r\n t = heightSt * (shape[j].y + heightOffset);\r\n st[stindex++] = s;\r\n st[stindex++] = t;\r\n }\r\n\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: new Float32Array(st),\r\n });\r\n }\r\n\r\n const endOffset = vertexCount - shapeLength * 2;\r\n for (i = 0; i < firstEndIndices.length; i += 3) {\r\n const v0 = firstEndIndices[i] + endOffset;\r\n const v1 = firstEndIndices[i + 1] + endOffset;\r\n const v2 = firstEndIndices[i + 2] + endOffset;\r\n\r\n indices[index++] = v0;\r\n indices[index++] = v1;\r\n indices[index++] = v2;\r\n indices[index++] = v2 + shapeLength;\r\n indices[index++] = v1 + shapeLength;\r\n indices[index++] = v0 + shapeLength;\r\n }\r\n\r\n let geometry = new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n boundingSphere: BoundingSphere.fromVertices(combinedPositions),\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n });\r\n\r\n if (vertexFormat.normal) {\r\n geometry = GeometryPipeline.computeNormal(geometry);\r\n }\r\n\r\n if (vertexFormat.tangent || vertexFormat.bitangent) {\r\n try {\r\n geometry = GeometryPipeline.computeTangentAndBitangent(geometry);\r\n } catch (e) {\r\n oneTimeWarning(\r\n \"polyline-volume-tangent-bitangent\",\r\n \"Unable to compute tangents and bitangents for polyline volume geometry\"\r\n );\r\n //TODO https://github.com/CesiumGS/cesium/issues/3609\r\n }\r\n\r\n if (!vertexFormat.tangent) {\r\n geometry.attributes.tangent = undefined;\r\n }\r\n if (!vertexFormat.bitangent) {\r\n geometry.attributes.bitangent = undefined;\r\n }\r\n if (!vertexFormat.st) {\r\n geometry.attributes.st = undefined;\r\n }\r\n }\r\n\r\n return geometry;\r\n}\r\n\r\n/**\r\n * A description of a polyline with a volume (a 2D shape extruded along a polyline).\r\n *\r\n * @alias PolylineVolumeGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.polylinePositions An array of {@link Cartesian3} positions that define the center of the polyline volume.\r\n * @param {Cartesian2[]} options.shapePositions An array of {@link Cartesian2} positions that define the shape to be extruded along the polyline\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\r\n *\r\n * @see PolylineVolumeGeometry#createGeometry\r\n *\r\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Polyline%20Volume.html|Cesium Sandcastle Polyline Volume Demo}\r\n *\r\n * @example\r\n * function computeCircle(radius) {\r\n * const positions = [];\r\n * for (let i = 0; i < 360; i++) {\r\n * const radians = Cesium.Math.toRadians(i);\r\n * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));\r\n * }\r\n * return positions;\r\n * }\r\n *\r\n * const volume = new Cesium.PolylineVolumeGeometry({\r\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY,\r\n * polylinePositions : Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0\r\n * ]),\r\n * shapePositions : computeCircle(100000.0)\r\n * });\r\n */\r\nfunction PolylineVolumeGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const positions = options.polylinePositions;\r\n const shape = options.shapePositions;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(positions)) {\r\n throw new DeveloperError(\"options.polylinePositions is required.\");\r\n }\r\n if (!defined(shape)) {\r\n throw new DeveloperError(\"options.shapePositions is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n this._positions = positions;\r\n this._shape = shape;\r\n this._ellipsoid = Ellipsoid.clone(\r\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\r\n );\r\n this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\r\n this._vertexFormat = VertexFormat.clone(\r\n defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\r\n );\r\n this._granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n this._workerName = \"createPolylineVolumeGeometry\";\r\n\r\n let numComponents = 1 + positions.length * Cartesian3.packedLength;\r\n numComponents += 1 + shape.length * Cartesian2.packedLength;\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 2;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {PolylineVolumeGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nPolylineVolumeGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n const positions = value._positions;\r\n let length = positions.length;\r\n array[startingIndex++] = length;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n Cartesian3.pack(positions[i], array, startingIndex);\r\n }\r\n\r\n const shape = value._shape;\r\n length = shape.length;\r\n array[startingIndex++] = length;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\r\n Cartesian2.pack(shape[i], array, startingIndex);\r\n }\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n array[startingIndex++] = value._cornerType;\r\n array[startingIndex] = value._granularity;\r\n\r\n return array;\r\n};\r\n\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchVertexFormat = new VertexFormat();\r\nconst scratchOptions = {\r\n polylinePositions: undefined,\r\n shapePositions: undefined,\r\n ellipsoid: scratchEllipsoid,\r\n vertexFormat: scratchVertexFormat,\r\n cornerType: undefined,\r\n granularity: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {PolylineVolumeGeometry} [result] The object into which to store the result.\r\n * @returns {PolylineVolumeGeometry} The modified result parameter or a new PolylineVolumeGeometry instance if one was not provided.\r\n */\r\nPolylineVolumeGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n let length = array[startingIndex++];\r\n const positions = new Array(length);\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n positions[i] = Cartesian3.unpack(array, startingIndex);\r\n }\r\n\r\n length = array[startingIndex++];\r\n const shape = new Array(length);\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\r\n shape[i] = Cartesian2.unpack(array, startingIndex);\r\n }\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n const cornerType = array[startingIndex++];\r\n const granularity = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.polylinePositions = positions;\r\n scratchOptions.shapePositions = shape;\r\n scratchOptions.cornerType = cornerType;\r\n scratchOptions.granularity = granularity;\r\n return new PolylineVolumeGeometry(scratchOptions);\r\n }\r\n\r\n result._positions = positions;\r\n result._shape = shape;\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._cornerType = cornerType;\r\n result._granularity = granularity;\r\n\r\n return result;\r\n};\r\n\r\nconst brScratch = new BoundingRectangle();\r\n\r\n/**\r\n * Computes the geometric representation of a polyline with a volume, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {PolylineVolumeGeometry} polylineVolumeGeometry A description of the polyline volume.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nPolylineVolumeGeometry.createGeometry = function (polylineVolumeGeometry) {\r\n const positions = polylineVolumeGeometry._positions;\r\n const cleanPositions = arrayRemoveDuplicates(\r\n positions,\r\n Cartesian3.equalsEpsilon\r\n );\r\n let shape2D = polylineVolumeGeometry._shape;\r\n shape2D = PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(shape2D);\r\n\r\n if (cleanPositions.length < 2 || shape2D.length < 3) {\r\n return undefined;\r\n }\r\n\r\n if (\r\n PolygonPipeline.computeWindingOrder2D(shape2D) === WindingOrder.CLOCKWISE\r\n ) {\r\n shape2D.reverse();\r\n }\r\n const boundingRectangle = BoundingRectangle.fromPoints(shape2D, brScratch);\r\n\r\n const computedPositions = PolylineVolumeGeometryLibrary.computePositions(\r\n cleanPositions,\r\n shape2D,\r\n boundingRectangle,\r\n polylineVolumeGeometry,\r\n true\r\n );\r\n return computeAttributes(\r\n computedPositions,\r\n shape2D,\r\n boundingRectangle,\r\n polylineVolumeGeometry._vertexFormat\r\n );\r\n};\r\nexport default PolylineVolumeGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport PolylineVolumeGeometry from \"../Core/PolylineVolumeGeometry.js\";\r\n\r\nfunction createPolylineVolumeGeometry(polylineVolumeGeometry, offset) {\r\n if (defined(offset)) {\r\n polylineVolumeGeometry = PolylineVolumeGeometry.unpack(\r\n polylineVolumeGeometry,\r\n offset\r\n );\r\n }\r\n polylineVolumeGeometry._ellipsoid = Ellipsoid.clone(\r\n polylineVolumeGeometry._ellipsoid\r\n );\r\n return PolylineVolumeGeometry.createGeometry(polylineVolumeGeometry);\r\n}\r\nexport default createPolylineVolumeGeometry;\r\n"],"names":["GeometryAttributes","GeometryAttribute","ComponentDatatype","PolygonPipeline","IndexDatatype","Geometry","BoundingSphere","PrimitiveType","GeometryPipeline","oneTimeWarning","defaultValue","defined","DeveloperError","Ellipsoid","CornerType","VertexFormat","CesiumMath","Cartesian3","Cartesian2","BoundingRectangle","arrayRemoveDuplicates","PolylineVolumeGeometryLibrary","WindingOrder"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,SAAS,iBAAiB;EAC1B,EAAE,iBAAiB;EACnB,EAAE,KAAK;EACP,EAAE,iBAAiB;EACnB,EAAE,YAAY;EACd,EAAE;EACF,EAAE,MAAM,UAAU,GAAG,IAAIA,qCAAkB,EAAE,CAAC;EAC9C,EAAE,IAAI,YAAY,CAAC,QAAQ,EAAE;EAC7B,IAAI,UAAU,CAAC,QAAQ,GAAG,IAAIC,mCAAiB,CAAC;EAChD,MAAM,iBAAiB,EAAEC,mCAAiB,CAAC,MAAM;EACjD,MAAM,sBAAsB,EAAE,CAAC;EAC/B,MAAM,MAAM,EAAE,iBAAiB;EAC/B,KAAK,CAAC,CAAC;EACP,GAAG;EACH,EAAE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;EACnC,EAAE,MAAM,WAAW,GAAG,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC;EACnD,EAAE,MAAM,MAAM,GAAG,CAAC,WAAW,GAAG,WAAW,GAAG,CAAC,KAAK,WAAW,GAAG,CAAC,CAAC,CAAC;EACrE,EAAE,MAAM,eAAe,GAAGC,+BAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC7D;EACA,EAAE,MAAM,YAAY;EACpB,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,WAAW,GAAG,CAAC,GAAG,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;EAChE,EAAE,MAAM,OAAO,GAAGC,2BAAa,CAAC,gBAAgB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;EAC5E,EAAE,IAAI,CAAC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AG,sBAAsB,CAAC,MAAM;EAC1D,MAAM,sBAAsB;EAC5B,MAAM,MAAM;EACZ,KAAK,CAAC;EACN,GAAG;EACH,EAAE,sBAAsB,CAAC,UAAU,GAAGE,iBAAS,CAAC,KAAK;EACrD,IAAI,sBAAsB,CAAC,UAAU;EACrC,GAAG,CAAC;EACJ,EAAE,OAAO,sBAAsB,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;EACvE;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createPolylineVolumeOutlineGeometry.js b/examples/cesium/Workers/createPolylineVolumeOutlineGeometry.js
new file mode 100644
index 0000000..23bf419
--- /dev/null
+++ b/examples/cesium/Workers/createPolylineVolumeOutlineGeometry.js
@@ -0,0 +1,327 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './arrayRemoveDuplicates-c3526030', './BoundingRectangle-6617ed83', './Transforms-11fb6b0a', './Matrix2-036c77dd', './ComponentDatatype-13a5630b', './PolylineVolumeGeometryLibrary-eed2bdf7', './Check-d10e5f2e', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolygonPipeline-313487c3', './combine-4598d225', './RuntimeError-e5c6a8b9', './WebGLConstants-f27a5e29', './EllipsoidTangentPlane-c421b2cb', './AxisAlignedBoundingBox-50342d27', './IntersectionTests-2c7928de', './Plane-c9f1487d', './PolylinePipeline-3c021236', './EllipsoidGeodesic-38d0ed4a', './EllipsoidRhumbLine-48b4507b'], (function (defaultValue, Matrix3, arrayRemoveDuplicates, BoundingRectangle, Transforms, Matrix2, ComponentDatatype, PolylineVolumeGeometryLibrary, Check, GeometryAttribute, GeometryAttributes, IndexDatatype, Math, PolygonPipeline, combine, RuntimeError, WebGLConstants, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane, PolylinePipeline, EllipsoidGeodesic, EllipsoidRhumbLine) { 'use strict';
+
+ function computeAttributes(positions, shape) {
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+
+ const shapeLength = shape.length;
+ const vertexCount = attributes.position.values.length / 3;
+ const positionLength = positions.length / 3;
+ const shapeCount = positionLength / shapeLength;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ vertexCount,
+ 2 * shapeLength * (shapeCount + 1)
+ );
+ let i, j;
+ let index = 0;
+ i = 0;
+ let offset = i * shapeLength;
+ for (j = 0; j < shapeLength - 1; j++) {
+ indices[index++] = j + offset;
+ indices[index++] = j + offset + 1;
+ }
+ indices[index++] = shapeLength - 1 + offset;
+ indices[index++] = offset;
+
+ i = shapeCount - 1;
+ offset = i * shapeLength;
+ for (j = 0; j < shapeLength - 1; j++) {
+ indices[index++] = j + offset;
+ indices[index++] = j + offset + 1;
+ }
+ indices[index++] = shapeLength - 1 + offset;
+ indices[index++] = offset;
+
+ for (i = 0; i < shapeCount - 1; i++) {
+ const firstOffset = shapeLength * i;
+ const secondOffset = firstOffset + shapeLength;
+ for (j = 0; j < shapeLength; j++) {
+ indices[index++] = j + firstOffset;
+ indices[index++] = j + secondOffset;
+ }
+ }
+
+ const geometry = new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: IndexDatatype.IndexDatatype.createTypedArray(vertexCount, indices),
+ boundingSphere: Transforms.BoundingSphere.fromVertices(positions),
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ });
+
+ return geometry;
+ }
+
+ /**
+ * A description of a polyline with a volume (a 2D shape extruded along a polyline).
+ *
+ * @alias PolylineVolumeOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.polylinePositions An array of positions that define the center of the polyline volume.
+ * @param {Cartesian2[]} options.shapePositions An array of positions that define the shape to be extruded along the polyline
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.
+ *
+ * @see PolylineVolumeOutlineGeometry#createGeometry
+ *
+ * @example
+ * function computeCircle(radius) {
+ * const positions = [];
+ * for (let i = 0; i < 360; i++) {
+ * const radians = Cesium.Math.toRadians(i);
+ * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));
+ * }
+ * return positions;
+ * }
+ *
+ * const volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({
+ * polylinePositions : Cesium.Cartesian3.fromDegreesArray([
+ * -72.0, 40.0,
+ * -70.0, 35.0
+ * ]),
+ * shapePositions : computeCircle(100000.0)
+ * });
+ */
+ function PolylineVolumeOutlineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const positions = options.polylinePositions;
+ const shape = options.shapePositions;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(positions)) {
+ throw new Check.DeveloperError("options.polylinePositions is required.");
+ }
+ if (!defaultValue.defined(shape)) {
+ throw new Check.DeveloperError("options.shapePositions is required.");
+ }
+ //>>includeEnd('debug');
+
+ this._positions = positions;
+ this._shape = shape;
+ this._ellipsoid = Matrix3.Ellipsoid.clone(
+ defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
+ );
+ this._cornerType = defaultValue.defaultValue(options.cornerType, PolylineVolumeGeometryLibrary.CornerType.ROUNDED);
+ this._granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math.CesiumMath.RADIANS_PER_DEGREE
+ );
+ this._workerName = "createPolylineVolumeOutlineGeometry";
+
+ let numComponents = 1 + positions.length * Matrix3.Cartesian3.packedLength;
+ numComponents += 1 + shape.length * Matrix2.Cartesian2.packedLength;
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength = numComponents + Matrix3.Ellipsoid.packedLength + 2;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {PolylineVolumeOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ PolylineVolumeOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ const positions = value._positions;
+ let length = positions.length;
+ array[startingIndex++] = length;
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
+ }
+
+ const shape = value._shape;
+ length = shape.length;
+ array[startingIndex++] = length;
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix2.Cartesian2.packedLength) {
+ Matrix2.Cartesian2.pack(shape[i], array, startingIndex);
+ }
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ array[startingIndex++] = value._cornerType;
+ array[startingIndex] = value._granularity;
+
+ return array;
+ };
+
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchOptions = {
+ polylinePositions: undefined,
+ shapePositions: undefined,
+ ellipsoid: scratchEllipsoid,
+ height: undefined,
+ cornerType: undefined,
+ granularity: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {PolylineVolumeOutlineGeometry} [result] The object into which to store the result.
+ * @returns {PolylineVolumeOutlineGeometry} The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided.
+ */
+ PolylineVolumeOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ let length = array[startingIndex++];
+ const positions = new Array(length);
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
+ }
+
+ length = array[startingIndex++];
+ const shape = new Array(length);
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix2.Cartesian2.packedLength) {
+ shape[i] = Matrix2.Cartesian2.unpack(array, startingIndex);
+ }
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const cornerType = array[startingIndex++];
+ const granularity = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.polylinePositions = positions;
+ scratchOptions.shapePositions = shape;
+ scratchOptions.cornerType = cornerType;
+ scratchOptions.granularity = granularity;
+ return new PolylineVolumeOutlineGeometry(scratchOptions);
+ }
+
+ result._positions = positions;
+ result._shape = shape;
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._cornerType = cornerType;
+ result._granularity = granularity;
+
+ return result;
+ };
+
+ const brScratch = new BoundingRectangle.BoundingRectangle();
+
+ /**
+ * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {PolylineVolumeOutlineGeometry} polylineVolumeOutlineGeometry A description of the polyline volume outline.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ PolylineVolumeOutlineGeometry.createGeometry = function (
+ polylineVolumeOutlineGeometry
+ ) {
+ const positions = polylineVolumeOutlineGeometry._positions;
+ const cleanPositions = arrayRemoveDuplicates.arrayRemoveDuplicates(
+ positions,
+ Matrix3.Cartesian3.equalsEpsilon
+ );
+ let shape2D = polylineVolumeOutlineGeometry._shape;
+ shape2D = PolylineVolumeGeometryLibrary.PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(shape2D);
+
+ if (cleanPositions.length < 2 || shape2D.length < 3) {
+ return undefined;
+ }
+
+ if (
+ PolygonPipeline.PolygonPipeline.computeWindingOrder2D(shape2D) === PolygonPipeline.WindingOrder.CLOCKWISE
+ ) {
+ shape2D.reverse();
+ }
+ const boundingRectangle = BoundingRectangle.BoundingRectangle.fromPoints(shape2D, brScratch);
+
+ const computedPositions = PolylineVolumeGeometryLibrary.PolylineVolumeGeometryLibrary.computePositions(
+ cleanPositions,
+ shape2D,
+ boundingRectangle,
+ polylineVolumeOutlineGeometry,
+ false
+ );
+ return computeAttributes(computedPositions, shape2D);
+ };
+
+ function createPolylineVolumeOutlineGeometry(
+ polylineVolumeOutlineGeometry,
+ offset
+ ) {
+ if (defaultValue.defined(offset)) {
+ polylineVolumeOutlineGeometry = PolylineVolumeOutlineGeometry.unpack(
+ polylineVolumeOutlineGeometry,
+ offset
+ );
+ }
+ polylineVolumeOutlineGeometry._ellipsoid = Matrix3.Ellipsoid.clone(
+ polylineVolumeOutlineGeometry._ellipsoid
+ );
+ return PolylineVolumeOutlineGeometry.createGeometry(
+ polylineVolumeOutlineGeometry
+ );
+ }
+
+ return createPolylineVolumeOutlineGeometry;
+
+}));
+//# sourceMappingURL=createPolylineVolumeOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createPolylineVolumeOutlineGeometry.js.map b/examples/cesium/Workers/createPolylineVolumeOutlineGeometry.js.map
new file mode 100644
index 0000000..219bd0f
--- /dev/null
+++ b/examples/cesium/Workers/createPolylineVolumeOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createPolylineVolumeOutlineGeometry.js","sources":["../../../Source/Core/PolylineVolumeOutlineGeometry.js","../../../Source/WorkersES6/createPolylineVolumeOutlineGeometry.js"],"sourcesContent":["import arrayRemoveDuplicates from \"./arrayRemoveDuplicates.js\";\r\nimport BoundingRectangle from \"./BoundingRectangle.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport CornerType from \"./CornerType.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PolygonPipeline from \"./PolygonPipeline.js\";\r\nimport PolylineVolumeGeometryLibrary from \"./PolylineVolumeGeometryLibrary.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport WindingOrder from \"./WindingOrder.js\";\r\n\r\nfunction computeAttributes(positions, shape) {\r\n const attributes = new GeometryAttributes();\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n\r\n const shapeLength = shape.length;\r\n const vertexCount = attributes.position.values.length / 3;\r\n const positionLength = positions.length / 3;\r\n const shapeCount = positionLength / shapeLength;\r\n const indices = IndexDatatype.createTypedArray(\r\n vertexCount,\r\n 2 * shapeLength * (shapeCount + 1)\r\n );\r\n let i, j;\r\n let index = 0;\r\n i = 0;\r\n let offset = i * shapeLength;\r\n for (j = 0; j < shapeLength - 1; j++) {\r\n indices[index++] = j + offset;\r\n indices[index++] = j + offset + 1;\r\n }\r\n indices[index++] = shapeLength - 1 + offset;\r\n indices[index++] = offset;\r\n\r\n i = shapeCount - 1;\r\n offset = i * shapeLength;\r\n for (j = 0; j < shapeLength - 1; j++) {\r\n indices[index++] = j + offset;\r\n indices[index++] = j + offset + 1;\r\n }\r\n indices[index++] = shapeLength - 1 + offset;\r\n indices[index++] = offset;\r\n\r\n for (i = 0; i < shapeCount - 1; i++) {\r\n const firstOffset = shapeLength * i;\r\n const secondOffset = firstOffset + shapeLength;\r\n for (j = 0; j < shapeLength; j++) {\r\n indices[index++] = j + firstOffset;\r\n indices[index++] = j + secondOffset;\r\n }\r\n }\r\n\r\n const geometry = new Geometry({\r\n attributes: attributes,\r\n indices: IndexDatatype.createTypedArray(vertexCount, indices),\r\n boundingSphere: BoundingSphere.fromVertices(positions),\r\n primitiveType: PrimitiveType.LINES,\r\n });\r\n\r\n return geometry;\r\n}\r\n\r\n/**\r\n * A description of a polyline with a volume (a 2D shape extruded along a polyline).\r\n *\r\n * @alias PolylineVolumeOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.polylinePositions An array of positions that define the center of the polyline volume.\r\n * @param {Cartesian2[]} options.shapePositions An array of positions that define the shape to be extruded along the polyline\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {CornerType} [options.cornerType=CornerType.ROUNDED] Determines the style of the corners.\r\n *\r\n * @see PolylineVolumeOutlineGeometry#createGeometry\r\n *\r\n * @example\r\n * function computeCircle(radius) {\r\n * const positions = [];\r\n * for (let i = 0; i < 360; i++) {\r\n * const radians = Cesium.Math.toRadians(i);\r\n * positions.push(new Cesium.Cartesian2(radius * Math.cos(radians), radius * Math.sin(radians)));\r\n * }\r\n * return positions;\r\n * }\r\n *\r\n * const volumeOutline = new Cesium.PolylineVolumeOutlineGeometry({\r\n * polylinePositions : Cesium.Cartesian3.fromDegreesArray([\r\n * -72.0, 40.0,\r\n * -70.0, 35.0\r\n * ]),\r\n * shapePositions : computeCircle(100000.0)\r\n * });\r\n */\r\nfunction PolylineVolumeOutlineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const positions = options.polylinePositions;\r\n const shape = options.shapePositions;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(positions)) {\r\n throw new DeveloperError(\"options.polylinePositions is required.\");\r\n }\r\n if (!defined(shape)) {\r\n throw new DeveloperError(\"options.shapePositions is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n this._positions = positions;\r\n this._shape = shape;\r\n this._ellipsoid = Ellipsoid.clone(\r\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\r\n );\r\n this._cornerType = defaultValue(options.cornerType, CornerType.ROUNDED);\r\n this._granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n this._workerName = \"createPolylineVolumeOutlineGeometry\";\r\n\r\n let numComponents = 1 + positions.length * Cartesian3.packedLength;\r\n numComponents += 1 + shape.length * Cartesian2.packedLength;\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength = numComponents + Ellipsoid.packedLength + 2;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {PolylineVolumeOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nPolylineVolumeOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n const positions = value._positions;\r\n let length = positions.length;\r\n array[startingIndex++] = length;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n Cartesian3.pack(positions[i], array, startingIndex);\r\n }\r\n\r\n const shape = value._shape;\r\n length = shape.length;\r\n array[startingIndex++] = length;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\r\n Cartesian2.pack(shape[i], array, startingIndex);\r\n }\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n array[startingIndex++] = value._cornerType;\r\n array[startingIndex] = value._granularity;\r\n\r\n return array;\r\n};\r\n\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchOptions = {\r\n polylinePositions: undefined,\r\n shapePositions: undefined,\r\n ellipsoid: scratchEllipsoid,\r\n height: undefined,\r\n cornerType: undefined,\r\n granularity: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {PolylineVolumeOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {PolylineVolumeOutlineGeometry} The modified result parameter or a new PolylineVolumeOutlineGeometry instance if one was not provided.\r\n */\r\nPolylineVolumeOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n let length = array[startingIndex++];\r\n const positions = new Array(length);\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n positions[i] = Cartesian3.unpack(array, startingIndex);\r\n }\r\n\r\n length = array[startingIndex++];\r\n const shape = new Array(length);\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian2.packedLength) {\r\n shape[i] = Cartesian2.unpack(array, startingIndex);\r\n }\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const cornerType = array[startingIndex++];\r\n const granularity = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.polylinePositions = positions;\r\n scratchOptions.shapePositions = shape;\r\n scratchOptions.cornerType = cornerType;\r\n scratchOptions.granularity = granularity;\r\n return new PolylineVolumeOutlineGeometry(scratchOptions);\r\n }\r\n\r\n result._positions = positions;\r\n result._shape = shape;\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._cornerType = cornerType;\r\n result._granularity = granularity;\r\n\r\n return result;\r\n};\r\n\r\nconst brScratch = new BoundingRectangle();\r\n\r\n/**\r\n * Computes the geometric representation of the outline of a polyline with a volume, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {PolylineVolumeOutlineGeometry} polylineVolumeOutlineGeometry A description of the polyline volume outline.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nPolylineVolumeOutlineGeometry.createGeometry = function (\r\n polylineVolumeOutlineGeometry\r\n) {\r\n const positions = polylineVolumeOutlineGeometry._positions;\r\n const cleanPositions = arrayRemoveDuplicates(\r\n positions,\r\n Cartesian3.equalsEpsilon\r\n );\r\n let shape2D = polylineVolumeOutlineGeometry._shape;\r\n shape2D = PolylineVolumeGeometryLibrary.removeDuplicatesFromShape(shape2D);\r\n\r\n if (cleanPositions.length < 2 || shape2D.length < 3) {\r\n return undefined;\r\n }\r\n\r\n if (\r\n PolygonPipeline.computeWindingOrder2D(shape2D) === WindingOrder.CLOCKWISE\r\n ) {\r\n shape2D.reverse();\r\n }\r\n const boundingRectangle = BoundingRectangle.fromPoints(shape2D, brScratch);\r\n\r\n const computedPositions = PolylineVolumeGeometryLibrary.computePositions(\r\n cleanPositions,\r\n shape2D,\r\n boundingRectangle,\r\n polylineVolumeOutlineGeometry,\r\n false\r\n );\r\n return computeAttributes(computedPositions, shape2D);\r\n};\r\nexport default PolylineVolumeOutlineGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport PolylineVolumeOutlineGeometry from \"../Core/PolylineVolumeOutlineGeometry.js\";\r\n\r\nfunction createPolylineVolumeOutlineGeometry(\r\n polylineVolumeOutlineGeometry,\r\n offset\r\n) {\r\n if (defined(offset)) {\r\n polylineVolumeOutlineGeometry = PolylineVolumeOutlineGeometry.unpack(\r\n polylineVolumeOutlineGeometry,\r\n offset\r\n );\r\n }\r\n polylineVolumeOutlineGeometry._ellipsoid = Ellipsoid.clone(\r\n polylineVolumeOutlineGeometry._ellipsoid\r\n );\r\n return PolylineVolumeOutlineGeometry.createGeometry(\r\n polylineVolumeOutlineGeometry\r\n );\r\n}\r\nexport default createPolylineVolumeOutlineGeometry;\r\n"],"names":["GeometryAttributes","GeometryAttribute","ComponentDatatype","IndexDatatype","Geometry","BoundingSphere","PrimitiveType","defaultValue","defined","DeveloperError","Ellipsoid","CornerType","CesiumMath","Cartesian3","Cartesian2","BoundingRectangle","arrayRemoveDuplicates","Polyline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ples/cesium/Workers/createRectangleGeometry.js
new file mode 100644
index 0000000..c8d3af4
--- /dev/null
+++ b/examples/cesium/Workers/createRectangleGeometry.js
@@ -0,0 +1,1502 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './Matrix2-036c77dd', './Transforms-11fb6b0a', './Check-d10e5f2e', './ComponentDatatype-13a5630b', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryInstance-b2be3e5a', './GeometryOffsetAttribute-cc320d7d', './GeometryPipeline-f28890f4', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolygonPipeline-313487c3', './RectangleGeometryLibrary-94f83a5a', './VertexFormat-f2d74c96', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29', './AttributeCompression-e9888cb8', './EncodedCartesian3-38e2691f', './IntersectionTests-2c7928de', './Plane-c9f1487d', './EllipsoidRhumbLine-48b4507b'], (function (defaultValue, Matrix3, Matrix2, Transforms, Check, ComponentDatatype, GeometryAttribute, GeometryAttributes, GeometryInstance, GeometryOffsetAttribute, GeometryPipeline, IndexDatatype, Math$1, PolygonPipeline, RectangleGeometryLibrary, VertexFormat, RuntimeError, combine, WebGLConstants, AttributeCompression, EncodedCartesian3, IntersectionTests, Plane, EllipsoidRhumbLine) { 'use strict';
+
+ const positionScratch = new Matrix3.Cartesian3();
+ const normalScratch = new Matrix3.Cartesian3();
+ const tangentScratch = new Matrix3.Cartesian3();
+ const bitangentScratch = new Matrix3.Cartesian3();
+ const rectangleScratch = new Matrix2.Rectangle();
+ const stScratch = new Matrix2.Cartesian2();
+ const bottomBoundingSphere = new Transforms.BoundingSphere();
+ const topBoundingSphere = new Transforms.BoundingSphere();
+
+ function createAttributes(vertexFormat, attributes) {
+ const geo = new GeometryAttribute.Geometry({
+ attributes: new GeometryAttributes.GeometryAttributes(),
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ });
+
+ geo.attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: attributes.positions,
+ });
+ if (vertexFormat.normal) {
+ geo.attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: attributes.normals,
+ });
+ }
+ if (vertexFormat.tangent) {
+ geo.attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: attributes.tangents,
+ });
+ }
+ if (vertexFormat.bitangent) {
+ geo.attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: attributes.bitangents,
+ });
+ }
+ return geo;
+ }
+
+ function calculateAttributes(
+ positions,
+ vertexFormat,
+ ellipsoid,
+ tangentRotationMatrix
+ ) {
+ const length = positions.length;
+
+ const normals = vertexFormat.normal ? new Float32Array(length) : undefined;
+ const tangents = vertexFormat.tangent ? new Float32Array(length) : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(length)
+ : undefined;
+
+ let attrIndex = 0;
+ const bitangent = bitangentScratch;
+ const tangent = tangentScratch;
+ let normal = normalScratch;
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
+ for (let i = 0; i < length; i += 3) {
+ const p = Matrix3.Cartesian3.fromArray(positions, i, positionScratch);
+ const attrIndex1 = attrIndex + 1;
+ const attrIndex2 = attrIndex + 2;
+
+ normal = ellipsoid.geodeticSurfaceNormal(p, normal);
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ Matrix3.Cartesian3.cross(Matrix3.Cartesian3.UNIT_Z, normal, tangent);
+ Matrix3.Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent);
+ Matrix3.Cartesian3.normalize(tangent, tangent);
+
+ if (vertexFormat.bitangent) {
+ Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(normal, tangent, bitangent),
+ bitangent
+ );
+ }
+ }
+
+ if (vertexFormat.normal) {
+ normals[attrIndex] = normal.x;
+ normals[attrIndex1] = normal.y;
+ normals[attrIndex2] = normal.z;
+ }
+ if (vertexFormat.tangent) {
+ tangents[attrIndex] = tangent.x;
+ tangents[attrIndex1] = tangent.y;
+ tangents[attrIndex2] = tangent.z;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents[attrIndex] = bitangent.x;
+ bitangents[attrIndex1] = bitangent.y;
+ bitangents[attrIndex2] = bitangent.z;
+ }
+ attrIndex += 3;
+ }
+ }
+ return createAttributes(vertexFormat, {
+ positions: positions,
+ normals: normals,
+ tangents: tangents,
+ bitangents: bitangents,
+ });
+ }
+
+ const v1Scratch = new Matrix3.Cartesian3();
+ const v2Scratch = new Matrix3.Cartesian3();
+
+ function calculateAttributesWall(positions, vertexFormat, ellipsoid) {
+ const length = positions.length;
+
+ const normals = vertexFormat.normal ? new Float32Array(length) : undefined;
+ const tangents = vertexFormat.tangent ? new Float32Array(length) : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(length)
+ : undefined;
+
+ let normalIndex = 0;
+ let tangentIndex = 0;
+ let bitangentIndex = 0;
+ let recomputeNormal = true;
+
+ let bitangent = bitangentScratch;
+ let tangent = tangentScratch;
+ let normal = normalScratch;
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
+ for (let i = 0; i < length; i += 6) {
+ const p = Matrix3.Cartesian3.fromArray(positions, i, positionScratch);
+ const p1 = Matrix3.Cartesian3.fromArray(positions, (i + 6) % length, v1Scratch);
+ if (recomputeNormal) {
+ const p2 = Matrix3.Cartesian3.fromArray(positions, (i + 3) % length, v2Scratch);
+ Matrix3.Cartesian3.subtract(p1, p, p1);
+ Matrix3.Cartesian3.subtract(p2, p, p2);
+ normal = Matrix3.Cartesian3.normalize(Matrix3.Cartesian3.cross(p2, p1, normal), normal);
+ recomputeNormal = false;
+ }
+
+ if (Matrix3.Cartesian3.equalsEpsilon(p1, p, Math$1.CesiumMath.EPSILON10)) {
+ // if we've reached a corner
+ recomputeNormal = true;
+ }
+
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ bitangent = ellipsoid.geodeticSurfaceNormal(p, bitangent);
+ if (vertexFormat.tangent) {
+ tangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(bitangent, normal, tangent),
+ tangent
+ );
+ }
+ }
+
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = normal.x;
+ normals[normalIndex++] = normal.y;
+ normals[normalIndex++] = normal.z;
+ normals[normalIndex++] = normal.x;
+ normals[normalIndex++] = normal.y;
+ normals[normalIndex++] = normal.z;
+ }
+
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ }
+
+ if (vertexFormat.bitangent) {
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ }
+ }
+ }
+
+ return createAttributes(vertexFormat, {
+ positions: positions,
+ normals: normals,
+ tangents: tangents,
+ bitangents: bitangents,
+ });
+ }
+
+ function constructRectangle(rectangleGeometry, computedOptions) {
+ const vertexFormat = rectangleGeometry._vertexFormat;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const height = computedOptions.height;
+ const width = computedOptions.width;
+ const northCap = computedOptions.northCap;
+ const southCap = computedOptions.southCap;
+
+ let rowStart = 0;
+ let rowEnd = height;
+ let rowHeight = height;
+ let size = 0;
+ if (northCap) {
+ rowStart = 1;
+ rowHeight -= 1;
+ size += 1;
+ }
+ if (southCap) {
+ rowEnd -= 1;
+ rowHeight -= 1;
+ size += 1;
+ }
+ size += width * rowHeight;
+
+ const positions = vertexFormat.position
+ ? new Float64Array(size * 3)
+ : undefined;
+ const textureCoordinates = vertexFormat.st
+ ? new Float32Array(size * 2)
+ : undefined;
+
+ let posIndex = 0;
+ let stIndex = 0;
+
+ const position = positionScratch;
+ const st = stScratch;
+
+ let minX = Number.MAX_VALUE;
+ let minY = Number.MAX_VALUE;
+ let maxX = -Number.MAX_VALUE;
+ let maxY = -Number.MAX_VALUE;
+
+ for (let row = rowStart; row < rowEnd; ++row) {
+ for (let col = 0; col < width; ++col) {
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ vertexFormat.st,
+ row,
+ col,
+ position,
+ st
+ );
+
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+
+ if (vertexFormat.st) {
+ textureCoordinates[stIndex++] = st.x;
+ textureCoordinates[stIndex++] = st.y;
+
+ minX = Math.min(minX, st.x);
+ minY = Math.min(minY, st.y);
+ maxX = Math.max(maxX, st.x);
+ maxY = Math.max(maxY, st.y);
+ }
+ }
+ }
+ if (northCap) {
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ vertexFormat.st,
+ 0,
+ 0,
+ position,
+ st
+ );
+
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+
+ if (vertexFormat.st) {
+ textureCoordinates[stIndex++] = st.x;
+ textureCoordinates[stIndex++] = st.y;
+
+ minX = st.x;
+ minY = st.y;
+ maxX = st.x;
+ maxY = st.y;
+ }
+ }
+ if (southCap) {
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ vertexFormat.st,
+ height - 1,
+ 0,
+ position,
+ st
+ );
+
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex] = position.z;
+
+ if (vertexFormat.st) {
+ textureCoordinates[stIndex++] = st.x;
+ textureCoordinates[stIndex] = st.y;
+
+ minX = Math.min(minX, st.x);
+ minY = Math.min(minY, st.y);
+ maxX = Math.max(maxX, st.x);
+ maxY = Math.max(maxY, st.y);
+ }
+ }
+
+ if (
+ vertexFormat.st &&
+ (minX < 0.0 || minY < 0.0 || maxX > 1.0 || maxY > 1.0)
+ ) {
+ for (let k = 0; k < textureCoordinates.length; k += 2) {
+ textureCoordinates[k] = (textureCoordinates[k] - minX) / (maxX - minX);
+ textureCoordinates[k + 1] =
+ (textureCoordinates[k + 1] - minY) / (maxY - minY);
+ }
+ }
+
+ const geo = calculateAttributes(
+ positions,
+ vertexFormat,
+ ellipsoid,
+ computedOptions.tangentRotationMatrix
+ );
+
+ let indicesSize = 6 * (width - 1) * (rowHeight - 1);
+ if (northCap) {
+ indicesSize += 3 * (width - 1);
+ }
+ if (southCap) {
+ indicesSize += 3 * (width - 1);
+ }
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(size, indicesSize);
+ let index = 0;
+ let indicesIndex = 0;
+ let i;
+ for (i = 0; i < rowHeight - 1; ++i) {
+ for (let j = 0; j < width - 1; ++j) {
+ const upperLeft = index;
+ const lowerLeft = upperLeft + width;
+ const lowerRight = lowerLeft + 1;
+ const upperRight = upperLeft + 1;
+ indices[indicesIndex++] = upperLeft;
+ indices[indicesIndex++] = lowerLeft;
+ indices[indicesIndex++] = upperRight;
+ indices[indicesIndex++] = upperRight;
+ indices[indicesIndex++] = lowerLeft;
+ indices[indicesIndex++] = lowerRight;
+ ++index;
+ }
+ ++index;
+ }
+ if (northCap || southCap) {
+ let northIndex = size - 1;
+ const southIndex = size - 1;
+ if (northCap && southCap) {
+ northIndex = size - 2;
+ }
+
+ let p1;
+ let p2;
+ index = 0;
+
+ if (northCap) {
+ for (i = 0; i < width - 1; i++) {
+ p1 = index;
+ p2 = p1 + 1;
+ indices[indicesIndex++] = northIndex;
+ indices[indicesIndex++] = p1;
+ indices[indicesIndex++] = p2;
+ ++index;
+ }
+ }
+ if (southCap) {
+ index = (rowHeight - 1) * width;
+ for (i = 0; i < width - 1; i++) {
+ p1 = index;
+ p2 = p1 + 1;
+ indices[indicesIndex++] = p1;
+ indices[indicesIndex++] = southIndex;
+ indices[indicesIndex++] = p2;
+ ++index;
+ }
+ }
+ }
+
+ geo.indices = indices;
+ if (vertexFormat.st) {
+ geo.attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates,
+ });
+ }
+
+ return geo;
+ }
+
+ function addWallPositions(
+ wallPositions,
+ posIndex,
+ i,
+ topPositions,
+ bottomPositions
+ ) {
+ wallPositions[posIndex++] = topPositions[i];
+ wallPositions[posIndex++] = topPositions[i + 1];
+ wallPositions[posIndex++] = topPositions[i + 2];
+ wallPositions[posIndex++] = bottomPositions[i];
+ wallPositions[posIndex++] = bottomPositions[i + 1];
+ wallPositions[posIndex] = bottomPositions[i + 2];
+ return wallPositions;
+ }
+
+ function addWallTextureCoordinates(wallTextures, stIndex, i, st) {
+ wallTextures[stIndex++] = st[i];
+ wallTextures[stIndex++] = st[i + 1];
+ wallTextures[stIndex++] = st[i];
+ wallTextures[stIndex] = st[i + 1];
+ return wallTextures;
+ }
+
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+
+ function constructExtrudedRectangle(rectangleGeometry, computedOptions) {
+ const shadowVolume = rectangleGeometry._shadowVolume;
+ const offsetAttributeValue = rectangleGeometry._offsetAttribute;
+ const vertexFormat = rectangleGeometry._vertexFormat;
+ const minHeight = rectangleGeometry._extrudedHeight;
+ const maxHeight = rectangleGeometry._surfaceHeight;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+
+ const height = computedOptions.height;
+ const width = computedOptions.width;
+
+ let i;
+
+ if (shadowVolume) {
+ const newVertexFormat = VertexFormat.VertexFormat.clone(
+ vertexFormat,
+ scratchVertexFormat
+ );
+ newVertexFormat.normal = true;
+ rectangleGeometry._vertexFormat = newVertexFormat;
+ }
+
+ const topBottomGeo = constructRectangle(rectangleGeometry, computedOptions);
+
+ if (shadowVolume) {
+ rectangleGeometry._vertexFormat = vertexFormat;
+ }
+
+ let topPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ topBottomGeo.attributes.position.values,
+ maxHeight,
+ ellipsoid,
+ false
+ );
+ topPositions = new Float64Array(topPositions);
+ let length = topPositions.length;
+ const newLength = length * 2;
+ const positions = new Float64Array(newLength);
+ positions.set(topPositions);
+ const bottomPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ topBottomGeo.attributes.position.values,
+ minHeight,
+ ellipsoid
+ );
+ positions.set(bottomPositions, length);
+ topBottomGeo.attributes.position.values = positions;
+
+ const normals = vertexFormat.normal ? new Float32Array(newLength) : undefined;
+ const tangents = vertexFormat.tangent
+ ? new Float32Array(newLength)
+ : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(newLength)
+ : undefined;
+ const textures = vertexFormat.st
+ ? new Float32Array((newLength / 3) * 2)
+ : undefined;
+ let topSt;
+ let topNormals;
+ if (vertexFormat.normal) {
+ topNormals = topBottomGeo.attributes.normal.values;
+ normals.set(topNormals);
+ for (i = 0; i < length; i++) {
+ topNormals[i] = -topNormals[i];
+ }
+ normals.set(topNormals, length);
+ topBottomGeo.attributes.normal.values = normals;
+ }
+ if (shadowVolume) {
+ topNormals = topBottomGeo.attributes.normal.values;
+ if (!vertexFormat.normal) {
+ topBottomGeo.attributes.normal = undefined;
+ }
+ const extrudeNormals = new Float32Array(newLength);
+ for (i = 0; i < length; i++) {
+ topNormals[i] = -topNormals[i];
+ }
+ extrudeNormals.set(topNormals, length); //only get normals for bottom layer that's going to be pushed down
+ topBottomGeo.attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: extrudeNormals,
+ });
+ }
+
+ let offsetValue;
+ const hasOffsets = defaultValue.defined(offsetAttributeValue);
+ if (hasOffsets) {
+ const size = (length / 3) * 2;
+ let offsetAttribute = new Uint8Array(size);
+ if (offsetAttributeValue === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else {
+ offsetValue =
+ offsetAttributeValue === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE ? 0 : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+
+ topBottomGeo.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ const topTangents = topBottomGeo.attributes.tangent.values;
+ tangents.set(topTangents);
+ for (i = 0; i < length; i++) {
+ topTangents[i] = -topTangents[i];
+ }
+ tangents.set(topTangents, length);
+ topBottomGeo.attributes.tangent.values = tangents;
+ }
+ if (vertexFormat.bitangent) {
+ const topBitangents = topBottomGeo.attributes.bitangent.values;
+ bitangents.set(topBitangents);
+ bitangents.set(topBitangents, length);
+ topBottomGeo.attributes.bitangent.values = bitangents;
+ }
+ if (vertexFormat.st) {
+ topSt = topBottomGeo.attributes.st.values;
+ textures.set(topSt);
+ textures.set(topSt, (length / 3) * 2);
+ topBottomGeo.attributes.st.values = textures;
+ }
+
+ const indices = topBottomGeo.indices;
+ const indicesLength = indices.length;
+ const posLength = length / 3;
+ const newIndices = IndexDatatype.IndexDatatype.createTypedArray(
+ newLength / 3,
+ indicesLength * 2
+ );
+ newIndices.set(indices);
+ for (i = 0; i < indicesLength; i += 3) {
+ newIndices[i + indicesLength] = indices[i + 2] + posLength;
+ newIndices[i + 1 + indicesLength] = indices[i + 1] + posLength;
+ newIndices[i + 2 + indicesLength] = indices[i] + posLength;
+ }
+ topBottomGeo.indices = newIndices;
+
+ const northCap = computedOptions.northCap;
+ const southCap = computedOptions.southCap;
+
+ let rowHeight = height;
+ let widthMultiplier = 2;
+ let perimeterPositions = 0;
+ let corners = 4;
+ let dupliateCorners = 4;
+ if (northCap) {
+ widthMultiplier -= 1;
+ rowHeight -= 1;
+ perimeterPositions += 1;
+ corners -= 2;
+ dupliateCorners -= 1;
+ }
+ if (southCap) {
+ widthMultiplier -= 1;
+ rowHeight -= 1;
+ perimeterPositions += 1;
+ corners -= 2;
+ dupliateCorners -= 1;
+ }
+ perimeterPositions += widthMultiplier * width + 2 * rowHeight - corners;
+
+ const wallCount = (perimeterPositions + dupliateCorners) * 2;
+
+ let wallPositions = new Float64Array(wallCount * 3);
+ const wallExtrudeNormals = shadowVolume
+ ? new Float32Array(wallCount * 3)
+ : undefined;
+ let wallOffsetAttribute = hasOffsets ? new Uint8Array(wallCount) : undefined;
+ let wallTextures = vertexFormat.st
+ ? new Float32Array(wallCount * 2)
+ : undefined;
+
+ const computeTopOffsets =
+ offsetAttributeValue === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP;
+ if (hasOffsets && !computeTopOffsets) {
+ offsetValue = offsetAttributeValue === GeometryOffsetAttribute.GeometryOffsetAttribute.ALL ? 1 : 0;
+ wallOffsetAttribute = wallOffsetAttribute.fill(offsetValue);
+ }
+
+ let posIndex = 0;
+ let stIndex = 0;
+ let extrudeNormalIndex = 0;
+ let wallOffsetIndex = 0;
+ const area = width * rowHeight;
+ let threeI;
+ for (i = 0; i < area; i += width) {
+ threeI = i * 3;
+ wallPositions = addWallPositions(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ i * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+
+ if (!southCap) {
+ for (i = area - width; i < area; i++) {
+ threeI = i * 3;
+ wallPositions = addWallPositions(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ i * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+ } else {
+ const southIndex = northCap ? area + 1 : area;
+ threeI = southIndex * 3;
+
+ for (i = 0; i < 2; i++) {
+ // duplicate corner points
+ wallPositions = addWallPositions(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ southIndex * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+ }
+
+ for (i = area - 1; i > 0; i -= width) {
+ threeI = i * 3;
+ wallPositions = addWallPositions(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ i * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+
+ if (!northCap) {
+ for (i = width - 1; i >= 0; i--) {
+ threeI = i * 3;
+ wallPositions = addWallPositions(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ i * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+ } else {
+ const northIndex = area;
+ threeI = northIndex * 3;
+
+ for (i = 0; i < 2; i++) {
+ // duplicate corner points
+ wallPositions = addWallPositions(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ northIndex * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+ }
+
+ let geo = calculateAttributesWall(wallPositions, vertexFormat, ellipsoid);
+
+ if (vertexFormat.st) {
+ geo.attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: wallTextures,
+ });
+ }
+ if (shadowVolume) {
+ geo.attributes.extrudeDirection = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: wallExtrudeNormals,
+ });
+ }
+ if (hasOffsets) {
+ geo.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: wallOffsetAttribute,
+ });
+ }
+
+ const wallIndices = IndexDatatype.IndexDatatype.createTypedArray(
+ wallCount,
+ perimeterPositions * 6
+ );
+
+ let upperLeft;
+ let lowerLeft;
+ let lowerRight;
+ let upperRight;
+ length = wallPositions.length / 3;
+ let index = 0;
+ for (i = 0; i < length - 1; i += 2) {
+ upperLeft = i;
+ upperRight = (upperLeft + 2) % length;
+ const p1 = Matrix3.Cartesian3.fromArray(wallPositions, upperLeft * 3, v1Scratch);
+ const p2 = Matrix3.Cartesian3.fromArray(wallPositions, upperRight * 3, v2Scratch);
+ if (Matrix3.Cartesian3.equalsEpsilon(p1, p2, Math$1.CesiumMath.EPSILON10)) {
+ continue;
+ }
+ lowerLeft = (upperLeft + 1) % length;
+ lowerRight = (lowerLeft + 2) % length;
+ wallIndices[index++] = upperLeft;
+ wallIndices[index++] = lowerLeft;
+ wallIndices[index++] = upperRight;
+ wallIndices[index++] = upperRight;
+ wallIndices[index++] = lowerLeft;
+ wallIndices[index++] = lowerRight;
+ }
+
+ geo.indices = wallIndices;
+
+ geo = GeometryPipeline.GeometryPipeline.combineInstances([
+ new GeometryInstance.GeometryInstance({
+ geometry: topBottomGeo,
+ }),
+ new GeometryInstance.GeometryInstance({
+ geometry: geo,
+ }),
+ ]);
+
+ return geo[0];
+ }
+
+ const scratchRectanglePoints = [
+ new Matrix3.Cartesian3(),
+ new Matrix3.Cartesian3(),
+ new Matrix3.Cartesian3(),
+ new Matrix3.Cartesian3(),
+ ];
+ const nwScratch = new Matrix3.Cartographic();
+ const stNwScratch = new Matrix3.Cartographic();
+ function computeRectangle(rectangle, granularity, rotation, ellipsoid, result) {
+ if (rotation === 0.0) {
+ return Matrix2.Rectangle.clone(rectangle, result);
+ }
+
+ const computedOptions = RectangleGeometryLibrary.RectangleGeometryLibrary.computeOptions(
+ rectangle,
+ granularity,
+ rotation,
+ 0,
+ rectangleScratch,
+ nwScratch
+ );
+
+ const height = computedOptions.height;
+ const width = computedOptions.width;
+
+ const positions = scratchRectanglePoints;
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ 0,
+ 0,
+ positions[0]
+ );
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ 0,
+ width - 1,
+ positions[1]
+ );
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ height - 1,
+ 0,
+ positions[2]
+ );
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ height - 1,
+ width - 1,
+ positions[3]
+ );
+
+ return Matrix2.Rectangle.fromCartesianArray(positions, ellipsoid, result);
+ }
+
+ /**
+ * A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.
+ *
+ * @alias RectangleGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface.
+ * @param {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
+ * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
+ * @param {Number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.
+ *
+ * @exception {DeveloperError} options.rectangle.north
must be in the interval [-Pi/2
, Pi/2
].
+ * @exception {DeveloperError} options.rectangle.south
must be in the interval [-Pi/2
, Pi/2
].
+ * @exception {DeveloperError} options.rectangle.east
must be in the interval [-Pi
, Pi
].
+ * @exception {DeveloperError} options.rectangle.west
must be in the interval [-Pi
, Pi
].
+ * @exception {DeveloperError} options.rectangle.north
must be greater than options.rectangle.south
.
+ *
+ * @see RectangleGeometry#createGeometry
+ *
+ * @demo {@link https://sandcastle.cesium.com/index.html?src=Rectangle.html|Cesium Sandcastle Rectangle Demo}
+ *
+ * @example
+ * // 1. create a rectangle
+ * const rectangle = new Cesium.RectangleGeometry({
+ * ellipsoid : Cesium.Ellipsoid.WGS84,
+ * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
+ * height : 10000.0
+ * });
+ * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
+ *
+ * // 2. create an extruded rectangle without a top
+ * const rectangle = new Cesium.RectangleGeometry({
+ * ellipsoid : Cesium.Ellipsoid.WGS84,
+ * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
+ * height : 10000.0,
+ * extrudedHeight: 300000
+ * });
+ * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);
+ */
+ function RectangleGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const rectangle = options.rectangle;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ Matrix2.Rectangle.validate(rectangle);
+ if (rectangle.north < rectangle.south) {
+ throw new Check.DeveloperError(
+ "options.rectangle.north must be greater than or equal to options.rectangle.south"
+ );
+ }
+ //>>includeEnd('debug');
+
+ const height = defaultValue.defaultValue(options.height, 0.0);
+ const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
+
+ this._rectangle = Matrix2.Rectangle.clone(rectangle);
+ this._granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ this._ellipsoid = Matrix3.Ellipsoid.clone(
+ defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84)
+ );
+ this._surfaceHeight = Math.max(height, extrudedHeight);
+ this._rotation = defaultValue.defaultValue(options.rotation, 0.0);
+ this._stRotation = defaultValue.defaultValue(options.stRotation, 0.0);
+ this._vertexFormat = VertexFormat.VertexFormat.clone(
+ defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT)
+ );
+ this._extrudedHeight = Math.min(height, extrudedHeight);
+ this._shadowVolume = defaultValue.defaultValue(options.shadowVolume, false);
+ this._workerName = "createRectangleGeometry";
+ this._offsetAttribute = options.offsetAttribute;
+ this._rotatedRectangle = undefined;
+
+ this._textureCoordinateRotationPoints = undefined;
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ RectangleGeometry.packedLength =
+ Matrix2.Rectangle.packedLength +
+ Matrix3.Ellipsoid.packedLength +
+ VertexFormat.VertexFormat.packedLength +
+ 7;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {RectangleGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ RectangleGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ Matrix2.Rectangle.pack(value._rectangle, array, startingIndex);
+ startingIndex += Matrix2.Rectangle.packedLength;
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._surfaceHeight;
+ array[startingIndex++] = value._rotation;
+ array[startingIndex++] = value._stRotation;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;
+ array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchRectangle = new Matrix2.Rectangle();
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchOptions = {
+ rectangle: scratchRectangle,
+ ellipsoid: scratchEllipsoid,
+ vertexFormat: scratchVertexFormat,
+ granularity: undefined,
+ height: undefined,
+ rotation: undefined,
+ stRotation: undefined,
+ extrudedHeight: undefined,
+ shadowVolume: undefined,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {RectangleGeometry} [result] The object into which to store the result.
+ * @returns {RectangleGeometry} The modified result parameter or a new RectangleGeometry instance if one was not provided.
+ */
+ RectangleGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.defined("array", array);
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const rectangle = Matrix2.Rectangle.unpack(array, startingIndex, scratchRectangle);
+ startingIndex += Matrix2.Rectangle.packedLength;
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ const granularity = array[startingIndex++];
+ const surfaceHeight = array[startingIndex++];
+ const rotation = array[startingIndex++];
+ const stRotation = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const shadowVolume = array[startingIndex++] === 1.0;
+ const offsetAttribute = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.granularity = granularity;
+ scratchOptions.height = surfaceHeight;
+ scratchOptions.rotation = rotation;
+ scratchOptions.stRotation = stRotation;
+ scratchOptions.extrudedHeight = extrudedHeight;
+ scratchOptions.shadowVolume = shadowVolume;
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return new RectangleGeometry(scratchOptions);
+ }
+
+ result._rectangle = Matrix2.Rectangle.clone(rectangle, result._rectangle);
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._granularity = granularity;
+ result._surfaceHeight = surfaceHeight;
+ result._rotation = rotation;
+ result._stRotation = stRotation;
+ result._extrudedHeight = extrudedHeight;
+ result._shadowVolume = shadowVolume;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ /**
+ * Computes the bounding rectangle based on the provided options
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
+ * @param {Rectangle} [result] An object in which to store the result.
+ *
+ * @returns {Rectangle} The result rectangle
+ */
+ RectangleGeometry.computeRectangle = function (options, result) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const rectangle = options.rectangle;
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("rectangle", rectangle);
+ Matrix2.Rectangle.validate(rectangle);
+ if (rectangle.north < rectangle.south) {
+ throw new Check.DeveloperError(
+ "options.rectangle.north must be greater than or equal to options.rectangle.south"
+ );
+ }
+ //>>includeEnd('debug');
+
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ const rotation = defaultValue.defaultValue(options.rotation, 0.0);
+
+ return computeRectangle(rectangle, granularity, rotation, ellipsoid, result);
+ };
+
+ const tangentRotationMatrixScratch = new Matrix3.Matrix3();
+ const quaternionScratch = new Transforms.Quaternion();
+ const centerScratch = new Matrix3.Cartographic();
+ /**
+ * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {RectangleGeometry} rectangleGeometry A description of the rectangle.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ *
+ * @exception {DeveloperError} Rotated rectangle is invalid.
+ */
+ RectangleGeometry.createGeometry = function (rectangleGeometry) {
+ if (
+ Math$1.CesiumMath.equalsEpsilon(
+ rectangleGeometry._rectangle.north,
+ rectangleGeometry._rectangle.south,
+ Math$1.CesiumMath.EPSILON10
+ ) ||
+ Math$1.CesiumMath.equalsEpsilon(
+ rectangleGeometry._rectangle.east,
+ rectangleGeometry._rectangle.west,
+ Math$1.CesiumMath.EPSILON10
+ )
+ ) {
+ return undefined;
+ }
+
+ let rectangle = rectangleGeometry._rectangle;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const rotation = rectangleGeometry._rotation;
+ const stRotation = rectangleGeometry._stRotation;
+ const vertexFormat = rectangleGeometry._vertexFormat;
+
+ const computedOptions = RectangleGeometryLibrary.RectangleGeometryLibrary.computeOptions(
+ rectangle,
+ rectangleGeometry._granularity,
+ rotation,
+ stRotation,
+ rectangleScratch,
+ nwScratch,
+ stNwScratch
+ );
+
+ const tangentRotationMatrix = tangentRotationMatrixScratch;
+ if (stRotation !== 0 || rotation !== 0) {
+ const center = Matrix2.Rectangle.center(rectangle, centerScratch);
+ const axis = ellipsoid.geodeticSurfaceNormalCartographic(center, v1Scratch);
+ Transforms.Quaternion.fromAxisAngle(axis, -stRotation, quaternionScratch);
+ Matrix3.Matrix3.fromQuaternion(quaternionScratch, tangentRotationMatrix);
+ } else {
+ Matrix3.Matrix3.clone(Matrix3.Matrix3.IDENTITY, tangentRotationMatrix);
+ }
+
+ const surfaceHeight = rectangleGeometry._surfaceHeight;
+ const extrudedHeight = rectangleGeometry._extrudedHeight;
+ const extrude = !Math$1.CesiumMath.equalsEpsilon(
+ surfaceHeight,
+ extrudedHeight,
+ 0,
+ Math$1.CesiumMath.EPSILON2
+ );
+
+ computedOptions.lonScalar = 1.0 / rectangleGeometry._rectangle.width;
+ computedOptions.latScalar = 1.0 / rectangleGeometry._rectangle.height;
+ computedOptions.tangentRotationMatrix = tangentRotationMatrix;
+
+ let geometry;
+ let boundingSphere;
+ rectangle = rectangleGeometry._rectangle;
+ if (extrude) {
+ geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);
+ const topBS = Transforms.BoundingSphere.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ surfaceHeight,
+ topBoundingSphere
+ );
+ const bottomBS = Transforms.BoundingSphere.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ extrudedHeight,
+ bottomBoundingSphere
+ );
+ boundingSphere = Transforms.BoundingSphere.union(topBS, bottomBS);
+ } else {
+ geometry = constructRectangle(rectangleGeometry, computedOptions);
+ geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ geometry.attributes.position.values,
+ surfaceHeight,
+ ellipsoid,
+ false
+ );
+
+ if (defaultValue.defined(rectangleGeometry._offsetAttribute)) {
+ const length = geometry.attributes.position.values.length;
+ const offsetValue =
+ rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ boundingSphere = Transforms.BoundingSphere.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ surfaceHeight
+ );
+ }
+
+ if (!vertexFormat.position) {
+ delete geometry.attributes.position;
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere: boundingSphere,
+ offsetAttribute: rectangleGeometry._offsetAttribute,
+ });
+ };
+
+ /**
+ * @private
+ */
+ RectangleGeometry.createShadowVolume = function (
+ rectangleGeometry,
+ minHeightFunc,
+ maxHeightFunc
+ ) {
+ const granularity = rectangleGeometry._granularity;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+
+ const minHeight = minHeightFunc(granularity, ellipsoid);
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
+
+ return new RectangleGeometry({
+ rectangle: rectangleGeometry._rectangle,
+ rotation: rectangleGeometry._rotation,
+ ellipsoid: ellipsoid,
+ stRotation: rectangleGeometry._stRotation,
+ granularity: granularity,
+ extrudedHeight: maxHeight,
+ height: minHeight,
+ vertexFormat: VertexFormat.VertexFormat.POSITION_ONLY,
+ shadowVolume: true,
+ });
+ };
+
+ const unrotatedTextureRectangleScratch = new Matrix2.Rectangle();
+ const points2DScratch = [new Matrix2.Cartesian2(), new Matrix2.Cartesian2(), new Matrix2.Cartesian2()];
+ const rotation2DScratch = new Matrix2.Matrix2();
+ const rectangleCenterScratch = new Matrix3.Cartographic();
+
+ function textureCoordinateRotationPoints(rectangleGeometry) {
+ if (rectangleGeometry._stRotation === 0.0) {
+ return [0, 0, 0, 1, 1, 0];
+ }
+
+ const rectangle = Matrix2.Rectangle.clone(
+ rectangleGeometry._rectangle,
+ unrotatedTextureRectangleScratch
+ );
+ const granularity = rectangleGeometry._granularity;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+
+ // Rotate to align the texture coordinates with ENU
+ const rotation = rectangleGeometry._rotation - rectangleGeometry._stRotation;
+
+ const unrotatedTextureRectangle = computeRectangle(
+ rectangle,
+ granularity,
+ rotation,
+ ellipsoid,
+ unrotatedTextureRectangleScratch
+ );
+
+ // Assume a computed "east-north" texture coordinate system based on spherical or planar tricks, bounded by `boundingRectangle`.
+ // The "desired" texture coordinate system forms an oriented rectangle (un-oriented computed) around the geometry that completely and tightly bounds it.
+ // We want to map from the "east-north" texture coordinate system into the "desired" system using a pair of lines (analagous planes in 2D)
+ // Compute 3 corners of the "desired" texture coordinate system in "east-north" texture space by the following in cartographic space:
+ // - rotate 3 of the corners in unrotatedTextureRectangle by stRotation around the center of the bounding rectangle
+ // - apply the "east-north" system's normalization formula to the rotated cartographics, even though this is likely to produce values outside [0-1].
+ // This gives us a set of points in the "east-north" texture coordinate system that can be used to map "east-north" texture coordinates to "desired."
+
+ const points2D = points2DScratch;
+ points2D[0].x = unrotatedTextureRectangle.west;
+ points2D[0].y = unrotatedTextureRectangle.south;
+
+ points2D[1].x = unrotatedTextureRectangle.west;
+ points2D[1].y = unrotatedTextureRectangle.north;
+
+ points2D[2].x = unrotatedTextureRectangle.east;
+ points2D[2].y = unrotatedTextureRectangle.south;
+
+ const boundingRectangle = rectangleGeometry.rectangle;
+ const toDesiredInComputed = Matrix2.Matrix2.fromRotation(
+ rectangleGeometry._stRotation,
+ rotation2DScratch
+ );
+ const boundingRectangleCenter = Matrix2.Rectangle.center(
+ boundingRectangle,
+ rectangleCenterScratch
+ );
+
+ for (let i = 0; i < 3; ++i) {
+ const point2D = points2D[i];
+ point2D.x -= boundingRectangleCenter.longitude;
+ point2D.y -= boundingRectangleCenter.latitude;
+ Matrix2.Matrix2.multiplyByVector(toDesiredInComputed, point2D, point2D);
+ point2D.x += boundingRectangleCenter.longitude;
+ point2D.y += boundingRectangleCenter.latitude;
+
+ // Convert point into east-north texture coordinate space
+ point2D.x = (point2D.x - boundingRectangle.west) / boundingRectangle.width;
+ point2D.y =
+ (point2D.y - boundingRectangle.south) / boundingRectangle.height;
+ }
+
+ const minXYCorner = points2D[0];
+ const maxYCorner = points2D[1];
+ const maxXCorner = points2D[2];
+ const result = new Array(6);
+ Matrix2.Cartesian2.pack(minXYCorner, result);
+ Matrix2.Cartesian2.pack(maxYCorner, result, 2);
+ Matrix2.Cartesian2.pack(maxXCorner, result, 4);
+ return result;
+ }
+
+ Object.defineProperties(RectangleGeometry.prototype, {
+ /**
+ * @private
+ */
+ rectangle: {
+ get: function () {
+ if (!defaultValue.defined(this._rotatedRectangle)) {
+ this._rotatedRectangle = computeRectangle(
+ this._rectangle,
+ this._granularity,
+ this._rotation,
+ this._ellipsoid
+ );
+ }
+ return this._rotatedRectangle;
+ },
+ },
+ /**
+ * For remapping texture coordinates when rendering RectangleGeometries as GroundPrimitives.
+ * This version permits skew in textures by computing offsets directly in cartographic space and
+ * more accurately approximates rendering RectangleGeometries with height as standard Primitives.
+ * @see Geometry#_textureCoordinateRotationPoints
+ * @private
+ */
+ textureCoordinateRotationPoints: {
+ get: function () {
+ if (!defaultValue.defined(this._textureCoordinateRotationPoints)) {
+ this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(
+ this
+ );
+ }
+ return this._textureCoordinateRotationPoints;
+ },
+ },
+ });
+
+ function createRectangleGeometry(rectangleGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ rectangleGeometry = RectangleGeometry.unpack(rectangleGeometry, offset);
+ }
+ rectangleGeometry._ellipsoid = Matrix3.Ellipsoid.clone(rectangleGeometry._ellipsoid);
+ rectangleGeometry._rectangle = Matrix2.Rectangle.clone(rectangleGeometry._rectangle);
+ return RectangleGeometry.createGeometry(rectangleGeometry);
+ }
+
+ return createRectangleGeometry;
+
+}));
+//# sourceMappingURL=createRectangleGeometry.js.map
diff --git a/examples/cesium/Workers/createRectangleGeometry.js.map b/examples/cesium/Workers/createRectangleGeometry.js.map
new file mode 100644
index 0000000..0d6b7c4
--- /dev/null
+++ b/examples/cesium/Workers/createRectangleGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createRectangleGeometry.js","sources":["../../../Source/Core/RectangleGeometry.js","../../../Source/WorkersES6/createRectangleGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport Check from \"./Check.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryInstance from \"./GeometryInstance.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport GeometryPipeline from \"./GeometryPipeline.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix2 from \"./Matrix2.js\";\r\nimport Matrix3 from \"./Matrix3.js\";\r\nimport PolygonPipeline from \"./PolygonPipeline.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport Quaternion from \"./Quaternion.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\nimport RectangleGeometryLibrary from \"./RectangleGeometryLibrary.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\nconst positionScratch = new Cartesian3();\r\nconst normalScratch = new Cartesian3();\r\nconst tangentScratch = new Cartesian3();\r\nconst bitangentScratch = new Cartesian3();\r\nconst rectangleScratch = new Rectangle();\r\nconst stScratch = new Cartesian2();\r\nconst bottomBoundingSphere = new BoundingSphere();\r\nconst topBoundingSphere = new BoundingSphere();\r\n\r\nfunction createAttributes(vertexFormat, attributes) {\r\n const geo = new Geometry({\r\n attributes: new GeometryAttributes(),\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n });\r\n\r\n geo.attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: attributes.positions,\r\n });\r\n if (vertexFormat.normal) {\r\n geo.attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: attributes.normals,\r\n });\r\n }\r\n if (vertexFormat.tangent) {\r\n geo.attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: attributes.tangents,\r\n });\r\n }\r\n if (vertexFormat.bitangent) {\r\n geo.attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: attributes.bitangents,\r\n });\r\n }\r\n return geo;\r\n}\r\n\r\nfunction calculateAttributes(\r\n positions,\r\n vertexFormat,\r\n ellipsoid,\r\n tangentRotationMatrix\r\n) {\r\n const length = positions.length;\r\n\r\n const normals = vertexFormat.normal ? new Float32Array(length) : undefined;\r\n const tangents = vertexFormat.tangent ? new Float32Array(length) : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(length)\r\n : undefined;\r\n\r\n let attrIndex = 0;\r\n const bitangent = bitangentScratch;\r\n const tangent = tangentScratch;\r\n let normal = normalScratch;\r\n if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\r\n for (let i = 0; i < length; i += 3) {\r\n const p = Cartesian3.fromArray(positions, i, positionScratch);\r\n const attrIndex1 = attrIndex + 1;\r\n const attrIndex2 = attrIndex + 2;\r\n\r\n normal = ellipsoid.geodeticSurfaceNormal(p, normal);\r\n if (vertexFormat.tangent || vertexFormat.bitangent) {\r\n Cartesian3.cross(Cartesian3.UNIT_Z, normal, tangent);\r\n Matrix3.multiplyByVector(tangentRotationMatrix, tangent, tangent);\r\n Cartesian3.normalize(tangent, tangent);\r\n\r\n if (vertexFormat.bitangent) {\r\n Cartesian3.normalize(\r\n Cartesian3.cross(normal, tangent, bitangent),\r\n bitangent\r\n );\r\n }\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n normals[attrIndex] = normal.x;\r\n normals[attrIndex1] = normal.y;\r\n normals[attrIndex2] = normal.z;\r\n }\r\n if (vertexFormat.tangent) {\r\n tangents[attrIndex] = tangent.x;\r\n tangents[attrIndex1] = tangent.y;\r\n tangents[attrIndex2] = tangent.z;\r\n }\r\n if (vertexFormat.bitangent) {\r\n bitangents[attrIndex] = bitangent.x;\r\n bitangents[attrIndex1] = bitangent.y;\r\n bitangents[attrIndex2] = bitangent.z;\r\n }\r\n attrIndex += 3;\r\n }\r\n }\r\n return createAttributes(vertexFormat, {\r\n positions: positions,\r\n normals: normals,\r\n tangents: tangents,\r\n bitangents: bitangents,\r\n });\r\n}\r\n\r\nconst v1Scratch = new Cartesian3();\r\nconst v2Scratch = new Cartesian3();\r\n\r\nfunction calculateAttributesWall(positions, vertexFormat, ellipsoid) {\r\n const length = positions.length;\r\n\r\n const normals = vertexFormat.normal ? new Float32Array(length) : undefined;\r\n const tangents = vertexFormat.tangent ? new Float32Array(length) : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(length)\r\n : undefined;\r\n\r\n let normalIndex = 0;\r\n let tangentIndex = 0;\r\n let bitangentIndex = 0;\r\n let recomputeNormal = true;\r\n\r\n let bitangent = bitangentScratch;\r\n let tangent = tangentScratch;\r\n let normal = normalScratch;\r\n if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\r\n for (let i = 0; i < length; i += 6) {\r\n const p = Cartesian3.fromArray(positions, i, positionScratch);\r\n const p1 = Cartesian3.fromArray(positions, (i + 6) % length, v1Scratch);\r\n if (recomputeNormal) {\r\n const p2 = Cartesian3.fromArray(positions, (i + 3) % length, v2Scratch);\r\n Cartesian3.subtract(p1, p, p1);\r\n Cartesian3.subtract(p2, p, p2);\r\n normal = Cartesian3.normalize(Cartesian3.cross(p2, p1, normal), normal);\r\n recomputeNormal = false;\r\n }\r\n\r\n if (Cartesian3.equalsEpsilon(p1, p, CesiumMath.EPSILON10)) {\r\n // if we've reached a corner\r\n recomputeNormal = true;\r\n }\r\n\r\n if (vertexFormat.tangent || vertexFormat.bitangent) {\r\n bitangent = ellipsoid.geodeticSurfaceNormal(p, bitangent);\r\n if (vertexFormat.tangent) {\r\n tangent = Cartesian3.normalize(\r\n Cartesian3.cross(bitangent, normal, tangent),\r\n tangent\r\n );\r\n }\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n normals[normalIndex++] = normal.x;\r\n normals[normalIndex++] = normal.y;\r\n normals[normalIndex++] = normal.z;\r\n normals[normalIndex++] = normal.x;\r\n normals[normalIndex++] = normal.y;\r\n normals[normalIndex++] = normal.z;\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n tangents[tangentIndex++] = tangent.x;\r\n tangents[tangentIndex++] = tangent.y;\r\n tangents[tangentIndex++] = tangent.z;\r\n tangents[tangentIndex++] = tangent.x;\r\n tangents[tangentIndex++] = tangent.y;\r\n tangents[tangentIndex++] = tangent.z;\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n bitangents[bitangentIndex++] = bitangent.x;\r\n bitangents[bitangentIndex++] = bitangent.y;\r\n bitangents[bitangentIndex++] = bitangent.z;\r\n bitangents[bitangentIndex++] = bitangent.x;\r\n bitangents[bitangentIndex++] = bitangent.y;\r\n bitangents[bitangentIndex++] = bitangent.z;\r\n }\r\n }\r\n }\r\n\r\n return createAttributes(vertexFormat, {\r\n positions: positions,\r\n normals: normals,\r\n tangents: tangents,\r\n bitangents: bitangents,\r\n });\r\n}\r\n\r\nfunction constructRectangle(rectangleGeometry, computedOptions) {\r\n const vertexFormat = rectangleGeometry._vertexFormat;\r\n const ellipsoid = rectangleGeometry._ellipsoid;\r\n const height = computedOptions.height;\r\n const width = computedOptions.width;\r\n const northCap = computedOptions.northCap;\r\n const southCap = computedOptions.southCap;\r\n\r\n let rowStart = 0;\r\n let rowEnd = height;\r\n let rowHeight = height;\r\n let size = 0;\r\n if (northCap) {\r\n rowStart = 1;\r\n rowHeight -= 1;\r\n size += 1;\r\n }\r\n if (southCap) {\r\n rowEnd -= 1;\r\n rowHeight -= 1;\r\n size += 1;\r\n }\r\n size += width * rowHeight;\r\n\r\n const positions = vertexFormat.position\r\n ? new Float64Array(size * 3)\r\n : undefined;\r\n const textureCoordinates = vertexFormat.st\r\n ? new Float32Array(size * 2)\r\n : undefined;\r\n\r\n let posIndex = 0;\r\n let stIndex = 0;\r\n\r\n const position = positionScratch;\r\n const st = stScratch;\r\n\r\n let minX = Number.MAX_VALUE;\r\n let minY = Number.MAX_VALUE;\r\n let maxX = -Number.MAX_VALUE;\r\n let maxY = -Number.MAX_VALUE;\r\n\r\n for (let row = rowStart; row < rowEnd; ++row) {\r\n for (let col = 0; col < width; ++col) {\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n vertexFormat.st,\r\n row,\r\n col,\r\n position,\r\n st\r\n );\r\n\r\n positions[posIndex++] = position.x;\r\n positions[posIndex++] = position.y;\r\n positions[posIndex++] = position.z;\r\n\r\n if (vertexFormat.st) {\r\n textureCoordinates[stIndex++] = st.x;\r\n textureCoordinates[stIndex++] = st.y;\r\n\r\n minX = Math.min(minX, st.x);\r\n minY = Math.min(minY, st.y);\r\n maxX = Math.max(maxX, st.x);\r\n maxY = Math.max(maxY, st.y);\r\n }\r\n }\r\n }\r\n if (northCap) {\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n vertexFormat.st,\r\n 0,\r\n 0,\r\n position,\r\n st\r\n );\r\n\r\n positions[posIndex++] = position.x;\r\n positions[posIndex++] = position.y;\r\n positions[posIndex++] = position.z;\r\n\r\n if (vertexFormat.st) {\r\n textureCoordinates[stIndex++] = st.x;\r\n textureCoordinates[stIndex++] = st.y;\r\n\r\n minX = st.x;\r\n minY = st.y;\r\n maxX = st.x;\r\n maxY = st.y;\r\n }\r\n }\r\n if (southCap) {\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n vertexFormat.st,\r\n height - 1,\r\n 0,\r\n position,\r\n st\r\n );\r\n\r\n positions[posIndex++] = position.x;\r\n positions[posIndex++] = position.y;\r\n positions[posIndex] = position.z;\r\n\r\n if (vertexFormat.st) {\r\n textureCoordinates[stIndex++] = st.x;\r\n textureCoordinates[stIndex] = st.y;\r\n\r\n minX = Math.min(minX, st.x);\r\n minY = Math.min(minY, st.y);\r\n maxX = Math.max(maxX, st.x);\r\n maxY = Math.max(maxY, st.y);\r\n }\r\n }\r\n\r\n if (\r\n vertexFormat.st &&\r\n (minX < 0.0 || minY < 0.0 || maxX > 1.0 || maxY > 1.0)\r\n ) {\r\n for (let k = 0; k < textureCoordinates.length; k += 2) {\r\n textureCoordinates[k] = (textureCoordinates[k] - minX) / (maxX - minX);\r\n textureCoordinates[k + 1] =\r\n (textureCoordinates[k + 1] - minY) / (maxY - minY);\r\n }\r\n }\r\n\r\n const geo = calculateAttributes(\r\n positions,\r\n vertexFormat,\r\n ellipsoid,\r\n computedOptions.tangentRotationMatrix\r\n );\r\n\r\n let indicesSize = 6 * (width - 1) * (rowHeight - 1);\r\n if (northCap) {\r\n indicesSize += 3 * (width - 1);\r\n }\r\n if (southCap) {\r\n indicesSize += 3 * (width - 1);\r\n }\r\n const indices = IndexDatatype.createTypedArray(size, indicesSize);\r\n let index = 0;\r\n let indicesIndex = 0;\r\n let i;\r\n for (i = 0; i < rowHeight - 1; ++i) {\r\n for (let j = 0; j < width - 1; ++j) {\r\n const upperLeft = index;\r\n const lowerLeft = upperLeft + width;\r\n const lowerRight = lowerLeft + 1;\r\n const upperRight = upperLeft + 1;\r\n indices[indicesIndex++] = upperLeft;\r\n indices[indicesIndex++] = lowerLeft;\r\n indices[indicesIndex++] = upperRight;\r\n indices[indicesIndex++] = upperRight;\r\n indices[indicesIndex++] = lowerLeft;\r\n indices[indicesIndex++] = lowerRight;\r\n ++index;\r\n }\r\n ++index;\r\n }\r\n if (northCap || southCap) {\r\n let northIndex = size - 1;\r\n const southIndex = size - 1;\r\n if (northCap && southCap) {\r\n northIndex = size - 2;\r\n }\r\n\r\n let p1;\r\n let p2;\r\n index = 0;\r\n\r\n if (northCap) {\r\n for (i = 0; i < width - 1; i++) {\r\n p1 = index;\r\n p2 = p1 + 1;\r\n indices[indicesIndex++] = northIndex;\r\n indices[indicesIndex++] = p1;\r\n indices[indicesIndex++] = p2;\r\n ++index;\r\n }\r\n }\r\n if (southCap) {\r\n index = (rowHeight - 1) * width;\r\n for (i = 0; i < width - 1; i++) {\r\n p1 = index;\r\n p2 = p1 + 1;\r\n indices[indicesIndex++] = p1;\r\n indices[indicesIndex++] = southIndex;\r\n indices[indicesIndex++] = p2;\r\n ++index;\r\n }\r\n }\r\n }\r\n\r\n geo.indices = indices;\r\n if (vertexFormat.st) {\r\n geo.attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: textureCoordinates,\r\n });\r\n }\r\n\r\n return geo;\r\n}\r\n\r\nfunction addWallPositions(\r\n wallPositions,\r\n posIndex,\r\n i,\r\n topPositions,\r\n bottomPositions\r\n) {\r\n wallPositions[posIndex++] = topPositions[i];\r\n wallPositions[posIndex++] = topPositions[i + 1];\r\n wallPositions[posIndex++] = topPositions[i + 2];\r\n wallPositions[posIndex++] = bottomPositions[i];\r\n wallPositions[posIndex++] = bottomPositions[i + 1];\r\n wallPositions[posIndex] = bottomPositions[i + 2];\r\n return wallPositions;\r\n}\r\n\r\nfunction addWallTextureCoordinates(wallTextures, stIndex, i, st) {\r\n wallTextures[stIndex++] = st[i];\r\n wallTextures[stIndex++] = st[i + 1];\r\n wallTextures[stIndex++] = st[i];\r\n wallTextures[stIndex] = st[i + 1];\r\n return wallTextures;\r\n}\r\n\r\nconst scratchVertexFormat = new VertexFormat();\r\n\r\nfunction constructExtrudedRectangle(rectangleGeometry, computedOptions) {\r\n const shadowVolume = rectangleGeometry._shadowVolume;\r\n const offsetAttributeValue = rectangleGeometry._offsetAttribute;\r\n const vertexFormat = rectangleGeometry._vertexFormat;\r\n const minHeight = rectangleGeometry._extrudedHeight;\r\n const maxHeight = rectangleGeometry._surfaceHeight;\r\n const ellipsoid = rectangleGeometry._ellipsoid;\r\n\r\n const height = computedOptions.height;\r\n const width = computedOptions.width;\r\n\r\n let i;\r\n\r\n if (shadowVolume) {\r\n const newVertexFormat = VertexFormat.clone(\r\n vertexFormat,\r\n scratchVertexFormat\r\n );\r\n newVertexFormat.normal = true;\r\n rectangleGeometry._vertexFormat = newVertexFormat;\r\n }\r\n\r\n const topBottomGeo = constructRectangle(rectangleGeometry, computedOptions);\r\n\r\n if (shadowVolume) {\r\n rectangleGeometry._vertexFormat = vertexFormat;\r\n }\r\n\r\n let topPositions = PolygonPipeline.scaleToGeodeticHeight(\r\n topBottomGeo.attributes.position.values,\r\n maxHeight,\r\n ellipsoid,\r\n false\r\n );\r\n topPositions = new Float64Array(topPositions);\r\n let length = topPositions.length;\r\n const newLength = length * 2;\r\n const positions = new Float64Array(newLength);\r\n positions.set(topPositions);\r\n const bottomPositions = PolygonPipeline.scaleToGeodeticHeight(\r\n topBottomGeo.attributes.position.values,\r\n minHeight,\r\n ellipsoid\r\n );\r\n positions.set(bottomPositions, length);\r\n topBottomGeo.attributes.position.values = positions;\r\n\r\n const normals = vertexFormat.normal ? new Float32Array(newLength) : undefined;\r\n const tangents = vertexFormat.tangent\r\n ? new Float32Array(newLength)\r\n : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(newLength)\r\n : undefined;\r\n const textures = vertexFormat.st\r\n ? new Float32Array((newLength / 3) * 2)\r\n : undefined;\r\n let topSt;\r\n let topNormals;\r\n if (vertexFormat.normal) {\r\n topNormals = topBottomGeo.attributes.normal.values;\r\n normals.set(topNormals);\r\n for (i = 0; i < length; i++) {\r\n topNormals[i] = -topNormals[i];\r\n }\r\n normals.set(topNormals, length);\r\n topBottomGeo.attributes.normal.values = normals;\r\n }\r\n if (shadowVolume) {\r\n topNormals = topBottomGeo.attributes.normal.values;\r\n if (!vertexFormat.normal) {\r\n topBottomGeo.attributes.normal = undefined;\r\n }\r\n const extrudeNormals = new Float32Array(newLength);\r\n for (i = 0; i < length; i++) {\r\n topNormals[i] = -topNormals[i];\r\n }\r\n extrudeNormals.set(topNormals, length); //only get normals for bottom layer that's going to be pushed down\r\n topBottomGeo.attributes.extrudeDirection = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: extrudeNormals,\r\n });\r\n }\r\n\r\n let offsetValue;\r\n const hasOffsets = defined(offsetAttributeValue);\r\n if (hasOffsets) {\r\n const size = (length / 3) * 2;\r\n let offsetAttribute = new Uint8Array(size);\r\n if (offsetAttributeValue === GeometryOffsetAttribute.TOP) {\r\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\r\n } else {\r\n offsetValue =\r\n offsetAttributeValue === GeometryOffsetAttribute.NONE ? 0 : 1;\r\n offsetAttribute = offsetAttribute.fill(offsetValue);\r\n }\r\n\r\n topBottomGeo.attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: offsetAttribute,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n const topTangents = topBottomGeo.attributes.tangent.values;\r\n tangents.set(topTangents);\r\n for (i = 0; i < length; i++) {\r\n topTangents[i] = -topTangents[i];\r\n }\r\n tangents.set(topTangents, length);\r\n topBottomGeo.attributes.tangent.values = tangents;\r\n }\r\n if (vertexFormat.bitangent) {\r\n const topBitangents = topBottomGeo.attributes.bitangent.values;\r\n bitangents.set(topBitangents);\r\n bitangents.set(topBitangents, length);\r\n topBottomGeo.attributes.bitangent.values = bitangents;\r\n }\r\n if (vertexFormat.st) {\r\n topSt = topBottomGeo.attributes.st.values;\r\n textures.set(topSt);\r\n textures.set(topSt, (length / 3) * 2);\r\n topBottomGeo.attributes.st.values = textures;\r\n }\r\n\r\n const indices = topBottomGeo.indices;\r\n const indicesLength = indices.length;\r\n const posLength = length / 3;\r\n const newIndices = IndexDatatype.createTypedArray(\r\n newLength / 3,\r\n indicesLength * 2\r\n );\r\n newIndices.set(indices);\r\n for (i = 0; i < indicesLength; i += 3) {\r\n newIndices[i + indicesLength] = indices[i + 2] + posLength;\r\n newIndices[i + 1 + indicesLength] = indices[i + 1] + posLength;\r\n newIndices[i + 2 + indicesLength] = indices[i] + posLength;\r\n }\r\n topBottomGeo.indices = newIndices;\r\n\r\n const northCap = computedOptions.northCap;\r\n const southCap = computedOptions.southCap;\r\n\r\n let rowHeight = height;\r\n let widthMultiplier = 2;\r\n let perimeterPositions = 0;\r\n let corners = 4;\r\n let dupliateCorners = 4;\r\n if (northCap) {\r\n widthMultiplier -= 1;\r\n rowHeight -= 1;\r\n perimeterPositions += 1;\r\n corners -= 2;\r\n dupliateCorners -= 1;\r\n }\r\n if (southCap) {\r\n widthMultiplier -= 1;\r\n rowHeight -= 1;\r\n perimeterPositions += 1;\r\n corners -= 2;\r\n dupliateCorners -= 1;\r\n }\r\n perimeterPositions += widthMultiplier * width + 2 * rowHeight - corners;\r\n\r\n const wallCount = (perimeterPositions + dupliateCorners) * 2;\r\n\r\n let wallPositions = new Float64Array(wallCount * 3);\r\n const wallExtrudeNormals = shadowVolume\r\n ? new Float32Array(wallCount * 3)\r\n : undefined;\r\n let wallOffsetAttribute = hasOffsets ? new Uint8Array(wallCount) : undefined;\r\n let wallTextures = vertexFormat.st\r\n ? new Float32Array(wallCount * 2)\r\n : undefined;\r\n\r\n const computeTopOffsets =\r\n offsetAttributeValue === GeometryOffsetAttribute.TOP;\r\n if (hasOffsets && !computeTopOffsets) {\r\n offsetValue = offsetAttributeValue === GeometryOffsetAttribute.ALL ? 1 : 0;\r\n wallOffsetAttribute = wallOffsetAttribute.fill(offsetValue);\r\n }\r\n\r\n let posIndex = 0;\r\n let stIndex = 0;\r\n let extrudeNormalIndex = 0;\r\n let wallOffsetIndex = 0;\r\n const area = width * rowHeight;\r\n let threeI;\r\n for (i = 0; i < area; i += width) {\r\n threeI = i * 3;\r\n wallPositions = addWallPositions(\r\n wallPositions,\r\n posIndex,\r\n threeI,\r\n topPositions,\r\n bottomPositions\r\n );\r\n posIndex += 6;\r\n if (vertexFormat.st) {\r\n wallTextures = addWallTextureCoordinates(\r\n wallTextures,\r\n stIndex,\r\n i * 2,\r\n topSt\r\n );\r\n stIndex += 4;\r\n }\r\n if (shadowVolume) {\r\n extrudeNormalIndex += 3;\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\r\n }\r\n if (computeTopOffsets) {\r\n wallOffsetAttribute[wallOffsetIndex++] = 1;\r\n wallOffsetIndex += 1;\r\n }\r\n }\r\n\r\n if (!southCap) {\r\n for (i = area - width; i < area; i++) {\r\n threeI = i * 3;\r\n wallPositions = addWallPositions(\r\n wallPositions,\r\n posIndex,\r\n threeI,\r\n topPositions,\r\n bottomPositions\r\n );\r\n posIndex += 6;\r\n if (vertexFormat.st) {\r\n wallTextures = addWallTextureCoordinates(\r\n wallTextures,\r\n stIndex,\r\n i * 2,\r\n topSt\r\n );\r\n stIndex += 4;\r\n }\r\n if (shadowVolume) {\r\n extrudeNormalIndex += 3;\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\r\n }\r\n if (computeTopOffsets) {\r\n wallOffsetAttribute[wallOffsetIndex++] = 1;\r\n wallOffsetIndex += 1;\r\n }\r\n }\r\n } else {\r\n const southIndex = northCap ? area + 1 : area;\r\n threeI = southIndex * 3;\r\n\r\n for (i = 0; i < 2; i++) {\r\n // duplicate corner points\r\n wallPositions = addWallPositions(\r\n wallPositions,\r\n posIndex,\r\n threeI,\r\n topPositions,\r\n bottomPositions\r\n );\r\n posIndex += 6;\r\n if (vertexFormat.st) {\r\n wallTextures = addWallTextureCoordinates(\r\n wallTextures,\r\n stIndex,\r\n southIndex * 2,\r\n topSt\r\n );\r\n stIndex += 4;\r\n }\r\n if (shadowVolume) {\r\n extrudeNormalIndex += 3;\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\r\n }\r\n if (computeTopOffsets) {\r\n wallOffsetAttribute[wallOffsetIndex++] = 1;\r\n wallOffsetIndex += 1;\r\n }\r\n }\r\n }\r\n\r\n for (i = area - 1; i > 0; i -= width) {\r\n threeI = i * 3;\r\n wallPositions = addWallPositions(\r\n wallPositions,\r\n posIndex,\r\n threeI,\r\n topPositions,\r\n bottomPositions\r\n );\r\n posIndex += 6;\r\n if (vertexFormat.st) {\r\n wallTextures = addWallTextureCoordinates(\r\n wallTextures,\r\n stIndex,\r\n i * 2,\r\n topSt\r\n );\r\n stIndex += 4;\r\n }\r\n if (shadowVolume) {\r\n extrudeNormalIndex += 3;\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\r\n }\r\n if (computeTopOffsets) {\r\n wallOffsetAttribute[wallOffsetIndex++] = 1;\r\n wallOffsetIndex += 1;\r\n }\r\n }\r\n\r\n if (!northCap) {\r\n for (i = width - 1; i >= 0; i--) {\r\n threeI = i * 3;\r\n wallPositions = addWallPositions(\r\n wallPositions,\r\n posIndex,\r\n threeI,\r\n topPositions,\r\n bottomPositions\r\n );\r\n posIndex += 6;\r\n if (vertexFormat.st) {\r\n wallTextures = addWallTextureCoordinates(\r\n wallTextures,\r\n stIndex,\r\n i * 2,\r\n topSt\r\n );\r\n stIndex += 4;\r\n }\r\n if (shadowVolume) {\r\n extrudeNormalIndex += 3;\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\r\n }\r\n if (computeTopOffsets) {\r\n wallOffsetAttribute[wallOffsetIndex++] = 1;\r\n wallOffsetIndex += 1;\r\n }\r\n }\r\n } else {\r\n const northIndex = area;\r\n threeI = northIndex * 3;\r\n\r\n for (i = 0; i < 2; i++) {\r\n // duplicate corner points\r\n wallPositions = addWallPositions(\r\n wallPositions,\r\n posIndex,\r\n threeI,\r\n topPositions,\r\n bottomPositions\r\n );\r\n posIndex += 6;\r\n if (vertexFormat.st) {\r\n wallTextures = addWallTextureCoordinates(\r\n wallTextures,\r\n stIndex,\r\n northIndex * 2,\r\n topSt\r\n );\r\n stIndex += 4;\r\n }\r\n if (shadowVolume) {\r\n extrudeNormalIndex += 3;\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];\r\n wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];\r\n }\r\n if (computeTopOffsets) {\r\n wallOffsetAttribute[wallOffsetIndex++] = 1;\r\n wallOffsetIndex += 1;\r\n }\r\n }\r\n }\r\n\r\n let geo = calculateAttributesWall(wallPositions, vertexFormat, ellipsoid);\r\n\r\n if (vertexFormat.st) {\r\n geo.attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: wallTextures,\r\n });\r\n }\r\n if (shadowVolume) {\r\n geo.attributes.extrudeDirection = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: wallExtrudeNormals,\r\n });\r\n }\r\n if (hasOffsets) {\r\n geo.attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: wallOffsetAttribute,\r\n });\r\n }\r\n\r\n const wallIndices = IndexDatatype.createTypedArray(\r\n wallCount,\r\n perimeterPositions * 6\r\n );\r\n\r\n let upperLeft;\r\n let lowerLeft;\r\n let lowerRight;\r\n let upperRight;\r\n length = wallPositions.length / 3;\r\n let index = 0;\r\n for (i = 0; i < length - 1; i += 2) {\r\n upperLeft = i;\r\n upperRight = (upperLeft + 2) % length;\r\n const p1 = Cartesian3.fromArray(wallPositions, upperLeft * 3, v1Scratch);\r\n const p2 = Cartesian3.fromArray(wallPositions, upperRight * 3, v2Scratch);\r\n if (Cartesian3.equalsEpsilon(p1, p2, CesiumMath.EPSILON10)) {\r\n continue;\r\n }\r\n lowerLeft = (upperLeft + 1) % length;\r\n lowerRight = (lowerLeft + 2) % length;\r\n wallIndices[index++] = upperLeft;\r\n wallIndices[index++] = lowerLeft;\r\n wallIndices[index++] = upperRight;\r\n wallIndices[index++] = upperRight;\r\n wallIndices[index++] = lowerLeft;\r\n wallIndices[index++] = lowerRight;\r\n }\r\n\r\n geo.indices = wallIndices;\r\n\r\n geo = GeometryPipeline.combineInstances([\r\n new GeometryInstance({\r\n geometry: topBottomGeo,\r\n }),\r\n new GeometryInstance({\r\n geometry: geo,\r\n }),\r\n ]);\r\n\r\n return geo[0];\r\n}\r\n\r\nconst scratchRectanglePoints = [\r\n new Cartesian3(),\r\n new Cartesian3(),\r\n new Cartesian3(),\r\n new Cartesian3(),\r\n];\r\nconst nwScratch = new Cartographic();\r\nconst stNwScratch = new Cartographic();\r\nfunction computeRectangle(rectangle, granularity, rotation, ellipsoid, result) {\r\n if (rotation === 0.0) {\r\n return Rectangle.clone(rectangle, result);\r\n }\r\n\r\n const computedOptions = RectangleGeometryLibrary.computeOptions(\r\n rectangle,\r\n granularity,\r\n rotation,\r\n 0,\r\n rectangleScratch,\r\n nwScratch\r\n );\r\n\r\n const height = computedOptions.height;\r\n const width = computedOptions.width;\r\n\r\n const positions = scratchRectanglePoints;\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n false,\r\n 0,\r\n 0,\r\n positions[0]\r\n );\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n false,\r\n 0,\r\n width - 1,\r\n positions[1]\r\n );\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n false,\r\n height - 1,\r\n 0,\r\n positions[2]\r\n );\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n false,\r\n height - 1,\r\n width - 1,\r\n positions[3]\r\n );\r\n\r\n return Rectangle.fromCartesianArray(positions, ellipsoid, result);\r\n}\r\n\r\n/**\r\n * A description of a cartographic rectangle on an ellipsoid centered at the origin. Rectangle geometry can be rendered with both {@link Primitive} and {@link GroundPrimitive}.\r\n *\r\n * @alias RectangleGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface.\r\n * @param {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.\r\n * @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.\r\n * @param {Number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.\r\n *\r\n * @exception {DeveloperError} options.rectangle.north
must be in the interval [-Pi/2
, Pi/2
].\r\n * @exception {DeveloperError} options.rectangle.south
must be in the interval [-Pi/2
, Pi/2
].\r\n * @exception {DeveloperError} options.rectangle.east
must be in the interval [-Pi
, Pi
].\r\n * @exception {DeveloperError} options.rectangle.west
must be in the interval [-Pi
, Pi
].\r\n * @exception {DeveloperError} options.rectangle.north
must be greater than options.rectangle.south
.\r\n *\r\n * @see RectangleGeometry#createGeometry\r\n *\r\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Rectangle.html|Cesium Sandcastle Rectangle Demo}\r\n *\r\n * @example\r\n * // 1. create a rectangle\r\n * const rectangle = new Cesium.RectangleGeometry({\r\n * ellipsoid : Cesium.Ellipsoid.WGS84,\r\n * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),\r\n * height : 10000.0\r\n * });\r\n * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);\r\n *\r\n * // 2. create an extruded rectangle without a top\r\n * const rectangle = new Cesium.RectangleGeometry({\r\n * ellipsoid : Cesium.Ellipsoid.WGS84,\r\n * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),\r\n * height : 10000.0,\r\n * extrudedHeight: 300000\r\n * });\r\n * const geometry = Cesium.RectangleGeometry.createGeometry(rectangle);\r\n */\r\nfunction RectangleGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const rectangle = options.rectangle;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n Rectangle.validate(rectangle);\r\n if (rectangle.north < rectangle.south) {\r\n throw new DeveloperError(\r\n \"options.rectangle.north must be greater than or equal to options.rectangle.south\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const height = defaultValue(options.height, 0.0);\r\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\r\n\r\n this._rectangle = Rectangle.clone(rectangle);\r\n this._granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n this._ellipsoid = Ellipsoid.clone(\r\n defaultValue(options.ellipsoid, Ellipsoid.WGS84)\r\n );\r\n this._surfaceHeight = Math.max(height, extrudedHeight);\r\n this._rotation = defaultValue(options.rotation, 0.0);\r\n this._stRotation = defaultValue(options.stRotation, 0.0);\r\n this._vertexFormat = VertexFormat.clone(\r\n defaultValue(options.vertexFormat, VertexFormat.DEFAULT)\r\n );\r\n this._extrudedHeight = Math.min(height, extrudedHeight);\r\n this._shadowVolume = defaultValue(options.shadowVolume, false);\r\n this._workerName = \"createRectangleGeometry\";\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._rotatedRectangle = undefined;\r\n\r\n this._textureCoordinateRotationPoints = undefined;\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nRectangleGeometry.packedLength =\r\n Rectangle.packedLength +\r\n Ellipsoid.packedLength +\r\n VertexFormat.packedLength +\r\n 7;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {RectangleGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nRectangleGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n Rectangle.pack(value._rectangle, array, startingIndex);\r\n startingIndex += Rectangle.packedLength;\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n array[startingIndex++] = value._granularity;\r\n array[startingIndex++] = value._surfaceHeight;\r\n array[startingIndex++] = value._rotation;\r\n array[startingIndex++] = value._stRotation;\r\n array[startingIndex++] = value._extrudedHeight;\r\n array[startingIndex++] = value._shadowVolume ? 1.0 : 0.0;\r\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchRectangle = new Rectangle();\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchOptions = {\r\n rectangle: scratchRectangle,\r\n ellipsoid: scratchEllipsoid,\r\n vertexFormat: scratchVertexFormat,\r\n granularity: undefined,\r\n height: undefined,\r\n rotation: undefined,\r\n stRotation: undefined,\r\n extrudedHeight: undefined,\r\n shadowVolume: undefined,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {RectangleGeometry} [result] The object into which to store the result.\r\n * @returns {RectangleGeometry} The modified result parameter or a new RectangleGeometry instance if one was not provided.\r\n */\r\nRectangleGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.defined(\"array\", array);\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const rectangle = Rectangle.unpack(array, startingIndex, scratchRectangle);\r\n startingIndex += Rectangle.packedLength;\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n const granularity = array[startingIndex++];\r\n const surfaceHeight = array[startingIndex++];\r\n const rotation = array[startingIndex++];\r\n const stRotation = array[startingIndex++];\r\n const extrudedHeight = array[startingIndex++];\r\n const shadowVolume = array[startingIndex++] === 1.0;\r\n const offsetAttribute = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.granularity = granularity;\r\n scratchOptions.height = surfaceHeight;\r\n scratchOptions.rotation = rotation;\r\n scratchOptions.stRotation = stRotation;\r\n scratchOptions.extrudedHeight = extrudedHeight;\r\n scratchOptions.shadowVolume = shadowVolume;\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return new RectangleGeometry(scratchOptions);\r\n }\r\n\r\n result._rectangle = Rectangle.clone(rectangle, result._rectangle);\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._granularity = granularity;\r\n result._surfaceHeight = surfaceHeight;\r\n result._rotation = rotation;\r\n result._stRotation = stRotation;\r\n result._extrudedHeight = extrudedHeight;\r\n result._shadowVolume = shadowVolume;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the bounding rectangle based on the provided options\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.\r\n * @param {Rectangle} [result] An object in which to store the result.\r\n *\r\n * @returns {Rectangle} The result rectangle\r\n */\r\nRectangleGeometry.computeRectangle = function (options, result) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const rectangle = options.rectangle;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"rectangle\", rectangle);\r\n Rectangle.validate(rectangle);\r\n if (rectangle.north < rectangle.south) {\r\n throw new DeveloperError(\r\n \"options.rectangle.north must be greater than or equal to options.rectangle.south\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n const rotation = defaultValue(options.rotation, 0.0);\r\n\r\n return computeRectangle(rectangle, granularity, rotation, ellipsoid, result);\r\n};\r\n\r\nconst tangentRotationMatrixScratch = new Matrix3();\r\nconst quaternionScratch = new Quaternion();\r\nconst centerScratch = new Cartographic();\r\n/**\r\n * Computes the geometric representation of a rectangle, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {RectangleGeometry} rectangleGeometry A description of the rectangle.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n *\r\n * @exception {DeveloperError} Rotated rectangle is invalid.\r\n */\r\nRectangleGeometry.createGeometry = function (rectangleGeometry) {\r\n if (\r\n CesiumMath.equalsEpsilon(\r\n rectangleGeometry._rectangle.north,\r\n rectangleGeometry._rectangle.south,\r\n CesiumMath.EPSILON10\r\n ) ||\r\n CesiumMath.equalsEpsilon(\r\n rectangleGeometry._rectangle.east,\r\n rectangleGeometry._rectangle.west,\r\n CesiumMath.EPSILON10\r\n )\r\n ) {\r\n return undefined;\r\n }\r\n\r\n let rectangle = rectangleGeometry._rectangle;\r\n const ellipsoid = rectangleGeometry._ellipsoid;\r\n const rotation = rectangleGeometry._rotation;\r\n const stRotation = rectangleGeometry._stRotation;\r\n const vertexFormat = rectangleGeometry._vertexFormat;\r\n\r\n const computedOptions = RectangleGeometryLibrary.computeOptions(\r\n rectangle,\r\n rectangleGeometry._granularity,\r\n rotation,\r\n stRotation,\r\n rectangleScratch,\r\n nwScratch,\r\n stNwScratch\r\n );\r\n\r\n const tangentRotationMatrix = tangentRotationMatrixScratch;\r\n if (stRotation !== 0 || rotation !== 0) {\r\n const center = Rectangle.center(rectangle, centerScratch);\r\n const axis = ellipsoid.geodeticSurfaceNormalCartographic(center, v1Scratch);\r\n Quaternion.fromAxisAngle(axis, -stRotation, quaternionScratch);\r\n Matrix3.fromQuaternion(quaternionScratch, tangentRotationMatrix);\r\n } else {\r\n Matrix3.clone(Matrix3.IDENTITY, tangentRotationMatrix);\r\n }\r\n\r\n const surfaceHeight = rectangleGeometry._surfaceHeight;\r\n const extrudedHeight = rectangleGeometry._extrudedHeight;\r\n const extrude = !CesiumMath.equalsEpsilon(\r\n surfaceHeight,\r\n extrudedHeight,\r\n 0,\r\n CesiumMath.EPSILON2\r\n );\r\n\r\n computedOptions.lonScalar = 1.0 / rectangleGeometry._rectangle.width;\r\n computedOptions.latScalar = 1.0 / rectangleGeometry._rectangle.height;\r\n computedOptions.tangentRotationMatrix = tangentRotationMatrix;\r\n\r\n let geometry;\r\n let boundingSphere;\r\n rectangle = rectangleGeometry._rectangle;\r\n if (extrude) {\r\n geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);\r\n const topBS = BoundingSphere.fromRectangle3D(\r\n rectangle,\r\n ellipsoid,\r\n surfaceHeight,\r\n topBoundingSphere\r\n );\r\n const bottomBS = BoundingSphere.fromRectangle3D(\r\n rectangle,\r\n ellipsoid,\r\n extrudedHeight,\r\n bottomBoundingSphere\r\n );\r\n boundingSphere = BoundingSphere.union(topBS, bottomBS);\r\n } else {\r\n geometry = constructRectangle(rectangleGeometry, computedOptions);\r\n geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\r\n geometry.attributes.position.values,\r\n surfaceHeight,\r\n ellipsoid,\r\n false\r\n );\r\n\r\n if (defined(rectangleGeometry._offsetAttribute)) {\r\n const length = geometry.attributes.position.values.length;\r\n const offsetValue =\r\n rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n geometry.attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n boundingSphere = BoundingSphere.fromRectangle3D(\r\n rectangle,\r\n ellipsoid,\r\n surfaceHeight\r\n );\r\n }\r\n\r\n if (!vertexFormat.position) {\r\n delete geometry.attributes.position;\r\n }\r\n\r\n return new Geometry({\r\n attributes: geometry.attributes,\r\n indices: geometry.indices,\r\n primitiveType: geometry.primitiveType,\r\n boundingSphere: boundingSphere,\r\n offsetAttribute: rectangleGeometry._offsetAttribute,\r\n });\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nRectangleGeometry.createShadowVolume = function (\r\n rectangleGeometry,\r\n minHeightFunc,\r\n maxHeightFunc\r\n) {\r\n const granularity = rectangleGeometry._granularity;\r\n const ellipsoid = rectangleGeometry._ellipsoid;\r\n\r\n const minHeight = minHeightFunc(granularity, ellipsoid);\r\n const maxHeight = maxHeightFunc(granularity, ellipsoid);\r\n\r\n return new RectangleGeometry({\r\n rectangle: rectangleGeometry._rectangle,\r\n rotation: rectangleGeometry._rotation,\r\n ellipsoid: ellipsoid,\r\n stRotation: rectangleGeometry._stRotation,\r\n granularity: granularity,\r\n extrudedHeight: maxHeight,\r\n height: minHeight,\r\n vertexFormat: VertexFormat.POSITION_ONLY,\r\n shadowVolume: true,\r\n });\r\n};\r\n\r\nconst unrotatedTextureRectangleScratch = new Rectangle();\r\nconst points2DScratch = [new Cartesian2(), new Cartesian2(), new Cartesian2()];\r\nconst rotation2DScratch = new Matrix2();\r\nconst rectangleCenterScratch = new Cartographic();\r\n\r\nfunction textureCoordinateRotationPoints(rectangleGeometry) {\r\n if (rectangleGeometry._stRotation === 0.0) {\r\n return [0, 0, 0, 1, 1, 0];\r\n }\r\n\r\n const rectangle = Rectangle.clone(\r\n rectangleGeometry._rectangle,\r\n unrotatedTextureRectangleScratch\r\n );\r\n const granularity = rectangleGeometry._granularity;\r\n const ellipsoid = rectangleGeometry._ellipsoid;\r\n\r\n // Rotate to align the texture coordinates with ENU\r\n const rotation = rectangleGeometry._rotation - rectangleGeometry._stRotation;\r\n\r\n const unrotatedTextureRectangle = computeRectangle(\r\n rectangle,\r\n granularity,\r\n rotation,\r\n ellipsoid,\r\n unrotatedTextureRectangleScratch\r\n );\r\n\r\n // Assume a computed \"east-north\" texture coordinate system based on spherical or planar tricks, bounded by `boundingRectangle`.\r\n // The \"desired\" texture coordinate system forms an oriented rectangle (un-oriented computed) around the geometry that completely and tightly bounds it.\r\n // We want to map from the \"east-north\" texture coordinate system into the \"desired\" system using a pair of lines (analagous planes in 2D)\r\n // Compute 3 corners of the \"desired\" texture coordinate system in \"east-north\" texture space by the following in cartographic space:\r\n // - rotate 3 of the corners in unrotatedTextureRectangle by stRotation around the center of the bounding rectangle\r\n // - apply the \"east-north\" system's normalization formula to the rotated cartographics, even though this is likely to produce values outside [0-1].\r\n // This gives us a set of points in the \"east-north\" texture coordinate system that can be used to map \"east-north\" texture coordinates to \"desired.\"\r\n\r\n const points2D = points2DScratch;\r\n points2D[0].x = unrotatedTextureRectangle.west;\r\n points2D[0].y = unrotatedTextureRectangle.south;\r\n\r\n points2D[1].x = unrotatedTextureRectangle.west;\r\n points2D[1].y = unrotatedTextureRectangle.north;\r\n\r\n points2D[2].x = unrotatedTextureRectangle.east;\r\n points2D[2].y = unrotatedTextureRectangle.south;\r\n\r\n const boundingRectangle = rectangleGeometry.rectangle;\r\n const toDesiredInComputed = Matrix2.fromRotation(\r\n rectangleGeometry._stRotation,\r\n rotation2DScratch\r\n );\r\n const boundingRectangleCenter = Rectangle.center(\r\n boundingRectangle,\r\n rectangleCenterScratch\r\n );\r\n\r\n for (let i = 0; i < 3; ++i) {\r\n const point2D = points2D[i];\r\n point2D.x -= boundingRectangleCenter.longitude;\r\n point2D.y -= boundingRectangleCenter.latitude;\r\n Matrix2.multiplyByVector(toDesiredInComputed, point2D, point2D);\r\n point2D.x += boundingRectangleCenter.longitude;\r\n point2D.y += boundingRectangleCenter.latitude;\r\n\r\n // Convert point into east-north texture coordinate space\r\n point2D.x = (point2D.x - boundingRectangle.west) / boundingRectangle.width;\r\n point2D.y =\r\n (point2D.y - boundingRectangle.south) / boundingRectangle.height;\r\n }\r\n\r\n const minXYCorner = points2D[0];\r\n const maxYCorner = points2D[1];\r\n const maxXCorner = points2D[2];\r\n const result = new Array(6);\r\n Cartesian2.pack(minXYCorner, result);\r\n Cartesian2.pack(maxYCorner, result, 2);\r\n Cartesian2.pack(maxXCorner, result, 4);\r\n return result;\r\n}\r\n\r\nObject.defineProperties(RectangleGeometry.prototype, {\r\n /**\r\n * @private\r\n */\r\n rectangle: {\r\n get: function () {\r\n if (!defined(this._rotatedRectangle)) {\r\n this._rotatedRectangle = computeRectangle(\r\n this._rectangle,\r\n this._granularity,\r\n this._rotation,\r\n this._ellipsoid\r\n );\r\n }\r\n return this._rotatedRectangle;\r\n },\r\n },\r\n /**\r\n * For remapping texture coordinates when rendering RectangleGeometries as GroundPrimitives.\r\n * This version permits skew in textures by computing offsets directly in cartographic space and\r\n * more accurately approximates rendering RectangleGeometries with height as standard Primitives.\r\n * @see Geometry#_textureCoordinateRotationPoints\r\n * @private\r\n */\r\n textureCoordinateRotationPoints: {\r\n get: function () {\r\n if (!defined(this._textureCoordinateRotationPoints)) {\r\n this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(\r\n this\r\n );\r\n }\r\n return this._textureCoordinateRotationPoints;\r\n },\r\n },\r\n});\r\nexport default RectangleGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport Rectangle from \"../Core/Rectangle.js\";\r\nimport RectangleGeometry from \"../Core/RectangleGeometry.js\";\r\n\r\nfunction createRectangleGeometry(rectangleGeometry, offset) {\r\n if (defined(offset)) {\r\n rectangleGeometry = RectangleGeometry.unpack(rectangleGeometry, offset);\r\n }\r\n rectangleGeometry._ellipsoid = Ellipsoid.clone(rectangleGeometry._ellipsoid);\r\n rectangleGeometry._rectangle = Rectangle.clone(rectangleGeometry._rectangle);\r\n return RectangleGeometry.createGeometry(rectangleGeometry);\r\n}\r\nexport default createRectangleGeometry;\r\n"],"names":["Cartesian3","Rectangle","Cartesian2","BoundingSphere","Geometry","GeometryAttributes","PrimitiveType","GeometryAttribute","ComponentDatatype","Matrix3","CesiumMath","RectangleGeometryLibrary","IndexDatatype","VertexFormat","PolygonPipeline","defined","GeometryOffsetAttribute","GeometryPipeline","GeometryInstance","Cartographic","defaultValue","Check","DeveloperError","Ellipsoid","Quaternion","Matrix2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BA,MAAM,eAAe,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACzC,MAAM,aAAa,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACvC,MAAM,cAAc,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACxC,MAAM,gBAAgB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC1C,MAAM,gBAAgB,GAAG,IAAIC,iBAAS,EAAE,CAAC;EACzC,MAAM,SAAS,GAAG,IAAIC,kBAAU,EAAE,CAAC;EACnC,MAAM,oBAAoB,GAAG,IAAIC,yBAAc,EAAE,CAAC;EAClD,MAAM,iBAAiB,GAAG,IAAIA,yBAAc,EAAE,CAAC;AAC/C;EACA,SAAS,gBAAgB,CAAC,YAAY,EAAE,UAAU,EAAE;EACpD,EAAE,MAAM,GAAG,GAAG,IAAIC,0BAAQ,CAAC;EAC3B,IAAI,UAAU,EAAE,IAAIC,qCAAkB,EAAE;EACxC,IAAI,aAAa,EAAEC,+BAAa,CAAC,SAAS;EAC1C,GAAG,CAAC,CAAC;AACL;EACA,EAAE,GAAG,CAAC,UAAU,CAAC,QAAQ,GAAG,IAAIC,mCAAiB,CAAC;EAClD,IAAI,iBAAiB,EAAEC,mCAAiB,CAAC,MAAM;EAC/C,IAAI,sBAAsB,EAAE,CAAC;EAC7B,IAAI,MAAM,EAAE,UAAU,CAAC,SAAS;EAChC,GAAG,CAAC,CAAC;EACL,EAAE,IAAI,YAAY,CAAC,MAAM,EAAE;EAC3B,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,IAAID,mCAA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SAAS;EACxB,UAAU,IAAI,CAAC,UAAU;EACzB,SAAS,CAAC;EACV,OAAO;EACP,MAAM,OAAO,IAAI,CAAC,iBAAiB,CAAC;EACpC,KAAK;EACL,GAAG;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,+BAA+B,EAAE;EACnC,IAAI,GAAG,EAAE,YAAY;EACrB,MAAM,IAAI,CAACA,oBAAO,CAAC,IAAI,CAAC,gCAAgC,CAAC,EAAE;EAC3D,QAAQ,IAAI,CAAC,gCAAgC,GAAG,+BAA+B;EAC/E,UAAU,IAAI;EACd,SAAS,CAAC;EACV,OAAO;EACP,MAAM,OAAO,IAAI,CAAC,gCAAgC,CAAC;EACnD,KAAK;EACL,GAAG;EACH,CAAC,CAAC;;EC18CF,SAAS,uBAAuB,CAAC,iBAAiB,EAAE,MAAM,EAAE;EAC5D,EAAE,IAAIA,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,iBAAiB,GAAG,iBAAiB,CAAC,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;EAC5E,GAAG;EACH,EAAE,iBAAiB,CAAC,UAAU,GAAGQ,iBAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;EAC/E,EAAE,iBAAiB,CAAC,UAAU,GAAGtB,iBAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;EAC/E,EAAE,OAAO,iBAAiB,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;EAC7D;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createRectangleOutlineGeometry.js b/examples/cesium/Workers/createRectangleOutlineGeometry.js
new file mode 100644
index 0000000..07ab242
--- /dev/null
+++ b/examples/cesium/Workers/createRectangleOutlineGeometry.js
@@ -0,0 +1,561 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './Matrix2-036c77dd', './Transforms-11fb6b0a', './ComponentDatatype-13a5630b', './Check-d10e5f2e', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolygonPipeline-313487c3', './RectangleGeometryLibrary-94f83a5a', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29', './EllipsoidRhumbLine-48b4507b'], (function (defaultValue, Matrix3, Matrix2, Transforms, ComponentDatatype, Check, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype, Math$1, PolygonPipeline, RectangleGeometryLibrary, RuntimeError, combine, WebGLConstants, EllipsoidRhumbLine) { 'use strict';
+
+ const bottomBoundingSphere = new Transforms.BoundingSphere();
+ const topBoundingSphere = new Transforms.BoundingSphere();
+ const positionScratch = new Matrix3.Cartesian3();
+ const rectangleScratch = new Matrix2.Rectangle();
+
+ function constructRectangle(geometry, computedOptions) {
+ const ellipsoid = geometry._ellipsoid;
+ const height = computedOptions.height;
+ const width = computedOptions.width;
+ const northCap = computedOptions.northCap;
+ const southCap = computedOptions.southCap;
+
+ let rowHeight = height;
+ let widthMultiplier = 2;
+ let size = 0;
+ let corners = 4;
+ if (northCap) {
+ widthMultiplier -= 1;
+ rowHeight -= 1;
+ size += 1;
+ corners -= 2;
+ }
+ if (southCap) {
+ widthMultiplier -= 1;
+ rowHeight -= 1;
+ size += 1;
+ corners -= 2;
+ }
+ size += widthMultiplier * width + 2 * rowHeight - corners;
+
+ const positions = new Float64Array(size * 3);
+
+ let posIndex = 0;
+ let row = 0;
+ let col;
+ const position = positionScratch;
+ if (northCap) {
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ row,
+ 0,
+ position
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ } else {
+ for (col = 0; col < width; col++) {
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ row,
+ col,
+ position
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ }
+ }
+
+ col = width - 1;
+ for (row = 1; row < height; row++) {
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ row,
+ col,
+ position
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ }
+
+ row = height - 1;
+ if (!southCap) {
+ // if southCap is true, we dont need to add any more points because the south pole point was added by the iteration above
+ for (col = width - 2; col >= 0; col--) {
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ row,
+ col,
+ position
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ }
+ }
+
+ col = 0;
+ for (row = height - 2; row > 0; row--) {
+ RectangleGeometryLibrary.RectangleGeometryLibrary.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ row,
+ col,
+ position
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ }
+
+ const indicesSize = (positions.length / 3) * 2;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ positions.length / 3,
+ indicesSize
+ );
+
+ let index = 0;
+ for (let i = 0; i < positions.length / 3 - 1; i++) {
+ indices[index++] = i;
+ indices[index++] = i + 1;
+ }
+ indices[index++] = positions.length / 3 - 1;
+ indices[index++] = 0;
+
+ const geo = new GeometryAttribute.Geometry({
+ attributes: new GeometryAttributes.GeometryAttributes(),
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ });
+
+ geo.attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+ geo.indices = indices;
+
+ return geo;
+ }
+
+ function constructExtrudedRectangle(rectangleGeometry, computedOptions) {
+ const surfaceHeight = rectangleGeometry._surfaceHeight;
+ const extrudedHeight = rectangleGeometry._extrudedHeight;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const minHeight = extrudedHeight;
+ const maxHeight = surfaceHeight;
+ const geo = constructRectangle(rectangleGeometry, computedOptions);
+
+ const height = computedOptions.height;
+ const width = computedOptions.width;
+
+ const topPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ geo.attributes.position.values,
+ maxHeight,
+ ellipsoid,
+ false
+ );
+ let length = topPositions.length;
+ const positions = new Float64Array(length * 2);
+ positions.set(topPositions);
+ const bottomPositions = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ geo.attributes.position.values,
+ minHeight,
+ ellipsoid
+ );
+ positions.set(bottomPositions, length);
+ geo.attributes.position.values = positions;
+
+ const northCap = computedOptions.northCap;
+ const southCap = computedOptions.southCap;
+ let corners = 4;
+ if (northCap) {
+ corners -= 1;
+ }
+ if (southCap) {
+ corners -= 1;
+ }
+
+ const indicesSize = (positions.length / 3 + corners) * 2;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ positions.length / 3,
+ indicesSize
+ );
+ length = positions.length / 6;
+ let index = 0;
+ for (let i = 0; i < length - 1; i++) {
+ indices[index++] = i;
+ indices[index++] = i + 1;
+ indices[index++] = i + length;
+ indices[index++] = i + length + 1;
+ }
+ indices[index++] = length - 1;
+ indices[index++] = 0;
+ indices[index++] = length + length - 1;
+ indices[index++] = length;
+
+ indices[index++] = 0;
+ indices[index++] = length;
+
+ let bottomCorner;
+ if (northCap) {
+ bottomCorner = height - 1;
+ } else {
+ const topRightCorner = width - 1;
+ indices[index++] = topRightCorner;
+ indices[index++] = topRightCorner + length;
+ bottomCorner = width + height - 2;
+ }
+
+ indices[index++] = bottomCorner;
+ indices[index++] = bottomCorner + length;
+
+ if (!southCap) {
+ const bottomLeftCorner = width + bottomCorner - 1;
+ indices[index++] = bottomLeftCorner;
+ indices[index] = bottomLeftCorner + length;
+ }
+
+ geo.indices = indices;
+
+ return geo;
+ }
+
+ /**
+ * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.
+ *
+ * @alias RectangleOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface.
+ * @param {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.
+ * @param {Number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.
+ *
+ * @exception {DeveloperError} options.rectangle.north
must be in the interval [-Pi/2
, Pi/2
].
+ * @exception {DeveloperError} options.rectangle.south
must be in the interval [-Pi/2
, Pi/2
].
+ * @exception {DeveloperError} options.rectangle.east
must be in the interval [-Pi
, Pi
].
+ * @exception {DeveloperError} options.rectangle.west
must be in the interval [-Pi
, Pi
].
+ * @exception {DeveloperError} options.rectangle.north
must be greater than rectangle.south
.
+ *
+ * @see RectangleOutlineGeometry#createGeometry
+ *
+ * @example
+ * const rectangle = new Cesium.RectangleOutlineGeometry({
+ * ellipsoid : Cesium.Ellipsoid.WGS84,
+ * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),
+ * height : 10000.0
+ * });
+ * const geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);
+ */
+ function RectangleOutlineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const rectangle = options.rectangle;
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math$1.CesiumMath.RADIANS_PER_DEGREE
+ );
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ const rotation = defaultValue.defaultValue(options.rotation, 0.0);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(rectangle)) {
+ throw new Check.DeveloperError("rectangle is required.");
+ }
+ Matrix2.Rectangle.validate(rectangle);
+ if (rectangle.north < rectangle.south) {
+ throw new Check.DeveloperError(
+ "options.rectangle.north must be greater than options.rectangle.south"
+ );
+ }
+ //>>includeEnd('debug');
+
+ const height = defaultValue.defaultValue(options.height, 0.0);
+ const extrudedHeight = defaultValue.defaultValue(options.extrudedHeight, height);
+
+ this._rectangle = Matrix2.Rectangle.clone(rectangle);
+ this._granularity = granularity;
+ this._ellipsoid = ellipsoid;
+ this._surfaceHeight = Math.max(height, extrudedHeight);
+ this._rotation = rotation;
+ this._extrudedHeight = Math.min(height, extrudedHeight);
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createRectangleOutlineGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ RectangleOutlineGeometry.packedLength =
+ Matrix2.Rectangle.packedLength + Matrix3.Ellipsoid.packedLength + 5;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {RectangleOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ RectangleOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ Matrix2.Rectangle.pack(value._rectangle, array, startingIndex);
+ startingIndex += Matrix2.Rectangle.packedLength;
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._surfaceHeight;
+ array[startingIndex++] = value._rotation;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex] = defaultValue.defaultValue(value._offsetAttribute, -1);
+
+ return array;
+ };
+
+ const scratchRectangle = new Matrix2.Rectangle();
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchOptions = {
+ rectangle: scratchRectangle,
+ ellipsoid: scratchEllipsoid,
+ granularity: undefined,
+ height: undefined,
+ rotation: undefined,
+ extrudedHeight: undefined,
+ offsetAttribute: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {RectangleOutlineGeometry} [result] The object into which to store the result.
+ * @returns {RectangleOutlineGeometry} The modified result parameter or a new Quaternion instance if one was not provided.
+ */
+ RectangleOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ const rectangle = Matrix2.Rectangle.unpack(array, startingIndex, scratchRectangle);
+ startingIndex += Matrix2.Rectangle.packedLength;
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const granularity = array[startingIndex++];
+ const height = array[startingIndex++];
+ const rotation = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.granularity = granularity;
+ scratchOptions.height = height;
+ scratchOptions.rotation = rotation;
+ scratchOptions.extrudedHeight = extrudedHeight;
+ scratchOptions.offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return new RectangleOutlineGeometry(scratchOptions);
+ }
+
+ result._rectangle = Matrix2.Rectangle.clone(rectangle, result._rectangle);
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._surfaceHeight = height;
+ result._rotation = rotation;
+ result._extrudedHeight = extrudedHeight;
+ result._offsetAttribute =
+ offsetAttribute === -1 ? undefined : offsetAttribute;
+
+ return result;
+ };
+
+ const nwScratch = new Matrix3.Cartographic();
+ /**
+ * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {RectangleOutlineGeometry} rectangleGeometry A description of the rectangle outline.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ *
+ * @exception {DeveloperError} Rotated rectangle is invalid.
+ */
+ RectangleOutlineGeometry.createGeometry = function (rectangleGeometry) {
+ const rectangle = rectangleGeometry._rectangle;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const computedOptions = RectangleGeometryLibrary.RectangleGeometryLibrary.computeOptions(
+ rectangle,
+ rectangleGeometry._granularity,
+ rectangleGeometry._rotation,
+ 0,
+ rectangleScratch,
+ nwScratch
+ );
+
+ let geometry;
+ let boundingSphere;
+
+ if (
+ Math$1.CesiumMath.equalsEpsilon(
+ rectangle.north,
+ rectangle.south,
+ Math$1.CesiumMath.EPSILON10
+ ) ||
+ Math$1.CesiumMath.equalsEpsilon(
+ rectangle.east,
+ rectangle.west,
+ Math$1.CesiumMath.EPSILON10
+ )
+ ) {
+ return undefined;
+ }
+
+ const surfaceHeight = rectangleGeometry._surfaceHeight;
+ const extrudedHeight = rectangleGeometry._extrudedHeight;
+ const extrude = !Math$1.CesiumMath.equalsEpsilon(
+ surfaceHeight,
+ extrudedHeight,
+ 0,
+ Math$1.CesiumMath.EPSILON2
+ );
+ let offsetValue;
+ if (extrude) {
+ geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);
+ if (defaultValue.defined(rectangleGeometry._offsetAttribute)) {
+ const size = geometry.attributes.position.values.length / 3;
+ let offsetAttribute = new Uint8Array(size);
+ if (rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.TOP) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else {
+ offsetValue =
+ rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+
+ geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute,
+ });
+ }
+ const topBS = Transforms.BoundingSphere.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ surfaceHeight,
+ topBoundingSphere
+ );
+ const bottomBS = Transforms.BoundingSphere.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ extrudedHeight,
+ bottomBoundingSphere
+ );
+ boundingSphere = Transforms.BoundingSphere.union(topBS, bottomBS);
+ } else {
+ geometry = constructRectangle(rectangleGeometry, computedOptions);
+ geometry.attributes.position.values = PolygonPipeline.PolygonPipeline.scaleToGeodeticHeight(
+ geometry.attributes.position.values,
+ surfaceHeight,
+ ellipsoid,
+ false
+ );
+
+ if (defaultValue.defined(rectangleGeometry._offsetAttribute)) {
+ const length = geometry.attributes.position.values.length;
+ offsetValue =
+ rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.GeometryOffsetAttribute.NONE
+ ? 0
+ : 1;
+ const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
+ geometry.attributes.applyOffset = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset,
+ });
+ }
+
+ boundingSphere = Transforms.BoundingSphere.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ surfaceHeight
+ );
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: boundingSphere,
+ offsetAttribute: rectangleGeometry._offsetAttribute,
+ });
+ };
+
+ function createRectangleOutlineGeometry(rectangleGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ rectangleGeometry = RectangleOutlineGeometry.unpack(
+ rectangleGeometry,
+ offset
+ );
+ }
+ rectangleGeometry._ellipsoid = Matrix3.Ellipsoid.clone(rectangleGeometry._ellipsoid);
+ rectangleGeometry._rectangle = Matrix2.Rectangle.clone(rectangleGeometry._rectangle);
+ return RectangleOutlineGeometry.createGeometry(rectangleGeometry);
+ }
+
+ return createRectangleOutlineGeometry;
+
+}));
+//# sourceMappingURL=createRectangleOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createRectangleOutlineGeometry.js.map b/examples/cesium/Workers/createRectangleOutlineGeometry.js.map
new file mode 100644
index 0000000..62c37e4
--- /dev/null
+++ b/examples/cesium/Workers/createRectangleOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createRectangleOutlineGeometry.js","sources":["../../../Source/Core/RectangleOutlineGeometry.js","../../../Source/WorkersES6/createRectangleOutlineGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PolygonPipeline from \"./PolygonPipeline.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\nimport RectangleGeometryLibrary from \"./RectangleGeometryLibrary.js\";\r\n\r\nconst bottomBoundingSphere = new BoundingSphere();\r\nconst topBoundingSphere = new BoundingSphere();\r\nconst positionScratch = new Cartesian3();\r\nconst rectangleScratch = new Rectangle();\r\n\r\nfunction constructRectangle(geometry, computedOptions) {\r\n const ellipsoid = geometry._ellipsoid;\r\n const height = computedOptions.height;\r\n const width = computedOptions.width;\r\n const northCap = computedOptions.northCap;\r\n const southCap = computedOptions.southCap;\r\n\r\n let rowHeight = height;\r\n let widthMultiplier = 2;\r\n let size = 0;\r\n let corners = 4;\r\n if (northCap) {\r\n widthMultiplier -= 1;\r\n rowHeight -= 1;\r\n size += 1;\r\n corners -= 2;\r\n }\r\n if (southCap) {\r\n widthMultiplier -= 1;\r\n rowHeight -= 1;\r\n size += 1;\r\n corners -= 2;\r\n }\r\n size += widthMultiplier * width + 2 * rowHeight - corners;\r\n\r\n const positions = new Float64Array(size * 3);\r\n\r\n let posIndex = 0;\r\n let row = 0;\r\n let col;\r\n const position = positionScratch;\r\n if (northCap) {\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n false,\r\n row,\r\n 0,\r\n position\r\n );\r\n positions[posIndex++] = position.x;\r\n positions[posIndex++] = position.y;\r\n positions[posIndex++] = position.z;\r\n } else {\r\n for (col = 0; col < width; col++) {\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n false,\r\n row,\r\n col,\r\n position\r\n );\r\n positions[posIndex++] = position.x;\r\n positions[posIndex++] = position.y;\r\n positions[posIndex++] = position.z;\r\n }\r\n }\r\n\r\n col = width - 1;\r\n for (row = 1; row < height; row++) {\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n false,\r\n row,\r\n col,\r\n position\r\n );\r\n positions[posIndex++] = position.x;\r\n positions[posIndex++] = position.y;\r\n positions[posIndex++] = position.z;\r\n }\r\n\r\n row = height - 1;\r\n if (!southCap) {\r\n // if southCap is true, we dont need to add any more points because the south pole point was added by the iteration above\r\n for (col = width - 2; col >= 0; col--) {\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n false,\r\n row,\r\n col,\r\n position\r\n );\r\n positions[posIndex++] = position.x;\r\n positions[posIndex++] = position.y;\r\n positions[posIndex++] = position.z;\r\n }\r\n }\r\n\r\n col = 0;\r\n for (row = height - 2; row > 0; row--) {\r\n RectangleGeometryLibrary.computePosition(\r\n computedOptions,\r\n ellipsoid,\r\n false,\r\n row,\r\n col,\r\n position\r\n );\r\n positions[posIndex++] = position.x;\r\n positions[posIndex++] = position.y;\r\n positions[posIndex++] = position.z;\r\n }\r\n\r\n const indicesSize = (positions.length / 3) * 2;\r\n const indices = IndexDatatype.createTypedArray(\r\n positions.length / 3,\r\n indicesSize\r\n );\r\n\r\n let index = 0;\r\n for (let i = 0; i < positions.length / 3 - 1; i++) {\r\n indices[index++] = i;\r\n indices[index++] = i + 1;\r\n }\r\n indices[index++] = positions.length / 3 - 1;\r\n indices[index++] = 0;\r\n\r\n const geo = new Geometry({\r\n attributes: new GeometryAttributes(),\r\n primitiveType: PrimitiveType.LINES,\r\n });\r\n\r\n geo.attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n geo.indices = indices;\r\n\r\n return geo;\r\n}\r\n\r\nfunction constructExtrudedRectangle(rectangleGeometry, computedOptions) {\r\n const surfaceHeight = rectangleGeometry._surfaceHeight;\r\n const extrudedHeight = rectangleGeometry._extrudedHeight;\r\n const ellipsoid = rectangleGeometry._ellipsoid;\r\n const minHeight = extrudedHeight;\r\n const maxHeight = surfaceHeight;\r\n const geo = constructRectangle(rectangleGeometry, computedOptions);\r\n\r\n const height = computedOptions.height;\r\n const width = computedOptions.width;\r\n\r\n const topPositions = PolygonPipeline.scaleToGeodeticHeight(\r\n geo.attributes.position.values,\r\n maxHeight,\r\n ellipsoid,\r\n false\r\n );\r\n let length = topPositions.length;\r\n const positions = new Float64Array(length * 2);\r\n positions.set(topPositions);\r\n const bottomPositions = PolygonPipeline.scaleToGeodeticHeight(\r\n geo.attributes.position.values,\r\n minHeight,\r\n ellipsoid\r\n );\r\n positions.set(bottomPositions, length);\r\n geo.attributes.position.values = positions;\r\n\r\n const northCap = computedOptions.northCap;\r\n const southCap = computedOptions.southCap;\r\n let corners = 4;\r\n if (northCap) {\r\n corners -= 1;\r\n }\r\n if (southCap) {\r\n corners -= 1;\r\n }\r\n\r\n const indicesSize = (positions.length / 3 + corners) * 2;\r\n const indices = IndexDatatype.createTypedArray(\r\n positions.length / 3,\r\n indicesSize\r\n );\r\n length = positions.length / 6;\r\n let index = 0;\r\n for (let i = 0; i < length - 1; i++) {\r\n indices[index++] = i;\r\n indices[index++] = i + 1;\r\n indices[index++] = i + length;\r\n indices[index++] = i + length + 1;\r\n }\r\n indices[index++] = length - 1;\r\n indices[index++] = 0;\r\n indices[index++] = length + length - 1;\r\n indices[index++] = length;\r\n\r\n indices[index++] = 0;\r\n indices[index++] = length;\r\n\r\n let bottomCorner;\r\n if (northCap) {\r\n bottomCorner = height - 1;\r\n } else {\r\n const topRightCorner = width - 1;\r\n indices[index++] = topRightCorner;\r\n indices[index++] = topRightCorner + length;\r\n bottomCorner = width + height - 2;\r\n }\r\n\r\n indices[index++] = bottomCorner;\r\n indices[index++] = bottomCorner + length;\r\n\r\n if (!southCap) {\r\n const bottomLeftCorner = width + bottomCorner - 1;\r\n indices[index++] = bottomLeftCorner;\r\n indices[index] = bottomLeftCorner + length;\r\n }\r\n\r\n geo.indices = indices;\r\n\r\n return geo;\r\n}\r\n\r\n/**\r\n * A description of the outline of a a cartographic rectangle on an ellipsoid centered at the origin.\r\n *\r\n * @alias RectangleOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Rectangle} options.rectangle A cartographic rectangle with north, south, east and west properties in radians.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the rectangle lies.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Number} [options.height=0.0] The distance in meters between the rectangle and the ellipsoid surface.\r\n * @param {Number} [options.rotation=0.0] The rotation of the rectangle, in radians. A positive rotation is counter-clockwise.\r\n * @param {Number} [options.extrudedHeight] The distance in meters between the rectangle's extruded face and the ellipsoid surface.\r\n *\r\n * @exception {DeveloperError} options.rectangle.north
must be in the interval [-Pi/2
, Pi/2
].\r\n * @exception {DeveloperError} options.rectangle.south
must be in the interval [-Pi/2
, Pi/2
].\r\n * @exception {DeveloperError} options.rectangle.east
must be in the interval [-Pi
, Pi
].\r\n * @exception {DeveloperError} options.rectangle.west
must be in the interval [-Pi
, Pi
].\r\n * @exception {DeveloperError} options.rectangle.north
must be greater than rectangle.south
.\r\n *\r\n * @see RectangleOutlineGeometry#createGeometry\r\n *\r\n * @example\r\n * const rectangle = new Cesium.RectangleOutlineGeometry({\r\n * ellipsoid : Cesium.Ellipsoid.WGS84,\r\n * rectangle : Cesium.Rectangle.fromDegrees(-80.0, 39.0, -74.0, 42.0),\r\n * height : 10000.0\r\n * });\r\n * const geometry = Cesium.RectangleOutlineGeometry.createGeometry(rectangle);\r\n */\r\nfunction RectangleOutlineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const rectangle = options.rectangle;\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n const rotation = defaultValue(options.rotation, 0.0);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(rectangle)) {\r\n throw new DeveloperError(\"rectangle is required.\");\r\n }\r\n Rectangle.validate(rectangle);\r\n if (rectangle.north < rectangle.south) {\r\n throw new DeveloperError(\r\n \"options.rectangle.north must be greater than options.rectangle.south\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const height = defaultValue(options.height, 0.0);\r\n const extrudedHeight = defaultValue(options.extrudedHeight, height);\r\n\r\n this._rectangle = Rectangle.clone(rectangle);\r\n this._granularity = granularity;\r\n this._ellipsoid = ellipsoid;\r\n this._surfaceHeight = Math.max(height, extrudedHeight);\r\n this._rotation = rotation;\r\n this._extrudedHeight = Math.min(height, extrudedHeight);\r\n this._offsetAttribute = options.offsetAttribute;\r\n this._workerName = \"createRectangleOutlineGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nRectangleOutlineGeometry.packedLength =\r\n Rectangle.packedLength + Ellipsoid.packedLength + 5;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {RectangleOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nRectangleOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n Rectangle.pack(value._rectangle, array, startingIndex);\r\n startingIndex += Rectangle.packedLength;\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n array[startingIndex++] = value._granularity;\r\n array[startingIndex++] = value._surfaceHeight;\r\n array[startingIndex++] = value._rotation;\r\n array[startingIndex++] = value._extrudedHeight;\r\n array[startingIndex] = defaultValue(value._offsetAttribute, -1);\r\n\r\n return array;\r\n};\r\n\r\nconst scratchRectangle = new Rectangle();\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchOptions = {\r\n rectangle: scratchRectangle,\r\n ellipsoid: scratchEllipsoid,\r\n granularity: undefined,\r\n height: undefined,\r\n rotation: undefined,\r\n extrudedHeight: undefined,\r\n offsetAttribute: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {RectangleOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {RectangleOutlineGeometry} The modified result parameter or a new Quaternion instance if one was not provided.\r\n */\r\nRectangleOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n const rectangle = Rectangle.unpack(array, startingIndex, scratchRectangle);\r\n startingIndex += Rectangle.packedLength;\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const granularity = array[startingIndex++];\r\n const height = array[startingIndex++];\r\n const rotation = array[startingIndex++];\r\n const extrudedHeight = array[startingIndex++];\r\n const offsetAttribute = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.granularity = granularity;\r\n scratchOptions.height = height;\r\n scratchOptions.rotation = rotation;\r\n scratchOptions.extrudedHeight = extrudedHeight;\r\n scratchOptions.offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return new RectangleOutlineGeometry(scratchOptions);\r\n }\r\n\r\n result._rectangle = Rectangle.clone(rectangle, result._rectangle);\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._surfaceHeight = height;\r\n result._rotation = rotation;\r\n result._extrudedHeight = extrudedHeight;\r\n result._offsetAttribute =\r\n offsetAttribute === -1 ? undefined : offsetAttribute;\r\n\r\n return result;\r\n};\r\n\r\nconst nwScratch = new Cartographic();\r\n/**\r\n * Computes the geometric representation of an outline of a rectangle, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {RectangleOutlineGeometry} rectangleGeometry A description of the rectangle outline.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n *\r\n * @exception {DeveloperError} Rotated rectangle is invalid.\r\n */\r\nRectangleOutlineGeometry.createGeometry = function (rectangleGeometry) {\r\n const rectangle = rectangleGeometry._rectangle;\r\n const ellipsoid = rectangleGeometry._ellipsoid;\r\n const computedOptions = RectangleGeometryLibrary.computeOptions(\r\n rectangle,\r\n rectangleGeometry._granularity,\r\n rectangleGeometry._rotation,\r\n 0,\r\n rectangleScratch,\r\n nwScratch\r\n );\r\n\r\n let geometry;\r\n let boundingSphere;\r\n\r\n if (\r\n CesiumMath.equalsEpsilon(\r\n rectangle.north,\r\n rectangle.south,\r\n CesiumMath.EPSILON10\r\n ) ||\r\n CesiumMath.equalsEpsilon(\r\n rectangle.east,\r\n rectangle.west,\r\n CesiumMath.EPSILON10\r\n )\r\n ) {\r\n return undefined;\r\n }\r\n\r\n const surfaceHeight = rectangleGeometry._surfaceHeight;\r\n const extrudedHeight = rectangleGeometry._extrudedHeight;\r\n const extrude = !CesiumMath.equalsEpsilon(\r\n surfaceHeight,\r\n extrudedHeight,\r\n 0,\r\n CesiumMath.EPSILON2\r\n );\r\n let offsetValue;\r\n if (extrude) {\r\n geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);\r\n if (defined(rectangleGeometry._offsetAttribute)) {\r\n const size = geometry.attributes.position.values.length / 3;\r\n let offsetAttribute = new Uint8Array(size);\r\n if (rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.TOP) {\r\n offsetAttribute = offsetAttribute.fill(1, 0, size / 2);\r\n } else {\r\n offsetValue =\r\n rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n offsetAttribute = offsetAttribute.fill(offsetValue);\r\n }\r\n\r\n geometry.attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: offsetAttribute,\r\n });\r\n }\r\n const topBS = BoundingSphere.fromRectangle3D(\r\n rectangle,\r\n ellipsoid,\r\n surfaceHeight,\r\n topBoundingSphere\r\n );\r\n const bottomBS = BoundingSphere.fromRectangle3D(\r\n rectangle,\r\n ellipsoid,\r\n extrudedHeight,\r\n bottomBoundingSphere\r\n );\r\n boundingSphere = BoundingSphere.union(topBS, bottomBS);\r\n } else {\r\n geometry = constructRectangle(rectangleGeometry, computedOptions);\r\n geometry.attributes.position.values = PolygonPipeline.scaleToGeodeticHeight(\r\n geometry.attributes.position.values,\r\n surfaceHeight,\r\n ellipsoid,\r\n false\r\n );\r\n\r\n if (defined(rectangleGeometry._offsetAttribute)) {\r\n const length = geometry.attributes.position.values.length;\r\n offsetValue =\r\n rectangleGeometry._offsetAttribute === GeometryOffsetAttribute.NONE\r\n ? 0\r\n : 1;\r\n const applyOffset = new Uint8Array(length / 3).fill(offsetValue);\r\n geometry.attributes.applyOffset = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 1,\r\n values: applyOffset,\r\n });\r\n }\r\n\r\n boundingSphere = BoundingSphere.fromRectangle3D(\r\n rectangle,\r\n ellipsoid,\r\n surfaceHeight\r\n );\r\n }\r\n\r\n return new Geometry({\r\n attributes: geometry.attributes,\r\n indices: geometry.indices,\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: boundingSphere,\r\n offsetAttribute: rectangleGeometry._offsetAttribute,\r\n });\r\n};\r\nexport default RectangleOutlineGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport Rectangle from \"../Core/Rectangle.js\";\r\nimport RectangleOutlineGeometry from \"../Core/RectangleOutlineGeometry.js\";\r\n\r\nfunction createRectangleOutlineGeometry(rectangleGeometry, offset) {\r\n if (defined(offset)) {\r\n rectangleGeometry = RectangleOutlineGeometry.unpack(\r\n rectangleGeometry,\r\n offset\r\n );\r\n }\r\n rectangleGeometry._ellipsoid = Ellipsoid.clone(rectangleGeometry._ellipsoid);\r\n rectangleGeometry._rectangle = Rectangle.clone(rectangleGeometry._rectangle);\r\n return RectangleOutlineGeometry.createGeometry(rectangleGeometry);\r\n}\r\nexport default createRectangleOutlineGeometry;\r\n"],"names":["BoundingSphere","Cartesian3","Rectangle","RectangleGeometryLibrary","IndexDatatype","Geometry","GeometryAttributes","PrimitiveType","GeometryAttribute","ComponentDatatype","PolygonPipeline","defaultValue","CesiumMath","Ellipsoid","defined","DeveloperError","Cartographic","GeometryOffsetAttribute"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBA,MAAM,oBAAoB,GAAG,IAAIA,yBAAc,EAAE,CAAC;EAClD,MAAM,iBAAiB,GAAG,IAAIA,yBAAc,EAAE,CAAC;EAC/C,MAAM,eAAe,G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C,mCAAiB,CAAC,aAAa;EAC1D,QAAQ,sBAAsB,EAAE,CAAC;EACjC,QAAQ,MAAM,EAAE,WAAW;EAC3B,OAAO,CAAC,CAAC;EACT,KAAK;AACL;EACA,IAAI,cAAc,GAAGT,yBAAc,CAAC,eAAe;EACnD,MAAM,SAAS;EACf,MAAM,SAAS;EACf,MAAM,aAAa;EACnB,KAAK,CAAC;EACN,GAAG;AACH;EACA,EAAE,OAAO,IAAIK,0BAAQ,CAAC;EACtB,IAAI,UAAU,EAAE,QAAQ,CAAC,UAAU;EACnC,IAAI,OAAO,EAAE,QAAQ,CAAC,OAAO;EAC7B,IAAI,aAAa,EAAEE,+BAAa,CAAC,KAAK;EACtC,IAAI,cAAc,EAAE,cAAc;EAClC,IAAI,eAAe,EAAE,iBAAiB,CAAC,gBAAgB;EACvD,GAAG,CAAC,CAAC;EACL,CAAC;;EClhBD,SAAS,8BAA8B,CAAC,iBAAiB,EAAE,MAAM,EAAE;EACnE,EAAE,IAAIO,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,iBAAiB,GAAG,wBAAwB,CAAC,MAAM;EACvD,MAAM,iBAAiB;EACvB,MAAM,MAAM;EACZ,KAAK,CAAC;EACN,GAAG;EACH,EAAE,iBAAiB,CAAC,UAAU,GAAGD,iBAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;EAC/E,EAAE,iBAAiB,CAAC,UAAU,GAAGX,iBAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;EAC/E,EAAE,OAAO,wBAAwB,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;EACpE;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createSimplePolylineGeometry.js b/examples/cesium/Workers/createSimplePolylineGeometry.js
new file mode 100644
index 0000000..3c5c6f7
--- /dev/null
+++ b/examples/cesium/Workers/createSimplePolylineGeometry.js
@@ -0,0 +1,484 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './ArcType-d608b872', './Transforms-11fb6b0a', './Color-c019c34b', './ComponentDatatype-13a5630b', './Check-d10e5f2e', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './IndexDatatype-b4e5cf89', './Math-9be8b918', './PolylinePipeline-3c021236', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29', './EllipsoidGeodesic-38d0ed4a', './EllipsoidRhumbLine-48b4507b', './IntersectionTests-2c7928de', './Plane-c9f1487d'], (function (defaultValue, Matrix3, ArcType, Transforms, Color, ComponentDatatype, Check, GeometryAttribute, GeometryAttributes, IndexDatatype, Math, PolylinePipeline, Matrix2, RuntimeError, combine, WebGLConstants, EllipsoidGeodesic, EllipsoidRhumbLine, IntersectionTests, Plane) { 'use strict';
+
+ function interpolateColors(p0, p1, color0, color1, minDistance, array, offset) {
+ const numPoints = PolylinePipeline.PolylinePipeline.numberOfPoints(p0, p1, minDistance);
+ let i;
+
+ const r0 = color0.red;
+ const g0 = color0.green;
+ const b0 = color0.blue;
+ const a0 = color0.alpha;
+
+ const r1 = color1.red;
+ const g1 = color1.green;
+ const b1 = color1.blue;
+ const a1 = color1.alpha;
+
+ if (Color.Color.equals(color0, color1)) {
+ for (i = 0; i < numPoints; i++) {
+ array[offset++] = Color.Color.floatToByte(r0);
+ array[offset++] = Color.Color.floatToByte(g0);
+ array[offset++] = Color.Color.floatToByte(b0);
+ array[offset++] = Color.Color.floatToByte(a0);
+ }
+ return offset;
+ }
+
+ const redPerVertex = (r1 - r0) / numPoints;
+ const greenPerVertex = (g1 - g0) / numPoints;
+ const bluePerVertex = (b1 - b0) / numPoints;
+ const alphaPerVertex = (a1 - a0) / numPoints;
+
+ let index = offset;
+ for (i = 0; i < numPoints; i++) {
+ array[index++] = Color.Color.floatToByte(r0 + i * redPerVertex);
+ array[index++] = Color.Color.floatToByte(g0 + i * greenPerVertex);
+ array[index++] = Color.Color.floatToByte(b0 + i * bluePerVertex);
+ array[index++] = Color.Color.floatToByte(a0 + i * alphaPerVertex);
+ }
+
+ return index;
+ }
+
+ /**
+ * A description of a polyline modeled as a line strip; the first two positions define a line segment,
+ * and each additional position defines a line segment from the previous position.
+ *
+ * @alias SimplePolylineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
+ * @param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.
+ * @param {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
+ * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
+ *
+ * @exception {DeveloperError} At least two positions are required.
+ * @exception {DeveloperError} colors has an invalid length.
+ *
+ * @see SimplePolylineGeometry#createGeometry
+ *
+ * @example
+ * // A polyline with two connected line segments
+ * const polyline = new Cesium.SimplePolylineGeometry({
+ * positions : Cesium.Cartesian3.fromDegreesArray([
+ * 0.0, 0.0,
+ * 5.0, 0.0,
+ * 5.0, 5.0
+ * ])
+ * });
+ * const geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);
+ */
+ function SimplePolylineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const positions = options.positions;
+ const colors = options.colors;
+ const colorsPerVertex = defaultValue.defaultValue(options.colorsPerVertex, false);
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(positions) || positions.length < 2) {
+ throw new Check.DeveloperError("At least two positions are required.");
+ }
+ if (
+ defaultValue.defined(colors) &&
+ ((colorsPerVertex && colors.length < positions.length) ||
+ (!colorsPerVertex && colors.length < positions.length - 1))
+ ) {
+ throw new Check.DeveloperError("colors has an invalid length.");
+ }
+ //>>includeEnd('debug');
+
+ this._positions = positions;
+ this._colors = colors;
+ this._colorsPerVertex = colorsPerVertex;
+
+ this._arcType = defaultValue.defaultValue(options.arcType, ArcType.ArcType.GEODESIC);
+ this._granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math.CesiumMath.RADIANS_PER_DEGREE
+ );
+ this._ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+ this._workerName = "createSimplePolylineGeometry";
+
+ let numComponents = 1 + positions.length * Matrix3.Cartesian3.packedLength;
+ numComponents += defaultValue.defined(colors) ? 1 + colors.length * Color.Color.packedLength : 1;
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength = numComponents + Matrix3.Ellipsoid.packedLength + 3;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {SimplePolylineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ SimplePolylineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ const positions = value._positions;
+ let length = positions.length;
+ array[startingIndex++] = length;
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
+ }
+
+ const colors = value._colors;
+ length = defaultValue.defined(colors) ? colors.length : 0.0;
+ array[startingIndex++] = length;
+
+ for (i = 0; i < length; ++i, startingIndex += Color.Color.packedLength) {
+ Color.Color.pack(colors[i], array, startingIndex);
+ }
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ array[startingIndex++] = value._colorsPerVertex ? 1.0 : 0.0;
+ array[startingIndex++] = value._arcType;
+ array[startingIndex] = value._granularity;
+
+ return array;
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {SimplePolylineGeometry} [result] The object into which to store the result.
+ * @returns {SimplePolylineGeometry} The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.
+ */
+ SimplePolylineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ let length = array[startingIndex++];
+ const positions = new Array(length);
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
+ }
+
+ length = array[startingIndex++];
+ const colors = length > 0 ? new Array(length) : undefined;
+
+ for (i = 0; i < length; ++i, startingIndex += Color.Color.packedLength) {
+ colors[i] = Color.Color.unpack(array, startingIndex);
+ }
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const colorsPerVertex = array[startingIndex++] === 1.0;
+ const arcType = array[startingIndex++];
+ const granularity = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ return new SimplePolylineGeometry({
+ positions: positions,
+ colors: colors,
+ ellipsoid: ellipsoid,
+ colorsPerVertex: colorsPerVertex,
+ arcType: arcType,
+ granularity: granularity,
+ });
+ }
+
+ result._positions = positions;
+ result._colors = colors;
+ result._ellipsoid = ellipsoid;
+ result._colorsPerVertex = colorsPerVertex;
+ result._arcType = arcType;
+ result._granularity = granularity;
+
+ return result;
+ };
+
+ const scratchArray1 = new Array(2);
+ const scratchArray2 = new Array(2);
+ const generateArcOptionsScratch = {
+ positions: scratchArray1,
+ height: scratchArray2,
+ ellipsoid: undefined,
+ minDistance: undefined,
+ granularity: undefined,
+ };
+
+ /**
+ * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {SimplePolylineGeometry} simplePolylineGeometry A description of the polyline.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ SimplePolylineGeometry.createGeometry = function (simplePolylineGeometry) {
+ const positions = simplePolylineGeometry._positions;
+ const colors = simplePolylineGeometry._colors;
+ const colorsPerVertex = simplePolylineGeometry._colorsPerVertex;
+ const arcType = simplePolylineGeometry._arcType;
+ const granularity = simplePolylineGeometry._granularity;
+ const ellipsoid = simplePolylineGeometry._ellipsoid;
+
+ const minDistance = Math.CesiumMath.chordLength(
+ granularity,
+ ellipsoid.maximumRadius
+ );
+ const perSegmentColors = defaultValue.defined(colors) && !colorsPerVertex;
+
+ let i;
+ const length = positions.length;
+
+ let positionValues;
+ let numberOfPositions;
+ let colorValues;
+ let color;
+ let offset = 0;
+
+ if (arcType === ArcType.ArcType.GEODESIC || arcType === ArcType.ArcType.RHUMB) {
+ let subdivisionSize;
+ let numberOfPointsFunction;
+ let generateArcFunction;
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ subdivisionSize = Math.CesiumMath.chordLength(
+ granularity,
+ ellipsoid.maximumRadius
+ );
+ numberOfPointsFunction = PolylinePipeline.PolylinePipeline.numberOfPoints;
+ generateArcFunction = PolylinePipeline.PolylinePipeline.generateArc;
+ } else {
+ subdivisionSize = granularity;
+ numberOfPointsFunction = PolylinePipeline.PolylinePipeline.numberOfPointsRhumbLine;
+ generateArcFunction = PolylinePipeline.PolylinePipeline.generateRhumbArc;
+ }
+
+ const heights = PolylinePipeline.PolylinePipeline.extractHeights(positions, ellipsoid);
+
+ const generateArcOptions = generateArcOptionsScratch;
+ if (arcType === ArcType.ArcType.GEODESIC) {
+ generateArcOptions.minDistance = minDistance;
+ } else {
+ generateArcOptions.granularity = granularity;
+ }
+ generateArcOptions.ellipsoid = ellipsoid;
+
+ if (perSegmentColors) {
+ let positionCount = 0;
+ for (i = 0; i < length - 1; i++) {
+ positionCount +=
+ numberOfPointsFunction(
+ positions[i],
+ positions[i + 1],
+ subdivisionSize
+ ) + 1;
+ }
+
+ positionValues = new Float64Array(positionCount * 3);
+ colorValues = new Uint8Array(positionCount * 4);
+
+ generateArcOptions.positions = scratchArray1;
+ generateArcOptions.height = scratchArray2;
+
+ let ci = 0;
+ for (i = 0; i < length - 1; ++i) {
+ scratchArray1[0] = positions[i];
+ scratchArray1[1] = positions[i + 1];
+
+ scratchArray2[0] = heights[i];
+ scratchArray2[1] = heights[i + 1];
+
+ const pos = generateArcFunction(generateArcOptions);
+
+ if (defaultValue.defined(colors)) {
+ const segLen = pos.length / 3;
+ color = colors[i];
+ for (let k = 0; k < segLen; ++k) {
+ colorValues[ci++] = Color.Color.floatToByte(color.red);
+ colorValues[ci++] = Color.Color.floatToByte(color.green);
+ colorValues[ci++] = Color.Color.floatToByte(color.blue);
+ colorValues[ci++] = Color.Color.floatToByte(color.alpha);
+ }
+ }
+
+ positionValues.set(pos, offset);
+ offset += pos.length;
+ }
+ } else {
+ generateArcOptions.positions = positions;
+ generateArcOptions.height = heights;
+ positionValues = new Float64Array(
+ generateArcFunction(generateArcOptions)
+ );
+
+ if (defaultValue.defined(colors)) {
+ colorValues = new Uint8Array((positionValues.length / 3) * 4);
+
+ for (i = 0; i < length - 1; ++i) {
+ const p0 = positions[i];
+ const p1 = positions[i + 1];
+ const c0 = colors[i];
+ const c1 = colors[i + 1];
+ offset = interpolateColors(
+ p0,
+ p1,
+ c0,
+ c1,
+ minDistance,
+ colorValues,
+ offset
+ );
+ }
+
+ const lastColor = colors[length - 1];
+ colorValues[offset++] = Color.Color.floatToByte(lastColor.red);
+ colorValues[offset++] = Color.Color.floatToByte(lastColor.green);
+ colorValues[offset++] = Color.Color.floatToByte(lastColor.blue);
+ colorValues[offset++] = Color.Color.floatToByte(lastColor.alpha);
+ }
+ }
+ } else {
+ numberOfPositions = perSegmentColors ? length * 2 - 2 : length;
+ positionValues = new Float64Array(numberOfPositions * 3);
+ colorValues = defaultValue.defined(colors)
+ ? new Uint8Array(numberOfPositions * 4)
+ : undefined;
+
+ let positionIndex = 0;
+ let colorIndex = 0;
+
+ for (i = 0; i < length; ++i) {
+ const p = positions[i];
+
+ if (perSegmentColors && i > 0) {
+ Matrix3.Cartesian3.pack(p, positionValues, positionIndex);
+ positionIndex += 3;
+
+ color = colors[i - 1];
+ colorValues[colorIndex++] = Color.Color.floatToByte(color.red);
+ colorValues[colorIndex++] = Color.Color.floatToByte(color.green);
+ colorValues[colorIndex++] = Color.Color.floatToByte(color.blue);
+ colorValues[colorIndex++] = Color.Color.floatToByte(color.alpha);
+ }
+
+ if (perSegmentColors && i === length - 1) {
+ break;
+ }
+
+ Matrix3.Cartesian3.pack(p, positionValues, positionIndex);
+ positionIndex += 3;
+
+ if (defaultValue.defined(colors)) {
+ color = colors[i];
+ colorValues[colorIndex++] = Color.Color.floatToByte(color.red);
+ colorValues[colorIndex++] = Color.Color.floatToByte(color.green);
+ colorValues[colorIndex++] = Color.Color.floatToByte(color.blue);
+ colorValues[colorIndex++] = Color.Color.floatToByte(color.alpha);
+ }
+ }
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positionValues,
+ });
+
+ if (defaultValue.defined(colors)) {
+ attributes.color = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.UNSIGNED_BYTE,
+ componentsPerAttribute: 4,
+ values: colorValues,
+ normalize: true,
+ });
+ }
+
+ numberOfPositions = positionValues.length / 3;
+ const numberOfIndices = (numberOfPositions - 1) * 2;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ numberOfPositions,
+ numberOfIndices
+ );
+
+ let index = 0;
+ for (i = 0; i < numberOfPositions - 1; ++i) {
+ indices[index++] = i;
+ indices[index++] = i + 1;
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: Transforms.BoundingSphere.fromPoints(positions),
+ });
+ };
+
+ function createSimplePolylineGeometry(simplePolylineGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ simplePolylineGeometry = SimplePolylineGeometry.unpack(
+ simplePolylineGeometry,
+ offset
+ );
+ }
+ simplePolylineGeometry._ellipsoid = Matrix3.Ellipsoid.clone(
+ simplePolylineGeometry._ellipsoid
+ );
+ return SimplePolylineGeometry.createGeometry(simplePolylineGeometry);
+ }
+
+ return createSimplePolylineGeometry;
+
+}));
+//# sourceMappingURL=createSimplePolylineGeometry.js.map
diff --git a/examples/cesium/Workers/createSimplePolylineGeometry.js.map b/examples/cesium/Workers/createSimplePolylineGeometry.js.map
new file mode 100644
index 0000000..2bed378
--- /dev/null
+++ b/examples/cesium/Workers/createSimplePolylineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createSimplePolylineGeometry.js","sources":["../../../Source/Core/SimplePolylineGeometry.js","../../../Source/WorkersES6/createSimplePolylineGeometry.js"],"sourcesContent":["import ArcType from \"./ArcType.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Color from \"./Color.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PolylinePipeline from \"./PolylinePipeline.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\n\r\nfunction interpolateColors(p0, p1, color0, color1, minDistance, array, offset) {\r\n const numPoints = PolylinePipeline.numberOfPoints(p0, p1, minDistance);\r\n let i;\r\n\r\n const r0 = color0.red;\r\n const g0 = color0.green;\r\n const b0 = color0.blue;\r\n const a0 = color0.alpha;\r\n\r\n const r1 = color1.red;\r\n const g1 = color1.green;\r\n const b1 = color1.blue;\r\n const a1 = color1.alpha;\r\n\r\n if (Color.equals(color0, color1)) {\r\n for (i = 0; i < numPoints; i++) {\r\n array[offset++] = Color.floatToByte(r0);\r\n array[offset++] = Color.floatToByte(g0);\r\n array[offset++] = Color.floatToByte(b0);\r\n array[offset++] = Color.floatToByte(a0);\r\n }\r\n return offset;\r\n }\r\n\r\n const redPerVertex = (r1 - r0) / numPoints;\r\n const greenPerVertex = (g1 - g0) / numPoints;\r\n const bluePerVertex = (b1 - b0) / numPoints;\r\n const alphaPerVertex = (a1 - a0) / numPoints;\r\n\r\n let index = offset;\r\n for (i = 0; i < numPoints; i++) {\r\n array[index++] = Color.floatToByte(r0 + i * redPerVertex);\r\n array[index++] = Color.floatToByte(g0 + i * greenPerVertex);\r\n array[index++] = Color.floatToByte(b0 + i * bluePerVertex);\r\n array[index++] = Color.floatToByte(a0 + i * alphaPerVertex);\r\n }\r\n\r\n return index;\r\n}\r\n\r\n/**\r\n * A description of a polyline modeled as a line strip; the first two positions define a line segment,\r\n * and each additional position defines a line segment from the previous position.\r\n *\r\n * @alias SimplePolylineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the positions in the polyline as a line strip.\r\n * @param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.\r\n * @param {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.\r\n * @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.\r\n *\r\n * @exception {DeveloperError} At least two positions are required.\r\n * @exception {DeveloperError} colors has an invalid length.\r\n *\r\n * @see SimplePolylineGeometry#createGeometry\r\n *\r\n * @example\r\n * // A polyline with two connected line segments\r\n * const polyline = new Cesium.SimplePolylineGeometry({\r\n * positions : Cesium.Cartesian3.fromDegreesArray([\r\n * 0.0, 0.0,\r\n * 5.0, 0.0,\r\n * 5.0, 5.0\r\n * ])\r\n * });\r\n * const geometry = Cesium.SimplePolylineGeometry.createGeometry(polyline);\r\n */\r\nfunction SimplePolylineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const positions = options.positions;\r\n const colors = options.colors;\r\n const colorsPerVertex = defaultValue(options.colorsPerVertex, false);\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(positions) || positions.length < 2) {\r\n throw new DeveloperError(\"At least two positions are required.\");\r\n }\r\n if (\r\n defined(colors) &&\r\n ((colorsPerVertex && colors.length < positions.length) ||\r\n (!colorsPerVertex && colors.length < positions.length - 1))\r\n ) {\r\n throw new DeveloperError(\"colors has an invalid length.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n this._positions = positions;\r\n this._colors = colors;\r\n this._colorsPerVertex = colorsPerVertex;\r\n\r\n this._arcType = defaultValue(options.arcType, ArcType.GEODESIC);\r\n this._granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n this._ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n this._workerName = \"createSimplePolylineGeometry\";\r\n\r\n let numComponents = 1 + positions.length * Cartesian3.packedLength;\r\n numComponents += defined(colors) ? 1 + colors.length * Color.packedLength : 1;\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength = numComponents + Ellipsoid.packedLength + 3;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {SimplePolylineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nSimplePolylineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n const positions = value._positions;\r\n let length = positions.length;\r\n array[startingIndex++] = length;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n Cartesian3.pack(positions[i], array, startingIndex);\r\n }\r\n\r\n const colors = value._colors;\r\n length = defined(colors) ? colors.length : 0.0;\r\n array[startingIndex++] = length;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\r\n Color.pack(colors[i], array, startingIndex);\r\n }\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n array[startingIndex++] = value._colorsPerVertex ? 1.0 : 0.0;\r\n array[startingIndex++] = value._arcType;\r\n array[startingIndex] = value._granularity;\r\n\r\n return array;\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {SimplePolylineGeometry} [result] The object into which to store the result.\r\n * @returns {SimplePolylineGeometry} The modified result parameter or a new SimplePolylineGeometry instance if one was not provided.\r\n */\r\nSimplePolylineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n let length = array[startingIndex++];\r\n const positions = new Array(length);\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n positions[i] = Cartesian3.unpack(array, startingIndex);\r\n }\r\n\r\n length = array[startingIndex++];\r\n const colors = length > 0 ? new Array(length) : undefined;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Color.packedLength) {\r\n colors[i] = Color.unpack(array, startingIndex);\r\n }\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const colorsPerVertex = array[startingIndex++] === 1.0;\r\n const arcType = array[startingIndex++];\r\n const granularity = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n return new SimplePolylineGeometry({\r\n positions: positions,\r\n colors: colors,\r\n ellipsoid: ellipsoid,\r\n colorsPerVertex: colorsPerVertex,\r\n arcType: arcType,\r\n granularity: granularity,\r\n });\r\n }\r\n\r\n result._positions = positions;\r\n result._colors = colors;\r\n result._ellipsoid = ellipsoid;\r\n result._colorsPerVertex = colorsPerVertex;\r\n result._arcType = arcType;\r\n result._granularity = granularity;\r\n\r\n return result;\r\n};\r\n\r\nconst scratchArray1 = new Array(2);\r\nconst scratchArray2 = new Array(2);\r\nconst generateArcOptionsScratch = {\r\n positions: scratchArray1,\r\n height: scratchArray2,\r\n ellipsoid: undefined,\r\n minDistance: undefined,\r\n granularity: undefined,\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a simple polyline, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {SimplePolylineGeometry} simplePolylineGeometry A description of the polyline.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nSimplePolylineGeometry.createGeometry = function (simplePolylineGeometry) {\r\n const positions = simplePolylineGeometry._positions;\r\n const colors = simplePolylineGeometry._colors;\r\n const colorsPerVertex = simplePolylineGeometry._colorsPerVertex;\r\n const arcType = simplePolylineGeometry._arcType;\r\n const granularity = simplePolylineGeometry._granularity;\r\n const ellipsoid = simplePolylineGeometry._ellipsoid;\r\n\r\n const minDistance = CesiumMath.chordLength(\r\n granularity,\r\n ellipsoid.maximumRadius\r\n );\r\n const perSegmentColors = defined(colors) && !colorsPerVertex;\r\n\r\n let i;\r\n const length = positions.length;\r\n\r\n let positionValues;\r\n let numberOfPositions;\r\n let colorValues;\r\n let color;\r\n let offset = 0;\r\n\r\n if (arcType === ArcType.GEODESIC || arcType === ArcType.RHUMB) {\r\n let subdivisionSize;\r\n let numberOfPointsFunction;\r\n let generateArcFunction;\r\n if (arcType === ArcType.GEODESIC) {\r\n subdivisionSize = CesiumMath.chordLength(\r\n granularity,\r\n ellipsoid.maximumRadius\r\n );\r\n numberOfPointsFunction = PolylinePipeline.numberOfPoints;\r\n generateArcFunction = PolylinePipeline.generateArc;\r\n } else {\r\n subdivisionSize = granularity;\r\n numberOfPointsFunction = PolylinePipeline.numberOfPointsRhumbLine;\r\n generateArcFunction = PolylinePipeline.generateRhumbArc;\r\n }\r\n\r\n const heights = PolylinePipeline.extractHeights(positions, ellipsoid);\r\n\r\n const generateArcOptions = generateArcOptionsScratch;\r\n if (arcType === ArcType.GEODESIC) {\r\n generateArcOptions.minDistance = minDistance;\r\n } else {\r\n generateArcOptions.granularity = granularity;\r\n }\r\n generateArcOptions.ellipsoid = ellipsoid;\r\n\r\n if (perSegmentColors) {\r\n let positionCount = 0;\r\n for (i = 0; i < length - 1; i++) {\r\n positionCount +=\r\n numberOfPointsFunction(\r\n positions[i],\r\n positions[i + 1],\r\n subdivisionSize\r\n ) + 1;\r\n }\r\n\r\n positionValues = new Float64Array(positionCount * 3);\r\n colorValues = new Uint8Array(positionCount * 4);\r\n\r\n generateArcOptions.positions = scratchArray1;\r\n generateArcOptions.height = scratchArray2;\r\n\r\n let ci = 0;\r\n for (i = 0; i < length - 1; ++i) {\r\n scratchArray1[0] = positions[i];\r\n scratchArray1[1] = positions[i + 1];\r\n\r\n scratchArray2[0] = heights[i];\r\n scratchArray2[1] = heights[i + 1];\r\n\r\n const pos = generateArcFunction(generateArcOptions);\r\n\r\n if (defined(colors)) {\r\n const segLen = pos.length / 3;\r\n color = colors[i];\r\n for (let k = 0; k < segLen; ++k) {\r\n colorValues[ci++] = Color.floatToByte(color.red);\r\n colorValues[ci++] = Color.floatToByte(color.green);\r\n colorValues[ci++] = Color.floatToByte(color.blue);\r\n colorValues[ci++] = Color.floatToByte(color.alpha);\r\n }\r\n }\r\n\r\n positionValues.set(pos, offset);\r\n offset += pos.length;\r\n }\r\n } else {\r\n generateArcOptions.positions = positions;\r\n generateArcOptions.height = heights;\r\n positionValues = new Float64Array(\r\n generateArcFunction(generateArcOptions)\r\n );\r\n\r\n if (defined(colors)) {\r\n colorValues = new Uint8Array((positionValues.length / 3) * 4);\r\n\r\n for (i = 0; i < length - 1; ++i) {\r\n const p0 = positions[i];\r\n const p1 = positions[i + 1];\r\n const c0 = colors[i];\r\n const c1 = colors[i + 1];\r\n offset = interpolateColors(\r\n p0,\r\n p1,\r\n c0,\r\n c1,\r\n minDistance,\r\n colorValues,\r\n offset\r\n );\r\n }\r\n\r\n const lastColor = colors[length - 1];\r\n colorValues[offset++] = Color.floatToByte(lastColor.red);\r\n colorValues[offset++] = Color.floatToByte(lastColor.green);\r\n colorValues[offset++] = Color.floatToByte(lastColor.blue);\r\n colorValues[offset++] = Color.floatToByte(lastColor.alpha);\r\n }\r\n }\r\n } else {\r\n numberOfPositions = perSegmentColors ? length * 2 - 2 : length;\r\n positionValues = new Float64Array(numberOfPositions * 3);\r\n colorValues = defined(colors)\r\n ? new Uint8Array(numberOfPositions * 4)\r\n : undefined;\r\n\r\n let positionIndex = 0;\r\n let colorIndex = 0;\r\n\r\n for (i = 0; i < length; ++i) {\r\n const p = positions[i];\r\n\r\n if (perSegmentColors && i > 0) {\r\n Cartesian3.pack(p, positionValues, positionIndex);\r\n positionIndex += 3;\r\n\r\n color = colors[i - 1];\r\n colorValues[colorIndex++] = Color.floatToByte(color.red);\r\n colorValues[colorIndex++] = Color.floatToByte(color.green);\r\n colorValues[colorIndex++] = Color.floatToByte(color.blue);\r\n colorValues[colorIndex++] = Color.floatToByte(color.alpha);\r\n }\r\n\r\n if (perSegmentColors && i === length - 1) {\r\n break;\r\n }\r\n\r\n Cartesian3.pack(p, positionValues, positionIndex);\r\n positionIndex += 3;\r\n\r\n if (defined(colors)) {\r\n color = colors[i];\r\n colorValues[colorIndex++] = Color.floatToByte(color.red);\r\n colorValues[colorIndex++] = Color.floatToByte(color.green);\r\n colorValues[colorIndex++] = Color.floatToByte(color.blue);\r\n colorValues[colorIndex++] = Color.floatToByte(color.alpha);\r\n }\r\n }\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positionValues,\r\n });\r\n\r\n if (defined(colors)) {\r\n attributes.color = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.UNSIGNED_BYTE,\r\n componentsPerAttribute: 4,\r\n values: colorValues,\r\n normalize: true,\r\n });\r\n }\r\n\r\n numberOfPositions = positionValues.length / 3;\r\n const numberOfIndices = (numberOfPositions - 1) * 2;\r\n const indices = IndexDatatype.createTypedArray(\r\n numberOfPositions,\r\n numberOfIndices\r\n );\r\n\r\n let index = 0;\r\n for (i = 0; i < numberOfPositions - 1; ++i) {\r\n indices[index++] = i;\r\n indices[index++] = i + 1;\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: BoundingSphere.fromPoints(positions),\r\n });\r\n};\r\nexport default SimplePolylineGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport SimplePolylineGeometry from \"../Core/SimplePolylineGeometry.js\";\r\n\r\nfunction createSimplePolylineGeometry(simplePolylineGeometry, offset) {\r\n if (defined(offset)) {\r\n simplePolylineGeometry = SimplePolylineGeometry.unpack(\r\n simplePolylineGeometry,\r\n offset\r\n );\r\n }\r\n simplePolylineGeometry._ellipsoid = Ellipsoid.clone(\r\n simplePolylineGeometry._ellipsoid\r\n );\r\n return SimplePolylineGeometry.createGeometry(simplePolylineGeometry);\r\n}\r\nexport default createSimplePolylineGeometry;\r\n"],"names":["PolylinePipeline","Color","defaultValue","defined","DeveloperError","ArcType","CesiumMath","Ellipsoid","Cartesian3","GeometryAttributes","GeometryAttribute","ComponentDatatype","IndexDatatype","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,SAAS,iBAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE;EAC/E,EAAE,MAAM,SAAS,GAAGA,iCAAgB,C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sB,CAAC,UAAU;EACrC,GAAG,CAAC;EACJ,EAAE,OAAO,sBAAsB,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;EACvE;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createSphereGeometry.js b/examples/cesium/Workers/createSphereGeometry.js
new file mode 100644
index 0000000..56313e1
--- /dev/null
+++ b/examples/cesium/Workers/createSphereGeometry.js
@@ -0,0 +1,149 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './Check-d10e5f2e', './EllipsoidGeometry-66510462', './VertexFormat-f2d74c96', './Math-9be8b918', './Transforms-11fb6b0a', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89'], (function (defaultValue, Matrix3, Check, EllipsoidGeometry, VertexFormat, Math, Transforms, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype) { 'use strict';
+
+ /**
+ * A description of a sphere centered at the origin.
+ *
+ * @alias SphereGeometry
+ * @constructor
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {Number} [options.radius=1.0] The radius of the sphere.
+ * @param {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.
+ * @param {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ *
+ * @exception {DeveloperError} options.slicePartitions cannot be less than three.
+ * @exception {DeveloperError} options.stackPartitions cannot be less than three.
+ *
+ * @see SphereGeometry#createGeometry
+ *
+ * @example
+ * const sphere = new Cesium.SphereGeometry({
+ * radius : 100.0,
+ * vertexFormat : Cesium.VertexFormat.POSITION_ONLY
+ * });
+ * const geometry = Cesium.SphereGeometry.createGeometry(sphere);
+ */
+ function SphereGeometry(options) {
+ const radius = defaultValue.defaultValue(options.radius, 1.0);
+ const radii = new Matrix3.Cartesian3(radius, radius, radius);
+ const ellipsoidOptions = {
+ radii: radii,
+ stackPartitions: options.stackPartitions,
+ slicePartitions: options.slicePartitions,
+ vertexFormat: options.vertexFormat,
+ };
+
+ this._ellipsoidGeometry = new EllipsoidGeometry.EllipsoidGeometry(ellipsoidOptions);
+ this._workerName = "createSphereGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ SphereGeometry.packedLength = EllipsoidGeometry.EllipsoidGeometry.packedLength;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {SphereGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ SphereGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ //>>includeEnd('debug');
+
+ return EllipsoidGeometry.EllipsoidGeometry.pack(value._ellipsoidGeometry, array, startingIndex);
+ };
+
+ const scratchEllipsoidGeometry = new EllipsoidGeometry.EllipsoidGeometry();
+ const scratchOptions = {
+ radius: undefined,
+ radii: new Matrix3.Cartesian3(),
+ vertexFormat: new VertexFormat.VertexFormat(),
+ stackPartitions: undefined,
+ slicePartitions: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {SphereGeometry} [result] The object into which to store the result.
+ * @returns {SphereGeometry} The modified result parameter or a new SphereGeometry instance if one was not provided.
+ */
+ SphereGeometry.unpack = function (array, startingIndex, result) {
+ const ellipsoidGeometry = EllipsoidGeometry.EllipsoidGeometry.unpack(
+ array,
+ startingIndex,
+ scratchEllipsoidGeometry
+ );
+ scratchOptions.vertexFormat = VertexFormat.VertexFormat.clone(
+ ellipsoidGeometry._vertexFormat,
+ scratchOptions.vertexFormat
+ );
+ scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions;
+ scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions;
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.radius = ellipsoidGeometry._radii.x;
+ return new SphereGeometry(scratchOptions);
+ }
+
+ Matrix3.Cartesian3.clone(ellipsoidGeometry._radii, scratchOptions.radii);
+ result._ellipsoidGeometry = new EllipsoidGeometry.EllipsoidGeometry(scratchOptions);
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {SphereGeometry} sphereGeometry A description of the sphere.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ SphereGeometry.createGeometry = function (sphereGeometry) {
+ return EllipsoidGeometry.EllipsoidGeometry.createGeometry(sphereGeometry._ellipsoidGeometry);
+ };
+
+ function createSphereGeometry(sphereGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ sphereGeometry = SphereGeometry.unpack(sphereGeometry, offset);
+ }
+ return SphereGeometry.createGeometry(sphereGeometry);
+ }
+
+ return createSphereGeometry;
+
+}));
+//# sourceMappingURL=createSphereGeometry.js.map
diff --git a/examples/cesium/Workers/createSphereGeometry.js.map b/examples/cesium/Workers/createSphereGeometry.js.map
new file mode 100644
index 0000000..cd69945
--- /dev/null
+++ b/examples/cesium/Workers/createSphereGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createSphereGeometry.js","sources":["../../../Source/Core/SphereGeometry.js","../../../Source/WorkersES6/createSphereGeometry.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport EllipsoidGeometry from \"./EllipsoidGeometry.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\n\r\n/**\r\n * A description of a sphere centered at the origin.\r\n *\r\n * @alias SphereGeometry\r\n * @constructor\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {Number} [options.radius=1.0] The radius of the sphere.\r\n * @param {Number} [options.stackPartitions=64] The number of times to partition the ellipsoid into stacks.\r\n * @param {Number} [options.slicePartitions=64] The number of times to partition the ellipsoid into radial slices.\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n *\r\n * @exception {DeveloperError} options.slicePartitions cannot be less than three.\r\n * @exception {DeveloperError} options.stackPartitions cannot be less than three.\r\n *\r\n * @see SphereGeometry#createGeometry\r\n *\r\n * @example\r\n * const sphere = new Cesium.SphereGeometry({\r\n * radius : 100.0,\r\n * vertexFormat : Cesium.VertexFormat.POSITION_ONLY\r\n * });\r\n * const geometry = Cesium.SphereGeometry.createGeometry(sphere);\r\n */\r\nfunction SphereGeometry(options) {\r\n const radius = defaultValue(options.radius, 1.0);\r\n const radii = new Cartesian3(radius, radius, radius);\r\n const ellipsoidOptions = {\r\n radii: radii,\r\n stackPartitions: options.stackPartitions,\r\n slicePartitions: options.slicePartitions,\r\n vertexFormat: options.vertexFormat,\r\n };\r\n\r\n this._ellipsoidGeometry = new EllipsoidGeometry(ellipsoidOptions);\r\n this._workerName = \"createSphereGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nSphereGeometry.packedLength = EllipsoidGeometry.packedLength;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {SphereGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nSphereGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n //>>includeEnd('debug');\r\n\r\n return EllipsoidGeometry.pack(value._ellipsoidGeometry, array, startingIndex);\r\n};\r\n\r\nconst scratchEllipsoidGeometry = new EllipsoidGeometry();\r\nconst scratchOptions = {\r\n radius: undefined,\r\n radii: new Cartesian3(),\r\n vertexFormat: new VertexFormat(),\r\n stackPartitions: undefined,\r\n slicePartitions: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {SphereGeometry} [result] The object into which to store the result.\r\n * @returns {SphereGeometry} The modified result parameter or a new SphereGeometry instance if one was not provided.\r\n */\r\nSphereGeometry.unpack = function (array, startingIndex, result) {\r\n const ellipsoidGeometry = EllipsoidGeometry.unpack(\r\n array,\r\n startingIndex,\r\n scratchEllipsoidGeometry\r\n );\r\n scratchOptions.vertexFormat = VertexFormat.clone(\r\n ellipsoidGeometry._vertexFormat,\r\n scratchOptions.vertexFormat\r\n );\r\n scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions;\r\n scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions;\r\n\r\n if (!defined(result)) {\r\n scratchOptions.radius = ellipsoidGeometry._radii.x;\r\n return new SphereGeometry(scratchOptions);\r\n }\r\n\r\n Cartesian3.clone(ellipsoidGeometry._radii, scratchOptions.radii);\r\n result._ellipsoidGeometry = new EllipsoidGeometry(scratchOptions);\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a sphere, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {SphereGeometry} sphereGeometry A description of the sphere.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nSphereGeometry.createGeometry = function (sphereGeometry) {\r\n return EllipsoidGeometry.createGeometry(sphereGeometry._ellipsoidGeometry);\r\n};\r\nexport default SphereGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport SphereGeometry from \"../Core/SphereGeometry.js\";\r\n\r\nfunction createSphereGeometry(sphereGeometry, offset) {\r\n if (defined(offset)) {\r\n sphereGeometry = SphereGeometry.unpack(sphereGeometry, offset);\r\n }\r\n return SphereGeometry.createGeometry(sphereGeometry);\r\n}\r\nexport default createSphereGeometry;\r\n"],"names":["defaultValue","Cartesian3","EllipsoidGeometry","Check","VertexFormat","defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAOA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,cAAc,CAAC,OAAO,EAAE;EACjC,EAAE,MAAM,MAAM,GAAGA,yBAAY,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;EACnD,EAAE,MAAM,KAAK,GAAG,IAAIC,kBAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;EACvD,EAAE,MAAM,gBAAgB,GAAG;EAC3B,IAAI,KAAK,EAAE,KAAK;EAChB,IAAI,eAAe,EAAE,OAAO,CAAC,eAAe;EAC5C,IAAI,eAAe,EAAE,OAAO,CAAC,eAAe;EAC5C,IAAI,YAAY,EAAE,OAAO,CAAC,YAAY;EACtC,GAAG,CAAC;AACJ;EACA,EAAE,IAAI,CAAC,kBAAkB,GAAG,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AC,gBAAgB,CAAC;EACtE,EAAE,cAAc,CAAC,eAAe,GAAG,iBAAiB,CAAC,gBAAgB,CAAC;AACtE;EACA,EAAE,IAAI,CAACC,oBAAO,CAAC,MAAM,CAAC,EAAE;EACxB,IAAI,cAAc,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;EACvD,IAAI,OAAO,IAAI,cAAc,CAAC,cAAc,CAAC,CAAC;EAC9C,GAAG;AACH;EACA,EAAEJ,kBAAU,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;EACnE,EAAE,MAAM,CAAC,kBAAkB,GAAG,IAAIC,mCAAiB,CAAC,cAAc,CAAC,CAAC;EACpE,EAAE,OAAO,MAAM,CAAC;EAChB,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc,CAAC,cAAc,GAAG,UAAU,cAAc,EAAE;EAC1D,EAAE,OAAOA,mCAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;EAC7E,CAAC;;ECjHD,SAAS,oBAAoB,CAAC,cAAc,EAAE,MAAM,EAAE;EACtD,EAAE,IAAIG,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,cAAc,GAAG,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;EACnE,GAAG;EACH,EAAE,OAAO,cAAc,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;EACvD;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createSphereOutlineGeometry.js b/examples/cesium/Workers/createSphereOutlineGeometry.js
new file mode 100644
index 0000000..cd1e58b
--- /dev/null
+++ b/examples/cesium/Workers/createSphereOutlineGeometry.js
@@ -0,0 +1,152 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './Check-d10e5f2e', './EllipsoidOutlineGeometry-c18e3c42', './Math-9be8b918', './Transforms-11fb6b0a', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './IndexDatatype-b4e5cf89'], (function (defaultValue, Matrix3, Check, EllipsoidOutlineGeometry, Math, Transforms, Matrix2, RuntimeError, combine, ComponentDatatype, WebGLConstants, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, IndexDatatype) { 'use strict';
+
+ /**
+ * A description of the outline of a sphere.
+ *
+ * @alias SphereOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} [options] Object with the following properties:
+ * @param {Number} [options.radius=1.0] The radius of the sphere.
+ * @param {Number} [options.stackPartitions=10] The count of stacks for the sphere (1 greater than the number of parallel lines).
+ * @param {Number} [options.slicePartitions=8] The count of slices for the sphere (Equal to the number of radial lines).
+ * @param {Number} [options.subdivisions=200] The number of points per line, determining the granularity of the curvature .
+ *
+ * @exception {DeveloperError} options.stackPartitions must be greater than or equal to one.
+ * @exception {DeveloperError} options.slicePartitions must be greater than or equal to zero.
+ * @exception {DeveloperError} options.subdivisions must be greater than or equal to zero.
+ *
+ * @example
+ * const sphere = new Cesium.SphereOutlineGeometry({
+ * radius : 100.0,
+ * stackPartitions : 6,
+ * slicePartitions: 5
+ * });
+ * const geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);
+ */
+ function SphereOutlineGeometry(options) {
+ const radius = defaultValue.defaultValue(options.radius, 1.0);
+ const radii = new Matrix3.Cartesian3(radius, radius, radius);
+ const ellipsoidOptions = {
+ radii: radii,
+ stackPartitions: options.stackPartitions,
+ slicePartitions: options.slicePartitions,
+ subdivisions: options.subdivisions,
+ };
+
+ this._ellipsoidGeometry = new EllipsoidOutlineGeometry.EllipsoidOutlineGeometry(ellipsoidOptions);
+ this._workerName = "createSphereOutlineGeometry";
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ SphereOutlineGeometry.packedLength = EllipsoidOutlineGeometry.EllipsoidOutlineGeometry.packedLength;
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {SphereOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ SphereOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("value", value);
+ //>>includeEnd('debug');
+
+ return EllipsoidOutlineGeometry.EllipsoidOutlineGeometry.pack(
+ value._ellipsoidGeometry,
+ array,
+ startingIndex
+ );
+ };
+
+ const scratchEllipsoidGeometry = new EllipsoidOutlineGeometry.EllipsoidOutlineGeometry();
+ const scratchOptions = {
+ radius: undefined,
+ radii: new Matrix3.Cartesian3(),
+ stackPartitions: undefined,
+ slicePartitions: undefined,
+ subdivisions: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {SphereOutlineGeometry} [result] The object into which to store the result.
+ * @returns {SphereOutlineGeometry} The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.
+ */
+ SphereOutlineGeometry.unpack = function (array, startingIndex, result) {
+ const ellipsoidGeometry = EllipsoidOutlineGeometry.EllipsoidOutlineGeometry.unpack(
+ array,
+ startingIndex,
+ scratchEllipsoidGeometry
+ );
+ scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions;
+ scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions;
+ scratchOptions.subdivisions = ellipsoidGeometry._subdivisions;
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.radius = ellipsoidGeometry._radii.x;
+ return new SphereOutlineGeometry(scratchOptions);
+ }
+
+ Matrix3.Cartesian3.clone(ellipsoidGeometry._radii, scratchOptions.radii);
+ result._ellipsoidGeometry = new EllipsoidOutlineGeometry.EllipsoidOutlineGeometry(scratchOptions);
+ return result;
+ };
+
+ /**
+ * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {SphereOutlineGeometry} sphereGeometry A description of the sphere outline.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ SphereOutlineGeometry.createGeometry = function (sphereGeometry) {
+ return EllipsoidOutlineGeometry.EllipsoidOutlineGeometry.createGeometry(
+ sphereGeometry._ellipsoidGeometry
+ );
+ };
+
+ function createSphereOutlineGeometry(sphereGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ sphereGeometry = SphereOutlineGeometry.unpack(sphereGeometry, offset);
+ }
+ return SphereOutlineGeometry.createGeometry(sphereGeometry);
+ }
+
+ return createSphereOutlineGeometry;
+
+}));
+//# sourceMappingURL=createSphereOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createSphereOutlineGeometry.js.map b/examples/cesium/Workers/createSphereOutlineGeometry.js.map
new file mode 100644
index 0000000..9abf635
--- /dev/null
+++ b/examples/cesium/Workers/createSphereOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createSphereOutlineGeometry.js","sources":["../../../Source/Core/SphereOutlineGeometry.js","../../../Source/WorkersES6/createSphereOutlineGeometry.js"],"sourcesContent":["import Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport EllipsoidOutlineGeometry from \"./EllipsoidOutlineGeometry.js\";\r\n\r\n/**\r\n * A description of the outline of a sphere.\r\n *\r\n * @alias SphereOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} [options] Object with the following properties:\r\n * @param {Number} [options.radius=1.0] The radius of the sphere.\r\n * @param {Number} [options.stackPartitions=10] The count of stacks for the sphere (1 greater than the number of parallel lines).\r\n * @param {Number} [options.slicePartitions=8] The count of slices for the sphere (Equal to the number of radial lines).\r\n * @param {Number} [options.subdivisions=200] The number of points per line, determining the granularity of the curvature .\r\n *\r\n * @exception {DeveloperError} options.stackPartitions must be greater than or equal to one.\r\n * @exception {DeveloperError} options.slicePartitions must be greater than or equal to zero.\r\n * @exception {DeveloperError} options.subdivisions must be greater than or equal to zero.\r\n *\r\n * @example\r\n * const sphere = new Cesium.SphereOutlineGeometry({\r\n * radius : 100.0,\r\n * stackPartitions : 6,\r\n * slicePartitions: 5\r\n * });\r\n * const geometry = Cesium.SphereOutlineGeometry.createGeometry(sphere);\r\n */\r\nfunction SphereOutlineGeometry(options) {\r\n const radius = defaultValue(options.radius, 1.0);\r\n const radii = new Cartesian3(radius, radius, radius);\r\n const ellipsoidOptions = {\r\n radii: radii,\r\n stackPartitions: options.stackPartitions,\r\n slicePartitions: options.slicePartitions,\r\n subdivisions: options.subdivisions,\r\n };\r\n\r\n this._ellipsoidGeometry = new EllipsoidOutlineGeometry(ellipsoidOptions);\r\n this._workerName = \"createSphereOutlineGeometry\";\r\n}\r\n\r\n/**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\nSphereOutlineGeometry.packedLength = EllipsoidOutlineGeometry.packedLength;\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {SphereOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nSphereOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"value\", value);\r\n //>>includeEnd('debug');\r\n\r\n return EllipsoidOutlineGeometry.pack(\r\n value._ellipsoidGeometry,\r\n array,\r\n startingIndex\r\n );\r\n};\r\n\r\nconst scratchEllipsoidGeometry = new EllipsoidOutlineGeometry();\r\nconst scratchOptions = {\r\n radius: undefined,\r\n radii: new Cartesian3(),\r\n stackPartitions: undefined,\r\n slicePartitions: undefined,\r\n subdivisions: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {SphereOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {SphereOutlineGeometry} The modified result parameter or a new SphereOutlineGeometry instance if one was not provided.\r\n */\r\nSphereOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n const ellipsoidGeometry = EllipsoidOutlineGeometry.unpack(\r\n array,\r\n startingIndex,\r\n scratchEllipsoidGeometry\r\n );\r\n scratchOptions.stackPartitions = ellipsoidGeometry._stackPartitions;\r\n scratchOptions.slicePartitions = ellipsoidGeometry._slicePartitions;\r\n scratchOptions.subdivisions = ellipsoidGeometry._subdivisions;\r\n\r\n if (!defined(result)) {\r\n scratchOptions.radius = ellipsoidGeometry._radii.x;\r\n return new SphereOutlineGeometry(scratchOptions);\r\n }\r\n\r\n Cartesian3.clone(ellipsoidGeometry._radii, scratchOptions.radii);\r\n result._ellipsoidGeometry = new EllipsoidOutlineGeometry(scratchOptions);\r\n return result;\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of an outline of a sphere, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {SphereOutlineGeometry} sphereGeometry A description of the sphere outline.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nSphereOutlineGeometry.createGeometry = function (sphereGeometry) {\r\n return EllipsoidOutlineGeometry.createGeometry(\r\n sphereGeometry._ellipsoidGeometry\r\n );\r\n};\r\nexport default SphereOutlineGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport SphereOutlineGeometry from \"../Core/SphereOutlineGeometry.js\";\r\n\r\nfunction createSphereOutlineGeometry(sphereGeometry, offset) {\r\n if (defined(offset)) {\r\n sphereGeometry = SphereOutlineGeometry.unpack(sphereGeometry, offset);\r\n }\r\n return SphereOutlineGeometry.createGeometry(sphereGeometry);\r\n}\r\nexport default createSphereOutlineGeometry;\r\n"],"names":["defaultValue","Cartesian3","EllipsoidOutlineGeometry","Check","defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,qBAAqB,CAAC,OAAO,EAAE;EACxC,EAAE,MAAM,MAAM,GAAGA,yBAAY,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;EACnD,EAAE,MAAM,KAAK,GAAG,IAAIC,kBAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;EACvD,EAAE,MAAM,gBAAgB,GAAG;EAC3B,IAAI,KAAK,EAAE,KAAK;EAChB,IAAI,eAAe,EAAE,OAAO,CAAC,eAAe;EAC5C,IAAI,eAAe,EAAE,OAAO,CAAC,eAAe;EAC5C,IAAI,YAAY,EAAE,OAAO,CAAC,YAAY;EACtC,GAAG,CAAC;AACJ;EACA,EAAE,IAAI,CAAC,kBAAkB,GAAG,IAAIC,iDAAwB,CAAC,gBAAgB,CAAC,CAAC;EAC3E,EAAE,IAAI,CAAC,WAAW,GAAG,6BAA6B,CAAC;EACnD,CAAC;AACD;EAC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,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;EACvD,IAAI,OAAO,IAAI,qBAAqB,CAAC,cAAc,CAAC,CAAC;EACrD,GAAG;AACH;EACA,EAAEH,kBAAU,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;EACnE,EAAE,MAAM,CAAC,kBAAkB,GAAG,IAAIC,iDAAwB,CAAC,cAAc,CAAC,CAAC;EAC3E,EAAE,OAAO,MAAM,CAAC;EAChB,CAAC,CAAC;AACF;EACA;EACA;EACA;EACA;EACA;EACA;EACA,qBAAqB,CAAC,cAAc,GAAG,UAAU,cAAc,EAAE;EACjE,EAAE,OAAOA,iDAAwB,CAAC,cAAc;EAChD,IAAI,cAAc,CAAC,kBAAkB;EACrC,GAAG,CAAC;EACJ,CAAC;;ECnHD,SAAS,2BAA2B,CAAC,cAAc,EAAE,MAAM,EAAE;EAC7D,EAAE,IAAIE,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,cAAc,GAAG,qBAAqB,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;EAC1E,GAAG;EACH,EAAE,OAAO,qBAAqB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;EAC9D;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createTaskProcessorWorker.js b/examples/cesium/Workers/createTaskProcessorWorker.js
new file mode 100644
index 0000000..a10e059
--- /dev/null
+++ b/examples/cesium/Workers/createTaskProcessorWorker.js
@@ -0,0 +1,153 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d'], (function (defaultValue) { 'use strict';
+
+ /**
+ * Formats an error object into a String. If available, uses name, message, and stack
+ * properties, otherwise, falls back on toString().
+ *
+ * @function
+ *
+ * @param {*} object The item to find in the array.
+ * @returns {String} A string containing the formatted error.
+ */
+ function formatError(object) {
+ let result;
+
+ const name = object.name;
+ const message = object.message;
+ if (defaultValue.defined(name) && defaultValue.defined(message)) {
+ result = `${name}: ${message}`;
+ } else {
+ result = object.toString();
+ }
+
+ const stack = object.stack;
+ if (defaultValue.defined(stack)) {
+ result += `\n${stack}`;
+ }
+
+ return result;
+ }
+
+ // createXXXGeometry functions may return Geometry or a Promise that resolves to Geometry
+ // if the function requires access to ApproximateTerrainHeights.
+ // For fully synchronous functions, just wrapping the function call in a Promise doesn't
+ // handle errors correctly, hence try-catch
+ function callAndWrap(workerFunction, parameters, transferableObjects) {
+ let resultOrPromise;
+ try {
+ resultOrPromise = workerFunction(parameters, transferableObjects);
+ return resultOrPromise; // errors handled by Promise
+ } catch (e) {
+ return Promise.reject(e);
+ }
+ }
+
+ /**
+ * Creates an adapter function to allow a calculation function to operate as a Web Worker,
+ * paired with TaskProcessor, to receive tasks and return results.
+ *
+ * @function createTaskProcessorWorker
+ *
+ * @param {createTaskProcessorWorker.WorkerFunction} workerFunction The calculation function,
+ * which takes parameters and returns a result.
+ * @returns {createTaskProcessorWorker.TaskProcessorWorkerFunction} A function that adapts the
+ * calculation function to work as a Web Worker onmessage listener with TaskProcessor.
+ *
+ *
+ * @example
+ * function doCalculation(parameters, transferableObjects) {
+ * // calculate some result using the inputs in parameters
+ * return result;
+ * }
+ *
+ * return Cesium.createTaskProcessorWorker(doCalculation);
+ * // the resulting function is compatible with TaskProcessor
+ *
+ * @see TaskProcessor
+ * @see {@link http://www.w3.org/TR/workers/|Web Workers}
+ * @see {@link http://www.w3.org/TR/html5/common-dom-interfaces.html#transferable-objects|Transferable objects}
+ */
+ function createTaskProcessorWorker(workerFunction) {
+ let postMessage;
+
+ return function (event) {
+ const data = event.data;
+
+ const transferableObjects = [];
+ const responseMessage = {
+ id: data.id,
+ result: undefined,
+ error: undefined,
+ };
+
+ return Promise.resolve(
+ callAndWrap(workerFunction, data.parameters, transferableObjects)
+ )
+ .then(function (result) {
+ responseMessage.result = result;
+ })
+ .catch(function (e) {
+ if (e instanceof Error) {
+ // Errors can't be posted in a message, copy the properties
+ responseMessage.error = {
+ name: e.name,
+ message: e.message,
+ stack: e.stack,
+ };
+ } else {
+ responseMessage.error = e;
+ }
+ })
+ .finally(function () {
+ if (!defaultValue.defined(postMessage)) {
+ postMessage = defaultValue.defaultValue(self.webkitPostMessage, self.postMessage);
+ }
+
+ if (!data.canTransferArrayBuffer) {
+ transferableObjects.length = 0;
+ }
+
+ try {
+ postMessage(responseMessage, transferableObjects);
+ } catch (e) {
+ // something went wrong trying to post the message, post a simpler
+ // error that we can be sure will be cloneable
+ responseMessage.result = undefined;
+ responseMessage.error = `postMessage failed with error: ${formatError(
+ e
+ )}\n with responseMessage: ${JSON.stringify(responseMessage)}`;
+ postMessage(responseMessage);
+ }
+ });
+ };
+ }
+
+ return createTaskProcessorWorker;
+
+}));
+//# sourceMappingURL=createTaskProcessorWorker.js.map
diff --git a/examples/cesium/Workers/createTaskProcessorWorker.js.map b/examples/cesium/Workers/createTaskProcessorWorker.js.map
new file mode 100644
index 0000000..2c6109f
--- /dev/null
+++ b/examples/cesium/Workers/createTaskProcessorWorker.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createTaskProcessorWorker.js","sources":["../../../Source/Core/formatError.js","../../../Source/WorkersES6/createTaskProcessorWorker.js"],"sourcesContent":["import defined from \"./defined.js\";\r\n\r\n/**\r\n * Formats an error object into a String. If available, uses name, message, and stack\r\n * properties, otherwise, falls back on toString().\r\n *\r\n * @function\r\n *\r\n * @param {*} object The item to find in the array.\r\n * @returns {String} A string containing the formatted error.\r\n */\r\nfunction formatError(object) {\r\n let result;\r\n\r\n const name = object.name;\r\n const message = object.message;\r\n if (defined(name) && defined(message)) {\r\n result = `${name}: ${message}`;\r\n } else {\r\n result = object.toString();\r\n }\r\n\r\n const stack = object.stack;\r\n if (defined(stack)) {\r\n result += `\\n${stack}`;\r\n }\r\n\r\n return result;\r\n}\r\nexport default formatError;\r\n","import defaultValue from \"../Core/defaultValue.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport formatError from \"../Core/formatError.js\";\r\n\r\n// createXXXGeometry functions may return Geometry or a Promise that resolves to Geometry\r\n// if the function requires access to ApproximateTerrainHeights.\r\n// For fully synchronous functions, just wrapping the function call in a Promise doesn't\r\n// handle errors correctly, hence try-catch\r\nfunction callAndWrap(workerFunction, parameters, transferableObjects) {\r\n let resultOrPromise;\r\n try {\r\n resultOrPromise = workerFunction(parameters, transferableObjects);\r\n return resultOrPromise; // errors handled by Promise\r\n } catch (e) {\r\n return Promise.reject(e);\r\n }\r\n}\r\n\r\n/**\r\n * Creates an adapter function to allow a calculation function to operate as a Web Worker,\r\n * paired with TaskProcessor, to receive tasks and return results.\r\n *\r\n * @function createTaskProcessorWorker\r\n *\r\n * @param {createTaskProcessorWorker.WorkerFunction} workerFunction The calculation function,\r\n * which takes parameters and returns a result.\r\n * @returns {createTaskProcessorWorker.TaskProcessorWorkerFunction} A function that adapts the\r\n * calculation function to work as a Web Worker onmessage listener with TaskProcessor.\r\n *\r\n *\r\n * @example\r\n * function doCalculation(parameters, transferableObjects) {\r\n * // calculate some result using the inputs in parameters\r\n * return result;\r\n * }\r\n *\r\n * return Cesium.createTaskProcessorWorker(doCalculation);\r\n * // the resulting function is compatible with TaskProcessor\r\n *\r\n * @see TaskProcessor\r\n * @see {@link http://www.w3.org/TR/workers/|Web Workers}\r\n * @see {@link http://www.w3.org/TR/html5/common-dom-interfaces.html#transferable-objects|Transferable objects}\r\n */\r\nfunction createTaskProcessorWorker(workerFunction) {\r\n let postMessage;\r\n\r\n return function (event) {\r\n const data = event.data;\r\n\r\n const transferableObjects = [];\r\n const responseMessage = {\r\n id: data.id,\r\n result: undefined,\r\n error: undefined,\r\n };\r\n\r\n return Promise.resolve(\r\n callAndWrap(workerFunction, data.parameters, transferableObjects)\r\n )\r\n .then(function (result) {\r\n responseMessage.result = result;\r\n })\r\n .catch(function (e) {\r\n if (e instanceof Error) {\r\n // Errors can't be posted in a message, copy the properties\r\n responseMessage.error = {\r\n name: e.name,\r\n message: e.message,\r\n stack: e.stack,\r\n };\r\n } else {\r\n responseMessage.error = e;\r\n }\r\n })\r\n .finally(function () {\r\n if (!defined(postMessage)) {\r\n postMessage = defaultValue(self.webkitPostMessage, self.postMessage);\r\n }\r\n\r\n if (!data.canTransferArrayBuffer) {\r\n transferableObjects.length = 0;\r\n }\r\n\r\n try {\r\n postMessage(responseMessage, transferableObjects);\r\n } catch (e) {\r\n // something went wrong trying to post the message, post a simpler\r\n // error that we can be sure will be cloneable\r\n responseMessage.result = undefined;\r\n responseMessage.error = `postMessage failed with error: ${formatError(\r\n e\r\n )}\\n with responseMessage: ${JSON.stringify(responseMessage)}`;\r\n postMessage(responseMessage);\r\n }\r\n });\r\n };\r\n}\r\n\r\n/**\r\n * A function that performs a calculation in a Web Worker.\r\n * @callback createTaskProcessorWorker.WorkerFunction\r\n *\r\n * @param {Object} parameters Parameters to the calculation.\r\n * @param {Array} transferableObjects An array that should be filled with references to objects inside\r\n * the result that should be transferred back to the main document instead of copied.\r\n * @returns {Object} The result of the calculation.\r\n *\r\n * @example\r\n * function calculate(parameters, transferableObjects) {\r\n * // perform whatever calculation is necessary.\r\n * const typedArray = new Float32Array(0);\r\n *\r\n * // typed arrays are transferable\r\n * transferableObjects.push(typedArray)\r\n *\r\n * return {\r\n * typedArray : typedArray\r\n * };\r\n * }\r\n */\r\n\r\n/**\r\n * A Web Worker message event handler function that handles the interaction with TaskProcessor,\r\n * specifically, task ID management and posting a response message containing the result.\r\n * @callback createTaskProcessorWorker.TaskProcessorWorkerFunction\r\n *\r\n * @param {Object} event The onmessage event object.\r\n */\r\nexport default createTaskProcessorWorker;\r\n"],"names":["defined","defaultValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,WAAW,CAAC,MAAM,EAAE;EAC7B,EAAE,IAAI,MAAM,CAAC;AACb;EACA,EAAE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;EAC3B,EAAE,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;EACjC,EAAE,IAAIA,oBAAO,CAAC,IAAI,CAAC,IAAIA,oBAAO,CAAC,OAAO,CAAC,EAAE;EACzC,IAAI,MAAM,GAAG,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;EACnC,GAAG,MAAM;EACT,IAAI,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;EAC/B,GAAG;AACH;EACA,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;EAC7B,EAAE,IAAIA,oBAAO,CAAC,KAAK,CAAC,EAAE;EACtB,IAAI,MAAM,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;EAC3B,GAAG;AACH;EACA,EAAE,OAAO,MAAM,CAAC;EAChB;;ECxBA;EACA;EACA;EACA;EACA,SAAS,WAAW,CAAC,cAAc,EAAE,UAAU,EAAE,mBAAmB,EAAE;EACtE,EAAE,IAAI,eAAe,CAAC;EACtB,EAAE,IAAI;EACN,IAAI,eAAe,GAAG,cAAc,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;EACtE,IAAI,OAAO,eAAe,CAAC;EAC3B,GAAG,CAAC,OAAO,CAAC,EAAE;EACd,IA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,CAAC,WAAW,CAAC,EAAE;EACnC,UAAU,WAAW,GAAGC,yBAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;EAC/E,SAAS;AACT;EACA,QAAQ,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE;EAC1C,UAAU,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC;EACzC,SAAS;AACT;EACA,QAAQ,IAAI;EACZ,UAAU,WAAW,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;EAC5D,SAAS,CAAC,OAAO,CAAC,EAAE;EACpB;EACA;EACA,UAAU,eAAe,CAAC,MAAM,GAAG,SAAS,CAAC;EAC7C,UAAU,eAAe,CAAC,KAAK,GAAG,CAAC,+BAA+B,EAAE,WAAW;AAC/E,YAAY,CAAC;AACb,WAAW,CAAC,0BAA0B,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;EAC1E,UAAU,WAAW,CAAC,eAAe,CAAC,CAAC;EACvC,SAAS;EACT,OAAO,CAAC,CAAC;EACT,GAAG,CAAC;EACJ;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createVectorTileClampedPolylines.js b/examples/cesium/Workers/createVectorTileClampedPolylines.js
new file mode 100644
index 0000000..46b1c33
--- /dev/null
+++ b/examples/cesium/Workers/createVectorTileClampedPolylines.js
@@ -0,0 +1,561 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./AttributeCompression-e9888cb8', './Matrix3-f22b0303', './combine-4598d225', './IndexDatatype-b4e5cf89', './Math-9be8b918', './Matrix2-036c77dd', './createTaskProcessorWorker', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './Check-d10e5f2e', './WebGLConstants-f27a5e29', './RuntimeError-e5c6a8b9'], (function (AttributeCompression, Matrix3, combine, IndexDatatype, Math$1, Matrix2, createTaskProcessorWorker, ComponentDatatype, defaultValue, Check, WebGLConstants, RuntimeError) { 'use strict';
+
+ const MAX_SHORT = 32767;
+ const MITER_BREAK = Math.cos(Math$1.CesiumMath.toRadians(150.0));
+
+ const scratchBVCartographic = new Matrix3.Cartographic();
+ const scratchEncodedPosition = new Matrix3.Cartesian3();
+
+ function decodePositions(
+ uBuffer,
+ vBuffer,
+ heightBuffer,
+ rectangle,
+ minimumHeight,
+ maximumHeight,
+ ellipsoid
+ ) {
+ const positionsLength = uBuffer.length;
+ const decodedPositions = new Float64Array(positionsLength * 3);
+ for (let i = 0; i < positionsLength; ++i) {
+ const u = uBuffer[i];
+ const v = vBuffer[i];
+ const h = heightBuffer[i];
+
+ const lon = Math$1.CesiumMath.lerp(rectangle.west, rectangle.east, u / MAX_SHORT);
+ const lat = Math$1.CesiumMath.lerp(
+ rectangle.south,
+ rectangle.north,
+ v / MAX_SHORT
+ );
+ const alt = Math$1.CesiumMath.lerp(minimumHeight, maximumHeight, h / MAX_SHORT);
+
+ const cartographic = Matrix3.Cartographic.fromRadians(
+ lon,
+ lat,
+ alt,
+ scratchBVCartographic
+ );
+ const decodedPosition = ellipsoid.cartographicToCartesian(
+ cartographic,
+ scratchEncodedPosition
+ );
+ Matrix3.Cartesian3.pack(decodedPosition, decodedPositions, i * 3);
+ }
+ return decodedPositions;
+ }
+
+ function getPositionOffsets(counts) {
+ const countsLength = counts.length;
+ const positionOffsets = new Uint32Array(countsLength + 1);
+ let offset = 0;
+ for (let i = 0; i < countsLength; ++i) {
+ positionOffsets[i] = offset;
+ offset += counts[i];
+ }
+ positionOffsets[countsLength] = offset;
+ return positionOffsets;
+ }
+
+ const previousCompressedCartographicScratch = new Matrix3.Cartographic();
+ const currentCompressedCartographicScratch = new Matrix3.Cartographic();
+ function removeDuplicates(uBuffer, vBuffer, heightBuffer, counts) {
+ const countsLength = counts.length;
+ const positionsLength = uBuffer.length;
+ const markRemoval = new Uint8Array(positionsLength);
+ const previous = previousCompressedCartographicScratch;
+ const current = currentCompressedCartographicScratch;
+ let offset = 0;
+ for (let i = 0; i < countsLength; i++) {
+ const count = counts[i];
+ let updatedCount = count;
+ for (let j = 1; j < count; j++) {
+ const index = offset + j;
+ const previousIndex = index - 1;
+ current.longitude = uBuffer[index];
+ current.latitude = vBuffer[index];
+ previous.longitude = uBuffer[previousIndex];
+ previous.latitude = vBuffer[previousIndex];
+
+ if (Matrix3.Cartographic.equals(current, previous)) {
+ updatedCount--;
+ markRemoval[previousIndex] = 1;
+ }
+ }
+ counts[i] = updatedCount;
+ offset += count;
+ }
+
+ let nextAvailableIndex = 0;
+ for (let k = 0; k < positionsLength; k++) {
+ if (markRemoval[k] !== 1) {
+ uBuffer[nextAvailableIndex] = uBuffer[k];
+ vBuffer[nextAvailableIndex] = vBuffer[k];
+ heightBuffer[nextAvailableIndex] = heightBuffer[k];
+ nextAvailableIndex++;
+ }
+ }
+ }
+
+ function VertexAttributesAndIndices(volumesCount) {
+ const vertexCount = volumesCount * 8;
+ const vec3Floats = vertexCount * 3;
+ const vec4Floats = vertexCount * 4;
+ this.startEllipsoidNormals = new Float32Array(vec3Floats);
+ this.endEllipsoidNormals = new Float32Array(vec3Floats);
+ this.startPositionAndHeights = new Float32Array(vec4Floats);
+ this.startFaceNormalAndVertexCornerIds = new Float32Array(vec4Floats);
+ this.endPositionAndHeights = new Float32Array(vec4Floats);
+ this.endFaceNormalAndHalfWidths = new Float32Array(vec4Floats);
+ this.vertexBatchIds = new Uint16Array(vertexCount);
+
+ this.indices = IndexDatatype.IndexDatatype.createTypedArray(vertexCount, 36 * volumesCount);
+
+ this.vec3Offset = 0;
+ this.vec4Offset = 0;
+ this.batchIdOffset = 0;
+ this.indexOffset = 0;
+
+ this.volumeStartIndex = 0;
+ }
+
+ const towardCurrScratch = new Matrix3.Cartesian3();
+ const towardNextScratch = new Matrix3.Cartesian3();
+ function computeMiteredNormal(
+ previousPosition,
+ position,
+ nextPosition,
+ ellipsoidSurfaceNormal,
+ result
+ ) {
+ const towardNext = Matrix3.Cartesian3.subtract(
+ nextPosition,
+ position,
+ towardNextScratch
+ );
+ let towardCurr = Matrix3.Cartesian3.subtract(
+ position,
+ previousPosition,
+ towardCurrScratch
+ );
+ Matrix3.Cartesian3.normalize(towardNext, towardNext);
+ Matrix3.Cartesian3.normalize(towardCurr, towardCurr);
+
+ if (Matrix3.Cartesian3.dot(towardNext, towardCurr) < MITER_BREAK) {
+ towardCurr = Matrix3.Cartesian3.multiplyByScalar(
+ towardCurr,
+ -1.0,
+ towardCurrScratch
+ );
+ }
+
+ Matrix3.Cartesian3.add(towardNext, towardCurr, result);
+ if (Matrix3.Cartesian3.equals(result, Matrix3.Cartesian3.ZERO)) {
+ result = Matrix3.Cartesian3.subtract(previousPosition, position);
+ }
+
+ // Make sure the normal is orthogonal to the ellipsoid surface normal
+ Matrix3.Cartesian3.cross(result, ellipsoidSurfaceNormal, result);
+ Matrix3.Cartesian3.cross(ellipsoidSurfaceNormal, result, result);
+ Matrix3.Cartesian3.normalize(result, result);
+ return result;
+ }
+
+ // Winding order is reversed so each segment's volume is inside-out
+ // 3-----------7
+ // /| left /|
+ // / | 1 / |
+ // 2-----------6 5 end
+ // | / | /
+ // start |/ right |/
+ // 0-----------4
+ //
+ const REFERENCE_INDICES = [
+ 0,
+ 2,
+ 6,
+ 0,
+ 6,
+ 4, // right
+ 0,
+ 1,
+ 3,
+ 0,
+ 3,
+ 2, // start face
+ 0,
+ 4,
+ 5,
+ 0,
+ 5,
+ 1, // bottom
+ 5,
+ 3,
+ 1,
+ 5,
+ 7,
+ 3, // left
+ 7,
+ 5,
+ 4,
+ 7,
+ 4,
+ 6, // end face
+ 7,
+ 6,
+ 2,
+ 7,
+ 2,
+ 3, // top
+ ];
+ const REFERENCE_INDICES_LENGTH = REFERENCE_INDICES.length;
+
+ const positionScratch = new Matrix3.Cartesian3();
+ const scratchStartEllipsoidNormal = new Matrix3.Cartesian3();
+ const scratchStartFaceNormal = new Matrix3.Cartesian3();
+ const scratchEndEllipsoidNormal = new Matrix3.Cartesian3();
+ const scratchEndFaceNormal = new Matrix3.Cartesian3();
+ VertexAttributesAndIndices.prototype.addVolume = function (
+ preStartRTC,
+ startRTC,
+ endRTC,
+ postEndRTC,
+ startHeight,
+ endHeight,
+ halfWidth,
+ batchId,
+ center,
+ ellipsoid
+ ) {
+ let position = Matrix3.Cartesian3.add(startRTC, center, positionScratch);
+ const startEllipsoidNormal = ellipsoid.geodeticSurfaceNormal(
+ position,
+ scratchStartEllipsoidNormal
+ );
+ position = Matrix3.Cartesian3.add(endRTC, center, positionScratch);
+ const endEllipsoidNormal = ellipsoid.geodeticSurfaceNormal(
+ position,
+ scratchEndEllipsoidNormal
+ );
+
+ const startFaceNormal = computeMiteredNormal(
+ preStartRTC,
+ startRTC,
+ endRTC,
+ startEllipsoidNormal,
+ scratchStartFaceNormal
+ );
+ const endFaceNormal = computeMiteredNormal(
+ postEndRTC,
+ endRTC,
+ startRTC,
+ endEllipsoidNormal,
+ scratchEndFaceNormal
+ );
+
+ const startEllipsoidNormals = this.startEllipsoidNormals;
+ const endEllipsoidNormals = this.endEllipsoidNormals;
+ const startPositionAndHeights = this.startPositionAndHeights;
+ const startFaceNormalAndVertexCornerIds = this
+ .startFaceNormalAndVertexCornerIds;
+ const endPositionAndHeights = this.endPositionAndHeights;
+ const endFaceNormalAndHalfWidths = this.endFaceNormalAndHalfWidths;
+ const vertexBatchIds = this.vertexBatchIds;
+
+ let batchIdOffset = this.batchIdOffset;
+ let vec3Offset = this.vec3Offset;
+ let vec4Offset = this.vec4Offset;
+
+ let i;
+ for (i = 0; i < 8; i++) {
+ Matrix3.Cartesian3.pack(startEllipsoidNormal, startEllipsoidNormals, vec3Offset);
+ Matrix3.Cartesian3.pack(endEllipsoidNormal, endEllipsoidNormals, vec3Offset);
+
+ Matrix3.Cartesian3.pack(startRTC, startPositionAndHeights, vec4Offset);
+ startPositionAndHeights[vec4Offset + 3] = startHeight;
+
+ Matrix3.Cartesian3.pack(endRTC, endPositionAndHeights, vec4Offset);
+ endPositionAndHeights[vec4Offset + 3] = endHeight;
+
+ Matrix3.Cartesian3.pack(
+ startFaceNormal,
+ startFaceNormalAndVertexCornerIds,
+ vec4Offset
+ );
+ startFaceNormalAndVertexCornerIds[vec4Offset + 3] = i;
+
+ Matrix3.Cartesian3.pack(endFaceNormal, endFaceNormalAndHalfWidths, vec4Offset);
+ endFaceNormalAndHalfWidths[vec4Offset + 3] = halfWidth;
+
+ vertexBatchIds[batchIdOffset++] = batchId;
+
+ vec3Offset += 3;
+ vec4Offset += 4;
+ }
+
+ this.batchIdOffset = batchIdOffset;
+ this.vec3Offset = vec3Offset;
+ this.vec4Offset = vec4Offset;
+ const indices = this.indices;
+ const volumeStartIndex = this.volumeStartIndex;
+
+ const indexOffset = this.indexOffset;
+ for (i = 0; i < REFERENCE_INDICES_LENGTH; i++) {
+ indices[indexOffset + i] = REFERENCE_INDICES[i] + volumeStartIndex;
+ }
+
+ this.volumeStartIndex += 8;
+ this.indexOffset += REFERENCE_INDICES_LENGTH;
+ };
+
+ const scratchRectangle = new Matrix2.Rectangle();
+ const scratchEllipsoid = new Matrix3.Ellipsoid();
+ const scratchCenter = new Matrix3.Cartesian3();
+
+ const scratchPrev = new Matrix3.Cartesian3();
+ const scratchP0 = new Matrix3.Cartesian3();
+ const scratchP1 = new Matrix3.Cartesian3();
+ const scratchNext = new Matrix3.Cartesian3();
+ function createVectorTileClampedPolylines(parameters, transferableObjects) {
+ const encodedPositions = new Uint16Array(parameters.positions);
+ const widths = new Uint16Array(parameters.widths);
+ const counts = new Uint32Array(parameters.counts);
+ const batchIds = new Uint16Array(parameters.batchIds);
+
+ // Unpack tile decoding parameters
+ const rectangle = scratchRectangle;
+ const ellipsoid = scratchEllipsoid;
+ const center = scratchCenter;
+ const packedBuffer = new Float64Array(parameters.packedBuffer);
+
+ let offset = 0;
+ const minimumHeight = packedBuffer[offset++];
+ const maximumHeight = packedBuffer[offset++];
+
+ Matrix2.Rectangle.unpack(packedBuffer, offset, rectangle);
+ offset += Matrix2.Rectangle.packedLength;
+
+ Matrix3.Ellipsoid.unpack(packedBuffer, offset, ellipsoid);
+ offset += Matrix3.Ellipsoid.packedLength;
+
+ Matrix3.Cartesian3.unpack(packedBuffer, offset, center);
+
+ let i;
+
+ // Unpack positions and generate volumes
+ let positionsLength = encodedPositions.length / 3;
+ const uBuffer = encodedPositions.subarray(0, positionsLength);
+ const vBuffer = encodedPositions.subarray(
+ positionsLength,
+ 2 * positionsLength
+ );
+ const heightBuffer = encodedPositions.subarray(
+ 2 * positionsLength,
+ 3 * positionsLength
+ );
+ AttributeCompression.AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);
+
+ removeDuplicates(uBuffer, vBuffer, heightBuffer, counts);
+
+ // Figure out how many volumes and how many vertices there will be.
+ const countsLength = counts.length;
+ let volumesCount = 0;
+ for (i = 0; i < countsLength; i++) {
+ const polylinePositionCount = counts[i];
+ volumesCount += polylinePositionCount - 1;
+ }
+
+ const attribsAndIndices = new VertexAttributesAndIndices(volumesCount);
+
+ const positions = decodePositions(
+ uBuffer,
+ vBuffer,
+ heightBuffer,
+ rectangle,
+ minimumHeight,
+ maximumHeight,
+ ellipsoid);
+
+ positionsLength = uBuffer.length;
+ const positionsRTC = new Float32Array(positionsLength * 3);
+ for (i = 0; i < positionsLength; ++i) {
+ positionsRTC[i * 3] = positions[i * 3] - center.x;
+ positionsRTC[i * 3 + 1] = positions[i * 3 + 1] - center.y;
+ positionsRTC[i * 3 + 2] = positions[i * 3 + 2] - center.z;
+ }
+
+ let currentPositionIndex = 0;
+ let currentHeightIndex = 0;
+ for (i = 0; i < countsLength; i++) {
+ const polylineVolumeCount = counts[i] - 1;
+ const halfWidth = widths[i] * 0.5;
+ const batchId = batchIds[i];
+ const volumeFirstPositionIndex = currentPositionIndex;
+ for (let j = 0; j < polylineVolumeCount; j++) {
+ const volumeStart = Matrix3.Cartesian3.unpack(
+ positionsRTC,
+ currentPositionIndex,
+ scratchP0
+ );
+ const volumeEnd = Matrix3.Cartesian3.unpack(
+ positionsRTC,
+ currentPositionIndex + 3,
+ scratchP1
+ );
+
+ let startHeight = heightBuffer[currentHeightIndex];
+ let endHeight = heightBuffer[currentHeightIndex + 1];
+ startHeight = Math$1.CesiumMath.lerp(
+ minimumHeight,
+ maximumHeight,
+ startHeight / MAX_SHORT
+ );
+ endHeight = Math$1.CesiumMath.lerp(
+ minimumHeight,
+ maximumHeight,
+ endHeight / MAX_SHORT
+ );
+
+ currentHeightIndex++;
+
+ let preStart = scratchPrev;
+ let postEnd = scratchNext;
+ if (j === 0) {
+ // Check if this volume is like a loop
+ const finalPositionIndex =
+ volumeFirstPositionIndex + polylineVolumeCount * 3;
+ const finalPosition = Matrix3.Cartesian3.unpack(
+ positionsRTC,
+ finalPositionIndex,
+ scratchPrev
+ );
+ if (Matrix3.Cartesian3.equals(finalPosition, volumeStart)) {
+ Matrix3.Cartesian3.unpack(positionsRTC, finalPositionIndex - 3, preStart);
+ } else {
+ const offsetPastStart = Matrix3.Cartesian3.subtract(
+ volumeStart,
+ volumeEnd,
+ scratchPrev
+ );
+ preStart = Matrix3.Cartesian3.add(offsetPastStart, volumeStart, scratchPrev);
+ }
+ } else {
+ Matrix3.Cartesian3.unpack(positionsRTC, currentPositionIndex - 3, preStart);
+ }
+
+ if (j === polylineVolumeCount - 1) {
+ // Check if this volume is like a loop
+ const firstPosition = Matrix3.Cartesian3.unpack(
+ positionsRTC,
+ volumeFirstPositionIndex,
+ scratchNext
+ );
+ if (Matrix3.Cartesian3.equals(firstPosition, volumeEnd)) {
+ Matrix3.Cartesian3.unpack(
+ positionsRTC,
+ volumeFirstPositionIndex + 3,
+ postEnd
+ );
+ } else {
+ const offsetPastEnd = Matrix3.Cartesian3.subtract(
+ volumeEnd,
+ volumeStart,
+ scratchNext
+ );
+ postEnd = Matrix3.Cartesian3.add(offsetPastEnd, volumeEnd, scratchNext);
+ }
+ } else {
+ Matrix3.Cartesian3.unpack(positionsRTC, currentPositionIndex + 6, postEnd);
+ }
+
+ attribsAndIndices.addVolume(
+ preStart,
+ volumeStart,
+ volumeEnd,
+ postEnd,
+ startHeight,
+ endHeight,
+ halfWidth,
+ batchId,
+ center,
+ ellipsoid
+ );
+
+ currentPositionIndex += 3;
+ }
+ currentPositionIndex += 3;
+ currentHeightIndex++;
+ }
+
+ const indices = attribsAndIndices.indices;
+
+ transferableObjects.push(attribsAndIndices.startEllipsoidNormals.buffer);
+ transferableObjects.push(attribsAndIndices.endEllipsoidNormals.buffer);
+ transferableObjects.push(attribsAndIndices.startPositionAndHeights.buffer);
+ transferableObjects.push(
+ attribsAndIndices.startFaceNormalAndVertexCornerIds.buffer
+ );
+ transferableObjects.push(attribsAndIndices.endPositionAndHeights.buffer);
+ transferableObjects.push(attribsAndIndices.endFaceNormalAndHalfWidths.buffer);
+ transferableObjects.push(attribsAndIndices.vertexBatchIds.buffer);
+ transferableObjects.push(indices.buffer);
+
+ let results = {
+ indexDatatype:
+ indices.BYTES_PER_ELEMENT === 2
+ ? IndexDatatype.IndexDatatype.UNSIGNED_SHORT
+ : IndexDatatype.IndexDatatype.UNSIGNED_INT,
+ startEllipsoidNormals: attribsAndIndices.startEllipsoidNormals.buffer,
+ endEllipsoidNormals: attribsAndIndices.endEllipsoidNormals.buffer,
+ startPositionAndHeights: attribsAndIndices.startPositionAndHeights.buffer,
+ startFaceNormalAndVertexCornerIds:
+ attribsAndIndices.startFaceNormalAndVertexCornerIds.buffer,
+ endPositionAndHeights: attribsAndIndices.endPositionAndHeights.buffer,
+ endFaceNormalAndHalfWidths:
+ attribsAndIndices.endFaceNormalAndHalfWidths.buffer,
+ vertexBatchIds: attribsAndIndices.vertexBatchIds.buffer,
+ indices: indices.buffer,
+ };
+
+ if (parameters.keepDecodedPositions) {
+ const positionOffsets = getPositionOffsets(counts);
+ transferableObjects.push(positions.buffer, positionOffsets.buffer);
+ results = combine.combine(results, {
+ decodedPositions: positions.buffer,
+ decodedPositionOffsets: positionOffsets.buffer,
+ });
+ }
+
+ return results;
+ }
+ var createVectorTileClampedPolylines$1 = createTaskProcessorWorker(createVectorTileClampedPolylines);
+
+ return createVectorTileClampedPolylines$1;
+
+}));
+//# sourceMappingURL=createVectorTileClampedPolylines.js.map
diff --git a/examples/cesium/Workers/createVectorTileClampedPolylines.js.map b/examples/cesium/Workers/createVectorTileClampedPolylines.js.map
new file mode 100644
index 0000000..a8b2cea
--- /dev/null
+++ b/examples/cesium/Workers/createVectorTileClampedPolylines.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createVectorTileClampedPolylines.js","sources":["../../../Source/WorkersES6/createVectorTileClampedPolylines.js"],"sourcesContent":["import AttributeCompression from \"../Core/AttributeCompression.js\";\r\nimport Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport Cartographic from \"../Core/Cartographic.js\";\r\nimport combine from \"../Core/combine.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\r\nimport CesiumMath from \"../Core/Math.js\";\r\nimport Rectangle from \"../Core/Rectangle.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nconst MAX_SHORT = 32767;\r\nconst MITER_BREAK = Math.cos(CesiumMath.toRadians(150.0));\r\n\r\nconst scratchBVCartographic = new Cartographic();\r\nconst scratchEncodedPosition = new Cartesian3();\r\n\r\nfunction decodePositions(\r\n uBuffer,\r\n vBuffer,\r\n heightBuffer,\r\n rectangle,\r\n minimumHeight,\r\n maximumHeight,\r\n ellipsoid\r\n) {\r\n const positionsLength = uBuffer.length;\r\n const decodedPositions = new Float64Array(positionsLength * 3);\r\n for (let i = 0; i < positionsLength; ++i) {\r\n const u = uBuffer[i];\r\n const v = vBuffer[i];\r\n const h = heightBuffer[i];\r\n\r\n const lon = CesiumMath.lerp(rectangle.west, rectangle.east, u / MAX_SHORT);\r\n const lat = CesiumMath.lerp(\r\n rectangle.south,\r\n rectangle.north,\r\n v / MAX_SHORT\r\n );\r\n const alt = CesiumMath.lerp(minimumHeight, maximumHeight, h / MAX_SHORT);\r\n\r\n const cartographic = Cartographic.fromRadians(\r\n lon,\r\n lat,\r\n alt,\r\n scratchBVCartographic\r\n );\r\n const decodedPosition = ellipsoid.cartographicToCartesian(\r\n cartographic,\r\n scratchEncodedPosition\r\n );\r\n Cartesian3.pack(decodedPosition, decodedPositions, i * 3);\r\n }\r\n return decodedPositions;\r\n}\r\n\r\nfunction getPositionOffsets(counts) {\r\n const countsLength = counts.length;\r\n const positionOffsets = new Uint32Array(countsLength + 1);\r\n let offset = 0;\r\n for (let i = 0; i < countsLength; ++i) {\r\n positionOffsets[i] = offset;\r\n offset += counts[i];\r\n }\r\n positionOffsets[countsLength] = offset;\r\n return positionOffsets;\r\n}\r\n\r\nconst previousCompressedCartographicScratch = new Cartographic();\r\nconst currentCompressedCartographicScratch = new Cartographic();\r\nfunction removeDuplicates(uBuffer, vBuffer, heightBuffer, counts) {\r\n const countsLength = counts.length;\r\n const positionsLength = uBuffer.length;\r\n const markRemoval = new Uint8Array(positionsLength);\r\n const previous = previousCompressedCartographicScratch;\r\n const current = currentCompressedCartographicScratch;\r\n let offset = 0;\r\n for (let i = 0; i < countsLength; i++) {\r\n const count = counts[i];\r\n let updatedCount = count;\r\n for (let j = 1; j < count; j++) {\r\n const index = offset + j;\r\n const previousIndex = index - 1;\r\n current.longitude = uBuffer[index];\r\n current.latitude = vBuffer[index];\r\n previous.longitude = uBuffer[previousIndex];\r\n previous.latitude = vBuffer[previousIndex];\r\n\r\n if (Cartographic.equals(current, previous)) {\r\n updatedCount--;\r\n markRemoval[previousIndex] = 1;\r\n }\r\n }\r\n counts[i] = updatedCount;\r\n offset += count;\r\n }\r\n\r\n let nextAvailableIndex = 0;\r\n for (let k = 0; k < positionsLength; k++) {\r\n if (markRemoval[k] !== 1) {\r\n uBuffer[nextAvailableIndex] = uBuffer[k];\r\n vBuffer[nextAvailableIndex] = vBuffer[k];\r\n heightBuffer[nextAvailableIndex] = heightBuffer[k];\r\n nextAvailableIndex++;\r\n }\r\n }\r\n}\r\n\r\nfunction VertexAttributesAndIndices(volumesCount) {\r\n const vertexCount = volumesCount * 8;\r\n const vec3Floats = vertexCount * 3;\r\n const vec4Floats = vertexCount * 4;\r\n this.startEllipsoidNormals = new Float32Array(vec3Floats);\r\n this.endEllipsoidNormals = new Float32Array(vec3Floats);\r\n this.startPositionAndHeights = new Float32Array(vec4Floats);\r\n this.startFaceNormalAndVertexCornerIds = new Float32Array(vec4Floats);\r\n this.endPositionAndHeights = new Float32Array(vec4Floats);\r\n this.endFaceNormalAndHalfWidths = new Float32Array(vec4Floats);\r\n this.vertexBatchIds = new Uint16Array(vertexCount);\r\n\r\n this.indices = IndexDatatype.createTypedArray(vertexCount, 36 * volumesCount);\r\n\r\n this.vec3Offset = 0;\r\n this.vec4Offset = 0;\r\n this.batchIdOffset = 0;\r\n this.indexOffset = 0;\r\n\r\n this.volumeStartIndex = 0;\r\n}\r\n\r\nconst towardCurrScratch = new Cartesian3();\r\nconst towardNextScratch = new Cartesian3();\r\nfunction computeMiteredNormal(\r\n previousPosition,\r\n position,\r\n nextPosition,\r\n ellipsoidSurfaceNormal,\r\n result\r\n) {\r\n const towardNext = Cartesian3.subtract(\r\n nextPosition,\r\n position,\r\n towardNextScratch\r\n );\r\n let towardCurr = Cartesian3.subtract(\r\n position,\r\n previousPosition,\r\n towardCurrScratch\r\n );\r\n Cartesian3.normalize(towardNext, towardNext);\r\n Cartesian3.normalize(towardCurr, towardCurr);\r\n\r\n if (Cartesian3.dot(towardNext, towardCurr) < MITER_BREAK) {\r\n towardCurr = Cartesian3.multiplyByScalar(\r\n towardCurr,\r\n -1.0,\r\n towardCurrScratch\r\n );\r\n }\r\n\r\n Cartesian3.add(towardNext, towardCurr, result);\r\n if (Cartesian3.equals(result, Cartesian3.ZERO)) {\r\n result = Cartesian3.subtract(previousPosition, position);\r\n }\r\n\r\n // Make sure the normal is orthogonal to the ellipsoid surface normal\r\n Cartesian3.cross(result, ellipsoidSurfaceNormal, result);\r\n Cartesian3.cross(ellipsoidSurfaceNormal, result, result);\r\n Cartesian3.normalize(result, result);\r\n return result;\r\n}\r\n\r\n// Winding order is reversed so each segment's volume is inside-out\r\n// 3-----------7\r\n// /| left /|\r\n// / | 1 / |\r\n// 2-----------6 5 end\r\n// | / | /\r\n// start |/ right |/\r\n// 0-----------4\r\n//\r\nconst REFERENCE_INDICES = [\r\n 0,\r\n 2,\r\n 6,\r\n 0,\r\n 6,\r\n 4, // right\r\n 0,\r\n 1,\r\n 3,\r\n 0,\r\n 3,\r\n 2, // start face\r\n 0,\r\n 4,\r\n 5,\r\n 0,\r\n 5,\r\n 1, // bottom\r\n 5,\r\n 3,\r\n 1,\r\n 5,\r\n 7,\r\n 3, // left\r\n 7,\r\n 5,\r\n 4,\r\n 7,\r\n 4,\r\n 6, // end face\r\n 7,\r\n 6,\r\n 2,\r\n 7,\r\n 2,\r\n 3, // top\r\n];\r\nconst REFERENCE_INDICES_LENGTH = REFERENCE_INDICES.length;\r\n\r\nconst positionScratch = new Cartesian3();\r\nconst scratchStartEllipsoidNormal = new Cartesian3();\r\nconst scratchStartFaceNormal = new Cartesian3();\r\nconst scratchEndEllipsoidNormal = new Cartesian3();\r\nconst scratchEndFaceNormal = new Cartesian3();\r\nVertexAttributesAndIndices.prototype.addVolume = function (\r\n preStartRTC,\r\n startRTC,\r\n endRTC,\r\n postEndRTC,\r\n startHeight,\r\n endHeight,\r\n halfWidth,\r\n batchId,\r\n center,\r\n ellipsoid\r\n) {\r\n let position = Cartesian3.add(startRTC, center, positionScratch);\r\n const startEllipsoidNormal = ellipsoid.geodeticSurfaceNormal(\r\n position,\r\n scratchStartEllipsoidNormal\r\n );\r\n position = Cartesian3.add(endRTC, center, positionScratch);\r\n const endEllipsoidNormal = ellipsoid.geodeticSurfaceNormal(\r\n position,\r\n scratchEndEllipsoidNormal\r\n );\r\n\r\n const startFaceNormal = computeMiteredNormal(\r\n preStartRTC,\r\n startRTC,\r\n endRTC,\r\n startEllipsoidNormal,\r\n scratchStartFaceNormal\r\n );\r\n const endFaceNormal = computeMiteredNormal(\r\n postEndRTC,\r\n endRTC,\r\n startRTC,\r\n endEllipsoidNormal,\r\n scratchEndFaceNormal\r\n );\r\n\r\n const startEllipsoidNormals = this.startEllipsoidNormals;\r\n const endEllipsoidNormals = this.endEllipsoidNormals;\r\n const startPositionAndHeights = this.startPositionAndHeights;\r\n const startFaceNormalAndVertexCornerIds = this\r\n .startFaceNormalAndVertexCornerIds;\r\n const endPositionAndHeights = this.endPositionAndHeights;\r\n const endFaceNormalAndHalfWidths = this.endFaceNormalAndHalfWidths;\r\n const vertexBatchIds = this.vertexBatchIds;\r\n\r\n let batchIdOffset = this.batchIdOffset;\r\n let vec3Offset = this.vec3Offset;\r\n let vec4Offset = this.vec4Offset;\r\n\r\n let i;\r\n for (i = 0; i < 8; i++) {\r\n Cartesian3.pack(startEllipsoidNormal, startEllipsoidNormals, vec3Offset);\r\n Cartesian3.pack(endEllipsoidNormal, endEllipsoidNormals, vec3Offset);\r\n\r\n Cartesian3.pack(startRTC, startPositionAndHeights, vec4Offset);\r\n startPositionAndHeights[vec4Offset + 3] = startHeight;\r\n\r\n Cartesian3.pack(endRTC, endPositionAndHeights, vec4Offset);\r\n endPositionAndHeights[vec4Offset + 3] = endHeight;\r\n\r\n Cartesian3.pack(\r\n startFaceNormal,\r\n startFaceNormalAndVertexCornerIds,\r\n vec4Offset\r\n );\r\n startFaceNormalAndVertexCornerIds[vec4Offset + 3] = i;\r\n\r\n Cartesian3.pack(endFaceNormal, endFaceNormalAndHalfWidths, vec4Offset);\r\n endFaceNormalAndHalfWidths[vec4Offset + 3] = halfWidth;\r\n\r\n vertexBatchIds[batchIdOffset++] = batchId;\r\n\r\n vec3Offset += 3;\r\n vec4Offset += 4;\r\n }\r\n\r\n this.batchIdOffset = batchIdOffset;\r\n this.vec3Offset = vec3Offset;\r\n this.vec4Offset = vec4Offset;\r\n const indices = this.indices;\r\n const volumeStartIndex = this.volumeStartIndex;\r\n\r\n const indexOffset = this.indexOffset;\r\n for (i = 0; i < REFERENCE_INDICES_LENGTH; i++) {\r\n indices[indexOffset + i] = REFERENCE_INDICES[i] + volumeStartIndex;\r\n }\r\n\r\n this.volumeStartIndex += 8;\r\n this.indexOffset += REFERENCE_INDICES_LENGTH;\r\n};\r\n\r\nconst scratchRectangle = new Rectangle();\r\nconst scratchEllipsoid = new Ellipsoid();\r\nconst scratchCenter = new Cartesian3();\r\n\r\nconst scratchPrev = new Cartesian3();\r\nconst scratchP0 = new Cartesian3();\r\nconst scratchP1 = new Cartesian3();\r\nconst scratchNext = new Cartesian3();\r\nfunction createVectorTileClampedPolylines(parameters, transferableObjects) {\r\n const encodedPositions = new Uint16Array(parameters.positions);\r\n const widths = new Uint16Array(parameters.widths);\r\n const counts = new Uint32Array(parameters.counts);\r\n const batchIds = new Uint16Array(parameters.batchIds);\r\n\r\n // Unpack tile decoding parameters\r\n const rectangle = scratchRectangle;\r\n const ellipsoid = scratchEllipsoid;\r\n const center = scratchCenter;\r\n const packedBuffer = new Float64Array(parameters.packedBuffer);\r\n\r\n let offset = 0;\r\n const minimumHeight = packedBuffer[offset++];\r\n const maximumHeight = packedBuffer[offset++];\r\n\r\n Rectangle.unpack(packedBuffer, offset, rectangle);\r\n offset += Rectangle.packedLength;\r\n\r\n Ellipsoid.unpack(packedBuffer, offset, ellipsoid);\r\n offset += Ellipsoid.packedLength;\r\n\r\n Cartesian3.unpack(packedBuffer, offset, center);\r\n\r\n let i;\r\n\r\n // Unpack positions and generate volumes\r\n let positionsLength = encodedPositions.length / 3;\r\n const uBuffer = encodedPositions.subarray(0, positionsLength);\r\n const vBuffer = encodedPositions.subarray(\r\n positionsLength,\r\n 2 * positionsLength\r\n );\r\n const heightBuffer = encodedPositions.subarray(\r\n 2 * positionsLength,\r\n 3 * positionsLength\r\n );\r\n AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);\r\n\r\n removeDuplicates(uBuffer, vBuffer, heightBuffer, counts);\r\n\r\n // Figure out how many volumes and how many vertices there will be.\r\n const countsLength = counts.length;\r\n let volumesCount = 0;\r\n for (i = 0; i < countsLength; i++) {\r\n const polylinePositionCount = counts[i];\r\n volumesCount += polylinePositionCount - 1;\r\n }\r\n\r\n const attribsAndIndices = new VertexAttributesAndIndices(volumesCount);\r\n\r\n const positions = decodePositions(\r\n uBuffer,\r\n vBuffer,\r\n heightBuffer,\r\n rectangle,\r\n minimumHeight,\r\n maximumHeight,\r\n ellipsoid,\r\n center\r\n );\r\n\r\n positionsLength = uBuffer.length;\r\n const positionsRTC = new Float32Array(positionsLength * 3);\r\n for (i = 0; i < positionsLength; ++i) {\r\n positionsRTC[i * 3] = positions[i * 3] - center.x;\r\n positionsRTC[i * 3 + 1] = positions[i * 3 + 1] - center.y;\r\n positionsRTC[i * 3 + 2] = positions[i * 3 + 2] - center.z;\r\n }\r\n\r\n let currentPositionIndex = 0;\r\n let currentHeightIndex = 0;\r\n for (i = 0; i < countsLength; i++) {\r\n const polylineVolumeCount = counts[i] - 1;\r\n const halfWidth = widths[i] * 0.5;\r\n const batchId = batchIds[i];\r\n const volumeFirstPositionIndex = currentPositionIndex;\r\n for (let j = 0; j < polylineVolumeCount; j++) {\r\n const volumeStart = Cartesian3.unpack(\r\n positionsRTC,\r\n currentPositionIndex,\r\n scratchP0\r\n );\r\n const volumeEnd = Cartesian3.unpack(\r\n positionsRTC,\r\n currentPositionIndex + 3,\r\n scratchP1\r\n );\r\n\r\n let startHeight = heightBuffer[currentHeightIndex];\r\n let endHeight = heightBuffer[currentHeightIndex + 1];\r\n startHeight = CesiumMath.lerp(\r\n minimumHeight,\r\n maximumHeight,\r\n startHeight / MAX_SHORT\r\n );\r\n endHeight = CesiumMath.lerp(\r\n minimumHeight,\r\n maximumHeight,\r\n endHeight / MAX_SHORT\r\n );\r\n\r\n currentHeightIndex++;\r\n\r\n let preStart = scratchPrev;\r\n let postEnd = scratchNext;\r\n if (j === 0) {\r\n // Check if this volume is like a loop\r\n const finalPositionIndex =\r\n volumeFirstPositionIndex + polylineVolumeCount * 3;\r\n const finalPosition = Cartesian3.unpack(\r\n positionsRTC,\r\n finalPositionIndex,\r\n scratchPrev\r\n );\r\n if (Cartesian3.equals(finalPosition, volumeStart)) {\r\n Cartesian3.unpack(positionsRTC, finalPositionIndex - 3, preStart);\r\n } else {\r\n const offsetPastStart = Cartesian3.subtract(\r\n volumeStart,\r\n volumeEnd,\r\n scratchPrev\r\n );\r\n preStart = Cartesian3.add(offsetPastStart, volumeStart, scratchPrev);\r\n }\r\n } else {\r\n Cartesian3.unpack(positionsRTC, currentPositionIndex - 3, preStart);\r\n }\r\n\r\n if (j === polylineVolumeCount - 1) {\r\n // Check if this volume is like a loop\r\n const firstPosition = Cartesian3.unpack(\r\n positionsRTC,\r\n volumeFirstPositionIndex,\r\n scratchNext\r\n );\r\n if (Cartesian3.equals(firstPosition, volumeEnd)) {\r\n Cartesian3.unpack(\r\n positionsRTC,\r\n volumeFirstPositionIndex + 3,\r\n postEnd\r\n );\r\n } else {\r\n const offsetPastEnd = Cartesian3.subtract(\r\n volumeEnd,\r\n volumeStart,\r\n scratchNext\r\n );\r\n postEnd = Cartesian3.add(offsetPastEnd, volumeEnd, scratchNext);\r\n }\r\n } else {\r\n Cartesian3.unpack(positionsRTC, currentPositionIndex + 6, postEnd);\r\n }\r\n\r\n attribsAndIndices.addVolume(\r\n preStart,\r\n volumeStart,\r\n volumeEnd,\r\n postEnd,\r\n startHeight,\r\n endHeight,\r\n halfWidth,\r\n batchId,\r\n center,\r\n ellipsoid\r\n );\r\n\r\n currentPositionIndex += 3;\r\n }\r\n currentPositionIndex += 3;\r\n currentHeightIndex++;\r\n }\r\n\r\n const indices = attribsAndIndices.indices;\r\n\r\n transferableObjects.push(attribsAndIndices.startEllipsoidNormals.buffer);\r\n transferableObjects.push(attribsAndIndices.endEllipsoidNormals.buffer);\r\n transferableObjects.push(attribsAndIndices.startPositionAndHeights.buffer);\r\n transferableObjects.push(\r\n attribsAndIndices.startFaceNormalAndVertexCornerIds.buffer\r\n );\r\n transferableObjects.push(attribsAndIndices.endPositionAndHeights.buffer);\r\n transferableObjects.push(attribsAndIndices.endFaceNormalAndHalfWidths.buffer);\r\n transferableObjects.push(attribsAndIndices.vertexBatchIds.buffer);\r\n transferableObjects.push(indices.buffer);\r\n\r\n let results = {\r\n indexDatatype:\r\n indices.BYTES_PER_ELEMENT === 2\r\n ? IndexDatatype.UNSIGNED_SHORT\r\n : IndexDatatype.UNSIGNED_INT,\r\n startEllipsoidNormals: attribsAndIndices.startEllipsoidNormals.buffer,\r\n endEllipsoidNormals: attribsAndIndices.endEllipsoidNormals.buffer,\r\n startPositionAndHeights: attribsAndIndices.startPositionAndHeights.buffer,\r\n startFaceNormalAndVertexCornerIds:\r\n attribsAndIndices.startFaceNormalAndVertexCornerIds.buffer,\r\n endPositionAndHeights: attribsAndIndices.endPositionAndHeights.buffer,\r\n endFaceNormalAndHalfWidths:\r\n attribsAndIndices.endFaceNormalAndHalfWidths.buffer,\r\n vertexBatchIds: attribsAndIndices.vertexBatchIds.buffer,\r\n indices: indices.buffer,\r\n };\r\n\r\n if (parameters.keepDecodedPositions) {\r\n const positionOffsets = getPositionOffsets(counts);\r\n transferableObjects.push(positions.buffer, positionOffsets.buffer);\r\n results = combine(results, {\r\n decodedPositions: positions.buffer,\r\n decodedPositionOffsets: positionOffsets.buffer,\r\n });\r\n }\r\n\r\n return results;\r\n}\r\nexport default createTaskProcessorWorker(createVectorTileClampedPolylines);\r\n"],"names":["CesiumMath","Cartographic","Cartesian3","IndexDatatype","Rectangle","Ellipsoid","AttributeCompression","combine"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAUA,MAAM,SAAS,GAAG,KAAK,CAAC;EACxB,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAACA,iBAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1D;EACA,MAAM,qBAAqB,GAAG,IAAIC,oBAAY,EAAE,CAAC;EACjD,MAAM,sBAAsB,GAAG,IAAIC,kBAAU,EAAE,CAAC;AAChD;EACA,SAAS,eAAe;EACxB,EAAE,OAAO;EACT,EAAE,OAAO;EACT,EAAE,YAAY;EACd,EAAE,SAAS;EACX,EAAE,aAAa;EACf,EAAE,aAAa;EACf,EAAE,SAAS;EACX,EAAE;EACF,EAAE,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;EACzC,EAAE,MAAM,gBAAgB,GAAG,IAAI,YAAY,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;EACjE,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,EAAE,CAAC,EAAE;EAC5C,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;EACzB,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;EACzB,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;AAC9B;EACA,IAAI,MAAM,GAAG,GAAGF,iBAAU,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC;EAC/E,IAAI,MAAM,GAAG,GAAGA,iBAAU,CAAC,IAAI;EAC/B,MAAM,SAAS,CAAC,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ileGeometries.js
new file mode 100644
index 0000000..cc3437c
--- /dev/null
+++ b/examples/cesium/Workers/createVectorTileGeometries.js
@@ -0,0 +1,471 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Transforms-11fb6b0a', './BoxGeometry-2c7f2d2d', './Matrix3-f22b0303', './Color-c019c34b', './CylinderGeometry-2b94e575', './defaultValue-0ab18f7d', './EllipsoidGeometry-66510462', './IndexDatatype-b4e5cf89', './Matrix2-036c77dd', './createTaskProcessorWorker', './Check-d10e5f2e', './Math-9be8b918', './combine-4598d225', './RuntimeError-e5c6a8b9', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './GeometryOffsetAttribute-cc320d7d', './VertexFormat-f2d74c96', './CylinderGeometryLibrary-d951e1d0'], (function (Transforms, BoxGeometry, Matrix3, Color, CylinderGeometry, defaultValue, EllipsoidGeometry, IndexDatatype, Matrix2, createTaskProcessorWorker, Check, Math$1, combine, RuntimeError, ComponentDatatype, WebGLConstants, GeometryAttribute, GeometryAttributes, GeometryOffsetAttribute, VertexFormat, CylinderGeometryLibrary) { 'use strict';
+
+ /**
+ * Describes a renderable batch of geometry.
+ *
+ * @alias Vector3DTileBatch
+ * @constructor
+ *
+ * @param {Object} options An object with the following properties:
+ * @param {Number} options.offset The offset of the batch into the indices buffer.
+ * @param {Number} options.count The number of indices in the batch.
+ * @param {Color} options.color The color of the geometry in the batch.
+ * @param {Number[]} options.batchIds An array where each element is the batch id of the geometry in the batch.
+ *
+ * @private
+ */
+ function Vector3DTileBatch(options) {
+ /**
+ * The offset of the batch into the indices buffer.
+ * @type {Number}
+ */
+ this.offset = options.offset;
+ /**
+ * The number of indices in the batch.
+ * @type {Number}
+ */
+ this.count = options.count;
+ /**
+ * The color of the geometry in the batch.
+ * @type {Color}
+ */
+ this.color = options.color;
+ /**
+ * An array where each element is the batch id of the geometry in the batch.
+ * @type {Number[]}
+ */
+ this.batchIds = options.batchIds;
+ }
+
+ const scratchCartesian = new Matrix3.Cartesian3();
+
+ const packedBoxLength = Matrix2.Matrix4.packedLength + Matrix3.Cartesian3.packedLength;
+ const packedCylinderLength = Matrix2.Matrix4.packedLength + 2;
+ const packedEllipsoidLength = Matrix2.Matrix4.packedLength + Matrix3.Cartesian3.packedLength;
+ const packedSphereLength = Matrix3.Cartesian3.packedLength + 1;
+
+ const scratchModelMatrixAndBV = {
+ modelMatrix: new Matrix2.Matrix4(),
+ boundingVolume: new Transforms.BoundingSphere(),
+ };
+
+ function boxModelMatrixAndBoundingVolume(boxes, index) {
+ let boxIndex = index * packedBoxLength;
+
+ const dimensions = Matrix3.Cartesian3.unpack(boxes, boxIndex, scratchCartesian);
+ boxIndex += Matrix3.Cartesian3.packedLength;
+
+ const boxModelMatrix = Matrix2.Matrix4.unpack(
+ boxes,
+ boxIndex,
+ scratchModelMatrixAndBV.modelMatrix
+ );
+ Matrix2.Matrix4.multiplyByScale(boxModelMatrix, dimensions, boxModelMatrix);
+
+ const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
+ Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, boundingVolume.center);
+ boundingVolume.radius = Math.sqrt(3.0);
+
+ return scratchModelMatrixAndBV;
+ }
+
+ function cylinderModelMatrixAndBoundingVolume(cylinders, index) {
+ let cylinderIndex = index * packedCylinderLength;
+
+ const cylinderRadius = cylinders[cylinderIndex++];
+ const length = cylinders[cylinderIndex++];
+ const scale = Matrix3.Cartesian3.fromElements(
+ cylinderRadius,
+ cylinderRadius,
+ length,
+ scratchCartesian
+ );
+
+ const cylinderModelMatrix = Matrix2.Matrix4.unpack(
+ cylinders,
+ cylinderIndex,
+ scratchModelMatrixAndBV.modelMatrix
+ );
+ Matrix2.Matrix4.multiplyByScale(cylinderModelMatrix, scale, cylinderModelMatrix);
+
+ const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
+ Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, boundingVolume.center);
+ boundingVolume.radius = Math.sqrt(2.0);
+
+ return scratchModelMatrixAndBV;
+ }
+
+ function ellipsoidModelMatrixAndBoundingVolume(ellipsoids, index) {
+ let ellipsoidIndex = index * packedEllipsoidLength;
+
+ const radii = Matrix3.Cartesian3.unpack(ellipsoids, ellipsoidIndex, scratchCartesian);
+ ellipsoidIndex += Matrix3.Cartesian3.packedLength;
+
+ const ellipsoidModelMatrix = Matrix2.Matrix4.unpack(
+ ellipsoids,
+ ellipsoidIndex,
+ scratchModelMatrixAndBV.modelMatrix
+ );
+ Matrix2.Matrix4.multiplyByScale(ellipsoidModelMatrix, radii, ellipsoidModelMatrix);
+
+ const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
+ Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, boundingVolume.center);
+ boundingVolume.radius = 1.0;
+
+ return scratchModelMatrixAndBV;
+ }
+
+ function sphereModelMatrixAndBoundingVolume(spheres, index) {
+ let sphereIndex = index * packedSphereLength;
+
+ const sphereRadius = spheres[sphereIndex++];
+
+ const sphereTranslation = Matrix3.Cartesian3.unpack(
+ spheres,
+ sphereIndex,
+ scratchCartesian
+ );
+ const sphereModelMatrix = Matrix2.Matrix4.fromTranslation(
+ sphereTranslation,
+ scratchModelMatrixAndBV.modelMatrix
+ );
+ Matrix2.Matrix4.multiplyByUniformScale(
+ sphereModelMatrix,
+ sphereRadius,
+ sphereModelMatrix
+ );
+
+ const boundingVolume = scratchModelMatrixAndBV.boundingVolume;
+ Matrix3.Cartesian3.clone(Matrix3.Cartesian3.ZERO, boundingVolume.center);
+ boundingVolume.radius = 1.0;
+
+ return scratchModelMatrixAndBV;
+ }
+
+ const scratchPosition = new Matrix3.Cartesian3();
+
+ function createPrimitive(
+ options,
+ primitive,
+ primitiveBatchIds,
+ geometry,
+ getModelMatrixAndBoundingVolume
+ ) {
+ if (!defaultValue.defined(primitive)) {
+ return;
+ }
+
+ const numberOfPrimitives = primitiveBatchIds.length;
+ const geometryPositions = geometry.attributes.position.values;
+ const geometryIndices = geometry.indices;
+
+ const positions = options.positions;
+ const vertexBatchIds = options.vertexBatchIds;
+ const indices = options.indices;
+
+ const batchIds = options.batchIds;
+ const batchTableColors = options.batchTableColors;
+ const batchedIndices = options.batchedIndices;
+ const indexOffsets = options.indexOffsets;
+ const indexCounts = options.indexCounts;
+ const boundingVolumes = options.boundingVolumes;
+
+ const modelMatrix = options.modelMatrix;
+ const center = options.center;
+
+ let positionOffset = options.positionOffset;
+ let batchIdIndex = options.batchIdIndex;
+ let indexOffset = options.indexOffset;
+ const batchedIndicesOffset = options.batchedIndicesOffset;
+
+ for (let i = 0; i < numberOfPrimitives; ++i) {
+ const primitiveModelMatrixAndBV = getModelMatrixAndBoundingVolume(
+ primitive,
+ i
+ );
+ const primitiveModelMatrix = primitiveModelMatrixAndBV.modelMatrix;
+ Matrix2.Matrix4.multiply(modelMatrix, primitiveModelMatrix, primitiveModelMatrix);
+
+ const batchId = primitiveBatchIds[i];
+
+ const positionsLength = geometryPositions.length;
+ for (let j = 0; j < positionsLength; j += 3) {
+ const position = Matrix3.Cartesian3.unpack(geometryPositions, j, scratchPosition);
+ Matrix2.Matrix4.multiplyByPoint(primitiveModelMatrix, position, position);
+ Matrix3.Cartesian3.subtract(position, center, position);
+
+ Matrix3.Cartesian3.pack(position, positions, positionOffset * 3 + j);
+ vertexBatchIds[batchIdIndex++] = batchId;
+ }
+
+ const indicesLength = geometryIndices.length;
+ for (let k = 0; k < indicesLength; ++k) {
+ indices[indexOffset + k] = geometryIndices[k] + positionOffset;
+ }
+
+ const offset = i + batchedIndicesOffset;
+ batchedIndices[offset] = new Vector3DTileBatch({
+ offset: indexOffset,
+ count: indicesLength,
+ color: Color.Color.fromRgba(batchTableColors[batchId]),
+ batchIds: [batchId],
+ });
+ batchIds[offset] = batchId;
+ indexOffsets[offset] = indexOffset;
+ indexCounts[offset] = indicesLength;
+ boundingVolumes[offset] = Transforms.BoundingSphere.transform(
+ primitiveModelMatrixAndBV.boundingVolume,
+ primitiveModelMatrix
+ );
+
+ positionOffset += positionsLength / 3;
+ indexOffset += indicesLength;
+ }
+
+ options.positionOffset = positionOffset;
+ options.batchIdIndex = batchIdIndex;
+ options.indexOffset = indexOffset;
+ options.batchedIndicesOffset += numberOfPrimitives;
+ }
+
+ const scratchCenter = new Matrix3.Cartesian3();
+ const scratchMatrix4 = new Matrix2.Matrix4();
+
+ function unpackBuffer(buffer) {
+ const packedBuffer = new Float64Array(buffer);
+
+ let offset = 0;
+ Matrix3.Cartesian3.unpack(packedBuffer, offset, scratchCenter);
+ offset += Matrix3.Cartesian3.packedLength;
+
+ Matrix2.Matrix4.unpack(packedBuffer, offset, scratchMatrix4);
+ }
+
+ function packedBatchedIndicesLength(batchedIndices) {
+ const length = batchedIndices.length;
+ let count = 0;
+ for (let i = 0; i < length; ++i) {
+ count += Color.Color.packedLength + 3 + batchedIndices[i].batchIds.length;
+ }
+ return count;
+ }
+
+ function packBuffer(indicesBytesPerElement, batchedIndices, boundingVolumes) {
+ const numBVs = boundingVolumes.length;
+ const length =
+ 1 +
+ 1 +
+ numBVs * Transforms.BoundingSphere.packedLength +
+ 1 +
+ packedBatchedIndicesLength(batchedIndices);
+
+ const packedBuffer = new Float64Array(length);
+
+ let offset = 0;
+ packedBuffer[offset++] = indicesBytesPerElement;
+ packedBuffer[offset++] = numBVs;
+
+ for (let i = 0; i < numBVs; ++i) {
+ Transforms.BoundingSphere.pack(boundingVolumes[i], packedBuffer, offset);
+ offset += Transforms.BoundingSphere.packedLength;
+ }
+
+ const indicesLength = batchedIndices.length;
+ packedBuffer[offset++] = indicesLength;
+
+ for (let j = 0; j < indicesLength; ++j) {
+ const batchedIndex = batchedIndices[j];
+
+ Color.Color.pack(batchedIndex.color, packedBuffer, offset);
+ offset += Color.Color.packedLength;
+
+ packedBuffer[offset++] = batchedIndex.offset;
+ packedBuffer[offset++] = batchedIndex.count;
+
+ const batchIds = batchedIndex.batchIds;
+ const batchIdsLength = batchIds.length;
+ packedBuffer[offset++] = batchIdsLength;
+
+ for (let k = 0; k < batchIdsLength; ++k) {
+ packedBuffer[offset++] = batchIds[k];
+ }
+ }
+
+ return packedBuffer;
+ }
+
+ function createVectorTileGeometries(parameters, transferableObjects) {
+ const boxes = defaultValue.defined(parameters.boxes)
+ ? new Float32Array(parameters.boxes)
+ : undefined;
+ const boxBatchIds = defaultValue.defined(parameters.boxBatchIds)
+ ? new Uint16Array(parameters.boxBatchIds)
+ : undefined;
+ const cylinders = defaultValue.defined(parameters.cylinders)
+ ? new Float32Array(parameters.cylinders)
+ : undefined;
+ const cylinderBatchIds = defaultValue.defined(parameters.cylinderBatchIds)
+ ? new Uint16Array(parameters.cylinderBatchIds)
+ : undefined;
+ const ellipsoids = defaultValue.defined(parameters.ellipsoids)
+ ? new Float32Array(parameters.ellipsoids)
+ : undefined;
+ const ellipsoidBatchIds = defaultValue.defined(parameters.ellipsoidBatchIds)
+ ? new Uint16Array(parameters.ellipsoidBatchIds)
+ : undefined;
+ const spheres = defaultValue.defined(parameters.spheres)
+ ? new Float32Array(parameters.spheres)
+ : undefined;
+ const sphereBatchIds = defaultValue.defined(parameters.sphereBatchIds)
+ ? new Uint16Array(parameters.sphereBatchIds)
+ : undefined;
+
+ const numberOfBoxes = defaultValue.defined(boxes) ? boxBatchIds.length : 0;
+ const numberOfCylinders = defaultValue.defined(cylinders) ? cylinderBatchIds.length : 0;
+ const numberOfEllipsoids = defaultValue.defined(ellipsoids) ? ellipsoidBatchIds.length : 0;
+ const numberOfSpheres = defaultValue.defined(spheres) ? sphereBatchIds.length : 0;
+
+ const boxGeometry = BoxGeometry.BoxGeometry.getUnitBox();
+ const cylinderGeometry = CylinderGeometry.CylinderGeometry.getUnitCylinder();
+ const ellipsoidGeometry = EllipsoidGeometry.EllipsoidGeometry.getUnitEllipsoid();
+
+ const boxPositions = boxGeometry.attributes.position.values;
+ const cylinderPositions = cylinderGeometry.attributes.position.values;
+ const ellipsoidPositions = ellipsoidGeometry.attributes.position.values;
+
+ let numberOfPositions = boxPositions.length * numberOfBoxes;
+ numberOfPositions += cylinderPositions.length * numberOfCylinders;
+ numberOfPositions +=
+ ellipsoidPositions.length * (numberOfEllipsoids + numberOfSpheres);
+
+ const boxIndices = boxGeometry.indices;
+ const cylinderIndices = cylinderGeometry.indices;
+ const ellipsoidIndices = ellipsoidGeometry.indices;
+
+ let numberOfIndices = boxIndices.length * numberOfBoxes;
+ numberOfIndices += cylinderIndices.length * numberOfCylinders;
+ numberOfIndices +=
+ ellipsoidIndices.length * (numberOfEllipsoids + numberOfSpheres);
+
+ const positions = new Float32Array(numberOfPositions);
+ const vertexBatchIds = new Uint16Array(numberOfPositions / 3);
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(
+ numberOfPositions / 3,
+ numberOfIndices
+ );
+
+ const numberOfGeometries =
+ numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;
+ const batchIds = new Uint16Array(numberOfGeometries);
+ const batchedIndices = new Array(numberOfGeometries);
+ const indexOffsets = new Uint32Array(numberOfGeometries);
+ const indexCounts = new Uint32Array(numberOfGeometries);
+ const boundingVolumes = new Array(numberOfGeometries);
+
+ unpackBuffer(parameters.packedBuffer);
+
+ const options = {
+ batchTableColors: new Uint32Array(parameters.batchTableColors),
+ positions: positions,
+ vertexBatchIds: vertexBatchIds,
+ indices: indices,
+ batchIds: batchIds,
+ batchedIndices: batchedIndices,
+ indexOffsets: indexOffsets,
+ indexCounts: indexCounts,
+ boundingVolumes: boundingVolumes,
+ positionOffset: 0,
+ batchIdIndex: 0,
+ indexOffset: 0,
+ batchedIndicesOffset: 0,
+ modelMatrix: scratchMatrix4,
+ center: scratchCenter,
+ };
+
+ createPrimitive(
+ options,
+ boxes,
+ boxBatchIds,
+ boxGeometry,
+ boxModelMatrixAndBoundingVolume
+ );
+ createPrimitive(
+ options,
+ cylinders,
+ cylinderBatchIds,
+ cylinderGeometry,
+ cylinderModelMatrixAndBoundingVolume
+ );
+ createPrimitive(
+ options,
+ ellipsoids,
+ ellipsoidBatchIds,
+ ellipsoidGeometry,
+ ellipsoidModelMatrixAndBoundingVolume
+ );
+ createPrimitive(
+ options,
+ spheres,
+ sphereBatchIds,
+ ellipsoidGeometry,
+ sphereModelMatrixAndBoundingVolume
+ );
+
+ const packedBuffer = packBuffer(
+ indices.BYTES_PER_ELEMENT,
+ batchedIndices,
+ boundingVolumes
+ );
+ transferableObjects.push(
+ positions.buffer,
+ vertexBatchIds.buffer,
+ indices.buffer
+ );
+ transferableObjects.push(
+ batchIds.buffer,
+ indexOffsets.buffer,
+ indexCounts.buffer
+ );
+ transferableObjects.push(packedBuffer.buffer);
+
+ return {
+ positions: positions.buffer,
+ vertexBatchIds: vertexBatchIds.buffer,
+ indices: indices.buffer,
+ indexOffsets: indexOffsets.buffer,
+ indexCounts: indexCounts.buffer,
+ batchIds: batchIds.buffer,
+ packedBuffer: packedBuffer.buffer,
+ };
+ }
+ var createVectorTileGeometries$1 = createTaskProcessorWorker(createVectorTileGeometries);
+
+ return createVectorTileGeometries$1;
+
+}));
+//# sourceMappingURL=createVectorTileGeometries.js.map
diff --git a/examples/cesium/Workers/createVectorTileGeometries.js.map b/examples/cesium/Workers/createVectorTileGeometries.js.map
new file mode 100644
index 0000000..763db89
--- /dev/null
+++ b/examples/cesium/Workers/createVectorTileGeometries.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createVectorTileGeometries.js","sources":["../../../Source/Scene/Vector3DTileBatch.js","../../../Source/WorkersES6/createVectorTileGeometries.js"],"sourcesContent":["/**\r\n * Describes a renderable batch of geometry.\r\n *\r\n * @alias Vector3DTileBatch\r\n * @constructor\r\n *\r\n * @param {Object} options An object with the following properties:\r\n * @param {Number} options.offset The offset of the batch into the indices buffer.\r\n * @param {Number} options.count The number of indices in the batch.\r\n * @param {Color} options.color The color of the geometry in the batch.\r\n * @param {Number[]} options.batchIds An array where each element is the batch id of the geometry in the batch.\r\n *\r\n * @private\r\n */\r\nfunction Vector3DTileBatch(options) {\r\n /**\r\n * The offset of the batch into the indices buffer.\r\n * @type {Number}\r\n */\r\n this.offset = options.offset;\r\n /**\r\n * The number of indices in the batch.\r\n * @type {Number}\r\n */\r\n this.count = options.count;\r\n /**\r\n * The color of the geometry in the batch.\r\n * @type {Color}\r\n */\r\n this.color = options.color;\r\n /**\r\n * An array where each element is the batch id of the geometry in the batch.\r\n * @type {Number[]}\r\n */\r\n this.batchIds = options.batchIds;\r\n}\r\nexport default Vector3DTileBatch;\r\n","import BoundingSphere from \"../Core/BoundingSphere.js\";\r\nimport BoxGeometry from \"../Core/BoxGeometry.js\";\r\nimport Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport Color from \"../Core/Color.js\";\r\nimport CylinderGeometry from \"../Core/CylinderGeometry.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport EllipsoidGeometry from \"../Core/EllipsoidGeometry.js\";\r\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\r\nimport Matrix4 from \"../Core/Matrix4.js\";\r\nimport Vector3DTileBatch from \"../Scene/Vector3DTileBatch.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nconst scratchCartesian = new Cartesian3();\r\n\r\nconst packedBoxLength = Matrix4.packedLength + Cartesian3.packedLength;\r\nconst packedCylinderLength = Matrix4.packedLength + 2;\r\nconst packedEllipsoidLength = Matrix4.packedLength + Cartesian3.packedLength;\r\nconst packedSphereLength = Cartesian3.packedLength + 1;\r\n\r\nconst scratchModelMatrixAndBV = {\r\n modelMatrix: new Matrix4(),\r\n boundingVolume: new BoundingSphere(),\r\n};\r\n\r\nfunction boxModelMatrixAndBoundingVolume(boxes, index) {\r\n let boxIndex = index * packedBoxLength;\r\n\r\n const dimensions = Cartesian3.unpack(boxes, boxIndex, scratchCartesian);\r\n boxIndex += Cartesian3.packedLength;\r\n\r\n const boxModelMatrix = Matrix4.unpack(\r\n boxes,\r\n boxIndex,\r\n scratchModelMatrixAndBV.modelMatrix\r\n );\r\n Matrix4.multiplyByScale(boxModelMatrix, dimensions, boxModelMatrix);\r\n\r\n const boundingVolume = scratchModelMatrixAndBV.boundingVolume;\r\n Cartesian3.clone(Cartesian3.ZERO, boundingVolume.center);\r\n boundingVolume.radius = Math.sqrt(3.0);\r\n\r\n return scratchModelMatrixAndBV;\r\n}\r\n\r\nfunction cylinderModelMatrixAndBoundingVolume(cylinders, index) {\r\n let cylinderIndex = index * packedCylinderLength;\r\n\r\n const cylinderRadius = cylinders[cylinderIndex++];\r\n const length = cylinders[cylinderIndex++];\r\n const scale = Cartesian3.fromElements(\r\n cylinderRadius,\r\n cylinderRadius,\r\n length,\r\n scratchCartesian\r\n );\r\n\r\n const cylinderModelMatrix = Matrix4.unpack(\r\n cylinders,\r\n cylinderIndex,\r\n scratchModelMatrixAndBV.modelMatrix\r\n );\r\n Matrix4.multiplyByScale(cylinderModelMatrix, scale, cylinderModelMatrix);\r\n\r\n const boundingVolume = scratchModelMatrixAndBV.boundingVolume;\r\n Cartesian3.clone(Cartesian3.ZERO, boundingVolume.center);\r\n boundingVolume.radius = Math.sqrt(2.0);\r\n\r\n return scratchModelMatrixAndBV;\r\n}\r\n\r\nfunction ellipsoidModelMatrixAndBoundingVolume(ellipsoids, index) {\r\n let ellipsoidIndex = index * packedEllipsoidLength;\r\n\r\n const radii = Cartesian3.unpack(ellipsoids, ellipsoidIndex, scratchCartesian);\r\n ellipsoidIndex += Cartesian3.packedLength;\r\n\r\n const ellipsoidModelMatrix = Matrix4.unpack(\r\n ellipsoids,\r\n ellipsoidIndex,\r\n scratchModelMatrixAndBV.modelMatrix\r\n );\r\n Matrix4.multiplyByScale(ellipsoidModelMatrix, radii, ellipsoidModelMatrix);\r\n\r\n const boundingVolume = scratchModelMatrixAndBV.boundingVolume;\r\n Cartesian3.clone(Cartesian3.ZERO, boundingVolume.center);\r\n boundingVolume.radius = 1.0;\r\n\r\n return scratchModelMatrixAndBV;\r\n}\r\n\r\nfunction sphereModelMatrixAndBoundingVolume(spheres, index) {\r\n let sphereIndex = index * packedSphereLength;\r\n\r\n const sphereRadius = spheres[sphereIndex++];\r\n\r\n const sphereTranslation = Cartesian3.unpack(\r\n spheres,\r\n sphereIndex,\r\n scratchCartesian\r\n );\r\n const sphereModelMatrix = Matrix4.fromTranslation(\r\n sphereTranslation,\r\n scratchModelMatrixAndBV.modelMatrix\r\n );\r\n Matrix4.multiplyByUniformScale(\r\n sphereModelMatrix,\r\n sphereRadius,\r\n sphereModelMatrix\r\n );\r\n\r\n const boundingVolume = scratchModelMatrixAndBV.boundingVolume;\r\n Cartesian3.clone(Cartesian3.ZERO, boundingVolume.center);\r\n boundingVolume.radius = 1.0;\r\n\r\n return scratchModelMatrixAndBV;\r\n}\r\n\r\nconst scratchPosition = new Cartesian3();\r\n\r\nfunction createPrimitive(\r\n options,\r\n primitive,\r\n primitiveBatchIds,\r\n geometry,\r\n getModelMatrixAndBoundingVolume\r\n) {\r\n if (!defined(primitive)) {\r\n return;\r\n }\r\n\r\n const numberOfPrimitives = primitiveBatchIds.length;\r\n const geometryPositions = geometry.attributes.position.values;\r\n const geometryIndices = geometry.indices;\r\n\r\n const positions = options.positions;\r\n const vertexBatchIds = options.vertexBatchIds;\r\n const indices = options.indices;\r\n\r\n const batchIds = options.batchIds;\r\n const batchTableColors = options.batchTableColors;\r\n const batchedIndices = options.batchedIndices;\r\n const indexOffsets = options.indexOffsets;\r\n const indexCounts = options.indexCounts;\r\n const boundingVolumes = options.boundingVolumes;\r\n\r\n const modelMatrix = options.modelMatrix;\r\n const center = options.center;\r\n\r\n let positionOffset = options.positionOffset;\r\n let batchIdIndex = options.batchIdIndex;\r\n let indexOffset = options.indexOffset;\r\n const batchedIndicesOffset = options.batchedIndicesOffset;\r\n\r\n for (let i = 0; i < numberOfPrimitives; ++i) {\r\n const primitiveModelMatrixAndBV = getModelMatrixAndBoundingVolume(\r\n primitive,\r\n i\r\n );\r\n const primitiveModelMatrix = primitiveModelMatrixAndBV.modelMatrix;\r\n Matrix4.multiply(modelMatrix, primitiveModelMatrix, primitiveModelMatrix);\r\n\r\n const batchId = primitiveBatchIds[i];\r\n\r\n const positionsLength = geometryPositions.length;\r\n for (let j = 0; j < positionsLength; j += 3) {\r\n const position = Cartesian3.unpack(geometryPositions, j, scratchPosition);\r\n Matrix4.multiplyByPoint(primitiveModelMatrix, position, position);\r\n Cartesian3.subtract(position, center, position);\r\n\r\n Cartesian3.pack(position, positions, positionOffset * 3 + j);\r\n vertexBatchIds[batchIdIndex++] = batchId;\r\n }\r\n\r\n const indicesLength = geometryIndices.length;\r\n for (let k = 0; k < indicesLength; ++k) {\r\n indices[indexOffset + k] = geometryIndices[k] + positionOffset;\r\n }\r\n\r\n const offset = i + batchedIndicesOffset;\r\n batchedIndices[offset] = new Vector3DTileBatch({\r\n offset: indexOffset,\r\n count: indicesLength,\r\n color: Color.fromRgba(batchTableColors[batchId]),\r\n batchIds: [batchId],\r\n });\r\n batchIds[offset] = batchId;\r\n indexOffsets[offset] = indexOffset;\r\n indexCounts[offset] = indicesLength;\r\n boundingVolumes[offset] = BoundingSphere.transform(\r\n primitiveModelMatrixAndBV.boundingVolume,\r\n primitiveModelMatrix\r\n );\r\n\r\n positionOffset += positionsLength / 3;\r\n indexOffset += indicesLength;\r\n }\r\n\r\n options.positionOffset = positionOffset;\r\n options.batchIdIndex = batchIdIndex;\r\n options.indexOffset = indexOffset;\r\n options.batchedIndicesOffset += numberOfPrimitives;\r\n}\r\n\r\nconst scratchCenter = new Cartesian3();\r\nconst scratchMatrix4 = new Matrix4();\r\n\r\nfunction unpackBuffer(buffer) {\r\n const packedBuffer = new Float64Array(buffer);\r\n\r\n let offset = 0;\r\n Cartesian3.unpack(packedBuffer, offset, scratchCenter);\r\n offset += Cartesian3.packedLength;\r\n\r\n Matrix4.unpack(packedBuffer, offset, scratchMatrix4);\r\n}\r\n\r\nfunction packedBatchedIndicesLength(batchedIndices) {\r\n const length = batchedIndices.length;\r\n let count = 0;\r\n for (let i = 0; i < length; ++i) {\r\n count += Color.packedLength + 3 + batchedIndices[i].batchIds.length;\r\n }\r\n return count;\r\n}\r\n\r\nfunction packBuffer(indicesBytesPerElement, batchedIndices, boundingVolumes) {\r\n const numBVs = boundingVolumes.length;\r\n const length =\r\n 1 +\r\n 1 +\r\n numBVs * BoundingSphere.packedLength +\r\n 1 +\r\n packedBatchedIndicesLength(batchedIndices);\r\n\r\n const packedBuffer = new Float64Array(length);\r\n\r\n let offset = 0;\r\n packedBuffer[offset++] = indicesBytesPerElement;\r\n packedBuffer[offset++] = numBVs;\r\n\r\n for (let i = 0; i < numBVs; ++i) {\r\n BoundingSphere.pack(boundingVolumes[i], packedBuffer, offset);\r\n offset += BoundingSphere.packedLength;\r\n }\r\n\r\n const indicesLength = batchedIndices.length;\r\n packedBuffer[offset++] = indicesLength;\r\n\r\n for (let j = 0; j < indicesLength; ++j) {\r\n const batchedIndex = batchedIndices[j];\r\n\r\n Color.pack(batchedIndex.color, packedBuffer, offset);\r\n offset += Color.packedLength;\r\n\r\n packedBuffer[offset++] = batchedIndex.offset;\r\n packedBuffer[offset++] = batchedIndex.count;\r\n\r\n const batchIds = batchedIndex.batchIds;\r\n const batchIdsLength = batchIds.length;\r\n packedBuffer[offset++] = batchIdsLength;\r\n\r\n for (let k = 0; k < batchIdsLength; ++k) {\r\n packedBuffer[offset++] = batchIds[k];\r\n }\r\n }\r\n\r\n return packedBuffer;\r\n}\r\n\r\nfunction createVectorTileGeometries(parameters, transferableObjects) {\r\n const boxes = defined(parameters.boxes)\r\n ? new Float32Array(parameters.boxes)\r\n : undefined;\r\n const boxBatchIds = defined(parameters.boxBatchIds)\r\n ? new Uint16Array(parameters.boxBatchIds)\r\n : undefined;\r\n const cylinders = defined(parameters.cylinders)\r\n ? new Float32Array(parameters.cylinders)\r\n : undefined;\r\n const cylinderBatchIds = defined(parameters.cylinderBatchIds)\r\n ? new Uint16Array(parameters.cylinderBatchIds)\r\n : undefined;\r\n const ellipsoids = defined(parameters.ellipsoids)\r\n ? new Float32Array(parameters.ellipsoids)\r\n : undefined;\r\n const ellipsoidBatchIds = defined(parameters.ellipsoidBatchIds)\r\n ? new Uint16Array(parameters.ellipsoidBatchIds)\r\n : undefined;\r\n const spheres = defined(parameters.spheres)\r\n ? new Float32Array(parameters.spheres)\r\n : undefined;\r\n const sphereBatchIds = defined(parameters.sphereBatchIds)\r\n ? new Uint16Array(parameters.sphereBatchIds)\r\n : undefined;\r\n\r\n const numberOfBoxes = defined(boxes) ? boxBatchIds.length : 0;\r\n const numberOfCylinders = defined(cylinders) ? cylinderBatchIds.length : 0;\r\n const numberOfEllipsoids = defined(ellipsoids) ? ellipsoidBatchIds.length : 0;\r\n const numberOfSpheres = defined(spheres) ? sphereBatchIds.length : 0;\r\n\r\n const boxGeometry = BoxGeometry.getUnitBox();\r\n const cylinderGeometry = CylinderGeometry.getUnitCylinder();\r\n const ellipsoidGeometry = EllipsoidGeometry.getUnitEllipsoid();\r\n\r\n const boxPositions = boxGeometry.attributes.position.values;\r\n const cylinderPositions = cylinderGeometry.attributes.position.values;\r\n const ellipsoidPositions = ellipsoidGeometry.attributes.position.values;\r\n\r\n let numberOfPositions = boxPositions.length * numberOfBoxes;\r\n numberOfPositions += cylinderPositions.length * numberOfCylinders;\r\n numberOfPositions +=\r\n ellipsoidPositions.length * (numberOfEllipsoids + numberOfSpheres);\r\n\r\n const boxIndices = boxGeometry.indices;\r\n const cylinderIndices = cylinderGeometry.indices;\r\n const ellipsoidIndices = ellipsoidGeometry.indices;\r\n\r\n let numberOfIndices = boxIndices.length * numberOfBoxes;\r\n numberOfIndices += cylinderIndices.length * numberOfCylinders;\r\n numberOfIndices +=\r\n ellipsoidIndices.length * (numberOfEllipsoids + numberOfSpheres);\r\n\r\n const positions = new Float32Array(numberOfPositions);\r\n const vertexBatchIds = new Uint16Array(numberOfPositions / 3);\r\n const indices = IndexDatatype.createTypedArray(\r\n numberOfPositions / 3,\r\n numberOfIndices\r\n );\r\n\r\n const numberOfGeometries =\r\n numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;\r\n const batchIds = new Uint16Array(numberOfGeometries);\r\n const batchedIndices = new Array(numberOfGeometries);\r\n const indexOffsets = new Uint32Array(numberOfGeometries);\r\n const indexCounts = new Uint32Array(numberOfGeometries);\r\n const boundingVolumes = new Array(numberOfGeometries);\r\n\r\n unpackBuffer(parameters.packedBuffer);\r\n\r\n const options = {\r\n batchTableColors: new Uint32Array(parameters.batchTableColors),\r\n positions: positions,\r\n vertexBatchIds: vertexBatchIds,\r\n indices: indices,\r\n batchIds: batchIds,\r\n batchedIndices: batchedIndices,\r\n indexOffsets: indexOffsets,\r\n indexCounts: indexCounts,\r\n boundingVolumes: boundingVolumes,\r\n positionOffset: 0,\r\n batchIdIndex: 0,\r\n indexOffset: 0,\r\n batchedIndicesOffset: 0,\r\n modelMatrix: scratchMatrix4,\r\n center: scratchCenter,\r\n };\r\n\r\n createPrimitive(\r\n options,\r\n boxes,\r\n boxBatchIds,\r\n boxGeometry,\r\n boxModelMatrixAndBoundingVolume\r\n );\r\n createPrimitive(\r\n options,\r\n cylinders,\r\n cylinderBatchIds,\r\n cylinderGeometry,\r\n cylinderModelMatrixAndBoundingVolume\r\n );\r\n createPrimitive(\r\n options,\r\n ellipsoids,\r\n ellipsoidBatchIds,\r\n ellipsoidGeometry,\r\n ellipsoidModelMatrixAndBoundingVolume\r\n );\r\n createPrimitive(\r\n options,\r\n spheres,\r\n sphereBatchIds,\r\n ellipsoidGeometry,\r\n sphereModelMatrixAndBoundingVolume\r\n );\r\n\r\n const packedBuffer = packBuffer(\r\n indices.BYTES_PER_ELEMENT,\r\n batchedIndices,\r\n boundingVolumes\r\n );\r\n transferableObjects.push(\r\n positions.buffer,\r\n vertexBatchIds.buffer,\r\n indices.buffer\r\n );\r\n transferableObjects.push(\r\n batchIds.buffer,\r\n indexOffsets.buffer,\r\n indexCounts.buffer\r\n );\r\n transferableObjects.push(packedBuffer.buffer);\r\n\r\n return {\r\n positions: positions.buffer,\r\n vertexBatchIds: vertexBatchIds.buffer,\r\n indices: indices.buffer,\r\n indexOffsets: indexOffsets.buffer,\r\n indexCounts: indexCounts.buffer,\r\n batchIds: batchIds.buffer,\r\n packedBuffer: packedBuffer.buffer,\r\n };\r\n}\r\nexport default createTaskProcessorWorker(createVectorTileGeometries);\r\n"],"names":["Cartesian3","Matrix4","BoundingSphere","defined","Color","BoxGeometry","CylinderGeometry","EllipsoidGeometry","IndexDatatype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,iBAAiB,CAAC,OAAO,EAAE;EACpC;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;EAC/B;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;EAC7B;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;EAC7B;EACA;EACA;EACA;EACA,EAAE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;EACnC;;ECvBA,MAAM,gBAAgB,GAAG,IAAIA,kBAAU,EAAE,CAAC;AAC1C;EACA,MAAM,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AAM;EACnB,IAAI,YAAY,CAAC,MAAM;EACvB,IAAI,WAAW,CAAC,MAAM;EACtB,GAAG,CAAC;EACJ,EAAE,mBAAmB,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;AAChD;EACA,EAAE,OAAO;EACT,IAAI,SAAS,EAAE,SAAS,CAAC,MAAM;EAC/B,IAAI,cAAc,EAAE,cAAc,CAAC,MAAM;EACzC,IAAI,OAAO,EAAE,OAAO,CAAC,MAAM;EAC3B,IAAI,YAAY,EAAE,YAAY,CAAC,MAAM;EACrC,IAAI,WAAW,EAAE,WAAW,CAAC,MAAM;EACnC,IAAI,QAAQ,EAAE,QAAQ,CAAC,MAAM;EAC7B,IAAI,YAAY,EAAE,YAAY,CAAC,MAAM;EACrC,GAAG,CAAC;EACJ,CAAC;AACD,qCAAe,yBAAyB,CAAC,0BAA0B,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createVectorTilePoints.js b/examples/cesium/Workers/createVectorTilePoints.js
new file mode 100644
index 0000000..e71d613
--- /dev/null
+++ b/examples/cesium/Workers/createVectorTilePoints.js
@@ -0,0 +1,105 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./AttributeCompression-e9888cb8', './Matrix3-f22b0303', './Math-9be8b918', './Matrix2-036c77dd', './createTaskProcessorWorker', './ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './Check-d10e5f2e', './WebGLConstants-f27a5e29', './RuntimeError-e5c6a8b9'], (function (AttributeCompression, Matrix3, Math, Matrix2, createTaskProcessorWorker, ComponentDatatype, defaultValue, Check, WebGLConstants, RuntimeError) { 'use strict';
+
+ const maxShort = 32767;
+
+ const scratchBVCartographic = new Matrix3.Cartographic();
+ const scratchEncodedPosition = new Matrix3.Cartesian3();
+
+ const scratchRectangle = new Matrix2.Rectangle();
+ const scratchEllipsoid = new Matrix3.Ellipsoid();
+ const scratchMinMaxHeights = {
+ min: undefined,
+ max: undefined,
+ };
+
+ function unpackBuffer(packedBuffer) {
+ packedBuffer = new Float64Array(packedBuffer);
+
+ let offset = 0;
+ scratchMinMaxHeights.min = packedBuffer[offset++];
+ scratchMinMaxHeights.max = packedBuffer[offset++];
+
+ Matrix2.Rectangle.unpack(packedBuffer, offset, scratchRectangle);
+ offset += Matrix2.Rectangle.packedLength;
+
+ Matrix3.Ellipsoid.unpack(packedBuffer, offset, scratchEllipsoid);
+ }
+
+ function createVectorTilePoints(parameters, transferableObjects) {
+ const positions = new Uint16Array(parameters.positions);
+
+ unpackBuffer(parameters.packedBuffer);
+ const rectangle = scratchRectangle;
+ const ellipsoid = scratchEllipsoid;
+ const minimumHeight = scratchMinMaxHeights.min;
+ const maximumHeight = scratchMinMaxHeights.max;
+
+ const positionsLength = positions.length / 3;
+ const uBuffer = positions.subarray(0, positionsLength);
+ const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
+ const heightBuffer = positions.subarray(
+ 2 * positionsLength,
+ 3 * positionsLength
+ );
+ AttributeCompression.AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);
+
+ const decoded = new Float64Array(positions.length);
+ for (let i = 0; i < positionsLength; ++i) {
+ const u = uBuffer[i];
+ const v = vBuffer[i];
+ const h = heightBuffer[i];
+
+ const lon = Math.CesiumMath.lerp(rectangle.west, rectangle.east, u / maxShort);
+ const lat = Math.CesiumMath.lerp(rectangle.south, rectangle.north, v / maxShort);
+ const alt = Math.CesiumMath.lerp(minimumHeight, maximumHeight, h / maxShort);
+
+ const cartographic = Matrix3.Cartographic.fromRadians(
+ lon,
+ lat,
+ alt,
+ scratchBVCartographic
+ );
+ const decodedPosition = ellipsoid.cartographicToCartesian(
+ cartographic,
+ scratchEncodedPosition
+ );
+ Matrix3.Cartesian3.pack(decodedPosition, decoded, i * 3);
+ }
+
+ transferableObjects.push(decoded.buffer);
+
+ return {
+ positions: decoded.buffer,
+ };
+ }
+ var createVectorTilePoints$1 = createTaskProcessorWorker(createVectorTilePoints);
+
+ return createVectorTilePoints$1;
+
+}));
+//# sourceMappingURL=createVectorTilePoints.js.map
diff --git a/examples/cesium/Workers/createVectorTilePoints.js.map b/examples/cesium/Workers/createVectorTilePoints.js.map
new file mode 100644
index 0000000..c4618b0
--- /dev/null
+++ b/examples/cesium/Workers/createVectorTilePoints.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createVectorTilePoints.js","sources":["../../../Source/WorkersES6/createVectorTilePoints.js"],"sourcesContent":["import AttributeCompression from \"../Core/AttributeCompression.js\";\r\nimport Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport Cartographic from \"../Core/Cartographic.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport CesiumMath from \"../Core/Math.js\";\r\nimport Rectangle from \"../Core/Rectangle.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nconst maxShort = 32767;\r\n\r\nconst scratchBVCartographic = new Cartographic();\r\nconst scratchEncodedPosition = new Cartesian3();\r\n\r\nconst scratchRectangle = new Rectangle();\r\nconst scratchEllipsoid = new Ellipsoid();\r\nconst scratchMinMaxHeights = {\r\n min: undefined,\r\n max: undefined,\r\n};\r\n\r\nfunction unpackBuffer(packedBuffer) {\r\n packedBuffer = new Float64Array(packedBuffer);\r\n\r\n let offset = 0;\r\n scratchMinMaxHeights.min = packedBuffer[offset++];\r\n scratchMinMaxHeights.max = packedBuffer[offset++];\r\n\r\n Rectangle.unpack(packedBuffer, offset, scratchRectangle);\r\n offset += Rectangle.packedLength;\r\n\r\n Ellipsoid.unpack(packedBuffer, offset, scratchEllipsoid);\r\n}\r\n\r\nfunction createVectorTilePoints(parameters, transferableObjects) {\r\n const positions = new Uint16Array(parameters.positions);\r\n\r\n unpackBuffer(parameters.packedBuffer);\r\n const rectangle = scratchRectangle;\r\n const ellipsoid = scratchEllipsoid;\r\n const minimumHeight = scratchMinMaxHeights.min;\r\n const maximumHeight = scratchMinMaxHeights.max;\r\n\r\n const positionsLength = positions.length / 3;\r\n const uBuffer = positions.subarray(0, positionsLength);\r\n const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);\r\n const heightBuffer = positions.subarray(\r\n 2 * positionsLength,\r\n 3 * positionsLength\r\n );\r\n AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);\r\n\r\n const decoded = new Float64Array(positions.length);\r\n for (let i = 0; i < positionsLength; ++i) {\r\n const u = uBuffer[i];\r\n const v = vBuffer[i];\r\n const h = heightBuffer[i];\r\n\r\n const lon = CesiumMath.lerp(rectangle.west, rectangle.east, u / maxShort);\r\n const lat = CesiumMath.lerp(rectangle.south, rectangle.north, v / maxShort);\r\n const alt = CesiumMath.lerp(minimumHeight, maximumHeight, h / maxShort);\r\n\r\n const cartographic = Cartographic.fromRadians(\r\n lon,\r\n lat,\r\n alt,\r\n scratchBVCartographic\r\n );\r\n const decodedPosition = ellipsoid.cartographicToCartesian(\r\n cartographic,\r\n scratchEncodedPosition\r\n );\r\n Cartesian3.pack(decodedPosition, decoded, i * 3);\r\n }\r\n\r\n transferableObjects.push(decoded.buffer);\r\n\r\n return {\r\n positions: decoded.buffer,\r\n };\r\n}\r\nexport default createTaskProcessorWorker(createVectorTilePoints);\r\n"],"names":["Cartographic","Cartesian3","Rectangle","Ellipsoid","AttributeCompression","CesiumMath"],"m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eAAU,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC;AAC5E;EACA,IAAI,MAAM,YAAY,GAAGL,oBAAY,CAAC,WAAW;EACjD,MAAM,GAAG;EACT,MAAM,GAAG;EACT,MAAM,GAAG;EACT,MAAM,qBAAqB;EAC3B,KAAK,CAAC;EACN,IAAI,MAAM,eAAe,GAAG,SAAS,CAAC,uBAAuB;EAC7D,MAAM,YAAY;EAClB,MAAM,sBAAsB;EAC5B,KAAK,CAAC;EACN,IAAIC,kBAAU,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;EACrD,GAAG;AACH;EACA,EAAE,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3C;EACA,EAAE,OAAO;EACT,IAAI,SAAS,EAAE,OAAO,CAAC,MAAM;EAC7B,GAAG,CAAC;EACJ,CAAC;AACD,iCAAe,yBAAyB,CAAC,sBAAsB,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createVectorTilePolygons.js b/examples/cesium/Workers/createVectorTilePolygons.js
new file mode 100644
index 0000000..a5eea92
--- /dev/null
+++ b/examples/cesium/Workers/createVectorTilePolygons.js
@@ -0,0 +1,432 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./AttributeCompression-e9888cb8', './Matrix3-f22b0303', './Color-c019c34b', './defaultValue-0ab18f7d', './IndexDatatype-b4e5cf89', './Math-9be8b918', './OrientedBoundingBox-7e2eebab', './Matrix2-036c77dd', './createTaskProcessorWorker', './ComponentDatatype-13a5630b', './Check-d10e5f2e', './WebGLConstants-f27a5e29', './Transforms-11fb6b0a', './combine-4598d225', './RuntimeError-e5c6a8b9', './EllipsoidTangentPlane-c421b2cb', './AxisAlignedBoundingBox-50342d27', './IntersectionTests-2c7928de', './Plane-c9f1487d'], (function (AttributeCompression, Matrix3, Color, defaultValue, IndexDatatype, Math$1, OrientedBoundingBox, Matrix2, createTaskProcessorWorker, ComponentDatatype, Check, WebGLConstants, Transforms, combine, RuntimeError, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane) { 'use strict';
+
+ const scratchCenter = new Matrix3.Cartesian3();
+ const scratchEllipsoid = new Matrix3.Ellipsoid();
+ const scratchRectangle = new Matrix2.Rectangle();
+ const scratchScalars = {
+ min: undefined,
+ max: undefined,
+ indexBytesPerElement: undefined,
+ };
+
+ function unpackBuffer(buffer) {
+ const packedBuffer = new Float64Array(buffer);
+
+ let offset = 0;
+ scratchScalars.indexBytesPerElement = packedBuffer[offset++];
+
+ scratchScalars.min = packedBuffer[offset++];
+ scratchScalars.max = packedBuffer[offset++];
+
+ Matrix3.Cartesian3.unpack(packedBuffer, offset, scratchCenter);
+ offset += Matrix3.Cartesian3.packedLength;
+
+ Matrix3.Ellipsoid.unpack(packedBuffer, offset, scratchEllipsoid);
+ offset += Matrix3.Ellipsoid.packedLength;
+
+ Matrix2.Rectangle.unpack(packedBuffer, offset, scratchRectangle);
+ }
+
+ function packedBatchedIndicesLength(batchedIndices) {
+ const length = batchedIndices.length;
+ let count = 0;
+ for (let i = 0; i < length; ++i) {
+ count += Color.Color.packedLength + 3 + batchedIndices[i].batchIds.length;
+ }
+ return count;
+ }
+
+ function packBuffer(indexDatatype, boundingVolumes, batchedIndices) {
+ const numBVs = boundingVolumes.length;
+ const length =
+ 1 +
+ 1 +
+ numBVs * OrientedBoundingBox.OrientedBoundingBox.packedLength +
+ 1 +
+ packedBatchedIndicesLength(batchedIndices);
+
+ const packedBuffer = new Float64Array(length);
+
+ let offset = 0;
+ packedBuffer[offset++] = indexDatatype;
+ packedBuffer[offset++] = numBVs;
+
+ for (let i = 0; i < numBVs; ++i) {
+ OrientedBoundingBox.OrientedBoundingBox.pack(boundingVolumes[i], packedBuffer, offset);
+ offset += OrientedBoundingBox.OrientedBoundingBox.packedLength;
+ }
+
+ const indicesLength = batchedIndices.length;
+ packedBuffer[offset++] = indicesLength;
+
+ for (let j = 0; j < indicesLength; ++j) {
+ const batchedIndex = batchedIndices[j];
+
+ Color.Color.pack(batchedIndex.color, packedBuffer, offset);
+ offset += Color.Color.packedLength;
+
+ packedBuffer[offset++] = batchedIndex.offset;
+ packedBuffer[offset++] = batchedIndex.count;
+
+ const batchIds = batchedIndex.batchIds;
+ const batchIdsLength = batchIds.length;
+ packedBuffer[offset++] = batchIdsLength;
+
+ for (let k = 0; k < batchIdsLength; ++k) {
+ packedBuffer[offset++] = batchIds[k];
+ }
+ }
+
+ return packedBuffer;
+ }
+
+ const maxShort = 32767;
+
+ const scratchEncodedPosition = new Matrix3.Cartesian3();
+ const scratchNormal = new Matrix3.Cartesian3();
+ const scratchScaledNormal = new Matrix3.Cartesian3();
+ const scratchMinHeightPosition = new Matrix3.Cartesian3();
+ const scratchMaxHeightPosition = new Matrix3.Cartesian3();
+ const scratchBVCartographic = new Matrix3.Cartographic();
+ const scratchBVRectangle = new Matrix2.Rectangle();
+
+ function createVectorTilePolygons(parameters, transferableObjects) {
+ unpackBuffer(parameters.packedBuffer);
+
+ let indices;
+ const indexBytesPerElement = scratchScalars.indexBytesPerElement;
+ if (indexBytesPerElement === 2) {
+ indices = new Uint16Array(parameters.indices);
+ } else {
+ indices = new Uint32Array(parameters.indices);
+ }
+
+ const positions = new Uint16Array(parameters.positions);
+ const counts = new Uint32Array(parameters.counts);
+ const indexCounts = new Uint32Array(parameters.indexCounts);
+ const batchIds = new Uint32Array(parameters.batchIds);
+ const batchTableColors = new Uint32Array(parameters.batchTableColors);
+
+ const boundingVolumes = new Array(counts.length);
+
+ const center = scratchCenter;
+ const ellipsoid = scratchEllipsoid;
+ let rectangle = scratchRectangle;
+ const minHeight = scratchScalars.min;
+ const maxHeight = scratchScalars.max;
+
+ let minimumHeights = parameters.minimumHeights;
+ let maximumHeights = parameters.maximumHeights;
+ if (defaultValue.defined(minimumHeights) && defaultValue.defined(maximumHeights)) {
+ minimumHeights = new Float32Array(minimumHeights);
+ maximumHeights = new Float32Array(maximumHeights);
+ }
+
+ let i;
+ let j;
+ let rgba;
+
+ const positionsLength = positions.length / 2;
+ const uBuffer = positions.subarray(0, positionsLength);
+ const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
+ AttributeCompression.AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer);
+
+ const decodedPositions = new Float64Array(positionsLength * 3);
+ for (i = 0; i < positionsLength; ++i) {
+ const u = uBuffer[i];
+ const v = vBuffer[i];
+
+ const x = Math$1.CesiumMath.lerp(rectangle.west, rectangle.east, u / maxShort);
+ const y = Math$1.CesiumMath.lerp(rectangle.south, rectangle.north, v / maxShort);
+
+ const cart = Matrix3.Cartographic.fromRadians(x, y, 0.0, scratchBVCartographic);
+ const decodedPosition = ellipsoid.cartographicToCartesian(
+ cart,
+ scratchEncodedPosition
+ );
+ Matrix3.Cartesian3.pack(decodedPosition, decodedPositions, i * 3);
+ }
+
+ const countsLength = counts.length;
+ const offsets = new Array(countsLength);
+ const indexOffsets = new Array(countsLength);
+ let currentOffset = 0;
+ let currentIndexOffset = 0;
+ for (i = 0; i < countsLength; ++i) {
+ offsets[i] = currentOffset;
+ indexOffsets[i] = currentIndexOffset;
+
+ currentOffset += counts[i];
+ currentIndexOffset += indexCounts[i];
+ }
+
+ const batchedPositions = new Float32Array(positionsLength * 3 * 2);
+ const batchedIds = new Uint16Array(positionsLength * 2);
+ const batchedIndexOffsets = new Uint32Array(indexOffsets.length);
+ const batchedIndexCounts = new Uint32Array(indexCounts.length);
+ let batchedIndices = [];
+
+ const colorToBuffers = {};
+ for (i = 0; i < countsLength; ++i) {
+ rgba = batchTableColors[i];
+ if (!defaultValue.defined(colorToBuffers[rgba])) {
+ colorToBuffers[rgba] = {
+ positionLength: counts[i],
+ indexLength: indexCounts[i],
+ offset: 0,
+ indexOffset: 0,
+ batchIds: [i],
+ };
+ } else {
+ colorToBuffers[rgba].positionLength += counts[i];
+ colorToBuffers[rgba].indexLength += indexCounts[i];
+ colorToBuffers[rgba].batchIds.push(i);
+ }
+ }
+
+ // get the offsets and counts for the positions and indices of each primitive
+ let buffer;
+ let byColorPositionOffset = 0;
+ let byColorIndexOffset = 0;
+ for (rgba in colorToBuffers) {
+ if (colorToBuffers.hasOwnProperty(rgba)) {
+ buffer = colorToBuffers[rgba];
+ buffer.offset = byColorPositionOffset;
+ buffer.indexOffset = byColorIndexOffset;
+
+ const positionLength = buffer.positionLength * 2;
+ const indexLength = buffer.indexLength * 2 + buffer.positionLength * 6;
+
+ byColorPositionOffset += positionLength;
+ byColorIndexOffset += indexLength;
+
+ buffer.indexLength = indexLength;
+ }
+ }
+
+ const batchedDrawCalls = [];
+
+ for (rgba in colorToBuffers) {
+ if (colorToBuffers.hasOwnProperty(rgba)) {
+ buffer = colorToBuffers[rgba];
+
+ batchedDrawCalls.push({
+ color: Color.Color.fromRgba(parseInt(rgba)),
+ offset: buffer.indexOffset,
+ count: buffer.indexLength,
+ batchIds: buffer.batchIds,
+ });
+ }
+ }
+
+ for (i = 0; i < countsLength; ++i) {
+ rgba = batchTableColors[i];
+
+ buffer = colorToBuffers[rgba];
+ const positionOffset = buffer.offset;
+ let positionIndex = positionOffset * 3;
+ let batchIdIndex = positionOffset;
+
+ const polygonOffset = offsets[i];
+ const polygonCount = counts[i];
+ const batchId = batchIds[i];
+
+ let polygonMinimumHeight = minHeight;
+ let polygonMaximumHeight = maxHeight;
+ if (defaultValue.defined(minimumHeights) && defaultValue.defined(maximumHeights)) {
+ polygonMinimumHeight = minimumHeights[i];
+ polygonMaximumHeight = maximumHeights[i];
+ }
+
+ let minLat = Number.POSITIVE_INFINITY;
+ let maxLat = Number.NEGATIVE_INFINITY;
+ let minLon = Number.POSITIVE_INFINITY;
+ let maxLon = Number.NEGATIVE_INFINITY;
+
+ for (j = 0; j < polygonCount; ++j) {
+ const position = Matrix3.Cartesian3.unpack(
+ decodedPositions,
+ polygonOffset * 3 + j * 3,
+ scratchEncodedPosition
+ );
+ ellipsoid.scaleToGeodeticSurface(position, position);
+
+ const carto = ellipsoid.cartesianToCartographic(
+ position,
+ scratchBVCartographic
+ );
+ const lat = carto.latitude;
+ const lon = carto.longitude;
+
+ minLat = Math.min(lat, minLat);
+ maxLat = Math.max(lat, maxLat);
+ minLon = Math.min(lon, minLon);
+ maxLon = Math.max(lon, maxLon);
+
+ const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);
+ let scaledNormal = Matrix3.Cartesian3.multiplyByScalar(
+ normal,
+ polygonMinimumHeight,
+ scratchScaledNormal
+ );
+ const minHeightPosition = Matrix3.Cartesian3.add(
+ position,
+ scaledNormal,
+ scratchMinHeightPosition
+ );
+
+ scaledNormal = Matrix3.Cartesian3.multiplyByScalar(
+ normal,
+ polygonMaximumHeight,
+ scaledNormal
+ );
+ const maxHeightPosition = Matrix3.Cartesian3.add(
+ position,
+ scaledNormal,
+ scratchMaxHeightPosition
+ );
+
+ Matrix3.Cartesian3.subtract(maxHeightPosition, center, maxHeightPosition);
+ Matrix3.Cartesian3.subtract(minHeightPosition, center, minHeightPosition);
+
+ Matrix3.Cartesian3.pack(maxHeightPosition, batchedPositions, positionIndex);
+ Matrix3.Cartesian3.pack(minHeightPosition, batchedPositions, positionIndex + 3);
+
+ batchedIds[batchIdIndex] = batchId;
+ batchedIds[batchIdIndex + 1] = batchId;
+
+ positionIndex += 6;
+ batchIdIndex += 2;
+ }
+
+ rectangle = scratchBVRectangle;
+ rectangle.west = minLon;
+ rectangle.east = maxLon;
+ rectangle.south = minLat;
+ rectangle.north = maxLat;
+
+ boundingVolumes[i] = OrientedBoundingBox.OrientedBoundingBox.fromRectangle(
+ rectangle,
+ minHeight,
+ maxHeight,
+ ellipsoid
+ );
+
+ let indicesIndex = buffer.indexOffset;
+
+ const indexOffset = indexOffsets[i];
+ const indexCount = indexCounts[i];
+
+ batchedIndexOffsets[i] = indicesIndex;
+
+ for (j = 0; j < indexCount; j += 3) {
+ const i0 = indices[indexOffset + j] - polygonOffset;
+ const i1 = indices[indexOffset + j + 1] - polygonOffset;
+ const i2 = indices[indexOffset + j + 2] - polygonOffset;
+
+ // triangle on the top of the extruded polygon
+ batchedIndices[indicesIndex++] = i0 * 2 + positionOffset;
+ batchedIndices[indicesIndex++] = i1 * 2 + positionOffset;
+ batchedIndices[indicesIndex++] = i2 * 2 + positionOffset;
+
+ // triangle on the bottom of the extruded polygon
+ batchedIndices[indicesIndex++] = i2 * 2 + 1 + positionOffset;
+ batchedIndices[indicesIndex++] = i1 * 2 + 1 + positionOffset;
+ batchedIndices[indicesIndex++] = i0 * 2 + 1 + positionOffset;
+ }
+
+ // indices for the walls of the extruded polygon
+ for (j = 0; j < polygonCount; ++j) {
+ const v0 = j;
+ const v1 = (j + 1) % polygonCount;
+
+ batchedIndices[indicesIndex++] = v0 * 2 + 1 + positionOffset;
+ batchedIndices[indicesIndex++] = v1 * 2 + positionOffset;
+ batchedIndices[indicesIndex++] = v0 * 2 + positionOffset;
+
+ batchedIndices[indicesIndex++] = v0 * 2 + 1 + positionOffset;
+ batchedIndices[indicesIndex++] = v1 * 2 + 1 + positionOffset;
+ batchedIndices[indicesIndex++] = v1 * 2 + positionOffset;
+ }
+
+ buffer.offset += polygonCount * 2;
+ buffer.indexOffset = indicesIndex;
+
+ batchedIndexCounts[i] = indicesIndex - batchedIndexOffsets[i];
+ }
+
+ batchedIndices = IndexDatatype.IndexDatatype.createTypedArray(
+ batchedPositions.length / 3,
+ batchedIndices
+ );
+
+ const batchedIndicesLength = batchedDrawCalls.length;
+ for (let m = 0; m < batchedIndicesLength; ++m) {
+ const tempIds = batchedDrawCalls[m].batchIds;
+ let count = 0;
+ const tempIdsLength = tempIds.length;
+ for (let n = 0; n < tempIdsLength; ++n) {
+ count += batchedIndexCounts[tempIds[n]];
+ }
+ batchedDrawCalls[m].count = count;
+ }
+
+ const indexDatatype =
+ batchedIndices.BYTES_PER_ELEMENT === 2
+ ? IndexDatatype.IndexDatatype.UNSIGNED_SHORT
+ : IndexDatatype.IndexDatatype.UNSIGNED_INT;
+ const packedBuffer = packBuffer(
+ indexDatatype,
+ boundingVolumes,
+ batchedDrawCalls
+ );
+
+ transferableObjects.push(
+ batchedPositions.buffer,
+ batchedIndices.buffer,
+ batchedIndexOffsets.buffer,
+ batchedIndexCounts.buffer,
+ batchedIds.buffer,
+ packedBuffer.buffer
+ );
+
+ return {
+ positions: batchedPositions.buffer,
+ indices: batchedIndices.buffer,
+ indexOffsets: batchedIndexOffsets.buffer,
+ indexCounts: batchedIndexCounts.buffer,
+ batchIds: batchedIds.buffer,
+ packedBuffer: packedBuffer.buffer,
+ };
+ }
+ var createVectorTilePolygons$1 = createTaskProcessorWorker(createVectorTilePolygons);
+
+ return createVectorTilePolygons$1;
+
+}));
+//# sourceMappingURL=createVectorTilePolygons.js.map
diff --git a/examples/cesium/Workers/createVectorTilePolygons.js.map b/examples/cesium/Workers/createVectorTilePolygons.js.map
new file mode 100644
index 0000000..a389b09
--- /dev/null
+++ b/examples/cesium/Workers/createVectorTilePolygons.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createVectorTilePolygons.js","sources":["../../../Source/WorkersES6/createVectorTilePolygons.js"],"sourcesContent":["import AttributeCompression from \"../Core/AttributeCompression.js\";\r\nimport Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport Cartographic from \"../Core/Cartographic.js\";\r\nimport Color from \"../Core/Color.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\r\nimport CesiumMath from \"../Core/Math.js\";\r\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\r\nimport Rectangle from \"../Core/Rectangle.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nconst scratchCenter = new Cartesian3();\r\nconst scratchEllipsoid = new Ellipsoid();\r\nconst scratchRectangle = new Rectangle();\r\nconst scratchScalars = {\r\n min: undefined,\r\n max: undefined,\r\n indexBytesPerElement: undefined,\r\n};\r\n\r\nfunction unpackBuffer(buffer) {\r\n const packedBuffer = new Float64Array(buffer);\r\n\r\n let offset = 0;\r\n scratchScalars.indexBytesPerElement = packedBuffer[offset++];\r\n\r\n scratchScalars.min = packedBuffer[offset++];\r\n scratchScalars.max = packedBuffer[offset++];\r\n\r\n Cartesian3.unpack(packedBuffer, offset, scratchCenter);\r\n offset += Cartesian3.packedLength;\r\n\r\n Ellipsoid.unpack(packedBuffer, offset, scratchEllipsoid);\r\n offset += Ellipsoid.packedLength;\r\n\r\n Rectangle.unpack(packedBuffer, offset, scratchRectangle);\r\n}\r\n\r\nfunction packedBatchedIndicesLength(batchedIndices) {\r\n const length = batchedIndices.length;\r\n let count = 0;\r\n for (let i = 0; i < length; ++i) {\r\n count += Color.packedLength + 3 + batchedIndices[i].batchIds.length;\r\n }\r\n return count;\r\n}\r\n\r\nfunction packBuffer(indexDatatype, boundingVolumes, batchedIndices) {\r\n const numBVs = boundingVolumes.length;\r\n const length =\r\n 1 +\r\n 1 +\r\n numBVs * OrientedBoundingBox.packedLength +\r\n 1 +\r\n packedBatchedIndicesLength(batchedIndices);\r\n\r\n const packedBuffer = new Float64Array(length);\r\n\r\n let offset = 0;\r\n packedBuffer[offset++] = indexDatatype;\r\n packedBuffer[offset++] = numBVs;\r\n\r\n for (let i = 0; i < numBVs; ++i) {\r\n OrientedBoundingBox.pack(boundingVolumes[i], packedBuffer, offset);\r\n offset += OrientedBoundingBox.packedLength;\r\n }\r\n\r\n const indicesLength = batchedIndices.length;\r\n packedBuffer[offset++] = indicesLength;\r\n\r\n for (let j = 0; j < indicesLength; ++j) {\r\n const batchedIndex = batchedIndices[j];\r\n\r\n Color.pack(batchedIndex.color, packedBuffer, offset);\r\n offset += Color.packedLength;\r\n\r\n packedBuffer[offset++] = batchedIndex.offset;\r\n packedBuffer[offset++] = batchedIndex.count;\r\n\r\n const batchIds = batchedIndex.batchIds;\r\n const batchIdsLength = batchIds.length;\r\n packedBuffer[offset++] = batchIdsLength;\r\n\r\n for (let k = 0; k < batchIdsLength; ++k) {\r\n packedBuffer[offset++] = batchIds[k];\r\n }\r\n }\r\n\r\n return packedBuffer;\r\n}\r\n\r\nconst maxShort = 32767;\r\n\r\nconst scratchEncodedPosition = new Cartesian3();\r\nconst scratchNormal = new Cartesian3();\r\nconst scratchScaledNormal = new Cartesian3();\r\nconst scratchMinHeightPosition = new Cartesian3();\r\nconst scratchMaxHeightPosition = new Cartesian3();\r\nconst scratchBVCartographic = new Cartographic();\r\nconst scratchBVRectangle = new Rectangle();\r\n\r\nfunction createVectorTilePolygons(parameters, transferableObjects) {\r\n unpackBuffer(parameters.packedBuffer);\r\n\r\n let indices;\r\n const indexBytesPerElement = scratchScalars.indexBytesPerElement;\r\n if (indexBytesPerElement === 2) {\r\n indices = new Uint16Array(parameters.indices);\r\n } else {\r\n indices = new Uint32Array(parameters.indices);\r\n }\r\n\r\n const positions = new Uint16Array(parameters.positions);\r\n const counts = new Uint32Array(parameters.counts);\r\n const indexCounts = new Uint32Array(parameters.indexCounts);\r\n const batchIds = new Uint32Array(parameters.batchIds);\r\n const batchTableColors = new Uint32Array(parameters.batchTableColors);\r\n\r\n const boundingVolumes = new Array(counts.length);\r\n\r\n const center = scratchCenter;\r\n const ellipsoid = scratchEllipsoid;\r\n let rectangle = scratchRectangle;\r\n const minHeight = scratchScalars.min;\r\n const maxHeight = scratchScalars.max;\r\n\r\n let minimumHeights = parameters.minimumHeights;\r\n let maximumHeights = parameters.maximumHeights;\r\n if (defined(minimumHeights) && defined(maximumHeights)) {\r\n minimumHeights = new Float32Array(minimumHeights);\r\n maximumHeights = new Float32Array(maximumHeights);\r\n }\r\n\r\n let i;\r\n let j;\r\n let rgba;\r\n\r\n const positionsLength = positions.length / 2;\r\n const uBuffer = positions.subarray(0, positionsLength);\r\n const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);\r\n AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer);\r\n\r\n const decodedPositions = new Float64Array(positionsLength * 3);\r\n for (i = 0; i < positionsLength; ++i) {\r\n const u = uBuffer[i];\r\n const v = vBuffer[i];\r\n\r\n const x = CesiumMath.lerp(rectangle.west, rectangle.east, u / maxShort);\r\n const y = CesiumMath.lerp(rectangle.south, rectangle.north, v / maxShort);\r\n\r\n const cart = Cartographic.fromRadians(x, y, 0.0, scratchBVCartographic);\r\n const decodedPosition = ellipsoid.cartographicToCartesian(\r\n cart,\r\n scratchEncodedPosition\r\n );\r\n Cartesian3.pack(decodedPosition, decodedPositions, i * 3);\r\n }\r\n\r\n const countsLength = counts.length;\r\n const offsets = new Array(countsLength);\r\n const indexOffsets = new Array(countsLength);\r\n let currentOffset = 0;\r\n let currentIndexOffset = 0;\r\n for (i = 0; i < countsLength; ++i) {\r\n offsets[i] = currentOffset;\r\n indexOffsets[i] = currentIndexOffset;\r\n\r\n currentOffset += counts[i];\r\n currentIndexOffset += indexCounts[i];\r\n }\r\n\r\n const batchedPositions = new Float32Array(positionsLength * 3 * 2);\r\n const batchedIds = new Uint16Array(positionsLength * 2);\r\n const batchedIndexOffsets = new Uint32Array(indexOffsets.length);\r\n const batchedIndexCounts = new Uint32Array(indexCounts.length);\r\n let batchedIndices = [];\r\n\r\n const colorToBuffers = {};\r\n for (i = 0; i < countsLength; ++i) {\r\n rgba = batchTableColors[i];\r\n if (!defined(colorToBuffers[rgba])) {\r\n colorToBuffers[rgba] = {\r\n positionLength: counts[i],\r\n indexLength: indexCounts[i],\r\n offset: 0,\r\n indexOffset: 0,\r\n batchIds: [i],\r\n };\r\n } else {\r\n colorToBuffers[rgba].positionLength += counts[i];\r\n colorToBuffers[rgba].indexLength += indexCounts[i];\r\n colorToBuffers[rgba].batchIds.push(i);\r\n }\r\n }\r\n\r\n // get the offsets and counts for the positions and indices of each primitive\r\n let buffer;\r\n let byColorPositionOffset = 0;\r\n let byColorIndexOffset = 0;\r\n for (rgba in colorToBuffers) {\r\n if (colorToBuffers.hasOwnProperty(rgba)) {\r\n buffer = colorToBuffers[rgba];\r\n buffer.offset = byColorPositionOffset;\r\n buffer.indexOffset = byColorIndexOffset;\r\n\r\n const positionLength = buffer.positionLength * 2;\r\n const indexLength = buffer.indexLength * 2 + buffer.positionLength * 6;\r\n\r\n byColorPositionOffset += positionLength;\r\n byColorIndexOffset += indexLength;\r\n\r\n buffer.indexLength = indexLength;\r\n }\r\n }\r\n\r\n const batchedDrawCalls = [];\r\n\r\n for (rgba in colorToBuffers) {\r\n if (colorToBuffers.hasOwnProperty(rgba)) {\r\n buffer = colorToBuffers[rgba];\r\n\r\n batchedDrawCalls.push({\r\n color: Color.fromRgba(parseInt(rgba)),\r\n offset: buffer.indexOffset,\r\n count: buffer.indexLength,\r\n batchIds: buffer.batchIds,\r\n });\r\n }\r\n }\r\n\r\n for (i = 0; i < countsLength; ++i) {\r\n rgba = batchTableColors[i];\r\n\r\n buffer = colorToBuffers[rgba];\r\n const positionOffset = buffer.offset;\r\n let positionIndex = positionOffset * 3;\r\n let batchIdIndex = positionOffset;\r\n\r\n const polygonOffset = offsets[i];\r\n const polygonCount = counts[i];\r\n const batchId = batchIds[i];\r\n\r\n let polygonMinimumHeight = minHeight;\r\n let polygonMaximumHeight = maxHeight;\r\n if (defined(minimumHeights) && defined(maximumHeights)) {\r\n polygonMinimumHeight = minimumHeights[i];\r\n polygonMaximumHeight = maximumHeights[i];\r\n }\r\n\r\n let minLat = Number.POSITIVE_INFINITY;\r\n let maxLat = Number.NEGATIVE_INFINITY;\r\n let minLon = Number.POSITIVE_INFINITY;\r\n let maxLon = Number.NEGATIVE_INFINITY;\r\n\r\n for (j = 0; j < polygonCount; ++j) {\r\n const position = Cartesian3.unpack(\r\n decodedPositions,\r\n polygonOffset * 3 + j * 3,\r\n scratchEncodedPosition\r\n );\r\n ellipsoid.scaleToGeodeticSurface(position, position);\r\n\r\n const carto = ellipsoid.cartesianToCartographic(\r\n position,\r\n scratchBVCartographic\r\n );\r\n const lat = carto.latitude;\r\n const lon = carto.longitude;\r\n\r\n minLat = Math.min(lat, minLat);\r\n maxLat = Math.max(lat, maxLat);\r\n minLon = Math.min(lon, minLon);\r\n maxLon = Math.max(lon, maxLon);\r\n\r\n const normal = ellipsoid.geodeticSurfaceNormal(position, scratchNormal);\r\n let scaledNormal = Cartesian3.multiplyByScalar(\r\n normal,\r\n polygonMinimumHeight,\r\n scratchScaledNormal\r\n );\r\n const minHeightPosition = Cartesian3.add(\r\n position,\r\n scaledNormal,\r\n scratchMinHeightPosition\r\n );\r\n\r\n scaledNormal = Cartesian3.multiplyByScalar(\r\n normal,\r\n polygonMaximumHeight,\r\n scaledNormal\r\n );\r\n const maxHeightPosition = Cartesian3.add(\r\n position,\r\n scaledNormal,\r\n scratchMaxHeightPosition\r\n );\r\n\r\n Cartesian3.subtract(maxHeightPosition, center, maxHeightPosition);\r\n Cartesian3.subtract(minHeightPosition, center, minHeightPosition);\r\n\r\n Cartesian3.pack(maxHeightPosition, batchedPositions, positionIndex);\r\n Cartesian3.pack(minHeightPosition, batchedPositions, positionIndex + 3);\r\n\r\n batchedIds[batchIdIndex] = batchId;\r\n batchedIds[batchIdIndex + 1] = batchId;\r\n\r\n positionIndex += 6;\r\n batchIdIndex += 2;\r\n }\r\n\r\n rectangle = scratchBVRectangle;\r\n rectangle.west = minLon;\r\n rectangle.east = maxLon;\r\n rectangle.south = minLat;\r\n rectangle.north = maxLat;\r\n\r\n boundingVolumes[i] = OrientedBoundingBox.fromRectangle(\r\n rectangle,\r\n minHeight,\r\n maxHeight,\r\n ellipsoid\r\n );\r\n\r\n let indicesIndex = buffer.indexOffset;\r\n\r\n const indexOffset = indexOffsets[i];\r\n const indexCount = indexCounts[i];\r\n\r\n batchedIndexOffsets[i] = indicesIndex;\r\n\r\n for (j = 0; j < indexCount; j += 3) {\r\n const i0 = indices[indexOffset + j] - polygonOffset;\r\n const i1 = indices[indexOffset + j + 1] - polygonOffset;\r\n const i2 = indices[indexOffset + j + 2] - polygonOffset;\r\n\r\n // triangle on the top of the extruded polygon\r\n batchedIndices[indicesIndex++] = i0 * 2 + positionOffset;\r\n batchedIndices[indicesIndex++] = i1 * 2 + positionOffset;\r\n batchedIndices[indicesIndex++] = i2 * 2 + positionOffset;\r\n\r\n // triangle on the bottom of the extruded polygon\r\n batchedIndices[indicesIndex++] = i2 * 2 + 1 + positionOffset;\r\n batchedIndices[indicesIndex++] = i1 * 2 + 1 + positionOffset;\r\n batchedIndices[indicesIndex++] = i0 * 2 + 1 + positionOffset;\r\n }\r\n\r\n // indices for the walls of the extruded polygon\r\n for (j = 0; j < polygonCount; ++j) {\r\n const v0 = j;\r\n const v1 = (j + 1) % polygonCount;\r\n\r\n batchedIndices[indicesIndex++] = v0 * 2 + 1 + positionOffset;\r\n batchedIndices[indicesIndex++] = v1 * 2 + positionOffset;\r\n batchedIndices[indicesIndex++] = v0 * 2 + positionOffset;\r\n\r\n batchedIndices[indicesIndex++] = v0 * 2 + 1 + positionOffset;\r\n batchedIndices[indicesIndex++] = v1 * 2 + 1 + positionOffset;\r\n batchedIndices[indicesIndex++] = v1 * 2 + positionOffset;\r\n }\r\n\r\n buffer.offset += polygonCount * 2;\r\n buffer.indexOffset = indicesIndex;\r\n\r\n batchedIndexCounts[i] = indicesIndex - batchedIndexOffsets[i];\r\n }\r\n\r\n batchedIndices = IndexDatatype.createTypedArray(\r\n batchedPositions.length / 3,\r\n batchedIndices\r\n );\r\n\r\n const batchedIndicesLength = batchedDrawCalls.length;\r\n for (let m = 0; m < batchedIndicesLength; ++m) {\r\n const tempIds = batchedDrawCalls[m].batchIds;\r\n let count = 0;\r\n const tempIdsLength = tempIds.length;\r\n for (let n = 0; n < tempIdsLength; ++n) {\r\n count += batchedIndexCounts[tempIds[n]];\r\n }\r\n batchedDrawCalls[m].count = count;\r\n }\r\n\r\n const indexDatatype =\r\n batchedIndices.BYTES_PER_ELEMENT === 2\r\n ? IndexDatatype.UNSIGNED_SHORT\r\n : IndexDatatype.UNSIGNED_INT;\r\n const packedBuffer = packBuffer(\r\n indexDatatype,\r\n boundingVolumes,\r\n batchedDrawCalls\r\n );\r\n\r\n transferableObjects.push(\r\n batchedPositions.buffer,\r\n batchedIndices.buffer,\r\n batchedIndexOffsets.buffer,\r\n batchedIndexCounts.buffer,\r\n batchedIds.buffer,\r\n packedBuffer.buffer\r\n );\r\n\r\n return {\r\n positions: batchedPositions.buffer,\r\n indices: batchedIndices.buffer,\r\n indexOffsets: batchedIndexOffsets.buffer,\r\n indexCounts: batchedIndexCounts.buffer,\r\n batchIds: batchedIds.buffer,\r\n packedBuffer: packedBuffer.buffer,\r\n };\r\n}\r\nexport default createTaskProcessorWorker(createVectorTilePolygons);\r\n"],"names":["Cartesian3","Ellipsoid","Rectangle","Color","OrientedBoundingBox","Cartographic","defined","AttributeCompression","CesiumMath","IndexDatatype"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAYA,MAAM,aAAa,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACvC,MAAM,gBAAgB,GAAG,IAAIC,iBAAS,EAAE,CAAC;EACzC,MAAM,gBAAgB,GAAG,IAAIC,iBAAS,EAAE,CAAC;EACzC,MAAM,cAAc,GAAG;EACvB,EAAE,GAAG,EAAE,SAAS;EAChB,EAAE,GAAG,EAAE,SAAS;EAChB,EAAE,oBAAoB,EAAE,SAAS;EACjC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B,IAAI,cAAc,CAAC,MAAM;EACzB,IAAI,mBAAmB,CAAC,MAAM;EAC9B,IAAI,kBAAkB,CAAC,MAAM;EAC7B,IAAI,UAAU,CAAC,MAAM;EACrB,IAAI,YAAY,CAAC,MAAM;EACvB,GAAG,CAAC;AACJ;EACA,EAAE,OAAO;EACT,IAAI,SAAS,EAAE,gBAAgB,CAAC,MAAM;EACtC,IAAI,OAAO,EAAE,cAAc,CAAC,MAAM;EAClC,IAAI,YAAY,EAAE,mBAAmB,CAAC,MAAM;EAC5C,IAAI,WAAW,EAAE,kBAAkB,CAAC,MAAM;EAC1C,IAAI,QAAQ,EAAE,UAAU,CAAC,MAAM;EAC/B,IAAI,YAAY,EAAE,YAAY,CAAC,MAAM;EACrC,GAAG,CAAC;EACJ,CAAC;AACD,mCAAe,yBAAyB,CAAC,wBAAwB,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createVectorTilePolylines.js b/examples/cesium/Workers/createVectorTilePolylines.js
new file mode 100644
index 0000000..4c83126
--- /dev/null
+++ b/examples/cesium/Workers/createVectorTilePolylines.js
@@ -0,0 +1,280 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Matrix3-f22b0303', './combine-4598d225', './AttributeCompression-e9888cb8', './Math-9be8b918', './IndexDatatype-b4e5cf89', './Matrix2-036c77dd', './createTaskProcessorWorker', './Check-d10e5f2e', './defaultValue-0ab18f7d', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './RuntimeError-e5c6a8b9'], (function (Matrix3, combine, AttributeCompression, Math, IndexDatatype, Matrix2, createTaskProcessorWorker, Check, defaultValue, ComponentDatatype, WebGLConstants, RuntimeError) { 'use strict';
+
+ const maxShort = 32767;
+
+ const scratchBVCartographic = new Matrix3.Cartographic();
+ const scratchEncodedPosition = new Matrix3.Cartesian3();
+
+ function decodeVectorPolylinePositions(
+ positions,
+ rectangle,
+ minimumHeight,
+ maximumHeight,
+ ellipsoid
+ ) {
+ const positionsLength = positions.length / 3;
+ const uBuffer = positions.subarray(0, positionsLength);
+ const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
+ const heightBuffer = positions.subarray(
+ 2 * positionsLength,
+ 3 * positionsLength
+ );
+ AttributeCompression.AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);
+
+ const decoded = new Float64Array(positions.length);
+ for (let i = 0; i < positionsLength; ++i) {
+ const u = uBuffer[i];
+ const v = vBuffer[i];
+ const h = heightBuffer[i];
+
+ const lon = Math.CesiumMath.lerp(rectangle.west, rectangle.east, u / maxShort);
+ const lat = Math.CesiumMath.lerp(rectangle.south, rectangle.north, v / maxShort);
+ const alt = Math.CesiumMath.lerp(minimumHeight, maximumHeight, h / maxShort);
+
+ const cartographic = Matrix3.Cartographic.fromRadians(
+ lon,
+ lat,
+ alt,
+ scratchBVCartographic
+ );
+ const decodedPosition = ellipsoid.cartographicToCartesian(
+ cartographic,
+ scratchEncodedPosition
+ );
+ Matrix3.Cartesian3.pack(decodedPosition, decoded, i * 3);
+ }
+ return decoded;
+ }
+
+ const scratchRectangle = new Matrix2.Rectangle();
+ const scratchEllipsoid = new Matrix3.Ellipsoid();
+ const scratchCenter = new Matrix3.Cartesian3();
+ const scratchMinMaxHeights = {
+ min: undefined,
+ max: undefined,
+ };
+
+ function unpackBuffer(packedBuffer) {
+ packedBuffer = new Float64Array(packedBuffer);
+
+ let offset = 0;
+ scratchMinMaxHeights.min = packedBuffer[offset++];
+ scratchMinMaxHeights.max = packedBuffer[offset++];
+
+ Matrix2.Rectangle.unpack(packedBuffer, offset, scratchRectangle);
+ offset += Matrix2.Rectangle.packedLength;
+
+ Matrix3.Ellipsoid.unpack(packedBuffer, offset, scratchEllipsoid);
+ offset += Matrix3.Ellipsoid.packedLength;
+
+ Matrix3.Cartesian3.unpack(packedBuffer, offset, scratchCenter);
+ }
+
+ function getPositionOffsets(counts) {
+ const countsLength = counts.length;
+ const positionOffsets = new Uint32Array(countsLength + 1);
+ let offset = 0;
+ for (let i = 0; i < countsLength; ++i) {
+ positionOffsets[i] = offset;
+ offset += counts[i];
+ }
+ positionOffsets[countsLength] = offset;
+ return positionOffsets;
+ }
+
+ const scratchP0 = new Matrix3.Cartesian3();
+ const scratchP1 = new Matrix3.Cartesian3();
+ const scratchPrev = new Matrix3.Cartesian3();
+ const scratchCur = new Matrix3.Cartesian3();
+ const scratchNext = new Matrix3.Cartesian3();
+
+ function createVectorTilePolylines(parameters, transferableObjects) {
+ const encodedPositions = new Uint16Array(parameters.positions);
+ const widths = new Uint16Array(parameters.widths);
+ const counts = new Uint32Array(parameters.counts);
+ const batchIds = new Uint16Array(parameters.batchIds);
+
+ unpackBuffer(parameters.packedBuffer);
+ const rectangle = scratchRectangle;
+ const ellipsoid = scratchEllipsoid;
+ const center = scratchCenter;
+ const minimumHeight = scratchMinMaxHeights.min;
+ const maximumHeight = scratchMinMaxHeights.max;
+
+ const positions = decodeVectorPolylinePositions(
+ encodedPositions,
+ rectangle,
+ minimumHeight,
+ maximumHeight,
+ ellipsoid
+ );
+
+ const positionsLength = positions.length / 3;
+ const size = positionsLength * 4 - 4;
+
+ const curPositions = new Float32Array(size * 3);
+ const prevPositions = new Float32Array(size * 3);
+ const nextPositions = new Float32Array(size * 3);
+ const expandAndWidth = new Float32Array(size * 2);
+ const vertexBatchIds = new Uint16Array(size);
+
+ let positionIndex = 0;
+ let expandAndWidthIndex = 0;
+ let batchIdIndex = 0;
+
+ let i;
+ let offset = 0;
+ let length = counts.length;
+
+ for (i = 0; i < length; ++i) {
+ const count = counts[i];
+ const width = widths[i];
+ const batchId = batchIds[i];
+
+ for (let j = 0; j < count; ++j) {
+ let previous;
+ if (j === 0) {
+ const p0 = Matrix3.Cartesian3.unpack(positions, offset * 3, scratchP0);
+ const p1 = Matrix3.Cartesian3.unpack(positions, (offset + 1) * 3, scratchP1);
+
+ previous = Matrix3.Cartesian3.subtract(p0, p1, scratchPrev);
+ Matrix3.Cartesian3.add(p0, previous, previous);
+ } else {
+ previous = Matrix3.Cartesian3.unpack(
+ positions,
+ (offset + j - 1) * 3,
+ scratchPrev
+ );
+ }
+
+ const current = Matrix3.Cartesian3.unpack(
+ positions,
+ (offset + j) * 3,
+ scratchCur
+ );
+
+ let next;
+ if (j === count - 1) {
+ const p2 = Matrix3.Cartesian3.unpack(
+ positions,
+ (offset + count - 1) * 3,
+ scratchP0
+ );
+ const p3 = Matrix3.Cartesian3.unpack(
+ positions,
+ (offset + count - 2) * 3,
+ scratchP1
+ );
+
+ next = Matrix3.Cartesian3.subtract(p2, p3, scratchNext);
+ Matrix3.Cartesian3.add(p2, next, next);
+ } else {
+ next = Matrix3.Cartesian3.unpack(positions, (offset + j + 1) * 3, scratchNext);
+ }
+
+ Matrix3.Cartesian3.subtract(previous, center, previous);
+ Matrix3.Cartesian3.subtract(current, center, current);
+ Matrix3.Cartesian3.subtract(next, center, next);
+
+ const startK = j === 0 ? 2 : 0;
+ const endK = j === count - 1 ? 2 : 4;
+
+ for (let k = startK; k < endK; ++k) {
+ Matrix3.Cartesian3.pack(current, curPositions, positionIndex);
+ Matrix3.Cartesian3.pack(previous, prevPositions, positionIndex);
+ Matrix3.Cartesian3.pack(next, nextPositions, positionIndex);
+ positionIndex += 3;
+
+ const direction = k - 2 < 0 ? -1.0 : 1.0;
+ expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1;
+ expandAndWidth[expandAndWidthIndex++] = direction * width;
+
+ vertexBatchIds[batchIdIndex++] = batchId;
+ }
+ }
+
+ offset += count;
+ }
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(size, positionsLength * 6 - 6);
+ let index = 0;
+ let indicesIndex = 0;
+ length = positionsLength - 1;
+ for (i = 0; i < length; ++i) {
+ indices[indicesIndex++] = index;
+ indices[indicesIndex++] = index + 2;
+ indices[indicesIndex++] = index + 1;
+
+ indices[indicesIndex++] = index + 1;
+ indices[indicesIndex++] = index + 2;
+ indices[indicesIndex++] = index + 3;
+
+ index += 4;
+ }
+
+ transferableObjects.push(
+ curPositions.buffer,
+ prevPositions.buffer,
+ nextPositions.buffer
+ );
+ transferableObjects.push(
+ expandAndWidth.buffer,
+ vertexBatchIds.buffer,
+ indices.buffer
+ );
+
+ let results = {
+ indexDatatype:
+ indices.BYTES_PER_ELEMENT === 2
+ ? IndexDatatype.IndexDatatype.UNSIGNED_SHORT
+ : IndexDatatype.IndexDatatype.UNSIGNED_INT,
+ currentPositions: curPositions.buffer,
+ previousPositions: prevPositions.buffer,
+ nextPositions: nextPositions.buffer,
+ expandAndWidth: expandAndWidth.buffer,
+ batchIds: vertexBatchIds.buffer,
+ indices: indices.buffer,
+ };
+
+ if (parameters.keepDecodedPositions) {
+ const positionOffsets = getPositionOffsets(counts);
+ transferableObjects.push(positions.buffer, positionOffsets.buffer);
+ results = combine.combine(results, {
+ decodedPositions: positions.buffer,
+ decodedPositionOffsets: positionOffsets.buffer,
+ });
+ }
+
+ return results;
+ }
+ var createVectorTilePolylines$1 = createTaskProcessorWorker(createVectorTilePolylines);
+
+ return createVectorTilePolylines$1;
+
+}));
+//# sourceMappingURL=createVectorTilePolylines.js.map
diff --git a/examples/cesium/Workers/createVectorTilePolylines.js.map b/examples/cesium/Workers/createVectorTilePolylines.js.map
new file mode 100644
index 0000000..26840a1
--- /dev/null
+++ b/examples/cesium/Workers/createVectorTilePolylines.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createVectorTilePolylines.js","sources":["../../../Source/Core/decodeVectorPolylinePositions.js","../../../Source/WorkersES6/createVectorTilePolylines.js"],"sourcesContent":["import AttributeCompression from \"./AttributeCompression.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Cartographic from \"./Cartographic.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\nconst maxShort = 32767;\r\n\r\nconst scratchBVCartographic = new Cartographic();\r\nconst scratchEncodedPosition = new Cartesian3();\r\n\r\nfunction decodeVectorPolylinePositions(\r\n positions,\r\n rectangle,\r\n minimumHeight,\r\n maximumHeight,\r\n ellipsoid\r\n) {\r\n const positionsLength = positions.length / 3;\r\n const uBuffer = positions.subarray(0, positionsLength);\r\n const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);\r\n const heightBuffer = positions.subarray(\r\n 2 * positionsLength,\r\n 3 * positionsLength\r\n );\r\n AttributeCompression.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);\r\n\r\n const decoded = new Float64Array(positions.length);\r\n for (let i = 0; i < positionsLength; ++i) {\r\n const u = uBuffer[i];\r\n const v = vBuffer[i];\r\n const h = heightBuffer[i];\r\n\r\n const lon = CesiumMath.lerp(rectangle.west, rectangle.east, u / maxShort);\r\n const lat = CesiumMath.lerp(rectangle.south, rectangle.north, v / maxShort);\r\n const alt = CesiumMath.lerp(minimumHeight, maximumHeight, h / maxShort);\r\n\r\n const cartographic = Cartographic.fromRadians(\r\n lon,\r\n lat,\r\n alt,\r\n scratchBVCartographic\r\n );\r\n const decodedPosition = ellipsoid.cartographicToCartesian(\r\n cartographic,\r\n scratchEncodedPosition\r\n );\r\n Cartesian3.pack(decodedPosition, decoded, i * 3);\r\n }\r\n return decoded;\r\n}\r\nexport default decodeVectorPolylinePositions;\r\n","import Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport combine from \"../Core/combine.js\";\r\nimport decodeVectorPolylinePositions from \"../Core/decodeVectorPolylinePositions.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\r\nimport Rectangle from \"../Core/Rectangle.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nconst scratchRectangle = new Rectangle();\r\nconst scratchEllipsoid = new Ellipsoid();\r\nconst scratchCenter = new Cartesian3();\r\nconst scratchMinMaxHeights = {\r\n min: undefined,\r\n max: undefined,\r\n};\r\n\r\nfunction unpackBuffer(packedBuffer) {\r\n packedBuffer = new Float64Array(packedBuffer);\r\n\r\n let offset = 0;\r\n scratchMinMaxHeights.min = packedBuffer[offset++];\r\n scratchMinMaxHeights.max = packedBuffer[offset++];\r\n\r\n Rectangle.unpack(packedBuffer, offset, scratchRectangle);\r\n offset += Rectangle.packedLength;\r\n\r\n Ellipsoid.unpack(packedBuffer, offset, scratchEllipsoid);\r\n offset += Ellipsoid.packedLength;\r\n\r\n Cartesian3.unpack(packedBuffer, offset, scratchCenter);\r\n}\r\n\r\nfunction getPositionOffsets(counts) {\r\n const countsLength = counts.length;\r\n const positionOffsets = new Uint32Array(countsLength + 1);\r\n let offset = 0;\r\n for (let i = 0; i < countsLength; ++i) {\r\n positionOffsets[i] = offset;\r\n offset += counts[i];\r\n }\r\n positionOffsets[countsLength] = offset;\r\n return positionOffsets;\r\n}\r\n\r\nconst scratchP0 = new Cartesian3();\r\nconst scratchP1 = new Cartesian3();\r\nconst scratchPrev = new Cartesian3();\r\nconst scratchCur = new Cartesian3();\r\nconst scratchNext = new Cartesian3();\r\n\r\nfunction createVectorTilePolylines(parameters, transferableObjects) {\r\n const encodedPositions = new Uint16Array(parameters.positions);\r\n const widths = new Uint16Array(parameters.widths);\r\n const counts = new Uint32Array(parameters.counts);\r\n const batchIds = new Uint16Array(parameters.batchIds);\r\n\r\n unpackBuffer(parameters.packedBuffer);\r\n const rectangle = scratchRectangle;\r\n const ellipsoid = scratchEllipsoid;\r\n const center = scratchCenter;\r\n const minimumHeight = scratchMinMaxHeights.min;\r\n const maximumHeight = scratchMinMaxHeights.max;\r\n\r\n const positions = decodeVectorPolylinePositions(\r\n encodedPositions,\r\n rectangle,\r\n minimumHeight,\r\n maximumHeight,\r\n ellipsoid\r\n );\r\n\r\n const positionsLength = positions.length / 3;\r\n const size = positionsLength * 4 - 4;\r\n\r\n const curPositions = new Float32Array(size * 3);\r\n const prevPositions = new Float32Array(size * 3);\r\n const nextPositions = new Float32Array(size * 3);\r\n const expandAndWidth = new Float32Array(size * 2);\r\n const vertexBatchIds = new Uint16Array(size);\r\n\r\n let positionIndex = 0;\r\n let expandAndWidthIndex = 0;\r\n let batchIdIndex = 0;\r\n\r\n let i;\r\n let offset = 0;\r\n let length = counts.length;\r\n\r\n for (i = 0; i < length; ++i) {\r\n const count = counts[i];\r\n const width = widths[i];\r\n const batchId = batchIds[i];\r\n\r\n for (let j = 0; j < count; ++j) {\r\n let previous;\r\n if (j === 0) {\r\n const p0 = Cartesian3.unpack(positions, offset * 3, scratchP0);\r\n const p1 = Cartesian3.unpack(positions, (offset + 1) * 3, scratchP1);\r\n\r\n previous = Cartesian3.subtract(p0, p1, scratchPrev);\r\n Cartesian3.add(p0, previous, previous);\r\n } else {\r\n previous = Cartesian3.unpack(\r\n positions,\r\n (offset + j - 1) * 3,\r\n scratchPrev\r\n );\r\n }\r\n\r\n const current = Cartesian3.unpack(\r\n positions,\r\n (offset + j) * 3,\r\n scratchCur\r\n );\r\n\r\n let next;\r\n if (j === count - 1) {\r\n const p2 = Cartesian3.unpack(\r\n positions,\r\n (offset + count - 1) * 3,\r\n scratchP0\r\n );\r\n const p3 = Cartesian3.unpack(\r\n positions,\r\n (offset + count - 2) * 3,\r\n scratchP1\r\n );\r\n\r\n next = Cartesian3.subtract(p2, p3, scratchNext);\r\n Cartesian3.add(p2, next, next);\r\n } else {\r\n next = Cartesian3.unpack(positions, (offset + j + 1) * 3, scratchNext);\r\n }\r\n\r\n Cartesian3.subtract(previous, center, previous);\r\n Cartesian3.subtract(current, center, current);\r\n Cartesian3.subtract(next, center, next);\r\n\r\n const startK = j === 0 ? 2 : 0;\r\n const endK = j === count - 1 ? 2 : 4;\r\n\r\n for (let k = startK; k < endK; ++k) {\r\n Cartesian3.pack(current, curPositions, positionIndex);\r\n Cartesian3.pack(previous, prevPositions, positionIndex);\r\n Cartesian3.pack(next, nextPositions, positionIndex);\r\n positionIndex += 3;\r\n\r\n const direction = k - 2 < 0 ? -1.0 : 1.0;\r\n expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1;\r\n expandAndWidth[expandAndWidthIndex++] = direction * width;\r\n\r\n vertexBatchIds[batchIdIndex++] = batchId;\r\n }\r\n }\r\n\r\n offset += count;\r\n }\r\n\r\n const indices = IndexDatatype.createTypedArray(size, positionsLength * 6 - 6);\r\n let index = 0;\r\n let indicesIndex = 0;\r\n length = positionsLength - 1;\r\n for (i = 0; i < length; ++i) {\r\n indices[indicesIndex++] = index;\r\n indices[indicesIndex++] = index + 2;\r\n indices[indicesIndex++] = index + 1;\r\n\r\n indices[indicesIndex++] = index + 1;\r\n indices[indicesIndex++] = index + 2;\r\n indices[indicesIndex++] = index + 3;\r\n\r\n index += 4;\r\n }\r\n\r\n transferableObjects.push(\r\n curPositions.buffer,\r\n prevPositions.buffer,\r\n nextPositions.buffer\r\n );\r\n transferableObjects.push(\r\n expandAndWidth.buffer,\r\n vertexBatchIds.buffer,\r\n indices.buffer\r\n );\r\n\r\n let results = {\r\n indexDatatype:\r\n indices.BYTES_PER_ELEMENT === 2\r\n ? IndexDatatype.UNSIGNED_SHORT\r\n : IndexDatatype.UNSIGNED_INT,\r\n currentPositions: curPositions.buffer,\r\n previousPositions: prevPositions.buffer,\r\n nextPositions: nextPositions.buffer,\r\n expandAndWidth: expandAndWidth.buffer,\r\n batchIds: vertexBatchIds.buffer,\r\n indices: indices.buffer,\r\n };\r\n\r\n if (parameters.keepDecodedPositions) {\r\n const positionOffsets = getPositionOffsets(counts);\r\n transferableObjects.push(positions.buffer, positionOffsets.buffer);\r\n results = combine(results, {\r\n decodedPositions: positions.buffer,\r\n decodedPositionOffsets: positionOffsets.buffer,\r\n });\r\n }\r\n\r\n return results;\r\n}\r\nexport default createTaskProcessorWorker(createVectorTilePolylines);\r\n"],"names":["Cartographic","Cartesian3","AttributeCompression","CesiumMath","Rectangle","Ellipsoid","IndexDatatype","combine"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA,MAAM,QAAQ,GAAG,KAAK,CAAC;AACvB;EACA,MAAM,qBAAqB,GAAG,IAAIA,oBAAY,EAAE,CAAC;EACjD,MAAM,sBAAsB,GAAG,IAAIC,kBAAU,EAAE,CAAC;AAChD;EACA,SAAS,6BAA6B;EACtC,EAAE,SAAS;EACX,EAAE,SAAS;EACX,EAAE,aAAa;EACf,EAAE,aAAa;EACf,EAAE,SAAS;EACX,EAAE;EACF,EAAE,MAAM,eAAe,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;EAC/C,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;EACzD,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,GAAG,eAAe,CAAC,CAAC;EAC3E,EAAE,MAAM,YAAY,GAAG,SAAS,CAAC,QAAQ;EACzC,IAAI,CAAC,GAAG,eAAe;EACvB,IAAI,CAAC,GAAG,eAAe;EACvB,GAAG,CAAC;EACJ,EAAEC,yCAAoB,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;AACzE;EACA,EAAE,MAAM,OAAO,GAAG,IAAI,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;EACrD,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,EAAE,EAAE,CAAC,EAAE;EAC5C,IAAI,MAAM,CAAC,GAAG,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;EAChB,IAAI,aAAa;EACjB,MAAM,OAAO,CAAC,iBAAiB,KAAK,CAAC;EACrC,UAAUA,2BAAa,CAAC,cAAc;EACtC,UAAUA,2BAAa,CAAC,YAAY;EACpC,IAAI,gBAAgB,EAAE,YAAY,CAAC,MAAM;EACzC,IAAI,iBAAiB,EAAE,aAAa,CAAC,MAAM;EAC3C,IAAI,aAAa,EAAE,aAAa,CAAC,MAAM;EACvC,IAAI,cAAc,EAAE,cAAc,CAAC,MAAM;EACzC,IAAI,QAAQ,EAAE,cAAc,CAAC,MAAM;EACnC,IAAI,OAAO,EAAE,OAAO,CAAC,MAAM;EAC3B,GAAG,CAAC;AACJ;EACA,EAAE,IAAI,UAAU,CAAC,oBAAoB,EAAE;EACvC,IAAI,MAAM,eAAe,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;EACvD,IAAI,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;EACvE,IAAI,OAAO,GAAGC,eAAO,CAAC,OAAO,EAAE;EAC/B,MAAM,gBAAgB,EAAE,SAAS,CAAC,MAAM;EACxC,MAAM,sBAAsB,EAAE,eAAe,CAAC,MAAM;EACpD,KAAK,CAAC,CAAC;EACP,GAAG;AACH;EACA,EAAE,OAAO,OAAO,CAAC;EACjB,CAAC;AACD,oCAAe,yBAAyB,CAAC,yBAAyB,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js b/examples/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js
new file mode 100644
index 0000000..7d4576b
--- /dev/null
+++ b/examples/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js
@@ -0,0 +1,666 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./AxisAlignedBoundingBox-50342d27', './Transforms-11fb6b0a', './Matrix2-036c77dd', './Matrix3-f22b0303', './defaultValue-0ab18f7d', './TerrainEncoding-c7d764e4', './Math-9be8b918', './OrientedBoundingBox-7e2eebab', './RuntimeError-e5c6a8b9', './WebMercatorProjection-306f7acc', './createTaskProcessorWorker', './Check-d10e5f2e', './combine-4598d225', './AttributeCompression-e9888cb8', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './EllipsoidTangentPlane-c421b2cb', './IntersectionTests-2c7928de', './Plane-c9f1487d'], (function (AxisAlignedBoundingBox, Transforms, Matrix2, Matrix3, defaultValue, TerrainEncoding, Math$1, OrientedBoundingBox, RuntimeError, WebMercatorProjection, createTaskProcessorWorker, Check, combine, AttributeCompression, ComponentDatatype, WebGLConstants, EllipsoidTangentPlane, IntersectionTests, Plane) { 'use strict';
+
+ const sizeOfUint16 = Uint16Array.BYTES_PER_ELEMENT;
+ const sizeOfInt32 = Int32Array.BYTES_PER_ELEMENT;
+ const sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;
+ const sizeOfFloat = Float32Array.BYTES_PER_ELEMENT;
+ const sizeOfDouble = Float64Array.BYTES_PER_ELEMENT;
+
+ function indexOfEpsilon(arr, elem, elemType) {
+ elemType = defaultValue.defaultValue(elemType, Math$1.CesiumMath);
+ const count = arr.length;
+ for (let i = 0; i < count; ++i) {
+ if (elemType.equalsEpsilon(arr[i], elem, Math$1.CesiumMath.EPSILON12)) {
+ return i;
+ }
+ }
+
+ return -1;
+ }
+
+ function createVerticesFromGoogleEarthEnterpriseBuffer(
+ parameters,
+ transferableObjects
+ ) {
+ parameters.ellipsoid = Matrix3.Ellipsoid.clone(parameters.ellipsoid);
+ parameters.rectangle = Matrix2.Rectangle.clone(parameters.rectangle);
+
+ const statistics = processBuffer(
+ parameters.buffer,
+ parameters.relativeToCenter,
+ parameters.ellipsoid,
+ parameters.rectangle,
+ parameters.nativeRectangle,
+ parameters.exaggeration,
+ parameters.exaggerationRelativeHeight,
+ parameters.skirtHeight,
+ parameters.includeWebMercatorT,
+ parameters.negativeAltitudeExponentBias,
+ parameters.negativeElevationThreshold
+ );
+ const vertices = statistics.vertices;
+ transferableObjects.push(vertices.buffer);
+ const indices = statistics.indices;
+ transferableObjects.push(indices.buffer);
+
+ return {
+ vertices: vertices.buffer,
+ indices: indices.buffer,
+ numberOfAttributes: statistics.encoding.stride,
+ minimumHeight: statistics.minimumHeight,
+ maximumHeight: statistics.maximumHeight,
+ boundingSphere3D: statistics.boundingSphere3D,
+ orientedBoundingBox: statistics.orientedBoundingBox,
+ occludeePointInScaledSpace: statistics.occludeePointInScaledSpace,
+ encoding: statistics.encoding,
+ vertexCountWithoutSkirts: statistics.vertexCountWithoutSkirts,
+ indexCountWithoutSkirts: statistics.indexCountWithoutSkirts,
+ westIndicesSouthToNorth: statistics.westIndicesSouthToNorth,
+ southIndicesEastToWest: statistics.southIndicesEastToWest,
+ eastIndicesNorthToSouth: statistics.eastIndicesNorthToSouth,
+ northIndicesWestToEast: statistics.northIndicesWestToEast,
+ };
+ }
+
+ const scratchCartographic = new Matrix3.Cartographic();
+ const scratchCartesian = new Matrix3.Cartesian3();
+ const minimumScratch = new Matrix3.Cartesian3();
+ const maximumScratch = new Matrix3.Cartesian3();
+ const matrix4Scratch = new Matrix2.Matrix4();
+
+ function processBuffer(
+ buffer,
+ relativeToCenter,
+ ellipsoid,
+ rectangle,
+ nativeRectangle,
+ exaggeration,
+ exaggerationRelativeHeight,
+ skirtHeight,
+ includeWebMercatorT,
+ negativeAltitudeExponentBias,
+ negativeElevationThreshold
+ ) {
+ let geographicWest;
+ let geographicSouth;
+ let geographicEast;
+ let geographicNorth;
+ let rectangleWidth, rectangleHeight;
+
+ if (!defaultValue.defined(rectangle)) {
+ geographicWest = Math$1.CesiumMath.toRadians(nativeRectangle.west);
+ geographicSouth = Math$1.CesiumMath.toRadians(nativeRectangle.south);
+ geographicEast = Math$1.CesiumMath.toRadians(nativeRectangle.east);
+ geographicNorth = Math$1.CesiumMath.toRadians(nativeRectangle.north);
+ rectangleWidth = Math$1.CesiumMath.toRadians(rectangle.width);
+ rectangleHeight = Math$1.CesiumMath.toRadians(rectangle.height);
+ } else {
+ geographicWest = rectangle.west;
+ geographicSouth = rectangle.south;
+ geographicEast = rectangle.east;
+ geographicNorth = rectangle.north;
+ rectangleWidth = rectangle.width;
+ rectangleHeight = rectangle.height;
+ }
+
+ // Keep track of quad borders so we can remove duplicates around the borders
+ const quadBorderLatitudes = [geographicSouth, geographicNorth];
+ const quadBorderLongitudes = [geographicWest, geographicEast];
+
+ const fromENU = Transforms.Transforms.eastNorthUpToFixedFrame(
+ relativeToCenter,
+ ellipsoid
+ );
+ const toENU = Matrix2.Matrix4.inverseTransformation(fromENU, matrix4Scratch);
+
+ let southMercatorY;
+ let oneOverMercatorHeight;
+ if (includeWebMercatorT) {
+ southMercatorY = WebMercatorProjection.WebMercatorProjection.geodeticLatitudeToMercatorAngle(
+ geographicSouth
+ );
+ oneOverMercatorHeight =
+ 1.0 /
+ (WebMercatorProjection.WebMercatorProjection.geodeticLatitudeToMercatorAngle(geographicNorth) -
+ southMercatorY);
+ }
+
+ const hasExaggeration = exaggeration !== 1.0;
+ const includeGeodeticSurfaceNormals = hasExaggeration;
+
+ const dv = new DataView(buffer);
+
+ let minHeight = Number.POSITIVE_INFINITY;
+ let maxHeight = Number.NEGATIVE_INFINITY;
+
+ const minimum = minimumScratch;
+ minimum.x = Number.POSITIVE_INFINITY;
+ minimum.y = Number.POSITIVE_INFINITY;
+ minimum.z = Number.POSITIVE_INFINITY;
+
+ const maximum = maximumScratch;
+ maximum.x = Number.NEGATIVE_INFINITY;
+ maximum.y = Number.NEGATIVE_INFINITY;
+ maximum.z = Number.NEGATIVE_INFINITY;
+
+ // Compute sizes
+ let offset = 0;
+ let size = 0;
+ let indicesSize = 0;
+ let quadSize;
+ let quad;
+ for (quad = 0; quad < 4; ++quad) {
+ let o = offset;
+ quadSize = dv.getUint32(o, true);
+ o += sizeOfUint32;
+
+ const x = Math$1.CesiumMath.toRadians(dv.getFloat64(o, true) * 180.0);
+ o += sizeOfDouble;
+ if (indexOfEpsilon(quadBorderLongitudes, x) === -1) {
+ quadBorderLongitudes.push(x);
+ }
+
+ const y = Math$1.CesiumMath.toRadians(dv.getFloat64(o, true) * 180.0);
+ o += sizeOfDouble;
+ if (indexOfEpsilon(quadBorderLatitudes, y) === -1) {
+ quadBorderLatitudes.push(y);
+ }
+
+ o += 2 * sizeOfDouble; // stepX + stepY
+
+ let c = dv.getInt32(o, true); // Read point count
+ o += sizeOfInt32;
+ size += c;
+
+ c = dv.getInt32(o, true); // Read index count
+ indicesSize += c * 3;
+
+ offset += quadSize + sizeOfUint32; // Jump to next quad
+ }
+
+ // Quad Border points to remove duplicates
+ const quadBorderPoints = [];
+ const quadBorderIndices = [];
+
+ // Create arrays
+ const positions = new Array(size);
+ const uvs = new Array(size);
+ const heights = new Array(size);
+ const webMercatorTs = includeWebMercatorT ? new Array(size) : [];
+ const geodeticSurfaceNormals = includeGeodeticSurfaceNormals
+ ? new Array(size)
+ : [];
+ const indices = new Array(indicesSize);
+
+ // Points are laid out in rows starting at SW, so storing border points as we
+ // come across them all points will be adjacent.
+ const westBorder = [];
+ const southBorder = [];
+ const eastBorder = [];
+ const northBorder = [];
+
+ // Each tile is split into 4 parts
+ let pointOffset = 0;
+ let indicesOffset = 0;
+ offset = 0;
+ for (quad = 0; quad < 4; ++quad) {
+ quadSize = dv.getUint32(offset, true);
+ offset += sizeOfUint32;
+ const startQuad = offset;
+
+ const originX = Math$1.CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);
+ offset += sizeOfDouble;
+
+ const originY = Math$1.CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);
+ offset += sizeOfDouble;
+
+ const stepX = Math$1.CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);
+ const halfStepX = stepX * 0.5;
+ offset += sizeOfDouble;
+
+ const stepY = Math$1.CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);
+ const halfStepY = stepY * 0.5;
+ offset += sizeOfDouble;
+
+ const numPoints = dv.getInt32(offset, true);
+ offset += sizeOfInt32;
+
+ const numFaces = dv.getInt32(offset, true);
+ offset += sizeOfInt32;
+
+ //const level = dv.getInt32(offset, true);
+ offset += sizeOfInt32;
+
+ // Keep track of quad indices to overall tile indices
+ const indicesMapping = new Array(numPoints);
+ for (let i = 0; i < numPoints; ++i) {
+ const longitude = originX + dv.getUint8(offset++) * stepX;
+ scratchCartographic.longitude = longitude;
+ const latitude = originY + dv.getUint8(offset++) * stepY;
+ scratchCartographic.latitude = latitude;
+
+ let height = dv.getFloat32(offset, true);
+ offset += sizeOfFloat;
+
+ // In order to support old clients, negative altitude values are stored as
+ // height/-2^32. Old clients see the value as really close to 0 but new clients multiply
+ // by -2^32 to get the real negative altitude value.
+ if (height !== 0 && height < negativeElevationThreshold) {
+ height *= -Math.pow(2, negativeAltitudeExponentBias);
+ }
+
+ // Height is stored in units of (1/EarthRadius) or (1/6371010.0)
+ height *= 6371010.0;
+
+ scratchCartographic.height = height;
+
+ // Is it along a quad border - if so check if already exists and use that index
+ if (
+ indexOfEpsilon(quadBorderLongitudes, longitude) !== -1 ||
+ indexOfEpsilon(quadBorderLatitudes, latitude) !== -1
+ ) {
+ const index = indexOfEpsilon(
+ quadBorderPoints,
+ scratchCartographic,
+ Matrix3.Cartographic
+ );
+ if (index === -1) {
+ quadBorderPoints.push(Matrix3.Cartographic.clone(scratchCartographic));
+ quadBorderIndices.push(pointOffset);
+ } else {
+ indicesMapping[i] = quadBorderIndices[index];
+ continue;
+ }
+ }
+ indicesMapping[i] = pointOffset;
+
+ if (Math.abs(longitude - geographicWest) < halfStepX) {
+ westBorder.push({
+ index: pointOffset,
+ cartographic: Matrix3.Cartographic.clone(scratchCartographic),
+ });
+ } else if (Math.abs(longitude - geographicEast) < halfStepX) {
+ eastBorder.push({
+ index: pointOffset,
+ cartographic: Matrix3.Cartographic.clone(scratchCartographic),
+ });
+ } else if (Math.abs(latitude - geographicSouth) < halfStepY) {
+ southBorder.push({
+ index: pointOffset,
+ cartographic: Matrix3.Cartographic.clone(scratchCartographic),
+ });
+ } else if (Math.abs(latitude - geographicNorth) < halfStepY) {
+ northBorder.push({
+ index: pointOffset,
+ cartographic: Matrix3.Cartographic.clone(scratchCartographic),
+ });
+ }
+
+ minHeight = Math.min(height, minHeight);
+ maxHeight = Math.max(height, maxHeight);
+ heights[pointOffset] = height;
+
+ const pos = ellipsoid.cartographicToCartesian(scratchCartographic);
+ positions[pointOffset] = pos;
+
+ if (includeWebMercatorT) {
+ webMercatorTs[pointOffset] =
+ (WebMercatorProjection.WebMercatorProjection.geodeticLatitudeToMercatorAngle(latitude) -
+ southMercatorY) *
+ oneOverMercatorHeight;
+ }
+
+ if (includeGeodeticSurfaceNormals) {
+ const normal = ellipsoid.geodeticSurfaceNormal(pos);
+ geodeticSurfaceNormals[pointOffset] = normal;
+ }
+
+ Matrix2.Matrix4.multiplyByPoint(toENU, pos, scratchCartesian);
+
+ Matrix3.Cartesian3.minimumByComponent(scratchCartesian, minimum, minimum);
+ Matrix3.Cartesian3.maximumByComponent(scratchCartesian, maximum, maximum);
+
+ let u = (longitude - geographicWest) / (geographicEast - geographicWest);
+ u = Math$1.CesiumMath.clamp(u, 0.0, 1.0);
+ let v =
+ (latitude - geographicSouth) / (geographicNorth - geographicSouth);
+ v = Math$1.CesiumMath.clamp(v, 0.0, 1.0);
+
+ uvs[pointOffset] = new Matrix2.Cartesian2(u, v);
+ ++pointOffset;
+ }
+
+ const facesElementCount = numFaces * 3;
+ for (let j = 0; j < facesElementCount; ++j, ++indicesOffset) {
+ indices[indicesOffset] = indicesMapping[dv.getUint16(offset, true)];
+ offset += sizeOfUint16;
+ }
+
+ if (quadSize !== offset - startQuad) {
+ throw new RuntimeError.RuntimeError("Invalid terrain tile.");
+ }
+ }
+
+ positions.length = pointOffset;
+ uvs.length = pointOffset;
+ heights.length = pointOffset;
+ if (includeWebMercatorT) {
+ webMercatorTs.length = pointOffset;
+ }
+ if (includeGeodeticSurfaceNormals) {
+ geodeticSurfaceNormals.length = pointOffset;
+ }
+
+ const vertexCountWithoutSkirts = pointOffset;
+ const indexCountWithoutSkirts = indicesOffset;
+
+ // Add skirt points
+ const skirtOptions = {
+ hMin: minHeight,
+ lastBorderPoint: undefined,
+ skirtHeight: skirtHeight,
+ toENU: toENU,
+ ellipsoid: ellipsoid,
+ minimum: minimum,
+ maximum: maximum,
+ };
+
+ // Sort counter clockwise from NW corner
+ // Corner points are in the east/west arrays
+ westBorder.sort(function (a, b) {
+ return b.cartographic.latitude - a.cartographic.latitude;
+ });
+ southBorder.sort(function (a, b) {
+ return a.cartographic.longitude - b.cartographic.longitude;
+ });
+ eastBorder.sort(function (a, b) {
+ return a.cartographic.latitude - b.cartographic.latitude;
+ });
+ northBorder.sort(function (a, b) {
+ return b.cartographic.longitude - a.cartographic.longitude;
+ });
+
+ const percentage = 0.00001;
+ addSkirt(
+ positions,
+ heights,
+ uvs,
+ webMercatorTs,
+ geodeticSurfaceNormals,
+ indices,
+ skirtOptions,
+ westBorder,
+ -percentage * rectangleWidth,
+ true,
+ -percentage * rectangleHeight
+ );
+ addSkirt(
+ positions,
+ heights,
+ uvs,
+ webMercatorTs,
+ geodeticSurfaceNormals,
+ indices,
+ skirtOptions,
+ southBorder,
+ -percentage * rectangleHeight,
+ false
+ );
+ addSkirt(
+ positions,
+ heights,
+ uvs,
+ webMercatorTs,
+ geodeticSurfaceNormals,
+ indices,
+ skirtOptions,
+ eastBorder,
+ percentage * rectangleWidth,
+ true,
+ percentage * rectangleHeight
+ );
+ addSkirt(
+ positions,
+ heights,
+ uvs,
+ webMercatorTs,
+ geodeticSurfaceNormals,
+ indices,
+ skirtOptions,
+ northBorder,
+ percentage * rectangleHeight,
+ false
+ );
+
+ // Since the corner between the north and west sides is in the west array, generate the last
+ // two triangles between the last north vertex and the first west vertex
+ if (westBorder.length > 0 && northBorder.length > 0) {
+ const firstBorderIndex = westBorder[0].index;
+ const firstSkirtIndex = vertexCountWithoutSkirts;
+ const lastBorderIndex = northBorder[northBorder.length - 1].index;
+ const lastSkirtIndex = positions.length - 1;
+
+ indices.push(
+ lastBorderIndex,
+ lastSkirtIndex,
+ firstSkirtIndex,
+ firstSkirtIndex,
+ firstBorderIndex,
+ lastBorderIndex
+ );
+ }
+
+ size = positions.length; // Get new size with skirt vertices
+
+ const boundingSphere3D = Transforms.BoundingSphere.fromPoints(positions);
+ let orientedBoundingBox;
+ if (defaultValue.defined(rectangle)) {
+ orientedBoundingBox = OrientedBoundingBox.OrientedBoundingBox.fromRectangle(
+ rectangle,
+ minHeight,
+ maxHeight,
+ ellipsoid
+ );
+ }
+
+ const occluder = new TerrainEncoding.EllipsoidalOccluder(ellipsoid);
+ const occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid(
+ relativeToCenter,
+ positions,
+ minHeight
+ );
+
+ const aaBox = new AxisAlignedBoundingBox.AxisAlignedBoundingBox(minimum, maximum, relativeToCenter);
+ const encoding = new TerrainEncoding.TerrainEncoding(
+ relativeToCenter,
+ aaBox,
+ skirtOptions.hMin,
+ maxHeight,
+ fromENU,
+ false,
+ includeWebMercatorT,
+ includeGeodeticSurfaceNormals,
+ exaggeration,
+ exaggerationRelativeHeight
+ );
+ const vertices = new Float32Array(size * encoding.stride);
+
+ let bufferIndex = 0;
+ for (let k = 0; k < size; ++k) {
+ bufferIndex = encoding.encode(
+ vertices,
+ bufferIndex,
+ positions[k],
+ uvs[k],
+ heights[k],
+ undefined,
+ webMercatorTs[k],
+ geodeticSurfaceNormals[k]
+ );
+ }
+
+ const westIndicesSouthToNorth = westBorder
+ .map(function (vertex) {
+ return vertex.index;
+ })
+ .reverse();
+ const southIndicesEastToWest = southBorder
+ .map(function (vertex) {
+ return vertex.index;
+ })
+ .reverse();
+ const eastIndicesNorthToSouth = eastBorder
+ .map(function (vertex) {
+ return vertex.index;
+ })
+ .reverse();
+ const northIndicesWestToEast = northBorder
+ .map(function (vertex) {
+ return vertex.index;
+ })
+ .reverse();
+
+ southIndicesEastToWest.unshift(
+ eastIndicesNorthToSouth[eastIndicesNorthToSouth.length - 1]
+ );
+ southIndicesEastToWest.push(westIndicesSouthToNorth[0]);
+
+ northIndicesWestToEast.unshift(
+ westIndicesSouthToNorth[westIndicesSouthToNorth.length - 1]
+ );
+ northIndicesWestToEast.push(eastIndicesNorthToSouth[0]);
+
+ return {
+ vertices: vertices,
+ indices: new Uint16Array(indices),
+ maximumHeight: maxHeight,
+ minimumHeight: minHeight,
+ encoding: encoding,
+ boundingSphere3D: boundingSphere3D,
+ orientedBoundingBox: orientedBoundingBox,
+ occludeePointInScaledSpace: occludeePointInScaledSpace,
+ vertexCountWithoutSkirts: vertexCountWithoutSkirts,
+ indexCountWithoutSkirts: indexCountWithoutSkirts,
+ westIndicesSouthToNorth: westIndicesSouthToNorth,
+ southIndicesEastToWest: southIndicesEastToWest,
+ eastIndicesNorthToSouth: eastIndicesNorthToSouth,
+ northIndicesWestToEast: northIndicesWestToEast,
+ };
+ }
+
+ function addSkirt(
+ positions,
+ heights,
+ uvs,
+ webMercatorTs,
+ geodeticSurfaceNormals,
+ indices,
+ skirtOptions,
+ borderPoints,
+ fudgeFactor,
+ eastOrWest,
+ cornerFudge
+ ) {
+ const count = borderPoints.length;
+ for (let j = 0; j < count; ++j) {
+ const borderPoint = borderPoints[j];
+ const borderCartographic = borderPoint.cartographic;
+ const borderIndex = borderPoint.index;
+ const currentIndex = positions.length;
+
+ const longitude = borderCartographic.longitude;
+ let latitude = borderCartographic.latitude;
+ latitude = Math$1.CesiumMath.clamp(
+ latitude,
+ -Math$1.CesiumMath.PI_OVER_TWO,
+ Math$1.CesiumMath.PI_OVER_TWO
+ ); // Don't go over the poles
+ const height = borderCartographic.height - skirtOptions.skirtHeight;
+ skirtOptions.hMin = Math.min(skirtOptions.hMin, height);
+
+ Matrix3.Cartographic.fromRadians(longitude, latitude, height, scratchCartographic);
+
+ // Adjust sides to angle out
+ if (eastOrWest) {
+ scratchCartographic.longitude += fudgeFactor;
+ }
+
+ // Adjust top or bottom to angle out
+ // Since corners are in the east/west arrays angle the first and last points as well
+ if (!eastOrWest) {
+ scratchCartographic.latitude += fudgeFactor;
+ } else if (j === count - 1) {
+ scratchCartographic.latitude += cornerFudge;
+ } else if (j === 0) {
+ scratchCartographic.latitude -= cornerFudge;
+ }
+
+ const pos = skirtOptions.ellipsoid.cartographicToCartesian(
+ scratchCartographic
+ );
+ positions.push(pos);
+ heights.push(height);
+ uvs.push(Matrix2.Cartesian2.clone(uvs[borderIndex])); // Copy UVs from border point
+ if (webMercatorTs.length > 0) {
+ webMercatorTs.push(webMercatorTs[borderIndex]);
+ }
+ if (geodeticSurfaceNormals.length > 0) {
+ geodeticSurfaceNormals.push(geodeticSurfaceNormals[borderIndex]);
+ }
+
+ Matrix2.Matrix4.multiplyByPoint(skirtOptions.toENU, pos, scratchCartesian);
+
+ const minimum = skirtOptions.minimum;
+ const maximum = skirtOptions.maximum;
+ Matrix3.Cartesian3.minimumByComponent(scratchCartesian, minimum, minimum);
+ Matrix3.Cartesian3.maximumByComponent(scratchCartesian, maximum, maximum);
+
+ const lastBorderPoint = skirtOptions.lastBorderPoint;
+ if (defaultValue.defined(lastBorderPoint)) {
+ const lastBorderIndex = lastBorderPoint.index;
+ indices.push(
+ lastBorderIndex,
+ currentIndex - 1,
+ currentIndex,
+ currentIndex,
+ borderIndex,
+ lastBorderIndex
+ );
+ }
+
+ skirtOptions.lastBorderPoint = borderPoint;
+ }
+ }
+ var createVerticesFromGoogleEarthEnterpriseBuffer$1 = createTaskProcessorWorker(
+ createVerticesFromGoogleEarthEnterpriseBuffer
+ );
+
+ return createVerticesFromGoogleEarthEnterpriseBuffer$1;
+
+}));
+//# sourceMappingURL=createVerticesFromGoogleEarthEnterpriseBuffer.js.map
diff --git a/examples/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js.map b/examples/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js.map
new file mode 100644
index 0000000..6a0edb6
--- /dev/null
+++ b/examples/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createVerticesFromGoogleEarthEnterpriseBuffer.js","sources":["../../../Source/WorkersES6/createVerticesFromGoogleEarthEnterpriseBuffer.js"],"sourcesContent":["import AxisAlignedBoundingBox from \"../Core/AxisAlignedBoundingBox.js\";\r\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\r\nimport Cartesian2 from \"../Core/Cartesian2.js\";\r\nimport Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport Cartographic from \"../Core/Cartographic.js\";\r\nimport defaultValue from \"../Core/defaultValue.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport EllipsoidalOccluder from \"../Core/EllipsoidalOccluder.js\";\r\nimport CesiumMath from \"../Core/Math.js\";\r\nimport Matrix4 from \"../Core/Matrix4.js\";\r\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\r\nimport Rectangle from \"../Core/Rectangle.js\";\r\nimport RuntimeError from \"../Core/RuntimeError.js\";\r\nimport TerrainEncoding from \"../Core/TerrainEncoding.js\";\r\nimport Transforms from \"../Core/Transforms.js\";\r\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nconst sizeOfUint16 = Uint16Array.BYTES_PER_ELEMENT;\r\nconst sizeOfInt32 = Int32Array.BYTES_PER_ELEMENT;\r\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\r\nconst sizeOfFloat = Float32Array.BYTES_PER_ELEMENT;\r\nconst sizeOfDouble = Float64Array.BYTES_PER_ELEMENT;\r\n\r\nfunction indexOfEpsilon(arr, elem, elemType) {\r\n elemType = defaultValue(elemType, CesiumMath);\r\n const count = arr.length;\r\n for (let i = 0; i < count; ++i) {\r\n if (elemType.equalsEpsilon(arr[i], elem, CesiumMath.EPSILON12)) {\r\n return i;\r\n }\r\n }\r\n\r\n return -1;\r\n}\r\n\r\nfunction createVerticesFromGoogleEarthEnterpriseBuffer(\r\n parameters,\r\n transferableObjects\r\n) {\r\n parameters.ellipsoid = Ellipsoid.clone(parameters.ellipsoid);\r\n parameters.rectangle = Rectangle.clone(parameters.rectangle);\r\n\r\n const statistics = processBuffer(\r\n parameters.buffer,\r\n parameters.relativeToCenter,\r\n parameters.ellipsoid,\r\n parameters.rectangle,\r\n parameters.nativeRectangle,\r\n parameters.exaggeration,\r\n parameters.exaggerationRelativeHeight,\r\n parameters.skirtHeight,\r\n parameters.includeWebMercatorT,\r\n parameters.negativeAltitudeExponentBias,\r\n parameters.negativeElevationThreshold\r\n );\r\n const vertices = statistics.vertices;\r\n transferableObjects.push(vertices.buffer);\r\n const indices = statistics.indices;\r\n transferableObjects.push(indices.buffer);\r\n\r\n return {\r\n vertices: vertices.buffer,\r\n indices: indices.buffer,\r\n numberOfAttributes: statistics.encoding.stride,\r\n minimumHeight: statistics.minimumHeight,\r\n maximumHeight: statistics.maximumHeight,\r\n boundingSphere3D: statistics.boundingSphere3D,\r\n orientedBoundingBox: statistics.orientedBoundingBox,\r\n occludeePointInScaledSpace: statistics.occludeePointInScaledSpace,\r\n encoding: statistics.encoding,\r\n vertexCountWithoutSkirts: statistics.vertexCountWithoutSkirts,\r\n indexCountWithoutSkirts: statistics.indexCountWithoutSkirts,\r\n westIndicesSouthToNorth: statistics.westIndicesSouthToNorth,\r\n southIndicesEastToWest: statistics.southIndicesEastToWest,\r\n eastIndicesNorthToSouth: statistics.eastIndicesNorthToSouth,\r\n northIndicesWestToEast: statistics.northIndicesWestToEast,\r\n };\r\n}\r\n\r\nconst scratchCartographic = new Cartographic();\r\nconst scratchCartesian = new Cartesian3();\r\nconst minimumScratch = new Cartesian3();\r\nconst maximumScratch = new Cartesian3();\r\nconst matrix4Scratch = new Matrix4();\r\n\r\nfunction processBuffer(\r\n buffer,\r\n relativeToCenter,\r\n ellipsoid,\r\n rectangle,\r\n nativeRectangle,\r\n exaggeration,\r\n exaggerationRelativeHeight,\r\n skirtHeight,\r\n includeWebMercatorT,\r\n negativeAltitudeExponentBias,\r\n negativeElevationThreshold\r\n) {\r\n let geographicWest;\r\n let geographicSouth;\r\n let geographicEast;\r\n let geographicNorth;\r\n let rectangleWidth, rectangleHeight;\r\n\r\n if (!defined(rectangle)) {\r\n geographicWest = CesiumMath.toRadians(nativeRectangle.west);\r\n geographicSouth = CesiumMath.toRadians(nativeRectangle.south);\r\n geographicEast = CesiumMath.toRadians(nativeRectangle.east);\r\n geographicNorth = CesiumMath.toRadians(nativeRectangle.north);\r\n rectangleWidth = CesiumMath.toRadians(rectangle.width);\r\n rectangleHeight = CesiumMath.toRadians(rectangle.height);\r\n } else {\r\n geographicWest = rectangle.west;\r\n geographicSouth = rectangle.south;\r\n geographicEast = rectangle.east;\r\n geographicNorth = rectangle.north;\r\n rectangleWidth = rectangle.width;\r\n rectangleHeight = rectangle.height;\r\n }\r\n\r\n // Keep track of quad borders so we can remove duplicates around the borders\r\n const quadBorderLatitudes = [geographicSouth, geographicNorth];\r\n const quadBorderLongitudes = [geographicWest, geographicEast];\r\n\r\n const fromENU = Transforms.eastNorthUpToFixedFrame(\r\n relativeToCenter,\r\n ellipsoid\r\n );\r\n const toENU = Matrix4.inverseTransformation(fromENU, matrix4Scratch);\r\n\r\n let southMercatorY;\r\n let oneOverMercatorHeight;\r\n if (includeWebMercatorT) {\r\n southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\r\n geographicSouth\r\n );\r\n oneOverMercatorHeight =\r\n 1.0 /\r\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(geographicNorth) -\r\n southMercatorY);\r\n }\r\n\r\n const hasExaggeration = exaggeration !== 1.0;\r\n const includeGeodeticSurfaceNormals = hasExaggeration;\r\n\r\n const dv = new DataView(buffer);\r\n\r\n let minHeight = Number.POSITIVE_INFINITY;\r\n let maxHeight = Number.NEGATIVE_INFINITY;\r\n\r\n const minimum = minimumScratch;\r\n minimum.x = Number.POSITIVE_INFINITY;\r\n minimum.y = Number.POSITIVE_INFINITY;\r\n minimum.z = Number.POSITIVE_INFINITY;\r\n\r\n const maximum = maximumScratch;\r\n maximum.x = Number.NEGATIVE_INFINITY;\r\n maximum.y = Number.NEGATIVE_INFINITY;\r\n maximum.z = Number.NEGATIVE_INFINITY;\r\n\r\n // Compute sizes\r\n let offset = 0;\r\n let size = 0;\r\n let indicesSize = 0;\r\n let quadSize;\r\n let quad;\r\n for (quad = 0; quad < 4; ++quad) {\r\n let o = offset;\r\n quadSize = dv.getUint32(o, true);\r\n o += sizeOfUint32;\r\n\r\n const x = CesiumMath.toRadians(dv.getFloat64(o, true) * 180.0);\r\n o += sizeOfDouble;\r\n if (indexOfEpsilon(quadBorderLongitudes, x) === -1) {\r\n quadBorderLongitudes.push(x);\r\n }\r\n\r\n const y = CesiumMath.toRadians(dv.getFloat64(o, true) * 180.0);\r\n o += sizeOfDouble;\r\n if (indexOfEpsilon(quadBorderLatitudes, y) === -1) {\r\n quadBorderLatitudes.push(y);\r\n }\r\n\r\n o += 2 * sizeOfDouble; // stepX + stepY\r\n\r\n let c = dv.getInt32(o, true); // Read point count\r\n o += sizeOfInt32;\r\n size += c;\r\n\r\n c = dv.getInt32(o, true); // Read index count\r\n indicesSize += c * 3;\r\n\r\n offset += quadSize + sizeOfUint32; // Jump to next quad\r\n }\r\n\r\n // Quad Border points to remove duplicates\r\n const quadBorderPoints = [];\r\n const quadBorderIndices = [];\r\n\r\n // Create arrays\r\n const positions = new Array(size);\r\n const uvs = new Array(size);\r\n const heights = new Array(size);\r\n const webMercatorTs = includeWebMercatorT ? new Array(size) : [];\r\n const geodeticSurfaceNormals = includeGeodeticSurfaceNormals\r\n ? new Array(size)\r\n : [];\r\n const indices = new Array(indicesSize);\r\n\r\n // Points are laid out in rows starting at SW, so storing border points as we\r\n // come across them all points will be adjacent.\r\n const westBorder = [];\r\n const southBorder = [];\r\n const eastBorder = [];\r\n const northBorder = [];\r\n\r\n // Each tile is split into 4 parts\r\n let pointOffset = 0;\r\n let indicesOffset = 0;\r\n offset = 0;\r\n for (quad = 0; quad < 4; ++quad) {\r\n quadSize = dv.getUint32(offset, true);\r\n offset += sizeOfUint32;\r\n const startQuad = offset;\r\n\r\n const originX = CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);\r\n offset += sizeOfDouble;\r\n\r\n const originY = CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);\r\n offset += sizeOfDouble;\r\n\r\n const stepX = CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);\r\n const halfStepX = stepX * 0.5;\r\n offset += sizeOfDouble;\r\n\r\n const stepY = CesiumMath.toRadians(dv.getFloat64(offset, true) * 180.0);\r\n const halfStepY = stepY * 0.5;\r\n offset += sizeOfDouble;\r\n\r\n const numPoints = dv.getInt32(offset, true);\r\n offset += sizeOfInt32;\r\n\r\n const numFaces = dv.getInt32(offset, true);\r\n offset += sizeOfInt32;\r\n\r\n //const level = dv.getInt32(offset, true);\r\n offset += sizeOfInt32;\r\n\r\n // Keep track of quad indices to overall tile indices\r\n const indicesMapping = new Array(numPoints);\r\n for (let i = 0; i < numPoints; ++i) {\r\n const longitude = originX + dv.getUint8(offset++) * stepX;\r\n scratchCartographic.longitude = longitude;\r\n const latitude = originY + dv.getUint8(offset++) * stepY;\r\n scratchCartographic.latitude = latitude;\r\n\r\n let height = dv.getFloat32(offset, true);\r\n offset += sizeOfFloat;\r\n\r\n // In order to support old clients, negative altitude values are stored as\r\n // height/-2^32. Old clients see the value as really close to 0 but new clients multiply\r\n // by -2^32 to get the real negative altitude value.\r\n if (height !== 0 && height < negativeElevationThreshold) {\r\n height *= -Math.pow(2, negativeAltitudeExponentBias);\r\n }\r\n\r\n // Height is stored in units of (1/EarthRadius) or (1/6371010.0)\r\n height *= 6371010.0;\r\n\r\n scratchCartographic.height = height;\r\n\r\n // Is it along a quad border - if so check if already exists and use that index\r\n if (\r\n indexOfEpsilon(quadBorderLongitudes, longitude) !== -1 ||\r\n indexOfEpsilon(quadBorderLatitudes, latitude) !== -1\r\n ) {\r\n const index = indexOfEpsilon(\r\n quadBorderPoints,\r\n scratchCartographic,\r\n Cartographic\r\n );\r\n if (index === -1) {\r\n quadBorderPoints.push(Cartographic.clone(scratchCartographic));\r\n quadBorderIndices.push(pointOffset);\r\n } else {\r\n indicesMapping[i] = quadBorderIndices[index];\r\n continue;\r\n }\r\n }\r\n indicesMapping[i] = pointOffset;\r\n\r\n if (Math.abs(longitude - geographicWest) < halfStepX) {\r\n westBorder.push({\r\n index: pointOffset,\r\n cartographic: Cartographic.clone(scratchCartographic),\r\n });\r\n } else if (Math.abs(longitude - geographicEast) < halfStepX) {\r\n eastBorder.push({\r\n index: pointOffset,\r\n cartographic: Cartographic.clone(scratchCartographic),\r\n });\r\n } else if (Math.abs(latitude - geographicSouth) < halfStepY) {\r\n southBorder.push({\r\n index: pointOffset,\r\n cartographic: Cartographic.clone(scratchCartographic),\r\n });\r\n } else if (Math.abs(latitude - geographicNorth) < halfStepY) {\r\n northBorder.push({\r\n index: pointOffset,\r\n cartographic: Cartographic.clone(scratchCartographic),\r\n });\r\n }\r\n\r\n minHeight = Math.min(height, minHeight);\r\n maxHeight = Math.max(height, maxHeight);\r\n heights[pointOffset] = height;\r\n\r\n const pos = ellipsoid.cartographicToCartesian(scratchCartographic);\r\n positions[pointOffset] = pos;\r\n\r\n if (includeWebMercatorT) {\r\n webMercatorTs[pointOffset] =\r\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(latitude) -\r\n southMercatorY) *\r\n oneOverMercatorHeight;\r\n }\r\n\r\n if (includeGeodeticSurfaceNormals) {\r\n const normal = ellipsoid.geodeticSurfaceNormal(pos);\r\n geodeticSurfaceNormals[pointOffset] = normal;\r\n }\r\n\r\n Matrix4.multiplyByPoint(toENU, pos, scratchCartesian);\r\n\r\n Cartesian3.minimumByComponent(scratchCartesian, minimum, minimum);\r\n Cartesian3.maximumByComponent(scratchCartesian, maximum, maximum);\r\n\r\n let u = (longitude - geographicWest) / (geographicEast - geographicWest);\r\n u = CesiumMath.clamp(u, 0.0, 1.0);\r\n let v =\r\n (latitude - geographicSouth) / (geographicNorth - geographicSouth);\r\n v = CesiumMath.clamp(v, 0.0, 1.0);\r\n\r\n uvs[pointOffset] = new Cartesian2(u, v);\r\n ++pointOffset;\r\n }\r\n\r\n const facesElementCount = numFaces * 3;\r\n for (let j = 0; j < facesElementCount; ++j, ++indicesOffset) {\r\n indices[indicesOffset] = indicesMapping[dv.getUint16(offset, true)];\r\n offset += sizeOfUint16;\r\n }\r\n\r\n if (quadSize !== offset - startQuad) {\r\n throw new RuntimeError(\"Invalid terrain tile.\");\r\n }\r\n }\r\n\r\n positions.length = pointOffset;\r\n uvs.length = pointOffset;\r\n heights.length = pointOffset;\r\n if (includeWebMercatorT) {\r\n webMercatorTs.length = pointOffset;\r\n }\r\n if (includeGeodeticSurfaceNormals) {\r\n geodeticSurfaceNormals.length = pointOffset;\r\n }\r\n\r\n const vertexCountWithoutSkirts = pointOffset;\r\n const indexCountWithoutSkirts = indicesOffset;\r\n\r\n // Add skirt points\r\n const skirtOptions = {\r\n hMin: minHeight,\r\n lastBorderPoint: undefined,\r\n skirtHeight: skirtHeight,\r\n toENU: toENU,\r\n ellipsoid: ellipsoid,\r\n minimum: minimum,\r\n maximum: maximum,\r\n };\r\n\r\n // Sort counter clockwise from NW corner\r\n // Corner points are in the east/west arrays\r\n westBorder.sort(function (a, b) {\r\n return b.cartographic.latitude - a.cartographic.latitude;\r\n });\r\n southBorder.sort(function (a, b) {\r\n return a.cartographic.longitude - b.cartographic.longitude;\r\n });\r\n eastBorder.sort(function (a, b) {\r\n return a.cartographic.latitude - b.cartographic.latitude;\r\n });\r\n northBorder.sort(function (a, b) {\r\n return b.cartographic.longitude - a.cartographic.longitude;\r\n });\r\n\r\n const percentage = 0.00001;\r\n addSkirt(\r\n positions,\r\n heights,\r\n uvs,\r\n webMercatorTs,\r\n geodeticSurfaceNormals,\r\n indices,\r\n skirtOptions,\r\n westBorder,\r\n -percentage * rectangleWidth,\r\n true,\r\n -percentage * rectangleHeight\r\n );\r\n addSkirt(\r\n positions,\r\n heights,\r\n uvs,\r\n webMercatorTs,\r\n geodeticSurfaceNormals,\r\n indices,\r\n skirtOptions,\r\n southBorder,\r\n -percentage * rectangleHeight,\r\n false\r\n );\r\n addSkirt(\r\n positions,\r\n heights,\r\n uvs,\r\n webMercatorTs,\r\n geodeticSurfaceNormals,\r\n indices,\r\n skirtOptions,\r\n eastBorder,\r\n percentage * rectangleWidth,\r\n true,\r\n percentage * rectangleHeight\r\n );\r\n addSkirt(\r\n positions,\r\n heights,\r\n uvs,\r\n webMercatorTs,\r\n geodeticSurfaceNormals,\r\n indices,\r\n skirtOptions,\r\n northBorder,\r\n percentage * rectangleHeight,\r\n false\r\n );\r\n\r\n // Since the corner between the north and west sides is in the west array, generate the last\r\n // two triangles between the last north vertex and the first west vertex\r\n if (westBorder.length > 0 && northBorder.length > 0) {\r\n const firstBorderIndex = westBorder[0].index;\r\n const firstSkirtIndex = vertexCountWithoutSkirts;\r\n const lastBorderIndex = northBorder[northBorder.length - 1].index;\r\n const lastSkirtIndex = positions.length - 1;\r\n\r\n indices.push(\r\n lastBorderIndex,\r\n lastSkirtIndex,\r\n firstSkirtIndex,\r\n firstSkirtIndex,\r\n firstBorderIndex,\r\n lastBorderIndex\r\n );\r\n }\r\n\r\n size = positions.length; // Get new size with skirt vertices\r\n\r\n const boundingSphere3D = BoundingSphere.fromPoints(positions);\r\n let orientedBoundingBox;\r\n if (defined(rectangle)) {\r\n orientedBoundingBox = OrientedBoundingBox.fromRectangle(\r\n rectangle,\r\n minHeight,\r\n maxHeight,\r\n ellipsoid\r\n );\r\n }\r\n\r\n const occluder = new EllipsoidalOccluder(ellipsoid);\r\n const occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid(\r\n relativeToCenter,\r\n positions,\r\n minHeight\r\n );\r\n\r\n const aaBox = new AxisAlignedBoundingBox(minimum, maximum, relativeToCenter);\r\n const encoding = new TerrainEncoding(\r\n relativeToCenter,\r\n aaBox,\r\n skirtOptions.hMin,\r\n maxHeight,\r\n fromENU,\r\n false,\r\n includeWebMercatorT,\r\n includeGeodeticSurfaceNormals,\r\n exaggeration,\r\n exaggerationRelativeHeight\r\n );\r\n const vertices = new Float32Array(size * encoding.stride);\r\n\r\n let bufferIndex = 0;\r\n for (let k = 0; k < size; ++k) {\r\n bufferIndex = encoding.encode(\r\n vertices,\r\n bufferIndex,\r\n positions[k],\r\n uvs[k],\r\n heights[k],\r\n undefined,\r\n webMercatorTs[k],\r\n geodeticSurfaceNormals[k]\r\n );\r\n }\r\n\r\n const westIndicesSouthToNorth = westBorder\r\n .map(function (vertex) {\r\n return vertex.index;\r\n })\r\n .reverse();\r\n const southIndicesEastToWest = southBorder\r\n .map(function (vertex) {\r\n return vertex.index;\r\n })\r\n .reverse();\r\n const eastIndicesNorthToSouth = eastBorder\r\n .map(function (vertex) {\r\n return vertex.index;\r\n })\r\n .reverse();\r\n const northIndicesWestToEast = northBorder\r\n .map(function (vertex) {\r\n return vertex.index;\r\n })\r\n .reverse();\r\n\r\n southIndicesEastToWest.unshift(\r\n eastIndicesNorthToSouth[eastIndicesNorthToSouth.length - 1]\r\n );\r\n southIndicesEastToWest.push(westIndicesSouthToNorth[0]);\r\n\r\n northIndicesWestToEast.unshift(\r\n westIndicesSouthToNorth[westIndicesSouthToNorth.length - 1]\r\n );\r\n northIndicesWestToEast.push(eastIndicesNorthToSouth[0]);\r\n\r\n return {\r\n vertices: vertices,\r\n indices: new Uint16Array(indices),\r\n maximumHeight: maxHeight,\r\n minimumHeight: minHeight,\r\n encoding: encoding,\r\n boundingSphere3D: boundingSphere3D,\r\n orientedBoundingBox: orientedBoundingBox,\r\n occludeePointInScaledSpace: occludeePointInScaledSpace,\r\n vertexCountWithoutSkirts: vertexCountWithoutSkirts,\r\n indexCountWithoutSkirts: indexCountWithoutSkirts,\r\n westIndicesSouthToNorth: westIndicesSouthToNorth,\r\n southIndicesEastToWest: southIndicesEastToWest,\r\n eastIndicesNorthToSouth: eastIndicesNorthToSouth,\r\n northIndicesWestToEast: northIndicesWestToEast,\r\n };\r\n}\r\n\r\nfunction addSkirt(\r\n positions,\r\n heights,\r\n uvs,\r\n webMercatorTs,\r\n geodeticSurfaceNormals,\r\n indices,\r\n skirtOptions,\r\n borderPoints,\r\n fudgeFactor,\r\n eastOrWest,\r\n cornerFudge\r\n) {\r\n const count = borderPoints.length;\r\n for (let j = 0; j < count; ++j) {\r\n const borderPoint = borderPoints[j];\r\n const borderCartographic = borderPoint.cartographic;\r\n const borderIndex = borderPoint.index;\r\n const currentIndex = positions.length;\r\n\r\n const longitude = borderCartographic.longitude;\r\n let latitude = borderCartographic.latitude;\r\n latitude = CesiumMath.clamp(\r\n latitude,\r\n -CesiumMath.PI_OVER_TWO,\r\n CesiumMath.PI_OVER_TWO\r\n ); // Don't go over the poles\r\n const height = borderCartographic.height - skirtOptions.skirtHeight;\r\n skirtOptions.hMin = Math.min(skirtOptions.hMin, height);\r\n\r\n Cartographic.fromRadians(longitude, latitude, height, scratchCartographic);\r\n\r\n // Adjust sides to angle out\r\n if (eastOrWest) {\r\n scratchCartographic.longitude += fudgeFactor;\r\n }\r\n\r\n // Adjust top or bottom to angle out\r\n // Since corners are in the east/west arrays angle the first and last points as well\r\n if (!eastOrWest) {\r\n scratchCartographic.latitude += fudgeFactor;\r\n } else if (j === count - 1) {\r\n scratchCartographic.latitude += cornerFudge;\r\n } else if (j === 0) {\r\n scratchCartographic.latitude -= cornerFudge;\r\n }\r\n\r\n const pos = skirtOptions.ellipsoid.cartographicToCartesian(\r\n scratchCartographic\r\n );\r\n positions.push(pos);\r\n heights.push(height);\r\n uvs.push(Cartesian2.clone(uvs[borderIndex])); // Copy UVs from border point\r\n if (webMercatorTs.length > 0) {\r\n webMercatorTs.push(webMercatorTs[borderIndex]);\r\n }\r\n if (geodeticSurfaceNormals.length > 0) {\r\n geodeticSurfaceNormals.push(geodeticSurfaceNormals[borderIndex]);\r\n }\r\n\r\n Matrix4.multiplyByPoint(skirtOptions.toENU, pos, scratchCartesian);\r\n\r\n const minimum = skirtOptions.minimum;\r\n const maximum = skirtOptions.maximum;\r\n Cartesian3.minimumByComponent(scratchCartesian, minimum, minimum);\r\n Cartesian3.maximumByComponent(scratchCartesian, maximum, maximum);\r\n\r\n const lastBorderPoint = skirtOptions.lastBorderPoint;\r\n if (defined(lastBorderPoint)) {\r\n const lastBorderIndex = lastBorderPoint.index;\r\n indices.push(\r\n lastBorderIndex,\r\n currentIndex - 1,\r\n currentIndex,\r\n currentIndex,\r\n borderIndex,\r\n lastBorderIndex\r\n );\r\n }\r\n\r\n skirtOptions.lastBorderPoint = borderPoint;\r\n }\r\n}\r\nexport default createTaskProcessorWorker(\r\n createVerticesFromGoogleEarthEnterpriseBuffer\r\n);\r\n"],"names":["defaultValue","CesiumMath","Ellipsoid","Rectangle","Cartographic","Cartesian3","Matrix4","defined","Transforms","WebMercatorProjection","Cartesian2","RuntimeError","BoundingSphere","OrientedBoundingBox","EllipsoidalOccluder","AxisAlignedBoundingBox","TerrainEncoding"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBA,MAAM,YAAY,GAAG,WAAW,CAAC,iBAAiB,CAAC;E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C,OAAO,CAAC;EACzC,IAAID,kBAAU,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EACtE,IAAIA,kBAAU,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACtE;EACA,IAAI,MAAM,eAAe,GAAG,YAAY,CAAC,eAAe,CAAC;EACzD,IAAI,IAAIE,oBAAO,CAAC,eAAe,CAAC,EAAE;EAClC,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC,KAAK,CAAC;EACpD,MAAM,OAAO,CAAC,IAAI;EAClB,QAAQ,eAAe;EACvB,QAAQ,YAAY,GAAG,CAAC;EACxB,QAAQ,YAAY;EACpB,QAAQ,YAAY;EACpB,QAAQ,WAAW;EACnB,QAAQ,eAAe;EACvB,OAAO,CAAC;EACR,KAAK;AACL;EACA,IAAI,YAAY,CAAC,eAAe,GAAG,WAAW,CAAC;EAC/C,GAAG;EACH,CAAC;AACD,wDAAe,yBAAyB;EACxC,EAAE,6CAA6C;EAC/C,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createVerticesFromHeightmap.js b/examples/cesium/Workers/createVerticesFromHeightmap.js
new file mode 100644
index 0000000..f0213d7
--- /dev/null
+++ b/examples/cesium/Workers/createVerticesFromHeightmap.js
@@ -0,0 +1,2733 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Matrix3-f22b0303', './AxisAlignedBoundingBox-50342d27', './Transforms-11fb6b0a', './Matrix2-036c77dd', './defaultValue-0ab18f7d', './Check-d10e5f2e', './TerrainEncoding-c7d764e4', './Math-9be8b918', './OrientedBoundingBox-7e2eebab', './WebMercatorProjection-306f7acc', './RuntimeError-e5c6a8b9', './createTaskProcessorWorker', './combine-4598d225', './AttributeCompression-e9888cb8', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './EllipsoidTangentPlane-c421b2cb', './IntersectionTests-2c7928de', './Plane-c9f1487d'], (function (Matrix3, AxisAlignedBoundingBox, Transforms, Matrix2, defaultValue, Check, TerrainEncoding, Math$1, OrientedBoundingBox, WebMercatorProjection, RuntimeError, createTaskProcessorWorker, combine, AttributeCompression, ComponentDatatype, WebGLConstants, EllipsoidTangentPlane, IntersectionTests, Plane) { 'use strict';
+
+ /**
+ * The encoding that is used for a heightmap
+ *
+ * @enum {Number}
+ */
+ const HeightmapEncoding = {
+ /**
+ * No encoding
+ *
+ * @type {Number}
+ * @constant
+ */
+ NONE: 0,
+
+ /**
+ * LERC encoding
+ *
+ * @type {Number}
+ * @constant
+ *
+ * @see {@link https://github.com/Esri/lerc|The LERC specification}
+ */
+ LERC: 1,
+ };
+ var HeightmapEncoding$1 = Object.freeze(HeightmapEncoding);
+
+ /**
+ * Contains functions to create a mesh from a heightmap image.
+ *
+ * @namespace HeightmapTessellator
+ *
+ * @private
+ */
+ const HeightmapTessellator = {};
+
+ /**
+ * The default structure of a heightmap, as given to {@link HeightmapTessellator.computeVertices}.
+ *
+ * @constant
+ */
+ HeightmapTessellator.DEFAULT_STRUCTURE = Object.freeze({
+ heightScale: 1.0,
+ heightOffset: 0.0,
+ elementsPerHeight: 1,
+ stride: 1,
+ elementMultiplier: 256.0,
+ isBigEndian: false,
+ });
+
+ const cartesian3Scratch = new Matrix3.Cartesian3();
+ const matrix4Scratch = new Matrix2.Matrix4();
+ const minimumScratch = new Matrix3.Cartesian3();
+ const maximumScratch = new Matrix3.Cartesian3();
+
+ /**
+ * Fills an array of vertices from a heightmap image.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.heightmap The heightmap to tessellate.
+ * @param {Number} options.width The width of the heightmap, in height samples.
+ * @param {Number} options.height The height of the heightmap, in height samples.
+ * @param {Number} options.skirtHeight The height of skirts to drape at the edges of the heightmap.
+ * @param {Rectangle} options.nativeRectangle A rectangle in the native coordinates of the heightmap's projection. For
+ * a heightmap with a geographic projection, this is degrees. For the web mercator
+ * projection, this is meters.
+ * @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.
+ * @param {Number} [options.exaggerationRelativeHeight=0.0] The height from which terrain is exaggerated.
+ * @param {Rectangle} [options.rectangle] The rectangle covered by the heightmap, in geodetic coordinates with north, south, east and
+ * west properties in radians. Either rectangle or nativeRectangle must be provided. If both
+ * are provided, they're assumed to be consistent.
+ * @param {Boolean} [options.isGeographic=true] True if the heightmap uses a {@link GeographicProjection}, or false if it uses
+ * a {@link WebMercatorProjection}.
+ * @param {Cartesian3} [options.relativeToCenter=Cartesian3.ZERO] The positions will be computed as Cartesian3.subtract(worldPosition, relativeToCenter)
.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to which the heightmap applies.
+ * @param {Object} [options.structure] An object describing the structure of the height data.
+ * @param {Number} [options.structure.heightScale=1.0] The factor by which to multiply height samples in order to obtain
+ * the height above the heightOffset, in meters. The heightOffset is added to the resulting
+ * height after multiplying by the scale.
+ * @param {Number} [options.structure.heightOffset=0.0] The offset to add to the scaled height to obtain the final
+ * height in meters. The offset is added after the height sample is multiplied by the
+ * heightScale.
+ * @param {Number} [options.structure.elementsPerHeight=1] The number of elements in the buffer that make up a single height
+ * sample. This is usually 1, indicating that each element is a separate height sample. If
+ * it is greater than 1, that number of elements together form the height sample, which is
+ * computed according to the structure.elementMultiplier and structure.isBigEndian properties.
+ * @param {Number} [options.structure.stride=1] The number of elements to skip to get from the first element of
+ * one height to the first element of the next height.
+ * @param {Number} [options.structure.elementMultiplier=256.0] The multiplier used to compute the height value when the
+ * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier
+ * is 256, the height is computed as follows:
+ * `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`
+ * This is assuming that the isBigEndian property is false. If it is true, the order of the
+ * elements is reversed.
+ * @param {Number} [options.structure.lowestEncodedHeight] The lowest value that can be stored in the height buffer. Any heights that are lower
+ * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
+ * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is
+ * not specified, no minimum value is enforced.
+ * @param {Number} [options.structure.highestEncodedHeight] The highest value that can be stored in the height buffer. Any heights that are higher
+ * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height
+ * buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger
+ * than 65535. If this parameter is not specified, no maximum value is enforced.
+ * @param {Boolean} [options.structure.isBigEndian=false] Indicates endianness of the elements in the buffer when the
+ * stride property is greater than 1. If this property is false, the first element is the
+ * low-order element. If it is true, the first element is the high-order element.
+ *
+ * @example
+ * const width = 5;
+ * const height = 5;
+ * const statistics = Cesium.HeightmapTessellator.computeVertices({
+ * heightmap : [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0],
+ * width : width,
+ * height : height,
+ * skirtHeight : 0.0,
+ * nativeRectangle : {
+ * west : 10.0,
+ * east : 20.0,
+ * south : 30.0,
+ * north : 40.0
+ * }
+ * });
+ *
+ * const encoding = statistics.encoding;
+ * const position = encoding.decodePosition(statistics.vertices, index);
+ */
+ HeightmapTessellator.computeVertices = function (options) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(options) || !defaultValue.defined(options.heightmap)) {
+ throw new Check.DeveloperError("options.heightmap is required.");
+ }
+ if (!defaultValue.defined(options.width) || !defaultValue.defined(options.height)) {
+ throw new Check.DeveloperError("options.width and options.height are required.");
+ }
+ if (!defaultValue.defined(options.nativeRectangle)) {
+ throw new Check.DeveloperError("options.nativeRectangle is required.");
+ }
+ if (!defaultValue.defined(options.skirtHeight)) {
+ throw new Check.DeveloperError("options.skirtHeight is required.");
+ }
+ //>>includeEnd('debug');
+
+ // This function tends to be a performance hotspot for terrain rendering,
+ // so it employs a lot of inlining and unrolling as an optimization.
+ // In particular, the functionality of Ellipsoid.cartographicToCartesian
+ // is inlined.
+
+ const cos = Math.cos;
+ const sin = Math.sin;
+ const sqrt = Math.sqrt;
+ const atan = Math.atan;
+ const exp = Math.exp;
+ const piOverTwo = Math$1.CesiumMath.PI_OVER_TWO;
+ const toRadians = Math$1.CesiumMath.toRadians;
+
+ const heightmap = options.heightmap;
+ const width = options.width;
+ const height = options.height;
+ const skirtHeight = options.skirtHeight;
+ const hasSkirts = skirtHeight > 0.0;
+
+ const isGeographic = defaultValue.defaultValue(options.isGeographic, true);
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+
+ const oneOverGlobeSemimajorAxis = 1.0 / ellipsoid.maximumRadius;
+
+ const nativeRectangle = Matrix2.Rectangle.clone(options.nativeRectangle);
+ const rectangle = Matrix2.Rectangle.clone(options.rectangle);
+
+ let geographicWest;
+ let geographicSouth;
+ let geographicEast;
+ let geographicNorth;
+
+ if (!defaultValue.defined(rectangle)) {
+ if (isGeographic) {
+ geographicWest = toRadians(nativeRectangle.west);
+ geographicSouth = toRadians(nativeRectangle.south);
+ geographicEast = toRadians(nativeRectangle.east);
+ geographicNorth = toRadians(nativeRectangle.north);
+ } else {
+ geographicWest = nativeRectangle.west * oneOverGlobeSemimajorAxis;
+ geographicSouth =
+ piOverTwo -
+ 2.0 * atan(exp(-nativeRectangle.south * oneOverGlobeSemimajorAxis));
+ geographicEast = nativeRectangle.east * oneOverGlobeSemimajorAxis;
+ geographicNorth =
+ piOverTwo -
+ 2.0 * atan(exp(-nativeRectangle.north * oneOverGlobeSemimajorAxis));
+ }
+ } else {
+ geographicWest = rectangle.west;
+ geographicSouth = rectangle.south;
+ geographicEast = rectangle.east;
+ geographicNorth = rectangle.north;
+ }
+
+ let relativeToCenter = options.relativeToCenter;
+ const hasRelativeToCenter = defaultValue.defined(relativeToCenter);
+ relativeToCenter = hasRelativeToCenter ? relativeToCenter : Matrix3.Cartesian3.ZERO;
+ const includeWebMercatorT = defaultValue.defaultValue(options.includeWebMercatorT, false);
+
+ const exaggeration = defaultValue.defaultValue(options.exaggeration, 1.0);
+ const exaggerationRelativeHeight = defaultValue.defaultValue(
+ options.exaggerationRelativeHeight,
+ 0.0
+ );
+ const hasExaggeration = exaggeration !== 1.0;
+ const includeGeodeticSurfaceNormals = hasExaggeration;
+
+ const structure = defaultValue.defaultValue(
+ options.structure,
+ HeightmapTessellator.DEFAULT_STRUCTURE
+ );
+ const heightScale = defaultValue.defaultValue(
+ structure.heightScale,
+ HeightmapTessellator.DEFAULT_STRUCTURE.heightScale
+ );
+ const heightOffset = defaultValue.defaultValue(
+ structure.heightOffset,
+ HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset
+ );
+ const elementsPerHeight = defaultValue.defaultValue(
+ structure.elementsPerHeight,
+ HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight
+ );
+ const stride = defaultValue.defaultValue(
+ structure.stride,
+ HeightmapTessellator.DEFAULT_STRUCTURE.stride
+ );
+ const elementMultiplier = defaultValue.defaultValue(
+ structure.elementMultiplier,
+ HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier
+ );
+ const isBigEndian = defaultValue.defaultValue(
+ structure.isBigEndian,
+ HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian
+ );
+
+ let rectangleWidth = Matrix2.Rectangle.computeWidth(nativeRectangle);
+ let rectangleHeight = Matrix2.Rectangle.computeHeight(nativeRectangle);
+
+ const granularityX = rectangleWidth / (width - 1);
+ const granularityY = rectangleHeight / (height - 1);
+
+ if (!isGeographic) {
+ rectangleWidth *= oneOverGlobeSemimajorAxis;
+ rectangleHeight *= oneOverGlobeSemimajorAxis;
+ }
+
+ const radiiSquared = ellipsoid.radiiSquared;
+ const radiiSquaredX = radiiSquared.x;
+ const radiiSquaredY = radiiSquared.y;
+ const radiiSquaredZ = radiiSquared.z;
+
+ let minimumHeight = 65536.0;
+ let maximumHeight = -65536.0;
+
+ const fromENU = Transforms.Transforms.eastNorthUpToFixedFrame(
+ relativeToCenter,
+ ellipsoid
+ );
+ const toENU = Matrix2.Matrix4.inverseTransformation(fromENU, matrix4Scratch);
+
+ let southMercatorY;
+ let oneOverMercatorHeight;
+ if (includeWebMercatorT) {
+ southMercatorY = WebMercatorProjection.WebMercatorProjection.geodeticLatitudeToMercatorAngle(
+ geographicSouth
+ );
+ oneOverMercatorHeight =
+ 1.0 /
+ (WebMercatorProjection.WebMercatorProjection.geodeticLatitudeToMercatorAngle(geographicNorth) -
+ southMercatorY);
+ }
+
+ const minimum = minimumScratch;
+ minimum.x = Number.POSITIVE_INFINITY;
+ minimum.y = Number.POSITIVE_INFINITY;
+ minimum.z = Number.POSITIVE_INFINITY;
+
+ const maximum = maximumScratch;
+ maximum.x = Number.NEGATIVE_INFINITY;
+ maximum.y = Number.NEGATIVE_INFINITY;
+ maximum.z = Number.NEGATIVE_INFINITY;
+
+ let hMin = Number.POSITIVE_INFINITY;
+
+ const gridVertexCount = width * height;
+ const edgeVertexCount = skirtHeight > 0.0 ? width * 2 + height * 2 : 0;
+ const vertexCount = gridVertexCount + edgeVertexCount;
+
+ const positions = new Array(vertexCount);
+ const heights = new Array(vertexCount);
+ const uvs = new Array(vertexCount);
+ const webMercatorTs = includeWebMercatorT ? new Array(vertexCount) : [];
+ const geodeticSurfaceNormals = includeGeodeticSurfaceNormals
+ ? new Array(vertexCount)
+ : [];
+
+ let startRow = 0;
+ let endRow = height;
+ let startCol = 0;
+ let endCol = width;
+
+ if (hasSkirts) {
+ --startRow;
+ ++endRow;
+ --startCol;
+ ++endCol;
+ }
+
+ const skirtOffsetPercentage = 0.00001;
+
+ for (let rowIndex = startRow; rowIndex < endRow; ++rowIndex) {
+ let row = rowIndex;
+ if (row < 0) {
+ row = 0;
+ }
+ if (row >= height) {
+ row = height - 1;
+ }
+
+ let latitude = nativeRectangle.north - granularityY * row;
+
+ if (!isGeographic) {
+ latitude =
+ piOverTwo - 2.0 * atan(exp(-latitude * oneOverGlobeSemimajorAxis));
+ } else {
+ latitude = toRadians(latitude);
+ }
+
+ let v = (latitude - geographicSouth) / (geographicNorth - geographicSouth);
+ v = Math$1.CesiumMath.clamp(v, 0.0, 1.0);
+
+ const isNorthEdge = rowIndex === startRow;
+ const isSouthEdge = rowIndex === endRow - 1;
+ if (skirtHeight > 0.0) {
+ if (isNorthEdge) {
+ latitude += skirtOffsetPercentage * rectangleHeight;
+ } else if (isSouthEdge) {
+ latitude -= skirtOffsetPercentage * rectangleHeight;
+ }
+ }
+
+ const cosLatitude = cos(latitude);
+ const nZ = sin(latitude);
+ const kZ = radiiSquaredZ * nZ;
+
+ let webMercatorT;
+ if (includeWebMercatorT) {
+ webMercatorT =
+ (WebMercatorProjection.WebMercatorProjection.geodeticLatitudeToMercatorAngle(latitude) -
+ southMercatorY) *
+ oneOverMercatorHeight;
+ }
+
+ for (let colIndex = startCol; colIndex < endCol; ++colIndex) {
+ let col = colIndex;
+ if (col < 0) {
+ col = 0;
+ }
+ if (col >= width) {
+ col = width - 1;
+ }
+
+ const terrainOffset = row * (width * stride) + col * stride;
+
+ let heightSample;
+ if (elementsPerHeight === 1) {
+ heightSample = heightmap[terrainOffset];
+ } else {
+ heightSample = 0;
+
+ let elementOffset;
+ if (isBigEndian) {
+ for (
+ elementOffset = 0;
+ elementOffset < elementsPerHeight;
+ ++elementOffset
+ ) {
+ heightSample =
+ heightSample * elementMultiplier +
+ heightmap[terrainOffset + elementOffset];
+ }
+ } else {
+ for (
+ elementOffset = elementsPerHeight - 1;
+ elementOffset >= 0;
+ --elementOffset
+ ) {
+ heightSample =
+ heightSample * elementMultiplier +
+ heightmap[terrainOffset + elementOffset];
+ }
+ }
+ }
+
+ heightSample = heightSample * heightScale + heightOffset;
+
+ maximumHeight = Math.max(maximumHeight, heightSample);
+ minimumHeight = Math.min(minimumHeight, heightSample);
+
+ let longitude = nativeRectangle.west + granularityX * col;
+
+ if (!isGeographic) {
+ longitude = longitude * oneOverGlobeSemimajorAxis;
+ } else {
+ longitude = toRadians(longitude);
+ }
+
+ let u = (longitude - geographicWest) / (geographicEast - geographicWest);
+ u = Math$1.CesiumMath.clamp(u, 0.0, 1.0);
+
+ let index = row * width + col;
+
+ if (skirtHeight > 0.0) {
+ const isWestEdge = colIndex === startCol;
+ const isEastEdge = colIndex === endCol - 1;
+ const isEdge = isNorthEdge || isSouthEdge || isWestEdge || isEastEdge;
+ const isCorner =
+ (isNorthEdge || isSouthEdge) && (isWestEdge || isEastEdge);
+ if (isCorner) {
+ // Don't generate skirts on the corners.
+ continue;
+ } else if (isEdge) {
+ heightSample -= skirtHeight;
+
+ if (isWestEdge) {
+ // The outer loop iterates north to south but the indices are ordered south to north, hence the index flip below
+ index = gridVertexCount + (height - row - 1);
+ longitude -= skirtOffsetPercentage * rectangleWidth;
+ } else if (isSouthEdge) {
+ // Add after west indices. South indices are ordered east to west.
+ index = gridVertexCount + height + (width - col - 1);
+ } else if (isEastEdge) {
+ // Add after west and south indices. East indices are ordered north to south. The index is flipped like above.
+ index = gridVertexCount + height + width + row;
+ longitude += skirtOffsetPercentage * rectangleWidth;
+ } else if (isNorthEdge) {
+ // Add after west, south, and east indices. North indices are ordered west to east.
+ index = gridVertexCount + height + width + height + col;
+ }
+ }
+ }
+
+ const nX = cosLatitude * cos(longitude);
+ const nY = cosLatitude * sin(longitude);
+
+ const kX = radiiSquaredX * nX;
+ const kY = radiiSquaredY * nY;
+
+ const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);
+ const oneOverGamma = 1.0 / gamma;
+
+ const rSurfaceX = kX * oneOverGamma;
+ const rSurfaceY = kY * oneOverGamma;
+ const rSurfaceZ = kZ * oneOverGamma;
+
+ const position = new Matrix3.Cartesian3();
+ position.x = rSurfaceX + nX * heightSample;
+ position.y = rSurfaceY + nY * heightSample;
+ position.z = rSurfaceZ + nZ * heightSample;
+
+ Matrix2.Matrix4.multiplyByPoint(toENU, position, cartesian3Scratch);
+ Matrix3.Cartesian3.minimumByComponent(cartesian3Scratch, minimum, minimum);
+ Matrix3.Cartesian3.maximumByComponent(cartesian3Scratch, maximum, maximum);
+ hMin = Math.min(hMin, heightSample);
+
+ positions[index] = position;
+ uvs[index] = new Matrix2.Cartesian2(u, v);
+ heights[index] = heightSample;
+
+ if (includeWebMercatorT) {
+ webMercatorTs[index] = webMercatorT;
+ }
+
+ if (includeGeodeticSurfaceNormals) {
+ geodeticSurfaceNormals[index] = ellipsoid.geodeticSurfaceNormal(
+ position
+ );
+ }
+ }
+ }
+
+ const boundingSphere3D = Transforms.BoundingSphere.fromPoints(positions);
+ let orientedBoundingBox;
+ if (defaultValue.defined(rectangle)) {
+ orientedBoundingBox = OrientedBoundingBox.OrientedBoundingBox.fromRectangle(
+ rectangle,
+ minimumHeight,
+ maximumHeight,
+ ellipsoid
+ );
+ }
+
+ let occludeePointInScaledSpace;
+ if (hasRelativeToCenter) {
+ const occluder = new TerrainEncoding.EllipsoidalOccluder(ellipsoid);
+ occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid(
+ relativeToCenter,
+ positions,
+ minimumHeight
+ );
+ }
+
+ const aaBox = new AxisAlignedBoundingBox.AxisAlignedBoundingBox(minimum, maximum, relativeToCenter);
+ const encoding = new TerrainEncoding.TerrainEncoding(
+ relativeToCenter,
+ aaBox,
+ hMin,
+ maximumHeight,
+ fromENU,
+ false,
+ includeWebMercatorT,
+ includeGeodeticSurfaceNormals,
+ exaggeration,
+ exaggerationRelativeHeight
+ );
+ const vertices = new Float32Array(vertexCount * encoding.stride);
+
+ let bufferIndex = 0;
+ for (let j = 0; j < vertexCount; ++j) {
+ bufferIndex = encoding.encode(
+ vertices,
+ bufferIndex,
+ positions[j],
+ uvs[j],
+ heights[j],
+ undefined,
+ webMercatorTs[j],
+ geodeticSurfaceNormals[j]
+ );
+ }
+
+ return {
+ vertices: vertices,
+ maximumHeight: maximumHeight,
+ minimumHeight: minimumHeight,
+ encoding: encoding,
+ boundingSphere3D: boundingSphere3D,
+ orientedBoundingBox: orientedBoundingBox,
+ occludeePointInScaledSpace: occludeePointInScaledSpace,
+ };
+ };
+ var HeightmapTessellator$1 = HeightmapTessellator;
+
+ var LercDecode = {exports: {}};
+
+ /* jshint forin: false, bitwise: false */
+
+ (function (module) {
+ /*
+ Copyright 2015-2018 Esri
+
+ 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.
+
+ A copy of the license and additional notices are located with the
+ source distribution at:
+
+ http://github.com/Esri/lerc/
+
+ Contributors: Johannes Schmid, (LERC v1)
+ Chayanika Khatua, (LERC v1)
+ Wenxue Ju (LERC v1, v2.x)
+ */
+
+ /* Copyright 2015-2018 Esri. 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 @preserve */
+
+ /**
+ * a module for decoding LERC blobs
+ * @module Lerc
+ */
+ (function() {
+ //the original LercDecode for Version 1
+ var LercDecode = (function() {
+
+ // WARNING: This decoder version can only read old version 1 Lerc blobs. Use with caution.
+
+ // Note: currently, this module only has an implementation for decoding LERC data, not encoding. The name of
+ // the class was chosen to be future proof.
+
+ var CntZImage = {};
+
+ CntZImage.defaultNoDataValue = -3.4027999387901484e+38; // smallest Float32 value
+
+ /**
+ * Decode a LERC byte stream and return an object containing the pixel data and some required and optional
+ * information about it, such as the image's width and height.
+ *
+ * @param {ArrayBuffer} input The LERC input byte stream
+ * @param {object} [options] Decoding options, containing any of the following properties:
+ * @config {number} [inputOffset = 0]
+ * Skip the first inputOffset bytes of the input byte stream. A valid LERC file is expected at that position.
+ * @config {Uint8Array} [encodedMask = null]
+ * If specified, the decoder will not read mask information from the input and use the specified encoded
+ * mask data instead. Mask header/data must not be present in the LERC byte stream in this case.
+ * @config {number} [noDataValue = LercCode.defaultNoDataValue]
+ * Pixel value to use for masked pixels.
+ * @config {ArrayBufferView|Array} [pixelType = Float32Array]
+ * The desired type of the pixelData array in the return value. Note that it is the caller's responsibility to
+ * provide an appropriate noDataValue if the default pixelType is overridden.
+ * @config {boolean} [returnMask = false]
+ * If true, the return value will contain a maskData property of type Uint8Array which has one element per
+ * pixel, the value of which is 1 or 0 depending on whether that pixel's data is present or masked. If the
+ * input LERC data does not contain a mask, maskData will not be returned.
+ * @config {boolean} [returnEncodedMask = false]
+ * If true, the return value will contain a encodedMaskData property, which can be passed into encode() as
+ * encodedMask.
+ * @config {boolean} [returnFileInfo = false]
+ * If true, the return value will have a fileInfo property that contains metadata obtained from the
+ * LERC headers and the decoding process.
+ * @config {boolean} [computeUsedBitDepths = false]
+ * If true, the fileInfo property in the return value will contain the set of all block bit depths
+ * encountered during decoding. Will only have an effect if returnFileInfo option is true.
+ * @returns {{width, height, pixelData, minValue, maxValue, noDataValue, maskData, encodedMaskData, fileInfo}}
+ */
+ CntZImage.decode = function(input, options) {
+ options = options || {};
+
+ var skipMask = options.encodedMaskData || (options.encodedMaskData === null);
+ var parsedData = parse(input, options.inputOffset || 0, skipMask);
+
+ var noDataValue = (options.noDataValue !== null) ? options.noDataValue : CntZImage.defaultNoDataValue;
+
+ var uncompressedData = uncompressPixelValues(parsedData, options.pixelType || Float32Array,
+ options.encodedMaskData, noDataValue, options.returnMask);
+
+ var result = {
+ width: parsedData.width,
+ height: parsedData.height,
+ pixelData: uncompressedData.resultPixels,
+ minValue: uncompressedData.minValue,
+ maxValue: parsedData.pixels.maxValue,
+ noDataValue: noDataValue
+ };
+
+ if (uncompressedData.resultMask) {
+ result.maskData = uncompressedData.resultMask;
+ }
+
+ if (options.returnEncodedMask && parsedData.mask) {
+ result.encodedMaskData = parsedData.mask.bitset ? parsedData.mask.bitset : null;
+ }
+
+ if (options.returnFileInfo) {
+ result.fileInfo = formatFileInfo(parsedData);
+ if (options.computeUsedBitDepths) {
+ result.fileInfo.bitDepths = computeUsedBitDepths(parsedData);
+ }
+ }
+
+ return result;
+ };
+
+ var uncompressPixelValues = function(data, TypedArrayClass, maskBitset, noDataValue, storeDecodedMask) {
+ var blockIdx = 0;
+ var numX = data.pixels.numBlocksX;
+ var numY = data.pixels.numBlocksY;
+ var blockWidth = Math.floor(data.width / numX);
+ var blockHeight = Math.floor(data.height / numY);
+ var scale = 2 * data.maxZError;
+ var minValue = Number.MAX_VALUE, currentValue;
+ maskBitset = maskBitset || ((data.mask) ? data.mask.bitset : null);
+
+ var resultPixels, resultMask;
+ resultPixels = new TypedArrayClass(data.width * data.height);
+ if (storeDecodedMask && maskBitset) {
+ resultMask = new Uint8Array(data.width * data.height);
+ }
+ var blockDataBuffer = new Float32Array(blockWidth * blockHeight);
+
+ var xx, yy;
+ for (var y = 0; y <= numY; y++) {
+ var thisBlockHeight = (y !== numY) ? blockHeight : (data.height % numY);
+ if (thisBlockHeight === 0) {
+ continue;
+ }
+ for (var x = 0; x <= numX; x++) {
+ var thisBlockWidth = (x !== numX) ? blockWidth : (data.width % numX);
+ if (thisBlockWidth === 0) {
+ continue;
+ }
+
+ var outPtr = y * data.width * blockHeight + x * blockWidth;
+ var outStride = data.width - thisBlockWidth;
+
+ var block = data.pixels.blocks[blockIdx];
+
+ var blockData, blockPtr, constValue;
+ if (block.encoding < 2) {
+ // block is either uncompressed or bit-stuffed (encodings 0 and 1)
+ if (block.encoding === 0) {
+ // block is uncompressed
+ blockData = block.rawData;
+ } else {
+ // block is bit-stuffed
+ unstuff(block.stuffedData, block.bitsPerPixel, block.numValidPixels, block.offset, scale, blockDataBuffer, data.pixels.maxValue);
+ blockData = blockDataBuffer;
+ }
+ blockPtr = 0;
+ }
+ else if (block.encoding === 2) {
+ // block is all 0
+ constValue = 0;
+ }
+ else {
+ // block has constant value (encoding === 3)
+ constValue = block.offset;
+ }
+
+ var maskByte;
+ if (maskBitset) {
+ for (yy = 0; yy < thisBlockHeight; yy++) {
+ if (outPtr & 7) {
+ //
+ maskByte = maskBitset[outPtr >> 3];
+ maskByte <<= outPtr & 7;
+ }
+ for (xx = 0; xx < thisBlockWidth; xx++) {
+ if (!(outPtr & 7)) {
+ // read next byte from mask
+ maskByte = maskBitset[outPtr >> 3];
+ }
+ if (maskByte & 128) {
+ // pixel data present
+ if (resultMask) {
+ resultMask[outPtr] = 1;
+ }
+ currentValue = (block.encoding < 2) ? blockData[blockPtr++] : constValue;
+ minValue = minValue > currentValue ? currentValue : minValue;
+ resultPixels[outPtr++] = currentValue;
+ } else {
+ // pixel data not present
+ if (resultMask) {
+ resultMask[outPtr] = 0;
+ }
+ resultPixels[outPtr++] = noDataValue;
+ }
+ maskByte <<= 1;
+ }
+ outPtr += outStride;
+ }
+ } else {
+ // mask not present, simply copy block over
+ if (block.encoding < 2) {
+ // duplicating this code block for performance reasons
+ // blockData case:
+ for (yy = 0; yy < thisBlockHeight; yy++) {
+ for (xx = 0; xx < thisBlockWidth; xx++) {
+ currentValue = blockData[blockPtr++];
+ minValue = minValue > currentValue ? currentValue : minValue;
+ resultPixels[outPtr++] = currentValue;
+ }
+ outPtr += outStride;
+ }
+ }
+ else {
+ // constValue case:
+ minValue = minValue > constValue ? constValue : minValue;
+ for (yy = 0; yy < thisBlockHeight; yy++) {
+ for (xx = 0; xx < thisBlockWidth; xx++) {
+ resultPixels[outPtr++] = constValue;
+ }
+ outPtr += outStride;
+ }
+ }
+ }
+ if ((block.encoding === 1) && (blockPtr !== block.numValidPixels)) {
+ throw "Block and Mask do not match";
+ }
+ blockIdx++;
+ }
+ }
+
+ return {
+ resultPixels: resultPixels,
+ resultMask: resultMask,
+ minValue: minValue
+ };
+ };
+
+ var formatFileInfo = function(data) {
+ return {
+ "fileIdentifierString": data.fileIdentifierString,
+ "fileVersion": data.fileVersion,
+ "imageType": data.imageType,
+ "height": data.height,
+ "width": data.width,
+ "maxZError": data.maxZError,
+ "eofOffset": data.eofOffset,
+ "mask": data.mask ? {
+ "numBlocksX": data.mask.numBlocksX,
+ "numBlocksY": data.mask.numBlocksY,
+ "numBytes": data.mask.numBytes,
+ "maxValue": data.mask.maxValue
+ } : null,
+ "pixels": {
+ "numBlocksX": data.pixels.numBlocksX,
+ "numBlocksY": data.pixels.numBlocksY,
+ "numBytes": data.pixels.numBytes,
+ "maxValue": data.pixels.maxValue,
+ "noDataValue": data.noDataValue
+ }
+ };
+ };
+
+ var computeUsedBitDepths = function(data) {
+ var numBlocks = data.pixels.numBlocksX * data.pixels.numBlocksY;
+ var bitDepths = {};
+ for (var i = 0; i < numBlocks; i++) {
+ var block = data.pixels.blocks[i];
+ if (block.encoding === 0) {
+ bitDepths.float32 = true;
+ } else if (block.encoding === 1) {
+ bitDepths[block.bitsPerPixel] = true;
+ } else {
+ bitDepths[0] = true;
+ }
+ }
+
+ return Object.keys(bitDepths);
+ };
+
+ var parse = function(input, fp, skipMask) {
+ var data = {};
+
+ // File header
+ var fileIdView = new Uint8Array(input, fp, 10);
+ data.fileIdentifierString = String.fromCharCode.apply(null, fileIdView);
+ if (data.fileIdentifierString.trim() !== "CntZImage") {
+ throw "Unexpected file identifier string: " + data.fileIdentifierString;
+ }
+ fp += 10;
+ var view = new DataView(input, fp, 24);
+ data.fileVersion = view.getInt32(0, true);
+ data.imageType = view.getInt32(4, true);
+ data.height = view.getUint32(8, true);
+ data.width = view.getUint32(12, true);
+ data.maxZError = view.getFloat64(16, true);
+ fp += 24;
+
+ // Mask Header
+ if (!skipMask) {
+ view = new DataView(input, fp, 16);
+ data.mask = {};
+ data.mask.numBlocksY = view.getUint32(0, true);
+ data.mask.numBlocksX = view.getUint32(4, true);
+ data.mask.numBytes = view.getUint32(8, true);
+ data.mask.maxValue = view.getFloat32(12, true);
+ fp += 16;
+
+ // Mask Data
+ if (data.mask.numBytes > 0) {
+ var bitset = new Uint8Array(Math.ceil(data.width * data.height / 8));
+ view = new DataView(input, fp, data.mask.numBytes);
+ var cnt = view.getInt16(0, true);
+ var ip = 2, op = 0;
+ do {
+ if (cnt > 0) {
+ while (cnt--) { bitset[op++] = view.getUint8(ip++); }
+ } else {
+ var val = view.getUint8(ip++);
+ cnt = -cnt;
+ while (cnt--) { bitset[op++] = val; }
+ }
+ cnt = view.getInt16(ip, true);
+ ip += 2;
+ } while (ip < data.mask.numBytes);
+ if ((cnt !== -32768) || (op < bitset.length)) {
+ throw "Unexpected end of mask RLE encoding";
+ }
+ data.mask.bitset = bitset;
+ fp += data.mask.numBytes;
+ }
+ else if ((data.mask.numBytes | data.mask.numBlocksY | data.mask.maxValue) === 0) { // Special case, all nodata
+ data.mask.bitset = new Uint8Array(Math.ceil(data.width * data.height / 8));
+ }
+ }
+
+ // Pixel Header
+ view = new DataView(input, fp, 16);
+ data.pixels = {};
+ data.pixels.numBlocksY = view.getUint32(0, true);
+ data.pixels.numBlocksX = view.getUint32(4, true);
+ data.pixels.numBytes = view.getUint32(8, true);
+ data.pixels.maxValue = view.getFloat32(12, true);
+ fp += 16;
+
+ var numBlocksX = data.pixels.numBlocksX;
+ var numBlocksY = data.pixels.numBlocksY;
+ // the number of blocks specified in the header does not take into account the blocks at the end of
+ // each row/column with a special width/height that make the image complete in case the width is not
+ // evenly divisible by the number of blocks.
+ var actualNumBlocksX = numBlocksX + ((data.width % numBlocksX) > 0 ? 1 : 0);
+ var actualNumBlocksY = numBlocksY + ((data.height % numBlocksY) > 0 ? 1 : 0);
+ data.pixels.blocks = new Array(actualNumBlocksX * actualNumBlocksY);
+ var blockI = 0;
+ for (var blockY = 0; blockY < actualNumBlocksY; blockY++) {
+ for (var blockX = 0; blockX < actualNumBlocksX; blockX++) {
+
+ // Block
+ var size = 0;
+ var bytesLeft = input.byteLength - fp;
+ view = new DataView(input, fp, Math.min(10, bytesLeft));
+ var block = {};
+ data.pixels.blocks[blockI++] = block;
+ var headerByte = view.getUint8(0); size++;
+ block.encoding = headerByte & 63;
+ if (block.encoding > 3) {
+ throw "Invalid block encoding (" + block.encoding + ")";
+ }
+ if (block.encoding === 2) {
+ fp++;
+ continue;
+ }
+ if ((headerByte !== 0) && (headerByte !== 2)) {
+ headerByte >>= 6;
+ block.offsetType = headerByte;
+ if (headerByte === 2) {
+ block.offset = view.getInt8(1); size++;
+ } else if (headerByte === 1) {
+ block.offset = view.getInt16(1, true); size += 2;
+ } else if (headerByte === 0) {
+ block.offset = view.getFloat32(1, true); size += 4;
+ } else {
+ throw "Invalid block offset type";
+ }
+
+ if (block.encoding === 1) {
+ headerByte = view.getUint8(size); size++;
+ block.bitsPerPixel = headerByte & 63;
+ headerByte >>= 6;
+ block.numValidPixelsType = headerByte;
+ if (headerByte === 2) {
+ block.numValidPixels = view.getUint8(size); size++;
+ } else if (headerByte === 1) {
+ block.numValidPixels = view.getUint16(size, true); size += 2;
+ } else if (headerByte === 0) {
+ block.numValidPixels = view.getUint32(size, true); size += 4;
+ } else {
+ throw "Invalid valid pixel count type";
+ }
+ }
+ }
+ fp += size;
+
+ if (block.encoding === 3) {
+ continue;
+ }
+
+ var arrayBuf, store8;
+ if (block.encoding === 0) {
+ var numPixels = (data.pixels.numBytes - 1) / 4;
+ if (numPixels !== Math.floor(numPixels)) {
+ throw "uncompressed block has invalid length";
+ }
+ arrayBuf = new ArrayBuffer(numPixels * 4);
+ store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, fp, numPixels * 4));
+ var rawData = new Float32Array(arrayBuf);
+ block.rawData = rawData;
+ fp += numPixels * 4;
+ } else if (block.encoding === 1) {
+ var dataBytes = Math.ceil(block.numValidPixels * block.bitsPerPixel / 8);
+ var dataWords = Math.ceil(dataBytes / 4);
+ arrayBuf = new ArrayBuffer(dataWords * 4);
+ store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, fp, dataBytes));
+ block.stuffedData = new Uint32Array(arrayBuf);
+ fp += dataBytes;
+ }
+ }
+ }
+ data.eofOffset = fp;
+ return data;
+ };
+
+ var unstuff = function(src, bitsPerPixel, numPixels, offset, scale, dest, maxValue) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o;
+ var bitsLeft = 0;
+ var n, buffer;
+ var nmax = Math.ceil((maxValue - offset) / scale);
+ // get rid of trailing bytes that are already part of next block
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
+
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;
+ bitsLeft -= bitsPerPixel;
+ } else {
+ var missingBits = (bitsPerPixel - bitsLeft);
+ n = ((buffer & bitMask) << missingBits) & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n += (buffer >>> bitsLeft);
+ }
+ //pixel values may exceed max due to quantization
+ dest[o] = n < nmax ? offset + n * scale : maxValue;
+ }
+ return dest;
+ };
+
+ return CntZImage;
+ })();
+
+ //version 2. Supports 2.1, 2.2, 2.3
+ var Lerc2Decode = (function() {
+ // Note: currently, this module only has an implementation for decoding LERC data, not encoding. The name of
+ // the class was chosen to be future proof, following LercDecode.
+
+ /*****************************************
+ * private static class bitsutffer used by Lerc2Decode
+ *******************************************/
+ var BitStuffer = {
+ //methods ending with 2 are for the new byte order used by Lerc2.3 and above.
+ //originalUnstuff is used to unpack Huffman code table. code is duplicated to unstuffx for performance reasons.
+ unstuff: function(src, dest, bitsPerPixel, numPixels, lutArr, offset, scale, maxValue) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o;
+ var bitsLeft = 0;
+ var n, buffer, missingBits, nmax;
+
+ // get rid of trailing bytes that are already part of next block
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
+ if (lutArr) {
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;
+ bitsLeft -= bitsPerPixel;
+ }
+ else {
+ missingBits = (bitsPerPixel - bitsLeft);
+ n = ((buffer & bitMask) << missingBits) & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n += (buffer >>> bitsLeft);
+ }
+ dest[o] = lutArr[n];//offset + lutArr[n] * scale;
+ }
+ }
+ else {
+ nmax = Math.ceil((maxValue - offset) / scale);
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;
+ bitsLeft -= bitsPerPixel;
+ }
+ else {
+ missingBits = (bitsPerPixel - bitsLeft);
+ n = ((buffer & bitMask) << missingBits) & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n += (buffer >>> bitsLeft);
+ }
+ //pixel values may exceed max due to quantization
+ dest[o] = n < nmax ? offset + n * scale : maxValue;
+ }
+ }
+ },
+
+ unstuffLUT: function(src, bitsPerPixel, numPixels, offset, scale, maxValue) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o = 0, missingBits = 0, bitsLeft = 0, n = 0;
+ var buffer;
+ var dest = [];
+
+ // get rid of trailing bytes that are already part of next block
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
+
+ var nmax = Math.ceil((maxValue - offset) / scale);
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;
+ bitsLeft -= bitsPerPixel;
+ } else {
+ missingBits = (bitsPerPixel - bitsLeft);
+ n = ((buffer & bitMask) << missingBits) & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n += (buffer >>> bitsLeft);
+ }
+ //dest.push(n);
+ dest[o] = n < nmax ? offset + n * scale : maxValue;
+ }
+ dest.unshift(offset);//1st one
+ return dest;
+ },
+
+ unstuff2: function(src, dest, bitsPerPixel, numPixels, lutArr, offset, scale, maxValue) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o;
+ var bitsLeft = 0, bitPos = 0;
+ var n, buffer, missingBits;
+ if (lutArr) {
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ bitPos = 0;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = ((buffer >>> bitPos) & bitMask);
+ bitsLeft -= bitsPerPixel;
+ bitPos += bitsPerPixel;
+ } else {
+ missingBits = (bitsPerPixel - bitsLeft);
+ n = (buffer >>> bitPos) & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);
+ bitPos = missingBits;
+ }
+ dest[o] = lutArr[n];
+ }
+ }
+ else {
+ var nmax = Math.ceil((maxValue - offset) / scale);
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ bitPos = 0;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ //no unsigned left shift
+ n = ((buffer >>> bitPos) & bitMask);
+ bitsLeft -= bitsPerPixel;
+ bitPos += bitsPerPixel;
+ } else {
+ missingBits = (bitsPerPixel - bitsLeft);
+ n = (buffer >>> bitPos) & bitMask;//((buffer & bitMask) << missingBits) & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);
+ bitPos = missingBits;
+ }
+ //pixel values may exceed max due to quantization
+ dest[o] = n < nmax ? offset + n * scale : maxValue;
+ }
+ }
+ return dest;
+ },
+
+ unstuffLUT2: function(src, bitsPerPixel, numPixels, offset, scale, maxValue) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o = 0, missingBits = 0, bitsLeft = 0, n = 0, bitPos = 0;
+ var buffer;
+ var dest = [];
+ var nmax = Math.ceil((maxValue - offset) / scale);
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ bitPos = 0;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ //no unsigned left shift
+ n = ((buffer >>> bitPos) & bitMask);
+ bitsLeft -= bitsPerPixel;
+ bitPos += bitsPerPixel;
+ } else {
+ missingBits = (bitsPerPixel - bitsLeft);
+ n = (buffer >>> bitPos) & bitMask;//((buffer & bitMask) << missingBits) & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);
+ bitPos = missingBits;
+ }
+ //dest.push(n);
+ dest[o] = n < nmax ? offset + n * scale : maxValue;
+ }
+ dest.unshift(offset);
+ return dest;
+ },
+
+ originalUnstuff: function(src, dest, bitsPerPixel, numPixels) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o;
+ var bitsLeft = 0;
+ var n, buffer, missingBits;
+
+ // get rid of trailing bytes that are already part of next block
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
+
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;
+ bitsLeft -= bitsPerPixel;
+ }
+ else {
+ missingBits = (bitsPerPixel - bitsLeft);
+ n = ((buffer & bitMask) << missingBits) & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n += (buffer >>> bitsLeft);
+ }
+ dest[o] = n;
+ }
+ return dest;
+ },
+
+ originalUnstuff2: function(src, dest, bitsPerPixel, numPixels) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o;
+ var bitsLeft = 0, bitPos = 0;
+ var n, buffer, missingBits;
+ //micro-optimizations
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ bitPos = 0;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ //no unsigned left shift
+ n = ((buffer >>> bitPos) & bitMask);
+ bitsLeft -= bitsPerPixel;
+ bitPos += bitsPerPixel;
+ } else {
+ missingBits = (bitsPerPixel - bitsLeft);
+ n = (buffer >>> bitPos) & bitMask;//((buffer & bitMask) << missingBits) & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);
+ bitPos = missingBits;
+ }
+ dest[o] = n;
+ }
+ return dest;
+ }
+ };
+
+ /*****************************************
+ *private static class used by Lerc2Decode
+ ******************************************/
+ var Lerc2Helpers = {
+ HUFFMAN_LUT_BITS_MAX: 12, //use 2^12 lut, treat it like constant
+ computeChecksumFletcher32: function(input) {
+
+ var sum1 = 0xffff, sum2 = 0xffff;
+ var len = input.length;
+ var words = Math.floor(len / 2);
+ var i = 0;
+ while (words) {
+ var tlen = (words >= 359) ? 359 : words;
+ words -= tlen;
+ do {
+ sum1 += (input[i++] << 8);
+ sum2 += sum1 += input[i++];
+ } while (--tlen);
+
+ sum1 = (sum1 & 0xffff) + (sum1 >>> 16);
+ sum2 = (sum2 & 0xffff) + (sum2 >>> 16);
+ }
+
+ // add the straggler byte if it exists
+ if (len & 1) {
+ sum2 += sum1 += (input[i] << 8);
+ }
+ // second reduction step to reduce sums to 16 bits
+ sum1 = (sum1 & 0xffff) + (sum1 >>> 16);
+ sum2 = (sum2 & 0xffff) + (sum2 >>> 16);
+
+ return (sum2 << 16 | sum1) >>> 0;
+ },
+
+ readHeaderInfo: function(input, data) {
+ var ptr = data.ptr;
+ var fileIdView = new Uint8Array(input, ptr, 6);
+ var headerInfo = {};
+ headerInfo.fileIdentifierString = String.fromCharCode.apply(null, fileIdView);
+ if (headerInfo.fileIdentifierString.lastIndexOf("Lerc2", 0) !== 0) {
+ throw "Unexpected file identifier string (expect Lerc2 ): " + headerInfo.fileIdentifierString;
+ }
+ ptr += 6;
+ var view = new DataView(input, ptr, 8);
+ var fileVersion = view.getInt32(0, true);
+ headerInfo.fileVersion = fileVersion;
+ ptr += 4;
+ if (fileVersion >= 3) {
+ headerInfo.checksum = view.getUint32(4, true); //nrows
+ ptr += 4;
+ }
+
+ //keys start from here
+ view = new DataView(input, ptr, 12);
+ headerInfo.height = view.getUint32(0, true); //nrows
+ headerInfo.width = view.getUint32(4, true); //ncols
+ ptr += 8;
+ if (fileVersion >= 4) {
+ headerInfo.numDims = view.getUint32(8, true);
+ ptr += 4;
+ }
+ else {
+ headerInfo.numDims = 1;
+ }
+
+ view = new DataView(input, ptr, 40);
+ headerInfo.numValidPixel = view.getUint32(0, true);
+ headerInfo.microBlockSize = view.getInt32(4, true);
+ headerInfo.blobSize = view.getInt32(8, true);
+ headerInfo.imageType = view.getInt32(12, true);
+
+ headerInfo.maxZError = view.getFloat64(16, true);
+ headerInfo.zMin = view.getFloat64(24, true);
+ headerInfo.zMax = view.getFloat64(32, true);
+ ptr += 40;
+ data.headerInfo = headerInfo;
+ data.ptr = ptr;
+
+ var checksum, keyLength;
+ if (fileVersion >= 3) {
+ keyLength = fileVersion >= 4 ? 52 : 48;
+ checksum = this.computeChecksumFletcher32(new Uint8Array(input, ptr - keyLength, headerInfo.blobSize - 14));
+ if (checksum !== headerInfo.checksum) {
+ throw "Checksum failed.";
+ }
+ }
+ return true;
+ },
+
+ checkMinMaxRanges: function(input, data) {
+ var headerInfo = data.headerInfo;
+ var OutPixelTypeArray = this.getDataTypeArray(headerInfo.imageType);
+ var rangeBytes = headerInfo.numDims * this.getDataTypeSize(headerInfo.imageType);
+ var minValues = this.readSubArray(input, data.ptr, OutPixelTypeArray, rangeBytes);
+ var maxValues = this.readSubArray(input, data.ptr + rangeBytes, OutPixelTypeArray, rangeBytes);
+ data.ptr += (2 * rangeBytes);
+ var i, equal = true;
+ for (i = 0; i < headerInfo.numDims; i++) {
+ if (minValues[i] !== maxValues[i]) {
+ equal = false;
+ break;
+ }
+ }
+ headerInfo.minValues = minValues;
+ headerInfo.maxValues = maxValues;
+ return equal;
+ },
+
+ readSubArray: function(input, ptr, OutPixelTypeArray, numBytes) {
+ var rawData;
+ if (OutPixelTypeArray === Uint8Array) {
+ rawData = new Uint8Array(input, ptr, numBytes);
+ }
+ else {
+ var arrayBuf = new ArrayBuffer(numBytes);
+ var store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, ptr, numBytes));
+ rawData = new OutPixelTypeArray(arrayBuf);
+ }
+ return rawData;
+ },
+
+ readMask: function(input, data) {
+ var ptr = data.ptr;
+ var headerInfo = data.headerInfo;
+ var numPixels = headerInfo.width * headerInfo.height;
+ var numValidPixel = headerInfo.numValidPixel;
+
+ var view = new DataView(input, ptr, 4);
+ var mask = {};
+ mask.numBytes = view.getUint32(0, true);
+ ptr += 4;
+
+ // Mask Data
+ if ((0 === numValidPixel || numPixels === numValidPixel) && 0 !== mask.numBytes) {
+ throw ("invalid mask");
+ }
+ var bitset, resultMask;
+ if (numValidPixel === 0) {
+ bitset = new Uint8Array(Math.ceil(numPixels / 8));
+ mask.bitset = bitset;
+ resultMask = new Uint8Array(numPixels);
+ data.pixels.resultMask = resultMask;
+ ptr += mask.numBytes;
+ }// ????? else if (data.mask.numBytes > 0 && data.mask.numBytes< data.numValidPixel) {
+ else if (mask.numBytes > 0) {
+ bitset = new Uint8Array(Math.ceil(numPixels / 8));
+ view = new DataView(input, ptr, mask.numBytes);
+ var cnt = view.getInt16(0, true);
+ var ip = 2, op = 0, val = 0;
+ do {
+ if (cnt > 0) {
+ while (cnt--) { bitset[op++] = view.getUint8(ip++); }
+ } else {
+ val = view.getUint8(ip++);
+ cnt = -cnt;
+ while (cnt--) { bitset[op++] = val; }
+ }
+ cnt = view.getInt16(ip, true);
+ ip += 2;
+ } while (ip < mask.numBytes);
+ if ((cnt !== -32768) || (op < bitset.length)) {
+ throw "Unexpected end of mask RLE encoding";
+ }
+
+ resultMask = new Uint8Array(numPixels);
+ var mb = 0, k = 0;
+
+ for (k = 0; k < numPixels; k++) {
+ if (k & 7) {
+ mb = bitset[k >> 3];
+ mb <<= k & 7;
+ }
+ else {
+ mb = bitset[k >> 3];
+ }
+ if (mb & 128) {
+ resultMask[k] = 1;
+ }
+ }
+ data.pixels.resultMask = resultMask;
+
+ mask.bitset = bitset;
+ ptr += mask.numBytes;
+ }
+ data.ptr = ptr;
+ data.mask = mask;
+ return true;
+ },
+
+ readDataOneSweep: function(input, data, OutPixelTypeArray) {
+ var ptr = data.ptr;
+ var headerInfo = data.headerInfo;
+ var numDims = headerInfo.numDims;
+ var numPixels = headerInfo.width * headerInfo.height;
+ var imageType = headerInfo.imageType;
+ var numBytes = headerInfo.numValidPixel * Lerc2Helpers.getDataTypeSize(imageType) * numDims;
+ //data.pixels.numBytes = numBytes;
+ var rawData;
+ var mask = data.pixels.resultMask;
+ if (OutPixelTypeArray === Uint8Array) {
+ rawData = new Uint8Array(input, ptr, numBytes);
+ }
+ else {
+ var arrayBuf = new ArrayBuffer(numBytes);
+ var store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, ptr, numBytes));
+ rawData = new OutPixelTypeArray(arrayBuf);
+ }
+ if (rawData.length === numPixels * numDims) {
+ data.pixels.resultPixels = rawData;
+ }
+ else //mask
+ {
+ data.pixels.resultPixels = new OutPixelTypeArray(numPixels * numDims);
+ var z = 0, k = 0, i = 0, nStart = 0;
+ if (numDims > 1) {
+ for (i=0; i < numDims; i++) {
+ nStart = i * numPixels;
+ for (k = 0; k < numPixels; k++) {
+ if (mask[k]) {
+ data.pixels.resultPixels[nStart + k] = rawData[z++];
+ }
+ }
+ }
+ }
+ else {
+ for (k = 0; k < numPixels; k++) {
+ if (mask[k]) {
+ data.pixels.resultPixels[k] = rawData[z++];
+ }
+ }
+ }
+ }
+ ptr += numBytes;
+ data.ptr = ptr; //return data;
+ return true;
+ },
+
+ readHuffmanTree: function(input, data) {
+ var BITS_MAX = this.HUFFMAN_LUT_BITS_MAX; //8 is slow for the large test image
+ //var size_max = 1 << BITS_MAX;
+ /* ************************
+ * reading code table
+ *************************/
+ var view = new DataView(input, data.ptr, 16);
+ data.ptr += 16;
+ var version = view.getInt32(0, true);
+ if (version < 2) {
+ throw "unsupported Huffman version";
+ }
+ var size = view.getInt32(4, true);
+ var i0 = view.getInt32(8, true);
+ var i1 = view.getInt32(12, true);
+ if (i0 >= i1) {
+ return false;
+ }
+ var blockDataBuffer = new Uint32Array(i1 - i0);
+ Lerc2Helpers.decodeBits(input, data, blockDataBuffer);
+ var codeTable = []; //size
+ var i, j, k, len;
+
+ for (i = i0; i < i1; i++) {
+ j = i - (i < size ? 0 : size);//wrap around
+ codeTable[j] = { first: blockDataBuffer[i - i0], second: null };
+ }
+
+ var dataBytes = input.byteLength - data.ptr;
+ var dataWords = Math.ceil(dataBytes / 4);
+ var arrayBuf = new ArrayBuffer(dataWords * 4);
+ var store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
+ var stuffedData = new Uint32Array(arrayBuf); //must start from x*4
+ var bitPos = 0, word, srcPtr = 0;
+ word = stuffedData[0];
+ for (i = i0; i < i1; i++) {
+ j = i - (i < size ? 0 : size);//wrap around
+ len = codeTable[j].first;
+ if (len > 0) {
+ codeTable[j].second = (word << bitPos) >>> (32 - len);
+
+ if (32 - bitPos >= len) {
+ bitPos += len;
+ if (bitPos === 32) {
+ bitPos = 0;
+ srcPtr++;
+ word = stuffedData[srcPtr];
+ }
+ }
+ else {
+ bitPos += len - 32;
+ srcPtr++;
+ word = stuffedData[srcPtr];
+ codeTable[j].second |= word >>> (32 - bitPos);
+ }
+ }
+ }
+
+ //finished reading code table
+
+ /* ************************
+ * building lut
+ *************************/
+ var numBitsLUT = 0, numBitsLUTQick = 0;
+ var tree = new TreeNode();
+ for (i = 0; i < codeTable.length; i++) {
+ if (codeTable[i] !== undefined) {
+ numBitsLUT = Math.max(numBitsLUT, codeTable[i].first);
+ }
+ }
+ if (numBitsLUT >= BITS_MAX) {
+ numBitsLUTQick = BITS_MAX;
+ }
+ else {
+ numBitsLUTQick = numBitsLUT;
+ }
+ if (numBitsLUT >= 30) {
+ console.log("WARning, large NUM LUT BITS IS " + numBitsLUT);
+ }
+ var decodeLut = [], entry, code, numEntries, jj, currentBit, node;
+ for (i = i0; i < i1; i++) {
+ j = i - (i < size ? 0 : size);//wrap around
+ len = codeTable[j].first;
+ if (len > 0) {
+ entry = [len, j];
+ if (len <= numBitsLUTQick) {
+ code = codeTable[j].second << (numBitsLUTQick - len);
+ numEntries = 1 << (numBitsLUTQick - len);
+ for (k = 0; k < numEntries; k++) {
+ decodeLut[code | k] = entry;
+ }
+ }
+ else {
+ //build tree
+ code = codeTable[j].second;
+ node = tree;
+ for (jj = len - 1; jj >= 0; jj--) {
+ currentBit = code >>> jj & 1; //no left shift as length could be 30,31
+ if (currentBit) {
+ if (!node.right) {
+ node.right = new TreeNode();
+ }
+ node = node.right;
+ }
+ else {
+ if (!node.left) {
+ node.left = new TreeNode();
+ }
+ node = node.left;
+ }
+ if (jj === 0 && !node.val) {
+ node.val = entry[1];
+ }
+ }
+ }
+ }
+ }
+ return {
+ decodeLut: decodeLut,
+ numBitsLUTQick: numBitsLUTQick,
+ numBitsLUT: numBitsLUT,
+ tree: tree,
+ stuffedData: stuffedData,
+ srcPtr: srcPtr,
+ bitPos: bitPos
+ };
+ },
+
+ readHuffman: function(input, data, OutPixelTypeArray) {
+ var headerInfo = data.headerInfo;
+ var numDims = headerInfo.numDims;
+ var height = data.headerInfo.height;
+ var width = data.headerInfo.width;
+ var numPixels = width * height;
+ //var size_max = 1 << BITS_MAX;
+ /* ************************
+ * reading huffman structure info
+ *************************/
+ var huffmanInfo = this.readHuffmanTree(input, data);
+ var decodeLut = huffmanInfo.decodeLut;
+ var tree = huffmanInfo.tree;
+ //stuffedData includes huffman headers
+ var stuffedData = huffmanInfo.stuffedData;
+ var srcPtr = huffmanInfo.srcPtr;
+ var bitPos = huffmanInfo.bitPos;
+ var numBitsLUTQick = huffmanInfo.numBitsLUTQick;
+ var numBitsLUT = huffmanInfo.numBitsLUT;
+ var offset = data.headerInfo.imageType === 0 ? 128 : 0;
+ /*************************
+ * decode
+ ***************************/
+ var node, val, delta, mask = data.pixels.resultMask, valTmp, valTmpQuick, currentBit;
+ var i, j, k, ii;
+ var prevVal = 0;
+ if (bitPos > 0) {
+ srcPtr++;
+ bitPos = 0;
+ }
+ var word = stuffedData[srcPtr];
+ var deltaEncode = data.encodeMode === 1;
+ var resultPixelsAllDim = new OutPixelTypeArray(numPixels * numDims);
+ var resultPixels = resultPixelsAllDim;
+ var iDim;
+ for (iDim = 0; iDim < headerInfo.numDims; iDim++) {
+ if (numDims > 1) {
+ //get the mem block of current dimension
+ resultPixels = new OutPixelTypeArray(resultPixelsAllDim.buffer, numPixels * iDim, numPixels);
+ prevVal = 0;
+ }
+ if (data.headerInfo.numValidPixel === width * height) { //all valid
+ for (k = 0, i = 0; i < height; i++) {
+ for (j = 0; j < width; j++, k++) {
+ val = 0;
+ valTmp = (word << bitPos) >>> (32 - numBitsLUTQick);
+ valTmpQuick = valTmp;// >>> deltaBits;
+ if (32 - bitPos < numBitsLUTQick) {
+ valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUTQick));
+ valTmpQuick = valTmp;// >>> deltaBits;
+ }
+ if (decodeLut[valTmpQuick]) // if there, move the correct number of bits and done
+ {
+ val = decodeLut[valTmpQuick][1];
+ bitPos += decodeLut[valTmpQuick][0];
+ }
+ else {
+ valTmp = (word << bitPos) >>> (32 - numBitsLUT);
+ valTmpQuick = valTmp;// >>> deltaBits;
+ if (32 - bitPos < numBitsLUT) {
+ valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUT));
+ valTmpQuick = valTmp;// >>> deltaBits;
+ }
+ node = tree;
+ for (ii = 0; ii < numBitsLUT; ii++) {
+ currentBit = valTmp >>> (numBitsLUT - ii - 1) & 1;
+ node = currentBit ? node.right : node.left;
+ if (!(node.left || node.right)) {
+ val = node.val;
+ bitPos = bitPos + ii + 1;
+ break;
+ }
+ }
+ }
+
+ if (bitPos >= 32) {
+ bitPos -= 32;
+ srcPtr++;
+ word = stuffedData[srcPtr];
+ }
+
+ delta = val - offset;
+ if (deltaEncode) {
+ if (j > 0) {
+ delta += prevVal; // use overflow
+ }
+ else if (i > 0) {
+ delta += resultPixels[k - width];
+ }
+ else {
+ delta += prevVal;
+ }
+ delta &= 0xFF; //overflow
+ resultPixels[k] = delta;//overflow
+ prevVal = delta;
+ }
+ else {
+ resultPixels[k] = delta;
+ }
+ }
+ }
+ }
+ else { //not all valid, use mask
+ for (k = 0, i = 0; i < height; i++) {
+ for (j = 0; j < width; j++, k++) {
+ if (mask[k]) {
+ val = 0;
+ valTmp = (word << bitPos) >>> (32 - numBitsLUTQick);
+ valTmpQuick = valTmp;// >>> deltaBits;
+ if (32 - bitPos < numBitsLUTQick) {
+ valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUTQick));
+ valTmpQuick = valTmp;// >>> deltaBits;
+ }
+ if (decodeLut[valTmpQuick]) // if there, move the correct number of bits and done
+ {
+ val = decodeLut[valTmpQuick][1];
+ bitPos += decodeLut[valTmpQuick][0];
+ }
+ else {
+ valTmp = (word << bitPos) >>> (32 - numBitsLUT);
+ valTmpQuick = valTmp;// >>> deltaBits;
+ if (32 - bitPos < numBitsLUT) {
+ valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUT));
+ valTmpQuick = valTmp;// >>> deltaBits;
+ }
+ node = tree;
+ for (ii = 0; ii < numBitsLUT; ii++) {
+ currentBit = valTmp >>> (numBitsLUT - ii - 1) & 1;
+ node = currentBit ? node.right : node.left;
+ if (!(node.left || node.right)) {
+ val = node.val;
+ bitPos = bitPos + ii + 1;
+ break;
+ }
+ }
+ }
+
+ if (bitPos >= 32) {
+ bitPos -= 32;
+ srcPtr++;
+ word = stuffedData[srcPtr];
+ }
+
+ delta = val - offset;
+ if (deltaEncode) {
+ if (j > 0 && mask[k - 1]) {
+ delta += prevVal; // use overflow
+ }
+ else if (i > 0 && mask[k - width]) {
+ delta += resultPixels[k - width];
+ }
+ else {
+ delta += prevVal;
+ }
+
+ delta &= 0xFF; //overflow
+ resultPixels[k] = delta;//overflow
+ prevVal = delta;
+ }
+ else {
+ resultPixels[k] = delta;
+ }
+ }
+ }
+ }
+ }
+ data.ptr = data.ptr + (srcPtr + 1) * 4 + (bitPos > 0 ? 4 : 0);
+ }
+ data.pixels.resultPixels = resultPixelsAllDim;
+ },
+
+ decodeBits: function(input, data, blockDataBuffer, offset, iDim) {
+ {
+ //bitstuff encoding is 3
+ var headerInfo = data.headerInfo;
+ var fileVersion = headerInfo.fileVersion;
+ //var block = {};
+ var blockPtr = 0;
+ var view = new DataView(input, data.ptr, 5);//to do
+ var headerByte = view.getUint8(0);
+ blockPtr++;
+ var bits67 = headerByte >> 6;
+ var n = (bits67 === 0) ? 4 : 3 - bits67;
+ var doLut = (headerByte & 32) > 0 ? true : false;//5th bit
+ var numBits = headerByte & 31;
+ var numElements = 0;
+ if (n === 1) {
+ numElements = view.getUint8(blockPtr); blockPtr++;
+ } else if (n === 2) {
+ numElements = view.getUint16(blockPtr, true); blockPtr += 2;
+ } else if (n === 4) {
+ numElements = view.getUint32(blockPtr, true); blockPtr += 4;
+ } else {
+ throw "Invalid valid pixel count type";
+ }
+ //fix: huffman codes are bit stuffed, but not bound by data's max value, so need to use originalUnstuff
+ //offset = offset || 0;
+ var scale = 2 * headerInfo.maxZError;
+ var stuffedData, arrayBuf, store8, dataBytes, dataWords;
+ var lutArr, lutData, lutBytes, bitsPerPixel;
+ var zMax = headerInfo.numDims > 1 ? headerInfo.maxValues[iDim] : headerInfo.zMax;
+ if (doLut) {
+ data.counter.lut++;
+ lutBytes = view.getUint8(blockPtr);
+ blockPtr++;
+ dataBytes = Math.ceil((lutBytes - 1) * numBits / 8);
+ dataWords = Math.ceil(dataBytes / 4);
+ arrayBuf = new ArrayBuffer(dataWords * 4);
+ store8 = new Uint8Array(arrayBuf);
+
+ data.ptr += blockPtr;
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
+
+ lutData = new Uint32Array(arrayBuf);
+ data.ptr += dataBytes;
+
+ bitsPerPixel = 0;
+ while ((lutBytes - 1) >>> bitsPerPixel) {
+ bitsPerPixel++;
+ }
+ dataBytes = Math.ceil(numElements * bitsPerPixel / 8);
+ dataWords = Math.ceil(dataBytes / 4);
+ arrayBuf = new ArrayBuffer(dataWords * 4);
+ store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
+ stuffedData = new Uint32Array(arrayBuf);
+ data.ptr += dataBytes;
+ if (fileVersion >= 3) {
+ lutArr = BitStuffer.unstuffLUT2(lutData, numBits, lutBytes - 1, offset, scale, zMax);
+ }
+ else {
+ lutArr = BitStuffer.unstuffLUT(lutData, numBits, lutBytes - 1, offset, scale, zMax);
+ }
+ //lutArr.unshift(0);
+ if (fileVersion >= 3) {
+ //BitStuffer.unstuff2(block, blockDataBuffer, headerInfo.zMax);
+ BitStuffer.unstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements, lutArr);
+ }
+ else {
+ BitStuffer.unstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements, lutArr);
+ }
+ }
+ else {
+ //console.debug("bitstuffer");
+ data.counter.bitstuffer++;
+ bitsPerPixel = numBits;
+ data.ptr += blockPtr;
+ if (bitsPerPixel > 0) {
+ dataBytes = Math.ceil(numElements * bitsPerPixel / 8);
+ dataWords = Math.ceil(dataBytes / 4);
+ arrayBuf = new ArrayBuffer(dataWords * 4);
+ store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
+ stuffedData = new Uint32Array(arrayBuf);
+ data.ptr += dataBytes;
+ if (fileVersion >= 3) {
+ if (offset == null) {
+ BitStuffer.originalUnstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements);
+ }
+ else {
+ BitStuffer.unstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements, false, offset, scale, zMax);
+ }
+ }
+ else {
+ if (offset == null) {
+ BitStuffer.originalUnstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements);
+ }
+ else {
+ BitStuffer.unstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements, false, offset, scale, zMax);
+ }
+ }
+ }
+ }
+ }
+
+ },
+
+ readTiles: function(input, data, OutPixelTypeArray) {
+ var headerInfo = data.headerInfo;
+ var width = headerInfo.width;
+ var height = headerInfo.height;
+ var microBlockSize = headerInfo.microBlockSize;
+ var imageType = headerInfo.imageType;
+ var dataTypeSize = Lerc2Helpers.getDataTypeSize(imageType);
+ var numBlocksX = Math.ceil(width / microBlockSize);
+ var numBlocksY = Math.ceil(height / microBlockSize);
+ data.pixels.numBlocksY = numBlocksY;
+ data.pixels.numBlocksX = numBlocksX;
+ data.pixels.ptr = 0;
+ var row = 0, col = 0, blockY = 0, blockX = 0, thisBlockHeight = 0, thisBlockWidth = 0, bytesLeft = 0, headerByte = 0, bits67 = 0, testCode = 0, outPtr = 0, outStride = 0, numBytes = 0, bytesleft = 0, z = 0, blockPtr = 0;
+ var view, block, arrayBuf, store8, rawData;
+ var blockEncoding;
+ var blockDataBuffer = new OutPixelTypeArray(microBlockSize * microBlockSize);
+ var lastBlockHeight = (height % microBlockSize) || microBlockSize;
+ var lastBlockWidth = (width % microBlockSize) || microBlockSize;
+ var offsetType, offset;
+ var numDims = headerInfo.numDims, iDim;
+ var mask = data.pixels.resultMask;
+ var resultPixels = data.pixels.resultPixels;
+ for (blockY = 0; blockY < numBlocksY; blockY++) {
+ thisBlockHeight = (blockY !== numBlocksY - 1) ? microBlockSize : lastBlockHeight;
+ for (blockX = 0; blockX < numBlocksX; blockX++) {
+ //console.debug("y" + blockY + " x" + blockX);
+ thisBlockWidth = (blockX !== numBlocksX - 1) ? microBlockSize : lastBlockWidth;
+
+ outPtr = blockY * width * microBlockSize + blockX * microBlockSize;
+ outStride = width - thisBlockWidth;
+
+
+ for (iDim = 0; iDim < numDims; iDim++) {
+ if (numDims > 1) {
+ resultPixels = new OutPixelTypeArray(data.pixels.resultPixels.buffer, width * height * iDim * dataTypeSize, width * height);
+ }
+ bytesLeft = input.byteLength - data.ptr;
+ view = new DataView(input, data.ptr, Math.min(10, bytesLeft));
+ block = {};
+ blockPtr = 0;
+ headerByte = view.getUint8(0);
+ blockPtr++;
+ bits67 = (headerByte >> 6) & 0xFF;
+ testCode = (headerByte >> 2) & 15; // use bits 2345 for integrity check
+ if (testCode !== (((blockX * microBlockSize) >> 3) & 15)) {
+ throw "integrity issue";
+ //return false;
+ }
+
+ blockEncoding = headerByte & 3;
+ if (blockEncoding > 3) {
+ data.ptr += blockPtr;
+ throw "Invalid block encoding (" + blockEncoding + ")";
+ }
+ else if (blockEncoding === 2) { //constant 0
+ data.counter.constant++;
+ data.ptr += blockPtr;
+ continue;
+ }
+ else if (blockEncoding === 0) { //uncompressed
+ data.counter.uncompressed++;
+ data.ptr += blockPtr;
+ numBytes = thisBlockHeight * thisBlockWidth * dataTypeSize;
+ bytesleft = input.byteLength - data.ptr;
+ numBytes = numBytes < bytesleft ? numBytes : bytesleft;
+ //bit alignment
+ arrayBuf = new ArrayBuffer((numBytes % dataTypeSize) === 0 ? numBytes : (numBytes + dataTypeSize - numBytes % dataTypeSize));
+ store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, data.ptr, numBytes));
+ rawData = new OutPixelTypeArray(arrayBuf);
+ z = 0;
+ if (mask) {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ if (mask[outPtr]) {
+ resultPixels[outPtr] = rawData[z++];
+ }
+ outPtr++;
+ }
+ outPtr += outStride;
+ }
+ }
+ else {//all valid
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ resultPixels[outPtr++] = rawData[z++];
+ }
+ outPtr += outStride;
+ }
+ }
+ data.ptr += z * dataTypeSize;
+ }
+ else { //1 or 3
+ offsetType = Lerc2Helpers.getDataTypeUsed(imageType, bits67);
+ offset = Lerc2Helpers.getOnePixel(block, blockPtr, offsetType, view);
+ blockPtr += Lerc2Helpers.getDataTypeSize(offsetType);
+ if (blockEncoding === 3) //constant offset value
+ {
+ data.ptr += blockPtr;
+ data.counter.constantoffset++;
+ //you can delete the following resultMask case in favor of performance because val is constant and users use nodata mask, otherwise nodatavalue post processing handles it too.
+ //while the above statement is true, we're not doing it as we want to keep invalid pixel value at 0 rather than arbitrary values
+ if (mask) {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ if (mask[outPtr]) {
+ resultPixels[outPtr] = offset;
+ }
+ outPtr++;
+ }
+ outPtr += outStride;
+ }
+ }
+ else {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ resultPixels[outPtr++] = offset;
+ }
+ outPtr += outStride;
+ }
+ }
+ }
+ else { //bitstuff encoding is 3
+ data.ptr += blockPtr;
+ //heavy lifting
+ Lerc2Helpers.decodeBits(input, data, blockDataBuffer, offset, iDim);
+ blockPtr = 0;
+ if (mask) {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ if (mask[outPtr]) {
+ resultPixels[outPtr] = blockDataBuffer[blockPtr++];
+ }
+ outPtr++;
+ }
+ outPtr += outStride;
+ }
+ }
+ else {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ resultPixels[outPtr++] = blockDataBuffer[blockPtr++];
+ }
+ outPtr += outStride;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+
+ /*****************
+ * private methods (helper methods)
+ *****************/
+
+ formatFileInfo: function(data) {
+ return {
+ "fileIdentifierString": data.headerInfo.fileIdentifierString,
+ "fileVersion": data.headerInfo.fileVersion,
+ "imageType": data.headerInfo.imageType,
+ "height": data.headerInfo.height,
+ "width": data.headerInfo.width,
+ "numValidPixel": data.headerInfo.numValidPixel,
+ "microBlockSize": data.headerInfo.microBlockSize,
+ "blobSize": data.headerInfo.blobSize,
+ "maxZError": data.headerInfo.maxZError,
+ "pixelType": Lerc2Helpers.getPixelType(data.headerInfo.imageType),
+ "eofOffset": data.eofOffset,
+ "mask": data.mask ? {
+ "numBytes": data.mask.numBytes
+ } : null,
+ "pixels": {
+ "numBlocksX": data.pixels.numBlocksX,
+ "numBlocksY": data.pixels.numBlocksY,
+ //"numBytes": data.pixels.numBytes,
+ "maxValue": data.headerInfo.zMax,
+ "minValue": data.headerInfo.zMin,
+ "noDataValue": data.noDataValue
+ }
+ };
+ },
+
+ constructConstantSurface: function(data) {
+ var val = data.headerInfo.zMax;
+ var numDims = data.headerInfo.numDims;
+ var numPixels = data.headerInfo.height * data.headerInfo.width;
+ var numPixelAllDims = numPixels * numDims;
+ var i=0, k = 0, nStart=0;
+ var mask = data.pixels.resultMask;
+ if (mask) {
+ if (numDims > 1) {
+ for (i=0; i < numDims; i++) {
+ nStart = i * numPixels;
+ for (k = 0; k < numPixels; k++) {
+ if (mask[k]) {
+ data.pixels.resultPixels[nStart + k] = val;
+ }
+ }
+ }
+ }
+ else {
+ for (k = 0; k < numPixels; k++) {
+ if (mask[k]) {
+ data.pixels.resultPixels[k] = val;
+ }
+ }
+ }
+ }
+ else {
+ if (data.pixels.resultPixels.fill) {
+ data.pixels.resultPixels.fill(val);
+ }
+ else {
+ for (k = 0; k < numPixelAllDims; k++) {
+ data.pixels.resultPixels[k] = val;
+ }
+ }
+ }
+ return;
+ },
+
+ getDataTypeArray: function(t) {
+ var tp;
+ switch (t) {
+ case 0: //char
+ tp = Int8Array;
+ break;
+ case 1: //byte
+ tp = Uint8Array;
+ break;
+ case 2: //short
+ tp = Int16Array;
+ break;
+ case 3: //ushort
+ tp = Uint16Array;
+ break;
+ case 4:
+ tp = Int32Array;
+ break;
+ case 5:
+ tp = Uint32Array;
+ break;
+ case 6:
+ tp = Float32Array;
+ break;
+ case 7:
+ tp = Float64Array;
+ break;
+ default:
+ tp = Float32Array;
+ }
+ return tp;
+ },
+
+ getPixelType: function(t) {
+ var tp;
+ switch (t) {
+ case 0: //char
+ tp = "S8";
+ break;
+ case 1: //byte
+ tp = "U8";
+ break;
+ case 2: //short
+ tp = "S16";
+ break;
+ case 3: //ushort
+ tp = "U16";
+ break;
+ case 4:
+ tp = "S32";
+ break;
+ case 5:
+ tp = "U32";
+ break;
+ case 6:
+ tp = "F32";
+ break;
+ case 7:
+ tp = "F64"; //not supported
+ break;
+ default:
+ tp = "F32";
+ }
+ return tp;
+ },
+
+ isValidPixelValue: function(t, val) {
+ if (val == null) {
+ return false;
+ }
+ var isValid;
+ switch (t) {
+ case 0: //char
+ isValid = val >= -128 && val <= 127;
+ break;
+ case 1: //byte (unsigned char)
+ isValid = val >= 0 && val <= 255;
+ break;
+ case 2: //short
+ isValid = val >= -32768 && val <= 32767;
+ break;
+ case 3: //ushort
+ isValid = val >= 0 && val <= 65536;
+ break;
+ case 4: //int 32
+ isValid = val >= -2147483648 && val <= 2147483647;
+ break;
+ case 5: //uinit 32
+ isValid = val >= 0 && val <= 4294967296;
+ break;
+ case 6:
+ isValid = val >= -3.4027999387901484e+38 && val <= 3.4027999387901484e+38;
+ break;
+ case 7:
+ isValid = val >= 5e-324 && val <= 1.7976931348623157e+308;
+ break;
+ default:
+ isValid = false;
+ }
+ return isValid;
+ },
+
+ getDataTypeSize: function(t) {
+ var s = 0;
+ switch (t) {
+ case 0: //ubyte
+ case 1: //byte
+ s = 1;
+ break;
+ case 2: //short
+ case 3: //ushort
+ s = 2;
+ break;
+ case 4:
+ case 5:
+ case 6:
+ s = 4;
+ break;
+ case 7:
+ s = 8;
+ break;
+ default:
+ s = t;
+ }
+ return s;
+ },
+
+ getDataTypeUsed: function(dt, tc) {
+ var t = dt;
+ switch (dt) {
+ case 2: //short
+ case 4: //long
+ t = dt - tc;
+ break;
+ case 3: //ushort
+ case 5: //ulong
+ t = dt - 2 * tc;
+ break;
+ case 6: //float
+ if (0 === tc) {
+ t = dt;
+ }
+ else if (1 === tc) {
+ t = 2;
+ }
+ else {
+ t = 1;//byte
+ }
+ break;
+ case 7: //double
+ if (0 === tc) {
+ t = dt;
+ }
+ else {
+ t = dt - 2 * tc + 1;
+ }
+ break;
+ default:
+ t = dt;
+ break;
+ }
+ return t;
+ },
+
+ getOnePixel: function(block, blockPtr, offsetType, view) {
+ var temp = 0;
+ switch (offsetType) {
+ case 0: //char
+ temp = view.getInt8(blockPtr);
+ break;
+ case 1: //byte
+ temp = view.getUint8(blockPtr);
+ break;
+ case 2:
+ temp = view.getInt16(blockPtr, true);
+ break;
+ case 3:
+ temp = view.getUint16(blockPtr, true);
+ break;
+ case 4:
+ temp = view.getInt32(blockPtr, true);
+ break;
+ case 5:
+ temp = view.getUInt32(blockPtr, true);
+ break;
+ case 6:
+ temp = view.getFloat32(blockPtr, true);
+ break;
+ case 7:
+ //temp = view.getFloat64(blockPtr, true);
+ //blockPtr += 8;
+ //lerc2 encoding doesnt handle float 64, force to float32???
+ temp = view.getFloat64(blockPtr, true);
+ break;
+ default:
+ throw ("the decoder does not understand this pixel type");
+ }
+ return temp;
+ }
+ };
+
+ /***************************************************
+ *private class for a tree node. Huffman code is in Lerc2Helpers
+ ****************************************************/
+ var TreeNode = function(val, left, right) {
+ this.val = val;
+ this.left = left;
+ this.right = right;
+ };
+
+ var Lerc2Decode = {
+ /*
+ * ********removed options compared to LERC1. We can bring some of them back if needed.
+ * removed pixel type. LERC2 is typed and doesn't require user to give pixel type
+ * changed encodedMaskData to maskData. LERC2 's js version make it faster to use maskData directly.
+ * removed returnMask. mask is used by LERC2 internally and is cost free. In case of user input mask, it's returned as well and has neglible cost.
+ * removed nodatavalue. Because LERC2 pixels are typed, nodatavalue will sacrify a useful value for many types (8bit, 16bit) etc,
+ * user has to be knowledgable enough about raster and their data to avoid usability issues. so nodata value is simply removed now.
+ * We can add it back later if their's a clear requirement.
+ * removed encodedMask. This option was not implemented in LercDecode. It can be done after decoding (less efficient)
+ * removed computeUsedBitDepths.
+ *
+ *
+ * response changes compared to LERC1
+ * 1. encodedMaskData is not available
+ * 2. noDataValue is optional (returns only if user's noDataValue is with in the valid data type range)
+ * 3. maskData is always available
+ */
+ /*****************
+ * public properties
+ ******************/
+ //HUFFMAN_LUT_BITS_MAX: 12, //use 2^12 lut, not configurable
+
+ /*****************
+ * public methods
+ *****************/
+
+ /**
+ * Decode a LERC2 byte stream and return an object containing the pixel data and optional metadata.
+ *
+ * @param {ArrayBuffer} input The LERC input byte stream
+ * @param {object} [options] options Decoding options
+ * @param {number} [options.inputOffset] The number of bytes to skip in the input byte stream. A valid LERC file is expected at that position
+ * @param {boolean} [options.returnFileInfo] If true, the return value will have a fileInfo property that contains metadata obtained from the LERC headers and the decoding process
+ */
+ decode: function(/*byte array*/ input, /*object*/ options) {
+ //currently there's a bug in the sparse array, so please do not set to false
+ options = options || {};
+ var noDataValue = options.noDataValue;
+
+ //initialize
+ var i = 0, data = {};
+ data.ptr = options.inputOffset || 0;
+ data.pixels = {};
+
+ // File header
+ if (!Lerc2Helpers.readHeaderInfo(input, data)) ;
+ var headerInfo = data.headerInfo;
+ var fileVersion = headerInfo.fileVersion;
+ var OutPixelTypeArray = Lerc2Helpers.getDataTypeArray(headerInfo.imageType);
+
+ // Mask Header
+ Lerc2Helpers.readMask(input, data);
+ if (headerInfo.numValidPixel !== headerInfo.width * headerInfo.height && !data.pixels.resultMask) {
+ data.pixels.resultMask = options.maskData;
+ }
+
+ var numPixels = headerInfo.width * headerInfo.height;
+ data.pixels.resultPixels = new OutPixelTypeArray(numPixels * headerInfo.numDims);
+
+ data.counter = {
+ onesweep: 0,
+ uncompressed: 0,
+ lut: 0,
+ bitstuffer: 0,
+ constant: 0,
+ constantoffset: 0
+ };
+ if (headerInfo.numValidPixel !== 0) {
+ //not tested
+ if (headerInfo.zMax === headerInfo.zMin) //constant surface
+ {
+ Lerc2Helpers.constructConstantSurface(data);
+ }
+ else if (fileVersion >= 4 && Lerc2Helpers.checkMinMaxRanges(input, data)) {
+ Lerc2Helpers.constructConstantSurface(data);
+ }
+ else {
+ var view = new DataView(input, data.ptr, 2);
+ var bReadDataOneSweep = view.getUint8(0);
+ data.ptr++;
+ if (bReadDataOneSweep) {
+ //console.debug("OneSweep");
+ Lerc2Helpers.readDataOneSweep(input, data, OutPixelTypeArray);
+ }
+ else {
+ //lerc2.1: //bitstuffing + lut
+ //lerc2.2: //bitstuffing + lut + huffman
+ //lerc2.3: new bitstuffer
+ if (fileVersion > 1 && headerInfo.imageType <= 1 && Math.abs(headerInfo.maxZError - 0.5) < 0.00001) {
+ //this is 2.x plus 8 bit (unsigned and signed) data, possiblity of Huffman
+ var flagHuffman = view.getUint8(1);
+ data.ptr++;
+ data.encodeMode = flagHuffman;
+ if (flagHuffman > 2 || (fileVersion < 4 && flagHuffman > 1)) {
+ throw "Invalid Huffman flag " + flagHuffman;
+ }
+ if (flagHuffman) {//1 - delta Huffman, 2 - Huffman
+ //console.log("Huffman");
+ Lerc2Helpers.readHuffman(input, data, OutPixelTypeArray);
+ }
+ else {
+ //console.log("Tiles");
+ Lerc2Helpers.readTiles(input, data, OutPixelTypeArray);
+ }
+ }
+ else { //lerc2.x non-8 bit data
+ //console.log("Tiles");
+ Lerc2Helpers.readTiles(input, data, OutPixelTypeArray);
+ }
+ }
+ }
+ }
+
+ data.eofOffset = data.ptr;
+ var diff;
+ if (options.inputOffset) {
+ diff = data.headerInfo.blobSize + options.inputOffset - data.ptr;
+ if (Math.abs(diff) >= 1) {
+ //console.debug("incorrect eof: dataptr " + data.ptr + " offset " + options.inputOffset + " blobsize " + data.headerInfo.blobSize + " diff: " + diff);
+ data.eofOffset = options.inputOffset + data.headerInfo.blobSize;
+ }
+ }
+ else {
+ diff = data.headerInfo.blobSize - data.ptr;
+ if (Math.abs(diff) >= 1) {
+ //console.debug("incorrect first band eof: dataptr " + data.ptr + " blobsize " + data.headerInfo.blobSize + " diff: " + diff);
+ data.eofOffset = data.headerInfo.blobSize;
+ }
+ }
+
+ var result = {
+ width: headerInfo.width,
+ height: headerInfo.height,
+ pixelData: data.pixels.resultPixels,
+ minValue: headerInfo.zMin,
+ maxValue: headerInfo.zMax,
+ validPixelCount: headerInfo.numValidPixel,
+ dimCount: headerInfo.numDims,
+ dimStats: {
+ minValues: headerInfo.minValues,
+ maxValues: headerInfo.maxValues
+ },
+ maskData: data.pixels.resultMask
+ //noDataValue: noDataValue
+ };
+
+ //we should remove this if there's no existing client
+ //optional noDataValue processing, it's user's responsiblity
+ if (data.pixels.resultMask && Lerc2Helpers.isValidPixelValue(headerInfo.imageType, noDataValue)) {
+ var mask = data.pixels.resultMask;
+ for (i = 0; i < numPixels; i++) {
+ if (!mask[i]) {
+ result.pixelData[i] = noDataValue;
+ }
+ }
+ result.noDataValue = noDataValue;
+ }
+ data.noDataValue = noDataValue;
+ if (options.returnFileInfo) {
+ result.fileInfo = Lerc2Helpers.formatFileInfo(data);
+ }
+ return result;
+ },
+
+ getBandCount: function(/*byte array*/ input) {
+ var count = 0;
+ var i = 0;
+ var temp = {};
+ temp.ptr = 0;
+ temp.pixels = {};
+ while (i < input.byteLength - 58) {
+ Lerc2Helpers.readHeaderInfo(input, temp);
+ i += temp.headerInfo.blobSize;
+ count++;
+ temp.ptr = i;
+ }
+ return count;
+ }
+ };
+
+ return Lerc2Decode;
+ })();
+
+ var isPlatformLittleEndian = (function() {
+ var a = new ArrayBuffer(4);
+ var b = new Uint8Array(a);
+ var c = new Uint32Array(a);
+ c[0] = 1;
+ return b[0] === 1;
+ })();
+
+ var Lerc = {
+ /************wrapper**********************************************/
+ /**
+ * A wrapper for decoding both LERC1 and LERC2 byte streams capable of handling multiband pixel blocks for various pixel types.
+ *
+ * @alias module:Lerc
+ * @param {ArrayBuffer} input The LERC input byte stream
+ * @param {object} [options] The decoding options below are optional.
+ * @param {number} [options.inputOffset] The number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position.
+ * @param {string} [options.pixelType] (LERC1 only) Default value is F32. Valid pixel types for input are U8/S8/S16/U16/S32/U32/F32.
+ * @param {number} [options.noDataValue] (LERC1 only). It is recommended to use the returned mask instead of setting this value.
+ * @returns {{width, height, pixels, pixelType, mask, statistics}}
+ * @property {number} width Width of decoded image.
+ * @property {number} height Height of decoded image.
+ * @property {array} pixels [band1, band2, …] Each band is a typed array of width*height.
+ * @property {string} pixelType The type of pixels represented in the output.
+ * @property {mask} mask Typed array with a size of width*height, or null if all pixels are valid.
+ * @property {array} statistics [statistics_band1, statistics_band2, …] Each element is a statistics object representing min and max values
+ **/
+ decode: function(encodedData, options) {
+ if (!isPlatformLittleEndian) {
+ throw "Big endian system is not supported.";
+ }
+ options = options || {};
+ var inputOffset = options.inputOffset || 0;
+ var fileIdView = new Uint8Array(encodedData, inputOffset, 10);
+ var fileIdentifierString = String.fromCharCode.apply(null, fileIdView);
+ var lerc, majorVersion;
+ if (fileIdentifierString.trim() === "CntZImage") {
+ lerc = LercDecode;
+ majorVersion = 1;
+ }
+ else if (fileIdentifierString.substring(0, 5) === "Lerc2") {
+ lerc = Lerc2Decode;
+ majorVersion = 2;
+ }
+ else {
+ throw "Unexpected file identifier string: " + fileIdentifierString;
+ }
+
+ var iPlane = 0, eof = encodedData.byteLength - 10, encodedMaskData, bandMasks = [], bandMask, maskData;
+ var decodedPixelBlock = {
+ width: 0,
+ height: 0,
+ pixels: [],
+ pixelType: options.pixelType,
+ mask: null,
+ statistics: []
+ };
+
+ while (inputOffset < eof) {
+ var result = lerc.decode(encodedData, {
+ inputOffset: inputOffset,//for both lerc1 and lerc2
+ encodedMaskData: encodedMaskData,//lerc1 only
+ maskData: maskData,//lerc2 only
+ returnMask: iPlane === 0 ? true : false,//lerc1 only
+ returnEncodedMask: iPlane === 0 ? true : false,//lerc1 only
+ returnFileInfo: true,//for both lerc1 and lerc2
+ pixelType: options.pixelType || null,//lerc1 only
+ noDataValue: options.noDataValue || null//lerc1 only
+ });
+
+ inputOffset = result.fileInfo.eofOffset;
+ if (iPlane === 0) {
+ encodedMaskData = result.encodedMaskData;//lerc1
+ maskData = result.maskData;//lerc2
+ decodedPixelBlock.width = result.width;
+ decodedPixelBlock.height = result.height;
+ decodedPixelBlock.dimCount = result.dimCount || 1;
+ //decodedPixelBlock.dimStats = decodedPixelBlock.dimStats;
+ decodedPixelBlock.pixelType = result.pixelType || result.fileInfo.pixelType;
+ decodedPixelBlock.mask = result.maskData;
+ }
+ if (majorVersion >1 && result.fileInfo.mask && result.fileInfo.mask.numBytes > 0) {
+ bandMasks.push(result.maskData);
+ }
+
+ iPlane++;
+ decodedPixelBlock.pixels.push(result.pixelData);
+ decodedPixelBlock.statistics.push({
+ minValue: result.minValue,
+ maxValue: result.maxValue,
+ noDataValue: result.noDataValue,
+ dimStats: result.dimStats
+ });
+ }
+ var i, j, numPixels;
+ if (majorVersion > 1 && bandMasks.length > 1) {
+ numPixels = decodedPixelBlock.width * decodedPixelBlock.height;
+ decodedPixelBlock.bandMasks = bandMasks;
+ maskData = new Uint8Array(numPixels);
+ maskData.set(bandMasks[0]);
+ for (i = 1; i < bandMasks.length; i++) {
+ bandMask = bandMasks[i];
+ for (j = 0; j < numPixels; j++) {
+ maskData[j] = maskData[j] & bandMask[j];
+ }
+ }
+ decodedPixelBlock.maskData = maskData;
+ }
+
+ return decodedPixelBlock;
+ }
+ };
+
+ if (module.exports) {/* jshint ignore:line */
+ //commonJS module 1.0/1.1/1.1.1 systems, such as nodeJS
+ //http://wiki.commonjs.org/wiki/Modules
+ module.exports = Lerc;/* jshint ignore:line */
+ }
+ else {
+ //assign to this, most likely window
+ this.Lerc = Lerc;
+ }
+
+ })();
+ } (LercDecode));
+
+ var Lerc = LercDecode.exports;
+
+ function createVerticesFromHeightmap(parameters, transferableObjects) {
+ // LERC encoded buffers must be decoded, then we can process them like normal
+ if (parameters.encoding === HeightmapEncoding$1.LERC) {
+ let result;
+ try {
+ result = Lerc.decode(parameters.heightmap);
+ } catch (error) {
+ throw new RuntimeError.RuntimeError(error);
+ }
+
+ const lercStatistics = result.statistics[0];
+ if (lercStatistics.minValue === Number.MAX_VALUE) {
+ throw new RuntimeError.RuntimeError("Invalid tile data");
+ }
+
+ parameters.heightmap = result.pixels[0];
+ parameters.width = result.width;
+ parameters.height = result.height;
+ }
+
+ parameters.ellipsoid = Matrix3.Ellipsoid.clone(parameters.ellipsoid);
+ parameters.rectangle = Matrix2.Rectangle.clone(parameters.rectangle);
+
+ const statistics = HeightmapTessellator$1.computeVertices(parameters);
+ const vertices = statistics.vertices;
+ transferableObjects.push(vertices.buffer);
+
+ return {
+ vertices: vertices.buffer,
+ numberOfAttributes: statistics.encoding.stride,
+ minimumHeight: statistics.minimumHeight,
+ maximumHeight: statistics.maximumHeight,
+ gridWidth: parameters.width,
+ gridHeight: parameters.height,
+ boundingSphere3D: statistics.boundingSphere3D,
+ orientedBoundingBox: statistics.orientedBoundingBox,
+ occludeePointInScaledSpace: statistics.occludeePointInScaledSpace,
+ encoding: statistics.encoding,
+ westIndicesSouthToNorth: statistics.westIndicesSouthToNorth,
+ southIndicesEastToWest: statistics.southIndicesEastToWest,
+ eastIndicesNorthToSouth: statistics.eastIndicesNorthToSouth,
+ northIndicesWestToEast: statistics.northIndicesWestToEast,
+ };
+ }
+ var createVerticesFromHeightmap$1 = createTaskProcessorWorker(createVerticesFromHeightmap);
+
+ return createVerticesFromHeightmap$1;
+
+}));
+//# sourceMappingURL=createVerticesFromHeightmap.js.map
diff --git a/examples/cesium/Workers/createVerticesFromHeightmap.js.map b/examples/cesium/Workers/createVerticesFromHeightmap.js.map
new file mode 100644
index 0000000..271789a
--- /dev/null
+++ b/examples/cesium/Workers/createVerticesFromHeightmap.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createVerticesFromHeightmap.js","sources":["../../../Source/Core/HeightmapEncoding.js","../../../Source/Core/HeightmapTessellator.js","../../../node_modules/lerc/LercDecode.js","../../../Source/WorkersES6/createVerticesFromHeightmap.js"],"sourcesContent":["/**\r\n * The encoding that is used for a heightmap\r\n *\r\n * @enum {Number}\r\n */\r\nconst HeightmapEncoding = {\r\n /**\r\n * No encoding\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n NONE: 0,\r\n\r\n /**\r\n * LERC encoding\r\n *\r\n * @type {Number}\r\n * @constant\r\n *\r\n * @see {@link https://github.com/Esri/lerc|The LERC specification}\r\n */\r\n LERC: 1,\r\n};\r\nexport default Object.freeze(HeightmapEncoding);\r\n","import AxisAlignedBoundingBox from \"./AxisAlignedBoundingBox.js\";\r\nimport BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport EllipsoidalOccluder from \"./EllipsoidalOccluder.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport Matrix4 from \"./Matrix4.js\";\r\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\r\nimport Rectangle from \"./Rectangle.js\";\r\nimport TerrainEncoding from \"./TerrainEncoding.js\";\r\nimport Transforms from \"./Transforms.js\";\r\nimport WebMercatorProjection from \"./WebMercatorProjection.js\";\r\n\r\n/**\r\n * Contains functions to create a mesh from a heightmap image.\r\n *\r\n * @namespace HeightmapTessellator\r\n *\r\n * @private\r\n */\r\nconst HeightmapTessellator = {};\r\n\r\n/**\r\n * The default structure of a heightmap, as given to {@link HeightmapTessellator.computeVertices}.\r\n *\r\n * @constant\r\n */\r\nHeightmapTessellator.DEFAULT_STRUCTURE = Object.freeze({\r\n heightScale: 1.0,\r\n heightOffset: 0.0,\r\n elementsPerHeight: 1,\r\n stride: 1,\r\n elementMultiplier: 256.0,\r\n isBigEndian: false,\r\n});\r\n\r\nconst cartesian3Scratch = new Cartesian3();\r\nconst matrix4Scratch = new Matrix4();\r\nconst minimumScratch = new Cartesian3();\r\nconst maximumScratch = new Cartesian3();\r\n\r\n/**\r\n * Fills an array of vertices from a heightmap image.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.heightmap The heightmap to tessellate.\r\n * @param {Number} options.width The width of the heightmap, in height samples.\r\n * @param {Number} options.height The height of the heightmap, in height samples.\r\n * @param {Number} options.skirtHeight The height of skirts to drape at the edges of the heightmap.\r\n * @param {Rectangle} options.nativeRectangle A rectangle in the native coordinates of the heightmap's projection. For\r\n * a heightmap with a geographic projection, this is degrees. For the web mercator\r\n * projection, this is meters.\r\n * @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\r\n * @param {Number} [options.exaggerationRelativeHeight=0.0] The height from which terrain is exaggerated.\r\n * @param {Rectangle} [options.rectangle] The rectangle covered by the heightmap, in geodetic coordinates with north, south, east and\r\n * west properties in radians. Either rectangle or nativeRectangle must be provided. If both\r\n * are provided, they're assumed to be consistent.\r\n * @param {Boolean} [options.isGeographic=true] True if the heightmap uses a {@link GeographicProjection}, or false if it uses\r\n * a {@link WebMercatorProjection}.\r\n * @param {Cartesian3} [options.relativeToCenter=Cartesian3.ZERO] The positions will be computed as Cartesian3.subtract(worldPosition, relativeToCenter)
.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to which the heightmap applies.\r\n * @param {Object} [options.structure] An object describing the structure of the height data.\r\n * @param {Number} [options.structure.heightScale=1.0] The factor by which to multiply height samples in order to obtain\r\n * the height above the heightOffset, in meters. The heightOffset is added to the resulting\r\n * height after multiplying by the scale.\r\n * @param {Number} [options.structure.heightOffset=0.0] The offset to add to the scaled height to obtain the final\r\n * height in meters. The offset is added after the height sample is multiplied by the\r\n * heightScale.\r\n * @param {Number} [options.structure.elementsPerHeight=1] The number of elements in the buffer that make up a single height\r\n * sample. This is usually 1, indicating that each element is a separate height sample. If\r\n * it is greater than 1, that number of elements together form the height sample, which is\r\n * computed according to the structure.elementMultiplier and structure.isBigEndian properties.\r\n * @param {Number} [options.structure.stride=1] The number of elements to skip to get from the first element of\r\n * one height to the first element of the next height.\r\n * @param {Number} [options.structure.elementMultiplier=256.0] The multiplier used to compute the height value when the\r\n * stride property is greater than 1. For example, if the stride is 4 and the strideMultiplier\r\n * is 256, the height is computed as follows:\r\n * `height = buffer[index] + buffer[index + 1] * 256 + buffer[index + 2] * 256 * 256 + buffer[index + 3] * 256 * 256 * 256`\r\n * This is assuming that the isBigEndian property is false. If it is true, the order of the\r\n * elements is reversed.\r\n * @param {Number} [options.structure.lowestEncodedHeight] The lowest value that can be stored in the height buffer. Any heights that are lower\r\n * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height\r\n * buffer is a `Uint16Array`, this value should be 0 because a `Uint16Array` cannot store negative numbers. If this parameter is\r\n * not specified, no minimum value is enforced.\r\n * @param {Number} [options.structure.highestEncodedHeight] The highest value that can be stored in the height buffer. Any heights that are higher\r\n * than this value after encoding with the `heightScale` and `heightOffset` are clamped to this value. For example, if the height\r\n * buffer is a `Uint16Array`, this value should be `256 * 256 - 1` or 65535 because a `Uint16Array` cannot store numbers larger\r\n * than 65535. If this parameter is not specified, no maximum value is enforced.\r\n * @param {Boolean} [options.structure.isBigEndian=false] Indicates endianness of the elements in the buffer when the\r\n * stride property is greater than 1. If this property is false, the first element is the\r\n * low-order element. If it is true, the first element is the high-order element.\r\n *\r\n * @example\r\n * const width = 5;\r\n * const height = 5;\r\n * const statistics = Cesium.HeightmapTessellator.computeVertices({\r\n * heightmap : [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0],\r\n * width : width,\r\n * height : height,\r\n * skirtHeight : 0.0,\r\n * nativeRectangle : {\r\n * west : 10.0,\r\n * east : 20.0,\r\n * south : 30.0,\r\n * north : 40.0\r\n * }\r\n * });\r\n *\r\n * const encoding = statistics.encoding;\r\n * const position = encoding.decodePosition(statistics.vertices, index);\r\n */\r\nHeightmapTessellator.computeVertices = function (options) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(options) || !defined(options.heightmap)) {\r\n throw new DeveloperError(\"options.heightmap is required.\");\r\n }\r\n if (!defined(options.width) || !defined(options.height)) {\r\n throw new DeveloperError(\"options.width and options.height are required.\");\r\n }\r\n if (!defined(options.nativeRectangle)) {\r\n throw new DeveloperError(\"options.nativeRectangle is required.\");\r\n }\r\n if (!defined(options.skirtHeight)) {\r\n throw new DeveloperError(\"options.skirtHeight is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n // This function tends to be a performance hotspot for terrain rendering,\r\n // so it employs a lot of inlining and unrolling as an optimization.\r\n // In particular, the functionality of Ellipsoid.cartographicToCartesian\r\n // is inlined.\r\n\r\n const cos = Math.cos;\r\n const sin = Math.sin;\r\n const sqrt = Math.sqrt;\r\n const atan = Math.atan;\r\n const exp = Math.exp;\r\n const piOverTwo = CesiumMath.PI_OVER_TWO;\r\n const toRadians = CesiumMath.toRadians;\r\n\r\n const heightmap = options.heightmap;\r\n const width = options.width;\r\n const height = options.height;\r\n const skirtHeight = options.skirtHeight;\r\n const hasSkirts = skirtHeight > 0.0;\r\n\r\n const isGeographic = defaultValue(options.isGeographic, true);\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n\r\n const oneOverGlobeSemimajorAxis = 1.0 / ellipsoid.maximumRadius;\r\n\r\n const nativeRectangle = Rectangle.clone(options.nativeRectangle);\r\n const rectangle = Rectangle.clone(options.rectangle);\r\n\r\n let geographicWest;\r\n let geographicSouth;\r\n let geographicEast;\r\n let geographicNorth;\r\n\r\n if (!defined(rectangle)) {\r\n if (isGeographic) {\r\n geographicWest = toRadians(nativeRectangle.west);\r\n geographicSouth = toRadians(nativeRectangle.south);\r\n geographicEast = toRadians(nativeRectangle.east);\r\n geographicNorth = toRadians(nativeRectangle.north);\r\n } else {\r\n geographicWest = nativeRectangle.west * oneOverGlobeSemimajorAxis;\r\n geographicSouth =\r\n piOverTwo -\r\n 2.0 * atan(exp(-nativeRectangle.south * oneOverGlobeSemimajorAxis));\r\n geographicEast = nativeRectangle.east * oneOverGlobeSemimajorAxis;\r\n geographicNorth =\r\n piOverTwo -\r\n 2.0 * atan(exp(-nativeRectangle.north * oneOverGlobeSemimajorAxis));\r\n }\r\n } else {\r\n geographicWest = rectangle.west;\r\n geographicSouth = rectangle.south;\r\n geographicEast = rectangle.east;\r\n geographicNorth = rectangle.north;\r\n }\r\n\r\n let relativeToCenter = options.relativeToCenter;\r\n const hasRelativeToCenter = defined(relativeToCenter);\r\n relativeToCenter = hasRelativeToCenter ? relativeToCenter : Cartesian3.ZERO;\r\n const includeWebMercatorT = defaultValue(options.includeWebMercatorT, false);\r\n\r\n const exaggeration = defaultValue(options.exaggeration, 1.0);\r\n const exaggerationRelativeHeight = defaultValue(\r\n options.exaggerationRelativeHeight,\r\n 0.0\r\n );\r\n const hasExaggeration = exaggeration !== 1.0;\r\n const includeGeodeticSurfaceNormals = hasExaggeration;\r\n\r\n const structure = defaultValue(\r\n options.structure,\r\n HeightmapTessellator.DEFAULT_STRUCTURE\r\n );\r\n const heightScale = defaultValue(\r\n structure.heightScale,\r\n HeightmapTessellator.DEFAULT_STRUCTURE.heightScale\r\n );\r\n const heightOffset = defaultValue(\r\n structure.heightOffset,\r\n HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset\r\n );\r\n const elementsPerHeight = defaultValue(\r\n structure.elementsPerHeight,\r\n HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight\r\n );\r\n const stride = defaultValue(\r\n structure.stride,\r\n HeightmapTessellator.DEFAULT_STRUCTURE.stride\r\n );\r\n const elementMultiplier = defaultValue(\r\n structure.elementMultiplier,\r\n HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier\r\n );\r\n const isBigEndian = defaultValue(\r\n structure.isBigEndian,\r\n HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian\r\n );\r\n\r\n let rectangleWidth = Rectangle.computeWidth(nativeRectangle);\r\n let rectangleHeight = Rectangle.computeHeight(nativeRectangle);\r\n\r\n const granularityX = rectangleWidth / (width - 1);\r\n const granularityY = rectangleHeight / (height - 1);\r\n\r\n if (!isGeographic) {\r\n rectangleWidth *= oneOverGlobeSemimajorAxis;\r\n rectangleHeight *= oneOverGlobeSemimajorAxis;\r\n }\r\n\r\n const radiiSquared = ellipsoid.radiiSquared;\r\n const radiiSquaredX = radiiSquared.x;\r\n const radiiSquaredY = radiiSquared.y;\r\n const radiiSquaredZ = radiiSquared.z;\r\n\r\n let minimumHeight = 65536.0;\r\n let maximumHeight = -65536.0;\r\n\r\n const fromENU = Transforms.eastNorthUpToFixedFrame(\r\n relativeToCenter,\r\n ellipsoid\r\n );\r\n const toENU = Matrix4.inverseTransformation(fromENU, matrix4Scratch);\r\n\r\n let southMercatorY;\r\n let oneOverMercatorHeight;\r\n if (includeWebMercatorT) {\r\n southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\r\n geographicSouth\r\n );\r\n oneOverMercatorHeight =\r\n 1.0 /\r\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(geographicNorth) -\r\n southMercatorY);\r\n }\r\n\r\n const minimum = minimumScratch;\r\n minimum.x = Number.POSITIVE_INFINITY;\r\n minimum.y = Number.POSITIVE_INFINITY;\r\n minimum.z = Number.POSITIVE_INFINITY;\r\n\r\n const maximum = maximumScratch;\r\n maximum.x = Number.NEGATIVE_INFINITY;\r\n maximum.y = Number.NEGATIVE_INFINITY;\r\n maximum.z = Number.NEGATIVE_INFINITY;\r\n\r\n let hMin = Number.POSITIVE_INFINITY;\r\n\r\n const gridVertexCount = width * height;\r\n const edgeVertexCount = skirtHeight > 0.0 ? width * 2 + height * 2 : 0;\r\n const vertexCount = gridVertexCount + edgeVertexCount;\r\n\r\n const positions = new Array(vertexCount);\r\n const heights = new Array(vertexCount);\r\n const uvs = new Array(vertexCount);\r\n const webMercatorTs = includeWebMercatorT ? new Array(vertexCount) : [];\r\n const geodeticSurfaceNormals = includeGeodeticSurfaceNormals\r\n ? new Array(vertexCount)\r\n : [];\r\n\r\n let startRow = 0;\r\n let endRow = height;\r\n let startCol = 0;\r\n let endCol = width;\r\n\r\n if (hasSkirts) {\r\n --startRow;\r\n ++endRow;\r\n --startCol;\r\n ++endCol;\r\n }\r\n\r\n const skirtOffsetPercentage = 0.00001;\r\n\r\n for (let rowIndex = startRow; rowIndex < endRow; ++rowIndex) {\r\n let row = rowIndex;\r\n if (row < 0) {\r\n row = 0;\r\n }\r\n if (row >= height) {\r\n row = height - 1;\r\n }\r\n\r\n let latitude = nativeRectangle.north - granularityY * row;\r\n\r\n if (!isGeographic) {\r\n latitude =\r\n piOverTwo - 2.0 * atan(exp(-latitude * oneOverGlobeSemimajorAxis));\r\n } else {\r\n latitude = toRadians(latitude);\r\n }\r\n\r\n let v = (latitude - geographicSouth) / (geographicNorth - geographicSouth);\r\n v = CesiumMath.clamp(v, 0.0, 1.0);\r\n\r\n const isNorthEdge = rowIndex === startRow;\r\n const isSouthEdge = rowIndex === endRow - 1;\r\n if (skirtHeight > 0.0) {\r\n if (isNorthEdge) {\r\n latitude += skirtOffsetPercentage * rectangleHeight;\r\n } else if (isSouthEdge) {\r\n latitude -= skirtOffsetPercentage * rectangleHeight;\r\n }\r\n }\r\n\r\n const cosLatitude = cos(latitude);\r\n const nZ = sin(latitude);\r\n const kZ = radiiSquaredZ * nZ;\r\n\r\n let webMercatorT;\r\n if (includeWebMercatorT) {\r\n webMercatorT =\r\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(latitude) -\r\n southMercatorY) *\r\n oneOverMercatorHeight;\r\n }\r\n\r\n for (let colIndex = startCol; colIndex < endCol; ++colIndex) {\r\n let col = colIndex;\r\n if (col < 0) {\r\n col = 0;\r\n }\r\n if (col >= width) {\r\n col = width - 1;\r\n }\r\n\r\n const terrainOffset = row * (width * stride) + col * stride;\r\n\r\n let heightSample;\r\n if (elementsPerHeight === 1) {\r\n heightSample = heightmap[terrainOffset];\r\n } else {\r\n heightSample = 0;\r\n\r\n let elementOffset;\r\n if (isBigEndian) {\r\n for (\r\n elementOffset = 0;\r\n elementOffset < elementsPerHeight;\r\n ++elementOffset\r\n ) {\r\n heightSample =\r\n heightSample * elementMultiplier +\r\n heightmap[terrainOffset + elementOffset];\r\n }\r\n } else {\r\n for (\r\n elementOffset = elementsPerHeight - 1;\r\n elementOffset >= 0;\r\n --elementOffset\r\n ) {\r\n heightSample =\r\n heightSample * elementMultiplier +\r\n heightmap[terrainOffset + elementOffset];\r\n }\r\n }\r\n }\r\n\r\n heightSample = heightSample * heightScale + heightOffset;\r\n\r\n maximumHeight = Math.max(maximumHeight, heightSample);\r\n minimumHeight = Math.min(minimumHeight, heightSample);\r\n\r\n let longitude = nativeRectangle.west + granularityX * col;\r\n\r\n if (!isGeographic) {\r\n longitude = longitude * oneOverGlobeSemimajorAxis;\r\n } else {\r\n longitude = toRadians(longitude);\r\n }\r\n\r\n let u = (longitude - geographicWest) / (geographicEast - geographicWest);\r\n u = CesiumMath.clamp(u, 0.0, 1.0);\r\n\r\n let index = row * width + col;\r\n\r\n if (skirtHeight > 0.0) {\r\n const isWestEdge = colIndex === startCol;\r\n const isEastEdge = colIndex === endCol - 1;\r\n const isEdge = isNorthEdge || isSouthEdge || isWestEdge || isEastEdge;\r\n const isCorner =\r\n (isNorthEdge || isSouthEdge) && (isWestEdge || isEastEdge);\r\n if (isCorner) {\r\n // Don't generate skirts on the corners.\r\n continue;\r\n } else if (isEdge) {\r\n heightSample -= skirtHeight;\r\n\r\n if (isWestEdge) {\r\n // The outer loop iterates north to south but the indices are ordered south to north, hence the index flip below\r\n index = gridVertexCount + (height - row - 1);\r\n longitude -= skirtOffsetPercentage * rectangleWidth;\r\n } else if (isSouthEdge) {\r\n // Add after west indices. South indices are ordered east to west.\r\n index = gridVertexCount + height + (width - col - 1);\r\n } else if (isEastEdge) {\r\n // Add after west and south indices. East indices are ordered north to south. The index is flipped like above.\r\n index = gridVertexCount + height + width + row;\r\n longitude += skirtOffsetPercentage * rectangleWidth;\r\n } else if (isNorthEdge) {\r\n // Add after west, south, and east indices. North indices are ordered west to east.\r\n index = gridVertexCount + height + width + height + col;\r\n }\r\n }\r\n }\r\n\r\n const nX = cosLatitude * cos(longitude);\r\n const nY = cosLatitude * sin(longitude);\r\n\r\n const kX = radiiSquaredX * nX;\r\n const kY = radiiSquaredY * nY;\r\n\r\n const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);\r\n const oneOverGamma = 1.0 / gamma;\r\n\r\n const rSurfaceX = kX * oneOverGamma;\r\n const rSurfaceY = kY * oneOverGamma;\r\n const rSurfaceZ = kZ * oneOverGamma;\r\n\r\n const position = new Cartesian3();\r\n position.x = rSurfaceX + nX * heightSample;\r\n position.y = rSurfaceY + nY * heightSample;\r\n position.z = rSurfaceZ + nZ * heightSample;\r\n\r\n Matrix4.multiplyByPoint(toENU, position, cartesian3Scratch);\r\n Cartesian3.minimumByComponent(cartesian3Scratch, minimum, minimum);\r\n Cartesian3.maximumByComponent(cartesian3Scratch, maximum, maximum);\r\n hMin = Math.min(hMin, heightSample);\r\n\r\n positions[index] = position;\r\n uvs[index] = new Cartesian2(u, v);\r\n heights[index] = heightSample;\r\n\r\n if (includeWebMercatorT) {\r\n webMercatorTs[index] = webMercatorT;\r\n }\r\n\r\n if (includeGeodeticSurfaceNormals) {\r\n geodeticSurfaceNormals[index] = ellipsoid.geodeticSurfaceNormal(\r\n position\r\n );\r\n }\r\n }\r\n }\r\n\r\n const boundingSphere3D = BoundingSphere.fromPoints(positions);\r\n let orientedBoundingBox;\r\n if (defined(rectangle)) {\r\n orientedBoundingBox = OrientedBoundingBox.fromRectangle(\r\n rectangle,\r\n minimumHeight,\r\n maximumHeight,\r\n ellipsoid\r\n );\r\n }\r\n\r\n let occludeePointInScaledSpace;\r\n if (hasRelativeToCenter) {\r\n const occluder = new EllipsoidalOccluder(ellipsoid);\r\n occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid(\r\n relativeToCenter,\r\n positions,\r\n minimumHeight\r\n );\r\n }\r\n\r\n const aaBox = new AxisAlignedBoundingBox(minimum, maximum, relativeToCenter);\r\n const encoding = new TerrainEncoding(\r\n relativeToCenter,\r\n aaBox,\r\n hMin,\r\n maximumHeight,\r\n fromENU,\r\n false,\r\n includeWebMercatorT,\r\n includeGeodeticSurfaceNormals,\r\n exaggeration,\r\n exaggerationRelativeHeight\r\n );\r\n const vertices = new Float32Array(vertexCount * encoding.stride);\r\n\r\n let bufferIndex = 0;\r\n for (let j = 0; j < vertexCount; ++j) {\r\n bufferIndex = encoding.encode(\r\n vertices,\r\n bufferIndex,\r\n positions[j],\r\n uvs[j],\r\n heights[j],\r\n undefined,\r\n webMercatorTs[j],\r\n geodeticSurfaceNormals[j]\r\n );\r\n }\r\n\r\n return {\r\n vertices: vertices,\r\n maximumHeight: maximumHeight,\r\n minimumHeight: minimumHeight,\r\n encoding: encoding,\r\n boundingSphere3D: boundingSphere3D,\r\n orientedBoundingBox: orientedBoundingBox,\r\n occludeePointInScaledSpace: occludeePointInScaledSpace,\r\n };\r\n};\r\nexport default HeightmapTessellator;\r\n","/* jshint forin: false, bitwise: false */\n/*\nCopyright 2015-2018 Esri\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\nA copy of the license and additional notices are located with the\nsource distribution at:\n\nhttp://github.com/Esri/lerc/\n\nContributors: Johannes Schmid, (LERC v1)\n Chayanika Khatua, (LERC v1)\n Wenxue Ju (LERC v1, v2.x)\n*/\n\n/* Copyright 2015-2018 Esri. 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 @preserve */\n\n/**\n * a module for decoding LERC blobs\n * @module Lerc\n */\n(function() {\n //the original LercDecode for Version 1\n var LercDecode = (function() {\n\n // WARNING: This decoder version can only read old version 1 Lerc blobs. Use with caution.\n\n // Note: currently, this module only has an implementation for decoding LERC data, not encoding. The name of\n // the class was chosen to be future proof.\n\n var CntZImage = {};\n\n CntZImage.defaultNoDataValue = -3.4027999387901484e+38; // smallest Float32 value\n\n /**\n * Decode a LERC byte stream and return an object containing the pixel data and some required and optional\n * information about it, such as the image's width and height.\n *\n * @param {ArrayBuffer} input The LERC input byte stream\n * @param {object} [options] Decoding options, containing any of the following properties:\n * @config {number} [inputOffset = 0]\n * Skip the first inputOffset bytes of the input byte stream. A valid LERC file is expected at that position.\n * @config {Uint8Array} [encodedMask = null]\n * If specified, the decoder will not read mask information from the input and use the specified encoded\n * mask data instead. Mask header/data must not be present in the LERC byte stream in this case.\n * @config {number} [noDataValue = LercCode.defaultNoDataValue]\n * Pixel value to use for masked pixels.\n * @config {ArrayBufferView|Array} [pixelType = Float32Array]\n * The desired type of the pixelData array in the return value. Note that it is the caller's responsibility to\n * provide an appropriate noDataValue if the default pixelType is overridden.\n * @config {boolean} [returnMask = false]\n * If true, the return value will contain a maskData property of type Uint8Array which has one element per\n * pixel, the value of which is 1 or 0 depending on whether that pixel's data is present or masked. If the\n * input LERC data does not contain a mask, maskData will not be returned.\n * @config {boolean} [returnEncodedMask = false]\n * If true, the return value will contain a encodedMaskData property, which can be passed into encode() as\n * encodedMask.\n * @config {boolean} [returnFileInfo = false]\n * If true, the return value will have a fileInfo property that contains metadata obtained from the\n * LERC headers and the decoding process.\n * @config {boolean} [computeUsedBitDepths = false]\n * If true, the fileInfo property in the return value will contain the set of all block bit depths\n * encountered during decoding. Will only have an effect if returnFileInfo option is true.\n * @returns {{width, height, pixelData, minValue, maxValue, noDataValue, maskData, encodedMaskData, fileInfo}}\n */\n CntZImage.decode = function(input, options) {\n options = options || {};\n\n var skipMask = options.encodedMaskData || (options.encodedMaskData === null);\n var parsedData = parse(input, options.inputOffset || 0, skipMask);\n\n var noDataValue = (options.noDataValue !== null) ? options.noDataValue : CntZImage.defaultNoDataValue;\n\n var uncompressedData = uncompressPixelValues(parsedData, options.pixelType || Float32Array,\n options.encodedMaskData, noDataValue, options.returnMask);\n\n var result = {\n width: parsedData.width,\n height: parsedData.height,\n pixelData: uncompressedData.resultPixels,\n minValue: uncompressedData.minValue,\n maxValue: parsedData.pixels.maxValue,\n noDataValue: noDataValue\n };\n\n if (uncompressedData.resultMask) {\n result.maskData = uncompressedData.resultMask;\n }\n\n if (options.returnEncodedMask && parsedData.mask) {\n result.encodedMaskData = parsedData.mask.bitset ? parsedData.mask.bitset : null;\n }\n\n if (options.returnFileInfo) {\n result.fileInfo = formatFileInfo(parsedData);\n if (options.computeUsedBitDepths) {\n result.fileInfo.bitDepths = computeUsedBitDepths(parsedData);\n }\n }\n\n return result;\n };\n\n var uncompressPixelValues = function(data, TypedArrayClass, maskBitset, noDataValue, storeDecodedMask) {\n var blockIdx = 0;\n var numX = data.pixels.numBlocksX;\n var numY = data.pixels.numBlocksY;\n var blockWidth = Math.floor(data.width / numX);\n var blockHeight = Math.floor(data.height / numY);\n var scale = 2 * data.maxZError;\n var minValue = Number.MAX_VALUE, currentValue;\n maskBitset = maskBitset || ((data.mask) ? data.mask.bitset : null);\n\n var resultPixels, resultMask;\n resultPixels = new TypedArrayClass(data.width * data.height);\n if (storeDecodedMask && maskBitset) {\n resultMask = new Uint8Array(data.width * data.height);\n }\n var blockDataBuffer = new Float32Array(blockWidth * blockHeight);\n\n var xx, yy;\n for (var y = 0; y <= numY; y++) {\n var thisBlockHeight = (y !== numY) ? blockHeight : (data.height % numY);\n if (thisBlockHeight === 0) {\n continue;\n }\n for (var x = 0; x <= numX; x++) {\n var thisBlockWidth = (x !== numX) ? blockWidth : (data.width % numX);\n if (thisBlockWidth === 0) {\n continue;\n }\n\n var outPtr = y * data.width * blockHeight + x * blockWidth;\n var outStride = data.width - thisBlockWidth;\n\n var block = data.pixels.blocks[blockIdx];\n\n var blockData, blockPtr, constValue;\n if (block.encoding < 2) {\n // block is either uncompressed or bit-stuffed (encodings 0 and 1)\n if (block.encoding === 0) {\n // block is uncompressed\n blockData = block.rawData;\n } else {\n // block is bit-stuffed\n unstuff(block.stuffedData, block.bitsPerPixel, block.numValidPixels, block.offset, scale, blockDataBuffer, data.pixels.maxValue);\n blockData = blockDataBuffer;\n }\n blockPtr = 0;\n }\n else if (block.encoding === 2) {\n // block is all 0\n constValue = 0;\n }\n else {\n // block has constant value (encoding === 3)\n constValue = block.offset;\n }\n\n var maskByte;\n if (maskBitset) {\n for (yy = 0; yy < thisBlockHeight; yy++) {\n if (outPtr & 7) {\n //\n maskByte = maskBitset[outPtr >> 3];\n maskByte <<= outPtr & 7;\n }\n for (xx = 0; xx < thisBlockWidth; xx++) {\n if (!(outPtr & 7)) {\n // read next byte from mask\n maskByte = maskBitset[outPtr >> 3];\n }\n if (maskByte & 128) {\n // pixel data present\n if (resultMask) {\n resultMask[outPtr] = 1;\n }\n currentValue = (block.encoding < 2) ? blockData[blockPtr++] : constValue;\n minValue = minValue > currentValue ? currentValue : minValue;\n resultPixels[outPtr++] = currentValue;\n } else {\n // pixel data not present\n if (resultMask) {\n resultMask[outPtr] = 0;\n }\n resultPixels[outPtr++] = noDataValue;\n }\n maskByte <<= 1;\n }\n outPtr += outStride;\n }\n } else {\n // mask not present, simply copy block over\n if (block.encoding < 2) {\n // duplicating this code block for performance reasons\n // blockData case:\n for (yy = 0; yy < thisBlockHeight; yy++) {\n for (xx = 0; xx < thisBlockWidth; xx++) {\n currentValue = blockData[blockPtr++];\n minValue = minValue > currentValue ? currentValue : minValue;\n resultPixels[outPtr++] = currentValue;\n }\n outPtr += outStride;\n }\n }\n else {\n // constValue case:\n minValue = minValue > constValue ? constValue : minValue;\n for (yy = 0; yy < thisBlockHeight; yy++) {\n for (xx = 0; xx < thisBlockWidth; xx++) {\n resultPixels[outPtr++] = constValue;\n }\n outPtr += outStride;\n }\n }\n }\n if ((block.encoding === 1) && (blockPtr !== block.numValidPixels)) {\n throw \"Block and Mask do not match\";\n }\n blockIdx++;\n }\n }\n\n return {\n resultPixels: resultPixels,\n resultMask: resultMask,\n minValue: minValue\n };\n };\n\n var formatFileInfo = function(data) {\n return {\n \"fileIdentifierString\": data.fileIdentifierString,\n \"fileVersion\": data.fileVersion,\n \"imageType\": data.imageType,\n \"height\": data.height,\n \"width\": data.width,\n \"maxZError\": data.maxZError,\n \"eofOffset\": data.eofOffset,\n \"mask\": data.mask ? {\n \"numBlocksX\": data.mask.numBlocksX,\n \"numBlocksY\": data.mask.numBlocksY,\n \"numBytes\": data.mask.numBytes,\n \"maxValue\": data.mask.maxValue\n } : null,\n \"pixels\": {\n \"numBlocksX\": data.pixels.numBlocksX,\n \"numBlocksY\": data.pixels.numBlocksY,\n \"numBytes\": data.pixels.numBytes,\n \"maxValue\": data.pixels.maxValue,\n \"noDataValue\": data.noDataValue\n }\n };\n };\n\n var computeUsedBitDepths = function(data) {\n var numBlocks = data.pixels.numBlocksX * data.pixels.numBlocksY;\n var bitDepths = {};\n for (var i = 0; i < numBlocks; i++) {\n var block = data.pixels.blocks[i];\n if (block.encoding === 0) {\n bitDepths.float32 = true;\n } else if (block.encoding === 1) {\n bitDepths[block.bitsPerPixel] = true;\n } else {\n bitDepths[0] = true;\n }\n }\n\n return Object.keys(bitDepths);\n };\n\n var parse = function(input, fp, skipMask) {\n var data = {};\n\n // File header\n var fileIdView = new Uint8Array(input, fp, 10);\n data.fileIdentifierString = String.fromCharCode.apply(null, fileIdView);\n if (data.fileIdentifierString.trim() !== \"CntZImage\") {\n throw \"Unexpected file identifier string: \" + data.fileIdentifierString;\n }\n fp += 10;\n var view = new DataView(input, fp, 24);\n data.fileVersion = view.getInt32(0, true);\n data.imageType = view.getInt32(4, true);\n data.height = view.getUint32(8, true);\n data.width = view.getUint32(12, true);\n data.maxZError = view.getFloat64(16, true);\n fp += 24;\n\n // Mask Header\n if (!skipMask) {\n view = new DataView(input, fp, 16);\n data.mask = {};\n data.mask.numBlocksY = view.getUint32(0, true);\n data.mask.numBlocksX = view.getUint32(4, true);\n data.mask.numBytes = view.getUint32(8, true);\n data.mask.maxValue = view.getFloat32(12, true);\n fp += 16;\n\n // Mask Data\n if (data.mask.numBytes > 0) {\n var bitset = new Uint8Array(Math.ceil(data.width * data.height / 8));\n view = new DataView(input, fp, data.mask.numBytes);\n var cnt = view.getInt16(0, true);\n var ip = 2, op = 0;\n do {\n if (cnt > 0) {\n while (cnt--) { bitset[op++] = view.getUint8(ip++); }\n } else {\n var val = view.getUint8(ip++);\n cnt = -cnt;\n while (cnt--) { bitset[op++] = val; }\n }\n cnt = view.getInt16(ip, true);\n ip += 2;\n } while (ip < data.mask.numBytes);\n if ((cnt !== -32768) || (op < bitset.length)) {\n throw \"Unexpected end of mask RLE encoding\";\n }\n data.mask.bitset = bitset;\n fp += data.mask.numBytes;\n }\n else if ((data.mask.numBytes | data.mask.numBlocksY | data.mask.maxValue) === 0) { // Special case, all nodata\n data.mask.bitset = new Uint8Array(Math.ceil(data.width * data.height / 8));\n }\n }\n\n // Pixel Header\n view = new DataView(input, fp, 16);\n data.pixels = {};\n data.pixels.numBlocksY = view.getUint32(0, true);\n data.pixels.numBlocksX = view.getUint32(4, true);\n data.pixels.numBytes = view.getUint32(8, true);\n data.pixels.maxValue = view.getFloat32(12, true);\n fp += 16;\n\n var numBlocksX = data.pixels.numBlocksX;\n var numBlocksY = data.pixels.numBlocksY;\n // the number of blocks specified in the header does not take into account the blocks at the end of\n // each row/column with a special width/height that make the image complete in case the width is not\n // evenly divisible by the number of blocks.\n var actualNumBlocksX = numBlocksX + ((data.width % numBlocksX) > 0 ? 1 : 0);\n var actualNumBlocksY = numBlocksY + ((data.height % numBlocksY) > 0 ? 1 : 0);\n data.pixels.blocks = new Array(actualNumBlocksX * actualNumBlocksY);\n var blockI = 0;\n for (var blockY = 0; blockY < actualNumBlocksY; blockY++) {\n for (var blockX = 0; blockX < actualNumBlocksX; blockX++) {\n\n // Block\n var size = 0;\n var bytesLeft = input.byteLength - fp;\n view = new DataView(input, fp, Math.min(10, bytesLeft));\n var block = {};\n data.pixels.blocks[blockI++] = block;\n var headerByte = view.getUint8(0); size++;\n block.encoding = headerByte & 63;\n if (block.encoding > 3) {\n throw \"Invalid block encoding (\" + block.encoding + \")\";\n }\n if (block.encoding === 2) {\n fp++;\n continue;\n }\n if ((headerByte !== 0) && (headerByte !== 2)) {\n headerByte >>= 6;\n block.offsetType = headerByte;\n if (headerByte === 2) {\n block.offset = view.getInt8(1); size++;\n } else if (headerByte === 1) {\n block.offset = view.getInt16(1, true); size += 2;\n } else if (headerByte === 0) {\n block.offset = view.getFloat32(1, true); size += 4;\n } else {\n throw \"Invalid block offset type\";\n }\n\n if (block.encoding === 1) {\n headerByte = view.getUint8(size); size++;\n block.bitsPerPixel = headerByte & 63;\n headerByte >>= 6;\n block.numValidPixelsType = headerByte;\n if (headerByte === 2) {\n block.numValidPixels = view.getUint8(size); size++;\n } else if (headerByte === 1) {\n block.numValidPixels = view.getUint16(size, true); size += 2;\n } else if (headerByte === 0) {\n block.numValidPixels = view.getUint32(size, true); size += 4;\n } else {\n throw \"Invalid valid pixel count type\";\n }\n }\n }\n fp += size;\n\n if (block.encoding === 3) {\n continue;\n }\n\n var arrayBuf, store8;\n if (block.encoding === 0) {\n var numPixels = (data.pixels.numBytes - 1) / 4;\n if (numPixels !== Math.floor(numPixels)) {\n throw \"uncompressed block has invalid length\";\n }\n arrayBuf = new ArrayBuffer(numPixels * 4);\n store8 = new Uint8Array(arrayBuf);\n store8.set(new Uint8Array(input, fp, numPixels * 4));\n var rawData = new Float32Array(arrayBuf);\n block.rawData = rawData;\n fp += numPixels * 4;\n } else if (block.encoding === 1) {\n var dataBytes = Math.ceil(block.numValidPixels * block.bitsPerPixel / 8);\n var dataWords = Math.ceil(dataBytes / 4);\n arrayBuf = new ArrayBuffer(dataWords * 4);\n store8 = new Uint8Array(arrayBuf);\n store8.set(new Uint8Array(input, fp, dataBytes));\n block.stuffedData = new Uint32Array(arrayBuf);\n fp += dataBytes;\n }\n }\n }\n data.eofOffset = fp;\n return data;\n };\n\n var unstuff = function(src, bitsPerPixel, numPixels, offset, scale, dest, maxValue) {\n var bitMask = (1 << bitsPerPixel) - 1;\n var i = 0, o;\n var bitsLeft = 0;\n var n, buffer;\n var nmax = Math.ceil((maxValue - offset) / scale);\n // get rid of trailing bytes that are already part of next block\n var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);\n src[src.length - 1] <<= 8 * numInvalidTailBytes;\n\n for (o = 0; o < numPixels; o++) {\n if (bitsLeft === 0) {\n buffer = src[i++];\n bitsLeft = 32;\n }\n if (bitsLeft >= bitsPerPixel) {\n n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;\n bitsLeft -= bitsPerPixel;\n } else {\n var missingBits = (bitsPerPixel - bitsLeft);\n n = ((buffer & bitMask) << missingBits) & bitMask;\n buffer = src[i++];\n bitsLeft = 32 - missingBits;\n n += (buffer >>> bitsLeft);\n }\n //pixel values may exceed max due to quantization\n dest[o] = n < nmax ? offset + n * scale : maxValue;\n }\n return dest;\n };\n\n return CntZImage;\n })();\n\n //version 2. Supports 2.1, 2.2, 2.3\n var Lerc2Decode = (function() {\n \"use strict\";\n // Note: currently, this module only has an implementation for decoding LERC data, not encoding. The name of\n // the class was chosen to be future proof, following LercDecode.\n\n /*****************************************\n * private static class bitsutffer used by Lerc2Decode\n *******************************************/\n var BitStuffer = {\n //methods ending with 2 are for the new byte order used by Lerc2.3 and above.\n //originalUnstuff is used to unpack Huffman code table. code is duplicated to unstuffx for performance reasons.\n unstuff: function(src, dest, bitsPerPixel, numPixels, lutArr, offset, scale, maxValue) {\n var bitMask = (1 << bitsPerPixel) - 1;\n var i = 0, o;\n var bitsLeft = 0;\n var n, buffer, missingBits, nmax;\n\n // get rid of trailing bytes that are already part of next block\n var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);\n src[src.length - 1] <<= 8 * numInvalidTailBytes;\n if (lutArr) {\n for (o = 0; o < numPixels; o++) {\n if (bitsLeft === 0) {\n buffer = src[i++];\n bitsLeft = 32;\n }\n if (bitsLeft >= bitsPerPixel) {\n n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;\n bitsLeft -= bitsPerPixel;\n }\n else {\n missingBits = (bitsPerPixel - bitsLeft);\n n = ((buffer & bitMask) << missingBits) & bitMask;\n buffer = src[i++];\n bitsLeft = 32 - missingBits;\n n += (buffer >>> bitsLeft);\n }\n dest[o] = lutArr[n];//offset + lutArr[n] * scale;\n }\n }\n else {\n nmax = Math.ceil((maxValue - offset) / scale);\n for (o = 0; o < numPixels; o++) {\n if (bitsLeft === 0) {\n buffer = src[i++];\n bitsLeft = 32;\n }\n if (bitsLeft >= bitsPerPixel) {\n n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;\n bitsLeft -= bitsPerPixel;\n }\n else {\n missingBits = (bitsPerPixel - bitsLeft);\n n = ((buffer & bitMask) << missingBits) & bitMask;\n buffer = src[i++];\n bitsLeft = 32 - missingBits;\n n += (buffer >>> bitsLeft);\n }\n //pixel values may exceed max due to quantization\n dest[o] = n < nmax ? offset + n * scale : maxValue;\n }\n }\n },\n\n unstuffLUT: function(src, bitsPerPixel, numPixels, offset, scale, maxValue) {\n var bitMask = (1 << bitsPerPixel) - 1;\n var i = 0, o = 0, missingBits = 0, bitsLeft = 0, n = 0;\n var buffer;\n var dest = [];\n\n // get rid of trailing bytes that are already part of next block\n var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);\n src[src.length - 1] <<= 8 * numInvalidTailBytes;\n\n var nmax = Math.ceil((maxValue - offset) / scale);\n for (o = 0; o < numPixels; o++) {\n if (bitsLeft === 0) {\n buffer = src[i++];\n bitsLeft = 32;\n }\n if (bitsLeft >= bitsPerPixel) {\n n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;\n bitsLeft -= bitsPerPixel;\n } else {\n missingBits = (bitsPerPixel - bitsLeft);\n n = ((buffer & bitMask) << missingBits) & bitMask;\n buffer = src[i++];\n bitsLeft = 32 - missingBits;\n n += (buffer >>> bitsLeft);\n }\n //dest.push(n);\n dest[o] = n < nmax ? offset + n * scale : maxValue;\n }\n dest.unshift(offset);//1st one\n return dest;\n },\n\n unstuff2: function(src, dest, bitsPerPixel, numPixels, lutArr, offset, scale, maxValue) {\n var bitMask = (1 << bitsPerPixel) - 1;\n var i = 0, o;\n var bitsLeft = 0, bitPos = 0;\n var n, buffer, missingBits;\n if (lutArr) {\n for (o = 0; o < numPixels; o++) {\n if (bitsLeft === 0) {\n buffer = src[i++];\n bitsLeft = 32;\n bitPos = 0;\n }\n if (bitsLeft >= bitsPerPixel) {\n n = ((buffer >>> bitPos) & bitMask);\n bitsLeft -= bitsPerPixel;\n bitPos += bitsPerPixel;\n } else {\n missingBits = (bitsPerPixel - bitsLeft);\n n = (buffer >>> bitPos) & bitMask;\n buffer = src[i++];\n bitsLeft = 32 - missingBits;\n n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);\n bitPos = missingBits;\n }\n dest[o] = lutArr[n];\n }\n }\n else {\n var nmax = Math.ceil((maxValue - offset) / scale);\n for (o = 0; o < numPixels; o++) {\n if (bitsLeft === 0) {\n buffer = src[i++];\n bitsLeft = 32;\n bitPos = 0;\n }\n if (bitsLeft >= bitsPerPixel) {\n //no unsigned left shift\n n = ((buffer >>> bitPos) & bitMask);\n bitsLeft -= bitsPerPixel;\n bitPos += bitsPerPixel;\n } else {\n missingBits = (bitsPerPixel - bitsLeft);\n n = (buffer >>> bitPos) & bitMask;//((buffer & bitMask) << missingBits) & bitMask;\n buffer = src[i++];\n bitsLeft = 32 - missingBits;\n n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);\n bitPos = missingBits;\n }\n //pixel values may exceed max due to quantization\n dest[o] = n < nmax ? offset + n * scale : maxValue;\n }\n }\n return dest;\n },\n\n unstuffLUT2: function(src, bitsPerPixel, numPixels, offset, scale, maxValue) {\n var bitMask = (1 << bitsPerPixel) - 1;\n var i = 0, o = 0, missingBits = 0, bitsLeft = 0, n = 0, bitPos = 0;\n var buffer;\n var dest = [];\n var nmax = Math.ceil((maxValue - offset) / scale);\n for (o = 0; o < numPixels; o++) {\n if (bitsLeft === 0) {\n buffer = src[i++];\n bitsLeft = 32;\n bitPos = 0;\n }\n if (bitsLeft >= bitsPerPixel) {\n //no unsigned left shift\n n = ((buffer >>> bitPos) & bitMask);\n bitsLeft -= bitsPerPixel;\n bitPos += bitsPerPixel;\n } else {\n missingBits = (bitsPerPixel - bitsLeft);\n n = (buffer >>> bitPos) & bitMask;//((buffer & bitMask) << missingBits) & bitMask;\n buffer = src[i++];\n bitsLeft = 32 - missingBits;\n n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);\n bitPos = missingBits;\n }\n //dest.push(n);\n dest[o] = n < nmax ? offset + n * scale : maxValue;\n }\n dest.unshift(offset);\n return dest;\n },\n\n originalUnstuff: function(src, dest, bitsPerPixel, numPixels) {\n var bitMask = (1 << bitsPerPixel) - 1;\n var i = 0, o;\n var bitsLeft = 0;\n var n, buffer, missingBits;\n\n // get rid of trailing bytes that are already part of next block\n var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);\n src[src.length - 1] <<= 8 * numInvalidTailBytes;\n\n for (o = 0; o < numPixels; o++) {\n if (bitsLeft === 0) {\n buffer = src[i++];\n bitsLeft = 32;\n }\n if (bitsLeft >= bitsPerPixel) {\n n = (buffer >>> (bitsLeft - bitsPerPixel)) & bitMask;\n bitsLeft -= bitsPerPixel;\n }\n else {\n missingBits = (bitsPerPixel - bitsLeft);\n n = ((buffer & bitMask) << missingBits) & bitMask;\n buffer = src[i++];\n bitsLeft = 32 - missingBits;\n n += (buffer >>> bitsLeft);\n }\n dest[o] = n;\n }\n return dest;\n },\n\n originalUnstuff2: function(src, dest, bitsPerPixel, numPixels) {\n var bitMask = (1 << bitsPerPixel) - 1;\n var i = 0, o;\n var bitsLeft = 0, bitPos = 0;\n var n, buffer, missingBits;\n //micro-optimizations\n for (o = 0; o < numPixels; o++) {\n if (bitsLeft === 0) {\n buffer = src[i++];\n bitsLeft = 32;\n bitPos = 0;\n }\n if (bitsLeft >= bitsPerPixel) {\n //no unsigned left shift\n n = ((buffer >>> bitPos) & bitMask);\n bitsLeft -= bitsPerPixel;\n bitPos += bitsPerPixel;\n } else {\n missingBits = (bitsPerPixel - bitsLeft);\n n = (buffer >>> bitPos) & bitMask;//((buffer & bitMask) << missingBits) & bitMask;\n buffer = src[i++];\n bitsLeft = 32 - missingBits;\n n |= (buffer & ((1 << missingBits) - 1)) << (bitsPerPixel - missingBits);\n bitPos = missingBits;\n }\n dest[o] = n;\n }\n return dest;\n }\n };\n\n /*****************************************\n *private static class used by Lerc2Decode\n ******************************************/\n var Lerc2Helpers = {\n HUFFMAN_LUT_BITS_MAX: 12, //use 2^12 lut, treat it like constant\n computeChecksumFletcher32: function(input) {\n\n var sum1 = 0xffff, sum2 = 0xffff;\n var len = input.length;\n var words = Math.floor(len / 2);\n var i = 0;\n while (words) {\n var tlen = (words >= 359) ? 359 : words;\n words -= tlen;\n do {\n sum1 += (input[i++] << 8);\n sum2 += sum1 += input[i++];\n } while (--tlen);\n\n sum1 = (sum1 & 0xffff) + (sum1 >>> 16);\n sum2 = (sum2 & 0xffff) + (sum2 >>> 16);\n }\n\n // add the straggler byte if it exists\n if (len & 1) {\n sum2 += sum1 += (input[i] << 8);\n }\n // second reduction step to reduce sums to 16 bits\n sum1 = (sum1 & 0xffff) + (sum1 >>> 16);\n sum2 = (sum2 & 0xffff) + (sum2 >>> 16);\n\n return (sum2 << 16 | sum1) >>> 0;\n },\n\n readHeaderInfo: function(input, data) {\n var ptr = data.ptr;\n var fileIdView = new Uint8Array(input, ptr, 6);\n var headerInfo = {};\n headerInfo.fileIdentifierString = String.fromCharCode.apply(null, fileIdView);\n if (headerInfo.fileIdentifierString.lastIndexOf(\"Lerc2\", 0) !== 0) {\n throw \"Unexpected file identifier string (expect Lerc2 ): \" + headerInfo.fileIdentifierString;\n }\n ptr += 6;\n var view = new DataView(input, ptr, 8);\n var fileVersion = view.getInt32(0, true);\n headerInfo.fileVersion = fileVersion;\n ptr += 4;\n if (fileVersion >= 3) {\n headerInfo.checksum = view.getUint32(4, true); //nrows\n ptr += 4;\n }\n\n //keys start from here\n view = new DataView(input, ptr, 12);\n headerInfo.height = view.getUint32(0, true); //nrows\n headerInfo.width = view.getUint32(4, true); //ncols\n ptr += 8;\n if (fileVersion >= 4) {\n headerInfo.numDims = view.getUint32(8, true);\n ptr += 4;\n }\n else {\n headerInfo.numDims = 1;\n }\n\n view = new DataView(input, ptr, 40);\n headerInfo.numValidPixel = view.getUint32(0, true);\n headerInfo.microBlockSize = view.getInt32(4, true);\n headerInfo.blobSize = view.getInt32(8, true);\n headerInfo.imageType = view.getInt32(12, true);\n\n headerInfo.maxZError = view.getFloat64(16, true);\n headerInfo.zMin = view.getFloat64(24, true);\n headerInfo.zMax = view.getFloat64(32, true);\n ptr += 40;\n data.headerInfo = headerInfo;\n data.ptr = ptr;\n\n var checksum, keyLength;\n if (fileVersion >= 3) {\n keyLength = fileVersion >= 4 ? 52 : 48;\n checksum = this.computeChecksumFletcher32(new Uint8Array(input, ptr - keyLength, headerInfo.blobSize - 14));\n if (checksum !== headerInfo.checksum) {\n throw \"Checksum failed.\";\n }\n }\n return true;\n },\n\n checkMinMaxRanges: function(input, data) {\n var headerInfo = data.headerInfo;\n var OutPixelTypeArray = this.getDataTypeArray(headerInfo.imageType);\n var rangeBytes = headerInfo.numDims * this.getDataTypeSize(headerInfo.imageType);\n var minValues = this.readSubArray(input, data.ptr, OutPixelTypeArray, rangeBytes);\n var maxValues = this.readSubArray(input, data.ptr + rangeBytes, OutPixelTypeArray, rangeBytes);\n data.ptr += (2 * rangeBytes);\n var i, equal = true;\n for (i = 0; i < headerInfo.numDims; i++) {\n if (minValues[i] !== maxValues[i]) {\n equal = false;\n break;\n }\n }\n headerInfo.minValues = minValues;\n headerInfo.maxValues = maxValues;\n return equal;\n },\n\n readSubArray: function(input, ptr, OutPixelTypeArray, numBytes) {\n var rawData;\n if (OutPixelTypeArray === Uint8Array) {\n rawData = new Uint8Array(input, ptr, numBytes);\n }\n else {\n var arrayBuf = new ArrayBuffer(numBytes);\n var store8 = new Uint8Array(arrayBuf);\n store8.set(new Uint8Array(input, ptr, numBytes));\n rawData = new OutPixelTypeArray(arrayBuf);\n }\n return rawData;\n },\n\n readMask: function(input, data) {\n var ptr = data.ptr;\n var headerInfo = data.headerInfo;\n var numPixels = headerInfo.width * headerInfo.height;\n var numValidPixel = headerInfo.numValidPixel;\n\n var view = new DataView(input, ptr, 4);\n var mask = {};\n mask.numBytes = view.getUint32(0, true);\n ptr += 4;\n\n // Mask Data\n if ((0 === numValidPixel || numPixels === numValidPixel) && 0 !== mask.numBytes) {\n throw (\"invalid mask\");\n }\n var bitset, resultMask;\n if (numValidPixel === 0) {\n bitset = new Uint8Array(Math.ceil(numPixels / 8));\n mask.bitset = bitset;\n resultMask = new Uint8Array(numPixels);\n data.pixels.resultMask = resultMask;\n ptr += mask.numBytes;\n }// ????? else if (data.mask.numBytes > 0 && data.mask.numBytes< data.numValidPixel) {\n else if (mask.numBytes > 0) {\n bitset = new Uint8Array(Math.ceil(numPixels / 8));\n view = new DataView(input, ptr, mask.numBytes);\n var cnt = view.getInt16(0, true);\n var ip = 2, op = 0, val = 0;\n do {\n if (cnt > 0) {\n while (cnt--) { bitset[op++] = view.getUint8(ip++); }\n } else {\n val = view.getUint8(ip++);\n cnt = -cnt;\n while (cnt--) { bitset[op++] = val; }\n }\n cnt = view.getInt16(ip, true);\n ip += 2;\n } while (ip < mask.numBytes);\n if ((cnt !== -32768) || (op < bitset.length)) {\n throw \"Unexpected end of mask RLE encoding\";\n }\n\n resultMask = new Uint8Array(numPixels);\n var mb = 0, k = 0;\n\n for (k = 0; k < numPixels; k++) {\n if (k & 7) {\n mb = bitset[k >> 3];\n mb <<= k & 7;\n }\n else {\n mb = bitset[k >> 3];\n }\n if (mb & 128) {\n resultMask[k] = 1;\n }\n }\n data.pixels.resultMask = resultMask;\n\n mask.bitset = bitset;\n ptr += mask.numBytes;\n }\n data.ptr = ptr;\n data.mask = mask;\n return true;\n },\n\n readDataOneSweep: function(input, data, OutPixelTypeArray) {\n var ptr = data.ptr;\n var headerInfo = data.headerInfo;\n var numDims = headerInfo.numDims;\n var numPixels = headerInfo.width * headerInfo.height;\n var imageType = headerInfo.imageType;\n var numBytes = headerInfo.numValidPixel * Lerc2Helpers.getDataTypeSize(imageType) * numDims;\n //data.pixels.numBytes = numBytes;\n var rawData;\n var mask = data.pixels.resultMask;\n if (OutPixelTypeArray === Uint8Array) {\n rawData = new Uint8Array(input, ptr, numBytes);\n }\n else {\n var arrayBuf = new ArrayBuffer(numBytes);\n var store8 = new Uint8Array(arrayBuf);\n store8.set(new Uint8Array(input, ptr, numBytes));\n rawData = new OutPixelTypeArray(arrayBuf);\n }\n if (rawData.length === numPixels * numDims) {\n data.pixels.resultPixels = rawData;\n }\n else //mask\n {\n data.pixels.resultPixels = new OutPixelTypeArray(numPixels * numDims);\n var z = 0, k = 0, i = 0, nStart = 0;\n if (numDims > 1) {\n for (i=0; i < numDims; i++) {\n nStart = i * numPixels;\n for (k = 0; k < numPixels; k++) {\n if (mask[k]) {\n data.pixels.resultPixels[nStart + k] = rawData[z++];\n }\n }\n }\n }\n else {\n for (k = 0; k < numPixels; k++) {\n if (mask[k]) {\n data.pixels.resultPixels[k] = rawData[z++];\n }\n }\n }\n }\n ptr += numBytes;\n data.ptr = ptr; //return data;\n return true;\n },\n\n readHuffmanTree: function(input, data) {\n var BITS_MAX = this.HUFFMAN_LUT_BITS_MAX; //8 is slow for the large test image\n //var size_max = 1 << BITS_MAX;\n /* ************************\n * reading code table\n *************************/\n var view = new DataView(input, data.ptr, 16);\n data.ptr += 16;\n var version = view.getInt32(0, true);\n if (version < 2) {\n throw \"unsupported Huffman version\";\n }\n var size = view.getInt32(4, true);\n var i0 = view.getInt32(8, true);\n var i1 = view.getInt32(12, true);\n if (i0 >= i1) {\n return false;\n }\n var blockDataBuffer = new Uint32Array(i1 - i0);\n Lerc2Helpers.decodeBits(input, data, blockDataBuffer);\n var codeTable = []; //size\n var i, j, k, len;\n\n for (i = i0; i < i1; i++) {\n j = i - (i < size ? 0 : size);//wrap around\n codeTable[j] = { first: blockDataBuffer[i - i0], second: null };\n }\n\n var dataBytes = input.byteLength - data.ptr;\n var dataWords = Math.ceil(dataBytes / 4);\n var arrayBuf = new ArrayBuffer(dataWords * 4);\n var store8 = new Uint8Array(arrayBuf);\n store8.set(new Uint8Array(input, data.ptr, dataBytes));\n var stuffedData = new Uint32Array(arrayBuf); //must start from x*4\n var bitPos = 0, word, srcPtr = 0;\n word = stuffedData[0];\n for (i = i0; i < i1; i++) {\n j = i - (i < size ? 0 : size);//wrap around\n len = codeTable[j].first;\n if (len > 0) {\n codeTable[j].second = (word << bitPos) >>> (32 - len);\n\n if (32 - bitPos >= len) {\n bitPos += len;\n if (bitPos === 32) {\n bitPos = 0;\n srcPtr++;\n word = stuffedData[srcPtr];\n }\n }\n else {\n bitPos += len - 32;\n srcPtr++;\n word = stuffedData[srcPtr];\n codeTable[j].second |= word >>> (32 - bitPos);\n }\n }\n }\n\n //finished reading code table\n\n /* ************************\n * building lut\n *************************/\n var numBitsLUT = 0, numBitsLUTQick = 0;\n var tree = new TreeNode();\n for (i = 0; i < codeTable.length; i++) {\n if (codeTable[i] !== undefined) {\n numBitsLUT = Math.max(numBitsLUT, codeTable[i].first);\n }\n }\n if (numBitsLUT >= BITS_MAX) {\n numBitsLUTQick = BITS_MAX;\n }\n else {\n numBitsLUTQick = numBitsLUT;\n }\n if (numBitsLUT >= 30) {\n console.log(\"WARning, large NUM LUT BITS IS \" + numBitsLUT);\n }\n var decodeLut = [], entry, code, numEntries, jj, currentBit, node;\n for (i = i0; i < i1; i++) {\n j = i - (i < size ? 0 : size);//wrap around\n len = codeTable[j].first;\n if (len > 0) {\n entry = [len, j];\n if (len <= numBitsLUTQick) {\n code = codeTable[j].second << (numBitsLUTQick - len);\n numEntries = 1 << (numBitsLUTQick - len);\n for (k = 0; k < numEntries; k++) {\n decodeLut[code | k] = entry;\n }\n }\n else {\n //build tree\n code = codeTable[j].second;\n node = tree;\n for (jj = len - 1; jj >= 0; jj--) {\n currentBit = code >>> jj & 1; //no left shift as length could be 30,31\n if (currentBit) {\n if (!node.right) {\n node.right = new TreeNode();\n }\n node = node.right;\n }\n else {\n if (!node.left) {\n node.left = new TreeNode();\n }\n node = node.left;\n }\n if (jj === 0 && !node.val) {\n node.val = entry[1];\n }\n }\n }\n }\n }\n return {\n decodeLut: decodeLut,\n numBitsLUTQick: numBitsLUTQick,\n numBitsLUT: numBitsLUT,\n tree: tree,\n stuffedData: stuffedData,\n srcPtr: srcPtr,\n bitPos: bitPos\n };\n },\n\n readHuffman: function(input, data, OutPixelTypeArray) {\n var headerInfo = data.headerInfo;\n var numDims = headerInfo.numDims;\n var height = data.headerInfo.height;\n var width = data.headerInfo.width;\n var numPixels = width * height;\n //var size_max = 1 << BITS_MAX;\n /* ************************\n * reading huffman structure info\n *************************/\n var huffmanInfo = this.readHuffmanTree(input, data);\n var decodeLut = huffmanInfo.decodeLut;\n var tree = huffmanInfo.tree;\n //stuffedData includes huffman headers\n var stuffedData = huffmanInfo.stuffedData;\n var srcPtr = huffmanInfo.srcPtr;\n var bitPos = huffmanInfo.bitPos;\n var numBitsLUTQick = huffmanInfo.numBitsLUTQick;\n var numBitsLUT = huffmanInfo.numBitsLUT;\n var offset = data.headerInfo.imageType === 0 ? 128 : 0;\n /*************************\n * decode\n ***************************/\n var node, val, delta, mask = data.pixels.resultMask, valTmp, valTmpQuick, currentBit;\n var i, j, k, ii;\n var prevVal = 0;\n if (bitPos > 0) {\n srcPtr++;\n bitPos = 0;\n }\n var word = stuffedData[srcPtr];\n var deltaEncode = data.encodeMode === 1;\n var resultPixelsAllDim = new OutPixelTypeArray(numPixels * numDims);\n var resultPixels = resultPixelsAllDim;\n var iDim;\n for (iDim = 0; iDim < headerInfo.numDims; iDim++) {\n if (numDims > 1) {\n //get the mem block of current dimension\n resultPixels = new OutPixelTypeArray(resultPixelsAllDim.buffer, numPixels * iDim, numPixels);\n prevVal = 0;\n }\n if (data.headerInfo.numValidPixel === width * height) { //all valid\n for (k = 0, i = 0; i < height; i++) {\n for (j = 0; j < width; j++, k++) {\n val = 0;\n valTmp = (word << bitPos) >>> (32 - numBitsLUTQick);\n valTmpQuick = valTmp;// >>> deltaBits;\n if (32 - bitPos < numBitsLUTQick) {\n valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUTQick));\n valTmpQuick = valTmp;// >>> deltaBits;\n }\n if (decodeLut[valTmpQuick]) // if there, move the correct number of bits and done\n {\n val = decodeLut[valTmpQuick][1];\n bitPos += decodeLut[valTmpQuick][0];\n }\n else {\n valTmp = (word << bitPos) >>> (32 - numBitsLUT);\n valTmpQuick = valTmp;// >>> deltaBits;\n if (32 - bitPos < numBitsLUT) {\n valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUT));\n valTmpQuick = valTmp;// >>> deltaBits;\n }\n node = tree;\n for (ii = 0; ii < numBitsLUT; ii++) {\n currentBit = valTmp >>> (numBitsLUT - ii - 1) & 1;\n node = currentBit ? node.right : node.left;\n if (!(node.left || node.right)) {\n val = node.val;\n bitPos = bitPos + ii + 1;\n break;\n }\n }\n }\n\n if (bitPos >= 32) {\n bitPos -= 32;\n srcPtr++;\n word = stuffedData[srcPtr];\n }\n\n delta = val - offset;\n if (deltaEncode) {\n if (j > 0) {\n delta += prevVal; // use overflow\n }\n else if (i > 0) {\n delta += resultPixels[k - width];\n }\n else {\n delta += prevVal;\n }\n delta &= 0xFF; //overflow\n resultPixels[k] = delta;//overflow\n prevVal = delta;\n }\n else {\n resultPixels[k] = delta;\n }\n }\n }\n }\n else { //not all valid, use mask\n for (k = 0, i = 0; i < height; i++) {\n for (j = 0; j < width; j++, k++) {\n if (mask[k]) {\n val = 0;\n valTmp = (word << bitPos) >>> (32 - numBitsLUTQick);\n valTmpQuick = valTmp;// >>> deltaBits;\n if (32 - bitPos < numBitsLUTQick) {\n valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUTQick));\n valTmpQuick = valTmp;// >>> deltaBits;\n }\n if (decodeLut[valTmpQuick]) // if there, move the correct number of bits and done\n {\n val = decodeLut[valTmpQuick][1];\n bitPos += decodeLut[valTmpQuick][0];\n }\n else {\n valTmp = (word << bitPos) >>> (32 - numBitsLUT);\n valTmpQuick = valTmp;// >>> deltaBits;\n if (32 - bitPos < numBitsLUT) {\n valTmp |= ((stuffedData[srcPtr + 1]) >>> (64 - bitPos - numBitsLUT));\n valTmpQuick = valTmp;// >>> deltaBits;\n }\n node = tree;\n for (ii = 0; ii < numBitsLUT; ii++) {\n currentBit = valTmp >>> (numBitsLUT - ii - 1) & 1;\n node = currentBit ? node.right : node.left;\n if (!(node.left || node.right)) {\n val = node.val;\n bitPos = bitPos + ii + 1;\n break;\n }\n }\n }\n\n if (bitPos >= 32) {\n bitPos -= 32;\n srcPtr++;\n word = stuffedData[srcPtr];\n }\n\n delta = val - offset;\n if (deltaEncode) {\n if (j > 0 && mask[k - 1]) {\n delta += prevVal; // use overflow\n }\n else if (i > 0 && mask[k - width]) {\n delta += resultPixels[k - width];\n }\n else {\n delta += prevVal;\n }\n\n delta &= 0xFF; //overflow\n resultPixels[k] = delta;//overflow\n prevVal = delta;\n }\n else {\n resultPixels[k] = delta;\n }\n }\n }\n }\n }\n data.ptr = data.ptr + (srcPtr + 1) * 4 + (bitPos > 0 ? 4 : 0);\n }\n data.pixels.resultPixels = resultPixelsAllDim;\n },\n\n decodeBits: function(input, data, blockDataBuffer, offset, iDim) {\n {\n //bitstuff encoding is 3\n var headerInfo = data.headerInfo;\n var fileVersion = headerInfo.fileVersion;\n //var block = {};\n var blockPtr = 0;\n var view = new DataView(input, data.ptr, 5);//to do\n var headerByte = view.getUint8(0);\n blockPtr++;\n var bits67 = headerByte >> 6;\n var n = (bits67 === 0) ? 4 : 3 - bits67;\n var doLut = (headerByte & 32) > 0 ? true : false;//5th bit\n var numBits = headerByte & 31;\n var numElements = 0;\n if (n === 1) {\n numElements = view.getUint8(blockPtr); blockPtr++;\n } else if (n === 2) {\n numElements = view.getUint16(blockPtr, true); blockPtr += 2;\n } else if (n === 4) {\n numElements = view.getUint32(blockPtr, true); blockPtr += 4;\n } else {\n throw \"Invalid valid pixel count type\";\n }\n //fix: huffman codes are bit stuffed, but not bound by data's max value, so need to use originalUnstuff\n //offset = offset || 0;\n var scale = 2 * headerInfo.maxZError;\n var stuffedData, arrayBuf, store8, dataBytes, dataWords;\n var lutArr, lutData, lutBytes, lutBitsPerElement, bitsPerPixel;\n var zMax = headerInfo.numDims > 1 ? headerInfo.maxValues[iDim] : headerInfo.zMax;\n if (doLut) {\n data.counter.lut++;\n lutBytes = view.getUint8(blockPtr);\n lutBitsPerElement = numBits;\n blockPtr++;\n dataBytes = Math.ceil((lutBytes - 1) * numBits / 8);\n dataWords = Math.ceil(dataBytes / 4);\n arrayBuf = new ArrayBuffer(dataWords * 4);\n store8 = new Uint8Array(arrayBuf);\n\n data.ptr += blockPtr;\n store8.set(new Uint8Array(input, data.ptr, dataBytes));\n\n lutData = new Uint32Array(arrayBuf);\n data.ptr += dataBytes;\n\n bitsPerPixel = 0;\n while ((lutBytes - 1) >>> bitsPerPixel) {\n bitsPerPixel++;\n }\n dataBytes = Math.ceil(numElements * bitsPerPixel / 8);\n dataWords = Math.ceil(dataBytes / 4);\n arrayBuf = new ArrayBuffer(dataWords * 4);\n store8 = new Uint8Array(arrayBuf);\n store8.set(new Uint8Array(input, data.ptr, dataBytes));\n stuffedData = new Uint32Array(arrayBuf);\n data.ptr += dataBytes;\n if (fileVersion >= 3) {\n lutArr = BitStuffer.unstuffLUT2(lutData, numBits, lutBytes - 1, offset, scale, zMax);\n }\n else {\n lutArr = BitStuffer.unstuffLUT(lutData, numBits, lutBytes - 1, offset, scale, zMax);\n }\n //lutArr.unshift(0);\n if (fileVersion >= 3) {\n //BitStuffer.unstuff2(block, blockDataBuffer, headerInfo.zMax);\n BitStuffer.unstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements, lutArr);\n }\n else {\n BitStuffer.unstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements, lutArr);\n }\n }\n else {\n //console.debug(\"bitstuffer\");\n data.counter.bitstuffer++;\n bitsPerPixel = numBits;\n data.ptr += blockPtr;\n if (bitsPerPixel > 0) {\n dataBytes = Math.ceil(numElements * bitsPerPixel / 8);\n dataWords = Math.ceil(dataBytes / 4);\n arrayBuf = new ArrayBuffer(dataWords * 4);\n store8 = new Uint8Array(arrayBuf);\n store8.set(new Uint8Array(input, data.ptr, dataBytes));\n stuffedData = new Uint32Array(arrayBuf);\n data.ptr += dataBytes;\n if (fileVersion >= 3) {\n if (offset == null) {\n BitStuffer.originalUnstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements);\n }\n else {\n BitStuffer.unstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements, false, offset, scale, zMax);\n }\n }\n else {\n if (offset == null) {\n BitStuffer.originalUnstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements);\n }\n else {\n BitStuffer.unstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements, false, offset, scale, zMax);\n }\n }\n }\n }\n }\n\n },\n\n readTiles: function(input, data, OutPixelTypeArray) {\n var headerInfo = data.headerInfo;\n var width = headerInfo.width;\n var height = headerInfo.height;\n var microBlockSize = headerInfo.microBlockSize;\n var imageType = headerInfo.imageType;\n var dataTypeSize = Lerc2Helpers.getDataTypeSize(imageType);\n var numBlocksX = Math.ceil(width / microBlockSize);\n var numBlocksY = Math.ceil(height / microBlockSize);\n data.pixels.numBlocksY = numBlocksY;\n data.pixels.numBlocksX = numBlocksX;\n data.pixels.ptr = 0;\n var row = 0, col = 0, blockY = 0, blockX = 0, thisBlockHeight = 0, thisBlockWidth = 0, bytesLeft = 0, headerByte = 0, bits67 = 0, testCode = 0, outPtr = 0, outStride = 0, numBytes = 0, bytesleft = 0, z = 0, blockPtr = 0;\n var view, block, arrayBuf, store8, rawData;\n var blockEncoding;\n var blockDataBuffer = new OutPixelTypeArray(microBlockSize * microBlockSize);\n var lastBlockHeight = (height % microBlockSize) || microBlockSize;\n var lastBlockWidth = (width % microBlockSize) || microBlockSize;\n var offsetType, offset;\n var numDims = headerInfo.numDims, iDim;\n var mask = data.pixels.resultMask;\n var resultPixels = data.pixels.resultPixels;\n for (blockY = 0; blockY < numBlocksY; blockY++) {\n thisBlockHeight = (blockY !== numBlocksY - 1) ? microBlockSize : lastBlockHeight;\n for (blockX = 0; blockX < numBlocksX; blockX++) {\n //console.debug(\"y\" + blockY + \" x\" + blockX);\n thisBlockWidth = (blockX !== numBlocksX - 1) ? microBlockSize : lastBlockWidth;\n\n outPtr = blockY * width * microBlockSize + blockX * microBlockSize;\n outStride = width - thisBlockWidth;\n\n\n for (iDim = 0; iDim < numDims; iDim++) {\n if (numDims > 1) {\n resultPixels = new OutPixelTypeArray(data.pixels.resultPixels.buffer, width * height * iDim * dataTypeSize, width * height);\n }\n bytesLeft = input.byteLength - data.ptr;\n view = new DataView(input, data.ptr, Math.min(10, bytesLeft));\n block = {};\n blockPtr = 0;\n headerByte = view.getUint8(0);\n blockPtr++;\n bits67 = (headerByte >> 6) & 0xFF;\n testCode = (headerByte >> 2) & 15; // use bits 2345 for integrity check\n if (testCode !== (((blockX * microBlockSize) >> 3) & 15)) {\n throw \"integrity issue\";\n //return false;\n }\n\n blockEncoding = headerByte & 3;\n if (blockEncoding > 3) {\n data.ptr += blockPtr;\n throw \"Invalid block encoding (\" + blockEncoding + \")\";\n }\n else if (blockEncoding === 2) { //constant 0\n data.counter.constant++;\n data.ptr += blockPtr;\n continue;\n }\n else if (blockEncoding === 0) { //uncompressed\n data.counter.uncompressed++;\n data.ptr += blockPtr;\n numBytes = thisBlockHeight * thisBlockWidth * dataTypeSize;\n bytesleft = input.byteLength - data.ptr;\n numBytes = numBytes < bytesleft ? numBytes : bytesleft;\n //bit alignment\n arrayBuf = new ArrayBuffer((numBytes % dataTypeSize) === 0 ? numBytes : (numBytes + dataTypeSize - numBytes % dataTypeSize));\n store8 = new Uint8Array(arrayBuf);\n store8.set(new Uint8Array(input, data.ptr, numBytes));\n rawData = new OutPixelTypeArray(arrayBuf);\n z = 0;\n if (mask) {\n for (row = 0; row < thisBlockHeight; row++) {\n for (col = 0; col < thisBlockWidth; col++) {\n if (mask[outPtr]) {\n resultPixels[outPtr] = rawData[z++];\n }\n outPtr++;\n }\n outPtr += outStride;\n }\n }\n else {//all valid\n for (row = 0; row < thisBlockHeight; row++) {\n for (col = 0; col < thisBlockWidth; col++) {\n resultPixels[outPtr++] = rawData[z++];\n }\n outPtr += outStride;\n }\n }\n data.ptr += z * dataTypeSize;\n }\n else { //1 or 3\n offsetType = Lerc2Helpers.getDataTypeUsed(imageType, bits67);\n offset = Lerc2Helpers.getOnePixel(block, blockPtr, offsetType, view);\n blockPtr += Lerc2Helpers.getDataTypeSize(offsetType);\n if (blockEncoding === 3) //constant offset value\n {\n data.ptr += blockPtr;\n data.counter.constantoffset++;\n //you can delete the following resultMask case in favor of performance because val is constant and users use nodata mask, otherwise nodatavalue post processing handles it too.\n //while the above statement is true, we're not doing it as we want to keep invalid pixel value at 0 rather than arbitrary values\n if (mask) {\n for (row = 0; row < thisBlockHeight; row++) {\n for (col = 0; col < thisBlockWidth; col++) {\n if (mask[outPtr]) {\n resultPixels[outPtr] = offset;\n }\n outPtr++;\n }\n outPtr += outStride;\n }\n }\n else {\n for (row = 0; row < thisBlockHeight; row++) {\n for (col = 0; col < thisBlockWidth; col++) {\n resultPixels[outPtr++] = offset;\n }\n outPtr += outStride;\n }\n }\n }\n else { //bitstuff encoding is 3\n data.ptr += blockPtr;\n //heavy lifting\n Lerc2Helpers.decodeBits(input, data, blockDataBuffer, offset, iDim);\n blockPtr = 0;\n if (mask) {\n for (row = 0; row < thisBlockHeight; row++) {\n for (col = 0; col < thisBlockWidth; col++) {\n if (mask[outPtr]) {\n resultPixels[outPtr] = blockDataBuffer[blockPtr++];\n }\n outPtr++;\n }\n outPtr += outStride;\n }\n }\n else {\n for (row = 0; row < thisBlockHeight; row++) {\n for (col = 0; col < thisBlockWidth; col++) {\n resultPixels[outPtr++] = blockDataBuffer[blockPtr++];\n }\n outPtr += outStride;\n }\n }\n }\n }\n }\n }\n }\n },\n\n /*****************\n * private methods (helper methods)\n *****************/\n\n formatFileInfo: function(data) {\n return {\n \"fileIdentifierString\": data.headerInfo.fileIdentifierString,\n \"fileVersion\": data.headerInfo.fileVersion,\n \"imageType\": data.headerInfo.imageType,\n \"height\": data.headerInfo.height,\n \"width\": data.headerInfo.width,\n \"numValidPixel\": data.headerInfo.numValidPixel,\n \"microBlockSize\": data.headerInfo.microBlockSize,\n \"blobSize\": data.headerInfo.blobSize,\n \"maxZError\": data.headerInfo.maxZError,\n \"pixelType\": Lerc2Helpers.getPixelType(data.headerInfo.imageType),\n \"eofOffset\": data.eofOffset,\n \"mask\": data.mask ? {\n \"numBytes\": data.mask.numBytes\n } : null,\n \"pixels\": {\n \"numBlocksX\": data.pixels.numBlocksX,\n \"numBlocksY\": data.pixels.numBlocksY,\n //\"numBytes\": data.pixels.numBytes,\n \"maxValue\": data.headerInfo.zMax,\n \"minValue\": data.headerInfo.zMin,\n \"noDataValue\": data.noDataValue\n }\n };\n },\n\n constructConstantSurface: function(data) {\n var val = data.headerInfo.zMax;\n var numDims = data.headerInfo.numDims;\n var numPixels = data.headerInfo.height * data.headerInfo.width;\n var numPixelAllDims = numPixels * numDims;\n var i=0, k = 0, nStart=0;\n var mask = data.pixels.resultMask;\n if (mask) {\n if (numDims > 1) {\n for (i=0; i < numDims; i++) {\n nStart = i * numPixels;\n for (k = 0; k < numPixels; k++) {\n if (mask[k]) {\n data.pixels.resultPixels[nStart + k] = val;\n }\n }\n }\n }\n else {\n for (k = 0; k < numPixels; k++) {\n if (mask[k]) {\n data.pixels.resultPixels[k] = val;\n }\n }\n }\n }\n else {\n if (data.pixels.resultPixels.fill) {\n data.pixels.resultPixels.fill(val);\n }\n else {\n for (k = 0; k < numPixelAllDims; k++) {\n data.pixels.resultPixels[k] = val;\n }\n }\n }\n return;\n },\n\n getDataTypeArray: function(t) {\n var tp;\n switch (t) {\n case 0: //char\n tp = Int8Array;\n break;\n case 1: //byte\n tp = Uint8Array;\n break;\n case 2: //short\n tp = Int16Array;\n break;\n case 3: //ushort\n tp = Uint16Array;\n break;\n case 4:\n tp = Int32Array;\n break;\n case 5:\n tp = Uint32Array;\n break;\n case 6:\n tp = Float32Array;\n break;\n case 7:\n tp = Float64Array;\n break;\n default:\n tp = Float32Array;\n }\n return tp;\n },\n\n getPixelType: function(t) {\n var tp;\n switch (t) {\n case 0: //char\n tp = \"S8\";\n break;\n case 1: //byte\n tp = \"U8\";\n break;\n case 2: //short\n tp = \"S16\";\n break;\n case 3: //ushort\n tp = \"U16\";\n break;\n case 4:\n tp = \"S32\";\n break;\n case 5:\n tp = \"U32\";\n break;\n case 6:\n tp = \"F32\";\n break;\n case 7:\n tp = \"F64\"; //not supported\n break;\n default:\n tp = \"F32\";\n }\n return tp;\n },\n\n isValidPixelValue: function(t, val) {\n if (val == null) {\n return false;\n }\n var isValid;\n switch (t) {\n case 0: //char\n isValid = val >= -128 && val <= 127;\n break;\n case 1: //byte (unsigned char)\n isValid = val >= 0 && val <= 255;\n break;\n case 2: //short\n isValid = val >= -32768 && val <= 32767;\n break;\n case 3: //ushort\n isValid = val >= 0 && val <= 65536;\n break;\n case 4: //int 32\n isValid = val >= -2147483648 && val <= 2147483647;\n break;\n case 5: //uinit 32\n isValid = val >= 0 && val <= 4294967296;\n break;\n case 6:\n isValid = val >= -3.4027999387901484e+38 && val <= 3.4027999387901484e+38;\n break;\n case 7:\n isValid = val >= 5e-324 && val <= 1.7976931348623157e+308;\n break;\n default:\n isValid = false;\n }\n return isValid;\n },\n\n getDataTypeSize: function(t) {\n var s = 0;\n switch (t) {\n case 0: //ubyte\n case 1: //byte\n s = 1;\n break;\n case 2: //short\n case 3: //ushort\n s = 2;\n break;\n case 4:\n case 5:\n case 6:\n s = 4;\n break;\n case 7:\n s = 8;\n break;\n default:\n s = t;\n }\n return s;\n },\n\n getDataTypeUsed: function(dt, tc) {\n var t = dt;\n switch (dt) {\n case 2: //short\n case 4: //long\n t = dt - tc;\n break;\n case 3: //ushort\n case 5: //ulong\n t = dt - 2 * tc;\n break;\n case 6: //float\n if (0 === tc) {\n t = dt;\n }\n else if (1 === tc) {\n t = 2;\n }\n else {\n t = 1;//byte\n }\n break;\n case 7: //double\n if (0 === tc) {\n t = dt;\n }\n else {\n t = dt - 2 * tc + 1;\n }\n break;\n default:\n t = dt;\n break;\n }\n return t;\n },\n\n getOnePixel: function(block, blockPtr, offsetType, view) {\n var temp = 0;\n switch (offsetType) {\n case 0: //char\n temp = view.getInt8(blockPtr);\n break;\n case 1: //byte\n temp = view.getUint8(blockPtr);\n break;\n case 2:\n temp = view.getInt16(blockPtr, true);\n break;\n case 3:\n temp = view.getUint16(blockPtr, true);\n break;\n case 4:\n temp = view.getInt32(blockPtr, true);\n break;\n case 5:\n temp = view.getUInt32(blockPtr, true);\n break;\n case 6:\n temp = view.getFloat32(blockPtr, true);\n break;\n case 7:\n //temp = view.getFloat64(blockPtr, true);\n //blockPtr += 8;\n //lerc2 encoding doesnt handle float 64, force to float32???\n temp = view.getFloat64(blockPtr, true);\n break;\n default:\n throw (\"the decoder does not understand this pixel type\");\n }\n return temp;\n }\n };\n\n /***************************************************\n *private class for a tree node. Huffman code is in Lerc2Helpers\n ****************************************************/\n var TreeNode = function(val, left, right) {\n this.val = val;\n this.left = left;\n this.right = right;\n };\n\n var Lerc2Decode = {\n /*\n * ********removed options compared to LERC1. We can bring some of them back if needed.\n * removed pixel type. LERC2 is typed and doesn't require user to give pixel type\n * changed encodedMaskData to maskData. LERC2 's js version make it faster to use maskData directly.\n * removed returnMask. mask is used by LERC2 internally and is cost free. In case of user input mask, it's returned as well and has neglible cost.\n * removed nodatavalue. Because LERC2 pixels are typed, nodatavalue will sacrify a useful value for many types (8bit, 16bit) etc,\n * user has to be knowledgable enough about raster and their data to avoid usability issues. so nodata value is simply removed now.\n * We can add it back later if their's a clear requirement.\n * removed encodedMask. This option was not implemented in LercDecode. It can be done after decoding (less efficient)\n * removed computeUsedBitDepths.\n *\n *\n * response changes compared to LERC1\n * 1. encodedMaskData is not available\n * 2. noDataValue is optional (returns only if user's noDataValue is with in the valid data type range)\n * 3. maskData is always available\n */\n /*****************\n * public properties\n ******************/\n //HUFFMAN_LUT_BITS_MAX: 12, //use 2^12 lut, not configurable\n\n /*****************\n * public methods\n *****************/\n\n /**\n * Decode a LERC2 byte stream and return an object containing the pixel data and optional metadata.\n *\n * @param {ArrayBuffer} input The LERC input byte stream\n * @param {object} [options] options Decoding options\n * @param {number} [options.inputOffset] The number of bytes to skip in the input byte stream. A valid LERC file is expected at that position\n * @param {boolean} [options.returnFileInfo] If true, the return value will have a fileInfo property that contains metadata obtained from the LERC headers and the decoding process\n */\n decode: function(/*byte array*/ input, /*object*/ options) {\n //currently there's a bug in the sparse array, so please do not set to false\n options = options || {};\n var noDataValue = options.noDataValue;\n\n //initialize\n var i = 0, data = {};\n data.ptr = options.inputOffset || 0;\n data.pixels = {};\n\n // File header\n if (!Lerc2Helpers.readHeaderInfo(input, data)) {\n return;\n }\n var headerInfo = data.headerInfo;\n var fileVersion = headerInfo.fileVersion;\n var OutPixelTypeArray = Lerc2Helpers.getDataTypeArray(headerInfo.imageType);\n\n // Mask Header\n Lerc2Helpers.readMask(input, data);\n if (headerInfo.numValidPixel !== headerInfo.width * headerInfo.height && !data.pixels.resultMask) {\n data.pixels.resultMask = options.maskData;\n }\n\n var numPixels = headerInfo.width * headerInfo.height;\n data.pixels.resultPixels = new OutPixelTypeArray(numPixels * headerInfo.numDims);\n\n data.counter = {\n onesweep: 0,\n uncompressed: 0,\n lut: 0,\n bitstuffer: 0,\n constant: 0,\n constantoffset: 0\n };\n if (headerInfo.numValidPixel !== 0) {\n //not tested\n if (headerInfo.zMax === headerInfo.zMin) //constant surface\n {\n Lerc2Helpers.constructConstantSurface(data);\n }\n else if (fileVersion >= 4 && Lerc2Helpers.checkMinMaxRanges(input, data)) {\n Lerc2Helpers.constructConstantSurface(data);\n }\n else {\n var view = new DataView(input, data.ptr, 2);\n var bReadDataOneSweep = view.getUint8(0);\n data.ptr++;\n if (bReadDataOneSweep) {\n //console.debug(\"OneSweep\");\n Lerc2Helpers.readDataOneSweep(input, data, OutPixelTypeArray);\n }\n else {\n //lerc2.1: //bitstuffing + lut\n //lerc2.2: //bitstuffing + lut + huffman\n //lerc2.3: new bitstuffer\n if (fileVersion > 1 && headerInfo.imageType <= 1 && Math.abs(headerInfo.maxZError - 0.5) < 0.00001) {\n //this is 2.x plus 8 bit (unsigned and signed) data, possiblity of Huffman\n var flagHuffman = view.getUint8(1);\n data.ptr++;\n data.encodeMode = flagHuffman;\n if (flagHuffman > 2 || (fileVersion < 4 && flagHuffman > 1)) {\n throw \"Invalid Huffman flag \" + flagHuffman;\n }\n if (flagHuffman) {//1 - delta Huffman, 2 - Huffman\n //console.log(\"Huffman\");\n Lerc2Helpers.readHuffman(input, data, OutPixelTypeArray);\n }\n else {\n //console.log(\"Tiles\");\n Lerc2Helpers.readTiles(input, data, OutPixelTypeArray);\n }\n }\n else { //lerc2.x non-8 bit data\n //console.log(\"Tiles\");\n Lerc2Helpers.readTiles(input, data, OutPixelTypeArray);\n }\n }\n }\n }\n\n data.eofOffset = data.ptr;\n var diff;\n if (options.inputOffset) {\n diff = data.headerInfo.blobSize + options.inputOffset - data.ptr;\n if (Math.abs(diff) >= 1) {\n //console.debug(\"incorrect eof: dataptr \" + data.ptr + \" offset \" + options.inputOffset + \" blobsize \" + data.headerInfo.blobSize + \" diff: \" + diff);\n data.eofOffset = options.inputOffset + data.headerInfo.blobSize;\n }\n }\n else {\n diff = data.headerInfo.blobSize - data.ptr;\n if (Math.abs(diff) >= 1) {\n //console.debug(\"incorrect first band eof: dataptr \" + data.ptr + \" blobsize \" + data.headerInfo.blobSize + \" diff: \" + diff);\n data.eofOffset = data.headerInfo.blobSize;\n }\n }\n\n var result = {\n width: headerInfo.width,\n height: headerInfo.height,\n pixelData: data.pixels.resultPixels,\n minValue: headerInfo.zMin,\n maxValue: headerInfo.zMax,\n validPixelCount: headerInfo.numValidPixel,\n dimCount: headerInfo.numDims,\n dimStats: {\n minValues: headerInfo.minValues,\n maxValues: headerInfo.maxValues\n },\n maskData: data.pixels.resultMask\n //noDataValue: noDataValue\n };\n\n //we should remove this if there's no existing client\n //optional noDataValue processing, it's user's responsiblity\n if (data.pixels.resultMask && Lerc2Helpers.isValidPixelValue(headerInfo.imageType, noDataValue)) {\n var mask = data.pixels.resultMask;\n for (i = 0; i < numPixels; i++) {\n if (!mask[i]) {\n result.pixelData[i] = noDataValue;\n }\n }\n result.noDataValue = noDataValue;\n }\n data.noDataValue = noDataValue;\n if (options.returnFileInfo) {\n result.fileInfo = Lerc2Helpers.formatFileInfo(data);\n }\n return result;\n },\n\n getBandCount: function(/*byte array*/ input) {\n var count = 0;\n var i = 0;\n var temp = {};\n temp.ptr = 0;\n temp.pixels = {};\n while (i < input.byteLength - 58) {\n Lerc2Helpers.readHeaderInfo(input, temp);\n i += temp.headerInfo.blobSize;\n count++;\n temp.ptr = i;\n }\n return count;\n }\n };\n\n return Lerc2Decode;\n })();\n\n var isPlatformLittleEndian = (function() {\n var a = new ArrayBuffer(4);\n var b = new Uint8Array(a);\n var c = new Uint32Array(a);\n c[0] = 1;\n return b[0] === 1;\n })();\n\n var Lerc = {\n /************wrapper**********************************************/\n /**\n * A wrapper for decoding both LERC1 and LERC2 byte streams capable of handling multiband pixel blocks for various pixel types.\n *\n * @alias module:Lerc\n * @param {ArrayBuffer} input The LERC input byte stream\n * @param {object} [options] The decoding options below are optional.\n * @param {number} [options.inputOffset] The number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position.\n * @param {string} [options.pixelType] (LERC1 only) Default value is F32. Valid pixel types for input are U8/S8/S16/U16/S32/U32/F32.\n * @param {number} [options.noDataValue] (LERC1 only). It is recommended to use the returned mask instead of setting this value.\n * @returns {{width, height, pixels, pixelType, mask, statistics}}\n * @property {number} width Width of decoded image.\n * @property {number} height Height of decoded image.\n * @property {array} pixels [band1, band2, …] Each band is a typed array of width*height.\n * @property {string} pixelType The type of pixels represented in the output.\n * @property {mask} mask Typed array with a size of width*height, or null if all pixels are valid.\n * @property {array} statistics [statistics_band1, statistics_band2, …] Each element is a statistics object representing min and max values\n **/\n decode: function(encodedData, options) {\n if (!isPlatformLittleEndian) {\n throw \"Big endian system is not supported.\";\n }\n options = options || {};\n var inputOffset = options.inputOffset || 0;\n var fileIdView = new Uint8Array(encodedData, inputOffset, 10);\n var fileIdentifierString = String.fromCharCode.apply(null, fileIdView);\n var lerc, majorVersion;\n if (fileIdentifierString.trim() === \"CntZImage\") {\n lerc = LercDecode;\n majorVersion = 1;\n }\n else if (fileIdentifierString.substring(0, 5) === \"Lerc2\") {\n lerc = Lerc2Decode;\n majorVersion = 2;\n }\n else {\n throw \"Unexpected file identifier string: \" + fileIdentifierString;\n }\n\n var iPlane = 0, eof = encodedData.byteLength - 10, encodedMaskData, bandMasks = [], bandMask, maskData;\n var decodedPixelBlock = {\n width: 0,\n height: 0,\n pixels: [],\n pixelType: options.pixelType,\n mask: null,\n statistics: []\n };\n\n while (inputOffset < eof) {\n var result = lerc.decode(encodedData, {\n inputOffset: inputOffset,//for both lerc1 and lerc2\n encodedMaskData: encodedMaskData,//lerc1 only\n maskData: maskData,//lerc2 only\n returnMask: iPlane === 0 ? true : false,//lerc1 only\n returnEncodedMask: iPlane === 0 ? true : false,//lerc1 only\n returnFileInfo: true,//for both lerc1 and lerc2\n pixelType: options.pixelType || null,//lerc1 only\n noDataValue: options.noDataValue || null//lerc1 only\n });\n\n inputOffset = result.fileInfo.eofOffset;\n if (iPlane === 0) {\n encodedMaskData = result.encodedMaskData;//lerc1\n maskData = result.maskData;//lerc2\n decodedPixelBlock.width = result.width;\n decodedPixelBlock.height = result.height;\n decodedPixelBlock.dimCount = result.dimCount || 1;\n //decodedPixelBlock.dimStats = decodedPixelBlock.dimStats;\n decodedPixelBlock.pixelType = result.pixelType || result.fileInfo.pixelType;\n decodedPixelBlock.mask = result.maskData;\n }\n if (majorVersion >1 && result.fileInfo.mask && result.fileInfo.mask.numBytes > 0) {\n bandMasks.push(result.maskData);\n }\n\n iPlane++;\n decodedPixelBlock.pixels.push(result.pixelData);\n decodedPixelBlock.statistics.push({\n minValue: result.minValue,\n maxValue: result.maxValue,\n noDataValue: result.noDataValue,\n dimStats: result.dimStats\n });\n }\n var i, j, numPixels;\n if (majorVersion > 1 && bandMasks.length > 1) {\n numPixels = decodedPixelBlock.width * decodedPixelBlock.height;\n decodedPixelBlock.bandMasks = bandMasks;\n maskData = new Uint8Array(numPixels);\n maskData.set(bandMasks[0]);\n for (i = 1; i < bandMasks.length; i++) {\n bandMask = bandMasks[i];\n for (j = 0; j < numPixels; j++) {\n maskData[j] = maskData[j] & bandMask[j];\n }\n }\n decodedPixelBlock.maskData = maskData;\n }\n\n return decodedPixelBlock;\n }\n };\n\n if (typeof define === \"function\" && define.amd) {/* jshint ignore:line */\n //amd loaders such as dojo and requireJS\n //http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition\n define([], function() { return Lerc; });/* jshint ignore:line */\n }\n else if (typeof module !== \"undefined\" && module.exports) {/* jshint ignore:line */\n //commonJS module 1.0/1.1/1.1.1 systems, such as nodeJS\n //http://wiki.commonjs.org/wiki/Modules\n module.exports = Lerc;/* jshint ignore:line */\n }\n else {\n //assign to this, most likely window\n this.Lerc = Lerc;\n }\n\n})();\n","import Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport HeightmapEncoding from \"../Core/HeightmapEncoding.js\";\r\nimport HeightmapTessellator from \"../Core/HeightmapTessellator.js\";\r\nimport Rectangle from \"../Core/Rectangle.js\";\r\nimport RuntimeError from \"../Core/RuntimeError.js\";\r\nimport Lerc from \"lerc\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nfunction createVerticesFromHeightmap(parameters, transferableObjects) {\r\n // LERC encoded buffers must be decoded, then we can process them like normal\r\n if (parameters.encoding === HeightmapEncoding.LERC) {\r\n let result;\r\n try {\r\n result = Lerc.decode(parameters.heightmap);\r\n } catch (error) {\r\n throw new RuntimeError(error);\r\n }\r\n\r\n const lercStatistics = result.statistics[0];\r\n if (lercStatistics.minValue === Number.MAX_VALUE) {\r\n throw new RuntimeError(\"Invalid tile data\");\r\n }\r\n\r\n parameters.heightmap = result.pixels[0];\r\n parameters.width = result.width;\r\n parameters.height = result.height;\r\n }\r\n\r\n parameters.ellipsoid = Ellipsoid.clone(parameters.ellipsoid);\r\n parameters.rectangle = Rectangle.clone(parameters.rectangle);\r\n\r\n const statistics = HeightmapTessellator.computeVertices(parameters);\r\n const vertices = statistics.vertices;\r\n transferableObjects.push(vertices.buffer);\r\n\r\n return {\r\n vertices: vertices.buffer,\r\n numberOfAttributes: statistics.encoding.stride,\r\n minimumHeight: statistics.minimumHeight,\r\n maximumHeight: statistics.maximumHeight,\r\n gridWidth: parameters.width,\r\n gridHeight: parameters.height,\r\n boundingSphere3D: statistics.boundingSphere3D,\r\n orientedBoundingBox: statistics.orientedBoundingBox,\r\n occludeePointInScaledSpace: statistics.occludeePointInScaledSpace,\r\n encoding: statistics.encoding,\r\n westIndicesSouthToNorth: statistics.westIndicesSouthToNorth,\r\n southIndicesEastToWest: statistics.southIndicesEastToWest,\r\n eastIndicesNorthToSouth: statistics.eastIndicesNorthToSouth,\r\n northIndicesWestToEast: statistics.northIndicesWestToEast,\r\n };\r\n}\r\nexport default createTaskProcessorWorker(createVerticesFromHeightmap);\r\n"],"names":["Cartesian3","Matrix4","defined","DeveloperError","CesiumMath","defaultValue","Ellipsoid","Rectangle","Transforms","WebMercatorProjection","Cartesian2","BoundingSphere","OrientedBoundingBox","EllipsoidalOccluder","AxisAlignedBoundingBox","TerrainEncoding","HeightmapEncoding","RuntimeError","HeightmapTessellator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA,MAAM,iBAAiB,GAAG;EAC1B;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,EAAE,CAAC;AACT;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,EAAE,CAAC;EACT,CAAC,CAAC;AACF,4BAAe,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC;;ECP/C;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC;EACA;EACA;EACA;EACA;EACA;EACA,oBAAoB,CAAC,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;EACvD,EAAE,WAAW,EAAE,GAAG;EAClB,EAAE,YAAY,EAAE,GAAG;EACnB,EAAE,iBAAiB,EAAE,CAAC;EACtB,EAAE,MAAM,EAAE,CAAC;EACX,EAAE,iBAAiB,EAAE,KAAK;EAC1B,EAAE,WAAW,EAAE,KAAK;EACpB,CAAC,CAAC,CAAC;AACH;EACA,MAAM,iBAAiB,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC3C,MAAM,cAAc,GAAG,IAAIC,eAAO,EAAE,CAAC;EACrC,MAAM,cAAc,GAAG,IAAID,kBAAU,EAAE,CAAC;EACxC,MAAM,cAAc,GAAG,IAAIA,kBAAU,EAAE,CAAC;AACxC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,oBAAoB,CAAC,eAAe,GAAG,UAAU,OAAO,EAAE;EAC1D;EACA,EAAE,IAAI,CAACE,oBAAO,CAAC,OAAO,CAAC,IAAI,CAACA,oBAAO,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;EACxD,IAAI,M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;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js b/examples/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js
new file mode 100644
index 0000000..2a2e3fb
--- /dev/null
+++ b/examples/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js
@@ -0,0 +1,1020 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./AxisAlignedBoundingBox-50342d27', './Matrix2-036c77dd', './Matrix3-f22b0303', './defaultValue-0ab18f7d', './TerrainEncoding-c7d764e4', './IndexDatatype-b4e5cf89', './Math-9be8b918', './Check-d10e5f2e', './Transforms-11fb6b0a', './WebMercatorProjection-306f7acc', './createTaskProcessorWorker', './RuntimeError-e5c6a8b9', './AttributeCompression-e9888cb8', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './combine-4598d225'], (function (AxisAlignedBoundingBox, Matrix2, Matrix3, defaultValue, TerrainEncoding, IndexDatatype, Math$1, Check, Transforms, WebMercatorProjection, createTaskProcessorWorker, RuntimeError, AttributeCompression, ComponentDatatype, WebGLConstants, combine) { 'use strict';
+
+ /**
+ * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is
+ * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an
+ * interface and is not intended to be instantiated directly.
+ *
+ * @alias TerrainProvider
+ * @constructor
+ *
+ * @see EllipsoidTerrainProvider
+ * @see CesiumTerrainProvider
+ * @see VRTheWorldTerrainProvider
+ * @see GoogleEarthEnterpriseTerrainProvider
+ */
+ function TerrainProvider() {
+ Check.DeveloperError.throwInstantiationError();
+ }
+
+ Object.defineProperties(TerrainProvider.prototype, {
+ /**
+ * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing
+ * to the event, you will be notified of the error and can potentially recover from it. Event listeners
+ * are passed an instance of {@link TileProviderError}.
+ * @memberof TerrainProvider.prototype
+ * @type {Event}
+ * @readonly
+ */
+ errorEvent: {
+ get: Check.DeveloperError.throwInstantiationError,
+ },
+
+ /**
+ * Gets the credit to display when this terrain provider is active. Typically this is used to credit
+ * the source of the terrain. This function should
+ * not be called before {@link TerrainProvider#ready} returns true.
+ * @memberof TerrainProvider.prototype
+ * @type {Credit}
+ * @readonly
+ */
+ credit: {
+ get: Check.DeveloperError.throwInstantiationError,
+ },
+
+ /**
+ * Gets the tiling scheme used by the provider. This function should
+ * not be called before {@link TerrainProvider#ready} returns true.
+ * @memberof TerrainProvider.prototype
+ * @type {TilingScheme}
+ * @readonly
+ */
+ tilingScheme: {
+ get: Check.DeveloperError.throwInstantiationError,
+ },
+
+ /**
+ * Gets a value indicating whether or not the provider is ready for use.
+ * @memberof TerrainProvider.prototype
+ * @type {Boolean}
+ * @readonly
+ */
+ ready: {
+ get: Check.DeveloperError.throwInstantiationError,
+ },
+
+ /**
+ * Gets a promise that resolves to true when the provider is ready for use.
+ * @memberof TerrainProvider.prototype
+ * @type {Promise.}
+ * @readonly
+ */
+ readyPromise: {
+ get: Check.DeveloperError.throwInstantiationError,
+ },
+
+ /**
+ * Gets a value indicating whether or not the provider includes a water mask. The water mask
+ * indicates which areas of the globe are water rather than land, so they can be rendered
+ * as a reflective surface with animated waves. This function should not be
+ * called before {@link TerrainProvider#ready} returns true.
+ * @memberof TerrainProvider.prototype
+ * @type {Boolean}
+ * @readonly
+ */
+ hasWaterMask: {
+ get: Check.DeveloperError.throwInstantiationError,
+ },
+
+ /**
+ * Gets a value indicating whether or not the requested tiles include vertex normals.
+ * This function should not be called before {@link TerrainProvider#ready} returns true.
+ * @memberof TerrainProvider.prototype
+ * @type {Boolean}
+ * @readonly
+ */
+ hasVertexNormals: {
+ get: Check.DeveloperError.throwInstantiationError,
+ },
+
+ /**
+ * Gets an object that can be used to determine availability of terrain from this provider, such as
+ * at points and in rectangles. This function should not be called before
+ * {@link TerrainProvider#ready} returns true. This property may be undefined if availability
+ * information is not available.
+ * @memberof TerrainProvider.prototype
+ * @type {TileAvailability}
+ * @readonly
+ */
+ availability: {
+ get: Check.DeveloperError.throwInstantiationError,
+ },
+ });
+
+ const regularGridIndicesCache = [];
+
+ /**
+ * Gets a list of indices for a triangle mesh representing a regular grid. Calling
+ * this function multiple times with the same grid width and height returns the
+ * same list of indices. The total number of vertices must be less than or equal
+ * to 65536.
+ *
+ * @param {Number} width The number of vertices in the regular grid in the horizontal direction.
+ * @param {Number} height The number of vertices in the regular grid in the vertical direction.
+ * @returns {Uint16Array|Uint32Array} The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.
+ */
+ TerrainProvider.getRegularGridIndices = function (width, height) {
+ //>>includeStart('debug', pragmas.debug);
+ if (width * height >= Math$1.CesiumMath.FOUR_GIGABYTES) {
+ throw new Check.DeveloperError(
+ "The total number of vertices (width * height) must be less than 4,294,967,296."
+ );
+ }
+ //>>includeEnd('debug');
+
+ let byWidth = regularGridIndicesCache[width];
+ if (!defaultValue.defined(byWidth)) {
+ regularGridIndicesCache[width] = byWidth = [];
+ }
+
+ let indices = byWidth[height];
+ if (!defaultValue.defined(indices)) {
+ if (width * height < Math$1.CesiumMath.SIXTY_FOUR_KILOBYTES) {
+ indices = byWidth[height] = new Uint16Array(
+ (width - 1) * (height - 1) * 6
+ );
+ } else {
+ indices = byWidth[height] = new Uint32Array(
+ (width - 1) * (height - 1) * 6
+ );
+ }
+ addRegularGridIndices(width, height, indices, 0);
+ }
+
+ return indices;
+ };
+
+ const regularGridAndEdgeIndicesCache = [];
+
+ /**
+ * @private
+ */
+ TerrainProvider.getRegularGridIndicesAndEdgeIndices = function (width, height) {
+ //>>includeStart('debug', pragmas.debug);
+ if (width * height >= Math$1.CesiumMath.FOUR_GIGABYTES) {
+ throw new Check.DeveloperError(
+ "The total number of vertices (width * height) must be less than 4,294,967,296."
+ );
+ }
+ //>>includeEnd('debug');
+
+ let byWidth = regularGridAndEdgeIndicesCache[width];
+ if (!defaultValue.defined(byWidth)) {
+ regularGridAndEdgeIndicesCache[width] = byWidth = [];
+ }
+
+ let indicesAndEdges = byWidth[height];
+ if (!defaultValue.defined(indicesAndEdges)) {
+ const indices = TerrainProvider.getRegularGridIndices(width, height);
+
+ const edgeIndices = getEdgeIndices(width, height);
+ const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;
+ const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;
+ const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;
+ const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;
+
+ indicesAndEdges = byWidth[height] = {
+ indices: indices,
+ westIndicesSouthToNorth: westIndicesSouthToNorth,
+ southIndicesEastToWest: southIndicesEastToWest,
+ eastIndicesNorthToSouth: eastIndicesNorthToSouth,
+ northIndicesWestToEast: northIndicesWestToEast,
+ };
+ }
+
+ return indicesAndEdges;
+ };
+
+ const regularGridAndSkirtAndEdgeIndicesCache = [];
+
+ /**
+ * @private
+ */
+ TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices = function (
+ width,
+ height
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (width * height >= Math$1.CesiumMath.FOUR_GIGABYTES) {
+ throw new Check.DeveloperError(
+ "The total number of vertices (width * height) must be less than 4,294,967,296."
+ );
+ }
+ //>>includeEnd('debug');
+
+ let byWidth = regularGridAndSkirtAndEdgeIndicesCache[width];
+ if (!defaultValue.defined(byWidth)) {
+ regularGridAndSkirtAndEdgeIndicesCache[width] = byWidth = [];
+ }
+
+ let indicesAndEdges = byWidth[height];
+ if (!defaultValue.defined(indicesAndEdges)) {
+ const gridVertexCount = width * height;
+ const gridIndexCount = (width - 1) * (height - 1) * 6;
+ const edgeVertexCount = width * 2 + height * 2;
+ const edgeIndexCount = Math.max(0, edgeVertexCount - 4) * 6;
+ const vertexCount = gridVertexCount + edgeVertexCount;
+ const indexCount = gridIndexCount + edgeIndexCount;
+
+ const edgeIndices = getEdgeIndices(width, height);
+ const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;
+ const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;
+ const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;
+ const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;
+
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(vertexCount, indexCount);
+ addRegularGridIndices(width, height, indices, 0);
+ TerrainProvider.addSkirtIndices(
+ westIndicesSouthToNorth,
+ southIndicesEastToWest,
+ eastIndicesNorthToSouth,
+ northIndicesWestToEast,
+ gridVertexCount,
+ indices,
+ gridIndexCount
+ );
+
+ indicesAndEdges = byWidth[height] = {
+ indices: indices,
+ westIndicesSouthToNorth: westIndicesSouthToNorth,
+ southIndicesEastToWest: southIndicesEastToWest,
+ eastIndicesNorthToSouth: eastIndicesNorthToSouth,
+ northIndicesWestToEast: northIndicesWestToEast,
+ indexCountWithoutSkirts: gridIndexCount,
+ };
+ }
+
+ return indicesAndEdges;
+ };
+
+ /**
+ * @private
+ */
+ TerrainProvider.addSkirtIndices = function (
+ westIndicesSouthToNorth,
+ southIndicesEastToWest,
+ eastIndicesNorthToSouth,
+ northIndicesWestToEast,
+ vertexCount,
+ indices,
+ offset
+ ) {
+ let vertexIndex = vertexCount;
+ offset = addSkirtIndices(
+ westIndicesSouthToNorth,
+ vertexIndex,
+ indices,
+ offset
+ );
+ vertexIndex += westIndicesSouthToNorth.length;
+ offset = addSkirtIndices(
+ southIndicesEastToWest,
+ vertexIndex,
+ indices,
+ offset
+ );
+ vertexIndex += southIndicesEastToWest.length;
+ offset = addSkirtIndices(
+ eastIndicesNorthToSouth,
+ vertexIndex,
+ indices,
+ offset
+ );
+ vertexIndex += eastIndicesNorthToSouth.length;
+ addSkirtIndices(northIndicesWestToEast, vertexIndex, indices, offset);
+ };
+
+ function getEdgeIndices(width, height) {
+ const westIndicesSouthToNorth = new Array(height);
+ const southIndicesEastToWest = new Array(width);
+ const eastIndicesNorthToSouth = new Array(height);
+ const northIndicesWestToEast = new Array(width);
+
+ let i;
+ for (i = 0; i < width; ++i) {
+ northIndicesWestToEast[i] = i;
+ southIndicesEastToWest[i] = width * height - 1 - i;
+ }
+
+ for (i = 0; i < height; ++i) {
+ eastIndicesNorthToSouth[i] = (i + 1) * width - 1;
+ westIndicesSouthToNorth[i] = (height - i - 1) * width;
+ }
+
+ return {
+ westIndicesSouthToNorth: westIndicesSouthToNorth,
+ southIndicesEastToWest: southIndicesEastToWest,
+ eastIndicesNorthToSouth: eastIndicesNorthToSouth,
+ northIndicesWestToEast: northIndicesWestToEast,
+ };
+ }
+
+ function addRegularGridIndices(width, height, indices, offset) {
+ let index = 0;
+ for (let j = 0; j < height - 1; ++j) {
+ for (let i = 0; i < width - 1; ++i) {
+ const upperLeft = index;
+ const lowerLeft = upperLeft + width;
+ const lowerRight = lowerLeft + 1;
+ const upperRight = upperLeft + 1;
+
+ indices[offset++] = upperLeft;
+ indices[offset++] = lowerLeft;
+ indices[offset++] = upperRight;
+ indices[offset++] = upperRight;
+ indices[offset++] = lowerLeft;
+ indices[offset++] = lowerRight;
+
+ ++index;
+ }
+ ++index;
+ }
+ }
+
+ function addSkirtIndices(edgeIndices, vertexIndex, indices, offset) {
+ let previousIndex = edgeIndices[0];
+
+ const length = edgeIndices.length;
+ for (let i = 1; i < length; ++i) {
+ const index = edgeIndices[i];
+
+ indices[offset++] = previousIndex;
+ indices[offset++] = index;
+ indices[offset++] = vertexIndex;
+
+ indices[offset++] = vertexIndex;
+ indices[offset++] = index;
+ indices[offset++] = vertexIndex + 1;
+
+ previousIndex = index;
+ ++vertexIndex;
+ }
+
+ return offset;
+ }
+
+ /**
+ * Specifies the quality of terrain created from heightmaps. A value of 1.0 will
+ * ensure that adjacent heightmap vertices are separated by no more than
+ * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly.
+ * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the
+ * screen pixels between adjacent heightmap vertices and thus rendering more quickly.
+ * @type {Number}
+ */
+ TerrainProvider.heightmapTerrainQuality = 0.25;
+
+ /**
+ * Determines an appropriate geometric error estimate when the geometry comes from a heightmap.
+ *
+ * @param {Ellipsoid} ellipsoid The ellipsoid to which the terrain is attached.
+ * @param {Number} tileImageWidth The width, in pixels, of the heightmap associated with a single tile.
+ * @param {Number} numberOfTilesAtLevelZero The number of tiles in the horizontal direction at tile level zero.
+ * @returns {Number} An estimated geometric error.
+ */
+ TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap = function (
+ ellipsoid,
+ tileImageWidth,
+ numberOfTilesAtLevelZero
+ ) {
+ return (
+ (ellipsoid.maximumRadius *
+ 2 *
+ Math.PI *
+ TerrainProvider.heightmapTerrainQuality) /
+ (tileImageWidth * numberOfTilesAtLevelZero)
+ );
+ };
+
+ /**
+ * Requests the geometry for a given tile. This function should not be called before
+ * {@link TerrainProvider#ready} returns true. The result must include terrain data and
+ * may optionally include a water mask and an indication of which child tiles are available.
+ * @function
+ *
+ * @param {Number} x The X coordinate of the tile for which to request geometry.
+ * @param {Number} y The Y coordinate of the tile for which to request geometry.
+ * @param {Number} level The level of the tile for which to request geometry.
+ * @param {Request} [request] The request object. Intended for internal use only.
+ *
+ * @returns {Promise.|undefined} A promise for the requested geometry. If this method
+ * returns undefined instead of a promise, it is an indication that too many requests are already
+ * pending and the request will be retried later.
+ */
+ TerrainProvider.prototype.requestTileGeometry =
+ Check.DeveloperError.throwInstantiationError;
+
+ /**
+ * Gets the maximum geometric error allowed in a tile at a given level. This function should not be
+ * called before {@link TerrainProvider#ready} returns true.
+ * @function
+ *
+ * @param {Number} level The tile level for which to get the maximum geometric error.
+ * @returns {Number} The maximum geometric error.
+ */
+ TerrainProvider.prototype.getLevelMaximumGeometricError =
+ Check.DeveloperError.throwInstantiationError;
+
+ /**
+ * Determines whether data for a tile is available to be loaded.
+ * @function
+ *
+ * @param {Number} x The X coordinate of the tile for which to request geometry.
+ * @param {Number} y The Y coordinate of the tile for which to request geometry.
+ * @param {Number} level The level of the tile for which to request geometry.
+ * @returns {Boolean|undefined} Undefined if not supported by the terrain provider, otherwise true or false.
+ */
+ TerrainProvider.prototype.getTileDataAvailable =
+ Check.DeveloperError.throwInstantiationError;
+
+ /**
+ * Makes sure we load availability data for a tile
+ * @function
+ *
+ * @param {Number} x The X coordinate of the tile for which to request geometry.
+ * @param {Number} y The Y coordinate of the tile for which to request geometry.
+ * @param {Number} level The level of the tile for which to request geometry.
+ * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
+ */
+ TerrainProvider.prototype.loadTileDataAvailability =
+ Check.DeveloperError.throwInstantiationError;
+
+ /**
+ * A function that is called when an error occurs.
+ * @callback TerrainProvider.ErrorEvent
+ *
+ * @this TerrainProvider
+ * @param {TileProviderError} err An object holding details about the error that occurred.
+ */
+
+ const maxShort = 32767;
+
+ const cartesian3Scratch = new Matrix3.Cartesian3();
+ const scratchMinimum = new Matrix3.Cartesian3();
+ const scratchMaximum = new Matrix3.Cartesian3();
+ const cartographicScratch = new Matrix3.Cartographic();
+ const toPack = new Matrix2.Cartesian2();
+
+ function createVerticesFromQuantizedTerrainMesh(
+ parameters,
+ transferableObjects
+ ) {
+ const quantizedVertices = parameters.quantizedVertices;
+ const quantizedVertexCount = quantizedVertices.length / 3;
+ const octEncodedNormals = parameters.octEncodedNormals;
+ const edgeVertexCount =
+ parameters.westIndices.length +
+ parameters.eastIndices.length +
+ parameters.southIndices.length +
+ parameters.northIndices.length;
+ const includeWebMercatorT = parameters.includeWebMercatorT;
+
+ const exaggeration = parameters.exaggeration;
+ const exaggerationRelativeHeight = parameters.exaggerationRelativeHeight;
+ const hasExaggeration = exaggeration !== 1.0;
+ const includeGeodeticSurfaceNormals = hasExaggeration;
+
+ const rectangle = Matrix2.Rectangle.clone(parameters.rectangle);
+ const west = rectangle.west;
+ const south = rectangle.south;
+ const east = rectangle.east;
+ const north = rectangle.north;
+
+ const ellipsoid = Matrix3.Ellipsoid.clone(parameters.ellipsoid);
+
+ const minimumHeight = parameters.minimumHeight;
+ const maximumHeight = parameters.maximumHeight;
+
+ const center = parameters.relativeToCenter;
+ const fromENU = Transforms.Transforms.eastNorthUpToFixedFrame(center, ellipsoid);
+ const toENU = Matrix2.Matrix4.inverseTransformation(fromENU, new Matrix2.Matrix4());
+
+ let southMercatorY;
+ let oneOverMercatorHeight;
+ if (includeWebMercatorT) {
+ southMercatorY = WebMercatorProjection.WebMercatorProjection.geodeticLatitudeToMercatorAngle(
+ south
+ );
+ oneOverMercatorHeight =
+ 1.0 /
+ (WebMercatorProjection.WebMercatorProjection.geodeticLatitudeToMercatorAngle(north) -
+ southMercatorY);
+ }
+
+ const uBuffer = quantizedVertices.subarray(0, quantizedVertexCount);
+ const vBuffer = quantizedVertices.subarray(
+ quantizedVertexCount,
+ 2 * quantizedVertexCount
+ );
+ const heightBuffer = quantizedVertices.subarray(
+ quantizedVertexCount * 2,
+ 3 * quantizedVertexCount
+ );
+ const hasVertexNormals = defaultValue.defined(octEncodedNormals);
+
+ const uvs = new Array(quantizedVertexCount);
+ const heights = new Array(quantizedVertexCount);
+ const positions = new Array(quantizedVertexCount);
+ const webMercatorTs = includeWebMercatorT
+ ? new Array(quantizedVertexCount)
+ : [];
+ const geodeticSurfaceNormals = includeGeodeticSurfaceNormals
+ ? new Array(quantizedVertexCount)
+ : [];
+
+ const minimum = scratchMinimum;
+ minimum.x = Number.POSITIVE_INFINITY;
+ minimum.y = Number.POSITIVE_INFINITY;
+ minimum.z = Number.POSITIVE_INFINITY;
+
+ const maximum = scratchMaximum;
+ maximum.x = Number.NEGATIVE_INFINITY;
+ maximum.y = Number.NEGATIVE_INFINITY;
+ maximum.z = Number.NEGATIVE_INFINITY;
+
+ let minLongitude = Number.POSITIVE_INFINITY;
+ let maxLongitude = Number.NEGATIVE_INFINITY;
+ let minLatitude = Number.POSITIVE_INFINITY;
+ let maxLatitude = Number.NEGATIVE_INFINITY;
+
+ for (let i = 0; i < quantizedVertexCount; ++i) {
+ const rawU = uBuffer[i];
+ const rawV = vBuffer[i];
+
+ const u = rawU / maxShort;
+ const v = rawV / maxShort;
+ const height = Math$1.CesiumMath.lerp(
+ minimumHeight,
+ maximumHeight,
+ heightBuffer[i] / maxShort
+ );
+
+ cartographicScratch.longitude = Math$1.CesiumMath.lerp(west, east, u);
+ cartographicScratch.latitude = Math$1.CesiumMath.lerp(south, north, v);
+ cartographicScratch.height = height;
+
+ minLongitude = Math.min(cartographicScratch.longitude, minLongitude);
+ maxLongitude = Math.max(cartographicScratch.longitude, maxLongitude);
+ minLatitude = Math.min(cartographicScratch.latitude, minLatitude);
+ maxLatitude = Math.max(cartographicScratch.latitude, maxLatitude);
+
+ const position = ellipsoid.cartographicToCartesian(cartographicScratch);
+
+ uvs[i] = new Matrix2.Cartesian2(u, v);
+ heights[i] = height;
+ positions[i] = position;
+
+ if (includeWebMercatorT) {
+ webMercatorTs[i] =
+ (WebMercatorProjection.WebMercatorProjection.geodeticLatitudeToMercatorAngle(
+ cartographicScratch.latitude
+ ) -
+ southMercatorY) *
+ oneOverMercatorHeight;
+ }
+
+ if (includeGeodeticSurfaceNormals) {
+ geodeticSurfaceNormals[i] = ellipsoid.geodeticSurfaceNormal(position);
+ }
+
+ Matrix2.Matrix4.multiplyByPoint(toENU, position, cartesian3Scratch);
+
+ Matrix3.Cartesian3.minimumByComponent(cartesian3Scratch, minimum, minimum);
+ Matrix3.Cartesian3.maximumByComponent(cartesian3Scratch, maximum, maximum);
+ }
+
+ const westIndicesSouthToNorth = copyAndSort(parameters.westIndices, function (
+ a,
+ b
+ ) {
+ return uvs[a].y - uvs[b].y;
+ });
+ const eastIndicesNorthToSouth = copyAndSort(parameters.eastIndices, function (
+ a,
+ b
+ ) {
+ return uvs[b].y - uvs[a].y;
+ });
+ const southIndicesEastToWest = copyAndSort(parameters.southIndices, function (
+ a,
+ b
+ ) {
+ return uvs[b].x - uvs[a].x;
+ });
+ const northIndicesWestToEast = copyAndSort(parameters.northIndices, function (
+ a,
+ b
+ ) {
+ return uvs[a].x - uvs[b].x;
+ });
+
+ let occludeePointInScaledSpace;
+ if (minimumHeight < 0.0) {
+ // Horizon culling point needs to be recomputed since the tile is at least partly under the ellipsoid.
+ const occluder = new TerrainEncoding.EllipsoidalOccluder(ellipsoid);
+ occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid(
+ center,
+ positions,
+ minimumHeight
+ );
+ }
+
+ let hMin = minimumHeight;
+ hMin = Math.min(
+ hMin,
+ findMinMaxSkirts(
+ parameters.westIndices,
+ parameters.westSkirtHeight,
+ heights,
+ uvs,
+ rectangle,
+ ellipsoid,
+ toENU,
+ minimum,
+ maximum
+ )
+ );
+ hMin = Math.min(
+ hMin,
+ findMinMaxSkirts(
+ parameters.southIndices,
+ parameters.southSkirtHeight,
+ heights,
+ uvs,
+ rectangle,
+ ellipsoid,
+ toENU,
+ minimum,
+ maximum
+ )
+ );
+ hMin = Math.min(
+ hMin,
+ findMinMaxSkirts(
+ parameters.eastIndices,
+ parameters.eastSkirtHeight,
+ heights,
+ uvs,
+ rectangle,
+ ellipsoid,
+ toENU,
+ minimum,
+ maximum
+ )
+ );
+ hMin = Math.min(
+ hMin,
+ findMinMaxSkirts(
+ parameters.northIndices,
+ parameters.northSkirtHeight,
+ heights,
+ uvs,
+ rectangle,
+ ellipsoid,
+ toENU,
+ minimum,
+ maximum
+ )
+ );
+
+ const aaBox = new AxisAlignedBoundingBox.AxisAlignedBoundingBox(minimum, maximum, center);
+ const encoding = new TerrainEncoding.TerrainEncoding(
+ center,
+ aaBox,
+ hMin,
+ maximumHeight,
+ fromENU,
+ hasVertexNormals,
+ includeWebMercatorT,
+ includeGeodeticSurfaceNormals,
+ exaggeration,
+ exaggerationRelativeHeight
+ );
+ const vertexStride = encoding.stride;
+ const size =
+ quantizedVertexCount * vertexStride + edgeVertexCount * vertexStride;
+ const vertexBuffer = new Float32Array(size);
+
+ let bufferIndex = 0;
+ for (let j = 0; j < quantizedVertexCount; ++j) {
+ if (hasVertexNormals) {
+ const n = j * 2.0;
+ toPack.x = octEncodedNormals[n];
+ toPack.y = octEncodedNormals[n + 1];
+ }
+
+ bufferIndex = encoding.encode(
+ vertexBuffer,
+ bufferIndex,
+ positions[j],
+ uvs[j],
+ heights[j],
+ toPack,
+ webMercatorTs[j],
+ geodeticSurfaceNormals[j]
+ );
+ }
+
+ const edgeTriangleCount = Math.max(0, (edgeVertexCount - 4) * 2);
+ const indexBufferLength = parameters.indices.length + edgeTriangleCount * 3;
+ const indexBuffer = IndexDatatype.IndexDatatype.createTypedArray(
+ quantizedVertexCount + edgeVertexCount,
+ indexBufferLength
+ );
+ indexBuffer.set(parameters.indices, 0);
+
+ const percentage = 0.0001;
+ const lonOffset = (maxLongitude - minLongitude) * percentage;
+ const latOffset = (maxLatitude - minLatitude) * percentage;
+ const westLongitudeOffset = -lonOffset;
+ const westLatitudeOffset = 0.0;
+ const eastLongitudeOffset = lonOffset;
+ const eastLatitudeOffset = 0.0;
+ const northLongitudeOffset = 0.0;
+ const northLatitudeOffset = latOffset;
+ const southLongitudeOffset = 0.0;
+ const southLatitudeOffset = -latOffset;
+
+ // Add skirts.
+ let vertexBufferIndex = quantizedVertexCount * vertexStride;
+ addSkirt(
+ vertexBuffer,
+ vertexBufferIndex,
+ westIndicesSouthToNorth,
+ encoding,
+ heights,
+ uvs,
+ octEncodedNormals,
+ ellipsoid,
+ rectangle,
+ parameters.westSkirtHeight,
+ southMercatorY,
+ oneOverMercatorHeight,
+ westLongitudeOffset,
+ westLatitudeOffset
+ );
+ vertexBufferIndex += parameters.westIndices.length * vertexStride;
+ addSkirt(
+ vertexBuffer,
+ vertexBufferIndex,
+ southIndicesEastToWest,
+ encoding,
+ heights,
+ uvs,
+ octEncodedNormals,
+ ellipsoid,
+ rectangle,
+ parameters.southSkirtHeight,
+ southMercatorY,
+ oneOverMercatorHeight,
+ southLongitudeOffset,
+ southLatitudeOffset
+ );
+ vertexBufferIndex += parameters.southIndices.length * vertexStride;
+ addSkirt(
+ vertexBuffer,
+ vertexBufferIndex,
+ eastIndicesNorthToSouth,
+ encoding,
+ heights,
+ uvs,
+ octEncodedNormals,
+ ellipsoid,
+ rectangle,
+ parameters.eastSkirtHeight,
+ southMercatorY,
+ oneOverMercatorHeight,
+ eastLongitudeOffset,
+ eastLatitudeOffset
+ );
+ vertexBufferIndex += parameters.eastIndices.length * vertexStride;
+ addSkirt(
+ vertexBuffer,
+ vertexBufferIndex,
+ northIndicesWestToEast,
+ encoding,
+ heights,
+ uvs,
+ octEncodedNormals,
+ ellipsoid,
+ rectangle,
+ parameters.northSkirtHeight,
+ southMercatorY,
+ oneOverMercatorHeight,
+ northLongitudeOffset,
+ northLatitudeOffset
+ );
+
+ TerrainProvider.addSkirtIndices(
+ westIndicesSouthToNorth,
+ southIndicesEastToWest,
+ eastIndicesNorthToSouth,
+ northIndicesWestToEast,
+ quantizedVertexCount,
+ indexBuffer,
+ parameters.indices.length
+ );
+
+ transferableObjects.push(vertexBuffer.buffer, indexBuffer.buffer);
+
+ return {
+ vertices: vertexBuffer.buffer,
+ indices: indexBuffer.buffer,
+ westIndicesSouthToNorth: westIndicesSouthToNorth,
+ southIndicesEastToWest: southIndicesEastToWest,
+ eastIndicesNorthToSouth: eastIndicesNorthToSouth,
+ northIndicesWestToEast: northIndicesWestToEast,
+ vertexStride: vertexStride,
+ center: center,
+ minimumHeight: minimumHeight,
+ maximumHeight: maximumHeight,
+ occludeePointInScaledSpace: occludeePointInScaledSpace,
+ encoding: encoding,
+ indexCountWithoutSkirts: parameters.indices.length,
+ };
+ }
+
+ function findMinMaxSkirts(
+ edgeIndices,
+ edgeHeight,
+ heights,
+ uvs,
+ rectangle,
+ ellipsoid,
+ toENU,
+ minimum,
+ maximum
+ ) {
+ let hMin = Number.POSITIVE_INFINITY;
+
+ const north = rectangle.north;
+ const south = rectangle.south;
+ let east = rectangle.east;
+ const west = rectangle.west;
+
+ if (east < west) {
+ east += Math$1.CesiumMath.TWO_PI;
+ }
+
+ const length = edgeIndices.length;
+ for (let i = 0; i < length; ++i) {
+ const index = edgeIndices[i];
+ const h = heights[index];
+ const uv = uvs[index];
+
+ cartographicScratch.longitude = Math$1.CesiumMath.lerp(west, east, uv.x);
+ cartographicScratch.latitude = Math$1.CesiumMath.lerp(south, north, uv.y);
+ cartographicScratch.height = h - edgeHeight;
+
+ const position = ellipsoid.cartographicToCartesian(
+ cartographicScratch,
+ cartesian3Scratch
+ );
+ Matrix2.Matrix4.multiplyByPoint(toENU, position, position);
+
+ Matrix3.Cartesian3.minimumByComponent(position, minimum, minimum);
+ Matrix3.Cartesian3.maximumByComponent(position, maximum, maximum);
+
+ hMin = Math.min(hMin, cartographicScratch.height);
+ }
+ return hMin;
+ }
+
+ function addSkirt(
+ vertexBuffer,
+ vertexBufferIndex,
+ edgeVertices,
+ encoding,
+ heights,
+ uvs,
+ octEncodedNormals,
+ ellipsoid,
+ rectangle,
+ skirtLength,
+ southMercatorY,
+ oneOverMercatorHeight,
+ longitudeOffset,
+ latitudeOffset
+ ) {
+ const hasVertexNormals = defaultValue.defined(octEncodedNormals);
+
+ const north = rectangle.north;
+ const south = rectangle.south;
+ let east = rectangle.east;
+ const west = rectangle.west;
+
+ if (east < west) {
+ east += Math$1.CesiumMath.TWO_PI;
+ }
+
+ const length = edgeVertices.length;
+ for (let i = 0; i < length; ++i) {
+ const index = edgeVertices[i];
+ const h = heights[index];
+ const uv = uvs[index];
+
+ cartographicScratch.longitude =
+ Math$1.CesiumMath.lerp(west, east, uv.x) + longitudeOffset;
+ cartographicScratch.latitude =
+ Math$1.CesiumMath.lerp(south, north, uv.y) + latitudeOffset;
+ cartographicScratch.height = h - skirtLength;
+
+ const position = ellipsoid.cartographicToCartesian(
+ cartographicScratch,
+ cartesian3Scratch
+ );
+
+ if (hasVertexNormals) {
+ const n = index * 2.0;
+ toPack.x = octEncodedNormals[n];
+ toPack.y = octEncodedNormals[n + 1];
+ }
+
+ let webMercatorT;
+ if (encoding.hasWebMercatorT) {
+ webMercatorT =
+ (WebMercatorProjection.WebMercatorProjection.geodeticLatitudeToMercatorAngle(
+ cartographicScratch.latitude
+ ) -
+ southMercatorY) *
+ oneOverMercatorHeight;
+ }
+
+ let geodeticSurfaceNormal;
+ if (encoding.hasGeodeticSurfaceNormals) {
+ geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal(position);
+ }
+
+ vertexBufferIndex = encoding.encode(
+ vertexBuffer,
+ vertexBufferIndex,
+ position,
+ uv,
+ cartographicScratch.height,
+ toPack,
+ webMercatorT,
+ geodeticSurfaceNormal
+ );
+ }
+ }
+
+ function copyAndSort(typedArray, comparator) {
+ let copy;
+ if (typeof typedArray.slice === "function") {
+ copy = typedArray.slice();
+ if (typeof copy.sort !== "function") {
+ // Sliced typed array isn't sortable, so we can't use it.
+ copy = undefined;
+ }
+ }
+
+ if (!defaultValue.defined(copy)) {
+ copy = Array.prototype.slice.call(typedArray);
+ }
+
+ copy.sort(comparator);
+
+ return copy;
+ }
+ var createVerticesFromQuantizedTerrainMesh$1 = createTaskProcessorWorker(
+ createVerticesFromQuantizedTerrainMesh
+ );
+
+ return createVerticesFromQuantizedTerrainMesh$1;
+
+}));
+//# sourceMappingURL=createVerticesFromQuantizedTerrainMesh.js.map
diff --git a/examples/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js.map b/examples/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js.map
new file mode 100644
index 0000000..86edbb3
--- /dev/null
+++ b/examples/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createVerticesFromQuantizedTerrainMesh.js","sources":["../../../Source/Core/TerrainProvider.js","../../../Source/WorkersES6/createVerticesFromQuantizedTerrainMesh.js"],"sourcesContent":["import defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\n\r\n/**\r\n * Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is\r\n * organized into a pyramid of tiles according to a {@link TilingScheme}. This type describes an\r\n * interface and is not intended to be instantiated directly.\r\n *\r\n * @alias TerrainProvider\r\n * @constructor\r\n *\r\n * @see EllipsoidTerrainProvider\r\n * @see CesiumTerrainProvider\r\n * @see VRTheWorldTerrainProvider\r\n * @see GoogleEarthEnterpriseTerrainProvider\r\n */\r\nfunction TerrainProvider() {\r\n DeveloperError.throwInstantiationError();\r\n}\r\n\r\nObject.defineProperties(TerrainProvider.prototype, {\r\n /**\r\n * Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing\r\n * to the event, you will be notified of the error and can potentially recover from it. Event listeners\r\n * are passed an instance of {@link TileProviderError}.\r\n * @memberof TerrainProvider.prototype\r\n * @type {Event}\r\n * @readonly\r\n */\r\n errorEvent: {\r\n get: DeveloperError.throwInstantiationError,\r\n },\r\n\r\n /**\r\n * Gets the credit to display when this terrain provider is active. Typically this is used to credit\r\n * the source of the terrain. This function should\r\n * not be called before {@link TerrainProvider#ready} returns true.\r\n * @memberof TerrainProvider.prototype\r\n * @type {Credit}\r\n * @readonly\r\n */\r\n credit: {\r\n get: DeveloperError.throwInstantiationError,\r\n },\r\n\r\n /**\r\n * Gets the tiling scheme used by the provider. This function should\r\n * not be called before {@link TerrainProvider#ready} returns true.\r\n * @memberof TerrainProvider.prototype\r\n * @type {TilingScheme}\r\n * @readonly\r\n */\r\n tilingScheme: {\r\n get: DeveloperError.throwInstantiationError,\r\n },\r\n\r\n /**\r\n * Gets a value indicating whether or not the provider is ready for use.\r\n * @memberof TerrainProvider.prototype\r\n * @type {Boolean}\r\n * @readonly\r\n */\r\n ready: {\r\n get: DeveloperError.throwInstantiationError,\r\n },\r\n\r\n /**\r\n * Gets a promise that resolves to true when the provider is ready for use.\r\n * @memberof TerrainProvider.prototype\r\n * @type {Promise.}\r\n * @readonly\r\n */\r\n readyPromise: {\r\n get: DeveloperError.throwInstantiationError,\r\n },\r\n\r\n /**\r\n * Gets a value indicating whether or not the provider includes a water mask. The water mask\r\n * indicates which areas of the globe are water rather than land, so they can be rendered\r\n * as a reflective surface with animated waves. This function should not be\r\n * called before {@link TerrainProvider#ready} returns true.\r\n * @memberof TerrainProvider.prototype\r\n * @type {Boolean}\r\n * @readonly\r\n */\r\n hasWaterMask: {\r\n get: DeveloperError.throwInstantiationError,\r\n },\r\n\r\n /**\r\n * Gets a value indicating whether or not the requested tiles include vertex normals.\r\n * This function should not be called before {@link TerrainProvider#ready} returns true.\r\n * @memberof TerrainProvider.prototype\r\n * @type {Boolean}\r\n * @readonly\r\n */\r\n hasVertexNormals: {\r\n get: DeveloperError.throwInstantiationError,\r\n },\r\n\r\n /**\r\n * Gets an object that can be used to determine availability of terrain from this provider, such as\r\n * at points and in rectangles. This function should not be called before\r\n * {@link TerrainProvider#ready} returns true. This property may be undefined if availability\r\n * information is not available.\r\n * @memberof TerrainProvider.prototype\r\n * @type {TileAvailability}\r\n * @readonly\r\n */\r\n availability: {\r\n get: DeveloperError.throwInstantiationError,\r\n },\r\n});\r\n\r\nconst regularGridIndicesCache = [];\r\n\r\n/**\r\n * Gets a list of indices for a triangle mesh representing a regular grid. Calling\r\n * this function multiple times with the same grid width and height returns the\r\n * same list of indices. The total number of vertices must be less than or equal\r\n * to 65536.\r\n *\r\n * @param {Number} width The number of vertices in the regular grid in the horizontal direction.\r\n * @param {Number} height The number of vertices in the regular grid in the vertical direction.\r\n * @returns {Uint16Array|Uint32Array} The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.\r\n */\r\nTerrainProvider.getRegularGridIndices = function (width, height) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (width * height >= CesiumMath.FOUR_GIGABYTES) {\r\n throw new DeveloperError(\r\n \"The total number of vertices (width * height) must be less than 4,294,967,296.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n let byWidth = regularGridIndicesCache[width];\r\n if (!defined(byWidth)) {\r\n regularGridIndicesCache[width] = byWidth = [];\r\n }\r\n\r\n let indices = byWidth[height];\r\n if (!defined(indices)) {\r\n if (width * height < CesiumMath.SIXTY_FOUR_KILOBYTES) {\r\n indices = byWidth[height] = new Uint16Array(\r\n (width - 1) * (height - 1) * 6\r\n );\r\n } else {\r\n indices = byWidth[height] = new Uint32Array(\r\n (width - 1) * (height - 1) * 6\r\n );\r\n }\r\n addRegularGridIndices(width, height, indices, 0);\r\n }\r\n\r\n return indices;\r\n};\r\n\r\nconst regularGridAndEdgeIndicesCache = [];\r\n\r\n/**\r\n * @private\r\n */\r\nTerrainProvider.getRegularGridIndicesAndEdgeIndices = function (width, height) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (width * height >= CesiumMath.FOUR_GIGABYTES) {\r\n throw new DeveloperError(\r\n \"The total number of vertices (width * height) must be less than 4,294,967,296.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n let byWidth = regularGridAndEdgeIndicesCache[width];\r\n if (!defined(byWidth)) {\r\n regularGridAndEdgeIndicesCache[width] = byWidth = [];\r\n }\r\n\r\n let indicesAndEdges = byWidth[height];\r\n if (!defined(indicesAndEdges)) {\r\n const indices = TerrainProvider.getRegularGridIndices(width, height);\r\n\r\n const edgeIndices = getEdgeIndices(width, height);\r\n const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;\r\n const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;\r\n const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;\r\n const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;\r\n\r\n indicesAndEdges = byWidth[height] = {\r\n indices: indices,\r\n westIndicesSouthToNorth: westIndicesSouthToNorth,\r\n southIndicesEastToWest: southIndicesEastToWest,\r\n eastIndicesNorthToSouth: eastIndicesNorthToSouth,\r\n northIndicesWestToEast: northIndicesWestToEast,\r\n };\r\n }\r\n\r\n return indicesAndEdges;\r\n};\r\n\r\nconst regularGridAndSkirtAndEdgeIndicesCache = [];\r\n\r\n/**\r\n * @private\r\n */\r\nTerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices = function (\r\n width,\r\n height\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (width * height >= CesiumMath.FOUR_GIGABYTES) {\r\n throw new DeveloperError(\r\n \"The total number of vertices (width * height) must be less than 4,294,967,296.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n let byWidth = regularGridAndSkirtAndEdgeIndicesCache[width];\r\n if (!defined(byWidth)) {\r\n regularGridAndSkirtAndEdgeIndicesCache[width] = byWidth = [];\r\n }\r\n\r\n let indicesAndEdges = byWidth[height];\r\n if (!defined(indicesAndEdges)) {\r\n const gridVertexCount = width * height;\r\n const gridIndexCount = (width - 1) * (height - 1) * 6;\r\n const edgeVertexCount = width * 2 + height * 2;\r\n const edgeIndexCount = Math.max(0, edgeVertexCount - 4) * 6;\r\n const vertexCount = gridVertexCount + edgeVertexCount;\r\n const indexCount = gridIndexCount + edgeIndexCount;\r\n\r\n const edgeIndices = getEdgeIndices(width, height);\r\n const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;\r\n const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;\r\n const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;\r\n const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;\r\n\r\n const indices = IndexDatatype.createTypedArray(vertexCount, indexCount);\r\n addRegularGridIndices(width, height, indices, 0);\r\n TerrainProvider.addSkirtIndices(\r\n westIndicesSouthToNorth,\r\n southIndicesEastToWest,\r\n eastIndicesNorthToSouth,\r\n northIndicesWestToEast,\r\n gridVertexCount,\r\n indices,\r\n gridIndexCount\r\n );\r\n\r\n indicesAndEdges = byWidth[height] = {\r\n indices: indices,\r\n westIndicesSouthToNorth: westIndicesSouthToNorth,\r\n southIndicesEastToWest: southIndicesEastToWest,\r\n eastIndicesNorthToSouth: eastIndicesNorthToSouth,\r\n northIndicesWestToEast: northIndicesWestToEast,\r\n indexCountWithoutSkirts: gridIndexCount,\r\n };\r\n }\r\n\r\n return indicesAndEdges;\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nTerrainProvider.addSkirtIndices = function (\r\n westIndicesSouthToNorth,\r\n southIndicesEastToWest,\r\n eastIndicesNorthToSouth,\r\n northIndicesWestToEast,\r\n vertexCount,\r\n indices,\r\n offset\r\n) {\r\n let vertexIndex = vertexCount;\r\n offset = addSkirtIndices(\r\n westIndicesSouthToNorth,\r\n vertexIndex,\r\n indices,\r\n offset\r\n );\r\n vertexIndex += westIndicesSouthToNorth.length;\r\n offset = addSkirtIndices(\r\n southIndicesEastToWest,\r\n vertexIndex,\r\n indices,\r\n offset\r\n );\r\n vertexIndex += southIndicesEastToWest.length;\r\n offset = addSkirtIndices(\r\n eastIndicesNorthToSouth,\r\n vertexIndex,\r\n indices,\r\n offset\r\n );\r\n vertexIndex += eastIndicesNorthToSouth.length;\r\n addSkirtIndices(northIndicesWestToEast, vertexIndex, indices, offset);\r\n};\r\n\r\nfunction getEdgeIndices(width, height) {\r\n const westIndicesSouthToNorth = new Array(height);\r\n const southIndicesEastToWest = new Array(width);\r\n const eastIndicesNorthToSouth = new Array(height);\r\n const northIndicesWestToEast = new Array(width);\r\n\r\n let i;\r\n for (i = 0; i < width; ++i) {\r\n northIndicesWestToEast[i] = i;\r\n southIndicesEastToWest[i] = width * height - 1 - i;\r\n }\r\n\r\n for (i = 0; i < height; ++i) {\r\n eastIndicesNorthToSouth[i] = (i + 1) * width - 1;\r\n westIndicesSouthToNorth[i] = (height - i - 1) * width;\r\n }\r\n\r\n return {\r\n westIndicesSouthToNorth: westIndicesSouthToNorth,\r\n southIndicesEastToWest: southIndicesEastToWest,\r\n eastIndicesNorthToSouth: eastIndicesNorthToSouth,\r\n northIndicesWestToEast: northIndicesWestToEast,\r\n };\r\n}\r\n\r\nfunction addRegularGridIndices(width, height, indices, offset) {\r\n let index = 0;\r\n for (let j = 0; j < height - 1; ++j) {\r\n for (let i = 0; i < width - 1; ++i) {\r\n const upperLeft = index;\r\n const lowerLeft = upperLeft + width;\r\n const lowerRight = lowerLeft + 1;\r\n const upperRight = upperLeft + 1;\r\n\r\n indices[offset++] = upperLeft;\r\n indices[offset++] = lowerLeft;\r\n indices[offset++] = upperRight;\r\n indices[offset++] = upperRight;\r\n indices[offset++] = lowerLeft;\r\n indices[offset++] = lowerRight;\r\n\r\n ++index;\r\n }\r\n ++index;\r\n }\r\n}\r\n\r\nfunction addSkirtIndices(edgeIndices, vertexIndex, indices, offset) {\r\n let previousIndex = edgeIndices[0];\r\n\r\n const length = edgeIndices.length;\r\n for (let i = 1; i < length; ++i) {\r\n const index = edgeIndices[i];\r\n\r\n indices[offset++] = previousIndex;\r\n indices[offset++] = index;\r\n indices[offset++] = vertexIndex;\r\n\r\n indices[offset++] = vertexIndex;\r\n indices[offset++] = index;\r\n indices[offset++] = vertexIndex + 1;\r\n\r\n previousIndex = index;\r\n ++vertexIndex;\r\n }\r\n\r\n return offset;\r\n}\r\n\r\n/**\r\n * Specifies the quality of terrain created from heightmaps. A value of 1.0 will\r\n * ensure that adjacent heightmap vertices are separated by no more than\r\n * {@link Globe.maximumScreenSpaceError} screen pixels and will probably go very slowly.\r\n * A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the\r\n * screen pixels between adjacent heightmap vertices and thus rendering more quickly.\r\n * @type {Number}\r\n */\r\nTerrainProvider.heightmapTerrainQuality = 0.25;\r\n\r\n/**\r\n * Determines an appropriate geometric error estimate when the geometry comes from a heightmap.\r\n *\r\n * @param {Ellipsoid} ellipsoid The ellipsoid to which the terrain is attached.\r\n * @param {Number} tileImageWidth The width, in pixels, of the heightmap associated with a single tile.\r\n * @param {Number} numberOfTilesAtLevelZero The number of tiles in the horizontal direction at tile level zero.\r\n * @returns {Number} An estimated geometric error.\r\n */\r\nTerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap = function (\r\n ellipsoid,\r\n tileImageWidth,\r\n numberOfTilesAtLevelZero\r\n) {\r\n return (\r\n (ellipsoid.maximumRadius *\r\n 2 *\r\n Math.PI *\r\n TerrainProvider.heightmapTerrainQuality) /\r\n (tileImageWidth * numberOfTilesAtLevelZero)\r\n );\r\n};\r\n\r\n/**\r\n * Requests the geometry for a given tile. This function should not be called before\r\n * {@link TerrainProvider#ready} returns true. The result must include terrain data and\r\n * may optionally include a water mask and an indication of which child tiles are available.\r\n * @function\r\n *\r\n * @param {Number} x The X coordinate of the tile for which to request geometry.\r\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\r\n * @param {Number} level The level of the tile for which to request geometry.\r\n * @param {Request} [request] The request object. Intended for internal use only.\r\n *\r\n * @returns {Promise.|undefined} A promise for the requested geometry. If this method\r\n * returns undefined instead of a promise, it is an indication that too many requests are already\r\n * pending and the request will be retried later.\r\n */\r\nTerrainProvider.prototype.requestTileGeometry =\r\n DeveloperError.throwInstantiationError;\r\n\r\n/**\r\n * Gets the maximum geometric error allowed in a tile at a given level. This function should not be\r\n * called before {@link TerrainProvider#ready} returns true.\r\n * @function\r\n *\r\n * @param {Number} level The tile level for which to get the maximum geometric error.\r\n * @returns {Number} The maximum geometric error.\r\n */\r\nTerrainProvider.prototype.getLevelMaximumGeometricError =\r\n DeveloperError.throwInstantiationError;\r\n\r\n/**\r\n * Determines whether data for a tile is available to be loaded.\r\n * @function\r\n *\r\n * @param {Number} x The X coordinate of the tile for which to request geometry.\r\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\r\n * @param {Number} level The level of the tile for which to request geometry.\r\n * @returns {Boolean|undefined} Undefined if not supported by the terrain provider, otherwise true or false.\r\n */\r\nTerrainProvider.prototype.getTileDataAvailable =\r\n DeveloperError.throwInstantiationError;\r\n\r\n/**\r\n * Makes sure we load availability data for a tile\r\n * @function\r\n *\r\n * @param {Number} x The X coordinate of the tile for which to request geometry.\r\n * @param {Number} y The Y coordinate of the tile for which to request geometry.\r\n * @param {Number} level The level of the tile for which to request geometry.\r\n * @returns {undefined|Promise} Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded\r\n */\r\nTerrainProvider.prototype.loadTileDataAvailability =\r\n DeveloperError.throwInstantiationError;\r\nexport default TerrainProvider;\r\n\r\n/**\r\n * A function that is called when an error occurs.\r\n * @callback TerrainProvider.ErrorEvent\r\n *\r\n * @this TerrainProvider\r\n * @param {TileProviderError} err An object holding details about the error that occurred.\r\n */\r\n","import AxisAlignedBoundingBox from \"../Core/AxisAlignedBoundingBox.js\";\r\nimport Cartesian2 from \"../Core/Cartesian2.js\";\r\nimport Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport Cartographic from \"../Core/Cartographic.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport EllipsoidalOccluder from \"../Core/EllipsoidalOccluder.js\";\r\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\r\nimport CesiumMath from \"../Core/Math.js\";\r\nimport Matrix4 from \"../Core/Matrix4.js\";\r\nimport Rectangle from \"../Core/Rectangle.js\";\r\nimport TerrainEncoding from \"../Core/TerrainEncoding.js\";\r\nimport TerrainProvider from \"../Core/TerrainProvider.js\";\r\nimport Transforms from \"../Core/Transforms.js\";\r\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nconst maxShort = 32767;\r\n\r\nconst cartesian3Scratch = new Cartesian3();\r\nconst scratchMinimum = new Cartesian3();\r\nconst scratchMaximum = new Cartesian3();\r\nconst cartographicScratch = new Cartographic();\r\nconst toPack = new Cartesian2();\r\n\r\nfunction createVerticesFromQuantizedTerrainMesh(\r\n parameters,\r\n transferableObjects\r\n) {\r\n const quantizedVertices = parameters.quantizedVertices;\r\n const quantizedVertexCount = quantizedVertices.length / 3;\r\n const octEncodedNormals = parameters.octEncodedNormals;\r\n const edgeVertexCount =\r\n parameters.westIndices.length +\r\n parameters.eastIndices.length +\r\n parameters.southIndices.length +\r\n parameters.northIndices.length;\r\n const includeWebMercatorT = parameters.includeWebMercatorT;\r\n\r\n const exaggeration = parameters.exaggeration;\r\n const exaggerationRelativeHeight = parameters.exaggerationRelativeHeight;\r\n const hasExaggeration = exaggeration !== 1.0;\r\n const includeGeodeticSurfaceNormals = hasExaggeration;\r\n\r\n const rectangle = Rectangle.clone(parameters.rectangle);\r\n const west = rectangle.west;\r\n const south = rectangle.south;\r\n const east = rectangle.east;\r\n const north = rectangle.north;\r\n\r\n const ellipsoid = Ellipsoid.clone(parameters.ellipsoid);\r\n\r\n const minimumHeight = parameters.minimumHeight;\r\n const maximumHeight = parameters.maximumHeight;\r\n\r\n const center = parameters.relativeToCenter;\r\n const fromENU = Transforms.eastNorthUpToFixedFrame(center, ellipsoid);\r\n const toENU = Matrix4.inverseTransformation(fromENU, new Matrix4());\r\n\r\n let southMercatorY;\r\n let oneOverMercatorHeight;\r\n if (includeWebMercatorT) {\r\n southMercatorY = WebMercatorProjection.geodeticLatitudeToMercatorAngle(\r\n south\r\n );\r\n oneOverMercatorHeight =\r\n 1.0 /\r\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(north) -\r\n southMercatorY);\r\n }\r\n\r\n const uBuffer = quantizedVertices.subarray(0, quantizedVertexCount);\r\n const vBuffer = quantizedVertices.subarray(\r\n quantizedVertexCount,\r\n 2 * quantizedVertexCount\r\n );\r\n const heightBuffer = quantizedVertices.subarray(\r\n quantizedVertexCount * 2,\r\n 3 * quantizedVertexCount\r\n );\r\n const hasVertexNormals = defined(octEncodedNormals);\r\n\r\n const uvs = new Array(quantizedVertexCount);\r\n const heights = new Array(quantizedVertexCount);\r\n const positions = new Array(quantizedVertexCount);\r\n const webMercatorTs = includeWebMercatorT\r\n ? new Array(quantizedVertexCount)\r\n : [];\r\n const geodeticSurfaceNormals = includeGeodeticSurfaceNormals\r\n ? new Array(quantizedVertexCount)\r\n : [];\r\n\r\n const minimum = scratchMinimum;\r\n minimum.x = Number.POSITIVE_INFINITY;\r\n minimum.y = Number.POSITIVE_INFINITY;\r\n minimum.z = Number.POSITIVE_INFINITY;\r\n\r\n const maximum = scratchMaximum;\r\n maximum.x = Number.NEGATIVE_INFINITY;\r\n maximum.y = Number.NEGATIVE_INFINITY;\r\n maximum.z = Number.NEGATIVE_INFINITY;\r\n\r\n let minLongitude = Number.POSITIVE_INFINITY;\r\n let maxLongitude = Number.NEGATIVE_INFINITY;\r\n let minLatitude = Number.POSITIVE_INFINITY;\r\n let maxLatitude = Number.NEGATIVE_INFINITY;\r\n\r\n for (let i = 0; i < quantizedVertexCount; ++i) {\r\n const rawU = uBuffer[i];\r\n const rawV = vBuffer[i];\r\n\r\n const u = rawU / maxShort;\r\n const v = rawV / maxShort;\r\n const height = CesiumMath.lerp(\r\n minimumHeight,\r\n maximumHeight,\r\n heightBuffer[i] / maxShort\r\n );\r\n\r\n cartographicScratch.longitude = CesiumMath.lerp(west, east, u);\r\n cartographicScratch.latitude = CesiumMath.lerp(south, north, v);\r\n cartographicScratch.height = height;\r\n\r\n minLongitude = Math.min(cartographicScratch.longitude, minLongitude);\r\n maxLongitude = Math.max(cartographicScratch.longitude, maxLongitude);\r\n minLatitude = Math.min(cartographicScratch.latitude, minLatitude);\r\n maxLatitude = Math.max(cartographicScratch.latitude, maxLatitude);\r\n\r\n const position = ellipsoid.cartographicToCartesian(cartographicScratch);\r\n\r\n uvs[i] = new Cartesian2(u, v);\r\n heights[i] = height;\r\n positions[i] = position;\r\n\r\n if (includeWebMercatorT) {\r\n webMercatorTs[i] =\r\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(\r\n cartographicScratch.latitude\r\n ) -\r\n southMercatorY) *\r\n oneOverMercatorHeight;\r\n }\r\n\r\n if (includeGeodeticSurfaceNormals) {\r\n geodeticSurfaceNormals[i] = ellipsoid.geodeticSurfaceNormal(position);\r\n }\r\n\r\n Matrix4.multiplyByPoint(toENU, position, cartesian3Scratch);\r\n\r\n Cartesian3.minimumByComponent(cartesian3Scratch, minimum, minimum);\r\n Cartesian3.maximumByComponent(cartesian3Scratch, maximum, maximum);\r\n }\r\n\r\n const westIndicesSouthToNorth = copyAndSort(parameters.westIndices, function (\r\n a,\r\n b\r\n ) {\r\n return uvs[a].y - uvs[b].y;\r\n });\r\n const eastIndicesNorthToSouth = copyAndSort(parameters.eastIndices, function (\r\n a,\r\n b\r\n ) {\r\n return uvs[b].y - uvs[a].y;\r\n });\r\n const southIndicesEastToWest = copyAndSort(parameters.southIndices, function (\r\n a,\r\n b\r\n ) {\r\n return uvs[b].x - uvs[a].x;\r\n });\r\n const northIndicesWestToEast = copyAndSort(parameters.northIndices, function (\r\n a,\r\n b\r\n ) {\r\n return uvs[a].x - uvs[b].x;\r\n });\r\n\r\n let occludeePointInScaledSpace;\r\n if (minimumHeight < 0.0) {\r\n // Horizon culling point needs to be recomputed since the tile is at least partly under the ellipsoid.\r\n const occluder = new EllipsoidalOccluder(ellipsoid);\r\n occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid(\r\n center,\r\n positions,\r\n minimumHeight\r\n );\r\n }\r\n\r\n let hMin = minimumHeight;\r\n hMin = Math.min(\r\n hMin,\r\n findMinMaxSkirts(\r\n parameters.westIndices,\r\n parameters.westSkirtHeight,\r\n heights,\r\n uvs,\r\n rectangle,\r\n ellipsoid,\r\n toENU,\r\n minimum,\r\n maximum\r\n )\r\n );\r\n hMin = Math.min(\r\n hMin,\r\n findMinMaxSkirts(\r\n parameters.southIndices,\r\n parameters.southSkirtHeight,\r\n heights,\r\n uvs,\r\n rectangle,\r\n ellipsoid,\r\n toENU,\r\n minimum,\r\n maximum\r\n )\r\n );\r\n hMin = Math.min(\r\n hMin,\r\n findMinMaxSkirts(\r\n parameters.eastIndices,\r\n parameters.eastSkirtHeight,\r\n heights,\r\n uvs,\r\n rectangle,\r\n ellipsoid,\r\n toENU,\r\n minimum,\r\n maximum\r\n )\r\n );\r\n hMin = Math.min(\r\n hMin,\r\n findMinMaxSkirts(\r\n parameters.northIndices,\r\n parameters.northSkirtHeight,\r\n heights,\r\n uvs,\r\n rectangle,\r\n ellipsoid,\r\n toENU,\r\n minimum,\r\n maximum\r\n )\r\n );\r\n\r\n const aaBox = new AxisAlignedBoundingBox(minimum, maximum, center);\r\n const encoding = new TerrainEncoding(\r\n center,\r\n aaBox,\r\n hMin,\r\n maximumHeight,\r\n fromENU,\r\n hasVertexNormals,\r\n includeWebMercatorT,\r\n includeGeodeticSurfaceNormals,\r\n exaggeration,\r\n exaggerationRelativeHeight\r\n );\r\n const vertexStride = encoding.stride;\r\n const size =\r\n quantizedVertexCount * vertexStride + edgeVertexCount * vertexStride;\r\n const vertexBuffer = new Float32Array(size);\r\n\r\n let bufferIndex = 0;\r\n for (let j = 0; j < quantizedVertexCount; ++j) {\r\n if (hasVertexNormals) {\r\n const n = j * 2.0;\r\n toPack.x = octEncodedNormals[n];\r\n toPack.y = octEncodedNormals[n + 1];\r\n }\r\n\r\n bufferIndex = encoding.encode(\r\n vertexBuffer,\r\n bufferIndex,\r\n positions[j],\r\n uvs[j],\r\n heights[j],\r\n toPack,\r\n webMercatorTs[j],\r\n geodeticSurfaceNormals[j]\r\n );\r\n }\r\n\r\n const edgeTriangleCount = Math.max(0, (edgeVertexCount - 4) * 2);\r\n const indexBufferLength = parameters.indices.length + edgeTriangleCount * 3;\r\n const indexBuffer = IndexDatatype.createTypedArray(\r\n quantizedVertexCount + edgeVertexCount,\r\n indexBufferLength\r\n );\r\n indexBuffer.set(parameters.indices, 0);\r\n\r\n const percentage = 0.0001;\r\n const lonOffset = (maxLongitude - minLongitude) * percentage;\r\n const latOffset = (maxLatitude - minLatitude) * percentage;\r\n const westLongitudeOffset = -lonOffset;\r\n const westLatitudeOffset = 0.0;\r\n const eastLongitudeOffset = lonOffset;\r\n const eastLatitudeOffset = 0.0;\r\n const northLongitudeOffset = 0.0;\r\n const northLatitudeOffset = latOffset;\r\n const southLongitudeOffset = 0.0;\r\n const southLatitudeOffset = -latOffset;\r\n\r\n // Add skirts.\r\n let vertexBufferIndex = quantizedVertexCount * vertexStride;\r\n addSkirt(\r\n vertexBuffer,\r\n vertexBufferIndex,\r\n westIndicesSouthToNorth,\r\n encoding,\r\n heights,\r\n uvs,\r\n octEncodedNormals,\r\n ellipsoid,\r\n rectangle,\r\n parameters.westSkirtHeight,\r\n southMercatorY,\r\n oneOverMercatorHeight,\r\n westLongitudeOffset,\r\n westLatitudeOffset\r\n );\r\n vertexBufferIndex += parameters.westIndices.length * vertexStride;\r\n addSkirt(\r\n vertexBuffer,\r\n vertexBufferIndex,\r\n southIndicesEastToWest,\r\n encoding,\r\n heights,\r\n uvs,\r\n octEncodedNormals,\r\n ellipsoid,\r\n rectangle,\r\n parameters.southSkirtHeight,\r\n southMercatorY,\r\n oneOverMercatorHeight,\r\n southLongitudeOffset,\r\n southLatitudeOffset\r\n );\r\n vertexBufferIndex += parameters.southIndices.length * vertexStride;\r\n addSkirt(\r\n vertexBuffer,\r\n vertexBufferIndex,\r\n eastIndicesNorthToSouth,\r\n encoding,\r\n heights,\r\n uvs,\r\n octEncodedNormals,\r\n ellipsoid,\r\n rectangle,\r\n parameters.eastSkirtHeight,\r\n southMercatorY,\r\n oneOverMercatorHeight,\r\n eastLongitudeOffset,\r\n eastLatitudeOffset\r\n );\r\n vertexBufferIndex += parameters.eastIndices.length * vertexStride;\r\n addSkirt(\r\n vertexBuffer,\r\n vertexBufferIndex,\r\n northIndicesWestToEast,\r\n encoding,\r\n heights,\r\n uvs,\r\n octEncodedNormals,\r\n ellipsoid,\r\n rectangle,\r\n parameters.northSkirtHeight,\r\n southMercatorY,\r\n oneOverMercatorHeight,\r\n northLongitudeOffset,\r\n northLatitudeOffset\r\n );\r\n\r\n TerrainProvider.addSkirtIndices(\r\n westIndicesSouthToNorth,\r\n southIndicesEastToWest,\r\n eastIndicesNorthToSouth,\r\n northIndicesWestToEast,\r\n quantizedVertexCount,\r\n indexBuffer,\r\n parameters.indices.length\r\n );\r\n\r\n transferableObjects.push(vertexBuffer.buffer, indexBuffer.buffer);\r\n\r\n return {\r\n vertices: vertexBuffer.buffer,\r\n indices: indexBuffer.buffer,\r\n westIndicesSouthToNorth: westIndicesSouthToNorth,\r\n southIndicesEastToWest: southIndicesEastToWest,\r\n eastIndicesNorthToSouth: eastIndicesNorthToSouth,\r\n northIndicesWestToEast: northIndicesWestToEast,\r\n vertexStride: vertexStride,\r\n center: center,\r\n minimumHeight: minimumHeight,\r\n maximumHeight: maximumHeight,\r\n occludeePointInScaledSpace: occludeePointInScaledSpace,\r\n encoding: encoding,\r\n indexCountWithoutSkirts: parameters.indices.length,\r\n };\r\n}\r\n\r\nfunction findMinMaxSkirts(\r\n edgeIndices,\r\n edgeHeight,\r\n heights,\r\n uvs,\r\n rectangle,\r\n ellipsoid,\r\n toENU,\r\n minimum,\r\n maximum\r\n) {\r\n let hMin = Number.POSITIVE_INFINITY;\r\n\r\n const north = rectangle.north;\r\n const south = rectangle.south;\r\n let east = rectangle.east;\r\n const west = rectangle.west;\r\n\r\n if (east < west) {\r\n east += CesiumMath.TWO_PI;\r\n }\r\n\r\n const length = edgeIndices.length;\r\n for (let i = 0; i < length; ++i) {\r\n const index = edgeIndices[i];\r\n const h = heights[index];\r\n const uv = uvs[index];\r\n\r\n cartographicScratch.longitude = CesiumMath.lerp(west, east, uv.x);\r\n cartographicScratch.latitude = CesiumMath.lerp(south, north, uv.y);\r\n cartographicScratch.height = h - edgeHeight;\r\n\r\n const position = ellipsoid.cartographicToCartesian(\r\n cartographicScratch,\r\n cartesian3Scratch\r\n );\r\n Matrix4.multiplyByPoint(toENU, position, position);\r\n\r\n Cartesian3.minimumByComponent(position, minimum, minimum);\r\n Cartesian3.maximumByComponent(position, maximum, maximum);\r\n\r\n hMin = Math.min(hMin, cartographicScratch.height);\r\n }\r\n return hMin;\r\n}\r\n\r\nfunction addSkirt(\r\n vertexBuffer,\r\n vertexBufferIndex,\r\n edgeVertices,\r\n encoding,\r\n heights,\r\n uvs,\r\n octEncodedNormals,\r\n ellipsoid,\r\n rectangle,\r\n skirtLength,\r\n southMercatorY,\r\n oneOverMercatorHeight,\r\n longitudeOffset,\r\n latitudeOffset\r\n) {\r\n const hasVertexNormals = defined(octEncodedNormals);\r\n\r\n const north = rectangle.north;\r\n const south = rectangle.south;\r\n let east = rectangle.east;\r\n const west = rectangle.west;\r\n\r\n if (east < west) {\r\n east += CesiumMath.TWO_PI;\r\n }\r\n\r\n const length = edgeVertices.length;\r\n for (let i = 0; i < length; ++i) {\r\n const index = edgeVertices[i];\r\n const h = heights[index];\r\n const uv = uvs[index];\r\n\r\n cartographicScratch.longitude =\r\n CesiumMath.lerp(west, east, uv.x) + longitudeOffset;\r\n cartographicScratch.latitude =\r\n CesiumMath.lerp(south, north, uv.y) + latitudeOffset;\r\n cartographicScratch.height = h - skirtLength;\r\n\r\n const position = ellipsoid.cartographicToCartesian(\r\n cartographicScratch,\r\n cartesian3Scratch\r\n );\r\n\r\n if (hasVertexNormals) {\r\n const n = index * 2.0;\r\n toPack.x = octEncodedNormals[n];\r\n toPack.y = octEncodedNormals[n + 1];\r\n }\r\n\r\n let webMercatorT;\r\n if (encoding.hasWebMercatorT) {\r\n webMercatorT =\r\n (WebMercatorProjection.geodeticLatitudeToMercatorAngle(\r\n cartographicScratch.latitude\r\n ) -\r\n southMercatorY) *\r\n oneOverMercatorHeight;\r\n }\r\n\r\n let geodeticSurfaceNormal;\r\n if (encoding.hasGeodeticSurfaceNormals) {\r\n geodeticSurfaceNormal = ellipsoid.geodeticSurfaceNormal(position);\r\n }\r\n\r\n vertexBufferIndex = encoding.encode(\r\n vertexBuffer,\r\n vertexBufferIndex,\r\n position,\r\n uv,\r\n cartographicScratch.height,\r\n toPack,\r\n webMercatorT,\r\n geodeticSurfaceNormal\r\n );\r\n }\r\n}\r\n\r\nfunction copyAndSort(typedArray, comparator) {\r\n let copy;\r\n if (typeof typedArray.slice === \"function\") {\r\n copy = typedArray.slice();\r\n if (typeof copy.sort !== \"function\") {\r\n // Sliced typed array isn't sortable, so we can't use it.\r\n copy = undefined;\r\n }\r\n }\r\n\r\n if (!defined(copy)) {\r\n copy = Array.prototype.slice.call(typedArray);\r\n }\r\n\r\n copy.sort(comparator);\r\n\r\n return copy;\r\n}\r\nexport default createTaskProcessorWorker(\r\n createVerticesFromQuantizedTerrainMesh\r\n);\r\n"],"names":["DeveloperError","CesiumMath","defined","IndexDatatype","Cartesian3","Cartographic","Cartesian2","Rectangle","Ellipsoid","Transforms","Matrix4","WebMercatorProjection","EllipsoidalOccluder","AxisAlignedBoundingBox","TerrainEncoding"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAKA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,eAAe,GAAG;EAC3B,EAAEA,oBAAc,CAAC,uBAAuB,EAAE,CAAC;EAC3C,CAAC;AACD;EACA,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,SAAS,EAAE;EACnD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,UAAU,EAAE;EACd,IAAI,GAAG,EAAEA,oBAAc,CAAC,uBAAuB;EAC/C,GAAG;AACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,MAAM,EAAE;EACV,IAAI,GAAG,EAAEA,oBAAc,CAAC,uBAAuB;EAC/C,GAAG;AACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,YAAY,EAAE;EAChB,IAAI,GAAG,EAAEA,oBAAc,CAAC,uBAAuB;EA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AAE,UAAU,EAAE;EAC7C,EAAE,IAAI,IAAI,CAAC;EACX,EAAE,IAAI,OAAO,UAAU,CAAC,KAAK,KAAK,UAAU,EAAE;EAC9C,IAAI,IAAI,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC;EAC9B,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;EACzC;EACA,MAAM,IAAI,GAAG,SAAS,CAAC;EACvB,KAAK;EACL,GAAG;AACH;EACA,EAAE,IAAI,CAACT,oBAAO,CAAC,IAAI,CAAC,EAAE;EACtB,IAAI,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;EAClD,GAAG;AACH;EACA,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACxB;EACA,EAAE,OAAO,IAAI,CAAC;EACd,CAAC;AACD,iDAAe,yBAAyB;EACxC,EAAE,sCAAsC;EACxC,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createWallGeometry.js b/examples/cesium/Workers/createWallGeometry.js
new file mode 100644
index 0000000..44382b0
--- /dev/null
+++ b/examples/cesium/Workers/createWallGeometry.js
@@ -0,0 +1,649 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './Transforms-11fb6b0a', './ComponentDatatype-13a5630b', './Check-d10e5f2e', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './IndexDatatype-b4e5cf89', './Math-9be8b918', './VertexFormat-f2d74c96', './WallGeometryLibrary-4f405b12', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29', './arrayRemoveDuplicates-c3526030', './PolylinePipeline-3c021236', './EllipsoidGeodesic-38d0ed4a', './EllipsoidRhumbLine-48b4507b', './IntersectionTests-2c7928de', './Plane-c9f1487d'], (function (defaultValue, Matrix3, Transforms, ComponentDatatype, Check, GeometryAttribute, GeometryAttributes, IndexDatatype, Math, VertexFormat, WallGeometryLibrary, Matrix2, RuntimeError, combine, WebGLConstants, arrayRemoveDuplicates, PolylinePipeline, EllipsoidGeodesic, EllipsoidRhumbLine, IntersectionTests, Plane) { 'use strict';
+
+ const scratchCartesian3Position1 = new Matrix3.Cartesian3();
+ const scratchCartesian3Position2 = new Matrix3.Cartesian3();
+ const scratchCartesian3Position4 = new Matrix3.Cartesian3();
+ const scratchCartesian3Position5 = new Matrix3.Cartesian3();
+ const scratchBitangent = new Matrix3.Cartesian3();
+ const scratchTangent = new Matrix3.Cartesian3();
+ const scratchNormal = new Matrix3.Cartesian3();
+
+ /**
+ * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
+ * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
+ *
+ * @alias WallGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Number[]} [options.maximumHeights] An array parallel to positions
that give the maximum height of the
+ * wall at positions
. If undefined, the height of each position in used.
+ * @param {Number[]} [options.minimumHeights] An array parallel to positions
that give the minimum height of the
+ * wall at positions
. If undefined, the height at each position is 0.0.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ *
+ * @exception {DeveloperError} positions length must be greater than or equal to 2.
+ * @exception {DeveloperError} positions and maximumHeights must have the same length.
+ * @exception {DeveloperError} positions and minimumHeights must have the same length.
+ *
+ * @see WallGeometry#createGeometry
+ * @see WallGeometry#fromConstantHeight
+ *
+ * @demo {@link https://sandcastle.cesium.com/index.html?src=Wall.html|Cesium Sandcastle Wall Demo}
+ *
+ * @example
+ * // create a wall that spans from ground level to 10000 meters
+ * const wall = new Cesium.WallGeometry({
+ * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
+ * 19.0, 47.0, 10000.0,
+ * 19.0, 48.0, 10000.0,
+ * 20.0, 48.0, 10000.0,
+ * 20.0, 47.0, 10000.0,
+ * 19.0, 47.0, 10000.0
+ * ])
+ * });
+ * const geometry = Cesium.WallGeometry.createGeometry(wall);
+ */
+ function WallGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const wallPositions = options.positions;
+ const maximumHeights = options.maximumHeights;
+ const minimumHeights = options.minimumHeights;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(wallPositions)) {
+ throw new Check.DeveloperError("options.positions is required.");
+ }
+ if (
+ defaultValue.defined(maximumHeights) &&
+ maximumHeights.length !== wallPositions.length
+ ) {
+ throw new Check.DeveloperError(
+ "options.positions and options.maximumHeights must have the same length."
+ );
+ }
+ if (
+ defaultValue.defined(minimumHeights) &&
+ minimumHeights.length !== wallPositions.length
+ ) {
+ throw new Check.DeveloperError(
+ "options.positions and options.minimumHeights must have the same length."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const vertexFormat = defaultValue.defaultValue(options.vertexFormat, VertexFormat.VertexFormat.DEFAULT);
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math.CesiumMath.RADIANS_PER_DEGREE
+ );
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+
+ this._positions = wallPositions;
+ this._minimumHeights = minimumHeights;
+ this._maximumHeights = maximumHeights;
+ this._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat);
+ this._granularity = granularity;
+ this._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid);
+ this._workerName = "createWallGeometry";
+
+ let numComponents = 1 + wallPositions.length * Matrix3.Cartesian3.packedLength + 2;
+ if (defaultValue.defined(minimumHeights)) {
+ numComponents += minimumHeights.length;
+ }
+ if (defaultValue.defined(maximumHeights)) {
+ numComponents += maximumHeights.length;
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength =
+ numComponents + Matrix3.Ellipsoid.packedLength + VertexFormat.VertexFormat.packedLength + 1;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {WallGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ WallGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ const positions = value._positions;
+ let length = positions.length;
+ array[startingIndex++] = length;
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
+ }
+
+ const minimumHeights = value._minimumHeights;
+ length = defaultValue.defined(minimumHeights) ? minimumHeights.length : 0;
+ array[startingIndex++] = length;
+
+ if (defaultValue.defined(minimumHeights)) {
+ for (i = 0; i < length; ++i) {
+ array[startingIndex++] = minimumHeights[i];
+ }
+ }
+
+ const maximumHeights = value._maximumHeights;
+ length = defaultValue.defined(maximumHeights) ? maximumHeights.length : 0;
+ array[startingIndex++] = length;
+
+ if (defaultValue.defined(maximumHeights)) {
+ for (i = 0; i < length; ++i) {
+ array[startingIndex++] = maximumHeights[i];
+ }
+ }
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ VertexFormat.VertexFormat.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ array[startingIndex] = value._granularity;
+
+ return array;
+ };
+
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchVertexFormat = new VertexFormat.VertexFormat();
+ const scratchOptions = {
+ positions: undefined,
+ minimumHeights: undefined,
+ maximumHeights: undefined,
+ ellipsoid: scratchEllipsoid,
+ vertexFormat: scratchVertexFormat,
+ granularity: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {WallGeometry} [result] The object into which to store the result.
+ * @returns {WallGeometry} The modified result parameter or a new WallGeometry instance if one was not provided.
+ */
+ WallGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ let length = array[startingIndex++];
+ const positions = new Array(length);
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
+ }
+
+ length = array[startingIndex++];
+ let minimumHeights;
+
+ if (length > 0) {
+ minimumHeights = new Array(length);
+ for (i = 0; i < length; ++i) {
+ minimumHeights[i] = array[startingIndex++];
+ }
+ }
+
+ length = array[startingIndex++];
+ let maximumHeights;
+
+ if (length > 0) {
+ maximumHeights = new Array(length);
+ for (i = 0; i < length; ++i) {
+ maximumHeights[i] = array[startingIndex++];
+ }
+ }
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const vertexFormat = VertexFormat.VertexFormat.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat
+ );
+ startingIndex += VertexFormat.VertexFormat.packedLength;
+
+ const granularity = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.positions = positions;
+ scratchOptions.minimumHeights = minimumHeights;
+ scratchOptions.maximumHeights = maximumHeights;
+ scratchOptions.granularity = granularity;
+ return new WallGeometry(scratchOptions);
+ }
+
+ result._positions = positions;
+ result._minimumHeights = minimumHeights;
+ result._maximumHeights = maximumHeights;
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat.VertexFormat.clone(vertexFormat, result._vertexFormat);
+ result._granularity = granularity;
+
+ return result;
+ };
+
+ /**
+ * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,
+ * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.
+ * @param {Number} [options.maximumHeight] A constant that defines the maximum height of the
+ * wall at positions
. If undefined, the height of each position in used.
+ * @param {Number} [options.minimumHeight] A constant that defines the minimum height of the
+ * wall at positions
. If undefined, the height at each position is 0.0.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation
+ * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
+ * @returns {WallGeometry}
+ *
+ *
+ * @example
+ * // create a wall that spans from 10000 meters to 20000 meters
+ * const wall = Cesium.WallGeometry.fromConstantHeights({
+ * positions : Cesium.Cartesian3.fromDegreesArray([
+ * 19.0, 47.0,
+ * 19.0, 48.0,
+ * 20.0, 48.0,
+ * 20.0, 47.0,
+ * 19.0, 47.0,
+ * ]),
+ * minimumHeight : 20000.0,
+ * maximumHeight : 10000.0
+ * });
+ * const geometry = Cesium.WallGeometry.createGeometry(wall);
+ *
+ * @see WallGeometry#createGeometry
+ */
+ WallGeometry.fromConstantHeights = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const positions = options.positions;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(positions)) {
+ throw new Check.DeveloperError("options.positions is required.");
+ }
+ //>>includeEnd('debug');
+
+ let minHeights;
+ let maxHeights;
+
+ const min = options.minimumHeight;
+ const max = options.maximumHeight;
+
+ const doMin = defaultValue.defined(min);
+ const doMax = defaultValue.defined(max);
+ if (doMin || doMax) {
+ const length = positions.length;
+ minHeights = doMin ? new Array(length) : undefined;
+ maxHeights = doMax ? new Array(length) : undefined;
+
+ for (let i = 0; i < length; ++i) {
+ if (doMin) {
+ minHeights[i] = min;
+ }
+
+ if (doMax) {
+ maxHeights[i] = max;
+ }
+ }
+ }
+
+ const newOptions = {
+ positions: positions,
+ maximumHeights: maxHeights,
+ minimumHeights: minHeights,
+ ellipsoid: options.ellipsoid,
+ vertexFormat: options.vertexFormat,
+ };
+ return new WallGeometry(newOptions);
+ };
+
+ /**
+ * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {WallGeometry} wallGeometry A description of the wall.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ WallGeometry.createGeometry = function (wallGeometry) {
+ const wallPositions = wallGeometry._positions;
+ const minimumHeights = wallGeometry._minimumHeights;
+ const maximumHeights = wallGeometry._maximumHeights;
+ const vertexFormat = wallGeometry._vertexFormat;
+ const granularity = wallGeometry._granularity;
+ const ellipsoid = wallGeometry._ellipsoid;
+
+ const pos = WallGeometryLibrary.WallGeometryLibrary.computePositions(
+ ellipsoid,
+ wallPositions,
+ maximumHeights,
+ minimumHeights,
+ granularity,
+ true
+ );
+ if (!defaultValue.defined(pos)) {
+ return;
+ }
+
+ const bottomPositions = pos.bottomPositions;
+ const topPositions = pos.topPositions;
+ const numCorners = pos.numCorners;
+
+ let length = topPositions.length;
+ let size = length * 2;
+
+ const positions = vertexFormat.position ? new Float64Array(size) : undefined;
+ const normals = vertexFormat.normal ? new Float32Array(size) : undefined;
+ const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;
+ const bitangents = vertexFormat.bitangent
+ ? new Float32Array(size)
+ : undefined;
+ const textureCoordinates = vertexFormat.st
+ ? new Float32Array((size / 3) * 2)
+ : undefined;
+
+ let positionIndex = 0;
+ let normalIndex = 0;
+ let bitangentIndex = 0;
+ let tangentIndex = 0;
+ let stIndex = 0;
+
+ // add lower and upper points one after the other, lower
+ // points being even and upper points being odd
+ let normal = scratchNormal;
+ let tangent = scratchTangent;
+ let bitangent = scratchBitangent;
+ let recomputeNormal = true;
+ length /= 3;
+ let i;
+ let s = 0;
+ const ds = 1 / (length - numCorners - 1);
+ for (i = 0; i < length; ++i) {
+ const i3 = i * 3;
+ const topPosition = Matrix3.Cartesian3.fromArray(
+ topPositions,
+ i3,
+ scratchCartesian3Position1
+ );
+ const bottomPosition = Matrix3.Cartesian3.fromArray(
+ bottomPositions,
+ i3,
+ scratchCartesian3Position2
+ );
+ if (vertexFormat.position) {
+ // insert the lower point
+ positions[positionIndex++] = bottomPosition.x;
+ positions[positionIndex++] = bottomPosition.y;
+ positions[positionIndex++] = bottomPosition.z;
+
+ // insert the upper point
+ positions[positionIndex++] = topPosition.x;
+ positions[positionIndex++] = topPosition.y;
+ positions[positionIndex++] = topPosition.z;
+ }
+
+ if (vertexFormat.st) {
+ textureCoordinates[stIndex++] = s;
+ textureCoordinates[stIndex++] = 0.0;
+
+ textureCoordinates[stIndex++] = s;
+ textureCoordinates[stIndex++] = 1.0;
+ }
+
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
+ let nextTop = Matrix3.Cartesian3.clone(
+ Matrix3.Cartesian3.ZERO,
+ scratchCartesian3Position5
+ );
+ const groundPosition = Matrix3.Cartesian3.subtract(
+ topPosition,
+ ellipsoid.geodeticSurfaceNormal(
+ topPosition,
+ scratchCartesian3Position2
+ ),
+ scratchCartesian3Position2
+ );
+ if (i + 1 < length) {
+ nextTop = Matrix3.Cartesian3.fromArray(
+ topPositions,
+ i3 + 3,
+ scratchCartesian3Position5
+ );
+ }
+
+ if (recomputeNormal) {
+ const scalednextPosition = Matrix3.Cartesian3.subtract(
+ nextTop,
+ topPosition,
+ scratchCartesian3Position4
+ );
+ const scaledGroundPosition = Matrix3.Cartesian3.subtract(
+ groundPosition,
+ topPosition,
+ scratchCartesian3Position1
+ );
+ normal = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(scaledGroundPosition, scalednextPosition, normal),
+ normal
+ );
+ recomputeNormal = false;
+ }
+
+ if (
+ Matrix3.Cartesian3.equalsEpsilon(topPosition, nextTop, Math.CesiumMath.EPSILON10)
+ ) {
+ recomputeNormal = true;
+ } else {
+ s += ds;
+ if (vertexFormat.tangent) {
+ tangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.subtract(nextTop, topPosition, tangent),
+ tangent
+ );
+ }
+ if (vertexFormat.bitangent) {
+ bitangent = Matrix3.Cartesian3.normalize(
+ Matrix3.Cartesian3.cross(normal, tangent, bitangent),
+ bitangent
+ );
+ }
+ }
+
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = normal.x;
+ normals[normalIndex++] = normal.y;
+ normals[normalIndex++] = normal.z;
+
+ normals[normalIndex++] = normal.x;
+ normals[normalIndex++] = normal.y;
+ normals[normalIndex++] = normal.z;
+ }
+
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ }
+
+ if (vertexFormat.bitangent) {
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ }
+ }
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes();
+
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ });
+ }
+
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals,
+ });
+ }
+
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents,
+ });
+ }
+
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents,
+ });
+ }
+
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates,
+ });
+ }
+
+ // prepare the side walls, two triangles for each wall
+ //
+ // A (i+1) B (i+3) E
+ // +--------+-------+
+ // | / | /| triangles: A C B
+ // | / | / | B C D
+ // | / | / |
+ // | / | / |
+ // | / | / |
+ // | / | / |
+ // +--------+-------+
+ // C (i) D (i+2) F
+ //
+
+ const numVertices = size / 3;
+ size -= 6 * (numCorners + 1);
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(numVertices, size);
+
+ let edgeIndex = 0;
+ for (i = 0; i < numVertices - 2; i += 2) {
+ const LL = i;
+ const LR = i + 2;
+ const pl = Matrix3.Cartesian3.fromArray(
+ positions,
+ LL * 3,
+ scratchCartesian3Position1
+ );
+ const pr = Matrix3.Cartesian3.fromArray(
+ positions,
+ LR * 3,
+ scratchCartesian3Position2
+ );
+ if (Matrix3.Cartesian3.equalsEpsilon(pl, pr, Math.CesiumMath.EPSILON10)) {
+ continue;
+ }
+ const UL = i + 1;
+ const UR = i + 3;
+
+ indices[edgeIndex++] = UL;
+ indices[edgeIndex++] = LL;
+ indices[edgeIndex++] = UR;
+ indices[edgeIndex++] = UR;
+ indices[edgeIndex++] = LL;
+ indices[edgeIndex++] = LR;
+ }
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.TRIANGLES,
+ boundingSphere: new Transforms.BoundingSphere.fromVertices(positions),
+ });
+ };
+
+ function createWallGeometry(wallGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ wallGeometry = WallGeometry.unpack(wallGeometry, offset);
+ }
+ wallGeometry._ellipsoid = Matrix3.Ellipsoid.clone(wallGeometry._ellipsoid);
+ return WallGeometry.createGeometry(wallGeometry);
+ }
+
+ return createWallGeometry;
+
+}));
+//# sourceMappingURL=createWallGeometry.js.map
diff --git a/examples/cesium/Workers/createWallGeometry.js.map b/examples/cesium/Workers/createWallGeometry.js.map
new file mode 100644
index 0000000..34b2958
--- /dev/null
+++ b/examples/cesium/Workers/createWallGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createWallGeometry.js","sources":["../../../Source/Core/WallGeometry.js","../../../Source/WorkersES6/createWallGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport VertexFormat from \"./VertexFormat.js\";\r\nimport WallGeometryLibrary from \"./WallGeometryLibrary.js\";\r\n\r\nconst scratchCartesian3Position1 = new Cartesian3();\r\nconst scratchCartesian3Position2 = new Cartesian3();\r\nconst scratchCartesian3Position4 = new Cartesian3();\r\nconst scratchCartesian3Position5 = new Cartesian3();\r\nconst scratchBitangent = new Cartesian3();\r\nconst scratchTangent = new Cartesian3();\r\nconst scratchNormal = new Cartesian3();\r\n\r\n/**\r\n * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,\r\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\r\n *\r\n * @alias WallGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Number[]} [options.maximumHeights] An array parallel to positions
that give the maximum height of the\r\n * wall at positions
. If undefined, the height of each position in used.\r\n * @param {Number[]} [options.minimumHeights] An array parallel to positions
that give the minimum height of the\r\n * wall at positions
. If undefined, the height at each position is 0.0.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n *\r\n * @exception {DeveloperError} positions length must be greater than or equal to 2.\r\n * @exception {DeveloperError} positions and maximumHeights must have the same length.\r\n * @exception {DeveloperError} positions and minimumHeights must have the same length.\r\n *\r\n * @see WallGeometry#createGeometry\r\n * @see WallGeometry#fromConstantHeight\r\n *\r\n * @demo {@link https://sandcastle.cesium.com/index.html?src=Wall.html|Cesium Sandcastle Wall Demo}\r\n *\r\n * @example\r\n * // create a wall that spans from ground level to 10000 meters\r\n * const wall = new Cesium.WallGeometry({\r\n * positions : Cesium.Cartesian3.fromDegreesArrayHeights([\r\n * 19.0, 47.0, 10000.0,\r\n * 19.0, 48.0, 10000.0,\r\n * 20.0, 48.0, 10000.0,\r\n * 20.0, 47.0, 10000.0,\r\n * 19.0, 47.0, 10000.0\r\n * ])\r\n * });\r\n * const geometry = Cesium.WallGeometry.createGeometry(wall);\r\n */\r\nfunction WallGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const wallPositions = options.positions;\r\n const maximumHeights = options.maximumHeights;\r\n const minimumHeights = options.minimumHeights;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(wallPositions)) {\r\n throw new DeveloperError(\"options.positions is required.\");\r\n }\r\n if (\r\n defined(maximumHeights) &&\r\n maximumHeights.length !== wallPositions.length\r\n ) {\r\n throw new DeveloperError(\r\n \"options.positions and options.maximumHeights must have the same length.\"\r\n );\r\n }\r\n if (\r\n defined(minimumHeights) &&\r\n minimumHeights.length !== wallPositions.length\r\n ) {\r\n throw new DeveloperError(\r\n \"options.positions and options.minimumHeights must have the same length.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const vertexFormat = defaultValue(options.vertexFormat, VertexFormat.DEFAULT);\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n\r\n this._positions = wallPositions;\r\n this._minimumHeights = minimumHeights;\r\n this._maximumHeights = maximumHeights;\r\n this._vertexFormat = VertexFormat.clone(vertexFormat);\r\n this._granularity = granularity;\r\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\r\n this._workerName = \"createWallGeometry\";\r\n\r\n let numComponents = 1 + wallPositions.length * Cartesian3.packedLength + 2;\r\n if (defined(minimumHeights)) {\r\n numComponents += minimumHeights.length;\r\n }\r\n if (defined(maximumHeights)) {\r\n numComponents += maximumHeights.length;\r\n }\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength =\r\n numComponents + Ellipsoid.packedLength + VertexFormat.packedLength + 1;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {WallGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nWallGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n const positions = value._positions;\r\n let length = positions.length;\r\n array[startingIndex++] = length;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n Cartesian3.pack(positions[i], array, startingIndex);\r\n }\r\n\r\n const minimumHeights = value._minimumHeights;\r\n length = defined(minimumHeights) ? minimumHeights.length : 0;\r\n array[startingIndex++] = length;\r\n\r\n if (defined(minimumHeights)) {\r\n for (i = 0; i < length; ++i) {\r\n array[startingIndex++] = minimumHeights[i];\r\n }\r\n }\r\n\r\n const maximumHeights = value._maximumHeights;\r\n length = defined(maximumHeights) ? maximumHeights.length : 0;\r\n array[startingIndex++] = length;\r\n\r\n if (defined(maximumHeights)) {\r\n for (i = 0; i < length; ++i) {\r\n array[startingIndex++] = maximumHeights[i];\r\n }\r\n }\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n VertexFormat.pack(value._vertexFormat, array, startingIndex);\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n array[startingIndex] = value._granularity;\r\n\r\n return array;\r\n};\r\n\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchVertexFormat = new VertexFormat();\r\nconst scratchOptions = {\r\n positions: undefined,\r\n minimumHeights: undefined,\r\n maximumHeights: undefined,\r\n ellipsoid: scratchEllipsoid,\r\n vertexFormat: scratchVertexFormat,\r\n granularity: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {WallGeometry} [result] The object into which to store the result.\r\n * @returns {WallGeometry} The modified result parameter or a new WallGeometry instance if one was not provided.\r\n */\r\nWallGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n let length = array[startingIndex++];\r\n const positions = new Array(length);\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n positions[i] = Cartesian3.unpack(array, startingIndex);\r\n }\r\n\r\n length = array[startingIndex++];\r\n let minimumHeights;\r\n\r\n if (length > 0) {\r\n minimumHeights = new Array(length);\r\n for (i = 0; i < length; ++i) {\r\n minimumHeights[i] = array[startingIndex++];\r\n }\r\n }\r\n\r\n length = array[startingIndex++];\r\n let maximumHeights;\r\n\r\n if (length > 0) {\r\n maximumHeights = new Array(length);\r\n for (i = 0; i < length; ++i) {\r\n maximumHeights[i] = array[startingIndex++];\r\n }\r\n }\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const vertexFormat = VertexFormat.unpack(\r\n array,\r\n startingIndex,\r\n scratchVertexFormat\r\n );\r\n startingIndex += VertexFormat.packedLength;\r\n\r\n const granularity = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.positions = positions;\r\n scratchOptions.minimumHeights = minimumHeights;\r\n scratchOptions.maximumHeights = maximumHeights;\r\n scratchOptions.granularity = granularity;\r\n return new WallGeometry(scratchOptions);\r\n }\r\n\r\n result._positions = positions;\r\n result._minimumHeights = minimumHeights;\r\n result._maximumHeights = maximumHeights;\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._vertexFormat = VertexFormat.clone(vertexFormat, result._vertexFormat);\r\n result._granularity = granularity;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * A description of a wall, which is similar to a KML line string. A wall is defined by a series of points,\r\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\r\n * @param {Number} [options.maximumHeight] A constant that defines the maximum height of the\r\n * wall at positions
. If undefined, the height of each position in used.\r\n * @param {Number} [options.minimumHeight] A constant that defines the minimum height of the\r\n * wall at positions
. If undefined, the height at each position is 0.0.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\r\n * @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.\r\n * @returns {WallGeometry}\r\n *\r\n *\r\n * @example\r\n * // create a wall that spans from 10000 meters to 20000 meters\r\n * const wall = Cesium.WallGeometry.fromConstantHeights({\r\n * positions : Cesium.Cartesian3.fromDegreesArray([\r\n * 19.0, 47.0,\r\n * 19.0, 48.0,\r\n * 20.0, 48.0,\r\n * 20.0, 47.0,\r\n * 19.0, 47.0,\r\n * ]),\r\n * minimumHeight : 20000.0,\r\n * maximumHeight : 10000.0\r\n * });\r\n * const geometry = Cesium.WallGeometry.createGeometry(wall);\r\n *\r\n * @see WallGeometry#createGeometry\r\n */\r\nWallGeometry.fromConstantHeights = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const positions = options.positions;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(positions)) {\r\n throw new DeveloperError(\"options.positions is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n let minHeights;\r\n let maxHeights;\r\n\r\n const min = options.minimumHeight;\r\n const max = options.maximumHeight;\r\n\r\n const doMin = defined(min);\r\n const doMax = defined(max);\r\n if (doMin || doMax) {\r\n const length = positions.length;\r\n minHeights = doMin ? new Array(length) : undefined;\r\n maxHeights = doMax ? new Array(length) : undefined;\r\n\r\n for (let i = 0; i < length; ++i) {\r\n if (doMin) {\r\n minHeights[i] = min;\r\n }\r\n\r\n if (doMax) {\r\n maxHeights[i] = max;\r\n }\r\n }\r\n }\r\n\r\n const newOptions = {\r\n positions: positions,\r\n maximumHeights: maxHeights,\r\n minimumHeights: minHeights,\r\n ellipsoid: options.ellipsoid,\r\n vertexFormat: options.vertexFormat,\r\n };\r\n return new WallGeometry(newOptions);\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a wall, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {WallGeometry} wallGeometry A description of the wall.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nWallGeometry.createGeometry = function (wallGeometry) {\r\n const wallPositions = wallGeometry._positions;\r\n const minimumHeights = wallGeometry._minimumHeights;\r\n const maximumHeights = wallGeometry._maximumHeights;\r\n const vertexFormat = wallGeometry._vertexFormat;\r\n const granularity = wallGeometry._granularity;\r\n const ellipsoid = wallGeometry._ellipsoid;\r\n\r\n const pos = WallGeometryLibrary.computePositions(\r\n ellipsoid,\r\n wallPositions,\r\n maximumHeights,\r\n minimumHeights,\r\n granularity,\r\n true\r\n );\r\n if (!defined(pos)) {\r\n return;\r\n }\r\n\r\n const bottomPositions = pos.bottomPositions;\r\n const topPositions = pos.topPositions;\r\n const numCorners = pos.numCorners;\r\n\r\n let length = topPositions.length;\r\n let size = length * 2;\r\n\r\n const positions = vertexFormat.position ? new Float64Array(size) : undefined;\r\n const normals = vertexFormat.normal ? new Float32Array(size) : undefined;\r\n const tangents = vertexFormat.tangent ? new Float32Array(size) : undefined;\r\n const bitangents = vertexFormat.bitangent\r\n ? new Float32Array(size)\r\n : undefined;\r\n const textureCoordinates = vertexFormat.st\r\n ? new Float32Array((size / 3) * 2)\r\n : undefined;\r\n\r\n let positionIndex = 0;\r\n let normalIndex = 0;\r\n let bitangentIndex = 0;\r\n let tangentIndex = 0;\r\n let stIndex = 0;\r\n\r\n // add lower and upper points one after the other, lower\r\n // points being even and upper points being odd\r\n let normal = scratchNormal;\r\n let tangent = scratchTangent;\r\n let bitangent = scratchBitangent;\r\n let recomputeNormal = true;\r\n length /= 3;\r\n let i;\r\n let s = 0;\r\n const ds = 1 / (length - numCorners - 1);\r\n for (i = 0; i < length; ++i) {\r\n const i3 = i * 3;\r\n const topPosition = Cartesian3.fromArray(\r\n topPositions,\r\n i3,\r\n scratchCartesian3Position1\r\n );\r\n const bottomPosition = Cartesian3.fromArray(\r\n bottomPositions,\r\n i3,\r\n scratchCartesian3Position2\r\n );\r\n if (vertexFormat.position) {\r\n // insert the lower point\r\n positions[positionIndex++] = bottomPosition.x;\r\n positions[positionIndex++] = bottomPosition.y;\r\n positions[positionIndex++] = bottomPosition.z;\r\n\r\n // insert the upper point\r\n positions[positionIndex++] = topPosition.x;\r\n positions[positionIndex++] = topPosition.y;\r\n positions[positionIndex++] = topPosition.z;\r\n }\r\n\r\n if (vertexFormat.st) {\r\n textureCoordinates[stIndex++] = s;\r\n textureCoordinates[stIndex++] = 0.0;\r\n\r\n textureCoordinates[stIndex++] = s;\r\n textureCoordinates[stIndex++] = 1.0;\r\n }\r\n\r\n if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {\r\n let nextTop = Cartesian3.clone(\r\n Cartesian3.ZERO,\r\n scratchCartesian3Position5\r\n );\r\n const groundPosition = Cartesian3.subtract(\r\n topPosition,\r\n ellipsoid.geodeticSurfaceNormal(\r\n topPosition,\r\n scratchCartesian3Position2\r\n ),\r\n scratchCartesian3Position2\r\n );\r\n if (i + 1 < length) {\r\n nextTop = Cartesian3.fromArray(\r\n topPositions,\r\n i3 + 3,\r\n scratchCartesian3Position5\r\n );\r\n }\r\n\r\n if (recomputeNormal) {\r\n const scalednextPosition = Cartesian3.subtract(\r\n nextTop,\r\n topPosition,\r\n scratchCartesian3Position4\r\n );\r\n const scaledGroundPosition = Cartesian3.subtract(\r\n groundPosition,\r\n topPosition,\r\n scratchCartesian3Position1\r\n );\r\n normal = Cartesian3.normalize(\r\n Cartesian3.cross(scaledGroundPosition, scalednextPosition, normal),\r\n normal\r\n );\r\n recomputeNormal = false;\r\n }\r\n\r\n if (\r\n Cartesian3.equalsEpsilon(topPosition, nextTop, CesiumMath.EPSILON10)\r\n ) {\r\n recomputeNormal = true;\r\n } else {\r\n s += ds;\r\n if (vertexFormat.tangent) {\r\n tangent = Cartesian3.normalize(\r\n Cartesian3.subtract(nextTop, topPosition, tangent),\r\n tangent\r\n );\r\n }\r\n if (vertexFormat.bitangent) {\r\n bitangent = Cartesian3.normalize(\r\n Cartesian3.cross(normal, tangent, bitangent),\r\n bitangent\r\n );\r\n }\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n normals[normalIndex++] = normal.x;\r\n normals[normalIndex++] = normal.y;\r\n normals[normalIndex++] = normal.z;\r\n\r\n normals[normalIndex++] = normal.x;\r\n normals[normalIndex++] = normal.y;\r\n normals[normalIndex++] = normal.z;\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n tangents[tangentIndex++] = tangent.x;\r\n tangents[tangentIndex++] = tangent.y;\r\n tangents[tangentIndex++] = tangent.z;\r\n\r\n tangents[tangentIndex++] = tangent.x;\r\n tangents[tangentIndex++] = tangent.y;\r\n tangents[tangentIndex++] = tangent.z;\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n bitangents[bitangentIndex++] = bitangent.x;\r\n bitangents[bitangentIndex++] = bitangent.y;\r\n bitangents[bitangentIndex++] = bitangent.z;\r\n\r\n bitangents[bitangentIndex++] = bitangent.x;\r\n bitangents[bitangentIndex++] = bitangent.y;\r\n bitangents[bitangentIndex++] = bitangent.z;\r\n }\r\n }\r\n }\r\n\r\n const attributes = new GeometryAttributes();\r\n\r\n if (vertexFormat.position) {\r\n attributes.position = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n });\r\n }\r\n\r\n if (vertexFormat.normal) {\r\n attributes.normal = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: normals,\r\n });\r\n }\r\n\r\n if (vertexFormat.tangent) {\r\n attributes.tangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: tangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.bitangent) {\r\n attributes.bitangent = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 3,\r\n values: bitangents,\r\n });\r\n }\r\n\r\n if (vertexFormat.st) {\r\n attributes.st = new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.FLOAT,\r\n componentsPerAttribute: 2,\r\n values: textureCoordinates,\r\n });\r\n }\r\n\r\n // prepare the side walls, two triangles for each wall\r\n //\r\n // A (i+1) B (i+3) E\r\n // +--------+-------+\r\n // | / | /| triangles: A C B\r\n // | / | / | B C D\r\n // | / | / |\r\n // | / | / |\r\n // | / | / |\r\n // | / | / |\r\n // +--------+-------+\r\n // C (i) D (i+2) F\r\n //\r\n\r\n const numVertices = size / 3;\r\n size -= 6 * (numCorners + 1);\r\n const indices = IndexDatatype.createTypedArray(numVertices, size);\r\n\r\n let edgeIndex = 0;\r\n for (i = 0; i < numVertices - 2; i += 2) {\r\n const LL = i;\r\n const LR = i + 2;\r\n const pl = Cartesian3.fromArray(\r\n positions,\r\n LL * 3,\r\n scratchCartesian3Position1\r\n );\r\n const pr = Cartesian3.fromArray(\r\n positions,\r\n LR * 3,\r\n scratchCartesian3Position2\r\n );\r\n if (Cartesian3.equalsEpsilon(pl, pr, CesiumMath.EPSILON10)) {\r\n continue;\r\n }\r\n const UL = i + 1;\r\n const UR = i + 3;\r\n\r\n indices[edgeIndex++] = UL;\r\n indices[edgeIndex++] = LL;\r\n indices[edgeIndex++] = UR;\r\n indices[edgeIndex++] = UR;\r\n indices[edgeIndex++] = LL;\r\n indices[edgeIndex++] = LR;\r\n }\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.TRIANGLES,\r\n boundingSphere: new BoundingSphere.fromVertices(positions),\r\n });\r\n};\r\nexport default WallGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport WallGeometry from \"../Core/WallGeometry.js\";\r\n\r\nfunction createWallGeometry(wallGeometry, offset) {\r\n if (defined(offset)) {\r\n wallGeometry = WallGeometry.unpack(wallGeometry, offset);\r\n }\r\n wallGeometry._ellipsoid = Ellipsoid.clone(wallGeometry._ellipsoid);\r\n return WallGeometry.createGeometry(wallGeometry);\r\n}\r\nexport default createWallGeometry;\r\n"],"names":["Cartesian3","defaultValue","defined","DeveloperError","VertexFormat","CesiumMath","Ellipsoid","WallGeometryLibrary","GeometryAttributes","GeometryAttribute","ComponentDatatype","IndexDatatype","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,0BAA0B,GAAG,IAAIA,kBAAU,EAAE,CAAC;EAC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AC,CAAC;EACrB,IAAI,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;AACrB;EACA,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,CAAC;EAC9B,GAAG;AACH;EACA,EAAE,OAAO,IAAIO,0BAAQ,CAAC;EACtB,IAAI,UAAU,EAAE,UAAU;EAC1B,IAAI,OAAO,EAAE,OAAO;EACpB,IAAI,aAAa,EAAEC,+BAAa,CAAC,SAAS;EAC1C,IAAI,cAAc,EAAE,IAAIC,yBAAc,CAAC,YAAY,CAAC,SAAS,CAAC;EAC9D,GAAG,CAAC,CAAC;EACL,CAAC;;EC5mBD,SAAS,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE;EAClD,EAAE,IAAIZ,oBAAO,CAAC,MAAM,CAAC,EAAE;EACvB,IAAI,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;EAC7D,GAAG;EACH,EAAE,YAAY,CAAC,UAAU,GAAGI,iBAAS,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;EACrE,EAAE,OAAO,YAAY,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;EACnD;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/createWallOutlineGeometry.js b/examples/cesium/Workers/createWallOutlineGeometry.js
new file mode 100644
index 0000000..4f3db22
--- /dev/null
+++ b/examples/cesium/Workers/createWallOutlineGeometry.js
@@ -0,0 +1,458 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Matrix3-f22b0303', './Transforms-11fb6b0a', './ComponentDatatype-13a5630b', './Check-d10e5f2e', './GeometryAttribute-f2746b95', './GeometryAttributes-eb2609b7', './IndexDatatype-b4e5cf89', './Math-9be8b918', './WallGeometryLibrary-4f405b12', './Matrix2-036c77dd', './RuntimeError-e5c6a8b9', './combine-4598d225', './WebGLConstants-f27a5e29', './arrayRemoveDuplicates-c3526030', './PolylinePipeline-3c021236', './EllipsoidGeodesic-38d0ed4a', './EllipsoidRhumbLine-48b4507b', './IntersectionTests-2c7928de', './Plane-c9f1487d'], (function (defaultValue, Matrix3, Transforms, ComponentDatatype, Check, GeometryAttribute, GeometryAttributes, IndexDatatype, Math, WallGeometryLibrary, Matrix2, RuntimeError, combine, WebGLConstants, arrayRemoveDuplicates, PolylinePipeline, EllipsoidGeodesic, EllipsoidRhumbLine, IntersectionTests, Plane) { 'use strict';
+
+ const scratchCartesian3Position1 = new Matrix3.Cartesian3();
+ const scratchCartesian3Position2 = new Matrix3.Cartesian3();
+
+ /**
+ * A description of a wall outline. A wall is defined by a series of points,
+ * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
+ *
+ * @alias WallOutlineGeometry
+ * @constructor
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.
+ * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
+ * @param {Number[]} [options.maximumHeights] An array parallel to positions
that give the maximum height of the
+ * wall at positions
. If undefined, the height of each position in used.
+ * @param {Number[]} [options.minimumHeights] An array parallel to positions
that give the minimum height of the
+ * wall at positions
. If undefined, the height at each position is 0.0.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation
+ *
+ * @exception {DeveloperError} positions length must be greater than or equal to 2.
+ * @exception {DeveloperError} positions and maximumHeights must have the same length.
+ * @exception {DeveloperError} positions and minimumHeights must have the same length.
+ *
+ * @see WallGeometry#createGeometry
+ * @see WallGeometry#fromConstantHeight
+ *
+ * @example
+ * // create a wall outline that spans from ground level to 10000 meters
+ * const wall = new Cesium.WallOutlineGeometry({
+ * positions : Cesium.Cartesian3.fromDegreesArrayHeights([
+ * 19.0, 47.0, 10000.0,
+ * 19.0, 48.0, 10000.0,
+ * 20.0, 48.0, 10000.0,
+ * 20.0, 47.0, 10000.0,
+ * 19.0, 47.0, 10000.0
+ * ])
+ * });
+ * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
+ */
+ function WallOutlineGeometry(options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+
+ const wallPositions = options.positions;
+ const maximumHeights = options.maximumHeights;
+ const minimumHeights = options.minimumHeights;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(wallPositions)) {
+ throw new Check.DeveloperError("options.positions is required.");
+ }
+ if (
+ defaultValue.defined(maximumHeights) &&
+ maximumHeights.length !== wallPositions.length
+ ) {
+ throw new Check.DeveloperError(
+ "options.positions and options.maximumHeights must have the same length."
+ );
+ }
+ if (
+ defaultValue.defined(minimumHeights) &&
+ minimumHeights.length !== wallPositions.length
+ ) {
+ throw new Check.DeveloperError(
+ "options.positions and options.minimumHeights must have the same length."
+ );
+ }
+ //>>includeEnd('debug');
+
+ const granularity = defaultValue.defaultValue(
+ options.granularity,
+ Math.CesiumMath.RADIANS_PER_DEGREE
+ );
+ const ellipsoid = defaultValue.defaultValue(options.ellipsoid, Matrix3.Ellipsoid.WGS84);
+
+ this._positions = wallPositions;
+ this._minimumHeights = minimumHeights;
+ this._maximumHeights = maximumHeights;
+ this._granularity = granularity;
+ this._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid);
+ this._workerName = "createWallOutlineGeometry";
+
+ let numComponents = 1 + wallPositions.length * Matrix3.Cartesian3.packedLength + 2;
+ if (defaultValue.defined(minimumHeights)) {
+ numComponents += minimumHeights.length;
+ }
+ if (defaultValue.defined(maximumHeights)) {
+ numComponents += maximumHeights.length;
+ }
+
+ /**
+ * The number of elements used to pack the object into an array.
+ * @type {Number}
+ */
+ this.packedLength = numComponents + Matrix3.Ellipsoid.packedLength + 1;
+ }
+
+ /**
+ * Stores the provided instance into the provided array.
+ *
+ * @param {WallOutlineGeometry} value The value to pack.
+ * @param {Number[]} array The array to pack into.
+ * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
+ *
+ * @returns {Number[]} The array that was packed into
+ */
+ WallOutlineGeometry.pack = function (value, array, startingIndex) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(value)) {
+ throw new Check.DeveloperError("value is required");
+ }
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ const positions = value._positions;
+ let length = positions.length;
+ array[startingIndex++] = length;
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ Matrix3.Cartesian3.pack(positions[i], array, startingIndex);
+ }
+
+ const minimumHeights = value._minimumHeights;
+ length = defaultValue.defined(minimumHeights) ? minimumHeights.length : 0;
+ array[startingIndex++] = length;
+
+ if (defaultValue.defined(minimumHeights)) {
+ for (i = 0; i < length; ++i) {
+ array[startingIndex++] = minimumHeights[i];
+ }
+ }
+
+ const maximumHeights = value._maximumHeights;
+ length = defaultValue.defined(maximumHeights) ? maximumHeights.length : 0;
+ array[startingIndex++] = length;
+
+ if (defaultValue.defined(maximumHeights)) {
+ for (i = 0; i < length; ++i) {
+ array[startingIndex++] = maximumHeights[i];
+ }
+ }
+
+ Matrix3.Ellipsoid.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ array[startingIndex] = value._granularity;
+
+ return array;
+ };
+
+ const scratchEllipsoid = Matrix3.Ellipsoid.clone(Matrix3.Ellipsoid.UNIT_SPHERE);
+ const scratchOptions = {
+ positions: undefined,
+ minimumHeights: undefined,
+ maximumHeights: undefined,
+ ellipsoid: scratchEllipsoid,
+ granularity: undefined,
+ };
+
+ /**
+ * Retrieves an instance from a packed array.
+ *
+ * @param {Number[]} array The packed array.
+ * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
+ * @param {WallOutlineGeometry} [result] The object into which to store the result.
+ * @returns {WallOutlineGeometry} The modified result parameter or a new WallOutlineGeometry instance if one was not provided.
+ */
+ WallOutlineGeometry.unpack = function (array, startingIndex, result) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(array)) {
+ throw new Check.DeveloperError("array is required");
+ }
+ //>>includeEnd('debug');
+
+ startingIndex = defaultValue.defaultValue(startingIndex, 0);
+
+ let i;
+
+ let length = array[startingIndex++];
+ const positions = new Array(length);
+
+ for (i = 0; i < length; ++i, startingIndex += Matrix3.Cartesian3.packedLength) {
+ positions[i] = Matrix3.Cartesian3.unpack(array, startingIndex);
+ }
+
+ length = array[startingIndex++];
+ let minimumHeights;
+
+ if (length > 0) {
+ minimumHeights = new Array(length);
+ for (i = 0; i < length; ++i) {
+ minimumHeights[i] = array[startingIndex++];
+ }
+ }
+
+ length = array[startingIndex++];
+ let maximumHeights;
+
+ if (length > 0) {
+ maximumHeights = new Array(length);
+ for (i = 0; i < length; ++i) {
+ maximumHeights[i] = array[startingIndex++];
+ }
+ }
+
+ const ellipsoid = Matrix3.Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Matrix3.Ellipsoid.packedLength;
+
+ const granularity = array[startingIndex];
+
+ if (!defaultValue.defined(result)) {
+ scratchOptions.positions = positions;
+ scratchOptions.minimumHeights = minimumHeights;
+ scratchOptions.maximumHeights = maximumHeights;
+ scratchOptions.granularity = granularity;
+ return new WallOutlineGeometry(scratchOptions);
+ }
+
+ result._positions = positions;
+ result._minimumHeights = minimumHeights;
+ result._maximumHeights = maximumHeights;
+ result._ellipsoid = Matrix3.Ellipsoid.clone(ellipsoid, result._ellipsoid);
+ result._granularity = granularity;
+
+ return result;
+ };
+
+ /**
+ * A description of a walloutline. A wall is defined by a series of points,
+ * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.
+ *
+ * @param {Object} options Object with the following properties:
+ * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.
+ * @param {Number} [options.maximumHeight] A constant that defines the maximum height of the
+ * wall at positions
. If undefined, the height of each position in used.
+ * @param {Number} [options.minimumHeight] A constant that defines the minimum height of the
+ * wall at positions
. If undefined, the height at each position is 0.0.
+ * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation
+ * @returns {WallOutlineGeometry}
+ *
+ *
+ * @example
+ * // create a wall that spans from 10000 meters to 20000 meters
+ * const wall = Cesium.WallOutlineGeometry.fromConstantHeights({
+ * positions : Cesium.Cartesian3.fromDegreesArray([
+ * 19.0, 47.0,
+ * 19.0, 48.0,
+ * 20.0, 48.0,
+ * 20.0, 47.0,
+ * 19.0, 47.0,
+ * ]),
+ * minimumHeight : 20000.0,
+ * maximumHeight : 10000.0
+ * });
+ * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);
+ *
+ * @see WallOutlineGeometry#createGeometry
+ */
+ WallOutlineGeometry.fromConstantHeights = function (options) {
+ options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
+ const positions = options.positions;
+
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(positions)) {
+ throw new Check.DeveloperError("options.positions is required.");
+ }
+ //>>includeEnd('debug');
+
+ let minHeights;
+ let maxHeights;
+
+ const min = options.minimumHeight;
+ const max = options.maximumHeight;
+
+ const doMin = defaultValue.defined(min);
+ const doMax = defaultValue.defined(max);
+ if (doMin || doMax) {
+ const length = positions.length;
+ minHeights = doMin ? new Array(length) : undefined;
+ maxHeights = doMax ? new Array(length) : undefined;
+
+ for (let i = 0; i < length; ++i) {
+ if (doMin) {
+ minHeights[i] = min;
+ }
+
+ if (doMax) {
+ maxHeights[i] = max;
+ }
+ }
+ }
+
+ const newOptions = {
+ positions: positions,
+ maximumHeights: maxHeights,
+ minimumHeights: minHeights,
+ ellipsoid: options.ellipsoid,
+ };
+ return new WallOutlineGeometry(newOptions);
+ };
+
+ /**
+ * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.
+ *
+ * @param {WallOutlineGeometry} wallGeometry A description of the wall outline.
+ * @returns {Geometry|undefined} The computed vertices and indices.
+ */
+ WallOutlineGeometry.createGeometry = function (wallGeometry) {
+ const wallPositions = wallGeometry._positions;
+ const minimumHeights = wallGeometry._minimumHeights;
+ const maximumHeights = wallGeometry._maximumHeights;
+ const granularity = wallGeometry._granularity;
+ const ellipsoid = wallGeometry._ellipsoid;
+
+ const pos = WallGeometryLibrary.WallGeometryLibrary.computePositions(
+ ellipsoid,
+ wallPositions,
+ maximumHeights,
+ minimumHeights,
+ granularity,
+ false
+ );
+ if (!defaultValue.defined(pos)) {
+ return;
+ }
+
+ const bottomPositions = pos.bottomPositions;
+ const topPositions = pos.topPositions;
+
+ let length = topPositions.length;
+ let size = length * 2;
+
+ const positions = new Float64Array(size);
+ let positionIndex = 0;
+
+ // add lower and upper points one after the other, lower
+ // points being even and upper points being odd
+ length /= 3;
+ let i;
+ for (i = 0; i < length; ++i) {
+ const i3 = i * 3;
+ const topPosition = Matrix3.Cartesian3.fromArray(
+ topPositions,
+ i3,
+ scratchCartesian3Position1
+ );
+ const bottomPosition = Matrix3.Cartesian3.fromArray(
+ bottomPositions,
+ i3,
+ scratchCartesian3Position2
+ );
+
+ // insert the lower point
+ positions[positionIndex++] = bottomPosition.x;
+ positions[positionIndex++] = bottomPosition.y;
+ positions[positionIndex++] = bottomPosition.z;
+
+ // insert the upper point
+ positions[positionIndex++] = topPosition.x;
+ positions[positionIndex++] = topPosition.y;
+ positions[positionIndex++] = topPosition.z;
+ }
+
+ const attributes = new GeometryAttributes.GeometryAttributes({
+ position: new GeometryAttribute.GeometryAttribute({
+ componentDatatype: ComponentDatatype.ComponentDatatype.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions,
+ }),
+ });
+
+ const numVertices = size / 3;
+ size = 2 * numVertices - 4 + numVertices;
+ const indices = IndexDatatype.IndexDatatype.createTypedArray(numVertices, size);
+
+ let edgeIndex = 0;
+ for (i = 0; i < numVertices - 2; i += 2) {
+ const LL = i;
+ const LR = i + 2;
+ const pl = Matrix3.Cartesian3.fromArray(
+ positions,
+ LL * 3,
+ scratchCartesian3Position1
+ );
+ const pr = Matrix3.Cartesian3.fromArray(
+ positions,
+ LR * 3,
+ scratchCartesian3Position2
+ );
+ if (Matrix3.Cartesian3.equalsEpsilon(pl, pr, Math.CesiumMath.EPSILON10)) {
+ continue;
+ }
+ const UL = i + 1;
+ const UR = i + 3;
+
+ indices[edgeIndex++] = UL;
+ indices[edgeIndex++] = LL;
+ indices[edgeIndex++] = UL;
+ indices[edgeIndex++] = UR;
+ indices[edgeIndex++] = LL;
+ indices[edgeIndex++] = LR;
+ }
+
+ indices[edgeIndex++] = numVertices - 2;
+ indices[edgeIndex++] = numVertices - 1;
+
+ return new GeometryAttribute.Geometry({
+ attributes: attributes,
+ indices: indices,
+ primitiveType: GeometryAttribute.PrimitiveType.LINES,
+ boundingSphere: new Transforms.BoundingSphere.fromVertices(positions),
+ });
+ };
+
+ function createWallOutlineGeometry(wallGeometry, offset) {
+ if (defaultValue.defined(offset)) {
+ wallGeometry = WallOutlineGeometry.unpack(wallGeometry, offset);
+ }
+ wallGeometry._ellipsoid = Matrix3.Ellipsoid.clone(wallGeometry._ellipsoid);
+ return WallOutlineGeometry.createGeometry(wallGeometry);
+ }
+
+ return createWallOutlineGeometry;
+
+}));
+//# sourceMappingURL=createWallOutlineGeometry.js.map
diff --git a/examples/cesium/Workers/createWallOutlineGeometry.js.map b/examples/cesium/Workers/createWallOutlineGeometry.js.map
new file mode 100644
index 0000000..a9e90e7
--- /dev/null
+++ b/examples/cesium/Workers/createWallOutlineGeometry.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"createWallOutlineGeometry.js","sources":["../../../Source/Core/WallOutlineGeometry.js","../../../Source/WorkersES6/createWallOutlineGeometry.js"],"sourcesContent":["import BoundingSphere from \"./BoundingSphere.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport ComponentDatatype from \"./ComponentDatatype.js\";\r\nimport defaultValue from \"./defaultValue.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\nimport Ellipsoid from \"./Ellipsoid.js\";\r\nimport Geometry from \"./Geometry.js\";\r\nimport GeometryAttribute from \"./GeometryAttribute.js\";\r\nimport GeometryAttributes from \"./GeometryAttributes.js\";\r\nimport IndexDatatype from \"./IndexDatatype.js\";\r\nimport CesiumMath from \"./Math.js\";\r\nimport PrimitiveType from \"./PrimitiveType.js\";\r\nimport WallGeometryLibrary from \"./WallGeometryLibrary.js\";\r\n\r\nconst scratchCartesian3Position1 = new Cartesian3();\r\nconst scratchCartesian3Position2 = new Cartesian3();\r\n\r\n/**\r\n * A description of a wall outline. A wall is defined by a series of points,\r\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\r\n *\r\n * @alias WallOutlineGeometry\r\n * @constructor\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\r\n * @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.\r\n * @param {Number[]} [options.maximumHeights] An array parallel to positions
that give the maximum height of the\r\n * wall at positions
. If undefined, the height of each position in used.\r\n * @param {Number[]} [options.minimumHeights] An array parallel to positions
that give the minimum height of the\r\n * wall at positions
. If undefined, the height at each position is 0.0.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\r\n *\r\n * @exception {DeveloperError} positions length must be greater than or equal to 2.\r\n * @exception {DeveloperError} positions and maximumHeights must have the same length.\r\n * @exception {DeveloperError} positions and minimumHeights must have the same length.\r\n *\r\n * @see WallGeometry#createGeometry\r\n * @see WallGeometry#fromConstantHeight\r\n *\r\n * @example\r\n * // create a wall outline that spans from ground level to 10000 meters\r\n * const wall = new Cesium.WallOutlineGeometry({\r\n * positions : Cesium.Cartesian3.fromDegreesArrayHeights([\r\n * 19.0, 47.0, 10000.0,\r\n * 19.0, 48.0, 10000.0,\r\n * 20.0, 48.0, 10000.0,\r\n * 20.0, 47.0, 10000.0,\r\n * 19.0, 47.0, 10000.0\r\n * ])\r\n * });\r\n * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);\r\n */\r\nfunction WallOutlineGeometry(options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n\r\n const wallPositions = options.positions;\r\n const maximumHeights = options.maximumHeights;\r\n const minimumHeights = options.minimumHeights;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(wallPositions)) {\r\n throw new DeveloperError(\"options.positions is required.\");\r\n }\r\n if (\r\n defined(maximumHeights) &&\r\n maximumHeights.length !== wallPositions.length\r\n ) {\r\n throw new DeveloperError(\r\n \"options.positions and options.maximumHeights must have the same length.\"\r\n );\r\n }\r\n if (\r\n defined(minimumHeights) &&\r\n minimumHeights.length !== wallPositions.length\r\n ) {\r\n throw new DeveloperError(\r\n \"options.positions and options.minimumHeights must have the same length.\"\r\n );\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const granularity = defaultValue(\r\n options.granularity,\r\n CesiumMath.RADIANS_PER_DEGREE\r\n );\r\n const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);\r\n\r\n this._positions = wallPositions;\r\n this._minimumHeights = minimumHeights;\r\n this._maximumHeights = maximumHeights;\r\n this._granularity = granularity;\r\n this._ellipsoid = Ellipsoid.clone(ellipsoid);\r\n this._workerName = \"createWallOutlineGeometry\";\r\n\r\n let numComponents = 1 + wallPositions.length * Cartesian3.packedLength + 2;\r\n if (defined(minimumHeights)) {\r\n numComponents += minimumHeights.length;\r\n }\r\n if (defined(maximumHeights)) {\r\n numComponents += maximumHeights.length;\r\n }\r\n\r\n /**\r\n * The number of elements used to pack the object into an array.\r\n * @type {Number}\r\n */\r\n this.packedLength = numComponents + Ellipsoid.packedLength + 1;\r\n}\r\n\r\n/**\r\n * Stores the provided instance into the provided array.\r\n *\r\n * @param {WallOutlineGeometry} value The value to pack.\r\n * @param {Number[]} array The array to pack into.\r\n * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.\r\n *\r\n * @returns {Number[]} The array that was packed into\r\n */\r\nWallOutlineGeometry.pack = function (value, array, startingIndex) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(value)) {\r\n throw new DeveloperError(\"value is required\");\r\n }\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n const positions = value._positions;\r\n let length = positions.length;\r\n array[startingIndex++] = length;\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n Cartesian3.pack(positions[i], array, startingIndex);\r\n }\r\n\r\n const minimumHeights = value._minimumHeights;\r\n length = defined(minimumHeights) ? minimumHeights.length : 0;\r\n array[startingIndex++] = length;\r\n\r\n if (defined(minimumHeights)) {\r\n for (i = 0; i < length; ++i) {\r\n array[startingIndex++] = minimumHeights[i];\r\n }\r\n }\r\n\r\n const maximumHeights = value._maximumHeights;\r\n length = defined(maximumHeights) ? maximumHeights.length : 0;\r\n array[startingIndex++] = length;\r\n\r\n if (defined(maximumHeights)) {\r\n for (i = 0; i < length; ++i) {\r\n array[startingIndex++] = maximumHeights[i];\r\n }\r\n }\r\n\r\n Ellipsoid.pack(value._ellipsoid, array, startingIndex);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n array[startingIndex] = value._granularity;\r\n\r\n return array;\r\n};\r\n\r\nconst scratchEllipsoid = Ellipsoid.clone(Ellipsoid.UNIT_SPHERE);\r\nconst scratchOptions = {\r\n positions: undefined,\r\n minimumHeights: undefined,\r\n maximumHeights: undefined,\r\n ellipsoid: scratchEllipsoid,\r\n granularity: undefined,\r\n};\r\n\r\n/**\r\n * Retrieves an instance from a packed array.\r\n *\r\n * @param {Number[]} array The packed array.\r\n * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.\r\n * @param {WallOutlineGeometry} [result] The object into which to store the result.\r\n * @returns {WallOutlineGeometry} The modified result parameter or a new WallOutlineGeometry instance if one was not provided.\r\n */\r\nWallOutlineGeometry.unpack = function (array, startingIndex, result) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(array)) {\r\n throw new DeveloperError(\"array is required\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n startingIndex = defaultValue(startingIndex, 0);\r\n\r\n let i;\r\n\r\n let length = array[startingIndex++];\r\n const positions = new Array(length);\r\n\r\n for (i = 0; i < length; ++i, startingIndex += Cartesian3.packedLength) {\r\n positions[i] = Cartesian3.unpack(array, startingIndex);\r\n }\r\n\r\n length = array[startingIndex++];\r\n let minimumHeights;\r\n\r\n if (length > 0) {\r\n minimumHeights = new Array(length);\r\n for (i = 0; i < length; ++i) {\r\n minimumHeights[i] = array[startingIndex++];\r\n }\r\n }\r\n\r\n length = array[startingIndex++];\r\n let maximumHeights;\r\n\r\n if (length > 0) {\r\n maximumHeights = new Array(length);\r\n for (i = 0; i < length; ++i) {\r\n maximumHeights[i] = array[startingIndex++];\r\n }\r\n }\r\n\r\n const ellipsoid = Ellipsoid.unpack(array, startingIndex, scratchEllipsoid);\r\n startingIndex += Ellipsoid.packedLength;\r\n\r\n const granularity = array[startingIndex];\r\n\r\n if (!defined(result)) {\r\n scratchOptions.positions = positions;\r\n scratchOptions.minimumHeights = minimumHeights;\r\n scratchOptions.maximumHeights = maximumHeights;\r\n scratchOptions.granularity = granularity;\r\n return new WallOutlineGeometry(scratchOptions);\r\n }\r\n\r\n result._positions = positions;\r\n result._minimumHeights = minimumHeights;\r\n result._maximumHeights = maximumHeights;\r\n result._ellipsoid = Ellipsoid.clone(ellipsoid, result._ellipsoid);\r\n result._granularity = granularity;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * A description of a walloutline. A wall is defined by a series of points,\r\n * which extrude down to the ground. Optionally, they can extrude downwards to a specified height.\r\n *\r\n * @param {Object} options Object with the following properties:\r\n * @param {Cartesian3[]} options.positions An array of Cartesian objects, which are the points of the wall.\r\n * @param {Number} [options.maximumHeight] A constant that defines the maximum height of the\r\n * wall at positions
. If undefined, the height of each position in used.\r\n * @param {Number} [options.minimumHeight] A constant that defines the minimum height of the\r\n * wall at positions
. If undefined, the height at each position is 0.0.\r\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid for coordinate manipulation\r\n * @returns {WallOutlineGeometry}\r\n *\r\n *\r\n * @example\r\n * // create a wall that spans from 10000 meters to 20000 meters\r\n * const wall = Cesium.WallOutlineGeometry.fromConstantHeights({\r\n * positions : Cesium.Cartesian3.fromDegreesArray([\r\n * 19.0, 47.0,\r\n * 19.0, 48.0,\r\n * 20.0, 48.0,\r\n * 20.0, 47.0,\r\n * 19.0, 47.0,\r\n * ]),\r\n * minimumHeight : 20000.0,\r\n * maximumHeight : 10000.0\r\n * });\r\n * const geometry = Cesium.WallOutlineGeometry.createGeometry(wall);\r\n *\r\n * @see WallOutlineGeometry#createGeometry\r\n */\r\nWallOutlineGeometry.fromConstantHeights = function (options) {\r\n options = defaultValue(options, defaultValue.EMPTY_OBJECT);\r\n const positions = options.positions;\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(positions)) {\r\n throw new DeveloperError(\"options.positions is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n let minHeights;\r\n let maxHeights;\r\n\r\n const min = options.minimumHeight;\r\n const max = options.maximumHeight;\r\n\r\n const doMin = defined(min);\r\n const doMax = defined(max);\r\n if (doMin || doMax) {\r\n const length = positions.length;\r\n minHeights = doMin ? new Array(length) : undefined;\r\n maxHeights = doMax ? new Array(length) : undefined;\r\n\r\n for (let i = 0; i < length; ++i) {\r\n if (doMin) {\r\n minHeights[i] = min;\r\n }\r\n\r\n if (doMax) {\r\n maxHeights[i] = max;\r\n }\r\n }\r\n }\r\n\r\n const newOptions = {\r\n positions: positions,\r\n maximumHeights: maxHeights,\r\n minimumHeights: minHeights,\r\n ellipsoid: options.ellipsoid,\r\n };\r\n return new WallOutlineGeometry(newOptions);\r\n};\r\n\r\n/**\r\n * Computes the geometric representation of a wall outline, including its vertices, indices, and a bounding sphere.\r\n *\r\n * @param {WallOutlineGeometry} wallGeometry A description of the wall outline.\r\n * @returns {Geometry|undefined} The computed vertices and indices.\r\n */\r\nWallOutlineGeometry.createGeometry = function (wallGeometry) {\r\n const wallPositions = wallGeometry._positions;\r\n const minimumHeights = wallGeometry._minimumHeights;\r\n const maximumHeights = wallGeometry._maximumHeights;\r\n const granularity = wallGeometry._granularity;\r\n const ellipsoid = wallGeometry._ellipsoid;\r\n\r\n const pos = WallGeometryLibrary.computePositions(\r\n ellipsoid,\r\n wallPositions,\r\n maximumHeights,\r\n minimumHeights,\r\n granularity,\r\n false\r\n );\r\n if (!defined(pos)) {\r\n return;\r\n }\r\n\r\n const bottomPositions = pos.bottomPositions;\r\n const topPositions = pos.topPositions;\r\n\r\n let length = topPositions.length;\r\n let size = length * 2;\r\n\r\n const positions = new Float64Array(size);\r\n let positionIndex = 0;\r\n\r\n // add lower and upper points one after the other, lower\r\n // points being even and upper points being odd\r\n length /= 3;\r\n let i;\r\n for (i = 0; i < length; ++i) {\r\n const i3 = i * 3;\r\n const topPosition = Cartesian3.fromArray(\r\n topPositions,\r\n i3,\r\n scratchCartesian3Position1\r\n );\r\n const bottomPosition = Cartesian3.fromArray(\r\n bottomPositions,\r\n i3,\r\n scratchCartesian3Position2\r\n );\r\n\r\n // insert the lower point\r\n positions[positionIndex++] = bottomPosition.x;\r\n positions[positionIndex++] = bottomPosition.y;\r\n positions[positionIndex++] = bottomPosition.z;\r\n\r\n // insert the upper point\r\n positions[positionIndex++] = topPosition.x;\r\n positions[positionIndex++] = topPosition.y;\r\n positions[positionIndex++] = topPosition.z;\r\n }\r\n\r\n const attributes = new GeometryAttributes({\r\n position: new GeometryAttribute({\r\n componentDatatype: ComponentDatatype.DOUBLE,\r\n componentsPerAttribute: 3,\r\n values: positions,\r\n }),\r\n });\r\n\r\n const numVertices = size / 3;\r\n size = 2 * numVertices - 4 + numVertices;\r\n const indices = IndexDatatype.createTypedArray(numVertices, size);\r\n\r\n let edgeIndex = 0;\r\n for (i = 0; i < numVertices - 2; i += 2) {\r\n const LL = i;\r\n const LR = i + 2;\r\n const pl = Cartesian3.fromArray(\r\n positions,\r\n LL * 3,\r\n scratchCartesian3Position1\r\n );\r\n const pr = Cartesian3.fromArray(\r\n positions,\r\n LR * 3,\r\n scratchCartesian3Position2\r\n );\r\n if (Cartesian3.equalsEpsilon(pl, pr, CesiumMath.EPSILON10)) {\r\n continue;\r\n }\r\n const UL = i + 1;\r\n const UR = i + 3;\r\n\r\n indices[edgeIndex++] = UL;\r\n indices[edgeIndex++] = LL;\r\n indices[edgeIndex++] = UL;\r\n indices[edgeIndex++] = UR;\r\n indices[edgeIndex++] = LL;\r\n indices[edgeIndex++] = LR;\r\n }\r\n\r\n indices[edgeIndex++] = numVertices - 2;\r\n indices[edgeIndex++] = numVertices - 1;\r\n\r\n return new Geometry({\r\n attributes: attributes,\r\n indices: indices,\r\n primitiveType: PrimitiveType.LINES,\r\n boundingSphere: new BoundingSphere.fromVertices(positions),\r\n });\r\n};\r\nexport default WallOutlineGeometry;\r\n","import defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport WallOutlineGeometry from \"../Core/WallOutlineGeometry.js\";\r\n\r\nfunction createWallOutlineGeometry(wallGeometry, offset) {\r\n if (defined(offset)) {\r\n wallGeometry = WallOutlineGeometry.unpack(wallGeometry, offset);\r\n }\r\n wallGeometry._ellipsoid = Ellipsoid.clone(wallGeometry._ellipsoid);\r\n return WallOutlineGeometry.createGeometry(wallGeometry);\r\n}\r\nexport default createWallOutlineGeometry;\r\n"],"names":["Cartesian3","defaultValue","defined","DeveloperError","CesiumMath","Ellipsoid","WallGeometryLibrary","GeometryAttributes","GeometryAttribute","ComponentDatatype","IndexDatatype","Geometry","PrimitiveType","BoundingSphere"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,0BAA0B,GAAG,IAAIA,kBAAU,EAAE,CAAC;EACpD,MAAM,0BAA0B,GAAG,IAAIA,kBAAU,EAAE,CAAC;AACpD;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,mBAAmB,CAAC,OAAO,EAAE;EACtC,EAAE,OAAO,GAAGC,yBAAY,CAAC,OAAO,EAAEA,yBAAY,CAAC,YAAY,CAAC,CAAC;AAC7D;EACA,EAAE,MAAM,aAAa,GAAG,OAAO,CAAC,SA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AAC,cAAc,CAAC,YAAY,CAAC,CAAC;EAC1D;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/decodeDraco.js b/examples/cesium/Workers/decodeDraco.js
new file mode 100644
index 0000000..6c37953
--- /dev/null
+++ b/examples/cesium/Workers/decodeDraco.js
@@ -0,0 +1,407 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./ComponentDatatype-13a5630b', './defaultValue-0ab18f7d', './IndexDatatype-b4e5cf89', './RuntimeError-e5c6a8b9', './createTaskProcessorWorker', './Check-d10e5f2e', './WebGLConstants-f27a5e29', './Math-9be8b918'], (function (ComponentDatatype, defaultValue, IndexDatatype, RuntimeError, createTaskProcessorWorker, Check, WebGLConstants, Math) { 'use strict';
+
+ /* global require */
+
+ let draco;
+
+ function decodeIndexArray(dracoGeometry, dracoDecoder) {
+ const numPoints = dracoGeometry.num_points();
+ const numFaces = dracoGeometry.num_faces();
+ const faceIndices = new draco.DracoInt32Array();
+ const numIndices = numFaces * 3;
+ const indexArray = IndexDatatype.IndexDatatype.createTypedArray(numPoints, numIndices);
+
+ let offset = 0;
+ for (let i = 0; i < numFaces; ++i) {
+ dracoDecoder.GetFaceFromMesh(dracoGeometry, i, faceIndices);
+
+ indexArray[offset + 0] = faceIndices.GetValue(0);
+ indexArray[offset + 1] = faceIndices.GetValue(1);
+ indexArray[offset + 2] = faceIndices.GetValue(2);
+ offset += 3;
+ }
+
+ draco.destroy(faceIndices);
+
+ return {
+ typedArray: indexArray,
+ numberOfIndices: numIndices,
+ };
+ }
+
+ function decodeQuantizedDracoTypedArray(
+ dracoGeometry,
+ dracoDecoder,
+ dracoAttribute,
+ quantization,
+ vertexArrayLength
+ ) {
+ let vertexArray;
+ let attributeData;
+ if (quantization.quantizationBits <= 8) {
+ attributeData = new draco.DracoUInt8Array();
+ vertexArray = new Uint8Array(vertexArrayLength);
+ dracoDecoder.GetAttributeUInt8ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ attributeData
+ );
+ } else {
+ attributeData = new draco.DracoUInt16Array();
+ vertexArray = new Uint16Array(vertexArrayLength);
+ dracoDecoder.GetAttributeUInt16ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ attributeData
+ );
+ }
+
+ for (let i = 0; i < vertexArrayLength; ++i) {
+ vertexArray[i] = attributeData.GetValue(i);
+ }
+
+ draco.destroy(attributeData);
+ return vertexArray;
+ }
+
+ function decodeDracoTypedArray(
+ dracoGeometry,
+ dracoDecoder,
+ dracoAttribute,
+ vertexArrayLength
+ ) {
+ let vertexArray;
+ let attributeData;
+
+ // Some attribute types are casted down to 32 bit since Draco only returns 32 bit values
+ switch (dracoAttribute.data_type()) {
+ case 1:
+ case 11: // DT_INT8 or DT_BOOL
+ attributeData = new draco.DracoInt8Array();
+ vertexArray = new Int8Array(vertexArrayLength);
+ dracoDecoder.GetAttributeInt8ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ attributeData
+ );
+ break;
+ case 2: // DT_UINT8
+ attributeData = new draco.DracoUInt8Array();
+ vertexArray = new Uint8Array(vertexArrayLength);
+ dracoDecoder.GetAttributeUInt8ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ attributeData
+ );
+ break;
+ case 3: // DT_INT16
+ attributeData = new draco.DracoInt16Array();
+ vertexArray = new Int16Array(vertexArrayLength);
+ dracoDecoder.GetAttributeInt16ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ attributeData
+ );
+ break;
+ case 4: // DT_UINT16
+ attributeData = new draco.DracoUInt16Array();
+ vertexArray = new Uint16Array(vertexArrayLength);
+ dracoDecoder.GetAttributeUInt16ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ attributeData
+ );
+ break;
+ case 5:
+ case 7: // DT_INT32 or DT_INT64
+ attributeData = new draco.DracoInt32Array();
+ vertexArray = new Int32Array(vertexArrayLength);
+ dracoDecoder.GetAttributeInt32ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ attributeData
+ );
+ break;
+ case 6:
+ case 8: // DT_UINT32 or DT_UINT64
+ attributeData = new draco.DracoUInt32Array();
+ vertexArray = new Uint32Array(vertexArrayLength);
+ dracoDecoder.GetAttributeUInt32ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ attributeData
+ );
+ break;
+ case 9:
+ case 10: // DT_FLOAT32 or DT_FLOAT64
+ attributeData = new draco.DracoFloat32Array();
+ vertexArray = new Float32Array(vertexArrayLength);
+ dracoDecoder.GetAttributeFloatForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ attributeData
+ );
+ break;
+ }
+
+ for (let i = 0; i < vertexArrayLength; ++i) {
+ vertexArray[i] = attributeData.GetValue(i);
+ }
+
+ draco.destroy(attributeData);
+ return vertexArray;
+ }
+
+ function decodeAttribute(dracoGeometry, dracoDecoder, dracoAttribute) {
+ const numPoints = dracoGeometry.num_points();
+ const numComponents = dracoAttribute.num_components();
+
+ let quantization;
+ let transform = new draco.AttributeQuantizationTransform();
+ if (transform.InitFromAttribute(dracoAttribute)) {
+ const minValues = new Array(numComponents);
+ for (let i = 0; i < numComponents; ++i) {
+ minValues[i] = transform.min_value(i);
+ }
+ quantization = {
+ quantizationBits: transform.quantization_bits(),
+ minValues: minValues,
+ range: transform.range(),
+ octEncoded: false,
+ };
+ }
+ draco.destroy(transform);
+
+ transform = new draco.AttributeOctahedronTransform();
+ if (transform.InitFromAttribute(dracoAttribute)) {
+ quantization = {
+ quantizationBits: transform.quantization_bits(),
+ octEncoded: true,
+ };
+ }
+ draco.destroy(transform);
+
+ const vertexArrayLength = numPoints * numComponents;
+ let vertexArray;
+ if (defaultValue.defined(quantization)) {
+ vertexArray = decodeQuantizedDracoTypedArray(
+ dracoGeometry,
+ dracoDecoder,
+ dracoAttribute,
+ quantization,
+ vertexArrayLength
+ );
+ } else {
+ vertexArray = decodeDracoTypedArray(
+ dracoGeometry,
+ dracoDecoder,
+ dracoAttribute,
+ vertexArrayLength
+ );
+ }
+
+ const componentDatatype = ComponentDatatype.ComponentDatatype.fromTypedArray(vertexArray);
+
+ return {
+ array: vertexArray,
+ data: {
+ componentsPerAttribute: numComponents,
+ componentDatatype: componentDatatype,
+ byteOffset: dracoAttribute.byte_offset(),
+ byteStride:
+ ComponentDatatype.ComponentDatatype.getSizeInBytes(componentDatatype) * numComponents,
+ normalized: dracoAttribute.normalized(),
+ quantization: quantization,
+ },
+ };
+ }
+
+ function decodePointCloud(parameters) {
+ const dracoDecoder = new draco.Decoder();
+
+ if (parameters.dequantizeInShader) {
+ dracoDecoder.SkipAttributeTransform(draco.POSITION);
+ dracoDecoder.SkipAttributeTransform(draco.NORMAL);
+ }
+
+ const buffer = new draco.DecoderBuffer();
+ buffer.Init(parameters.buffer, parameters.buffer.length);
+
+ const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);
+ if (geometryType !== draco.POINT_CLOUD) {
+ throw new RuntimeError.RuntimeError("Draco geometry type must be POINT_CLOUD.");
+ }
+
+ const dracoPointCloud = new draco.PointCloud();
+ const decodingStatus = dracoDecoder.DecodeBufferToPointCloud(
+ buffer,
+ dracoPointCloud
+ );
+ if (!decodingStatus.ok() || dracoPointCloud.ptr === 0) {
+ throw new RuntimeError.RuntimeError(
+ `Error decoding draco point cloud: ${decodingStatus.error_msg()}`
+ );
+ }
+
+ draco.destroy(buffer);
+
+ const result = {};
+
+ const properties = parameters.properties;
+ for (const propertyName in properties) {
+ if (properties.hasOwnProperty(propertyName)) {
+ let dracoAttribute;
+ if (propertyName === "POSITION" || propertyName === "NORMAL") {
+ const dracoAttributeId = dracoDecoder.GetAttributeId(
+ dracoPointCloud,
+ draco[propertyName]
+ );
+ dracoAttribute = dracoDecoder.GetAttribute(
+ dracoPointCloud,
+ dracoAttributeId
+ );
+ } else {
+ const attributeId = properties[propertyName];
+ dracoAttribute = dracoDecoder.GetAttributeByUniqueId(
+ dracoPointCloud,
+ attributeId
+ );
+ }
+ result[propertyName] = decodeAttribute(
+ dracoPointCloud,
+ dracoDecoder,
+ dracoAttribute
+ );
+ }
+ }
+
+ draco.destroy(dracoPointCloud);
+ draco.destroy(dracoDecoder);
+
+ return result;
+ }
+
+ function decodePrimitive(parameters) {
+ const dracoDecoder = new draco.Decoder();
+
+ // Skip all parameter types except generic
+ const attributesToSkip = ["POSITION", "NORMAL", "COLOR", "TEX_COORD"];
+ if (parameters.dequantizeInShader) {
+ for (let i = 0; i < attributesToSkip.length; ++i) {
+ dracoDecoder.SkipAttributeTransform(draco[attributesToSkip[i]]);
+ }
+ }
+
+ const bufferView = parameters.bufferView;
+ const buffer = new draco.DecoderBuffer();
+ buffer.Init(parameters.array, bufferView.byteLength);
+
+ const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);
+ if (geometryType !== draco.TRIANGULAR_MESH) {
+ throw new RuntimeError.RuntimeError("Unsupported draco mesh geometry type.");
+ }
+
+ const dracoGeometry = new draco.Mesh();
+ const decodingStatus = dracoDecoder.DecodeBufferToMesh(buffer, dracoGeometry);
+ if (!decodingStatus.ok() || dracoGeometry.ptr === 0) {
+ throw new RuntimeError.RuntimeError(
+ `Error decoding draco mesh geometry: ${decodingStatus.error_msg()}`
+ );
+ }
+
+ draco.destroy(buffer);
+
+ const attributeData = {};
+
+ const compressedAttributes = parameters.compressedAttributes;
+ for (const attributeName in compressedAttributes) {
+ if (compressedAttributes.hasOwnProperty(attributeName)) {
+ const compressedAttribute = compressedAttributes[attributeName];
+ const dracoAttribute = dracoDecoder.GetAttributeByUniqueId(
+ dracoGeometry,
+ compressedAttribute
+ );
+ attributeData[attributeName] = decodeAttribute(
+ dracoGeometry,
+ dracoDecoder,
+ dracoAttribute
+ );
+ }
+ }
+
+ const result = {
+ indexArray: decodeIndexArray(dracoGeometry, dracoDecoder),
+ attributeData: attributeData,
+ };
+
+ draco.destroy(dracoGeometry);
+ draco.destroy(dracoDecoder);
+
+ return result;
+ }
+
+ function decode(parameters) {
+ if (defaultValue.defined(parameters.bufferView)) {
+ return decodePrimitive(parameters);
+ }
+ return decodePointCloud(parameters);
+ }
+
+ function initWorker(dracoModule) {
+ draco = dracoModule;
+ self.onmessage = createTaskProcessorWorker(decode);
+ self.postMessage(true);
+ }
+
+ function decodeDraco(event) {
+ const data = event.data;
+
+ // Expect the first message to be to load a web assembly module
+ const wasmConfig = data.webAssemblyConfig;
+ if (defaultValue.defined(wasmConfig)) {
+ // Require and compile WebAssembly module, or use fallback if not supported
+ return require([wasmConfig.modulePath], function (dracoModule) {
+ if (defaultValue.defined(wasmConfig.wasmBinaryFile)) {
+ if (!defaultValue.defined(dracoModule)) {
+ dracoModule = self.DracoDecoderModule;
+ }
+
+ dracoModule(wasmConfig).then(function (compiledModule) {
+ initWorker(compiledModule);
+ });
+ } else {
+ initWorker(dracoModule());
+ }
+ });
+ }
+ }
+
+ return decodeDraco;
+
+}));
+//# sourceMappingURL=decodeDraco.js.map
diff --git a/examples/cesium/Workers/decodeDraco.js.map b/examples/cesium/Workers/decodeDraco.js.map
new file mode 100644
index 0000000..bacb171
--- /dev/null
+++ b/examples/cesium/Workers/decodeDraco.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeDraco.js","sources":["../../../Source/WorkersES6/decodeDraco.js"],"sourcesContent":["/* global require */\r\nimport ComponentDatatype from \"../Core/ComponentDatatype.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\r\nimport RuntimeError from \"../Core/RuntimeError.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nlet draco;\r\n\r\nfunction decodeIndexArray(dracoGeometry, dracoDecoder) {\r\n const numPoints = dracoGeometry.num_points();\r\n const numFaces = dracoGeometry.num_faces();\r\n const faceIndices = new draco.DracoInt32Array();\r\n const numIndices = numFaces * 3;\r\n const indexArray = IndexDatatype.createTypedArray(numPoints, numIndices);\r\n\r\n let offset = 0;\r\n for (let i = 0; i < numFaces; ++i) {\r\n dracoDecoder.GetFaceFromMesh(dracoGeometry, i, faceIndices);\r\n\r\n indexArray[offset + 0] = faceIndices.GetValue(0);\r\n indexArray[offset + 1] = faceIndices.GetValue(1);\r\n indexArray[offset + 2] = faceIndices.GetValue(2);\r\n offset += 3;\r\n }\r\n\r\n draco.destroy(faceIndices);\r\n\r\n return {\r\n typedArray: indexArray,\r\n numberOfIndices: numIndices,\r\n };\r\n}\r\n\r\nfunction decodeQuantizedDracoTypedArray(\r\n dracoGeometry,\r\n dracoDecoder,\r\n dracoAttribute,\r\n quantization,\r\n vertexArrayLength\r\n) {\r\n let vertexArray;\r\n let attributeData;\r\n if (quantization.quantizationBits <= 8) {\r\n attributeData = new draco.DracoUInt8Array();\r\n vertexArray = new Uint8Array(vertexArrayLength);\r\n dracoDecoder.GetAttributeUInt8ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n attributeData\r\n );\r\n } else {\r\n attributeData = new draco.DracoUInt16Array();\r\n vertexArray = new Uint16Array(vertexArrayLength);\r\n dracoDecoder.GetAttributeUInt16ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n attributeData\r\n );\r\n }\r\n\r\n for (let i = 0; i < vertexArrayLength; ++i) {\r\n vertexArray[i] = attributeData.GetValue(i);\r\n }\r\n\r\n draco.destroy(attributeData);\r\n return vertexArray;\r\n}\r\n\r\nfunction decodeDracoTypedArray(\r\n dracoGeometry,\r\n dracoDecoder,\r\n dracoAttribute,\r\n vertexArrayLength\r\n) {\r\n let vertexArray;\r\n let attributeData;\r\n\r\n // Some attribute types are casted down to 32 bit since Draco only returns 32 bit values\r\n switch (dracoAttribute.data_type()) {\r\n case 1:\r\n case 11: // DT_INT8 or DT_BOOL\r\n attributeData = new draco.DracoInt8Array();\r\n vertexArray = new Int8Array(vertexArrayLength);\r\n dracoDecoder.GetAttributeInt8ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n attributeData\r\n );\r\n break;\r\n case 2: // DT_UINT8\r\n attributeData = new draco.DracoUInt8Array();\r\n vertexArray = new Uint8Array(vertexArrayLength);\r\n dracoDecoder.GetAttributeUInt8ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n attributeData\r\n );\r\n break;\r\n case 3: // DT_INT16\r\n attributeData = new draco.DracoInt16Array();\r\n vertexArray = new Int16Array(vertexArrayLength);\r\n dracoDecoder.GetAttributeInt16ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n attributeData\r\n );\r\n break;\r\n case 4: // DT_UINT16\r\n attributeData = new draco.DracoUInt16Array();\r\n vertexArray = new Uint16Array(vertexArrayLength);\r\n dracoDecoder.GetAttributeUInt16ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n attributeData\r\n );\r\n break;\r\n case 5:\r\n case 7: // DT_INT32 or DT_INT64\r\n attributeData = new draco.DracoInt32Array();\r\n vertexArray = new Int32Array(vertexArrayLength);\r\n dracoDecoder.GetAttributeInt32ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n attributeData\r\n );\r\n break;\r\n case 6:\r\n case 8: // DT_UINT32 or DT_UINT64\r\n attributeData = new draco.DracoUInt32Array();\r\n vertexArray = new Uint32Array(vertexArrayLength);\r\n dracoDecoder.GetAttributeUInt32ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n attributeData\r\n );\r\n break;\r\n case 9:\r\n case 10: // DT_FLOAT32 or DT_FLOAT64\r\n attributeData = new draco.DracoFloat32Array();\r\n vertexArray = new Float32Array(vertexArrayLength);\r\n dracoDecoder.GetAttributeFloatForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n attributeData\r\n );\r\n break;\r\n }\r\n\r\n for (let i = 0; i < vertexArrayLength; ++i) {\r\n vertexArray[i] = attributeData.GetValue(i);\r\n }\r\n\r\n draco.destroy(attributeData);\r\n return vertexArray;\r\n}\r\n\r\nfunction decodeAttribute(dracoGeometry, dracoDecoder, dracoAttribute) {\r\n const numPoints = dracoGeometry.num_points();\r\n const numComponents = dracoAttribute.num_components();\r\n\r\n let quantization;\r\n let transform = new draco.AttributeQuantizationTransform();\r\n if (transform.InitFromAttribute(dracoAttribute)) {\r\n const minValues = new Array(numComponents);\r\n for (let i = 0; i < numComponents; ++i) {\r\n minValues[i] = transform.min_value(i);\r\n }\r\n quantization = {\r\n quantizationBits: transform.quantization_bits(),\r\n minValues: minValues,\r\n range: transform.range(),\r\n octEncoded: false,\r\n };\r\n }\r\n draco.destroy(transform);\r\n\r\n transform = new draco.AttributeOctahedronTransform();\r\n if (transform.InitFromAttribute(dracoAttribute)) {\r\n quantization = {\r\n quantizationBits: transform.quantization_bits(),\r\n octEncoded: true,\r\n };\r\n }\r\n draco.destroy(transform);\r\n\r\n const vertexArrayLength = numPoints * numComponents;\r\n let vertexArray;\r\n if (defined(quantization)) {\r\n vertexArray = decodeQuantizedDracoTypedArray(\r\n dracoGeometry,\r\n dracoDecoder,\r\n dracoAttribute,\r\n quantization,\r\n vertexArrayLength\r\n );\r\n } else {\r\n vertexArray = decodeDracoTypedArray(\r\n dracoGeometry,\r\n dracoDecoder,\r\n dracoAttribute,\r\n vertexArrayLength\r\n );\r\n }\r\n\r\n const componentDatatype = ComponentDatatype.fromTypedArray(vertexArray);\r\n\r\n return {\r\n array: vertexArray,\r\n data: {\r\n componentsPerAttribute: numComponents,\r\n componentDatatype: componentDatatype,\r\n byteOffset: dracoAttribute.byte_offset(),\r\n byteStride:\r\n ComponentDatatype.getSizeInBytes(componentDatatype) * numComponents,\r\n normalized: dracoAttribute.normalized(),\r\n quantization: quantization,\r\n },\r\n };\r\n}\r\n\r\nfunction decodePointCloud(parameters) {\r\n const dracoDecoder = new draco.Decoder();\r\n\r\n if (parameters.dequantizeInShader) {\r\n dracoDecoder.SkipAttributeTransform(draco.POSITION);\r\n dracoDecoder.SkipAttributeTransform(draco.NORMAL);\r\n }\r\n\r\n const buffer = new draco.DecoderBuffer();\r\n buffer.Init(parameters.buffer, parameters.buffer.length);\r\n\r\n const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);\r\n if (geometryType !== draco.POINT_CLOUD) {\r\n throw new RuntimeError(\"Draco geometry type must be POINT_CLOUD.\");\r\n }\r\n\r\n const dracoPointCloud = new draco.PointCloud();\r\n const decodingStatus = dracoDecoder.DecodeBufferToPointCloud(\r\n buffer,\r\n dracoPointCloud\r\n );\r\n if (!decodingStatus.ok() || dracoPointCloud.ptr === 0) {\r\n throw new RuntimeError(\r\n `Error decoding draco point cloud: ${decodingStatus.error_msg()}`\r\n );\r\n }\r\n\r\n draco.destroy(buffer);\r\n\r\n const result = {};\r\n\r\n const properties = parameters.properties;\r\n for (const propertyName in properties) {\r\n if (properties.hasOwnProperty(propertyName)) {\r\n let dracoAttribute;\r\n if (propertyName === \"POSITION\" || propertyName === \"NORMAL\") {\r\n const dracoAttributeId = dracoDecoder.GetAttributeId(\r\n dracoPointCloud,\r\n draco[propertyName]\r\n );\r\n dracoAttribute = dracoDecoder.GetAttribute(\r\n dracoPointCloud,\r\n dracoAttributeId\r\n );\r\n } else {\r\n const attributeId = properties[propertyName];\r\n dracoAttribute = dracoDecoder.GetAttributeByUniqueId(\r\n dracoPointCloud,\r\n attributeId\r\n );\r\n }\r\n result[propertyName] = decodeAttribute(\r\n dracoPointCloud,\r\n dracoDecoder,\r\n dracoAttribute\r\n );\r\n }\r\n }\r\n\r\n draco.destroy(dracoPointCloud);\r\n draco.destroy(dracoDecoder);\r\n\r\n return result;\r\n}\r\n\r\nfunction decodePrimitive(parameters) {\r\n const dracoDecoder = new draco.Decoder();\r\n\r\n // Skip all parameter types except generic\r\n const attributesToSkip = [\"POSITION\", \"NORMAL\", \"COLOR\", \"TEX_COORD\"];\r\n if (parameters.dequantizeInShader) {\r\n for (let i = 0; i < attributesToSkip.length; ++i) {\r\n dracoDecoder.SkipAttributeTransform(draco[attributesToSkip[i]]);\r\n }\r\n }\r\n\r\n const bufferView = parameters.bufferView;\r\n const buffer = new draco.DecoderBuffer();\r\n buffer.Init(parameters.array, bufferView.byteLength);\r\n\r\n const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);\r\n if (geometryType !== draco.TRIANGULAR_MESH) {\r\n throw new RuntimeError(\"Unsupported draco mesh geometry type.\");\r\n }\r\n\r\n const dracoGeometry = new draco.Mesh();\r\n const decodingStatus = dracoDecoder.DecodeBufferToMesh(buffer, dracoGeometry);\r\n if (!decodingStatus.ok() || dracoGeometry.ptr === 0) {\r\n throw new RuntimeError(\r\n `Error decoding draco mesh geometry: ${decodingStatus.error_msg()}`\r\n );\r\n }\r\n\r\n draco.destroy(buffer);\r\n\r\n const attributeData = {};\r\n\r\n const compressedAttributes = parameters.compressedAttributes;\r\n for (const attributeName in compressedAttributes) {\r\n if (compressedAttributes.hasOwnProperty(attributeName)) {\r\n const compressedAttribute = compressedAttributes[attributeName];\r\n const dracoAttribute = dracoDecoder.GetAttributeByUniqueId(\r\n dracoGeometry,\r\n compressedAttribute\r\n );\r\n attributeData[attributeName] = decodeAttribute(\r\n dracoGeometry,\r\n dracoDecoder,\r\n dracoAttribute\r\n );\r\n }\r\n }\r\n\r\n const result = {\r\n indexArray: decodeIndexArray(dracoGeometry, dracoDecoder),\r\n attributeData: attributeData,\r\n };\r\n\r\n draco.destroy(dracoGeometry);\r\n draco.destroy(dracoDecoder);\r\n\r\n return result;\r\n}\r\n\r\nfunction decode(parameters) {\r\n if (defined(parameters.bufferView)) {\r\n return decodePrimitive(parameters);\r\n }\r\n return decodePointCloud(parameters);\r\n}\r\n\r\nfunction initWorker(dracoModule) {\r\n draco = dracoModule;\r\n self.onmessage = createTaskProcessorWorker(decode);\r\n self.postMessage(true);\r\n}\r\n\r\nfunction decodeDraco(event) {\r\n const data = event.data;\r\n\r\n // Expect the first message to be to load a web assembly module\r\n const wasmConfig = data.webAssemblyConfig;\r\n if (defined(wasmConfig)) {\r\n // Require and compile WebAssembly module, or use fallback if not supported\r\n return require([wasmConfig.modulePath], function (dracoModule) {\r\n if (defined(wasmConfig.wasmBinaryFile)) {\r\n if (!defined(dracoModule)) {\r\n dracoModule = self.DracoDecoderModule;\r\n }\r\n\r\n dracoModule(wasmConfig).then(function (compiledModule) {\r\n initWorker(compiledModule);\r\n });\r\n } else {\r\n initWorker(dracoModule());\r\n }\r\n });\r\n }\r\n}\r\nexport default decodeDraco;\r\n"],"names":["IndexDatatype","defined","ComponentDatatype","RuntimeError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;AAMA;EACA,IAAI,KAAK,CAAC;AACV;EACA,SAAS,gBAAgB,CAAC,aAAa,EAAE,YAAY,EAAE;EACvD,EAAE,MAAM,SAAS,GAAG,aAAa,CAAC,UAAU,EAAE,CAAC;EAC/C,EAAE,MAAM,QAAQ,GAAG,aAAa,CAAC,SAAS,EAAE,CAAC;EAC7C,EAAE,MAAM,WAAW,GAAG,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;EAClD,EAAE,MAAM,UAAU,GAAG,QAAQ,GAAG,CAAC,CAAC;EAClC,EAAE,MAAM,UAAU,GAAGA,2BAAa,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAC3E;EACA,EAAE,IAAI,MAAM,GAAG,CAAC,CAAC;EACjB,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,EAAE,EAAE,CAAC,EAAE;EACrC,IAAI,YAAY,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC,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AE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AAC1B;EACA;EACA,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC;EAC5C,EAAE,IAAIA,oBAAO,CAAC,UAAU,CAAC,EAAE;EAC3B;EACA,IAAI,OAAO,OAAO,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,UAAU,WAAW,EAAE;EACnE,MAAM,IAAIA,oBAAO,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE;EAC9C,QAAQ,IAAI,CAACA,oBAAO,CAAC,WAAW,CAAC,EAAE;EACnC,UAAU,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC;EAChD,SAAS;AACT;EACA,QAAQ,WAAW,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,cAAc,EAAE;EAC/D,UAAU,UAAU,CAAC,cAAc,CAAC,CAAC;EACrC,SAAS,CAAC,CAAC;EACX,OAAO,MAAM;EACb,QAAQ,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;EAClC,OAAO;EACP,KAAK,CAAC,CAAC;EACP,GAAG;EACH;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/decodeGoogleEarthEnterprisePacket.js b/examples/cesium/Workers/decodeGoogleEarthEnterprisePacket.js
new file mode 100644
index 0000000..2a07f56
--- /dev/null
+++ b/examples/cesium/Workers/decodeGoogleEarthEnterprisePacket.js
@@ -0,0 +1,3713 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./Check-d10e5f2e', './RuntimeError-e5c6a8b9', './defaultValue-0ab18f7d', './createTaskProcessorWorker'], (function (Check, RuntimeError, defaultValue, createTaskProcessorWorker) { 'use strict';
+
+ const compressedMagic$1 = 0x7468dead;
+ const compressedMagicSwap$1 = 0xadde6874;
+
+ /**
+ * Decodes data that is received from the Google Earth Enterprise server.
+ *
+ * @param {ArrayBuffer} key The key used during decoding.
+ * @param {ArrayBuffer} data The data to be decoded.
+ *
+ * @private
+ */
+ function decodeGoogleEarthEnterpriseData(key, data) {
+ if (decodeGoogleEarthEnterpriseData.passThroughDataForTesting) {
+ return data;
+ }
+
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("key", key);
+ Check.Check.typeOf.object("data", data);
+ //>>includeEnd('debug');
+
+ const keyLength = key.byteLength;
+ if (keyLength === 0 || keyLength % 4 !== 0) {
+ throw new RuntimeError.RuntimeError(
+ "The length of key must be greater than 0 and a multiple of 4."
+ );
+ }
+
+ const dataView = new DataView(data);
+ const magic = dataView.getUint32(0, true);
+ if (magic === compressedMagic$1 || magic === compressedMagicSwap$1) {
+ // Occasionally packets don't come back encoded, so just return
+ return data;
+ }
+
+ const keyView = new DataView(key);
+
+ let dp = 0;
+ const dpend = data.byteLength;
+ const dpend64 = dpend - (dpend % 8);
+ const kpend = keyLength;
+ let kp;
+ let off = 8;
+
+ // This algorithm is intentionally asymmetric to make it more difficult to
+ // guess. Security through obscurity. :-(
+
+ // while we have a full uint64 (8 bytes) left to do
+ // assumes buffer is 64bit aligned (or processor doesn't care)
+ while (dp < dpend64) {
+ // rotate the key each time through by using the offets 16,0,8,16,0,8,...
+ off = (off + 8) % 24;
+ kp = off;
+
+ // run through one key length xor'ing one uint64 at a time
+ // then drop out to rotate the key for the next bit
+ while (dp < dpend64 && kp < kpend) {
+ dataView.setUint32(
+ dp,
+ dataView.getUint32(dp, true) ^ keyView.getUint32(kp, true),
+ true
+ );
+ dataView.setUint32(
+ dp + 4,
+ dataView.getUint32(dp + 4, true) ^ keyView.getUint32(kp + 4, true),
+ true
+ );
+ dp += 8;
+ kp += 24;
+ }
+ }
+
+ // now the remaining 1 to 7 bytes
+ if (dp < dpend) {
+ if (kp >= kpend) {
+ // rotate the key one last time (if necessary)
+ off = (off + 8) % 24;
+ kp = off;
+ }
+
+ while (dp < dpend) {
+ dataView.setUint8(dp, dataView.getUint8(dp) ^ keyView.getUint8(kp));
+ dp++;
+ kp++;
+ }
+ }
+ }
+
+ decodeGoogleEarthEnterpriseData.passThroughDataForTesting = false;
+
+ /**
+ * @private
+ */
+ function isBitSet(bits, mask) {
+ return (bits & mask) !== 0;
+ }
+
+ // Bitmask for checking tile properties
+ const childrenBitmasks = [0x01, 0x02, 0x04, 0x08];
+ const anyChildBitmask = 0x0f;
+ const cacheFlagBitmask = 0x10; // True if there is a child subtree
+ const imageBitmask = 0x40;
+ const terrainBitmask = 0x80;
+
+ /**
+ * Contains information about each tile from a Google Earth Enterprise server
+ *
+ * @param {Number} bits Bitmask that contains the type of data and available children for each tile.
+ * @param {Number} cnodeVersion Version of the request for subtree metadata.
+ * @param {Number} imageryVersion Version of the request for imagery tile.
+ * @param {Number} terrainVersion Version of the request for terrain tile.
+ * @param {Number} imageryProvider Id of imagery provider.
+ * @param {Number} terrainProvider Id of terrain provider.
+ *
+ * @private
+ */
+ function GoogleEarthEnterpriseTileInformation(
+ bits,
+ cnodeVersion,
+ imageryVersion,
+ terrainVersion,
+ imageryProvider,
+ terrainProvider
+ ) {
+ this._bits = bits;
+ this.cnodeVersion = cnodeVersion;
+ this.imageryVersion = imageryVersion;
+ this.terrainVersion = terrainVersion;
+ this.imageryProvider = imageryProvider;
+ this.terrainProvider = terrainProvider;
+ this.ancestorHasTerrain = false; // Set it later once we find its parent
+ this.terrainState = undefined;
+ }
+
+ /**
+ * Creates GoogleEarthEnterpriseTileInformation from an object
+ *
+ * @param {Object} info Object to be cloned
+ * @param {GoogleEarthEnterpriseTileInformation} [result] The object onto which to store the result.
+ * @returns {GoogleEarthEnterpriseTileInformation} The modified result parameter or a new GoogleEarthEnterpriseTileInformation instance if none was provided.
+ */
+ GoogleEarthEnterpriseTileInformation.clone = function (info, result) {
+ if (!defaultValue.defined(result)) {
+ result = new GoogleEarthEnterpriseTileInformation(
+ info._bits,
+ info.cnodeVersion,
+ info.imageryVersion,
+ info.terrainVersion,
+ info.imageryProvider,
+ info.terrainProvider
+ );
+ } else {
+ result._bits = info._bits;
+ result.cnodeVersion = info.cnodeVersion;
+ result.imageryVersion = info.imageryVersion;
+ result.terrainVersion = info.terrainVersion;
+ result.imageryProvider = info.imageryProvider;
+ result.terrainProvider = info.terrainProvider;
+ }
+ result.ancestorHasTerrain = info.ancestorHasTerrain;
+ result.terrainState = info.terrainState;
+
+ return result;
+ };
+
+ /**
+ * Sets the parent for the tile
+ *
+ * @param {GoogleEarthEnterpriseTileInformation} parent Parent tile
+ */
+ GoogleEarthEnterpriseTileInformation.prototype.setParent = function (parent) {
+ this.ancestorHasTerrain = parent.ancestorHasTerrain || this.hasTerrain();
+ };
+
+ /**
+ * Gets whether a subtree is available
+ *
+ * @returns {Boolean} true if subtree is available, false otherwise.
+ */
+ GoogleEarthEnterpriseTileInformation.prototype.hasSubtree = function () {
+ return isBitSet(this._bits, cacheFlagBitmask);
+ };
+
+ /**
+ * Gets whether imagery is available
+ *
+ * @returns {Boolean} true if imagery is available, false otherwise.
+ */
+ GoogleEarthEnterpriseTileInformation.prototype.hasImagery = function () {
+ return isBitSet(this._bits, imageBitmask);
+ };
+
+ /**
+ * Gets whether terrain is available
+ *
+ * @returns {Boolean} true if terrain is available, false otherwise.
+ */
+ GoogleEarthEnterpriseTileInformation.prototype.hasTerrain = function () {
+ return isBitSet(this._bits, terrainBitmask);
+ };
+
+ /**
+ * Gets whether any children are present
+ *
+ * @returns {Boolean} true if any children are available, false otherwise.
+ */
+ GoogleEarthEnterpriseTileInformation.prototype.hasChildren = function () {
+ return isBitSet(this._bits, anyChildBitmask);
+ };
+
+ /**
+ * Gets whether a specified child is available
+ *
+ * @param {Number} index Index of child tile
+ *
+ * @returns {Boolean} true if child is available, false otherwise
+ */
+ GoogleEarthEnterpriseTileInformation.prototype.hasChild = function (index) {
+ return isBitSet(this._bits, childrenBitmasks[index]);
+ };
+
+ /**
+ * Gets bitmask containing children
+ *
+ * @returns {Number} Children bitmask
+ */
+ GoogleEarthEnterpriseTileInformation.prototype.getChildBitmask = function () {
+ return this._bits & anyChildBitmask;
+ };
+
+ var inflate$3 = {};
+
+ var inflate$2 = {};
+
+ // Note: adler32 takes 12% for level 0 and 2% for level 6.
+ // It isn't worth it to make additional optimizations as in original.
+ // Small size is preferable.
+
+ // (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+ //
+ // This software is provided 'as-is', without any express or implied
+ // warranty. In no event will the authors be held liable for any damages
+ // arising from the use of this software.
+ //
+ // Permission is granted to anyone to use this software for any purpose,
+ // including commercial applications, and to alter it and redistribute it
+ // freely, subject to the following restrictions:
+ //
+ // 1. The origin of this software must not be misrepresented; you must not
+ // claim that you wrote the original software. If you use this software
+ // in a product, an acknowledgment in the product documentation would be
+ // appreciated but is not required.
+ // 2. Altered source versions must be plainly marked as such, and must not be
+ // misrepresented as being the original software.
+ // 3. This notice may not be removed or altered from any source distribution.
+
+ const adler32$1 = (adler, buf, len, pos) => {
+ let s1 = (adler & 0xffff) |0,
+ s2 = ((adler >>> 16) & 0xffff) |0,
+ n = 0;
+
+ while (len !== 0) {
+ // Set limit ~ twice less than 5552, to keep
+ // s2 in 31-bits, because we force signed ints.
+ // in other case %= will fail.
+ n = len > 2000 ? 2000 : len;
+ len -= n;
+
+ do {
+ s1 = (s1 + buf[pos++]) |0;
+ s2 = (s2 + s1) |0;
+ } while (--n);
+
+ s1 %= 65521;
+ s2 %= 65521;
+ }
+
+ return (s1 | (s2 << 16)) |0;
+ };
+
+
+ var adler32_1 = adler32$1;
+
+ // Note: we can't get significant speed boost here.
+ // So write code to minimize size - no pregenerated tables
+ // and array tools dependencies.
+
+ // (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+ //
+ // This software is provided 'as-is', without any express or implied
+ // warranty. In no event will the authors be held liable for any damages
+ // arising from the use of this software.
+ //
+ // Permission is granted to anyone to use this software for any purpose,
+ // including commercial applications, and to alter it and redistribute it
+ // freely, subject to the following restrictions:
+ //
+ // 1. The origin of this software must not be misrepresented; you must not
+ // claim that you wrote the original software. If you use this software
+ // in a product, an acknowledgment in the product documentation would be
+ // appreciated but is not required.
+ // 2. Altered source versions must be plainly marked as such, and must not be
+ // misrepresented as being the original software.
+ // 3. This notice may not be removed or altered from any source distribution.
+
+ // Use ordinary array, since untyped makes no boost here
+ const makeTable = () => {
+ let c, table = [];
+
+ for (var n = 0; n < 256; n++) {
+ c = n;
+ for (var k = 0; k < 8; k++) {
+ c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
+ }
+ table[n] = c;
+ }
+
+ return table;
+ };
+
+ // Create table on load. Just 255 signed longs. Not a problem.
+ const crcTable = new Uint32Array(makeTable());
+
+
+ const crc32$1 = (crc, buf, len, pos) => {
+ const t = crcTable;
+ const end = pos + len;
+
+ crc ^= -1;
+
+ for (let i = pos; i < end; i++) {
+ crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
+ }
+
+ return (crc ^ (-1)); // >>> 0;
+ };
+
+
+ var crc32_1 = crc32$1;
+
+ // (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+ //
+ // This software is provided 'as-is', without any express or implied
+ // warranty. In no event will the authors be held liable for any damages
+ // arising from the use of this software.
+ //
+ // Permission is granted to anyone to use this software for any purpose,
+ // including commercial applications, and to alter it and redistribute it
+ // freely, subject to the following restrictions:
+ //
+ // 1. The origin of this software must not be misrepresented; you must not
+ // claim that you wrote the original software. If you use this software
+ // in a product, an acknowledgment in the product documentation would be
+ // appreciated but is not required.
+ // 2. Altered source versions must be plainly marked as such, and must not be
+ // misrepresented as being the original software.
+ // 3. This notice may not be removed or altered from any source distribution.
+
+ // See state defs from inflate.js
+ const BAD$1 = 16209; /* got a data error -- remain here until reset */
+ const TYPE$1 = 16191; /* i: waiting for type bits, including last-flag bit */
+
+ /*
+ Decode literal, length, and distance codes and write out the resulting
+ literal and match bytes until either not enough input or output is
+ available, an end-of-block is encountered, or a data error is encountered.
+ When large enough input and output buffers are supplied to inflate(), for
+ example, a 16K input buffer and a 64K output buffer, more than 95% of the
+ inflate execution time is spent in this routine.
+
+ Entry assumptions:
+
+ state.mode === LEN
+ strm.avail_in >= 6
+ strm.avail_out >= 258
+ start >= strm.avail_out
+ state.bits < 8
+
+ On return, state.mode is one of:
+
+ LEN -- ran out of enough output space or enough available input
+ TYPE -- reached end of block code, inflate() to interpret next block
+ BAD -- error in block data
+
+ Notes:
+
+ - The maximum input bits used by a length/distance pair is 15 bits for the
+ length code, 5 bits for the length extra, 15 bits for the distance code,
+ and 13 bits for the distance extra. This totals 48 bits, or six bytes.
+ Therefore if strm.avail_in >= 6, then there is enough input to avoid
+ checking for available input while decoding.
+
+ - The maximum bytes that a single length/distance pair can output is 258
+ bytes, which is the maximum length that can be coded. inflate_fast()
+ requires strm.avail_out >= 258 for each loop to avoid checking for
+ output space.
+ */
+ var inffast = function inflate_fast(strm, start) {
+ let _in; /* local strm.input */
+ let last; /* have enough input while in < last */
+ let _out; /* local strm.output */
+ let beg; /* inflate()'s initial strm.output */
+ let end; /* while out < end, enough space available */
+ //#ifdef INFLATE_STRICT
+ let dmax; /* maximum distance from zlib header */
+ //#endif
+ let wsize; /* window size or zero if not using window */
+ let whave; /* valid bytes in the window */
+ let wnext; /* window write index */
+ // Use `s_window` instead `window`, avoid conflict with instrumentation tools
+ let s_window; /* allocated sliding window, if wsize != 0 */
+ let hold; /* local strm.hold */
+ let bits; /* local strm.bits */
+ let lcode; /* local strm.lencode */
+ let dcode; /* local strm.distcode */
+ let lmask; /* mask for first level of length codes */
+ let dmask; /* mask for first level of distance codes */
+ let here; /* retrieved table entry */
+ let op; /* code bits, operation, extra bits, or */
+ /* window position, window bytes to copy */
+ let len; /* match length, unused bytes */
+ let dist; /* match distance */
+ let from; /* where to copy match from */
+ let from_source;
+
+
+ let input, output; // JS specific, because we have no pointers
+
+ /* copy state to local variables */
+ const state = strm.state;
+ //here = state.here;
+ _in = strm.next_in;
+ input = strm.input;
+ last = _in + (strm.avail_in - 5);
+ _out = strm.next_out;
+ output = strm.output;
+ beg = _out - (start - strm.avail_out);
+ end = _out + (strm.avail_out - 257);
+ //#ifdef INFLATE_STRICT
+ dmax = state.dmax;
+ //#endif
+ wsize = state.wsize;
+ whave = state.whave;
+ wnext = state.wnext;
+ s_window = state.window;
+ hold = state.hold;
+ bits = state.bits;
+ lcode = state.lencode;
+ dcode = state.distcode;
+ lmask = (1 << state.lenbits) - 1;
+ dmask = (1 << state.distbits) - 1;
+
+
+ /* decode literals and length/distances until end-of-block or not enough
+ input data or output space */
+
+ top:
+ do {
+ if (bits < 15) {
+ hold += input[_in++] << bits;
+ bits += 8;
+ hold += input[_in++] << bits;
+ bits += 8;
+ }
+
+ here = lcode[hold & lmask];
+
+ dolen:
+ for (;;) { // Goto emulation
+ op = here >>> 24/*here.bits*/;
+ hold >>>= op;
+ bits -= op;
+ op = (here >>> 16) & 0xff/*here.op*/;
+ if (op === 0) { /* literal */
+ //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+ // "inflate: literal '%c'\n" :
+ // "inflate: literal 0x%02x\n", here.val));
+ output[_out++] = here & 0xffff/*here.val*/;
+ }
+ else if (op & 16) { /* length base */
+ len = here & 0xffff/*here.val*/;
+ op &= 15; /* number of extra bits */
+ if (op) {
+ if (bits < op) {
+ hold += input[_in++] << bits;
+ bits += 8;
+ }
+ len += hold & ((1 << op) - 1);
+ hold >>>= op;
+ bits -= op;
+ }
+ //Tracevv((stderr, "inflate: length %u\n", len));
+ if (bits < 15) {
+ hold += input[_in++] << bits;
+ bits += 8;
+ hold += input[_in++] << bits;
+ bits += 8;
+ }
+ here = dcode[hold & dmask];
+
+ dodist:
+ for (;;) { // goto emulation
+ op = here >>> 24/*here.bits*/;
+ hold >>>= op;
+ bits -= op;
+ op = (here >>> 16) & 0xff/*here.op*/;
+
+ if (op & 16) { /* distance base */
+ dist = here & 0xffff/*here.val*/;
+ op &= 15; /* number of extra bits */
+ if (bits < op) {
+ hold += input[_in++] << bits;
+ bits += 8;
+ if (bits < op) {
+ hold += input[_in++] << bits;
+ bits += 8;
+ }
+ }
+ dist += hold & ((1 << op) - 1);
+ //#ifdef INFLATE_STRICT
+ if (dist > dmax) {
+ strm.msg = 'invalid distance too far back';
+ state.mode = BAD$1;
+ break top;
+ }
+ //#endif
+ hold >>>= op;
+ bits -= op;
+ //Tracevv((stderr, "inflate: distance %u\n", dist));
+ op = _out - beg; /* max distance in output */
+ if (dist > op) { /* see if copy from window */
+ op = dist - op; /* distance back in window */
+ if (op > whave) {
+ if (state.sane) {
+ strm.msg = 'invalid distance too far back';
+ state.mode = BAD$1;
+ break top;
+ }
+
+ // (!) This block is disabled in zlib defaults,
+ // don't enable it for binary compatibility
+ //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ // if (len <= op - whave) {
+ // do {
+ // output[_out++] = 0;
+ // } while (--len);
+ // continue top;
+ // }
+ // len -= op - whave;
+ // do {
+ // output[_out++] = 0;
+ // } while (--op > whave);
+ // if (op === 0) {
+ // from = _out - dist;
+ // do {
+ // output[_out++] = output[from++];
+ // } while (--len);
+ // continue top;
+ // }
+ //#endif
+ }
+ from = 0; // window index
+ from_source = s_window;
+ if (wnext === 0) { /* very common case */
+ from += wsize - op;
+ if (op < len) { /* some from window */
+ len -= op;
+ do {
+ output[_out++] = s_window[from++];
+ } while (--op);
+ from = _out - dist; /* rest from output */
+ from_source = output;
+ }
+ }
+ else if (wnext < op) { /* wrap around window */
+ from += wsize + wnext - op;
+ op -= wnext;
+ if (op < len) { /* some from end of window */
+ len -= op;
+ do {
+ output[_out++] = s_window[from++];
+ } while (--op);
+ from = 0;
+ if (wnext < len) { /* some from start of window */
+ op = wnext;
+ len -= op;
+ do {
+ output[_out++] = s_window[from++];
+ } while (--op);
+ from = _out - dist; /* rest from output */
+ from_source = output;
+ }
+ }
+ }
+ else { /* contiguous in window */
+ from += wnext - op;
+ if (op < len) { /* some from window */
+ len -= op;
+ do {
+ output[_out++] = s_window[from++];
+ } while (--op);
+ from = _out - dist; /* rest from output */
+ from_source = output;
+ }
+ }
+ while (len > 2) {
+ output[_out++] = from_source[from++];
+ output[_out++] = from_source[from++];
+ output[_out++] = from_source[from++];
+ len -= 3;
+ }
+ if (len) {
+ output[_out++] = from_source[from++];
+ if (len > 1) {
+ output[_out++] = from_source[from++];
+ }
+ }
+ }
+ else {
+ from = _out - dist; /* copy direct from output */
+ do { /* minimum length is three */
+ output[_out++] = output[from++];
+ output[_out++] = output[from++];
+ output[_out++] = output[from++];
+ len -= 3;
+ } while (len > 2);
+ if (len) {
+ output[_out++] = output[from++];
+ if (len > 1) {
+ output[_out++] = output[from++];
+ }
+ }
+ }
+ }
+ else if ((op & 64) === 0) { /* 2nd level distance code */
+ here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
+ continue dodist;
+ }
+ else {
+ strm.msg = 'invalid distance code';
+ state.mode = BAD$1;
+ break top;
+ }
+
+ break; // need to emulate goto via "continue"
+ }
+ }
+ else if ((op & 64) === 0) { /* 2nd level length code */
+ here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
+ continue dolen;
+ }
+ else if (op & 32) { /* end-of-block */
+ //Tracevv((stderr, "inflate: end of block\n"));
+ state.mode = TYPE$1;
+ break top;
+ }
+ else {
+ strm.msg = 'invalid literal/length code';
+ state.mode = BAD$1;
+ break top;
+ }
+
+ break; // need to emulate goto via "continue"
+ }
+ } while (_in < last && _out < end);
+
+ /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+ len = bits >> 3;
+ _in -= len;
+ bits -= len << 3;
+ hold &= (1 << bits) - 1;
+
+ /* update state and return */
+ strm.next_in = _in;
+ strm.next_out = _out;
+ strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
+ strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
+ state.hold = hold;
+ state.bits = bits;
+ return;
+ };
+
+ // (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+ //
+ // This software is provided 'as-is', without any express or implied
+ // warranty. In no event will the authors be held liable for any damages
+ // arising from the use of this software.
+ //
+ // Permission is granted to anyone to use this software for any purpose,
+ // including commercial applications, and to alter it and redistribute it
+ // freely, subject to the following restrictions:
+ //
+ // 1. The origin of this software must not be misrepresented; you must not
+ // claim that you wrote the original software. If you use this software
+ // in a product, an acknowledgment in the product documentation would be
+ // appreciated but is not required.
+ // 2. Altered source versions must be plainly marked as such, and must not be
+ // misrepresented as being the original software.
+ // 3. This notice may not be removed or altered from any source distribution.
+
+ const MAXBITS = 15;
+ const ENOUGH_LENS$1 = 852;
+ const ENOUGH_DISTS$1 = 592;
+ //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
+
+ const CODES$1 = 0;
+ const LENS$1 = 1;
+ const DISTS$1 = 2;
+
+ const lbase = new Uint16Array([ /* Length codes 257..285 base */
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
+ 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
+ ]);
+
+ const lext = new Uint8Array([ /* Length codes 257..285 extra */
+ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
+ ]);
+
+ const dbase = new Uint16Array([ /* Distance codes 0..29 base */
+ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
+ 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+ 8193, 12289, 16385, 24577, 0, 0
+ ]);
+
+ const dext = new Uint8Array([ /* Distance codes 0..29 extra */
+ 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+ 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
+ 28, 28, 29, 29, 64, 64
+ ]);
+
+ const inflate_table$1 = (type, lens, lens_index, codes, table, table_index, work, opts) =>
+ {
+ const bits = opts.bits;
+ //here = opts.here; /* table entry for duplication */
+
+ let len = 0; /* a code's length in bits */
+ let sym = 0; /* index of code symbols */
+ let min = 0, max = 0; /* minimum and maximum code lengths */
+ let root = 0; /* number of index bits for root table */
+ let curr = 0; /* number of index bits for current table */
+ let drop = 0; /* code bits to drop for sub-table */
+ let left = 0; /* number of prefix codes available */
+ let used = 0; /* code entries in table used */
+ let huff = 0; /* Huffman code */
+ let incr; /* for incrementing code, index */
+ let fill; /* index for replicating entries */
+ let low; /* low bits for current root entry */
+ let mask; /* mask for low root bits */
+ let next; /* next available space in table */
+ let base = null; /* base value table to use */
+ // let shoextra; /* extra bits table to use */
+ let match; /* use base and extra for symbol >= match */
+ const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */
+ const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */
+ let extra = null;
+
+ let here_bits, here_op, here_val;
+
+ /*
+ Process a set of code lengths to create a canonical Huffman code. The
+ code lengths are lens[0..codes-1]. Each length corresponds to the
+ symbols 0..codes-1. The Huffman code is generated by first sorting the
+ symbols by length from short to long, and retaining the symbol order
+ for codes with equal lengths. Then the code starts with all zero bits
+ for the first code of the shortest length, and the codes are integer
+ increments for the same length, and zeros are appended as the length
+ increases. For the deflate format, these bits are stored backwards
+ from their more natural integer increment ordering, and so when the
+ decoding tables are built in the large loop below, the integer codes
+ are incremented backwards.
+
+ This routine assumes, but does not check, that all of the entries in
+ lens[] are in the range 0..MAXBITS. The caller must assure this.
+ 1..MAXBITS is interpreted as that code length. zero means that that
+ symbol does not occur in this code.
+
+ The codes are sorted by computing a count of codes for each length,
+ creating from that a table of starting indices for each length in the
+ sorted table, and then entering the symbols in order in the sorted
+ table. The sorted table is work[], with that space being provided by
+ the caller.
+
+ The length counts are used for other purposes as well, i.e. finding
+ the minimum and maximum length codes, determining if there are any
+ codes at all, checking for a valid set of lengths, and looking ahead
+ at length counts to determine sub-table sizes when building the
+ decoding tables.
+ */
+
+ /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
+ for (len = 0; len <= MAXBITS; len++) {
+ count[len] = 0;
+ }
+ for (sym = 0; sym < codes; sym++) {
+ count[lens[lens_index + sym]]++;
+ }
+
+ /* bound code lengths, force root to be within code lengths */
+ root = bits;
+ for (max = MAXBITS; max >= 1; max--) {
+ if (count[max] !== 0) { break; }
+ }
+ if (root > max) {
+ root = max;
+ }
+ if (max === 0) { /* no symbols to code at all */
+ //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
+ //table.bits[opts.table_index] = 1; //here.bits = (var char)1;
+ //table.val[opts.table_index++] = 0; //here.val = (var short)0;
+ table[table_index++] = (1 << 24) | (64 << 16) | 0;
+
+
+ //table.op[opts.table_index] = 64;
+ //table.bits[opts.table_index] = 1;
+ //table.val[opts.table_index++] = 0;
+ table[table_index++] = (1 << 24) | (64 << 16) | 0;
+
+ opts.bits = 1;
+ return 0; /* no symbols, but wait for decoding to report error */
+ }
+ for (min = 1; min < max; min++) {
+ if (count[min] !== 0) { break; }
+ }
+ if (root < min) {
+ root = min;
+ }
+
+ /* check for an over-subscribed or incomplete set of lengths */
+ left = 1;
+ for (len = 1; len <= MAXBITS; len++) {
+ left <<= 1;
+ left -= count[len];
+ if (left < 0) {
+ return -1;
+ } /* over-subscribed */
+ }
+ if (left > 0 && (type === CODES$1 || max !== 1)) {
+ return -1; /* incomplete set */
+ }
+
+ /* generate offsets into symbol table for each length for sorting */
+ offs[1] = 0;
+ for (len = 1; len < MAXBITS; len++) {
+ offs[len + 1] = offs[len] + count[len];
+ }
+
+ /* sort symbols by length, by symbol order within each length */
+ for (sym = 0; sym < codes; sym++) {
+ if (lens[lens_index + sym] !== 0) {
+ work[offs[lens[lens_index + sym]]++] = sym;
+ }
+ }
+
+ /*
+ Create and fill in decoding tables. In this loop, the table being
+ filled is at next and has curr index bits. The code being used is huff
+ with length len. That code is converted to an index by dropping drop
+ bits off of the bottom. For codes where len is less than drop + curr,
+ those top drop + curr - len bits are incremented through all values to
+ fill the table with replicated entries.
+
+ root is the number of index bits for the root table. When len exceeds
+ root, sub-tables are created pointed to by the root entry with an index
+ of the low root bits of huff. This is saved in low to check for when a
+ new sub-table should be started. drop is zero when the root table is
+ being filled, and drop is root when sub-tables are being filled.
+
+ When a new sub-table is needed, it is necessary to look ahead in the
+ code lengths to determine what size sub-table is needed. The length
+ counts are used for this, and so count[] is decremented as codes are
+ entered in the tables.
+
+ used keeps track of how many table entries have been allocated from the
+ provided *table space. It is checked for LENS and DIST tables against
+ the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
+ the initial root table size constants. See the comments in inftrees.h
+ for more information.
+
+ sym increments through all symbols, and the loop terminates when
+ all codes of length max, i.e. all codes, have been processed. This
+ routine permits incomplete codes, so another loop after this one fills
+ in the rest of the decoding tables with invalid code markers.
+ */
+
+ /* set up for code type */
+ // poor man optimization - use if-else instead of switch,
+ // to avoid deopts in old v8
+ if (type === CODES$1) {
+ base = extra = work; /* dummy value--not used */
+ match = 20;
+
+ } else if (type === LENS$1) {
+ base = lbase;
+ extra = lext;
+ match = 257;
+
+ } else { /* DISTS */
+ base = dbase;
+ extra = dext;
+ match = 0;
+ }
+
+ /* initialize opts for loop */
+ huff = 0; /* starting code */
+ sym = 0; /* starting code symbol */
+ len = min; /* starting code length */
+ next = table_index; /* current table to fill in */
+ curr = root; /* current table index bits */
+ drop = 0; /* current bits to drop from code for index */
+ low = -1; /* trigger new sub-table when len > root */
+ used = 1 << root; /* use root table entries */
+ mask = used - 1; /* mask for comparing low */
+
+ /* check available table space */
+ if ((type === LENS$1 && used > ENOUGH_LENS$1) ||
+ (type === DISTS$1 && used > ENOUGH_DISTS$1)) {
+ return 1;
+ }
+
+ /* process all codes and make table entries */
+ for (;;) {
+ /* create table entry */
+ here_bits = len - drop;
+ if (work[sym] + 1 < match) {
+ here_op = 0;
+ here_val = work[sym];
+ }
+ else if (work[sym] >= match) {
+ here_op = extra[work[sym] - match];
+ here_val = base[work[sym] - match];
+ }
+ else {
+ here_op = 32 + 64; /* end of block */
+ here_val = 0;
+ }
+
+ /* replicate for those indices with low len bits equal to huff */
+ incr = 1 << (len - drop);
+ fill = 1 << curr;
+ min = fill; /* save offset to next table */
+ do {
+ fill -= incr;
+ table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
+ } while (fill !== 0);
+
+ /* backwards increment the len-bit code huff */
+ incr = 1 << (len - 1);
+ while (huff & incr) {
+ incr >>= 1;
+ }
+ if (incr !== 0) {
+ huff &= incr - 1;
+ huff += incr;
+ } else {
+ huff = 0;
+ }
+
+ /* go to next symbol, update count, len */
+ sym++;
+ if (--count[len] === 0) {
+ if (len === max) { break; }
+ len = lens[lens_index + work[sym]];
+ }
+
+ /* create new sub-table if needed */
+ if (len > root && (huff & mask) !== low) {
+ /* if first time, transition to sub-tables */
+ if (drop === 0) {
+ drop = root;
+ }
+
+ /* increment past last table */
+ next += min; /* here min is 1 << curr */
+
+ /* determine length of next table */
+ curr = len - drop;
+ left = 1 << curr;
+ while (curr + drop < max) {
+ left -= count[curr + drop];
+ if (left <= 0) { break; }
+ curr++;
+ left <<= 1;
+ }
+
+ /* check for enough space */
+ used += 1 << curr;
+ if ((type === LENS$1 && used > ENOUGH_LENS$1) ||
+ (type === DISTS$1 && used > ENOUGH_DISTS$1)) {
+ return 1;
+ }
+
+ /* point entry in root table to sub-table */
+ low = huff & mask;
+ /*table.op[low] = curr;
+ table.bits[low] = root;
+ table.val[low] = next - opts.table_index;*/
+ table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
+ }
+ }
+
+ /* fill in remaining table entry if code is incomplete (guaranteed to have
+ at most one remaining entry, since if the code is incomplete, the
+ maximum code length that was allowed to get this far is one bit) */
+ if (huff !== 0) {
+ //table.op[next + huff] = 64; /* invalid code marker */
+ //table.bits[next + huff] = len - drop;
+ //table.val[next + huff] = 0;
+ table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
+ }
+
+ /* set return parameters */
+ //opts.table_index += used;
+ opts.bits = root;
+ return 0;
+ };
+
+
+ var inftrees = inflate_table$1;
+
+ // (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+ //
+ // This software is provided 'as-is', without any express or implied
+ // warranty. In no event will the authors be held liable for any damages
+ // arising from the use of this software.
+ //
+ // Permission is granted to anyone to use this software for any purpose,
+ // including commercial applications, and to alter it and redistribute it
+ // freely, subject to the following restrictions:
+ //
+ // 1. The origin of this software must not be misrepresented; you must not
+ // claim that you wrote the original software. If you use this software
+ // in a product, an acknowledgment in the product documentation would be
+ // appreciated but is not required.
+ // 2. Altered source versions must be plainly marked as such, and must not be
+ // misrepresented as being the original software.
+ // 3. This notice may not be removed or altered from any source distribution.
+
+ var constants = {
+
+ /* Allowed flush values; see deflate() and inflate() below for details */
+ Z_NO_FLUSH: 0,
+ Z_PARTIAL_FLUSH: 1,
+ Z_SYNC_FLUSH: 2,
+ Z_FULL_FLUSH: 3,
+ Z_FINISH: 4,
+ Z_BLOCK: 5,
+ Z_TREES: 6,
+
+ /* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
+ */
+ Z_OK: 0,
+ Z_STREAM_END: 1,
+ Z_NEED_DICT: 2,
+ Z_ERRNO: -1,
+ Z_STREAM_ERROR: -2,
+ Z_DATA_ERROR: -3,
+ Z_MEM_ERROR: -4,
+ Z_BUF_ERROR: -5,
+ //Z_VERSION_ERROR: -6,
+
+ /* compression levels */
+ Z_NO_COMPRESSION: 0,
+ Z_BEST_SPEED: 1,
+ Z_BEST_COMPRESSION: 9,
+ Z_DEFAULT_COMPRESSION: -1,
+
+
+ Z_FILTERED: 1,
+ Z_HUFFMAN_ONLY: 2,
+ Z_RLE: 3,
+ Z_FIXED: 4,
+ Z_DEFAULT_STRATEGY: 0,
+
+ /* Possible values of the data_type field (though see inflate()) */
+ Z_BINARY: 0,
+ Z_TEXT: 1,
+ //Z_ASCII: 1, // = Z_TEXT (deprecated)
+ Z_UNKNOWN: 2,
+
+ /* The deflate compression method */
+ Z_DEFLATED: 8
+ //Z_NULL: null // Use -1 or null inline, depending on var type
+ };
+
+ // (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+ //
+ // This software is provided 'as-is', without any express or implied
+ // warranty. In no event will the authors be held liable for any damages
+ // arising from the use of this software.
+ //
+ // Permission is granted to anyone to use this software for any purpose,
+ // including commercial applications, and to alter it and redistribute it
+ // freely, subject to the following restrictions:
+ //
+ // 1. The origin of this software must not be misrepresented; you must not
+ // claim that you wrote the original software. If you use this software
+ // in a product, an acknowledgment in the product documentation would be
+ // appreciated but is not required.
+ // 2. Altered source versions must be plainly marked as such, and must not be
+ // misrepresented as being the original software.
+ // 3. This notice may not be removed or altered from any source distribution.
+
+ const adler32 = adler32_1;
+ const crc32 = crc32_1;
+ const inflate_fast = inffast;
+ const inflate_table = inftrees;
+
+ const CODES = 0;
+ const LENS = 1;
+ const DISTS = 2;
+
+ /* Public constants ==========================================================*/
+ /* ===========================================================================*/
+
+ const {
+ Z_FINISH: Z_FINISH$1, Z_BLOCK, Z_TREES,
+ Z_OK: Z_OK$1, Z_STREAM_END: Z_STREAM_END$1, Z_NEED_DICT: Z_NEED_DICT$1, Z_STREAM_ERROR: Z_STREAM_ERROR$1, Z_DATA_ERROR: Z_DATA_ERROR$1, Z_MEM_ERROR: Z_MEM_ERROR$1, Z_BUF_ERROR,
+ Z_DEFLATED
+ } = constants;
+
+
+ /* STATES ====================================================================*/
+ /* ===========================================================================*/
+
+
+ const HEAD = 16180; /* i: waiting for magic header */
+ const FLAGS = 16181; /* i: waiting for method and flags (gzip) */
+ const TIME = 16182; /* i: waiting for modification time (gzip) */
+ const OS = 16183; /* i: waiting for extra flags and operating system (gzip) */
+ const EXLEN = 16184; /* i: waiting for extra length (gzip) */
+ const EXTRA = 16185; /* i: waiting for extra bytes (gzip) */
+ const NAME = 16186; /* i: waiting for end of file name (gzip) */
+ const COMMENT = 16187; /* i: waiting for end of comment (gzip) */
+ const HCRC = 16188; /* i: waiting for header crc (gzip) */
+ const DICTID = 16189; /* i: waiting for dictionary check value */
+ const DICT = 16190; /* waiting for inflateSetDictionary() call */
+ const TYPE = 16191; /* i: waiting for type bits, including last-flag bit */
+ const TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */
+ const STORED = 16193; /* i: waiting for stored size (length and complement) */
+ const COPY_ = 16194; /* i/o: same as COPY below, but only first time in */
+ const COPY = 16195; /* i/o: waiting for input or output to copy stored block */
+ const TABLE = 16196; /* i: waiting for dynamic block table lengths */
+ const LENLENS = 16197; /* i: waiting for code length code lengths */
+ const CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */
+ const LEN_ = 16199; /* i: same as LEN below, but only first time in */
+ const LEN = 16200; /* i: waiting for length/lit/eob code */
+ const LENEXT = 16201; /* i: waiting for length extra bits */
+ const DIST = 16202; /* i: waiting for distance code */
+ const DISTEXT = 16203; /* i: waiting for distance extra bits */
+ const MATCH = 16204; /* o: waiting for output space to copy string */
+ const LIT = 16205; /* o: waiting for output space to write literal */
+ const CHECK = 16206; /* i: waiting for 32-bit check value */
+ const LENGTH = 16207; /* i: waiting for 32-bit length (gzip) */
+ const DONE = 16208; /* finished check, done -- remain here until reset */
+ const BAD = 16209; /* got a data error -- remain here until reset */
+ const MEM = 16210; /* got an inflate() memory error -- remain here until reset */
+ const SYNC = 16211; /* looking for synchronization bytes to restart inflate() */
+
+ /* ===========================================================================*/
+
+
+
+ const ENOUGH_LENS = 852;
+ const ENOUGH_DISTS = 592;
+ //const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
+
+ const MAX_WBITS = 15;
+ /* 32K LZ77 window */
+ const DEF_WBITS = MAX_WBITS;
+
+
+ const zswap32 = (q) => {
+
+ return (((q >>> 24) & 0xff) +
+ ((q >>> 8) & 0xff00) +
+ ((q & 0xff00) << 8) +
+ ((q & 0xff) << 24));
+ };
+
+
+ function InflateState() {
+ this.strm = null; /* pointer back to this zlib stream */
+ this.mode = 0; /* current inflate mode */
+ this.last = false; /* true if processing last block */
+ this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip,
+ bit 2 true to validate check value */
+ this.havedict = false; /* true if dictionary provided */
+ this.flags = 0; /* gzip header method and flags (0 if zlib), or
+ -1 if raw or no header yet */
+ this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
+ this.check = 0; /* protected copy of check value */
+ this.total = 0; /* protected copy of output count */
+ // TODO: may be {}
+ this.head = null; /* where to save gzip header information */
+
+ /* sliding window */
+ this.wbits = 0; /* log base 2 of requested window size */
+ this.wsize = 0; /* window size or zero if not using window */
+ this.whave = 0; /* valid bytes in the window */
+ this.wnext = 0; /* window write index */
+ this.window = null; /* allocated sliding window, if needed */
+
+ /* bit accumulator */
+ this.hold = 0; /* input bit accumulator */
+ this.bits = 0; /* number of bits in "in" */
+
+ /* for string and stored block copying */
+ this.length = 0; /* literal or length of data to copy */
+ this.offset = 0; /* distance back to copy string from */
+
+ /* for table and code decoding */
+ this.extra = 0; /* extra bits needed */
+
+ /* fixed and dynamic code tables */
+ this.lencode = null; /* starting table for length/literal codes */
+ this.distcode = null; /* starting table for distance codes */
+ this.lenbits = 0; /* index bits for lencode */
+ this.distbits = 0; /* index bits for distcode */
+
+ /* dynamic table building */
+ this.ncode = 0; /* number of code length code lengths */
+ this.nlen = 0; /* number of length code lengths */
+ this.ndist = 0; /* number of distance code lengths */
+ this.have = 0; /* number of code lengths in lens[] */
+ this.next = null; /* next available space in codes[] */
+
+ this.lens = new Uint16Array(320); /* temporary storage for code lengths */
+ this.work = new Uint16Array(288); /* work area for code table building */
+
+ /*
+ because we don't have pointers in js, we use lencode and distcode directly
+ as buffers so we don't need codes
+ */
+ //this.codes = new Int32Array(ENOUGH); /* space for code tables */
+ this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
+ this.distdyn = null; /* dynamic table for distance codes (JS specific) */
+ this.sane = 0; /* if false, allow invalid distance too far */
+ this.back = 0; /* bits back of last unprocessed length/lit */
+ this.was = 0; /* initial length of match */
+ }
+
+
+ const inflateStateCheck = (strm) => {
+
+ if (!strm) {
+ return 1;
+ }
+ const state = strm.state;
+ if (!state || state.strm !== strm ||
+ state.mode < HEAD || state.mode > SYNC) {
+ return 1;
+ }
+ return 0;
+ };
+
+
+ const inflateResetKeep = (strm) => {
+
+ if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }
+ const state = strm.state;
+ strm.total_in = strm.total_out = state.total = 0;
+ strm.msg = ''; /*Z_NULL*/
+ if (state.wrap) { /* to support ill-conceived Java test suite */
+ strm.adler = state.wrap & 1;
+ }
+ state.mode = HEAD;
+ state.last = 0;
+ state.havedict = 0;
+ state.flags = -1;
+ state.dmax = 32768;
+ state.head = null/*Z_NULL*/;
+ state.hold = 0;
+ state.bits = 0;
+ //state.lencode = state.distcode = state.next = state.codes;
+ state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);
+ state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);
+
+ state.sane = 1;
+ state.back = -1;
+ //Tracev((stderr, "inflate: reset\n"));
+ return Z_OK$1;
+ };
+
+
+ const inflateReset = (strm) => {
+
+ if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }
+ const state = strm.state;
+ state.wsize = 0;
+ state.whave = 0;
+ state.wnext = 0;
+ return inflateResetKeep(strm);
+
+ };
+
+
+ const inflateReset2 = (strm, windowBits) => {
+ let wrap;
+
+ /* get the state */
+ if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }
+ const state = strm.state;
+
+ /* extract wrap request from windowBits parameter */
+ if (windowBits < 0) {
+ wrap = 0;
+ windowBits = -windowBits;
+ }
+ else {
+ wrap = (windowBits >> 4) + 5;
+ if (windowBits < 48) {
+ windowBits &= 15;
+ }
+ }
+
+ /* set number of window bits, free window if different */
+ if (windowBits && (windowBits < 8 || windowBits > 15)) {
+ return Z_STREAM_ERROR$1;
+ }
+ if (state.window !== null && state.wbits !== windowBits) {
+ state.window = null;
+ }
+
+ /* update state and reset the rest of it */
+ state.wrap = wrap;
+ state.wbits = windowBits;
+ return inflateReset(strm);
+ };
+
+
+ const inflateInit2 = (strm, windowBits) => {
+
+ if (!strm) { return Z_STREAM_ERROR$1; }
+ //strm.msg = Z_NULL; /* in case we return an error */
+
+ const state = new InflateState();
+
+ //if (state === Z_NULL) return Z_MEM_ERROR;
+ //Tracev((stderr, "inflate: allocated\n"));
+ strm.state = state;
+ state.strm = strm;
+ state.window = null/*Z_NULL*/;
+ state.mode = HEAD; /* to pass state test in inflateReset2() */
+ const ret = inflateReset2(strm, windowBits);
+ if (ret !== Z_OK$1) {
+ strm.state = null/*Z_NULL*/;
+ }
+ return ret;
+ };
+
+
+ const inflateInit = (strm) => {
+
+ return inflateInit2(strm, DEF_WBITS);
+ };
+
+
+ /*
+ Return state with length and distance decoding tables and index sizes set to
+ fixed code decoding. Normally this returns fixed tables from inffixed.h.
+ If BUILDFIXED is defined, then instead this routine builds the tables the
+ first time it's called, and returns those tables the first time and
+ thereafter. This reduces the size of the code by about 2K bytes, in
+ exchange for a little execution time. However, BUILDFIXED should not be
+ used for threaded applications, since the rewriting of the tables and virgin
+ may not be thread-safe.
+ */
+ let virgin = true;
+
+ let lenfix, distfix; // We have no pointers in JS, so keep tables separate
+
+
+ const fixedtables = (state) => {
+
+ /* build fixed huffman tables if first call (may not be thread safe) */
+ if (virgin) {
+ lenfix = new Int32Array(512);
+ distfix = new Int32Array(32);
+
+ /* literal/length table */
+ let sym = 0;
+ while (sym < 144) { state.lens[sym++] = 8; }
+ while (sym < 256) { state.lens[sym++] = 9; }
+ while (sym < 280) { state.lens[sym++] = 7; }
+ while (sym < 288) { state.lens[sym++] = 8; }
+
+ inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
+
+ /* distance table */
+ sym = 0;
+ while (sym < 32) { state.lens[sym++] = 5; }
+
+ inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
+
+ /* do this just once */
+ virgin = false;
+ }
+
+ state.lencode = lenfix;
+ state.lenbits = 9;
+ state.distcode = distfix;
+ state.distbits = 5;
+ };
+
+
+ /*
+ Update the window with the last wsize (normally 32K) bytes written before
+ returning. If window does not exist yet, create it. This is only called
+ when a window is already in use, or when output has been written during this
+ inflate call, but the end of the deflate stream has not been reached yet.
+ It is also called to create a window for dictionary data when a dictionary
+ is loaded.
+
+ Providing output buffers larger than 32K to inflate() should provide a speed
+ advantage, since only the last 32K of output is copied to the sliding window
+ upon return from inflate(), and since all distances after the first 32K of
+ output will fall in the output data, making match copies simpler and faster.
+ The advantage may be dependent on the size of the processor's data caches.
+ */
+ const updatewindow = (strm, src, end, copy) => {
+
+ let dist;
+ const state = strm.state;
+
+ /* if it hasn't been done already, allocate space for the window */
+ if (state.window === null) {
+ state.wsize = 1 << state.wbits;
+ state.wnext = 0;
+ state.whave = 0;
+
+ state.window = new Uint8Array(state.wsize);
+ }
+
+ /* copy state->wsize or less output bytes into the circular window */
+ if (copy >= state.wsize) {
+ state.window.set(src.subarray(end - state.wsize, end), 0);
+ state.wnext = 0;
+ state.whave = state.wsize;
+ }
+ else {
+ dist = state.wsize - state.wnext;
+ if (dist > copy) {
+ dist = copy;
+ }
+ //zmemcpy(state->window + state->wnext, end - copy, dist);
+ state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext);
+ copy -= dist;
+ if (copy) {
+ //zmemcpy(state->window, end - copy, copy);
+ state.window.set(src.subarray(end - copy, end), 0);
+ state.wnext = copy;
+ state.whave = state.wsize;
+ }
+ else {
+ state.wnext += dist;
+ if (state.wnext === state.wsize) { state.wnext = 0; }
+ if (state.whave < state.wsize) { state.whave += dist; }
+ }
+ }
+ return 0;
+ };
+
+
+ const inflate$1 = (strm, flush) => {
+
+ let state;
+ let input, output; // input/output buffers
+ let next; /* next input INDEX */
+ let put; /* next output INDEX */
+ let have, left; /* available input and output */
+ let hold; /* bit buffer */
+ let bits; /* bits in bit buffer */
+ let _in, _out; /* save starting available input and output */
+ let copy; /* number of stored or match bytes to copy */
+ let from; /* where to copy match bytes from */
+ let from_source;
+ let here = 0; /* current decoding table entry */
+ let here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
+ //let last; /* parent table entry */
+ let last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
+ let len; /* length to copy for repeats, bits to drop */
+ let ret; /* return code */
+ const hbuf = new Uint8Array(4); /* buffer for gzip header crc calculation */
+ let opts;
+
+ let n; // temporary variable for NEED_BITS
+
+ const order = /* permutation of code lengths */
+ new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]);
+
+
+ if (inflateStateCheck(strm) || !strm.output ||
+ (!strm.input && strm.avail_in !== 0)) {
+ return Z_STREAM_ERROR$1;
+ }
+
+ state = strm.state;
+ if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
+
+
+ //--- LOAD() ---
+ put = strm.next_out;
+ output = strm.output;
+ left = strm.avail_out;
+ next = strm.next_in;
+ input = strm.input;
+ have = strm.avail_in;
+ hold = state.hold;
+ bits = state.bits;
+ //---
+
+ _in = have;
+ _out = left;
+ ret = Z_OK$1;
+
+ inf_leave: // goto emulation
+ for (;;) {
+ switch (state.mode) {
+ case HEAD:
+ if (state.wrap === 0) {
+ state.mode = TYPEDO;
+ break;
+ }
+ //=== NEEDBITS(16);
+ while (bits < 16) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
+ if (state.wbits === 0) {
+ state.wbits = 15;
+ }
+ state.check = 0/*crc32(0L, Z_NULL, 0)*/;
+ //=== CRC2(state.check, hold);
+ hbuf[0] = hold & 0xff;
+ hbuf[1] = (hold >>> 8) & 0xff;
+ state.check = crc32(state.check, hbuf, 2, 0);
+ //===//
+
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = FLAGS;
+ break;
+ }
+ if (state.head) {
+ state.head.done = false;
+ }
+ if (!(state.wrap & 1) || /* check if zlib header allowed */
+ (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
+ strm.msg = 'incorrect header check';
+ state.mode = BAD;
+ break;
+ }
+ if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
+ strm.msg = 'unknown compression method';
+ state.mode = BAD;
+ break;
+ }
+ //--- DROPBITS(4) ---//
+ hold >>>= 4;
+ bits -= 4;
+ //---//
+ len = (hold & 0x0f)/*BITS(4)*/ + 8;
+ if (state.wbits === 0) {
+ state.wbits = len;
+ }
+ if (len > 15 || len > state.wbits) {
+ strm.msg = 'invalid window size';
+ state.mode = BAD;
+ break;
+ }
+
+ // !!! pako patch. Force use `options.windowBits` if passed.
+ // Required to always use max window size by default.
+ state.dmax = 1 << state.wbits;
+ //state.dmax = 1 << len;
+
+ state.flags = 0; /* indicate zlib header */
+ //Tracev((stderr, "inflate: zlib header ok\n"));
+ strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
+ state.mode = hold & 0x200 ? DICTID : TYPE;
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ break;
+ case FLAGS:
+ //=== NEEDBITS(16); */
+ while (bits < 16) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.flags = hold;
+ if ((state.flags & 0xff) !== Z_DEFLATED) {
+ strm.msg = 'unknown compression method';
+ state.mode = BAD;
+ break;
+ }
+ if (state.flags & 0xe000) {
+ strm.msg = 'unknown header flags set';
+ state.mode = BAD;
+ break;
+ }
+ if (state.head) {
+ state.head.text = ((hold >> 8) & 1);
+ }
+ if ((state.flags & 0x0200) && (state.wrap & 4)) {
+ //=== CRC2(state.check, hold);
+ hbuf[0] = hold & 0xff;
+ hbuf[1] = (hold >>> 8) & 0xff;
+ state.check = crc32(state.check, hbuf, 2, 0);
+ //===//
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = TIME;
+ /* falls through */
+ case TIME:
+ //=== NEEDBITS(32); */
+ while (bits < 32) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if (state.head) {
+ state.head.time = hold;
+ }
+ if ((state.flags & 0x0200) && (state.wrap & 4)) {
+ //=== CRC4(state.check, hold)
+ hbuf[0] = hold & 0xff;
+ hbuf[1] = (hold >>> 8) & 0xff;
+ hbuf[2] = (hold >>> 16) & 0xff;
+ hbuf[3] = (hold >>> 24) & 0xff;
+ state.check = crc32(state.check, hbuf, 4, 0);
+ //===
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = OS;
+ /* falls through */
+ case OS:
+ //=== NEEDBITS(16); */
+ while (bits < 16) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if (state.head) {
+ state.head.xflags = (hold & 0xff);
+ state.head.os = (hold >> 8);
+ }
+ if ((state.flags & 0x0200) && (state.wrap & 4)) {
+ //=== CRC2(state.check, hold);
+ hbuf[0] = hold & 0xff;
+ hbuf[1] = (hold >>> 8) & 0xff;
+ state.check = crc32(state.check, hbuf, 2, 0);
+ //===//
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = EXLEN;
+ /* falls through */
+ case EXLEN:
+ if (state.flags & 0x0400) {
+ //=== NEEDBITS(16); */
+ while (bits < 16) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.length = hold;
+ if (state.head) {
+ state.head.extra_len = hold;
+ }
+ if ((state.flags & 0x0200) && (state.wrap & 4)) {
+ //=== CRC2(state.check, hold);
+ hbuf[0] = hold & 0xff;
+ hbuf[1] = (hold >>> 8) & 0xff;
+ state.check = crc32(state.check, hbuf, 2, 0);
+ //===//
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ }
+ else if (state.head) {
+ state.head.extra = null/*Z_NULL*/;
+ }
+ state.mode = EXTRA;
+ /* falls through */
+ case EXTRA:
+ if (state.flags & 0x0400) {
+ copy = state.length;
+ if (copy > have) { copy = have; }
+ if (copy) {
+ if (state.head) {
+ len = state.head.extra_len - state.length;
+ if (!state.head.extra) {
+ // Use untyped array for more convenient processing later
+ state.head.extra = new Uint8Array(state.head.extra_len);
+ }
+ state.head.extra.set(
+ input.subarray(
+ next,
+ // extra field is limited to 65536 bytes
+ // - no need for additional size check
+ next + copy
+ ),
+ /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
+ len
+ );
+ //zmemcpy(state.head.extra + len, next,
+ // len + copy > state.head.extra_max ?
+ // state.head.extra_max - len : copy);
+ }
+ if ((state.flags & 0x0200) && (state.wrap & 4)) {
+ state.check = crc32(state.check, input, copy, next);
+ }
+ have -= copy;
+ next += copy;
+ state.length -= copy;
+ }
+ if (state.length) { break inf_leave; }
+ }
+ state.length = 0;
+ state.mode = NAME;
+ /* falls through */
+ case NAME:
+ if (state.flags & 0x0800) {
+ if (have === 0) { break inf_leave; }
+ copy = 0;
+ do {
+ // TODO: 2 or 1 bytes?
+ len = input[next + copy++];
+ /* use constant limit because in js we should not preallocate memory */
+ if (state.head && len &&
+ (state.length < 65536 /*state.head.name_max*/)) {
+ state.head.name += String.fromCharCode(len);
+ }
+ } while (len && copy < have);
+
+ if ((state.flags & 0x0200) && (state.wrap & 4)) {
+ state.check = crc32(state.check, input, copy, next);
+ }
+ have -= copy;
+ next += copy;
+ if (len) { break inf_leave; }
+ }
+ else if (state.head) {
+ state.head.name = null;
+ }
+ state.length = 0;
+ state.mode = COMMENT;
+ /* falls through */
+ case COMMENT:
+ if (state.flags & 0x1000) {
+ if (have === 0) { break inf_leave; }
+ copy = 0;
+ do {
+ len = input[next + copy++];
+ /* use constant limit because in js we should not preallocate memory */
+ if (state.head && len &&
+ (state.length < 65536 /*state.head.comm_max*/)) {
+ state.head.comment += String.fromCharCode(len);
+ }
+ } while (len && copy < have);
+ if ((state.flags & 0x0200) && (state.wrap & 4)) {
+ state.check = crc32(state.check, input, copy, next);
+ }
+ have -= copy;
+ next += copy;
+ if (len) { break inf_leave; }
+ }
+ else if (state.head) {
+ state.head.comment = null;
+ }
+ state.mode = HCRC;
+ /* falls through */
+ case HCRC:
+ if (state.flags & 0x0200) {
+ //=== NEEDBITS(16); */
+ while (bits < 16) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if ((state.wrap & 4) && hold !== (state.check & 0xffff)) {
+ strm.msg = 'header crc mismatch';
+ state.mode = BAD;
+ break;
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ }
+ if (state.head) {
+ state.head.hcrc = ((state.flags >> 9) & 1);
+ state.head.done = true;
+ }
+ strm.adler = state.check = 0;
+ state.mode = TYPE;
+ break;
+ case DICTID:
+ //=== NEEDBITS(32); */
+ while (bits < 32) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ strm.adler = state.check = zswap32(hold);
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = DICT;
+ /* falls through */
+ case DICT:
+ if (state.havedict === 0) {
+ //--- RESTORE() ---
+ strm.next_out = put;
+ strm.avail_out = left;
+ strm.next_in = next;
+ strm.avail_in = have;
+ state.hold = hold;
+ state.bits = bits;
+ //---
+ return Z_NEED_DICT$1;
+ }
+ strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
+ state.mode = TYPE;
+ /* falls through */
+ case TYPE:
+ if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
+ /* falls through */
+ case TYPEDO:
+ if (state.last) {
+ //--- BYTEBITS() ---//
+ hold >>>= bits & 7;
+ bits -= bits & 7;
+ //---//
+ state.mode = CHECK;
+ break;
+ }
+ //=== NEEDBITS(3); */
+ while (bits < 3) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.last = (hold & 0x01)/*BITS(1)*/;
+ //--- DROPBITS(1) ---//
+ hold >>>= 1;
+ bits -= 1;
+ //---//
+
+ switch ((hold & 0x03)/*BITS(2)*/) {
+ case 0: /* stored block */
+ //Tracev((stderr, "inflate: stored block%s\n",
+ // state.last ? " (last)" : ""));
+ state.mode = STORED;
+ break;
+ case 1: /* fixed block */
+ fixedtables(state);
+ //Tracev((stderr, "inflate: fixed codes block%s\n",
+ // state.last ? " (last)" : ""));
+ state.mode = LEN_; /* decode codes */
+ if (flush === Z_TREES) {
+ //--- DROPBITS(2) ---//
+ hold >>>= 2;
+ bits -= 2;
+ //---//
+ break inf_leave;
+ }
+ break;
+ case 2: /* dynamic block */
+ //Tracev((stderr, "inflate: dynamic codes block%s\n",
+ // state.last ? " (last)" : ""));
+ state.mode = TABLE;
+ break;
+ case 3:
+ strm.msg = 'invalid block type';
+ state.mode = BAD;
+ }
+ //--- DROPBITS(2) ---//
+ hold >>>= 2;
+ bits -= 2;
+ //---//
+ break;
+ case STORED:
+ //--- BYTEBITS() ---// /* go to byte boundary */
+ hold >>>= bits & 7;
+ bits -= bits & 7;
+ //---//
+ //=== NEEDBITS(32); */
+ while (bits < 32) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
+ strm.msg = 'invalid stored block lengths';
+ state.mode = BAD;
+ break;
+ }
+ state.length = hold & 0xffff;
+ //Tracev((stderr, "inflate: stored length %u\n",
+ // state.length));
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ state.mode = COPY_;
+ if (flush === Z_TREES) { break inf_leave; }
+ /* falls through */
+ case COPY_:
+ state.mode = COPY;
+ /* falls through */
+ case COPY:
+ copy = state.length;
+ if (copy) {
+ if (copy > have) { copy = have; }
+ if (copy > left) { copy = left; }
+ if (copy === 0) { break inf_leave; }
+ //--- zmemcpy(put, next, copy); ---
+ output.set(input.subarray(next, next + copy), put);
+ //---//
+ have -= copy;
+ next += copy;
+ left -= copy;
+ put += copy;
+ state.length -= copy;
+ break;
+ }
+ //Tracev((stderr, "inflate: stored end\n"));
+ state.mode = TYPE;
+ break;
+ case TABLE:
+ //=== NEEDBITS(14); */
+ while (bits < 14) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
+ //--- DROPBITS(5) ---//
+ hold >>>= 5;
+ bits -= 5;
+ //---//
+ state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
+ //--- DROPBITS(5) ---//
+ hold >>>= 5;
+ bits -= 5;
+ //---//
+ state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
+ //--- DROPBITS(4) ---//
+ hold >>>= 4;
+ bits -= 4;
+ //---//
+ //#ifndef PKZIP_BUG_WORKAROUND
+ if (state.nlen > 286 || state.ndist > 30) {
+ strm.msg = 'too many length or distance symbols';
+ state.mode = BAD;
+ break;
+ }
+ //#endif
+ //Tracev((stderr, "inflate: table sizes ok\n"));
+ state.have = 0;
+ state.mode = LENLENS;
+ /* falls through */
+ case LENLENS:
+ while (state.have < state.ncode) {
+ //=== NEEDBITS(3);
+ while (bits < 3) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
+ //--- DROPBITS(3) ---//
+ hold >>>= 3;
+ bits -= 3;
+ //---//
+ }
+ while (state.have < 19) {
+ state.lens[order[state.have++]] = 0;
+ }
+ // We have separate tables & no pointers. 2 commented lines below not needed.
+ //state.next = state.codes;
+ //state.lencode = state.next;
+ // Switch to use dynamic table
+ state.lencode = state.lendyn;
+ state.lenbits = 7;
+
+ opts = { bits: state.lenbits };
+ ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
+ state.lenbits = opts.bits;
+
+ if (ret) {
+ strm.msg = 'invalid code lengths set';
+ state.mode = BAD;
+ break;
+ }
+ //Tracev((stderr, "inflate: code lengths ok\n"));
+ state.have = 0;
+ state.mode = CODELENS;
+ /* falls through */
+ case CODELENS:
+ while (state.have < state.nlen + state.ndist) {
+ for (;;) {
+ here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
+ here_bits = here >>> 24;
+ here_op = (here >>> 16) & 0xff;
+ here_val = here & 0xffff;
+
+ if ((here_bits) <= bits) { break; }
+ //--- PULLBYTE() ---//
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ //---//
+ }
+ if (here_val < 16) {
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ state.lens[state.have++] = here_val;
+ }
+ else {
+ if (here_val === 16) {
+ //=== NEEDBITS(here.bits + 2);
+ n = here_bits + 2;
+ while (bits < n) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ if (state.have === 0) {
+ strm.msg = 'invalid bit length repeat';
+ state.mode = BAD;
+ break;
+ }
+ len = state.lens[state.have - 1];
+ copy = 3 + (hold & 0x03);//BITS(2);
+ //--- DROPBITS(2) ---//
+ hold >>>= 2;
+ bits -= 2;
+ //---//
+ }
+ else if (here_val === 17) {
+ //=== NEEDBITS(here.bits + 3);
+ n = here_bits + 3;
+ while (bits < n) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ len = 0;
+ copy = 3 + (hold & 0x07);//BITS(3);
+ //--- DROPBITS(3) ---//
+ hold >>>= 3;
+ bits -= 3;
+ //---//
+ }
+ else {
+ //=== NEEDBITS(here.bits + 7);
+ n = here_bits + 7;
+ while (bits < n) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ len = 0;
+ copy = 11 + (hold & 0x7f);//BITS(7);
+ //--- DROPBITS(7) ---//
+ hold >>>= 7;
+ bits -= 7;
+ //---//
+ }
+ if (state.have + copy > state.nlen + state.ndist) {
+ strm.msg = 'invalid bit length repeat';
+ state.mode = BAD;
+ break;
+ }
+ while (copy--) {
+ state.lens[state.have++] = len;
+ }
+ }
+ }
+
+ /* handle error breaks in while */
+ if (state.mode === BAD) { break; }
+
+ /* check for end-of-block code (better have one) */
+ if (state.lens[256] === 0) {
+ strm.msg = 'invalid code -- missing end-of-block';
+ state.mode = BAD;
+ break;
+ }
+
+ /* build code tables -- note: do not change the lenbits or distbits
+ values here (9 and 6) without reading the comments in inftrees.h
+ concerning the ENOUGH constants, which depend on those values */
+ state.lenbits = 9;
+
+ opts = { bits: state.lenbits };
+ ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
+ // We have separate tables & no pointers. 2 commented lines below not needed.
+ // state.next_index = opts.table_index;
+ state.lenbits = opts.bits;
+ // state.lencode = state.next;
+
+ if (ret) {
+ strm.msg = 'invalid literal/lengths set';
+ state.mode = BAD;
+ break;
+ }
+
+ state.distbits = 6;
+ //state.distcode.copy(state.codes);
+ // Switch to use dynamic table
+ state.distcode = state.distdyn;
+ opts = { bits: state.distbits };
+ ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
+ // We have separate tables & no pointers. 2 commented lines below not needed.
+ // state.next_index = opts.table_index;
+ state.distbits = opts.bits;
+ // state.distcode = state.next;
+
+ if (ret) {
+ strm.msg = 'invalid distances set';
+ state.mode = BAD;
+ break;
+ }
+ //Tracev((stderr, 'inflate: codes ok\n'));
+ state.mode = LEN_;
+ if (flush === Z_TREES) { break inf_leave; }
+ /* falls through */
+ case LEN_:
+ state.mode = LEN;
+ /* falls through */
+ case LEN:
+ if (have >= 6 && left >= 258) {
+ //--- RESTORE() ---
+ strm.next_out = put;
+ strm.avail_out = left;
+ strm.next_in = next;
+ strm.avail_in = have;
+ state.hold = hold;
+ state.bits = bits;
+ //---
+ inflate_fast(strm, _out);
+ //--- LOAD() ---
+ put = strm.next_out;
+ output = strm.output;
+ left = strm.avail_out;
+ next = strm.next_in;
+ input = strm.input;
+ have = strm.avail_in;
+ hold = state.hold;
+ bits = state.bits;
+ //---
+
+ if (state.mode === TYPE) {
+ state.back = -1;
+ }
+ break;
+ }
+ state.back = 0;
+ for (;;) {
+ here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/
+ here_bits = here >>> 24;
+ here_op = (here >>> 16) & 0xff;
+ here_val = here & 0xffff;
+
+ if (here_bits <= bits) { break; }
+ //--- PULLBYTE() ---//
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ //---//
+ }
+ if (here_op && (here_op & 0xf0) === 0) {
+ last_bits = here_bits;
+ last_op = here_op;
+ last_val = here_val;
+ for (;;) {
+ here = state.lencode[last_val +
+ ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
+ here_bits = here >>> 24;
+ here_op = (here >>> 16) & 0xff;
+ here_val = here & 0xffff;
+
+ if ((last_bits + here_bits) <= bits) { break; }
+ //--- PULLBYTE() ---//
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ //---//
+ }
+ //--- DROPBITS(last.bits) ---//
+ hold >>>= last_bits;
+ bits -= last_bits;
+ //---//
+ state.back += last_bits;
+ }
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ state.back += here_bits;
+ state.length = here_val;
+ if (here_op === 0) {
+ //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+ // "inflate: literal '%c'\n" :
+ // "inflate: literal 0x%02x\n", here.val));
+ state.mode = LIT;
+ break;
+ }
+ if (here_op & 32) {
+ //Tracevv((stderr, "inflate: end of block\n"));
+ state.back = -1;
+ state.mode = TYPE;
+ break;
+ }
+ if (here_op & 64) {
+ strm.msg = 'invalid literal/length code';
+ state.mode = BAD;
+ break;
+ }
+ state.extra = here_op & 15;
+ state.mode = LENEXT;
+ /* falls through */
+ case LENEXT:
+ if (state.extra) {
+ //=== NEEDBITS(state.extra);
+ n = state.extra;
+ while (bits < n) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
+ //--- DROPBITS(state.extra) ---//
+ hold >>>= state.extra;
+ bits -= state.extra;
+ //---//
+ state.back += state.extra;
+ }
+ //Tracevv((stderr, "inflate: length %u\n", state.length));
+ state.was = state.length;
+ state.mode = DIST;
+ /* falls through */
+ case DIST:
+ for (;;) {
+ here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
+ here_bits = here >>> 24;
+ here_op = (here >>> 16) & 0xff;
+ here_val = here & 0xffff;
+
+ if ((here_bits) <= bits) { break; }
+ //--- PULLBYTE() ---//
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ //---//
+ }
+ if ((here_op & 0xf0) === 0) {
+ last_bits = here_bits;
+ last_op = here_op;
+ last_val = here_val;
+ for (;;) {
+ here = state.distcode[last_val +
+ ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
+ here_bits = here >>> 24;
+ here_op = (here >>> 16) & 0xff;
+ here_val = here & 0xffff;
+
+ if ((last_bits + here_bits) <= bits) { break; }
+ //--- PULLBYTE() ---//
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ //---//
+ }
+ //--- DROPBITS(last.bits) ---//
+ hold >>>= last_bits;
+ bits -= last_bits;
+ //---//
+ state.back += last_bits;
+ }
+ //--- DROPBITS(here.bits) ---//
+ hold >>>= here_bits;
+ bits -= here_bits;
+ //---//
+ state.back += here_bits;
+ if (here_op & 64) {
+ strm.msg = 'invalid distance code';
+ state.mode = BAD;
+ break;
+ }
+ state.offset = here_val;
+ state.extra = (here_op) & 15;
+ state.mode = DISTEXT;
+ /* falls through */
+ case DISTEXT:
+ if (state.extra) {
+ //=== NEEDBITS(state.extra);
+ n = state.extra;
+ while (bits < n) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
+ //--- DROPBITS(state.extra) ---//
+ hold >>>= state.extra;
+ bits -= state.extra;
+ //---//
+ state.back += state.extra;
+ }
+ //#ifdef INFLATE_STRICT
+ if (state.offset > state.dmax) {
+ strm.msg = 'invalid distance too far back';
+ state.mode = BAD;
+ break;
+ }
+ //#endif
+ //Tracevv((stderr, "inflate: distance %u\n", state.offset));
+ state.mode = MATCH;
+ /* falls through */
+ case MATCH:
+ if (left === 0) { break inf_leave; }
+ copy = _out - left;
+ if (state.offset > copy) { /* copy from window */
+ copy = state.offset - copy;
+ if (copy > state.whave) {
+ if (state.sane) {
+ strm.msg = 'invalid distance too far back';
+ state.mode = BAD;
+ break;
+ }
+ // (!) This block is disabled in zlib defaults,
+ // don't enable it for binary compatibility
+ //#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ // Trace((stderr, "inflate.c too far\n"));
+ // copy -= state.whave;
+ // if (copy > state.length) { copy = state.length; }
+ // if (copy > left) { copy = left; }
+ // left -= copy;
+ // state.length -= copy;
+ // do {
+ // output[put++] = 0;
+ // } while (--copy);
+ // if (state.length === 0) { state.mode = LEN; }
+ // break;
+ //#endif
+ }
+ if (copy > state.wnext) {
+ copy -= state.wnext;
+ from = state.wsize - copy;
+ }
+ else {
+ from = state.wnext - copy;
+ }
+ if (copy > state.length) { copy = state.length; }
+ from_source = state.window;
+ }
+ else { /* copy from output */
+ from_source = output;
+ from = put - state.offset;
+ copy = state.length;
+ }
+ if (copy > left) { copy = left; }
+ left -= copy;
+ state.length -= copy;
+ do {
+ output[put++] = from_source[from++];
+ } while (--copy);
+ if (state.length === 0) { state.mode = LEN; }
+ break;
+ case LIT:
+ if (left === 0) { break inf_leave; }
+ output[put++] = state.length;
+ left--;
+ state.mode = LEN;
+ break;
+ case CHECK:
+ if (state.wrap) {
+ //=== NEEDBITS(32);
+ while (bits < 32) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ // Use '|' instead of '+' to make sure that result is signed
+ hold |= input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ _out -= left;
+ strm.total_out += _out;
+ state.total += _out;
+ if ((state.wrap & 4) && _out) {
+ strm.adler = state.check =
+ /*UPDATE_CHECK(state.check, put - _out, _out);*/
+ (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
+
+ }
+ _out = left;
+ // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
+ if ((state.wrap & 4) && (state.flags ? hold : zswap32(hold)) !== state.check) {
+ strm.msg = 'incorrect data check';
+ state.mode = BAD;
+ break;
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ //Tracev((stderr, "inflate: check matches trailer\n"));
+ }
+ state.mode = LENGTH;
+ /* falls through */
+ case LENGTH:
+ if (state.wrap && state.flags) {
+ //=== NEEDBITS(32);
+ while (bits < 32) {
+ if (have === 0) { break inf_leave; }
+ have--;
+ hold += input[next++] << bits;
+ bits += 8;
+ }
+ //===//
+ if ((state.wrap & 4) && hold !== (state.total & 0xffffffff)) {
+ strm.msg = 'incorrect length check';
+ state.mode = BAD;
+ break;
+ }
+ //=== INITBITS();
+ hold = 0;
+ bits = 0;
+ //===//
+ //Tracev((stderr, "inflate: length matches trailer\n"));
+ }
+ state.mode = DONE;
+ /* falls through */
+ case DONE:
+ ret = Z_STREAM_END$1;
+ break inf_leave;
+ case BAD:
+ ret = Z_DATA_ERROR$1;
+ break inf_leave;
+ case MEM:
+ return Z_MEM_ERROR$1;
+ case SYNC:
+ /* falls through */
+ default:
+ return Z_STREAM_ERROR$1;
+ }
+ }
+
+ // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
+
+ /*
+ Return from inflate(), updating the total counts and the check value.
+ If there was no progress during the inflate() call, return a buffer
+ error. Call updatewindow() to create and/or update the window state.
+ Note: a memory error from inflate() is non-recoverable.
+ */
+
+ //--- RESTORE() ---
+ strm.next_out = put;
+ strm.avail_out = left;
+ strm.next_in = next;
+ strm.avail_in = have;
+ state.hold = hold;
+ state.bits = bits;
+ //---
+
+ if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
+ (state.mode < CHECK || flush !== Z_FINISH$1))) {
+ if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) ;
+ }
+ _in -= strm.avail_in;
+ _out -= strm.avail_out;
+ strm.total_in += _in;
+ strm.total_out += _out;
+ state.total += _out;
+ if ((state.wrap & 4) && _out) {
+ strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
+ (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
+ }
+ strm.data_type = state.bits + (state.last ? 64 : 0) +
+ (state.mode === TYPE ? 128 : 0) +
+ (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
+ if (((_in === 0 && _out === 0) || flush === Z_FINISH$1) && ret === Z_OK$1) {
+ ret = Z_BUF_ERROR;
+ }
+ return ret;
+ };
+
+
+ const inflateEnd = (strm) => {
+
+ if (inflateStateCheck(strm)) {
+ return Z_STREAM_ERROR$1;
+ }
+
+ let state = strm.state;
+ if (state.window) {
+ state.window = null;
+ }
+ strm.state = null;
+ return Z_OK$1;
+ };
+
+
+ const inflateGetHeader = (strm, head) => {
+
+ /* check state */
+ if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }
+ const state = strm.state;
+ if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR$1; }
+
+ /* save header structure */
+ state.head = head;
+ head.done = false;
+ return Z_OK$1;
+ };
+
+
+ const inflateSetDictionary = (strm, dictionary) => {
+ const dictLength = dictionary.length;
+
+ let state;
+ let dictid;
+ let ret;
+
+ /* check state */
+ if (inflateStateCheck(strm)) { return Z_STREAM_ERROR$1; }
+ state = strm.state;
+
+ if (state.wrap !== 0 && state.mode !== DICT) {
+ return Z_STREAM_ERROR$1;
+ }
+
+ /* check for correct dictionary identifier */
+ if (state.mode === DICT) {
+ dictid = 1; /* adler32(0, null, 0)*/
+ /* dictid = adler32(dictid, dictionary, dictLength); */
+ dictid = adler32(dictid, dictionary, dictLength, 0);
+ if (dictid !== state.check) {
+ return Z_DATA_ERROR$1;
+ }
+ }
+ /* copy dictionary to window using updatewindow(), which will amend the
+ existing dictionary if appropriate */
+ ret = updatewindow(strm, dictionary, dictLength, dictLength);
+ if (ret) {
+ state.mode = MEM;
+ return Z_MEM_ERROR$1;
+ }
+ state.havedict = 1;
+ // Tracev((stderr, "inflate: dictionary set\n"));
+ return Z_OK$1;
+ };
+
+
+ inflate$2.inflateReset = inflateReset;
+ inflate$2.inflateReset2 = inflateReset2;
+ inflate$2.inflateResetKeep = inflateResetKeep;
+ inflate$2.inflateInit = inflateInit;
+ inflate$2.inflateInit2 = inflateInit2;
+ inflate$2.inflate = inflate$1;
+ inflate$2.inflateEnd = inflateEnd;
+ inflate$2.inflateGetHeader = inflateGetHeader;
+ inflate$2.inflateSetDictionary = inflateSetDictionary;
+ inflate$2.inflateInfo = 'pako inflate (from Nodeca project)';
+
+ var common = {};
+
+ const _has = (obj, key) => {
+ return Object.prototype.hasOwnProperty.call(obj, key);
+ };
+
+ common.assign = function (obj /*from1, from2, from3, ...*/) {
+ const sources = Array.prototype.slice.call(arguments, 1);
+ while (sources.length) {
+ const source = sources.shift();
+ if (!source) { continue; }
+
+ if (typeof source !== 'object') {
+ throw new TypeError(source + 'must be non-object');
+ }
+
+ for (const p in source) {
+ if (_has(source, p)) {
+ obj[p] = source[p];
+ }
+ }
+ }
+
+ return obj;
+ };
+
+
+ // Join array of chunks to single array.
+ common.flattenChunks = (chunks) => {
+ // calculate data length
+ let len = 0;
+
+ for (let i = 0, l = chunks.length; i < l; i++) {
+ len += chunks[i].length;
+ }
+
+ // join chunks
+ const result = new Uint8Array(len);
+
+ for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {
+ let chunk = chunks[i];
+ result.set(chunk, pos);
+ pos += chunk.length;
+ }
+
+ return result;
+ };
+
+ var strings$1 = {};
+
+ // Quick check if we can use fast array to bin string conversion
+ //
+ // - apply(Array) can fail on Android 2.2
+ // - apply(Uint8Array) can fail on iOS 5.1 Safari
+ //
+ let STR_APPLY_UIA_OK = true;
+
+ try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }
+
+
+ // Table with utf8 lengths (calculated by first byte of sequence)
+ // Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,
+ // because max possible codepoint is 0x10ffff
+ const _utf8len = new Uint8Array(256);
+ for (let q = 0; q < 256; q++) {
+ _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);
+ }
+ _utf8len[254] = _utf8len[254] = 1; // Invalid sequence start
+
+
+ // convert string to array (typed, when possible)
+ strings$1.string2buf = (str) => {
+ if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {
+ return new TextEncoder().encode(str);
+ }
+
+ let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;
+
+ // count binary size
+ for (m_pos = 0; m_pos < str_len; m_pos++) {
+ c = str.charCodeAt(m_pos);
+ if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
+ c2 = str.charCodeAt(m_pos + 1);
+ if ((c2 & 0xfc00) === 0xdc00) {
+ c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
+ m_pos++;
+ }
+ }
+ buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;
+ }
+
+ // allocate buffer
+ buf = new Uint8Array(buf_len);
+
+ // convert
+ for (i = 0, m_pos = 0; i < buf_len; m_pos++) {
+ c = str.charCodeAt(m_pos);
+ if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {
+ c2 = str.charCodeAt(m_pos + 1);
+ if ((c2 & 0xfc00) === 0xdc00) {
+ c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);
+ m_pos++;
+ }
+ }
+ if (c < 0x80) {
+ /* one byte */
+ buf[i++] = c;
+ } else if (c < 0x800) {
+ /* two bytes */
+ buf[i++] = 0xC0 | (c >>> 6);
+ buf[i++] = 0x80 | (c & 0x3f);
+ } else if (c < 0x10000) {
+ /* three bytes */
+ buf[i++] = 0xE0 | (c >>> 12);
+ buf[i++] = 0x80 | (c >>> 6 & 0x3f);
+ buf[i++] = 0x80 | (c & 0x3f);
+ } else {
+ /* four bytes */
+ buf[i++] = 0xf0 | (c >>> 18);
+ buf[i++] = 0x80 | (c >>> 12 & 0x3f);
+ buf[i++] = 0x80 | (c >>> 6 & 0x3f);
+ buf[i++] = 0x80 | (c & 0x3f);
+ }
+ }
+
+ return buf;
+ };
+
+ // Helper
+ const buf2binstring = (buf, len) => {
+ // On Chrome, the arguments in a function call that are allowed is `65534`.
+ // If the length of the buffer is smaller than that, we can use this optimization,
+ // otherwise we will take a slower path.
+ if (len < 65534) {
+ if (buf.subarray && STR_APPLY_UIA_OK) {
+ return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));
+ }
+ }
+
+ let result = '';
+ for (let i = 0; i < len; i++) {
+ result += String.fromCharCode(buf[i]);
+ }
+ return result;
+ };
+
+
+ // convert array to string
+ strings$1.buf2string = (buf, max) => {
+ const len = max || buf.length;
+
+ if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {
+ return new TextDecoder().decode(buf.subarray(0, max));
+ }
+
+ let i, out;
+
+ // Reserve max possible length (2 words per char)
+ // NB: by unknown reasons, Array is significantly faster for
+ // String.fromCharCode.apply than Uint16Array.
+ const utf16buf = new Array(len * 2);
+
+ for (out = 0, i = 0; i < len;) {
+ let c = buf[i++];
+ // quick process ascii
+ if (c < 0x80) { utf16buf[out++] = c; continue; }
+
+ let c_len = _utf8len[c];
+ // skip 5 & 6 byte codes
+ if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }
+
+ // apply mask on first byte
+ c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;
+ // join the rest
+ while (c_len > 1 && i < len) {
+ c = (c << 6) | (buf[i++] & 0x3f);
+ c_len--;
+ }
+
+ // terminated by end of string?
+ if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }
+
+ if (c < 0x10000) {
+ utf16buf[out++] = c;
+ } else {
+ c -= 0x10000;
+ utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);
+ utf16buf[out++] = 0xdc00 | (c & 0x3ff);
+ }
+ }
+
+ return buf2binstring(utf16buf, out);
+ };
+
+
+ // Calculate max possible position in utf8 buffer,
+ // that will not break sequence. If that's not possible
+ // - (very small limits) return max size as is.
+ //
+ // buf[] - utf8 bytes array
+ // max - length limit (mandatory);
+ strings$1.utf8border = (buf, max) => {
+
+ max = max || buf.length;
+ if (max > buf.length) { max = buf.length; }
+
+ // go back from last position, until start of sequence found
+ let pos = max - 1;
+ while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
+
+ // Very small and broken sequence,
+ // return max, because we should return something anyway.
+ if (pos < 0) { return max; }
+
+ // If we came to start of buffer - that means buffer is too small,
+ // return max too.
+ if (pos === 0) { return max; }
+
+ return (pos + _utf8len[buf[pos]] > max) ? pos : max;
+ };
+
+ // (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+ //
+ // This software is provided 'as-is', without any express or implied
+ // warranty. In no event will the authors be held liable for any damages
+ // arising from the use of this software.
+ //
+ // Permission is granted to anyone to use this software for any purpose,
+ // including commercial applications, and to alter it and redistribute it
+ // freely, subject to the following restrictions:
+ //
+ // 1. The origin of this software must not be misrepresented; you must not
+ // claim that you wrote the original software. If you use this software
+ // in a product, an acknowledgment in the product documentation would be
+ // appreciated but is not required.
+ // 2. Altered source versions must be plainly marked as such, and must not be
+ // misrepresented as being the original software.
+ // 3. This notice may not be removed or altered from any source distribution.
+
+ var messages = {
+ 2: 'need dictionary', /* Z_NEED_DICT 2 */
+ 1: 'stream end', /* Z_STREAM_END 1 */
+ 0: '', /* Z_OK 0 */
+ '-1': 'file error', /* Z_ERRNO (-1) */
+ '-2': 'stream error', /* Z_STREAM_ERROR (-2) */
+ '-3': 'data error', /* Z_DATA_ERROR (-3) */
+ '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
+ '-5': 'buffer error', /* Z_BUF_ERROR (-5) */
+ '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
+ };
+
+ // (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+ //
+ // This software is provided 'as-is', without any express or implied
+ // warranty. In no event will the authors be held liable for any damages
+ // arising from the use of this software.
+ //
+ // Permission is granted to anyone to use this software for any purpose,
+ // including commercial applications, and to alter it and redistribute it
+ // freely, subject to the following restrictions:
+ //
+ // 1. The origin of this software must not be misrepresented; you must not
+ // claim that you wrote the original software. If you use this software
+ // in a product, an acknowledgment in the product documentation would be
+ // appreciated but is not required.
+ // 2. Altered source versions must be plainly marked as such, and must not be
+ // misrepresented as being the original software.
+ // 3. This notice may not be removed or altered from any source distribution.
+
+ function ZStream$1() {
+ /* next input byte */
+ this.input = null; // JS specific, because we have no pointers
+ this.next_in = 0;
+ /* number of bytes available at input */
+ this.avail_in = 0;
+ /* total number of input bytes read so far */
+ this.total_in = 0;
+ /* next output byte should be put there */
+ this.output = null; // JS specific, because we have no pointers
+ this.next_out = 0;
+ /* remaining free space at output */
+ this.avail_out = 0;
+ /* total number of bytes output so far */
+ this.total_out = 0;
+ /* last error message, NULL if no error */
+ this.msg = ''/*Z_NULL*/;
+ /* not visible by applications */
+ this.state = null;
+ /* best guess about the data type: binary or text */
+ this.data_type = 2/*Z_UNKNOWN*/;
+ /* adler32 value of the uncompressed data */
+ this.adler = 0;
+ }
+
+ var zstream = ZStream$1;
+
+ // (C) 1995-2013 Jean-loup Gailly and Mark Adler
+ // (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
+ //
+ // This software is provided 'as-is', without any express or implied
+ // warranty. In no event will the authors be held liable for any damages
+ // arising from the use of this software.
+ //
+ // Permission is granted to anyone to use this software for any purpose,
+ // including commercial applications, and to alter it and redistribute it
+ // freely, subject to the following restrictions:
+ //
+ // 1. The origin of this software must not be misrepresented; you must not
+ // claim that you wrote the original software. If you use this software
+ // in a product, an acknowledgment in the product documentation would be
+ // appreciated but is not required.
+ // 2. Altered source versions must be plainly marked as such, and must not be
+ // misrepresented as being the original software.
+ // 3. This notice may not be removed or altered from any source distribution.
+
+ function GZheader$1() {
+ /* true if compressed data believed to be text */
+ this.text = 0;
+ /* modification time */
+ this.time = 0;
+ /* extra flags (not used when writing a gzip file) */
+ this.xflags = 0;
+ /* operating system */
+ this.os = 0;
+ /* pointer to extra field or Z_NULL if none */
+ this.extra = null;
+ /* extra field length (valid if extra != Z_NULL) */
+ this.extra_len = 0; // Actually, we don't need it in JS,
+ // but leave for few code modifications
+
+ //
+ // Setup limits is not necessary because in js we should not preallocate memory
+ // for inflate use constant limit in 65536 bytes
+ //
+
+ /* space at extra (only when reading header) */
+ // this.extra_max = 0;
+ /* pointer to zero-terminated file name or Z_NULL */
+ this.name = '';
+ /* space at name (only when reading header) */
+ // this.name_max = 0;
+ /* pointer to zero-terminated comment or Z_NULL */
+ this.comment = '';
+ /* space at comment (only when reading header) */
+ // this.comm_max = 0;
+ /* true if there was or will be a header crc */
+ this.hcrc = 0;
+ /* true when done reading gzip header (not used when writing a gzip file) */
+ this.done = false;
+ }
+
+ var gzheader = GZheader$1;
+
+ const zlib_inflate = inflate$2;
+ const utils = common;
+ const strings = strings$1;
+ const msg = messages;
+ const ZStream = zstream;
+ const GZheader = gzheader;
+
+ const toString = Object.prototype.toString;
+
+ /* Public constants ==========================================================*/
+ /* ===========================================================================*/
+
+ const {
+ Z_NO_FLUSH, Z_FINISH,
+ Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR
+ } = constants;
+
+ /* ===========================================================================*/
+
+
+ /**
+ * class Inflate
+ *
+ * Generic JS-style wrapper for zlib calls. If you don't need
+ * streaming behaviour - use more simple functions: [[inflate]]
+ * and [[inflateRaw]].
+ **/
+
+ /* internal
+ * inflate.chunks -> Array
+ *
+ * Chunks of output data, if [[Inflate#onData]] not overridden.
+ **/
+
+ /**
+ * Inflate.result -> Uint8Array|String
+ *
+ * Uncompressed result, generated by default [[Inflate#onData]]
+ * and [[Inflate#onEnd]] handlers. Filled after you push last chunk
+ * (call [[Inflate#push]] with `Z_FINISH` / `true` param).
+ **/
+
+ /**
+ * Inflate.err -> Number
+ *
+ * Error code after inflate finished. 0 (Z_OK) on success.
+ * Should be checked if broken data possible.
+ **/
+
+ /**
+ * Inflate.msg -> String
+ *
+ * Error message, if [[Inflate.err]] != 0
+ **/
+
+
+ /**
+ * new Inflate(options)
+ * - options (Object): zlib inflate options.
+ *
+ * Creates new inflator instance with specified params. Throws exception
+ * on bad params. Supported options:
+ *
+ * - `windowBits`
+ * - `dictionary`
+ *
+ * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
+ * for more information on these.
+ *
+ * Additional options, for internal needs:
+ *
+ * - `chunkSize` - size of generated data chunks (16K by default)
+ * - `raw` (Boolean) - do raw inflate
+ * - `to` (String) - if equal to 'string', then result will be converted
+ * from utf8 to utf16 (javascript) string. When string output requested,
+ * chunk length can differ from `chunkSize`, depending on content.
+ *
+ * By default, when no options set, autodetect deflate/gzip data format via
+ * wrapper header.
+ *
+ * ##### Example:
+ *
+ * ```javascript
+ * const pako = require('pako')
+ * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])
+ * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);
+ *
+ * const inflate = new pako.Inflate({ level: 3});
+ *
+ * inflate.push(chunk1, false);
+ * inflate.push(chunk2, true); // true -> last chunk
+ *
+ * if (inflate.err) { throw new Error(inflate.err); }
+ *
+ * console.log(inflate.result);
+ * ```
+ **/
+ function Inflate(options) {
+ this.options = utils.assign({
+ chunkSize: 1024 * 64,
+ windowBits: 15,
+ to: ''
+ }, options || {});
+
+ const opt = this.options;
+
+ // Force window size for `raw` data, if not set directly,
+ // because we have no header for autodetect.
+ if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {
+ opt.windowBits = -opt.windowBits;
+ if (opt.windowBits === 0) { opt.windowBits = -15; }
+ }
+
+ // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate
+ if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&
+ !(options && options.windowBits)) {
+ opt.windowBits += 32;
+ }
+
+ // Gzip header has no info about windows size, we can do autodetect only
+ // for deflate. So, if window size not set, force it to max when gzip possible
+ if ((opt.windowBits > 15) && (opt.windowBits < 48)) {
+ // bit 3 (16) -> gzipped data
+ // bit 4 (32) -> autodetect gzip/deflate
+ if ((opt.windowBits & 15) === 0) {
+ opt.windowBits |= 15;
+ }
+ }
+
+ this.err = 0; // error code, if happens (0 = Z_OK)
+ this.msg = ''; // error message
+ this.ended = false; // used to avoid multiple onEnd() calls
+ this.chunks = []; // chunks of compressed data
+
+ this.strm = new ZStream();
+ this.strm.avail_out = 0;
+
+ let status = zlib_inflate.inflateInit2(
+ this.strm,
+ opt.windowBits
+ );
+
+ if (status !== Z_OK) {
+ throw new Error(msg[status]);
+ }
+
+ this.header = new GZheader();
+
+ zlib_inflate.inflateGetHeader(this.strm, this.header);
+
+ // Setup dictionary
+ if (opt.dictionary) {
+ // Convert data if needed
+ if (typeof opt.dictionary === 'string') {
+ opt.dictionary = strings.string2buf(opt.dictionary);
+ } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {
+ opt.dictionary = new Uint8Array(opt.dictionary);
+ }
+ if (opt.raw) { //In raw mode we need to set the dictionary early
+ status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);
+ if (status !== Z_OK) {
+ throw new Error(msg[status]);
+ }
+ }
+ }
+ }
+
+ /**
+ * Inflate#push(data[, flush_mode]) -> Boolean
+ * - data (Uint8Array|ArrayBuffer): input data
+ * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE
+ * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,
+ * `true` means Z_FINISH.
+ *
+ * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
+ * new output chunks. Returns `true` on success. If end of stream detected,
+ * [[Inflate#onEnd]] will be called.
+ *
+ * `flush_mode` is not needed for normal operation, because end of stream
+ * detected automatically. You may try to use it for advanced things, but
+ * this functionality was not tested.
+ *
+ * On fail call [[Inflate#onEnd]] with error code and return false.
+ *
+ * ##### Example
+ *
+ * ```javascript
+ * push(chunk, false); // push one of data chunks
+ * ...
+ * push(chunk, true); // push last chunk
+ * ```
+ **/
+ Inflate.prototype.push = function (data, flush_mode) {
+ const strm = this.strm;
+ const chunkSize = this.options.chunkSize;
+ const dictionary = this.options.dictionary;
+ let status, _flush_mode, last_avail_out;
+
+ if (this.ended) return false;
+
+ if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;
+ else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;
+
+ // Convert data if needed
+ if (toString.call(data) === '[object ArrayBuffer]') {
+ strm.input = new Uint8Array(data);
+ } else {
+ strm.input = data;
+ }
+
+ strm.next_in = 0;
+ strm.avail_in = strm.input.length;
+
+ for (;;) {
+ if (strm.avail_out === 0) {
+ strm.output = new Uint8Array(chunkSize);
+ strm.next_out = 0;
+ strm.avail_out = chunkSize;
+ }
+
+ status = zlib_inflate.inflate(strm, _flush_mode);
+
+ if (status === Z_NEED_DICT && dictionary) {
+ status = zlib_inflate.inflateSetDictionary(strm, dictionary);
+
+ if (status === Z_OK) {
+ status = zlib_inflate.inflate(strm, _flush_mode);
+ } else if (status === Z_DATA_ERROR) {
+ // Replace code with more verbose
+ status = Z_NEED_DICT;
+ }
+ }
+
+ // Skip snyc markers if more data follows and not raw mode
+ while (strm.avail_in > 0 &&
+ status === Z_STREAM_END &&
+ strm.state.wrap > 0 &&
+ data[strm.next_in] !== 0)
+ {
+ zlib_inflate.inflateReset(strm);
+ status = zlib_inflate.inflate(strm, _flush_mode);
+ }
+
+ switch (status) {
+ case Z_STREAM_ERROR:
+ case Z_DATA_ERROR:
+ case Z_NEED_DICT:
+ case Z_MEM_ERROR:
+ this.onEnd(status);
+ this.ended = true;
+ return false;
+ }
+
+ // Remember real `avail_out` value, because we may patch out buffer content
+ // to align utf8 strings boundaries.
+ last_avail_out = strm.avail_out;
+
+ if (strm.next_out) {
+ if (strm.avail_out === 0 || status === Z_STREAM_END) {
+
+ if (this.options.to === 'string') {
+
+ let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);
+
+ let tail = strm.next_out - next_out_utf8;
+ let utf8str = strings.buf2string(strm.output, next_out_utf8);
+
+ // move tail & realign counters
+ strm.next_out = tail;
+ strm.avail_out = chunkSize - tail;
+ if (tail) strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);
+
+ this.onData(utf8str);
+
+ } else {
+ this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));
+ }
+ }
+ }
+
+ // Must repeat iteration if out buffer is full
+ if (status === Z_OK && last_avail_out === 0) continue;
+
+ // Finalize if end of stream reached.
+ if (status === Z_STREAM_END) {
+ status = zlib_inflate.inflateEnd(this.strm);
+ this.onEnd(status);
+ this.ended = true;
+ return true;
+ }
+
+ if (strm.avail_in === 0) break;
+ }
+
+ return true;
+ };
+
+
+ /**
+ * Inflate#onData(chunk) -> Void
+ * - chunk (Uint8Array|String): output data. When string output requested,
+ * each chunk will be string.
+ *
+ * By default, stores data blocks in `chunks[]` property and glue
+ * those in `onEnd`. Override this handler, if you need another behaviour.
+ **/
+ Inflate.prototype.onData = function (chunk) {
+ this.chunks.push(chunk);
+ };
+
+
+ /**
+ * Inflate#onEnd(status) -> Void
+ * - status (Number): inflate status. 0 (Z_OK) on success,
+ * other if not.
+ *
+ * Called either after you tell inflate that the input stream is
+ * complete (Z_FINISH). By default - join collected chunks,
+ * free memory and fill `results` / `err` properties.
+ **/
+ Inflate.prototype.onEnd = function (status) {
+ // On success - join
+ if (status === Z_OK) {
+ if (this.options.to === 'string') {
+ this.result = this.chunks.join('');
+ } else {
+ this.result = utils.flattenChunks(this.chunks);
+ }
+ }
+ this.chunks = [];
+ this.err = status;
+ this.msg = this.strm.msg;
+ };
+
+
+ /**
+ * inflate(data[, options]) -> Uint8Array|String
+ * - data (Uint8Array|ArrayBuffer): input data to decompress.
+ * - options (Object): zlib inflate options.
+ *
+ * Decompress `data` with inflate/ungzip and `options`. Autodetect
+ * format via wrapper header by default. That's why we don't provide
+ * separate `ungzip` method.
+ *
+ * Supported options are:
+ *
+ * - windowBits
+ *
+ * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
+ * for more information.
+ *
+ * Sugar (options):
+ *
+ * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
+ * negative windowBits implicitly.
+ * - `to` (String) - if equal to 'string', then result will be converted
+ * from utf8 to utf16 (javascript) string. When string output requested,
+ * chunk length can differ from `chunkSize`, depending on content.
+ *
+ *
+ * ##### Example:
+ *
+ * ```javascript
+ * const pako = require('pako');
+ * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));
+ * let output;
+ *
+ * try {
+ * output = pako.inflate(input);
+ * } catch (err) {
+ * console.log(err);
+ * }
+ * ```
+ **/
+ function inflate(input, options) {
+ const inflator = new Inflate(options);
+
+ inflator.push(input);
+
+ // That will never happens, if you don't cheat with options :)
+ if (inflator.err) throw inflator.msg || msg[inflator.err];
+
+ return inflator.result;
+ }
+
+
+ /**
+ * inflateRaw(data[, options]) -> Uint8Array|String
+ * - data (Uint8Array|ArrayBuffer): input data to decompress.
+ * - options (Object): zlib inflate options.
+ *
+ * The same as [[inflate]], but creates raw data, without wrapper
+ * (header and adler32 crc).
+ **/
+ function inflateRaw(input, options) {
+ options = options || {};
+ options.raw = true;
+ return inflate(input, options);
+ }
+
+
+ /**
+ * ungzip(data[, options]) -> Uint8Array|String
+ * - data (Uint8Array|ArrayBuffer): input data to decompress.
+ * - options (Object): zlib inflate options.
+ *
+ * Just shortcut to [[inflate]], because it autodetects format
+ * by header.content. Done for convenience.
+ **/
+
+
+ inflate$3.Inflate = Inflate;
+ inflate$3.inflate = inflate;
+ inflate$3.inflateRaw = inflateRaw;
+ inflate$3.ungzip = inflate;
+ inflate$3.constants = constants;
+
+ // Datatype sizes
+ const sizeOfUint16 = Uint16Array.BYTES_PER_ELEMENT;
+ const sizeOfInt32 = Int32Array.BYTES_PER_ELEMENT;
+ const sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;
+
+ const Types = {
+ METADATA: 0,
+ TERRAIN: 1,
+ DBROOT: 2,
+ };
+
+ Types.fromString = function (s) {
+ if (s === "Metadata") {
+ return Types.METADATA;
+ } else if (s === "Terrain") {
+ return Types.TERRAIN;
+ } else if (s === "DbRoot") {
+ return Types.DBROOT;
+ }
+ };
+
+ function decodeGoogleEarthEnterprisePacket(parameters, transferableObjects) {
+ const type = Types.fromString(parameters.type);
+ let buffer = parameters.buffer;
+ decodeGoogleEarthEnterpriseData(parameters.key, buffer);
+
+ const uncompressedTerrain = uncompressPacket(buffer);
+ buffer = uncompressedTerrain.buffer;
+ const length = uncompressedTerrain.length;
+
+ switch (type) {
+ case Types.METADATA:
+ return processMetadata(buffer, length, parameters.quadKey);
+ case Types.TERRAIN:
+ return processTerrain(buffer, length, transferableObjects);
+ case Types.DBROOT:
+ transferableObjects.push(buffer);
+ return {
+ buffer: buffer,
+ };
+ }
+ }
+
+ const qtMagic = 32301;
+
+ function processMetadata(buffer, totalSize, quadKey) {
+ const dv = new DataView(buffer);
+ let offset = 0;
+ const magic = dv.getUint32(offset, true);
+ offset += sizeOfUint32;
+ if (magic !== qtMagic) {
+ throw new RuntimeError.RuntimeError("Invalid magic");
+ }
+
+ const dataTypeId = dv.getUint32(offset, true);
+ offset += sizeOfUint32;
+ if (dataTypeId !== 1) {
+ throw new RuntimeError.RuntimeError("Invalid data type. Must be 1 for QuadTreePacket");
+ }
+
+ // Tile format version
+ const quadVersion = dv.getUint32(offset, true);
+ offset += sizeOfUint32;
+ if (quadVersion !== 2) {
+ throw new RuntimeError.RuntimeError(
+ "Invalid QuadTreePacket version. Only version 2 is supported."
+ );
+ }
+
+ const numInstances = dv.getInt32(offset, true);
+ offset += sizeOfInt32;
+
+ const dataInstanceSize = dv.getInt32(offset, true);
+ offset += sizeOfInt32;
+ if (dataInstanceSize !== 32) {
+ throw new RuntimeError.RuntimeError("Invalid instance size.");
+ }
+
+ const dataBufferOffset = dv.getInt32(offset, true);
+ offset += sizeOfInt32;
+
+ const dataBufferSize = dv.getInt32(offset, true);
+ offset += sizeOfInt32;
+
+ const metaBufferSize = dv.getInt32(offset, true);
+ offset += sizeOfInt32;
+
+ // Offset from beginning of packet (instances + current offset)
+ if (dataBufferOffset !== numInstances * dataInstanceSize + offset) {
+ throw new RuntimeError.RuntimeError("Invalid dataBufferOffset");
+ }
+
+ // Verify the packets is all there header + instances + dataBuffer + metaBuffer
+ if (dataBufferOffset + dataBufferSize + metaBufferSize !== totalSize) {
+ throw new RuntimeError.RuntimeError("Invalid packet offsets");
+ }
+
+ // Read all the instances
+ const instances = [];
+ for (let i = 0; i < numInstances; ++i) {
+ const bitfield = dv.getUint8(offset);
+ ++offset;
+
+ ++offset; // 2 byte align
+
+ const cnodeVersion = dv.getUint16(offset, true);
+ offset += sizeOfUint16;
+
+ const imageVersion = dv.getUint16(offset, true);
+ offset += sizeOfUint16;
+
+ const terrainVersion = dv.getUint16(offset, true);
+ offset += sizeOfUint16;
+
+ // Number of channels stored in the dataBuffer
+ offset += sizeOfUint16;
+
+ offset += sizeOfUint16; // 4 byte align
+
+ // Channel type offset into dataBuffer
+ offset += sizeOfInt32;
+
+ // Channel version offset into dataBuffer
+ offset += sizeOfInt32;
+
+ offset += 8; // Ignore image neighbors for now
+
+ // Data providers
+ const imageProvider = dv.getUint8(offset++);
+ const terrainProvider = dv.getUint8(offset++);
+ offset += sizeOfUint16; // 4 byte align
+
+ instances.push(
+ new GoogleEarthEnterpriseTileInformation(
+ bitfield,
+ cnodeVersion,
+ imageVersion,
+ terrainVersion,
+ imageProvider,
+ terrainProvider
+ )
+ );
+ }
+
+ const tileInfo = [];
+ let index = 0;
+
+ function populateTiles(parentKey, parent, level) {
+ let isLeaf = false;
+ if (level === 4) {
+ if (parent.hasSubtree()) {
+ return; // We have a subtree, so just return
+ }
+
+ isLeaf = true; // No subtree, so set all children to null
+ }
+ for (let i = 0; i < 4; ++i) {
+ const childKey = parentKey + i.toString();
+ if (isLeaf) {
+ // No subtree so set all children to null
+ tileInfo[childKey] = null;
+ } else if (level < 4) {
+ // We are still in the middle of the subtree, so add child
+ // only if their bits are set, otherwise set child to null.
+ if (!parent.hasChild(i)) {
+ tileInfo[childKey] = null;
+ } else {
+ if (index === numInstances) {
+ console.log("Incorrect number of instances");
+ return;
+ }
+
+ const instance = instances[index++];
+ tileInfo[childKey] = instance;
+ populateTiles(childKey, instance, level + 1);
+ }
+ }
+ }
+ }
+
+ let level = 0;
+ const root = instances[index++];
+ if (quadKey === "") {
+ // Root tile has data at its root and one less level
+ ++level;
+ } else {
+ tileInfo[quadKey] = root; // This will only contain the child bitmask
+ }
+
+ populateTiles(quadKey, root, level);
+
+ return tileInfo;
+ }
+
+ const numMeshesPerPacket = 5;
+ const numSubMeshesPerMesh = 4;
+
+ // Each terrain packet will have 5 meshes - each containg 4 sub-meshes:
+ // 1 even level mesh and its 4 odd level children.
+ // Any remaining bytes after the 20 sub-meshes contains water surface meshes,
+ // which are ignored.
+ function processTerrain(buffer, totalSize, transferableObjects) {
+ const dv = new DataView(buffer);
+
+ // Find the sub-meshes.
+ const advanceMesh = function (pos) {
+ for (let sub = 0; sub < numSubMeshesPerMesh; ++sub) {
+ const size = dv.getUint32(pos, true);
+ pos += sizeOfUint32;
+ pos += size;
+ if (pos > totalSize) {
+ throw new RuntimeError.RuntimeError("Malformed terrain packet found.");
+ }
+ }
+ return pos;
+ };
+
+ let offset = 0;
+ const terrainMeshes = [];
+ while (terrainMeshes.length < numMeshesPerPacket) {
+ const start = offset;
+ offset = advanceMesh(offset);
+ const mesh = buffer.slice(start, offset);
+ transferableObjects.push(mesh);
+ terrainMeshes.push(mesh);
+ }
+
+ return terrainMeshes;
+ }
+
+ const compressedMagic = 0x7468dead;
+ const compressedMagicSwap = 0xadde6874;
+
+ function uncompressPacket(data) {
+ // The layout of this decoded data is
+ // Magic Uint32
+ // Size Uint32
+ // [GZipped chunk of Size bytes]
+
+ // Pullout magic and verify we have the correct data
+ const dv = new DataView(data);
+ let offset = 0;
+ const magic = dv.getUint32(offset, true);
+ offset += sizeOfUint32;
+ if (magic !== compressedMagic && magic !== compressedMagicSwap) {
+ throw new RuntimeError.RuntimeError("Invalid magic");
+ }
+
+ // Get the size of the compressed buffer - the endianness depends on which magic was used
+ const size = dv.getUint32(offset, magic === compressedMagic);
+ offset += sizeOfUint32;
+
+ const compressedPacket = new Uint8Array(data, offset);
+ const uncompressedPacket = inflate$3.inflate(compressedPacket);
+
+ if (uncompressedPacket.length !== size) {
+ throw new RuntimeError.RuntimeError("Size of packet doesn't match header");
+ }
+
+ return uncompressedPacket;
+ }
+ var decodeGoogleEarthEnterprisePacket$1 = createTaskProcessorWorker(decodeGoogleEarthEnterprisePacket);
+
+ return decodeGoogleEarthEnterprisePacket$1;
+
+}));
+//# sourceMappingURL=decodeGoogleEarthEnterprisePacket.js.map
diff --git a/examples/cesium/Workers/decodeGoogleEarthEnterprisePacket.js.map b/examples/cesium/Workers/decodeGoogleEarthEnterprisePacket.js.map
new file mode 100644
index 0000000..6fe705d
--- /dev/null
+++ b/examples/cesium/Workers/decodeGoogleEarthEnterprisePacket.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeGoogleEarthEnterprisePacket.js","sources":["../../../Source/Core/decodeGoogleEarthEnterpriseData.js","../../../Source/Core/isBitSet.js","../../../Source/Core/GoogleEarthEnterpriseTileInformation.js","../../../node_modules/pako/lib/zlib/adler32.js","../../../node_modules/pako/lib/zlib/crc32.js","../../../node_modules/pako/lib/zlib/inffast.js","../../../node_modules/pako/lib/zlib/inftrees.js","../../../node_modules/pako/lib/zlib/constants.js","../../../node_modules/pako/lib/zlib/inflate.js","../../../node_modules/pako/lib/utils/common.js","../../../node_modules/pako/lib/utils/strings.js","../../../node_modules/pako/lib/zlib/messages.js","../../../node_modules/pako/lib/zlib/zstream.js","../../../node_modules/pako/lib/zlib/gzheader.js","../../../node_modules/pako/lib/inflate.js","../../../Source/WorkersES6/decodeGoogleEarthEnterprisePacket.js"],"sourcesContent":["import Check from \"./Check.js\";\r\nimport RuntimeError from \"./RuntimeError.js\";\r\n\r\nconst compressedMagic = 0x7468dead;\r\nconst compressedMagicSwap = 0xadde6874;\r\n\r\n/**\r\n * Decodes data that is received from the Google Earth Enterprise server.\r\n *\r\n * @param {ArrayBuffer} key The key used during decoding.\r\n * @param {ArrayBuffer} data The data to be decoded.\r\n *\r\n * @private\r\n */\r\nfunction decodeGoogleEarthEnterpriseData(key, data) {\r\n if (decodeGoogleEarthEnterpriseData.passThroughDataForTesting) {\r\n return data;\r\n }\r\n\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"key\", key);\r\n Check.typeOf.object(\"data\", data);\r\n //>>includeEnd('debug');\r\n\r\n const keyLength = key.byteLength;\r\n if (keyLength === 0 || keyLength % 4 !== 0) {\r\n throw new RuntimeError(\r\n \"The length of key must be greater than 0 and a multiple of 4.\"\r\n );\r\n }\r\n\r\n const dataView = new DataView(data);\r\n const magic = dataView.getUint32(0, true);\r\n if (magic === compressedMagic || magic === compressedMagicSwap) {\r\n // Occasionally packets don't come back encoded, so just return\r\n return data;\r\n }\r\n\r\n const keyView = new DataView(key);\r\n\r\n let dp = 0;\r\n const dpend = data.byteLength;\r\n const dpend64 = dpend - (dpend % 8);\r\n const kpend = keyLength;\r\n let kp;\r\n let off = 8;\r\n\r\n // This algorithm is intentionally asymmetric to make it more difficult to\r\n // guess. Security through obscurity. :-(\r\n\r\n // while we have a full uint64 (8 bytes) left to do\r\n // assumes buffer is 64bit aligned (or processor doesn't care)\r\n while (dp < dpend64) {\r\n // rotate the key each time through by using the offets 16,0,8,16,0,8,...\r\n off = (off + 8) % 24;\r\n kp = off;\r\n\r\n // run through one key length xor'ing one uint64 at a time\r\n // then drop out to rotate the key for the next bit\r\n while (dp < dpend64 && kp < kpend) {\r\n dataView.setUint32(\r\n dp,\r\n dataView.getUint32(dp, true) ^ keyView.getUint32(kp, true),\r\n true\r\n );\r\n dataView.setUint32(\r\n dp + 4,\r\n dataView.getUint32(dp + 4, true) ^ keyView.getUint32(kp + 4, true),\r\n true\r\n );\r\n dp += 8;\r\n kp += 24;\r\n }\r\n }\r\n\r\n // now the remaining 1 to 7 bytes\r\n if (dp < dpend) {\r\n if (kp >= kpend) {\r\n // rotate the key one last time (if necessary)\r\n off = (off + 8) % 24;\r\n kp = off;\r\n }\r\n\r\n while (dp < dpend) {\r\n dataView.setUint8(dp, dataView.getUint8(dp) ^ keyView.getUint8(kp));\r\n dp++;\r\n kp++;\r\n }\r\n }\r\n}\r\n\r\ndecodeGoogleEarthEnterpriseData.passThroughDataForTesting = false;\r\nexport default decodeGoogleEarthEnterpriseData;\r\n","/**\r\n * @private\r\n */\r\nfunction isBitSet(bits, mask) {\r\n return (bits & mask) !== 0;\r\n}\r\nexport default isBitSet;\r\n","import defined from \"./defined.js\";\r\nimport isBitSet from \"./isBitSet.js\";\r\n\r\n// Bitmask for checking tile properties\r\nconst childrenBitmasks = [0x01, 0x02, 0x04, 0x08];\r\nconst anyChildBitmask = 0x0f;\r\nconst cacheFlagBitmask = 0x10; // True if there is a child subtree\r\nconst imageBitmask = 0x40;\r\nconst terrainBitmask = 0x80;\r\n\r\n/**\r\n * Contains information about each tile from a Google Earth Enterprise server\r\n *\r\n * @param {Number} bits Bitmask that contains the type of data and available children for each tile.\r\n * @param {Number} cnodeVersion Version of the request for subtree metadata.\r\n * @param {Number} imageryVersion Version of the request for imagery tile.\r\n * @param {Number} terrainVersion Version of the request for terrain tile.\r\n * @param {Number} imageryProvider Id of imagery provider.\r\n * @param {Number} terrainProvider Id of terrain provider.\r\n *\r\n * @private\r\n */\r\nfunction GoogleEarthEnterpriseTileInformation(\r\n bits,\r\n cnodeVersion,\r\n imageryVersion,\r\n terrainVersion,\r\n imageryProvider,\r\n terrainProvider\r\n) {\r\n this._bits = bits;\r\n this.cnodeVersion = cnodeVersion;\r\n this.imageryVersion = imageryVersion;\r\n this.terrainVersion = terrainVersion;\r\n this.imageryProvider = imageryProvider;\r\n this.terrainProvider = terrainProvider;\r\n this.ancestorHasTerrain = false; // Set it later once we find its parent\r\n this.terrainState = undefined;\r\n}\r\n\r\n/**\r\n * Creates GoogleEarthEnterpriseTileInformation from an object\r\n *\r\n * @param {Object} info Object to be cloned\r\n * @param {GoogleEarthEnterpriseTileInformation} [result] The object onto which to store the result.\r\n * @returns {GoogleEarthEnterpriseTileInformation} The modified result parameter or a new GoogleEarthEnterpriseTileInformation instance if none was provided.\r\n */\r\nGoogleEarthEnterpriseTileInformation.clone = function (info, result) {\r\n if (!defined(result)) {\r\n result = new GoogleEarthEnterpriseTileInformation(\r\n info._bits,\r\n info.cnodeVersion,\r\n info.imageryVersion,\r\n info.terrainVersion,\r\n info.imageryProvider,\r\n info.terrainProvider\r\n );\r\n } else {\r\n result._bits = info._bits;\r\n result.cnodeVersion = info.cnodeVersion;\r\n result.imageryVersion = info.imageryVersion;\r\n result.terrainVersion = info.terrainVersion;\r\n result.imageryProvider = info.imageryProvider;\r\n result.terrainProvider = info.terrainProvider;\r\n }\r\n result.ancestorHasTerrain = info.ancestorHasTerrain;\r\n result.terrainState = info.terrainState;\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Sets the parent for the tile\r\n *\r\n * @param {GoogleEarthEnterpriseTileInformation} parent Parent tile\r\n */\r\nGoogleEarthEnterpriseTileInformation.prototype.setParent = function (parent) {\r\n this.ancestorHasTerrain = parent.ancestorHasTerrain || this.hasTerrain();\r\n};\r\n\r\n/**\r\n * Gets whether a subtree is available\r\n *\r\n * @returns {Boolean} true if subtree is available, false otherwise.\r\n */\r\nGoogleEarthEnterpriseTileInformation.prototype.hasSubtree = function () {\r\n return isBitSet(this._bits, cacheFlagBitmask);\r\n};\r\n\r\n/**\r\n * Gets whether imagery is available\r\n *\r\n * @returns {Boolean} true if imagery is available, false otherwise.\r\n */\r\nGoogleEarthEnterpriseTileInformation.prototype.hasImagery = function () {\r\n return isBitSet(this._bits, imageBitmask);\r\n};\r\n\r\n/**\r\n * Gets whether terrain is available\r\n *\r\n * @returns {Boolean} true if terrain is available, false otherwise.\r\n */\r\nGoogleEarthEnterpriseTileInformation.prototype.hasTerrain = function () {\r\n return isBitSet(this._bits, terrainBitmask);\r\n};\r\n\r\n/**\r\n * Gets whether any children are present\r\n *\r\n * @returns {Boolean} true if any children are available, false otherwise.\r\n */\r\nGoogleEarthEnterpriseTileInformation.prototype.hasChildren = function () {\r\n return isBitSet(this._bits, anyChildBitmask);\r\n};\r\n\r\n/**\r\n * Gets whether a specified child is available\r\n *\r\n * @param {Number} index Index of child tile\r\n *\r\n * @returns {Boolean} true if child is available, false otherwise\r\n */\r\nGoogleEarthEnterpriseTileInformation.prototype.hasChild = function (index) {\r\n return isBitSet(this._bits, childrenBitmasks[index]);\r\n};\r\n\r\n/**\r\n * Gets bitmask containing children\r\n *\r\n * @returns {Number} Children bitmask\r\n */\r\nGoogleEarthEnterpriseTileInformation.prototype.getChildBitmask = function () {\r\n return this._bits & anyChildBitmask;\r\n};\r\nexport default GoogleEarthEnterpriseTileInformation;\r\n","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = (adler, buf, len, pos) => {\n let s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n};\n\n\nmodule.exports = adler32;\n","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nconst makeTable = () => {\n let c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n};\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = new Uint32Array(makeTable());\n\n\nconst crc32 = (crc, buf, len, pos) => {\n const t = crcTable;\n const end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n};\n\n\nmodule.exports = crc32;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let last; /* have enough input while in < last */\n let _out; /* local strm.output */\n let beg; /* inflate()'s initial strm.output */\n let end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n let dmax; /* maximum distance from zlib header */\n//#endif\n let wsize; /* window size or zero if not using window */\n let whave; /* valid bytes in the window */\n let wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let s_window; /* allocated sliding window, if wsize != 0 */\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let lcode; /* local strm.lencode */\n let dcode; /* local strm.distcode */\n let lmask; /* mask for first level of length codes */\n let dmask; /* mask for first level of distance codes */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n /* window position, window bytes to copy */\n let len; /* match length, unused bytes */\n let dist; /* match distance */\n let from; /* where to copy match from */\n let from_source;\n\n\n let input, output; // JS specific, because we have no pointers\n\n /* copy state to local variables */\n const state = strm.state;\n //here = state.here;\n _in = strm.next_in;\n input = strm.input;\n last = _in + (strm.avail_in - 5);\n _out = strm.next_out;\n output = strm.output;\n beg = _out - (start - strm.avail_out);\n end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n dmax = state.dmax;\n//#endif\n wsize = state.wsize;\n whave = state.whave;\n wnext = state.wnext;\n s_window = state.window;\n hold = state.hold;\n bits = state.bits;\n lcode = state.lencode;\n dcode = state.distcode;\n lmask = (1 << state.lenbits) - 1;\n dmask = (1 << state.distbits) - 1;\n\n\n /* decode literals and length/distances until end-of-block or not enough\n input data or output space */\n\n top:\n do {\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n\n here = lcode[hold & lmask];\n\n dolen:\n for (;;) { // Goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n if (op === 0) { /* literal */\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n output[_out++] = here & 0xffff/*here.val*/;\n }\n else if (op & 16) { /* length base */\n len = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (op) {\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n len += hold & ((1 << op) - 1);\n hold >>>= op;\n bits -= op;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", len));\n if (bits < 15) {\n hold += input[_in++] << bits;\n bits += 8;\n hold += input[_in++] << bits;\n bits += 8;\n }\n here = dcode[hold & dmask];\n\n dodist:\n for (;;) { // goto emulation\n op = here >>> 24/*here.bits*/;\n hold >>>= op;\n bits -= op;\n op = (here >>> 16) & 0xff/*here.op*/;\n\n if (op & 16) { /* distance base */\n dist = here & 0xffff/*here.val*/;\n op &= 15; /* number of extra bits */\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n if (bits < op) {\n hold += input[_in++] << bits;\n bits += 8;\n }\n }\n dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n if (dist > dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n//#endif\n hold >>>= op;\n bits -= op;\n //Tracevv((stderr, \"inflate: distance %u\\n\", dist));\n op = _out - beg; /* max distance in output */\n if (dist > op) { /* see if copy from window */\n op = dist - op; /* distance back in window */\n if (op > whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break top;\n }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// if (len <= op - whave) {\n// do {\n// output[_out++] = 0;\n// } while (--len);\n// continue top;\n// }\n// len -= op - whave;\n// do {\n// output[_out++] = 0;\n// } while (--op > whave);\n// if (op === 0) {\n// from = _out - dist;\n// do {\n// output[_out++] = output[from++];\n// } while (--len);\n// continue top;\n// }\n//#endif\n }\n from = 0; // window index\n from_source = s_window;\n if (wnext === 0) { /* very common case */\n from += wsize - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n else if (wnext < op) { /* wrap around window */\n from += wsize + wnext - op;\n op -= wnext;\n if (op < len) { /* some from end of window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = 0;\n if (wnext < len) { /* some from start of window */\n op = wnext;\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n }\n else { /* contiguous in window */\n from += wnext - op;\n if (op < len) { /* some from window */\n len -= op;\n do {\n output[_out++] = s_window[from++];\n } while (--op);\n from = _out - dist; /* rest from output */\n from_source = output;\n }\n }\n while (len > 2) {\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n output[_out++] = from_source[from++];\n len -= 3;\n }\n if (len) {\n output[_out++] = from_source[from++];\n if (len > 1) {\n output[_out++] = from_source[from++];\n }\n }\n }\n else {\n from = _out - dist; /* copy direct from output */\n do { /* minimum length is three */\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n output[_out++] = output[from++];\n len -= 3;\n } while (len > 2);\n if (len) {\n output[_out++] = output[from++];\n if (len > 1) {\n output[_out++] = output[from++];\n }\n }\n }\n }\n else if ((op & 64) === 0) { /* 2nd level distance code */\n here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dodist;\n }\n else {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n }\n else if ((op & 64) === 0) { /* 2nd level length code */\n here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n continue dolen;\n }\n else if (op & 32) { /* end-of-block */\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.mode = TYPE;\n break top;\n }\n else {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break top;\n }\n\n break; // need to emulate goto via \"continue\"\n }\n } while (_in < last && _out < end);\n\n /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n len = bits >> 3;\n _in -= len;\n bits -= len << 3;\n hold &= (1 << bits) - 1;\n\n /* update state and return */\n strm.next_in = _in;\n strm.next_out = _out;\n strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n state.hold = hold;\n state.bits = bits;\n return;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\nconst lbase = new Uint16Array([ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n]);\n\nconst lext = new Uint8Array([ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n]);\n\nconst dbase = new Uint16Array([ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n]);\n\nconst dext = new Uint8Array([ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n]);\n\nconst inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) =>\n{\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let mask; /* mask for low root bits */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n// let shoextra; /* extra bits table to use */\n let match; /* use base and extra for symbol >= match */\n const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer\n increments for the same length, and zeros are appended as the length\n increases. For the deflate format, these bits are stored backwards\n from their more natural integer increment ordering, and so when the\n decoding tables are built in the large loop below, the integer codes\n are incremented backwards.\n\n This routine assumes, but does not check, that all of the entries in\n lens[] are in the range 0..MAXBITS. The caller must assure this.\n 1..MAXBITS is interpreted as that code length. zero means that that\n symbol does not occur in this code.\n\n The codes are sorted by computing a count of codes for each length,\n creating from that a table of starting indices for each length in the\n sorted table, and then entering the symbols in order in the sorted\n table. The sorted table is work[], with that space being provided by\n the caller.\n\n The length counts are used for other purposes as well, i.e. finding\n the minimum and maximum length codes, determining if there are any\n codes at all, checking for a valid set of lengths, and looking ahead\n at length counts to determine sub-table sizes when building the\n decoding tables.\n */\n\n /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n for (len = 0; len <= MAXBITS; len++) {\n count[len] = 0;\n }\n for (sym = 0; sym < codes; sym++) {\n count[lens[lens_index + sym]]++;\n }\n\n /* bound code lengths, force root to be within code lengths */\n root = bits;\n for (max = MAXBITS; max >= 1; max--) {\n if (count[max] !== 0) { break; }\n }\n if (root > max) {\n root = max;\n }\n if (max === 0) { /* no symbols to code at all */\n //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */\n //table.bits[opts.table_index] = 1; //here.bits = (var char)1;\n //table.val[opts.table_index++] = 0; //here.val = (var short)0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n //table.op[opts.table_index] = 64;\n //table.bits[opts.table_index] = 1;\n //table.val[opts.table_index++] = 0;\n table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n opts.bits = 1;\n return 0; /* no symbols, but wait for decoding to report error */\n }\n for (min = 1; min < max; min++) {\n if (count[min] !== 0) { break; }\n }\n if (root < min) {\n root = min;\n }\n\n /* check for an over-subscribed or incomplete set of lengths */\n left = 1;\n for (len = 1; len <= MAXBITS; len++) {\n left <<= 1;\n left -= count[len];\n if (left < 0) {\n return -1;\n } /* over-subscribed */\n }\n if (left > 0 && (type === CODES || max !== 1)) {\n return -1; /* incomplete set */\n }\n\n /* generate offsets into symbol table for each length for sorting */\n offs[1] = 0;\n for (len = 1; len < MAXBITS; len++) {\n offs[len + 1] = offs[len] + count[len];\n }\n\n /* sort symbols by length, by symbol order within each length */\n for (sym = 0; sym < codes; sym++) {\n if (lens[lens_index + sym] !== 0) {\n work[offs[lens[lens_index + sym]]++] = sym;\n }\n }\n\n /*\n Create and fill in decoding tables. In this loop, the table being\n filled is at next and has curr index bits. The code being used is huff\n with length len. That code is converted to an index by dropping drop\n bits off of the bottom. For codes where len is less than drop + curr,\n those top drop + curr - len bits are incremented through all values to\n fill the table with replicated entries.\n\n root is the number of index bits for the root table. When len exceeds\n root, sub-tables are created pointed to by the root entry with an index\n of the low root bits of huff. This is saved in low to check for when a\n new sub-table should be started. drop is zero when the root table is\n being filled, and drop is root when sub-tables are being filled.\n\n When a new sub-table is needed, it is necessary to look ahead in the\n code lengths to determine what size sub-table is needed. The length\n counts are used for this, and so count[] is decremented as codes are\n entered in the tables.\n\n used keeps track of how many table entries have been allocated from the\n provided *table space. It is checked for LENS and DIST tables against\n the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n the initial root table size constants. See the comments in inftrees.h\n for more information.\n\n sym increments through all symbols, and the loop terminates when\n all codes of length max, i.e. all codes, have been processed. This\n routine permits incomplete codes, so another loop after this one fills\n in the rest of the decoding tables with invalid code markers.\n */\n\n /* set up for code type */\n // poor man optimization - use if-else instead of switch,\n // to avoid deopts in old v8\n if (type === CODES) {\n base = extra = work; /* dummy value--not used */\n match = 20;\n\n } else if (type === LENS) {\n base = lbase;\n extra = lext;\n match = 257;\n\n } else { /* DISTS */\n base = dbase;\n extra = dext;\n match = 0;\n }\n\n /* initialize opts for loop */\n huff = 0; /* starting code */\n sym = 0; /* starting code symbol */\n len = min; /* starting code length */\n next = table_index; /* current table to fill in */\n curr = root; /* current table index bits */\n drop = 0; /* current bits to drop from code for index */\n low = -1; /* trigger new sub-table when len > root */\n used = 1 << root; /* use root table entries */\n mask = used - 1; /* mask for comparing low */\n\n /* check available table space */\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* process all codes and make table entries */\n for (;;) {\n /* create table entry */\n here_bits = len - drop;\n if (work[sym] + 1 < match) {\n here_op = 0;\n here_val = work[sym];\n }\n else if (work[sym] >= match) {\n here_op = extra[work[sym] - match];\n here_val = base[work[sym] - match];\n }\n else {\n here_op = 32 + 64; /* end of block */\n here_val = 0;\n }\n\n /* replicate for those indices with low len bits equal to huff */\n incr = 1 << (len - drop);\n fill = 1 << curr;\n min = fill; /* save offset to next table */\n do {\n fill -= incr;\n table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n } while (fill !== 0);\n\n /* backwards increment the len-bit code huff */\n incr = 1 << (len - 1);\n while (huff & incr) {\n incr >>= 1;\n }\n if (incr !== 0) {\n huff &= incr - 1;\n huff += incr;\n } else {\n huff = 0;\n }\n\n /* go to next symbol, update count, len */\n sym++;\n if (--count[len] === 0) {\n if (len === max) { break; }\n len = lens[lens_index + work[sym]];\n }\n\n /* create new sub-table if needed */\n if (len > root && (huff & mask) !== low) {\n /* if first time, transition to sub-tables */\n if (drop === 0) {\n drop = root;\n }\n\n /* increment past last table */\n next += min; /* here min is 1 << curr */\n\n /* determine length of next table */\n curr = len - drop;\n left = 1 << curr;\n while (curr + drop < max) {\n left -= count[curr + drop];\n if (left <= 0) { break; }\n curr++;\n left <<= 1;\n }\n\n /* check for enough space */\n used += 1 << curr;\n if ((type === LENS && used > ENOUGH_LENS) ||\n (type === DISTS && used > ENOUGH_DISTS)) {\n return 1;\n }\n\n /* point entry in root table to sub-table */\n low = huff & mask;\n /*table.op[low] = curr;\n table.bits[low] = root;\n table.val[low] = next - opts.table_index;*/\n table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n }\n }\n\n /* fill in remaining table entry if code is incomplete (guaranteed to have\n at most one remaining entry, since if the code is incomplete, the\n maximum code length that was allowed to get this far is one bit) */\n if (huff !== 0) {\n //table.op[next + huff] = 64; /* invalid code marker */\n //table.bits[next + huff] = len - drop;\n //table.val[next + huff] = 0;\n table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n }\n\n /* set return parameters */\n //opts.table_index += used;\n opts.bits = root;\n return 0;\n};\n\n\nmodule.exports = inflate_table;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = require('./adler32');\nconst crc32 = require('./crc32');\nconst inflate_fast = require('./inffast');\nconst inflate_table = require('./inftrees');\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_FINISH, Z_BLOCK, Z_TREES,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_BUF_ERROR,\n Z_DEFLATED\n} = require('./constants');\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst HEAD = 16180; /* i: waiting for magic header */\nconst FLAGS = 16181; /* i: waiting for method and flags (gzip) */\nconst TIME = 16182; /* i: waiting for modification time (gzip) */\nconst OS = 16183; /* i: waiting for extra flags and operating system (gzip) */\nconst EXLEN = 16184; /* i: waiting for extra length (gzip) */\nconst EXTRA = 16185; /* i: waiting for extra bytes (gzip) */\nconst NAME = 16186; /* i: waiting for end of file name (gzip) */\nconst COMMENT = 16187; /* i: waiting for end of comment (gzip) */\nconst HCRC = 16188; /* i: waiting for header crc (gzip) */\nconst DICTID = 16189; /* i: waiting for dictionary check value */\nconst DICT = 16190; /* waiting for inflateSetDictionary() call */\nconst TYPE = 16191; /* i: waiting for type bits, including last-flag bit */\nconst TYPEDO = 16192; /* i: same, but skip check to exit inflate on new block */\nconst STORED = 16193; /* i: waiting for stored size (length and complement) */\nconst COPY_ = 16194; /* i/o: same as COPY below, but only first time in */\nconst COPY = 16195; /* i/o: waiting for input or output to copy stored block */\nconst TABLE = 16196; /* i: waiting for dynamic block table lengths */\nconst LENLENS = 16197; /* i: waiting for code length code lengths */\nconst CODELENS = 16198; /* i: waiting for length/lit and distance code lengths */\nconst LEN_ = 16199; /* i: same as LEN below, but only first time in */\nconst LEN = 16200; /* i: waiting for length/lit/eob code */\nconst LENEXT = 16201; /* i: waiting for length extra bits */\nconst DIST = 16202; /* i: waiting for distance code */\nconst DISTEXT = 16203; /* i: waiting for distance extra bits */\nconst MATCH = 16204; /* o: waiting for output space to copy string */\nconst LIT = 16205; /* o: waiting for output space to write literal */\nconst CHECK = 16206; /* i: waiting for 32-bit check value */\nconst LENGTH = 16207; /* i: waiting for 32-bit length (gzip) */\nconst DONE = 16208; /* finished check, done -- remain here until reset */\nconst BAD = 16209; /* got a data error -- remain here until reset */\nconst MEM = 16210; /* got an inflate() memory error -- remain here until reset */\nconst SYNC = 16211; /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_WBITS = MAX_WBITS;\n\n\nconst zswap32 = (q) => {\n\n return (((q >>> 24) & 0xff) +\n ((q >>> 8) & 0xff00) +\n ((q & 0xff00) << 8) +\n ((q & 0xff) << 24));\n};\n\n\nfunction InflateState() {\n this.strm = null; /* pointer back to this zlib stream */\n this.mode = 0; /* current inflate mode */\n this.last = false; /* true if processing last block */\n this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip,\n bit 2 true to validate check value */\n this.havedict = false; /* true if dictionary provided */\n this.flags = 0; /* gzip header method and flags (0 if zlib), or\n -1 if raw or no header yet */\n this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */\n this.check = 0; /* protected copy of check value */\n this.total = 0; /* protected copy of output count */\n // TODO: may be {}\n this.head = null; /* where to save gzip header information */\n\n /* sliding window */\n this.wbits = 0; /* log base 2 of requested window size */\n this.wsize = 0; /* window size or zero if not using window */\n this.whave = 0; /* valid bytes in the window */\n this.wnext = 0; /* window write index */\n this.window = null; /* allocated sliding window, if needed */\n\n /* bit accumulator */\n this.hold = 0; /* input bit accumulator */\n this.bits = 0; /* number of bits in \"in\" */\n\n /* for string and stored block copying */\n this.length = 0; /* literal or length of data to copy */\n this.offset = 0; /* distance back to copy string from */\n\n /* for table and code decoding */\n this.extra = 0; /* extra bits needed */\n\n /* fixed and dynamic code tables */\n this.lencode = null; /* starting table for length/literal codes */\n this.distcode = null; /* starting table for distance codes */\n this.lenbits = 0; /* index bits for lencode */\n this.distbits = 0; /* index bits for distcode */\n\n /* dynamic table building */\n this.ncode = 0; /* number of code length code lengths */\n this.nlen = 0; /* number of length code lengths */\n this.ndist = 0; /* number of distance code lengths */\n this.have = 0; /* number of code lengths in lens[] */\n this.next = null; /* next available space in codes[] */\n\n this.lens = new Uint16Array(320); /* temporary storage for code lengths */\n this.work = new Uint16Array(288); /* work area for code table building */\n\n /*\n because we don't have pointers in js, we use lencode and distcode directly\n as buffers so we don't need codes\n */\n //this.codes = new Int32Array(ENOUGH); /* space for code tables */\n this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */\n this.distdyn = null; /* dynamic table for distance codes (JS specific) */\n this.sane = 0; /* if false, allow invalid distance too far */\n this.back = 0; /* bits back of last unprocessed length/lit */\n this.was = 0; /* initial length of match */\n}\n\n\nconst inflateStateCheck = (strm) => {\n\n if (!strm) {\n return 1;\n }\n const state = strm.state;\n if (!state || state.strm !== strm ||\n state.mode < HEAD || state.mode > SYNC) {\n return 1;\n }\n return 0;\n};\n\n\nconst inflateResetKeep = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n strm.total_in = strm.total_out = state.total = 0;\n strm.msg = ''; /*Z_NULL*/\n if (state.wrap) { /* to support ill-conceived Java test suite */\n strm.adler = state.wrap & 1;\n }\n state.mode = HEAD;\n state.last = 0;\n state.havedict = 0;\n state.flags = -1;\n state.dmax = 32768;\n state.head = null/*Z_NULL*/;\n state.hold = 0;\n state.bits = 0;\n //state.lencode = state.distcode = state.next = state.codes;\n state.lencode = state.lendyn = new Int32Array(ENOUGH_LENS);\n state.distcode = state.distdyn = new Int32Array(ENOUGH_DISTS);\n\n state.sane = 1;\n state.back = -1;\n //Tracev((stderr, \"inflate: reset\\n\"));\n return Z_OK;\n};\n\n\nconst inflateReset = (strm) => {\n\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n state.wsize = 0;\n state.whave = 0;\n state.wnext = 0;\n return inflateResetKeep(strm);\n\n};\n\n\nconst inflateReset2 = (strm, windowBits) => {\n let wrap;\n\n /* get the state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n\n /* extract wrap request from windowBits parameter */\n if (windowBits < 0) {\n wrap = 0;\n windowBits = -windowBits;\n }\n else {\n wrap = (windowBits >> 4) + 5;\n if (windowBits < 48) {\n windowBits &= 15;\n }\n }\n\n /* set number of window bits, free window if different */\n if (windowBits && (windowBits < 8 || windowBits > 15)) {\n return Z_STREAM_ERROR;\n }\n if (state.window !== null && state.wbits !== windowBits) {\n state.window = null;\n }\n\n /* update state and reset the rest of it */\n state.wrap = wrap;\n state.wbits = windowBits;\n return inflateReset(strm);\n};\n\n\nconst inflateInit2 = (strm, windowBits) => {\n\n if (!strm) { return Z_STREAM_ERROR; }\n //strm.msg = Z_NULL; /* in case we return an error */\n\n const state = new InflateState();\n\n //if (state === Z_NULL) return Z_MEM_ERROR;\n //Tracev((stderr, \"inflate: allocated\\n\"));\n strm.state = state;\n state.strm = strm;\n state.window = null/*Z_NULL*/;\n state.mode = HEAD; /* to pass state test in inflateReset2() */\n const ret = inflateReset2(strm, windowBits);\n if (ret !== Z_OK) {\n strm.state = null/*Z_NULL*/;\n }\n return ret;\n};\n\n\nconst inflateInit = (strm) => {\n\n return inflateInit2(strm, DEF_WBITS);\n};\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding. Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter. This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time. However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nlet virgin = true;\n\nlet lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\n\nconst fixedtables = (state) => {\n\n /* build fixed huffman tables if first call (may not be thread safe) */\n if (virgin) {\n lenfix = new Int32Array(512);\n distfix = new Int32Array(32);\n\n /* literal/length table */\n let sym = 0;\n while (sym < 144) { state.lens[sym++] = 8; }\n while (sym < 256) { state.lens[sym++] = 9; }\n while (sym < 280) { state.lens[sym++] = 7; }\n while (sym < 288) { state.lens[sym++] = 8; }\n\n inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });\n\n /* distance table */\n sym = 0;\n while (sym < 32) { state.lens[sym++] = 5; }\n\n inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });\n\n /* do this just once */\n virgin = false;\n }\n\n state.lencode = lenfix;\n state.lenbits = 9;\n state.distcode = distfix;\n state.distbits = 5;\n};\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning. If window does not exist yet, create it. This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nconst updatewindow = (strm, src, end, copy) => {\n\n let dist;\n const state = strm.state;\n\n /* if it hasn't been done already, allocate space for the window */\n if (state.window === null) {\n state.wsize = 1 << state.wbits;\n state.wnext = 0;\n state.whave = 0;\n\n state.window = new Uint8Array(state.wsize);\n }\n\n /* copy state->wsize or less output bytes into the circular window */\n if (copy >= state.wsize) {\n state.window.set(src.subarray(end - state.wsize, end), 0);\n state.wnext = 0;\n state.whave = state.wsize;\n }\n else {\n dist = state.wsize - state.wnext;\n if (dist > copy) {\n dist = copy;\n }\n //zmemcpy(state->window + state->wnext, end - copy, dist);\n state.window.set(src.subarray(end - copy, end - copy + dist), state.wnext);\n copy -= dist;\n if (copy) {\n //zmemcpy(state->window, end - copy, copy);\n state.window.set(src.subarray(end - copy, end), 0);\n state.wnext = copy;\n state.whave = state.wsize;\n }\n else {\n state.wnext += dist;\n if (state.wnext === state.wsize) { state.wnext = 0; }\n if (state.whave < state.wsize) { state.whave += dist; }\n }\n }\n return 0;\n};\n\n\nconst inflate = (strm, flush) => {\n\n let state;\n let input, output; // input/output buffers\n let next; /* next input INDEX */\n let put; /* next output INDEX */\n let have, left; /* available input and output */\n let hold; /* bit buffer */\n let bits; /* bits in bit buffer */\n let _in, _out; /* save starting available input and output */\n let copy; /* number of stored or match bytes to copy */\n let from; /* where to copy match bytes from */\n let from_source;\n let here = 0; /* current decoding table entry */\n let here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n //let last; /* parent table entry */\n let last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n let len; /* length to copy for repeats, bits to drop */\n let ret; /* return code */\n const hbuf = new Uint8Array(4); /* buffer for gzip header crc calculation */\n let opts;\n\n let n; // temporary variable for NEED_BITS\n\n const order = /* permutation of code lengths */\n new Uint8Array([ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ]);\n\n\n if (inflateStateCheck(strm) || !strm.output ||\n (!strm.input && strm.avail_in !== 0)) {\n return Z_STREAM_ERROR;\n }\n\n state = strm.state;\n if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */\n\n\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n _in = have;\n _out = left;\n ret = Z_OK;\n\n inf_leave: // goto emulation\n for (;;) {\n switch (state.mode) {\n case HEAD:\n if (state.wrap === 0) {\n state.mode = TYPEDO;\n break;\n }\n //=== NEEDBITS(16);\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */\n if (state.wbits === 0) {\n state.wbits = 15;\n }\n state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = FLAGS;\n break;\n }\n if (state.head) {\n state.head.done = false;\n }\n if (!(state.wrap & 1) || /* check if zlib header allowed */\n (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n strm.msg = 'incorrect header check';\n state.mode = BAD;\n break;\n }\n if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n len = (hold & 0x0f)/*BITS(4)*/ + 8;\n if (state.wbits === 0) {\n state.wbits = len;\n }\n if (len > 15 || len > state.wbits) {\n strm.msg = 'invalid window size';\n state.mode = BAD;\n break;\n }\n\n // !!! pako patch. Force use `options.windowBits` if passed.\n // Required to always use max window size by default.\n state.dmax = 1 << state.wbits;\n //state.dmax = 1 << len;\n\n state.flags = 0; /* indicate zlib header */\n //Tracev((stderr, \"inflate: zlib header ok\\n\"));\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = hold & 0x200 ? DICTID : TYPE;\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n break;\n case FLAGS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.flags = hold;\n if ((state.flags & 0xff) !== Z_DEFLATED) {\n strm.msg = 'unknown compression method';\n state.mode = BAD;\n break;\n }\n if (state.flags & 0xe000) {\n strm.msg = 'unknown header flags set';\n state.mode = BAD;\n break;\n }\n if (state.head) {\n state.head.text = ((hold >> 8) & 1);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = TIME;\n /* falls through */\n case TIME:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.time = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC4(state.check, hold)\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n hbuf[2] = (hold >>> 16) & 0xff;\n hbuf[3] = (hold >>> 24) & 0xff;\n state.check = crc32(state.check, hbuf, 4, 0);\n //===\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = OS;\n /* falls through */\n case OS:\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if (state.head) {\n state.head.xflags = (hold & 0xff);\n state.head.os = (hold >> 8);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = EXLEN;\n /* falls through */\n case EXLEN:\n if (state.flags & 0x0400) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length = hold;\n if (state.head) {\n state.head.extra_len = hold;\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n //=== CRC2(state.check, hold);\n hbuf[0] = hold & 0xff;\n hbuf[1] = (hold >>> 8) & 0xff;\n state.check = crc32(state.check, hbuf, 2, 0);\n //===//\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n else if (state.head) {\n state.head.extra = null/*Z_NULL*/;\n }\n state.mode = EXTRA;\n /* falls through */\n case EXTRA:\n if (state.flags & 0x0400) {\n copy = state.length;\n if (copy > have) { copy = have; }\n if (copy) {\n if (state.head) {\n len = state.head.extra_len - state.length;\n if (!state.head.extra) {\n // Use untyped array for more convenient processing later\n state.head.extra = new Uint8Array(state.head.extra_len);\n }\n state.head.extra.set(\n input.subarray(\n next,\n // extra field is limited to 65536 bytes\n // - no need for additional size check\n next + copy\n ),\n /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n len\n );\n //zmemcpy(state.head.extra + len, next,\n // len + copy > state.head.extra_max ?\n // state.head.extra_max - len : copy);\n }\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n state.length -= copy;\n }\n if (state.length) { break inf_leave; }\n }\n state.length = 0;\n state.mode = NAME;\n /* falls through */\n case NAME:\n if (state.flags & 0x0800) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n // TODO: 2 or 1 bytes?\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.name_max*/)) {\n state.head.name += String.fromCharCode(len);\n }\n } while (len && copy < have);\n\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.name = null;\n }\n state.length = 0;\n state.mode = COMMENT;\n /* falls through */\n case COMMENT:\n if (state.flags & 0x1000) {\n if (have === 0) { break inf_leave; }\n copy = 0;\n do {\n len = input[next + copy++];\n /* use constant limit because in js we should not preallocate memory */\n if (state.head && len &&\n (state.length < 65536 /*state.head.comm_max*/)) {\n state.head.comment += String.fromCharCode(len);\n }\n } while (len && copy < have);\n if ((state.flags & 0x0200) && (state.wrap & 4)) {\n state.check = crc32(state.check, input, copy, next);\n }\n have -= copy;\n next += copy;\n if (len) { break inf_leave; }\n }\n else if (state.head) {\n state.head.comment = null;\n }\n state.mode = HCRC;\n /* falls through */\n case HCRC:\n if (state.flags & 0x0200) {\n //=== NEEDBITS(16); */\n while (bits < 16) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.check & 0xffff)) {\n strm.msg = 'header crc mismatch';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n }\n if (state.head) {\n state.head.hcrc = ((state.flags >> 9) & 1);\n state.head.done = true;\n }\n strm.adler = state.check = 0;\n state.mode = TYPE;\n break;\n case DICTID:\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n strm.adler = state.check = zswap32(hold);\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = DICT;\n /* falls through */\n case DICT:\n if (state.havedict === 0) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n return Z_NEED_DICT;\n }\n strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n state.mode = TYPE;\n /* falls through */\n case TYPE:\n if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case TYPEDO:\n if (state.last) {\n //--- BYTEBITS() ---//\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n state.mode = CHECK;\n break;\n }\n //=== NEEDBITS(3); */\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.last = (hold & 0x01)/*BITS(1)*/;\n //--- DROPBITS(1) ---//\n hold >>>= 1;\n bits -= 1;\n //---//\n\n switch ((hold & 0x03)/*BITS(2)*/) {\n case 0: /* stored block */\n //Tracev((stderr, \"inflate: stored block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = STORED;\n break;\n case 1: /* fixed block */\n fixedtables(state);\n //Tracev((stderr, \"inflate: fixed codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = LEN_; /* decode codes */\n if (flush === Z_TREES) {\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break inf_leave;\n }\n break;\n case 2: /* dynamic block */\n //Tracev((stderr, \"inflate: dynamic codes block%s\\n\",\n // state.last ? \" (last)\" : \"\"));\n state.mode = TABLE;\n break;\n case 3:\n strm.msg = 'invalid block type';\n state.mode = BAD;\n }\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n break;\n case STORED:\n //--- BYTEBITS() ---// /* go to byte boundary */\n hold >>>= bits & 7;\n bits -= bits & 7;\n //---//\n //=== NEEDBITS(32); */\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n strm.msg = 'invalid stored block lengths';\n state.mode = BAD;\n break;\n }\n state.length = hold & 0xffff;\n //Tracev((stderr, \"inflate: stored length %u\\n\",\n // state.length));\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n state.mode = COPY_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case COPY_:\n state.mode = COPY;\n /* falls through */\n case COPY:\n copy = state.length;\n if (copy) {\n if (copy > have) { copy = have; }\n if (copy > left) { copy = left; }\n if (copy === 0) { break inf_leave; }\n //--- zmemcpy(put, next, copy); ---\n output.set(input.subarray(next, next + copy), put);\n //---//\n have -= copy;\n next += copy;\n left -= copy;\n put += copy;\n state.length -= copy;\n break;\n }\n //Tracev((stderr, \"inflate: stored end\\n\"));\n state.mode = TYPE;\n break;\n case TABLE:\n //=== NEEDBITS(14); */\n while (bits < 14) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n //--- DROPBITS(5) ---//\n hold >>>= 5;\n bits -= 5;\n //---//\n state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n //--- DROPBITS(4) ---//\n hold >>>= 4;\n bits -= 4;\n //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n if (state.nlen > 286 || state.ndist > 30) {\n strm.msg = 'too many length or distance symbols';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracev((stderr, \"inflate: table sizes ok\\n\"));\n state.have = 0;\n state.mode = LENLENS;\n /* falls through */\n case LENLENS:\n while (state.have < state.ncode) {\n //=== NEEDBITS(3);\n while (bits < 3) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n while (state.have < 19) {\n state.lens[order[state.have++]] = 0;\n }\n // We have separate tables & no pointers. 2 commented lines below not needed.\n //state.next = state.codes;\n //state.lencode = state.next;\n // Switch to use dynamic table\n state.lencode = state.lendyn;\n state.lenbits = 7;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n state.lenbits = opts.bits;\n\n if (ret) {\n strm.msg = 'invalid code lengths set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, \"inflate: code lengths ok\\n\"));\n state.have = 0;\n state.mode = CODELENS;\n /* falls through */\n case CODELENS:\n while (state.have < state.nlen + state.ndist) {\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_val < 16) {\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.lens[state.have++] = here_val;\n }\n else {\n if (here_val === 16) {\n //=== NEEDBITS(here.bits + 2);\n n = here_bits + 2;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n if (state.have === 0) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n len = state.lens[state.have - 1];\n copy = 3 + (hold & 0x03);//BITS(2);\n //--- DROPBITS(2) ---//\n hold >>>= 2;\n bits -= 2;\n //---//\n }\n else if (here_val === 17) {\n //=== NEEDBITS(here.bits + 3);\n n = here_bits + 3;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 3 + (hold & 0x07);//BITS(3);\n //--- DROPBITS(3) ---//\n hold >>>= 3;\n bits -= 3;\n //---//\n }\n else {\n //=== NEEDBITS(here.bits + 7);\n n = here_bits + 7;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n len = 0;\n copy = 11 + (hold & 0x7f);//BITS(7);\n //--- DROPBITS(7) ---//\n hold >>>= 7;\n bits -= 7;\n //---//\n }\n if (state.have + copy > state.nlen + state.ndist) {\n strm.msg = 'invalid bit length repeat';\n state.mode = BAD;\n break;\n }\n while (copy--) {\n state.lens[state.have++] = len;\n }\n }\n }\n\n /* handle error breaks in while */\n if (state.mode === BAD) { break; }\n\n /* check for end-of-block code (better have one) */\n if (state.lens[256] === 0) {\n strm.msg = 'invalid code -- missing end-of-block';\n state.mode = BAD;\n break;\n }\n\n /* build code tables -- note: do not change the lenbits or distbits\n values here (9 and 6) without reading the comments in inftrees.h\n concerning the ENOUGH constants, which depend on those values */\n state.lenbits = 9;\n\n opts = { bits: state.lenbits };\n ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.lenbits = opts.bits;\n // state.lencode = state.next;\n\n if (ret) {\n strm.msg = 'invalid literal/lengths set';\n state.mode = BAD;\n break;\n }\n\n state.distbits = 6;\n //state.distcode.copy(state.codes);\n // Switch to use dynamic table\n state.distcode = state.distdyn;\n opts = { bits: state.distbits };\n ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n // We have separate tables & no pointers. 2 commented lines below not needed.\n // state.next_index = opts.table_index;\n state.distbits = opts.bits;\n // state.distcode = state.next;\n\n if (ret) {\n strm.msg = 'invalid distances set';\n state.mode = BAD;\n break;\n }\n //Tracev((stderr, 'inflate: codes ok\\n'));\n state.mode = LEN_;\n if (flush === Z_TREES) { break inf_leave; }\n /* falls through */\n case LEN_:\n state.mode = LEN;\n /* falls through */\n case LEN:\n if (have >= 6 && left >= 258) {\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n inflate_fast(strm, _out);\n //--- LOAD() ---\n put = strm.next_out;\n output = strm.output;\n left = strm.avail_out;\n next = strm.next_in;\n input = strm.input;\n have = strm.avail_in;\n hold = state.hold;\n bits = state.bits;\n //---\n\n if (state.mode === TYPE) {\n state.back = -1;\n }\n break;\n }\n state.back = 0;\n for (;;) {\n here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if (here_bits <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if (here_op && (here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.lencode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n state.length = here_val;\n if (here_op === 0) {\n //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n // \"inflate: literal '%c'\\n\" :\n // \"inflate: literal 0x%02x\\n\", here.val));\n state.mode = LIT;\n break;\n }\n if (here_op & 32) {\n //Tracevv((stderr, \"inflate: end of block\\n\"));\n state.back = -1;\n state.mode = TYPE;\n break;\n }\n if (here_op & 64) {\n strm.msg = 'invalid literal/length code';\n state.mode = BAD;\n break;\n }\n state.extra = here_op & 15;\n state.mode = LENEXT;\n /* falls through */\n case LENEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n //Tracevv((stderr, \"inflate: length %u\\n\", state.length));\n state.was = state.length;\n state.mode = DIST;\n /* falls through */\n case DIST:\n for (;;) {\n here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n if ((here_op & 0xf0) === 0) {\n last_bits = here_bits;\n last_op = here_op;\n last_val = here_val;\n for (;;) {\n here = state.distcode[last_val +\n ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n here_bits = here >>> 24;\n here_op = (here >>> 16) & 0xff;\n here_val = here & 0xffff;\n\n if ((last_bits + here_bits) <= bits) { break; }\n //--- PULLBYTE() ---//\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n //---//\n }\n //--- DROPBITS(last.bits) ---//\n hold >>>= last_bits;\n bits -= last_bits;\n //---//\n state.back += last_bits;\n }\n //--- DROPBITS(here.bits) ---//\n hold >>>= here_bits;\n bits -= here_bits;\n //---//\n state.back += here_bits;\n if (here_op & 64) {\n strm.msg = 'invalid distance code';\n state.mode = BAD;\n break;\n }\n state.offset = here_val;\n state.extra = (here_op) & 15;\n state.mode = DISTEXT;\n /* falls through */\n case DISTEXT:\n if (state.extra) {\n //=== NEEDBITS(state.extra);\n n = state.extra;\n while (bits < n) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n //--- DROPBITS(state.extra) ---//\n hold >>>= state.extra;\n bits -= state.extra;\n //---//\n state.back += state.extra;\n }\n//#ifdef INFLATE_STRICT\n if (state.offset > state.dmax) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n//#endif\n //Tracevv((stderr, \"inflate: distance %u\\n\", state.offset));\n state.mode = MATCH;\n /* falls through */\n case MATCH:\n if (left === 0) { break inf_leave; }\n copy = _out - left;\n if (state.offset > copy) { /* copy from window */\n copy = state.offset - copy;\n if (copy > state.whave) {\n if (state.sane) {\n strm.msg = 'invalid distance too far back';\n state.mode = BAD;\n break;\n }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n// Trace((stderr, \"inflate.c too far\\n\"));\n// copy -= state.whave;\n// if (copy > state.length) { copy = state.length; }\n// if (copy > left) { copy = left; }\n// left -= copy;\n// state.length -= copy;\n// do {\n// output[put++] = 0;\n// } while (--copy);\n// if (state.length === 0) { state.mode = LEN; }\n// break;\n//#endif\n }\n if (copy > state.wnext) {\n copy -= state.wnext;\n from = state.wsize - copy;\n }\n else {\n from = state.wnext - copy;\n }\n if (copy > state.length) { copy = state.length; }\n from_source = state.window;\n }\n else { /* copy from output */\n from_source = output;\n from = put - state.offset;\n copy = state.length;\n }\n if (copy > left) { copy = left; }\n left -= copy;\n state.length -= copy;\n do {\n output[put++] = from_source[from++];\n } while (--copy);\n if (state.length === 0) { state.mode = LEN; }\n break;\n case LIT:\n if (left === 0) { break inf_leave; }\n output[put++] = state.length;\n left--;\n state.mode = LEN;\n break;\n case CHECK:\n if (state.wrap) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n // Use '|' instead of '+' to make sure that result is signed\n hold |= input[next++] << bits;\n bits += 8;\n }\n //===//\n _out -= left;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check =\n /*UPDATE_CHECK(state.check, put - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n }\n _out = left;\n // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n if ((state.wrap & 4) && (state.flags ? hold : zswap32(hold)) !== state.check) {\n strm.msg = 'incorrect data check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: check matches trailer\\n\"));\n }\n state.mode = LENGTH;\n /* falls through */\n case LENGTH:\n if (state.wrap && state.flags) {\n //=== NEEDBITS(32);\n while (bits < 32) {\n if (have === 0) { break inf_leave; }\n have--;\n hold += input[next++] << bits;\n bits += 8;\n }\n //===//\n if ((state.wrap & 4) && hold !== (state.total & 0xffffffff)) {\n strm.msg = 'incorrect length check';\n state.mode = BAD;\n break;\n }\n //=== INITBITS();\n hold = 0;\n bits = 0;\n //===//\n //Tracev((stderr, \"inflate: length matches trailer\\n\"));\n }\n state.mode = DONE;\n /* falls through */\n case DONE:\n ret = Z_STREAM_END;\n break inf_leave;\n case BAD:\n ret = Z_DATA_ERROR;\n break inf_leave;\n case MEM:\n return Z_MEM_ERROR;\n case SYNC:\n /* falls through */\n default:\n return Z_STREAM_ERROR;\n }\n }\n\n // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n /*\n Return from inflate(), updating the total counts and the check value.\n If there was no progress during the inflate() call, return a buffer\n error. Call updatewindow() to create and/or update the window state.\n Note: a memory error from inflate() is non-recoverable.\n */\n\n //--- RESTORE() ---\n strm.next_out = put;\n strm.avail_out = left;\n strm.next_in = next;\n strm.avail_in = have;\n state.hold = hold;\n state.bits = bits;\n //---\n\n if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n (state.mode < CHECK || flush !== Z_FINISH))) {\n if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n }\n _in -= strm.avail_in;\n _out -= strm.avail_out;\n strm.total_in += _in;\n strm.total_out += _out;\n state.total += _out;\n if ((state.wrap & 4) && _out) {\n strm.adler = state.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/\n (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n }\n strm.data_type = state.bits + (state.last ? 64 : 0) +\n (state.mode === TYPE ? 128 : 0) +\n (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n ret = Z_BUF_ERROR;\n }\n return ret;\n};\n\n\nconst inflateEnd = (strm) => {\n\n if (inflateStateCheck(strm)) {\n return Z_STREAM_ERROR;\n }\n\n let state = strm.state;\n if (state.window) {\n state.window = null;\n }\n strm.state = null;\n return Z_OK;\n};\n\n\nconst inflateGetHeader = (strm, head) => {\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n const state = strm.state;\n if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n /* save header structure */\n state.head = head;\n head.done = false;\n return Z_OK;\n};\n\n\nconst inflateSetDictionary = (strm, dictionary) => {\n const dictLength = dictionary.length;\n\n let state;\n let dictid;\n let ret;\n\n /* check state */\n if (inflateStateCheck(strm)) { return Z_STREAM_ERROR; }\n state = strm.state;\n\n if (state.wrap !== 0 && state.mode !== DICT) {\n return Z_STREAM_ERROR;\n }\n\n /* check for correct dictionary identifier */\n if (state.mode === DICT) {\n dictid = 1; /* adler32(0, null, 0)*/\n /* dictid = adler32(dictid, dictionary, dictLength); */\n dictid = adler32(dictid, dictionary, dictLength, 0);\n if (dictid !== state.check) {\n return Z_DATA_ERROR;\n }\n }\n /* copy dictionary to window using updatewindow(), which will amend the\n existing dictionary if appropriate */\n ret = updatewindow(strm, dictionary, dictLength, dictLength);\n if (ret) {\n state.mode = MEM;\n return Z_MEM_ERROR;\n }\n state.havedict = 1;\n // Tracev((stderr, \"inflate: dictionary set\\n\"));\n return Z_OK;\n};\n\n\nmodule.exports.inflateReset = inflateReset;\nmodule.exports.inflateReset2 = inflateReset2;\nmodule.exports.inflateResetKeep = inflateResetKeep;\nmodule.exports.inflateInit = inflateInit;\nmodule.exports.inflateInit2 = inflateInit2;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateEnd = inflateEnd;\nmodule.exports.inflateGetHeader = inflateGetHeader;\nmodule.exports.inflateSetDictionary = inflateSetDictionary;\nmodule.exports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nmodule.exports.inflateCodesUsed = inflateCodesUsed;\nmodule.exports.inflateCopy = inflateCopy;\nmodule.exports.inflateGetDictionary = inflateGetDictionary;\nmodule.exports.inflateMark = inflateMark;\nmodule.exports.inflatePrime = inflatePrime;\nmodule.exports.inflateSync = inflateSync;\nmodule.exports.inflateSyncPoint = inflateSyncPoint;\nmodule.exports.inflateUndermine = inflateUndermine;\nmodule.exports.inflateValidate = inflateValidate;\n*/\n","'use strict';\n\n\nconst _has = (obj, key) => {\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n\nmodule.exports.assign = function (obj /*from1, from2, from3, ...*/) {\n const sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n const source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (const p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// Join array of chunks to single array.\nmodule.exports.flattenChunks = (chunks) => {\n // calculate data length\n let len = 0;\n\n for (let i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n\n for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {\n let chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n};\n","// String encode/decode helpers\n'use strict';\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new Uint8Array(256);\nfor (let q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nmodule.exports.string2buf = (str) => {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n\n let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new Uint8Array(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper\nconst buf2binstring = (buf, len) => {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK) {\n return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));\n }\n }\n\n let result = '';\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n};\n\n\n// convert array to string\nmodule.exports.buf2string = (buf, max) => {\n const len = max || buf.length;\n\n if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {\n return new TextDecoder().decode(buf.subarray(0, max));\n }\n\n let i, out;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n const utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n let c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n let c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // terminated by end of string?\n if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n if (c < 0x10000) {\n utf16buf[out++] = c;\n } else {\n c -= 0x10000;\n utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n }\n }\n\n return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max - length limit (mandatory);\nmodule.exports.utf8border = (buf, max) => {\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n let pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Very small and broken sequence,\n // return max, because we should return something anyway.\n if (pos < 0) { return max; }\n\n // If we came to start of buffer - that means buffer is too small,\n // return max too.\n if (pos === 0) { return max; }\n\n return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n","'use strict';\n\n\nconst zlib_inflate = require('./zlib/inflate');\nconst utils = require('./utils/common');\nconst strings = require('./utils/strings');\nconst msg = require('./zlib/messages');\nconst ZStream = require('./zlib/zstream');\nconst GZheader = require('./zlib/gzheader');\n\nconst toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR\n} = require('./zlib/constants');\n\n/* ===========================================================================*/\n\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n this.options = utils.assign({\n chunkSize: 1024 * 64,\n windowBits: 15,\n to: ''\n }, options || {});\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has no info about windows size, we can do autodetect only\n // for deflate. So, if window size not set, force it to max when gzip possible\n if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n // bit 3 (16) -> gzipped data\n // bit 4 (32) -> autodetect gzip/deflate\n if ((opt.windowBits & 15) === 0) {\n opt.windowBits |= 15;\n }\n }\n\n this.err = 0; // error code, if happens (0 = Z_OK)\n this.msg = ''; // error message\n this.ended = false; // used to avoid multiple onEnd() calls\n this.chunks = []; // chunks of compressed data\n\n this.strm = new ZStream();\n this.strm.avail_out = 0;\n\n let status = zlib_inflate.inflateInit2(\n this.strm,\n opt.windowBits\n );\n\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n\n this.header = new GZheader();\n\n zlib_inflate.inflateGetHeader(this.strm, this.header);\n\n // Setup dictionary\n if (opt.dictionary) {\n // Convert data if needed\n if (typeof opt.dictionary === 'string') {\n opt.dictionary = strings.string2buf(opt.dictionary);\n } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n opt.dictionary = new Uint8Array(opt.dictionary);\n }\n if (opt.raw) { //In raw mode we need to set the dictionary early\n status = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary);\n if (status !== Z_OK) {\n throw new Error(msg[status]);\n }\n }\n }\n}\n\n/**\n * Inflate#push(data[, flush_mode]) -> Boolean\n * - data (Uint8Array|ArrayBuffer): input data\n * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE\n * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,\n * `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. If end of stream detected,\n * [[Inflate#onEnd]] will be called.\n *\n * `flush_mode` is not needed for normal operation, because end of stream\n * detected automatically. You may try to use it for advanced things, but\n * this functionality was not tested.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true); // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, flush_mode) {\n const strm = this.strm;\n const chunkSize = this.options.chunkSize;\n const dictionary = this.options.dictionary;\n let status, _flush_mode, last_avail_out;\n\n if (this.ended) return false;\n\n if (flush_mode === ~~flush_mode) _flush_mode = flush_mode;\n else _flush_mode = flush_mode === true ? Z_FINISH : Z_NO_FLUSH;\n\n // Convert data if needed\n if (toString.call(data) === '[object ArrayBuffer]') {\n strm.input = new Uint8Array(data);\n } else {\n strm.input = data;\n }\n\n strm.next_in = 0;\n strm.avail_in = strm.input.length;\n\n for (;;) {\n if (strm.avail_out === 0) {\n strm.output = new Uint8Array(chunkSize);\n strm.next_out = 0;\n strm.avail_out = chunkSize;\n }\n\n status = zlib_inflate.inflate(strm, _flush_mode);\n\n if (status === Z_NEED_DICT && dictionary) {\n status = zlib_inflate.inflateSetDictionary(strm, dictionary);\n\n if (status === Z_OK) {\n status = zlib_inflate.inflate(strm, _flush_mode);\n } else if (status === Z_DATA_ERROR) {\n // Replace code with more verbose\n status = Z_NEED_DICT;\n }\n }\n\n // Skip snyc markers if more data follows and not raw mode\n while (strm.avail_in > 0 &&\n status === Z_STREAM_END &&\n strm.state.wrap > 0 &&\n data[strm.next_in] !== 0)\n {\n zlib_inflate.inflateReset(strm);\n status = zlib_inflate.inflate(strm, _flush_mode);\n }\n\n switch (status) {\n case Z_STREAM_ERROR:\n case Z_DATA_ERROR:\n case Z_NEED_DICT:\n case Z_MEM_ERROR:\n this.onEnd(status);\n this.ended = true;\n return false;\n }\n\n // Remember real `avail_out` value, because we may patch out buffer content\n // to align utf8 strings boundaries.\n last_avail_out = strm.avail_out;\n\n if (strm.next_out) {\n if (strm.avail_out === 0 || status === Z_STREAM_END) {\n\n if (this.options.to === 'string') {\n\n let next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n let tail = strm.next_out - next_out_utf8;\n let utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n // move tail & realign counters\n strm.next_out = tail;\n strm.avail_out = chunkSize - tail;\n if (tail) strm.output.set(strm.output.subarray(next_out_utf8, next_out_utf8 + tail), 0);\n\n this.onData(utf8str);\n\n } else {\n this.onData(strm.output.length === strm.next_out ? strm.output : strm.output.subarray(0, strm.next_out));\n }\n }\n }\n\n // Must repeat iteration if out buffer is full\n if (status === Z_OK && last_avail_out === 0) continue;\n\n // Finalize if end of stream reached.\n if (status === Z_STREAM_END) {\n status = zlib_inflate.inflateEnd(this.strm);\n this.onEnd(status);\n this.ended = true;\n return true;\n }\n\n if (strm.avail_in === 0) break;\n }\n\n return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|String): output data. When string output requested,\n * each chunk will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n * other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH). By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n // On success - join\n if (status === Z_OK) {\n if (this.options.to === 'string') {\n this.result = this.chunks.join('');\n } else {\n this.result = utils.flattenChunks(this.chunks);\n }\n }\n this.chunks = [];\n this.err = status;\n this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n * negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako');\n * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));\n * let output;\n *\n * try {\n * output = pako.inflate(input);\n * } catch (err) {\n * console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n const inflator = new Inflate(options);\n\n inflator.push(input);\n\n // That will never happens, if you don't cheat with options :)\n if (inflator.err) throw inflator.msg || msg[inflator.err];\n\n return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n options = options || {};\n options.raw = true;\n return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|String\n * - data (Uint8Array|ArrayBuffer): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nmodule.exports.Inflate = Inflate;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateRaw = inflateRaw;\nmodule.exports.ungzip = inflate;\nmodule.exports.constants = require('./zlib/constants');\n","import decodeGoogleEarthEnterpriseData from \"../Core/decodeGoogleEarthEnterpriseData.js\";\r\nimport GoogleEarthEnterpriseTileInformation from \"../Core/GoogleEarthEnterpriseTileInformation.js\";\r\nimport RuntimeError from \"../Core/RuntimeError.js\";\r\nimport pako from \"pako/lib/inflate.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\n// Datatype sizes\r\nconst sizeOfUint16 = Uint16Array.BYTES_PER_ELEMENT;\r\nconst sizeOfInt32 = Int32Array.BYTES_PER_ELEMENT;\r\nconst sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;\r\n\r\nconst Types = {\r\n METADATA: 0,\r\n TERRAIN: 1,\r\n DBROOT: 2,\r\n};\r\n\r\nTypes.fromString = function (s) {\r\n if (s === \"Metadata\") {\r\n return Types.METADATA;\r\n } else if (s === \"Terrain\") {\r\n return Types.TERRAIN;\r\n } else if (s === \"DbRoot\") {\r\n return Types.DBROOT;\r\n }\r\n};\r\n\r\nfunction decodeGoogleEarthEnterprisePacket(parameters, transferableObjects) {\r\n const type = Types.fromString(parameters.type);\r\n let buffer = parameters.buffer;\r\n decodeGoogleEarthEnterpriseData(parameters.key, buffer);\r\n\r\n const uncompressedTerrain = uncompressPacket(buffer);\r\n buffer = uncompressedTerrain.buffer;\r\n const length = uncompressedTerrain.length;\r\n\r\n switch (type) {\r\n case Types.METADATA:\r\n return processMetadata(buffer, length, parameters.quadKey);\r\n case Types.TERRAIN:\r\n return processTerrain(buffer, length, transferableObjects);\r\n case Types.DBROOT:\r\n transferableObjects.push(buffer);\r\n return {\r\n buffer: buffer,\r\n };\r\n }\r\n}\r\n\r\nconst qtMagic = 32301;\r\n\r\nfunction processMetadata(buffer, totalSize, quadKey) {\r\n const dv = new DataView(buffer);\r\n let offset = 0;\r\n const magic = dv.getUint32(offset, true);\r\n offset += sizeOfUint32;\r\n if (magic !== qtMagic) {\r\n throw new RuntimeError(\"Invalid magic\");\r\n }\r\n\r\n const dataTypeId = dv.getUint32(offset, true);\r\n offset += sizeOfUint32;\r\n if (dataTypeId !== 1) {\r\n throw new RuntimeError(\"Invalid data type. Must be 1 for QuadTreePacket\");\r\n }\r\n\r\n // Tile format version\r\n const quadVersion = dv.getUint32(offset, true);\r\n offset += sizeOfUint32;\r\n if (quadVersion !== 2) {\r\n throw new RuntimeError(\r\n \"Invalid QuadTreePacket version. Only version 2 is supported.\"\r\n );\r\n }\r\n\r\n const numInstances = dv.getInt32(offset, true);\r\n offset += sizeOfInt32;\r\n\r\n const dataInstanceSize = dv.getInt32(offset, true);\r\n offset += sizeOfInt32;\r\n if (dataInstanceSize !== 32) {\r\n throw new RuntimeError(\"Invalid instance size.\");\r\n }\r\n\r\n const dataBufferOffset = dv.getInt32(offset, true);\r\n offset += sizeOfInt32;\r\n\r\n const dataBufferSize = dv.getInt32(offset, true);\r\n offset += sizeOfInt32;\r\n\r\n const metaBufferSize = dv.getInt32(offset, true);\r\n offset += sizeOfInt32;\r\n\r\n // Offset from beginning of packet (instances + current offset)\r\n if (dataBufferOffset !== numInstances * dataInstanceSize + offset) {\r\n throw new RuntimeError(\"Invalid dataBufferOffset\");\r\n }\r\n\r\n // Verify the packets is all there header + instances + dataBuffer + metaBuffer\r\n if (dataBufferOffset + dataBufferSize + metaBufferSize !== totalSize) {\r\n throw new RuntimeError(\"Invalid packet offsets\");\r\n }\r\n\r\n // Read all the instances\r\n const instances = [];\r\n for (let i = 0; i < numInstances; ++i) {\r\n const bitfield = dv.getUint8(offset);\r\n ++offset;\r\n\r\n ++offset; // 2 byte align\r\n\r\n const cnodeVersion = dv.getUint16(offset, true);\r\n offset += sizeOfUint16;\r\n\r\n const imageVersion = dv.getUint16(offset, true);\r\n offset += sizeOfUint16;\r\n\r\n const terrainVersion = dv.getUint16(offset, true);\r\n offset += sizeOfUint16;\r\n\r\n // Number of channels stored in the dataBuffer\r\n offset += sizeOfUint16;\r\n\r\n offset += sizeOfUint16; // 4 byte align\r\n\r\n // Channel type offset into dataBuffer\r\n offset += sizeOfInt32;\r\n\r\n // Channel version offset into dataBuffer\r\n offset += sizeOfInt32;\r\n\r\n offset += 8; // Ignore image neighbors for now\r\n\r\n // Data providers\r\n const imageProvider = dv.getUint8(offset++);\r\n const terrainProvider = dv.getUint8(offset++);\r\n offset += sizeOfUint16; // 4 byte align\r\n\r\n instances.push(\r\n new GoogleEarthEnterpriseTileInformation(\r\n bitfield,\r\n cnodeVersion,\r\n imageVersion,\r\n terrainVersion,\r\n imageProvider,\r\n terrainProvider\r\n )\r\n );\r\n }\r\n\r\n const tileInfo = [];\r\n let index = 0;\r\n\r\n function populateTiles(parentKey, parent, level) {\r\n let isLeaf = false;\r\n if (level === 4) {\r\n if (parent.hasSubtree()) {\r\n return; // We have a subtree, so just return\r\n }\r\n\r\n isLeaf = true; // No subtree, so set all children to null\r\n }\r\n for (let i = 0; i < 4; ++i) {\r\n const childKey = parentKey + i.toString();\r\n if (isLeaf) {\r\n // No subtree so set all children to null\r\n tileInfo[childKey] = null;\r\n } else if (level < 4) {\r\n // We are still in the middle of the subtree, so add child\r\n // only if their bits are set, otherwise set child to null.\r\n if (!parent.hasChild(i)) {\r\n tileInfo[childKey] = null;\r\n } else {\r\n if (index === numInstances) {\r\n console.log(\"Incorrect number of instances\");\r\n return;\r\n }\r\n\r\n const instance = instances[index++];\r\n tileInfo[childKey] = instance;\r\n populateTiles(childKey, instance, level + 1);\r\n }\r\n }\r\n }\r\n }\r\n\r\n let level = 0;\r\n const root = instances[index++];\r\n if (quadKey === \"\") {\r\n // Root tile has data at its root and one less level\r\n ++level;\r\n } else {\r\n tileInfo[quadKey] = root; // This will only contain the child bitmask\r\n }\r\n\r\n populateTiles(quadKey, root, level);\r\n\r\n return tileInfo;\r\n}\r\n\r\nconst numMeshesPerPacket = 5;\r\nconst numSubMeshesPerMesh = 4;\r\n\r\n// Each terrain packet will have 5 meshes - each containg 4 sub-meshes:\r\n// 1 even level mesh and its 4 odd level children.\r\n// Any remaining bytes after the 20 sub-meshes contains water surface meshes,\r\n// which are ignored.\r\nfunction processTerrain(buffer, totalSize, transferableObjects) {\r\n const dv = new DataView(buffer);\r\n\r\n // Find the sub-meshes.\r\n const advanceMesh = function (pos) {\r\n for (let sub = 0; sub < numSubMeshesPerMesh; ++sub) {\r\n const size = dv.getUint32(pos, true);\r\n pos += sizeOfUint32;\r\n pos += size;\r\n if (pos > totalSize) {\r\n throw new RuntimeError(\"Malformed terrain packet found.\");\r\n }\r\n }\r\n return pos;\r\n };\r\n\r\n let offset = 0;\r\n const terrainMeshes = [];\r\n while (terrainMeshes.length < numMeshesPerPacket) {\r\n const start = offset;\r\n offset = advanceMesh(offset);\r\n const mesh = buffer.slice(start, offset);\r\n transferableObjects.push(mesh);\r\n terrainMeshes.push(mesh);\r\n }\r\n\r\n return terrainMeshes;\r\n}\r\n\r\nconst compressedMagic = 0x7468dead;\r\nconst compressedMagicSwap = 0xadde6874;\r\n\r\nfunction uncompressPacket(data) {\r\n // The layout of this decoded data is\r\n // Magic Uint32\r\n // Size Uint32\r\n // [GZipped chunk of Size bytes]\r\n\r\n // Pullout magic and verify we have the correct data\r\n const dv = new DataView(data);\r\n let offset = 0;\r\n const magic = dv.getUint32(offset, true);\r\n offset += sizeOfUint32;\r\n if (magic !== compressedMagic && magic !== compressedMagicSwap) {\r\n throw new RuntimeError(\"Invalid magic\");\r\n }\r\n\r\n // Get the size of the compressed buffer - the endianness depends on which magic was used\r\n const size = dv.getUint32(offset, magic === compressedMagic);\r\n offset += sizeOfUint32;\r\n\r\n const compressedPacket = new Uint8Array(data, offset);\r\n const uncompressedPacket = pako.inflate(compressedPacket);\r\n\r\n if (uncompressedPacket.length !== size) {\r\n throw new RuntimeError(\"Size of packet doesn't match header\");\r\n }\r\n\r\n return uncompressedPacket;\r\n}\r\nexport default createTaskProcessorWorker(decodeGoogleEarthEnterprisePacket);\r\n"],"names":["compressedMagic","compressedMagicSwap","Check","RuntimeError","defined","adler32","crc32","BAD","TYPE","ENOUGH_LENS","ENOUGH_DISTS","CODES","LENS","DISTS","inflate_table","require$$0","require$$1","require$$2","require$$3","Z_FINISH","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","require$$4","inflate","inflate_1","strings","ZStream","GZheader","require$$5","require$$6","pako"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAGA,MAAMA,iBAAe,GAAG,UAAU,CAAC;EACnC,MAAMC,qBAAmB,GAAG,UAAU,CAAC;AACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,+BAA+B,CAAC,GAAG,EAAE,IAAI,EAAE;EACpD,EAAE,IAAI,+BAA+B,CAAC,yBAAyB,EAAE;EACjE,IAAI,OAAO,IAAI,CAAC;EAChB,GAAG;AACH;EACA;EACA,EAAEC,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;EAClC,EAAEA,WAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;EACpC;AACA;EACA,EAAE,MAAM,SAAS,GAAG,GAAG,CAAC,UAAU,CAAC;EACnC,EAAE,IAAI,SAAS,KAAK,CAAC,IAAI,SAAS,GAAG,CAAC,KAAK,CAAC,EAAE;EAC9C,IAAI,MAAM,IAAIC,yBAAY;EAC1B,MAAM,+DAA+D;EACrE,KAAK,CAAC;EACN,GAAG;AACH;EACA,EAAE,MAAM,QAAQ,GAAG,IAA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AAC,CAAC;EACjB,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;EAC3C,EAAE,MAAM,IAAI,YAAY,CAAC;EACzB,EAAE,IAAI,KAAK,KAAK,eAAe,IAAI,KAAK,KAAK,mBAAmB,EAAE;EAClE,IAAI,MAAM,IAAIA,yBAAY,CAAC,eAAe,CAAC,CAAC;EAC5C,GAAG;AACH;EACA;EACA,EAAE,MAAM,IAAI,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,KAAK,eAAe,CAAC,CAAC;EAC/D,EAAE,MAAM,IAAI,YAAY,CAAC;AACzB;EACA,EAAE,MAAM,gBAAgB,GAAG,IAAI,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;EACxD,EAAE,MAAM,kBAAkB,GAAG+B,SAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC5D;EACA,EAAE,IAAI,kBAAkB,CAAC,MAAM,KAAK,IAAI,EAAE;EAC1C,IAAI,MAAM,IAAI/B,yBAAY,CAAC,qCAAqC,CAAC,CAAC;EAClE,GAAG;AACH;EACA,EAAE,OAAO,kBAAkB,CAAC;EAC5B,CAAC;AACD,4CAAe,yBAAyB,CAAC,iCAAiC,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/decodeI3S.js b/examples/cesium/Workers/decodeI3S.js
new file mode 100644
index 0000000..33681e7
--- /dev/null
+++ b/examples/cesium/Workers/decodeI3S.js
@@ -0,0 +1,1066 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./createTaskProcessorWorker', './defaultValue-0ab18f7d', './WebMercatorProjection-306f7acc', './Matrix3-f22b0303', './Math-9be8b918', './Check-d10e5f2e'], (function (createTaskProcessorWorker, defaultValue, WebMercatorProjection, Matrix3, Math$1, Check) { 'use strict';
+
+ /* global require */
+
+ let draco;
+
+ function bilinearInterpolate(tx, ty, h00, h10, h01, h11) {
+ const a = h00 * (1 - tx) + h10 * tx;
+ const b = h01 * (1 - tx) + h11 * tx;
+ return a * (1 - ty) + b * ty;
+ }
+
+ function sampleMap(u, v, width, data) {
+ const address = u + v * width;
+ return data[address];
+ }
+
+ function sampleGeoid(sampleX, sampleY, geoidData) {
+ const extent = geoidData.nativeExtent;
+ let x =
+ ((sampleX - extent.west) / (extent.east - extent.west)) *
+ (geoidData.width - 1);
+ let y =
+ ((sampleY - extent.south) / (extent.north - extent.south)) *
+ (geoidData.height - 1);
+ const xi = Math.floor(x);
+ let yi = Math.floor(y);
+
+ x -= xi;
+ y -= yi;
+
+ const xNext = xi < geoidData.width ? xi + 1 : xi;
+ let yNext = yi < geoidData.height ? yi + 1 : yi;
+
+ yi = geoidData.height - 1 - yi;
+ yNext = geoidData.height - 1 - yNext;
+
+ const h00 = sampleMap(xi, yi, geoidData.width, geoidData.buffer);
+ const h10 = sampleMap(xNext, yi, geoidData.width, geoidData.buffer);
+ const h01 = sampleMap(xi, yNext, geoidData.width, geoidData.buffer);
+ const h11 = sampleMap(xNext, yNext, geoidData.width, geoidData.buffer);
+
+ let finalHeight = bilinearInterpolate(x, y, h00, h10, h01, h11);
+ finalHeight = finalHeight * geoidData.scale + geoidData.offset;
+ return finalHeight;
+ }
+
+ function sampleGeoidFromList(lon, lat, geoidDataList) {
+ for (let i = 0; i < geoidDataList.length; i++) {
+ const localExtent = geoidDataList[i].nativeExtent;
+
+ let localPt = new Matrix3.Cartesian3();
+ if (geoidDataList[i].projectionType === "WebMercator") {
+ const radii = geoidDataList[i].projection._ellipsoid._radii;
+ const webMercatorProj = new WebMercatorProjection.WebMercatorProjection(
+ new Matrix3.Ellipsoid(radii.x, radii.y, radii.z)
+ );
+ localPt = webMercatorProj.project(new Matrix3.Cartographic(lon, lat, 0));
+ } else {
+ localPt.x = lon;
+ localPt.y = lat;
+ }
+
+ if (
+ localPt.x > localExtent.west &&
+ localPt.x < localExtent.east &&
+ localPt.y > localExtent.south &&
+ localPt.y < localExtent.north
+ ) {
+ return sampleGeoid(localPt.x, localPt.y, geoidDataList[i]);
+ }
+ }
+
+ return 0;
+ }
+
+ function orthometricToEllipsoidal(
+ vertexCount,
+ position,
+ scale_x,
+ scale_y,
+ center,
+ geoidDataList,
+ fast
+ ) {
+ if (fast) {
+ // Geometry is already relative to the tile origin which has already been shifted to account for geoid height
+ // Nothing to do here
+ return;
+ }
+
+ // For more precision, sample the geoid height at each vertex and shift by the difference between that value and the height at the center of the tile
+ const centerHeight = sampleGeoidFromList(
+ center.longitude,
+ center.latitude,
+ geoidDataList
+ );
+
+ for (let i = 0; i < vertexCount; ++i) {
+ const height = sampleGeoidFromList(
+ center.longitude + Math$1.CesiumMath.toRadians(scale_x * position[i * 3]),
+ center.latitude + Math$1.CesiumMath.toRadians(scale_y * position[i * 3 + 1]),
+ geoidDataList
+ );
+ position[i * 3 + 2] += height - centerHeight;
+ }
+ }
+
+ function transformToLocal(
+ vertexCount,
+ positions,
+ normals,
+ cartographicCenter,
+ cartesianCenter,
+ parentRotation,
+ ellipsoidRadiiSquare,
+ scale_x,
+ scale_y
+ ) {
+ if (vertexCount === 0 || !defaultValue.defined(positions) || positions.length === 0) {
+ return;
+ }
+
+ const ellipsoid = new Matrix3.Ellipsoid(
+ Math.sqrt(ellipsoidRadiiSquare.x),
+ Math.sqrt(ellipsoidRadiiSquare.y),
+ Math.sqrt(ellipsoidRadiiSquare.z)
+ );
+ for (let i = 0; i < vertexCount; ++i) {
+ const indexOffset = i * 3;
+ const indexOffset1 = indexOffset + 1;
+ const indexOffset2 = indexOffset + 2;
+
+ const cartographic = new Matrix3.Cartographic();
+ cartographic.longitude =
+ cartographicCenter.longitude +
+ Math$1.CesiumMath.toRadians(scale_x * positions[indexOffset]);
+
+ cartographic.latitude =
+ cartographicCenter.latitude +
+ Math$1.CesiumMath.toRadians(scale_y * positions[indexOffset1]);
+ cartographic.height = cartographicCenter.height + positions[indexOffset2];
+
+ const position = {};
+ ellipsoid.cartographicToCartesian(cartographic, position);
+
+ position.x -= cartesianCenter.x;
+ position.y -= cartesianCenter.y;
+ position.z -= cartesianCenter.z;
+
+ const rotatedPosition = {};
+ Matrix3.Matrix3.multiplyByVector(parentRotation, position, rotatedPosition);
+
+ positions[indexOffset] = rotatedPosition.x;
+ positions[indexOffset1] = rotatedPosition.y;
+ positions[indexOffset2] = rotatedPosition.z;
+
+ if (defaultValue.defined(normals)) {
+ const normal = new Matrix3.Cartesian3(
+ normals[indexOffset],
+ normals[indexOffset1],
+ normals[indexOffset2]
+ );
+
+ const rotatedNormal = {};
+ Matrix3.Matrix3.multiplyByVector(parentRotation, normal, rotatedNormal);
+
+ // TODO: check if normals are Z-UP or Y-UP and flip y and z
+ normals[indexOffset] = rotatedNormal.x;
+ normals[indexOffset1] = rotatedNormal.y;
+ normals[indexOffset2] = rotatedNormal.z;
+ }
+ }
+ }
+
+ function cropUVs(vertexCount, uv0s, uvRegions) {
+ for (let vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex) {
+ const minU = uvRegions[vertexIndex * 4] / 65535.0;
+ const minV = uvRegions[vertexIndex * 4 + 1] / 65535.0;
+ const scaleU =
+ (uvRegions[vertexIndex * 4 + 2] - uvRegions[vertexIndex * 4]) / 65535.0;
+ const scaleV =
+ (uvRegions[vertexIndex * 4 + 3] - uvRegions[vertexIndex * 4 + 1]) /
+ 65535.0;
+
+ uv0s[vertexIndex * 2] *= scaleU;
+ uv0s[vertexIndex * 2] += minU;
+
+ uv0s[vertexIndex * 2 + 1] *= scaleV;
+ uv0s[vertexIndex * 2 + 1] += minV;
+ }
+ }
+
+ function generateGltfBuffer(
+ vertexCount,
+ indices,
+ positions,
+ normals,
+ uv0s,
+ colors
+ ) {
+ if (vertexCount === 0 || !defaultValue.defined(positions) || positions.length === 0) {
+ return {
+ buffers: [],
+ bufferViews: [],
+ accessors: [],
+ meshes: [],
+ nodes: [],
+ nodesInScene: [],
+ };
+ }
+
+ const buffers = [];
+ const bufferViews = [];
+ const accessors = [];
+ const meshes = [];
+ const nodes = [];
+ const nodesInScene = [];
+
+ // If we provide indices, then the vertex count is the length
+ // of that array, otherwise we assume non-indexed triangle
+ if (defaultValue.defined(indices)) {
+ vertexCount = indices.length;
+ }
+
+ // Allocate array
+ const indexArray = new Uint32Array(vertexCount);
+
+ if (defaultValue.defined(indices)) {
+ // Set the indices
+ for (let vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex) {
+ indexArray[vertexIndex] = indices[vertexIndex];
+ }
+ } else {
+ // Generate indices
+ for (
+ let newVertexIndex = 0;
+ newVertexIndex < vertexCount;
+ ++newVertexIndex
+ ) {
+ indexArray[newVertexIndex] = newVertexIndex;
+ }
+ }
+
+ // Push to the buffers, bufferViews and accessors
+ const indicesBlob = new Blob([indexArray], { type: "application/binary" });
+ const indicesURL = URL.createObjectURL(indicesBlob);
+
+ const endIndex = vertexCount;
+
+ // POSITIONS
+ const meshPositions = positions.subarray(0, endIndex * 3);
+ const positionsBlob = new Blob([meshPositions], {
+ type: "application/binary",
+ });
+ const positionsURL = URL.createObjectURL(positionsBlob);
+
+ let minX = Number.POSITIVE_INFINITY;
+ let maxX = Number.NEGATIVE_INFINITY;
+ let minY = Number.POSITIVE_INFINITY;
+ let maxY = Number.NEGATIVE_INFINITY;
+ let minZ = Number.POSITIVE_INFINITY;
+ let maxZ = Number.NEGATIVE_INFINITY;
+
+ for (let i = 0; i < meshPositions.length / 3; i++) {
+ minX = Math.min(minX, meshPositions[i * 3 + 0]);
+ maxX = Math.max(maxX, meshPositions[i * 3 + 0]);
+ minY = Math.min(minY, meshPositions[i * 3 + 1]);
+ maxY = Math.max(maxY, meshPositions[i * 3 + 1]);
+ minZ = Math.min(minZ, meshPositions[i * 3 + 2]);
+ maxZ = Math.max(maxZ, meshPositions[i * 3 + 2]);
+ }
+
+ // NORMALS
+ const meshNormals = normals ? normals.subarray(0, endIndex * 3) : undefined;
+ let normalsURL;
+ if (defaultValue.defined(meshNormals)) {
+ const normalsBlob = new Blob([meshNormals], {
+ type: "application/binary",
+ });
+ normalsURL = URL.createObjectURL(normalsBlob);
+ }
+
+ // UV0s
+ const meshUv0s = uv0s ? uv0s.subarray(0, endIndex * 2) : undefined;
+ let uv0URL;
+ if (defaultValue.defined(meshUv0s)) {
+ const uv0Blob = new Blob([meshUv0s], { type: "application/binary" });
+ uv0URL = URL.createObjectURL(uv0Blob);
+ }
+
+ // COLORS
+ const meshColorsInBytes = defaultValue.defined(colors)
+ ? colors.subarray(0, endIndex * 4)
+ : undefined;
+ let colorsURL;
+ if (defaultValue.defined(meshColorsInBytes)) {
+ const colorsBlob = new Blob([meshColorsInBytes], {
+ type: "application/binary",
+ });
+ colorsURL = URL.createObjectURL(colorsBlob);
+ }
+
+ const posIndex = 0;
+ let normalIndex = 0;
+ let uv0Index = 0;
+ let colorIndex = 0;
+ let indicesIndex = 0;
+
+ let currentIndex = posIndex;
+
+ const attributes = {};
+
+ // POSITIONS
+ attributes.POSITION = posIndex;
+ buffers.push({
+ uri: positionsURL,
+ byteLength: meshPositions.byteLength,
+ });
+ bufferViews.push({
+ buffer: posIndex,
+ byteOffset: 0,
+ byteLength: meshPositions.byteLength,
+ target: 34962,
+ });
+ accessors.push({
+ bufferView: posIndex,
+ byteOffset: 0,
+ componentType: 5126,
+ count: vertexCount,
+ type: "VEC3",
+ max: [minX, minY, minZ],
+ min: [maxX, maxY, maxZ],
+ });
+
+ // NORMALS
+ if (defaultValue.defined(normalsURL)) {
+ ++currentIndex;
+ normalIndex = currentIndex;
+ attributes.NORMAL = normalIndex;
+ buffers.push({
+ uri: normalsURL,
+ byteLength: meshNormals.byteLength,
+ });
+ bufferViews.push({
+ buffer: normalIndex,
+ byteOffset: 0,
+ byteLength: meshNormals.byteLength,
+ target: 34962,
+ });
+ accessors.push({
+ bufferView: normalIndex,
+ byteOffset: 0,
+ componentType: 5126,
+ count: vertexCount,
+ type: "VEC3",
+ });
+ }
+
+ // UV0
+ if (defaultValue.defined(uv0URL)) {
+ ++currentIndex;
+ uv0Index = currentIndex;
+ attributes.TEXCOORD_0 = uv0Index;
+ buffers.push({
+ uri: uv0URL,
+ byteLength: meshUv0s.byteLength,
+ });
+ bufferViews.push({
+ buffer: uv0Index,
+ byteOffset: 0,
+ byteLength: meshUv0s.byteLength,
+ target: 34962,
+ });
+ accessors.push({
+ bufferView: uv0Index,
+ byteOffset: 0,
+ componentType: 5126,
+ count: vertexCount,
+ type: "VEC2",
+ });
+ }
+
+ // COLORS
+ if (defaultValue.defined(colorsURL)) {
+ ++currentIndex;
+ colorIndex = currentIndex;
+ attributes.COLOR_0 = colorIndex;
+ buffers.push({
+ uri: colorsURL,
+ byteLength: meshColorsInBytes.byteLength,
+ });
+ bufferViews.push({
+ buffer: colorIndex,
+ byteOffset: 0,
+ byteLength: meshColorsInBytes.byteLength,
+ target: 34962,
+ });
+ accessors.push({
+ bufferView: colorIndex,
+ byteOffset: 0,
+ componentType: 5121,
+ normalized: true,
+ count: vertexCount,
+ type: "VEC4",
+ });
+ }
+
+ // INDICES
+ ++currentIndex;
+ indicesIndex = currentIndex;
+ buffers.push({
+ uri: indicesURL,
+ byteLength: indexArray.byteLength,
+ });
+ bufferViews.push({
+ buffer: indicesIndex,
+ byteOffset: 0,
+ byteLength: indexArray.byteLength,
+ target: 34963,
+ });
+ accessors.push({
+ bufferView: indicesIndex,
+ byteOffset: 0,
+ componentType: 5125,
+ count: vertexCount,
+ type: "SCALAR",
+ });
+
+ // Create a new mesh for this page
+ meshes.push({
+ primitives: [
+ {
+ attributes: attributes,
+ indices: indicesIndex,
+ material: 0,
+ },
+ ],
+ });
+ nodesInScene.push(0);
+ nodes.push({ mesh: 0 });
+
+ return {
+ buffers: buffers,
+ bufferViews: bufferViews,
+ accessors: accessors,
+ meshes: meshes,
+ nodes: nodes,
+ nodesInScene: nodesInScene,
+ };
+ }
+
+ function decode(data, schema, bufferInfo, featureData) {
+ const magicNumber = new Uint8Array(data, 0, 5);
+ if (
+ magicNumber[0] === "D".charCodeAt() &&
+ magicNumber[1] === "R".charCodeAt() &&
+ magicNumber[2] === "A".charCodeAt() &&
+ magicNumber[3] === "C".charCodeAt() &&
+ magicNumber[4] === "O".charCodeAt()
+ ) {
+ return decodeDracoEncodedGeometry(data);
+ }
+ return decodeBinaryGeometry(data, schema, bufferInfo, featureData);
+ }
+
+ function decodeDracoEncodedGeometry(data) {
+ // Create the Draco decoder.
+ const dracoDecoderModule = draco;
+ const buffer = new dracoDecoderModule.DecoderBuffer();
+
+ const byteArray = new Uint8Array(data);
+ buffer.Init(byteArray, byteArray.length);
+
+ // Create a buffer to hold the encoded data.
+ const dracoDecoder = new dracoDecoderModule.Decoder();
+ const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);
+ const metadataQuerier = new dracoDecoderModule.MetadataQuerier();
+
+ // Decode the encoded geometry.
+ // See: https://github.com/google/draco/blob/master/src/draco/javascript/emscripten/draco_web_decoder.idl
+ let dracoGeometry;
+ let status;
+ if (geometryType === dracoDecoderModule.TRIANGULAR_MESH) {
+ dracoGeometry = new dracoDecoderModule.Mesh();
+ status = dracoDecoder.DecodeBufferToMesh(buffer, dracoGeometry);
+ }
+
+ const decodedGeometry = {
+ vertexCount: [0],
+ featureCount: 0,
+ };
+
+ // if all is OK
+ if (defaultValue.defined(status) && status.ok() && dracoGeometry.ptr !== 0) {
+ const faceCount = dracoGeometry.num_faces();
+ const attributesCount = dracoGeometry.num_attributes();
+ const vertexCount = dracoGeometry.num_points();
+ decodedGeometry.indices = new Uint32Array(faceCount * 3);
+ const faces = decodedGeometry.indices;
+
+ decodedGeometry.vertexCount[0] = vertexCount;
+ decodedGeometry.scale_x = 1;
+ decodedGeometry.scale_y = 1;
+
+ // Decode faces
+ // @TODO: Replace that code with GetTrianglesUInt32Array for better efficiency
+ const face = new dracoDecoderModule.DracoInt32Array(3);
+ for (let faceIndex = 0; faceIndex < faceCount; ++faceIndex) {
+ dracoDecoder.GetFaceFromMesh(dracoGeometry, faceIndex, face);
+ faces[faceIndex * 3] = face.GetValue(0);
+ faces[faceIndex * 3 + 1] = face.GetValue(1);
+ faces[faceIndex * 3 + 2] = face.GetValue(2);
+ }
+
+ dracoDecoderModule.destroy(face);
+
+ for (let attrIndex = 0; attrIndex < attributesCount; ++attrIndex) {
+ const dracoAttribute = dracoDecoder.GetAttribute(
+ dracoGeometry,
+ attrIndex
+ );
+
+ const attributeData = decodeDracoAttribute(
+ dracoDecoderModule,
+ dracoDecoder,
+ dracoGeometry,
+ dracoAttribute,
+ vertexCount
+ );
+
+ // initial mapping
+ const dracoAttributeType = dracoAttribute.attribute_type();
+ let attributei3sName = "unknown";
+
+ if (dracoAttributeType === dracoDecoderModule.POSITION) {
+ attributei3sName = "positions";
+ } else if (dracoAttributeType === dracoDecoderModule.NORMAL) {
+ attributei3sName = "normals";
+ } else if (dracoAttributeType === dracoDecoderModule.COLOR) {
+ attributei3sName = "colors";
+ } else if (dracoAttributeType === dracoDecoderModule.TEX_COORD) {
+ attributei3sName = "uv0s";
+ }
+
+ // get the metadata
+ const metadata = dracoDecoder.GetAttributeMetadata(
+ dracoGeometry,
+ attrIndex
+ );
+
+ if (metadata.ptr !== 0) {
+ const numEntries = metadataQuerier.NumEntries(metadata);
+ for (let entry = 0; entry < numEntries; ++entry) {
+ const entryName = metadataQuerier.GetEntryName(metadata, entry);
+ if (entryName === "i3s-scale_x") {
+ decodedGeometry.scale_x = metadataQuerier.GetDoubleEntry(
+ metadata,
+ "i3s-scale_x"
+ );
+ } else if (entryName === "i3s-scale_y") {
+ decodedGeometry.scale_y = metadataQuerier.GetDoubleEntry(
+ metadata,
+ "i3s-scale_y"
+ );
+ } else if (entryName === "i3s-attribute-type") {
+ attributei3sName = metadataQuerier.GetStringEntry(
+ metadata,
+ "i3s-attribute-type"
+ );
+ }
+ }
+ }
+
+ if (defaultValue.defined(decodedGeometry[attributei3sName])) {
+ console.log("Attribute already exists", attributei3sName);
+ }
+
+ decodedGeometry[attributei3sName] = attributeData;
+
+ if (attributei3sName === "feature-index") {
+ decodedGeometry.featureCount++;
+ }
+ }
+
+ dracoDecoderModule.destroy(dracoGeometry);
+ }
+
+ dracoDecoderModule.destroy(metadataQuerier);
+ dracoDecoderModule.destroy(dracoDecoder);
+
+ return decodedGeometry;
+ }
+
+ function decodeDracoAttribute(
+ dracoDecoderModule,
+ dracoDecoder,
+ dracoGeometry,
+ dracoAttribute,
+ vertexCount
+ ) {
+ const bufferSize = dracoAttribute.num_components() * vertexCount;
+ let dracoAttributeData;
+
+ const handlers = [
+ function () {}, // DT_INVALID - 0
+ function () {
+ // DT_INT8 - 1
+ dracoAttributeData = new dracoDecoderModule.DracoInt8Array(bufferSize);
+ const success = dracoDecoder.GetAttributeInt8ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ dracoAttributeData
+ );
+
+ if (!success) {
+ console.error("Bad stream");
+ }
+ const attributeData = new Int8Array(bufferSize);
+ for (let i = 0; i < bufferSize; ++i) {
+ attributeData[i] = dracoAttributeData.GetValue(i);
+ }
+ return attributeData;
+ },
+ function () {
+ // DT_UINT8 - 2
+ dracoAttributeData = new dracoDecoderModule.DracoInt8Array(bufferSize);
+ const success = dracoDecoder.GetAttributeUInt8ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ dracoAttributeData
+ );
+
+ if (!success) {
+ console.error("Bad stream");
+ }
+ const attributeData = new Uint8Array(bufferSize);
+ for (let i = 0; i < bufferSize; ++i) {
+ attributeData[i] = dracoAttributeData.GetValue(i);
+ }
+ return attributeData;
+ },
+ function () {
+ // DT_INT16 - 3
+ dracoAttributeData = new dracoDecoderModule.DracoInt16Array(bufferSize);
+ const success = dracoDecoder.GetAttributeInt16ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ dracoAttributeData
+ );
+
+ if (!success) {
+ console.error("Bad stream");
+ }
+ const attributeData = new Int16Array(bufferSize);
+ for (let i = 0; i < bufferSize; ++i) {
+ attributeData[i] = dracoAttributeData.GetValue(i);
+ }
+ return attributeData;
+ },
+ function () {
+ // DT_UINT16 - 4
+ dracoAttributeData = new dracoDecoderModule.DracoInt16Array(bufferSize);
+ const success = dracoDecoder.GetAttributeUInt16ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ dracoAttributeData
+ );
+
+ if (!success) {
+ console.error("Bad stream");
+ }
+ const attributeData = new Uint16Array(bufferSize);
+ for (let i = 0; i < bufferSize; ++i) {
+ attributeData[i] = dracoAttributeData.GetValue(i);
+ }
+ return attributeData;
+ },
+ function () {
+ // DT_INT32 - 5
+ dracoAttributeData = new dracoDecoderModule.DracoInt32Array(bufferSize);
+ const success = dracoDecoder.GetAttributeInt32ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ dracoAttributeData
+ );
+
+ if (!success) {
+ console.error("Bad stream");
+ }
+ const attributeData = new Int32Array(bufferSize);
+ for (let i = 0; i < bufferSize; ++i) {
+ attributeData[i] = dracoAttributeData.GetValue(i);
+ }
+ return attributeData;
+ },
+ function () {
+ // DT_UINT32 - 6
+ dracoAttributeData = new dracoDecoderModule.DracoInt32Array(bufferSize);
+ const success = dracoDecoder.GetAttributeUInt32ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ dracoAttributeData
+ );
+
+ if (!success) {
+ console.error("Bad stream");
+ }
+ const attributeData = new Uint32Array(bufferSize);
+ for (let i = 0; i < bufferSize; ++i) {
+ attributeData[i] = dracoAttributeData.GetValue(i);
+ }
+ return attributeData;
+ },
+ function () {
+ // DT_INT64 - 7
+ },
+ function () {
+ // DT_UINT64 - 8
+ },
+ function () {
+ // DT_FLOAT32 - 9
+ dracoAttributeData = new dracoDecoderModule.DracoFloat32Array(bufferSize);
+ const success = dracoDecoder.GetAttributeFloatForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ dracoAttributeData
+ );
+
+ if (!success) {
+ console.error("Bad stream");
+ }
+ const attributeData = new Float32Array(bufferSize);
+ for (let i = 0; i < bufferSize; ++i) {
+ attributeData[i] = dracoAttributeData.GetValue(i);
+ }
+ return attributeData;
+ },
+ function () {
+ // DT_FLOAT64 - 10
+ },
+ function () {
+ // DT_FLOAT32 - 11
+ dracoAttributeData = new dracoDecoderModule.DracoUInt8Array(bufferSize);
+ const success = dracoDecoder.GetAttributeUInt8ForAllPoints(
+ dracoGeometry,
+ dracoAttribute,
+ dracoAttributeData
+ );
+
+ if (!success) {
+ console.error("Bad stream");
+ }
+ const attributeData = new Uint8Array(bufferSize);
+ for (let i = 0; i < bufferSize; ++i) {
+ attributeData[i] = dracoAttributeData.GetValue(i);
+ }
+ return attributeData;
+ },
+ ];
+
+ const attributeData = handlers[dracoAttribute.data_type()]();
+
+ if (defaultValue.defined(dracoAttributeData)) {
+ dracoDecoderModule.destroy(dracoAttributeData);
+ }
+
+ return attributeData;
+ }
+
+ const binaryAttributeDecoders = {
+ position: function (decodedGeometry, data, offset) {
+ const count = decodedGeometry.vertexCount * 3;
+ decodedGeometry.positions = new Float32Array(data, offset, count);
+ offset += count * 4;
+ return offset;
+ },
+ normal: function (decodedGeometry, data, offset) {
+ const count = decodedGeometry.vertexCount * 3;
+ decodedGeometry.normals = new Float32Array(data, offset, count);
+ offset += count * 4;
+ return offset;
+ },
+ uv0: function (decodedGeometry, data, offset) {
+ const count = decodedGeometry.vertexCount * 2;
+ decodedGeometry.uv0s = new Float32Array(data, offset, count);
+ offset += count * 4;
+ return offset;
+ },
+ color: function (decodedGeometry, data, offset) {
+ const count = decodedGeometry.vertexCount * 4;
+ decodedGeometry.colors = new Uint8Array(data, offset, count);
+ offset += count;
+ return offset;
+ },
+ featureId: function (decodedGeometry, data, offset) {
+ // We don't need to use this for anything so just increment the offset
+ const count = decodedGeometry.featureCount;
+ offset += count * 8;
+ return offset;
+ },
+ id: function (decodedGeometry, data, offset) {
+ // We don't need to use this for anything so just increment the offset
+ const count = decodedGeometry.featureCount;
+ offset += count * 8;
+ return offset;
+ },
+ faceRange: function (decodedGeometry, data, offset) {
+ const count = decodedGeometry.featureCount * 2;
+ decodedGeometry.faceRange = new Uint32Array(data, offset, count);
+ offset += count * 4;
+ return offset;
+ },
+ uvRegion: function (decodedGeometry, data, offset) {
+ const count = decodedGeometry.vertexCount * 4;
+ decodedGeometry["uv-region"] = new Uint16Array(data, offset, count);
+ offset += count * 2;
+ return offset;
+ },
+ region: function (decodedGeometry, data, offset) {
+ const count = decodedGeometry.vertexCount * 4;
+ decodedGeometry["uv-region"] = new Uint16Array(data, offset, count);
+ offset += count * 2;
+ return offset;
+ },
+ };
+
+ function decodeBinaryGeometry(data, schema, bufferInfo, featureData) {
+ // From this spec:
+ // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/defaultGeometrySchema.cmn.md
+ const decodedGeometry = {
+ vertexCount: 0,
+ };
+
+ const dataView = new DataView(data);
+
+ try {
+ let offset = 0;
+ decodedGeometry.vertexCount = dataView.getUint32(offset, 1);
+ offset += 4;
+
+ decodedGeometry.featureCount = dataView.getUint32(offset, 1);
+ offset += 4;
+
+ if (defaultValue.defined(bufferInfo)) {
+ for (
+ let attrIndex = 0;
+ attrIndex < bufferInfo.attributes.length;
+ attrIndex++
+ ) {
+ if (
+ defaultValue.defined(binaryAttributeDecoders[bufferInfo.attributes[attrIndex]])
+ ) {
+ offset = binaryAttributeDecoders[bufferInfo.attributes[attrIndex]](
+ decodedGeometry,
+ data,
+ offset
+ );
+ } else {
+ console.error(
+ "Unknown decoder for",
+ bufferInfo.attributes[attrIndex]
+ );
+ }
+ }
+ } else {
+ let ordering = schema.ordering;
+ let featureAttributeOrder = schema.featureAttributeOrder;
+
+ if (
+ defaultValue.defined(featureData) &&
+ defaultValue.defined(featureData.geometryData) &&
+ defaultValue.defined(featureData.geometryData[0]) &&
+ defaultValue.defined(featureData.geometryData[0].params)
+ ) {
+ ordering = Object.keys(
+ featureData.geometryData[0].params.vertexAttributes
+ );
+ featureAttributeOrder = Object.keys(
+ featureData.geometryData[0].params.featureAttributes
+ );
+ }
+
+ // Use default geometry schema
+ for (let i = 0; i < ordering.length; i++) {
+ const decoder = binaryAttributeDecoders[ordering[i]];
+ if (!defaultValue.defined(decoder)) {
+ console.log(ordering[i]);
+ }
+ offset = decoder(decodedGeometry, data, offset);
+ }
+
+ for (let j = 0; j < featureAttributeOrder.length; j++) {
+ const curDecoder = binaryAttributeDecoders[featureAttributeOrder[j]];
+ if (!defaultValue.defined(curDecoder)) {
+ console.log(featureAttributeOrder[j]);
+ }
+ offset = curDecoder(decodedGeometry, data, offset);
+ }
+ }
+ } catch (e) {
+ console.error(e);
+ }
+
+ decodedGeometry.scale_x = 1;
+ decodedGeometry.scale_y = 1;
+
+ return decodedGeometry;
+ }
+
+ function decodeI3S(parameters) {
+ // Decode the data into geometry
+ const geometryData = decode(
+ parameters.binaryData,
+ parameters.schema,
+ parameters.bufferInfo,
+ parameters.featureData
+ );
+
+ // Adjust height from orthometric to ellipsoidal
+ if (
+ defaultValue.defined(parameters.geoidDataList) &&
+ parameters.geoidDataList.length > 0
+ ) {
+ orthometricToEllipsoidal(
+ geometryData.vertexCount,
+ geometryData.positions,
+ geometryData.scale_x,
+ geometryData.scale_y,
+ parameters.cartographicCenter,
+ parameters.geoidDataList,
+ false
+ );
+ }
+
+ // Transform vertices to local
+ transformToLocal(
+ geometryData.vertexCount,
+ geometryData.positions,
+ geometryData.normals,
+ parameters.cartographicCenter,
+ parameters.cartesianCenter,
+ parameters.parentRotation,
+ parameters.ellipsoidRadiiSquare,
+ geometryData.scale_x,
+ geometryData.scale_y
+ );
+
+ // Adjust UVs if there is a UV region
+ if (defaultValue.defined(geometryData.uv0s) && defaultValue.defined(geometryData["uv-region"])) {
+ cropUVs(
+ geometryData.vertexCount,
+ geometryData.uv0s,
+ geometryData["uv-region"]
+ );
+ }
+
+ // Create the final buffer
+ const meshData = generateGltfBuffer(
+ geometryData.vertexCount,
+ geometryData.indices,
+ geometryData.positions,
+ geometryData.normals,
+ geometryData.uv0s,
+ geometryData.colors
+ );
+
+ const customAttributes = {};
+ if (defaultValue.defined(geometryData["feature-index"])) {
+ customAttributes.positions = geometryData.positions;
+ customAttributes.indices = geometryData.indices;
+ customAttributes.featureIndex = geometryData["feature-index"];
+ customAttributes.cartesianCenter = parameters.cartesianCenter;
+ customAttributes.parentRotation = parameters.parentRotation;
+ } else if (defaultValue.defined(geometryData["faceRange"])) {
+ customAttributes.positions = geometryData.positions;
+ customAttributes.indices = geometryData.indices;
+ customAttributes.sourceURL = parameters.url;
+ customAttributes.cartesianCenter = parameters.cartesianCenter;
+ customAttributes.parentRotation = parameters.parentRotation;
+
+ // Build the feature index array from the faceRange.
+ customAttributes.featureIndex = new Array(geometryData.positions.length);
+ for (
+ let range = 0;
+ range < geometryData["faceRange"].length - 1;
+ range += 2
+ ) {
+ const curIndex = range / 2;
+ const rangeStart = geometryData["faceRange"][range];
+ const rangeEnd = geometryData["faceRange"][range + 1];
+ for (let i = rangeStart; i <= rangeEnd; i++) {
+ customAttributes.featureIndex[i * 3] = curIndex;
+ customAttributes.featureIndex[i * 3 + 1] = curIndex;
+ customAttributes.featureIndex[i * 3 + 2] = curIndex;
+ }
+ }
+ }
+
+ meshData._customAttributes = customAttributes;
+
+ const results = {
+ meshData: meshData,
+ };
+
+ return results;
+ }
+
+ function initWorker(dracoModule) {
+ draco = dracoModule;
+ self.onmessage = createTaskProcessorWorker(decodeI3S);
+ self.postMessage(true);
+ }
+
+ function decodeI3SStart(event) {
+ const data = event.data;
+
+ // Expect the first message to be to load a web assembly module
+ const wasmConfig = data.webAssemblyConfig;
+ if (defaultValue.defined(wasmConfig)) {
+ // Require and compile WebAssembly module, or use fallback if not supported
+ return require([wasmConfig.modulePath], function (dracoModule) {
+ if (defaultValue.defined(wasmConfig.wasmBinaryFile)) {
+ if (!defaultValue.defined(dracoModule)) {
+ dracoModule = self.DracoDecoderModule;
+ }
+
+ dracoModule(wasmConfig).then(function (compiledModule) {
+ initWorker(compiledModule);
+ });
+ } else {
+ initWorker(dracoModule());
+ }
+ });
+ }
+ }
+
+ return decodeI3SStart;
+
+}));
+//# sourceMappingURL=decodeI3S.js.map
diff --git a/examples/cesium/Workers/decodeI3S.js.map b/examples/cesium/Workers/decodeI3S.js.map
new file mode 100644
index 0000000..f47eab4
--- /dev/null
+++ b/examples/cesium/Workers/decodeI3S.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"decodeI3S.js","sources":["../../../Source/WorkersES6/decodeI3S.js"],"sourcesContent":["/* global require */\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport WebMercatorProjection from \"../Core/WebMercatorProjection.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport Cartographic from \"../Core/Cartographic.js\";\r\nimport Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport Matrix3 from \"../Core/Matrix3.js\";\r\nimport CesiumMath from \"../Core/Math.js\";\r\n\r\nlet draco;\r\n\r\nfunction bilinearInterpolate(tx, ty, h00, h10, h01, h11) {\r\n const a = h00 * (1 - tx) + h10 * tx;\r\n const b = h01 * (1 - tx) + h11 * tx;\r\n return a * (1 - ty) + b * ty;\r\n}\r\n\r\nfunction sampleMap(u, v, width, data) {\r\n const address = u + v * width;\r\n return data[address];\r\n}\r\n\r\nfunction sampleGeoid(sampleX, sampleY, geoidData) {\r\n const extent = geoidData.nativeExtent;\r\n let x =\r\n ((sampleX - extent.west) / (extent.east - extent.west)) *\r\n (geoidData.width - 1);\r\n let y =\r\n ((sampleY - extent.south) / (extent.north - extent.south)) *\r\n (geoidData.height - 1);\r\n const xi = Math.floor(x);\r\n let yi = Math.floor(y);\r\n\r\n x -= xi;\r\n y -= yi;\r\n\r\n const xNext = xi < geoidData.width ? xi + 1 : xi;\r\n let yNext = yi < geoidData.height ? yi + 1 : yi;\r\n\r\n yi = geoidData.height - 1 - yi;\r\n yNext = geoidData.height - 1 - yNext;\r\n\r\n const h00 = sampleMap(xi, yi, geoidData.width, geoidData.buffer);\r\n const h10 = sampleMap(xNext, yi, geoidData.width, geoidData.buffer);\r\n const h01 = sampleMap(xi, yNext, geoidData.width, geoidData.buffer);\r\n const h11 = sampleMap(xNext, yNext, geoidData.width, geoidData.buffer);\r\n\r\n let finalHeight = bilinearInterpolate(x, y, h00, h10, h01, h11);\r\n finalHeight = finalHeight * geoidData.scale + geoidData.offset;\r\n return finalHeight;\r\n}\r\n\r\nfunction sampleGeoidFromList(lon, lat, geoidDataList) {\r\n for (let i = 0; i < geoidDataList.length; i++) {\r\n const localExtent = geoidDataList[i].nativeExtent;\r\n\r\n let localPt = new Cartesian3();\r\n if (geoidDataList[i].projectionType === \"WebMercator\") {\r\n const radii = geoidDataList[i].projection._ellipsoid._radii;\r\n const webMercatorProj = new WebMercatorProjection(\r\n new Ellipsoid(radii.x, radii.y, radii.z)\r\n );\r\n localPt = webMercatorProj.project(new Cartographic(lon, lat, 0));\r\n } else {\r\n localPt.x = lon;\r\n localPt.y = lat;\r\n }\r\n\r\n if (\r\n localPt.x > localExtent.west &&\r\n localPt.x < localExtent.east &&\r\n localPt.y > localExtent.south &&\r\n localPt.y < localExtent.north\r\n ) {\r\n return sampleGeoid(localPt.x, localPt.y, geoidDataList[i]);\r\n }\r\n }\r\n\r\n return 0;\r\n}\r\n\r\nfunction orthometricToEllipsoidal(\r\n vertexCount,\r\n position,\r\n scale_x,\r\n scale_y,\r\n center,\r\n geoidDataList,\r\n fast\r\n) {\r\n if (fast) {\r\n // Geometry is already relative to the tile origin which has already been shifted to account for geoid height\r\n // Nothing to do here\r\n return;\r\n }\r\n\r\n // For more precision, sample the geoid height at each vertex and shift by the difference between that value and the height at the center of the tile\r\n const centerHeight = sampleGeoidFromList(\r\n center.longitude,\r\n center.latitude,\r\n geoidDataList\r\n );\r\n\r\n for (let i = 0; i < vertexCount; ++i) {\r\n const height = sampleGeoidFromList(\r\n center.longitude + CesiumMath.toRadians(scale_x * position[i * 3]),\r\n center.latitude + CesiumMath.toRadians(scale_y * position[i * 3 + 1]),\r\n geoidDataList\r\n );\r\n position[i * 3 + 2] += height - centerHeight;\r\n }\r\n}\r\n\r\nfunction transformToLocal(\r\n vertexCount,\r\n positions,\r\n normals,\r\n cartographicCenter,\r\n cartesianCenter,\r\n parentRotation,\r\n ellipsoidRadiiSquare,\r\n scale_x,\r\n scale_y\r\n) {\r\n if (vertexCount === 0 || !defined(positions) || positions.length === 0) {\r\n return;\r\n }\r\n\r\n const ellipsoid = new Ellipsoid(\r\n Math.sqrt(ellipsoidRadiiSquare.x),\r\n Math.sqrt(ellipsoidRadiiSquare.y),\r\n Math.sqrt(ellipsoidRadiiSquare.z)\r\n );\r\n for (let i = 0; i < vertexCount; ++i) {\r\n const indexOffset = i * 3;\r\n const indexOffset1 = indexOffset + 1;\r\n const indexOffset2 = indexOffset + 2;\r\n\r\n const cartographic = new Cartographic();\r\n cartographic.longitude =\r\n cartographicCenter.longitude +\r\n CesiumMath.toRadians(scale_x * positions[indexOffset]);\r\n\r\n cartographic.latitude =\r\n cartographicCenter.latitude +\r\n CesiumMath.toRadians(scale_y * positions[indexOffset1]);\r\n cartographic.height = cartographicCenter.height + positions[indexOffset2];\r\n\r\n const position = {};\r\n ellipsoid.cartographicToCartesian(cartographic, position);\r\n\r\n position.x -= cartesianCenter.x;\r\n position.y -= cartesianCenter.y;\r\n position.z -= cartesianCenter.z;\r\n\r\n const rotatedPosition = {};\r\n Matrix3.multiplyByVector(parentRotation, position, rotatedPosition);\r\n\r\n positions[indexOffset] = rotatedPosition.x;\r\n positions[indexOffset1] = rotatedPosition.y;\r\n positions[indexOffset2] = rotatedPosition.z;\r\n\r\n if (defined(normals)) {\r\n const normal = new Cartesian3(\r\n normals[indexOffset],\r\n normals[indexOffset1],\r\n normals[indexOffset2]\r\n );\r\n\r\n const rotatedNormal = {};\r\n Matrix3.multiplyByVector(parentRotation, normal, rotatedNormal);\r\n\r\n // TODO: check if normals are Z-UP or Y-UP and flip y and z\r\n normals[indexOffset] = rotatedNormal.x;\r\n normals[indexOffset1] = rotatedNormal.y;\r\n normals[indexOffset2] = rotatedNormal.z;\r\n }\r\n }\r\n}\r\n\r\nfunction cropUVs(vertexCount, uv0s, uvRegions) {\r\n for (let vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex) {\r\n const minU = uvRegions[vertexIndex * 4] / 65535.0;\r\n const minV = uvRegions[vertexIndex * 4 + 1] / 65535.0;\r\n const scaleU =\r\n (uvRegions[vertexIndex * 4 + 2] - uvRegions[vertexIndex * 4]) / 65535.0;\r\n const scaleV =\r\n (uvRegions[vertexIndex * 4 + 3] - uvRegions[vertexIndex * 4 + 1]) /\r\n 65535.0;\r\n\r\n uv0s[vertexIndex * 2] *= scaleU;\r\n uv0s[vertexIndex * 2] += minU;\r\n\r\n uv0s[vertexIndex * 2 + 1] *= scaleV;\r\n uv0s[vertexIndex * 2 + 1] += minV;\r\n }\r\n}\r\n\r\nfunction generateGltfBuffer(\r\n vertexCount,\r\n indices,\r\n positions,\r\n normals,\r\n uv0s,\r\n colors\r\n) {\r\n if (vertexCount === 0 || !defined(positions) || positions.length === 0) {\r\n return {\r\n buffers: [],\r\n bufferViews: [],\r\n accessors: [],\r\n meshes: [],\r\n nodes: [],\r\n nodesInScene: [],\r\n };\r\n }\r\n\r\n const buffers = [];\r\n const bufferViews = [];\r\n const accessors = [];\r\n const meshes = [];\r\n const nodes = [];\r\n const nodesInScene = [];\r\n\r\n // If we provide indices, then the vertex count is the length\r\n // of that array, otherwise we assume non-indexed triangle\r\n if (defined(indices)) {\r\n vertexCount = indices.length;\r\n }\r\n\r\n // Allocate array\r\n const indexArray = new Uint32Array(vertexCount);\r\n\r\n if (defined(indices)) {\r\n // Set the indices\r\n for (let vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex) {\r\n indexArray[vertexIndex] = indices[vertexIndex];\r\n }\r\n } else {\r\n // Generate indices\r\n for (\r\n let newVertexIndex = 0;\r\n newVertexIndex < vertexCount;\r\n ++newVertexIndex\r\n ) {\r\n indexArray[newVertexIndex] = newVertexIndex;\r\n }\r\n }\r\n\r\n // Push to the buffers, bufferViews and accessors\r\n const indicesBlob = new Blob([indexArray], { type: \"application/binary\" });\r\n const indicesURL = URL.createObjectURL(indicesBlob);\r\n\r\n const endIndex = vertexCount;\r\n\r\n // POSITIONS\r\n const meshPositions = positions.subarray(0, endIndex * 3);\r\n const positionsBlob = new Blob([meshPositions], {\r\n type: \"application/binary\",\r\n });\r\n const positionsURL = URL.createObjectURL(positionsBlob);\r\n\r\n let minX = Number.POSITIVE_INFINITY;\r\n let maxX = Number.NEGATIVE_INFINITY;\r\n let minY = Number.POSITIVE_INFINITY;\r\n let maxY = Number.NEGATIVE_INFINITY;\r\n let minZ = Number.POSITIVE_INFINITY;\r\n let maxZ = Number.NEGATIVE_INFINITY;\r\n\r\n for (let i = 0; i < meshPositions.length / 3; i++) {\r\n minX = Math.min(minX, meshPositions[i * 3 + 0]);\r\n maxX = Math.max(maxX, meshPositions[i * 3 + 0]);\r\n minY = Math.min(minY, meshPositions[i * 3 + 1]);\r\n maxY = Math.max(maxY, meshPositions[i * 3 + 1]);\r\n minZ = Math.min(minZ, meshPositions[i * 3 + 2]);\r\n maxZ = Math.max(maxZ, meshPositions[i * 3 + 2]);\r\n }\r\n\r\n // NORMALS\r\n const meshNormals = normals ? normals.subarray(0, endIndex * 3) : undefined;\r\n let normalsURL;\r\n if (defined(meshNormals)) {\r\n const normalsBlob = new Blob([meshNormals], {\r\n type: \"application/binary\",\r\n });\r\n normalsURL = URL.createObjectURL(normalsBlob);\r\n }\r\n\r\n // UV0s\r\n const meshUv0s = uv0s ? uv0s.subarray(0, endIndex * 2) : undefined;\r\n let uv0URL;\r\n if (defined(meshUv0s)) {\r\n const uv0Blob = new Blob([meshUv0s], { type: \"application/binary\" });\r\n uv0URL = URL.createObjectURL(uv0Blob);\r\n }\r\n\r\n // COLORS\r\n const meshColorsInBytes = defined(colors)\r\n ? colors.subarray(0, endIndex * 4)\r\n : undefined;\r\n let colorsURL;\r\n if (defined(meshColorsInBytes)) {\r\n const colorsBlob = new Blob([meshColorsInBytes], {\r\n type: \"application/binary\",\r\n });\r\n colorsURL = URL.createObjectURL(colorsBlob);\r\n }\r\n\r\n const posIndex = 0;\r\n let normalIndex = 0;\r\n let uv0Index = 0;\r\n let colorIndex = 0;\r\n let indicesIndex = 0;\r\n\r\n let currentIndex = posIndex;\r\n\r\n const attributes = {};\r\n\r\n // POSITIONS\r\n attributes.POSITION = posIndex;\r\n buffers.push({\r\n uri: positionsURL,\r\n byteLength: meshPositions.byteLength,\r\n });\r\n bufferViews.push({\r\n buffer: posIndex,\r\n byteOffset: 0,\r\n byteLength: meshPositions.byteLength,\r\n target: 34962,\r\n });\r\n accessors.push({\r\n bufferView: posIndex,\r\n byteOffset: 0,\r\n componentType: 5126,\r\n count: vertexCount,\r\n type: \"VEC3\",\r\n max: [minX, minY, minZ],\r\n min: [maxX, maxY, maxZ],\r\n });\r\n\r\n // NORMALS\r\n if (defined(normalsURL)) {\r\n ++currentIndex;\r\n normalIndex = currentIndex;\r\n attributes.NORMAL = normalIndex;\r\n buffers.push({\r\n uri: normalsURL,\r\n byteLength: meshNormals.byteLength,\r\n });\r\n bufferViews.push({\r\n buffer: normalIndex,\r\n byteOffset: 0,\r\n byteLength: meshNormals.byteLength,\r\n target: 34962,\r\n });\r\n accessors.push({\r\n bufferView: normalIndex,\r\n byteOffset: 0,\r\n componentType: 5126,\r\n count: vertexCount,\r\n type: \"VEC3\",\r\n });\r\n }\r\n\r\n // UV0\r\n if (defined(uv0URL)) {\r\n ++currentIndex;\r\n uv0Index = currentIndex;\r\n attributes.TEXCOORD_0 = uv0Index;\r\n buffers.push({\r\n uri: uv0URL,\r\n byteLength: meshUv0s.byteLength,\r\n });\r\n bufferViews.push({\r\n buffer: uv0Index,\r\n byteOffset: 0,\r\n byteLength: meshUv0s.byteLength,\r\n target: 34962,\r\n });\r\n accessors.push({\r\n bufferView: uv0Index,\r\n byteOffset: 0,\r\n componentType: 5126,\r\n count: vertexCount,\r\n type: \"VEC2\",\r\n });\r\n }\r\n\r\n // COLORS\r\n if (defined(colorsURL)) {\r\n ++currentIndex;\r\n colorIndex = currentIndex;\r\n attributes.COLOR_0 = colorIndex;\r\n buffers.push({\r\n uri: colorsURL,\r\n byteLength: meshColorsInBytes.byteLength,\r\n });\r\n bufferViews.push({\r\n buffer: colorIndex,\r\n byteOffset: 0,\r\n byteLength: meshColorsInBytes.byteLength,\r\n target: 34962,\r\n });\r\n accessors.push({\r\n bufferView: colorIndex,\r\n byteOffset: 0,\r\n componentType: 5121,\r\n normalized: true,\r\n count: vertexCount,\r\n type: \"VEC4\",\r\n });\r\n }\r\n\r\n // INDICES\r\n ++currentIndex;\r\n indicesIndex = currentIndex;\r\n buffers.push({\r\n uri: indicesURL,\r\n byteLength: indexArray.byteLength,\r\n });\r\n bufferViews.push({\r\n buffer: indicesIndex,\r\n byteOffset: 0,\r\n byteLength: indexArray.byteLength,\r\n target: 34963,\r\n });\r\n accessors.push({\r\n bufferView: indicesIndex,\r\n byteOffset: 0,\r\n componentType: 5125,\r\n count: vertexCount,\r\n type: \"SCALAR\",\r\n });\r\n\r\n // Create a new mesh for this page\r\n meshes.push({\r\n primitives: [\r\n {\r\n attributes: attributes,\r\n indices: indicesIndex,\r\n material: 0,\r\n },\r\n ],\r\n });\r\n nodesInScene.push(0);\r\n nodes.push({ mesh: 0 });\r\n\r\n return {\r\n buffers: buffers,\r\n bufferViews: bufferViews,\r\n accessors: accessors,\r\n meshes: meshes,\r\n nodes: nodes,\r\n nodesInScene: nodesInScene,\r\n };\r\n}\r\n\r\nfunction decode(data, schema, bufferInfo, featureData) {\r\n const magicNumber = new Uint8Array(data, 0, 5);\r\n if (\r\n magicNumber[0] === \"D\".charCodeAt() &&\r\n magicNumber[1] === \"R\".charCodeAt() &&\r\n magicNumber[2] === \"A\".charCodeAt() &&\r\n magicNumber[3] === \"C\".charCodeAt() &&\r\n magicNumber[4] === \"O\".charCodeAt()\r\n ) {\r\n return decodeDracoEncodedGeometry(data, bufferInfo);\r\n }\r\n return decodeBinaryGeometry(data, schema, bufferInfo, featureData);\r\n}\r\n\r\nfunction decodeDracoEncodedGeometry(data) {\r\n // Create the Draco decoder.\r\n const dracoDecoderModule = draco;\r\n const buffer = new dracoDecoderModule.DecoderBuffer();\r\n\r\n const byteArray = new Uint8Array(data);\r\n buffer.Init(byteArray, byteArray.length);\r\n\r\n // Create a buffer to hold the encoded data.\r\n const dracoDecoder = new dracoDecoderModule.Decoder();\r\n const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);\r\n const metadataQuerier = new dracoDecoderModule.MetadataQuerier();\r\n\r\n // Decode the encoded geometry.\r\n // See: https://github.com/google/draco/blob/master/src/draco/javascript/emscripten/draco_web_decoder.idl\r\n let dracoGeometry;\r\n let status;\r\n if (geometryType === dracoDecoderModule.TRIANGULAR_MESH) {\r\n dracoGeometry = new dracoDecoderModule.Mesh();\r\n status = dracoDecoder.DecodeBufferToMesh(buffer, dracoGeometry);\r\n }\r\n\r\n const decodedGeometry = {\r\n vertexCount: [0],\r\n featureCount: 0,\r\n };\r\n\r\n // if all is OK\r\n if (defined(status) && status.ok() && dracoGeometry.ptr !== 0) {\r\n const faceCount = dracoGeometry.num_faces();\r\n const attributesCount = dracoGeometry.num_attributes();\r\n const vertexCount = dracoGeometry.num_points();\r\n decodedGeometry.indices = new Uint32Array(faceCount * 3);\r\n const faces = decodedGeometry.indices;\r\n\r\n decodedGeometry.vertexCount[0] = vertexCount;\r\n decodedGeometry.scale_x = 1;\r\n decodedGeometry.scale_y = 1;\r\n\r\n // Decode faces\r\n // @TODO: Replace that code with GetTrianglesUInt32Array for better efficiency\r\n const face = new dracoDecoderModule.DracoInt32Array(3);\r\n for (let faceIndex = 0; faceIndex < faceCount; ++faceIndex) {\r\n dracoDecoder.GetFaceFromMesh(dracoGeometry, faceIndex, face);\r\n faces[faceIndex * 3] = face.GetValue(0);\r\n faces[faceIndex * 3 + 1] = face.GetValue(1);\r\n faces[faceIndex * 3 + 2] = face.GetValue(2);\r\n }\r\n\r\n dracoDecoderModule.destroy(face);\r\n\r\n for (let attrIndex = 0; attrIndex < attributesCount; ++attrIndex) {\r\n const dracoAttribute = dracoDecoder.GetAttribute(\r\n dracoGeometry,\r\n attrIndex\r\n );\r\n\r\n const attributeData = decodeDracoAttribute(\r\n dracoDecoderModule,\r\n dracoDecoder,\r\n dracoGeometry,\r\n dracoAttribute,\r\n vertexCount\r\n );\r\n\r\n // initial mapping\r\n const dracoAttributeType = dracoAttribute.attribute_type();\r\n let attributei3sName = \"unknown\";\r\n\r\n if (dracoAttributeType === dracoDecoderModule.POSITION) {\r\n attributei3sName = \"positions\";\r\n } else if (dracoAttributeType === dracoDecoderModule.NORMAL) {\r\n attributei3sName = \"normals\";\r\n } else if (dracoAttributeType === dracoDecoderModule.COLOR) {\r\n attributei3sName = \"colors\";\r\n } else if (dracoAttributeType === dracoDecoderModule.TEX_COORD) {\r\n attributei3sName = \"uv0s\";\r\n }\r\n\r\n // get the metadata\r\n const metadata = dracoDecoder.GetAttributeMetadata(\r\n dracoGeometry,\r\n attrIndex\r\n );\r\n\r\n if (metadata.ptr !== 0) {\r\n const numEntries = metadataQuerier.NumEntries(metadata);\r\n for (let entry = 0; entry < numEntries; ++entry) {\r\n const entryName = metadataQuerier.GetEntryName(metadata, entry);\r\n if (entryName === \"i3s-scale_x\") {\r\n decodedGeometry.scale_x = metadataQuerier.GetDoubleEntry(\r\n metadata,\r\n \"i3s-scale_x\"\r\n );\r\n } else if (entryName === \"i3s-scale_y\") {\r\n decodedGeometry.scale_y = metadataQuerier.GetDoubleEntry(\r\n metadata,\r\n \"i3s-scale_y\"\r\n );\r\n } else if (entryName === \"i3s-attribute-type\") {\r\n attributei3sName = metadataQuerier.GetStringEntry(\r\n metadata,\r\n \"i3s-attribute-type\"\r\n );\r\n }\r\n }\r\n }\r\n\r\n if (defined(decodedGeometry[attributei3sName])) {\r\n console.log(\"Attribute already exists\", attributei3sName);\r\n }\r\n\r\n decodedGeometry[attributei3sName] = attributeData;\r\n\r\n if (attributei3sName === \"feature-index\") {\r\n decodedGeometry.featureCount++;\r\n }\r\n }\r\n\r\n dracoDecoderModule.destroy(dracoGeometry);\r\n }\r\n\r\n dracoDecoderModule.destroy(metadataQuerier);\r\n dracoDecoderModule.destroy(dracoDecoder);\r\n\r\n return decodedGeometry;\r\n}\r\n\r\nfunction decodeDracoAttribute(\r\n dracoDecoderModule,\r\n dracoDecoder,\r\n dracoGeometry,\r\n dracoAttribute,\r\n vertexCount\r\n) {\r\n const bufferSize = dracoAttribute.num_components() * vertexCount;\r\n let dracoAttributeData;\r\n\r\n const handlers = [\r\n function () {}, // DT_INVALID - 0\r\n function () {\r\n // DT_INT8 - 1\r\n dracoAttributeData = new dracoDecoderModule.DracoInt8Array(bufferSize);\r\n const success = dracoDecoder.GetAttributeInt8ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n dracoAttributeData\r\n );\r\n\r\n if (!success) {\r\n console.error(\"Bad stream\");\r\n }\r\n const attributeData = new Int8Array(bufferSize);\r\n for (let i = 0; i < bufferSize; ++i) {\r\n attributeData[i] = dracoAttributeData.GetValue(i);\r\n }\r\n return attributeData;\r\n },\r\n function () {\r\n // DT_UINT8 - 2\r\n dracoAttributeData = new dracoDecoderModule.DracoInt8Array(bufferSize);\r\n const success = dracoDecoder.GetAttributeUInt8ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n dracoAttributeData\r\n );\r\n\r\n if (!success) {\r\n console.error(\"Bad stream\");\r\n }\r\n const attributeData = new Uint8Array(bufferSize);\r\n for (let i = 0; i < bufferSize; ++i) {\r\n attributeData[i] = dracoAttributeData.GetValue(i);\r\n }\r\n return attributeData;\r\n },\r\n function () {\r\n // DT_INT16 - 3\r\n dracoAttributeData = new dracoDecoderModule.DracoInt16Array(bufferSize);\r\n const success = dracoDecoder.GetAttributeInt16ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n dracoAttributeData\r\n );\r\n\r\n if (!success) {\r\n console.error(\"Bad stream\");\r\n }\r\n const attributeData = new Int16Array(bufferSize);\r\n for (let i = 0; i < bufferSize; ++i) {\r\n attributeData[i] = dracoAttributeData.GetValue(i);\r\n }\r\n return attributeData;\r\n },\r\n function () {\r\n // DT_UINT16 - 4\r\n dracoAttributeData = new dracoDecoderModule.DracoInt16Array(bufferSize);\r\n const success = dracoDecoder.GetAttributeUInt16ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n dracoAttributeData\r\n );\r\n\r\n if (!success) {\r\n console.error(\"Bad stream\");\r\n }\r\n const attributeData = new Uint16Array(bufferSize);\r\n for (let i = 0; i < bufferSize; ++i) {\r\n attributeData[i] = dracoAttributeData.GetValue(i);\r\n }\r\n return attributeData;\r\n },\r\n function () {\r\n // DT_INT32 - 5\r\n dracoAttributeData = new dracoDecoderModule.DracoInt32Array(bufferSize);\r\n const success = dracoDecoder.GetAttributeInt32ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n dracoAttributeData\r\n );\r\n\r\n if (!success) {\r\n console.error(\"Bad stream\");\r\n }\r\n const attributeData = new Int32Array(bufferSize);\r\n for (let i = 0; i < bufferSize; ++i) {\r\n attributeData[i] = dracoAttributeData.GetValue(i);\r\n }\r\n return attributeData;\r\n },\r\n function () {\r\n // DT_UINT32 - 6\r\n dracoAttributeData = new dracoDecoderModule.DracoInt32Array(bufferSize);\r\n const success = dracoDecoder.GetAttributeUInt32ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n dracoAttributeData\r\n );\r\n\r\n if (!success) {\r\n console.error(\"Bad stream\");\r\n }\r\n const attributeData = new Uint32Array(bufferSize);\r\n for (let i = 0; i < bufferSize; ++i) {\r\n attributeData[i] = dracoAttributeData.GetValue(i);\r\n }\r\n return attributeData;\r\n },\r\n function () {\r\n // DT_INT64 - 7\r\n },\r\n function () {\r\n // DT_UINT64 - 8\r\n },\r\n function () {\r\n // DT_FLOAT32 - 9\r\n dracoAttributeData = new dracoDecoderModule.DracoFloat32Array(bufferSize);\r\n const success = dracoDecoder.GetAttributeFloatForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n dracoAttributeData\r\n );\r\n\r\n if (!success) {\r\n console.error(\"Bad stream\");\r\n }\r\n const attributeData = new Float32Array(bufferSize);\r\n for (let i = 0; i < bufferSize; ++i) {\r\n attributeData[i] = dracoAttributeData.GetValue(i);\r\n }\r\n return attributeData;\r\n },\r\n function () {\r\n // DT_FLOAT64 - 10\r\n },\r\n function () {\r\n // DT_FLOAT32 - 11\r\n dracoAttributeData = new dracoDecoderModule.DracoUInt8Array(bufferSize);\r\n const success = dracoDecoder.GetAttributeUInt8ForAllPoints(\r\n dracoGeometry,\r\n dracoAttribute,\r\n dracoAttributeData\r\n );\r\n\r\n if (!success) {\r\n console.error(\"Bad stream\");\r\n }\r\n const attributeData = new Uint8Array(bufferSize);\r\n for (let i = 0; i < bufferSize; ++i) {\r\n attributeData[i] = dracoAttributeData.GetValue(i);\r\n }\r\n return attributeData;\r\n },\r\n ];\r\n\r\n const attributeData = handlers[dracoAttribute.data_type()]();\r\n\r\n if (defined(dracoAttributeData)) {\r\n dracoDecoderModule.destroy(dracoAttributeData);\r\n }\r\n\r\n return attributeData;\r\n}\r\n\r\nconst binaryAttributeDecoders = {\r\n position: function (decodedGeometry, data, offset) {\r\n const count = decodedGeometry.vertexCount * 3;\r\n decodedGeometry.positions = new Float32Array(data, offset, count);\r\n offset += count * 4;\r\n return offset;\r\n },\r\n normal: function (decodedGeometry, data, offset) {\r\n const count = decodedGeometry.vertexCount * 3;\r\n decodedGeometry.normals = new Float32Array(data, offset, count);\r\n offset += count * 4;\r\n return offset;\r\n },\r\n uv0: function (decodedGeometry, data, offset) {\r\n const count = decodedGeometry.vertexCount * 2;\r\n decodedGeometry.uv0s = new Float32Array(data, offset, count);\r\n offset += count * 4;\r\n return offset;\r\n },\r\n color: function (decodedGeometry, data, offset) {\r\n const count = decodedGeometry.vertexCount * 4;\r\n decodedGeometry.colors = new Uint8Array(data, offset, count);\r\n offset += count;\r\n return offset;\r\n },\r\n featureId: function (decodedGeometry, data, offset) {\r\n // We don't need to use this for anything so just increment the offset\r\n const count = decodedGeometry.featureCount;\r\n offset += count * 8;\r\n return offset;\r\n },\r\n id: function (decodedGeometry, data, offset) {\r\n // We don't need to use this for anything so just increment the offset\r\n const count = decodedGeometry.featureCount;\r\n offset += count * 8;\r\n return offset;\r\n },\r\n faceRange: function (decodedGeometry, data, offset) {\r\n const count = decodedGeometry.featureCount * 2;\r\n decodedGeometry.faceRange = new Uint32Array(data, offset, count);\r\n offset += count * 4;\r\n return offset;\r\n },\r\n uvRegion: function (decodedGeometry, data, offset) {\r\n const count = decodedGeometry.vertexCount * 4;\r\n decodedGeometry[\"uv-region\"] = new Uint16Array(data, offset, count);\r\n offset += count * 2;\r\n return offset;\r\n },\r\n region: function (decodedGeometry, data, offset) {\r\n const count = decodedGeometry.vertexCount * 4;\r\n decodedGeometry[\"uv-region\"] = new Uint16Array(data, offset, count);\r\n offset += count * 2;\r\n return offset;\r\n },\r\n};\r\n\r\nfunction decodeBinaryGeometry(data, schema, bufferInfo, featureData) {\r\n // From this spec:\r\n // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/defaultGeometrySchema.cmn.md\r\n const decodedGeometry = {\r\n vertexCount: 0,\r\n };\r\n\r\n const dataView = new DataView(data);\r\n\r\n try {\r\n let offset = 0;\r\n decodedGeometry.vertexCount = dataView.getUint32(offset, 1);\r\n offset += 4;\r\n\r\n decodedGeometry.featureCount = dataView.getUint32(offset, 1);\r\n offset += 4;\r\n\r\n if (defined(bufferInfo)) {\r\n for (\r\n let attrIndex = 0;\r\n attrIndex < bufferInfo.attributes.length;\r\n attrIndex++\r\n ) {\r\n if (\r\n defined(binaryAttributeDecoders[bufferInfo.attributes[attrIndex]])\r\n ) {\r\n offset = binaryAttributeDecoders[bufferInfo.attributes[attrIndex]](\r\n decodedGeometry,\r\n data,\r\n offset\r\n );\r\n } else {\r\n console.error(\r\n \"Unknown decoder for\",\r\n bufferInfo.attributes[attrIndex]\r\n );\r\n }\r\n }\r\n } else {\r\n let ordering = schema.ordering;\r\n let featureAttributeOrder = schema.featureAttributeOrder;\r\n\r\n if (\r\n defined(featureData) &&\r\n defined(featureData.geometryData) &&\r\n defined(featureData.geometryData[0]) &&\r\n defined(featureData.geometryData[0].params)\r\n ) {\r\n ordering = Object.keys(\r\n featureData.geometryData[0].params.vertexAttributes\r\n );\r\n featureAttributeOrder = Object.keys(\r\n featureData.geometryData[0].params.featureAttributes\r\n );\r\n }\r\n\r\n // Use default geometry schema\r\n for (let i = 0; i < ordering.length; i++) {\r\n const decoder = binaryAttributeDecoders[ordering[i]];\r\n if (!defined(decoder)) {\r\n console.log(ordering[i]);\r\n }\r\n offset = decoder(decodedGeometry, data, offset);\r\n }\r\n\r\n for (let j = 0; j < featureAttributeOrder.length; j++) {\r\n const curDecoder = binaryAttributeDecoders[featureAttributeOrder[j]];\r\n if (!defined(curDecoder)) {\r\n console.log(featureAttributeOrder[j]);\r\n }\r\n offset = curDecoder(decodedGeometry, data, offset);\r\n }\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n\r\n decodedGeometry.scale_x = 1;\r\n decodedGeometry.scale_y = 1;\r\n\r\n return decodedGeometry;\r\n}\r\n\r\nfunction decodeI3S(parameters) {\r\n // Decode the data into geometry\r\n const geometryData = decode(\r\n parameters.binaryData,\r\n parameters.schema,\r\n parameters.bufferInfo,\r\n parameters.featureData\r\n );\r\n\r\n // Adjust height from orthometric to ellipsoidal\r\n if (\r\n defined(parameters.geoidDataList) &&\r\n parameters.geoidDataList.length > 0\r\n ) {\r\n orthometricToEllipsoidal(\r\n geometryData.vertexCount,\r\n geometryData.positions,\r\n geometryData.scale_x,\r\n geometryData.scale_y,\r\n parameters.cartographicCenter,\r\n parameters.geoidDataList,\r\n false\r\n );\r\n }\r\n\r\n // Transform vertices to local\r\n transformToLocal(\r\n geometryData.vertexCount,\r\n geometryData.positions,\r\n geometryData.normals,\r\n parameters.cartographicCenter,\r\n parameters.cartesianCenter,\r\n parameters.parentRotation,\r\n parameters.ellipsoidRadiiSquare,\r\n geometryData.scale_x,\r\n geometryData.scale_y\r\n );\r\n\r\n // Adjust UVs if there is a UV region\r\n if (defined(geometryData.uv0s) && defined(geometryData[\"uv-region\"])) {\r\n cropUVs(\r\n geometryData.vertexCount,\r\n geometryData.uv0s,\r\n geometryData[\"uv-region\"]\r\n );\r\n }\r\n\r\n // Create the final buffer\r\n const meshData = generateGltfBuffer(\r\n geometryData.vertexCount,\r\n geometryData.indices,\r\n geometryData.positions,\r\n geometryData.normals,\r\n geometryData.uv0s,\r\n geometryData.colors\r\n );\r\n\r\n const customAttributes = {};\r\n if (defined(geometryData[\"feature-index\"])) {\r\n customAttributes.positions = geometryData.positions;\r\n customAttributes.indices = geometryData.indices;\r\n customAttributes.featureIndex = geometryData[\"feature-index\"];\r\n customAttributes.cartesianCenter = parameters.cartesianCenter;\r\n customAttributes.parentRotation = parameters.parentRotation;\r\n } else if (defined(geometryData[\"faceRange\"])) {\r\n customAttributes.positions = geometryData.positions;\r\n customAttributes.indices = geometryData.indices;\r\n customAttributes.sourceURL = parameters.url;\r\n customAttributes.cartesianCenter = parameters.cartesianCenter;\r\n customAttributes.parentRotation = parameters.parentRotation;\r\n\r\n // Build the feature index array from the faceRange.\r\n customAttributes.featureIndex = new Array(geometryData.positions.length);\r\n for (\r\n let range = 0;\r\n range < geometryData[\"faceRange\"].length - 1;\r\n range += 2\r\n ) {\r\n const curIndex = range / 2;\r\n const rangeStart = geometryData[\"faceRange\"][range];\r\n const rangeEnd = geometryData[\"faceRange\"][range + 1];\r\n for (let i = rangeStart; i <= rangeEnd; i++) {\r\n customAttributes.featureIndex[i * 3] = curIndex;\r\n customAttributes.featureIndex[i * 3 + 1] = curIndex;\r\n customAttributes.featureIndex[i * 3 + 2] = curIndex;\r\n }\r\n }\r\n }\r\n\r\n meshData._customAttributes = customAttributes;\r\n\r\n const results = {\r\n meshData: meshData,\r\n };\r\n\r\n return results;\r\n}\r\n\r\nfunction initWorker(dracoModule) {\r\n draco = dracoModule;\r\n self.onmessage = createTaskProcessorWorker(decodeI3S);\r\n self.postMessage(true);\r\n}\r\n\r\nfunction decodeI3SStart(event) {\r\n const data = event.data;\r\n\r\n // Expect the first message to be to load a web assembly module\r\n const wasmConfig = data.webAssemblyConfig;\r\n if (defined(wasmConfig)) {\r\n // Require and compile WebAssembly module, or use fallback if not supported\r\n return require([wasmConfig.modulePath], function (dracoModule) {\r\n if (defined(wasmConfig.wasmBinaryFile)) {\r\n if (!defined(dracoModule)) {\r\n dracoModule = self.DracoDecoderModule;\r\n }\r\n\r\n dracoModule(wasmConfig).then(function (compiledModule) {\r\n initWorker(compiledModule);\r\n });\r\n } else {\r\n initWorker(dracoModule());\r\n }\r\n });\r\n }\r\n}\r\n\r\nexport default decodeI3SStart;\r\n"],"names":["Cartesian3","WebMercatorProjection","Ellipsoid","Cartographic","CesiumMath","defined","Matrix3"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;AASA;EACA,IAAI,KAAK,CAAC;AACV;EACA,SAAS,mBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;EACzD,EAAE,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;EACtC,E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,OAAO,CAAC;EACjB,CAAC;AACD;EACA,SAAS,UAAU,CAAC,WAAW,EAAE;EACjC,EAAE,KAAK,GAAG,WAAW,CAAC;EACtB,EAAE,IAAI,CAAC,SAAS,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;EACxD,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;EACzB,CAAC;AACD;EACA,SAAS,cAAc,CAAC,KAAK,EAAE;EAC/B,EAAE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AAC1B;EACA;EACA,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC;EAC5C,EAAE,IAAIA,oBAAO,CAAC,UAAU,CAAC,EAAE;EAC3B;EACA,IAAI,OAAO,OAAO,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,UAAU,WAAW,EAAE;EACnE,MAAM,IAAIA,oBAAO,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE;EAC9C,QAAQ,IAAI,CAACA,oBAAO,CAAC,WAAW,CAAC,EAAE;EACnC,UAAU,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC;EAChD,SAAS;AACT;EACA,QAAQ,WAAW,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,cAAc,EAAE;EAC/D,UAAU,UAAU,CAAC,cAAc,CAAC,CAAC;EACrC,SAAS,CAAC,CAAC;EACX,OAAO,MAAM;EACb,QAAQ,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;EAClC,OAAO;EACP,KAAK,CAAC,CAAC;EACP,GAAG;EACH;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/defaultValue-0ab18f7d.js b/examples/cesium/Workers/defaultValue-0ab18f7d.js
new file mode 100644
index 0000000..74ee026
--- /dev/null
+++ b/examples/cesium/Workers/defaultValue-0ab18f7d.js
@@ -0,0 +1,77 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['exports'], (function (exports) { 'use strict';
+
+ /**
+ * @function
+ *
+ * @param {*} value The object.
+ * @returns {Boolean} Returns true if the object is defined, returns false otherwise.
+ *
+ * @example
+ * if (Cesium.defined(positions)) {
+ * doSomething();
+ * } else {
+ * doSomethingElse();
+ * }
+ */
+ function defined(value) {
+ return value !== undefined && value !== null;
+ }
+
+ /**
+ * Returns the first parameter if not undefined, otherwise the second parameter.
+ * Useful for setting a default value for a parameter.
+ *
+ * @function
+ *
+ * @param {*} a
+ * @param {*} b
+ * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter.
+ *
+ * @example
+ * param = Cesium.defaultValue(param, 'default');
+ */
+ function defaultValue(a, b) {
+ if (a !== undefined && a !== null) {
+ return a;
+ }
+ return b;
+ }
+
+ /**
+ * A frozen empty object that can be used as the default value for options passed as
+ * an object literal.
+ * @type {Object}
+ * @memberof defaultValue
+ */
+ defaultValue.EMPTY_OBJECT = Object.freeze({});
+
+ exports.defaultValue = defaultValue;
+ exports.defined = defined;
+
+}));
+//# sourceMappingURL=defaultValue-0ab18f7d.js.map
diff --git a/examples/cesium/Workers/defaultValue-0ab18f7d.js.map b/examples/cesium/Workers/defaultValue-0ab18f7d.js.map
new file mode 100644
index 0000000..0bc8624
--- /dev/null
+++ b/examples/cesium/Workers/defaultValue-0ab18f7d.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"defaultValue-0ab18f7d.js","sources":["../../../Source/Core/defined.js","../../../Source/Core/defaultValue.js"],"sourcesContent":["/**\r\n * @function\r\n *\r\n * @param {*} value The object.\r\n * @returns {Boolean} Returns true if the object is defined, returns false otherwise.\r\n *\r\n * @example\r\n * if (Cesium.defined(positions)) {\r\n * doSomething();\r\n * } else {\r\n * doSomethingElse();\r\n * }\r\n */\r\nfunction defined(value) {\r\n return value !== undefined && value !== null;\r\n}\r\nexport default defined;\r\n","/**\r\n * Returns the first parameter if not undefined, otherwise the second parameter.\r\n * Useful for setting a default value for a parameter.\r\n *\r\n * @function\r\n *\r\n * @param {*} a\r\n * @param {*} b\r\n * @returns {*} Returns the first parameter if not undefined, otherwise the second parameter.\r\n *\r\n * @example\r\n * param = Cesium.defaultValue(param, 'default');\r\n */\r\nfunction defaultValue(a, b) {\r\n if (a !== undefined && a !== null) {\r\n return a;\r\n }\r\n return b;\r\n}\r\n\r\n/**\r\n * A frozen empty object that can be used as the default value for options passed as\r\n * an object literal.\r\n * @type {Object}\r\n * @memberof defaultValue\r\n */\r\ndefaultValue.EMPTY_OBJECT = Object.freeze({});\r\n\r\nexport default defaultValue;\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,OAAO,CAAC,KAAK,EAAE;EACxB,EAAE,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;EAC/C;;ECfA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAAS,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE;EAC5B,EAAE,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,EAAE;EACrC,IAAI,OAAO,CAAC,CAAC;EACb,GAAG;EACH,EAAE,OAAO,CAAC,CAAC;EACX,CAAC;AACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY,CAAC,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/package.js b/examples/cesium/Workers/package.js
new file mode 100644
index 0000000..cfe829c
--- /dev/null
+++ b/examples/cesium/Workers/package.js
@@ -0,0 +1,26 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+module.exports = { type: "commonjs" };
diff --git a/examples/cesium/Workers/package.json b/examples/cesium/Workers/package.json
new file mode 100644
index 0000000..0292b99
--- /dev/null
+++ b/examples/cesium/Workers/package.json
@@ -0,0 +1 @@
+{"type":"commonjs"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/transcodeKTX2.js b/examples/cesium/Workers/transcodeKTX2.js
new file mode 100644
index 0000000..d8691f9
--- /dev/null
+++ b/examples/cesium/Workers/transcodeKTX2.js
@@ -0,0 +1,1542 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./defaultValue-0ab18f7d', './Check-d10e5f2e', './WebGLConstants-f27a5e29', './RuntimeError-e5c6a8b9', './createTaskProcessorWorker'], (function (defaultValue, Check, WebGLConstants, RuntimeError, createTaskProcessorWorker) { 'use strict';
+
+ /**
+ * The data type of a pixel.
+ *
+ * @enum {Number}
+ * @see PostProcessStage
+ */
+ const PixelDatatype = {
+ UNSIGNED_BYTE: WebGLConstants.WebGLConstants.UNSIGNED_BYTE,
+ UNSIGNED_SHORT: WebGLConstants.WebGLConstants.UNSIGNED_SHORT,
+ UNSIGNED_INT: WebGLConstants.WebGLConstants.UNSIGNED_INT,
+ FLOAT: WebGLConstants.WebGLConstants.FLOAT,
+ HALF_FLOAT: WebGLConstants.WebGLConstants.HALF_FLOAT_OES,
+ UNSIGNED_INT_24_8: WebGLConstants.WebGLConstants.UNSIGNED_INT_24_8,
+ UNSIGNED_SHORT_4_4_4_4: WebGLConstants.WebGLConstants.UNSIGNED_SHORT_4_4_4_4,
+ UNSIGNED_SHORT_5_5_5_1: WebGLConstants.WebGLConstants.UNSIGNED_SHORT_5_5_5_1,
+ UNSIGNED_SHORT_5_6_5: WebGLConstants.WebGLConstants.UNSIGNED_SHORT_5_6_5,
+ };
+
+ /**
+ @private
+ */
+ PixelDatatype.toWebGLConstant = function (pixelDatatype, context) {
+ switch (pixelDatatype) {
+ case PixelDatatype.UNSIGNED_BYTE:
+ return WebGLConstants.WebGLConstants.UNSIGNED_BYTE;
+ case PixelDatatype.UNSIGNED_SHORT:
+ return WebGLConstants.WebGLConstants.UNSIGNED_SHORT;
+ case PixelDatatype.UNSIGNED_INT:
+ return WebGLConstants.WebGLConstants.UNSIGNED_INT;
+ case PixelDatatype.FLOAT:
+ return WebGLConstants.WebGLConstants.FLOAT;
+ case PixelDatatype.HALF_FLOAT:
+ return context.webgl2
+ ? WebGLConstants.WebGLConstants.HALF_FLOAT
+ : WebGLConstants.WebGLConstants.HALF_FLOAT_OES;
+ case PixelDatatype.UNSIGNED_INT_24_8:
+ return WebGLConstants.WebGLConstants.UNSIGNED_INT_24_8;
+ case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:
+ return WebGLConstants.WebGLConstants.UNSIGNED_SHORT_4_4_4_4;
+ case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:
+ return WebGLConstants.WebGLConstants.UNSIGNED_SHORT_5_5_5_1;
+ case PixelDatatype.UNSIGNED_SHORT_5_6_5:
+ return PixelDatatype.UNSIGNED_SHORT_5_6_5;
+ }
+ };
+
+ /**
+ @private
+ */
+ PixelDatatype.isPacked = function (pixelDatatype) {
+ return (
+ pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 ||
+ pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 ||
+ pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 ||
+ pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5
+ );
+ };
+
+ /**
+ @private
+ */
+ PixelDatatype.sizeInBytes = function (pixelDatatype) {
+ switch (pixelDatatype) {
+ case PixelDatatype.UNSIGNED_BYTE:
+ return 1;
+ case PixelDatatype.UNSIGNED_SHORT:
+ case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:
+ case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:
+ case PixelDatatype.UNSIGNED_SHORT_5_6_5:
+ case PixelDatatype.HALF_FLOAT:
+ return 2;
+ case PixelDatatype.UNSIGNED_INT:
+ case PixelDatatype.FLOAT:
+ case PixelDatatype.UNSIGNED_INT_24_8:
+ return 4;
+ }
+ };
+
+ /**
+ @private
+ */
+ PixelDatatype.validate = function (pixelDatatype) {
+ return (
+ pixelDatatype === PixelDatatype.UNSIGNED_BYTE ||
+ pixelDatatype === PixelDatatype.UNSIGNED_SHORT ||
+ pixelDatatype === PixelDatatype.UNSIGNED_INT ||
+ pixelDatatype === PixelDatatype.FLOAT ||
+ pixelDatatype === PixelDatatype.HALF_FLOAT ||
+ pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 ||
+ pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 ||
+ pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 ||
+ pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5
+ );
+ };
+
+ var PixelDatatype$1 = Object.freeze(PixelDatatype);
+
+ /**
+ * The format of a pixel, i.e., the number of components it has and what they represent.
+ *
+ * @enum {Number}
+ */
+ const PixelFormat = {
+ /**
+ * A pixel format containing a depth value.
+ *
+ * @type {Number}
+ * @constant
+ */
+ DEPTH_COMPONENT: WebGLConstants.WebGLConstants.DEPTH_COMPONENT,
+
+ /**
+ * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.
+ *
+ * @type {Number}
+ * @constant
+ */
+ DEPTH_STENCIL: WebGLConstants.WebGLConstants.DEPTH_STENCIL,
+
+ /**
+ * A pixel format containing an alpha channel.
+ *
+ * @type {Number}
+ * @constant
+ */
+ ALPHA: WebGLConstants.WebGLConstants.ALPHA,
+
+ /**
+ * A pixel format containing red, green, and blue channels.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGB: WebGLConstants.WebGLConstants.RGB,
+
+ /**
+ * A pixel format containing red, green, blue, and alpha channels.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGBA: WebGLConstants.WebGLConstants.RGBA,
+
+ /**
+ * A pixel format containing a luminance (intensity) channel.
+ *
+ * @type {Number}
+ * @constant
+ */
+ LUMINANCE: WebGLConstants.WebGLConstants.LUMINANCE,
+
+ /**
+ * A pixel format containing luminance (intensity) and alpha channels.
+ *
+ * @type {Number}
+ * @constant
+ */
+ LUMINANCE_ALPHA: WebGLConstants.WebGLConstants.LUMINANCE_ALPHA,
+
+ /**
+ * A pixel format containing red, green, and blue channels that is DXT1 compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGB_DXT1: WebGLConstants.WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,
+
+ /**
+ * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGBA_DXT1: WebGLConstants.WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,
+
+ /**
+ * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGBA_DXT3: WebGLConstants.WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,
+
+ /**
+ * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGBA_DXT5: WebGLConstants.WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,
+
+ /**
+ * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGB_PVRTC_4BPPV1: WebGLConstants.WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
+
+ /**
+ * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGB_PVRTC_2BPPV1: WebGLConstants.WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
+
+ /**
+ * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGBA_PVRTC_4BPPV1: WebGLConstants.WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
+
+ /**
+ * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGBA_PVRTC_2BPPV1: WebGLConstants.WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
+
+ /**
+ * A pixel format containing red, green, blue, and alpha channels that is ASTC compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGBA_ASTC: WebGLConstants.WebGLConstants.COMPRESSED_RGBA_ASTC_4x4_WEBGL,
+
+ /**
+ * A pixel format containing red, green, and blue channels that is ETC1 compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGB_ETC1: WebGLConstants.WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,
+
+ /**
+ * A pixel format containing red, green, and blue channels that is ETC2 compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGB8_ETC2: WebGLConstants.WebGLConstants.COMPRESSED_RGB8_ETC2,
+
+ /**
+ * A pixel format containing red, green, blue, and alpha channels that is ETC2 compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGBA8_ETC2_EAC: WebGLConstants.WebGLConstants.COMPRESSED_RGBA8_ETC2_EAC,
+
+ /**
+ * A pixel format containing red, green, blue, and alpha channels that is BC7 compressed.
+ *
+ * @type {Number}
+ * @constant
+ */
+ RGBA_BC7: WebGLConstants.WebGLConstants.COMPRESSED_RGBA_BPTC_UNORM,
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.componentsLength = function (pixelFormat) {
+ switch (pixelFormat) {
+ case PixelFormat.RGB:
+ return 3;
+ case PixelFormat.RGBA:
+ return 4;
+ case PixelFormat.LUMINANCE_ALPHA:
+ return 2;
+ case PixelFormat.ALPHA:
+ case PixelFormat.LUMINANCE:
+ return 1;
+ default:
+ return 1;
+ }
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.validate = function (pixelFormat) {
+ return (
+ pixelFormat === PixelFormat.DEPTH_COMPONENT ||
+ pixelFormat === PixelFormat.DEPTH_STENCIL ||
+ pixelFormat === PixelFormat.ALPHA ||
+ pixelFormat === PixelFormat.RGB ||
+ pixelFormat === PixelFormat.RGBA ||
+ pixelFormat === PixelFormat.LUMINANCE ||
+ pixelFormat === PixelFormat.LUMINANCE_ALPHA ||
+ pixelFormat === PixelFormat.RGB_DXT1 ||
+ pixelFormat === PixelFormat.RGBA_DXT1 ||
+ pixelFormat === PixelFormat.RGBA_DXT3 ||
+ pixelFormat === PixelFormat.RGBA_DXT5 ||
+ pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||
+ pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||
+ pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||
+ pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 ||
+ pixelFormat === PixelFormat.RGBA_ASTC ||
+ pixelFormat === PixelFormat.RGB_ETC1 ||
+ pixelFormat === PixelFormat.RGB8_ETC2 ||
+ pixelFormat === PixelFormat.RGBA8_ETC2_EAC ||
+ pixelFormat === PixelFormat.RGBA_BC7
+ );
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.isColorFormat = function (pixelFormat) {
+ return (
+ pixelFormat === PixelFormat.ALPHA ||
+ pixelFormat === PixelFormat.RGB ||
+ pixelFormat === PixelFormat.RGBA ||
+ pixelFormat === PixelFormat.LUMINANCE ||
+ pixelFormat === PixelFormat.LUMINANCE_ALPHA
+ );
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.isDepthFormat = function (pixelFormat) {
+ return (
+ pixelFormat === PixelFormat.DEPTH_COMPONENT ||
+ pixelFormat === PixelFormat.DEPTH_STENCIL
+ );
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.isCompressedFormat = function (pixelFormat) {
+ return (
+ pixelFormat === PixelFormat.RGB_DXT1 ||
+ pixelFormat === PixelFormat.RGBA_DXT1 ||
+ pixelFormat === PixelFormat.RGBA_DXT3 ||
+ pixelFormat === PixelFormat.RGBA_DXT5 ||
+ pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||
+ pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||
+ pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||
+ pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 ||
+ pixelFormat === PixelFormat.RGBA_ASTC ||
+ pixelFormat === PixelFormat.RGB_ETC1 ||
+ pixelFormat === PixelFormat.RGB8_ETC2 ||
+ pixelFormat === PixelFormat.RGBA8_ETC2_EAC ||
+ pixelFormat === PixelFormat.RGBA_BC7
+ );
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.isDXTFormat = function (pixelFormat) {
+ return (
+ pixelFormat === PixelFormat.RGB_DXT1 ||
+ pixelFormat === PixelFormat.RGBA_DXT1 ||
+ pixelFormat === PixelFormat.RGBA_DXT3 ||
+ pixelFormat === PixelFormat.RGBA_DXT5
+ );
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.isPVRTCFormat = function (pixelFormat) {
+ return (
+ pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||
+ pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||
+ pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||
+ pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1
+ );
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.isASTCFormat = function (pixelFormat) {
+ return pixelFormat === PixelFormat.RGBA_ASTC;
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.isETC1Format = function (pixelFormat) {
+ return pixelFormat === PixelFormat.RGB_ETC1;
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.isETC2Format = function (pixelFormat) {
+ return (
+ pixelFormat === PixelFormat.RGB8_ETC2 ||
+ pixelFormat === PixelFormat.RGBA8_ETC2_EAC
+ );
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.isBC7Format = function (pixelFormat) {
+ return pixelFormat === PixelFormat.RGBA_BC7;
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.compressedTextureSizeInBytes = function (
+ pixelFormat,
+ width,
+ height
+ ) {
+ switch (pixelFormat) {
+ case PixelFormat.RGB_DXT1:
+ case PixelFormat.RGBA_DXT1:
+ case PixelFormat.RGB_ETC1:
+ case PixelFormat.RGB8_ETC2:
+ return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;
+
+ case PixelFormat.RGBA_DXT3:
+ case PixelFormat.RGBA_DXT5:
+ case PixelFormat.RGBA_ASTC:
+ case PixelFormat.RGBA8_ETC2_EAC:
+ return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;
+
+ case PixelFormat.RGB_PVRTC_4BPPV1:
+ case PixelFormat.RGBA_PVRTC_4BPPV1:
+ return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8);
+
+ case PixelFormat.RGB_PVRTC_2BPPV1:
+ case PixelFormat.RGBA_PVRTC_2BPPV1:
+ return Math.floor(
+ (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8
+ );
+
+ case PixelFormat.RGBA_BC7:
+ return Math.ceil(width / 4) * Math.ceil(height / 4) * 16;
+
+ default:
+ return 0;
+ }
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.textureSizeInBytes = function (
+ pixelFormat,
+ pixelDatatype,
+ width,
+ height
+ ) {
+ let componentsLength = PixelFormat.componentsLength(pixelFormat);
+ if (PixelDatatype$1.isPacked(pixelDatatype)) {
+ componentsLength = 1;
+ }
+ return (
+ componentsLength * PixelDatatype$1.sizeInBytes(pixelDatatype) * width * height
+ );
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.alignmentInBytes = function (pixelFormat, pixelDatatype, width) {
+ const mod =
+ PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, width, 1) % 4;
+ return mod === 0 ? 4 : mod === 2 ? 2 : 1;
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.createTypedArray = function (
+ pixelFormat,
+ pixelDatatype,
+ width,
+ height
+ ) {
+ let constructor;
+ const sizeInBytes = PixelDatatype$1.sizeInBytes(pixelDatatype);
+ if (sizeInBytes === Uint8Array.BYTES_PER_ELEMENT) {
+ constructor = Uint8Array;
+ } else if (sizeInBytes === Uint16Array.BYTES_PER_ELEMENT) {
+ constructor = Uint16Array;
+ } else if (
+ sizeInBytes === Float32Array.BYTES_PER_ELEMENT &&
+ pixelDatatype === PixelDatatype$1.FLOAT
+ ) {
+ constructor = Float32Array;
+ } else {
+ constructor = Uint32Array;
+ }
+
+ const size = PixelFormat.componentsLength(pixelFormat) * width * height;
+ return new constructor(size);
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.flipY = function (
+ bufferView,
+ pixelFormat,
+ pixelDatatype,
+ width,
+ height
+ ) {
+ if (height === 1) {
+ return bufferView;
+ }
+ const flipped = PixelFormat.createTypedArray(
+ pixelFormat,
+ pixelDatatype,
+ width,
+ height
+ );
+ const numberOfComponents = PixelFormat.componentsLength(pixelFormat);
+ const textureWidth = width * numberOfComponents;
+ for (let i = 0; i < height; ++i) {
+ const row = i * width * numberOfComponents;
+ const flippedRow = (height - i - 1) * width * numberOfComponents;
+ for (let j = 0; j < textureWidth; ++j) {
+ flipped[flippedRow + j] = bufferView[row + j];
+ }
+ }
+ return flipped;
+ };
+
+ /**
+ * @private
+ */
+ PixelFormat.toInternalFormat = function (pixelFormat, pixelDatatype, context) {
+ // WebGL 1 require internalFormat to be the same as PixelFormat
+ if (!context.webgl2) {
+ return pixelFormat;
+ }
+
+ // Convert pixelFormat to correct internalFormat for WebGL 2
+ if (pixelFormat === PixelFormat.DEPTH_STENCIL) {
+ return WebGLConstants.WebGLConstants.DEPTH24_STENCIL8;
+ }
+
+ if (pixelFormat === PixelFormat.DEPTH_COMPONENT) {
+ if (pixelDatatype === PixelDatatype$1.UNSIGNED_SHORT) {
+ return WebGLConstants.WebGLConstants.DEPTH_COMPONENT16;
+ } else if (pixelDatatype === PixelDatatype$1.UNSIGNED_INT) {
+ return WebGLConstants.WebGLConstants.DEPTH_COMPONENT24;
+ }
+ }
+
+ if (pixelDatatype === PixelDatatype$1.FLOAT) {
+ switch (pixelFormat) {
+ case PixelFormat.RGBA:
+ return WebGLConstants.WebGLConstants.RGBA32F;
+ case PixelFormat.RGB:
+ return WebGLConstants.WebGLConstants.RGB32F;
+ case PixelFormat.RG:
+ return WebGLConstants.WebGLConstants.RG32F;
+ case PixelFormat.R:
+ return WebGLConstants.WebGLConstants.R32F;
+ }
+ }
+
+ if (pixelDatatype === PixelDatatype$1.HALF_FLOAT) {
+ switch (pixelFormat) {
+ case PixelFormat.RGBA:
+ return WebGLConstants.WebGLConstants.RGBA16F;
+ case PixelFormat.RGB:
+ return WebGLConstants.WebGLConstants.RGB16F;
+ case PixelFormat.RG:
+ return WebGLConstants.WebGLConstants.RG16F;
+ case PixelFormat.R:
+ return WebGLConstants.WebGLConstants.R16F;
+ }
+ }
+
+ return pixelFormat;
+ };
+
+ var PixelFormat$1 = Object.freeze(PixelFormat);
+
+ /**
+ * Enum containing Vulkan Constant values by name.
+ *
+ * These match the constants from the {@link https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-definition|Vulkan 1.2 specification}.
+ *
+ * @enum {Number}
+ * @private
+ */
+ const VulkanConstants = {
+ VK_FORMAT_UNDEFINED: 0,
+ VK_FORMAT_R4G4_UNORM_PACK8: 1,
+ VK_FORMAT_R4G4B4A4_UNORM_PACK16: 2,
+ VK_FORMAT_B4G4R4A4_UNORM_PACK16: 3,
+ VK_FORMAT_R5G6B5_UNORM_PACK16: 4,
+ VK_FORMAT_B5G6R5_UNORM_PACK16: 5,
+ VK_FORMAT_R5G5B5A1_UNORM_PACK16: 6,
+ VK_FORMAT_B5G5R5A1_UNORM_PACK16: 7,
+ VK_FORMAT_A1R5G5B5_UNORM_PACK16: 8,
+ VK_FORMAT_R8_UNORM: 9,
+ VK_FORMAT_R8_SNORM: 10,
+ VK_FORMAT_R8_USCALED: 11,
+ VK_FORMAT_R8_SSCALED: 12,
+ VK_FORMAT_R8_UINT: 13,
+ VK_FORMAT_R8_SINT: 14,
+ VK_FORMAT_R8_SRGB: 15,
+ VK_FORMAT_R8G8_UNORM: 16,
+ VK_FORMAT_R8G8_SNORM: 17,
+ VK_FORMAT_R8G8_USCALED: 18,
+ VK_FORMAT_R8G8_SSCALED: 19,
+ VK_FORMAT_R8G8_UINT: 20,
+ VK_FORMAT_R8G8_SINT: 21,
+ VK_FORMAT_R8G8_SRGB: 22,
+ VK_FORMAT_R8G8B8_UNORM: 23,
+ VK_FORMAT_R8G8B8_SNORM: 24,
+ VK_FORMAT_R8G8B8_USCALED: 25,
+ VK_FORMAT_R8G8B8_SSCALED: 26,
+ VK_FORMAT_R8G8B8_UINT: 27,
+ VK_FORMAT_R8G8B8_SINT: 28,
+ VK_FORMAT_R8G8B8_SRGB: 29,
+ VK_FORMAT_B8G8R8_UNORM: 30,
+ VK_FORMAT_B8G8R8_SNORM: 31,
+ VK_FORMAT_B8G8R8_USCALED: 32,
+ VK_FORMAT_B8G8R8_SSCALED: 33,
+ VK_FORMAT_B8G8R8_UINT: 34,
+ VK_FORMAT_B8G8R8_SINT: 35,
+ VK_FORMAT_B8G8R8_SRGB: 36,
+ VK_FORMAT_R8G8B8A8_UNORM: 37,
+ VK_FORMAT_R8G8B8A8_SNORM: 38,
+ VK_FORMAT_R8G8B8A8_USCALED: 39,
+ VK_FORMAT_R8G8B8A8_SSCALED: 40,
+ VK_FORMAT_R8G8B8A8_UINT: 41,
+ VK_FORMAT_R8G8B8A8_SINT: 42,
+ VK_FORMAT_R8G8B8A8_SRGB: 43,
+ VK_FORMAT_B8G8R8A8_UNORM: 44,
+ VK_FORMAT_B8G8R8A8_SNORM: 45,
+ VK_FORMAT_B8G8R8A8_USCALED: 46,
+ VK_FORMAT_B8G8R8A8_SSCALED: 47,
+ VK_FORMAT_B8G8R8A8_UINT: 48,
+ VK_FORMAT_B8G8R8A8_SINT: 49,
+ VK_FORMAT_B8G8R8A8_SRGB: 50,
+ VK_FORMAT_A8B8G8R8_UNORM_PACK32: 51,
+ VK_FORMAT_A8B8G8R8_SNORM_PACK32: 52,
+ VK_FORMAT_A8B8G8R8_USCALED_PACK32: 53,
+ VK_FORMAT_A8B8G8R8_SSCALED_PACK32: 54,
+ VK_FORMAT_A8B8G8R8_UINT_PACK32: 55,
+ VK_FORMAT_A8B8G8R8_SINT_PACK32: 56,
+ VK_FORMAT_A8B8G8R8_SRGB_PACK32: 57,
+ VK_FORMAT_A2R10G10B10_UNORM_PACK32: 58,
+ VK_FORMAT_A2R10G10B10_SNORM_PACK32: 59,
+ VK_FORMAT_A2R10G10B10_USCALED_PACK32: 60,
+ VK_FORMAT_A2R10G10B10_SSCALED_PACK32: 61,
+ VK_FORMAT_A2R10G10B10_UINT_PACK32: 62,
+ VK_FORMAT_A2R10G10B10_SINT_PACK32: 63,
+ VK_FORMAT_A2B10G10R10_UNORM_PACK32: 64,
+ VK_FORMAT_A2B10G10R10_SNORM_PACK32: 65,
+ VK_FORMAT_A2B10G10R10_USCALED_PACK32: 66,
+ VK_FORMAT_A2B10G10R10_SSCALED_PACK32: 67,
+ VK_FORMAT_A2B10G10R10_UINT_PACK32: 68,
+ VK_FORMAT_A2B10G10R10_SINT_PACK32: 69,
+ VK_FORMAT_R16_UNORM: 70,
+ VK_FORMAT_R16_SNORM: 71,
+ VK_FORMAT_R16_USCALED: 72,
+ VK_FORMAT_R16_SSCALED: 73,
+ VK_FORMAT_R16_UINT: 74,
+ VK_FORMAT_R16_SINT: 75,
+ VK_FORMAT_R16_SFLOAT: 76,
+ VK_FORMAT_R16G16_UNORM: 77,
+ VK_FORMAT_R16G16_SNORM: 78,
+ VK_FORMAT_R16G16_USCALED: 79,
+ VK_FORMAT_R16G16_SSCALED: 80,
+ VK_FORMAT_R16G16_UINT: 81,
+ VK_FORMAT_R16G16_SINT: 82,
+ VK_FORMAT_R16G16_SFLOAT: 83,
+ VK_FORMAT_R16G16B16_UNORM: 84,
+ VK_FORMAT_R16G16B16_SNORM: 85,
+ VK_FORMAT_R16G16B16_USCALED: 86,
+ VK_FORMAT_R16G16B16_SSCALED: 87,
+ VK_FORMAT_R16G16B16_UINT: 88,
+ VK_FORMAT_R16G16B16_SINT: 89,
+ VK_FORMAT_R16G16B16_SFLOAT: 90,
+ VK_FORMAT_R16G16B16A16_UNORM: 91,
+ VK_FORMAT_R16G16B16A16_SNORM: 92,
+ VK_FORMAT_R16G16B16A16_USCALED: 93,
+ VK_FORMAT_R16G16B16A16_SSCALED: 94,
+ VK_FORMAT_R16G16B16A16_UINT: 95,
+ VK_FORMAT_R16G16B16A16_SINT: 96,
+ VK_FORMAT_R16G16B16A16_SFLOAT: 97,
+ VK_FORMAT_R32_UINT: 98,
+ VK_FORMAT_R32_SINT: 99,
+ VK_FORMAT_R32_SFLOAT: 100,
+ VK_FORMAT_R32G32_UINT: 101,
+ VK_FORMAT_R32G32_SINT: 102,
+ VK_FORMAT_R32G32_SFLOAT: 103,
+ VK_FORMAT_R32G32B32_UINT: 104,
+ VK_FORMAT_R32G32B32_SINT: 105,
+ VK_FORMAT_R32G32B32_SFLOAT: 106,
+ VK_FORMAT_R32G32B32A32_UINT: 107,
+ VK_FORMAT_R32G32B32A32_SINT: 108,
+ VK_FORMAT_R32G32B32A32_SFLOAT: 109,
+ VK_FORMAT_R64_UINT: 110,
+ VK_FORMAT_R64_SINT: 111,
+ VK_FORMAT_R64_SFLOAT: 112,
+ VK_FORMAT_R64G64_UINT: 113,
+ VK_FORMAT_R64G64_SINT: 114,
+ VK_FORMAT_R64G64_SFLOAT: 115,
+ VK_FORMAT_R64G64B64_UINT: 116,
+ VK_FORMAT_R64G64B64_SINT: 117,
+ VK_FORMAT_R64G64B64_SFLOAT: 118,
+ VK_FORMAT_R64G64B64A64_UINT: 119,
+ VK_FORMAT_R64G64B64A64_SINT: 120,
+ VK_FORMAT_R64G64B64A64_SFLOAT: 121,
+ VK_FORMAT_B10G11R11_UFLOAT_PACK32: 122,
+ VK_FORMAT_E5B9G9R9_UFLOAT_PACK32: 123,
+ VK_FORMAT_D16_UNORM: 124,
+ VK_FORMAT_X8_D24_UNORM_PACK32: 125,
+ VK_FORMAT_D32_SFLOAT: 126,
+ VK_FORMAT_S8_UINT: 127,
+ VK_FORMAT_D16_UNORM_S8_UINT: 128,
+ VK_FORMAT_D24_UNORM_S8_UINT: 129,
+ VK_FORMAT_D32_SFLOAT_S8_UINT: 130,
+ VK_FORMAT_BC1_RGB_UNORM_BLOCK: 131,
+ VK_FORMAT_BC1_RGB_SRGB_BLOCK: 132,
+ VK_FORMAT_BC1_RGBA_UNORM_BLOCK: 133,
+ VK_FORMAT_BC1_RGBA_SRGB_BLOCK: 134,
+ VK_FORMAT_BC2_UNORM_BLOCK: 135,
+ VK_FORMAT_BC2_SRGB_BLOCK: 136,
+ VK_FORMAT_BC3_UNORM_BLOCK: 137,
+ VK_FORMAT_BC3_SRGB_BLOCK: 138,
+ VK_FORMAT_BC4_UNORM_BLOCK: 139,
+ VK_FORMAT_BC4_SNORM_BLOCK: 140,
+ VK_FORMAT_BC5_UNORM_BLOCK: 141,
+ VK_FORMAT_BC5_SNORM_BLOCK: 142,
+ VK_FORMAT_BC6H_UFLOAT_BLOCK: 143,
+ VK_FORMAT_BC6H_SFLOAT_BLOCK: 144,
+ VK_FORMAT_BC7_UNORM_BLOCK: 145,
+ VK_FORMAT_BC7_SRGB_BLOCK: 146,
+ VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: 147,
+ VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: 148,
+ VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: 149,
+ VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: 150,
+ VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: 151,
+ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: 152,
+ VK_FORMAT_EAC_R11_UNORM_BLOCK: 153,
+ VK_FORMAT_EAC_R11_SNORM_BLOCK: 154,
+ VK_FORMAT_EAC_R11G11_UNORM_BLOCK: 155,
+ VK_FORMAT_EAC_R11G11_SNORM_BLOCK: 156,
+ VK_FORMAT_ASTC_4x4_UNORM_BLOCK: 157,
+ VK_FORMAT_ASTC_4x4_SRGB_BLOCK: 158,
+ VK_FORMAT_ASTC_5x4_UNORM_BLOCK: 159,
+ VK_FORMAT_ASTC_5x4_SRGB_BLOCK: 160,
+ VK_FORMAT_ASTC_5x5_UNORM_BLOCK: 161,
+ VK_FORMAT_ASTC_5x5_SRGB_BLOCK: 162,
+ VK_FORMAT_ASTC_6x5_UNORM_BLOCK: 163,
+ VK_FORMAT_ASTC_6x5_SRGB_BLOCK: 164,
+ VK_FORMAT_ASTC_6x6_UNORM_BLOCK: 165,
+ VK_FORMAT_ASTC_6x6_SRGB_BLOCK: 166,
+ VK_FORMAT_ASTC_8x5_UNORM_BLOCK: 167,
+ VK_FORMAT_ASTC_8x5_SRGB_BLOCK: 168,
+ VK_FORMAT_ASTC_8x6_UNORM_BLOCK: 169,
+ VK_FORMAT_ASTC_8x6_SRGB_BLOCK: 170,
+ VK_FORMAT_ASTC_8x8_UNORM_BLOCK: 171,
+ VK_FORMAT_ASTC_8x8_SRGB_BLOCK: 172,
+ VK_FORMAT_ASTC_10x5_UNORM_BLOCK: 173,
+ VK_FORMAT_ASTC_10x5_SRGB_BLOCK: 174,
+ VK_FORMAT_ASTC_10x6_UNORM_BLOCK: 175,
+ VK_FORMAT_ASTC_10x6_SRGB_BLOCK: 176,
+ VK_FORMAT_ASTC_10x8_UNORM_BLOCK: 177,
+ VK_FORMAT_ASTC_10x8_SRGB_BLOCK: 178,
+ VK_FORMAT_ASTC_10x10_UNORM_BLOCK: 179,
+ VK_FORMAT_ASTC_10x10_SRGB_BLOCK: 180,
+ VK_FORMAT_ASTC_12x10_UNORM_BLOCK: 181,
+ VK_FORMAT_ASTC_12x10_SRGB_BLOCK: 182,
+ VK_FORMAT_ASTC_12x12_UNORM_BLOCK: 183,
+ VK_FORMAT_ASTC_12x12_SRGB_BLOCK: 184,
+ VK_FORMAT_G8B8G8R8_422_UNORM: 1000156000,
+ VK_FORMAT_B8G8R8G8_422_UNORM: 1000156001,
+ VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: 1000156002,
+ VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: 1000156003,
+ VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM: 1000156004,
+ VK_FORMAT_G8_B8R8_2PLANE_422_UNORM: 1000156005,
+ VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM: 1000156006,
+ VK_FORMAT_R10X6_UNORM_PACK16: 1000156007,
+ VK_FORMAT_R10X6G10X6_UNORM_2PACK16: 1000156008,
+ VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16: 1000156009,
+ VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: 1000156010,
+ VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: 1000156011,
+ VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: 1000156012,
+ VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: 1000156013,
+ VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: 1000156014,
+ VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: 1000156015,
+ VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: 1000156016,
+ VK_FORMAT_R12X4_UNORM_PACK16: 1000156017,
+ VK_FORMAT_R12X4G12X4_UNORM_2PACK16: 1000156018,
+ VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16: 1000156019,
+ VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: 1000156020,
+ VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: 1000156021,
+ VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: 1000156022,
+ VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: 1000156023,
+ VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: 1000156024,
+ VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: 1000156025,
+ VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: 1000156026,
+ VK_FORMAT_G16B16G16R16_422_UNORM: 1000156027,
+ VK_FORMAT_B16G16R16G16_422_UNORM: 1000156028,
+ VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM: 1000156029,
+ VK_FORMAT_G16_B16R16_2PLANE_420_UNORM: 1000156030,
+ VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM: 1000156031,
+ VK_FORMAT_G16_B16R16_2PLANE_422_UNORM: 1000156032,
+ VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM: 1000156033,
+ VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG: 1000054000,
+ VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG: 1000054001,
+ VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG: 1000054002,
+ VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG: 1000054003,
+ VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG: 1000054004,
+ VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG: 1000054005,
+ VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG: 1000054006,
+ VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: 1000054007,
+ VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT: 1000066000,
+ VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT: 1000066001,
+ VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT: 1000066002,
+ VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT: 1000066003,
+ VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT: 1000066004,
+ VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT: 1000066005,
+ VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT: 1000066006,
+ VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT: 1000066007,
+ VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT: 1000066008,
+ VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT: 1000066009,
+ VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT: 1000066010,
+ VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT: 1000066011,
+ VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT: 1000066012,
+ VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT: 1000066013,
+ VK_FORMAT_G8B8G8R8_422_UNORM_KHR: 1000156000,
+ VK_FORMAT_B8G8R8G8_422_UNORM_KHR: 1000156001,
+ VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR: 1000156002,
+ VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR: 1000156003,
+ VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR: 1000156004,
+ VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR: 1000156005,
+ VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR: 1000156006,
+ VK_FORMAT_R10X6_UNORM_PACK16_KHR: 1000156007,
+ VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR: 1000156008,
+ VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR: 1000156009,
+ VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR: 1000156010,
+ VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR: 1000156011,
+ VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR: 1000156012,
+ VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR: 1000156013,
+ VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR: 1000156014,
+ VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR: 1000156015,
+ VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR: 1000156016,
+ VK_FORMAT_R12X4_UNORM_PACK16_KHR: 1000156017,
+ VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR: 1000156018,
+ VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR: 1000156019,
+ VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR: 1000156020,
+ VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR: 1000156021,
+ VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR: 1000156022,
+ VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR: 1000156023,
+ VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR: 1000156024,
+ VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR: 1000156025,
+ VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR: 1000156026,
+ VK_FORMAT_G16B16G16R16_422_UNORM_KHR: 1000156027,
+ VK_FORMAT_B16G16R16G16_422_UNORM_KHR: 1000156028,
+ VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR: 1000156029,
+ VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR: 1000156030,
+ VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR: 1000156031,
+ VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR: 1000156032,
+ VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR: 1000156033,
+ };
+ var VulkanConstants$1 = Object.freeze(VulkanConstants);
+
+ ///////////////////////////////////////////////////
+ // KTX2 Header.
+ ///////////////////////////////////////////////////
+ const KHR_SUPERCOMPRESSION_NONE = 0;
+ // Data Format Descriptor (DFD).
+ ///////////////////////////////////////////////////
+
+ const KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT = 0;
+ const KHR_DF_VENDORID_KHRONOS = 0;
+ const KHR_DF_VERSION = 2;
+ const KHR_DF_MODEL_UNSPECIFIED = 0;
+ const KHR_DF_FLAG_ALPHA_STRAIGHT = 0;
+ const KHR_DF_TRANSFER_SRGB = 2;
+ const KHR_DF_PRIMARIES_BT709 = 1;
+ const KHR_DF_SAMPLE_DATATYPE_SIGNED = 0x40;
+ // VK FORMAT.
+ ///////////////////////////////////////////////////
+
+ const VK_FORMAT_UNDEFINED = 0;
+
+ /**
+ * Represents an unpacked KTX 2.0 texture container. Data for individual mip levels are stored in
+ * the `.levels` array, typically compressed in Basis Universal formats. Additional properties
+ * provide metadata required to process, transcode, and upload these textures.
+ */
+
+ class KTX2Container {
+ constructor() {
+ this.vkFormat = VK_FORMAT_UNDEFINED;
+ this.typeSize = 1;
+ this.pixelWidth = 0;
+ this.pixelHeight = 0;
+ this.pixelDepth = 0;
+ this.layerCount = 0;
+ this.faceCount = 1;
+ this.supercompressionScheme = KHR_SUPERCOMPRESSION_NONE;
+ this.levels = [];
+ this.dataFormatDescriptor = [{
+ vendorId: KHR_DF_VENDORID_KHRONOS,
+ descriptorType: KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT,
+ descriptorBlockSize: 0,
+ versionNumber: KHR_DF_VERSION,
+ colorModel: KHR_DF_MODEL_UNSPECIFIED,
+ colorPrimaries: KHR_DF_PRIMARIES_BT709,
+ transferFunction: KHR_DF_TRANSFER_SRGB,
+ flags: KHR_DF_FLAG_ALPHA_STRAIGHT,
+ texelBlockDimension: [0, 0, 0, 0],
+ bytesPlane: [0, 0, 0, 0, 0, 0, 0, 0],
+ samples: []
+ }];
+ this.keyValue = {};
+ this.globalData = null;
+ }
+
+ }
+
+ class BufferReader {
+ constructor(data, byteOffset, byteLength, littleEndian) {
+ this._dataView = void 0;
+ this._littleEndian = void 0;
+ this._offset = void 0;
+ this._dataView = new DataView(data.buffer, data.byteOffset + byteOffset, byteLength);
+ this._littleEndian = littleEndian;
+ this._offset = 0;
+ }
+
+ _nextUint8() {
+ const value = this._dataView.getUint8(this._offset);
+
+ this._offset += 1;
+ return value;
+ }
+
+ _nextUint16() {
+ const value = this._dataView.getUint16(this._offset, this._littleEndian);
+
+ this._offset += 2;
+ return value;
+ }
+
+ _nextUint32() {
+ const value = this._dataView.getUint32(this._offset, this._littleEndian);
+
+ this._offset += 4;
+ return value;
+ }
+
+ _nextUint64() {
+ const left = this._dataView.getUint32(this._offset, this._littleEndian);
+
+ const right = this._dataView.getUint32(this._offset + 4, this._littleEndian); // TODO(cleanup): Just test this...
+ // const value = this._littleEndian ? left + (2 ** 32 * right) : (2 ** 32 * left) + right;
+
+
+ const value = left + 2 ** 32 * right;
+ this._offset += 8;
+ return value;
+ }
+
+ _nextInt32() {
+ const value = this._dataView.getInt32(this._offset, this._littleEndian);
+
+ this._offset += 4;
+ return value;
+ }
+
+ _skip(bytes) {
+ this._offset += bytes;
+ return this;
+ }
+
+ _scan(maxByteLength, term = 0x00) {
+ const byteOffset = this._offset;
+ let byteLength = 0;
+
+ while (this._dataView.getUint8(this._offset) !== term && byteLength < maxByteLength) {
+ byteLength++;
+ this._offset++;
+ }
+
+ if (byteLength < maxByteLength) this._offset++;
+ return new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + byteOffset, byteLength);
+ }
+
+ }
+ // KTX2 Header.
+ ///////////////////////////////////////////////////
+
+ const KTX2_ID = [// '´', 'K', 'T', 'X', '2', '0', 'ª', '\r', '\n', '\x1A', '\n'
+ 0xab, 0x4b, 0x54, 0x58, 0x20, 0x32, 0x30, 0xbb, 0x0d, 0x0a, 0x1a, 0x0a];
+ /** Decodes an ArrayBuffer to text. */
+
+ function decodeText(buffer) {
+ if (typeof TextDecoder !== 'undefined') {
+ return new TextDecoder().decode(buffer);
+ }
+
+ return Buffer.from(buffer).toString('utf8');
+ }
+
+ /**
+ * Parses a KTX 2.0 file, returning an unpacked {@link KTX2Container} instance with all associated
+ * data. The container's mip levels and other binary data are pointers into the original file, not
+ * copies, so the original file should not be overwritten after reading.
+ *
+ * @param data Bytes of KTX 2.0 file, as Uint8Array or Buffer.
+ */
+
+ function read(data) {
+ ///////////////////////////////////////////////////
+ // KTX 2.0 Identifier.
+ ///////////////////////////////////////////////////
+ const id = new Uint8Array(data.buffer, data.byteOffset, KTX2_ID.length);
+
+ if (id[0] !== KTX2_ID[0] || // '´'
+ id[1] !== KTX2_ID[1] || // 'K'
+ id[2] !== KTX2_ID[2] || // 'T'
+ id[3] !== KTX2_ID[3] || // 'X'
+ id[4] !== KTX2_ID[4] || // ' '
+ id[5] !== KTX2_ID[5] || // '2'
+ id[6] !== KTX2_ID[6] || // '0'
+ id[7] !== KTX2_ID[7] || // 'ª'
+ id[8] !== KTX2_ID[8] || // '\r'
+ id[9] !== KTX2_ID[9] || // '\n'
+ id[10] !== KTX2_ID[10] || // '\x1A'
+ id[11] !== KTX2_ID[11] // '\n'
+ ) {
+ throw new Error('Missing KTX 2.0 identifier.');
+ }
+
+ const container = new KTX2Container(); ///////////////////////////////////////////////////
+ // Header.
+ ///////////////////////////////////////////////////
+
+ const headerByteLength = 17 * Uint32Array.BYTES_PER_ELEMENT;
+ const headerReader = new BufferReader(data, KTX2_ID.length, headerByteLength, true);
+ container.vkFormat = headerReader._nextUint32();
+ container.typeSize = headerReader._nextUint32();
+ container.pixelWidth = headerReader._nextUint32();
+ container.pixelHeight = headerReader._nextUint32();
+ container.pixelDepth = headerReader._nextUint32();
+ container.layerCount = headerReader._nextUint32();
+ container.faceCount = headerReader._nextUint32();
+
+ const levelCount = headerReader._nextUint32();
+
+ container.supercompressionScheme = headerReader._nextUint32();
+
+ const dfdByteOffset = headerReader._nextUint32();
+
+ const dfdByteLength = headerReader._nextUint32();
+
+ const kvdByteOffset = headerReader._nextUint32();
+
+ const kvdByteLength = headerReader._nextUint32();
+
+ const sgdByteOffset = headerReader._nextUint64();
+
+ const sgdByteLength = headerReader._nextUint64(); ///////////////////////////////////////////////////
+ // Level Index.
+ ///////////////////////////////////////////////////
+
+
+ const levelByteLength = levelCount * 3 * 8;
+ const levelReader = new BufferReader(data, KTX2_ID.length + headerByteLength, levelByteLength, true);
+
+ for (let i = 0; i < levelCount; i++) {
+ container.levels.push({
+ levelData: new Uint8Array(data.buffer, data.byteOffset + levelReader._nextUint64(), levelReader._nextUint64()),
+ uncompressedByteLength: levelReader._nextUint64()
+ });
+ } ///////////////////////////////////////////////////
+ // Data Format Descriptor (DFD).
+ ///////////////////////////////////////////////////
+
+
+ const dfdReader = new BufferReader(data, dfdByteOffset, dfdByteLength, true);
+ const dfd = {
+ vendorId: dfdReader._skip(4
+ /* totalSize */
+ )._nextUint16(),
+ descriptorType: dfdReader._nextUint16(),
+ versionNumber: dfdReader._nextUint16(),
+ descriptorBlockSize: dfdReader._nextUint16(),
+ colorModel: dfdReader._nextUint8(),
+ colorPrimaries: dfdReader._nextUint8(),
+ transferFunction: dfdReader._nextUint8(),
+ flags: dfdReader._nextUint8(),
+ texelBlockDimension: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],
+ bytesPlane: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],
+ samples: []
+ };
+ const sampleStart = 6;
+ const sampleWords = 4;
+ const numSamples = (dfd.descriptorBlockSize / 4 - sampleStart) / sampleWords;
+
+ for (let i = 0; i < numSamples; i++) {
+ const sample = {
+ bitOffset: dfdReader._nextUint16(),
+ bitLength: dfdReader._nextUint8(),
+ channelType: dfdReader._nextUint8(),
+ samplePosition: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],
+ sampleLower: -Infinity,
+ sampleUpper: Infinity
+ };
+
+ if (sample.channelType & KHR_DF_SAMPLE_DATATYPE_SIGNED) {
+ sample.sampleLower = dfdReader._nextInt32();
+ sample.sampleUpper = dfdReader._nextInt32();
+ } else {
+ sample.sampleLower = dfdReader._nextUint32();
+ sample.sampleUpper = dfdReader._nextUint32();
+ }
+
+ dfd.samples[i] = sample;
+ }
+
+ container.dataFormatDescriptor.length = 0;
+ container.dataFormatDescriptor.push(dfd); ///////////////////////////////////////////////////
+ // Key/Value Data (KVD).
+ ///////////////////////////////////////////////////
+
+ const kvdReader = new BufferReader(data, kvdByteOffset, kvdByteLength, true);
+
+ while (kvdReader._offset < kvdByteLength) {
+ const keyValueByteLength = kvdReader._nextUint32();
+
+ const keyData = kvdReader._scan(keyValueByteLength);
+
+ const key = decodeText(keyData);
+
+ const valueData = kvdReader._scan(keyValueByteLength - keyData.byteLength);
+
+ container.keyValue[key] = key.match(/^ktx/i) ? decodeText(valueData) : valueData; // 4-byte alignment.
+
+ if (kvdReader._offset % 4) kvdReader._skip(4 - kvdReader._offset % 4);
+ } ///////////////////////////////////////////////////
+ // Supercompression Global Data (SGD).
+ ///////////////////////////////////////////////////
+
+
+ if (sgdByteLength <= 0) return container;
+ const sgdReader = new BufferReader(data, sgdByteOffset, sgdByteLength, true);
+
+ const endpointCount = sgdReader._nextUint16();
+
+ const selectorCount = sgdReader._nextUint16();
+
+ const endpointsByteLength = sgdReader._nextUint32();
+
+ const selectorsByteLength = sgdReader._nextUint32();
+
+ const tablesByteLength = sgdReader._nextUint32();
+
+ const extendedByteLength = sgdReader._nextUint32();
+
+ const imageDescs = [];
+
+ for (let i = 0; i < levelCount; i++) {
+ imageDescs.push({
+ imageFlags: sgdReader._nextUint32(),
+ rgbSliceByteOffset: sgdReader._nextUint32(),
+ rgbSliceByteLength: sgdReader._nextUint32(),
+ alphaSliceByteOffset: sgdReader._nextUint32(),
+ alphaSliceByteLength: sgdReader._nextUint32()
+ });
+ }
+
+ const endpointsByteOffset = sgdByteOffset + sgdReader._offset;
+ const selectorsByteOffset = endpointsByteOffset + endpointsByteLength;
+ const tablesByteOffset = selectorsByteOffset + selectorsByteLength;
+ const extendedByteOffset = tablesByteOffset + tablesByteLength;
+ const endpointsData = new Uint8Array(data.buffer, data.byteOffset + endpointsByteOffset, endpointsByteLength);
+ const selectorsData = new Uint8Array(data.buffer, data.byteOffset + selectorsByteOffset, selectorsByteLength);
+ const tablesData = new Uint8Array(data.buffer, data.byteOffset + tablesByteOffset, tablesByteLength);
+ const extendedData = new Uint8Array(data.buffer, data.byteOffset + extendedByteOffset, extendedByteLength);
+ container.globalData = {
+ endpointCount,
+ selectorCount,
+ imageDescs,
+ endpointsData,
+ selectorsData,
+ tablesData,
+ extendedData
+ };
+ return container;
+ }
+
+ /* global require */
+
+ const faceOrder = [
+ "positiveX",
+ "negativeX",
+ "positiveY",
+ "negativeY",
+ "positiveZ",
+ "negativeZ",
+ ];
+
+ // Flags
+ const colorModelETC1S = 163;
+ const colorModelUASTC = 166;
+
+ let transcoderModule;
+ function transcode(parameters, transferableObjects) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.object("transcoderModule", transcoderModule);
+ //>>includeEnd('debug');
+
+ const data = parameters.ktx2Buffer;
+ const supportedTargetFormats = parameters.supportedTargetFormats;
+ let header;
+ try {
+ header = read(data);
+ } catch (e) {
+ throw new RuntimeError.RuntimeError("Invalid KTX2 file.");
+ }
+
+ if (header.layerCount !== 0) {
+ throw new RuntimeError.RuntimeError("KTX2 texture arrays are not supported.");
+ }
+
+ if (header.pixelDepth !== 0) {
+ throw new RuntimeError.RuntimeError("KTX2 3D textures are unsupported.");
+ }
+
+ const dfd = header.dataFormatDescriptor[0];
+ const result = new Array(header.levelCount);
+
+ if (
+ header.vkFormat === 0x0 &&
+ (dfd.colorModel === colorModelETC1S || dfd.colorModel === colorModelUASTC)
+ ) {
+ // Compressed, initialize transcoder module
+ transcodeCompressed(
+ data,
+ header,
+ supportedTargetFormats,
+ transcoderModule,
+ transferableObjects,
+ result
+ );
+ } else {
+ transferableObjects.push(data.buffer);
+ parseUncompressed(header, result);
+ }
+
+ return result;
+ }
+
+ // Parser for uncompressed
+ function parseUncompressed(header, result) {
+ const internalFormat =
+ header.vkFormat === VulkanConstants$1.VK_FORMAT_R8G8B8_SRGB
+ ? PixelFormat$1.RGB
+ : PixelFormat$1.RGBA;
+ let datatype;
+ if (header.vkFormat === VulkanConstants$1.VK_FORMAT_R8G8B8A8_UNORM) {
+ datatype = PixelDatatype$1.UNSIGNED_BYTE;
+ } else if (
+ header.vkFormat === VulkanConstants$1.VK_FORMAT_R16G16B16A16_SFLOAT
+ ) {
+ datatype = PixelDatatype$1.HALF_FLOAT;
+ } else if (
+ header.vkFormat === VulkanConstants$1.VK_FORMAT_R32G32B32A32_SFLOAT
+ ) {
+ datatype = PixelDatatype$1.FLOAT;
+ }
+
+ for (let i = 0; i < header.levels.length; ++i) {
+ const level = {};
+ result[i] = level;
+ const levelBuffer = header.levels[i].levelData;
+
+ const width = header.pixelWidth >> i;
+ const height = header.pixelHeight >> i;
+ const faceLength =
+ width * height * PixelFormat$1.componentsLength(internalFormat);
+
+ for (let j = 0; j < header.faceCount; ++j) {
+ // multiply levelBuffer.byteOffset by the size in bytes of the pixel data type
+ const faceByteOffset =
+ levelBuffer.byteOffset + faceLength * header.typeSize * j;
+ let faceView;
+ if (!defaultValue.defined(datatype) || PixelDatatype$1.sizeInBytes(datatype) === 1) {
+ faceView = new Uint8Array(
+ levelBuffer.buffer,
+ faceByteOffset,
+ faceLength
+ );
+ } else if (PixelDatatype$1.sizeInBytes(datatype) === 2) {
+ faceView = new Uint16Array(
+ levelBuffer.buffer,
+ faceByteOffset,
+ faceLength
+ );
+ } else {
+ faceView = new Float32Array(
+ levelBuffer.buffer,
+ faceByteOffset,
+ faceLength
+ );
+ }
+
+ level[faceOrder[j]] = {
+ internalFormat: internalFormat,
+ datatype: datatype,
+ width: width,
+ height: height,
+ levelBuffer: faceView,
+ };
+ }
+ }
+ }
+
+ function transcodeCompressed(
+ data,
+ header,
+ supportedTargetFormats,
+ transcoderModule,
+ transferableObjects,
+ result
+ ) {
+ const ktx2File = new transcoderModule.KTX2File(data);
+ let width = ktx2File.getWidth();
+ let height = ktx2File.getHeight();
+ const levels = ktx2File.getLevels();
+ const hasAlpha = ktx2File.getHasAlpha();
+
+ if (!(width > 0) || !(height > 0) || !(levels > 0)) {
+ ktx2File.close();
+ ktx2File.delete();
+ throw new RuntimeError.RuntimeError("Invalid KTX2 file");
+ }
+
+ let internalFormat, transcoderFormat;
+ const dfd = header.dataFormatDescriptor[0];
+ const BasisFormat = transcoderModule.transcoder_texture_format;
+
+ // Determine target format based on platform support
+ if (dfd.colorModel === colorModelETC1S) {
+ if (supportedTargetFormats.etc) {
+ internalFormat = hasAlpha
+ ? PixelFormat$1.RGBA8_ETC2_EAC
+ : PixelFormat$1.RGB8_ETC2;
+ transcoderFormat = hasAlpha
+ ? BasisFormat.cTFETC2_RGBA
+ : BasisFormat.cTFETC1_RGB;
+ } else if (supportedTargetFormats.etc1 && !hasAlpha) {
+ internalFormat = PixelFormat$1.RGB_ETC1;
+ transcoderFormat = BasisFormat.cTFETC1_RGB;
+ } else if (supportedTargetFormats.s3tc) {
+ internalFormat = hasAlpha ? PixelFormat$1.RGBA_DXT5 : PixelFormat$1.RGB_DXT1;
+ transcoderFormat = hasAlpha
+ ? BasisFormat.cTFBC3_RGBA
+ : BasisFormat.cTFBC1_RGB;
+ } else if (supportedTargetFormats.pvrtc) {
+ internalFormat = hasAlpha
+ ? PixelFormat$1.RGBA_PVRTC_4BPPV1
+ : PixelFormat$1.RGB_PVRTC_4BPPV1;
+ transcoderFormat = hasAlpha
+ ? BasisFormat.cTFPVRTC1_4_RGBA
+ : BasisFormat.cTFPVRTC1_4_RGB;
+ } else if (supportedTargetFormats.astc) {
+ internalFormat = PixelFormat$1.RGBA_ASTC;
+ transcoderFormat = BasisFormat.cTFASTC_4x4_RGBA;
+ } else if (supportedTargetFormats.bc7) {
+ internalFormat = PixelFormat$1.RGBA_BC7;
+ transcoderFormat = BasisFormat.cTFBC7_RGBA;
+ } else {
+ throw new RuntimeError.RuntimeError(
+ "No transcoding format target available for ETC1S compressed ktx2."
+ );
+ }
+ } else if (dfd.colorModel === colorModelUASTC) {
+ if (supportedTargetFormats.astc) {
+ internalFormat = PixelFormat$1.RGBA_ASTC;
+ transcoderFormat = BasisFormat.cTFASTC_4x4_RGBA;
+ } else if (supportedTargetFormats.bc7) {
+ internalFormat = PixelFormat$1.RGBA_BC7;
+ transcoderFormat = BasisFormat.cTFBC7_RGBA;
+ } else if (supportedTargetFormats.s3tc) {
+ internalFormat = hasAlpha ? PixelFormat$1.RGBA_DXT5 : PixelFormat$1.RGB_DXT1;
+ transcoderFormat = hasAlpha
+ ? BasisFormat.cTFBC3_RGBA
+ : BasisFormat.cTFBC1_RGB;
+ } else if (supportedTargetFormats.etc) {
+ internalFormat = hasAlpha
+ ? PixelFormat$1.RGBA8_ETC2_EAC
+ : PixelFormat$1.RGB8_ETC2;
+ transcoderFormat = hasAlpha
+ ? BasisFormat.cTFETC2_RGBA
+ : BasisFormat.cTFETC1_RGB;
+ } else if (supportedTargetFormats.etc1 && !hasAlpha) {
+ internalFormat = PixelFormat$1.RGB_ETC1;
+ transcoderFormat = BasisFormat.cTFETC1_RGB;
+ } else if (supportedTargetFormats.pvrtc) {
+ internalFormat = hasAlpha
+ ? PixelFormat$1.RGBA_PVRTC_4BPPV1
+ : PixelFormat$1.RGB_PVRTC_4BPPV1;
+ transcoderFormat = hasAlpha
+ ? BasisFormat.cTFPVRTC1_4_RGBA
+ : BasisFormat.cTFPVRTC1_4_RGB;
+ } else {
+ throw new RuntimeError.RuntimeError(
+ "No transcoding format target available for UASTC compressed ktx2."
+ );
+ }
+ }
+
+ if (!ktx2File.startTranscoding()) {
+ ktx2File.close();
+ ktx2File.delete();
+ throw new RuntimeError.RuntimeError("startTranscoding() failed");
+ }
+
+ for (let i = 0; i < header.levels.length; ++i) {
+ const level = {};
+ result[i] = level;
+ width = header.pixelWidth >> i;
+ height = header.pixelHeight >> i;
+
+ // Since supercompressed cubemaps are unsupported, this function
+ // does not iterate over KTX2 faces and assumes faceCount = 1.
+
+ const dstSize = ktx2File.getImageTranscodedSizeInBytes(
+ i, // level index
+ 0, // layer index
+ 0, // face index
+ transcoderFormat.value
+ );
+ const dst = new Uint8Array(dstSize);
+
+ const transcoded = ktx2File.transcodeImage(
+ dst,
+ i, // level index
+ 0, // layer index
+ 0, // face index
+ transcoderFormat.value,
+ 0, // get_alpha_for_opaque_formats
+ -1, // channel0
+ -1 // channel1
+ );
+
+ if (!defaultValue.defined(transcoded)) {
+ throw new RuntimeError.RuntimeError("transcodeImage() failed.");
+ }
+
+ transferableObjects.push(dst.buffer);
+
+ level[faceOrder[0]] = {
+ internalFormat: internalFormat,
+ width: width,
+ height: height,
+ levelBuffer: dst,
+ };
+ }
+
+ ktx2File.close();
+ ktx2File.delete();
+ return result;
+ }
+
+ function initWorker(compiledModule) {
+ transcoderModule = compiledModule;
+ transcoderModule.initializeBasis();
+
+ self.onmessage = createTaskProcessorWorker(transcode);
+ self.postMessage(true);
+ }
+
+ function transcodeKTX2(event) {
+ const data = event.data;
+
+ // Expect the first message to be to load a web assembly module
+ const wasmConfig = data.webAssemblyConfig;
+ if (defaultValue.defined(wasmConfig)) {
+ // Require and compile WebAssembly module, or use fallback if not supported
+ return require([wasmConfig.modulePath], function (mscBasisTranscoder) {
+ if (defaultValue.defined(wasmConfig.wasmBinaryFile)) {
+ if (!defaultValue.defined(mscBasisTranscoder)) {
+ mscBasisTranscoder = self.MSC_TRANSCODER;
+ }
+
+ mscBasisTranscoder(wasmConfig).then(function (compiledModule) {
+ initWorker(compiledModule);
+ });
+ } else {
+ return mscBasisTranscoder().then(function (transcoder) {
+ initWorker(transcoder);
+ });
+ }
+ });
+ }
+ }
+
+ return transcodeKTX2;
+
+}));
+//# sourceMappingURL=transcodeKTX2.js.map
diff --git a/examples/cesium/Workers/transcodeKTX2.js.map b/examples/cesium/Workers/transcodeKTX2.js.map
new file mode 100644
index 0000000..798da5b
--- /dev/null
+++ b/examples/cesium/Workers/transcodeKTX2.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"transcodeKTX2.js","sources":["../../../Source/Renderer/PixelDatatype.js","../../../Source/Core/PixelFormat.js","../../../Source/Core/VulkanConstants.js","../../../node_modules/ktx-parse/dist/ktx-parse.modern.js","../../../Source/WorkersES6/transcodeKTX2.js"],"sourcesContent":["import WebGLConstants from \"../Core/WebGLConstants.js\";\r\n\r\n/**\r\n * The data type of a pixel.\r\n *\r\n * @enum {Number}\r\n * @see PostProcessStage\r\n */\r\nconst PixelDatatype = {\r\n UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE,\r\n UNSIGNED_SHORT: WebGLConstants.UNSIGNED_SHORT,\r\n UNSIGNED_INT: WebGLConstants.UNSIGNED_INT,\r\n FLOAT: WebGLConstants.FLOAT,\r\n HALF_FLOAT: WebGLConstants.HALF_FLOAT_OES,\r\n UNSIGNED_INT_24_8: WebGLConstants.UNSIGNED_INT_24_8,\r\n UNSIGNED_SHORT_4_4_4_4: WebGLConstants.UNSIGNED_SHORT_4_4_4_4,\r\n UNSIGNED_SHORT_5_5_5_1: WebGLConstants.UNSIGNED_SHORT_5_5_5_1,\r\n UNSIGNED_SHORT_5_6_5: WebGLConstants.UNSIGNED_SHORT_5_6_5,\r\n};\r\n\r\n/**\r\n @private\r\n*/\r\nPixelDatatype.toWebGLConstant = function (pixelDatatype, context) {\r\n switch (pixelDatatype) {\r\n case PixelDatatype.UNSIGNED_BYTE:\r\n return WebGLConstants.UNSIGNED_BYTE;\r\n case PixelDatatype.UNSIGNED_SHORT:\r\n return WebGLConstants.UNSIGNED_SHORT;\r\n case PixelDatatype.UNSIGNED_INT:\r\n return WebGLConstants.UNSIGNED_INT;\r\n case PixelDatatype.FLOAT:\r\n return WebGLConstants.FLOAT;\r\n case PixelDatatype.HALF_FLOAT:\r\n return context.webgl2\r\n ? WebGLConstants.HALF_FLOAT\r\n : WebGLConstants.HALF_FLOAT_OES;\r\n case PixelDatatype.UNSIGNED_INT_24_8:\r\n return WebGLConstants.UNSIGNED_INT_24_8;\r\n case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:\r\n return WebGLConstants.UNSIGNED_SHORT_4_4_4_4;\r\n case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:\r\n return WebGLConstants.UNSIGNED_SHORT_5_5_5_1;\r\n case PixelDatatype.UNSIGNED_SHORT_5_6_5:\r\n return PixelDatatype.UNSIGNED_SHORT_5_6_5;\r\n }\r\n};\r\n\r\n/**\r\n @private\r\n*/\r\nPixelDatatype.isPacked = function (pixelDatatype) {\r\n return (\r\n pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 ||\r\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 ||\r\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 ||\r\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5\r\n );\r\n};\r\n\r\n/**\r\n @private\r\n*/\r\nPixelDatatype.sizeInBytes = function (pixelDatatype) {\r\n switch (pixelDatatype) {\r\n case PixelDatatype.UNSIGNED_BYTE:\r\n return 1;\r\n case PixelDatatype.UNSIGNED_SHORT:\r\n case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:\r\n case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:\r\n case PixelDatatype.UNSIGNED_SHORT_5_6_5:\r\n case PixelDatatype.HALF_FLOAT:\r\n return 2;\r\n case PixelDatatype.UNSIGNED_INT:\r\n case PixelDatatype.FLOAT:\r\n case PixelDatatype.UNSIGNED_INT_24_8:\r\n return 4;\r\n }\r\n};\r\n\r\n/**\r\n @private\r\n*/\r\nPixelDatatype.validate = function (pixelDatatype) {\r\n return (\r\n pixelDatatype === PixelDatatype.UNSIGNED_BYTE ||\r\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT ||\r\n pixelDatatype === PixelDatatype.UNSIGNED_INT ||\r\n pixelDatatype === PixelDatatype.FLOAT ||\r\n pixelDatatype === PixelDatatype.HALF_FLOAT ||\r\n pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 ||\r\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 ||\r\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 ||\r\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5\r\n );\r\n};\r\n\r\nexport default Object.freeze(PixelDatatype);\r\n","import PixelDatatype from \"../Renderer/PixelDatatype.js\";\r\nimport WebGLConstants from \"./WebGLConstants.js\";\r\n\r\n/**\r\n * The format of a pixel, i.e., the number of components it has and what they represent.\r\n *\r\n * @enum {Number}\r\n */\r\nconst PixelFormat = {\r\n /**\r\n * A pixel format containing a depth value.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n DEPTH_COMPONENT: WebGLConstants.DEPTH_COMPONENT,\r\n\r\n /**\r\n * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n DEPTH_STENCIL: WebGLConstants.DEPTH_STENCIL,\r\n\r\n /**\r\n * A pixel format containing an alpha channel.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n ALPHA: WebGLConstants.ALPHA,\r\n\r\n /**\r\n * A pixel format containing red, green, and blue channels.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGB: WebGLConstants.RGB,\r\n\r\n /**\r\n * A pixel format containing red, green, blue, and alpha channels.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGBA: WebGLConstants.RGBA,\r\n\r\n /**\r\n * A pixel format containing a luminance (intensity) channel.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n LUMINANCE: WebGLConstants.LUMINANCE,\r\n\r\n /**\r\n * A pixel format containing luminance (intensity) and alpha channels.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n LUMINANCE_ALPHA: WebGLConstants.LUMINANCE_ALPHA,\r\n\r\n /**\r\n * A pixel format containing red, green, and blue channels that is DXT1 compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGB_DXT1: WebGLConstants.COMPRESSED_RGB_S3TC_DXT1_EXT,\r\n\r\n /**\r\n * A pixel format containing red, green, blue, and alpha channels that is DXT1 compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGBA_DXT1: WebGLConstants.COMPRESSED_RGBA_S3TC_DXT1_EXT,\r\n\r\n /**\r\n * A pixel format containing red, green, blue, and alpha channels that is DXT3 compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGBA_DXT3: WebGLConstants.COMPRESSED_RGBA_S3TC_DXT3_EXT,\r\n\r\n /**\r\n * A pixel format containing red, green, blue, and alpha channels that is DXT5 compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGBA_DXT5: WebGLConstants.COMPRESSED_RGBA_S3TC_DXT5_EXT,\r\n\r\n /**\r\n * A pixel format containing red, green, and blue channels that is PVR 4bpp compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGB_PVRTC_4BPPV1: WebGLConstants.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,\r\n\r\n /**\r\n * A pixel format containing red, green, and blue channels that is PVR 2bpp compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGB_PVRTC_2BPPV1: WebGLConstants.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,\r\n\r\n /**\r\n * A pixel format containing red, green, blue, and alpha channels that is PVR 4bpp compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGBA_PVRTC_4BPPV1: WebGLConstants.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,\r\n\r\n /**\r\n * A pixel format containing red, green, blue, and alpha channels that is PVR 2bpp compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGBA_PVRTC_2BPPV1: WebGLConstants.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,\r\n\r\n /**\r\n * A pixel format containing red, green, blue, and alpha channels that is ASTC compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGBA_ASTC: WebGLConstants.COMPRESSED_RGBA_ASTC_4x4_WEBGL,\r\n\r\n /**\r\n * A pixel format containing red, green, and blue channels that is ETC1 compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGB_ETC1: WebGLConstants.COMPRESSED_RGB_ETC1_WEBGL,\r\n\r\n /**\r\n * A pixel format containing red, green, and blue channels that is ETC2 compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGB8_ETC2: WebGLConstants.COMPRESSED_RGB8_ETC2,\r\n\r\n /**\r\n * A pixel format containing red, green, blue, and alpha channels that is ETC2 compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGBA8_ETC2_EAC: WebGLConstants.COMPRESSED_RGBA8_ETC2_EAC,\r\n\r\n /**\r\n * A pixel format containing red, green, blue, and alpha channels that is BC7 compressed.\r\n *\r\n * @type {Number}\r\n * @constant\r\n */\r\n RGBA_BC7: WebGLConstants.COMPRESSED_RGBA_BPTC_UNORM,\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.componentsLength = function (pixelFormat) {\r\n switch (pixelFormat) {\r\n case PixelFormat.RGB:\r\n return 3;\r\n case PixelFormat.RGBA:\r\n return 4;\r\n case PixelFormat.LUMINANCE_ALPHA:\r\n return 2;\r\n case PixelFormat.ALPHA:\r\n case PixelFormat.LUMINANCE:\r\n return 1;\r\n default:\r\n return 1;\r\n }\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.validate = function (pixelFormat) {\r\n return (\r\n pixelFormat === PixelFormat.DEPTH_COMPONENT ||\r\n pixelFormat === PixelFormat.DEPTH_STENCIL ||\r\n pixelFormat === PixelFormat.ALPHA ||\r\n pixelFormat === PixelFormat.RGB ||\r\n pixelFormat === PixelFormat.RGBA ||\r\n pixelFormat === PixelFormat.LUMINANCE ||\r\n pixelFormat === PixelFormat.LUMINANCE_ALPHA ||\r\n pixelFormat === PixelFormat.RGB_DXT1 ||\r\n pixelFormat === PixelFormat.RGBA_DXT1 ||\r\n pixelFormat === PixelFormat.RGBA_DXT3 ||\r\n pixelFormat === PixelFormat.RGBA_DXT5 ||\r\n pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||\r\n pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||\r\n pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||\r\n pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 ||\r\n pixelFormat === PixelFormat.RGBA_ASTC ||\r\n pixelFormat === PixelFormat.RGB_ETC1 ||\r\n pixelFormat === PixelFormat.RGB8_ETC2 ||\r\n pixelFormat === PixelFormat.RGBA8_ETC2_EAC ||\r\n pixelFormat === PixelFormat.RGBA_BC7\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.isColorFormat = function (pixelFormat) {\r\n return (\r\n pixelFormat === PixelFormat.ALPHA ||\r\n pixelFormat === PixelFormat.RGB ||\r\n pixelFormat === PixelFormat.RGBA ||\r\n pixelFormat === PixelFormat.LUMINANCE ||\r\n pixelFormat === PixelFormat.LUMINANCE_ALPHA\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.isDepthFormat = function (pixelFormat) {\r\n return (\r\n pixelFormat === PixelFormat.DEPTH_COMPONENT ||\r\n pixelFormat === PixelFormat.DEPTH_STENCIL\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.isCompressedFormat = function (pixelFormat) {\r\n return (\r\n pixelFormat === PixelFormat.RGB_DXT1 ||\r\n pixelFormat === PixelFormat.RGBA_DXT1 ||\r\n pixelFormat === PixelFormat.RGBA_DXT3 ||\r\n pixelFormat === PixelFormat.RGBA_DXT5 ||\r\n pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||\r\n pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||\r\n pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||\r\n pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 ||\r\n pixelFormat === PixelFormat.RGBA_ASTC ||\r\n pixelFormat === PixelFormat.RGB_ETC1 ||\r\n pixelFormat === PixelFormat.RGB8_ETC2 ||\r\n pixelFormat === PixelFormat.RGBA8_ETC2_EAC ||\r\n pixelFormat === PixelFormat.RGBA_BC7\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.isDXTFormat = function (pixelFormat) {\r\n return (\r\n pixelFormat === PixelFormat.RGB_DXT1 ||\r\n pixelFormat === PixelFormat.RGBA_DXT1 ||\r\n pixelFormat === PixelFormat.RGBA_DXT3 ||\r\n pixelFormat === PixelFormat.RGBA_DXT5\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.isPVRTCFormat = function (pixelFormat) {\r\n return (\r\n pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 ||\r\n pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 ||\r\n pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 ||\r\n pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.isASTCFormat = function (pixelFormat) {\r\n return pixelFormat === PixelFormat.RGBA_ASTC;\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.isETC1Format = function (pixelFormat) {\r\n return pixelFormat === PixelFormat.RGB_ETC1;\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.isETC2Format = function (pixelFormat) {\r\n return (\r\n pixelFormat === PixelFormat.RGB8_ETC2 ||\r\n pixelFormat === PixelFormat.RGBA8_ETC2_EAC\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.isBC7Format = function (pixelFormat) {\r\n return pixelFormat === PixelFormat.RGBA_BC7;\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.compressedTextureSizeInBytes = function (\r\n pixelFormat,\r\n width,\r\n height\r\n) {\r\n switch (pixelFormat) {\r\n case PixelFormat.RGB_DXT1:\r\n case PixelFormat.RGBA_DXT1:\r\n case PixelFormat.RGB_ETC1:\r\n case PixelFormat.RGB8_ETC2:\r\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\r\n\r\n case PixelFormat.RGBA_DXT3:\r\n case PixelFormat.RGBA_DXT5:\r\n case PixelFormat.RGBA_ASTC:\r\n case PixelFormat.RGBA8_ETC2_EAC:\r\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;\r\n\r\n case PixelFormat.RGB_PVRTC_4BPPV1:\r\n case PixelFormat.RGBA_PVRTC_4BPPV1:\r\n return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8);\r\n\r\n case PixelFormat.RGB_PVRTC_2BPPV1:\r\n case PixelFormat.RGBA_PVRTC_2BPPV1:\r\n return Math.floor(\r\n (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8\r\n );\r\n\r\n case PixelFormat.RGBA_BC7:\r\n return Math.ceil(width / 4) * Math.ceil(height / 4) * 16;\r\n\r\n default:\r\n return 0;\r\n }\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.textureSizeInBytes = function (\r\n pixelFormat,\r\n pixelDatatype,\r\n width,\r\n height\r\n) {\r\n let componentsLength = PixelFormat.componentsLength(pixelFormat);\r\n if (PixelDatatype.isPacked(pixelDatatype)) {\r\n componentsLength = 1;\r\n }\r\n return (\r\n componentsLength * PixelDatatype.sizeInBytes(pixelDatatype) * width * height\r\n );\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.alignmentInBytes = function (pixelFormat, pixelDatatype, width) {\r\n const mod =\r\n PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, width, 1) % 4;\r\n return mod === 0 ? 4 : mod === 2 ? 2 : 1;\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.createTypedArray = function (\r\n pixelFormat,\r\n pixelDatatype,\r\n width,\r\n height\r\n) {\r\n let constructor;\r\n const sizeInBytes = PixelDatatype.sizeInBytes(pixelDatatype);\r\n if (sizeInBytes === Uint8Array.BYTES_PER_ELEMENT) {\r\n constructor = Uint8Array;\r\n } else if (sizeInBytes === Uint16Array.BYTES_PER_ELEMENT) {\r\n constructor = Uint16Array;\r\n } else if (\r\n sizeInBytes === Float32Array.BYTES_PER_ELEMENT &&\r\n pixelDatatype === PixelDatatype.FLOAT\r\n ) {\r\n constructor = Float32Array;\r\n } else {\r\n constructor = Uint32Array;\r\n }\r\n\r\n const size = PixelFormat.componentsLength(pixelFormat) * width * height;\r\n return new constructor(size);\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.flipY = function (\r\n bufferView,\r\n pixelFormat,\r\n pixelDatatype,\r\n width,\r\n height\r\n) {\r\n if (height === 1) {\r\n return bufferView;\r\n }\r\n const flipped = PixelFormat.createTypedArray(\r\n pixelFormat,\r\n pixelDatatype,\r\n width,\r\n height\r\n );\r\n const numberOfComponents = PixelFormat.componentsLength(pixelFormat);\r\n const textureWidth = width * numberOfComponents;\r\n for (let i = 0; i < height; ++i) {\r\n const row = i * width * numberOfComponents;\r\n const flippedRow = (height - i - 1) * width * numberOfComponents;\r\n for (let j = 0; j < textureWidth; ++j) {\r\n flipped[flippedRow + j] = bufferView[row + j];\r\n }\r\n }\r\n return flipped;\r\n};\r\n\r\n/**\r\n * @private\r\n */\r\nPixelFormat.toInternalFormat = function (pixelFormat, pixelDatatype, context) {\r\n // WebGL 1 require internalFormat to be the same as PixelFormat\r\n if (!context.webgl2) {\r\n return pixelFormat;\r\n }\r\n\r\n // Convert pixelFormat to correct internalFormat for WebGL 2\r\n if (pixelFormat === PixelFormat.DEPTH_STENCIL) {\r\n return WebGLConstants.DEPTH24_STENCIL8;\r\n }\r\n\r\n if (pixelFormat === PixelFormat.DEPTH_COMPONENT) {\r\n if (pixelDatatype === PixelDatatype.UNSIGNED_SHORT) {\r\n return WebGLConstants.DEPTH_COMPONENT16;\r\n } else if (pixelDatatype === PixelDatatype.UNSIGNED_INT) {\r\n return WebGLConstants.DEPTH_COMPONENT24;\r\n }\r\n }\r\n\r\n if (pixelDatatype === PixelDatatype.FLOAT) {\r\n switch (pixelFormat) {\r\n case PixelFormat.RGBA:\r\n return WebGLConstants.RGBA32F;\r\n case PixelFormat.RGB:\r\n return WebGLConstants.RGB32F;\r\n case PixelFormat.RG:\r\n return WebGLConstants.RG32F;\r\n case PixelFormat.R:\r\n return WebGLConstants.R32F;\r\n }\r\n }\r\n\r\n if (pixelDatatype === PixelDatatype.HALF_FLOAT) {\r\n switch (pixelFormat) {\r\n case PixelFormat.RGBA:\r\n return WebGLConstants.RGBA16F;\r\n case PixelFormat.RGB:\r\n return WebGLConstants.RGB16F;\r\n case PixelFormat.RG:\r\n return WebGLConstants.RG16F;\r\n case PixelFormat.R:\r\n return WebGLConstants.R16F;\r\n }\r\n }\r\n\r\n return pixelFormat;\r\n};\r\n\r\nexport default Object.freeze(PixelFormat);\r\n","/**\r\n * Enum containing Vulkan Constant values by name.\r\n *\r\n * These match the constants from the {@link https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-definition|Vulkan 1.2 specification}.\r\n *\r\n * @enum {Number}\r\n * @private\r\n */\r\nconst VulkanConstants = {\r\n VK_FORMAT_UNDEFINED: 0,\r\n VK_FORMAT_R4G4_UNORM_PACK8: 1,\r\n VK_FORMAT_R4G4B4A4_UNORM_PACK16: 2,\r\n VK_FORMAT_B4G4R4A4_UNORM_PACK16: 3,\r\n VK_FORMAT_R5G6B5_UNORM_PACK16: 4,\r\n VK_FORMAT_B5G6R5_UNORM_PACK16: 5,\r\n VK_FORMAT_R5G5B5A1_UNORM_PACK16: 6,\r\n VK_FORMAT_B5G5R5A1_UNORM_PACK16: 7,\r\n VK_FORMAT_A1R5G5B5_UNORM_PACK16: 8,\r\n VK_FORMAT_R8_UNORM: 9,\r\n VK_FORMAT_R8_SNORM: 10,\r\n VK_FORMAT_R8_USCALED: 11,\r\n VK_FORMAT_R8_SSCALED: 12,\r\n VK_FORMAT_R8_UINT: 13,\r\n VK_FORMAT_R8_SINT: 14,\r\n VK_FORMAT_R8_SRGB: 15,\r\n VK_FORMAT_R8G8_UNORM: 16,\r\n VK_FORMAT_R8G8_SNORM: 17,\r\n VK_FORMAT_R8G8_USCALED: 18,\r\n VK_FORMAT_R8G8_SSCALED: 19,\r\n VK_FORMAT_R8G8_UINT: 20,\r\n VK_FORMAT_R8G8_SINT: 21,\r\n VK_FORMAT_R8G8_SRGB: 22,\r\n VK_FORMAT_R8G8B8_UNORM: 23,\r\n VK_FORMAT_R8G8B8_SNORM: 24,\r\n VK_FORMAT_R8G8B8_USCALED: 25,\r\n VK_FORMAT_R8G8B8_SSCALED: 26,\r\n VK_FORMAT_R8G8B8_UINT: 27,\r\n VK_FORMAT_R8G8B8_SINT: 28,\r\n VK_FORMAT_R8G8B8_SRGB: 29,\r\n VK_FORMAT_B8G8R8_UNORM: 30,\r\n VK_FORMAT_B8G8R8_SNORM: 31,\r\n VK_FORMAT_B8G8R8_USCALED: 32,\r\n VK_FORMAT_B8G8R8_SSCALED: 33,\r\n VK_FORMAT_B8G8R8_UINT: 34,\r\n VK_FORMAT_B8G8R8_SINT: 35,\r\n VK_FORMAT_B8G8R8_SRGB: 36,\r\n VK_FORMAT_R8G8B8A8_UNORM: 37,\r\n VK_FORMAT_R8G8B8A8_SNORM: 38,\r\n VK_FORMAT_R8G8B8A8_USCALED: 39,\r\n VK_FORMAT_R8G8B8A8_SSCALED: 40,\r\n VK_FORMAT_R8G8B8A8_UINT: 41,\r\n VK_FORMAT_R8G8B8A8_SINT: 42,\r\n VK_FORMAT_R8G8B8A8_SRGB: 43,\r\n VK_FORMAT_B8G8R8A8_UNORM: 44,\r\n VK_FORMAT_B8G8R8A8_SNORM: 45,\r\n VK_FORMAT_B8G8R8A8_USCALED: 46,\r\n VK_FORMAT_B8G8R8A8_SSCALED: 47,\r\n VK_FORMAT_B8G8R8A8_UINT: 48,\r\n VK_FORMAT_B8G8R8A8_SINT: 49,\r\n VK_FORMAT_B8G8R8A8_SRGB: 50,\r\n VK_FORMAT_A8B8G8R8_UNORM_PACK32: 51,\r\n VK_FORMAT_A8B8G8R8_SNORM_PACK32: 52,\r\n VK_FORMAT_A8B8G8R8_USCALED_PACK32: 53,\r\n VK_FORMAT_A8B8G8R8_SSCALED_PACK32: 54,\r\n VK_FORMAT_A8B8G8R8_UINT_PACK32: 55,\r\n VK_FORMAT_A8B8G8R8_SINT_PACK32: 56,\r\n VK_FORMAT_A8B8G8R8_SRGB_PACK32: 57,\r\n VK_FORMAT_A2R10G10B10_UNORM_PACK32: 58,\r\n VK_FORMAT_A2R10G10B10_SNORM_PACK32: 59,\r\n VK_FORMAT_A2R10G10B10_USCALED_PACK32: 60,\r\n VK_FORMAT_A2R10G10B10_SSCALED_PACK32: 61,\r\n VK_FORMAT_A2R10G10B10_UINT_PACK32: 62,\r\n VK_FORMAT_A2R10G10B10_SINT_PACK32: 63,\r\n VK_FORMAT_A2B10G10R10_UNORM_PACK32: 64,\r\n VK_FORMAT_A2B10G10R10_SNORM_PACK32: 65,\r\n VK_FORMAT_A2B10G10R10_USCALED_PACK32: 66,\r\n VK_FORMAT_A2B10G10R10_SSCALED_PACK32: 67,\r\n VK_FORMAT_A2B10G10R10_UINT_PACK32: 68,\r\n VK_FORMAT_A2B10G10R10_SINT_PACK32: 69,\r\n VK_FORMAT_R16_UNORM: 70,\r\n VK_FORMAT_R16_SNORM: 71,\r\n VK_FORMAT_R16_USCALED: 72,\r\n VK_FORMAT_R16_SSCALED: 73,\r\n VK_FORMAT_R16_UINT: 74,\r\n VK_FORMAT_R16_SINT: 75,\r\n VK_FORMAT_R16_SFLOAT: 76,\r\n VK_FORMAT_R16G16_UNORM: 77,\r\n VK_FORMAT_R16G16_SNORM: 78,\r\n VK_FORMAT_R16G16_USCALED: 79,\r\n VK_FORMAT_R16G16_SSCALED: 80,\r\n VK_FORMAT_R16G16_UINT: 81,\r\n VK_FORMAT_R16G16_SINT: 82,\r\n VK_FORMAT_R16G16_SFLOAT: 83,\r\n VK_FORMAT_R16G16B16_UNORM: 84,\r\n VK_FORMAT_R16G16B16_SNORM: 85,\r\n VK_FORMAT_R16G16B16_USCALED: 86,\r\n VK_FORMAT_R16G16B16_SSCALED: 87,\r\n VK_FORMAT_R16G16B16_UINT: 88,\r\n VK_FORMAT_R16G16B16_SINT: 89,\r\n VK_FORMAT_R16G16B16_SFLOAT: 90,\r\n VK_FORMAT_R16G16B16A16_UNORM: 91,\r\n VK_FORMAT_R16G16B16A16_SNORM: 92,\r\n VK_FORMAT_R16G16B16A16_USCALED: 93,\r\n VK_FORMAT_R16G16B16A16_SSCALED: 94,\r\n VK_FORMAT_R16G16B16A16_UINT: 95,\r\n VK_FORMAT_R16G16B16A16_SINT: 96,\r\n VK_FORMAT_R16G16B16A16_SFLOAT: 97,\r\n VK_FORMAT_R32_UINT: 98,\r\n VK_FORMAT_R32_SINT: 99,\r\n VK_FORMAT_R32_SFLOAT: 100,\r\n VK_FORMAT_R32G32_UINT: 101,\r\n VK_FORMAT_R32G32_SINT: 102,\r\n VK_FORMAT_R32G32_SFLOAT: 103,\r\n VK_FORMAT_R32G32B32_UINT: 104,\r\n VK_FORMAT_R32G32B32_SINT: 105,\r\n VK_FORMAT_R32G32B32_SFLOAT: 106,\r\n VK_FORMAT_R32G32B32A32_UINT: 107,\r\n VK_FORMAT_R32G32B32A32_SINT: 108,\r\n VK_FORMAT_R32G32B32A32_SFLOAT: 109,\r\n VK_FORMAT_R64_UINT: 110,\r\n VK_FORMAT_R64_SINT: 111,\r\n VK_FORMAT_R64_SFLOAT: 112,\r\n VK_FORMAT_R64G64_UINT: 113,\r\n VK_FORMAT_R64G64_SINT: 114,\r\n VK_FORMAT_R64G64_SFLOAT: 115,\r\n VK_FORMAT_R64G64B64_UINT: 116,\r\n VK_FORMAT_R64G64B64_SINT: 117,\r\n VK_FORMAT_R64G64B64_SFLOAT: 118,\r\n VK_FORMAT_R64G64B64A64_UINT: 119,\r\n VK_FORMAT_R64G64B64A64_SINT: 120,\r\n VK_FORMAT_R64G64B64A64_SFLOAT: 121,\r\n VK_FORMAT_B10G11R11_UFLOAT_PACK32: 122,\r\n VK_FORMAT_E5B9G9R9_UFLOAT_PACK32: 123,\r\n VK_FORMAT_D16_UNORM: 124,\r\n VK_FORMAT_X8_D24_UNORM_PACK32: 125,\r\n VK_FORMAT_D32_SFLOAT: 126,\r\n VK_FORMAT_S8_UINT: 127,\r\n VK_FORMAT_D16_UNORM_S8_UINT: 128,\r\n VK_FORMAT_D24_UNORM_S8_UINT: 129,\r\n VK_FORMAT_D32_SFLOAT_S8_UINT: 130,\r\n VK_FORMAT_BC1_RGB_UNORM_BLOCK: 131,\r\n VK_FORMAT_BC1_RGB_SRGB_BLOCK: 132,\r\n VK_FORMAT_BC1_RGBA_UNORM_BLOCK: 133,\r\n VK_FORMAT_BC1_RGBA_SRGB_BLOCK: 134,\r\n VK_FORMAT_BC2_UNORM_BLOCK: 135,\r\n VK_FORMAT_BC2_SRGB_BLOCK: 136,\r\n VK_FORMAT_BC3_UNORM_BLOCK: 137,\r\n VK_FORMAT_BC3_SRGB_BLOCK: 138,\r\n VK_FORMAT_BC4_UNORM_BLOCK: 139,\r\n VK_FORMAT_BC4_SNORM_BLOCK: 140,\r\n VK_FORMAT_BC5_UNORM_BLOCK: 141,\r\n VK_FORMAT_BC5_SNORM_BLOCK: 142,\r\n VK_FORMAT_BC6H_UFLOAT_BLOCK: 143,\r\n VK_FORMAT_BC6H_SFLOAT_BLOCK: 144,\r\n VK_FORMAT_BC7_UNORM_BLOCK: 145,\r\n VK_FORMAT_BC7_SRGB_BLOCK: 146,\r\n VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: 147,\r\n VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: 148,\r\n VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: 149,\r\n VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: 150,\r\n VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: 151,\r\n VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: 152,\r\n VK_FORMAT_EAC_R11_UNORM_BLOCK: 153,\r\n VK_FORMAT_EAC_R11_SNORM_BLOCK: 154,\r\n VK_FORMAT_EAC_R11G11_UNORM_BLOCK: 155,\r\n VK_FORMAT_EAC_R11G11_SNORM_BLOCK: 156,\r\n VK_FORMAT_ASTC_4x4_UNORM_BLOCK: 157,\r\n VK_FORMAT_ASTC_4x4_SRGB_BLOCK: 158,\r\n VK_FORMAT_ASTC_5x4_UNORM_BLOCK: 159,\r\n VK_FORMAT_ASTC_5x4_SRGB_BLOCK: 160,\r\n VK_FORMAT_ASTC_5x5_UNORM_BLOCK: 161,\r\n VK_FORMAT_ASTC_5x5_SRGB_BLOCK: 162,\r\n VK_FORMAT_ASTC_6x5_UNORM_BLOCK: 163,\r\n VK_FORMAT_ASTC_6x5_SRGB_BLOCK: 164,\r\n VK_FORMAT_ASTC_6x6_UNORM_BLOCK: 165,\r\n VK_FORMAT_ASTC_6x6_SRGB_BLOCK: 166,\r\n VK_FORMAT_ASTC_8x5_UNORM_BLOCK: 167,\r\n VK_FORMAT_ASTC_8x5_SRGB_BLOCK: 168,\r\n VK_FORMAT_ASTC_8x6_UNORM_BLOCK: 169,\r\n VK_FORMAT_ASTC_8x6_SRGB_BLOCK: 170,\r\n VK_FORMAT_ASTC_8x8_UNORM_BLOCK: 171,\r\n VK_FORMAT_ASTC_8x8_SRGB_BLOCK: 172,\r\n VK_FORMAT_ASTC_10x5_UNORM_BLOCK: 173,\r\n VK_FORMAT_ASTC_10x5_SRGB_BLOCK: 174,\r\n VK_FORMAT_ASTC_10x6_UNORM_BLOCK: 175,\r\n VK_FORMAT_ASTC_10x6_SRGB_BLOCK: 176,\r\n VK_FORMAT_ASTC_10x8_UNORM_BLOCK: 177,\r\n VK_FORMAT_ASTC_10x8_SRGB_BLOCK: 178,\r\n VK_FORMAT_ASTC_10x10_UNORM_BLOCK: 179,\r\n VK_FORMAT_ASTC_10x10_SRGB_BLOCK: 180,\r\n VK_FORMAT_ASTC_12x10_UNORM_BLOCK: 181,\r\n VK_FORMAT_ASTC_12x10_SRGB_BLOCK: 182,\r\n VK_FORMAT_ASTC_12x12_UNORM_BLOCK: 183,\r\n VK_FORMAT_ASTC_12x12_SRGB_BLOCK: 184,\r\n VK_FORMAT_G8B8G8R8_422_UNORM: 1000156000,\r\n VK_FORMAT_B8G8R8G8_422_UNORM: 1000156001,\r\n VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: 1000156002,\r\n VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: 1000156003,\r\n VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM: 1000156004,\r\n VK_FORMAT_G8_B8R8_2PLANE_422_UNORM: 1000156005,\r\n VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM: 1000156006,\r\n VK_FORMAT_R10X6_UNORM_PACK16: 1000156007,\r\n VK_FORMAT_R10X6G10X6_UNORM_2PACK16: 1000156008,\r\n VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16: 1000156009,\r\n VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: 1000156010,\r\n VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: 1000156011,\r\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: 1000156012,\r\n VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: 1000156013,\r\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: 1000156014,\r\n VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: 1000156015,\r\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: 1000156016,\r\n VK_FORMAT_R12X4_UNORM_PACK16: 1000156017,\r\n VK_FORMAT_R12X4G12X4_UNORM_2PACK16: 1000156018,\r\n VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16: 1000156019,\r\n VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: 1000156020,\r\n VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: 1000156021,\r\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: 1000156022,\r\n VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: 1000156023,\r\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: 1000156024,\r\n VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: 1000156025,\r\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: 1000156026,\r\n VK_FORMAT_G16B16G16R16_422_UNORM: 1000156027,\r\n VK_FORMAT_B16G16R16G16_422_UNORM: 1000156028,\r\n VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM: 1000156029,\r\n VK_FORMAT_G16_B16R16_2PLANE_420_UNORM: 1000156030,\r\n VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM: 1000156031,\r\n VK_FORMAT_G16_B16R16_2PLANE_422_UNORM: 1000156032,\r\n VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM: 1000156033,\r\n VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG: 1000054000,\r\n VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG: 1000054001,\r\n VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG: 1000054002,\r\n VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG: 1000054003,\r\n VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG: 1000054004,\r\n VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG: 1000054005,\r\n VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG: 1000054006,\r\n VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: 1000054007,\r\n VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT: 1000066000,\r\n VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT: 1000066001,\r\n VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT: 1000066002,\r\n VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT: 1000066003,\r\n VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT: 1000066004,\r\n VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT: 1000066005,\r\n VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT: 1000066006,\r\n VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT: 1000066007,\r\n VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT: 1000066008,\r\n VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT: 1000066009,\r\n VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT: 1000066010,\r\n VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT: 1000066011,\r\n VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT: 1000066012,\r\n VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT: 1000066013,\r\n VK_FORMAT_G8B8G8R8_422_UNORM_KHR: 1000156000,\r\n VK_FORMAT_B8G8R8G8_422_UNORM_KHR: 1000156001,\r\n VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR: 1000156002,\r\n VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR: 1000156003,\r\n VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR: 1000156004,\r\n VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR: 1000156005,\r\n VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR: 1000156006,\r\n VK_FORMAT_R10X6_UNORM_PACK16_KHR: 1000156007,\r\n VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR: 1000156008,\r\n VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR: 1000156009,\r\n VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR: 1000156010,\r\n VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR: 1000156011,\r\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR: 1000156012,\r\n VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR: 1000156013,\r\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR: 1000156014,\r\n VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR: 1000156015,\r\n VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR: 1000156016,\r\n VK_FORMAT_R12X4_UNORM_PACK16_KHR: 1000156017,\r\n VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR: 1000156018,\r\n VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR: 1000156019,\r\n VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR: 1000156020,\r\n VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR: 1000156021,\r\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR: 1000156022,\r\n VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR: 1000156023,\r\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR: 1000156024,\r\n VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR: 1000156025,\r\n VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR: 1000156026,\r\n VK_FORMAT_G16B16G16R16_422_UNORM_KHR: 1000156027,\r\n VK_FORMAT_B16G16R16G16_422_UNORM_KHR: 1000156028,\r\n VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR: 1000156029,\r\n VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR: 1000156030,\r\n VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR: 1000156031,\r\n VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR: 1000156032,\r\n VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR: 1000156033,\r\n};\r\nexport default Object.freeze(VulkanConstants);\r\n","///////////////////////////////////////////////////\n// KTX2 Header.\n///////////////////////////////////////////////////\nconst KHR_SUPERCOMPRESSION_NONE = 0;\nconst KHR_SUPERCOMPRESSION_BASISLZ = 1;\nconst KHR_SUPERCOMPRESSION_ZSTD = 2;\nconst KHR_SUPERCOMPRESSION_ZLIB = 3; ///////////////////////////////////////////////////\n// Data Format Descriptor (DFD).\n///////////////////////////////////////////////////\n\nconst KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT = 0;\nconst KHR_DF_VENDORID_KHRONOS = 0;\nconst KHR_DF_VERSION = 2;\nconst KHR_DF_MODEL_UNSPECIFIED = 0;\nconst KHR_DF_MODEL_RGBSDA = 1; // ...\n\nconst KHR_DF_MODEL_ETC1 = 160;\nconst KHR_DF_MODEL_ETC2 = 161;\nconst KHR_DF_MODEL_ASTC = 162;\nconst KHR_DF_MODEL_ETC1S = 163;\nconst KHR_DF_MODEL_UASTC = 166;\nconst KHR_DF_FLAG_ALPHA_STRAIGHT = 0;\nconst KHR_DF_FLAG_ALPHA_PREMULTIPLIED = 1;\nconst KHR_DF_TRANSFER_UNSPECIFIED = 0;\nconst KHR_DF_TRANSFER_LINEAR = 1;\nconst KHR_DF_TRANSFER_SRGB = 2;\nconst KHR_DF_TRANSFER_ITU = 3;\nconst KHR_DF_TRANSFER_NTSC = 4;\nconst KHR_DF_TRANSFER_SLOG = 5;\nconst KHR_DF_TRANSFER_SLOG2 = 6;\nconst KHR_DF_TRANSFER_BT1886 = 7;\nconst KHR_DF_TRANSFER_HLG_OETF = 8;\nconst KHR_DF_TRANSFER_HLG_EOTF = 9;\nconst KHR_DF_TRANSFER_PQ_EOTF = 10;\nconst KHR_DF_TRANSFER_PQ_OETF = 11;\nconst KHR_DF_TRANSFER_DCIP3 = 12;\nconst KHR_DF_TRANSFER_PAL_OETF = 13;\nconst KHR_DF_TRANSFER_PAL625_EOTF = 14;\nconst KHR_DF_TRANSFER_ST240 = 15;\nconst KHR_DF_TRANSFER_ACESCC = 16;\nconst KHR_DF_TRANSFER_ACESCCT = 17;\nconst KHR_DF_TRANSFER_ADOBERGB = 18;\nconst KHR_DF_PRIMARIES_UNSPECIFIED = 0;\nconst KHR_DF_PRIMARIES_BT709 = 1;\nconst KHR_DF_PRIMARIES_BT601_EBU = 2;\nconst KHR_DF_PRIMARIES_BT601_SMPTE = 3;\nconst KHR_DF_PRIMARIES_BT2020 = 4;\nconst KHR_DF_PRIMARIES_CIEXYZ = 5;\nconst KHR_DF_PRIMARIES_ACES = 6;\nconst KHR_DF_PRIMARIES_ACESCC = 7;\nconst KHR_DF_PRIMARIES_NTSC1953 = 8;\nconst KHR_DF_PRIMARIES_PAL525 = 9;\nconst KHR_DF_PRIMARIES_DISPLAYP3 = 10;\nconst KHR_DF_PRIMARIES_ADOBERGB = 11;\nconst KHR_DF_CHANNEL_RGBSDA_RED = 0;\nconst KHR_DF_CHANNEL_RGBSDA_GREEN = 1;\nconst KHR_DF_CHANNEL_RGBSDA_BLUE = 2;\nconst KHR_DF_CHANNEL_RGBSDA_STENCIL = 13;\nconst KHR_DF_CHANNEL_RGBSDA_DEPTH = 14;\nconst KHR_DF_CHANNEL_RGBSDA_ALPHA = 15;\nconst KHR_DF_SAMPLE_DATATYPE_FLOAT = 0x80;\nconst KHR_DF_SAMPLE_DATATYPE_SIGNED = 0x40;\nconst KHR_DF_SAMPLE_DATATYPE_EXPONENT = 0x20;\nconst KHR_DF_SAMPLE_DATATYPE_LINEAR = 0x10; ///////////////////////////////////////////////////\n// VK FORMAT.\n///////////////////////////////////////////////////\n\nconst VK_FORMAT_UNDEFINED = 0;\nconst VK_FORMAT_R4G4_UNORM_PACK8 = 1;\nconst VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2;\nconst VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3;\nconst VK_FORMAT_R5G6B5_UNORM_PACK16 = 4;\nconst VK_FORMAT_B5G6R5_UNORM_PACK16 = 5;\nconst VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6;\nconst VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7;\nconst VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8;\nconst VK_FORMAT_R8_UNORM = 9;\nconst VK_FORMAT_R8_SNORM = 10;\nconst VK_FORMAT_R8_UINT = 13;\nconst VK_FORMAT_R8_SINT = 14;\nconst VK_FORMAT_R8_SRGB = 15;\nconst VK_FORMAT_R8G8_UNORM = 16;\nconst VK_FORMAT_R8G8_SNORM = 17;\nconst VK_FORMAT_R8G8_UINT = 20;\nconst VK_FORMAT_R8G8_SINT = 21;\nconst VK_FORMAT_R8G8_SRGB = 22;\nconst VK_FORMAT_R8G8B8_UNORM = 23;\nconst VK_FORMAT_R8G8B8_SNORM = 24;\nconst VK_FORMAT_R8G8B8_UINT = 27;\nconst VK_FORMAT_R8G8B8_SINT = 28;\nconst VK_FORMAT_R8G8B8_SRGB = 29;\nconst VK_FORMAT_B8G8R8_UNORM = 30;\nconst VK_FORMAT_B8G8R8_SNORM = 31;\nconst VK_FORMAT_B8G8R8_UINT = 34;\nconst VK_FORMAT_B8G8R8_SINT = 35;\nconst VK_FORMAT_B8G8R8_SRGB = 36;\nconst VK_FORMAT_R8G8B8A8_UNORM = 37;\nconst VK_FORMAT_R8G8B8A8_SNORM = 38;\nconst VK_FORMAT_R8G8B8A8_UINT = 41;\nconst VK_FORMAT_R8G8B8A8_SINT = 42;\nconst VK_FORMAT_R8G8B8A8_SRGB = 43;\nconst VK_FORMAT_B8G8R8A8_UNORM = 44;\nconst VK_FORMAT_B8G8R8A8_SNORM = 45;\nconst VK_FORMAT_B8G8R8A8_UINT = 48;\nconst VK_FORMAT_B8G8R8A8_SINT = 49;\nconst VK_FORMAT_B8G8R8A8_SRGB = 50;\nconst VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58;\nconst VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59;\nconst VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62;\nconst VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63;\nconst VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64;\nconst VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65;\nconst VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68;\nconst VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69;\nconst VK_FORMAT_R16_UNORM = 70;\nconst VK_FORMAT_R16_SNORM = 71;\nconst VK_FORMAT_R16_UINT = 74;\nconst VK_FORMAT_R16_SINT = 75;\nconst VK_FORMAT_R16_SFLOAT = 76;\nconst VK_FORMAT_R16G16_UNORM = 77;\nconst VK_FORMAT_R16G16_SNORM = 78;\nconst VK_FORMAT_R16G16_UINT = 81;\nconst VK_FORMAT_R16G16_SINT = 82;\nconst VK_FORMAT_R16G16_SFLOAT = 83;\nconst VK_FORMAT_R16G16B16_UNORM = 84;\nconst VK_FORMAT_R16G16B16_SNORM = 85;\nconst VK_FORMAT_R16G16B16_UINT = 88;\nconst VK_FORMAT_R16G16B16_SINT = 89;\nconst VK_FORMAT_R16G16B16_SFLOAT = 90;\nconst VK_FORMAT_R16G16B16A16_UNORM = 91;\nconst VK_FORMAT_R16G16B16A16_SNORM = 92;\nconst VK_FORMAT_R16G16B16A16_UINT = 95;\nconst VK_FORMAT_R16G16B16A16_SINT = 96;\nconst VK_FORMAT_R16G16B16A16_SFLOAT = 97;\nconst VK_FORMAT_R32_UINT = 98;\nconst VK_FORMAT_R32_SINT = 99;\nconst VK_FORMAT_R32_SFLOAT = 100;\nconst VK_FORMAT_R32G32_UINT = 101;\nconst VK_FORMAT_R32G32_SINT = 102;\nconst VK_FORMAT_R32G32_SFLOAT = 103;\nconst VK_FORMAT_R32G32B32_UINT = 104;\nconst VK_FORMAT_R32G32B32_SINT = 105;\nconst VK_FORMAT_R32G32B32_SFLOAT = 106;\nconst VK_FORMAT_R32G32B32A32_UINT = 107;\nconst VK_FORMAT_R32G32B32A32_SINT = 108;\nconst VK_FORMAT_R32G32B32A32_SFLOAT = 109;\nconst VK_FORMAT_R64_UINT = 110;\nconst VK_FORMAT_R64_SINT = 111;\nconst VK_FORMAT_R64_SFLOAT = 112;\nconst VK_FORMAT_R64G64_UINT = 113;\nconst VK_FORMAT_R64G64_SINT = 114;\nconst VK_FORMAT_R64G64_SFLOAT = 115;\nconst VK_FORMAT_R64G64B64_UINT = 116;\nconst VK_FORMAT_R64G64B64_SINT = 117;\nconst VK_FORMAT_R64G64B64_SFLOAT = 118;\nconst VK_FORMAT_R64G64B64A64_UINT = 119;\nconst VK_FORMAT_R64G64B64A64_SINT = 120;\nconst VK_FORMAT_R64G64B64A64_SFLOAT = 121;\nconst VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122;\nconst VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123;\nconst VK_FORMAT_D16_UNORM = 124;\nconst VK_FORMAT_X8_D24_UNORM_PACK32 = 125;\nconst VK_FORMAT_D32_SFLOAT = 126;\nconst VK_FORMAT_S8_UINT = 127;\nconst VK_FORMAT_D16_UNORM_S8_UINT = 128;\nconst VK_FORMAT_D24_UNORM_S8_UINT = 129;\nconst VK_FORMAT_D32_SFLOAT_S8_UINT = 130;\nconst VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131;\nconst VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132;\nconst VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133;\nconst VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134;\nconst VK_FORMAT_BC2_UNORM_BLOCK = 135;\nconst VK_FORMAT_BC2_SRGB_BLOCK = 136;\nconst VK_FORMAT_BC3_UNORM_BLOCK = 137;\nconst VK_FORMAT_BC3_SRGB_BLOCK = 138;\nconst VK_FORMAT_BC4_UNORM_BLOCK = 139;\nconst VK_FORMAT_BC4_SNORM_BLOCK = 140;\nconst VK_FORMAT_BC5_UNORM_BLOCK = 141;\nconst VK_FORMAT_BC5_SNORM_BLOCK = 142;\nconst VK_FORMAT_BC6H_UFLOAT_BLOCK = 143;\nconst VK_FORMAT_BC6H_SFLOAT_BLOCK = 144;\nconst VK_FORMAT_BC7_UNORM_BLOCK = 145;\nconst VK_FORMAT_BC7_SRGB_BLOCK = 146;\nconst VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147;\nconst VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148;\nconst VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149;\nconst VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150;\nconst VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151;\nconst VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152;\nconst VK_FORMAT_EAC_R11_UNORM_BLOCK = 153;\nconst VK_FORMAT_EAC_R11_SNORM_BLOCK = 154;\nconst VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155;\nconst VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156;\nconst VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157;\nconst VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158;\nconst VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159;\nconst VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160;\nconst VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161;\nconst VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162;\nconst VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163;\nconst VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164;\nconst VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165;\nconst VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166;\nconst VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167;\nconst VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168;\nconst VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169;\nconst VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170;\nconst VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171;\nconst VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172;\nconst VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173;\nconst VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174;\nconst VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175;\nconst VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176;\nconst VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177;\nconst VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178;\nconst VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179;\nconst VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180;\nconst VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181;\nconst VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182;\nconst VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183;\nconst VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184;\nconst VK_FORMAT_R10X6_UNORM_PACK16 = 1000156007;\nconst VK_FORMAT_R10X6G10X6_UNORM_2PACK16 = 1000156008;\nconst VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 1000156009;\nconst VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 1000156010;\nconst VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 1000156011;\nconst VK_FORMAT_R12X4_UNORM_PACK16 = 1000156017;\nconst VK_FORMAT_R12X4G12X4_UNORM_2PACK16 = 1000156018;\nconst VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 1000156019;\nconst VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 1000156020;\nconst VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 1000156021;\nconst VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000;\nconst VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001;\nconst VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002;\nconst VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003;\nconst VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004;\nconst VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005;\nconst VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006;\nconst VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007;\nconst VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT = 1000066000;\nconst VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT = 1000066001;\nconst VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT = 1000066002;\nconst VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT = 1000066003;\nconst VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT = 1000066004;\nconst VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT = 1000066005;\nconst VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT = 1000066006;\nconst VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT = 1000066007;\nconst VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT = 1000066008;\nconst VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT = 1000066009;\nconst VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT = 1000066010;\nconst VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT = 1000066011;\nconst VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT = 1000066012;\nconst VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT = 1000066013;\nconst VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT = 1000340000;\nconst VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT = 1000340001;\n\n/**\r\n * Represents an unpacked KTX 2.0 texture container. Data for individual mip levels are stored in\r\n * the `.levels` array, typically compressed in Basis Universal formats. Additional properties\r\n * provide metadata required to process, transcode, and upload these textures.\r\n */\n\nclass KTX2Container {\n constructor() {\n this.vkFormat = VK_FORMAT_UNDEFINED;\n this.typeSize = 1;\n this.pixelWidth = 0;\n this.pixelHeight = 0;\n this.pixelDepth = 0;\n this.layerCount = 0;\n this.faceCount = 1;\n this.supercompressionScheme = KHR_SUPERCOMPRESSION_NONE;\n this.levels = [];\n this.dataFormatDescriptor = [{\n vendorId: KHR_DF_VENDORID_KHRONOS,\n descriptorType: KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT,\n descriptorBlockSize: 0,\n versionNumber: KHR_DF_VERSION,\n colorModel: KHR_DF_MODEL_UNSPECIFIED,\n colorPrimaries: KHR_DF_PRIMARIES_BT709,\n transferFunction: KHR_DF_TRANSFER_SRGB,\n flags: KHR_DF_FLAG_ALPHA_STRAIGHT,\n texelBlockDimension: [0, 0, 0, 0],\n bytesPlane: [0, 0, 0, 0, 0, 0, 0, 0],\n samples: []\n }];\n this.keyValue = {};\n this.globalData = null;\n }\n\n}\n\nclass BufferReader {\n constructor(data, byteOffset, byteLength, littleEndian) {\n this._dataView = void 0;\n this._littleEndian = void 0;\n this._offset = void 0;\n this._dataView = new DataView(data.buffer, data.byteOffset + byteOffset, byteLength);\n this._littleEndian = littleEndian;\n this._offset = 0;\n }\n\n _nextUint8() {\n const value = this._dataView.getUint8(this._offset);\n\n this._offset += 1;\n return value;\n }\n\n _nextUint16() {\n const value = this._dataView.getUint16(this._offset, this._littleEndian);\n\n this._offset += 2;\n return value;\n }\n\n _nextUint32() {\n const value = this._dataView.getUint32(this._offset, this._littleEndian);\n\n this._offset += 4;\n return value;\n }\n\n _nextUint64() {\n const left = this._dataView.getUint32(this._offset, this._littleEndian);\n\n const right = this._dataView.getUint32(this._offset + 4, this._littleEndian); // TODO(cleanup): Just test this...\n // const value = this._littleEndian ? left + (2 ** 32 * right) : (2 ** 32 * left) + right;\n\n\n const value = left + 2 ** 32 * right;\n this._offset += 8;\n return value;\n }\n\n _nextInt32() {\n const value = this._dataView.getInt32(this._offset, this._littleEndian);\n\n this._offset += 4;\n return value;\n }\n\n _skip(bytes) {\n this._offset += bytes;\n return this;\n }\n\n _scan(maxByteLength, term = 0x00) {\n const byteOffset = this._offset;\n let byteLength = 0;\n\n while (this._dataView.getUint8(this._offset) !== term && byteLength < maxByteLength) {\n byteLength++;\n this._offset++;\n }\n\n if (byteLength < maxByteLength) this._offset++;\n return new Uint8Array(this._dataView.buffer, this._dataView.byteOffset + byteOffset, byteLength);\n }\n\n}\n\n///////////////////////////////////////////////////\n// Common.\n///////////////////////////////////////////////////\nconst KTX_WRITER = `KTX-Parse v${\"0.4.5\"}`;\nconst NUL = new Uint8Array([0x00]); ///////////////////////////////////////////////////\n// KTX2 Header.\n///////////////////////////////////////////////////\n\nconst KTX2_ID = [// '´', 'K', 'T', 'X', '2', '0', 'ª', '\\r', '\\n', '\\x1A', '\\n'\n0xab, 0x4b, 0x54, 0x58, 0x20, 0x32, 0x30, 0xbb, 0x0d, 0x0a, 0x1a, 0x0a];\nconst HEADER_BYTE_LENGTH = 68; // 13 * 4 + 2 * 8\n\n/** Encodes text to an ArrayBuffer. */\nfunction encodeText(text) {\n if (typeof TextEncoder !== 'undefined') {\n return new TextEncoder().encode(text);\n }\n\n return Buffer.from(text);\n}\n/** Decodes an ArrayBuffer to text. */\n\nfunction decodeText(buffer) {\n if (typeof TextDecoder !== 'undefined') {\n return new TextDecoder().decode(buffer);\n }\n\n return Buffer.from(buffer).toString('utf8');\n}\n/** Concatenates N ArrayBuffers. */\n\nfunction concat(buffers) {\n let totalByteLength = 0;\n\n for (const buffer of buffers) {\n totalByteLength += buffer.byteLength;\n }\n\n const result = new Uint8Array(totalByteLength);\n let byteOffset = 0;\n\n for (const buffer of buffers) {\n result.set(new Uint8Array(buffer), byteOffset);\n byteOffset += buffer.byteLength;\n }\n\n return result;\n}\n\n/**\r\n * Parses a KTX 2.0 file, returning an unpacked {@link KTX2Container} instance with all associated\r\n * data. The container's mip levels and other binary data are pointers into the original file, not\r\n * copies, so the original file should not be overwritten after reading.\r\n *\r\n * @param data Bytes of KTX 2.0 file, as Uint8Array or Buffer.\r\n */\n\nfunction read(data) {\n ///////////////////////////////////////////////////\n // KTX 2.0 Identifier.\n ///////////////////////////////////////////////////\n const id = new Uint8Array(data.buffer, data.byteOffset, KTX2_ID.length);\n\n if (id[0] !== KTX2_ID[0] || // '´'\n id[1] !== KTX2_ID[1] || // 'K'\n id[2] !== KTX2_ID[2] || // 'T'\n id[3] !== KTX2_ID[3] || // 'X'\n id[4] !== KTX2_ID[4] || // ' '\n id[5] !== KTX2_ID[5] || // '2'\n id[6] !== KTX2_ID[6] || // '0'\n id[7] !== KTX2_ID[7] || // 'ª'\n id[8] !== KTX2_ID[8] || // '\\r'\n id[9] !== KTX2_ID[9] || // '\\n'\n id[10] !== KTX2_ID[10] || // '\\x1A'\n id[11] !== KTX2_ID[11] // '\\n'\n ) {\n throw new Error('Missing KTX 2.0 identifier.');\n }\n\n const container = new KTX2Container(); ///////////////////////////////////////////////////\n // Header.\n ///////////////////////////////////////////////////\n\n const headerByteLength = 17 * Uint32Array.BYTES_PER_ELEMENT;\n const headerReader = new BufferReader(data, KTX2_ID.length, headerByteLength, true);\n container.vkFormat = headerReader._nextUint32();\n container.typeSize = headerReader._nextUint32();\n container.pixelWidth = headerReader._nextUint32();\n container.pixelHeight = headerReader._nextUint32();\n container.pixelDepth = headerReader._nextUint32();\n container.layerCount = headerReader._nextUint32();\n container.faceCount = headerReader._nextUint32();\n\n const levelCount = headerReader._nextUint32();\n\n container.supercompressionScheme = headerReader._nextUint32();\n\n const dfdByteOffset = headerReader._nextUint32();\n\n const dfdByteLength = headerReader._nextUint32();\n\n const kvdByteOffset = headerReader._nextUint32();\n\n const kvdByteLength = headerReader._nextUint32();\n\n const sgdByteOffset = headerReader._nextUint64();\n\n const sgdByteLength = headerReader._nextUint64(); ///////////////////////////////////////////////////\n // Level Index.\n ///////////////////////////////////////////////////\n\n\n const levelByteLength = levelCount * 3 * 8;\n const levelReader = new BufferReader(data, KTX2_ID.length + headerByteLength, levelByteLength, true);\n\n for (let i = 0; i < levelCount; i++) {\n container.levels.push({\n levelData: new Uint8Array(data.buffer, data.byteOffset + levelReader._nextUint64(), levelReader._nextUint64()),\n uncompressedByteLength: levelReader._nextUint64()\n });\n } ///////////////////////////////////////////////////\n // Data Format Descriptor (DFD).\n ///////////////////////////////////////////////////\n\n\n const dfdReader = new BufferReader(data, dfdByteOffset, dfdByteLength, true);\n const dfd = {\n vendorId: dfdReader._skip(4\n /* totalSize */\n )._nextUint16(),\n descriptorType: dfdReader._nextUint16(),\n versionNumber: dfdReader._nextUint16(),\n descriptorBlockSize: dfdReader._nextUint16(),\n colorModel: dfdReader._nextUint8(),\n colorPrimaries: dfdReader._nextUint8(),\n transferFunction: dfdReader._nextUint8(),\n flags: dfdReader._nextUint8(),\n texelBlockDimension: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],\n bytesPlane: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],\n samples: []\n };\n const sampleStart = 6;\n const sampleWords = 4;\n const numSamples = (dfd.descriptorBlockSize / 4 - sampleStart) / sampleWords;\n\n for (let i = 0; i < numSamples; i++) {\n const sample = {\n bitOffset: dfdReader._nextUint16(),\n bitLength: dfdReader._nextUint8(),\n channelType: dfdReader._nextUint8(),\n samplePosition: [dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8(), dfdReader._nextUint8()],\n sampleLower: -Infinity,\n sampleUpper: Infinity\n };\n\n if (sample.channelType & KHR_DF_SAMPLE_DATATYPE_SIGNED) {\n sample.sampleLower = dfdReader._nextInt32();\n sample.sampleUpper = dfdReader._nextInt32();\n } else {\n sample.sampleLower = dfdReader._nextUint32();\n sample.sampleUpper = dfdReader._nextUint32();\n }\n\n dfd.samples[i] = sample;\n }\n\n container.dataFormatDescriptor.length = 0;\n container.dataFormatDescriptor.push(dfd); ///////////////////////////////////////////////////\n // Key/Value Data (KVD).\n ///////////////////////////////////////////////////\n\n const kvdReader = new BufferReader(data, kvdByteOffset, kvdByteLength, true);\n\n while (kvdReader._offset < kvdByteLength) {\n const keyValueByteLength = kvdReader._nextUint32();\n\n const keyData = kvdReader._scan(keyValueByteLength);\n\n const key = decodeText(keyData);\n\n const valueData = kvdReader._scan(keyValueByteLength - keyData.byteLength);\n\n container.keyValue[key] = key.match(/^ktx/i) ? decodeText(valueData) : valueData; // 4-byte alignment.\n\n if (kvdReader._offset % 4) kvdReader._skip(4 - kvdReader._offset % 4);\n } ///////////////////////////////////////////////////\n // Supercompression Global Data (SGD).\n ///////////////////////////////////////////////////\n\n\n if (sgdByteLength <= 0) return container;\n const sgdReader = new BufferReader(data, sgdByteOffset, sgdByteLength, true);\n\n const endpointCount = sgdReader._nextUint16();\n\n const selectorCount = sgdReader._nextUint16();\n\n const endpointsByteLength = sgdReader._nextUint32();\n\n const selectorsByteLength = sgdReader._nextUint32();\n\n const tablesByteLength = sgdReader._nextUint32();\n\n const extendedByteLength = sgdReader._nextUint32();\n\n const imageDescs = [];\n\n for (let i = 0; i < levelCount; i++) {\n imageDescs.push({\n imageFlags: sgdReader._nextUint32(),\n rgbSliceByteOffset: sgdReader._nextUint32(),\n rgbSliceByteLength: sgdReader._nextUint32(),\n alphaSliceByteOffset: sgdReader._nextUint32(),\n alphaSliceByteLength: sgdReader._nextUint32()\n });\n }\n\n const endpointsByteOffset = sgdByteOffset + sgdReader._offset;\n const selectorsByteOffset = endpointsByteOffset + endpointsByteLength;\n const tablesByteOffset = selectorsByteOffset + selectorsByteLength;\n const extendedByteOffset = tablesByteOffset + tablesByteLength;\n const endpointsData = new Uint8Array(data.buffer, data.byteOffset + endpointsByteOffset, endpointsByteLength);\n const selectorsData = new Uint8Array(data.buffer, data.byteOffset + selectorsByteOffset, selectorsByteLength);\n const tablesData = new Uint8Array(data.buffer, data.byteOffset + tablesByteOffset, tablesByteLength);\n const extendedData = new Uint8Array(data.buffer, data.byteOffset + extendedByteOffset, extendedByteLength);\n container.globalData = {\n endpointCount,\n selectorCount,\n imageDescs,\n endpointsData,\n selectorsData,\n tablesData,\n extendedData\n };\n return container;\n}\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nconst DEFAULT_OPTIONS = {\n keepWriter: false\n};\n/**\r\n * Serializes a {@link KTX2Container} instance to a KTX 2.0 file. Mip levels and other binary data\r\n * are copied into the resulting Uint8Array, so the original container can safely be edited or\r\n * destroyed after it is serialized.\r\n *\r\n * Options:\r\n * - keepWriter: If true, 'KTXWriter' key/value field is written as provided by the container.\r\n * \t\tOtherwise, a string for the current ktx-parse version is generated. Default: false.\r\n *\r\n * @param container\r\n * @param options\r\n */\n\nfunction write(container, options = {}) {\n options = _extends({}, DEFAULT_OPTIONS, options); ///////////////////////////////////////////////////\n // Supercompression Global Data (SGD).\n ///////////////////////////////////////////////////\n\n let sgdBuffer = new ArrayBuffer(0);\n\n if (container.globalData) {\n const sgdHeaderBuffer = new ArrayBuffer(20 + container.globalData.imageDescs.length * 5 * 4);\n const sgdHeaderView = new DataView(sgdHeaderBuffer);\n sgdHeaderView.setUint16(0, container.globalData.endpointCount, true);\n sgdHeaderView.setUint16(2, container.globalData.selectorCount, true);\n sgdHeaderView.setUint32(4, container.globalData.endpointsData.byteLength, true);\n sgdHeaderView.setUint32(8, container.globalData.selectorsData.byteLength, true);\n sgdHeaderView.setUint32(12, container.globalData.tablesData.byteLength, true);\n sgdHeaderView.setUint32(16, container.globalData.extendedData.byteLength, true);\n\n for (let i = 0; i < container.globalData.imageDescs.length; i++) {\n const imageDesc = container.globalData.imageDescs[i];\n sgdHeaderView.setUint32(20 + i * 5 * 4 + 0, imageDesc.imageFlags, true);\n sgdHeaderView.setUint32(20 + i * 5 * 4 + 4, imageDesc.rgbSliceByteOffset, true);\n sgdHeaderView.setUint32(20 + i * 5 * 4 + 8, imageDesc.rgbSliceByteLength, true);\n sgdHeaderView.setUint32(20 + i * 5 * 4 + 12, imageDesc.alphaSliceByteOffset, true);\n sgdHeaderView.setUint32(20 + i * 5 * 4 + 16, imageDesc.alphaSliceByteLength, true);\n }\n\n sgdBuffer = concat([sgdHeaderBuffer, container.globalData.endpointsData, container.globalData.selectorsData, container.globalData.tablesData, container.globalData.extendedData]);\n } ///////////////////////////////////////////////////\n // Key/Value Data (KVD).\n ///////////////////////////////////////////////////\n\n\n const keyValueData = [];\n let keyValue = container.keyValue;\n\n if (!options.keepWriter) {\n keyValue = _extends({}, container.keyValue, {\n KTXwriter: KTX_WRITER\n });\n }\n\n for (const key in keyValue) {\n const value = keyValue[key];\n const keyData = encodeText(key);\n const valueData = typeof value === 'string' ? encodeText(value) : value;\n const kvByteLength = keyData.byteLength + 1 + valueData.byteLength + 1;\n const kvPadding = kvByteLength % 4 ? 4 - kvByteLength % 4 : 0; // align(4)\n\n keyValueData.push(concat([new Uint32Array([kvByteLength]), keyData, NUL, valueData, NUL, new Uint8Array(kvPadding).fill(0x00) // align(4)\n ]));\n }\n\n const kvdBuffer = concat(keyValueData); ///////////////////////////////////////////////////\n // Data Format Descriptor (DFD).\n ///////////////////////////////////////////////////\n\n if (container.dataFormatDescriptor.length !== 1 || container.dataFormatDescriptor[0].descriptorType !== KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT) {\n throw new Error('Only BASICFORMAT Data Format Descriptor output supported.');\n }\n\n const dfd = container.dataFormatDescriptor[0];\n const dfdBuffer = new ArrayBuffer(28 + dfd.samples.length * 16);\n const dfdView = new DataView(dfdBuffer);\n const descriptorBlockSize = 24 + dfd.samples.length * 16;\n dfdView.setUint32(0, dfdBuffer.byteLength, true);\n dfdView.setUint16(4, dfd.vendorId, true);\n dfdView.setUint16(6, dfd.descriptorType, true);\n dfdView.setUint16(8, dfd.versionNumber, true);\n dfdView.setUint16(10, descriptorBlockSize, true);\n dfdView.setUint8(12, dfd.colorModel);\n dfdView.setUint8(13, dfd.colorPrimaries);\n dfdView.setUint8(14, dfd.transferFunction);\n dfdView.setUint8(15, dfd.flags);\n\n if (!Array.isArray(dfd.texelBlockDimension)) {\n throw new Error('texelBlockDimension is now an array. For dimensionality `d`, set `d - 1`.');\n }\n\n dfdView.setUint8(16, dfd.texelBlockDimension[0]);\n dfdView.setUint8(17, dfd.texelBlockDimension[1]);\n dfdView.setUint8(18, dfd.texelBlockDimension[2]);\n dfdView.setUint8(19, dfd.texelBlockDimension[3]);\n\n for (let i = 0; i < 8; i++) dfdView.setUint8(20 + i, dfd.bytesPlane[i]);\n\n for (let i = 0; i < dfd.samples.length; i++) {\n const sample = dfd.samples[i];\n const sampleByteOffset = 28 + i * 16;\n\n if (sample.channelID) {\n throw new Error('channelID has been renamed to channelType.');\n }\n\n dfdView.setUint16(sampleByteOffset + 0, sample.bitOffset, true);\n dfdView.setUint8(sampleByteOffset + 2, sample.bitLength);\n dfdView.setUint8(sampleByteOffset + 3, sample.channelType);\n dfdView.setUint8(sampleByteOffset + 4, sample.samplePosition[0]);\n dfdView.setUint8(sampleByteOffset + 5, sample.samplePosition[1]);\n dfdView.setUint8(sampleByteOffset + 6, sample.samplePosition[2]);\n dfdView.setUint8(sampleByteOffset + 7, sample.samplePosition[3]);\n\n if (sample.channelType & KHR_DF_SAMPLE_DATATYPE_SIGNED) {\n dfdView.setInt32(sampleByteOffset + 8, sample.sampleLower, true);\n dfdView.setInt32(sampleByteOffset + 12, sample.sampleUpper, true);\n } else {\n dfdView.setUint32(sampleByteOffset + 8, sample.sampleLower, true);\n dfdView.setUint32(sampleByteOffset + 12, sample.sampleUpper, true);\n }\n } ///////////////////////////////////////////////////\n // Data alignment.\n ///////////////////////////////////////////////////\n\n\n const dfdByteOffset = KTX2_ID.length + HEADER_BYTE_LENGTH + container.levels.length * 3 * 8;\n const kvdByteOffset = dfdByteOffset + dfdBuffer.byteLength;\n let sgdByteOffset = sgdBuffer.byteLength > 0 ? kvdByteOffset + kvdBuffer.byteLength : 0;\n if (sgdByteOffset % 8) sgdByteOffset += 8 - sgdByteOffset % 8; // align(8)\n ///////////////////////////////////////////////////\n // Level Index.\n ///////////////////////////////////////////////////\n\n const levelData = [];\n const levelIndex = new DataView(new ArrayBuffer(container.levels.length * 3 * 8));\n let levelDataByteOffset = (sgdByteOffset || kvdByteOffset + kvdBuffer.byteLength) + sgdBuffer.byteLength;\n\n for (let i = 0; i < container.levels.length; i++) {\n const level = container.levels[i];\n levelData.push(level.levelData);\n levelIndex.setBigUint64(i * 24 + 0, BigInt(levelDataByteOffset), true);\n levelIndex.setBigUint64(i * 24 + 8, BigInt(level.levelData.byteLength), true);\n levelIndex.setBigUint64(i * 24 + 16, BigInt(level.uncompressedByteLength), true);\n levelDataByteOffset += level.levelData.byteLength;\n } ///////////////////////////////////////////////////\n // Header.\n ///////////////////////////////////////////////////\n\n\n const headerBuffer = new ArrayBuffer(HEADER_BYTE_LENGTH);\n const headerView = new DataView(headerBuffer);\n headerView.setUint32(0, container.vkFormat, true);\n headerView.setUint32(4, container.typeSize, true);\n headerView.setUint32(8, container.pixelWidth, true);\n headerView.setUint32(12, container.pixelHeight, true);\n headerView.setUint32(16, container.pixelDepth, true);\n headerView.setUint32(20, container.layerCount, true);\n headerView.setUint32(24, container.faceCount, true);\n headerView.setUint32(28, container.levels.length, true);\n headerView.setUint32(32, container.supercompressionScheme, true);\n headerView.setUint32(36, dfdByteOffset, true);\n headerView.setUint32(40, dfdBuffer.byteLength, true);\n headerView.setUint32(44, kvdByteOffset, true);\n headerView.setUint32(48, kvdBuffer.byteLength, true);\n headerView.setBigUint64(52, BigInt(sgdBuffer.byteLength > 0 ? sgdByteOffset : 0), true);\n headerView.setBigUint64(60, BigInt(sgdBuffer.byteLength), true); ///////////////////////////////////////////////////\n // Compose.\n ///////////////////////////////////////////////////\n\n return new Uint8Array(concat([new Uint8Array(KTX2_ID).buffer, headerBuffer, levelIndex.buffer, dfdBuffer, kvdBuffer, sgdByteOffset > 0 ? new ArrayBuffer(sgdByteOffset - (kvdByteOffset + kvdBuffer.byteLength)) // align(8)\n : new ArrayBuffer(0), sgdBuffer, ...levelData]));\n}\n\nexport { KHR_DF_CHANNEL_RGBSDA_ALPHA, KHR_DF_CHANNEL_RGBSDA_BLUE, KHR_DF_CHANNEL_RGBSDA_DEPTH, KHR_DF_CHANNEL_RGBSDA_GREEN, KHR_DF_CHANNEL_RGBSDA_RED, KHR_DF_CHANNEL_RGBSDA_STENCIL, KHR_DF_FLAG_ALPHA_PREMULTIPLIED, KHR_DF_FLAG_ALPHA_STRAIGHT, KHR_DF_KHR_DESCRIPTORTYPE_BASICFORMAT, KHR_DF_MODEL_ASTC, KHR_DF_MODEL_ETC1, KHR_DF_MODEL_ETC1S, KHR_DF_MODEL_ETC2, KHR_DF_MODEL_RGBSDA, KHR_DF_MODEL_UASTC, KHR_DF_MODEL_UNSPECIFIED, KHR_DF_PRIMARIES_ACES, KHR_DF_PRIMARIES_ACESCC, KHR_DF_PRIMARIES_ADOBERGB, KHR_DF_PRIMARIES_BT2020, KHR_DF_PRIMARIES_BT601_EBU, KHR_DF_PRIMARIES_BT601_SMPTE, KHR_DF_PRIMARIES_BT709, KHR_DF_PRIMARIES_CIEXYZ, KHR_DF_PRIMARIES_DISPLAYP3, KHR_DF_PRIMARIES_NTSC1953, KHR_DF_PRIMARIES_PAL525, KHR_DF_PRIMARIES_UNSPECIFIED, KHR_DF_SAMPLE_DATATYPE_EXPONENT, KHR_DF_SAMPLE_DATATYPE_FLOAT, KHR_DF_SAMPLE_DATATYPE_LINEAR, KHR_DF_SAMPLE_DATATYPE_SIGNED, KHR_DF_TRANSFER_ACESCC, KHR_DF_TRANSFER_ACESCCT, KHR_DF_TRANSFER_ADOBERGB, KHR_DF_TRANSFER_BT1886, KHR_DF_TRANSFER_DCIP3, KHR_DF_TRANSFER_HLG_EOTF, KHR_DF_TRANSFER_HLG_OETF, KHR_DF_TRANSFER_ITU, KHR_DF_TRANSFER_LINEAR, KHR_DF_TRANSFER_NTSC, KHR_DF_TRANSFER_PAL625_EOTF, KHR_DF_TRANSFER_PAL_OETF, KHR_DF_TRANSFER_PQ_EOTF, KHR_DF_TRANSFER_PQ_OETF, KHR_DF_TRANSFER_SLOG, KHR_DF_TRANSFER_SLOG2, KHR_DF_TRANSFER_SRGB, KHR_DF_TRANSFER_ST240, KHR_DF_TRANSFER_UNSPECIFIED, KHR_DF_VENDORID_KHRONOS, KHR_DF_VERSION, KHR_SUPERCOMPRESSION_BASISLZ, KHR_SUPERCOMPRESSION_NONE, KHR_SUPERCOMPRESSION_ZLIB, KHR_SUPERCOMPRESSION_ZSTD, KTX2Container, VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_A2B10G10R10_SINT_PACK32, VK_FORMAT_A2B10G10R10_SNORM_PACK32, VK_FORMAT_A2B10G10R10_UINT_PACK32, VK_FORMAT_A2B10G10R10_UNORM_PACK32, VK_FORMAT_A2R10G10B10_SINT_PACK32, VK_FORMAT_A2R10G10B10_SNORM_PACK32, VK_FORMAT_A2R10G10B10_UINT_PACK32, VK_FORMAT_A2R10G10B10_UNORM_PACK32, VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT, VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT, VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x10_SRGB_BLOCK, VK_FORMAT_ASTC_10x10_UNORM_BLOCK, VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x5_SRGB_BLOCK, VK_FORMAT_ASTC_10x5_UNORM_BLOCK, VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x6_SRGB_BLOCK, VK_FORMAT_ASTC_10x6_UNORM_BLOCK, VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_10x8_SRGB_BLOCK, VK_FORMAT_ASTC_10x8_UNORM_BLOCK, VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_12x10_SRGB_BLOCK, VK_FORMAT_ASTC_12x10_UNORM_BLOCK, VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_12x12_SRGB_BLOCK, VK_FORMAT_ASTC_12x12_UNORM_BLOCK, VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_4x4_SRGB_BLOCK, VK_FORMAT_ASTC_4x4_UNORM_BLOCK, VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_5x4_SRGB_BLOCK, VK_FORMAT_ASTC_5x4_UNORM_BLOCK, VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_5x5_SRGB_BLOCK, VK_FORMAT_ASTC_5x5_UNORM_BLOCK, VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_6x5_SRGB_BLOCK, VK_FORMAT_ASTC_6x5_UNORM_BLOCK, VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_6x6_SRGB_BLOCK, VK_FORMAT_ASTC_6x6_UNORM_BLOCK, VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_8x5_SRGB_BLOCK, VK_FORMAT_ASTC_8x5_UNORM_BLOCK, VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_8x6_SRGB_BLOCK, VK_FORMAT_ASTC_8x6_UNORM_BLOCK, VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT, VK_FORMAT_ASTC_8x8_SRGB_BLOCK, VK_FORMAT_ASTC_8x8_UNORM_BLOCK, VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, VK_FORMAT_B4G4R4A4_UNORM_PACK16, VK_FORMAT_B5G5R5A1_UNORM_PACK16, VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_B8G8R8A8_SINT, VK_FORMAT_B8G8R8A8_SNORM, VK_FORMAT_B8G8R8A8_SRGB, VK_FORMAT_B8G8R8A8_UINT, VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8_SINT, VK_FORMAT_B8G8R8_SNORM, VK_FORMAT_B8G8R8_SRGB, VK_FORMAT_B8G8R8_UINT, VK_FORMAT_B8G8R8_UNORM, VK_FORMAT_BC1_RGBA_SRGB_BLOCK, VK_FORMAT_BC1_RGBA_UNORM_BLOCK, VK_FORMAT_BC1_RGB_SRGB_BLOCK, VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_BC2_SRGB_BLOCK, VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_BC3_SRGB_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_BC4_SNORM_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_BC5_SNORM_BLOCK, VK_FORMAT_BC5_UNORM_BLOCK, VK_FORMAT_BC6H_SFLOAT_BLOCK, VK_FORMAT_BC6H_UFLOAT_BLOCK, VK_FORMAT_BC7_SRGB_BLOCK, VK_FORMAT_BC7_UNORM_BLOCK, VK_FORMAT_D16_UNORM, VK_FORMAT_D16_UNORM_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_D32_SFLOAT, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, VK_FORMAT_EAC_R11G11_SNORM_BLOCK, VK_FORMAT_EAC_R11G11_UNORM_BLOCK, VK_FORMAT_EAC_R11_SNORM_BLOCK, VK_FORMAT_EAC_R11_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG, VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG, VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG, VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG, VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG, VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, VK_FORMAT_R10X6G10X6_UNORM_2PACK16, VK_FORMAT_R10X6_UNORM_PACK16, VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, VK_FORMAT_R12X4G12X4_UNORM_2PACK16, VK_FORMAT_R12X4_UNORM_PACK16, VK_FORMAT_R16G16B16A16_SFLOAT, VK_FORMAT_R16G16B16A16_SINT, VK_FORMAT_R16G16B16A16_SNORM, VK_FORMAT_R16G16B16A16_UINT, VK_FORMAT_R16G16B16A16_UNORM, VK_FORMAT_R16G16B16_SFLOAT, VK_FORMAT_R16G16B16_SINT, VK_FORMAT_R16G16B16_SNORM, VK_FORMAT_R16G16B16_UINT, VK_FORMAT_R16G16B16_UNORM, VK_FORMAT_R16G16_SFLOAT, VK_FORMAT_R16G16_SINT, VK_FORMAT_R16G16_SNORM, VK_FORMAT_R16G16_UINT, VK_FORMAT_R16G16_UNORM, VK_FORMAT_R16_SFLOAT, VK_FORMAT_R16_SINT, VK_FORMAT_R16_SNORM, VK_FORMAT_R16_UINT, VK_FORMAT_R16_UNORM, VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32B32A32_SINT, VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32_SFLOAT, VK_FORMAT_R32G32B32_SINT, VK_FORMAT_R32G32B32_UINT, VK_FORMAT_R32G32_SFLOAT, VK_FORMAT_R32G32_SINT, VK_FORMAT_R32G32_UINT, VK_FORMAT_R32_SFLOAT, VK_FORMAT_R32_SINT, VK_FORMAT_R32_UINT, VK_FORMAT_R4G4B4A4_UNORM_PACK16, VK_FORMAT_R4G4_UNORM_PACK8, VK_FORMAT_R5G5B5A1_UNORM_PACK16, VK_FORMAT_R5G6B5_UNORM_PACK16, VK_FORMAT_R64G64B64A64_SFLOAT, VK_FORMAT_R64G64B64A64_SINT, VK_FORMAT_R64G64B64A64_UINT, VK_FORMAT_R64G64B64_SFLOAT, VK_FORMAT_R64G64B64_SINT, VK_FORMAT_R64G64B64_UINT, VK_FORMAT_R64G64_SFLOAT, VK_FORMAT_R64G64_SINT, VK_FORMAT_R64G64_UINT, VK_FORMAT_R64_SFLOAT, VK_FORMAT_R64_SINT, VK_FORMAT_R64_UINT, VK_FORMAT_R8G8B8A8_SINT, VK_FORMAT_R8G8B8A8_SNORM, VK_FORMAT_R8G8B8A8_SRGB, VK_FORMAT_R8G8B8A8_UINT, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8_SINT, VK_FORMAT_R8G8B8_SNORM, VK_FORMAT_R8G8B8_SRGB, VK_FORMAT_R8G8B8_UINT, VK_FORMAT_R8G8B8_UNORM, VK_FORMAT_R8G8_SINT, VK_FORMAT_R8G8_SNORM, VK_FORMAT_R8G8_SRGB, VK_FORMAT_R8G8_UINT, VK_FORMAT_R8G8_UNORM, VK_FORMAT_R8_SINT, VK_FORMAT_R8_SNORM, VK_FORMAT_R8_SRGB, VK_FORMAT_R8_UINT, VK_FORMAT_R8_UNORM, VK_FORMAT_S8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_X8_D24_UNORM_PACK32, read, write };\n//# sourceMappingURL=ktx-parse.modern.js.map\n","/* global require */\r\nimport defined from \"../Core/defined.js\";\r\nimport Check from \"../Core/Check.js\";\r\nimport PixelFormat from \"../Core/PixelFormat.js\";\r\nimport RuntimeError from \"../Core/RuntimeError.js\";\r\nimport VulkanConstants from \"../Core//VulkanConstants.js\";\r\nimport PixelDatatype from \"../Renderer/PixelDatatype.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\nimport { read } from \"ktx-parse\";\r\n\r\nconst faceOrder = [\r\n \"positiveX\",\r\n \"negativeX\",\r\n \"positiveY\",\r\n \"negativeY\",\r\n \"positiveZ\",\r\n \"negativeZ\",\r\n];\r\n\r\n// Flags\r\nconst colorModelETC1S = 163;\r\nconst colorModelUASTC = 166;\r\n\r\nlet transcoderModule;\r\nfunction transcode(parameters, transferableObjects) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.object(\"transcoderModule\", transcoderModule);\r\n //>>includeEnd('debug');\r\n\r\n const data = parameters.ktx2Buffer;\r\n const supportedTargetFormats = parameters.supportedTargetFormats;\r\n let header;\r\n try {\r\n header = read(data);\r\n } catch (e) {\r\n throw new RuntimeError(\"Invalid KTX2 file.\");\r\n }\r\n\r\n if (header.layerCount !== 0) {\r\n throw new RuntimeError(\"KTX2 texture arrays are not supported.\");\r\n }\r\n\r\n if (header.pixelDepth !== 0) {\r\n throw new RuntimeError(\"KTX2 3D textures are unsupported.\");\r\n }\r\n\r\n const dfd = header.dataFormatDescriptor[0];\r\n const result = new Array(header.levelCount);\r\n\r\n if (\r\n header.vkFormat === 0x0 &&\r\n (dfd.colorModel === colorModelETC1S || dfd.colorModel === colorModelUASTC)\r\n ) {\r\n // Compressed, initialize transcoder module\r\n transcodeCompressed(\r\n data,\r\n header,\r\n supportedTargetFormats,\r\n transcoderModule,\r\n transferableObjects,\r\n result\r\n );\r\n } else {\r\n transferableObjects.push(data.buffer);\r\n parseUncompressed(header, result);\r\n }\r\n\r\n return result;\r\n}\r\n\r\n// Parser for uncompressed\r\nfunction parseUncompressed(header, result) {\r\n const internalFormat =\r\n header.vkFormat === VulkanConstants.VK_FORMAT_R8G8B8_SRGB\r\n ? PixelFormat.RGB\r\n : PixelFormat.RGBA;\r\n let datatype;\r\n if (header.vkFormat === VulkanConstants.VK_FORMAT_R8G8B8A8_UNORM) {\r\n datatype = PixelDatatype.UNSIGNED_BYTE;\r\n } else if (\r\n header.vkFormat === VulkanConstants.VK_FORMAT_R16G16B16A16_SFLOAT\r\n ) {\r\n datatype = PixelDatatype.HALF_FLOAT;\r\n } else if (\r\n header.vkFormat === VulkanConstants.VK_FORMAT_R32G32B32A32_SFLOAT\r\n ) {\r\n datatype = PixelDatatype.FLOAT;\r\n }\r\n\r\n for (let i = 0; i < header.levels.length; ++i) {\r\n const level = {};\r\n result[i] = level;\r\n const levelBuffer = header.levels[i].levelData;\r\n\r\n const width = header.pixelWidth >> i;\r\n const height = header.pixelHeight >> i;\r\n const faceLength =\r\n width * height * PixelFormat.componentsLength(internalFormat);\r\n\r\n for (let j = 0; j < header.faceCount; ++j) {\r\n // multiply levelBuffer.byteOffset by the size in bytes of the pixel data type\r\n const faceByteOffset =\r\n levelBuffer.byteOffset + faceLength * header.typeSize * j;\r\n let faceView;\r\n if (!defined(datatype) || PixelDatatype.sizeInBytes(datatype) === 1) {\r\n faceView = new Uint8Array(\r\n levelBuffer.buffer,\r\n faceByteOffset,\r\n faceLength\r\n );\r\n } else if (PixelDatatype.sizeInBytes(datatype) === 2) {\r\n faceView = new Uint16Array(\r\n levelBuffer.buffer,\r\n faceByteOffset,\r\n faceLength\r\n );\r\n } else {\r\n faceView = new Float32Array(\r\n levelBuffer.buffer,\r\n faceByteOffset,\r\n faceLength\r\n );\r\n }\r\n\r\n level[faceOrder[j]] = {\r\n internalFormat: internalFormat,\r\n datatype: datatype,\r\n width: width,\r\n height: height,\r\n levelBuffer: faceView,\r\n };\r\n }\r\n }\r\n}\r\n\r\nfunction transcodeCompressed(\r\n data,\r\n header,\r\n supportedTargetFormats,\r\n transcoderModule,\r\n transferableObjects,\r\n result\r\n) {\r\n const ktx2File = new transcoderModule.KTX2File(data);\r\n let width = ktx2File.getWidth();\r\n let height = ktx2File.getHeight();\r\n const levels = ktx2File.getLevels();\r\n const hasAlpha = ktx2File.getHasAlpha();\r\n\r\n if (!(width > 0) || !(height > 0) || !(levels > 0)) {\r\n ktx2File.close();\r\n ktx2File.delete();\r\n throw new RuntimeError(\"Invalid KTX2 file\");\r\n }\r\n\r\n let internalFormat, transcoderFormat;\r\n const dfd = header.dataFormatDescriptor[0];\r\n const BasisFormat = transcoderModule.transcoder_texture_format;\r\n\r\n // Determine target format based on platform support\r\n if (dfd.colorModel === colorModelETC1S) {\r\n if (supportedTargetFormats.etc) {\r\n internalFormat = hasAlpha\r\n ? PixelFormat.RGBA8_ETC2_EAC\r\n : PixelFormat.RGB8_ETC2;\r\n transcoderFormat = hasAlpha\r\n ? BasisFormat.cTFETC2_RGBA\r\n : BasisFormat.cTFETC1_RGB;\r\n } else if (supportedTargetFormats.etc1 && !hasAlpha) {\r\n internalFormat = PixelFormat.RGB_ETC1;\r\n transcoderFormat = BasisFormat.cTFETC1_RGB;\r\n } else if (supportedTargetFormats.s3tc) {\r\n internalFormat = hasAlpha ? PixelFormat.RGBA_DXT5 : PixelFormat.RGB_DXT1;\r\n transcoderFormat = hasAlpha\r\n ? BasisFormat.cTFBC3_RGBA\r\n : BasisFormat.cTFBC1_RGB;\r\n } else if (supportedTargetFormats.pvrtc) {\r\n internalFormat = hasAlpha\r\n ? PixelFormat.RGBA_PVRTC_4BPPV1\r\n : PixelFormat.RGB_PVRTC_4BPPV1;\r\n transcoderFormat = hasAlpha\r\n ? BasisFormat.cTFPVRTC1_4_RGBA\r\n : BasisFormat.cTFPVRTC1_4_RGB;\r\n } else if (supportedTargetFormats.astc) {\r\n internalFormat = PixelFormat.RGBA_ASTC;\r\n transcoderFormat = BasisFormat.cTFASTC_4x4_RGBA;\r\n } else if (supportedTargetFormats.bc7) {\r\n internalFormat = PixelFormat.RGBA_BC7;\r\n transcoderFormat = BasisFormat.cTFBC7_RGBA;\r\n } else {\r\n throw new RuntimeError(\r\n \"No transcoding format target available for ETC1S compressed ktx2.\"\r\n );\r\n }\r\n } else if (dfd.colorModel === colorModelUASTC) {\r\n if (supportedTargetFormats.astc) {\r\n internalFormat = PixelFormat.RGBA_ASTC;\r\n transcoderFormat = BasisFormat.cTFASTC_4x4_RGBA;\r\n } else if (supportedTargetFormats.bc7) {\r\n internalFormat = PixelFormat.RGBA_BC7;\r\n transcoderFormat = BasisFormat.cTFBC7_RGBA;\r\n } else if (supportedTargetFormats.s3tc) {\r\n internalFormat = hasAlpha ? PixelFormat.RGBA_DXT5 : PixelFormat.RGB_DXT1;\r\n transcoderFormat = hasAlpha\r\n ? BasisFormat.cTFBC3_RGBA\r\n : BasisFormat.cTFBC1_RGB;\r\n } else if (supportedTargetFormats.etc) {\r\n internalFormat = hasAlpha\r\n ? PixelFormat.RGBA8_ETC2_EAC\r\n : PixelFormat.RGB8_ETC2;\r\n transcoderFormat = hasAlpha\r\n ? BasisFormat.cTFETC2_RGBA\r\n : BasisFormat.cTFETC1_RGB;\r\n } else if (supportedTargetFormats.etc1 && !hasAlpha) {\r\n internalFormat = PixelFormat.RGB_ETC1;\r\n transcoderFormat = BasisFormat.cTFETC1_RGB;\r\n } else if (supportedTargetFormats.pvrtc) {\r\n internalFormat = hasAlpha\r\n ? PixelFormat.RGBA_PVRTC_4BPPV1\r\n : PixelFormat.RGB_PVRTC_4BPPV1;\r\n transcoderFormat = hasAlpha\r\n ? BasisFormat.cTFPVRTC1_4_RGBA\r\n : BasisFormat.cTFPVRTC1_4_RGB;\r\n } else {\r\n throw new RuntimeError(\r\n \"No transcoding format target available for UASTC compressed ktx2.\"\r\n );\r\n }\r\n }\r\n\r\n if (!ktx2File.startTranscoding()) {\r\n ktx2File.close();\r\n ktx2File.delete();\r\n throw new RuntimeError(\"startTranscoding() failed\");\r\n }\r\n\r\n for (let i = 0; i < header.levels.length; ++i) {\r\n const level = {};\r\n result[i] = level;\r\n width = header.pixelWidth >> i;\r\n height = header.pixelHeight >> i;\r\n\r\n // Since supercompressed cubemaps are unsupported, this function\r\n // does not iterate over KTX2 faces and assumes faceCount = 1.\r\n\r\n const dstSize = ktx2File.getImageTranscodedSizeInBytes(\r\n i, // level index\r\n 0, // layer index\r\n 0, // face index\r\n transcoderFormat.value\r\n );\r\n const dst = new Uint8Array(dstSize);\r\n\r\n const transcoded = ktx2File.transcodeImage(\r\n dst,\r\n i, // level index\r\n 0, // layer index\r\n 0, // face index\r\n transcoderFormat.value,\r\n 0, // get_alpha_for_opaque_formats\r\n -1, // channel0\r\n -1 // channel1\r\n );\r\n\r\n if (!defined(transcoded)) {\r\n throw new RuntimeError(\"transcodeImage() failed.\");\r\n }\r\n\r\n transferableObjects.push(dst.buffer);\r\n\r\n level[faceOrder[0]] = {\r\n internalFormat: internalFormat,\r\n width: width,\r\n height: height,\r\n levelBuffer: dst,\r\n };\r\n }\r\n\r\n ktx2File.close();\r\n ktx2File.delete();\r\n return result;\r\n}\r\n\r\nfunction initWorker(compiledModule) {\r\n transcoderModule = compiledModule;\r\n transcoderModule.initializeBasis();\r\n\r\n self.onmessage = createTaskProcessorWorker(transcode);\r\n self.postMessage(true);\r\n}\r\n\r\nfunction transcodeKTX2(event) {\r\n const data = event.data;\r\n\r\n // Expect the first message to be to load a web assembly module\r\n const wasmConfig = data.webAssemblyConfig;\r\n if (defined(wasmConfig)) {\r\n // Require and compile WebAssembly module, or use fallback if not supported\r\n return require([wasmConfig.modulePath], function (mscBasisTranscoder) {\r\n if (defined(wasmConfig.wasmBinaryFile)) {\r\n if (!defined(mscBasisTranscoder)) {\r\n mscBasisTranscoder = self.MSC_TRANSCODER;\r\n }\r\n\r\n mscBasisTranscoder(wasmConfig).then(function (compiledModule) {\r\n initWorker(compiledModule);\r\n });\r\n } else {\r\n return mscBasisTranscoder().then(function (transcoder) {\r\n initWorker(transcoder);\r\n });\r\n }\r\n });\r\n }\r\n}\r\nexport default transcodeKTX2;\r\n"],"names":["WebGLConstants","PixelDatatype","Check","RuntimeError","VulkanConstants","PixelFormat","defined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM,aAAa,GAAG;EACtB,EAAE,aAAa,EAAEA,6BAAc,CAAC,aAAa;EAC7C,EAAE,cAAc,EAAEA,6BAAc,CAAC,cAAc;EAC/C,EAAE,YAAY,EAAEA,6BAAc,CAAC,YAAY;EAC3C,EAAE,KAAK,EAAEA,6BAAc,CAAC,KAAK;EAC7B,EAAE,UAAU,EAAEA,6BA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CAAC,sBAAsB;EAC1D,IAAI,aAAa,KAAK,aAAa,CAAC,oBAAoB;EACxD,IAAI;EACJ,CAAC,CAAC;AACF;AACA,wBAAe,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;;EC9F3C;EACA;EACA;EACA;EACA;EACA,MAAM,WAAW,GAAG;EACpB;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,eAAe,EAAEA,6BAAc,CAAC,eAAe;AACjD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,aAAa,EAAEA,6BAAc,CAAC,aAAa;AAC7C;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,KAAK,EAAEA,6BAAc,CAAC,KAAK;AAC7B;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,GAAG,EAAEA,6BAAc,CAAC,GAAG;AACzB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,IAAI,EAAEA,6BAAc,CAAC,IAAI;AAC3B;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,EAAEA,6BAAc,CAAC,SAAS;AACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,eAAe,EAAEA,6BAAc,CAAC,eAAe;AACjD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,QAAQ,EAAEA,6BAAc,CAAC,4BAA4B;AACvD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,EAAEA,6BAAc,CAAC,6BAA6B;AACzD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,EAAEA,6BAAc,CAAC,6BAA6B;AACzD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,SAAS,EAAEA,6BAAc,CAAC,6BAA6B;AACzD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,gBAAgB,EAAEA,6BAAc,CAAC,+BAA+B;AAClE;EACA;EACA;EACA;EACA;EACA;EACA;EACA,EAAE,gBAAgB,EAAEA,6BAAc,CAAC,+BAA+B;A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B,CAAC,SAAS,CAAC,CAAC;EACxD,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;EACzB,CAAC;AACD;EACA,SAAS,aAAa,CAAC,KAAK,EAAE;EAC9B,EAAE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;AAC1B;EACA;EACA,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC;EAC5C,EAAE,IAAIG,oBAAO,CAAC,UAAU,CAAC,EAAE;EAC3B;EACA,IAAI,OAAO,OAAO,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,UAAU,kBAAkB,EAAE;EAC1E,MAAM,IAAIA,oBAAO,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE;EAC9C,QAAQ,IAAI,CAACA,oBAAO,CAAC,kBAAkB,CAAC,EAAE;EAC1C,UAAU,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC;EACnD,SAAS;AACT;EACA,QAAQ,kBAAkB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,UAAU,cAAc,EAAE;EACtE,UAAU,UAAU,CAAC,cAAc,CAAC,CAAC;EACrC,SAAS,CAAC,CAAC;EACX,OAAO,MAAM;EACb,QAAQ,OAAO,kBAAkB,EAAE,CAAC,IAAI,CAAC,UAAU,UAAU,EAAE;EAC/D,UAAU,UAAU,CAAC,UAAU,CAAC,CAAC;EACjC,SAAS,CAAC,CAAC;EACX,OAAO;EACP,KAAK,CAAC,CAAC;EACP,GAAG;EACH;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/Workers/transferTypedArrayTest.js b/examples/cesium/Workers/transferTypedArrayTest.js
new file mode 100644
index 0000000..76ed585
--- /dev/null
+++ b/examples/cesium/Workers/transferTypedArrayTest.js
@@ -0,0 +1,42 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+if (typeof self === "undefined") {
+ self = {};
+}
+self.onmessage = function(event) {
+ const array = event.data.array;
+ const postMessage = self.webkitPostMessage || self.postMessage;
+ try {
+ postMessage(
+ {
+ array
+ },
+ [array.buffer]
+ );
+ } catch (e) {
+ postMessage({});
+ }
+};
diff --git a/examples/cesium/Workers/upsampleQuantizedTerrainMesh.js b/examples/cesium/Workers/upsampleQuantizedTerrainMesh.js
new file mode 100644
index 0000000..356d0b6
--- /dev/null
+++ b/examples/cesium/Workers/upsampleQuantizedTerrainMesh.js
@@ -0,0 +1,1049 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+define(['./AttributeCompression-e9888cb8', './Transforms-11fb6b0a', './Matrix2-036c77dd', './Matrix3-f22b0303', './defaultValue-0ab18f7d', './TerrainEncoding-c7d764e4', './IndexDatatype-b4e5cf89', './Check-d10e5f2e', './Math-9be8b918', './OrientedBoundingBox-7e2eebab', './createTaskProcessorWorker', './ComponentDatatype-13a5630b', './WebGLConstants-f27a5e29', './combine-4598d225', './RuntimeError-e5c6a8b9', './EllipsoidTangentPlane-c421b2cb', './AxisAlignedBoundingBox-50342d27', './IntersectionTests-2c7928de', './Plane-c9f1487d'], (function (AttributeCompression, Transforms, Matrix2, Matrix3, defaultValue, TerrainEncoding, IndexDatatype, Check, Math$1, OrientedBoundingBox, createTaskProcessorWorker, ComponentDatatype, WebGLConstants, combine, RuntimeError, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane) { 'use strict';
+
+ /**
+ * Contains functions for operating on 2D triangles.
+ *
+ * @namespace Intersections2D
+ */
+ const Intersections2D = {};
+
+ /**
+ * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting
+ * polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2,
+ * 3, or 4 vertices.
+ *
+ * @param {Number} threshold The threshold coordinate value at which to clip the triangle.
+ * @param {Boolean} keepAbove true to keep the portion of the triangle above the threshold, or false
+ * to keep the portion below.
+ * @param {Number} u0 The coordinate of the first vertex in the triangle, in counter-clockwise order.
+ * @param {Number} u1 The coordinate of the second vertex in the triangle, in counter-clockwise order.
+ * @param {Number} u2 The coordinate of the third vertex in the triangle, in counter-clockwise order.
+ * @param {Number[]} [result] The array into which to copy the result. If this parameter is not supplied,
+ * a new array is constructed and returned.
+ * @returns {Number[]} The polygon that results after the clip, specified as a list of
+ * vertices. The vertices are specified in counter-clockwise order.
+ * Each vertex is either an index from the existing list (identified as
+ * a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.
+ * For new vertices, the -1 is followed by three additional numbers: the
+ * index of each of the two original vertices forming the line segment that
+ * the new vertex lies on, and the fraction of the distance from the first
+ * vertex to the second one.
+ *
+ * @example
+ * const result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);
+ * // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]
+ */
+ Intersections2D.clipTriangleAtAxisAlignedThreshold = function (
+ threshold,
+ keepAbove,
+ u0,
+ u1,
+ u2,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(threshold)) {
+ throw new Check.DeveloperError("threshold is required.");
+ }
+ if (!defaultValue.defined(keepAbove)) {
+ throw new Check.DeveloperError("keepAbove is required.");
+ }
+ if (!defaultValue.defined(u0)) {
+ throw new Check.DeveloperError("u0 is required.");
+ }
+ if (!defaultValue.defined(u1)) {
+ throw new Check.DeveloperError("u1 is required.");
+ }
+ if (!defaultValue.defined(u2)) {
+ throw new Check.DeveloperError("u2 is required.");
+ }
+ //>>includeEnd('debug');
+
+ if (!defaultValue.defined(result)) {
+ result = [];
+ } else {
+ result.length = 0;
+ }
+
+ let u0Behind;
+ let u1Behind;
+ let u2Behind;
+ if (keepAbove) {
+ u0Behind = u0 < threshold;
+ u1Behind = u1 < threshold;
+ u2Behind = u2 < threshold;
+ } else {
+ u0Behind = u0 > threshold;
+ u1Behind = u1 > threshold;
+ u2Behind = u2 > threshold;
+ }
+
+ const numBehind = u0Behind + u1Behind + u2Behind;
+
+ let u01Ratio;
+ let u02Ratio;
+ let u12Ratio;
+ let u10Ratio;
+ let u20Ratio;
+ let u21Ratio;
+
+ if (numBehind === 1) {
+ if (u0Behind) {
+ u01Ratio = (threshold - u0) / (u1 - u0);
+ u02Ratio = (threshold - u0) / (u2 - u0);
+
+ result.push(1);
+
+ result.push(2);
+
+ if (u02Ratio !== 1.0) {
+ result.push(-1);
+ result.push(0);
+ result.push(2);
+ result.push(u02Ratio);
+ }
+
+ if (u01Ratio !== 1.0) {
+ result.push(-1);
+ result.push(0);
+ result.push(1);
+ result.push(u01Ratio);
+ }
+ } else if (u1Behind) {
+ u12Ratio = (threshold - u1) / (u2 - u1);
+ u10Ratio = (threshold - u1) / (u0 - u1);
+
+ result.push(2);
+
+ result.push(0);
+
+ if (u10Ratio !== 1.0) {
+ result.push(-1);
+ result.push(1);
+ result.push(0);
+ result.push(u10Ratio);
+ }
+
+ if (u12Ratio !== 1.0) {
+ result.push(-1);
+ result.push(1);
+ result.push(2);
+ result.push(u12Ratio);
+ }
+ } else if (u2Behind) {
+ u20Ratio = (threshold - u2) / (u0 - u2);
+ u21Ratio = (threshold - u2) / (u1 - u2);
+
+ result.push(0);
+
+ result.push(1);
+
+ if (u21Ratio !== 1.0) {
+ result.push(-1);
+ result.push(2);
+ result.push(1);
+ result.push(u21Ratio);
+ }
+
+ if (u20Ratio !== 1.0) {
+ result.push(-1);
+ result.push(2);
+ result.push(0);
+ result.push(u20Ratio);
+ }
+ }
+ } else if (numBehind === 2) {
+ if (!u0Behind && u0 !== threshold) {
+ u10Ratio = (threshold - u1) / (u0 - u1);
+ u20Ratio = (threshold - u2) / (u0 - u2);
+
+ result.push(0);
+
+ result.push(-1);
+ result.push(1);
+ result.push(0);
+ result.push(u10Ratio);
+
+ result.push(-1);
+ result.push(2);
+ result.push(0);
+ result.push(u20Ratio);
+ } else if (!u1Behind && u1 !== threshold) {
+ u21Ratio = (threshold - u2) / (u1 - u2);
+ u01Ratio = (threshold - u0) / (u1 - u0);
+
+ result.push(1);
+
+ result.push(-1);
+ result.push(2);
+ result.push(1);
+ result.push(u21Ratio);
+
+ result.push(-1);
+ result.push(0);
+ result.push(1);
+ result.push(u01Ratio);
+ } else if (!u2Behind && u2 !== threshold) {
+ u02Ratio = (threshold - u0) / (u2 - u0);
+ u12Ratio = (threshold - u1) / (u2 - u1);
+
+ result.push(2);
+
+ result.push(-1);
+ result.push(0);
+ result.push(2);
+ result.push(u02Ratio);
+
+ result.push(-1);
+ result.push(1);
+ result.push(2);
+ result.push(u12Ratio);
+ }
+ } else if (numBehind !== 3) {
+ // Completely in front of threshold
+ result.push(0);
+ result.push(1);
+ result.push(2);
+ }
+ // else Completely behind threshold
+
+ return result;
+ };
+
+ /**
+ * Compute the barycentric coordinates of a 2D position within a 2D triangle.
+ *
+ * @param {Number} x The x coordinate of the position for which to find the barycentric coordinates.
+ * @param {Number} y The y coordinate of the position for which to find the barycentric coordinates.
+ * @param {Number} x1 The x coordinate of the triangle's first vertex.
+ * @param {Number} y1 The y coordinate of the triangle's first vertex.
+ * @param {Number} x2 The x coordinate of the triangle's second vertex.
+ * @param {Number} y2 The y coordinate of the triangle's second vertex.
+ * @param {Number} x3 The x coordinate of the triangle's third vertex.
+ * @param {Number} y3 The y coordinate of the triangle's third vertex.
+ * @param {Cartesian3} [result] The instance into to which to copy the result. If this parameter
+ * is undefined, a new instance is created and returned.
+ * @returns {Cartesian3} The barycentric coordinates of the position within the triangle.
+ *
+ * @example
+ * const result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);
+ * // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);
+ */
+ Intersections2D.computeBarycentricCoordinates = function (
+ x,
+ y,
+ x1,
+ y1,
+ x2,
+ y2,
+ x3,
+ y3,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ if (!defaultValue.defined(x)) {
+ throw new Check.DeveloperError("x is required.");
+ }
+ if (!defaultValue.defined(y)) {
+ throw new Check.DeveloperError("y is required.");
+ }
+ if (!defaultValue.defined(x1)) {
+ throw new Check.DeveloperError("x1 is required.");
+ }
+ if (!defaultValue.defined(y1)) {
+ throw new Check.DeveloperError("y1 is required.");
+ }
+ if (!defaultValue.defined(x2)) {
+ throw new Check.DeveloperError("x2 is required.");
+ }
+ if (!defaultValue.defined(y2)) {
+ throw new Check.DeveloperError("y2 is required.");
+ }
+ if (!defaultValue.defined(x3)) {
+ throw new Check.DeveloperError("x3 is required.");
+ }
+ if (!defaultValue.defined(y3)) {
+ throw new Check.DeveloperError("y3 is required.");
+ }
+ //>>includeEnd('debug');
+
+ const x1mx3 = x1 - x3;
+ const x3mx2 = x3 - x2;
+ const y2my3 = y2 - y3;
+ const y1my3 = y1 - y3;
+ const inverseDeterminant = 1.0 / (y2my3 * x1mx3 + x3mx2 * y1my3);
+ const ymy3 = y - y3;
+ const xmx3 = x - x3;
+ const l1 = (y2my3 * xmx3 + x3mx2 * ymy3) * inverseDeterminant;
+ const l2 = (-y1my3 * xmx3 + x1mx3 * ymy3) * inverseDeterminant;
+ const l3 = 1.0 - l1 - l2;
+
+ if (defaultValue.defined(result)) {
+ result.x = l1;
+ result.y = l2;
+ result.z = l3;
+ return result;
+ }
+ return new Matrix3.Cartesian3(l1, l2, l3);
+ };
+
+ /**
+ * Compute the intersection between 2 line segments
+ *
+ * @param {Number} x00 The x coordinate of the first line's first vertex.
+ * @param {Number} y00 The y coordinate of the first line's first vertex.
+ * @param {Number} x01 The x coordinate of the first line's second vertex.
+ * @param {Number} y01 The y coordinate of the first line's second vertex.
+ * @param {Number} x10 The x coordinate of the second line's first vertex.
+ * @param {Number} y10 The y coordinate of the second line's first vertex.
+ * @param {Number} x11 The x coordinate of the second line's second vertex.
+ * @param {Number} y11 The y coordinate of the second line's second vertex.
+ * @param {Cartesian2} [result] The instance into to which to copy the result. If this parameter
+ * is undefined, a new instance is created and returned.
+ * @returns {Cartesian2} The intersection point, undefined if there is no intersection point or lines are coincident.
+ *
+ * @example
+ * const result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);
+ * // result === new Cesium.Cartesian2(0.0, 1.0);
+ */
+ Intersections2D.computeLineSegmentLineSegmentIntersection = function (
+ x00,
+ y00,
+ x01,
+ y01,
+ x10,
+ y10,
+ x11,
+ y11,
+ result
+ ) {
+ //>>includeStart('debug', pragmas.debug);
+ Check.Check.typeOf.number("x00", x00);
+ Check.Check.typeOf.number("y00", y00);
+ Check.Check.typeOf.number("x01", x01);
+ Check.Check.typeOf.number("y01", y01);
+ Check.Check.typeOf.number("x10", x10);
+ Check.Check.typeOf.number("y10", y10);
+ Check.Check.typeOf.number("x11", x11);
+ Check.Check.typeOf.number("y11", y11);
+ //>>includeEnd('debug');
+
+ const numerator1A = (x11 - x10) * (y00 - y10) - (y11 - y10) * (x00 - x10);
+ const numerator1B = (x01 - x00) * (y00 - y10) - (y01 - y00) * (x00 - x10);
+ const denominator1 = (y11 - y10) * (x01 - x00) - (x11 - x10) * (y01 - y00);
+
+ // If denominator = 0, then lines are parallel. If denominator = 0 and both numerators are 0, then coincident
+ if (denominator1 === 0) {
+ return;
+ }
+
+ const ua1 = numerator1A / denominator1;
+ const ub1 = numerator1B / denominator1;
+
+ if (ua1 >= 0 && ua1 <= 1 && ub1 >= 0 && ub1 <= 1) {
+ if (!defaultValue.defined(result)) {
+ result = new Matrix2.Cartesian2();
+ }
+
+ result.x = x00 + ua1 * (x01 - x00);
+ result.y = y00 + ua1 * (y01 - y00);
+
+ return result;
+ }
+ };
+ var Intersections2D$1 = Intersections2D;
+
+ const maxShort = 32767;
+ const halfMaxShort = (maxShort / 2) | 0;
+
+ const clipScratch = [];
+ const clipScratch2 = [];
+ const verticesScratch = [];
+ const cartographicScratch = new Matrix3.Cartographic();
+ let cartesian3Scratch = new Matrix3.Cartesian3();
+ const uScratch = [];
+ const vScratch = [];
+ const heightScratch = [];
+ const indicesScratch = [];
+ const normalsScratch = [];
+ const horizonOcclusionPointScratch = new Matrix3.Cartesian3();
+ const boundingSphereScratch = new Transforms.BoundingSphere();
+ const orientedBoundingBoxScratch = new OrientedBoundingBox.OrientedBoundingBox();
+ const decodeTexCoordsScratch = new Matrix2.Cartesian2();
+ const octEncodedNormalScratch = new Matrix3.Cartesian3();
+
+ function upsampleQuantizedTerrainMesh(parameters, transferableObjects) {
+ const isEastChild = parameters.isEastChild;
+ const isNorthChild = parameters.isNorthChild;
+
+ const minU = isEastChild ? halfMaxShort : 0;
+ const maxU = isEastChild ? maxShort : halfMaxShort;
+ const minV = isNorthChild ? halfMaxShort : 0;
+ const maxV = isNorthChild ? maxShort : halfMaxShort;
+
+ const uBuffer = uScratch;
+ const vBuffer = vScratch;
+ const heightBuffer = heightScratch;
+ const normalBuffer = normalsScratch;
+
+ uBuffer.length = 0;
+ vBuffer.length = 0;
+ heightBuffer.length = 0;
+ normalBuffer.length = 0;
+
+ const indices = indicesScratch;
+ indices.length = 0;
+
+ const vertexMap = {};
+
+ const parentVertices = parameters.vertices;
+ let parentIndices = parameters.indices;
+ parentIndices = parentIndices.subarray(0, parameters.indexCountWithoutSkirts);
+
+ const encoding = TerrainEncoding.TerrainEncoding.clone(parameters.encoding);
+ const hasVertexNormals = encoding.hasVertexNormals;
+
+ let vertexCount = 0;
+ const quantizedVertexCount = parameters.vertexCountWithoutSkirts;
+
+ const parentMinimumHeight = parameters.minimumHeight;
+ const parentMaximumHeight = parameters.maximumHeight;
+
+ const parentUBuffer = new Array(quantizedVertexCount);
+ const parentVBuffer = new Array(quantizedVertexCount);
+ const parentHeightBuffer = new Array(quantizedVertexCount);
+ const parentNormalBuffer = hasVertexNormals
+ ? new Array(quantizedVertexCount * 2)
+ : undefined;
+
+ const threshold = 20;
+ let height;
+
+ let i, n;
+ let u, v;
+ for (i = 0, n = 0; i < quantizedVertexCount; ++i, n += 2) {
+ const texCoords = encoding.decodeTextureCoordinates(
+ parentVertices,
+ i,
+ decodeTexCoordsScratch
+ );
+ height = encoding.decodeHeight(parentVertices, i);
+
+ u = Math$1.CesiumMath.clamp((texCoords.x * maxShort) | 0, 0, maxShort);
+ v = Math$1.CesiumMath.clamp((texCoords.y * maxShort) | 0, 0, maxShort);
+ parentHeightBuffer[i] = Math$1.CesiumMath.clamp(
+ (((height - parentMinimumHeight) /
+ (parentMaximumHeight - parentMinimumHeight)) *
+ maxShort) |
+ 0,
+ 0,
+ maxShort
+ );
+
+ if (u < threshold) {
+ u = 0;
+ }
+
+ if (v < threshold) {
+ v = 0;
+ }
+
+ if (maxShort - u < threshold) {
+ u = maxShort;
+ }
+
+ if (maxShort - v < threshold) {
+ v = maxShort;
+ }
+
+ parentUBuffer[i] = u;
+ parentVBuffer[i] = v;
+
+ if (hasVertexNormals) {
+ const encodedNormal = encoding.getOctEncodedNormal(
+ parentVertices,
+ i,
+ octEncodedNormalScratch
+ );
+ parentNormalBuffer[n] = encodedNormal.x;
+ parentNormalBuffer[n + 1] = encodedNormal.y;
+ }
+
+ if (
+ ((isEastChild && u >= halfMaxShort) ||
+ (!isEastChild && u <= halfMaxShort)) &&
+ ((isNorthChild && v >= halfMaxShort) ||
+ (!isNorthChild && v <= halfMaxShort))
+ ) {
+ vertexMap[i] = vertexCount;
+ uBuffer.push(u);
+ vBuffer.push(v);
+ heightBuffer.push(parentHeightBuffer[i]);
+ if (hasVertexNormals) {
+ normalBuffer.push(parentNormalBuffer[n]);
+ normalBuffer.push(parentNormalBuffer[n + 1]);
+ }
+
+ ++vertexCount;
+ }
+ }
+
+ const triangleVertices = [];
+ triangleVertices.push(new Vertex());
+ triangleVertices.push(new Vertex());
+ triangleVertices.push(new Vertex());
+
+ const clippedTriangleVertices = [];
+ clippedTriangleVertices.push(new Vertex());
+ clippedTriangleVertices.push(new Vertex());
+ clippedTriangleVertices.push(new Vertex());
+
+ let clippedIndex;
+ let clipped2;
+
+ for (i = 0; i < parentIndices.length; i += 3) {
+ const i0 = parentIndices[i];
+ const i1 = parentIndices[i + 1];
+ const i2 = parentIndices[i + 2];
+
+ const u0 = parentUBuffer[i0];
+ const u1 = parentUBuffer[i1];
+ const u2 = parentUBuffer[i2];
+
+ triangleVertices[0].initializeIndexed(
+ parentUBuffer,
+ parentVBuffer,
+ parentHeightBuffer,
+ parentNormalBuffer,
+ i0
+ );
+ triangleVertices[1].initializeIndexed(
+ parentUBuffer,
+ parentVBuffer,
+ parentHeightBuffer,
+ parentNormalBuffer,
+ i1
+ );
+ triangleVertices[2].initializeIndexed(
+ parentUBuffer,
+ parentVBuffer,
+ parentHeightBuffer,
+ parentNormalBuffer,
+ i2
+ );
+
+ // Clip triangle on the east-west boundary.
+ const clipped = Intersections2D$1.clipTriangleAtAxisAlignedThreshold(
+ halfMaxShort,
+ isEastChild,
+ u0,
+ u1,
+ u2,
+ clipScratch
+ );
+
+ // Get the first clipped triangle, if any.
+ clippedIndex = 0;
+
+ if (clippedIndex >= clipped.length) {
+ continue;
+ }
+ clippedIndex = clippedTriangleVertices[0].initializeFromClipResult(
+ clipped,
+ clippedIndex,
+ triangleVertices
+ );
+
+ if (clippedIndex >= clipped.length) {
+ continue;
+ }
+ clippedIndex = clippedTriangleVertices[1].initializeFromClipResult(
+ clipped,
+ clippedIndex,
+ triangleVertices
+ );
+
+ if (clippedIndex >= clipped.length) {
+ continue;
+ }
+ clippedIndex = clippedTriangleVertices[2].initializeFromClipResult(
+ clipped,
+ clippedIndex,
+ triangleVertices
+ );
+
+ // Clip the triangle against the North-south boundary.
+ clipped2 = Intersections2D$1.clipTriangleAtAxisAlignedThreshold(
+ halfMaxShort,
+ isNorthChild,
+ clippedTriangleVertices[0].getV(),
+ clippedTriangleVertices[1].getV(),
+ clippedTriangleVertices[2].getV(),
+ clipScratch2
+ );
+ addClippedPolygon(
+ uBuffer,
+ vBuffer,
+ heightBuffer,
+ normalBuffer,
+ indices,
+ vertexMap,
+ clipped2,
+ clippedTriangleVertices,
+ hasVertexNormals
+ );
+
+ // If there's another vertex in the original clipped result,
+ // it forms a second triangle. Clip it as well.
+ if (clippedIndex < clipped.length) {
+ clippedTriangleVertices[2].clone(clippedTriangleVertices[1]);
+ clippedTriangleVertices[2].initializeFromClipResult(
+ clipped,
+ clippedIndex,
+ triangleVertices
+ );
+
+ clipped2 = Intersections2D$1.clipTriangleAtAxisAlignedThreshold(
+ halfMaxShort,
+ isNorthChild,
+ clippedTriangleVertices[0].getV(),
+ clippedTriangleVertices[1].getV(),
+ clippedTriangleVertices[2].getV(),
+ clipScratch2
+ );
+ addClippedPolygon(
+ uBuffer,
+ vBuffer,
+ heightBuffer,
+ normalBuffer,
+ indices,
+ vertexMap,
+ clipped2,
+ clippedTriangleVertices,
+ hasVertexNormals
+ );
+ }
+ }
+
+ const uOffset = isEastChild ? -maxShort : 0;
+ const vOffset = isNorthChild ? -maxShort : 0;
+
+ const westIndices = [];
+ const southIndices = [];
+ const eastIndices = [];
+ const northIndices = [];
+
+ let minimumHeight = Number.MAX_VALUE;
+ let maximumHeight = -minimumHeight;
+
+ const cartesianVertices = verticesScratch;
+ cartesianVertices.length = 0;
+
+ const ellipsoid = Matrix3.Ellipsoid.clone(parameters.ellipsoid);
+ const rectangle = Matrix2.Rectangle.clone(parameters.childRectangle);
+
+ const north = rectangle.north;
+ const south = rectangle.south;
+ let east = rectangle.east;
+ const west = rectangle.west;
+
+ if (east < west) {
+ east += Math$1.CesiumMath.TWO_PI;
+ }
+
+ for (i = 0; i < uBuffer.length; ++i) {
+ u = Math.round(uBuffer[i]);
+ if (u <= minU) {
+ westIndices.push(i);
+ u = 0;
+ } else if (u >= maxU) {
+ eastIndices.push(i);
+ u = maxShort;
+ } else {
+ u = u * 2 + uOffset;
+ }
+
+ uBuffer[i] = u;
+
+ v = Math.round(vBuffer[i]);
+ if (v <= minV) {
+ southIndices.push(i);
+ v = 0;
+ } else if (v >= maxV) {
+ northIndices.push(i);
+ v = maxShort;
+ } else {
+ v = v * 2 + vOffset;
+ }
+
+ vBuffer[i] = v;
+
+ height = Math$1.CesiumMath.lerp(
+ parentMinimumHeight,
+ parentMaximumHeight,
+ heightBuffer[i] / maxShort
+ );
+ if (height < minimumHeight) {
+ minimumHeight = height;
+ }
+ if (height > maximumHeight) {
+ maximumHeight = height;
+ }
+
+ heightBuffer[i] = height;
+
+ cartographicScratch.longitude = Math$1.CesiumMath.lerp(west, east, u / maxShort);
+ cartographicScratch.latitude = Math$1.CesiumMath.lerp(south, north, v / maxShort);
+ cartographicScratch.height = height;
+
+ ellipsoid.cartographicToCartesian(cartographicScratch, cartesian3Scratch);
+
+ cartesianVertices.push(cartesian3Scratch.x);
+ cartesianVertices.push(cartesian3Scratch.y);
+ cartesianVertices.push(cartesian3Scratch.z);
+ }
+
+ const boundingSphere = Transforms.BoundingSphere.fromVertices(
+ cartesianVertices,
+ Matrix3.Cartesian3.ZERO,
+ 3,
+ boundingSphereScratch
+ );
+ const orientedBoundingBox = OrientedBoundingBox.OrientedBoundingBox.fromRectangle(
+ rectangle,
+ minimumHeight,
+ maximumHeight,
+ ellipsoid,
+ orientedBoundingBoxScratch
+ );
+
+ const occluder = new TerrainEncoding.EllipsoidalOccluder(ellipsoid);
+ const horizonOcclusionPoint = occluder.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(
+ boundingSphere.center,
+ cartesianVertices,
+ 3,
+ boundingSphere.center,
+ minimumHeight,
+ horizonOcclusionPointScratch
+ );
+
+ const heightRange = maximumHeight - minimumHeight;
+
+ const vertices = new Uint16Array(
+ uBuffer.length + vBuffer.length + heightBuffer.length
+ );
+
+ for (i = 0; i < uBuffer.length; ++i) {
+ vertices[i] = uBuffer[i];
+ }
+
+ let start = uBuffer.length;
+
+ for (i = 0; i < vBuffer.length; ++i) {
+ vertices[start + i] = vBuffer[i];
+ }
+
+ start += vBuffer.length;
+
+ for (i = 0; i < heightBuffer.length; ++i) {
+ vertices[start + i] =
+ (maxShort * (heightBuffer[i] - minimumHeight)) / heightRange;
+ }
+
+ const indicesTypedArray = IndexDatatype.IndexDatatype.createTypedArray(
+ uBuffer.length,
+ indices
+ );
+
+ let encodedNormals;
+ if (hasVertexNormals) {
+ const normalArray = new Uint8Array(normalBuffer);
+ transferableObjects.push(
+ vertices.buffer,
+ indicesTypedArray.buffer,
+ normalArray.buffer
+ );
+ encodedNormals = normalArray.buffer;
+ } else {
+ transferableObjects.push(vertices.buffer, indicesTypedArray.buffer);
+ }
+
+ return {
+ vertices: vertices.buffer,
+ encodedNormals: encodedNormals,
+ indices: indicesTypedArray.buffer,
+ minimumHeight: minimumHeight,
+ maximumHeight: maximumHeight,
+ westIndices: westIndices,
+ southIndices: southIndices,
+ eastIndices: eastIndices,
+ northIndices: northIndices,
+ boundingSphere: boundingSphere,
+ orientedBoundingBox: orientedBoundingBox,
+ horizonOcclusionPoint: horizonOcclusionPoint,
+ };
+ }
+
+ function Vertex() {
+ this.vertexBuffer = undefined;
+ this.index = undefined;
+ this.first = undefined;
+ this.second = undefined;
+ this.ratio = undefined;
+ }
+
+ Vertex.prototype.clone = function (result) {
+ if (!defaultValue.defined(result)) {
+ result = new Vertex();
+ }
+
+ result.uBuffer = this.uBuffer;
+ result.vBuffer = this.vBuffer;
+ result.heightBuffer = this.heightBuffer;
+ result.normalBuffer = this.normalBuffer;
+ result.index = this.index;
+ result.first = this.first;
+ result.second = this.second;
+ result.ratio = this.ratio;
+
+ return result;
+ };
+
+ Vertex.prototype.initializeIndexed = function (
+ uBuffer,
+ vBuffer,
+ heightBuffer,
+ normalBuffer,
+ index
+ ) {
+ this.uBuffer = uBuffer;
+ this.vBuffer = vBuffer;
+ this.heightBuffer = heightBuffer;
+ this.normalBuffer = normalBuffer;
+ this.index = index;
+ this.first = undefined;
+ this.second = undefined;
+ this.ratio = undefined;
+ };
+
+ Vertex.prototype.initializeFromClipResult = function (
+ clipResult,
+ index,
+ vertices
+ ) {
+ let nextIndex = index + 1;
+
+ if (clipResult[index] !== -1) {
+ vertices[clipResult[index]].clone(this);
+ } else {
+ this.vertexBuffer = undefined;
+ this.index = undefined;
+ this.first = vertices[clipResult[nextIndex]];
+ ++nextIndex;
+ this.second = vertices[clipResult[nextIndex]];
+ ++nextIndex;
+ this.ratio = clipResult[nextIndex];
+ ++nextIndex;
+ }
+
+ return nextIndex;
+ };
+
+ Vertex.prototype.getKey = function () {
+ if (this.isIndexed()) {
+ return this.index;
+ }
+ return JSON.stringify({
+ first: this.first.getKey(),
+ second: this.second.getKey(),
+ ratio: this.ratio,
+ });
+ };
+
+ Vertex.prototype.isIndexed = function () {
+ return defaultValue.defined(this.index);
+ };
+
+ Vertex.prototype.getH = function () {
+ if (defaultValue.defined(this.index)) {
+ return this.heightBuffer[this.index];
+ }
+ return Math$1.CesiumMath.lerp(this.first.getH(), this.second.getH(), this.ratio);
+ };
+
+ Vertex.prototype.getU = function () {
+ if (defaultValue.defined(this.index)) {
+ return this.uBuffer[this.index];
+ }
+ return Math$1.CesiumMath.lerp(this.first.getU(), this.second.getU(), this.ratio);
+ };
+
+ Vertex.prototype.getV = function () {
+ if (defaultValue.defined(this.index)) {
+ return this.vBuffer[this.index];
+ }
+ return Math$1.CesiumMath.lerp(this.first.getV(), this.second.getV(), this.ratio);
+ };
+
+ let encodedScratch = new Matrix2.Cartesian2();
+ // An upsampled triangle may be clipped twice before it is assigned an index
+ // In this case, we need a buffer to handle the recursion of getNormalX() and getNormalY().
+ let depth = -1;
+ const cartesianScratch1 = [new Matrix3.Cartesian3(), new Matrix3.Cartesian3()];
+ const cartesianScratch2 = [new Matrix3.Cartesian3(), new Matrix3.Cartesian3()];
+ function lerpOctEncodedNormal(vertex, result) {
+ ++depth;
+
+ let first = cartesianScratch1[depth];
+ let second = cartesianScratch2[depth];
+
+ first = AttributeCompression.AttributeCompression.octDecode(
+ vertex.first.getNormalX(),
+ vertex.first.getNormalY(),
+ first
+ );
+ second = AttributeCompression.AttributeCompression.octDecode(
+ vertex.second.getNormalX(),
+ vertex.second.getNormalY(),
+ second
+ );
+ cartesian3Scratch = Matrix3.Cartesian3.lerp(
+ first,
+ second,
+ vertex.ratio,
+ cartesian3Scratch
+ );
+ Matrix3.Cartesian3.normalize(cartesian3Scratch, cartesian3Scratch);
+
+ AttributeCompression.AttributeCompression.octEncode(cartesian3Scratch, result);
+
+ --depth;
+
+ return result;
+ }
+
+ Vertex.prototype.getNormalX = function () {
+ if (defaultValue.defined(this.index)) {
+ return this.normalBuffer[this.index * 2];
+ }
+
+ encodedScratch = lerpOctEncodedNormal(this, encodedScratch);
+ return encodedScratch.x;
+ };
+
+ Vertex.prototype.getNormalY = function () {
+ if (defaultValue.defined(this.index)) {
+ return this.normalBuffer[this.index * 2 + 1];
+ }
+
+ encodedScratch = lerpOctEncodedNormal(this, encodedScratch);
+ return encodedScratch.y;
+ };
+
+ const polygonVertices = [];
+ polygonVertices.push(new Vertex());
+ polygonVertices.push(new Vertex());
+ polygonVertices.push(new Vertex());
+ polygonVertices.push(new Vertex());
+
+ function addClippedPolygon(
+ uBuffer,
+ vBuffer,
+ heightBuffer,
+ normalBuffer,
+ indices,
+ vertexMap,
+ clipped,
+ triangleVertices,
+ hasVertexNormals
+ ) {
+ if (clipped.length === 0) {
+ return;
+ }
+
+ let numVertices = 0;
+ let clippedIndex = 0;
+ while (clippedIndex < clipped.length) {
+ clippedIndex = polygonVertices[numVertices++].initializeFromClipResult(
+ clipped,
+ clippedIndex,
+ triangleVertices
+ );
+ }
+
+ for (let i = 0; i < numVertices; ++i) {
+ const polygonVertex = polygonVertices[i];
+ if (!polygonVertex.isIndexed()) {
+ const key = polygonVertex.getKey();
+ if (defaultValue.defined(vertexMap[key])) {
+ polygonVertex.newIndex = vertexMap[key];
+ } else {
+ const newIndex = uBuffer.length;
+ uBuffer.push(polygonVertex.getU());
+ vBuffer.push(polygonVertex.getV());
+ heightBuffer.push(polygonVertex.getH());
+ if (hasVertexNormals) {
+ normalBuffer.push(polygonVertex.getNormalX());
+ normalBuffer.push(polygonVertex.getNormalY());
+ }
+ polygonVertex.newIndex = newIndex;
+ vertexMap[key] = newIndex;
+ }
+ } else {
+ polygonVertex.newIndex = vertexMap[polygonVertex.index];
+ polygonVertex.uBuffer = uBuffer;
+ polygonVertex.vBuffer = vBuffer;
+ polygonVertex.heightBuffer = heightBuffer;
+ if (hasVertexNormals) {
+ polygonVertex.normalBuffer = normalBuffer;
+ }
+ }
+ }
+
+ if (numVertices === 3) {
+ // A triangle.
+ indices.push(polygonVertices[0].newIndex);
+ indices.push(polygonVertices[1].newIndex);
+ indices.push(polygonVertices[2].newIndex);
+ } else if (numVertices === 4) {
+ // A quad - two triangles.
+ indices.push(polygonVertices[0].newIndex);
+ indices.push(polygonVertices[1].newIndex);
+ indices.push(polygonVertices[2].newIndex);
+
+ indices.push(polygonVertices[0].newIndex);
+ indices.push(polygonVertices[2].newIndex);
+ indices.push(polygonVertices[3].newIndex);
+ }
+ }
+ var upsampleQuantizedTerrainMesh$1 = createTaskProcessorWorker(upsampleQuantizedTerrainMesh);
+
+ return upsampleQuantizedTerrainMesh$1;
+
+}));
+//# sourceMappingURL=upsampleQuantizedTerrainMesh.js.map
diff --git a/examples/cesium/Workers/upsampleQuantizedTerrainMesh.js.map b/examples/cesium/Workers/upsampleQuantizedTerrainMesh.js.map
new file mode 100644
index 0000000..47b24c0
--- /dev/null
+++ b/examples/cesium/Workers/upsampleQuantizedTerrainMesh.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"upsampleQuantizedTerrainMesh.js","sources":["../../../Source/Core/Intersections2D.js","../../../Source/WorkersES6/upsampleQuantizedTerrainMesh.js"],"sourcesContent":["import Cartesian2 from \"./Cartesian2.js\";\r\nimport Cartesian3 from \"./Cartesian3.js\";\r\nimport Check from \"./Check.js\";\r\nimport defined from \"./defined.js\";\r\nimport DeveloperError from \"./DeveloperError.js\";\r\n\r\n/**\r\n * Contains functions for operating on 2D triangles.\r\n *\r\n * @namespace Intersections2D\r\n */\r\nconst Intersections2D = {};\r\n\r\n/**\r\n * Splits a 2D triangle at given axis-aligned threshold value and returns the resulting\r\n * polygon on a given side of the threshold. The resulting polygon may have 0, 1, 2,\r\n * 3, or 4 vertices.\r\n *\r\n * @param {Number} threshold The threshold coordinate value at which to clip the triangle.\r\n * @param {Boolean} keepAbove true to keep the portion of the triangle above the threshold, or false\r\n * to keep the portion below.\r\n * @param {Number} u0 The coordinate of the first vertex in the triangle, in counter-clockwise order.\r\n * @param {Number} u1 The coordinate of the second vertex in the triangle, in counter-clockwise order.\r\n * @param {Number} u2 The coordinate of the third vertex in the triangle, in counter-clockwise order.\r\n * @param {Number[]} [result] The array into which to copy the result. If this parameter is not supplied,\r\n * a new array is constructed and returned.\r\n * @returns {Number[]} The polygon that results after the clip, specified as a list of\r\n * vertices. The vertices are specified in counter-clockwise order.\r\n * Each vertex is either an index from the existing list (identified as\r\n * a 0, 1, or 2) or -1 indicating a new vertex not in the original triangle.\r\n * For new vertices, the -1 is followed by three additional numbers: the\r\n * index of each of the two original vertices forming the line segment that\r\n * the new vertex lies on, and the fraction of the distance from the first\r\n * vertex to the second one.\r\n *\r\n * @example\r\n * const result = Cesium.Intersections2D.clipTriangleAtAxisAlignedThreshold(0.5, false, 0.2, 0.6, 0.4);\r\n * // result === [2, 0, -1, 1, 0, 0.25, -1, 1, 2, 0.5]\r\n */\r\nIntersections2D.clipTriangleAtAxisAlignedThreshold = function (\r\n threshold,\r\n keepAbove,\r\n u0,\r\n u1,\r\n u2,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(threshold)) {\r\n throw new DeveloperError(\"threshold is required.\");\r\n }\r\n if (!defined(keepAbove)) {\r\n throw new DeveloperError(\"keepAbove is required.\");\r\n }\r\n if (!defined(u0)) {\r\n throw new DeveloperError(\"u0 is required.\");\r\n }\r\n if (!defined(u1)) {\r\n throw new DeveloperError(\"u1 is required.\");\r\n }\r\n if (!defined(u2)) {\r\n throw new DeveloperError(\"u2 is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n if (!defined(result)) {\r\n result = [];\r\n } else {\r\n result.length = 0;\r\n }\r\n\r\n let u0Behind;\r\n let u1Behind;\r\n let u2Behind;\r\n if (keepAbove) {\r\n u0Behind = u0 < threshold;\r\n u1Behind = u1 < threshold;\r\n u2Behind = u2 < threshold;\r\n } else {\r\n u0Behind = u0 > threshold;\r\n u1Behind = u1 > threshold;\r\n u2Behind = u2 > threshold;\r\n }\r\n\r\n const numBehind = u0Behind + u1Behind + u2Behind;\r\n\r\n let u01Ratio;\r\n let u02Ratio;\r\n let u12Ratio;\r\n let u10Ratio;\r\n let u20Ratio;\r\n let u21Ratio;\r\n\r\n if (numBehind === 1) {\r\n if (u0Behind) {\r\n u01Ratio = (threshold - u0) / (u1 - u0);\r\n u02Ratio = (threshold - u0) / (u2 - u0);\r\n\r\n result.push(1);\r\n\r\n result.push(2);\r\n\r\n if (u02Ratio !== 1.0) {\r\n result.push(-1);\r\n result.push(0);\r\n result.push(2);\r\n result.push(u02Ratio);\r\n }\r\n\r\n if (u01Ratio !== 1.0) {\r\n result.push(-1);\r\n result.push(0);\r\n result.push(1);\r\n result.push(u01Ratio);\r\n }\r\n } else if (u1Behind) {\r\n u12Ratio = (threshold - u1) / (u2 - u1);\r\n u10Ratio = (threshold - u1) / (u0 - u1);\r\n\r\n result.push(2);\r\n\r\n result.push(0);\r\n\r\n if (u10Ratio !== 1.0) {\r\n result.push(-1);\r\n result.push(1);\r\n result.push(0);\r\n result.push(u10Ratio);\r\n }\r\n\r\n if (u12Ratio !== 1.0) {\r\n result.push(-1);\r\n result.push(1);\r\n result.push(2);\r\n result.push(u12Ratio);\r\n }\r\n } else if (u2Behind) {\r\n u20Ratio = (threshold - u2) / (u0 - u2);\r\n u21Ratio = (threshold - u2) / (u1 - u2);\r\n\r\n result.push(0);\r\n\r\n result.push(1);\r\n\r\n if (u21Ratio !== 1.0) {\r\n result.push(-1);\r\n result.push(2);\r\n result.push(1);\r\n result.push(u21Ratio);\r\n }\r\n\r\n if (u20Ratio !== 1.0) {\r\n result.push(-1);\r\n result.push(2);\r\n result.push(0);\r\n result.push(u20Ratio);\r\n }\r\n }\r\n } else if (numBehind === 2) {\r\n if (!u0Behind && u0 !== threshold) {\r\n u10Ratio = (threshold - u1) / (u0 - u1);\r\n u20Ratio = (threshold - u2) / (u0 - u2);\r\n\r\n result.push(0);\r\n\r\n result.push(-1);\r\n result.push(1);\r\n result.push(0);\r\n result.push(u10Ratio);\r\n\r\n result.push(-1);\r\n result.push(2);\r\n result.push(0);\r\n result.push(u20Ratio);\r\n } else if (!u1Behind && u1 !== threshold) {\r\n u21Ratio = (threshold - u2) / (u1 - u2);\r\n u01Ratio = (threshold - u0) / (u1 - u0);\r\n\r\n result.push(1);\r\n\r\n result.push(-1);\r\n result.push(2);\r\n result.push(1);\r\n result.push(u21Ratio);\r\n\r\n result.push(-1);\r\n result.push(0);\r\n result.push(1);\r\n result.push(u01Ratio);\r\n } else if (!u2Behind && u2 !== threshold) {\r\n u02Ratio = (threshold - u0) / (u2 - u0);\r\n u12Ratio = (threshold - u1) / (u2 - u1);\r\n\r\n result.push(2);\r\n\r\n result.push(-1);\r\n result.push(0);\r\n result.push(2);\r\n result.push(u02Ratio);\r\n\r\n result.push(-1);\r\n result.push(1);\r\n result.push(2);\r\n result.push(u12Ratio);\r\n }\r\n } else if (numBehind !== 3) {\r\n // Completely in front of threshold\r\n result.push(0);\r\n result.push(1);\r\n result.push(2);\r\n }\r\n // else Completely behind threshold\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Compute the barycentric coordinates of a 2D position within a 2D triangle.\r\n *\r\n * @param {Number} x The x coordinate of the position for which to find the barycentric coordinates.\r\n * @param {Number} y The y coordinate of the position for which to find the barycentric coordinates.\r\n * @param {Number} x1 The x coordinate of the triangle's first vertex.\r\n * @param {Number} y1 The y coordinate of the triangle's first vertex.\r\n * @param {Number} x2 The x coordinate of the triangle's second vertex.\r\n * @param {Number} y2 The y coordinate of the triangle's second vertex.\r\n * @param {Number} x3 The x coordinate of the triangle's third vertex.\r\n * @param {Number} y3 The y coordinate of the triangle's third vertex.\r\n * @param {Cartesian3} [result] The instance into to which to copy the result. If this parameter\r\n * is undefined, a new instance is created and returned.\r\n * @returns {Cartesian3} The barycentric coordinates of the position within the triangle.\r\n *\r\n * @example\r\n * const result = Cesium.Intersections2D.computeBarycentricCoordinates(0.0, 0.0, 0.0, 1.0, -1, -0.5, 1, -0.5);\r\n * // result === new Cesium.Cartesian3(1.0 / 3.0, 1.0 / 3.0, 1.0 / 3.0);\r\n */\r\nIntersections2D.computeBarycentricCoordinates = function (\r\n x,\r\n y,\r\n x1,\r\n y1,\r\n x2,\r\n y2,\r\n x3,\r\n y3,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n if (!defined(x)) {\r\n throw new DeveloperError(\"x is required.\");\r\n }\r\n if (!defined(y)) {\r\n throw new DeveloperError(\"y is required.\");\r\n }\r\n if (!defined(x1)) {\r\n throw new DeveloperError(\"x1 is required.\");\r\n }\r\n if (!defined(y1)) {\r\n throw new DeveloperError(\"y1 is required.\");\r\n }\r\n if (!defined(x2)) {\r\n throw new DeveloperError(\"x2 is required.\");\r\n }\r\n if (!defined(y2)) {\r\n throw new DeveloperError(\"y2 is required.\");\r\n }\r\n if (!defined(x3)) {\r\n throw new DeveloperError(\"x3 is required.\");\r\n }\r\n if (!defined(y3)) {\r\n throw new DeveloperError(\"y3 is required.\");\r\n }\r\n //>>includeEnd('debug');\r\n\r\n const x1mx3 = x1 - x3;\r\n const x3mx2 = x3 - x2;\r\n const y2my3 = y2 - y3;\r\n const y1my3 = y1 - y3;\r\n const inverseDeterminant = 1.0 / (y2my3 * x1mx3 + x3mx2 * y1my3);\r\n const ymy3 = y - y3;\r\n const xmx3 = x - x3;\r\n const l1 = (y2my3 * xmx3 + x3mx2 * ymy3) * inverseDeterminant;\r\n const l2 = (-y1my3 * xmx3 + x1mx3 * ymy3) * inverseDeterminant;\r\n const l3 = 1.0 - l1 - l2;\r\n\r\n if (defined(result)) {\r\n result.x = l1;\r\n result.y = l2;\r\n result.z = l3;\r\n return result;\r\n }\r\n return new Cartesian3(l1, l2, l3);\r\n};\r\n\r\n/**\r\n * Compute the intersection between 2 line segments\r\n *\r\n * @param {Number} x00 The x coordinate of the first line's first vertex.\r\n * @param {Number} y00 The y coordinate of the first line's first vertex.\r\n * @param {Number} x01 The x coordinate of the first line's second vertex.\r\n * @param {Number} y01 The y coordinate of the first line's second vertex.\r\n * @param {Number} x10 The x coordinate of the second line's first vertex.\r\n * @param {Number} y10 The y coordinate of the second line's first vertex.\r\n * @param {Number} x11 The x coordinate of the second line's second vertex.\r\n * @param {Number} y11 The y coordinate of the second line's second vertex.\r\n * @param {Cartesian2} [result] The instance into to which to copy the result. If this parameter\r\n * is undefined, a new instance is created and returned.\r\n * @returns {Cartesian2} The intersection point, undefined if there is no intersection point or lines are coincident.\r\n *\r\n * @example\r\n * const result = Cesium.Intersections2D.computeLineSegmentLineSegmentIntersection(0.0, 0.0, 0.0, 2.0, -1, 1, 1, 1);\r\n * // result === new Cesium.Cartesian2(0.0, 1.0);\r\n */\r\nIntersections2D.computeLineSegmentLineSegmentIntersection = function (\r\n x00,\r\n y00,\r\n x01,\r\n y01,\r\n x10,\r\n y10,\r\n x11,\r\n y11,\r\n result\r\n) {\r\n //>>includeStart('debug', pragmas.debug);\r\n Check.typeOf.number(\"x00\", x00);\r\n Check.typeOf.number(\"y00\", y00);\r\n Check.typeOf.number(\"x01\", x01);\r\n Check.typeOf.number(\"y01\", y01);\r\n Check.typeOf.number(\"x10\", x10);\r\n Check.typeOf.number(\"y10\", y10);\r\n Check.typeOf.number(\"x11\", x11);\r\n Check.typeOf.number(\"y11\", y11);\r\n //>>includeEnd('debug');\r\n\r\n const numerator1A = (x11 - x10) * (y00 - y10) - (y11 - y10) * (x00 - x10);\r\n const numerator1B = (x01 - x00) * (y00 - y10) - (y01 - y00) * (x00 - x10);\r\n const denominator1 = (y11 - y10) * (x01 - x00) - (x11 - x10) * (y01 - y00);\r\n\r\n // If denominator = 0, then lines are parallel. If denominator = 0 and both numerators are 0, then coincident\r\n if (denominator1 === 0) {\r\n return;\r\n }\r\n\r\n const ua1 = numerator1A / denominator1;\r\n const ub1 = numerator1B / denominator1;\r\n\r\n if (ua1 >= 0 && ua1 <= 1 && ub1 >= 0 && ub1 <= 1) {\r\n if (!defined(result)) {\r\n result = new Cartesian2();\r\n }\r\n\r\n result.x = x00 + ua1 * (x01 - x00);\r\n result.y = y00 + ua1 * (y01 - y00);\r\n\r\n return result;\r\n }\r\n};\r\nexport default Intersections2D;\r\n","import AttributeCompression from \"../Core/AttributeCompression.js\";\r\nimport BoundingSphere from \"../Core/BoundingSphere.js\";\r\nimport Cartesian2 from \"../Core/Cartesian2.js\";\r\nimport Cartesian3 from \"../Core/Cartesian3.js\";\r\nimport Cartographic from \"../Core/Cartographic.js\";\r\nimport defined from \"../Core/defined.js\";\r\nimport Ellipsoid from \"../Core/Ellipsoid.js\";\r\nimport EllipsoidalOccluder from \"../Core/EllipsoidalOccluder.js\";\r\nimport IndexDatatype from \"../Core/IndexDatatype.js\";\r\nimport Intersections2D from \"../Core/Intersections2D.js\";\r\nimport CesiumMath from \"../Core/Math.js\";\r\nimport OrientedBoundingBox from \"../Core/OrientedBoundingBox.js\";\r\nimport Rectangle from \"../Core/Rectangle.js\";\r\nimport TerrainEncoding from \"../Core/TerrainEncoding.js\";\r\nimport createTaskProcessorWorker from \"./createTaskProcessorWorker.js\";\r\n\r\nconst maxShort = 32767;\r\nconst halfMaxShort = (maxShort / 2) | 0;\r\n\r\nconst clipScratch = [];\r\nconst clipScratch2 = [];\r\nconst verticesScratch = [];\r\nconst cartographicScratch = new Cartographic();\r\nlet cartesian3Scratch = new Cartesian3();\r\nconst uScratch = [];\r\nconst vScratch = [];\r\nconst heightScratch = [];\r\nconst indicesScratch = [];\r\nconst normalsScratch = [];\r\nconst horizonOcclusionPointScratch = new Cartesian3();\r\nconst boundingSphereScratch = new BoundingSphere();\r\nconst orientedBoundingBoxScratch = new OrientedBoundingBox();\r\nconst decodeTexCoordsScratch = new Cartesian2();\r\nconst octEncodedNormalScratch = new Cartesian3();\r\n\r\nfunction upsampleQuantizedTerrainMesh(parameters, transferableObjects) {\r\n const isEastChild = parameters.isEastChild;\r\n const isNorthChild = parameters.isNorthChild;\r\n\r\n const minU = isEastChild ? halfMaxShort : 0;\r\n const maxU = isEastChild ? maxShort : halfMaxShort;\r\n const minV = isNorthChild ? halfMaxShort : 0;\r\n const maxV = isNorthChild ? maxShort : halfMaxShort;\r\n\r\n const uBuffer = uScratch;\r\n const vBuffer = vScratch;\r\n const heightBuffer = heightScratch;\r\n const normalBuffer = normalsScratch;\r\n\r\n uBuffer.length = 0;\r\n vBuffer.length = 0;\r\n heightBuffer.length = 0;\r\n normalBuffer.length = 0;\r\n\r\n const indices = indicesScratch;\r\n indices.length = 0;\r\n\r\n const vertexMap = {};\r\n\r\n const parentVertices = parameters.vertices;\r\n let parentIndices = parameters.indices;\r\n parentIndices = parentIndices.subarray(0, parameters.indexCountWithoutSkirts);\r\n\r\n const encoding = TerrainEncoding.clone(parameters.encoding);\r\n const hasVertexNormals = encoding.hasVertexNormals;\r\n\r\n let vertexCount = 0;\r\n const quantizedVertexCount = parameters.vertexCountWithoutSkirts;\r\n\r\n const parentMinimumHeight = parameters.minimumHeight;\r\n const parentMaximumHeight = parameters.maximumHeight;\r\n\r\n const parentUBuffer = new Array(quantizedVertexCount);\r\n const parentVBuffer = new Array(quantizedVertexCount);\r\n const parentHeightBuffer = new Array(quantizedVertexCount);\r\n const parentNormalBuffer = hasVertexNormals\r\n ? new Array(quantizedVertexCount * 2)\r\n : undefined;\r\n\r\n const threshold = 20;\r\n let height;\r\n\r\n let i, n;\r\n let u, v;\r\n for (i = 0, n = 0; i < quantizedVertexCount; ++i, n += 2) {\r\n const texCoords = encoding.decodeTextureCoordinates(\r\n parentVertices,\r\n i,\r\n decodeTexCoordsScratch\r\n );\r\n height = encoding.decodeHeight(parentVertices, i);\r\n\r\n u = CesiumMath.clamp((texCoords.x * maxShort) | 0, 0, maxShort);\r\n v = CesiumMath.clamp((texCoords.y * maxShort) | 0, 0, maxShort);\r\n parentHeightBuffer[i] = CesiumMath.clamp(\r\n (((height - parentMinimumHeight) /\r\n (parentMaximumHeight - parentMinimumHeight)) *\r\n maxShort) |\r\n 0,\r\n 0,\r\n maxShort\r\n );\r\n\r\n if (u < threshold) {\r\n u = 0;\r\n }\r\n\r\n if (v < threshold) {\r\n v = 0;\r\n }\r\n\r\n if (maxShort - u < threshold) {\r\n u = maxShort;\r\n }\r\n\r\n if (maxShort - v < threshold) {\r\n v = maxShort;\r\n }\r\n\r\n parentUBuffer[i] = u;\r\n parentVBuffer[i] = v;\r\n\r\n if (hasVertexNormals) {\r\n const encodedNormal = encoding.getOctEncodedNormal(\r\n parentVertices,\r\n i,\r\n octEncodedNormalScratch\r\n );\r\n parentNormalBuffer[n] = encodedNormal.x;\r\n parentNormalBuffer[n + 1] = encodedNormal.y;\r\n }\r\n\r\n if (\r\n ((isEastChild && u >= halfMaxShort) ||\r\n (!isEastChild && u <= halfMaxShort)) &&\r\n ((isNorthChild && v >= halfMaxShort) ||\r\n (!isNorthChild && v <= halfMaxShort))\r\n ) {\r\n vertexMap[i] = vertexCount;\r\n uBuffer.push(u);\r\n vBuffer.push(v);\r\n heightBuffer.push(parentHeightBuffer[i]);\r\n if (hasVertexNormals) {\r\n normalBuffer.push(parentNormalBuffer[n]);\r\n normalBuffer.push(parentNormalBuffer[n + 1]);\r\n }\r\n\r\n ++vertexCount;\r\n }\r\n }\r\n\r\n const triangleVertices = [];\r\n triangleVertices.push(new Vertex());\r\n triangleVertices.push(new Vertex());\r\n triangleVertices.push(new Vertex());\r\n\r\n const clippedTriangleVertices = [];\r\n clippedTriangleVertices.push(new Vertex());\r\n clippedTriangleVertices.push(new Vertex());\r\n clippedTriangleVertices.push(new Vertex());\r\n\r\n let clippedIndex;\r\n let clipped2;\r\n\r\n for (i = 0; i < parentIndices.length; i += 3) {\r\n const i0 = parentIndices[i];\r\n const i1 = parentIndices[i + 1];\r\n const i2 = parentIndices[i + 2];\r\n\r\n const u0 = parentUBuffer[i0];\r\n const u1 = parentUBuffer[i1];\r\n const u2 = parentUBuffer[i2];\r\n\r\n triangleVertices[0].initializeIndexed(\r\n parentUBuffer,\r\n parentVBuffer,\r\n parentHeightBuffer,\r\n parentNormalBuffer,\r\n i0\r\n );\r\n triangleVertices[1].initializeIndexed(\r\n parentUBuffer,\r\n parentVBuffer,\r\n parentHeightBuffer,\r\n parentNormalBuffer,\r\n i1\r\n );\r\n triangleVertices[2].initializeIndexed(\r\n parentUBuffer,\r\n parentVBuffer,\r\n parentHeightBuffer,\r\n parentNormalBuffer,\r\n i2\r\n );\r\n\r\n // Clip triangle on the east-west boundary.\r\n const clipped = Intersections2D.clipTriangleAtAxisAlignedThreshold(\r\n halfMaxShort,\r\n isEastChild,\r\n u0,\r\n u1,\r\n u2,\r\n clipScratch\r\n );\r\n\r\n // Get the first clipped triangle, if any.\r\n clippedIndex = 0;\r\n\r\n if (clippedIndex >= clipped.length) {\r\n continue;\r\n }\r\n clippedIndex = clippedTriangleVertices[0].initializeFromClipResult(\r\n clipped,\r\n clippedIndex,\r\n triangleVertices\r\n );\r\n\r\n if (clippedIndex >= clipped.length) {\r\n continue;\r\n }\r\n clippedIndex = clippedTriangleVertices[1].initializeFromClipResult(\r\n clipped,\r\n clippedIndex,\r\n triangleVertices\r\n );\r\n\r\n if (clippedIndex >= clipped.length) {\r\n continue;\r\n }\r\n clippedIndex = clippedTriangleVertices[2].initializeFromClipResult(\r\n clipped,\r\n clippedIndex,\r\n triangleVertices\r\n );\r\n\r\n // Clip the triangle against the North-south boundary.\r\n clipped2 = Intersections2D.clipTriangleAtAxisAlignedThreshold(\r\n halfMaxShort,\r\n isNorthChild,\r\n clippedTriangleVertices[0].getV(),\r\n clippedTriangleVertices[1].getV(),\r\n clippedTriangleVertices[2].getV(),\r\n clipScratch2\r\n );\r\n addClippedPolygon(\r\n uBuffer,\r\n vBuffer,\r\n heightBuffer,\r\n normalBuffer,\r\n indices,\r\n vertexMap,\r\n clipped2,\r\n clippedTriangleVertices,\r\n hasVertexNormals\r\n );\r\n\r\n // If there's another vertex in the original clipped result,\r\n // it forms a second triangle. Clip it as well.\r\n if (clippedIndex < clipped.length) {\r\n clippedTriangleVertices[2].clone(clippedTriangleVertices[1]);\r\n clippedTriangleVertices[2].initializeFromClipResult(\r\n clipped,\r\n clippedIndex,\r\n triangleVertices\r\n );\r\n\r\n clipped2 = Intersections2D.clipTriangleAtAxisAlignedThreshold(\r\n halfMaxShort,\r\n isNorthChild,\r\n clippedTriangleVertices[0].getV(),\r\n clippedTriangleVertices[1].getV(),\r\n clippedTriangleVertices[2].getV(),\r\n clipScratch2\r\n );\r\n addClippedPolygon(\r\n uBuffer,\r\n vBuffer,\r\n heightBuffer,\r\n normalBuffer,\r\n indices,\r\n vertexMap,\r\n clipped2,\r\n clippedTriangleVertices,\r\n hasVertexNormals\r\n );\r\n }\r\n }\r\n\r\n const uOffset = isEastChild ? -maxShort : 0;\r\n const vOffset = isNorthChild ? -maxShort : 0;\r\n\r\n const westIndices = [];\r\n const southIndices = [];\r\n const eastIndices = [];\r\n const northIndices = [];\r\n\r\n let minimumHeight = Number.MAX_VALUE;\r\n let maximumHeight = -minimumHeight;\r\n\r\n const cartesianVertices = verticesScratch;\r\n cartesianVertices.length = 0;\r\n\r\n const ellipsoid = Ellipsoid.clone(parameters.ellipsoid);\r\n const rectangle = Rectangle.clone(parameters.childRectangle);\r\n\r\n const north = rectangle.north;\r\n const south = rectangle.south;\r\n let east = rectangle.east;\r\n const west = rectangle.west;\r\n\r\n if (east < west) {\r\n east += CesiumMath.TWO_PI;\r\n }\r\n\r\n for (i = 0; i < uBuffer.length; ++i) {\r\n u = Math.round(uBuffer[i]);\r\n if (u <= minU) {\r\n westIndices.push(i);\r\n u = 0;\r\n } else if (u >= maxU) {\r\n eastIndices.push(i);\r\n u = maxShort;\r\n } else {\r\n u = u * 2 + uOffset;\r\n }\r\n\r\n uBuffer[i] = u;\r\n\r\n v = Math.round(vBuffer[i]);\r\n if (v <= minV) {\r\n southIndices.push(i);\r\n v = 0;\r\n } else if (v >= maxV) {\r\n northIndices.push(i);\r\n v = maxShort;\r\n } else {\r\n v = v * 2 + vOffset;\r\n }\r\n\r\n vBuffer[i] = v;\r\n\r\n height = CesiumMath.lerp(\r\n parentMinimumHeight,\r\n parentMaximumHeight,\r\n heightBuffer[i] / maxShort\r\n );\r\n if (height < minimumHeight) {\r\n minimumHeight = height;\r\n }\r\n if (height > maximumHeight) {\r\n maximumHeight = height;\r\n }\r\n\r\n heightBuffer[i] = height;\r\n\r\n cartographicScratch.longitude = CesiumMath.lerp(west, east, u / maxShort);\r\n cartographicScratch.latitude = CesiumMath.lerp(south, north, v / maxShort);\r\n cartographicScratch.height = height;\r\n\r\n ellipsoid.cartographicToCartesian(cartographicScratch, cartesian3Scratch);\r\n\r\n cartesianVertices.push(cartesian3Scratch.x);\r\n cartesianVertices.push(cartesian3Scratch.y);\r\n cartesianVertices.push(cartesian3Scratch.z);\r\n }\r\n\r\n const boundingSphere = BoundingSphere.fromVertices(\r\n cartesianVertices,\r\n Cartesian3.ZERO,\r\n 3,\r\n boundingSphereScratch\r\n );\r\n const orientedBoundingBox = OrientedBoundingBox.fromRectangle(\r\n rectangle,\r\n minimumHeight,\r\n maximumHeight,\r\n ellipsoid,\r\n orientedBoundingBoxScratch\r\n );\r\n\r\n const occluder = new EllipsoidalOccluder(ellipsoid);\r\n const horizonOcclusionPoint = occluder.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(\r\n boundingSphere.center,\r\n cartesianVertices,\r\n 3,\r\n boundingSphere.center,\r\n minimumHeight,\r\n horizonOcclusionPointScratch\r\n );\r\n\r\n const heightRange = maximumHeight - minimumHeight;\r\n\r\n const vertices = new Uint16Array(\r\n uBuffer.length + vBuffer.length + heightBuffer.length\r\n );\r\n\r\n for (i = 0; i < uBuffer.length; ++i) {\r\n vertices[i] = uBuffer[i];\r\n }\r\n\r\n let start = uBuffer.length;\r\n\r\n for (i = 0; i < vBuffer.length; ++i) {\r\n vertices[start + i] = vBuffer[i];\r\n }\r\n\r\n start += vBuffer.length;\r\n\r\n for (i = 0; i < heightBuffer.length; ++i) {\r\n vertices[start + i] =\r\n (maxShort * (heightBuffer[i] - minimumHeight)) / heightRange;\r\n }\r\n\r\n const indicesTypedArray = IndexDatatype.createTypedArray(\r\n uBuffer.length,\r\n indices\r\n );\r\n\r\n let encodedNormals;\r\n if (hasVertexNormals) {\r\n const normalArray = new Uint8Array(normalBuffer);\r\n transferableObjects.push(\r\n vertices.buffer,\r\n indicesTypedArray.buffer,\r\n normalArray.buffer\r\n );\r\n encodedNormals = normalArray.buffer;\r\n } else {\r\n transferableObjects.push(vertices.buffer, indicesTypedArray.buffer);\r\n }\r\n\r\n return {\r\n vertices: vertices.buffer,\r\n encodedNormals: encodedNormals,\r\n indices: indicesTypedArray.buffer,\r\n minimumHeight: minimumHeight,\r\n maximumHeight: maximumHeight,\r\n westIndices: westIndices,\r\n southIndices: southIndices,\r\n eastIndices: eastIndices,\r\n northIndices: northIndices,\r\n boundingSphere: boundingSphere,\r\n orientedBoundingBox: orientedBoundingBox,\r\n horizonOcclusionPoint: horizonOcclusionPoint,\r\n };\r\n}\r\n\r\nfunction Vertex() {\r\n this.vertexBuffer = undefined;\r\n this.index = undefined;\r\n this.first = undefined;\r\n this.second = undefined;\r\n this.ratio = undefined;\r\n}\r\n\r\nVertex.prototype.clone = function (result) {\r\n if (!defined(result)) {\r\n result = new Vertex();\r\n }\r\n\r\n result.uBuffer = this.uBuffer;\r\n result.vBuffer = this.vBuffer;\r\n result.heightBuffer = this.heightBuffer;\r\n result.normalBuffer = this.normalBuffer;\r\n result.index = this.index;\r\n result.first = this.first;\r\n result.second = this.second;\r\n result.ratio = this.ratio;\r\n\r\n return result;\r\n};\r\n\r\nVertex.prototype.initializeIndexed = function (\r\n uBuffer,\r\n vBuffer,\r\n heightBuffer,\r\n normalBuffer,\r\n index\r\n) {\r\n this.uBuffer = uBuffer;\r\n this.vBuffer = vBuffer;\r\n this.heightBuffer = heightBuffer;\r\n this.normalBuffer = normalBuffer;\r\n this.index = index;\r\n this.first = undefined;\r\n this.second = undefined;\r\n this.ratio = undefined;\r\n};\r\n\r\nVertex.prototype.initializeFromClipResult = function (\r\n clipResult,\r\n index,\r\n vertices\r\n) {\r\n let nextIndex = index + 1;\r\n\r\n if (clipResult[index] !== -1) {\r\n vertices[clipResult[index]].clone(this);\r\n } else {\r\n this.vertexBuffer = undefined;\r\n this.index = undefined;\r\n this.first = vertices[clipResult[nextIndex]];\r\n ++nextIndex;\r\n this.second = vertices[clipResult[nextIndex]];\r\n ++nextIndex;\r\n this.ratio = clipResult[nextIndex];\r\n ++nextIndex;\r\n }\r\n\r\n return nextIndex;\r\n};\r\n\r\nVertex.prototype.getKey = function () {\r\n if (this.isIndexed()) {\r\n return this.index;\r\n }\r\n return JSON.stringify({\r\n first: this.first.getKey(),\r\n second: this.second.getKey(),\r\n ratio: this.ratio,\r\n });\r\n};\r\n\r\nVertex.prototype.isIndexed = function () {\r\n return defined(this.index);\r\n};\r\n\r\nVertex.prototype.getH = function () {\r\n if (defined(this.index)) {\r\n return this.heightBuffer[this.index];\r\n }\r\n return CesiumMath.lerp(this.first.getH(), this.second.getH(), this.ratio);\r\n};\r\n\r\nVertex.prototype.getU = function () {\r\n if (defined(this.index)) {\r\n return this.uBuffer[this.index];\r\n }\r\n return CesiumMath.lerp(this.first.getU(), this.second.getU(), this.ratio);\r\n};\r\n\r\nVertex.prototype.getV = function () {\r\n if (defined(this.index)) {\r\n return this.vBuffer[this.index];\r\n }\r\n return CesiumMath.lerp(this.first.getV(), this.second.getV(), this.ratio);\r\n};\r\n\r\nlet encodedScratch = new Cartesian2();\r\n// An upsampled triangle may be clipped twice before it is assigned an index\r\n// In this case, we need a buffer to handle the recursion of getNormalX() and getNormalY().\r\nlet depth = -1;\r\nconst cartesianScratch1 = [new Cartesian3(), new Cartesian3()];\r\nconst cartesianScratch2 = [new Cartesian3(), new Cartesian3()];\r\nfunction lerpOctEncodedNormal(vertex, result) {\r\n ++depth;\r\n\r\n let first = cartesianScratch1[depth];\r\n let second = cartesianScratch2[depth];\r\n\r\n first = AttributeCompression.octDecode(\r\n vertex.first.getNormalX(),\r\n vertex.first.getNormalY(),\r\n first\r\n );\r\n second = AttributeCompression.octDecode(\r\n vertex.second.getNormalX(),\r\n vertex.second.getNormalY(),\r\n second\r\n );\r\n cartesian3Scratch = Cartesian3.lerp(\r\n first,\r\n second,\r\n vertex.ratio,\r\n cartesian3Scratch\r\n );\r\n Cartesian3.normalize(cartesian3Scratch, cartesian3Scratch);\r\n\r\n AttributeCompression.octEncode(cartesian3Scratch, result);\r\n\r\n --depth;\r\n\r\n return result;\r\n}\r\n\r\nVertex.prototype.getNormalX = function () {\r\n if (defined(this.index)) {\r\n return this.normalBuffer[this.index * 2];\r\n }\r\n\r\n encodedScratch = lerpOctEncodedNormal(this, encodedScratch);\r\n return encodedScratch.x;\r\n};\r\n\r\nVertex.prototype.getNormalY = function () {\r\n if (defined(this.index)) {\r\n return this.normalBuffer[this.index * 2 + 1];\r\n }\r\n\r\n encodedScratch = lerpOctEncodedNormal(this, encodedScratch);\r\n return encodedScratch.y;\r\n};\r\n\r\nconst polygonVertices = [];\r\npolygonVertices.push(new Vertex());\r\npolygonVertices.push(new Vertex());\r\npolygonVertices.push(new Vertex());\r\npolygonVertices.push(new Vertex());\r\n\r\nfunction addClippedPolygon(\r\n uBuffer,\r\n vBuffer,\r\n heightBuffer,\r\n normalBuffer,\r\n indices,\r\n vertexMap,\r\n clipped,\r\n triangleVertices,\r\n hasVertexNormals\r\n) {\r\n if (clipped.length === 0) {\r\n return;\r\n }\r\n\r\n let numVertices = 0;\r\n let clippedIndex = 0;\r\n while (clippedIndex < clipped.length) {\r\n clippedIndex = polygonVertices[numVertices++].initializeFromClipResult(\r\n clipped,\r\n clippedIndex,\r\n triangleVertices\r\n );\r\n }\r\n\r\n for (let i = 0; i < numVertices; ++i) {\r\n const polygonVertex = polygonVertices[i];\r\n if (!polygonVertex.isIndexed()) {\r\n const key = polygonVertex.getKey();\r\n if (defined(vertexMap[key])) {\r\n polygonVertex.newIndex = vertexMap[key];\r\n } else {\r\n const newIndex = uBuffer.length;\r\n uBuffer.push(polygonVertex.getU());\r\n vBuffer.push(polygonVertex.getV());\r\n heightBuffer.push(polygonVertex.getH());\r\n if (hasVertexNormals) {\r\n normalBuffer.push(polygonVertex.getNormalX());\r\n normalBuffer.push(polygonVertex.getNormalY());\r\n }\r\n polygonVertex.newIndex = newIndex;\r\n vertexMap[key] = newIndex;\r\n }\r\n } else {\r\n polygonVertex.newIndex = vertexMap[polygonVertex.index];\r\n polygonVertex.uBuffer = uBuffer;\r\n polygonVertex.vBuffer = vBuffer;\r\n polygonVertex.heightBuffer = heightBuffer;\r\n if (hasVertexNormals) {\r\n polygonVertex.normalBuffer = normalBuffer;\r\n }\r\n }\r\n }\r\n\r\n if (numVertices === 3) {\r\n // A triangle.\r\n indices.push(polygonVertices[0].newIndex);\r\n indices.push(polygonVertices[1].newIndex);\r\n indices.push(polygonVertices[2].newIndex);\r\n } else if (numVertices === 4) {\r\n // A quad - two triangles.\r\n indices.push(polygonVertices[0].newIndex);\r\n indices.push(polygonVertices[1].newIndex);\r\n indices.push(polygonVertices[2].newIndex);\r\n\r\n indices.push(polygonVertices[0].newIndex);\r\n indices.push(polygonVertices[2].newIndex);\r\n indices.push(polygonVertices[3].newIndex);\r\n }\r\n}\r\nexport default createTaskProcessorWorker(upsampleQuantizedTerrainMesh);\r\n"],"names":["defined","DeveloperError","Cartesian3","Check","Cartesian2","Cartographic","BoundingSphere","OrientedBoundingBox","TerrainEncoding","CesiumMath","Intersections2D","Ellipsoid","Rectangle","EllipsoidalOccluder","IndexDatatype","AttributeCompression"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA;EACA;EACA;EACA;EACA;EACA,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,eAAe,CAAC,kCAAkC,GAAG;EACrD,EAAE,SAAS;EACX,EAAE,SAAS;EACX,EAAE,EAAE;EACJ,EAAE,EAAE;EACJ,EAAE,EAAE;EACJ,EAAE,MAAM;EACR,EAAE;EACF;EACA,EAAE,IAAI,CAACA,oBAAO,CAAC,SAAS,CAAC,EAAE;EAC3B,IAAI,MAAM,IAAIC,oBAAc,CAAC,wBAAwB,CAAC,CAAC;EACvD,GAAG;EACH,EAAE,IAAI,CAACD,oBAAO,CAAC,SA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C,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;EAC9C,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;EAC9C,GAAG,MAAM,IAAI,WAAW,KAAK,CAAC,EAAE;EAChC;EACA,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;EAC9C,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;EAC9C,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC9C;EACA,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;EAC9C,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;EAC9C,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;EAC9C,GAAG;EACH,CAAC;AACD,uCAAe,yBAAyB,CAAC,4BAA4B,CAAC;;;;;;;;"}
\ No newline at end of file
diff --git a/examples/cesium/index.js b/examples/cesium/index.js
new file mode 100644
index 0000000..847b387
--- /dev/null
+++ b/examples/cesium/index.js
@@ -0,0 +1,217485 @@
+/**
+ * @license
+ * Cesium - https://github.com/CesiumGS/cesium
+ * Version 1.99
+ *
+ * Copyright 2011-2022 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/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
+ */
+
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
+ get: (a3, b) => (typeof require !== "undefined" ? require : a3)[b]
+}) : x)(function(x) {
+ if (typeof require !== "undefined")
+ return require.apply(this, arguments);
+ throw new Error('Dynamic require of "' + x + '" is not supported');
+});
+var __commonJS = (cb, mod2) => function __require2() {
+ return mod2 || (0, cb[__getOwnPropNames(cb)[0]])((mod2 = { exports: {} }).exports, mod2), mod2.exports;
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__getProtoOf(mod2)) : {}, __copyProps(
+ isNodeMode || !mod2 || !mod2.__esModule ? __defProp(target, "default", { value: mod2, enumerable: true }) : target,
+ mod2
+));
+
+// node_modules/mersenne-twister/src/mersenne-twister.js
+var require_mersenne_twister = __commonJS({
+ "node_modules/mersenne-twister/src/mersenne-twister.js"(exports2, module2) {
+ var MersenneTwister4 = function(seed) {
+ if (seed == void 0) {
+ seed = 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;
+ if (seed.constructor == Array) {
+ this.init_by_array(seed, seed.length);
+ } else {
+ this.init_seed(seed);
+ }
+ };
+ MersenneTwister4.prototype.init_seed = function(s) {
+ this.mt[0] = s >>> 0;
+ for (this.mti = 1; this.mti < this.N; this.mti++) {
+ var s = this.mt[this.mti - 1] ^ this.mt[this.mti - 1] >>> 30;
+ this.mt[this.mti] = (((s & 4294901760) >>> 16) * 1812433253 << 16) + (s & 65535) * 1812433253 + this.mti;
+ this.mt[this.mti] >>>= 0;
+ }
+ };
+ MersenneTwister4.prototype.init_by_array = function(init_key, key_length) {
+ var i, j, k;
+ this.init_seed(19650218);
+ i = 1;
+ j = 0;
+ k = this.N > key_length ? this.N : key_length;
+ for (; k; k--) {
+ var s = this.mt[i - 1] ^ this.mt[i - 1] >>> 30;
+ this.mt[i] = (this.mt[i] ^ (((s & 4294901760) >>> 16) * 1664525 << 16) + (s & 65535) * 1664525) + init_key[j] + j;
+ this.mt[i] >>>= 0;
+ i++;
+ j++;
+ if (i >= this.N) {
+ this.mt[0] = this.mt[this.N - 1];
+ i = 1;
+ }
+ if (j >= key_length)
+ j = 0;
+ }
+ for (k = this.N - 1; k; k--) {
+ var s = this.mt[i - 1] ^ this.mt[i - 1] >>> 30;
+ this.mt[i] = (this.mt[i] ^ (((s & 4294901760) >>> 16) * 1566083941 << 16) + (s & 65535) * 1566083941) - i;
+ this.mt[i] >>>= 0;
+ i++;
+ if (i >= this.N) {
+ this.mt[0] = this.mt[this.N - 1];
+ i = 1;
+ }
+ }
+ this.mt[0] = 2147483648;
+ };
+ MersenneTwister4.prototype.random_int = function() {
+ var y;
+ var mag01 = new Array(0, this.MATRIX_A);
+ if (this.mti >= this.N) {
+ var kk;
+ if (this.mti == this.N + 1)
+ this.init_seed(5489);
+ for (kk = 0; kk < this.N - this.M; kk++) {
+ y = this.mt[kk] & this.UPPER_MASK | this.mt[kk + 1] & this.LOWER_MASK;
+ this.mt[kk] = this.mt[kk + this.M] ^ y >>> 1 ^ mag01[y & 1];
+ }
+ for (; kk < this.N - 1; kk++) {
+ y = this.mt[kk] & this.UPPER_MASK | this.mt[kk + 1] & this.LOWER_MASK;
+ this.mt[kk] = this.mt[kk + (this.M - this.N)] ^ y >>> 1 ^ mag01[y & 1];
+ }
+ y = this.mt[this.N - 1] & this.UPPER_MASK | this.mt[0] & this.LOWER_MASK;
+ this.mt[this.N - 1] = this.mt[this.M - 1] ^ y >>> 1 ^ mag01[y & 1];
+ this.mti = 0;
+ }
+ y = this.mt[this.mti++];
+ y ^= y >>> 11;
+ y ^= y << 7 & 2636928640;
+ y ^= y << 15 & 4022730752;
+ y ^= y >>> 18;
+ return y >>> 0;
+ };
+ MersenneTwister4.prototype.random_int31 = function() {
+ return this.random_int() >>> 1;
+ };
+ MersenneTwister4.prototype.random_incl = function() {
+ return this.random_int() * (1 / 4294967295);
+ };
+ MersenneTwister4.prototype.random = function() {
+ return this.random_int() * (1 / 4294967296);
+ };
+ MersenneTwister4.prototype.random_excl = function() {
+ return (this.random_int() + 0.5) * (1 / 4294967296);
+ };
+ MersenneTwister4.prototype.random_long = function() {
+ var a3 = this.random_int() >>> 5, b = this.random_int() >>> 6;
+ return (a3 * 67108864 + b) * (1 / 9007199254740992);
+ };
+ module2.exports = MersenneTwister4;
+ }
+});
+
+// node_modules/urijs/src/punycode.js
+var require_punycode = __commonJS({
+ "node_modules/urijs/src/punycode.js"(exports2, module2) {
+ /*! https://mths.be/punycode v1.4.0 by @mathias */
+ (function(root) {
+ var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2;
+ var freeModule = typeof module2 == "object" && module2 && !module2.nodeType && module2;
+ var freeGlobal = typeof global == "object" && global;
+ if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal) {
+ root = freeGlobal;
+ }
+ var punycode, maxInt = 2147483647, base = 36, tMin = 1, tMax = 26, skew = 38, damp = 700, initialBias = 72, initialN = 128, delimiter = "-", regexPunycode = /^xn--/, regexNonASCII = /[^\x20-\x7E]/, regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, errors = {
+ "overflow": "Overflow: input needs wider integers to process",
+ "not-basic": "Illegal input >= 0x80 (not a basic code point)",
+ "invalid-input": "Invalid input"
+ }, baseMinusTMin = base - tMin, floor = Math.floor, stringFromCharCode = String.fromCharCode, key;
+ function error(type) {
+ throw new RangeError(errors[type]);
+ }
+ function map(array, fn) {
+ var length3 = array.length;
+ var result = [];
+ while (length3--) {
+ result[length3] = fn(array[length3]);
+ }
+ return result;
+ }
+ function mapDomain(string, fn) {
+ var parts = string.split("@");
+ var result = "";
+ if (parts.length > 1) {
+ result = parts[0] + "@";
+ string = parts[1];
+ }
+ string = string.replace(regexSeparators, ".");
+ var labels = string.split(".");
+ var encoded = map(labels, fn).join(".");
+ return result + encoded;
+ }
+ function ucs2decode(string) {
+ var output = [], counter = 0, length3 = string.length, value, extra;
+ while (counter < length3) {
+ value = string.charCodeAt(counter++);
+ if (value >= 55296 && value <= 56319 && counter < length3) {
+ extra = string.charCodeAt(counter++);
+ if ((extra & 64512) == 56320) {
+ output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
+ } else {
+ output.push(value);
+ counter--;
+ }
+ } else {
+ output.push(value);
+ }
+ }
+ return output;
+ }
+ function ucs2encode(array) {
+ return map(array, function(value) {
+ var output = "";
+ if (value > 65535) {
+ value -= 65536;
+ output += stringFromCharCode(value >>> 10 & 1023 | 55296);
+ value = 56320 | value & 1023;
+ }
+ output += stringFromCharCode(value);
+ return output;
+ }).join("");
+ }
+ function basicToDigit(codePoint) {
+ if (codePoint - 48 < 10) {
+ return codePoint - 22;
+ }
+ if (codePoint - 65 < 26) {
+ return codePoint - 65;
+ }
+ if (codePoint - 97 < 26) {
+ return codePoint - 97;
+ }
+ return base;
+ }
+ function digitToBasic(digit, flag) {
+ return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
+ }
+ function adapt(delta, numPoints, firstTime) {
+ var k = 0;
+ delta = firstTime ? floor(delta / damp) : delta >> 1;
+ delta += floor(delta / numPoints);
+ for (; delta > baseMinusTMin * tMax >> 1; k += base) {
+ delta = floor(delta / baseMinusTMin);
+ }
+ return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
+ }
+ function decode(input) {
+ var output = [], inputLength = input.length, out, i = 0, n = initialN, bias = initialBias, basic, j, index, oldi, w, k, digit, t, baseMinusT;
+ basic = input.lastIndexOf(delimiter);
+ if (basic < 0) {
+ basic = 0;
+ }
+ for (j = 0; j < basic; ++j) {
+ if (input.charCodeAt(j) >= 128) {
+ error("not-basic");
+ }
+ output.push(input.charCodeAt(j));
+ }
+ for (index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {
+ for (oldi = i, w = 1, k = base; ; k += base) {
+ if (index >= inputLength) {
+ error("invalid-input");
+ }
+ digit = basicToDigit(input.charCodeAt(index++));
+ if (digit >= base || digit > floor((maxInt - i) / w)) {
+ error("overflow");
+ }
+ i += digit * w;
+ t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
+ if (digit < t) {
+ break;
+ }
+ baseMinusT = base - t;
+ if (w > floor(maxInt / baseMinusT)) {
+ error("overflow");
+ }
+ w *= baseMinusT;
+ }
+ out = output.length + 1;
+ bias = adapt(i - oldi, out, oldi == 0);
+ if (floor(i / out) > maxInt - n) {
+ error("overflow");
+ }
+ n += floor(i / out);
+ i %= out;
+ output.splice(i++, 0, n);
+ }
+ return ucs2encode(output);
+ }
+ function encode(input) {
+ var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [], inputLength, handledCPCountPlusOne, baseMinusT, qMinusT;
+ input = ucs2decode(input);
+ inputLength = input.length;
+ n = initialN;
+ delta = 0;
+ bias = initialBias;
+ for (j = 0; j < inputLength; ++j) {
+ currentValue = input[j];
+ if (currentValue < 128) {
+ output.push(stringFromCharCode(currentValue));
+ }
+ }
+ handledCPCount = basicLength = output.length;
+ if (basicLength) {
+ output.push(delimiter);
+ }
+ while (handledCPCount < inputLength) {
+ for (m = maxInt, j = 0; j < inputLength; ++j) {
+ currentValue = input[j];
+ if (currentValue >= n && currentValue < m) {
+ m = currentValue;
+ }
+ }
+ handledCPCountPlusOne = handledCPCount + 1;
+ if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
+ error("overflow");
+ }
+ delta += (m - n) * handledCPCountPlusOne;
+ n = m;
+ for (j = 0; j < inputLength; ++j) {
+ currentValue = input[j];
+ if (currentValue < n && ++delta > maxInt) {
+ error("overflow");
+ }
+ if (currentValue == n) {
+ for (q = delta, k = base; ; k += base) {
+ t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
+ if (q < t) {
+ break;
+ }
+ qMinusT = q - t;
+ baseMinusT = base - t;
+ output.push(
+ stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
+ );
+ q = floor(qMinusT / baseMinusT);
+ }
+ output.push(stringFromCharCode(digitToBasic(q, 0)));
+ bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
+ delta = 0;
+ ++handledCPCount;
+ }
+ }
+ ++delta;
+ ++n;
+ }
+ return output.join("");
+ }
+ function toUnicode(input) {
+ return mapDomain(input, function(string) {
+ return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
+ });
+ }
+ function toASCII(input) {
+ return mapDomain(input, function(string) {
+ return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
+ });
+ }
+ punycode = {
+ "version": "1.3.2",
+ "ucs2": {
+ "decode": ucs2decode,
+ "encode": ucs2encode
+ },
+ "decode": decode,
+ "encode": encode,
+ "toASCII": toASCII,
+ "toUnicode": toUnicode
+ };
+ if (typeof define == "function" && typeof define.amd == "object" && define.amd) {
+ define("punycode", function() {
+ return punycode;
+ });
+ } else if (freeExports && freeModule) {
+ if (module2.exports == freeExports) {
+ freeModule.exports = punycode;
+ } else {
+ for (key in punycode) {
+ punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
+ }
+ }
+ } else {
+ root.punycode = punycode;
+ }
+ })(exports2);
+ }
+});
+
+// node_modules/urijs/src/IPv6.js
+var require_IPv6 = __commonJS({
+ "node_modules/urijs/src/IPv6.js"(exports2, module2) {
+ /*!
+ * URI.js - Mutating URLs
+ * IPv6 Support
+ *
+ * Version: 1.19.11
+ *
+ * Author: Rodney Rehm
+ * Web: http://medialize.github.io/URI.js/
+ *
+ * Licensed under
+ * MIT License http://www.opensource.org/licenses/mit-license
+ *
+ */
+ (function(root, factory) {
+ "use strict";
+ if (typeof module2 === "object" && module2.exports) {
+ module2.exports = factory();
+ } else if (typeof define === "function" && define.amd) {
+ define(factory);
+ } else {
+ root.IPv6 = factory(root);
+ }
+ })(exports2, function(root) {
+ "use strict";
+ var _IPv6 = root && root.IPv6;
+ function bestPresentation(address) {
+ var _address = address.toLowerCase();
+ var segments = _address.split(":");
+ var length3 = segments.length;
+ var total = 8;
+ if (segments[0] === "" && segments[1] === "" && segments[2] === "") {
+ segments.shift();
+ segments.shift();
+ } else if (segments[0] === "" && segments[1] === "") {
+ segments.shift();
+ } else if (segments[length3 - 1] === "" && segments[length3 - 2] === "") {
+ segments.pop();
+ }
+ length3 = segments.length;
+ if (segments[length3 - 1].indexOf(".") !== -1) {
+ total = 7;
+ }
+ var pos;
+ for (pos = 0; pos < length3; pos++) {
+ if (segments[pos] === "") {
+ break;
+ }
+ }
+ if (pos < total) {
+ segments.splice(pos, 1, "0000");
+ while (segments.length < total) {
+ segments.splice(pos, 0, "0000");
+ }
+ }
+ var _segments;
+ for (var i = 0; i < total; i++) {
+ _segments = segments[i].split("");
+ for (var j = 0; j < 3; j++) {
+ if (_segments[0] === "0" && _segments.length > 1) {
+ _segments.splice(0, 1);
+ } else {
+ break;
+ }
+ }
+ segments[i] = _segments.join("");
+ }
+ var best = -1;
+ var _best = 0;
+ var _current = 0;
+ var current = -1;
+ var inzeroes = false;
+ for (i = 0; i < total; i++) {
+ if (inzeroes) {
+ if (segments[i] === "0") {
+ _current += 1;
+ } else {
+ inzeroes = false;
+ if (_current > _best) {
+ best = current;
+ _best = _current;
+ }
+ }
+ } else {
+ if (segments[i] === "0") {
+ inzeroes = true;
+ current = i;
+ _current = 1;
+ }
+ }
+ }
+ if (_current > _best) {
+ best = current;
+ _best = _current;
+ }
+ if (_best > 1) {
+ segments.splice(best, _best, "");
+ }
+ length3 = segments.length;
+ var result = "";
+ if (segments[0] === "") {
+ result = ":";
+ }
+ for (i = 0; i < length3; i++) {
+ result += segments[i];
+ if (i === length3 - 1) {
+ break;
+ }
+ result += ":";
+ }
+ if (segments[length3 - 1] === "") {
+ result += ":";
+ }
+ return result;
+ }
+ function noConflict() {
+ if (root.IPv6 === this) {
+ root.IPv6 = _IPv6;
+ }
+ return this;
+ }
+ return {
+ best: bestPresentation,
+ noConflict
+ };
+ });
+ }
+});
+
+// node_modules/urijs/src/SecondLevelDomains.js
+var require_SecondLevelDomains = __commonJS({
+ "node_modules/urijs/src/SecondLevelDomains.js"(exports2, module2) {
+ /*!
+ * URI.js - Mutating URLs
+ * Second Level Domain (SLD) Support
+ *
+ * Version: 1.19.11
+ *
+ * Author: Rodney Rehm
+ * Web: http://medialize.github.io/URI.js/
+ *
+ * Licensed under
+ * MIT License http://www.opensource.org/licenses/mit-license
+ *
+ */
+ (function(root, factory) {
+ "use strict";
+ if (typeof module2 === "object" && module2.exports) {
+ module2.exports = factory();
+ } else if (typeof define === "function" && define.amd) {
+ define(factory);
+ } else {
+ root.SecondLevelDomains = factory(root);
+ }
+ })(exports2, function(root) {
+ "use strict";
+ var _SecondLevelDomains = root && root.SecondLevelDomains;
+ var SLD = {
+ list: {
+ "ac": " com gov mil net org ",
+ "ae": " ac co gov mil name net org pro sch ",
+ "af": " com edu gov net org ",
+ "al": " com edu gov mil net org ",
+ "ao": " co ed gv it og pb ",
+ "ar": " com edu gob gov int mil net org tur ",
+ "at": " ac co gv or ",
+ "au": " asn com csiro edu gov id net org ",
+ "ba": " co com edu gov mil net org rs unbi unmo unsa untz unze ",
+ "bb": " biz co com edu gov info net org store tv ",
+ "bh": " biz cc com edu gov info net org ",
+ "bn": " com edu gov net org ",
+ "bo": " com edu gob gov int mil net org tv ",
+ "br": " adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",
+ "bs": " com edu gov net org ",
+ "bz": " du et om ov rg ",
+ "ca": " ab bc mb nb nf nl ns nt nu on pe qc sk yk ",
+ "ck": " biz co edu gen gov info net org ",
+ "cn": " ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",
+ "co": " com edu gov mil net nom org ",
+ "cr": " ac c co ed fi go or sa ",
+ "cy": " ac biz com ekloges gov ltd name net org parliament press pro tm ",
+ "do": " art com edu gob gov mil net org sld web ",
+ "dz": " art asso com edu gov net org pol ",
+ "ec": " com edu fin gov info med mil net org pro ",
+ "eg": " com edu eun gov mil name net org sci ",
+ "er": " com edu gov ind mil net org rochest w ",
+ "es": " com edu gob nom org ",
+ "et": " biz com edu gov info name net org ",
+ "fj": " ac biz com info mil name net org pro ",
+ "fk": " ac co gov net nom org ",
+ "fr": " asso com f gouv nom prd presse tm ",
+ "gg": " co net org ",
+ "gh": " com edu gov mil org ",
+ "gn": " ac com gov net org ",
+ "gr": " com edu gov mil net org ",
+ "gt": " com edu gob ind mil net org ",
+ "gu": " com edu gov net org ",
+ "hk": " com edu gov idv net org ",
+ "hu": " 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",
+ "id": " ac co go mil net or sch web ",
+ "il": " ac co gov idf k12 muni net org ",
+ "in": " ac co edu ernet firm gen gov i ind mil net nic org res ",
+ "iq": " com edu gov i mil net org ",
+ "ir": " ac co dnssec gov i id net org sch ",
+ "it": " edu gov ",
+ "je": " co net org ",
+ "jo": " com edu gov mil name net org sch ",
+ "jp": " ac ad co ed go gr lg ne or ",
+ "ke": " ac co go info me mobi ne or sc ",
+ "kh": " com edu gov mil net org per ",
+ "ki": " biz com de edu gov info mob net org tel ",
+ "km": " asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",
+ "kn": " edu gov net org ",
+ "kr": " ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",
+ "kw": " com edu gov net org ",
+ "ky": " com edu gov net org ",
+ "kz": " com edu gov mil net org ",
+ "lb": " com edu gov net org ",
+ "lk": " assn com edu gov grp hotel int ltd net ngo org sch soc web ",
+ "lr": " com edu gov net org ",
+ "lv": " asn com conf edu gov id mil net org ",
+ "ly": " com edu gov id med net org plc sch ",
+ "ma": " ac co gov m net org press ",
+ "mc": " asso tm ",
+ "me": " ac co edu gov its net org priv ",
+ "mg": " com edu gov mil nom org prd tm ",
+ "mk": " com edu gov inf name net org pro ",
+ "ml": " com edu gov net org presse ",
+ "mn": " edu gov org ",
+ "mo": " com edu gov net org ",
+ "mt": " com edu gov net org ",
+ "mv": " aero biz com coop edu gov info int mil museum name net org pro ",
+ "mw": " ac co com coop edu gov int museum net org ",
+ "mx": " com edu gob net org ",
+ "my": " com edu gov mil name net org sch ",
+ "nf": " arts com firm info net other per rec store web ",
+ "ng": " biz com edu gov mil mobi name net org sch ",
+ "ni": " ac co com edu gob mil net nom org ",
+ "np": " com edu gov mil net org ",
+ "nr": " biz com edu gov info net org ",
+ "om": " ac biz co com edu gov med mil museum net org pro sch ",
+ "pe": " com edu gob mil net nom org sld ",
+ "ph": " com edu gov i mil net ngo org ",
+ "pk": " biz com edu fam gob gok gon gop gos gov net org web ",
+ "pl": " art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",
+ "pr": " ac biz com edu est gov info isla name net org pro prof ",
+ "ps": " com edu gov net org plo sec ",
+ "pw": " belau co ed go ne or ",
+ "ro": " arts com firm info nom nt org rec store tm www ",
+ "rs": " ac co edu gov in org ",
+ "sb": " com edu gov net org ",
+ "sc": " com edu gov net org ",
+ "sh": " co com edu gov net nom org ",
+ "sl": " com edu gov net org ",
+ "st": " co com consulado edu embaixada gov mil net org principe saotome store ",
+ "sv": " com edu gob org red ",
+ "sz": " ac co org ",
+ "tr": " av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",
+ "tt": " aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",
+ "tw": " club com ebiz edu game gov idv mil net org ",
+ "mu": " ac co com gov net or org ",
+ "mz": " ac co edu gov org ",
+ "na": " co com ",
+ "nz": " ac co cri geek gen govt health iwi maori mil net org parliament school ",
+ "pa": " abo ac com edu gob ing med net nom org sld ",
+ "pt": " com edu gov int net nome org publ ",
+ "py": " com edu gov mil net org ",
+ "qa": " com edu gov mil net org ",
+ "re": " asso com nom ",
+ "ru": " ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",
+ "rw": " ac co com edu gouv gov int mil net ",
+ "sa": " com edu gov med net org pub sch ",
+ "sd": " com edu gov info med net org tv ",
+ "se": " a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",
+ "sg": " com edu gov idn net org per ",
+ "sn": " art com edu gouv org perso univ ",
+ "sy": " com edu gov mil net news org ",
+ "th": " ac co go in mi net or ",
+ "tj": " ac biz co com edu go gov info int mil name net nic org test web ",
+ "tn": " agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",
+ "tz": " ac co go ne or ",
+ "ua": " biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",
+ "ug": " ac co go ne or org sc ",
+ "uk": " ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",
+ "us": " dni fed isa kids nsn ",
+ "uy": " com edu gub mil net org ",
+ "ve": " co com edu gob info mil net org web ",
+ "vi": " co com k12 net org ",
+ "vn": " ac biz com edu gov health info int name net org pro ",
+ "ye": " co com gov ltd me net org plc ",
+ "yu": " ac co edu gov org ",
+ "za": " ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",
+ "zm": " ac co com edu gov net org sch ",
+ "com": "ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",
+ "net": "gb jp se uk ",
+ "org": "ae",
+ "de": "com "
+ },
+ has: function(domain) {
+ var tldOffset = domain.lastIndexOf(".");
+ if (tldOffset <= 0 || tldOffset >= domain.length - 1) {
+ return false;
+ }
+ var sldOffset = domain.lastIndexOf(".", tldOffset - 1);
+ if (sldOffset <= 0 || sldOffset >= tldOffset - 1) {
+ return false;
+ }
+ var sldList = SLD.list[domain.slice(tldOffset + 1)];
+ if (!sldList) {
+ return false;
+ }
+ return sldList.indexOf(" " + domain.slice(sldOffset + 1, tldOffset) + " ") >= 0;
+ },
+ is: function(domain) {
+ var tldOffset = domain.lastIndexOf(".");
+ if (tldOffset <= 0 || tldOffset >= domain.length - 1) {
+ return false;
+ }
+ var sldOffset = domain.lastIndexOf(".", tldOffset - 1);
+ if (sldOffset >= 0) {
+ return false;
+ }
+ var sldList = SLD.list[domain.slice(tldOffset + 1)];
+ if (!sldList) {
+ return false;
+ }
+ return sldList.indexOf(" " + domain.slice(0, tldOffset) + " ") >= 0;
+ },
+ get: function(domain) {
+ var tldOffset = domain.lastIndexOf(".");
+ if (tldOffset <= 0 || tldOffset >= domain.length - 1) {
+ return null;
+ }
+ var sldOffset = domain.lastIndexOf(".", tldOffset - 1);
+ if (sldOffset <= 0 || sldOffset >= tldOffset - 1) {
+ return null;
+ }
+ var sldList = SLD.list[domain.slice(tldOffset + 1)];
+ if (!sldList) {
+ return null;
+ }
+ if (sldList.indexOf(" " + domain.slice(sldOffset + 1, tldOffset) + " ") < 0) {
+ return null;
+ }
+ return domain.slice(sldOffset + 1);
+ },
+ noConflict: function() {
+ if (root.SecondLevelDomains === this) {
+ root.SecondLevelDomains = _SecondLevelDomains;
+ }
+ return this;
+ }
+ };
+ return SLD;
+ });
+ }
+});
+
+// node_modules/urijs/src/URI.js
+var require_URI = __commonJS({
+ "node_modules/urijs/src/URI.js"(exports2, module2) {
+ /*!
+ * URI.js - Mutating URLs
+ *
+ * Version: 1.19.11
+ *
+ * Author: Rodney Rehm
+ * Web: http://medialize.github.io/URI.js/
+ *
+ * Licensed under
+ * MIT License http://www.opensource.org/licenses/mit-license
+ *
+ */
+ (function(root, factory) {
+ "use strict";
+ if (typeof module2 === "object" && module2.exports) {
+ module2.exports = factory(require_punycode(), require_IPv6(), require_SecondLevelDomains());
+ } else if (typeof define === "function" && define.amd) {
+ define(["./punycode", "./IPv6", "./SecondLevelDomains"], factory);
+ } else {
+ root.URI = factory(root.punycode, root.IPv6, root.SecondLevelDomains, root);
+ }
+ })(exports2, function(punycode, IPv6, SLD, root) {
+ "use strict";
+ var _URI = root && root.URI;
+ function URI(url2, base) {
+ var _urlSupplied = arguments.length >= 1;
+ var _baseSupplied = arguments.length >= 2;
+ if (!(this instanceof URI)) {
+ if (_urlSupplied) {
+ if (_baseSupplied) {
+ return new URI(url2, base);
+ }
+ return new URI(url2);
+ }
+ return new URI();
+ }
+ if (url2 === void 0) {
+ if (_urlSupplied) {
+ throw new TypeError("undefined is not a valid argument for URI");
+ }
+ if (typeof location !== "undefined") {
+ url2 = location.href + "";
+ } else {
+ url2 = "";
+ }
+ }
+ if (url2 === null) {
+ if (_urlSupplied) {
+ throw new TypeError("null is not a valid argument for URI");
+ }
+ }
+ this.href(url2);
+ if (base !== void 0) {
+ return this.absoluteTo(base);
+ }
+ return this;
+ }
+ function isInteger(value) {
+ return /^[0-9]+$/.test(value);
+ }
+ URI.version = "1.19.11";
+ var p = URI.prototype;
+ var hasOwn = Object.prototype.hasOwnProperty;
+ function escapeRegEx(string) {
+ return string.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
+ }
+ function getType(value) {
+ if (value === void 0) {
+ return "Undefined";
+ }
+ return String(Object.prototype.toString.call(value)).slice(8, -1);
+ }
+ function isArray(obj) {
+ return getType(obj) === "Array";
+ }
+ function filterArrayValues(data, value) {
+ var lookup = {};
+ var i, length3;
+ if (getType(value) === "RegExp") {
+ lookup = null;
+ } else if (isArray(value)) {
+ for (i = 0, length3 = value.length; i < length3; i++) {
+ lookup[value[i]] = true;
+ }
+ } else {
+ lookup[value] = true;
+ }
+ for (i = 0, length3 = data.length; i < length3; i++) {
+ var _match = lookup && lookup[data[i]] !== void 0 || !lookup && value.test(data[i]);
+ if (_match) {
+ data.splice(i, 1);
+ length3--;
+ i--;
+ }
+ }
+ return data;
+ }
+ function arrayContains(list, value) {
+ var i, length3;
+ if (isArray(value)) {
+ for (i = 0, length3 = value.length; i < length3; i++) {
+ if (!arrayContains(list, value[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+ var _type = getType(value);
+ for (i = 0, length3 = list.length; i < length3; i++) {
+ if (_type === "RegExp") {
+ if (typeof list[i] === "string" && list[i].match(value)) {
+ return true;
+ }
+ } else if (list[i] === value) {
+ return true;
+ }
+ }
+ return false;
+ }
+ function arraysEqual(one, two) {
+ if (!isArray(one) || !isArray(two)) {
+ return false;
+ }
+ if (one.length !== two.length) {
+ return false;
+ }
+ one.sort();
+ two.sort();
+ for (var i = 0, l = one.length; i < l; i++) {
+ if (one[i] !== two[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+ function trimSlashes(text) {
+ var trim_expression = /^\/+|\/+$/g;
+ return text.replace(trim_expression, "");
+ }
+ URI._parts = function() {
+ return {
+ protocol: null,
+ username: null,
+ password: null,
+ hostname: null,
+ urn: null,
+ port: null,
+ path: null,
+ query: null,
+ fragment: null,
+ preventInvalidHostname: URI.preventInvalidHostname,
+ duplicateQueryParameters: URI.duplicateQueryParameters,
+ escapeQuerySpace: URI.escapeQuerySpace
+ };
+ };
+ URI.preventInvalidHostname = false;
+ URI.duplicateQueryParameters = false;
+ URI.escapeQuerySpace = true;
+ URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i;
+ URI.idn_expression = /[^a-z0-9\._-]/i;
+ URI.punycode_expression = /(xn--)/i;
+ URI.ip4_expression = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
+ URI.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
+ URI.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig;
+ URI.findUri = {
+ start: /\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,
+ end: /[\s\r\n]|$/,
+ trim: /[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,
+ parens: /(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g
+ };
+ URI.leading_whitespace_expression = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;
+ URI.ascii_tab_whitespace = /[\u0009\u000A\u000D]+/g;
+ URI.defaultPorts = {
+ http: "80",
+ https: "443",
+ ftp: "21",
+ gopher: "70",
+ ws: "80",
+ wss: "443"
+ };
+ URI.hostProtocols = [
+ "http",
+ "https"
+ ];
+ URI.invalid_hostname_characters = /[^a-zA-Z0-9\.\-:_]/;
+ URI.domAttributes = {
+ "a": "href",
+ "blockquote": "cite",
+ "link": "href",
+ "base": "href",
+ "script": "src",
+ "form": "action",
+ "img": "src",
+ "area": "href",
+ "iframe": "src",
+ "embed": "src",
+ "source": "src",
+ "track": "src",
+ "input": "src",
+ "audio": "src",
+ "video": "src"
+ };
+ URI.getDomAttribute = function(node) {
+ if (!node || !node.nodeName) {
+ return void 0;
+ }
+ var nodeName = node.nodeName.toLowerCase();
+ if (nodeName === "input" && node.type !== "image") {
+ return void 0;
+ }
+ return URI.domAttributes[nodeName];
+ };
+ function escapeForDumbFirefox36(value) {
+ return escape(value);
+ }
+ function strictEncodeURIComponent(string) {
+ return encodeURIComponent(string).replace(/[!'()*]/g, escapeForDumbFirefox36).replace(/\*/g, "%2A");
+ }
+ URI.encode = strictEncodeURIComponent;
+ URI.decode = decodeURIComponent;
+ URI.iso8859 = function() {
+ URI.encode = escape;
+ URI.decode = unescape;
+ };
+ URI.unicode = function() {
+ URI.encode = strictEncodeURIComponent;
+ URI.decode = decodeURIComponent;
+ };
+ URI.characters = {
+ pathname: {
+ encode: {
+ expression: /%(24|26|2B|2C|3B|3D|3A|40)/ig,
+ map: {
+ "%24": "$",
+ "%26": "&",
+ "%2B": "+",
+ "%2C": ",",
+ "%3B": ";",
+ "%3D": "=",
+ "%3A": ":",
+ "%40": "@"
+ }
+ },
+ decode: {
+ expression: /[\/\?#]/g,
+ map: {
+ "/": "%2F",
+ "?": "%3F",
+ "#": "%23"
+ }
+ }
+ },
+ reserved: {
+ encode: {
+ expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,
+ map: {
+ "%3A": ":",
+ "%2F": "/",
+ "%3F": "?",
+ "%23": "#",
+ "%5B": "[",
+ "%5D": "]",
+ "%40": "@",
+ "%21": "!",
+ "%24": "$",
+ "%26": "&",
+ "%27": "'",
+ "%28": "(",
+ "%29": ")",
+ "%2A": "*",
+ "%2B": "+",
+ "%2C": ",",
+ "%3B": ";",
+ "%3D": "="
+ }
+ }
+ },
+ urnpath: {
+ encode: {
+ expression: /%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,
+ map: {
+ "%21": "!",
+ "%24": "$",
+ "%27": "'",
+ "%28": "(",
+ "%29": ")",
+ "%2A": "*",
+ "%2B": "+",
+ "%2C": ",",
+ "%3B": ";",
+ "%3D": "=",
+ "%40": "@"
+ }
+ },
+ decode: {
+ expression: /[\/\?#:]/g,
+ map: {
+ "/": "%2F",
+ "?": "%3F",
+ "#": "%23",
+ ":": "%3A"
+ }
+ }
+ }
+ };
+ URI.encodeQuery = function(string, escapeQuerySpace) {
+ var escaped = URI.encode(string + "");
+ if (escapeQuerySpace === void 0) {
+ escapeQuerySpace = URI.escapeQuerySpace;
+ }
+ return escapeQuerySpace ? escaped.replace(/%20/g, "+") : escaped;
+ };
+ URI.decodeQuery = function(string, escapeQuerySpace) {
+ string += "";
+ if (escapeQuerySpace === void 0) {
+ escapeQuerySpace = URI.escapeQuerySpace;
+ }
+ try {
+ return URI.decode(escapeQuerySpace ? string.replace(/\+/g, "%20") : string);
+ } catch (e) {
+ return string;
+ }
+ };
+ var _parts = { "encode": "encode", "decode": "decode" };
+ var _part;
+ var generateAccessor = function(_group, _part2) {
+ return function(string) {
+ try {
+ return URI[_part2](string + "").replace(URI.characters[_group][_part2].expression, function(c) {
+ return URI.characters[_group][_part2].map[c];
+ });
+ } catch (e) {
+ return string;
+ }
+ };
+ };
+ for (_part in _parts) {
+ URI[_part + "PathSegment"] = generateAccessor("pathname", _parts[_part]);
+ URI[_part + "UrnPathSegment"] = generateAccessor("urnpath", _parts[_part]);
+ }
+ var generateSegmentedPathFunction = function(_sep, _codingFuncName, _innerCodingFuncName) {
+ return function(string) {
+ var actualCodingFunc;
+ if (!_innerCodingFuncName) {
+ actualCodingFunc = URI[_codingFuncName];
+ } else {
+ actualCodingFunc = function(string2) {
+ return URI[_codingFuncName](URI[_innerCodingFuncName](string2));
+ };
+ }
+ var segments = (string + "").split(_sep);
+ for (var i = 0, length3 = segments.length; i < length3; i++) {
+ segments[i] = actualCodingFunc(segments[i]);
+ }
+ return segments.join(_sep);
+ };
+ };
+ URI.decodePath = generateSegmentedPathFunction("/", "decodePathSegment");
+ URI.decodeUrnPath = generateSegmentedPathFunction(":", "decodeUrnPathSegment");
+ URI.recodePath = generateSegmentedPathFunction("/", "encodePathSegment", "decode");
+ URI.recodeUrnPath = generateSegmentedPathFunction(":", "encodeUrnPathSegment", "decode");
+ URI.encodeReserved = generateAccessor("reserved", "encode");
+ URI.parse = function(string, parts) {
+ var pos;
+ if (!parts) {
+ parts = {
+ preventInvalidHostname: URI.preventInvalidHostname
+ };
+ }
+ string = string.replace(URI.leading_whitespace_expression, "");
+ string = string.replace(URI.ascii_tab_whitespace, "");
+ pos = string.indexOf("#");
+ if (pos > -1) {
+ parts.fragment = string.substring(pos + 1) || null;
+ string = string.substring(0, pos);
+ }
+ pos = string.indexOf("?");
+ if (pos > -1) {
+ parts.query = string.substring(pos + 1) || null;
+ string = string.substring(0, pos);
+ }
+ string = string.replace(/^(https?|ftp|wss?)?:+[/\\]*/i, "$1://");
+ string = string.replace(/^[/\\]{2,}/i, "//");
+ if (string.substring(0, 2) === "//") {
+ parts.protocol = null;
+ string = string.substring(2);
+ string = URI.parseAuthority(string, parts);
+ } else {
+ pos = string.indexOf(":");
+ if (pos > -1) {
+ parts.protocol = string.substring(0, pos) || null;
+ if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {
+ parts.protocol = void 0;
+ } else if (string.substring(pos + 1, pos + 3).replace(/\\/g, "/") === "//") {
+ string = string.substring(pos + 3);
+ string = URI.parseAuthority(string, parts);
+ } else {
+ string = string.substring(pos + 1);
+ parts.urn = true;
+ }
+ }
+ }
+ parts.path = string;
+ return parts;
+ };
+ URI.parseHost = function(string, parts) {
+ if (!string) {
+ string = "";
+ }
+ string = string.replace(/\\/g, "/");
+ var pos = string.indexOf("/");
+ var bracketPos;
+ var t;
+ if (pos === -1) {
+ pos = string.length;
+ }
+ if (string.charAt(0) === "[") {
+ bracketPos = string.indexOf("]");
+ parts.hostname = string.substring(1, bracketPos) || null;
+ parts.port = string.substring(bracketPos + 2, pos) || null;
+ if (parts.port === "/") {
+ parts.port = null;
+ }
+ } else {
+ var firstColon = string.indexOf(":");
+ var firstSlash = string.indexOf("/");
+ var nextColon = string.indexOf(":", firstColon + 1);
+ if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) {
+ parts.hostname = string.substring(0, pos) || null;
+ parts.port = null;
+ } else {
+ t = string.substring(0, pos).split(":");
+ parts.hostname = t[0] || null;
+ parts.port = t[1] || null;
+ }
+ }
+ if (parts.hostname && string.substring(pos).charAt(0) !== "/") {
+ pos++;
+ string = "/" + string;
+ }
+ if (parts.preventInvalidHostname) {
+ URI.ensureValidHostname(parts.hostname, parts.protocol);
+ }
+ if (parts.port) {
+ URI.ensureValidPort(parts.port);
+ }
+ return string.substring(pos) || "/";
+ };
+ URI.parseAuthority = function(string, parts) {
+ string = URI.parseUserinfo(string, parts);
+ return URI.parseHost(string, parts);
+ };
+ URI.parseUserinfo = function(string, parts) {
+ var _string = string;
+ var firstBackSlash = string.indexOf("\\");
+ if (firstBackSlash !== -1) {
+ string = string.replace(/\\/g, "/");
+ }
+ var firstSlash = string.indexOf("/");
+ var pos = string.lastIndexOf("@", firstSlash > -1 ? firstSlash : string.length - 1);
+ var t;
+ if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) {
+ t = string.substring(0, pos).split(":");
+ parts.username = t[0] ? URI.decode(t[0]) : null;
+ t.shift();
+ parts.password = t[0] ? URI.decode(t.join(":")) : null;
+ string = _string.substring(pos + 1);
+ } else {
+ parts.username = null;
+ parts.password = null;
+ }
+ return string;
+ };
+ URI.parseQuery = function(string, escapeQuerySpace) {
+ if (!string) {
+ return {};
+ }
+ string = string.replace(/&+/g, "&").replace(/^\?*&*|&+$/g, "");
+ if (!string) {
+ return {};
+ }
+ var items = {};
+ var splits = string.split("&");
+ var length3 = splits.length;
+ var v7, name, value;
+ for (var i = 0; i < length3; i++) {
+ v7 = splits[i].split("=");
+ name = URI.decodeQuery(v7.shift(), escapeQuerySpace);
+ value = v7.length ? URI.decodeQuery(v7.join("="), escapeQuerySpace) : null;
+ if (name === "__proto__") {
+ continue;
+ } else if (hasOwn.call(items, name)) {
+ if (typeof items[name] === "string" || items[name] === null) {
+ items[name] = [items[name]];
+ }
+ items[name].push(value);
+ } else {
+ items[name] = value;
+ }
+ }
+ return items;
+ };
+ URI.build = function(parts) {
+ var t = "";
+ var requireAbsolutePath = false;
+ if (parts.protocol) {
+ t += parts.protocol + ":";
+ }
+ if (!parts.urn && (t || parts.hostname)) {
+ t += "//";
+ requireAbsolutePath = true;
+ }
+ t += URI.buildAuthority(parts) || "";
+ if (typeof parts.path === "string") {
+ if (parts.path.charAt(0) !== "/" && requireAbsolutePath) {
+ t += "/";
+ }
+ t += parts.path;
+ }
+ if (typeof parts.query === "string" && parts.query) {
+ t += "?" + parts.query;
+ }
+ if (typeof parts.fragment === "string" && parts.fragment) {
+ t += "#" + parts.fragment;
+ }
+ return t;
+ };
+ URI.buildHost = function(parts) {
+ var t = "";
+ if (!parts.hostname) {
+ return "";
+ } else if (URI.ip6_expression.test(parts.hostname)) {
+ t += "[" + parts.hostname + "]";
+ } else {
+ t += parts.hostname;
+ }
+ if (parts.port) {
+ t += ":" + parts.port;
+ }
+ return t;
+ };
+ URI.buildAuthority = function(parts) {
+ return URI.buildUserinfo(parts) + URI.buildHost(parts);
+ };
+ URI.buildUserinfo = function(parts) {
+ var t = "";
+ if (parts.username) {
+ t += URI.encode(parts.username);
+ }
+ if (parts.password) {
+ t += ":" + URI.encode(parts.password);
+ }
+ if (t) {
+ t += "@";
+ }
+ return t;
+ };
+ URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) {
+ var t = "";
+ var unique, key, i, length3;
+ for (key in data) {
+ if (key === "__proto__") {
+ continue;
+ } else if (hasOwn.call(data, key)) {
+ if (isArray(data[key])) {
+ unique = {};
+ for (i = 0, length3 = data[key].length; i < length3; i++) {
+ if (data[key][i] !== void 0 && unique[data[key][i] + ""] === void 0) {
+ t += "&" + URI.buildQueryParameter(key, data[key][i], escapeQuerySpace);
+ if (duplicateQueryParameters !== true) {
+ unique[data[key][i] + ""] = true;
+ }
+ }
+ }
+ } else if (data[key] !== void 0) {
+ t += "&" + URI.buildQueryParameter(key, data[key], escapeQuerySpace);
+ }
+ }
+ }
+ return t.substring(1);
+ };
+ URI.buildQueryParameter = function(name, value, escapeQuerySpace) {
+ return URI.encodeQuery(name, escapeQuerySpace) + (value !== null ? "=" + URI.encodeQuery(value, escapeQuerySpace) : "");
+ };
+ URI.addQuery = function(data, name, value) {
+ if (typeof name === "object") {
+ for (var key in name) {
+ if (hasOwn.call(name, key)) {
+ URI.addQuery(data, key, name[key]);
+ }
+ }
+ } else if (typeof name === "string") {
+ if (data[name] === void 0) {
+ data[name] = value;
+ return;
+ } else if (typeof data[name] === "string") {
+ data[name] = [data[name]];
+ }
+ if (!isArray(value)) {
+ value = [value];
+ }
+ data[name] = (data[name] || []).concat(value);
+ } else {
+ throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");
+ }
+ };
+ URI.setQuery = function(data, name, value) {
+ if (typeof name === "object") {
+ for (var key in name) {
+ if (hasOwn.call(name, key)) {
+ URI.setQuery(data, key, name[key]);
+ }
+ }
+ } else if (typeof name === "string") {
+ data[name] = value === void 0 ? null : value;
+ } else {
+ throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");
+ }
+ };
+ URI.removeQuery = function(data, name, value) {
+ var i, length3, key;
+ if (isArray(name)) {
+ for (i = 0, length3 = name.length; i < length3; i++) {
+ data[name[i]] = void 0;
+ }
+ } else if (getType(name) === "RegExp") {
+ for (key in data) {
+ if (name.test(key)) {
+ data[key] = void 0;
+ }
+ }
+ } else if (typeof name === "object") {
+ for (key in name) {
+ if (hasOwn.call(name, key)) {
+ URI.removeQuery(data, key, name[key]);
+ }
+ }
+ } else if (typeof name === "string") {
+ if (value !== void 0) {
+ if (getType(value) === "RegExp") {
+ if (!isArray(data[name]) && value.test(data[name])) {
+ data[name] = void 0;
+ } else {
+ data[name] = filterArrayValues(data[name], value);
+ }
+ } else if (data[name] === String(value) && (!isArray(value) || value.length === 1)) {
+ data[name] = void 0;
+ } else if (isArray(data[name])) {
+ data[name] = filterArrayValues(data[name], value);
+ }
+ } else {
+ data[name] = void 0;
+ }
+ } else {
+ throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");
+ }
+ };
+ URI.hasQuery = function(data, name, value, withinArray) {
+ switch (getType(name)) {
+ case "String":
+ break;
+ case "RegExp":
+ for (var key in data) {
+ if (hasOwn.call(data, key)) {
+ if (name.test(key) && (value === void 0 || URI.hasQuery(data, key, value))) {
+ return true;
+ }
+ }
+ }
+ return false;
+ case "Object":
+ for (var _key in name) {
+ if (hasOwn.call(name, _key)) {
+ if (!URI.hasQuery(data, _key, name[_key])) {
+ return false;
+ }
+ }
+ }
+ return true;
+ default:
+ throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter");
+ }
+ switch (getType(value)) {
+ case "Undefined":
+ return name in data;
+ case "Boolean":
+ var _booly = Boolean(isArray(data[name]) ? data[name].length : data[name]);
+ return value === _booly;
+ case "Function":
+ return !!value(data[name], name, data);
+ case "Array":
+ if (!isArray(data[name])) {
+ return false;
+ }
+ var op = withinArray ? arrayContains : arraysEqual;
+ return op(data[name], value);
+ case "RegExp":
+ if (!isArray(data[name])) {
+ return Boolean(data[name] && data[name].match(value));
+ }
+ if (!withinArray) {
+ return false;
+ }
+ return arrayContains(data[name], value);
+ case "Number":
+ value = String(value);
+ case "String":
+ if (!isArray(data[name])) {
+ return data[name] === value;
+ }
+ if (!withinArray) {
+ return false;
+ }
+ return arrayContains(data[name], value);
+ default:
+ throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter");
+ }
+ };
+ URI.joinPaths = function() {
+ var input = [];
+ var segments = [];
+ var nonEmptySegments = 0;
+ for (var i = 0; i < arguments.length; i++) {
+ var url2 = new URI(arguments[i]);
+ input.push(url2);
+ var _segments = url2.segment();
+ for (var s = 0; s < _segments.length; s++) {
+ if (typeof _segments[s] === "string") {
+ segments.push(_segments[s]);
+ }
+ if (_segments[s]) {
+ nonEmptySegments++;
+ }
+ }
+ }
+ if (!segments.length || !nonEmptySegments) {
+ return new URI("");
+ }
+ var uri = new URI("").segment(segments);
+ if (input[0].path() === "" || input[0].path().slice(0, 1) === "/") {
+ uri.path("/" + uri.path());
+ }
+ return uri.normalize();
+ };
+ URI.commonPath = function(one, two) {
+ var length3 = Math.min(one.length, two.length);
+ var pos;
+ for (pos = 0; pos < length3; pos++) {
+ if (one.charAt(pos) !== two.charAt(pos)) {
+ pos--;
+ break;
+ }
+ }
+ if (pos < 1) {
+ return one.charAt(0) === two.charAt(0) && one.charAt(0) === "/" ? "/" : "";
+ }
+ if (one.charAt(pos) !== "/" || two.charAt(pos) !== "/") {
+ pos = one.substring(0, pos).lastIndexOf("/");
+ }
+ return one.substring(0, pos + 1);
+ };
+ URI.withinString = function(string, callback, options) {
+ options || (options = {});
+ var _start = options.start || URI.findUri.start;
+ var _end = options.end || URI.findUri.end;
+ var _trim = options.trim || URI.findUri.trim;
+ var _parens = options.parens || URI.findUri.parens;
+ var _attributeOpen = /[a-z0-9-]=["']?$/i;
+ _start.lastIndex = 0;
+ while (true) {
+ var match = _start.exec(string);
+ if (!match) {
+ break;
+ }
+ var start = match.index;
+ if (options.ignoreHtml) {
+ var attributeOpen = string.slice(Math.max(start - 3, 0), start);
+ if (attributeOpen && _attributeOpen.test(attributeOpen)) {
+ continue;
+ }
+ }
+ var end = start + string.slice(start).search(_end);
+ var slice = string.slice(start, end);
+ var parensEnd = -1;
+ while (true) {
+ var parensMatch = _parens.exec(slice);
+ if (!parensMatch) {
+ break;
+ }
+ var parensMatchEnd = parensMatch.index + parensMatch[0].length;
+ parensEnd = Math.max(parensEnd, parensMatchEnd);
+ }
+ if (parensEnd > -1) {
+ slice = slice.slice(0, parensEnd) + slice.slice(parensEnd).replace(_trim, "");
+ } else {
+ slice = slice.replace(_trim, "");
+ }
+ if (slice.length <= match[0].length) {
+ continue;
+ }
+ if (options.ignore && options.ignore.test(slice)) {
+ continue;
+ }
+ end = start + slice.length;
+ var result = callback(slice, start, end, string);
+ if (result === void 0) {
+ _start.lastIndex = end;
+ continue;
+ }
+ result = String(result);
+ string = string.slice(0, start) + result + string.slice(end);
+ _start.lastIndex = start + result.length;
+ }
+ _start.lastIndex = 0;
+ return string;
+ };
+ URI.ensureValidHostname = function(v7, protocol) {
+ var hasHostname = !!v7;
+ var hasProtocol = !!protocol;
+ var rejectEmptyHostname = false;
+ if (hasProtocol) {
+ rejectEmptyHostname = arrayContains(URI.hostProtocols, protocol);
+ }
+ if (rejectEmptyHostname && !hasHostname) {
+ throw new TypeError("Hostname cannot be empty, if protocol is " + protocol);
+ } else if (v7 && v7.match(URI.invalid_hostname_characters)) {
+ if (!punycode) {
+ throw new TypeError('Hostname "' + v7 + '" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');
+ }
+ if (punycode.toASCII(v7).match(URI.invalid_hostname_characters)) {
+ throw new TypeError('Hostname "' + v7 + '" contains characters other than [A-Z0-9.-:_]');
+ }
+ }
+ };
+ URI.ensureValidPort = function(v7) {
+ if (!v7) {
+ return;
+ }
+ var port = Number(v7);
+ if (isInteger(port) && port > 0 && port < 65536) {
+ return;
+ }
+ throw new TypeError('Port "' + v7 + '" is not a valid port');
+ };
+ URI.noConflict = function(removeAll2) {
+ if (removeAll2) {
+ var unconflicted = {
+ URI: this.noConflict()
+ };
+ if (root.URITemplate && typeof root.URITemplate.noConflict === "function") {
+ unconflicted.URITemplate = root.URITemplate.noConflict();
+ }
+ if (root.IPv6 && typeof root.IPv6.noConflict === "function") {
+ unconflicted.IPv6 = root.IPv6.noConflict();
+ }
+ if (root.SecondLevelDomains && typeof root.SecondLevelDomains.noConflict === "function") {
+ unconflicted.SecondLevelDomains = root.SecondLevelDomains.noConflict();
+ }
+ return unconflicted;
+ } else if (root.URI === this) {
+ root.URI = _URI;
+ }
+ return this;
+ };
+ p.build = function(deferBuild) {
+ if (deferBuild === true) {
+ this._deferred_build = true;
+ } else if (deferBuild === void 0 || this._deferred_build) {
+ this._string = URI.build(this._parts);
+ this._deferred_build = false;
+ }
+ return this;
+ };
+ p.clone = function() {
+ return new URI(this);
+ };
+ p.valueOf = p.toString = function() {
+ return this.build(false)._string;
+ };
+ function generateSimpleAccessor(_part2) {
+ return function(v7, build) {
+ if (v7 === void 0) {
+ return this._parts[_part2] || "";
+ } else {
+ this._parts[_part2] = v7 || null;
+ this.build(!build);
+ return this;
+ }
+ };
+ }
+ function generatePrefixAccessor(_part2, _key) {
+ return function(v7, build) {
+ if (v7 === void 0) {
+ return this._parts[_part2] || "";
+ } else {
+ if (v7 !== null) {
+ v7 = v7 + "";
+ if (v7.charAt(0) === _key) {
+ v7 = v7.substring(1);
+ }
+ }
+ this._parts[_part2] = v7;
+ this.build(!build);
+ return this;
+ }
+ };
+ }
+ p.protocol = generateSimpleAccessor("protocol");
+ p.username = generateSimpleAccessor("username");
+ p.password = generateSimpleAccessor("password");
+ p.hostname = generateSimpleAccessor("hostname");
+ p.port = generateSimpleAccessor("port");
+ p.query = generatePrefixAccessor("query", "?");
+ p.fragment = generatePrefixAccessor("fragment", "#");
+ p.search = function(v7, build) {
+ var t = this.query(v7, build);
+ return typeof t === "string" && t.length ? "?" + t : t;
+ };
+ p.hash = function(v7, build) {
+ var t = this.fragment(v7, build);
+ return typeof t === "string" && t.length ? "#" + t : t;
+ };
+ p.pathname = function(v7, build) {
+ if (v7 === void 0 || v7 === true) {
+ var res = this._parts.path || (this._parts.hostname ? "/" : "");
+ return v7 ? (this._parts.urn ? URI.decodeUrnPath : URI.decodePath)(res) : res;
+ } else {
+ if (this._parts.urn) {
+ this._parts.path = v7 ? URI.recodeUrnPath(v7) : "";
+ } else {
+ this._parts.path = v7 ? URI.recodePath(v7) : "/";
+ }
+ this.build(!build);
+ return this;
+ }
+ };
+ p.path = p.pathname;
+ p.href = function(href, build) {
+ var key;
+ if (href === void 0) {
+ return this.toString();
+ }
+ this._string = "";
+ this._parts = URI._parts();
+ var _URI2 = href instanceof URI;
+ var _object = typeof href === "object" && (href.hostname || href.path || href.pathname);
+ if (href.nodeName) {
+ var attribute = URI.getDomAttribute(href);
+ href = href[attribute] || "";
+ _object = false;
+ }
+ if (!_URI2 && _object && href.pathname !== void 0) {
+ href = href.toString();
+ }
+ if (typeof href === "string" || href instanceof String) {
+ this._parts = URI.parse(String(href), this._parts);
+ } else if (_URI2 || _object) {
+ var src = _URI2 ? href._parts : href;
+ for (key in src) {
+ if (key === "query") {
+ continue;
+ }
+ if (hasOwn.call(this._parts, key)) {
+ this._parts[key] = src[key];
+ }
+ }
+ if (src.query) {
+ this.query(src.query, false);
+ }
+ } else {
+ throw new TypeError("invalid input");
+ }
+ this.build(!build);
+ return this;
+ };
+ p.is = function(what) {
+ var ip = false;
+ var ip4 = false;
+ var ip6 = false;
+ var name = false;
+ var sld = false;
+ var idn = false;
+ var punycode2 = false;
+ var relative = !this._parts.urn;
+ if (this._parts.hostname) {
+ relative = false;
+ ip4 = URI.ip4_expression.test(this._parts.hostname);
+ ip6 = URI.ip6_expression.test(this._parts.hostname);
+ ip = ip4 || ip6;
+ name = !ip;
+ sld = name && SLD && SLD.has(this._parts.hostname);
+ idn = name && URI.idn_expression.test(this._parts.hostname);
+ punycode2 = name && URI.punycode_expression.test(this._parts.hostname);
+ }
+ switch (what.toLowerCase()) {
+ case "relative":
+ return relative;
+ case "absolute":
+ return !relative;
+ case "domain":
+ case "name":
+ return name;
+ case "sld":
+ return sld;
+ case "ip":
+ return ip;
+ case "ip4":
+ case "ipv4":
+ case "inet4":
+ return ip4;
+ case "ip6":
+ case "ipv6":
+ case "inet6":
+ return ip6;
+ case "idn":
+ return idn;
+ case "url":
+ return !this._parts.urn;
+ case "urn":
+ return !!this._parts.urn;
+ case "punycode":
+ return punycode2;
+ }
+ return null;
+ };
+ var _protocol = p.protocol;
+ var _port = p.port;
+ var _hostname = p.hostname;
+ p.protocol = function(v7, build) {
+ if (v7) {
+ v7 = v7.replace(/:(\/\/)?$/, "");
+ if (!v7.match(URI.protocol_expression)) {
+ throw new TypeError('Protocol "' + v7 + `" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);
+ }
+ }
+ return _protocol.call(this, v7, build);
+ };
+ p.scheme = p.protocol;
+ p.port = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (v7 !== void 0) {
+ if (v7 === 0) {
+ v7 = null;
+ }
+ if (v7) {
+ v7 += "";
+ if (v7.charAt(0) === ":") {
+ v7 = v7.substring(1);
+ }
+ URI.ensureValidPort(v7);
+ }
+ }
+ return _port.call(this, v7, build);
+ };
+ p.hostname = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (v7 !== void 0) {
+ var x = { preventInvalidHostname: this._parts.preventInvalidHostname };
+ var res = URI.parseHost(v7, x);
+ if (res !== "/") {
+ throw new TypeError('Hostname "' + v7 + '" contains characters other than [A-Z0-9.-]');
+ }
+ v7 = x.hostname;
+ if (this._parts.preventInvalidHostname) {
+ URI.ensureValidHostname(v7, this._parts.protocol);
+ }
+ }
+ return _hostname.call(this, v7, build);
+ };
+ p.origin = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (v7 === void 0) {
+ var protocol = this.protocol();
+ var authority = this.authority();
+ if (!authority) {
+ return "";
+ }
+ return (protocol ? protocol + "://" : "") + this.authority();
+ } else {
+ var origin = URI(v7);
+ this.protocol(origin.protocol()).authority(origin.authority()).build(!build);
+ return this;
+ }
+ };
+ p.host = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (v7 === void 0) {
+ return this._parts.hostname ? URI.buildHost(this._parts) : "";
+ } else {
+ var res = URI.parseHost(v7, this._parts);
+ if (res !== "/") {
+ throw new TypeError('Hostname "' + v7 + '" contains characters other than [A-Z0-9.-]');
+ }
+ this.build(!build);
+ return this;
+ }
+ };
+ p.authority = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (v7 === void 0) {
+ return this._parts.hostname ? URI.buildAuthority(this._parts) : "";
+ } else {
+ var res = URI.parseAuthority(v7, this._parts);
+ if (res !== "/") {
+ throw new TypeError('Hostname "' + v7 + '" contains characters other than [A-Z0-9.-]');
+ }
+ this.build(!build);
+ return this;
+ }
+ };
+ p.userinfo = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (v7 === void 0) {
+ var t = URI.buildUserinfo(this._parts);
+ return t ? t.substring(0, t.length - 1) : t;
+ } else {
+ if (v7[v7.length - 1] !== "@") {
+ v7 += "@";
+ }
+ URI.parseUserinfo(v7, this._parts);
+ this.build(!build);
+ return this;
+ }
+ };
+ p.resource = function(v7, build) {
+ var parts;
+ if (v7 === void 0) {
+ return this.path() + this.search() + this.hash();
+ }
+ parts = URI.parse(v7);
+ this._parts.path = parts.path;
+ this._parts.query = parts.query;
+ this._parts.fragment = parts.fragment;
+ this.build(!build);
+ return this;
+ };
+ p.subdomain = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (v7 === void 0) {
+ if (!this._parts.hostname || this.is("IP")) {
+ return "";
+ }
+ var end = this._parts.hostname.length - this.domain().length - 1;
+ return this._parts.hostname.substring(0, end) || "";
+ } else {
+ var e = this._parts.hostname.length - this.domain().length;
+ var sub = this._parts.hostname.substring(0, e);
+ var replace = new RegExp("^" + escapeRegEx(sub));
+ if (v7 && v7.charAt(v7.length - 1) !== ".") {
+ v7 += ".";
+ }
+ if (v7.indexOf(":") !== -1) {
+ throw new TypeError("Domains cannot contain colons");
+ }
+ if (v7) {
+ URI.ensureValidHostname(v7, this._parts.protocol);
+ }
+ this._parts.hostname = this._parts.hostname.replace(replace, v7);
+ this.build(!build);
+ return this;
+ }
+ };
+ p.domain = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (typeof v7 === "boolean") {
+ build = v7;
+ v7 = void 0;
+ }
+ if (v7 === void 0) {
+ if (!this._parts.hostname || this.is("IP")) {
+ return "";
+ }
+ var t = this._parts.hostname.match(/\./g);
+ if (t && t.length < 2) {
+ return this._parts.hostname;
+ }
+ var end = this._parts.hostname.length - this.tld(build).length - 1;
+ end = this._parts.hostname.lastIndexOf(".", end - 1) + 1;
+ return this._parts.hostname.substring(end) || "";
+ } else {
+ if (!v7) {
+ throw new TypeError("cannot set domain empty");
+ }
+ if (v7.indexOf(":") !== -1) {
+ throw new TypeError("Domains cannot contain colons");
+ }
+ URI.ensureValidHostname(v7, this._parts.protocol);
+ if (!this._parts.hostname || this.is("IP")) {
+ this._parts.hostname = v7;
+ } else {
+ var replace = new RegExp(escapeRegEx(this.domain()) + "$");
+ this._parts.hostname = this._parts.hostname.replace(replace, v7);
+ }
+ this.build(!build);
+ return this;
+ }
+ };
+ p.tld = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (typeof v7 === "boolean") {
+ build = v7;
+ v7 = void 0;
+ }
+ if (v7 === void 0) {
+ if (!this._parts.hostname || this.is("IP")) {
+ return "";
+ }
+ var pos = this._parts.hostname.lastIndexOf(".");
+ var tld = this._parts.hostname.substring(pos + 1);
+ if (build !== true && SLD && SLD.list[tld.toLowerCase()]) {
+ return SLD.get(this._parts.hostname) || tld;
+ }
+ return tld;
+ } else {
+ var replace;
+ if (!v7) {
+ throw new TypeError("cannot set TLD empty");
+ } else if (v7.match(/[^a-zA-Z0-9-]/)) {
+ if (SLD && SLD.is(v7)) {
+ replace = new RegExp(escapeRegEx(this.tld()) + "$");
+ this._parts.hostname = this._parts.hostname.replace(replace, v7);
+ } else {
+ throw new TypeError('TLD "' + v7 + '" contains characters other than [A-Z0-9]');
+ }
+ } else if (!this._parts.hostname || this.is("IP")) {
+ throw new ReferenceError("cannot set TLD on non-domain host");
+ } else {
+ replace = new RegExp(escapeRegEx(this.tld()) + "$");
+ this._parts.hostname = this._parts.hostname.replace(replace, v7);
+ }
+ this.build(!build);
+ return this;
+ }
+ };
+ p.directory = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (v7 === void 0 || v7 === true) {
+ if (!this._parts.path && !this._parts.hostname) {
+ return "";
+ }
+ if (this._parts.path === "/") {
+ return "/";
+ }
+ var end = this._parts.path.length - this.filename().length - 1;
+ var res = this._parts.path.substring(0, end) || (this._parts.hostname ? "/" : "");
+ return v7 ? URI.decodePath(res) : res;
+ } else {
+ var e = this._parts.path.length - this.filename().length;
+ var directory = this._parts.path.substring(0, e);
+ var replace = new RegExp("^" + escapeRegEx(directory));
+ if (!this.is("relative")) {
+ if (!v7) {
+ v7 = "/";
+ }
+ if (v7.charAt(0) !== "/") {
+ v7 = "/" + v7;
+ }
+ }
+ if (v7 && v7.charAt(v7.length - 1) !== "/") {
+ v7 += "/";
+ }
+ v7 = URI.recodePath(v7);
+ this._parts.path = this._parts.path.replace(replace, v7);
+ this.build(!build);
+ return this;
+ }
+ };
+ p.filename = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (typeof v7 !== "string") {
+ if (!this._parts.path || this._parts.path === "/") {
+ return "";
+ }
+ var pos = this._parts.path.lastIndexOf("/");
+ var res = this._parts.path.substring(pos + 1);
+ return v7 ? URI.decodePathSegment(res) : res;
+ } else {
+ var mutatedDirectory = false;
+ if (v7.charAt(0) === "/") {
+ v7 = v7.substring(1);
+ }
+ if (v7.match(/\.?\//)) {
+ mutatedDirectory = true;
+ }
+ var replace = new RegExp(escapeRegEx(this.filename()) + "$");
+ v7 = URI.recodePath(v7);
+ this._parts.path = this._parts.path.replace(replace, v7);
+ if (mutatedDirectory) {
+ this.normalizePath(build);
+ } else {
+ this.build(!build);
+ }
+ return this;
+ }
+ };
+ p.suffix = function(v7, build) {
+ if (this._parts.urn) {
+ return v7 === void 0 ? "" : this;
+ }
+ if (v7 === void 0 || v7 === true) {
+ if (!this._parts.path || this._parts.path === "/") {
+ return "";
+ }
+ var filename = this.filename();
+ var pos = filename.lastIndexOf(".");
+ var s, res;
+ if (pos === -1) {
+ return "";
+ }
+ s = filename.substring(pos + 1);
+ res = /^[a-z0-9%]+$/i.test(s) ? s : "";
+ return v7 ? URI.decodePathSegment(res) : res;
+ } else {
+ if (v7.charAt(0) === ".") {
+ v7 = v7.substring(1);
+ }
+ var suffix = this.suffix();
+ var replace;
+ if (!suffix) {
+ if (!v7) {
+ return this;
+ }
+ this._parts.path += "." + URI.recodePath(v7);
+ } else if (!v7) {
+ replace = new RegExp(escapeRegEx("." + suffix) + "$");
+ } else {
+ replace = new RegExp(escapeRegEx(suffix) + "$");
+ }
+ if (replace) {
+ v7 = URI.recodePath(v7);
+ this._parts.path = this._parts.path.replace(replace, v7);
+ }
+ this.build(!build);
+ return this;
+ }
+ };
+ p.segment = function(segment, v7, build) {
+ var separator = this._parts.urn ? ":" : "/";
+ var path = this.path();
+ var absolute = path.substring(0, 1) === "/";
+ var segments = path.split(separator);
+ if (segment !== void 0 && typeof segment !== "number") {
+ build = v7;
+ v7 = segment;
+ segment = void 0;
+ }
+ if (segment !== void 0 && typeof segment !== "number") {
+ throw new Error('Bad segment "' + segment + '", must be 0-based integer');
+ }
+ if (absolute) {
+ segments.shift();
+ }
+ if (segment < 0) {
+ segment = Math.max(segments.length + segment, 0);
+ }
+ if (v7 === void 0) {
+ return segment === void 0 ? segments : segments[segment];
+ } else if (segment === null || segments[segment] === void 0) {
+ if (isArray(v7)) {
+ segments = [];
+ for (var i = 0, l = v7.length; i < l; i++) {
+ if (!v7[i].length && (!segments.length || !segments[segments.length - 1].length)) {
+ continue;
+ }
+ if (segments.length && !segments[segments.length - 1].length) {
+ segments.pop();
+ }
+ segments.push(trimSlashes(v7[i]));
+ }
+ } else if (v7 || typeof v7 === "string") {
+ v7 = trimSlashes(v7);
+ if (segments[segments.length - 1] === "") {
+ segments[segments.length - 1] = v7;
+ } else {
+ segments.push(v7);
+ }
+ }
+ } else {
+ if (v7) {
+ segments[segment] = trimSlashes(v7);
+ } else {
+ segments.splice(segment, 1);
+ }
+ }
+ if (absolute) {
+ segments.unshift("");
+ }
+ return this.path(segments.join(separator), build);
+ };
+ p.segmentCoded = function(segment, v7, build) {
+ var segments, i, l;
+ if (typeof segment !== "number") {
+ build = v7;
+ v7 = segment;
+ segment = void 0;
+ }
+ if (v7 === void 0) {
+ segments = this.segment(segment, v7, build);
+ if (!isArray(segments)) {
+ segments = segments !== void 0 ? URI.decode(segments) : void 0;
+ } else {
+ for (i = 0, l = segments.length; i < l; i++) {
+ segments[i] = URI.decode(segments[i]);
+ }
+ }
+ return segments;
+ }
+ if (!isArray(v7)) {
+ v7 = typeof v7 === "string" || v7 instanceof String ? URI.encode(v7) : v7;
+ } else {
+ for (i = 0, l = v7.length; i < l; i++) {
+ v7[i] = URI.encode(v7[i]);
+ }
+ }
+ return this.segment(segment, v7, build);
+ };
+ var q = p.query;
+ p.query = function(v7, build) {
+ if (v7 === true) {
+ return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ } else if (typeof v7 === "function") {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ var result = v7.call(this, data);
+ this._parts.query = URI.buildQuery(result || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ this.build(!build);
+ return this;
+ } else if (v7 !== void 0 && typeof v7 !== "string") {
+ this._parts.query = URI.buildQuery(v7, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ this.build(!build);
+ return this;
+ } else {
+ return q.call(this, v7, build);
+ }
+ };
+ p.setQuery = function(name, value, build) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ if (typeof name === "string" || name instanceof String) {
+ data[name] = value !== void 0 ? value : null;
+ } else if (typeof name === "object") {
+ for (var key in name) {
+ if (hasOwn.call(name, key)) {
+ data[key] = name[key];
+ }
+ }
+ } else {
+ throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");
+ }
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ if (typeof name !== "string") {
+ build = value;
+ }
+ this.build(!build);
+ return this;
+ };
+ p.addQuery = function(name, value, build) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ URI.addQuery(data, name, value === void 0 ? null : value);
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ if (typeof name !== "string") {
+ build = value;
+ }
+ this.build(!build);
+ return this;
+ };
+ p.removeQuery = function(name, value, build) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ URI.removeQuery(data, name, value);
+ this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
+ if (typeof name !== "string") {
+ build = value;
+ }
+ this.build(!build);
+ return this;
+ };
+ p.hasQuery = function(name, value, withinArray) {
+ var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
+ return URI.hasQuery(data, name, value, withinArray);
+ };
+ p.setSearch = p.setQuery;
+ p.addSearch = p.addQuery;
+ p.removeSearch = p.removeQuery;
+ p.hasSearch = p.hasQuery;
+ p.normalize = function() {
+ if (this._parts.urn) {
+ return this.normalizeProtocol(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build();
+ }
+ return this.normalizeProtocol(false).normalizeHostname(false).normalizePort(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build();
+ };
+ p.normalizeProtocol = function(build) {
+ if (typeof this._parts.protocol === "string") {
+ this._parts.protocol = this._parts.protocol.toLowerCase();
+ this.build(!build);
+ }
+ return this;
+ };
+ p.normalizeHostname = function(build) {
+ if (this._parts.hostname) {
+ if (this.is("IDN") && punycode) {
+ this._parts.hostname = punycode.toASCII(this._parts.hostname);
+ } else if (this.is("IPv6") && IPv6) {
+ this._parts.hostname = IPv6.best(this._parts.hostname);
+ }
+ this._parts.hostname = this._parts.hostname.toLowerCase();
+ this.build(!build);
+ }
+ return this;
+ };
+ p.normalizePort = function(build) {
+ if (typeof this._parts.protocol === "string" && this._parts.port === URI.defaultPorts[this._parts.protocol]) {
+ this._parts.port = null;
+ this.build(!build);
+ }
+ return this;
+ };
+ p.normalizePath = function(build) {
+ var _path = this._parts.path;
+ if (!_path) {
+ return this;
+ }
+ if (this._parts.urn) {
+ this._parts.path = URI.recodeUrnPath(this._parts.path);
+ this.build(!build);
+ return this;
+ }
+ if (this._parts.path === "/") {
+ return this;
+ }
+ _path = URI.recodePath(_path);
+ var _was_relative;
+ var _leadingParents = "";
+ var _parent, _pos;
+ if (_path.charAt(0) !== "/") {
+ _was_relative = true;
+ _path = "/" + _path;
+ }
+ if (_path.slice(-3) === "/.." || _path.slice(-2) === "/.") {
+ _path += "/";
+ }
+ _path = _path.replace(/(\/(\.\/)+)|(\/\.$)/g, "/").replace(/\/{2,}/g, "/");
+ if (_was_relative) {
+ _leadingParents = _path.substring(1).match(/^(\.\.\/)+/) || "";
+ if (_leadingParents) {
+ _leadingParents = _leadingParents[0];
+ }
+ }
+ while (true) {
+ _parent = _path.search(/\/\.\.(\/|$)/);
+ if (_parent === -1) {
+ break;
+ } else if (_parent === 0) {
+ _path = _path.substring(3);
+ continue;
+ }
+ _pos = _path.substring(0, _parent).lastIndexOf("/");
+ if (_pos === -1) {
+ _pos = _parent;
+ }
+ _path = _path.substring(0, _pos) + _path.substring(_parent + 3);
+ }
+ if (_was_relative && this.is("relative")) {
+ _path = _leadingParents + _path.substring(1);
+ }
+ this._parts.path = _path;
+ this.build(!build);
+ return this;
+ };
+ p.normalizePathname = p.normalizePath;
+ p.normalizeQuery = function(build) {
+ if (typeof this._parts.query === "string") {
+ if (!this._parts.query.length) {
+ this._parts.query = null;
+ } else {
+ this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace));
+ }
+ this.build(!build);
+ }
+ return this;
+ };
+ p.normalizeFragment = function(build) {
+ if (!this._parts.fragment) {
+ this._parts.fragment = null;
+ this.build(!build);
+ }
+ return this;
+ };
+ p.normalizeSearch = p.normalizeQuery;
+ p.normalizeHash = p.normalizeFragment;
+ p.iso8859 = function() {
+ var e = URI.encode;
+ var d = URI.decode;
+ URI.encode = escape;
+ URI.decode = decodeURIComponent;
+ try {
+ this.normalize();
+ } finally {
+ URI.encode = e;
+ URI.decode = d;
+ }
+ return this;
+ };
+ p.unicode = function() {
+ var e = URI.encode;
+ var d = URI.decode;
+ URI.encode = strictEncodeURIComponent;
+ URI.decode = unescape;
+ try {
+ this.normalize();
+ } finally {
+ URI.encode = e;
+ URI.decode = d;
+ }
+ return this;
+ };
+ p.readable = function() {
+ var uri = this.clone();
+ uri.username("").password("").normalize();
+ var t = "";
+ if (uri._parts.protocol) {
+ t += uri._parts.protocol + "://";
+ }
+ if (uri._parts.hostname) {
+ if (uri.is("punycode") && punycode) {
+ t += punycode.toUnicode(uri._parts.hostname);
+ if (uri._parts.port) {
+ t += ":" + uri._parts.port;
+ }
+ } else {
+ t += uri.host();
+ }
+ }
+ if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== "/") {
+ t += "/";
+ }
+ t += uri.path(true);
+ if (uri._parts.query) {
+ var q3 = "";
+ for (var i = 0, qp = uri._parts.query.split("&"), l = qp.length; i < l; i++) {
+ var kv = (qp[i] || "").split("=");
+ q3 += "&" + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace).replace(/&/g, "%26");
+ if (kv[1] !== void 0) {
+ q3 += "=" + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace).replace(/&/g, "%26");
+ }
+ }
+ t += "?" + q3.substring(1);
+ }
+ t += URI.decodeQuery(uri.hash(), true);
+ return t;
+ };
+ p.absoluteTo = function(base) {
+ var resolved = this.clone();
+ var properties = ["protocol", "username", "password", "hostname", "port"];
+ var basedir, i, p2;
+ if (this._parts.urn) {
+ throw new Error("URNs do not have any generally defined hierarchical components");
+ }
+ if (!(base instanceof URI)) {
+ base = new URI(base);
+ }
+ if (resolved._parts.protocol) {
+ return resolved;
+ } else {
+ resolved._parts.protocol = base._parts.protocol;
+ }
+ if (this._parts.hostname) {
+ return resolved;
+ }
+ for (i = 0; p2 = properties[i]; i++) {
+ resolved._parts[p2] = base._parts[p2];
+ }
+ if (!resolved._parts.path) {
+ resolved._parts.path = base._parts.path;
+ if (!resolved._parts.query) {
+ resolved._parts.query = base._parts.query;
+ }
+ } else {
+ if (resolved._parts.path.substring(-2) === "..") {
+ resolved._parts.path += "/";
+ }
+ if (resolved.path().charAt(0) !== "/") {
+ basedir = base.directory();
+ basedir = basedir ? basedir : base.path().indexOf("/") === 0 ? "/" : "";
+ resolved._parts.path = (basedir ? basedir + "/" : "") + resolved._parts.path;
+ resolved.normalizePath();
+ }
+ }
+ resolved.build();
+ return resolved;
+ };
+ p.relativeTo = function(base) {
+ var relative = this.clone().normalize();
+ var relativeParts, baseParts, common, relativePath, basePath;
+ if (relative._parts.urn) {
+ throw new Error("URNs do not have any generally defined hierarchical components");
+ }
+ base = new URI(base).normalize();
+ relativeParts = relative._parts;
+ baseParts = base._parts;
+ relativePath = relative.path();
+ basePath = base.path();
+ if (relativePath.charAt(0) !== "/") {
+ throw new Error("URI is already relative");
+ }
+ if (basePath.charAt(0) !== "/") {
+ throw new Error("Cannot calculate a URI relative to another relative URI");
+ }
+ if (relativeParts.protocol === baseParts.protocol) {
+ relativeParts.protocol = null;
+ }
+ if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) {
+ return relative.build();
+ }
+ if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) {
+ return relative.build();
+ }
+ if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) {
+ relativeParts.hostname = null;
+ relativeParts.port = null;
+ } else {
+ return relative.build();
+ }
+ if (relativePath === basePath) {
+ relativeParts.path = "";
+ return relative.build();
+ }
+ common = URI.commonPath(relativePath, basePath);
+ if (!common) {
+ return relative.build();
+ }
+ var parents = baseParts.path.substring(common.length).replace(/[^\/]*$/, "").replace(/.*?\//g, "../");
+ relativeParts.path = parents + relativeParts.path.substring(common.length) || "./";
+ return relative.build();
+ };
+ p.equals = function(uri) {
+ var one = this.clone();
+ var two = new URI(uri);
+ var one_map = {};
+ var two_map = {};
+ var checked = {};
+ var one_query, two_query, key;
+ one.normalize();
+ two.normalize();
+ if (one.toString() === two.toString()) {
+ return true;
+ }
+ one_query = one.query();
+ two_query = two.query();
+ one.query("");
+ two.query("");
+ if (one.toString() !== two.toString()) {
+ return false;
+ }
+ if (one_query.length !== two_query.length) {
+ return false;
+ }
+ one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace);
+ two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace);
+ for (key in one_map) {
+ if (hasOwn.call(one_map, key)) {
+ if (!isArray(one_map[key])) {
+ if (one_map[key] !== two_map[key]) {
+ return false;
+ }
+ } else if (!arraysEqual(one_map[key], two_map[key])) {
+ return false;
+ }
+ checked[key] = true;
+ }
+ }
+ for (key in two_map) {
+ if (hasOwn.call(two_map, key)) {
+ if (!checked[key]) {
+ return false;
+ }
+ }
+ }
+ return true;
+ };
+ p.preventInvalidHostname = function(v7) {
+ this._parts.preventInvalidHostname = !!v7;
+ return this;
+ };
+ p.duplicateQueryParameters = function(v7) {
+ this._parts.duplicateQueryParameters = !!v7;
+ return this;
+ };
+ p.escapeQuerySpace = function(v7) {
+ this._parts.escapeQuerySpace = !!v7;
+ return this;
+ };
+ return URI;
+ });
+ }
+});
+
+// node_modules/dompurify/dist/purify.js
+var require_purify = __commonJS({
+ "node_modules/dompurify/dist/purify.js"(exports2, module2) {
+ /*! @license DOMPurify 2.4.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.5/LICENSE */
+ (function(global2, factory) {
+ typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.DOMPurify = factory());
+ })(exports2, function() {
+ "use strict";
+ function _typeof(obj) {
+ "@babel/helpers - typeof";
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
+ return typeof obj2;
+ } : function(obj2) {
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
+ }, _typeof(obj);
+ }
+ function _setPrototypeOf(o, p) {
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
+ o2.__proto__ = p2;
+ return o2;
+ };
+ return _setPrototypeOf(o, p);
+ }
+ function _isNativeReflectConstruct() {
+ if (typeof Reflect === "undefined" || !Reflect.construct)
+ return false;
+ if (Reflect.construct.sham)
+ return false;
+ if (typeof Proxy === "function")
+ return true;
+ try {
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
+ }));
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }
+ function _construct(Parent, args, Class) {
+ if (_isNativeReflectConstruct()) {
+ _construct = Reflect.construct;
+ } else {
+ _construct = function _construct2(Parent2, args2, Class2) {
+ var a3 = [null];
+ a3.push.apply(a3, args2);
+ var Constructor = Function.bind.apply(Parent2, a3);
+ var instance = new Constructor();
+ if (Class2)
+ _setPrototypeOf(instance, Class2.prototype);
+ return instance;
+ };
+ }
+ return _construct.apply(null, arguments);
+ }
+ function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+ }
+ function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr))
+ return _arrayLikeToArray(arr);
+ }
+ function _iterableToArray(iter) {
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
+ return Array.from(iter);
+ }
+ function _unsupportedIterableToArray(o, minLen) {
+ if (!o)
+ return;
+ if (typeof o === "string")
+ return _arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor)
+ n = o.constructor.name;
+ if (n === "Map" || n === "Set")
+ return Array.from(o);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
+ return _arrayLikeToArray(o, minLen);
+ }
+ function _arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length)
+ len = arr.length;
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
+ arr2[i] = arr[i];
+ return arr2;
+ }
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+ var hasOwnProperty = Object.hasOwnProperty, setPrototypeOf = Object.setPrototypeOf, isFrozen = Object.isFrozen, getPrototypeOf = Object.getPrototypeOf, getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
+ var freeze = Object.freeze, seal = Object.seal, create = Object.create;
+ var _ref = typeof Reflect !== "undefined" && Reflect, apply = _ref.apply, construct = _ref.construct;
+ if (!apply) {
+ apply = function apply2(fun, thisValue, args) {
+ return fun.apply(thisValue, args);
+ };
+ }
+ if (!freeze) {
+ freeze = function freeze2(x) {
+ return x;
+ };
+ }
+ if (!seal) {
+ seal = function seal2(x) {
+ return x;
+ };
+ }
+ if (!construct) {
+ construct = function construct2(Func, args) {
+ return _construct(Func, _toConsumableArray(args));
+ };
+ }
+ var arrayForEach = unapply(Array.prototype.forEach);
+ var arrayPop = unapply(Array.prototype.pop);
+ var arrayPush = unapply(Array.prototype.push);
+ var stringToLowerCase = unapply(String.prototype.toLowerCase);
+ var stringToString = unapply(String.prototype.toString);
+ var stringMatch = unapply(String.prototype.match);
+ var stringReplace = unapply(String.prototype.replace);
+ var stringIndexOf = unapply(String.prototype.indexOf);
+ var stringTrim = unapply(String.prototype.trim);
+ var regExpTest = unapply(RegExp.prototype.test);
+ var typeErrorCreate = unconstruct(TypeError);
+ function unapply(func) {
+ return function(thisArg) {
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
+ args[_key - 1] = arguments[_key];
+ }
+ return apply(func, thisArg, args);
+ };
+ }
+ function unconstruct(func) {
+ return function() {
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
+ args[_key2] = arguments[_key2];
+ }
+ return construct(func, args);
+ };
+ }
+ function addToSet(set2, array, transformCaseFunc) {
+ transformCaseFunc = transformCaseFunc ? transformCaseFunc : stringToLowerCase;
+ if (setPrototypeOf) {
+ setPrototypeOf(set2, null);
+ }
+ var l = array.length;
+ while (l--) {
+ var element = array[l];
+ if (typeof element === "string") {
+ var lcElement = transformCaseFunc(element);
+ if (lcElement !== element) {
+ if (!isFrozen(array)) {
+ array[l] = lcElement;
+ }
+ element = lcElement;
+ }
+ }
+ set2[element] = true;
+ }
+ return set2;
+ }
+ function clone2(object2) {
+ var newObject = create(null);
+ var property;
+ for (property in object2) {
+ if (apply(hasOwnProperty, object2, [property]) === true) {
+ newObject[property] = object2[property];
+ }
+ }
+ return newObject;
+ }
+ function lookupGetter(object2, prop) {
+ while (object2 !== null) {
+ var desc = getOwnPropertyDescriptor(object2, prop);
+ if (desc) {
+ if (desc.get) {
+ return unapply(desc.get);
+ }
+ if (typeof desc.value === "function") {
+ return unapply(desc.value);
+ }
+ }
+ object2 = getPrototypeOf(object2);
+ }
+ function fallbackValue(element) {
+ console.warn("fallback value for", element);
+ return null;
+ }
+ return fallbackValue;
+ }
+ var html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
+ var svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
+ var svgFilters = freeze(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
+ var svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "fedropshadow", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
+ var mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover"]);
+ var mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
+ var text = freeze(["#text"]);
+ var html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]);
+ var svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
+ var mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
+ var xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
+ var MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
+ var ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
+ var TMPLIT_EXPR = seal(/\${[\w\W]*}/gm);
+ var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/);
+ var ARIA_ATTR = seal(/^aria-[\-\w]+$/);
+ var IS_ALLOWED_URI = seal(
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
+ );
+ var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
+ var ATTR_WHITESPACE = seal(
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
+ );
+ var DOCTYPE_NAME = seal(/^html$/i);
+ var getGlobal = function getGlobal2() {
+ return typeof window === "undefined" ? null : window;
+ };
+ var _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, document2) {
+ if (_typeof(trustedTypes) !== "object" || typeof trustedTypes.createPolicy !== "function") {
+ return null;
+ }
+ var suffix = null;
+ var ATTR_NAME = "data-tt-policy-suffix";
+ if (document2.currentScript && document2.currentScript.hasAttribute(ATTR_NAME)) {
+ suffix = document2.currentScript.getAttribute(ATTR_NAME);
+ }
+ var policyName = "dompurify" + (suffix ? "#" + suffix : "");
+ try {
+ return trustedTypes.createPolicy(policyName, {
+ createHTML: function createHTML(html2) {
+ return html2;
+ },
+ createScriptURL: function createScriptURL(scriptUrl) {
+ return scriptUrl;
+ }
+ });
+ } catch (_) {
+ console.warn("TrustedTypes policy " + policyName + " could not be created.");
+ return null;
+ }
+ };
+ function createDOMPurify() {
+ var window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
+ var DOMPurify2 = function DOMPurify3(root) {
+ return createDOMPurify(root);
+ };
+ DOMPurify2.version = "2.4.5";
+ DOMPurify2.removed = [];
+ if (!window2 || !window2.document || window2.document.nodeType !== 9) {
+ DOMPurify2.isSupported = false;
+ return DOMPurify2;
+ }
+ var originalDocument = window2.document;
+ var document2 = window2.document;
+ var DocumentFragment2 = window2.DocumentFragment, HTMLTemplateElement = window2.HTMLTemplateElement, Node6 = window2.Node, Element2 = window2.Element, NodeFilter = window2.NodeFilter, _window$NamedNodeMap = window2.NamedNodeMap, NamedNodeMap = _window$NamedNodeMap === void 0 ? window2.NamedNodeMap || window2.MozNamedAttrMap : _window$NamedNodeMap, HTMLFormElement = window2.HTMLFormElement, DOMParser2 = window2.DOMParser, trustedTypes = window2.trustedTypes;
+ var ElementPrototype = Element2.prototype;
+ var cloneNode = lookupGetter(ElementPrototype, "cloneNode");
+ var getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
+ var getChildNodes = lookupGetter(ElementPrototype, "childNodes");
+ var getParentNode = lookupGetter(ElementPrototype, "parentNode");
+ if (typeof HTMLTemplateElement === "function") {
+ var template = document2.createElement("template");
+ if (template.content && template.content.ownerDocument) {
+ document2 = template.content.ownerDocument;
+ }
+ }
+ var trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, originalDocument);
+ var emptyHTML = trustedTypesPolicy ? trustedTypesPolicy.createHTML("") : "";
+ var _document = document2, implementation2 = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName = _document.getElementsByTagName;
+ var importNode = originalDocument.importNode;
+ var documentMode = {};
+ try {
+ documentMode = clone2(document2).documentMode ? document2.documentMode : {};
+ } catch (_) {
+ }
+ var hooks = {};
+ DOMPurify2.isSupported = typeof getParentNode === "function" && implementation2 && typeof implementation2.createHTMLDocument !== "undefined" && documentMode !== 9;
+ var MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE;
+ var IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
+ var ALLOWED_TAGS = null;
+ var DEFAULT_ALLOWED_TAGS = addToSet({}, [].concat(_toConsumableArray(html$1), _toConsumableArray(svg$1), _toConsumableArray(svgFilters), _toConsumableArray(mathMl$1), _toConsumableArray(text)));
+ var ALLOWED_ATTR = null;
+ var DEFAULT_ALLOWED_ATTR = addToSet({}, [].concat(_toConsumableArray(html), _toConsumableArray(svg), _toConsumableArray(mathMl), _toConsumableArray(xml)));
+ var CUSTOM_ELEMENT_HANDLING = Object.seal(Object.create(null, {
+ tagNameCheck: {
+ writable: true,
+ configurable: false,
+ enumerable: true,
+ value: null
+ },
+ attributeNameCheck: {
+ writable: true,
+ configurable: false,
+ enumerable: true,
+ value: null
+ },
+ allowCustomizedBuiltInElements: {
+ writable: true,
+ configurable: false,
+ enumerable: true,
+ value: false
+ }
+ }));
+ var FORBID_TAGS = null;
+ var FORBID_ATTR = null;
+ var ALLOW_ARIA_ATTR = true;
+ var ALLOW_DATA_ATTR = true;
+ var ALLOW_UNKNOWN_PROTOCOLS = false;
+ var ALLOW_SELF_CLOSE_IN_ATTR = true;
+ var SAFE_FOR_TEMPLATES = false;
+ var WHOLE_DOCUMENT = false;
+ var SET_CONFIG = false;
+ var FORCE_BODY = false;
+ var RETURN_DOM = false;
+ var RETURN_DOM_FRAGMENT = false;
+ var RETURN_TRUSTED_TYPE = false;
+ var SANITIZE_DOM = true;
+ var SANITIZE_NAMED_PROPS = false;
+ var SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
+ var KEEP_CONTENT = true;
+ var IN_PLACE = false;
+ var USE_PROFILES = {};
+ var FORBID_CONTENTS = null;
+ var DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
+ var DATA_URI_TAGS = null;
+ var DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
+ var URI_SAFE_ATTRIBUTES = null;
+ var DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
+ var MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
+ var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
+ var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
+ var NAMESPACE = HTML_NAMESPACE;
+ var IS_EMPTY_INPUT = false;
+ var ALLOWED_NAMESPACES = null;
+ var DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
+ var PARSER_MEDIA_TYPE;
+ var SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
+ var DEFAULT_PARSER_MEDIA_TYPE = "text/html";
+ var transformCaseFunc;
+ var CONFIG = null;
+ var formElement = document2.createElement("form");
+ var isRegexOrFunction = function isRegexOrFunction2(testValue) {
+ return testValue instanceof RegExp || testValue instanceof Function;
+ };
+ var _parseConfig = function _parseConfig2(cfg) {
+ if (CONFIG && CONFIG === cfg) {
+ return;
+ }
+ if (!cfg || _typeof(cfg) !== "object") {
+ cfg = {};
+ }
+ cfg = clone2(cfg);
+ PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? PARSER_MEDIA_TYPE = DEFAULT_PARSER_MEDIA_TYPE : PARSER_MEDIA_TYPE = cfg.PARSER_MEDIA_TYPE;
+ transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
+ ALLOWED_TAGS = "ALLOWED_TAGS" in cfg ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
+ ALLOWED_ATTR = "ALLOWED_ATTR" in cfg ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
+ ALLOWED_NAMESPACES = "ALLOWED_NAMESPACES" in cfg ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
+ URI_SAFE_ATTRIBUTES = "ADD_URI_SAFE_ATTR" in cfg ? addToSet(
+ clone2(DEFAULT_URI_SAFE_ATTRIBUTES),
+ cfg.ADD_URI_SAFE_ATTR,
+ transformCaseFunc
+ ) : DEFAULT_URI_SAFE_ATTRIBUTES;
+ DATA_URI_TAGS = "ADD_DATA_URI_TAGS" in cfg ? addToSet(
+ clone2(DEFAULT_DATA_URI_TAGS),
+ cfg.ADD_DATA_URI_TAGS,
+ transformCaseFunc
+ ) : DEFAULT_DATA_URI_TAGS;
+ FORBID_CONTENTS = "FORBID_CONTENTS" in cfg ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
+ FORBID_TAGS = "FORBID_TAGS" in cfg ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
+ FORBID_ATTR = "FORBID_ATTR" in cfg ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
+ USE_PROFILES = "USE_PROFILES" in cfg ? cfg.USE_PROFILES : false;
+ ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
+ ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
+ ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
+ ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
+ SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
+ WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
+ RETURN_DOM = cfg.RETURN_DOM || false;
+ RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
+ RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
+ FORCE_BODY = cfg.FORCE_BODY || false;
+ SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
+ SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
+ KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
+ IN_PLACE = cfg.IN_PLACE || false;
+ IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI$1;
+ NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
+ CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
+ CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
+ }
+ if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
+ CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
+ }
+ if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === "boolean") {
+ CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
+ }
+ if (SAFE_FOR_TEMPLATES) {
+ ALLOW_DATA_ATTR = false;
+ }
+ if (RETURN_DOM_FRAGMENT) {
+ RETURN_DOM = true;
+ }
+ if (USE_PROFILES) {
+ ALLOWED_TAGS = addToSet({}, _toConsumableArray(text));
+ ALLOWED_ATTR = [];
+ if (USE_PROFILES.html === true) {
+ addToSet(ALLOWED_TAGS, html$1);
+ addToSet(ALLOWED_ATTR, html);
+ }
+ if (USE_PROFILES.svg === true) {
+ addToSet(ALLOWED_TAGS, svg$1);
+ addToSet(ALLOWED_ATTR, svg);
+ addToSet(ALLOWED_ATTR, xml);
+ }
+ if (USE_PROFILES.svgFilters === true) {
+ addToSet(ALLOWED_TAGS, svgFilters);
+ addToSet(ALLOWED_ATTR, svg);
+ addToSet(ALLOWED_ATTR, xml);
+ }
+ if (USE_PROFILES.mathMl === true) {
+ addToSet(ALLOWED_TAGS, mathMl$1);
+ addToSet(ALLOWED_ATTR, mathMl);
+ addToSet(ALLOWED_ATTR, xml);
+ }
+ }
+ if (cfg.ADD_TAGS) {
+ if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
+ ALLOWED_TAGS = clone2(ALLOWED_TAGS);
+ }
+ addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
+ }
+ if (cfg.ADD_ATTR) {
+ if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
+ ALLOWED_ATTR = clone2(ALLOWED_ATTR);
+ }
+ addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
+ }
+ if (cfg.ADD_URI_SAFE_ATTR) {
+ addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
+ }
+ if (cfg.FORBID_CONTENTS) {
+ if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
+ FORBID_CONTENTS = clone2(FORBID_CONTENTS);
+ }
+ addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
+ }
+ if (KEEP_CONTENT) {
+ ALLOWED_TAGS["#text"] = true;
+ }
+ if (WHOLE_DOCUMENT) {
+ addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
+ }
+ if (ALLOWED_TAGS.table) {
+ addToSet(ALLOWED_TAGS, ["tbody"]);
+ delete FORBID_TAGS.tbody;
+ }
+ if (freeze) {
+ freeze(cfg);
+ }
+ CONFIG = cfg;
+ };
+ var MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
+ var HTML_INTEGRATION_POINTS = addToSet({}, ["foreignobject", "desc", "title", "annotation-xml"]);
+ var COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
+ var ALL_SVG_TAGS = addToSet({}, svg$1);
+ addToSet(ALL_SVG_TAGS, svgFilters);
+ addToSet(ALL_SVG_TAGS, svgDisallowed);
+ var ALL_MATHML_TAGS = addToSet({}, mathMl$1);
+ addToSet(ALL_MATHML_TAGS, mathMlDisallowed);
+ var _checkValidNamespace = function _checkValidNamespace2(element) {
+ var parent = getParentNode(element);
+ if (!parent || !parent.tagName) {
+ parent = {
+ namespaceURI: NAMESPACE,
+ tagName: "template"
+ };
+ }
+ var tagName = stringToLowerCase(element.tagName);
+ var parentTagName = stringToLowerCase(parent.tagName);
+ if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
+ return false;
+ }
+ if (element.namespaceURI === SVG_NAMESPACE) {
+ if (parent.namespaceURI === HTML_NAMESPACE) {
+ return tagName === "svg";
+ }
+ if (parent.namespaceURI === MATHML_NAMESPACE) {
+ return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
+ }
+ return Boolean(ALL_SVG_TAGS[tagName]);
+ }
+ if (element.namespaceURI === MATHML_NAMESPACE) {
+ if (parent.namespaceURI === HTML_NAMESPACE) {
+ return tagName === "math";
+ }
+ if (parent.namespaceURI === SVG_NAMESPACE) {
+ return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
+ }
+ return Boolean(ALL_MATHML_TAGS[tagName]);
+ }
+ if (element.namespaceURI === HTML_NAMESPACE) {
+ if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
+ return false;
+ }
+ if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
+ return false;
+ }
+ return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
+ }
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) {
+ return true;
+ }
+ return false;
+ };
+ var _forceRemove = function _forceRemove2(node) {
+ arrayPush(DOMPurify2.removed, {
+ element: node
+ });
+ try {
+ node.parentNode.removeChild(node);
+ } catch (_) {
+ try {
+ node.outerHTML = emptyHTML;
+ } catch (_2) {
+ node.remove();
+ }
+ }
+ };
+ var _removeAttribute = function _removeAttribute2(name, node) {
+ try {
+ arrayPush(DOMPurify2.removed, {
+ attribute: node.getAttributeNode(name),
+ from: node
+ });
+ } catch (_) {
+ arrayPush(DOMPurify2.removed, {
+ attribute: null,
+ from: node
+ });
+ }
+ node.removeAttribute(name);
+ if (name === "is" && !ALLOWED_ATTR[name]) {
+ if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
+ try {
+ _forceRemove(node);
+ } catch (_) {
+ }
+ } else {
+ try {
+ node.setAttribute(name, "");
+ } catch (_) {
+ }
+ }
+ }
+ };
+ var _initDocument = function _initDocument2(dirty) {
+ var doc;
+ var leadingWhitespace;
+ if (FORCE_BODY) {
+ dirty = " " + dirty;
+ } else {
+ var matches = stringMatch(dirty, /^[\r\n\t ]+/);
+ leadingWhitespace = matches && matches[0];
+ }
+ if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) {
+ dirty = '' + dirty + "";
+ }
+ var dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
+ if (NAMESPACE === HTML_NAMESPACE) {
+ try {
+ doc = new DOMParser2().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
+ } catch (_) {
+ }
+ }
+ if (!doc || !doc.documentElement) {
+ doc = implementation2.createDocument(NAMESPACE, "template", null);
+ try {
+ doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
+ } catch (_) {
+ }
+ }
+ var body = doc.body || doc.documentElement;
+ if (dirty && leadingWhitespace) {
+ body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
+ }
+ if (NAMESPACE === HTML_NAMESPACE) {
+ return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
+ }
+ return WHOLE_DOCUMENT ? doc.documentElement : body;
+ };
+ var _createIterator = function _createIterator2(root) {
+ return createNodeIterator.call(
+ root.ownerDocument || root,
+ root,
+ NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT,
+ null,
+ false
+ );
+ };
+ var _isClobbered = function _isClobbered2(elm) {
+ return elm instanceof HTMLFormElement && (typeof elm.nodeName !== "string" || typeof elm.textContent !== "string" || typeof elm.removeChild !== "function" || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== "function" || typeof elm.setAttribute !== "function" || typeof elm.namespaceURI !== "string" || typeof elm.insertBefore !== "function" || typeof elm.hasChildNodes !== "function");
+ };
+ var _isNode = function _isNode2(object2) {
+ return _typeof(Node6) === "object" ? object2 instanceof Node6 : object2 && _typeof(object2) === "object" && typeof object2.nodeType === "number" && typeof object2.nodeName === "string";
+ };
+ var _executeHook = function _executeHook2(entryPoint, currentNode, data) {
+ if (!hooks[entryPoint]) {
+ return;
+ }
+ arrayForEach(hooks[entryPoint], function(hook) {
+ hook.call(DOMPurify2, currentNode, data, CONFIG);
+ });
+ };
+ var _sanitizeElements = function _sanitizeElements2(currentNode) {
+ var content;
+ _executeHook("beforeSanitizeElements", currentNode, null);
+ if (_isClobbered(currentNode)) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ if (regExpTest(/[\u0080-\uFFFF]/, currentNode.nodeName)) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ var tagName = transformCaseFunc(currentNode.nodeName);
+ _executeHook("uponSanitizeElement", currentNode, {
+ tagName,
+ allowedTags: ALLOWED_TAGS
+ });
+ if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && (!_isNode(currentNode.content) || !_isNode(currentNode.content.firstElementChild)) && regExpTest(/<[/\w]/g, currentNode.innerHTML) && regExpTest(/<[/\w]/g, currentNode.textContent)) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ if (tagName === "select" && regExpTest(/= 0; --i) {
+ parentNode.insertBefore(cloneNode(childNodes[i], true), getNextSibling(currentNode));
+ }
+ }
+ }
+ _forceRemove(currentNode);
+ return true;
+ }
+ if (currentNode instanceof Element2 && !_checkValidNamespace(currentNode)) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ if ((tagName === "noscript" || tagName === "noembed") && regExpTest(/<\/no(script|embed)/i, currentNode.innerHTML)) {
+ _forceRemove(currentNode);
+ return true;
+ }
+ if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {
+ content = currentNode.textContent;
+ content = stringReplace(content, MUSTACHE_EXPR$1, " ");
+ content = stringReplace(content, ERB_EXPR$1, " ");
+ content = stringReplace(content, TMPLIT_EXPR$1, " ");
+ if (currentNode.textContent !== content) {
+ arrayPush(DOMPurify2.removed, {
+ element: currentNode.cloneNode()
+ });
+ currentNode.textContent = content;
+ }
+ }
+ _executeHook("afterSanitizeElements", currentNode, null);
+ return false;
+ };
+ var _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
+ if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value in formElement)) {
+ return false;
+ }
+ if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR$1, lcName))
+ ;
+ else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName))
+ ;
+ else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
+ if (_basicCustomElementTest(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)))
+ ;
+ else {
+ return false;
+ }
+ } else if (URI_SAFE_ATTRIBUTES[lcName])
+ ;
+ else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, "")))
+ ;
+ else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag])
+ ;
+ else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, "")))
+ ;
+ else if (!value)
+ ;
+ else {
+ return false;
+ }
+ return true;
+ };
+ var _basicCustomElementTest = function _basicCustomElementTest2(tagName) {
+ return tagName.indexOf("-") > 0;
+ };
+ var _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
+ var attr;
+ var value;
+ var lcName;
+ var l;
+ _executeHook("beforeSanitizeAttributes", currentNode, null);
+ var attributes = currentNode.attributes;
+ if (!attributes) {
+ return;
+ }
+ var hookEvent = {
+ attrName: "",
+ attrValue: "",
+ keepAttr: true,
+ allowedAttributes: ALLOWED_ATTR
+ };
+ l = attributes.length;
+ while (l--) {
+ attr = attributes[l];
+ var _attr = attr, name = _attr.name, namespaceURI = _attr.namespaceURI;
+ value = name === "value" ? attr.value : stringTrim(attr.value);
+ lcName = transformCaseFunc(name);
+ hookEvent.attrName = lcName;
+ hookEvent.attrValue = value;
+ hookEvent.keepAttr = true;
+ hookEvent.forceKeepAttr = void 0;
+ _executeHook("uponSanitizeAttribute", currentNode, hookEvent);
+ value = hookEvent.attrValue;
+ if (hookEvent.forceKeepAttr) {
+ continue;
+ }
+ _removeAttribute(name, currentNode);
+ if (!hookEvent.keepAttr) {
+ continue;
+ }
+ if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
+ _removeAttribute(name, currentNode);
+ continue;
+ }
+ if (SAFE_FOR_TEMPLATES) {
+ value = stringReplace(value, MUSTACHE_EXPR$1, " ");
+ value = stringReplace(value, ERB_EXPR$1, " ");
+ value = stringReplace(value, TMPLIT_EXPR$1, " ");
+ }
+ var lcTag = transformCaseFunc(currentNode.nodeName);
+ if (!_isValidAttribute(lcTag, lcName, value)) {
+ continue;
+ }
+ if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
+ _removeAttribute(name, currentNode);
+ value = SANITIZE_NAMED_PROPS_PREFIX + value;
+ }
+ if (trustedTypesPolicy && _typeof(trustedTypes) === "object" && typeof trustedTypes.getAttributeType === "function") {
+ if (namespaceURI)
+ ;
+ else {
+ switch (trustedTypes.getAttributeType(lcTag, lcName)) {
+ case "TrustedHTML":
+ value = trustedTypesPolicy.createHTML(value);
+ break;
+ case "TrustedScriptURL":
+ value = trustedTypesPolicy.createScriptURL(value);
+ break;
+ }
+ }
+ }
+ try {
+ if (namespaceURI) {
+ currentNode.setAttributeNS(namespaceURI, name, value);
+ } else {
+ currentNode.setAttribute(name, value);
+ }
+ arrayPop(DOMPurify2.removed);
+ } catch (_) {
+ }
+ }
+ _executeHook("afterSanitizeAttributes", currentNode, null);
+ };
+ var _sanitizeShadowDOM = function _sanitizeShadowDOM2(fragment) {
+ var shadowNode;
+ var shadowIterator = _createIterator(fragment);
+ _executeHook("beforeSanitizeShadowDOM", fragment, null);
+ while (shadowNode = shadowIterator.nextNode()) {
+ _executeHook("uponSanitizeShadowNode", shadowNode, null);
+ if (_sanitizeElements(shadowNode)) {
+ continue;
+ }
+ if (shadowNode.content instanceof DocumentFragment2) {
+ _sanitizeShadowDOM2(shadowNode.content);
+ }
+ _sanitizeAttributes(shadowNode);
+ }
+ _executeHook("afterSanitizeShadowDOM", fragment, null);
+ };
+ DOMPurify2.sanitize = function(dirty) {
+ var cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
+ var body;
+ var importedNode;
+ var currentNode;
+ var oldNode;
+ var returnNode;
+ IS_EMPTY_INPUT = !dirty;
+ if (IS_EMPTY_INPUT) {
+ dirty = "";
+ }
+ if (typeof dirty !== "string" && !_isNode(dirty)) {
+ if (typeof dirty.toString !== "function") {
+ throw typeErrorCreate("toString is not a function");
+ } else {
+ dirty = dirty.toString();
+ if (typeof dirty !== "string") {
+ throw typeErrorCreate("dirty is not a string, aborting");
+ }
+ }
+ }
+ if (!DOMPurify2.isSupported) {
+ if (_typeof(window2.toStaticHTML) === "object" || typeof window2.toStaticHTML === "function") {
+ if (typeof dirty === "string") {
+ return window2.toStaticHTML(dirty);
+ }
+ if (_isNode(dirty)) {
+ return window2.toStaticHTML(dirty.outerHTML);
+ }
+ }
+ return dirty;
+ }
+ if (!SET_CONFIG) {
+ _parseConfig(cfg);
+ }
+ DOMPurify2.removed = [];
+ if (typeof dirty === "string") {
+ IN_PLACE = false;
+ }
+ if (IN_PLACE) {
+ if (dirty.nodeName) {
+ var tagName = transformCaseFunc(dirty.nodeName);
+ if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
+ throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
+ }
+ }
+ } else if (dirty instanceof Node6) {
+ body = _initDocument("");
+ importedNode = body.ownerDocument.importNode(dirty, true);
+ if (importedNode.nodeType === 1 && importedNode.nodeName === "BODY") {
+ body = importedNode;
+ } else if (importedNode.nodeName === "HTML") {
+ body = importedNode;
+ } else {
+ body.appendChild(importedNode);
+ }
+ } else {
+ if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) {
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
+ }
+ body = _initDocument(dirty);
+ if (!body) {
+ return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
+ }
+ }
+ if (body && FORCE_BODY) {
+ _forceRemove(body.firstChild);
+ }
+ var nodeIterator = _createIterator(IN_PLACE ? dirty : body);
+ while (currentNode = nodeIterator.nextNode()) {
+ if (currentNode.nodeType === 3 && currentNode === oldNode) {
+ continue;
+ }
+ if (_sanitizeElements(currentNode)) {
+ continue;
+ }
+ if (currentNode.content instanceof DocumentFragment2) {
+ _sanitizeShadowDOM(currentNode.content);
+ }
+ _sanitizeAttributes(currentNode);
+ oldNode = currentNode;
+ }
+ oldNode = null;
+ if (IN_PLACE) {
+ return dirty;
+ }
+ if (RETURN_DOM) {
+ if (RETURN_DOM_FRAGMENT) {
+ returnNode = createDocumentFragment.call(body.ownerDocument);
+ while (body.firstChild) {
+ returnNode.appendChild(body.firstChild);
+ }
+ } else {
+ returnNode = body;
+ }
+ if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmod) {
+ returnNode = importNode.call(originalDocument, returnNode, true);
+ }
+ return returnNode;
+ }
+ var serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
+ if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
+ serializedHTML = "\n" + serializedHTML;
+ }
+ if (SAFE_FOR_TEMPLATES) {
+ serializedHTML = stringReplace(serializedHTML, MUSTACHE_EXPR$1, " ");
+ serializedHTML = stringReplace(serializedHTML, ERB_EXPR$1, " ");
+ serializedHTML = stringReplace(serializedHTML, TMPLIT_EXPR$1, " ");
+ }
+ return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
+ };
+ DOMPurify2.setConfig = function(cfg) {
+ _parseConfig(cfg);
+ SET_CONFIG = true;
+ };
+ DOMPurify2.clearConfig = function() {
+ CONFIG = null;
+ SET_CONFIG = false;
+ };
+ DOMPurify2.isValidAttribute = function(tag, attr, value) {
+ if (!CONFIG) {
+ _parseConfig({});
+ }
+ var lcTag = transformCaseFunc(tag);
+ var lcName = transformCaseFunc(attr);
+ return _isValidAttribute(lcTag, lcName, value);
+ };
+ DOMPurify2.addHook = function(entryPoint, hookFunction) {
+ if (typeof hookFunction !== "function") {
+ return;
+ }
+ hooks[entryPoint] = hooks[entryPoint] || [];
+ arrayPush(hooks[entryPoint], hookFunction);
+ };
+ DOMPurify2.removeHook = function(entryPoint) {
+ if (hooks[entryPoint]) {
+ return arrayPop(hooks[entryPoint]);
+ }
+ };
+ DOMPurify2.removeHooks = function(entryPoint) {
+ if (hooks[entryPoint]) {
+ hooks[entryPoint] = [];
+ }
+ };
+ DOMPurify2.removeAllHooks = function() {
+ hooks = {};
+ };
+ return DOMPurify2;
+ }
+ var purify = createDOMPurify();
+ return purify;
+ });
+ }
+});
+
+// node_modules/jsep/build/jsep.js
+var require_jsep = __commonJS({
+ "node_modules/jsep/build/jsep.js"(exports2, module2) {
+ (function(root) {
+ "use strict";
+ var COMPOUND = "Compound", IDENTIFIER = "Identifier", MEMBER_EXP = "MemberExpression", LITERAL = "Literal", THIS_EXP = "ThisExpression", CALL_EXP = "CallExpression", UNARY_EXP = "UnaryExpression", BINARY_EXP = "BinaryExpression", LOGICAL_EXP = "LogicalExpression", CONDITIONAL_EXP = "ConditionalExpression", ARRAY_EXP = "ArrayExpression", PERIOD_CODE = 46, COMMA_CODE = 44, SQUOTE_CODE = 39, DQUOTE_CODE = 34, OPAREN_CODE = 40, CPAREN_CODE = 41, OBRACK_CODE = 91, CBRACK_CODE = 93, QUMARK_CODE = 63, SEMCOL_CODE = 59, COLON_CODE = 58, throwError = function(message, index) {
+ var error = new Error(message + " at character " + index);
+ error.index = index;
+ error.description = message;
+ throw error;
+ }, t = true, unary_ops = { "-": t, "!": t, "~": t, "+": t }, binary_ops = {
+ "||": 1,
+ "&&": 2,
+ "|": 3,
+ "^": 4,
+ "&": 5,
+ "==": 6,
+ "!=": 6,
+ "===": 6,
+ "!==": 6,
+ "<": 7,
+ ">": 7,
+ "<=": 7,
+ ">=": 7,
+ "<<": 8,
+ ">>": 8,
+ ">>>": 8,
+ "+": 9,
+ "-": 9,
+ "*": 10,
+ "/": 10,
+ "%": 10
+ }, getMaxKeyLen = function(obj) {
+ var max_len = 0, len;
+ for (var key in obj) {
+ if ((len = key.length) > max_len && obj.hasOwnProperty(key)) {
+ max_len = len;
+ }
+ }
+ return max_len;
+ }, max_unop_len = getMaxKeyLen(unary_ops), max_binop_len = getMaxKeyLen(binary_ops), literals = {
+ "true": true,
+ "false": false,
+ "null": null
+ }, this_str = "this", binaryPrecedence = function(op_val) {
+ return binary_ops[op_val] || 0;
+ }, createBinaryExpression = function(operator, left, right) {
+ var type = operator === "||" || operator === "&&" ? LOGICAL_EXP : BINARY_EXP;
+ return {
+ type,
+ operator,
+ left,
+ right
+ };
+ }, isDecimalDigit = function(ch) {
+ return ch >= 48 && ch <= 57;
+ }, isIdentifierStart = function(ch) {
+ return ch === 36 || ch === 95 || ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 128 && !binary_ops[String.fromCharCode(ch)];
+ }, isIdentifierPart = function(ch) {
+ return ch === 36 || ch === 95 || ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 48 && ch <= 57 || ch >= 128 && !binary_ops[String.fromCharCode(ch)];
+ }, jsep2 = function(expr) {
+ var index = 0, charAtFunc = expr.charAt, charCodeAtFunc = expr.charCodeAt, exprI = function(i) {
+ return charAtFunc.call(expr, i);
+ }, exprICode = function(i) {
+ return charCodeAtFunc.call(expr, i);
+ }, length3 = expr.length, gobbleSpaces = function() {
+ var ch = exprICode(index);
+ while (ch === 32 || ch === 9 || ch === 10 || ch === 13) {
+ ch = exprICode(++index);
+ }
+ }, gobbleExpression = function() {
+ var test = gobbleBinaryExpression(), consequent, alternate;
+ gobbleSpaces();
+ if (exprICode(index) === QUMARK_CODE) {
+ index++;
+ consequent = gobbleExpression();
+ if (!consequent) {
+ throwError("Expected expression", index);
+ }
+ gobbleSpaces();
+ if (exprICode(index) === COLON_CODE) {
+ index++;
+ alternate = gobbleExpression();
+ if (!alternate) {
+ throwError("Expected expression", index);
+ }
+ return {
+ type: CONDITIONAL_EXP,
+ test,
+ consequent,
+ alternate
+ };
+ } else {
+ throwError("Expected :", index);
+ }
+ } else {
+ return test;
+ }
+ }, gobbleBinaryOp = function() {
+ gobbleSpaces();
+ var biop, to_check = expr.substr(index, max_binop_len), tc_len = to_check.length;
+ while (tc_len > 0) {
+ if (binary_ops.hasOwnProperty(to_check) && (!isIdentifierStart(exprICode(index)) || index + to_check.length < expr.length && !isIdentifierPart(exprICode(index + to_check.length)))) {
+ index += tc_len;
+ return to_check;
+ }
+ to_check = to_check.substr(0, --tc_len);
+ }
+ return false;
+ }, gobbleBinaryExpression = function() {
+ var ch_i2, node2, biop, prec, stack, biop_info, left, right, i, cur_biop;
+ left = gobbleToken();
+ biop = gobbleBinaryOp();
+ if (!biop) {
+ return left;
+ }
+ biop_info = { value: biop, prec: binaryPrecedence(biop) };
+ right = gobbleToken();
+ if (!right) {
+ throwError("Expected expression after " + biop, index);
+ }
+ stack = [left, biop_info, right];
+ while (biop = gobbleBinaryOp()) {
+ prec = binaryPrecedence(biop);
+ if (prec === 0) {
+ break;
+ }
+ biop_info = { value: biop, prec };
+ cur_biop = biop;
+ while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {
+ right = stack.pop();
+ biop = stack.pop().value;
+ left = stack.pop();
+ node2 = createBinaryExpression(biop, left, right);
+ stack.push(node2);
+ }
+ node2 = gobbleToken();
+ if (!node2) {
+ throwError("Expected expression after " + cur_biop, index);
+ }
+ stack.push(biop_info, node2);
+ }
+ i = stack.length - 1;
+ node2 = stack[i];
+ while (i > 1) {
+ node2 = createBinaryExpression(stack[i - 1].value, stack[i - 2], node2);
+ i -= 2;
+ }
+ return node2;
+ }, gobbleToken = function() {
+ var ch, to_check, tc_len;
+ gobbleSpaces();
+ ch = exprICode(index);
+ if (isDecimalDigit(ch) || ch === PERIOD_CODE) {
+ return gobbleNumericLiteral();
+ } else if (ch === SQUOTE_CODE || ch === DQUOTE_CODE) {
+ return gobbleStringLiteral();
+ } else if (ch === OBRACK_CODE) {
+ return gobbleArray();
+ } else {
+ to_check = expr.substr(index, max_unop_len);
+ tc_len = to_check.length;
+ while (tc_len > 0) {
+ if (unary_ops.hasOwnProperty(to_check) && (!isIdentifierStart(exprICode(index)) || index + to_check.length < expr.length && !isIdentifierPart(exprICode(index + to_check.length)))) {
+ index += tc_len;
+ return {
+ type: UNARY_EXP,
+ operator: to_check,
+ argument: gobbleToken(),
+ prefix: true
+ };
+ }
+ to_check = to_check.substr(0, --tc_len);
+ }
+ if (isIdentifierStart(ch) || ch === OPAREN_CODE) {
+ return gobbleVariable();
+ }
+ }
+ return false;
+ }, gobbleNumericLiteral = function() {
+ var number = "", ch, chCode;
+ while (isDecimalDigit(exprICode(index))) {
+ number += exprI(index++);
+ }
+ if (exprICode(index) === PERIOD_CODE) {
+ number += exprI(index++);
+ while (isDecimalDigit(exprICode(index))) {
+ number += exprI(index++);
+ }
+ }
+ ch = exprI(index);
+ if (ch === "e" || ch === "E") {
+ number += exprI(index++);
+ ch = exprI(index);
+ if (ch === "+" || ch === "-") {
+ number += exprI(index++);
+ }
+ while (isDecimalDigit(exprICode(index))) {
+ number += exprI(index++);
+ }
+ if (!isDecimalDigit(exprICode(index - 1))) {
+ throwError("Expected exponent (" + number + exprI(index) + ")", index);
+ }
+ }
+ chCode = exprICode(index);
+ if (isIdentifierStart(chCode)) {
+ throwError("Variable names cannot start with a number (" + number + exprI(index) + ")", index);
+ } else if (chCode === PERIOD_CODE) {
+ throwError("Unexpected period", index);
+ }
+ return {
+ type: LITERAL,
+ value: parseFloat(number),
+ raw: number
+ };
+ }, gobbleStringLiteral = function() {
+ var str = "", quote = exprI(index++), closed = false, ch;
+ while (index < length3) {
+ ch = exprI(index++);
+ if (ch === quote) {
+ closed = true;
+ break;
+ } else if (ch === "\\") {
+ ch = exprI(index++);
+ switch (ch) {
+ case "n":
+ str += "\n";
+ break;
+ case "r":
+ str += "\r";
+ break;
+ case "t":
+ str += " ";
+ break;
+ case "b":
+ str += "\b";
+ break;
+ case "f":
+ str += "\f";
+ break;
+ case "v":
+ str += "\v";
+ break;
+ default:
+ str += ch;
+ }
+ } else {
+ str += ch;
+ }
+ }
+ if (!closed) {
+ throwError('Unclosed quote after "' + str + '"', index);
+ }
+ return {
+ type: LITERAL,
+ value: str,
+ raw: quote + str + quote
+ };
+ }, gobbleIdentifier = function() {
+ var ch = exprICode(index), start = index, identifier;
+ if (isIdentifierStart(ch)) {
+ index++;
+ } else {
+ throwError("Unexpected " + exprI(index), index);
+ }
+ while (index < length3) {
+ ch = exprICode(index);
+ if (isIdentifierPart(ch)) {
+ index++;
+ } else {
+ break;
+ }
+ }
+ identifier = expr.slice(start, index);
+ if (literals.hasOwnProperty(identifier)) {
+ return {
+ type: LITERAL,
+ value: literals[identifier],
+ raw: identifier
+ };
+ } else if (identifier === this_str) {
+ return { type: THIS_EXP };
+ } else {
+ return {
+ type: IDENTIFIER,
+ name: identifier
+ };
+ }
+ }, gobbleArguments = function(termination) {
+ var ch_i2, args = [], node2, closed = false;
+ var separator_count = 0;
+ while (index < length3) {
+ gobbleSpaces();
+ ch_i2 = exprICode(index);
+ if (ch_i2 === termination) {
+ closed = true;
+ index++;
+ if (termination === CPAREN_CODE && separator_count && separator_count >= args.length) {
+ throwError("Unexpected token " + String.fromCharCode(termination), index);
+ }
+ break;
+ } else if (ch_i2 === COMMA_CODE) {
+ index++;
+ separator_count++;
+ if (separator_count !== args.length) {
+ if (termination === CPAREN_CODE) {
+ throwError("Unexpected token ,", index);
+ } else if (termination === CBRACK_CODE) {
+ for (var arg = args.length; arg < separator_count; arg++) {
+ args.push(null);
+ }
+ }
+ }
+ } else {
+ node2 = gobbleExpression();
+ if (!node2 || node2.type === COMPOUND) {
+ throwError("Expected comma", index);
+ }
+ args.push(node2);
+ }
+ }
+ if (!closed) {
+ throwError("Expected " + String.fromCharCode(termination), index);
+ }
+ return args;
+ }, gobbleVariable = function() {
+ var ch_i2, node2;
+ ch_i2 = exprICode(index);
+ if (ch_i2 === OPAREN_CODE) {
+ node2 = gobbleGroup();
+ } else {
+ node2 = gobbleIdentifier();
+ }
+ gobbleSpaces();
+ ch_i2 = exprICode(index);
+ while (ch_i2 === PERIOD_CODE || ch_i2 === OBRACK_CODE || ch_i2 === OPAREN_CODE) {
+ index++;
+ if (ch_i2 === PERIOD_CODE) {
+ gobbleSpaces();
+ node2 = {
+ type: MEMBER_EXP,
+ computed: false,
+ object: node2,
+ property: gobbleIdentifier()
+ };
+ } else if (ch_i2 === OBRACK_CODE) {
+ node2 = {
+ type: MEMBER_EXP,
+ computed: true,
+ object: node2,
+ property: gobbleExpression()
+ };
+ gobbleSpaces();
+ ch_i2 = exprICode(index);
+ if (ch_i2 !== CBRACK_CODE) {
+ throwError("Unclosed [", index);
+ }
+ index++;
+ } else if (ch_i2 === OPAREN_CODE) {
+ node2 = {
+ type: CALL_EXP,
+ "arguments": gobbleArguments(CPAREN_CODE),
+ callee: node2
+ };
+ }
+ gobbleSpaces();
+ ch_i2 = exprICode(index);
+ }
+ return node2;
+ }, gobbleGroup = function() {
+ index++;
+ var node2 = gobbleExpression();
+ gobbleSpaces();
+ if (exprICode(index) === CPAREN_CODE) {
+ index++;
+ return node2;
+ } else {
+ throwError("Unclosed (", index);
+ }
+ }, gobbleArray = function() {
+ index++;
+ return {
+ type: ARRAY_EXP,
+ elements: gobbleArguments(CBRACK_CODE)
+ };
+ }, nodes = [], ch_i, node;
+ while (index < length3) {
+ ch_i = exprICode(index);
+ if (ch_i === SEMCOL_CODE || ch_i === COMMA_CODE) {
+ index++;
+ } else {
+ if (node = gobbleExpression()) {
+ nodes.push(node);
+ } else if (index < length3) {
+ throwError('Unexpected "' + exprI(index) + '"', index);
+ }
+ }
+ }
+ if (nodes.length === 1) {
+ return nodes[0];
+ } else {
+ return {
+ type: COMPOUND,
+ body: nodes
+ };
+ }
+ };
+ jsep2.version = "0.3.5";
+ jsep2.toString = function() {
+ return "JavaScript Expression Parser (JSEP) v" + jsep2.version;
+ };
+ jsep2.addUnaryOp = function(op_name) {
+ max_unop_len = Math.max(op_name.length, max_unop_len);
+ unary_ops[op_name] = t;
+ return this;
+ };
+ jsep2.addBinaryOp = function(op_name, precedence) {
+ max_binop_len = Math.max(op_name.length, max_binop_len);
+ binary_ops[op_name] = precedence;
+ return this;
+ };
+ jsep2.addLiteral = function(literal_name, literal_value) {
+ literals[literal_name] = literal_value;
+ return this;
+ };
+ jsep2.removeUnaryOp = function(op_name) {
+ delete unary_ops[op_name];
+ if (op_name.length === max_unop_len) {
+ max_unop_len = getMaxKeyLen(unary_ops);
+ }
+ return this;
+ };
+ jsep2.removeAllUnaryOps = function() {
+ unary_ops = {};
+ max_unop_len = 0;
+ return this;
+ };
+ jsep2.removeBinaryOp = function(op_name) {
+ delete binary_ops[op_name];
+ if (op_name.length === max_binop_len) {
+ max_binop_len = getMaxKeyLen(binary_ops);
+ }
+ return this;
+ };
+ jsep2.removeAllBinaryOps = function() {
+ binary_ops = {};
+ max_binop_len = 0;
+ return this;
+ };
+ jsep2.removeLiteral = function(literal_name) {
+ delete literals[literal_name];
+ return this;
+ };
+ jsep2.removeAllLiterals = function() {
+ literals = {};
+ return this;
+ };
+ if (typeof exports2 === "undefined") {
+ var old_jsep = root.jsep;
+ root.jsep = jsep2;
+ jsep2.noConflict = function() {
+ if (root.jsep === jsep2) {
+ root.jsep = old_jsep;
+ }
+ return jsep2;
+ };
+ } else {
+ if (typeof module2 !== "undefined" && module2.exports) {
+ exports2 = module2.exports = jsep2;
+ } else {
+ exports2.parse = jsep2;
+ }
+ }
+ })(exports2);
+ }
+});
+
+// node_modules/bitmap-sdf/index.js
+var require_bitmap_sdf = __commonJS({
+ "node_modules/bitmap-sdf/index.js"(exports2, module2) {
+ "use strict";
+ module2.exports = calcSDF;
+ var INF = 1e20;
+ function calcSDF(src, options) {
+ if (!options)
+ options = {};
+ var cutoff = options.cutoff == null ? 0.25 : options.cutoff;
+ var radius = options.radius == null ? 8 : options.radius;
+ var channel = options.channel || 0;
+ var w, h, size, data, intData, stride, ctx, canvas, imgData, i, l;
+ if (ArrayBuffer.isView(src) || Array.isArray(src)) {
+ if (!options.width || !options.height)
+ throw Error("For raw data width and height should be provided by options");
+ w = options.width, h = options.height;
+ data = src;
+ if (!options.stride)
+ stride = Math.floor(src.length / w / h);
+ else
+ stride = options.stride;
+ } else {
+ if (window.HTMLCanvasElement && src instanceof window.HTMLCanvasElement) {
+ canvas = src;
+ ctx = canvas.getContext("2d");
+ w = canvas.width, h = canvas.height;
+ imgData = ctx.getImageData(0, 0, w, h);
+ data = imgData.data;
+ stride = 4;
+ } else if (window.CanvasRenderingContext2D && src instanceof window.CanvasRenderingContext2D) {
+ canvas = src.canvas;
+ ctx = src;
+ w = canvas.width, h = canvas.height;
+ imgData = ctx.getImageData(0, 0, w, h);
+ data = imgData.data;
+ stride = 4;
+ } else if (window.ImageData && src instanceof window.ImageData) {
+ imgData = src;
+ w = src.width, h = src.height;
+ data = imgData.data;
+ stride = 4;
+ }
+ }
+ size = Math.max(w, h);
+ if (window.Uint8ClampedArray && data instanceof window.Uint8ClampedArray || window.Uint8Array && data instanceof window.Uint8Array) {
+ intData = data;
+ data = Array(w * h);
+ for (i = 0, l = Math.floor(intData.length / stride); i < l; i++) {
+ data[i] = intData[i * stride + channel] / 255;
+ }
+ } else {
+ if (stride !== 1)
+ throw Error("Raw data can have only 1 value per pixel");
+ }
+ var gridOuter = Array(w * h);
+ var gridInner = Array(w * h);
+ var f = Array(size);
+ var d = Array(size);
+ var z = Array(size + 1);
+ var v7 = Array(size);
+ for (i = 0, l = w * h; i < l; i++) {
+ var a3 = data[i];
+ gridOuter[i] = a3 === 1 ? 0 : a3 === 0 ? INF : Math.pow(Math.max(0, 0.5 - a3), 2);
+ gridInner[i] = a3 === 1 ? INF : a3 === 0 ? 0 : Math.pow(Math.max(0, a3 - 0.5), 2);
+ }
+ edt(gridOuter, w, h, f, d, v7, z);
+ edt(gridInner, w, h, f, d, v7, z);
+ var dist = window.Float32Array ? new Float32Array(w * h) : new Array(w * h);
+ for (i = 0, l = w * h; i < l; i++) {
+ dist[i] = Math.min(Math.max(1 - ((gridOuter[i] - gridInner[i]) / radius + cutoff), 0), 1);
+ }
+ return dist;
+ }
+ function edt(data, width, height, f, d, v7, z) {
+ for (var x = 0; x < width; x++) {
+ for (var y = 0; y < height; y++) {
+ f[y] = data[y * width + x];
+ }
+ edt1d(f, d, v7, z, height);
+ for (y = 0; y < height; y++) {
+ data[y * width + x] = d[y];
+ }
+ }
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ f[x] = data[y * width + x];
+ }
+ edt1d(f, d, v7, z, width);
+ for (x = 0; x < width; x++) {
+ data[y * width + x] = Math.sqrt(d[x]);
+ }
+ }
+ }
+ function edt1d(f, d, v7, z, n) {
+ v7[0] = 0;
+ z[0] = -INF;
+ z[1] = +INF;
+ for (var q = 1, k = 0; q < n; q++) {
+ var s = (f[q] + q * q - (f[v7[k]] + v7[k] * v7[k])) / (2 * q - 2 * v7[k]);
+ while (s <= z[k]) {
+ k--;
+ s = (f[q] + q * q - (f[v7[k]] + v7[k] * v7[k])) / (2 * q - 2 * v7[k]);
+ }
+ k++;
+ v7[k] = q;
+ z[k] = s;
+ z[k + 1] = +INF;
+ }
+ for (q = 0, k = 0; q < n; q++) {
+ while (z[k + 1] < q)
+ k++;
+ d[q] = (q - v7[k]) * (q - v7[k]) + f[v7[k]];
+ }
+ }
+ }
+});
+
+// node_modules/grapheme-splitter/index.js
+var require_grapheme_splitter = __commonJS({
+ "node_modules/grapheme-splitter/index.js"(exports2, module2) {
+ function GraphemeSplitter2() {
+ var CR = 0, LF = 1, Control = 2, Extend = 3, Regional_Indicator = 4, SpacingMark = 5, L = 6, V = 7, T = 8, LV = 9, LVT = 10, Other = 11, Prepend = 12, E_Base = 13, E_Modifier = 14, ZWJ = 15, Glue_After_Zwj = 16, E_Base_GAZ = 17;
+ var NotBreak = 0, BreakStart = 1, Break = 2, BreakLastRegional = 3, BreakPenultimateRegional = 4;
+ function isSurrogate(str, pos) {
+ return 55296 <= str.charCodeAt(pos) && str.charCodeAt(pos) <= 56319 && 56320 <= str.charCodeAt(pos + 1) && str.charCodeAt(pos + 1) <= 57343;
+ }
+ function codePointAt(str, idx) {
+ if (idx === void 0) {
+ idx = 0;
+ }
+ var code = str.charCodeAt(idx);
+ if (55296 <= code && code <= 56319 && idx < str.length - 1) {
+ var hi = code;
+ var low = str.charCodeAt(idx + 1);
+ if (56320 <= low && low <= 57343) {
+ return (hi - 55296) * 1024 + (low - 56320) + 65536;
+ }
+ return hi;
+ }
+ if (56320 <= code && code <= 57343 && idx >= 1) {
+ var hi = str.charCodeAt(idx - 1);
+ var low = code;
+ if (55296 <= hi && hi <= 56319) {
+ return (hi - 55296) * 1024 + (low - 56320) + 65536;
+ }
+ return low;
+ }
+ return code;
+ }
+ function shouldBreak(start, mid, end) {
+ var all = [start].concat(mid).concat([end]);
+ var previous = all[all.length - 2];
+ var next = end;
+ var eModifierIndex = all.lastIndexOf(E_Modifier);
+ if (eModifierIndex > 1 && all.slice(1, eModifierIndex).every(function(c) {
+ return c == Extend;
+ }) && [Extend, E_Base, E_Base_GAZ].indexOf(start) == -1) {
+ return Break;
+ }
+ var rIIndex = all.lastIndexOf(Regional_Indicator);
+ if (rIIndex > 0 && all.slice(1, rIIndex).every(function(c) {
+ return c == Regional_Indicator;
+ }) && [Prepend, Regional_Indicator].indexOf(previous) == -1) {
+ if (all.filter(function(c) {
+ return c == Regional_Indicator;
+ }).length % 2 == 1) {
+ return BreakLastRegional;
+ } else {
+ return BreakPenultimateRegional;
+ }
+ }
+ if (previous == CR && next == LF) {
+ return NotBreak;
+ } else if (previous == Control || previous == CR || previous == LF) {
+ if (next == E_Modifier && mid.every(function(c) {
+ return c == Extend;
+ })) {
+ return Break;
+ } else {
+ return BreakStart;
+ }
+ } else if (next == Control || next == CR || next == LF) {
+ return BreakStart;
+ } else if (previous == L && (next == L || next == V || next == LV || next == LVT)) {
+ return NotBreak;
+ } else if ((previous == LV || previous == V) && (next == V || next == T)) {
+ return NotBreak;
+ } else if ((previous == LVT || previous == T) && next == T) {
+ return NotBreak;
+ } else if (next == Extend || next == ZWJ) {
+ return NotBreak;
+ } else if (next == SpacingMark) {
+ return NotBreak;
+ } else if (previous == Prepend) {
+ return NotBreak;
+ }
+ var previousNonExtendIndex = all.indexOf(Extend) != -1 ? all.lastIndexOf(Extend) - 1 : all.length - 2;
+ if ([E_Base, E_Base_GAZ].indexOf(all[previousNonExtendIndex]) != -1 && all.slice(previousNonExtendIndex + 1, -1).every(function(c) {
+ return c == Extend;
+ }) && next == E_Modifier) {
+ return NotBreak;
+ }
+ if (previous == ZWJ && [Glue_After_Zwj, E_Base_GAZ].indexOf(next) != -1) {
+ return NotBreak;
+ }
+ if (mid.indexOf(Regional_Indicator) != -1) {
+ return Break;
+ }
+ if (previous == Regional_Indicator && next == Regional_Indicator) {
+ return NotBreak;
+ }
+ return BreakStart;
+ }
+ this.nextBreak = function(string, index) {
+ if (index === void 0) {
+ index = 0;
+ }
+ if (index < 0) {
+ return 0;
+ }
+ if (index >= string.length - 1) {
+ return string.length;
+ }
+ var prev = getGraphemeBreakProperty(codePointAt(string, index));
+ var mid = [];
+ for (var i = index + 1; i < string.length; i++) {
+ if (isSurrogate(string, i - 1)) {
+ continue;
+ }
+ var next = getGraphemeBreakProperty(codePointAt(string, i));
+ if (shouldBreak(prev, mid, next)) {
+ return i;
+ }
+ mid.push(next);
+ }
+ return string.length;
+ };
+ this.splitGraphemes = function(str) {
+ var res = [];
+ var index = 0;
+ var brk;
+ while ((brk = this.nextBreak(str, index)) < str.length) {
+ res.push(str.slice(index, brk));
+ index = brk;
+ }
+ if (index < str.length) {
+ res.push(str.slice(index));
+ }
+ return res;
+ };
+ this.iterateGraphemes = function(str) {
+ var index = 0;
+ var res = {
+ next: function() {
+ var value;
+ var brk;
+ if ((brk = this.nextBreak(str, index)) < str.length) {
+ value = str.slice(index, brk);
+ index = brk;
+ return { value, done: false };
+ }
+ if (index < str.length) {
+ value = str.slice(index);
+ index = str.length;
+ return { value, done: false };
+ }
+ return { value: void 0, done: true };
+ }.bind(this)
+ };
+ if (typeof Symbol !== "undefined" && Symbol.iterator) {
+ res[Symbol.iterator] = function() {
+ return res;
+ };
+ }
+ return res;
+ };
+ this.countGraphemes = function(str) {
+ var count = 0;
+ var index = 0;
+ var brk;
+ while ((brk = this.nextBreak(str, index)) < str.length) {
+ index = brk;
+ count++;
+ }
+ if (index < str.length) {
+ count++;
+ }
+ return count;
+ };
+ function getGraphemeBreakProperty(code) {
+ if (1536 <= code && code <= 1541 || 1757 == code || 1807 == code || 2274 == code || 3406 == code || 69821 == code || 70082 <= code && code <= 70083 || 72250 == code || 72326 <= code && code <= 72329 || 73030 == code) {
+ return Prepend;
+ }
+ if (13 == code) {
+ return CR;
+ }
+ if (10 == code) {
+ return LF;
+ }
+ if (0 <= code && code <= 9 || 11 <= code && code <= 12 || 14 <= code && code <= 31 || 127 <= code && code <= 159 || 173 == code || 1564 == code || 6158 == code || 8203 == code || 8206 <= code && code <= 8207 || 8232 == code || 8233 == code || 8234 <= code && code <= 8238 || 8288 <= code && code <= 8292 || 8293 == code || 8294 <= code && code <= 8303 || 55296 <= code && code <= 57343 || 65279 == code || 65520 <= code && code <= 65528 || 65529 <= code && code <= 65531 || 113824 <= code && code <= 113827 || 119155 <= code && code <= 119162 || 917504 == code || 917505 == code || 917506 <= code && code <= 917535 || 917632 <= code && code <= 917759 || 918e3 <= code && code <= 921599) {
+ return Control;
+ }
+ if (768 <= code && code <= 879 || 1155 <= code && code <= 1159 || 1160 <= code && code <= 1161 || 1425 <= code && code <= 1469 || 1471 == code || 1473 <= code && code <= 1474 || 1476 <= code && code <= 1477 || 1479 == code || 1552 <= code && code <= 1562 || 1611 <= code && code <= 1631 || 1648 == code || 1750 <= code && code <= 1756 || 1759 <= code && code <= 1764 || 1767 <= code && code <= 1768 || 1770 <= code && code <= 1773 || 1809 == code || 1840 <= code && code <= 1866 || 1958 <= code && code <= 1968 || 2027 <= code && code <= 2035 || 2070 <= code && code <= 2073 || 2075 <= code && code <= 2083 || 2085 <= code && code <= 2087 || 2089 <= code && code <= 2093 || 2137 <= code && code <= 2139 || 2260 <= code && code <= 2273 || 2275 <= code && code <= 2306 || 2362 == code || 2364 == code || 2369 <= code && code <= 2376 || 2381 == code || 2385 <= code && code <= 2391 || 2402 <= code && code <= 2403 || 2433 == code || 2492 == code || 2494 == code || 2497 <= code && code <= 2500 || 2509 == code || 2519 == code || 2530 <= code && code <= 2531 || 2561 <= code && code <= 2562 || 2620 == code || 2625 <= code && code <= 2626 || 2631 <= code && code <= 2632 || 2635 <= code && code <= 2637 || 2641 == code || 2672 <= code && code <= 2673 || 2677 == code || 2689 <= code && code <= 2690 || 2748 == code || 2753 <= code && code <= 2757 || 2759 <= code && code <= 2760 || 2765 == code || 2786 <= code && code <= 2787 || 2810 <= code && code <= 2815 || 2817 == code || 2876 == code || 2878 == code || 2879 == code || 2881 <= code && code <= 2884 || 2893 == code || 2902 == code || 2903 == code || 2914 <= code && code <= 2915 || 2946 == code || 3006 == code || 3008 == code || 3021 == code || 3031 == code || 3072 == code || 3134 <= code && code <= 3136 || 3142 <= code && code <= 3144 || 3146 <= code && code <= 3149 || 3157 <= code && code <= 3158 || 3170 <= code && code <= 3171 || 3201 == code || 3260 == code || 3263 == code || 3266 == code || 3270 == code || 3276 <= code && code <= 3277 || 3285 <= code && code <= 3286 || 3298 <= code && code <= 3299 || 3328 <= code && code <= 3329 || 3387 <= code && code <= 3388 || 3390 == code || 3393 <= code && code <= 3396 || 3405 == code || 3415 == code || 3426 <= code && code <= 3427 || 3530 == code || 3535 == code || 3538 <= code && code <= 3540 || 3542 == code || 3551 == code || 3633 == code || 3636 <= code && code <= 3642 || 3655 <= code && code <= 3662 || 3761 == code || 3764 <= code && code <= 3769 || 3771 <= code && code <= 3772 || 3784 <= code && code <= 3789 || 3864 <= code && code <= 3865 || 3893 == code || 3895 == code || 3897 == code || 3953 <= code && code <= 3966 || 3968 <= code && code <= 3972 || 3974 <= code && code <= 3975 || 3981 <= code && code <= 3991 || 3993 <= code && code <= 4028 || 4038 == code || 4141 <= code && code <= 4144 || 4146 <= code && code <= 4151 || 4153 <= code && code <= 4154 || 4157 <= code && code <= 4158 || 4184 <= code && code <= 4185 || 4190 <= code && code <= 4192 || 4209 <= code && code <= 4212 || 4226 == code || 4229 <= code && code <= 4230 || 4237 == code || 4253 == code || 4957 <= code && code <= 4959 || 5906 <= code && code <= 5908 || 5938 <= code && code <= 5940 || 5970 <= code && code <= 5971 || 6002 <= code && code <= 6003 || 6068 <= code && code <= 6069 || 6071 <= code && code <= 6077 || 6086 == code || 6089 <= code && code <= 6099 || 6109 == code || 6155 <= code && code <= 6157 || 6277 <= code && code <= 6278 || 6313 == code || 6432 <= code && code <= 6434 || 6439 <= code && code <= 6440 || 6450 == code || 6457 <= code && code <= 6459 || 6679 <= code && code <= 6680 || 6683 == code || 6742 == code || 6744 <= code && code <= 6750 || 6752 == code || 6754 == code || 6757 <= code && code <= 6764 || 6771 <= code && code <= 6780 || 6783 == code || 6832 <= code && code <= 6845 || 6846 == code || 6912 <= code && code <= 6915 || 6964 == code || 6966 <= code && code <= 6970 || 6972 == code || 6978 == code || 7019 <= code && code <= 7027 || 7040 <= code && code <= 7041 || 7074 <= code && code <= 7077 || 7080 <= code && code <= 7081 || 7083 <= code && code <= 7085 || 7142 == code || 7144 <= code && code <= 7145 || 7149 == code || 7151 <= code && code <= 7153 || 7212 <= code && code <= 7219 || 7222 <= code && code <= 7223 || 7376 <= code && code <= 7378 || 7380 <= code && code <= 7392 || 7394 <= code && code <= 7400 || 7405 == code || 7412 == code || 7416 <= code && code <= 7417 || 7616 <= code && code <= 7673 || 7675 <= code && code <= 7679 || 8204 == code || 8400 <= code && code <= 8412 || 8413 <= code && code <= 8416 || 8417 == code || 8418 <= code && code <= 8420 || 8421 <= code && code <= 8432 || 11503 <= code && code <= 11505 || 11647 == code || 11744 <= code && code <= 11775 || 12330 <= code && code <= 12333 || 12334 <= code && code <= 12335 || 12441 <= code && code <= 12442 || 42607 == code || 42608 <= code && code <= 42610 || 42612 <= code && code <= 42621 || 42654 <= code && code <= 42655 || 42736 <= code && code <= 42737 || 43010 == code || 43014 == code || 43019 == code || 43045 <= code && code <= 43046 || 43204 <= code && code <= 43205 || 43232 <= code && code <= 43249 || 43302 <= code && code <= 43309 || 43335 <= code && code <= 43345 || 43392 <= code && code <= 43394 || 43443 == code || 43446 <= code && code <= 43449 || 43452 == code || 43493 == code || 43561 <= code && code <= 43566 || 43569 <= code && code <= 43570 || 43573 <= code && code <= 43574 || 43587 == code || 43596 == code || 43644 == code || 43696 == code || 43698 <= code && code <= 43700 || 43703 <= code && code <= 43704 || 43710 <= code && code <= 43711 || 43713 == code || 43756 <= code && code <= 43757 || 43766 == code || 44005 == code || 44008 == code || 44013 == code || 64286 == code || 65024 <= code && code <= 65039 || 65056 <= code && code <= 65071 || 65438 <= code && code <= 65439 || 66045 == code || 66272 == code || 66422 <= code && code <= 66426 || 68097 <= code && code <= 68099 || 68101 <= code && code <= 68102 || 68108 <= code && code <= 68111 || 68152 <= code && code <= 68154 || 68159 == code || 68325 <= code && code <= 68326 || 69633 == code || 69688 <= code && code <= 69702 || 69759 <= code && code <= 69761 || 69811 <= code && code <= 69814 || 69817 <= code && code <= 69818 || 69888 <= code && code <= 69890 || 69927 <= code && code <= 69931 || 69933 <= code && code <= 69940 || 70003 == code || 70016 <= code && code <= 70017 || 70070 <= code && code <= 70078 || 70090 <= code && code <= 70092 || 70191 <= code && code <= 70193 || 70196 == code || 70198 <= code && code <= 70199 || 70206 == code || 70367 == code || 70371 <= code && code <= 70378 || 70400 <= code && code <= 70401 || 70460 == code || 70462 == code || 70464 == code || 70487 == code || 70502 <= code && code <= 70508 || 70512 <= code && code <= 70516 || 70712 <= code && code <= 70719 || 70722 <= code && code <= 70724 || 70726 == code || 70832 == code || 70835 <= code && code <= 70840 || 70842 == code || 70845 == code || 70847 <= code && code <= 70848 || 70850 <= code && code <= 70851 || 71087 == code || 71090 <= code && code <= 71093 || 71100 <= code && code <= 71101 || 71103 <= code && code <= 71104 || 71132 <= code && code <= 71133 || 71219 <= code && code <= 71226 || 71229 == code || 71231 <= code && code <= 71232 || 71339 == code || 71341 == code || 71344 <= code && code <= 71349 || 71351 == code || 71453 <= code && code <= 71455 || 71458 <= code && code <= 71461 || 71463 <= code && code <= 71467 || 72193 <= code && code <= 72198 || 72201 <= code && code <= 72202 || 72243 <= code && code <= 72248 || 72251 <= code && code <= 72254 || 72263 == code || 72273 <= code && code <= 72278 || 72281 <= code && code <= 72283 || 72330 <= code && code <= 72342 || 72344 <= code && code <= 72345 || 72752 <= code && code <= 72758 || 72760 <= code && code <= 72765 || 72767 == code || 72850 <= code && code <= 72871 || 72874 <= code && code <= 72880 || 72882 <= code && code <= 72883 || 72885 <= code && code <= 72886 || 73009 <= code && code <= 73014 || 73018 == code || 73020 <= code && code <= 73021 || 73023 <= code && code <= 73029 || 73031 == code || 92912 <= code && code <= 92916 || 92976 <= code && code <= 92982 || 94095 <= code && code <= 94098 || 113821 <= code && code <= 113822 || 119141 == code || 119143 <= code && code <= 119145 || 119150 <= code && code <= 119154 || 119163 <= code && code <= 119170 || 119173 <= code && code <= 119179 || 119210 <= code && code <= 119213 || 119362 <= code && code <= 119364 || 121344 <= code && code <= 121398 || 121403 <= code && code <= 121452 || 121461 == code || 121476 == code || 121499 <= code && code <= 121503 || 121505 <= code && code <= 121519 || 122880 <= code && code <= 122886 || 122888 <= code && code <= 122904 || 122907 <= code && code <= 122913 || 122915 <= code && code <= 122916 || 122918 <= code && code <= 122922 || 125136 <= code && code <= 125142 || 125252 <= code && code <= 125258 || 917536 <= code && code <= 917631 || 917760 <= code && code <= 917999) {
+ return Extend;
+ }
+ if (127462 <= code && code <= 127487) {
+ return Regional_Indicator;
+ }
+ if (2307 == code || 2363 == code || 2366 <= code && code <= 2368 || 2377 <= code && code <= 2380 || 2382 <= code && code <= 2383 || 2434 <= code && code <= 2435 || 2495 <= code && code <= 2496 || 2503 <= code && code <= 2504 || 2507 <= code && code <= 2508 || 2563 == code || 2622 <= code && code <= 2624 || 2691 == code || 2750 <= code && code <= 2752 || 2761 == code || 2763 <= code && code <= 2764 || 2818 <= code && code <= 2819 || 2880 == code || 2887 <= code && code <= 2888 || 2891 <= code && code <= 2892 || 3007 == code || 3009 <= code && code <= 3010 || 3014 <= code && code <= 3016 || 3018 <= code && code <= 3020 || 3073 <= code && code <= 3075 || 3137 <= code && code <= 3140 || 3202 <= code && code <= 3203 || 3262 == code || 3264 <= code && code <= 3265 || 3267 <= code && code <= 3268 || 3271 <= code && code <= 3272 || 3274 <= code && code <= 3275 || 3330 <= code && code <= 3331 || 3391 <= code && code <= 3392 || 3398 <= code && code <= 3400 || 3402 <= code && code <= 3404 || 3458 <= code && code <= 3459 || 3536 <= code && code <= 3537 || 3544 <= code && code <= 3550 || 3570 <= code && code <= 3571 || 3635 == code || 3763 == code || 3902 <= code && code <= 3903 || 3967 == code || 4145 == code || 4155 <= code && code <= 4156 || 4182 <= code && code <= 4183 || 4228 == code || 6070 == code || 6078 <= code && code <= 6085 || 6087 <= code && code <= 6088 || 6435 <= code && code <= 6438 || 6441 <= code && code <= 6443 || 6448 <= code && code <= 6449 || 6451 <= code && code <= 6456 || 6681 <= code && code <= 6682 || 6741 == code || 6743 == code || 6765 <= code && code <= 6770 || 6916 == code || 6965 == code || 6971 == code || 6973 <= code && code <= 6977 || 6979 <= code && code <= 6980 || 7042 == code || 7073 == code || 7078 <= code && code <= 7079 || 7082 == code || 7143 == code || 7146 <= code && code <= 7148 || 7150 == code || 7154 <= code && code <= 7155 || 7204 <= code && code <= 7211 || 7220 <= code && code <= 7221 || 7393 == code || 7410 <= code && code <= 7411 || 7415 == code || 43043 <= code && code <= 43044 || 43047 == code || 43136 <= code && code <= 43137 || 43188 <= code && code <= 43203 || 43346 <= code && code <= 43347 || 43395 == code || 43444 <= code && code <= 43445 || 43450 <= code && code <= 43451 || 43453 <= code && code <= 43456 || 43567 <= code && code <= 43568 || 43571 <= code && code <= 43572 || 43597 == code || 43755 == code || 43758 <= code && code <= 43759 || 43765 == code || 44003 <= code && code <= 44004 || 44006 <= code && code <= 44007 || 44009 <= code && code <= 44010 || 44012 == code || 69632 == code || 69634 == code || 69762 == code || 69808 <= code && code <= 69810 || 69815 <= code && code <= 69816 || 69932 == code || 70018 == code || 70067 <= code && code <= 70069 || 70079 <= code && code <= 70080 || 70188 <= code && code <= 70190 || 70194 <= code && code <= 70195 || 70197 == code || 70368 <= code && code <= 70370 || 70402 <= code && code <= 70403 || 70463 == code || 70465 <= code && code <= 70468 || 70471 <= code && code <= 70472 || 70475 <= code && code <= 70477 || 70498 <= code && code <= 70499 || 70709 <= code && code <= 70711 || 70720 <= code && code <= 70721 || 70725 == code || 70833 <= code && code <= 70834 || 70841 == code || 70843 <= code && code <= 70844 || 70846 == code || 70849 == code || 71088 <= code && code <= 71089 || 71096 <= code && code <= 71099 || 71102 == code || 71216 <= code && code <= 71218 || 71227 <= code && code <= 71228 || 71230 == code || 71340 == code || 71342 <= code && code <= 71343 || 71350 == code || 71456 <= code && code <= 71457 || 71462 == code || 72199 <= code && code <= 72200 || 72249 == code || 72279 <= code && code <= 72280 || 72343 == code || 72751 == code || 72766 == code || 72873 == code || 72881 == code || 72884 == code || 94033 <= code && code <= 94078 || 119142 == code || 119149 == code) {
+ return SpacingMark;
+ }
+ if (4352 <= code && code <= 4447 || 43360 <= code && code <= 43388) {
+ return L;
+ }
+ if (4448 <= code && code <= 4519 || 55216 <= code && code <= 55238) {
+ return V;
+ }
+ if (4520 <= code && code <= 4607 || 55243 <= code && code <= 55291) {
+ return T;
+ }
+ if (44032 == code || 44060 == code || 44088 == code || 44116 == code || 44144 == code || 44172 == code || 44200 == code || 44228 == code || 44256 == code || 44284 == code || 44312 == code || 44340 == code || 44368 == code || 44396 == code || 44424 == code || 44452 == code || 44480 == code || 44508 == code || 44536 == code || 44564 == code || 44592 == code || 44620 == code || 44648 == code || 44676 == code || 44704 == code || 44732 == code || 44760 == code || 44788 == code || 44816 == code || 44844 == code || 44872 == code || 44900 == code || 44928 == code || 44956 == code || 44984 == code || 45012 == code || 45040 == code || 45068 == code || 45096 == code || 45124 == code || 45152 == code || 45180 == code || 45208 == code || 45236 == code || 45264 == code || 45292 == code || 45320 == code || 45348 == code || 45376 == code || 45404 == code || 45432 == code || 45460 == code || 45488 == code || 45516 == code || 45544 == code || 45572 == code || 45600 == code || 45628 == code || 45656 == code || 45684 == code || 45712 == code || 45740 == code || 45768 == code || 45796 == code || 45824 == code || 45852 == code || 45880 == code || 45908 == code || 45936 == code || 45964 == code || 45992 == code || 46020 == code || 46048 == code || 46076 == code || 46104 == code || 46132 == code || 46160 == code || 46188 == code || 46216 == code || 46244 == code || 46272 == code || 46300 == code || 46328 == code || 46356 == code || 46384 == code || 46412 == code || 46440 == code || 46468 == code || 46496 == code || 46524 == code || 46552 == code || 46580 == code || 46608 == code || 46636 == code || 46664 == code || 46692 == code || 46720 == code || 46748 == code || 46776 == code || 46804 == code || 46832 == code || 46860 == code || 46888 == code || 46916 == code || 46944 == code || 46972 == code || 47e3 == code || 47028 == code || 47056 == code || 47084 == code || 47112 == code || 47140 == code || 47168 == code || 47196 == code || 47224 == code || 47252 == code || 47280 == code || 47308 == code || 47336 == code || 47364 == code || 47392 == code || 47420 == code || 47448 == code || 47476 == code || 47504 == code || 47532 == code || 47560 == code || 47588 == code || 47616 == code || 47644 == code || 47672 == code || 47700 == code || 47728 == code || 47756 == code || 47784 == code || 47812 == code || 47840 == code || 47868 == code || 47896 == code || 47924 == code || 47952 == code || 47980 == code || 48008 == code || 48036 == code || 48064 == code || 48092 == code || 48120 == code || 48148 == code || 48176 == code || 48204 == code || 48232 == code || 48260 == code || 48288 == code || 48316 == code || 48344 == code || 48372 == code || 48400 == code || 48428 == code || 48456 == code || 48484 == code || 48512 == code || 48540 == code || 48568 == code || 48596 == code || 48624 == code || 48652 == code || 48680 == code || 48708 == code || 48736 == code || 48764 == code || 48792 == code || 48820 == code || 48848 == code || 48876 == code || 48904 == code || 48932 == code || 48960 == code || 48988 == code || 49016 == code || 49044 == code || 49072 == code || 49100 == code || 49128 == code || 49156 == code || 49184 == code || 49212 == code || 49240 == code || 49268 == code || 49296 == code || 49324 == code || 49352 == code || 49380 == code || 49408 == code || 49436 == code || 49464 == code || 49492 == code || 49520 == code || 49548 == code || 49576 == code || 49604 == code || 49632 == code || 49660 == code || 49688 == code || 49716 == code || 49744 == code || 49772 == code || 49800 == code || 49828 == code || 49856 == code || 49884 == code || 49912 == code || 49940 == code || 49968 == code || 49996 == code || 50024 == code || 50052 == code || 50080 == code || 50108 == code || 50136 == code || 50164 == code || 50192 == code || 50220 == code || 50248 == code || 50276 == code || 50304 == code || 50332 == code || 50360 == code || 50388 == code || 50416 == code || 50444 == code || 50472 == code || 50500 == code || 50528 == code || 50556 == code || 50584 == code || 50612 == code || 50640 == code || 50668 == code || 50696 == code || 50724 == code || 50752 == code || 50780 == code || 50808 == code || 50836 == code || 50864 == code || 50892 == code || 50920 == code || 50948 == code || 50976 == code || 51004 == code || 51032 == code || 51060 == code || 51088 == code || 51116 == code || 51144 == code || 51172 == code || 51200 == code || 51228 == code || 51256 == code || 51284 == code || 51312 == code || 51340 == code || 51368 == code || 51396 == code || 51424 == code || 51452 == code || 51480 == code || 51508 == code || 51536 == code || 51564 == code || 51592 == code || 51620 == code || 51648 == code || 51676 == code || 51704 == code || 51732 == code || 51760 == code || 51788 == code || 51816 == code || 51844 == code || 51872 == code || 51900 == code || 51928 == code || 51956 == code || 51984 == code || 52012 == code || 52040 == code || 52068 == code || 52096 == code || 52124 == code || 52152 == code || 52180 == code || 52208 == code || 52236 == code || 52264 == code || 52292 == code || 52320 == code || 52348 == code || 52376 == code || 52404 == code || 52432 == code || 52460 == code || 52488 == code || 52516 == code || 52544 == code || 52572 == code || 52600 == code || 52628 == code || 52656 == code || 52684 == code || 52712 == code || 52740 == code || 52768 == code || 52796 == code || 52824 == code || 52852 == code || 52880 == code || 52908 == code || 52936 == code || 52964 == code || 52992 == code || 53020 == code || 53048 == code || 53076 == code || 53104 == code || 53132 == code || 53160 == code || 53188 == code || 53216 == code || 53244 == code || 53272 == code || 53300 == code || 53328 == code || 53356 == code || 53384 == code || 53412 == code || 53440 == code || 53468 == code || 53496 == code || 53524 == code || 53552 == code || 53580 == code || 53608 == code || 53636 == code || 53664 == code || 53692 == code || 53720 == code || 53748 == code || 53776 == code || 53804 == code || 53832 == code || 53860 == code || 53888 == code || 53916 == code || 53944 == code || 53972 == code || 54e3 == code || 54028 == code || 54056 == code || 54084 == code || 54112 == code || 54140 == code || 54168 == code || 54196 == code || 54224 == code || 54252 == code || 54280 == code || 54308 == code || 54336 == code || 54364 == code || 54392 == code || 54420 == code || 54448 == code || 54476 == code || 54504 == code || 54532 == code || 54560 == code || 54588 == code || 54616 == code || 54644 == code || 54672 == code || 54700 == code || 54728 == code || 54756 == code || 54784 == code || 54812 == code || 54840 == code || 54868 == code || 54896 == code || 54924 == code || 54952 == code || 54980 == code || 55008 == code || 55036 == code || 55064 == code || 55092 == code || 55120 == code || 55148 == code || 55176 == code) {
+ return LV;
+ }
+ if (44033 <= code && code <= 44059 || 44061 <= code && code <= 44087 || 44089 <= code && code <= 44115 || 44117 <= code && code <= 44143 || 44145 <= code && code <= 44171 || 44173 <= code && code <= 44199 || 44201 <= code && code <= 44227 || 44229 <= code && code <= 44255 || 44257 <= code && code <= 44283 || 44285 <= code && code <= 44311 || 44313 <= code && code <= 44339 || 44341 <= code && code <= 44367 || 44369 <= code && code <= 44395 || 44397 <= code && code <= 44423 || 44425 <= code && code <= 44451 || 44453 <= code && code <= 44479 || 44481 <= code && code <= 44507 || 44509 <= code && code <= 44535 || 44537 <= code && code <= 44563 || 44565 <= code && code <= 44591 || 44593 <= code && code <= 44619 || 44621 <= code && code <= 44647 || 44649 <= code && code <= 44675 || 44677 <= code && code <= 44703 || 44705 <= code && code <= 44731 || 44733 <= code && code <= 44759 || 44761 <= code && code <= 44787 || 44789 <= code && code <= 44815 || 44817 <= code && code <= 44843 || 44845 <= code && code <= 44871 || 44873 <= code && code <= 44899 || 44901 <= code && code <= 44927 || 44929 <= code && code <= 44955 || 44957 <= code && code <= 44983 || 44985 <= code && code <= 45011 || 45013 <= code && code <= 45039 || 45041 <= code && code <= 45067 || 45069 <= code && code <= 45095 || 45097 <= code && code <= 45123 || 45125 <= code && code <= 45151 || 45153 <= code && code <= 45179 || 45181 <= code && code <= 45207 || 45209 <= code && code <= 45235 || 45237 <= code && code <= 45263 || 45265 <= code && code <= 45291 || 45293 <= code && code <= 45319 || 45321 <= code && code <= 45347 || 45349 <= code && code <= 45375 || 45377 <= code && code <= 45403 || 45405 <= code && code <= 45431 || 45433 <= code && code <= 45459 || 45461 <= code && code <= 45487 || 45489 <= code && code <= 45515 || 45517 <= code && code <= 45543 || 45545 <= code && code <= 45571 || 45573 <= code && code <= 45599 || 45601 <= code && code <= 45627 || 45629 <= code && code <= 45655 || 45657 <= code && code <= 45683 || 45685 <= code && code <= 45711 || 45713 <= code && code <= 45739 || 45741 <= code && code <= 45767 || 45769 <= code && code <= 45795 || 45797 <= code && code <= 45823 || 45825 <= code && code <= 45851 || 45853 <= code && code <= 45879 || 45881 <= code && code <= 45907 || 45909 <= code && code <= 45935 || 45937 <= code && code <= 45963 || 45965 <= code && code <= 45991 || 45993 <= code && code <= 46019 || 46021 <= code && code <= 46047 || 46049 <= code && code <= 46075 || 46077 <= code && code <= 46103 || 46105 <= code && code <= 46131 || 46133 <= code && code <= 46159 || 46161 <= code && code <= 46187 || 46189 <= code && code <= 46215 || 46217 <= code && code <= 46243 || 46245 <= code && code <= 46271 || 46273 <= code && code <= 46299 || 46301 <= code && code <= 46327 || 46329 <= code && code <= 46355 || 46357 <= code && code <= 46383 || 46385 <= code && code <= 46411 || 46413 <= code && code <= 46439 || 46441 <= code && code <= 46467 || 46469 <= code && code <= 46495 || 46497 <= code && code <= 46523 || 46525 <= code && code <= 46551 || 46553 <= code && code <= 46579 || 46581 <= code && code <= 46607 || 46609 <= code && code <= 46635 || 46637 <= code && code <= 46663 || 46665 <= code && code <= 46691 || 46693 <= code && code <= 46719 || 46721 <= code && code <= 46747 || 46749 <= code && code <= 46775 || 46777 <= code && code <= 46803 || 46805 <= code && code <= 46831 || 46833 <= code && code <= 46859 || 46861 <= code && code <= 46887 || 46889 <= code && code <= 46915 || 46917 <= code && code <= 46943 || 46945 <= code && code <= 46971 || 46973 <= code && code <= 46999 || 47001 <= code && code <= 47027 || 47029 <= code && code <= 47055 || 47057 <= code && code <= 47083 || 47085 <= code && code <= 47111 || 47113 <= code && code <= 47139 || 47141 <= code && code <= 47167 || 47169 <= code && code <= 47195 || 47197 <= code && code <= 47223 || 47225 <= code && code <= 47251 || 47253 <= code && code <= 47279 || 47281 <= code && code <= 47307 || 47309 <= code && code <= 47335 || 47337 <= code && code <= 47363 || 47365 <= code && code <= 47391 || 47393 <= code && code <= 47419 || 47421 <= code && code <= 47447 || 47449 <= code && code <= 47475 || 47477 <= code && code <= 47503 || 47505 <= code && code <= 47531 || 47533 <= code && code <= 47559 || 47561 <= code && code <= 47587 || 47589 <= code && code <= 47615 || 47617 <= code && code <= 47643 || 47645 <= code && code <= 47671 || 47673 <= code && code <= 47699 || 47701 <= code && code <= 47727 || 47729 <= code && code <= 47755 || 47757 <= code && code <= 47783 || 47785 <= code && code <= 47811 || 47813 <= code && code <= 47839 || 47841 <= code && code <= 47867 || 47869 <= code && code <= 47895 || 47897 <= code && code <= 47923 || 47925 <= code && code <= 47951 || 47953 <= code && code <= 47979 || 47981 <= code && code <= 48007 || 48009 <= code && code <= 48035 || 48037 <= code && code <= 48063 || 48065 <= code && code <= 48091 || 48093 <= code && code <= 48119 || 48121 <= code && code <= 48147 || 48149 <= code && code <= 48175 || 48177 <= code && code <= 48203 || 48205 <= code && code <= 48231 || 48233 <= code && code <= 48259 || 48261 <= code && code <= 48287 || 48289 <= code && code <= 48315 || 48317 <= code && code <= 48343 || 48345 <= code && code <= 48371 || 48373 <= code && code <= 48399 || 48401 <= code && code <= 48427 || 48429 <= code && code <= 48455 || 48457 <= code && code <= 48483 || 48485 <= code && code <= 48511 || 48513 <= code && code <= 48539 || 48541 <= code && code <= 48567 || 48569 <= code && code <= 48595 || 48597 <= code && code <= 48623 || 48625 <= code && code <= 48651 || 48653 <= code && code <= 48679 || 48681 <= code && code <= 48707 || 48709 <= code && code <= 48735 || 48737 <= code && code <= 48763 || 48765 <= code && code <= 48791 || 48793 <= code && code <= 48819 || 48821 <= code && code <= 48847 || 48849 <= code && code <= 48875 || 48877 <= code && code <= 48903 || 48905 <= code && code <= 48931 || 48933 <= code && code <= 48959 || 48961 <= code && code <= 48987 || 48989 <= code && code <= 49015 || 49017 <= code && code <= 49043 || 49045 <= code && code <= 49071 || 49073 <= code && code <= 49099 || 49101 <= code && code <= 49127 || 49129 <= code && code <= 49155 || 49157 <= code && code <= 49183 || 49185 <= code && code <= 49211 || 49213 <= code && code <= 49239 || 49241 <= code && code <= 49267 || 49269 <= code && code <= 49295 || 49297 <= code && code <= 49323 || 49325 <= code && code <= 49351 || 49353 <= code && code <= 49379 || 49381 <= code && code <= 49407 || 49409 <= code && code <= 49435 || 49437 <= code && code <= 49463 || 49465 <= code && code <= 49491 || 49493 <= code && code <= 49519 || 49521 <= code && code <= 49547 || 49549 <= code && code <= 49575 || 49577 <= code && code <= 49603 || 49605 <= code && code <= 49631 || 49633 <= code && code <= 49659 || 49661 <= code && code <= 49687 || 49689 <= code && code <= 49715 || 49717 <= code && code <= 49743 || 49745 <= code && code <= 49771 || 49773 <= code && code <= 49799 || 49801 <= code && code <= 49827 || 49829 <= code && code <= 49855 || 49857 <= code && code <= 49883 || 49885 <= code && code <= 49911 || 49913 <= code && code <= 49939 || 49941 <= code && code <= 49967 || 49969 <= code && code <= 49995 || 49997 <= code && code <= 50023 || 50025 <= code && code <= 50051 || 50053 <= code && code <= 50079 || 50081 <= code && code <= 50107 || 50109 <= code && code <= 50135 || 50137 <= code && code <= 50163 || 50165 <= code && code <= 50191 || 50193 <= code && code <= 50219 || 50221 <= code && code <= 50247 || 50249 <= code && code <= 50275 || 50277 <= code && code <= 50303 || 50305 <= code && code <= 50331 || 50333 <= code && code <= 50359 || 50361 <= code && code <= 50387 || 50389 <= code && code <= 50415 || 50417 <= code && code <= 50443 || 50445 <= code && code <= 50471 || 50473 <= code && code <= 50499 || 50501 <= code && code <= 50527 || 50529 <= code && code <= 50555 || 50557 <= code && code <= 50583 || 50585 <= code && code <= 50611 || 50613 <= code && code <= 50639 || 50641 <= code && code <= 50667 || 50669 <= code && code <= 50695 || 50697 <= code && code <= 50723 || 50725 <= code && code <= 50751 || 50753 <= code && code <= 50779 || 50781 <= code && code <= 50807 || 50809 <= code && code <= 50835 || 50837 <= code && code <= 50863 || 50865 <= code && code <= 50891 || 50893 <= code && code <= 50919 || 50921 <= code && code <= 50947 || 50949 <= code && code <= 50975 || 50977 <= code && code <= 51003 || 51005 <= code && code <= 51031 || 51033 <= code && code <= 51059 || 51061 <= code && code <= 51087 || 51089 <= code && code <= 51115 || 51117 <= code && code <= 51143 || 51145 <= code && code <= 51171 || 51173 <= code && code <= 51199 || 51201 <= code && code <= 51227 || 51229 <= code && code <= 51255 || 51257 <= code && code <= 51283 || 51285 <= code && code <= 51311 || 51313 <= code && code <= 51339 || 51341 <= code && code <= 51367 || 51369 <= code && code <= 51395 || 51397 <= code && code <= 51423 || 51425 <= code && code <= 51451 || 51453 <= code && code <= 51479 || 51481 <= code && code <= 51507 || 51509 <= code && code <= 51535 || 51537 <= code && code <= 51563 || 51565 <= code && code <= 51591 || 51593 <= code && code <= 51619 || 51621 <= code && code <= 51647 || 51649 <= code && code <= 51675 || 51677 <= code && code <= 51703 || 51705 <= code && code <= 51731 || 51733 <= code && code <= 51759 || 51761 <= code && code <= 51787 || 51789 <= code && code <= 51815 || 51817 <= code && code <= 51843 || 51845 <= code && code <= 51871 || 51873 <= code && code <= 51899 || 51901 <= code && code <= 51927 || 51929 <= code && code <= 51955 || 51957 <= code && code <= 51983 || 51985 <= code && code <= 52011 || 52013 <= code && code <= 52039 || 52041 <= code && code <= 52067 || 52069 <= code && code <= 52095 || 52097 <= code && code <= 52123 || 52125 <= code && code <= 52151 || 52153 <= code && code <= 52179 || 52181 <= code && code <= 52207 || 52209 <= code && code <= 52235 || 52237 <= code && code <= 52263 || 52265 <= code && code <= 52291 || 52293 <= code && code <= 52319 || 52321 <= code && code <= 52347 || 52349 <= code && code <= 52375 || 52377 <= code && code <= 52403 || 52405 <= code && code <= 52431 || 52433 <= code && code <= 52459 || 52461 <= code && code <= 52487 || 52489 <= code && code <= 52515 || 52517 <= code && code <= 52543 || 52545 <= code && code <= 52571 || 52573 <= code && code <= 52599 || 52601 <= code && code <= 52627 || 52629 <= code && code <= 52655 || 52657 <= code && code <= 52683 || 52685 <= code && code <= 52711 || 52713 <= code && code <= 52739 || 52741 <= code && code <= 52767 || 52769 <= code && code <= 52795 || 52797 <= code && code <= 52823 || 52825 <= code && code <= 52851 || 52853 <= code && code <= 52879 || 52881 <= code && code <= 52907 || 52909 <= code && code <= 52935 || 52937 <= code && code <= 52963 || 52965 <= code && code <= 52991 || 52993 <= code && code <= 53019 || 53021 <= code && code <= 53047 || 53049 <= code && code <= 53075 || 53077 <= code && code <= 53103 || 53105 <= code && code <= 53131 || 53133 <= code && code <= 53159 || 53161 <= code && code <= 53187 || 53189 <= code && code <= 53215 || 53217 <= code && code <= 53243 || 53245 <= code && code <= 53271 || 53273 <= code && code <= 53299 || 53301 <= code && code <= 53327 || 53329 <= code && code <= 53355 || 53357 <= code && code <= 53383 || 53385 <= code && code <= 53411 || 53413 <= code && code <= 53439 || 53441 <= code && code <= 53467 || 53469 <= code && code <= 53495 || 53497 <= code && code <= 53523 || 53525 <= code && code <= 53551 || 53553 <= code && code <= 53579 || 53581 <= code && code <= 53607 || 53609 <= code && code <= 53635 || 53637 <= code && code <= 53663 || 53665 <= code && code <= 53691 || 53693 <= code && code <= 53719 || 53721 <= code && code <= 53747 || 53749 <= code && code <= 53775 || 53777 <= code && code <= 53803 || 53805 <= code && code <= 53831 || 53833 <= code && code <= 53859 || 53861 <= code && code <= 53887 || 53889 <= code && code <= 53915 || 53917 <= code && code <= 53943 || 53945 <= code && code <= 53971 || 53973 <= code && code <= 53999 || 54001 <= code && code <= 54027 || 54029 <= code && code <= 54055 || 54057 <= code && code <= 54083 || 54085 <= code && code <= 54111 || 54113 <= code && code <= 54139 || 54141 <= code && code <= 54167 || 54169 <= code && code <= 54195 || 54197 <= code && code <= 54223 || 54225 <= code && code <= 54251 || 54253 <= code && code <= 54279 || 54281 <= code && code <= 54307 || 54309 <= code && code <= 54335 || 54337 <= code && code <= 54363 || 54365 <= code && code <= 54391 || 54393 <= code && code <= 54419 || 54421 <= code && code <= 54447 || 54449 <= code && code <= 54475 || 54477 <= code && code <= 54503 || 54505 <= code && code <= 54531 || 54533 <= code && code <= 54559 || 54561 <= code && code <= 54587 || 54589 <= code && code <= 54615 || 54617 <= code && code <= 54643 || 54645 <= code && code <= 54671 || 54673 <= code && code <= 54699 || 54701 <= code && code <= 54727 || 54729 <= code && code <= 54755 || 54757 <= code && code <= 54783 || 54785 <= code && code <= 54811 || 54813 <= code && code <= 54839 || 54841 <= code && code <= 54867 || 54869 <= code && code <= 54895 || 54897 <= code && code <= 54923 || 54925 <= code && code <= 54951 || 54953 <= code && code <= 54979 || 54981 <= code && code <= 55007 || 55009 <= code && code <= 55035 || 55037 <= code && code <= 55063 || 55065 <= code && code <= 55091 || 55093 <= code && code <= 55119 || 55121 <= code && code <= 55147 || 55149 <= code && code <= 55175 || 55177 <= code && code <= 55203) {
+ return LVT;
+ }
+ if (9757 == code || 9977 == code || 9994 <= code && code <= 9997 || 127877 == code || 127938 <= code && code <= 127940 || 127943 == code || 127946 <= code && code <= 127948 || 128066 <= code && code <= 128067 || 128070 <= code && code <= 128080 || 128110 == code || 128112 <= code && code <= 128120 || 128124 == code || 128129 <= code && code <= 128131 || 128133 <= code && code <= 128135 || 128170 == code || 128372 <= code && code <= 128373 || 128378 == code || 128400 == code || 128405 <= code && code <= 128406 || 128581 <= code && code <= 128583 || 128587 <= code && code <= 128591 || 128675 == code || 128692 <= code && code <= 128694 || 128704 == code || 128716 == code || 129304 <= code && code <= 129308 || 129310 <= code && code <= 129311 || 129318 == code || 129328 <= code && code <= 129337 || 129341 <= code && code <= 129342 || 129489 <= code && code <= 129501) {
+ return E_Base;
+ }
+ if (127995 <= code && code <= 127999) {
+ return E_Modifier;
+ }
+ if (8205 == code) {
+ return ZWJ;
+ }
+ if (9792 == code || 9794 == code || 9877 <= code && code <= 9878 || 9992 == code || 10084 == code || 127752 == code || 127806 == code || 127859 == code || 127891 == code || 127908 == code || 127912 == code || 127979 == code || 127981 == code || 128139 == code || 128187 <= code && code <= 128188 || 128295 == code || 128300 == code || 128488 == code || 128640 == code || 128658 == code) {
+ return Glue_After_Zwj;
+ }
+ if (128102 <= code && code <= 128105) {
+ return E_Base_GAZ;
+ }
+ return Other;
+ }
+ return this;
+ }
+ if (typeof module2 != "undefined" && module2.exports) {
+ module2.exports = GraphemeSplitter2;
+ }
+ }
+});
+
+// node_modules/earcut/src/earcut.js
+var require_earcut = __commonJS({
+ "node_modules/earcut/src/earcut.js"(exports2, module2) {
+ "use strict";
+ module2.exports = earcut2;
+ module2.exports.default = earcut2;
+ function earcut2(data, holeIndices, dim) {
+ dim = dim || 2;
+ var hasHoles = holeIndices && holeIndices.length, outerLen = hasHoles ? holeIndices[0] * dim : data.length, outerNode = linkedList(data, 0, outerLen, dim, true), triangles = [];
+ if (!outerNode || outerNode.next === outerNode.prev)
+ return triangles;
+ var minX, minY, maxX, maxY, x, y, invSize;
+ if (hasHoles)
+ outerNode = eliminateHoles(data, holeIndices, outerNode, dim);
+ if (data.length > 80 * dim) {
+ minX = maxX = data[0];
+ minY = maxY = data[1];
+ for (var i = dim; i < outerLen; i += dim) {
+ x = data[i];
+ y = data[i + 1];
+ if (x < minX)
+ minX = x;
+ if (y < minY)
+ minY = y;
+ if (x > maxX)
+ maxX = x;
+ if (y > maxY)
+ maxY = y;
+ }
+ invSize = Math.max(maxX - minX, maxY - minY);
+ invSize = invSize !== 0 ? 32767 / invSize : 0;
+ }
+ earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);
+ return triangles;
+ }
+ function linkedList(data, start, end, dim, clockwise) {
+ var i, last;
+ if (clockwise === signedArea(data, start, end, dim) > 0) {
+ for (i = start; i < end; i += dim)
+ last = insertNode(i, data[i], data[i + 1], last);
+ } else {
+ for (i = end - dim; i >= start; i -= dim)
+ last = insertNode(i, data[i], data[i + 1], last);
+ }
+ if (last && equals(last, last.next)) {
+ removeNode(last);
+ last = last.next;
+ }
+ return last;
+ }
+ function filterPoints(start, end) {
+ if (!start)
+ return start;
+ if (!end)
+ end = start;
+ var p = start, again;
+ do {
+ again = false;
+ if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
+ removeNode(p);
+ p = end = p.prev;
+ if (p === p.next)
+ break;
+ again = true;
+ } else {
+ p = p.next;
+ }
+ } while (again || p !== end);
+ return end;
+ }
+ function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {
+ if (!ear)
+ return;
+ if (!pass && invSize)
+ indexCurve(ear, minX, minY, invSize);
+ var stop2 = ear, prev, next;
+ while (ear.prev !== ear.next) {
+ prev = ear.prev;
+ next = ear.next;
+ if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
+ triangles.push(prev.i / dim | 0);
+ triangles.push(ear.i / dim | 0);
+ triangles.push(next.i / dim | 0);
+ removeNode(ear);
+ ear = next.next;
+ stop2 = next.next;
+ continue;
+ }
+ ear = next;
+ if (ear === stop2) {
+ if (!pass) {
+ earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);
+ } else if (pass === 1) {
+ ear = cureLocalIntersections(filterPoints(ear), triangles, dim);
+ earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);
+ } else if (pass === 2) {
+ splitEarcut(ear, triangles, dim, minX, minY, invSize);
+ }
+ break;
+ }
+ }
+ }
+ function isEar(ear) {
+ var a3 = ear.prev, b = ear, c = ear.next;
+ if (area(a3, b, c) >= 0)
+ return false;
+ var ax = a3.x, bx = b.x, cx = c.x, ay = a3.y, by = b.y, cy = c.y;
+ var x0 = ax < bx ? ax < cx ? ax : cx : bx < cx ? bx : cx, y0 = ay < by ? ay < cy ? ay : cy : by < cy ? by : cy, x1 = ax > bx ? ax > cx ? ax : cx : bx > cx ? bx : cx, y1 = ay > by ? ay > cy ? ay : cy : by > cy ? by : cy;
+ var p = c.next;
+ while (p !== a3) {
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0)
+ return false;
+ p = p.next;
+ }
+ return true;
+ }
+ function isEarHashed(ear, minX, minY, invSize) {
+ var a3 = ear.prev, b = ear, c = ear.next;
+ if (area(a3, b, c) >= 0)
+ return false;
+ var ax = a3.x, bx = b.x, cx = c.x, ay = a3.y, by = b.y, cy = c.y;
+ var x0 = ax < bx ? ax < cx ? ax : cx : bx < cx ? bx : cx, y0 = ay < by ? ay < cy ? ay : cy : by < cy ? by : cy, x1 = ax > bx ? ax > cx ? ax : cx : bx > cx ? bx : cx, y1 = ay > by ? ay > cy ? ay : cy : by > cy ? by : cy;
+ var minZ = zOrder(x0, y0, minX, minY, invSize), maxZ = zOrder(x1, y1, minX, minY, invSize);
+ var p = ear.prevZ, n = ear.nextZ;
+ while (p && p.z >= minZ && n && n.z <= maxZ) {
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a3 && p !== c && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0)
+ return false;
+ p = p.prevZ;
+ if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a3 && n !== c && pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0)
+ return false;
+ n = n.nextZ;
+ }
+ while (p && p.z >= minZ) {
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a3 && p !== c && pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0)
+ return false;
+ p = p.prevZ;
+ }
+ while (n && n.z <= maxZ) {
+ if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a3 && n !== c && pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0)
+ return false;
+ n = n.nextZ;
+ }
+ return true;
+ }
+ function cureLocalIntersections(start, triangles, dim) {
+ var p = start;
+ do {
+ var a3 = p.prev, b = p.next.next;
+ if (!equals(a3, b) && intersects(a3, p, p.next, b) && locallyInside(a3, b) && locallyInside(b, a3)) {
+ triangles.push(a3.i / dim | 0);
+ triangles.push(p.i / dim | 0);
+ triangles.push(b.i / dim | 0);
+ removeNode(p);
+ removeNode(p.next);
+ p = start = b;
+ }
+ p = p.next;
+ } while (p !== start);
+ return filterPoints(p);
+ }
+ function splitEarcut(start, triangles, dim, minX, minY, invSize) {
+ var a3 = start;
+ do {
+ var b = a3.next.next;
+ while (b !== a3.prev) {
+ if (a3.i !== b.i && isValidDiagonal(a3, b)) {
+ var c = splitPolygon(a3, b);
+ a3 = filterPoints(a3, a3.next);
+ c = filterPoints(c, c.next);
+ earcutLinked(a3, triangles, dim, minX, minY, invSize, 0);
+ earcutLinked(c, triangles, dim, minX, minY, invSize, 0);
+ return;
+ }
+ b = b.next;
+ }
+ a3 = a3.next;
+ } while (a3 !== start);
+ }
+ function eliminateHoles(data, holeIndices, outerNode, dim) {
+ var queue = [], i, len, start, end, list;
+ for (i = 0, len = holeIndices.length; i < len; i++) {
+ start = holeIndices[i] * dim;
+ end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
+ list = linkedList(data, start, end, dim, false);
+ if (list === list.next)
+ list.steiner = true;
+ queue.push(getLeftmost(list));
+ }
+ queue.sort(compareX);
+ for (i = 0; i < queue.length; i++) {
+ outerNode = eliminateHole(queue[i], outerNode);
+ }
+ return outerNode;
+ }
+ function compareX(a3, b) {
+ return a3.x - b.x;
+ }
+ function eliminateHole(hole, outerNode) {
+ var bridge = findHoleBridge(hole, outerNode);
+ if (!bridge) {
+ return outerNode;
+ }
+ var bridgeReverse = splitPolygon(bridge, hole);
+ filterPoints(bridgeReverse, bridgeReverse.next);
+ return filterPoints(bridge, bridge.next);
+ }
+ function findHoleBridge(hole, outerNode) {
+ var p = outerNode, hx = hole.x, hy = hole.y, qx = -Infinity, m;
+ do {
+ if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {
+ var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
+ if (x <= hx && x > qx) {
+ qx = x;
+ m = p.x < p.next.x ? p : p.next;
+ if (x === hx)
+ return m;
+ }
+ }
+ p = p.next;
+ } while (p !== outerNode);
+ if (!m)
+ return null;
+ var stop2 = m, mx = m.x, my = m.y, tanMin = Infinity, tan;
+ p = m;
+ do {
+ if (hx >= p.x && p.x >= mx && hx !== p.x && pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {
+ tan = Math.abs(hy - p.y) / (hx - p.x);
+ if (locallyInside(p, hole) && (tan < tanMin || tan === tanMin && (p.x > m.x || p.x === m.x && sectorContainsSector(m, p)))) {
+ m = p;
+ tanMin = tan;
+ }
+ }
+ p = p.next;
+ } while (p !== stop2);
+ return m;
+ }
+ function sectorContainsSector(m, p) {
+ return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;
+ }
+ function indexCurve(start, minX, minY, invSize) {
+ var p = start;
+ do {
+ if (p.z === 0)
+ p.z = zOrder(p.x, p.y, minX, minY, invSize);
+ p.prevZ = p.prev;
+ p.nextZ = p.next;
+ p = p.next;
+ } while (p !== start);
+ p.prevZ.nextZ = null;
+ p.prevZ = null;
+ sortLinked(p);
+ }
+ function sortLinked(list) {
+ var i, p, q, e, tail, numMerges, pSize, qSize, inSize = 1;
+ do {
+ p = list;
+ list = null;
+ tail = null;
+ numMerges = 0;
+ while (p) {
+ numMerges++;
+ q = p;
+ pSize = 0;
+ for (i = 0; i < inSize; i++) {
+ pSize++;
+ q = q.nextZ;
+ if (!q)
+ break;
+ }
+ qSize = inSize;
+ while (pSize > 0 || qSize > 0 && q) {
+ if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {
+ e = p;
+ p = p.nextZ;
+ pSize--;
+ } else {
+ e = q;
+ q = q.nextZ;
+ qSize--;
+ }
+ if (tail)
+ tail.nextZ = e;
+ else
+ list = e;
+ e.prevZ = tail;
+ tail = e;
+ }
+ p = q;
+ }
+ tail.nextZ = null;
+ inSize *= 2;
+ } while (numMerges > 1);
+ return list;
+ }
+ function zOrder(x, y, minX, minY, invSize) {
+ x = (x - minX) * invSize | 0;
+ y = (y - minY) * invSize | 0;
+ x = (x | x << 8) & 16711935;
+ x = (x | x << 4) & 252645135;
+ x = (x | x << 2) & 858993459;
+ x = (x | x << 1) & 1431655765;
+ y = (y | y << 8) & 16711935;
+ y = (y | y << 4) & 252645135;
+ y = (y | y << 2) & 858993459;
+ y = (y | y << 1) & 1431655765;
+ return x | y << 1;
+ }
+ function getLeftmost(start) {
+ var p = start, leftmost = start;
+ do {
+ if (p.x < leftmost.x || p.x === leftmost.x && p.y < leftmost.y)
+ leftmost = p;
+ p = p.next;
+ } while (p !== start);
+ return leftmost;
+ }
+ function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
+ return (cx - px) * (ay - py) >= (ax - px) * (cy - py) && (ax - px) * (by - py) >= (bx - px) * (ay - py) && (bx - px) * (cy - py) >= (cx - px) * (by - py);
+ }
+ function isValidDiagonal(a3, b) {
+ return a3.next.i !== b.i && a3.prev.i !== b.i && !intersectsPolygon(a3, b) && (locallyInside(a3, b) && locallyInside(b, a3) && middleInside(a3, b) && (area(a3.prev, a3, b.prev) || area(a3, b.prev, b)) || equals(a3, b) && area(a3.prev, a3, a3.next) > 0 && area(b.prev, b, b.next) > 0);
+ }
+ function area(p, q, r) {
+ return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
+ }
+ function equals(p1, p2) {
+ return p1.x === p2.x && p1.y === p2.y;
+ }
+ function intersects(p1, q12, p2, q22) {
+ var o1 = sign2(area(p1, q12, p2));
+ var o2 = sign2(area(p1, q12, q22));
+ var o3 = sign2(area(p2, q22, p1));
+ var o4 = sign2(area(p2, q22, q12));
+ if (o1 !== o2 && o3 !== o4)
+ return true;
+ if (o1 === 0 && onSegment(p1, p2, q12))
+ return true;
+ if (o2 === 0 && onSegment(p1, q22, q12))
+ return true;
+ if (o3 === 0 && onSegment(p2, p1, q22))
+ return true;
+ if (o4 === 0 && onSegment(p2, q12, q22))
+ return true;
+ return false;
+ }
+ function onSegment(p, q, r) {
+ return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);
+ }
+ function sign2(num) {
+ return num > 0 ? 1 : num < 0 ? -1 : 0;
+ }
+ function intersectsPolygon(a3, b) {
+ var p = a3;
+ do {
+ if (p.i !== a3.i && p.next.i !== a3.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a3, b))
+ return true;
+ p = p.next;
+ } while (p !== a3);
+ return false;
+ }
+ function locallyInside(a3, b) {
+ return area(a3.prev, a3, a3.next) < 0 ? area(a3, b, a3.next) >= 0 && area(a3, a3.prev, b) >= 0 : area(a3, b, a3.prev) < 0 || area(a3, a3.next, b) < 0;
+ }
+ function middleInside(a3, b) {
+ var p = a3, inside = false, px = (a3.x + b.x) / 2, py = (a3.y + b.y) / 2;
+ do {
+ if (p.y > py !== p.next.y > py && p.next.y !== p.y && px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)
+ inside = !inside;
+ p = p.next;
+ } while (p !== a3);
+ return inside;
+ }
+ function splitPolygon(a3, b) {
+ var a22 = new Node6(a3.i, a3.x, a3.y), b2 = new Node6(b.i, b.x, b.y), an = a3.next, bp = b.prev;
+ a3.next = b;
+ b.prev = a3;
+ a22.next = an;
+ an.prev = a22;
+ b2.next = a22;
+ a22.prev = b2;
+ bp.next = b2;
+ b2.prev = bp;
+ return b2;
+ }
+ function insertNode(i, x, y, last) {
+ var p = new Node6(i, x, y);
+ if (!last) {
+ p.prev = p;
+ p.next = p;
+ } else {
+ p.next = last.next;
+ p.prev = last;
+ last.next.prev = p;
+ last.next = p;
+ }
+ return p;
+ }
+ function removeNode(p) {
+ p.next.prev = p.prev;
+ p.prev.next = p.next;
+ if (p.prevZ)
+ p.prevZ.nextZ = p.nextZ;
+ if (p.nextZ)
+ p.nextZ.prevZ = p.prevZ;
+ }
+ function Node6(i, x, y) {
+ this.i = i;
+ this.x = x;
+ this.y = y;
+ this.prev = null;
+ this.next = null;
+ this.z = 0;
+ this.prevZ = null;
+ this.nextZ = null;
+ this.steiner = false;
+ }
+ earcut2.deviation = function(data, holeIndices, dim, triangles) {
+ var hasHoles = holeIndices && holeIndices.length;
+ var outerLen = hasHoles ? holeIndices[0] * dim : data.length;
+ var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));
+ if (hasHoles) {
+ for (var i = 0, len = holeIndices.length; i < len; i++) {
+ var start = holeIndices[i] * dim;
+ var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
+ polygonArea -= Math.abs(signedArea(data, start, end, dim));
+ }
+ }
+ var trianglesArea = 0;
+ for (i = 0; i < triangles.length; i += 3) {
+ var a3 = triangles[i] * dim;
+ var b = triangles[i + 1] * dim;
+ var c = triangles[i + 2] * dim;
+ trianglesArea += Math.abs(
+ (data[a3] - data[c]) * (data[b + 1] - data[a3 + 1]) - (data[a3] - data[b]) * (data[c + 1] - data[a3 + 1])
+ );
+ }
+ return polygonArea === 0 && trianglesArea === 0 ? 0 : Math.abs((trianglesArea - polygonArea) / polygonArea);
+ };
+ function signedArea(data, start, end, dim) {
+ var sum = 0;
+ for (var i = start, j = end - dim; i < end; i += dim) {
+ sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
+ j = i;
+ }
+ return sum;
+ }
+ earcut2.flatten = function(data) {
+ var dim = data[0][0].length, result = { vertices: [], holes: [], dimensions: dim }, holeIndex = 0;
+ for (var i = 0; i < data.length; i++) {
+ for (var j = 0; j < data[i].length; j++) {
+ for (var d = 0; d < dim; d++)
+ result.vertices.push(data[i][j][d]);
+ }
+ if (i > 0) {
+ holeIndex += data[i - 1].length;
+ result.holes.push(holeIndex);
+ }
+ }
+ return result;
+ };
+ }
+});
+
+// node_modules/rbush/rbush.min.js
+var require_rbush_min = __commonJS({
+ "node_modules/rbush/rbush.min.js"(exports2, module2) {
+ !function(t, i) {
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = i() : "function" == typeof define && define.amd ? define(i) : (t = t || self).RBush = i();
+ }(exports2, function() {
+ "use strict";
+ function t(t2, r2, e2, a4, h2) {
+ !function t3(n2, r3, e3, a5, h3) {
+ for (; a5 > e3; ) {
+ if (a5 - e3 > 600) {
+ var o2 = a5 - e3 + 1, s2 = r3 - e3 + 1, l2 = Math.log(o2), f2 = 0.5 * Math.exp(2 * l2 / 3), u4 = 0.5 * Math.sqrt(l2 * f2 * (o2 - f2) / o2) * (s2 - o2 / 2 < 0 ? -1 : 1), m2 = Math.max(e3, Math.floor(r3 - s2 * f2 / o2 + u4)), c14 = Math.min(a5, Math.floor(r3 + (o2 - s2) * f2 / o2 + u4));
+ t3(n2, r3, m2, c14, h3);
+ }
+ var p2 = n2[r3], d2 = e3, x = a5;
+ for (i(n2, e3, r3), h3(n2[a5], p2) > 0 && i(n2, e3, a5); d2 < x; ) {
+ for (i(n2, d2, x), d2++, x--; h3(n2[d2], p2) < 0; )
+ d2++;
+ for (; h3(n2[x], p2) > 0; )
+ x--;
+ }
+ 0 === h3(n2[e3], p2) ? i(n2, e3, x) : i(n2, ++x, a5), x <= r3 && (e3 = x + 1), r3 <= x && (a5 = x - 1);
+ }
+ }(t2, r2, e2 || 0, a4 || t2.length - 1, h2 || n);
+ }
+ function i(t2, i2, n2) {
+ var r2 = t2[i2];
+ t2[i2] = t2[n2], t2[n2] = r2;
+ }
+ function n(t2, i2) {
+ return t2 < i2 ? -1 : t2 > i2 ? 1 : 0;
+ }
+ var r = function(t2) {
+ void 0 === t2 && (t2 = 9), this._maxEntries = Math.max(4, t2), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
+ };
+ function e(t2, i2, n2) {
+ if (!n2)
+ return i2.indexOf(t2);
+ for (var r2 = 0; r2 < i2.length; r2++)
+ if (n2(t2, i2[r2]))
+ return r2;
+ return -1;
+ }
+ function a3(t2, i2) {
+ h(t2, 0, t2.children.length, i2, t2);
+ }
+ function h(t2, i2, n2, r2, e2) {
+ e2 || (e2 = p(null)), e2.minX = 1 / 0, e2.minY = 1 / 0, e2.maxX = -1 / 0, e2.maxY = -1 / 0;
+ for (var a4 = i2; a4 < n2; a4++) {
+ var h2 = t2.children[a4];
+ o(e2, t2.leaf ? r2(h2) : h2);
+ }
+ return e2;
+ }
+ function o(t2, i2) {
+ return t2.minX = Math.min(t2.minX, i2.minX), t2.minY = Math.min(t2.minY, i2.minY), t2.maxX = Math.max(t2.maxX, i2.maxX), t2.maxY = Math.max(t2.maxY, i2.maxY), t2;
+ }
+ function s(t2, i2) {
+ return t2.minX - i2.minX;
+ }
+ function l(t2, i2) {
+ return t2.minY - i2.minY;
+ }
+ function f(t2) {
+ return (t2.maxX - t2.minX) * (t2.maxY - t2.minY);
+ }
+ function u3(t2) {
+ return t2.maxX - t2.minX + (t2.maxY - t2.minY);
+ }
+ function m(t2, i2) {
+ return t2.minX <= i2.minX && t2.minY <= i2.minY && i2.maxX <= t2.maxX && i2.maxY <= t2.maxY;
+ }
+ function c(t2, i2) {
+ return i2.minX <= t2.maxX && i2.minY <= t2.maxY && i2.maxX >= t2.minX && i2.maxY >= t2.minY;
+ }
+ function p(t2) {
+ return { children: t2, height: 1, leaf: true, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
+ }
+ function d(i2, n2, r2, e2, a4) {
+ for (var h2 = [n2, r2]; h2.length; )
+ if (!((r2 = h2.pop()) - (n2 = h2.pop()) <= e2)) {
+ var o2 = n2 + Math.ceil((r2 - n2) / e2 / 2) * e2;
+ t(i2, o2, n2, r2, a4), h2.push(n2, o2, o2, r2);
+ }
+ }
+ return r.prototype.all = function() {
+ return this._all(this.data, []);
+ }, r.prototype.search = function(t2) {
+ var i2 = this.data, n2 = [];
+ if (!c(t2, i2))
+ return n2;
+ for (var r2 = this.toBBox, e2 = []; i2; ) {
+ for (var a4 = 0; a4 < i2.children.length; a4++) {
+ var h2 = i2.children[a4], o2 = i2.leaf ? r2(h2) : h2;
+ c(t2, o2) && (i2.leaf ? n2.push(h2) : m(t2, o2) ? this._all(h2, n2) : e2.push(h2));
+ }
+ i2 = e2.pop();
+ }
+ return n2;
+ }, r.prototype.collides = function(t2) {
+ var i2 = this.data;
+ if (!c(t2, i2))
+ return false;
+ for (var n2 = []; i2; ) {
+ for (var r2 = 0; r2 < i2.children.length; r2++) {
+ var e2 = i2.children[r2], a4 = i2.leaf ? this.toBBox(e2) : e2;
+ if (c(t2, a4)) {
+ if (i2.leaf || m(t2, a4))
+ return true;
+ n2.push(e2);
+ }
+ }
+ i2 = n2.pop();
+ }
+ return false;
+ }, r.prototype.load = function(t2) {
+ if (!t2 || !t2.length)
+ return this;
+ if (t2.length < this._minEntries) {
+ for (var i2 = 0; i2 < t2.length; i2++)
+ this.insert(t2[i2]);
+ return this;
+ }
+ var n2 = this._build(t2.slice(), 0, t2.length - 1, 0);
+ if (this.data.children.length)
+ if (this.data.height === n2.height)
+ this._splitRoot(this.data, n2);
+ else {
+ if (this.data.height < n2.height) {
+ var r2 = this.data;
+ this.data = n2, n2 = r2;
+ }
+ this._insert(n2, this.data.height - n2.height - 1, true);
+ }
+ else
+ this.data = n2;
+ return this;
+ }, r.prototype.insert = function(t2) {
+ return t2 && this._insert(t2, this.data.height - 1), this;
+ }, r.prototype.clear = function() {
+ return this.data = p([]), this;
+ }, r.prototype.remove = function(t2, i2) {
+ if (!t2)
+ return this;
+ for (var n2, r2, a4, h2 = this.data, o2 = this.toBBox(t2), s2 = [], l2 = []; h2 || s2.length; ) {
+ if (h2 || (h2 = s2.pop(), r2 = s2[s2.length - 1], n2 = l2.pop(), a4 = true), h2.leaf) {
+ var f2 = e(t2, h2.children, i2);
+ if (-1 !== f2)
+ return h2.children.splice(f2, 1), s2.push(h2), this._condense(s2), this;
+ }
+ a4 || h2.leaf || !m(h2, o2) ? r2 ? (n2++, h2 = r2.children[n2], a4 = false) : h2 = null : (s2.push(h2), l2.push(n2), n2 = 0, r2 = h2, h2 = h2.children[0]);
+ }
+ return this;
+ }, r.prototype.toBBox = function(t2) {
+ return t2;
+ }, r.prototype.compareMinX = function(t2, i2) {
+ return t2.minX - i2.minX;
+ }, r.prototype.compareMinY = function(t2, i2) {
+ return t2.minY - i2.minY;
+ }, r.prototype.toJSON = function() {
+ return this.data;
+ }, r.prototype.fromJSON = function(t2) {
+ return this.data = t2, this;
+ }, r.prototype._all = function(t2, i2) {
+ for (var n2 = []; t2; )
+ t2.leaf ? i2.push.apply(i2, t2.children) : n2.push.apply(n2, t2.children), t2 = n2.pop();
+ return i2;
+ }, r.prototype._build = function(t2, i2, n2, r2) {
+ var e2, h2 = n2 - i2 + 1, o2 = this._maxEntries;
+ if (h2 <= o2)
+ return a3(e2 = p(t2.slice(i2, n2 + 1)), this.toBBox), e2;
+ r2 || (r2 = Math.ceil(Math.log(h2) / Math.log(o2)), o2 = Math.ceil(h2 / Math.pow(o2, r2 - 1))), (e2 = p([])).leaf = false, e2.height = r2;
+ var s2 = Math.ceil(h2 / o2), l2 = s2 * Math.ceil(Math.sqrt(o2));
+ d(t2, i2, n2, l2, this.compareMinX);
+ for (var f2 = i2; f2 <= n2; f2 += l2) {
+ var u4 = Math.min(f2 + l2 - 1, n2);
+ d(t2, f2, u4, s2, this.compareMinY);
+ for (var m2 = f2; m2 <= u4; m2 += s2) {
+ var c14 = Math.min(m2 + s2 - 1, u4);
+ e2.children.push(this._build(t2, m2, c14, r2 - 1));
+ }
+ }
+ return a3(e2, this.toBBox), e2;
+ }, r.prototype._chooseSubtree = function(t2, i2, n2, r2) {
+ for (; r2.push(i2), !i2.leaf && r2.length - 1 !== n2; ) {
+ for (var e2 = 1 / 0, a4 = 1 / 0, h2 = void 0, o2 = 0; o2 < i2.children.length; o2++) {
+ var s2 = i2.children[o2], l2 = f(s2), u4 = (m2 = t2, c14 = s2, (Math.max(c14.maxX, m2.maxX) - Math.min(c14.minX, m2.minX)) * (Math.max(c14.maxY, m2.maxY) - Math.min(c14.minY, m2.minY)) - l2);
+ u4 < a4 ? (a4 = u4, e2 = l2 < e2 ? l2 : e2, h2 = s2) : u4 === a4 && l2 < e2 && (e2 = l2, h2 = s2);
+ }
+ i2 = h2 || i2.children[0];
+ }
+ var m2, c14;
+ return i2;
+ }, r.prototype._insert = function(t2, i2, n2) {
+ var r2 = n2 ? t2 : this.toBBox(t2), e2 = [], a4 = this._chooseSubtree(r2, this.data, i2, e2);
+ for (a4.children.push(t2), o(a4, r2); i2 >= 0 && e2[i2].children.length > this._maxEntries; )
+ this._split(e2, i2), i2--;
+ this._adjustParentBBoxes(r2, e2, i2);
+ }, r.prototype._split = function(t2, i2) {
+ var n2 = t2[i2], r2 = n2.children.length, e2 = this._minEntries;
+ this._chooseSplitAxis(n2, e2, r2);
+ var h2 = this._chooseSplitIndex(n2, e2, r2), o2 = p(n2.children.splice(h2, n2.children.length - h2));
+ o2.height = n2.height, o2.leaf = n2.leaf, a3(n2, this.toBBox), a3(o2, this.toBBox), i2 ? t2[i2 - 1].children.push(o2) : this._splitRoot(n2, o2);
+ }, r.prototype._splitRoot = function(t2, i2) {
+ this.data = p([t2, i2]), this.data.height = t2.height + 1, this.data.leaf = false, a3(this.data, this.toBBox);
+ }, r.prototype._chooseSplitIndex = function(t2, i2, n2) {
+ for (var r2, e2, a4, o2, s2, l2, u4, m2 = 1 / 0, c14 = 1 / 0, p2 = i2; p2 <= n2 - i2; p2++) {
+ var d2 = h(t2, 0, p2, this.toBBox), x = h(t2, p2, n2, this.toBBox), v7 = (e2 = d2, a4 = x, o2 = void 0, s2 = void 0, l2 = void 0, u4 = void 0, o2 = Math.max(e2.minX, a4.minX), s2 = Math.max(e2.minY, a4.minY), l2 = Math.min(e2.maxX, a4.maxX), u4 = Math.min(e2.maxY, a4.maxY), Math.max(0, l2 - o2) * Math.max(0, u4 - s2)), M = f(d2) + f(x);
+ v7 < m2 ? (m2 = v7, r2 = p2, c14 = M < c14 ? M : c14) : v7 === m2 && M < c14 && (c14 = M, r2 = p2);
+ }
+ return r2 || n2 - i2;
+ }, r.prototype._chooseSplitAxis = function(t2, i2, n2) {
+ var r2 = t2.leaf ? this.compareMinX : s, e2 = t2.leaf ? this.compareMinY : l;
+ this._allDistMargin(t2, i2, n2, r2) < this._allDistMargin(t2, i2, n2, e2) && t2.children.sort(r2);
+ }, r.prototype._allDistMargin = function(t2, i2, n2, r2) {
+ t2.children.sort(r2);
+ for (var e2 = this.toBBox, a4 = h(t2, 0, i2, e2), s2 = h(t2, n2 - i2, n2, e2), l2 = u3(a4) + u3(s2), f2 = i2; f2 < n2 - i2; f2++) {
+ var m2 = t2.children[f2];
+ o(a4, t2.leaf ? e2(m2) : m2), l2 += u3(a4);
+ }
+ for (var c14 = n2 - i2 - 1; c14 >= i2; c14--) {
+ var p2 = t2.children[c14];
+ o(s2, t2.leaf ? e2(p2) : p2), l2 += u3(s2);
+ }
+ return l2;
+ }, r.prototype._adjustParentBBoxes = function(t2, i2, n2) {
+ for (var r2 = n2; r2 >= 0; r2--)
+ o(i2[r2], t2);
+ }, r.prototype._condense = function(t2) {
+ for (var i2 = t2.length - 1, n2 = void 0; i2 >= 0; i2--)
+ 0 === t2[i2].children.length ? i2 > 0 ? (n2 = t2[i2 - 1].children).splice(n2.indexOf(t2[i2]), 1) : this.clear() : a3(t2[i2], this.toBBox);
+ }, r;
+ });
+ }
+});
+
+// node_modules/tslib/tslib.js
+var require_tslib = __commonJS({
+ "node_modules/tslib/tslib.js"(exports2, module2) {
+ var __extends2;
+ var __assign2;
+ var __rest2;
+ var __decorate2;
+ var __param2;
+ var __esDecorate2;
+ var __runInitializers2;
+ var __propKey2;
+ var __setFunctionName2;
+ var __metadata2;
+ var __awaiter2;
+ var __generator2;
+ var __exportStar2;
+ var __values2;
+ var __read2;
+ var __spread2;
+ var __spreadArrays2;
+ var __spreadArray2;
+ var __await2;
+ var __asyncGenerator2;
+ var __asyncDelegator2;
+ var __asyncValues2;
+ var __makeTemplateObject2;
+ var __importStar2;
+ var __importDefault2;
+ var __classPrivateFieldGet2;
+ var __classPrivateFieldSet2;
+ var __classPrivateFieldIn2;
+ var __createBinding2;
+ (function(factory) {
+ var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
+ if (typeof define === "function" && define.amd) {
+ define("tslib", ["exports"], function(exports3) {
+ factory(createExporter(root, createExporter(exports3)));
+ });
+ } else if (typeof module2 === "object" && typeof module2.exports === "object") {
+ factory(createExporter(root, createExporter(module2.exports)));
+ } else {
+ factory(createExporter(root));
+ }
+ function createExporter(exports3, previous) {
+ if (exports3 !== root) {
+ if (typeof Object.create === "function") {
+ Object.defineProperty(exports3, "__esModule", { value: true });
+ } else {
+ exports3.__esModule = true;
+ }
+ }
+ return function(id, v7) {
+ return exports3[id] = previous ? previous(id, v7) : v7;
+ };
+ }
+ })(function(exporter) {
+ var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
+ d.__proto__ = b;
+ } || function(d, b) {
+ for (var p in b)
+ if (Object.prototype.hasOwnProperty.call(b, p))
+ d[p] = b[p];
+ };
+ __extends2 = function(d, b) {
+ if (typeof b !== "function" && b !== null)
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
+ extendStatics(d, b);
+ function __() {
+ this.constructor = d;
+ }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+ __assign2 = Object.assign || function(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s)
+ if (Object.prototype.hasOwnProperty.call(s, p))
+ t[p] = s[p];
+ }
+ return t;
+ };
+ __rest2 = function(s, e) {
+ var t = {};
+ for (var p in s)
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+ };
+ __decorate2 = function(decorators, target, key, desc) {
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
+ r = Reflect.decorate(decorators, target, key, desc);
+ else
+ for (var i = decorators.length - 1; i >= 0; i--)
+ if (d = decorators[i])
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
+ };
+ __param2 = function(paramIndex, decorator) {
+ return function(target, key) {
+ decorator(target, key, paramIndex);
+ };
+ };
+ __esDecorate2 = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
+ function accept(f) {
+ if (f !== void 0 && typeof f !== "function")
+ throw new TypeError("Function expected");
+ return f;
+ }
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
+ var _, done = false;
+ for (var i = decorators.length - 1; i >= 0; i--) {
+ var context = {};
+ for (var p in contextIn)
+ context[p] = p === "access" ? {} : contextIn[p];
+ for (var p in contextIn.access)
+ context.access[p] = contextIn.access[p];
+ context.addInitializer = function(f) {
+ if (done)
+ throw new TypeError("Cannot add initializers after decoration has completed");
+ extraInitializers.push(accept(f || null));
+ };
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
+ if (kind === "accessor") {
+ if (result === void 0)
+ continue;
+ if (result === null || typeof result !== "object")
+ throw new TypeError("Object expected");
+ if (_ = accept(result.get))
+ descriptor.get = _;
+ if (_ = accept(result.set))
+ descriptor.set = _;
+ if (_ = accept(result.init))
+ initializers.push(_);
+ } else if (_ = accept(result)) {
+ if (kind === "field")
+ initializers.push(_);
+ else
+ descriptor[key] = _;
+ }
+ }
+ if (target)
+ Object.defineProperty(target, contextIn.name, descriptor);
+ done = true;
+ };
+ __runInitializers2 = function(thisArg, initializers, value) {
+ var useValue = arguments.length > 2;
+ for (var i = 0; i < initializers.length; i++) {
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
+ }
+ return useValue ? value : void 0;
+ };
+ __propKey2 = function(x) {
+ return typeof x === "symbol" ? x : "".concat(x);
+ };
+ __setFunctionName2 = function(f, name, prefix) {
+ if (typeof name === "symbol")
+ name = name.description ? "[".concat(name.description, "]") : "";
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
+ };
+ __metadata2 = function(metadataKey, metadataValue) {
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
+ return Reflect.metadata(metadataKey, metadataValue);
+ };
+ __awaiter2 = function(thisArg, _arguments, P, generator) {
+ function adopt(value) {
+ return value instanceof P ? value : new P(function(resolve2) {
+ resolve2(value);
+ });
+ }
+ return new (P || (P = Promise))(function(resolve2, reject) {
+ function fulfilled(value) {
+ try {
+ step2(generator.next(value));
+ } catch (e) {
+ reject(e);
+ }
+ }
+ function rejected(value) {
+ try {
+ step2(generator["throw"](value));
+ } catch (e) {
+ reject(e);
+ }
+ }
+ function step2(result) {
+ result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
+ }
+ step2((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+ };
+ __generator2 = function(thisArg, body) {
+ var _ = { label: 0, sent: function() {
+ if (t[0] & 1)
+ throw t[1];
+ return t[1];
+ }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
+ return this;
+ }), g;
+ function verb(n) {
+ return function(v7) {
+ return step2([n, v7]);
+ };
+ }
+ function step2(op) {
+ if (f)
+ throw new TypeError("Generator is already executing.");
+ while (g && (g = 0, op[0] && (_ = 0)), _)
+ try {
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
+ return t;
+ if (y = 0, t)
+ op = [op[0] & 2, t.value];
+ switch (op[0]) {
+ case 0:
+ case 1:
+ t = op;
+ break;
+ case 4:
+ _.label++;
+ return { value: op[1], done: false };
+ case 5:
+ _.label++;
+ y = op[1];
+ op = [0];
+ continue;
+ case 7:
+ op = _.ops.pop();
+ _.trys.pop();
+ continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
+ _ = 0;
+ continue;
+ }
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
+ _.label = op[1];
+ break;
+ }
+ if (op[0] === 6 && _.label < t[1]) {
+ _.label = t[1];
+ t = op;
+ break;
+ }
+ if (t && _.label < t[2]) {
+ _.label = t[2];
+ _.ops.push(op);
+ break;
+ }
+ if (t[2])
+ _.ops.pop();
+ _.trys.pop();
+ continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) {
+ op = [6, e];
+ y = 0;
+ } finally {
+ f = t = 0;
+ }
+ if (op[0] & 5)
+ throw op[1];
+ return { value: op[0] ? op[1] : void 0, done: true };
+ }
+ };
+ __exportStar2 = function(m, o) {
+ for (var p in m)
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
+ __createBinding2(o, m, p);
+ };
+ __createBinding2 = Object.create ? function(o, m, k, k2) {
+ if (k2 === void 0)
+ k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() {
+ return m[k];
+ } };
+ }
+ Object.defineProperty(o, k2, desc);
+ } : function(o, m, k, k2) {
+ if (k2 === void 0)
+ k2 = k;
+ o[k2] = m[k];
+ };
+ __values2 = function(o) {
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
+ if (m)
+ return m.call(o);
+ if (o && typeof o.length === "number")
+ return {
+ next: function() {
+ if (o && i >= o.length)
+ o = void 0;
+ return { value: o && o[i++], done: !o };
+ }
+ };
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
+ };
+ __read2 = function(o, n) {
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
+ if (!m)
+ return o;
+ var i = m.call(o), r, ar = [], e;
+ try {
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
+ ar.push(r.value);
+ } catch (error) {
+ e = { error };
+ } finally {
+ try {
+ if (r && !r.done && (m = i["return"]))
+ m.call(i);
+ } finally {
+ if (e)
+ throw e.error;
+ }
+ }
+ return ar;
+ };
+ __spread2 = function() {
+ for (var ar = [], i = 0; i < arguments.length; i++)
+ ar = ar.concat(__read2(arguments[i]));
+ return ar;
+ };
+ __spreadArrays2 = function() {
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
+ s += arguments[i].length;
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
+ for (var a3 = arguments[i], j = 0, jl = a3.length; j < jl; j++, k++)
+ r[k] = a3[j];
+ return r;
+ };
+ __spreadArray2 = function(to, from, pack) {
+ if (pack || arguments.length === 2)
+ for (var i = 0, l = from.length, ar; i < l; i++) {
+ if (ar || !(i in from)) {
+ if (!ar)
+ ar = Array.prototype.slice.call(from, 0, i);
+ ar[i] = from[i];
+ }
+ }
+ return to.concat(ar || Array.prototype.slice.call(from));
+ };
+ __await2 = function(v7) {
+ return this instanceof __await2 ? (this.v = v7, this) : new __await2(v7);
+ };
+ __asyncGenerator2 = function(thisArg, _arguments, generator) {
+ if (!Symbol.asyncIterator)
+ throw new TypeError("Symbol.asyncIterator is not defined.");
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
+ return this;
+ }, i;
+ function verb(n) {
+ if (g[n])
+ i[n] = function(v7) {
+ return new Promise(function(a3, b) {
+ q.push([n, v7, a3, b]) > 1 || resume(n, v7);
+ });
+ };
+ }
+ function resume(n, v7) {
+ try {
+ step2(g[n](v7));
+ } catch (e) {
+ settle(q[0][3], e);
+ }
+ }
+ function step2(r) {
+ r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
+ }
+ function fulfill(value) {
+ resume("next", value);
+ }
+ function reject(value) {
+ resume("throw", value);
+ }
+ function settle(f, v7) {
+ if (f(v7), q.shift(), q.length)
+ resume(q[0][0], q[0][1]);
+ }
+ };
+ __asyncDelegator2 = function(o) {
+ var i, p;
+ return i = {}, verb("next"), verb("throw", function(e) {
+ throw e;
+ }), verb("return"), i[Symbol.iterator] = function() {
+ return this;
+ }, i;
+ function verb(n, f) {
+ i[n] = o[n] ? function(v7) {
+ return (p = !p) ? { value: __await2(o[n](v7)), done: false } : f ? f(v7) : v7;
+ } : f;
+ }
+ };
+ __asyncValues2 = function(o) {
+ if (!Symbol.asyncIterator)
+ throw new TypeError("Symbol.asyncIterator is not defined.");
+ var m = o[Symbol.asyncIterator], i;
+ return m ? m.call(o) : (o = typeof __values2 === "function" ? __values2(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
+ return this;
+ }, i);
+ function verb(n) {
+ i[n] = o[n] && function(v7) {
+ return new Promise(function(resolve2, reject) {
+ v7 = o[n](v7), settle(resolve2, reject, v7.done, v7.value);
+ });
+ };
+ }
+ function settle(resolve2, reject, d, v7) {
+ Promise.resolve(v7).then(function(v8) {
+ resolve2({ value: v8, done: d });
+ }, reject);
+ }
+ };
+ __makeTemplateObject2 = function(cooked, raw) {
+ if (Object.defineProperty) {
+ Object.defineProperty(cooked, "raw", { value: raw });
+ } else {
+ cooked.raw = raw;
+ }
+ return cooked;
+ };
+ var __setModuleDefault = Object.create ? function(o, v7) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v7 });
+ } : function(o, v7) {
+ o["default"] = v7;
+ };
+ __importStar2 = function(mod2) {
+ if (mod2 && mod2.__esModule)
+ return mod2;
+ var result = {};
+ if (mod2 != null) {
+ for (var k in mod2)
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k))
+ __createBinding2(result, mod2, k);
+ }
+ __setModuleDefault(result, mod2);
+ return result;
+ };
+ __importDefault2 = function(mod2) {
+ return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
+ };
+ __classPrivateFieldGet2 = function(receiver, state, kind, f) {
+ if (kind === "a" && !f)
+ throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+ };
+ __classPrivateFieldSet2 = function(receiver, state, value, kind, f) {
+ if (kind === "m")
+ throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f)
+ throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
+ };
+ __classPrivateFieldIn2 = function(state, receiver) {
+ if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function")
+ throw new TypeError("Cannot use 'in' operator on non-object");
+ return typeof state === "function" ? receiver === state : state.has(receiver);
+ };
+ exporter("__extends", __extends2);
+ exporter("__assign", __assign2);
+ exporter("__rest", __rest2);
+ exporter("__decorate", __decorate2);
+ exporter("__param", __param2);
+ exporter("__esDecorate", __esDecorate2);
+ exporter("__runInitializers", __runInitializers2);
+ exporter("__propKey", __propKey2);
+ exporter("__setFunctionName", __setFunctionName2);
+ exporter("__metadata", __metadata2);
+ exporter("__awaiter", __awaiter2);
+ exporter("__generator", __generator2);
+ exporter("__exportStar", __exportStar2);
+ exporter("__createBinding", __createBinding2);
+ exporter("__values", __values2);
+ exporter("__read", __read2);
+ exporter("__spread", __spread2);
+ exporter("__spreadArrays", __spreadArrays2);
+ exporter("__spreadArray", __spreadArray2);
+ exporter("__await", __await2);
+ exporter("__asyncGenerator", __asyncGenerator2);
+ exporter("__asyncDelegator", __asyncDelegator2);
+ exporter("__asyncValues", __asyncValues2);
+ exporter("__makeTemplateObject", __makeTemplateObject2);
+ exporter("__importStar", __importStar2);
+ exporter("__importDefault", __importDefault2);
+ exporter("__classPrivateFieldGet", __classPrivateFieldGet2);
+ exporter("__classPrivateFieldSet", __classPrivateFieldSet2);
+ exporter("__classPrivateFieldIn", __classPrivateFieldIn2);
+ });
+ }
+});
+
+// node_modules/protobufjs/dist/minimal/protobuf.js
+var require_protobuf = __commonJS({
+ "node_modules/protobufjs/dist/minimal/protobuf.js"(exports, module) {
+ /*!
+ * protobuf.js v7.2.3 (c) 2016, daniel wirtz
+ * compiled mon, 27 mar 2023 18:08:22 utc
+ * licensed under the bsd-3-clause license
+ * see: https://github.com/dcodeio/protobuf.js for details
+ */
+ (function(undefined) {
+ "use strict";
+ (function prelude(modules, cache, entries) {
+ function $require(name) {
+ var $module = cache[name];
+ if (!$module)
+ modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);
+ return $module.exports;
+ }
+ var protobuf3 = $require(entries[0]);
+ protobuf3.util.global.protobuf = protobuf3;
+ if (typeof define === "function" && define.amd)
+ define(["long"], function(Long) {
+ if (Long && Long.isLong) {
+ protobuf3.util.Long = Long;
+ protobuf3.configure();
+ }
+ return protobuf3;
+ });
+ if (typeof module === "object" && module && module.exports)
+ module.exports = protobuf3;
+ })({ 1: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = asPromise;
+ function asPromise(fn, ctx) {
+ var params = new Array(arguments.length - 1), offset2 = 0, index = 2, pending = true;
+ while (index < arguments.length)
+ params[offset2++] = arguments[index++];
+ return new Promise(function executor(resolve2, reject) {
+ params[offset2] = function callback(err) {
+ if (pending) {
+ pending = false;
+ if (err)
+ reject(err);
+ else {
+ var params2 = new Array(arguments.length - 1), offset3 = 0;
+ while (offset3 < params2.length)
+ params2[offset3++] = arguments[offset3];
+ resolve2.apply(null, params2);
+ }
+ }
+ };
+ try {
+ fn.apply(ctx || null, params);
+ } catch (err) {
+ if (pending) {
+ pending = false;
+ reject(err);
+ }
+ }
+ });
+ }
+ }, {}], 2: [function(require2, module2, exports2) {
+ "use strict";
+ var base64 = exports2;
+ base64.length = function length3(string) {
+ var p = string.length;
+ if (!p)
+ return 0;
+ var n = 0;
+ while (--p % 4 > 1 && string.charAt(p) === "=")
+ ++n;
+ return Math.ceil(string.length * 3) / 4 - n;
+ };
+ var b64 = new Array(64);
+ var s64 = new Array(123);
+ for (var i = 0; i < 64; )
+ s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;
+ base64.encode = function encode(buffer, start, end) {
+ var parts = null, chunk = [];
+ var i2 = 0, j = 0, t;
+ while (start < end) {
+ var b = buffer[start++];
+ switch (j) {
+ case 0:
+ chunk[i2++] = b64[b >> 2];
+ t = (b & 3) << 4;
+ j = 1;
+ break;
+ case 1:
+ chunk[i2++] = b64[t | b >> 4];
+ t = (b & 15) << 2;
+ j = 2;
+ break;
+ case 2:
+ chunk[i2++] = b64[t | b >> 6];
+ chunk[i2++] = b64[b & 63];
+ j = 0;
+ break;
+ }
+ if (i2 > 8191) {
+ (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
+ i2 = 0;
+ }
+ }
+ if (j) {
+ chunk[i2++] = b64[t];
+ chunk[i2++] = 61;
+ if (j === 1)
+ chunk[i2++] = 61;
+ }
+ if (parts) {
+ if (i2)
+ parts.push(String.fromCharCode.apply(String, chunk.slice(0, i2)));
+ return parts.join("");
+ }
+ return String.fromCharCode.apply(String, chunk.slice(0, i2));
+ };
+ var invalidEncoding = "invalid encoding";
+ base64.decode = function decode(string, buffer, offset2) {
+ var start = offset2;
+ var j = 0, t;
+ for (var i2 = 0; i2 < string.length; ) {
+ var c = string.charCodeAt(i2++);
+ if (c === 61 && j > 1)
+ break;
+ if ((c = s64[c]) === undefined)
+ throw Error(invalidEncoding);
+ switch (j) {
+ case 0:
+ t = c;
+ j = 1;
+ break;
+ case 1:
+ buffer[offset2++] = t << 2 | (c & 48) >> 4;
+ t = c;
+ j = 2;
+ break;
+ case 2:
+ buffer[offset2++] = (t & 15) << 4 | (c & 60) >> 2;
+ t = c;
+ j = 3;
+ break;
+ case 3:
+ buffer[offset2++] = (t & 3) << 6 | c;
+ j = 0;
+ break;
+ }
+ }
+ if (j === 1)
+ throw Error(invalidEncoding);
+ return offset2 - start;
+ };
+ base64.test = function test(string) {
+ return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);
+ };
+ }, {}], 3: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = EventEmitter;
+ function EventEmitter() {
+ this._listeners = {};
+ }
+ EventEmitter.prototype.on = function on(evt, fn, ctx) {
+ (this._listeners[evt] || (this._listeners[evt] = [])).push({
+ fn,
+ ctx: ctx || this
+ });
+ return this;
+ };
+ EventEmitter.prototype.off = function off(evt, fn) {
+ if (evt === undefined)
+ this._listeners = {};
+ else {
+ if (fn === undefined)
+ this._listeners[evt] = [];
+ else {
+ var listeners = this._listeners[evt];
+ for (var i = 0; i < listeners.length; )
+ if (listeners[i].fn === fn)
+ listeners.splice(i, 1);
+ else
+ ++i;
+ }
+ }
+ return this;
+ };
+ EventEmitter.prototype.emit = function emit(evt) {
+ var listeners = this._listeners[evt];
+ if (listeners) {
+ var args = [], i = 1;
+ for (; i < arguments.length; )
+ args.push(arguments[i++]);
+ for (i = 0; i < listeners.length; )
+ listeners[i].fn.apply(listeners[i++].ctx, args);
+ }
+ return this;
+ };
+ }, {}], 4: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = factory(factory);
+ function factory(exports3) {
+ if (typeof Float32Array !== "undefined")
+ (function() {
+ var f32 = new Float32Array([-0]), f8b = new Uint8Array(f32.buffer), le = f8b[3] === 128;
+ function writeFloat_f32_cpy(val, buf, pos) {
+ f32[0] = val;
+ buf[pos] = f8b[0];
+ buf[pos + 1] = f8b[1];
+ buf[pos + 2] = f8b[2];
+ buf[pos + 3] = f8b[3];
+ }
+ function writeFloat_f32_rev(val, buf, pos) {
+ f32[0] = val;
+ buf[pos] = f8b[3];
+ buf[pos + 1] = f8b[2];
+ buf[pos + 2] = f8b[1];
+ buf[pos + 3] = f8b[0];
+ }
+ exports3.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;
+ exports3.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;
+ function readFloat_f32_cpy(buf, pos) {
+ f8b[0] = buf[pos];
+ f8b[1] = buf[pos + 1];
+ f8b[2] = buf[pos + 2];
+ f8b[3] = buf[pos + 3];
+ return f32[0];
+ }
+ function readFloat_f32_rev(buf, pos) {
+ f8b[3] = buf[pos];
+ f8b[2] = buf[pos + 1];
+ f8b[1] = buf[pos + 2];
+ f8b[0] = buf[pos + 3];
+ return f32[0];
+ }
+ exports3.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;
+ exports3.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;
+ })();
+ else
+ (function() {
+ function writeFloat_ieee754(writeUint, val, buf, pos) {
+ var sign2 = val < 0 ? 1 : 0;
+ if (sign2)
+ val = -val;
+ if (val === 0)
+ writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos);
+ else if (isNaN(val))
+ writeUint(2143289344, buf, pos);
+ else if (val > 34028234663852886e22)
+ writeUint((sign2 << 31 | 2139095040) >>> 0, buf, pos);
+ else if (val < 11754943508222875e-54)
+ writeUint((sign2 << 31 | Math.round(val / 1401298464324817e-60)) >>> 0, buf, pos);
+ else {
+ var exponent = Math.floor(Math.log(val) / Math.LN2), mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;
+ writeUint((sign2 << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);
+ }
+ }
+ exports3.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);
+ exports3.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);
+ function readFloat_ieee754(readUint, buf, pos) {
+ var uint = readUint(buf, pos), sign2 = (uint >> 31) * 2 + 1, exponent = uint >>> 23 & 255, mantissa = uint & 8388607;
+ return exponent === 255 ? mantissa ? NaN : sign2 * Infinity : exponent === 0 ? sign2 * 1401298464324817e-60 * mantissa : sign2 * Math.pow(2, exponent - 150) * (mantissa + 8388608);
+ }
+ exports3.readFloatLE = readFloat_ieee754.bind(null, readUintLE);
+ exports3.readFloatBE = readFloat_ieee754.bind(null, readUintBE);
+ })();
+ if (typeof Float64Array !== "undefined")
+ (function() {
+ var f64 = new Float64Array([-0]), f8b = new Uint8Array(f64.buffer), le = f8b[7] === 128;
+ function writeDouble_f64_cpy(val, buf, pos) {
+ f64[0] = val;
+ buf[pos] = f8b[0];
+ buf[pos + 1] = f8b[1];
+ buf[pos + 2] = f8b[2];
+ buf[pos + 3] = f8b[3];
+ buf[pos + 4] = f8b[4];
+ buf[pos + 5] = f8b[5];
+ buf[pos + 6] = f8b[6];
+ buf[pos + 7] = f8b[7];
+ }
+ function writeDouble_f64_rev(val, buf, pos) {
+ f64[0] = val;
+ buf[pos] = f8b[7];
+ buf[pos + 1] = f8b[6];
+ buf[pos + 2] = f8b[5];
+ buf[pos + 3] = f8b[4];
+ buf[pos + 4] = f8b[3];
+ buf[pos + 5] = f8b[2];
+ buf[pos + 6] = f8b[1];
+ buf[pos + 7] = f8b[0];
+ }
+ exports3.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;
+ exports3.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;
+ function readDouble_f64_cpy(buf, pos) {
+ f8b[0] = buf[pos];
+ f8b[1] = buf[pos + 1];
+ f8b[2] = buf[pos + 2];
+ f8b[3] = buf[pos + 3];
+ f8b[4] = buf[pos + 4];
+ f8b[5] = buf[pos + 5];
+ f8b[6] = buf[pos + 6];
+ f8b[7] = buf[pos + 7];
+ return f64[0];
+ }
+ function readDouble_f64_rev(buf, pos) {
+ f8b[7] = buf[pos];
+ f8b[6] = buf[pos + 1];
+ f8b[5] = buf[pos + 2];
+ f8b[4] = buf[pos + 3];
+ f8b[3] = buf[pos + 4];
+ f8b[2] = buf[pos + 5];
+ f8b[1] = buf[pos + 6];
+ f8b[0] = buf[pos + 7];
+ return f64[0];
+ }
+ exports3.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;
+ exports3.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;
+ })();
+ else
+ (function() {
+ function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {
+ var sign2 = val < 0 ? 1 : 0;
+ if (sign2)
+ val = -val;
+ if (val === 0) {
+ writeUint(0, buf, pos + off0);
+ writeUint(1 / val > 0 ? 0 : 2147483648, buf, pos + off1);
+ } else if (isNaN(val)) {
+ writeUint(0, buf, pos + off0);
+ writeUint(2146959360, buf, pos + off1);
+ } else if (val > 17976931348623157e292) {
+ writeUint(0, buf, pos + off0);
+ writeUint((sign2 << 31 | 2146435072) >>> 0, buf, pos + off1);
+ } else {
+ var mantissa;
+ if (val < 22250738585072014e-324) {
+ mantissa = val / 5e-324;
+ writeUint(mantissa >>> 0, buf, pos + off0);
+ writeUint((sign2 << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);
+ } else {
+ var exponent = Math.floor(Math.log(val) / Math.LN2);
+ if (exponent === 1024)
+ exponent = 1023;
+ mantissa = val * Math.pow(2, -exponent);
+ writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);
+ writeUint((sign2 << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);
+ }
+ }
+ }
+ exports3.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);
+ exports3.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);
+ function readDouble_ieee754(readUint, off0, off1, buf, pos) {
+ var lo = readUint(buf, pos + off0), hi = readUint(buf, pos + off1);
+ var sign2 = (hi >> 31) * 2 + 1, exponent = hi >>> 20 & 2047, mantissa = 4294967296 * (hi & 1048575) + lo;
+ return exponent === 2047 ? mantissa ? NaN : sign2 * Infinity : exponent === 0 ? sign2 * 5e-324 * mantissa : sign2 * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);
+ }
+ exports3.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);
+ exports3.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);
+ })();
+ return exports3;
+ }
+ function writeUintLE(val, buf, pos) {
+ buf[pos] = val & 255;
+ buf[pos + 1] = val >>> 8 & 255;
+ buf[pos + 2] = val >>> 16 & 255;
+ buf[pos + 3] = val >>> 24;
+ }
+ function writeUintBE(val, buf, pos) {
+ buf[pos] = val >>> 24;
+ buf[pos + 1] = val >>> 16 & 255;
+ buf[pos + 2] = val >>> 8 & 255;
+ buf[pos + 3] = val & 255;
+ }
+ function readUintLE(buf, pos) {
+ return (buf[pos] | buf[pos + 1] << 8 | buf[pos + 2] << 16 | buf[pos + 3] << 24) >>> 0;
+ }
+ function readUintBE(buf, pos) {
+ return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0;
+ }
+ }, {}], 5: [function(require, module, exports) {
+ "use strict";
+ module.exports = inquire;
+ function inquire(moduleName) {
+ try {
+ var mod = eval("quire".replace(/^/, "re"))(moduleName);
+ if (mod && (mod.length || Object.keys(mod).length))
+ return mod;
+ } catch (e) {
+ }
+ return null;
+ }
+ }, {}], 6: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = pool2;
+ function pool2(alloc, slice, size) {
+ var SIZE = size || 8192;
+ var MAX = SIZE >>> 1;
+ var slab = null;
+ var offset2 = SIZE;
+ return function pool_alloc(size2) {
+ if (size2 < 1 || size2 > MAX)
+ return alloc(size2);
+ if (offset2 + size2 > SIZE) {
+ slab = alloc(SIZE);
+ offset2 = 0;
+ }
+ var buf = slice.call(slab, offset2, offset2 += size2);
+ if (offset2 & 7)
+ offset2 = (offset2 | 7) + 1;
+ return buf;
+ };
+ }
+ }, {}], 7: [function(require2, module2, exports2) {
+ "use strict";
+ var utf8 = exports2;
+ utf8.length = function utf8_length(string) {
+ var len = 0, c = 0;
+ for (var i = 0; i < string.length; ++i) {
+ c = string.charCodeAt(i);
+ if (c < 128)
+ len += 1;
+ else if (c < 2048)
+ len += 2;
+ else if ((c & 64512) === 55296 && (string.charCodeAt(i + 1) & 64512) === 56320) {
+ ++i;
+ len += 4;
+ } else
+ len += 3;
+ }
+ return len;
+ };
+ utf8.read = function utf8_read(buffer, start, end) {
+ var len = end - start;
+ if (len < 1)
+ return "";
+ var parts = null, chunk = [], i = 0, t;
+ while (start < end) {
+ t = buffer[start++];
+ if (t < 128)
+ chunk[i++] = t;
+ else if (t > 191 && t < 224)
+ chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;
+ else if (t > 239 && t < 365) {
+ t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 65536;
+ chunk[i++] = 55296 + (t >> 10);
+ chunk[i++] = 56320 + (t & 1023);
+ } else
+ chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;
+ if (i > 8191) {
+ (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));
+ i = 0;
+ }
+ }
+ if (parts) {
+ if (i)
+ parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));
+ return parts.join("");
+ }
+ return String.fromCharCode.apply(String, chunk.slice(0, i));
+ };
+ utf8.write = function utf8_write(string, buffer, offset2) {
+ var start = offset2, c14, c22;
+ for (var i = 0; i < string.length; ++i) {
+ c14 = string.charCodeAt(i);
+ if (c14 < 128) {
+ buffer[offset2++] = c14;
+ } else if (c14 < 2048) {
+ buffer[offset2++] = c14 >> 6 | 192;
+ buffer[offset2++] = c14 & 63 | 128;
+ } else if ((c14 & 64512) === 55296 && ((c22 = string.charCodeAt(i + 1)) & 64512) === 56320) {
+ c14 = 65536 + ((c14 & 1023) << 10) + (c22 & 1023);
+ ++i;
+ buffer[offset2++] = c14 >> 18 | 240;
+ buffer[offset2++] = c14 >> 12 & 63 | 128;
+ buffer[offset2++] = c14 >> 6 & 63 | 128;
+ buffer[offset2++] = c14 & 63 | 128;
+ } else {
+ buffer[offset2++] = c14 >> 12 | 224;
+ buffer[offset2++] = c14 >> 6 & 63 | 128;
+ buffer[offset2++] = c14 & 63 | 128;
+ }
+ }
+ return offset2 - start;
+ };
+ }, {}], 8: [function(require2, module2, exports2) {
+ "use strict";
+ var protobuf3 = exports2;
+ protobuf3.build = "minimal";
+ protobuf3.Writer = require2(16);
+ protobuf3.BufferWriter = require2(17);
+ protobuf3.Reader = require2(9);
+ protobuf3.BufferReader = require2(10);
+ protobuf3.util = require2(15);
+ protobuf3.rpc = require2(12);
+ protobuf3.roots = require2(11);
+ protobuf3.configure = configure2;
+ function configure2() {
+ protobuf3.util._configure();
+ protobuf3.Writer._configure(protobuf3.BufferWriter);
+ protobuf3.Reader._configure(protobuf3.BufferReader);
+ }
+ configure2();
+ }, { "10": 10, "11": 11, "12": 12, "15": 15, "16": 16, "17": 17, "9": 9 }], 9: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = Reader3;
+ var util = require2(15);
+ var BufferReader;
+ var LongBits = util.LongBits, utf8 = util.utf8;
+ function indexOutOfRange(reader, writeLength) {
+ return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len);
+ }
+ function Reader3(buffer) {
+ this.buf = buffer;
+ this.pos = 0;
+ this.len = buffer.length;
+ }
+ var create_array = typeof Uint8Array !== "undefined" ? function create_typed_array(buffer) {
+ if (buffer instanceof Uint8Array || Array.isArray(buffer))
+ return new Reader3(buffer);
+ throw Error("illegal buffer");
+ } : function create_array2(buffer) {
+ if (Array.isArray(buffer))
+ return new Reader3(buffer);
+ throw Error("illegal buffer");
+ };
+ var create = function create2() {
+ return util.Buffer ? function create_buffer_setup(buffer) {
+ return (Reader3.create = function create_buffer(buffer2) {
+ return util.Buffer.isBuffer(buffer2) ? new BufferReader(buffer2) : create_array(buffer2);
+ })(buffer);
+ } : create_array;
+ };
+ Reader3.create = create();
+ Reader3.prototype._slice = util.Array.prototype.subarray || util.Array.prototype.slice;
+ Reader3.prototype.uint32 = function read_uint32_setup() {
+ var value = 4294967295;
+ return function read_uint32() {
+ value = (this.buf[this.pos] & 127) >>> 0;
+ if (this.buf[this.pos++] < 128)
+ return value;
+ value = (value | (this.buf[this.pos] & 127) << 7) >>> 0;
+ if (this.buf[this.pos++] < 128)
+ return value;
+ value = (value | (this.buf[this.pos] & 127) << 14) >>> 0;
+ if (this.buf[this.pos++] < 128)
+ return value;
+ value = (value | (this.buf[this.pos] & 127) << 21) >>> 0;
+ if (this.buf[this.pos++] < 128)
+ return value;
+ value = (value | (this.buf[this.pos] & 15) << 28) >>> 0;
+ if (this.buf[this.pos++] < 128)
+ return value;
+ if ((this.pos += 5) > this.len) {
+ this.pos = this.len;
+ throw indexOutOfRange(this, 10);
+ }
+ return value;
+ };
+ }();
+ Reader3.prototype.int32 = function read_int32() {
+ return this.uint32() | 0;
+ };
+ Reader3.prototype.sint32 = function read_sint32() {
+ var value = this.uint32();
+ return value >>> 1 ^ -(value & 1) | 0;
+ };
+ function readLongVarint() {
+ var bits = new LongBits(0, 0);
+ var i = 0;
+ if (this.len - this.pos > 4) {
+ for (; i < 4; ++i) {
+ bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;
+ if (this.buf[this.pos++] < 128)
+ return bits;
+ }
+ bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;
+ bits.hi = (bits.hi | (this.buf[this.pos] & 127) >> 4) >>> 0;
+ if (this.buf[this.pos++] < 128)
+ return bits;
+ i = 0;
+ } else {
+ for (; i < 3; ++i) {
+ if (this.pos >= this.len)
+ throw indexOutOfRange(this);
+ bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;
+ if (this.buf[this.pos++] < 128)
+ return bits;
+ }
+ bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;
+ return bits;
+ }
+ if (this.len - this.pos > 4) {
+ for (; i < 5; ++i) {
+ bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;
+ if (this.buf[this.pos++] < 128)
+ return bits;
+ }
+ } else {
+ for (; i < 5; ++i) {
+ if (this.pos >= this.len)
+ throw indexOutOfRange(this);
+ bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;
+ if (this.buf[this.pos++] < 128)
+ return bits;
+ }
+ }
+ throw Error("invalid varint encoding");
+ }
+ Reader3.prototype.bool = function read_bool() {
+ return this.uint32() !== 0;
+ };
+ function readFixed32_end(buf, end) {
+ return (buf[end - 4] | buf[end - 3] << 8 | buf[end - 2] << 16 | buf[end - 1] << 24) >>> 0;
+ }
+ Reader3.prototype.fixed32 = function read_fixed32() {
+ if (this.pos + 4 > this.len)
+ throw indexOutOfRange(this, 4);
+ return readFixed32_end(this.buf, this.pos += 4);
+ };
+ Reader3.prototype.sfixed32 = function read_sfixed32() {
+ if (this.pos + 4 > this.len)
+ throw indexOutOfRange(this, 4);
+ return readFixed32_end(this.buf, this.pos += 4) | 0;
+ };
+ function readFixed64() {
+ if (this.pos + 8 > this.len)
+ throw indexOutOfRange(this, 8);
+ return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));
+ }
+ Reader3.prototype.float = function read_float() {
+ if (this.pos + 4 > this.len)
+ throw indexOutOfRange(this, 4);
+ var value = util.float.readFloatLE(this.buf, this.pos);
+ this.pos += 4;
+ return value;
+ };
+ Reader3.prototype.double = function read_double() {
+ if (this.pos + 8 > this.len)
+ throw indexOutOfRange(this, 4);
+ var value = util.float.readDoubleLE(this.buf, this.pos);
+ this.pos += 8;
+ return value;
+ };
+ Reader3.prototype.bytes = function read_bytes() {
+ var length3 = this.uint32(), start = this.pos, end = this.pos + length3;
+ if (end > this.len)
+ throw indexOutOfRange(this, length3);
+ this.pos += length3;
+ if (Array.isArray(this.buf))
+ return this.buf.slice(start, end);
+ return start === end ? new this.buf.constructor(0) : this._slice.call(this.buf, start, end);
+ };
+ Reader3.prototype.string = function read_string() {
+ var bytes = this.bytes();
+ return utf8.read(bytes, 0, bytes.length);
+ };
+ Reader3.prototype.skip = function skip(length3) {
+ if (typeof length3 === "number") {
+ if (this.pos + length3 > this.len)
+ throw indexOutOfRange(this, length3);
+ this.pos += length3;
+ } else {
+ do {
+ if (this.pos >= this.len)
+ throw indexOutOfRange(this);
+ } while (this.buf[this.pos++] & 128);
+ }
+ return this;
+ };
+ Reader3.prototype.skipType = function(wireType) {
+ switch (wireType) {
+ case 0:
+ this.skip();
+ break;
+ case 1:
+ this.skip(8);
+ break;
+ case 2:
+ this.skip(this.uint32());
+ break;
+ case 3:
+ while ((wireType = this.uint32() & 7) !== 4) {
+ this.skipType(wireType);
+ }
+ break;
+ case 5:
+ this.skip(4);
+ break;
+ default:
+ throw Error("invalid wire type " + wireType + " at offset " + this.pos);
+ }
+ return this;
+ };
+ Reader3._configure = function(BufferReader_) {
+ BufferReader = BufferReader_;
+ Reader3.create = create();
+ BufferReader._configure();
+ var fn = util.Long ? "toLong" : "toNumber";
+ util.merge(Reader3.prototype, {
+ int64: function read_int64() {
+ return readLongVarint.call(this)[fn](false);
+ },
+ uint64: function read_uint64() {
+ return readLongVarint.call(this)[fn](true);
+ },
+ sint64: function read_sint64() {
+ return readLongVarint.call(this).zzDecode()[fn](false);
+ },
+ fixed64: function read_fixed64() {
+ return readFixed64.call(this)[fn](true);
+ },
+ sfixed64: function read_sfixed64() {
+ return readFixed64.call(this)[fn](false);
+ }
+ });
+ };
+ }, { "15": 15 }], 10: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = BufferReader;
+ var Reader3 = require2(9);
+ (BufferReader.prototype = Object.create(Reader3.prototype)).constructor = BufferReader;
+ var util = require2(15);
+ function BufferReader(buffer) {
+ Reader3.call(this, buffer);
+ }
+ BufferReader._configure = function() {
+ if (util.Buffer)
+ BufferReader.prototype._slice = util.Buffer.prototype.slice;
+ };
+ BufferReader.prototype.string = function read_string_buffer() {
+ var len = this.uint32();
+ return this.buf.utf8Slice ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len)) : this.buf.toString("utf-8", this.pos, this.pos = Math.min(this.pos + len, this.len));
+ };
+ BufferReader._configure();
+ }, { "15": 15, "9": 9 }], 11: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = {};
+ }, {}], 12: [function(require2, module2, exports2) {
+ "use strict";
+ var rpc = exports2;
+ rpc.Service = require2(13);
+ }, { "13": 13 }], 13: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = Service;
+ var util = require2(15);
+ (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;
+ function Service(rpcImpl, requestDelimited, responseDelimited) {
+ if (typeof rpcImpl !== "function")
+ throw TypeError("rpcImpl must be a function");
+ util.EventEmitter.call(this);
+ this.rpcImpl = rpcImpl;
+ this.requestDelimited = Boolean(requestDelimited);
+ this.responseDelimited = Boolean(responseDelimited);
+ }
+ Service.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {
+ if (!request)
+ throw TypeError("request must be specified");
+ var self2 = this;
+ if (!callback)
+ return util.asPromise(rpcCall, self2, method, requestCtor, responseCtor, request);
+ if (!self2.rpcImpl) {
+ setTimeout(function() {
+ callback(Error("already ended"));
+ }, 0);
+ return undefined;
+ }
+ try {
+ return self2.rpcImpl(
+ method,
+ requestCtor[self2.requestDelimited ? "encodeDelimited" : "encode"](request).finish(),
+ function rpcCallback(err, response) {
+ if (err) {
+ self2.emit("error", err, method);
+ return callback(err);
+ }
+ if (response === null) {
+ self2.end(true);
+ return undefined;
+ }
+ if (!(response instanceof responseCtor)) {
+ try {
+ response = responseCtor[self2.responseDelimited ? "decodeDelimited" : "decode"](response);
+ } catch (err2) {
+ self2.emit("error", err2, method);
+ return callback(err2);
+ }
+ }
+ self2.emit("data", response, method);
+ return callback(null, response);
+ }
+ );
+ } catch (err) {
+ self2.emit("error", err, method);
+ setTimeout(function() {
+ callback(err);
+ }, 0);
+ return undefined;
+ }
+ };
+ Service.prototype.end = function end(endedByRPC) {
+ if (this.rpcImpl) {
+ if (!endedByRPC)
+ this.rpcImpl(null, null, null);
+ this.rpcImpl = null;
+ this.emit("end").off();
+ }
+ return this;
+ };
+ }, { "15": 15 }], 14: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = LongBits;
+ var util = require2(15);
+ function LongBits(lo, hi) {
+ this.lo = lo >>> 0;
+ this.hi = hi >>> 0;
+ }
+ var zero = LongBits.zero = new LongBits(0, 0);
+ zero.toNumber = function() {
+ return 0;
+ };
+ zero.zzEncode = zero.zzDecode = function() {
+ return this;
+ };
+ zero.length = function() {
+ return 1;
+ };
+ var zeroHash = LongBits.zeroHash = "\0\0\0\0\0\0\0\0";
+ LongBits.fromNumber = function fromNumber(value) {
+ if (value === 0)
+ return zero;
+ var sign2 = value < 0;
+ if (sign2)
+ value = -value;
+ var lo = value >>> 0, hi = (value - lo) / 4294967296 >>> 0;
+ if (sign2) {
+ hi = ~hi >>> 0;
+ lo = ~lo >>> 0;
+ if (++lo > 4294967295) {
+ lo = 0;
+ if (++hi > 4294967295)
+ hi = 0;
+ }
+ }
+ return new LongBits(lo, hi);
+ };
+ LongBits.from = function from(value) {
+ if (typeof value === "number")
+ return LongBits.fromNumber(value);
+ if (util.isString(value)) {
+ if (util.Long)
+ value = util.Long.fromString(value);
+ else
+ return LongBits.fromNumber(parseInt(value, 10));
+ }
+ return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;
+ };
+ LongBits.prototype.toNumber = function toNumber(unsigned) {
+ if (!unsigned && this.hi >>> 31) {
+ var lo = ~this.lo + 1 >>> 0, hi = ~this.hi >>> 0;
+ if (!lo)
+ hi = hi + 1 >>> 0;
+ return -(lo + hi * 4294967296);
+ }
+ return this.lo + this.hi * 4294967296;
+ };
+ LongBits.prototype.toLong = function toLong(unsigned) {
+ return util.Long ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned)) : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };
+ };
+ var charCodeAt = String.prototype.charCodeAt;
+ LongBits.fromHash = function fromHash(hash2) {
+ if (hash2 === zeroHash)
+ return zero;
+ return new LongBits(
+ (charCodeAt.call(hash2, 0) | charCodeAt.call(hash2, 1) << 8 | charCodeAt.call(hash2, 2) << 16 | charCodeAt.call(hash2, 3) << 24) >>> 0,
+ (charCodeAt.call(hash2, 4) | charCodeAt.call(hash2, 5) << 8 | charCodeAt.call(hash2, 6) << 16 | charCodeAt.call(hash2, 7) << 24) >>> 0
+ );
+ };
+ LongBits.prototype.toHash = function toHash() {
+ return String.fromCharCode(
+ this.lo & 255,
+ this.lo >>> 8 & 255,
+ this.lo >>> 16 & 255,
+ this.lo >>> 24,
+ this.hi & 255,
+ this.hi >>> 8 & 255,
+ this.hi >>> 16 & 255,
+ this.hi >>> 24
+ );
+ };
+ LongBits.prototype.zzEncode = function zzEncode() {
+ var mask = this.hi >> 31;
+ this.hi = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;
+ this.lo = (this.lo << 1 ^ mask) >>> 0;
+ return this;
+ };
+ LongBits.prototype.zzDecode = function zzDecode() {
+ var mask = -(this.lo & 1);
+ this.lo = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;
+ this.hi = (this.hi >>> 1 ^ mask) >>> 0;
+ return this;
+ };
+ LongBits.prototype.length = function length3() {
+ var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24;
+ return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10;
+ };
+ }, { "15": 15 }], 15: [function(require2, module2, exports2) {
+ "use strict";
+ var util = exports2;
+ util.asPromise = require2(1);
+ util.base64 = require2(2);
+ util.EventEmitter = require2(3);
+ util.float = require2(4);
+ util.inquire = require2(5);
+ util.utf8 = require2(7);
+ util.pool = require2(6);
+ util.LongBits = require2(14);
+ util.isNode = Boolean(typeof global !== "undefined" && global && global.process && global.process.versions && global.process.versions.node);
+ util.global = util.isNode && global || typeof window !== "undefined" && window || typeof self !== "undefined" && self || this;
+ util.emptyArray = Object.freeze ? Object.freeze([]) : [];
+ util.emptyObject = Object.freeze ? Object.freeze({}) : {};
+ util.isInteger = Number.isInteger || function isInteger(value) {
+ return typeof value === "number" && isFinite(value) && Math.floor(value) === value;
+ };
+ util.isString = function isString(value) {
+ return typeof value === "string" || value instanceof String;
+ };
+ util.isObject = function isObject(value) {
+ return value && typeof value === "object";
+ };
+ util.isset = util.isSet = function isSet(obj, prop) {
+ var value = obj[prop];
+ if (value != null && obj.hasOwnProperty(prop))
+ return typeof value !== "object" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;
+ return false;
+ };
+ util.Buffer = function() {
+ try {
+ var Buffer3 = util.inquire("buffer").Buffer;
+ return Buffer3.prototype.utf8Write ? Buffer3 : null;
+ } catch (e) {
+ return null;
+ }
+ }();
+ util._Buffer_from = null;
+ util._Buffer_allocUnsafe = null;
+ util.newBuffer = function newBuffer(sizeOrArray) {
+ return typeof sizeOrArray === "number" ? util.Buffer ? util._Buffer_allocUnsafe(sizeOrArray) : new util.Array(sizeOrArray) : util.Buffer ? util._Buffer_from(sizeOrArray) : typeof Uint8Array === "undefined" ? sizeOrArray : new Uint8Array(sizeOrArray);
+ };
+ util.Array = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
+ util.Long = util.global.dcodeIO && util.global.dcodeIO.Long || util.global.Long || util.inquire("long");
+ util.key2Re = /^true|false|0|1$/;
+ util.key32Re = /^-?(?:0|[1-9][0-9]*)$/;
+ util.key64Re = /^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;
+ util.longToHash = function longToHash(value) {
+ return value ? util.LongBits.from(value).toHash() : util.LongBits.zeroHash;
+ };
+ util.longFromHash = function longFromHash(hash2, unsigned) {
+ var bits = util.LongBits.fromHash(hash2);
+ if (util.Long)
+ return util.Long.fromBits(bits.lo, bits.hi, unsigned);
+ return bits.toNumber(Boolean(unsigned));
+ };
+ function merge2(dst, src, ifNotSet) {
+ for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)
+ if (dst[keys[i]] === undefined || !ifNotSet)
+ dst[keys[i]] = src[keys[i]];
+ return dst;
+ }
+ util.merge = merge2;
+ util.lcFirst = function lcFirst(str) {
+ return str.charAt(0).toLowerCase() + str.substring(1);
+ };
+ function newError(name) {
+ function CustomError(message, properties) {
+ if (!(this instanceof CustomError))
+ return new CustomError(message, properties);
+ Object.defineProperty(this, "message", { get: function() {
+ return message;
+ } });
+ if (Error.captureStackTrace)
+ Error.captureStackTrace(this, CustomError);
+ else
+ Object.defineProperty(this, "stack", { value: new Error().stack || "" });
+ if (properties)
+ merge2(this, properties);
+ }
+ CustomError.prototype = Object.create(Error.prototype, {
+ constructor: {
+ value: CustomError,
+ writable: true,
+ enumerable: false,
+ configurable: true
+ },
+ name: {
+ get: function get2() {
+ return name;
+ },
+ set: undefined,
+ enumerable: false,
+ configurable: true
+ },
+ toString: {
+ value: function value() {
+ return this.name + ": " + this.message;
+ },
+ writable: true,
+ enumerable: false,
+ configurable: true
+ }
+ });
+ return CustomError;
+ }
+ util.newError = newError;
+ util.ProtocolError = newError("ProtocolError");
+ util.oneOfGetter = function getOneOf(fieldNames) {
+ var fieldMap = {};
+ for (var i = 0; i < fieldNames.length; ++i)
+ fieldMap[fieldNames[i]] = 1;
+ return function() {
+ for (var keys = Object.keys(this), i2 = keys.length - 1; i2 > -1; --i2)
+ if (fieldMap[keys[i2]] === 1 && this[keys[i2]] !== undefined && this[keys[i2]] !== null)
+ return keys[i2];
+ };
+ };
+ util.oneOfSetter = function setOneOf(fieldNames) {
+ return function(name) {
+ for (var i = 0; i < fieldNames.length; ++i)
+ if (fieldNames[i] !== name)
+ delete this[fieldNames[i]];
+ };
+ };
+ util.toJSONOptions = {
+ longs: String,
+ enums: String,
+ bytes: String,
+ json: true
+ };
+ util._configure = function() {
+ var Buffer3 = util.Buffer;
+ if (!Buffer3) {
+ util._Buffer_from = util._Buffer_allocUnsafe = null;
+ return;
+ }
+ util._Buffer_from = Buffer3.from !== Uint8Array.from && Buffer3.from || function Buffer_from(value, encoding) {
+ return new Buffer3(value, encoding);
+ };
+ util._Buffer_allocUnsafe = Buffer3.allocUnsafe || function Buffer_allocUnsafe(size) {
+ return new Buffer3(size);
+ };
+ };
+ }, { "1": 1, "14": 14, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7 }], 16: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = Writer2;
+ var util = require2(15);
+ var BufferWriter;
+ var LongBits = util.LongBits, base64 = util.base64, utf8 = util.utf8;
+ function Op(fn, len, val) {
+ this.fn = fn;
+ this.len = len;
+ this.next = undefined;
+ this.val = val;
+ }
+ function noop() {
+ }
+ function State(writer) {
+ this.head = writer.head;
+ this.tail = writer.tail;
+ this.len = writer.len;
+ this.next = writer.states;
+ }
+ function Writer2() {
+ this.len = 0;
+ this.head = new Op(noop, 0, 0);
+ this.tail = this.head;
+ this.states = null;
+ }
+ var create = function create2() {
+ return util.Buffer ? function create_buffer_setup() {
+ return (Writer2.create = function create_buffer() {
+ return new BufferWriter();
+ })();
+ } : function create_array() {
+ return new Writer2();
+ };
+ };
+ Writer2.create = create();
+ Writer2.alloc = function alloc(size) {
+ return new util.Array(size);
+ };
+ if (util.Array !== Array)
+ Writer2.alloc = util.pool(Writer2.alloc, util.Array.prototype.subarray);
+ Writer2.prototype._push = function push(fn, len, val) {
+ this.tail = this.tail.next = new Op(fn, len, val);
+ this.len += len;
+ return this;
+ };
+ function writeByte(val, buf, pos) {
+ buf[pos] = val & 255;
+ }
+ function writeVarint32(val, buf, pos) {
+ while (val > 127) {
+ buf[pos++] = val & 127 | 128;
+ val >>>= 7;
+ }
+ buf[pos] = val;
+ }
+ function VarintOp(len, val) {
+ this.len = len;
+ this.next = undefined;
+ this.val = val;
+ }
+ VarintOp.prototype = Object.create(Op.prototype);
+ VarintOp.prototype.fn = writeVarint32;
+ Writer2.prototype.uint32 = function write_uint32(value) {
+ this.len += (this.tail = this.tail.next = new VarintOp(
+ (value = value >>> 0) < 128 ? 1 : value < 16384 ? 2 : value < 2097152 ? 3 : value < 268435456 ? 4 : 5,
+ value
+ )).len;
+ return this;
+ };
+ Writer2.prototype.int32 = function write_int32(value) {
+ return value < 0 ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) : this.uint32(value);
+ };
+ Writer2.prototype.sint32 = function write_sint32(value) {
+ return this.uint32((value << 1 ^ value >> 31) >>> 0);
+ };
+ function writeVarint64(val, buf, pos) {
+ while (val.hi) {
+ buf[pos++] = val.lo & 127 | 128;
+ val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;
+ val.hi >>>= 7;
+ }
+ while (val.lo > 127) {
+ buf[pos++] = val.lo & 127 | 128;
+ val.lo = val.lo >>> 7;
+ }
+ buf[pos++] = val.lo;
+ }
+ Writer2.prototype.uint64 = function write_uint64(value) {
+ var bits = LongBits.from(value);
+ return this._push(writeVarint64, bits.length(), bits);
+ };
+ Writer2.prototype.int64 = Writer2.prototype.uint64;
+ Writer2.prototype.sint64 = function write_sint64(value) {
+ var bits = LongBits.from(value).zzEncode();
+ return this._push(writeVarint64, bits.length(), bits);
+ };
+ Writer2.prototype.bool = function write_bool(value) {
+ return this._push(writeByte, 1, value ? 1 : 0);
+ };
+ function writeFixed32(val, buf, pos) {
+ buf[pos] = val & 255;
+ buf[pos + 1] = val >>> 8 & 255;
+ buf[pos + 2] = val >>> 16 & 255;
+ buf[pos + 3] = val >>> 24;
+ }
+ Writer2.prototype.fixed32 = function write_fixed32(value) {
+ return this._push(writeFixed32, 4, value >>> 0);
+ };
+ Writer2.prototype.sfixed32 = Writer2.prototype.fixed32;
+ Writer2.prototype.fixed64 = function write_fixed64(value) {
+ var bits = LongBits.from(value);
+ return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);
+ };
+ Writer2.prototype.sfixed64 = Writer2.prototype.fixed64;
+ Writer2.prototype.float = function write_float(value) {
+ return this._push(util.float.writeFloatLE, 4, value);
+ };
+ Writer2.prototype.double = function write_double(value) {
+ return this._push(util.float.writeDoubleLE, 8, value);
+ };
+ var writeBytes = util.Array.prototype.set ? function writeBytes_set(val, buf, pos) {
+ buf.set(val, pos);
+ } : function writeBytes_for(val, buf, pos) {
+ for (var i = 0; i < val.length; ++i)
+ buf[pos + i] = val[i];
+ };
+ Writer2.prototype.bytes = function write_bytes(value) {
+ var len = value.length >>> 0;
+ if (!len)
+ return this._push(writeByte, 1, 0);
+ if (util.isString(value)) {
+ var buf = Writer2.alloc(len = base64.length(value));
+ base64.decode(value, buf, 0);
+ value = buf;
+ }
+ return this.uint32(len)._push(writeBytes, len, value);
+ };
+ Writer2.prototype.string = function write_string(value) {
+ var len = utf8.length(value);
+ return len ? this.uint32(len)._push(utf8.write, len, value) : this._push(writeByte, 1, 0);
+ };
+ Writer2.prototype.fork = function fork() {
+ this.states = new State(this);
+ this.head = this.tail = new Op(noop, 0, 0);
+ this.len = 0;
+ return this;
+ };
+ Writer2.prototype.reset = function reset() {
+ if (this.states) {
+ this.head = this.states.head;
+ this.tail = this.states.tail;
+ this.len = this.states.len;
+ this.states = this.states.next;
+ } else {
+ this.head = this.tail = new Op(noop, 0, 0);
+ this.len = 0;
+ }
+ return this;
+ };
+ Writer2.prototype.ldelim = function ldelim() {
+ var head = this.head, tail = this.tail, len = this.len;
+ this.reset().uint32(len);
+ if (len) {
+ this.tail.next = head.next;
+ this.tail = tail;
+ this.len += len;
+ }
+ return this;
+ };
+ Writer2.prototype.finish = function finish() {
+ var head = this.head.next, buf = this.constructor.alloc(this.len), pos = 0;
+ while (head) {
+ head.fn(head.val, buf, pos);
+ pos += head.len;
+ head = head.next;
+ }
+ return buf;
+ };
+ Writer2._configure = function(BufferWriter_) {
+ BufferWriter = BufferWriter_;
+ Writer2.create = create();
+ BufferWriter._configure();
+ };
+ }, { "15": 15 }], 17: [function(require2, module2, exports2) {
+ "use strict";
+ module2.exports = BufferWriter;
+ var Writer2 = require2(16);
+ (BufferWriter.prototype = Object.create(Writer2.prototype)).constructor = BufferWriter;
+ var util = require2(15);
+ function BufferWriter() {
+ Writer2.call(this);
+ }
+ BufferWriter._configure = function() {
+ BufferWriter.alloc = util._Buffer_allocUnsafe;
+ BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === "set" ? function writeBytesBuffer_set(val, buf, pos) {
+ buf.set(val, pos);
+ } : function writeBytesBuffer_copy(val, buf, pos) {
+ if (val.copy)
+ val.copy(buf, pos, 0, val.length);
+ else
+ for (var i = 0; i < val.length; )
+ buf[pos++] = val[i++];
+ };
+ };
+ BufferWriter.prototype.bytes = function write_bytes_buffer(value) {
+ if (util.isString(value))
+ value = util._Buffer_from(value, "base64");
+ var len = value.length >>> 0;
+ this.uint32(len);
+ if (len)
+ this._push(BufferWriter.writeBytesBuffer, len, value);
+ return this;
+ };
+ function writeStringBuffer(val, buf, pos) {
+ if (val.length < 40)
+ util.utf8.write(val, buf, pos);
+ else if (buf.utf8Write)
+ buf.utf8Write(val, pos);
+ else
+ buf.write(val, pos);
+ }
+ BufferWriter.prototype.string = function write_string_buffer(value) {
+ var len = util.Buffer.byteLength(value);
+ this.uint32(len);
+ if (len)
+ this._push(writeStringBuffer, len, value);
+ return this;
+ };
+ BufferWriter._configure();
+ }, { "15": 15, "16": 16 }] }, {}, [8]);
+ })();
+ }
+});
+
+// node_modules/lerc/LercDecode.js
+var require_LercDecode = __commonJS({
+ "node_modules/lerc/LercDecode.js"(exports2, module2) {
+ /* Copyright 2015-2018 Esri. 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 @preserve */
+ (function() {
+ var LercDecode = function() {
+ var CntZImage = {};
+ CntZImage.defaultNoDataValue = -34027999387901484e22;
+ CntZImage.decode = function(input, options) {
+ options = options || {};
+ var skipMask = options.encodedMaskData || options.encodedMaskData === null;
+ var parsedData = parse3(input, options.inputOffset || 0, skipMask);
+ var noDataValue = options.noDataValue !== null ? options.noDataValue : CntZImage.defaultNoDataValue;
+ var uncompressedData = uncompressPixelValues(
+ parsedData,
+ options.pixelType || Float32Array,
+ options.encodedMaskData,
+ noDataValue,
+ options.returnMask
+ );
+ var result = {
+ width: parsedData.width,
+ height: parsedData.height,
+ pixelData: uncompressedData.resultPixels,
+ minValue: uncompressedData.minValue,
+ maxValue: parsedData.pixels.maxValue,
+ noDataValue
+ };
+ if (uncompressedData.resultMask) {
+ result.maskData = uncompressedData.resultMask;
+ }
+ if (options.returnEncodedMask && parsedData.mask) {
+ result.encodedMaskData = parsedData.mask.bitset ? parsedData.mask.bitset : null;
+ }
+ if (options.returnFileInfo) {
+ result.fileInfo = formatFileInfo(parsedData);
+ if (options.computeUsedBitDepths) {
+ result.fileInfo.bitDepths = computeUsedBitDepths(parsedData);
+ }
+ }
+ return result;
+ };
+ var uncompressPixelValues = function(data, TypedArrayClass, maskBitset, noDataValue, storeDecodedMask) {
+ var blockIdx = 0;
+ var numX = data.pixels.numBlocksX;
+ var numY = data.pixels.numBlocksY;
+ var blockWidth = Math.floor(data.width / numX);
+ var blockHeight = Math.floor(data.height / numY);
+ var scale = 2 * data.maxZError;
+ var minValue = Number.MAX_VALUE, currentValue;
+ maskBitset = maskBitset || (data.mask ? data.mask.bitset : null);
+ var resultPixels, resultMask;
+ resultPixels = new TypedArrayClass(data.width * data.height);
+ if (storeDecodedMask && maskBitset) {
+ resultMask = new Uint8Array(data.width * data.height);
+ }
+ var blockDataBuffer = new Float32Array(blockWidth * blockHeight);
+ var xx, yy;
+ for (var y = 0; y <= numY; y++) {
+ var thisBlockHeight = y !== numY ? blockHeight : data.height % numY;
+ if (thisBlockHeight === 0) {
+ continue;
+ }
+ for (var x = 0; x <= numX; x++) {
+ var thisBlockWidth = x !== numX ? blockWidth : data.width % numX;
+ if (thisBlockWidth === 0) {
+ continue;
+ }
+ var outPtr = y * data.width * blockHeight + x * blockWidth;
+ var outStride = data.width - thisBlockWidth;
+ var block = data.pixels.blocks[blockIdx];
+ var blockData, blockPtr, constValue;
+ if (block.encoding < 2) {
+ if (block.encoding === 0) {
+ blockData = block.rawData;
+ } else {
+ unstuff(block.stuffedData, block.bitsPerPixel, block.numValidPixels, block.offset, scale, blockDataBuffer, data.pixels.maxValue);
+ blockData = blockDataBuffer;
+ }
+ blockPtr = 0;
+ } else if (block.encoding === 2) {
+ constValue = 0;
+ } else {
+ constValue = block.offset;
+ }
+ var maskByte;
+ if (maskBitset) {
+ for (yy = 0; yy < thisBlockHeight; yy++) {
+ if (outPtr & 7) {
+ maskByte = maskBitset[outPtr >> 3];
+ maskByte <<= outPtr & 7;
+ }
+ for (xx = 0; xx < thisBlockWidth; xx++) {
+ if (!(outPtr & 7)) {
+ maskByte = maskBitset[outPtr >> 3];
+ }
+ if (maskByte & 128) {
+ if (resultMask) {
+ resultMask[outPtr] = 1;
+ }
+ currentValue = block.encoding < 2 ? blockData[blockPtr++] : constValue;
+ minValue = minValue > currentValue ? currentValue : minValue;
+ resultPixels[outPtr++] = currentValue;
+ } else {
+ if (resultMask) {
+ resultMask[outPtr] = 0;
+ }
+ resultPixels[outPtr++] = noDataValue;
+ }
+ maskByte <<= 1;
+ }
+ outPtr += outStride;
+ }
+ } else {
+ if (block.encoding < 2) {
+ for (yy = 0; yy < thisBlockHeight; yy++) {
+ for (xx = 0; xx < thisBlockWidth; xx++) {
+ currentValue = blockData[blockPtr++];
+ minValue = minValue > currentValue ? currentValue : minValue;
+ resultPixels[outPtr++] = currentValue;
+ }
+ outPtr += outStride;
+ }
+ } else {
+ minValue = minValue > constValue ? constValue : minValue;
+ for (yy = 0; yy < thisBlockHeight; yy++) {
+ for (xx = 0; xx < thisBlockWidth; xx++) {
+ resultPixels[outPtr++] = constValue;
+ }
+ outPtr += outStride;
+ }
+ }
+ }
+ if (block.encoding === 1 && blockPtr !== block.numValidPixels) {
+ throw "Block and Mask do not match";
+ }
+ blockIdx++;
+ }
+ }
+ return {
+ resultPixels,
+ resultMask,
+ minValue
+ };
+ };
+ var formatFileInfo = function(data) {
+ return {
+ "fileIdentifierString": data.fileIdentifierString,
+ "fileVersion": data.fileVersion,
+ "imageType": data.imageType,
+ "height": data.height,
+ "width": data.width,
+ "maxZError": data.maxZError,
+ "eofOffset": data.eofOffset,
+ "mask": data.mask ? {
+ "numBlocksX": data.mask.numBlocksX,
+ "numBlocksY": data.mask.numBlocksY,
+ "numBytes": data.mask.numBytes,
+ "maxValue": data.mask.maxValue
+ } : null,
+ "pixels": {
+ "numBlocksX": data.pixels.numBlocksX,
+ "numBlocksY": data.pixels.numBlocksY,
+ "numBytes": data.pixels.numBytes,
+ "maxValue": data.pixels.maxValue,
+ "noDataValue": data.noDataValue
+ }
+ };
+ };
+ var computeUsedBitDepths = function(data) {
+ var numBlocks = data.pixels.numBlocksX * data.pixels.numBlocksY;
+ var bitDepths = {};
+ for (var i = 0; i < numBlocks; i++) {
+ var block = data.pixels.blocks[i];
+ if (block.encoding === 0) {
+ bitDepths.float32 = true;
+ } else if (block.encoding === 1) {
+ bitDepths[block.bitsPerPixel] = true;
+ } else {
+ bitDepths[0] = true;
+ }
+ }
+ return Object.keys(bitDepths);
+ };
+ var parse3 = function(input, fp, skipMask) {
+ var data = {};
+ var fileIdView = new Uint8Array(input, fp, 10);
+ data.fileIdentifierString = String.fromCharCode.apply(null, fileIdView);
+ if (data.fileIdentifierString.trim() !== "CntZImage") {
+ throw "Unexpected file identifier string: " + data.fileIdentifierString;
+ }
+ fp += 10;
+ var view = new DataView(input, fp, 24);
+ data.fileVersion = view.getInt32(0, true);
+ data.imageType = view.getInt32(4, true);
+ data.height = view.getUint32(8, true);
+ data.width = view.getUint32(12, true);
+ data.maxZError = view.getFloat64(16, true);
+ fp += 24;
+ if (!skipMask) {
+ view = new DataView(input, fp, 16);
+ data.mask = {};
+ data.mask.numBlocksY = view.getUint32(0, true);
+ data.mask.numBlocksX = view.getUint32(4, true);
+ data.mask.numBytes = view.getUint32(8, true);
+ data.mask.maxValue = view.getFloat32(12, true);
+ fp += 16;
+ if (data.mask.numBytes > 0) {
+ var bitset = new Uint8Array(Math.ceil(data.width * data.height / 8));
+ view = new DataView(input, fp, data.mask.numBytes);
+ var cnt = view.getInt16(0, true);
+ var ip = 2, op = 0;
+ do {
+ if (cnt > 0) {
+ while (cnt--) {
+ bitset[op++] = view.getUint8(ip++);
+ }
+ } else {
+ var val = view.getUint8(ip++);
+ cnt = -cnt;
+ while (cnt--) {
+ bitset[op++] = val;
+ }
+ }
+ cnt = view.getInt16(ip, true);
+ ip += 2;
+ } while (ip < data.mask.numBytes);
+ if (cnt !== -32768 || op < bitset.length) {
+ throw "Unexpected end of mask RLE encoding";
+ }
+ data.mask.bitset = bitset;
+ fp += data.mask.numBytes;
+ } else if ((data.mask.numBytes | data.mask.numBlocksY | data.mask.maxValue) === 0) {
+ data.mask.bitset = new Uint8Array(Math.ceil(data.width * data.height / 8));
+ }
+ }
+ view = new DataView(input, fp, 16);
+ data.pixels = {};
+ data.pixels.numBlocksY = view.getUint32(0, true);
+ data.pixels.numBlocksX = view.getUint32(4, true);
+ data.pixels.numBytes = view.getUint32(8, true);
+ data.pixels.maxValue = view.getFloat32(12, true);
+ fp += 16;
+ var numBlocksX = data.pixels.numBlocksX;
+ var numBlocksY = data.pixels.numBlocksY;
+ var actualNumBlocksX = numBlocksX + (data.width % numBlocksX > 0 ? 1 : 0);
+ var actualNumBlocksY = numBlocksY + (data.height % numBlocksY > 0 ? 1 : 0);
+ data.pixels.blocks = new Array(actualNumBlocksX * actualNumBlocksY);
+ var blockI = 0;
+ for (var blockY = 0; blockY < actualNumBlocksY; blockY++) {
+ for (var blockX = 0; blockX < actualNumBlocksX; blockX++) {
+ var size = 0;
+ var bytesLeft = input.byteLength - fp;
+ view = new DataView(input, fp, Math.min(10, bytesLeft));
+ var block = {};
+ data.pixels.blocks[blockI++] = block;
+ var headerByte = view.getUint8(0);
+ size++;
+ block.encoding = headerByte & 63;
+ if (block.encoding > 3) {
+ throw "Invalid block encoding (" + block.encoding + ")";
+ }
+ if (block.encoding === 2) {
+ fp++;
+ continue;
+ }
+ if (headerByte !== 0 && headerByte !== 2) {
+ headerByte >>= 6;
+ block.offsetType = headerByte;
+ if (headerByte === 2) {
+ block.offset = view.getInt8(1);
+ size++;
+ } else if (headerByte === 1) {
+ block.offset = view.getInt16(1, true);
+ size += 2;
+ } else if (headerByte === 0) {
+ block.offset = view.getFloat32(1, true);
+ size += 4;
+ } else {
+ throw "Invalid block offset type";
+ }
+ if (block.encoding === 1) {
+ headerByte = view.getUint8(size);
+ size++;
+ block.bitsPerPixel = headerByte & 63;
+ headerByte >>= 6;
+ block.numValidPixelsType = headerByte;
+ if (headerByte === 2) {
+ block.numValidPixels = view.getUint8(size);
+ size++;
+ } else if (headerByte === 1) {
+ block.numValidPixels = view.getUint16(size, true);
+ size += 2;
+ } else if (headerByte === 0) {
+ block.numValidPixels = view.getUint32(size, true);
+ size += 4;
+ } else {
+ throw "Invalid valid pixel count type";
+ }
+ }
+ }
+ fp += size;
+ if (block.encoding === 3) {
+ continue;
+ }
+ var arrayBuf, store8;
+ if (block.encoding === 0) {
+ var numPixels = (data.pixels.numBytes - 1) / 4;
+ if (numPixels !== Math.floor(numPixels)) {
+ throw "uncompressed block has invalid length";
+ }
+ arrayBuf = new ArrayBuffer(numPixels * 4);
+ store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, fp, numPixels * 4));
+ var rawData = new Float32Array(arrayBuf);
+ block.rawData = rawData;
+ fp += numPixels * 4;
+ } else if (block.encoding === 1) {
+ var dataBytes = Math.ceil(block.numValidPixels * block.bitsPerPixel / 8);
+ var dataWords = Math.ceil(dataBytes / 4);
+ arrayBuf = new ArrayBuffer(dataWords * 4);
+ store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, fp, dataBytes));
+ block.stuffedData = new Uint32Array(arrayBuf);
+ fp += dataBytes;
+ }
+ }
+ }
+ data.eofOffset = fp;
+ return data;
+ };
+ var unstuff = function(src, bitsPerPixel, numPixels, offset2, scale, dest, maxValue) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o;
+ var bitsLeft = 0;
+ var n, buffer;
+ var nmax = Math.ceil((maxValue - offset2) / scale);
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = buffer >>> bitsLeft - bitsPerPixel & bitMask;
+ bitsLeft -= bitsPerPixel;
+ } else {
+ var missingBits = bitsPerPixel - bitsLeft;
+ n = (buffer & bitMask) << missingBits & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n += buffer >>> bitsLeft;
+ }
+ dest[o] = n < nmax ? offset2 + n * scale : maxValue;
+ }
+ return dest;
+ };
+ return CntZImage;
+ }();
+ var Lerc2Decode = function() {
+ "use strict";
+ var BitStuffer = {
+ unstuff: function(src, dest, bitsPerPixel, numPixels, lutArr, offset2, scale, maxValue) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o;
+ var bitsLeft = 0;
+ var n, buffer, missingBits, nmax;
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
+ if (lutArr) {
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = buffer >>> bitsLeft - bitsPerPixel & bitMask;
+ bitsLeft -= bitsPerPixel;
+ } else {
+ missingBits = bitsPerPixel - bitsLeft;
+ n = (buffer & bitMask) << missingBits & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n += buffer >>> bitsLeft;
+ }
+ dest[o] = lutArr[n];
+ }
+ } else {
+ nmax = Math.ceil((maxValue - offset2) / scale);
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = buffer >>> bitsLeft - bitsPerPixel & bitMask;
+ bitsLeft -= bitsPerPixel;
+ } else {
+ missingBits = bitsPerPixel - bitsLeft;
+ n = (buffer & bitMask) << missingBits & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n += buffer >>> bitsLeft;
+ }
+ dest[o] = n < nmax ? offset2 + n * scale : maxValue;
+ }
+ }
+ },
+ unstuffLUT: function(src, bitsPerPixel, numPixels, offset2, scale, maxValue) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o = 0, missingBits = 0, bitsLeft = 0, n = 0;
+ var buffer;
+ var dest = [];
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
+ var nmax = Math.ceil((maxValue - offset2) / scale);
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = buffer >>> bitsLeft - bitsPerPixel & bitMask;
+ bitsLeft -= bitsPerPixel;
+ } else {
+ missingBits = bitsPerPixel - bitsLeft;
+ n = (buffer & bitMask) << missingBits & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n += buffer >>> bitsLeft;
+ }
+ dest[o] = n < nmax ? offset2 + n * scale : maxValue;
+ }
+ dest.unshift(offset2);
+ return dest;
+ },
+ unstuff2: function(src, dest, bitsPerPixel, numPixels, lutArr, offset2, scale, maxValue) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o;
+ var bitsLeft = 0, bitPos = 0;
+ var n, buffer, missingBits;
+ if (lutArr) {
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ bitPos = 0;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = buffer >>> bitPos & bitMask;
+ bitsLeft -= bitsPerPixel;
+ bitPos += bitsPerPixel;
+ } else {
+ missingBits = bitsPerPixel - bitsLeft;
+ n = buffer >>> bitPos & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n |= (buffer & (1 << missingBits) - 1) << bitsPerPixel - missingBits;
+ bitPos = missingBits;
+ }
+ dest[o] = lutArr[n];
+ }
+ } else {
+ var nmax = Math.ceil((maxValue - offset2) / scale);
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ bitPos = 0;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = buffer >>> bitPos & bitMask;
+ bitsLeft -= bitsPerPixel;
+ bitPos += bitsPerPixel;
+ } else {
+ missingBits = bitsPerPixel - bitsLeft;
+ n = buffer >>> bitPos & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n |= (buffer & (1 << missingBits) - 1) << bitsPerPixel - missingBits;
+ bitPos = missingBits;
+ }
+ dest[o] = n < nmax ? offset2 + n * scale : maxValue;
+ }
+ }
+ return dest;
+ },
+ unstuffLUT2: function(src, bitsPerPixel, numPixels, offset2, scale, maxValue) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o = 0, missingBits = 0, bitsLeft = 0, n = 0, bitPos = 0;
+ var buffer;
+ var dest = [];
+ var nmax = Math.ceil((maxValue - offset2) / scale);
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ bitPos = 0;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = buffer >>> bitPos & bitMask;
+ bitsLeft -= bitsPerPixel;
+ bitPos += bitsPerPixel;
+ } else {
+ missingBits = bitsPerPixel - bitsLeft;
+ n = buffer >>> bitPos & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n |= (buffer & (1 << missingBits) - 1) << bitsPerPixel - missingBits;
+ bitPos = missingBits;
+ }
+ dest[o] = n < nmax ? offset2 + n * scale : maxValue;
+ }
+ dest.unshift(offset2);
+ return dest;
+ },
+ originalUnstuff: function(src, dest, bitsPerPixel, numPixels) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o;
+ var bitsLeft = 0;
+ var n, buffer, missingBits;
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = buffer >>> bitsLeft - bitsPerPixel & bitMask;
+ bitsLeft -= bitsPerPixel;
+ } else {
+ missingBits = bitsPerPixel - bitsLeft;
+ n = (buffer & bitMask) << missingBits & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n += buffer >>> bitsLeft;
+ }
+ dest[o] = n;
+ }
+ return dest;
+ },
+ originalUnstuff2: function(src, dest, bitsPerPixel, numPixels) {
+ var bitMask = (1 << bitsPerPixel) - 1;
+ var i = 0, o;
+ var bitsLeft = 0, bitPos = 0;
+ var n, buffer, missingBits;
+ for (o = 0; o < numPixels; o++) {
+ if (bitsLeft === 0) {
+ buffer = src[i++];
+ bitsLeft = 32;
+ bitPos = 0;
+ }
+ if (bitsLeft >= bitsPerPixel) {
+ n = buffer >>> bitPos & bitMask;
+ bitsLeft -= bitsPerPixel;
+ bitPos += bitsPerPixel;
+ } else {
+ missingBits = bitsPerPixel - bitsLeft;
+ n = buffer >>> bitPos & bitMask;
+ buffer = src[i++];
+ bitsLeft = 32 - missingBits;
+ n |= (buffer & (1 << missingBits) - 1) << bitsPerPixel - missingBits;
+ bitPos = missingBits;
+ }
+ dest[o] = n;
+ }
+ return dest;
+ }
+ };
+ var Lerc2Helpers = {
+ HUFFMAN_LUT_BITS_MAX: 12,
+ computeChecksumFletcher32: function(input) {
+ var sum1 = 65535, sum2 = 65535;
+ var len = input.length;
+ var words = Math.floor(len / 2);
+ var i = 0;
+ while (words) {
+ var tlen = words >= 359 ? 359 : words;
+ words -= tlen;
+ do {
+ sum1 += input[i++] << 8;
+ sum2 += sum1 += input[i++];
+ } while (--tlen);
+ sum1 = (sum1 & 65535) + (sum1 >>> 16);
+ sum2 = (sum2 & 65535) + (sum2 >>> 16);
+ }
+ if (len & 1) {
+ sum2 += sum1 += input[i] << 8;
+ }
+ sum1 = (sum1 & 65535) + (sum1 >>> 16);
+ sum2 = (sum2 & 65535) + (sum2 >>> 16);
+ return (sum2 << 16 | sum1) >>> 0;
+ },
+ readHeaderInfo: function(input, data) {
+ var ptr = data.ptr;
+ var fileIdView = new Uint8Array(input, ptr, 6);
+ var headerInfo = {};
+ headerInfo.fileIdentifierString = String.fromCharCode.apply(null, fileIdView);
+ if (headerInfo.fileIdentifierString.lastIndexOf("Lerc2", 0) !== 0) {
+ throw "Unexpected file identifier string (expect Lerc2 ): " + headerInfo.fileIdentifierString;
+ }
+ ptr += 6;
+ var view = new DataView(input, ptr, 8);
+ var fileVersion = view.getInt32(0, true);
+ headerInfo.fileVersion = fileVersion;
+ ptr += 4;
+ if (fileVersion >= 3) {
+ headerInfo.checksum = view.getUint32(4, true);
+ ptr += 4;
+ }
+ view = new DataView(input, ptr, 12);
+ headerInfo.height = view.getUint32(0, true);
+ headerInfo.width = view.getUint32(4, true);
+ ptr += 8;
+ if (fileVersion >= 4) {
+ headerInfo.numDims = view.getUint32(8, true);
+ ptr += 4;
+ } else {
+ headerInfo.numDims = 1;
+ }
+ view = new DataView(input, ptr, 40);
+ headerInfo.numValidPixel = view.getUint32(0, true);
+ headerInfo.microBlockSize = view.getInt32(4, true);
+ headerInfo.blobSize = view.getInt32(8, true);
+ headerInfo.imageType = view.getInt32(12, true);
+ headerInfo.maxZError = view.getFloat64(16, true);
+ headerInfo.zMin = view.getFloat64(24, true);
+ headerInfo.zMax = view.getFloat64(32, true);
+ ptr += 40;
+ data.headerInfo = headerInfo;
+ data.ptr = ptr;
+ var checksum, keyLength;
+ if (fileVersion >= 3) {
+ keyLength = fileVersion >= 4 ? 52 : 48;
+ checksum = this.computeChecksumFletcher32(new Uint8Array(input, ptr - keyLength, headerInfo.blobSize - 14));
+ if (checksum !== headerInfo.checksum) {
+ throw "Checksum failed.";
+ }
+ }
+ return true;
+ },
+ checkMinMaxRanges: function(input, data) {
+ var headerInfo = data.headerInfo;
+ var OutPixelTypeArray = this.getDataTypeArray(headerInfo.imageType);
+ var rangeBytes = headerInfo.numDims * this.getDataTypeSize(headerInfo.imageType);
+ var minValues = this.readSubArray(input, data.ptr, OutPixelTypeArray, rangeBytes);
+ var maxValues = this.readSubArray(input, data.ptr + rangeBytes, OutPixelTypeArray, rangeBytes);
+ data.ptr += 2 * rangeBytes;
+ var i, equal = true;
+ for (i = 0; i < headerInfo.numDims; i++) {
+ if (minValues[i] !== maxValues[i]) {
+ equal = false;
+ break;
+ }
+ }
+ headerInfo.minValues = minValues;
+ headerInfo.maxValues = maxValues;
+ return equal;
+ },
+ readSubArray: function(input, ptr, OutPixelTypeArray, numBytes) {
+ var rawData;
+ if (OutPixelTypeArray === Uint8Array) {
+ rawData = new Uint8Array(input, ptr, numBytes);
+ } else {
+ var arrayBuf = new ArrayBuffer(numBytes);
+ var store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, ptr, numBytes));
+ rawData = new OutPixelTypeArray(arrayBuf);
+ }
+ return rawData;
+ },
+ readMask: function(input, data) {
+ var ptr = data.ptr;
+ var headerInfo = data.headerInfo;
+ var numPixels = headerInfo.width * headerInfo.height;
+ var numValidPixel = headerInfo.numValidPixel;
+ var view = new DataView(input, ptr, 4);
+ var mask = {};
+ mask.numBytes = view.getUint32(0, true);
+ ptr += 4;
+ if ((0 === numValidPixel || numPixels === numValidPixel) && 0 !== mask.numBytes) {
+ throw "invalid mask";
+ }
+ var bitset, resultMask;
+ if (numValidPixel === 0) {
+ bitset = new Uint8Array(Math.ceil(numPixels / 8));
+ mask.bitset = bitset;
+ resultMask = new Uint8Array(numPixels);
+ data.pixels.resultMask = resultMask;
+ ptr += mask.numBytes;
+ } else if (mask.numBytes > 0) {
+ bitset = new Uint8Array(Math.ceil(numPixels / 8));
+ view = new DataView(input, ptr, mask.numBytes);
+ var cnt = view.getInt16(0, true);
+ var ip = 2, op = 0, val = 0;
+ do {
+ if (cnt > 0) {
+ while (cnt--) {
+ bitset[op++] = view.getUint8(ip++);
+ }
+ } else {
+ val = view.getUint8(ip++);
+ cnt = -cnt;
+ while (cnt--) {
+ bitset[op++] = val;
+ }
+ }
+ cnt = view.getInt16(ip, true);
+ ip += 2;
+ } while (ip < mask.numBytes);
+ if (cnt !== -32768 || op < bitset.length) {
+ throw "Unexpected end of mask RLE encoding";
+ }
+ resultMask = new Uint8Array(numPixels);
+ var mb = 0, k = 0;
+ for (k = 0; k < numPixels; k++) {
+ if (k & 7) {
+ mb = bitset[k >> 3];
+ mb <<= k & 7;
+ } else {
+ mb = bitset[k >> 3];
+ }
+ if (mb & 128) {
+ resultMask[k] = 1;
+ }
+ }
+ data.pixels.resultMask = resultMask;
+ mask.bitset = bitset;
+ ptr += mask.numBytes;
+ }
+ data.ptr = ptr;
+ data.mask = mask;
+ return true;
+ },
+ readDataOneSweep: function(input, data, OutPixelTypeArray) {
+ var ptr = data.ptr;
+ var headerInfo = data.headerInfo;
+ var numDims = headerInfo.numDims;
+ var numPixels = headerInfo.width * headerInfo.height;
+ var imageType = headerInfo.imageType;
+ var numBytes = headerInfo.numValidPixel * Lerc2Helpers.getDataTypeSize(imageType) * numDims;
+ var rawData;
+ var mask = data.pixels.resultMask;
+ if (OutPixelTypeArray === Uint8Array) {
+ rawData = new Uint8Array(input, ptr, numBytes);
+ } else {
+ var arrayBuf = new ArrayBuffer(numBytes);
+ var store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, ptr, numBytes));
+ rawData = new OutPixelTypeArray(arrayBuf);
+ }
+ if (rawData.length === numPixels * numDims) {
+ data.pixels.resultPixels = rawData;
+ } else {
+ data.pixels.resultPixels = new OutPixelTypeArray(numPixels * numDims);
+ var z = 0, k = 0, i = 0, nStart = 0;
+ if (numDims > 1) {
+ for (i = 0; i < numDims; i++) {
+ nStart = i * numPixels;
+ for (k = 0; k < numPixels; k++) {
+ if (mask[k]) {
+ data.pixels.resultPixels[nStart + k] = rawData[z++];
+ }
+ }
+ }
+ } else {
+ for (k = 0; k < numPixels; k++) {
+ if (mask[k]) {
+ data.pixels.resultPixels[k] = rawData[z++];
+ }
+ }
+ }
+ }
+ ptr += numBytes;
+ data.ptr = ptr;
+ return true;
+ },
+ readHuffmanTree: function(input, data) {
+ var BITS_MAX = this.HUFFMAN_LUT_BITS_MAX;
+ var view = new DataView(input, data.ptr, 16);
+ data.ptr += 16;
+ var version2 = view.getInt32(0, true);
+ if (version2 < 2) {
+ throw "unsupported Huffman version";
+ }
+ var size = view.getInt32(4, true);
+ var i0 = view.getInt32(8, true);
+ var i1 = view.getInt32(12, true);
+ if (i0 >= i1) {
+ return false;
+ }
+ var blockDataBuffer = new Uint32Array(i1 - i0);
+ Lerc2Helpers.decodeBits(input, data, blockDataBuffer);
+ var codeTable = [];
+ var i, j, k, len;
+ for (i = i0; i < i1; i++) {
+ j = i - (i < size ? 0 : size);
+ codeTable[j] = { first: blockDataBuffer[i - i0], second: null };
+ }
+ var dataBytes = input.byteLength - data.ptr;
+ var dataWords = Math.ceil(dataBytes / 4);
+ var arrayBuf = new ArrayBuffer(dataWords * 4);
+ var store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
+ var stuffedData = new Uint32Array(arrayBuf);
+ var bitPos = 0, word, srcPtr = 0;
+ word = stuffedData[0];
+ for (i = i0; i < i1; i++) {
+ j = i - (i < size ? 0 : size);
+ len = codeTable[j].first;
+ if (len > 0) {
+ codeTable[j].second = word << bitPos >>> 32 - len;
+ if (32 - bitPos >= len) {
+ bitPos += len;
+ if (bitPos === 32) {
+ bitPos = 0;
+ srcPtr++;
+ word = stuffedData[srcPtr];
+ }
+ } else {
+ bitPos += len - 32;
+ srcPtr++;
+ word = stuffedData[srcPtr];
+ codeTable[j].second |= word >>> 32 - bitPos;
+ }
+ }
+ }
+ var numBitsLUT = 0, numBitsLUTQick = 0;
+ var tree = new TreeNode();
+ for (i = 0; i < codeTable.length; i++) {
+ if (codeTable[i] !== void 0) {
+ numBitsLUT = Math.max(numBitsLUT, codeTable[i].first);
+ }
+ }
+ if (numBitsLUT >= BITS_MAX) {
+ numBitsLUTQick = BITS_MAX;
+ } else {
+ numBitsLUTQick = numBitsLUT;
+ }
+ if (numBitsLUT >= 30) {
+ console.log("WARning, large NUM LUT BITS IS " + numBitsLUT);
+ }
+ var decodeLut = [], entry, code, numEntries, jj, currentBit, node;
+ for (i = i0; i < i1; i++) {
+ j = i - (i < size ? 0 : size);
+ len = codeTable[j].first;
+ if (len > 0) {
+ entry = [len, j];
+ if (len <= numBitsLUTQick) {
+ code = codeTable[j].second << numBitsLUTQick - len;
+ numEntries = 1 << numBitsLUTQick - len;
+ for (k = 0; k < numEntries; k++) {
+ decodeLut[code | k] = entry;
+ }
+ } else {
+ code = codeTable[j].second;
+ node = tree;
+ for (jj = len - 1; jj >= 0; jj--) {
+ currentBit = code >>> jj & 1;
+ if (currentBit) {
+ if (!node.right) {
+ node.right = new TreeNode();
+ }
+ node = node.right;
+ } else {
+ if (!node.left) {
+ node.left = new TreeNode();
+ }
+ node = node.left;
+ }
+ if (jj === 0 && !node.val) {
+ node.val = entry[1];
+ }
+ }
+ }
+ }
+ }
+ return {
+ decodeLut,
+ numBitsLUTQick,
+ numBitsLUT,
+ tree,
+ stuffedData,
+ srcPtr,
+ bitPos
+ };
+ },
+ readHuffman: function(input, data, OutPixelTypeArray) {
+ var headerInfo = data.headerInfo;
+ var numDims = headerInfo.numDims;
+ var height = data.headerInfo.height;
+ var width = data.headerInfo.width;
+ var numPixels = width * height;
+ var huffmanInfo = this.readHuffmanTree(input, data);
+ var decodeLut = huffmanInfo.decodeLut;
+ var tree = huffmanInfo.tree;
+ var stuffedData = huffmanInfo.stuffedData;
+ var srcPtr = huffmanInfo.srcPtr;
+ var bitPos = huffmanInfo.bitPos;
+ var numBitsLUTQick = huffmanInfo.numBitsLUTQick;
+ var numBitsLUT = huffmanInfo.numBitsLUT;
+ var offset2 = data.headerInfo.imageType === 0 ? 128 : 0;
+ var node, val, delta, mask = data.pixels.resultMask, valTmp, valTmpQuick, currentBit;
+ var i, j, k, ii;
+ var prevVal = 0;
+ if (bitPos > 0) {
+ srcPtr++;
+ bitPos = 0;
+ }
+ var word = stuffedData[srcPtr];
+ var deltaEncode = data.encodeMode === 1;
+ var resultPixelsAllDim = new OutPixelTypeArray(numPixels * numDims);
+ var resultPixels = resultPixelsAllDim;
+ var iDim;
+ for (iDim = 0; iDim < headerInfo.numDims; iDim++) {
+ if (numDims > 1) {
+ resultPixels = new OutPixelTypeArray(resultPixelsAllDim.buffer, numPixels * iDim, numPixels);
+ prevVal = 0;
+ }
+ if (data.headerInfo.numValidPixel === width * height) {
+ for (k = 0, i = 0; i < height; i++) {
+ for (j = 0; j < width; j++, k++) {
+ val = 0;
+ valTmp = word << bitPos >>> 32 - numBitsLUTQick;
+ valTmpQuick = valTmp;
+ if (32 - bitPos < numBitsLUTQick) {
+ valTmp |= stuffedData[srcPtr + 1] >>> 64 - bitPos - numBitsLUTQick;
+ valTmpQuick = valTmp;
+ }
+ if (decodeLut[valTmpQuick]) {
+ val = decodeLut[valTmpQuick][1];
+ bitPos += decodeLut[valTmpQuick][0];
+ } else {
+ valTmp = word << bitPos >>> 32 - numBitsLUT;
+ valTmpQuick = valTmp;
+ if (32 - bitPos < numBitsLUT) {
+ valTmp |= stuffedData[srcPtr + 1] >>> 64 - bitPos - numBitsLUT;
+ valTmpQuick = valTmp;
+ }
+ node = tree;
+ for (ii = 0; ii < numBitsLUT; ii++) {
+ currentBit = valTmp >>> numBitsLUT - ii - 1 & 1;
+ node = currentBit ? node.right : node.left;
+ if (!(node.left || node.right)) {
+ val = node.val;
+ bitPos = bitPos + ii + 1;
+ break;
+ }
+ }
+ }
+ if (bitPos >= 32) {
+ bitPos -= 32;
+ srcPtr++;
+ word = stuffedData[srcPtr];
+ }
+ delta = val - offset2;
+ if (deltaEncode) {
+ if (j > 0) {
+ delta += prevVal;
+ } else if (i > 0) {
+ delta += resultPixels[k - width];
+ } else {
+ delta += prevVal;
+ }
+ delta &= 255;
+ resultPixels[k] = delta;
+ prevVal = delta;
+ } else {
+ resultPixels[k] = delta;
+ }
+ }
+ }
+ } else {
+ for (k = 0, i = 0; i < height; i++) {
+ for (j = 0; j < width; j++, k++) {
+ if (mask[k]) {
+ val = 0;
+ valTmp = word << bitPos >>> 32 - numBitsLUTQick;
+ valTmpQuick = valTmp;
+ if (32 - bitPos < numBitsLUTQick) {
+ valTmp |= stuffedData[srcPtr + 1] >>> 64 - bitPos - numBitsLUTQick;
+ valTmpQuick = valTmp;
+ }
+ if (decodeLut[valTmpQuick]) {
+ val = decodeLut[valTmpQuick][1];
+ bitPos += decodeLut[valTmpQuick][0];
+ } else {
+ valTmp = word << bitPos >>> 32 - numBitsLUT;
+ valTmpQuick = valTmp;
+ if (32 - bitPos < numBitsLUT) {
+ valTmp |= stuffedData[srcPtr + 1] >>> 64 - bitPos - numBitsLUT;
+ valTmpQuick = valTmp;
+ }
+ node = tree;
+ for (ii = 0; ii < numBitsLUT; ii++) {
+ currentBit = valTmp >>> numBitsLUT - ii - 1 & 1;
+ node = currentBit ? node.right : node.left;
+ if (!(node.left || node.right)) {
+ val = node.val;
+ bitPos = bitPos + ii + 1;
+ break;
+ }
+ }
+ }
+ if (bitPos >= 32) {
+ bitPos -= 32;
+ srcPtr++;
+ word = stuffedData[srcPtr];
+ }
+ delta = val - offset2;
+ if (deltaEncode) {
+ if (j > 0 && mask[k - 1]) {
+ delta += prevVal;
+ } else if (i > 0 && mask[k - width]) {
+ delta += resultPixels[k - width];
+ } else {
+ delta += prevVal;
+ }
+ delta &= 255;
+ resultPixels[k] = delta;
+ prevVal = delta;
+ } else {
+ resultPixels[k] = delta;
+ }
+ }
+ }
+ }
+ }
+ data.ptr = data.ptr + (srcPtr + 1) * 4 + (bitPos > 0 ? 4 : 0);
+ }
+ data.pixels.resultPixels = resultPixelsAllDim;
+ },
+ decodeBits: function(input, data, blockDataBuffer, offset2, iDim) {
+ {
+ var headerInfo = data.headerInfo;
+ var fileVersion = headerInfo.fileVersion;
+ var blockPtr = 0;
+ var view = new DataView(input, data.ptr, 5);
+ var headerByte = view.getUint8(0);
+ blockPtr++;
+ var bits67 = headerByte >> 6;
+ var n = bits67 === 0 ? 4 : 3 - bits67;
+ var doLut = (headerByte & 32) > 0 ? true : false;
+ var numBits = headerByte & 31;
+ var numElements = 0;
+ if (n === 1) {
+ numElements = view.getUint8(blockPtr);
+ blockPtr++;
+ } else if (n === 2) {
+ numElements = view.getUint16(blockPtr, true);
+ blockPtr += 2;
+ } else if (n === 4) {
+ numElements = view.getUint32(blockPtr, true);
+ blockPtr += 4;
+ } else {
+ throw "Invalid valid pixel count type";
+ }
+ var scale = 2 * headerInfo.maxZError;
+ var stuffedData, arrayBuf, store8, dataBytes, dataWords;
+ var lutArr, lutData, lutBytes, lutBitsPerElement, bitsPerPixel;
+ var zMax = headerInfo.numDims > 1 ? headerInfo.maxValues[iDim] : headerInfo.zMax;
+ if (doLut) {
+ data.counter.lut++;
+ lutBytes = view.getUint8(blockPtr);
+ lutBitsPerElement = numBits;
+ blockPtr++;
+ dataBytes = Math.ceil((lutBytes - 1) * numBits / 8);
+ dataWords = Math.ceil(dataBytes / 4);
+ arrayBuf = new ArrayBuffer(dataWords * 4);
+ store8 = new Uint8Array(arrayBuf);
+ data.ptr += blockPtr;
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
+ lutData = new Uint32Array(arrayBuf);
+ data.ptr += dataBytes;
+ bitsPerPixel = 0;
+ while (lutBytes - 1 >>> bitsPerPixel) {
+ bitsPerPixel++;
+ }
+ dataBytes = Math.ceil(numElements * bitsPerPixel / 8);
+ dataWords = Math.ceil(dataBytes / 4);
+ arrayBuf = new ArrayBuffer(dataWords * 4);
+ store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
+ stuffedData = new Uint32Array(arrayBuf);
+ data.ptr += dataBytes;
+ if (fileVersion >= 3) {
+ lutArr = BitStuffer.unstuffLUT2(lutData, numBits, lutBytes - 1, offset2, scale, zMax);
+ } else {
+ lutArr = BitStuffer.unstuffLUT(lutData, numBits, lutBytes - 1, offset2, scale, zMax);
+ }
+ if (fileVersion >= 3) {
+ BitStuffer.unstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements, lutArr);
+ } else {
+ BitStuffer.unstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements, lutArr);
+ }
+ } else {
+ data.counter.bitstuffer++;
+ bitsPerPixel = numBits;
+ data.ptr += blockPtr;
+ if (bitsPerPixel > 0) {
+ dataBytes = Math.ceil(numElements * bitsPerPixel / 8);
+ dataWords = Math.ceil(dataBytes / 4);
+ arrayBuf = new ArrayBuffer(dataWords * 4);
+ store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
+ stuffedData = new Uint32Array(arrayBuf);
+ data.ptr += dataBytes;
+ if (fileVersion >= 3) {
+ if (offset2 == null) {
+ BitStuffer.originalUnstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements);
+ } else {
+ BitStuffer.unstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements, false, offset2, scale, zMax);
+ }
+ } else {
+ if (offset2 == null) {
+ BitStuffer.originalUnstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements);
+ } else {
+ BitStuffer.unstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements, false, offset2, scale, zMax);
+ }
+ }
+ }
+ }
+ }
+ },
+ readTiles: function(input, data, OutPixelTypeArray) {
+ var headerInfo = data.headerInfo;
+ var width = headerInfo.width;
+ var height = headerInfo.height;
+ var microBlockSize = headerInfo.microBlockSize;
+ var imageType = headerInfo.imageType;
+ var dataTypeSize = Lerc2Helpers.getDataTypeSize(imageType);
+ var numBlocksX = Math.ceil(width / microBlockSize);
+ var numBlocksY = Math.ceil(height / microBlockSize);
+ data.pixels.numBlocksY = numBlocksY;
+ data.pixels.numBlocksX = numBlocksX;
+ data.pixels.ptr = 0;
+ var row = 0, col = 0, blockY = 0, blockX = 0, thisBlockHeight = 0, thisBlockWidth = 0, bytesLeft = 0, headerByte = 0, bits67 = 0, testCode = 0, outPtr = 0, outStride = 0, numBytes = 0, bytesleft = 0, z = 0, blockPtr = 0;
+ var view, block, arrayBuf, store8, rawData;
+ var blockEncoding;
+ var blockDataBuffer = new OutPixelTypeArray(microBlockSize * microBlockSize);
+ var lastBlockHeight = height % microBlockSize || microBlockSize;
+ var lastBlockWidth = width % microBlockSize || microBlockSize;
+ var offsetType, offset2;
+ var numDims = headerInfo.numDims, iDim;
+ var mask = data.pixels.resultMask;
+ var resultPixels = data.pixels.resultPixels;
+ for (blockY = 0; blockY < numBlocksY; blockY++) {
+ thisBlockHeight = blockY !== numBlocksY - 1 ? microBlockSize : lastBlockHeight;
+ for (blockX = 0; blockX < numBlocksX; blockX++) {
+ thisBlockWidth = blockX !== numBlocksX - 1 ? microBlockSize : lastBlockWidth;
+ outPtr = blockY * width * microBlockSize + blockX * microBlockSize;
+ outStride = width - thisBlockWidth;
+ for (iDim = 0; iDim < numDims; iDim++) {
+ if (numDims > 1) {
+ resultPixels = new OutPixelTypeArray(data.pixels.resultPixels.buffer, width * height * iDim * dataTypeSize, width * height);
+ }
+ bytesLeft = input.byteLength - data.ptr;
+ view = new DataView(input, data.ptr, Math.min(10, bytesLeft));
+ block = {};
+ blockPtr = 0;
+ headerByte = view.getUint8(0);
+ blockPtr++;
+ bits67 = headerByte >> 6 & 255;
+ testCode = headerByte >> 2 & 15;
+ if (testCode !== (blockX * microBlockSize >> 3 & 15)) {
+ throw "integrity issue";
+ }
+ blockEncoding = headerByte & 3;
+ if (blockEncoding > 3) {
+ data.ptr += blockPtr;
+ throw "Invalid block encoding (" + blockEncoding + ")";
+ } else if (blockEncoding === 2) {
+ data.counter.constant++;
+ data.ptr += blockPtr;
+ continue;
+ } else if (blockEncoding === 0) {
+ data.counter.uncompressed++;
+ data.ptr += blockPtr;
+ numBytes = thisBlockHeight * thisBlockWidth * dataTypeSize;
+ bytesleft = input.byteLength - data.ptr;
+ numBytes = numBytes < bytesleft ? numBytes : bytesleft;
+ arrayBuf = new ArrayBuffer(numBytes % dataTypeSize === 0 ? numBytes : numBytes + dataTypeSize - numBytes % dataTypeSize);
+ store8 = new Uint8Array(arrayBuf);
+ store8.set(new Uint8Array(input, data.ptr, numBytes));
+ rawData = new OutPixelTypeArray(arrayBuf);
+ z = 0;
+ if (mask) {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ if (mask[outPtr]) {
+ resultPixels[outPtr] = rawData[z++];
+ }
+ outPtr++;
+ }
+ outPtr += outStride;
+ }
+ } else {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ resultPixels[outPtr++] = rawData[z++];
+ }
+ outPtr += outStride;
+ }
+ }
+ data.ptr += z * dataTypeSize;
+ } else {
+ offsetType = Lerc2Helpers.getDataTypeUsed(imageType, bits67);
+ offset2 = Lerc2Helpers.getOnePixel(block, blockPtr, offsetType, view);
+ blockPtr += Lerc2Helpers.getDataTypeSize(offsetType);
+ if (blockEncoding === 3) {
+ data.ptr += blockPtr;
+ data.counter.constantoffset++;
+ if (mask) {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ if (mask[outPtr]) {
+ resultPixels[outPtr] = offset2;
+ }
+ outPtr++;
+ }
+ outPtr += outStride;
+ }
+ } else {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ resultPixels[outPtr++] = offset2;
+ }
+ outPtr += outStride;
+ }
+ }
+ } else {
+ data.ptr += blockPtr;
+ Lerc2Helpers.decodeBits(input, data, blockDataBuffer, offset2, iDim);
+ blockPtr = 0;
+ if (mask) {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ if (mask[outPtr]) {
+ resultPixels[outPtr] = blockDataBuffer[blockPtr++];
+ }
+ outPtr++;
+ }
+ outPtr += outStride;
+ }
+ } else {
+ for (row = 0; row < thisBlockHeight; row++) {
+ for (col = 0; col < thisBlockWidth; col++) {
+ resultPixels[outPtr++] = blockDataBuffer[blockPtr++];
+ }
+ outPtr += outStride;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ formatFileInfo: function(data) {
+ return {
+ "fileIdentifierString": data.headerInfo.fileIdentifierString,
+ "fileVersion": data.headerInfo.fileVersion,
+ "imageType": data.headerInfo.imageType,
+ "height": data.headerInfo.height,
+ "width": data.headerInfo.width,
+ "numValidPixel": data.headerInfo.numValidPixel,
+ "microBlockSize": data.headerInfo.microBlockSize,
+ "blobSize": data.headerInfo.blobSize,
+ "maxZError": data.headerInfo.maxZError,
+ "pixelType": Lerc2Helpers.getPixelType(data.headerInfo.imageType),
+ "eofOffset": data.eofOffset,
+ "mask": data.mask ? {
+ "numBytes": data.mask.numBytes
+ } : null,
+ "pixels": {
+ "numBlocksX": data.pixels.numBlocksX,
+ "numBlocksY": data.pixels.numBlocksY,
+ "maxValue": data.headerInfo.zMax,
+ "minValue": data.headerInfo.zMin,
+ "noDataValue": data.noDataValue
+ }
+ };
+ },
+ constructConstantSurface: function(data) {
+ var val = data.headerInfo.zMax;
+ var numDims = data.headerInfo.numDims;
+ var numPixels = data.headerInfo.height * data.headerInfo.width;
+ var numPixelAllDims = numPixels * numDims;
+ var i = 0, k = 0, nStart = 0;
+ var mask = data.pixels.resultMask;
+ if (mask) {
+ if (numDims > 1) {
+ for (i = 0; i < numDims; i++) {
+ nStart = i * numPixels;
+ for (k = 0; k < numPixels; k++) {
+ if (mask[k]) {
+ data.pixels.resultPixels[nStart + k] = val;
+ }
+ }
+ }
+ } else {
+ for (k = 0; k < numPixels; k++) {
+ if (mask[k]) {
+ data.pixels.resultPixels[k] = val;
+ }
+ }
+ }
+ } else {
+ if (data.pixels.resultPixels.fill) {
+ data.pixels.resultPixels.fill(val);
+ } else {
+ for (k = 0; k < numPixelAllDims; k++) {
+ data.pixels.resultPixels[k] = val;
+ }
+ }
+ }
+ return;
+ },
+ getDataTypeArray: function(t) {
+ var tp;
+ switch (t) {
+ case 0:
+ tp = Int8Array;
+ break;
+ case 1:
+ tp = Uint8Array;
+ break;
+ case 2:
+ tp = Int16Array;
+ break;
+ case 3:
+ tp = Uint16Array;
+ break;
+ case 4:
+ tp = Int32Array;
+ break;
+ case 5:
+ tp = Uint32Array;
+ break;
+ case 6:
+ tp = Float32Array;
+ break;
+ case 7:
+ tp = Float64Array;
+ break;
+ default:
+ tp = Float32Array;
+ }
+ return tp;
+ },
+ getPixelType: function(t) {
+ var tp;
+ switch (t) {
+ case 0:
+ tp = "S8";
+ break;
+ case 1:
+ tp = "U8";
+ break;
+ case 2:
+ tp = "S16";
+ break;
+ case 3:
+ tp = "U16";
+ break;
+ case 4:
+ tp = "S32";
+ break;
+ case 5:
+ tp = "U32";
+ break;
+ case 6:
+ tp = "F32";
+ break;
+ case 7:
+ tp = "F64";
+ break;
+ default:
+ tp = "F32";
+ }
+ return tp;
+ },
+ isValidPixelValue: function(t, val) {
+ if (val == null) {
+ return false;
+ }
+ var isValid;
+ switch (t) {
+ case 0:
+ isValid = val >= -128 && val <= 127;
+ break;
+ case 1:
+ isValid = val >= 0 && val <= 255;
+ break;
+ case 2:
+ isValid = val >= -32768 && val <= 32767;
+ break;
+ case 3:
+ isValid = val >= 0 && val <= 65536;
+ break;
+ case 4:
+ isValid = val >= -2147483648 && val <= 2147483647;
+ break;
+ case 5:
+ isValid = val >= 0 && val <= 4294967296;
+ break;
+ case 6:
+ isValid = val >= -34027999387901484e22 && val <= 34027999387901484e22;
+ break;
+ case 7:
+ isValid = val >= 5e-324 && val <= 17976931348623157e292;
+ break;
+ default:
+ isValid = false;
+ }
+ return isValid;
+ },
+ getDataTypeSize: function(t) {
+ var s = 0;
+ switch (t) {
+ case 0:
+ case 1:
+ s = 1;
+ break;
+ case 2:
+ case 3:
+ s = 2;
+ break;
+ case 4:
+ case 5:
+ case 6:
+ s = 4;
+ break;
+ case 7:
+ s = 8;
+ break;
+ default:
+ s = t;
+ }
+ return s;
+ },
+ getDataTypeUsed: function(dt, tc) {
+ var t = dt;
+ switch (dt) {
+ case 2:
+ case 4:
+ t = dt - tc;
+ break;
+ case 3:
+ case 5:
+ t = dt - 2 * tc;
+ break;
+ case 6:
+ if (0 === tc) {
+ t = dt;
+ } else if (1 === tc) {
+ t = 2;
+ } else {
+ t = 1;
+ }
+ break;
+ case 7:
+ if (0 === tc) {
+ t = dt;
+ } else {
+ t = dt - 2 * tc + 1;
+ }
+ break;
+ default:
+ t = dt;
+ break;
+ }
+ return t;
+ },
+ getOnePixel: function(block, blockPtr, offsetType, view) {
+ var temp = 0;
+ switch (offsetType) {
+ case 0:
+ temp = view.getInt8(blockPtr);
+ break;
+ case 1:
+ temp = view.getUint8(blockPtr);
+ break;
+ case 2:
+ temp = view.getInt16(blockPtr, true);
+ break;
+ case 3:
+ temp = view.getUint16(blockPtr, true);
+ break;
+ case 4:
+ temp = view.getInt32(blockPtr, true);
+ break;
+ case 5:
+ temp = view.getUInt32(blockPtr, true);
+ break;
+ case 6:
+ temp = view.getFloat32(blockPtr, true);
+ break;
+ case 7:
+ temp = view.getFloat64(blockPtr, true);
+ break;
+ default:
+ throw "the decoder does not understand this pixel type";
+ }
+ return temp;
+ }
+ };
+ var TreeNode = function(val, left, right) {
+ this.val = val;
+ this.left = left;
+ this.right = right;
+ };
+ var Lerc2Decode2 = {
+ decode: function(input, options) {
+ options = options || {};
+ var noDataValue = options.noDataValue;
+ var i = 0, data = {};
+ data.ptr = options.inputOffset || 0;
+ data.pixels = {};
+ if (!Lerc2Helpers.readHeaderInfo(input, data)) {
+ return;
+ }
+ var headerInfo = data.headerInfo;
+ var fileVersion = headerInfo.fileVersion;
+ var OutPixelTypeArray = Lerc2Helpers.getDataTypeArray(headerInfo.imageType);
+ Lerc2Helpers.readMask(input, data);
+ if (headerInfo.numValidPixel !== headerInfo.width * headerInfo.height && !data.pixels.resultMask) {
+ data.pixels.resultMask = options.maskData;
+ }
+ var numPixels = headerInfo.width * headerInfo.height;
+ data.pixels.resultPixels = new OutPixelTypeArray(numPixels * headerInfo.numDims);
+ data.counter = {
+ onesweep: 0,
+ uncompressed: 0,
+ lut: 0,
+ bitstuffer: 0,
+ constant: 0,
+ constantoffset: 0
+ };
+ if (headerInfo.numValidPixel !== 0) {
+ if (headerInfo.zMax === headerInfo.zMin) {
+ Lerc2Helpers.constructConstantSurface(data);
+ } else if (fileVersion >= 4 && Lerc2Helpers.checkMinMaxRanges(input, data)) {
+ Lerc2Helpers.constructConstantSurface(data);
+ } else {
+ var view = new DataView(input, data.ptr, 2);
+ var bReadDataOneSweep = view.getUint8(0);
+ data.ptr++;
+ if (bReadDataOneSweep) {
+ Lerc2Helpers.readDataOneSweep(input, data, OutPixelTypeArray);
+ } else {
+ if (fileVersion > 1 && headerInfo.imageType <= 1 && Math.abs(headerInfo.maxZError - 0.5) < 1e-5) {
+ var flagHuffman = view.getUint8(1);
+ data.ptr++;
+ data.encodeMode = flagHuffman;
+ if (flagHuffman > 2 || fileVersion < 4 && flagHuffman > 1) {
+ throw "Invalid Huffman flag " + flagHuffman;
+ }
+ if (flagHuffman) {
+ Lerc2Helpers.readHuffman(input, data, OutPixelTypeArray);
+ } else {
+ Lerc2Helpers.readTiles(input, data, OutPixelTypeArray);
+ }
+ } else {
+ Lerc2Helpers.readTiles(input, data, OutPixelTypeArray);
+ }
+ }
+ }
+ }
+ data.eofOffset = data.ptr;
+ var diff;
+ if (options.inputOffset) {
+ diff = data.headerInfo.blobSize + options.inputOffset - data.ptr;
+ if (Math.abs(diff) >= 1) {
+ data.eofOffset = options.inputOffset + data.headerInfo.blobSize;
+ }
+ } else {
+ diff = data.headerInfo.blobSize - data.ptr;
+ if (Math.abs(diff) >= 1) {
+ data.eofOffset = data.headerInfo.blobSize;
+ }
+ }
+ var result = {
+ width: headerInfo.width,
+ height: headerInfo.height,
+ pixelData: data.pixels.resultPixels,
+ minValue: headerInfo.zMin,
+ maxValue: headerInfo.zMax,
+ validPixelCount: headerInfo.numValidPixel,
+ dimCount: headerInfo.numDims,
+ dimStats: {
+ minValues: headerInfo.minValues,
+ maxValues: headerInfo.maxValues
+ },
+ maskData: data.pixels.resultMask
+ };
+ if (data.pixels.resultMask && Lerc2Helpers.isValidPixelValue(headerInfo.imageType, noDataValue)) {
+ var mask = data.pixels.resultMask;
+ for (i = 0; i < numPixels; i++) {
+ if (!mask[i]) {
+ result.pixelData[i] = noDataValue;
+ }
+ }
+ result.noDataValue = noDataValue;
+ }
+ data.noDataValue = noDataValue;
+ if (options.returnFileInfo) {
+ result.fileInfo = Lerc2Helpers.formatFileInfo(data);
+ }
+ return result;
+ },
+ getBandCount: function(input) {
+ var count = 0;
+ var i = 0;
+ var temp = {};
+ temp.ptr = 0;
+ temp.pixels = {};
+ while (i < input.byteLength - 58) {
+ Lerc2Helpers.readHeaderInfo(input, temp);
+ i += temp.headerInfo.blobSize;
+ count++;
+ temp.ptr = i;
+ }
+ return count;
+ }
+ };
+ return Lerc2Decode2;
+ }();
+ var isPlatformLittleEndian = function() {
+ var a3 = new ArrayBuffer(4);
+ var b = new Uint8Array(a3);
+ var c = new Uint32Array(a3);
+ c[0] = 1;
+ return b[0] === 1;
+ }();
+ var Lerc2 = {
+ decode: function(encodedData, options) {
+ if (!isPlatformLittleEndian) {
+ throw "Big endian system is not supported.";
+ }
+ options = options || {};
+ var inputOffset = options.inputOffset || 0;
+ var fileIdView = new Uint8Array(encodedData, inputOffset, 10);
+ var fileIdentifierString = String.fromCharCode.apply(null, fileIdView);
+ var lerc, majorVersion;
+ if (fileIdentifierString.trim() === "CntZImage") {
+ lerc = LercDecode;
+ majorVersion = 1;
+ } else if (fileIdentifierString.substring(0, 5) === "Lerc2") {
+ lerc = Lerc2Decode;
+ majorVersion = 2;
+ } else {
+ throw "Unexpected file identifier string: " + fileIdentifierString;
+ }
+ var iPlane = 0, eof = encodedData.byteLength - 10, encodedMaskData, bandMasks = [], bandMask, maskData;
+ var decodedPixelBlock = {
+ width: 0,
+ height: 0,
+ pixels: [],
+ pixelType: options.pixelType,
+ mask: null,
+ statistics: []
+ };
+ while (inputOffset < eof) {
+ var result = lerc.decode(encodedData, {
+ inputOffset,
+ encodedMaskData,
+ maskData,
+ returnMask: iPlane === 0 ? true : false,
+ returnEncodedMask: iPlane === 0 ? true : false,
+ returnFileInfo: true,
+ pixelType: options.pixelType || null,
+ noDataValue: options.noDataValue || null
+ });
+ inputOffset = result.fileInfo.eofOffset;
+ if (iPlane === 0) {
+ encodedMaskData = result.encodedMaskData;
+ maskData = result.maskData;
+ decodedPixelBlock.width = result.width;
+ decodedPixelBlock.height = result.height;
+ decodedPixelBlock.dimCount = result.dimCount || 1;
+ decodedPixelBlock.pixelType = result.pixelType || result.fileInfo.pixelType;
+ decodedPixelBlock.mask = result.maskData;
+ }
+ if (majorVersion > 1 && result.fileInfo.mask && result.fileInfo.mask.numBytes > 0) {
+ bandMasks.push(result.maskData);
+ }
+ iPlane++;
+ decodedPixelBlock.pixels.push(result.pixelData);
+ decodedPixelBlock.statistics.push({
+ minValue: result.minValue,
+ maxValue: result.maxValue,
+ noDataValue: result.noDataValue,
+ dimStats: result.dimStats
+ });
+ }
+ var i, j, numPixels;
+ if (majorVersion > 1 && bandMasks.length > 1) {
+ numPixels = decodedPixelBlock.width * decodedPixelBlock.height;
+ decodedPixelBlock.bandMasks = bandMasks;
+ maskData = new Uint8Array(numPixels);
+ maskData.set(bandMasks[0]);
+ for (i = 1; i < bandMasks.length; i++) {
+ bandMask = bandMasks[i];
+ for (j = 0; j < numPixels; j++) {
+ maskData[j] = maskData[j] & bandMask[j];
+ }
+ }
+ decodedPixelBlock.maskData = maskData;
+ }
+ return decodedPixelBlock;
+ }
+ };
+ if (typeof define === "function" && define.amd) {
+ define([], function() {
+ return Lerc2;
+ });
+ } else if (typeof module2 !== "undefined" && module2.exports) {
+ module2.exports = Lerc2;
+ } else {
+ this.Lerc = Lerc2;
+ }
+ })();
+ }
+});
+
+// node_modules/nosleep.js/src/media.js
+var require_media = __commonJS({
+ "node_modules/nosleep.js/src/media.js"(exports2, module2) {
+ module2.exports = {
+ webm: "data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEF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FVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSim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AACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"
+ };
+ }
+});
+
+// node_modules/nosleep.js/src/index.js
+var require_src = __commonJS({
+ "node_modules/nosleep.js/src/index.js"(exports2, module2) {
+ var { webm, mp4 } = require_media();
+ var oldIOS = () => typeof navigator !== "undefined" && parseFloat(
+ ("" + (/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(
+ navigator.userAgent
+ ) || [0, ""])[1]).replace("undefined", "3_2").replace("_", ".").replace("_", "")
+ ) < 10 && !window.MSStream;
+ var nativeWakeLock = () => "wakeLock" in navigator;
+ var NoSleep2 = class {
+ constructor() {
+ this.enabled = false;
+ if (nativeWakeLock()) {
+ this._wakeLock = null;
+ const handleVisibilityChange = () => {
+ if (this._wakeLock !== null && document.visibilityState === "visible") {
+ this.enable();
+ }
+ };
+ document.addEventListener("visibilitychange", handleVisibilityChange);
+ document.addEventListener("fullscreenchange", handleVisibilityChange);
+ } else if (oldIOS()) {
+ this.noSleepTimer = null;
+ } else {
+ this.noSleepVideo = document.createElement("video");
+ this.noSleepVideo.setAttribute("title", "No Sleep");
+ this.noSleepVideo.setAttribute("playsinline", "");
+ this._addSourceToVideo(this.noSleepVideo, "webm", webm);
+ this._addSourceToVideo(this.noSleepVideo, "mp4", mp4);
+ this.noSleepVideo.addEventListener("loadedmetadata", () => {
+ if (this.noSleepVideo.duration <= 1) {
+ this.noSleepVideo.setAttribute("loop", "");
+ } else {
+ this.noSleepVideo.addEventListener("timeupdate", () => {
+ if (this.noSleepVideo.currentTime > 0.5) {
+ this.noSleepVideo.currentTime = Math.random();
+ }
+ });
+ }
+ });
+ }
+ }
+ _addSourceToVideo(element, type, dataURI) {
+ var source = document.createElement("source");
+ source.src = dataURI;
+ source.type = `video/${type}`;
+ element.appendChild(source);
+ }
+ get isEnabled() {
+ return this.enabled;
+ }
+ enable() {
+ if (nativeWakeLock()) {
+ return navigator.wakeLock.request("screen").then((wakeLock) => {
+ this._wakeLock = wakeLock;
+ this.enabled = true;
+ console.log("Wake Lock active.");
+ this._wakeLock.addEventListener("release", () => {
+ console.log("Wake Lock released.");
+ });
+ }).catch((err) => {
+ this.enabled = false;
+ console.error(`${err.name}, ${err.message}`);
+ throw err;
+ });
+ } else if (oldIOS()) {
+ this.disable();
+ console.warn(`
+ NoSleep enabled for older iOS devices. This can interrupt
+ active or long-running network requests from completing successfully.
+ See https://github.com/richtr/NoSleep.js/issues/15 for more details.
+ `);
+ this.noSleepTimer = window.setInterval(() => {
+ if (!document.hidden) {
+ window.location.href = window.location.href.split("#")[0];
+ window.setTimeout(window.stop, 0);
+ }
+ }, 15e3);
+ this.enabled = true;
+ return Promise.resolve();
+ } else {
+ let playPromise = this.noSleepVideo.play();
+ return playPromise.then((res) => {
+ this.enabled = true;
+ return res;
+ }).catch((err) => {
+ this.enabled = false;
+ throw err;
+ });
+ }
+ }
+ disable() {
+ if (nativeWakeLock()) {
+ if (this._wakeLock) {
+ this._wakeLock.release();
+ }
+ this._wakeLock = null;
+ } else if (oldIOS()) {
+ if (this.noSleepTimer) {
+ console.warn(`
+ NoSleep now disabled for older iOS devices.
+ `);
+ window.clearInterval(this.noSleepTimer);
+ this.noSleepTimer = null;
+ }
+ } else {
+ this.noSleepVideo.pause();
+ }
+ this.enabled = false;
+ }
+ };
+ module2.exports = NoSleep2;
+ }
+});
+
+// Source/Core/defined.js
+function defined(value) {
+ return value !== void 0 && value !== null;
+}
+var defined_default = defined;
+
+// Source/Core/DeveloperError.js
+function DeveloperError(message) {
+ this.name = "DeveloperError";
+ this.message = message;
+ let stack;
+ try {
+ throw new Error();
+ } catch (e) {
+ stack = e.stack;
+ }
+ this.stack = stack;
+}
+if (defined_default(Object.create)) {
+ DeveloperError.prototype = Object.create(Error.prototype);
+ DeveloperError.prototype.constructor = DeveloperError;
+}
+DeveloperError.prototype.toString = function() {
+ let str = `${this.name}: ${this.message}`;
+ if (defined_default(this.stack)) {
+ str += `
+${this.stack.toString()}`;
+ }
+ return str;
+};
+DeveloperError.throwInstantiationError = function() {
+ throw new DeveloperError(
+ "This function defines an interface and should not be called directly."
+ );
+};
+var DeveloperError_default = DeveloperError;
+
+// Source/Core/Check.js
+var Check = {};
+Check.typeOf = {};
+function getUndefinedErrorMessage(name) {
+ return `${name} is required, actual value was undefined`;
+}
+function getFailedTypeErrorMessage(actual, expected, name) {
+ return `Expected ${name} to be typeof ${expected}, actual typeof was ${actual}`;
+}
+Check.defined = function(name, test) {
+ if (!defined_default(test)) {
+ throw new DeveloperError_default(getUndefinedErrorMessage(name));
+ }
+};
+Check.typeOf.func = function(name, test) {
+ if (typeof test !== "function") {
+ throw new DeveloperError_default(
+ getFailedTypeErrorMessage(typeof test, "function", name)
+ );
+ }
+};
+Check.typeOf.string = function(name, test) {
+ if (typeof test !== "string") {
+ throw new DeveloperError_default(
+ getFailedTypeErrorMessage(typeof test, "string", name)
+ );
+ }
+};
+Check.typeOf.number = function(name, test) {
+ if (typeof test !== "number") {
+ throw new DeveloperError_default(
+ getFailedTypeErrorMessage(typeof test, "number", name)
+ );
+ }
+};
+Check.typeOf.number.lessThan = function(name, test, limit) {
+ Check.typeOf.number(name, test);
+ if (test >= limit) {
+ throw new DeveloperError_default(
+ `Expected ${name} to be less than ${limit}, actual value was ${test}`
+ );
+ }
+};
+Check.typeOf.number.lessThanOrEquals = function(name, test, limit) {
+ Check.typeOf.number(name, test);
+ if (test > limit) {
+ throw new DeveloperError_default(
+ `Expected ${name} to be less than or equal to ${limit}, actual value was ${test}`
+ );
+ }
+};
+Check.typeOf.number.greaterThan = function(name, test, limit) {
+ Check.typeOf.number(name, test);
+ if (test <= limit) {
+ throw new DeveloperError_default(
+ `Expected ${name} to be greater than ${limit}, actual value was ${test}`
+ );
+ }
+};
+Check.typeOf.number.greaterThanOrEquals = function(name, test, limit) {
+ Check.typeOf.number(name, test);
+ if (test < limit) {
+ throw new DeveloperError_default(
+ `Expected ${name} to be greater than or equal to ${limit}, actual value was ${test}`
+ );
+ }
+};
+Check.typeOf.object = function(name, test) {
+ if (typeof test !== "object") {
+ throw new DeveloperError_default(
+ getFailedTypeErrorMessage(typeof test, "object", name)
+ );
+ }
+};
+Check.typeOf.bool = function(name, test) {
+ if (typeof test !== "boolean") {
+ throw new DeveloperError_default(
+ getFailedTypeErrorMessage(typeof test, "boolean", name)
+ );
+ }
+};
+Check.typeOf.bigint = function(name, test) {
+ if (typeof test !== "bigint") {
+ throw new DeveloperError_default(
+ getFailedTypeErrorMessage(typeof test, "bigint", name)
+ );
+ }
+};
+Check.typeOf.number.equals = function(name1, name2, test1, test2) {
+ Check.typeOf.number(name1, test1);
+ Check.typeOf.number(name2, test2);
+ if (test1 !== test2) {
+ throw new DeveloperError_default(
+ `${name1} must be equal to ${name2}, the actual values are ${test1} and ${test2}`
+ );
+ }
+};
+var Check_default = Check;
+
+// Source/Core/defaultValue.js
+function defaultValue(a3, b) {
+ if (a3 !== void 0 && a3 !== null) {
+ return a3;
+ }
+ return b;
+}
+defaultValue.EMPTY_OBJECT = Object.freeze({});
+var defaultValue_default = defaultValue;
+
+// Source/Core/Math.js
+var import_mersenne_twister = __toESM(require_mersenne_twister(), 1);
+var CesiumMath = {};
+CesiumMath.EPSILON1 = 0.1;
+CesiumMath.EPSILON2 = 0.01;
+CesiumMath.EPSILON3 = 1e-3;
+CesiumMath.EPSILON4 = 1e-4;
+CesiumMath.EPSILON5 = 1e-5;
+CesiumMath.EPSILON6 = 1e-6;
+CesiumMath.EPSILON7 = 1e-7;
+CesiumMath.EPSILON8 = 1e-8;
+CesiumMath.EPSILON9 = 1e-9;
+CesiumMath.EPSILON10 = 1e-10;
+CesiumMath.EPSILON11 = 1e-11;
+CesiumMath.EPSILON12 = 1e-12;
+CesiumMath.EPSILON13 = 1e-13;
+CesiumMath.EPSILON14 = 1e-14;
+CesiumMath.EPSILON15 = 1e-15;
+CesiumMath.EPSILON16 = 1e-16;
+CesiumMath.EPSILON17 = 1e-17;
+CesiumMath.EPSILON18 = 1e-18;
+CesiumMath.EPSILON19 = 1e-19;
+CesiumMath.EPSILON20 = 1e-20;
+CesiumMath.EPSILON21 = 1e-21;
+CesiumMath.GRAVITATIONALPARAMETER = 3986004418e5;
+CesiumMath.SOLAR_RADIUS = 6955e5;
+CesiumMath.LUNAR_RADIUS = 1737400;
+CesiumMath.SIXTY_FOUR_KILOBYTES = 64 * 1024;
+CesiumMath.FOUR_GIGABYTES = 4 * 1024 * 1024 * 1024;
+CesiumMath.sign = defaultValue_default(Math.sign, function sign(value) {
+ value = +value;
+ if (value === 0 || value !== value) {
+ return value;
+ }
+ return value > 0 ? 1 : -1;
+});
+CesiumMath.signNotZero = function(value) {
+ return value < 0 ? -1 : 1;
+};
+CesiumMath.toSNorm = function(value, rangeMaximum) {
+ rangeMaximum = defaultValue_default(rangeMaximum, 255);
+ return Math.round(
+ (CesiumMath.clamp(value, -1, 1) * 0.5 + 0.5) * rangeMaximum
+ );
+};
+CesiumMath.fromSNorm = function(value, rangeMaximum) {
+ rangeMaximum = defaultValue_default(rangeMaximum, 255);
+ return CesiumMath.clamp(value, 0, rangeMaximum) / rangeMaximum * 2 - 1;
+};
+CesiumMath.normalize = function(value, rangeMinimum, rangeMaximum) {
+ rangeMaximum = Math.max(rangeMaximum - rangeMinimum, 0);
+ return rangeMaximum === 0 ? 0 : CesiumMath.clamp((value - rangeMinimum) / rangeMaximum, 0, 1);
+};
+CesiumMath.sinh = defaultValue_default(Math.sinh, function sinh(value) {
+ return (Math.exp(value) - Math.exp(-value)) / 2;
+});
+CesiumMath.cosh = defaultValue_default(Math.cosh, function cosh(value) {
+ return (Math.exp(value) + Math.exp(-value)) / 2;
+});
+CesiumMath.lerp = function(p, q, time) {
+ return (1 - time) * p + time * q;
+};
+CesiumMath.PI = Math.PI;
+CesiumMath.ONE_OVER_PI = 1 / Math.PI;
+CesiumMath.PI_OVER_TWO = Math.PI / 2;
+CesiumMath.PI_OVER_THREE = Math.PI / 3;
+CesiumMath.PI_OVER_FOUR = Math.PI / 4;
+CesiumMath.PI_OVER_SIX = Math.PI / 6;
+CesiumMath.THREE_PI_OVER_TWO = 3 * Math.PI / 2;
+CesiumMath.TWO_PI = 2 * Math.PI;
+CesiumMath.ONE_OVER_TWO_PI = 1 / (2 * Math.PI);
+CesiumMath.RADIANS_PER_DEGREE = Math.PI / 180;
+CesiumMath.DEGREES_PER_RADIAN = 180 / Math.PI;
+CesiumMath.RADIANS_PER_ARCSECOND = CesiumMath.RADIANS_PER_DEGREE / 3600;
+CesiumMath.toRadians = function(degrees) {
+ if (!defined_default(degrees)) {
+ throw new DeveloperError_default("degrees is required.");
+ }
+ return degrees * CesiumMath.RADIANS_PER_DEGREE;
+};
+CesiumMath.toDegrees = function(radians) {
+ if (!defined_default(radians)) {
+ throw new DeveloperError_default("radians is required.");
+ }
+ return radians * CesiumMath.DEGREES_PER_RADIAN;
+};
+CesiumMath.convertLongitudeRange = function(angle) {
+ if (!defined_default(angle)) {
+ throw new DeveloperError_default("angle is required.");
+ }
+ const twoPi = CesiumMath.TWO_PI;
+ const simplified = angle - Math.floor(angle / twoPi) * twoPi;
+ if (simplified < -Math.PI) {
+ return simplified + twoPi;
+ }
+ if (simplified >= Math.PI) {
+ return simplified - twoPi;
+ }
+ return simplified;
+};
+CesiumMath.clampToLatitudeRange = function(angle) {
+ if (!defined_default(angle)) {
+ throw new DeveloperError_default("angle is required.");
+ }
+ return CesiumMath.clamp(
+ angle,
+ -1 * CesiumMath.PI_OVER_TWO,
+ CesiumMath.PI_OVER_TWO
+ );
+};
+CesiumMath.negativePiToPi = function(angle) {
+ if (!defined_default(angle)) {
+ throw new DeveloperError_default("angle is required.");
+ }
+ if (angle >= -CesiumMath.PI && angle <= CesiumMath.PI) {
+ return angle;
+ }
+ return CesiumMath.zeroToTwoPi(angle + CesiumMath.PI) - CesiumMath.PI;
+};
+CesiumMath.zeroToTwoPi = function(angle) {
+ if (!defined_default(angle)) {
+ throw new DeveloperError_default("angle is required.");
+ }
+ if (angle >= 0 && angle <= CesiumMath.TWO_PI) {
+ return angle;
+ }
+ const mod2 = CesiumMath.mod(angle, CesiumMath.TWO_PI);
+ if (Math.abs(mod2) < CesiumMath.EPSILON14 && Math.abs(angle) > CesiumMath.EPSILON14) {
+ return CesiumMath.TWO_PI;
+ }
+ return mod2;
+};
+CesiumMath.mod = function(m, n) {
+ if (!defined_default(m)) {
+ throw new DeveloperError_default("m is required.");
+ }
+ if (!defined_default(n)) {
+ throw new DeveloperError_default("n is required.");
+ }
+ if (n === 0) {
+ throw new DeveloperError_default("divisor cannot be 0.");
+ }
+ if (CesiumMath.sign(m) === CesiumMath.sign(n) && Math.abs(m) < Math.abs(n)) {
+ return m;
+ }
+ return (m % n + n) % n;
+};
+CesiumMath.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {
+ if (!defined_default(left)) {
+ throw new DeveloperError_default("left is required.");
+ }
+ if (!defined_default(right)) {
+ throw new DeveloperError_default("right is required.");
+ }
+ relativeEpsilon = defaultValue_default(relativeEpsilon, 0);
+ absoluteEpsilon = defaultValue_default(absoluteEpsilon, relativeEpsilon);
+ const absDiff = Math.abs(left - right);
+ return absDiff <= absoluteEpsilon || absDiff <= relativeEpsilon * Math.max(Math.abs(left), Math.abs(right));
+};
+CesiumMath.lessThan = function(left, right, absoluteEpsilon) {
+ if (!defined_default(left)) {
+ throw new DeveloperError_default("first is required.");
+ }
+ if (!defined_default(right)) {
+ throw new DeveloperError_default("second is required.");
+ }
+ if (!defined_default(absoluteEpsilon)) {
+ throw new DeveloperError_default("absoluteEpsilon is required.");
+ }
+ return left - right < -absoluteEpsilon;
+};
+CesiumMath.lessThanOrEquals = function(left, right, absoluteEpsilon) {
+ if (!defined_default(left)) {
+ throw new DeveloperError_default("first is required.");
+ }
+ if (!defined_default(right)) {
+ throw new DeveloperError_default("second is required.");
+ }
+ if (!defined_default(absoluteEpsilon)) {
+ throw new DeveloperError_default("absoluteEpsilon is required.");
+ }
+ return left - right < absoluteEpsilon;
+};
+CesiumMath.greaterThan = function(left, right, absoluteEpsilon) {
+ if (!defined_default(left)) {
+ throw new DeveloperError_default("first is required.");
+ }
+ if (!defined_default(right)) {
+ throw new DeveloperError_default("second is required.");
+ }
+ if (!defined_default(absoluteEpsilon)) {
+ throw new DeveloperError_default("absoluteEpsilon is required.");
+ }
+ return left - right > absoluteEpsilon;
+};
+CesiumMath.greaterThanOrEquals = function(left, right, absoluteEpsilon) {
+ if (!defined_default(left)) {
+ throw new DeveloperError_default("first is required.");
+ }
+ if (!defined_default(right)) {
+ throw new DeveloperError_default("second is required.");
+ }
+ if (!defined_default(absoluteEpsilon)) {
+ throw new DeveloperError_default("absoluteEpsilon is required.");
+ }
+ return left - right > -absoluteEpsilon;
+};
+var factorials = [1];
+CesiumMath.factorial = function(n) {
+ if (typeof n !== "number" || n < 0) {
+ throw new DeveloperError_default(
+ "A number greater than or equal to 0 is required."
+ );
+ }
+ const length3 = factorials.length;
+ if (n >= length3) {
+ let sum = factorials[length3 - 1];
+ for (let i = length3; i <= n; i++) {
+ const next = sum * i;
+ factorials.push(next);
+ sum = next;
+ }
+ }
+ return factorials[n];
+};
+CesiumMath.incrementWrap = function(n, maximumValue, minimumValue) {
+ minimumValue = defaultValue_default(minimumValue, 0);
+ if (!defined_default(n)) {
+ throw new DeveloperError_default("n is required.");
+ }
+ if (maximumValue <= minimumValue) {
+ throw new DeveloperError_default("maximumValue must be greater than minimumValue.");
+ }
+ ++n;
+ if (n > maximumValue) {
+ n = minimumValue;
+ }
+ return n;
+};
+CesiumMath.isPowerOfTwo = function(n) {
+ if (typeof n !== "number" || n < 0 || n > 4294967295) {
+ throw new DeveloperError_default("A number between 0 and (2^32)-1 is required.");
+ }
+ return n !== 0 && (n & n - 1) === 0;
+};
+CesiumMath.nextPowerOfTwo = function(n) {
+ if (typeof n !== "number" || n < 0 || n > 2147483648) {
+ throw new DeveloperError_default("A number between 0 and 2^31 is required.");
+ }
+ --n;
+ n |= n >> 1;
+ n |= n >> 2;
+ n |= n >> 4;
+ n |= n >> 8;
+ n |= n >> 16;
+ ++n;
+ return n;
+};
+CesiumMath.previousPowerOfTwo = function(n) {
+ if (typeof n !== "number" || n < 0 || n > 4294967295) {
+ throw new DeveloperError_default("A number between 0 and (2^32)-1 is required.");
+ }
+ n |= n >> 1;
+ n |= n >> 2;
+ n |= n >> 4;
+ n |= n >> 8;
+ n |= n >> 16;
+ n |= n >> 32;
+ n = (n >>> 0) - (n >>> 1);
+ return n;
+};
+CesiumMath.clamp = function(value, min3, max3) {
+ Check_default.typeOf.number("value", value);
+ Check_default.typeOf.number("min", min3);
+ Check_default.typeOf.number("max", max3);
+ return value < min3 ? min3 : value > max3 ? max3 : value;
+};
+var randomNumberGenerator = new import_mersenne_twister.default();
+CesiumMath.setRandomNumberSeed = function(seed) {
+ if (!defined_default(seed)) {
+ throw new DeveloperError_default("seed is required.");
+ }
+ randomNumberGenerator = new import_mersenne_twister.default(seed);
+};
+CesiumMath.nextRandomNumber = function() {
+ return randomNumberGenerator.random();
+};
+CesiumMath.randomBetween = function(min3, max3) {
+ return CesiumMath.nextRandomNumber() * (max3 - min3) + min3;
+};
+CesiumMath.acosClamped = function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ return Math.acos(CesiumMath.clamp(value, -1, 1));
+};
+CesiumMath.asinClamped = function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ return Math.asin(CesiumMath.clamp(value, -1, 1));
+};
+CesiumMath.chordLength = function(angle, radius) {
+ if (!defined_default(angle)) {
+ throw new DeveloperError_default("angle is required.");
+ }
+ if (!defined_default(radius)) {
+ throw new DeveloperError_default("radius is required.");
+ }
+ return 2 * radius * Math.sin(angle * 0.5);
+};
+CesiumMath.logBase = function(number, base) {
+ if (!defined_default(number)) {
+ throw new DeveloperError_default("number is required.");
+ }
+ if (!defined_default(base)) {
+ throw new DeveloperError_default("base is required.");
+ }
+ return Math.log(number) / Math.log(base);
+};
+CesiumMath.cbrt = defaultValue_default(Math.cbrt, function cbrt(number) {
+ const result = Math.pow(Math.abs(number), 1 / 3);
+ return number < 0 ? -result : result;
+});
+CesiumMath.log2 = defaultValue_default(Math.log2, function log2(number) {
+ return Math.log(number) * Math.LOG2E;
+});
+CesiumMath.fog = function(distanceToCamera, density) {
+ const scalar = distanceToCamera * density;
+ return 1 - Math.exp(-(scalar * scalar));
+};
+CesiumMath.fastApproximateAtan = function(x) {
+ Check_default.typeOf.number("x", x);
+ return x * (-0.1784 * Math.abs(x) - 0.0663 * x * x + 1.0301);
+};
+CesiumMath.fastApproximateAtan2 = function(x, y) {
+ Check_default.typeOf.number("x", x);
+ Check_default.typeOf.number("y", y);
+ let opposite;
+ let t = Math.abs(x);
+ opposite = Math.abs(y);
+ const adjacent = Math.max(t, opposite);
+ opposite = Math.min(t, opposite);
+ const oppositeOverAdjacent = opposite / adjacent;
+ if (isNaN(oppositeOverAdjacent)) {
+ throw new DeveloperError_default("either x or y must be nonzero");
+ }
+ t = CesiumMath.fastApproximateAtan(oppositeOverAdjacent);
+ t = Math.abs(y) > Math.abs(x) ? CesiumMath.PI_OVER_TWO - t : t;
+ t = x < 0 ? CesiumMath.PI - t : t;
+ t = y < 0 ? -t : t;
+ return t;
+};
+var Math_default = CesiumMath;
+
+// Source/Core/Cartesian3.js
+function Cartesian3(x, y, z) {
+ this.x = defaultValue_default(x, 0);
+ this.y = defaultValue_default(y, 0);
+ this.z = defaultValue_default(z, 0);
+}
+Cartesian3.fromSpherical = function(spherical, result) {
+ Check_default.typeOf.object("spherical", spherical);
+ if (!defined_default(result)) {
+ result = new Cartesian3();
+ }
+ const clock = spherical.clock;
+ const cone = spherical.cone;
+ const magnitude = defaultValue_default(spherical.magnitude, 1);
+ const radial = magnitude * Math.sin(cone);
+ result.x = radial * Math.cos(clock);
+ result.y = radial * Math.sin(clock);
+ result.z = magnitude * Math.cos(cone);
+ return result;
+};
+Cartesian3.fromElements = function(x, y, z, result) {
+ if (!defined_default(result)) {
+ return new Cartesian3(x, y, z);
+ }
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+};
+Cartesian3.clone = function(cartesian11, result) {
+ if (!defined_default(cartesian11)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Cartesian3(cartesian11.x, cartesian11.y, cartesian11.z);
+ }
+ result.x = cartesian11.x;
+ result.y = cartesian11.y;
+ result.z = cartesian11.z;
+ return result;
+};
+Cartesian3.fromCartesian4 = Cartesian3.clone;
+Cartesian3.packedLength = 3;
+Cartesian3.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.x;
+ array[startingIndex++] = value.y;
+ array[startingIndex] = value.z;
+ return array;
+};
+Cartesian3.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new Cartesian3();
+ }
+ result.x = array[startingIndex++];
+ result.y = array[startingIndex++];
+ result.z = array[startingIndex];
+ return result;
+};
+Cartesian3.packArray = function(array, result) {
+ Check_default.defined("array", array);
+ const length3 = array.length;
+ const resultLength = length3 * 3;
+ if (!defined_default(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ throw new DeveloperError_default(
+ "If result is a typed array, it must have exactly array.length * 3 elements"
+ );
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+ for (let i = 0; i < length3; ++i) {
+ Cartesian3.pack(array[i], result, i * 3);
+ }
+ return result;
+};
+Cartesian3.unpackArray = function(array, result) {
+ Check_default.defined("array", array);
+ Check_default.typeOf.number.greaterThanOrEquals("array.length", array.length, 3);
+ if (array.length % 3 !== 0) {
+ throw new DeveloperError_default("array length must be a multiple of 3.");
+ }
+ const length3 = array.length;
+ if (!defined_default(result)) {
+ result = new Array(length3 / 3);
+ } else {
+ result.length = length3 / 3;
+ }
+ for (let i = 0; i < length3; i += 3) {
+ const index = i / 3;
+ result[index] = Cartesian3.unpack(array, i, result[index]);
+ }
+ return result;
+};
+Cartesian3.fromArray = Cartesian3.unpack;
+Cartesian3.maximumComponent = function(cartesian11) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ return Math.max(cartesian11.x, cartesian11.y, cartesian11.z);
+};
+Cartesian3.minimumComponent = function(cartesian11) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ return Math.min(cartesian11.x, cartesian11.y, cartesian11.z);
+};
+Cartesian3.minimumByComponent = function(first, second, result) {
+ Check_default.typeOf.object("first", first);
+ Check_default.typeOf.object("second", second);
+ Check_default.typeOf.object("result", result);
+ result.x = Math.min(first.x, second.x);
+ result.y = Math.min(first.y, second.y);
+ result.z = Math.min(first.z, second.z);
+ return result;
+};
+Cartesian3.maximumByComponent = function(first, second, result) {
+ Check_default.typeOf.object("first", first);
+ Check_default.typeOf.object("second", second);
+ Check_default.typeOf.object("result", result);
+ result.x = Math.max(first.x, second.x);
+ result.y = Math.max(first.y, second.y);
+ result.z = Math.max(first.z, second.z);
+ return result;
+};
+Cartesian3.clamp = function(value, min3, max3, result) {
+ Check_default.typeOf.object("value", value);
+ Check_default.typeOf.object("min", min3);
+ Check_default.typeOf.object("max", max3);
+ Check_default.typeOf.object("result", result);
+ const x = Math_default.clamp(value.x, min3.x, max3.x);
+ const y = Math_default.clamp(value.y, min3.y, max3.y);
+ const z = Math_default.clamp(value.z, min3.z, max3.z);
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+};
+Cartesian3.magnitudeSquared = function(cartesian11) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ return cartesian11.x * cartesian11.x + cartesian11.y * cartesian11.y + cartesian11.z * cartesian11.z;
+};
+Cartesian3.magnitude = function(cartesian11) {
+ return Math.sqrt(Cartesian3.magnitudeSquared(cartesian11));
+};
+var distanceScratch = new Cartesian3();
+Cartesian3.distance = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Cartesian3.subtract(left, right, distanceScratch);
+ return Cartesian3.magnitude(distanceScratch);
+};
+Cartesian3.distanceSquared = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Cartesian3.subtract(left, right, distanceScratch);
+ return Cartesian3.magnitudeSquared(distanceScratch);
+};
+Cartesian3.normalize = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const magnitude = Cartesian3.magnitude(cartesian11);
+ result.x = cartesian11.x / magnitude;
+ result.y = cartesian11.y / magnitude;
+ result.z = cartesian11.z / magnitude;
+ if (isNaN(result.x) || isNaN(result.y) || isNaN(result.z)) {
+ throw new DeveloperError_default("normalized result is not a number");
+ }
+ return result;
+};
+Cartesian3.dot = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ return left.x * right.x + left.y * right.y + left.z * right.z;
+};
+Cartesian3.multiplyComponents = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x * right.x;
+ result.y = left.y * right.y;
+ result.z = left.z * right.z;
+ return result;
+};
+Cartesian3.divideComponents = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x / right.x;
+ result.y = left.y / right.y;
+ result.z = left.z / right.z;
+ return result;
+};
+Cartesian3.add = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x + right.x;
+ result.y = left.y + right.y;
+ result.z = left.z + right.z;
+ return result;
+};
+Cartesian3.subtract = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x - right.x;
+ result.y = left.y - right.y;
+ result.z = left.z - right.z;
+ return result;
+};
+Cartesian3.multiplyByScalar = function(cartesian11, scalar, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result.x = cartesian11.x * scalar;
+ result.y = cartesian11.y * scalar;
+ result.z = cartesian11.z * scalar;
+ return result;
+};
+Cartesian3.divideByScalar = function(cartesian11, scalar, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result.x = cartesian11.x / scalar;
+ result.y = cartesian11.y / scalar;
+ result.z = cartesian11.z / scalar;
+ return result;
+};
+Cartesian3.negate = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result.x = -cartesian11.x;
+ result.y = -cartesian11.y;
+ result.z = -cartesian11.z;
+ return result;
+};
+Cartesian3.abs = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result.x = Math.abs(cartesian11.x);
+ result.y = Math.abs(cartesian11.y);
+ result.z = Math.abs(cartesian11.z);
+ return result;
+};
+var lerpScratch = new Cartesian3();
+Cartesian3.lerp = function(start, end, t, result) {
+ Check_default.typeOf.object("start", start);
+ Check_default.typeOf.object("end", end);
+ Check_default.typeOf.number("t", t);
+ Check_default.typeOf.object("result", result);
+ Cartesian3.multiplyByScalar(end, t, lerpScratch);
+ result = Cartesian3.multiplyByScalar(start, 1 - t, result);
+ return Cartesian3.add(lerpScratch, result, result);
+};
+var angleBetweenScratch = new Cartesian3();
+var angleBetweenScratch2 = new Cartesian3();
+Cartesian3.angleBetween = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Cartesian3.normalize(left, angleBetweenScratch);
+ Cartesian3.normalize(right, angleBetweenScratch2);
+ const cosine = Cartesian3.dot(angleBetweenScratch, angleBetweenScratch2);
+ const sine = Cartesian3.magnitude(
+ Cartesian3.cross(
+ angleBetweenScratch,
+ angleBetweenScratch2,
+ angleBetweenScratch
+ )
+ );
+ return Math.atan2(sine, cosine);
+};
+var mostOrthogonalAxisScratch = new Cartesian3();
+Cartesian3.mostOrthogonalAxis = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const f = Cartesian3.normalize(cartesian11, mostOrthogonalAxisScratch);
+ Cartesian3.abs(f, f);
+ if (f.x <= f.y) {
+ if (f.x <= f.z) {
+ result = Cartesian3.clone(Cartesian3.UNIT_X, result);
+ } else {
+ result = Cartesian3.clone(Cartesian3.UNIT_Z, result);
+ }
+ } else if (f.y <= f.z) {
+ result = Cartesian3.clone(Cartesian3.UNIT_Y, result);
+ } else {
+ result = Cartesian3.clone(Cartesian3.UNIT_Z, result);
+ }
+ return result;
+};
+Cartesian3.projectVector = function(a3, b, result) {
+ Check_default.defined("a", a3);
+ Check_default.defined("b", b);
+ Check_default.defined("result", result);
+ const scalar = Cartesian3.dot(a3, b) / Cartesian3.dot(b, b);
+ return Cartesian3.multiplyByScalar(b, scalar, result);
+};
+Cartesian3.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.x === right.x && left.y === right.y && left.z === right.z;
+};
+Cartesian3.equalsArray = function(cartesian11, array, offset2) {
+ return cartesian11.x === array[offset2] && cartesian11.y === array[offset2 + 1] && cartesian11.z === array[offset2 + 2];
+};
+Cartesian3.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {
+ return left === right || defined_default(left) && defined_default(right) && Math_default.equalsEpsilon(
+ left.x,
+ right.x,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ left.y,
+ right.y,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ left.z,
+ right.z,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+};
+Cartesian3.cross = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ const leftX = left.x;
+ const leftY = left.y;
+ const leftZ = left.z;
+ const rightX = right.x;
+ const rightY = right.y;
+ const rightZ = right.z;
+ const x = leftY * rightZ - leftZ * rightY;
+ const y = leftZ * rightX - leftX * rightZ;
+ const z = leftX * rightY - leftY * rightX;
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+};
+Cartesian3.midpoint = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = (left.x + right.x) * 0.5;
+ result.y = (left.y + right.y) * 0.5;
+ result.z = (left.z + right.z) * 0.5;
+ return result;
+};
+Cartesian3.fromDegrees = function(longitude, latitude, height, ellipsoid, result) {
+ Check_default.typeOf.number("longitude", longitude);
+ Check_default.typeOf.number("latitude", latitude);
+ longitude = Math_default.toRadians(longitude);
+ latitude = Math_default.toRadians(latitude);
+ return Cartesian3.fromRadians(longitude, latitude, height, ellipsoid, result);
+};
+var scratchN = new Cartesian3();
+var scratchK = new Cartesian3();
+var wgs84RadiiSquared = new Cartesian3(
+ 6378137 * 6378137,
+ 6378137 * 6378137,
+ 6356752314245179e-9 * 6356752314245179e-9
+);
+Cartesian3.fromRadians = function(longitude, latitude, height, ellipsoid, result) {
+ Check_default.typeOf.number("longitude", longitude);
+ Check_default.typeOf.number("latitude", latitude);
+ height = defaultValue_default(height, 0);
+ const radiiSquared = defined_default(ellipsoid) ? ellipsoid.radiiSquared : wgs84RadiiSquared;
+ const cosLatitude = Math.cos(latitude);
+ scratchN.x = cosLatitude * Math.cos(longitude);
+ scratchN.y = cosLatitude * Math.sin(longitude);
+ scratchN.z = Math.sin(latitude);
+ scratchN = Cartesian3.normalize(scratchN, scratchN);
+ Cartesian3.multiplyComponents(radiiSquared, scratchN, scratchK);
+ const gamma = Math.sqrt(Cartesian3.dot(scratchN, scratchK));
+ scratchK = Cartesian3.divideByScalar(scratchK, gamma, scratchK);
+ scratchN = Cartesian3.multiplyByScalar(scratchN, height, scratchN);
+ if (!defined_default(result)) {
+ result = new Cartesian3();
+ }
+ return Cartesian3.add(scratchK, scratchN, result);
+};
+Cartesian3.fromDegreesArray = function(coordinates, ellipsoid, result) {
+ Check_default.defined("coordinates", coordinates);
+ if (coordinates.length < 2 || coordinates.length % 2 !== 0) {
+ throw new DeveloperError_default(
+ "the number of coordinates must be a multiple of 2 and at least 2"
+ );
+ }
+ const length3 = coordinates.length;
+ if (!defined_default(result)) {
+ result = new Array(length3 / 2);
+ } else {
+ result.length = length3 / 2;
+ }
+ for (let i = 0; i < length3; i += 2) {
+ const longitude = coordinates[i];
+ const latitude = coordinates[i + 1];
+ const index = i / 2;
+ result[index] = Cartesian3.fromDegrees(
+ longitude,
+ latitude,
+ 0,
+ ellipsoid,
+ result[index]
+ );
+ }
+ return result;
+};
+Cartesian3.fromRadiansArray = function(coordinates, ellipsoid, result) {
+ Check_default.defined("coordinates", coordinates);
+ if (coordinates.length < 2 || coordinates.length % 2 !== 0) {
+ throw new DeveloperError_default(
+ "the number of coordinates must be a multiple of 2 and at least 2"
+ );
+ }
+ const length3 = coordinates.length;
+ if (!defined_default(result)) {
+ result = new Array(length3 / 2);
+ } else {
+ result.length = length3 / 2;
+ }
+ for (let i = 0; i < length3; i += 2) {
+ const longitude = coordinates[i];
+ const latitude = coordinates[i + 1];
+ const index = i / 2;
+ result[index] = Cartesian3.fromRadians(
+ longitude,
+ latitude,
+ 0,
+ ellipsoid,
+ result[index]
+ );
+ }
+ return result;
+};
+Cartesian3.fromDegreesArrayHeights = function(coordinates, ellipsoid, result) {
+ Check_default.defined("coordinates", coordinates);
+ if (coordinates.length < 3 || coordinates.length % 3 !== 0) {
+ throw new DeveloperError_default(
+ "the number of coordinates must be a multiple of 3 and at least 3"
+ );
+ }
+ const length3 = coordinates.length;
+ if (!defined_default(result)) {
+ result = new Array(length3 / 3);
+ } else {
+ result.length = length3 / 3;
+ }
+ for (let i = 0; i < length3; i += 3) {
+ const longitude = coordinates[i];
+ const latitude = coordinates[i + 1];
+ const height = coordinates[i + 2];
+ const index = i / 3;
+ result[index] = Cartesian3.fromDegrees(
+ longitude,
+ latitude,
+ height,
+ ellipsoid,
+ result[index]
+ );
+ }
+ return result;
+};
+Cartesian3.fromRadiansArrayHeights = function(coordinates, ellipsoid, result) {
+ Check_default.defined("coordinates", coordinates);
+ if (coordinates.length < 3 || coordinates.length % 3 !== 0) {
+ throw new DeveloperError_default(
+ "the number of coordinates must be a multiple of 3 and at least 3"
+ );
+ }
+ const length3 = coordinates.length;
+ if (!defined_default(result)) {
+ result = new Array(length3 / 3);
+ } else {
+ result.length = length3 / 3;
+ }
+ for (let i = 0; i < length3; i += 3) {
+ const longitude = coordinates[i];
+ const latitude = coordinates[i + 1];
+ const height = coordinates[i + 2];
+ const index = i / 3;
+ result[index] = Cartesian3.fromRadians(
+ longitude,
+ latitude,
+ height,
+ ellipsoid,
+ result[index]
+ );
+ }
+ return result;
+};
+Cartesian3.ZERO = Object.freeze(new Cartesian3(0, 0, 0));
+Cartesian3.ONE = Object.freeze(new Cartesian3(1, 1, 1));
+Cartesian3.UNIT_X = Object.freeze(new Cartesian3(1, 0, 0));
+Cartesian3.UNIT_Y = Object.freeze(new Cartesian3(0, 1, 0));
+Cartesian3.UNIT_Z = Object.freeze(new Cartesian3(0, 0, 1));
+Cartesian3.prototype.clone = function(result) {
+ return Cartesian3.clone(this, result);
+};
+Cartesian3.prototype.equals = function(right) {
+ return Cartesian3.equals(this, right);
+};
+Cartesian3.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) {
+ return Cartesian3.equalsEpsilon(
+ this,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+};
+Cartesian3.prototype.toString = function() {
+ return `(${this.x}, ${this.y}, ${this.z})`;
+};
+var Cartesian3_default = Cartesian3;
+
+// Source/Core/Cartesian4.js
+function Cartesian4(x, y, z, w) {
+ this.x = defaultValue_default(x, 0);
+ this.y = defaultValue_default(y, 0);
+ this.z = defaultValue_default(z, 0);
+ this.w = defaultValue_default(w, 0);
+}
+Cartesian4.fromElements = function(x, y, z, w, result) {
+ if (!defined_default(result)) {
+ return new Cartesian4(x, y, z, w);
+ }
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+};
+Cartesian4.fromColor = function(color, result) {
+ Check_default.typeOf.object("color", color);
+ if (!defined_default(result)) {
+ return new Cartesian4(color.red, color.green, color.blue, color.alpha);
+ }
+ result.x = color.red;
+ result.y = color.green;
+ result.z = color.blue;
+ result.w = color.alpha;
+ return result;
+};
+Cartesian4.clone = function(cartesian11, result) {
+ if (!defined_default(cartesian11)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Cartesian4(cartesian11.x, cartesian11.y, cartesian11.z, cartesian11.w);
+ }
+ result.x = cartesian11.x;
+ result.y = cartesian11.y;
+ result.z = cartesian11.z;
+ result.w = cartesian11.w;
+ return result;
+};
+Cartesian4.packedLength = 4;
+Cartesian4.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.x;
+ array[startingIndex++] = value.y;
+ array[startingIndex++] = value.z;
+ array[startingIndex] = value.w;
+ return array;
+};
+Cartesian4.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new Cartesian4();
+ }
+ result.x = array[startingIndex++];
+ result.y = array[startingIndex++];
+ result.z = array[startingIndex++];
+ result.w = array[startingIndex];
+ return result;
+};
+Cartesian4.packArray = function(array, result) {
+ Check_default.defined("array", array);
+ const length3 = array.length;
+ const resultLength = length3 * 4;
+ if (!defined_default(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ throw new DeveloperError_default(
+ "If result is a typed array, it must have exactly array.length * 4 elements"
+ );
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+ for (let i = 0; i < length3; ++i) {
+ Cartesian4.pack(array[i], result, i * 4);
+ }
+ return result;
+};
+Cartesian4.unpackArray = function(array, result) {
+ Check_default.defined("array", array);
+ Check_default.typeOf.number.greaterThanOrEquals("array.length", array.length, 4);
+ if (array.length % 4 !== 0) {
+ throw new DeveloperError_default("array length must be a multiple of 4.");
+ }
+ const length3 = array.length;
+ if (!defined_default(result)) {
+ result = new Array(length3 / 4);
+ } else {
+ result.length = length3 / 4;
+ }
+ for (let i = 0; i < length3; i += 4) {
+ const index = i / 4;
+ result[index] = Cartesian4.unpack(array, i, result[index]);
+ }
+ return result;
+};
+Cartesian4.fromArray = Cartesian4.unpack;
+Cartesian4.maximumComponent = function(cartesian11) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ return Math.max(cartesian11.x, cartesian11.y, cartesian11.z, cartesian11.w);
+};
+Cartesian4.minimumComponent = function(cartesian11) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ return Math.min(cartesian11.x, cartesian11.y, cartesian11.z, cartesian11.w);
+};
+Cartesian4.minimumByComponent = function(first, second, result) {
+ Check_default.typeOf.object("first", first);
+ Check_default.typeOf.object("second", second);
+ Check_default.typeOf.object("result", result);
+ result.x = Math.min(first.x, second.x);
+ result.y = Math.min(first.y, second.y);
+ result.z = Math.min(first.z, second.z);
+ result.w = Math.min(first.w, second.w);
+ return result;
+};
+Cartesian4.maximumByComponent = function(first, second, result) {
+ Check_default.typeOf.object("first", first);
+ Check_default.typeOf.object("second", second);
+ Check_default.typeOf.object("result", result);
+ result.x = Math.max(first.x, second.x);
+ result.y = Math.max(first.y, second.y);
+ result.z = Math.max(first.z, second.z);
+ result.w = Math.max(first.w, second.w);
+ return result;
+};
+Cartesian4.clamp = function(value, min3, max3, result) {
+ Check_default.typeOf.object("value", value);
+ Check_default.typeOf.object("min", min3);
+ Check_default.typeOf.object("max", max3);
+ Check_default.typeOf.object("result", result);
+ const x = Math_default.clamp(value.x, min3.x, max3.x);
+ const y = Math_default.clamp(value.y, min3.y, max3.y);
+ const z = Math_default.clamp(value.z, min3.z, max3.z);
+ const w = Math_default.clamp(value.w, min3.w, max3.w);
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+};
+Cartesian4.magnitudeSquared = function(cartesian11) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ return cartesian11.x * cartesian11.x + cartesian11.y * cartesian11.y + cartesian11.z * cartesian11.z + cartesian11.w * cartesian11.w;
+};
+Cartesian4.magnitude = function(cartesian11) {
+ return Math.sqrt(Cartesian4.magnitudeSquared(cartesian11));
+};
+var distanceScratch2 = new Cartesian4();
+Cartesian4.distance = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Cartesian4.subtract(left, right, distanceScratch2);
+ return Cartesian4.magnitude(distanceScratch2);
+};
+Cartesian4.distanceSquared = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Cartesian4.subtract(left, right, distanceScratch2);
+ return Cartesian4.magnitudeSquared(distanceScratch2);
+};
+Cartesian4.normalize = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const magnitude = Cartesian4.magnitude(cartesian11);
+ result.x = cartesian11.x / magnitude;
+ result.y = cartesian11.y / magnitude;
+ result.z = cartesian11.z / magnitude;
+ result.w = cartesian11.w / magnitude;
+ if (isNaN(result.x) || isNaN(result.y) || isNaN(result.z) || isNaN(result.w)) {
+ throw new DeveloperError_default("normalized result is not a number");
+ }
+ return result;
+};
+Cartesian4.dot = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w;
+};
+Cartesian4.multiplyComponents = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x * right.x;
+ result.y = left.y * right.y;
+ result.z = left.z * right.z;
+ result.w = left.w * right.w;
+ return result;
+};
+Cartesian4.divideComponents = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x / right.x;
+ result.y = left.y / right.y;
+ result.z = left.z / right.z;
+ result.w = left.w / right.w;
+ return result;
+};
+Cartesian4.add = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x + right.x;
+ result.y = left.y + right.y;
+ result.z = left.z + right.z;
+ result.w = left.w + right.w;
+ return result;
+};
+Cartesian4.subtract = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x - right.x;
+ result.y = left.y - right.y;
+ result.z = left.z - right.z;
+ result.w = left.w - right.w;
+ return result;
+};
+Cartesian4.multiplyByScalar = function(cartesian11, scalar, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result.x = cartesian11.x * scalar;
+ result.y = cartesian11.y * scalar;
+ result.z = cartesian11.z * scalar;
+ result.w = cartesian11.w * scalar;
+ return result;
+};
+Cartesian4.divideByScalar = function(cartesian11, scalar, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result.x = cartesian11.x / scalar;
+ result.y = cartesian11.y / scalar;
+ result.z = cartesian11.z / scalar;
+ result.w = cartesian11.w / scalar;
+ return result;
+};
+Cartesian4.negate = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result.x = -cartesian11.x;
+ result.y = -cartesian11.y;
+ result.z = -cartesian11.z;
+ result.w = -cartesian11.w;
+ return result;
+};
+Cartesian4.abs = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result.x = Math.abs(cartesian11.x);
+ result.y = Math.abs(cartesian11.y);
+ result.z = Math.abs(cartesian11.z);
+ result.w = Math.abs(cartesian11.w);
+ return result;
+};
+var lerpScratch2 = new Cartesian4();
+Cartesian4.lerp = function(start, end, t, result) {
+ Check_default.typeOf.object("start", start);
+ Check_default.typeOf.object("end", end);
+ Check_default.typeOf.number("t", t);
+ Check_default.typeOf.object("result", result);
+ Cartesian4.multiplyByScalar(end, t, lerpScratch2);
+ result = Cartesian4.multiplyByScalar(start, 1 - t, result);
+ return Cartesian4.add(lerpScratch2, result, result);
+};
+var mostOrthogonalAxisScratch2 = new Cartesian4();
+Cartesian4.mostOrthogonalAxis = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const f = Cartesian4.normalize(cartesian11, mostOrthogonalAxisScratch2);
+ Cartesian4.abs(f, f);
+ if (f.x <= f.y) {
+ if (f.x <= f.z) {
+ if (f.x <= f.w) {
+ result = Cartesian4.clone(Cartesian4.UNIT_X, result);
+ } else {
+ result = Cartesian4.clone(Cartesian4.UNIT_W, result);
+ }
+ } else if (f.z <= f.w) {
+ result = Cartesian4.clone(Cartesian4.UNIT_Z, result);
+ } else {
+ result = Cartesian4.clone(Cartesian4.UNIT_W, result);
+ }
+ } else if (f.y <= f.z) {
+ if (f.y <= f.w) {
+ result = Cartesian4.clone(Cartesian4.UNIT_Y, result);
+ } else {
+ result = Cartesian4.clone(Cartesian4.UNIT_W, result);
+ }
+ } else if (f.z <= f.w) {
+ result = Cartesian4.clone(Cartesian4.UNIT_Z, result);
+ } else {
+ result = Cartesian4.clone(Cartesian4.UNIT_W, result);
+ }
+ return result;
+};
+Cartesian4.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.x === right.x && left.y === right.y && left.z === right.z && left.w === right.w;
+};
+Cartesian4.equalsArray = function(cartesian11, array, offset2) {
+ return cartesian11.x === array[offset2] && cartesian11.y === array[offset2 + 1] && cartesian11.z === array[offset2 + 2] && cartesian11.w === array[offset2 + 3];
+};
+Cartesian4.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {
+ return left === right || defined_default(left) && defined_default(right) && Math_default.equalsEpsilon(
+ left.x,
+ right.x,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ left.y,
+ right.y,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ left.z,
+ right.z,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ left.w,
+ right.w,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+};
+Cartesian4.ZERO = Object.freeze(new Cartesian4(0, 0, 0, 0));
+Cartesian4.ONE = Object.freeze(new Cartesian4(1, 1, 1, 1));
+Cartesian4.UNIT_X = Object.freeze(new Cartesian4(1, 0, 0, 0));
+Cartesian4.UNIT_Y = Object.freeze(new Cartesian4(0, 1, 0, 0));
+Cartesian4.UNIT_Z = Object.freeze(new Cartesian4(0, 0, 1, 0));
+Cartesian4.UNIT_W = Object.freeze(new Cartesian4(0, 0, 0, 1));
+Cartesian4.prototype.clone = function(result) {
+ return Cartesian4.clone(this, result);
+};
+Cartesian4.prototype.equals = function(right) {
+ return Cartesian4.equals(this, right);
+};
+Cartesian4.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) {
+ return Cartesian4.equalsEpsilon(
+ this,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+};
+Cartesian4.prototype.toString = function() {
+ return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;
+};
+var scratchF32Array = new Float32Array(1);
+var scratchU8Array = new Uint8Array(scratchF32Array.buffer);
+var testU32 = new Uint32Array([287454020]);
+var testU8 = new Uint8Array(testU32.buffer);
+var littleEndian = testU8[0] === 68;
+Cartesian4.packFloat = function(value, result) {
+ Check_default.typeOf.number("value", value);
+ if (!defined_default(result)) {
+ result = new Cartesian4();
+ }
+ scratchF32Array[0] = value;
+ if (littleEndian) {
+ result.x = scratchU8Array[0];
+ result.y = scratchU8Array[1];
+ result.z = scratchU8Array[2];
+ result.w = scratchU8Array[3];
+ } else {
+ result.x = scratchU8Array[3];
+ result.y = scratchU8Array[2];
+ result.z = scratchU8Array[1];
+ result.w = scratchU8Array[0];
+ }
+ return result;
+};
+Cartesian4.unpackFloat = function(packedFloat) {
+ Check_default.typeOf.object("packedFloat", packedFloat);
+ if (littleEndian) {
+ scratchU8Array[0] = packedFloat.x;
+ scratchU8Array[1] = packedFloat.y;
+ scratchU8Array[2] = packedFloat.z;
+ scratchU8Array[3] = packedFloat.w;
+ } else {
+ scratchU8Array[0] = packedFloat.w;
+ scratchU8Array[1] = packedFloat.z;
+ scratchU8Array[2] = packedFloat.y;
+ scratchU8Array[3] = packedFloat.x;
+ }
+ return scratchF32Array[0];
+};
+var Cartesian4_default = Cartesian4;
+
+// Source/Core/Matrix3.js
+function Matrix3(column0Row0, column1Row0, column2Row0, column0Row1, column1Row1, column2Row1, column0Row2, column1Row2, column2Row2) {
+ this[0] = defaultValue_default(column0Row0, 0);
+ this[1] = defaultValue_default(column0Row1, 0);
+ this[2] = defaultValue_default(column0Row2, 0);
+ this[3] = defaultValue_default(column1Row0, 0);
+ this[4] = defaultValue_default(column1Row1, 0);
+ this[5] = defaultValue_default(column1Row2, 0);
+ this[6] = defaultValue_default(column2Row0, 0);
+ this[7] = defaultValue_default(column2Row1, 0);
+ this[8] = defaultValue_default(column2Row2, 0);
+}
+Matrix3.packedLength = 9;
+Matrix3.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value[0];
+ array[startingIndex++] = value[1];
+ array[startingIndex++] = value[2];
+ array[startingIndex++] = value[3];
+ array[startingIndex++] = value[4];
+ array[startingIndex++] = value[5];
+ array[startingIndex++] = value[6];
+ array[startingIndex++] = value[7];
+ array[startingIndex++] = value[8];
+ return array;
+};
+Matrix3.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new Matrix3();
+ }
+ result[0] = array[startingIndex++];
+ result[1] = array[startingIndex++];
+ result[2] = array[startingIndex++];
+ result[3] = array[startingIndex++];
+ result[4] = array[startingIndex++];
+ result[5] = array[startingIndex++];
+ result[6] = array[startingIndex++];
+ result[7] = array[startingIndex++];
+ result[8] = array[startingIndex++];
+ return result;
+};
+Matrix3.packArray = function(array, result) {
+ Check_default.defined("array", array);
+ const length3 = array.length;
+ const resultLength = length3 * 9;
+ if (!defined_default(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ throw new DeveloperError_default(
+ "If result is a typed array, it must have exactly array.length * 9 elements"
+ );
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+ for (let i = 0; i < length3; ++i) {
+ Matrix3.pack(array[i], result, i * 9);
+ }
+ return result;
+};
+Matrix3.unpackArray = function(array, result) {
+ Check_default.defined("array", array);
+ Check_default.typeOf.number.greaterThanOrEquals("array.length", array.length, 9);
+ if (array.length % 9 !== 0) {
+ throw new DeveloperError_default("array length must be a multiple of 9.");
+ }
+ const length3 = array.length;
+ if (!defined_default(result)) {
+ result = new Array(length3 / 9);
+ } else {
+ result.length = length3 / 9;
+ }
+ for (let i = 0; i < length3; i += 9) {
+ const index = i / 9;
+ result[index] = Matrix3.unpack(array, i, result[index]);
+ }
+ return result;
+};
+Matrix3.clone = function(matrix, result) {
+ if (!defined_default(matrix)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Matrix3(
+ matrix[0],
+ matrix[3],
+ matrix[6],
+ matrix[1],
+ matrix[4],
+ matrix[7],
+ matrix[2],
+ matrix[5],
+ matrix[8]
+ );
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ return result;
+};
+Matrix3.fromArray = Matrix3.unpack;
+Matrix3.fromColumnMajorArray = function(values, result) {
+ Check_default.defined("values", values);
+ return Matrix3.clone(values, result);
+};
+Matrix3.fromRowMajorArray = function(values, result) {
+ Check_default.defined("values", values);
+ if (!defined_default(result)) {
+ return new Matrix3(
+ values[0],
+ values[1],
+ values[2],
+ values[3],
+ values[4],
+ values[5],
+ values[6],
+ values[7],
+ values[8]
+ );
+ }
+ result[0] = values[0];
+ result[1] = values[3];
+ result[2] = values[6];
+ result[3] = values[1];
+ result[4] = values[4];
+ result[5] = values[7];
+ result[6] = values[2];
+ result[7] = values[5];
+ result[8] = values[8];
+ return result;
+};
+Matrix3.fromQuaternion = function(quaternion, result) {
+ Check_default.typeOf.object("quaternion", quaternion);
+ const x2 = quaternion.x * quaternion.x;
+ const xy = quaternion.x * quaternion.y;
+ const xz = quaternion.x * quaternion.z;
+ const xw = quaternion.x * quaternion.w;
+ const y2 = quaternion.y * quaternion.y;
+ const yz = quaternion.y * quaternion.z;
+ const yw = quaternion.y * quaternion.w;
+ const z2 = quaternion.z * quaternion.z;
+ const zw = quaternion.z * quaternion.w;
+ const w2 = quaternion.w * quaternion.w;
+ const m00 = x2 - y2 - z2 + w2;
+ const m01 = 2 * (xy - zw);
+ const m02 = 2 * (xz + yw);
+ const m10 = 2 * (xy + zw);
+ const m11 = -x2 + y2 - z2 + w2;
+ const m12 = 2 * (yz - xw);
+ const m20 = 2 * (xz - yw);
+ const m21 = 2 * (yz + xw);
+ const m22 = -x2 - y2 + z2 + w2;
+ if (!defined_default(result)) {
+ return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);
+ }
+ result[0] = m00;
+ result[1] = m10;
+ result[2] = m20;
+ result[3] = m01;
+ result[4] = m11;
+ result[5] = m21;
+ result[6] = m02;
+ result[7] = m12;
+ result[8] = m22;
+ return result;
+};
+Matrix3.fromHeadingPitchRoll = function(headingPitchRoll, result) {
+ Check_default.typeOf.object("headingPitchRoll", headingPitchRoll);
+ const cosTheta = Math.cos(-headingPitchRoll.pitch);
+ const cosPsi = Math.cos(-headingPitchRoll.heading);
+ const cosPhi = Math.cos(headingPitchRoll.roll);
+ const sinTheta = Math.sin(-headingPitchRoll.pitch);
+ const sinPsi = Math.sin(-headingPitchRoll.heading);
+ const sinPhi = Math.sin(headingPitchRoll.roll);
+ const m00 = cosTheta * cosPsi;
+ const m01 = -cosPhi * sinPsi + sinPhi * sinTheta * cosPsi;
+ const m02 = sinPhi * sinPsi + cosPhi * sinTheta * cosPsi;
+ const m10 = cosTheta * sinPsi;
+ const m11 = cosPhi * cosPsi + sinPhi * sinTheta * sinPsi;
+ const m12 = -sinPhi * cosPsi + cosPhi * sinTheta * sinPsi;
+ const m20 = -sinTheta;
+ const m21 = sinPhi * cosTheta;
+ const m22 = cosPhi * cosTheta;
+ if (!defined_default(result)) {
+ return new Matrix3(m00, m01, m02, m10, m11, m12, m20, m21, m22);
+ }
+ result[0] = m00;
+ result[1] = m10;
+ result[2] = m20;
+ result[3] = m01;
+ result[4] = m11;
+ result[5] = m21;
+ result[6] = m02;
+ result[7] = m12;
+ result[8] = m22;
+ return result;
+};
+Matrix3.fromScale = function(scale, result) {
+ Check_default.typeOf.object("scale", scale);
+ if (!defined_default(result)) {
+ return new Matrix3(scale.x, 0, 0, 0, scale.y, 0, 0, 0, scale.z);
+ }
+ result[0] = scale.x;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = scale.y;
+ result[5] = 0;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = scale.z;
+ return result;
+};
+Matrix3.fromUniformScale = function(scale, result) {
+ Check_default.typeOf.number("scale", scale);
+ if (!defined_default(result)) {
+ return new Matrix3(scale, 0, 0, 0, scale, 0, 0, 0, scale);
+ }
+ result[0] = scale;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = scale;
+ result[5] = 0;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = scale;
+ return result;
+};
+Matrix3.fromCrossProduct = function(vector, result) {
+ Check_default.typeOf.object("vector", vector);
+ if (!defined_default(result)) {
+ return new Matrix3(
+ 0,
+ -vector.z,
+ vector.y,
+ vector.z,
+ 0,
+ -vector.x,
+ -vector.y,
+ vector.x,
+ 0
+ );
+ }
+ result[0] = 0;
+ result[1] = vector.z;
+ result[2] = -vector.y;
+ result[3] = -vector.z;
+ result[4] = 0;
+ result[5] = vector.x;
+ result[6] = vector.y;
+ result[7] = -vector.x;
+ result[8] = 0;
+ return result;
+};
+Matrix3.fromRotationX = function(angle, result) {
+ Check_default.typeOf.number("angle", angle);
+ const cosAngle = Math.cos(angle);
+ const sinAngle = Math.sin(angle);
+ if (!defined_default(result)) {
+ return new Matrix3(
+ 1,
+ 0,
+ 0,
+ 0,
+ cosAngle,
+ -sinAngle,
+ 0,
+ sinAngle,
+ cosAngle
+ );
+ }
+ result[0] = 1;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = cosAngle;
+ result[5] = sinAngle;
+ result[6] = 0;
+ result[7] = -sinAngle;
+ result[8] = cosAngle;
+ return result;
+};
+Matrix3.fromRotationY = function(angle, result) {
+ Check_default.typeOf.number("angle", angle);
+ const cosAngle = Math.cos(angle);
+ const sinAngle = Math.sin(angle);
+ if (!defined_default(result)) {
+ return new Matrix3(
+ cosAngle,
+ 0,
+ sinAngle,
+ 0,
+ 1,
+ 0,
+ -sinAngle,
+ 0,
+ cosAngle
+ );
+ }
+ result[0] = cosAngle;
+ result[1] = 0;
+ result[2] = -sinAngle;
+ result[3] = 0;
+ result[4] = 1;
+ result[5] = 0;
+ result[6] = sinAngle;
+ result[7] = 0;
+ result[8] = cosAngle;
+ return result;
+};
+Matrix3.fromRotationZ = function(angle, result) {
+ Check_default.typeOf.number("angle", angle);
+ const cosAngle = Math.cos(angle);
+ const sinAngle = Math.sin(angle);
+ if (!defined_default(result)) {
+ return new Matrix3(
+ cosAngle,
+ -sinAngle,
+ 0,
+ sinAngle,
+ cosAngle,
+ 0,
+ 0,
+ 0,
+ 1
+ );
+ }
+ result[0] = cosAngle;
+ result[1] = sinAngle;
+ result[2] = 0;
+ result[3] = -sinAngle;
+ result[4] = cosAngle;
+ result[5] = 0;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = 1;
+ return result;
+};
+Matrix3.toArray = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ if (!defined_default(result)) {
+ return [
+ matrix[0],
+ matrix[1],
+ matrix[2],
+ matrix[3],
+ matrix[4],
+ matrix[5],
+ matrix[6],
+ matrix[7],
+ matrix[8]
+ ];
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ return result;
+};
+Matrix3.getElementIndex = function(column, row) {
+ Check_default.typeOf.number.greaterThanOrEquals("row", row, 0);
+ Check_default.typeOf.number.lessThanOrEquals("row", row, 2);
+ Check_default.typeOf.number.greaterThanOrEquals("column", column, 0);
+ Check_default.typeOf.number.lessThanOrEquals("column", column, 2);
+ return column * 3 + row;
+};
+Matrix3.getColumn = function(matrix, index, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 2);
+ Check_default.typeOf.object("result", result);
+ const startIndex = index * 3;
+ const x = matrix[startIndex];
+ const y = matrix[startIndex + 1];
+ const z = matrix[startIndex + 2];
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+};
+Matrix3.setColumn = function(matrix, index, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 2);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result = Matrix3.clone(matrix, result);
+ const startIndex = index * 3;
+ result[startIndex] = cartesian11.x;
+ result[startIndex + 1] = cartesian11.y;
+ result[startIndex + 2] = cartesian11.z;
+ return result;
+};
+Matrix3.getRow = function(matrix, index, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 2);
+ Check_default.typeOf.object("result", result);
+ const x = matrix[index];
+ const y = matrix[index + 3];
+ const z = matrix[index + 6];
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+};
+Matrix3.setRow = function(matrix, index, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 2);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result = Matrix3.clone(matrix, result);
+ result[index] = cartesian11.x;
+ result[index + 3] = cartesian11.y;
+ result[index + 6] = cartesian11.z;
+ return result;
+};
+var scaleScratch1 = new Cartesian3_default();
+Matrix3.setScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("scale", scale);
+ Check_default.typeOf.object("result", result);
+ const existingScale = Matrix3.getScale(matrix, scaleScratch1);
+ const scaleRatioX = scale.x / existingScale.x;
+ const scaleRatioY = scale.y / existingScale.y;
+ const scaleRatioZ = scale.z / existingScale.z;
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioX;
+ result[3] = matrix[3] * scaleRatioY;
+ result[4] = matrix[4] * scaleRatioY;
+ result[5] = matrix[5] * scaleRatioY;
+ result[6] = matrix[6] * scaleRatioZ;
+ result[7] = matrix[7] * scaleRatioZ;
+ result[8] = matrix[8] * scaleRatioZ;
+ return result;
+};
+var scaleScratch2 = new Cartesian3_default();
+Matrix3.setUniformScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number("scale", scale);
+ Check_default.typeOf.object("result", result);
+ const existingScale = Matrix3.getScale(matrix, scaleScratch2);
+ const scaleRatioX = scale / existingScale.x;
+ const scaleRatioY = scale / existingScale.y;
+ const scaleRatioZ = scale / existingScale.z;
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioX;
+ result[3] = matrix[3] * scaleRatioY;
+ result[4] = matrix[4] * scaleRatioY;
+ result[5] = matrix[5] * scaleRatioY;
+ result[6] = matrix[6] * scaleRatioZ;
+ result[7] = matrix[7] * scaleRatioZ;
+ result[8] = matrix[8] * scaleRatioZ;
+ return result;
+};
+var scratchColumn = new Cartesian3_default();
+Matrix3.getScale = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result.x = Cartesian3_default.magnitude(
+ Cartesian3_default.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn)
+ );
+ result.y = Cartesian3_default.magnitude(
+ Cartesian3_default.fromElements(matrix[3], matrix[4], matrix[5], scratchColumn)
+ );
+ result.z = Cartesian3_default.magnitude(
+ Cartesian3_default.fromElements(matrix[6], matrix[7], matrix[8], scratchColumn)
+ );
+ return result;
+};
+var scaleScratch3 = new Cartesian3_default();
+Matrix3.getMaximumScale = function(matrix) {
+ Matrix3.getScale(matrix, scaleScratch3);
+ return Cartesian3_default.maximumComponent(scaleScratch3);
+};
+var scaleScratch4 = new Cartesian3_default();
+Matrix3.setRotation = function(matrix, rotation, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const scale = Matrix3.getScale(matrix, scaleScratch4);
+ result[0] = rotation[0] * scale.x;
+ result[1] = rotation[1] * scale.x;
+ result[2] = rotation[2] * scale.x;
+ result[3] = rotation[3] * scale.y;
+ result[4] = rotation[4] * scale.y;
+ result[5] = rotation[5] * scale.y;
+ result[6] = rotation[6] * scale.z;
+ result[7] = rotation[7] * scale.z;
+ result[8] = rotation[8] * scale.z;
+ return result;
+};
+var scaleScratch5 = new Cartesian3_default();
+Matrix3.getRotation = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const scale = Matrix3.getScale(matrix, scaleScratch5);
+ result[0] = matrix[0] / scale.x;
+ result[1] = matrix[1] / scale.x;
+ result[2] = matrix[2] / scale.x;
+ result[3] = matrix[3] / scale.y;
+ result[4] = matrix[4] / scale.y;
+ result[5] = matrix[5] / scale.y;
+ result[6] = matrix[6] / scale.z;
+ result[7] = matrix[7] / scale.z;
+ result[8] = matrix[8] / scale.z;
+ return result;
+};
+Matrix3.multiply = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ const column0Row0 = left[0] * right[0] + left[3] * right[1] + left[6] * right[2];
+ const column0Row1 = left[1] * right[0] + left[4] * right[1] + left[7] * right[2];
+ const column0Row2 = left[2] * right[0] + left[5] * right[1] + left[8] * right[2];
+ const column1Row0 = left[0] * right[3] + left[3] * right[4] + left[6] * right[5];
+ const column1Row1 = left[1] * right[3] + left[4] * right[4] + left[7] * right[5];
+ const column1Row2 = left[2] * right[3] + left[5] * right[4] + left[8] * right[5];
+ const column2Row0 = left[0] * right[6] + left[3] * right[7] + left[6] * right[8];
+ const column2Row1 = left[1] * right[6] + left[4] * right[7] + left[7] * right[8];
+ const column2Row2 = left[2] * right[6] + left[5] * right[7] + left[8] * right[8];
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column0Row2;
+ result[3] = column1Row0;
+ result[4] = column1Row1;
+ result[5] = column1Row2;
+ result[6] = column2Row0;
+ result[7] = column2Row1;
+ result[8] = column2Row2;
+ return result;
+};
+Matrix3.add = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result[0] = left[0] + right[0];
+ result[1] = left[1] + right[1];
+ result[2] = left[2] + right[2];
+ result[3] = left[3] + right[3];
+ result[4] = left[4] + right[4];
+ result[5] = left[5] + right[5];
+ result[6] = left[6] + right[6];
+ result[7] = left[7] + right[7];
+ result[8] = left[8] + right[8];
+ return result;
+};
+Matrix3.subtract = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result[0] = left[0] - right[0];
+ result[1] = left[1] - right[1];
+ result[2] = left[2] - right[2];
+ result[3] = left[3] - right[3];
+ result[4] = left[4] - right[4];
+ result[5] = left[5] - right[5];
+ result[6] = left[6] - right[6];
+ result[7] = left[7] - right[7];
+ result[8] = left[8] - right[8];
+ return result;
+};
+Matrix3.multiplyByVector = function(matrix, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const vX = cartesian11.x;
+ const vY = cartesian11.y;
+ const vZ = cartesian11.z;
+ const x = matrix[0] * vX + matrix[3] * vY + matrix[6] * vZ;
+ const y = matrix[1] * vX + matrix[4] * vY + matrix[7] * vZ;
+ const z = matrix[2] * vX + matrix[5] * vY + matrix[8] * vZ;
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+};
+Matrix3.multiplyByScalar = function(matrix, scalar, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result[0] = matrix[0] * scalar;
+ result[1] = matrix[1] * scalar;
+ result[2] = matrix[2] * scalar;
+ result[3] = matrix[3] * scalar;
+ result[4] = matrix[4] * scalar;
+ result[5] = matrix[5] * scalar;
+ result[6] = matrix[6] * scalar;
+ result[7] = matrix[7] * scalar;
+ result[8] = matrix[8] * scalar;
+ return result;
+};
+Matrix3.multiplyByScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("scale", scale);
+ Check_default.typeOf.object("result", result);
+ result[0] = matrix[0] * scale.x;
+ result[1] = matrix[1] * scale.x;
+ result[2] = matrix[2] * scale.x;
+ result[3] = matrix[3] * scale.y;
+ result[4] = matrix[4] * scale.y;
+ result[5] = matrix[5] * scale.y;
+ result[6] = matrix[6] * scale.z;
+ result[7] = matrix[7] * scale.z;
+ result[8] = matrix[8] * scale.z;
+ return result;
+};
+Matrix3.multiplyByUniformScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number("scale", scale);
+ Check_default.typeOf.object("result", result);
+ result[0] = matrix[0] * scale;
+ result[1] = matrix[1] * scale;
+ result[2] = matrix[2] * scale;
+ result[3] = matrix[3] * scale;
+ result[4] = matrix[4] * scale;
+ result[5] = matrix[5] * scale;
+ result[6] = matrix[6] * scale;
+ result[7] = matrix[7] * scale;
+ result[8] = matrix[8] * scale;
+ return result;
+};
+Matrix3.negate = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result[0] = -matrix[0];
+ result[1] = -matrix[1];
+ result[2] = -matrix[2];
+ result[3] = -matrix[3];
+ result[4] = -matrix[4];
+ result[5] = -matrix[5];
+ result[6] = -matrix[6];
+ result[7] = -matrix[7];
+ result[8] = -matrix[8];
+ return result;
+};
+Matrix3.transpose = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const column0Row0 = matrix[0];
+ const column0Row1 = matrix[3];
+ const column0Row2 = matrix[6];
+ const column1Row0 = matrix[1];
+ const column1Row1 = matrix[4];
+ const column1Row2 = matrix[7];
+ const column2Row0 = matrix[2];
+ const column2Row1 = matrix[5];
+ const column2Row2 = matrix[8];
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column0Row2;
+ result[3] = column1Row0;
+ result[4] = column1Row1;
+ result[5] = column1Row2;
+ result[6] = column2Row0;
+ result[7] = column2Row1;
+ result[8] = column2Row2;
+ return result;
+};
+function computeFrobeniusNorm(matrix) {
+ let norm = 0;
+ for (let i = 0; i < 9; ++i) {
+ const temp = matrix[i];
+ norm += temp * temp;
+ }
+ return Math.sqrt(norm);
+}
+var rowVal = [1, 0, 0];
+var colVal = [2, 2, 1];
+function offDiagonalFrobeniusNorm(matrix) {
+ let norm = 0;
+ for (let i = 0; i < 3; ++i) {
+ const temp = matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])];
+ norm += 2 * temp * temp;
+ }
+ return Math.sqrt(norm);
+}
+function shurDecomposition(matrix, result) {
+ const tolerance = Math_default.EPSILON15;
+ let maxDiagonal = 0;
+ let rotAxis2 = 1;
+ for (let i = 0; i < 3; ++i) {
+ const temp = Math.abs(
+ matrix[Matrix3.getElementIndex(colVal[i], rowVal[i])]
+ );
+ if (temp > maxDiagonal) {
+ rotAxis2 = i;
+ maxDiagonal = temp;
+ }
+ }
+ let c = 1;
+ let s = 0;
+ const p = rowVal[rotAxis2];
+ const q = colVal[rotAxis2];
+ if (Math.abs(matrix[Matrix3.getElementIndex(q, p)]) > tolerance) {
+ const qq = matrix[Matrix3.getElementIndex(q, q)];
+ const pp = matrix[Matrix3.getElementIndex(p, p)];
+ const qp = matrix[Matrix3.getElementIndex(q, p)];
+ const tau = (qq - pp) / 2 / qp;
+ let t;
+ if (tau < 0) {
+ t = -1 / (-tau + Math.sqrt(1 + tau * tau));
+ } else {
+ t = 1 / (tau + Math.sqrt(1 + tau * tau));
+ }
+ c = 1 / Math.sqrt(1 + t * t);
+ s = t * c;
+ }
+ result = Matrix3.clone(Matrix3.IDENTITY, result);
+ result[Matrix3.getElementIndex(p, p)] = result[Matrix3.getElementIndex(q, q)] = c;
+ result[Matrix3.getElementIndex(q, p)] = s;
+ result[Matrix3.getElementIndex(p, q)] = -s;
+ return result;
+}
+var jMatrix = new Matrix3();
+var jMatrixTranspose = new Matrix3();
+Matrix3.computeEigenDecomposition = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ const tolerance = Math_default.EPSILON20;
+ const maxSweeps = 10;
+ let count = 0;
+ let sweep = 0;
+ if (!defined_default(result)) {
+ result = {};
+ }
+ const unitaryMatrix = result.unitary = Matrix3.clone(
+ Matrix3.IDENTITY,
+ result.unitary
+ );
+ const diagMatrix = result.diagonal = Matrix3.clone(matrix, result.diagonal);
+ const epsilon = tolerance * computeFrobeniusNorm(diagMatrix);
+ while (sweep < maxSweeps && offDiagonalFrobeniusNorm(diagMatrix) > epsilon) {
+ shurDecomposition(diagMatrix, jMatrix);
+ Matrix3.transpose(jMatrix, jMatrixTranspose);
+ Matrix3.multiply(diagMatrix, jMatrix, diagMatrix);
+ Matrix3.multiply(jMatrixTranspose, diagMatrix, diagMatrix);
+ Matrix3.multiply(unitaryMatrix, jMatrix, unitaryMatrix);
+ if (++count > 2) {
+ ++sweep;
+ count = 0;
+ }
+ }
+ return result;
+};
+Matrix3.abs = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result[0] = Math.abs(matrix[0]);
+ result[1] = Math.abs(matrix[1]);
+ result[2] = Math.abs(matrix[2]);
+ result[3] = Math.abs(matrix[3]);
+ result[4] = Math.abs(matrix[4]);
+ result[5] = Math.abs(matrix[5]);
+ result[6] = Math.abs(matrix[6]);
+ result[7] = Math.abs(matrix[7]);
+ result[8] = Math.abs(matrix[8]);
+ return result;
+};
+Matrix3.determinant = function(matrix) {
+ Check_default.typeOf.object("matrix", matrix);
+ const m11 = matrix[0];
+ const m21 = matrix[3];
+ const m31 = matrix[6];
+ const m12 = matrix[1];
+ const m22 = matrix[4];
+ const m32 = matrix[7];
+ const m13 = matrix[2];
+ const m23 = matrix[5];
+ const m33 = matrix[8];
+ return m11 * (m22 * m33 - m23 * m32) + m12 * (m23 * m31 - m21 * m33) + m13 * (m21 * m32 - m22 * m31);
+};
+Matrix3.inverse = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const m11 = matrix[0];
+ const m21 = matrix[1];
+ const m31 = matrix[2];
+ const m12 = matrix[3];
+ const m22 = matrix[4];
+ const m32 = matrix[5];
+ const m13 = matrix[6];
+ const m23 = matrix[7];
+ const m33 = matrix[8];
+ const determinant = Matrix3.determinant(matrix);
+ if (Math.abs(determinant) <= Math_default.EPSILON15) {
+ throw new DeveloperError_default("matrix is not invertible");
+ }
+ result[0] = m22 * m33 - m23 * m32;
+ result[1] = m23 * m31 - m21 * m33;
+ result[2] = m21 * m32 - m22 * m31;
+ result[3] = m13 * m32 - m12 * m33;
+ result[4] = m11 * m33 - m13 * m31;
+ result[5] = m12 * m31 - m11 * m32;
+ result[6] = m12 * m23 - m13 * m22;
+ result[7] = m13 * m21 - m11 * m23;
+ result[8] = m11 * m22 - m12 * m21;
+ const scale = 1 / determinant;
+ return Matrix3.multiplyByScalar(result, scale, result);
+};
+var scratchTransposeMatrix = new Matrix3();
+Matrix3.inverseTranspose = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ return Matrix3.inverse(
+ Matrix3.transpose(matrix, scratchTransposeMatrix),
+ result
+ );
+};
+Matrix3.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left[0] === right[0] && left[1] === right[1] && left[2] === right[2] && left[3] === right[3] && left[4] === right[4] && left[5] === right[5] && left[6] === right[6] && left[7] === right[7] && left[8] === right[8];
+};
+Matrix3.equalsEpsilon = function(left, right, epsilon) {
+ epsilon = defaultValue_default(epsilon, 0);
+ return left === right || defined_default(left) && defined_default(right) && Math.abs(left[0] - right[0]) <= epsilon && Math.abs(left[1] - right[1]) <= epsilon && Math.abs(left[2] - right[2]) <= epsilon && Math.abs(left[3] - right[3]) <= epsilon && Math.abs(left[4] - right[4]) <= epsilon && Math.abs(left[5] - right[5]) <= epsilon && Math.abs(left[6] - right[6]) <= epsilon && Math.abs(left[7] - right[7]) <= epsilon && Math.abs(left[8] - right[8]) <= epsilon;
+};
+Matrix3.IDENTITY = Object.freeze(
+ new Matrix3(1, 0, 0, 0, 1, 0, 0, 0, 1)
+);
+Matrix3.ZERO = Object.freeze(
+ new Matrix3(0, 0, 0, 0, 0, 0, 0, 0, 0)
+);
+Matrix3.COLUMN0ROW0 = 0;
+Matrix3.COLUMN0ROW1 = 1;
+Matrix3.COLUMN0ROW2 = 2;
+Matrix3.COLUMN1ROW0 = 3;
+Matrix3.COLUMN1ROW1 = 4;
+Matrix3.COLUMN1ROW2 = 5;
+Matrix3.COLUMN2ROW0 = 6;
+Matrix3.COLUMN2ROW1 = 7;
+Matrix3.COLUMN2ROW2 = 8;
+Object.defineProperties(Matrix3.prototype, {
+ length: {
+ get: function() {
+ return Matrix3.packedLength;
+ }
+ }
+});
+Matrix3.prototype.clone = function(result) {
+ return Matrix3.clone(this, result);
+};
+Matrix3.prototype.equals = function(right) {
+ return Matrix3.equals(this, right);
+};
+Matrix3.equalsArray = function(matrix, array, offset2) {
+ return matrix[0] === array[offset2] && matrix[1] === array[offset2 + 1] && matrix[2] === array[offset2 + 2] && matrix[3] === array[offset2 + 3] && matrix[4] === array[offset2 + 4] && matrix[5] === array[offset2 + 5] && matrix[6] === array[offset2 + 6] && matrix[7] === array[offset2 + 7] && matrix[8] === array[offset2 + 8];
+};
+Matrix3.prototype.equalsEpsilon = function(right, epsilon) {
+ return Matrix3.equalsEpsilon(this, right, epsilon);
+};
+Matrix3.prototype.toString = function() {
+ return `(${this[0]}, ${this[3]}, ${this[6]})
+(${this[1]}, ${this[4]}, ${this[7]})
+(${this[2]}, ${this[5]}, ${this[8]})`;
+};
+var Matrix3_default = Matrix3;
+
+// Source/Core/RuntimeError.js
+function RuntimeError(message) {
+ this.name = "RuntimeError";
+ this.message = message;
+ let stack;
+ try {
+ throw new Error();
+ } catch (e) {
+ stack = e.stack;
+ }
+ this.stack = stack;
+}
+if (defined_default(Object.create)) {
+ RuntimeError.prototype = Object.create(Error.prototype);
+ RuntimeError.prototype.constructor = RuntimeError;
+}
+RuntimeError.prototype.toString = function() {
+ let str = `${this.name}: ${this.message}`;
+ if (defined_default(this.stack)) {
+ str += `
+${this.stack.toString()}`;
+ }
+ return str;
+};
+var RuntimeError_default = RuntimeError;
+
+// Source/Core/Matrix4.js
+function Matrix4(column0Row0, column1Row0, column2Row0, column3Row0, column0Row1, column1Row1, column2Row1, column3Row1, column0Row2, column1Row2, column2Row2, column3Row2, column0Row3, column1Row3, column2Row3, column3Row3) {
+ this[0] = defaultValue_default(column0Row0, 0);
+ this[1] = defaultValue_default(column0Row1, 0);
+ this[2] = defaultValue_default(column0Row2, 0);
+ this[3] = defaultValue_default(column0Row3, 0);
+ this[4] = defaultValue_default(column1Row0, 0);
+ this[5] = defaultValue_default(column1Row1, 0);
+ this[6] = defaultValue_default(column1Row2, 0);
+ this[7] = defaultValue_default(column1Row3, 0);
+ this[8] = defaultValue_default(column2Row0, 0);
+ this[9] = defaultValue_default(column2Row1, 0);
+ this[10] = defaultValue_default(column2Row2, 0);
+ this[11] = defaultValue_default(column2Row3, 0);
+ this[12] = defaultValue_default(column3Row0, 0);
+ this[13] = defaultValue_default(column3Row1, 0);
+ this[14] = defaultValue_default(column3Row2, 0);
+ this[15] = defaultValue_default(column3Row3, 0);
+}
+Matrix4.packedLength = 16;
+Matrix4.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value[0];
+ array[startingIndex++] = value[1];
+ array[startingIndex++] = value[2];
+ array[startingIndex++] = value[3];
+ array[startingIndex++] = value[4];
+ array[startingIndex++] = value[5];
+ array[startingIndex++] = value[6];
+ array[startingIndex++] = value[7];
+ array[startingIndex++] = value[8];
+ array[startingIndex++] = value[9];
+ array[startingIndex++] = value[10];
+ array[startingIndex++] = value[11];
+ array[startingIndex++] = value[12];
+ array[startingIndex++] = value[13];
+ array[startingIndex++] = value[14];
+ array[startingIndex] = value[15];
+ return array;
+};
+Matrix4.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new Matrix4();
+ }
+ result[0] = array[startingIndex++];
+ result[1] = array[startingIndex++];
+ result[2] = array[startingIndex++];
+ result[3] = array[startingIndex++];
+ result[4] = array[startingIndex++];
+ result[5] = array[startingIndex++];
+ result[6] = array[startingIndex++];
+ result[7] = array[startingIndex++];
+ result[8] = array[startingIndex++];
+ result[9] = array[startingIndex++];
+ result[10] = array[startingIndex++];
+ result[11] = array[startingIndex++];
+ result[12] = array[startingIndex++];
+ result[13] = array[startingIndex++];
+ result[14] = array[startingIndex++];
+ result[15] = array[startingIndex];
+ return result;
+};
+Matrix4.packArray = function(array, result) {
+ Check_default.defined("array", array);
+ const length3 = array.length;
+ const resultLength = length3 * 16;
+ if (!defined_default(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ throw new DeveloperError_default(
+ "If result is a typed array, it must have exactly array.length * 16 elements"
+ );
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+ for (let i = 0; i < length3; ++i) {
+ Matrix4.pack(array[i], result, i * 16);
+ }
+ return result;
+};
+Matrix4.unpackArray = function(array, result) {
+ Check_default.defined("array", array);
+ Check_default.typeOf.number.greaterThanOrEquals("array.length", array.length, 16);
+ if (array.length % 16 !== 0) {
+ throw new DeveloperError_default("array length must be a multiple of 16.");
+ }
+ const length3 = array.length;
+ if (!defined_default(result)) {
+ result = new Array(length3 / 16);
+ } else {
+ result.length = length3 / 16;
+ }
+ for (let i = 0; i < length3; i += 16) {
+ const index = i / 16;
+ result[index] = Matrix4.unpack(array, i, result[index]);
+ }
+ return result;
+};
+Matrix4.clone = function(matrix, result) {
+ if (!defined_default(matrix)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Matrix4(
+ matrix[0],
+ matrix[4],
+ matrix[8],
+ matrix[12],
+ matrix[1],
+ matrix[5],
+ matrix[9],
+ matrix[13],
+ matrix[2],
+ matrix[6],
+ matrix[10],
+ matrix[14],
+ matrix[3],
+ matrix[7],
+ matrix[11],
+ matrix[15]
+ );
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ result[9] = matrix[9];
+ result[10] = matrix[10];
+ result[11] = matrix[11];
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+};
+Matrix4.fromArray = Matrix4.unpack;
+Matrix4.fromColumnMajorArray = function(values, result) {
+ Check_default.defined("values", values);
+ return Matrix4.clone(values, result);
+};
+Matrix4.fromRowMajorArray = function(values, result) {
+ Check_default.defined("values", values);
+ if (!defined_default(result)) {
+ return new Matrix4(
+ values[0],
+ values[1],
+ values[2],
+ values[3],
+ values[4],
+ values[5],
+ values[6],
+ values[7],
+ values[8],
+ values[9],
+ values[10],
+ values[11],
+ values[12],
+ values[13],
+ values[14],
+ values[15]
+ );
+ }
+ result[0] = values[0];
+ result[1] = values[4];
+ result[2] = values[8];
+ result[3] = values[12];
+ result[4] = values[1];
+ result[5] = values[5];
+ result[6] = values[9];
+ result[7] = values[13];
+ result[8] = values[2];
+ result[9] = values[6];
+ result[10] = values[10];
+ result[11] = values[14];
+ result[12] = values[3];
+ result[13] = values[7];
+ result[14] = values[11];
+ result[15] = values[15];
+ return result;
+};
+Matrix4.fromRotationTranslation = function(rotation, translation3, result) {
+ Check_default.typeOf.object("rotation", rotation);
+ translation3 = defaultValue_default(translation3, Cartesian3_default.ZERO);
+ if (!defined_default(result)) {
+ return new Matrix4(
+ rotation[0],
+ rotation[3],
+ rotation[6],
+ translation3.x,
+ rotation[1],
+ rotation[4],
+ rotation[7],
+ translation3.y,
+ rotation[2],
+ rotation[5],
+ rotation[8],
+ translation3.z,
+ 0,
+ 0,
+ 0,
+ 1
+ );
+ }
+ result[0] = rotation[0];
+ result[1] = rotation[1];
+ result[2] = rotation[2];
+ result[3] = 0;
+ result[4] = rotation[3];
+ result[5] = rotation[4];
+ result[6] = rotation[5];
+ result[7] = 0;
+ result[8] = rotation[6];
+ result[9] = rotation[7];
+ result[10] = rotation[8];
+ result[11] = 0;
+ result[12] = translation3.x;
+ result[13] = translation3.y;
+ result[14] = translation3.z;
+ result[15] = 1;
+ return result;
+};
+Matrix4.fromTranslationQuaternionRotationScale = function(translation3, rotation, scale, result) {
+ Check_default.typeOf.object("translation", translation3);
+ Check_default.typeOf.object("rotation", rotation);
+ Check_default.typeOf.object("scale", scale);
+ if (!defined_default(result)) {
+ result = new Matrix4();
+ }
+ const scaleX = scale.x;
+ const scaleY = scale.y;
+ const scaleZ = scale.z;
+ const x2 = rotation.x * rotation.x;
+ const xy = rotation.x * rotation.y;
+ const xz = rotation.x * rotation.z;
+ const xw = rotation.x * rotation.w;
+ const y2 = rotation.y * rotation.y;
+ const yz = rotation.y * rotation.z;
+ const yw = rotation.y * rotation.w;
+ const z2 = rotation.z * rotation.z;
+ const zw = rotation.z * rotation.w;
+ const w2 = rotation.w * rotation.w;
+ const m00 = x2 - y2 - z2 + w2;
+ const m01 = 2 * (xy - zw);
+ const m02 = 2 * (xz + yw);
+ const m10 = 2 * (xy + zw);
+ const m11 = -x2 + y2 - z2 + w2;
+ const m12 = 2 * (yz - xw);
+ const m20 = 2 * (xz - yw);
+ const m21 = 2 * (yz + xw);
+ const m22 = -x2 - y2 + z2 + w2;
+ result[0] = m00 * scaleX;
+ result[1] = m10 * scaleX;
+ result[2] = m20 * scaleX;
+ result[3] = 0;
+ result[4] = m01 * scaleY;
+ result[5] = m11 * scaleY;
+ result[6] = m21 * scaleY;
+ result[7] = 0;
+ result[8] = m02 * scaleZ;
+ result[9] = m12 * scaleZ;
+ result[10] = m22 * scaleZ;
+ result[11] = 0;
+ result[12] = translation3.x;
+ result[13] = translation3.y;
+ result[14] = translation3.z;
+ result[15] = 1;
+ return result;
+};
+Matrix4.fromTranslationRotationScale = function(translationRotationScale, result) {
+ Check_default.typeOf.object("translationRotationScale", translationRotationScale);
+ return Matrix4.fromTranslationQuaternionRotationScale(
+ translationRotationScale.translation,
+ translationRotationScale.rotation,
+ translationRotationScale.scale,
+ result
+ );
+};
+Matrix4.fromTranslation = function(translation3, result) {
+ Check_default.typeOf.object("translation", translation3);
+ return Matrix4.fromRotationTranslation(Matrix3_default.IDENTITY, translation3, result);
+};
+Matrix4.fromScale = function(scale, result) {
+ Check_default.typeOf.object("scale", scale);
+ if (!defined_default(result)) {
+ return new Matrix4(
+ scale.x,
+ 0,
+ 0,
+ 0,
+ 0,
+ scale.y,
+ 0,
+ 0,
+ 0,
+ 0,
+ scale.z,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1
+ );
+ }
+ result[0] = scale.x;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = 0;
+ result[5] = scale.y;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = 0;
+ result[9] = 0;
+ result[10] = scale.z;
+ result[11] = 0;
+ result[12] = 0;
+ result[13] = 0;
+ result[14] = 0;
+ result[15] = 1;
+ return result;
+};
+Matrix4.fromUniformScale = function(scale, result) {
+ Check_default.typeOf.number("scale", scale);
+ if (!defined_default(result)) {
+ return new Matrix4(
+ scale,
+ 0,
+ 0,
+ 0,
+ 0,
+ scale,
+ 0,
+ 0,
+ 0,
+ 0,
+ scale,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1
+ );
+ }
+ result[0] = scale;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = 0;
+ result[5] = scale;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = 0;
+ result[9] = 0;
+ result[10] = scale;
+ result[11] = 0;
+ result[12] = 0;
+ result[13] = 0;
+ result[14] = 0;
+ result[15] = 1;
+ return result;
+};
+Matrix4.fromRotation = function(rotation, result) {
+ Check_default.typeOf.object("rotation", rotation);
+ if (!defined_default(result)) {
+ result = new Matrix4();
+ }
+ result[0] = rotation[0];
+ result[1] = rotation[1];
+ result[2] = rotation[2];
+ result[3] = 0;
+ result[4] = rotation[3];
+ result[5] = rotation[4];
+ result[6] = rotation[5];
+ result[7] = 0;
+ result[8] = rotation[6];
+ result[9] = rotation[7];
+ result[10] = rotation[8];
+ result[11] = 0;
+ result[12] = 0;
+ result[13] = 0;
+ result[14] = 0;
+ result[15] = 1;
+ return result;
+};
+var fromCameraF = new Cartesian3_default();
+var fromCameraR = new Cartesian3_default();
+var fromCameraU = new Cartesian3_default();
+Matrix4.fromCamera = function(camera, result) {
+ Check_default.typeOf.object("camera", camera);
+ const position = camera.position;
+ const direction2 = camera.direction;
+ const up = camera.up;
+ Check_default.typeOf.object("camera.position", position);
+ Check_default.typeOf.object("camera.direction", direction2);
+ Check_default.typeOf.object("camera.up", up);
+ Cartesian3_default.normalize(direction2, fromCameraF);
+ Cartesian3_default.normalize(
+ Cartesian3_default.cross(fromCameraF, up, fromCameraR),
+ fromCameraR
+ );
+ Cartesian3_default.normalize(
+ Cartesian3_default.cross(fromCameraR, fromCameraF, fromCameraU),
+ fromCameraU
+ );
+ const sX = fromCameraR.x;
+ const sY = fromCameraR.y;
+ const sZ = fromCameraR.z;
+ const fX = fromCameraF.x;
+ const fY = fromCameraF.y;
+ const fZ = fromCameraF.z;
+ const uX = fromCameraU.x;
+ const uY = fromCameraU.y;
+ const uZ = fromCameraU.z;
+ const positionX = position.x;
+ const positionY = position.y;
+ const positionZ = position.z;
+ const t0 = sX * -positionX + sY * -positionY + sZ * -positionZ;
+ const t1 = uX * -positionX + uY * -positionY + uZ * -positionZ;
+ const t2 = fX * positionX + fY * positionY + fZ * positionZ;
+ if (!defined_default(result)) {
+ return new Matrix4(
+ sX,
+ sY,
+ sZ,
+ t0,
+ uX,
+ uY,
+ uZ,
+ t1,
+ -fX,
+ -fY,
+ -fZ,
+ t2,
+ 0,
+ 0,
+ 0,
+ 1
+ );
+ }
+ result[0] = sX;
+ result[1] = uX;
+ result[2] = -fX;
+ result[3] = 0;
+ result[4] = sY;
+ result[5] = uY;
+ result[6] = -fY;
+ result[7] = 0;
+ result[8] = sZ;
+ result[9] = uZ;
+ result[10] = -fZ;
+ result[11] = 0;
+ result[12] = t0;
+ result[13] = t1;
+ result[14] = t2;
+ result[15] = 1;
+ return result;
+};
+Matrix4.computePerspectiveFieldOfView = function(fovY, aspectRatio, near, far, result) {
+ Check_default.typeOf.number.greaterThan("fovY", fovY, 0);
+ Check_default.typeOf.number.lessThan("fovY", fovY, Math.PI);
+ Check_default.typeOf.number.greaterThan("near", near, 0);
+ Check_default.typeOf.number.greaterThan("far", far, 0);
+ Check_default.typeOf.object("result", result);
+ const bottom = Math.tan(fovY * 0.5);
+ const column1Row1 = 1 / bottom;
+ const column0Row0 = column1Row1 / aspectRatio;
+ const column2Row2 = (far + near) / (near - far);
+ const column3Row2 = 2 * far * near / (near - far);
+ result[0] = column0Row0;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = 0;
+ result[5] = column1Row1;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = 0;
+ result[9] = 0;
+ result[10] = column2Row2;
+ result[11] = -1;
+ result[12] = 0;
+ result[13] = 0;
+ result[14] = column3Row2;
+ result[15] = 0;
+ return result;
+};
+Matrix4.computeOrthographicOffCenter = function(left, right, bottom, top, near, far, result) {
+ Check_default.typeOf.number("left", left);
+ Check_default.typeOf.number("right", right);
+ Check_default.typeOf.number("bottom", bottom);
+ Check_default.typeOf.number("top", top);
+ Check_default.typeOf.number("near", near);
+ Check_default.typeOf.number("far", far);
+ Check_default.typeOf.object("result", result);
+ let a3 = 1 / (right - left);
+ let b = 1 / (top - bottom);
+ let c = 1 / (far - near);
+ const tx = -(right + left) * a3;
+ const ty = -(top + bottom) * b;
+ const tz = -(far + near) * c;
+ a3 *= 2;
+ b *= 2;
+ c *= -2;
+ result[0] = a3;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = 0;
+ result[5] = b;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = 0;
+ result[9] = 0;
+ result[10] = c;
+ result[11] = 0;
+ result[12] = tx;
+ result[13] = ty;
+ result[14] = tz;
+ result[15] = 1;
+ return result;
+};
+Matrix4.computePerspectiveOffCenter = function(left, right, bottom, top, near, far, result) {
+ Check_default.typeOf.number("left", left);
+ Check_default.typeOf.number("right", right);
+ Check_default.typeOf.number("bottom", bottom);
+ Check_default.typeOf.number("top", top);
+ Check_default.typeOf.number("near", near);
+ Check_default.typeOf.number("far", far);
+ Check_default.typeOf.object("result", result);
+ const column0Row0 = 2 * near / (right - left);
+ const column1Row1 = 2 * near / (top - bottom);
+ const column2Row0 = (right + left) / (right - left);
+ const column2Row1 = (top + bottom) / (top - bottom);
+ const column2Row2 = -(far + near) / (far - near);
+ const column2Row3 = -1;
+ const column3Row2 = -2 * far * near / (far - near);
+ result[0] = column0Row0;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = 0;
+ result[5] = column1Row1;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = column2Row0;
+ result[9] = column2Row1;
+ result[10] = column2Row2;
+ result[11] = column2Row3;
+ result[12] = 0;
+ result[13] = 0;
+ result[14] = column3Row2;
+ result[15] = 0;
+ return result;
+};
+Matrix4.computeInfinitePerspectiveOffCenter = function(left, right, bottom, top, near, result) {
+ Check_default.typeOf.number("left", left);
+ Check_default.typeOf.number("right", right);
+ Check_default.typeOf.number("bottom", bottom);
+ Check_default.typeOf.number("top", top);
+ Check_default.typeOf.number("near", near);
+ Check_default.typeOf.object("result", result);
+ const column0Row0 = 2 * near / (right - left);
+ const column1Row1 = 2 * near / (top - bottom);
+ const column2Row0 = (right + left) / (right - left);
+ const column2Row1 = (top + bottom) / (top - bottom);
+ const column2Row2 = -1;
+ const column2Row3 = -1;
+ const column3Row2 = -2 * near;
+ result[0] = column0Row0;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = 0;
+ result[5] = column1Row1;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = column2Row0;
+ result[9] = column2Row1;
+ result[10] = column2Row2;
+ result[11] = column2Row3;
+ result[12] = 0;
+ result[13] = 0;
+ result[14] = column3Row2;
+ result[15] = 0;
+ return result;
+};
+Matrix4.computeViewportTransformation = function(viewport, nearDepthRange, farDepthRange, result) {
+ if (!defined_default(result)) {
+ result = new Matrix4();
+ }
+ viewport = defaultValue_default(viewport, defaultValue_default.EMPTY_OBJECT);
+ const x = defaultValue_default(viewport.x, 0);
+ const y = defaultValue_default(viewport.y, 0);
+ const width = defaultValue_default(viewport.width, 0);
+ const height = defaultValue_default(viewport.height, 0);
+ nearDepthRange = defaultValue_default(nearDepthRange, 0);
+ farDepthRange = defaultValue_default(farDepthRange, 1);
+ const halfWidth = width * 0.5;
+ const halfHeight = height * 0.5;
+ const halfDepth = (farDepthRange - nearDepthRange) * 0.5;
+ const column0Row0 = halfWidth;
+ const column1Row1 = halfHeight;
+ const column2Row2 = halfDepth;
+ const column3Row0 = x + halfWidth;
+ const column3Row1 = y + halfHeight;
+ const column3Row2 = nearDepthRange + halfDepth;
+ const column3Row3 = 1;
+ result[0] = column0Row0;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = 0;
+ result[5] = column1Row1;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = 0;
+ result[9] = 0;
+ result[10] = column2Row2;
+ result[11] = 0;
+ result[12] = column3Row0;
+ result[13] = column3Row1;
+ result[14] = column3Row2;
+ result[15] = column3Row3;
+ return result;
+};
+Matrix4.computeView = function(position, direction2, up, right, result) {
+ Check_default.typeOf.object("position", position);
+ Check_default.typeOf.object("direction", direction2);
+ Check_default.typeOf.object("up", up);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result[0] = right.x;
+ result[1] = up.x;
+ result[2] = -direction2.x;
+ result[3] = 0;
+ result[4] = right.y;
+ result[5] = up.y;
+ result[6] = -direction2.y;
+ result[7] = 0;
+ result[8] = right.z;
+ result[9] = up.z;
+ result[10] = -direction2.z;
+ result[11] = 0;
+ result[12] = -Cartesian3_default.dot(right, position);
+ result[13] = -Cartesian3_default.dot(up, position);
+ result[14] = Cartesian3_default.dot(direction2, position);
+ result[15] = 1;
+ return result;
+};
+Matrix4.toArray = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ if (!defined_default(result)) {
+ return [
+ matrix[0],
+ matrix[1],
+ matrix[2],
+ matrix[3],
+ matrix[4],
+ matrix[5],
+ matrix[6],
+ matrix[7],
+ matrix[8],
+ matrix[9],
+ matrix[10],
+ matrix[11],
+ matrix[12],
+ matrix[13],
+ matrix[14],
+ matrix[15]
+ ];
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ result[9] = matrix[9];
+ result[10] = matrix[10];
+ result[11] = matrix[11];
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+};
+Matrix4.getElementIndex = function(column, row) {
+ Check_default.typeOf.number.greaterThanOrEquals("row", row, 0);
+ Check_default.typeOf.number.lessThanOrEquals("row", row, 3);
+ Check_default.typeOf.number.greaterThanOrEquals("column", column, 0);
+ Check_default.typeOf.number.lessThanOrEquals("column", column, 3);
+ return column * 4 + row;
+};
+Matrix4.getColumn = function(matrix, index, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 3);
+ Check_default.typeOf.object("result", result);
+ const startIndex = index * 4;
+ const x = matrix[startIndex];
+ const y = matrix[startIndex + 1];
+ const z = matrix[startIndex + 2];
+ const w = matrix[startIndex + 3];
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+};
+Matrix4.setColumn = function(matrix, index, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 3);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result = Matrix4.clone(matrix, result);
+ const startIndex = index * 4;
+ result[startIndex] = cartesian11.x;
+ result[startIndex + 1] = cartesian11.y;
+ result[startIndex + 2] = cartesian11.z;
+ result[startIndex + 3] = cartesian11.w;
+ return result;
+};
+Matrix4.getRow = function(matrix, index, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 3);
+ Check_default.typeOf.object("result", result);
+ const x = matrix[index];
+ const y = matrix[index + 4];
+ const z = matrix[index + 8];
+ const w = matrix[index + 12];
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+};
+Matrix4.setRow = function(matrix, index, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 3);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result = Matrix4.clone(matrix, result);
+ result[index] = cartesian11.x;
+ result[index + 4] = cartesian11.y;
+ result[index + 8] = cartesian11.z;
+ result[index + 12] = cartesian11.w;
+ return result;
+};
+Matrix4.setTranslation = function(matrix, translation3, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("translation", translation3);
+ Check_default.typeOf.object("result", result);
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ result[9] = matrix[9];
+ result[10] = matrix[10];
+ result[11] = matrix[11];
+ result[12] = translation3.x;
+ result[13] = translation3.y;
+ result[14] = translation3.z;
+ result[15] = matrix[15];
+ return result;
+};
+var scaleScratch12 = new Cartesian3_default();
+Matrix4.setScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("scale", scale);
+ Check_default.typeOf.object("result", result);
+ const existingScale = Matrix4.getScale(matrix, scaleScratch12);
+ const scaleRatioX = scale.x / existingScale.x;
+ const scaleRatioY = scale.y / existingScale.y;
+ const scaleRatioZ = scale.z / existingScale.z;
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioX;
+ result[3] = matrix[3];
+ result[4] = matrix[4] * scaleRatioY;
+ result[5] = matrix[5] * scaleRatioY;
+ result[6] = matrix[6] * scaleRatioY;
+ result[7] = matrix[7];
+ result[8] = matrix[8] * scaleRatioZ;
+ result[9] = matrix[9] * scaleRatioZ;
+ result[10] = matrix[10] * scaleRatioZ;
+ result[11] = matrix[11];
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+};
+var scaleScratch22 = new Cartesian3_default();
+Matrix4.setUniformScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number("scale", scale);
+ Check_default.typeOf.object("result", result);
+ const existingScale = Matrix4.getScale(matrix, scaleScratch22);
+ const scaleRatioX = scale / existingScale.x;
+ const scaleRatioY = scale / existingScale.y;
+ const scaleRatioZ = scale / existingScale.z;
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioX;
+ result[3] = matrix[3];
+ result[4] = matrix[4] * scaleRatioY;
+ result[5] = matrix[5] * scaleRatioY;
+ result[6] = matrix[6] * scaleRatioY;
+ result[7] = matrix[7];
+ result[8] = matrix[8] * scaleRatioZ;
+ result[9] = matrix[9] * scaleRatioZ;
+ result[10] = matrix[10] * scaleRatioZ;
+ result[11] = matrix[11];
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+};
+var scratchColumn2 = new Cartesian3_default();
+Matrix4.getScale = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result.x = Cartesian3_default.magnitude(
+ Cartesian3_default.fromElements(matrix[0], matrix[1], matrix[2], scratchColumn2)
+ );
+ result.y = Cartesian3_default.magnitude(
+ Cartesian3_default.fromElements(matrix[4], matrix[5], matrix[6], scratchColumn2)
+ );
+ result.z = Cartesian3_default.magnitude(
+ Cartesian3_default.fromElements(matrix[8], matrix[9], matrix[10], scratchColumn2)
+ );
+ return result;
+};
+var scaleScratch32 = new Cartesian3_default();
+Matrix4.getMaximumScale = function(matrix) {
+ Matrix4.getScale(matrix, scaleScratch32);
+ return Cartesian3_default.maximumComponent(scaleScratch32);
+};
+var scaleScratch42 = new Cartesian3_default();
+Matrix4.setRotation = function(matrix, rotation, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const scale = Matrix4.getScale(matrix, scaleScratch42);
+ result[0] = rotation[0] * scale.x;
+ result[1] = rotation[1] * scale.x;
+ result[2] = rotation[2] * scale.x;
+ result[3] = matrix[3];
+ result[4] = rotation[3] * scale.y;
+ result[5] = rotation[4] * scale.y;
+ result[6] = rotation[5] * scale.y;
+ result[7] = matrix[7];
+ result[8] = rotation[6] * scale.z;
+ result[9] = rotation[7] * scale.z;
+ result[10] = rotation[8] * scale.z;
+ result[11] = matrix[11];
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+};
+var scaleScratch52 = new Cartesian3_default();
+Matrix4.getRotation = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const scale = Matrix4.getScale(matrix, scaleScratch52);
+ result[0] = matrix[0] / scale.x;
+ result[1] = matrix[1] / scale.x;
+ result[2] = matrix[2] / scale.x;
+ result[3] = matrix[4] / scale.y;
+ result[4] = matrix[5] / scale.y;
+ result[5] = matrix[6] / scale.y;
+ result[6] = matrix[8] / scale.z;
+ result[7] = matrix[9] / scale.z;
+ result[8] = matrix[10] / scale.z;
+ return result;
+};
+Matrix4.multiply = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ const left0 = left[0];
+ const left1 = left[1];
+ const left2 = left[2];
+ const left3 = left[3];
+ const left4 = left[4];
+ const left5 = left[5];
+ const left6 = left[6];
+ const left7 = left[7];
+ const left8 = left[8];
+ const left9 = left[9];
+ const left10 = left[10];
+ const left11 = left[11];
+ const left12 = left[12];
+ const left13 = left[13];
+ const left14 = left[14];
+ const left15 = left[15];
+ const right0 = right[0];
+ const right1 = right[1];
+ const right2 = right[2];
+ const right3 = right[3];
+ const right4 = right[4];
+ const right5 = right[5];
+ const right6 = right[6];
+ const right7 = right[7];
+ const right8 = right[8];
+ const right9 = right[9];
+ const right10 = right[10];
+ const right11 = right[11];
+ const right12 = right[12];
+ const right13 = right[13];
+ const right14 = right[14];
+ const right15 = right[15];
+ const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2 + left12 * right3;
+ const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2 + left13 * right3;
+ const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2 + left14 * right3;
+ const column0Row3 = left3 * right0 + left7 * right1 + left11 * right2 + left15 * right3;
+ const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6 + left12 * right7;
+ const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6 + left13 * right7;
+ const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6 + left14 * right7;
+ const column1Row3 = left3 * right4 + left7 * right5 + left11 * right6 + left15 * right7;
+ const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10 + left12 * right11;
+ const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10 + left13 * right11;
+ const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10 + left14 * right11;
+ const column2Row3 = left3 * right8 + left7 * right9 + left11 * right10 + left15 * right11;
+ const column3Row0 = left0 * right12 + left4 * right13 + left8 * right14 + left12 * right15;
+ const column3Row1 = left1 * right12 + left5 * right13 + left9 * right14 + left13 * right15;
+ const column3Row2 = left2 * right12 + left6 * right13 + left10 * right14 + left14 * right15;
+ const column3Row3 = left3 * right12 + left7 * right13 + left11 * right14 + left15 * right15;
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column0Row2;
+ result[3] = column0Row3;
+ result[4] = column1Row0;
+ result[5] = column1Row1;
+ result[6] = column1Row2;
+ result[7] = column1Row3;
+ result[8] = column2Row0;
+ result[9] = column2Row1;
+ result[10] = column2Row2;
+ result[11] = column2Row3;
+ result[12] = column3Row0;
+ result[13] = column3Row1;
+ result[14] = column3Row2;
+ result[15] = column3Row3;
+ return result;
+};
+Matrix4.add = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result[0] = left[0] + right[0];
+ result[1] = left[1] + right[1];
+ result[2] = left[2] + right[2];
+ result[3] = left[3] + right[3];
+ result[4] = left[4] + right[4];
+ result[5] = left[5] + right[5];
+ result[6] = left[6] + right[6];
+ result[7] = left[7] + right[7];
+ result[8] = left[8] + right[8];
+ result[9] = left[9] + right[9];
+ result[10] = left[10] + right[10];
+ result[11] = left[11] + right[11];
+ result[12] = left[12] + right[12];
+ result[13] = left[13] + right[13];
+ result[14] = left[14] + right[14];
+ result[15] = left[15] + right[15];
+ return result;
+};
+Matrix4.subtract = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result[0] = left[0] - right[0];
+ result[1] = left[1] - right[1];
+ result[2] = left[2] - right[2];
+ result[3] = left[3] - right[3];
+ result[4] = left[4] - right[4];
+ result[5] = left[5] - right[5];
+ result[6] = left[6] - right[6];
+ result[7] = left[7] - right[7];
+ result[8] = left[8] - right[8];
+ result[9] = left[9] - right[9];
+ result[10] = left[10] - right[10];
+ result[11] = left[11] - right[11];
+ result[12] = left[12] - right[12];
+ result[13] = left[13] - right[13];
+ result[14] = left[14] - right[14];
+ result[15] = left[15] - right[15];
+ return result;
+};
+Matrix4.multiplyTransformation = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ const left0 = left[0];
+ const left1 = left[1];
+ const left2 = left[2];
+ const left4 = left[4];
+ const left5 = left[5];
+ const left6 = left[6];
+ const left8 = left[8];
+ const left9 = left[9];
+ const left10 = left[10];
+ const left12 = left[12];
+ const left13 = left[13];
+ const left14 = left[14];
+ const right0 = right[0];
+ const right1 = right[1];
+ const right2 = right[2];
+ const right4 = right[4];
+ const right5 = right[5];
+ const right6 = right[6];
+ const right8 = right[8];
+ const right9 = right[9];
+ const right10 = right[10];
+ const right12 = right[12];
+ const right13 = right[13];
+ const right14 = right[14];
+ const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;
+ const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;
+ const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;
+ const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;
+ const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;
+ const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;
+ const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;
+ const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;
+ const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;
+ const column3Row0 = left0 * right12 + left4 * right13 + left8 * right14 + left12;
+ const column3Row1 = left1 * right12 + left5 * right13 + left9 * right14 + left13;
+ const column3Row2 = left2 * right12 + left6 * right13 + left10 * right14 + left14;
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column0Row2;
+ result[3] = 0;
+ result[4] = column1Row0;
+ result[5] = column1Row1;
+ result[6] = column1Row2;
+ result[7] = 0;
+ result[8] = column2Row0;
+ result[9] = column2Row1;
+ result[10] = column2Row2;
+ result[11] = 0;
+ result[12] = column3Row0;
+ result[13] = column3Row1;
+ result[14] = column3Row2;
+ result[15] = 1;
+ return result;
+};
+Matrix4.multiplyByMatrix3 = function(matrix, rotation, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("rotation", rotation);
+ Check_default.typeOf.object("result", result);
+ const left0 = matrix[0];
+ const left1 = matrix[1];
+ const left2 = matrix[2];
+ const left4 = matrix[4];
+ const left5 = matrix[5];
+ const left6 = matrix[6];
+ const left8 = matrix[8];
+ const left9 = matrix[9];
+ const left10 = matrix[10];
+ const right0 = rotation[0];
+ const right1 = rotation[1];
+ const right2 = rotation[2];
+ const right4 = rotation[3];
+ const right5 = rotation[4];
+ const right6 = rotation[5];
+ const right8 = rotation[6];
+ const right9 = rotation[7];
+ const right10 = rotation[8];
+ const column0Row0 = left0 * right0 + left4 * right1 + left8 * right2;
+ const column0Row1 = left1 * right0 + left5 * right1 + left9 * right2;
+ const column0Row2 = left2 * right0 + left6 * right1 + left10 * right2;
+ const column1Row0 = left0 * right4 + left4 * right5 + left8 * right6;
+ const column1Row1 = left1 * right4 + left5 * right5 + left9 * right6;
+ const column1Row2 = left2 * right4 + left6 * right5 + left10 * right6;
+ const column2Row0 = left0 * right8 + left4 * right9 + left8 * right10;
+ const column2Row1 = left1 * right8 + left5 * right9 + left9 * right10;
+ const column2Row2 = left2 * right8 + left6 * right9 + left10 * right10;
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column0Row2;
+ result[3] = 0;
+ result[4] = column1Row0;
+ result[5] = column1Row1;
+ result[6] = column1Row2;
+ result[7] = 0;
+ result[8] = column2Row0;
+ result[9] = column2Row1;
+ result[10] = column2Row2;
+ result[11] = 0;
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+};
+Matrix4.multiplyByTranslation = function(matrix, translation3, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("translation", translation3);
+ Check_default.typeOf.object("result", result);
+ const x = translation3.x;
+ const y = translation3.y;
+ const z = translation3.z;
+ const tx = x * matrix[0] + y * matrix[4] + z * matrix[8] + matrix[12];
+ const ty = x * matrix[1] + y * matrix[5] + z * matrix[9] + matrix[13];
+ const tz = x * matrix[2] + y * matrix[6] + z * matrix[10] + matrix[14];
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ result[4] = matrix[4];
+ result[5] = matrix[5];
+ result[6] = matrix[6];
+ result[7] = matrix[7];
+ result[8] = matrix[8];
+ result[9] = matrix[9];
+ result[10] = matrix[10];
+ result[11] = matrix[11];
+ result[12] = tx;
+ result[13] = ty;
+ result[14] = tz;
+ result[15] = matrix[15];
+ return result;
+};
+Matrix4.multiplyByScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("scale", scale);
+ Check_default.typeOf.object("result", result);
+ const scaleX = scale.x;
+ const scaleY = scale.y;
+ const scaleZ = scale.z;
+ if (scaleX === 1 && scaleY === 1 && scaleZ === 1) {
+ return Matrix4.clone(matrix, result);
+ }
+ result[0] = scaleX * matrix[0];
+ result[1] = scaleX * matrix[1];
+ result[2] = scaleX * matrix[2];
+ result[3] = matrix[3];
+ result[4] = scaleY * matrix[4];
+ result[5] = scaleY * matrix[5];
+ result[6] = scaleY * matrix[6];
+ result[7] = matrix[7];
+ result[8] = scaleZ * matrix[8];
+ result[9] = scaleZ * matrix[9];
+ result[10] = scaleZ * matrix[10];
+ result[11] = matrix[11];
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+};
+Matrix4.multiplyByUniformScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number("scale", scale);
+ Check_default.typeOf.object("result", result);
+ result[0] = matrix[0] * scale;
+ result[1] = matrix[1] * scale;
+ result[2] = matrix[2] * scale;
+ result[3] = matrix[3];
+ result[4] = matrix[4] * scale;
+ result[5] = matrix[5] * scale;
+ result[6] = matrix[6] * scale;
+ result[7] = matrix[7];
+ result[8] = matrix[8] * scale;
+ result[9] = matrix[9] * scale;
+ result[10] = matrix[10] * scale;
+ result[11] = matrix[11];
+ result[12] = matrix[12];
+ result[13] = matrix[13];
+ result[14] = matrix[14];
+ result[15] = matrix[15];
+ return result;
+};
+Matrix4.multiplyByVector = function(matrix, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const vX = cartesian11.x;
+ const vY = cartesian11.y;
+ const vZ = cartesian11.z;
+ const vW = cartesian11.w;
+ const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12] * vW;
+ const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13] * vW;
+ const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14] * vW;
+ const w = matrix[3] * vX + matrix[7] * vY + matrix[11] * vZ + matrix[15] * vW;
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+};
+Matrix4.multiplyByPointAsVector = function(matrix, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const vX = cartesian11.x;
+ const vY = cartesian11.y;
+ const vZ = cartesian11.z;
+ const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ;
+ const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ;
+ const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ;
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+};
+Matrix4.multiplyByPoint = function(matrix, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const vX = cartesian11.x;
+ const vY = cartesian11.y;
+ const vZ = cartesian11.z;
+ const x = matrix[0] * vX + matrix[4] * vY + matrix[8] * vZ + matrix[12];
+ const y = matrix[1] * vX + matrix[5] * vY + matrix[9] * vZ + matrix[13];
+ const z = matrix[2] * vX + matrix[6] * vY + matrix[10] * vZ + matrix[14];
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+};
+Matrix4.multiplyByScalar = function(matrix, scalar, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result[0] = matrix[0] * scalar;
+ result[1] = matrix[1] * scalar;
+ result[2] = matrix[2] * scalar;
+ result[3] = matrix[3] * scalar;
+ result[4] = matrix[4] * scalar;
+ result[5] = matrix[5] * scalar;
+ result[6] = matrix[6] * scalar;
+ result[7] = matrix[7] * scalar;
+ result[8] = matrix[8] * scalar;
+ result[9] = matrix[9] * scalar;
+ result[10] = matrix[10] * scalar;
+ result[11] = matrix[11] * scalar;
+ result[12] = matrix[12] * scalar;
+ result[13] = matrix[13] * scalar;
+ result[14] = matrix[14] * scalar;
+ result[15] = matrix[15] * scalar;
+ return result;
+};
+Matrix4.negate = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result[0] = -matrix[0];
+ result[1] = -matrix[1];
+ result[2] = -matrix[2];
+ result[3] = -matrix[3];
+ result[4] = -matrix[4];
+ result[5] = -matrix[5];
+ result[6] = -matrix[6];
+ result[7] = -matrix[7];
+ result[8] = -matrix[8];
+ result[9] = -matrix[9];
+ result[10] = -matrix[10];
+ result[11] = -matrix[11];
+ result[12] = -matrix[12];
+ result[13] = -matrix[13];
+ result[14] = -matrix[14];
+ result[15] = -matrix[15];
+ return result;
+};
+Matrix4.transpose = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const matrix1 = matrix[1];
+ const matrix2 = matrix[2];
+ const matrix3 = matrix[3];
+ const matrix6 = matrix[6];
+ const matrix7 = matrix[7];
+ const matrix11 = matrix[11];
+ result[0] = matrix[0];
+ result[1] = matrix[4];
+ result[2] = matrix[8];
+ result[3] = matrix[12];
+ result[4] = matrix1;
+ result[5] = matrix[5];
+ result[6] = matrix[9];
+ result[7] = matrix[13];
+ result[8] = matrix2;
+ result[9] = matrix6;
+ result[10] = matrix[10];
+ result[11] = matrix[14];
+ result[12] = matrix3;
+ result[13] = matrix7;
+ result[14] = matrix11;
+ result[15] = matrix[15];
+ return result;
+};
+Matrix4.abs = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result[0] = Math.abs(matrix[0]);
+ result[1] = Math.abs(matrix[1]);
+ result[2] = Math.abs(matrix[2]);
+ result[3] = Math.abs(matrix[3]);
+ result[4] = Math.abs(matrix[4]);
+ result[5] = Math.abs(matrix[5]);
+ result[6] = Math.abs(matrix[6]);
+ result[7] = Math.abs(matrix[7]);
+ result[8] = Math.abs(matrix[8]);
+ result[9] = Math.abs(matrix[9]);
+ result[10] = Math.abs(matrix[10]);
+ result[11] = Math.abs(matrix[11]);
+ result[12] = Math.abs(matrix[12]);
+ result[13] = Math.abs(matrix[13]);
+ result[14] = Math.abs(matrix[14]);
+ result[15] = Math.abs(matrix[15]);
+ return result;
+};
+Matrix4.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left[12] === right[12] && left[13] === right[13] && left[14] === right[14] && left[0] === right[0] && left[1] === right[1] && left[2] === right[2] && left[4] === right[4] && left[5] === right[5] && left[6] === right[6] && left[8] === right[8] && left[9] === right[9] && left[10] === right[10] && left[3] === right[3] && left[7] === right[7] && left[11] === right[11] && left[15] === right[15];
+};
+Matrix4.equalsEpsilon = function(left, right, epsilon) {
+ epsilon = defaultValue_default(epsilon, 0);
+ return left === right || defined_default(left) && defined_default(right) && Math.abs(left[0] - right[0]) <= epsilon && Math.abs(left[1] - right[1]) <= epsilon && Math.abs(left[2] - right[2]) <= epsilon && Math.abs(left[3] - right[3]) <= epsilon && Math.abs(left[4] - right[4]) <= epsilon && Math.abs(left[5] - right[5]) <= epsilon && Math.abs(left[6] - right[6]) <= epsilon && Math.abs(left[7] - right[7]) <= epsilon && Math.abs(left[8] - right[8]) <= epsilon && Math.abs(left[9] - right[9]) <= epsilon && Math.abs(left[10] - right[10]) <= epsilon && Math.abs(left[11] - right[11]) <= epsilon && Math.abs(left[12] - right[12]) <= epsilon && Math.abs(left[13] - right[13]) <= epsilon && Math.abs(left[14] - right[14]) <= epsilon && Math.abs(left[15] - right[15]) <= epsilon;
+};
+Matrix4.getTranslation = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result.x = matrix[12];
+ result.y = matrix[13];
+ result.z = matrix[14];
+ return result;
+};
+Matrix4.getMatrix3 = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[4];
+ result[4] = matrix[5];
+ result[5] = matrix[6];
+ result[6] = matrix[8];
+ result[7] = matrix[9];
+ result[8] = matrix[10];
+ return result;
+};
+var scratchInverseRotation = new Matrix3_default();
+var scratchMatrix3Zero = new Matrix3_default();
+var scratchBottomRow = new Cartesian4_default();
+var scratchExpectedBottomRow = new Cartesian4_default(0, 0, 0, 1);
+Matrix4.inverse = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const src0 = matrix[0];
+ const src1 = matrix[4];
+ const src2 = matrix[8];
+ const src3 = matrix[12];
+ const src4 = matrix[1];
+ const src5 = matrix[5];
+ const src6 = matrix[9];
+ const src7 = matrix[13];
+ const src8 = matrix[2];
+ const src9 = matrix[6];
+ const src10 = matrix[10];
+ const src11 = matrix[14];
+ const src12 = matrix[3];
+ const src13 = matrix[7];
+ const src14 = matrix[11];
+ const src15 = matrix[15];
+ let tmp0 = src10 * src15;
+ let tmp1 = src11 * src14;
+ let tmp2 = src9 * src15;
+ let tmp3 = src11 * src13;
+ let tmp4 = src9 * src14;
+ let tmp5 = src10 * src13;
+ let tmp6 = src8 * src15;
+ let tmp7 = src11 * src12;
+ let tmp8 = src8 * src14;
+ let tmp9 = src10 * src12;
+ let tmp10 = src8 * src13;
+ let tmp11 = src9 * src12;
+ const dst0 = tmp0 * src5 + tmp3 * src6 + tmp4 * src7 - (tmp1 * src5 + tmp2 * src6 + tmp5 * src7);
+ const dst1 = tmp1 * src4 + tmp6 * src6 + tmp9 * src7 - (tmp0 * src4 + tmp7 * src6 + tmp8 * src7);
+ const dst2 = tmp2 * src4 + tmp7 * src5 + tmp10 * src7 - (tmp3 * src4 + tmp6 * src5 + tmp11 * src7);
+ const dst3 = tmp5 * src4 + tmp8 * src5 + tmp11 * src6 - (tmp4 * src4 + tmp9 * src5 + tmp10 * src6);
+ const dst4 = tmp1 * src1 + tmp2 * src2 + tmp5 * src3 - (tmp0 * src1 + tmp3 * src2 + tmp4 * src3);
+ const dst5 = tmp0 * src0 + tmp7 * src2 + tmp8 * src3 - (tmp1 * src0 + tmp6 * src2 + tmp9 * src3);
+ const dst6 = tmp3 * src0 + tmp6 * src1 + tmp11 * src3 - (tmp2 * src0 + tmp7 * src1 + tmp10 * src3);
+ const dst7 = tmp4 * src0 + tmp9 * src1 + tmp10 * src2 - (tmp5 * src0 + tmp8 * src1 + tmp11 * src2);
+ tmp0 = src2 * src7;
+ tmp1 = src3 * src6;
+ tmp2 = src1 * src7;
+ tmp3 = src3 * src5;
+ tmp4 = src1 * src6;
+ tmp5 = src2 * src5;
+ tmp6 = src0 * src7;
+ tmp7 = src3 * src4;
+ tmp8 = src0 * src6;
+ tmp9 = src2 * src4;
+ tmp10 = src0 * src5;
+ tmp11 = src1 * src4;
+ const dst8 = tmp0 * src13 + tmp3 * src14 + tmp4 * src15 - (tmp1 * src13 + tmp2 * src14 + tmp5 * src15);
+ const dst9 = tmp1 * src12 + tmp6 * src14 + tmp9 * src15 - (tmp0 * src12 + tmp7 * src14 + tmp8 * src15);
+ const dst10 = tmp2 * src12 + tmp7 * src13 + tmp10 * src15 - (tmp3 * src12 + tmp6 * src13 + tmp11 * src15);
+ const dst11 = tmp5 * src12 + tmp8 * src13 + tmp11 * src14 - (tmp4 * src12 + tmp9 * src13 + tmp10 * src14);
+ const dst12 = tmp2 * src10 + tmp5 * src11 + tmp1 * src9 - (tmp4 * src11 + tmp0 * src9 + tmp3 * src10);
+ const dst13 = tmp8 * src11 + tmp0 * src8 + tmp7 * src10 - (tmp6 * src10 + tmp9 * src11 + tmp1 * src8);
+ const dst14 = tmp6 * src9 + tmp11 * src11 + tmp3 * src8 - (tmp10 * src11 + tmp2 * src8 + tmp7 * src9);
+ const dst15 = tmp10 * src10 + tmp4 * src8 + tmp9 * src9 - (tmp8 * src9 + tmp11 * src10 + tmp5 * src8);
+ let det = src0 * dst0 + src1 * dst1 + src2 * dst2 + src3 * dst3;
+ if (Math.abs(det) < Math_default.EPSILON21) {
+ if (Matrix3_default.equalsEpsilon(
+ Matrix4.getMatrix3(matrix, scratchInverseRotation),
+ scratchMatrix3Zero,
+ Math_default.EPSILON7
+ ) && Cartesian4_default.equals(
+ Matrix4.getRow(matrix, 3, scratchBottomRow),
+ scratchExpectedBottomRow
+ )) {
+ result[0] = 0;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = 0;
+ result[4] = 0;
+ result[5] = 0;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = 0;
+ result[9] = 0;
+ result[10] = 0;
+ result[11] = 0;
+ result[12] = -matrix[12];
+ result[13] = -matrix[13];
+ result[14] = -matrix[14];
+ result[15] = 1;
+ return result;
+ }
+ throw new RuntimeError_default(
+ "matrix is not invertible because its determinate is zero."
+ );
+ }
+ det = 1 / det;
+ result[0] = dst0 * det;
+ result[1] = dst1 * det;
+ result[2] = dst2 * det;
+ result[3] = dst3 * det;
+ result[4] = dst4 * det;
+ result[5] = dst5 * det;
+ result[6] = dst6 * det;
+ result[7] = dst7 * det;
+ result[8] = dst8 * det;
+ result[9] = dst9 * det;
+ result[10] = dst10 * det;
+ result[11] = dst11 * det;
+ result[12] = dst12 * det;
+ result[13] = dst13 * det;
+ result[14] = dst14 * det;
+ result[15] = dst15 * det;
+ return result;
+};
+Matrix4.inverseTransformation = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const matrix0 = matrix[0];
+ const matrix1 = matrix[1];
+ const matrix2 = matrix[2];
+ const matrix4 = matrix[4];
+ const matrix5 = matrix[5];
+ const matrix6 = matrix[6];
+ const matrix8 = matrix[8];
+ const matrix9 = matrix[9];
+ const matrix10 = matrix[10];
+ const vX = matrix[12];
+ const vY = matrix[13];
+ const vZ = matrix[14];
+ const x = -matrix0 * vX - matrix1 * vY - matrix2 * vZ;
+ const y = -matrix4 * vX - matrix5 * vY - matrix6 * vZ;
+ const z = -matrix8 * vX - matrix9 * vY - matrix10 * vZ;
+ result[0] = matrix0;
+ result[1] = matrix4;
+ result[2] = matrix8;
+ result[3] = 0;
+ result[4] = matrix1;
+ result[5] = matrix5;
+ result[6] = matrix9;
+ result[7] = 0;
+ result[8] = matrix2;
+ result[9] = matrix6;
+ result[10] = matrix10;
+ result[11] = 0;
+ result[12] = x;
+ result[13] = y;
+ result[14] = z;
+ result[15] = 1;
+ return result;
+};
+var scratchTransposeMatrix2 = new Matrix4();
+Matrix4.inverseTranspose = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ return Matrix4.inverse(
+ Matrix4.transpose(matrix, scratchTransposeMatrix2),
+ result
+ );
+};
+Matrix4.IDENTITY = Object.freeze(
+ new Matrix4(
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1
+ )
+);
+Matrix4.ZERO = Object.freeze(
+ new Matrix4(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ )
+);
+Matrix4.COLUMN0ROW0 = 0;
+Matrix4.COLUMN0ROW1 = 1;
+Matrix4.COLUMN0ROW2 = 2;
+Matrix4.COLUMN0ROW3 = 3;
+Matrix4.COLUMN1ROW0 = 4;
+Matrix4.COLUMN1ROW1 = 5;
+Matrix4.COLUMN1ROW2 = 6;
+Matrix4.COLUMN1ROW3 = 7;
+Matrix4.COLUMN2ROW0 = 8;
+Matrix4.COLUMN2ROW1 = 9;
+Matrix4.COLUMN2ROW2 = 10;
+Matrix4.COLUMN2ROW3 = 11;
+Matrix4.COLUMN3ROW0 = 12;
+Matrix4.COLUMN3ROW1 = 13;
+Matrix4.COLUMN3ROW2 = 14;
+Matrix4.COLUMN3ROW3 = 15;
+Object.defineProperties(Matrix4.prototype, {
+ length: {
+ get: function() {
+ return Matrix4.packedLength;
+ }
+ }
+});
+Matrix4.prototype.clone = function(result) {
+ return Matrix4.clone(this, result);
+};
+Matrix4.prototype.equals = function(right) {
+ return Matrix4.equals(this, right);
+};
+Matrix4.equalsArray = function(matrix, array, offset2) {
+ return matrix[0] === array[offset2] && matrix[1] === array[offset2 + 1] && matrix[2] === array[offset2 + 2] && matrix[3] === array[offset2 + 3] && matrix[4] === array[offset2 + 4] && matrix[5] === array[offset2 + 5] && matrix[6] === array[offset2 + 6] && matrix[7] === array[offset2 + 7] && matrix[8] === array[offset2 + 8] && matrix[9] === array[offset2 + 9] && matrix[10] === array[offset2 + 10] && matrix[11] === array[offset2 + 11] && matrix[12] === array[offset2 + 12] && matrix[13] === array[offset2 + 13] && matrix[14] === array[offset2 + 14] && matrix[15] === array[offset2 + 15];
+};
+Matrix4.prototype.equalsEpsilon = function(right, epsilon) {
+ return Matrix4.equalsEpsilon(this, right, epsilon);
+};
+Matrix4.prototype.toString = function() {
+ return `(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
+(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
+(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
+(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`;
+};
+var Matrix4_default = Matrix4;
+
+// Source/Core/WebGLConstants.js
+var WebGLConstants = {
+ DEPTH_BUFFER_BIT: 256,
+ STENCIL_BUFFER_BIT: 1024,
+ COLOR_BUFFER_BIT: 16384,
+ POINTS: 0,
+ LINES: 1,
+ LINE_LOOP: 2,
+ LINE_STRIP: 3,
+ TRIANGLES: 4,
+ TRIANGLE_STRIP: 5,
+ TRIANGLE_FAN: 6,
+ ZERO: 0,
+ ONE: 1,
+ SRC_COLOR: 768,
+ ONE_MINUS_SRC_COLOR: 769,
+ SRC_ALPHA: 770,
+ ONE_MINUS_SRC_ALPHA: 771,
+ DST_ALPHA: 772,
+ ONE_MINUS_DST_ALPHA: 773,
+ DST_COLOR: 774,
+ ONE_MINUS_DST_COLOR: 775,
+ SRC_ALPHA_SATURATE: 776,
+ FUNC_ADD: 32774,
+ BLEND_EQUATION: 32777,
+ BLEND_EQUATION_RGB: 32777,
+ BLEND_EQUATION_ALPHA: 34877,
+ FUNC_SUBTRACT: 32778,
+ FUNC_REVERSE_SUBTRACT: 32779,
+ BLEND_DST_RGB: 32968,
+ BLEND_SRC_RGB: 32969,
+ BLEND_DST_ALPHA: 32970,
+ BLEND_SRC_ALPHA: 32971,
+ CONSTANT_COLOR: 32769,
+ ONE_MINUS_CONSTANT_COLOR: 32770,
+ CONSTANT_ALPHA: 32771,
+ ONE_MINUS_CONSTANT_ALPHA: 32772,
+ BLEND_COLOR: 32773,
+ ARRAY_BUFFER: 34962,
+ ELEMENT_ARRAY_BUFFER: 34963,
+ ARRAY_BUFFER_BINDING: 34964,
+ ELEMENT_ARRAY_BUFFER_BINDING: 34965,
+ STREAM_DRAW: 35040,
+ STATIC_DRAW: 35044,
+ DYNAMIC_DRAW: 35048,
+ BUFFER_SIZE: 34660,
+ BUFFER_USAGE: 34661,
+ CURRENT_VERTEX_ATTRIB: 34342,
+ FRONT: 1028,
+ BACK: 1029,
+ FRONT_AND_BACK: 1032,
+ CULL_FACE: 2884,
+ BLEND: 3042,
+ DITHER: 3024,
+ STENCIL_TEST: 2960,
+ DEPTH_TEST: 2929,
+ SCISSOR_TEST: 3089,
+ POLYGON_OFFSET_FILL: 32823,
+ SAMPLE_ALPHA_TO_COVERAGE: 32926,
+ SAMPLE_COVERAGE: 32928,
+ NO_ERROR: 0,
+ INVALID_ENUM: 1280,
+ INVALID_VALUE: 1281,
+ INVALID_OPERATION: 1282,
+ OUT_OF_MEMORY: 1285,
+ CW: 2304,
+ CCW: 2305,
+ LINE_WIDTH: 2849,
+ ALIASED_POINT_SIZE_RANGE: 33901,
+ ALIASED_LINE_WIDTH_RANGE: 33902,
+ CULL_FACE_MODE: 2885,
+ FRONT_FACE: 2886,
+ DEPTH_RANGE: 2928,
+ DEPTH_WRITEMASK: 2930,
+ DEPTH_CLEAR_VALUE: 2931,
+ DEPTH_FUNC: 2932,
+ STENCIL_CLEAR_VALUE: 2961,
+ STENCIL_FUNC: 2962,
+ STENCIL_FAIL: 2964,
+ STENCIL_PASS_DEPTH_FAIL: 2965,
+ STENCIL_PASS_DEPTH_PASS: 2966,
+ STENCIL_REF: 2967,
+ STENCIL_VALUE_MASK: 2963,
+ STENCIL_WRITEMASK: 2968,
+ STENCIL_BACK_FUNC: 34816,
+ STENCIL_BACK_FAIL: 34817,
+ STENCIL_BACK_PASS_DEPTH_FAIL: 34818,
+ STENCIL_BACK_PASS_DEPTH_PASS: 34819,
+ STENCIL_BACK_REF: 36003,
+ STENCIL_BACK_VALUE_MASK: 36004,
+ STENCIL_BACK_WRITEMASK: 36005,
+ VIEWPORT: 2978,
+ SCISSOR_BOX: 3088,
+ COLOR_CLEAR_VALUE: 3106,
+ COLOR_WRITEMASK: 3107,
+ UNPACK_ALIGNMENT: 3317,
+ PACK_ALIGNMENT: 3333,
+ MAX_TEXTURE_SIZE: 3379,
+ MAX_VIEWPORT_DIMS: 3386,
+ SUBPIXEL_BITS: 3408,
+ RED_BITS: 3410,
+ GREEN_BITS: 3411,
+ BLUE_BITS: 3412,
+ ALPHA_BITS: 3413,
+ DEPTH_BITS: 3414,
+ STENCIL_BITS: 3415,
+ POLYGON_OFFSET_UNITS: 10752,
+ POLYGON_OFFSET_FACTOR: 32824,
+ TEXTURE_BINDING_2D: 32873,
+ SAMPLE_BUFFERS: 32936,
+ SAMPLES: 32937,
+ SAMPLE_COVERAGE_VALUE: 32938,
+ SAMPLE_COVERAGE_INVERT: 32939,
+ COMPRESSED_TEXTURE_FORMATS: 34467,
+ DONT_CARE: 4352,
+ FASTEST: 4353,
+ NICEST: 4354,
+ GENERATE_MIPMAP_HINT: 33170,
+ BYTE: 5120,
+ UNSIGNED_BYTE: 5121,
+ SHORT: 5122,
+ UNSIGNED_SHORT: 5123,
+ INT: 5124,
+ UNSIGNED_INT: 5125,
+ FLOAT: 5126,
+ DEPTH_COMPONENT: 6402,
+ ALPHA: 6406,
+ RGB: 6407,
+ RGBA: 6408,
+ LUMINANCE: 6409,
+ LUMINANCE_ALPHA: 6410,
+ UNSIGNED_SHORT_4_4_4_4: 32819,
+ UNSIGNED_SHORT_5_5_5_1: 32820,
+ UNSIGNED_SHORT_5_6_5: 33635,
+ FRAGMENT_SHADER: 35632,
+ VERTEX_SHADER: 35633,
+ MAX_VERTEX_ATTRIBS: 34921,
+ MAX_VERTEX_UNIFORM_VECTORS: 36347,
+ MAX_VARYING_VECTORS: 36348,
+ MAX_COMBINED_TEXTURE_IMAGE_UNITS: 35661,
+ MAX_VERTEX_TEXTURE_IMAGE_UNITS: 35660,
+ MAX_TEXTURE_IMAGE_UNITS: 34930,
+ MAX_FRAGMENT_UNIFORM_VECTORS: 36349,
+ SHADER_TYPE: 35663,
+ DELETE_STATUS: 35712,
+ LINK_STATUS: 35714,
+ VALIDATE_STATUS: 35715,
+ ATTACHED_SHADERS: 35717,
+ ACTIVE_UNIFORMS: 35718,
+ ACTIVE_ATTRIBUTES: 35721,
+ SHADING_LANGUAGE_VERSION: 35724,
+ CURRENT_PROGRAM: 35725,
+ NEVER: 512,
+ LESS: 513,
+ EQUAL: 514,
+ LEQUAL: 515,
+ GREATER: 516,
+ NOTEQUAL: 517,
+ GEQUAL: 518,
+ ALWAYS: 519,
+ KEEP: 7680,
+ REPLACE: 7681,
+ INCR: 7682,
+ DECR: 7683,
+ INVERT: 5386,
+ INCR_WRAP: 34055,
+ DECR_WRAP: 34056,
+ VENDOR: 7936,
+ RENDERER: 7937,
+ VERSION: 7938,
+ NEAREST: 9728,
+ LINEAR: 9729,
+ NEAREST_MIPMAP_NEAREST: 9984,
+ LINEAR_MIPMAP_NEAREST: 9985,
+ NEAREST_MIPMAP_LINEAR: 9986,
+ LINEAR_MIPMAP_LINEAR: 9987,
+ TEXTURE_MAG_FILTER: 10240,
+ TEXTURE_MIN_FILTER: 10241,
+ TEXTURE_WRAP_S: 10242,
+ TEXTURE_WRAP_T: 10243,
+ TEXTURE_2D: 3553,
+ TEXTURE: 5890,
+ TEXTURE_CUBE_MAP: 34067,
+ TEXTURE_BINDING_CUBE_MAP: 34068,
+ TEXTURE_CUBE_MAP_POSITIVE_X: 34069,
+ TEXTURE_CUBE_MAP_NEGATIVE_X: 34070,
+ TEXTURE_CUBE_MAP_POSITIVE_Y: 34071,
+ TEXTURE_CUBE_MAP_NEGATIVE_Y: 34072,
+ TEXTURE_CUBE_MAP_POSITIVE_Z: 34073,
+ TEXTURE_CUBE_MAP_NEGATIVE_Z: 34074,
+ MAX_CUBE_MAP_TEXTURE_SIZE: 34076,
+ TEXTURE0: 33984,
+ TEXTURE1: 33985,
+ TEXTURE2: 33986,
+ TEXTURE3: 33987,
+ TEXTURE4: 33988,
+ TEXTURE5: 33989,
+ TEXTURE6: 33990,
+ TEXTURE7: 33991,
+ TEXTURE8: 33992,
+ TEXTURE9: 33993,
+ TEXTURE10: 33994,
+ TEXTURE11: 33995,
+ TEXTURE12: 33996,
+ TEXTURE13: 33997,
+ TEXTURE14: 33998,
+ TEXTURE15: 33999,
+ TEXTURE16: 34e3,
+ TEXTURE17: 34001,
+ TEXTURE18: 34002,
+ TEXTURE19: 34003,
+ TEXTURE20: 34004,
+ TEXTURE21: 34005,
+ TEXTURE22: 34006,
+ TEXTURE23: 34007,
+ TEXTURE24: 34008,
+ TEXTURE25: 34009,
+ TEXTURE26: 34010,
+ TEXTURE27: 34011,
+ TEXTURE28: 34012,
+ TEXTURE29: 34013,
+ TEXTURE30: 34014,
+ TEXTURE31: 34015,
+ ACTIVE_TEXTURE: 34016,
+ REPEAT: 10497,
+ CLAMP_TO_EDGE: 33071,
+ MIRRORED_REPEAT: 33648,
+ FLOAT_VEC2: 35664,
+ FLOAT_VEC3: 35665,
+ FLOAT_VEC4: 35666,
+ INT_VEC2: 35667,
+ INT_VEC3: 35668,
+ INT_VEC4: 35669,
+ BOOL: 35670,
+ BOOL_VEC2: 35671,
+ BOOL_VEC3: 35672,
+ BOOL_VEC4: 35673,
+ FLOAT_MAT2: 35674,
+ FLOAT_MAT3: 35675,
+ FLOAT_MAT4: 35676,
+ SAMPLER_2D: 35678,
+ SAMPLER_CUBE: 35680,
+ VERTEX_ATTRIB_ARRAY_ENABLED: 34338,
+ VERTEX_ATTRIB_ARRAY_SIZE: 34339,
+ VERTEX_ATTRIB_ARRAY_STRIDE: 34340,
+ VERTEX_ATTRIB_ARRAY_TYPE: 34341,
+ VERTEX_ATTRIB_ARRAY_NORMALIZED: 34922,
+ VERTEX_ATTRIB_ARRAY_POINTER: 34373,
+ VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: 34975,
+ IMPLEMENTATION_COLOR_READ_TYPE: 35738,
+ IMPLEMENTATION_COLOR_READ_FORMAT: 35739,
+ COMPILE_STATUS: 35713,
+ LOW_FLOAT: 36336,
+ MEDIUM_FLOAT: 36337,
+ HIGH_FLOAT: 36338,
+ LOW_INT: 36339,
+ MEDIUM_INT: 36340,
+ HIGH_INT: 36341,
+ FRAMEBUFFER: 36160,
+ RENDERBUFFER: 36161,
+ RGBA4: 32854,
+ RGB5_A1: 32855,
+ RGB565: 36194,
+ DEPTH_COMPONENT16: 33189,
+ STENCIL_INDEX: 6401,
+ STENCIL_INDEX8: 36168,
+ DEPTH_STENCIL: 34041,
+ RENDERBUFFER_WIDTH: 36162,
+ RENDERBUFFER_HEIGHT: 36163,
+ RENDERBUFFER_INTERNAL_FORMAT: 36164,
+ RENDERBUFFER_RED_SIZE: 36176,
+ RENDERBUFFER_GREEN_SIZE: 36177,
+ RENDERBUFFER_BLUE_SIZE: 36178,
+ RENDERBUFFER_ALPHA_SIZE: 36179,
+ RENDERBUFFER_DEPTH_SIZE: 36180,
+ RENDERBUFFER_STENCIL_SIZE: 36181,
+ FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: 36048,
+ FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: 36049,
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: 36050,
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: 36051,
+ COLOR_ATTACHMENT0: 36064,
+ DEPTH_ATTACHMENT: 36096,
+ STENCIL_ATTACHMENT: 36128,
+ DEPTH_STENCIL_ATTACHMENT: 33306,
+ NONE: 0,
+ FRAMEBUFFER_COMPLETE: 36053,
+ FRAMEBUFFER_INCOMPLETE_ATTACHMENT: 36054,
+ FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: 36055,
+ FRAMEBUFFER_INCOMPLETE_DIMENSIONS: 36057,
+ FRAMEBUFFER_UNSUPPORTED: 36061,
+ FRAMEBUFFER_BINDING: 36006,
+ RENDERBUFFER_BINDING: 36007,
+ MAX_RENDERBUFFER_SIZE: 34024,
+ INVALID_FRAMEBUFFER_OPERATION: 1286,
+ UNPACK_FLIP_Y_WEBGL: 37440,
+ UNPACK_PREMULTIPLY_ALPHA_WEBGL: 37441,
+ CONTEXT_LOST_WEBGL: 37442,
+ UNPACK_COLORSPACE_CONVERSION_WEBGL: 37443,
+ BROWSER_DEFAULT_WEBGL: 37444,
+ COMPRESSED_RGB_S3TC_DXT1_EXT: 33776,
+ COMPRESSED_RGBA_S3TC_DXT1_EXT: 33777,
+ COMPRESSED_RGBA_S3TC_DXT3_EXT: 33778,
+ COMPRESSED_RGBA_S3TC_DXT5_EXT: 33779,
+ COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 35840,
+ COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 35841,
+ COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 35842,
+ COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 35843,
+ COMPRESSED_RGBA_ASTC_4x4_WEBGL: 37808,
+ COMPRESSED_RGB_ETC1_WEBGL: 36196,
+ COMPRESSED_RGBA_BPTC_UNORM: 36492,
+ HALF_FLOAT_OES: 36193,
+ DOUBLE: 5130,
+ READ_BUFFER: 3074,
+ UNPACK_ROW_LENGTH: 3314,
+ UNPACK_SKIP_ROWS: 3315,
+ UNPACK_SKIP_PIXELS: 3316,
+ PACK_ROW_LENGTH: 3330,
+ PACK_SKIP_ROWS: 3331,
+ PACK_SKIP_PIXELS: 3332,
+ COLOR: 6144,
+ DEPTH: 6145,
+ STENCIL: 6146,
+ RED: 6403,
+ RGB8: 32849,
+ RGBA8: 32856,
+ RGB10_A2: 32857,
+ TEXTURE_BINDING_3D: 32874,
+ UNPACK_SKIP_IMAGES: 32877,
+ UNPACK_IMAGE_HEIGHT: 32878,
+ TEXTURE_3D: 32879,
+ TEXTURE_WRAP_R: 32882,
+ MAX_3D_TEXTURE_SIZE: 32883,
+ UNSIGNED_INT_2_10_10_10_REV: 33640,
+ MAX_ELEMENTS_VERTICES: 33e3,
+ MAX_ELEMENTS_INDICES: 33001,
+ TEXTURE_MIN_LOD: 33082,
+ TEXTURE_MAX_LOD: 33083,
+ TEXTURE_BASE_LEVEL: 33084,
+ TEXTURE_MAX_LEVEL: 33085,
+ MIN: 32775,
+ MAX: 32776,
+ DEPTH_COMPONENT24: 33190,
+ MAX_TEXTURE_LOD_BIAS: 34045,
+ TEXTURE_COMPARE_MODE: 34892,
+ TEXTURE_COMPARE_FUNC: 34893,
+ CURRENT_QUERY: 34917,
+ QUERY_RESULT: 34918,
+ QUERY_RESULT_AVAILABLE: 34919,
+ STREAM_READ: 35041,
+ STREAM_COPY: 35042,
+ STATIC_READ: 35045,
+ STATIC_COPY: 35046,
+ DYNAMIC_READ: 35049,
+ DYNAMIC_COPY: 35050,
+ MAX_DRAW_BUFFERS: 34852,
+ DRAW_BUFFER0: 34853,
+ DRAW_BUFFER1: 34854,
+ DRAW_BUFFER2: 34855,
+ DRAW_BUFFER3: 34856,
+ DRAW_BUFFER4: 34857,
+ DRAW_BUFFER5: 34858,
+ DRAW_BUFFER6: 34859,
+ DRAW_BUFFER7: 34860,
+ DRAW_BUFFER8: 34861,
+ DRAW_BUFFER9: 34862,
+ DRAW_BUFFER10: 34863,
+ DRAW_BUFFER11: 34864,
+ DRAW_BUFFER12: 34865,
+ DRAW_BUFFER13: 34866,
+ DRAW_BUFFER14: 34867,
+ DRAW_BUFFER15: 34868,
+ MAX_FRAGMENT_UNIFORM_COMPONENTS: 35657,
+ MAX_VERTEX_UNIFORM_COMPONENTS: 35658,
+ SAMPLER_3D: 35679,
+ SAMPLER_2D_SHADOW: 35682,
+ FRAGMENT_SHADER_DERIVATIVE_HINT: 35723,
+ PIXEL_PACK_BUFFER: 35051,
+ PIXEL_UNPACK_BUFFER: 35052,
+ PIXEL_PACK_BUFFER_BINDING: 35053,
+ PIXEL_UNPACK_BUFFER_BINDING: 35055,
+ FLOAT_MAT2x3: 35685,
+ FLOAT_MAT2x4: 35686,
+ FLOAT_MAT3x2: 35687,
+ FLOAT_MAT3x4: 35688,
+ FLOAT_MAT4x2: 35689,
+ FLOAT_MAT4x3: 35690,
+ SRGB: 35904,
+ SRGB8: 35905,
+ SRGB8_ALPHA8: 35907,
+ COMPARE_REF_TO_TEXTURE: 34894,
+ RGBA32F: 34836,
+ RGB32F: 34837,
+ RGBA16F: 34842,
+ RGB16F: 34843,
+ VERTEX_ATTRIB_ARRAY_INTEGER: 35069,
+ MAX_ARRAY_TEXTURE_LAYERS: 35071,
+ MIN_PROGRAM_TEXEL_OFFSET: 35076,
+ MAX_PROGRAM_TEXEL_OFFSET: 35077,
+ MAX_VARYING_COMPONENTS: 35659,
+ TEXTURE_2D_ARRAY: 35866,
+ TEXTURE_BINDING_2D_ARRAY: 35869,
+ R11F_G11F_B10F: 35898,
+ UNSIGNED_INT_10F_11F_11F_REV: 35899,
+ RGB9_E5: 35901,
+ UNSIGNED_INT_5_9_9_9_REV: 35902,
+ TRANSFORM_FEEDBACK_BUFFER_MODE: 35967,
+ MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS: 35968,
+ TRANSFORM_FEEDBACK_VARYINGS: 35971,
+ TRANSFORM_FEEDBACK_BUFFER_START: 35972,
+ TRANSFORM_FEEDBACK_BUFFER_SIZE: 35973,
+ TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN: 35976,
+ RASTERIZER_DISCARD: 35977,
+ MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS: 35978,
+ MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS: 35979,
+ INTERLEAVED_ATTRIBS: 35980,
+ SEPARATE_ATTRIBS: 35981,
+ TRANSFORM_FEEDBACK_BUFFER: 35982,
+ TRANSFORM_FEEDBACK_BUFFER_BINDING: 35983,
+ RGBA32UI: 36208,
+ RGB32UI: 36209,
+ RGBA16UI: 36214,
+ RGB16UI: 36215,
+ RGBA8UI: 36220,
+ RGB8UI: 36221,
+ RGBA32I: 36226,
+ RGB32I: 36227,
+ RGBA16I: 36232,
+ RGB16I: 36233,
+ RGBA8I: 36238,
+ RGB8I: 36239,
+ RED_INTEGER: 36244,
+ RGB_INTEGER: 36248,
+ RGBA_INTEGER: 36249,
+ SAMPLER_2D_ARRAY: 36289,
+ SAMPLER_2D_ARRAY_SHADOW: 36292,
+ SAMPLER_CUBE_SHADOW: 36293,
+ UNSIGNED_INT_VEC2: 36294,
+ UNSIGNED_INT_VEC3: 36295,
+ UNSIGNED_INT_VEC4: 36296,
+ INT_SAMPLER_2D: 36298,
+ INT_SAMPLER_3D: 36299,
+ INT_SAMPLER_CUBE: 36300,
+ INT_SAMPLER_2D_ARRAY: 36303,
+ UNSIGNED_INT_SAMPLER_2D: 36306,
+ UNSIGNED_INT_SAMPLER_3D: 36307,
+ UNSIGNED_INT_SAMPLER_CUBE: 36308,
+ UNSIGNED_INT_SAMPLER_2D_ARRAY: 36311,
+ DEPTH_COMPONENT32F: 36012,
+ DEPTH32F_STENCIL8: 36013,
+ FLOAT_32_UNSIGNED_INT_24_8_REV: 36269,
+ FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: 33296,
+ FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: 33297,
+ FRAMEBUFFER_ATTACHMENT_RED_SIZE: 33298,
+ FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: 33299,
+ FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: 33300,
+ FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: 33301,
+ FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: 33302,
+ FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: 33303,
+ FRAMEBUFFER_DEFAULT: 33304,
+ UNSIGNED_INT_24_8: 34042,
+ DEPTH24_STENCIL8: 35056,
+ UNSIGNED_NORMALIZED: 35863,
+ DRAW_FRAMEBUFFER_BINDING: 36006,
+ READ_FRAMEBUFFER: 36008,
+ DRAW_FRAMEBUFFER: 36009,
+ READ_FRAMEBUFFER_BINDING: 36010,
+ RENDERBUFFER_SAMPLES: 36011,
+ FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER: 36052,
+ MAX_COLOR_ATTACHMENTS: 36063,
+ COLOR_ATTACHMENT1: 36065,
+ COLOR_ATTACHMENT2: 36066,
+ COLOR_ATTACHMENT3: 36067,
+ COLOR_ATTACHMENT4: 36068,
+ COLOR_ATTACHMENT5: 36069,
+ COLOR_ATTACHMENT6: 36070,
+ COLOR_ATTACHMENT7: 36071,
+ COLOR_ATTACHMENT8: 36072,
+ COLOR_ATTACHMENT9: 36073,
+ COLOR_ATTACHMENT10: 36074,
+ COLOR_ATTACHMENT11: 36075,
+ COLOR_ATTACHMENT12: 36076,
+ COLOR_ATTACHMENT13: 36077,
+ COLOR_ATTACHMENT14: 36078,
+ COLOR_ATTACHMENT15: 36079,
+ FRAMEBUFFER_INCOMPLETE_MULTISAMPLE: 36182,
+ MAX_SAMPLES: 36183,
+ HALF_FLOAT: 5131,
+ RG: 33319,
+ RG_INTEGER: 33320,
+ R8: 33321,
+ RG8: 33323,
+ R16F: 33325,
+ R32F: 33326,
+ RG16F: 33327,
+ RG32F: 33328,
+ R8I: 33329,
+ R8UI: 33330,
+ R16I: 33331,
+ R16UI: 33332,
+ R32I: 33333,
+ R32UI: 33334,
+ RG8I: 33335,
+ RG8UI: 33336,
+ RG16I: 33337,
+ RG16UI: 33338,
+ RG32I: 33339,
+ RG32UI: 33340,
+ VERTEX_ARRAY_BINDING: 34229,
+ R8_SNORM: 36756,
+ RG8_SNORM: 36757,
+ RGB8_SNORM: 36758,
+ RGBA8_SNORM: 36759,
+ SIGNED_NORMALIZED: 36764,
+ COPY_READ_BUFFER: 36662,
+ COPY_WRITE_BUFFER: 36663,
+ COPY_READ_BUFFER_BINDING: 36662,
+ COPY_WRITE_BUFFER_BINDING: 36663,
+ UNIFORM_BUFFER: 35345,
+ UNIFORM_BUFFER_BINDING: 35368,
+ UNIFORM_BUFFER_START: 35369,
+ UNIFORM_BUFFER_SIZE: 35370,
+ MAX_VERTEX_UNIFORM_BLOCKS: 35371,
+ MAX_FRAGMENT_UNIFORM_BLOCKS: 35373,
+ MAX_COMBINED_UNIFORM_BLOCKS: 35374,
+ MAX_UNIFORM_BUFFER_BINDINGS: 35375,
+ MAX_UNIFORM_BLOCK_SIZE: 35376,
+ MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS: 35377,
+ MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS: 35379,
+ UNIFORM_BUFFER_OFFSET_ALIGNMENT: 35380,
+ ACTIVE_UNIFORM_BLOCKS: 35382,
+ UNIFORM_TYPE: 35383,
+ UNIFORM_SIZE: 35384,
+ UNIFORM_BLOCK_INDEX: 35386,
+ UNIFORM_OFFSET: 35387,
+ UNIFORM_ARRAY_STRIDE: 35388,
+ UNIFORM_MATRIX_STRIDE: 35389,
+ UNIFORM_IS_ROW_MAJOR: 35390,
+ UNIFORM_BLOCK_BINDING: 35391,
+ UNIFORM_BLOCK_DATA_SIZE: 35392,
+ UNIFORM_BLOCK_ACTIVE_UNIFORMS: 35394,
+ UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES: 35395,
+ UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER: 35396,
+ UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER: 35398,
+ INVALID_INDEX: 4294967295,
+ MAX_VERTEX_OUTPUT_COMPONENTS: 37154,
+ MAX_FRAGMENT_INPUT_COMPONENTS: 37157,
+ MAX_SERVER_WAIT_TIMEOUT: 37137,
+ OBJECT_TYPE: 37138,
+ SYNC_CONDITION: 37139,
+ SYNC_STATUS: 37140,
+ SYNC_FLAGS: 37141,
+ SYNC_FENCE: 37142,
+ SYNC_GPU_COMMANDS_COMPLETE: 37143,
+ UNSIGNALED: 37144,
+ SIGNALED: 37145,
+ ALREADY_SIGNALED: 37146,
+ TIMEOUT_EXPIRED: 37147,
+ CONDITION_SATISFIED: 37148,
+ WAIT_FAILED: 37149,
+ SYNC_FLUSH_COMMANDS_BIT: 1,
+ VERTEX_ATTRIB_ARRAY_DIVISOR: 35070,
+ ANY_SAMPLES_PASSED: 35887,
+ ANY_SAMPLES_PASSED_CONSERVATIVE: 36202,
+ SAMPLER_BINDING: 35097,
+ RGB10_A2UI: 36975,
+ INT_2_10_10_10_REV: 36255,
+ TRANSFORM_FEEDBACK: 36386,
+ TRANSFORM_FEEDBACK_PAUSED: 36387,
+ TRANSFORM_FEEDBACK_ACTIVE: 36388,
+ TRANSFORM_FEEDBACK_BINDING: 36389,
+ COMPRESSED_R11_EAC: 37488,
+ COMPRESSED_SIGNED_R11_EAC: 37489,
+ COMPRESSED_RG11_EAC: 37490,
+ COMPRESSED_SIGNED_RG11_EAC: 37491,
+ COMPRESSED_RGB8_ETC2: 37492,
+ COMPRESSED_SRGB8_ETC2: 37493,
+ COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 37494,
+ COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 37495,
+ COMPRESSED_RGBA8_ETC2_EAC: 37496,
+ COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 37497,
+ TEXTURE_IMMUTABLE_FORMAT: 37167,
+ MAX_ELEMENT_INDEX: 36203,
+ TEXTURE_IMMUTABLE_LEVELS: 33503,
+ MAX_TEXTURE_MAX_ANISOTROPY_EXT: 34047
+};
+var WebGLConstants_default = Object.freeze(WebGLConstants);
+
+// Source/Renderer/AutomaticUniforms.js
+var viewerPositionWCScratch = new Cartesian3_default();
+function AutomaticUniform(options) {
+ this._size = options.size;
+ this._datatype = options.datatype;
+ this.getValue = options.getValue;
+}
+var datatypeToGlsl = {};
+datatypeToGlsl[WebGLConstants_default.FLOAT] = "float";
+datatypeToGlsl[WebGLConstants_default.FLOAT_VEC2] = "vec2";
+datatypeToGlsl[WebGLConstants_default.FLOAT_VEC3] = "vec3";
+datatypeToGlsl[WebGLConstants_default.FLOAT_VEC4] = "vec4";
+datatypeToGlsl[WebGLConstants_default.INT] = "int";
+datatypeToGlsl[WebGLConstants_default.INT_VEC2] = "ivec2";
+datatypeToGlsl[WebGLConstants_default.INT_VEC3] = "ivec3";
+datatypeToGlsl[WebGLConstants_default.INT_VEC4] = "ivec4";
+datatypeToGlsl[WebGLConstants_default.BOOL] = "bool";
+datatypeToGlsl[WebGLConstants_default.BOOL_VEC2] = "bvec2";
+datatypeToGlsl[WebGLConstants_default.BOOL_VEC3] = "bvec3";
+datatypeToGlsl[WebGLConstants_default.BOOL_VEC4] = "bvec4";
+datatypeToGlsl[WebGLConstants_default.FLOAT_MAT2] = "mat2";
+datatypeToGlsl[WebGLConstants_default.FLOAT_MAT3] = "mat3";
+datatypeToGlsl[WebGLConstants_default.FLOAT_MAT4] = "mat4";
+datatypeToGlsl[WebGLConstants_default.SAMPLER_2D] = "sampler2D";
+datatypeToGlsl[WebGLConstants_default.SAMPLER_CUBE] = "samplerCube";
+AutomaticUniform.prototype.getDeclaration = function(name) {
+ let declaration = `uniform ${datatypeToGlsl[this._datatype]} ${name}`;
+ const size = this._size;
+ if (size === 1) {
+ declaration += ";";
+ } else {
+ declaration += `[${size.toString()}];`;
+ }
+ return declaration;
+};
+var AutomaticUniforms = {
+ czm_viewport: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC4,
+ getValue: function(uniformState) {
+ return uniformState.viewportCartesian4;
+ }
+ }),
+ czm_viewportOrthographic: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.viewportOrthographic;
+ }
+ }),
+ czm_viewportTransformation: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.viewportTransformation;
+ }
+ }),
+ czm_globeDepthTexture: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.SAMPLER_2D,
+ getValue: function(uniformState) {
+ return uniformState.globeDepthTexture;
+ }
+ }),
+ czm_model: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.model;
+ }
+ }),
+ czm_inverseModel: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.inverseModel;
+ }
+ }),
+ czm_view: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.view;
+ }
+ }),
+ czm_view3D: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.view3D;
+ }
+ }),
+ czm_viewRotation: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT3,
+ getValue: function(uniformState) {
+ return uniformState.viewRotation;
+ }
+ }),
+ czm_viewRotation3D: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT3,
+ getValue: function(uniformState) {
+ return uniformState.viewRotation3D;
+ }
+ }),
+ czm_inverseView: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.inverseView;
+ }
+ }),
+ czm_inverseView3D: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.inverseView3D;
+ }
+ }),
+ czm_inverseViewRotation: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT3,
+ getValue: function(uniformState) {
+ return uniformState.inverseViewRotation;
+ }
+ }),
+ czm_inverseViewRotation3D: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT3,
+ getValue: function(uniformState) {
+ return uniformState.inverseViewRotation3D;
+ }
+ }),
+ czm_projection: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.projection;
+ }
+ }),
+ czm_inverseProjection: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.inverseProjection;
+ }
+ }),
+ czm_infiniteProjection: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.infiniteProjection;
+ }
+ }),
+ czm_modelView: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.modelView;
+ }
+ }),
+ czm_modelView3D: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.modelView3D;
+ }
+ }),
+ czm_modelViewRelativeToEye: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.modelViewRelativeToEye;
+ }
+ }),
+ czm_inverseModelView: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.inverseModelView;
+ }
+ }),
+ czm_inverseModelView3D: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.inverseModelView3D;
+ }
+ }),
+ czm_viewProjection: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.viewProjection;
+ }
+ }),
+ czm_inverseViewProjection: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.inverseViewProjection;
+ }
+ }),
+ czm_modelViewProjection: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.modelViewProjection;
+ }
+ }),
+ czm_inverseModelViewProjection: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.inverseModelViewProjection;
+ }
+ }),
+ czm_modelViewProjectionRelativeToEye: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.modelViewProjectionRelativeToEye;
+ }
+ }),
+ czm_modelViewInfiniteProjection: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT4,
+ getValue: function(uniformState) {
+ return uniformState.modelViewInfiniteProjection;
+ }
+ }),
+ czm_orthographicIn3D: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.orthographicIn3D ? 1 : 0;
+ }
+ }),
+ czm_normal: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT3,
+ getValue: function(uniformState) {
+ return uniformState.normal;
+ }
+ }),
+ czm_normal3D: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT3,
+ getValue: function(uniformState) {
+ return uniformState.normal3D;
+ }
+ }),
+ czm_inverseNormal: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT3,
+ getValue: function(uniformState) {
+ return uniformState.inverseNormal;
+ }
+ }),
+ czm_inverseNormal3D: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT3,
+ getValue: function(uniformState) {
+ return uniformState.inverseNormal3D;
+ }
+ }),
+ czm_eyeHeight: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.eyeHeight;
+ }
+ }),
+ czm_eyeHeight2D: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC2,
+ getValue: function(uniformState) {
+ return uniformState.eyeHeight2D;
+ }
+ }),
+ czm_entireFrustum: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC2,
+ getValue: function(uniformState) {
+ return uniformState.entireFrustum;
+ }
+ }),
+ czm_currentFrustum: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC2,
+ getValue: function(uniformState) {
+ return uniformState.currentFrustum;
+ }
+ }),
+ czm_frustumPlanes: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC4,
+ getValue: function(uniformState) {
+ return uniformState.frustumPlanes;
+ }
+ }),
+ czm_farDepthFromNearPlusOne: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.farDepthFromNearPlusOne;
+ }
+ }),
+ czm_log2FarDepthFromNearPlusOne: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.log2FarDepthFromNearPlusOne;
+ }
+ }),
+ czm_oneOverLog2FarDepthFromNearPlusOne: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.oneOverLog2FarDepthFromNearPlusOne;
+ }
+ }),
+ czm_sunPositionWC: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.sunPositionWC;
+ }
+ }),
+ czm_sunPositionColumbusView: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.sunPositionColumbusView;
+ }
+ }),
+ czm_sunDirectionEC: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.sunDirectionEC;
+ }
+ }),
+ czm_sunDirectionWC: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.sunDirectionWC;
+ }
+ }),
+ czm_moonDirectionEC: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.moonDirectionEC;
+ }
+ }),
+ czm_lightDirectionEC: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.lightDirectionEC;
+ }
+ }),
+ czm_lightDirectionWC: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.lightDirectionWC;
+ }
+ }),
+ czm_lightColor: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.lightColor;
+ }
+ }),
+ czm_lightColorHdr: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.lightColorHdr;
+ }
+ }),
+ czm_encodedCameraPositionMCHigh: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.encodedCameraPositionMCHigh;
+ }
+ }),
+ czm_encodedCameraPositionMCLow: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.encodedCameraPositionMCLow;
+ }
+ }),
+ czm_viewerPositionWC: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return Matrix4_default.getTranslation(
+ uniformState.inverseView,
+ viewerPositionWCScratch
+ );
+ }
+ }),
+ czm_frameNumber: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.frameState.frameNumber;
+ }
+ }),
+ czm_morphTime: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.frameState.morphTime;
+ }
+ }),
+ czm_sceneMode: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.frameState.mode;
+ }
+ }),
+ czm_pass: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.pass;
+ }
+ }),
+ czm_backgroundColor: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC4,
+ getValue: function(uniformState) {
+ return uniformState.backgroundColor;
+ }
+ }),
+ czm_brdfLut: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.SAMPLER_2D,
+ getValue: function(uniformState) {
+ return uniformState.brdfLut;
+ }
+ }),
+ czm_environmentMap: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.SAMPLER_CUBE,
+ getValue: function(uniformState) {
+ return uniformState.environmentMap;
+ }
+ }),
+ czm_specularEnvironmentMaps: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.SAMPLER_2D,
+ getValue: function(uniformState) {
+ return uniformState.specularEnvironmentMaps;
+ }
+ }),
+ czm_specularEnvironmentMapSize: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC2,
+ getValue: function(uniformState) {
+ return uniformState.specularEnvironmentMapsDimensions;
+ }
+ }),
+ czm_specularEnvironmentMapsMaximumLOD: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.specularEnvironmentMapsMaximumLOD;
+ }
+ }),
+ czm_sphericalHarmonicCoefficients: new AutomaticUniform({
+ size: 9,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.sphericalHarmonicCoefficients;
+ }
+ }),
+ czm_temeToPseudoFixed: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_MAT3,
+ getValue: function(uniformState) {
+ return uniformState.temeToPseudoFixedMatrix;
+ }
+ }),
+ czm_pixelRatio: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.pixelRatio;
+ }
+ }),
+ czm_fogDensity: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.fogDensity;
+ }
+ }),
+ czm_splitPosition: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.splitPosition;
+ }
+ }),
+ czm_geometricToleranceOverMeter: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.geometricToleranceOverMeter;
+ }
+ }),
+ czm_minimumDisableDepthTestDistance: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.minimumDisableDepthTestDistance;
+ }
+ }),
+ czm_invertClassificationColor: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC4,
+ getValue: function(uniformState) {
+ return uniformState.invertClassificationColor;
+ }
+ }),
+ czm_gamma: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT,
+ getValue: function(uniformState) {
+ return uniformState.gamma;
+ }
+ }),
+ czm_ellipsoidRadii: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.ellipsoid.radii;
+ }
+ }),
+ czm_ellipsoidInverseRadii: new AutomaticUniform({
+ size: 1,
+ datatype: WebGLConstants_default.FLOAT_VEC3,
+ getValue: function(uniformState) {
+ return uniformState.ellipsoid.oneOverRadii;
+ }
+ })
+};
+var AutomaticUniforms_default = AutomaticUniforms;
+
+// Source/Core/createGuid.js
+function createGuid() {
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
+ const r = Math.random() * 16 | 0;
+ const v7 = c === "x" ? r : r & 3 | 8;
+ return v7.toString(16);
+ });
+}
+var createGuid_default = createGuid;
+
+// Source/Core/destroyObject.js
+function returnTrue() {
+ return true;
+}
+function destroyObject(object2, message) {
+ message = defaultValue_default(
+ message,
+ "This object was destroyed, i.e., destroy() was called."
+ );
+ function throwOnDestroyed() {
+ throw new DeveloperError_default(message);
+ }
+ for (const key in object2) {
+ if (typeof object2[key] === "function") {
+ object2[key] = throwOnDestroyed;
+ }
+ }
+ object2.isDestroyed = returnTrue;
+ return void 0;
+}
+var destroyObject_default = destroyObject;
+
+// Source/Core/IndexDatatype.js
+var IndexDatatype = {
+ UNSIGNED_BYTE: WebGLConstants_default.UNSIGNED_BYTE,
+ UNSIGNED_SHORT: WebGLConstants_default.UNSIGNED_SHORT,
+ UNSIGNED_INT: WebGLConstants_default.UNSIGNED_INT
+};
+IndexDatatype.getSizeInBytes = function(indexDatatype) {
+ switch (indexDatatype) {
+ case IndexDatatype.UNSIGNED_BYTE:
+ return Uint8Array.BYTES_PER_ELEMENT;
+ case IndexDatatype.UNSIGNED_SHORT:
+ return Uint16Array.BYTES_PER_ELEMENT;
+ case IndexDatatype.UNSIGNED_INT:
+ return Uint32Array.BYTES_PER_ELEMENT;
+ }
+ throw new DeveloperError_default(
+ "indexDatatype is required and must be a valid IndexDatatype constant."
+ );
+};
+IndexDatatype.fromSizeInBytes = function(sizeInBytes) {
+ switch (sizeInBytes) {
+ case 2:
+ return IndexDatatype.UNSIGNED_SHORT;
+ case 4:
+ return IndexDatatype.UNSIGNED_INT;
+ case 1:
+ return IndexDatatype.UNSIGNED_BYTE;
+ default:
+ throw new DeveloperError_default(
+ "Size in bytes cannot be mapped to an IndexDatatype"
+ );
+ }
+};
+IndexDatatype.validate = function(indexDatatype) {
+ return defined_default(indexDatatype) && (indexDatatype === IndexDatatype.UNSIGNED_BYTE || indexDatatype === IndexDatatype.UNSIGNED_SHORT || indexDatatype === IndexDatatype.UNSIGNED_INT);
+};
+IndexDatatype.createTypedArray = function(numberOfVertices, indicesLengthOrArray) {
+ if (!defined_default(numberOfVertices)) {
+ throw new DeveloperError_default("numberOfVertices is required.");
+ }
+ if (numberOfVertices >= Math_default.SIXTY_FOUR_KILOBYTES) {
+ return new Uint32Array(indicesLengthOrArray);
+ }
+ return new Uint16Array(indicesLengthOrArray);
+};
+IndexDatatype.createTypedArrayFromArrayBuffer = function(numberOfVertices, sourceArray, byteOffset, length3) {
+ if (!defined_default(numberOfVertices)) {
+ throw new DeveloperError_default("numberOfVertices is required.");
+ }
+ if (!defined_default(sourceArray)) {
+ throw new DeveloperError_default("sourceArray is required.");
+ }
+ if (!defined_default(byteOffset)) {
+ throw new DeveloperError_default("byteOffset is required.");
+ }
+ if (numberOfVertices >= Math_default.SIXTY_FOUR_KILOBYTES) {
+ return new Uint32Array(sourceArray, byteOffset, length3);
+ }
+ return new Uint16Array(sourceArray, byteOffset, length3);
+};
+IndexDatatype.fromTypedArray = function(array) {
+ if (array instanceof Uint8Array) {
+ return IndexDatatype.UNSIGNED_BYTE;
+ }
+ if (array instanceof Uint16Array) {
+ return IndexDatatype.UNSIGNED_SHORT;
+ }
+ if (array instanceof Uint32Array) {
+ return IndexDatatype.UNSIGNED_INT;
+ }
+ throw new DeveloperError_default(
+ "array must be a Uint8Array, Uint16Array, or Uint32Array."
+ );
+};
+var IndexDatatype_default = Object.freeze(IndexDatatype);
+
+// Source/Renderer/BufferUsage.js
+var BufferUsage = {
+ STREAM_DRAW: WebGLConstants_default.STREAM_DRAW,
+ STATIC_DRAW: WebGLConstants_default.STATIC_DRAW,
+ DYNAMIC_DRAW: WebGLConstants_default.DYNAMIC_DRAW,
+ validate: function(bufferUsage) {
+ return bufferUsage === BufferUsage.STREAM_DRAW || bufferUsage === BufferUsage.STATIC_DRAW || bufferUsage === BufferUsage.DYNAMIC_DRAW;
+ }
+};
+var BufferUsage_default = Object.freeze(BufferUsage);
+
+// Source/Renderer/Buffer.js
+function Buffer2(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.context", options.context);
+ if (!defined_default(options.typedArray) && !defined_default(options.sizeInBytes)) {
+ throw new DeveloperError_default(
+ "Either options.sizeInBytes or options.typedArray is required."
+ );
+ }
+ if (defined_default(options.typedArray) && defined_default(options.sizeInBytes)) {
+ throw new DeveloperError_default(
+ "Cannot pass in both options.sizeInBytes and options.typedArray."
+ );
+ }
+ if (defined_default(options.typedArray)) {
+ Check_default.typeOf.object("options.typedArray", options.typedArray);
+ Check_default.typeOf.number(
+ "options.typedArray.byteLength",
+ options.typedArray.byteLength
+ );
+ }
+ if (!BufferUsage_default.validate(options.usage)) {
+ throw new DeveloperError_default("usage is invalid.");
+ }
+ const gl = options.context._gl;
+ const bufferTarget = options.bufferTarget;
+ const typedArray = options.typedArray;
+ let sizeInBytes = options.sizeInBytes;
+ const usage = options.usage;
+ const hasArray = defined_default(typedArray);
+ if (hasArray) {
+ sizeInBytes = typedArray.byteLength;
+ }
+ Check_default.typeOf.number.greaterThan("sizeInBytes", sizeInBytes, 0);
+ const buffer = gl.createBuffer();
+ gl.bindBuffer(bufferTarget, buffer);
+ gl.bufferData(bufferTarget, hasArray ? typedArray : sizeInBytes, usage);
+ gl.bindBuffer(bufferTarget, null);
+ this._id = createGuid_default();
+ this._gl = gl;
+ this._webgl2 = options.context._webgl2;
+ this._bufferTarget = bufferTarget;
+ this._sizeInBytes = sizeInBytes;
+ this._usage = usage;
+ this._buffer = buffer;
+ this.vertexArrayDestroyable = true;
+}
+Buffer2.createVertexBuffer = function(options) {
+ Check_default.defined("options.context", options.context);
+ return new Buffer2({
+ context: options.context,
+ bufferTarget: WebGLConstants_default.ARRAY_BUFFER,
+ typedArray: options.typedArray,
+ sizeInBytes: options.sizeInBytes,
+ usage: options.usage
+ });
+};
+Buffer2.createIndexBuffer = function(options) {
+ Check_default.defined("options.context", options.context);
+ if (!IndexDatatype_default.validate(options.indexDatatype)) {
+ throw new DeveloperError_default("Invalid indexDatatype.");
+ }
+ if (options.indexDatatype === IndexDatatype_default.UNSIGNED_INT && !options.context.elementIndexUint) {
+ throw new DeveloperError_default(
+ "IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint."
+ );
+ }
+ const context = options.context;
+ const indexDatatype = options.indexDatatype;
+ const bytesPerIndex = IndexDatatype_default.getSizeInBytes(indexDatatype);
+ const buffer = new Buffer2({
+ context,
+ bufferTarget: WebGLConstants_default.ELEMENT_ARRAY_BUFFER,
+ typedArray: options.typedArray,
+ sizeInBytes: options.sizeInBytes,
+ usage: options.usage
+ });
+ const numberOfIndices = buffer.sizeInBytes / bytesPerIndex;
+ Object.defineProperties(buffer, {
+ indexDatatype: {
+ get: function() {
+ return indexDatatype;
+ }
+ },
+ bytesPerIndex: {
+ get: function() {
+ return bytesPerIndex;
+ }
+ },
+ numberOfIndices: {
+ get: function() {
+ return numberOfIndices;
+ }
+ }
+ });
+ return buffer;
+};
+Object.defineProperties(Buffer2.prototype, {
+ sizeInBytes: {
+ get: function() {
+ return this._sizeInBytes;
+ }
+ },
+ usage: {
+ get: function() {
+ return this._usage;
+ }
+ }
+});
+Buffer2.prototype._getBuffer = function() {
+ return this._buffer;
+};
+Buffer2.prototype.copyFromArrayView = function(arrayView, offsetInBytes) {
+ offsetInBytes = defaultValue_default(offsetInBytes, 0);
+ Check_default.defined("arrayView", arrayView);
+ Check_default.typeOf.number.lessThanOrEquals(
+ "offsetInBytes + arrayView.byteLength",
+ offsetInBytes + arrayView.byteLength,
+ this._sizeInBytes
+ );
+ const gl = this._gl;
+ const target = this._bufferTarget;
+ gl.bindBuffer(target, this._buffer);
+ gl.bufferSubData(target, offsetInBytes, arrayView);
+ gl.bindBuffer(target, null);
+};
+Buffer2.prototype.copyFromBuffer = function(readBuffer, readOffset, writeOffset, sizeInBytes) {
+ if (!this._webgl2) {
+ throw new DeveloperError_default("A WebGL 2 context is required.");
+ }
+ if (!defined_default(readBuffer)) {
+ throw new DeveloperError_default("readBuffer must be defined.");
+ }
+ if (!defined_default(sizeInBytes) || sizeInBytes <= 0) {
+ throw new DeveloperError_default(
+ "sizeInBytes must be defined and be greater than zero."
+ );
+ }
+ if (!defined_default(readOffset) || readOffset < 0 || readOffset + sizeInBytes > readBuffer._sizeInBytes) {
+ throw new DeveloperError_default(
+ "readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes."
+ );
+ }
+ if (!defined_default(writeOffset) || writeOffset < 0 || writeOffset + sizeInBytes > this._sizeInBytes) {
+ throw new DeveloperError_default(
+ "writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes."
+ );
+ }
+ if (this._buffer === readBuffer._buffer && (writeOffset >= readOffset && writeOffset < readOffset + sizeInBytes || readOffset > writeOffset && readOffset < writeOffset + sizeInBytes)) {
+ throw new DeveloperError_default(
+ "When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap."
+ );
+ }
+ if (this._bufferTarget === WebGLConstants_default.ELEMENT_ARRAY_BUFFER && readBuffer._bufferTarget !== WebGLConstants_default.ELEMENT_ARRAY_BUFFER || this._bufferTarget !== WebGLConstants_default.ELEMENT_ARRAY_BUFFER && readBuffer._bufferTarget === WebGLConstants_default.ELEMENT_ARRAY_BUFFER) {
+ throw new DeveloperError_default(
+ "Can not copy an index buffer into another buffer type."
+ );
+ }
+ const readTarget = WebGLConstants_default.COPY_READ_BUFFER;
+ const writeTarget = WebGLConstants_default.COPY_WRITE_BUFFER;
+ const gl = this._gl;
+ gl.bindBuffer(writeTarget, this._buffer);
+ gl.bindBuffer(readTarget, readBuffer._buffer);
+ gl.copyBufferSubData(
+ readTarget,
+ writeTarget,
+ readOffset,
+ writeOffset,
+ sizeInBytes
+ );
+ gl.bindBuffer(writeTarget, null);
+ gl.bindBuffer(readTarget, null);
+};
+Buffer2.prototype.getBufferData = function(arrayView, sourceOffset, destinationOffset, length3) {
+ sourceOffset = defaultValue_default(sourceOffset, 0);
+ destinationOffset = defaultValue_default(destinationOffset, 0);
+ if (!this._webgl2) {
+ throw new DeveloperError_default("A WebGL 2 context is required.");
+ }
+ if (!defined_default(arrayView)) {
+ throw new DeveloperError_default("arrayView is required.");
+ }
+ let copyLength;
+ let elementSize;
+ let arrayLength = arrayView.byteLength;
+ if (!defined_default(length3)) {
+ if (defined_default(arrayLength)) {
+ copyLength = arrayLength - destinationOffset;
+ elementSize = 1;
+ } else {
+ arrayLength = arrayView.length;
+ copyLength = arrayLength - destinationOffset;
+ elementSize = arrayView.BYTES_PER_ELEMENT;
+ }
+ } else {
+ copyLength = length3;
+ if (defined_default(arrayLength)) {
+ elementSize = 1;
+ } else {
+ arrayLength = arrayView.length;
+ elementSize = arrayView.BYTES_PER_ELEMENT;
+ }
+ }
+ if (destinationOffset < 0 || destinationOffset > arrayLength) {
+ throw new DeveloperError_default(
+ "destinationOffset must be greater than zero and less than the arrayView length."
+ );
+ }
+ if (destinationOffset + copyLength > arrayLength) {
+ throw new DeveloperError_default(
+ "destinationOffset + length must be less than or equal to the arrayViewLength."
+ );
+ }
+ if (sourceOffset < 0 || sourceOffset > this._sizeInBytes) {
+ throw new DeveloperError_default(
+ "sourceOffset must be greater than zero and less than the buffers size."
+ );
+ }
+ if (sourceOffset + copyLength * elementSize > this._sizeInBytes) {
+ throw new DeveloperError_default(
+ "sourceOffset + length must be less than the buffers size."
+ );
+ }
+ const gl = this._gl;
+ const target = WebGLConstants_default.COPY_READ_BUFFER;
+ gl.bindBuffer(target, this._buffer);
+ gl.getBufferSubData(
+ target,
+ sourceOffset,
+ arrayView,
+ destinationOffset,
+ length3
+ );
+ gl.bindBuffer(target, null);
+};
+Buffer2.prototype.isDestroyed = function() {
+ return false;
+};
+Buffer2.prototype.destroy = function() {
+ this._gl.deleteBuffer(this._buffer);
+ return destroyObject_default(this);
+};
+var Buffer_default = Buffer2;
+
+// Source/Core/Fullscreen.js
+var _supportsFullscreen;
+var _names = {
+ requestFullscreen: void 0,
+ exitFullscreen: void 0,
+ fullscreenEnabled: void 0,
+ fullscreenElement: void 0,
+ fullscreenchange: void 0,
+ fullscreenerror: void 0
+};
+var Fullscreen = {};
+Object.defineProperties(Fullscreen, {
+ element: {
+ get: function() {
+ if (!Fullscreen.supportsFullscreen()) {
+ return void 0;
+ }
+ return document[_names.fullscreenElement];
+ }
+ },
+ changeEventName: {
+ get: function() {
+ if (!Fullscreen.supportsFullscreen()) {
+ return void 0;
+ }
+ return _names.fullscreenchange;
+ }
+ },
+ errorEventName: {
+ get: function() {
+ if (!Fullscreen.supportsFullscreen()) {
+ return void 0;
+ }
+ return _names.fullscreenerror;
+ }
+ },
+ enabled: {
+ get: function() {
+ if (!Fullscreen.supportsFullscreen()) {
+ return void 0;
+ }
+ return document[_names.fullscreenEnabled];
+ }
+ },
+ fullscreen: {
+ get: function() {
+ if (!Fullscreen.supportsFullscreen()) {
+ return void 0;
+ }
+ return Fullscreen.element !== null;
+ }
+ }
+});
+Fullscreen.supportsFullscreen = function() {
+ if (defined_default(_supportsFullscreen)) {
+ return _supportsFullscreen;
+ }
+ _supportsFullscreen = false;
+ const body = document.body;
+ if (typeof body.requestFullscreen === "function") {
+ _names.requestFullscreen = "requestFullscreen";
+ _names.exitFullscreen = "exitFullscreen";
+ _names.fullscreenEnabled = "fullscreenEnabled";
+ _names.fullscreenElement = "fullscreenElement";
+ _names.fullscreenchange = "fullscreenchange";
+ _names.fullscreenerror = "fullscreenerror";
+ _supportsFullscreen = true;
+ return _supportsFullscreen;
+ }
+ const prefixes = ["webkit", "moz", "o", "ms", "khtml"];
+ let name;
+ for (let i = 0, len = prefixes.length; i < len; ++i) {
+ const prefix = prefixes[i];
+ name = `${prefix}RequestFullscreen`;
+ if (typeof body[name] === "function") {
+ _names.requestFullscreen = name;
+ _supportsFullscreen = true;
+ } else {
+ name = `${prefix}RequestFullScreen`;
+ if (typeof body[name] === "function") {
+ _names.requestFullscreen = name;
+ _supportsFullscreen = true;
+ }
+ }
+ name = `${prefix}ExitFullscreen`;
+ if (typeof document[name] === "function") {
+ _names.exitFullscreen = name;
+ } else {
+ name = `${prefix}CancelFullScreen`;
+ if (typeof document[name] === "function") {
+ _names.exitFullscreen = name;
+ }
+ }
+ name = `${prefix}FullscreenEnabled`;
+ if (document[name] !== void 0) {
+ _names.fullscreenEnabled = name;
+ } else {
+ name = `${prefix}FullScreenEnabled`;
+ if (document[name] !== void 0) {
+ _names.fullscreenEnabled = name;
+ }
+ }
+ name = `${prefix}FullscreenElement`;
+ if (document[name] !== void 0) {
+ _names.fullscreenElement = name;
+ } else {
+ name = `${prefix}FullScreenElement`;
+ if (document[name] !== void 0) {
+ _names.fullscreenElement = name;
+ }
+ }
+ name = `${prefix}fullscreenchange`;
+ if (document[`on${name}`] !== void 0) {
+ if (prefix === "ms") {
+ name = "MSFullscreenChange";
+ }
+ _names.fullscreenchange = name;
+ }
+ name = `${prefix}fullscreenerror`;
+ if (document[`on${name}`] !== void 0) {
+ if (prefix === "ms") {
+ name = "MSFullscreenError";
+ }
+ _names.fullscreenerror = name;
+ }
+ }
+ return _supportsFullscreen;
+};
+Fullscreen.requestFullscreen = function(element, vrDevice) {
+ if (!Fullscreen.supportsFullscreen()) {
+ return;
+ }
+ element[_names.requestFullscreen]({ vrDisplay: vrDevice });
+};
+Fullscreen.exitFullscreen = function() {
+ if (!Fullscreen.supportsFullscreen()) {
+ return;
+ }
+ document[_names.exitFullscreen]();
+};
+Fullscreen._names = _names;
+var Fullscreen_default = Fullscreen;
+
+// Source/Core/FeatureDetection.js
+var theNavigator;
+if (typeof navigator !== "undefined") {
+ theNavigator = navigator;
+} else {
+ theNavigator = {};
+}
+function extractVersion(versionString) {
+ const parts = versionString.split(".");
+ for (let i = 0, len = parts.length; i < len; ++i) {
+ parts[i] = parseInt(parts[i], 10);
+ }
+ return parts;
+}
+var isChromeResult;
+var chromeVersionResult;
+function isChrome() {
+ if (!defined_default(isChromeResult)) {
+ isChromeResult = false;
+ if (!isEdge()) {
+ const fields = / Chrome\/([\.0-9]+)/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isChromeResult = true;
+ chromeVersionResult = extractVersion(fields[1]);
+ }
+ }
+ }
+ return isChromeResult;
+}
+function chromeVersion() {
+ return isChrome() && chromeVersionResult;
+}
+var isSafariResult;
+var safariVersionResult;
+function isSafari() {
+ if (!defined_default(isSafariResult)) {
+ isSafariResult = false;
+ if (!isChrome() && !isEdge() && / Safari\/[\.0-9]+/.test(theNavigator.userAgent)) {
+ const fields = / Version\/([\.0-9]+)/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isSafariResult = true;
+ safariVersionResult = extractVersion(fields[1]);
+ }
+ }
+ }
+ return isSafariResult;
+}
+function safariVersion() {
+ return isSafari() && safariVersionResult;
+}
+var isWebkitResult;
+var webkitVersionResult;
+function isWebkit() {
+ if (!defined_default(isWebkitResult)) {
+ isWebkitResult = false;
+ const fields = / AppleWebKit\/([\.0-9]+)(\+?)/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isWebkitResult = true;
+ webkitVersionResult = extractVersion(fields[1]);
+ webkitVersionResult.isNightly = !!fields[2];
+ }
+ }
+ return isWebkitResult;
+}
+function webkitVersion() {
+ return isWebkit() && webkitVersionResult;
+}
+var isInternetExplorerResult;
+var internetExplorerVersionResult;
+function isInternetExplorer() {
+ if (!defined_default(isInternetExplorerResult)) {
+ isInternetExplorerResult = false;
+ let fields;
+ if (theNavigator.appName === "Microsoft Internet Explorer") {
+ fields = /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isInternetExplorerResult = true;
+ internetExplorerVersionResult = extractVersion(fields[1]);
+ }
+ } else if (theNavigator.appName === "Netscape") {
+ fields = /Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(
+ theNavigator.userAgent
+ );
+ if (fields !== null) {
+ isInternetExplorerResult = true;
+ internetExplorerVersionResult = extractVersion(fields[1]);
+ }
+ }
+ }
+ return isInternetExplorerResult;
+}
+function internetExplorerVersion() {
+ return isInternetExplorer() && internetExplorerVersionResult;
+}
+var isEdgeResult;
+var edgeVersionResult;
+function isEdge() {
+ if (!defined_default(isEdgeResult)) {
+ isEdgeResult = false;
+ const fields = / Edg\/([\.0-9]+)/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isEdgeResult = true;
+ edgeVersionResult = extractVersion(fields[1]);
+ }
+ }
+ return isEdgeResult;
+}
+function edgeVersion() {
+ return isEdge() && edgeVersionResult;
+}
+var isFirefoxResult;
+var firefoxVersionResult;
+function isFirefox() {
+ if (!defined_default(isFirefoxResult)) {
+ isFirefoxResult = false;
+ const fields = /Firefox\/([\.0-9]+)/.exec(theNavigator.userAgent);
+ if (fields !== null) {
+ isFirefoxResult = true;
+ firefoxVersionResult = extractVersion(fields[1]);
+ }
+ }
+ return isFirefoxResult;
+}
+var isWindowsResult;
+function isWindows() {
+ if (!defined_default(isWindowsResult)) {
+ isWindowsResult = /Windows/i.test(theNavigator.appVersion);
+ }
+ return isWindowsResult;
+}
+var isIPadOrIOSResult;
+function isIPadOrIOS() {
+ if (!defined_default(isIPadOrIOSResult)) {
+ isIPadOrIOSResult = navigator.platform === "iPhone" || navigator.platform === "iPod" || navigator.platform === "iPad";
+ }
+ return isIPadOrIOSResult;
+}
+function firefoxVersion() {
+ return isFirefox() && firefoxVersionResult;
+}
+var hasPointerEvents;
+function supportsPointerEvents() {
+ if (!defined_default(hasPointerEvents)) {
+ hasPointerEvents = !isFirefox() && typeof PointerEvent !== "undefined" && (!defined_default(theNavigator.pointerEnabled) || theNavigator.pointerEnabled);
+ }
+ return hasPointerEvents;
+}
+var imageRenderingValueResult;
+var supportsImageRenderingPixelatedResult;
+function supportsImageRenderingPixelated() {
+ if (!defined_default(supportsImageRenderingPixelatedResult)) {
+ const canvas = document.createElement("canvas");
+ canvas.setAttribute(
+ "style",
+ "image-rendering: -moz-crisp-edges;image-rendering: pixelated;"
+ );
+ const tmp2 = canvas.style.imageRendering;
+ supportsImageRenderingPixelatedResult = defined_default(tmp2) && tmp2 !== "";
+ if (supportsImageRenderingPixelatedResult) {
+ imageRenderingValueResult = tmp2;
+ }
+ }
+ return supportsImageRenderingPixelatedResult;
+}
+function imageRenderingValue() {
+ return supportsImageRenderingPixelated() ? imageRenderingValueResult : void 0;
+}
+function supportsWebP() {
+ if (!supportsWebP.initialized) {
+ throw new DeveloperError_default(
+ "You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP"
+ );
+ }
+ return supportsWebP._result;
+}
+supportsWebP._promise = void 0;
+supportsWebP._result = void 0;
+supportsWebP.initialize = function() {
+ if (defined_default(supportsWebP._promise)) {
+ return supportsWebP._promise;
+ }
+ supportsWebP._promise = new Promise((resolve2) => {
+ const image = new Image();
+ image.onload = function() {
+ supportsWebP._result = image.width > 0 && image.height > 0;
+ resolve2(supportsWebP._result);
+ };
+ image.onerror = function() {
+ supportsWebP._result = false;
+ resolve2(supportsWebP._result);
+ };
+ image.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA";
+ });
+ return supportsWebP._promise;
+};
+Object.defineProperties(supportsWebP, {
+ initialized: {
+ get: function() {
+ return defined_default(supportsWebP._result);
+ }
+ }
+});
+var typedArrayTypes = [];
+if (typeof ArrayBuffer !== "undefined") {
+ typedArrayTypes.push(
+ Int8Array,
+ Uint8Array,
+ Int16Array,
+ Uint16Array,
+ Int32Array,
+ Uint32Array,
+ Float32Array,
+ Float64Array
+ );
+ if (typeof Uint8ClampedArray !== "undefined") {
+ typedArrayTypes.push(Uint8ClampedArray);
+ }
+ if (typeof Uint8ClampedArray !== "undefined") {
+ typedArrayTypes.push(Uint8ClampedArray);
+ }
+ if (typeof BigInt64Array !== "undefined") {
+ typedArrayTypes.push(BigInt64Array);
+ }
+ if (typeof BigUint64Array !== "undefined") {
+ typedArrayTypes.push(BigUint64Array);
+ }
+}
+var FeatureDetection = {
+ isChrome,
+ chromeVersion,
+ isSafari,
+ safariVersion,
+ isWebkit,
+ webkitVersion,
+ isInternetExplorer,
+ internetExplorerVersion,
+ isEdge,
+ edgeVersion,
+ isFirefox,
+ firefoxVersion,
+ isWindows,
+ isIPadOrIOS,
+ hardwareConcurrency: defaultValue_default(theNavigator.hardwareConcurrency, 3),
+ supportsPointerEvents,
+ supportsImageRenderingPixelated,
+ supportsWebP,
+ imageRenderingValue,
+ typedArrayTypes
+};
+FeatureDetection.supportsBasis = function(scene) {
+ return FeatureDetection.supportsWebAssembly() && scene.context.supportsBasis;
+};
+FeatureDetection.supportsFullscreen = function() {
+ return Fullscreen_default.supportsFullscreen();
+};
+FeatureDetection.supportsTypedArrays = function() {
+ return typeof ArrayBuffer !== "undefined";
+};
+FeatureDetection.supportsBigInt64Array = function() {
+ return typeof BigInt64Array !== "undefined";
+};
+FeatureDetection.supportsBigUint64Array = function() {
+ return typeof BigUint64Array !== "undefined";
+};
+FeatureDetection.supportsBigInt = function() {
+ return typeof BigInt !== "undefined";
+};
+FeatureDetection.supportsWebWorkers = function() {
+ return typeof Worker !== "undefined";
+};
+FeatureDetection.supportsWebAssembly = function() {
+ return typeof WebAssembly !== "undefined";
+};
+var FeatureDetection_default = FeatureDetection;
+
+// Source/Core/Color.js
+function hue2rgb(m1, m2, h) {
+ if (h < 0) {
+ h += 1;
+ }
+ if (h > 1) {
+ h -= 1;
+ }
+ if (h * 6 < 1) {
+ return m1 + (m2 - m1) * 6 * h;
+ }
+ if (h * 2 < 1) {
+ return m2;
+ }
+ if (h * 3 < 2) {
+ return m1 + (m2 - m1) * (2 / 3 - h) * 6;
+ }
+ return m1;
+}
+function Color(red, green, blue, alpha) {
+ this.red = defaultValue_default(red, 1);
+ this.green = defaultValue_default(green, 1);
+ this.blue = defaultValue_default(blue, 1);
+ this.alpha = defaultValue_default(alpha, 1);
+}
+Color.fromCartesian4 = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ if (!defined_default(result)) {
+ return new Color(cartesian11.x, cartesian11.y, cartesian11.z, cartesian11.w);
+ }
+ result.red = cartesian11.x;
+ result.green = cartesian11.y;
+ result.blue = cartesian11.z;
+ result.alpha = cartesian11.w;
+ return result;
+};
+Color.fromBytes = function(red, green, blue, alpha, result) {
+ red = Color.byteToFloat(defaultValue_default(red, 255));
+ green = Color.byteToFloat(defaultValue_default(green, 255));
+ blue = Color.byteToFloat(defaultValue_default(blue, 255));
+ alpha = Color.byteToFloat(defaultValue_default(alpha, 255));
+ if (!defined_default(result)) {
+ return new Color(red, green, blue, alpha);
+ }
+ result.red = red;
+ result.green = green;
+ result.blue = blue;
+ result.alpha = alpha;
+ return result;
+};
+Color.fromAlpha = function(color, alpha, result) {
+ Check_default.typeOf.object("color", color);
+ Check_default.typeOf.number("alpha", alpha);
+ if (!defined_default(result)) {
+ return new Color(color.red, color.green, color.blue, alpha);
+ }
+ result.red = color.red;
+ result.green = color.green;
+ result.blue = color.blue;
+ result.alpha = alpha;
+ return result;
+};
+var scratchArrayBuffer;
+var scratchUint32Array;
+var scratchUint8Array;
+if (FeatureDetection_default.supportsTypedArrays()) {
+ scratchArrayBuffer = new ArrayBuffer(4);
+ scratchUint32Array = new Uint32Array(scratchArrayBuffer);
+ scratchUint8Array = new Uint8Array(scratchArrayBuffer);
+}
+Color.fromRgba = function(rgba, result) {
+ scratchUint32Array[0] = rgba;
+ return Color.fromBytes(
+ scratchUint8Array[0],
+ scratchUint8Array[1],
+ scratchUint8Array[2],
+ scratchUint8Array[3],
+ result
+ );
+};
+Color.fromHsl = function(hue, saturation, lightness, alpha, result) {
+ hue = defaultValue_default(hue, 0) % 1;
+ saturation = defaultValue_default(saturation, 0);
+ lightness = defaultValue_default(lightness, 0);
+ alpha = defaultValue_default(alpha, 1);
+ let red = lightness;
+ let green = lightness;
+ let blue = lightness;
+ if (saturation !== 0) {
+ let m2;
+ if (lightness < 0.5) {
+ m2 = lightness * (1 + saturation);
+ } else {
+ m2 = lightness + saturation - lightness * saturation;
+ }
+ const m1 = 2 * lightness - m2;
+ red = hue2rgb(m1, m2, hue + 1 / 3);
+ green = hue2rgb(m1, m2, hue);
+ blue = hue2rgb(m1, m2, hue - 1 / 3);
+ }
+ if (!defined_default(result)) {
+ return new Color(red, green, blue, alpha);
+ }
+ result.red = red;
+ result.green = green;
+ result.blue = blue;
+ result.alpha = alpha;
+ return result;
+};
+Color.fromRandom = function(options, result) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ let red = options.red;
+ if (!defined_default(red)) {
+ const minimumRed = defaultValue_default(options.minimumRed, 0);
+ const maximumRed = defaultValue_default(options.maximumRed, 1);
+ Check_default.typeOf.number.lessThanOrEquals("minimumRed", minimumRed, maximumRed);
+ red = minimumRed + Math_default.nextRandomNumber() * (maximumRed - minimumRed);
+ }
+ let green = options.green;
+ if (!defined_default(green)) {
+ const minimumGreen = defaultValue_default(options.minimumGreen, 0);
+ const maximumGreen = defaultValue_default(options.maximumGreen, 1);
+ Check_default.typeOf.number.lessThanOrEquals(
+ "minimumGreen",
+ minimumGreen,
+ maximumGreen
+ );
+ green = minimumGreen + Math_default.nextRandomNumber() * (maximumGreen - minimumGreen);
+ }
+ let blue = options.blue;
+ if (!defined_default(blue)) {
+ const minimumBlue = defaultValue_default(options.minimumBlue, 0);
+ const maximumBlue = defaultValue_default(options.maximumBlue, 1);
+ Check_default.typeOf.number.lessThanOrEquals(
+ "minimumBlue",
+ minimumBlue,
+ maximumBlue
+ );
+ blue = minimumBlue + Math_default.nextRandomNumber() * (maximumBlue - minimumBlue);
+ }
+ let alpha = options.alpha;
+ if (!defined_default(alpha)) {
+ const minimumAlpha = defaultValue_default(options.minimumAlpha, 0);
+ const maximumAlpha = defaultValue_default(options.maximumAlpha, 1);
+ Check_default.typeOf.number.lessThanOrEquals(
+ "minumumAlpha",
+ minimumAlpha,
+ maximumAlpha
+ );
+ alpha = minimumAlpha + Math_default.nextRandomNumber() * (maximumAlpha - minimumAlpha);
+ }
+ if (!defined_default(result)) {
+ return new Color(red, green, blue, alpha);
+ }
+ result.red = red;
+ result.green = green;
+ result.blue = blue;
+ result.alpha = alpha;
+ return result;
+};
+var rgbaMatcher = /^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i;
+var rrggbbaaMatcher = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i;
+var rgbParenthesesMatcher = /^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i;
+var hslParenthesesMatcher = /^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;
+Color.fromCssColorString = function(color, result) {
+ Check_default.typeOf.string("color", color);
+ if (!defined_default(result)) {
+ result = new Color();
+ }
+ color = color.replace(/\s/g, "");
+ const namedColor = Color[color.toUpperCase()];
+ if (defined_default(namedColor)) {
+ Color.clone(namedColor, result);
+ return result;
+ }
+ let matches = rgbaMatcher.exec(color);
+ if (matches !== null) {
+ result.red = parseInt(matches[1], 16) / 15;
+ result.green = parseInt(matches[2], 16) / 15;
+ result.blue = parseInt(matches[3], 16) / 15;
+ result.alpha = parseInt(defaultValue_default(matches[4], "f"), 16) / 15;
+ return result;
+ }
+ matches = rrggbbaaMatcher.exec(color);
+ if (matches !== null) {
+ result.red = parseInt(matches[1], 16) / 255;
+ result.green = parseInt(matches[2], 16) / 255;
+ result.blue = parseInt(matches[3], 16) / 255;
+ result.alpha = parseInt(defaultValue_default(matches[4], "ff"), 16) / 255;
+ return result;
+ }
+ matches = rgbParenthesesMatcher.exec(color);
+ if (matches !== null) {
+ result.red = parseFloat(matches[1]) / ("%" === matches[1].substr(-1) ? 100 : 255);
+ result.green = parseFloat(matches[2]) / ("%" === matches[2].substr(-1) ? 100 : 255);
+ result.blue = parseFloat(matches[3]) / ("%" === matches[3].substr(-1) ? 100 : 255);
+ result.alpha = parseFloat(defaultValue_default(matches[4], "1.0"));
+ return result;
+ }
+ matches = hslParenthesesMatcher.exec(color);
+ if (matches !== null) {
+ return Color.fromHsl(
+ parseFloat(matches[1]) / 360,
+ parseFloat(matches[2]) / 100,
+ parseFloat(matches[3]) / 100,
+ parseFloat(defaultValue_default(matches[4], "1.0")),
+ result
+ );
+ }
+ result = void 0;
+ return result;
+};
+Color.packedLength = 4;
+Color.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.red;
+ array[startingIndex++] = value.green;
+ array[startingIndex++] = value.blue;
+ array[startingIndex] = value.alpha;
+ return array;
+};
+Color.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new Color();
+ }
+ result.red = array[startingIndex++];
+ result.green = array[startingIndex++];
+ result.blue = array[startingIndex++];
+ result.alpha = array[startingIndex];
+ return result;
+};
+Color.byteToFloat = function(number) {
+ return number / 255;
+};
+Color.floatToByte = function(number) {
+ return number === 1 ? 255 : number * 256 | 0;
+};
+Color.clone = function(color, result) {
+ if (!defined_default(color)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Color(color.red, color.green, color.blue, color.alpha);
+ }
+ result.red = color.red;
+ result.green = color.green;
+ result.blue = color.blue;
+ result.alpha = color.alpha;
+ return result;
+};
+Color.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.red === right.red && left.green === right.green && left.blue === right.blue && left.alpha === right.alpha;
+};
+Color.equalsArray = function(color, array, offset2) {
+ return color.red === array[offset2] && color.green === array[offset2 + 1] && color.blue === array[offset2 + 2] && color.alpha === array[offset2 + 3];
+};
+Color.prototype.clone = function(result) {
+ return Color.clone(this, result);
+};
+Color.prototype.equals = function(other) {
+ return Color.equals(this, other);
+};
+Color.prototype.equalsEpsilon = function(other, epsilon) {
+ return this === other || defined_default(other) && Math.abs(this.red - other.red) <= epsilon && Math.abs(this.green - other.green) <= epsilon && Math.abs(this.blue - other.blue) <= epsilon && Math.abs(this.alpha - other.alpha) <= epsilon;
+};
+Color.prototype.toString = function() {
+ return `(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;
+};
+Color.prototype.toCssColorString = function() {
+ const red = Color.floatToByte(this.red);
+ const green = Color.floatToByte(this.green);
+ const blue = Color.floatToByte(this.blue);
+ if (this.alpha === 1) {
+ return `rgb(${red},${green},${blue})`;
+ }
+ return `rgba(${red},${green},${blue},${this.alpha})`;
+};
+Color.prototype.toCssHexString = function() {
+ let r = Color.floatToByte(this.red).toString(16);
+ if (r.length < 2) {
+ r = `0${r}`;
+ }
+ let g = Color.floatToByte(this.green).toString(16);
+ if (g.length < 2) {
+ g = `0${g}`;
+ }
+ let b = Color.floatToByte(this.blue).toString(16);
+ if (b.length < 2) {
+ b = `0${b}`;
+ }
+ if (this.alpha < 1) {
+ let hexAlpha = Color.floatToByte(this.alpha).toString(16);
+ if (hexAlpha.length < 2) {
+ hexAlpha = `0${hexAlpha}`;
+ }
+ return `#${r}${g}${b}${hexAlpha}`;
+ }
+ return `#${r}${g}${b}`;
+};
+Color.prototype.toBytes = function(result) {
+ const red = Color.floatToByte(this.red);
+ const green = Color.floatToByte(this.green);
+ const blue = Color.floatToByte(this.blue);
+ const alpha = Color.floatToByte(this.alpha);
+ if (!defined_default(result)) {
+ return [red, green, blue, alpha];
+ }
+ result[0] = red;
+ result[1] = green;
+ result[2] = blue;
+ result[3] = alpha;
+ return result;
+};
+Color.prototype.toRgba = function() {
+ scratchUint8Array[0] = Color.floatToByte(this.red);
+ scratchUint8Array[1] = Color.floatToByte(this.green);
+ scratchUint8Array[2] = Color.floatToByte(this.blue);
+ scratchUint8Array[3] = Color.floatToByte(this.alpha);
+ return scratchUint32Array[0];
+};
+Color.prototype.brighten = function(magnitude, result) {
+ Check_default.typeOf.number("magnitude", magnitude);
+ Check_default.typeOf.number.greaterThanOrEquals("magnitude", magnitude, 0);
+ Check_default.typeOf.object("result", result);
+ magnitude = 1 - magnitude;
+ result.red = 1 - (1 - this.red) * magnitude;
+ result.green = 1 - (1 - this.green) * magnitude;
+ result.blue = 1 - (1 - this.blue) * magnitude;
+ result.alpha = this.alpha;
+ return result;
+};
+Color.prototype.darken = function(magnitude, result) {
+ Check_default.typeOf.number("magnitude", magnitude);
+ Check_default.typeOf.number.greaterThanOrEquals("magnitude", magnitude, 0);
+ Check_default.typeOf.object("result", result);
+ magnitude = 1 - magnitude;
+ result.red = this.red * magnitude;
+ result.green = this.green * magnitude;
+ result.blue = this.blue * magnitude;
+ result.alpha = this.alpha;
+ return result;
+};
+Color.prototype.withAlpha = function(alpha, result) {
+ return Color.fromAlpha(this, alpha, result);
+};
+Color.add = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.red = left.red + right.red;
+ result.green = left.green + right.green;
+ result.blue = left.blue + right.blue;
+ result.alpha = left.alpha + right.alpha;
+ return result;
+};
+Color.subtract = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.red = left.red - right.red;
+ result.green = left.green - right.green;
+ result.blue = left.blue - right.blue;
+ result.alpha = left.alpha - right.alpha;
+ return result;
+};
+Color.multiply = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.red = left.red * right.red;
+ result.green = left.green * right.green;
+ result.blue = left.blue * right.blue;
+ result.alpha = left.alpha * right.alpha;
+ return result;
+};
+Color.divide = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.red = left.red / right.red;
+ result.green = left.green / right.green;
+ result.blue = left.blue / right.blue;
+ result.alpha = left.alpha / right.alpha;
+ return result;
+};
+Color.mod = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.red = left.red % right.red;
+ result.green = left.green % right.green;
+ result.blue = left.blue % right.blue;
+ result.alpha = left.alpha % right.alpha;
+ return result;
+};
+Color.lerp = function(start, end, t, result) {
+ Check_default.typeOf.object("start", start);
+ Check_default.typeOf.object("end", end);
+ Check_default.typeOf.number("t", t);
+ Check_default.typeOf.object("result", result);
+ result.red = Math_default.lerp(start.red, end.red, t);
+ result.green = Math_default.lerp(start.green, end.green, t);
+ result.blue = Math_default.lerp(start.blue, end.blue, t);
+ result.alpha = Math_default.lerp(start.alpha, end.alpha, t);
+ return result;
+};
+Color.multiplyByScalar = function(color, scalar, result) {
+ Check_default.typeOf.object("color", color);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result.red = color.red * scalar;
+ result.green = color.green * scalar;
+ result.blue = color.blue * scalar;
+ result.alpha = color.alpha * scalar;
+ return result;
+};
+Color.divideByScalar = function(color, scalar, result) {
+ Check_default.typeOf.object("color", color);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result.red = color.red / scalar;
+ result.green = color.green / scalar;
+ result.blue = color.blue / scalar;
+ result.alpha = color.alpha / scalar;
+ return result;
+};
+Color.ALICEBLUE = Object.freeze(Color.fromCssColorString("#F0F8FF"));
+Color.ANTIQUEWHITE = Object.freeze(Color.fromCssColorString("#FAEBD7"));
+Color.AQUA = Object.freeze(Color.fromCssColorString("#00FFFF"));
+Color.AQUAMARINE = Object.freeze(Color.fromCssColorString("#7FFFD4"));
+Color.AZURE = Object.freeze(Color.fromCssColorString("#F0FFFF"));
+Color.BEIGE = Object.freeze(Color.fromCssColorString("#F5F5DC"));
+Color.BISQUE = Object.freeze(Color.fromCssColorString("#FFE4C4"));
+Color.BLACK = Object.freeze(Color.fromCssColorString("#000000"));
+Color.BLANCHEDALMOND = Object.freeze(Color.fromCssColorString("#FFEBCD"));
+Color.BLUE = Object.freeze(Color.fromCssColorString("#0000FF"));
+Color.BLUEVIOLET = Object.freeze(Color.fromCssColorString("#8A2BE2"));
+Color.BROWN = Object.freeze(Color.fromCssColorString("#A52A2A"));
+Color.BURLYWOOD = Object.freeze(Color.fromCssColorString("#DEB887"));
+Color.CADETBLUE = Object.freeze(Color.fromCssColorString("#5F9EA0"));
+Color.CHARTREUSE = Object.freeze(Color.fromCssColorString("#7FFF00"));
+Color.CHOCOLATE = Object.freeze(Color.fromCssColorString("#D2691E"));
+Color.CORAL = Object.freeze(Color.fromCssColorString("#FF7F50"));
+Color.CORNFLOWERBLUE = Object.freeze(Color.fromCssColorString("#6495ED"));
+Color.CORNSILK = Object.freeze(Color.fromCssColorString("#FFF8DC"));
+Color.CRIMSON = Object.freeze(Color.fromCssColorString("#DC143C"));
+Color.CYAN = Object.freeze(Color.fromCssColorString("#00FFFF"));
+Color.DARKBLUE = Object.freeze(Color.fromCssColorString("#00008B"));
+Color.DARKCYAN = Object.freeze(Color.fromCssColorString("#008B8B"));
+Color.DARKGOLDENROD = Object.freeze(Color.fromCssColorString("#B8860B"));
+Color.DARKGRAY = Object.freeze(Color.fromCssColorString("#A9A9A9"));
+Color.DARKGREEN = Object.freeze(Color.fromCssColorString("#006400"));
+Color.DARKGREY = Color.DARKGRAY;
+Color.DARKKHAKI = Object.freeze(Color.fromCssColorString("#BDB76B"));
+Color.DARKMAGENTA = Object.freeze(Color.fromCssColorString("#8B008B"));
+Color.DARKOLIVEGREEN = Object.freeze(Color.fromCssColorString("#556B2F"));
+Color.DARKORANGE = Object.freeze(Color.fromCssColorString("#FF8C00"));
+Color.DARKORCHID = Object.freeze(Color.fromCssColorString("#9932CC"));
+Color.DARKRED = Object.freeze(Color.fromCssColorString("#8B0000"));
+Color.DARKSALMON = Object.freeze(Color.fromCssColorString("#E9967A"));
+Color.DARKSEAGREEN = Object.freeze(Color.fromCssColorString("#8FBC8F"));
+Color.DARKSLATEBLUE = Object.freeze(Color.fromCssColorString("#483D8B"));
+Color.DARKSLATEGRAY = Object.freeze(Color.fromCssColorString("#2F4F4F"));
+Color.DARKSLATEGREY = Color.DARKSLATEGRAY;
+Color.DARKTURQUOISE = Object.freeze(Color.fromCssColorString("#00CED1"));
+Color.DARKVIOLET = Object.freeze(Color.fromCssColorString("#9400D3"));
+Color.DEEPPINK = Object.freeze(Color.fromCssColorString("#FF1493"));
+Color.DEEPSKYBLUE = Object.freeze(Color.fromCssColorString("#00BFFF"));
+Color.DIMGRAY = Object.freeze(Color.fromCssColorString("#696969"));
+Color.DIMGREY = Color.DIMGRAY;
+Color.DODGERBLUE = Object.freeze(Color.fromCssColorString("#1E90FF"));
+Color.FIREBRICK = Object.freeze(Color.fromCssColorString("#B22222"));
+Color.FLORALWHITE = Object.freeze(Color.fromCssColorString("#FFFAF0"));
+Color.FORESTGREEN = Object.freeze(Color.fromCssColorString("#228B22"));
+Color.FUCHSIA = Object.freeze(Color.fromCssColorString("#FF00FF"));
+Color.GAINSBORO = Object.freeze(Color.fromCssColorString("#DCDCDC"));
+Color.GHOSTWHITE = Object.freeze(Color.fromCssColorString("#F8F8FF"));
+Color.GOLD = Object.freeze(Color.fromCssColorString("#FFD700"));
+Color.GOLDENROD = Object.freeze(Color.fromCssColorString("#DAA520"));
+Color.GRAY = Object.freeze(Color.fromCssColorString("#808080"));
+Color.GREEN = Object.freeze(Color.fromCssColorString("#008000"));
+Color.GREENYELLOW = Object.freeze(Color.fromCssColorString("#ADFF2F"));
+Color.GREY = Color.GRAY;
+Color.HONEYDEW = Object.freeze(Color.fromCssColorString("#F0FFF0"));
+Color.HOTPINK = Object.freeze(Color.fromCssColorString("#FF69B4"));
+Color.INDIANRED = Object.freeze(Color.fromCssColorString("#CD5C5C"));
+Color.INDIGO = Object.freeze(Color.fromCssColorString("#4B0082"));
+Color.IVORY = Object.freeze(Color.fromCssColorString("#FFFFF0"));
+Color.KHAKI = Object.freeze(Color.fromCssColorString("#F0E68C"));
+Color.LAVENDER = Object.freeze(Color.fromCssColorString("#E6E6FA"));
+Color.LAVENDAR_BLUSH = Object.freeze(Color.fromCssColorString("#FFF0F5"));
+Color.LAWNGREEN = Object.freeze(Color.fromCssColorString("#7CFC00"));
+Color.LEMONCHIFFON = Object.freeze(Color.fromCssColorString("#FFFACD"));
+Color.LIGHTBLUE = Object.freeze(Color.fromCssColorString("#ADD8E6"));
+Color.LIGHTCORAL = Object.freeze(Color.fromCssColorString("#F08080"));
+Color.LIGHTCYAN = Object.freeze(Color.fromCssColorString("#E0FFFF"));
+Color.LIGHTGOLDENRODYELLOW = Object.freeze(Color.fromCssColorString("#FAFAD2"));
+Color.LIGHTGRAY = Object.freeze(Color.fromCssColorString("#D3D3D3"));
+Color.LIGHTGREEN = Object.freeze(Color.fromCssColorString("#90EE90"));
+Color.LIGHTGREY = Color.LIGHTGRAY;
+Color.LIGHTPINK = Object.freeze(Color.fromCssColorString("#FFB6C1"));
+Color.LIGHTSEAGREEN = Object.freeze(Color.fromCssColorString("#20B2AA"));
+Color.LIGHTSKYBLUE = Object.freeze(Color.fromCssColorString("#87CEFA"));
+Color.LIGHTSLATEGRAY = Object.freeze(Color.fromCssColorString("#778899"));
+Color.LIGHTSLATEGREY = Color.LIGHTSLATEGRAY;
+Color.LIGHTSTEELBLUE = Object.freeze(Color.fromCssColorString("#B0C4DE"));
+Color.LIGHTYELLOW = Object.freeze(Color.fromCssColorString("#FFFFE0"));
+Color.LIME = Object.freeze(Color.fromCssColorString("#00FF00"));
+Color.LIMEGREEN = Object.freeze(Color.fromCssColorString("#32CD32"));
+Color.LINEN = Object.freeze(Color.fromCssColorString("#FAF0E6"));
+Color.MAGENTA = Object.freeze(Color.fromCssColorString("#FF00FF"));
+Color.MAROON = Object.freeze(Color.fromCssColorString("#800000"));
+Color.MEDIUMAQUAMARINE = Object.freeze(Color.fromCssColorString("#66CDAA"));
+Color.MEDIUMBLUE = Object.freeze(Color.fromCssColorString("#0000CD"));
+Color.MEDIUMORCHID = Object.freeze(Color.fromCssColorString("#BA55D3"));
+Color.MEDIUMPURPLE = Object.freeze(Color.fromCssColorString("#9370DB"));
+Color.MEDIUMSEAGREEN = Object.freeze(Color.fromCssColorString("#3CB371"));
+Color.MEDIUMSLATEBLUE = Object.freeze(Color.fromCssColorString("#7B68EE"));
+Color.MEDIUMSPRINGGREEN = Object.freeze(Color.fromCssColorString("#00FA9A"));
+Color.MEDIUMTURQUOISE = Object.freeze(Color.fromCssColorString("#48D1CC"));
+Color.MEDIUMVIOLETRED = Object.freeze(Color.fromCssColorString("#C71585"));
+Color.MIDNIGHTBLUE = Object.freeze(Color.fromCssColorString("#191970"));
+Color.MINTCREAM = Object.freeze(Color.fromCssColorString("#F5FFFA"));
+Color.MISTYROSE = Object.freeze(Color.fromCssColorString("#FFE4E1"));
+Color.MOCCASIN = Object.freeze(Color.fromCssColorString("#FFE4B5"));
+Color.NAVAJOWHITE = Object.freeze(Color.fromCssColorString("#FFDEAD"));
+Color.NAVY = Object.freeze(Color.fromCssColorString("#000080"));
+Color.OLDLACE = Object.freeze(Color.fromCssColorString("#FDF5E6"));
+Color.OLIVE = Object.freeze(Color.fromCssColorString("#808000"));
+Color.OLIVEDRAB = Object.freeze(Color.fromCssColorString("#6B8E23"));
+Color.ORANGE = Object.freeze(Color.fromCssColorString("#FFA500"));
+Color.ORANGERED = Object.freeze(Color.fromCssColorString("#FF4500"));
+Color.ORCHID = Object.freeze(Color.fromCssColorString("#DA70D6"));
+Color.PALEGOLDENROD = Object.freeze(Color.fromCssColorString("#EEE8AA"));
+Color.PALEGREEN = Object.freeze(Color.fromCssColorString("#98FB98"));
+Color.PALETURQUOISE = Object.freeze(Color.fromCssColorString("#AFEEEE"));
+Color.PALEVIOLETRED = Object.freeze(Color.fromCssColorString("#DB7093"));
+Color.PAPAYAWHIP = Object.freeze(Color.fromCssColorString("#FFEFD5"));
+Color.PEACHPUFF = Object.freeze(Color.fromCssColorString("#FFDAB9"));
+Color.PERU = Object.freeze(Color.fromCssColorString("#CD853F"));
+Color.PINK = Object.freeze(Color.fromCssColorString("#FFC0CB"));
+Color.PLUM = Object.freeze(Color.fromCssColorString("#DDA0DD"));
+Color.POWDERBLUE = Object.freeze(Color.fromCssColorString("#B0E0E6"));
+Color.PURPLE = Object.freeze(Color.fromCssColorString("#800080"));
+Color.RED = Object.freeze(Color.fromCssColorString("#FF0000"));
+Color.ROSYBROWN = Object.freeze(Color.fromCssColorString("#BC8F8F"));
+Color.ROYALBLUE = Object.freeze(Color.fromCssColorString("#4169E1"));
+Color.SADDLEBROWN = Object.freeze(Color.fromCssColorString("#8B4513"));
+Color.SALMON = Object.freeze(Color.fromCssColorString("#FA8072"));
+Color.SANDYBROWN = Object.freeze(Color.fromCssColorString("#F4A460"));
+Color.SEAGREEN = Object.freeze(Color.fromCssColorString("#2E8B57"));
+Color.SEASHELL = Object.freeze(Color.fromCssColorString("#FFF5EE"));
+Color.SIENNA = Object.freeze(Color.fromCssColorString("#A0522D"));
+Color.SILVER = Object.freeze(Color.fromCssColorString("#C0C0C0"));
+Color.SKYBLUE = Object.freeze(Color.fromCssColorString("#87CEEB"));
+Color.SLATEBLUE = Object.freeze(Color.fromCssColorString("#6A5ACD"));
+Color.SLATEGRAY = Object.freeze(Color.fromCssColorString("#708090"));
+Color.SLATEGREY = Color.SLATEGRAY;
+Color.SNOW = Object.freeze(Color.fromCssColorString("#FFFAFA"));
+Color.SPRINGGREEN = Object.freeze(Color.fromCssColorString("#00FF7F"));
+Color.STEELBLUE = Object.freeze(Color.fromCssColorString("#4682B4"));
+Color.TAN = Object.freeze(Color.fromCssColorString("#D2B48C"));
+Color.TEAL = Object.freeze(Color.fromCssColorString("#008080"));
+Color.THISTLE = Object.freeze(Color.fromCssColorString("#D8BFD8"));
+Color.TOMATO = Object.freeze(Color.fromCssColorString("#FF6347"));
+Color.TURQUOISE = Object.freeze(Color.fromCssColorString("#40E0D0"));
+Color.VIOLET = Object.freeze(Color.fromCssColorString("#EE82EE"));
+Color.WHEAT = Object.freeze(Color.fromCssColorString("#F5DEB3"));
+Color.WHITE = Object.freeze(Color.fromCssColorString("#FFFFFF"));
+Color.WHITESMOKE = Object.freeze(Color.fromCssColorString("#F5F5F5"));
+Color.YELLOW = Object.freeze(Color.fromCssColorString("#FFFF00"));
+Color.YELLOWGREEN = Object.freeze(Color.fromCssColorString("#9ACD32"));
+Color.TRANSPARENT = Object.freeze(new Color(0, 0, 0, 0));
+var Color_default = Color;
+
+// Source/Renderer/ClearCommand.js
+function ClearCommand(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.color = options.color;
+ this.depth = options.depth;
+ this.stencil = options.stencil;
+ this.renderState = options.renderState;
+ this.framebuffer = options.framebuffer;
+ this.owner = options.owner;
+ this.pass = options.pass;
+}
+ClearCommand.ALL = Object.freeze(
+ new ClearCommand({
+ color: new Color_default(0, 0, 0, 0),
+ depth: 1,
+ stencil: 0
+ })
+);
+ClearCommand.prototype.execute = function(context, passState) {
+ context.clear(this, passState);
+};
+var ClearCommand_default = ClearCommand;
+
+// Source/Renderer/Pass.js
+var Pass = {
+ ENVIRONMENT: 0,
+ COMPUTE: 1,
+ GLOBE: 2,
+ TERRAIN_CLASSIFICATION: 3,
+ CESIUM_3D_TILE: 4,
+ CESIUM_3D_TILE_CLASSIFICATION: 5,
+ CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW: 6,
+ OPAQUE: 7,
+ TRANSLUCENT: 8,
+ OVERLAY: 9,
+ NUMBER_OF_PASSES: 10
+};
+var Pass_default = Object.freeze(Pass);
+
+// Source/Renderer/ComputeCommand.js
+function ComputeCommand(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.vertexArray = options.vertexArray;
+ this.fragmentShaderSource = options.fragmentShaderSource;
+ this.shaderProgram = options.shaderProgram;
+ this.uniformMap = options.uniformMap;
+ this.outputTexture = options.outputTexture;
+ this.preExecute = options.preExecute;
+ this.postExecute = options.postExecute;
+ this.canceled = options.canceled;
+ this.persists = defaultValue_default(options.persists, false);
+ this.pass = Pass_default.COMPUTE;
+ this.owner = options.owner;
+}
+ComputeCommand.prototype.execute = function(computeEngine) {
+ computeEngine.execute(this);
+};
+var ComputeCommand_default = ComputeCommand;
+
+// Source/Core/Cartesian2.js
+function Cartesian2(x, y) {
+ this.x = defaultValue_default(x, 0);
+ this.y = defaultValue_default(y, 0);
+}
+Cartesian2.fromElements = function(x, y, result) {
+ if (!defined_default(result)) {
+ return new Cartesian2(x, y);
+ }
+ result.x = x;
+ result.y = y;
+ return result;
+};
+Cartesian2.clone = function(cartesian11, result) {
+ if (!defined_default(cartesian11)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Cartesian2(cartesian11.x, cartesian11.y);
+ }
+ result.x = cartesian11.x;
+ result.y = cartesian11.y;
+ return result;
+};
+Cartesian2.fromCartesian3 = Cartesian2.clone;
+Cartesian2.fromCartesian4 = Cartesian2.clone;
+Cartesian2.packedLength = 2;
+Cartesian2.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.x;
+ array[startingIndex] = value.y;
+ return array;
+};
+Cartesian2.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new Cartesian2();
+ }
+ result.x = array[startingIndex++];
+ result.y = array[startingIndex];
+ return result;
+};
+Cartesian2.packArray = function(array, result) {
+ Check_default.defined("array", array);
+ const length3 = array.length;
+ const resultLength = length3 * 2;
+ if (!defined_default(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ throw new DeveloperError_default(
+ "If result is a typed array, it must have exactly array.length * 2 elements"
+ );
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+ for (let i = 0; i < length3; ++i) {
+ Cartesian2.pack(array[i], result, i * 2);
+ }
+ return result;
+};
+Cartesian2.unpackArray = function(array, result) {
+ Check_default.defined("array", array);
+ Check_default.typeOf.number.greaterThanOrEquals("array.length", array.length, 2);
+ if (array.length % 2 !== 0) {
+ throw new DeveloperError_default("array length must be a multiple of 2.");
+ }
+ const length3 = array.length;
+ if (!defined_default(result)) {
+ result = new Array(length3 / 2);
+ } else {
+ result.length = length3 / 2;
+ }
+ for (let i = 0; i < length3; i += 2) {
+ const index = i / 2;
+ result[index] = Cartesian2.unpack(array, i, result[index]);
+ }
+ return result;
+};
+Cartesian2.fromArray = Cartesian2.unpack;
+Cartesian2.maximumComponent = function(cartesian11) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ return Math.max(cartesian11.x, cartesian11.y);
+};
+Cartesian2.minimumComponent = function(cartesian11) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ return Math.min(cartesian11.x, cartesian11.y);
+};
+Cartesian2.minimumByComponent = function(first, second, result) {
+ Check_default.typeOf.object("first", first);
+ Check_default.typeOf.object("second", second);
+ Check_default.typeOf.object("result", result);
+ result.x = Math.min(first.x, second.x);
+ result.y = Math.min(first.y, second.y);
+ return result;
+};
+Cartesian2.maximumByComponent = function(first, second, result) {
+ Check_default.typeOf.object("first", first);
+ Check_default.typeOf.object("second", second);
+ Check_default.typeOf.object("result", result);
+ result.x = Math.max(first.x, second.x);
+ result.y = Math.max(first.y, second.y);
+ return result;
+};
+Cartesian2.clamp = function(value, min3, max3, result) {
+ Check_default.typeOf.object("value", value);
+ Check_default.typeOf.object("min", min3);
+ Check_default.typeOf.object("max", max3);
+ Check_default.typeOf.object("result", result);
+ const x = Math_default.clamp(value.x, min3.x, max3.x);
+ const y = Math_default.clamp(value.y, min3.y, max3.y);
+ result.x = x;
+ result.y = y;
+ return result;
+};
+Cartesian2.magnitudeSquared = function(cartesian11) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ return cartesian11.x * cartesian11.x + cartesian11.y * cartesian11.y;
+};
+Cartesian2.magnitude = function(cartesian11) {
+ return Math.sqrt(Cartesian2.magnitudeSquared(cartesian11));
+};
+var distanceScratch3 = new Cartesian2();
+Cartesian2.distance = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Cartesian2.subtract(left, right, distanceScratch3);
+ return Cartesian2.magnitude(distanceScratch3);
+};
+Cartesian2.distanceSquared = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Cartesian2.subtract(left, right, distanceScratch3);
+ return Cartesian2.magnitudeSquared(distanceScratch3);
+};
+Cartesian2.normalize = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const magnitude = Cartesian2.magnitude(cartesian11);
+ result.x = cartesian11.x / magnitude;
+ result.y = cartesian11.y / magnitude;
+ if (isNaN(result.x) || isNaN(result.y)) {
+ throw new DeveloperError_default("normalized result is not a number");
+ }
+ return result;
+};
+Cartesian2.dot = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ return left.x * right.x + left.y * right.y;
+};
+Cartesian2.cross = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ return left.x * right.y - left.y * right.x;
+};
+Cartesian2.multiplyComponents = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x * right.x;
+ result.y = left.y * right.y;
+ return result;
+};
+Cartesian2.divideComponents = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x / right.x;
+ result.y = left.y / right.y;
+ return result;
+};
+Cartesian2.add = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x + right.x;
+ result.y = left.y + right.y;
+ return result;
+};
+Cartesian2.subtract = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x - right.x;
+ result.y = left.y - right.y;
+ return result;
+};
+Cartesian2.multiplyByScalar = function(cartesian11, scalar, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result.x = cartesian11.x * scalar;
+ result.y = cartesian11.y * scalar;
+ return result;
+};
+Cartesian2.divideByScalar = function(cartesian11, scalar, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result.x = cartesian11.x / scalar;
+ result.y = cartesian11.y / scalar;
+ return result;
+};
+Cartesian2.negate = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result.x = -cartesian11.x;
+ result.y = -cartesian11.y;
+ return result;
+};
+Cartesian2.abs = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result.x = Math.abs(cartesian11.x);
+ result.y = Math.abs(cartesian11.y);
+ return result;
+};
+var lerpScratch3 = new Cartesian2();
+Cartesian2.lerp = function(start, end, t, result) {
+ Check_default.typeOf.object("start", start);
+ Check_default.typeOf.object("end", end);
+ Check_default.typeOf.number("t", t);
+ Check_default.typeOf.object("result", result);
+ Cartesian2.multiplyByScalar(end, t, lerpScratch3);
+ result = Cartesian2.multiplyByScalar(start, 1 - t, result);
+ return Cartesian2.add(lerpScratch3, result, result);
+};
+var angleBetweenScratch3 = new Cartesian2();
+var angleBetweenScratch22 = new Cartesian2();
+Cartesian2.angleBetween = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Cartesian2.normalize(left, angleBetweenScratch3);
+ Cartesian2.normalize(right, angleBetweenScratch22);
+ return Math_default.acosClamped(
+ Cartesian2.dot(angleBetweenScratch3, angleBetweenScratch22)
+ );
+};
+var mostOrthogonalAxisScratch3 = new Cartesian2();
+Cartesian2.mostOrthogonalAxis = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const f = Cartesian2.normalize(cartesian11, mostOrthogonalAxisScratch3);
+ Cartesian2.abs(f, f);
+ if (f.x <= f.y) {
+ result = Cartesian2.clone(Cartesian2.UNIT_X, result);
+ } else {
+ result = Cartesian2.clone(Cartesian2.UNIT_Y, result);
+ }
+ return result;
+};
+Cartesian2.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.x === right.x && left.y === right.y;
+};
+Cartesian2.equalsArray = function(cartesian11, array, offset2) {
+ return cartesian11.x === array[offset2] && cartesian11.y === array[offset2 + 1];
+};
+Cartesian2.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {
+ return left === right || defined_default(left) && defined_default(right) && Math_default.equalsEpsilon(
+ left.x,
+ right.x,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ left.y,
+ right.y,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+};
+Cartesian2.ZERO = Object.freeze(new Cartesian2(0, 0));
+Cartesian2.ONE = Object.freeze(new Cartesian2(1, 1));
+Cartesian2.UNIT_X = Object.freeze(new Cartesian2(1, 0));
+Cartesian2.UNIT_Y = Object.freeze(new Cartesian2(0, 1));
+Cartesian2.prototype.clone = function(result) {
+ return Cartesian2.clone(this, result);
+};
+Cartesian2.prototype.equals = function(right) {
+ return Cartesian2.equals(this, right);
+};
+Cartesian2.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) {
+ return Cartesian2.equalsEpsilon(
+ this,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+};
+Cartesian2.prototype.toString = function() {
+ return `(${this.x}, ${this.y})`;
+};
+var Cartesian2_default = Cartesian2;
+
+// Source/Core/scaleToGeodeticSurface.js
+var scaleToGeodeticSurfaceIntersection = new Cartesian3_default();
+var scaleToGeodeticSurfaceGradient = new Cartesian3_default();
+function scaleToGeodeticSurface(cartesian11, oneOverRadii, oneOverRadiiSquared, centerToleranceSquared, result) {
+ if (!defined_default(cartesian11)) {
+ throw new DeveloperError_default("cartesian is required.");
+ }
+ if (!defined_default(oneOverRadii)) {
+ throw new DeveloperError_default("oneOverRadii is required.");
+ }
+ if (!defined_default(oneOverRadiiSquared)) {
+ throw new DeveloperError_default("oneOverRadiiSquared is required.");
+ }
+ if (!defined_default(centerToleranceSquared)) {
+ throw new DeveloperError_default("centerToleranceSquared is required.");
+ }
+ const positionX = cartesian11.x;
+ const positionY = cartesian11.y;
+ const positionZ = cartesian11.z;
+ const oneOverRadiiX = oneOverRadii.x;
+ const oneOverRadiiY = oneOverRadii.y;
+ const oneOverRadiiZ = oneOverRadii.z;
+ const x2 = positionX * positionX * oneOverRadiiX * oneOverRadiiX;
+ const y2 = positionY * positionY * oneOverRadiiY * oneOverRadiiY;
+ const z2 = positionZ * positionZ * oneOverRadiiZ * oneOverRadiiZ;
+ const squaredNorm = x2 + y2 + z2;
+ const ratio = Math.sqrt(1 / squaredNorm);
+ const intersection = Cartesian3_default.multiplyByScalar(
+ cartesian11,
+ ratio,
+ scaleToGeodeticSurfaceIntersection
+ );
+ if (squaredNorm < centerToleranceSquared) {
+ return !isFinite(ratio) ? void 0 : Cartesian3_default.clone(intersection, result);
+ }
+ const oneOverRadiiSquaredX = oneOverRadiiSquared.x;
+ const oneOverRadiiSquaredY = oneOverRadiiSquared.y;
+ const oneOverRadiiSquaredZ = oneOverRadiiSquared.z;
+ const gradient = scaleToGeodeticSurfaceGradient;
+ gradient.x = intersection.x * oneOverRadiiSquaredX * 2;
+ gradient.y = intersection.y * oneOverRadiiSquaredY * 2;
+ gradient.z = intersection.z * oneOverRadiiSquaredZ * 2;
+ let lambda = (1 - ratio) * Cartesian3_default.magnitude(cartesian11) / (0.5 * Cartesian3_default.magnitude(gradient));
+ let correction = 0;
+ let func;
+ let denominator;
+ let xMultiplier;
+ let yMultiplier;
+ let zMultiplier;
+ let xMultiplier2;
+ let yMultiplier2;
+ let zMultiplier2;
+ let xMultiplier3;
+ let yMultiplier3;
+ let zMultiplier3;
+ do {
+ lambda -= correction;
+ xMultiplier = 1 / (1 + lambda * oneOverRadiiSquaredX);
+ yMultiplier = 1 / (1 + lambda * oneOverRadiiSquaredY);
+ zMultiplier = 1 / (1 + lambda * oneOverRadiiSquaredZ);
+ xMultiplier2 = xMultiplier * xMultiplier;
+ yMultiplier2 = yMultiplier * yMultiplier;
+ zMultiplier2 = zMultiplier * zMultiplier;
+ xMultiplier3 = xMultiplier2 * xMultiplier;
+ yMultiplier3 = yMultiplier2 * yMultiplier;
+ zMultiplier3 = zMultiplier2 * zMultiplier;
+ func = x2 * xMultiplier2 + y2 * yMultiplier2 + z2 * zMultiplier2 - 1;
+ denominator = x2 * xMultiplier3 * oneOverRadiiSquaredX + y2 * yMultiplier3 * oneOverRadiiSquaredY + z2 * zMultiplier3 * oneOverRadiiSquaredZ;
+ const derivative = -2 * denominator;
+ correction = func / derivative;
+ } while (Math.abs(func) > Math_default.EPSILON12);
+ if (!defined_default(result)) {
+ return new Cartesian3_default(
+ positionX * xMultiplier,
+ positionY * yMultiplier,
+ positionZ * zMultiplier
+ );
+ }
+ result.x = positionX * xMultiplier;
+ result.y = positionY * yMultiplier;
+ result.z = positionZ * zMultiplier;
+ return result;
+}
+var scaleToGeodeticSurface_default = scaleToGeodeticSurface;
+
+// Source/Core/Cartographic.js
+function Cartographic(longitude, latitude, height) {
+ this.longitude = defaultValue_default(longitude, 0);
+ this.latitude = defaultValue_default(latitude, 0);
+ this.height = defaultValue_default(height, 0);
+}
+Cartographic.fromRadians = function(longitude, latitude, height, result) {
+ Check_default.typeOf.number("longitude", longitude);
+ Check_default.typeOf.number("latitude", latitude);
+ height = defaultValue_default(height, 0);
+ if (!defined_default(result)) {
+ return new Cartographic(longitude, latitude, height);
+ }
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = height;
+ return result;
+};
+Cartographic.fromDegrees = function(longitude, latitude, height, result) {
+ Check_default.typeOf.number("longitude", longitude);
+ Check_default.typeOf.number("latitude", latitude);
+ longitude = Math_default.toRadians(longitude);
+ latitude = Math_default.toRadians(latitude);
+ return Cartographic.fromRadians(longitude, latitude, height, result);
+};
+var cartesianToCartographicN = new Cartesian3_default();
+var cartesianToCartographicP = new Cartesian3_default();
+var cartesianToCartographicH = new Cartesian3_default();
+var wgs84OneOverRadii = new Cartesian3_default(
+ 1 / 6378137,
+ 1 / 6378137,
+ 1 / 6356752314245179e-9
+);
+var wgs84OneOverRadiiSquared = new Cartesian3_default(
+ 1 / (6378137 * 6378137),
+ 1 / (6378137 * 6378137),
+ 1 / (6356752314245179e-9 * 6356752314245179e-9)
+);
+var wgs84CenterToleranceSquared = Math_default.EPSILON1;
+Cartographic.fromCartesian = function(cartesian11, ellipsoid, result) {
+ const oneOverRadii = defined_default(ellipsoid) ? ellipsoid.oneOverRadii : wgs84OneOverRadii;
+ const oneOverRadiiSquared = defined_default(ellipsoid) ? ellipsoid.oneOverRadiiSquared : wgs84OneOverRadiiSquared;
+ const centerToleranceSquared = defined_default(ellipsoid) ? ellipsoid._centerToleranceSquared : wgs84CenterToleranceSquared;
+ const p = scaleToGeodeticSurface_default(
+ cartesian11,
+ oneOverRadii,
+ oneOverRadiiSquared,
+ centerToleranceSquared,
+ cartesianToCartographicP
+ );
+ if (!defined_default(p)) {
+ return void 0;
+ }
+ let n = Cartesian3_default.multiplyComponents(
+ p,
+ oneOverRadiiSquared,
+ cartesianToCartographicN
+ );
+ n = Cartesian3_default.normalize(n, n);
+ const h = Cartesian3_default.subtract(cartesian11, p, cartesianToCartographicH);
+ const longitude = Math.atan2(n.y, n.x);
+ const latitude = Math.asin(n.z);
+ const height = Math_default.sign(Cartesian3_default.dot(h, cartesian11)) * Cartesian3_default.magnitude(h);
+ if (!defined_default(result)) {
+ return new Cartographic(longitude, latitude, height);
+ }
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = height;
+ return result;
+};
+Cartographic.toCartesian = function(cartographic2, ellipsoid, result) {
+ Check_default.defined("cartographic", cartographic2);
+ return Cartesian3_default.fromRadians(
+ cartographic2.longitude,
+ cartographic2.latitude,
+ cartographic2.height,
+ ellipsoid,
+ result
+ );
+};
+Cartographic.clone = function(cartographic2, result) {
+ if (!defined_default(cartographic2)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Cartographic(
+ cartographic2.longitude,
+ cartographic2.latitude,
+ cartographic2.height
+ );
+ }
+ result.longitude = cartographic2.longitude;
+ result.latitude = cartographic2.latitude;
+ result.height = cartographic2.height;
+ return result;
+};
+Cartographic.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.longitude === right.longitude && left.latitude === right.latitude && left.height === right.height;
+};
+Cartographic.equalsEpsilon = function(left, right, epsilon) {
+ epsilon = defaultValue_default(epsilon, 0);
+ return left === right || defined_default(left) && defined_default(right) && Math.abs(left.longitude - right.longitude) <= epsilon && Math.abs(left.latitude - right.latitude) <= epsilon && Math.abs(left.height - right.height) <= epsilon;
+};
+Cartographic.ZERO = Object.freeze(new Cartographic(0, 0, 0));
+Cartographic.prototype.clone = function(result) {
+ return Cartographic.clone(this, result);
+};
+Cartographic.prototype.equals = function(right) {
+ return Cartographic.equals(this, right);
+};
+Cartographic.prototype.equalsEpsilon = function(right, epsilon) {
+ return Cartographic.equalsEpsilon(this, right, epsilon);
+};
+Cartographic.prototype.toString = function() {
+ return `(${this.longitude}, ${this.latitude}, ${this.height})`;
+};
+var Cartographic_default = Cartographic;
+
+// Source/Core/Ellipsoid.js
+function initialize(ellipsoid, x, y, z) {
+ x = defaultValue_default(x, 0);
+ y = defaultValue_default(y, 0);
+ z = defaultValue_default(z, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("x", x, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("y", y, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("z", z, 0);
+ ellipsoid._radii = new Cartesian3_default(x, y, z);
+ ellipsoid._radiiSquared = new Cartesian3_default(x * x, y * y, z * z);
+ ellipsoid._radiiToTheFourth = new Cartesian3_default(
+ x * x * x * x,
+ y * y * y * y,
+ z * z * z * z
+ );
+ ellipsoid._oneOverRadii = new Cartesian3_default(
+ x === 0 ? 0 : 1 / x,
+ y === 0 ? 0 : 1 / y,
+ z === 0 ? 0 : 1 / z
+ );
+ ellipsoid._oneOverRadiiSquared = new Cartesian3_default(
+ x === 0 ? 0 : 1 / (x * x),
+ y === 0 ? 0 : 1 / (y * y),
+ z === 0 ? 0 : 1 / (z * z)
+ );
+ ellipsoid._minimumRadius = Math.min(x, y, z);
+ ellipsoid._maximumRadius = Math.max(x, y, z);
+ ellipsoid._centerToleranceSquared = Math_default.EPSILON1;
+ if (ellipsoid._radiiSquared.z !== 0) {
+ ellipsoid._squaredXOverSquaredZ = ellipsoid._radiiSquared.x / ellipsoid._radiiSquared.z;
+ }
+}
+function Ellipsoid(x, y, z) {
+ 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._squaredXOverSquaredZ = void 0;
+ initialize(this, x, y, z);
+}
+Object.defineProperties(Ellipsoid.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;
+ }
+ }
+});
+Ellipsoid.clone = function(ellipsoid, result) {
+ if (!defined_default(ellipsoid)) {
+ return void 0;
+ }
+ const radii = ellipsoid._radii;
+ if (!defined_default(result)) {
+ return new Ellipsoid(radii.x, radii.y, radii.z);
+ }
+ Cartesian3_default.clone(radii, result._radii);
+ Cartesian3_default.clone(ellipsoid._radiiSquared, result._radiiSquared);
+ Cartesian3_default.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);
+ Cartesian3_default.clone(ellipsoid._oneOverRadii, result._oneOverRadii);
+ Cartesian3_default.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);
+ result._minimumRadius = ellipsoid._minimumRadius;
+ result._maximumRadius = ellipsoid._maximumRadius;
+ result._centerToleranceSquared = ellipsoid._centerToleranceSquared;
+ return result;
+};
+Ellipsoid.fromCartesian3 = function(cartesian11, result) {
+ if (!defined_default(result)) {
+ result = new Ellipsoid();
+ }
+ if (!defined_default(cartesian11)) {
+ return result;
+ }
+ initialize(result, cartesian11.x, cartesian11.y, cartesian11.z);
+ return result;
+};
+Ellipsoid.WGS84 = Object.freeze(
+ new Ellipsoid(6378137, 6378137, 6356752314245179e-9)
+);
+Ellipsoid.UNIT_SPHERE = Object.freeze(new Ellipsoid(1, 1, 1));
+Ellipsoid.MOON = Object.freeze(
+ new Ellipsoid(
+ Math_default.LUNAR_RADIUS,
+ Math_default.LUNAR_RADIUS,
+ Math_default.LUNAR_RADIUS
+ )
+);
+Ellipsoid.prototype.clone = function(result) {
+ return Ellipsoid.clone(this, result);
+};
+Ellipsoid.packedLength = Cartesian3_default.packedLength;
+Ellipsoid.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ Cartesian3_default.pack(value._radii, array, startingIndex);
+ return array;
+};
+Ellipsoid.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const radii = Cartesian3_default.unpack(array, startingIndex);
+ return Ellipsoid.fromCartesian3(radii, result);
+};
+Ellipsoid.prototype.geocentricSurfaceNormal = Cartesian3_default.normalize;
+Ellipsoid.prototype.geodeticSurfaceNormalCartographic = function(cartographic2, result) {
+ Check_default.typeOf.object("cartographic", cartographic2);
+ const longitude = cartographic2.longitude;
+ const latitude = cartographic2.latitude;
+ const cosLatitude = Math.cos(latitude);
+ const x = cosLatitude * Math.cos(longitude);
+ const y = cosLatitude * Math.sin(longitude);
+ const z = Math.sin(latitude);
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return Cartesian3_default.normalize(result, result);
+};
+Ellipsoid.prototype.geodeticSurfaceNormal = function(cartesian11, result) {
+ if (Cartesian3_default.equalsEpsilon(cartesian11, Cartesian3_default.ZERO, Math_default.EPSILON14)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ result = Cartesian3_default.multiplyComponents(
+ cartesian11,
+ this._oneOverRadiiSquared,
+ result
+ );
+ return Cartesian3_default.normalize(result, result);
+};
+var cartographicToCartesianNormal = new Cartesian3_default();
+var cartographicToCartesianK = new Cartesian3_default();
+Ellipsoid.prototype.cartographicToCartesian = function(cartographic2, result) {
+ const n = cartographicToCartesianNormal;
+ const k = cartographicToCartesianK;
+ this.geodeticSurfaceNormalCartographic(cartographic2, n);
+ Cartesian3_default.multiplyComponents(this._radiiSquared, n, k);
+ const gamma = Math.sqrt(Cartesian3_default.dot(n, k));
+ Cartesian3_default.divideByScalar(k, gamma, k);
+ Cartesian3_default.multiplyByScalar(n, cartographic2.height, n);
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ return Cartesian3_default.add(k, n, result);
+};
+Ellipsoid.prototype.cartographicArrayToCartesianArray = function(cartographics, result) {
+ Check_default.defined("cartographics", cartographics);
+ const length3 = cartographics.length;
+ if (!defined_default(result)) {
+ result = new Array(length3);
+ } else {
+ result.length = length3;
+ }
+ for (let i = 0; i < length3; i++) {
+ result[i] = this.cartographicToCartesian(cartographics[i], result[i]);
+ }
+ return result;
+};
+var cartesianToCartographicN2 = new Cartesian3_default();
+var cartesianToCartographicP2 = new Cartesian3_default();
+var cartesianToCartographicH2 = new Cartesian3_default();
+Ellipsoid.prototype.cartesianToCartographic = function(cartesian11, result) {
+ const p = this.scaleToGeodeticSurface(cartesian11, cartesianToCartographicP2);
+ if (!defined_default(p)) {
+ return void 0;
+ }
+ const n = this.geodeticSurfaceNormal(p, cartesianToCartographicN2);
+ const h = Cartesian3_default.subtract(cartesian11, p, cartesianToCartographicH2);
+ const longitude = Math.atan2(n.y, n.x);
+ const latitude = Math.asin(n.z);
+ const height = Math_default.sign(Cartesian3_default.dot(h, cartesian11)) * Cartesian3_default.magnitude(h);
+ if (!defined_default(result)) {
+ return new Cartographic_default(longitude, latitude, height);
+ }
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = height;
+ return result;
+};
+Ellipsoid.prototype.cartesianArrayToCartographicArray = function(cartesians, result) {
+ Check_default.defined("cartesians", cartesians);
+ const length3 = cartesians.length;
+ if (!defined_default(result)) {
+ result = new Array(length3);
+ } else {
+ result.length = length3;
+ }
+ for (let i = 0; i < length3; ++i) {
+ result[i] = this.cartesianToCartographic(cartesians[i], result[i]);
+ }
+ return result;
+};
+Ellipsoid.prototype.scaleToGeodeticSurface = function(cartesian11, result) {
+ return scaleToGeodeticSurface_default(
+ cartesian11,
+ this._oneOverRadii,
+ this._oneOverRadiiSquared,
+ this._centerToleranceSquared,
+ result
+ );
+};
+Ellipsoid.prototype.scaleToGeocentricSurface = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ const positionX = cartesian11.x;
+ const positionY = cartesian11.y;
+ const positionZ = cartesian11.z;
+ const oneOverRadiiSquared = this._oneOverRadiiSquared;
+ const beta = 1 / Math.sqrt(
+ positionX * positionX * oneOverRadiiSquared.x + positionY * positionY * oneOverRadiiSquared.y + positionZ * positionZ * oneOverRadiiSquared.z
+ );
+ return Cartesian3_default.multiplyByScalar(cartesian11, beta, result);
+};
+Ellipsoid.prototype.transformPositionToScaledSpace = function(position, result) {
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ return Cartesian3_default.multiplyComponents(position, this._oneOverRadii, result);
+};
+Ellipsoid.prototype.transformPositionFromScaledSpace = function(position, result) {
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ return Cartesian3_default.multiplyComponents(position, this._radii, result);
+};
+Ellipsoid.prototype.equals = function(right) {
+ return this === right || defined_default(right) && Cartesian3_default.equals(this._radii, right._radii);
+};
+Ellipsoid.prototype.toString = function() {
+ return this._radii.toString();
+};
+Ellipsoid.prototype.getSurfaceNormalIntersectionWithZAxis = function(position, buffer, result) {
+ Check_default.typeOf.object("position", position);
+ if (!Math_default.equalsEpsilon(
+ this._radii.x,
+ this._radii.y,
+ Math_default.EPSILON15
+ )) {
+ throw new DeveloperError_default(
+ "Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)"
+ );
+ }
+ Check_default.typeOf.number.greaterThan("Ellipsoid.radii.z", this._radii.z, 0);
+ buffer = defaultValue_default(buffer, 0);
+ const squaredXOverSquaredZ = this._squaredXOverSquaredZ;
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ result.x = 0;
+ result.y = 0;
+ result.z = position.z * (1 - squaredXOverSquaredZ);
+ if (Math.abs(result.z) >= this._radii.z - buffer) {
+ return void 0;
+ }
+ return result;
+};
+var abscissas = [
+ 0.14887433898163,
+ 0.43339539412925,
+ 0.67940956829902,
+ 0.86506336668898,
+ 0.97390652851717,
+ 0
+];
+var weights = [
+ 0.29552422471475,
+ 0.26926671930999,
+ 0.21908636251598,
+ 0.14945134915058,
+ 0.066671344308684,
+ 0
+];
+function gaussLegendreQuadrature(a3, b, func) {
+ Check_default.typeOf.number("a", a3);
+ Check_default.typeOf.number("b", b);
+ Check_default.typeOf.func("func", func);
+ const xMean = 0.5 * (b + a3);
+ const xRange = 0.5 * (b - a3);
+ let sum = 0;
+ for (let i = 0; i < 5; i++) {
+ const dx = xRange * abscissas[i];
+ sum += weights[i] * (func(xMean + dx) + func(xMean - dx));
+ }
+ sum *= xRange;
+ return sum;
+}
+Ellipsoid.prototype.surfaceArea = function(rectangle) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ const minLongitude = rectangle.west;
+ let maxLongitude = rectangle.east;
+ const minLatitude = rectangle.south;
+ const maxLatitude = rectangle.north;
+ while (maxLongitude < minLongitude) {
+ maxLongitude += Math_default.TWO_PI;
+ }
+ const radiiSquared = this._radiiSquared;
+ const a22 = radiiSquared.x;
+ const b2 = radiiSquared.y;
+ const c22 = radiiSquared.z;
+ const a2b2 = a22 * b2;
+ return gaussLegendreQuadrature(minLatitude, maxLatitude, function(lat) {
+ const sinPhi = Math.cos(lat);
+ const cosPhi = Math.sin(lat);
+ return Math.cos(lat) * gaussLegendreQuadrature(minLongitude, maxLongitude, function(lon) {
+ const cosTheta = Math.cos(lon);
+ const sinTheta = Math.sin(lon);
+ return Math.sqrt(
+ a2b2 * cosPhi * cosPhi + c22 * (b2 * cosTheta * cosTheta + a22 * sinTheta * sinTheta) * sinPhi * sinPhi
+ );
+ });
+ });
+};
+var Ellipsoid_default = Ellipsoid;
+
+// Source/Core/GeographicProjection.js
+function GeographicProjection(ellipsoid) {
+ this._ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ this._semimajorAxis = this._ellipsoid.maximumRadius;
+ this._oneOverSemimajorAxis = 1 / this._semimajorAxis;
+}
+Object.defineProperties(GeographicProjection.prototype, {
+ ellipsoid: {
+ get: function() {
+ return this._ellipsoid;
+ }
+ }
+});
+GeographicProjection.prototype.project = function(cartographic2, result) {
+ const semimajorAxis = this._semimajorAxis;
+ const x = cartographic2.longitude * semimajorAxis;
+ const y = cartographic2.latitude * semimajorAxis;
+ const z = cartographic2.height;
+ if (!defined_default(result)) {
+ return new Cartesian3_default(x, y, z);
+ }
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+};
+GeographicProjection.prototype.unproject = function(cartesian11, result) {
+ if (!defined_default(cartesian11)) {
+ throw new DeveloperError_default("cartesian is required");
+ }
+ const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;
+ const longitude = cartesian11.x * oneOverEarthSemimajorAxis;
+ const latitude = cartesian11.y * oneOverEarthSemimajorAxis;
+ const height = cartesian11.z;
+ if (!defined_default(result)) {
+ return new Cartographic_default(longitude, latitude, height);
+ }
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = height;
+ return result;
+};
+var GeographicProjection_default = GeographicProjection;
+
+// Source/Core/Intersect.js
+var Intersect = {
+ OUTSIDE: -1,
+ INTERSECTING: 0,
+ INSIDE: 1
+};
+var Intersect_default = Object.freeze(Intersect);
+
+// Source/Core/Rectangle.js
+function Rectangle(west, south, east, north) {
+ this.west = defaultValue_default(west, 0);
+ this.south = defaultValue_default(south, 0);
+ this.east = defaultValue_default(east, 0);
+ this.north = defaultValue_default(north, 0);
+}
+Object.defineProperties(Rectangle.prototype, {
+ width: {
+ get: function() {
+ return Rectangle.computeWidth(this);
+ }
+ },
+ height: {
+ get: function() {
+ return Rectangle.computeHeight(this);
+ }
+ }
+});
+Rectangle.packedLength = 4;
+Rectangle.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.west;
+ array[startingIndex++] = value.south;
+ array[startingIndex++] = value.east;
+ array[startingIndex] = value.north;
+ return array;
+};
+Rectangle.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new Rectangle();
+ }
+ result.west = array[startingIndex++];
+ result.south = array[startingIndex++];
+ result.east = array[startingIndex++];
+ result.north = array[startingIndex];
+ return result;
+};
+Rectangle.computeWidth = function(rectangle) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ let east = rectangle.east;
+ const west = rectangle.west;
+ if (east < west) {
+ east += Math_default.TWO_PI;
+ }
+ return east - west;
+};
+Rectangle.computeHeight = function(rectangle) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ return rectangle.north - rectangle.south;
+};
+Rectangle.fromDegrees = function(west, south, east, north, result) {
+ west = Math_default.toRadians(defaultValue_default(west, 0));
+ south = Math_default.toRadians(defaultValue_default(south, 0));
+ east = Math_default.toRadians(defaultValue_default(east, 0));
+ north = Math_default.toRadians(defaultValue_default(north, 0));
+ if (!defined_default(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+};
+Rectangle.fromRadians = function(west, south, east, north, result) {
+ if (!defined_default(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+ result.west = defaultValue_default(west, 0);
+ result.south = defaultValue_default(south, 0);
+ result.east = defaultValue_default(east, 0);
+ result.north = defaultValue_default(north, 0);
+ return result;
+};
+Rectangle.fromCartographicArray = function(cartographics, result) {
+ Check_default.defined("cartographics", cartographics);
+ let west = Number.MAX_VALUE;
+ let east = -Number.MAX_VALUE;
+ let westOverIDL = Number.MAX_VALUE;
+ let eastOverIDL = -Number.MAX_VALUE;
+ let south = Number.MAX_VALUE;
+ let north = -Number.MAX_VALUE;
+ for (let i = 0, len = cartographics.length; i < len; i++) {
+ const position = cartographics[i];
+ west = Math.min(west, position.longitude);
+ east = Math.max(east, position.longitude);
+ south = Math.min(south, position.latitude);
+ north = Math.max(north, position.latitude);
+ const lonAdjusted = position.longitude >= 0 ? position.longitude : position.longitude + Math_default.TWO_PI;
+ westOverIDL = Math.min(westOverIDL, lonAdjusted);
+ eastOverIDL = Math.max(eastOverIDL, lonAdjusted);
+ }
+ if (east - west > eastOverIDL - westOverIDL) {
+ west = westOverIDL;
+ east = eastOverIDL;
+ if (east > Math_default.PI) {
+ east = east - Math_default.TWO_PI;
+ }
+ if (west > Math_default.PI) {
+ west = west - Math_default.TWO_PI;
+ }
+ }
+ if (!defined_default(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+};
+Rectangle.fromCartesianArray = function(cartesians, ellipsoid, result) {
+ Check_default.defined("cartesians", cartesians);
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ let west = Number.MAX_VALUE;
+ let east = -Number.MAX_VALUE;
+ let westOverIDL = Number.MAX_VALUE;
+ let eastOverIDL = -Number.MAX_VALUE;
+ let south = Number.MAX_VALUE;
+ let north = -Number.MAX_VALUE;
+ for (let i = 0, len = cartesians.length; i < len; i++) {
+ const position = ellipsoid.cartesianToCartographic(cartesians[i]);
+ west = Math.min(west, position.longitude);
+ east = Math.max(east, position.longitude);
+ south = Math.min(south, position.latitude);
+ north = Math.max(north, position.latitude);
+ const lonAdjusted = position.longitude >= 0 ? position.longitude : position.longitude + Math_default.TWO_PI;
+ westOverIDL = Math.min(westOverIDL, lonAdjusted);
+ eastOverIDL = Math.max(eastOverIDL, lonAdjusted);
+ }
+ if (east - west > eastOverIDL - westOverIDL) {
+ west = westOverIDL;
+ east = eastOverIDL;
+ if (east > Math_default.PI) {
+ east = east - Math_default.TWO_PI;
+ }
+ if (west > Math_default.PI) {
+ west = west - Math_default.TWO_PI;
+ }
+ }
+ if (!defined_default(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+};
+Rectangle.clone = function(rectangle, result) {
+ if (!defined_default(rectangle)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Rectangle(
+ rectangle.west,
+ rectangle.south,
+ rectangle.east,
+ rectangle.north
+ );
+ }
+ result.west = rectangle.west;
+ result.south = rectangle.south;
+ result.east = rectangle.east;
+ result.north = rectangle.north;
+ return result;
+};
+Rectangle.equalsEpsilon = function(left, right, absoluteEpsilon) {
+ absoluteEpsilon = defaultValue_default(absoluteEpsilon, 0);
+ return left === right || defined_default(left) && defined_default(right) && Math.abs(left.west - right.west) <= absoluteEpsilon && Math.abs(left.south - right.south) <= absoluteEpsilon && Math.abs(left.east - right.east) <= absoluteEpsilon && Math.abs(left.north - right.north) <= absoluteEpsilon;
+};
+Rectangle.prototype.clone = function(result) {
+ return Rectangle.clone(this, result);
+};
+Rectangle.prototype.equals = function(other) {
+ return Rectangle.equals(this, other);
+};
+Rectangle.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.west === right.west && left.south === right.south && left.east === right.east && left.north === right.north;
+};
+Rectangle.prototype.equalsEpsilon = function(other, epsilon) {
+ return Rectangle.equalsEpsilon(this, other, epsilon);
+};
+Rectangle.validate = function(rectangle) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ const north = rectangle.north;
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "north",
+ north,
+ -Math_default.PI_OVER_TWO
+ );
+ Check_default.typeOf.number.lessThanOrEquals("north", north, Math_default.PI_OVER_TWO);
+ const south = rectangle.south;
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "south",
+ south,
+ -Math_default.PI_OVER_TWO
+ );
+ Check_default.typeOf.number.lessThanOrEquals("south", south, Math_default.PI_OVER_TWO);
+ const west = rectangle.west;
+ Check_default.typeOf.number.greaterThanOrEquals("west", west, -Math.PI);
+ Check_default.typeOf.number.lessThanOrEquals("west", west, Math.PI);
+ const east = rectangle.east;
+ Check_default.typeOf.number.greaterThanOrEquals("east", east, -Math.PI);
+ Check_default.typeOf.number.lessThanOrEquals("east", east, Math.PI);
+};
+Rectangle.southwest = function(rectangle, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ if (!defined_default(result)) {
+ return new Cartographic_default(rectangle.west, rectangle.south);
+ }
+ result.longitude = rectangle.west;
+ result.latitude = rectangle.south;
+ result.height = 0;
+ return result;
+};
+Rectangle.northwest = function(rectangle, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ if (!defined_default(result)) {
+ return new Cartographic_default(rectangle.west, rectangle.north);
+ }
+ result.longitude = rectangle.west;
+ result.latitude = rectangle.north;
+ result.height = 0;
+ return result;
+};
+Rectangle.northeast = function(rectangle, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ if (!defined_default(result)) {
+ return new Cartographic_default(rectangle.east, rectangle.north);
+ }
+ result.longitude = rectangle.east;
+ result.latitude = rectangle.north;
+ result.height = 0;
+ return result;
+};
+Rectangle.southeast = function(rectangle, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ if (!defined_default(result)) {
+ return new Cartographic_default(rectangle.east, rectangle.south);
+ }
+ result.longitude = rectangle.east;
+ result.latitude = rectangle.south;
+ result.height = 0;
+ return result;
+};
+Rectangle.center = function(rectangle, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ let east = rectangle.east;
+ const west = rectangle.west;
+ if (east < west) {
+ east += Math_default.TWO_PI;
+ }
+ const longitude = Math_default.negativePiToPi((west + east) * 0.5);
+ const latitude = (rectangle.south + rectangle.north) * 0.5;
+ if (!defined_default(result)) {
+ return new Cartographic_default(longitude, latitude);
+ }
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = 0;
+ return result;
+};
+Rectangle.intersection = function(rectangle, otherRectangle, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ Check_default.typeOf.object("otherRectangle", otherRectangle);
+ let rectangleEast = rectangle.east;
+ let rectangleWest = rectangle.west;
+ let otherRectangleEast = otherRectangle.east;
+ let otherRectangleWest = otherRectangle.west;
+ if (rectangleEast < rectangleWest && otherRectangleEast > 0) {
+ rectangleEast += Math_default.TWO_PI;
+ } else if (otherRectangleEast < otherRectangleWest && rectangleEast > 0) {
+ otherRectangleEast += Math_default.TWO_PI;
+ }
+ if (rectangleEast < rectangleWest && otherRectangleWest < 0) {
+ otherRectangleWest += Math_default.TWO_PI;
+ } else if (otherRectangleEast < otherRectangleWest && rectangleWest < 0) {
+ rectangleWest += Math_default.TWO_PI;
+ }
+ const west = Math_default.negativePiToPi(
+ Math.max(rectangleWest, otherRectangleWest)
+ );
+ const east = Math_default.negativePiToPi(
+ Math.min(rectangleEast, otherRectangleEast)
+ );
+ if ((rectangle.west < rectangle.east || otherRectangle.west < otherRectangle.east) && east <= west) {
+ return void 0;
+ }
+ const south = Math.max(rectangle.south, otherRectangle.south);
+ const north = Math.min(rectangle.north, otherRectangle.north);
+ if (south >= north) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+};
+Rectangle.simpleIntersection = function(rectangle, otherRectangle, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ Check_default.typeOf.object("otherRectangle", otherRectangle);
+ const west = Math.max(rectangle.west, otherRectangle.west);
+ const south = Math.max(rectangle.south, otherRectangle.south);
+ const east = Math.min(rectangle.east, otherRectangle.east);
+ const north = Math.min(rectangle.north, otherRectangle.north);
+ if (south >= north || west >= east) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Rectangle(west, south, east, north);
+ }
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+};
+Rectangle.union = function(rectangle, otherRectangle, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ Check_default.typeOf.object("otherRectangle", otherRectangle);
+ if (!defined_default(result)) {
+ result = new Rectangle();
+ }
+ let rectangleEast = rectangle.east;
+ let rectangleWest = rectangle.west;
+ let otherRectangleEast = otherRectangle.east;
+ let otherRectangleWest = otherRectangle.west;
+ if (rectangleEast < rectangleWest && otherRectangleEast > 0) {
+ rectangleEast += Math_default.TWO_PI;
+ } else if (otherRectangleEast < otherRectangleWest && rectangleEast > 0) {
+ otherRectangleEast += Math_default.TWO_PI;
+ }
+ if (rectangleEast < rectangleWest && otherRectangleWest < 0) {
+ otherRectangleWest += Math_default.TWO_PI;
+ } else if (otherRectangleEast < otherRectangleWest && rectangleWest < 0) {
+ rectangleWest += Math_default.TWO_PI;
+ }
+ const west = Math_default.negativePiToPi(
+ Math.min(rectangleWest, otherRectangleWest)
+ );
+ const east = Math_default.negativePiToPi(
+ Math.max(rectangleEast, otherRectangleEast)
+ );
+ result.west = west;
+ result.south = Math.min(rectangle.south, otherRectangle.south);
+ result.east = east;
+ result.north = Math.max(rectangle.north, otherRectangle.north);
+ return result;
+};
+Rectangle.expand = function(rectangle, cartographic2, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ Check_default.typeOf.object("cartographic", cartographic2);
+ if (!defined_default(result)) {
+ result = new Rectangle();
+ }
+ result.west = Math.min(rectangle.west, cartographic2.longitude);
+ result.south = Math.min(rectangle.south, cartographic2.latitude);
+ result.east = Math.max(rectangle.east, cartographic2.longitude);
+ result.north = Math.max(rectangle.north, cartographic2.latitude);
+ return result;
+};
+Rectangle.contains = function(rectangle, cartographic2) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ Check_default.typeOf.object("cartographic", cartographic2);
+ let longitude = cartographic2.longitude;
+ const latitude = cartographic2.latitude;
+ const west = rectangle.west;
+ let east = rectangle.east;
+ if (east < west) {
+ east += Math_default.TWO_PI;
+ if (longitude < 0) {
+ longitude += Math_default.TWO_PI;
+ }
+ }
+ return (longitude > west || Math_default.equalsEpsilon(longitude, west, Math_default.EPSILON14)) && (longitude < east || Math_default.equalsEpsilon(longitude, east, Math_default.EPSILON14)) && latitude >= rectangle.south && latitude <= rectangle.north;
+};
+var subsampleLlaScratch = new Cartographic_default();
+Rectangle.subsample = function(rectangle, ellipsoid, surfaceHeight, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ surfaceHeight = defaultValue_default(surfaceHeight, 0);
+ if (!defined_default(result)) {
+ result = [];
+ }
+ let length3 = 0;
+ const north = rectangle.north;
+ const south = rectangle.south;
+ const east = rectangle.east;
+ const west = rectangle.west;
+ const lla = subsampleLlaScratch;
+ lla.height = surfaceHeight;
+ lla.longitude = west;
+ lla.latitude = north;
+ result[length3] = ellipsoid.cartographicToCartesian(lla, result[length3]);
+ length3++;
+ lla.longitude = east;
+ result[length3] = ellipsoid.cartographicToCartesian(lla, result[length3]);
+ length3++;
+ lla.latitude = south;
+ result[length3] = ellipsoid.cartographicToCartesian(lla, result[length3]);
+ length3++;
+ lla.longitude = west;
+ result[length3] = ellipsoid.cartographicToCartesian(lla, result[length3]);
+ length3++;
+ if (north < 0) {
+ lla.latitude = north;
+ } else if (south > 0) {
+ lla.latitude = south;
+ } else {
+ lla.latitude = 0;
+ }
+ for (let i = 1; i < 8; ++i) {
+ lla.longitude = -Math.PI + i * Math_default.PI_OVER_TWO;
+ if (Rectangle.contains(rectangle, lla)) {
+ result[length3] = ellipsoid.cartographicToCartesian(lla, result[length3]);
+ length3++;
+ }
+ }
+ if (lla.latitude === 0) {
+ lla.longitude = west;
+ result[length3] = ellipsoid.cartographicToCartesian(lla, result[length3]);
+ length3++;
+ lla.longitude = east;
+ result[length3] = ellipsoid.cartographicToCartesian(lla, result[length3]);
+ length3++;
+ }
+ result.length = length3;
+ return result;
+};
+Rectangle.subsection = function(rectangle, westLerp, southLerp, eastLerp, northLerp, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ Check_default.typeOf.number.greaterThanOrEquals("westLerp", westLerp, 0);
+ Check_default.typeOf.number.lessThanOrEquals("westLerp", westLerp, 1);
+ Check_default.typeOf.number.greaterThanOrEquals("southLerp", southLerp, 0);
+ Check_default.typeOf.number.lessThanOrEquals("southLerp", southLerp, 1);
+ Check_default.typeOf.number.greaterThanOrEquals("eastLerp", eastLerp, 0);
+ Check_default.typeOf.number.lessThanOrEquals("eastLerp", eastLerp, 1);
+ Check_default.typeOf.number.greaterThanOrEquals("northLerp", northLerp, 0);
+ Check_default.typeOf.number.lessThanOrEquals("northLerp", northLerp, 1);
+ Check_default.typeOf.number.lessThanOrEquals("westLerp", westLerp, eastLerp);
+ Check_default.typeOf.number.lessThanOrEquals("southLerp", southLerp, northLerp);
+ if (!defined_default(result)) {
+ result = new Rectangle();
+ }
+ if (rectangle.west <= rectangle.east) {
+ const width = rectangle.east - rectangle.west;
+ result.west = rectangle.west + westLerp * width;
+ result.east = rectangle.west + eastLerp * width;
+ } else {
+ const width = Math_default.TWO_PI + rectangle.east - rectangle.west;
+ result.west = Math_default.negativePiToPi(rectangle.west + westLerp * width);
+ result.east = Math_default.negativePiToPi(rectangle.west + eastLerp * width);
+ }
+ const height = rectangle.north - rectangle.south;
+ result.south = rectangle.south + southLerp * height;
+ result.north = rectangle.south + northLerp * height;
+ if (westLerp === 1) {
+ result.west = rectangle.east;
+ }
+ if (eastLerp === 1) {
+ result.east = rectangle.east;
+ }
+ if (southLerp === 1) {
+ result.south = rectangle.north;
+ }
+ if (northLerp === 1) {
+ result.north = rectangle.north;
+ }
+ return result;
+};
+Rectangle.MAX_VALUE = Object.freeze(
+ new Rectangle(
+ -Math.PI,
+ -Math_default.PI_OVER_TWO,
+ Math.PI,
+ Math_default.PI_OVER_TWO
+ )
+);
+var Rectangle_default = Rectangle;
+
+// Source/Core/BoundingRectangle.js
+function BoundingRectangle(x, y, width, height) {
+ this.x = defaultValue_default(x, 0);
+ this.y = defaultValue_default(y, 0);
+ this.width = defaultValue_default(width, 0);
+ this.height = defaultValue_default(height, 0);
+}
+BoundingRectangle.packedLength = 4;
+BoundingRectangle.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.x;
+ array[startingIndex++] = value.y;
+ array[startingIndex++] = value.width;
+ array[startingIndex] = value.height;
+ return array;
+};
+BoundingRectangle.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new BoundingRectangle();
+ }
+ result.x = array[startingIndex++];
+ result.y = array[startingIndex++];
+ result.width = array[startingIndex++];
+ result.height = array[startingIndex];
+ return result;
+};
+BoundingRectangle.fromPoints = function(positions, result) {
+ if (!defined_default(result)) {
+ result = new BoundingRectangle();
+ }
+ if (!defined_default(positions) || positions.length === 0) {
+ result.x = 0;
+ result.y = 0;
+ result.width = 0;
+ result.height = 0;
+ return result;
+ }
+ const length3 = positions.length;
+ let minimumX = positions[0].x;
+ let minimumY = positions[0].y;
+ let maximumX = positions[0].x;
+ let maximumY = positions[0].y;
+ for (let i = 1; i < length3; i++) {
+ const p = positions[i];
+ const x = p.x;
+ const y = p.y;
+ minimumX = Math.min(x, minimumX);
+ maximumX = Math.max(x, maximumX);
+ minimumY = Math.min(y, minimumY);
+ maximumY = Math.max(y, maximumY);
+ }
+ result.x = minimumX;
+ result.y = minimumY;
+ result.width = maximumX - minimumX;
+ result.height = maximumY - minimumY;
+ return result;
+};
+var defaultProjection = new GeographicProjection_default();
+var fromRectangleLowerLeft = new Cartographic_default();
+var fromRectangleUpperRight = new Cartographic_default();
+BoundingRectangle.fromRectangle = function(rectangle, projection, result) {
+ if (!defined_default(result)) {
+ result = new BoundingRectangle();
+ }
+ if (!defined_default(rectangle)) {
+ result.x = 0;
+ result.y = 0;
+ result.width = 0;
+ result.height = 0;
+ return result;
+ }
+ projection = defaultValue_default(projection, defaultProjection);
+ const lowerLeft = projection.project(
+ Rectangle_default.southwest(rectangle, fromRectangleLowerLeft)
+ );
+ const upperRight = projection.project(
+ Rectangle_default.northeast(rectangle, fromRectangleUpperRight)
+ );
+ Cartesian2_default.subtract(upperRight, lowerLeft, upperRight);
+ result.x = lowerLeft.x;
+ result.y = lowerLeft.y;
+ result.width = upperRight.x;
+ result.height = upperRight.y;
+ return result;
+};
+BoundingRectangle.clone = function(rectangle, result) {
+ if (!defined_default(rectangle)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new BoundingRectangle(
+ rectangle.x,
+ rectangle.y,
+ rectangle.width,
+ rectangle.height
+ );
+ }
+ result.x = rectangle.x;
+ result.y = rectangle.y;
+ result.width = rectangle.width;
+ result.height = rectangle.height;
+ return result;
+};
+BoundingRectangle.union = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ if (!defined_default(result)) {
+ result = new BoundingRectangle();
+ }
+ const lowerLeftX = Math.min(left.x, right.x);
+ const lowerLeftY = Math.min(left.y, right.y);
+ const upperRightX = Math.max(left.x + left.width, right.x + right.width);
+ const upperRightY = Math.max(left.y + left.height, right.y + right.height);
+ result.x = lowerLeftX;
+ result.y = lowerLeftY;
+ result.width = upperRightX - lowerLeftX;
+ result.height = upperRightY - lowerLeftY;
+ return result;
+};
+BoundingRectangle.expand = function(rectangle, point, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ Check_default.typeOf.object("point", point);
+ result = BoundingRectangle.clone(rectangle, result);
+ const width = point.x - result.x;
+ const height = point.y - result.y;
+ if (width > result.width) {
+ result.width = width;
+ } else if (width < 0) {
+ result.width -= width;
+ result.x = point.x;
+ }
+ if (height > result.height) {
+ result.height = height;
+ } else if (height < 0) {
+ result.height -= height;
+ result.y = point.y;
+ }
+ return result;
+};
+BoundingRectangle.intersect = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ const leftX = left.x;
+ const leftY = left.y;
+ const rightX = right.x;
+ const rightY = right.y;
+ if (!(leftX > rightX + right.width || leftX + left.width < rightX || leftY + left.height < rightY || leftY > rightY + right.height)) {
+ return Intersect_default.INTERSECTING;
+ }
+ return Intersect_default.OUTSIDE;
+};
+BoundingRectangle.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.x === right.x && left.y === right.y && left.width === right.width && left.height === right.height;
+};
+BoundingRectangle.prototype.clone = function(result) {
+ return BoundingRectangle.clone(this, result);
+};
+BoundingRectangle.prototype.intersect = function(right) {
+ return BoundingRectangle.intersect(this, right);
+};
+BoundingRectangle.prototype.equals = function(right) {
+ return BoundingRectangle.equals(this, right);
+};
+var BoundingRectangle_default = BoundingRectangle;
+
+// Source/Core/PrimitiveType.js
+var PrimitiveType = {
+ POINTS: WebGLConstants_default.POINTS,
+ LINES: WebGLConstants_default.LINES,
+ LINE_LOOP: WebGLConstants_default.LINE_LOOP,
+ LINE_STRIP: WebGLConstants_default.LINE_STRIP,
+ TRIANGLES: WebGLConstants_default.TRIANGLES,
+ TRIANGLE_STRIP: WebGLConstants_default.TRIANGLE_STRIP,
+ TRIANGLE_FAN: WebGLConstants_default.TRIANGLE_FAN
+};
+PrimitiveType.isLines = function(primitiveType) {
+ return primitiveType === PrimitiveType.LINES || primitiveType === PrimitiveType.LINE_LOOP || primitiveType === PrimitiveType.LINE_STRIP;
+};
+PrimitiveType.isTriangles = function(primitiveType) {
+ return primitiveType === PrimitiveType.TRIANGLES || primitiveType === PrimitiveType.TRIANGLE_STRIP || primitiveType === PrimitiveType.TRIANGLE_FAN;
+};
+PrimitiveType.validate = function(primitiveType) {
+ return primitiveType === PrimitiveType.POINTS || primitiveType === PrimitiveType.LINES || primitiveType === PrimitiveType.LINE_LOOP || primitiveType === PrimitiveType.LINE_STRIP || primitiveType === PrimitiveType.TRIANGLES || primitiveType === PrimitiveType.TRIANGLE_STRIP || primitiveType === PrimitiveType.TRIANGLE_FAN;
+};
+var PrimitiveType_default = Object.freeze(PrimitiveType);
+
+// Source/Shaders/ViewportQuadVS.js
+var ViewportQuadVS_default = "attribute vec4 position;\nattribute vec2 textureCoordinates;\n\nvarying vec2 v_textureCoordinates;\n\nvoid main() \n{\n gl_Position = position;\n v_textureCoordinates = textureCoordinates;\n}\n";
+
+// Source/Renderer/DrawCommand.js
+var Flags = {
+ CULL: 1,
+ OCCLUDE: 2,
+ EXECUTE_IN_CLOSEST_FRUSTUM: 4,
+ DEBUG_SHOW_BOUNDING_VOLUME: 8,
+ CAST_SHADOWS: 16,
+ RECEIVE_SHADOWS: 32,
+ PICK_ONLY: 64,
+ DEPTH_FOR_TRANSLUCENT_CLASSIFICATION: 128
+};
+function DrawCommand(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._boundingVolume = options.boundingVolume;
+ this._orientedBoundingBox = options.orientedBoundingBox;
+ this._modelMatrix = options.modelMatrix;
+ this._primitiveType = defaultValue_default(
+ options.primitiveType,
+ PrimitiveType_default.TRIANGLES
+ );
+ this._vertexArray = options.vertexArray;
+ this._count = options.count;
+ this._offset = defaultValue_default(options.offset, 0);
+ this._instanceCount = defaultValue_default(options.instanceCount, 0);
+ this._shaderProgram = options.shaderProgram;
+ this._uniformMap = options.uniformMap;
+ this._renderState = options.renderState;
+ this._framebuffer = options.framebuffer;
+ this._pass = options.pass;
+ this._owner = options.owner;
+ this._debugOverlappingFrustums = 0;
+ this._pickId = options.pickId;
+ this._flags = 0;
+ this.cull = defaultValue_default(options.cull, true);
+ this.occlude = defaultValue_default(options.occlude, true);
+ this.executeInClosestFrustum = defaultValue_default(
+ options.executeInClosestFrustum,
+ false
+ );
+ this.debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this.castShadows = defaultValue_default(options.castShadows, false);
+ this.receiveShadows = defaultValue_default(options.receiveShadows, false);
+ this.pickOnly = defaultValue_default(options.pickOnly, false);
+ this.depthForTranslucentClassification = defaultValue_default(
+ options.depthForTranslucentClassification,
+ false
+ );
+ this.dirty = true;
+ this.lastDirtyTime = 0;
+ this.derivedCommands = {};
+}
+function hasFlag(command, flag) {
+ return (command._flags & flag) === flag;
+}
+function setFlag(command, flag, value) {
+ if (value) {
+ command._flags |= flag;
+ } else {
+ command._flags &= ~flag;
+ }
+}
+Object.defineProperties(DrawCommand.prototype, {
+ boundingVolume: {
+ get: function() {
+ return this._boundingVolume;
+ },
+ set: function(value) {
+ if (this._boundingVolume !== value) {
+ this._boundingVolume = value;
+ this.dirty = true;
+ }
+ }
+ },
+ orientedBoundingBox: {
+ get: function() {
+ return this._orientedBoundingBox;
+ },
+ set: function(value) {
+ if (this._orientedBoundingBox !== value) {
+ this._orientedBoundingBox = value;
+ this.dirty = true;
+ }
+ }
+ },
+ cull: {
+ get: function() {
+ return hasFlag(this, Flags.CULL);
+ },
+ set: function(value) {
+ if (hasFlag(this, Flags.CULL) !== value) {
+ setFlag(this, Flags.CULL, value);
+ this.dirty = true;
+ }
+ }
+ },
+ occlude: {
+ get: function() {
+ return hasFlag(this, Flags.OCCLUDE);
+ },
+ set: function(value) {
+ if (hasFlag(this, Flags.OCCLUDE) !== value) {
+ setFlag(this, Flags.OCCLUDE, value);
+ this.dirty = true;
+ }
+ }
+ },
+ modelMatrix: {
+ get: function() {
+ return this._modelMatrix;
+ },
+ set: function(value) {
+ if (this._modelMatrix !== value) {
+ this._modelMatrix = value;
+ this.dirty = true;
+ }
+ }
+ },
+ primitiveType: {
+ get: function() {
+ return this._primitiveType;
+ },
+ set: function(value) {
+ if (this._primitiveType !== value) {
+ this._primitiveType = value;
+ this.dirty = true;
+ }
+ }
+ },
+ vertexArray: {
+ get: function() {
+ return this._vertexArray;
+ },
+ set: function(value) {
+ if (this._vertexArray !== value) {
+ this._vertexArray = value;
+ this.dirty = true;
+ }
+ }
+ },
+ count: {
+ get: function() {
+ return this._count;
+ },
+ set: function(value) {
+ if (this._count !== value) {
+ this._count = value;
+ this.dirty = true;
+ }
+ }
+ },
+ offset: {
+ get: function() {
+ return this._offset;
+ },
+ set: function(value) {
+ if (this._offset !== value) {
+ this._offset = value;
+ this.dirty = true;
+ }
+ }
+ },
+ instanceCount: {
+ get: function() {
+ return this._instanceCount;
+ },
+ set: function(value) {
+ if (this._instanceCount !== value) {
+ this._instanceCount = value;
+ this.dirty = true;
+ }
+ }
+ },
+ shaderProgram: {
+ get: function() {
+ return this._shaderProgram;
+ },
+ set: function(value) {
+ if (this._shaderProgram !== value) {
+ this._shaderProgram = value;
+ this.dirty = true;
+ }
+ }
+ },
+ castShadows: {
+ get: function() {
+ return hasFlag(this, Flags.CAST_SHADOWS);
+ },
+ set: function(value) {
+ if (hasFlag(this, Flags.CAST_SHADOWS) !== value) {
+ setFlag(this, Flags.CAST_SHADOWS, value);
+ this.dirty = true;
+ }
+ }
+ },
+ receiveShadows: {
+ get: function() {
+ return hasFlag(this, Flags.RECEIVE_SHADOWS);
+ },
+ set: function(value) {
+ if (hasFlag(this, Flags.RECEIVE_SHADOWS) !== value) {
+ setFlag(this, Flags.RECEIVE_SHADOWS, value);
+ this.dirty = true;
+ }
+ }
+ },
+ uniformMap: {
+ get: function() {
+ return this._uniformMap;
+ },
+ set: function(value) {
+ if (this._uniformMap !== value) {
+ this._uniformMap = value;
+ this.dirty = true;
+ }
+ }
+ },
+ renderState: {
+ get: function() {
+ return this._renderState;
+ },
+ set: function(value) {
+ if (this._renderState !== value) {
+ this._renderState = value;
+ this.dirty = true;
+ }
+ }
+ },
+ framebuffer: {
+ get: function() {
+ return this._framebuffer;
+ },
+ set: function(value) {
+ if (this._framebuffer !== value) {
+ this._framebuffer = value;
+ this.dirty = true;
+ }
+ }
+ },
+ pass: {
+ get: function() {
+ return this._pass;
+ },
+ set: function(value) {
+ if (this._pass !== value) {
+ this._pass = value;
+ this.dirty = true;
+ }
+ }
+ },
+ executeInClosestFrustum: {
+ get: function() {
+ return hasFlag(this, Flags.EXECUTE_IN_CLOSEST_FRUSTUM);
+ },
+ set: function(value) {
+ if (hasFlag(this, Flags.EXECUTE_IN_CLOSEST_FRUSTUM) !== value) {
+ setFlag(this, Flags.EXECUTE_IN_CLOSEST_FRUSTUM, value);
+ this.dirty = true;
+ }
+ }
+ },
+ owner: {
+ get: function() {
+ return this._owner;
+ },
+ set: function(value) {
+ if (this._owner !== value) {
+ this._owner = value;
+ this.dirty = true;
+ }
+ }
+ },
+ debugShowBoundingVolume: {
+ get: function() {
+ return hasFlag(this, Flags.DEBUG_SHOW_BOUNDING_VOLUME);
+ },
+ set: function(value) {
+ if (hasFlag(this, Flags.DEBUG_SHOW_BOUNDING_VOLUME) !== value) {
+ setFlag(this, Flags.DEBUG_SHOW_BOUNDING_VOLUME, value);
+ this.dirty = true;
+ }
+ }
+ },
+ debugOverlappingFrustums: {
+ get: function() {
+ return this._debugOverlappingFrustums;
+ },
+ set: function(value) {
+ if (this._debugOverlappingFrustums !== value) {
+ this._debugOverlappingFrustums = value;
+ this.dirty = true;
+ }
+ }
+ },
+ pickId: {
+ get: function() {
+ return this._pickId;
+ },
+ set: function(value) {
+ if (this._pickId !== value) {
+ this._pickId = value;
+ this.dirty = true;
+ }
+ }
+ },
+ pickOnly: {
+ get: function() {
+ return hasFlag(this, Flags.PICK_ONLY);
+ },
+ set: function(value) {
+ if (hasFlag(this, Flags.PICK_ONLY) !== value) {
+ setFlag(this, Flags.PICK_ONLY, value);
+ this.dirty = true;
+ }
+ }
+ },
+ depthForTranslucentClassification: {
+ get: function() {
+ return hasFlag(this, Flags.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION);
+ },
+ set: function(value) {
+ if (hasFlag(this, Flags.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION) !== value) {
+ setFlag(this, Flags.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION, value);
+ this.dirty = true;
+ }
+ }
+ }
+});
+DrawCommand.shallowClone = function(command, result) {
+ if (!defined_default(command)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ result = new DrawCommand();
+ }
+ result._boundingVolume = command._boundingVolume;
+ result._orientedBoundingBox = command._orientedBoundingBox;
+ result._modelMatrix = command._modelMatrix;
+ result._primitiveType = command._primitiveType;
+ result._vertexArray = command._vertexArray;
+ result._count = command._count;
+ result._offset = command._offset;
+ result._instanceCount = command._instanceCount;
+ result._shaderProgram = command._shaderProgram;
+ result._uniformMap = command._uniformMap;
+ result._renderState = command._renderState;
+ result._framebuffer = command._framebuffer;
+ result._pass = command._pass;
+ result._owner = command._owner;
+ result._debugOverlappingFrustums = command._debugOverlappingFrustums;
+ result._pickId = command._pickId;
+ result._flags = command._flags;
+ result.dirty = true;
+ result.lastDirtyTime = 0;
+ return result;
+};
+DrawCommand.prototype.execute = function(context, passState) {
+ context.draw(this, passState);
+};
+var DrawCommand_default = DrawCommand;
+
+// Source/Renderer/PixelDatatype.js
+var PixelDatatype = {
+ UNSIGNED_BYTE: WebGLConstants_default.UNSIGNED_BYTE,
+ UNSIGNED_SHORT: WebGLConstants_default.UNSIGNED_SHORT,
+ UNSIGNED_INT: WebGLConstants_default.UNSIGNED_INT,
+ FLOAT: WebGLConstants_default.FLOAT,
+ HALF_FLOAT: WebGLConstants_default.HALF_FLOAT_OES,
+ UNSIGNED_INT_24_8: WebGLConstants_default.UNSIGNED_INT_24_8,
+ UNSIGNED_SHORT_4_4_4_4: WebGLConstants_default.UNSIGNED_SHORT_4_4_4_4,
+ UNSIGNED_SHORT_5_5_5_1: WebGLConstants_default.UNSIGNED_SHORT_5_5_5_1,
+ UNSIGNED_SHORT_5_6_5: WebGLConstants_default.UNSIGNED_SHORT_5_6_5
+};
+PixelDatatype.toWebGLConstant = function(pixelDatatype, context) {
+ switch (pixelDatatype) {
+ case PixelDatatype.UNSIGNED_BYTE:
+ return WebGLConstants_default.UNSIGNED_BYTE;
+ case PixelDatatype.UNSIGNED_SHORT:
+ return WebGLConstants_default.UNSIGNED_SHORT;
+ case PixelDatatype.UNSIGNED_INT:
+ return WebGLConstants_default.UNSIGNED_INT;
+ case PixelDatatype.FLOAT:
+ return WebGLConstants_default.FLOAT;
+ case PixelDatatype.HALF_FLOAT:
+ return context.webgl2 ? WebGLConstants_default.HALF_FLOAT : WebGLConstants_default.HALF_FLOAT_OES;
+ case PixelDatatype.UNSIGNED_INT_24_8:
+ return WebGLConstants_default.UNSIGNED_INT_24_8;
+ case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:
+ return WebGLConstants_default.UNSIGNED_SHORT_4_4_4_4;
+ case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:
+ return WebGLConstants_default.UNSIGNED_SHORT_5_5_5_1;
+ case PixelDatatype.UNSIGNED_SHORT_5_6_5:
+ return PixelDatatype.UNSIGNED_SHORT_5_6_5;
+ }
+};
+PixelDatatype.isPacked = function(pixelDatatype) {
+ return pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 || pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 || pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 || pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5;
+};
+PixelDatatype.sizeInBytes = function(pixelDatatype) {
+ switch (pixelDatatype) {
+ case PixelDatatype.UNSIGNED_BYTE:
+ return 1;
+ case PixelDatatype.UNSIGNED_SHORT:
+ case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:
+ case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:
+ case PixelDatatype.UNSIGNED_SHORT_5_6_5:
+ case PixelDatatype.HALF_FLOAT:
+ return 2;
+ case PixelDatatype.UNSIGNED_INT:
+ case PixelDatatype.FLOAT:
+ case PixelDatatype.UNSIGNED_INT_24_8:
+ return 4;
+ }
+};
+PixelDatatype.validate = function(pixelDatatype) {
+ return pixelDatatype === PixelDatatype.UNSIGNED_BYTE || pixelDatatype === PixelDatatype.UNSIGNED_SHORT || pixelDatatype === PixelDatatype.UNSIGNED_INT || pixelDatatype === PixelDatatype.FLOAT || pixelDatatype === PixelDatatype.HALF_FLOAT || pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 || pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 || pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 || pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5;
+};
+var PixelDatatype_default = Object.freeze(PixelDatatype);
+
+// Source/Core/PixelFormat.js
+var PixelFormat = {
+ DEPTH_COMPONENT: WebGLConstants_default.DEPTH_COMPONENT,
+ DEPTH_STENCIL: WebGLConstants_default.DEPTH_STENCIL,
+ ALPHA: WebGLConstants_default.ALPHA,
+ RGB: WebGLConstants_default.RGB,
+ RGBA: WebGLConstants_default.RGBA,
+ LUMINANCE: WebGLConstants_default.LUMINANCE,
+ LUMINANCE_ALPHA: WebGLConstants_default.LUMINANCE_ALPHA,
+ RGB_DXT1: WebGLConstants_default.COMPRESSED_RGB_S3TC_DXT1_EXT,
+ RGBA_DXT1: WebGLConstants_default.COMPRESSED_RGBA_S3TC_DXT1_EXT,
+ RGBA_DXT3: WebGLConstants_default.COMPRESSED_RGBA_S3TC_DXT3_EXT,
+ RGBA_DXT5: WebGLConstants_default.COMPRESSED_RGBA_S3TC_DXT5_EXT,
+ RGB_PVRTC_4BPPV1: WebGLConstants_default.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,
+ RGB_PVRTC_2BPPV1: WebGLConstants_default.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,
+ RGBA_PVRTC_4BPPV1: WebGLConstants_default.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,
+ RGBA_PVRTC_2BPPV1: WebGLConstants_default.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,
+ RGBA_ASTC: WebGLConstants_default.COMPRESSED_RGBA_ASTC_4x4_WEBGL,
+ RGB_ETC1: WebGLConstants_default.COMPRESSED_RGB_ETC1_WEBGL,
+ RGB8_ETC2: WebGLConstants_default.COMPRESSED_RGB8_ETC2,
+ RGBA8_ETC2_EAC: WebGLConstants_default.COMPRESSED_RGBA8_ETC2_EAC,
+ RGBA_BC7: WebGLConstants_default.COMPRESSED_RGBA_BPTC_UNORM
+};
+PixelFormat.componentsLength = function(pixelFormat) {
+ switch (pixelFormat) {
+ case PixelFormat.RGB:
+ return 3;
+ case PixelFormat.RGBA:
+ return 4;
+ case PixelFormat.LUMINANCE_ALPHA:
+ return 2;
+ case PixelFormat.ALPHA:
+ case PixelFormat.LUMINANCE:
+ return 1;
+ default:
+ return 1;
+ }
+};
+PixelFormat.validate = function(pixelFormat) {
+ return pixelFormat === PixelFormat.DEPTH_COMPONENT || pixelFormat === PixelFormat.DEPTH_STENCIL || pixelFormat === PixelFormat.ALPHA || pixelFormat === PixelFormat.RGB || pixelFormat === PixelFormat.RGBA || pixelFormat === PixelFormat.LUMINANCE || pixelFormat === PixelFormat.LUMINANCE_ALPHA || pixelFormat === PixelFormat.RGB_DXT1 || pixelFormat === PixelFormat.RGBA_DXT1 || pixelFormat === PixelFormat.RGBA_DXT3 || pixelFormat === PixelFormat.RGBA_DXT5 || pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 || pixelFormat === PixelFormat.RGBA_ASTC || pixelFormat === PixelFormat.RGB_ETC1 || pixelFormat === PixelFormat.RGB8_ETC2 || pixelFormat === PixelFormat.RGBA8_ETC2_EAC || pixelFormat === PixelFormat.RGBA_BC7;
+};
+PixelFormat.isColorFormat = function(pixelFormat) {
+ return pixelFormat === PixelFormat.ALPHA || pixelFormat === PixelFormat.RGB || pixelFormat === PixelFormat.RGBA || pixelFormat === PixelFormat.LUMINANCE || pixelFormat === PixelFormat.LUMINANCE_ALPHA;
+};
+PixelFormat.isDepthFormat = function(pixelFormat) {
+ return pixelFormat === PixelFormat.DEPTH_COMPONENT || pixelFormat === PixelFormat.DEPTH_STENCIL;
+};
+PixelFormat.isCompressedFormat = function(pixelFormat) {
+ return pixelFormat === PixelFormat.RGB_DXT1 || pixelFormat === PixelFormat.RGBA_DXT1 || pixelFormat === PixelFormat.RGBA_DXT3 || pixelFormat === PixelFormat.RGBA_DXT5 || pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1 || pixelFormat === PixelFormat.RGBA_ASTC || pixelFormat === PixelFormat.RGB_ETC1 || pixelFormat === PixelFormat.RGB8_ETC2 || pixelFormat === PixelFormat.RGBA8_ETC2_EAC || pixelFormat === PixelFormat.RGBA_BC7;
+};
+PixelFormat.isDXTFormat = function(pixelFormat) {
+ return pixelFormat === PixelFormat.RGB_DXT1 || pixelFormat === PixelFormat.RGBA_DXT1 || pixelFormat === PixelFormat.RGBA_DXT3 || pixelFormat === PixelFormat.RGBA_DXT5;
+};
+PixelFormat.isPVRTCFormat = function(pixelFormat) {
+ return pixelFormat === PixelFormat.RGB_PVRTC_4BPPV1 || pixelFormat === PixelFormat.RGB_PVRTC_2BPPV1 || pixelFormat === PixelFormat.RGBA_PVRTC_4BPPV1 || pixelFormat === PixelFormat.RGBA_PVRTC_2BPPV1;
+};
+PixelFormat.isASTCFormat = function(pixelFormat) {
+ return pixelFormat === PixelFormat.RGBA_ASTC;
+};
+PixelFormat.isETC1Format = function(pixelFormat) {
+ return pixelFormat === PixelFormat.RGB_ETC1;
+};
+PixelFormat.isETC2Format = function(pixelFormat) {
+ return pixelFormat === PixelFormat.RGB8_ETC2 || pixelFormat === PixelFormat.RGBA8_ETC2_EAC;
+};
+PixelFormat.isBC7Format = function(pixelFormat) {
+ return pixelFormat === PixelFormat.RGBA_BC7;
+};
+PixelFormat.compressedTextureSizeInBytes = function(pixelFormat, width, height) {
+ switch (pixelFormat) {
+ case PixelFormat.RGB_DXT1:
+ case PixelFormat.RGBA_DXT1:
+ case PixelFormat.RGB_ETC1:
+ case PixelFormat.RGB8_ETC2:
+ return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;
+ case PixelFormat.RGBA_DXT3:
+ case PixelFormat.RGBA_DXT5:
+ case PixelFormat.RGBA_ASTC:
+ case PixelFormat.RGBA8_ETC2_EAC:
+ return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;
+ case PixelFormat.RGB_PVRTC_4BPPV1:
+ case PixelFormat.RGBA_PVRTC_4BPPV1:
+ return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8);
+ case PixelFormat.RGB_PVRTC_2BPPV1:
+ case PixelFormat.RGBA_PVRTC_2BPPV1:
+ return Math.floor(
+ (Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8
+ );
+ case PixelFormat.RGBA_BC7:
+ return Math.ceil(width / 4) * Math.ceil(height / 4) * 16;
+ default:
+ return 0;
+ }
+};
+PixelFormat.textureSizeInBytes = function(pixelFormat, pixelDatatype, width, height) {
+ let componentsLength = PixelFormat.componentsLength(pixelFormat);
+ if (PixelDatatype_default.isPacked(pixelDatatype)) {
+ componentsLength = 1;
+ }
+ return componentsLength * PixelDatatype_default.sizeInBytes(pixelDatatype) * width * height;
+};
+PixelFormat.alignmentInBytes = function(pixelFormat, pixelDatatype, width) {
+ const mod2 = PixelFormat.textureSizeInBytes(pixelFormat, pixelDatatype, width, 1) % 4;
+ return mod2 === 0 ? 4 : mod2 === 2 ? 2 : 1;
+};
+PixelFormat.createTypedArray = function(pixelFormat, pixelDatatype, width, height) {
+ let constructor;
+ const sizeInBytes = PixelDatatype_default.sizeInBytes(pixelDatatype);
+ if (sizeInBytes === Uint8Array.BYTES_PER_ELEMENT) {
+ constructor = Uint8Array;
+ } else if (sizeInBytes === Uint16Array.BYTES_PER_ELEMENT) {
+ constructor = Uint16Array;
+ } else if (sizeInBytes === Float32Array.BYTES_PER_ELEMENT && pixelDatatype === PixelDatatype_default.FLOAT) {
+ constructor = Float32Array;
+ } else {
+ constructor = Uint32Array;
+ }
+ const size = PixelFormat.componentsLength(pixelFormat) * width * height;
+ return new constructor(size);
+};
+PixelFormat.flipY = function(bufferView, pixelFormat, pixelDatatype, width, height) {
+ if (height === 1) {
+ return bufferView;
+ }
+ const flipped = PixelFormat.createTypedArray(
+ pixelFormat,
+ pixelDatatype,
+ width,
+ height
+ );
+ const numberOfComponents = PixelFormat.componentsLength(pixelFormat);
+ const textureWidth = width * numberOfComponents;
+ for (let i = 0; i < height; ++i) {
+ const row = i * width * numberOfComponents;
+ const flippedRow = (height - i - 1) * width * numberOfComponents;
+ for (let j = 0; j < textureWidth; ++j) {
+ flipped[flippedRow + j] = bufferView[row + j];
+ }
+ }
+ return flipped;
+};
+PixelFormat.toInternalFormat = function(pixelFormat, pixelDatatype, context) {
+ if (!context.webgl2) {
+ return pixelFormat;
+ }
+ if (pixelFormat === PixelFormat.DEPTH_STENCIL) {
+ return WebGLConstants_default.DEPTH24_STENCIL8;
+ }
+ if (pixelFormat === PixelFormat.DEPTH_COMPONENT) {
+ if (pixelDatatype === PixelDatatype_default.UNSIGNED_SHORT) {
+ return WebGLConstants_default.DEPTH_COMPONENT16;
+ } else if (pixelDatatype === PixelDatatype_default.UNSIGNED_INT) {
+ return WebGLConstants_default.DEPTH_COMPONENT24;
+ }
+ }
+ if (pixelDatatype === PixelDatatype_default.FLOAT) {
+ switch (pixelFormat) {
+ case PixelFormat.RGBA:
+ return WebGLConstants_default.RGBA32F;
+ case PixelFormat.RGB:
+ return WebGLConstants_default.RGB32F;
+ case PixelFormat.RG:
+ return WebGLConstants_default.RG32F;
+ case PixelFormat.R:
+ return WebGLConstants_default.R32F;
+ }
+ }
+ if (pixelDatatype === PixelDatatype_default.HALF_FLOAT) {
+ switch (pixelFormat) {
+ case PixelFormat.RGBA:
+ return WebGLConstants_default.RGBA16F;
+ case PixelFormat.RGB:
+ return WebGLConstants_default.RGB16F;
+ case PixelFormat.RG:
+ return WebGLConstants_default.RG16F;
+ case PixelFormat.R:
+ return WebGLConstants_default.R16F;
+ }
+ }
+ return pixelFormat;
+};
+var PixelFormat_default = Object.freeze(PixelFormat);
+
+// Source/Renderer/ContextLimits.js
+var ContextLimits = {
+ _maximumCombinedTextureImageUnits: 0,
+ _maximumCubeMapSize: 0,
+ _maximumFragmentUniformVectors: 0,
+ _maximumTextureImageUnits: 0,
+ _maximumRenderbufferSize: 0,
+ _maximumTextureSize: 0,
+ _maximumVaryingVectors: 0,
+ _maximumVertexAttributes: 0,
+ _maximumVertexTextureImageUnits: 0,
+ _maximumVertexUniformVectors: 0,
+ _minimumAliasedLineWidth: 0,
+ _maximumAliasedLineWidth: 0,
+ _minimumAliasedPointSize: 0,
+ _maximumAliasedPointSize: 0,
+ _maximumViewportWidth: 0,
+ _maximumViewportHeight: 0,
+ _maximumTextureFilterAnisotropy: 0,
+ _maximumDrawBuffers: 0,
+ _maximumColorAttachments: 0,
+ _maximumSamples: 0,
+ _highpFloatSupported: false,
+ _highpIntSupported: false
+};
+Object.defineProperties(ContextLimits, {
+ maximumCombinedTextureImageUnits: {
+ get: function() {
+ return ContextLimits._maximumCombinedTextureImageUnits;
+ }
+ },
+ maximumCubeMapSize: {
+ get: function() {
+ return ContextLimits._maximumCubeMapSize;
+ }
+ },
+ maximumFragmentUniformVectors: {
+ get: function() {
+ return ContextLimits._maximumFragmentUniformVectors;
+ }
+ },
+ maximumTextureImageUnits: {
+ get: function() {
+ return ContextLimits._maximumTextureImageUnits;
+ }
+ },
+ maximumRenderbufferSize: {
+ get: function() {
+ return ContextLimits._maximumRenderbufferSize;
+ }
+ },
+ maximumTextureSize: {
+ get: function() {
+ return ContextLimits._maximumTextureSize;
+ }
+ },
+ maximumVaryingVectors: {
+ get: function() {
+ return ContextLimits._maximumVaryingVectors;
+ }
+ },
+ maximumVertexAttributes: {
+ get: function() {
+ return ContextLimits._maximumVertexAttributes;
+ }
+ },
+ maximumVertexTextureImageUnits: {
+ get: function() {
+ return ContextLimits._maximumVertexTextureImageUnits;
+ }
+ },
+ maximumVertexUniformVectors: {
+ get: function() {
+ return ContextLimits._maximumVertexUniformVectors;
+ }
+ },
+ minimumAliasedLineWidth: {
+ get: function() {
+ return ContextLimits._minimumAliasedLineWidth;
+ }
+ },
+ maximumAliasedLineWidth: {
+ get: function() {
+ return ContextLimits._maximumAliasedLineWidth;
+ }
+ },
+ minimumAliasedPointSize: {
+ get: function() {
+ return ContextLimits._minimumAliasedPointSize;
+ }
+ },
+ maximumAliasedPointSize: {
+ get: function() {
+ return ContextLimits._maximumAliasedPointSize;
+ }
+ },
+ maximumViewportWidth: {
+ get: function() {
+ return ContextLimits._maximumViewportWidth;
+ }
+ },
+ maximumViewportHeight: {
+ get: function() {
+ return ContextLimits._maximumViewportHeight;
+ }
+ },
+ maximumTextureFilterAnisotropy: {
+ get: function() {
+ return ContextLimits._maximumTextureFilterAnisotropy;
+ }
+ },
+ maximumDrawBuffers: {
+ get: function() {
+ return ContextLimits._maximumDrawBuffers;
+ }
+ },
+ maximumColorAttachments: {
+ get: function() {
+ return ContextLimits._maximumColorAttachments;
+ }
+ },
+ maximumSamples: {
+ get: function() {
+ return ContextLimits._maximumSamples;
+ }
+ },
+ highpFloatSupported: {
+ get: function() {
+ return ContextLimits._highpFloatSupported;
+ }
+ },
+ highpIntSupported: {
+ get: function() {
+ return ContextLimits._highpIntSupported;
+ }
+ }
+});
+var ContextLimits_default = ContextLimits;
+
+// Source/Renderer/Framebuffer.js
+function attachTexture(framebuffer, attachment, texture) {
+ const gl = framebuffer._gl;
+ gl.framebufferTexture2D(
+ gl.FRAMEBUFFER,
+ attachment,
+ texture._target,
+ texture._texture,
+ 0
+ );
+}
+function attachRenderbuffer(framebuffer, attachment, renderbuffer) {
+ const gl = framebuffer._gl;
+ gl.framebufferRenderbuffer(
+ gl.FRAMEBUFFER,
+ attachment,
+ gl.RENDERBUFFER,
+ renderbuffer._getRenderbuffer()
+ );
+}
+function Framebuffer(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const context = options.context;
+ Check_default.defined("options.context", context);
+ const gl = context._gl;
+ const maximumColorAttachments = ContextLimits_default.maximumColorAttachments;
+ this._gl = gl;
+ this._framebuffer = gl.createFramebuffer();
+ this._colorTextures = [];
+ this._colorRenderbuffers = [];
+ this._activeColorAttachments = [];
+ this._depthTexture = void 0;
+ this._depthRenderbuffer = void 0;
+ this._stencilRenderbuffer = void 0;
+ this._depthStencilTexture = void 0;
+ this._depthStencilRenderbuffer = void 0;
+ this.destroyAttachments = defaultValue_default(options.destroyAttachments, true);
+ if (defined_default(options.colorTextures) && defined_default(options.colorRenderbuffers)) {
+ throw new DeveloperError_default(
+ "Cannot have both color texture and color renderbuffer attachments."
+ );
+ }
+ if (defined_default(options.depthTexture) && defined_default(options.depthRenderbuffer)) {
+ throw new DeveloperError_default(
+ "Cannot have both a depth texture and depth renderbuffer attachment."
+ );
+ }
+ if (defined_default(options.depthStencilTexture) && defined_default(options.depthStencilRenderbuffer)) {
+ throw new DeveloperError_default(
+ "Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment."
+ );
+ }
+ const depthAttachment = defined_default(options.depthTexture) || defined_default(options.depthRenderbuffer);
+ const depthStencilAttachment = defined_default(options.depthStencilTexture) || defined_default(options.depthStencilRenderbuffer);
+ if (depthAttachment && depthStencilAttachment) {
+ throw new DeveloperError_default(
+ "Cannot have both a depth and depth-stencil attachment."
+ );
+ }
+ if (defined_default(options.stencilRenderbuffer) && depthStencilAttachment) {
+ throw new DeveloperError_default(
+ "Cannot have both a stencil and depth-stencil attachment."
+ );
+ }
+ if (depthAttachment && defined_default(options.stencilRenderbuffer)) {
+ throw new DeveloperError_default(
+ "Cannot have both a depth and stencil attachment."
+ );
+ }
+ this._bind();
+ let texture;
+ let renderbuffer;
+ let i;
+ let length3;
+ let attachmentEnum;
+ if (defined_default(options.colorTextures)) {
+ const textures = options.colorTextures;
+ length3 = this._colorTextures.length = this._activeColorAttachments.length = textures.length;
+ if (length3 > maximumColorAttachments) {
+ throw new DeveloperError_default(
+ "The number of color attachments exceeds the number supported."
+ );
+ }
+ for (i = 0; i < length3; ++i) {
+ texture = textures[i];
+ if (!PixelFormat_default.isColorFormat(texture.pixelFormat)) {
+ throw new DeveloperError_default(
+ "The color-texture pixel-format must be a color format."
+ );
+ }
+ if (texture.pixelDatatype === PixelDatatype_default.FLOAT && !context.colorBufferFloat) {
+ throw new DeveloperError_default(
+ "The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat."
+ );
+ }
+ if (texture.pixelDatatype === PixelDatatype_default.HALF_FLOAT && !context.colorBufferHalfFloat) {
+ throw new DeveloperError_default(
+ "The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat."
+ );
+ }
+ attachmentEnum = this._gl.COLOR_ATTACHMENT0 + i;
+ attachTexture(this, attachmentEnum, texture);
+ this._activeColorAttachments[i] = attachmentEnum;
+ this._colorTextures[i] = texture;
+ }
+ }
+ if (defined_default(options.colorRenderbuffers)) {
+ const renderbuffers = options.colorRenderbuffers;
+ length3 = this._colorRenderbuffers.length = this._activeColorAttachments.length = renderbuffers.length;
+ if (length3 > maximumColorAttachments) {
+ throw new DeveloperError_default(
+ "The number of color attachments exceeds the number supported."
+ );
+ }
+ for (i = 0; i < length3; ++i) {
+ renderbuffer = renderbuffers[i];
+ attachmentEnum = this._gl.COLOR_ATTACHMENT0 + i;
+ attachRenderbuffer(this, attachmentEnum, renderbuffer);
+ this._activeColorAttachments[i] = attachmentEnum;
+ this._colorRenderbuffers[i] = renderbuffer;
+ }
+ }
+ if (defined_default(options.depthTexture)) {
+ texture = options.depthTexture;
+ if (texture.pixelFormat !== PixelFormat_default.DEPTH_COMPONENT) {
+ throw new DeveloperError_default(
+ "The depth-texture pixel-format must be DEPTH_COMPONENT."
+ );
+ }
+ attachTexture(this, this._gl.DEPTH_ATTACHMENT, texture);
+ this._depthTexture = texture;
+ }
+ if (defined_default(options.depthRenderbuffer)) {
+ renderbuffer = options.depthRenderbuffer;
+ attachRenderbuffer(this, this._gl.DEPTH_ATTACHMENT, renderbuffer);
+ this._depthRenderbuffer = renderbuffer;
+ }
+ if (defined_default(options.stencilRenderbuffer)) {
+ renderbuffer = options.stencilRenderbuffer;
+ attachRenderbuffer(this, this._gl.STENCIL_ATTACHMENT, renderbuffer);
+ this._stencilRenderbuffer = renderbuffer;
+ }
+ if (defined_default(options.depthStencilTexture)) {
+ texture = options.depthStencilTexture;
+ if (texture.pixelFormat !== PixelFormat_default.DEPTH_STENCIL) {
+ throw new DeveloperError_default(
+ "The depth-stencil pixel-format must be DEPTH_STENCIL."
+ );
+ }
+ attachTexture(this, this._gl.DEPTH_STENCIL_ATTACHMENT, texture);
+ this._depthStencilTexture = texture;
+ }
+ if (defined_default(options.depthStencilRenderbuffer)) {
+ renderbuffer = options.depthStencilRenderbuffer;
+ attachRenderbuffer(this, this._gl.DEPTH_STENCIL_ATTACHMENT, renderbuffer);
+ this._depthStencilRenderbuffer = renderbuffer;
+ }
+ this._unBind();
+}
+Object.defineProperties(Framebuffer.prototype, {
+ status: {
+ get: function() {
+ this._bind();
+ const status = this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);
+ this._unBind();
+ return status;
+ }
+ },
+ numberOfColorAttachments: {
+ get: function() {
+ return this._activeColorAttachments.length;
+ }
+ },
+ depthTexture: {
+ get: function() {
+ return this._depthTexture;
+ }
+ },
+ depthRenderbuffer: {
+ get: function() {
+ return this._depthRenderbuffer;
+ }
+ },
+ stencilRenderbuffer: {
+ get: function() {
+ return this._stencilRenderbuffer;
+ }
+ },
+ depthStencilTexture: {
+ get: function() {
+ return this._depthStencilTexture;
+ }
+ },
+ depthStencilRenderbuffer: {
+ get: function() {
+ return this._depthStencilRenderbuffer;
+ }
+ },
+ hasDepthAttachment: {
+ get: function() {
+ return !!(this.depthTexture || this.depthRenderbuffer || this.depthStencilTexture || this.depthStencilRenderbuffer);
+ }
+ }
+});
+Framebuffer.prototype._bind = function() {
+ const gl = this._gl;
+ gl.bindFramebuffer(gl.FRAMEBUFFER, this._framebuffer);
+};
+Framebuffer.prototype._unBind = function() {
+ const gl = this._gl;
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+};
+Framebuffer.prototype.bindDraw = function() {
+ const gl = this._gl;
+ gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, this._framebuffer);
+};
+Framebuffer.prototype.bindRead = function() {
+ const gl = this._gl;
+ gl.bindFramebuffer(gl.READ_FRAMEBUFFER, this._framebuffer);
+};
+Framebuffer.prototype._getActiveColorAttachments = function() {
+ return this._activeColorAttachments;
+};
+Framebuffer.prototype.getColorTexture = function(index) {
+ if (!defined_default(index) || index < 0 || index >= this._colorTextures.length) {
+ throw new DeveloperError_default(
+ "index is required, must be greater than or equal to zero and must be less than the number of color attachments."
+ );
+ }
+ return this._colorTextures[index];
+};
+Framebuffer.prototype.getColorRenderbuffer = function(index) {
+ if (!defined_default(index) || index < 0 || index >= this._colorRenderbuffers.length) {
+ throw new DeveloperError_default(
+ "index is required, must be greater than or equal to zero and must be less than the number of color attachments."
+ );
+ }
+ return this._colorRenderbuffers[index];
+};
+Framebuffer.prototype.isDestroyed = function() {
+ return false;
+};
+Framebuffer.prototype.destroy = function() {
+ if (this.destroyAttachments) {
+ let i = 0;
+ const textures = this._colorTextures;
+ let length3 = textures.length;
+ for (; i < length3; ++i) {
+ const texture = textures[i];
+ if (defined_default(texture)) {
+ texture.destroy();
+ }
+ }
+ const renderbuffers = this._colorRenderbuffers;
+ length3 = renderbuffers.length;
+ for (i = 0; i < length3; ++i) {
+ const renderbuffer = renderbuffers[i];
+ if (defined_default(renderbuffer)) {
+ renderbuffer.destroy();
+ }
+ }
+ this._depthTexture = this._depthTexture && this._depthTexture.destroy();
+ this._depthRenderbuffer = this._depthRenderbuffer && this._depthRenderbuffer.destroy();
+ this._stencilRenderbuffer = this._stencilRenderbuffer && this._stencilRenderbuffer.destroy();
+ this._depthStencilTexture = this._depthStencilTexture && this._depthStencilTexture.destroy();
+ this._depthStencilRenderbuffer = this._depthStencilRenderbuffer && this._depthStencilRenderbuffer.destroy();
+ }
+ this._gl.deleteFramebuffer(this._framebuffer);
+ return destroyObject_default(this);
+};
+var Framebuffer_default = Framebuffer;
+
+// Source/Core/WindingOrder.js
+var WindingOrder = {
+ CLOCKWISE: WebGLConstants_default.CW,
+ COUNTER_CLOCKWISE: WebGLConstants_default.CCW
+};
+WindingOrder.validate = function(windingOrder) {
+ return windingOrder === WindingOrder.CLOCKWISE || windingOrder === WindingOrder.COUNTER_CLOCKWISE;
+};
+var WindingOrder_default = Object.freeze(WindingOrder);
+
+// Source/Renderer/freezeRenderState.js
+function freezeRenderState(renderState) {
+ if (typeof renderState !== "object" || renderState === null) {
+ return renderState;
+ }
+ let propName;
+ const propNames = Object.keys(renderState);
+ for (let i = 0; i < propNames.length; i++) {
+ propName = propNames[i];
+ if (renderState.hasOwnProperty(propName) && propName !== "_applyFunctions") {
+ renderState[propName] = freezeRenderState(renderState[propName]);
+ }
+ }
+ return Object.freeze(renderState);
+}
+var freezeRenderState_default = freezeRenderState;
+
+// Source/Renderer/RenderState.js
+function validateBlendEquation(blendEquation) {
+ return blendEquation === WebGLConstants_default.FUNC_ADD || blendEquation === WebGLConstants_default.FUNC_SUBTRACT || blendEquation === WebGLConstants_default.FUNC_REVERSE_SUBTRACT || blendEquation === WebGLConstants_default.MIN || blendEquation === WebGLConstants_default.MAX;
+}
+function validateBlendFunction(blendFunction) {
+ return blendFunction === WebGLConstants_default.ZERO || blendFunction === WebGLConstants_default.ONE || blendFunction === WebGLConstants_default.SRC_COLOR || blendFunction === WebGLConstants_default.ONE_MINUS_SRC_COLOR || blendFunction === WebGLConstants_default.DST_COLOR || blendFunction === WebGLConstants_default.ONE_MINUS_DST_COLOR || blendFunction === WebGLConstants_default.SRC_ALPHA || blendFunction === WebGLConstants_default.ONE_MINUS_SRC_ALPHA || blendFunction === WebGLConstants_default.DST_ALPHA || blendFunction === WebGLConstants_default.ONE_MINUS_DST_ALPHA || blendFunction === WebGLConstants_default.CONSTANT_COLOR || blendFunction === WebGLConstants_default.ONE_MINUS_CONSTANT_COLOR || blendFunction === WebGLConstants_default.CONSTANT_ALPHA || blendFunction === WebGLConstants_default.ONE_MINUS_CONSTANT_ALPHA || blendFunction === WebGLConstants_default.SRC_ALPHA_SATURATE;
+}
+function validateCullFace(cullFace) {
+ return cullFace === WebGLConstants_default.FRONT || cullFace === WebGLConstants_default.BACK || cullFace === WebGLConstants_default.FRONT_AND_BACK;
+}
+function validateDepthFunction(depthFunction) {
+ return depthFunction === WebGLConstants_default.NEVER || depthFunction === WebGLConstants_default.LESS || depthFunction === WebGLConstants_default.EQUAL || depthFunction === WebGLConstants_default.LEQUAL || depthFunction === WebGLConstants_default.GREATER || depthFunction === WebGLConstants_default.NOTEQUAL || depthFunction === WebGLConstants_default.GEQUAL || depthFunction === WebGLConstants_default.ALWAYS;
+}
+function validateStencilFunction(stencilFunction) {
+ return stencilFunction === WebGLConstants_default.NEVER || stencilFunction === WebGLConstants_default.LESS || stencilFunction === WebGLConstants_default.EQUAL || stencilFunction === WebGLConstants_default.LEQUAL || stencilFunction === WebGLConstants_default.GREATER || stencilFunction === WebGLConstants_default.NOTEQUAL || stencilFunction === WebGLConstants_default.GEQUAL || stencilFunction === WebGLConstants_default.ALWAYS;
+}
+function validateStencilOperation(stencilOperation) {
+ return stencilOperation === WebGLConstants_default.ZERO || stencilOperation === WebGLConstants_default.KEEP || stencilOperation === WebGLConstants_default.REPLACE || stencilOperation === WebGLConstants_default.INCR || stencilOperation === WebGLConstants_default.DECR || stencilOperation === WebGLConstants_default.INVERT || stencilOperation === WebGLConstants_default.INCR_WRAP || stencilOperation === WebGLConstants_default.DECR_WRAP;
+}
+function RenderState(renderState) {
+ const rs = defaultValue_default(renderState, defaultValue_default.EMPTY_OBJECT);
+ const cull = defaultValue_default(rs.cull, defaultValue_default.EMPTY_OBJECT);
+ const polygonOffset = defaultValue_default(
+ rs.polygonOffset,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ const scissorTest = defaultValue_default(rs.scissorTest, defaultValue_default.EMPTY_OBJECT);
+ const scissorTestRectangle = defaultValue_default(
+ scissorTest.rectangle,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ const depthRange = defaultValue_default(rs.depthRange, defaultValue_default.EMPTY_OBJECT);
+ const depthTest = defaultValue_default(rs.depthTest, defaultValue_default.EMPTY_OBJECT);
+ const colorMask = defaultValue_default(rs.colorMask, defaultValue_default.EMPTY_OBJECT);
+ const blending = defaultValue_default(rs.blending, defaultValue_default.EMPTY_OBJECT);
+ const blendingColor = defaultValue_default(blending.color, defaultValue_default.EMPTY_OBJECT);
+ const stencilTest = defaultValue_default(rs.stencilTest, defaultValue_default.EMPTY_OBJECT);
+ const stencilTestFrontOperation = defaultValue_default(
+ stencilTest.frontOperation,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ const stencilTestBackOperation = defaultValue_default(
+ stencilTest.backOperation,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ const sampleCoverage = defaultValue_default(
+ rs.sampleCoverage,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ const viewport = rs.viewport;
+ this.frontFace = defaultValue_default(rs.frontFace, WindingOrder_default.COUNTER_CLOCKWISE);
+ this.cull = {
+ enabled: defaultValue_default(cull.enabled, false),
+ face: defaultValue_default(cull.face, WebGLConstants_default.BACK)
+ };
+ this.lineWidth = defaultValue_default(rs.lineWidth, 1);
+ this.polygonOffset = {
+ enabled: defaultValue_default(polygonOffset.enabled, false),
+ factor: defaultValue_default(polygonOffset.factor, 0),
+ units: defaultValue_default(polygonOffset.units, 0)
+ };
+ this.scissorTest = {
+ enabled: defaultValue_default(scissorTest.enabled, false),
+ rectangle: BoundingRectangle_default.clone(scissorTestRectangle)
+ };
+ this.depthRange = {
+ near: defaultValue_default(depthRange.near, 0),
+ far: defaultValue_default(depthRange.far, 1)
+ };
+ this.depthTest = {
+ enabled: defaultValue_default(depthTest.enabled, false),
+ func: defaultValue_default(depthTest.func, WebGLConstants_default.LESS)
+ };
+ this.colorMask = {
+ red: defaultValue_default(colorMask.red, true),
+ green: defaultValue_default(colorMask.green, true),
+ blue: defaultValue_default(colorMask.blue, true),
+ alpha: defaultValue_default(colorMask.alpha, true)
+ };
+ this.depthMask = defaultValue_default(rs.depthMask, true);
+ this.stencilMask = defaultValue_default(rs.stencilMask, ~0);
+ this.blending = {
+ enabled: defaultValue_default(blending.enabled, false),
+ color: new Color_default(
+ defaultValue_default(blendingColor.red, 0),
+ defaultValue_default(blendingColor.green, 0),
+ defaultValue_default(blendingColor.blue, 0),
+ defaultValue_default(blendingColor.alpha, 0)
+ ),
+ equationRgb: defaultValue_default(blending.equationRgb, WebGLConstants_default.FUNC_ADD),
+ equationAlpha: defaultValue_default(
+ blending.equationAlpha,
+ WebGLConstants_default.FUNC_ADD
+ ),
+ functionSourceRgb: defaultValue_default(
+ blending.functionSourceRgb,
+ WebGLConstants_default.ONE
+ ),
+ functionSourceAlpha: defaultValue_default(
+ blending.functionSourceAlpha,
+ WebGLConstants_default.ONE
+ ),
+ functionDestinationRgb: defaultValue_default(
+ blending.functionDestinationRgb,
+ WebGLConstants_default.ZERO
+ ),
+ functionDestinationAlpha: defaultValue_default(
+ blending.functionDestinationAlpha,
+ WebGLConstants_default.ZERO
+ )
+ };
+ this.stencilTest = {
+ enabled: defaultValue_default(stencilTest.enabled, false),
+ frontFunction: defaultValue_default(
+ stencilTest.frontFunction,
+ WebGLConstants_default.ALWAYS
+ ),
+ backFunction: defaultValue_default(stencilTest.backFunction, WebGLConstants_default.ALWAYS),
+ reference: defaultValue_default(stencilTest.reference, 0),
+ mask: defaultValue_default(stencilTest.mask, ~0),
+ frontOperation: {
+ fail: defaultValue_default(stencilTestFrontOperation.fail, WebGLConstants_default.KEEP),
+ zFail: defaultValue_default(stencilTestFrontOperation.zFail, WebGLConstants_default.KEEP),
+ zPass: defaultValue_default(stencilTestFrontOperation.zPass, WebGLConstants_default.KEEP)
+ },
+ backOperation: {
+ fail: defaultValue_default(stencilTestBackOperation.fail, WebGLConstants_default.KEEP),
+ zFail: defaultValue_default(stencilTestBackOperation.zFail, WebGLConstants_default.KEEP),
+ zPass: defaultValue_default(stencilTestBackOperation.zPass, WebGLConstants_default.KEEP)
+ }
+ };
+ this.sampleCoverage = {
+ enabled: defaultValue_default(sampleCoverage.enabled, false),
+ value: defaultValue_default(sampleCoverage.value, 1),
+ invert: defaultValue_default(sampleCoverage.invert, false)
+ };
+ this.viewport = defined_default(viewport) ? new BoundingRectangle_default(
+ viewport.x,
+ viewport.y,
+ viewport.width,
+ viewport.height
+ ) : void 0;
+ if (this.lineWidth < ContextLimits_default.minimumAliasedLineWidth || this.lineWidth > ContextLimits_default.maximumAliasedLineWidth) {
+ throw new DeveloperError_default(
+ "renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth."
+ );
+ }
+ if (!WindingOrder_default.validate(this.frontFace)) {
+ throw new DeveloperError_default("Invalid renderState.frontFace.");
+ }
+ if (!validateCullFace(this.cull.face)) {
+ throw new DeveloperError_default("Invalid renderState.cull.face.");
+ }
+ if (this.scissorTest.rectangle.width < 0 || this.scissorTest.rectangle.height < 0) {
+ throw new DeveloperError_default(
+ "renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero."
+ );
+ }
+ if (this.depthRange.near > this.depthRange.far) {
+ throw new DeveloperError_default(
+ "renderState.depthRange.near can not be greater than renderState.depthRange.far."
+ );
+ }
+ if (this.depthRange.near < 0) {
+ throw new DeveloperError_default(
+ "renderState.depthRange.near must be greater than or equal to zero."
+ );
+ }
+ if (this.depthRange.far > 1) {
+ throw new DeveloperError_default(
+ "renderState.depthRange.far must be less than or equal to one."
+ );
+ }
+ if (!validateDepthFunction(this.depthTest.func)) {
+ throw new DeveloperError_default("Invalid renderState.depthTest.func.");
+ }
+ if (this.blending.color.red < 0 || this.blending.color.red > 1 || this.blending.color.green < 0 || this.blending.color.green > 1 || this.blending.color.blue < 0 || this.blending.color.blue > 1 || this.blending.color.alpha < 0 || this.blending.color.alpha > 1) {
+ throw new DeveloperError_default(
+ "renderState.blending.color components must be greater than or equal to zero and less than or equal to one."
+ );
+ }
+ if (!validateBlendEquation(this.blending.equationRgb)) {
+ throw new DeveloperError_default("Invalid renderState.blending.equationRgb.");
+ }
+ if (!validateBlendEquation(this.blending.equationAlpha)) {
+ throw new DeveloperError_default("Invalid renderState.blending.equationAlpha.");
+ }
+ if (!validateBlendFunction(this.blending.functionSourceRgb)) {
+ throw new DeveloperError_default("Invalid renderState.blending.functionSourceRgb.");
+ }
+ if (!validateBlendFunction(this.blending.functionSourceAlpha)) {
+ throw new DeveloperError_default(
+ "Invalid renderState.blending.functionSourceAlpha."
+ );
+ }
+ if (!validateBlendFunction(this.blending.functionDestinationRgb)) {
+ throw new DeveloperError_default(
+ "Invalid renderState.blending.functionDestinationRgb."
+ );
+ }
+ if (!validateBlendFunction(this.blending.functionDestinationAlpha)) {
+ throw new DeveloperError_default(
+ "Invalid renderState.blending.functionDestinationAlpha."
+ );
+ }
+ if (!validateStencilFunction(this.stencilTest.frontFunction)) {
+ throw new DeveloperError_default("Invalid renderState.stencilTest.frontFunction.");
+ }
+ if (!validateStencilFunction(this.stencilTest.backFunction)) {
+ throw new DeveloperError_default("Invalid renderState.stencilTest.backFunction.");
+ }
+ if (!validateStencilOperation(this.stencilTest.frontOperation.fail)) {
+ throw new DeveloperError_default(
+ "Invalid renderState.stencilTest.frontOperation.fail."
+ );
+ }
+ if (!validateStencilOperation(this.stencilTest.frontOperation.zFail)) {
+ throw new DeveloperError_default(
+ "Invalid renderState.stencilTest.frontOperation.zFail."
+ );
+ }
+ if (!validateStencilOperation(this.stencilTest.frontOperation.zPass)) {
+ throw new DeveloperError_default(
+ "Invalid renderState.stencilTest.frontOperation.zPass."
+ );
+ }
+ if (!validateStencilOperation(this.stencilTest.backOperation.fail)) {
+ throw new DeveloperError_default(
+ "Invalid renderState.stencilTest.backOperation.fail."
+ );
+ }
+ if (!validateStencilOperation(this.stencilTest.backOperation.zFail)) {
+ throw new DeveloperError_default(
+ "Invalid renderState.stencilTest.backOperation.zFail."
+ );
+ }
+ if (!validateStencilOperation(this.stencilTest.backOperation.zPass)) {
+ throw new DeveloperError_default(
+ "Invalid renderState.stencilTest.backOperation.zPass."
+ );
+ }
+ if (defined_default(this.viewport)) {
+ if (this.viewport.width < 0) {
+ throw new DeveloperError_default(
+ "renderState.viewport.width must be greater than or equal to zero."
+ );
+ }
+ if (this.viewport.height < 0) {
+ throw new DeveloperError_default(
+ "renderState.viewport.height must be greater than or equal to zero."
+ );
+ }
+ if (this.viewport.width > ContextLimits_default.maximumViewportWidth) {
+ throw new DeveloperError_default(
+ `renderState.viewport.width must be less than or equal to the maximum viewport width (${ContextLimits_default.maximumViewportWidth.toString()}). Check maximumViewportWidth.`
+ );
+ }
+ if (this.viewport.height > ContextLimits_default.maximumViewportHeight) {
+ throw new DeveloperError_default(
+ `renderState.viewport.height must be less than or equal to the maximum viewport height (${ContextLimits_default.maximumViewportHeight.toString()}). Check maximumViewportHeight.`
+ );
+ }
+ }
+ this.id = 0;
+ this._applyFunctions = [];
+}
+var nextRenderStateId = 0;
+var renderStateCache = {};
+RenderState.fromCache = function(renderState) {
+ const partialKey = JSON.stringify(renderState);
+ let cachedState = renderStateCache[partialKey];
+ if (defined_default(cachedState)) {
+ ++cachedState.referenceCount;
+ return cachedState.state;
+ }
+ let states = new RenderState(renderState);
+ const fullKey = JSON.stringify(states);
+ cachedState = renderStateCache[fullKey];
+ if (!defined_default(cachedState)) {
+ states.id = nextRenderStateId++;
+ states = freezeRenderState_default(states);
+ cachedState = {
+ referenceCount: 0,
+ state: states
+ };
+ renderStateCache[fullKey] = cachedState;
+ }
+ ++cachedState.referenceCount;
+ renderStateCache[partialKey] = {
+ referenceCount: 1,
+ state: cachedState.state
+ };
+ return cachedState.state;
+};
+RenderState.removeFromCache = function(renderState) {
+ const states = new RenderState(renderState);
+ const fullKey = JSON.stringify(states);
+ const fullCachedState = renderStateCache[fullKey];
+ const partialKey = JSON.stringify(renderState);
+ const cachedState = renderStateCache[partialKey];
+ if (defined_default(cachedState)) {
+ --cachedState.referenceCount;
+ if (cachedState.referenceCount === 0) {
+ delete renderStateCache[partialKey];
+ if (defined_default(fullCachedState)) {
+ --fullCachedState.referenceCount;
+ }
+ }
+ }
+ if (defined_default(fullCachedState) && fullCachedState.referenceCount === 0) {
+ delete renderStateCache[fullKey];
+ }
+};
+RenderState.getCache = function() {
+ return renderStateCache;
+};
+RenderState.clearCache = function() {
+ renderStateCache = {};
+};
+function enableOrDisable(gl, glEnum, enable) {
+ if (enable) {
+ gl.enable(glEnum);
+ } else {
+ gl.disable(glEnum);
+ }
+}
+function applyFrontFace(gl, renderState) {
+ gl.frontFace(renderState.frontFace);
+}
+function applyCull(gl, renderState) {
+ const cull = renderState.cull;
+ const enabled = cull.enabled;
+ enableOrDisable(gl, gl.CULL_FACE, enabled);
+ if (enabled) {
+ gl.cullFace(cull.face);
+ }
+}
+function applyLineWidth(gl, renderState) {
+ gl.lineWidth(renderState.lineWidth);
+}
+function applyPolygonOffset(gl, renderState) {
+ const polygonOffset = renderState.polygonOffset;
+ const enabled = polygonOffset.enabled;
+ enableOrDisable(gl, gl.POLYGON_OFFSET_FILL, enabled);
+ if (enabled) {
+ gl.polygonOffset(polygonOffset.factor, polygonOffset.units);
+ }
+}
+function applyScissorTest(gl, renderState, passState) {
+ const scissorTest = renderState.scissorTest;
+ const enabled = defined_default(passState.scissorTest) ? passState.scissorTest.enabled : scissorTest.enabled;
+ enableOrDisable(gl, gl.SCISSOR_TEST, enabled);
+ if (enabled) {
+ const rectangle = defined_default(passState.scissorTest) ? passState.scissorTest.rectangle : scissorTest.rectangle;
+ gl.scissor(rectangle.x, rectangle.y, rectangle.width, rectangle.height);
+ }
+}
+function applyDepthRange(gl, renderState) {
+ const depthRange = renderState.depthRange;
+ gl.depthRange(depthRange.near, depthRange.far);
+}
+function applyDepthTest(gl, renderState) {
+ const depthTest = renderState.depthTest;
+ const enabled = depthTest.enabled;
+ enableOrDisable(gl, gl.DEPTH_TEST, enabled);
+ if (enabled) {
+ gl.depthFunc(depthTest.func);
+ }
+}
+function applyColorMask(gl, renderState) {
+ const colorMask = renderState.colorMask;
+ gl.colorMask(colorMask.red, colorMask.green, colorMask.blue, colorMask.alpha);
+}
+function applyDepthMask(gl, renderState) {
+ gl.depthMask(renderState.depthMask);
+}
+function applyStencilMask(gl, renderState) {
+ gl.stencilMask(renderState.stencilMask);
+}
+function applyBlendingColor(gl, color) {
+ gl.blendColor(color.red, color.green, color.blue, color.alpha);
+}
+function applyBlending(gl, renderState, passState) {
+ const blending = renderState.blending;
+ const enabled = defined_default(passState.blendingEnabled) ? passState.blendingEnabled : blending.enabled;
+ enableOrDisable(gl, gl.BLEND, enabled);
+ if (enabled) {
+ applyBlendingColor(gl, blending.color);
+ gl.blendEquationSeparate(blending.equationRgb, blending.equationAlpha);
+ gl.blendFuncSeparate(
+ blending.functionSourceRgb,
+ blending.functionDestinationRgb,
+ blending.functionSourceAlpha,
+ blending.functionDestinationAlpha
+ );
+ }
+}
+function applyStencilTest(gl, renderState) {
+ const stencilTest = renderState.stencilTest;
+ const enabled = stencilTest.enabled;
+ enableOrDisable(gl, gl.STENCIL_TEST, enabled);
+ if (enabled) {
+ const frontFunction = stencilTest.frontFunction;
+ const backFunction = stencilTest.backFunction;
+ const reference = stencilTest.reference;
+ const mask = stencilTest.mask;
+ gl.stencilFunc(frontFunction, reference, mask);
+ gl.stencilFuncSeparate(gl.BACK, backFunction, reference, mask);
+ gl.stencilFuncSeparate(gl.FRONT, frontFunction, reference, mask);
+ const frontOperation = stencilTest.frontOperation;
+ const frontOperationFail = frontOperation.fail;
+ const frontOperationZFail = frontOperation.zFail;
+ const frontOperationZPass = frontOperation.zPass;
+ gl.stencilOpSeparate(
+ gl.FRONT,
+ frontOperationFail,
+ frontOperationZFail,
+ frontOperationZPass
+ );
+ const backOperation = stencilTest.backOperation;
+ const backOperationFail = backOperation.fail;
+ const backOperationZFail = backOperation.zFail;
+ const backOperationZPass = backOperation.zPass;
+ gl.stencilOpSeparate(
+ gl.BACK,
+ backOperationFail,
+ backOperationZFail,
+ backOperationZPass
+ );
+ }
+}
+function applySampleCoverage(gl, renderState) {
+ const sampleCoverage = renderState.sampleCoverage;
+ const enabled = sampleCoverage.enabled;
+ enableOrDisable(gl, gl.SAMPLE_COVERAGE, enabled);
+ if (enabled) {
+ gl.sampleCoverage(sampleCoverage.value, sampleCoverage.invert);
+ }
+}
+var scratchViewport = new BoundingRectangle_default();
+function applyViewport(gl, renderState, passState) {
+ let viewport = defaultValue_default(renderState.viewport, passState.viewport);
+ if (!defined_default(viewport)) {
+ viewport = scratchViewport;
+ viewport.width = passState.context.drawingBufferWidth;
+ viewport.height = passState.context.drawingBufferHeight;
+ }
+ passState.context.uniformState.viewport = viewport;
+ gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+}
+RenderState.apply = function(gl, renderState, passState) {
+ applyFrontFace(gl, renderState);
+ applyCull(gl, renderState);
+ applyLineWidth(gl, renderState);
+ applyPolygonOffset(gl, renderState);
+ applyDepthRange(gl, renderState);
+ applyDepthTest(gl, renderState);
+ applyColorMask(gl, renderState);
+ applyDepthMask(gl, renderState);
+ applyStencilMask(gl, renderState);
+ applyStencilTest(gl, renderState);
+ applySampleCoverage(gl, renderState);
+ applyScissorTest(gl, renderState, passState);
+ applyBlending(gl, renderState, passState);
+ applyViewport(gl, renderState, passState);
+};
+function createFuncs(previousState, nextState) {
+ const funcs = [];
+ if (previousState.frontFace !== nextState.frontFace) {
+ funcs.push(applyFrontFace);
+ }
+ if (previousState.cull.enabled !== nextState.cull.enabled || previousState.cull.face !== nextState.cull.face) {
+ funcs.push(applyCull);
+ }
+ if (previousState.lineWidth !== nextState.lineWidth) {
+ funcs.push(applyLineWidth);
+ }
+ if (previousState.polygonOffset.enabled !== nextState.polygonOffset.enabled || previousState.polygonOffset.factor !== nextState.polygonOffset.factor || previousState.polygonOffset.units !== nextState.polygonOffset.units) {
+ funcs.push(applyPolygonOffset);
+ }
+ if (previousState.depthRange.near !== nextState.depthRange.near || previousState.depthRange.far !== nextState.depthRange.far) {
+ funcs.push(applyDepthRange);
+ }
+ if (previousState.depthTest.enabled !== nextState.depthTest.enabled || previousState.depthTest.func !== nextState.depthTest.func) {
+ funcs.push(applyDepthTest);
+ }
+ if (previousState.colorMask.red !== nextState.colorMask.red || previousState.colorMask.green !== nextState.colorMask.green || previousState.colorMask.blue !== nextState.colorMask.blue || previousState.colorMask.alpha !== nextState.colorMask.alpha) {
+ funcs.push(applyColorMask);
+ }
+ if (previousState.depthMask !== nextState.depthMask) {
+ funcs.push(applyDepthMask);
+ }
+ if (previousState.stencilMask !== nextState.stencilMask) {
+ funcs.push(applyStencilMask);
+ }
+ if (previousState.stencilTest.enabled !== nextState.stencilTest.enabled || previousState.stencilTest.frontFunction !== nextState.stencilTest.frontFunction || previousState.stencilTest.backFunction !== nextState.stencilTest.backFunction || previousState.stencilTest.reference !== nextState.stencilTest.reference || previousState.stencilTest.mask !== nextState.stencilTest.mask || previousState.stencilTest.frontOperation.fail !== nextState.stencilTest.frontOperation.fail || previousState.stencilTest.frontOperation.zFail !== nextState.stencilTest.frontOperation.zFail || previousState.stencilTest.backOperation.fail !== nextState.stencilTest.backOperation.fail || previousState.stencilTest.backOperation.zFail !== nextState.stencilTest.backOperation.zFail || previousState.stencilTest.backOperation.zPass !== nextState.stencilTest.backOperation.zPass) {
+ funcs.push(applyStencilTest);
+ }
+ if (previousState.sampleCoverage.enabled !== nextState.sampleCoverage.enabled || previousState.sampleCoverage.value !== nextState.sampleCoverage.value || previousState.sampleCoverage.invert !== nextState.sampleCoverage.invert) {
+ funcs.push(applySampleCoverage);
+ }
+ return funcs;
+}
+RenderState.partialApply = function(gl, previousRenderState, renderState, previousPassState, passState, clear2) {
+ if (previousRenderState !== renderState) {
+ let funcs = renderState._applyFunctions[previousRenderState.id];
+ if (!defined_default(funcs)) {
+ funcs = createFuncs(previousRenderState, renderState);
+ renderState._applyFunctions[previousRenderState.id] = funcs;
+ }
+ const len = funcs.length;
+ for (let i = 0; i < len; ++i) {
+ funcs[i](gl, renderState);
+ }
+ }
+ const previousScissorTest = defined_default(previousPassState.scissorTest) ? previousPassState.scissorTest : previousRenderState.scissorTest;
+ const scissorTest = defined_default(passState.scissorTest) ? passState.scissorTest : renderState.scissorTest;
+ if (previousScissorTest !== scissorTest || clear2) {
+ applyScissorTest(gl, renderState, passState);
+ }
+ const previousBlendingEnabled = defined_default(previousPassState.blendingEnabled) ? previousPassState.blendingEnabled : previousRenderState.blending.enabled;
+ const blendingEnabled = defined_default(passState.blendingEnabled) ? passState.blendingEnabled : renderState.blending.enabled;
+ if (previousBlendingEnabled !== blendingEnabled || blendingEnabled && previousRenderState.blending !== renderState.blending) {
+ applyBlending(gl, renderState, passState);
+ }
+ if (previousRenderState !== renderState || previousPassState !== passState || previousPassState.context !== passState.context) {
+ applyViewport(gl, renderState, passState);
+ }
+};
+RenderState.getState = function(renderState) {
+ if (!defined_default(renderState)) {
+ throw new DeveloperError_default("renderState is required.");
+ }
+ return {
+ frontFace: renderState.frontFace,
+ cull: {
+ enabled: renderState.cull.enabled,
+ face: renderState.cull.face
+ },
+ lineWidth: renderState.lineWidth,
+ polygonOffset: {
+ enabled: renderState.polygonOffset.enabled,
+ factor: renderState.polygonOffset.factor,
+ units: renderState.polygonOffset.units
+ },
+ scissorTest: {
+ enabled: renderState.scissorTest.enabled,
+ rectangle: BoundingRectangle_default.clone(renderState.scissorTest.rectangle)
+ },
+ depthRange: {
+ near: renderState.depthRange.near,
+ far: renderState.depthRange.far
+ },
+ depthTest: {
+ enabled: renderState.depthTest.enabled,
+ func: renderState.depthTest.func
+ },
+ colorMask: {
+ red: renderState.colorMask.red,
+ green: renderState.colorMask.green,
+ blue: renderState.colorMask.blue,
+ alpha: renderState.colorMask.alpha
+ },
+ depthMask: renderState.depthMask,
+ stencilMask: renderState.stencilMask,
+ blending: {
+ enabled: renderState.blending.enabled,
+ color: Color_default.clone(renderState.blending.color),
+ equationRgb: renderState.blending.equationRgb,
+ equationAlpha: renderState.blending.equationAlpha,
+ functionSourceRgb: renderState.blending.functionSourceRgb,
+ functionSourceAlpha: renderState.blending.functionSourceAlpha,
+ functionDestinationRgb: renderState.blending.functionDestinationRgb,
+ functionDestinationAlpha: renderState.blending.functionDestinationAlpha
+ },
+ stencilTest: {
+ enabled: renderState.stencilTest.enabled,
+ frontFunction: renderState.stencilTest.frontFunction,
+ backFunction: renderState.stencilTest.backFunction,
+ reference: renderState.stencilTest.reference,
+ mask: renderState.stencilTest.mask,
+ frontOperation: {
+ fail: renderState.stencilTest.frontOperation.fail,
+ zFail: renderState.stencilTest.frontOperation.zFail,
+ zPass: renderState.stencilTest.frontOperation.zPass
+ },
+ backOperation: {
+ fail: renderState.stencilTest.backOperation.fail,
+ zFail: renderState.stencilTest.backOperation.zFail,
+ zPass: renderState.stencilTest.backOperation.zPass
+ }
+ },
+ sampleCoverage: {
+ enabled: renderState.sampleCoverage.enabled,
+ value: renderState.sampleCoverage.value,
+ invert: renderState.sampleCoverage.invert
+ },
+ viewport: defined_default(renderState.viewport) ? BoundingRectangle_default.clone(renderState.viewport) : void 0
+ };
+};
+var RenderState_default = RenderState;
+
+// Source/Core/Matrix2.js
+function Matrix2(column0Row0, column1Row0, column0Row1, column1Row1) {
+ this[0] = defaultValue_default(column0Row0, 0);
+ this[1] = defaultValue_default(column0Row1, 0);
+ this[2] = defaultValue_default(column1Row0, 0);
+ this[3] = defaultValue_default(column1Row1, 0);
+}
+Matrix2.packedLength = 4;
+Matrix2.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value[0];
+ array[startingIndex++] = value[1];
+ array[startingIndex++] = value[2];
+ array[startingIndex++] = value[3];
+ return array;
+};
+Matrix2.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new Matrix2();
+ }
+ result[0] = array[startingIndex++];
+ result[1] = array[startingIndex++];
+ result[2] = array[startingIndex++];
+ result[3] = array[startingIndex++];
+ return result;
+};
+Matrix2.packArray = function(array, result) {
+ Check_default.defined("array", array);
+ const length3 = array.length;
+ const resultLength = length3 * 4;
+ if (!defined_default(result)) {
+ result = new Array(resultLength);
+ } else if (!Array.isArray(result) && result.length !== resultLength) {
+ throw new DeveloperError_default(
+ "If result is a typed array, it must have exactly array.length * 4 elements"
+ );
+ } else if (result.length !== resultLength) {
+ result.length = resultLength;
+ }
+ for (let i = 0; i < length3; ++i) {
+ Matrix2.pack(array[i], result, i * 4);
+ }
+ return result;
+};
+Matrix2.unpackArray = function(array, result) {
+ Check_default.defined("array", array);
+ Check_default.typeOf.number.greaterThanOrEquals("array.length", array.length, 4);
+ if (array.length % 4 !== 0) {
+ throw new DeveloperError_default("array length must be a multiple of 4.");
+ }
+ const length3 = array.length;
+ if (!defined_default(result)) {
+ result = new Array(length3 / 4);
+ } else {
+ result.length = length3 / 4;
+ }
+ for (let i = 0; i < length3; i += 4) {
+ const index = i / 4;
+ result[index] = Matrix2.unpack(array, i, result[index]);
+ }
+ return result;
+};
+Matrix2.clone = function(matrix, result) {
+ if (!defined_default(matrix)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Matrix2(matrix[0], matrix[2], matrix[1], matrix[3]);
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ return result;
+};
+Matrix2.fromArray = Matrix2.unpack;
+Matrix2.fromColumnMajorArray = function(values, result) {
+ Check_default.defined("values", values);
+ return Matrix2.clone(values, result);
+};
+Matrix2.fromRowMajorArray = function(values, result) {
+ Check_default.defined("values", values);
+ if (!defined_default(result)) {
+ return new Matrix2(values[0], values[1], values[2], values[3]);
+ }
+ result[0] = values[0];
+ result[1] = values[2];
+ result[2] = values[1];
+ result[3] = values[3];
+ return result;
+};
+Matrix2.fromScale = function(scale, result) {
+ Check_default.typeOf.object("scale", scale);
+ if (!defined_default(result)) {
+ return new Matrix2(scale.x, 0, 0, scale.y);
+ }
+ result[0] = scale.x;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = scale.y;
+ return result;
+};
+Matrix2.fromUniformScale = function(scale, result) {
+ Check_default.typeOf.number("scale", scale);
+ if (!defined_default(result)) {
+ return new Matrix2(scale, 0, 0, scale);
+ }
+ result[0] = scale;
+ result[1] = 0;
+ result[2] = 0;
+ result[3] = scale;
+ return result;
+};
+Matrix2.fromRotation = function(angle, result) {
+ Check_default.typeOf.number("angle", angle);
+ const cosAngle = Math.cos(angle);
+ const sinAngle = Math.sin(angle);
+ if (!defined_default(result)) {
+ return new Matrix2(cosAngle, -sinAngle, sinAngle, cosAngle);
+ }
+ result[0] = cosAngle;
+ result[1] = sinAngle;
+ result[2] = -sinAngle;
+ result[3] = cosAngle;
+ return result;
+};
+Matrix2.toArray = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ if (!defined_default(result)) {
+ return [matrix[0], matrix[1], matrix[2], matrix[3]];
+ }
+ result[0] = matrix[0];
+ result[1] = matrix[1];
+ result[2] = matrix[2];
+ result[3] = matrix[3];
+ return result;
+};
+Matrix2.getElementIndex = function(column, row) {
+ Check_default.typeOf.number.greaterThanOrEquals("row", row, 0);
+ Check_default.typeOf.number.lessThanOrEquals("row", row, 1);
+ Check_default.typeOf.number.greaterThanOrEquals("column", column, 0);
+ Check_default.typeOf.number.lessThanOrEquals("column", column, 1);
+ return column * 2 + row;
+};
+Matrix2.getColumn = function(matrix, index, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 1);
+ Check_default.typeOf.object("result", result);
+ const startIndex = index * 2;
+ const x = matrix[startIndex];
+ const y = matrix[startIndex + 1];
+ result.x = x;
+ result.y = y;
+ return result;
+};
+Matrix2.setColumn = function(matrix, index, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 1);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result = Matrix2.clone(matrix, result);
+ const startIndex = index * 2;
+ result[startIndex] = cartesian11.x;
+ result[startIndex + 1] = cartesian11.y;
+ return result;
+};
+Matrix2.getRow = function(matrix, index, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 1);
+ Check_default.typeOf.object("result", result);
+ const x = matrix[index];
+ const y = matrix[index + 2];
+ result.x = x;
+ result.y = y;
+ return result;
+};
+Matrix2.setRow = function(matrix, index, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ Check_default.typeOf.number.lessThanOrEquals("index", index, 1);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ result = Matrix2.clone(matrix, result);
+ result[index] = cartesian11.x;
+ result[index + 2] = cartesian11.y;
+ return result;
+};
+var scaleScratch13 = new Cartesian2_default();
+Matrix2.setScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("scale", scale);
+ Check_default.typeOf.object("result", result);
+ const existingScale = Matrix2.getScale(matrix, scaleScratch13);
+ const scaleRatioX = scale.x / existingScale.x;
+ const scaleRatioY = scale.y / existingScale.y;
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioY;
+ result[3] = matrix[3] * scaleRatioY;
+ return result;
+};
+var scaleScratch23 = new Cartesian2_default();
+Matrix2.setUniformScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number("scale", scale);
+ Check_default.typeOf.object("result", result);
+ const existingScale = Matrix2.getScale(matrix, scaleScratch23);
+ const scaleRatioX = scale / existingScale.x;
+ const scaleRatioY = scale / existingScale.y;
+ result[0] = matrix[0] * scaleRatioX;
+ result[1] = matrix[1] * scaleRatioX;
+ result[2] = matrix[2] * scaleRatioY;
+ result[3] = matrix[3] * scaleRatioY;
+ return result;
+};
+var scratchColumn3 = new Cartesian2_default();
+Matrix2.getScale = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result.x = Cartesian2_default.magnitude(
+ Cartesian2_default.fromElements(matrix[0], matrix[1], scratchColumn3)
+ );
+ result.y = Cartesian2_default.magnitude(
+ Cartesian2_default.fromElements(matrix[2], matrix[3], scratchColumn3)
+ );
+ return result;
+};
+var scaleScratch33 = new Cartesian2_default();
+Matrix2.getMaximumScale = function(matrix) {
+ Matrix2.getScale(matrix, scaleScratch33);
+ return Cartesian2_default.maximumComponent(scaleScratch33);
+};
+var scaleScratch43 = new Cartesian2_default();
+Matrix2.setRotation = function(matrix, rotation, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const scale = Matrix2.getScale(matrix, scaleScratch43);
+ result[0] = rotation[0] * scale.x;
+ result[1] = rotation[1] * scale.x;
+ result[2] = rotation[2] * scale.y;
+ result[3] = rotation[3] * scale.y;
+ return result;
+};
+var scaleScratch53 = new Cartesian2_default();
+Matrix2.getRotation = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const scale = Matrix2.getScale(matrix, scaleScratch53);
+ result[0] = matrix[0] / scale.x;
+ result[1] = matrix[1] / scale.x;
+ result[2] = matrix[2] / scale.y;
+ result[3] = matrix[3] / scale.y;
+ return result;
+};
+Matrix2.multiply = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ const column0Row0 = left[0] * right[0] + left[2] * right[1];
+ const column1Row0 = left[0] * right[2] + left[2] * right[3];
+ const column0Row1 = left[1] * right[0] + left[3] * right[1];
+ const column1Row1 = left[1] * right[2] + left[3] * right[3];
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column1Row0;
+ result[3] = column1Row1;
+ return result;
+};
+Matrix2.add = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result[0] = left[0] + right[0];
+ result[1] = left[1] + right[1];
+ result[2] = left[2] + right[2];
+ result[3] = left[3] + right[3];
+ return result;
+};
+Matrix2.subtract = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result[0] = left[0] - right[0];
+ result[1] = left[1] - right[1];
+ result[2] = left[2] - right[2];
+ result[3] = left[3] - right[3];
+ return result;
+};
+Matrix2.multiplyByVector = function(matrix, cartesian11, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const x = matrix[0] * cartesian11.x + matrix[2] * cartesian11.y;
+ const y = matrix[1] * cartesian11.x + matrix[3] * cartesian11.y;
+ result.x = x;
+ result.y = y;
+ return result;
+};
+Matrix2.multiplyByScalar = function(matrix, scalar, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result[0] = matrix[0] * scalar;
+ result[1] = matrix[1] * scalar;
+ result[2] = matrix[2] * scalar;
+ result[3] = matrix[3] * scalar;
+ return result;
+};
+Matrix2.multiplyByScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("scale", scale);
+ Check_default.typeOf.object("result", result);
+ result[0] = matrix[0] * scale.x;
+ result[1] = matrix[1] * scale.x;
+ result[2] = matrix[2] * scale.y;
+ result[3] = matrix[3] * scale.y;
+ return result;
+};
+Matrix2.multiplyByUniformScale = function(matrix, scale, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.number("scale", scale);
+ Check_default.typeOf.object("result", result);
+ result[0] = matrix[0] * scale;
+ result[1] = matrix[1] * scale;
+ result[2] = matrix[2] * scale;
+ result[3] = matrix[3] * scale;
+ return result;
+};
+Matrix2.negate = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result[0] = -matrix[0];
+ result[1] = -matrix[1];
+ result[2] = -matrix[2];
+ result[3] = -matrix[3];
+ return result;
+};
+Matrix2.transpose = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ const column0Row0 = matrix[0];
+ const column0Row1 = matrix[2];
+ const column1Row0 = matrix[1];
+ const column1Row1 = matrix[3];
+ result[0] = column0Row0;
+ result[1] = column0Row1;
+ result[2] = column1Row0;
+ result[3] = column1Row1;
+ return result;
+};
+Matrix2.abs = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ Check_default.typeOf.object("result", result);
+ result[0] = Math.abs(matrix[0]);
+ result[1] = Math.abs(matrix[1]);
+ result[2] = Math.abs(matrix[2]);
+ result[3] = Math.abs(matrix[3]);
+ return result;
+};
+Matrix2.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left[0] === right[0] && left[1] === right[1] && left[2] === right[2] && left[3] === right[3];
+};
+Matrix2.equalsArray = function(matrix, array, offset2) {
+ return matrix[0] === array[offset2] && matrix[1] === array[offset2 + 1] && matrix[2] === array[offset2 + 2] && matrix[3] === array[offset2 + 3];
+};
+Matrix2.equalsEpsilon = function(left, right, epsilon) {
+ epsilon = defaultValue_default(epsilon, 0);
+ return left === right || defined_default(left) && defined_default(right) && Math.abs(left[0] - right[0]) <= epsilon && Math.abs(left[1] - right[1]) <= epsilon && Math.abs(left[2] - right[2]) <= epsilon && Math.abs(left[3] - right[3]) <= epsilon;
+};
+Matrix2.IDENTITY = Object.freeze(new Matrix2(1, 0, 0, 1));
+Matrix2.ZERO = Object.freeze(new Matrix2(0, 0, 0, 0));
+Matrix2.COLUMN0ROW0 = 0;
+Matrix2.COLUMN0ROW1 = 1;
+Matrix2.COLUMN1ROW0 = 2;
+Matrix2.COLUMN1ROW1 = 3;
+Object.defineProperties(Matrix2.prototype, {
+ length: {
+ get: function() {
+ return Matrix2.packedLength;
+ }
+ }
+});
+Matrix2.prototype.clone = function(result) {
+ return Matrix2.clone(this, result);
+};
+Matrix2.prototype.equals = function(right) {
+ return Matrix2.equals(this, right);
+};
+Matrix2.prototype.equalsEpsilon = function(right, epsilon) {
+ return Matrix2.equalsEpsilon(this, right, epsilon);
+};
+Matrix2.prototype.toString = function() {
+ return `(${this[0]}, ${this[2]})
+(${this[1]}, ${this[3]})`;
+};
+var Matrix2_default = Matrix2;
+
+// Source/Renderer/createUniform.js
+function createUniform(gl, activeUniform, uniformName, location2) {
+ switch (activeUniform.type) {
+ case gl.FLOAT:
+ return new UniformFloat(gl, activeUniform, uniformName, location2);
+ case gl.FLOAT_VEC2:
+ return new UniformFloatVec2(gl, activeUniform, uniformName, location2);
+ case gl.FLOAT_VEC3:
+ return new UniformFloatVec3(gl, activeUniform, uniformName, location2);
+ case gl.FLOAT_VEC4:
+ return new UniformFloatVec4(gl, activeUniform, uniformName, location2);
+ case gl.SAMPLER_2D:
+ case gl.SAMPLER_CUBE:
+ return new UniformSampler(gl, activeUniform, uniformName, location2);
+ case gl.INT:
+ case gl.BOOL:
+ return new UniformInt(gl, activeUniform, uniformName, location2);
+ case gl.INT_VEC2:
+ case gl.BOOL_VEC2:
+ return new UniformIntVec2(gl, activeUniform, uniformName, location2);
+ case gl.INT_VEC3:
+ case gl.BOOL_VEC3:
+ return new UniformIntVec3(gl, activeUniform, uniformName, location2);
+ case gl.INT_VEC4:
+ case gl.BOOL_VEC4:
+ return new UniformIntVec4(gl, activeUniform, uniformName, location2);
+ case gl.FLOAT_MAT2:
+ return new UniformMat2(gl, activeUniform, uniformName, location2);
+ case gl.FLOAT_MAT3:
+ return new UniformMat3(gl, activeUniform, uniformName, location2);
+ case gl.FLOAT_MAT4:
+ return new UniformMat4(gl, activeUniform, uniformName, location2);
+ default:
+ throw new RuntimeError_default(
+ `Unrecognized uniform type: ${activeUniform.type} for uniform "${uniformName}".`
+ );
+ }
+}
+function UniformFloat(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = 0;
+ this._gl = gl;
+ this._location = location2;
+}
+UniformFloat.prototype.set = function() {
+ if (this.value !== this._value) {
+ this._value = this.value;
+ this._gl.uniform1f(this._location, this.value);
+ }
+};
+function UniformFloatVec2(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = new Cartesian2_default();
+ this._gl = gl;
+ this._location = location2;
+}
+UniformFloatVec2.prototype.set = function() {
+ const v7 = this.value;
+ if (!Cartesian2_default.equals(v7, this._value)) {
+ Cartesian2_default.clone(v7, this._value);
+ this._gl.uniform2f(this._location, v7.x, v7.y);
+ }
+};
+function UniformFloatVec3(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = void 0;
+ this._gl = gl;
+ this._location = location2;
+}
+UniformFloatVec3.prototype.set = function() {
+ const v7 = this.value;
+ if (defined_default(v7.red)) {
+ if (!Color_default.equals(v7, this._value)) {
+ this._value = Color_default.clone(v7, this._value);
+ this._gl.uniform3f(this._location, v7.red, v7.green, v7.blue);
+ }
+ } else if (defined_default(v7.x)) {
+ if (!Cartesian3_default.equals(v7, this._value)) {
+ this._value = Cartesian3_default.clone(v7, this._value);
+ this._gl.uniform3f(this._location, v7.x, v7.y, v7.z);
+ }
+ } else {
+ throw new DeveloperError_default(`Invalid vec3 value for uniform "${this.name}".`);
+ }
+};
+function UniformFloatVec4(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = void 0;
+ this._gl = gl;
+ this._location = location2;
+}
+UniformFloatVec4.prototype.set = function() {
+ const v7 = this.value;
+ if (defined_default(v7.red)) {
+ if (!Color_default.equals(v7, this._value)) {
+ this._value = Color_default.clone(v7, this._value);
+ this._gl.uniform4f(this._location, v7.red, v7.green, v7.blue, v7.alpha);
+ }
+ } else if (defined_default(v7.x)) {
+ if (!Cartesian4_default.equals(v7, this._value)) {
+ this._value = Cartesian4_default.clone(v7, this._value);
+ this._gl.uniform4f(this._location, v7.x, v7.y, v7.z, v7.w);
+ }
+ } else {
+ throw new DeveloperError_default(`Invalid vec4 value for uniform "${this.name}".`);
+ }
+};
+function UniformSampler(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._gl = gl;
+ this._location = location2;
+ this.textureUnitIndex = void 0;
+}
+UniformSampler.prototype.set = function() {
+ const gl = this._gl;
+ gl.activeTexture(gl.TEXTURE0 + this.textureUnitIndex);
+ const v7 = this.value;
+ gl.bindTexture(v7._target, v7._texture);
+};
+UniformSampler.prototype._setSampler = function(textureUnitIndex) {
+ this.textureUnitIndex = textureUnitIndex;
+ this._gl.uniform1i(this._location, textureUnitIndex);
+ return textureUnitIndex + 1;
+};
+function UniformInt(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = 0;
+ this._gl = gl;
+ this._location = location2;
+}
+UniformInt.prototype.set = function() {
+ if (this.value !== this._value) {
+ this._value = this.value;
+ this._gl.uniform1i(this._location, this.value);
+ }
+};
+function UniformIntVec2(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = new Cartesian2_default();
+ this._gl = gl;
+ this._location = location2;
+}
+UniformIntVec2.prototype.set = function() {
+ const v7 = this.value;
+ if (!Cartesian2_default.equals(v7, this._value)) {
+ Cartesian2_default.clone(v7, this._value);
+ this._gl.uniform2i(this._location, v7.x, v7.y);
+ }
+};
+function UniformIntVec3(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = new Cartesian3_default();
+ this._gl = gl;
+ this._location = location2;
+}
+UniformIntVec3.prototype.set = function() {
+ const v7 = this.value;
+ if (!Cartesian3_default.equals(v7, this._value)) {
+ Cartesian3_default.clone(v7, this._value);
+ this._gl.uniform3i(this._location, v7.x, v7.y, v7.z);
+ }
+};
+function UniformIntVec4(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = new Cartesian4_default();
+ this._gl = gl;
+ this._location = location2;
+}
+UniformIntVec4.prototype.set = function() {
+ const v7 = this.value;
+ if (!Cartesian4_default.equals(v7, this._value)) {
+ Cartesian4_default.clone(v7, this._value);
+ this._gl.uniform4i(this._location, v7.x, v7.y, v7.z, v7.w);
+ }
+};
+var scratchUniformArray = new Float32Array(4);
+function UniformMat2(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = new Matrix2_default();
+ this._gl = gl;
+ this._location = location2;
+}
+UniformMat2.prototype.set = function() {
+ if (!Matrix2_default.equalsArray(this.value, this._value, 0)) {
+ Matrix2_default.clone(this.value, this._value);
+ const array = Matrix2_default.toArray(this.value, scratchUniformArray);
+ this._gl.uniformMatrix2fv(this._location, false, array);
+ }
+};
+var scratchMat3Array = new Float32Array(9);
+function UniformMat3(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = new Matrix3_default();
+ this._gl = gl;
+ this._location = location2;
+}
+UniformMat3.prototype.set = function() {
+ if (!Matrix3_default.equalsArray(this.value, this._value, 0)) {
+ Matrix3_default.clone(this.value, this._value);
+ const array = Matrix3_default.toArray(this.value, scratchMat3Array);
+ this._gl.uniformMatrix3fv(this._location, false, array);
+ }
+};
+var scratchMat4Array = new Float32Array(16);
+function UniformMat4(gl, activeUniform, uniformName, location2) {
+ this.name = uniformName;
+ this.value = void 0;
+ this._value = new Matrix4_default();
+ this._gl = gl;
+ this._location = location2;
+}
+UniformMat4.prototype.set = function() {
+ if (!Matrix4_default.equalsArray(this.value, this._value, 0)) {
+ Matrix4_default.clone(this.value, this._value);
+ const array = Matrix4_default.toArray(this.value, scratchMat4Array);
+ this._gl.uniformMatrix4fv(this._location, false, array);
+ }
+};
+var createUniform_default = createUniform;
+
+// Source/Renderer/createUniformArray.js
+function createUniformArray(gl, activeUniform, uniformName, locations) {
+ switch (activeUniform.type) {
+ case gl.FLOAT:
+ return new UniformArrayFloat(gl, activeUniform, uniformName, locations);
+ case gl.FLOAT_VEC2:
+ return new UniformArrayFloatVec2(
+ gl,
+ activeUniform,
+ uniformName,
+ locations
+ );
+ case gl.FLOAT_VEC3:
+ return new UniformArrayFloatVec3(
+ gl,
+ activeUniform,
+ uniformName,
+ locations
+ );
+ case gl.FLOAT_VEC4:
+ return new UniformArrayFloatVec4(
+ gl,
+ activeUniform,
+ uniformName,
+ locations
+ );
+ case gl.SAMPLER_2D:
+ case gl.SAMPLER_CUBE:
+ return new UniformArraySampler(gl, activeUniform, uniformName, locations);
+ case gl.INT:
+ case gl.BOOL:
+ return new UniformArrayInt(gl, activeUniform, uniformName, locations);
+ case gl.INT_VEC2:
+ case gl.BOOL_VEC2:
+ return new UniformArrayIntVec2(gl, activeUniform, uniformName, locations);
+ case gl.INT_VEC3:
+ case gl.BOOL_VEC3:
+ return new UniformArrayIntVec3(gl, activeUniform, uniformName, locations);
+ case gl.INT_VEC4:
+ case gl.BOOL_VEC4:
+ return new UniformArrayIntVec4(gl, activeUniform, uniformName, locations);
+ case gl.FLOAT_MAT2:
+ return new UniformArrayMat2(gl, activeUniform, uniformName, locations);
+ case gl.FLOAT_MAT3:
+ return new UniformArrayMat3(gl, activeUniform, uniformName, locations);
+ case gl.FLOAT_MAT4:
+ return new UniformArrayMat4(gl, activeUniform, uniformName, locations);
+ default:
+ throw new RuntimeError_default(
+ `Unrecognized uniform type: ${activeUniform.type} for uniform "${uniformName}".`
+ );
+ }
+}
+function UniformArrayFloat(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Float32Array(length3);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayFloat.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (v7 !== arraybuffer[i]) {
+ arraybuffer[i] = v7;
+ changed = true;
+ }
+ }
+ if (changed) {
+ this._gl.uniform1fv(this._location, arraybuffer);
+ }
+};
+function UniformArrayFloatVec2(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Float32Array(length3 * 2);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayFloatVec2.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ let j = 0;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (!Cartesian2_default.equalsArray(v7, arraybuffer, j)) {
+ Cartesian2_default.pack(v7, arraybuffer, j);
+ changed = true;
+ }
+ j += 2;
+ }
+ if (changed) {
+ this._gl.uniform2fv(this._location, arraybuffer);
+ }
+};
+function UniformArrayFloatVec3(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Float32Array(length3 * 3);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayFloatVec3.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ let j = 0;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (defined_default(v7.red)) {
+ if (v7.red !== arraybuffer[j] || v7.green !== arraybuffer[j + 1] || v7.blue !== arraybuffer[j + 2]) {
+ arraybuffer[j] = v7.red;
+ arraybuffer[j + 1] = v7.green;
+ arraybuffer[j + 2] = v7.blue;
+ changed = true;
+ }
+ } else if (defined_default(v7.x)) {
+ if (!Cartesian3_default.equalsArray(v7, arraybuffer, j)) {
+ Cartesian3_default.pack(v7, arraybuffer, j);
+ changed = true;
+ }
+ } else {
+ throw new DeveloperError_default("Invalid vec3 value.");
+ }
+ j += 3;
+ }
+ if (changed) {
+ this._gl.uniform3fv(this._location, arraybuffer);
+ }
+};
+function UniformArrayFloatVec4(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Float32Array(length3 * 4);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayFloatVec4.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ let j = 0;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (defined_default(v7.red)) {
+ if (!Color_default.equalsArray(v7, arraybuffer, j)) {
+ Color_default.pack(v7, arraybuffer, j);
+ changed = true;
+ }
+ } else if (defined_default(v7.x)) {
+ if (!Cartesian4_default.equalsArray(v7, arraybuffer, j)) {
+ Cartesian4_default.pack(v7, arraybuffer, j);
+ changed = true;
+ }
+ } else {
+ throw new DeveloperError_default("Invalid vec4 value.");
+ }
+ j += 4;
+ }
+ if (changed) {
+ this._gl.uniform4fv(this._location, arraybuffer);
+ }
+};
+function UniformArraySampler(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Float32Array(length3);
+ this._gl = gl;
+ this._locations = locations;
+ this.textureUnitIndex = void 0;
+}
+UniformArraySampler.prototype.set = function() {
+ const gl = this._gl;
+ const textureUnitIndex = gl.TEXTURE0 + this.textureUnitIndex;
+ const value = this.value;
+ const length3 = value.length;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ gl.activeTexture(textureUnitIndex + i);
+ gl.bindTexture(v7._target, v7._texture);
+ }
+};
+UniformArraySampler.prototype._setSampler = function(textureUnitIndex) {
+ this.textureUnitIndex = textureUnitIndex;
+ const locations = this._locations;
+ const length3 = locations.length;
+ for (let i = 0; i < length3; ++i) {
+ const index = textureUnitIndex + i;
+ this._gl.uniform1i(locations[i], index);
+ }
+ return textureUnitIndex + length3;
+};
+function UniformArrayInt(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Int32Array(length3);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayInt.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (v7 !== arraybuffer[i]) {
+ arraybuffer[i] = v7;
+ changed = true;
+ }
+ }
+ if (changed) {
+ this._gl.uniform1iv(this._location, arraybuffer);
+ }
+};
+function UniformArrayIntVec2(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Int32Array(length3 * 2);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayIntVec2.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ let j = 0;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (!Cartesian2_default.equalsArray(v7, arraybuffer, j)) {
+ Cartesian2_default.pack(v7, arraybuffer, j);
+ changed = true;
+ }
+ j += 2;
+ }
+ if (changed) {
+ this._gl.uniform2iv(this._location, arraybuffer);
+ }
+};
+function UniformArrayIntVec3(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Int32Array(length3 * 3);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayIntVec3.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ let j = 0;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (!Cartesian3_default.equalsArray(v7, arraybuffer, j)) {
+ Cartesian3_default.pack(v7, arraybuffer, j);
+ changed = true;
+ }
+ j += 3;
+ }
+ if (changed) {
+ this._gl.uniform3iv(this._location, arraybuffer);
+ }
+};
+function UniformArrayIntVec4(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Int32Array(length3 * 4);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayIntVec4.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ let j = 0;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (!Cartesian4_default.equalsArray(v7, arraybuffer, j)) {
+ Cartesian4_default.pack(v7, arraybuffer, j);
+ changed = true;
+ }
+ j += 4;
+ }
+ if (changed) {
+ this._gl.uniform4iv(this._location, arraybuffer);
+ }
+};
+function UniformArrayMat2(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Float32Array(length3 * 4);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayMat2.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ let j = 0;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (!Matrix2_default.equalsArray(v7, arraybuffer, j)) {
+ Matrix2_default.pack(v7, arraybuffer, j);
+ changed = true;
+ }
+ j += 4;
+ }
+ if (changed) {
+ this._gl.uniformMatrix2fv(this._location, false, arraybuffer);
+ }
+};
+function UniformArrayMat3(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Float32Array(length3 * 9);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayMat3.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ let j = 0;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (!Matrix3_default.equalsArray(v7, arraybuffer, j)) {
+ Matrix3_default.pack(v7, arraybuffer, j);
+ changed = true;
+ }
+ j += 9;
+ }
+ if (changed) {
+ this._gl.uniformMatrix3fv(this._location, false, arraybuffer);
+ }
+};
+function UniformArrayMat4(gl, activeUniform, uniformName, locations) {
+ const length3 = locations.length;
+ this.name = uniformName;
+ this.value = new Array(length3);
+ this._value = new Float32Array(length3 * 16);
+ this._gl = gl;
+ this._location = locations[0];
+}
+UniformArrayMat4.prototype.set = function() {
+ const value = this.value;
+ const length3 = value.length;
+ const arraybuffer = this._value;
+ let changed = false;
+ let j = 0;
+ for (let i = 0; i < length3; ++i) {
+ const v7 = value[i];
+ if (!Matrix4_default.equalsArray(v7, arraybuffer, j)) {
+ Matrix4_default.pack(v7, arraybuffer, j);
+ changed = true;
+ }
+ j += 16;
+ }
+ if (changed) {
+ this._gl.uniformMatrix4fv(this._location, false, arraybuffer);
+ }
+};
+var createUniformArray_default = createUniformArray;
+
+// Source/Renderer/ShaderProgram.js
+var nextShaderProgramId = 0;
+function ShaderProgram(options) {
+ let vertexShaderText = options.vertexShaderText;
+ let fragmentShaderText = options.fragmentShaderText;
+ if (typeof spector !== "undefined") {
+ vertexShaderText = vertexShaderText.replace(/^#line/gm, "//#line");
+ fragmentShaderText = fragmentShaderText.replace(/^#line/gm, "//#line");
+ }
+ const modifiedFS = handleUniformPrecisionMismatches(
+ vertexShaderText,
+ fragmentShaderText
+ );
+ this._gl = options.gl;
+ this._logShaderCompilation = options.logShaderCompilation;
+ this._debugShaders = options.debugShaders;
+ this._attributeLocations = options.attributeLocations;
+ this._program = void 0;
+ this._numberOfVertexAttributes = void 0;
+ this._vertexAttributes = void 0;
+ this._uniformsByName = void 0;
+ this._uniforms = void 0;
+ this._automaticUniforms = void 0;
+ this._manualUniforms = void 0;
+ this._duplicateUniformNames = modifiedFS.duplicateUniformNames;
+ this._cachedShader = void 0;
+ this.maximumTextureUnitIndex = void 0;
+ this._vertexShaderSource = options.vertexShaderSource;
+ this._vertexShaderText = options.vertexShaderText;
+ this._fragmentShaderSource = options.fragmentShaderSource;
+ this._fragmentShaderText = modifiedFS.fragmentShaderText;
+ this.id = nextShaderProgramId++;
+}
+ShaderProgram.fromCache = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.context", options.context);
+ return options.context.shaderCache.getShaderProgram(options);
+};
+ShaderProgram.replaceCache = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.context", options.context);
+ return options.context.shaderCache.replaceShaderProgram(options);
+};
+Object.defineProperties(ShaderProgram.prototype, {
+ vertexShaderSource: {
+ get: function() {
+ return this._vertexShaderSource;
+ }
+ },
+ fragmentShaderSource: {
+ get: function() {
+ return this._fragmentShaderSource;
+ }
+ },
+ vertexAttributes: {
+ get: function() {
+ initialize2(this);
+ return this._vertexAttributes;
+ }
+ },
+ numberOfVertexAttributes: {
+ get: function() {
+ initialize2(this);
+ return this._numberOfVertexAttributes;
+ }
+ },
+ allUniforms: {
+ get: function() {
+ initialize2(this);
+ return this._uniformsByName;
+ }
+ }
+});
+function extractUniforms(shaderText) {
+ const uniformNames = [];
+ const uniformLines = shaderText.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);
+ if (defined_default(uniformLines)) {
+ const len = uniformLines.length;
+ for (let i = 0; i < len; i++) {
+ const line = uniformLines[i].trim();
+ const name = line.slice(line.lastIndexOf(" ") + 1);
+ uniformNames.push(name);
+ }
+ }
+ return uniformNames;
+}
+function handleUniformPrecisionMismatches(vertexShaderText, fragmentShaderText) {
+ const duplicateUniformNames = {};
+ if (!ContextLimits_default.highpFloatSupported || !ContextLimits_default.highpIntSupported) {
+ let i, j;
+ let uniformName;
+ let duplicateName;
+ const vertexShaderUniforms = extractUniforms(vertexShaderText);
+ const fragmentShaderUniforms = extractUniforms(fragmentShaderText);
+ const vertexUniformsCount = vertexShaderUniforms.length;
+ const fragmentUniformsCount = fragmentShaderUniforms.length;
+ for (i = 0; i < vertexUniformsCount; i++) {
+ for (j = 0; j < fragmentUniformsCount; j++) {
+ if (vertexShaderUniforms[i] === fragmentShaderUniforms[j]) {
+ uniformName = vertexShaderUniforms[i];
+ duplicateName = `czm_mediump_${uniformName}`;
+ const re = new RegExp(`${uniformName}\\b`, "g");
+ fragmentShaderText = fragmentShaderText.replace(re, duplicateName);
+ duplicateUniformNames[duplicateName] = uniformName;
+ }
+ }
+ }
+ }
+ return {
+ fragmentShaderText,
+ duplicateUniformNames
+ };
+}
+var consolePrefix = "[Cesium WebGL] ";
+function createAndLinkProgram(gl, shader) {
+ const vsSource = shader._vertexShaderText;
+ const fsSource = shader._fragmentShaderText;
+ const vertexShader = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(vertexShader, vsSource);
+ gl.compileShader(vertexShader);
+ const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(fragmentShader, fsSource);
+ gl.compileShader(fragmentShader);
+ const program = gl.createProgram();
+ gl.attachShader(program, vertexShader);
+ gl.attachShader(program, fragmentShader);
+ const attributeLocations8 = shader._attributeLocations;
+ if (defined_default(attributeLocations8)) {
+ for (const attribute in attributeLocations8) {
+ if (attributeLocations8.hasOwnProperty(attribute)) {
+ gl.bindAttribLocation(
+ program,
+ attributeLocations8[attribute],
+ attribute
+ );
+ }
+ }
+ }
+ gl.linkProgram(program);
+ let log;
+ if (gl.getProgramParameter(program, gl.LINK_STATUS)) {
+ if (shader._logShaderCompilation) {
+ log = gl.getShaderInfoLog(vertexShader);
+ if (defined_default(log) && log.length > 0) {
+ console.log(`${consolePrefix}Vertex shader compile log: ${log}`);
+ }
+ log = gl.getShaderInfoLog(fragmentShader);
+ if (defined_default(log) && log.length > 0) {
+ console.log(`${consolePrefix}Fragment shader compile log: ${log}`);
+ }
+ log = gl.getProgramInfoLog(program);
+ if (defined_default(log) && log.length > 0) {
+ console.log(`${consolePrefix}Shader program link log: ${log}`);
+ }
+ }
+ gl.deleteShader(vertexShader);
+ gl.deleteShader(fragmentShader);
+ return program;
+ }
+ let errorMessage;
+ const debugShaders = shader._debugShaders;
+ if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
+ log = gl.getShaderInfoLog(fragmentShader);
+ console.error(`${consolePrefix}Fragment shader compile log: ${log}`);
+ console.error(`${consolePrefix} Fragment shader source:
+${fsSource}`);
+ errorMessage = `Fragment shader failed to compile. Compile log: ${log}`;
+ } else if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
+ log = gl.getShaderInfoLog(vertexShader);
+ console.error(`${consolePrefix}Vertex shader compile log: ${log}`);
+ console.error(`${consolePrefix} Vertex shader source:
+${vsSource}`);
+ errorMessage = `Vertex shader failed to compile. Compile log: ${log}`;
+ } else {
+ log = gl.getProgramInfoLog(program);
+ console.error(`${consolePrefix}Shader program link log: ${log}`);
+ logTranslatedSource(vertexShader, "vertex");
+ logTranslatedSource(fragmentShader, "fragment");
+ errorMessage = `Program failed to link. Link log: ${log}`;
+ }
+ gl.deleteShader(vertexShader);
+ gl.deleteShader(fragmentShader);
+ gl.deleteProgram(program);
+ throw new RuntimeError_default(errorMessage);
+ function logTranslatedSource(compiledShader, name) {
+ if (!defined_default(debugShaders)) {
+ return;
+ }
+ const translation3 = debugShaders.getTranslatedShaderSource(compiledShader);
+ if (translation3 === "") {
+ console.error(`${consolePrefix}${name} shader translation failed.`);
+ return;
+ }
+ console.error(
+ `${consolePrefix}Translated ${name} shaderSource:
+${translation3}`
+ );
+ }
+}
+function findVertexAttributes(gl, program, numberOfAttributes2) {
+ const attributes = {};
+ for (let i = 0; i < numberOfAttributes2; ++i) {
+ const attr = gl.getActiveAttrib(program, i);
+ const location2 = gl.getAttribLocation(program, attr.name);
+ attributes[attr.name] = {
+ name: attr.name,
+ type: attr.type,
+ index: location2
+ };
+ }
+ return attributes;
+}
+function findUniforms(gl, program) {
+ const uniformsByName = {};
+ const uniforms = [];
+ const samplerUniforms = [];
+ const numberOfUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
+ for (let i = 0; i < numberOfUniforms; ++i) {
+ const activeUniform = gl.getActiveUniform(program, i);
+ const suffix = "[0]";
+ const uniformName = activeUniform.name.indexOf(
+ suffix,
+ activeUniform.name.length - suffix.length
+ ) !== -1 ? activeUniform.name.slice(0, activeUniform.name.length - 3) : activeUniform.name;
+ if (uniformName.indexOf("gl_") !== 0) {
+ if (activeUniform.name.indexOf("[") < 0) {
+ const location2 = gl.getUniformLocation(program, uniformName);
+ if (location2 !== null) {
+ const uniform = createUniform_default(
+ gl,
+ activeUniform,
+ uniformName,
+ location2
+ );
+ uniformsByName[uniformName] = uniform;
+ uniforms.push(uniform);
+ if (uniform._setSampler) {
+ samplerUniforms.push(uniform);
+ }
+ }
+ } else {
+ let uniformArray;
+ let locations;
+ let value;
+ let loc;
+ const indexOfBracket = uniformName.indexOf("[");
+ if (indexOfBracket >= 0) {
+ uniformArray = uniformsByName[uniformName.slice(0, indexOfBracket)];
+ if (!defined_default(uniformArray)) {
+ continue;
+ }
+ locations = uniformArray._locations;
+ if (locations.length <= 1) {
+ value = uniformArray.value;
+ loc = gl.getUniformLocation(program, uniformName);
+ if (loc !== null) {
+ locations.push(loc);
+ value.push(gl.getUniform(program, loc));
+ }
+ }
+ } else {
+ locations = [];
+ for (let j = 0; j < activeUniform.size; ++j) {
+ loc = gl.getUniformLocation(program, `${uniformName}[${j}]`);
+ if (loc !== null) {
+ locations.push(loc);
+ }
+ }
+ uniformArray = createUniformArray_default(
+ gl,
+ activeUniform,
+ uniformName,
+ locations
+ );
+ uniformsByName[uniformName] = uniformArray;
+ uniforms.push(uniformArray);
+ if (uniformArray._setSampler) {
+ samplerUniforms.push(uniformArray);
+ }
+ }
+ }
+ }
+ }
+ return {
+ uniformsByName,
+ uniforms,
+ samplerUniforms
+ };
+}
+function partitionUniforms(shader, uniforms) {
+ const automaticUniforms = [];
+ const manualUniforms = [];
+ for (const uniform in uniforms) {
+ if (uniforms.hasOwnProperty(uniform)) {
+ const uniformObject = uniforms[uniform];
+ let uniformName = uniform;
+ const duplicateUniform = shader._duplicateUniformNames[uniformName];
+ if (defined_default(duplicateUniform)) {
+ uniformObject.name = duplicateUniform;
+ uniformName = duplicateUniform;
+ }
+ const automaticUniform = AutomaticUniforms_default[uniformName];
+ if (defined_default(automaticUniform)) {
+ automaticUniforms.push({
+ uniform: uniformObject,
+ automaticUniform
+ });
+ } else {
+ manualUniforms.push(uniformObject);
+ }
+ }
+ }
+ return {
+ automaticUniforms,
+ manualUniforms
+ };
+}
+function setSamplerUniforms(gl, program, samplerUniforms) {
+ gl.useProgram(program);
+ let textureUnitIndex = 0;
+ const length3 = samplerUniforms.length;
+ for (let i = 0; i < length3; ++i) {
+ textureUnitIndex = samplerUniforms[i]._setSampler(textureUnitIndex);
+ }
+ gl.useProgram(null);
+ return textureUnitIndex;
+}
+function initialize2(shader) {
+ if (defined_default(shader._program)) {
+ return;
+ }
+ reinitialize(shader);
+}
+function reinitialize(shader) {
+ const oldProgram = shader._program;
+ const gl = shader._gl;
+ const program = createAndLinkProgram(gl, shader, shader._debugShaders);
+ const numberOfVertexAttributes = gl.getProgramParameter(
+ program,
+ gl.ACTIVE_ATTRIBUTES
+ );
+ const uniforms = findUniforms(gl, program);
+ const partitionedUniforms = partitionUniforms(
+ shader,
+ uniforms.uniformsByName
+ );
+ shader._program = program;
+ shader._numberOfVertexAttributes = numberOfVertexAttributes;
+ shader._vertexAttributes = findVertexAttributes(
+ gl,
+ program,
+ numberOfVertexAttributes
+ );
+ shader._uniformsByName = uniforms.uniformsByName;
+ shader._uniforms = uniforms.uniforms;
+ shader._automaticUniforms = partitionedUniforms.automaticUniforms;
+ shader._manualUniforms = partitionedUniforms.manualUniforms;
+ shader.maximumTextureUnitIndex = setSamplerUniforms(
+ gl,
+ program,
+ uniforms.samplerUniforms
+ );
+ if (oldProgram) {
+ shader._gl.deleteProgram(oldProgram);
+ }
+ if (typeof spector !== "undefined") {
+ shader._program.__SPECTOR_rebuildProgram = function(vertexSourceCode, fragmentSourceCode, onCompiled, onError) {
+ const originalVS = shader._vertexShaderText;
+ const originalFS = shader._fragmentShaderText;
+ const regex = / ! = /g;
+ shader._vertexShaderText = vertexSourceCode.replace(regex, " != ");
+ shader._fragmentShaderText = fragmentSourceCode.replace(regex, " != ");
+ try {
+ reinitialize(shader);
+ onCompiled(shader._program);
+ } catch (e) {
+ shader._vertexShaderText = originalVS;
+ shader._fragmentShaderText = originalFS;
+ const errorMatcher = /(?:Compile|Link) error: ([^]*)/;
+ const match = errorMatcher.exec(e.message);
+ if (match) {
+ onError(match[1]);
+ } else {
+ onError(e.message);
+ }
+ }
+ };
+ }
+}
+ShaderProgram.prototype._bind = function() {
+ initialize2(this);
+ this._gl.useProgram(this._program);
+};
+ShaderProgram.prototype._setUniforms = function(uniformMap2, uniformState, validate) {
+ let len;
+ let i;
+ if (defined_default(uniformMap2)) {
+ const manualUniforms = this._manualUniforms;
+ len = manualUniforms.length;
+ for (i = 0; i < len; ++i) {
+ const mu = manualUniforms[i];
+ mu.value = uniformMap2[mu.name]();
+ }
+ }
+ const automaticUniforms = this._automaticUniforms;
+ len = automaticUniforms.length;
+ for (i = 0; i < len; ++i) {
+ const au = automaticUniforms[i];
+ au.uniform.value = au.automaticUniform.getValue(uniformState);
+ }
+ const uniforms = this._uniforms;
+ len = uniforms.length;
+ for (i = 0; i < len; ++i) {
+ uniforms[i].set();
+ }
+ if (validate) {
+ const gl = this._gl;
+ const program = this._program;
+ gl.validateProgram(program);
+ if (!gl.getProgramParameter(program, gl.VALIDATE_STATUS)) {
+ throw new DeveloperError_default(
+ `Program validation failed. Program info log: ${gl.getProgramInfoLog(
+ program
+ )}`
+ );
+ }
+ }
+};
+ShaderProgram.prototype.isDestroyed = function() {
+ return false;
+};
+ShaderProgram.prototype.destroy = function() {
+ this._cachedShader.cache.releaseShaderProgram(this);
+ return void 0;
+};
+ShaderProgram.prototype.finalDestroy = function() {
+ this._gl.deleteProgram(this._program);
+ return destroyObject_default(this);
+};
+var ShaderProgram_default = ShaderProgram;
+
+// Source/Renderer/ComputeEngine.js
+function ComputeEngine(context) {
+ this._context = context;
+}
+var renderStateScratch;
+var drawCommandScratch = new DrawCommand_default({
+ primitiveType: PrimitiveType_default.TRIANGLES
+});
+var clearCommandScratch = new ClearCommand_default({
+ color: new Color_default(0, 0, 0, 0)
+});
+function createFramebuffer(context, outputTexture) {
+ return new Framebuffer_default({
+ context,
+ colorTextures: [outputTexture],
+ destroyAttachments: false
+ });
+}
+function createViewportQuadShader(context, fragmentShaderSource) {
+ return ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource: ViewportQuadVS_default,
+ fragmentShaderSource,
+ attributeLocations: {
+ position: 0,
+ textureCoordinates: 1
+ }
+ });
+}
+function createRenderState(width, height) {
+ if (!defined_default(renderStateScratch) || renderStateScratch.viewport.width !== width || renderStateScratch.viewport.height !== height) {
+ renderStateScratch = RenderState_default.fromCache({
+ viewport: new BoundingRectangle_default(0, 0, width, height)
+ });
+ }
+ return renderStateScratch;
+}
+ComputeEngine.prototype.execute = function(computeCommand) {
+ Check_default.defined("computeCommand", computeCommand);
+ if (defined_default(computeCommand.preExecute)) {
+ computeCommand.preExecute(computeCommand);
+ }
+ if (!defined_default(computeCommand.fragmentShaderSource) && !defined_default(computeCommand.shaderProgram)) {
+ throw new DeveloperError_default(
+ "computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required."
+ );
+ }
+ Check_default.defined("computeCommand.outputTexture", computeCommand.outputTexture);
+ const outputTexture = computeCommand.outputTexture;
+ const width = outputTexture.width;
+ const height = outputTexture.height;
+ const context = this._context;
+ const vertexArray = defined_default(computeCommand.vertexArray) ? computeCommand.vertexArray : context.getViewportQuadVertexArray();
+ const shaderProgram = defined_default(computeCommand.shaderProgram) ? computeCommand.shaderProgram : createViewportQuadShader(context, computeCommand.fragmentShaderSource);
+ const framebuffer = createFramebuffer(context, outputTexture);
+ const renderState = createRenderState(width, height);
+ const uniformMap2 = computeCommand.uniformMap;
+ const clearCommand = clearCommandScratch;
+ clearCommand.framebuffer = framebuffer;
+ clearCommand.renderState = renderState;
+ clearCommand.execute(context);
+ const drawCommand = drawCommandScratch;
+ drawCommand.vertexArray = vertexArray;
+ drawCommand.renderState = renderState;
+ drawCommand.shaderProgram = shaderProgram;
+ drawCommand.uniformMap = uniformMap2;
+ drawCommand.framebuffer = framebuffer;
+ drawCommand.execute(context);
+ framebuffer.destroy();
+ if (!computeCommand.persists) {
+ shaderProgram.destroy();
+ if (defined_default(computeCommand.vertexArray)) {
+ vertexArray.destroy();
+ }
+ }
+ if (defined_default(computeCommand.postExecute)) {
+ computeCommand.postExecute(outputTexture);
+ }
+};
+ComputeEngine.prototype.isDestroyed = function() {
+ return false;
+};
+ComputeEngine.prototype.destroy = function() {
+ return destroyObject_default(this);
+};
+var ComputeEngine_default = ComputeEngine;
+
+// Source/Core/clone.js
+function clone(object2, deep) {
+ if (object2 === null || typeof object2 !== "object") {
+ return object2;
+ }
+ deep = defaultValue_default(deep, false);
+ const result = new object2.constructor();
+ for (const propertyName in object2) {
+ if (object2.hasOwnProperty(propertyName)) {
+ let value = object2[propertyName];
+ if (deep) {
+ value = clone(value, deep);
+ }
+ result[propertyName] = value;
+ }
+ }
+ return result;
+}
+var clone_default = clone;
+
+// Source/Core/ComponentDatatype.js
+var ComponentDatatype = {
+ BYTE: WebGLConstants_default.BYTE,
+ UNSIGNED_BYTE: WebGLConstants_default.UNSIGNED_BYTE,
+ SHORT: WebGLConstants_default.SHORT,
+ UNSIGNED_SHORT: WebGLConstants_default.UNSIGNED_SHORT,
+ INT: WebGLConstants_default.INT,
+ UNSIGNED_INT: WebGLConstants_default.UNSIGNED_INT,
+ FLOAT: WebGLConstants_default.FLOAT,
+ DOUBLE: WebGLConstants_default.DOUBLE
+};
+ComponentDatatype.getSizeInBytes = function(componentDatatype) {
+ if (!defined_default(componentDatatype)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ switch (componentDatatype) {
+ case ComponentDatatype.BYTE:
+ return Int8Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.UNSIGNED_BYTE:
+ return Uint8Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.SHORT:
+ return Int16Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.UNSIGNED_SHORT:
+ return Uint16Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.INT:
+ return Int32Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.UNSIGNED_INT:
+ return Uint32Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.FLOAT:
+ return Float32Array.BYTES_PER_ELEMENT;
+ case ComponentDatatype.DOUBLE:
+ return Float64Array.BYTES_PER_ELEMENT;
+ default:
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
+ }
+};
+ComponentDatatype.fromTypedArray = function(array) {
+ if (array instanceof Int8Array) {
+ return ComponentDatatype.BYTE;
+ }
+ if (array instanceof Uint8Array) {
+ return ComponentDatatype.UNSIGNED_BYTE;
+ }
+ if (array instanceof Int16Array) {
+ return ComponentDatatype.SHORT;
+ }
+ if (array instanceof Uint16Array) {
+ return ComponentDatatype.UNSIGNED_SHORT;
+ }
+ if (array instanceof Int32Array) {
+ return ComponentDatatype.INT;
+ }
+ if (array instanceof Uint32Array) {
+ return ComponentDatatype.UNSIGNED_INT;
+ }
+ if (array instanceof Float32Array) {
+ return ComponentDatatype.FLOAT;
+ }
+ if (array instanceof Float64Array) {
+ return ComponentDatatype.DOUBLE;
+ }
+ throw new DeveloperError_default(
+ "array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array."
+ );
+};
+ComponentDatatype.validate = function(componentDatatype) {
+ return defined_default(componentDatatype) && (componentDatatype === ComponentDatatype.BYTE || componentDatatype === ComponentDatatype.UNSIGNED_BYTE || componentDatatype === ComponentDatatype.SHORT || componentDatatype === ComponentDatatype.UNSIGNED_SHORT || componentDatatype === ComponentDatatype.INT || componentDatatype === ComponentDatatype.UNSIGNED_INT || componentDatatype === ComponentDatatype.FLOAT || componentDatatype === ComponentDatatype.DOUBLE);
+};
+ComponentDatatype.createTypedArray = function(componentDatatype, valuesOrLength) {
+ if (!defined_default(componentDatatype)) {
+ throw new DeveloperError_default("componentDatatype is required.");
+ }
+ if (!defined_default(valuesOrLength)) {
+ throw new DeveloperError_default("valuesOrLength is required.");
+ }
+ switch (componentDatatype) {
+ case ComponentDatatype.BYTE:
+ return new Int8Array(valuesOrLength);
+ case ComponentDatatype.UNSIGNED_BYTE:
+ return new Uint8Array(valuesOrLength);
+ case ComponentDatatype.SHORT:
+ return new Int16Array(valuesOrLength);
+ case ComponentDatatype.UNSIGNED_SHORT:
+ return new Uint16Array(valuesOrLength);
+ case ComponentDatatype.INT:
+ return new Int32Array(valuesOrLength);
+ case ComponentDatatype.UNSIGNED_INT:
+ return new Uint32Array(valuesOrLength);
+ case ComponentDatatype.FLOAT:
+ return new Float32Array(valuesOrLength);
+ case ComponentDatatype.DOUBLE:
+ return new Float64Array(valuesOrLength);
+ default:
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
+ }
+};
+ComponentDatatype.createArrayBufferView = function(componentDatatype, buffer, byteOffset, length3) {
+ if (!defined_default(componentDatatype)) {
+ throw new DeveloperError_default("componentDatatype is required.");
+ }
+ if (!defined_default(buffer)) {
+ throw new DeveloperError_default("buffer is required.");
+ }
+ byteOffset = defaultValue_default(byteOffset, 0);
+ length3 = defaultValue_default(
+ length3,
+ (buffer.byteLength - byteOffset) / ComponentDatatype.getSizeInBytes(componentDatatype)
+ );
+ switch (componentDatatype) {
+ case ComponentDatatype.BYTE:
+ return new Int8Array(buffer, byteOffset, length3);
+ case ComponentDatatype.UNSIGNED_BYTE:
+ return new Uint8Array(buffer, byteOffset, length3);
+ case ComponentDatatype.SHORT:
+ return new Int16Array(buffer, byteOffset, length3);
+ case ComponentDatatype.UNSIGNED_SHORT:
+ return new Uint16Array(buffer, byteOffset, length3);
+ case ComponentDatatype.INT:
+ return new Int32Array(buffer, byteOffset, length3);
+ case ComponentDatatype.UNSIGNED_INT:
+ return new Uint32Array(buffer, byteOffset, length3);
+ case ComponentDatatype.FLOAT:
+ return new Float32Array(buffer, byteOffset, length3);
+ case ComponentDatatype.DOUBLE:
+ return new Float64Array(buffer, byteOffset, length3);
+ default:
+ throw new DeveloperError_default("componentDatatype is not a valid value.");
+ }
+};
+ComponentDatatype.fromName = function(name) {
+ switch (name) {
+ case "BYTE":
+ return ComponentDatatype.BYTE;
+ case "UNSIGNED_BYTE":
+ return ComponentDatatype.UNSIGNED_BYTE;
+ case "SHORT":
+ return ComponentDatatype.SHORT;
+ case "UNSIGNED_SHORT":
+ return ComponentDatatype.UNSIGNED_SHORT;
+ case "INT":
+ return ComponentDatatype.INT;
+ case "UNSIGNED_INT":
+ return ComponentDatatype.UNSIGNED_INT;
+ case "FLOAT":
+ return ComponentDatatype.FLOAT;
+ case "DOUBLE":
+ return ComponentDatatype.DOUBLE;
+ default:
+ throw new DeveloperError_default("name is not a valid value.");
+ }
+};
+var ComponentDatatype_default = Object.freeze(ComponentDatatype);
+
+// Source/Core/GeometryType.js
+var GeometryType = {
+ NONE: 0,
+ TRIANGLES: 1,
+ LINES: 2,
+ POLYLINES: 3
+};
+var GeometryType_default = Object.freeze(GeometryType);
+
+// Source/Core/Quaternion.js
+function Quaternion(x, y, z, w) {
+ this.x = defaultValue_default(x, 0);
+ this.y = defaultValue_default(y, 0);
+ this.z = defaultValue_default(z, 0);
+ this.w = defaultValue_default(w, 0);
+}
+var fromAxisAngleScratch = new Cartesian3_default();
+Quaternion.fromAxisAngle = function(axis, angle, result) {
+ Check_default.typeOf.object("axis", axis);
+ Check_default.typeOf.number("angle", angle);
+ const halfAngle = angle / 2;
+ const s = Math.sin(halfAngle);
+ fromAxisAngleScratch = Cartesian3_default.normalize(axis, fromAxisAngleScratch);
+ const x = fromAxisAngleScratch.x * s;
+ const y = fromAxisAngleScratch.y * s;
+ const z = fromAxisAngleScratch.z * s;
+ const w = Math.cos(halfAngle);
+ if (!defined_default(result)) {
+ return new Quaternion(x, y, z, w);
+ }
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+};
+var fromRotationMatrixNext = [1, 2, 0];
+var fromRotationMatrixQuat = new Array(3);
+Quaternion.fromRotationMatrix = function(matrix, result) {
+ Check_default.typeOf.object("matrix", matrix);
+ let root;
+ let x;
+ let y;
+ let z;
+ let w;
+ const m00 = matrix[Matrix3_default.COLUMN0ROW0];
+ const m11 = matrix[Matrix3_default.COLUMN1ROW1];
+ const m22 = matrix[Matrix3_default.COLUMN2ROW2];
+ const trace = m00 + m11 + m22;
+ if (trace > 0) {
+ root = Math.sqrt(trace + 1);
+ w = 0.5 * root;
+ root = 0.5 / root;
+ x = (matrix[Matrix3_default.COLUMN1ROW2] - matrix[Matrix3_default.COLUMN2ROW1]) * root;
+ y = (matrix[Matrix3_default.COLUMN2ROW0] - matrix[Matrix3_default.COLUMN0ROW2]) * root;
+ z = (matrix[Matrix3_default.COLUMN0ROW1] - matrix[Matrix3_default.COLUMN1ROW0]) * root;
+ } else {
+ const next = fromRotationMatrixNext;
+ let i = 0;
+ if (m11 > m00) {
+ i = 1;
+ }
+ if (m22 > m00 && m22 > m11) {
+ i = 2;
+ }
+ const j = next[i];
+ const k = next[j];
+ root = Math.sqrt(
+ matrix[Matrix3_default.getElementIndex(i, i)] - matrix[Matrix3_default.getElementIndex(j, j)] - matrix[Matrix3_default.getElementIndex(k, k)] + 1
+ );
+ const quat = fromRotationMatrixQuat;
+ quat[i] = 0.5 * root;
+ root = 0.5 / root;
+ w = (matrix[Matrix3_default.getElementIndex(k, j)] - matrix[Matrix3_default.getElementIndex(j, k)]) * root;
+ quat[j] = (matrix[Matrix3_default.getElementIndex(j, i)] + matrix[Matrix3_default.getElementIndex(i, j)]) * root;
+ quat[k] = (matrix[Matrix3_default.getElementIndex(k, i)] + matrix[Matrix3_default.getElementIndex(i, k)]) * root;
+ x = -quat[0];
+ y = -quat[1];
+ z = -quat[2];
+ }
+ if (!defined_default(result)) {
+ return new Quaternion(x, y, z, w);
+ }
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+};
+var scratchHPRQuaternion = new Quaternion();
+var scratchHeadingQuaternion = new Quaternion();
+var scratchPitchQuaternion = new Quaternion();
+var scratchRollQuaternion = new Quaternion();
+Quaternion.fromHeadingPitchRoll = function(headingPitchRoll, result) {
+ Check_default.typeOf.object("headingPitchRoll", headingPitchRoll);
+ scratchRollQuaternion = Quaternion.fromAxisAngle(
+ Cartesian3_default.UNIT_X,
+ headingPitchRoll.roll,
+ scratchHPRQuaternion
+ );
+ scratchPitchQuaternion = Quaternion.fromAxisAngle(
+ Cartesian3_default.UNIT_Y,
+ -headingPitchRoll.pitch,
+ result
+ );
+ result = Quaternion.multiply(
+ scratchPitchQuaternion,
+ scratchRollQuaternion,
+ scratchPitchQuaternion
+ );
+ scratchHeadingQuaternion = Quaternion.fromAxisAngle(
+ Cartesian3_default.UNIT_Z,
+ -headingPitchRoll.heading,
+ scratchHPRQuaternion
+ );
+ return Quaternion.multiply(scratchHeadingQuaternion, result, result);
+};
+var sampledQuaternionAxis = new Cartesian3_default();
+var sampledQuaternionRotation = new Cartesian3_default();
+var sampledQuaternionTempQuaternion = new Quaternion();
+var sampledQuaternionQuaternion0 = new Quaternion();
+var sampledQuaternionQuaternion0Conjugate = new Quaternion();
+Quaternion.packedLength = 4;
+Quaternion.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.x;
+ array[startingIndex++] = value.y;
+ array[startingIndex++] = value.z;
+ array[startingIndex] = value.w;
+ return array;
+};
+Quaternion.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new Quaternion();
+ }
+ result.x = array[startingIndex];
+ result.y = array[startingIndex + 1];
+ result.z = array[startingIndex + 2];
+ result.w = array[startingIndex + 3];
+ return result;
+};
+Quaternion.packedInterpolationLength = 3;
+Quaternion.convertPackedArrayForInterpolation = function(packedArray, startingIndex, lastIndex, result) {
+ Quaternion.unpack(
+ packedArray,
+ lastIndex * 4,
+ sampledQuaternionQuaternion0Conjugate
+ );
+ Quaternion.conjugate(
+ sampledQuaternionQuaternion0Conjugate,
+ sampledQuaternionQuaternion0Conjugate
+ );
+ for (let i = 0, len = lastIndex - startingIndex + 1; i < len; i++) {
+ const offset2 = i * 3;
+ Quaternion.unpack(
+ packedArray,
+ (startingIndex + i) * 4,
+ sampledQuaternionTempQuaternion
+ );
+ Quaternion.multiply(
+ sampledQuaternionTempQuaternion,
+ sampledQuaternionQuaternion0Conjugate,
+ sampledQuaternionTempQuaternion
+ );
+ if (sampledQuaternionTempQuaternion.w < 0) {
+ Quaternion.negate(
+ sampledQuaternionTempQuaternion,
+ sampledQuaternionTempQuaternion
+ );
+ }
+ Quaternion.computeAxis(
+ sampledQuaternionTempQuaternion,
+ sampledQuaternionAxis
+ );
+ const angle = Quaternion.computeAngle(sampledQuaternionTempQuaternion);
+ if (!defined_default(result)) {
+ result = [];
+ }
+ result[offset2] = sampledQuaternionAxis.x * angle;
+ result[offset2 + 1] = sampledQuaternionAxis.y * angle;
+ result[offset2 + 2] = sampledQuaternionAxis.z * angle;
+ }
+};
+Quaternion.unpackInterpolationResult = function(array, sourceArray, firstIndex, lastIndex, result) {
+ if (!defined_default(result)) {
+ result = new Quaternion();
+ }
+ Cartesian3_default.fromArray(array, 0, sampledQuaternionRotation);
+ const magnitude = Cartesian3_default.magnitude(sampledQuaternionRotation);
+ Quaternion.unpack(sourceArray, lastIndex * 4, sampledQuaternionQuaternion0);
+ if (magnitude === 0) {
+ Quaternion.clone(Quaternion.IDENTITY, sampledQuaternionTempQuaternion);
+ } else {
+ Quaternion.fromAxisAngle(
+ sampledQuaternionRotation,
+ magnitude,
+ sampledQuaternionTempQuaternion
+ );
+ }
+ return Quaternion.multiply(
+ sampledQuaternionTempQuaternion,
+ sampledQuaternionQuaternion0,
+ result
+ );
+};
+Quaternion.clone = function(quaternion, result) {
+ if (!defined_default(quaternion)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Quaternion(
+ quaternion.x,
+ quaternion.y,
+ quaternion.z,
+ quaternion.w
+ );
+ }
+ result.x = quaternion.x;
+ result.y = quaternion.y;
+ result.z = quaternion.z;
+ result.w = quaternion.w;
+ return result;
+};
+Quaternion.conjugate = function(quaternion, result) {
+ Check_default.typeOf.object("quaternion", quaternion);
+ Check_default.typeOf.object("result", result);
+ result.x = -quaternion.x;
+ result.y = -quaternion.y;
+ result.z = -quaternion.z;
+ result.w = quaternion.w;
+ return result;
+};
+Quaternion.magnitudeSquared = function(quaternion) {
+ Check_default.typeOf.object("quaternion", quaternion);
+ return quaternion.x * quaternion.x + quaternion.y * quaternion.y + quaternion.z * quaternion.z + quaternion.w * quaternion.w;
+};
+Quaternion.magnitude = function(quaternion) {
+ return Math.sqrt(Quaternion.magnitudeSquared(quaternion));
+};
+Quaternion.normalize = function(quaternion, result) {
+ Check_default.typeOf.object("result", result);
+ const inverseMagnitude = 1 / Quaternion.magnitude(quaternion);
+ const x = quaternion.x * inverseMagnitude;
+ const y = quaternion.y * inverseMagnitude;
+ const z = quaternion.z * inverseMagnitude;
+ const w = quaternion.w * inverseMagnitude;
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+};
+Quaternion.inverse = function(quaternion, result) {
+ Check_default.typeOf.object("result", result);
+ const magnitudeSquared = Quaternion.magnitudeSquared(quaternion);
+ result = Quaternion.conjugate(quaternion, result);
+ return Quaternion.multiplyByScalar(result, 1 / magnitudeSquared, result);
+};
+Quaternion.add = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x + right.x;
+ result.y = left.y + right.y;
+ result.z = left.z + right.z;
+ result.w = left.w + right.w;
+ return result;
+};
+Quaternion.subtract = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ result.x = left.x - right.x;
+ result.y = left.y - right.y;
+ result.z = left.z - right.z;
+ result.w = left.w - right.w;
+ return result;
+};
+Quaternion.negate = function(quaternion, result) {
+ Check_default.typeOf.object("quaternion", quaternion);
+ Check_default.typeOf.object("result", result);
+ result.x = -quaternion.x;
+ result.y = -quaternion.y;
+ result.z = -quaternion.z;
+ result.w = -quaternion.w;
+ return result;
+};
+Quaternion.dot = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w;
+};
+Quaternion.multiply = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ Check_default.typeOf.object("result", result);
+ const leftX = left.x;
+ const leftY = left.y;
+ const leftZ = left.z;
+ const leftW = left.w;
+ const rightX = right.x;
+ const rightY = right.y;
+ const rightZ = right.z;
+ const rightW = right.w;
+ const x = leftW * rightX + leftX * rightW + leftY * rightZ - leftZ * rightY;
+ const y = leftW * rightY - leftX * rightZ + leftY * rightW + leftZ * rightX;
+ const z = leftW * rightZ + leftX * rightY - leftY * rightX + leftZ * rightW;
+ const w = leftW * rightW - leftX * rightX - leftY * rightY - leftZ * rightZ;
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ result.w = w;
+ return result;
+};
+Quaternion.multiplyByScalar = function(quaternion, scalar, result) {
+ Check_default.typeOf.object("quaternion", quaternion);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result.x = quaternion.x * scalar;
+ result.y = quaternion.y * scalar;
+ result.z = quaternion.z * scalar;
+ result.w = quaternion.w * scalar;
+ return result;
+};
+Quaternion.divideByScalar = function(quaternion, scalar, result) {
+ Check_default.typeOf.object("quaternion", quaternion);
+ Check_default.typeOf.number("scalar", scalar);
+ Check_default.typeOf.object("result", result);
+ result.x = quaternion.x / scalar;
+ result.y = quaternion.y / scalar;
+ result.z = quaternion.z / scalar;
+ result.w = quaternion.w / scalar;
+ return result;
+};
+Quaternion.computeAxis = function(quaternion, result) {
+ Check_default.typeOf.object("quaternion", quaternion);
+ Check_default.typeOf.object("result", result);
+ const w = quaternion.w;
+ if (Math.abs(w - 1) < Math_default.EPSILON6) {
+ result.x = result.y = result.z = 0;
+ return result;
+ }
+ const scalar = 1 / Math.sqrt(1 - w * w);
+ result.x = quaternion.x * scalar;
+ result.y = quaternion.y * scalar;
+ result.z = quaternion.z * scalar;
+ return result;
+};
+Quaternion.computeAngle = function(quaternion) {
+ Check_default.typeOf.object("quaternion", quaternion);
+ if (Math.abs(quaternion.w - 1) < Math_default.EPSILON6) {
+ return 0;
+ }
+ return 2 * Math.acos(quaternion.w);
+};
+var lerpScratch4 = new Quaternion();
+Quaternion.lerp = function(start, end, t, result) {
+ Check_default.typeOf.object("start", start);
+ Check_default.typeOf.object("end", end);
+ Check_default.typeOf.number("t", t);
+ Check_default.typeOf.object("result", result);
+ lerpScratch4 = Quaternion.multiplyByScalar(end, t, lerpScratch4);
+ result = Quaternion.multiplyByScalar(start, 1 - t, result);
+ return Quaternion.add(lerpScratch4, result, result);
+};
+var slerpEndNegated = new Quaternion();
+var slerpScaledP = new Quaternion();
+var slerpScaledR = new Quaternion();
+Quaternion.slerp = function(start, end, t, result) {
+ Check_default.typeOf.object("start", start);
+ Check_default.typeOf.object("end", end);
+ Check_default.typeOf.number("t", t);
+ Check_default.typeOf.object("result", result);
+ let dot2 = Quaternion.dot(start, end);
+ let r = end;
+ if (dot2 < 0) {
+ dot2 = -dot2;
+ r = slerpEndNegated = Quaternion.negate(end, slerpEndNegated);
+ }
+ if (1 - dot2 < Math_default.EPSILON6) {
+ return Quaternion.lerp(start, r, t, result);
+ }
+ const theta = Math.acos(dot2);
+ slerpScaledP = Quaternion.multiplyByScalar(
+ start,
+ Math.sin((1 - t) * theta),
+ slerpScaledP
+ );
+ slerpScaledR = Quaternion.multiplyByScalar(
+ r,
+ Math.sin(t * theta),
+ slerpScaledR
+ );
+ result = Quaternion.add(slerpScaledP, slerpScaledR, result);
+ return Quaternion.multiplyByScalar(result, 1 / Math.sin(theta), result);
+};
+Quaternion.log = function(quaternion, result) {
+ Check_default.typeOf.object("quaternion", quaternion);
+ Check_default.typeOf.object("result", result);
+ const theta = Math_default.acosClamped(quaternion.w);
+ let thetaOverSinTheta = 0;
+ if (theta !== 0) {
+ thetaOverSinTheta = theta / Math.sin(theta);
+ }
+ return Cartesian3_default.multiplyByScalar(quaternion, thetaOverSinTheta, result);
+};
+Quaternion.exp = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ Check_default.typeOf.object("result", result);
+ const theta = Cartesian3_default.magnitude(cartesian11);
+ let sinThetaOverTheta = 0;
+ if (theta !== 0) {
+ sinThetaOverTheta = Math.sin(theta) / theta;
+ }
+ result.x = cartesian11.x * sinThetaOverTheta;
+ result.y = cartesian11.y * sinThetaOverTheta;
+ result.z = cartesian11.z * sinThetaOverTheta;
+ result.w = Math.cos(theta);
+ return result;
+};
+var squadScratchCartesian0 = new Cartesian3_default();
+var squadScratchCartesian1 = new Cartesian3_default();
+var squadScratchQuaternion0 = new Quaternion();
+var squadScratchQuaternion1 = new Quaternion();
+Quaternion.computeInnerQuadrangle = function(q0, q12, q22, result) {
+ Check_default.typeOf.object("q0", q0);
+ Check_default.typeOf.object("q1", q12);
+ Check_default.typeOf.object("q2", q22);
+ Check_default.typeOf.object("result", result);
+ const qInv = Quaternion.conjugate(q12, squadScratchQuaternion0);
+ Quaternion.multiply(qInv, q22, squadScratchQuaternion1);
+ const cart0 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian0);
+ Quaternion.multiply(qInv, q0, squadScratchQuaternion1);
+ const cart1 = Quaternion.log(squadScratchQuaternion1, squadScratchCartesian1);
+ Cartesian3_default.add(cart0, cart1, cart0);
+ Cartesian3_default.multiplyByScalar(cart0, 0.25, cart0);
+ Cartesian3_default.negate(cart0, cart0);
+ Quaternion.exp(cart0, squadScratchQuaternion0);
+ return Quaternion.multiply(q12, squadScratchQuaternion0, result);
+};
+Quaternion.squad = function(q0, q12, s0, s1, t, result) {
+ Check_default.typeOf.object("q0", q0);
+ Check_default.typeOf.object("q1", q12);
+ Check_default.typeOf.object("s0", s0);
+ Check_default.typeOf.object("s1", s1);
+ Check_default.typeOf.number("t", t);
+ Check_default.typeOf.object("result", result);
+ const slerp0 = Quaternion.slerp(q0, q12, t, squadScratchQuaternion0);
+ const slerp1 = Quaternion.slerp(s0, s1, t, squadScratchQuaternion1);
+ return Quaternion.slerp(slerp0, slerp1, 2 * t * (1 - t), result);
+};
+var fastSlerpScratchQuaternion = new Quaternion();
+var opmu = 1.9011074535173003;
+var u = FeatureDetection_default.supportsTypedArrays() ? new Float32Array(8) : [];
+var v = FeatureDetection_default.supportsTypedArrays() ? new Float32Array(8) : [];
+var bT = FeatureDetection_default.supportsTypedArrays() ? new Float32Array(8) : [];
+var bD = FeatureDetection_default.supportsTypedArrays() ? new Float32Array(8) : [];
+for (let i = 0; i < 7; ++i) {
+ const s = i + 1;
+ const t = 2 * s + 1;
+ u[i] = 1 / (s * t);
+ v[i] = s / t;
+}
+u[7] = opmu / (8 * 17);
+v[7] = opmu * 8 / 17;
+Quaternion.fastSlerp = function(start, end, t, result) {
+ Check_default.typeOf.object("start", start);
+ Check_default.typeOf.object("end", end);
+ Check_default.typeOf.number("t", t);
+ Check_default.typeOf.object("result", result);
+ let x = Quaternion.dot(start, end);
+ let sign2;
+ if (x >= 0) {
+ sign2 = 1;
+ } else {
+ sign2 = -1;
+ x = -x;
+ }
+ const xm1 = x - 1;
+ const d = 1 - t;
+ const sqrT = t * t;
+ const sqrD = d * d;
+ for (let i = 7; i >= 0; --i) {
+ bT[i] = (u[i] * sqrT - v[i]) * xm1;
+ bD[i] = (u[i] * sqrD - v[i]) * xm1;
+ }
+ const cT = sign2 * t * (1 + bT[0] * (1 + bT[1] * (1 + bT[2] * (1 + bT[3] * (1 + bT[4] * (1 + bT[5] * (1 + bT[6] * (1 + bT[7]))))))));
+ const cD = d * (1 + bD[0] * (1 + bD[1] * (1 + bD[2] * (1 + bD[3] * (1 + bD[4] * (1 + bD[5] * (1 + bD[6] * (1 + bD[7]))))))));
+ const temp = Quaternion.multiplyByScalar(
+ start,
+ cD,
+ fastSlerpScratchQuaternion
+ );
+ Quaternion.multiplyByScalar(end, cT, result);
+ return Quaternion.add(temp, result, result);
+};
+Quaternion.fastSquad = function(q0, q12, s0, s1, t, result) {
+ Check_default.typeOf.object("q0", q0);
+ Check_default.typeOf.object("q1", q12);
+ Check_default.typeOf.object("s0", s0);
+ Check_default.typeOf.object("s1", s1);
+ Check_default.typeOf.number("t", t);
+ Check_default.typeOf.object("result", result);
+ const slerp0 = Quaternion.fastSlerp(q0, q12, t, squadScratchQuaternion0);
+ const slerp1 = Quaternion.fastSlerp(s0, s1, t, squadScratchQuaternion1);
+ return Quaternion.fastSlerp(slerp0, slerp1, 2 * t * (1 - t), result);
+};
+Quaternion.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.x === right.x && left.y === right.y && left.z === right.z && left.w === right.w;
+};
+Quaternion.equalsEpsilon = function(left, right, epsilon) {
+ epsilon = defaultValue_default(epsilon, 0);
+ return left === right || defined_default(left) && defined_default(right) && Math.abs(left.x - right.x) <= epsilon && Math.abs(left.y - right.y) <= epsilon && Math.abs(left.z - right.z) <= epsilon && Math.abs(left.w - right.w) <= epsilon;
+};
+Quaternion.ZERO = Object.freeze(new Quaternion(0, 0, 0, 0));
+Quaternion.IDENTITY = Object.freeze(new Quaternion(0, 0, 0, 1));
+Quaternion.prototype.clone = function(result) {
+ return Quaternion.clone(this, result);
+};
+Quaternion.prototype.equals = function(right) {
+ return Quaternion.equals(this, right);
+};
+Quaternion.prototype.equalsEpsilon = function(right, epsilon) {
+ return Quaternion.equalsEpsilon(this, right, epsilon);
+};
+Quaternion.prototype.toString = function() {
+ return `(${this.x}, ${this.y}, ${this.z}, ${this.w})`;
+};
+var Quaternion_default = Quaternion;
+
+// Source/Core/binarySearch.js
+function binarySearch(array, itemToFind, comparator) {
+ Check_default.defined("array", array);
+ Check_default.defined("itemToFind", itemToFind);
+ Check_default.defined("comparator", comparator);
+ let low = 0;
+ let high = array.length - 1;
+ let i;
+ let comparison;
+ while (low <= high) {
+ i = ~~((low + high) / 2);
+ comparison = comparator(array[i], itemToFind);
+ if (comparison < 0) {
+ low = i + 1;
+ continue;
+ }
+ if (comparison > 0) {
+ high = i - 1;
+ continue;
+ }
+ return i;
+ }
+ return ~(high + 1);
+}
+var binarySearch_default = binarySearch;
+
+// Source/Core/EarthOrientationParametersSample.js
+function EarthOrientationParametersSample(xPoleWander, yPoleWander, xPoleOffset, yPoleOffset, ut1MinusUtc) {
+ this.xPoleWander = xPoleWander;
+ this.yPoleWander = yPoleWander;
+ this.xPoleOffset = xPoleOffset;
+ this.yPoleOffset = yPoleOffset;
+ this.ut1MinusUtc = ut1MinusUtc;
+}
+var EarthOrientationParametersSample_default = EarthOrientationParametersSample;
+
+// Source/Core/GregorianDate.js
+function GregorianDate(year, month, day, hour, minute, second, millisecond, isLeapSecond) {
+ this.year = year;
+ this.month = month;
+ this.day = day;
+ this.hour = hour;
+ this.minute = minute;
+ this.second = second;
+ this.millisecond = millisecond;
+ this.isLeapSecond = isLeapSecond;
+}
+var GregorianDate_default = GregorianDate;
+
+// Source/Core/isLeapYear.js
+function isLeapYear(year) {
+ if (year === null || isNaN(year)) {
+ throw new DeveloperError_default("year is required and must be a number.");
+ }
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
+}
+var isLeapYear_default = isLeapYear;
+
+// Source/Core/LeapSecond.js
+function LeapSecond(date, offset2) {
+ this.julianDate = date;
+ this.offset = offset2;
+}
+var LeapSecond_default = LeapSecond;
+
+// Source/Core/TimeConstants.js
+var TimeConstants = {
+ SECONDS_PER_MILLISECOND: 1e-3,
+ SECONDS_PER_MINUTE: 60,
+ MINUTES_PER_HOUR: 60,
+ HOURS_PER_DAY: 24,
+ SECONDS_PER_HOUR: 3600,
+ MINUTES_PER_DAY: 1440,
+ SECONDS_PER_DAY: 86400,
+ DAYS_PER_JULIAN_CENTURY: 36525,
+ PICOSECOND: 1e-9,
+ MODIFIED_JULIAN_DATE_DIFFERENCE: 24000005e-1
+};
+var TimeConstants_default = Object.freeze(TimeConstants);
+
+// Source/Core/TimeStandard.js
+var TimeStandard = {
+ UTC: 0,
+ TAI: 1
+};
+var TimeStandard_default = Object.freeze(TimeStandard);
+
+// Source/Core/JulianDate.js
+var gregorianDateScratch = new GregorianDate_default();
+var daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+var daysInLeapFeburary = 29;
+function compareLeapSecondDates(leapSecond, dateToFind) {
+ return JulianDate.compare(leapSecond.julianDate, dateToFind.julianDate);
+}
+var binarySearchScratchLeapSecond = new LeapSecond_default();
+function convertUtcToTai(julianDate) {
+ binarySearchScratchLeapSecond.julianDate = julianDate;
+ const leapSeconds = JulianDate.leapSeconds;
+ let index = binarySearch_default(
+ leapSeconds,
+ binarySearchScratchLeapSecond,
+ compareLeapSecondDates
+ );
+ if (index < 0) {
+ index = ~index;
+ }
+ if (index >= leapSeconds.length) {
+ index = leapSeconds.length - 1;
+ }
+ let offset2 = leapSeconds[index].offset;
+ if (index > 0) {
+ const difference = JulianDate.secondsDifference(
+ leapSeconds[index].julianDate,
+ julianDate
+ );
+ if (difference > offset2) {
+ index--;
+ offset2 = leapSeconds[index].offset;
+ }
+ }
+ JulianDate.addSeconds(julianDate, offset2, julianDate);
+}
+function convertTaiToUtc(julianDate, result) {
+ binarySearchScratchLeapSecond.julianDate = julianDate;
+ const leapSeconds = JulianDate.leapSeconds;
+ let index = binarySearch_default(
+ leapSeconds,
+ binarySearchScratchLeapSecond,
+ compareLeapSecondDates
+ );
+ if (index < 0) {
+ index = ~index;
+ }
+ if (index === 0) {
+ return JulianDate.addSeconds(julianDate, -leapSeconds[0].offset, result);
+ }
+ if (index >= leapSeconds.length) {
+ return JulianDate.addSeconds(
+ julianDate,
+ -leapSeconds[index - 1].offset,
+ result
+ );
+ }
+ const difference = JulianDate.secondsDifference(
+ leapSeconds[index].julianDate,
+ julianDate
+ );
+ if (difference === 0) {
+ return JulianDate.addSeconds(
+ julianDate,
+ -leapSeconds[index].offset,
+ result
+ );
+ }
+ if (difference <= 1) {
+ return void 0;
+ }
+ return JulianDate.addSeconds(
+ julianDate,
+ -leapSeconds[--index].offset,
+ result
+ );
+}
+function setComponents(wholeDays, secondsOfDay, julianDate) {
+ const extraDays = secondsOfDay / TimeConstants_default.SECONDS_PER_DAY | 0;
+ wholeDays += extraDays;
+ secondsOfDay -= TimeConstants_default.SECONDS_PER_DAY * extraDays;
+ if (secondsOfDay < 0) {
+ wholeDays--;
+ secondsOfDay += TimeConstants_default.SECONDS_PER_DAY;
+ }
+ julianDate.dayNumber = wholeDays;
+ julianDate.secondsOfDay = secondsOfDay;
+ return julianDate;
+}
+function computeJulianDateComponents(year, month, day, hour, minute, second, millisecond) {
+ const a3 = (month - 14) / 12 | 0;
+ const b = year + 4800 + a3;
+ let dayNumber = (1461 * b / 4 | 0) + (367 * (month - 2 - 12 * a3) / 12 | 0) - (3 * ((b + 100) / 100 | 0) / 4 | 0) + day - 32075;
+ hour = hour - 12;
+ if (hour < 0) {
+ hour += 24;
+ }
+ const secondsOfDay = second + (hour * TimeConstants_default.SECONDS_PER_HOUR + minute * TimeConstants_default.SECONDS_PER_MINUTE + millisecond * TimeConstants_default.SECONDS_PER_MILLISECOND);
+ if (secondsOfDay >= 43200) {
+ dayNumber -= 1;
+ }
+ return [dayNumber, secondsOfDay];
+}
+var matchCalendarYear = /^(\d{4})$/;
+var matchCalendarMonth = /^(\d{4})-(\d{2})$/;
+var matchOrdinalDate = /^(\d{4})-?(\d{3})$/;
+var matchWeekDate = /^(\d{4})-?W(\d{2})-?(\d{1})?$/;
+var matchCalendarDate = /^(\d{4})-?(\d{2})-?(\d{2})$/;
+var utcOffset = /([Z+\-])?(\d{2})?:?(\d{2})?$/;
+var matchHours = /^(\d{2})(\.\d+)?/.source + utcOffset.source;
+var matchHoursMinutes = /^(\d{2}):?(\d{2})(\.\d+)?/.source + utcOffset.source;
+var matchHoursMinutesSeconds = /^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source + utcOffset.source;
+var iso8601ErrorMessage = "Invalid ISO 8601 date.";
+function JulianDate(julianDayNumber, secondsOfDay, timeStandard) {
+ this.dayNumber = void 0;
+ this.secondsOfDay = void 0;
+ julianDayNumber = defaultValue_default(julianDayNumber, 0);
+ secondsOfDay = defaultValue_default(secondsOfDay, 0);
+ timeStandard = defaultValue_default(timeStandard, TimeStandard_default.UTC);
+ const wholeDays = julianDayNumber | 0;
+ secondsOfDay = secondsOfDay + (julianDayNumber - wholeDays) * TimeConstants_default.SECONDS_PER_DAY;
+ setComponents(wholeDays, secondsOfDay, this);
+ if (timeStandard === TimeStandard_default.UTC) {
+ convertUtcToTai(this);
+ }
+}
+JulianDate.fromGregorianDate = function(date, result) {
+ if (!(date instanceof GregorianDate_default)) {
+ throw new DeveloperError_default("date must be a valid GregorianDate.");
+ }
+ const components = computeJulianDateComponents(
+ date.year,
+ date.month,
+ date.day,
+ date.hour,
+ date.minute,
+ date.second,
+ date.millisecond
+ );
+ if (!defined_default(result)) {
+ return new JulianDate(components[0], components[1], TimeStandard_default.UTC);
+ }
+ setComponents(components[0], components[1], result);
+ convertUtcToTai(result);
+ return result;
+};
+JulianDate.fromDate = function(date, result) {
+ if (!(date instanceof Date) || isNaN(date.getTime())) {
+ throw new DeveloperError_default("date must be a valid JavaScript Date.");
+ }
+ const components = computeJulianDateComponents(
+ date.getUTCFullYear(),
+ date.getUTCMonth() + 1,
+ date.getUTCDate(),
+ date.getUTCHours(),
+ date.getUTCMinutes(),
+ date.getUTCSeconds(),
+ date.getUTCMilliseconds()
+ );
+ if (!defined_default(result)) {
+ return new JulianDate(components[0], components[1], TimeStandard_default.UTC);
+ }
+ setComponents(components[0], components[1], result);
+ convertUtcToTai(result);
+ return result;
+};
+JulianDate.fromIso8601 = function(iso8601String, result) {
+ if (typeof iso8601String !== "string") {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ iso8601String = iso8601String.replace(",", ".");
+ let tokens = iso8601String.split("T");
+ let year;
+ let month = 1;
+ let day = 1;
+ let hour = 0;
+ let minute = 0;
+ let second = 0;
+ let millisecond = 0;
+ const date = tokens[0];
+ const time = tokens[1];
+ let tmp2;
+ let inLeapYear;
+ if (!defined_default(date)) {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ let dashCount;
+ tokens = date.match(matchCalendarDate);
+ if (tokens !== null) {
+ dashCount = date.split("-").length - 1;
+ if (dashCount > 0 && dashCount !== 2) {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ year = +tokens[1];
+ month = +tokens[2];
+ day = +tokens[3];
+ } else {
+ tokens = date.match(matchCalendarMonth);
+ if (tokens !== null) {
+ year = +tokens[1];
+ month = +tokens[2];
+ } else {
+ tokens = date.match(matchCalendarYear);
+ if (tokens !== null) {
+ year = +tokens[1];
+ } else {
+ let dayOfYear;
+ tokens = date.match(matchOrdinalDate);
+ if (tokens !== null) {
+ year = +tokens[1];
+ dayOfYear = +tokens[2];
+ inLeapYear = isLeapYear_default(year);
+ if (dayOfYear < 1 || inLeapYear && dayOfYear > 366 || !inLeapYear && dayOfYear > 365) {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ } else {
+ tokens = date.match(matchWeekDate);
+ if (tokens !== null) {
+ year = +tokens[1];
+ const weekNumber = +tokens[2];
+ const dayOfWeek = +tokens[3] || 0;
+ dashCount = date.split("-").length - 1;
+ if (dashCount > 0 && (!defined_default(tokens[3]) && dashCount !== 1 || defined_default(tokens[3]) && dashCount !== 2)) {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ const january4 = new Date(Date.UTC(year, 0, 4));
+ dayOfYear = weekNumber * 7 + dayOfWeek - january4.getUTCDay() - 3;
+ } else {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ }
+ tmp2 = new Date(Date.UTC(year, 0, 1));
+ tmp2.setUTCDate(dayOfYear);
+ month = tmp2.getUTCMonth() + 1;
+ day = tmp2.getUTCDate();
+ }
+ }
+ }
+ inLeapYear = isLeapYear_default(year);
+ if (month < 1 || month > 12 || day < 1 || (month !== 2 || !inLeapYear) && day > daysInMonth[month - 1] || inLeapYear && month === 2 && day > daysInLeapFeburary) {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ let offsetIndex;
+ if (defined_default(time)) {
+ tokens = time.match(matchHoursMinutesSeconds);
+ if (tokens !== null) {
+ dashCount = time.split(":").length - 1;
+ if (dashCount > 0 && dashCount !== 2 && dashCount !== 3) {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ hour = +tokens[1];
+ minute = +tokens[2];
+ second = +tokens[3];
+ millisecond = +(tokens[4] || 0) * 1e3;
+ offsetIndex = 5;
+ } else {
+ tokens = time.match(matchHoursMinutes);
+ if (tokens !== null) {
+ dashCount = time.split(":").length - 1;
+ if (dashCount > 2) {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ hour = +tokens[1];
+ minute = +tokens[2];
+ second = +(tokens[3] || 0) * 60;
+ offsetIndex = 4;
+ } else {
+ tokens = time.match(matchHours);
+ if (tokens !== null) {
+ hour = +tokens[1];
+ minute = +(tokens[2] || 0) * 60;
+ offsetIndex = 3;
+ } else {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ }
+ }
+ if (minute >= 60 || second >= 61 || hour > 24 || hour === 24 && (minute > 0 || second > 0 || millisecond > 0)) {
+ throw new DeveloperError_default(iso8601ErrorMessage);
+ }
+ const offset2 = tokens[offsetIndex];
+ const offsetHours = +tokens[offsetIndex + 1];
+ const offsetMinutes = +(tokens[offsetIndex + 2] || 0);
+ switch (offset2) {
+ case "+":
+ hour = hour - offsetHours;
+ minute = minute - offsetMinutes;
+ break;
+ case "-":
+ hour = hour + offsetHours;
+ minute = minute + offsetMinutes;
+ break;
+ case "Z":
+ break;
+ default:
+ minute = minute + new Date(
+ Date.UTC(year, month - 1, day, hour, minute)
+ ).getTimezoneOffset();
+ break;
+ }
+ }
+ const isLeapSecond = second === 60;
+ if (isLeapSecond) {
+ second--;
+ }
+ while (minute >= 60) {
+ minute -= 60;
+ hour++;
+ }
+ while (hour >= 24) {
+ hour -= 24;
+ day++;
+ }
+ tmp2 = inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];
+ while (day > tmp2) {
+ day -= tmp2;
+ month++;
+ if (month > 12) {
+ month -= 12;
+ year++;
+ }
+ tmp2 = inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];
+ }
+ while (minute < 0) {
+ minute += 60;
+ hour--;
+ }
+ while (hour < 0) {
+ hour += 24;
+ day--;
+ }
+ while (day < 1) {
+ month--;
+ if (month < 1) {
+ month += 12;
+ year--;
+ }
+ tmp2 = inLeapYear && month === 2 ? daysInLeapFeburary : daysInMonth[month - 1];
+ day += tmp2;
+ }
+ const components = computeJulianDateComponents(
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second,
+ millisecond
+ );
+ if (!defined_default(result)) {
+ result = new JulianDate(components[0], components[1], TimeStandard_default.UTC);
+ } else {
+ setComponents(components[0], components[1], result);
+ convertUtcToTai(result);
+ }
+ if (isLeapSecond) {
+ JulianDate.addSeconds(result, 1, result);
+ }
+ return result;
+};
+JulianDate.now = function(result) {
+ return JulianDate.fromDate(new Date(), result);
+};
+var toGregorianDateScratch = new JulianDate(0, 0, TimeStandard_default.TAI);
+JulianDate.toGregorianDate = function(julianDate, result) {
+ if (!defined_default(julianDate)) {
+ throw new DeveloperError_default("julianDate is required.");
+ }
+ let isLeapSecond = false;
+ let thisUtc = convertTaiToUtc(julianDate, toGregorianDateScratch);
+ if (!defined_default(thisUtc)) {
+ JulianDate.addSeconds(julianDate, -1, toGregorianDateScratch);
+ thisUtc = convertTaiToUtc(toGregorianDateScratch, toGregorianDateScratch);
+ isLeapSecond = true;
+ }
+ let julianDayNumber = thisUtc.dayNumber;
+ const secondsOfDay = thisUtc.secondsOfDay;
+ if (secondsOfDay >= 43200) {
+ julianDayNumber += 1;
+ }
+ let L = julianDayNumber + 68569 | 0;
+ const N = 4 * L / 146097 | 0;
+ L = L - ((146097 * N + 3) / 4 | 0) | 0;
+ const I = 4e3 * (L + 1) / 1461001 | 0;
+ L = L - (1461 * I / 4 | 0) + 31 | 0;
+ const J = 80 * L / 2447 | 0;
+ const day = L - (2447 * J / 80 | 0) | 0;
+ L = J / 11 | 0;
+ const month = J + 2 - 12 * L | 0;
+ const year = 100 * (N - 49) + I + L | 0;
+ let hour = secondsOfDay / TimeConstants_default.SECONDS_PER_HOUR | 0;
+ let remainingSeconds = secondsOfDay - hour * TimeConstants_default.SECONDS_PER_HOUR;
+ const minute = remainingSeconds / TimeConstants_default.SECONDS_PER_MINUTE | 0;
+ remainingSeconds = remainingSeconds - minute * TimeConstants_default.SECONDS_PER_MINUTE;
+ let second = remainingSeconds | 0;
+ const millisecond = (remainingSeconds - second) / TimeConstants_default.SECONDS_PER_MILLISECOND;
+ hour += 12;
+ if (hour > 23) {
+ hour -= 24;
+ }
+ if (isLeapSecond) {
+ second += 1;
+ }
+ if (!defined_default(result)) {
+ return new GregorianDate_default(
+ year,
+ month,
+ day,
+ hour,
+ minute,
+ second,
+ millisecond,
+ isLeapSecond
+ );
+ }
+ result.year = year;
+ result.month = month;
+ result.day = day;
+ result.hour = hour;
+ result.minute = minute;
+ result.second = second;
+ result.millisecond = millisecond;
+ result.isLeapSecond = isLeapSecond;
+ return result;
+};
+JulianDate.toDate = function(julianDate) {
+ if (!defined_default(julianDate)) {
+ throw new DeveloperError_default("julianDate is required.");
+ }
+ const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);
+ let second = gDate.second;
+ if (gDate.isLeapSecond) {
+ second -= 1;
+ }
+ return new Date(
+ Date.UTC(
+ gDate.year,
+ gDate.month - 1,
+ gDate.day,
+ gDate.hour,
+ gDate.minute,
+ second,
+ gDate.millisecond
+ )
+ );
+};
+JulianDate.toIso8601 = function(julianDate, precision) {
+ if (!defined_default(julianDate)) {
+ throw new DeveloperError_default("julianDate is required.");
+ }
+ const gDate = JulianDate.toGregorianDate(julianDate, gregorianDateScratch);
+ let year = gDate.year;
+ let month = gDate.month;
+ let day = gDate.day;
+ let hour = gDate.hour;
+ const minute = gDate.minute;
+ const second = gDate.second;
+ const millisecond = gDate.millisecond;
+ if (year === 1e4 && month === 1 && day === 1 && hour === 0 && minute === 0 && second === 0 && millisecond === 0) {
+ year = 9999;
+ month = 12;
+ day = 31;
+ hour = 24;
+ }
+ let millisecondStr;
+ if (!defined_default(precision) && millisecond !== 0) {
+ millisecondStr = (millisecond * 0.01).toString().replace(".", "");
+ return `${year.toString().padStart(4, "0")}-${month.toString().padStart(2, "0")}-${day.toString().padStart(2, "0")}T${hour.toString().padStart(2, "0")}:${minute.toString().padStart(2, "0")}:${second.toString().padStart(2, "0")}.${millisecondStr}Z`;
+ }
+ if (!defined_default(precision) || precision === 0) {
+ return `${year.toString().padStart(4, "0")}-${month.toString().padStart(2, "0")}-${day.toString().padStart(2, "0")}T${hour.toString().padStart(2, "0")}:${minute.toString().padStart(2, "0")}:${second.toString().padStart(2, "0")}Z`;
+ }
+ millisecondStr = (millisecond * 0.01).toFixed(precision).replace(".", "").slice(0, precision);
+ return `${year.toString().padStart(4, "0")}-${month.toString().padStart(2, "0")}-${day.toString().padStart(2, "0")}T${hour.toString().padStart(2, "0")}:${minute.toString().padStart(2, "0")}:${second.toString().padStart(2, "0")}.${millisecondStr}Z`;
+};
+JulianDate.clone = function(julianDate, result) {
+ if (!defined_default(julianDate)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new JulianDate(
+ julianDate.dayNumber,
+ julianDate.secondsOfDay,
+ TimeStandard_default.TAI
+ );
+ }
+ result.dayNumber = julianDate.dayNumber;
+ result.secondsOfDay = julianDate.secondsOfDay;
+ return result;
+};
+JulianDate.compare = function(left, right) {
+ if (!defined_default(left)) {
+ throw new DeveloperError_default("left is required.");
+ }
+ if (!defined_default(right)) {
+ throw new DeveloperError_default("right is required.");
+ }
+ const julianDayNumberDifference = left.dayNumber - right.dayNumber;
+ if (julianDayNumberDifference !== 0) {
+ return julianDayNumberDifference;
+ }
+ return left.secondsOfDay - right.secondsOfDay;
+};
+JulianDate.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.dayNumber === right.dayNumber && left.secondsOfDay === right.secondsOfDay;
+};
+JulianDate.equalsEpsilon = function(left, right, epsilon) {
+ epsilon = defaultValue_default(epsilon, 0);
+ return left === right || defined_default(left) && defined_default(right) && Math.abs(JulianDate.secondsDifference(left, right)) <= epsilon;
+};
+JulianDate.totalDays = function(julianDate) {
+ if (!defined_default(julianDate)) {
+ throw new DeveloperError_default("julianDate is required.");
+ }
+ return julianDate.dayNumber + julianDate.secondsOfDay / TimeConstants_default.SECONDS_PER_DAY;
+};
+JulianDate.secondsDifference = function(left, right) {
+ if (!defined_default(left)) {
+ throw new DeveloperError_default("left is required.");
+ }
+ if (!defined_default(right)) {
+ throw new DeveloperError_default("right is required.");
+ }
+ const dayDifference = (left.dayNumber - right.dayNumber) * TimeConstants_default.SECONDS_PER_DAY;
+ return dayDifference + (left.secondsOfDay - right.secondsOfDay);
+};
+JulianDate.daysDifference = function(left, right) {
+ if (!defined_default(left)) {
+ throw new DeveloperError_default("left is required.");
+ }
+ if (!defined_default(right)) {
+ throw new DeveloperError_default("right is required.");
+ }
+ const dayDifference = left.dayNumber - right.dayNumber;
+ const secondDifference = (left.secondsOfDay - right.secondsOfDay) / TimeConstants_default.SECONDS_PER_DAY;
+ return dayDifference + secondDifference;
+};
+JulianDate.computeTaiMinusUtc = function(julianDate) {
+ binarySearchScratchLeapSecond.julianDate = julianDate;
+ const leapSeconds = JulianDate.leapSeconds;
+ let index = binarySearch_default(
+ leapSeconds,
+ binarySearchScratchLeapSecond,
+ compareLeapSecondDates
+ );
+ if (index < 0) {
+ index = ~index;
+ --index;
+ if (index < 0) {
+ index = 0;
+ }
+ }
+ return leapSeconds[index].offset;
+};
+JulianDate.addSeconds = function(julianDate, seconds, result) {
+ if (!defined_default(julianDate)) {
+ throw new DeveloperError_default("julianDate is required.");
+ }
+ if (!defined_default(seconds)) {
+ throw new DeveloperError_default("seconds is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ return setComponents(
+ julianDate.dayNumber,
+ julianDate.secondsOfDay + seconds,
+ result
+ );
+};
+JulianDate.addMinutes = function(julianDate, minutes, result) {
+ if (!defined_default(julianDate)) {
+ throw new DeveloperError_default("julianDate is required.");
+ }
+ if (!defined_default(minutes)) {
+ throw new DeveloperError_default("minutes is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const newSecondsOfDay = julianDate.secondsOfDay + minutes * TimeConstants_default.SECONDS_PER_MINUTE;
+ return setComponents(julianDate.dayNumber, newSecondsOfDay, result);
+};
+JulianDate.addHours = function(julianDate, hours, result) {
+ if (!defined_default(julianDate)) {
+ throw new DeveloperError_default("julianDate is required.");
+ }
+ if (!defined_default(hours)) {
+ throw new DeveloperError_default("hours is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const newSecondsOfDay = julianDate.secondsOfDay + hours * TimeConstants_default.SECONDS_PER_HOUR;
+ return setComponents(julianDate.dayNumber, newSecondsOfDay, result);
+};
+JulianDate.addDays = function(julianDate, days, result) {
+ if (!defined_default(julianDate)) {
+ throw new DeveloperError_default("julianDate is required.");
+ }
+ if (!defined_default(days)) {
+ throw new DeveloperError_default("days is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const newJulianDayNumber = julianDate.dayNumber + days;
+ return setComponents(newJulianDayNumber, julianDate.secondsOfDay, result);
+};
+JulianDate.lessThan = function(left, right) {
+ return JulianDate.compare(left, right) < 0;
+};
+JulianDate.lessThanOrEquals = function(left, right) {
+ return JulianDate.compare(left, right) <= 0;
+};
+JulianDate.greaterThan = function(left, right) {
+ return JulianDate.compare(left, right) > 0;
+};
+JulianDate.greaterThanOrEquals = function(left, right) {
+ return JulianDate.compare(left, right) >= 0;
+};
+JulianDate.prototype.clone = function(result) {
+ return JulianDate.clone(this, result);
+};
+JulianDate.prototype.equals = function(right) {
+ return JulianDate.equals(this, right);
+};
+JulianDate.prototype.equalsEpsilon = function(right, epsilon) {
+ return JulianDate.equalsEpsilon(this, right, epsilon);
+};
+JulianDate.prototype.toString = function() {
+ return JulianDate.toIso8601(this);
+};
+JulianDate.leapSeconds = [
+ new LeapSecond_default(new JulianDate(2441317, 43210, TimeStandard_default.TAI), 10),
+ new LeapSecond_default(new JulianDate(2441499, 43211, TimeStandard_default.TAI), 11),
+ new LeapSecond_default(new JulianDate(2441683, 43212, TimeStandard_default.TAI), 12),
+ new LeapSecond_default(new JulianDate(2442048, 43213, TimeStandard_default.TAI), 13),
+ new LeapSecond_default(new JulianDate(2442413, 43214, TimeStandard_default.TAI), 14),
+ new LeapSecond_default(new JulianDate(2442778, 43215, TimeStandard_default.TAI), 15),
+ new LeapSecond_default(new JulianDate(2443144, 43216, TimeStandard_default.TAI), 16),
+ new LeapSecond_default(new JulianDate(2443509, 43217, TimeStandard_default.TAI), 17),
+ new LeapSecond_default(new JulianDate(2443874, 43218, TimeStandard_default.TAI), 18),
+ new LeapSecond_default(new JulianDate(2444239, 43219, TimeStandard_default.TAI), 19),
+ new LeapSecond_default(new JulianDate(2444786, 43220, TimeStandard_default.TAI), 20),
+ new LeapSecond_default(new JulianDate(2445151, 43221, TimeStandard_default.TAI), 21),
+ new LeapSecond_default(new JulianDate(2445516, 43222, TimeStandard_default.TAI), 22),
+ new LeapSecond_default(new JulianDate(2446247, 43223, TimeStandard_default.TAI), 23),
+ new LeapSecond_default(new JulianDate(2447161, 43224, TimeStandard_default.TAI), 24),
+ new LeapSecond_default(new JulianDate(2447892, 43225, TimeStandard_default.TAI), 25),
+ new LeapSecond_default(new JulianDate(2448257, 43226, TimeStandard_default.TAI), 26),
+ new LeapSecond_default(new JulianDate(2448804, 43227, TimeStandard_default.TAI), 27),
+ new LeapSecond_default(new JulianDate(2449169, 43228, TimeStandard_default.TAI), 28),
+ new LeapSecond_default(new JulianDate(2449534, 43229, TimeStandard_default.TAI), 29),
+ new LeapSecond_default(new JulianDate(2450083, 43230, TimeStandard_default.TAI), 30),
+ new LeapSecond_default(new JulianDate(2450630, 43231, TimeStandard_default.TAI), 31),
+ new LeapSecond_default(new JulianDate(2451179, 43232, TimeStandard_default.TAI), 32),
+ new LeapSecond_default(new JulianDate(2453736, 43233, TimeStandard_default.TAI), 33),
+ new LeapSecond_default(new JulianDate(2454832, 43234, TimeStandard_default.TAI), 34),
+ new LeapSecond_default(new JulianDate(2456109, 43235, TimeStandard_default.TAI), 35),
+ new LeapSecond_default(new JulianDate(2457204, 43236, TimeStandard_default.TAI), 36),
+ new LeapSecond_default(new JulianDate(2457754, 43237, TimeStandard_default.TAI), 37)
+];
+var JulianDate_default = JulianDate;
+
+// Source/Core/Resource.js
+var import_urijs6 = __toESM(require_URI(), 1);
+
+// Source/Core/appendForwardSlash.js
+function appendForwardSlash(url2) {
+ if (url2.length === 0 || url2[url2.length - 1] !== "/") {
+ url2 = `${url2}/`;
+ }
+ return url2;
+}
+var appendForwardSlash_default = appendForwardSlash;
+
+// Source/Core/combine.js
+function combine(object1, object2, deep) {
+ deep = defaultValue_default(deep, false);
+ const result = {};
+ const object1Defined = defined_default(object1);
+ const object2Defined = defined_default(object2);
+ let property;
+ let object1Value;
+ let object2Value;
+ if (object1Defined) {
+ for (property in object1) {
+ if (object1.hasOwnProperty(property)) {
+ object1Value = object1[property];
+ if (object2Defined && deep && typeof object1Value === "object" && object2.hasOwnProperty(property)) {
+ object2Value = object2[property];
+ if (typeof object2Value === "object") {
+ result[property] = combine(object1Value, object2Value, deep);
+ } else {
+ result[property] = object1Value;
+ }
+ } else {
+ result[property] = object1Value;
+ }
+ }
+ }
+ }
+ if (object2Defined) {
+ for (property in object2) {
+ if (object2.hasOwnProperty(property) && !result.hasOwnProperty(property)) {
+ object2Value = object2[property];
+ result[property] = object2Value;
+ }
+ }
+ }
+ return result;
+}
+var combine_default = combine;
+
+// Source/Core/defer.js
+function defer() {
+ let resolve2;
+ let reject;
+ const promise = new Promise(function(res, rej) {
+ resolve2 = res;
+ reject = rej;
+ });
+ return {
+ resolve: resolve2,
+ reject,
+ promise
+ };
+}
+var defer_default = defer;
+
+// Source/Core/getAbsoluteUri.js
+var import_urijs = __toESM(require_URI(), 1);
+function getAbsoluteUri(relative, base) {
+ let documentObject;
+ if (typeof document !== "undefined") {
+ documentObject = document;
+ }
+ return getAbsoluteUri._implementation(relative, base, documentObject);
+}
+getAbsoluteUri._implementation = function(relative, base, documentObject) {
+ if (!defined_default(relative)) {
+ throw new DeveloperError_default("relative uri is required.");
+ }
+ if (!defined_default(base)) {
+ if (typeof documentObject === "undefined") {
+ return relative;
+ }
+ base = defaultValue_default(documentObject.baseURI, documentObject.location.href);
+ }
+ const relativeUri = new import_urijs.default(relative);
+ if (relativeUri.scheme() !== "") {
+ return relativeUri.toString();
+ }
+ return relativeUri.absoluteTo(base).toString();
+};
+var getAbsoluteUri_default = getAbsoluteUri;
+
+// Source/Core/getBaseUri.js
+var import_urijs2 = __toESM(require_URI(), 1);
+function getBaseUri(uri, includeQuery) {
+ if (!defined_default(uri)) {
+ throw new DeveloperError_default("uri is required.");
+ }
+ let basePath = "";
+ const i = uri.lastIndexOf("/");
+ if (i !== -1) {
+ basePath = uri.substring(0, i + 1);
+ }
+ if (!includeQuery) {
+ return basePath;
+ }
+ uri = new import_urijs2.default(uri);
+ if (uri.query().length !== 0) {
+ basePath += `?${uri.query()}`;
+ }
+ if (uri.fragment().length !== 0) {
+ basePath += `#${uri.fragment()}`;
+ }
+ return basePath;
+}
+var getBaseUri_default = getBaseUri;
+
+// Source/Core/getExtensionFromUri.js
+var import_urijs3 = __toESM(require_URI(), 1);
+function getExtensionFromUri(uri) {
+ if (!defined_default(uri)) {
+ throw new DeveloperError_default("uri is required.");
+ }
+ const uriObject = new import_urijs3.default(uri);
+ uriObject.normalize();
+ let path = uriObject.path();
+ let index = path.lastIndexOf("/");
+ if (index !== -1) {
+ path = path.substr(index + 1);
+ }
+ index = path.lastIndexOf(".");
+ if (index === -1) {
+ path = "";
+ } else {
+ path = path.substr(index + 1);
+ }
+ return path;
+}
+var getExtensionFromUri_default = getExtensionFromUri;
+
+// Source/Core/getImagePixels.js
+var context2DsByWidthAndHeight = {};
+function getImagePixels(image, width, height) {
+ if (!defined_default(width)) {
+ width = image.width;
+ }
+ if (!defined_default(height)) {
+ height = image.height;
+ }
+ let context2DsByHeight = context2DsByWidthAndHeight[width];
+ if (!defined_default(context2DsByHeight)) {
+ context2DsByHeight = {};
+ context2DsByWidthAndHeight[width] = context2DsByHeight;
+ }
+ let context2d = context2DsByHeight[height];
+ if (!defined_default(context2d)) {
+ const canvas = document.createElement("canvas");
+ canvas.width = width;
+ canvas.height = height;
+ context2d = canvas.getContext("2d");
+ context2d.globalCompositeOperation = "copy";
+ context2DsByHeight[height] = context2d;
+ }
+ context2d.drawImage(image, 0, 0, width, height);
+ return context2d.getImageData(0, 0, width, height).data;
+}
+var getImagePixels_default = getImagePixels;
+
+// Source/Core/isBlobUri.js
+var blobUriRegex = /^blob:/i;
+function isBlobUri(uri) {
+ Check_default.typeOf.string("uri", uri);
+ return blobUriRegex.test(uri);
+}
+var isBlobUri_default = isBlobUri;
+
+// Source/Core/isCrossOriginUrl.js
+var a;
+function isCrossOriginUrl(url2) {
+ if (!defined_default(a)) {
+ a = document.createElement("a");
+ }
+ a.href = window.location.href;
+ const host = a.host;
+ const protocol = a.protocol;
+ a.href = url2;
+ a.href = a.href;
+ return protocol !== a.protocol || host !== a.host;
+}
+var isCrossOriginUrl_default = isCrossOriginUrl;
+
+// Source/Core/isDataUri.js
+var dataUriRegex = /^data:/i;
+function isDataUri(uri) {
+ Check_default.typeOf.string("uri", uri);
+ return dataUriRegex.test(uri);
+}
+var isDataUri_default = isDataUri;
+
+// Source/Core/loadAndExecuteScript.js
+function loadAndExecuteScript(url2) {
+ const script = document.createElement("script");
+ script.async = true;
+ script.src = url2;
+ return new Promise((resolve2, reject) => {
+ if (window.crossOriginIsolated) {
+ script.setAttribute("crossorigin", "anonymous");
+ }
+ const head = document.getElementsByTagName("head")[0];
+ script.onload = function() {
+ script.onload = void 0;
+ head.removeChild(script);
+ resolve2();
+ };
+ script.onerror = function(e) {
+ reject(e);
+ };
+ head.appendChild(script);
+ });
+}
+var loadAndExecuteScript_default = loadAndExecuteScript;
+
+// Source/Core/objectToQuery.js
+function objectToQuery(obj) {
+ if (!defined_default(obj)) {
+ throw new DeveloperError_default("obj is required.");
+ }
+ let result = "";
+ for (const propName in obj) {
+ if (obj.hasOwnProperty(propName)) {
+ const value = obj[propName];
+ const part = `${encodeURIComponent(propName)}=`;
+ if (Array.isArray(value)) {
+ for (let i = 0, len = value.length; i < len; ++i) {
+ result += `${part + encodeURIComponent(value[i])}&`;
+ }
+ } else {
+ result += `${part + encodeURIComponent(value)}&`;
+ }
+ }
+ }
+ result = result.slice(0, -1);
+ return result;
+}
+var objectToQuery_default = objectToQuery;
+
+// Source/Core/queryToObject.js
+function queryToObject(queryString) {
+ if (!defined_default(queryString)) {
+ throw new DeveloperError_default("queryString is required.");
+ }
+ const result = {};
+ if (queryString === "") {
+ return result;
+ }
+ const parts = queryString.replace(/\+/g, "%20").split(/[&;]/);
+ for (let i = 0, len = parts.length; i < len; ++i) {
+ const subparts = parts[i].split("=");
+ const name = decodeURIComponent(subparts[0]);
+ let value = subparts[1];
+ if (defined_default(value)) {
+ value = decodeURIComponent(value);
+ } else {
+ value = "";
+ }
+ const resultValue = result[name];
+ if (typeof resultValue === "string") {
+ result[name] = [resultValue, value];
+ } else if (Array.isArray(resultValue)) {
+ resultValue.push(value);
+ } else {
+ result[name] = value;
+ }
+ }
+ return result;
+}
+var queryToObject_default = queryToObject;
+
+// Source/Core/RequestState.js
+var RequestState = {
+ UNISSUED: 0,
+ ISSUED: 1,
+ ACTIVE: 2,
+ RECEIVED: 3,
+ CANCELLED: 4,
+ FAILED: 5
+};
+var RequestState_default = Object.freeze(RequestState);
+
+// Source/Core/RequestType.js
+var RequestType = {
+ TERRAIN: 0,
+ IMAGERY: 1,
+ TILES3D: 2,
+ OTHER: 3
+};
+var RequestType_default = Object.freeze(RequestType);
+
+// Source/Core/Request.js
+function Request(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const throttleByServer = defaultValue_default(options.throttleByServer, false);
+ const throttle = defaultValue_default(options.throttle, false);
+ this.url = options.url;
+ this.requestFunction = options.requestFunction;
+ this.cancelFunction = options.cancelFunction;
+ this.priorityFunction = options.priorityFunction;
+ this.priority = defaultValue_default(options.priority, 0);
+ this.throttle = throttle;
+ this.throttleByServer = throttleByServer;
+ this.type = defaultValue_default(options.type, RequestType_default.OTHER);
+ this.serverKey = void 0;
+ this.state = RequestState_default.UNISSUED;
+ this.deferred = void 0;
+ this.cancelled = false;
+}
+Request.prototype.cancel = function() {
+ this.cancelled = true;
+};
+Request.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new Request(this);
+ }
+ result.url = this.url;
+ result.requestFunction = this.requestFunction;
+ result.cancelFunction = this.cancelFunction;
+ result.priorityFunction = this.priorityFunction;
+ result.priority = this.priority;
+ result.throttle = this.throttle;
+ result.throttleByServer = this.throttleByServer;
+ result.type = this.type;
+ result.serverKey = this.serverKey;
+ result.state = this.RequestState.UNISSUED;
+ result.deferred = void 0;
+ result.cancelled = false;
+ return result;
+};
+var Request_default = Request;
+
+// Source/Core/parseResponseHeaders.js
+function parseResponseHeaders(headerString) {
+ const headers = {};
+ if (!headerString) {
+ return headers;
+ }
+ const headerPairs = headerString.split("\r\n");
+ for (let i = 0; i < headerPairs.length; ++i) {
+ const headerPair = headerPairs[i];
+ const index = headerPair.indexOf(": ");
+ if (index > 0) {
+ const key = headerPair.substring(0, index);
+ const val = headerPair.substring(index + 2);
+ headers[key] = val;
+ }
+ }
+ return headers;
+}
+var parseResponseHeaders_default = parseResponseHeaders;
+
+// Source/Core/RequestErrorEvent.js
+function RequestErrorEvent(statusCode, response, responseHeaders) {
+ this.statusCode = statusCode;
+ this.response = response;
+ this.responseHeaders = responseHeaders;
+ if (typeof this.responseHeaders === "string") {
+ this.responseHeaders = parseResponseHeaders_default(this.responseHeaders);
+ }
+}
+RequestErrorEvent.prototype.toString = function() {
+ let str = "Request has failed.";
+ if (defined_default(this.statusCode)) {
+ str += ` Status Code: ${this.statusCode}`;
+ }
+ return str;
+};
+var RequestErrorEvent_default = RequestErrorEvent;
+
+// Source/Core/RequestScheduler.js
+var import_urijs4 = __toESM(require_URI(), 1);
+
+// Source/Core/Event.js
+function Event() {
+ this._listeners = [];
+ this._scopes = [];
+ this._toRemove = [];
+ this._insideRaiseEvent = false;
+}
+Object.defineProperties(Event.prototype, {
+ numberOfListeners: {
+ get: function() {
+ return this._listeners.length - this._toRemove.length;
+ }
+ }
+});
+Event.prototype.addEventListener = function(listener, scope) {
+ Check_default.typeOf.func("listener", listener);
+ this._listeners.push(listener);
+ this._scopes.push(scope);
+ const event = this;
+ return function() {
+ event.removeEventListener(listener, scope);
+ };
+};
+Event.prototype.removeEventListener = function(listener, scope) {
+ Check_default.typeOf.func("listener", listener);
+ const listeners = this._listeners;
+ const scopes = this._scopes;
+ let index = -1;
+ for (let i = 0; i < listeners.length; i++) {
+ if (listeners[i] === listener && scopes[i] === scope) {
+ index = i;
+ break;
+ }
+ }
+ if (index !== -1) {
+ if (this._insideRaiseEvent) {
+ this._toRemove.push(index);
+ listeners[index] = void 0;
+ scopes[index] = void 0;
+ } else {
+ listeners.splice(index, 1);
+ scopes.splice(index, 1);
+ }
+ return true;
+ }
+ return false;
+};
+function compareNumber(a3, b) {
+ return b - a3;
+}
+Event.prototype.raiseEvent = function() {
+ this._insideRaiseEvent = true;
+ let i;
+ const listeners = this._listeners;
+ const scopes = this._scopes;
+ let length3 = listeners.length;
+ for (i = 0; i < length3; i++) {
+ const listener = listeners[i];
+ if (defined_default(listener)) {
+ listeners[i].apply(scopes[i], arguments);
+ }
+ }
+ const toRemove = this._toRemove;
+ length3 = toRemove.length;
+ if (length3 > 0) {
+ toRemove.sort(compareNumber);
+ for (i = 0; i < length3; i++) {
+ const index = toRemove[i];
+ listeners.splice(index, 1);
+ scopes.splice(index, 1);
+ }
+ toRemove.length = 0;
+ }
+ this._insideRaiseEvent = false;
+};
+var Event_default = Event;
+
+// Source/Core/Heap.js
+function Heap(options) {
+ Check_default.typeOf.object("options", options);
+ Check_default.defined("options.comparator", options.comparator);
+ this._comparator = options.comparator;
+ this._array = [];
+ this._length = 0;
+ this._maximumLength = void 0;
+}
+Object.defineProperties(Heap.prototype, {
+ length: {
+ get: function() {
+ return this._length;
+ }
+ },
+ internalArray: {
+ get: function() {
+ return this._array;
+ }
+ },
+ maximumLength: {
+ get: function() {
+ return this._maximumLength;
+ },
+ set: function(value) {
+ Check_default.typeOf.number.greaterThanOrEquals("maximumLength", value, 0);
+ const originalLength = this._length;
+ if (value < originalLength) {
+ const array = this._array;
+ for (let i = value; i < originalLength; ++i) {
+ array[i] = void 0;
+ }
+ this._length = value;
+ array.length = value;
+ }
+ this._maximumLength = value;
+ }
+ },
+ comparator: {
+ get: function() {
+ return this._comparator;
+ }
+ }
+});
+function swap(array, a3, b) {
+ const temp = array[a3];
+ array[a3] = array[b];
+ array[b] = temp;
+}
+Heap.prototype.reserve = function(length3) {
+ length3 = defaultValue_default(length3, this._length);
+ this._array.length = length3;
+};
+Heap.prototype.heapify = function(index) {
+ index = defaultValue_default(index, 0);
+ const length3 = this._length;
+ const comparator = this._comparator;
+ const array = this._array;
+ let candidate = -1;
+ let inserting = true;
+ while (inserting) {
+ const right = 2 * (index + 1);
+ const left = right - 1;
+ if (left < length3 && comparator(array[left], array[index]) < 0) {
+ candidate = left;
+ } else {
+ candidate = index;
+ }
+ if (right < length3 && comparator(array[right], array[candidate]) < 0) {
+ candidate = right;
+ }
+ if (candidate !== index) {
+ swap(array, candidate, index);
+ index = candidate;
+ } else {
+ inserting = false;
+ }
+ }
+};
+Heap.prototype.resort = function() {
+ const length3 = this._length;
+ for (let i = Math.ceil(length3 / 2); i >= 0; --i) {
+ this.heapify(i);
+ }
+};
+Heap.prototype.insert = function(element) {
+ Check_default.defined("element", element);
+ const array = this._array;
+ const comparator = this._comparator;
+ const maximumLength = this._maximumLength;
+ let index = this._length++;
+ if (index < array.length) {
+ array[index] = element;
+ } else {
+ array.push(element);
+ }
+ while (index !== 0) {
+ const parent = Math.floor((index - 1) / 2);
+ if (comparator(array[index], array[parent]) < 0) {
+ swap(array, index, parent);
+ index = parent;
+ } else {
+ break;
+ }
+ }
+ let removedElement;
+ if (defined_default(maximumLength) && this._length > maximumLength) {
+ removedElement = array[maximumLength];
+ this._length = maximumLength;
+ }
+ return removedElement;
+};
+Heap.prototype.pop = function(index) {
+ index = defaultValue_default(index, 0);
+ if (this._length === 0) {
+ return void 0;
+ }
+ Check_default.typeOf.number.lessThan("index", index, this._length);
+ const array = this._array;
+ const root = array[index];
+ swap(array, index, --this._length);
+ this.heapify(index);
+ array[this._length] = void 0;
+ return root;
+};
+var Heap_default = Heap;
+
+// Source/Core/RequestScheduler.js
+function sortRequests(a3, b) {
+ return a3.priority - b.priority;
+}
+var statistics = {
+ numberOfAttemptedRequests: 0,
+ numberOfActiveRequests: 0,
+ numberOfCancelledRequests: 0,
+ numberOfCancelledActiveRequests: 0,
+ numberOfFailedRequests: 0,
+ numberOfActiveRequestsEver: 0,
+ lastNumberOfActiveRequests: 0
+};
+var priorityHeapLength = 20;
+var requestHeap = new Heap_default({
+ comparator: sortRequests
+});
+requestHeap.maximumLength = priorityHeapLength;
+requestHeap.reserve(priorityHeapLength);
+var activeRequests = [];
+var numberOfActiveRequestsByServer = {};
+var pageUri = typeof document !== "undefined" ? new import_urijs4.default(document.location.href) : new import_urijs4.default();
+var requestCompletedEvent = new Event_default();
+function RequestScheduler() {
+}
+RequestScheduler.maximumRequests = 50;
+RequestScheduler.maximumRequestsPerServer = 6;
+RequestScheduler.requestsByServer = {
+ "api.cesium.com:443": 18,
+ "assets.cesium.com:443": 18
+};
+RequestScheduler.throttleRequests = true;
+RequestScheduler.debugShowStatistics = false;
+RequestScheduler.requestCompletedEvent = requestCompletedEvent;
+Object.defineProperties(RequestScheduler, {
+ statistics: {
+ get: function() {
+ return statistics;
+ }
+ },
+ priorityHeapLength: {
+ get: function() {
+ return priorityHeapLength;
+ },
+ set: function(value) {
+ if (value < priorityHeapLength) {
+ while (requestHeap.length > value) {
+ const request = requestHeap.pop();
+ cancelRequest(request);
+ }
+ }
+ priorityHeapLength = value;
+ requestHeap.maximumLength = value;
+ requestHeap.reserve(value);
+ }
+ }
+});
+function updatePriority(request) {
+ if (defined_default(request.priorityFunction)) {
+ request.priority = request.priorityFunction();
+ }
+}
+RequestScheduler.serverHasOpenSlots = function(serverKey, desiredRequests) {
+ desiredRequests = defaultValue_default(desiredRequests, 1);
+ const maxRequests = defaultValue_default(
+ RequestScheduler.requestsByServer[serverKey],
+ RequestScheduler.maximumRequestsPerServer
+ );
+ const hasOpenSlotsServer = numberOfActiveRequestsByServer[serverKey] + desiredRequests <= maxRequests;
+ return hasOpenSlotsServer;
+};
+RequestScheduler.heapHasOpenSlots = function(desiredRequests) {
+ const hasOpenSlotsHeap = requestHeap.length + desiredRequests <= priorityHeapLength;
+ return hasOpenSlotsHeap;
+};
+function issueRequest(request) {
+ if (request.state === RequestState_default.UNISSUED) {
+ request.state = RequestState_default.ISSUED;
+ request.deferred = defer_default();
+ }
+ return request.deferred.promise;
+}
+function getRequestReceivedFunction(request) {
+ return function(results) {
+ if (request.state === RequestState_default.CANCELLED) {
+ return;
+ }
+ const deferred = request.deferred;
+ --statistics.numberOfActiveRequests;
+ --numberOfActiveRequestsByServer[request.serverKey];
+ requestCompletedEvent.raiseEvent();
+ request.state = RequestState_default.RECEIVED;
+ request.deferred = void 0;
+ deferred.resolve(results);
+ };
+}
+function getRequestFailedFunction(request) {
+ return function(error) {
+ if (request.state === RequestState_default.CANCELLED) {
+ return;
+ }
+ ++statistics.numberOfFailedRequests;
+ --statistics.numberOfActiveRequests;
+ --numberOfActiveRequestsByServer[request.serverKey];
+ requestCompletedEvent.raiseEvent(error);
+ request.state = RequestState_default.FAILED;
+ request.deferred.reject(error);
+ };
+}
+function startRequest(request) {
+ const promise = issueRequest(request);
+ request.state = RequestState_default.ACTIVE;
+ activeRequests.push(request);
+ ++statistics.numberOfActiveRequests;
+ ++statistics.numberOfActiveRequestsEver;
+ ++numberOfActiveRequestsByServer[request.serverKey];
+ request.requestFunction().then(getRequestReceivedFunction(request)).catch(getRequestFailedFunction(request));
+ return promise;
+}
+function cancelRequest(request) {
+ const active = request.state === RequestState_default.ACTIVE;
+ request.state = RequestState_default.CANCELLED;
+ ++statistics.numberOfCancelledRequests;
+ if (defined_default(request.deferred)) {
+ const deferred = request.deferred;
+ request.deferred = void 0;
+ deferred.reject();
+ }
+ if (active) {
+ --statistics.numberOfActiveRequests;
+ --numberOfActiveRequestsByServer[request.serverKey];
+ ++statistics.numberOfCancelledActiveRequests;
+ }
+ if (defined_default(request.cancelFunction)) {
+ request.cancelFunction();
+ }
+}
+RequestScheduler.update = function() {
+ let i;
+ let request;
+ let removeCount = 0;
+ const activeLength = activeRequests.length;
+ for (i = 0; i < activeLength; ++i) {
+ request = activeRequests[i];
+ if (request.cancelled) {
+ cancelRequest(request);
+ }
+ if (request.state !== RequestState_default.ACTIVE) {
+ ++removeCount;
+ continue;
+ }
+ if (removeCount > 0) {
+ activeRequests[i - removeCount] = request;
+ }
+ }
+ activeRequests.length -= removeCount;
+ const issuedRequests = requestHeap.internalArray;
+ const issuedLength = requestHeap.length;
+ for (i = 0; i < issuedLength; ++i) {
+ updatePriority(issuedRequests[i]);
+ }
+ requestHeap.resort();
+ const openSlots = Math.max(
+ RequestScheduler.maximumRequests - activeRequests.length,
+ 0
+ );
+ let filledSlots = 0;
+ while (filledSlots < openSlots && requestHeap.length > 0) {
+ request = requestHeap.pop();
+ if (request.cancelled) {
+ cancelRequest(request);
+ continue;
+ }
+ if (request.throttleByServer && !RequestScheduler.serverHasOpenSlots(request.serverKey)) {
+ cancelRequest(request);
+ continue;
+ }
+ startRequest(request);
+ ++filledSlots;
+ }
+ updateStatistics();
+};
+RequestScheduler.getServerKey = function(url2) {
+ Check_default.typeOf.string("url", url2);
+ let uri = new import_urijs4.default(url2);
+ if (uri.scheme() === "") {
+ uri = new import_urijs4.default(url2).absoluteTo(pageUri);
+ uri.normalize();
+ }
+ let serverKey = uri.authority();
+ if (!/:/.test(serverKey)) {
+ serverKey = `${serverKey}:${uri.scheme() === "https" ? "443" : "80"}`;
+ }
+ const length3 = numberOfActiveRequestsByServer[serverKey];
+ if (!defined_default(length3)) {
+ numberOfActiveRequestsByServer[serverKey] = 0;
+ }
+ return serverKey;
+};
+RequestScheduler.request = function(request) {
+ Check_default.typeOf.object("request", request);
+ Check_default.typeOf.string("request.url", request.url);
+ Check_default.typeOf.func("request.requestFunction", request.requestFunction);
+ if (isDataUri_default(request.url) || isBlobUri_default(request.url)) {
+ requestCompletedEvent.raiseEvent();
+ request.state = RequestState_default.RECEIVED;
+ return request.requestFunction();
+ }
+ ++statistics.numberOfAttemptedRequests;
+ if (!defined_default(request.serverKey)) {
+ request.serverKey = RequestScheduler.getServerKey(request.url);
+ }
+ if (RequestScheduler.throttleRequests && request.throttleByServer && !RequestScheduler.serverHasOpenSlots(request.serverKey)) {
+ return void 0;
+ }
+ if (!RequestScheduler.throttleRequests || !request.throttle) {
+ return startRequest(request);
+ }
+ if (activeRequests.length >= RequestScheduler.maximumRequests) {
+ return void 0;
+ }
+ updatePriority(request);
+ const removedRequest = requestHeap.insert(request);
+ if (defined_default(removedRequest)) {
+ if (removedRequest === request) {
+ return void 0;
+ }
+ cancelRequest(removedRequest);
+ }
+ return issueRequest(request);
+};
+function updateStatistics() {
+ if (!RequestScheduler.debugShowStatistics) {
+ return;
+ }
+ if (statistics.numberOfActiveRequests === 0 && statistics.lastNumberOfActiveRequests > 0) {
+ if (statistics.numberOfAttemptedRequests > 0) {
+ console.log(
+ `Number of attempted requests: ${statistics.numberOfAttemptedRequests}`
+ );
+ statistics.numberOfAttemptedRequests = 0;
+ }
+ if (statistics.numberOfCancelledRequests > 0) {
+ console.log(
+ `Number of cancelled requests: ${statistics.numberOfCancelledRequests}`
+ );
+ statistics.numberOfCancelledRequests = 0;
+ }
+ if (statistics.numberOfCancelledActiveRequests > 0) {
+ console.log(
+ `Number of cancelled active requests: ${statistics.numberOfCancelledActiveRequests}`
+ );
+ statistics.numberOfCancelledActiveRequests = 0;
+ }
+ if (statistics.numberOfFailedRequests > 0) {
+ console.log(
+ `Number of failed requests: ${statistics.numberOfFailedRequests}`
+ );
+ statistics.numberOfFailedRequests = 0;
+ }
+ }
+ statistics.lastNumberOfActiveRequests = statistics.numberOfActiveRequests;
+}
+RequestScheduler.clearForSpecs = function() {
+ while (requestHeap.length > 0) {
+ const request = requestHeap.pop();
+ cancelRequest(request);
+ }
+ const length3 = activeRequests.length;
+ for (let i = 0; i < length3; ++i) {
+ cancelRequest(activeRequests[i]);
+ }
+ activeRequests.length = 0;
+ numberOfActiveRequestsByServer = {};
+ statistics.numberOfAttemptedRequests = 0;
+ statistics.numberOfActiveRequests = 0;
+ statistics.numberOfCancelledRequests = 0;
+ statistics.numberOfCancelledActiveRequests = 0;
+ statistics.numberOfFailedRequests = 0;
+ statistics.numberOfActiveRequestsEver = 0;
+ statistics.lastNumberOfActiveRequests = 0;
+};
+RequestScheduler.numberOfActiveRequestsByServer = function(serverKey) {
+ return numberOfActiveRequestsByServer[serverKey];
+};
+RequestScheduler.requestHeap = requestHeap;
+var RequestScheduler_default = RequestScheduler;
+
+// Source/Core/TrustedServers.js
+var import_urijs5 = __toESM(require_URI(), 1);
+var TrustedServers = {};
+var _servers = {};
+TrustedServers.add = function(host, port) {
+ if (!defined_default(host)) {
+ throw new DeveloperError_default("host is required.");
+ }
+ if (!defined_default(port) || port <= 0) {
+ throw new DeveloperError_default("port is required to be greater than 0.");
+ }
+ const authority = `${host.toLowerCase()}:${port}`;
+ if (!defined_default(_servers[authority])) {
+ _servers[authority] = true;
+ }
+};
+TrustedServers.remove = function(host, port) {
+ if (!defined_default(host)) {
+ throw new DeveloperError_default("host is required.");
+ }
+ if (!defined_default(port) || port <= 0) {
+ throw new DeveloperError_default("port is required to be greater than 0.");
+ }
+ const authority = `${host.toLowerCase()}:${port}`;
+ if (defined_default(_servers[authority])) {
+ delete _servers[authority];
+ }
+};
+function getAuthority(url2) {
+ const uri = new import_urijs5.default(url2);
+ uri.normalize();
+ let authority = uri.authority();
+ if (authority.length === 0) {
+ return void 0;
+ }
+ uri.authority(authority);
+ if (authority.indexOf("@") !== -1) {
+ const parts = authority.split("@");
+ authority = parts[1];
+ }
+ if (authority.indexOf(":") === -1) {
+ let scheme = uri.scheme();
+ if (scheme.length === 0) {
+ scheme = window.location.protocol;
+ scheme = scheme.substring(0, scheme.length - 1);
+ }
+ if (scheme === "http") {
+ authority += ":80";
+ } else if (scheme === "https") {
+ authority += ":443";
+ } else {
+ return void 0;
+ }
+ }
+ return authority;
+}
+TrustedServers.contains = function(url2) {
+ if (!defined_default(url2)) {
+ throw new DeveloperError_default("url is required.");
+ }
+ const authority = getAuthority(url2);
+ if (defined_default(authority) && defined_default(_servers[authority])) {
+ return true;
+ }
+ return false;
+};
+TrustedServers.clear = function() {
+ _servers = {};
+};
+var TrustedServers_default = TrustedServers;
+
+// Source/Core/Resource.js
+var xhrBlobSupported = function() {
+ try {
+ const xhr = new XMLHttpRequest();
+ xhr.open("GET", "#", true);
+ xhr.responseType = "blob";
+ return xhr.responseType === "blob";
+ } catch (e) {
+ return false;
+ }
+}();
+function parseQuery(uri, resource, merge2, preserveQueryParameters) {
+ const queryString = uri.query();
+ if (queryString.length === 0) {
+ return {};
+ }
+ let query;
+ if (queryString.indexOf("=") === -1) {
+ const result = {};
+ result[queryString] = void 0;
+ query = result;
+ } else {
+ query = queryToObject_default(queryString);
+ }
+ if (merge2) {
+ resource._queryParameters = combineQueryParameters(
+ query,
+ resource._queryParameters,
+ preserveQueryParameters
+ );
+ } else {
+ resource._queryParameters = query;
+ }
+ uri.search("");
+}
+function stringifyQuery(uri, resource) {
+ const queryObject = resource._queryParameters;
+ const keys = Object.keys(queryObject);
+ if (keys.length === 1 && !defined_default(queryObject[keys[0]])) {
+ uri.search(keys[0]);
+ } else {
+ uri.search(objectToQuery_default(queryObject));
+ }
+}
+function defaultClone(val, defaultVal) {
+ if (!defined_default(val)) {
+ return defaultVal;
+ }
+ return defined_default(val.clone) ? val.clone() : clone_default(val);
+}
+function checkAndResetRequest(request) {
+ if (request.state === RequestState_default.ISSUED || request.state === RequestState_default.ACTIVE) {
+ throw new RuntimeError_default("The Resource is already being fetched.");
+ }
+ request.state = RequestState_default.UNISSUED;
+ request.deferred = void 0;
+}
+function combineQueryParameters(q12, q22, preserveQueryParameters) {
+ if (!preserveQueryParameters) {
+ return combine_default(q12, q22);
+ }
+ const result = clone_default(q12, true);
+ for (const param in q22) {
+ if (q22.hasOwnProperty(param)) {
+ let value = result[param];
+ const q2Value = q22[param];
+ if (defined_default(value)) {
+ if (!Array.isArray(value)) {
+ value = result[param] = [value];
+ }
+ result[param] = value.concat(q2Value);
+ } else {
+ result[param] = Array.isArray(q2Value) ? q2Value.slice() : q2Value;
+ }
+ }
+ }
+ return result;
+}
+function Resource(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ if (typeof options === "string") {
+ options = {
+ url: options
+ };
+ }
+ Check_default.typeOf.string("options.url", options.url);
+ this._url = void 0;
+ this._templateValues = defaultClone(options.templateValues, {});
+ this._queryParameters = defaultClone(options.queryParameters, {});
+ this.headers = defaultClone(options.headers, {});
+ this.request = defaultValue_default(options.request, new Request_default());
+ this.proxy = options.proxy;
+ this.retryCallback = options.retryCallback;
+ this.retryAttempts = defaultValue_default(options.retryAttempts, 0);
+ this._retryCount = 0;
+ const uri = new import_urijs6.default(options.url);
+ parseQuery(uri, this, true, true);
+ uri.fragment("");
+ this._url = uri.toString();
+}
+Resource.createIfNeeded = function(resource) {
+ if (resource instanceof Resource) {
+ return resource.getDerivedResource({
+ request: resource.request
+ });
+ }
+ if (typeof resource !== "string") {
+ return resource;
+ }
+ return new Resource({
+ url: resource
+ });
+};
+var supportsImageBitmapOptionsPromise;
+Resource.supportsImageBitmapOptions = function() {
+ if (defined_default(supportsImageBitmapOptionsPromise)) {
+ return supportsImageBitmapOptionsPromise;
+ }
+ if (typeof createImageBitmap !== "function") {
+ supportsImageBitmapOptionsPromise = Promise.resolve(false);
+ return supportsImageBitmapOptionsPromise;
+ }
+ const imageDataUri = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC";
+ supportsImageBitmapOptionsPromise = Resource.fetchBlob({
+ url: imageDataUri
+ }).then(function(blob) {
+ const imageBitmapOptions = {
+ imageOrientation: "flipY",
+ premultiplyAlpha: "none",
+ colorSpaceConversion: "none"
+ };
+ return Promise.all([
+ createImageBitmap(blob, imageBitmapOptions),
+ createImageBitmap(blob)
+ ]);
+ }).then(function(imageBitmaps) {
+ const colorWithOptions = getImagePixels_default(imageBitmaps[0]);
+ const colorWithDefaults = getImagePixels_default(imageBitmaps[1]);
+ return colorWithOptions[1] !== colorWithDefaults[1];
+ }).catch(function() {
+ return false;
+ });
+ return supportsImageBitmapOptionsPromise;
+};
+Object.defineProperties(Resource, {
+ isBlobSupported: {
+ get: function() {
+ return xhrBlobSupported;
+ }
+ }
+});
+Object.defineProperties(Resource.prototype, {
+ queryParameters: {
+ get: function() {
+ return this._queryParameters;
+ }
+ },
+ templateValues: {
+ get: function() {
+ return this._templateValues;
+ }
+ },
+ url: {
+ get: function() {
+ return this.getUrlComponent(true, true);
+ },
+ set: function(value) {
+ const uri = new import_urijs6.default(value);
+ parseQuery(uri, this, false);
+ uri.fragment("");
+ this._url = uri.toString();
+ }
+ },
+ extension: {
+ get: function() {
+ return getExtensionFromUri_default(this._url);
+ }
+ },
+ isDataUri: {
+ get: function() {
+ return isDataUri_default(this._url);
+ }
+ },
+ isBlobUri: {
+ get: function() {
+ return isBlobUri_default(this._url);
+ }
+ },
+ isCrossOriginUrl: {
+ get: function() {
+ return isCrossOriginUrl_default(this._url);
+ }
+ },
+ hasHeaders: {
+ get: function() {
+ return Object.keys(this.headers).length > 0;
+ }
+ }
+});
+Resource.prototype.toString = function() {
+ return this.getUrlComponent(true, true);
+};
+Resource.prototype.getUrlComponent = function(query, proxy) {
+ if (this.isDataUri) {
+ return this._url;
+ }
+ const uri = new import_urijs6.default(this._url);
+ if (query) {
+ stringifyQuery(uri, this);
+ }
+ let url2 = uri.toString().replace(/%7B/g, "{").replace(/%7D/g, "}");
+ const templateValues = this._templateValues;
+ url2 = url2.replace(/{(.*?)}/g, function(match, key) {
+ const replacement = templateValues[key];
+ if (defined_default(replacement)) {
+ return encodeURIComponent(replacement);
+ }
+ return match;
+ });
+ if (proxy && defined_default(this.proxy)) {
+ url2 = this.proxy.getURL(url2);
+ }
+ return url2;
+};
+Resource.prototype.setQueryParameters = function(params, useAsDefault) {
+ if (useAsDefault) {
+ this._queryParameters = combineQueryParameters(
+ this._queryParameters,
+ params,
+ false
+ );
+ } else {
+ this._queryParameters = combineQueryParameters(
+ params,
+ this._queryParameters,
+ false
+ );
+ }
+};
+Resource.prototype.appendQueryParameters = function(params) {
+ this._queryParameters = combineQueryParameters(
+ params,
+ this._queryParameters,
+ true
+ );
+};
+Resource.prototype.setTemplateValues = function(template, useAsDefault) {
+ if (useAsDefault) {
+ this._templateValues = combine_default(this._templateValues, template);
+ } else {
+ this._templateValues = combine_default(template, this._templateValues);
+ }
+};
+Resource.prototype.getDerivedResource = function(options) {
+ const resource = this.clone();
+ resource._retryCount = 0;
+ if (defined_default(options.url)) {
+ const uri = new import_urijs6.default(options.url);
+ const preserveQueryParameters = defaultValue_default(
+ options.preserveQueryParameters,
+ false
+ );
+ parseQuery(uri, resource, true, preserveQueryParameters);
+ uri.fragment("");
+ if (uri.scheme() !== "") {
+ resource._url = uri.toString();
+ } else {
+ resource._url = uri.absoluteTo(new import_urijs6.default(getAbsoluteUri_default(this._url))).toString();
+ }
+ }
+ if (defined_default(options.queryParameters)) {
+ resource._queryParameters = combine_default(
+ options.queryParameters,
+ resource._queryParameters
+ );
+ }
+ if (defined_default(options.templateValues)) {
+ resource._templateValues = combine_default(
+ options.templateValues,
+ resource.templateValues
+ );
+ }
+ if (defined_default(options.headers)) {
+ resource.headers = combine_default(options.headers, resource.headers);
+ }
+ if (defined_default(options.proxy)) {
+ resource.proxy = options.proxy;
+ }
+ if (defined_default(options.request)) {
+ resource.request = options.request;
+ }
+ if (defined_default(options.retryCallback)) {
+ resource.retryCallback = options.retryCallback;
+ }
+ if (defined_default(options.retryAttempts)) {
+ resource.retryAttempts = options.retryAttempts;
+ }
+ return resource;
+};
+Resource.prototype.retryOnError = function(error) {
+ const retryCallback2 = this.retryCallback;
+ if (typeof retryCallback2 !== "function" || this._retryCount >= this.retryAttempts) {
+ return Promise.resolve(false);
+ }
+ const that = this;
+ return Promise.resolve(retryCallback2(this, error)).then(function(result) {
+ ++that._retryCount;
+ return result;
+ });
+};
+Resource.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ result = new Resource({
+ url: this._url
+ });
+ }
+ result._url = this._url;
+ result._queryParameters = clone_default(this._queryParameters);
+ result._templateValues = clone_default(this._templateValues);
+ result.headers = clone_default(this.headers);
+ result.proxy = this.proxy;
+ result.retryCallback = this.retryCallback;
+ result.retryAttempts = this.retryAttempts;
+ result._retryCount = 0;
+ result.request = this.request.clone();
+ return result;
+};
+Resource.prototype.getBaseUri = function(includeQuery) {
+ return getBaseUri_default(this.getUrlComponent(includeQuery), includeQuery);
+};
+Resource.prototype.appendForwardSlash = function() {
+ this._url = appendForwardSlash_default(this._url);
+};
+Resource.prototype.fetchArrayBuffer = function() {
+ return this.fetch({
+ responseType: "arraybuffer"
+ });
+};
+Resource.fetchArrayBuffer = function(options) {
+ const resource = new Resource(options);
+ return resource.fetchArrayBuffer();
+};
+Resource.prototype.fetchBlob = function() {
+ return this.fetch({
+ responseType: "blob"
+ });
+};
+Resource.fetchBlob = function(options) {
+ const resource = new Resource(options);
+ return resource.fetchBlob();
+};
+Resource.prototype.fetchImage = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const preferImageBitmap = defaultValue_default(options.preferImageBitmap, false);
+ const preferBlob = defaultValue_default(options.preferBlob, false);
+ const flipY = defaultValue_default(options.flipY, false);
+ const skipColorSpaceConversion = defaultValue_default(
+ options.skipColorSpaceConversion,
+ false
+ );
+ checkAndResetRequest(this.request);
+ if (!xhrBlobSupported || this.isDataUri || this.isBlobUri || !this.hasHeaders && !preferBlob) {
+ return fetchImage({
+ resource: this,
+ flipY,
+ skipColorSpaceConversion,
+ preferImageBitmap
+ });
+ }
+ const blobPromise = this.fetchBlob();
+ if (!defined_default(blobPromise)) {
+ return;
+ }
+ let supportsImageBitmap;
+ let useImageBitmap;
+ let generatedBlobResource;
+ let generatedBlob;
+ return Resource.supportsImageBitmapOptions().then(function(result) {
+ supportsImageBitmap = result;
+ useImageBitmap = supportsImageBitmap && preferImageBitmap;
+ return blobPromise;
+ }).then(function(blob) {
+ if (!defined_default(blob)) {
+ return;
+ }
+ generatedBlob = blob;
+ if (useImageBitmap) {
+ return Resource.createImageBitmapFromBlob(blob, {
+ flipY,
+ premultiplyAlpha: false,
+ skipColorSpaceConversion
+ });
+ }
+ const blobUrl = window.URL.createObjectURL(blob);
+ generatedBlobResource = new Resource({
+ url: blobUrl
+ });
+ return fetchImage({
+ resource: generatedBlobResource,
+ flipY,
+ skipColorSpaceConversion,
+ preferImageBitmap: false
+ });
+ }).then(function(image) {
+ if (!defined_default(image)) {
+ return;
+ }
+ image.blob = generatedBlob;
+ if (useImageBitmap) {
+ return image;
+ }
+ window.URL.revokeObjectURL(generatedBlobResource.url);
+ return image;
+ }).catch(function(error) {
+ if (defined_default(generatedBlobResource)) {
+ window.URL.revokeObjectURL(generatedBlobResource.url);
+ }
+ error.blob = generatedBlob;
+ return Promise.reject(error);
+ });
+};
+function fetchImage(options) {
+ const resource = options.resource;
+ const flipY = options.flipY;
+ const skipColorSpaceConversion = options.skipColorSpaceConversion;
+ const preferImageBitmap = options.preferImageBitmap;
+ const request = resource.request;
+ request.url = resource.url;
+ request.requestFunction = function() {
+ let crossOrigin = false;
+ if (!resource.isDataUri && !resource.isBlobUri) {
+ crossOrigin = resource.isCrossOriginUrl;
+ }
+ const deferred = defer_default();
+ Resource._Implementations.createImage(
+ request,
+ crossOrigin,
+ deferred,
+ flipY,
+ skipColorSpaceConversion,
+ preferImageBitmap
+ );
+ return deferred.promise;
+ };
+ const promise = RequestScheduler_default.request(request);
+ if (!defined_default(promise)) {
+ return;
+ }
+ return promise.catch(function(e) {
+ if (request.state !== RequestState_default.FAILED) {
+ return Promise.reject(e);
+ }
+ return resource.retryOnError(e).then(function(retry) {
+ if (retry) {
+ request.state = RequestState_default.UNISSUED;
+ request.deferred = void 0;
+ return fetchImage({
+ resource,
+ flipY,
+ skipColorSpaceConversion,
+ preferImageBitmap
+ });
+ }
+ return Promise.reject(e);
+ });
+ });
+}
+Resource.fetchImage = function(options) {
+ const resource = new Resource(options);
+ return resource.fetchImage({
+ flipY: options.flipY,
+ skipColorSpaceConversion: options.skipColorSpaceConversion,
+ preferBlob: options.preferBlob,
+ preferImageBitmap: options.preferImageBitmap
+ });
+};
+Resource.prototype.fetchText = function() {
+ return this.fetch({
+ responseType: "text"
+ });
+};
+Resource.fetchText = function(options) {
+ const resource = new Resource(options);
+ return resource.fetchText();
+};
+Resource.prototype.fetchJson = function() {
+ const promise = this.fetch({
+ responseType: "text",
+ headers: {
+ Accept: "application/json,*/*;q=0.01"
+ }
+ });
+ if (!defined_default(promise)) {
+ return void 0;
+ }
+ return promise.then(function(value) {
+ if (!defined_default(value)) {
+ return;
+ }
+ return JSON.parse(value);
+ });
+};
+Resource.fetchJson = function(options) {
+ const resource = new Resource(options);
+ return resource.fetchJson();
+};
+Resource.prototype.fetchXML = function() {
+ return this.fetch({
+ responseType: "document",
+ overrideMimeType: "text/xml"
+ });
+};
+Resource.fetchXML = function(options) {
+ const resource = new Resource(options);
+ return resource.fetchXML();
+};
+Resource.prototype.fetchJsonp = function(callbackParameterName) {
+ callbackParameterName = defaultValue_default(callbackParameterName, "callback");
+ checkAndResetRequest(this.request);
+ let functionName;
+ do {
+ functionName = `loadJsonp${Math_default.nextRandomNumber().toString().substring(2, 8)}`;
+ } while (defined_default(window[functionName]));
+ return fetchJsonp(this, callbackParameterName, functionName);
+};
+function fetchJsonp(resource, callbackParameterName, functionName) {
+ const callbackQuery = {};
+ callbackQuery[callbackParameterName] = functionName;
+ resource.setQueryParameters(callbackQuery);
+ const request = resource.request;
+ request.url = resource.url;
+ request.requestFunction = function() {
+ const deferred = defer_default();
+ window[functionName] = function(data) {
+ deferred.resolve(data);
+ try {
+ delete window[functionName];
+ } catch (e) {
+ window[functionName] = void 0;
+ }
+ };
+ Resource._Implementations.loadAndExecuteScript(
+ resource.url,
+ functionName,
+ deferred
+ );
+ return deferred.promise;
+ };
+ const promise = RequestScheduler_default.request(request);
+ if (!defined_default(promise)) {
+ return;
+ }
+ return promise.catch(function(e) {
+ if (request.state !== RequestState_default.FAILED) {
+ return Promise.reject(e);
+ }
+ return resource.retryOnError(e).then(function(retry) {
+ if (retry) {
+ request.state = RequestState_default.UNISSUED;
+ request.deferred = void 0;
+ return fetchJsonp(resource, callbackParameterName, functionName);
+ }
+ return Promise.reject(e);
+ });
+ });
+}
+Resource.fetchJsonp = function(options) {
+ const resource = new Resource(options);
+ return resource.fetchJsonp(options.callbackParameterName);
+};
+Resource.prototype._makeRequest = function(options) {
+ const resource = this;
+ checkAndResetRequest(resource.request);
+ const request = resource.request;
+ request.url = resource.url;
+ request.requestFunction = function() {
+ const responseType = options.responseType;
+ const headers = combine_default(options.headers, resource.headers);
+ const overrideMimeType = options.overrideMimeType;
+ const method = options.method;
+ const data = options.data;
+ const deferred = defer_default();
+ const xhr = Resource._Implementations.loadWithXhr(
+ resource.url,
+ responseType,
+ method,
+ data,
+ headers,
+ deferred,
+ overrideMimeType
+ );
+ if (defined_default(xhr) && defined_default(xhr.abort)) {
+ request.cancelFunction = function() {
+ xhr.abort();
+ };
+ }
+ return deferred.promise;
+ };
+ const promise = RequestScheduler_default.request(request);
+ if (!defined_default(promise)) {
+ return;
+ }
+ return promise.then(function(data) {
+ request.cancelFunction = void 0;
+ return data;
+ }).catch(function(e) {
+ request.cancelFunction = void 0;
+ if (request.state !== RequestState_default.FAILED) {
+ return Promise.reject(e);
+ }
+ return resource.retryOnError(e).then(function(retry) {
+ if (retry) {
+ request.state = RequestState_default.UNISSUED;
+ request.deferred = void 0;
+ return resource.fetch(options);
+ }
+ return Promise.reject(e);
+ });
+ });
+};
+var dataUriRegex2 = /^data:(.*?)(;base64)?,(.*)$/;
+function decodeDataUriText(isBase64, data) {
+ const result = decodeURIComponent(data);
+ if (isBase64) {
+ return atob(result);
+ }
+ return result;
+}
+function decodeDataUriArrayBuffer(isBase64, data) {
+ const byteString = decodeDataUriText(isBase64, data);
+ const buffer = new ArrayBuffer(byteString.length);
+ const view = new Uint8Array(buffer);
+ for (let i = 0; i < byteString.length; i++) {
+ view[i] = byteString.charCodeAt(i);
+ }
+ return buffer;
+}
+function decodeDataUri(dataUriRegexResult, responseType) {
+ responseType = defaultValue_default(responseType, "");
+ const mimeType = dataUriRegexResult[1];
+ const isBase64 = !!dataUriRegexResult[2];
+ const data = dataUriRegexResult[3];
+ let buffer;
+ let parser3;
+ switch (responseType) {
+ case "":
+ case "text":
+ return decodeDataUriText(isBase64, data);
+ case "arraybuffer":
+ return decodeDataUriArrayBuffer(isBase64, data);
+ case "blob":
+ buffer = decodeDataUriArrayBuffer(isBase64, data);
+ return new Blob([buffer], {
+ type: mimeType
+ });
+ case "document":
+ parser3 = new DOMParser();
+ return parser3.parseFromString(
+ decodeDataUriText(isBase64, data),
+ mimeType
+ );
+ case "json":
+ return JSON.parse(decodeDataUriText(isBase64, data));
+ default:
+ throw new DeveloperError_default(`Unhandled responseType: ${responseType}`);
+ }
+}
+Resource.prototype.fetch = function(options) {
+ options = defaultClone(options, {});
+ options.method = "GET";
+ return this._makeRequest(options);
+};
+Resource.fetch = function(options) {
+ const resource = new Resource(options);
+ return resource.fetch({
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType
+ });
+};
+Resource.prototype.delete = function(options) {
+ options = defaultClone(options, {});
+ options.method = "DELETE";
+ return this._makeRequest(options);
+};
+Resource.delete = function(options) {
+ const resource = new Resource(options);
+ return resource.delete({
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType,
+ data: options.data
+ });
+};
+Resource.prototype.head = function(options) {
+ options = defaultClone(options, {});
+ options.method = "HEAD";
+ return this._makeRequest(options);
+};
+Resource.head = function(options) {
+ const resource = new Resource(options);
+ return resource.head({
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType
+ });
+};
+Resource.prototype.options = function(options) {
+ options = defaultClone(options, {});
+ options.method = "OPTIONS";
+ return this._makeRequest(options);
+};
+Resource.options = function(options) {
+ const resource = new Resource(options);
+ return resource.options({
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType
+ });
+};
+Resource.prototype.post = function(data, options) {
+ Check_default.defined("data", data);
+ options = defaultClone(options, {});
+ options.method = "POST";
+ options.data = data;
+ return this._makeRequest(options);
+};
+Resource.post = function(options) {
+ const resource = new Resource(options);
+ return resource.post(options.data, {
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType
+ });
+};
+Resource.prototype.put = function(data, options) {
+ Check_default.defined("data", data);
+ options = defaultClone(options, {});
+ options.method = "PUT";
+ options.data = data;
+ return this._makeRequest(options);
+};
+Resource.put = function(options) {
+ const resource = new Resource(options);
+ return resource.put(options.data, {
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType
+ });
+};
+Resource.prototype.patch = function(data, options) {
+ Check_default.defined("data", data);
+ options = defaultClone(options, {});
+ options.method = "PATCH";
+ options.data = data;
+ return this._makeRequest(options);
+};
+Resource.patch = function(options) {
+ const resource = new Resource(options);
+ return resource.patch(options.data, {
+ responseType: options.responseType,
+ overrideMimeType: options.overrideMimeType
+ });
+};
+Resource._Implementations = {};
+Resource._Implementations.loadImageElement = function(url2, crossOrigin, deferred) {
+ const image = new Image();
+ image.onload = function() {
+ if (image.naturalWidth === 0 && image.naturalHeight === 0 && image.width === 0 && image.height === 0) {
+ image.width = 300;
+ image.height = 150;
+ }
+ deferred.resolve(image);
+ };
+ image.onerror = function(e) {
+ deferred.reject(e);
+ };
+ if (crossOrigin) {
+ if (TrustedServers_default.contains(url2)) {
+ image.crossOrigin = "use-credentials";
+ } else {
+ image.crossOrigin = "";
+ }
+ }
+ image.src = url2;
+};
+Resource._Implementations.createImage = function(request, crossOrigin, deferred, flipY, skipColorSpaceConversion, preferImageBitmap) {
+ const url2 = request.url;
+ Resource.supportsImageBitmapOptions().then(function(supportsImageBitmap) {
+ if (!(supportsImageBitmap && preferImageBitmap)) {
+ Resource._Implementations.loadImageElement(url2, crossOrigin, deferred);
+ return;
+ }
+ const responseType = "blob";
+ const method = "GET";
+ const xhrDeferred = defer_default();
+ const xhr = Resource._Implementations.loadWithXhr(
+ url2,
+ responseType,
+ method,
+ void 0,
+ void 0,
+ xhrDeferred,
+ void 0,
+ void 0,
+ void 0
+ );
+ if (defined_default(xhr) && defined_default(xhr.abort)) {
+ request.cancelFunction = function() {
+ xhr.abort();
+ };
+ }
+ return xhrDeferred.promise.then(function(blob) {
+ if (!defined_default(blob)) {
+ deferred.reject(
+ new RuntimeError_default(
+ `Successfully retrieved ${url2} but it contained no content.`
+ )
+ );
+ return;
+ }
+ return Resource.createImageBitmapFromBlob(blob, {
+ flipY,
+ premultiplyAlpha: false,
+ skipColorSpaceConversion
+ });
+ }).then(function(image) {
+ deferred.resolve(image);
+ });
+ }).catch(function(e) {
+ deferred.reject(e);
+ });
+};
+Resource.createImageBitmapFromBlob = function(blob, options) {
+ Check_default.defined("options", options);
+ Check_default.typeOf.bool("options.flipY", options.flipY);
+ Check_default.typeOf.bool("options.premultiplyAlpha", options.premultiplyAlpha);
+ Check_default.typeOf.bool(
+ "options.skipColorSpaceConversion",
+ options.skipColorSpaceConversion
+ );
+ return createImageBitmap(blob, {
+ imageOrientation: options.flipY ? "flipY" : "none",
+ premultiplyAlpha: options.premultiplyAlpha ? "premultiply" : "none",
+ colorSpaceConversion: options.skipColorSpaceConversion ? "none" : "default"
+ });
+};
+function decodeResponse(loadWithHttpResponse, responseType) {
+ switch (responseType) {
+ case "text":
+ return loadWithHttpResponse.toString("utf8");
+ case "json":
+ return JSON.parse(loadWithHttpResponse.toString("utf8"));
+ default:
+ return new Uint8Array(loadWithHttpResponse).buffer;
+ }
+}
+function loadWithHttpRequest(url2, responseType, method, data, headers, deferred, overrideMimeType) {
+ let URL2;
+ let zlib;
+ Promise.all([import("url"), import("zlib")]).then(([urlImport, zlibImport]) => {
+ URL2 = urlImport.parse(url2);
+ zlib = zlibImport;
+ return URL2.protocol === "https:" ? import("https") : import("http");
+ }).then((http) => {
+ const options = {
+ protocol: URL2.protocol,
+ hostname: URL2.hostname,
+ port: URL2.port,
+ path: URL2.path,
+ query: URL2.query,
+ method,
+ headers
+ };
+ http.request(options).on("response", function(res) {
+ if (res.statusCode < 200 || res.statusCode >= 300) {
+ deferred.reject(
+ new RequestErrorEvent_default(res.statusCode, res, res.headers)
+ );
+ return;
+ }
+ const chunkArray = [];
+ res.on("data", function(chunk) {
+ chunkArray.push(chunk);
+ });
+ res.on("end", function() {
+ const result = Buffer.concat(chunkArray);
+ if (res.headers["content-encoding"] === "gzip") {
+ zlib.gunzip(result, function(error, resultUnzipped) {
+ if (error) {
+ deferred.reject(
+ new RuntimeError_default("Error decompressing response.")
+ );
+ } else {
+ deferred.resolve(
+ decodeResponse(resultUnzipped, responseType)
+ );
+ }
+ });
+ } else {
+ deferred.resolve(decodeResponse(result, responseType));
+ }
+ });
+ }).on("error", function(e) {
+ deferred.reject(new RequestErrorEvent_default());
+ }).end();
+ });
+}
+var noXMLHttpRequest = typeof XMLHttpRequest === "undefined";
+Resource._Implementations.loadWithXhr = function(url2, responseType, method, data, headers, deferred, overrideMimeType) {
+ const dataUriRegexResult = dataUriRegex2.exec(url2);
+ if (dataUriRegexResult !== null) {
+ deferred.resolve(decodeDataUri(dataUriRegexResult, responseType));
+ return;
+ }
+ if (noXMLHttpRequest) {
+ loadWithHttpRequest(
+ url2,
+ responseType,
+ method,
+ data,
+ headers,
+ deferred,
+ overrideMimeType
+ );
+ return;
+ }
+ const xhr = new XMLHttpRequest();
+ if (TrustedServers_default.contains(url2)) {
+ xhr.withCredentials = true;
+ }
+ xhr.open(method, url2, true);
+ if (defined_default(overrideMimeType) && defined_default(xhr.overrideMimeType)) {
+ xhr.overrideMimeType(overrideMimeType);
+ }
+ if (defined_default(headers)) {
+ for (const key in headers) {
+ if (headers.hasOwnProperty(key)) {
+ xhr.setRequestHeader(key, headers[key]);
+ }
+ }
+ }
+ if (defined_default(responseType)) {
+ xhr.responseType = responseType;
+ }
+ let localFile = false;
+ if (typeof url2 === "string") {
+ localFile = url2.indexOf("file://") === 0 || typeof window !== "undefined" && window.location.origin === "file://";
+ }
+ xhr.onload = function() {
+ if ((xhr.status < 200 || xhr.status >= 300) && !(localFile && xhr.status === 0)) {
+ deferred.reject(
+ new RequestErrorEvent_default(
+ xhr.status,
+ xhr.response,
+ xhr.getAllResponseHeaders()
+ )
+ );
+ return;
+ }
+ const response = xhr.response;
+ const browserResponseType = xhr.responseType;
+ if (method === "HEAD" || method === "OPTIONS") {
+ const responseHeaderString = xhr.getAllResponseHeaders();
+ const splitHeaders = responseHeaderString.trim().split(/[\r\n]+/);
+ const responseHeaders = {};
+ splitHeaders.forEach(function(line) {
+ const parts = line.split(": ");
+ const header = parts.shift();
+ responseHeaders[header] = parts.join(": ");
+ });
+ deferred.resolve(responseHeaders);
+ return;
+ }
+ if (xhr.status === 204) {
+ deferred.resolve();
+ } else if (defined_default(response) && (!defined_default(responseType) || browserResponseType === responseType)) {
+ deferred.resolve(response);
+ } else if (responseType === "json" && typeof response === "string") {
+ try {
+ deferred.resolve(JSON.parse(response));
+ } catch (e) {
+ deferred.reject(e);
+ }
+ } else if ((browserResponseType === "" || browserResponseType === "document") && defined_default(xhr.responseXML) && xhr.responseXML.hasChildNodes()) {
+ deferred.resolve(xhr.responseXML);
+ } else if ((browserResponseType === "" || browserResponseType === "text") && defined_default(xhr.responseText)) {
+ deferred.resolve(xhr.responseText);
+ } else {
+ deferred.reject(
+ new RuntimeError_default("Invalid XMLHttpRequest response type.")
+ );
+ }
+ };
+ xhr.onerror = function(e) {
+ deferred.reject(new RequestErrorEvent_default());
+ };
+ xhr.send(data);
+ return xhr;
+};
+Resource._Implementations.loadAndExecuteScript = function(url2, functionName, deferred) {
+ return loadAndExecuteScript_default(url2, functionName).catch(function(e) {
+ deferred.reject(e);
+ });
+};
+Resource._DefaultImplementations = {};
+Resource._DefaultImplementations.createImage = Resource._Implementations.createImage;
+Resource._DefaultImplementations.loadWithXhr = Resource._Implementations.loadWithXhr;
+Resource._DefaultImplementations.loadAndExecuteScript = Resource._Implementations.loadAndExecuteScript;
+Resource.DEFAULT = Object.freeze(
+ new Resource({
+ url: typeof document === "undefined" ? "" : document.location.href.split("?")[0]
+ })
+);
+var Resource_default = Resource;
+
+// Source/Core/EarthOrientationParameters.js
+function EarthOrientationParameters(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._dates = void 0;
+ this._samples = void 0;
+ this._dateColumn = -1;
+ this._xPoleWanderRadiansColumn = -1;
+ this._yPoleWanderRadiansColumn = -1;
+ this._ut1MinusUtcSecondsColumn = -1;
+ this._xCelestialPoleOffsetRadiansColumn = -1;
+ this._yCelestialPoleOffsetRadiansColumn = -1;
+ this._taiMinusUtcSecondsColumn = -1;
+ this._columnCount = 0;
+ this._lastIndex = -1;
+ this._downloadPromise = void 0;
+ this._dataError = void 0;
+ this._addNewLeapSeconds = defaultValue_default(options.addNewLeapSeconds, true);
+ if (defined_default(options.data)) {
+ onDataReady(this, options.data);
+ } else if (defined_default(options.url)) {
+ const resource = Resource_default.createIfNeeded(options.url);
+ const that = this;
+ this._downloadPromise = resource.fetchJson().then(function(eopData) {
+ onDataReady(that, eopData);
+ }).catch(function() {
+ that._dataError = `An error occurred while retrieving the EOP data from the URL ${resource.url}.`;
+ });
+ } else {
+ onDataReady(this, {
+ columnNames: [
+ "dateIso8601",
+ "modifiedJulianDateUtc",
+ "xPoleWanderRadians",
+ "yPoleWanderRadians",
+ "ut1MinusUtcSeconds",
+ "lengthOfDayCorrectionSeconds",
+ "xCelestialPoleOffsetRadians",
+ "yCelestialPoleOffsetRadians",
+ "taiMinusUtcSeconds"
+ ],
+ samples: []
+ });
+ }
+}
+EarthOrientationParameters.NONE = Object.freeze({
+ getPromiseToLoad: function() {
+ return Promise.resolve();
+ },
+ compute: function(date, result) {
+ if (!defined_default(result)) {
+ result = new EarthOrientationParametersSample_default(0, 0, 0, 0, 0);
+ } else {
+ result.xPoleWander = 0;
+ result.yPoleWander = 0;
+ result.xPoleOffset = 0;
+ result.yPoleOffset = 0;
+ result.ut1MinusUtc = 0;
+ }
+ return result;
+ }
+});
+EarthOrientationParameters.prototype.getPromiseToLoad = function() {
+ return Promise.resolve(this._downloadPromise);
+};
+EarthOrientationParameters.prototype.compute = function(date, result) {
+ if (!defined_default(this._samples)) {
+ if (defined_default(this._dataError)) {
+ throw new RuntimeError_default(this._dataError);
+ }
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ result = new EarthOrientationParametersSample_default(0, 0, 0, 0, 0);
+ }
+ if (this._samples.length === 0) {
+ result.xPoleWander = 0;
+ result.yPoleWander = 0;
+ result.xPoleOffset = 0;
+ result.yPoleOffset = 0;
+ result.ut1MinusUtc = 0;
+ return result;
+ }
+ const dates = this._dates;
+ const lastIndex = this._lastIndex;
+ let before = 0;
+ let after = 0;
+ if (defined_default(lastIndex)) {
+ const previousIndexDate = dates[lastIndex];
+ const nextIndexDate = dates[lastIndex + 1];
+ const isAfterPrevious = JulianDate_default.lessThanOrEquals(
+ previousIndexDate,
+ date
+ );
+ const isAfterLastSample = !defined_default(nextIndexDate);
+ const isBeforeNext = isAfterLastSample || JulianDate_default.greaterThanOrEquals(nextIndexDate, date);
+ if (isAfterPrevious && isBeforeNext) {
+ before = lastIndex;
+ if (!isAfterLastSample && nextIndexDate.equals(date)) {
+ ++before;
+ }
+ after = before + 1;
+ interpolate(this, dates, this._samples, date, before, after, result);
+ return result;
+ }
+ }
+ let index = binarySearch_default(dates, date, JulianDate_default.compare, this._dateColumn);
+ if (index >= 0) {
+ if (index < dates.length - 1 && dates[index + 1].equals(date)) {
+ ++index;
+ }
+ before = index;
+ after = index;
+ } else {
+ after = ~index;
+ before = after - 1;
+ if (before < 0) {
+ before = 0;
+ }
+ }
+ this._lastIndex = before;
+ interpolate(this, dates, this._samples, date, before, after, result);
+ return result;
+};
+function compareLeapSecondDates2(leapSecond, dateToFind) {
+ return JulianDate_default.compare(leapSecond.julianDate, dateToFind);
+}
+function onDataReady(eop, eopData) {
+ if (!defined_default(eopData.columnNames)) {
+ eop._dataError = "Error in loaded EOP data: The columnNames property is required.";
+ return;
+ }
+ if (!defined_default(eopData.samples)) {
+ eop._dataError = "Error in loaded EOP data: The samples property is required.";
+ return;
+ }
+ const dateColumn = eopData.columnNames.indexOf("modifiedJulianDateUtc");
+ const xPoleWanderRadiansColumn = eopData.columnNames.indexOf(
+ "xPoleWanderRadians"
+ );
+ const yPoleWanderRadiansColumn = eopData.columnNames.indexOf(
+ "yPoleWanderRadians"
+ );
+ const ut1MinusUtcSecondsColumn = eopData.columnNames.indexOf(
+ "ut1MinusUtcSeconds"
+ );
+ const xCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf(
+ "xCelestialPoleOffsetRadians"
+ );
+ const yCelestialPoleOffsetRadiansColumn = eopData.columnNames.indexOf(
+ "yCelestialPoleOffsetRadians"
+ );
+ const taiMinusUtcSecondsColumn = eopData.columnNames.indexOf(
+ "taiMinusUtcSeconds"
+ );
+ if (dateColumn < 0 || xPoleWanderRadiansColumn < 0 || yPoleWanderRadiansColumn < 0 || ut1MinusUtcSecondsColumn < 0 || xCelestialPoleOffsetRadiansColumn < 0 || yCelestialPoleOffsetRadiansColumn < 0 || taiMinusUtcSecondsColumn < 0) {
+ eop._dataError = "Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns";
+ return;
+ }
+ const samples = eop._samples = eopData.samples;
+ const dates = eop._dates = [];
+ eop._dateColumn = dateColumn;
+ eop._xPoleWanderRadiansColumn = xPoleWanderRadiansColumn;
+ eop._yPoleWanderRadiansColumn = yPoleWanderRadiansColumn;
+ eop._ut1MinusUtcSecondsColumn = ut1MinusUtcSecondsColumn;
+ eop._xCelestialPoleOffsetRadiansColumn = xCelestialPoleOffsetRadiansColumn;
+ eop._yCelestialPoleOffsetRadiansColumn = yCelestialPoleOffsetRadiansColumn;
+ eop._taiMinusUtcSecondsColumn = taiMinusUtcSecondsColumn;
+ eop._columnCount = eopData.columnNames.length;
+ eop._lastIndex = void 0;
+ let lastTaiMinusUtc;
+ const addNewLeapSeconds = eop._addNewLeapSeconds;
+ for (let i = 0, len = samples.length; i < len; i += eop._columnCount) {
+ const mjd = samples[i + dateColumn];
+ const taiMinusUtc = samples[i + taiMinusUtcSecondsColumn];
+ const day = mjd + TimeConstants_default.MODIFIED_JULIAN_DATE_DIFFERENCE;
+ const date = new JulianDate_default(day, taiMinusUtc, TimeStandard_default.TAI);
+ dates.push(date);
+ if (addNewLeapSeconds) {
+ if (taiMinusUtc !== lastTaiMinusUtc && defined_default(lastTaiMinusUtc)) {
+ const leapSeconds = JulianDate_default.leapSeconds;
+ const leapSecondIndex = binarySearch_default(
+ leapSeconds,
+ date,
+ compareLeapSecondDates2
+ );
+ if (leapSecondIndex < 0) {
+ const leapSecond = new LeapSecond_default(date, taiMinusUtc);
+ leapSeconds.splice(~leapSecondIndex, 0, leapSecond);
+ }
+ }
+ lastTaiMinusUtc = taiMinusUtc;
+ }
+ }
+}
+function fillResultFromIndex(eop, samples, index, columnCount, result) {
+ const start = index * columnCount;
+ result.xPoleWander = samples[start + eop._xPoleWanderRadiansColumn];
+ result.yPoleWander = samples[start + eop._yPoleWanderRadiansColumn];
+ result.xPoleOffset = samples[start + eop._xCelestialPoleOffsetRadiansColumn];
+ result.yPoleOffset = samples[start + eop._yCelestialPoleOffsetRadiansColumn];
+ result.ut1MinusUtc = samples[start + eop._ut1MinusUtcSecondsColumn];
+}
+function linearInterp(dx, y1, y2) {
+ return y1 + dx * (y2 - y1);
+}
+function interpolate(eop, dates, samples, date, before, after, result) {
+ const columnCount = eop._columnCount;
+ if (after > dates.length - 1) {
+ result.xPoleWander = 0;
+ result.yPoleWander = 0;
+ result.xPoleOffset = 0;
+ result.yPoleOffset = 0;
+ result.ut1MinusUtc = 0;
+ return result;
+ }
+ const beforeDate = dates[before];
+ const afterDate = dates[after];
+ if (beforeDate.equals(afterDate) || date.equals(beforeDate)) {
+ fillResultFromIndex(eop, samples, before, columnCount, result);
+ return result;
+ } else if (date.equals(afterDate)) {
+ fillResultFromIndex(eop, samples, after, columnCount, result);
+ return result;
+ }
+ const factor2 = JulianDate_default.secondsDifference(date, beforeDate) / JulianDate_default.secondsDifference(afterDate, beforeDate);
+ const startBefore = before * columnCount;
+ const startAfter = after * columnCount;
+ let beforeUt1MinusUtc = samples[startBefore + eop._ut1MinusUtcSecondsColumn];
+ let afterUt1MinusUtc = samples[startAfter + eop._ut1MinusUtcSecondsColumn];
+ const offsetDifference = afterUt1MinusUtc - beforeUt1MinusUtc;
+ if (offsetDifference > 0.5 || offsetDifference < -0.5) {
+ const beforeTaiMinusUtc = samples[startBefore + eop._taiMinusUtcSecondsColumn];
+ const afterTaiMinusUtc = samples[startAfter + eop._taiMinusUtcSecondsColumn];
+ if (beforeTaiMinusUtc !== afterTaiMinusUtc) {
+ if (afterDate.equals(date)) {
+ beforeUt1MinusUtc = afterUt1MinusUtc;
+ } else {
+ afterUt1MinusUtc -= afterTaiMinusUtc - beforeTaiMinusUtc;
+ }
+ }
+ }
+ result.xPoleWander = linearInterp(
+ factor2,
+ samples[startBefore + eop._xPoleWanderRadiansColumn],
+ samples[startAfter + eop._xPoleWanderRadiansColumn]
+ );
+ result.yPoleWander = linearInterp(
+ factor2,
+ samples[startBefore + eop._yPoleWanderRadiansColumn],
+ samples[startAfter + eop._yPoleWanderRadiansColumn]
+ );
+ result.xPoleOffset = linearInterp(
+ factor2,
+ samples[startBefore + eop._xCelestialPoleOffsetRadiansColumn],
+ samples[startAfter + eop._xCelestialPoleOffsetRadiansColumn]
+ );
+ result.yPoleOffset = linearInterp(
+ factor2,
+ samples[startBefore + eop._yCelestialPoleOffsetRadiansColumn],
+ samples[startAfter + eop._yCelestialPoleOffsetRadiansColumn]
+ );
+ result.ut1MinusUtc = linearInterp(
+ factor2,
+ beforeUt1MinusUtc,
+ afterUt1MinusUtc
+ );
+ return result;
+}
+var EarthOrientationParameters_default = EarthOrientationParameters;
+
+// Source/Core/HeadingPitchRoll.js
+function HeadingPitchRoll(heading, pitch, roll) {
+ this.heading = defaultValue_default(heading, 0);
+ this.pitch = defaultValue_default(pitch, 0);
+ this.roll = defaultValue_default(roll, 0);
+}
+HeadingPitchRoll.fromQuaternion = function(quaternion, result) {
+ if (!defined_default(quaternion)) {
+ throw new DeveloperError_default("quaternion is required");
+ }
+ if (!defined_default(result)) {
+ result = new HeadingPitchRoll();
+ }
+ const test = 2 * (quaternion.w * quaternion.y - quaternion.z * quaternion.x);
+ const denominatorRoll = 1 - 2 * (quaternion.x * quaternion.x + quaternion.y * quaternion.y);
+ const numeratorRoll = 2 * (quaternion.w * quaternion.x + quaternion.y * quaternion.z);
+ const denominatorHeading = 1 - 2 * (quaternion.y * quaternion.y + quaternion.z * quaternion.z);
+ const numeratorHeading = 2 * (quaternion.w * quaternion.z + quaternion.x * quaternion.y);
+ result.heading = -Math.atan2(numeratorHeading, denominatorHeading);
+ result.roll = Math.atan2(numeratorRoll, denominatorRoll);
+ result.pitch = -Math_default.asinClamped(test);
+ return result;
+};
+HeadingPitchRoll.fromDegrees = function(heading, pitch, roll, result) {
+ if (!defined_default(heading)) {
+ throw new DeveloperError_default("heading is required");
+ }
+ if (!defined_default(pitch)) {
+ throw new DeveloperError_default("pitch is required");
+ }
+ if (!defined_default(roll)) {
+ throw new DeveloperError_default("roll is required");
+ }
+ if (!defined_default(result)) {
+ result = new HeadingPitchRoll();
+ }
+ result.heading = heading * Math_default.RADIANS_PER_DEGREE;
+ result.pitch = pitch * Math_default.RADIANS_PER_DEGREE;
+ result.roll = roll * Math_default.RADIANS_PER_DEGREE;
+ return result;
+};
+HeadingPitchRoll.clone = function(headingPitchRoll, result) {
+ if (!defined_default(headingPitchRoll)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new HeadingPitchRoll(
+ headingPitchRoll.heading,
+ headingPitchRoll.pitch,
+ headingPitchRoll.roll
+ );
+ }
+ result.heading = headingPitchRoll.heading;
+ result.pitch = headingPitchRoll.pitch;
+ result.roll = headingPitchRoll.roll;
+ return result;
+};
+HeadingPitchRoll.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.heading === right.heading && left.pitch === right.pitch && left.roll === right.roll;
+};
+HeadingPitchRoll.equalsEpsilon = function(left, right, relativeEpsilon, absoluteEpsilon) {
+ return left === right || defined_default(left) && defined_default(right) && Math_default.equalsEpsilon(
+ left.heading,
+ right.heading,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ left.pitch,
+ right.pitch,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ left.roll,
+ right.roll,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+};
+HeadingPitchRoll.prototype.clone = function(result) {
+ return HeadingPitchRoll.clone(this, result);
+};
+HeadingPitchRoll.prototype.equals = function(right) {
+ return HeadingPitchRoll.equals(this, right);
+};
+HeadingPitchRoll.prototype.equalsEpsilon = function(right, relativeEpsilon, absoluteEpsilon) {
+ return HeadingPitchRoll.equalsEpsilon(
+ this,
+ right,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+};
+HeadingPitchRoll.prototype.toString = function() {
+ return `(${this.heading}, ${this.pitch}, ${this.roll})`;
+};
+var HeadingPitchRoll_default = HeadingPitchRoll;
+
+// Source/Core/buildModuleUrl.js
+var cesiumScriptRegex = /((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;
+function getBaseUrlFromCesiumScript() {
+ const scripts = document.getElementsByTagName("script");
+ for (let i = 0, len = scripts.length; i < len; ++i) {
+ const src = scripts[i].getAttribute("src");
+ const result = cesiumScriptRegex.exec(src);
+ if (result !== null) {
+ return result[1];
+ }
+ }
+ return void 0;
+}
+var a2;
+function tryMakeAbsolute(url2) {
+ if (typeof document === "undefined") {
+ return url2;
+ }
+ if (!defined_default(a2)) {
+ a2 = document.createElement("a");
+ }
+ a2.href = url2;
+ a2.href = a2.href;
+ return a2.href;
+}
+var baseResource;
+function getCesiumBaseUrl() {
+ if (defined_default(baseResource)) {
+ return baseResource;
+ }
+ let baseUrlString;
+ if (typeof CESIUM_BASE_URL !== "undefined") {
+ baseUrlString = CESIUM_BASE_URL;
+ } else if (typeof define === "object" && defined_default(define.amd) && !define.amd.toUrlUndefined && defined_default(__require.toUrl)) {
+ baseUrlString = getAbsoluteUri_default(
+ "..",
+ buildModuleUrl("Core/buildModuleUrl.js")
+ );
+ } else {
+ baseUrlString = getBaseUrlFromCesiumScript();
+ }
+ if (!defined_default(baseUrlString)) {
+ throw new DeveloperError_default(
+ "Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL."
+ );
+ }
+ baseResource = new Resource_default({
+ url: tryMakeAbsolute(baseUrlString)
+ });
+ baseResource.appendForwardSlash();
+ return baseResource;
+}
+function buildModuleUrlFromRequireToUrl(moduleID) {
+ return tryMakeAbsolute(__require.toUrl(`../${moduleID}`));
+}
+function buildModuleUrlFromBaseUrl(moduleID) {
+ const resource = getCesiumBaseUrl().getDerivedResource({
+ url: moduleID
+ });
+ return resource.url;
+}
+var implementation;
+function buildModuleUrl(relativeUrl) {
+ if (!defined_default(implementation)) {
+ if (typeof define === "object" && defined_default(define.amd) && !define.amd.toUrlUndefined && defined_default(__require.toUrl)) {
+ implementation = buildModuleUrlFromRequireToUrl;
+ } else {
+ implementation = buildModuleUrlFromBaseUrl;
+ }
+ }
+ const url2 = implementation(relativeUrl);
+ return url2;
+}
+buildModuleUrl._cesiumScriptRegex = cesiumScriptRegex;
+buildModuleUrl._buildModuleUrlFromBaseUrl = buildModuleUrlFromBaseUrl;
+buildModuleUrl._clearBaseResource = function() {
+ baseResource = void 0;
+};
+buildModuleUrl.setBaseUrl = function(value) {
+ baseResource = Resource_default.DEFAULT.getDerivedResource({
+ url: value
+ });
+};
+buildModuleUrl.getCesiumBaseUrl = getCesiumBaseUrl;
+var buildModuleUrl_default = buildModuleUrl;
+
+// Source/Core/Iau2006XysSample.js
+function Iau2006XysSample(x, y, s) {
+ this.x = x;
+ this.y = y;
+ this.s = s;
+}
+var Iau2006XysSample_default = Iau2006XysSample;
+
+// Source/Core/Iau2006XysData.js
+function Iau2006XysData(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._xysFileUrlTemplate = Resource_default.createIfNeeded(
+ options.xysFileUrlTemplate
+ );
+ this._interpolationOrder = defaultValue_default(options.interpolationOrder, 9);
+ this._sampleZeroJulianEphemerisDate = defaultValue_default(
+ options.sampleZeroJulianEphemerisDate,
+ 24423965e-1
+ );
+ this._sampleZeroDateTT = new JulianDate_default(
+ this._sampleZeroJulianEphemerisDate,
+ 0,
+ TimeStandard_default.TAI
+ );
+ this._stepSizeDays = defaultValue_default(options.stepSizeDays, 1);
+ this._samplesPerXysFile = defaultValue_default(options.samplesPerXysFile, 1e3);
+ this._totalSamples = defaultValue_default(options.totalSamples, 27426);
+ this._samples = new Array(this._totalSamples * 3);
+ this._chunkDownloadsInProgress = [];
+ const order = this._interpolationOrder;
+ const denom = this._denominators = new Array(order + 1);
+ const xTable = this._xTable = new Array(order + 1);
+ const stepN = Math.pow(this._stepSizeDays, order);
+ for (let i = 0; i <= order; ++i) {
+ denom[i] = stepN;
+ xTable[i] = i * this._stepSizeDays;
+ for (let j = 0; j <= order; ++j) {
+ if (j !== i) {
+ denom[i] *= i - j;
+ }
+ }
+ denom[i] = 1 / denom[i];
+ }
+ this._work = new Array(order + 1);
+ this._coef = new Array(order + 1);
+}
+var julianDateScratch = new JulianDate_default(0, 0, TimeStandard_default.TAI);
+function getDaysSinceEpoch(xys, dayTT, secondTT) {
+ const dateTT2 = julianDateScratch;
+ dateTT2.dayNumber = dayTT;
+ dateTT2.secondsOfDay = secondTT;
+ return JulianDate_default.daysDifference(dateTT2, xys._sampleZeroDateTT);
+}
+Iau2006XysData.prototype.preload = function(startDayTT, startSecondTT, stopDayTT, stopSecondTT) {
+ const startDaysSinceEpoch = getDaysSinceEpoch(
+ this,
+ startDayTT,
+ startSecondTT
+ );
+ const stopDaysSinceEpoch = getDaysSinceEpoch(this, stopDayTT, stopSecondTT);
+ let startIndex = startDaysSinceEpoch / this._stepSizeDays - this._interpolationOrder / 2 | 0;
+ if (startIndex < 0) {
+ startIndex = 0;
+ }
+ let stopIndex = stopDaysSinceEpoch / this._stepSizeDays - this._interpolationOrder / 2 | 0 + this._interpolationOrder;
+ if (stopIndex >= this._totalSamples) {
+ stopIndex = this._totalSamples - 1;
+ }
+ const startChunk = startIndex / this._samplesPerXysFile | 0;
+ const stopChunk = stopIndex / this._samplesPerXysFile | 0;
+ const promises = [];
+ for (let i = startChunk; i <= stopChunk; ++i) {
+ promises.push(requestXysChunk(this, i));
+ }
+ return Promise.all(promises);
+};
+Iau2006XysData.prototype.computeXysRadians = function(dayTT, secondTT, result) {
+ const daysSinceEpoch = getDaysSinceEpoch(this, dayTT, secondTT);
+ if (daysSinceEpoch < 0) {
+ return void 0;
+ }
+ const centerIndex = daysSinceEpoch / this._stepSizeDays | 0;
+ if (centerIndex >= this._totalSamples) {
+ return void 0;
+ }
+ const degree = this._interpolationOrder;
+ let firstIndex = centerIndex - (degree / 2 | 0);
+ if (firstIndex < 0) {
+ firstIndex = 0;
+ }
+ let lastIndex = firstIndex + degree;
+ if (lastIndex >= this._totalSamples) {
+ lastIndex = this._totalSamples - 1;
+ firstIndex = lastIndex - degree;
+ if (firstIndex < 0) {
+ firstIndex = 0;
+ }
+ }
+ let isDataMissing = false;
+ const samples = this._samples;
+ if (!defined_default(samples[firstIndex * 3])) {
+ requestXysChunk(this, firstIndex / this._samplesPerXysFile | 0);
+ isDataMissing = true;
+ }
+ if (!defined_default(samples[lastIndex * 3])) {
+ requestXysChunk(this, lastIndex / this._samplesPerXysFile | 0);
+ isDataMissing = true;
+ }
+ if (isDataMissing) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ result = new Iau2006XysSample_default(0, 0, 0);
+ } else {
+ result.x = 0;
+ result.y = 0;
+ result.s = 0;
+ }
+ const x = daysSinceEpoch - firstIndex * this._stepSizeDays;
+ const work = this._work;
+ const denom = this._denominators;
+ const coef = this._coef;
+ const xTable = this._xTable;
+ let i, j;
+ for (i = 0; i <= degree; ++i) {
+ work[i] = x - xTable[i];
+ }
+ for (i = 0; i <= degree; ++i) {
+ coef[i] = 1;
+ for (j = 0; j <= degree; ++j) {
+ if (j !== i) {
+ coef[i] *= work[j];
+ }
+ }
+ coef[i] *= denom[i];
+ let sampleIndex = (firstIndex + i) * 3;
+ result.x += coef[i] * samples[sampleIndex++];
+ result.y += coef[i] * samples[sampleIndex++];
+ result.s += coef[i] * samples[sampleIndex];
+ }
+ return result;
+};
+function requestXysChunk(xysData, chunkIndex) {
+ if (xysData._chunkDownloadsInProgress[chunkIndex]) {
+ return xysData._chunkDownloadsInProgress[chunkIndex];
+ }
+ let chunkUrl;
+ const xysFileUrlTemplate = xysData._xysFileUrlTemplate;
+ if (defined_default(xysFileUrlTemplate)) {
+ chunkUrl = xysFileUrlTemplate.getDerivedResource({
+ templateValues: {
+ 0: chunkIndex
+ }
+ });
+ } else {
+ chunkUrl = new Resource_default({
+ url: buildModuleUrl_default(`Assets/IAU2006_XYS/IAU2006_XYS_${chunkIndex}.json`)
+ });
+ }
+ const promise = chunkUrl.fetchJson().then(function(chunk) {
+ xysData._chunkDownloadsInProgress[chunkIndex] = false;
+ const samples = xysData._samples;
+ const newSamples = chunk.samples;
+ const startIndex = chunkIndex * xysData._samplesPerXysFile * 3;
+ for (let i = 0, len = newSamples.length; i < len; ++i) {
+ samples[startIndex + i] = newSamples[i];
+ }
+ });
+ xysData._chunkDownloadsInProgress[chunkIndex] = promise;
+ return promise;
+}
+var Iau2006XysData_default = Iau2006XysData;
+
+// Source/Core/Transforms.js
+var Transforms = {};
+var vectorProductLocalFrame = {
+ up: {
+ south: "east",
+ north: "west",
+ west: "south",
+ east: "north"
+ },
+ down: {
+ south: "west",
+ north: "east",
+ west: "north",
+ east: "south"
+ },
+ south: {
+ up: "west",
+ down: "east",
+ west: "down",
+ east: "up"
+ },
+ north: {
+ up: "east",
+ down: "west",
+ west: "up",
+ east: "down"
+ },
+ west: {
+ up: "north",
+ down: "south",
+ north: "down",
+ south: "up"
+ },
+ east: {
+ up: "south",
+ down: "north",
+ north: "up",
+ south: "down"
+ }
+};
+var degeneratePositionLocalFrame = {
+ north: [-1, 0, 0],
+ east: [0, 1, 0],
+ up: [0, 0, 1],
+ south: [1, 0, 0],
+ west: [0, -1, 0],
+ down: [0, 0, -1]
+};
+var localFrameToFixedFrameCache = {};
+var scratchCalculateCartesian = {
+ east: new Cartesian3_default(),
+ north: new Cartesian3_default(),
+ up: new Cartesian3_default(),
+ west: new Cartesian3_default(),
+ south: new Cartesian3_default(),
+ down: new Cartesian3_default()
+};
+var scratchFirstCartesian = new Cartesian3_default();
+var scratchSecondCartesian = new Cartesian3_default();
+var scratchThirdCartesian = new Cartesian3_default();
+Transforms.localFrameToFixedFrameGenerator = function(firstAxis, secondAxis) {
+ if (!vectorProductLocalFrame.hasOwnProperty(firstAxis) || !vectorProductLocalFrame[firstAxis].hasOwnProperty(secondAxis)) {
+ throw new DeveloperError_default(
+ "firstAxis and secondAxis must be east, north, up, west, south or down."
+ );
+ }
+ const thirdAxis = vectorProductLocalFrame[firstAxis][secondAxis];
+ let resultat;
+ const hashAxis = firstAxis + secondAxis;
+ if (defined_default(localFrameToFixedFrameCache[hashAxis])) {
+ resultat = localFrameToFixedFrameCache[hashAxis];
+ } else {
+ resultat = function(origin, ellipsoid, result) {
+ if (!defined_default(origin)) {
+ throw new DeveloperError_default("origin is required.");
+ }
+ if (!defined_default(result)) {
+ result = new Matrix4_default();
+ }
+ if (Cartesian3_default.equalsEpsilon(origin, Cartesian3_default.ZERO, Math_default.EPSILON14)) {
+ Cartesian3_default.unpack(
+ degeneratePositionLocalFrame[firstAxis],
+ 0,
+ scratchFirstCartesian
+ );
+ Cartesian3_default.unpack(
+ degeneratePositionLocalFrame[secondAxis],
+ 0,
+ scratchSecondCartesian
+ );
+ Cartesian3_default.unpack(
+ degeneratePositionLocalFrame[thirdAxis],
+ 0,
+ scratchThirdCartesian
+ );
+ } else if (Math_default.equalsEpsilon(origin.x, 0, Math_default.EPSILON14) && Math_default.equalsEpsilon(origin.y, 0, Math_default.EPSILON14)) {
+ const sign2 = Math_default.sign(origin.z);
+ Cartesian3_default.unpack(
+ degeneratePositionLocalFrame[firstAxis],
+ 0,
+ scratchFirstCartesian
+ );
+ if (firstAxis !== "east" && firstAxis !== "west") {
+ Cartesian3_default.multiplyByScalar(
+ scratchFirstCartesian,
+ sign2,
+ scratchFirstCartesian
+ );
+ }
+ Cartesian3_default.unpack(
+ degeneratePositionLocalFrame[secondAxis],
+ 0,
+ scratchSecondCartesian
+ );
+ if (secondAxis !== "east" && secondAxis !== "west") {
+ Cartesian3_default.multiplyByScalar(
+ scratchSecondCartesian,
+ sign2,
+ scratchSecondCartesian
+ );
+ }
+ Cartesian3_default.unpack(
+ degeneratePositionLocalFrame[thirdAxis],
+ 0,
+ scratchThirdCartesian
+ );
+ if (thirdAxis !== "east" && thirdAxis !== "west") {
+ Cartesian3_default.multiplyByScalar(
+ scratchThirdCartesian,
+ sign2,
+ scratchThirdCartesian
+ );
+ }
+ } else {
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ ellipsoid.geodeticSurfaceNormal(origin, scratchCalculateCartesian.up);
+ const up = scratchCalculateCartesian.up;
+ const east = scratchCalculateCartesian.east;
+ east.x = -origin.y;
+ east.y = origin.x;
+ east.z = 0;
+ Cartesian3_default.normalize(east, scratchCalculateCartesian.east);
+ Cartesian3_default.cross(up, east, scratchCalculateCartesian.north);
+ Cartesian3_default.multiplyByScalar(
+ scratchCalculateCartesian.up,
+ -1,
+ scratchCalculateCartesian.down
+ );
+ Cartesian3_default.multiplyByScalar(
+ scratchCalculateCartesian.east,
+ -1,
+ scratchCalculateCartesian.west
+ );
+ Cartesian3_default.multiplyByScalar(
+ scratchCalculateCartesian.north,
+ -1,
+ scratchCalculateCartesian.south
+ );
+ scratchFirstCartesian = scratchCalculateCartesian[firstAxis];
+ scratchSecondCartesian = scratchCalculateCartesian[secondAxis];
+ scratchThirdCartesian = scratchCalculateCartesian[thirdAxis];
+ }
+ result[0] = scratchFirstCartesian.x;
+ result[1] = scratchFirstCartesian.y;
+ result[2] = scratchFirstCartesian.z;
+ result[3] = 0;
+ result[4] = scratchSecondCartesian.x;
+ result[5] = scratchSecondCartesian.y;
+ result[6] = scratchSecondCartesian.z;
+ result[7] = 0;
+ result[8] = scratchThirdCartesian.x;
+ result[9] = scratchThirdCartesian.y;
+ result[10] = scratchThirdCartesian.z;
+ result[11] = 0;
+ result[12] = origin.x;
+ result[13] = origin.y;
+ result[14] = origin.z;
+ result[15] = 1;
+ return result;
+ };
+ localFrameToFixedFrameCache[hashAxis] = resultat;
+ }
+ return resultat;
+};
+Transforms.eastNorthUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator(
+ "east",
+ "north"
+);
+Transforms.northEastDownToFixedFrame = Transforms.localFrameToFixedFrameGenerator(
+ "north",
+ "east"
+);
+Transforms.northUpEastToFixedFrame = Transforms.localFrameToFixedFrameGenerator(
+ "north",
+ "up"
+);
+Transforms.northWestUpToFixedFrame = Transforms.localFrameToFixedFrameGenerator(
+ "north",
+ "west"
+);
+var scratchHPRQuaternion2 = new Quaternion_default();
+var scratchScale = new Cartesian3_default(1, 1, 1);
+var scratchHPRMatrix4 = new Matrix4_default();
+Transforms.headingPitchRollToFixedFrame = function(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) {
+ Check_default.typeOf.object("HeadingPitchRoll", headingPitchRoll);
+ fixedFrameTransform = defaultValue_default(
+ fixedFrameTransform,
+ Transforms.eastNorthUpToFixedFrame
+ );
+ const hprQuaternion = Quaternion_default.fromHeadingPitchRoll(
+ headingPitchRoll,
+ scratchHPRQuaternion2
+ );
+ const hprMatrix = Matrix4_default.fromTranslationQuaternionRotationScale(
+ Cartesian3_default.ZERO,
+ hprQuaternion,
+ scratchScale,
+ scratchHPRMatrix4
+ );
+ result = fixedFrameTransform(origin, ellipsoid, result);
+ return Matrix4_default.multiply(result, hprMatrix, result);
+};
+var scratchENUMatrix4 = new Matrix4_default();
+var scratchHPRMatrix3 = new Matrix3_default();
+Transforms.headingPitchRollQuaternion = function(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) {
+ Check_default.typeOf.object("HeadingPitchRoll", headingPitchRoll);
+ const transform3 = Transforms.headingPitchRollToFixedFrame(
+ origin,
+ headingPitchRoll,
+ ellipsoid,
+ fixedFrameTransform,
+ scratchENUMatrix4
+ );
+ const rotation = Matrix4_default.getMatrix3(transform3, scratchHPRMatrix3);
+ return Quaternion_default.fromRotationMatrix(rotation, result);
+};
+var noScale = new Cartesian3_default(1, 1, 1);
+var hprCenterScratch = new Cartesian3_default();
+var ffScratch = new Matrix4_default();
+var hprTransformScratch = new Matrix4_default();
+var hprRotationScratch = new Matrix3_default();
+var hprQuaternionScratch = new Quaternion_default();
+Transforms.fixedFrameToHeadingPitchRoll = function(transform3, ellipsoid, fixedFrameTransform, result) {
+ Check_default.defined("transform", transform3);
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ fixedFrameTransform = defaultValue_default(
+ fixedFrameTransform,
+ Transforms.eastNorthUpToFixedFrame
+ );
+ if (!defined_default(result)) {
+ result = new HeadingPitchRoll_default();
+ }
+ const center = Matrix4_default.getTranslation(transform3, hprCenterScratch);
+ if (Cartesian3_default.equals(center, Cartesian3_default.ZERO)) {
+ result.heading = 0;
+ result.pitch = 0;
+ result.roll = 0;
+ return result;
+ }
+ let toFixedFrame = Matrix4_default.inverseTransformation(
+ fixedFrameTransform(center, ellipsoid, ffScratch),
+ ffScratch
+ );
+ let transformCopy = Matrix4_default.setScale(transform3, noScale, hprTransformScratch);
+ transformCopy = Matrix4_default.setTranslation(
+ transformCopy,
+ Cartesian3_default.ZERO,
+ transformCopy
+ );
+ toFixedFrame = Matrix4_default.multiply(toFixedFrame, transformCopy, toFixedFrame);
+ let quaternionRotation = Quaternion_default.fromRotationMatrix(
+ Matrix4_default.getMatrix3(toFixedFrame, hprRotationScratch),
+ hprQuaternionScratch
+ );
+ quaternionRotation = Quaternion_default.normalize(
+ quaternionRotation,
+ quaternionRotation
+ );
+ return HeadingPitchRoll_default.fromQuaternion(quaternionRotation, result);
+};
+var gmstConstant0 = 6 * 3600 + 41 * 60 + 50.54841;
+var gmstConstant1 = 8640184812866e-6;
+var gmstConstant2 = 0.093104;
+var gmstConstant3 = -62e-7;
+var rateCoef = 11772758384668e-32;
+var wgs84WRPrecessing = 72921158553e-15;
+var twoPiOverSecondsInDay = Math_default.TWO_PI / 86400;
+var dateInUtc = new JulianDate_default();
+Transforms.computeTemeToPseudoFixedMatrix = function(date, result) {
+ if (!defined_default(date)) {
+ throw new DeveloperError_default("date is required.");
+ }
+ dateInUtc = JulianDate_default.addSeconds(
+ date,
+ -JulianDate_default.computeTaiMinusUtc(date),
+ dateInUtc
+ );
+ const utcDayNumber = dateInUtc.dayNumber;
+ const utcSecondsIntoDay = dateInUtc.secondsOfDay;
+ let t;
+ const diffDays = utcDayNumber - 2451545;
+ if (utcSecondsIntoDay >= 43200) {
+ t = (diffDays + 0.5) / TimeConstants_default.DAYS_PER_JULIAN_CENTURY;
+ } else {
+ t = (diffDays - 0.5) / TimeConstants_default.DAYS_PER_JULIAN_CENTURY;
+ }
+ const gmst0 = gmstConstant0 + t * (gmstConstant1 + t * (gmstConstant2 + t * gmstConstant3));
+ const angle = gmst0 * twoPiOverSecondsInDay % Math_default.TWO_PI;
+ const ratio = wgs84WRPrecessing + rateCoef * (utcDayNumber - 24515455e-1);
+ const secondsSinceMidnight = (utcSecondsIntoDay + TimeConstants_default.SECONDS_PER_DAY * 0.5) % TimeConstants_default.SECONDS_PER_DAY;
+ const gha = angle + ratio * secondsSinceMidnight;
+ const cosGha = Math.cos(gha);
+ const sinGha = Math.sin(gha);
+ if (!defined_default(result)) {
+ return new Matrix3_default(
+ cosGha,
+ sinGha,
+ 0,
+ -sinGha,
+ cosGha,
+ 0,
+ 0,
+ 0,
+ 1
+ );
+ }
+ result[0] = cosGha;
+ result[1] = -sinGha;
+ result[2] = 0;
+ result[3] = sinGha;
+ result[4] = cosGha;
+ result[5] = 0;
+ result[6] = 0;
+ result[7] = 0;
+ result[8] = 1;
+ return result;
+};
+Transforms.iau2006XysData = new Iau2006XysData_default();
+Transforms.earthOrientationParameters = EarthOrientationParameters_default.NONE;
+var ttMinusTai = 32.184;
+var j2000ttDays = 2451545;
+Transforms.preloadIcrfFixed = function(timeInterval) {
+ const startDayTT = timeInterval.start.dayNumber;
+ const startSecondTT = timeInterval.start.secondsOfDay + ttMinusTai;
+ const stopDayTT = timeInterval.stop.dayNumber;
+ const stopSecondTT = timeInterval.stop.secondsOfDay + ttMinusTai;
+ const xysPromise = Transforms.iau2006XysData.preload(
+ startDayTT,
+ startSecondTT,
+ stopDayTT,
+ stopSecondTT
+ );
+ const eopPromise = Transforms.earthOrientationParameters.getPromiseToLoad();
+ return Promise.all([xysPromise, eopPromise]);
+};
+Transforms.computeIcrfToFixedMatrix = function(date, result) {
+ if (!defined_default(date)) {
+ throw new DeveloperError_default("date is required.");
+ }
+ if (!defined_default(result)) {
+ result = new Matrix3_default();
+ }
+ const fixedToIcrfMtx = Transforms.computeFixedToIcrfMatrix(date, result);
+ if (!defined_default(fixedToIcrfMtx)) {
+ return void 0;
+ }
+ return Matrix3_default.transpose(fixedToIcrfMtx, result);
+};
+var xysScratch = new Iau2006XysSample_default(0, 0, 0);
+var eopScratch = new EarthOrientationParametersSample_default(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+);
+var rotation1Scratch = new Matrix3_default();
+var rotation2Scratch = new Matrix3_default();
+Transforms.computeFixedToIcrfMatrix = function(date, result) {
+ if (!defined_default(date)) {
+ throw new DeveloperError_default("date is required.");
+ }
+ if (!defined_default(result)) {
+ result = new Matrix3_default();
+ }
+ const eop = Transforms.earthOrientationParameters.compute(date, eopScratch);
+ if (!defined_default(eop)) {
+ return void 0;
+ }
+ const dayTT = date.dayNumber;
+ const secondTT = date.secondsOfDay + ttMinusTai;
+ const xys = Transforms.iau2006XysData.computeXysRadians(
+ dayTT,
+ secondTT,
+ xysScratch
+ );
+ if (!defined_default(xys)) {
+ return void 0;
+ }
+ const x = xys.x + eop.xPoleOffset;
+ const y = xys.y + eop.yPoleOffset;
+ const a3 = 1 / (1 + Math.sqrt(1 - x * x - y * y));
+ const rotation1 = rotation1Scratch;
+ rotation1[0] = 1 - a3 * x * x;
+ rotation1[3] = -a3 * x * y;
+ rotation1[6] = x;
+ rotation1[1] = -a3 * x * y;
+ rotation1[4] = 1 - a3 * y * y;
+ rotation1[7] = y;
+ rotation1[2] = -x;
+ rotation1[5] = -y;
+ rotation1[8] = 1 - a3 * (x * x + y * y);
+ const rotation2 = Matrix3_default.fromRotationZ(-xys.s, rotation2Scratch);
+ const matrixQ = Matrix3_default.multiply(rotation1, rotation2, rotation1Scratch);
+ const dateUt1day = date.dayNumber;
+ const dateUt1sec = date.secondsOfDay - JulianDate_default.computeTaiMinusUtc(date) + eop.ut1MinusUtc;
+ const daysSinceJ2000 = dateUt1day - 2451545;
+ const fractionOfDay = dateUt1sec / TimeConstants_default.SECONDS_PER_DAY;
+ let era = 0.779057273264 + fractionOfDay + 0.00273781191135448 * (daysSinceJ2000 + fractionOfDay);
+ era = era % 1 * Math_default.TWO_PI;
+ const earthRotation = Matrix3_default.fromRotationZ(era, rotation2Scratch);
+ const pfToIcrf = Matrix3_default.multiply(matrixQ, earthRotation, rotation1Scratch);
+ const cosxp = Math.cos(eop.xPoleWander);
+ const cosyp = Math.cos(eop.yPoleWander);
+ const sinxp = Math.sin(eop.xPoleWander);
+ const sinyp = Math.sin(eop.yPoleWander);
+ let ttt = dayTT - j2000ttDays + secondTT / TimeConstants_default.SECONDS_PER_DAY;
+ ttt /= 36525;
+ const sp = -47e-6 * ttt * Math_default.RADIANS_PER_DEGREE / 3600;
+ const cossp = Math.cos(sp);
+ const sinsp = Math.sin(sp);
+ const fToPfMtx = rotation2Scratch;
+ fToPfMtx[0] = cosxp * cossp;
+ fToPfMtx[1] = cosxp * sinsp;
+ fToPfMtx[2] = sinxp;
+ fToPfMtx[3] = -cosyp * sinsp + sinyp * sinxp * cossp;
+ fToPfMtx[4] = cosyp * cossp + sinyp * sinxp * sinsp;
+ fToPfMtx[5] = -sinyp * cosxp;
+ fToPfMtx[6] = -sinyp * sinsp - cosyp * sinxp * cossp;
+ fToPfMtx[7] = sinyp * cossp - cosyp * sinxp * sinsp;
+ fToPfMtx[8] = cosyp * cosxp;
+ return Matrix3_default.multiply(pfToIcrf, fToPfMtx, result);
+};
+var pointToWindowCoordinatesTemp = new Cartesian4_default();
+Transforms.pointToWindowCoordinates = function(modelViewProjectionMatrix, viewportTransformation, point, result) {
+ result = Transforms.pointToGLWindowCoordinates(
+ modelViewProjectionMatrix,
+ viewportTransformation,
+ point,
+ result
+ );
+ result.y = 2 * viewportTransformation[5] - result.y;
+ return result;
+};
+Transforms.pointToGLWindowCoordinates = function(modelViewProjectionMatrix, viewportTransformation, point, result) {
+ if (!defined_default(modelViewProjectionMatrix)) {
+ throw new DeveloperError_default("modelViewProjectionMatrix is required.");
+ }
+ if (!defined_default(viewportTransformation)) {
+ throw new DeveloperError_default("viewportTransformation is required.");
+ }
+ if (!defined_default(point)) {
+ throw new DeveloperError_default("point is required.");
+ }
+ if (!defined_default(result)) {
+ result = new Cartesian2_default();
+ }
+ const tmp2 = pointToWindowCoordinatesTemp;
+ Matrix4_default.multiplyByVector(
+ modelViewProjectionMatrix,
+ Cartesian4_default.fromElements(point.x, point.y, point.z, 1, tmp2),
+ tmp2
+ );
+ Cartesian4_default.multiplyByScalar(tmp2, 1 / tmp2.w, tmp2);
+ Matrix4_default.multiplyByVector(viewportTransformation, tmp2, tmp2);
+ return Cartesian2_default.fromCartesian4(tmp2, result);
+};
+var normalScratch = new Cartesian3_default();
+var rightScratch = new Cartesian3_default();
+var upScratch = new Cartesian3_default();
+Transforms.rotationMatrixFromPositionVelocity = function(position, velocity, ellipsoid, result) {
+ if (!defined_default(position)) {
+ throw new DeveloperError_default("position is required.");
+ }
+ if (!defined_default(velocity)) {
+ throw new DeveloperError_default("velocity is required.");
+ }
+ const normal2 = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84).geodeticSurfaceNormal(
+ position,
+ normalScratch
+ );
+ let right = Cartesian3_default.cross(velocity, normal2, rightScratch);
+ if (Cartesian3_default.equalsEpsilon(right, Cartesian3_default.ZERO, Math_default.EPSILON6)) {
+ right = Cartesian3_default.clone(Cartesian3_default.UNIT_X, right);
+ }
+ const up = Cartesian3_default.cross(right, velocity, upScratch);
+ Cartesian3_default.normalize(up, up);
+ Cartesian3_default.cross(velocity, up, right);
+ Cartesian3_default.negate(right, right);
+ Cartesian3_default.normalize(right, right);
+ if (!defined_default(result)) {
+ result = new Matrix3_default();
+ }
+ result[0] = velocity.x;
+ result[1] = velocity.y;
+ result[2] = velocity.z;
+ result[3] = right.x;
+ result[4] = right.y;
+ result[5] = right.z;
+ result[6] = up.x;
+ result[7] = up.y;
+ result[8] = up.z;
+ return result;
+};
+var swizzleMatrix = new Matrix4_default(
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1
+);
+var scratchCartographic = new Cartographic_default();
+var scratchCartesian3Projection = new Cartesian3_default();
+var scratchCenter = new Cartesian3_default();
+var scratchRotation = new Matrix3_default();
+var scratchFromENU = new Matrix4_default();
+var scratchToENU = new Matrix4_default();
+Transforms.basisTo2D = function(projection, matrix, result) {
+ if (!defined_default(projection)) {
+ throw new DeveloperError_default("projection is required.");
+ }
+ if (!defined_default(matrix)) {
+ throw new DeveloperError_default("matrix is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const rtcCenter = Matrix4_default.getTranslation(matrix, scratchCenter);
+ const ellipsoid = projection.ellipsoid;
+ const cartographic2 = ellipsoid.cartesianToCartographic(
+ rtcCenter,
+ scratchCartographic
+ );
+ const projectedPosition2 = projection.project(
+ cartographic2,
+ scratchCartesian3Projection
+ );
+ Cartesian3_default.fromElements(
+ projectedPosition2.z,
+ projectedPosition2.x,
+ projectedPosition2.y,
+ projectedPosition2
+ );
+ const fromENU = Transforms.eastNorthUpToFixedFrame(
+ rtcCenter,
+ ellipsoid,
+ scratchFromENU
+ );
+ const toENU = Matrix4_default.inverseTransformation(fromENU, scratchToENU);
+ const rotation = Matrix4_default.getMatrix3(matrix, scratchRotation);
+ const local = Matrix4_default.multiplyByMatrix3(toENU, rotation, result);
+ Matrix4_default.multiply(swizzleMatrix, local, result);
+ Matrix4_default.setTranslation(result, projectedPosition2, result);
+ return result;
+};
+Transforms.wgs84To2DModelMatrix = function(projection, center, result) {
+ if (!defined_default(projection)) {
+ throw new DeveloperError_default("projection is required.");
+ }
+ if (!defined_default(center)) {
+ throw new DeveloperError_default("center is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const ellipsoid = projection.ellipsoid;
+ const fromENU = Transforms.eastNorthUpToFixedFrame(
+ center,
+ ellipsoid,
+ scratchFromENU
+ );
+ const toENU = Matrix4_default.inverseTransformation(fromENU, scratchToENU);
+ const cartographic2 = ellipsoid.cartesianToCartographic(
+ center,
+ scratchCartographic
+ );
+ const projectedPosition2 = projection.project(
+ cartographic2,
+ scratchCartesian3Projection
+ );
+ Cartesian3_default.fromElements(
+ projectedPosition2.z,
+ projectedPosition2.x,
+ projectedPosition2.y,
+ projectedPosition2
+ );
+ const translation3 = Matrix4_default.fromTranslation(
+ projectedPosition2,
+ scratchFromENU
+ );
+ Matrix4_default.multiply(swizzleMatrix, toENU, result);
+ Matrix4_default.multiply(translation3, result, result);
+ return result;
+};
+var Transforms_default = Transforms;
+
+// Source/Core/Geometry.js
+function Geometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.typeOf.object("options.attributes", options.attributes);
+ this.attributes = options.attributes;
+ this.indices = options.indices;
+ this.primitiveType = defaultValue_default(
+ options.primitiveType,
+ PrimitiveType_default.TRIANGLES
+ );
+ this.boundingSphere = options.boundingSphere;
+ this.geometryType = defaultValue_default(options.geometryType, GeometryType_default.NONE);
+ this.boundingSphereCV = options.boundingSphereCV;
+ this.offsetAttribute = options.offsetAttribute;
+}
+Geometry.computeNumberOfVertices = function(geometry) {
+ Check_default.typeOf.object("geometry", geometry);
+ let numberOfVertices = -1;
+ for (const property in geometry.attributes) {
+ if (geometry.attributes.hasOwnProperty(property) && defined_default(geometry.attributes[property]) && defined_default(geometry.attributes[property].values)) {
+ const attribute = geometry.attributes[property];
+ const num = attribute.values.length / attribute.componentsPerAttribute;
+ if (numberOfVertices !== num && numberOfVertices !== -1) {
+ throw new DeveloperError_default(
+ "All attribute lists must have the same number of attributes."
+ );
+ }
+ numberOfVertices = num;
+ }
+ }
+ return numberOfVertices;
+};
+var rectangleCenterScratch = new Cartographic_default();
+var enuCenterScratch = new Cartesian3_default();
+var fixedFrameToEnuScratch = new Matrix4_default();
+var boundingRectanglePointsCartographicScratch = [
+ new Cartographic_default(),
+ new Cartographic_default(),
+ new Cartographic_default()
+];
+var boundingRectanglePointsEnuScratch = [
+ new Cartesian2_default(),
+ new Cartesian2_default(),
+ new Cartesian2_default()
+];
+var points2DScratch = [new Cartesian2_default(), new Cartesian2_default(), new Cartesian2_default()];
+var pointEnuScratch = new Cartesian3_default();
+var enuRotationScratch = new Quaternion_default();
+var enuRotationMatrixScratch = new Matrix4_default();
+var rotation2DScratch = new Matrix2_default();
+Geometry._textureCoordinateRotationPoints = function(positions, stRotation, ellipsoid, boundingRectangle) {
+ let i;
+ const rectangleCenter = Rectangle_default.center(
+ boundingRectangle,
+ rectangleCenterScratch
+ );
+ const enuCenter = Cartographic_default.toCartesian(
+ rectangleCenter,
+ ellipsoid,
+ enuCenterScratch
+ );
+ const enuToFixedFrame = Transforms_default.eastNorthUpToFixedFrame(
+ enuCenter,
+ ellipsoid,
+ fixedFrameToEnuScratch
+ );
+ const fixedFrameToEnu = Matrix4_default.inverse(
+ enuToFixedFrame,
+ fixedFrameToEnuScratch
+ );
+ const boundingPointsEnu = boundingRectanglePointsEnuScratch;
+ const boundingPointsCarto = boundingRectanglePointsCartographicScratch;
+ boundingPointsCarto[0].longitude = boundingRectangle.west;
+ boundingPointsCarto[0].latitude = boundingRectangle.south;
+ boundingPointsCarto[1].longitude = boundingRectangle.west;
+ boundingPointsCarto[1].latitude = boundingRectangle.north;
+ boundingPointsCarto[2].longitude = boundingRectangle.east;
+ boundingPointsCarto[2].latitude = boundingRectangle.south;
+ let posEnu = pointEnuScratch;
+ for (i = 0; i < 3; i++) {
+ Cartographic_default.toCartesian(boundingPointsCarto[i], ellipsoid, posEnu);
+ posEnu = Matrix4_default.multiplyByPointAsVector(fixedFrameToEnu, posEnu, posEnu);
+ boundingPointsEnu[i].x = posEnu.x;
+ boundingPointsEnu[i].y = posEnu.y;
+ }
+ const rotation = Quaternion_default.fromAxisAngle(
+ Cartesian3_default.UNIT_Z,
+ -stRotation,
+ enuRotationScratch
+ );
+ const textureMatrix = Matrix3_default.fromQuaternion(
+ rotation,
+ enuRotationMatrixScratch
+ );
+ const positionsLength = positions.length;
+ let enuMinX = Number.POSITIVE_INFINITY;
+ let enuMinY = Number.POSITIVE_INFINITY;
+ let enuMaxX = Number.NEGATIVE_INFINITY;
+ let enuMaxY = Number.NEGATIVE_INFINITY;
+ for (i = 0; i < positionsLength; i++) {
+ posEnu = Matrix4_default.multiplyByPointAsVector(
+ fixedFrameToEnu,
+ positions[i],
+ posEnu
+ );
+ posEnu = Matrix3_default.multiplyByVector(textureMatrix, posEnu, posEnu);
+ enuMinX = Math.min(enuMinX, posEnu.x);
+ enuMinY = Math.min(enuMinY, posEnu.y);
+ enuMaxX = Math.max(enuMaxX, posEnu.x);
+ enuMaxY = Math.max(enuMaxY, posEnu.y);
+ }
+ const toDesiredInComputed = Matrix2_default.fromRotation(
+ stRotation,
+ rotation2DScratch
+ );
+ const points2D = points2DScratch;
+ points2D[0].x = enuMinX;
+ points2D[0].y = enuMinY;
+ points2D[1].x = enuMinX;
+ points2D[1].y = enuMaxY;
+ points2D[2].x = enuMaxX;
+ points2D[2].y = enuMinY;
+ const boundingEnuMin = boundingPointsEnu[0];
+ const boundingPointsWidth = boundingPointsEnu[2].x - boundingEnuMin.x;
+ const boundingPointsHeight = boundingPointsEnu[1].y - boundingEnuMin.y;
+ for (i = 0; i < 3; i++) {
+ const point2D = points2D[i];
+ Matrix2_default.multiplyByVector(toDesiredInComputed, point2D, point2D);
+ point2D.x = (point2D.x - boundingEnuMin.x) / boundingPointsWidth;
+ point2D.y = (point2D.y - boundingEnuMin.y) / boundingPointsHeight;
+ }
+ const minXYCorner = points2D[0];
+ const maxYCorner = points2D[1];
+ const maxXCorner = points2D[2];
+ const result = new Array(6);
+ Cartesian2_default.pack(minXYCorner, result);
+ Cartesian2_default.pack(maxYCorner, result, 2);
+ Cartesian2_default.pack(maxXCorner, result, 4);
+ return result;
+};
+var Geometry_default = Geometry;
+
+// Source/Core/GeometryAttribute.js
+function GeometryAttribute(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ if (!defined_default(options.componentDatatype)) {
+ throw new DeveloperError_default("options.componentDatatype is required.");
+ }
+ if (!defined_default(options.componentsPerAttribute)) {
+ throw new DeveloperError_default("options.componentsPerAttribute is required.");
+ }
+ if (options.componentsPerAttribute < 1 || options.componentsPerAttribute > 4) {
+ throw new DeveloperError_default(
+ "options.componentsPerAttribute must be between 1 and 4."
+ );
+ }
+ if (!defined_default(options.values)) {
+ throw new DeveloperError_default("options.values is required.");
+ }
+ this.componentDatatype = options.componentDatatype;
+ this.componentsPerAttribute = options.componentsPerAttribute;
+ this.normalize = defaultValue_default(options.normalize, false);
+ this.values = options.values;
+}
+var GeometryAttribute_default = GeometryAttribute;
+
+// Source/Core/CompressedTextureBuffer.js
+function CompressedTextureBuffer(internalFormat, pixelDatatype, width, height, buffer) {
+ this._format = internalFormat;
+ this._datatype = pixelDatatype;
+ this._width = width;
+ this._height = height;
+ this._buffer = buffer;
+}
+Object.defineProperties(CompressedTextureBuffer.prototype, {
+ internalFormat: {
+ get: function() {
+ return this._format;
+ }
+ },
+ pixelDatatype: {
+ get: function() {
+ return this._datatype;
+ }
+ },
+ width: {
+ get: function() {
+ return this._width;
+ }
+ },
+ height: {
+ get: function() {
+ return this._height;
+ }
+ },
+ bufferView: {
+ get: function() {
+ return this._buffer;
+ }
+ }
+});
+CompressedTextureBuffer.clone = function(object2) {
+ if (!defined_default(object2)) {
+ return void 0;
+ }
+ return new CompressedTextureBuffer(
+ object2._format,
+ object2._datatype,
+ object2._width,
+ object2._height,
+ object2._buffer
+ );
+};
+CompressedTextureBuffer.prototype.clone = function() {
+ return CompressedTextureBuffer.clone(this);
+};
+var CompressedTextureBuffer_default = CompressedTextureBuffer;
+
+// Source/Core/TaskProcessor.js
+var import_urijs7 = __toESM(require_URI(), 1);
+function canTransferArrayBuffer() {
+ if (!defined_default(TaskProcessor._canTransferArrayBuffer)) {
+ const worker = new Worker(
+ getWorkerUrl("Workers/transferTypedArrayTest.js")
+ );
+ worker.postMessage = defaultValue_default(
+ worker.webkitPostMessage,
+ worker.postMessage
+ );
+ const value = 99;
+ const array = new Int8Array([value]);
+ try {
+ worker.postMessage(
+ {
+ array
+ },
+ [array.buffer]
+ );
+ } catch (e) {
+ TaskProcessor._canTransferArrayBuffer = false;
+ return TaskProcessor._canTransferArrayBuffer;
+ }
+ const deferred = defer_default();
+ worker.onmessage = function(event) {
+ const array2 = event.data.array;
+ const result = defined_default(array2) && array2[0] === value;
+ deferred.resolve(result);
+ worker.terminate();
+ TaskProcessor._canTransferArrayBuffer = result;
+ };
+ TaskProcessor._canTransferArrayBuffer = deferred.promise;
+ }
+ return TaskProcessor._canTransferArrayBuffer;
+}
+var taskCompletedEvent = new Event_default();
+function completeTask(processor, data) {
+ --processor._activeTasks;
+ const id = data.id;
+ if (!defined_default(id)) {
+ return;
+ }
+ const deferreds = processor._deferreds;
+ const deferred = deferreds[id];
+ if (defined_default(data.error)) {
+ let error = data.error;
+ if (error.name === "RuntimeError") {
+ error = new RuntimeError_default(data.error.message);
+ error.stack = data.error.stack;
+ } else if (error.name === "DeveloperError") {
+ error = new DeveloperError_default(data.error.message);
+ error.stack = data.error.stack;
+ }
+ taskCompletedEvent.raiseEvent(error);
+ deferred.reject(error);
+ } else {
+ taskCompletedEvent.raiseEvent();
+ deferred.resolve(data.result);
+ }
+ delete deferreds[id];
+}
+function getWorkerUrl(moduleID) {
+ let url2 = buildModuleUrl_default(moduleID);
+ if (isCrossOriginUrl_default(url2)) {
+ const script = `importScripts("${url2}");`;
+ let blob;
+ try {
+ blob = new Blob([script], {
+ type: "application/javascript"
+ });
+ } catch (e) {
+ const BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
+ const blobBuilder = new BlobBuilder();
+ blobBuilder.append(script);
+ blob = blobBuilder.getBlob("application/javascript");
+ }
+ const URL2 = window.URL || window.webkitURL;
+ url2 = URL2.createObjectURL(blob);
+ }
+ return url2;
+}
+var bootstrapperUrlResult;
+function getBootstrapperUrl() {
+ if (!defined_default(bootstrapperUrlResult)) {
+ bootstrapperUrlResult = getWorkerUrl("Workers/cesiumWorkerBootstrapper.js");
+ }
+ return bootstrapperUrlResult;
+}
+function createWorker(processor) {
+ const worker = new Worker(getBootstrapperUrl());
+ worker.postMessage = defaultValue_default(
+ worker.webkitPostMessage,
+ worker.postMessage
+ );
+ const bootstrapMessage = {
+ loaderConfig: {
+ paths: {
+ Workers: buildModuleUrl_default("Workers")
+ },
+ baseUrl: buildModuleUrl_default.getCesiumBaseUrl().url
+ },
+ workerModule: processor._workerPath
+ };
+ worker.postMessage(bootstrapMessage);
+ worker.onmessage = function(event) {
+ completeTask(processor, event.data);
+ };
+ return worker;
+}
+function getWebAssemblyLoaderConfig(processor, wasmOptions) {
+ const config2 = {
+ modulePath: void 0,
+ wasmBinaryFile: void 0,
+ wasmBinary: void 0
+ };
+ if (!FeatureDetection_default.supportsWebAssembly()) {
+ if (!defined_default(wasmOptions.fallbackModulePath)) {
+ throw new RuntimeError_default(
+ `This browser does not support Web Assembly, and no backup module was provided for ${processor._workerPath}`
+ );
+ }
+ config2.modulePath = buildModuleUrl_default(wasmOptions.fallbackModulePath);
+ return Promise.resolve(config2);
+ }
+ config2.modulePath = buildModuleUrl_default(wasmOptions.modulePath);
+ config2.wasmBinaryFile = buildModuleUrl_default(wasmOptions.wasmBinaryFile);
+ return Resource_default.fetchArrayBuffer({
+ url: config2.wasmBinaryFile
+ }).then(function(arrayBuffer) {
+ config2.wasmBinary = arrayBuffer;
+ return config2;
+ });
+}
+function TaskProcessor(workerPath, maximumActiveTasks) {
+ const uri = new import_urijs7.default(workerPath);
+ this._workerPath = uri.scheme().length !== 0 && uri.fragment().length === 0 ? workerPath : TaskProcessor._workerModulePrefix + workerPath;
+ this._maximumActiveTasks = defaultValue_default(
+ maximumActiveTasks,
+ Number.POSITIVE_INFINITY
+ );
+ this._activeTasks = 0;
+ this._deferreds = {};
+ this._nextID = 0;
+}
+var emptyTransferableObjectArray = [];
+TaskProcessor.prototype.scheduleTask = function(parameters, transferableObjects) {
+ if (!defined_default(this._worker)) {
+ this._worker = createWorker(this);
+ }
+ if (this._activeTasks >= this._maximumActiveTasks) {
+ return void 0;
+ }
+ ++this._activeTasks;
+ const processor = this;
+ return Promise.resolve(canTransferArrayBuffer()).then(function(canTransferArrayBuffer2) {
+ if (!defined_default(transferableObjects)) {
+ transferableObjects = emptyTransferableObjectArray;
+ } else if (!canTransferArrayBuffer2) {
+ transferableObjects.length = 0;
+ }
+ const id = processor._nextID++;
+ const deferred = defer_default();
+ processor._deferreds[id] = deferred;
+ processor._worker.postMessage(
+ {
+ id,
+ parameters,
+ canTransferArrayBuffer: canTransferArrayBuffer2
+ },
+ transferableObjects
+ );
+ return deferred.promise;
+ });
+};
+TaskProcessor.prototype.initWebAssemblyModule = function(webAssemblyOptions) {
+ if (!defined_default(this._worker)) {
+ this._worker = createWorker(this);
+ }
+ const deferred = defer_default();
+ const processor = this;
+ const worker = this._worker;
+ getWebAssemblyLoaderConfig(this, webAssemblyOptions).then(function(wasmConfig) {
+ return Promise.resolve(canTransferArrayBuffer()).then(function(canTransferArrayBuffer2) {
+ let transferableObjects;
+ const binary = wasmConfig.wasmBinary;
+ if (defined_default(binary) && canTransferArrayBuffer2) {
+ transferableObjects = [binary];
+ }
+ worker.onmessage = function(event) {
+ worker.onmessage = function(event2) {
+ completeTask(processor, event2.data);
+ };
+ deferred.resolve(event.data);
+ };
+ worker.postMessage(
+ { webAssemblyConfig: wasmConfig },
+ transferableObjects
+ );
+ });
+ });
+ return deferred.promise;
+};
+TaskProcessor.prototype.isDestroyed = function() {
+ return false;
+};
+TaskProcessor.prototype.destroy = function() {
+ if (defined_default(this._worker)) {
+ this._worker.terminate();
+ }
+ return destroyObject_default(this);
+};
+TaskProcessor.taskCompletedEvent = taskCompletedEvent;
+TaskProcessor._defaultWorkerModulePrefix = "Workers/";
+TaskProcessor._workerModulePrefix = TaskProcessor._defaultWorkerModulePrefix;
+TaskProcessor._canTransferArrayBuffer = void 0;
+var TaskProcessor_default = TaskProcessor;
+
+// Source/Core/KTX2Transcoder.js
+function KTX2Transcoder() {
+}
+KTX2Transcoder._transcodeTaskProcessor = new TaskProcessor_default(
+ "transcodeKTX2",
+ Number.POSITIVE_INFINITY
+);
+KTX2Transcoder._readyPromise = void 0;
+function makeReadyPromise() {
+ const readyPromise = KTX2Transcoder._transcodeTaskProcessor.initWebAssemblyModule({
+ modulePath: "ThirdParty/Workers/basis_transcoder.js",
+ wasmBinaryFile: "ThirdParty/basis_transcoder.wasm"
+ }).then(function() {
+ return KTX2Transcoder._transcodeTaskProcessor;
+ });
+ KTX2Transcoder._readyPromise = readyPromise;
+}
+KTX2Transcoder.transcode = function(ktx2Buffer, supportedTargetFormats) {
+ Check_default.defined("supportedTargetFormats", supportedTargetFormats);
+ if (!defined_default(KTX2Transcoder._readyPromise)) {
+ makeReadyPromise();
+ }
+ return KTX2Transcoder._readyPromise.then(function(taskProcessor3) {
+ let parameters;
+ if (ktx2Buffer instanceof ArrayBuffer) {
+ const view = new Uint8Array(ktx2Buffer);
+ parameters = {
+ supportedTargetFormats,
+ ktx2Buffer: view
+ };
+ return taskProcessor3.scheduleTask(parameters, [ktx2Buffer]);
+ }
+ parameters = {
+ supportedTargetFormats,
+ ktx2Buffer
+ };
+ return taskProcessor3.scheduleTask(parameters, [ktx2Buffer.buffer]);
+ }).then(function(result) {
+ const levelsLength = result.length;
+ const faceKeys = Object.keys(result[0]);
+ const faceKeysLength = faceKeys.length;
+ let i;
+ for (i = 0; i < levelsLength; i++) {
+ const faces2 = result[i];
+ for (let j = 0; j < faceKeysLength; j++) {
+ const face = faces2[faceKeys[j]];
+ faces2[faceKeys[j]] = new CompressedTextureBuffer_default(
+ face.internalFormat,
+ face.datatype,
+ face.width,
+ face.height,
+ face.levelBuffer
+ );
+ }
+ }
+ if (faceKeysLength === 1) {
+ for (i = 0; i < levelsLength; ++i) {
+ result[i] = result[i][faceKeys[0]];
+ }
+ if (levelsLength === 1) {
+ result = result[0];
+ }
+ }
+ return result;
+ }).catch(function(error) {
+ throw error;
+ });
+};
+var KTX2Transcoder_default = KTX2Transcoder;
+
+// Source/Core/loadKTX2.js
+var supportedTranscoderFormats;
+loadKTX2.setKTX2SupportedFormats = function(s3tc, pvrtc, astc, etc, etc1, bc7) {
+ supportedTranscoderFormats = {
+ s3tc,
+ pvrtc,
+ astc,
+ etc,
+ etc1,
+ bc7
+ };
+};
+function loadKTX2(resourceOrUrlOrBuffer) {
+ Check_default.defined("resourceOrUrlOrBuffer", resourceOrUrlOrBuffer);
+ let loadPromise;
+ if (resourceOrUrlOrBuffer instanceof ArrayBuffer || ArrayBuffer.isView(resourceOrUrlOrBuffer)) {
+ loadPromise = Promise.resolve(resourceOrUrlOrBuffer);
+ } else {
+ const resource = Resource_default.createIfNeeded(resourceOrUrlOrBuffer);
+ loadPromise = resource.fetchArrayBuffer();
+ }
+ return loadPromise.then(function(data) {
+ return KTX2Transcoder_default.transcode(data, supportedTranscoderFormats);
+ });
+}
+var loadKTX2_default = loadKTX2;
+
+// Source/Renderer/CubeMapFace.js
+function CubeMapFace(context, texture, textureTarget, targetFace, internalFormat, pixelFormat, pixelDatatype, size, preMultiplyAlpha, flipY, initialized) {
+ this._context = context;
+ this._texture = texture;
+ this._textureTarget = textureTarget;
+ this._targetFace = targetFace;
+ this._pixelDatatype = pixelDatatype;
+ this._internalFormat = internalFormat;
+ this._pixelFormat = pixelFormat;
+ this._size = size;
+ this._preMultiplyAlpha = preMultiplyAlpha;
+ this._flipY = flipY;
+ this._initialized = initialized;
+}
+Object.defineProperties(CubeMapFace.prototype, {
+ pixelFormat: {
+ get: function() {
+ return this._pixelFormat;
+ }
+ },
+ pixelDatatype: {
+ get: function() {
+ return this._pixelDatatype;
+ }
+ },
+ _target: {
+ get: function() {
+ return this._targetFace;
+ }
+ }
+});
+CubeMapFace.prototype.copyFrom = function(options) {
+ Check_default.defined("options", options);
+ const xOffset = defaultValue_default(options.xOffset, 0);
+ const yOffset = defaultValue_default(options.yOffset, 0);
+ Check_default.defined("options.source", options.source);
+ Check_default.typeOf.number.greaterThanOrEquals("xOffset", xOffset, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("yOffset", yOffset, 0);
+ if (xOffset + options.source.width > this._size) {
+ throw new DeveloperError_default(
+ "xOffset + options.source.width must be less than or equal to width."
+ );
+ }
+ if (yOffset + options.source.height > this._size) {
+ throw new DeveloperError_default(
+ "yOffset + options.source.height must be less than or equal to height."
+ );
+ }
+ const source = options.source;
+ const gl = this._context._gl;
+ const target = this._textureTarget;
+ const targetFace = this._targetFace;
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(target, this._texture);
+ const width = source.width;
+ const height = source.height;
+ let arrayBufferView = source.arrayBufferView;
+ const size = this._size;
+ const pixelFormat = this._pixelFormat;
+ const internalFormat = this._internalFormat;
+ const pixelDatatype = this._pixelDatatype;
+ const preMultiplyAlpha = this._preMultiplyAlpha;
+ const flipY = this._flipY;
+ const skipColorSpaceConversion = defaultValue_default(
+ options.skipColorSpaceConversion,
+ false
+ );
+ let unpackAlignment = 4;
+ if (defined_default(arrayBufferView)) {
+ unpackAlignment = PixelFormat_default.alignmentInBytes(
+ pixelFormat,
+ pixelDatatype,
+ width
+ );
+ }
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);
+ if (skipColorSpaceConversion) {
+ gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
+ } else {
+ gl.pixelStorei(
+ gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,
+ gl.BROWSER_DEFAULT_WEBGL
+ );
+ }
+ let uploaded = false;
+ if (!this._initialized) {
+ if (xOffset === 0 && yOffset === 0 && width === size && height === size) {
+ if (defined_default(arrayBufferView)) {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ if (flipY) {
+ arrayBufferView = PixelFormat_default.flipY(
+ arrayBufferView,
+ pixelFormat,
+ pixelDatatype,
+ size,
+ size
+ );
+ }
+ gl.texImage2D(
+ targetFace,
+ 0,
+ internalFormat,
+ size,
+ size,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, this._context),
+ arrayBufferView
+ );
+ } else {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
+ gl.texImage2D(
+ targetFace,
+ 0,
+ internalFormat,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, this._context),
+ source
+ );
+ }
+ uploaded = true;
+ } else {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ const bufferView = PixelFormat_default.createTypedArray(
+ pixelFormat,
+ pixelDatatype,
+ size,
+ size
+ );
+ gl.texImage2D(
+ targetFace,
+ 0,
+ internalFormat,
+ size,
+ size,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, this._context),
+ bufferView
+ );
+ }
+ this._initialized = true;
+ }
+ if (!uploaded) {
+ if (defined_default(arrayBufferView)) {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ if (flipY) {
+ arrayBufferView = PixelFormat_default.flipY(
+ arrayBufferView,
+ pixelFormat,
+ pixelDatatype,
+ width,
+ height
+ );
+ }
+ gl.texSubImage2D(
+ targetFace,
+ 0,
+ xOffset,
+ yOffset,
+ width,
+ height,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, this._context),
+ arrayBufferView
+ );
+ } else {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
+ gl.texSubImage2D(
+ targetFace,
+ 0,
+ xOffset,
+ yOffset,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, this._context),
+ source
+ );
+ }
+ }
+ gl.bindTexture(target, null);
+};
+CubeMapFace.prototype.copyFromFramebuffer = function(xOffset, yOffset, framebufferXOffset, framebufferYOffset, width, height) {
+ xOffset = defaultValue_default(xOffset, 0);
+ yOffset = defaultValue_default(yOffset, 0);
+ framebufferXOffset = defaultValue_default(framebufferXOffset, 0);
+ framebufferYOffset = defaultValue_default(framebufferYOffset, 0);
+ width = defaultValue_default(width, this._size);
+ height = defaultValue_default(height, this._size);
+ Check_default.typeOf.number.greaterThanOrEquals("xOffset", xOffset, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("yOffset", yOffset, 0);
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "framebufferXOffset",
+ framebufferXOffset,
+ 0
+ );
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "framebufferYOffset",
+ framebufferYOffset,
+ 0
+ );
+ if (xOffset + width > this._size) {
+ throw new DeveloperError_default(
+ "xOffset + source.width must be less than or equal to width."
+ );
+ }
+ if (yOffset + height > this._size) {
+ throw new DeveloperError_default(
+ "yOffset + source.height must be less than or equal to height."
+ );
+ }
+ if (this._pixelDatatype === PixelDatatype_default.FLOAT) {
+ throw new DeveloperError_default(
+ "Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT."
+ );
+ }
+ if (this._pixelDatatype === PixelDatatype_default.HALF_FLOAT) {
+ throw new DeveloperError_default(
+ "Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT."
+ );
+ }
+ const gl = this._context._gl;
+ const target = this._textureTarget;
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(target, this._texture);
+ gl.copyTexSubImage2D(
+ this._targetFace,
+ 0,
+ xOffset,
+ yOffset,
+ framebufferXOffset,
+ framebufferYOffset,
+ width,
+ height
+ );
+ gl.bindTexture(target, null);
+ this._initialized = true;
+};
+var CubeMapFace_default = CubeMapFace;
+
+// Source/Renderer/MipmapHint.js
+var MipmapHint = {
+ DONT_CARE: WebGLConstants_default.DONT_CARE,
+ FASTEST: WebGLConstants_default.FASTEST,
+ NICEST: WebGLConstants_default.NICEST,
+ validate: function(mipmapHint) {
+ return mipmapHint === MipmapHint.DONT_CARE || mipmapHint === MipmapHint.FASTEST || mipmapHint === MipmapHint.NICEST;
+ }
+};
+var MipmapHint_default = Object.freeze(MipmapHint);
+
+// Source/Renderer/TextureMagnificationFilter.js
+var TextureMagnificationFilter = {
+ NEAREST: WebGLConstants_default.NEAREST,
+ LINEAR: WebGLConstants_default.LINEAR
+};
+TextureMagnificationFilter.validate = function(textureMagnificationFilter) {
+ return textureMagnificationFilter === TextureMagnificationFilter.NEAREST || textureMagnificationFilter === TextureMagnificationFilter.LINEAR;
+};
+var TextureMagnificationFilter_default = Object.freeze(TextureMagnificationFilter);
+
+// Source/Renderer/TextureMinificationFilter.js
+var TextureMinificationFilter = {
+ NEAREST: WebGLConstants_default.NEAREST,
+ LINEAR: WebGLConstants_default.LINEAR,
+ NEAREST_MIPMAP_NEAREST: WebGLConstants_default.NEAREST_MIPMAP_NEAREST,
+ LINEAR_MIPMAP_NEAREST: WebGLConstants_default.LINEAR_MIPMAP_NEAREST,
+ NEAREST_MIPMAP_LINEAR: WebGLConstants_default.NEAREST_MIPMAP_LINEAR,
+ LINEAR_MIPMAP_LINEAR: WebGLConstants_default.LINEAR_MIPMAP_LINEAR
+};
+TextureMinificationFilter.validate = function(textureMinificationFilter) {
+ return textureMinificationFilter === TextureMinificationFilter.NEAREST || textureMinificationFilter === TextureMinificationFilter.LINEAR || textureMinificationFilter === TextureMinificationFilter.NEAREST_MIPMAP_NEAREST || textureMinificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_NEAREST || textureMinificationFilter === TextureMinificationFilter.NEAREST_MIPMAP_LINEAR || textureMinificationFilter === TextureMinificationFilter.LINEAR_MIPMAP_LINEAR;
+};
+var TextureMinificationFilter_default = Object.freeze(TextureMinificationFilter);
+
+// Source/Renderer/TextureWrap.js
+var TextureWrap = {
+ CLAMP_TO_EDGE: WebGLConstants_default.CLAMP_TO_EDGE,
+ REPEAT: WebGLConstants_default.REPEAT,
+ MIRRORED_REPEAT: WebGLConstants_default.MIRRORED_REPEAT,
+ validate: function(textureWrap) {
+ return textureWrap === TextureWrap.CLAMP_TO_EDGE || textureWrap === TextureWrap.REPEAT || textureWrap === TextureWrap.MIRRORED_REPEAT;
+ }
+};
+var TextureWrap_default = Object.freeze(TextureWrap);
+
+// Source/Renderer/Sampler.js
+function Sampler(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const wrapS = defaultValue_default(options.wrapS, TextureWrap_default.CLAMP_TO_EDGE);
+ const wrapT = defaultValue_default(options.wrapT, TextureWrap_default.CLAMP_TO_EDGE);
+ const minificationFilter = defaultValue_default(
+ options.minificationFilter,
+ TextureMinificationFilter_default.LINEAR
+ );
+ const magnificationFilter = defaultValue_default(
+ options.magnificationFilter,
+ TextureMagnificationFilter_default.LINEAR
+ );
+ const maximumAnisotropy = defined_default(options.maximumAnisotropy) ? options.maximumAnisotropy : 1;
+ if (!TextureWrap_default.validate(wrapS)) {
+ throw new DeveloperError_default("Invalid sampler.wrapS.");
+ }
+ if (!TextureWrap_default.validate(wrapT)) {
+ throw new DeveloperError_default("Invalid sampler.wrapT.");
+ }
+ if (!TextureMinificationFilter_default.validate(minificationFilter)) {
+ throw new DeveloperError_default("Invalid sampler.minificationFilter.");
+ }
+ if (!TextureMagnificationFilter_default.validate(magnificationFilter)) {
+ throw new DeveloperError_default("Invalid sampler.magnificationFilter.");
+ }
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "maximumAnisotropy",
+ maximumAnisotropy,
+ 1
+ );
+ this._wrapS = wrapS;
+ this._wrapT = wrapT;
+ this._minificationFilter = minificationFilter;
+ this._magnificationFilter = magnificationFilter;
+ this._maximumAnisotropy = maximumAnisotropy;
+}
+Object.defineProperties(Sampler.prototype, {
+ wrapS: {
+ get: function() {
+ return this._wrapS;
+ }
+ },
+ wrapT: {
+ get: function() {
+ return this._wrapT;
+ }
+ },
+ minificationFilter: {
+ get: function() {
+ return this._minificationFilter;
+ }
+ },
+ magnificationFilter: {
+ get: function() {
+ return this._magnificationFilter;
+ }
+ },
+ maximumAnisotropy: {
+ get: function() {
+ return this._maximumAnisotropy;
+ }
+ }
+});
+Sampler.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left._wrapS === right._wrapS && left._wrapT === right._wrapT && left._minificationFilter === right._minificationFilter && left._magnificationFilter === right._magnificationFilter && left._maximumAnisotropy === right._maximumAnisotropy;
+};
+Sampler.NEAREST = Object.freeze(
+ new Sampler({
+ wrapS: TextureWrap_default.CLAMP_TO_EDGE,
+ wrapT: TextureWrap_default.CLAMP_TO_EDGE,
+ minificationFilter: TextureMinificationFilter_default.NEAREST,
+ magnificationFilter: TextureMagnificationFilter_default.NEAREST
+ })
+);
+var Sampler_default = Sampler;
+
+// Source/Renderer/CubeMap.js
+function CubeMap(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.context", options.context);
+ const context = options.context;
+ const source = options.source;
+ let width;
+ let height;
+ if (defined_default(source)) {
+ const faces2 = [
+ source.positiveX,
+ source.negativeX,
+ source.positiveY,
+ source.negativeY,
+ source.positiveZ,
+ source.negativeZ
+ ];
+ if (!faces2[0] || !faces2[1] || !faces2[2] || !faces2[3] || !faces2[4] || !faces2[5]) {
+ throw new DeveloperError_default(
+ "options.source requires positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ faces."
+ );
+ }
+ width = faces2[0].width;
+ height = faces2[0].height;
+ for (let i = 1; i < 6; ++i) {
+ if (Number(faces2[i].width) !== width || Number(faces2[i].height) !== height) {
+ throw new DeveloperError_default(
+ "Each face in options.source must have the same width and height."
+ );
+ }
+ }
+ } else {
+ width = options.width;
+ height = options.height;
+ }
+ const size = width;
+ const pixelDatatype = defaultValue_default(
+ options.pixelDatatype,
+ PixelDatatype_default.UNSIGNED_BYTE
+ );
+ const pixelFormat = defaultValue_default(options.pixelFormat, PixelFormat_default.RGBA);
+ const internalFormat = PixelFormat_default.toInternalFormat(
+ pixelFormat,
+ pixelDatatype,
+ context
+ );
+ if (!defined_default(width) || !defined_default(height)) {
+ throw new DeveloperError_default(
+ "options requires a source field to create an initialized cube map or width and height fields to create a blank cube map."
+ );
+ }
+ if (width !== height) {
+ throw new DeveloperError_default("Width must equal height.");
+ }
+ if (size <= 0) {
+ throw new DeveloperError_default("Width and height must be greater than zero.");
+ }
+ if (size > ContextLimits_default.maximumCubeMapSize) {
+ throw new DeveloperError_default(
+ `Width and height must be less than or equal to the maximum cube map size (${ContextLimits_default.maximumCubeMapSize}). Check maximumCubeMapSize.`
+ );
+ }
+ if (!PixelFormat_default.validate(pixelFormat)) {
+ throw new DeveloperError_default("Invalid options.pixelFormat.");
+ }
+ if (PixelFormat_default.isDepthFormat(pixelFormat)) {
+ throw new DeveloperError_default(
+ "options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL."
+ );
+ }
+ if (!PixelDatatype_default.validate(pixelDatatype)) {
+ throw new DeveloperError_default("Invalid options.pixelDatatype.");
+ }
+ if (pixelDatatype === PixelDatatype_default.FLOAT && !context.floatingPointTexture) {
+ throw new DeveloperError_default(
+ "When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension."
+ );
+ }
+ if (pixelDatatype === PixelDatatype_default.HALF_FLOAT && !context.halfFloatingPointTexture) {
+ throw new DeveloperError_default(
+ "When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension."
+ );
+ }
+ const sizeInBytes = PixelFormat_default.textureSizeInBytes(pixelFormat, pixelDatatype, size, size) * 6;
+ const preMultiplyAlpha = options.preMultiplyAlpha || pixelFormat === PixelFormat_default.RGB || pixelFormat === PixelFormat_default.LUMINANCE;
+ const flipY = defaultValue_default(options.flipY, true);
+ const skipColorSpaceConversion = defaultValue_default(
+ options.skipColorSpaceConversion,
+ false
+ );
+ const gl = context._gl;
+ const textureTarget = gl.TEXTURE_CUBE_MAP;
+ const texture = gl.createTexture();
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(textureTarget, texture);
+ function createFace(target, sourceFace, preMultiplyAlpha2, flipY2, skipColorSpaceConversion2) {
+ let arrayBufferView = sourceFace.arrayBufferView;
+ if (!defined_default(arrayBufferView)) {
+ arrayBufferView = sourceFace.bufferView;
+ }
+ let unpackAlignment = 4;
+ if (defined_default(arrayBufferView)) {
+ unpackAlignment = PixelFormat_default.alignmentInBytes(
+ pixelFormat,
+ pixelDatatype,
+ width
+ );
+ }
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);
+ if (skipColorSpaceConversion2) {
+ gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
+ } else {
+ gl.pixelStorei(
+ gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,
+ gl.BROWSER_DEFAULT_WEBGL
+ );
+ }
+ if (defined_default(arrayBufferView)) {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ if (flipY2) {
+ arrayBufferView = PixelFormat_default.flipY(
+ arrayBufferView,
+ pixelFormat,
+ pixelDatatype,
+ size,
+ size
+ );
+ }
+ gl.texImage2D(
+ target,
+ 0,
+ internalFormat,
+ size,
+ size,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ arrayBufferView
+ );
+ } else {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha2);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY2);
+ gl.texImage2D(
+ target,
+ 0,
+ internalFormat,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ sourceFace
+ );
+ }
+ }
+ if (defined_default(source)) {
+ createFace(
+ gl.TEXTURE_CUBE_MAP_POSITIVE_X,
+ source.positiveX,
+ preMultiplyAlpha,
+ flipY,
+ skipColorSpaceConversion
+ );
+ createFace(
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X,
+ source.negativeX,
+ preMultiplyAlpha,
+ flipY,
+ skipColorSpaceConversion
+ );
+ createFace(
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y,
+ source.positiveY,
+ preMultiplyAlpha,
+ flipY,
+ skipColorSpaceConversion
+ );
+ createFace(
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,
+ source.negativeY,
+ preMultiplyAlpha,
+ flipY,
+ skipColorSpaceConversion
+ );
+ createFace(
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z,
+ source.positiveZ,
+ preMultiplyAlpha,
+ flipY,
+ skipColorSpaceConversion
+ );
+ createFace(
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,
+ source.negativeZ,
+ preMultiplyAlpha,
+ flipY,
+ skipColorSpaceConversion
+ );
+ } else {
+ gl.texImage2D(
+ gl.TEXTURE_CUBE_MAP_POSITIVE_X,
+ 0,
+ internalFormat,
+ size,
+ size,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ null
+ );
+ gl.texImage2D(
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X,
+ 0,
+ internalFormat,
+ size,
+ size,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ null
+ );
+ gl.texImage2D(
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y,
+ 0,
+ internalFormat,
+ size,
+ size,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ null
+ );
+ gl.texImage2D(
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,
+ 0,
+ internalFormat,
+ size,
+ size,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ null
+ );
+ gl.texImage2D(
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z,
+ 0,
+ internalFormat,
+ size,
+ size,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ null
+ );
+ gl.texImage2D(
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,
+ 0,
+ internalFormat,
+ size,
+ size,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ null
+ );
+ }
+ gl.bindTexture(textureTarget, null);
+ this._context = context;
+ this._textureFilterAnisotropic = context._textureFilterAnisotropic;
+ this._textureTarget = textureTarget;
+ this._texture = texture;
+ this._pixelFormat = pixelFormat;
+ this._pixelDatatype = pixelDatatype;
+ this._size = size;
+ this._hasMipmap = false;
+ this._sizeInBytes = sizeInBytes;
+ this._preMultiplyAlpha = preMultiplyAlpha;
+ this._flipY = flipY;
+ this._sampler = void 0;
+ const initialized = defined_default(source);
+ this._positiveX = new CubeMapFace_default(
+ context,
+ texture,
+ textureTarget,
+ gl.TEXTURE_CUBE_MAP_POSITIVE_X,
+ internalFormat,
+ pixelFormat,
+ pixelDatatype,
+ size,
+ preMultiplyAlpha,
+ flipY,
+ initialized
+ );
+ this._negativeX = new CubeMapFace_default(
+ context,
+ texture,
+ textureTarget,
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_X,
+ internalFormat,
+ pixelFormat,
+ pixelDatatype,
+ size,
+ preMultiplyAlpha,
+ flipY,
+ initialized
+ );
+ this._positiveY = new CubeMapFace_default(
+ context,
+ texture,
+ textureTarget,
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Y,
+ internalFormat,
+ pixelFormat,
+ pixelDatatype,
+ size,
+ preMultiplyAlpha,
+ flipY,
+ initialized
+ );
+ this._negativeY = new CubeMapFace_default(
+ context,
+ texture,
+ textureTarget,
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Y,
+ internalFormat,
+ pixelFormat,
+ pixelDatatype,
+ size,
+ preMultiplyAlpha,
+ flipY,
+ initialized
+ );
+ this._positiveZ = new CubeMapFace_default(
+ context,
+ texture,
+ textureTarget,
+ gl.TEXTURE_CUBE_MAP_POSITIVE_Z,
+ internalFormat,
+ pixelFormat,
+ pixelDatatype,
+ size,
+ preMultiplyAlpha,
+ flipY,
+ initialized
+ );
+ this._negativeZ = new CubeMapFace_default(
+ context,
+ texture,
+ textureTarget,
+ gl.TEXTURE_CUBE_MAP_NEGATIVE_Z,
+ internalFormat,
+ pixelFormat,
+ pixelDatatype,
+ size,
+ preMultiplyAlpha,
+ flipY,
+ initialized
+ );
+ this.sampler = defined_default(options.sampler) ? options.sampler : new Sampler_default();
+}
+Object.defineProperties(CubeMap.prototype, {
+ positiveX: {
+ get: function() {
+ return this._positiveX;
+ }
+ },
+ negativeX: {
+ get: function() {
+ return this._negativeX;
+ }
+ },
+ positiveY: {
+ get: function() {
+ return this._positiveY;
+ }
+ },
+ negativeY: {
+ get: function() {
+ return this._negativeY;
+ }
+ },
+ positiveZ: {
+ get: function() {
+ return this._positiveZ;
+ }
+ },
+ negativeZ: {
+ get: function() {
+ return this._negativeZ;
+ }
+ },
+ sampler: {
+ get: function() {
+ return this._sampler;
+ },
+ set: function(sampler) {
+ let minificationFilter = sampler.minificationFilter;
+ let magnificationFilter = sampler.magnificationFilter;
+ const mipmap = minificationFilter === TextureMinificationFilter_default.NEAREST_MIPMAP_NEAREST || minificationFilter === TextureMinificationFilter_default.NEAREST_MIPMAP_LINEAR || minificationFilter === TextureMinificationFilter_default.LINEAR_MIPMAP_NEAREST || minificationFilter === TextureMinificationFilter_default.LINEAR_MIPMAP_LINEAR;
+ const context = this._context;
+ const pixelDatatype = this._pixelDatatype;
+ if (pixelDatatype === PixelDatatype_default.FLOAT && !context.textureFloatLinear || pixelDatatype === PixelDatatype_default.HALF_FLOAT && !context.textureHalfFloatLinear) {
+ minificationFilter = mipmap ? TextureMinificationFilter_default.NEAREST_MIPMAP_NEAREST : TextureMinificationFilter_default.NEAREST;
+ magnificationFilter = TextureMagnificationFilter_default.NEAREST;
+ }
+ const gl = context._gl;
+ const target = this._textureTarget;
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(target, this._texture);
+ gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, minificationFilter);
+ gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, magnificationFilter);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_S, sampler.wrapS);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_T, sampler.wrapT);
+ if (defined_default(this._textureFilterAnisotropic)) {
+ gl.texParameteri(
+ target,
+ this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,
+ sampler.maximumAnisotropy
+ );
+ }
+ gl.bindTexture(target, null);
+ this._sampler = sampler;
+ }
+ },
+ pixelFormat: {
+ get: function() {
+ return this._pixelFormat;
+ }
+ },
+ pixelDatatype: {
+ get: function() {
+ return this._pixelDatatype;
+ }
+ },
+ width: {
+ get: function() {
+ return this._size;
+ }
+ },
+ height: {
+ get: function() {
+ return this._size;
+ }
+ },
+ sizeInBytes: {
+ get: function() {
+ if (this._hasMipmap) {
+ return Math.floor(this._sizeInBytes * 4 / 3);
+ }
+ return this._sizeInBytes;
+ }
+ },
+ preMultiplyAlpha: {
+ get: function() {
+ return this._preMultiplyAlpha;
+ }
+ },
+ flipY: {
+ get: function() {
+ return this._flipY;
+ }
+ },
+ _target: {
+ get: function() {
+ return this._textureTarget;
+ }
+ }
+});
+CubeMap.prototype.generateMipmap = function(hint) {
+ hint = defaultValue_default(hint, MipmapHint_default.DONT_CARE);
+ if (this._size > 1 && !Math_default.isPowerOfTwo(this._size)) {
+ throw new DeveloperError_default(
+ "width and height must be a power of two to call generateMipmap()."
+ );
+ }
+ if (!MipmapHint_default.validate(hint)) {
+ throw new DeveloperError_default("hint is invalid.");
+ }
+ this._hasMipmap = true;
+ const gl = this._context._gl;
+ const target = this._textureTarget;
+ gl.hint(gl.GENERATE_MIPMAP_HINT, hint);
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(target, this._texture);
+ gl.generateMipmap(target);
+ gl.bindTexture(target, null);
+};
+CubeMap.prototype.isDestroyed = function() {
+ return false;
+};
+CubeMap.prototype.destroy = function() {
+ this._context._gl.deleteTexture(this._texture);
+ this._positiveX = destroyObject_default(this._positiveX);
+ this._negativeX = destroyObject_default(this._negativeX);
+ this._positiveY = destroyObject_default(this._positiveY);
+ this._negativeY = destroyObject_default(this._negativeY);
+ this._positiveZ = destroyObject_default(this._positiveZ);
+ this._negativeZ = destroyObject_default(this._negativeZ);
+ return destroyObject_default(this);
+};
+var CubeMap_default = CubeMap;
+
+// Source/Renderer/PassState.js
+function PassState(context) {
+ this.context = context;
+ this.framebuffer = void 0;
+ this.blendingEnabled = void 0;
+ this.scissorTest = void 0;
+ this.viewport = void 0;
+}
+var PassState_default = PassState;
+
+// Source/Renderer/modernizeShader.js
+function modernizeShader(source, isFragmentShader) {
+ const outputDeclarationRegex = /#define OUTPUT_DECLARATION/;
+ const splitSource = source.split("\n");
+ if (/#version 300 es/g.test(source)) {
+ return source;
+ }
+ let outputDeclarationLine = -1;
+ let i, line;
+ for (i = 0; i < splitSource.length; ++i) {
+ line = splitSource[i];
+ if (outputDeclarationRegex.test(line)) {
+ outputDeclarationLine = i;
+ break;
+ }
+ }
+ if (outputDeclarationLine === -1) {
+ throw new DeveloperError_default("Could not find a #define OUTPUT_DECLARATION!");
+ }
+ const outputVariables = [];
+ for (i = 0; i < 10; i++) {
+ const fragDataString = `gl_FragData\\[${i}\\]`;
+ const newOutput = `czm_out${i}`;
+ const regex = new RegExp(fragDataString, "g");
+ if (regex.test(source)) {
+ setAdd(newOutput, outputVariables);
+ replaceInSourceString(fragDataString, newOutput, splitSource);
+ splitSource.splice(
+ outputDeclarationLine,
+ 0,
+ `layout(location = ${i}) out vec4 ${newOutput};`
+ );
+ outputDeclarationLine += 1;
+ }
+ }
+ const czmFragColor = "czm_fragColor";
+ if (findInSource("gl_FragColor", splitSource)) {
+ setAdd(czmFragColor, outputVariables);
+ replaceInSourceString("gl_FragColor", czmFragColor, splitSource);
+ splitSource.splice(
+ outputDeclarationLine,
+ 0,
+ "layout(location = 0) out vec4 czm_fragColor;"
+ );
+ outputDeclarationLine += 1;
+ }
+ const variableMap = getVariablePreprocessorBranch(
+ outputVariables,
+ splitSource
+ );
+ const lineAdds = {};
+ for (i = 0; i < splitSource.length; i++) {
+ line = splitSource[i];
+ for (const variable in variableMap) {
+ if (variableMap.hasOwnProperty(variable)) {
+ const matchVar = new RegExp(
+ `(layout)[^]+(out)[^]+(${variable})[^]+`,
+ "g"
+ );
+ if (matchVar.test(line)) {
+ lineAdds[line] = variable;
+ }
+ }
+ }
+ }
+ for (const layoutDeclaration in lineAdds) {
+ if (lineAdds.hasOwnProperty(layoutDeclaration)) {
+ const variableName = lineAdds[layoutDeclaration];
+ let lineNumber = splitSource.indexOf(layoutDeclaration);
+ const entry = variableMap[variableName];
+ const depth = entry.length;
+ for (let d = 0; d < depth; d++) {
+ splitSource.splice(lineNumber, 0, entry[d]);
+ }
+ lineNumber += depth + 1;
+ for (let d = depth - 1; d >= 0; d--) {
+ splitSource.splice(lineNumber, 0, `#endif //${entry[d]}`);
+ }
+ }
+ }
+ const webgl2UniqueID = "WEBGL_2";
+ const webgl2DefineMacro = `#define ${webgl2UniqueID}`;
+ const versionThree = "#version 300 es";
+ let foundVersion = false;
+ for (i = 0; i < splitSource.length; i++) {
+ if (/#version/.test(splitSource[i])) {
+ splitSource[i] = versionThree;
+ foundVersion = true;
+ break;
+ }
+ }
+ if (!foundVersion) {
+ splitSource.splice(0, 0, versionThree);
+ }
+ splitSource.splice(1, 0, webgl2DefineMacro);
+ removeExtension("EXT_draw_buffers", webgl2UniqueID, splitSource);
+ removeExtension("EXT_frag_depth", webgl2UniqueID, splitSource);
+ removeExtension("OES_standard_derivatives", webgl2UniqueID, splitSource);
+ replaceInSourceString("texture2D", "texture", splitSource);
+ replaceInSourceString("texture3D", "texture", splitSource);
+ replaceInSourceString("textureCube", "texture", splitSource);
+ replaceInSourceString("gl_FragDepthEXT", "gl_FragDepth", splitSource);
+ if (isFragmentShader) {
+ replaceInSourceString("varying", "in", splitSource);
+ } else {
+ replaceInSourceString("attribute", "in", splitSource);
+ replaceInSourceString("varying", "out", splitSource);
+ }
+ return compileSource(splitSource);
+}
+function replaceInSourceString(str, replacement, splitSource) {
+ const regexStr = `(^|[^\\w])(${str})($|[^\\w])`;
+ const regex = new RegExp(regexStr, "g");
+ const splitSourceLength = splitSource.length;
+ for (let i = 0; i < splitSourceLength; ++i) {
+ const line = splitSource[i];
+ splitSource[i] = line.replace(regex, `$1${replacement}$3`);
+ }
+}
+function replaceInSourceRegex(regex, replacement, splitSource) {
+ const splitSourceLength = splitSource.length;
+ for (let i = 0; i < splitSourceLength; ++i) {
+ const line = splitSource[i];
+ splitSource[i] = line.replace(regex, replacement);
+ }
+}
+function findInSource(str, splitSource) {
+ const regexStr = `(^|[^\\w])(${str})($|[^\\w])`;
+ const regex = new RegExp(regexStr, "g");
+ const splitSourceLength = splitSource.length;
+ for (let i = 0; i < splitSourceLength; ++i) {
+ const line = splitSource[i];
+ if (regex.test(line)) {
+ return true;
+ }
+ }
+ return false;
+}
+function compileSource(splitSource) {
+ let wholeSource = "";
+ const splitSourceLength = splitSource.length;
+ for (let i = 0; i < splitSourceLength; ++i) {
+ wholeSource += `${splitSource[i]}
+`;
+ }
+ return wholeSource;
+}
+function setAdd(variable, set2) {
+ if (set2.indexOf(variable) === -1) {
+ set2.push(variable);
+ }
+}
+function getVariablePreprocessorBranch(layoutVariables, splitSource) {
+ const variableMap = {};
+ const numLayoutVariables = layoutVariables.length;
+ const stack = [];
+ for (let i = 0; i < splitSource.length; ++i) {
+ const line = splitSource[i];
+ const hasIF = /(#ifdef|#if)/g.test(line);
+ const hasELSE = /#else/g.test(line);
+ const hasENDIF = /#endif/g.test(line);
+ if (hasIF) {
+ stack.push(line);
+ } else if (hasELSE) {
+ const top = stack[stack.length - 1];
+ let op = top.replace("ifdef", "ifndef");
+ if (/if/g.test(op)) {
+ op = op.replace(/(#if\s+)(\S*)([^]*)/, "$1!($2)$3");
+ }
+ stack.pop();
+ stack.push(op);
+ } else if (hasENDIF) {
+ stack.pop();
+ } else if (!/layout/g.test(line)) {
+ for (let varIndex = 0; varIndex < numLayoutVariables; ++varIndex) {
+ const varName = layoutVariables[varIndex];
+ if (line.indexOf(varName) !== -1) {
+ if (!defined_default(variableMap[varName])) {
+ variableMap[varName] = stack.slice();
+ } else {
+ variableMap[varName] = variableMap[varName].filter(function(x) {
+ return stack.indexOf(x) >= 0;
+ });
+ }
+ }
+ }
+ }
+ }
+ return variableMap;
+}
+function removeExtension(name, webgl2UniqueID, splitSource) {
+ const regex = `#extension\\s+GL_${name}\\s+:\\s+[a-zA-Z0-9]+\\s*$`;
+ replaceInSourceRegex(new RegExp(regex, "g"), "", splitSource);
+ replaceInSourceString(`GL_${name}`, webgl2UniqueID, splitSource);
+}
+var modernizeShader_default = modernizeShader;
+
+// Source/Shaders/Builtin/Constants/degreesPerRadian.js
+var degreesPerRadian_default = "/**\n * A built-in GLSL floating-point constant for converting radians to degrees.\n *\n * @alias czm_degreesPerRadian\n * @glslConstant\n *\n * @see CesiumMath.DEGREES_PER_RADIAN\n *\n * @example\n * // GLSL declaration\n * const float czm_degreesPerRadian = ...;\n *\n * // Example\n * float deg = czm_degreesPerRadian * rad;\n */\nconst float czm_degreesPerRadian = 57.29577951308232;\n";
+
+// Source/Shaders/Builtin/Constants/depthRange.js
+var depthRange_default = "/**\n * A built-in GLSL vec2 constant for defining the depth range.\n * This is a workaround to a bug where IE11 does not implement gl_DepthRange.\n *\n * @alias czm_depthRange\n * @glslConstant\n *\n * @example\n * // GLSL declaration\n * float depthRangeNear = czm_depthRange.near;\n * float depthRangeFar = czm_depthRange.far;\n *\n */\nconst czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n";
+
+// Source/Shaders/Builtin/Constants/epsilon1.js
+var epsilon1_default = "/**\n * 0.1\n *\n * @name czm_epsilon1\n * @glslConstant\n */\nconst float czm_epsilon1 = 0.1;\n";
+
+// Source/Shaders/Builtin/Constants/epsilon2.js
+var epsilon2_default = "/**\n * 0.01\n *\n * @name czm_epsilon2\n * @glslConstant\n */\nconst float czm_epsilon2 = 0.01;\n";
+
+// Source/Shaders/Builtin/Constants/epsilon3.js
+var epsilon3_default = "/**\n * 0.001\n *\n * @name czm_epsilon3\n * @glslConstant\n */\nconst float czm_epsilon3 = 0.001;\n";
+
+// Source/Shaders/Builtin/Constants/epsilon4.js
+var epsilon4_default = "/**\n * 0.0001\n *\n * @name czm_epsilon4\n * @glslConstant\n */\nconst float czm_epsilon4 = 0.0001;\n";
+
+// Source/Shaders/Builtin/Constants/epsilon5.js
+var epsilon5_default = "/**\n * 0.00001\n *\n * @name czm_epsilon5\n * @glslConstant\n */\nconst float czm_epsilon5 = 0.00001;\n";
+
+// Source/Shaders/Builtin/Constants/epsilon6.js
+var epsilon6_default = "/**\n * 0.000001\n *\n * @name czm_epsilon6\n * @glslConstant\n */\nconst float czm_epsilon6 = 0.000001;\n";
+
+// Source/Shaders/Builtin/Constants/epsilon7.js
+var epsilon7_default = "/**\n * 0.0000001\n *\n * @name czm_epsilon7\n * @glslConstant\n */\nconst float czm_epsilon7 = 0.0000001;\n";
+
+// Source/Shaders/Builtin/Constants/infinity.js
+var infinity_default = "/**\n * DOC_TBA\n *\n * @name czm_infinity\n * @glslConstant\n */\nconst float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp?\n";
+
+// Source/Shaders/Builtin/Constants/oneOverPi.js
+var oneOverPi_default = "/**\n * A built-in GLSL floating-point constant for 1/pi
.\n *\n * @alias czm_oneOverPi\n * @glslConstant\n *\n * @see CesiumMath.ONE_OVER_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_oneOverPi = ...;\n *\n * // Example\n * float pi = 1.0 / czm_oneOverPi;\n */\nconst float czm_oneOverPi = 0.3183098861837907;\n";
+
+// Source/Shaders/Builtin/Constants/oneOverTwoPi.js
+var oneOverTwoPi_default = "/**\n * A built-in GLSL floating-point constant for 1/2pi
.\n *\n * @alias czm_oneOverTwoPi\n * @glslConstant\n *\n * @see CesiumMath.ONE_OVER_TWO_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_oneOverTwoPi = ...;\n *\n * // Example\n * float pi = 2.0 * czm_oneOverTwoPi;\n */\nconst float czm_oneOverTwoPi = 0.15915494309189535;\n";
+
+// Source/Shaders/Builtin/Constants/passCesium3DTile.js
+var passCesium3DTile_default = "/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}\n *\n * @name czm_passCesium3DTile\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTile = 4.0;\n";
+
+// Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js
+var passCesium3DTileClassification_default = "/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}\n *\n * @name czm_passCesium3DTileClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTileClassification = 5.0;\n";
+
+// Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js
+var passCesium3DTileClassificationIgnoreShow_default = "/**\n * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}\n *\n * @name czm_passCesium3DTileClassificationIgnoreShow\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCesium3DTileClassificationIgnoreShow = 6.0;\n";
+
+// Source/Shaders/Builtin/Constants/passClassification.js
+var passClassification_default = "/**\n * The automatic GLSL constant for {@link Pass#CLASSIFICATION}\n *\n * @name czm_passClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passClassification = 7.0;\n";
+
+// Source/Shaders/Builtin/Constants/passCompute.js
+var passCompute_default = "/**\n * The automatic GLSL constant for {@link Pass#COMPUTE}\n *\n * @name czm_passCompute\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passCompute = 1.0;\n";
+
+// Source/Shaders/Builtin/Constants/passEnvironment.js
+var passEnvironment_default = "/**\n * The automatic GLSL constant for {@link Pass#ENVIRONMENT}\n *\n * @name czm_passEnvironment\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passEnvironment = 0.0;\n";
+
+// Source/Shaders/Builtin/Constants/passGlobe.js
+var passGlobe_default = "/**\n * The automatic GLSL constant for {@link Pass#GLOBE}\n *\n * @name czm_passGlobe\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passGlobe = 2.0;\n";
+
+// Source/Shaders/Builtin/Constants/passOpaque.js
+var passOpaque_default = "/**\n * The automatic GLSL constant for {@link Pass#OPAQUE}\n *\n * @name czm_passOpaque\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passOpaque = 7.0;\n";
+
+// Source/Shaders/Builtin/Constants/passOverlay.js
+var passOverlay_default = "/**\n * The automatic GLSL constant for {@link Pass#OVERLAY}\n *\n * @name czm_passOverlay\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passOverlay = 9.0;\n";
+
+// Source/Shaders/Builtin/Constants/passTerrainClassification.js
+var passTerrainClassification_default = "/**\n * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}\n *\n * @name czm_passTerrainClassification\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passTerrainClassification = 3.0;\n";
+
+// Source/Shaders/Builtin/Constants/passTranslucent.js
+var passTranslucent_default = "/**\n * The automatic GLSL constant for {@link Pass#TRANSLUCENT}\n *\n * @name czm_passTranslucent\n * @glslConstant\n *\n * @see czm_pass\n */\nconst float czm_passTranslucent = 8.0;\n";
+
+// Source/Shaders/Builtin/Constants/pi.js
+var pi_default = "/**\n * A built-in GLSL floating-point constant for Math.PI
.\n *\n * @alias czm_pi\n * @glslConstant\n *\n * @see CesiumMath.PI\n *\n * @example\n * // GLSL declaration\n * const float czm_pi = ...;\n *\n * // Example\n * float twoPi = 2.0 * czm_pi;\n */\nconst float czm_pi = 3.141592653589793;\n";
+
+// Source/Shaders/Builtin/Constants/piOverFour.js
+var piOverFour_default = "/**\n * A built-in GLSL floating-point constant for pi/4
.\n *\n * @alias czm_piOverFour\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_FOUR\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverFour = ...;\n *\n * // Example\n * float pi = 4.0 * czm_piOverFour;\n */\nconst float czm_piOverFour = 0.7853981633974483;\n";
+
+// Source/Shaders/Builtin/Constants/piOverSix.js
+var piOverSix_default = "/**\n * A built-in GLSL floating-point constant for pi/6
.\n *\n * @alias czm_piOverSix\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_SIX\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverSix = ...;\n *\n * // Example\n * float pi = 6.0 * czm_piOverSix;\n */\nconst float czm_piOverSix = 0.5235987755982988;\n";
+
+// Source/Shaders/Builtin/Constants/piOverThree.js
+var piOverThree_default = "/**\n * A built-in GLSL floating-point constant for pi/3
.\n *\n * @alias czm_piOverThree\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_THREE\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverThree = ...;\n *\n * // Example\n * float pi = 3.0 * czm_piOverThree;\n */\nconst float czm_piOverThree = 1.0471975511965976;\n";
+
+// Source/Shaders/Builtin/Constants/piOverTwo.js
+var piOverTwo_default = "/**\n * A built-in GLSL floating-point constant for pi/2
.\n *\n * @alias czm_piOverTwo\n * @glslConstant\n *\n * @see CesiumMath.PI_OVER_TWO\n *\n * @example\n * // GLSL declaration\n * const float czm_piOverTwo = ...;\n *\n * // Example\n * float pi = 2.0 * czm_piOverTwo;\n */\nconst float czm_piOverTwo = 1.5707963267948966;\n";
+
+// Source/Shaders/Builtin/Constants/radiansPerDegree.js
+var radiansPerDegree_default = "/**\n * A built-in GLSL floating-point constant for converting degrees to radians.\n *\n * @alias czm_radiansPerDegree\n * @glslConstant\n *\n * @see CesiumMath.RADIANS_PER_DEGREE\n *\n * @example\n * // GLSL declaration\n * const float czm_radiansPerDegree = ...;\n *\n * // Example\n * float rad = czm_radiansPerDegree * deg;\n */\nconst float czm_radiansPerDegree = 0.017453292519943295;\n";
+
+// Source/Shaders/Builtin/Constants/sceneMode2D.js
+var sceneMode2D_default = "/**\n * The constant identifier for the 2D {@link SceneMode}\n *\n * @name czm_sceneMode2D\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneModeColumbusView\n * @see czm_sceneMode3D\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneMode2D = 2.0;\n";
+
+// Source/Shaders/Builtin/Constants/sceneMode3D.js
+var sceneMode3D_default = "/**\n * The constant identifier for the 3D {@link SceneMode}\n *\n * @name czm_sceneMode3D\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneModeColumbusView\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneMode3D = 3.0;\n";
+
+// Source/Shaders/Builtin/Constants/sceneModeColumbusView.js
+var sceneModeColumbusView_default = "/**\n * The constant identifier for the Columbus View {@link SceneMode}\n *\n * @name czm_sceneModeColumbusView\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneMode3D\n * @see czm_sceneModeMorphing\n */\nconst float czm_sceneModeColumbusView = 1.0;\n";
+
+// Source/Shaders/Builtin/Constants/sceneModeMorphing.js
+var sceneModeMorphing_default = "/**\n * The constant identifier for the Morphing {@link SceneMode}\n *\n * @name czm_sceneModeMorphing\n * @glslConstant\n * @see czm_sceneMode\n * @see czm_sceneMode2D\n * @see czm_sceneModeColumbusView\n * @see czm_sceneMode3D\n */\nconst float czm_sceneModeMorphing = 0.0;\n";
+
+// Source/Shaders/Builtin/Constants/solarRadius.js
+var solarRadius_default = "/**\n * A built-in GLSL floating-point constant for one solar radius.\n *\n * @alias czm_solarRadius\n * @glslConstant\n *\n * @see CesiumMath.SOLAR_RADIUS\n *\n * @example\n * // GLSL declaration\n * const float czm_solarRadius = ...;\n */\nconst float czm_solarRadius = 695500000.0;\n";
+
+// Source/Shaders/Builtin/Constants/threePiOver2.js
+var threePiOver2_default = "/**\n * A built-in GLSL floating-point constant for 3pi/2
.\n *\n * @alias czm_threePiOver2\n * @glslConstant\n *\n * @see CesiumMath.THREE_PI_OVER_TWO\n *\n * @example\n * // GLSL declaration\n * const float czm_threePiOver2 = ...;\n *\n * // Example\n * float pi = (2.0 / 3.0) * czm_threePiOver2;\n */\nconst float czm_threePiOver2 = 4.71238898038469;\n";
+
+// Source/Shaders/Builtin/Constants/twoPi.js
+var twoPi_default = "/**\n * A built-in GLSL floating-point constant for 2pi
.\n *\n * @alias czm_twoPi\n * @glslConstant\n *\n * @see CesiumMath.TWO_PI\n *\n * @example\n * // GLSL declaration\n * const float czm_twoPi = ...;\n *\n * // Example\n * float pi = czm_twoPi / 2.0;\n */\nconst float czm_twoPi = 6.283185307179586;\n";
+
+// Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.js
+var webMercatorMaxLatitude_default = "/**\n * The maximum latitude, in radians, both North and South, supported by a Web Mercator\n * (EPSG:3857) projection. Technically, the Mercator projection is defined\n * for any latitude up to (but not including) 90 degrees, but it makes sense\n * to cut it off sooner because it grows exponentially with increasing latitude.\n * The logic behind this particular cutoff value, which is the one used by\n * Google Maps, Bing Maps, and Esri, is that it makes the projection\n * square. That is, the rectangle is equal in the X and Y directions.\n *\n * The constant value is computed as follows:\n * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))\n *\n * @name czm_webMercatorMaxLatitude\n * @glslConstant\n */\nconst float czm_webMercatorMaxLatitude = 1.4844222297453324;\n";
+
+// Source/Shaders/Builtin/Structs/depthRangeStruct.js
+var depthRangeStruct_default = "/**\n * @name czm_depthRangeStruct\n * @glslStruct\n */\nstruct czm_depthRangeStruct\n{\n float near;\n float far;\n};\n";
+
+// Source/Shaders/Builtin/Structs/material.js
+var material_default = "/**\n * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.\n *\n * @name czm_material\n * @glslStruct\n *\n * @property {vec3} diffuse Incoming light that scatters evenly in all directions.\n * @property {float} specular Intensity of incoming light reflecting in a single direction.\n * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.\n * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.\n * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.\n * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.\n */\nstruct czm_material\n{\n vec3 diffuse;\n float specular;\n float shininess;\n vec3 normal;\n vec3 emission;\n float alpha;\n};\n";
+
+// Source/Shaders/Builtin/Structs/materialInput.js
+var materialInput_default = "/**\n * Used as input to every material's czm_getMaterial function.\n *\n * @name czm_materialInput\n * @glslStruct\n *\n * @property {float} s 1D texture coordinates.\n * @property {vec2} st 2D texture coordinates.\n * @property {vec3} str 3D texture coordinates.\n * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.\n * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.\n * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye.\n * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials.\n * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials.\n * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials.\n */\nstruct czm_materialInput\n{\n float s;\n vec2 st;\n vec3 str;\n vec3 normalEC;\n mat3 tangentToEyeMatrix;\n vec3 positionToEyeEC;\n float height;\n float slope;\n float aspect;\n};\n";
+
+// Source/Shaders/Builtin/Structs/modelMaterial.js
+var modelMaterial_default = "/**\n * Struct for representing a material for a {@link Model}. The model\n * rendering pipeline will pass this struct between material, custom shaders,\n * and lighting stages. This is not to be confused with {@link czm_material}\n * which is used by the older Fabric materials system, although they are similar.\n * \n * All color values (diffuse, specular, emissive) are in linear color space.\n *
\n *\n * @name czm_modelMaterial\n * @glslStruct\n *\n * @property {vec3} diffuse Incoming light that scatters evenly in all directions.\n * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.\n * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.\n * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.\n * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.\n * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.\n * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.\n */\nstruct czm_modelMaterial {\n vec3 diffuse;\n float alpha;\n vec3 specular;\n float roughness;\n vec3 normalEC;\n float occlusion;\n vec3 emissive;\n};\n";
+
+// Source/Shaders/Builtin/Structs/modelVertexOutput.js
+var modelVertexOutput_default = "/**\n * Struct for representing the output of a custom vertex shader.\n * \n * @name czm_modelVertexOutput\n * @glslStruct\n *\n * @see {@link CustomShader}\n * @see {@link Model}\n *\n * @property {vec3} positionMC The position of the vertex in model coordinates\n * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. \n */\nstruct czm_modelVertexOutput {\n vec3 positionMC;\n float pointSize;\n};\n";
+
+// Source/Shaders/Builtin/Structs/pbrParameters.js
+var pbrParameters_default = "/**\n * Parameters for {@link czm_pbrLighting}\n *\n * @name czm_material\n * @glslStruct\n *\n * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation\n * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is.\n * @property {vec3} f0 The reflectance of the material at normal incidence\n */\nstruct czm_pbrParameters\n{\n vec3 diffuseColor;\n float roughness;\n vec3 f0;\n};\n";
+
+// Source/Shaders/Builtin/Structs/ray.js
+var ray_default = "/**\n * DOC_TBA\n *\n * @name czm_ray\n * @glslStruct\n */\nstruct czm_ray\n{\n vec3 origin;\n vec3 direction;\n};\n";
+
+// Source/Shaders/Builtin/Structs/raySegment.js
+var raySegment_default = "/**\n * DOC_TBA\n *\n * @name czm_raySegment\n * @glslStruct\n */\nstruct czm_raySegment\n{\n float start;\n float stop;\n};\n\n/**\n * DOC_TBA\n *\n * @name czm_emptyRaySegment\n * @glslConstant \n */\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\n\n/**\n * DOC_TBA\n *\n * @name czm_fullRaySegment\n * @glslConstant \n */\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n";
+
+// Source/Shaders/Builtin/Structs/shadowParameters.js
+var shadowParameters_default = "struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\n vec3 texCoords;\n#else\n vec2 texCoords;\n#endif\n\n float depthBias;\n float depth;\n float nDotL;\n vec2 texelStepSize;\n float normalShadingSmooth;\n float darkness;\n};\n";
+
+// Source/Shaders/Builtin/Functions/acesTonemapping.js
+var acesTonemapping_default = "// See:\n// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/\n\nvec3 czm_acesTonemapping(vec3 color) {\n float g = 0.985;\n float a = 0.065;\n float b = 0.0001;\n float c = 0.433;\n float d = 0.238;\n\n color = (color * (color + a) - b) / (color * (g * color + c) + d);\n\n color = clamp(color, 0.0, 1.0);\n\n return color;\n}\n";
+
+// Source/Shaders/Builtin/Functions/alphaWeight.js
+var alphaWeight_default = "/**\n * @private\n */\nfloat czm_alphaWeight(float a)\n{\n float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\n\n // See Weighted Blended Order-Independent Transparency for examples of different weighting functions:\n // http://jcgt.org/published/0002/02/09/\n return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));\n}\n";
+
+// Source/Shaders/Builtin/Functions/antialias.js
+var antialias_default = "/**\n * Procedural anti-aliasing by blurring two colors that meet at a sharp edge.\n *\n * @name czm_antialias\n * @glslFunction\n *\n * @param {vec4} color1 The color on one side of the edge.\n * @param {vec4} color2 The color on the other side of the edge.\n * @param {vec4} currentcolor The current color, either color1
or color2
.\n * @param {float} dist The distance to the edge in texture coordinates.\n * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.\n * @returns {vec4} The anti-aliased color.\n *\n * @example\n * // GLSL declarations\n * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);\n * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);\n *\n * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space\n * float dist = abs(textureCoordinates.t - 0.5);\n * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));\n * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);\n */\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\n float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\n float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\n val1 = val1 * (1.0 - val2);\n val1 = val1 * val1 * (3.0 - (2.0 * val1));\n val1 = pow(val1, 0.5); //makes the transition nicer\n \n vec4 midColor = (color1 + color2) * 0.5;\n return mix(midColor, currentColor, val1);\n}\n\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\n return czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n";
+
+// Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.js
+var approximateSphericalCoordinates_default = "/**\n * Approximately computes spherical coordinates given a normal.\n * Uses approximate inverse trigonometry for speed and consistency,\n * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.\n *\n * @name czm_approximateSphericalCoordinates\n * @glslFunction\n *\n * @param {vec3} normal arbitrary-length normal.\n *\n * @returns {vec2} Approximate latitude and longitude spherical coordinates.\n */\nvec2 czm_approximateSphericalCoordinates(vec3 normal) {\n // Project into plane with vertical for latitude\n float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);\n float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);\n return vec2(latitudeApproximation, longitudeApproximation);\n}\n";
+
+// Source/Shaders/Builtin/Functions/backFacing.js
+var backFacing_default = "/**\n * Determines if the fragment is back facing\n *\n * @name czm_backFacing\n * @glslFunction \n * \n * @returns {bool} true
if the fragment is back facing; otherwise, false
.\n */\nbool czm_backFacing()\n{\n // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.\n return gl_FrontFacing == false;\n}\n";
+
+// Source/Shaders/Builtin/Functions/branchFreeTernary.js
+var branchFreeTernary_default = "/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a float expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {float} a Value to return if the comparison is true.\n * @param {float} b Value to return if the comparison is false.\n *\n * @returns {float} equivalent of comparison ? a : b\n */\nfloat czm_branchFreeTernary(bool comparison, float a, float b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec2 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec2} a Value to return if the comparison is true.\n * @param {vec2} b Value to return if the comparison is false.\n *\n * @returns {vec2} equivalent of comparison ? a : b\n */\nvec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec3 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec3} a Value to return if the comparison is true.\n * @param {vec3} b Value to return if the comparison is false.\n *\n * @returns {vec3} equivalent of comparison ? a : b\n */\nvec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n\n/**\n * Branchless ternary operator to be used when it's inexpensive to explicitly\n * evaluate both possibilities for a vec4 expression.\n *\n * @name czm_branchFreeTernary\n * @glslFunction\n *\n * @param {bool} comparison A comparison statement\n * @param {vec3} a Value to return if the comparison is true.\n * @param {vec3} b Value to return if the comparison is false.\n *\n * @returns {vec3} equivalent of comparison ? a : b\n */\nvec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {\n float useA = float(comparison);\n return a * useA + b * (1.0 - useA);\n}\n";
+
+// Source/Shaders/Builtin/Functions/cascadeColor.js
+var cascadeColor_default = "\nvec4 czm_cascadeColor(vec4 weights)\n{\n return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\n vec4(0.0, 1.0, 0.0, 1.0) * weights.y +\n vec4(0.0, 0.0, 1.0, 1.0) * weights.z +\n vec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n";
+
+// Source/Shaders/Builtin/Functions/cascadeDistance.js
+var cascadeDistance_default = "\nuniform vec4 shadowMap_cascadeDistances;\n\nfloat czm_cascadeDistance(vec4 weights)\n{\n return dot(shadowMap_cascadeDistances, weights);\n}\n";
+
+// Source/Shaders/Builtin/Functions/cascadeMatrix.js
+var cascadeMatrix_default = "\nuniform mat4 shadowMap_cascadeMatrices[4];\n\nmat4 czm_cascadeMatrix(vec4 weights)\n{\n return shadowMap_cascadeMatrices[0] * weights.x +\n shadowMap_cascadeMatrices[1] * weights.y +\n shadowMap_cascadeMatrices[2] * weights.z +\n shadowMap_cascadeMatrices[3] * weights.w;\n}\n";
+
+// Source/Shaders/Builtin/Functions/cascadeWeights.js
+var cascadeWeights_default = "\nuniform vec4 shadowMap_cascadeSplits[2];\n\nvec4 czm_cascadeWeights(float depthEye)\n{\n // One component is set to 1.0 and all others set to 0.0.\n vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\n vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\n return near * far;\n}\n";
+
+// Source/Shaders/Builtin/Functions/columbusViewMorph.js
+var columbusViewMorph_default = "/**\n * DOC_TBA\n *\n * @name czm_columbusViewMorph\n * @glslFunction\n */\nvec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\n // Just linear for now.\n vec3 p = mix(position2D.xyz, position3D.xyz, time);\n return vec4(p, 1.0);\n}\n";
+
+// Source/Shaders/Builtin/Functions/computePosition.js
+var computePosition_default = "/**\n * Returns a position in model coordinates relative to eye taking into\n * account the current scene mode: 3D, 2D, or Columbus view.\n * \n * This uses standard position attributes, position3DHigh
, \n * position3DLow
, position2DHigh
, and position2DLow
, \n * and should be used when writing a vertex shader for an {@link Appearance}.\n *
\n *\n * @name czm_computePosition\n * @glslFunction\n *\n * @returns {vec4} The position relative to eye.\n *\n * @example\n * vec4 p = czm_computePosition();\n * v_positionEC = (czm_modelViewRelativeToEye * p).xyz;\n * gl_Position = czm_modelViewProjectionRelativeToEye * p;\n *\n * @see czm_translateRelativeToEye\n */\nvec4 czm_computePosition();\n";
+
+// Source/Shaders/Builtin/Functions/cosineAndSine.js
+var cosineAndSine_default = "/**\n * @private\n */\nvec2 cordic(float angle)\n{\n// Scale the vector by the appropriate factor for the 24 iterations to follow.\n vec2 vector = vec2(6.0725293500888267e-1, 0.0);\n// Iteration 1\n float sense = (angle < 0.0) ? -1.0 : 1.0;\n // float factor = sense * 1.0; // 2^-0\n mat2 rotation = mat2(1.0, sense, -sense, 1.0);\n vector = rotation * vector;\n angle -= sense * 7.8539816339744828e-1; // atan(2^-0)\n// Iteration 2\n sense = (angle < 0.0) ? -1.0 : 1.0;\n float factor = sense * 5.0e-1; // 2^-1\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 4.6364760900080609e-1; // atan(2^-1)\n// Iteration 3\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 2.5e-1; // 2^-2\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 2.4497866312686414e-1; // atan(2^-2)\n// Iteration 4\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.25e-1; // 2^-3\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.2435499454676144e-1; // atan(2^-3)\n// Iteration 5\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 6.25e-2; // 2^-4\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 6.2418809995957350e-2; // atan(2^-4)\n// Iteration 6\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.125e-2; // 2^-5\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.1239833430268277e-2; // atan(2^-5)\n// Iteration 7\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.5625e-2; // 2^-6\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.5623728620476831e-2; // atan(2^-6)\n// Iteration 8\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 7.8125e-3; // 2^-7\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 7.8123410601011111e-3; // atan(2^-7)\n// Iteration 9\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.90625e-3; // 2^-8\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.9062301319669718e-3; // atan(2^-8)\n// Iteration 10\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.953125e-3; // 2^-9\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.9531225164788188e-3; // atan(2^-9)\n// Iteration 11\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 9.765625e-4; // 2^-10\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 9.7656218955931946e-4; // atan(2^-10)\n// Iteration 12\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 4.8828125e-4; // 2^-11\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 4.8828121119489829e-4; // atan(2^-11)\n// Iteration 13\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 2.44140625e-4; // 2^-12\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 2.4414062014936177e-4; // atan(2^-12)\n// Iteration 14\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.220703125e-4; // 2^-13\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.2207031189367021e-4; // atan(2^-13)\n// Iteration 15\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 6.103515625e-5; // 2^-14\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 6.1035156174208773e-5; // atan(2^-14)\n// Iteration 16\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.0517578125e-5; // 2^-15\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.0517578115526096e-5; // atan(2^-15)\n// Iteration 17\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.52587890625e-5; // 2^-16\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.5258789061315762e-5; // atan(2^-16)\n// Iteration 18\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 7.62939453125e-6; // 2^-17\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 7.6293945311019700e-6; // atan(2^-17)\n// Iteration 19\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 3.814697265625e-6; // 2^-18\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 3.8146972656064961e-6; // atan(2^-18)\n// Iteration 20\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.9073486328125e-6; // 2^-19\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 1.9073486328101870e-6; // atan(2^-19)\n// Iteration 21\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 9.5367431640625e-7; // 2^-20\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 9.5367431640596084e-7; // atan(2^-20)\n// Iteration 22\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 4.76837158203125e-7; // 2^-21\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 4.7683715820308884e-7; // atan(2^-21)\n// Iteration 23\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 2.384185791015625e-7; // 2^-22\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n angle -= sense * 2.3841857910155797e-7; // atan(2^-22)\n// Iteration 24\n sense = (angle < 0.0) ? -1.0 : 1.0;\n factor = sense * 1.1920928955078125e-7; // 2^-23\n rotation[0][1] = factor;\n rotation[1][0] = -factor;\n vector = rotation * vector;\n// angle -= sense * 1.1920928955078068e-7; // atan(2^-23)\n\n return vector;\n}\n\n/**\n * Computes the cosine and sine of the provided angle using the CORDIC algorithm.\n *\n * @name czm_cosineAndSine\n * @glslFunction\n *\n * @param {float} angle The angle in radians.\n *\n * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).\n *\n * @example\n * vec2 v = czm_cosineAndSine(czm_piOverSix);\n * float cosine = v.x;\n * float sine = v.y;\n */\nvec2 czm_cosineAndSine(float angle)\n{\n if (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n {\n if (angle < 0.0)\n {\n return -cordic(angle + czm_pi);\n }\n else\n {\n return -cordic(angle - czm_pi);\n }\n }\n else\n {\n return cordic(angle);\n }\n}\n";
+
+// Source/Shaders/Builtin/Functions/decompressTextureCoordinates.js
+var decompressTextureCoordinates_default = "/**\n * Decompresses texture coordinates that were packed into a single float.\n *\n * @name czm_decompressTextureCoordinates\n * @glslFunction\n *\n * @param {float} encoded The compressed texture coordinates.\n * @returns {vec2} The decompressed texture coordinates.\n */\n vec2 czm_decompressTextureCoordinates(float encoded)\n {\n float temp = encoded / 4096.0;\n float xZeroTo4095 = floor(temp);\n float stx = xZeroTo4095 / 4095.0;\n float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\n return vec2(stx, sty);\n }\n";
+
+// Source/Shaders/Builtin/Functions/defaultPbrMaterial.js
+var defaultPbrMaterial_default = "/**\n * Get default parameters for physically based rendering. These defaults\n * describe a rough dielectric (non-metal) surface (e.g. rough plastic).\n *\n * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting}\n */\nczm_pbrParameters czm_defaultPbrMaterial()\n{\n czm_pbrParameters results;\n results.diffuseColor = vec3(1.0);\n results.roughness = 1.0;\n\n const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);\n results.f0 = REFLECTANCE_DIELECTRIC;\n return results;\n}\n";
+
+// Source/Shaders/Builtin/Functions/depthClamp.js
+var depthClamp_default = "// emulated noperspective\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\nvarying float v_WindowZ;\n#endif\n\n/**\n * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.\n * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, \n * capping the shadow volume. More information here: \n * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.\n *\n * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring \n * no geometry gets clipped by setting the clip space z value to 0.0 and then\n * sending the unaltered screen space z value (using emulated noperspective\n * interpolation) to the frag shader where it is clamped to [0,1] and then\n * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:\n * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.\n *\n * When GL_EXT_frag_depth is not available, which is the case on some mobile \n * devices, we must attempt to fix this only in the vertex shader. \n * The approach is to clamp the z value to the far plane, which closes the \n * shadow volume but also distorts the geometry, so there can still be artifacts\n * on frustum seams.\n *\n * @name czm_depthClamp\n * @glslFunction\n *\n * @param {vec4} coords The vertex in clip coordinates.\n * @returns {vec4} The modified vertex.\n *\n * @example\n * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));\n *\n * @see czm_writeDepthClamp\n */\nvec4 czm_depthClamp(vec4 coords)\n{\n#ifndef LOG_DEPTH\n#ifdef GL_EXT_frag_depth\n v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;\n coords.z = 0.0;\n#else\n coords.z = min(coords.z, coords.w);\n#endif\n#endif\n return coords;\n}\n";
+
+// Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js
+var eastNorthUpToEyeCoordinates_default = "/**\n * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system \n * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the \n * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.\n *
\n * The ellipsoid is assumed to be centered at the model coordinate's origin.\n *\n * @name czm_eastNorthUpToEyeCoordinates\n * @glslFunction\n *\n * @param {vec3} positionMC The position on the ellipsoid in model coordinates.\n * @param {vec3} normalEC The normalized ellipsoid surface normal, at positionMC
, in eye coordinates.\n *\n * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.\n *\n * @example\n * // Transform a vector defined in the east-north-up coordinate \n * // system, (0, 0, 1) which is the surface normal, to eye \n * // coordinates.\n * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\n * vec3 normalEC = m * vec3(0.0, 0.0, 1.0);\n */\nmat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\n vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates\n vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordiantes\n vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates\n\n return mat3(\n tangentEC.x, tangentEC.y, tangentEC.z,\n bitangentEC.x, bitangentEC.y, bitangentEC.z,\n normalEC.x, normalEC.y, normalEC.z);\n}\n";
+
+// Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.js
+var ellipsoidContainsPoint_default = "/**\n * DOC_TBA\n *\n * @name czm_ellipsoidContainsPoint\n * @glslFunction\n *\n */\nbool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)\n{\n vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\n return (dot(scaled, scaled) <= 1.0);\n}\n";
+
+// Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.js
+var ellipsoidWgs84TextureCoordinates_default = "/**\n * DOC_TBA\n *\n * @name czm_ellipsoidWgs84TextureCoordinates\n * @glslFunction\n */\nvec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\n return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n";
+
+// Source/Shaders/Builtin/Functions/equalsEpsilon.js
+var equalsEpsilon_default = "/**\n * Compares left
and right
componentwise. Returns true
\n * if they are within epsilon
and false
otherwise. The inputs\n * left
and right
can be float
s, vec2
s,\n * vec3
s, or vec4
s.\n *\n * @name czm_equalsEpsilon\n * @glslFunction\n *\n * @param {} left The first vector.\n * @param {} right The second vector.\n * @param {float} epsilon The epsilon to use for equality testing.\n * @returns {bool} true
if the components are within epsilon
and false
otherwise.\n *\n * @example\n * // GLSL declarations\n * bool czm_equalsEpsilon(float left, float right, float epsilon);\n * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);\n * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);\n * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);\n */\nbool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\n return all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\n\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\n return all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\n\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\n return all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\n\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\n return (abs(left - right) <= epsilon);\n}\n";
+
+// Source/Shaders/Builtin/Functions/eyeOffset.js
+var eyeOffset_default = "/**\n * DOC_TBA\n *\n * @name czm_eyeOffset\n * @glslFunction\n *\n * @param {vec4} positionEC DOC_TBA.\n * @param {vec3} eyeOffset DOC_TBA.\n *\n * @returns {vec4} DOC_TBA.\n */\nvec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\n // This equation is approximate in x and y.\n vec4 p = positionEC;\n vec4 zEyeOffset = normalize(p) * eyeOffset.z;\n p.xy += eyeOffset.xy + zEyeOffset.xy;\n p.z += zEyeOffset.z;\n return p;\n}\n";
+
+// Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.js
+var eyeToWindowCoordinates_default = "/**\n * Transforms a position from eye to window coordinates. The transformation\n * from eye to clip coordinates is done using {@link czm_projection}.\n * The transform from normalized device coordinates to window coordinates is\n * done using {@link czm_viewportTransformation}, which assumes a depth range\n * of near = 0
and far = 1
.\n *
\n * This transform is useful when there is a need to manipulate window coordinates\n * in a vertex shader as done by {@link BillboardCollection}.\n *\n * @name czm_eyeToWindowCoordinates\n * @glslFunction\n *\n * @param {vec4} position The position in eye coordinates to transform.\n *\n * @returns {vec4} The transformed position in window coordinates.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_projection\n * @see czm_viewportTransformation\n * @see BillboardCollection\n *\n * @example\n * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\n */\nvec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\n vec4 q = czm_projection * positionEC; // clip coordinates\n q.xyz /= q.w; // normalized device coordinates\n q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates\n return q;\n}\n";
+
+// Source/Shaders/Builtin/Functions/fastApproximateAtan.js
+var fastApproximateAtan_default = `/**
+ * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.
+ *
+ * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on
+ * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
+ * Adapted from ShaderFastLibs under MIT License.
+ *
+ * Chosen for the following characteristics over range [0, 1]:
+ * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)
+ * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)
+ *
+ * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);
+ * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.
+ *
+ * @name czm_fastApproximateAtan
+ * @glslFunction
+ *
+ * @param {float} x Value between 0 and 1 inclusive.
+ *
+ * @returns {float} Approximation of atan(x)
+ */
+float czm_fastApproximateAtan(float x) {
+ return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
+}
+
+/**
+ * Approximation of atan2.
+ *
+ * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html
+ * However, we replaced their atan curve with Michael Drobot's (see above).
+ *
+ * @name czm_fastApproximateAtan
+ * @glslFunction
+ *
+ * @param {float} x Value between -1 and 1 inclusive.
+ * @param {float} y Value between -1 and 1 inclusive.
+ *
+ * @returns {float} Approximation of atan2(x, y)
+ */
+float czm_fastApproximateAtan(float x, float y) {
+ // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.
+ // So range-reduce using abs and by flipping whether x or y is on top.
+ float t = abs(x); // t used as swap and atan result.
+ float opposite = abs(y);
+ float adjacent = max(t, opposite);
+ opposite = min(t, opposite);
+
+ t = czm_fastApproximateAtan(opposite / adjacent);
+
+ // Undo range reduction
+ t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);
+ t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);
+ t = czm_branchFreeTernary(y < 0.0, -t, t);
+ return t;
+}
+`;
+
+// Source/Shaders/Builtin/Functions/fog.js
+var fog_default = "/**\n * Gets the color with fog at a distance from the camera.\n *\n * @name czm_fog\n * @glslFunction\n *\n * @param {float} distanceToCamera The distance to the camera in meters.\n * @param {vec3} color The original color.\n * @param {vec3} fogColor The color of the fog.\n *\n * @returns {vec3} The color adjusted for fog at the distance from the camera.\n */\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\n float scalar = distanceToCamera * czm_fogDensity;\n float fog = 1.0 - exp(-(scalar * scalar));\n return mix(color, fogColor, fog);\n}\n\n/**\n * Gets the color with fog at a distance from the camera.\n *\n * @name czm_fog\n * @glslFunction\n *\n * @param {float} distanceToCamera The distance to the camera in meters.\n * @param {vec3} color The original color.\n * @param {vec3} fogColor The color of the fog.\n * @param {float} fogModifierConstant A constant to modify the appearance of fog.\n *\n * @returns {vec3} The color adjusted for fog at the distance from the camera.\n */\nvec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)\n{\n float scalar = distanceToCamera * czm_fogDensity;\n float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));\n return mix(color, fogColor, fog);\n}\n";
+
+// Source/Shaders/Builtin/Functions/gammaCorrect.js
+var gammaCorrect_default = "/**\n * Converts a color from RGB space to linear space.\n *\n * @name czm_gammaCorrect\n * @glslFunction\n *\n * @param {vec3} color The color in RGB space.\n * @returns {vec3} The color in linear space.\n */\nvec3 czm_gammaCorrect(vec3 color) {\n#ifdef HDR\n color = pow(color, vec3(czm_gamma));\n#endif\n return color;\n}\n\nvec4 czm_gammaCorrect(vec4 color) {\n#ifdef HDR\n color.rgb = pow(color.rgb, vec3(czm_gamma));\n#endif\n return color;\n}\n";
+
+// Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.js
+var geodeticSurfaceNormal_default = "/**\n * DOC_TBA\n *\n * @name czm_geodeticSurfaceNormal\n * @glslFunction\n *\n * @param {vec3} positionOnEllipsoid DOC_TBA\n * @param {vec3} ellipsoidCenter DOC_TBA\n * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA\n * \n * @returns {vec3} DOC_TBA.\n */\nvec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\n return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n";
+
+// Source/Shaders/Builtin/Functions/getDefaultMaterial.js
+var getDefaultMaterial_default = "/**\n * An czm_material with default values. Every material's czm_getMaterial\n * should use this default material as a base for the material it returns.\n * The default normal value is given by materialInput.normalEC.\n *\n * @name czm_getDefaultMaterial\n * @glslFunction\n *\n * @param {czm_materialInput} input The input used to construct the default material.\n *\n * @returns {czm_material} The default material.\n *\n * @see czm_materialInput\n * @see czm_material\n * @see czm_getMaterial\n */\nczm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\n czm_material material;\n material.diffuse = vec3(0.0);\n material.specular = 0.0;\n material.shininess = 1.0;\n material.normal = materialInput.normalEC;\n material.emission = vec3(0.0);\n material.alpha = 1.0;\n return material;\n}\n";
+
+// Source/Shaders/Builtin/Functions/getLambertDiffuse.js
+var getLambertDiffuse_default = "/**\n * Calculates the intensity of diffusely reflected light.\n *\n * @name czm_getLambertDiffuse\n * @glslFunction\n *\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {vec3} normalEC The surface normal in eye coordinates.\n *\n * @returns {float} The intensity of the diffuse reflection.\n *\n * @see czm_phong\n *\n * @example\n * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\n * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\n * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\n */\nfloat czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\n return max(dot(lightDirectionEC, normalEC), 0.0);\n}\n";
+
+// Source/Shaders/Builtin/Functions/getSpecular.js
+var getSpecular_default = "/**\n * Calculates the specular intensity of reflected light.\n *\n * @name czm_getSpecular\n * @glslFunction\n *\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.\n * @param {vec3} normalEC The surface normal in eye coordinates.\n * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.\n *\n * @returns {float} The intensity of the specular highlight.\n *\n * @see czm_phong\n *\n * @example\n * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);\n * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);\n * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);\n */\nfloat czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\n vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\n float specular = max(dot(toReflectedLight, toEyeEC), 0.0);\n\n // pow has undefined behavior if both parameters <= 0.\n // Prevent this by making sure shininess is at least czm_epsilon2.\n return pow(specular, max(shininess, czm_epsilon2));\n}\n";
+
+// Source/Shaders/Builtin/Functions/getWaterNoise.js
+var getWaterNoise_default = "/**\n * @private\n */\nvec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\n float cosAngle = cos(angleInRadians);\n float sinAngle = sin(angleInRadians);\n\n // time dependent sampling directions\n vec2 s0 = vec2(1.0/17.0, 0.0);\n vec2 s1 = vec2(-1.0/29.0, 0.0);\n vec2 s2 = vec2(1.0/101.0, 1.0/59.0);\n vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\n\n // rotate sampling direction by specified angle\n s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\n s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\n s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\n s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\n\n vec2 uv0 = (uv/103.0) + (time * s0);\n vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\n vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\n vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\n\n uv0 = fract(uv0);\n uv1 = fract(uv1);\n uv2 = fract(uv2);\n uv3 = fract(uv3);\n vec4 noise = (texture2D(normalMap, uv0)) +\n (texture2D(normalMap, uv1)) +\n (texture2D(normalMap, uv2)) +\n (texture2D(normalMap, uv3));\n\n // average and scale to between -1 and 1\n return ((noise / 4.0) - 0.5) * 2.0;\n}\n";
+
+// Source/Shaders/Builtin/Functions/HSBToRGB.js
+var HSBToRGB_default = "/**\n * Converts an HSB color (hue, saturation, brightness) to RGB\n * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}\n *\n * @name czm_HSBToRGB\n * @glslFunction\n * \n * @param {vec3} hsb The color in HSB.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 hsb = czm_RGBToHSB(rgb);\n * hsb.z *= 0.1;\n * rgb = czm_HSBToRGB(hsb);\n */\n\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n\nvec3 czm_HSBToRGB(vec3 hsb)\n{\n vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\n return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\n}\n";
+
+// Source/Shaders/Builtin/Functions/HSLToRGB.js
+var HSLToRGB_default = "/**\n * Converts an HSL color (hue, saturation, lightness) to RGB\n * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}\n *\n * @name czm_HSLToRGB\n * @glslFunction\n * \n * @param {vec3} rgb The color in HSL.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 hsl = czm_RGBToHSL(rgb);\n * hsl.z *= 0.1;\n * rgb = czm_HSLToRGB(hsl);\n */\n\nvec3 hueToRGB(float hue)\n{\n float r = abs(hue * 6.0 - 3.0) - 1.0;\n float g = 2.0 - abs(hue * 6.0 - 2.0);\n float b = 2.0 - abs(hue * 6.0 - 4.0);\n return clamp(vec3(r, g, b), 0.0, 1.0);\n}\n\nvec3 czm_HSLToRGB(vec3 hsl)\n{\n vec3 rgb = hueToRGB(hsl.x);\n float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\n return (rgb - 0.5) * c + hsl.z;\n}\n";
+
+// Source/Shaders/Builtin/Functions/hue.js
+var hue_default = "/**\n * Adjusts the hue of a color.\n * \n * @name czm_hue\n * @glslFunction\n * \n * @param {vec3} rgb The color.\n * @param {float} adjustment The amount to adjust the hue of the color in radians.\n *\n * @returns {float} The color with the hue adjusted.\n *\n * @example\n * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)\n */\nvec3 czm_hue(vec3 rgb, float adjustment)\n{\n const mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n 0.595716, -0.274453, -0.321263,\n 0.211456, -0.522591, 0.311135);\n const mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n 1.0, -0.2721, -0.6474,\n 1.0, -1.107, 1.7046);\n \n vec3 yiq = toYIQ * rgb;\n float hue = atan(yiq.z, yiq.y) + adjustment;\n float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\n \n vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\n return toRGB * color;\n}\n";
+
+// Source/Shaders/Builtin/Functions/inverseGamma.js
+var inverseGamma_default = "/**\n * Converts a color in linear space to RGB space.\n *\n * @name czm_inverseGamma\n * @glslFunction\n *\n * @param {vec3} color The color in linear space.\n * @returns {vec3} The color in RGB space.\n */\nvec3 czm_inverseGamma(vec3 color) {\n return pow(color, vec3(1.0 / czm_gamma));\n}\n";
+
+// Source/Shaders/Builtin/Functions/isEmpty.js
+var isEmpty_default = "/**\n * Determines if a time interval is empty.\n *\n * @name czm_isEmpty\n * @glslFunction \n * \n * @param {czm_raySegment} interval The interval to test.\n * \n * @returns {bool} true
if the time interval is empty; otherwise, false
.\n *\n * @example\n * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true\n * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false\n * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.\n */\nbool czm_isEmpty(czm_raySegment interval)\n{\n return (interval.stop < 0.0);\n}\n";
+
+// Source/Shaders/Builtin/Functions/isFull.js
+var isFull_default = "/**\n * Determines if a time interval is empty.\n *\n * @name czm_isFull\n * @glslFunction \n * \n * @param {czm_raySegment} interval The interval to test.\n * \n * @returns {bool} true
if the time interval is empty; otherwise, false
.\n *\n * @example\n * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true\n * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false\n * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.\n */\nbool czm_isFull(czm_raySegment interval)\n{\n return (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n";
+
+// Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.js
+var latitudeToWebMercatorFraction_default = "/**\n * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.\n *\n * @name czm_latitudeToWebMercatorFraction\n * @glslFunction\n *\n * @param {float} latitude The geodetic latitude, in radians.\n * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.\n * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.\n *\n * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern\n * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return\n * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection.\n */ \nfloat czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\n float sinLatitude = sin(latitude);\n float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\n \n return (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n";
+
+// Source/Shaders/Builtin/Functions/linearToSrgb.js
+var linearToSrgb_default = "/**\n * Converts a linear RGB color to an sRGB color.\n *\n * @param {vec3|vec4} linearIn The color in linear color space.\n * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.\n */\nvec3 czm_linearToSrgb(vec3 linearIn) \n{\n return pow(linearIn, vec3(1.0/2.2));\n}\n\nvec4 czm_linearToSrgb(vec4 linearIn) \n{\n vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));\n return vec4(srgbOut, linearIn.a);\n}\n";
+
+// Source/Shaders/Builtin/Functions/lineDistance.js
+var lineDistance_default = "/**\n * Computes distance from an point in 2D to a line in 2D.\n *\n * @name czm_lineDistance\n * @glslFunction\n *\n * param {vec2} point1 A point along the line.\n * param {vec2} point2 A point along the line.\n * param {vec2} point A point that may or may not be on the line.\n * returns {float} The distance from the point to the line.\n */\nfloat czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {\n return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);\n}\n";
+
+// Source/Shaders/Builtin/Functions/luminance.js
+var luminance_default = "/**\n * Computes the luminance of a color. \n *\n * @name czm_luminance\n * @glslFunction\n *\n * @param {vec3} rgb The color.\n * \n * @returns {float} The luminance.\n *\n * @example\n * float light = czm_luminance(vec3(0.0)); // 0.0\n * float dark = czm_luminance(vec3(1.0)); // ~1.0 \n */\nfloat czm_luminance(vec3 rgb)\n{\n // Algorithm from Chapter 10 of Graphics Shaders.\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n return dot(rgb, W);\n}\n";
+
+// Source/Shaders/Builtin/Functions/metersPerPixel.js
+var metersPerPixel_default = "/**\n * Computes the size of a pixel in meters at a distance from the eye.\n * \n * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.\n *
\n * @name czm_metersPerPixel\n * @glslFunction\n *\n * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.\n * @param {float} pixelRatio The scaling factor from pixel space to coordinate space\n *\n * @returns {float} The meters per pixel at positionEC.\n */\nfloat czm_metersPerPixel(vec4 positionEC, float pixelRatio)\n{\n float width = czm_viewport.z;\n float height = czm_viewport.w;\n float pixelWidth;\n float pixelHeight;\n\n float top = czm_frustumPlanes.x;\n float bottom = czm_frustumPlanes.y;\n float left = czm_frustumPlanes.z;\n float right = czm_frustumPlanes.w;\n\n if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)\n {\n float frustumWidth = right - left;\n float frustumHeight = top - bottom;\n pixelWidth = frustumWidth / width;\n pixelHeight = frustumHeight / height;\n }\n else\n {\n float distanceToPixel = -positionEC.z;\n float inverseNear = 1.0 / czm_currentFrustum.x;\n float tanTheta = top * inverseNear;\n pixelHeight = 2.0 * distanceToPixel * tanTheta / height;\n tanTheta = right * inverseNear;\n pixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n }\n\n return max(pixelWidth, pixelHeight) * pixelRatio;\n}\n\n/**\n * Computes the size of a pixel in meters at a distance from the eye.\n * \n * Use this version when scaling by pixel ratio.\n *
\n * @name czm_metersPerPixel\n * @glslFunction\n *\n * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.\n *\n * @returns {float} The meters per pixel at positionEC.\n */\nfloat czm_metersPerPixel(vec4 positionEC)\n{\n return czm_metersPerPixel(positionEC, czm_pixelRatio);\n}\n";
+
+// Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js
+var modelToWindowCoordinates_default = "/**\n * Transforms a position from model to window coordinates. The transformation\n * from model to clip coordinates is done using {@link czm_modelViewProjection}.\n * The transform from normalized device coordinates to window coordinates is\n * done using {@link czm_viewportTransformation}, which assumes a depth range\n * of near = 0
and far = 1
.\n *
\n * This transform is useful when there is a need to manipulate window coordinates\n * in a vertex shader as done by {@link BillboardCollection}.\n *
\n * This function should not be confused with {@link czm_viewportOrthographic},\n * which is an orthographic projection matrix that transforms from window \n * coordinates to clip coordinates.\n *\n * @name czm_modelToWindowCoordinates\n * @glslFunction\n *\n * @param {vec4} position The position in model coordinates to transform.\n *\n * @returns {vec4} The transformed position in window coordinates.\n *\n * @see czm_eyeToWindowCoordinates\n * @see czm_modelViewProjection\n * @see czm_viewportTransformation\n * @see czm_viewportOrthographic\n * @see BillboardCollection\n *\n * @example\n * vec4 positionWC = czm_modelToWindowCoordinates(positionMC);\n */\nvec4 czm_modelToWindowCoordinates(vec4 position)\n{\n vec4 q = czm_modelViewProjection * position; // clip coordinates\n q.xyz /= q.w; // normalized device coordinates\n q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates\n return q;\n}\n";
+
+// Source/Shaders/Builtin/Functions/multiplyWithColorBalance.js
+var multiplyWithColorBalance_default = "/**\n * DOC_TBA\n *\n * @name czm_multiplyWithColorBalance\n * @glslFunction\n */\nvec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\n // Algorithm from Chapter 10 of Graphics Shaders.\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n \n vec3 target = left * right;\n float leftLuminance = dot(left, W);\n float rightLuminance = dot(right, W);\n float targetLuminance = dot(target, W);\n \n return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n";
+
+// Source/Shaders/Builtin/Functions/nearFarScalar.js
+var nearFarScalar_default = "/**\n * Computes a value that scales with distance. The scaling is clamped at the near and\n * far distances, and does not extrapolate. This function works with the\n * {@link NearFarScalar} JavaScript class.\n *\n * @name czm_nearFarScalar\n * @glslFunction\n *\n * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).\n * @param {float} cameraDistSq The square of the current distance from the camera.\n *\n * @returns {float} The value at this distance.\n */\nfloat czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\n float valueAtMin = nearFarScalar.y;\n float valueAtMax = nearFarScalar.w;\n float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\n float farDistanceSq = nearFarScalar.z * nearFarScalar.z;\n\n float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\n\n t = pow(clamp(t, 0.0, 1.0), 0.2);\n\n return mix(valueAtMin, valueAtMax, t);\n}\n";
+
+// Source/Shaders/Builtin/Functions/octDecode.js
+var octDecode_default = ` /**
+ * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
+ * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
+ * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
+ *
+ * @name czm_octDecode
+ * @param {vec2} encoded The oct-encoded, unit-length vector
+ * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
+ * @returns {vec3} The decoded and normalized vector
+ */
+ vec3 czm_octDecode(vec2 encoded, float range)
+ {
+ if (encoded.x == 0.0 && encoded.y == 0.0) {
+ return vec3(0.0, 0.0, 0.0);
+ }
+
+ encoded = encoded / range * 2.0 - 1.0;
+ vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));
+ if (v.z < 0.0)
+ {
+ v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);
+ }
+
+ return normalize(v);
+ }
+
+/**
+ * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
+ * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
+ * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
+ *
+ * @name czm_octDecode
+ * @param {vec2} encoded The oct-encoded, unit-length vector
+ * @returns {vec3} The decoded and normalized vector
+ */
+ vec3 czm_octDecode(vec2 encoded)
+ {
+ return czm_octDecode(encoded, 255.0);
+ }
+
+ /**
+ * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.
+ * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
+ * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
+ *
+ * @name czm_octDecode
+ * @param {float} encoded The oct-encoded, unit-length vector
+ * @returns {vec3} The decoded and normalized vector
+ */
+ vec3 czm_octDecode(float encoded)
+ {
+ float temp = encoded / 256.0;
+ float x = floor(temp);
+ float y = (temp - x) * 256.0;
+ return czm_octDecode(vec2(x, y));
+ }
+
+/**
+ * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.
+ * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
+ * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
+ *
+ * @name czm_octDecode
+ * @param {vec2} encoded The packed oct-encoded, unit-length vectors.
+ * @param {vec3} vector1 One decoded and normalized vector.
+ * @param {vec3} vector2 One decoded and normalized vector.
+ * @param {vec3} vector3 One decoded and normalized vector.
+ */
+ void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)
+ {
+ float temp = encoded.x / 65536.0;
+ float x = floor(temp);
+ float encodedFloat1 = (temp - x) * 65536.0;
+
+ temp = encoded.y / 65536.0;
+ float y = floor(temp);
+ float encodedFloat2 = (temp - y) * 65536.0;
+
+ vector1 = czm_octDecode(encodedFloat1);
+ vector2 = czm_octDecode(encodedFloat2);
+ vector3 = czm_octDecode(vec2(x, y));
+ }
+
+`;
+
+// Source/Shaders/Builtin/Functions/packDepth.js
+var packDepth_default = "/**\n * Packs a depth value into a vec3 that can be represented by unsigned bytes.\n *\n * @name czm_packDepth\n * @glslFunction\n *\n * @param {float} depth The floating-point depth.\n * @returns {vec3} The packed depth.\n */\nvec4 czm_packDepth(float depth)\n{\n // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA\n // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n return enc;\n}\n";
+
+// Source/Shaders/Builtin/Functions/pbrLighting.js
+var pbrLighting_default = "vec3 lambertianDiffuse(vec3 diffuseColor)\n{\n return diffuseColor / czm_pi;\n}\n\nvec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)\n{\n return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0);\n}\n\nfloat smithVisibilityG1(float NdotV, float roughness)\n{\n // this is the k value for direct lighting.\n // for image based lighting it will be roughness^2 / 2\n float k = (roughness + 1.0) * (roughness + 1.0) / 8.0;\n return NdotV / (NdotV * (1.0 - k) + k);\n}\n\nfloat smithVisibilityGGX(float roughness, float NdotL, float NdotV)\n{\n return (\n smithVisibilityG1(NdotL, roughness) *\n smithVisibilityG1(NdotV, roughness)\n );\n}\n\nfloat GGX(float roughness, float NdotH)\n{\n float roughnessSquared = roughness * roughness;\n float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0;\n return roughnessSquared / (czm_pi * f * f);\n}\n\n/**\n * Compute the diffuse and specular contributions using physically based\n * rendering. This function only handles direct lighting.\n * \n * This function only handles the lighting calculations. Metallic/roughness\n * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial}\n *
\n *\n * @name czm_pbrlighting\n * @glslFunction\n *\n * @param {vec3} positionEC The position of the fragment in eye coordinates\n * @param {vec3} normalEC The surface normal in eye coordinates\n * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.\n * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value.\n * @param {czm_pbrParameters} The computed PBR parameters.\n * @return {vec3} The computed HDR color\n *\n * @example\n * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial(\n * baseColor,\n * metallic,\n * roughness\n * );\n * vec3 color = czm_pbrlighting(\n * positionEC,\n * normalEC,\n * lightDirectionEC,\n * lightColorHdr,\n * pbrParameters);\n */\nvec3 czm_pbrLighting(\n vec3 positionEC,\n vec3 normalEC,\n vec3 lightDirectionEC,\n vec3 lightColorHdr,\n czm_pbrParameters pbrParameters\n)\n{\n vec3 v = -normalize(positionEC);\n vec3 l = normalize(lightDirectionEC);\n vec3 h = normalize(v + l);\n vec3 n = normalEC;\n float NdotL = clamp(dot(n, l), 0.001, 1.0);\n float NdotV = abs(dot(n, v)) + 0.001;\n float NdotH = clamp(dot(n, h), 0.0, 1.0);\n float LdotH = clamp(dot(l, h), 0.0, 1.0);\n float VdotH = clamp(dot(v, h), 0.0, 1.0);\n\n vec3 f0 = pbrParameters.f0;\n float reflectance = max(max(f0.r, f0.g), f0.b);\n vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n vec3 F = fresnelSchlick2(f0, f90, VdotH);\n\n float alpha = pbrParameters.roughness;\n float G = smithVisibilityGGX(alpha, NdotL, NdotV);\n float D = GGX(alpha, NdotH);\n vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV);\n\n vec3 diffuseColor = pbrParameters.diffuseColor;\n // F here represents the specular contribution\n vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);\n\n // Lo = (diffuse + specular) * Li * NdotL\n return (diffuseContribution + specularContribution) * NdotL * lightColorHdr;\n}\n";
+
+// Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.js
+var pbrMetallicRoughnessMaterial_default = "/**\n * Compute parameters for physically based rendering using the\n * metallic/roughness workflow. All inputs are linear; sRGB texture values must\n * be decoded beforehand\n *\n * @name czm_pbrMetallicRoughnessMaterial\n * @glslFunction\n *\n * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence)\n * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt);\n * @param {float} roughness A value between 0.0 and 1.0\n * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting}\n */\nczm_pbrParameters czm_pbrMetallicRoughnessMaterial(\n vec3 baseColor,\n float metallic,\n float roughness\n) \n{\n czm_pbrParameters results;\n\n // roughness is authored as perceptual roughness\n // square it to get material roughness\n roughness = clamp(roughness, 0.0, 1.0);\n results.roughness = roughness * roughness;\n\n // dielectrics use f0 = 0.04, metals use albedo as f0\n metallic = clamp(metallic, 0.0, 1.0);\n const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);\n vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic);\n results.f0 = f0;\n\n // diffuse only applies to dielectrics.\n results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic);\n\n return results;\n}\n";
+
+// Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.js
+var pbrSpecularGlossinessMaterial_default = "/**\n * Compute parameters for physically based rendering using the\n * specular/glossy workflow. All inputs are linear; sRGB texture values must\n * be decoded beforehand\n *\n * @name czm_pbrSpecularGlossinessMaterial\n * @glslFunction\n *\n * @param {vec3} diffuse The diffuse color for dielectrics (non-metals)\n * @param {vec3} specular The reflectance at normal incidence (f0)\n * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is.\n * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting}\n */\nczm_pbrParameters czm_pbrSpecularGlossinessMaterial(\n vec3 diffuse,\n vec3 specular,\n float glossiness\n) \n{\n czm_pbrParameters results;\n\n // glossiness is the opposite of roughness, but easier for artists to use.\n float roughness = 1.0 - glossiness;\n results.roughness = roughness * roughness;\n\n results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b));\n results.f0 = specular;\n\n return results;\n}\n";
+
+// Source/Shaders/Builtin/Functions/phong.js
+var phong_default = "float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\n return czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\n\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\n return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\n\n/**\n * Computes a color using the Phong lighting model.\n *\n * @name czm_phong\n * @glslFunction\n *\n * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.\n * @param {czm_material} material The fragment's material.\n *\n * @returns {vec4} The computed color.\n *\n * @example\n * vec3 positionToEyeEC = // ...\n * czm_material material = // ...\n * vec3 lightDirectionEC = // ...\n * gl_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);\n *\n * @see czm_getMaterial\n */\nvec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n // Diffuse from directional light sources at eye (for top-down)\n float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\n if (czm_sceneMode == czm_sceneMode3D) {\n // (and horizon views in 3D)\n diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n }\n\n float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\n\n // Temporary workaround for adding ambient.\n vec3 materialDiffuse = material.diffuse * 0.5;\n\n vec3 ambient = materialDiffuse;\n vec3 color = ambient + material.emission;\n color += materialDiffuse * diffuse * czm_lightColor;\n color += material.specular * specular * czm_lightColor;\n\n return vec4(color, material.alpha);\n}\n\nvec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);\n float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);\n\n vec3 ambient = vec3(0.0);\n vec3 color = ambient + material.emission;\n color += material.diffuse * diffuse * czm_lightColor;\n color += material.specular * specular * czm_lightColor;\n\n return vec4(color, material.alpha);\n}\n";
+
+// Source/Shaders/Builtin/Functions/planeDistance.js
+var planeDistance_default = "/**\n * Computes distance from a point to a plane.\n *\n * @name czm_planeDistance\n * @glslFunction\n *\n * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js\n * param {vec3} point A point in the same space as the plane.\n * returns {float} The distance from the point to the plane.\n */\nfloat czm_planeDistance(vec4 plane, vec3 point) {\n return (dot(plane.xyz, point) + plane.w);\n}\n\n/**\n * Computes distance from a point to a plane.\n *\n * @name czm_planeDistance\n * @glslFunction\n *\n * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js\n * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js\n * param {vec3} point A point in the same space as the plane.\n * returns {float} The distance from the point to the plane.\n */\nfloat czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {\n return (dot(planeNormal, point) + planeDistance);\n}\n";
+
+// Source/Shaders/Builtin/Functions/pointAlongRay.js
+var pointAlongRay_default = "/**\n * Computes the point along a ray at the given time. time
can be positive, negative, or zero.\n *\n * @name czm_pointAlongRay\n * @glslFunction\n *\n * @param {czm_ray} ray The ray to compute the point along.\n * @param {float} time The time along the ray.\n * \n * @returns {vec3} The point along the ray at the given time.\n * \n * @example\n * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction\n * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)\n */\nvec3 czm_pointAlongRay(czm_ray ray, float time)\n{\n return ray.origin + (time * ray.direction);\n}\n";
+
+// Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.js
+var rayEllipsoidIntersectionInterval_default = "/**\n * DOC_TBA\n *\n * @name czm_rayEllipsoidIntersectionInterval\n * @glslFunction\n */\nczm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)\n{\n // ray and ellipsoid center in eye coordinates. radii in model coordinates.\n vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\n vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\n\n q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;\n\n float q2 = dot(q, q);\n float qw = dot(q, w);\n\n if (q2 > 1.0) // Outside ellipsoid.\n {\n if (qw >= 0.0) // Looking outward or tangent (0 intersections).\n {\n return czm_emptyRaySegment;\n }\n else // qw < 0.0.\n {\n float qw2 = qw * qw;\n float difference = q2 - 1.0; // Positively valued.\n float w2 = dot(w, w);\n float product = w2 * difference;\n\n if (qw2 < product) // Imaginary roots (0 intersections).\n {\n return czm_emptyRaySegment;\n }\n else if (qw2 > product) // Distinct roots (2 intersections).\n {\n float discriminant = qw * qw - product;\n float temp = -qw + sqrt(discriminant); // Avoid cancellation.\n float root0 = temp / w2;\n float root1 = difference / temp;\n if (root0 < root1)\n {\n czm_raySegment i = czm_raySegment(root0, root1);\n return i;\n }\n else\n {\n czm_raySegment i = czm_raySegment(root1, root0);\n return i;\n }\n }\n else // qw2 == product. Repeated roots (2 intersections).\n {\n float root = sqrt(difference / w2);\n czm_raySegment i = czm_raySegment(root, root);\n return i;\n }\n }\n }\n else if (q2 < 1.0) // Inside ellipsoid (2 intersections).\n {\n float difference = q2 - 1.0; // Negatively valued.\n float w2 = dot(w, w);\n float product = w2 * difference; // Negatively valued.\n float discriminant = qw * qw - product;\n float temp = -qw + sqrt(discriminant); // Positively valued.\n czm_raySegment i = czm_raySegment(0.0, temp / w2);\n return i;\n }\n else // q2 == 1.0. On ellipsoid.\n {\n if (qw < 0.0) // Looking inward.\n {\n float w2 = dot(w, w);\n czm_raySegment i = czm_raySegment(0.0, -qw / w2);\n return i;\n }\n else // qw >= 0.0. Looking outward or tangent.\n {\n return czm_emptyRaySegment;\n }\n }\n}\n";
+
+// Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.js
+var raySphereIntersectionInterval_default = "/**\n * Compute the intersection interval of a ray with a sphere.\n *\n * @name czm_raySphereIntersectionInterval\n * @glslFunction\n *\n * @param {czm_ray} ray The ray.\n * @param {vec3} center The center of the sphere.\n * @param {float} radius The radius of the sphere.\n * @return {czm_raySegment} The intersection interval of the ray with the sphere.\n */\nczm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)\n{\n vec3 o = ray.origin;\n vec3 d = ray.direction;\n\n vec3 oc = o - center;\n\n float a = dot(d, d);\n float b = 2.0 * dot(d, oc);\n float c = dot(oc, oc) - (radius * radius);\n\n float det = (b * b) - (4.0 * a * c);\n\n if (det < 0.0) {\n return czm_emptyRaySegment;\n }\n\n float sqrtDet = sqrt(det);\n\n float t0 = (-b - sqrtDet) / (2.0 * a);\n float t1 = (-b + sqrtDet) / (2.0 * a);\n\n czm_raySegment result = czm_raySegment(t0, t1);\n return result;\n}\n";
+
+// Source/Shaders/Builtin/Functions/readDepth.js
+var readDepth_default = "float czm_readDepth(sampler2D depthTexture, vec2 texCoords)\n{\n return czm_reverseLogDepth(texture2D(depthTexture, texCoords).r);\n}\n";
+
+// Source/Shaders/Builtin/Functions/readNonPerspective.js
+var readNonPerspective_default = "/**\n * Reads a value previously transformed with {@link czm_writeNonPerspective}\n * by dividing it by `w`, the value used in the perspective divide.\n * This function is intended to be called in a fragment shader to access a\n * `varying` that should not be subject to perspective interpolation.\n * For example, screen-space texture coordinates. The value should have been\n * previously written in the vertex shader with a call to\n * {@link czm_writeNonPerspective}.\n *\n * @name czm_readNonPerspective\n * @glslFunction\n *\n * @param {float|vec2|vec3|vec4} value The non-perspective value to be read.\n * @param {float} oneOverW One over the perspective divide value, `w`. Usually this is simply `gl_FragCoord.w`.\n * @returns {float|vec2|vec3|vec4} The usable value.\n */\nfloat czm_readNonPerspective(float value, float oneOverW) {\n return value * oneOverW;\n}\n\nvec2 czm_readNonPerspective(vec2 value, float oneOverW) {\n return value * oneOverW;\n}\n\nvec3 czm_readNonPerspective(vec3 value, float oneOverW) {\n return value * oneOverW;\n}\n\nvec4 czm_readNonPerspective(vec4 value, float oneOverW) {\n return value * oneOverW;\n}\n";
+
+// Source/Shaders/Builtin/Functions/reverseLogDepth.js
+var reverseLogDepth_default = "float czm_reverseLogDepth(float logZ)\n{\n#ifdef LOG_DEPTH\n float near = czm_currentFrustum.x;\n float far = czm_currentFrustum.y;\n float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;\n float depthFromNear = pow(2.0, log2Depth) - 1.0;\n return far * (1.0 - near / (depthFromNear + near)) / (far - near);\n#endif\n return logZ;\n}\n";
+
+// Source/Shaders/Builtin/Functions/RGBToHSB.js
+var RGBToHSB_default = "/**\n * Converts an RGB color to HSB (hue, saturation, brightness)\n * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}\n *\n * @name czm_RGBToHSB\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in HSB.\n *\n * @example\n * vec3 hsb = czm_RGBToHSB(rgb);\n * hsb.z *= 0.1;\n * rgb = czm_HSBToRGB(hsb);\n */\n\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n\nvec3 czm_RGBToHSB(vec3 rgb)\n{\n vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\n vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\n\n float d = q.x - min(q.w, q.y);\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\n";
+
+// Source/Shaders/Builtin/Functions/RGBToHSL.js
+var RGBToHSL_default = "/**\n * Converts an RGB color to HSL (hue, saturation, lightness)\n * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}\n *\n * @name czm_RGBToHSL\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in HSL.\n *\n * @example\n * vec3 hsl = czm_RGBToHSL(rgb);\n * hsl.z *= 0.1;\n * rgb = czm_HSLToRGB(hsl);\n */\n \nvec3 RGBtoHCV(vec3 rgb)\n{\n // Based on work by Sam Hocevar and Emil Persson\n vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\n vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\n float c = q.x - min(q.w, q.y);\n float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\n return vec3(h, c, q.x);\n}\n\nvec3 czm_RGBToHSL(vec3 rgb)\n{\n vec3 hcv = RGBtoHCV(rgb);\n float l = hcv.z - hcv.y * 0.5;\n float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\n return vec3(hcv.x, s, l);\n}\n";
+
+// Source/Shaders/Builtin/Functions/RGBToXYZ.js
+var RGBToXYZ_default = "/**\n * Converts an RGB color to CIE Yxy.\n * The conversion is described in\n * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}\n *
\n * \n * @name czm_RGBToXYZ\n * @glslFunction\n * \n * @param {vec3} rgb The color in RGB.\n *\n * @returns {vec3} The color in CIE Yxy.\n *\n * @example\n * vec3 xyz = czm_RGBToXYZ(rgb);\n * xyz.x = max(xyz.x - luminanceThreshold, 0.0);\n * rgb = czm_XYZToRGB(xyz);\n */\nvec3 czm_RGBToXYZ(vec3 rgb)\n{\n const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n 0.3576, 0.7152, 0.1192,\n 0.1805, 0.0722, 0.9505);\n vec3 xyz = RGB2XYZ * rgb;\n vec3 Yxy;\n Yxy.r = xyz.g;\n float temp = dot(vec3(1.0), xyz);\n Yxy.gb = xyz.rg / temp;\n return Yxy;\n}\n";
+
+// Source/Shaders/Builtin/Functions/round.js
+var round_default = "/**\n * Round a floating point value. This function exists because round() doesn't\n * exist in GLSL 1.00. \n *\n * @param {float|vec2|vec3|vec4} value The value to round\n * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.\n */\nfloat czm_round(float value) {\n return floor(value + 0.5);\n}\n\nvec2 czm_round(vec2 value) {\n return floor(value + 0.5);\n}\n\nvec3 czm_round(vec3 value) {\n return floor(value + 0.5);\n}\n\nvec4 czm_round(vec4 value) {\n return floor(value + 0.5);\n}\n";
+
+// Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js
+var sampleOctahedralProjection_default = "/**\n * Samples the 4 neighboring pixels and return the weighted average.\n *\n * @private\n */\nvec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod)\n{\n direction /= dot(vec3(1.0), abs(direction));\n vec2 rev = abs(direction.zx) - vec2(1.0);\n vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x,\n direction.z < 0.0 ? rev.y : -rev.y);\n vec2 uv = direction.y < 0.0 ? neg : direction.xz;\n vec2 coord = 0.5 * uv + vec2(0.5);\n vec2 pixel = 1.0 / textureSize;\n\n if (lod > 0.0)\n {\n // Each subseqeuent mip level is half the size\n float scale = 1.0 / pow(2.0, lod);\n float offset = ((textureSize.y + 1.0) / textureSize.x);\n\n coord.x *= offset;\n coord *= scale;\n\n coord.x += offset + pixel.x;\n coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0;\n }\n else\n {\n coord.x *= (textureSize.y / textureSize.x);\n }\n\n // Do bilinear filtering\n #ifndef OES_texture_float_linear\n vec3 color1 = texture2D(projectedMap, coord + vec2(0.0, pixel.y)).rgb;\n vec3 color2 = texture2D(projectedMap, coord + vec2(pixel.x, 0.0)).rgb;\n vec3 color3 = texture2D(projectedMap, coord + pixel).rgb;\n vec3 color4 = texture2D(projectedMap, coord).rgb;\n\n vec2 texturePosition = coord * textureSize;\n\n float fu = fract(texturePosition.x);\n float fv = fract(texturePosition.y);\n\n vec3 average1 = mix(color4, color2, fu);\n vec3 average2 = mix(color1, color3, fu);\n\n vec3 color = mix(average1, average2, fv);\n #else\n vec3 color = texture2D(projectedMap, coord).rgb;\n #endif\n\n return color;\n}\n\n\n/**\n * Samples from a cube map that has been projected using an octahedral projection from the given direction.\n *\n * @name czm_sampleOctahedralProjection\n * @glslFunction\n *\n * @param {sampler2D} projectedMap The texture with the octahedral projected cube map.\n * @param {vec2} textureSize The width and height dimensions in pixels of the projected map.\n * @param {vec3} direction The normalized direction used to sample the cube map.\n * @param {float} lod The level of detail to sample.\n * @param {float} maxLod The maximum level of detail.\n * @returns {vec3} The color of the cube map at the direction.\n */\nvec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) {\n float currentLod = floor(lod + 0.5);\n float nextLod = min(currentLod + 1.0, maxLod);\n\n vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod);\n vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod);\n\n return mix(colorNextLod, colorCurrentLod, nextLod - lod);\n}\n";
+
+// Source/Shaders/Builtin/Functions/saturation.js
+var saturation_default = "/**\n * Adjusts the saturation of a color.\n * \n * @name czm_saturation\n * @glslFunction\n * \n * @param {vec3} rgb The color.\n * @param {float} adjustment The amount to adjust the saturation of the color.\n *\n * @returns {float} The color with the saturation adjusted.\n *\n * @example\n * vec3 greyScale = czm_saturation(color, 0.0);\n * vec3 doubleSaturation = czm_saturation(color, 2.0);\n */\nvec3 czm_saturation(vec3 rgb, float adjustment)\n{\n // Algorithm from Chapter 16 of OpenGL Shading Language\n const vec3 W = vec3(0.2125, 0.7154, 0.0721);\n vec3 intensity = vec3(dot(rgb, W));\n return mix(intensity, rgb, adjustment);\n}\n";
+
+// Source/Shaders/Builtin/Functions/shadowDepthCompare.js
+var shadowDepthCompare_default = "\nfloat czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)\n{\n return czm_unpackDepth(textureCube(shadowMap, d));\n}\n\nfloat czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\n return texture2D(shadowMap, uv).r;\n#else\n return czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\n\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\n return step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\n return step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n";
+
+// Source/Shaders/Builtin/Functions/shadowVisibility.js
+var shadowVisibility_default = "\nfloat czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\n float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\n float strength = step(0.0, nDotL);\n#endif\n visibility *= strength;\n#endif\n\n visibility = max(visibility, darkness);\n return visibility;\n}\n\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec3 uvw = shadowParameters.texCoords;\n\n depth -= depthBias;\n float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\n float depthBias = shadowParameters.depthBias;\n float depth = shadowParameters.depth;\n float nDotL = shadowParameters.nDotL;\n float normalShadingSmooth = shadowParameters.normalShadingSmooth;\n float darkness = shadowParameters.darkness;\n vec2 uv = shadowParameters.texCoords;\n\n depth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\n vec2 texelStepSize = shadowParameters.texelStepSize;\n float radius = 1.0;\n float dx0 = -texelStepSize.x * radius;\n float dy0 = -texelStepSize.y * radius;\n float dx1 = texelStepSize.x * radius;\n float dy1 = texelStepSize.y * radius;\n float visibility = (\n czm_shadowDepthCompare(shadowMap, uv, depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\n czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n ) * (1.0 / 9.0);\n#else\n float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\n\n return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n";
+
+// Source/Shaders/Builtin/Functions/signNotZero.js
+var signNotZero_default = "/**\n * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL\n * built-in function sign
except that returns 1.0 instead of 0.0 when the input value is 0.0.\n * \n * @name czm_signNotZero\n * @glslFunction\n *\n * @param {} value The value for which to determine the sign.\n * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.\n */\nfloat czm_signNotZero(float value)\n{\n return value >= 0.0 ? 1.0 : -1.0;\n}\n\nvec2 czm_signNotZero(vec2 value)\n{\n return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\n\nvec3 czm_signNotZero(vec3 value)\n{\n return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\n\nvec4 czm_signNotZero(vec4 value)\n{\n return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n";
+
+// Source/Shaders/Builtin/Functions/sphericalHarmonics.js
+var sphericalHarmonics_default = "/**\n * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.\n * \n * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].\n *
\n *\n * @name czm_sphericalHarmonics\n * @glslFunction\n *\n * @param {vec3} normal The normalized direction.\n * @param {vec3[9]} coefficients The third order spherical harmonic coefficients.\n * @returns {vec3} The color at the direction.\n *\n * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf\n */\nvec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])\n{\n vec3 L00 = coefficients[0];\n vec3 L1_1 = coefficients[1];\n vec3 L10 = coefficients[2];\n vec3 L11 = coefficients[3];\n vec3 L2_2 = coefficients[4];\n vec3 L2_1 = coefficients[5];\n vec3 L20 = coefficients[6];\n vec3 L21 = coefficients[7];\n vec3 L22 = coefficients[8];\n\n float x = normal.x;\n float y = normal.y;\n float z = normal.z;\n\n return\n L00\n + L1_1 * y\n + L10 * z\n + L11 * x\n + L2_2 * (y * x)\n + L2_1 * (y * z)\n + L20 * (3.0 * z * z - 1.0)\n + L21 * (z * x)\n + L22 * (x * x - y * y);\n}\n";
+
+// Source/Shaders/Builtin/Functions/srgbToLinear.js
+var srgbToLinear_default = "/**\n * Converts an sRGB color to a linear RGB color.\n *\n * @param {vec3|vec4} srgbIn The color in sRGB space\n * @returns {vec3|vec4} The color in linear color space. The vector type matches the input.\n */\nvec3 czm_srgbToLinear(vec3 srgbIn)\n{\n return pow(srgbIn, vec3(2.2));\n}\n\nvec4 czm_srgbToLinear(vec4 srgbIn) \n{\n vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));\n return vec4(linearOut, srgbIn.a);\n}\n";
+
+// Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js
+var tangentToEyeSpaceMatrix_default = "/**\n * Creates a matrix that transforms vectors from tangent space to eye space.\n *\n * @name czm_tangentToEyeSpaceMatrix\n * @glslFunction\n *\n * @param {vec3} normalEC The normal vector in eye coordinates.\n * @param {vec3} tangentEC The tangent vector in eye coordinates.\n * @param {vec3} bitangentEC The bitangent vector in eye coordinates.\n *\n * @returns {mat3} The matrix that transforms from tangent space to eye space.\n *\n * @example\n * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);\n * vec3 normal = tangentToEye * texture2D(normalMap, st).xyz;\n */\nmat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\n vec3 normal = normalize(normalEC);\n vec3 tangent = normalize(tangentEC);\n vec3 bitangent = normalize(bitangentEC);\n return mat3(tangent.x , tangent.y , tangent.z,\n bitangent.x, bitangent.y, bitangent.z,\n normal.x , normal.y , normal.z);\n}\n";
+
+// Source/Shaders/Builtin/Functions/transformPlane.js
+var transformPlane_default = "/**\n * Transforms a plane.\n * \n * @name czm_transformPlane\n * @glslFunction\n *\n * @param {vec4} plane The plane in Hessian Normal Form.\n * @param {mat4} transform The inverse-transpose of a transformation matrix.\n */\nvec4 czm_transformPlane(vec4 plane, mat4 transform) {\n vec4 transformedPlane = transform * plane;\n // Convert the transformed plane to Hessian Normal Form\n float normalMagnitude = length(transformedPlane.xyz);\n return transformedPlane / normalMagnitude;\n}\n";
+
+// Source/Shaders/Builtin/Functions/translateRelativeToEye.js
+var translateRelativeToEye_default = "/**\n * Translates a position (or any vec3
) that was encoded with {@link EncodedCartesian3},\n * and then provided to the shader as separate high
and low
bits to\n * be relative to the eye. As shown in the example, the position can then be transformed in eye\n * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},\n * respectively.\n * \n * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as\n * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.\n *
\n *\n * @name czm_translateRelativeToEye\n * @glslFunction\n *\n * @param {vec3} high The position's high bits.\n * @param {vec3} low The position's low bits.\n * @returns {vec3} The position translated to be relative to the camera's position.\n *\n * @example\n * attribute vec3 positionHigh;\n * attribute vec3 positionLow;\n *\n * void main()\n * {\n * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\n * gl_Position = czm_modelViewProjectionRelativeToEye * p;\n * }\n *\n * @see czm_modelViewRelativeToEye\n * @see czm_modelViewProjectionRelativeToEye\n * @see czm_computePosition\n * @see EncodedCartesian3\n */\nvec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\n vec3 highDifference = high - czm_encodedCameraPositionMCHigh;\n vec3 lowDifference = low - czm_encodedCameraPositionMCLow;\n\n return vec4(highDifference + lowDifference, 1.0);\n}\n";
+
+// Source/Shaders/Builtin/Functions/translucentPhong.js
+var translucentPhong_default = "/**\n * @private\n */\nvec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)\n{\n // Diffuse from directional light sources at eye (for top-down and horizon views)\n float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\n\n if (czm_sceneMode == czm_sceneMode3D) {\n // (and horizon views in 3D)\n diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n }\n\n diffuse = clamp(diffuse, 0.0, 1.0);\n\n float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);\n\n // Temporary workaround for adding ambient.\n vec3 materialDiffuse = material.diffuse * 0.5;\n\n vec3 ambient = materialDiffuse;\n vec3 color = ambient + material.emission;\n color += materialDiffuse * diffuse * czm_lightColor;\n color += material.specular * specular * czm_lightColor;\n\n return vec4(color, material.alpha);\n}\n";
+
+// Source/Shaders/Builtin/Functions/transpose.js
+var transpose_default = "/**\n * Returns the transpose of the matrix. The input matrix
can be\n * a mat2
, mat3
, or mat4
.\n *\n * @name czm_transpose\n * @glslFunction\n *\n * @param {} matrix The matrix to transpose.\n *\n * @returns {} The transposed matrix.\n *\n * @example\n * // GLSL declarations\n * mat2 czm_transpose(mat2 matrix);\n * mat3 czm_transpose(mat3 matrix);\n * mat4 czm_transpose(mat4 matrix);\n *\n * // Transpose a 3x3 rotation matrix to find its inverse.\n * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(\n * positionMC, normalEC);\n * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);\n */\nmat2 czm_transpose(mat2 matrix)\n{\n return mat2(\n matrix[0][0], matrix[1][0],\n matrix[0][1], matrix[1][1]);\n}\n\nmat3 czm_transpose(mat3 matrix)\n{\n return mat3(\n matrix[0][0], matrix[1][0], matrix[2][0],\n matrix[0][1], matrix[1][1], matrix[2][1],\n matrix[0][2], matrix[1][2], matrix[2][2]);\n}\n\nmat4 czm_transpose(mat4 matrix)\n{\n return mat4(\n matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\n matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\n matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\n matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n";
+
+// Source/Shaders/Builtin/Functions/unpackDepth.js
+var unpackDepth_default = "/**\n * Unpacks a vec4 depth value to a float in [0, 1) range.\n *\n * @name czm_unpackDepth\n * @glslFunction\n *\n * @param {vec4} packedDepth The packed depth.\n *\n * @returns {float} The floating-point depth in [0, 1) range.\n */\n float czm_unpackDepth(vec4 packedDepth)\n {\n // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA\n // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/\n return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n }\n";
+
+// Source/Shaders/Builtin/Functions/unpackFloat.js
+var unpackFloat_default = "/**\n * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.\n *\n * @name czm_unpackFloat\n * @glslFunction\n *\n * @param {vec4} packedFloat The packed float.\n *\n * @returns {float} The floating-point depth in arbitrary range.\n */\nfloat czm_unpackFloat(vec4 packedFloat)\n{\n // Convert to [0.0, 255.0] and round to integer\n packedFloat = floor(packedFloat * 255.0 + 0.5);\n float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;\n float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; \n if (exponent == -127.0)\n {\n return 0.0;\n }\n float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);\n float result = sign * exp2(exponent - 23.0) * mantissa;\n return result;\n}\n";
+
+// Source/Shaders/Builtin/Functions/unpackUint.js
+var unpackUint_default = "/**\n * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,\n * so the return value is an int.\n * \n * There are also precision limitations in WebGL 1. highp int is still limited\n * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.\n *
\n *\n * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.\n *\n * @return {int} The unpacked value.\n */\n int czm_unpackUint(float packedValue) {\n float rounded = czm_round(packedValue * 255.0);\n return int(rounded);\n }\n\n int czm_unpackUint(vec2 packedValue) {\n vec2 rounded = czm_round(packedValue * 255.0);\n return int(dot(rounded, vec2(1.0, 256.0)));\n }\n\n int czm_unpackUint(vec3 packedValue) {\n vec3 rounded = czm_round(packedValue * 255.0);\n return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));\n }\n\n int czm_unpackUint(vec4 packedValue) {\n vec4 rounded = czm_round(packedValue * 255.0);\n return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));\n }\n";
+
+// Source/Shaders/Builtin/Functions/valueTransform.js
+var valueTransform_default = "/**\n * Transform metadata values following the EXT_structural_metadata spec\n * by multiplying by scale and adding the offset. Operations are always\n * performed component-wise, even for matrices.\n * \n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add\n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply\n * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.\n *\n * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.\n */\nfloat czm_valueTransform(float offset, float scale, float value) {\n return scale * value + offset;\n}\n\nvec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {\n return scale * value + offset;\n}\n\nvec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {\n return scale * value + offset;\n}\n\nvec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {\n return scale * value + offset;\n}\n\nmat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {\n return matrixCompMult(scale, value) + offset;\n}\n\nmat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {\n return matrixCompMult(scale, value) + offset;\n}\n\nmat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {\n return matrixCompMult(scale, value) + offset;\n}\n";
+
+// Source/Shaders/Builtin/Functions/vertexLogDepth.js
+var vertexLogDepth_default = "#ifdef LOG_DEPTH\n// 1.0 at the near plane, increasing linearly from there.\nvarying float v_depthFromNearPlusOne;\n#ifdef SHADOW_MAP\nvarying vec3 v_logPositionEC;\n#endif\n#endif\n\nvec4 czm_updatePositionDepth(vec4 coords) {\n#if defined(LOG_DEPTH)\n\n#ifdef SHADOW_MAP\n vec3 logPositionEC = (czm_inverseProjection * coords).xyz;\n v_logPositionEC = logPositionEC;\n#endif\n\n // With the very high far/near ratios used with the logarithmic depth\n // buffer, floating point rounding errors can cause linear depth values\n // to end up on the wrong side of the far plane, even for vertices that\n // are really nowhere near it. Since we always write a correct logarithmic\n // depth value in the fragment shader anyway, we just need to make sure\n // such errors don't cause the primitive to be clipped entirely before\n // we even get to the fragment shader.\n coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;\n#endif\n\n return coords;\n}\n\n/**\n * Writes the logarithmic depth to gl_Position using the already computed gl_Position.\n *\n * @name czm_vertexLogDepth\n * @glslFunction\n */\nvoid czm_vertexLogDepth()\n{\n#ifdef LOG_DEPTH\n v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;\n gl_Position = czm_updatePositionDepth(gl_Position);\n#endif\n}\n\n/**\n * Writes the logarithmic depth to gl_Position using the provided clip coordinates.\n * \n * An example use case for this function would be moving the vertex in window coordinates\n * before converting back to clip coordinates. Use the original vertex clip coordinates.\n *
\n * @name czm_vertexLogDepth\n * @glslFunction\n *\n * @param {vec4} clipCoords The vertex in clip coordinates.\n *\n * @example\n * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));\n */\nvoid czm_vertexLogDepth(vec4 clipCoords)\n{\n#ifdef LOG_DEPTH\n v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;\n czm_updatePositionDepth(clipCoords);\n#endif\n}\n";
+
+// Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js
+var windowToEyeCoordinates_default = "/**\n * Transforms a position from window to eye coordinates.\n * The transform from window to normalized device coordinates is done using components\n * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating\n * the inverse of czm_viewportTransformation
. The transformation from\n * normalized device coordinates to clip coordinates is done using fragmentCoordinate.w
,\n * which is expected to be the scalar used in the perspective divide. The transformation\n * from clip to eye coordinates is done using {@link czm_inverseProjection}.\n *\n * @name czm_windowToEyeCoordinates\n * @glslFunction\n *\n * @param {vec4} fragmentCoordinate The position in window coordinates to transform.\n *\n * @returns {vec4} The transformed position in eye coordinates.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_eyeToWindowCoordinates\n * @see czm_inverseProjection\n * @see czm_viewport\n * @see czm_viewportTransformation\n *\n * @example\n * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);\n */\nvec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\n // Reconstruct NDC coordinates\n float x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\n float y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\n float z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\n vec4 q = vec4(x, y, z, 1.0);\n\n // Reverse the perspective division to obtain clip coordinates.\n q /= fragmentCoordinate.w;\n\n // Reverse the projection transformation to obtain eye coordinates.\n if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s\n {\n q = czm_inverseProjection * q;\n }\n else\n {\n float top = czm_frustumPlanes.x;\n float bottom = czm_frustumPlanes.y;\n float left = czm_frustumPlanes.z;\n float right = czm_frustumPlanes.w;\n\n float near = czm_currentFrustum.x;\n float far = czm_currentFrustum.y;\n\n q.x = (q.x * (right - left) + left + right) * 0.5;\n q.y = (q.y * (top - bottom) + bottom + top) * 0.5;\n q.z = (q.z * (near - far) - near - far) * 0.5;\n q.w = 1.0;\n }\n\n return q;\n}\n\n/**\n * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.\n * This function produces more accurate results for window positions with log depth than\n * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version\n * of czm_windowToEyeCoordinates.\n *\n * @name czm_windowToEyeCoordinates\n * @glslFunction\n *\n * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.\n * @param {float} depthOrLogDepth A depth or log depth for the fragment.\n *\n * @see czm_modelToWindowCoordinates\n * @see czm_eyeToWindowCoordinates\n * @see czm_inverseProjection\n * @see czm_viewport\n * @see czm_viewportTransformation\n *\n * @returns {vec4} The transformed position in eye coordinates.\n */\nvec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)\n{\n // See reverseLogDepth.glsl. This is separate to re-use the pow.\n#ifdef LOG_DEPTH\n float near = czm_currentFrustum.x;\n float far = czm_currentFrustum.y;\n float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;\n float depthFromNear = pow(2.0, log2Depth) - 1.0;\n float depthFromCamera = depthFromNear + near;\n vec4 windowCoord = vec4(fragmentCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\n eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision\n return eyeCoordinate;\n#else\n vec4 windowCoord = vec4(fragmentCoordinateXY, depthOrLogDepth, 1.0);\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(windowCoord);\n#endif\n return eyeCoordinate;\n}\n";
+
+// Source/Shaders/Builtin/Functions/writeDepthClamp.js
+var writeDepthClamp_default = "// emulated noperspective\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\nvarying float v_WindowZ;\n#endif\n\n/**\n * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane\n * by writing the fragment's depth. See czm_depthClamp for more details.\n * \n * The shader must enable the GL_EXT_frag_depth extension.\n *
\n *\n * @name czm_writeDepthClamp\n * @glslFunction\n *\n * @example\n * gl_FragColor = color;\n * czm_writeDepthClamp();\n *\n * @see czm_depthClamp\n */\nvoid czm_writeDepthClamp()\n{\n#if defined(GL_EXT_frag_depth) && !defined(LOG_DEPTH)\n gl_FragDepthEXT = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);\n#endif\n}\n";
+
+// Source/Shaders/Builtin/Functions/writeLogDepth.js
+var writeLogDepth_default = "#ifdef LOG_DEPTH\nvarying float v_depthFromNearPlusOne;\n\n#ifdef POLYGON_OFFSET\nuniform vec2 u_polygonOffset;\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n#endif\n\n#endif\n\n/**\n * Writes the fragment depth to the logarithmic depth buffer.\n * \n * Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when\n * ray-casting geometry using a full screen quad.\n *
\n * @name czm_writeLogDepth\n * @glslFunction\n *\n * @param {float} depth The depth coordinate, where 1.0 is on the near plane and\n * depth increases in eye-space units from there\n *\n * @example\n * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);\n */\nvoid czm_writeLogDepth(float depth)\n{\n#if defined(GL_EXT_frag_depth) && defined(LOG_DEPTH)\n // Discard the vertex if it's not between the near and far planes.\n // We allow a bit of epsilon on the near plane comparison because a 1.0\n // from the vertex shader (indicating the vertex should be _on_ the near\n // plane) will not necessarily come here as exactly 1.0.\n if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {\n discard;\n }\n\n#ifdef POLYGON_OFFSET\n // Polygon offset: m * factor + r * units\n float factor = u_polygonOffset[0];\n float units = u_polygonOffset[1];\n\n// If we can't compute derivatives, just leave out the factor I guess?\n#ifdef GL_OES_standard_derivatives\n if (factor != 0.0) {\n // m = sqrt(dZdX^2 + dZdY^2);\n float x = dFdx(depth);\n float y = dFdy(depth);\n float m = sqrt(x * x + y * y);\n\n // Apply the factor before computing the log depth.\n depth += m * factor;\n }\n#endif\n\n#endif\n\n gl_FragDepthEXT = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;\n\n#ifdef POLYGON_OFFSET\n // Apply the units after the log depth.\n gl_FragDepthEXT += czm_epsilon7 * units;\n#endif\n\n#endif\n}\n\n/**\n * Writes the fragment depth to the logarithmic depth buffer.\n * \n * Use this when the vertex shader calls {@link czm_vertexlogDepth}.\n *
\n *\n * @name czm_writeLogDepth\n * @glslFunction\n */\nvoid czm_writeLogDepth() {\n#ifdef LOG_DEPTH\n czm_writeLogDepth(v_depthFromNearPlusOne);\n#endif\n}\n";
+
+// Source/Shaders/Builtin/Functions/writeNonPerspective.js
+var writeNonPerspective_default = "/**\n * Transforms a value for non-perspective interpolation by multiplying\n * it by w, the value used in the perspective divide. This function is\n * intended to be called in a vertex shader to compute the value of a\n * `varying` that should not be subject to perspective interpolation.\n * For example, screen-space texture coordinates. The fragment shader\n * must call {@link czm_readNonPerspective} to retrieve the final\n * non-perspective value.\n *\n * @name czm_writeNonPerspective\n * @glslFunction\n *\n * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.\n * @param {float} w The perspective divide value. Usually this is the computed `gl_Position.w`.\n * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a `varying` and read in the\n * fragment shader with {@link czm_readNonPerspective}.\n */\nfloat czm_writeNonPerspective(float value, float w) {\n return value * w;\n}\n\nvec2 czm_writeNonPerspective(vec2 value, float w) {\n return value * w;\n}\n\nvec3 czm_writeNonPerspective(vec3 value, float w) {\n return value * w;\n}\n\nvec4 czm_writeNonPerspective(vec4 value, float w) {\n return value * w;\n}\n";
+
+// Source/Shaders/Builtin/Functions/XYZToRGB.js
+var XYZToRGB_default = "/**\n * Converts a CIE Yxy color to RGB.\n * The conversion is described in\n * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}\n *
\n * \n * @name czm_XYZToRGB\n * @glslFunction\n * \n * @param {vec3} Yxy The color in CIE Yxy.\n *\n * @returns {vec3} The color in RGB.\n *\n * @example\n * vec3 xyz = czm_RGBToXYZ(rgb);\n * xyz.x = max(xyz.x - luminanceThreshold, 0.0);\n * rgb = czm_XYZToRGB(xyz);\n */\nvec3 czm_XYZToRGB(vec3 Yxy)\n{\n const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n -1.5371, 1.8760, -0.2040,\n -0.4985, 0.0416, 1.0572);\n vec3 xyz;\n xyz.r = Yxy.r * Yxy.g / Yxy.b;\n xyz.g = Yxy.r;\n xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\n \n return XYZ2RGB * xyz;\n}\n";
+
+// Source/Shaders/Builtin/CzmBuiltins.js
+var CzmBuiltins_default = {
+ czm_degreesPerRadian: degreesPerRadian_default,
+ czm_depthRange: depthRange_default,
+ czm_epsilon1: epsilon1_default,
+ czm_epsilon2: epsilon2_default,
+ czm_epsilon3: epsilon3_default,
+ czm_epsilon4: epsilon4_default,
+ czm_epsilon5: epsilon5_default,
+ czm_epsilon6: epsilon6_default,
+ czm_epsilon7: epsilon7_default,
+ czm_infinity: infinity_default,
+ czm_oneOverPi: oneOverPi_default,
+ czm_oneOverTwoPi: oneOverTwoPi_default,
+ czm_passCesium3DTile: passCesium3DTile_default,
+ czm_passCesium3DTileClassification: passCesium3DTileClassification_default,
+ czm_passCesium3DTileClassificationIgnoreShow: passCesium3DTileClassificationIgnoreShow_default,
+ czm_passClassification: passClassification_default,
+ czm_passCompute: passCompute_default,
+ czm_passEnvironment: passEnvironment_default,
+ czm_passGlobe: passGlobe_default,
+ czm_passOpaque: passOpaque_default,
+ czm_passOverlay: passOverlay_default,
+ czm_passTerrainClassification: passTerrainClassification_default,
+ czm_passTranslucent: passTranslucent_default,
+ czm_pi: pi_default,
+ czm_piOverFour: piOverFour_default,
+ czm_piOverSix: piOverSix_default,
+ czm_piOverThree: piOverThree_default,
+ czm_piOverTwo: piOverTwo_default,
+ czm_radiansPerDegree: radiansPerDegree_default,
+ czm_sceneMode2D: sceneMode2D_default,
+ czm_sceneMode3D: sceneMode3D_default,
+ czm_sceneModeColumbusView: sceneModeColumbusView_default,
+ czm_sceneModeMorphing: sceneModeMorphing_default,
+ czm_solarRadius: solarRadius_default,
+ czm_threePiOver2: threePiOver2_default,
+ czm_twoPi: twoPi_default,
+ czm_webMercatorMaxLatitude: webMercatorMaxLatitude_default,
+ czm_depthRangeStruct: depthRangeStruct_default,
+ czm_material: material_default,
+ czm_materialInput: materialInput_default,
+ czm_modelMaterial: modelMaterial_default,
+ czm_modelVertexOutput: modelVertexOutput_default,
+ czm_pbrParameters: pbrParameters_default,
+ czm_ray: ray_default,
+ czm_raySegment: raySegment_default,
+ czm_shadowParameters: shadowParameters_default,
+ czm_acesTonemapping: acesTonemapping_default,
+ czm_alphaWeight: alphaWeight_default,
+ czm_antialias: antialias_default,
+ czm_approximateSphericalCoordinates: approximateSphericalCoordinates_default,
+ czm_backFacing: backFacing_default,
+ czm_branchFreeTernary: branchFreeTernary_default,
+ czm_cascadeColor: cascadeColor_default,
+ czm_cascadeDistance: cascadeDistance_default,
+ czm_cascadeMatrix: cascadeMatrix_default,
+ czm_cascadeWeights: cascadeWeights_default,
+ czm_columbusViewMorph: columbusViewMorph_default,
+ czm_computePosition: computePosition_default,
+ czm_cosineAndSine: cosineAndSine_default,
+ czm_decompressTextureCoordinates: decompressTextureCoordinates_default,
+ czm_defaultPbrMaterial: defaultPbrMaterial_default,
+ czm_depthClamp: depthClamp_default,
+ czm_eastNorthUpToEyeCoordinates: eastNorthUpToEyeCoordinates_default,
+ czm_ellipsoidContainsPoint: ellipsoidContainsPoint_default,
+ czm_ellipsoidWgs84TextureCoordinates: ellipsoidWgs84TextureCoordinates_default,
+ czm_equalsEpsilon: equalsEpsilon_default,
+ czm_eyeOffset: eyeOffset_default,
+ czm_eyeToWindowCoordinates: eyeToWindowCoordinates_default,
+ czm_fastApproximateAtan: fastApproximateAtan_default,
+ czm_fog: fog_default,
+ czm_gammaCorrect: gammaCorrect_default,
+ czm_geodeticSurfaceNormal: geodeticSurfaceNormal_default,
+ czm_getDefaultMaterial: getDefaultMaterial_default,
+ czm_getLambertDiffuse: getLambertDiffuse_default,
+ czm_getSpecular: getSpecular_default,
+ czm_getWaterNoise: getWaterNoise_default,
+ czm_HSBToRGB: HSBToRGB_default,
+ czm_HSLToRGB: HSLToRGB_default,
+ czm_hue: hue_default,
+ czm_inverseGamma: inverseGamma_default,
+ czm_isEmpty: isEmpty_default,
+ czm_isFull: isFull_default,
+ czm_latitudeToWebMercatorFraction: latitudeToWebMercatorFraction_default,
+ czm_linearToSrgb: linearToSrgb_default,
+ czm_lineDistance: lineDistance_default,
+ czm_luminance: luminance_default,
+ czm_metersPerPixel: metersPerPixel_default,
+ czm_modelToWindowCoordinates: modelToWindowCoordinates_default,
+ czm_multiplyWithColorBalance: multiplyWithColorBalance_default,
+ czm_nearFarScalar: nearFarScalar_default,
+ czm_octDecode: octDecode_default,
+ czm_packDepth: packDepth_default,
+ czm_pbrLighting: pbrLighting_default,
+ czm_pbrMetallicRoughnessMaterial: pbrMetallicRoughnessMaterial_default,
+ czm_pbrSpecularGlossinessMaterial: pbrSpecularGlossinessMaterial_default,
+ czm_phong: phong_default,
+ czm_planeDistance: planeDistance_default,
+ czm_pointAlongRay: pointAlongRay_default,
+ czm_rayEllipsoidIntersectionInterval: rayEllipsoidIntersectionInterval_default,
+ czm_raySphereIntersectionInterval: raySphereIntersectionInterval_default,
+ czm_readDepth: readDepth_default,
+ czm_readNonPerspective: readNonPerspective_default,
+ czm_reverseLogDepth: reverseLogDepth_default,
+ czm_RGBToHSB: RGBToHSB_default,
+ czm_RGBToHSL: RGBToHSL_default,
+ czm_RGBToXYZ: RGBToXYZ_default,
+ czm_round: round_default,
+ czm_sampleOctahedralProjection: sampleOctahedralProjection_default,
+ czm_saturation: saturation_default,
+ czm_shadowDepthCompare: shadowDepthCompare_default,
+ czm_shadowVisibility: shadowVisibility_default,
+ czm_signNotZero: signNotZero_default,
+ czm_sphericalHarmonics: sphericalHarmonics_default,
+ czm_srgbToLinear: srgbToLinear_default,
+ czm_tangentToEyeSpaceMatrix: tangentToEyeSpaceMatrix_default,
+ czm_transformPlane: transformPlane_default,
+ czm_translateRelativeToEye: translateRelativeToEye_default,
+ czm_translucentPhong: translucentPhong_default,
+ czm_transpose: transpose_default,
+ czm_unpackDepth: unpackDepth_default,
+ czm_unpackFloat: unpackFloat_default,
+ czm_unpackUint: unpackUint_default,
+ czm_valueTransform: valueTransform_default,
+ czm_vertexLogDepth: vertexLogDepth_default,
+ czm_windowToEyeCoordinates: windowToEyeCoordinates_default,
+ czm_writeDepthClamp: writeDepthClamp_default,
+ czm_writeLogDepth: writeLogDepth_default,
+ czm_writeNonPerspective: writeNonPerspective_default,
+ czm_XYZToRGB: XYZToRGB_default
+};
+
+// Source/Renderer/ShaderSource.js
+function removeComments(source) {
+ source = source.replace(/\/\/.*/g, "");
+ return source.replace(/\/\*\*[\s\S]*?\*\//gm, function(match) {
+ const numberOfLines = match.match(/\n/gm).length;
+ let replacement = "";
+ for (let lineNumber = 0; lineNumber < numberOfLines; ++lineNumber) {
+ replacement += "\n";
+ }
+ return replacement;
+ });
+}
+function getDependencyNode(name, glslSource, nodes) {
+ let dependencyNode;
+ for (let i = 0; i < nodes.length; ++i) {
+ if (nodes[i].name === name) {
+ dependencyNode = nodes[i];
+ }
+ }
+ if (!defined_default(dependencyNode)) {
+ glslSource = removeComments(glslSource);
+ dependencyNode = {
+ name,
+ glslSource,
+ dependsOn: [],
+ requiredBy: [],
+ evaluated: false
+ };
+ nodes.push(dependencyNode);
+ }
+ return dependencyNode;
+}
+function generateDependencies(currentNode, dependencyNodes) {
+ if (currentNode.evaluated) {
+ return;
+ }
+ currentNode.evaluated = true;
+ let czmMatches = currentNode.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);
+ if (defined_default(czmMatches) && czmMatches !== null) {
+ czmMatches = czmMatches.filter(function(elem, pos) {
+ return czmMatches.indexOf(elem) === pos;
+ });
+ czmMatches.forEach(function(element) {
+ if (element !== currentNode.name && ShaderSource._czmBuiltinsAndUniforms.hasOwnProperty(element)) {
+ const referencedNode = getDependencyNode(
+ element,
+ ShaderSource._czmBuiltinsAndUniforms[element],
+ dependencyNodes
+ );
+ currentNode.dependsOn.push(referencedNode);
+ referencedNode.requiredBy.push(currentNode);
+ generateDependencies(referencedNode, dependencyNodes);
+ }
+ });
+ }
+}
+function sortDependencies(dependencyNodes) {
+ const nodesWithoutIncomingEdges = [];
+ const allNodes = [];
+ while (dependencyNodes.length > 0) {
+ const node = dependencyNodes.pop();
+ allNodes.push(node);
+ if (node.requiredBy.length === 0) {
+ nodesWithoutIncomingEdges.push(node);
+ }
+ }
+ while (nodesWithoutIncomingEdges.length > 0) {
+ const currentNode = nodesWithoutIncomingEdges.shift();
+ dependencyNodes.push(currentNode);
+ for (let i = 0; i < currentNode.dependsOn.length; ++i) {
+ const referencedNode = currentNode.dependsOn[i];
+ const index = referencedNode.requiredBy.indexOf(currentNode);
+ referencedNode.requiredBy.splice(index, 1);
+ if (referencedNode.requiredBy.length === 0) {
+ nodesWithoutIncomingEdges.push(referencedNode);
+ }
+ }
+ }
+ const badNodes = [];
+ for (let j = 0; j < allNodes.length; ++j) {
+ if (allNodes[j].requiredBy.length !== 0) {
+ badNodes.push(allNodes[j]);
+ }
+ }
+ if (badNodes.length !== 0) {
+ let message = "A circular dependency was found in the following built-in functions/structs/constants: \n";
+ for (let k = 0; k < badNodes.length; ++k) {
+ message = `${message + badNodes[k].name}
+`;
+ }
+ throw new DeveloperError_default(message);
+ }
+}
+function getBuiltinsAndAutomaticUniforms(shaderSource) {
+ const dependencyNodes = [];
+ const root = getDependencyNode("main", shaderSource, dependencyNodes);
+ generateDependencies(root, dependencyNodes);
+ sortDependencies(dependencyNodes);
+ let builtinsSource = "";
+ for (let i = dependencyNodes.length - 1; i >= 0; --i) {
+ builtinsSource = `${builtinsSource + dependencyNodes[i].glslSource}
+`;
+ }
+ return builtinsSource.replace(root.glslSource, "");
+}
+function combineShader(shaderSource, isFragmentShader, context) {
+ let i;
+ let length3;
+ let combinedSources = "";
+ const sources = shaderSource.sources;
+ if (defined_default(sources)) {
+ for (i = 0, length3 = sources.length; i < length3; ++i) {
+ combinedSources += `
+#line 0
+${sources[i]}`;
+ }
+ }
+ combinedSources = removeComments(combinedSources);
+ let version2;
+ combinedSources = combinedSources.replace(/#version\s+(.*?)\n/gm, function(match, group1) {
+ if (defined_default(version2) && version2 !== group1) {
+ throw new DeveloperError_default(
+ `inconsistent versions found: ${version2} and ${group1}`
+ );
+ }
+ version2 = group1;
+ return "\n";
+ });
+ const extensions = [];
+ combinedSources = combinedSources.replace(/#extension.*\n/gm, function(match) {
+ extensions.push(match);
+ return "\n";
+ });
+ combinedSources = combinedSources.replace(
+ /precision\s(lowp|mediump|highp)\s(float|int);/,
+ ""
+ );
+ const pickColorQualifier = shaderSource.pickColorQualifier;
+ if (defined_default(pickColorQualifier)) {
+ combinedSources = ShaderSource.createPickFragmentShaderSource(
+ combinedSources,
+ pickColorQualifier
+ );
+ }
+ let result = "";
+ if (defined_default(version2)) {
+ result = `#version ${version2}
+`;
+ }
+ const extensionsLength = extensions.length;
+ for (i = 0; i < extensionsLength; i++) {
+ result += extensions[i];
+ }
+ if (isFragmentShader) {
+ result += "#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n#else\n precision mediump float;\n precision mediump int;\n #define highp mediump\n#endif\n\n";
+ }
+ const defines = shaderSource.defines;
+ if (defined_default(defines)) {
+ for (i = 0, length3 = defines.length; i < length3; ++i) {
+ const define2 = defines[i];
+ if (define2.length !== 0) {
+ result += `#define ${define2}
+`;
+ }
+ }
+ }
+ if (context.webgl2) {
+ result += "#define OUTPUT_DECLARATION\n\n";
+ }
+ if (context.textureFloatLinear) {
+ result += "#define OES_texture_float_linear\n\n";
+ }
+ if (context.floatingPointTexture) {
+ result += "#define OES_texture_float\n\n";
+ }
+ if (shaderSource.includeBuiltIns) {
+ result += getBuiltinsAndAutomaticUniforms(combinedSources);
+ }
+ result += "\n#line 0\n";
+ result += combinedSources;
+ if (context.webgl2) {
+ result = modernizeShader_default(result, isFragmentShader, true);
+ }
+ return result;
+}
+function ShaderSource(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const pickColorQualifier = options.pickColorQualifier;
+ if (defined_default(pickColorQualifier) && pickColorQualifier !== "uniform" && pickColorQualifier !== "varying") {
+ throw new DeveloperError_default(
+ "options.pickColorQualifier must be 'uniform' or 'varying'."
+ );
+ }
+ this.defines = defined_default(options.defines) ? options.defines.slice(0) : [];
+ this.sources = defined_default(options.sources) ? options.sources.slice(0) : [];
+ this.pickColorQualifier = pickColorQualifier;
+ this.includeBuiltIns = defaultValue_default(options.includeBuiltIns, true);
+}
+ShaderSource.prototype.clone = function() {
+ return new ShaderSource({
+ sources: this.sources,
+ defines: this.defines,
+ pickColorQualifier: this.pickColorQualifier,
+ includeBuiltIns: this.includeBuiltIns
+ });
+};
+ShaderSource.replaceMain = function(source, renamedMain) {
+ renamedMain = `void ${renamedMain}()`;
+ return source.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g, renamedMain);
+};
+ShaderSource.prototype.getCacheKey = function() {
+ const sortedDefines = this.defines.slice().sort();
+ const definesKey = sortedDefines.join(",");
+ const pickKey = this.pickColorQualifier;
+ const builtinsKey = this.includeBuiltIns;
+ const sourcesKey = this.sources.join("\n");
+ return `${definesKey}:${pickKey}:${builtinsKey}:${sourcesKey}`;
+};
+ShaderSource.prototype.createCombinedVertexShader = function(context) {
+ return combineShader(this, false, context);
+};
+ShaderSource.prototype.createCombinedFragmentShader = function(context) {
+ return combineShader(this, true, context);
+};
+ShaderSource._czmBuiltinsAndUniforms = {};
+for (const builtinName in CzmBuiltins_default) {
+ if (CzmBuiltins_default.hasOwnProperty(builtinName)) {
+ ShaderSource._czmBuiltinsAndUniforms[builtinName] = CzmBuiltins_default[builtinName];
+ }
+}
+for (const uniformName in AutomaticUniforms_default) {
+ if (AutomaticUniforms_default.hasOwnProperty(uniformName)) {
+ const uniform = AutomaticUniforms_default[uniformName];
+ if (typeof uniform.getDeclaration === "function") {
+ ShaderSource._czmBuiltinsAndUniforms[uniformName] = uniform.getDeclaration(uniformName);
+ }
+ }
+}
+ShaderSource.createPickVertexShaderSource = function(vertexShaderSource) {
+ const renamedVS = ShaderSource.replaceMain(
+ vertexShaderSource,
+ "czm_old_main"
+ );
+ const pickMain = "attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}";
+ return `${renamedVS}
+${pickMain}`;
+};
+ShaderSource.createPickFragmentShaderSource = function(fragmentShaderSource, pickColorQualifier) {
+ const renamedFS = ShaderSource.replaceMain(
+ fragmentShaderSource,
+ "czm_old_main"
+ );
+ const pickMain = `${pickColorQualifier} vec4 czm_pickColor;
+void main()
+{
+ czm_old_main();
+ if (gl_FragColor.a == 0.0) {
+ discard;
+ }
+ gl_FragColor = czm_pickColor;
+}`;
+ return `${renamedFS}
+${pickMain}`;
+};
+function containsDefine(shaderSource, define2) {
+ const defines = shaderSource.defines;
+ const definesLength = defines.length;
+ for (let i = 0; i < definesLength; ++i) {
+ if (defines[i] === define2) {
+ return true;
+ }
+ }
+ return false;
+}
+function containsString(shaderSource, string) {
+ const sources = shaderSource.sources;
+ const sourcesLength = sources.length;
+ for (let i = 0; i < sourcesLength; ++i) {
+ if (sources[i].indexOf(string) !== -1) {
+ return true;
+ }
+ }
+ return false;
+}
+function findFirstString(shaderSource, strings) {
+ const stringsLength = strings.length;
+ for (let i = 0; i < stringsLength; ++i) {
+ const string = strings[i];
+ if (containsString(shaderSource, string)) {
+ return string;
+ }
+ }
+ return void 0;
+}
+var normalVaryingNames = ["v_normalEC", "v_normal"];
+ShaderSource.findNormalVarying = function(shaderSource) {
+ if (containsString(shaderSource, "#ifdef HAS_NORMALS")) {
+ if (containsDefine(shaderSource, "HAS_NORMALS")) {
+ return "v_normalEC";
+ }
+ return void 0;
+ }
+ return findFirstString(shaderSource, normalVaryingNames);
+};
+var positionVaryingNames = ["v_positionEC"];
+ShaderSource.findPositionVarying = function(shaderSource) {
+ return findFirstString(shaderSource, positionVaryingNames);
+};
+var ShaderSource_default = ShaderSource;
+
+// Source/Renderer/ShaderCache.js
+function ShaderCache(context) {
+ this._context = context;
+ this._shaders = {};
+ this._numberOfShaders = 0;
+ this._shadersToRelease = {};
+}
+Object.defineProperties(ShaderCache.prototype, {
+ numberOfShaders: {
+ get: function() {
+ return this._numberOfShaders;
+ }
+ }
+});
+ShaderCache.prototype.replaceShaderProgram = function(options) {
+ if (defined_default(options.shaderProgram)) {
+ options.shaderProgram.destroy();
+ }
+ return this.getShaderProgram(options);
+};
+function toSortedJson(dictionary) {
+ const sortedKeys = Object.keys(dictionary).sort();
+ return JSON.stringify(dictionary, sortedKeys);
+}
+ShaderCache.prototype.getShaderProgram = function(options) {
+ let vertexShaderSource = options.vertexShaderSource;
+ let fragmentShaderSource = options.fragmentShaderSource;
+ const attributeLocations8 = options.attributeLocations;
+ if (typeof vertexShaderSource === "string") {
+ vertexShaderSource = new ShaderSource_default({
+ sources: [vertexShaderSource]
+ });
+ }
+ if (typeof fragmentShaderSource === "string") {
+ fragmentShaderSource = new ShaderSource_default({
+ sources: [fragmentShaderSource]
+ });
+ }
+ const vertexShaderKey = vertexShaderSource.getCacheKey();
+ const fragmentShaderKey = fragmentShaderSource.getCacheKey();
+ const attributeLocationKey = defined_default(attributeLocations8) ? toSortedJson(attributeLocations8) : "";
+ const keyword = `${vertexShaderKey}:${fragmentShaderKey}:${attributeLocationKey}`;
+ let cachedShader;
+ if (defined_default(this._shaders[keyword])) {
+ cachedShader = this._shaders[keyword];
+ delete this._shadersToRelease[keyword];
+ } else {
+ const context = this._context;
+ const vertexShaderText = vertexShaderSource.createCombinedVertexShader(
+ context
+ );
+ const fragmentShaderText = fragmentShaderSource.createCombinedFragmentShader(
+ context
+ );
+ const shaderProgram = new ShaderProgram_default({
+ gl: context._gl,
+ logShaderCompilation: context.logShaderCompilation,
+ debugShaders: context.debugShaders,
+ vertexShaderSource,
+ vertexShaderText,
+ fragmentShaderSource,
+ fragmentShaderText,
+ attributeLocations: attributeLocations8
+ });
+ cachedShader = {
+ cache: this,
+ shaderProgram,
+ keyword,
+ derivedKeywords: [],
+ count: 0
+ };
+ shaderProgram._cachedShader = cachedShader;
+ this._shaders[keyword] = cachedShader;
+ ++this._numberOfShaders;
+ }
+ ++cachedShader.count;
+ return cachedShader.shaderProgram;
+};
+ShaderCache.prototype.replaceDerivedShaderProgram = function(shaderProgram, keyword, options) {
+ const cachedShader = shaderProgram._cachedShader;
+ const derivedKeyword = keyword + cachedShader.keyword;
+ const cachedDerivedShader = this._shaders[derivedKeyword];
+ if (defined_default(cachedDerivedShader)) {
+ destroyShader(this, cachedDerivedShader);
+ const index = cachedShader.derivedKeywords.indexOf(keyword);
+ if (index > -1) {
+ cachedShader.derivedKeywords.splice(index, 1);
+ }
+ }
+ return this.createDerivedShaderProgram(shaderProgram, keyword, options);
+};
+ShaderCache.prototype.getDerivedShaderProgram = function(shaderProgram, keyword) {
+ const cachedShader = shaderProgram._cachedShader;
+ const derivedKeyword = keyword + cachedShader.keyword;
+ const cachedDerivedShader = this._shaders[derivedKeyword];
+ if (!defined_default(cachedDerivedShader)) {
+ return void 0;
+ }
+ return cachedDerivedShader.shaderProgram;
+};
+ShaderCache.prototype.createDerivedShaderProgram = function(shaderProgram, keyword, options) {
+ const cachedShader = shaderProgram._cachedShader;
+ const derivedKeyword = keyword + cachedShader.keyword;
+ let vertexShaderSource = options.vertexShaderSource;
+ let fragmentShaderSource = options.fragmentShaderSource;
+ const attributeLocations8 = options.attributeLocations;
+ if (typeof vertexShaderSource === "string") {
+ vertexShaderSource = new ShaderSource_default({
+ sources: [vertexShaderSource]
+ });
+ }
+ if (typeof fragmentShaderSource === "string") {
+ fragmentShaderSource = new ShaderSource_default({
+ sources: [fragmentShaderSource]
+ });
+ }
+ const context = this._context;
+ const vertexShaderText = vertexShaderSource.createCombinedVertexShader(
+ context
+ );
+ const fragmentShaderText = fragmentShaderSource.createCombinedFragmentShader(
+ context
+ );
+ const derivedShaderProgram = new ShaderProgram_default({
+ gl: context._gl,
+ logShaderCompilation: context.logShaderCompilation,
+ debugShaders: context.debugShaders,
+ vertexShaderSource,
+ vertexShaderText,
+ fragmentShaderSource,
+ fragmentShaderText,
+ attributeLocations: attributeLocations8
+ });
+ const derivedCachedShader = {
+ cache: this,
+ shaderProgram: derivedShaderProgram,
+ keyword: derivedKeyword,
+ derivedKeywords: [],
+ count: 0
+ };
+ cachedShader.derivedKeywords.push(keyword);
+ derivedShaderProgram._cachedShader = derivedCachedShader;
+ this._shaders[derivedKeyword] = derivedCachedShader;
+ return derivedShaderProgram;
+};
+function destroyShader(cache, cachedShader) {
+ const derivedKeywords = cachedShader.derivedKeywords;
+ const length3 = derivedKeywords.length;
+ for (let i = 0; i < length3; ++i) {
+ const keyword = derivedKeywords[i] + cachedShader.keyword;
+ const derivedCachedShader = cache._shaders[keyword];
+ destroyShader(cache, derivedCachedShader);
+ }
+ delete cache._shaders[cachedShader.keyword];
+ cachedShader.shaderProgram.finalDestroy();
+}
+ShaderCache.prototype.destroyReleasedShaderPrograms = function() {
+ const shadersToRelease = this._shadersToRelease;
+ for (const keyword in shadersToRelease) {
+ if (shadersToRelease.hasOwnProperty(keyword)) {
+ const cachedShader = shadersToRelease[keyword];
+ destroyShader(this, cachedShader);
+ --this._numberOfShaders;
+ }
+ }
+ this._shadersToRelease = {};
+};
+ShaderCache.prototype.releaseShaderProgram = function(shaderProgram) {
+ if (defined_default(shaderProgram)) {
+ const cachedShader = shaderProgram._cachedShader;
+ if (cachedShader && --cachedShader.count === 0) {
+ this._shadersToRelease[cachedShader.keyword] = cachedShader;
+ }
+ }
+};
+ShaderCache.prototype.isDestroyed = function() {
+ return false;
+};
+ShaderCache.prototype.destroy = function() {
+ const shaders = this._shaders;
+ for (const keyword in shaders) {
+ if (shaders.hasOwnProperty(keyword)) {
+ shaders[keyword].shaderProgram.finalDestroy();
+ }
+ }
+ return destroyObject_default(this);
+};
+var ShaderCache_default = ShaderCache;
+
+// Source/Renderer/Texture.js
+function Texture(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.context", options.context);
+ const context = options.context;
+ let width = options.width;
+ let height = options.height;
+ const source = options.source;
+ if (defined_default(source)) {
+ if (!defined_default(width)) {
+ width = defaultValue_default(source.videoWidth, source.width);
+ }
+ if (!defined_default(height)) {
+ height = defaultValue_default(source.videoHeight, source.height);
+ }
+ }
+ const pixelFormat = defaultValue_default(options.pixelFormat, PixelFormat_default.RGBA);
+ const pixelDatatype = defaultValue_default(
+ options.pixelDatatype,
+ PixelDatatype_default.UNSIGNED_BYTE
+ );
+ const internalFormat = PixelFormat_default.toInternalFormat(
+ pixelFormat,
+ pixelDatatype,
+ context
+ );
+ const isCompressed = PixelFormat_default.isCompressedFormat(internalFormat);
+ if (!defined_default(width) || !defined_default(height)) {
+ throw new DeveloperError_default(
+ "options requires a source field to create an initialized texture or width and height fields to create a blank texture."
+ );
+ }
+ Check_default.typeOf.number.greaterThan("width", width, 0);
+ if (width > ContextLimits_default.maximumTextureSize) {
+ throw new DeveloperError_default(
+ `Width must be less than or equal to the maximum texture size (${ContextLimits_default.maximumTextureSize}). Check maximumTextureSize.`
+ );
+ }
+ Check_default.typeOf.number.greaterThan("height", height, 0);
+ if (height > ContextLimits_default.maximumTextureSize) {
+ throw new DeveloperError_default(
+ `Height must be less than or equal to the maximum texture size (${ContextLimits_default.maximumTextureSize}). Check maximumTextureSize.`
+ );
+ }
+ if (!PixelFormat_default.validate(pixelFormat)) {
+ throw new DeveloperError_default("Invalid options.pixelFormat.");
+ }
+ if (!isCompressed && !PixelDatatype_default.validate(pixelDatatype)) {
+ throw new DeveloperError_default("Invalid options.pixelDatatype.");
+ }
+ if (pixelFormat === PixelFormat_default.DEPTH_COMPONENT && pixelDatatype !== PixelDatatype_default.UNSIGNED_SHORT && pixelDatatype !== PixelDatatype_default.UNSIGNED_INT) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT."
+ );
+ }
+ if (pixelFormat === PixelFormat_default.DEPTH_STENCIL && pixelDatatype !== PixelDatatype_default.UNSIGNED_INT_24_8) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8."
+ );
+ }
+ if (pixelDatatype === PixelDatatype_default.FLOAT && !context.floatingPointTexture) {
+ throw new DeveloperError_default(
+ "When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture."
+ );
+ }
+ if (pixelDatatype === PixelDatatype_default.HALF_FLOAT && !context.halfFloatingPointTexture) {
+ throw new DeveloperError_default(
+ "When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture."
+ );
+ }
+ if (PixelFormat_default.isDepthFormat(pixelFormat)) {
+ if (defined_default(source)) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided."
+ );
+ }
+ if (!context.depthTexture) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture."
+ );
+ }
+ }
+ if (isCompressed) {
+ if (!defined_default(source) || !defined_default(source.arrayBufferView)) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is compressed, options.source.arrayBufferView must be defined."
+ );
+ }
+ if (PixelFormat_default.isDXTFormat(internalFormat) && !context.s3tc) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc."
+ );
+ } else if (PixelFormat_default.isPVRTCFormat(internalFormat) && !context.pvrtc) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc."
+ );
+ } else if (PixelFormat_default.isASTCFormat(internalFormat) && !context.astc) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc."
+ );
+ } else if (PixelFormat_default.isETC2Format(internalFormat) && !context.etc) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc."
+ );
+ } else if (PixelFormat_default.isETC1Format(internalFormat) && !context.etc1) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1."
+ );
+ } else if (PixelFormat_default.isBC7Format(internalFormat) && !context.bc7) {
+ throw new DeveloperError_default(
+ "When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7."
+ );
+ }
+ if (PixelFormat_default.compressedTextureSizeInBytes(
+ internalFormat,
+ width,
+ height
+ ) !== source.arrayBufferView.byteLength) {
+ throw new DeveloperError_default(
+ "The byte length of the array buffer is invalid for the compressed texture with the given width and height."
+ );
+ }
+ }
+ const preMultiplyAlpha = options.preMultiplyAlpha || pixelFormat === PixelFormat_default.RGB || pixelFormat === PixelFormat_default.LUMINANCE;
+ const flipY = defaultValue_default(options.flipY, true);
+ const skipColorSpaceConversion = defaultValue_default(
+ options.skipColorSpaceConversion,
+ false
+ );
+ let initialized = true;
+ const gl = context._gl;
+ const textureTarget = gl.TEXTURE_2D;
+ const texture = gl.createTexture();
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(textureTarget, texture);
+ let unpackAlignment = 4;
+ if (defined_default(source) && defined_default(source.arrayBufferView) && !isCompressed) {
+ unpackAlignment = PixelFormat_default.alignmentInBytes(
+ pixelFormat,
+ pixelDatatype,
+ width
+ );
+ }
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);
+ if (skipColorSpaceConversion) {
+ gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
+ } else {
+ gl.pixelStorei(
+ gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,
+ gl.BROWSER_DEFAULT_WEBGL
+ );
+ }
+ if (defined_default(source)) {
+ if (defined_default(source.arrayBufferView)) {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ let arrayBufferView = source.arrayBufferView;
+ let i, mipWidth, mipHeight;
+ if (isCompressed) {
+ gl.compressedTexImage2D(
+ textureTarget,
+ 0,
+ internalFormat,
+ width,
+ height,
+ 0,
+ arrayBufferView
+ );
+ if (defined_default(source.mipLevels)) {
+ mipWidth = width;
+ mipHeight = height;
+ for (i = 0; i < source.mipLevels.length; ++i) {
+ mipWidth = Math.floor(mipWidth / 2) | 0;
+ if (mipWidth < 1) {
+ mipWidth = 1;
+ }
+ mipHeight = Math.floor(mipHeight / 2) | 0;
+ if (mipHeight < 1) {
+ mipHeight = 1;
+ }
+ gl.compressedTexImage2D(
+ textureTarget,
+ i + 1,
+ internalFormat,
+ mipWidth,
+ mipHeight,
+ 0,
+ source.mipLevels[i]
+ );
+ }
+ }
+ } else {
+ if (flipY) {
+ arrayBufferView = PixelFormat_default.flipY(
+ arrayBufferView,
+ pixelFormat,
+ pixelDatatype,
+ width,
+ height
+ );
+ }
+ gl.texImage2D(
+ textureTarget,
+ 0,
+ internalFormat,
+ width,
+ height,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ arrayBufferView
+ );
+ if (defined_default(source.mipLevels)) {
+ mipWidth = width;
+ mipHeight = height;
+ for (i = 0; i < source.mipLevels.length; ++i) {
+ mipWidth = Math.floor(mipWidth / 2) | 0;
+ if (mipWidth < 1) {
+ mipWidth = 1;
+ }
+ mipHeight = Math.floor(mipHeight / 2) | 0;
+ if (mipHeight < 1) {
+ mipHeight = 1;
+ }
+ gl.texImage2D(
+ textureTarget,
+ i + 1,
+ internalFormat,
+ mipWidth,
+ mipHeight,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ source.mipLevels[i]
+ );
+ }
+ }
+ }
+ } else if (defined_default(source.framebuffer)) {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ if (source.framebuffer !== context.defaultFramebuffer) {
+ source.framebuffer._bind();
+ }
+ gl.copyTexImage2D(
+ textureTarget,
+ 0,
+ internalFormat,
+ source.xOffset,
+ source.yOffset,
+ width,
+ height,
+ 0
+ );
+ if (source.framebuffer !== context.defaultFramebuffer) {
+ source.framebuffer._unBind();
+ }
+ } else {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
+ gl.texImage2D(
+ textureTarget,
+ 0,
+ internalFormat,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ source
+ );
+ }
+ } else {
+ gl.texImage2D(
+ textureTarget,
+ 0,
+ internalFormat,
+ width,
+ height,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ null
+ );
+ initialized = false;
+ }
+ gl.bindTexture(textureTarget, null);
+ let sizeInBytes;
+ if (isCompressed) {
+ sizeInBytes = PixelFormat_default.compressedTextureSizeInBytes(
+ pixelFormat,
+ width,
+ height
+ );
+ } else {
+ sizeInBytes = PixelFormat_default.textureSizeInBytes(
+ pixelFormat,
+ pixelDatatype,
+ width,
+ height
+ );
+ }
+ this._id = createGuid_default();
+ this._context = context;
+ this._textureFilterAnisotropic = context._textureFilterAnisotropic;
+ this._textureTarget = textureTarget;
+ this._texture = texture;
+ this._internalFormat = internalFormat;
+ this._pixelFormat = pixelFormat;
+ this._pixelDatatype = pixelDatatype;
+ this._width = width;
+ this._height = height;
+ this._dimensions = new Cartesian2_default(width, height);
+ this._hasMipmap = false;
+ this._sizeInBytes = sizeInBytes;
+ this._preMultiplyAlpha = preMultiplyAlpha;
+ this._flipY = flipY;
+ this._initialized = initialized;
+ this._sampler = void 0;
+ this.sampler = defined_default(options.sampler) ? options.sampler : new Sampler_default();
+}
+Texture.create = function(options) {
+ return new Texture(options);
+};
+Texture.fromFramebuffer = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.context", options.context);
+ const context = options.context;
+ const gl = context._gl;
+ const pixelFormat = defaultValue_default(options.pixelFormat, PixelFormat_default.RGB);
+ const framebufferXOffset = defaultValue_default(options.framebufferXOffset, 0);
+ const framebufferYOffset = defaultValue_default(options.framebufferYOffset, 0);
+ const width = defaultValue_default(options.width, gl.drawingBufferWidth);
+ const height = defaultValue_default(options.height, gl.drawingBufferHeight);
+ const framebuffer = options.framebuffer;
+ if (!PixelFormat_default.validate(pixelFormat)) {
+ throw new DeveloperError_default("Invalid pixelFormat.");
+ }
+ if (PixelFormat_default.isDepthFormat(pixelFormat) || PixelFormat_default.isCompressedFormat(pixelFormat)) {
+ throw new DeveloperError_default(
+ "pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format."
+ );
+ }
+ Check_default.defined("options.context", options.context);
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "framebufferXOffset",
+ framebufferXOffset,
+ 0
+ );
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "framebufferYOffset",
+ framebufferYOffset,
+ 0
+ );
+ if (framebufferXOffset + width > gl.drawingBufferWidth) {
+ throw new DeveloperError_default(
+ "framebufferXOffset + width must be less than or equal to drawingBufferWidth"
+ );
+ }
+ if (framebufferYOffset + height > gl.drawingBufferHeight) {
+ throw new DeveloperError_default(
+ "framebufferYOffset + height must be less than or equal to drawingBufferHeight."
+ );
+ }
+ const texture = new Texture({
+ context,
+ width,
+ height,
+ pixelFormat,
+ source: {
+ framebuffer: defined_default(framebuffer) ? framebuffer : context.defaultFramebuffer,
+ xOffset: framebufferXOffset,
+ yOffset: framebufferYOffset,
+ width,
+ height
+ }
+ });
+ return texture;
+};
+Object.defineProperties(Texture.prototype, {
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ sampler: {
+ get: function() {
+ return this._sampler;
+ },
+ set: function(sampler) {
+ let minificationFilter = sampler.minificationFilter;
+ let magnificationFilter = sampler.magnificationFilter;
+ const context = this._context;
+ const pixelFormat = this._pixelFormat;
+ const pixelDatatype = this._pixelDatatype;
+ const mipmap = minificationFilter === TextureMinificationFilter_default.NEAREST_MIPMAP_NEAREST || minificationFilter === TextureMinificationFilter_default.NEAREST_MIPMAP_LINEAR || minificationFilter === TextureMinificationFilter_default.LINEAR_MIPMAP_NEAREST || minificationFilter === TextureMinificationFilter_default.LINEAR_MIPMAP_LINEAR;
+ if (pixelDatatype === PixelDatatype_default.FLOAT && !context.textureFloatLinear || pixelDatatype === PixelDatatype_default.HALF_FLOAT && !context.textureHalfFloatLinear) {
+ minificationFilter = mipmap ? TextureMinificationFilter_default.NEAREST_MIPMAP_NEAREST : TextureMinificationFilter_default.NEAREST;
+ magnificationFilter = TextureMagnificationFilter_default.NEAREST;
+ }
+ if (context.webgl2) {
+ if (PixelFormat_default.isDepthFormat(pixelFormat)) {
+ minificationFilter = TextureMinificationFilter_default.NEAREST;
+ magnificationFilter = TextureMagnificationFilter_default.NEAREST;
+ }
+ }
+ const gl = context._gl;
+ const target = this._textureTarget;
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(target, this._texture);
+ gl.texParameteri(target, gl.TEXTURE_MIN_FILTER, minificationFilter);
+ gl.texParameteri(target, gl.TEXTURE_MAG_FILTER, magnificationFilter);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_S, sampler.wrapS);
+ gl.texParameteri(target, gl.TEXTURE_WRAP_T, sampler.wrapT);
+ if (defined_default(this._textureFilterAnisotropic)) {
+ gl.texParameteri(
+ target,
+ this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,
+ sampler.maximumAnisotropy
+ );
+ }
+ gl.bindTexture(target, null);
+ this._sampler = sampler;
+ }
+ },
+ pixelFormat: {
+ get: function() {
+ return this._pixelFormat;
+ }
+ },
+ pixelDatatype: {
+ get: function() {
+ return this._pixelDatatype;
+ }
+ },
+ dimensions: {
+ get: function() {
+ return this._dimensions;
+ }
+ },
+ preMultiplyAlpha: {
+ get: function() {
+ return this._preMultiplyAlpha;
+ }
+ },
+ flipY: {
+ get: function() {
+ return this._flipY;
+ }
+ },
+ width: {
+ get: function() {
+ return this._width;
+ }
+ },
+ height: {
+ get: function() {
+ return this._height;
+ }
+ },
+ sizeInBytes: {
+ get: function() {
+ if (this._hasMipmap) {
+ return Math.floor(this._sizeInBytes * 4 / 3);
+ }
+ return this._sizeInBytes;
+ }
+ },
+ _target: {
+ get: function() {
+ return this._textureTarget;
+ }
+ }
+});
+Texture.prototype.copyFrom = function(options) {
+ Check_default.defined("options", options);
+ const xOffset = defaultValue_default(options.xOffset, 0);
+ const yOffset = defaultValue_default(options.yOffset, 0);
+ Check_default.defined("options.source", options.source);
+ if (PixelFormat_default.isDepthFormat(this._pixelFormat)) {
+ throw new DeveloperError_default(
+ "Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL."
+ );
+ }
+ if (PixelFormat_default.isCompressedFormat(this._pixelFormat)) {
+ throw new DeveloperError_default(
+ "Cannot call copyFrom with a compressed texture pixel format."
+ );
+ }
+ Check_default.typeOf.number.greaterThanOrEquals("xOffset", xOffset, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("yOffset", yOffset, 0);
+ Check_default.typeOf.number.lessThanOrEquals(
+ "xOffset + options.source.width",
+ xOffset + options.source.width,
+ this._width
+ );
+ Check_default.typeOf.number.lessThanOrEquals(
+ "yOffset + options.source.height",
+ yOffset + options.source.height,
+ this._height
+ );
+ const source = options.source;
+ const context = this._context;
+ const gl = context._gl;
+ const target = this._textureTarget;
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(target, this._texture);
+ const width = source.width;
+ const height = source.height;
+ let arrayBufferView = source.arrayBufferView;
+ const textureWidth = this._width;
+ const textureHeight = this._height;
+ const internalFormat = this._internalFormat;
+ const pixelFormat = this._pixelFormat;
+ const pixelDatatype = this._pixelDatatype;
+ const preMultiplyAlpha = this._preMultiplyAlpha;
+ const flipY = this._flipY;
+ const skipColorSpaceConversion = defaultValue_default(
+ options.skipColorSpaceConversion,
+ false
+ );
+ let unpackAlignment = 4;
+ if (defined_default(arrayBufferView)) {
+ unpackAlignment = PixelFormat_default.alignmentInBytes(
+ pixelFormat,
+ pixelDatatype,
+ width
+ );
+ }
+ gl.pixelStorei(gl.UNPACK_ALIGNMENT, unpackAlignment);
+ if (skipColorSpaceConversion) {
+ gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
+ } else {
+ gl.pixelStorei(
+ gl.UNPACK_COLORSPACE_CONVERSION_WEBGL,
+ gl.BROWSER_DEFAULT_WEBGL
+ );
+ }
+ let uploaded = false;
+ if (!this._initialized) {
+ if (xOffset === 0 && yOffset === 0 && width === textureWidth && height === textureHeight) {
+ if (defined_default(arrayBufferView)) {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ if (flipY) {
+ arrayBufferView = PixelFormat_default.flipY(
+ arrayBufferView,
+ pixelFormat,
+ pixelDatatype,
+ textureWidth,
+ textureHeight
+ );
+ }
+ gl.texImage2D(
+ target,
+ 0,
+ internalFormat,
+ textureWidth,
+ textureHeight,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ arrayBufferView
+ );
+ } else {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
+ gl.texImage2D(
+ target,
+ 0,
+ internalFormat,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ source
+ );
+ }
+ uploaded = true;
+ } else {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ const bufferView = PixelFormat_default.createTypedArray(
+ pixelFormat,
+ pixelDatatype,
+ textureWidth,
+ textureHeight
+ );
+ gl.texImage2D(
+ target,
+ 0,
+ internalFormat,
+ textureWidth,
+ textureHeight,
+ 0,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ bufferView
+ );
+ }
+ this._initialized = true;
+ }
+ if (!uploaded) {
+ if (defined_default(arrayBufferView)) {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+ if (flipY) {
+ arrayBufferView = PixelFormat_default.flipY(
+ arrayBufferView,
+ pixelFormat,
+ pixelDatatype,
+ width,
+ height
+ );
+ }
+ gl.texSubImage2D(
+ target,
+ 0,
+ xOffset,
+ yOffset,
+ width,
+ height,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ arrayBufferView
+ );
+ } else {
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, preMultiplyAlpha);
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY);
+ gl.texSubImage2D(
+ target,
+ 0,
+ xOffset,
+ yOffset,
+ pixelFormat,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, context),
+ source
+ );
+ }
+ }
+ gl.bindTexture(target, null);
+};
+Texture.prototype.copyFromFramebuffer = function(xOffset, yOffset, framebufferXOffset, framebufferYOffset, width, height) {
+ xOffset = defaultValue_default(xOffset, 0);
+ yOffset = defaultValue_default(yOffset, 0);
+ framebufferXOffset = defaultValue_default(framebufferXOffset, 0);
+ framebufferYOffset = defaultValue_default(framebufferYOffset, 0);
+ width = defaultValue_default(width, this._width);
+ height = defaultValue_default(height, this._height);
+ if (PixelFormat_default.isDepthFormat(this._pixelFormat)) {
+ throw new DeveloperError_default(
+ "Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL."
+ );
+ }
+ if (this._pixelDatatype === PixelDatatype_default.FLOAT) {
+ throw new DeveloperError_default(
+ "Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT."
+ );
+ }
+ if (this._pixelDatatype === PixelDatatype_default.HALF_FLOAT) {
+ throw new DeveloperError_default(
+ "Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT."
+ );
+ }
+ if (PixelFormat_default.isCompressedFormat(this._pixelFormat)) {
+ throw new DeveloperError_default(
+ "Cannot call copyFrom with a compressed texture pixel format."
+ );
+ }
+ Check_default.typeOf.number.greaterThanOrEquals("xOffset", xOffset, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("yOffset", yOffset, 0);
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "framebufferXOffset",
+ framebufferXOffset,
+ 0
+ );
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "framebufferYOffset",
+ framebufferYOffset,
+ 0
+ );
+ Check_default.typeOf.number.lessThanOrEquals(
+ "xOffset + width",
+ xOffset + width,
+ this._width
+ );
+ Check_default.typeOf.number.lessThanOrEquals(
+ "yOffset + height",
+ yOffset + height,
+ this._height
+ );
+ const gl = this._context._gl;
+ const target = this._textureTarget;
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(target, this._texture);
+ gl.copyTexSubImage2D(
+ target,
+ 0,
+ xOffset,
+ yOffset,
+ framebufferXOffset,
+ framebufferYOffset,
+ width,
+ height
+ );
+ gl.bindTexture(target, null);
+ this._initialized = true;
+};
+Texture.prototype.generateMipmap = function(hint) {
+ hint = defaultValue_default(hint, MipmapHint_default.DONT_CARE);
+ if (PixelFormat_default.isDepthFormat(this._pixelFormat)) {
+ throw new DeveloperError_default(
+ "Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL."
+ );
+ }
+ if (PixelFormat_default.isCompressedFormat(this._pixelFormat)) {
+ throw new DeveloperError_default(
+ "Cannot call generateMipmap with a compressed pixel format."
+ );
+ }
+ if (!this._context.webgl2) {
+ if (this._width > 1 && !Math_default.isPowerOfTwo(this._width)) {
+ throw new DeveloperError_default(
+ "width must be a power of two to call generateMipmap() in a WebGL1 context."
+ );
+ }
+ if (this._height > 1 && !Math_default.isPowerOfTwo(this._height)) {
+ throw new DeveloperError_default(
+ "height must be a power of two to call generateMipmap() in a WebGL1 context."
+ );
+ }
+ }
+ if (!MipmapHint_default.validate(hint)) {
+ throw new DeveloperError_default("hint is invalid.");
+ }
+ this._hasMipmap = true;
+ const gl = this._context._gl;
+ const target = this._textureTarget;
+ gl.hint(gl.GENERATE_MIPMAP_HINT, hint);
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(target, this._texture);
+ gl.generateMipmap(target);
+ gl.bindTexture(target, null);
+};
+Texture.prototype.isDestroyed = function() {
+ return false;
+};
+Texture.prototype.destroy = function() {
+ this._context._gl.deleteTexture(this._texture);
+ return destroyObject_default(this);
+};
+var Texture_default = Texture;
+
+// Source/Renderer/TextureCache.js
+function TextureCache() {
+ this._textures = {};
+ this._numberOfTextures = 0;
+ this._texturesToRelease = {};
+}
+Object.defineProperties(TextureCache.prototype, {
+ numberOfTextures: {
+ get: function() {
+ return this._numberOfTextures;
+ }
+ }
+});
+TextureCache.prototype.getTexture = function(keyword) {
+ const cachedTexture = this._textures[keyword];
+ if (!defined_default(cachedTexture)) {
+ return void 0;
+ }
+ delete this._texturesToRelease[keyword];
+ ++cachedTexture.count;
+ return cachedTexture.texture;
+};
+TextureCache.prototype.addTexture = function(keyword, texture) {
+ const cachedTexture = {
+ texture,
+ count: 1
+ };
+ texture.finalDestroy = texture.destroy;
+ const that = this;
+ texture.destroy = function() {
+ if (--cachedTexture.count === 0) {
+ that._texturesToRelease[keyword] = cachedTexture;
+ }
+ };
+ this._textures[keyword] = cachedTexture;
+ ++this._numberOfTextures;
+};
+TextureCache.prototype.destroyReleasedTextures = function() {
+ const texturesToRelease = this._texturesToRelease;
+ for (const keyword in texturesToRelease) {
+ if (texturesToRelease.hasOwnProperty(keyword)) {
+ const cachedTexture = texturesToRelease[keyword];
+ delete this._textures[keyword];
+ cachedTexture.texture.finalDestroy();
+ --this._numberOfTextures;
+ }
+ }
+ this._texturesToRelease = {};
+};
+TextureCache.prototype.isDestroyed = function() {
+ return false;
+};
+TextureCache.prototype.destroy = function() {
+ const textures = this._textures;
+ for (const keyword in textures) {
+ if (textures.hasOwnProperty(keyword)) {
+ textures[keyword].texture.finalDestroy();
+ }
+ }
+ return destroyObject_default(this);
+};
+var TextureCache_default = TextureCache;
+
+// Source/Core/EncodedCartesian3.js
+function EncodedCartesian3() {
+ this.high = Cartesian3_default.clone(Cartesian3_default.ZERO);
+ this.low = Cartesian3_default.clone(Cartesian3_default.ZERO);
+}
+EncodedCartesian3.encode = function(value, result) {
+ Check_default.typeOf.number("value", value);
+ if (!defined_default(result)) {
+ result = {
+ high: 0,
+ low: 0
+ };
+ }
+ let doubleHigh;
+ if (value >= 0) {
+ doubleHigh = Math.floor(value / 65536) * 65536;
+ result.high = doubleHigh;
+ result.low = value - doubleHigh;
+ } else {
+ doubleHigh = Math.floor(-value / 65536) * 65536;
+ result.high = -doubleHigh;
+ result.low = value + doubleHigh;
+ }
+ return result;
+};
+var scratchEncode = {
+ high: 0,
+ low: 0
+};
+EncodedCartesian3.fromCartesian = function(cartesian11, result) {
+ Check_default.typeOf.object("cartesian", cartesian11);
+ if (!defined_default(result)) {
+ result = new EncodedCartesian3();
+ }
+ const high = result.high;
+ const low = result.low;
+ EncodedCartesian3.encode(cartesian11.x, scratchEncode);
+ high.x = scratchEncode.high;
+ low.x = scratchEncode.low;
+ EncodedCartesian3.encode(cartesian11.y, scratchEncode);
+ high.y = scratchEncode.high;
+ low.y = scratchEncode.low;
+ EncodedCartesian3.encode(cartesian11.z, scratchEncode);
+ high.z = scratchEncode.high;
+ low.z = scratchEncode.low;
+ return result;
+};
+var encodedP = new EncodedCartesian3();
+EncodedCartesian3.writeElements = function(cartesian11, cartesianArray, index) {
+ Check_default.defined("cartesianArray", cartesianArray);
+ Check_default.typeOf.number("index", index);
+ Check_default.typeOf.number.greaterThanOrEquals("index", index, 0);
+ EncodedCartesian3.fromCartesian(cartesian11, encodedP);
+ const high = encodedP.high;
+ const low = encodedP.low;
+ cartesianArray[index] = high.x;
+ cartesianArray[index + 1] = high.y;
+ cartesianArray[index + 2] = high.z;
+ cartesianArray[index + 3] = low.x;
+ cartesianArray[index + 4] = low.y;
+ cartesianArray[index + 5] = low.z;
+};
+var EncodedCartesian3_default = EncodedCartesian3;
+
+// Source/Core/Plane.js
+function Plane(normal2, distance2) {
+ Check_default.typeOf.object("normal", normal2);
+ if (!Math_default.equalsEpsilon(
+ Cartesian3_default.magnitude(normal2),
+ 1,
+ Math_default.EPSILON6
+ )) {
+ throw new DeveloperError_default("normal must be normalized.");
+ }
+ Check_default.typeOf.number("distance", distance2);
+ this.normal = Cartesian3_default.clone(normal2);
+ this.distance = distance2;
+}
+Plane.fromPointNormal = function(point, normal2, result) {
+ Check_default.typeOf.object("point", point);
+ Check_default.typeOf.object("normal", normal2);
+ if (!Math_default.equalsEpsilon(
+ Cartesian3_default.magnitude(normal2),
+ 1,
+ Math_default.EPSILON6
+ )) {
+ throw new DeveloperError_default("normal must be normalized.");
+ }
+ const distance2 = -Cartesian3_default.dot(normal2, point);
+ if (!defined_default(result)) {
+ return new Plane(normal2, distance2);
+ }
+ Cartesian3_default.clone(normal2, result.normal);
+ result.distance = distance2;
+ return result;
+};
+var scratchNormal = new Cartesian3_default();
+Plane.fromCartesian4 = function(coefficients, result) {
+ Check_default.typeOf.object("coefficients", coefficients);
+ const normal2 = Cartesian3_default.fromCartesian4(coefficients, scratchNormal);
+ const distance2 = coefficients.w;
+ if (!Math_default.equalsEpsilon(
+ Cartesian3_default.magnitude(normal2),
+ 1,
+ Math_default.EPSILON6
+ )) {
+ throw new DeveloperError_default("normal must be normalized.");
+ }
+ if (!defined_default(result)) {
+ return new Plane(normal2, distance2);
+ }
+ Cartesian3_default.clone(normal2, result.normal);
+ result.distance = distance2;
+ return result;
+};
+Plane.getPointDistance = function(plane, point) {
+ Check_default.typeOf.object("plane", plane);
+ Check_default.typeOf.object("point", point);
+ return Cartesian3_default.dot(plane.normal, point) + plane.distance;
+};
+var scratchCartesian = new Cartesian3_default();
+Plane.projectPointOntoPlane = function(plane, point, result) {
+ Check_default.typeOf.object("plane", plane);
+ Check_default.typeOf.object("point", point);
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ const pointDistance = Plane.getPointDistance(plane, point);
+ const scaledNormal = Cartesian3_default.multiplyByScalar(
+ plane.normal,
+ pointDistance,
+ scratchCartesian
+ );
+ return Cartesian3_default.subtract(point, scaledNormal, result);
+};
+var scratchInverseTranspose = new Matrix4_default();
+var scratchPlaneCartesian4 = new Cartesian4_default();
+var scratchTransformNormal = new Cartesian3_default();
+Plane.transform = function(plane, transform3, result) {
+ Check_default.typeOf.object("plane", plane);
+ Check_default.typeOf.object("transform", transform3);
+ const normal2 = plane.normal;
+ const distance2 = plane.distance;
+ const inverseTranspose2 = Matrix4_default.inverseTranspose(
+ transform3,
+ scratchInverseTranspose
+ );
+ let planeAsCartesian4 = Cartesian4_default.fromElements(
+ normal2.x,
+ normal2.y,
+ normal2.z,
+ distance2,
+ scratchPlaneCartesian4
+ );
+ planeAsCartesian4 = Matrix4_default.multiplyByVector(
+ inverseTranspose2,
+ planeAsCartesian4,
+ planeAsCartesian4
+ );
+ const transformedNormal = Cartesian3_default.fromCartesian4(
+ planeAsCartesian4,
+ scratchTransformNormal
+ );
+ planeAsCartesian4 = Cartesian4_default.divideByScalar(
+ planeAsCartesian4,
+ Cartesian3_default.magnitude(transformedNormal),
+ planeAsCartesian4
+ );
+ return Plane.fromCartesian4(planeAsCartesian4, result);
+};
+Plane.clone = function(plane, result) {
+ Check_default.typeOf.object("plane", plane);
+ if (!defined_default(result)) {
+ return new Plane(plane.normal, plane.distance);
+ }
+ Cartesian3_default.clone(plane.normal, result.normal);
+ result.distance = plane.distance;
+ return result;
+};
+Plane.equals = function(left, right) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ return left.distance === right.distance && Cartesian3_default.equals(left.normal, right.normal);
+};
+Plane.ORIGIN_XY_PLANE = Object.freeze(new Plane(Cartesian3_default.UNIT_Z, 0));
+Plane.ORIGIN_YZ_PLANE = Object.freeze(new Plane(Cartesian3_default.UNIT_X, 0));
+Plane.ORIGIN_ZX_PLANE = Object.freeze(new Plane(Cartesian3_default.UNIT_Y, 0));
+var Plane_default = Plane;
+
+// Source/Core/CullingVolume.js
+function CullingVolume(planes) {
+ this.planes = defaultValue_default(planes, []);
+}
+var faces = [new Cartesian3_default(), new Cartesian3_default(), new Cartesian3_default()];
+Cartesian3_default.clone(Cartesian3_default.UNIT_X, faces[0]);
+Cartesian3_default.clone(Cartesian3_default.UNIT_Y, faces[1]);
+Cartesian3_default.clone(Cartesian3_default.UNIT_Z, faces[2]);
+var scratchPlaneCenter = new Cartesian3_default();
+var scratchPlaneNormal = new Cartesian3_default();
+var scratchPlane = new Plane_default(new Cartesian3_default(1, 0, 0), 0);
+CullingVolume.fromBoundingSphere = function(boundingSphere, result) {
+ if (!defined_default(boundingSphere)) {
+ throw new DeveloperError_default("boundingSphere is required.");
+ }
+ if (!defined_default(result)) {
+ result = new CullingVolume();
+ }
+ const length3 = faces.length;
+ const planes = result.planes;
+ planes.length = 2 * length3;
+ const center = boundingSphere.center;
+ const radius = boundingSphere.radius;
+ let planeIndex = 0;
+ for (let i = 0; i < length3; ++i) {
+ const faceNormal = faces[i];
+ let plane0 = planes[planeIndex];
+ let plane1 = planes[planeIndex + 1];
+ if (!defined_default(plane0)) {
+ plane0 = planes[planeIndex] = new Cartesian4_default();
+ }
+ if (!defined_default(plane1)) {
+ plane1 = planes[planeIndex + 1] = new Cartesian4_default();
+ }
+ Cartesian3_default.multiplyByScalar(faceNormal, -radius, scratchPlaneCenter);
+ Cartesian3_default.add(center, scratchPlaneCenter, scratchPlaneCenter);
+ plane0.x = faceNormal.x;
+ plane0.y = faceNormal.y;
+ plane0.z = faceNormal.z;
+ plane0.w = -Cartesian3_default.dot(faceNormal, scratchPlaneCenter);
+ Cartesian3_default.multiplyByScalar(faceNormal, radius, scratchPlaneCenter);
+ Cartesian3_default.add(center, scratchPlaneCenter, scratchPlaneCenter);
+ plane1.x = -faceNormal.x;
+ plane1.y = -faceNormal.y;
+ plane1.z = -faceNormal.z;
+ plane1.w = -Cartesian3_default.dot(
+ Cartesian3_default.negate(faceNormal, scratchPlaneNormal),
+ scratchPlaneCenter
+ );
+ planeIndex += 2;
+ }
+ return result;
+};
+CullingVolume.prototype.computeVisibility = function(boundingVolume) {
+ if (!defined_default(boundingVolume)) {
+ throw new DeveloperError_default("boundingVolume is required.");
+ }
+ const planes = this.planes;
+ let intersecting = false;
+ for (let k = 0, len = planes.length; k < len; ++k) {
+ const result = boundingVolume.intersectPlane(
+ Plane_default.fromCartesian4(planes[k], scratchPlane)
+ );
+ if (result === Intersect_default.OUTSIDE) {
+ return Intersect_default.OUTSIDE;
+ } else if (result === Intersect_default.INTERSECTING) {
+ intersecting = true;
+ }
+ }
+ return intersecting ? Intersect_default.INTERSECTING : Intersect_default.INSIDE;
+};
+CullingVolume.prototype.computeVisibilityWithPlaneMask = function(boundingVolume, parentPlaneMask) {
+ if (!defined_default(boundingVolume)) {
+ throw new DeveloperError_default("boundingVolume is required.");
+ }
+ if (!defined_default(parentPlaneMask)) {
+ throw new DeveloperError_default("parentPlaneMask is required.");
+ }
+ if (parentPlaneMask === CullingVolume.MASK_OUTSIDE || parentPlaneMask === CullingVolume.MASK_INSIDE) {
+ return parentPlaneMask;
+ }
+ let mask = CullingVolume.MASK_INSIDE;
+ const planes = this.planes;
+ for (let k = 0, len = planes.length; k < len; ++k) {
+ const flag = k < 31 ? 1 << k : 0;
+ if (k < 31 && (parentPlaneMask & flag) === 0) {
+ continue;
+ }
+ const result = boundingVolume.intersectPlane(
+ Plane_default.fromCartesian4(planes[k], scratchPlane)
+ );
+ if (result === Intersect_default.OUTSIDE) {
+ return CullingVolume.MASK_OUTSIDE;
+ } else if (result === Intersect_default.INTERSECTING) {
+ mask |= flag;
+ }
+ }
+ return mask;
+};
+CullingVolume.MASK_OUTSIDE = 4294967295;
+CullingVolume.MASK_INSIDE = 0;
+CullingVolume.MASK_INDETERMINATE = 2147483647;
+var CullingVolume_default = CullingVolume;
+
+// Source/Core/OrthographicOffCenterFrustum.js
+function OrthographicOffCenterFrustum(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.left = options.left;
+ this._left = void 0;
+ this.right = options.right;
+ this._right = void 0;
+ this.top = options.top;
+ this._top = void 0;
+ this.bottom = options.bottom;
+ this._bottom = void 0;
+ this.near = defaultValue_default(options.near, 1);
+ this._near = this.near;
+ this.far = defaultValue_default(options.far, 5e8);
+ this._far = this.far;
+ this._cullingVolume = new CullingVolume_default();
+ this._orthographicMatrix = new Matrix4_default();
+}
+function update(frustum) {
+ if (!defined_default(frustum.right) || !defined_default(frustum.left) || !defined_default(frustum.top) || !defined_default(frustum.bottom) || !defined_default(frustum.near) || !defined_default(frustum.far)) {
+ throw new DeveloperError_default(
+ "right, left, top, bottom, near, or far parameters are not set."
+ );
+ }
+ if (frustum.top !== frustum._top || frustum.bottom !== frustum._bottom || frustum.left !== frustum._left || frustum.right !== frustum._right || frustum.near !== frustum._near || frustum.far !== frustum._far) {
+ if (frustum.left > frustum.right) {
+ throw new DeveloperError_default("right must be greater than left.");
+ }
+ if (frustum.bottom > frustum.top) {
+ throw new DeveloperError_default("top must be greater than bottom.");
+ }
+ if (frustum.near <= 0 || frustum.near > frustum.far) {
+ throw new DeveloperError_default(
+ "near must be greater than zero and less than far."
+ );
+ }
+ frustum._left = frustum.left;
+ frustum._right = frustum.right;
+ frustum._top = frustum.top;
+ frustum._bottom = frustum.bottom;
+ frustum._near = frustum.near;
+ frustum._far = frustum.far;
+ frustum._orthographicMatrix = Matrix4_default.computeOrthographicOffCenter(
+ frustum.left,
+ frustum.right,
+ frustum.bottom,
+ frustum.top,
+ frustum.near,
+ frustum.far,
+ frustum._orthographicMatrix
+ );
+ }
+}
+Object.defineProperties(OrthographicOffCenterFrustum.prototype, {
+ projectionMatrix: {
+ get: function() {
+ update(this);
+ return this._orthographicMatrix;
+ }
+ }
+});
+var getPlanesRight = new Cartesian3_default();
+var getPlanesNearCenter = new Cartesian3_default();
+var getPlanesPoint = new Cartesian3_default();
+var negateScratch = new Cartesian3_default();
+OrthographicOffCenterFrustum.prototype.computeCullingVolume = function(position, direction2, up) {
+ if (!defined_default(position)) {
+ throw new DeveloperError_default("position is required.");
+ }
+ if (!defined_default(direction2)) {
+ throw new DeveloperError_default("direction is required.");
+ }
+ if (!defined_default(up)) {
+ throw new DeveloperError_default("up is required.");
+ }
+ const planes = this._cullingVolume.planes;
+ const t = this.top;
+ const b = this.bottom;
+ const r = this.right;
+ const l = this.left;
+ const n = this.near;
+ const f = this.far;
+ const right = Cartesian3_default.cross(direction2, up, getPlanesRight);
+ Cartesian3_default.normalize(right, right);
+ const nearCenter = getPlanesNearCenter;
+ Cartesian3_default.multiplyByScalar(direction2, n, nearCenter);
+ Cartesian3_default.add(position, nearCenter, nearCenter);
+ const point = getPlanesPoint;
+ Cartesian3_default.multiplyByScalar(right, l, point);
+ Cartesian3_default.add(nearCenter, point, point);
+ let plane = planes[0];
+ if (!defined_default(plane)) {
+ plane = planes[0] = new Cartesian4_default();
+ }
+ plane.x = right.x;
+ plane.y = right.y;
+ plane.z = right.z;
+ plane.w = -Cartesian3_default.dot(right, point);
+ Cartesian3_default.multiplyByScalar(right, r, point);
+ Cartesian3_default.add(nearCenter, point, point);
+ plane = planes[1];
+ if (!defined_default(plane)) {
+ plane = planes[1] = new Cartesian4_default();
+ }
+ plane.x = -right.x;
+ plane.y = -right.y;
+ plane.z = -right.z;
+ plane.w = -Cartesian3_default.dot(Cartesian3_default.negate(right, negateScratch), point);
+ Cartesian3_default.multiplyByScalar(up, b, point);
+ Cartesian3_default.add(nearCenter, point, point);
+ plane = planes[2];
+ if (!defined_default(plane)) {
+ plane = planes[2] = new Cartesian4_default();
+ }
+ plane.x = up.x;
+ plane.y = up.y;
+ plane.z = up.z;
+ plane.w = -Cartesian3_default.dot(up, point);
+ Cartesian3_default.multiplyByScalar(up, t, point);
+ Cartesian3_default.add(nearCenter, point, point);
+ plane = planes[3];
+ if (!defined_default(plane)) {
+ plane = planes[3] = new Cartesian4_default();
+ }
+ plane.x = -up.x;
+ plane.y = -up.y;
+ plane.z = -up.z;
+ plane.w = -Cartesian3_default.dot(Cartesian3_default.negate(up, negateScratch), point);
+ plane = planes[4];
+ if (!defined_default(plane)) {
+ plane = planes[4] = new Cartesian4_default();
+ }
+ plane.x = direction2.x;
+ plane.y = direction2.y;
+ plane.z = direction2.z;
+ plane.w = -Cartesian3_default.dot(direction2, nearCenter);
+ Cartesian3_default.multiplyByScalar(direction2, f, point);
+ Cartesian3_default.add(position, point, point);
+ plane = planes[5];
+ if (!defined_default(plane)) {
+ plane = planes[5] = new Cartesian4_default();
+ }
+ plane.x = -direction2.x;
+ plane.y = -direction2.y;
+ plane.z = -direction2.z;
+ plane.w = -Cartesian3_default.dot(Cartesian3_default.negate(direction2, negateScratch), point);
+ return this._cullingVolume;
+};
+OrthographicOffCenterFrustum.prototype.getPixelDimensions = function(drawingBufferWidth, drawingBufferHeight, distance2, pixelRatio, result) {
+ update(this);
+ if (!defined_default(drawingBufferWidth) || !defined_default(drawingBufferHeight)) {
+ throw new DeveloperError_default(
+ "Both drawingBufferWidth and drawingBufferHeight are required."
+ );
+ }
+ if (drawingBufferWidth <= 0) {
+ throw new DeveloperError_default("drawingBufferWidth must be greater than zero.");
+ }
+ if (drawingBufferHeight <= 0) {
+ throw new DeveloperError_default("drawingBufferHeight must be greater than zero.");
+ }
+ if (!defined_default(distance2)) {
+ throw new DeveloperError_default("distance is required.");
+ }
+ if (!defined_default(pixelRatio)) {
+ throw new DeveloperError_default("pixelRatio is required.");
+ }
+ if (pixelRatio <= 0) {
+ throw new DeveloperError_default("pixelRatio must be greater than zero.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("A result object is required.");
+ }
+ const frustumWidth = this.right - this.left;
+ const frustumHeight = this.top - this.bottom;
+ const pixelWidth = pixelRatio * frustumWidth / drawingBufferWidth;
+ const pixelHeight = pixelRatio * frustumHeight / drawingBufferHeight;
+ result.x = pixelWidth;
+ result.y = pixelHeight;
+ return result;
+};
+OrthographicOffCenterFrustum.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ result = new OrthographicOffCenterFrustum();
+ }
+ result.left = this.left;
+ result.right = this.right;
+ result.top = this.top;
+ result.bottom = this.bottom;
+ result.near = this.near;
+ result.far = this.far;
+ result._left = void 0;
+ result._right = void 0;
+ result._top = void 0;
+ result._bottom = void 0;
+ result._near = void 0;
+ result._far = void 0;
+ return result;
+};
+OrthographicOffCenterFrustum.prototype.equals = function(other) {
+ return defined_default(other) && other instanceof OrthographicOffCenterFrustum && this.right === other.right && this.left === other.left && this.top === other.top && this.bottom === other.bottom && this.near === other.near && this.far === other.far;
+};
+OrthographicOffCenterFrustum.prototype.equalsEpsilon = function(other, relativeEpsilon, absoluteEpsilon) {
+ return other === this || defined_default(other) && other instanceof OrthographicOffCenterFrustum && Math_default.equalsEpsilon(
+ this.right,
+ other.right,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ this.left,
+ other.left,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ this.top,
+ other.top,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ this.bottom,
+ other.bottom,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ this.near,
+ other.near,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ this.far,
+ other.far,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+};
+var OrthographicOffCenterFrustum_default = OrthographicOffCenterFrustum;
+
+// Source/Core/OrthographicFrustum.js
+function OrthographicFrustum(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._offCenterFrustum = new OrthographicOffCenterFrustum_default();
+ this.width = options.width;
+ this._width = void 0;
+ this.aspectRatio = options.aspectRatio;
+ this._aspectRatio = void 0;
+ this.near = defaultValue_default(options.near, 1);
+ this._near = this.near;
+ this.far = defaultValue_default(options.far, 5e8);
+ this._far = this.far;
+}
+OrthographicFrustum.packedLength = 4;
+OrthographicFrustum.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.width;
+ array[startingIndex++] = value.aspectRatio;
+ array[startingIndex++] = value.near;
+ array[startingIndex] = value.far;
+ return array;
+};
+OrthographicFrustum.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new OrthographicFrustum();
+ }
+ result.width = array[startingIndex++];
+ result.aspectRatio = array[startingIndex++];
+ result.near = array[startingIndex++];
+ result.far = array[startingIndex];
+ return result;
+};
+function update2(frustum) {
+ if (!defined_default(frustum.width) || !defined_default(frustum.aspectRatio) || !defined_default(frustum.near) || !defined_default(frustum.far)) {
+ throw new DeveloperError_default(
+ "width, aspectRatio, near, or far parameters are not set."
+ );
+ }
+ const f = frustum._offCenterFrustum;
+ if (frustum.width !== frustum._width || frustum.aspectRatio !== frustum._aspectRatio || frustum.near !== frustum._near || frustum.far !== frustum._far) {
+ if (frustum.aspectRatio < 0) {
+ throw new DeveloperError_default("aspectRatio must be positive.");
+ }
+ if (frustum.near < 0 || frustum.near > frustum.far) {
+ throw new DeveloperError_default(
+ "near must be greater than zero and less than far."
+ );
+ }
+ frustum._aspectRatio = frustum.aspectRatio;
+ frustum._width = frustum.width;
+ frustum._near = frustum.near;
+ frustum._far = frustum.far;
+ const ratio = 1 / frustum.aspectRatio;
+ f.right = frustum.width * 0.5;
+ f.left = -f.right;
+ f.top = ratio * f.right;
+ f.bottom = -f.top;
+ f.near = frustum.near;
+ f.far = frustum.far;
+ }
+}
+Object.defineProperties(OrthographicFrustum.prototype, {
+ projectionMatrix: {
+ get: function() {
+ update2(this);
+ return this._offCenterFrustum.projectionMatrix;
+ }
+ }
+});
+OrthographicFrustum.prototype.computeCullingVolume = function(position, direction2, up) {
+ update2(this);
+ return this._offCenterFrustum.computeCullingVolume(position, direction2, up);
+};
+OrthographicFrustum.prototype.getPixelDimensions = function(drawingBufferWidth, drawingBufferHeight, distance2, pixelRatio, result) {
+ update2(this);
+ return this._offCenterFrustum.getPixelDimensions(
+ drawingBufferWidth,
+ drawingBufferHeight,
+ distance2,
+ pixelRatio,
+ result
+ );
+};
+OrthographicFrustum.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ result = new OrthographicFrustum();
+ }
+ result.aspectRatio = this.aspectRatio;
+ result.width = this.width;
+ result.near = this.near;
+ result.far = this.far;
+ result._aspectRatio = void 0;
+ result._width = void 0;
+ result._near = void 0;
+ result._far = void 0;
+ this._offCenterFrustum.clone(result._offCenterFrustum);
+ return result;
+};
+OrthographicFrustum.prototype.equals = function(other) {
+ if (!defined_default(other) || !(other instanceof OrthographicFrustum)) {
+ return false;
+ }
+ update2(this);
+ update2(other);
+ return this.width === other.width && this.aspectRatio === other.aspectRatio && this._offCenterFrustum.equals(other._offCenterFrustum);
+};
+OrthographicFrustum.prototype.equalsEpsilon = function(other, relativeEpsilon, absoluteEpsilon) {
+ if (!defined_default(other) || !(other instanceof OrthographicFrustum)) {
+ return false;
+ }
+ update2(this);
+ update2(other);
+ return Math_default.equalsEpsilon(
+ this.width,
+ other.width,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && Math_default.equalsEpsilon(
+ this.aspectRatio,
+ other.aspectRatio,
+ relativeEpsilon,
+ absoluteEpsilon
+ ) && this._offCenterFrustum.equalsEpsilon(
+ other._offCenterFrustum,
+ relativeEpsilon,
+ absoluteEpsilon
+ );
+};
+var OrthographicFrustum_default = OrthographicFrustum;
+
+// Source/Core/Simon1994PlanetaryPositions.js
+var Simon1994PlanetaryPositions = {};
+function computeTdbMinusTtSpice(daysSinceJ2000InTerrestrialTime) {
+ const g = 6.239996 + 0.0172019696544 * daysSinceJ2000InTerrestrialTime;
+ return 1657e-6 * Math.sin(g + 0.01671 * Math.sin(g));
+}
+var TdtMinusTai = 32.184;
+var J2000d = 2451545;
+function taiToTdb(date, result) {
+ result = JulianDate_default.addSeconds(date, TdtMinusTai, result);
+ const days = JulianDate_default.totalDays(result) - J2000d;
+ result = JulianDate_default.addSeconds(result, computeTdbMinusTtSpice(days), result);
+ return result;
+}
+var epoch = new JulianDate_default(2451545, 0, TimeStandard_default.TAI);
+var MetersPerKilometer = 1e3;
+var RadiansPerDegree = Math_default.RADIANS_PER_DEGREE;
+var RadiansPerArcSecond = Math_default.RADIANS_PER_ARCSECOND;
+var MetersPerAstronomicalUnit = 14959787e4;
+var perifocalToEquatorial = new Matrix3_default();
+function elementsToCartesian(semimajorAxis, eccentricity, inclination, longitudeOfPerigee, longitudeOfNode, meanLongitude, result) {
+ if (inclination < 0) {
+ inclination = -inclination;
+ longitudeOfNode += Math_default.PI;
+ }
+ if (inclination < 0 || inclination > Math_default.PI) {
+ throw new DeveloperError_default(
+ "The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians."
+ );
+ }
+ const radiusOfPeriapsis = semimajorAxis * (1 - eccentricity);
+ const argumentOfPeriapsis = longitudeOfPerigee - longitudeOfNode;
+ const rightAscensionOfAscendingNode = longitudeOfNode;
+ const trueAnomaly = meanAnomalyToTrueAnomaly(
+ meanLongitude - longitudeOfPerigee,
+ eccentricity
+ );
+ const type = chooseOrbit(eccentricity, 0);
+ if (type === "Hyperbolic" && Math.abs(Math_default.negativePiToPi(trueAnomaly)) >= Math.acos(-1 / eccentricity)) {
+ throw new DeveloperError_default(
+ "The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola."
+ );
+ }
+ perifocalToCartesianMatrix(
+ argumentOfPeriapsis,
+ inclination,
+ rightAscensionOfAscendingNode,
+ perifocalToEquatorial
+ );
+ const semilatus = radiusOfPeriapsis * (1 + eccentricity);
+ const costheta = Math.cos(trueAnomaly);
+ const sintheta = Math.sin(trueAnomaly);
+ const denom = 1 + eccentricity * costheta;
+ if (denom <= Math_default.Epsilon10) {
+ throw new DeveloperError_default("elements cannot be converted to cartesian");
+ }
+ const radius = semilatus / denom;
+ if (!defined_default(result)) {
+ result = new Cartesian3_default(radius * costheta, radius * sintheta, 0);
+ } else {
+ result.x = radius * costheta;
+ result.y = radius * sintheta;
+ result.z = 0;
+ }
+ return Matrix3_default.multiplyByVector(perifocalToEquatorial, result, result);
+}
+function chooseOrbit(eccentricity, tolerance) {
+ if (eccentricity < 0) {
+ throw new DeveloperError_default("eccentricity cannot be negative.");
+ }
+ if (eccentricity <= tolerance) {
+ return "Circular";
+ } else if (eccentricity < 1 - tolerance) {
+ return "Elliptical";
+ } else if (eccentricity <= 1 + tolerance) {
+ return "Parabolic";
+ }
+ return "Hyperbolic";
+}
+function meanAnomalyToTrueAnomaly(meanAnomaly, eccentricity) {
+ if (eccentricity < 0 || eccentricity >= 1) {
+ throw new DeveloperError_default("eccentricity out of range.");
+ }
+ const eccentricAnomaly = meanAnomalyToEccentricAnomaly(
+ meanAnomaly,
+ eccentricity
+ );
+ return eccentricAnomalyToTrueAnomaly(eccentricAnomaly, eccentricity);
+}
+var maxIterationCount = 50;
+var keplerEqConvergence = Math_default.EPSILON8;
+function meanAnomalyToEccentricAnomaly(meanAnomaly, eccentricity) {
+ if (eccentricity < 0 || eccentricity >= 1) {
+ throw new DeveloperError_default("eccentricity out of range.");
+ }
+ const revs = Math.floor(meanAnomaly / Math_default.TWO_PI);
+ meanAnomaly -= revs * Math_default.TWO_PI;
+ let iterationValue = meanAnomaly + eccentricity * Math.sin(meanAnomaly) / (1 - Math.sin(meanAnomaly + eccentricity) + Math.sin(meanAnomaly));
+ let eccentricAnomaly = Number.MAX_VALUE;
+ let count;
+ for (count = 0; count < maxIterationCount && Math.abs(eccentricAnomaly - iterationValue) > keplerEqConvergence; ++count) {
+ eccentricAnomaly = iterationValue;
+ const NRfunction = eccentricAnomaly - eccentricity * Math.sin(eccentricAnomaly) - meanAnomaly;
+ const dNRfunction = 1 - eccentricity * Math.cos(eccentricAnomaly);
+ iterationValue = eccentricAnomaly - NRfunction / dNRfunction;
+ }
+ if (count >= maxIterationCount) {
+ throw new DeveloperError_default("Kepler equation did not converge");
+ }
+ eccentricAnomaly = iterationValue + revs * Math_default.TWO_PI;
+ return eccentricAnomaly;
+}
+function eccentricAnomalyToTrueAnomaly(eccentricAnomaly, eccentricity) {
+ if (eccentricity < 0 || eccentricity >= 1) {
+ throw new DeveloperError_default("eccentricity out of range.");
+ }
+ const revs = Math.floor(eccentricAnomaly / Math_default.TWO_PI);
+ eccentricAnomaly -= revs * Math_default.TWO_PI;
+ const trueAnomalyX = Math.cos(eccentricAnomaly) - eccentricity;
+ const trueAnomalyY = Math.sin(eccentricAnomaly) * Math.sqrt(1 - eccentricity * eccentricity);
+ let trueAnomaly = Math.atan2(trueAnomalyY, trueAnomalyX);
+ trueAnomaly = Math_default.zeroToTwoPi(trueAnomaly);
+ if (eccentricAnomaly < 0) {
+ trueAnomaly -= Math_default.TWO_PI;
+ }
+ trueAnomaly += revs * Math_default.TWO_PI;
+ return trueAnomaly;
+}
+function perifocalToCartesianMatrix(argumentOfPeriapsis, inclination, rightAscension, result) {
+ if (inclination < 0 || inclination > Math_default.PI) {
+ throw new DeveloperError_default("inclination out of range");
+ }
+ const cosap = Math.cos(argumentOfPeriapsis);
+ const sinap = Math.sin(argumentOfPeriapsis);
+ const cosi = Math.cos(inclination);
+ const sini = Math.sin(inclination);
+ const cosraan = Math.cos(rightAscension);
+ const sinraan = Math.sin(rightAscension);
+ if (!defined_default(result)) {
+ result = new Matrix3_default(
+ cosraan * cosap - sinraan * sinap * cosi,
+ -cosraan * sinap - sinraan * cosap * cosi,
+ sinraan * sini,
+ sinraan * cosap + cosraan * sinap * cosi,
+ -sinraan * sinap + cosraan * cosap * cosi,
+ -cosraan * sini,
+ sinap * sini,
+ cosap * sini,
+ cosi
+ );
+ } else {
+ result[0] = cosraan * cosap - sinraan * sinap * cosi;
+ result[1] = sinraan * cosap + cosraan * sinap * cosi;
+ result[2] = sinap * sini;
+ result[3] = -cosraan * sinap - sinraan * cosap * cosi;
+ result[4] = -sinraan * sinap + cosraan * cosap * cosi;
+ result[5] = cosap * sini;
+ result[6] = sinraan * sini;
+ result[7] = -cosraan * sini;
+ result[8] = cosi;
+ }
+ return result;
+}
+var semiMajorAxis0 = 1.0000010178 * MetersPerAstronomicalUnit;
+var meanLongitude0 = 100.46645683 * RadiansPerDegree;
+var meanLongitude1 = 129597742283429e-5 * RadiansPerArcSecond;
+var p1u = 16002;
+var p2u = 21863;
+var p3u = 32004;
+var p4u = 10931;
+var p5u = 14529;
+var p6u = 16368;
+var p7u = 15318;
+var p8u = 32794;
+var Ca1 = 64 * 1e-7 * MetersPerAstronomicalUnit;
+var Ca2 = -152 * 1e-7 * MetersPerAstronomicalUnit;
+var Ca3 = 62 * 1e-7 * MetersPerAstronomicalUnit;
+var Ca4 = -8 * 1e-7 * MetersPerAstronomicalUnit;
+var Ca5 = 32 * 1e-7 * MetersPerAstronomicalUnit;
+var Ca6 = -41 * 1e-7 * MetersPerAstronomicalUnit;
+var Ca7 = 19 * 1e-7 * MetersPerAstronomicalUnit;
+var Ca8 = -11 * 1e-7 * MetersPerAstronomicalUnit;
+var Sa1 = -150 * 1e-7 * MetersPerAstronomicalUnit;
+var Sa2 = -46 * 1e-7 * MetersPerAstronomicalUnit;
+var Sa3 = 68 * 1e-7 * MetersPerAstronomicalUnit;
+var Sa4 = 54 * 1e-7 * MetersPerAstronomicalUnit;
+var Sa5 = 14 * 1e-7 * MetersPerAstronomicalUnit;
+var Sa6 = 24 * 1e-7 * MetersPerAstronomicalUnit;
+var Sa7 = -28 * 1e-7 * MetersPerAstronomicalUnit;
+var Sa8 = 22 * 1e-7 * MetersPerAstronomicalUnit;
+var q1u = 10;
+var q2u = 16002;
+var q3u = 21863;
+var q4u = 10931;
+var q5u = 1473;
+var q6u = 32004;
+var q7u = 4387;
+var q8u = 73;
+var Cl1 = -325 * 1e-7;
+var Cl2 = -322 * 1e-7;
+var Cl3 = -79 * 1e-7;
+var Cl4 = 232 * 1e-7;
+var Cl5 = -52 * 1e-7;
+var Cl6 = 97 * 1e-7;
+var Cl7 = 55 * 1e-7;
+var Cl8 = -41 * 1e-7;
+var Sl1 = -105 * 1e-7;
+var Sl2 = -137 * 1e-7;
+var Sl3 = 258 * 1e-7;
+var Sl4 = 35 * 1e-7;
+var Sl5 = -116 * 1e-7;
+var Sl6 = -88 * 1e-7;
+var Sl7 = -112 * 1e-7;
+var Sl8 = -80 * 1e-7;
+var scratchDate = new JulianDate_default(0, 0, TimeStandard_default.TAI);
+function computeSimonEarthMoonBarycenter(date, result) {
+ taiToTdb(date, scratchDate);
+ const x = scratchDate.dayNumber - epoch.dayNumber + (scratchDate.secondsOfDay - epoch.secondsOfDay) / TimeConstants_default.SECONDS_PER_DAY;
+ const t = x / (TimeConstants_default.DAYS_PER_JULIAN_CENTURY * 10);
+ const u3 = 0.3595362 * t;
+ const semimajorAxis = semiMajorAxis0 + Ca1 * Math.cos(p1u * u3) + Sa1 * Math.sin(p1u * u3) + Ca2 * Math.cos(p2u * u3) + Sa2 * Math.sin(p2u * u3) + Ca3 * Math.cos(p3u * u3) + Sa3 * Math.sin(p3u * u3) + Ca4 * Math.cos(p4u * u3) + Sa4 * Math.sin(p4u * u3) + Ca5 * Math.cos(p5u * u3) + Sa5 * Math.sin(p5u * u3) + Ca6 * Math.cos(p6u * u3) + Sa6 * Math.sin(p6u * u3) + Ca7 * Math.cos(p7u * u3) + Sa7 * Math.sin(p7u * u3) + Ca8 * Math.cos(p8u * u3) + Sa8 * Math.sin(p8u * u3);
+ const meanLongitude = meanLongitude0 + meanLongitude1 * t + Cl1 * Math.cos(q1u * u3) + Sl1 * Math.sin(q1u * u3) + Cl2 * Math.cos(q2u * u3) + Sl2 * Math.sin(q2u * u3) + Cl3 * Math.cos(q3u * u3) + Sl3 * Math.sin(q3u * u3) + Cl4 * Math.cos(q4u * u3) + Sl4 * Math.sin(q4u * u3) + Cl5 * Math.cos(q5u * u3) + Sl5 * Math.sin(q5u * u3) + Cl6 * Math.cos(q6u * u3) + Sl6 * Math.sin(q6u * u3) + Cl7 * Math.cos(q7u * u3) + Sl7 * Math.sin(q7u * u3) + Cl8 * Math.cos(q8u * u3) + Sl8 * Math.sin(q8u * u3);
+ const eccentricity = 0.0167086342 - 4203654e-10 * t;
+ const longitudeOfPerigee = 102.93734808 * RadiansPerDegree + 11612.3529 * RadiansPerArcSecond * t;
+ const inclination = 469.97289 * RadiansPerArcSecond * t;
+ const longitudeOfNode = 174.87317577 * RadiansPerDegree - 8679.27034 * RadiansPerArcSecond * t;
+ return elementsToCartesian(
+ semimajorAxis,
+ eccentricity,
+ inclination,
+ longitudeOfPerigee,
+ longitudeOfNode,
+ meanLongitude,
+ result
+ );
+}
+function computeSimonMoon(date, result) {
+ taiToTdb(date, scratchDate);
+ const x = scratchDate.dayNumber - epoch.dayNumber + (scratchDate.secondsOfDay - epoch.secondsOfDay) / TimeConstants_default.SECONDS_PER_DAY;
+ const t = x / TimeConstants_default.DAYS_PER_JULIAN_CENTURY;
+ const t2 = t * t;
+ const t3 = t2 * t;
+ const t4 = t3 * t;
+ let semimajorAxis = 383397.7725 + 4e-3 * t;
+ let eccentricity = 0.055545526 - 16e-9 * t;
+ const inclinationConstant = 5.15668983 * RadiansPerDegree;
+ let inclinationSecPart = -8e-5 * t + 0.02966 * t2 - 42e-6 * t3 - 13e-8 * t4;
+ const longitudeOfPerigeeConstant = 83.35324312 * RadiansPerDegree;
+ let longitudeOfPerigeeSecPart = 146434202669e-4 * t - 38.2702 * t2 - 0.045047 * t3 + 21301e-8 * t4;
+ const longitudeOfNodeConstant = 125.04455501 * RadiansPerDegree;
+ let longitudeOfNodeSecPart = -69679193631e-4 * t + 6.3602 * t2 + 7625e-6 * t3 - 3586e-8 * t4;
+ const meanLongitudeConstant = 218.31664563 * RadiansPerDegree;
+ let meanLongitudeSecPart = 17325593434847e-4 * t - 6.391 * t2 + 6588e-6 * t3 - 3169e-8 * t4;
+ const D = 297.85019547 * RadiansPerDegree + RadiansPerArcSecond * (1602961601209e-3 * t - 6.3706 * t2 + 6593e-6 * t3 - 3169e-8 * t4);
+ const F = 93.27209062 * RadiansPerDegree + RadiansPerArcSecond * (17395272628478e-4 * t - 12.7512 * t2 - 1037e-6 * t3 + 417e-8 * t4);
+ const l = 134.96340251 * RadiansPerDegree + RadiansPerArcSecond * (17179159232178e-4 * t + 31.8792 * t2 + 0.051635 * t3 - 2447e-7 * t4);
+ const lprime = 357.52910918 * RadiansPerDegree + RadiansPerArcSecond * (1295965810481e-4 * t - 0.5532 * t2 + 136e-6 * t3 - 1149e-8 * t4);
+ const psi = 310.17137918 * RadiansPerDegree - RadiansPerArcSecond * (6967051436e-3 * t + 6.2068 * t2 + 7618e-6 * t3 - 3219e-8 * t4);
+ const twoD = 2 * D;
+ const fourD = 4 * D;
+ const sixD = 6 * D;
+ const twol = 2 * l;
+ const threel = 3 * l;
+ const fourl = 4 * l;
+ const twoF = 2 * F;
+ semimajorAxis += 3400.4 * Math.cos(twoD) - 635.6 * Math.cos(twoD - l) - 235.6 * Math.cos(l) + 218.1 * Math.cos(twoD - lprime) + 181 * Math.cos(twoD + l);
+ eccentricity += 0.014216 * Math.cos(twoD - l) + 8551e-6 * Math.cos(twoD - twol) - 1383e-6 * Math.cos(l) + 1356e-6 * Math.cos(twoD + l) - 1147e-6 * Math.cos(fourD - threel) - 914e-6 * Math.cos(fourD - twol) + 869e-6 * Math.cos(twoD - lprime - l) - 627e-6 * Math.cos(twoD) - 394e-6 * Math.cos(fourD - fourl) + 282e-6 * Math.cos(twoD - lprime - twol) - 279e-6 * Math.cos(D - l) - 236e-6 * Math.cos(twol) + 231e-6 * Math.cos(fourD) + 229e-6 * Math.cos(sixD - fourl) - 201e-6 * Math.cos(twol - twoF);
+ inclinationSecPart += 486.26 * Math.cos(twoD - twoF) - 40.13 * Math.cos(twoD) + 37.51 * Math.cos(twoF) + 25.73 * Math.cos(twol - twoF) + 19.97 * Math.cos(twoD - lprime - twoF);
+ longitudeOfPerigeeSecPart += -55609 * Math.sin(twoD - l) - 34711 * Math.sin(twoD - twol) - 9792 * Math.sin(l) + 9385 * Math.sin(fourD - threel) + 7505 * Math.sin(fourD - twol) + 5318 * Math.sin(twoD + l) + 3484 * Math.sin(fourD - fourl) - 3417 * Math.sin(twoD - lprime - l) - 2530 * Math.sin(sixD - fourl) - 2376 * Math.sin(twoD) - 2075 * Math.sin(twoD - threel) - 1883 * Math.sin(twol) - 1736 * Math.sin(sixD - 5 * l) + 1626 * Math.sin(lprime) - 1370 * Math.sin(sixD - threel);
+ longitudeOfNodeSecPart += -5392 * Math.sin(twoD - twoF) - 540 * Math.sin(lprime) - 441 * Math.sin(twoD) + 423 * Math.sin(twoF) - 288 * Math.sin(twol - twoF);
+ meanLongitudeSecPart += -3332.9 * Math.sin(twoD) + 1197.4 * Math.sin(twoD - l) - 662.5 * Math.sin(lprime) + 396.3 * Math.sin(l) - 218 * Math.sin(twoD - lprime);
+ const twoPsi = 2 * psi;
+ const threePsi = 3 * psi;
+ inclinationSecPart += 46.997 * Math.cos(psi) * t - 0.614 * Math.cos(twoD - twoF + psi) * t + 0.614 * Math.cos(twoD - twoF - psi) * t - 0.0297 * Math.cos(twoPsi) * t2 - 0.0335 * Math.cos(psi) * t2 + 12e-4 * Math.cos(twoD - twoF + twoPsi) * t2 - 16e-5 * Math.cos(psi) * t3 + 4e-5 * Math.cos(threePsi) * t3 + 4e-5 * Math.cos(twoPsi) * t3;
+ const perigeeAndMean = 2.116 * Math.sin(psi) * t - 0.111 * Math.sin(twoD - twoF - psi) * t - 15e-4 * Math.sin(psi) * t2;
+ longitudeOfPerigeeSecPart += perigeeAndMean;
+ meanLongitudeSecPart += perigeeAndMean;
+ longitudeOfNodeSecPart += -520.77 * Math.sin(psi) * t + 13.66 * Math.sin(twoD - twoF + psi) * t + 1.12 * Math.sin(twoD - psi) * t - 1.06 * Math.sin(twoF - psi) * t + 0.66 * Math.sin(twoPsi) * t2 + 0.371 * Math.sin(psi) * t2 - 0.035 * Math.sin(twoD - twoF + twoPsi) * t2 - 0.015 * Math.sin(twoD - twoF + psi) * t2 + 14e-4 * Math.sin(psi) * t3 - 11e-4 * Math.sin(threePsi) * t3 - 9e-4 * Math.sin(twoPsi) * t3;
+ semimajorAxis *= MetersPerKilometer;
+ const inclination = inclinationConstant + inclinationSecPart * RadiansPerArcSecond;
+ const longitudeOfPerigee = longitudeOfPerigeeConstant + longitudeOfPerigeeSecPart * RadiansPerArcSecond;
+ const meanLongitude = meanLongitudeConstant + meanLongitudeSecPart * RadiansPerArcSecond;
+ const longitudeOfNode = longitudeOfNodeConstant + longitudeOfNodeSecPart * RadiansPerArcSecond;
+ return elementsToCartesian(
+ semimajorAxis,
+ eccentricity,
+ inclination,
+ longitudeOfPerigee,
+ longitudeOfNode,
+ meanLongitude,
+ result
+ );
+}
+var moonEarthMassRatio = 0.012300034;
+var factor = moonEarthMassRatio / (moonEarthMassRatio + 1) * -1;
+function computeSimonEarth(date, result) {
+ result = computeSimonMoon(date, result);
+ return Cartesian3_default.multiplyByScalar(result, factor, result);
+}
+var axesTransformation = new Matrix3_default(
+ 1.0000000000000002,
+ 5619723173785822e-31,
+ 4690511510146299e-34,
+ -5154129427414611e-31,
+ 0.9174820620691819,
+ -0.39777715593191376,
+ -223970096136568e-30,
+ 0.39777715593191376,
+ 0.9174820620691819
+);
+var translation = new Cartesian3_default();
+Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame = function(julianDate, result) {
+ if (!defined_default(julianDate)) {
+ julianDate = JulianDate_default.now();
+ }
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ translation = computeSimonEarthMoonBarycenter(julianDate, translation);
+ result = Cartesian3_default.negate(translation, result);
+ computeSimonEarth(julianDate, translation);
+ Cartesian3_default.subtract(result, translation, result);
+ Matrix3_default.multiplyByVector(axesTransformation, result, result);
+ return result;
+};
+Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame = function(julianDate, result) {
+ if (!defined_default(julianDate)) {
+ julianDate = JulianDate_default.now();
+ }
+ result = computeSimonMoon(julianDate, result);
+ Matrix3_default.multiplyByVector(axesTransformation, result, result);
+ return result;
+};
+var Simon1994PlanetaryPositions_default = Simon1994PlanetaryPositions;
+
+// Source/Scene/SceneMode.js
+var SceneMode = {
+ MORPHING: 0,
+ COLUMBUS_VIEW: 1,
+ SCENE2D: 2,
+ SCENE3D: 3
+};
+SceneMode.getMorphTime = function(value) {
+ if (value === SceneMode.SCENE3D) {
+ return 1;
+ } else if (value === SceneMode.MORPHING) {
+ return void 0;
+ }
+ return 0;
+};
+var SceneMode_default = Object.freeze(SceneMode);
+
+// Source/Scene/SunLight.js
+function SunLight(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.color = Color_default.clone(defaultValue_default(options.color, Color_default.WHITE));
+ this.intensity = defaultValue_default(options.intensity, 2);
+}
+var SunLight_default = SunLight;
+
+// Source/Renderer/UniformState.js
+function UniformState() {
+ this.globeDepthTexture = void 0;
+ this.gamma = void 0;
+ this._viewport = new BoundingRectangle_default();
+ this._viewportCartesian4 = new Cartesian4_default();
+ this._viewportDirty = false;
+ this._viewportOrthographicMatrix = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._viewportTransformation = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._model = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._view = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._inverseView = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._projection = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._infiniteProjection = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._entireFrustum = new Cartesian2_default();
+ this._currentFrustum = new Cartesian2_default();
+ this._frustumPlanes = new Cartesian4_default();
+ this._farDepthFromNearPlusOne = void 0;
+ this._log2FarDepthFromNearPlusOne = void 0;
+ this._oneOverLog2FarDepthFromNearPlusOne = void 0;
+ this._frameState = void 0;
+ this._temeToPseudoFixed = Matrix3_default.clone(Matrix4_default.IDENTITY);
+ this._view3DDirty = true;
+ this._view3D = new Matrix4_default();
+ this._inverseView3DDirty = true;
+ this._inverseView3D = new Matrix4_default();
+ this._inverseModelDirty = true;
+ this._inverseModel = new Matrix4_default();
+ this._inverseTransposeModelDirty = true;
+ this._inverseTransposeModel = new Matrix3_default();
+ this._viewRotation = new Matrix3_default();
+ this._inverseViewRotation = new Matrix3_default();
+ this._viewRotation3D = new Matrix3_default();
+ this._inverseViewRotation3D = new Matrix3_default();
+ this._inverseProjectionDirty = true;
+ this._inverseProjection = new Matrix4_default();
+ this._modelViewDirty = true;
+ this._modelView = new Matrix4_default();
+ this._modelView3DDirty = true;
+ this._modelView3D = new Matrix4_default();
+ this._modelViewRelativeToEyeDirty = true;
+ this._modelViewRelativeToEye = new Matrix4_default();
+ this._inverseModelViewDirty = true;
+ this._inverseModelView = new Matrix4_default();
+ this._inverseModelView3DDirty = true;
+ this._inverseModelView3D = new Matrix4_default();
+ this._viewProjectionDirty = true;
+ this._viewProjection = new Matrix4_default();
+ this._inverseViewProjectionDirty = true;
+ this._inverseViewProjection = new Matrix4_default();
+ this._modelViewProjectionDirty = true;
+ this._modelViewProjection = new Matrix4_default();
+ this._inverseModelViewProjectionDirty = true;
+ this._inverseModelViewProjection = new Matrix4_default();
+ this._modelViewProjectionRelativeToEyeDirty = true;
+ this._modelViewProjectionRelativeToEye = new Matrix4_default();
+ this._modelViewInfiniteProjectionDirty = true;
+ this._modelViewInfiniteProjection = new Matrix4_default();
+ this._normalDirty = true;
+ this._normal = new Matrix3_default();
+ this._normal3DDirty = true;
+ this._normal3D = new Matrix3_default();
+ this._inverseNormalDirty = true;
+ this._inverseNormal = new Matrix3_default();
+ this._inverseNormal3DDirty = true;
+ this._inverseNormal3D = new Matrix3_default();
+ this._encodedCameraPositionMCDirty = true;
+ this._encodedCameraPositionMC = new EncodedCartesian3_default();
+ this._cameraPosition = new Cartesian3_default();
+ this._sunPositionWC = new Cartesian3_default();
+ this._sunPositionColumbusView = new Cartesian3_default();
+ this._sunDirectionWC = new Cartesian3_default();
+ this._sunDirectionEC = new Cartesian3_default();
+ this._moonDirectionEC = new Cartesian3_default();
+ this._lightDirectionWC = new Cartesian3_default();
+ this._lightDirectionEC = new Cartesian3_default();
+ this._lightColor = new Cartesian3_default();
+ this._lightColorHdr = new Cartesian3_default();
+ this._pass = void 0;
+ this._mode = void 0;
+ this._mapProjection = void 0;
+ this._ellipsoid = void 0;
+ this._cameraDirection = new Cartesian3_default();
+ this._cameraRight = new Cartesian3_default();
+ this._cameraUp = new Cartesian3_default();
+ this._frustum2DWidth = 0;
+ this._eyeHeight = 0;
+ this._eyeHeight2D = new Cartesian2_default();
+ this._pixelRatio = 1;
+ this._orthographicIn3D = false;
+ this._backgroundColor = new Color_default();
+ this._brdfLut = void 0;
+ this._environmentMap = void 0;
+ this._sphericalHarmonicCoefficients = void 0;
+ this._specularEnvironmentMaps = void 0;
+ this._specularEnvironmentMapsDimensions = new Cartesian2_default();
+ this._specularEnvironmentMapsMaximumLOD = void 0;
+ this._fogDensity = void 0;
+ this._invertClassificationColor = void 0;
+ this._splitPosition = 0;
+ this._pixelSizePerMeter = void 0;
+ this._geometricToleranceOverMeter = void 0;
+ this._minimumDisableDepthTestDistance = void 0;
+}
+Object.defineProperties(UniformState.prototype, {
+ frameState: {
+ get: function() {
+ return this._frameState;
+ }
+ },
+ viewport: {
+ get: function() {
+ return this._viewport;
+ },
+ set: function(viewport) {
+ if (!BoundingRectangle_default.equals(viewport, this._viewport)) {
+ BoundingRectangle_default.clone(viewport, this._viewport);
+ const v7 = this._viewport;
+ const vc = this._viewportCartesian4;
+ vc.x = v7.x;
+ vc.y = v7.y;
+ vc.z = v7.width;
+ vc.w = v7.height;
+ this._viewportDirty = true;
+ }
+ }
+ },
+ viewportCartesian4: {
+ get: function() {
+ return this._viewportCartesian4;
+ }
+ },
+ viewportOrthographic: {
+ get: function() {
+ cleanViewport(this);
+ return this._viewportOrthographicMatrix;
+ }
+ },
+ viewportTransformation: {
+ get: function() {
+ cleanViewport(this);
+ return this._viewportTransformation;
+ }
+ },
+ model: {
+ get: function() {
+ return this._model;
+ },
+ set: function(matrix) {
+ Matrix4_default.clone(matrix, this._model);
+ this._modelView3DDirty = true;
+ this._inverseModelView3DDirty = true;
+ this._inverseModelDirty = true;
+ this._inverseTransposeModelDirty = true;
+ this._modelViewDirty = true;
+ this._inverseModelViewDirty = true;
+ this._modelViewRelativeToEyeDirty = true;
+ this._inverseModelViewDirty = true;
+ this._modelViewProjectionDirty = true;
+ this._inverseModelViewProjectionDirty = true;
+ this._modelViewProjectionRelativeToEyeDirty = true;
+ this._modelViewInfiniteProjectionDirty = true;
+ this._normalDirty = true;
+ this._inverseNormalDirty = true;
+ this._normal3DDirty = true;
+ this._inverseNormal3DDirty = true;
+ this._encodedCameraPositionMCDirty = true;
+ }
+ },
+ inverseModel: {
+ get: function() {
+ if (this._inverseModelDirty) {
+ this._inverseModelDirty = false;
+ Matrix4_default.inverse(this._model, this._inverseModel);
+ }
+ return this._inverseModel;
+ }
+ },
+ inverseTransposeModel: {
+ get: function() {
+ const m = this._inverseTransposeModel;
+ if (this._inverseTransposeModelDirty) {
+ this._inverseTransposeModelDirty = false;
+ Matrix4_default.getMatrix3(this.inverseModel, m);
+ Matrix3_default.transpose(m, m);
+ }
+ return m;
+ }
+ },
+ view: {
+ get: function() {
+ return this._view;
+ }
+ },
+ view3D: {
+ get: function() {
+ updateView3D(this);
+ return this._view3D;
+ }
+ },
+ viewRotation: {
+ get: function() {
+ updateView3D(this);
+ return this._viewRotation;
+ }
+ },
+ viewRotation3D: {
+ get: function() {
+ updateView3D(this);
+ return this._viewRotation3D;
+ }
+ },
+ inverseView: {
+ get: function() {
+ return this._inverseView;
+ }
+ },
+ inverseView3D: {
+ get: function() {
+ updateInverseView3D(this);
+ return this._inverseView3D;
+ }
+ },
+ inverseViewRotation: {
+ get: function() {
+ return this._inverseViewRotation;
+ }
+ },
+ inverseViewRotation3D: {
+ get: function() {
+ updateInverseView3D(this);
+ return this._inverseViewRotation3D;
+ }
+ },
+ projection: {
+ get: function() {
+ return this._projection;
+ }
+ },
+ inverseProjection: {
+ get: function() {
+ cleanInverseProjection(this);
+ return this._inverseProjection;
+ }
+ },
+ infiniteProjection: {
+ get: function() {
+ return this._infiniteProjection;
+ }
+ },
+ modelView: {
+ get: function() {
+ cleanModelView(this);
+ return this._modelView;
+ }
+ },
+ modelView3D: {
+ get: function() {
+ cleanModelView3D(this);
+ return this._modelView3D;
+ }
+ },
+ modelViewRelativeToEye: {
+ get: function() {
+ cleanModelViewRelativeToEye(this);
+ return this._modelViewRelativeToEye;
+ }
+ },
+ inverseModelView: {
+ get: function() {
+ cleanInverseModelView(this);
+ return this._inverseModelView;
+ }
+ },
+ inverseModelView3D: {
+ get: function() {
+ cleanInverseModelView3D(this);
+ return this._inverseModelView3D;
+ }
+ },
+ viewProjection: {
+ get: function() {
+ cleanViewProjection(this);
+ return this._viewProjection;
+ }
+ },
+ inverseViewProjection: {
+ get: function() {
+ cleanInverseViewProjection(this);
+ return this._inverseViewProjection;
+ }
+ },
+ modelViewProjection: {
+ get: function() {
+ cleanModelViewProjection(this);
+ return this._modelViewProjection;
+ }
+ },
+ inverseModelViewProjection: {
+ get: function() {
+ cleanInverseModelViewProjection(this);
+ return this._inverseModelViewProjection;
+ }
+ },
+ modelViewProjectionRelativeToEye: {
+ get: function() {
+ cleanModelViewProjectionRelativeToEye(this);
+ return this._modelViewProjectionRelativeToEye;
+ }
+ },
+ modelViewInfiniteProjection: {
+ get: function() {
+ cleanModelViewInfiniteProjection(this);
+ return this._modelViewInfiniteProjection;
+ }
+ },
+ normal: {
+ get: function() {
+ cleanNormal(this);
+ return this._normal;
+ }
+ },
+ normal3D: {
+ get: function() {
+ cleanNormal3D(this);
+ return this._normal3D;
+ }
+ },
+ inverseNormal: {
+ get: function() {
+ cleanInverseNormal(this);
+ return this._inverseNormal;
+ }
+ },
+ inverseNormal3D: {
+ get: function() {
+ cleanInverseNormal3D(this);
+ return this._inverseNormal3D;
+ }
+ },
+ entireFrustum: {
+ get: function() {
+ return this._entireFrustum;
+ }
+ },
+ currentFrustum: {
+ get: function() {
+ return this._currentFrustum;
+ }
+ },
+ frustumPlanes: {
+ get: function() {
+ return this._frustumPlanes;
+ }
+ },
+ farDepthFromNearPlusOne: {
+ get: function() {
+ return this._farDepthFromNearPlusOne;
+ }
+ },
+ log2FarDepthFromNearPlusOne: {
+ get: function() {
+ return this._log2FarDepthFromNearPlusOne;
+ }
+ },
+ oneOverLog2FarDepthFromNearPlusOne: {
+ get: function() {
+ return this._oneOverLog2FarDepthFromNearPlusOne;
+ }
+ },
+ eyeHeight: {
+ get: function() {
+ return this._eyeHeight;
+ }
+ },
+ eyeHeight2D: {
+ get: function() {
+ return this._eyeHeight2D;
+ }
+ },
+ sunPositionWC: {
+ get: function() {
+ return this._sunPositionWC;
+ }
+ },
+ sunPositionColumbusView: {
+ get: function() {
+ return this._sunPositionColumbusView;
+ }
+ },
+ sunDirectionWC: {
+ get: function() {
+ return this._sunDirectionWC;
+ }
+ },
+ sunDirectionEC: {
+ get: function() {
+ return this._sunDirectionEC;
+ }
+ },
+ moonDirectionEC: {
+ get: function() {
+ return this._moonDirectionEC;
+ }
+ },
+ lightDirectionWC: {
+ get: function() {
+ return this._lightDirectionWC;
+ }
+ },
+ lightDirectionEC: {
+ get: function() {
+ return this._lightDirectionEC;
+ }
+ },
+ lightColor: {
+ get: function() {
+ return this._lightColor;
+ }
+ },
+ lightColorHdr: {
+ get: function() {
+ return this._lightColorHdr;
+ }
+ },
+ encodedCameraPositionMCHigh: {
+ get: function() {
+ cleanEncodedCameraPositionMC(this);
+ return this._encodedCameraPositionMC.high;
+ }
+ },
+ encodedCameraPositionMCLow: {
+ get: function() {
+ cleanEncodedCameraPositionMC(this);
+ return this._encodedCameraPositionMC.low;
+ }
+ },
+ temeToPseudoFixedMatrix: {
+ get: function() {
+ return this._temeToPseudoFixed;
+ }
+ },
+ pixelRatio: {
+ get: function() {
+ return this._pixelRatio;
+ }
+ },
+ fogDensity: {
+ get: function() {
+ return this._fogDensity;
+ }
+ },
+ geometricToleranceOverMeter: {
+ get: function() {
+ return this._geometricToleranceOverMeter;
+ }
+ },
+ pass: {
+ get: function() {
+ return this._pass;
+ }
+ },
+ backgroundColor: {
+ get: function() {
+ return this._backgroundColor;
+ }
+ },
+ brdfLut: {
+ get: function() {
+ return this._brdfLut;
+ }
+ },
+ environmentMap: {
+ get: function() {
+ return this._environmentMap;
+ }
+ },
+ sphericalHarmonicCoefficients: {
+ get: function() {
+ return this._sphericalHarmonicCoefficients;
+ }
+ },
+ specularEnvironmentMaps: {
+ get: function() {
+ return this._specularEnvironmentMaps;
+ }
+ },
+ specularEnvironmentMapsDimensions: {
+ get: function() {
+ return this._specularEnvironmentMapsDimensions;
+ }
+ },
+ specularEnvironmentMapsMaximumLOD: {
+ get: function() {
+ return this._specularEnvironmentMapsMaximumLOD;
+ }
+ },
+ splitPosition: {
+ get: function() {
+ return this._splitPosition;
+ }
+ },
+ minimumDisableDepthTestDistance: {
+ get: function() {
+ return this._minimumDisableDepthTestDistance;
+ }
+ },
+ invertClassificationColor: {
+ get: function() {
+ return this._invertClassificationColor;
+ }
+ },
+ orthographicIn3D: {
+ get: function() {
+ return this._orthographicIn3D;
+ }
+ },
+ ellipsoid: {
+ get: function() {
+ return defaultValue_default(this._ellipsoid, Ellipsoid_default.WGS84);
+ }
+ }
+});
+function setView(uniformState, matrix) {
+ Matrix4_default.clone(matrix, uniformState._view);
+ Matrix4_default.getMatrix3(matrix, uniformState._viewRotation);
+ uniformState._view3DDirty = true;
+ uniformState._inverseView3DDirty = true;
+ uniformState._modelViewDirty = true;
+ uniformState._modelView3DDirty = true;
+ uniformState._modelViewRelativeToEyeDirty = true;
+ uniformState._inverseModelViewDirty = true;
+ uniformState._inverseModelView3DDirty = true;
+ uniformState._viewProjectionDirty = true;
+ uniformState._inverseViewProjectionDirty = true;
+ uniformState._modelViewProjectionDirty = true;
+ uniformState._modelViewProjectionRelativeToEyeDirty = true;
+ uniformState._modelViewInfiniteProjectionDirty = true;
+ uniformState._normalDirty = true;
+ uniformState._inverseNormalDirty = true;
+ uniformState._normal3DDirty = true;
+ uniformState._inverseNormal3DDirty = true;
+}
+function setInverseView(uniformState, matrix) {
+ Matrix4_default.clone(matrix, uniformState._inverseView);
+ Matrix4_default.getMatrix3(matrix, uniformState._inverseViewRotation);
+}
+function setProjection(uniformState, matrix) {
+ Matrix4_default.clone(matrix, uniformState._projection);
+ uniformState._inverseProjectionDirty = true;
+ uniformState._viewProjectionDirty = true;
+ uniformState._inverseViewProjectionDirty = true;
+ uniformState._modelViewProjectionDirty = true;
+ uniformState._modelViewProjectionRelativeToEyeDirty = true;
+}
+function setInfiniteProjection(uniformState, matrix) {
+ Matrix4_default.clone(matrix, uniformState._infiniteProjection);
+ uniformState._modelViewInfiniteProjectionDirty = true;
+}
+function setCamera(uniformState, camera) {
+ Cartesian3_default.clone(camera.positionWC, uniformState._cameraPosition);
+ Cartesian3_default.clone(camera.directionWC, uniformState._cameraDirection);
+ Cartesian3_default.clone(camera.rightWC, uniformState._cameraRight);
+ Cartesian3_default.clone(camera.upWC, uniformState._cameraUp);
+ const positionCartographic = camera.positionCartographic;
+ if (!defined_default(positionCartographic)) {
+ uniformState._eyeHeight = -uniformState._ellipsoid.maximumRadius;
+ } else {
+ uniformState._eyeHeight = positionCartographic.height;
+ }
+ uniformState._encodedCameraPositionMCDirty = true;
+}
+var transformMatrix = new Matrix3_default();
+var sunCartographicScratch = new Cartographic_default();
+function setSunAndMoonDirections(uniformState, frameState) {
+ if (!defined_default(
+ Transforms_default.computeIcrfToFixedMatrix(frameState.time, transformMatrix)
+ )) {
+ transformMatrix = Transforms_default.computeTemeToPseudoFixedMatrix(
+ frameState.time,
+ transformMatrix
+ );
+ }
+ let position = Simon1994PlanetaryPositions_default.computeSunPositionInEarthInertialFrame(
+ frameState.time,
+ uniformState._sunPositionWC
+ );
+ Matrix3_default.multiplyByVector(transformMatrix, position, position);
+ Cartesian3_default.normalize(position, uniformState._sunDirectionWC);
+ position = Matrix3_default.multiplyByVector(
+ uniformState.viewRotation3D,
+ position,
+ uniformState._sunDirectionEC
+ );
+ Cartesian3_default.normalize(position, position);
+ position = Simon1994PlanetaryPositions_default.computeMoonPositionInEarthInertialFrame(
+ frameState.time,
+ uniformState._moonDirectionEC
+ );
+ Matrix3_default.multiplyByVector(transformMatrix, position, position);
+ Matrix3_default.multiplyByVector(uniformState.viewRotation3D, position, position);
+ Cartesian3_default.normalize(position, position);
+ const projection = frameState.mapProjection;
+ const ellipsoid = projection.ellipsoid;
+ const sunCartographic = ellipsoid.cartesianToCartographic(
+ uniformState._sunPositionWC,
+ sunCartographicScratch
+ );
+ projection.project(sunCartographic, uniformState._sunPositionColumbusView);
+}
+UniformState.prototype.updateCamera = function(camera) {
+ setView(this, camera.viewMatrix);
+ setInverseView(this, camera.inverseViewMatrix);
+ setCamera(this, camera);
+ this._entireFrustum.x = camera.frustum.near;
+ this._entireFrustum.y = camera.frustum.far;
+ this.updateFrustum(camera.frustum);
+ this._orthographicIn3D = this._mode !== SceneMode_default.SCENE2D && camera.frustum instanceof OrthographicFrustum_default;
+};
+UniformState.prototype.updateFrustum = function(frustum) {
+ setProjection(this, frustum.projectionMatrix);
+ if (defined_default(frustum.infiniteProjectionMatrix)) {
+ setInfiniteProjection(this, frustum.infiniteProjectionMatrix);
+ }
+ this._currentFrustum.x = frustum.near;
+ this._currentFrustum.y = frustum.far;
+ this._farDepthFromNearPlusOne = frustum.far - frustum.near + 1;
+ this._log2FarDepthFromNearPlusOne = Math_default.log2(
+ this._farDepthFromNearPlusOne
+ );
+ this._oneOverLog2FarDepthFromNearPlusOne = 1 / this._log2FarDepthFromNearPlusOne;
+ if (defined_default(frustum._offCenterFrustum)) {
+ frustum = frustum._offCenterFrustum;
+ }
+ this._frustumPlanes.x = frustum.top;
+ this._frustumPlanes.y = frustum.bottom;
+ this._frustumPlanes.z = frustum.left;
+ this._frustumPlanes.w = frustum.right;
+};
+UniformState.prototype.updatePass = function(pass) {
+ this._pass = pass;
+};
+var EMPTY_ARRAY = [];
+var defaultLight = new SunLight_default();
+UniformState.prototype.update = function(frameState) {
+ this._mode = frameState.mode;
+ this._mapProjection = frameState.mapProjection;
+ this._ellipsoid = frameState.mapProjection.ellipsoid;
+ this._pixelRatio = frameState.pixelRatio;
+ const camera = frameState.camera;
+ this.updateCamera(camera);
+ if (frameState.mode === SceneMode_default.SCENE2D) {
+ this._frustum2DWidth = camera.frustum.right - camera.frustum.left;
+ this._eyeHeight2D.x = this._frustum2DWidth * 0.5;
+ this._eyeHeight2D.y = this._eyeHeight2D.x * this._eyeHeight2D.x;
+ } else {
+ this._frustum2DWidth = 0;
+ this._eyeHeight2D.x = 0;
+ this._eyeHeight2D.y = 0;
+ }
+ setSunAndMoonDirections(this, frameState);
+ const light = defaultValue_default(frameState.light, defaultLight);
+ if (light instanceof SunLight_default) {
+ this._lightDirectionWC = Cartesian3_default.clone(
+ this._sunDirectionWC,
+ this._lightDirectionWC
+ );
+ this._lightDirectionEC = Cartesian3_default.clone(
+ this._sunDirectionEC,
+ this._lightDirectionEC
+ );
+ } else {
+ this._lightDirectionWC = Cartesian3_default.normalize(
+ Cartesian3_default.negate(light.direction, this._lightDirectionWC),
+ this._lightDirectionWC
+ );
+ this._lightDirectionEC = Matrix3_default.multiplyByVector(
+ this.viewRotation3D,
+ this._lightDirectionWC,
+ this._lightDirectionEC
+ );
+ }
+ const lightColor = light.color;
+ let lightColorHdr = Cartesian3_default.fromElements(
+ lightColor.red,
+ lightColor.green,
+ lightColor.blue,
+ this._lightColorHdr
+ );
+ lightColorHdr = Cartesian3_default.multiplyByScalar(
+ lightColorHdr,
+ light.intensity,
+ lightColorHdr
+ );
+ const maximumComponent = Cartesian3_default.maximumComponent(lightColorHdr);
+ if (maximumComponent > 1) {
+ Cartesian3_default.divideByScalar(
+ lightColorHdr,
+ maximumComponent,
+ this._lightColor
+ );
+ } else {
+ Cartesian3_default.clone(lightColorHdr, this._lightColor);
+ }
+ const brdfLutGenerator = frameState.brdfLutGenerator;
+ const brdfLut = defined_default(brdfLutGenerator) ? brdfLutGenerator.colorTexture : void 0;
+ this._brdfLut = brdfLut;
+ this._environmentMap = defaultValue_default(
+ frameState.environmentMap,
+ frameState.context.defaultCubeMap
+ );
+ this._sphericalHarmonicCoefficients = defaultValue_default(
+ frameState.sphericalHarmonicCoefficients,
+ EMPTY_ARRAY
+ );
+ this._specularEnvironmentMaps = frameState.specularEnvironmentMaps;
+ this._specularEnvironmentMapsMaximumLOD = frameState.specularEnvironmentMapsMaximumLOD;
+ if (defined_default(this._specularEnvironmentMaps)) {
+ Cartesian2_default.clone(
+ this._specularEnvironmentMaps.dimensions,
+ this._specularEnvironmentMapsDimensions
+ );
+ }
+ this._fogDensity = frameState.fog.density;
+ this._invertClassificationColor = frameState.invertClassificationColor;
+ this._frameState = frameState;
+ this._temeToPseudoFixed = Transforms_default.computeTemeToPseudoFixedMatrix(
+ frameState.time,
+ this._temeToPseudoFixed
+ );
+ this._splitPosition = frameState.splitPosition * frameState.context.drawingBufferWidth;
+ const fov = camera.frustum.fov;
+ const viewport = this._viewport;
+ let pixelSizePerMeter;
+ if (defined_default(fov)) {
+ if (viewport.height > viewport.width) {
+ pixelSizePerMeter = Math.tan(0.5 * fov) * 2 / viewport.height;
+ } else {
+ pixelSizePerMeter = Math.tan(0.5 * fov) * 2 / viewport.width;
+ }
+ } else {
+ pixelSizePerMeter = 1 / Math.max(viewport.width, viewport.height);
+ }
+ this._geometricToleranceOverMeter = pixelSizePerMeter * frameState.maximumScreenSpaceError;
+ Color_default.clone(frameState.backgroundColor, this._backgroundColor);
+ this._minimumDisableDepthTestDistance = frameState.minimumDisableDepthTestDistance;
+ this._minimumDisableDepthTestDistance *= this._minimumDisableDepthTestDistance;
+ if (this._minimumDisableDepthTestDistance === Number.POSITIVE_INFINITY) {
+ this._minimumDisableDepthTestDistance = -1;
+ }
+};
+function cleanViewport(uniformState) {
+ if (uniformState._viewportDirty) {
+ const v7 = uniformState._viewport;
+ Matrix4_default.computeOrthographicOffCenter(
+ v7.x,
+ v7.x + v7.width,
+ v7.y,
+ v7.y + v7.height,
+ 0,
+ 1,
+ uniformState._viewportOrthographicMatrix
+ );
+ Matrix4_default.computeViewportTransformation(
+ v7,
+ 0,
+ 1,
+ uniformState._viewportTransformation
+ );
+ uniformState._viewportDirty = false;
+ }
+}
+function cleanInverseProjection(uniformState) {
+ if (uniformState._inverseProjectionDirty) {
+ uniformState._inverseProjectionDirty = false;
+ if (uniformState._mode !== SceneMode_default.SCENE2D && uniformState._mode !== SceneMode_default.MORPHING && !uniformState._orthographicIn3D) {
+ Matrix4_default.inverse(
+ uniformState._projection,
+ uniformState._inverseProjection
+ );
+ } else {
+ Matrix4_default.clone(Matrix4_default.ZERO, uniformState._inverseProjection);
+ }
+ }
+}
+function cleanModelView(uniformState) {
+ if (uniformState._modelViewDirty) {
+ uniformState._modelViewDirty = false;
+ Matrix4_default.multiplyTransformation(
+ uniformState._view,
+ uniformState._model,
+ uniformState._modelView
+ );
+ }
+}
+function cleanModelView3D(uniformState) {
+ if (uniformState._modelView3DDirty) {
+ uniformState._modelView3DDirty = false;
+ Matrix4_default.multiplyTransformation(
+ uniformState.view3D,
+ uniformState._model,
+ uniformState._modelView3D
+ );
+ }
+}
+function cleanInverseModelView(uniformState) {
+ if (uniformState._inverseModelViewDirty) {
+ uniformState._inverseModelViewDirty = false;
+ Matrix4_default.inverse(uniformState.modelView, uniformState._inverseModelView);
+ }
+}
+function cleanInverseModelView3D(uniformState) {
+ if (uniformState._inverseModelView3DDirty) {
+ uniformState._inverseModelView3DDirty = false;
+ Matrix4_default.inverse(uniformState.modelView3D, uniformState._inverseModelView3D);
+ }
+}
+function cleanViewProjection(uniformState) {
+ if (uniformState._viewProjectionDirty) {
+ uniformState._viewProjectionDirty = false;
+ Matrix4_default.multiply(
+ uniformState._projection,
+ uniformState._view,
+ uniformState._viewProjection
+ );
+ }
+}
+function cleanInverseViewProjection(uniformState) {
+ if (uniformState._inverseViewProjectionDirty) {
+ uniformState._inverseViewProjectionDirty = false;
+ Matrix4_default.inverse(
+ uniformState.viewProjection,
+ uniformState._inverseViewProjection
+ );
+ }
+}
+function cleanModelViewProjection(uniformState) {
+ if (uniformState._modelViewProjectionDirty) {
+ uniformState._modelViewProjectionDirty = false;
+ Matrix4_default.multiply(
+ uniformState._projection,
+ uniformState.modelView,
+ uniformState._modelViewProjection
+ );
+ }
+}
+function cleanModelViewRelativeToEye(uniformState) {
+ if (uniformState._modelViewRelativeToEyeDirty) {
+ uniformState._modelViewRelativeToEyeDirty = false;
+ const mv = uniformState.modelView;
+ const mvRte = uniformState._modelViewRelativeToEye;
+ mvRte[0] = mv[0];
+ mvRte[1] = mv[1];
+ mvRte[2] = mv[2];
+ mvRte[3] = mv[3];
+ mvRte[4] = mv[4];
+ mvRte[5] = mv[5];
+ mvRte[6] = mv[6];
+ mvRte[7] = mv[7];
+ mvRte[8] = mv[8];
+ mvRte[9] = mv[9];
+ mvRte[10] = mv[10];
+ mvRte[11] = mv[11];
+ mvRte[12] = 0;
+ mvRte[13] = 0;
+ mvRte[14] = 0;
+ mvRte[15] = mv[15];
+ }
+}
+function cleanInverseModelViewProjection(uniformState) {
+ if (uniformState._inverseModelViewProjectionDirty) {
+ uniformState._inverseModelViewProjectionDirty = false;
+ Matrix4_default.inverse(
+ uniformState.modelViewProjection,
+ uniformState._inverseModelViewProjection
+ );
+ }
+}
+function cleanModelViewProjectionRelativeToEye(uniformState) {
+ if (uniformState._modelViewProjectionRelativeToEyeDirty) {
+ uniformState._modelViewProjectionRelativeToEyeDirty = false;
+ Matrix4_default.multiply(
+ uniformState._projection,
+ uniformState.modelViewRelativeToEye,
+ uniformState._modelViewProjectionRelativeToEye
+ );
+ }
+}
+function cleanModelViewInfiniteProjection(uniformState) {
+ if (uniformState._modelViewInfiniteProjectionDirty) {
+ uniformState._modelViewInfiniteProjectionDirty = false;
+ Matrix4_default.multiply(
+ uniformState._infiniteProjection,
+ uniformState.modelView,
+ uniformState._modelViewInfiniteProjection
+ );
+ }
+}
+function cleanNormal(uniformState) {
+ if (uniformState._normalDirty) {
+ uniformState._normalDirty = false;
+ const m = uniformState._normal;
+ Matrix4_default.getMatrix3(uniformState.inverseModelView, m);
+ Matrix3_default.getRotation(m, m);
+ Matrix3_default.transpose(m, m);
+ }
+}
+function cleanNormal3D(uniformState) {
+ if (uniformState._normal3DDirty) {
+ uniformState._normal3DDirty = false;
+ const m = uniformState._normal3D;
+ Matrix4_default.getMatrix3(uniformState.inverseModelView3D, m);
+ Matrix3_default.getRotation(m, m);
+ Matrix3_default.transpose(m, m);
+ }
+}
+function cleanInverseNormal(uniformState) {
+ if (uniformState._inverseNormalDirty) {
+ uniformState._inverseNormalDirty = false;
+ Matrix4_default.getMatrix3(
+ uniformState.inverseModelView,
+ uniformState._inverseNormal
+ );
+ Matrix3_default.getRotation(
+ uniformState._inverseNormal,
+ uniformState._inverseNormal
+ );
+ }
+}
+function cleanInverseNormal3D(uniformState) {
+ if (uniformState._inverseNormal3DDirty) {
+ uniformState._inverseNormal3DDirty = false;
+ Matrix4_default.getMatrix3(
+ uniformState.inverseModelView3D,
+ uniformState._inverseNormal3D
+ );
+ Matrix3_default.getRotation(
+ uniformState._inverseNormal3D,
+ uniformState._inverseNormal3D
+ );
+ }
+}
+var cameraPositionMC = new Cartesian3_default();
+function cleanEncodedCameraPositionMC(uniformState) {
+ if (uniformState._encodedCameraPositionMCDirty) {
+ uniformState._encodedCameraPositionMCDirty = false;
+ Matrix4_default.multiplyByPoint(
+ uniformState.inverseModel,
+ uniformState._cameraPosition,
+ cameraPositionMC
+ );
+ EncodedCartesian3_default.fromCartesian(
+ cameraPositionMC,
+ uniformState._encodedCameraPositionMC
+ );
+ }
+}
+var view2Dto3DPScratch = new Cartesian3_default();
+var view2Dto3DRScratch = new Cartesian3_default();
+var view2Dto3DUScratch = new Cartesian3_default();
+var view2Dto3DDScratch = new Cartesian3_default();
+var view2Dto3DCartographicScratch = new Cartographic_default();
+var view2Dto3DCartesian3Scratch = new Cartesian3_default();
+var view2Dto3DMatrix4Scratch = new Matrix4_default();
+function view2Dto3D(position2D, direction2D, right2D, up2D, frustum2DWidth, mode2, projection, result) {
+ const p = view2Dto3DPScratch;
+ p.x = position2D.y;
+ p.y = position2D.z;
+ p.z = position2D.x;
+ const r = view2Dto3DRScratch;
+ r.x = right2D.y;
+ r.y = right2D.z;
+ r.z = right2D.x;
+ const u3 = view2Dto3DUScratch;
+ u3.x = up2D.y;
+ u3.y = up2D.z;
+ u3.z = up2D.x;
+ const d = view2Dto3DDScratch;
+ d.x = direction2D.y;
+ d.y = direction2D.z;
+ d.z = direction2D.x;
+ if (mode2 === SceneMode_default.SCENE2D) {
+ p.z = frustum2DWidth * 0.5;
+ }
+ const cartographic2 = projection.unproject(p, view2Dto3DCartographicScratch);
+ cartographic2.longitude = Math_default.clamp(
+ cartographic2.longitude,
+ -Math.PI,
+ Math.PI
+ );
+ cartographic2.latitude = Math_default.clamp(
+ cartographic2.latitude,
+ -Math_default.PI_OVER_TWO,
+ Math_default.PI_OVER_TWO
+ );
+ const ellipsoid = projection.ellipsoid;
+ const position3D = ellipsoid.cartographicToCartesian(
+ cartographic2,
+ view2Dto3DCartesian3Scratch
+ );
+ const enuToFixed = Transforms_default.eastNorthUpToFixedFrame(
+ position3D,
+ ellipsoid,
+ view2Dto3DMatrix4Scratch
+ );
+ Matrix4_default.multiplyByPointAsVector(enuToFixed, r, r);
+ Matrix4_default.multiplyByPointAsVector(enuToFixed, u3, u3);
+ Matrix4_default.multiplyByPointAsVector(enuToFixed, d, d);
+ if (!defined_default(result)) {
+ result = new Matrix4_default();
+ }
+ result[0] = r.x;
+ result[1] = u3.x;
+ result[2] = -d.x;
+ result[3] = 0;
+ result[4] = r.y;
+ result[5] = u3.y;
+ result[6] = -d.y;
+ result[7] = 0;
+ result[8] = r.z;
+ result[9] = u3.z;
+ result[10] = -d.z;
+ result[11] = 0;
+ result[12] = -Cartesian3_default.dot(r, position3D);
+ result[13] = -Cartesian3_default.dot(u3, position3D);
+ result[14] = Cartesian3_default.dot(d, position3D);
+ result[15] = 1;
+ return result;
+}
+function updateView3D(that) {
+ if (that._view3DDirty) {
+ if (that._mode === SceneMode_default.SCENE3D) {
+ Matrix4_default.clone(that._view, that._view3D);
+ } else {
+ view2Dto3D(
+ that._cameraPosition,
+ that._cameraDirection,
+ that._cameraRight,
+ that._cameraUp,
+ that._frustum2DWidth,
+ that._mode,
+ that._mapProjection,
+ that._view3D
+ );
+ }
+ Matrix4_default.getMatrix3(that._view3D, that._viewRotation3D);
+ that._view3DDirty = false;
+ }
+}
+function updateInverseView3D(that) {
+ if (that._inverseView3DDirty) {
+ Matrix4_default.inverseTransformation(that.view3D, that._inverseView3D);
+ Matrix4_default.getMatrix3(that._inverseView3D, that._inverseViewRotation3D);
+ that._inverseView3DDirty = false;
+ }
+}
+var UniformState_default = UniformState;
+
+// Source/Renderer/VertexArray.js
+function addAttribute(attributes, attribute, index, context) {
+ const hasVertexBuffer = defined_default(attribute.vertexBuffer);
+ const hasValue = defined_default(attribute.value);
+ const componentsPerAttribute = attribute.value ? attribute.value.length : attribute.componentsPerAttribute;
+ if (!hasVertexBuffer && !hasValue) {
+ throw new DeveloperError_default("attribute must have a vertexBuffer or a value.");
+ }
+ if (hasVertexBuffer && hasValue) {
+ throw new DeveloperError_default(
+ "attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices."
+ );
+ }
+ if (componentsPerAttribute !== 1 && componentsPerAttribute !== 2 && componentsPerAttribute !== 3 && componentsPerAttribute !== 4) {
+ if (hasValue) {
+ throw new DeveloperError_default(
+ "attribute.value.length must be in the range [1, 4]."
+ );
+ }
+ throw new DeveloperError_default(
+ "attribute.componentsPerAttribute must be in the range [1, 4]."
+ );
+ }
+ if (defined_default(attribute.componentDatatype) && !ComponentDatatype_default.validate(attribute.componentDatatype)) {
+ throw new DeveloperError_default(
+ "attribute must have a valid componentDatatype or not specify it."
+ );
+ }
+ if (defined_default(attribute.strideInBytes) && attribute.strideInBytes > 255) {
+ throw new DeveloperError_default(
+ "attribute must have a strideInBytes less than or equal to 255 or not specify it."
+ );
+ }
+ if (defined_default(attribute.instanceDivisor) && attribute.instanceDivisor > 0 && !context.instancedArrays) {
+ throw new DeveloperError_default("instanced arrays is not supported");
+ }
+ if (defined_default(attribute.instanceDivisor) && attribute.instanceDivisor < 0) {
+ throw new DeveloperError_default(
+ "attribute must have an instanceDivisor greater than or equal to zero"
+ );
+ }
+ if (defined_default(attribute.instanceDivisor) && hasValue) {
+ throw new DeveloperError_default(
+ "attribute cannot have have an instanceDivisor if it is not backed by a buffer"
+ );
+ }
+ if (defined_default(attribute.instanceDivisor) && attribute.instanceDivisor > 0 && attribute.index === 0) {
+ throw new DeveloperError_default(
+ "attribute zero cannot have an instanceDivisor greater than 0"
+ );
+ }
+ const attr = {
+ index: defaultValue_default(attribute.index, index),
+ enabled: defaultValue_default(attribute.enabled, true),
+ vertexBuffer: attribute.vertexBuffer,
+ value: hasValue ? attribute.value.slice(0) : void 0,
+ componentsPerAttribute,
+ componentDatatype: defaultValue_default(
+ attribute.componentDatatype,
+ ComponentDatatype_default.FLOAT
+ ),
+ normalize: defaultValue_default(attribute.normalize, false),
+ offsetInBytes: defaultValue_default(attribute.offsetInBytes, 0),
+ strideInBytes: defaultValue_default(attribute.strideInBytes, 0),
+ instanceDivisor: defaultValue_default(attribute.instanceDivisor, 0)
+ };
+ if (hasVertexBuffer) {
+ attr.vertexAttrib = function(gl) {
+ const index2 = this.index;
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer._getBuffer());
+ gl.vertexAttribPointer(
+ index2,
+ this.componentsPerAttribute,
+ this.componentDatatype,
+ this.normalize,
+ this.strideInBytes,
+ this.offsetInBytes
+ );
+ gl.enableVertexAttribArray(index2);
+ if (this.instanceDivisor > 0) {
+ context.glVertexAttribDivisor(index2, this.instanceDivisor);
+ context._vertexAttribDivisors[index2] = this.instanceDivisor;
+ context._previousDrawInstanced = true;
+ }
+ };
+ attr.disableVertexAttribArray = function(gl) {
+ gl.disableVertexAttribArray(this.index);
+ if (this.instanceDivisor > 0) {
+ context.glVertexAttribDivisor(index, 0);
+ }
+ };
+ } else {
+ switch (attr.componentsPerAttribute) {
+ case 1:
+ attr.vertexAttrib = function(gl) {
+ gl.vertexAttrib1fv(this.index, this.value);
+ };
+ break;
+ case 2:
+ attr.vertexAttrib = function(gl) {
+ gl.vertexAttrib2fv(this.index, this.value);
+ };
+ break;
+ case 3:
+ attr.vertexAttrib = function(gl) {
+ gl.vertexAttrib3fv(this.index, this.value);
+ };
+ break;
+ case 4:
+ attr.vertexAttrib = function(gl) {
+ gl.vertexAttrib4fv(this.index, this.value);
+ };
+ break;
+ }
+ attr.disableVertexAttribArray = function(gl) {
+ };
+ }
+ attributes.push(attr);
+}
+function bind(gl, attributes, indexBuffer) {
+ for (let i = 0; i < attributes.length; ++i) {
+ const attribute = attributes[i];
+ if (attribute.enabled) {
+ attribute.vertexAttrib(gl);
+ }
+ }
+ if (defined_default(indexBuffer)) {
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer._getBuffer());
+ }
+}
+function VertexArray(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.context", options.context);
+ Check_default.defined("options.attributes", options.attributes);
+ const context = options.context;
+ const gl = context._gl;
+ const attributes = options.attributes;
+ const indexBuffer = options.indexBuffer;
+ let i;
+ const vaAttributes = [];
+ let numberOfVertices = 1;
+ let hasInstancedAttributes = false;
+ let hasConstantAttributes = false;
+ let length3 = attributes.length;
+ for (i = 0; i < length3; ++i) {
+ addAttribute(vaAttributes, attributes[i], i, context);
+ }
+ length3 = vaAttributes.length;
+ for (i = 0; i < length3; ++i) {
+ const attribute = vaAttributes[i];
+ if (defined_default(attribute.vertexBuffer) && attribute.instanceDivisor === 0) {
+ const bytes = attribute.strideInBytes || attribute.componentsPerAttribute * ComponentDatatype_default.getSizeInBytes(attribute.componentDatatype);
+ numberOfVertices = attribute.vertexBuffer.sizeInBytes / bytes;
+ break;
+ }
+ }
+ for (i = 0; i < length3; ++i) {
+ if (vaAttributes[i].instanceDivisor > 0) {
+ hasInstancedAttributes = true;
+ }
+ if (defined_default(vaAttributes[i].value)) {
+ hasConstantAttributes = true;
+ }
+ }
+ const uniqueIndices = {};
+ for (i = 0; i < length3; ++i) {
+ const index = vaAttributes[i].index;
+ if (uniqueIndices[index]) {
+ throw new DeveloperError_default(
+ `Index ${index} is used by more than one attribute.`
+ );
+ }
+ uniqueIndices[index] = true;
+ }
+ let vao;
+ if (context.vertexArrayObject) {
+ vao = context.glCreateVertexArray();
+ context.glBindVertexArray(vao);
+ bind(gl, vaAttributes, indexBuffer);
+ context.glBindVertexArray(null);
+ }
+ this._numberOfVertices = numberOfVertices;
+ this._hasInstancedAttributes = hasInstancedAttributes;
+ this._hasConstantAttributes = hasConstantAttributes;
+ this._context = context;
+ this._gl = gl;
+ this._vao = vao;
+ this._attributes = vaAttributes;
+ this._indexBuffer = indexBuffer;
+}
+function computeNumberOfVertices(attribute) {
+ return attribute.values.length / attribute.componentsPerAttribute;
+}
+function computeAttributeSizeInBytes(attribute) {
+ return ComponentDatatype_default.getSizeInBytes(attribute.componentDatatype) * attribute.componentsPerAttribute;
+}
+function interleaveAttributes(attributes) {
+ let j;
+ let name;
+ let attribute;
+ const names = [];
+ for (name in attributes) {
+ if (attributes.hasOwnProperty(name) && defined_default(attributes[name]) && defined_default(attributes[name].values)) {
+ names.push(name);
+ if (attributes[name].componentDatatype === ComponentDatatype_default.DOUBLE) {
+ attributes[name].componentDatatype = ComponentDatatype_default.FLOAT;
+ attributes[name].values = ComponentDatatype_default.createTypedArray(
+ ComponentDatatype_default.FLOAT,
+ attributes[name].values
+ );
+ }
+ }
+ }
+ let numberOfVertices;
+ const namesLength = names.length;
+ if (namesLength > 0) {
+ numberOfVertices = computeNumberOfVertices(attributes[names[0]]);
+ for (j = 1; j < namesLength; ++j) {
+ const currentNumberOfVertices = computeNumberOfVertices(
+ attributes[names[j]]
+ );
+ if (currentNumberOfVertices !== numberOfVertices) {
+ throw new RuntimeError_default(
+ `${"Each attribute list must have the same number of vertices. Attribute "}${names[j]} has a different number of vertices (${currentNumberOfVertices.toString()}) than attribute ${names[0]} (${numberOfVertices.toString()}).`
+ );
+ }
+ }
+ }
+ names.sort(function(left, right) {
+ return ComponentDatatype_default.getSizeInBytes(attributes[right].componentDatatype) - ComponentDatatype_default.getSizeInBytes(attributes[left].componentDatatype);
+ });
+ let vertexSizeInBytes = 0;
+ const offsetsInBytes = {};
+ for (j = 0; j < namesLength; ++j) {
+ name = names[j];
+ attribute = attributes[name];
+ offsetsInBytes[name] = vertexSizeInBytes;
+ vertexSizeInBytes += computeAttributeSizeInBytes(attribute);
+ }
+ if (vertexSizeInBytes > 0) {
+ const maxComponentSizeInBytes = ComponentDatatype_default.getSizeInBytes(
+ attributes[names[0]].componentDatatype
+ );
+ const remainder = vertexSizeInBytes % maxComponentSizeInBytes;
+ if (remainder !== 0) {
+ vertexSizeInBytes += maxComponentSizeInBytes - remainder;
+ }
+ const vertexBufferSizeInBytes = numberOfVertices * vertexSizeInBytes;
+ const buffer = new ArrayBuffer(vertexBufferSizeInBytes);
+ const views = {};
+ for (j = 0; j < namesLength; ++j) {
+ name = names[j];
+ const sizeInBytes = ComponentDatatype_default.getSizeInBytes(
+ attributes[name].componentDatatype
+ );
+ views[name] = {
+ pointer: ComponentDatatype_default.createTypedArray(
+ attributes[name].componentDatatype,
+ buffer
+ ),
+ index: offsetsInBytes[name] / sizeInBytes,
+ strideInComponentType: vertexSizeInBytes / sizeInBytes
+ };
+ }
+ for (j = 0; j < numberOfVertices; ++j) {
+ for (let n = 0; n < namesLength; ++n) {
+ name = names[n];
+ attribute = attributes[name];
+ const values = attribute.values;
+ const view = views[name];
+ const pointer = view.pointer;
+ const numberOfComponents = attribute.componentsPerAttribute;
+ for (let k = 0; k < numberOfComponents; ++k) {
+ pointer[view.index + k] = values[j * numberOfComponents + k];
+ }
+ view.index += view.strideInComponentType;
+ }
+ }
+ return {
+ buffer,
+ offsetsInBytes,
+ vertexSizeInBytes
+ };
+ }
+ return void 0;
+}
+VertexArray.fromGeometry = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.context", options.context);
+ const context = options.context;
+ const geometry = defaultValue_default(options.geometry, defaultValue_default.EMPTY_OBJECT);
+ const bufferUsage = defaultValue_default(
+ options.bufferUsage,
+ BufferUsage_default.DYNAMIC_DRAW
+ );
+ const attributeLocations8 = defaultValue_default(
+ options.attributeLocations,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ const interleave = defaultValue_default(options.interleave, false);
+ const createdVAAttributes = options.vertexArrayAttributes;
+ let name;
+ let attribute;
+ let vertexBuffer;
+ const vaAttributes = defined_default(createdVAAttributes) ? createdVAAttributes : [];
+ const attributes = geometry.attributes;
+ if (interleave) {
+ const interleavedAttributes = interleaveAttributes(attributes);
+ if (defined_default(interleavedAttributes)) {
+ vertexBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: interleavedAttributes.buffer,
+ usage: bufferUsage
+ });
+ const offsetsInBytes = interleavedAttributes.offsetsInBytes;
+ const strideInBytes = interleavedAttributes.vertexSizeInBytes;
+ for (name in attributes) {
+ if (attributes.hasOwnProperty(name) && defined_default(attributes[name])) {
+ attribute = attributes[name];
+ if (defined_default(attribute.values)) {
+ vaAttributes.push({
+ index: attributeLocations8[name],
+ vertexBuffer,
+ componentDatatype: attribute.componentDatatype,
+ componentsPerAttribute: attribute.componentsPerAttribute,
+ normalize: attribute.normalize,
+ offsetInBytes: offsetsInBytes[name],
+ strideInBytes
+ });
+ } else {
+ vaAttributes.push({
+ index: attributeLocations8[name],
+ value: attribute.value,
+ componentDatatype: attribute.componentDatatype,
+ normalize: attribute.normalize
+ });
+ }
+ }
+ }
+ }
+ } else {
+ for (name in attributes) {
+ if (attributes.hasOwnProperty(name) && defined_default(attributes[name])) {
+ attribute = attributes[name];
+ let componentDatatype = attribute.componentDatatype;
+ if (componentDatatype === ComponentDatatype_default.DOUBLE) {
+ componentDatatype = ComponentDatatype_default.FLOAT;
+ }
+ vertexBuffer = void 0;
+ if (defined_default(attribute.values)) {
+ vertexBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: ComponentDatatype_default.createTypedArray(
+ componentDatatype,
+ attribute.values
+ ),
+ usage: bufferUsage
+ });
+ }
+ vaAttributes.push({
+ index: attributeLocations8[name],
+ vertexBuffer,
+ value: attribute.value,
+ componentDatatype,
+ componentsPerAttribute: attribute.componentsPerAttribute,
+ normalize: attribute.normalize
+ });
+ }
+ }
+ }
+ let indexBuffer;
+ const indices2 = geometry.indices;
+ if (defined_default(indices2)) {
+ if (Geometry_default.computeNumberOfVertices(geometry) >= Math_default.SIXTY_FOUR_KILOBYTES && context.elementIndexUint) {
+ indexBuffer = Buffer_default.createIndexBuffer({
+ context,
+ typedArray: new Uint32Array(indices2),
+ usage: bufferUsage,
+ indexDatatype: IndexDatatype_default.UNSIGNED_INT
+ });
+ } else {
+ indexBuffer = Buffer_default.createIndexBuffer({
+ context,
+ typedArray: new Uint16Array(indices2),
+ usage: bufferUsage,
+ indexDatatype: IndexDatatype_default.UNSIGNED_SHORT
+ });
+ }
+ }
+ return new VertexArray({
+ context,
+ attributes: vaAttributes,
+ indexBuffer
+ });
+};
+Object.defineProperties(VertexArray.prototype, {
+ numberOfAttributes: {
+ get: function() {
+ return this._attributes.length;
+ }
+ },
+ numberOfVertices: {
+ get: function() {
+ return this._numberOfVertices;
+ }
+ },
+ indexBuffer: {
+ get: function() {
+ return this._indexBuffer;
+ }
+ }
+});
+VertexArray.prototype.getAttribute = function(index) {
+ Check_default.defined("index", index);
+ return this._attributes[index];
+};
+function setVertexAttribDivisor(vertexArray) {
+ const context = vertexArray._context;
+ const hasInstancedAttributes = vertexArray._hasInstancedAttributes;
+ if (!hasInstancedAttributes && !context._previousDrawInstanced) {
+ return;
+ }
+ context._previousDrawInstanced = hasInstancedAttributes;
+ const divisors = context._vertexAttribDivisors;
+ const attributes = vertexArray._attributes;
+ const maxAttributes = ContextLimits_default.maximumVertexAttributes;
+ let i;
+ if (hasInstancedAttributes) {
+ const length3 = attributes.length;
+ for (i = 0; i < length3; ++i) {
+ const attribute = attributes[i];
+ if (attribute.enabled) {
+ const divisor = attribute.instanceDivisor;
+ const index = attribute.index;
+ if (divisor !== divisors[index]) {
+ context.glVertexAttribDivisor(index, divisor);
+ divisors[index] = divisor;
+ }
+ }
+ }
+ } else {
+ for (i = 0; i < maxAttributes; ++i) {
+ if (divisors[i] > 0) {
+ context.glVertexAttribDivisor(i, 0);
+ divisors[i] = 0;
+ }
+ }
+ }
+}
+function setConstantAttributes(vertexArray, gl) {
+ const attributes = vertexArray._attributes;
+ const length3 = attributes.length;
+ for (let i = 0; i < length3; ++i) {
+ const attribute = attributes[i];
+ if (attribute.enabled && defined_default(attribute.value)) {
+ attribute.vertexAttrib(gl);
+ }
+ }
+}
+VertexArray.prototype._bind = function() {
+ if (defined_default(this._vao)) {
+ this._context.glBindVertexArray(this._vao);
+ if (this._context.instancedArrays) {
+ setVertexAttribDivisor(this);
+ }
+ if (this._hasConstantAttributes) {
+ setConstantAttributes(this, this._gl);
+ }
+ } else {
+ bind(this._gl, this._attributes, this._indexBuffer);
+ }
+};
+VertexArray.prototype._unBind = function() {
+ if (defined_default(this._vao)) {
+ this._context.glBindVertexArray(null);
+ } else {
+ const attributes = this._attributes;
+ const gl = this._gl;
+ for (let i = 0; i < attributes.length; ++i) {
+ const attribute = attributes[i];
+ if (attribute.enabled) {
+ attribute.disableVertexAttribArray(gl);
+ }
+ }
+ if (this._indexBuffer) {
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);
+ }
+ }
+};
+VertexArray.prototype.isDestroyed = function() {
+ return false;
+};
+VertexArray.prototype.destroy = function() {
+ const attributes = this._attributes;
+ for (let i = 0; i < attributes.length; ++i) {
+ const vertexBuffer = attributes[i].vertexBuffer;
+ if (defined_default(vertexBuffer) && !vertexBuffer.isDestroyed() && vertexBuffer.vertexArrayDestroyable) {
+ vertexBuffer.destroy();
+ }
+ }
+ const indexBuffer = this._indexBuffer;
+ if (defined_default(indexBuffer) && !indexBuffer.isDestroyed() && indexBuffer.vertexArrayDestroyable) {
+ indexBuffer.destroy();
+ }
+ if (defined_default(this._vao)) {
+ this._context.glDeleteVertexArray(this._vao);
+ }
+ return destroyObject_default(this);
+};
+var VertexArray_default = VertexArray;
+
+// Source/Renderer/Context.js
+function errorToString(gl, error) {
+ let message = "WebGL Error: ";
+ switch (error) {
+ case gl.INVALID_ENUM:
+ message += "INVALID_ENUM";
+ break;
+ case gl.INVALID_VALUE:
+ message += "INVALID_VALUE";
+ break;
+ case gl.INVALID_OPERATION:
+ message += "INVALID_OPERATION";
+ break;
+ case gl.OUT_OF_MEMORY:
+ message += "OUT_OF_MEMORY";
+ break;
+ case gl.CONTEXT_LOST_WEBGL:
+ message += "CONTEXT_LOST_WEBGL lost";
+ break;
+ default:
+ message += `Unknown (${error})`;
+ }
+ return message;
+}
+function createErrorMessage(gl, glFunc, glFuncArguments, error) {
+ let message = `${errorToString(gl, error)}: ${glFunc.name}(`;
+ for (let i = 0; i < glFuncArguments.length; ++i) {
+ if (i !== 0) {
+ message += ", ";
+ }
+ message += glFuncArguments[i];
+ }
+ message += ");";
+ return message;
+}
+function throwOnError(gl, glFunc, glFuncArguments) {
+ const error = gl.getError();
+ if (error !== gl.NO_ERROR) {
+ throw new RuntimeError_default(
+ createErrorMessage(gl, glFunc, glFuncArguments, error)
+ );
+ }
+}
+function makeGetterSetter(gl, propertyName, logFunction) {
+ return {
+ get: function() {
+ const value = gl[propertyName];
+ logFunction(gl, `get: ${propertyName}`, value);
+ return gl[propertyName];
+ },
+ set: function(value) {
+ gl[propertyName] = value;
+ logFunction(gl, `set: ${propertyName}`, value);
+ }
+ };
+}
+function wrapGL(gl, logFunction) {
+ if (!defined_default(logFunction)) {
+ return gl;
+ }
+ function wrapFunction2(property) {
+ return function() {
+ const result = property.apply(gl, arguments);
+ logFunction(gl, property, arguments);
+ return result;
+ };
+ }
+ const glWrapper = {};
+ for (const propertyName in gl) {
+ const property = gl[propertyName];
+ if (property instanceof Function) {
+ glWrapper[propertyName] = wrapFunction2(property);
+ } else {
+ Object.defineProperty(
+ glWrapper,
+ propertyName,
+ makeGetterSetter(gl, propertyName, logFunction)
+ );
+ }
+ }
+ return glWrapper;
+}
+function getExtension(gl, names) {
+ const length3 = names.length;
+ for (let i = 0; i < length3; ++i) {
+ const extension = gl.getExtension(names[i]);
+ if (extension) {
+ return extension;
+ }
+ }
+ return void 0;
+}
+function Context(canvas, options) {
+ if (typeof WebGLRenderingContext === "undefined") {
+ throw new RuntimeError_default(
+ "The browser does not support WebGL. Visit http://get.webgl.org."
+ );
+ }
+ Check_default.defined("canvas", canvas);
+ this._canvas = canvas;
+ options = clone_default(options, true);
+ options = defaultValue_default(options, {});
+ options.allowTextureFilterAnisotropic = defaultValue_default(
+ options.allowTextureFilterAnisotropic,
+ true
+ );
+ const webglOptions = defaultValue_default(options.webgl, {});
+ webglOptions.alpha = defaultValue_default(webglOptions.alpha, false);
+ webglOptions.stencil = defaultValue_default(webglOptions.stencil, true);
+ const requestWebgl2 = defaultValue_default(options.requestWebgl2, false) && typeof WebGL2RenderingContext !== "undefined";
+ let webgl2 = false;
+ let glContext;
+ const getWebGLStub = options.getWebGLStub;
+ if (!defined_default(getWebGLStub)) {
+ if (requestWebgl2) {
+ glContext = canvas.getContext("webgl2", webglOptions) || canvas.getContext("experimental-webgl2", webglOptions) || void 0;
+ if (defined_default(glContext)) {
+ webgl2 = true;
+ }
+ }
+ if (!defined_default(glContext)) {
+ glContext = canvas.getContext("webgl", webglOptions) || canvas.getContext("experimental-webgl", webglOptions) || void 0;
+ }
+ if (!defined_default(glContext)) {
+ throw new RuntimeError_default(
+ "The browser supports WebGL, but initialization failed."
+ );
+ }
+ } else {
+ glContext = getWebGLStub(canvas, webglOptions);
+ }
+ this._originalGLContext = glContext;
+ this._gl = glContext;
+ this._webgl2 = webgl2;
+ this._id = createGuid_default();
+ this.validateFramebuffer = false;
+ this.validateShaderProgram = false;
+ this.logShaderCompilation = false;
+ this._throwOnWebGLError = false;
+ this._shaderCache = new ShaderCache_default(this);
+ this._textureCache = new TextureCache_default();
+ const gl = glContext;
+ this._stencilBits = gl.getParameter(gl.STENCIL_BITS);
+ ContextLimits_default._maximumCombinedTextureImageUnits = gl.getParameter(
+ gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS
+ );
+ ContextLimits_default._maximumCubeMapSize = gl.getParameter(
+ gl.MAX_CUBE_MAP_TEXTURE_SIZE
+ );
+ ContextLimits_default._maximumFragmentUniformVectors = gl.getParameter(
+ gl.MAX_FRAGMENT_UNIFORM_VECTORS
+ );
+ ContextLimits_default._maximumTextureImageUnits = gl.getParameter(
+ gl.MAX_TEXTURE_IMAGE_UNITS
+ );
+ ContextLimits_default._maximumRenderbufferSize = gl.getParameter(
+ gl.MAX_RENDERBUFFER_SIZE
+ );
+ ContextLimits_default._maximumTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);
+ ContextLimits_default._maximumVaryingVectors = gl.getParameter(
+ gl.MAX_VARYING_VECTORS
+ );
+ ContextLimits_default._maximumVertexAttributes = gl.getParameter(
+ gl.MAX_VERTEX_ATTRIBS
+ );
+ ContextLimits_default._maximumVertexTextureImageUnits = gl.getParameter(
+ gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS
+ );
+ ContextLimits_default._maximumVertexUniformVectors = gl.getParameter(
+ gl.MAX_VERTEX_UNIFORM_VECTORS
+ );
+ ContextLimits_default._maximumSamples = this._webgl2 ? gl.getParameter(gl.MAX_SAMPLES) : 0;
+ const aliasedLineWidthRange = gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE);
+ ContextLimits_default._minimumAliasedLineWidth = aliasedLineWidthRange[0];
+ ContextLimits_default._maximumAliasedLineWidth = aliasedLineWidthRange[1];
+ const aliasedPointSizeRange = gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE);
+ ContextLimits_default._minimumAliasedPointSize = aliasedPointSizeRange[0];
+ ContextLimits_default._maximumAliasedPointSize = aliasedPointSizeRange[1];
+ const maximumViewportDimensions = gl.getParameter(gl.MAX_VIEWPORT_DIMS);
+ ContextLimits_default._maximumViewportWidth = maximumViewportDimensions[0];
+ ContextLimits_default._maximumViewportHeight = maximumViewportDimensions[1];
+ const highpFloat = gl.getShaderPrecisionFormat(
+ gl.FRAGMENT_SHADER,
+ gl.HIGH_FLOAT
+ );
+ ContextLimits_default._highpFloatSupported = highpFloat.precision !== 0;
+ const highpInt = gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT);
+ ContextLimits_default._highpIntSupported = highpInt.rangeMax !== 0;
+ this._antialias = gl.getContextAttributes().antialias;
+ this._standardDerivatives = !!getExtension(gl, ["OES_standard_derivatives"]);
+ this._blendMinmax = !!getExtension(gl, ["EXT_blend_minmax"]);
+ this._elementIndexUint = !!getExtension(gl, ["OES_element_index_uint"]);
+ this._depthTexture = !!getExtension(gl, [
+ "WEBGL_depth_texture",
+ "WEBKIT_WEBGL_depth_texture"
+ ]);
+ this._fragDepth = !!getExtension(gl, ["EXT_frag_depth"]);
+ this._debugShaders = getExtension(gl, ["WEBGL_debug_shaders"]);
+ this._textureFloat = !!getExtension(gl, ["OES_texture_float"]);
+ this._textureHalfFloat = !!getExtension(gl, ["OES_texture_half_float"]);
+ this._textureFloatLinear = !!getExtension(gl, ["OES_texture_float_linear"]);
+ this._textureHalfFloatLinear = !!getExtension(gl, [
+ "OES_texture_half_float_linear"
+ ]);
+ this._colorBufferFloat = !!getExtension(gl, [
+ "EXT_color_buffer_float",
+ "WEBGL_color_buffer_float"
+ ]);
+ this._floatBlend = !!getExtension(gl, ["EXT_float_blend"]);
+ this._colorBufferHalfFloat = !!getExtension(gl, [
+ "EXT_color_buffer_half_float"
+ ]);
+ this._s3tc = !!getExtension(gl, [
+ "WEBGL_compressed_texture_s3tc",
+ "MOZ_WEBGL_compressed_texture_s3tc",
+ "WEBKIT_WEBGL_compressed_texture_s3tc"
+ ]);
+ this._pvrtc = !!getExtension(gl, [
+ "WEBGL_compressed_texture_pvrtc",
+ "WEBKIT_WEBGL_compressed_texture_pvrtc"
+ ]);
+ this._astc = !!getExtension(gl, ["WEBGL_compressed_texture_astc"]);
+ this._etc = !!getExtension(gl, ["WEBG_compressed_texture_etc"]);
+ this._etc1 = !!getExtension(gl, ["WEBGL_compressed_texture_etc1"]);
+ this._bc7 = !!getExtension(gl, ["EXT_texture_compression_bptc"]);
+ loadKTX2_default.setKTX2SupportedFormats(
+ this._s3tc,
+ this._pvrtc,
+ this._astc,
+ this._etc,
+ this._etc1,
+ this._bc7
+ );
+ const textureFilterAnisotropic = options.allowTextureFilterAnisotropic ? getExtension(gl, [
+ "EXT_texture_filter_anisotropic",
+ "WEBKIT_EXT_texture_filter_anisotropic"
+ ]) : void 0;
+ this._textureFilterAnisotropic = textureFilterAnisotropic;
+ ContextLimits_default._maximumTextureFilterAnisotropy = defined_default(
+ textureFilterAnisotropic
+ ) ? gl.getParameter(textureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 1;
+ let glCreateVertexArray;
+ let glBindVertexArray;
+ let glDeleteVertexArray;
+ let glDrawElementsInstanced;
+ let glDrawArraysInstanced;
+ let glVertexAttribDivisor;
+ let glDrawBuffers;
+ let vertexArrayObject;
+ let instancedArrays;
+ let drawBuffers;
+ if (webgl2) {
+ const that = this;
+ glCreateVertexArray = function() {
+ return that._gl.createVertexArray();
+ };
+ glBindVertexArray = function(vao) {
+ that._gl.bindVertexArray(vao);
+ };
+ glDeleteVertexArray = function(vao) {
+ that._gl.deleteVertexArray(vao);
+ };
+ glDrawElementsInstanced = function(mode2, count, type, offset2, instanceCount) {
+ gl.drawElementsInstanced(mode2, count, type, offset2, instanceCount);
+ };
+ glDrawArraysInstanced = function(mode2, first, count, instanceCount) {
+ gl.drawArraysInstanced(mode2, first, count, instanceCount);
+ };
+ glVertexAttribDivisor = function(index, divisor) {
+ gl.vertexAttribDivisor(index, divisor);
+ };
+ glDrawBuffers = function(buffers) {
+ gl.drawBuffers(buffers);
+ };
+ } else {
+ vertexArrayObject = getExtension(gl, ["OES_vertex_array_object"]);
+ if (defined_default(vertexArrayObject)) {
+ glCreateVertexArray = function() {
+ return vertexArrayObject.createVertexArrayOES();
+ };
+ glBindVertexArray = function(vertexArray) {
+ vertexArrayObject.bindVertexArrayOES(vertexArray);
+ };
+ glDeleteVertexArray = function(vertexArray) {
+ vertexArrayObject.deleteVertexArrayOES(vertexArray);
+ };
+ }
+ instancedArrays = getExtension(gl, ["ANGLE_instanced_arrays"]);
+ if (defined_default(instancedArrays)) {
+ glDrawElementsInstanced = function(mode2, count, type, offset2, instanceCount) {
+ instancedArrays.drawElementsInstancedANGLE(
+ mode2,
+ count,
+ type,
+ offset2,
+ instanceCount
+ );
+ };
+ glDrawArraysInstanced = function(mode2, first, count, instanceCount) {
+ instancedArrays.drawArraysInstancedANGLE(
+ mode2,
+ first,
+ count,
+ instanceCount
+ );
+ };
+ glVertexAttribDivisor = function(index, divisor) {
+ instancedArrays.vertexAttribDivisorANGLE(index, divisor);
+ };
+ }
+ drawBuffers = getExtension(gl, ["WEBGL_draw_buffers"]);
+ if (defined_default(drawBuffers)) {
+ glDrawBuffers = function(buffers) {
+ drawBuffers.drawBuffersWEBGL(buffers);
+ };
+ }
+ }
+ this.glCreateVertexArray = glCreateVertexArray;
+ this.glBindVertexArray = glBindVertexArray;
+ this.glDeleteVertexArray = glDeleteVertexArray;
+ this.glDrawElementsInstanced = glDrawElementsInstanced;
+ this.glDrawArraysInstanced = glDrawArraysInstanced;
+ this.glVertexAttribDivisor = glVertexAttribDivisor;
+ this.glDrawBuffers = glDrawBuffers;
+ this._vertexArrayObject = !!vertexArrayObject;
+ this._instancedArrays = !!instancedArrays;
+ this._drawBuffers = !!drawBuffers;
+ ContextLimits_default._maximumDrawBuffers = this.drawBuffers ? gl.getParameter(WebGLConstants_default.MAX_DRAW_BUFFERS) : 1;
+ ContextLimits_default._maximumColorAttachments = this.drawBuffers ? gl.getParameter(WebGLConstants_default.MAX_COLOR_ATTACHMENTS) : 1;
+ this._clearColor = new Color_default(0, 0, 0, 0);
+ this._clearDepth = 1;
+ this._clearStencil = 0;
+ const us = new UniformState_default();
+ const ps = new PassState_default(this);
+ const rs = RenderState_default.fromCache();
+ this._defaultPassState = ps;
+ this._defaultRenderState = rs;
+ this._defaultTexture = void 0;
+ this._defaultEmissiveTexture = void 0;
+ this._defaultNormalTexture = void 0;
+ this._defaultCubeMap = void 0;
+ this._us = us;
+ this._currentRenderState = rs;
+ this._currentPassState = ps;
+ this._currentFramebuffer = void 0;
+ this._maxFrameTextureUnitIndex = 0;
+ this._vertexAttribDivisors = [];
+ this._previousDrawInstanced = false;
+ for (let i = 0; i < ContextLimits_default._maximumVertexAttributes; i++) {
+ this._vertexAttribDivisors.push(0);
+ }
+ this._pickObjects = {};
+ this._nextPickColor = new Uint32Array(1);
+ this.options = options;
+ this.cache = {};
+ RenderState_default.apply(gl, rs, ps);
+}
+var defaultFramebufferMarker = {};
+Object.defineProperties(Context.prototype, {
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ webgl2: {
+ get: function() {
+ return this._webgl2;
+ }
+ },
+ canvas: {
+ get: function() {
+ return this._canvas;
+ }
+ },
+ shaderCache: {
+ get: function() {
+ return this._shaderCache;
+ }
+ },
+ textureCache: {
+ get: function() {
+ return this._textureCache;
+ }
+ },
+ uniformState: {
+ get: function() {
+ return this._us;
+ }
+ },
+ stencilBits: {
+ get: function() {
+ return this._stencilBits;
+ }
+ },
+ stencilBuffer: {
+ get: function() {
+ return this._stencilBits >= 8;
+ }
+ },
+ antialias: {
+ get: function() {
+ return this._antialias;
+ }
+ },
+ msaa: {
+ get: function() {
+ return this._webgl2;
+ }
+ },
+ standardDerivatives: {
+ get: function() {
+ return this._standardDerivatives || this._webgl2;
+ }
+ },
+ floatBlend: {
+ get: function() {
+ return this._floatBlend;
+ }
+ },
+ blendMinmax: {
+ get: function() {
+ return this._blendMinmax || this._webgl2;
+ }
+ },
+ elementIndexUint: {
+ get: function() {
+ return this._elementIndexUint || this._webgl2;
+ }
+ },
+ depthTexture: {
+ get: function() {
+ return this._depthTexture || this._webgl2;
+ }
+ },
+ floatingPointTexture: {
+ get: function() {
+ return this._webgl2 || this._textureFloat;
+ }
+ },
+ halfFloatingPointTexture: {
+ get: function() {
+ return this._webgl2 || this._textureHalfFloat;
+ }
+ },
+ textureFloatLinear: {
+ get: function() {
+ return this._textureFloatLinear;
+ }
+ },
+ textureHalfFloatLinear: {
+ get: function() {
+ return this._webgl2 && this._textureFloatLinear || !this._webgl2 && this._textureHalfFloatLinear;
+ }
+ },
+ textureFilterAnisotropic: {
+ get: function() {
+ return !!this._textureFilterAnisotropic;
+ }
+ },
+ s3tc: {
+ get: function() {
+ return this._s3tc;
+ }
+ },
+ pvrtc: {
+ get: function() {
+ return this._pvrtc;
+ }
+ },
+ astc: {
+ get: function() {
+ return this._astc;
+ }
+ },
+ etc: {
+ get: function() {
+ return this._etc;
+ }
+ },
+ etc1: {
+ get: function() {
+ return this._etc1;
+ }
+ },
+ bc7: {
+ get: function() {
+ return this._bc7;
+ }
+ },
+ supportsBasis: {
+ get: function() {
+ return this._s3tc || this._pvrtc || this._astc || this._etc || this._etc1 || this._bc7;
+ }
+ },
+ vertexArrayObject: {
+ get: function() {
+ return this._vertexArrayObject || this._webgl2;
+ }
+ },
+ fragmentDepth: {
+ get: function() {
+ return this._fragDepth || this._webgl2;
+ }
+ },
+ instancedArrays: {
+ get: function() {
+ return this._instancedArrays || this._webgl2;
+ }
+ },
+ colorBufferFloat: {
+ get: function() {
+ return this._colorBufferFloat;
+ }
+ },
+ colorBufferHalfFloat: {
+ get: function() {
+ return this._webgl2 && this._colorBufferFloat || !this._webgl2 && this._colorBufferHalfFloat;
+ }
+ },
+ drawBuffers: {
+ get: function() {
+ return this._drawBuffers || this._webgl2;
+ }
+ },
+ debugShaders: {
+ get: function() {
+ return this._debugShaders;
+ }
+ },
+ throwOnWebGLError: {
+ get: function() {
+ return this._throwOnWebGLError;
+ },
+ set: function(value) {
+ this._throwOnWebGLError = value;
+ this._gl = wrapGL(
+ this._originalGLContext,
+ value ? throwOnError : void 0
+ );
+ }
+ },
+ defaultTexture: {
+ get: function() {
+ if (this._defaultTexture === void 0) {
+ this._defaultTexture = new Texture_default({
+ context: this,
+ source: {
+ width: 1,
+ height: 1,
+ arrayBufferView: new Uint8Array([255, 255, 255, 255])
+ },
+ flipY: false
+ });
+ }
+ return this._defaultTexture;
+ }
+ },
+ defaultEmissiveTexture: {
+ get: function() {
+ if (this._defaultEmissiveTexture === void 0) {
+ this._defaultEmissiveTexture = new Texture_default({
+ context: this,
+ pixelFormat: PixelFormat_default.RGB,
+ source: {
+ width: 1,
+ height: 1,
+ arrayBufferView: new Uint8Array([0, 0, 0])
+ },
+ flipY: false
+ });
+ }
+ return this._defaultEmissiveTexture;
+ }
+ },
+ defaultNormalTexture: {
+ get: function() {
+ if (this._defaultNormalTexture === void 0) {
+ this._defaultNormalTexture = new Texture_default({
+ context: this,
+ pixelFormat: PixelFormat_default.RGB,
+ source: {
+ width: 1,
+ height: 1,
+ arrayBufferView: new Uint8Array([128, 128, 255])
+ },
+ flipY: false
+ });
+ }
+ return this._defaultNormalTexture;
+ }
+ },
+ defaultCubeMap: {
+ get: function() {
+ if (this._defaultCubeMap === void 0) {
+ const face = {
+ width: 1,
+ height: 1,
+ arrayBufferView: new Uint8Array([255, 255, 255, 255])
+ };
+ this._defaultCubeMap = new CubeMap_default({
+ context: this,
+ source: {
+ positiveX: face,
+ negativeX: face,
+ positiveY: face,
+ negativeY: face,
+ positiveZ: face,
+ negativeZ: face
+ },
+ flipY: false
+ });
+ }
+ return this._defaultCubeMap;
+ }
+ },
+ drawingBufferHeight: {
+ get: function() {
+ return this._gl.drawingBufferHeight;
+ }
+ },
+ drawingBufferWidth: {
+ get: function() {
+ return this._gl.drawingBufferWidth;
+ }
+ },
+ defaultFramebuffer: {
+ get: function() {
+ return defaultFramebufferMarker;
+ }
+ }
+});
+function validateFramebuffer(context) {
+ if (context.validateFramebuffer) {
+ const gl = context._gl;
+ const status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ if (status !== gl.FRAMEBUFFER_COMPLETE) {
+ let message;
+ switch (status) {
+ case gl.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
+ message = "Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";
+ break;
+ case gl.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
+ message = "Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";
+ break;
+ case gl.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
+ message = "Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";
+ break;
+ case gl.FRAMEBUFFER_UNSUPPORTED:
+ message = "Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.";
+ break;
+ }
+ throw new DeveloperError_default(message);
+ }
+ }
+}
+function applyRenderState(context, renderState, passState, clear2) {
+ const previousRenderState = context._currentRenderState;
+ const previousPassState = context._currentPassState;
+ context._currentRenderState = renderState;
+ context._currentPassState = passState;
+ RenderState_default.partialApply(
+ context._gl,
+ previousRenderState,
+ renderState,
+ previousPassState,
+ passState,
+ clear2
+ );
+}
+var scratchBackBufferArray;
+if (typeof WebGLRenderingContext !== "undefined") {
+ scratchBackBufferArray = [WebGLConstants_default.BACK];
+}
+function bindFramebuffer(context, framebuffer) {
+ if (framebuffer !== context._currentFramebuffer) {
+ context._currentFramebuffer = framebuffer;
+ let buffers = scratchBackBufferArray;
+ if (defined_default(framebuffer)) {
+ framebuffer._bind();
+ validateFramebuffer(context);
+ buffers = framebuffer._getActiveColorAttachments();
+ } else {
+ const gl = context._gl;
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ }
+ if (context.drawBuffers) {
+ context.glDrawBuffers(buffers);
+ }
+ }
+}
+var defaultClearCommand = new ClearCommand_default();
+Context.prototype.clear = function(clearCommand, passState) {
+ clearCommand = defaultValue_default(clearCommand, defaultClearCommand);
+ passState = defaultValue_default(passState, this._defaultPassState);
+ const gl = this._gl;
+ let bitmask = 0;
+ const c = clearCommand.color;
+ const d = clearCommand.depth;
+ const s = clearCommand.stencil;
+ if (defined_default(c)) {
+ if (!Color_default.equals(this._clearColor, c)) {
+ Color_default.clone(c, this._clearColor);
+ gl.clearColor(c.red, c.green, c.blue, c.alpha);
+ }
+ bitmask |= gl.COLOR_BUFFER_BIT;
+ }
+ if (defined_default(d)) {
+ if (d !== this._clearDepth) {
+ this._clearDepth = d;
+ gl.clearDepth(d);
+ }
+ bitmask |= gl.DEPTH_BUFFER_BIT;
+ }
+ if (defined_default(s)) {
+ if (s !== this._clearStencil) {
+ this._clearStencil = s;
+ gl.clearStencil(s);
+ }
+ bitmask |= gl.STENCIL_BUFFER_BIT;
+ }
+ const rs = defaultValue_default(clearCommand.renderState, this._defaultRenderState);
+ applyRenderState(this, rs, passState, true);
+ const framebuffer = defaultValue_default(
+ clearCommand.framebuffer,
+ passState.framebuffer
+ );
+ bindFramebuffer(this, framebuffer);
+ gl.clear(bitmask);
+};
+function beginDraw(context, framebuffer, passState, shaderProgram, renderState) {
+ if (defined_default(framebuffer) && renderState.depthTest) {
+ if (renderState.depthTest.enabled && !framebuffer.hasDepthAttachment) {
+ throw new DeveloperError_default(
+ "The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer."
+ );
+ }
+ }
+ bindFramebuffer(context, framebuffer);
+ applyRenderState(context, renderState, passState, false);
+ shaderProgram._bind();
+ context._maxFrameTextureUnitIndex = Math.max(
+ context._maxFrameTextureUnitIndex,
+ shaderProgram.maximumTextureUnitIndex
+ );
+}
+function continueDraw(context, drawCommand, shaderProgram, uniformMap2) {
+ const primitiveType = drawCommand._primitiveType;
+ const va = drawCommand._vertexArray;
+ let offset2 = drawCommand._offset;
+ let count = drawCommand._count;
+ const instanceCount = drawCommand.instanceCount;
+ if (!PrimitiveType_default.validate(primitiveType)) {
+ throw new DeveloperError_default(
+ "drawCommand.primitiveType is required and must be valid."
+ );
+ }
+ Check_default.defined("drawCommand.vertexArray", va);
+ Check_default.typeOf.number.greaterThanOrEquals("drawCommand.offset", offset2, 0);
+ if (defined_default(count)) {
+ Check_default.typeOf.number.greaterThanOrEquals("drawCommand.count", count, 0);
+ }
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "drawCommand.instanceCount",
+ instanceCount,
+ 0
+ );
+ if (instanceCount > 0 && !context.instancedArrays) {
+ throw new DeveloperError_default("Instanced arrays extension is not supported");
+ }
+ context._us.model = defaultValue_default(drawCommand._modelMatrix, Matrix4_default.IDENTITY);
+ shaderProgram._setUniforms(
+ uniformMap2,
+ context._us,
+ context.validateShaderProgram
+ );
+ va._bind();
+ const indexBuffer = va.indexBuffer;
+ if (defined_default(indexBuffer)) {
+ offset2 = offset2 * indexBuffer.bytesPerIndex;
+ count = defaultValue_default(count, indexBuffer.numberOfIndices);
+ if (instanceCount === 0) {
+ context._gl.drawElements(
+ primitiveType,
+ count,
+ indexBuffer.indexDatatype,
+ offset2
+ );
+ } else {
+ context.glDrawElementsInstanced(
+ primitiveType,
+ count,
+ indexBuffer.indexDatatype,
+ offset2,
+ instanceCount
+ );
+ }
+ } else {
+ count = defaultValue_default(count, va.numberOfVertices);
+ if (instanceCount === 0) {
+ context._gl.drawArrays(primitiveType, offset2, count);
+ } else {
+ context.glDrawArraysInstanced(
+ primitiveType,
+ offset2,
+ count,
+ instanceCount
+ );
+ }
+ }
+ va._unBind();
+}
+Context.prototype.draw = function(drawCommand, passState, shaderProgram, uniformMap2) {
+ Check_default.defined("drawCommand", drawCommand);
+ Check_default.defined("drawCommand.shaderProgram", drawCommand._shaderProgram);
+ passState = defaultValue_default(passState, this._defaultPassState);
+ const framebuffer = defaultValue_default(
+ drawCommand._framebuffer,
+ passState.framebuffer
+ );
+ const renderState = defaultValue_default(
+ drawCommand._renderState,
+ this._defaultRenderState
+ );
+ shaderProgram = defaultValue_default(shaderProgram, drawCommand._shaderProgram);
+ uniformMap2 = defaultValue_default(uniformMap2, drawCommand._uniformMap);
+ beginDraw(this, framebuffer, passState, shaderProgram, renderState);
+ continueDraw(this, drawCommand, shaderProgram, uniformMap2);
+};
+Context.prototype.endFrame = function() {
+ const gl = this._gl;
+ gl.useProgram(null);
+ this._currentFramebuffer = void 0;
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ const buffers = scratchBackBufferArray;
+ if (this.drawBuffers) {
+ this.glDrawBuffers(buffers);
+ }
+ const length3 = this._maxFrameTextureUnitIndex;
+ this._maxFrameTextureUnitIndex = 0;
+ for (let i = 0; i < length3; ++i) {
+ gl.activeTexture(gl.TEXTURE0 + i);
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);
+ }
+};
+Context.prototype.readPixels = function(readState) {
+ const gl = this._gl;
+ readState = defaultValue_default(readState, defaultValue_default.EMPTY_OBJECT);
+ const x = Math.max(defaultValue_default(readState.x, 0), 0);
+ const y = Math.max(defaultValue_default(readState.y, 0), 0);
+ const width = defaultValue_default(readState.width, gl.drawingBufferWidth);
+ const height = defaultValue_default(readState.height, gl.drawingBufferHeight);
+ const framebuffer = readState.framebuffer;
+ Check_default.typeOf.number.greaterThan("readState.width", width, 0);
+ Check_default.typeOf.number.greaterThan("readState.height", height, 0);
+ let pixelDatatype = PixelDatatype_default.UNSIGNED_BYTE;
+ if (defined_default(framebuffer) && framebuffer.numberOfColorAttachments > 0) {
+ pixelDatatype = framebuffer.getColorTexture(0).pixelDatatype;
+ }
+ const pixels = PixelFormat_default.createTypedArray(
+ PixelFormat_default.RGBA,
+ pixelDatatype,
+ width,
+ height
+ );
+ bindFramebuffer(this, framebuffer);
+ gl.readPixels(
+ x,
+ y,
+ width,
+ height,
+ PixelFormat_default.RGBA,
+ PixelDatatype_default.toWebGLConstant(pixelDatatype, this),
+ pixels
+ );
+ return pixels;
+};
+var viewportQuadAttributeLocations = {
+ position: 0,
+ textureCoordinates: 1
+};
+Context.prototype.getViewportQuadVertexArray = function() {
+ let vertexArray = this.cache.viewportQuad_vertexArray;
+ if (!defined_default(vertexArray)) {
+ const geometry = new Geometry_default({
+ attributes: {
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: [-1, -1, 1, -1, 1, 1, -1, 1]
+ }),
+ textureCoordinates: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: [0, 0, 1, 0, 1, 1, 0, 1]
+ })
+ },
+ indices: new Uint16Array([0, 1, 2, 0, 2, 3]),
+ primitiveType: PrimitiveType_default.TRIANGLES
+ });
+ vertexArray = VertexArray_default.fromGeometry({
+ context: this,
+ geometry,
+ attributeLocations: viewportQuadAttributeLocations,
+ bufferUsage: BufferUsage_default.STATIC_DRAW,
+ interleave: true
+ });
+ this.cache.viewportQuad_vertexArray = vertexArray;
+ }
+ return vertexArray;
+};
+Context.prototype.createViewportQuadCommand = function(fragmentShaderSource, overrides) {
+ overrides = defaultValue_default(overrides, defaultValue_default.EMPTY_OBJECT);
+ return new DrawCommand_default({
+ vertexArray: this.getViewportQuadVertexArray(),
+ primitiveType: PrimitiveType_default.TRIANGLES,
+ renderState: overrides.renderState,
+ shaderProgram: ShaderProgram_default.fromCache({
+ context: this,
+ vertexShaderSource: ViewportQuadVS_default,
+ fragmentShaderSource,
+ attributeLocations: viewportQuadAttributeLocations
+ }),
+ uniformMap: overrides.uniformMap,
+ owner: overrides.owner,
+ framebuffer: overrides.framebuffer,
+ pass: overrides.pass
+ });
+};
+Context.prototype.getObjectByPickColor = function(pickColor) {
+ Check_default.defined("pickColor", pickColor);
+ return this._pickObjects[pickColor.toRgba()];
+};
+function PickId(pickObjects, key, color) {
+ this._pickObjects = pickObjects;
+ this.key = key;
+ this.color = color;
+}
+Object.defineProperties(PickId.prototype, {
+ object: {
+ get: function() {
+ return this._pickObjects[this.key];
+ },
+ set: function(value) {
+ this._pickObjects[this.key] = value;
+ }
+ }
+});
+PickId.prototype.destroy = function() {
+ delete this._pickObjects[this.key];
+ return void 0;
+};
+Context.prototype.createPickId = function(object2) {
+ Check_default.defined("object", object2);
+ ++this._nextPickColor[0];
+ const key = this._nextPickColor[0];
+ if (key === 0) {
+ throw new RuntimeError_default("Out of unique Pick IDs.");
+ }
+ this._pickObjects[key] = object2;
+ return new PickId(this._pickObjects, key, Color_default.fromRgba(key));
+};
+Context.prototype.isDestroyed = function() {
+ return false;
+};
+Context.prototype.destroy = function() {
+ const cache = this.cache;
+ for (const property in cache) {
+ if (cache.hasOwnProperty(property)) {
+ const propertyValue = cache[property];
+ if (defined_default(propertyValue.destroy)) {
+ propertyValue.destroy();
+ }
+ }
+ }
+ this._shaderCache = this._shaderCache.destroy();
+ this._textureCache = this._textureCache.destroy();
+ this._defaultTexture = this._defaultTexture && this._defaultTexture.destroy();
+ this._defaultEmissiveTexture = this._defaultEmissiveTexture && this._defaultEmissiveTexture.destroy();
+ this._defaultNormalTexture = this._defaultNormalTexture && this._defaultNormalTexture.destroy();
+ this._defaultCubeMap = this._defaultCubeMap && this._defaultCubeMap.destroy();
+ return destroyObject_default(this);
+};
+var Context_default = Context;
+
+// Source/Renderer/MultisampleFramebuffer.js
+function MultisampleFramebuffer(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const context = options.context;
+ const width = options.width;
+ const height = options.height;
+ Check_default.defined("options.context", context);
+ Check_default.defined("options.width", width);
+ Check_default.defined("options.height", height);
+ this._width = width;
+ this._height = height;
+ const colorRenderbuffers = options.colorRenderbuffers;
+ const colorTextures = options.colorTextures;
+ if (defined_default(colorRenderbuffers) !== defined_default(colorTextures)) {
+ throw new DeveloperError_default(
+ "Both color renderbuffer and texture attachments must be provided."
+ );
+ }
+ const depthStencilRenderbuffer = options.depthStencilRenderbuffer;
+ const depthStencilTexture = options.depthStencilTexture;
+ if (defined_default(depthStencilRenderbuffer) !== defined_default(depthStencilTexture)) {
+ throw new DeveloperError_default(
+ "Both depth-stencil renderbuffer and texture attachments must be provided."
+ );
+ }
+ this._renderFramebuffer = new Framebuffer_default({
+ context,
+ colorRenderbuffers,
+ depthStencilRenderbuffer,
+ destroyAttachments: options.destroyAttachments
+ });
+ this._colorFramebuffer = new Framebuffer_default({
+ context,
+ colorTextures,
+ depthStencilTexture,
+ destroyAttachments: options.destroyAttachments
+ });
+}
+MultisampleFramebuffer.prototype.getRenderFramebuffer = function() {
+ return this._renderFramebuffer;
+};
+MultisampleFramebuffer.prototype.getColorFramebuffer = function() {
+ return this._colorFramebuffer;
+};
+MultisampleFramebuffer.prototype.blitFramebuffers = function(context, blitStencil) {
+ this._renderFramebuffer.bindRead();
+ this._colorFramebuffer.bindDraw();
+ const gl = context._gl;
+ let mask = 0;
+ if (this._colorFramebuffer._colorTextures.length > 0) {
+ mask |= gl.COLOR_BUFFER_BIT;
+ }
+ if (defined_default(this._colorFramebuffer.depthStencilTexture)) {
+ mask |= gl.DEPTH_BUFFER_BIT | (blitStencil ? gl.STENCIL_BUFFER_BIT : 0);
+ }
+ gl.blitFramebuffer(
+ 0,
+ 0,
+ this._width,
+ this._height,
+ 0,
+ 0,
+ this._width,
+ this._height,
+ mask,
+ gl.NEAREST
+ );
+ gl.bindFramebuffer(gl.READ_FRAMEBUFFER, null);
+ gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);
+};
+MultisampleFramebuffer.prototype.isDestroyed = function() {
+ return false;
+};
+MultisampleFramebuffer.prototype.destroy = function() {
+ this._renderFramebuffer.destroy();
+ this._colorFramebuffer.destroy();
+ return destroyObject_default(this);
+};
+var MultisampleFramebuffer_default = MultisampleFramebuffer;
+
+// Source/Renderer/RenderbufferFormat.js
+var RenderbufferFormat = {
+ RGBA4: WebGLConstants_default.RGBA4,
+ RGBA8: WebGLConstants_default.RGBA8,
+ RGBA16F: WebGLConstants_default.RGBA16F,
+ RGBA32F: WebGLConstants_default.RGBA32F,
+ RGB5_A1: WebGLConstants_default.RGB5_A1,
+ RGB565: WebGLConstants_default.RGB565,
+ DEPTH_COMPONENT16: WebGLConstants_default.DEPTH_COMPONENT16,
+ STENCIL_INDEX8: WebGLConstants_default.STENCIL_INDEX8,
+ DEPTH_STENCIL: WebGLConstants_default.DEPTH_STENCIL,
+ DEPTH24_STENCIL8: WebGLConstants_default.DEPTH24_STENCIL8,
+ validate: function(renderbufferFormat) {
+ return renderbufferFormat === RenderbufferFormat.RGBA4 || renderbufferFormat === RenderbufferFormat.RGBA8 || renderbufferFormat === RenderbufferFormat.RGBA16F || renderbufferFormat === RenderbufferFormat.RGBA32F || renderbufferFormat === RenderbufferFormat.RGB5_A1 || renderbufferFormat === RenderbufferFormat.RGB565 || renderbufferFormat === RenderbufferFormat.DEPTH_COMPONENT16 || renderbufferFormat === RenderbufferFormat.STENCIL_INDEX8 || renderbufferFormat === RenderbufferFormat.DEPTH_STENCIL || renderbufferFormat === RenderbufferFormat.DEPTH24_STENCIL8;
+ },
+ getColorFormat: function(datatype) {
+ if (datatype === WebGLConstants_default.FLOAT) {
+ return RenderbufferFormat.RGBA32F;
+ } else if (datatype === WebGLConstants_default.HALF_FLOAT_OES) {
+ return RenderbufferFormat.RGBA16F;
+ }
+ return RenderbufferFormat.RGBA8;
+ }
+};
+var RenderbufferFormat_default = Object.freeze(RenderbufferFormat);
+
+// Source/Renderer/Renderbuffer.js
+function Renderbuffer(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.context", options.context);
+ const context = options.context;
+ const gl = context._gl;
+ const maximumRenderbufferSize = ContextLimits_default.maximumRenderbufferSize;
+ const format = defaultValue_default(options.format, RenderbufferFormat_default.RGBA4);
+ const width = defined_default(options.width) ? options.width : gl.drawingBufferWidth;
+ const height = defined_default(options.height) ? options.height : gl.drawingBufferHeight;
+ const numSamples = defaultValue_default(options.numSamples, 1);
+ if (!RenderbufferFormat_default.validate(format)) {
+ throw new DeveloperError_default("Invalid format.");
+ }
+ Check_default.typeOf.number.greaterThan("width", width, 0);
+ if (width > maximumRenderbufferSize) {
+ throw new DeveloperError_default(
+ `Width must be less than or equal to the maximum renderbuffer size (${maximumRenderbufferSize}). Check maximumRenderbufferSize.`
+ );
+ }
+ Check_default.typeOf.number.greaterThan("height", height, 0);
+ if (height > maximumRenderbufferSize) {
+ throw new DeveloperError_default(
+ `Height must be less than or equal to the maximum renderbuffer size (${maximumRenderbufferSize}). Check maximumRenderbufferSize.`
+ );
+ }
+ this._gl = gl;
+ this._format = format;
+ this._width = width;
+ this._height = height;
+ this._renderbuffer = this._gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, this._renderbuffer);
+ if (numSamples > 1) {
+ gl.renderbufferStorageMultisample(
+ gl.RENDERBUFFER,
+ numSamples,
+ format,
+ width,
+ height
+ );
+ } else {
+ gl.renderbufferStorage(gl.RENDERBUFFER, format, width, height);
+ }
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+}
+Object.defineProperties(Renderbuffer.prototype, {
+ format: {
+ get: function() {
+ return this._format;
+ }
+ },
+ width: {
+ get: function() {
+ return this._width;
+ }
+ },
+ height: {
+ get: function() {
+ return this._height;
+ }
+ }
+});
+Renderbuffer.prototype._getRenderbuffer = function() {
+ return this._renderbuffer;
+};
+Renderbuffer.prototype.isDestroyed = function() {
+ return false;
+};
+Renderbuffer.prototype.destroy = function() {
+ this._gl.deleteRenderbuffer(this._renderbuffer);
+ return destroyObject_default(this);
+};
+var Renderbuffer_default = Renderbuffer;
+
+// Source/Renderer/FramebufferManager.js
+function FramebufferManager(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._numSamples = defaultValue_default(options.numSamples, 1);
+ this._colorAttachmentsLength = defaultValue_default(
+ options.colorAttachmentsLength,
+ 1
+ );
+ this._color = defaultValue_default(options.color, true);
+ this._depth = defaultValue_default(options.depth, false);
+ this._depthStencil = defaultValue_default(options.depthStencil, false);
+ this._supportsDepthTexture = defaultValue_default(
+ options.supportsDepthTexture,
+ false
+ );
+ if (!this._color && !this._depth && !this._depthStencil) {
+ throw new DeveloperError_default(
+ "Must enable at least one type of framebuffer attachment."
+ );
+ }
+ if (this._depth && this._depthStencil) {
+ throw new DeveloperError_default(
+ "Cannot have both a depth and depth-stencil attachment."
+ );
+ }
+ this._createColorAttachments = defaultValue_default(
+ options.createColorAttachments,
+ true
+ );
+ this._createDepthAttachments = defaultValue_default(
+ options.createDepthAttachments,
+ true
+ );
+ this._pixelDatatype = options.pixelDatatype;
+ this._pixelFormat = options.pixelFormat;
+ this._width = void 0;
+ this._height = void 0;
+ this._framebuffer = void 0;
+ this._multisampleFramebuffer = void 0;
+ this._colorTextures = void 0;
+ if (this._color) {
+ this._colorTextures = new Array(this._colorAttachmentsLength);
+ this._colorRenderbuffers = new Array(this._colorAttachmentsLength);
+ }
+ this._colorRenderbuffer = void 0;
+ this._depthStencilRenderbuffer = void 0;
+ this._depthStencilTexture = void 0;
+ this._depthRenderbuffer = void 0;
+ this._depthTexture = void 0;
+ this._attachmentsDirty = false;
+}
+Object.defineProperties(FramebufferManager.prototype, {
+ framebuffer: {
+ get: function() {
+ if (this._numSamples > 1) {
+ return this._multisampleFramebuffer.getRenderFramebuffer();
+ }
+ return this._framebuffer;
+ }
+ },
+ numSamples: {
+ get: function() {
+ return this._numSamples;
+ }
+ },
+ status: {
+ get: function() {
+ return this.framebuffer.status;
+ }
+ }
+});
+FramebufferManager.prototype.isDirty = function(width, height, numSamples, pixelDatatype, pixelFormat) {
+ numSamples = defaultValue_default(numSamples, 1);
+ const dimensionChanged = this._width !== width || this._height !== height;
+ const samplesChanged = this._numSamples !== numSamples;
+ const pixelChanged = defined_default(pixelDatatype) && this._pixelDatatype !== pixelDatatype || defined_default(pixelFormat) && this._pixelFormat !== pixelFormat;
+ const framebufferDefined = numSamples === 1 ? defined_default(this._framebuffer) : defined_default(this._multisampleFramebuffer);
+ return this._attachmentsDirty || dimensionChanged || samplesChanged || pixelChanged || !framebufferDefined || this._color && !defined_default(this._colorTextures[0]);
+};
+FramebufferManager.prototype.update = function(context, width, height, numSamples, pixelDatatype, pixelFormat) {
+ if (!defined_default(width) || !defined_default(height)) {
+ throw new DeveloperError_default("width and height must be defined.");
+ }
+ numSamples = context.msaa ? defaultValue_default(numSamples, 1) : 1;
+ pixelDatatype = defaultValue_default(
+ pixelDatatype,
+ this._color ? defaultValue_default(this._pixelDatatype, PixelDatatype_default.UNSIGNED_BYTE) : void 0
+ );
+ pixelFormat = defaultValue_default(
+ pixelFormat,
+ this._color ? defaultValue_default(this._pixelFormat, PixelFormat_default.RGBA) : void 0
+ );
+ if (this.isDirty(width, height, numSamples, pixelDatatype, pixelFormat)) {
+ this.destroy();
+ this._width = width;
+ this._height = height;
+ this._numSamples = numSamples;
+ this._pixelDatatype = pixelDatatype;
+ this._pixelFormat = pixelFormat;
+ this._attachmentsDirty = false;
+ if (this._color && this._createColorAttachments) {
+ for (let i = 0; i < this._colorAttachmentsLength; ++i) {
+ this._colorTextures[i] = new Texture_default({
+ context,
+ width,
+ height,
+ pixelFormat,
+ pixelDatatype,
+ sampler: Sampler_default.NEAREST
+ });
+ if (this._numSamples > 1) {
+ const format = RenderbufferFormat_default.getColorFormat(pixelDatatype);
+ this._colorRenderbuffers[i] = new Renderbuffer_default({
+ context,
+ width,
+ height,
+ format,
+ numSamples: this._numSamples
+ });
+ }
+ }
+ }
+ if (this._depthStencil && this._createDepthAttachments) {
+ if (this._supportsDepthTexture && context.depthTexture) {
+ this._depthStencilTexture = new Texture_default({
+ context,
+ width,
+ height,
+ pixelFormat: PixelFormat_default.DEPTH_STENCIL,
+ pixelDatatype: PixelDatatype_default.UNSIGNED_INT_24_8,
+ sampler: Sampler_default.NEAREST
+ });
+ if (this._numSamples > 1) {
+ this._depthStencilRenderbuffer = new Renderbuffer_default({
+ context,
+ width,
+ height,
+ format: RenderbufferFormat_default.DEPTH24_STENCIL8,
+ numSamples: this._numSamples
+ });
+ }
+ } else {
+ this._depthStencilRenderbuffer = new Renderbuffer_default({
+ context,
+ width,
+ height,
+ format: RenderbufferFormat_default.DEPTH_STENCIL
+ });
+ }
+ }
+ if (this._depth && this._createDepthAttachments) {
+ if (this._supportsDepthTexture && context.depthTexture) {
+ this._depthTexture = new Texture_default({
+ context,
+ width,
+ height,
+ pixelFormat: PixelFormat_default.DEPTH_COMPONENT,
+ pixelDatatype: PixelDatatype_default.UNSIGNED_INT,
+ sampler: Sampler_default.NEAREST
+ });
+ } else {
+ this._depthRenderbuffer = new Renderbuffer_default({
+ context,
+ width,
+ height,
+ format: RenderbufferFormat_default.DEPTH_COMPONENT16
+ });
+ }
+ }
+ if (this._numSamples > 1) {
+ this._multisampleFramebuffer = new MultisampleFramebuffer_default({
+ context,
+ width: this._width,
+ height: this._height,
+ colorTextures: this._colorTextures,
+ colorRenderbuffers: this._colorRenderbuffers,
+ depthStencilTexture: this._depthStencilTexture,
+ depthStencilRenderbuffer: this._depthStencilRenderbuffer,
+ destroyAttachments: false
+ });
+ } else {
+ this._framebuffer = new Framebuffer_default({
+ context,
+ colorTextures: this._colorTextures,
+ depthTexture: this._depthTexture,
+ depthRenderbuffer: this._depthRenderbuffer,
+ depthStencilTexture: this._depthStencilTexture,
+ depthStencilRenderbuffer: this._depthStencilRenderbuffer,
+ destroyAttachments: false
+ });
+ }
+ }
+};
+FramebufferManager.prototype.getColorTexture = function(index) {
+ index = defaultValue_default(index, 0);
+ if (index >= this._colorAttachmentsLength) {
+ throw new DeveloperError_default(
+ "index must be smaller than total number of color attachments."
+ );
+ }
+ return this._colorTextures[index];
+};
+FramebufferManager.prototype.setColorTexture = function(texture, index) {
+ index = defaultValue_default(index, 0);
+ if (this._createColorAttachments) {
+ throw new DeveloperError_default(
+ "createColorAttachments must be false if setColorTexture is called."
+ );
+ }
+ if (index >= this._colorAttachmentsLength) {
+ throw new DeveloperError_default(
+ "index must be smaller than total number of color attachments."
+ );
+ }
+ this._attachmentsDirty = texture !== this._colorTextures[index];
+ this._colorTextures[index] = texture;
+};
+FramebufferManager.prototype.getColorRenderbuffer = function(index) {
+ index = defaultValue_default(index, 0);
+ if (index >= this._colorAttachmentsLength) {
+ throw new DeveloperError_default(
+ "index must be smaller than total number of color attachments."
+ );
+ }
+ return this._colorRenderbuffers[index];
+};
+FramebufferManager.prototype.setColorRenderbuffer = function(renderbuffer, index) {
+ index = defaultValue_default(index, 0);
+ if (this._createColorAttachments) {
+ throw new DeveloperError_default(
+ "createColorAttachments must be false if setColorRenderbuffer is called."
+ );
+ }
+ if (index >= this._colorAttachmentsLength) {
+ throw new DeveloperError_default(
+ "index must be smaller than total number of color attachments."
+ );
+ }
+ this._attachmentsDirty = renderbuffer !== this._colorRenderbuffers[index];
+ this._colorRenderbuffers[index] = renderbuffer;
+};
+FramebufferManager.prototype.getDepthRenderbuffer = function() {
+ return this._depthRenderbuffer;
+};
+FramebufferManager.prototype.setDepthRenderbuffer = function(renderbuffer) {
+ if (this._createDepthAttachments) {
+ throw new DeveloperError_default(
+ "createDepthAttachments must be false if setDepthRenderbuffer is called."
+ );
+ }
+ this._attachmentsDirty = renderbuffer !== this._depthRenderbuffer;
+ this._depthRenderbuffer = renderbuffer;
+};
+FramebufferManager.prototype.getDepthTexture = function() {
+ return this._depthTexture;
+};
+FramebufferManager.prototype.setDepthTexture = function(texture) {
+ if (this._createDepthAttachments) {
+ throw new DeveloperError_default(
+ "createDepthAttachments must be false if setDepthTexture is called."
+ );
+ }
+ this._attachmentsDirty = texture !== this._depthTexture;
+ this._depthTexture = texture;
+};
+FramebufferManager.prototype.getDepthStencilRenderbuffer = function() {
+ return this._depthStencilRenderbuffer;
+};
+FramebufferManager.prototype.setDepthStencilRenderbuffer = function(renderbuffer) {
+ if (this._createDepthAttachments) {
+ throw new DeveloperError_default(
+ "createDepthAttachments must be false if setDepthStencilRenderbuffer is called."
+ );
+ }
+ this._attachmentsDirty = renderbuffer !== this._depthStencilRenderbuffer;
+ this._depthStencilRenderbuffer = renderbuffer;
+};
+FramebufferManager.prototype.getDepthStencilTexture = function() {
+ return this._depthStencilTexture;
+};
+FramebufferManager.prototype.setDepthStencilTexture = function(texture) {
+ if (this._createDepthAttachments) {
+ throw new DeveloperError_default(
+ "createDepthAttachments must be false if setDepthStencilTexture is called."
+ );
+ }
+ this._attachmentsDirty = texture !== this._depthStencilTexture;
+ this._depthStencilTexture = texture;
+};
+FramebufferManager.prototype.prepareTextures = function(context, blitStencil) {
+ if (this._numSamples > 1) {
+ this._multisampleFramebuffer.blitFramebuffers(context, blitStencil);
+ }
+};
+FramebufferManager.prototype.clear = function(context, clearCommand, passState) {
+ const framebuffer = clearCommand.framebuffer;
+ clearCommand.framebuffer = this.framebuffer;
+ clearCommand.execute(context, passState);
+ clearCommand.framebuffer = framebuffer;
+};
+FramebufferManager.prototype.destroyFramebuffer = function() {
+ this._framebuffer = this._framebuffer && this._framebuffer.destroy();
+ this._multisampleFramebuffer = this._multisampleFramebuffer && this._multisampleFramebuffer.destroy();
+};
+FramebufferManager.prototype.destroy = function() {
+ if (this._color) {
+ let i;
+ const length3 = this._colorTextures.length;
+ for (i = 0; i < length3; ++i) {
+ const texture = this._colorTextures[i];
+ if (this._createColorAttachments) {
+ if (defined_default(texture) && !texture.isDestroyed()) {
+ this._colorTextures[i].destroy();
+ this._colorTextures[i] = void 0;
+ }
+ }
+ if (defined_default(texture) && texture.isDestroyed()) {
+ this._colorTextures[i] = void 0;
+ }
+ const renderbuffer = this._colorRenderbuffers[i];
+ if (this._createColorAttachments) {
+ if (defined_default(renderbuffer) && !renderbuffer.isDestroyed()) {
+ this._colorRenderbuffers[i].destroy();
+ this._colorRenderbuffers[i] = void 0;
+ }
+ }
+ if (defined_default(renderbuffer) && renderbuffer.isDestroyed()) {
+ this._colorRenderbuffers[i] = void 0;
+ }
+ }
+ }
+ if (this._depthStencil) {
+ if (this._createDepthAttachments) {
+ this._depthStencilTexture = this._depthStencilTexture && this._depthStencilTexture.destroy();
+ this._depthStencilRenderbuffer = this._depthStencilRenderbuffer && this._depthStencilRenderbuffer.destroy();
+ }
+ if (defined_default(this._depthStencilTexture) && this._depthStencilTexture.isDestroyed()) {
+ this._depthStencilTexture = void 0;
+ }
+ if (defined_default(this._depthStencilRenderbuffer) && this._depthStencilRenderbuffer.isDestroyed()) {
+ this._depthStencilRenderbuffer = void 0;
+ }
+ }
+ if (this._depth) {
+ if (this._createDepthAttachments) {
+ this._depthTexture = this._depthTexture && this._depthTexture.destroy();
+ this._depthRenderbuffer = this._depthRenderbuffer && this._depthRenderbuffer.destroy();
+ }
+ if (defined_default(this._depthTexture) && this._depthTexture.isDestroyed()) {
+ this._depthTexture = void 0;
+ }
+ if (defined_default(this._depthRenderbuffer) && this._depthRenderbuffer.isDestroyed()) {
+ this._depthRenderbuffer = void 0;
+ }
+ }
+ this.destroyFramebuffer();
+};
+var FramebufferManager_default = FramebufferManager;
+
+// Source/Renderer/loadCubeMap.js
+function loadCubeMap(context, urls, skipColorSpaceConversion) {
+ Check_default.defined("context", context);
+ if (!defined_default(urls) || !defined_default(urls.positiveX) || !defined_default(urls.negativeX) || !defined_default(urls.positiveY) || !defined_default(urls.negativeY) || !defined_default(urls.positiveZ) || !defined_default(urls.negativeZ)) {
+ throw new DeveloperError_default(
+ "urls is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties."
+ );
+ }
+ const flipOptions = {
+ flipY: true,
+ skipColorSpaceConversion,
+ preferImageBitmap: true
+ };
+ const facePromises = [
+ Resource_default.createIfNeeded(urls.positiveX).fetchImage(flipOptions),
+ Resource_default.createIfNeeded(urls.negativeX).fetchImage(flipOptions),
+ Resource_default.createIfNeeded(urls.positiveY).fetchImage(flipOptions),
+ Resource_default.createIfNeeded(urls.negativeY).fetchImage(flipOptions),
+ Resource_default.createIfNeeded(urls.positiveZ).fetchImage(flipOptions),
+ Resource_default.createIfNeeded(urls.negativeZ).fetchImage(flipOptions)
+ ];
+ return Promise.all(facePromises).then(function(images) {
+ return new CubeMap_default({
+ context,
+ source: {
+ positiveX: images[0],
+ negativeX: images[1],
+ positiveY: images[2],
+ negativeY: images[3],
+ positiveZ: images[4],
+ negativeZ: images[5]
+ }
+ });
+ });
+}
+var loadCubeMap_default = loadCubeMap;
+
+// Source/Renderer/ShaderDestination.js
+var ShaderDestination = {
+ VERTEX: 0,
+ FRAGMENT: 1,
+ BOTH: 2
+};
+ShaderDestination.includesVertexShader = function(destination) {
+ Check_default.typeOf.number("destination", destination);
+ return destination === ShaderDestination.VERTEX || destination === ShaderDestination.BOTH;
+};
+ShaderDestination.includesFragmentShader = function(destination) {
+ Check_default.typeOf.number("destination", destination);
+ return destination === ShaderDestination.FRAGMENT || destination === ShaderDestination.BOTH;
+};
+var ShaderDestination_default = Object.freeze(ShaderDestination);
+
+// Source/Renderer/ShaderStruct.js
+function ShaderStruct(name) {
+ this.name = name;
+ this.fields = [];
+}
+ShaderStruct.prototype.addField = function(type, identifier) {
+ const field = ` ${type} ${identifier};`;
+ this.fields.push(field);
+};
+ShaderStruct.prototype.generateGlslLines = function() {
+ let fields = this.fields;
+ if (fields.length === 0) {
+ fields = [" float _empty;"];
+ }
+ return [].concat(`struct ${this.name}`, "{", fields, "};");
+};
+var ShaderStruct_default = ShaderStruct;
+
+// Source/Renderer/ShaderFunction.js
+function ShaderFunction(signature) {
+ this.signature = signature;
+ this.body = [];
+}
+ShaderFunction.prototype.addLines = function(lines) {
+ if (typeof lines !== "string" && !Array.isArray(lines)) {
+ throw new DeveloperError_default(
+ `Expected lines to be a string or an array of strings, actual value was ${lines}`
+ );
+ }
+ const body = this.body;
+ if (Array.isArray(lines)) {
+ const length3 = lines.length;
+ for (let i = 0; i < length3; i++) {
+ body.push(` ${lines[i]}`);
+ }
+ } else {
+ body.push(` ${lines}`);
+ }
+};
+ShaderFunction.prototype.generateGlslLines = function() {
+ return [].concat(this.signature, "{", this.body, "}");
+};
+var ShaderFunction_default = ShaderFunction;
+
+// Source/Renderer/ShaderBuilder.js
+function ShaderBuilder() {
+ this._positionAttributeLine = void 0;
+ this._nextAttributeLocation = 1;
+ this._attributeLocations = {};
+ this._attributeLines = [];
+ this._structs = {};
+ this._functions = {};
+ this._vertexShaderParts = {
+ defineLines: [],
+ uniformLines: [],
+ shaderLines: [],
+ varyingLines: [],
+ structIds: [],
+ functionIds: []
+ };
+ this._fragmentShaderParts = {
+ defineLines: [],
+ uniformLines: [],
+ shaderLines: [],
+ varyingLines: [],
+ structIds: [],
+ functionIds: []
+ };
+}
+Object.defineProperties(ShaderBuilder.prototype, {
+ attributeLocations: {
+ get: function() {
+ return this._attributeLocations;
+ }
+ }
+});
+ShaderBuilder.prototype.addDefine = function(identifier, value, destination) {
+ Check_default.typeOf.string("identifier", identifier);
+ destination = defaultValue_default(destination, ShaderDestination_default.BOTH);
+ let line = identifier;
+ if (defined_default(value)) {
+ line += ` ${value.toString()}`;
+ }
+ if (ShaderDestination_default.includesVertexShader(destination)) {
+ this._vertexShaderParts.defineLines.push(line);
+ }
+ if (ShaderDestination_default.includesFragmentShader(destination)) {
+ this._fragmentShaderParts.defineLines.push(line);
+ }
+};
+ShaderBuilder.prototype.addStruct = function(structId, structName, destination) {
+ Check_default.typeOf.string("structId", structId);
+ Check_default.typeOf.string("structName", structName);
+ Check_default.typeOf.number("destination", destination);
+ this._structs[structId] = new ShaderStruct_default(structName);
+ if (ShaderDestination_default.includesVertexShader(destination)) {
+ this._vertexShaderParts.structIds.push(structId);
+ }
+ if (ShaderDestination_default.includesFragmentShader(destination)) {
+ this._fragmentShaderParts.structIds.push(structId);
+ }
+};
+ShaderBuilder.prototype.addStructField = function(structId, type, identifier) {
+ Check_default.typeOf.string("structId", structId);
+ Check_default.typeOf.string("type", type);
+ Check_default.typeOf.string("identifier", identifier);
+ this._structs[structId].addField(type, identifier);
+};
+ShaderBuilder.prototype.addFunction = function(functionName, signature, destination) {
+ Check_default.typeOf.string("functionName", functionName);
+ Check_default.typeOf.string("signature", signature);
+ Check_default.typeOf.number("destination", destination);
+ this._functions[functionName] = new ShaderFunction_default(signature);
+ if (ShaderDestination_default.includesVertexShader(destination)) {
+ this._vertexShaderParts.functionIds.push(functionName);
+ }
+ if (ShaderDestination_default.includesFragmentShader(destination)) {
+ this._fragmentShaderParts.functionIds.push(functionName);
+ }
+};
+ShaderBuilder.prototype.addFunctionLines = function(functionName, lines) {
+ Check_default.typeOf.string("functionName", functionName);
+ if (typeof lines !== "string" && !Array.isArray(lines)) {
+ throw new DeveloperError_default(
+ `Expected lines to be a string or an array of strings, actual value was ${lines}`
+ );
+ }
+ this._functions[functionName].addLines(lines);
+};
+ShaderBuilder.prototype.addUniform = function(type, identifier, destination) {
+ Check_default.typeOf.string("type", type);
+ Check_default.typeOf.string("identifier", identifier);
+ destination = defaultValue_default(destination, ShaderDestination_default.BOTH);
+ const line = `uniform ${type} ${identifier};`;
+ if (ShaderDestination_default.includesVertexShader(destination)) {
+ this._vertexShaderParts.uniformLines.push(line);
+ }
+ if (ShaderDestination_default.includesFragmentShader(destination)) {
+ this._fragmentShaderParts.uniformLines.push(line);
+ }
+};
+ShaderBuilder.prototype.setPositionAttribute = function(type, identifier) {
+ Check_default.typeOf.string("type", type);
+ Check_default.typeOf.string("identifier", identifier);
+ if (defined_default(this._positionAttributeLine)) {
+ throw new DeveloperError_default(
+ "setPositionAttribute() must be called exactly once for the attribute used for gl_Position. For other attributes, use addAttribute()"
+ );
+ }
+ this._positionAttributeLine = `attribute ${type} ${identifier};`;
+ this._attributeLocations[identifier] = 0;
+ return 0;
+};
+ShaderBuilder.prototype.addAttribute = function(type, identifier) {
+ Check_default.typeOf.string("type", type);
+ Check_default.typeOf.string("identifier", identifier);
+ const line = `attribute ${type} ${identifier};`;
+ this._attributeLines.push(line);
+ const location2 = this._nextAttributeLocation;
+ this._attributeLocations[identifier] = location2;
+ this._nextAttributeLocation += getAttributeLocationCount(type);
+ return location2;
+};
+ShaderBuilder.prototype.addVarying = function(type, identifier) {
+ Check_default.typeOf.string("type", type);
+ Check_default.typeOf.string("identifier", identifier);
+ const line = `varying ${type} ${identifier};`;
+ this._vertexShaderParts.varyingLines.push(line);
+ this._fragmentShaderParts.varyingLines.push(line);
+};
+ShaderBuilder.prototype.addVertexLines = function(lines) {
+ if (typeof lines !== "string" && !Array.isArray(lines)) {
+ throw new DeveloperError_default(
+ `Expected lines to be a string or an array of strings, actual value was ${lines}`
+ );
+ }
+ const vertexLines = this._vertexShaderParts.shaderLines;
+ if (Array.isArray(lines)) {
+ vertexLines.push.apply(vertexLines, lines);
+ } else {
+ vertexLines.push(lines);
+ }
+};
+ShaderBuilder.prototype.addFragmentLines = function(lines) {
+ if (typeof lines !== "string" && !Array.isArray(lines)) {
+ throw new DeveloperError_default(
+ `Expected lines to be a string or an array of strings, actual value was ${lines}`
+ );
+ }
+ const fragmentLines = this._fragmentShaderParts.shaderLines;
+ if (Array.isArray(lines)) {
+ fragmentLines.push.apply(fragmentLines, lines);
+ } else {
+ fragmentLines.push(lines);
+ }
+};
+ShaderBuilder.prototype.buildShaderProgram = function(context) {
+ Check_default.typeOf.object("context", context);
+ const positionAttribute = defined_default(this._positionAttributeLine) ? [this._positionAttributeLine] : [];
+ const structLines = generateStructLines(this);
+ const functionLines = generateFunctionLines(this);
+ const vertexLines = positionAttribute.concat(
+ this._attributeLines,
+ this._vertexShaderParts.uniformLines,
+ this._vertexShaderParts.varyingLines,
+ structLines.vertexLines,
+ functionLines.vertexLines,
+ this._vertexShaderParts.shaderLines
+ ).join("\n");
+ const vertexShaderSource = new ShaderSource_default({
+ defines: this._vertexShaderParts.defineLines,
+ sources: [vertexLines]
+ });
+ const fragmentLines = this._fragmentShaderParts.uniformLines.concat(
+ this._fragmentShaderParts.varyingLines,
+ structLines.fragmentLines,
+ functionLines.fragmentLines,
+ this._fragmentShaderParts.shaderLines
+ ).join("\n");
+ const fragmentShaderSource = new ShaderSource_default({
+ defines: this._fragmentShaderParts.defineLines,
+ sources: [fragmentLines]
+ });
+ return ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource,
+ fragmentShaderSource,
+ attributeLocations: this._attributeLocations
+ });
+};
+ShaderBuilder.prototype.clone = function() {
+ return clone_default(this, true);
+};
+function generateStructLines(shaderBuilder) {
+ const vertexLines = [];
+ const fragmentLines = [];
+ let i;
+ let structIds = shaderBuilder._vertexShaderParts.structIds;
+ let structId;
+ let struct;
+ let structLines;
+ for (i = 0; i < structIds.length; i++) {
+ structId = structIds[i];
+ struct = shaderBuilder._structs[structId];
+ structLines = struct.generateGlslLines();
+ vertexLines.push.apply(vertexLines, structLines);
+ }
+ structIds = shaderBuilder._fragmentShaderParts.structIds;
+ for (i = 0; i < structIds.length; i++) {
+ structId = structIds[i];
+ struct = shaderBuilder._structs[structId];
+ structLines = struct.generateGlslLines();
+ fragmentLines.push.apply(fragmentLines, structLines);
+ }
+ return {
+ vertexLines,
+ fragmentLines
+ };
+}
+function getAttributeLocationCount(glslType) {
+ switch (glslType) {
+ case "mat2":
+ return 2;
+ case "mat3":
+ return 3;
+ case "mat4":
+ return 4;
+ default:
+ return 1;
+ }
+}
+function generateFunctionLines(shaderBuilder) {
+ const vertexLines = [];
+ const fragmentLines = [];
+ let i;
+ let functionIds = shaderBuilder._vertexShaderParts.functionIds;
+ let functionId;
+ let func;
+ let functionLines;
+ for (i = 0; i < functionIds.length; i++) {
+ functionId = functionIds[i];
+ func = shaderBuilder._functions[functionId];
+ functionLines = func.generateGlslLines();
+ vertexLines.push.apply(vertexLines, functionLines);
+ }
+ functionIds = shaderBuilder._fragmentShaderParts.functionIds;
+ for (i = 0; i < functionIds.length; i++) {
+ functionId = functionIds[i];
+ func = shaderBuilder._functions[functionId];
+ functionLines = func.generateGlslLines();
+ fragmentLines.push.apply(fragmentLines, functionLines);
+ }
+ return {
+ vertexLines,
+ fragmentLines
+ };
+}
+var ShaderBuilder_default = ShaderBuilder;
+
+// Source/Renderer/VertexArrayFacade.js
+function VertexArrayFacade(context, attributes, sizeInVertices, instanced) {
+ Check_default.defined("context", context);
+ if (!attributes || attributes.length === 0) {
+ throw new DeveloperError_default("At least one attribute is required.");
+ }
+ const attrs = VertexArrayFacade._verifyAttributes(attributes);
+ sizeInVertices = defaultValue_default(sizeInVertices, 0);
+ const precreatedAttributes = [];
+ const attributesByUsage = {};
+ let attributesForUsage;
+ let usage;
+ const length3 = attrs.length;
+ for (let i = 0; i < length3; ++i) {
+ const attribute = attrs[i];
+ if (attribute.vertexBuffer) {
+ precreatedAttributes.push(attribute);
+ continue;
+ }
+ usage = attribute.usage;
+ attributesForUsage = attributesByUsage[usage];
+ if (!defined_default(attributesForUsage)) {
+ attributesForUsage = attributesByUsage[usage] = [];
+ }
+ attributesForUsage.push(attribute);
+ }
+ function compare(left, right) {
+ return ComponentDatatype_default.getSizeInBytes(right.componentDatatype) - ComponentDatatype_default.getSizeInBytes(left.componentDatatype);
+ }
+ this._allBuffers = [];
+ for (usage in attributesByUsage) {
+ if (attributesByUsage.hasOwnProperty(usage)) {
+ attributesForUsage = attributesByUsage[usage];
+ attributesForUsage.sort(compare);
+ const vertexSizeInBytes = VertexArrayFacade._vertexSizeInBytes(
+ attributesForUsage
+ );
+ const bufferUsage = attributesForUsage[0].usage;
+ const buffer = {
+ vertexSizeInBytes,
+ vertexBuffer: void 0,
+ usage: bufferUsage,
+ needsCommit: false,
+ arrayBuffer: void 0,
+ arrayViews: VertexArrayFacade._createArrayViews(
+ attributesForUsage,
+ vertexSizeInBytes
+ )
+ };
+ this._allBuffers.push(buffer);
+ }
+ }
+ this._size = 0;
+ this._instanced = defaultValue_default(instanced, false);
+ this._precreated = precreatedAttributes;
+ this._context = context;
+ this.writers = void 0;
+ this.va = void 0;
+ this.resize(sizeInVertices);
+}
+VertexArrayFacade._verifyAttributes = function(attributes) {
+ const attrs = [];
+ for (let i = 0; i < attributes.length; ++i) {
+ const attribute = attributes[i];
+ const attr = {
+ index: defaultValue_default(attribute.index, i),
+ enabled: defaultValue_default(attribute.enabled, true),
+ componentsPerAttribute: attribute.componentsPerAttribute,
+ componentDatatype: defaultValue_default(
+ attribute.componentDatatype,
+ ComponentDatatype_default.FLOAT
+ ),
+ normalize: defaultValue_default(attribute.normalize, false),
+ vertexBuffer: attribute.vertexBuffer,
+ usage: defaultValue_default(attribute.usage, BufferUsage_default.STATIC_DRAW)
+ };
+ attrs.push(attr);
+ if (attr.componentsPerAttribute !== 1 && attr.componentsPerAttribute !== 2 && attr.componentsPerAttribute !== 3 && attr.componentsPerAttribute !== 4) {
+ throw new DeveloperError_default(
+ "attribute.componentsPerAttribute must be in the range [1, 4]."
+ );
+ }
+ const datatype = attr.componentDatatype;
+ if (!ComponentDatatype_default.validate(datatype)) {
+ throw new DeveloperError_default(
+ "Attribute must have a valid componentDatatype or not specify it."
+ );
+ }
+ if (!BufferUsage_default.validate(attr.usage)) {
+ throw new DeveloperError_default(
+ "Attribute must have a valid usage or not specify it."
+ );
+ }
+ }
+ const uniqueIndices = new Array(attrs.length);
+ for (let j = 0; j < attrs.length; ++j) {
+ const currentAttr = attrs[j];
+ const index = currentAttr.index;
+ if (uniqueIndices[index]) {
+ throw new DeveloperError_default(
+ `Index ${index} is used by more than one attribute.`
+ );
+ }
+ uniqueIndices[index] = true;
+ }
+ return attrs;
+};
+VertexArrayFacade._vertexSizeInBytes = function(attributes) {
+ let sizeInBytes = 0;
+ const length3 = attributes.length;
+ for (let i = 0; i < length3; ++i) {
+ const attribute = attributes[i];
+ sizeInBytes += attribute.componentsPerAttribute * ComponentDatatype_default.getSizeInBytes(attribute.componentDatatype);
+ }
+ const maxComponentSizeInBytes = length3 > 0 ? ComponentDatatype_default.getSizeInBytes(attributes[0].componentDatatype) : 0;
+ const remainder = maxComponentSizeInBytes > 0 ? sizeInBytes % maxComponentSizeInBytes : 0;
+ const padding = remainder === 0 ? 0 : maxComponentSizeInBytes - remainder;
+ sizeInBytes += padding;
+ return sizeInBytes;
+};
+VertexArrayFacade._createArrayViews = function(attributes, vertexSizeInBytes) {
+ const views = [];
+ let offsetInBytes = 0;
+ const length3 = attributes.length;
+ for (let i = 0; i < length3; ++i) {
+ const attribute = attributes[i];
+ const componentDatatype = attribute.componentDatatype;
+ views.push({
+ index: attribute.index,
+ enabled: attribute.enabled,
+ componentsPerAttribute: attribute.componentsPerAttribute,
+ componentDatatype,
+ normalize: attribute.normalize,
+ offsetInBytes,
+ vertexSizeInComponentType: vertexSizeInBytes / ComponentDatatype_default.getSizeInBytes(componentDatatype),
+ view: void 0
+ });
+ offsetInBytes += attribute.componentsPerAttribute * ComponentDatatype_default.getSizeInBytes(componentDatatype);
+ }
+ return views;
+};
+VertexArrayFacade.prototype.resize = function(sizeInVertices) {
+ this._size = sizeInVertices;
+ const allBuffers = this._allBuffers;
+ this.writers = [];
+ for (let i = 0, len = allBuffers.length; i < len; ++i) {
+ const buffer = allBuffers[i];
+ VertexArrayFacade._resize(buffer, this._size);
+ VertexArrayFacade._appendWriters(this.writers, buffer);
+ }
+ destroyVA(this);
+};
+VertexArrayFacade._resize = function(buffer, size) {
+ if (buffer.vertexSizeInBytes > 0) {
+ const arrayBuffer = new ArrayBuffer(size * buffer.vertexSizeInBytes);
+ if (defined_default(buffer.arrayBuffer)) {
+ const destView = new Uint8Array(arrayBuffer);
+ const sourceView = new Uint8Array(buffer.arrayBuffer);
+ const sourceLength = sourceView.length;
+ for (let j = 0; j < sourceLength; ++j) {
+ destView[j] = sourceView[j];
+ }
+ }
+ const views = buffer.arrayViews;
+ const length3 = views.length;
+ for (let i = 0; i < length3; ++i) {
+ const view = views[i];
+ view.view = ComponentDatatype_default.createArrayBufferView(
+ view.componentDatatype,
+ arrayBuffer,
+ view.offsetInBytes
+ );
+ }
+ buffer.arrayBuffer = arrayBuffer;
+ }
+};
+var createWriters = [
+ function(buffer, view, vertexSizeInComponentType) {
+ return function(index, attribute) {
+ view[index * vertexSizeInComponentType] = attribute;
+ buffer.needsCommit = true;
+ };
+ },
+ function(buffer, view, vertexSizeInComponentType) {
+ return function(index, component0, component1) {
+ const i = index * vertexSizeInComponentType;
+ view[i] = component0;
+ view[i + 1] = component1;
+ buffer.needsCommit = true;
+ };
+ },
+ function(buffer, view, vertexSizeInComponentType) {
+ return function(index, component0, component1, component2) {
+ const i = index * vertexSizeInComponentType;
+ view[i] = component0;
+ view[i + 1] = component1;
+ view[i + 2] = component2;
+ buffer.needsCommit = true;
+ };
+ },
+ function(buffer, view, vertexSizeInComponentType) {
+ return function(index, component0, component1, component2, component3) {
+ const i = index * vertexSizeInComponentType;
+ view[i] = component0;
+ view[i + 1] = component1;
+ view[i + 2] = component2;
+ view[i + 3] = component3;
+ buffer.needsCommit = true;
+ };
+ }
+];
+VertexArrayFacade._appendWriters = function(writers, buffer) {
+ const arrayViews = buffer.arrayViews;
+ const length3 = arrayViews.length;
+ for (let i = 0; i < length3; ++i) {
+ const arrayView = arrayViews[i];
+ writers[arrayView.index] = createWriters[arrayView.componentsPerAttribute - 1](buffer, arrayView.view, arrayView.vertexSizeInComponentType);
+ }
+};
+VertexArrayFacade.prototype.commit = function(indexBuffer) {
+ let recreateVA = false;
+ const allBuffers = this._allBuffers;
+ let buffer;
+ let i;
+ let length3;
+ for (i = 0, length3 = allBuffers.length; i < length3; ++i) {
+ buffer = allBuffers[i];
+ recreateVA = commit(this, buffer) || recreateVA;
+ }
+ if (recreateVA || !defined_default(this.va)) {
+ destroyVA(this);
+ const va = this.va = [];
+ const chunkSize = Math_default.SIXTY_FOUR_KILOBYTES - 4;
+ const numberOfVertexArrays = defined_default(indexBuffer) && !this._instanced ? Math.ceil(this._size / chunkSize) : 1;
+ for (let k = 0; k < numberOfVertexArrays; ++k) {
+ let attributes = [];
+ for (i = 0, length3 = allBuffers.length; i < length3; ++i) {
+ buffer = allBuffers[i];
+ const offset2 = k * (buffer.vertexSizeInBytes * chunkSize);
+ VertexArrayFacade._appendAttributes(
+ attributes,
+ buffer,
+ offset2,
+ this._instanced
+ );
+ }
+ attributes = attributes.concat(this._precreated);
+ va.push({
+ va: new VertexArray_default({
+ context: this._context,
+ attributes,
+ indexBuffer
+ }),
+ indicesCount: 1.5 * (k !== numberOfVertexArrays - 1 ? chunkSize : this._size % chunkSize)
+ });
+ }
+ }
+};
+function commit(vertexArrayFacade, buffer) {
+ if (buffer.needsCommit && buffer.vertexSizeInBytes > 0) {
+ buffer.needsCommit = false;
+ const vertexBuffer = buffer.vertexBuffer;
+ const vertexBufferSizeInBytes = vertexArrayFacade._size * buffer.vertexSizeInBytes;
+ const vertexBufferDefined = defined_default(vertexBuffer);
+ if (!vertexBufferDefined || vertexBuffer.sizeInBytes < vertexBufferSizeInBytes) {
+ if (vertexBufferDefined) {
+ vertexBuffer.destroy();
+ }
+ buffer.vertexBuffer = Buffer_default.createVertexBuffer({
+ context: vertexArrayFacade._context,
+ typedArray: buffer.arrayBuffer,
+ usage: buffer.usage
+ });
+ buffer.vertexBuffer.vertexArrayDestroyable = false;
+ return true;
+ }
+ buffer.vertexBuffer.copyFromArrayView(buffer.arrayBuffer);
+ }
+ return false;
+}
+VertexArrayFacade._appendAttributes = function(attributes, buffer, vertexBufferOffset, instanced) {
+ const arrayViews = buffer.arrayViews;
+ const length3 = arrayViews.length;
+ for (let i = 0; i < length3; ++i) {
+ const view = arrayViews[i];
+ attributes.push({
+ index: view.index,
+ enabled: view.enabled,
+ componentsPerAttribute: view.componentsPerAttribute,
+ componentDatatype: view.componentDatatype,
+ normalize: view.normalize,
+ vertexBuffer: buffer.vertexBuffer,
+ offsetInBytes: vertexBufferOffset + view.offsetInBytes,
+ strideInBytes: buffer.vertexSizeInBytes,
+ instanceDivisor: instanced ? 1 : 0
+ });
+ }
+};
+VertexArrayFacade.prototype.subCommit = function(offsetInVertices, lengthInVertices) {
+ if (offsetInVertices < 0 || offsetInVertices >= this._size) {
+ throw new DeveloperError_default(
+ "offsetInVertices must be greater than or equal to zero and less than the vertex array size."
+ );
+ }
+ if (offsetInVertices + lengthInVertices > this._size) {
+ throw new DeveloperError_default(
+ "offsetInVertices + lengthInVertices cannot exceed the vertex array size."
+ );
+ }
+ const allBuffers = this._allBuffers;
+ for (let i = 0, len = allBuffers.length; i < len; ++i) {
+ subCommit(allBuffers[i], offsetInVertices, lengthInVertices);
+ }
+};
+function subCommit(buffer, offsetInVertices, lengthInVertices) {
+ if (buffer.needsCommit && buffer.vertexSizeInBytes > 0) {
+ const byteOffset = buffer.vertexSizeInBytes * offsetInVertices;
+ const byteLength = buffer.vertexSizeInBytes * lengthInVertices;
+ buffer.vertexBuffer.copyFromArrayView(
+ new Uint8Array(buffer.arrayBuffer, byteOffset, byteLength),
+ byteOffset
+ );
+ }
+}
+VertexArrayFacade.prototype.endSubCommits = function() {
+ const allBuffers = this._allBuffers;
+ for (let i = 0, len = allBuffers.length; i < len; ++i) {
+ allBuffers[i].needsCommit = false;
+ }
+};
+function destroyVA(vertexArrayFacade) {
+ const va = vertexArrayFacade.va;
+ if (!defined_default(va)) {
+ return;
+ }
+ const length3 = va.length;
+ for (let i = 0; i < length3; ++i) {
+ va[i].va.destroy();
+ }
+ vertexArrayFacade.va = void 0;
+}
+VertexArrayFacade.prototype.isDestroyed = function() {
+ return false;
+};
+VertexArrayFacade.prototype.destroy = function() {
+ const allBuffers = this._allBuffers;
+ for (let i = 0, len = allBuffers.length; i < len; ++i) {
+ const buffer = allBuffers[i];
+ buffer.vertexBuffer = buffer.vertexBuffer && buffer.vertexBuffer.destroy();
+ }
+ destroyVA(this);
+ return destroyObject_default(this);
+};
+var VertexArrayFacade_default = VertexArrayFacade;
+
+// Source/DataSources/ConstantProperty.js
+function ConstantProperty(value) {
+ this._value = void 0;
+ this._hasClone = false;
+ this._hasEquals = false;
+ this._definitionChanged = new Event_default();
+ this.setValue(value);
+}
+Object.defineProperties(ConstantProperty.prototype, {
+ isConstant: {
+ value: true
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ }
+});
+ConstantProperty.prototype.getValue = function(time, result) {
+ return this._hasClone ? this._value.clone(result) : this._value;
+};
+ConstantProperty.prototype.setValue = function(value) {
+ const oldValue2 = this._value;
+ if (oldValue2 !== value) {
+ const isDefined = defined_default(value);
+ const hasClone = isDefined && typeof value.clone === "function";
+ const hasEquals = isDefined && typeof value.equals === "function";
+ const changed = !hasEquals || !value.equals(oldValue2);
+ if (changed) {
+ this._hasClone = hasClone;
+ this._hasEquals = hasEquals;
+ this._value = !hasClone ? value : value.clone(this._value);
+ this._definitionChanged.raiseEvent(this);
+ }
+ }
+};
+ConstantProperty.prototype.equals = function(other) {
+ return this === other || other instanceof ConstantProperty && (!this._hasEquals && this._value === other._value || this._hasEquals && this._value.equals(other._value));
+};
+ConstantProperty.prototype.valueOf = function() {
+ return this._value;
+};
+ConstantProperty.prototype.toString = function() {
+ return String(this._value);
+};
+var ConstantProperty_default = ConstantProperty;
+
+// Source/DataSources/createPropertyDescriptor.js
+function createProperty(name, privateName, subscriptionName, configurable, createPropertyCallback) {
+ return {
+ configurable,
+ get: function() {
+ return this[privateName];
+ },
+ set: function(value) {
+ const oldValue2 = this[privateName];
+ const subscription = this[subscriptionName];
+ if (defined_default(subscription)) {
+ subscription();
+ this[subscriptionName] = void 0;
+ }
+ const hasValue = value !== void 0;
+ if (hasValue && (!defined_default(value) || !defined_default(value.getValue)) && defined_default(createPropertyCallback)) {
+ value = createPropertyCallback(value);
+ }
+ if (oldValue2 !== value) {
+ this[privateName] = value;
+ this._definitionChanged.raiseEvent(this, name, value, oldValue2);
+ }
+ if (defined_default(value) && defined_default(value.definitionChanged)) {
+ this[subscriptionName] = value.definitionChanged.addEventListener(
+ function() {
+ this._definitionChanged.raiseEvent(this, name, value, value);
+ },
+ this
+ );
+ }
+ }
+ };
+}
+function createConstantProperty(value) {
+ return new ConstantProperty_default(value);
+}
+function createPropertyDescriptor(name, configurable, createPropertyCallback) {
+ return createProperty(
+ name,
+ `_${name.toString()}`,
+ `_${name.toString()}Subscription`,
+ defaultValue_default(configurable, false),
+ defaultValue_default(createPropertyCallback, createConstantProperty)
+ );
+}
+var createPropertyDescriptor_default = createPropertyDescriptor;
+
+// Source/DataSources/BillboardGraphics.js
+function BillboardGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._image = void 0;
+ this._imageSubscription = void 0;
+ this._scale = void 0;
+ this._scaleSubscription = void 0;
+ this._pixelOffset = void 0;
+ this._pixelOffsetSubscription = void 0;
+ this._eyeOffset = void 0;
+ this._eyeOffsetSubscription = void 0;
+ this._horizontalOrigin = void 0;
+ this._horizontalOriginSubscription = void 0;
+ this._verticalOrigin = void 0;
+ this._verticalOriginSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._color = void 0;
+ this._colorSubscription = void 0;
+ this._rotation = void 0;
+ this._rotationSubscription = void 0;
+ this._alignedAxis = void 0;
+ this._alignedAxisSubscription = void 0;
+ this._sizeInMeters = void 0;
+ this._sizeInMetersSubscription = void 0;
+ this._width = void 0;
+ this._widthSubscription = void 0;
+ this._height = void 0;
+ this._heightSubscription = void 0;
+ this._scaleByDistance = void 0;
+ this._scaleByDistanceSubscription = void 0;
+ this._translucencyByDistance = void 0;
+ this._translucencyByDistanceSubscription = void 0;
+ this._pixelOffsetScaleByDistance = void 0;
+ this._pixelOffsetScaleByDistanceSubscription = void 0;
+ this._imageSubRegion = void 0;
+ this._imageSubRegionSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this._disableDepthTestDistance = void 0;
+ this._disableDepthTestDistanceSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(BillboardGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ image: createPropertyDescriptor_default("image"),
+ scale: createPropertyDescriptor_default("scale"),
+ pixelOffset: createPropertyDescriptor_default("pixelOffset"),
+ eyeOffset: createPropertyDescriptor_default("eyeOffset"),
+ horizontalOrigin: createPropertyDescriptor_default("horizontalOrigin"),
+ verticalOrigin: createPropertyDescriptor_default("verticalOrigin"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ color: createPropertyDescriptor_default("color"),
+ rotation: createPropertyDescriptor_default("rotation"),
+ alignedAxis: createPropertyDescriptor_default("alignedAxis"),
+ sizeInMeters: createPropertyDescriptor_default("sizeInMeters"),
+ width: createPropertyDescriptor_default("width"),
+ height: createPropertyDescriptor_default("height"),
+ scaleByDistance: createPropertyDescriptor_default("scaleByDistance"),
+ translucencyByDistance: createPropertyDescriptor_default("translucencyByDistance"),
+ pixelOffsetScaleByDistance: createPropertyDescriptor_default(
+ "pixelOffsetScaleByDistance"
+ ),
+ imageSubRegion: createPropertyDescriptor_default("imageSubRegion"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ ),
+ disableDepthTestDistance: createPropertyDescriptor_default(
+ "disableDepthTestDistance"
+ )
+});
+BillboardGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new BillboardGraphics(this);
+ }
+ result.show = this._show;
+ result.image = this._image;
+ result.scale = this._scale;
+ result.pixelOffset = this._pixelOffset;
+ result.eyeOffset = this._eyeOffset;
+ result.horizontalOrigin = this._horizontalOrigin;
+ result.verticalOrigin = this._verticalOrigin;
+ result.heightReference = this._heightReference;
+ result.color = this._color;
+ result.rotation = this._rotation;
+ result.alignedAxis = this._alignedAxis;
+ result.sizeInMeters = this._sizeInMeters;
+ result.width = this._width;
+ result.height = this._height;
+ result.scaleByDistance = this._scaleByDistance;
+ result.translucencyByDistance = this._translucencyByDistance;
+ result.pixelOffsetScaleByDistance = this._pixelOffsetScaleByDistance;
+ result.imageSubRegion = this._imageSubRegion;
+ result.distanceDisplayCondition = this._distanceDisplayCondition;
+ result.disableDepthTestDistance = this._disableDepthTestDistance;
+ return result;
+};
+BillboardGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this._show, source.show);
+ this.image = defaultValue_default(this._image, source.image);
+ this.scale = defaultValue_default(this._scale, source.scale);
+ this.pixelOffset = defaultValue_default(this._pixelOffset, source.pixelOffset);
+ this.eyeOffset = defaultValue_default(this._eyeOffset, source.eyeOffset);
+ this.horizontalOrigin = defaultValue_default(
+ this._horizontalOrigin,
+ source.horizontalOrigin
+ );
+ this.verticalOrigin = defaultValue_default(
+ this._verticalOrigin,
+ source.verticalOrigin
+ );
+ this.heightReference = defaultValue_default(
+ this._heightReference,
+ source.heightReference
+ );
+ this.color = defaultValue_default(this._color, source.color);
+ this.rotation = defaultValue_default(this._rotation, source.rotation);
+ this.alignedAxis = defaultValue_default(this._alignedAxis, source.alignedAxis);
+ this.sizeInMeters = defaultValue_default(this._sizeInMeters, source.sizeInMeters);
+ this.width = defaultValue_default(this._width, source.width);
+ this.height = defaultValue_default(this._height, source.height);
+ this.scaleByDistance = defaultValue_default(
+ this._scaleByDistance,
+ source.scaleByDistance
+ );
+ this.translucencyByDistance = defaultValue_default(
+ this._translucencyByDistance,
+ source.translucencyByDistance
+ );
+ this.pixelOffsetScaleByDistance = defaultValue_default(
+ this._pixelOffsetScaleByDistance,
+ source.pixelOffsetScaleByDistance
+ );
+ this.imageSubRegion = defaultValue_default(
+ this._imageSubRegion,
+ source.imageSubRegion
+ );
+ this.distanceDisplayCondition = defaultValue_default(
+ this._distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+ this.disableDepthTestDistance = defaultValue_default(
+ this._disableDepthTestDistance,
+ source.disableDepthTestDistance
+ );
+};
+var BillboardGraphics_default = BillboardGraphics;
+
+// Source/Core/AssociativeArray.js
+function AssociativeArray() {
+ this._array = [];
+ this._hash = {};
+}
+Object.defineProperties(AssociativeArray.prototype, {
+ length: {
+ get: function() {
+ return this._array.length;
+ }
+ },
+ values: {
+ get: function() {
+ return this._array;
+ }
+ }
+});
+AssociativeArray.prototype.contains = function(key) {
+ if (typeof key !== "string" && typeof key !== "number") {
+ throw new DeveloperError_default("key is required to be a string or number.");
+ }
+ return defined_default(this._hash[key]);
+};
+AssociativeArray.prototype.set = function(key, value) {
+ if (typeof key !== "string" && typeof key !== "number") {
+ throw new DeveloperError_default("key is required to be a string or number.");
+ }
+ const oldValue2 = this._hash[key];
+ if (value !== oldValue2) {
+ this.remove(key);
+ this._hash[key] = value;
+ this._array.push(value);
+ }
+};
+AssociativeArray.prototype.get = function(key) {
+ if (typeof key !== "string" && typeof key !== "number") {
+ throw new DeveloperError_default("key is required to be a string or number.");
+ }
+ return this._hash[key];
+};
+AssociativeArray.prototype.remove = function(key) {
+ if (defined_default(key) && typeof key !== "string" && typeof key !== "number") {
+ throw new DeveloperError_default("key is required to be a string or number.");
+ }
+ const value = this._hash[key];
+ const hasValue = defined_default(value);
+ if (hasValue) {
+ const array = this._array;
+ array.splice(array.indexOf(value), 1);
+ delete this._hash[key];
+ }
+ return hasValue;
+};
+AssociativeArray.prototype.removeAll = function() {
+ const array = this._array;
+ if (array.length > 0) {
+ this._hash = {};
+ array.length = 0;
+ }
+};
+var AssociativeArray_default = AssociativeArray;
+
+// Source/Core/DistanceDisplayCondition.js
+function DistanceDisplayCondition(near, far) {
+ near = defaultValue_default(near, 0);
+ this._near = near;
+ far = defaultValue_default(far, Number.MAX_VALUE);
+ this._far = far;
+}
+Object.defineProperties(DistanceDisplayCondition.prototype, {
+ near: {
+ get: function() {
+ return this._near;
+ },
+ set: function(value) {
+ this._near = value;
+ }
+ },
+ far: {
+ get: function() {
+ return this._far;
+ },
+ set: function(value) {
+ this._far = value;
+ }
+ }
+});
+DistanceDisplayCondition.packedLength = 2;
+DistanceDisplayCondition.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.near;
+ array[startingIndex] = value.far;
+ return array;
+};
+DistanceDisplayCondition.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new DistanceDisplayCondition();
+ }
+ result.near = array[startingIndex++];
+ result.far = array[startingIndex];
+ return result;
+};
+DistanceDisplayCondition.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.near === right.near && left.far === right.far;
+};
+DistanceDisplayCondition.clone = function(value, result) {
+ if (!defined_default(value)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ result = new DistanceDisplayCondition();
+ }
+ result.near = value.near;
+ result.far = value.far;
+ return result;
+};
+DistanceDisplayCondition.prototype.clone = function(result) {
+ return DistanceDisplayCondition.clone(this, result);
+};
+DistanceDisplayCondition.prototype.equals = function(other) {
+ return DistanceDisplayCondition.equals(this, other);
+};
+var DistanceDisplayCondition_default = DistanceDisplayCondition;
+
+// Source/Core/NearFarScalar.js
+function NearFarScalar(near, nearValue, far, farValue) {
+ this.near = defaultValue_default(near, 0);
+ this.nearValue = defaultValue_default(nearValue, 0);
+ this.far = defaultValue_default(far, 1);
+ this.farValue = defaultValue_default(farValue, 0);
+}
+NearFarScalar.clone = function(nearFarScalar, result) {
+ if (!defined_default(nearFarScalar)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new NearFarScalar(
+ nearFarScalar.near,
+ nearFarScalar.nearValue,
+ nearFarScalar.far,
+ nearFarScalar.farValue
+ );
+ }
+ result.near = nearFarScalar.near;
+ result.nearValue = nearFarScalar.nearValue;
+ result.far = nearFarScalar.far;
+ result.farValue = nearFarScalar.farValue;
+ return result;
+};
+NearFarScalar.packedLength = 4;
+NearFarScalar.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.near;
+ array[startingIndex++] = value.nearValue;
+ array[startingIndex++] = value.far;
+ array[startingIndex] = value.farValue;
+ return array;
+};
+NearFarScalar.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new NearFarScalar();
+ }
+ result.near = array[startingIndex++];
+ result.nearValue = array[startingIndex++];
+ result.far = array[startingIndex++];
+ result.farValue = array[startingIndex];
+ return result;
+};
+NearFarScalar.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.near === right.near && left.nearValue === right.nearValue && left.far === right.far && left.farValue === right.farValue;
+};
+NearFarScalar.prototype.clone = function(result) {
+ return NearFarScalar.clone(this, result);
+};
+NearFarScalar.prototype.equals = function(right) {
+ return NearFarScalar.equals(this, right);
+};
+var NearFarScalar_default = NearFarScalar;
+
+// Source/Scene/HeightReference.js
+var HeightReference = {
+ NONE: 0,
+ CLAMP_TO_GROUND: 1,
+ RELATIVE_TO_GROUND: 2
+};
+var HeightReference_default = Object.freeze(HeightReference);
+
+// Source/Scene/HorizontalOrigin.js
+var HorizontalOrigin = {
+ CENTER: 0,
+ LEFT: 1,
+ RIGHT: -1
+};
+var HorizontalOrigin_default = Object.freeze(HorizontalOrigin);
+
+// Source/Scene/VerticalOrigin.js
+var VerticalOrigin = {
+ CENTER: 0,
+ BOTTOM: 1,
+ BASELINE: 2,
+ TOP: -1
+};
+var VerticalOrigin_default = Object.freeze(VerticalOrigin);
+
+// Source/DataSources/BoundingSphereState.js
+var BoundingSphereState = {
+ DONE: 0,
+ PENDING: 1,
+ FAILED: 2
+};
+var BoundingSphereState_default = Object.freeze(BoundingSphereState);
+
+// Source/DataSources/Property.js
+function Property() {
+ DeveloperError_default.throwInstantiationError();
+}
+Object.defineProperties(Property.prototype, {
+ isConstant: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ definitionChanged: {
+ get: DeveloperError_default.throwInstantiationError
+ }
+});
+Property.prototype.getValue = DeveloperError_default.throwInstantiationError;
+Property.prototype.equals = DeveloperError_default.throwInstantiationError;
+Property.equals = function(left, right) {
+ return left === right || defined_default(left) && left.equals(right);
+};
+Property.arrayEquals = function(left, right) {
+ if (left === right) {
+ return true;
+ }
+ if (!defined_default(left) || !defined_default(right) || left.length !== right.length) {
+ return false;
+ }
+ const length3 = left.length;
+ for (let i = 0; i < length3; i++) {
+ if (!Property.equals(left[i], right[i])) {
+ return false;
+ }
+ }
+ return true;
+};
+Property.isConstant = function(property) {
+ return !defined_default(property) || property.isConstant;
+};
+Property.getValueOrUndefined = function(property, time, result) {
+ return defined_default(property) ? property.getValue(time, result) : void 0;
+};
+Property.getValueOrDefault = function(property, time, valueDefault, result) {
+ return defined_default(property) ? defaultValue_default(property.getValue(time, result), valueDefault) : valueDefault;
+};
+Property.getValueOrClonedDefault = function(property, time, valueDefault, result) {
+ let value;
+ if (defined_default(property)) {
+ value = property.getValue(time, result);
+ }
+ if (!defined_default(value)) {
+ value = valueDefault.clone(value);
+ }
+ return value;
+};
+var Property_default = Property;
+
+// Source/DataSources/BillboardVisualizer.js
+var defaultColor = Color_default.WHITE;
+var defaultEyeOffset = Cartesian3_default.ZERO;
+var defaultHeightReference = HeightReference_default.NONE;
+var defaultPixelOffset = Cartesian2_default.ZERO;
+var defaultScale = 1;
+var defaultRotation = 0;
+var defaultAlignedAxis = Cartesian3_default.ZERO;
+var defaultHorizontalOrigin = HorizontalOrigin_default.CENTER;
+var defaultVerticalOrigin = VerticalOrigin_default.CENTER;
+var defaultSizeInMeters = false;
+var positionScratch = new Cartesian3_default();
+var colorScratch = new Color_default();
+var eyeOffsetScratch = new Cartesian3_default();
+var pixelOffsetScratch = new Cartesian2_default();
+var scaleByDistanceScratch = new NearFarScalar_default();
+var translucencyByDistanceScratch = new NearFarScalar_default();
+var pixelOffsetScaleByDistanceScratch = new NearFarScalar_default();
+var boundingRectangleScratch = new BoundingRectangle_default();
+var distanceDisplayConditionScratch = new DistanceDisplayCondition_default();
+function EntityData(entity) {
+ this.entity = entity;
+ this.billboard = void 0;
+ this.textureValue = void 0;
+}
+function BillboardVisualizer(entityCluster, entityCollection) {
+ if (!defined_default(entityCluster)) {
+ throw new DeveloperError_default("entityCluster is required.");
+ }
+ if (!defined_default(entityCollection)) {
+ throw new DeveloperError_default("entityCollection is required.");
+ }
+ entityCollection.collectionChanged.addEventListener(
+ BillboardVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ this._cluster = entityCluster;
+ this._entityCollection = entityCollection;
+ this._items = new AssociativeArray_default();
+ this._onCollectionChanged(entityCollection, entityCollection.values, [], []);
+}
+BillboardVisualizer.prototype.update = function(time) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ const items = this._items.values;
+ const cluster = this._cluster;
+ for (let i = 0, len = items.length; i < len; i++) {
+ const item = items[i];
+ const entity = item.entity;
+ const billboardGraphics = entity._billboard;
+ let textureValue;
+ let billboard = item.billboard;
+ let show = entity.isShowing && entity.isAvailable(time) && Property_default.getValueOrDefault(billboardGraphics._show, time, true);
+ let position;
+ if (show) {
+ position = Property_default.getValueOrUndefined(
+ entity._position,
+ time,
+ positionScratch
+ );
+ textureValue = Property_default.getValueOrUndefined(
+ billboardGraphics._image,
+ time
+ );
+ show = defined_default(position) && defined_default(textureValue);
+ }
+ if (!show) {
+ returnPrimitive(item, entity, cluster);
+ continue;
+ }
+ if (!Property_default.isConstant(entity._position)) {
+ cluster._clusterDirty = true;
+ }
+ if (!defined_default(billboard)) {
+ billboard = cluster.getBillboard(entity);
+ billboard.id = entity;
+ billboard.image = void 0;
+ item.billboard = billboard;
+ }
+ billboard.show = show;
+ if (!defined_default(billboard.image) || item.textureValue !== textureValue) {
+ billboard.image = textureValue;
+ item.textureValue = textureValue;
+ }
+ billboard.position = position;
+ billboard.color = Property_default.getValueOrDefault(
+ billboardGraphics._color,
+ time,
+ defaultColor,
+ colorScratch
+ );
+ billboard.eyeOffset = Property_default.getValueOrDefault(
+ billboardGraphics._eyeOffset,
+ time,
+ defaultEyeOffset,
+ eyeOffsetScratch
+ );
+ billboard.heightReference = Property_default.getValueOrDefault(
+ billboardGraphics._heightReference,
+ time,
+ defaultHeightReference
+ );
+ billboard.pixelOffset = Property_default.getValueOrDefault(
+ billboardGraphics._pixelOffset,
+ time,
+ defaultPixelOffset,
+ pixelOffsetScratch
+ );
+ billboard.scale = Property_default.getValueOrDefault(
+ billboardGraphics._scale,
+ time,
+ defaultScale
+ );
+ billboard.rotation = Property_default.getValueOrDefault(
+ billboardGraphics._rotation,
+ time,
+ defaultRotation
+ );
+ billboard.alignedAxis = Property_default.getValueOrDefault(
+ billboardGraphics._alignedAxis,
+ time,
+ defaultAlignedAxis
+ );
+ billboard.horizontalOrigin = Property_default.getValueOrDefault(
+ billboardGraphics._horizontalOrigin,
+ time,
+ defaultHorizontalOrigin
+ );
+ billboard.verticalOrigin = Property_default.getValueOrDefault(
+ billboardGraphics._verticalOrigin,
+ time,
+ defaultVerticalOrigin
+ );
+ billboard.width = Property_default.getValueOrUndefined(
+ billboardGraphics._width,
+ time
+ );
+ billboard.height = Property_default.getValueOrUndefined(
+ billboardGraphics._height,
+ time
+ );
+ billboard.scaleByDistance = Property_default.getValueOrUndefined(
+ billboardGraphics._scaleByDistance,
+ time,
+ scaleByDistanceScratch
+ );
+ billboard.translucencyByDistance = Property_default.getValueOrUndefined(
+ billboardGraphics._translucencyByDistance,
+ time,
+ translucencyByDistanceScratch
+ );
+ billboard.pixelOffsetScaleByDistance = Property_default.getValueOrUndefined(
+ billboardGraphics._pixelOffsetScaleByDistance,
+ time,
+ pixelOffsetScaleByDistanceScratch
+ );
+ billboard.sizeInMeters = Property_default.getValueOrDefault(
+ billboardGraphics._sizeInMeters,
+ time,
+ defaultSizeInMeters
+ );
+ billboard.distanceDisplayCondition = Property_default.getValueOrUndefined(
+ billboardGraphics._distanceDisplayCondition,
+ time,
+ distanceDisplayConditionScratch
+ );
+ billboard.disableDepthTestDistance = Property_default.getValueOrUndefined(
+ billboardGraphics._disableDepthTestDistance,
+ time
+ );
+ const subRegion = Property_default.getValueOrUndefined(
+ billboardGraphics._imageSubRegion,
+ time,
+ boundingRectangleScratch
+ );
+ if (defined_default(subRegion)) {
+ billboard.setImageSubRegion(billboard._imageId, subRegion);
+ }
+ }
+ return true;
+};
+BillboardVisualizer.prototype.getBoundingSphere = function(entity, result) {
+ if (!defined_default(entity)) {
+ throw new DeveloperError_default("entity is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const item = this._items.get(entity.id);
+ if (!defined_default(item) || !defined_default(item.billboard)) {
+ return BoundingSphereState_default.FAILED;
+ }
+ const billboard = item.billboard;
+ if (billboard.heightReference === HeightReference_default.NONE) {
+ result.center = Cartesian3_default.clone(billboard.position, result.center);
+ } else {
+ if (!defined_default(billboard._clampedPosition)) {
+ return BoundingSphereState_default.PENDING;
+ }
+ result.center = Cartesian3_default.clone(billboard._clampedPosition, result.center);
+ }
+ result.radius = 0;
+ return BoundingSphereState_default.DONE;
+};
+BillboardVisualizer.prototype.isDestroyed = function() {
+ return false;
+};
+BillboardVisualizer.prototype.destroy = function() {
+ this._entityCollection.collectionChanged.removeEventListener(
+ BillboardVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ const entities = this._entityCollection.values;
+ for (let i = 0; i < entities.length; i++) {
+ this._cluster.removeBillboard(entities[i]);
+ }
+ return destroyObject_default(this);
+};
+BillboardVisualizer.prototype._onCollectionChanged = function(entityCollection, added, removed, changed) {
+ let i;
+ let entity;
+ const items = this._items;
+ const cluster = this._cluster;
+ for (i = added.length - 1; i > -1; i--) {
+ entity = added[i];
+ if (defined_default(entity._billboard) && defined_default(entity._position)) {
+ items.set(entity.id, new EntityData(entity));
+ }
+ }
+ for (i = changed.length - 1; i > -1; i--) {
+ entity = changed[i];
+ if (defined_default(entity._billboard) && defined_default(entity._position)) {
+ if (!items.contains(entity.id)) {
+ items.set(entity.id, new EntityData(entity));
+ }
+ } else {
+ returnPrimitive(items.get(entity.id), entity, cluster);
+ items.remove(entity.id);
+ }
+ }
+ for (i = removed.length - 1; i > -1; i--) {
+ entity = removed[i];
+ returnPrimitive(items.get(entity.id), entity, cluster);
+ items.remove(entity.id);
+ }
+};
+function returnPrimitive(item, entity, cluster) {
+ if (defined_default(item)) {
+ item.billboard = void 0;
+ cluster.removeBillboard(entity);
+ }
+}
+var BillboardVisualizer_default = BillboardVisualizer;
+
+// Source/Core/Interval.js
+function Interval(start, stop2) {
+ this.start = defaultValue_default(start, 0);
+ this.stop = defaultValue_default(stop2, 0);
+}
+var Interval_default = Interval;
+
+// Source/Core/BoundingSphere.js
+function BoundingSphere(center, radius) {
+ this.center = Cartesian3_default.clone(defaultValue_default(center, Cartesian3_default.ZERO));
+ this.radius = defaultValue_default(radius, 0);
+}
+var fromPointsXMin = new Cartesian3_default();
+var fromPointsYMin = new Cartesian3_default();
+var fromPointsZMin = new Cartesian3_default();
+var fromPointsXMax = new Cartesian3_default();
+var fromPointsYMax = new Cartesian3_default();
+var fromPointsZMax = new Cartesian3_default();
+var fromPointsCurrentPos = new Cartesian3_default();
+var fromPointsScratch = new Cartesian3_default();
+var fromPointsRitterCenter = new Cartesian3_default();
+var fromPointsMinBoxPt = new Cartesian3_default();
+var fromPointsMaxBoxPt = new Cartesian3_default();
+var fromPointsNaiveCenterScratch = new Cartesian3_default();
+var volumeConstant = 4 / 3 * Math_default.PI;
+BoundingSphere.fromPoints = function(positions, result) {
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ if (!defined_default(positions) || positions.length === 0) {
+ result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
+ result.radius = 0;
+ return result;
+ }
+ const currentPos = Cartesian3_default.clone(positions[0], fromPointsCurrentPos);
+ const xMin = Cartesian3_default.clone(currentPos, fromPointsXMin);
+ const yMin = Cartesian3_default.clone(currentPos, fromPointsYMin);
+ const zMin = Cartesian3_default.clone(currentPos, fromPointsZMin);
+ const xMax = Cartesian3_default.clone(currentPos, fromPointsXMax);
+ const yMax = Cartesian3_default.clone(currentPos, fromPointsYMax);
+ const zMax = Cartesian3_default.clone(currentPos, fromPointsZMax);
+ const numPositions = positions.length;
+ let i;
+ for (i = 1; i < numPositions; i++) {
+ Cartesian3_default.clone(positions[i], currentPos);
+ const x = currentPos.x;
+ const y = currentPos.y;
+ const z = currentPos.z;
+ if (x < xMin.x) {
+ Cartesian3_default.clone(currentPos, xMin);
+ }
+ if (x > xMax.x) {
+ Cartesian3_default.clone(currentPos, xMax);
+ }
+ if (y < yMin.y) {
+ Cartesian3_default.clone(currentPos, yMin);
+ }
+ if (y > yMax.y) {
+ Cartesian3_default.clone(currentPos, yMax);
+ }
+ if (z < zMin.z) {
+ Cartesian3_default.clone(currentPos, zMin);
+ }
+ if (z > zMax.z) {
+ Cartesian3_default.clone(currentPos, zMax);
+ }
+ }
+ const xSpan = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(xMax, xMin, fromPointsScratch)
+ );
+ const ySpan = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(yMax, yMin, fromPointsScratch)
+ );
+ const zSpan = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(zMax, zMin, fromPointsScratch)
+ );
+ let diameter1 = xMin;
+ let diameter2 = xMax;
+ let maxSpan = xSpan;
+ if (ySpan > maxSpan) {
+ maxSpan = ySpan;
+ diameter1 = yMin;
+ diameter2 = yMax;
+ }
+ if (zSpan > maxSpan) {
+ maxSpan = zSpan;
+ diameter1 = zMin;
+ diameter2 = zMax;
+ }
+ const ritterCenter = fromPointsRitterCenter;
+ ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
+ ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
+ ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
+ let radiusSquared = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(diameter2, ritterCenter, fromPointsScratch)
+ );
+ let ritterRadius = Math.sqrt(radiusSquared);
+ const minBoxPt = fromPointsMinBoxPt;
+ minBoxPt.x = xMin.x;
+ minBoxPt.y = yMin.y;
+ minBoxPt.z = zMin.z;
+ const maxBoxPt = fromPointsMaxBoxPt;
+ maxBoxPt.x = xMax.x;
+ maxBoxPt.y = yMax.y;
+ maxBoxPt.z = zMax.z;
+ const naiveCenter = Cartesian3_default.midpoint(
+ minBoxPt,
+ maxBoxPt,
+ fromPointsNaiveCenterScratch
+ );
+ let naiveRadius = 0;
+ for (i = 0; i < numPositions; i++) {
+ Cartesian3_default.clone(positions[i], currentPos);
+ const r = Cartesian3_default.magnitude(
+ Cartesian3_default.subtract(currentPos, naiveCenter, fromPointsScratch)
+ );
+ if (r > naiveRadius) {
+ naiveRadius = r;
+ }
+ const oldCenterToPointSquared = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(currentPos, ritterCenter, fromPointsScratch)
+ );
+ if (oldCenterToPointSquared > radiusSquared) {
+ const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
+ ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
+ radiusSquared = ritterRadius * ritterRadius;
+ const oldToNew = oldCenterToPoint - ritterRadius;
+ ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
+ ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
+ ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
+ }
+ }
+ if (ritterRadius < naiveRadius) {
+ Cartesian3_default.clone(ritterCenter, result.center);
+ result.radius = ritterRadius;
+ } else {
+ Cartesian3_default.clone(naiveCenter, result.center);
+ result.radius = naiveRadius;
+ }
+ return result;
+};
+var defaultProjection2 = new GeographicProjection_default();
+var fromRectangle2DLowerLeft = new Cartesian3_default();
+var fromRectangle2DUpperRight = new Cartesian3_default();
+var fromRectangle2DSouthwest = new Cartographic_default();
+var fromRectangle2DNortheast = new Cartographic_default();
+BoundingSphere.fromRectangle2D = function(rectangle, projection, result) {
+ return BoundingSphere.fromRectangleWithHeights2D(
+ rectangle,
+ projection,
+ 0,
+ 0,
+ result
+ );
+};
+BoundingSphere.fromRectangleWithHeights2D = function(rectangle, projection, minimumHeight, maximumHeight, result) {
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ if (!defined_default(rectangle)) {
+ result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
+ result.radius = 0;
+ return result;
+ }
+ projection = defaultValue_default(projection, defaultProjection2);
+ Rectangle_default.southwest(rectangle, fromRectangle2DSouthwest);
+ fromRectangle2DSouthwest.height = minimumHeight;
+ Rectangle_default.northeast(rectangle, fromRectangle2DNortheast);
+ fromRectangle2DNortheast.height = maximumHeight;
+ const lowerLeft = projection.project(
+ fromRectangle2DSouthwest,
+ fromRectangle2DLowerLeft
+ );
+ const upperRight = projection.project(
+ fromRectangle2DNortheast,
+ fromRectangle2DUpperRight
+ );
+ const width = upperRight.x - lowerLeft.x;
+ const height = upperRight.y - lowerLeft.y;
+ const elevation = upperRight.z - lowerLeft.z;
+ result.radius = Math.sqrt(width * width + height * height + elevation * elevation) * 0.5;
+ const center = result.center;
+ center.x = lowerLeft.x + width * 0.5;
+ center.y = lowerLeft.y + height * 0.5;
+ center.z = lowerLeft.z + elevation * 0.5;
+ return result;
+};
+var fromRectangle3DScratch = [];
+BoundingSphere.fromRectangle3D = function(rectangle, ellipsoid, surfaceHeight, result) {
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ surfaceHeight = defaultValue_default(surfaceHeight, 0);
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ if (!defined_default(rectangle)) {
+ result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
+ result.radius = 0;
+ return result;
+ }
+ const positions = Rectangle_default.subsample(
+ rectangle,
+ ellipsoid,
+ surfaceHeight,
+ fromRectangle3DScratch
+ );
+ return BoundingSphere.fromPoints(positions, result);
+};
+BoundingSphere.fromVertices = function(positions, center, stride, result) {
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ if (!defined_default(positions) || positions.length === 0) {
+ result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
+ result.radius = 0;
+ return result;
+ }
+ center = defaultValue_default(center, Cartesian3_default.ZERO);
+ stride = defaultValue_default(stride, 3);
+ Check_default.typeOf.number.greaterThanOrEquals("stride", stride, 3);
+ const currentPos = fromPointsCurrentPos;
+ currentPos.x = positions[0] + center.x;
+ currentPos.y = positions[1] + center.y;
+ currentPos.z = positions[2] + center.z;
+ const xMin = Cartesian3_default.clone(currentPos, fromPointsXMin);
+ const yMin = Cartesian3_default.clone(currentPos, fromPointsYMin);
+ const zMin = Cartesian3_default.clone(currentPos, fromPointsZMin);
+ const xMax = Cartesian3_default.clone(currentPos, fromPointsXMax);
+ const yMax = Cartesian3_default.clone(currentPos, fromPointsYMax);
+ const zMax = Cartesian3_default.clone(currentPos, fromPointsZMax);
+ const numElements = positions.length;
+ let i;
+ for (i = 0; i < numElements; i += stride) {
+ const x = positions[i] + center.x;
+ const y = positions[i + 1] + center.y;
+ const z = positions[i + 2] + center.z;
+ currentPos.x = x;
+ currentPos.y = y;
+ currentPos.z = z;
+ if (x < xMin.x) {
+ Cartesian3_default.clone(currentPos, xMin);
+ }
+ if (x > xMax.x) {
+ Cartesian3_default.clone(currentPos, xMax);
+ }
+ if (y < yMin.y) {
+ Cartesian3_default.clone(currentPos, yMin);
+ }
+ if (y > yMax.y) {
+ Cartesian3_default.clone(currentPos, yMax);
+ }
+ if (z < zMin.z) {
+ Cartesian3_default.clone(currentPos, zMin);
+ }
+ if (z > zMax.z) {
+ Cartesian3_default.clone(currentPos, zMax);
+ }
+ }
+ const xSpan = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(xMax, xMin, fromPointsScratch)
+ );
+ const ySpan = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(yMax, yMin, fromPointsScratch)
+ );
+ const zSpan = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(zMax, zMin, fromPointsScratch)
+ );
+ let diameter1 = xMin;
+ let diameter2 = xMax;
+ let maxSpan = xSpan;
+ if (ySpan > maxSpan) {
+ maxSpan = ySpan;
+ diameter1 = yMin;
+ diameter2 = yMax;
+ }
+ if (zSpan > maxSpan) {
+ maxSpan = zSpan;
+ diameter1 = zMin;
+ diameter2 = zMax;
+ }
+ const ritterCenter = fromPointsRitterCenter;
+ ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
+ ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
+ ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
+ let radiusSquared = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(diameter2, ritterCenter, fromPointsScratch)
+ );
+ let ritterRadius = Math.sqrt(radiusSquared);
+ const minBoxPt = fromPointsMinBoxPt;
+ minBoxPt.x = xMin.x;
+ minBoxPt.y = yMin.y;
+ minBoxPt.z = zMin.z;
+ const maxBoxPt = fromPointsMaxBoxPt;
+ maxBoxPt.x = xMax.x;
+ maxBoxPt.y = yMax.y;
+ maxBoxPt.z = zMax.z;
+ const naiveCenter = Cartesian3_default.midpoint(
+ minBoxPt,
+ maxBoxPt,
+ fromPointsNaiveCenterScratch
+ );
+ let naiveRadius = 0;
+ for (i = 0; i < numElements; i += stride) {
+ currentPos.x = positions[i] + center.x;
+ currentPos.y = positions[i + 1] + center.y;
+ currentPos.z = positions[i + 2] + center.z;
+ const r = Cartesian3_default.magnitude(
+ Cartesian3_default.subtract(currentPos, naiveCenter, fromPointsScratch)
+ );
+ if (r > naiveRadius) {
+ naiveRadius = r;
+ }
+ const oldCenterToPointSquared = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(currentPos, ritterCenter, fromPointsScratch)
+ );
+ if (oldCenterToPointSquared > radiusSquared) {
+ const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
+ ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
+ radiusSquared = ritterRadius * ritterRadius;
+ const oldToNew = oldCenterToPoint - ritterRadius;
+ ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
+ ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
+ ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
+ }
+ }
+ if (ritterRadius < naiveRadius) {
+ Cartesian3_default.clone(ritterCenter, result.center);
+ result.radius = ritterRadius;
+ } else {
+ Cartesian3_default.clone(naiveCenter, result.center);
+ result.radius = naiveRadius;
+ }
+ return result;
+};
+BoundingSphere.fromEncodedCartesianVertices = function(positionsHigh, positionsLow, result) {
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ if (!defined_default(positionsHigh) || !defined_default(positionsLow) || positionsHigh.length !== positionsLow.length || positionsHigh.length === 0) {
+ result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
+ result.radius = 0;
+ return result;
+ }
+ const currentPos = fromPointsCurrentPos;
+ currentPos.x = positionsHigh[0] + positionsLow[0];
+ currentPos.y = positionsHigh[1] + positionsLow[1];
+ currentPos.z = positionsHigh[2] + positionsLow[2];
+ const xMin = Cartesian3_default.clone(currentPos, fromPointsXMin);
+ const yMin = Cartesian3_default.clone(currentPos, fromPointsYMin);
+ const zMin = Cartesian3_default.clone(currentPos, fromPointsZMin);
+ const xMax = Cartesian3_default.clone(currentPos, fromPointsXMax);
+ const yMax = Cartesian3_default.clone(currentPos, fromPointsYMax);
+ const zMax = Cartesian3_default.clone(currentPos, fromPointsZMax);
+ const numElements = positionsHigh.length;
+ let i;
+ for (i = 0; i < numElements; i += 3) {
+ const x = positionsHigh[i] + positionsLow[i];
+ const y = positionsHigh[i + 1] + positionsLow[i + 1];
+ const z = positionsHigh[i + 2] + positionsLow[i + 2];
+ currentPos.x = x;
+ currentPos.y = y;
+ currentPos.z = z;
+ if (x < xMin.x) {
+ Cartesian3_default.clone(currentPos, xMin);
+ }
+ if (x > xMax.x) {
+ Cartesian3_default.clone(currentPos, xMax);
+ }
+ if (y < yMin.y) {
+ Cartesian3_default.clone(currentPos, yMin);
+ }
+ if (y > yMax.y) {
+ Cartesian3_default.clone(currentPos, yMax);
+ }
+ if (z < zMin.z) {
+ Cartesian3_default.clone(currentPos, zMin);
+ }
+ if (z > zMax.z) {
+ Cartesian3_default.clone(currentPos, zMax);
+ }
+ }
+ const xSpan = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(xMax, xMin, fromPointsScratch)
+ );
+ const ySpan = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(yMax, yMin, fromPointsScratch)
+ );
+ const zSpan = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(zMax, zMin, fromPointsScratch)
+ );
+ let diameter1 = xMin;
+ let diameter2 = xMax;
+ let maxSpan = xSpan;
+ if (ySpan > maxSpan) {
+ maxSpan = ySpan;
+ diameter1 = yMin;
+ diameter2 = yMax;
+ }
+ if (zSpan > maxSpan) {
+ maxSpan = zSpan;
+ diameter1 = zMin;
+ diameter2 = zMax;
+ }
+ const ritterCenter = fromPointsRitterCenter;
+ ritterCenter.x = (diameter1.x + diameter2.x) * 0.5;
+ ritterCenter.y = (diameter1.y + diameter2.y) * 0.5;
+ ritterCenter.z = (diameter1.z + diameter2.z) * 0.5;
+ let radiusSquared = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(diameter2, ritterCenter, fromPointsScratch)
+ );
+ let ritterRadius = Math.sqrt(radiusSquared);
+ const minBoxPt = fromPointsMinBoxPt;
+ minBoxPt.x = xMin.x;
+ minBoxPt.y = yMin.y;
+ minBoxPt.z = zMin.z;
+ const maxBoxPt = fromPointsMaxBoxPt;
+ maxBoxPt.x = xMax.x;
+ maxBoxPt.y = yMax.y;
+ maxBoxPt.z = zMax.z;
+ const naiveCenter = Cartesian3_default.midpoint(
+ minBoxPt,
+ maxBoxPt,
+ fromPointsNaiveCenterScratch
+ );
+ let naiveRadius = 0;
+ for (i = 0; i < numElements; i += 3) {
+ currentPos.x = positionsHigh[i] + positionsLow[i];
+ currentPos.y = positionsHigh[i + 1] + positionsLow[i + 1];
+ currentPos.z = positionsHigh[i + 2] + positionsLow[i + 2];
+ const r = Cartesian3_default.magnitude(
+ Cartesian3_default.subtract(currentPos, naiveCenter, fromPointsScratch)
+ );
+ if (r > naiveRadius) {
+ naiveRadius = r;
+ }
+ const oldCenterToPointSquared = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(currentPos, ritterCenter, fromPointsScratch)
+ );
+ if (oldCenterToPointSquared > radiusSquared) {
+ const oldCenterToPoint = Math.sqrt(oldCenterToPointSquared);
+ ritterRadius = (ritterRadius + oldCenterToPoint) * 0.5;
+ radiusSquared = ritterRadius * ritterRadius;
+ const oldToNew = oldCenterToPoint - ritterRadius;
+ ritterCenter.x = (ritterRadius * ritterCenter.x + oldToNew * currentPos.x) / oldCenterToPoint;
+ ritterCenter.y = (ritterRadius * ritterCenter.y + oldToNew * currentPos.y) / oldCenterToPoint;
+ ritterCenter.z = (ritterRadius * ritterCenter.z + oldToNew * currentPos.z) / oldCenterToPoint;
+ }
+ }
+ if (ritterRadius < naiveRadius) {
+ Cartesian3_default.clone(ritterCenter, result.center);
+ result.radius = ritterRadius;
+ } else {
+ Cartesian3_default.clone(naiveCenter, result.center);
+ result.radius = naiveRadius;
+ }
+ return result;
+};
+BoundingSphere.fromCornerPoints = function(corner, oppositeCorner, result) {
+ Check_default.typeOf.object("corner", corner);
+ Check_default.typeOf.object("oppositeCorner", oppositeCorner);
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ const center = Cartesian3_default.midpoint(corner, oppositeCorner, result.center);
+ result.radius = Cartesian3_default.distance(center, oppositeCorner);
+ return result;
+};
+BoundingSphere.fromEllipsoid = function(ellipsoid, result) {
+ Check_default.typeOf.object("ellipsoid", ellipsoid);
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
+ result.radius = ellipsoid.maximumRadius;
+ return result;
+};
+var fromBoundingSpheresScratch = new Cartesian3_default();
+BoundingSphere.fromBoundingSpheres = function(boundingSpheres, result) {
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ if (!defined_default(boundingSpheres) || boundingSpheres.length === 0) {
+ result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
+ result.radius = 0;
+ return result;
+ }
+ const length3 = boundingSpheres.length;
+ if (length3 === 1) {
+ return BoundingSphere.clone(boundingSpheres[0], result);
+ }
+ if (length3 === 2) {
+ return BoundingSphere.union(boundingSpheres[0], boundingSpheres[1], result);
+ }
+ const positions = [];
+ let i;
+ for (i = 0; i < length3; i++) {
+ positions.push(boundingSpheres[i].center);
+ }
+ result = BoundingSphere.fromPoints(positions, result);
+ const center = result.center;
+ let radius = result.radius;
+ for (i = 0; i < length3; i++) {
+ const tmp2 = boundingSpheres[i];
+ radius = Math.max(
+ radius,
+ Cartesian3_default.distance(center, tmp2.center, fromBoundingSpheresScratch) + tmp2.radius
+ );
+ }
+ result.radius = radius;
+ return result;
+};
+var fromOrientedBoundingBoxScratchU = new Cartesian3_default();
+var fromOrientedBoundingBoxScratchV = new Cartesian3_default();
+var fromOrientedBoundingBoxScratchW = new Cartesian3_default();
+BoundingSphere.fromOrientedBoundingBox = function(orientedBoundingBox, result) {
+ Check_default.defined("orientedBoundingBox", orientedBoundingBox);
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ const halfAxes = orientedBoundingBox.halfAxes;
+ const u3 = Matrix3_default.getColumn(halfAxes, 0, fromOrientedBoundingBoxScratchU);
+ const v7 = Matrix3_default.getColumn(halfAxes, 1, fromOrientedBoundingBoxScratchV);
+ const w = Matrix3_default.getColumn(halfAxes, 2, fromOrientedBoundingBoxScratchW);
+ Cartesian3_default.add(u3, v7, u3);
+ Cartesian3_default.add(u3, w, u3);
+ result.center = Cartesian3_default.clone(orientedBoundingBox.center, result.center);
+ result.radius = Cartesian3_default.magnitude(u3);
+ return result;
+};
+var scratchFromTransformationCenter = new Cartesian3_default();
+var scratchFromTransformationScale = new Cartesian3_default();
+BoundingSphere.fromTransformation = function(transformation, result) {
+ Check_default.typeOf.object("transformation", transformation);
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ const center = Matrix4_default.getTranslation(
+ transformation,
+ scratchFromTransformationCenter
+ );
+ const scale = Matrix4_default.getScale(
+ transformation,
+ scratchFromTransformationScale
+ );
+ const radius = 0.5 * Cartesian3_default.magnitude(scale);
+ result.center = Cartesian3_default.clone(center, result.center);
+ result.radius = radius;
+ return result;
+};
+BoundingSphere.clone = function(sphere, result) {
+ if (!defined_default(sphere)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new BoundingSphere(sphere.center, sphere.radius);
+ }
+ result.center = Cartesian3_default.clone(sphere.center, result.center);
+ result.radius = sphere.radius;
+ return result;
+};
+BoundingSphere.packedLength = 4;
+BoundingSphere.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const center = value.center;
+ array[startingIndex++] = center.x;
+ array[startingIndex++] = center.y;
+ array[startingIndex++] = center.z;
+ array[startingIndex] = value.radius;
+ return array;
+};
+BoundingSphere.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ const center = result.center;
+ center.x = array[startingIndex++];
+ center.y = array[startingIndex++];
+ center.z = array[startingIndex++];
+ result.radius = array[startingIndex];
+ return result;
+};
+var unionScratch = new Cartesian3_default();
+var unionScratchCenter = new Cartesian3_default();
+BoundingSphere.union = function(left, right, result) {
+ Check_default.typeOf.object("left", left);
+ Check_default.typeOf.object("right", right);
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ const leftCenter = left.center;
+ const leftRadius = left.radius;
+ const rightCenter = right.center;
+ const rightRadius = right.radius;
+ const toRightCenter = Cartesian3_default.subtract(
+ rightCenter,
+ leftCenter,
+ unionScratch
+ );
+ const centerSeparation = Cartesian3_default.magnitude(toRightCenter);
+ if (leftRadius >= centerSeparation + rightRadius) {
+ left.clone(result);
+ return result;
+ }
+ if (rightRadius >= centerSeparation + leftRadius) {
+ right.clone(result);
+ return result;
+ }
+ const halfDistanceBetweenTangentPoints = (leftRadius + centerSeparation + rightRadius) * 0.5;
+ const center = Cartesian3_default.multiplyByScalar(
+ toRightCenter,
+ (-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation,
+ unionScratchCenter
+ );
+ Cartesian3_default.add(center, leftCenter, center);
+ Cartesian3_default.clone(center, result.center);
+ result.radius = halfDistanceBetweenTangentPoints;
+ return result;
+};
+var expandScratch = new Cartesian3_default();
+BoundingSphere.expand = function(sphere, point, result) {
+ Check_default.typeOf.object("sphere", sphere);
+ Check_default.typeOf.object("point", point);
+ result = BoundingSphere.clone(sphere, result);
+ const radius = Cartesian3_default.magnitude(
+ Cartesian3_default.subtract(point, result.center, expandScratch)
+ );
+ if (radius > result.radius) {
+ result.radius = radius;
+ }
+ return result;
+};
+BoundingSphere.intersectPlane = function(sphere, plane) {
+ Check_default.typeOf.object("sphere", sphere);
+ Check_default.typeOf.object("plane", plane);
+ const center = sphere.center;
+ const radius = sphere.radius;
+ const normal2 = plane.normal;
+ const distanceToPlane = Cartesian3_default.dot(normal2, center) + plane.distance;
+ if (distanceToPlane < -radius) {
+ return Intersect_default.OUTSIDE;
+ } else if (distanceToPlane < radius) {
+ return Intersect_default.INTERSECTING;
+ }
+ return Intersect_default.INSIDE;
+};
+BoundingSphere.transform = function(sphere, transform3, result) {
+ Check_default.typeOf.object("sphere", sphere);
+ Check_default.typeOf.object("transform", transform3);
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ result.center = Matrix4_default.multiplyByPoint(
+ transform3,
+ sphere.center,
+ result.center
+ );
+ result.radius = Matrix4_default.getMaximumScale(transform3) * sphere.radius;
+ return result;
+};
+var distanceSquaredToScratch = new Cartesian3_default();
+BoundingSphere.distanceSquaredTo = function(sphere, cartesian11) {
+ Check_default.typeOf.object("sphere", sphere);
+ Check_default.typeOf.object("cartesian", cartesian11);
+ const diff = Cartesian3_default.subtract(
+ sphere.center,
+ cartesian11,
+ distanceSquaredToScratch
+ );
+ const distance2 = Cartesian3_default.magnitude(diff) - sphere.radius;
+ if (distance2 <= 0) {
+ return 0;
+ }
+ return distance2 * distance2;
+};
+BoundingSphere.transformWithoutScale = function(sphere, transform3, result) {
+ Check_default.typeOf.object("sphere", sphere);
+ Check_default.typeOf.object("transform", transform3);
+ if (!defined_default(result)) {
+ result = new BoundingSphere();
+ }
+ result.center = Matrix4_default.multiplyByPoint(
+ transform3,
+ sphere.center,
+ result.center
+ );
+ result.radius = sphere.radius;
+ return result;
+};
+var scratchCartesian3 = new Cartesian3_default();
+BoundingSphere.computePlaneDistances = function(sphere, position, direction2, result) {
+ Check_default.typeOf.object("sphere", sphere);
+ Check_default.typeOf.object("position", position);
+ Check_default.typeOf.object("direction", direction2);
+ if (!defined_default(result)) {
+ result = new Interval_default();
+ }
+ const toCenter = Cartesian3_default.subtract(
+ sphere.center,
+ position,
+ scratchCartesian3
+ );
+ const mag = Cartesian3_default.dot(direction2, toCenter);
+ result.start = mag - sphere.radius;
+ result.stop = mag + sphere.radius;
+ return result;
+};
+var projectTo2DNormalScratch = new Cartesian3_default();
+var projectTo2DEastScratch = new Cartesian3_default();
+var projectTo2DNorthScratch = new Cartesian3_default();
+var projectTo2DWestScratch = new Cartesian3_default();
+var projectTo2DSouthScratch = new Cartesian3_default();
+var projectTo2DCartographicScratch = new Cartographic_default();
+var projectTo2DPositionsScratch = new Array(8);
+for (let n = 0; n < 8; ++n) {
+ projectTo2DPositionsScratch[n] = new Cartesian3_default();
+}
+var projectTo2DProjection = new GeographicProjection_default();
+BoundingSphere.projectTo2D = function(sphere, projection, result) {
+ Check_default.typeOf.object("sphere", sphere);
+ projection = defaultValue_default(projection, projectTo2DProjection);
+ const ellipsoid = projection.ellipsoid;
+ let center = sphere.center;
+ const radius = sphere.radius;
+ let normal2;
+ if (Cartesian3_default.equals(center, Cartesian3_default.ZERO)) {
+ normal2 = Cartesian3_default.clone(Cartesian3_default.UNIT_X, projectTo2DNormalScratch);
+ } else {
+ normal2 = ellipsoid.geodeticSurfaceNormal(center, projectTo2DNormalScratch);
+ }
+ const east = Cartesian3_default.cross(
+ Cartesian3_default.UNIT_Z,
+ normal2,
+ projectTo2DEastScratch
+ );
+ Cartesian3_default.normalize(east, east);
+ const north = Cartesian3_default.cross(normal2, east, projectTo2DNorthScratch);
+ Cartesian3_default.normalize(north, north);
+ Cartesian3_default.multiplyByScalar(normal2, radius, normal2);
+ Cartesian3_default.multiplyByScalar(north, radius, north);
+ Cartesian3_default.multiplyByScalar(east, radius, east);
+ const south = Cartesian3_default.negate(north, projectTo2DSouthScratch);
+ const west = Cartesian3_default.negate(east, projectTo2DWestScratch);
+ const positions = projectTo2DPositionsScratch;
+ let corner = positions[0];
+ Cartesian3_default.add(normal2, north, corner);
+ Cartesian3_default.add(corner, east, corner);
+ corner = positions[1];
+ Cartesian3_default.add(normal2, north, corner);
+ Cartesian3_default.add(corner, west, corner);
+ corner = positions[2];
+ Cartesian3_default.add(normal2, south, corner);
+ Cartesian3_default.add(corner, west, corner);
+ corner = positions[3];
+ Cartesian3_default.add(normal2, south, corner);
+ Cartesian3_default.add(corner, east, corner);
+ Cartesian3_default.negate(normal2, normal2);
+ corner = positions[4];
+ Cartesian3_default.add(normal2, north, corner);
+ Cartesian3_default.add(corner, east, corner);
+ corner = positions[5];
+ Cartesian3_default.add(normal2, north, corner);
+ Cartesian3_default.add(corner, west, corner);
+ corner = positions[6];
+ Cartesian3_default.add(normal2, south, corner);
+ Cartesian3_default.add(corner, west, corner);
+ corner = positions[7];
+ Cartesian3_default.add(normal2, south, corner);
+ Cartesian3_default.add(corner, east, corner);
+ const length3 = positions.length;
+ for (let i = 0; i < length3; ++i) {
+ const position = positions[i];
+ Cartesian3_default.add(center, position, position);
+ const cartographic2 = ellipsoid.cartesianToCartographic(
+ position,
+ projectTo2DCartographicScratch
+ );
+ projection.project(cartographic2, position);
+ }
+ result = BoundingSphere.fromPoints(positions, result);
+ center = result.center;
+ const x = center.x;
+ const y = center.y;
+ const z = center.z;
+ center.x = z;
+ center.y = x;
+ center.z = y;
+ return result;
+};
+BoundingSphere.isOccluded = function(sphere, occluder) {
+ Check_default.typeOf.object("sphere", sphere);
+ Check_default.typeOf.object("occluder", occluder);
+ return !occluder.isBoundingSphereVisible(sphere);
+};
+BoundingSphere.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && Cartesian3_default.equals(left.center, right.center) && left.radius === right.radius;
+};
+BoundingSphere.prototype.intersectPlane = function(plane) {
+ return BoundingSphere.intersectPlane(this, plane);
+};
+BoundingSphere.prototype.distanceSquaredTo = function(cartesian11) {
+ return BoundingSphere.distanceSquaredTo(this, cartesian11);
+};
+BoundingSphere.prototype.computePlaneDistances = function(position, direction2, result) {
+ return BoundingSphere.computePlaneDistances(
+ this,
+ position,
+ direction2,
+ result
+ );
+};
+BoundingSphere.prototype.isOccluded = function(occluder) {
+ return BoundingSphere.isOccluded(this, occluder);
+};
+BoundingSphere.prototype.equals = function(right) {
+ return BoundingSphere.equals(this, right);
+};
+BoundingSphere.prototype.clone = function(result) {
+ return BoundingSphere.clone(this, result);
+};
+BoundingSphere.prototype.volume = function() {
+ const radius = this.radius;
+ return volumeConstant * radius * radius * radius;
+};
+var BoundingSphere_default = BoundingSphere;
+
+// Source/Core/GeometryAttributes.js
+function GeometryAttributes(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.position = options.position;
+ this.normal = options.normal;
+ this.st = options.st;
+ this.bitangent = options.bitangent;
+ this.tangent = options.tangent;
+ this.color = options.color;
+}
+var GeometryAttributes_default = GeometryAttributes;
+
+// Source/Core/GeometryOffsetAttribute.js
+var GeometryOffsetAttribute = {
+ NONE: 0,
+ TOP: 1,
+ ALL: 2
+};
+var GeometryOffsetAttribute_default = Object.freeze(GeometryOffsetAttribute);
+
+// Source/Core/VertexFormat.js
+function VertexFormat(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.position = defaultValue_default(options.position, false);
+ this.normal = defaultValue_default(options.normal, false);
+ this.st = defaultValue_default(options.st, false);
+ this.bitangent = defaultValue_default(options.bitangent, false);
+ this.tangent = defaultValue_default(options.tangent, false);
+ this.color = defaultValue_default(options.color, false);
+}
+VertexFormat.POSITION_ONLY = Object.freeze(
+ new VertexFormat({
+ position: true
+ })
+);
+VertexFormat.POSITION_AND_NORMAL = Object.freeze(
+ new VertexFormat({
+ position: true,
+ normal: true
+ })
+);
+VertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(
+ new VertexFormat({
+ position: true,
+ normal: true,
+ st: true
+ })
+);
+VertexFormat.POSITION_AND_ST = Object.freeze(
+ new VertexFormat({
+ position: true,
+ st: true
+ })
+);
+VertexFormat.POSITION_AND_COLOR = Object.freeze(
+ new VertexFormat({
+ position: true,
+ color: true
+ })
+);
+VertexFormat.ALL = Object.freeze(
+ new VertexFormat({
+ position: true,
+ normal: true,
+ st: true,
+ tangent: true,
+ bitangent: true
+ })
+);
+VertexFormat.DEFAULT = VertexFormat.POSITION_NORMAL_AND_ST;
+VertexFormat.packedLength = 6;
+VertexFormat.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value.position ? 1 : 0;
+ array[startingIndex++] = value.normal ? 1 : 0;
+ array[startingIndex++] = value.st ? 1 : 0;
+ array[startingIndex++] = value.tangent ? 1 : 0;
+ array[startingIndex++] = value.bitangent ? 1 : 0;
+ array[startingIndex] = value.color ? 1 : 0;
+ return array;
+};
+VertexFormat.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new VertexFormat();
+ }
+ result.position = array[startingIndex++] === 1;
+ result.normal = array[startingIndex++] === 1;
+ result.st = array[startingIndex++] === 1;
+ result.tangent = array[startingIndex++] === 1;
+ result.bitangent = array[startingIndex++] === 1;
+ result.color = array[startingIndex] === 1;
+ return result;
+};
+VertexFormat.clone = function(vertexFormat, result) {
+ if (!defined_default(vertexFormat)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ result = new VertexFormat();
+ }
+ result.position = vertexFormat.position;
+ result.normal = vertexFormat.normal;
+ result.st = vertexFormat.st;
+ result.tangent = vertexFormat.tangent;
+ result.bitangent = vertexFormat.bitangent;
+ result.color = vertexFormat.color;
+ return result;
+};
+var VertexFormat_default = VertexFormat;
+
+// Source/Core/BoxGeometry.js
+var diffScratch = new Cartesian3_default();
+function BoxGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const min3 = options.minimum;
+ const max3 = options.maximum;
+ Check_default.typeOf.object("min", min3);
+ Check_default.typeOf.object("max", max3);
+ if (defined_default(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ throw new DeveloperError_default(
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
+ );
+ }
+ const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
+ this._minimum = Cartesian3_default.clone(min3);
+ this._maximum = Cartesian3_default.clone(max3);
+ this._vertexFormat = vertexFormat;
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createBoxGeometry";
+}
+BoxGeometry.fromDimensions = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const dimensions = options.dimensions;
+ Check_default.typeOf.object("dimensions", dimensions);
+ Check_default.typeOf.number.greaterThanOrEquals("dimensions.x", dimensions.x, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("dimensions.y", dimensions.y, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("dimensions.z", dimensions.z, 0);
+ const corner = Cartesian3_default.multiplyByScalar(dimensions, 0.5, new Cartesian3_default());
+ return new BoxGeometry({
+ minimum: Cartesian3_default.negate(corner, new Cartesian3_default()),
+ maximum: corner,
+ vertexFormat: options.vertexFormat,
+ offsetAttribute: options.offsetAttribute
+ });
+};
+BoxGeometry.fromAxisAlignedBoundingBox = function(boundingBox) {
+ Check_default.typeOf.object("boundingBox", boundingBox);
+ return new BoxGeometry({
+ minimum: boundingBox.minimum,
+ maximum: boundingBox.maximum
+ });
+};
+BoxGeometry.packedLength = 2 * Cartesian3_default.packedLength + VertexFormat_default.packedLength + 1;
+BoxGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ Cartesian3_default.pack(value._minimum, array, startingIndex);
+ Cartesian3_default.pack(
+ value._maximum,
+ array,
+ startingIndex + Cartesian3_default.packedLength
+ );
+ VertexFormat_default.pack(
+ value._vertexFormat,
+ array,
+ startingIndex + 2 * Cartesian3_default.packedLength
+ );
+ array[startingIndex + 2 * Cartesian3_default.packedLength + VertexFormat_default.packedLength] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchMin = new Cartesian3_default();
+var scratchMax = new Cartesian3_default();
+var scratchVertexFormat = new VertexFormat_default();
+var scratchOptions = {
+ minimum: scratchMin,
+ maximum: scratchMax,
+ vertexFormat: scratchVertexFormat,
+ offsetAttribute: void 0
+};
+BoxGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const min3 = Cartesian3_default.unpack(array, startingIndex, scratchMin);
+ const max3 = Cartesian3_default.unpack(
+ array,
+ startingIndex + Cartesian3_default.packedLength,
+ scratchMax
+ );
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex + 2 * Cartesian3_default.packedLength,
+ scratchVertexFormat
+ );
+ const offsetAttribute = array[startingIndex + 2 * Cartesian3_default.packedLength + VertexFormat_default.packedLength];
+ if (!defined_default(result)) {
+ scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new BoxGeometry(scratchOptions);
+ }
+ result._minimum = Cartesian3_default.clone(min3, result._minimum);
+ result._maximum = Cartesian3_default.clone(max3, result._maximum);
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+BoxGeometry.createGeometry = function(boxGeometry) {
+ const min3 = boxGeometry._minimum;
+ const max3 = boxGeometry._maximum;
+ const vertexFormat = boxGeometry._vertexFormat;
+ if (Cartesian3_default.equals(min3, max3)) {
+ return;
+ }
+ const attributes = new GeometryAttributes_default();
+ let indices2;
+ let positions;
+ if (vertexFormat.position && (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent)) {
+ if (vertexFormat.position) {
+ positions = new Float64Array(6 * 4 * 3);
+ positions[0] = min3.x;
+ positions[1] = min3.y;
+ positions[2] = max3.z;
+ positions[3] = max3.x;
+ positions[4] = min3.y;
+ positions[5] = max3.z;
+ positions[6] = max3.x;
+ positions[7] = max3.y;
+ positions[8] = max3.z;
+ positions[9] = min3.x;
+ positions[10] = max3.y;
+ positions[11] = max3.z;
+ positions[12] = min3.x;
+ positions[13] = min3.y;
+ positions[14] = min3.z;
+ positions[15] = max3.x;
+ positions[16] = min3.y;
+ positions[17] = min3.z;
+ positions[18] = max3.x;
+ positions[19] = max3.y;
+ positions[20] = min3.z;
+ positions[21] = min3.x;
+ positions[22] = max3.y;
+ positions[23] = min3.z;
+ positions[24] = max3.x;
+ positions[25] = min3.y;
+ positions[26] = min3.z;
+ positions[27] = max3.x;
+ positions[28] = max3.y;
+ positions[29] = min3.z;
+ positions[30] = max3.x;
+ positions[31] = max3.y;
+ positions[32] = max3.z;
+ positions[33] = max3.x;
+ positions[34] = min3.y;
+ positions[35] = max3.z;
+ positions[36] = min3.x;
+ positions[37] = min3.y;
+ positions[38] = min3.z;
+ positions[39] = min3.x;
+ positions[40] = max3.y;
+ positions[41] = min3.z;
+ positions[42] = min3.x;
+ positions[43] = max3.y;
+ positions[44] = max3.z;
+ positions[45] = min3.x;
+ positions[46] = min3.y;
+ positions[47] = max3.z;
+ positions[48] = min3.x;
+ positions[49] = max3.y;
+ positions[50] = min3.z;
+ positions[51] = max3.x;
+ positions[52] = max3.y;
+ positions[53] = min3.z;
+ positions[54] = max3.x;
+ positions[55] = max3.y;
+ positions[56] = max3.z;
+ positions[57] = min3.x;
+ positions[58] = max3.y;
+ positions[59] = max3.z;
+ positions[60] = min3.x;
+ positions[61] = min3.y;
+ positions[62] = min3.z;
+ positions[63] = max3.x;
+ positions[64] = min3.y;
+ positions[65] = min3.z;
+ positions[66] = max3.x;
+ positions[67] = min3.y;
+ positions[68] = max3.z;
+ positions[69] = min3.x;
+ positions[70] = min3.y;
+ positions[71] = max3.z;
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ }
+ if (vertexFormat.normal) {
+ const normals = new Float32Array(6 * 4 * 3);
+ normals[0] = 0;
+ normals[1] = 0;
+ normals[2] = 1;
+ normals[3] = 0;
+ normals[4] = 0;
+ normals[5] = 1;
+ normals[6] = 0;
+ normals[7] = 0;
+ normals[8] = 1;
+ normals[9] = 0;
+ normals[10] = 0;
+ normals[11] = 1;
+ normals[12] = 0;
+ normals[13] = 0;
+ normals[14] = -1;
+ normals[15] = 0;
+ normals[16] = 0;
+ normals[17] = -1;
+ normals[18] = 0;
+ normals[19] = 0;
+ normals[20] = -1;
+ normals[21] = 0;
+ normals[22] = 0;
+ normals[23] = -1;
+ normals[24] = 1;
+ normals[25] = 0;
+ normals[26] = 0;
+ normals[27] = 1;
+ normals[28] = 0;
+ normals[29] = 0;
+ normals[30] = 1;
+ normals[31] = 0;
+ normals[32] = 0;
+ normals[33] = 1;
+ normals[34] = 0;
+ normals[35] = 0;
+ normals[36] = -1;
+ normals[37] = 0;
+ normals[38] = 0;
+ normals[39] = -1;
+ normals[40] = 0;
+ normals[41] = 0;
+ normals[42] = -1;
+ normals[43] = 0;
+ normals[44] = 0;
+ normals[45] = -1;
+ normals[46] = 0;
+ normals[47] = 0;
+ normals[48] = 0;
+ normals[49] = 1;
+ normals[50] = 0;
+ normals[51] = 0;
+ normals[52] = 1;
+ normals[53] = 0;
+ normals[54] = 0;
+ normals[55] = 1;
+ normals[56] = 0;
+ normals[57] = 0;
+ normals[58] = 1;
+ normals[59] = 0;
+ normals[60] = 0;
+ normals[61] = -1;
+ normals[62] = 0;
+ normals[63] = 0;
+ normals[64] = -1;
+ normals[65] = 0;
+ normals[66] = 0;
+ normals[67] = -1;
+ normals[68] = 0;
+ normals[69] = 0;
+ normals[70] = -1;
+ normals[71] = 0;
+ attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals
+ });
+ }
+ if (vertexFormat.st) {
+ const texCoords = new Float32Array(6 * 4 * 2);
+ texCoords[0] = 0;
+ texCoords[1] = 0;
+ texCoords[2] = 1;
+ texCoords[3] = 0;
+ texCoords[4] = 1;
+ texCoords[5] = 1;
+ texCoords[6] = 0;
+ texCoords[7] = 1;
+ texCoords[8] = 1;
+ texCoords[9] = 0;
+ texCoords[10] = 0;
+ texCoords[11] = 0;
+ texCoords[12] = 0;
+ texCoords[13] = 1;
+ texCoords[14] = 1;
+ texCoords[15] = 1;
+ texCoords[16] = 0;
+ texCoords[17] = 0;
+ texCoords[18] = 1;
+ texCoords[19] = 0;
+ texCoords[20] = 1;
+ texCoords[21] = 1;
+ texCoords[22] = 0;
+ texCoords[23] = 1;
+ texCoords[24] = 1;
+ texCoords[25] = 0;
+ texCoords[26] = 0;
+ texCoords[27] = 0;
+ texCoords[28] = 0;
+ texCoords[29] = 1;
+ texCoords[30] = 1;
+ texCoords[31] = 1;
+ texCoords[32] = 1;
+ texCoords[33] = 0;
+ texCoords[34] = 0;
+ texCoords[35] = 0;
+ texCoords[36] = 0;
+ texCoords[37] = 1;
+ texCoords[38] = 1;
+ texCoords[39] = 1;
+ texCoords[40] = 0;
+ texCoords[41] = 0;
+ texCoords[42] = 1;
+ texCoords[43] = 0;
+ texCoords[44] = 1;
+ texCoords[45] = 1;
+ texCoords[46] = 0;
+ texCoords[47] = 1;
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: texCoords
+ });
+ }
+ if (vertexFormat.tangent) {
+ const tangents = new Float32Array(6 * 4 * 3);
+ tangents[0] = 1;
+ tangents[1] = 0;
+ tangents[2] = 0;
+ tangents[3] = 1;
+ tangents[4] = 0;
+ tangents[5] = 0;
+ tangents[6] = 1;
+ tangents[7] = 0;
+ tangents[8] = 0;
+ tangents[9] = 1;
+ tangents[10] = 0;
+ tangents[11] = 0;
+ tangents[12] = -1;
+ tangents[13] = 0;
+ tangents[14] = 0;
+ tangents[15] = -1;
+ tangents[16] = 0;
+ tangents[17] = 0;
+ tangents[18] = -1;
+ tangents[19] = 0;
+ tangents[20] = 0;
+ tangents[21] = -1;
+ tangents[22] = 0;
+ tangents[23] = 0;
+ tangents[24] = 0;
+ tangents[25] = 1;
+ tangents[26] = 0;
+ tangents[27] = 0;
+ tangents[28] = 1;
+ tangents[29] = 0;
+ tangents[30] = 0;
+ tangents[31] = 1;
+ tangents[32] = 0;
+ tangents[33] = 0;
+ tangents[34] = 1;
+ tangents[35] = 0;
+ tangents[36] = 0;
+ tangents[37] = -1;
+ tangents[38] = 0;
+ tangents[39] = 0;
+ tangents[40] = -1;
+ tangents[41] = 0;
+ tangents[42] = 0;
+ tangents[43] = -1;
+ tangents[44] = 0;
+ tangents[45] = 0;
+ tangents[46] = -1;
+ tangents[47] = 0;
+ tangents[48] = -1;
+ tangents[49] = 0;
+ tangents[50] = 0;
+ tangents[51] = -1;
+ tangents[52] = 0;
+ tangents[53] = 0;
+ tangents[54] = -1;
+ tangents[55] = 0;
+ tangents[56] = 0;
+ tangents[57] = -1;
+ tangents[58] = 0;
+ tangents[59] = 0;
+ tangents[60] = 1;
+ tangents[61] = 0;
+ tangents[62] = 0;
+ tangents[63] = 1;
+ tangents[64] = 0;
+ tangents[65] = 0;
+ tangents[66] = 1;
+ tangents[67] = 0;
+ tangents[68] = 0;
+ tangents[69] = 1;
+ tangents[70] = 0;
+ tangents[71] = 0;
+ attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ const bitangents = new Float32Array(6 * 4 * 3);
+ bitangents[0] = 0;
+ bitangents[1] = 1;
+ bitangents[2] = 0;
+ bitangents[3] = 0;
+ bitangents[4] = 1;
+ bitangents[5] = 0;
+ bitangents[6] = 0;
+ bitangents[7] = 1;
+ bitangents[8] = 0;
+ bitangents[9] = 0;
+ bitangents[10] = 1;
+ bitangents[11] = 0;
+ bitangents[12] = 0;
+ bitangents[13] = 1;
+ bitangents[14] = 0;
+ bitangents[15] = 0;
+ bitangents[16] = 1;
+ bitangents[17] = 0;
+ bitangents[18] = 0;
+ bitangents[19] = 1;
+ bitangents[20] = 0;
+ bitangents[21] = 0;
+ bitangents[22] = 1;
+ bitangents[23] = 0;
+ bitangents[24] = 0;
+ bitangents[25] = 0;
+ bitangents[26] = 1;
+ bitangents[27] = 0;
+ bitangents[28] = 0;
+ bitangents[29] = 1;
+ bitangents[30] = 0;
+ bitangents[31] = 0;
+ bitangents[32] = 1;
+ bitangents[33] = 0;
+ bitangents[34] = 0;
+ bitangents[35] = 1;
+ bitangents[36] = 0;
+ bitangents[37] = 0;
+ bitangents[38] = 1;
+ bitangents[39] = 0;
+ bitangents[40] = 0;
+ bitangents[41] = 1;
+ bitangents[42] = 0;
+ bitangents[43] = 0;
+ bitangents[44] = 1;
+ bitangents[45] = 0;
+ bitangents[46] = 0;
+ bitangents[47] = 1;
+ bitangents[48] = 0;
+ bitangents[49] = 0;
+ bitangents[50] = 1;
+ bitangents[51] = 0;
+ bitangents[52] = 0;
+ bitangents[53] = 1;
+ bitangents[54] = 0;
+ bitangents[55] = 0;
+ bitangents[56] = 1;
+ bitangents[57] = 0;
+ bitangents[58] = 0;
+ bitangents[59] = 1;
+ bitangents[60] = 0;
+ bitangents[61] = 0;
+ bitangents[62] = 1;
+ bitangents[63] = 0;
+ bitangents[64] = 0;
+ bitangents[65] = 1;
+ bitangents[66] = 0;
+ bitangents[67] = 0;
+ bitangents[68] = 1;
+ bitangents[69] = 0;
+ bitangents[70] = 0;
+ bitangents[71] = 1;
+ attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents
+ });
+ }
+ indices2 = new Uint16Array(6 * 2 * 3);
+ indices2[0] = 0;
+ indices2[1] = 1;
+ indices2[2] = 2;
+ indices2[3] = 0;
+ indices2[4] = 2;
+ indices2[5] = 3;
+ indices2[6] = 4 + 2;
+ indices2[7] = 4 + 1;
+ indices2[8] = 4 + 0;
+ indices2[9] = 4 + 3;
+ indices2[10] = 4 + 2;
+ indices2[11] = 4 + 0;
+ indices2[12] = 8 + 0;
+ indices2[13] = 8 + 1;
+ indices2[14] = 8 + 2;
+ indices2[15] = 8 + 0;
+ indices2[16] = 8 + 2;
+ indices2[17] = 8 + 3;
+ indices2[18] = 12 + 2;
+ indices2[19] = 12 + 1;
+ indices2[20] = 12 + 0;
+ indices2[21] = 12 + 3;
+ indices2[22] = 12 + 2;
+ indices2[23] = 12 + 0;
+ indices2[24] = 16 + 2;
+ indices2[25] = 16 + 1;
+ indices2[26] = 16 + 0;
+ indices2[27] = 16 + 3;
+ indices2[28] = 16 + 2;
+ indices2[29] = 16 + 0;
+ indices2[30] = 20 + 0;
+ indices2[31] = 20 + 1;
+ indices2[32] = 20 + 2;
+ indices2[33] = 20 + 0;
+ indices2[34] = 20 + 2;
+ indices2[35] = 20 + 3;
+ } else {
+ positions = new Float64Array(8 * 3);
+ positions[0] = min3.x;
+ positions[1] = min3.y;
+ positions[2] = min3.z;
+ positions[3] = max3.x;
+ positions[4] = min3.y;
+ positions[5] = min3.z;
+ positions[6] = max3.x;
+ positions[7] = max3.y;
+ positions[8] = min3.z;
+ positions[9] = min3.x;
+ positions[10] = max3.y;
+ positions[11] = min3.z;
+ positions[12] = min3.x;
+ positions[13] = min3.y;
+ positions[14] = max3.z;
+ positions[15] = max3.x;
+ positions[16] = min3.y;
+ positions[17] = max3.z;
+ positions[18] = max3.x;
+ positions[19] = max3.y;
+ positions[20] = max3.z;
+ positions[21] = min3.x;
+ positions[22] = max3.y;
+ positions[23] = max3.z;
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ indices2 = new Uint16Array(6 * 2 * 3);
+ indices2[0] = 4;
+ indices2[1] = 5;
+ indices2[2] = 6;
+ indices2[3] = 4;
+ indices2[4] = 6;
+ indices2[5] = 7;
+ indices2[6] = 1;
+ indices2[7] = 0;
+ indices2[8] = 3;
+ indices2[9] = 1;
+ indices2[10] = 3;
+ indices2[11] = 2;
+ indices2[12] = 1;
+ indices2[13] = 6;
+ indices2[14] = 5;
+ indices2[15] = 1;
+ indices2[16] = 2;
+ indices2[17] = 6;
+ indices2[18] = 2;
+ indices2[19] = 3;
+ indices2[20] = 7;
+ indices2[21] = 2;
+ indices2[22] = 7;
+ indices2[23] = 6;
+ indices2[24] = 3;
+ indices2[25] = 0;
+ indices2[26] = 4;
+ indices2[27] = 3;
+ indices2[28] = 4;
+ indices2[29] = 7;
+ indices2[30] = 0;
+ indices2[31] = 1;
+ indices2[32] = 5;
+ indices2[33] = 0;
+ indices2[34] = 5;
+ indices2[35] = 4;
+ }
+ const diff = Cartesian3_default.subtract(max3, min3, diffScratch);
+ const radius = Cartesian3_default.magnitude(diff) * 0.5;
+ if (defined_default(boxGeometry._offsetAttribute)) {
+ const length3 = positions.length;
+ const offsetValue = boxGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.TRIANGLES,
+ boundingSphere: new BoundingSphere_default(Cartesian3_default.ZERO, radius),
+ offsetAttribute: boxGeometry._offsetAttribute
+ });
+};
+var unitBoxGeometry;
+BoxGeometry.getUnitBox = function() {
+ if (!defined_default(unitBoxGeometry)) {
+ unitBoxGeometry = BoxGeometry.createGeometry(
+ BoxGeometry.fromDimensions({
+ dimensions: new Cartesian3_default(1, 1, 1),
+ vertexFormat: VertexFormat_default.POSITION_ONLY
+ })
+ );
+ }
+ return unitBoxGeometry;
+};
+var BoxGeometry_default = BoxGeometry;
+
+// Source/Core/BoxOutlineGeometry.js
+var diffScratch2 = new Cartesian3_default();
+function BoxOutlineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const min3 = options.minimum;
+ const max3 = options.maximum;
+ Check_default.typeOf.object("min", min3);
+ Check_default.typeOf.object("max", max3);
+ if (defined_default(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ throw new DeveloperError_default(
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
+ );
+ }
+ this._min = Cartesian3_default.clone(min3);
+ this._max = Cartesian3_default.clone(max3);
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createBoxOutlineGeometry";
+}
+BoxOutlineGeometry.fromDimensions = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const dimensions = options.dimensions;
+ Check_default.typeOf.object("dimensions", dimensions);
+ Check_default.typeOf.number.greaterThanOrEquals("dimensions.x", dimensions.x, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("dimensions.y", dimensions.y, 0);
+ Check_default.typeOf.number.greaterThanOrEquals("dimensions.z", dimensions.z, 0);
+ const corner = Cartesian3_default.multiplyByScalar(dimensions, 0.5, new Cartesian3_default());
+ return new BoxOutlineGeometry({
+ minimum: Cartesian3_default.negate(corner, new Cartesian3_default()),
+ maximum: corner,
+ offsetAttribute: options.offsetAttribute
+ });
+};
+BoxOutlineGeometry.fromAxisAlignedBoundingBox = function(boundingBox) {
+ Check_default.typeOf.object("boundindBox", boundingBox);
+ return new BoxOutlineGeometry({
+ minimum: boundingBox.minimum,
+ maximum: boundingBox.maximum
+ });
+};
+BoxOutlineGeometry.packedLength = 2 * Cartesian3_default.packedLength + 1;
+BoxOutlineGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ Cartesian3_default.pack(value._min, array, startingIndex);
+ Cartesian3_default.pack(value._max, array, startingIndex + Cartesian3_default.packedLength);
+ array[startingIndex + Cartesian3_default.packedLength * 2] = defaultValue_default(
+ value._offsetAttribute,
+ -1
+ );
+ return array;
+};
+var scratchMin2 = new Cartesian3_default();
+var scratchMax2 = new Cartesian3_default();
+var scratchOptions2 = {
+ minimum: scratchMin2,
+ maximum: scratchMax2,
+ offsetAttribute: void 0
+};
+BoxOutlineGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const min3 = Cartesian3_default.unpack(array, startingIndex, scratchMin2);
+ const max3 = Cartesian3_default.unpack(
+ array,
+ startingIndex + Cartesian3_default.packedLength,
+ scratchMax2
+ );
+ const offsetAttribute = array[startingIndex + Cartesian3_default.packedLength * 2];
+ if (!defined_default(result)) {
+ scratchOptions2.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new BoxOutlineGeometry(scratchOptions2);
+ }
+ result._min = Cartesian3_default.clone(min3, result._min);
+ result._max = Cartesian3_default.clone(max3, result._max);
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+BoxOutlineGeometry.createGeometry = function(boxGeometry) {
+ const min3 = boxGeometry._min;
+ const max3 = boxGeometry._max;
+ if (Cartesian3_default.equals(min3, max3)) {
+ return;
+ }
+ const attributes = new GeometryAttributes_default();
+ const indices2 = new Uint16Array(12 * 2);
+ const positions = new Float64Array(8 * 3);
+ positions[0] = min3.x;
+ positions[1] = min3.y;
+ positions[2] = min3.z;
+ positions[3] = max3.x;
+ positions[4] = min3.y;
+ positions[5] = min3.z;
+ positions[6] = max3.x;
+ positions[7] = max3.y;
+ positions[8] = min3.z;
+ positions[9] = min3.x;
+ positions[10] = max3.y;
+ positions[11] = min3.z;
+ positions[12] = min3.x;
+ positions[13] = min3.y;
+ positions[14] = max3.z;
+ positions[15] = max3.x;
+ positions[16] = min3.y;
+ positions[17] = max3.z;
+ positions[18] = max3.x;
+ positions[19] = max3.y;
+ positions[20] = max3.z;
+ positions[21] = min3.x;
+ positions[22] = max3.y;
+ positions[23] = max3.z;
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ indices2[0] = 4;
+ indices2[1] = 5;
+ indices2[2] = 5;
+ indices2[3] = 6;
+ indices2[4] = 6;
+ indices2[5] = 7;
+ indices2[6] = 7;
+ indices2[7] = 4;
+ indices2[8] = 0;
+ indices2[9] = 1;
+ indices2[10] = 1;
+ indices2[11] = 2;
+ indices2[12] = 2;
+ indices2[13] = 3;
+ indices2[14] = 3;
+ indices2[15] = 0;
+ indices2[16] = 0;
+ indices2[17] = 4;
+ indices2[18] = 1;
+ indices2[19] = 5;
+ indices2[20] = 2;
+ indices2[21] = 6;
+ indices2[22] = 3;
+ indices2[23] = 7;
+ const diff = Cartesian3_default.subtract(max3, min3, diffScratch2);
+ const radius = Cartesian3_default.magnitude(diff) * 0.5;
+ if (defined_default(boxGeometry._offsetAttribute)) {
+ const length3 = positions.length;
+ const offsetValue = boxGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.LINES,
+ boundingSphere: new BoundingSphere_default(Cartesian3_default.ZERO, radius),
+ offsetAttribute: boxGeometry._offsetAttribute
+ });
+};
+var BoxOutlineGeometry_default = BoxOutlineGeometry;
+
+// Source/Core/ColorGeometryInstanceAttribute.js
+function ColorGeometryInstanceAttribute(red, green, blue, alpha) {
+ red = defaultValue_default(red, 1);
+ green = defaultValue_default(green, 1);
+ blue = defaultValue_default(blue, 1);
+ alpha = defaultValue_default(alpha, 1);
+ this.value = new Uint8Array([
+ Color_default.floatToByte(red),
+ Color_default.floatToByte(green),
+ Color_default.floatToByte(blue),
+ Color_default.floatToByte(alpha)
+ ]);
+}
+Object.defineProperties(ColorGeometryInstanceAttribute.prototype, {
+ componentDatatype: {
+ get: function() {
+ return ComponentDatatype_default.UNSIGNED_BYTE;
+ }
+ },
+ componentsPerAttribute: {
+ get: function() {
+ return 4;
+ }
+ },
+ normalize: {
+ get: function() {
+ return true;
+ }
+ }
+});
+ColorGeometryInstanceAttribute.fromColor = function(color) {
+ if (!defined_default(color)) {
+ throw new DeveloperError_default("color is required.");
+ }
+ return new ColorGeometryInstanceAttribute(
+ color.red,
+ color.green,
+ color.blue,
+ color.alpha
+ );
+};
+ColorGeometryInstanceAttribute.toValue = function(color, result) {
+ if (!defined_default(color)) {
+ throw new DeveloperError_default("color is required.");
+ }
+ if (!defined_default(result)) {
+ return new Uint8Array(color.toBytes());
+ }
+ return color.toBytes(result);
+};
+ColorGeometryInstanceAttribute.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.value[0] === right.value[0] && left.value[1] === right.value[1] && left.value[2] === right.value[2] && left.value[3] === right.value[3];
+};
+var ColorGeometryInstanceAttribute_default = ColorGeometryInstanceAttribute;
+
+// Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js
+function DistanceDisplayConditionGeometryInstanceAttribute(near, far) {
+ near = defaultValue_default(near, 0);
+ far = defaultValue_default(far, Number.MAX_VALUE);
+ if (far <= near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ this.value = new Float32Array([near, far]);
+}
+Object.defineProperties(
+ DistanceDisplayConditionGeometryInstanceAttribute.prototype,
+ {
+ componentDatatype: {
+ get: function() {
+ return ComponentDatatype_default.FLOAT;
+ }
+ },
+ componentsPerAttribute: {
+ get: function() {
+ return 2;
+ }
+ },
+ normalize: {
+ get: function() {
+ return false;
+ }
+ }
+ }
+);
+DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition = function(distanceDisplayCondition) {
+ if (!defined_default(distanceDisplayCondition)) {
+ throw new DeveloperError_default("distanceDisplayCondition is required.");
+ }
+ if (distanceDisplayCondition.far <= distanceDisplayCondition.near) {
+ throw new DeveloperError_default(
+ "distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance."
+ );
+ }
+ return new DistanceDisplayConditionGeometryInstanceAttribute(
+ distanceDisplayCondition.near,
+ distanceDisplayCondition.far
+ );
+};
+DistanceDisplayConditionGeometryInstanceAttribute.toValue = function(distanceDisplayCondition, result) {
+ if (!defined_default(distanceDisplayCondition)) {
+ throw new DeveloperError_default("distanceDisplayCondition is required.");
+ }
+ if (!defined_default(result)) {
+ return new Float32Array([
+ distanceDisplayCondition.near,
+ distanceDisplayCondition.far
+ ]);
+ }
+ result[0] = distanceDisplayCondition.near;
+ result[1] = distanceDisplayCondition.far;
+ return result;
+};
+var DistanceDisplayConditionGeometryInstanceAttribute_default = DistanceDisplayConditionGeometryInstanceAttribute;
+
+// Source/Core/GeometryInstance.js
+function GeometryInstance(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ if (!defined_default(options.geometry)) {
+ throw new DeveloperError_default("options.geometry is required.");
+ }
+ this.geometry = options.geometry;
+ this.modelMatrix = Matrix4_default.clone(
+ defaultValue_default(options.modelMatrix, Matrix4_default.IDENTITY)
+ );
+ this.id = options.id;
+ this.pickPrimitive = options.pickPrimitive;
+ this.attributes = defaultValue_default(options.attributes, {});
+ this.westHemisphereGeometry = void 0;
+ this.eastHemisphereGeometry = void 0;
+}
+var GeometryInstance_default = GeometryInstance;
+
+// Source/Core/TimeInterval.js
+function TimeInterval(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.start = defined_default(options.start) ? JulianDate_default.clone(options.start) : new JulianDate_default();
+ this.stop = defined_default(options.stop) ? JulianDate_default.clone(options.stop) : new JulianDate_default();
+ this.data = options.data;
+ this.isStartIncluded = defaultValue_default(options.isStartIncluded, true);
+ this.isStopIncluded = defaultValue_default(options.isStopIncluded, true);
+}
+Object.defineProperties(TimeInterval.prototype, {
+ isEmpty: {
+ get: function() {
+ const stopComparedToStart = JulianDate_default.compare(this.stop, this.start);
+ return stopComparedToStart < 0 || stopComparedToStart === 0 && (!this.isStartIncluded || !this.isStopIncluded);
+ }
+ }
+});
+var scratchInterval = {
+ start: void 0,
+ stop: void 0,
+ isStartIncluded: void 0,
+ isStopIncluded: void 0,
+ data: void 0
+};
+TimeInterval.fromIso8601 = function(options, result) {
+ Check_default.typeOf.object("options", options);
+ Check_default.typeOf.string("options.iso8601", options.iso8601);
+ const dates = options.iso8601.split("/");
+ if (dates.length !== 2) {
+ throw new DeveloperError_default(
+ "options.iso8601 is an invalid ISO 8601 interval."
+ );
+ }
+ const start = JulianDate_default.fromIso8601(dates[0]);
+ const stop2 = JulianDate_default.fromIso8601(dates[1]);
+ const isStartIncluded = defaultValue_default(options.isStartIncluded, true);
+ const isStopIncluded = defaultValue_default(options.isStopIncluded, true);
+ const data = options.data;
+ if (!defined_default(result)) {
+ scratchInterval.start = start;
+ scratchInterval.stop = stop2;
+ scratchInterval.isStartIncluded = isStartIncluded;
+ scratchInterval.isStopIncluded = isStopIncluded;
+ scratchInterval.data = data;
+ return new TimeInterval(scratchInterval);
+ }
+ result.start = start;
+ result.stop = stop2;
+ result.isStartIncluded = isStartIncluded;
+ result.isStopIncluded = isStopIncluded;
+ result.data = data;
+ return result;
+};
+TimeInterval.toIso8601 = function(timeInterval, precision) {
+ Check_default.typeOf.object("timeInterval", timeInterval);
+ return `${JulianDate_default.toIso8601(
+ timeInterval.start,
+ precision
+ )}/${JulianDate_default.toIso8601(timeInterval.stop, precision)}`;
+};
+TimeInterval.clone = function(timeInterval, result) {
+ if (!defined_default(timeInterval)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new TimeInterval(timeInterval);
+ }
+ result.start = timeInterval.start;
+ result.stop = timeInterval.stop;
+ result.isStartIncluded = timeInterval.isStartIncluded;
+ result.isStopIncluded = timeInterval.isStopIncluded;
+ result.data = timeInterval.data;
+ return result;
+};
+TimeInterval.equals = function(left, right, dataComparer) {
+ return left === right || defined_default(left) && defined_default(right) && (left.isEmpty && right.isEmpty || left.isStartIncluded === right.isStartIncluded && left.isStopIncluded === right.isStopIncluded && JulianDate_default.equals(left.start, right.start) && JulianDate_default.equals(left.stop, right.stop) && (left.data === right.data || defined_default(dataComparer) && dataComparer(left.data, right.data)));
+};
+TimeInterval.equalsEpsilon = function(left, right, epsilon, dataComparer) {
+ epsilon = defaultValue_default(epsilon, 0);
+ return left === right || defined_default(left) && defined_default(right) && (left.isEmpty && right.isEmpty || left.isStartIncluded === right.isStartIncluded && left.isStopIncluded === right.isStopIncluded && JulianDate_default.equalsEpsilon(left.start, right.start, epsilon) && JulianDate_default.equalsEpsilon(left.stop, right.stop, epsilon) && (left.data === right.data || defined_default(dataComparer) && dataComparer(left.data, right.data)));
+};
+TimeInterval.intersect = function(left, right, result, mergeCallback) {
+ Check_default.typeOf.object("left", left);
+ if (!defined_default(right)) {
+ return TimeInterval.clone(TimeInterval.EMPTY, result);
+ }
+ const leftStart = left.start;
+ const leftStop = left.stop;
+ const rightStart = right.start;
+ const rightStop = right.stop;
+ const intersectsStartRight = JulianDate_default.greaterThanOrEquals(rightStart, leftStart) && JulianDate_default.greaterThanOrEquals(leftStop, rightStart);
+ const intersectsStartLeft = !intersectsStartRight && JulianDate_default.lessThanOrEquals(rightStart, leftStart) && JulianDate_default.lessThanOrEquals(leftStart, rightStop);
+ if (!intersectsStartRight && !intersectsStartLeft) {
+ return TimeInterval.clone(TimeInterval.EMPTY, result);
+ }
+ const leftIsStartIncluded = left.isStartIncluded;
+ const leftIsStopIncluded = left.isStopIncluded;
+ const rightIsStartIncluded = right.isStartIncluded;
+ const rightIsStopIncluded = right.isStopIncluded;
+ const leftLessThanRight = JulianDate_default.lessThan(leftStop, rightStop);
+ if (!defined_default(result)) {
+ result = new TimeInterval();
+ }
+ result.start = intersectsStartRight ? rightStart : leftStart;
+ result.isStartIncluded = leftIsStartIncluded && rightIsStartIncluded || !JulianDate_default.equals(rightStart, leftStart) && (intersectsStartRight && rightIsStartIncluded || intersectsStartLeft && leftIsStartIncluded);
+ result.stop = leftLessThanRight ? leftStop : rightStop;
+ result.isStopIncluded = leftLessThanRight ? leftIsStopIncluded : leftIsStopIncluded && rightIsStopIncluded || !JulianDate_default.equals(rightStop, leftStop) && rightIsStopIncluded;
+ result.data = defined_default(mergeCallback) ? mergeCallback(left.data, right.data) : left.data;
+ return result;
+};
+TimeInterval.contains = function(timeInterval, julianDate) {
+ Check_default.typeOf.object("timeInterval", timeInterval);
+ Check_default.typeOf.object("julianDate", julianDate);
+ if (timeInterval.isEmpty) {
+ return false;
+ }
+ const startComparedToDate = JulianDate_default.compare(
+ timeInterval.start,
+ julianDate
+ );
+ if (startComparedToDate === 0) {
+ return timeInterval.isStartIncluded;
+ }
+ const dateComparedToStop = JulianDate_default.compare(julianDate, timeInterval.stop);
+ if (dateComparedToStop === 0) {
+ return timeInterval.isStopIncluded;
+ }
+ return startComparedToDate < 0 && dateComparedToStop < 0;
+};
+TimeInterval.prototype.clone = function(result) {
+ return TimeInterval.clone(this, result);
+};
+TimeInterval.prototype.equals = function(right, dataComparer) {
+ return TimeInterval.equals(this, right, dataComparer);
+};
+TimeInterval.prototype.equalsEpsilon = function(right, epsilon, dataComparer) {
+ return TimeInterval.equalsEpsilon(this, right, epsilon, dataComparer);
+};
+TimeInterval.prototype.toString = function() {
+ return TimeInterval.toIso8601(this);
+};
+TimeInterval.EMPTY = Object.freeze(
+ new TimeInterval({
+ start: new JulianDate_default(),
+ stop: new JulianDate_default(),
+ isStartIncluded: false,
+ isStopIncluded: false
+ })
+);
+var TimeInterval_default = TimeInterval;
+
+// Source/Core/Iso8601.js
+var MINIMUM_VALUE = Object.freeze(
+ JulianDate_default.fromIso8601("0000-01-01T00:00:00Z")
+);
+var MAXIMUM_VALUE = Object.freeze(
+ JulianDate_default.fromIso8601("9999-12-31T24:00:00Z")
+);
+var MAXIMUM_INTERVAL = Object.freeze(
+ new TimeInterval_default({
+ start: MINIMUM_VALUE,
+ stop: MAXIMUM_VALUE
+ })
+);
+var Iso8601 = {
+ MINIMUM_VALUE,
+ MAXIMUM_VALUE,
+ MAXIMUM_INTERVAL
+};
+var Iso8601_default = Iso8601;
+
+// Source/Core/OffsetGeometryInstanceAttribute.js
+function OffsetGeometryInstanceAttribute(x, y, z) {
+ x = defaultValue_default(x, 0);
+ y = defaultValue_default(y, 0);
+ z = defaultValue_default(z, 0);
+ this.value = new Float32Array([x, y, z]);
+}
+Object.defineProperties(OffsetGeometryInstanceAttribute.prototype, {
+ componentDatatype: {
+ get: function() {
+ return ComponentDatatype_default.FLOAT;
+ }
+ },
+ componentsPerAttribute: {
+ get: function() {
+ return 3;
+ }
+ },
+ normalize: {
+ get: function() {
+ return false;
+ }
+ }
+});
+OffsetGeometryInstanceAttribute.fromCartesian3 = function(offset2) {
+ Check_default.defined("offset", offset2);
+ return new OffsetGeometryInstanceAttribute(offset2.x, offset2.y, offset2.z);
+};
+OffsetGeometryInstanceAttribute.toValue = function(offset2, result) {
+ Check_default.defined("offset", offset2);
+ if (!defined_default(result)) {
+ result = new Float32Array([offset2.x, offset2.y, offset2.z]);
+ }
+ result[0] = offset2.x;
+ result[1] = offset2.y;
+ result[2] = offset2.z;
+ return result;
+};
+var OffsetGeometryInstanceAttribute_default = OffsetGeometryInstanceAttribute;
+
+// Source/Core/ShowGeometryInstanceAttribute.js
+function ShowGeometryInstanceAttribute(show) {
+ show = defaultValue_default(show, true);
+ this.value = ShowGeometryInstanceAttribute.toValue(show);
+}
+Object.defineProperties(ShowGeometryInstanceAttribute.prototype, {
+ componentDatatype: {
+ get: function() {
+ return ComponentDatatype_default.UNSIGNED_BYTE;
+ }
+ },
+ componentsPerAttribute: {
+ get: function() {
+ return 1;
+ }
+ },
+ normalize: {
+ get: function() {
+ return false;
+ }
+ }
+});
+ShowGeometryInstanceAttribute.toValue = function(show, result) {
+ if (!defined_default(show)) {
+ throw new DeveloperError_default("show is required.");
+ }
+ if (!defined_default(result)) {
+ return new Uint8Array([show]);
+ }
+ result[0] = show;
+ return result;
+};
+var ShowGeometryInstanceAttribute_default = ShowGeometryInstanceAttribute;
+
+// Source/Shaders/Appearances/AllMaterialAppearanceFS.js
+var AllMaterialAppearanceFS_default = "varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\n\nvoid main()\n{\n vec3 positionToEyeEC = -v_positionEC;\n mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);\n\n vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = tangentToEyeMatrix;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = v_st;\n czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\n gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n";
+
+// Source/Shaders/Appearances/AllMaterialAppearanceVS.js
+var AllMaterialAppearanceVS_default = "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 bitangent;\nattribute vec2 st;\nattribute float batchId;\n\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_bitangentEC;\nvarying vec2 v_st;\n\nvoid main()\n{\n vec4 p = czm_computePosition();\n\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n v_tangentEC = czm_normal * tangent; // tangent in eye coordinates\n v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates\n v_st = st;\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";
+
+// Source/Shaders/Appearances/BasicMaterialAppearanceFS.js
+var BasicMaterialAppearanceFS_default = "varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\n\nvoid main()\n{\n vec3 positionToEyeEC = -v_positionEC;\n\n vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\n gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n";
+
+// Source/Shaders/Appearances/BasicMaterialAppearanceVS.js
+var BasicMaterialAppearanceVS_default = "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute float batchId;\n\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\n\nvoid main()\n{\n vec4 p = czm_computePosition();\n\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";
+
+// Source/Shaders/Appearances/TexturedMaterialAppearanceFS.js
+var TexturedMaterialAppearanceFS_default = "varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\n\nvoid main()\n{\n vec3 positionToEyeEC = -v_positionEC;\n\n vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = v_st;\n czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\n gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n#endif\n}\n";
+
+// Source/Shaders/Appearances/TexturedMaterialAppearanceVS.js
+var TexturedMaterialAppearanceVS_default = "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nattribute float batchId;\n\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\n\nvoid main()\n{\n vec4 p = czm_computePosition();\n\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n v_st = st;\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";
+
+// Source/Scene/BlendEquation.js
+var BlendEquation = {
+ ADD: WebGLConstants_default.FUNC_ADD,
+ SUBTRACT: WebGLConstants_default.FUNC_SUBTRACT,
+ REVERSE_SUBTRACT: WebGLConstants_default.FUNC_REVERSE_SUBTRACT,
+ MIN: WebGLConstants_default.MIN,
+ MAX: WebGLConstants_default.MAX
+};
+var BlendEquation_default = Object.freeze(BlendEquation);
+
+// Source/Scene/BlendFunction.js
+var BlendFunction = {
+ ZERO: WebGLConstants_default.ZERO,
+ ONE: WebGLConstants_default.ONE,
+ SOURCE_COLOR: WebGLConstants_default.SRC_COLOR,
+ ONE_MINUS_SOURCE_COLOR: WebGLConstants_default.ONE_MINUS_SRC_COLOR,
+ DESTINATION_COLOR: WebGLConstants_default.DST_COLOR,
+ ONE_MINUS_DESTINATION_COLOR: WebGLConstants_default.ONE_MINUS_DST_COLOR,
+ SOURCE_ALPHA: WebGLConstants_default.SRC_ALPHA,
+ ONE_MINUS_SOURCE_ALPHA: WebGLConstants_default.ONE_MINUS_SRC_ALPHA,
+ DESTINATION_ALPHA: WebGLConstants_default.DST_ALPHA,
+ ONE_MINUS_DESTINATION_ALPHA: WebGLConstants_default.ONE_MINUS_DST_ALPHA,
+ CONSTANT_COLOR: WebGLConstants_default.CONSTANT_COLOR,
+ ONE_MINUS_CONSTANT_COLOR: WebGLConstants_default.ONE_MINUS_CONSTANT_COLOR,
+ CONSTANT_ALPHA: WebGLConstants_default.CONSTANT_ALPHA,
+ ONE_MINUS_CONSTANT_ALPHA: WebGLConstants_default.ONE_MINUS_CONSTANT_ALPHA,
+ SOURCE_ALPHA_SATURATE: WebGLConstants_default.SRC_ALPHA_SATURATE
+};
+var BlendFunction_default = Object.freeze(BlendFunction);
+
+// Source/Scene/BlendingState.js
+var BlendingState = {
+ DISABLED: Object.freeze({
+ enabled: false
+ }),
+ ALPHA_BLEND: Object.freeze({
+ enabled: true,
+ equationRgb: BlendEquation_default.ADD,
+ equationAlpha: BlendEquation_default.ADD,
+ functionSourceRgb: BlendFunction_default.SOURCE_ALPHA,
+ functionSourceAlpha: BlendFunction_default.ONE,
+ functionDestinationRgb: BlendFunction_default.ONE_MINUS_SOURCE_ALPHA,
+ functionDestinationAlpha: BlendFunction_default.ONE_MINUS_SOURCE_ALPHA
+ }),
+ PRE_MULTIPLIED_ALPHA_BLEND: Object.freeze({
+ enabled: true,
+ equationRgb: BlendEquation_default.ADD,
+ equationAlpha: BlendEquation_default.ADD,
+ functionSourceRgb: BlendFunction_default.ONE,
+ functionSourceAlpha: BlendFunction_default.ONE,
+ functionDestinationRgb: BlendFunction_default.ONE_MINUS_SOURCE_ALPHA,
+ functionDestinationAlpha: BlendFunction_default.ONE_MINUS_SOURCE_ALPHA
+ }),
+ ADDITIVE_BLEND: Object.freeze({
+ enabled: true,
+ equationRgb: BlendEquation_default.ADD,
+ equationAlpha: BlendEquation_default.ADD,
+ functionSourceRgb: BlendFunction_default.SOURCE_ALPHA,
+ functionSourceAlpha: BlendFunction_default.ONE,
+ functionDestinationRgb: BlendFunction_default.ONE,
+ functionDestinationAlpha: BlendFunction_default.ONE
+ })
+};
+var BlendingState_default = Object.freeze(BlendingState);
+
+// Source/Scene/CullFace.js
+var CullFace = {
+ FRONT: WebGLConstants_default.FRONT,
+ BACK: WebGLConstants_default.BACK,
+ FRONT_AND_BACK: WebGLConstants_default.FRONT_AND_BACK
+};
+var CullFace_default = Object.freeze(CullFace);
+
+// Source/Scene/Appearance.js
+function Appearance(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.material = options.material;
+ this.translucent = defaultValue_default(options.translucent, true);
+ this._vertexShaderSource = options.vertexShaderSource;
+ this._fragmentShaderSource = options.fragmentShaderSource;
+ this._renderState = options.renderState;
+ this._closed = defaultValue_default(options.closed, false);
+}
+Object.defineProperties(Appearance.prototype, {
+ vertexShaderSource: {
+ get: function() {
+ return this._vertexShaderSource;
+ }
+ },
+ fragmentShaderSource: {
+ get: function() {
+ return this._fragmentShaderSource;
+ }
+ },
+ renderState: {
+ get: function() {
+ return this._renderState;
+ }
+ },
+ closed: {
+ get: function() {
+ return this._closed;
+ }
+ }
+});
+Appearance.prototype.getFragmentShaderSource = function() {
+ const parts = [];
+ if (this.flat) {
+ parts.push("#define FLAT");
+ }
+ if (this.faceForward) {
+ parts.push("#define FACE_FORWARD");
+ }
+ if (defined_default(this.material)) {
+ parts.push(this.material.shaderSource);
+ }
+ parts.push(this.fragmentShaderSource);
+ return parts.join("\n");
+};
+Appearance.prototype.isTranslucent = function() {
+ return defined_default(this.material) && this.material.isTranslucent() || !defined_default(this.material) && this.translucent;
+};
+Appearance.prototype.getRenderState = function() {
+ const translucent = this.isTranslucent();
+ const rs = clone_default(this.renderState, false);
+ if (translucent) {
+ rs.depthMask = false;
+ rs.blending = BlendingState_default.ALPHA_BLEND;
+ } else {
+ rs.depthMask = true;
+ }
+ return rs;
+};
+Appearance.getDefaultRenderState = function(translucent, closed, existing) {
+ let rs = {
+ depthTest: {
+ enabled: true
+ }
+ };
+ if (translucent) {
+ rs.depthMask = false;
+ rs.blending = BlendingState_default.ALPHA_BLEND;
+ }
+ if (closed) {
+ rs.cull = {
+ enabled: true,
+ face: CullFace_default.BACK
+ };
+ }
+ if (defined_default(existing)) {
+ rs = combine_default(existing, rs, true);
+ }
+ return rs;
+};
+var Appearance_default = Appearance;
+
+// Source/Shaders/Materials/AspectRampMaterial.js
+var AspectRampMaterial_default = "uniform sampler2D image;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec4 rampColor = texture2D(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));\n rampColor = czm_gammaCorrect(rampColor);\n material.diffuse = rampColor.rgb;\n material.alpha = rampColor.a;\n return material;\n}\n";
+
+// Source/Shaders/Materials/BumpMapMaterial.js
+var BumpMapMaterial_default = "uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n\n vec2 centerPixel = fract(repeat * st);\n float centerBump = texture2D(image, centerPixel).channel;\n\n float imageWidth = float(imageDimensions.x);\n vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\n float rightBump = texture2D(image, rightPixel).channel;\n\n float imageHeight = float(imageDimensions.y);\n vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\n float topBump = texture2D(image, leftPixel).channel;\n\n vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\n vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\n\n material.normal = normalEC;\n material.diffuse = vec3(0.01);\n\n return material;\n}\n";
+
+// Source/Shaders/Materials/CheckerboardMaterial.js
+var CheckerboardMaterial_default = "uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n\n // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\n float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0\n\n // Find the distance from the closest separator (region between two colors)\n float scaledWidth = fract(repeat.s * st.s);\n scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\n float scaledHeight = fract(repeat.t * st.t);\n scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\n float value = min(scaledWidth, scaledHeight);\n\n vec4 currentColor = mix(lightColor, darkColor, b);\n vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\n\n color = czm_gammaCorrect(color);\n material.diffuse = color.rgb;\n material.alpha = color.a;\n\n return material;\n}\n";
+
+// Source/Shaders/Materials/DotMaterial.js
+var DotMaterial_default = "uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights\n float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0\n\n vec4 color = mix(lightColor, darkColor, b);\n color = czm_gammaCorrect(color);\n material.diffuse = color.rgb;\n material.alpha = color.a;\n\n return material;\n}\n";
+
+// Source/Shaders/Materials/ElevationBandMaterial.js
+var ElevationBandMaterial_default = "uniform sampler2D heights;\nuniform sampler2D colors;\n\n// This material expects heights to be sorted from lowest to highest.\n\nfloat getHeight(int idx, float invTexSize)\n{\n vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);\n#ifdef OES_texture_float\n return texture2D(heights, uv).x;\n#else\n return czm_unpackFloat(texture2D(heights, uv));\n#endif\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n float height = materialInput.height;\n float invTexSize = 1.0 / float(heightsDimensions.x);\n\n float minHeight = getHeight(0, invTexSize);\n float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);\n\n // early-out when outside the height range\n if (height < minHeight || height > maxHeight) {\n material.diffuse = vec3(0.0);\n material.alpha = 0.0;\n return material;\n }\n\n // Binary search to find heights above and below.\n int idxBelow = 0;\n int idxAbove = heightsDimensions.x;\n float heightBelow = minHeight;\n float heightAbove = maxHeight;\n\n // while loop not allowed, so use for loop with max iterations.\n // maxIterations of 16 supports a texture size up to 65536 (2^16).\n const int maxIterations = 16;\n for (int i = 0; i < maxIterations; i++) {\n if (idxBelow >= idxAbove - 1) {\n break;\n }\n\n int idxMid = (idxBelow + idxAbove) / 2;\n float heightTex = getHeight(idxMid, invTexSize);\n\n if (height > heightTex) {\n idxBelow = idxMid;\n heightBelow = heightTex;\n } else {\n idxAbove = idxMid;\n heightAbove = heightTex;\n }\n }\n\n float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);\n vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);\n vec4 color = texture2D(colors, colorUv);\n\n // undo preumultiplied alpha\n if (color.a > 0.0) \n {\n color.rgb /= color.a;\n }\n \n color.rgb = czm_gammaCorrect(color.rgb);\n\n material.diffuse = color.rgb;\n material.alpha = color.a;\n return material;\n}\n";
+
+// Source/Shaders/Materials/ElevationContourMaterial.js
+var ElevationContourMaterial_default = "#ifdef GL_OES_standard_derivatives\n #extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec4 color;\nuniform float spacing;\nuniform float width;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n float distanceToContour = mod(materialInput.height, spacing);\n\n#ifdef GL_OES_standard_derivatives\n float dxc = abs(dFdx(materialInput.height));\n float dyc = abs(dFdy(materialInput.height));\n float dF = max(dxc, dyc) * czm_pixelRatio * width;\n float alpha = (distanceToContour < dF) ? 1.0 : 0.0;\n#else\n float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;\n#endif\n\n vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n\n return material;\n}\n";
+
+// Source/Shaders/Materials/ElevationRampMaterial.js
+var ElevationRampMaterial_default = "uniform sampler2D image;\nuniform float minimumHeight;\nuniform float maximumHeight;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\n vec4 rampColor = texture2D(image, vec2(scaledHeight, 0.5));\n rampColor = czm_gammaCorrect(rampColor);\n material.diffuse = rampColor.rgb;\n material.alpha = rampColor.a;\n return material;\n}\n";
+
+// Source/Shaders/Materials/FadeMaterial.js
+var FadeMaterial_default = "uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\n\nfloat getTime(float t, float coord)\n{\n float scalar = 1.0 / maximumDistance;\n float q = distance(t, coord) * scalar;\n if (repeat)\n {\n float r = distance(t, coord + 1.0) * scalar;\n float s = distance(t, coord - 1.0) * scalar;\n q = min(min(r, s), q);\n }\n return clamp(q, 0.0, 1.0);\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n float s = getTime(time.x, st.s) * fadeDirection.s;\n float t = getTime(time.y, st.t) * fadeDirection.t;\n\n float u = length(vec2(s, t));\n vec4 color = mix(fadeInColor, fadeOutColor, u);\n\n color = czm_gammaCorrect(color);\n material.emission = color.rgb;\n material.alpha = color.a;\n\n return material;\n}\n";
+
+// Source/Shaders/Materials/GridMaterial.js
+var GridMaterial_default = '#ifdef GL_OES_standard_derivatives\n #extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n\n float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\n scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\n float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\n scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\n\n float value;\n#ifdef GL_OES_standard_derivatives\n // Fuzz Factor - Controls blurriness of lines\n const float fuzz = 1.2;\n vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;\n\n // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.\n vec2 dx = abs(dFdx(st));\n vec2 dy = abs(dFdy(st));\n vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\n value = min(\n smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\n smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\n // Fuzz Factor - Controls blurriness of lines\n const float fuzz = 0.05;\n\n vec2 range = 0.5 - (lineThickness * 0.05);\n value = min(\n 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\n\n // Edges taken from RimLightingMaterial.glsl\n // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html\n float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\n float sRim = smoothstep(0.8, 1.0, dRim);\n value *= (1.0 - sRim);\n\n vec4 halfColor;\n halfColor.rgb = color.rgb * 0.5;\n halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));\n halfColor = czm_gammaCorrect(halfColor);\n material.diffuse = halfColor.rgb;\n material.emission = halfColor.rgb;\n material.alpha = halfColor.a;\n\n return material;\n}\n';
+
+// Source/Shaders/Materials/NormalMapMaterial.js
+var NormalMapMaterial_default = "uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n \n vec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\n vec3 normalTangentSpace = textureValue.channels;\n normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\n normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\n normalTangentSpace = normalize(normalTangentSpace);\n vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\n \n material.normal = normalEC;\n \n return material;\n}\n";
+
+// Source/Shaders/Materials/PolylineArrowMaterial.js
+var PolylineArrowMaterial_default = "#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\nuniform vec4 color;\n\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\n float slope = (p0.y - p1.y) / (p0.x - p1.x);\n return slope * (x - p0.x) + p0.y;\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n\n#ifdef GL_OES_standard_derivatives\n float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;\n#else\n float base = 0.975; // 2.5% of the line will be the arrow head\n#endif\n\n vec2 center = vec2(1.0, 0.5);\n float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\n float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\n\n float halfWidth = 0.15;\n float s = step(0.5 - halfWidth, st.t);\n s *= 1.0 - step(0.5 + halfWidth, st.t);\n s *= 1.0 - step(base, st.s);\n\n float t = step(base, materialInput.st.s);\n t *= 1.0 - step(ptOnUpperLine, st.t);\n t *= step(ptOnLowerLine, st.t);\n\n // Find the distance from the closest separator (region between two colors)\n float dist;\n if (st.s < base)\n {\n float d1 = abs(st.t - (0.5 - halfWidth));\n float d2 = abs(st.t - (0.5 + halfWidth));\n dist = min(d1, d2);\n }\n else\n {\n float d1 = czm_infinity;\n if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n {\n d1 = abs(st.s - base);\n }\n float d2 = abs(st.t - ptOnUpperLine);\n float d3 = abs(st.t - ptOnLowerLine);\n dist = min(min(d1, d2), d3);\n }\n\n vec4 outsideColor = vec4(0.0);\n vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\n vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\n\n outColor = czm_gammaCorrect(outColor);\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n return material;\n}\n";
+
+// Source/Shaders/Materials/PolylineDashMaterial.js
+var PolylineDashMaterial_default = "uniform vec4 color;\nuniform vec4 gapColor;\nuniform float dashLength;\nuniform float dashPattern;\nvarying float v_polylineAngle;\n\nconst float maskLength = 16.0;\n\nmat2 rotate(float rad) {\n float c = cos(rad);\n float s = sin(rad);\n return mat2(\n c, s,\n -s, c\n );\n}\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;\n\n // Get the relative position within the dash from 0 to 1\n float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));\n // Figure out the mask index.\n float maskIndex = floor(dashPosition * maskLength);\n // Test the bit mask.\n float maskTest = floor(dashPattern / pow(2.0, maskIndex));\n vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\n if (fragColor.a < 0.005) { // matches 0/255 and 1/255\n discard;\n }\n\n fragColor = czm_gammaCorrect(fragColor);\n material.emission = fragColor.rgb;\n material.alpha = fragColor.a;\n return material;\n}\n";
+
+// Source/Shaders/Materials/PolylineGlowMaterial.js
+var PolylineGlowMaterial_default = "uniform vec4 color;\nuniform float glowPower;\nuniform float taperPower;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\n\n if (taperPower <= 0.99999) {\n glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));\n }\n\n vec4 fragColor;\n fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);\n fragColor.a = clamp(0.0, 1.0, glow) * color.a;\n fragColor = czm_gammaCorrect(fragColor);\n\n material.emission = fragColor.rgb;\n material.alpha = fragColor.a;\n\n return material;\n}\n";
+
+// Source/Shaders/Materials/PolylineOutlineMaterial.js
+var PolylineOutlineMaterial_default = "uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\n\nvarying float v_width;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n vec2 st = materialInput.st;\n float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\n float b = step(0.5 - halfInteriorWidth, st.t);\n b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\n\n // Find the distance from the closest separator (region between two colors)\n float d1 = abs(st.t - (0.5 - halfInteriorWidth));\n float d2 = abs(st.t - (0.5 + halfInteriorWidth));\n float dist = min(d1, d2);\n\n vec4 currentColor = mix(outlineColor, color, b);\n vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\n outColor = czm_gammaCorrect(outColor);\n\n material.diffuse = outColor.rgb;\n material.alpha = outColor.a;\n\n return material;\n}\n";
+
+// Source/Shaders/Materials/RimLightingMaterial.js
+var RimLightingMaterial_default = "uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html\n float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\n float s = smoothstep(1.0 - width, 1.0, d);\n\n vec4 outColor = czm_gammaCorrect(color);\n vec4 outRimColor = czm_gammaCorrect(rimColor);\n\n material.diffuse = outColor.rgb;\n material.emission = outRimColor.rgb * s;\n material.alpha = mix(outColor.a, outRimColor.a, s);\n\n return material;\n}\n";
+
+// Source/Shaders/Materials/SlopeRampMaterial.js
+var SlopeRampMaterial_default = "uniform sampler2D image;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec4 rampColor = texture2D(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));\n rampColor = czm_gammaCorrect(rampColor);\n material.diffuse = rampColor.rgb;\n material.alpha = rampColor.a;\n return material;\n}\n";
+
+// Source/Shaders/Materials/StripeMaterial.js
+var StripeMaterial_default = "uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n // Based on the Stripes Fragment Shader in the Orange Book (11.1.2)\n float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\n float value = fract((coord - offset) * (repeat * 0.5));\n float dist = min(value, min(abs(value - 0.5), 1.0 - value));\n\n vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\n vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\n color = czm_gammaCorrect(color);\n\n material.diffuse = color.rgb;\n material.alpha = color.a;\n\n return material;\n}\n";
+
+// Source/Shaders/Materials/Water.js
+var Water_default = "// Thanks for the contribution Jonas\n// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog\n\nuniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\n\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n\n float time = czm_frameNumber * animationSpeed;\n\n // fade is a function of the distance from the fragment and the frequency of the waves\n float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\n\n float specularMapValue = texture2D(specularMap, materialInput.st).r;\n\n // note: not using directional motion at this time, just set the angle to 0.0;\n vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\n vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\n\n // fade out the normal perturbation as we move further from the water surface\n normalTangentSpace.xy /= fade;\n\n // attempt to fade out the normal perturbation as we approach non water areas (low specular map value)\n normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\n\n normalTangentSpace = normalize(normalTangentSpace);\n\n // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane\n float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\n\n // fade out water effect as specular map value decreases\n material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;\n\n // base color is a blend of the water and non-water color based on the value from the specular map\n // may need a uniform blend factor to better control this\n material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\n\n // diffuse highlights are based on how perturbed the normal is\n material.diffuse += (0.1 * tsPerturbationRatio);\n\n material.diffuse = material.diffuse;\n\n material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\n\n material.specular = specularIntensity;\n material.shininess = 10.0;\n\n return material;\n}\n";
+
+// Source/Scene/Material.js
+function Material(options) {
+ this.type = void 0;
+ this.shaderSource = void 0;
+ this.materials = void 0;
+ this.uniforms = void 0;
+ this._uniforms = void 0;
+ this.translucent = void 0;
+ this._minificationFilter = defaultValue_default(
+ options.minificationFilter,
+ TextureMinificationFilter_default.LINEAR
+ );
+ this._magnificationFilter = defaultValue_default(
+ options.magnificationFilter,
+ TextureMagnificationFilter_default.LINEAR
+ );
+ this._strict = void 0;
+ this._template = void 0;
+ this._count = void 0;
+ this._texturePaths = {};
+ this._loadedImages = [];
+ this._loadedCubeMaps = [];
+ this._textures = {};
+ this._updateFunctions = [];
+ this._defaultTexture = void 0;
+ initializeMaterial(options, this);
+ Object.defineProperties(this, {
+ type: {
+ value: this.type,
+ writable: false
+ }
+ });
+ if (!defined_default(Material._uniformList[this.type])) {
+ Material._uniformList[this.type] = Object.keys(this._uniforms);
+ }
+}
+Material._uniformList = {};
+Material.fromType = function(type, uniforms) {
+ if (!defined_default(Material._materialCache.getMaterial(type))) {
+ throw new DeveloperError_default(`material with type '${type}' does not exist.`);
+ }
+ const material = new Material({
+ fabric: {
+ type
+ }
+ });
+ if (defined_default(uniforms)) {
+ for (const name in uniforms) {
+ if (uniforms.hasOwnProperty(name)) {
+ material.uniforms[name] = uniforms[name];
+ }
+ }
+ }
+ return material;
+};
+Material.prototype.isTranslucent = function() {
+ if (defined_default(this.translucent)) {
+ if (typeof this.translucent === "function") {
+ return this.translucent();
+ }
+ return this.translucent;
+ }
+ let translucent = true;
+ const funcs = this._translucentFunctions;
+ const length3 = funcs.length;
+ for (let i = 0; i < length3; ++i) {
+ const func = funcs[i];
+ if (typeof func === "function") {
+ translucent = translucent && func();
+ } else {
+ translucent = translucent && func;
+ }
+ if (!translucent) {
+ break;
+ }
+ }
+ return translucent;
+};
+Material.prototype.update = function(context) {
+ this._defaultTexture = context.defaultTexture;
+ let i;
+ let uniformId;
+ const loadedImages = this._loadedImages;
+ let length3 = loadedImages.length;
+ for (i = 0; i < length3; ++i) {
+ const loadedImage = loadedImages[i];
+ uniformId = loadedImage.id;
+ let image = loadedImage.image;
+ let mipLevels;
+ if (Array.isArray(image)) {
+ mipLevels = image.slice(1, image.length).map(function(mipLevel) {
+ return mipLevel.bufferView;
+ });
+ image = image[0];
+ }
+ const sampler = new Sampler_default({
+ minificationFilter: this._minificationFilter,
+ magnificationFilter: this._magnificationFilter
+ });
+ let texture;
+ if (defined_default(image.internalFormat)) {
+ texture = new Texture_default({
+ context,
+ pixelFormat: image.internalFormat,
+ width: image.width,
+ height: image.height,
+ source: {
+ arrayBufferView: image.bufferView,
+ mipLevels
+ },
+ sampler
+ });
+ } else {
+ texture = new Texture_default({
+ context,
+ source: image,
+ sampler
+ });
+ }
+ const oldTexture = this._textures[uniformId];
+ if (defined_default(oldTexture) && oldTexture !== this._defaultTexture) {
+ oldTexture.destroy();
+ }
+ this._textures[uniformId] = texture;
+ const uniformDimensionsName = `${uniformId}Dimensions`;
+ if (this.uniforms.hasOwnProperty(uniformDimensionsName)) {
+ const uniformDimensions = this.uniforms[uniformDimensionsName];
+ uniformDimensions.x = texture._width;
+ uniformDimensions.y = texture._height;
+ }
+ }
+ loadedImages.length = 0;
+ const loadedCubeMaps = this._loadedCubeMaps;
+ length3 = loadedCubeMaps.length;
+ for (i = 0; i < length3; ++i) {
+ const loadedCubeMap = loadedCubeMaps[i];
+ uniformId = loadedCubeMap.id;
+ const images = loadedCubeMap.images;
+ const cubeMap = new CubeMap_default({
+ context,
+ source: {
+ positiveX: images[0],
+ negativeX: images[1],
+ positiveY: images[2],
+ negativeY: images[3],
+ positiveZ: images[4],
+ negativeZ: images[5]
+ },
+ sampler: new Sampler_default({
+ minificationFilter: this._minificationFilter,
+ magnificationFilter: this._magnificationFilter
+ })
+ });
+ this._textures[uniformId] = cubeMap;
+ }
+ loadedCubeMaps.length = 0;
+ const updateFunctions2 = this._updateFunctions;
+ length3 = updateFunctions2.length;
+ for (i = 0; i < length3; ++i) {
+ updateFunctions2[i](this, context);
+ }
+ const subMaterials = this.materials;
+ for (const name in subMaterials) {
+ if (subMaterials.hasOwnProperty(name)) {
+ subMaterials[name].update(context);
+ }
+ }
+};
+Material.prototype.isDestroyed = function() {
+ return false;
+};
+Material.prototype.destroy = function() {
+ const textures = this._textures;
+ for (const texture in textures) {
+ if (textures.hasOwnProperty(texture)) {
+ const instance = textures[texture];
+ if (instance !== this._defaultTexture) {
+ instance.destroy();
+ }
+ }
+ }
+ const materials = this.materials;
+ for (const material in materials) {
+ if (materials.hasOwnProperty(material)) {
+ materials[material].destroy();
+ }
+ }
+ return destroyObject_default(this);
+};
+function initializeMaterial(options, result) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ result._strict = defaultValue_default(options.strict, false);
+ result._count = defaultValue_default(options.count, 0);
+ result._template = clone_default(
+ defaultValue_default(options.fabric, defaultValue_default.EMPTY_OBJECT)
+ );
+ result._template.uniforms = clone_default(
+ defaultValue_default(result._template.uniforms, defaultValue_default.EMPTY_OBJECT)
+ );
+ result._template.materials = clone_default(
+ defaultValue_default(result._template.materials, defaultValue_default.EMPTY_OBJECT)
+ );
+ result.type = defined_default(result._template.type) ? result._template.type : createGuid_default();
+ result.shaderSource = "";
+ result.materials = {};
+ result.uniforms = {};
+ result._uniforms = {};
+ result._translucentFunctions = [];
+ let translucent;
+ const cachedMaterial = Material._materialCache.getMaterial(result.type);
+ if (defined_default(cachedMaterial)) {
+ const template = clone_default(cachedMaterial.fabric, true);
+ result._template = combine_default(result._template, template, true);
+ translucent = cachedMaterial.translucent;
+ }
+ checkForTemplateErrors(result);
+ if (!defined_default(cachedMaterial)) {
+ Material._materialCache.addMaterial(result.type, result);
+ }
+ createMethodDefinition(result);
+ createUniforms(result);
+ createSubMaterials(result);
+ const defaultTranslucent = result._translucentFunctions.length === 0 ? true : void 0;
+ translucent = defaultValue_default(translucent, defaultTranslucent);
+ translucent = defaultValue_default(options.translucent, translucent);
+ if (defined_default(translucent)) {
+ if (typeof translucent === "function") {
+ const wrappedTranslucent = function() {
+ return translucent(result);
+ };
+ result._translucentFunctions.push(wrappedTranslucent);
+ } else {
+ result._translucentFunctions.push(translucent);
+ }
+ }
+}
+function checkForValidProperties(object2, properties, result, throwNotFound) {
+ if (defined_default(object2)) {
+ for (const property in object2) {
+ if (object2.hasOwnProperty(property)) {
+ const hasProperty = properties.indexOf(property) !== -1;
+ if (throwNotFound && !hasProperty || !throwNotFound && hasProperty) {
+ result(property, properties);
+ }
+ }
+ }
+ }
+}
+function invalidNameError(property, properties) {
+ let errorString = `fabric: property name '${property}' is not valid. It should be `;
+ for (let i = 0; i < properties.length; i++) {
+ const propertyName = `'${properties[i]}'`;
+ errorString += i === properties.length - 1 ? `or ${propertyName}.` : `${propertyName}, `;
+ }
+ throw new DeveloperError_default(errorString);
+}
+function duplicateNameError(property, properties) {
+ const errorString = `fabric: uniforms and materials cannot share the same property '${property}'`;
+ throw new DeveloperError_default(errorString);
+}
+var templateProperties = [
+ "type",
+ "materials",
+ "uniforms",
+ "components",
+ "source"
+];
+var componentProperties = [
+ "diffuse",
+ "specular",
+ "shininess",
+ "normal",
+ "emission",
+ "alpha"
+];
+function checkForTemplateErrors(material) {
+ const template = material._template;
+ const uniforms = template.uniforms;
+ const materials = template.materials;
+ const components = template.components;
+ if (defined_default(components) && defined_default(template.source)) {
+ throw new DeveloperError_default(
+ "fabric: cannot have source and components in the same template."
+ );
+ }
+ checkForValidProperties(template, templateProperties, invalidNameError, true);
+ checkForValidProperties(
+ components,
+ componentProperties,
+ invalidNameError,
+ true
+ );
+ const materialNames = [];
+ for (const property in materials) {
+ if (materials.hasOwnProperty(property)) {
+ materialNames.push(property);
+ }
+ }
+ checkForValidProperties(uniforms, materialNames, duplicateNameError, false);
+}
+function isMaterialFused(shaderComponent, material) {
+ const materials = material._template.materials;
+ for (const subMaterialId in materials) {
+ if (materials.hasOwnProperty(subMaterialId)) {
+ if (shaderComponent.indexOf(subMaterialId) > -1) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+function createMethodDefinition(material) {
+ const components = material._template.components;
+ const source = material._template.source;
+ if (defined_default(source)) {
+ material.shaderSource += `${source}
+`;
+ } else {
+ material.shaderSource += "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n";
+ material.shaderSource += "czm_material material = czm_getDefaultMaterial(materialInput);\n";
+ if (defined_default(components)) {
+ const isMultiMaterial = Object.keys(material._template.materials).length > 0;
+ for (const component in components) {
+ if (components.hasOwnProperty(component)) {
+ if (component === "diffuse" || component === "emission") {
+ const isFusion = isMultiMaterial && isMaterialFused(components[component], material);
+ const componentSource = isFusion ? components[component] : `czm_gammaCorrect(${components[component]})`;
+ material.shaderSource += `material.${component} = ${componentSource};
+`;
+ } else if (component === "alpha") {
+ material.shaderSource += `material.alpha = ${components.alpha};
+`;
+ } else {
+ material.shaderSource += `material.${component} = ${components[component]};
+`;
+ }
+ }
+ }
+ }
+ material.shaderSource += "return material;\n}\n";
+ }
+}
+var matrixMap = {
+ mat2: Matrix2_default,
+ mat3: Matrix3_default,
+ mat4: Matrix4_default
+};
+var ktx2Regex = /\.ktx2$/i;
+function createTexture2DUpdateFunction(uniformId) {
+ let oldUniformValue;
+ return function(material, context) {
+ const uniforms = material.uniforms;
+ const uniformValue = uniforms[uniformId];
+ const uniformChanged = oldUniformValue !== uniformValue;
+ const uniformValueIsDefaultImage = !defined_default(uniformValue) || uniformValue === Material.DefaultImageId;
+ oldUniformValue = uniformValue;
+ let texture = material._textures[uniformId];
+ let uniformDimensionsName;
+ let uniformDimensions;
+ if (uniformValue instanceof HTMLVideoElement) {
+ if (uniformValue.readyState >= 2) {
+ if (uniformChanged && defined_default(texture)) {
+ if (texture !== context.defaultTexture) {
+ texture.destroy();
+ }
+ texture = void 0;
+ }
+ if (!defined_default(texture) || texture === context.defaultTexture) {
+ const sampler = new Sampler_default({
+ minificationFilter: material._minificationFilter,
+ magnificationFilter: material._magnificationFilter
+ });
+ texture = new Texture_default({
+ context,
+ source: uniformValue,
+ sampler
+ });
+ material._textures[uniformId] = texture;
+ return;
+ }
+ texture.copyFrom({
+ source: uniformValue
+ });
+ } else if (!defined_default(texture)) {
+ material._textures[uniformId] = context.defaultTexture;
+ }
+ return;
+ }
+ if (uniformValue instanceof Texture_default && uniformValue !== texture) {
+ material._texturePaths[uniformId] = void 0;
+ const tmp2 = material._textures[uniformId];
+ if (defined_default(tmp2) && tmp2 !== material._defaultTexture) {
+ tmp2.destroy();
+ }
+ material._textures[uniformId] = uniformValue;
+ uniformDimensionsName = `${uniformId}Dimensions`;
+ if (uniforms.hasOwnProperty(uniformDimensionsName)) {
+ uniformDimensions = uniforms[uniformDimensionsName];
+ uniformDimensions.x = uniformValue._width;
+ uniformDimensions.y = uniformValue._height;
+ }
+ return;
+ }
+ if (uniformChanged && defined_default(texture) && uniformValueIsDefaultImage) {
+ if (texture !== material._defaultTexture) {
+ texture.destroy();
+ }
+ texture = void 0;
+ }
+ if (!defined_default(texture)) {
+ material._texturePaths[uniformId] = void 0;
+ texture = material._textures[uniformId] = material._defaultTexture;
+ uniformDimensionsName = `${uniformId}Dimensions`;
+ if (uniforms.hasOwnProperty(uniformDimensionsName)) {
+ uniformDimensions = uniforms[uniformDimensionsName];
+ uniformDimensions.x = texture._width;
+ uniformDimensions.y = texture._height;
+ }
+ }
+ if (uniformValueIsDefaultImage) {
+ return;
+ }
+ const isResource = uniformValue instanceof Resource_default;
+ if (!defined_default(material._texturePaths[uniformId]) || isResource && uniformValue.url !== material._texturePaths[uniformId].url || !isResource && uniformValue !== material._texturePaths[uniformId]) {
+ if (typeof uniformValue === "string" || isResource) {
+ const resource = isResource ? uniformValue : Resource_default.createIfNeeded(uniformValue);
+ let promise;
+ if (ktx2Regex.test(resource.url)) {
+ promise = loadKTX2_default(resource.url);
+ } else {
+ promise = resource.fetchImage();
+ }
+ Promise.resolve(promise).then(function(image) {
+ material._loadedImages.push({
+ id: uniformId,
+ image
+ });
+ }).catch(function() {
+ if (defined_default(texture) && texture !== material._defaultTexture) {
+ texture.destroy();
+ }
+ material._textures[uniformId] = material._defaultTexture;
+ });
+ } else if (uniformValue instanceof HTMLCanvasElement || uniformValue instanceof HTMLImageElement) {
+ material._loadedImages.push({
+ id: uniformId,
+ image: uniformValue
+ });
+ }
+ material._texturePaths[uniformId] = uniformValue;
+ }
+ };
+}
+function createCubeMapUpdateFunction(uniformId) {
+ return function(material, context) {
+ const uniformValue = material.uniforms[uniformId];
+ if (uniformValue instanceof CubeMap_default) {
+ const tmp2 = material._textures[uniformId];
+ if (tmp2 !== material._defaultTexture) {
+ tmp2.destroy();
+ }
+ material._texturePaths[uniformId] = void 0;
+ material._textures[uniformId] = uniformValue;
+ return;
+ }
+ if (!defined_default(material._textures[uniformId])) {
+ material._texturePaths[uniformId] = void 0;
+ material._textures[uniformId] = context.defaultCubeMap;
+ }
+ if (uniformValue === Material.DefaultCubeMapId) {
+ return;
+ }
+ const path = uniformValue.positiveX + uniformValue.negativeX + uniformValue.positiveY + uniformValue.negativeY + uniformValue.positiveZ + uniformValue.negativeZ;
+ if (path !== material._texturePaths[uniformId]) {
+ const promises = [
+ Resource_default.createIfNeeded(uniformValue.positiveX).fetchImage(),
+ Resource_default.createIfNeeded(uniformValue.negativeX).fetchImage(),
+ Resource_default.createIfNeeded(uniformValue.positiveY).fetchImage(),
+ Resource_default.createIfNeeded(uniformValue.negativeY).fetchImage(),
+ Resource_default.createIfNeeded(uniformValue.positiveZ).fetchImage(),
+ Resource_default.createIfNeeded(uniformValue.negativeZ).fetchImage()
+ ];
+ Promise.all(promises).then(function(images) {
+ material._loadedCubeMaps.push({
+ id: uniformId,
+ images
+ });
+ });
+ material._texturePaths[uniformId] = path;
+ }
+ };
+}
+function createUniforms(material) {
+ const uniforms = material._template.uniforms;
+ for (const uniformId in uniforms) {
+ if (uniforms.hasOwnProperty(uniformId)) {
+ createUniform2(material, uniformId);
+ }
+ }
+}
+function createUniform2(material, uniformId) {
+ const strict = material._strict;
+ const materialUniforms = material._template.uniforms;
+ const uniformValue = materialUniforms[uniformId];
+ const uniformType = getUniformType(uniformValue);
+ if (!defined_default(uniformType)) {
+ throw new DeveloperError_default(
+ `fabric: uniform '${uniformId}' has invalid type.`
+ );
+ }
+ let replacedTokenCount;
+ if (uniformType === "channels") {
+ replacedTokenCount = replaceToken(material, uniformId, uniformValue, false);
+ if (replacedTokenCount === 0 && strict) {
+ throw new DeveloperError_default(
+ `strict: shader source does not use channels '${uniformId}'.`
+ );
+ }
+ } else {
+ if (uniformType === "sampler2D") {
+ const imageDimensionsUniformName = `${uniformId}Dimensions`;
+ if (getNumberOfTokens(material, imageDimensionsUniformName) > 0) {
+ materialUniforms[imageDimensionsUniformName] = {
+ type: "ivec3",
+ x: 1,
+ y: 1
+ };
+ createUniform2(material, imageDimensionsUniformName);
+ }
+ }
+ const uniformDeclarationRegex = new RegExp(
+ `uniform\\s+${uniformType}\\s+${uniformId}\\s*;`
+ );
+ if (!uniformDeclarationRegex.test(material.shaderSource)) {
+ const uniformDeclaration = `uniform ${uniformType} ${uniformId};`;
+ material.shaderSource = uniformDeclaration + material.shaderSource;
+ }
+ const newUniformId = `${uniformId}_${material._count++}`;
+ replacedTokenCount = replaceToken(material, uniformId, newUniformId);
+ if (replacedTokenCount === 1 && strict) {
+ throw new DeveloperError_default(
+ `strict: shader source does not use uniform '${uniformId}'.`
+ );
+ }
+ material.uniforms[uniformId] = uniformValue;
+ if (uniformType === "sampler2D") {
+ material._uniforms[newUniformId] = function() {
+ return material._textures[uniformId];
+ };
+ material._updateFunctions.push(createTexture2DUpdateFunction(uniformId));
+ } else if (uniformType === "samplerCube") {
+ material._uniforms[newUniformId] = function() {
+ return material._textures[uniformId];
+ };
+ material._updateFunctions.push(createCubeMapUpdateFunction(uniformId));
+ } else if (uniformType.indexOf("mat") !== -1) {
+ const scratchMatrix6 = new matrixMap[uniformType]();
+ material._uniforms[newUniformId] = function() {
+ return matrixMap[uniformType].fromColumnMajorArray(
+ material.uniforms[uniformId],
+ scratchMatrix6
+ );
+ };
+ } else {
+ material._uniforms[newUniformId] = function() {
+ return material.uniforms[uniformId];
+ };
+ }
+ }
+}
+function getUniformType(uniformValue) {
+ let uniformType = uniformValue.type;
+ if (!defined_default(uniformType)) {
+ const type = typeof uniformValue;
+ if (type === "number") {
+ uniformType = "float";
+ } else if (type === "boolean") {
+ uniformType = "bool";
+ } else if (type === "string" || uniformValue instanceof Resource_default || uniformValue instanceof HTMLCanvasElement || uniformValue instanceof HTMLImageElement) {
+ if (/^([rgba]){1,4}$/i.test(uniformValue)) {
+ uniformType = "channels";
+ } else if (uniformValue === Material.DefaultCubeMapId) {
+ uniformType = "samplerCube";
+ } else {
+ uniformType = "sampler2D";
+ }
+ } else if (type === "object") {
+ if (Array.isArray(uniformValue)) {
+ if (uniformValue.length === 4 || uniformValue.length === 9 || uniformValue.length === 16) {
+ uniformType = `mat${Math.sqrt(uniformValue.length)}`;
+ }
+ } else {
+ let numAttributes = 0;
+ for (const attribute in uniformValue) {
+ if (uniformValue.hasOwnProperty(attribute)) {
+ numAttributes += 1;
+ }
+ }
+ if (numAttributes >= 2 && numAttributes <= 4) {
+ uniformType = `vec${numAttributes}`;
+ } else if (numAttributes === 6) {
+ uniformType = "samplerCube";
+ }
+ }
+ }
+ }
+ return uniformType;
+}
+function createSubMaterials(material) {
+ const strict = material._strict;
+ const subMaterialTemplates = material._template.materials;
+ for (const subMaterialId in subMaterialTemplates) {
+ if (subMaterialTemplates.hasOwnProperty(subMaterialId)) {
+ const subMaterial = new Material({
+ strict,
+ fabric: subMaterialTemplates[subMaterialId],
+ count: material._count
+ });
+ material._count = subMaterial._count;
+ material._uniforms = combine_default(
+ material._uniforms,
+ subMaterial._uniforms,
+ true
+ );
+ material.materials[subMaterialId] = subMaterial;
+ material._translucentFunctions = material._translucentFunctions.concat(
+ subMaterial._translucentFunctions
+ );
+ const originalMethodName = "czm_getMaterial";
+ const newMethodName = `${originalMethodName}_${material._count++}`;
+ replaceToken(subMaterial, originalMethodName, newMethodName);
+ material.shaderSource = subMaterial.shaderSource + material.shaderSource;
+ const materialMethodCall = `${newMethodName}(materialInput)`;
+ const tokensReplacedCount = replaceToken(
+ material,
+ subMaterialId,
+ materialMethodCall
+ );
+ if (tokensReplacedCount === 0 && strict) {
+ throw new DeveloperError_default(
+ `strict: shader source does not use material '${subMaterialId}'.`
+ );
+ }
+ }
+ }
+}
+function replaceToken(material, token, newToken, excludePeriod) {
+ excludePeriod = defaultValue_default(excludePeriod, true);
+ let count = 0;
+ const suffixChars = "([\\w])?";
+ const prefixChars = `([\\w${excludePeriod ? "." : ""}])?`;
+ const regExp = new RegExp(prefixChars + token + suffixChars, "g");
+ material.shaderSource = material.shaderSource.replace(regExp, function($0, $1, $2) {
+ if ($1 || $2) {
+ return $0;
+ }
+ count += 1;
+ return newToken;
+ });
+ return count;
+}
+function getNumberOfTokens(material, token, excludePeriod) {
+ return replaceToken(material, token, token, excludePeriod);
+}
+Material._materialCache = {
+ _materials: {},
+ addMaterial: function(type, materialTemplate) {
+ this._materials[type] = materialTemplate;
+ },
+ getMaterial: function(type) {
+ return this._materials[type];
+ }
+};
+Material.DefaultImageId = "czm_defaultImage";
+Material.DefaultCubeMapId = "czm_defaultCubeMap";
+Material.ColorType = "Color";
+Material._materialCache.addMaterial(Material.ColorType, {
+ fabric: {
+ type: Material.ColorType,
+ uniforms: {
+ color: new Color_default(1, 0, 0, 0.5)
+ },
+ components: {
+ diffuse: "color.rgb",
+ alpha: "color.a"
+ }
+ },
+ translucent: function(material) {
+ return material.uniforms.color.alpha < 1;
+ }
+});
+Material.ImageType = "Image";
+Material._materialCache.addMaterial(Material.ImageType, {
+ fabric: {
+ type: Material.ImageType,
+ uniforms: {
+ image: Material.DefaultImageId,
+ repeat: new Cartesian2_default(1, 1),
+ color: new Color_default(1, 1, 1, 1)
+ },
+ components: {
+ diffuse: "texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb",
+ alpha: "texture2D(image, fract(repeat * materialInput.st)).a * color.a"
+ }
+ },
+ translucent: function(material) {
+ return material.uniforms.color.alpha < 1;
+ }
+});
+Material.DiffuseMapType = "DiffuseMap";
+Material._materialCache.addMaterial(Material.DiffuseMapType, {
+ fabric: {
+ type: Material.DiffuseMapType,
+ uniforms: {
+ image: Material.DefaultImageId,
+ channels: "rgb",
+ repeat: new Cartesian2_default(1, 1)
+ },
+ components: {
+ diffuse: "texture2D(image, fract(repeat * materialInput.st)).channels"
+ }
+ },
+ translucent: false
+});
+Material.AlphaMapType = "AlphaMap";
+Material._materialCache.addMaterial(Material.AlphaMapType, {
+ fabric: {
+ type: Material.AlphaMapType,
+ uniforms: {
+ image: Material.DefaultImageId,
+ channel: "a",
+ repeat: new Cartesian2_default(1, 1)
+ },
+ components: {
+ alpha: "texture2D(image, fract(repeat * materialInput.st)).channel"
+ }
+ },
+ translucent: true
+});
+Material.SpecularMapType = "SpecularMap";
+Material._materialCache.addMaterial(Material.SpecularMapType, {
+ fabric: {
+ type: Material.SpecularMapType,
+ uniforms: {
+ image: Material.DefaultImageId,
+ channel: "r",
+ repeat: new Cartesian2_default(1, 1)
+ },
+ components: {
+ specular: "texture2D(image, fract(repeat * materialInput.st)).channel"
+ }
+ },
+ translucent: false
+});
+Material.EmissionMapType = "EmissionMap";
+Material._materialCache.addMaterial(Material.EmissionMapType, {
+ fabric: {
+ type: Material.EmissionMapType,
+ uniforms: {
+ image: Material.DefaultImageId,
+ channels: "rgb",
+ repeat: new Cartesian2_default(1, 1)
+ },
+ components: {
+ emission: "texture2D(image, fract(repeat * materialInput.st)).channels"
+ }
+ },
+ translucent: false
+});
+Material.BumpMapType = "BumpMap";
+Material._materialCache.addMaterial(Material.BumpMapType, {
+ fabric: {
+ type: Material.BumpMapType,
+ uniforms: {
+ image: Material.DefaultImageId,
+ channel: "r",
+ strength: 0.8,
+ repeat: new Cartesian2_default(1, 1)
+ },
+ source: BumpMapMaterial_default
+ },
+ translucent: false
+});
+Material.NormalMapType = "NormalMap";
+Material._materialCache.addMaterial(Material.NormalMapType, {
+ fabric: {
+ type: Material.NormalMapType,
+ uniforms: {
+ image: Material.DefaultImageId,
+ channels: "rgb",
+ strength: 0.8,
+ repeat: new Cartesian2_default(1, 1)
+ },
+ source: NormalMapMaterial_default
+ },
+ translucent: false
+});
+Material.GridType = "Grid";
+Material._materialCache.addMaterial(Material.GridType, {
+ fabric: {
+ type: Material.GridType,
+ uniforms: {
+ color: new Color_default(0, 1, 0, 1),
+ cellAlpha: 0.1,
+ lineCount: new Cartesian2_default(8, 8),
+ lineThickness: new Cartesian2_default(1, 1),
+ lineOffset: new Cartesian2_default(0, 0)
+ },
+ source: GridMaterial_default
+ },
+ translucent: function(material) {
+ const uniforms = material.uniforms;
+ return uniforms.color.alpha < 1 || uniforms.cellAlpha < 1;
+ }
+});
+Material.StripeType = "Stripe";
+Material._materialCache.addMaterial(Material.StripeType, {
+ fabric: {
+ type: Material.StripeType,
+ uniforms: {
+ horizontal: true,
+ evenColor: new Color_default(1, 1, 1, 0.5),
+ oddColor: new Color_default(0, 0, 1, 0.5),
+ offset: 0,
+ repeat: 5
+ },
+ source: StripeMaterial_default
+ },
+ translucent: function(material) {
+ const uniforms = material.uniforms;
+ return uniforms.evenColor.alpha < 1 || uniforms.oddColor.alpha < 1;
+ }
+});
+Material.CheckerboardType = "Checkerboard";
+Material._materialCache.addMaterial(Material.CheckerboardType, {
+ fabric: {
+ type: Material.CheckerboardType,
+ uniforms: {
+ lightColor: new Color_default(1, 1, 1, 0.5),
+ darkColor: new Color_default(0, 0, 0, 0.5),
+ repeat: new Cartesian2_default(5, 5)
+ },
+ source: CheckerboardMaterial_default
+ },
+ translucent: function(material) {
+ const uniforms = material.uniforms;
+ return uniforms.lightColor.alpha < 1 || uniforms.darkColor.alpha < 1;
+ }
+});
+Material.DotType = "Dot";
+Material._materialCache.addMaterial(Material.DotType, {
+ fabric: {
+ type: Material.DotType,
+ uniforms: {
+ lightColor: new Color_default(1, 1, 0, 0.75),
+ darkColor: new Color_default(0, 1, 1, 0.75),
+ repeat: new Cartesian2_default(5, 5)
+ },
+ source: DotMaterial_default
+ },
+ translucent: function(material) {
+ const uniforms = material.uniforms;
+ return uniforms.lightColor.alpha < 1 || uniforms.darkColor.alpha < 1;
+ }
+});
+Material.WaterType = "Water";
+Material._materialCache.addMaterial(Material.WaterType, {
+ fabric: {
+ type: Material.WaterType,
+ uniforms: {
+ baseWaterColor: new Color_default(0.2, 0.3, 0.6, 1),
+ blendColor: new Color_default(0, 1, 0.699, 1),
+ specularMap: Material.DefaultImageId,
+ normalMap: Material.DefaultImageId,
+ frequency: 10,
+ animationSpeed: 0.01,
+ amplitude: 1,
+ specularIntensity: 0.5,
+ fadeFactor: 1
+ },
+ source: Water_default
+ },
+ translucent: function(material) {
+ const uniforms = material.uniforms;
+ return uniforms.baseWaterColor.alpha < 1 || uniforms.blendColor.alpha < 1;
+ }
+});
+Material.RimLightingType = "RimLighting";
+Material._materialCache.addMaterial(Material.RimLightingType, {
+ fabric: {
+ type: Material.RimLightingType,
+ uniforms: {
+ color: new Color_default(1, 0, 0, 0.7),
+ rimColor: new Color_default(1, 1, 1, 0.4),
+ width: 0.3
+ },
+ source: RimLightingMaterial_default
+ },
+ translucent: function(material) {
+ const uniforms = material.uniforms;
+ return uniforms.color.alpha < 1 || uniforms.rimColor.alpha < 1;
+ }
+});
+Material.FadeType = "Fade";
+Material._materialCache.addMaterial(Material.FadeType, {
+ fabric: {
+ type: Material.FadeType,
+ uniforms: {
+ fadeInColor: new Color_default(1, 0, 0, 1),
+ fadeOutColor: new Color_default(0, 0, 0, 0),
+ maximumDistance: 0.5,
+ repeat: true,
+ fadeDirection: {
+ x: true,
+ y: true
+ },
+ time: new Cartesian2_default(0.5, 0.5)
+ },
+ source: FadeMaterial_default
+ },
+ translucent: function(material) {
+ const uniforms = material.uniforms;
+ return uniforms.fadeInColor.alpha < 1 || uniforms.fadeOutColor.alpha < 1;
+ }
+});
+Material.PolylineArrowType = "PolylineArrow";
+Material._materialCache.addMaterial(Material.PolylineArrowType, {
+ fabric: {
+ type: Material.PolylineArrowType,
+ uniforms: {
+ color: new Color_default(1, 1, 1, 1)
+ },
+ source: PolylineArrowMaterial_default
+ },
+ translucent: true
+});
+Material.PolylineDashType = "PolylineDash";
+Material._materialCache.addMaterial(Material.PolylineDashType, {
+ fabric: {
+ type: Material.PolylineDashType,
+ uniforms: {
+ color: new Color_default(1, 0, 1, 1),
+ gapColor: new Color_default(0, 0, 0, 0),
+ dashLength: 16,
+ dashPattern: 255
+ },
+ source: PolylineDashMaterial_default
+ },
+ translucent: true
+});
+Material.PolylineGlowType = "PolylineGlow";
+Material._materialCache.addMaterial(Material.PolylineGlowType, {
+ fabric: {
+ type: Material.PolylineGlowType,
+ uniforms: {
+ color: new Color_default(0, 0.5, 1, 1),
+ glowPower: 0.25,
+ taperPower: 1
+ },
+ source: PolylineGlowMaterial_default
+ },
+ translucent: true
+});
+Material.PolylineOutlineType = "PolylineOutline";
+Material._materialCache.addMaterial(Material.PolylineOutlineType, {
+ fabric: {
+ type: Material.PolylineOutlineType,
+ uniforms: {
+ color: new Color_default(1, 1, 1, 1),
+ outlineColor: new Color_default(1, 0, 0, 1),
+ outlineWidth: 1
+ },
+ source: PolylineOutlineMaterial_default
+ },
+ translucent: function(material) {
+ const uniforms = material.uniforms;
+ return uniforms.color.alpha < 1 || uniforms.outlineColor.alpha < 1;
+ }
+});
+Material.ElevationContourType = "ElevationContour";
+Material._materialCache.addMaterial(Material.ElevationContourType, {
+ fabric: {
+ type: Material.ElevationContourType,
+ uniforms: {
+ spacing: 100,
+ color: new Color_default(1, 0, 0, 1),
+ width: 1
+ },
+ source: ElevationContourMaterial_default
+ },
+ translucent: false
+});
+Material.ElevationRampType = "ElevationRamp";
+Material._materialCache.addMaterial(Material.ElevationRampType, {
+ fabric: {
+ type: Material.ElevationRampType,
+ uniforms: {
+ image: Material.DefaultImageId,
+ minimumHeight: 0,
+ maximumHeight: 1e4
+ },
+ source: ElevationRampMaterial_default
+ },
+ translucent: false
+});
+Material.SlopeRampMaterialType = "SlopeRamp";
+Material._materialCache.addMaterial(Material.SlopeRampMaterialType, {
+ fabric: {
+ type: Material.SlopeRampMaterialType,
+ uniforms: {
+ image: Material.DefaultImageId
+ },
+ source: SlopeRampMaterial_default
+ },
+ translucent: false
+});
+Material.AspectRampMaterialType = "AspectRamp";
+Material._materialCache.addMaterial(Material.AspectRampMaterialType, {
+ fabric: {
+ type: Material.AspectRampMaterialType,
+ uniforms: {
+ image: Material.DefaultImageId
+ },
+ source: AspectRampMaterial_default
+ },
+ translucent: false
+});
+Material.ElevationBandType = "ElevationBand";
+Material._materialCache.addMaterial(Material.ElevationBandType, {
+ fabric: {
+ type: Material.ElevationBandType,
+ uniforms: {
+ heights: Material.DefaultImageId,
+ colors: Material.DefaultImageId
+ },
+ source: ElevationBandMaterial_default
+ },
+ translucent: true
+});
+var Material_default = Material;
+
+// Source/Scene/MaterialAppearance.js
+function MaterialAppearance(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const translucent = defaultValue_default(options.translucent, true);
+ const closed = defaultValue_default(options.closed, false);
+ const materialSupport = defaultValue_default(
+ options.materialSupport,
+ MaterialAppearance.MaterialSupport.TEXTURED
+ );
+ this.material = defined_default(options.material) ? options.material : Material_default.fromType(Material_default.ColorType);
+ this.translucent = translucent;
+ this._vertexShaderSource = defaultValue_default(
+ options.vertexShaderSource,
+ materialSupport.vertexShaderSource
+ );
+ this._fragmentShaderSource = defaultValue_default(
+ options.fragmentShaderSource,
+ materialSupport.fragmentShaderSource
+ );
+ this._renderState = Appearance_default.getDefaultRenderState(
+ translucent,
+ closed,
+ options.renderState
+ );
+ this._closed = closed;
+ this._materialSupport = materialSupport;
+ this._vertexFormat = materialSupport.vertexFormat;
+ this._flat = defaultValue_default(options.flat, false);
+ this._faceForward = defaultValue_default(options.faceForward, !closed);
+}
+Object.defineProperties(MaterialAppearance.prototype, {
+ vertexShaderSource: {
+ get: function() {
+ return this._vertexShaderSource;
+ }
+ },
+ fragmentShaderSource: {
+ get: function() {
+ return this._fragmentShaderSource;
+ }
+ },
+ renderState: {
+ get: function() {
+ return this._renderState;
+ }
+ },
+ closed: {
+ get: function() {
+ return this._closed;
+ }
+ },
+ materialSupport: {
+ get: function() {
+ return this._materialSupport;
+ }
+ },
+ vertexFormat: {
+ get: function() {
+ return this._vertexFormat;
+ }
+ },
+ flat: {
+ get: function() {
+ return this._flat;
+ }
+ },
+ faceForward: {
+ get: function() {
+ return this._faceForward;
+ }
+ }
+});
+MaterialAppearance.prototype.getFragmentShaderSource = Appearance_default.prototype.getFragmentShaderSource;
+MaterialAppearance.prototype.isTranslucent = Appearance_default.prototype.isTranslucent;
+MaterialAppearance.prototype.getRenderState = Appearance_default.prototype.getRenderState;
+MaterialAppearance.MaterialSupport = {
+ BASIC: Object.freeze({
+ vertexFormat: VertexFormat_default.POSITION_AND_NORMAL,
+ vertexShaderSource: BasicMaterialAppearanceVS_default,
+ fragmentShaderSource: BasicMaterialAppearanceFS_default
+ }),
+ TEXTURED: Object.freeze({
+ vertexFormat: VertexFormat_default.POSITION_NORMAL_AND_ST,
+ vertexShaderSource: TexturedMaterialAppearanceVS_default,
+ fragmentShaderSource: TexturedMaterialAppearanceFS_default
+ }),
+ ALL: Object.freeze({
+ vertexFormat: VertexFormat_default.ALL,
+ vertexShaderSource: AllMaterialAppearanceVS_default,
+ fragmentShaderSource: AllMaterialAppearanceFS_default
+ })
+};
+var MaterialAppearance_default = MaterialAppearance;
+
+// Source/Shaders/Appearances/PerInstanceColorAppearanceFS.js
+var PerInstanceColorAppearanceFS_default = "varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\n\nvoid main()\n{\n vec3 positionToEyeEC = -v_positionEC;\n\n vec3 normalEC = normalize(v_normalEC);\n#ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n#endif\n\n vec4 color = czm_gammaCorrect(v_color);\n\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n material.alpha = color.a;\n\n gl_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n}\n";
+
+// Source/Shaders/Appearances/PerInstanceColorAppearanceVS.js
+var PerInstanceColorAppearanceVS_default = "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nattribute float batchId;\n\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\n\nvoid main()\n{\n vec4 p = czm_computePosition();\n\n v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates\n v_normalEC = czm_normal * normal; // normal in eye coordinates\n v_color = color;\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";
+
+// Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js
+var PerInstanceFlatColorAppearanceFS_default = "varying vec4 v_color;\n\nvoid main()\n{\n gl_FragColor = czm_gammaCorrect(v_color);\n}\n";
+
+// Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js
+var PerInstanceFlatColorAppearanceVS_default = "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nattribute float batchId;\n\nvarying vec4 v_color;\n\nvoid main()\n{\n vec4 p = czm_computePosition();\n\n v_color = color;\n\n gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n";
+
+// Source/Scene/PerInstanceColorAppearance.js
+function PerInstanceColorAppearance(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const translucent = defaultValue_default(options.translucent, true);
+ const closed = defaultValue_default(options.closed, false);
+ const flat = defaultValue_default(options.flat, false);
+ const vs = flat ? PerInstanceFlatColorAppearanceVS_default : PerInstanceColorAppearanceVS_default;
+ const fs = flat ? PerInstanceFlatColorAppearanceFS_default : PerInstanceColorAppearanceFS_default;
+ const vertexFormat = flat ? PerInstanceColorAppearance.FLAT_VERTEX_FORMAT : PerInstanceColorAppearance.VERTEX_FORMAT;
+ this.material = void 0;
+ this.translucent = translucent;
+ this._vertexShaderSource = defaultValue_default(options.vertexShaderSource, vs);
+ this._fragmentShaderSource = defaultValue_default(options.fragmentShaderSource, fs);
+ this._renderState = Appearance_default.getDefaultRenderState(
+ translucent,
+ closed,
+ options.renderState
+ );
+ this._closed = closed;
+ this._vertexFormat = vertexFormat;
+ this._flat = flat;
+ this._faceForward = defaultValue_default(options.faceForward, !closed);
+}
+Object.defineProperties(PerInstanceColorAppearance.prototype, {
+ vertexShaderSource: {
+ get: function() {
+ return this._vertexShaderSource;
+ }
+ },
+ fragmentShaderSource: {
+ get: function() {
+ return this._fragmentShaderSource;
+ }
+ },
+ renderState: {
+ get: function() {
+ return this._renderState;
+ }
+ },
+ closed: {
+ get: function() {
+ return this._closed;
+ }
+ },
+ vertexFormat: {
+ get: function() {
+ return this._vertexFormat;
+ }
+ },
+ flat: {
+ get: function() {
+ return this._flat;
+ }
+ },
+ faceForward: {
+ get: function() {
+ return this._faceForward;
+ }
+ }
+});
+PerInstanceColorAppearance.VERTEX_FORMAT = VertexFormat_default.POSITION_AND_NORMAL;
+PerInstanceColorAppearance.FLAT_VERTEX_FORMAT = VertexFormat_default.POSITION_ONLY;
+PerInstanceColorAppearance.prototype.getFragmentShaderSource = Appearance_default.prototype.getFragmentShaderSource;
+PerInstanceColorAppearance.prototype.isTranslucent = Appearance_default.prototype.isTranslucent;
+PerInstanceColorAppearance.prototype.getRenderState = Appearance_default.prototype.getRenderState;
+var PerInstanceColorAppearance_default = PerInstanceColorAppearance;
+
+// Source/DataSources/ColorMaterialProperty.js
+function ColorMaterialProperty(color) {
+ this._definitionChanged = new Event_default();
+ this._color = void 0;
+ this._colorSubscription = void 0;
+ this.color = color;
+}
+Object.defineProperties(ColorMaterialProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._color);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ color: createPropertyDescriptor_default("color")
+});
+ColorMaterialProperty.prototype.getType = function(time) {
+ return "Color";
+};
+ColorMaterialProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(result)) {
+ result = {};
+ }
+ result.color = Property_default.getValueOrClonedDefault(
+ this._color,
+ time,
+ Color_default.WHITE,
+ result.color
+ );
+ return result;
+};
+ColorMaterialProperty.prototype.equals = function(other) {
+ return this === other || other instanceof ColorMaterialProperty && Property_default.equals(this._color, other._color);
+};
+var ColorMaterialProperty_default = ColorMaterialProperty;
+
+// Source/Core/GeographicTilingScheme.js
+function GeographicTilingScheme(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ this._rectangle = defaultValue_default(options.rectangle, Rectangle_default.MAX_VALUE);
+ this._projection = new GeographicProjection_default(this._ellipsoid);
+ this._numberOfLevelZeroTilesX = defaultValue_default(
+ options.numberOfLevelZeroTilesX,
+ 2
+ );
+ this._numberOfLevelZeroTilesY = defaultValue_default(
+ options.numberOfLevelZeroTilesY,
+ 1
+ );
+}
+Object.defineProperties(GeographicTilingScheme.prototype, {
+ ellipsoid: {
+ get: function() {
+ return this._ellipsoid;
+ }
+ },
+ rectangle: {
+ get: function() {
+ return this._rectangle;
+ }
+ },
+ projection: {
+ get: function() {
+ return this._projection;
+ }
+ }
+});
+GeographicTilingScheme.prototype.getNumberOfXTilesAtLevel = function(level) {
+ return this._numberOfLevelZeroTilesX << level;
+};
+GeographicTilingScheme.prototype.getNumberOfYTilesAtLevel = function(level) {
+ return this._numberOfLevelZeroTilesY << level;
+};
+GeographicTilingScheme.prototype.rectangleToNativeRectangle = function(rectangle, result) {
+ Check_default.defined("rectangle", rectangle);
+ const west = Math_default.toDegrees(rectangle.west);
+ const south = Math_default.toDegrees(rectangle.south);
+ const east = Math_default.toDegrees(rectangle.east);
+ const north = Math_default.toDegrees(rectangle.north);
+ if (!defined_default(result)) {
+ return new Rectangle_default(west, south, east, north);
+ }
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+};
+GeographicTilingScheme.prototype.tileXYToNativeRectangle = function(x, y, level, result) {
+ const rectangleRadians = this.tileXYToRectangle(x, y, level, result);
+ rectangleRadians.west = Math_default.toDegrees(rectangleRadians.west);
+ rectangleRadians.south = Math_default.toDegrees(rectangleRadians.south);
+ rectangleRadians.east = Math_default.toDegrees(rectangleRadians.east);
+ rectangleRadians.north = Math_default.toDegrees(rectangleRadians.north);
+ return rectangleRadians;
+};
+GeographicTilingScheme.prototype.tileXYToRectangle = function(x, y, level, result) {
+ const rectangle = this._rectangle;
+ const xTiles = this.getNumberOfXTilesAtLevel(level);
+ const yTiles = this.getNumberOfYTilesAtLevel(level);
+ const xTileWidth = rectangle.width / xTiles;
+ const west = x * xTileWidth + rectangle.west;
+ const east = (x + 1) * xTileWidth + rectangle.west;
+ const yTileHeight = rectangle.height / yTiles;
+ const north = rectangle.north - y * yTileHeight;
+ const south = rectangle.north - (y + 1) * yTileHeight;
+ if (!defined_default(result)) {
+ result = new Rectangle_default(west, south, east, north);
+ }
+ result.west = west;
+ result.south = south;
+ result.east = east;
+ result.north = north;
+ return result;
+};
+GeographicTilingScheme.prototype.positionToTileXY = function(position, level, result) {
+ const rectangle = this._rectangle;
+ if (!Rectangle_default.contains(rectangle, position)) {
+ return void 0;
+ }
+ const xTiles = this.getNumberOfXTilesAtLevel(level);
+ const yTiles = this.getNumberOfYTilesAtLevel(level);
+ const xTileWidth = rectangle.width / xTiles;
+ const yTileHeight = rectangle.height / yTiles;
+ let longitude = position.longitude;
+ if (rectangle.east < rectangle.west) {
+ longitude += Math_default.TWO_PI;
+ }
+ let xTileCoordinate = (longitude - rectangle.west) / xTileWidth | 0;
+ if (xTileCoordinate >= xTiles) {
+ xTileCoordinate = xTiles - 1;
+ }
+ let yTileCoordinate = (rectangle.north - position.latitude) / yTileHeight | 0;
+ if (yTileCoordinate >= yTiles) {
+ yTileCoordinate = yTiles - 1;
+ }
+ if (!defined_default(result)) {
+ return new Cartesian2_default(xTileCoordinate, yTileCoordinate);
+ }
+ result.x = xTileCoordinate;
+ result.y = yTileCoordinate;
+ return result;
+};
+var GeographicTilingScheme_default = GeographicTilingScheme;
+
+// Source/Core/ApproximateTerrainHeights.js
+var scratchDiagonalCartesianNE = new Cartesian3_default();
+var scratchDiagonalCartesianSW = new Cartesian3_default();
+var scratchDiagonalCartographic = new Cartographic_default();
+var scratchCenterCartesian = new Cartesian3_default();
+var scratchSurfaceCartesian = new Cartesian3_default();
+var scratchBoundingSphere = new BoundingSphere_default();
+var tilingScheme = new GeographicTilingScheme_default();
+var scratchCorners = [
+ new Cartographic_default(),
+ new Cartographic_default(),
+ new Cartographic_default(),
+ new Cartographic_default()
+];
+var scratchTileXY = new Cartesian2_default();
+var ApproximateTerrainHeights = {};
+ApproximateTerrainHeights.initialize = function() {
+ let initPromise = ApproximateTerrainHeights._initPromise;
+ if (defined_default(initPromise)) {
+ return initPromise;
+ }
+ initPromise = Resource_default.fetchJson(
+ buildModuleUrl_default("Assets/approximateTerrainHeights.json")
+ ).then(function(json) {
+ ApproximateTerrainHeights._terrainHeights = json;
+ });
+ ApproximateTerrainHeights._initPromise = initPromise;
+ return initPromise;
+};
+ApproximateTerrainHeights.getMinimumMaximumHeights = function(rectangle, ellipsoid) {
+ Check_default.defined("rectangle", rectangle);
+ if (!defined_default(ApproximateTerrainHeights._terrainHeights)) {
+ throw new DeveloperError_default(
+ "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function"
+ );
+ }
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ const xyLevel = getTileXYLevel(rectangle);
+ let minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;
+ let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;
+ if (defined_default(xyLevel)) {
+ const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;
+ const heights = ApproximateTerrainHeights._terrainHeights[key];
+ if (defined_default(heights)) {
+ minTerrainHeight = heights[0];
+ maxTerrainHeight = heights[1];
+ }
+ ellipsoid.cartographicToCartesian(
+ Rectangle_default.northeast(rectangle, scratchDiagonalCartographic),
+ scratchDiagonalCartesianNE
+ );
+ ellipsoid.cartographicToCartesian(
+ Rectangle_default.southwest(rectangle, scratchDiagonalCartographic),
+ scratchDiagonalCartesianSW
+ );
+ Cartesian3_default.midpoint(
+ scratchDiagonalCartesianSW,
+ scratchDiagonalCartesianNE,
+ scratchCenterCartesian
+ );
+ const surfacePosition = ellipsoid.scaleToGeodeticSurface(
+ scratchCenterCartesian,
+ scratchSurfaceCartesian
+ );
+ if (defined_default(surfacePosition)) {
+ const distance2 = Cartesian3_default.distance(
+ scratchCenterCartesian,
+ surfacePosition
+ );
+ minTerrainHeight = Math.min(minTerrainHeight, -distance2);
+ } else {
+ minTerrainHeight = ApproximateTerrainHeights._defaultMinTerrainHeight;
+ }
+ }
+ minTerrainHeight = Math.max(
+ ApproximateTerrainHeights._defaultMinTerrainHeight,
+ minTerrainHeight
+ );
+ return {
+ minimumTerrainHeight: minTerrainHeight,
+ maximumTerrainHeight: maxTerrainHeight
+ };
+};
+ApproximateTerrainHeights.getBoundingSphere = function(rectangle, ellipsoid) {
+ Check_default.defined("rectangle", rectangle);
+ if (!defined_default(ApproximateTerrainHeights._terrainHeights)) {
+ throw new DeveloperError_default(
+ "You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function"
+ );
+ }
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ const xyLevel = getTileXYLevel(rectangle);
+ let maxTerrainHeight = ApproximateTerrainHeights._defaultMaxTerrainHeight;
+ if (defined_default(xyLevel)) {
+ const key = `${xyLevel.level}-${xyLevel.x}-${xyLevel.y}`;
+ const heights = ApproximateTerrainHeights._terrainHeights[key];
+ if (defined_default(heights)) {
+ maxTerrainHeight = heights[1];
+ }
+ }
+ const result = BoundingSphere_default.fromRectangle3D(rectangle, ellipsoid, 0);
+ BoundingSphere_default.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ maxTerrainHeight,
+ scratchBoundingSphere
+ );
+ return BoundingSphere_default.union(result, scratchBoundingSphere, result);
+};
+function getTileXYLevel(rectangle) {
+ Cartographic_default.fromRadians(
+ rectangle.east,
+ rectangle.north,
+ 0,
+ scratchCorners[0]
+ );
+ Cartographic_default.fromRadians(
+ rectangle.west,
+ rectangle.north,
+ 0,
+ scratchCorners[1]
+ );
+ Cartographic_default.fromRadians(
+ rectangle.east,
+ rectangle.south,
+ 0,
+ scratchCorners[2]
+ );
+ Cartographic_default.fromRadians(
+ rectangle.west,
+ rectangle.south,
+ 0,
+ scratchCorners[3]
+ );
+ let lastLevelX = 0, lastLevelY = 0;
+ let currentX = 0, currentY = 0;
+ const maxLevel = ApproximateTerrainHeights._terrainHeightsMaxLevel;
+ let i;
+ for (i = 0; i <= maxLevel; ++i) {
+ let failed = false;
+ for (let j = 0; j < 4; ++j) {
+ const corner = scratchCorners[j];
+ tilingScheme.positionToTileXY(corner, i, scratchTileXY);
+ if (j === 0) {
+ currentX = scratchTileXY.x;
+ currentY = scratchTileXY.y;
+ } else if (currentX !== scratchTileXY.x || currentY !== scratchTileXY.y) {
+ failed = true;
+ break;
+ }
+ }
+ if (failed) {
+ break;
+ }
+ lastLevelX = currentX;
+ lastLevelY = currentY;
+ }
+ if (i === 0) {
+ return void 0;
+ }
+ return {
+ x: lastLevelX,
+ y: lastLevelY,
+ level: i > maxLevel ? maxLevel : i - 1
+ };
+}
+ApproximateTerrainHeights._terrainHeightsMaxLevel = 6;
+ApproximateTerrainHeights._defaultMaxTerrainHeight = 9e3;
+ApproximateTerrainHeights._defaultMinTerrainHeight = -1e5;
+ApproximateTerrainHeights._terrainHeights = void 0;
+ApproximateTerrainHeights._initPromise = void 0;
+Object.defineProperties(ApproximateTerrainHeights, {
+ initialized: {
+ get: function() {
+ return defined_default(ApproximateTerrainHeights._terrainHeights);
+ }
+ }
+});
+var ApproximateTerrainHeights_default = ApproximateTerrainHeights;
+
+// Source/Core/AxisAlignedBoundingBox.js
+function AxisAlignedBoundingBox(minimum, maximum, center) {
+ this.minimum = Cartesian3_default.clone(defaultValue_default(minimum, Cartesian3_default.ZERO));
+ this.maximum = Cartesian3_default.clone(defaultValue_default(maximum, Cartesian3_default.ZERO));
+ if (!defined_default(center)) {
+ center = Cartesian3_default.midpoint(this.minimum, this.maximum, new Cartesian3_default());
+ } else {
+ center = Cartesian3_default.clone(center);
+ }
+ this.center = center;
+}
+AxisAlignedBoundingBox.fromCorners = function(minimum, maximum, result) {
+ Check_default.defined("minimum", minimum);
+ Check_default.defined("maximum", maximum);
+ if (!defined_default(result)) {
+ result = new AxisAlignedBoundingBox();
+ }
+ result.minimum = Cartesian3_default.clone(minimum, result.minimum);
+ result.maximum = Cartesian3_default.clone(maximum, result.maximum);
+ result.center = Cartesian3_default.midpoint(minimum, maximum, result.center);
+ return result;
+};
+AxisAlignedBoundingBox.fromPoints = function(positions, result) {
+ if (!defined_default(result)) {
+ result = new AxisAlignedBoundingBox();
+ }
+ if (!defined_default(positions) || positions.length === 0) {
+ result.minimum = Cartesian3_default.clone(Cartesian3_default.ZERO, result.minimum);
+ result.maximum = Cartesian3_default.clone(Cartesian3_default.ZERO, result.maximum);
+ result.center = Cartesian3_default.clone(Cartesian3_default.ZERO, result.center);
+ return result;
+ }
+ let minimumX = positions[0].x;
+ let minimumY = positions[0].y;
+ let minimumZ = positions[0].z;
+ let maximumX = positions[0].x;
+ let maximumY = positions[0].y;
+ let maximumZ = positions[0].z;
+ const length3 = positions.length;
+ for (let i = 1; i < length3; i++) {
+ const p = positions[i];
+ const x = p.x;
+ const y = p.y;
+ const z = p.z;
+ minimumX = Math.min(x, minimumX);
+ maximumX = Math.max(x, maximumX);
+ minimumY = Math.min(y, minimumY);
+ maximumY = Math.max(y, maximumY);
+ minimumZ = Math.min(z, minimumZ);
+ maximumZ = Math.max(z, maximumZ);
+ }
+ const minimum = result.minimum;
+ minimum.x = minimumX;
+ minimum.y = minimumY;
+ minimum.z = minimumZ;
+ const maximum = result.maximum;
+ maximum.x = maximumX;
+ maximum.y = maximumY;
+ maximum.z = maximumZ;
+ result.center = Cartesian3_default.midpoint(minimum, maximum, result.center);
+ return result;
+};
+AxisAlignedBoundingBox.clone = function(box, result) {
+ if (!defined_default(box)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new AxisAlignedBoundingBox(box.minimum, box.maximum, box.center);
+ }
+ result.minimum = Cartesian3_default.clone(box.minimum, result.minimum);
+ result.maximum = Cartesian3_default.clone(box.maximum, result.maximum);
+ result.center = Cartesian3_default.clone(box.center, result.center);
+ return result;
+};
+AxisAlignedBoundingBox.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && Cartesian3_default.equals(left.center, right.center) && Cartesian3_default.equals(left.minimum, right.minimum) && Cartesian3_default.equals(left.maximum, right.maximum);
+};
+var intersectScratch = new Cartesian3_default();
+AxisAlignedBoundingBox.intersectPlane = function(box, plane) {
+ Check_default.defined("box", box);
+ Check_default.defined("plane", plane);
+ intersectScratch = Cartesian3_default.subtract(
+ box.maximum,
+ box.minimum,
+ intersectScratch
+ );
+ const h = Cartesian3_default.multiplyByScalar(
+ intersectScratch,
+ 0.5,
+ intersectScratch
+ );
+ const normal2 = plane.normal;
+ const e = h.x * Math.abs(normal2.x) + h.y * Math.abs(normal2.y) + h.z * Math.abs(normal2.z);
+ const s = Cartesian3_default.dot(box.center, normal2) + plane.distance;
+ if (s - e > 0) {
+ return Intersect_default.INSIDE;
+ }
+ if (s + e < 0) {
+ return Intersect_default.OUTSIDE;
+ }
+ return Intersect_default.INTERSECTING;
+};
+AxisAlignedBoundingBox.prototype.clone = function(result) {
+ return AxisAlignedBoundingBox.clone(this, result);
+};
+AxisAlignedBoundingBox.prototype.intersectPlane = function(plane) {
+ return AxisAlignedBoundingBox.intersectPlane(this, plane);
+};
+AxisAlignedBoundingBox.prototype.equals = function(right) {
+ return AxisAlignedBoundingBox.equals(this, right);
+};
+var AxisAlignedBoundingBox_default = AxisAlignedBoundingBox;
+
+// Source/Core/QuadraticRealPolynomial.js
+var QuadraticRealPolynomial = {};
+QuadraticRealPolynomial.computeDiscriminant = function(a3, b, c) {
+ if (typeof a3 !== "number") {
+ throw new DeveloperError_default("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new DeveloperError_default("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new DeveloperError_default("c is a required number.");
+ }
+ const discriminant = b * b - 4 * a3 * c;
+ return discriminant;
+};
+function addWithCancellationCheck(left, right, tolerance) {
+ const difference = left + right;
+ if (Math_default.sign(left) !== Math_default.sign(right) && Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance) {
+ return 0;
+ }
+ return difference;
+}
+QuadraticRealPolynomial.computeRealRoots = function(a3, b, c) {
+ if (typeof a3 !== "number") {
+ throw new DeveloperError_default("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new DeveloperError_default("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new DeveloperError_default("c is a required number.");
+ }
+ let ratio;
+ if (a3 === 0) {
+ if (b === 0) {
+ return [];
+ }
+ return [-c / b];
+ } else if (b === 0) {
+ if (c === 0) {
+ return [0, 0];
+ }
+ const cMagnitude = Math.abs(c);
+ const aMagnitude = Math.abs(a3);
+ if (cMagnitude < aMagnitude && cMagnitude / aMagnitude < Math_default.EPSILON14) {
+ return [0, 0];
+ } else if (cMagnitude > aMagnitude && aMagnitude / cMagnitude < Math_default.EPSILON14) {
+ return [];
+ }
+ ratio = -c / a3;
+ if (ratio < 0) {
+ return [];
+ }
+ const root = Math.sqrt(ratio);
+ return [-root, root];
+ } else if (c === 0) {
+ ratio = -b / a3;
+ if (ratio < 0) {
+ return [ratio, 0];
+ }
+ return [0, ratio];
+ }
+ const b2 = b * b;
+ const four_ac = 4 * a3 * c;
+ const radicand = addWithCancellationCheck(b2, -four_ac, Math_default.EPSILON14);
+ if (radicand < 0) {
+ return [];
+ }
+ const q = -0.5 * addWithCancellationCheck(
+ b,
+ Math_default.sign(b) * Math.sqrt(radicand),
+ Math_default.EPSILON14
+ );
+ if (b > 0) {
+ return [q / a3, c / q];
+ }
+ return [c / q, q / a3];
+};
+var QuadraticRealPolynomial_default = QuadraticRealPolynomial;
+
+// Source/Core/CubicRealPolynomial.js
+var CubicRealPolynomial = {};
+CubicRealPolynomial.computeDiscriminant = function(a3, b, c, d) {
+ if (typeof a3 !== "number") {
+ throw new DeveloperError_default("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new DeveloperError_default("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new DeveloperError_default("c is a required number.");
+ }
+ if (typeof d !== "number") {
+ throw new DeveloperError_default("d is a required number.");
+ }
+ const a22 = a3 * a3;
+ const b2 = b * b;
+ const c22 = c * c;
+ const d2 = d * d;
+ const discriminant = 18 * a3 * b * c * d + b2 * c22 - 27 * a22 * d2 - 4 * (a3 * c22 * c + b2 * b * d);
+ return discriminant;
+};
+function computeRealRoots(a3, b, c, d) {
+ const A = a3;
+ const B = b / 3;
+ const C = c / 3;
+ const D = d;
+ const AC = A * C;
+ const BD = B * D;
+ const B2 = B * B;
+ const C2 = C * C;
+ const delta1 = A * C - B2;
+ const delta2 = A * D - B * C;
+ const delta3 = B * D - C2;
+ const discriminant = 4 * delta1 * delta3 - delta2 * delta2;
+ let temp;
+ let temp1;
+ if (discriminant < 0) {
+ let ABar;
+ let CBar;
+ let DBar;
+ if (B2 * BD >= AC * C2) {
+ ABar = A;
+ CBar = delta1;
+ DBar = -2 * B * delta1 + A * delta2;
+ } else {
+ ABar = D;
+ CBar = delta3;
+ DBar = -D * delta2 + 2 * C * delta3;
+ }
+ const s = DBar < 0 ? -1 : 1;
+ const temp0 = -s * Math.abs(ABar) * Math.sqrt(-discriminant);
+ temp1 = -DBar + temp0;
+ const x = temp1 / 2;
+ const p = x < 0 ? -Math.pow(-x, 1 / 3) : Math.pow(x, 1 / 3);
+ const q = temp1 === temp0 ? -p : -CBar / p;
+ temp = CBar <= 0 ? p + q : -DBar / (p * p + q * q + CBar);
+ if (B2 * BD >= AC * C2) {
+ return [(temp - B) / A];
+ }
+ return [-D / (temp + C)];
+ }
+ const CBarA = delta1;
+ const DBarA = -2 * B * delta1 + A * delta2;
+ const CBarD = delta3;
+ const DBarD = -D * delta2 + 2 * C * delta3;
+ const squareRootOfDiscriminant = Math.sqrt(discriminant);
+ const halfSquareRootOf3 = Math.sqrt(3) / 2;
+ let theta = Math.abs(Math.atan2(A * squareRootOfDiscriminant, -DBarA) / 3);
+ temp = 2 * Math.sqrt(-CBarA);
+ let cosine = Math.cos(theta);
+ temp1 = temp * cosine;
+ let temp3 = temp * (-cosine / 2 - halfSquareRootOf3 * Math.sin(theta));
+ const numeratorLarge = temp1 + temp3 > 2 * B ? temp1 - B : temp3 - B;
+ const denominatorLarge = A;
+ const root1 = numeratorLarge / denominatorLarge;
+ theta = Math.abs(Math.atan2(D * squareRootOfDiscriminant, -DBarD) / 3);
+ temp = 2 * Math.sqrt(-CBarD);
+ cosine = Math.cos(theta);
+ temp1 = temp * cosine;
+ temp3 = temp * (-cosine / 2 - halfSquareRootOf3 * Math.sin(theta));
+ const numeratorSmall = -D;
+ const denominatorSmall = temp1 + temp3 < 2 * C ? temp1 + C : temp3 + C;
+ const root3 = numeratorSmall / denominatorSmall;
+ const E = denominatorLarge * denominatorSmall;
+ const F = -numeratorLarge * denominatorSmall - denominatorLarge * numeratorSmall;
+ const G = numeratorLarge * numeratorSmall;
+ const root2 = (C * F - B * G) / (-B * F + C * E);
+ if (root1 <= root2) {
+ if (root1 <= root3) {
+ if (root2 <= root3) {
+ return [root1, root2, root3];
+ }
+ return [root1, root3, root2];
+ }
+ return [root3, root1, root2];
+ }
+ if (root1 <= root3) {
+ return [root2, root1, root3];
+ }
+ if (root2 <= root3) {
+ return [root2, root3, root1];
+ }
+ return [root3, root2, root1];
+}
+CubicRealPolynomial.computeRealRoots = function(a3, b, c, d) {
+ if (typeof a3 !== "number") {
+ throw new DeveloperError_default("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new DeveloperError_default("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new DeveloperError_default("c is a required number.");
+ }
+ if (typeof d !== "number") {
+ throw new DeveloperError_default("d is a required number.");
+ }
+ let roots;
+ let ratio;
+ if (a3 === 0) {
+ return QuadraticRealPolynomial_default.computeRealRoots(b, c, d);
+ } else if (b === 0) {
+ if (c === 0) {
+ if (d === 0) {
+ return [0, 0, 0];
+ }
+ ratio = -d / a3;
+ const root = ratio < 0 ? -Math.pow(-ratio, 1 / 3) : Math.pow(ratio, 1 / 3);
+ return [root, root, root];
+ } else if (d === 0) {
+ roots = QuadraticRealPolynomial_default.computeRealRoots(a3, 0, c);
+ if (roots.Length === 0) {
+ return [0];
+ }
+ return [roots[0], 0, roots[1]];
+ }
+ return computeRealRoots(a3, 0, c, d);
+ } else if (c === 0) {
+ if (d === 0) {
+ ratio = -b / a3;
+ if (ratio < 0) {
+ return [ratio, 0, 0];
+ }
+ return [0, 0, ratio];
+ }
+ return computeRealRoots(a3, b, 0, d);
+ } else if (d === 0) {
+ roots = QuadraticRealPolynomial_default.computeRealRoots(a3, b, c);
+ if (roots.length === 0) {
+ return [0];
+ } else if (roots[1] <= 0) {
+ return [roots[0], roots[1], 0];
+ } else if (roots[0] >= 0) {
+ return [0, roots[0], roots[1]];
+ }
+ return [roots[0], 0, roots[1]];
+ }
+ return computeRealRoots(a3, b, c, d);
+};
+var CubicRealPolynomial_default = CubicRealPolynomial;
+
+// Source/Core/QuarticRealPolynomial.js
+var QuarticRealPolynomial = {};
+QuarticRealPolynomial.computeDiscriminant = function(a3, b, c, d, e) {
+ if (typeof a3 !== "number") {
+ throw new DeveloperError_default("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new DeveloperError_default("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new DeveloperError_default("c is a required number.");
+ }
+ if (typeof d !== "number") {
+ throw new DeveloperError_default("d is a required number.");
+ }
+ if (typeof e !== "number") {
+ throw new DeveloperError_default("e is a required number.");
+ }
+ const a22 = a3 * a3;
+ const a32 = a22 * a3;
+ const b2 = b * b;
+ const b3 = b2 * b;
+ const c22 = c * c;
+ const c33 = c22 * c;
+ const d2 = d * d;
+ const d3 = d2 * d;
+ const e2 = e * e;
+ const e3 = e2 * e;
+ const discriminant = b2 * c22 * d2 - 4 * b3 * d3 - 4 * a3 * c33 * d2 + 18 * a3 * b * c * d3 - 27 * a22 * d2 * d2 + 256 * a32 * e3 + e * (18 * b3 * c * d - 4 * b2 * c33 + 16 * a3 * c22 * c22 - 80 * a3 * b * c22 * d - 6 * a3 * b2 * d2 + 144 * a22 * c * d2) + e2 * (144 * a3 * b2 * c - 27 * b2 * b2 - 128 * a22 * c22 - 192 * a22 * b * d);
+ return discriminant;
+};
+function original(a3, a22, a1, a0) {
+ const a3Squared = a3 * a3;
+ const p = a22 - 3 * a3Squared / 8;
+ const q = a1 - a22 * a3 / 2 + a3Squared * a3 / 8;
+ const r = a0 - a1 * a3 / 4 + a22 * a3Squared / 16 - 3 * a3Squared * a3Squared / 256;
+ const cubicRoots = CubicRealPolynomial_default.computeRealRoots(
+ 1,
+ 2 * p,
+ p * p - 4 * r,
+ -q * q
+ );
+ if (cubicRoots.length > 0) {
+ const temp = -a3 / 4;
+ const hSquared = cubicRoots[cubicRoots.length - 1];
+ if (Math.abs(hSquared) < Math_default.EPSILON14) {
+ const roots = QuadraticRealPolynomial_default.computeRealRoots(1, p, r);
+ if (roots.length === 2) {
+ const root0 = roots[0];
+ const root1 = roots[1];
+ let y;
+ if (root0 >= 0 && root1 >= 0) {
+ const y0 = Math.sqrt(root0);
+ const y1 = Math.sqrt(root1);
+ return [temp - y1, temp - y0, temp + y0, temp + y1];
+ } else if (root0 >= 0 && root1 < 0) {
+ y = Math.sqrt(root0);
+ return [temp - y, temp + y];
+ } else if (root0 < 0 && root1 >= 0) {
+ y = Math.sqrt(root1);
+ return [temp - y, temp + y];
+ }
+ }
+ return [];
+ } else if (hSquared > 0) {
+ const h = Math.sqrt(hSquared);
+ const m = (p + hSquared - q / h) / 2;
+ const n = (p + hSquared + q / h) / 2;
+ const roots1 = QuadraticRealPolynomial_default.computeRealRoots(1, h, m);
+ const roots2 = QuadraticRealPolynomial_default.computeRealRoots(1, -h, n);
+ if (roots1.length !== 0) {
+ roots1[0] += temp;
+ roots1[1] += temp;
+ if (roots2.length !== 0) {
+ roots2[0] += temp;
+ roots2[1] += temp;
+ if (roots1[1] <= roots2[0]) {
+ return [roots1[0], roots1[1], roots2[0], roots2[1]];
+ } else if (roots2[1] <= roots1[0]) {
+ return [roots2[0], roots2[1], roots1[0], roots1[1]];
+ } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {
+ return [roots2[0], roots1[0], roots1[1], roots2[1]];
+ } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {
+ return [roots1[0], roots2[0], roots2[1], roots1[1]];
+ } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {
+ return [roots2[0], roots1[0], roots2[1], roots1[1]];
+ }
+ return [roots1[0], roots2[0], roots1[1], roots2[1]];
+ }
+ return roots1;
+ }
+ if (roots2.length !== 0) {
+ roots2[0] += temp;
+ roots2[1] += temp;
+ return roots2;
+ }
+ return [];
+ }
+ }
+ return [];
+}
+function neumark(a3, a22, a1, a0) {
+ const a1Squared = a1 * a1;
+ const a2Squared = a22 * a22;
+ const a3Squared = a3 * a3;
+ const p = -2 * a22;
+ const q = a1 * a3 + a2Squared - 4 * a0;
+ const r = a3Squared * a0 - a1 * a22 * a3 + a1Squared;
+ const cubicRoots = CubicRealPolynomial_default.computeRealRoots(1, p, q, r);
+ if (cubicRoots.length > 0) {
+ const y = cubicRoots[0];
+ const temp = a22 - y;
+ const tempSquared = temp * temp;
+ const g1 = a3 / 2;
+ const h1 = temp / 2;
+ const m = tempSquared - 4 * a0;
+ const mError = tempSquared + 4 * Math.abs(a0);
+ const n = a3Squared - 4 * y;
+ const nError = a3Squared + 4 * Math.abs(y);
+ let g2;
+ let h2;
+ if (y < 0 || m * nError < n * mError) {
+ const squareRootOfN = Math.sqrt(n);
+ g2 = squareRootOfN / 2;
+ h2 = squareRootOfN === 0 ? 0 : (a3 * h1 - a1) / squareRootOfN;
+ } else {
+ const squareRootOfM = Math.sqrt(m);
+ g2 = squareRootOfM === 0 ? 0 : (a3 * h1 - a1) / squareRootOfM;
+ h2 = squareRootOfM / 2;
+ }
+ let G;
+ let g;
+ if (g1 === 0 && g2 === 0) {
+ G = 0;
+ g = 0;
+ } else if (Math_default.sign(g1) === Math_default.sign(g2)) {
+ G = g1 + g2;
+ g = y / G;
+ } else {
+ g = g1 - g2;
+ G = y / g;
+ }
+ let H;
+ let h;
+ if (h1 === 0 && h2 === 0) {
+ H = 0;
+ h = 0;
+ } else if (Math_default.sign(h1) === Math_default.sign(h2)) {
+ H = h1 + h2;
+ h = a0 / H;
+ } else {
+ h = h1 - h2;
+ H = a0 / h;
+ }
+ const roots1 = QuadraticRealPolynomial_default.computeRealRoots(1, G, H);
+ const roots2 = QuadraticRealPolynomial_default.computeRealRoots(1, g, h);
+ if (roots1.length !== 0) {
+ if (roots2.length !== 0) {
+ if (roots1[1] <= roots2[0]) {
+ return [roots1[0], roots1[1], roots2[0], roots2[1]];
+ } else if (roots2[1] <= roots1[0]) {
+ return [roots2[0], roots2[1], roots1[0], roots1[1]];
+ } else if (roots1[0] >= roots2[0] && roots1[1] <= roots2[1]) {
+ return [roots2[0], roots1[0], roots1[1], roots2[1]];
+ } else if (roots2[0] >= roots1[0] && roots2[1] <= roots1[1]) {
+ return [roots1[0], roots2[0], roots2[1], roots1[1]];
+ } else if (roots1[0] > roots2[0] && roots1[0] < roots2[1]) {
+ return [roots2[0], roots1[0], roots2[1], roots1[1]];
+ }
+ return [roots1[0], roots2[0], roots1[1], roots2[1]];
+ }
+ return roots1;
+ }
+ if (roots2.length !== 0) {
+ return roots2;
+ }
+ }
+ return [];
+}
+QuarticRealPolynomial.computeRealRoots = function(a3, b, c, d, e) {
+ if (typeof a3 !== "number") {
+ throw new DeveloperError_default("a is a required number.");
+ }
+ if (typeof b !== "number") {
+ throw new DeveloperError_default("b is a required number.");
+ }
+ if (typeof c !== "number") {
+ throw new DeveloperError_default("c is a required number.");
+ }
+ if (typeof d !== "number") {
+ throw new DeveloperError_default("d is a required number.");
+ }
+ if (typeof e !== "number") {
+ throw new DeveloperError_default("e is a required number.");
+ }
+ if (Math.abs(a3) < Math_default.EPSILON15) {
+ return CubicRealPolynomial_default.computeRealRoots(b, c, d, e);
+ }
+ const a32 = b / a3;
+ const a22 = c / a3;
+ const a1 = d / a3;
+ const a0 = e / a3;
+ let k = a32 < 0 ? 1 : 0;
+ k += a22 < 0 ? k + 1 : k;
+ k += a1 < 0 ? k + 1 : k;
+ k += a0 < 0 ? k + 1 : k;
+ switch (k) {
+ case 0:
+ return original(a32, a22, a1, a0);
+ case 1:
+ return neumark(a32, a22, a1, a0);
+ case 2:
+ return neumark(a32, a22, a1, a0);
+ case 3:
+ return original(a32, a22, a1, a0);
+ case 4:
+ return original(a32, a22, a1, a0);
+ case 5:
+ return neumark(a32, a22, a1, a0);
+ case 6:
+ return original(a32, a22, a1, a0);
+ case 7:
+ return original(a32, a22, a1, a0);
+ case 8:
+ return neumark(a32, a22, a1, a0);
+ case 9:
+ return original(a32, a22, a1, a0);
+ case 10:
+ return original(a32, a22, a1, a0);
+ case 11:
+ return neumark(a32, a22, a1, a0);
+ case 12:
+ return original(a32, a22, a1, a0);
+ case 13:
+ return original(a32, a22, a1, a0);
+ case 14:
+ return original(a32, a22, a1, a0);
+ case 15:
+ return original(a32, a22, a1, a0);
+ default:
+ return void 0;
+ }
+};
+var QuarticRealPolynomial_default = QuarticRealPolynomial;
+
+// Source/Core/Ray.js
+function Ray(origin, direction2) {
+ direction2 = Cartesian3_default.clone(defaultValue_default(direction2, Cartesian3_default.ZERO));
+ if (!Cartesian3_default.equals(direction2, Cartesian3_default.ZERO)) {
+ Cartesian3_default.normalize(direction2, direction2);
+ }
+ this.origin = Cartesian3_default.clone(defaultValue_default(origin, Cartesian3_default.ZERO));
+ this.direction = direction2;
+}
+Ray.clone = function(ray, result) {
+ if (!defined_default(ray)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Ray(ray.origin, ray.direction);
+ }
+ result.origin = Cartesian3_default.clone(ray.origin);
+ result.direction = Cartesian3_default.clone(ray.direction);
+ return result;
+};
+Ray.getPoint = function(ray, t, result) {
+ Check_default.typeOf.object("ray", ray);
+ Check_default.typeOf.number("t", t);
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ result = Cartesian3_default.multiplyByScalar(ray.direction, t, result);
+ return Cartesian3_default.add(ray.origin, result, result);
+};
+var Ray_default = Ray;
+
+// Source/Core/IntersectionTests.js
+var IntersectionTests = {};
+IntersectionTests.rayPlane = function(ray, plane, result) {
+ if (!defined_default(ray)) {
+ throw new DeveloperError_default("ray is required.");
+ }
+ if (!defined_default(plane)) {
+ throw new DeveloperError_default("plane is required.");
+ }
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ const origin = ray.origin;
+ const direction2 = ray.direction;
+ const normal2 = plane.normal;
+ const denominator = Cartesian3_default.dot(normal2, direction2);
+ if (Math.abs(denominator) < Math_default.EPSILON15) {
+ return void 0;
+ }
+ const t = (-plane.distance - Cartesian3_default.dot(normal2, origin)) / denominator;
+ if (t < 0) {
+ return void 0;
+ }
+ result = Cartesian3_default.multiplyByScalar(direction2, t, result);
+ return Cartesian3_default.add(origin, result, result);
+};
+var scratchEdge0 = new Cartesian3_default();
+var scratchEdge1 = new Cartesian3_default();
+var scratchPVec = new Cartesian3_default();
+var scratchTVec = new Cartesian3_default();
+var scratchQVec = new Cartesian3_default();
+IntersectionTests.rayTriangleParametric = function(ray, p0, p1, p2, cullBackFaces) {
+ if (!defined_default(ray)) {
+ throw new DeveloperError_default("ray is required.");
+ }
+ if (!defined_default(p0)) {
+ throw new DeveloperError_default("p0 is required.");
+ }
+ if (!defined_default(p1)) {
+ throw new DeveloperError_default("p1 is required.");
+ }
+ if (!defined_default(p2)) {
+ throw new DeveloperError_default("p2 is required.");
+ }
+ cullBackFaces = defaultValue_default(cullBackFaces, false);
+ const origin = ray.origin;
+ const direction2 = ray.direction;
+ const edge0 = Cartesian3_default.subtract(p1, p0, scratchEdge0);
+ const edge1 = Cartesian3_default.subtract(p2, p0, scratchEdge1);
+ const p = Cartesian3_default.cross(direction2, edge1, scratchPVec);
+ const det = Cartesian3_default.dot(edge0, p);
+ let tvec;
+ let q;
+ let u3;
+ let v7;
+ let t;
+ if (cullBackFaces) {
+ if (det < Math_default.EPSILON6) {
+ return void 0;
+ }
+ tvec = Cartesian3_default.subtract(origin, p0, scratchTVec);
+ u3 = Cartesian3_default.dot(tvec, p);
+ if (u3 < 0 || u3 > det) {
+ return void 0;
+ }
+ q = Cartesian3_default.cross(tvec, edge0, scratchQVec);
+ v7 = Cartesian3_default.dot(direction2, q);
+ if (v7 < 0 || u3 + v7 > det) {
+ return void 0;
+ }
+ t = Cartesian3_default.dot(edge1, q) / det;
+ } else {
+ if (Math.abs(det) < Math_default.EPSILON6) {
+ return void 0;
+ }
+ const invDet = 1 / det;
+ tvec = Cartesian3_default.subtract(origin, p0, scratchTVec);
+ u3 = Cartesian3_default.dot(tvec, p) * invDet;
+ if (u3 < 0 || u3 > 1) {
+ return void 0;
+ }
+ q = Cartesian3_default.cross(tvec, edge0, scratchQVec);
+ v7 = Cartesian3_default.dot(direction2, q) * invDet;
+ if (v7 < 0 || u3 + v7 > 1) {
+ return void 0;
+ }
+ t = Cartesian3_default.dot(edge1, q) * invDet;
+ }
+ return t;
+};
+IntersectionTests.rayTriangle = function(ray, p0, p1, p2, cullBackFaces, result) {
+ const t = IntersectionTests.rayTriangleParametric(
+ ray,
+ p0,
+ p1,
+ p2,
+ cullBackFaces
+ );
+ if (!defined_default(t) || t < 0) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ Cartesian3_default.multiplyByScalar(ray.direction, t, result);
+ return Cartesian3_default.add(ray.origin, result, result);
+};
+var scratchLineSegmentTriangleRay = new Ray_default();
+IntersectionTests.lineSegmentTriangle = function(v02, v13, p0, p1, p2, cullBackFaces, result) {
+ if (!defined_default(v02)) {
+ throw new DeveloperError_default("v0 is required.");
+ }
+ if (!defined_default(v13)) {
+ throw new DeveloperError_default("v1 is required.");
+ }
+ if (!defined_default(p0)) {
+ throw new DeveloperError_default("p0 is required.");
+ }
+ if (!defined_default(p1)) {
+ throw new DeveloperError_default("p1 is required.");
+ }
+ if (!defined_default(p2)) {
+ throw new DeveloperError_default("p2 is required.");
+ }
+ const ray = scratchLineSegmentTriangleRay;
+ Cartesian3_default.clone(v02, ray.origin);
+ Cartesian3_default.subtract(v13, v02, ray.direction);
+ Cartesian3_default.normalize(ray.direction, ray.direction);
+ const t = IntersectionTests.rayTriangleParametric(
+ ray,
+ p0,
+ p1,
+ p2,
+ cullBackFaces
+ );
+ if (!defined_default(t) || t < 0 || t > Cartesian3_default.distance(v02, v13)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ Cartesian3_default.multiplyByScalar(ray.direction, t, result);
+ return Cartesian3_default.add(ray.origin, result, result);
+};
+function solveQuadratic(a3, b, c, result) {
+ const det = b * b - 4 * a3 * c;
+ if (det < 0) {
+ return void 0;
+ } else if (det > 0) {
+ const denom = 1 / (2 * a3);
+ const disc = Math.sqrt(det);
+ const root0 = (-b + disc) * denom;
+ const root1 = (-b - disc) * denom;
+ if (root0 < root1) {
+ result.root0 = root0;
+ result.root1 = root1;
+ } else {
+ result.root0 = root1;
+ result.root1 = root0;
+ }
+ return result;
+ }
+ const root = -b / (2 * a3);
+ if (root === 0) {
+ return void 0;
+ }
+ result.root0 = result.root1 = root;
+ return result;
+}
+var raySphereRoots = {
+ root0: 0,
+ root1: 0
+};
+function raySphere(ray, sphere, result) {
+ if (!defined_default(result)) {
+ result = new Interval_default();
+ }
+ const origin = ray.origin;
+ const direction2 = ray.direction;
+ const center = sphere.center;
+ const radiusSquared = sphere.radius * sphere.radius;
+ const diff = Cartesian3_default.subtract(origin, center, scratchPVec);
+ const a3 = Cartesian3_default.dot(direction2, direction2);
+ const b = 2 * Cartesian3_default.dot(direction2, diff);
+ const c = Cartesian3_default.magnitudeSquared(diff) - radiusSquared;
+ const roots = solveQuadratic(a3, b, c, raySphereRoots);
+ if (!defined_default(roots)) {
+ return void 0;
+ }
+ result.start = roots.root0;
+ result.stop = roots.root1;
+ return result;
+}
+IntersectionTests.raySphere = function(ray, sphere, result) {
+ if (!defined_default(ray)) {
+ throw new DeveloperError_default("ray is required.");
+ }
+ if (!defined_default(sphere)) {
+ throw new DeveloperError_default("sphere is required.");
+ }
+ result = raySphere(ray, sphere, result);
+ if (!defined_default(result) || result.stop < 0) {
+ return void 0;
+ }
+ result.start = Math.max(result.start, 0);
+ return result;
+};
+var scratchLineSegmentRay = new Ray_default();
+IntersectionTests.lineSegmentSphere = function(p0, p1, sphere, result) {
+ if (!defined_default(p0)) {
+ throw new DeveloperError_default("p0 is required.");
+ }
+ if (!defined_default(p1)) {
+ throw new DeveloperError_default("p1 is required.");
+ }
+ if (!defined_default(sphere)) {
+ throw new DeveloperError_default("sphere is required.");
+ }
+ const ray = scratchLineSegmentRay;
+ Cartesian3_default.clone(p0, ray.origin);
+ const direction2 = Cartesian3_default.subtract(p1, p0, ray.direction);
+ const maxT = Cartesian3_default.magnitude(direction2);
+ Cartesian3_default.normalize(direction2, direction2);
+ result = raySphere(ray, sphere, result);
+ if (!defined_default(result) || result.stop < 0 || result.start > maxT) {
+ return void 0;
+ }
+ result.start = Math.max(result.start, 0);
+ result.stop = Math.min(result.stop, maxT);
+ return result;
+};
+var scratchQ = new Cartesian3_default();
+var scratchW = new Cartesian3_default();
+IntersectionTests.rayEllipsoid = function(ray, ellipsoid) {
+ if (!defined_default(ray)) {
+ throw new DeveloperError_default("ray is required.");
+ }
+ if (!defined_default(ellipsoid)) {
+ throw new DeveloperError_default("ellipsoid is required.");
+ }
+ const inverseRadii = ellipsoid.oneOverRadii;
+ const q = Cartesian3_default.multiplyComponents(inverseRadii, ray.origin, scratchQ);
+ const w = Cartesian3_default.multiplyComponents(
+ inverseRadii,
+ ray.direction,
+ scratchW
+ );
+ const q22 = Cartesian3_default.magnitudeSquared(q);
+ const qw = Cartesian3_default.dot(q, w);
+ let difference, w2, product, discriminant, temp;
+ if (q22 > 1) {
+ if (qw >= 0) {
+ return void 0;
+ }
+ const qw2 = qw * qw;
+ difference = q22 - 1;
+ w2 = Cartesian3_default.magnitudeSquared(w);
+ product = w2 * difference;
+ if (qw2 < product) {
+ return void 0;
+ } else if (qw2 > product) {
+ discriminant = qw * qw - product;
+ temp = -qw + Math.sqrt(discriminant);
+ const root0 = temp / w2;
+ const root1 = difference / temp;
+ if (root0 < root1) {
+ return new Interval_default(root0, root1);
+ }
+ return {
+ start: root1,
+ stop: root0
+ };
+ }
+ const root = Math.sqrt(difference / w2);
+ return new Interval_default(root, root);
+ } else if (q22 < 1) {
+ difference = q22 - 1;
+ w2 = Cartesian3_default.magnitudeSquared(w);
+ product = w2 * difference;
+ discriminant = qw * qw - product;
+ temp = -qw + Math.sqrt(discriminant);
+ return new Interval_default(0, temp / w2);
+ }
+ if (qw < 0) {
+ w2 = Cartesian3_default.magnitudeSquared(w);
+ return new Interval_default(0, -qw / w2);
+ }
+ return void 0;
+};
+function addWithCancellationCheck2(left, right, tolerance) {
+ const difference = left + right;
+ if (Math_default.sign(left) !== Math_default.sign(right) && Math.abs(difference / Math.max(Math.abs(left), Math.abs(right))) < tolerance) {
+ return 0;
+ }
+ return difference;
+}
+function quadraticVectorExpression(A, b, c, x, w) {
+ const xSquared = x * x;
+ const wSquared = w * w;
+ const l2 = (A[Matrix3_default.COLUMN1ROW1] - A[Matrix3_default.COLUMN2ROW2]) * wSquared;
+ const l1 = w * (x * addWithCancellationCheck2(
+ A[Matrix3_default.COLUMN1ROW0],
+ A[Matrix3_default.COLUMN0ROW1],
+ Math_default.EPSILON15
+ ) + b.y);
+ const l0 = A[Matrix3_default.COLUMN0ROW0] * xSquared + A[Matrix3_default.COLUMN2ROW2] * wSquared + x * b.x + c;
+ const r1 = wSquared * addWithCancellationCheck2(
+ A[Matrix3_default.COLUMN2ROW1],
+ A[Matrix3_default.COLUMN1ROW2],
+ Math_default.EPSILON15
+ );
+ const r0 = w * (x * addWithCancellationCheck2(A[Matrix3_default.COLUMN2ROW0], A[Matrix3_default.COLUMN0ROW2]) + b.z);
+ let cosines;
+ const solutions = [];
+ if (r0 === 0 && r1 === 0) {
+ cosines = QuadraticRealPolynomial_default.computeRealRoots(l2, l1, l0);
+ if (cosines.length === 0) {
+ return solutions;
+ }
+ const cosine0 = cosines[0];
+ const sine0 = Math.sqrt(Math.max(1 - cosine0 * cosine0, 0));
+ solutions.push(new Cartesian3_default(x, w * cosine0, w * -sine0));
+ solutions.push(new Cartesian3_default(x, w * cosine0, w * sine0));
+ if (cosines.length === 2) {
+ const cosine1 = cosines[1];
+ const sine1 = Math.sqrt(Math.max(1 - cosine1 * cosine1, 0));
+ solutions.push(new Cartesian3_default(x, w * cosine1, w * -sine1));
+ solutions.push(new Cartesian3_default(x, w * cosine1, w * sine1));
+ }
+ return solutions;
+ }
+ const r0Squared = r0 * r0;
+ const r1Squared = r1 * r1;
+ const l2Squared = l2 * l2;
+ const r0r1 = r0 * r1;
+ const c42 = l2Squared + r1Squared;
+ const c33 = 2 * (l1 * l2 + r0r1);
+ const c22 = 2 * l0 * l2 + l1 * l1 - r1Squared + r0Squared;
+ const c14 = 2 * (l0 * l1 - r0r1);
+ const c0 = l0 * l0 - r0Squared;
+ if (c42 === 0 && c33 === 0 && c22 === 0 && c14 === 0) {
+ return solutions;
+ }
+ cosines = QuarticRealPolynomial_default.computeRealRoots(c42, c33, c22, c14, c0);
+ const length3 = cosines.length;
+ if (length3 === 0) {
+ return solutions;
+ }
+ for (let i = 0; i < length3; ++i) {
+ const cosine = cosines[i];
+ const cosineSquared = cosine * cosine;
+ const sineSquared = Math.max(1 - cosineSquared, 0);
+ const sine = Math.sqrt(sineSquared);
+ let left;
+ if (Math_default.sign(l2) === Math_default.sign(l0)) {
+ left = addWithCancellationCheck2(
+ l2 * cosineSquared + l0,
+ l1 * cosine,
+ Math_default.EPSILON12
+ );
+ } else if (Math_default.sign(l0) === Math_default.sign(l1 * cosine)) {
+ left = addWithCancellationCheck2(
+ l2 * cosineSquared,
+ l1 * cosine + l0,
+ Math_default.EPSILON12
+ );
+ } else {
+ left = addWithCancellationCheck2(
+ l2 * cosineSquared + l1 * cosine,
+ l0,
+ Math_default.EPSILON12
+ );
+ }
+ const right = addWithCancellationCheck2(
+ r1 * cosine,
+ r0,
+ Math_default.EPSILON15
+ );
+ const product = left * right;
+ if (product < 0) {
+ solutions.push(new Cartesian3_default(x, w * cosine, w * sine));
+ } else if (product > 0) {
+ solutions.push(new Cartesian3_default(x, w * cosine, w * -sine));
+ } else if (sine !== 0) {
+ solutions.push(new Cartesian3_default(x, w * cosine, w * -sine));
+ solutions.push(new Cartesian3_default(x, w * cosine, w * sine));
+ ++i;
+ } else {
+ solutions.push(new Cartesian3_default(x, w * cosine, w * sine));
+ }
+ }
+ return solutions;
+}
+var firstAxisScratch = new Cartesian3_default();
+var secondAxisScratch = new Cartesian3_default();
+var thirdAxisScratch = new Cartesian3_default();
+var referenceScratch = new Cartesian3_default();
+var bCart = new Cartesian3_default();
+var bScratch = new Matrix3_default();
+var btScratch = new Matrix3_default();
+var diScratch = new Matrix3_default();
+var dScratch = new Matrix3_default();
+var cScratch = new Matrix3_default();
+var tempMatrix = new Matrix3_default();
+var aScratch = new Matrix3_default();
+var sScratch = new Cartesian3_default();
+var closestScratch = new Cartesian3_default();
+var surfPointScratch = new Cartographic_default();
+IntersectionTests.grazingAltitudeLocation = function(ray, ellipsoid) {
+ if (!defined_default(ray)) {
+ throw new DeveloperError_default("ray is required.");
+ }
+ if (!defined_default(ellipsoid)) {
+ throw new DeveloperError_default("ellipsoid is required.");
+ }
+ const position = ray.origin;
+ const direction2 = ray.direction;
+ if (!Cartesian3_default.equals(position, Cartesian3_default.ZERO)) {
+ const normal2 = ellipsoid.geodeticSurfaceNormal(position, firstAxisScratch);
+ if (Cartesian3_default.dot(direction2, normal2) >= 0) {
+ return position;
+ }
+ }
+ const intersects = defined_default(this.rayEllipsoid(ray, ellipsoid));
+ const f = ellipsoid.transformPositionToScaledSpace(
+ direction2,
+ firstAxisScratch
+ );
+ const firstAxis = Cartesian3_default.normalize(f, f);
+ const reference = Cartesian3_default.mostOrthogonalAxis(f, referenceScratch);
+ const secondAxis = Cartesian3_default.normalize(
+ Cartesian3_default.cross(reference, firstAxis, secondAxisScratch),
+ secondAxisScratch
+ );
+ const thirdAxis = Cartesian3_default.normalize(
+ Cartesian3_default.cross(firstAxis, secondAxis, thirdAxisScratch),
+ thirdAxisScratch
+ );
+ const B = bScratch;
+ B[0] = firstAxis.x;
+ B[1] = firstAxis.y;
+ B[2] = firstAxis.z;
+ B[3] = secondAxis.x;
+ B[4] = secondAxis.y;
+ B[5] = secondAxis.z;
+ B[6] = thirdAxis.x;
+ B[7] = thirdAxis.y;
+ B[8] = thirdAxis.z;
+ const B_T = Matrix3_default.transpose(B, btScratch);
+ const D_I = Matrix3_default.fromScale(ellipsoid.radii, diScratch);
+ const D = Matrix3_default.fromScale(ellipsoid.oneOverRadii, dScratch);
+ const C = cScratch;
+ C[0] = 0;
+ C[1] = -direction2.z;
+ C[2] = direction2.y;
+ C[3] = direction2.z;
+ C[4] = 0;
+ C[5] = -direction2.x;
+ C[6] = -direction2.y;
+ C[7] = direction2.x;
+ C[8] = 0;
+ const temp = Matrix3_default.multiply(
+ Matrix3_default.multiply(B_T, D, tempMatrix),
+ C,
+ tempMatrix
+ );
+ const A = Matrix3_default.multiply(
+ Matrix3_default.multiply(temp, D_I, aScratch),
+ B,
+ aScratch
+ );
+ const b = Matrix3_default.multiplyByVector(temp, position, bCart);
+ const solutions = quadraticVectorExpression(
+ A,
+ Cartesian3_default.negate(b, firstAxisScratch),
+ 0,
+ 0,
+ 1
+ );
+ let s;
+ let altitude;
+ const length3 = solutions.length;
+ if (length3 > 0) {
+ let closest = Cartesian3_default.clone(Cartesian3_default.ZERO, closestScratch);
+ let maximumValue = Number.NEGATIVE_INFINITY;
+ for (let i = 0; i < length3; ++i) {
+ s = Matrix3_default.multiplyByVector(
+ D_I,
+ Matrix3_default.multiplyByVector(B, solutions[i], sScratch),
+ sScratch
+ );
+ const v7 = Cartesian3_default.normalize(
+ Cartesian3_default.subtract(s, position, referenceScratch),
+ referenceScratch
+ );
+ const dotProduct = Cartesian3_default.dot(v7, direction2);
+ if (dotProduct > maximumValue) {
+ maximumValue = dotProduct;
+ closest = Cartesian3_default.clone(s, closest);
+ }
+ }
+ const surfacePoint = ellipsoid.cartesianToCartographic(
+ closest,
+ surfPointScratch
+ );
+ maximumValue = Math_default.clamp(maximumValue, 0, 1);
+ altitude = Cartesian3_default.magnitude(
+ Cartesian3_default.subtract(closest, position, referenceScratch)
+ ) * Math.sqrt(1 - maximumValue * maximumValue);
+ altitude = intersects ? -altitude : altitude;
+ surfacePoint.height = altitude;
+ return ellipsoid.cartographicToCartesian(surfacePoint, new Cartesian3_default());
+ }
+ return void 0;
+};
+var lineSegmentPlaneDifference = new Cartesian3_default();
+IntersectionTests.lineSegmentPlane = function(endPoint0, endPoint1, plane, result) {
+ if (!defined_default(endPoint0)) {
+ throw new DeveloperError_default("endPoint0 is required.");
+ }
+ if (!defined_default(endPoint1)) {
+ throw new DeveloperError_default("endPoint1 is required.");
+ }
+ if (!defined_default(plane)) {
+ throw new DeveloperError_default("plane is required.");
+ }
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ const difference = Cartesian3_default.subtract(
+ endPoint1,
+ endPoint0,
+ lineSegmentPlaneDifference
+ );
+ const normal2 = plane.normal;
+ const nDotDiff = Cartesian3_default.dot(normal2, difference);
+ if (Math.abs(nDotDiff) < Math_default.EPSILON6) {
+ return void 0;
+ }
+ const nDotP0 = Cartesian3_default.dot(normal2, endPoint0);
+ const t = -(plane.distance + nDotP0) / nDotDiff;
+ if (t < 0 || t > 1) {
+ return void 0;
+ }
+ Cartesian3_default.multiplyByScalar(difference, t, result);
+ Cartesian3_default.add(endPoint0, result, result);
+ return result;
+};
+IntersectionTests.trianglePlaneIntersection = function(p0, p1, p2, plane) {
+ if (!defined_default(p0) || !defined_default(p1) || !defined_default(p2) || !defined_default(plane)) {
+ throw new DeveloperError_default("p0, p1, p2, and plane are required.");
+ }
+ const planeNormal = plane.normal;
+ const planeD = plane.distance;
+ const p0Behind = Cartesian3_default.dot(planeNormal, p0) + planeD < 0;
+ const p1Behind = Cartesian3_default.dot(planeNormal, p1) + planeD < 0;
+ const p2Behind = Cartesian3_default.dot(planeNormal, p2) + planeD < 0;
+ let numBehind = 0;
+ numBehind += p0Behind ? 1 : 0;
+ numBehind += p1Behind ? 1 : 0;
+ numBehind += p2Behind ? 1 : 0;
+ let u12, u22;
+ if (numBehind === 1 || numBehind === 2) {
+ u12 = new Cartesian3_default();
+ u22 = new Cartesian3_default();
+ }
+ if (numBehind === 1) {
+ if (p0Behind) {
+ IntersectionTests.lineSegmentPlane(p0, p1, plane, u12);
+ IntersectionTests.lineSegmentPlane(p0, p2, plane, u22);
+ return {
+ positions: [p0, p1, p2, u12, u22],
+ indices: [
+ 0,
+ 3,
+ 4,
+ 1,
+ 2,
+ 4,
+ 1,
+ 4,
+ 3
+ ]
+ };
+ } else if (p1Behind) {
+ IntersectionTests.lineSegmentPlane(p1, p2, plane, u12);
+ IntersectionTests.lineSegmentPlane(p1, p0, plane, u22);
+ return {
+ positions: [p0, p1, p2, u12, u22],
+ indices: [
+ 1,
+ 3,
+ 4,
+ 2,
+ 0,
+ 4,
+ 2,
+ 4,
+ 3
+ ]
+ };
+ } else if (p2Behind) {
+ IntersectionTests.lineSegmentPlane(p2, p0, plane, u12);
+ IntersectionTests.lineSegmentPlane(p2, p1, plane, u22);
+ return {
+ positions: [p0, p1, p2, u12, u22],
+ indices: [
+ 2,
+ 3,
+ 4,
+ 0,
+ 1,
+ 4,
+ 0,
+ 4,
+ 3
+ ]
+ };
+ }
+ } else if (numBehind === 2) {
+ if (!p0Behind) {
+ IntersectionTests.lineSegmentPlane(p1, p0, plane, u12);
+ IntersectionTests.lineSegmentPlane(p2, p0, plane, u22);
+ return {
+ positions: [p0, p1, p2, u12, u22],
+ indices: [
+ 1,
+ 2,
+ 4,
+ 1,
+ 4,
+ 3,
+ 0,
+ 3,
+ 4
+ ]
+ };
+ } else if (!p1Behind) {
+ IntersectionTests.lineSegmentPlane(p2, p1, plane, u12);
+ IntersectionTests.lineSegmentPlane(p0, p1, plane, u22);
+ return {
+ positions: [p0, p1, p2, u12, u22],
+ indices: [
+ 2,
+ 0,
+ 4,
+ 2,
+ 4,
+ 3,
+ 1,
+ 3,
+ 4
+ ]
+ };
+ } else if (!p2Behind) {
+ IntersectionTests.lineSegmentPlane(p0, p2, plane, u12);
+ IntersectionTests.lineSegmentPlane(p1, p2, plane, u22);
+ return {
+ positions: [p0, p1, p2, u12, u22],
+ indices: [
+ 0,
+ 1,
+ 4,
+ 0,
+ 4,
+ 3,
+ 2,
+ 3,
+ 4
+ ]
+ };
+ }
+ }
+ return void 0;
+};
+var IntersectionTests_default = IntersectionTests;
+
+// Source/Core/EllipsoidTangentPlane.js
+var scratchCart4 = new Cartesian4_default();
+function EllipsoidTangentPlane(origin, ellipsoid) {
+ Check_default.defined("origin", origin);
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ origin = ellipsoid.scaleToGeodeticSurface(origin);
+ if (!defined_default(origin)) {
+ throw new DeveloperError_default(
+ "origin must not be at the center of the ellipsoid."
+ );
+ }
+ const eastNorthUp = Transforms_default.eastNorthUpToFixedFrame(origin, ellipsoid);
+ this._ellipsoid = ellipsoid;
+ this._origin = origin;
+ this._xAxis = Cartesian3_default.fromCartesian4(
+ Matrix4_default.getColumn(eastNorthUp, 0, scratchCart4)
+ );
+ this._yAxis = Cartesian3_default.fromCartesian4(
+ Matrix4_default.getColumn(eastNorthUp, 1, scratchCart4)
+ );
+ const normal2 = Cartesian3_default.fromCartesian4(
+ Matrix4_default.getColumn(eastNorthUp, 2, scratchCart4)
+ );
+ this._plane = Plane_default.fromPointNormal(origin, normal2);
+}
+Object.defineProperties(EllipsoidTangentPlane.prototype, {
+ ellipsoid: {
+ get: function() {
+ return this._ellipsoid;
+ }
+ },
+ origin: {
+ get: function() {
+ return this._origin;
+ }
+ },
+ plane: {
+ get: function() {
+ return this._plane;
+ }
+ },
+ xAxis: {
+ get: function() {
+ return this._xAxis;
+ }
+ },
+ yAxis: {
+ get: function() {
+ return this._yAxis;
+ }
+ },
+ zAxis: {
+ get: function() {
+ return this._plane.normal;
+ }
+ }
+});
+var tmp = new AxisAlignedBoundingBox_default();
+EllipsoidTangentPlane.fromPoints = function(cartesians, ellipsoid) {
+ Check_default.defined("cartesians", cartesians);
+ const box = AxisAlignedBoundingBox_default.fromPoints(cartesians, tmp);
+ return new EllipsoidTangentPlane(box.center, ellipsoid);
+};
+var scratchProjectPointOntoPlaneRay = new Ray_default();
+var scratchProjectPointOntoPlaneCartesian3 = new Cartesian3_default();
+EllipsoidTangentPlane.prototype.projectPointOntoPlane = function(cartesian11, result) {
+ Check_default.defined("cartesian", cartesian11);
+ const ray = scratchProjectPointOntoPlaneRay;
+ ray.origin = cartesian11;
+ Cartesian3_default.normalize(cartesian11, ray.direction);
+ let intersectionPoint = IntersectionTests_default.rayPlane(
+ ray,
+ this._plane,
+ scratchProjectPointOntoPlaneCartesian3
+ );
+ if (!defined_default(intersectionPoint)) {
+ Cartesian3_default.negate(ray.direction, ray.direction);
+ intersectionPoint = IntersectionTests_default.rayPlane(
+ ray,
+ this._plane,
+ scratchProjectPointOntoPlaneCartesian3
+ );
+ }
+ if (defined_default(intersectionPoint)) {
+ const v7 = Cartesian3_default.subtract(
+ intersectionPoint,
+ this._origin,
+ intersectionPoint
+ );
+ const x = Cartesian3_default.dot(this._xAxis, v7);
+ const y = Cartesian3_default.dot(this._yAxis, v7);
+ if (!defined_default(result)) {
+ return new Cartesian2_default(x, y);
+ }
+ result.x = x;
+ result.y = y;
+ return result;
+ }
+ return void 0;
+};
+EllipsoidTangentPlane.prototype.projectPointsOntoPlane = function(cartesians, result) {
+ Check_default.defined("cartesians", cartesians);
+ if (!defined_default(result)) {
+ result = [];
+ }
+ let count = 0;
+ const length3 = cartesians.length;
+ for (let i = 0; i < length3; i++) {
+ const p = this.projectPointOntoPlane(cartesians[i], result[count]);
+ if (defined_default(p)) {
+ result[count] = p;
+ count++;
+ }
+ }
+ result.length = count;
+ return result;
+};
+EllipsoidTangentPlane.prototype.projectPointToNearestOnPlane = function(cartesian11, result) {
+ Check_default.defined("cartesian", cartesian11);
+ if (!defined_default(result)) {
+ result = new Cartesian2_default();
+ }
+ const ray = scratchProjectPointOntoPlaneRay;
+ ray.origin = cartesian11;
+ Cartesian3_default.clone(this._plane.normal, ray.direction);
+ let intersectionPoint = IntersectionTests_default.rayPlane(
+ ray,
+ this._plane,
+ scratchProjectPointOntoPlaneCartesian3
+ );
+ if (!defined_default(intersectionPoint)) {
+ Cartesian3_default.negate(ray.direction, ray.direction);
+ intersectionPoint = IntersectionTests_default.rayPlane(
+ ray,
+ this._plane,
+ scratchProjectPointOntoPlaneCartesian3
+ );
+ }
+ const v7 = Cartesian3_default.subtract(
+ intersectionPoint,
+ this._origin,
+ intersectionPoint
+ );
+ const x = Cartesian3_default.dot(this._xAxis, v7);
+ const y = Cartesian3_default.dot(this._yAxis, v7);
+ result.x = x;
+ result.y = y;
+ return result;
+};
+EllipsoidTangentPlane.prototype.projectPointsToNearestOnPlane = function(cartesians, result) {
+ Check_default.defined("cartesians", cartesians);
+ if (!defined_default(result)) {
+ result = [];
+ }
+ const length3 = cartesians.length;
+ result.length = length3;
+ for (let i = 0; i < length3; i++) {
+ result[i] = this.projectPointToNearestOnPlane(cartesians[i], result[i]);
+ }
+ return result;
+};
+var projectPointsOntoEllipsoidScratch = new Cartesian3_default();
+EllipsoidTangentPlane.prototype.projectPointOntoEllipsoid = function(cartesian11, result) {
+ Check_default.defined("cartesian", cartesian11);
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ const ellipsoid = this._ellipsoid;
+ const origin = this._origin;
+ const xAxis = this._xAxis;
+ const yAxis = this._yAxis;
+ const tmp2 = projectPointsOntoEllipsoidScratch;
+ Cartesian3_default.multiplyByScalar(xAxis, cartesian11.x, tmp2);
+ result = Cartesian3_default.add(origin, tmp2, result);
+ Cartesian3_default.multiplyByScalar(yAxis, cartesian11.y, tmp2);
+ Cartesian3_default.add(result, tmp2, result);
+ ellipsoid.scaleToGeocentricSurface(result, result);
+ return result;
+};
+EllipsoidTangentPlane.prototype.projectPointsOntoEllipsoid = function(cartesians, result) {
+ Check_default.defined("cartesians", cartesians);
+ const length3 = cartesians.length;
+ if (!defined_default(result)) {
+ result = new Array(length3);
+ } else {
+ result.length = length3;
+ }
+ for (let i = 0; i < length3; ++i) {
+ result[i] = this.projectPointOntoEllipsoid(cartesians[i], result[i]);
+ }
+ return result;
+};
+var EllipsoidTangentPlane_default = EllipsoidTangentPlane;
+
+// Source/Core/OrientedBoundingBox.js
+function OrientedBoundingBox(center, halfAxes) {
+ this.center = Cartesian3_default.clone(defaultValue_default(center, Cartesian3_default.ZERO));
+ this.halfAxes = Matrix3_default.clone(defaultValue_default(halfAxes, Matrix3_default.ZERO));
+}
+OrientedBoundingBox.packedLength = Cartesian3_default.packedLength + Matrix3_default.packedLength;
+OrientedBoundingBox.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ Cartesian3_default.pack(value.center, array, startingIndex);
+ Matrix3_default.pack(value.halfAxes, array, startingIndex + Cartesian3_default.packedLength);
+ return array;
+};
+OrientedBoundingBox.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ if (!defined_default(result)) {
+ result = new OrientedBoundingBox();
+ }
+ Cartesian3_default.unpack(array, startingIndex, result.center);
+ Matrix3_default.unpack(
+ array,
+ startingIndex + Cartesian3_default.packedLength,
+ result.halfAxes
+ );
+ return result;
+};
+var scratchCartesian1 = new Cartesian3_default();
+var scratchCartesian2 = new Cartesian3_default();
+var scratchCartesian32 = new Cartesian3_default();
+var scratchCartesian4 = new Cartesian3_default();
+var scratchCartesian5 = new Cartesian3_default();
+var scratchCartesian6 = new Cartesian3_default();
+var scratchCovarianceResult = new Matrix3_default();
+var scratchEigenResult = {
+ unitary: new Matrix3_default(),
+ diagonal: new Matrix3_default()
+};
+OrientedBoundingBox.fromPoints = function(positions, result) {
+ if (!defined_default(result)) {
+ result = new OrientedBoundingBox();
+ }
+ if (!defined_default(positions) || positions.length === 0) {
+ result.halfAxes = Matrix3_default.ZERO;
+ result.center = Cartesian3_default.ZERO;
+ return result;
+ }
+ let i;
+ const length3 = positions.length;
+ const meanPoint = Cartesian3_default.clone(positions[0], scratchCartesian1);
+ for (i = 1; i < length3; i++) {
+ Cartesian3_default.add(meanPoint, positions[i], meanPoint);
+ }
+ const invLength = 1 / length3;
+ Cartesian3_default.multiplyByScalar(meanPoint, invLength, meanPoint);
+ let exx = 0;
+ let exy = 0;
+ let exz = 0;
+ let eyy = 0;
+ let eyz = 0;
+ let ezz = 0;
+ let p;
+ for (i = 0; i < length3; i++) {
+ p = Cartesian3_default.subtract(positions[i], meanPoint, scratchCartesian2);
+ exx += p.x * p.x;
+ exy += p.x * p.y;
+ exz += p.x * p.z;
+ eyy += p.y * p.y;
+ eyz += p.y * p.z;
+ ezz += p.z * p.z;
+ }
+ exx *= invLength;
+ exy *= invLength;
+ exz *= invLength;
+ eyy *= invLength;
+ eyz *= invLength;
+ ezz *= invLength;
+ const covarianceMatrix = scratchCovarianceResult;
+ covarianceMatrix[0] = exx;
+ covarianceMatrix[1] = exy;
+ covarianceMatrix[2] = exz;
+ covarianceMatrix[3] = exy;
+ covarianceMatrix[4] = eyy;
+ covarianceMatrix[5] = eyz;
+ covarianceMatrix[6] = exz;
+ covarianceMatrix[7] = eyz;
+ covarianceMatrix[8] = ezz;
+ const eigenDecomposition = Matrix3_default.computeEigenDecomposition(
+ covarianceMatrix,
+ scratchEigenResult
+ );
+ const rotation = Matrix3_default.clone(eigenDecomposition.unitary, result.halfAxes);
+ let v13 = Matrix3_default.getColumn(rotation, 0, scratchCartesian4);
+ let v23 = Matrix3_default.getColumn(rotation, 1, scratchCartesian5);
+ let v32 = Matrix3_default.getColumn(rotation, 2, scratchCartesian6);
+ let u12 = -Number.MAX_VALUE;
+ let u22 = -Number.MAX_VALUE;
+ let u3 = -Number.MAX_VALUE;
+ let l1 = Number.MAX_VALUE;
+ let l2 = Number.MAX_VALUE;
+ let l3 = Number.MAX_VALUE;
+ for (i = 0; i < length3; i++) {
+ p = positions[i];
+ u12 = Math.max(Cartesian3_default.dot(v13, p), u12);
+ u22 = Math.max(Cartesian3_default.dot(v23, p), u22);
+ u3 = Math.max(Cartesian3_default.dot(v32, p), u3);
+ l1 = Math.min(Cartesian3_default.dot(v13, p), l1);
+ l2 = Math.min(Cartesian3_default.dot(v23, p), l2);
+ l3 = Math.min(Cartesian3_default.dot(v32, p), l3);
+ }
+ v13 = Cartesian3_default.multiplyByScalar(v13, 0.5 * (l1 + u12), v13);
+ v23 = Cartesian3_default.multiplyByScalar(v23, 0.5 * (l2 + u22), v23);
+ v32 = Cartesian3_default.multiplyByScalar(v32, 0.5 * (l3 + u3), v32);
+ const center = Cartesian3_default.add(v13, v23, result.center);
+ Cartesian3_default.add(center, v32, center);
+ const scale = scratchCartesian32;
+ scale.x = u12 - l1;
+ scale.y = u22 - l2;
+ scale.z = u3 - l3;
+ Cartesian3_default.multiplyByScalar(scale, 0.5, scale);
+ Matrix3_default.multiplyByScale(result.halfAxes, scale, result.halfAxes);
+ return result;
+};
+var scratchOffset = new Cartesian3_default();
+var scratchScale2 = new Cartesian3_default();
+function fromPlaneExtents(planeOrigin, planeXAxis, planeYAxis, planeZAxis, minimumX, maximumX, minimumY, maximumY, minimumZ, maximumZ, result) {
+ if (!defined_default(minimumX) || !defined_default(maximumX) || !defined_default(minimumY) || !defined_default(maximumY) || !defined_default(minimumZ) || !defined_default(maximumZ)) {
+ throw new DeveloperError_default(
+ "all extents (minimum/maximum X/Y/Z) are required."
+ );
+ }
+ if (!defined_default(result)) {
+ result = new OrientedBoundingBox();
+ }
+ const halfAxes = result.halfAxes;
+ Matrix3_default.setColumn(halfAxes, 0, planeXAxis, halfAxes);
+ Matrix3_default.setColumn(halfAxes, 1, planeYAxis, halfAxes);
+ Matrix3_default.setColumn(halfAxes, 2, planeZAxis, halfAxes);
+ let centerOffset = scratchOffset;
+ centerOffset.x = (minimumX + maximumX) / 2;
+ centerOffset.y = (minimumY + maximumY) / 2;
+ centerOffset.z = (minimumZ + maximumZ) / 2;
+ const scale = scratchScale2;
+ scale.x = (maximumX - minimumX) / 2;
+ scale.y = (maximumY - minimumY) / 2;
+ scale.z = (maximumZ - minimumZ) / 2;
+ const center = result.center;
+ centerOffset = Matrix3_default.multiplyByVector(halfAxes, centerOffset, centerOffset);
+ Cartesian3_default.add(planeOrigin, centerOffset, center);
+ Matrix3_default.multiplyByScale(halfAxes, scale, halfAxes);
+ return result;
+}
+var scratchRectangleCenterCartographic = new Cartographic_default();
+var scratchRectangleCenter = new Cartesian3_default();
+var scratchPerimeterCartographicNC = new Cartographic_default();
+var scratchPerimeterCartographicNW = new Cartographic_default();
+var scratchPerimeterCartographicCW = new Cartographic_default();
+var scratchPerimeterCartographicSW = new Cartographic_default();
+var scratchPerimeterCartographicSC = new Cartographic_default();
+var scratchPerimeterCartesianNC = new Cartesian3_default();
+var scratchPerimeterCartesianNW = new Cartesian3_default();
+var scratchPerimeterCartesianCW = new Cartesian3_default();
+var scratchPerimeterCartesianSW = new Cartesian3_default();
+var scratchPerimeterCartesianSC = new Cartesian3_default();
+var scratchPerimeterProjectedNC = new Cartesian2_default();
+var scratchPerimeterProjectedNW = new Cartesian2_default();
+var scratchPerimeterProjectedCW = new Cartesian2_default();
+var scratchPerimeterProjectedSW = new Cartesian2_default();
+var scratchPerimeterProjectedSC = new Cartesian2_default();
+var scratchPlaneOrigin = new Cartesian3_default();
+var scratchPlaneNormal2 = new Cartesian3_default();
+var scratchPlaneXAxis = new Cartesian3_default();
+var scratchHorizonCartesian = new Cartesian3_default();
+var scratchHorizonProjected = new Cartesian2_default();
+var scratchMaxY = new Cartesian3_default();
+var scratchMinY = new Cartesian3_default();
+var scratchZ = new Cartesian3_default();
+var scratchPlane2 = new Plane_default(Cartesian3_default.UNIT_X, 0);
+OrientedBoundingBox.fromRectangle = function(rectangle, minimumHeight, maximumHeight, ellipsoid, result) {
+ if (!defined_default(rectangle)) {
+ throw new DeveloperError_default("rectangle is required");
+ }
+ if (rectangle.width < 0 || rectangle.width > Math_default.TWO_PI) {
+ throw new DeveloperError_default("Rectangle width must be between 0 and 2*pi");
+ }
+ if (rectangle.height < 0 || rectangle.height > Math_default.PI) {
+ throw new DeveloperError_default("Rectangle height must be between 0 and pi");
+ }
+ if (defined_default(ellipsoid) && !Math_default.equalsEpsilon(
+ ellipsoid.radii.x,
+ ellipsoid.radii.y,
+ Math_default.EPSILON15
+ )) {
+ throw new DeveloperError_default(
+ "Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)"
+ );
+ }
+ minimumHeight = defaultValue_default(minimumHeight, 0);
+ maximumHeight = defaultValue_default(maximumHeight, 0);
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ let minX, maxX, minY, maxY, minZ, maxZ, plane;
+ if (rectangle.width <= Math_default.PI) {
+ const tangentPointCartographic = Rectangle_default.center(
+ rectangle,
+ scratchRectangleCenterCartographic
+ );
+ const tangentPoint = ellipsoid.cartographicToCartesian(
+ tangentPointCartographic,
+ scratchRectangleCenter
+ );
+ const tangentPlane = new EllipsoidTangentPlane_default(tangentPoint, ellipsoid);
+ plane = tangentPlane.plane;
+ const lonCenter = tangentPointCartographic.longitude;
+ const latCenter = rectangle.south < 0 && rectangle.north > 0 ? 0 : tangentPointCartographic.latitude;
+ const perimeterCartographicNC = Cartographic_default.fromRadians(
+ lonCenter,
+ rectangle.north,
+ maximumHeight,
+ scratchPerimeterCartographicNC
+ );
+ const perimeterCartographicNW = Cartographic_default.fromRadians(
+ rectangle.west,
+ rectangle.north,
+ maximumHeight,
+ scratchPerimeterCartographicNW
+ );
+ const perimeterCartographicCW = Cartographic_default.fromRadians(
+ rectangle.west,
+ latCenter,
+ maximumHeight,
+ scratchPerimeterCartographicCW
+ );
+ const perimeterCartographicSW = Cartographic_default.fromRadians(
+ rectangle.west,
+ rectangle.south,
+ maximumHeight,
+ scratchPerimeterCartographicSW
+ );
+ const perimeterCartographicSC = Cartographic_default.fromRadians(
+ lonCenter,
+ rectangle.south,
+ maximumHeight,
+ scratchPerimeterCartographicSC
+ );
+ const perimeterCartesianNC = ellipsoid.cartographicToCartesian(
+ perimeterCartographicNC,
+ scratchPerimeterCartesianNC
+ );
+ let perimeterCartesianNW = ellipsoid.cartographicToCartesian(
+ perimeterCartographicNW,
+ scratchPerimeterCartesianNW
+ );
+ const perimeterCartesianCW = ellipsoid.cartographicToCartesian(
+ perimeterCartographicCW,
+ scratchPerimeterCartesianCW
+ );
+ let perimeterCartesianSW = ellipsoid.cartographicToCartesian(
+ perimeterCartographicSW,
+ scratchPerimeterCartesianSW
+ );
+ const perimeterCartesianSC = ellipsoid.cartographicToCartesian(
+ perimeterCartographicSC,
+ scratchPerimeterCartesianSC
+ );
+ const perimeterProjectedNC = tangentPlane.projectPointToNearestOnPlane(
+ perimeterCartesianNC,
+ scratchPerimeterProjectedNC
+ );
+ const perimeterProjectedNW = tangentPlane.projectPointToNearestOnPlane(
+ perimeterCartesianNW,
+ scratchPerimeterProjectedNW
+ );
+ const perimeterProjectedCW = tangentPlane.projectPointToNearestOnPlane(
+ perimeterCartesianCW,
+ scratchPerimeterProjectedCW
+ );
+ const perimeterProjectedSW = tangentPlane.projectPointToNearestOnPlane(
+ perimeterCartesianSW,
+ scratchPerimeterProjectedSW
+ );
+ const perimeterProjectedSC = tangentPlane.projectPointToNearestOnPlane(
+ perimeterCartesianSC,
+ scratchPerimeterProjectedSC
+ );
+ minX = Math.min(
+ perimeterProjectedNW.x,
+ perimeterProjectedCW.x,
+ perimeterProjectedSW.x
+ );
+ maxX = -minX;
+ maxY = Math.max(perimeterProjectedNW.y, perimeterProjectedNC.y);
+ minY = Math.min(perimeterProjectedSW.y, perimeterProjectedSC.y);
+ perimeterCartographicNW.height = perimeterCartographicSW.height = minimumHeight;
+ perimeterCartesianNW = ellipsoid.cartographicToCartesian(
+ perimeterCartographicNW,
+ scratchPerimeterCartesianNW
+ );
+ perimeterCartesianSW = ellipsoid.cartographicToCartesian(
+ perimeterCartographicSW,
+ scratchPerimeterCartesianSW
+ );
+ minZ = Math.min(
+ Plane_default.getPointDistance(plane, perimeterCartesianNW),
+ Plane_default.getPointDistance(plane, perimeterCartesianSW)
+ );
+ maxZ = maximumHeight;
+ return fromPlaneExtents(
+ tangentPlane.origin,
+ tangentPlane.xAxis,
+ tangentPlane.yAxis,
+ tangentPlane.zAxis,
+ minX,
+ maxX,
+ minY,
+ maxY,
+ minZ,
+ maxZ,
+ result
+ );
+ }
+ const fullyAboveEquator = rectangle.south > 0;
+ const fullyBelowEquator = rectangle.north < 0;
+ const latitudeNearestToEquator = fullyAboveEquator ? rectangle.south : fullyBelowEquator ? rectangle.north : 0;
+ const centerLongitude = Rectangle_default.center(
+ rectangle,
+ scratchRectangleCenterCartographic
+ ).longitude;
+ const planeOrigin = Cartesian3_default.fromRadians(
+ centerLongitude,
+ latitudeNearestToEquator,
+ maximumHeight,
+ ellipsoid,
+ scratchPlaneOrigin
+ );
+ planeOrigin.z = 0;
+ const isPole = Math.abs(planeOrigin.x) < Math_default.EPSILON10 && Math.abs(planeOrigin.y) < Math_default.EPSILON10;
+ const planeNormal = !isPole ? Cartesian3_default.normalize(planeOrigin, scratchPlaneNormal2) : Cartesian3_default.UNIT_X;
+ const planeYAxis = Cartesian3_default.UNIT_Z;
+ const planeXAxis = Cartesian3_default.cross(
+ planeNormal,
+ planeYAxis,
+ scratchPlaneXAxis
+ );
+ plane = Plane_default.fromPointNormal(planeOrigin, planeNormal, scratchPlane2);
+ const horizonCartesian = Cartesian3_default.fromRadians(
+ centerLongitude + Math_default.PI_OVER_TWO,
+ latitudeNearestToEquator,
+ maximumHeight,
+ ellipsoid,
+ scratchHorizonCartesian
+ );
+ maxX = Cartesian3_default.dot(
+ Plane_default.projectPointOntoPlane(
+ plane,
+ horizonCartesian,
+ scratchHorizonProjected
+ ),
+ planeXAxis
+ );
+ minX = -maxX;
+ maxY = Cartesian3_default.fromRadians(
+ 0,
+ rectangle.north,
+ fullyBelowEquator ? minimumHeight : maximumHeight,
+ ellipsoid,
+ scratchMaxY
+ ).z;
+ minY = Cartesian3_default.fromRadians(
+ 0,
+ rectangle.south,
+ fullyAboveEquator ? minimumHeight : maximumHeight,
+ ellipsoid,
+ scratchMinY
+ ).z;
+ const farZ = Cartesian3_default.fromRadians(
+ rectangle.east,
+ latitudeNearestToEquator,
+ maximumHeight,
+ ellipsoid,
+ scratchZ
+ );
+ minZ = Plane_default.getPointDistance(plane, farZ);
+ maxZ = 0;
+ return fromPlaneExtents(
+ planeOrigin,
+ planeXAxis,
+ planeYAxis,
+ planeNormal,
+ minX,
+ maxX,
+ minY,
+ maxY,
+ minZ,
+ maxZ,
+ result
+ );
+};
+OrientedBoundingBox.fromTransformation = function(transformation, result) {
+ Check_default.typeOf.object("transformation", transformation);
+ if (!defined_default(result)) {
+ result = new OrientedBoundingBox();
+ }
+ result.center = Matrix4_default.getTranslation(transformation, result.center);
+ result.halfAxes = Matrix4_default.getMatrix3(transformation, result.halfAxes);
+ result.halfAxes = Matrix3_default.multiplyByScalar(
+ result.halfAxes,
+ 0.5,
+ result.halfAxes
+ );
+ return result;
+};
+OrientedBoundingBox.clone = function(box, result) {
+ if (!defined_default(box)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new OrientedBoundingBox(box.center, box.halfAxes);
+ }
+ Cartesian3_default.clone(box.center, result.center);
+ Matrix3_default.clone(box.halfAxes, result.halfAxes);
+ return result;
+};
+OrientedBoundingBox.intersectPlane = function(box, plane) {
+ if (!defined_default(box)) {
+ throw new DeveloperError_default("box is required.");
+ }
+ if (!defined_default(plane)) {
+ throw new DeveloperError_default("plane is required.");
+ }
+ const center = box.center;
+ const normal2 = plane.normal;
+ const halfAxes = box.halfAxes;
+ const normalX = normal2.x, normalY = normal2.y, normalZ = normal2.z;
+ const radEffective = Math.abs(
+ normalX * halfAxes[Matrix3_default.COLUMN0ROW0] + normalY * halfAxes[Matrix3_default.COLUMN0ROW1] + normalZ * halfAxes[Matrix3_default.COLUMN0ROW2]
+ ) + Math.abs(
+ normalX * halfAxes[Matrix3_default.COLUMN1ROW0] + normalY * halfAxes[Matrix3_default.COLUMN1ROW1] + normalZ * halfAxes[Matrix3_default.COLUMN1ROW2]
+ ) + Math.abs(
+ normalX * halfAxes[Matrix3_default.COLUMN2ROW0] + normalY * halfAxes[Matrix3_default.COLUMN2ROW1] + normalZ * halfAxes[Matrix3_default.COLUMN2ROW2]
+ );
+ const distanceToPlane = Cartesian3_default.dot(normal2, center) + plane.distance;
+ if (distanceToPlane <= -radEffective) {
+ return Intersect_default.OUTSIDE;
+ } else if (distanceToPlane >= radEffective) {
+ return Intersect_default.INSIDE;
+ }
+ return Intersect_default.INTERSECTING;
+};
+var scratchCartesianU = new Cartesian3_default();
+var scratchCartesianV = new Cartesian3_default();
+var scratchCartesianW = new Cartesian3_default();
+var scratchValidAxis2 = new Cartesian3_default();
+var scratchValidAxis3 = new Cartesian3_default();
+var scratchPPrime = new Cartesian3_default();
+OrientedBoundingBox.distanceSquaredTo = function(box, cartesian11) {
+ if (!defined_default(box)) {
+ throw new DeveloperError_default("box is required.");
+ }
+ if (!defined_default(cartesian11)) {
+ throw new DeveloperError_default("cartesian is required.");
+ }
+ const offset2 = Cartesian3_default.subtract(cartesian11, box.center, scratchOffset);
+ const halfAxes = box.halfAxes;
+ let u3 = Matrix3_default.getColumn(halfAxes, 0, scratchCartesianU);
+ let v7 = Matrix3_default.getColumn(halfAxes, 1, scratchCartesianV);
+ let w = Matrix3_default.getColumn(halfAxes, 2, scratchCartesianW);
+ const uHalf = Cartesian3_default.magnitude(u3);
+ const vHalf = Cartesian3_default.magnitude(v7);
+ const wHalf = Cartesian3_default.magnitude(w);
+ let uValid = true;
+ let vValid = true;
+ let wValid = true;
+ if (uHalf > 0) {
+ Cartesian3_default.divideByScalar(u3, uHalf, u3);
+ } else {
+ uValid = false;
+ }
+ if (vHalf > 0) {
+ Cartesian3_default.divideByScalar(v7, vHalf, v7);
+ } else {
+ vValid = false;
+ }
+ if (wHalf > 0) {
+ Cartesian3_default.divideByScalar(w, wHalf, w);
+ } else {
+ wValid = false;
+ }
+ const numberOfDegenerateAxes = !uValid + !vValid + !wValid;
+ let validAxis1;
+ let validAxis2;
+ let validAxis3;
+ if (numberOfDegenerateAxes === 1) {
+ let degenerateAxis = u3;
+ validAxis1 = v7;
+ validAxis2 = w;
+ if (!vValid) {
+ degenerateAxis = v7;
+ validAxis1 = u3;
+ } else if (!wValid) {
+ degenerateAxis = w;
+ validAxis2 = u3;
+ }
+ validAxis3 = Cartesian3_default.cross(validAxis1, validAxis2, scratchValidAxis3);
+ if (degenerateAxis === u3) {
+ u3 = validAxis3;
+ } else if (degenerateAxis === v7) {
+ v7 = validAxis3;
+ } else if (degenerateAxis === w) {
+ w = validAxis3;
+ }
+ } else if (numberOfDegenerateAxes === 2) {
+ validAxis1 = u3;
+ if (vValid) {
+ validAxis1 = v7;
+ } else if (wValid) {
+ validAxis1 = w;
+ }
+ let crossVector = Cartesian3_default.UNIT_Y;
+ if (crossVector.equalsEpsilon(validAxis1, Math_default.EPSILON3)) {
+ crossVector = Cartesian3_default.UNIT_X;
+ }
+ validAxis2 = Cartesian3_default.cross(validAxis1, crossVector, scratchValidAxis2);
+ Cartesian3_default.normalize(validAxis2, validAxis2);
+ validAxis3 = Cartesian3_default.cross(validAxis1, validAxis2, scratchValidAxis3);
+ Cartesian3_default.normalize(validAxis3, validAxis3);
+ if (validAxis1 === u3) {
+ v7 = validAxis2;
+ w = validAxis3;
+ } else if (validAxis1 === v7) {
+ w = validAxis2;
+ u3 = validAxis3;
+ } else if (validAxis1 === w) {
+ u3 = validAxis2;
+ v7 = validAxis3;
+ }
+ } else if (numberOfDegenerateAxes === 3) {
+ u3 = Cartesian3_default.UNIT_X;
+ v7 = Cartesian3_default.UNIT_Y;
+ w = Cartesian3_default.UNIT_Z;
+ }
+ const pPrime = scratchPPrime;
+ pPrime.x = Cartesian3_default.dot(offset2, u3);
+ pPrime.y = Cartesian3_default.dot(offset2, v7);
+ pPrime.z = Cartesian3_default.dot(offset2, w);
+ let distanceSquared = 0;
+ let d;
+ if (pPrime.x < -uHalf) {
+ d = pPrime.x + uHalf;
+ distanceSquared += d * d;
+ } else if (pPrime.x > uHalf) {
+ d = pPrime.x - uHalf;
+ distanceSquared += d * d;
+ }
+ if (pPrime.y < -vHalf) {
+ d = pPrime.y + vHalf;
+ distanceSquared += d * d;
+ } else if (pPrime.y > vHalf) {
+ d = pPrime.y - vHalf;
+ distanceSquared += d * d;
+ }
+ if (pPrime.z < -wHalf) {
+ d = pPrime.z + wHalf;
+ distanceSquared += d * d;
+ } else if (pPrime.z > wHalf) {
+ d = pPrime.z - wHalf;
+ distanceSquared += d * d;
+ }
+ return distanceSquared;
+};
+var scratchCorner = new Cartesian3_default();
+var scratchToCenter = new Cartesian3_default();
+OrientedBoundingBox.computePlaneDistances = function(box, position, direction2, result) {
+ if (!defined_default(box)) {
+ throw new DeveloperError_default("box is required.");
+ }
+ if (!defined_default(position)) {
+ throw new DeveloperError_default("position is required.");
+ }
+ if (!defined_default(direction2)) {
+ throw new DeveloperError_default("direction is required.");
+ }
+ if (!defined_default(result)) {
+ result = new Interval_default();
+ }
+ let minDist = Number.POSITIVE_INFINITY;
+ let maxDist = Number.NEGATIVE_INFINITY;
+ const center = box.center;
+ const halfAxes = box.halfAxes;
+ const u3 = Matrix3_default.getColumn(halfAxes, 0, scratchCartesianU);
+ const v7 = Matrix3_default.getColumn(halfAxes, 1, scratchCartesianV);
+ const w = Matrix3_default.getColumn(halfAxes, 2, scratchCartesianW);
+ const corner = Cartesian3_default.add(u3, v7, scratchCorner);
+ Cartesian3_default.add(corner, w, corner);
+ Cartesian3_default.add(corner, center, corner);
+ const toCenter = Cartesian3_default.subtract(corner, position, scratchToCenter);
+ let mag = Cartesian3_default.dot(direction2, toCenter);
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+ Cartesian3_default.add(center, u3, corner);
+ Cartesian3_default.add(corner, v7, corner);
+ Cartesian3_default.subtract(corner, w, corner);
+ Cartesian3_default.subtract(corner, position, toCenter);
+ mag = Cartesian3_default.dot(direction2, toCenter);
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+ Cartesian3_default.add(center, u3, corner);
+ Cartesian3_default.subtract(corner, v7, corner);
+ Cartesian3_default.add(corner, w, corner);
+ Cartesian3_default.subtract(corner, position, toCenter);
+ mag = Cartesian3_default.dot(direction2, toCenter);
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+ Cartesian3_default.add(center, u3, corner);
+ Cartesian3_default.subtract(corner, v7, corner);
+ Cartesian3_default.subtract(corner, w, corner);
+ Cartesian3_default.subtract(corner, position, toCenter);
+ mag = Cartesian3_default.dot(direction2, toCenter);
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+ Cartesian3_default.subtract(center, u3, corner);
+ Cartesian3_default.add(corner, v7, corner);
+ Cartesian3_default.add(corner, w, corner);
+ Cartesian3_default.subtract(corner, position, toCenter);
+ mag = Cartesian3_default.dot(direction2, toCenter);
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+ Cartesian3_default.subtract(center, u3, corner);
+ Cartesian3_default.add(corner, v7, corner);
+ Cartesian3_default.subtract(corner, w, corner);
+ Cartesian3_default.subtract(corner, position, toCenter);
+ mag = Cartesian3_default.dot(direction2, toCenter);
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+ Cartesian3_default.subtract(center, u3, corner);
+ Cartesian3_default.subtract(corner, v7, corner);
+ Cartesian3_default.add(corner, w, corner);
+ Cartesian3_default.subtract(corner, position, toCenter);
+ mag = Cartesian3_default.dot(direction2, toCenter);
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+ Cartesian3_default.subtract(center, u3, corner);
+ Cartesian3_default.subtract(corner, v7, corner);
+ Cartesian3_default.subtract(corner, w, corner);
+ Cartesian3_default.subtract(corner, position, toCenter);
+ mag = Cartesian3_default.dot(direction2, toCenter);
+ minDist = Math.min(mag, minDist);
+ maxDist = Math.max(mag, maxDist);
+ result.start = minDist;
+ result.stop = maxDist;
+ return result;
+};
+var scratchXAxis = new Cartesian3_default();
+var scratchYAxis = new Cartesian3_default();
+var scratchZAxis = new Cartesian3_default();
+OrientedBoundingBox.computeCorners = function(box, result) {
+ Check_default.typeOf.object("box", box);
+ if (!defined_default(result)) {
+ result = [
+ new Cartesian3_default(),
+ new Cartesian3_default(),
+ new Cartesian3_default(),
+ new Cartesian3_default(),
+ new Cartesian3_default(),
+ new Cartesian3_default(),
+ new Cartesian3_default(),
+ new Cartesian3_default()
+ ];
+ }
+ const center = box.center;
+ const halfAxes = box.halfAxes;
+ const xAxis = Matrix3_default.getColumn(halfAxes, 0, scratchXAxis);
+ const yAxis = Matrix3_default.getColumn(halfAxes, 1, scratchYAxis);
+ const zAxis = Matrix3_default.getColumn(halfAxes, 2, scratchZAxis);
+ Cartesian3_default.clone(center, result[0]);
+ Cartesian3_default.subtract(result[0], xAxis, result[0]);
+ Cartesian3_default.subtract(result[0], yAxis, result[0]);
+ Cartesian3_default.subtract(result[0], zAxis, result[0]);
+ Cartesian3_default.clone(center, result[1]);
+ Cartesian3_default.subtract(result[1], xAxis, result[1]);
+ Cartesian3_default.subtract(result[1], yAxis, result[1]);
+ Cartesian3_default.add(result[1], zAxis, result[1]);
+ Cartesian3_default.clone(center, result[2]);
+ Cartesian3_default.subtract(result[2], xAxis, result[2]);
+ Cartesian3_default.add(result[2], yAxis, result[2]);
+ Cartesian3_default.subtract(result[2], zAxis, result[2]);
+ Cartesian3_default.clone(center, result[3]);
+ Cartesian3_default.subtract(result[3], xAxis, result[3]);
+ Cartesian3_default.add(result[3], yAxis, result[3]);
+ Cartesian3_default.add(result[3], zAxis, result[3]);
+ Cartesian3_default.clone(center, result[4]);
+ Cartesian3_default.add(result[4], xAxis, result[4]);
+ Cartesian3_default.subtract(result[4], yAxis, result[4]);
+ Cartesian3_default.subtract(result[4], zAxis, result[4]);
+ Cartesian3_default.clone(center, result[5]);
+ Cartesian3_default.add(result[5], xAxis, result[5]);
+ Cartesian3_default.subtract(result[5], yAxis, result[5]);
+ Cartesian3_default.add(result[5], zAxis, result[5]);
+ Cartesian3_default.clone(center, result[6]);
+ Cartesian3_default.add(result[6], xAxis, result[6]);
+ Cartesian3_default.add(result[6], yAxis, result[6]);
+ Cartesian3_default.subtract(result[6], zAxis, result[6]);
+ Cartesian3_default.clone(center, result[7]);
+ Cartesian3_default.add(result[7], xAxis, result[7]);
+ Cartesian3_default.add(result[7], yAxis, result[7]);
+ Cartesian3_default.add(result[7], zAxis, result[7]);
+ return result;
+};
+var scratchRotationScale = new Matrix3_default();
+OrientedBoundingBox.computeTransformation = function(box, result) {
+ Check_default.typeOf.object("box", box);
+ if (!defined_default(result)) {
+ result = new Matrix4_default();
+ }
+ const translation3 = box.center;
+ const rotationScale = Matrix3_default.multiplyByUniformScale(
+ box.halfAxes,
+ 2,
+ scratchRotationScale
+ );
+ return Matrix4_default.fromRotationTranslation(rotationScale, translation3, result);
+};
+var scratchBoundingSphere2 = new BoundingSphere_default();
+OrientedBoundingBox.isOccluded = function(box, occluder) {
+ if (!defined_default(box)) {
+ throw new DeveloperError_default("box is required.");
+ }
+ if (!defined_default(occluder)) {
+ throw new DeveloperError_default("occluder is required.");
+ }
+ const sphere = BoundingSphere_default.fromOrientedBoundingBox(
+ box,
+ scratchBoundingSphere2
+ );
+ return !occluder.isBoundingSphereVisible(sphere);
+};
+OrientedBoundingBox.prototype.intersectPlane = function(plane) {
+ return OrientedBoundingBox.intersectPlane(this, plane);
+};
+OrientedBoundingBox.prototype.distanceSquaredTo = function(cartesian11) {
+ return OrientedBoundingBox.distanceSquaredTo(this, cartesian11);
+};
+OrientedBoundingBox.prototype.computePlaneDistances = function(position, direction2, result) {
+ return OrientedBoundingBox.computePlaneDistances(
+ this,
+ position,
+ direction2,
+ result
+ );
+};
+OrientedBoundingBox.prototype.computeCorners = function(result) {
+ return OrientedBoundingBox.computeCorners(this, result);
+};
+OrientedBoundingBox.prototype.computeTransformation = function(result) {
+ return OrientedBoundingBox.computeTransformation(this, result);
+};
+OrientedBoundingBox.prototype.isOccluded = function(occluder) {
+ return OrientedBoundingBox.isOccluded(this, occluder);
+};
+OrientedBoundingBox.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && Cartesian3_default.equals(left.center, right.center) && Matrix3_default.equals(left.halfAxes, right.halfAxes);
+};
+OrientedBoundingBox.prototype.clone = function(result) {
+ return OrientedBoundingBox.clone(this, result);
+};
+OrientedBoundingBox.prototype.equals = function(right) {
+ return OrientedBoundingBox.equals(this, right);
+};
+var OrientedBoundingBox_default = OrientedBoundingBox;
+
+// Source/Core/TerrainExaggeration.js
+var TerrainExaggeration = {};
+TerrainExaggeration.getHeight = function(height, scale, relativeHeight) {
+ return (height - relativeHeight) * scale + relativeHeight;
+};
+var scratchCartographic2 = new Cartesian3_default();
+TerrainExaggeration.getPosition = function(position, ellipsoid, terrainExaggeration, terrainExaggerationRelativeHeight, result) {
+ const cartographic2 = ellipsoid.cartesianToCartographic(
+ position,
+ scratchCartographic2
+ );
+ const newHeight = TerrainExaggeration.getHeight(
+ cartographic2.height,
+ terrainExaggeration,
+ terrainExaggerationRelativeHeight
+ );
+ return Cartesian3_default.fromRadians(
+ cartographic2.longitude,
+ cartographic2.latitude,
+ newHeight,
+ ellipsoid,
+ result
+ );
+};
+var TerrainExaggeration_default = TerrainExaggeration;
+
+// Source/Shaders/ShadowVolumeAppearanceVS.js
+var ShadowVolumeAppearanceVS_default = 'attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n\n#ifdef EXTRUDED_GEOMETRY\nattribute vec3 extrudeDirection;\n\nuniform float u_globeMinimumAltitude;\n#endif // EXTRUDED_GEOMETRY\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif // PER_INSTANCE_COLOR\n\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n\nvoid main()\n{\n vec4 position = czm_computePosition();\n\n#ifdef EXTRUDED_GEOMETRY\n float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));\n delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;\n\n //extrudeDirection is zero for the top layer\n position = position + vec4(extrudeDirection * delta, 0.0);\n#endif\n\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\n v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);\n v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);\n#else // SPHERICAL\n#ifdef COLUMBUS_VIEW_2D\n vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);\n vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);\n\n // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):\n // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)\n // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)\n // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)\n vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));\n bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;\n planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);\n planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);\n\n // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)\n // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)\n // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)\n idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;\n idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));\n planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);\n planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);\n\n vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;\n vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;\n vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;\n#else // COLUMBUS_VIEW_2D\n // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction\n vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;\n vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;\n vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;\n#endif // COLUMBUS_VIEW_2D\n\n vec3 eastWard = southEastCorner - southWestCorner;\n float eastExtent = length(eastWard);\n eastWard /= eastExtent;\n\n vec3 northWard = northWestCorner - southWestCorner;\n float northExtent = length(northWard);\n northWard /= northExtent;\n\n v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));\n v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));\n v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);\n#endif // SPHERICAL\n vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);\n vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);\n\n v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);\n v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);\n v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;\n#endif // TEXTURE_COORDINATES\n\n#ifdef PER_INSTANCE_COLOR\n v_color = czm_batchTable_color(batchId);\n#endif\n\n gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);\n}\n';
+
+// Source/Shaders/ShadowVolumeFS.js
+var ShadowVolumeFS_default = "#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\n\nvoid main(void)\n{\n#ifdef VECTOR_TILE\n gl_FragColor = czm_gammaCorrect(u_highlightColor);\n#else\n gl_FragColor = vec4(1.0);\n#endif\n czm_writeDepthClamp();\n}\n";
+
+// Source/Scene/ClassificationType.js
+var ClassificationType = {
+ TERRAIN: 0,
+ CESIUM_3D_TILE: 1,
+ BOTH: 2
+};
+ClassificationType.NUMBER_OF_CLASSIFICATION_TYPES = 3;
+var ClassificationType_default = Object.freeze(ClassificationType);
+
+// Source/Scene/DepthFunction.js
+var DepthFunction = {
+ NEVER: WebGLConstants_default.NEVER,
+ LESS: WebGLConstants_default.LESS,
+ EQUAL: WebGLConstants_default.EQUAL,
+ LESS_OR_EQUAL: WebGLConstants_default.LEQUAL,
+ GREATER: WebGLConstants_default.GREATER,
+ NOT_EQUAL: WebGLConstants_default.NOTEQUAL,
+ GREATER_OR_EQUAL: WebGLConstants_default.GEQUAL,
+ ALWAYS: WebGLConstants_default.ALWAYS
+};
+var DepthFunction_default = Object.freeze(DepthFunction);
+
+// Source/Core/subdivideArray.js
+function subdivideArray(array, numberOfArrays) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required.");
+ }
+ if (!defined_default(numberOfArrays) || numberOfArrays < 1) {
+ throw new DeveloperError_default("numberOfArrays must be greater than 0.");
+ }
+ const result = [];
+ const len = array.length;
+ let i = 0;
+ while (i < len) {
+ const size = Math.ceil((len - i) / numberOfArrays--);
+ result.push(array.slice(i, i + size));
+ i += size;
+ }
+ return result;
+}
+var subdivideArray_default = subdivideArray;
+
+// Source/Scene/BatchTable.js
+function BatchTable(context, attributes, numberOfInstances) {
+ if (!defined_default(context)) {
+ throw new DeveloperError_default("context is required");
+ }
+ if (!defined_default(attributes)) {
+ throw new DeveloperError_default("attributes is required");
+ }
+ if (!defined_default(numberOfInstances)) {
+ throw new DeveloperError_default("numberOfInstances is required");
+ }
+ this._attributes = attributes;
+ this._numberOfInstances = numberOfInstances;
+ if (attributes.length === 0) {
+ return;
+ }
+ const pixelDatatype = getDatatype(attributes);
+ const textureFloatSupported = context.floatingPointTexture;
+ const packFloats = pixelDatatype === PixelDatatype_default.FLOAT && !textureFloatSupported;
+ const offsets = createOffsets(attributes, packFloats);
+ const stride = getStride(offsets, attributes, packFloats);
+ const maxNumberOfInstancesPerRow = Math.floor(
+ ContextLimits_default.maximumTextureSize / stride
+ );
+ const instancesPerWidth = Math.min(
+ numberOfInstances,
+ maxNumberOfInstancesPerRow
+ );
+ const width = stride * instancesPerWidth;
+ const height = Math.ceil(numberOfInstances / instancesPerWidth);
+ const stepX = 1 / width;
+ const centerX = stepX * 0.5;
+ const stepY = 1 / height;
+ const centerY = stepY * 0.5;
+ this._textureDimensions = new Cartesian2_default(width, height);
+ this._textureStep = new Cartesian4_default(stepX, centerX, stepY, centerY);
+ this._pixelDatatype = !packFloats ? pixelDatatype : PixelDatatype_default.UNSIGNED_BYTE;
+ this._packFloats = packFloats;
+ this._offsets = offsets;
+ this._stride = stride;
+ this._texture = void 0;
+ const batchLength = 4 * width * height;
+ this._batchValues = pixelDatatype === PixelDatatype_default.FLOAT && !packFloats ? new Float32Array(batchLength) : new Uint8Array(batchLength);
+ this._batchValuesDirty = false;
+}
+Object.defineProperties(BatchTable.prototype, {
+ attributes: {
+ get: function() {
+ return this._attributes;
+ }
+ },
+ numberOfInstances: {
+ get: function() {
+ return this._numberOfInstances;
+ }
+ }
+});
+function getDatatype(attributes) {
+ let foundFloatDatatype = false;
+ const length3 = attributes.length;
+ for (let i = 0; i < length3; ++i) {
+ if (attributes[i].componentDatatype !== ComponentDatatype_default.UNSIGNED_BYTE) {
+ foundFloatDatatype = true;
+ break;
+ }
+ }
+ return foundFloatDatatype ? PixelDatatype_default.FLOAT : PixelDatatype_default.UNSIGNED_BYTE;
+}
+function getAttributeType(attributes, attributeIndex) {
+ const componentsPerAttribute = attributes[attributeIndex].componentsPerAttribute;
+ if (componentsPerAttribute === 2) {
+ return Cartesian2_default;
+ } else if (componentsPerAttribute === 3) {
+ return Cartesian3_default;
+ } else if (componentsPerAttribute === 4) {
+ return Cartesian4_default;
+ }
+ return Number;
+}
+function createOffsets(attributes, packFloats) {
+ const offsets = new Array(attributes.length);
+ let currentOffset = 0;
+ const attributesLength = attributes.length;
+ for (let i = 0; i < attributesLength; ++i) {
+ const attribute = attributes[i];
+ const componentDatatype = attribute.componentDatatype;
+ offsets[i] = currentOffset;
+ if (componentDatatype !== ComponentDatatype_default.UNSIGNED_BYTE && packFloats) {
+ currentOffset += 4;
+ } else {
+ ++currentOffset;
+ }
+ }
+ return offsets;
+}
+function getStride(offsets, attributes, packFloats) {
+ const length3 = offsets.length;
+ const lastOffset = offsets[length3 - 1];
+ const lastAttribute = attributes[length3 - 1];
+ const componentDatatype = lastAttribute.componentDatatype;
+ if (componentDatatype !== ComponentDatatype_default.UNSIGNED_BYTE && packFloats) {
+ return lastOffset + 4;
+ }
+ return lastOffset + 1;
+}
+var scratchPackedFloatCartesian4 = new Cartesian4_default();
+function getPackedFloat(array, index, result) {
+ let packed = Cartesian4_default.unpack(array, index, scratchPackedFloatCartesian4);
+ const x = Cartesian4_default.unpackFloat(packed);
+ packed = Cartesian4_default.unpack(array, index + 4, scratchPackedFloatCartesian4);
+ const y = Cartesian4_default.unpackFloat(packed);
+ packed = Cartesian4_default.unpack(array, index + 8, scratchPackedFloatCartesian4);
+ const z = Cartesian4_default.unpackFloat(packed);
+ packed = Cartesian4_default.unpack(array, index + 12, scratchPackedFloatCartesian4);
+ const w = Cartesian4_default.unpackFloat(packed);
+ return Cartesian4_default.fromElements(x, y, z, w, result);
+}
+function setPackedAttribute(value, array, index) {
+ let packed = Cartesian4_default.packFloat(value.x, scratchPackedFloatCartesian4);
+ Cartesian4_default.pack(packed, array, index);
+ packed = Cartesian4_default.packFloat(value.y, packed);
+ Cartesian4_default.pack(packed, array, index + 4);
+ packed = Cartesian4_default.packFloat(value.z, packed);
+ Cartesian4_default.pack(packed, array, index + 8);
+ packed = Cartesian4_default.packFloat(value.w, packed);
+ Cartesian4_default.pack(packed, array, index + 12);
+}
+var scratchGetAttributeCartesian4 = new Cartesian4_default();
+BatchTable.prototype.getBatchedAttribute = function(instanceIndex, attributeIndex, result) {
+ if (instanceIndex < 0 || instanceIndex >= this._numberOfInstances) {
+ throw new DeveloperError_default("instanceIndex is out of range.");
+ }
+ if (attributeIndex < 0 || attributeIndex >= this._attributes.length) {
+ throw new DeveloperError_default("attributeIndex is out of range");
+ }
+ const attributes = this._attributes;
+ const offset2 = this._offsets[attributeIndex];
+ const stride = this._stride;
+ const index = 4 * stride * instanceIndex + 4 * offset2;
+ let value;
+ if (this._packFloats && attributes[attributeIndex].componentDatatype !== PixelDatatype_default.UNSIGNED_BYTE) {
+ value = getPackedFloat(
+ this._batchValues,
+ index,
+ scratchGetAttributeCartesian4
+ );
+ } else {
+ value = Cartesian4_default.unpack(
+ this._batchValues,
+ index,
+ scratchGetAttributeCartesian4
+ );
+ }
+ const attributeType = getAttributeType(attributes, attributeIndex);
+ if (defined_default(attributeType.fromCartesian4)) {
+ return attributeType.fromCartesian4(value, result);
+ } else if (defined_default(attributeType.clone)) {
+ return attributeType.clone(value, result);
+ }
+ return value.x;
+};
+var setAttributeScratchValues = [
+ void 0,
+ void 0,
+ new Cartesian2_default(),
+ new Cartesian3_default(),
+ new Cartesian4_default()
+];
+var setAttributeScratchCartesian4 = new Cartesian4_default();
+BatchTable.prototype.setBatchedAttribute = function(instanceIndex, attributeIndex, value) {
+ if (instanceIndex < 0 || instanceIndex >= this._numberOfInstances) {
+ throw new DeveloperError_default("instanceIndex is out of range.");
+ }
+ if (attributeIndex < 0 || attributeIndex >= this._attributes.length) {
+ throw new DeveloperError_default("attributeIndex is out of range");
+ }
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const attributes = this._attributes;
+ const result = setAttributeScratchValues[attributes[attributeIndex].componentsPerAttribute];
+ const currentAttribute = this.getBatchedAttribute(
+ instanceIndex,
+ attributeIndex,
+ result
+ );
+ const attributeType = getAttributeType(this._attributes, attributeIndex);
+ const entriesEqual = defined_default(attributeType.equals) ? attributeType.equals(currentAttribute, value) : currentAttribute === value;
+ if (entriesEqual) {
+ return;
+ }
+ const attributeValue = setAttributeScratchCartesian4;
+ attributeValue.x = defined_default(value.x) ? value.x : value;
+ attributeValue.y = defined_default(value.y) ? value.y : 0;
+ attributeValue.z = defined_default(value.z) ? value.z : 0;
+ attributeValue.w = defined_default(value.w) ? value.w : 0;
+ const offset2 = this._offsets[attributeIndex];
+ const stride = this._stride;
+ const index = 4 * stride * instanceIndex + 4 * offset2;
+ if (this._packFloats && attributes[attributeIndex].componentDatatype !== PixelDatatype_default.UNSIGNED_BYTE) {
+ setPackedAttribute(attributeValue, this._batchValues, index);
+ } else {
+ Cartesian4_default.pack(attributeValue, this._batchValues, index);
+ }
+ this._batchValuesDirty = true;
+};
+function createTexture(batchTable, context) {
+ const dimensions = batchTable._textureDimensions;
+ batchTable._texture = new Texture_default({
+ context,
+ pixelFormat: PixelFormat_default.RGBA,
+ pixelDatatype: batchTable._pixelDatatype,
+ width: dimensions.x,
+ height: dimensions.y,
+ sampler: Sampler_default.NEAREST,
+ flipY: false
+ });
+}
+function updateTexture(batchTable) {
+ const dimensions = batchTable._textureDimensions;
+ batchTable._texture.copyFrom({
+ source: {
+ width: dimensions.x,
+ height: dimensions.y,
+ arrayBufferView: batchTable._batchValues
+ }
+ });
+}
+BatchTable.prototype.update = function(frameState) {
+ if (defined_default(this._texture) && !this._batchValuesDirty || this._attributes.length === 0) {
+ return;
+ }
+ this._batchValuesDirty = false;
+ if (!defined_default(this._texture)) {
+ createTexture(this, frameState.context);
+ }
+ updateTexture(this);
+};
+BatchTable.prototype.getUniformMapCallback = function() {
+ const that = this;
+ return function(uniformMap2) {
+ if (that._attributes.length === 0) {
+ return uniformMap2;
+ }
+ const batchUniformMap = {
+ batchTexture: function() {
+ return that._texture;
+ },
+ batchTextureDimensions: function() {
+ return that._textureDimensions;
+ },
+ batchTextureStep: function() {
+ return that._textureStep;
+ }
+ };
+ return combine_default(uniformMap2, batchUniformMap);
+ };
+};
+function getGlslComputeSt(batchTable) {
+ const stride = batchTable._stride;
+ if (batchTable._textureDimensions.y === 1) {
+ return `${"uniform vec4 batchTextureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float numberOfAttributes = float("}${stride});
+ return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5);
+}
+`;
+ }
+ return `${"uniform vec4 batchTextureStep; \nuniform vec2 batchTextureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = batchTextureStep.x; \n float centerX = batchTextureStep.y; \n float stepY = batchTextureStep.z; \n float centerY = batchTextureStep.w; \n float numberOfAttributes = float("}${stride});
+ float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x);
+ float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x);
+ return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
+}
+`;
+}
+function getComponentType(componentsPerAttribute) {
+ if (componentsPerAttribute === 1) {
+ return "float";
+ }
+ return `vec${componentsPerAttribute}`;
+}
+function getComponentSwizzle(componentsPerAttribute) {
+ if (componentsPerAttribute === 1) {
+ return ".x";
+ } else if (componentsPerAttribute === 2) {
+ return ".xy";
+ } else if (componentsPerAttribute === 3) {
+ return ".xyz";
+ }
+ return "";
+}
+function getGlslAttributeFunction(batchTable, attributeIndex) {
+ const attributes = batchTable._attributes;
+ const attribute = attributes[attributeIndex];
+ const componentsPerAttribute = attribute.componentsPerAttribute;
+ const functionName = attribute.functionName;
+ const functionReturnType = getComponentType(componentsPerAttribute);
+ const functionReturnValue = getComponentSwizzle(componentsPerAttribute);
+ const offset2 = batchTable._offsets[attributeIndex];
+ let glslFunction = `${functionReturnType} ${functionName}(float batchId)
+{
+ vec2 st = computeSt(batchId);
+ st.x += batchTextureStep.x * float(${offset2});
+`;
+ if (batchTable._packFloats && attribute.componentDatatype !== PixelDatatype_default.UNSIGNED_BYTE) {
+ glslFunction += "vec4 textureValue; \ntextureValue.x = czm_unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = czm_unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n";
+ } else {
+ glslFunction += " vec4 textureValue = texture2D(batchTexture, st); \n";
+ }
+ glslFunction += ` ${functionReturnType} value = textureValue${functionReturnValue};
+`;
+ if (batchTable._pixelDatatype === PixelDatatype_default.UNSIGNED_BYTE && attribute.componentDatatype === ComponentDatatype_default.UNSIGNED_BYTE && !attribute.normalize) {
+ glslFunction += "value *= 255.0; \n";
+ } else if (batchTable._pixelDatatype === PixelDatatype_default.FLOAT && attribute.componentDatatype === ComponentDatatype_default.UNSIGNED_BYTE && attribute.normalize) {
+ glslFunction += "value /= 255.0; \n";
+ }
+ glslFunction += " return value; \n} \n";
+ return glslFunction;
+}
+BatchTable.prototype.getVertexShaderCallback = function() {
+ const attributes = this._attributes;
+ if (attributes.length === 0) {
+ return function(source) {
+ return source;
+ };
+ }
+ let batchTableShader = "uniform highp sampler2D batchTexture; \n";
+ batchTableShader += `${getGlslComputeSt(this)}
+`;
+ const length3 = attributes.length;
+ for (let i = 0; i < length3; ++i) {
+ batchTableShader += getGlslAttributeFunction(this, i);
+ }
+ return function(source) {
+ const mainIndex = source.indexOf("void main");
+ const beforeMain = source.substring(0, mainIndex);
+ const afterMain = source.substring(mainIndex);
+ return `${beforeMain}
+${batchTableShader}
+${afterMain}`;
+ };
+};
+BatchTable.prototype.isDestroyed = function() {
+ return false;
+};
+BatchTable.prototype.destroy = function() {
+ this._texture = this._texture && this._texture.destroy();
+ return destroyObject_default(this);
+};
+var BatchTable_default = BatchTable;
+
+// Source/Scene/AttributeType.js
+var AttributeType = {
+ SCALAR: "SCALAR",
+ VEC2: "VEC2",
+ VEC3: "VEC3",
+ VEC4: "VEC4",
+ MAT2: "MAT2",
+ MAT3: "MAT3",
+ MAT4: "MAT4"
+};
+AttributeType.getMathType = function(attributeType) {
+ switch (attributeType) {
+ case AttributeType.SCALAR:
+ return Number;
+ case AttributeType.VEC2:
+ return Cartesian2_default;
+ case AttributeType.VEC3:
+ return Cartesian3_default;
+ case AttributeType.VEC4:
+ return Cartesian4_default;
+ case AttributeType.MAT2:
+ return Matrix2_default;
+ case AttributeType.MAT3:
+ return Matrix3_default;
+ case AttributeType.MAT4:
+ return Matrix4_default;
+ default:
+ throw new DeveloperError_default("attributeType is not a valid value.");
+ }
+};
+AttributeType.getNumberOfComponents = function(attributeType) {
+ switch (attributeType) {
+ case AttributeType.SCALAR:
+ return 1;
+ case AttributeType.VEC2:
+ return 2;
+ case AttributeType.VEC3:
+ return 3;
+ case AttributeType.VEC4:
+ case AttributeType.MAT2:
+ return 4;
+ case AttributeType.MAT3:
+ return 9;
+ case AttributeType.MAT4:
+ return 16;
+ default:
+ throw new DeveloperError_default("attributeType is not a valid value.");
+ }
+};
+AttributeType.getAttributeLocationCount = function(attributeType) {
+ switch (attributeType) {
+ case AttributeType.SCALAR:
+ case AttributeType.VEC2:
+ case AttributeType.VEC3:
+ case AttributeType.VEC4:
+ return 1;
+ case AttributeType.MAT2:
+ return 2;
+ case AttributeType.MAT3:
+ return 3;
+ case AttributeType.MAT4:
+ return 4;
+ default:
+ throw new DeveloperError_default("attributeType is not a valid value.");
+ }
+};
+AttributeType.getGlslType = function(attributeType) {
+ Check_default.typeOf.string("attributeType", attributeType);
+ switch (attributeType) {
+ case AttributeType.SCALAR:
+ return "float";
+ case AttributeType.VEC2:
+ return "vec2";
+ case AttributeType.VEC3:
+ return "vec3";
+ case AttributeType.VEC4:
+ return "vec4";
+ case AttributeType.MAT2:
+ return "mat2";
+ case AttributeType.MAT3:
+ return "mat3";
+ case AttributeType.MAT4:
+ return "mat4";
+ default:
+ throw new DeveloperError_default("attributeType is not a valid value.");
+ }
+};
+var AttributeType_default = Object.freeze(AttributeType);
+
+// Source/Core/AttributeCompression.js
+var RIGHT_SHIFT = 1 / 256;
+var LEFT_SHIFT = 256;
+var AttributeCompression = {};
+AttributeCompression.octEncodeInRange = function(vector, rangeMax, result) {
+ Check_default.defined("vector", vector);
+ Check_default.defined("result", result);
+ const magSquared = Cartesian3_default.magnitudeSquared(vector);
+ if (Math.abs(magSquared - 1) > Math_default.EPSILON6) {
+ throw new DeveloperError_default("vector must be normalized.");
+ }
+ result.x = vector.x / (Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z));
+ result.y = vector.y / (Math.abs(vector.x) + Math.abs(vector.y) + Math.abs(vector.z));
+ if (vector.z < 0) {
+ const x = result.x;
+ const y = result.y;
+ result.x = (1 - Math.abs(y)) * Math_default.signNotZero(x);
+ result.y = (1 - Math.abs(x)) * Math_default.signNotZero(y);
+ }
+ result.x = Math_default.toSNorm(result.x, rangeMax);
+ result.y = Math_default.toSNorm(result.y, rangeMax);
+ return result;
+};
+AttributeCompression.octEncode = function(vector, result) {
+ return AttributeCompression.octEncodeInRange(vector, 255, result);
+};
+var octEncodeScratch = new Cartesian2_default();
+var uint8ForceArray = new Uint8Array(1);
+function forceUint8(value) {
+ uint8ForceArray[0] = value;
+ return uint8ForceArray[0];
+}
+AttributeCompression.octEncodeToCartesian4 = function(vector, result) {
+ AttributeCompression.octEncodeInRange(vector, 65535, octEncodeScratch);
+ result.x = forceUint8(octEncodeScratch.x * RIGHT_SHIFT);
+ result.y = forceUint8(octEncodeScratch.x);
+ result.z = forceUint8(octEncodeScratch.y * RIGHT_SHIFT);
+ result.w = forceUint8(octEncodeScratch.y);
+ return result;
+};
+AttributeCompression.octDecodeInRange = function(x, y, rangeMax, result) {
+ Check_default.defined("result", result);
+ if (x < 0 || x > rangeMax || y < 0 || y > rangeMax) {
+ throw new DeveloperError_default(
+ `x and y must be unsigned normalized integers between 0 and ${rangeMax}`
+ );
+ }
+ result.x = Math_default.fromSNorm(x, rangeMax);
+ result.y = Math_default.fromSNorm(y, rangeMax);
+ result.z = 1 - (Math.abs(result.x) + Math.abs(result.y));
+ if (result.z < 0) {
+ const oldVX = result.x;
+ result.x = (1 - Math.abs(result.y)) * Math_default.signNotZero(oldVX);
+ result.y = (1 - Math.abs(oldVX)) * Math_default.signNotZero(result.y);
+ }
+ return Cartesian3_default.normalize(result, result);
+};
+AttributeCompression.octDecode = function(x, y, result) {
+ return AttributeCompression.octDecodeInRange(x, y, 255, result);
+};
+AttributeCompression.octDecodeFromCartesian4 = function(encoded, result) {
+ Check_default.typeOf.object("encoded", encoded);
+ Check_default.typeOf.object("result", result);
+ const x = encoded.x;
+ const y = encoded.y;
+ const z = encoded.z;
+ const w = encoded.w;
+ if (x < 0 || x > 255 || y < 0 || y > 255 || z < 0 || z > 255 || w < 0 || w > 255) {
+ throw new DeveloperError_default(
+ "x, y, z, and w must be unsigned normalized integers between 0 and 255"
+ );
+ }
+ const xOct16 = x * LEFT_SHIFT + y;
+ const yOct16 = z * LEFT_SHIFT + w;
+ return AttributeCompression.octDecodeInRange(xOct16, yOct16, 65535, result);
+};
+AttributeCompression.octPackFloat = function(encoded) {
+ Check_default.defined("encoded", encoded);
+ return 256 * encoded.x + encoded.y;
+};
+var scratchEncodeCart2 = new Cartesian2_default();
+AttributeCompression.octEncodeFloat = function(vector) {
+ AttributeCompression.octEncode(vector, scratchEncodeCart2);
+ return AttributeCompression.octPackFloat(scratchEncodeCart2);
+};
+AttributeCompression.octDecodeFloat = function(value, result) {
+ Check_default.defined("value", value);
+ const temp = value / 256;
+ const x = Math.floor(temp);
+ const y = (temp - x) * 256;
+ return AttributeCompression.octDecode(x, y, result);
+};
+AttributeCompression.octPack = function(v13, v23, v32, result) {
+ Check_default.defined("v1", v13);
+ Check_default.defined("v2", v23);
+ Check_default.defined("v3", v32);
+ Check_default.defined("result", result);
+ const encoded1 = AttributeCompression.octEncodeFloat(v13);
+ const encoded2 = AttributeCompression.octEncodeFloat(v23);
+ const encoded3 = AttributeCompression.octEncode(v32, scratchEncodeCart2);
+ result.x = 65536 * encoded3.x + encoded1;
+ result.y = 65536 * encoded3.y + encoded2;
+ return result;
+};
+AttributeCompression.octUnpack = function(packed, v13, v23, v32) {
+ Check_default.defined("packed", packed);
+ Check_default.defined("v1", v13);
+ Check_default.defined("v2", v23);
+ Check_default.defined("v3", v32);
+ let temp = packed.x / 65536;
+ const x = Math.floor(temp);
+ const encodedFloat1 = (temp - x) * 65536;
+ temp = packed.y / 65536;
+ const y = Math.floor(temp);
+ const encodedFloat2 = (temp - y) * 65536;
+ AttributeCompression.octDecodeFloat(encodedFloat1, v13);
+ AttributeCompression.octDecodeFloat(encodedFloat2, v23);
+ AttributeCompression.octDecode(x, y, v32);
+};
+AttributeCompression.compressTextureCoordinates = function(textureCoordinates) {
+ Check_default.defined("textureCoordinates", textureCoordinates);
+ const x = textureCoordinates.x * 4095 | 0;
+ const y = textureCoordinates.y * 4095 | 0;
+ return 4096 * x + y;
+};
+AttributeCompression.decompressTextureCoordinates = function(compressed, result) {
+ Check_default.defined("compressed", compressed);
+ Check_default.defined("result", result);
+ const temp = compressed / 4096;
+ const xZeroTo4095 = Math.floor(temp);
+ result.x = xZeroTo4095 / 4095;
+ result.y = (compressed - xZeroTo4095 * 4096) / 4095;
+ return result;
+};
+function zigZagDecode(value) {
+ return value >> 1 ^ -(value & 1);
+}
+AttributeCompression.zigZagDeltaDecode = function(uBuffer, vBuffer, heightBuffer) {
+ Check_default.defined("uBuffer", uBuffer);
+ Check_default.defined("vBuffer", vBuffer);
+ Check_default.typeOf.number.equals(
+ "uBuffer.length",
+ "vBuffer.length",
+ uBuffer.length,
+ vBuffer.length
+ );
+ if (defined_default(heightBuffer)) {
+ Check_default.typeOf.number.equals(
+ "uBuffer.length",
+ "heightBuffer.length",
+ uBuffer.length,
+ heightBuffer.length
+ );
+ }
+ const count = uBuffer.length;
+ let u3 = 0;
+ let v7 = 0;
+ let height = 0;
+ for (let i = 0; i < count; ++i) {
+ u3 += zigZagDecode(uBuffer[i]);
+ v7 += zigZagDecode(vBuffer[i]);
+ uBuffer[i] = u3;
+ vBuffer[i] = v7;
+ if (defined_default(heightBuffer)) {
+ height += zigZagDecode(heightBuffer[i]);
+ heightBuffer[i] = height;
+ }
+ }
+};
+AttributeCompression.dequantize = function(typedArray, componentDatatype, type, count) {
+ Check_default.defined("typedArray", typedArray);
+ Check_default.defined("componentDatatype", componentDatatype);
+ Check_default.defined("type", type);
+ Check_default.defined("count", count);
+ const componentsPerAttribute = AttributeType_default.getNumberOfComponents(type);
+ let divisor;
+ switch (componentDatatype) {
+ case ComponentDatatype_default.BYTE:
+ divisor = 127;
+ break;
+ case ComponentDatatype_default.UNSIGNED_BYTE:
+ divisor = 255;
+ break;
+ case ComponentDatatype_default.SHORT:
+ divisor = 32767;
+ break;
+ case ComponentDatatype_default.UNSIGNED_SHORT:
+ divisor = 65535;
+ break;
+ case ComponentDatatype_default.INT:
+ divisor = 2147483647;
+ break;
+ case ComponentDatatype_default.UNSIGNED_INT:
+ divisor = 4294967295;
+ break;
+ default:
+ throw new DeveloperError_default(
+ `Cannot dequantize component datatype: ${componentDatatype}`
+ );
+ }
+ const dequantizedTypedArray = new Float32Array(
+ count * componentsPerAttribute
+ );
+ for (let i = 0; i < count; i++) {
+ for (let j = 0; j < componentsPerAttribute; j++) {
+ const index = i * componentsPerAttribute + j;
+ dequantizedTypedArray[index] = Math.max(
+ typedArray[index] / divisor,
+ -1
+ );
+ }
+ }
+ return dequantizedTypedArray;
+};
+AttributeCompression.decodeRGB565 = function(typedArray, result) {
+ Check_default.defined("typedArray", typedArray);
+ const expectedLength = typedArray.length * 3;
+ if (defined_default(result)) {
+ Check_default.typeOf.number.equals(
+ "result.length",
+ "typedArray.length * 3",
+ result.length,
+ expectedLength
+ );
+ }
+ const count = typedArray.length;
+ if (!defined_default(result)) {
+ result = new Float32Array(count * 3);
+ }
+ const mask5 = (1 << 5) - 1;
+ const mask6 = (1 << 6) - 1;
+ const normalize5 = 1 / 31;
+ const normalize6 = 1 / 63;
+ for (let i = 0; i < count; i++) {
+ const value = typedArray[i];
+ const red = value >> 11;
+ const green = value >> 5 & mask6;
+ const blue = value & mask5;
+ const offset2 = 3 * i;
+ result[offset2] = red * normalize5;
+ result[offset2 + 1] = green * normalize6;
+ result[offset2 + 2] = blue * normalize5;
+ }
+ return result;
+};
+var AttributeCompression_default = AttributeCompression;
+
+// Source/Core/barycentricCoordinates.js
+var scratchCartesian12 = new Cartesian3_default();
+var scratchCartesian22 = new Cartesian3_default();
+var scratchCartesian33 = new Cartesian3_default();
+function barycentricCoordinates(point, p0, p1, p2, result) {
+ Check_default.defined("point", point);
+ Check_default.defined("p0", p0);
+ Check_default.defined("p1", p1);
+ Check_default.defined("p2", p2);
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ let v02;
+ let v13;
+ let v23;
+ let dot00;
+ let dot01;
+ let dot02;
+ let dot11;
+ let dot12;
+ if (!defined_default(p0.z)) {
+ if (Cartesian2_default.equalsEpsilon(point, p0, Math_default.EPSILON14)) {
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_X, result);
+ }
+ if (Cartesian2_default.equalsEpsilon(point, p1, Math_default.EPSILON14)) {
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_Y, result);
+ }
+ if (Cartesian2_default.equalsEpsilon(point, p2, Math_default.EPSILON14)) {
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_Z, result);
+ }
+ v02 = Cartesian2_default.subtract(p1, p0, scratchCartesian12);
+ v13 = Cartesian2_default.subtract(p2, p0, scratchCartesian22);
+ v23 = Cartesian2_default.subtract(point, p0, scratchCartesian33);
+ dot00 = Cartesian2_default.dot(v02, v02);
+ dot01 = Cartesian2_default.dot(v02, v13);
+ dot02 = Cartesian2_default.dot(v02, v23);
+ dot11 = Cartesian2_default.dot(v13, v13);
+ dot12 = Cartesian2_default.dot(v13, v23);
+ } else {
+ if (Cartesian3_default.equalsEpsilon(point, p0, Math_default.EPSILON14)) {
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_X, result);
+ }
+ if (Cartesian3_default.equalsEpsilon(point, p1, Math_default.EPSILON14)) {
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_Y, result);
+ }
+ if (Cartesian3_default.equalsEpsilon(point, p2, Math_default.EPSILON14)) {
+ return Cartesian3_default.clone(Cartesian3_default.UNIT_Z, result);
+ }
+ v02 = Cartesian3_default.subtract(p1, p0, scratchCartesian12);
+ v13 = Cartesian3_default.subtract(p2, p0, scratchCartesian22);
+ v23 = Cartesian3_default.subtract(point, p0, scratchCartesian33);
+ dot00 = Cartesian3_default.dot(v02, v02);
+ dot01 = Cartesian3_default.dot(v02, v13);
+ dot02 = Cartesian3_default.dot(v02, v23);
+ dot11 = Cartesian3_default.dot(v13, v13);
+ dot12 = Cartesian3_default.dot(v13, v23);
+ }
+ result.y = dot11 * dot02 - dot01 * dot12;
+ result.z = dot00 * dot12 - dot01 * dot02;
+ const q = dot00 * dot11 - dot01 * dot01;
+ if (q === 0) {
+ return void 0;
+ }
+ result.y /= q;
+ result.z /= q;
+ result.x = 1 - result.y - result.z;
+ return result;
+}
+var barycentricCoordinates_default = barycentricCoordinates;
+
+// Source/Core/Tipsify.js
+var Tipsify = {};
+Tipsify.calculateACMR = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const indices2 = options.indices;
+ let maximumIndex = options.maximumIndex;
+ const cacheSize = defaultValue_default(options.cacheSize, 24);
+ if (!defined_default(indices2)) {
+ throw new DeveloperError_default("indices is required.");
+ }
+ const numIndices = indices2.length;
+ if (numIndices < 3 || numIndices % 3 !== 0) {
+ throw new DeveloperError_default("indices length must be a multiple of three.");
+ }
+ if (maximumIndex <= 0) {
+ throw new DeveloperError_default("maximumIndex must be greater than zero.");
+ }
+ if (cacheSize < 3) {
+ throw new DeveloperError_default("cacheSize must be greater than two.");
+ }
+ if (!defined_default(maximumIndex)) {
+ maximumIndex = 0;
+ let currentIndex = 0;
+ let intoIndices = indices2[currentIndex];
+ while (currentIndex < numIndices) {
+ if (intoIndices > maximumIndex) {
+ maximumIndex = intoIndices;
+ }
+ ++currentIndex;
+ intoIndices = indices2[currentIndex];
+ }
+ }
+ const vertexTimeStamps = [];
+ for (let i = 0; i < maximumIndex + 1; i++) {
+ vertexTimeStamps[i] = 0;
+ }
+ let s = cacheSize + 1;
+ for (let j = 0; j < numIndices; ++j) {
+ if (s - vertexTimeStamps[indices2[j]] > cacheSize) {
+ vertexTimeStamps[indices2[j]] = s;
+ ++s;
+ }
+ }
+ return (s - cacheSize + 1) / (numIndices / 3);
+};
+Tipsify.tipsify = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const indices2 = options.indices;
+ const maximumIndex = options.maximumIndex;
+ const cacheSize = defaultValue_default(options.cacheSize, 24);
+ let cursor;
+ function skipDeadEnd(vertices2, deadEnd2, indices3, maximumIndexPlusOne2) {
+ while (deadEnd2.length >= 1) {
+ const d = deadEnd2[deadEnd2.length - 1];
+ deadEnd2.splice(deadEnd2.length - 1, 1);
+ if (vertices2[d].numLiveTriangles > 0) {
+ return d;
+ }
+ }
+ while (cursor < maximumIndexPlusOne2) {
+ if (vertices2[cursor].numLiveTriangles > 0) {
+ ++cursor;
+ return cursor - 1;
+ }
+ ++cursor;
+ }
+ return -1;
+ }
+ function getNextVertex(indices3, cacheSize2, oneRing2, vertices2, s2, deadEnd2, maximumIndexPlusOne2) {
+ let n = -1;
+ let p;
+ let m = -1;
+ let itOneRing = 0;
+ while (itOneRing < oneRing2.length) {
+ const index2 = oneRing2[itOneRing];
+ if (vertices2[index2].numLiveTriangles) {
+ p = 0;
+ if (s2 - vertices2[index2].timeStamp + 2 * vertices2[index2].numLiveTriangles <= cacheSize2) {
+ p = s2 - vertices2[index2].timeStamp;
+ }
+ if (p > m || m === -1) {
+ m = p;
+ n = index2;
+ }
+ }
+ ++itOneRing;
+ }
+ if (n === -1) {
+ return skipDeadEnd(vertices2, deadEnd2, indices3, maximumIndexPlusOne2);
+ }
+ return n;
+ }
+ if (!defined_default(indices2)) {
+ throw new DeveloperError_default("indices is required.");
+ }
+ const numIndices = indices2.length;
+ if (numIndices < 3 || numIndices % 3 !== 0) {
+ throw new DeveloperError_default("indices length must be a multiple of three.");
+ }
+ if (maximumIndex <= 0) {
+ throw new DeveloperError_default("maximumIndex must be greater than zero.");
+ }
+ if (cacheSize < 3) {
+ throw new DeveloperError_default("cacheSize must be greater than two.");
+ }
+ let maximumIndexPlusOne = 0;
+ let currentIndex = 0;
+ let intoIndices = indices2[currentIndex];
+ const endIndex = numIndices;
+ if (defined_default(maximumIndex)) {
+ maximumIndexPlusOne = maximumIndex + 1;
+ } else {
+ while (currentIndex < endIndex) {
+ if (intoIndices > maximumIndexPlusOne) {
+ maximumIndexPlusOne = intoIndices;
+ }
+ ++currentIndex;
+ intoIndices = indices2[currentIndex];
+ }
+ if (maximumIndexPlusOne === -1) {
+ return 0;
+ }
+ ++maximumIndexPlusOne;
+ }
+ const vertices = [];
+ let i;
+ for (i = 0; i < maximumIndexPlusOne; i++) {
+ vertices[i] = {
+ numLiveTriangles: 0,
+ timeStamp: 0,
+ vertexTriangles: []
+ };
+ }
+ currentIndex = 0;
+ let triangle = 0;
+ while (currentIndex < endIndex) {
+ vertices[indices2[currentIndex]].vertexTriangles.push(triangle);
+ ++vertices[indices2[currentIndex]].numLiveTriangles;
+ vertices[indices2[currentIndex + 1]].vertexTriangles.push(triangle);
+ ++vertices[indices2[currentIndex + 1]].numLiveTriangles;
+ vertices[indices2[currentIndex + 2]].vertexTriangles.push(triangle);
+ ++vertices[indices2[currentIndex + 2]].numLiveTriangles;
+ ++triangle;
+ currentIndex += 3;
+ }
+ let f = 0;
+ let s = cacheSize + 1;
+ cursor = 1;
+ let oneRing = [];
+ const deadEnd = [];
+ let vertex;
+ let intoVertices;
+ let currentOutputIndex = 0;
+ const outputIndices = [];
+ const numTriangles = numIndices / 3;
+ const triangleEmitted = [];
+ for (i = 0; i < numTriangles; i++) {
+ triangleEmitted[i] = false;
+ }
+ let index;
+ let limit;
+ while (f !== -1) {
+ oneRing = [];
+ intoVertices = vertices[f];
+ limit = intoVertices.vertexTriangles.length;
+ for (let k = 0; k < limit; ++k) {
+ triangle = intoVertices.vertexTriangles[k];
+ if (!triangleEmitted[triangle]) {
+ triangleEmitted[triangle] = true;
+ currentIndex = triangle + triangle + triangle;
+ for (let j = 0; j < 3; ++j) {
+ index = indices2[currentIndex];
+ oneRing.push(index);
+ deadEnd.push(index);
+ outputIndices[currentOutputIndex] = index;
+ ++currentOutputIndex;
+ vertex = vertices[index];
+ --vertex.numLiveTriangles;
+ if (s - vertex.timeStamp > cacheSize) {
+ vertex.timeStamp = s;
+ ++s;
+ }
+ ++currentIndex;
+ }
+ }
+ }
+ f = getNextVertex(
+ indices2,
+ cacheSize,
+ oneRing,
+ vertices,
+ s,
+ deadEnd,
+ maximumIndexPlusOne
+ );
+ }
+ return outputIndices;
+};
+var Tipsify_default = Tipsify;
+
+// Source/Core/GeometryPipeline.js
+var GeometryPipeline = {};
+function addTriangle(lines, index, i0, i1, i2) {
+ lines[index++] = i0;
+ lines[index++] = i1;
+ lines[index++] = i1;
+ lines[index++] = i2;
+ lines[index++] = i2;
+ lines[index] = i0;
+}
+function trianglesToLines(triangles) {
+ const count = triangles.length;
+ const size = count / 3 * 6;
+ const lines = IndexDatatype_default.createTypedArray(count, size);
+ let index = 0;
+ for (let i = 0; i < count; i += 3, index += 6) {
+ addTriangle(lines, index, triangles[i], triangles[i + 1], triangles[i + 2]);
+ }
+ return lines;
+}
+function triangleStripToLines(triangles) {
+ const count = triangles.length;
+ if (count >= 3) {
+ const size = (count - 2) * 6;
+ const lines = IndexDatatype_default.createTypedArray(count, size);
+ addTriangle(lines, 0, triangles[0], triangles[1], triangles[2]);
+ let index = 6;
+ for (let i = 3; i < count; ++i, index += 6) {
+ addTriangle(
+ lines,
+ index,
+ triangles[i - 1],
+ triangles[i],
+ triangles[i - 2]
+ );
+ }
+ return lines;
+ }
+ return new Uint16Array();
+}
+function triangleFanToLines(triangles) {
+ if (triangles.length > 0) {
+ const count = triangles.length - 1;
+ const size = (count - 1) * 6;
+ const lines = IndexDatatype_default.createTypedArray(count, size);
+ const base = triangles[0];
+ let index = 0;
+ for (let i = 1; i < count; ++i, index += 6) {
+ addTriangle(lines, index, base, triangles[i], triangles[i + 1]);
+ }
+ return lines;
+ }
+ return new Uint16Array();
+}
+GeometryPipeline.toWireframe = function(geometry) {
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ const indices2 = geometry.indices;
+ if (defined_default(indices2)) {
+ switch (geometry.primitiveType) {
+ case PrimitiveType_default.TRIANGLES:
+ geometry.indices = trianglesToLines(indices2);
+ break;
+ case PrimitiveType_default.TRIANGLE_STRIP:
+ geometry.indices = triangleStripToLines(indices2);
+ break;
+ case PrimitiveType_default.TRIANGLE_FAN:
+ geometry.indices = triangleFanToLines(indices2);
+ break;
+ default:
+ throw new DeveloperError_default(
+ "geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN."
+ );
+ }
+ geometry.primitiveType = PrimitiveType_default.LINES;
+ }
+ return geometry;
+};
+GeometryPipeline.createLineSegmentsForVectors = function(geometry, attributeName, length3) {
+ attributeName = defaultValue_default(attributeName, "normal");
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ if (!defined_default(geometry.attributes.position)) {
+ throw new DeveloperError_default("geometry.attributes.position is required.");
+ }
+ if (!defined_default(geometry.attributes[attributeName])) {
+ throw new DeveloperError_default(
+ `geometry.attributes must have an attribute with the same name as the attributeName parameter, ${attributeName}.`
+ );
+ }
+ length3 = defaultValue_default(length3, 1e4);
+ const positions = geometry.attributes.position.values;
+ const vectors = geometry.attributes[attributeName].values;
+ const positionsLength = positions.length;
+ const newPositions = new Float64Array(2 * positionsLength);
+ let j = 0;
+ for (let i = 0; i < positionsLength; i += 3) {
+ newPositions[j++] = positions[i];
+ newPositions[j++] = positions[i + 1];
+ newPositions[j++] = positions[i + 2];
+ newPositions[j++] = positions[i] + vectors[i] * length3;
+ newPositions[j++] = positions[i + 1] + vectors[i + 1] * length3;
+ newPositions[j++] = positions[i + 2] + vectors[i + 2] * length3;
+ }
+ let newBoundingSphere;
+ const bs = geometry.boundingSphere;
+ if (defined_default(bs)) {
+ newBoundingSphere = new BoundingSphere_default(bs.center, bs.radius + length3);
+ }
+ return new Geometry_default({
+ attributes: {
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: newPositions
+ })
+ },
+ primitiveType: PrimitiveType_default.LINES,
+ boundingSphere: newBoundingSphere
+ });
+};
+GeometryPipeline.createAttributeLocations = function(geometry) {
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ const semantics = [
+ "position",
+ "positionHigh",
+ "positionLow",
+ "position3DHigh",
+ "position3DLow",
+ "position2DHigh",
+ "position2DLow",
+ "pickColor",
+ "normal",
+ "st",
+ "tangent",
+ "bitangent",
+ "extrudeDirection",
+ "compressedAttributes"
+ ];
+ const attributes = geometry.attributes;
+ const indices2 = {};
+ let j = 0;
+ let i;
+ const len = semantics.length;
+ for (i = 0; i < len; ++i) {
+ const semantic = semantics[i];
+ if (defined_default(attributes[semantic])) {
+ indices2[semantic] = j++;
+ }
+ }
+ for (const name in attributes) {
+ if (attributes.hasOwnProperty(name) && !defined_default(indices2[name])) {
+ indices2[name] = j++;
+ }
+ }
+ return indices2;
+};
+GeometryPipeline.reorderForPreVertexCache = function(geometry) {
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ const numVertices = Geometry_default.computeNumberOfVertices(geometry);
+ const indices2 = geometry.indices;
+ if (defined_default(indices2)) {
+ const indexCrossReferenceOldToNew = new Int32Array(numVertices);
+ for (let i = 0; i < numVertices; i++) {
+ indexCrossReferenceOldToNew[i] = -1;
+ }
+ const indicesIn = indices2;
+ const numIndices = indicesIn.length;
+ const indicesOut = IndexDatatype_default.createTypedArray(numVertices, numIndices);
+ let intoIndicesIn = 0;
+ let intoIndicesOut = 0;
+ let nextIndex = 0;
+ let tempIndex;
+ while (intoIndicesIn < numIndices) {
+ tempIndex = indexCrossReferenceOldToNew[indicesIn[intoIndicesIn]];
+ if (tempIndex !== -1) {
+ indicesOut[intoIndicesOut] = tempIndex;
+ } else {
+ tempIndex = indicesIn[intoIndicesIn];
+ indexCrossReferenceOldToNew[tempIndex] = nextIndex;
+ indicesOut[intoIndicesOut] = nextIndex;
+ ++nextIndex;
+ }
+ ++intoIndicesIn;
+ ++intoIndicesOut;
+ }
+ geometry.indices = indicesOut;
+ const attributes = geometry.attributes;
+ for (const property in attributes) {
+ if (attributes.hasOwnProperty(property) && defined_default(attributes[property]) && defined_default(attributes[property].values)) {
+ const attribute = attributes[property];
+ const elementsIn = attribute.values;
+ let intoElementsIn = 0;
+ const numComponents = attribute.componentsPerAttribute;
+ const elementsOut = ComponentDatatype_default.createTypedArray(
+ attribute.componentDatatype,
+ nextIndex * numComponents
+ );
+ while (intoElementsIn < numVertices) {
+ const temp = indexCrossReferenceOldToNew[intoElementsIn];
+ if (temp !== -1) {
+ for (let j = 0; j < numComponents; j++) {
+ elementsOut[numComponents * temp + j] = elementsIn[numComponents * intoElementsIn + j];
+ }
+ }
+ ++intoElementsIn;
+ }
+ attribute.values = elementsOut;
+ }
+ }
+ }
+ return geometry;
+};
+GeometryPipeline.reorderForPostVertexCache = function(geometry, cacheCapacity) {
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ const indices2 = geometry.indices;
+ if (geometry.primitiveType === PrimitiveType_default.TRIANGLES && defined_default(indices2)) {
+ const numIndices = indices2.length;
+ let maximumIndex = 0;
+ for (let j = 0; j < numIndices; j++) {
+ if (indices2[j] > maximumIndex) {
+ maximumIndex = indices2[j];
+ }
+ }
+ geometry.indices = Tipsify_default.tipsify({
+ indices: indices2,
+ maximumIndex,
+ cacheSize: cacheCapacity
+ });
+ }
+ return geometry;
+};
+function copyAttributesDescriptions(attributes) {
+ const newAttributes = {};
+ for (const attribute in attributes) {
+ if (attributes.hasOwnProperty(attribute) && defined_default(attributes[attribute]) && defined_default(attributes[attribute].values)) {
+ const attr = attributes[attribute];
+ newAttributes[attribute] = new GeometryAttribute_default({
+ componentDatatype: attr.componentDatatype,
+ componentsPerAttribute: attr.componentsPerAttribute,
+ normalize: attr.normalize,
+ values: []
+ });
+ }
+ }
+ return newAttributes;
+}
+function copyVertex(destinationAttributes, sourceAttributes, index) {
+ for (const attribute in sourceAttributes) {
+ if (sourceAttributes.hasOwnProperty(attribute) && defined_default(sourceAttributes[attribute]) && defined_default(sourceAttributes[attribute].values)) {
+ const attr = sourceAttributes[attribute];
+ for (let k = 0; k < attr.componentsPerAttribute; ++k) {
+ destinationAttributes[attribute].values.push(
+ attr.values[index * attr.componentsPerAttribute + k]
+ );
+ }
+ }
+ }
+}
+GeometryPipeline.fitToUnsignedShortIndices = function(geometry) {
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ if (defined_default(geometry.indices) && geometry.primitiveType !== PrimitiveType_default.TRIANGLES && geometry.primitiveType !== PrimitiveType_default.LINES && geometry.primitiveType !== PrimitiveType_default.POINTS) {
+ throw new DeveloperError_default(
+ "geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS."
+ );
+ }
+ const geometries = [];
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
+ if (defined_default(geometry.indices) && numberOfVertices >= Math_default.SIXTY_FOUR_KILOBYTES) {
+ let oldToNewIndex = [];
+ let newIndices = [];
+ let currentIndex = 0;
+ let newAttributes = copyAttributesDescriptions(geometry.attributes);
+ const originalIndices = geometry.indices;
+ const numberOfIndices = originalIndices.length;
+ let indicesPerPrimitive;
+ if (geometry.primitiveType === PrimitiveType_default.TRIANGLES) {
+ indicesPerPrimitive = 3;
+ } else if (geometry.primitiveType === PrimitiveType_default.LINES) {
+ indicesPerPrimitive = 2;
+ } else if (geometry.primitiveType === PrimitiveType_default.POINTS) {
+ indicesPerPrimitive = 1;
+ }
+ for (let j = 0; j < numberOfIndices; j += indicesPerPrimitive) {
+ for (let k = 0; k < indicesPerPrimitive; ++k) {
+ const x = originalIndices[j + k];
+ let i = oldToNewIndex[x];
+ if (!defined_default(i)) {
+ i = currentIndex++;
+ oldToNewIndex[x] = i;
+ copyVertex(newAttributes, geometry.attributes, x);
+ }
+ newIndices.push(i);
+ }
+ if (currentIndex + indicesPerPrimitive >= Math_default.SIXTY_FOUR_KILOBYTES) {
+ geometries.push(
+ new Geometry_default({
+ attributes: newAttributes,
+ indices: newIndices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere: geometry.boundingSphere,
+ boundingSphereCV: geometry.boundingSphereCV
+ })
+ );
+ oldToNewIndex = [];
+ newIndices = [];
+ currentIndex = 0;
+ newAttributes = copyAttributesDescriptions(geometry.attributes);
+ }
+ }
+ if (newIndices.length !== 0) {
+ geometries.push(
+ new Geometry_default({
+ attributes: newAttributes,
+ indices: newIndices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere: geometry.boundingSphere,
+ boundingSphereCV: geometry.boundingSphereCV
+ })
+ );
+ }
+ } else {
+ geometries.push(geometry);
+ }
+ return geometries;
+};
+var scratchProjectTo2DCartesian3 = new Cartesian3_default();
+var scratchProjectTo2DCartographic = new Cartographic_default();
+GeometryPipeline.projectTo2D = function(geometry, attributeName, attributeName3D, attributeName2D, projection) {
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ if (!defined_default(attributeName)) {
+ throw new DeveloperError_default("attributeName is required.");
+ }
+ if (!defined_default(attributeName3D)) {
+ throw new DeveloperError_default("attributeName3D is required.");
+ }
+ if (!defined_default(attributeName2D)) {
+ throw new DeveloperError_default("attributeName2D is required.");
+ }
+ if (!defined_default(geometry.attributes[attributeName])) {
+ throw new DeveloperError_default(
+ `geometry must have attribute matching the attributeName argument: ${attributeName}.`
+ );
+ }
+ if (geometry.attributes[attributeName].componentDatatype !== ComponentDatatype_default.DOUBLE) {
+ throw new DeveloperError_default(
+ "The attribute componentDatatype must be ComponentDatatype.DOUBLE."
+ );
+ }
+ const attribute = geometry.attributes[attributeName];
+ projection = defined_default(projection) ? projection : new GeographicProjection_default();
+ const ellipsoid = projection.ellipsoid;
+ const values3D = attribute.values;
+ const projectedValues = new Float64Array(values3D.length);
+ let index = 0;
+ for (let i = 0; i < values3D.length; i += 3) {
+ const value = Cartesian3_default.fromArray(
+ values3D,
+ i,
+ scratchProjectTo2DCartesian3
+ );
+ const lonLat = ellipsoid.cartesianToCartographic(
+ value,
+ scratchProjectTo2DCartographic
+ );
+ if (!defined_default(lonLat)) {
+ throw new DeveloperError_default(
+ `Could not project point (${value.x}, ${value.y}, ${value.z}) to 2D.`
+ );
+ }
+ const projectedLonLat = projection.project(
+ lonLat,
+ scratchProjectTo2DCartesian3
+ );
+ projectedValues[index++] = projectedLonLat.x;
+ projectedValues[index++] = projectedLonLat.y;
+ projectedValues[index++] = projectedLonLat.z;
+ }
+ geometry.attributes[attributeName3D] = attribute;
+ geometry.attributes[attributeName2D] = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: projectedValues
+ });
+ delete geometry.attributes[attributeName];
+ return geometry;
+};
+var encodedResult = {
+ high: 0,
+ low: 0
+};
+GeometryPipeline.encodeAttribute = function(geometry, attributeName, attributeHighName, attributeLowName) {
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ if (!defined_default(attributeName)) {
+ throw new DeveloperError_default("attributeName is required.");
+ }
+ if (!defined_default(attributeHighName)) {
+ throw new DeveloperError_default("attributeHighName is required.");
+ }
+ if (!defined_default(attributeLowName)) {
+ throw new DeveloperError_default("attributeLowName is required.");
+ }
+ if (!defined_default(geometry.attributes[attributeName])) {
+ throw new DeveloperError_default(
+ `geometry must have attribute matching the attributeName argument: ${attributeName}.`
+ );
+ }
+ if (geometry.attributes[attributeName].componentDatatype !== ComponentDatatype_default.DOUBLE) {
+ throw new DeveloperError_default(
+ "The attribute componentDatatype must be ComponentDatatype.DOUBLE."
+ );
+ }
+ const attribute = geometry.attributes[attributeName];
+ const values = attribute.values;
+ const length3 = values.length;
+ const highValues = new Float32Array(length3);
+ const lowValues = new Float32Array(length3);
+ for (let i = 0; i < length3; ++i) {
+ EncodedCartesian3_default.encode(values[i], encodedResult);
+ highValues[i] = encodedResult.high;
+ lowValues[i] = encodedResult.low;
+ }
+ const componentsPerAttribute = attribute.componentsPerAttribute;
+ geometry.attributes[attributeHighName] = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute,
+ values: highValues
+ });
+ geometry.attributes[attributeLowName] = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute,
+ values: lowValues
+ });
+ delete geometry.attributes[attributeName];
+ return geometry;
+};
+var scratchCartesian34 = new Cartesian3_default();
+function transformPoint(matrix, attribute) {
+ if (defined_default(attribute)) {
+ const values = attribute.values;
+ const length3 = values.length;
+ for (let i = 0; i < length3; i += 3) {
+ Cartesian3_default.unpack(values, i, scratchCartesian34);
+ Matrix4_default.multiplyByPoint(matrix, scratchCartesian34, scratchCartesian34);
+ Cartesian3_default.pack(scratchCartesian34, values, i);
+ }
+ }
+}
+function transformVector(matrix, attribute) {
+ if (defined_default(attribute)) {
+ const values = attribute.values;
+ const length3 = values.length;
+ for (let i = 0; i < length3; i += 3) {
+ Cartesian3_default.unpack(values, i, scratchCartesian34);
+ Matrix3_default.multiplyByVector(matrix, scratchCartesian34, scratchCartesian34);
+ scratchCartesian34 = Cartesian3_default.normalize(
+ scratchCartesian34,
+ scratchCartesian34
+ );
+ Cartesian3_default.pack(scratchCartesian34, values, i);
+ }
+ }
+}
+var inverseTranspose = new Matrix4_default();
+var normalMatrix = new Matrix3_default();
+GeometryPipeline.transformToWorldCoordinates = function(instance) {
+ if (!defined_default(instance)) {
+ throw new DeveloperError_default("instance is required.");
+ }
+ const modelMatrix = instance.modelMatrix;
+ if (Matrix4_default.equals(modelMatrix, Matrix4_default.IDENTITY)) {
+ return instance;
+ }
+ const attributes = instance.geometry.attributes;
+ transformPoint(modelMatrix, attributes.position);
+ transformPoint(modelMatrix, attributes.prevPosition);
+ transformPoint(modelMatrix, attributes.nextPosition);
+ if (defined_default(attributes.normal) || defined_default(attributes.tangent) || defined_default(attributes.bitangent)) {
+ Matrix4_default.inverse(modelMatrix, inverseTranspose);
+ Matrix4_default.transpose(inverseTranspose, inverseTranspose);
+ Matrix4_default.getMatrix3(inverseTranspose, normalMatrix);
+ transformVector(normalMatrix, attributes.normal);
+ transformVector(normalMatrix, attributes.tangent);
+ transformVector(normalMatrix, attributes.bitangent);
+ }
+ const boundingSphere = instance.geometry.boundingSphere;
+ if (defined_default(boundingSphere)) {
+ instance.geometry.boundingSphere = BoundingSphere_default.transform(
+ boundingSphere,
+ modelMatrix,
+ boundingSphere
+ );
+ }
+ instance.modelMatrix = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ return instance;
+};
+function findAttributesInAllGeometries(instances, propertyName) {
+ const length3 = instances.length;
+ const attributesInAllGeometries = {};
+ const attributes0 = instances[0][propertyName].attributes;
+ let name;
+ for (name in attributes0) {
+ if (attributes0.hasOwnProperty(name) && defined_default(attributes0[name]) && defined_default(attributes0[name].values)) {
+ const attribute = attributes0[name];
+ let numberOfComponents = attribute.values.length;
+ let inAllGeometries = true;
+ for (let i = 1; i < length3; ++i) {
+ const otherAttribute = instances[i][propertyName].attributes[name];
+ if (!defined_default(otherAttribute) || attribute.componentDatatype !== otherAttribute.componentDatatype || attribute.componentsPerAttribute !== otherAttribute.componentsPerAttribute || attribute.normalize !== otherAttribute.normalize) {
+ inAllGeometries = false;
+ break;
+ }
+ numberOfComponents += otherAttribute.values.length;
+ }
+ if (inAllGeometries) {
+ attributesInAllGeometries[name] = new GeometryAttribute_default({
+ componentDatatype: attribute.componentDatatype,
+ componentsPerAttribute: attribute.componentsPerAttribute,
+ normalize: attribute.normalize,
+ values: ComponentDatatype_default.createTypedArray(
+ attribute.componentDatatype,
+ numberOfComponents
+ )
+ });
+ }
+ }
+ }
+ return attributesInAllGeometries;
+}
+var tempScratch = new Cartesian3_default();
+function combineGeometries(instances, propertyName) {
+ const length3 = instances.length;
+ let name;
+ let i;
+ let j;
+ let k;
+ const m = instances[0].modelMatrix;
+ const haveIndices = defined_default(instances[0][propertyName].indices);
+ const primitiveType = instances[0][propertyName].primitiveType;
+ for (i = 1; i < length3; ++i) {
+ if (!Matrix4_default.equals(instances[i].modelMatrix, m)) {
+ throw new DeveloperError_default("All instances must have the same modelMatrix.");
+ }
+ if (defined_default(instances[i][propertyName].indices) !== haveIndices) {
+ throw new DeveloperError_default(
+ "All instance geometries must have an indices or not have one."
+ );
+ }
+ if (instances[i][propertyName].primitiveType !== primitiveType) {
+ throw new DeveloperError_default(
+ "All instance geometries must have the same primitiveType."
+ );
+ }
+ }
+ const attributes = findAttributesInAllGeometries(instances, propertyName);
+ let values;
+ let sourceValues;
+ let sourceValuesLength;
+ for (name in attributes) {
+ if (attributes.hasOwnProperty(name)) {
+ values = attributes[name].values;
+ k = 0;
+ for (i = 0; i < length3; ++i) {
+ sourceValues = instances[i][propertyName].attributes[name].values;
+ sourceValuesLength = sourceValues.length;
+ for (j = 0; j < sourceValuesLength; ++j) {
+ values[k++] = sourceValues[j];
+ }
+ }
+ }
+ }
+ let indices2;
+ if (haveIndices) {
+ let numberOfIndices = 0;
+ for (i = 0; i < length3; ++i) {
+ numberOfIndices += instances[i][propertyName].indices.length;
+ }
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(
+ new Geometry_default({
+ attributes,
+ primitiveType: PrimitiveType_default.POINTS
+ })
+ );
+ const destIndices = IndexDatatype_default.createTypedArray(
+ numberOfVertices,
+ numberOfIndices
+ );
+ let destOffset = 0;
+ let offset2 = 0;
+ for (i = 0; i < length3; ++i) {
+ const sourceIndices = instances[i][propertyName].indices;
+ const sourceIndicesLen = sourceIndices.length;
+ for (k = 0; k < sourceIndicesLen; ++k) {
+ destIndices[destOffset++] = offset2 + sourceIndices[k];
+ }
+ offset2 += Geometry_default.computeNumberOfVertices(instances[i][propertyName]);
+ }
+ indices2 = destIndices;
+ }
+ let center = new Cartesian3_default();
+ let radius = 0;
+ let bs;
+ for (i = 0; i < length3; ++i) {
+ bs = instances[i][propertyName].boundingSphere;
+ if (!defined_default(bs)) {
+ center = void 0;
+ break;
+ }
+ Cartesian3_default.add(bs.center, center, center);
+ }
+ if (defined_default(center)) {
+ Cartesian3_default.divideByScalar(center, length3, center);
+ for (i = 0; i < length3; ++i) {
+ bs = instances[i][propertyName].boundingSphere;
+ const tempRadius = Cartesian3_default.magnitude(
+ Cartesian3_default.subtract(bs.center, center, tempScratch)
+ ) + bs.radius;
+ if (tempRadius > radius) {
+ radius = tempRadius;
+ }
+ }
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType,
+ boundingSphere: defined_default(center) ? new BoundingSphere_default(center, radius) : void 0
+ });
+}
+GeometryPipeline.combineInstances = function(instances) {
+ if (!defined_default(instances) || instances.length < 1) {
+ throw new DeveloperError_default(
+ "instances is required and must have length greater than zero."
+ );
+ }
+ const instanceGeometry = [];
+ const instanceSplitGeometry = [];
+ const length3 = instances.length;
+ for (let i = 0; i < length3; ++i) {
+ const instance = instances[i];
+ if (defined_default(instance.geometry)) {
+ instanceGeometry.push(instance);
+ } else if (defined_default(instance.westHemisphereGeometry) && defined_default(instance.eastHemisphereGeometry)) {
+ instanceSplitGeometry.push(instance);
+ }
+ }
+ const geometries = [];
+ if (instanceGeometry.length > 0) {
+ geometries.push(combineGeometries(instanceGeometry, "geometry"));
+ }
+ if (instanceSplitGeometry.length > 0) {
+ geometries.push(
+ combineGeometries(instanceSplitGeometry, "westHemisphereGeometry")
+ );
+ geometries.push(
+ combineGeometries(instanceSplitGeometry, "eastHemisphereGeometry")
+ );
+ }
+ return geometries;
+};
+var normal = new Cartesian3_default();
+var v0 = new Cartesian3_default();
+var v1 = new Cartesian3_default();
+var v2 = new Cartesian3_default();
+GeometryPipeline.computeNormal = function(geometry) {
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ if (!defined_default(geometry.attributes.position) || !defined_default(geometry.attributes.position.values)) {
+ throw new DeveloperError_default(
+ "geometry.attributes.position.values is required."
+ );
+ }
+ if (!defined_default(geometry.indices)) {
+ throw new DeveloperError_default("geometry.indices is required.");
+ }
+ if (geometry.indices.length < 2 || geometry.indices.length % 3 !== 0) {
+ throw new DeveloperError_default(
+ "geometry.indices length must be greater than 0 and be a multiple of 3."
+ );
+ }
+ if (geometry.primitiveType !== PrimitiveType_default.TRIANGLES) {
+ throw new DeveloperError_default(
+ "geometry.primitiveType must be PrimitiveType.TRIANGLES."
+ );
+ }
+ const indices2 = geometry.indices;
+ const attributes = geometry.attributes;
+ const vertices = attributes.position.values;
+ const numVertices = attributes.position.values.length / 3;
+ const numIndices = indices2.length;
+ const normalsPerVertex = new Array(numVertices);
+ const normalsPerTriangle = new Array(numIndices / 3);
+ const normalIndices = new Array(numIndices);
+ let i;
+ for (i = 0; i < numVertices; i++) {
+ normalsPerVertex[i] = {
+ indexOffset: 0,
+ count: 0,
+ currentCount: 0
+ };
+ }
+ let j = 0;
+ for (i = 0; i < numIndices; i += 3) {
+ const i0 = indices2[i];
+ const i1 = indices2[i + 1];
+ const i2 = indices2[i + 2];
+ const i03 = i0 * 3;
+ const i13 = i1 * 3;
+ const i23 = i2 * 3;
+ v0.x = vertices[i03];
+ v0.y = vertices[i03 + 1];
+ v0.z = vertices[i03 + 2];
+ v1.x = vertices[i13];
+ v1.y = vertices[i13 + 1];
+ v1.z = vertices[i13 + 2];
+ v2.x = vertices[i23];
+ v2.y = vertices[i23 + 1];
+ v2.z = vertices[i23 + 2];
+ normalsPerVertex[i0].count++;
+ normalsPerVertex[i1].count++;
+ normalsPerVertex[i2].count++;
+ Cartesian3_default.subtract(v1, v0, v1);
+ Cartesian3_default.subtract(v2, v0, v2);
+ normalsPerTriangle[j] = Cartesian3_default.cross(v1, v2, new Cartesian3_default());
+ j++;
+ }
+ let indexOffset = 0;
+ for (i = 0; i < numVertices; i++) {
+ normalsPerVertex[i].indexOffset += indexOffset;
+ indexOffset += normalsPerVertex[i].count;
+ }
+ j = 0;
+ let vertexNormalData;
+ for (i = 0; i < numIndices; i += 3) {
+ vertexNormalData = normalsPerVertex[indices2[i]];
+ let index = vertexNormalData.indexOffset + vertexNormalData.currentCount;
+ normalIndices[index] = j;
+ vertexNormalData.currentCount++;
+ vertexNormalData = normalsPerVertex[indices2[i + 1]];
+ index = vertexNormalData.indexOffset + vertexNormalData.currentCount;
+ normalIndices[index] = j;
+ vertexNormalData.currentCount++;
+ vertexNormalData = normalsPerVertex[indices2[i + 2]];
+ index = vertexNormalData.indexOffset + vertexNormalData.currentCount;
+ normalIndices[index] = j;
+ vertexNormalData.currentCount++;
+ j++;
+ }
+ const normalValues = new Float32Array(numVertices * 3);
+ for (i = 0; i < numVertices; i++) {
+ const i3 = i * 3;
+ vertexNormalData = normalsPerVertex[i];
+ Cartesian3_default.clone(Cartesian3_default.ZERO, normal);
+ if (vertexNormalData.count > 0) {
+ for (j = 0; j < vertexNormalData.count; j++) {
+ Cartesian3_default.add(
+ normal,
+ normalsPerTriangle[normalIndices[vertexNormalData.indexOffset + j]],
+ normal
+ );
+ }
+ if (Cartesian3_default.equalsEpsilon(Cartesian3_default.ZERO, normal, Math_default.EPSILON10)) {
+ Cartesian3_default.clone(
+ normalsPerTriangle[normalIndices[vertexNormalData.indexOffset]],
+ normal
+ );
+ }
+ }
+ if (Cartesian3_default.equalsEpsilon(Cartesian3_default.ZERO, normal, Math_default.EPSILON10)) {
+ normal.z = 1;
+ }
+ Cartesian3_default.normalize(normal, normal);
+ normalValues[i3] = normal.x;
+ normalValues[i3 + 1] = normal.y;
+ normalValues[i3 + 2] = normal.z;
+ }
+ geometry.attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: normalValues
+ });
+ return geometry;
+};
+var normalScratch2 = new Cartesian3_default();
+var normalScale = new Cartesian3_default();
+var tScratch = new Cartesian3_default();
+GeometryPipeline.computeTangentAndBitangent = function(geometry) {
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ const attributes = geometry.attributes;
+ const indices2 = geometry.indices;
+ if (!defined_default(attributes.position) || !defined_default(attributes.position.values)) {
+ throw new DeveloperError_default(
+ "geometry.attributes.position.values is required."
+ );
+ }
+ if (!defined_default(attributes.normal) || !defined_default(attributes.normal.values)) {
+ throw new DeveloperError_default("geometry.attributes.normal.values is required.");
+ }
+ if (!defined_default(attributes.st) || !defined_default(attributes.st.values)) {
+ throw new DeveloperError_default("geometry.attributes.st.values is required.");
+ }
+ if (!defined_default(indices2)) {
+ throw new DeveloperError_default("geometry.indices is required.");
+ }
+ if (indices2.length < 2 || indices2.length % 3 !== 0) {
+ throw new DeveloperError_default(
+ "geometry.indices length must be greater than 0 and be a multiple of 3."
+ );
+ }
+ if (geometry.primitiveType !== PrimitiveType_default.TRIANGLES) {
+ throw new DeveloperError_default(
+ "geometry.primitiveType must be PrimitiveType.TRIANGLES."
+ );
+ }
+ const vertices = geometry.attributes.position.values;
+ const normals = geometry.attributes.normal.values;
+ const st = geometry.attributes.st.values;
+ const numVertices = geometry.attributes.position.values.length / 3;
+ const numIndices = indices2.length;
+ const tan1 = new Array(numVertices * 3);
+ let i;
+ for (i = 0; i < tan1.length; i++) {
+ tan1[i] = 0;
+ }
+ let i03;
+ let i13;
+ let i23;
+ for (i = 0; i < numIndices; i += 3) {
+ const i0 = indices2[i];
+ const i1 = indices2[i + 1];
+ const i2 = indices2[i + 2];
+ i03 = i0 * 3;
+ i13 = i1 * 3;
+ i23 = i2 * 3;
+ const i02 = i0 * 2;
+ const i12 = i1 * 2;
+ const i22 = i2 * 2;
+ const ux = vertices[i03];
+ const uy = vertices[i03 + 1];
+ const uz = vertices[i03 + 2];
+ const wx = st[i02];
+ const wy = st[i02 + 1];
+ const t1 = st[i12 + 1] - wy;
+ const t2 = st[i22 + 1] - wy;
+ const r = 1 / ((st[i12] - wx) * t2 - (st[i22] - wx) * t1);
+ const sdirx = (t2 * (vertices[i13] - ux) - t1 * (vertices[i23] - ux)) * r;
+ const sdiry = (t2 * (vertices[i13 + 1] - uy) - t1 * (vertices[i23 + 1] - uy)) * r;
+ const sdirz = (t2 * (vertices[i13 + 2] - uz) - t1 * (vertices[i23 + 2] - uz)) * r;
+ tan1[i03] += sdirx;
+ tan1[i03 + 1] += sdiry;
+ tan1[i03 + 2] += sdirz;
+ tan1[i13] += sdirx;
+ tan1[i13 + 1] += sdiry;
+ tan1[i13 + 2] += sdirz;
+ tan1[i23] += sdirx;
+ tan1[i23 + 1] += sdiry;
+ tan1[i23 + 2] += sdirz;
+ }
+ const tangentValues = new Float32Array(numVertices * 3);
+ const bitangentValues = new Float32Array(numVertices * 3);
+ for (i = 0; i < numVertices; i++) {
+ i03 = i * 3;
+ i13 = i03 + 1;
+ i23 = i03 + 2;
+ const n = Cartesian3_default.fromArray(normals, i03, normalScratch2);
+ const t = Cartesian3_default.fromArray(tan1, i03, tScratch);
+ const scalar = Cartesian3_default.dot(n, t);
+ Cartesian3_default.multiplyByScalar(n, scalar, normalScale);
+ Cartesian3_default.normalize(Cartesian3_default.subtract(t, normalScale, t), t);
+ tangentValues[i03] = t.x;
+ tangentValues[i13] = t.y;
+ tangentValues[i23] = t.z;
+ Cartesian3_default.normalize(Cartesian3_default.cross(n, t, t), t);
+ bitangentValues[i03] = t.x;
+ bitangentValues[i13] = t.y;
+ bitangentValues[i23] = t.z;
+ }
+ geometry.attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangentValues
+ });
+ geometry.attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangentValues
+ });
+ return geometry;
+};
+var scratchCartesian23 = new Cartesian2_default();
+var toEncode1 = new Cartesian3_default();
+var toEncode2 = new Cartesian3_default();
+var toEncode3 = new Cartesian3_default();
+var encodeResult2 = new Cartesian2_default();
+GeometryPipeline.compressVertices = function(geometry) {
+ if (!defined_default(geometry)) {
+ throw new DeveloperError_default("geometry is required.");
+ }
+ const extrudeAttribute = geometry.attributes.extrudeDirection;
+ let i;
+ let numVertices;
+ if (defined_default(extrudeAttribute)) {
+ const extrudeDirections = extrudeAttribute.values;
+ numVertices = extrudeDirections.length / 3;
+ const compressedDirections = new Float32Array(numVertices * 2);
+ let i2 = 0;
+ for (i = 0; i < numVertices; ++i) {
+ Cartesian3_default.fromArray(extrudeDirections, i * 3, toEncode1);
+ if (Cartesian3_default.equals(toEncode1, Cartesian3_default.ZERO)) {
+ i2 += 2;
+ continue;
+ }
+ encodeResult2 = AttributeCompression_default.octEncodeInRange(
+ toEncode1,
+ 65535,
+ encodeResult2
+ );
+ compressedDirections[i2++] = encodeResult2.x;
+ compressedDirections[i2++] = encodeResult2.y;
+ }
+ geometry.attributes.compressedAttributes = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: compressedDirections
+ });
+ delete geometry.attributes.extrudeDirection;
+ return geometry;
+ }
+ const normalAttribute = geometry.attributes.normal;
+ const stAttribute = geometry.attributes.st;
+ const hasNormal = defined_default(normalAttribute);
+ const hasSt = defined_default(stAttribute);
+ if (!hasNormal && !hasSt) {
+ return geometry;
+ }
+ const tangentAttribute = geometry.attributes.tangent;
+ const bitangentAttribute = geometry.attributes.bitangent;
+ const hasTangent = defined_default(tangentAttribute);
+ const hasBitangent = defined_default(bitangentAttribute);
+ let normals;
+ let st;
+ let tangents;
+ let bitangents;
+ if (hasNormal) {
+ normals = normalAttribute.values;
+ }
+ if (hasSt) {
+ st = stAttribute.values;
+ }
+ if (hasTangent) {
+ tangents = tangentAttribute.values;
+ }
+ if (hasBitangent) {
+ bitangents = bitangentAttribute.values;
+ }
+ const length3 = hasNormal ? normals.length : st.length;
+ const numComponents = hasNormal ? 3 : 2;
+ numVertices = length3 / numComponents;
+ let compressedLength = numVertices;
+ let numCompressedComponents = hasSt && hasNormal ? 2 : 1;
+ numCompressedComponents += hasTangent || hasBitangent ? 1 : 0;
+ compressedLength *= numCompressedComponents;
+ const compressedAttributes = new Float32Array(compressedLength);
+ let normalIndex = 0;
+ for (i = 0; i < numVertices; ++i) {
+ if (hasSt) {
+ Cartesian2_default.fromArray(st, i * 2, scratchCartesian23);
+ compressedAttributes[normalIndex++] = AttributeCompression_default.compressTextureCoordinates(scratchCartesian23);
+ }
+ const index = i * 3;
+ if (hasNormal && defined_default(tangents) && defined_default(bitangents)) {
+ Cartesian3_default.fromArray(normals, index, toEncode1);
+ Cartesian3_default.fromArray(tangents, index, toEncode2);
+ Cartesian3_default.fromArray(bitangents, index, toEncode3);
+ AttributeCompression_default.octPack(
+ toEncode1,
+ toEncode2,
+ toEncode3,
+ scratchCartesian23
+ );
+ compressedAttributes[normalIndex++] = scratchCartesian23.x;
+ compressedAttributes[normalIndex++] = scratchCartesian23.y;
+ } else {
+ if (hasNormal) {
+ Cartesian3_default.fromArray(normals, index, toEncode1);
+ compressedAttributes[normalIndex++] = AttributeCompression_default.octEncodeFloat(toEncode1);
+ }
+ if (hasTangent) {
+ Cartesian3_default.fromArray(tangents, index, toEncode1);
+ compressedAttributes[normalIndex++] = AttributeCompression_default.octEncodeFloat(toEncode1);
+ }
+ if (hasBitangent) {
+ Cartesian3_default.fromArray(bitangents, index, toEncode1);
+ compressedAttributes[normalIndex++] = AttributeCompression_default.octEncodeFloat(toEncode1);
+ }
+ }
+ }
+ geometry.attributes.compressedAttributes = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: numCompressedComponents,
+ values: compressedAttributes
+ });
+ if (hasNormal) {
+ delete geometry.attributes.normal;
+ }
+ if (hasSt) {
+ delete geometry.attributes.st;
+ }
+ if (hasBitangent) {
+ delete geometry.attributes.bitangent;
+ }
+ if (hasTangent) {
+ delete geometry.attributes.tangent;
+ }
+ return geometry;
+};
+function indexTriangles(geometry) {
+ if (defined_default(geometry.indices)) {
+ return geometry;
+ }
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
+ if (numberOfVertices < 3) {
+ throw new DeveloperError_default("The number of vertices must be at least three.");
+ }
+ if (numberOfVertices % 3 !== 0) {
+ throw new DeveloperError_default(
+ "The number of vertices must be a multiple of three."
+ );
+ }
+ const indices2 = IndexDatatype_default.createTypedArray(
+ numberOfVertices,
+ numberOfVertices
+ );
+ for (let i = 0; i < numberOfVertices; ++i) {
+ indices2[i] = i;
+ }
+ geometry.indices = indices2;
+ return geometry;
+}
+function indexTriangleFan(geometry) {
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
+ if (numberOfVertices < 3) {
+ throw new DeveloperError_default("The number of vertices must be at least three.");
+ }
+ const indices2 = IndexDatatype_default.createTypedArray(
+ numberOfVertices,
+ (numberOfVertices - 2) * 3
+ );
+ indices2[0] = 1;
+ indices2[1] = 0;
+ indices2[2] = 2;
+ let indicesIndex = 3;
+ for (let i = 3; i < numberOfVertices; ++i) {
+ indices2[indicesIndex++] = i - 1;
+ indices2[indicesIndex++] = 0;
+ indices2[indicesIndex++] = i;
+ }
+ geometry.indices = indices2;
+ geometry.primitiveType = PrimitiveType_default.TRIANGLES;
+ return geometry;
+}
+function indexTriangleStrip(geometry) {
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
+ if (numberOfVertices < 3) {
+ throw new DeveloperError_default("The number of vertices must be at least 3.");
+ }
+ const indices2 = IndexDatatype_default.createTypedArray(
+ numberOfVertices,
+ (numberOfVertices - 2) * 3
+ );
+ indices2[0] = 0;
+ indices2[1] = 1;
+ indices2[2] = 2;
+ if (numberOfVertices > 3) {
+ indices2[3] = 0;
+ indices2[4] = 2;
+ indices2[5] = 3;
+ }
+ let indicesIndex = 6;
+ for (let i = 3; i < numberOfVertices - 1; i += 2) {
+ indices2[indicesIndex++] = i;
+ indices2[indicesIndex++] = i - 1;
+ indices2[indicesIndex++] = i + 1;
+ if (i + 2 < numberOfVertices) {
+ indices2[indicesIndex++] = i;
+ indices2[indicesIndex++] = i + 1;
+ indices2[indicesIndex++] = i + 2;
+ }
+ }
+ geometry.indices = indices2;
+ geometry.primitiveType = PrimitiveType_default.TRIANGLES;
+ return geometry;
+}
+function indexLines(geometry) {
+ if (defined_default(geometry.indices)) {
+ return geometry;
+ }
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
+ if (numberOfVertices < 2) {
+ throw new DeveloperError_default("The number of vertices must be at least two.");
+ }
+ if (numberOfVertices % 2 !== 0) {
+ throw new DeveloperError_default("The number of vertices must be a multiple of 2.");
+ }
+ const indices2 = IndexDatatype_default.createTypedArray(
+ numberOfVertices,
+ numberOfVertices
+ );
+ for (let i = 0; i < numberOfVertices; ++i) {
+ indices2[i] = i;
+ }
+ geometry.indices = indices2;
+ return geometry;
+}
+function indexLineStrip(geometry) {
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
+ if (numberOfVertices < 2) {
+ throw new DeveloperError_default("The number of vertices must be at least two.");
+ }
+ const indices2 = IndexDatatype_default.createTypedArray(
+ numberOfVertices,
+ (numberOfVertices - 1) * 2
+ );
+ indices2[0] = 0;
+ indices2[1] = 1;
+ let indicesIndex = 2;
+ for (let i = 2; i < numberOfVertices; ++i) {
+ indices2[indicesIndex++] = i - 1;
+ indices2[indicesIndex++] = i;
+ }
+ geometry.indices = indices2;
+ geometry.primitiveType = PrimitiveType_default.LINES;
+ return geometry;
+}
+function indexLineLoop(geometry) {
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
+ if (numberOfVertices < 2) {
+ throw new DeveloperError_default("The number of vertices must be at least two.");
+ }
+ const indices2 = IndexDatatype_default.createTypedArray(
+ numberOfVertices,
+ numberOfVertices * 2
+ );
+ indices2[0] = 0;
+ indices2[1] = 1;
+ let indicesIndex = 2;
+ for (let i = 2; i < numberOfVertices; ++i) {
+ indices2[indicesIndex++] = i - 1;
+ indices2[indicesIndex++] = i;
+ }
+ indices2[indicesIndex++] = numberOfVertices - 1;
+ indices2[indicesIndex] = 0;
+ geometry.indices = indices2;
+ geometry.primitiveType = PrimitiveType_default.LINES;
+ return geometry;
+}
+function indexPrimitive(geometry) {
+ switch (geometry.primitiveType) {
+ case PrimitiveType_default.TRIANGLE_FAN:
+ return indexTriangleFan(geometry);
+ case PrimitiveType_default.TRIANGLE_STRIP:
+ return indexTriangleStrip(geometry);
+ case PrimitiveType_default.TRIANGLES:
+ return indexTriangles(geometry);
+ case PrimitiveType_default.LINE_STRIP:
+ return indexLineStrip(geometry);
+ case PrimitiveType_default.LINE_LOOP:
+ return indexLineLoop(geometry);
+ case PrimitiveType_default.LINES:
+ return indexLines(geometry);
+ }
+ return geometry;
+}
+function offsetPointFromXZPlane(p, isBehind) {
+ if (Math.abs(p.y) < Math_default.EPSILON6) {
+ if (isBehind) {
+ p.y = -Math_default.EPSILON6;
+ } else {
+ p.y = Math_default.EPSILON6;
+ }
+ }
+}
+function offsetTriangleFromXZPlane(p0, p1, p2) {
+ if (p0.y !== 0 && p1.y !== 0 && p2.y !== 0) {
+ offsetPointFromXZPlane(p0, p0.y < 0);
+ offsetPointFromXZPlane(p1, p1.y < 0);
+ offsetPointFromXZPlane(p2, p2.y < 0);
+ return;
+ }
+ const p0y = Math.abs(p0.y);
+ const p1y = Math.abs(p1.y);
+ const p2y = Math.abs(p2.y);
+ let sign2;
+ if (p0y > p1y) {
+ if (p0y > p2y) {
+ sign2 = Math_default.sign(p0.y);
+ } else {
+ sign2 = Math_default.sign(p2.y);
+ }
+ } else if (p1y > p2y) {
+ sign2 = Math_default.sign(p1.y);
+ } else {
+ sign2 = Math_default.sign(p2.y);
+ }
+ const isBehind = sign2 < 0;
+ offsetPointFromXZPlane(p0, isBehind);
+ offsetPointFromXZPlane(p1, isBehind);
+ offsetPointFromXZPlane(p2, isBehind);
+}
+var c3 = new Cartesian3_default();
+function getXZIntersectionOffsetPoints(p, p1, u12, v13) {
+ Cartesian3_default.add(
+ p,
+ Cartesian3_default.multiplyByScalar(
+ Cartesian3_default.subtract(p1, p, c3),
+ p.y / (p.y - p1.y),
+ c3
+ ),
+ u12
+ );
+ Cartesian3_default.clone(u12, v13);
+ offsetPointFromXZPlane(u12, true);
+ offsetPointFromXZPlane(v13, false);
+}
+var u1 = new Cartesian3_default();
+var u2 = new Cartesian3_default();
+var q1 = new Cartesian3_default();
+var q2 = new Cartesian3_default();
+var splitTriangleResult = {
+ positions: new Array(7),
+ indices: new Array(3 * 3)
+};
+function splitTriangle(p0, p1, p2) {
+ if (p0.x >= 0 || p1.x >= 0 || p2.x >= 0) {
+ return void 0;
+ }
+ offsetTriangleFromXZPlane(p0, p1, p2);
+ const p0Behind = p0.y < 0;
+ const p1Behind = p1.y < 0;
+ const p2Behind = p2.y < 0;
+ let numBehind = 0;
+ numBehind += p0Behind ? 1 : 0;
+ numBehind += p1Behind ? 1 : 0;
+ numBehind += p2Behind ? 1 : 0;
+ const indices2 = splitTriangleResult.indices;
+ if (numBehind === 1) {
+ indices2[1] = 3;
+ indices2[2] = 4;
+ indices2[5] = 6;
+ indices2[7] = 6;
+ indices2[8] = 5;
+ if (p0Behind) {
+ getXZIntersectionOffsetPoints(p0, p1, u1, q1);
+ getXZIntersectionOffsetPoints(p0, p2, u2, q2);
+ indices2[0] = 0;
+ indices2[3] = 1;
+ indices2[4] = 2;
+ indices2[6] = 1;
+ } else if (p1Behind) {
+ getXZIntersectionOffsetPoints(p1, p2, u1, q1);
+ getXZIntersectionOffsetPoints(p1, p0, u2, q2);
+ indices2[0] = 1;
+ indices2[3] = 2;
+ indices2[4] = 0;
+ indices2[6] = 2;
+ } else if (p2Behind) {
+ getXZIntersectionOffsetPoints(p2, p0, u1, q1);
+ getXZIntersectionOffsetPoints(p2, p1, u2, q2);
+ indices2[0] = 2;
+ indices2[3] = 0;
+ indices2[4] = 1;
+ indices2[6] = 0;
+ }
+ } else if (numBehind === 2) {
+ indices2[2] = 4;
+ indices2[4] = 4;
+ indices2[5] = 3;
+ indices2[7] = 5;
+ indices2[8] = 6;
+ if (!p0Behind) {
+ getXZIntersectionOffsetPoints(p0, p1, u1, q1);
+ getXZIntersectionOffsetPoints(p0, p2, u2, q2);
+ indices2[0] = 1;
+ indices2[1] = 2;
+ indices2[3] = 1;
+ indices2[6] = 0;
+ } else if (!p1Behind) {
+ getXZIntersectionOffsetPoints(p1, p2, u1, q1);
+ getXZIntersectionOffsetPoints(p1, p0, u2, q2);
+ indices2[0] = 2;
+ indices2[1] = 0;
+ indices2[3] = 2;
+ indices2[6] = 1;
+ } else if (!p2Behind) {
+ getXZIntersectionOffsetPoints(p2, p0, u1, q1);
+ getXZIntersectionOffsetPoints(p2, p1, u2, q2);
+ indices2[0] = 0;
+ indices2[1] = 1;
+ indices2[3] = 0;
+ indices2[6] = 2;
+ }
+ }
+ const positions = splitTriangleResult.positions;
+ positions[0] = p0;
+ positions[1] = p1;
+ positions[2] = p2;
+ positions.length = 3;
+ if (numBehind === 1 || numBehind === 2) {
+ positions[3] = u1;
+ positions[4] = u2;
+ positions[5] = q1;
+ positions[6] = q2;
+ positions.length = 7;
+ }
+ return splitTriangleResult;
+}
+function updateGeometryAfterSplit(geometry, computeBoundingSphere) {
+ const attributes = geometry.attributes;
+ if (attributes.position.values.length === 0) {
+ return void 0;
+ }
+ for (const property in attributes) {
+ if (attributes.hasOwnProperty(property) && defined_default(attributes[property]) && defined_default(attributes[property].values)) {
+ const attribute = attributes[property];
+ attribute.values = ComponentDatatype_default.createTypedArray(
+ attribute.componentDatatype,
+ attribute.values
+ );
+ }
+ }
+ const numberOfVertices = Geometry_default.computeNumberOfVertices(geometry);
+ geometry.indices = IndexDatatype_default.createTypedArray(
+ numberOfVertices,
+ geometry.indices
+ );
+ if (computeBoundingSphere) {
+ geometry.boundingSphere = BoundingSphere_default.fromVertices(
+ attributes.position.values
+ );
+ }
+ return geometry;
+}
+function copyGeometryForSplit(geometry) {
+ const attributes = geometry.attributes;
+ const copiedAttributes = {};
+ for (const property in attributes) {
+ if (attributes.hasOwnProperty(property) && defined_default(attributes[property]) && defined_default(attributes[property].values)) {
+ const attribute = attributes[property];
+ copiedAttributes[property] = new GeometryAttribute_default({
+ componentDatatype: attribute.componentDatatype,
+ componentsPerAttribute: attribute.componentsPerAttribute,
+ normalize: attribute.normalize,
+ values: []
+ });
+ }
+ }
+ return new Geometry_default({
+ attributes: copiedAttributes,
+ indices: [],
+ primitiveType: geometry.primitiveType
+ });
+}
+function updateInstanceAfterSplit(instance, westGeometry, eastGeometry) {
+ const computeBoundingSphere = defined_default(instance.geometry.boundingSphere);
+ westGeometry = updateGeometryAfterSplit(westGeometry, computeBoundingSphere);
+ eastGeometry = updateGeometryAfterSplit(eastGeometry, computeBoundingSphere);
+ if (defined_default(eastGeometry) && !defined_default(westGeometry)) {
+ instance.geometry = eastGeometry;
+ } else if (!defined_default(eastGeometry) && defined_default(westGeometry)) {
+ instance.geometry = westGeometry;
+ } else {
+ instance.westHemisphereGeometry = westGeometry;
+ instance.eastHemisphereGeometry = eastGeometry;
+ instance.geometry = void 0;
+ }
+}
+function generateBarycentricInterpolateFunction(CartesianType, numberOfComponents) {
+ const v0Scratch = new CartesianType();
+ const v1Scratch2 = new CartesianType();
+ const v2Scratch2 = new CartesianType();
+ return function(i0, i1, i2, coords, sourceValues, currentValues, insertedIndex, normalize2) {
+ const v02 = CartesianType.fromArray(
+ sourceValues,
+ i0 * numberOfComponents,
+ v0Scratch
+ );
+ const v13 = CartesianType.fromArray(
+ sourceValues,
+ i1 * numberOfComponents,
+ v1Scratch2
+ );
+ const v23 = CartesianType.fromArray(
+ sourceValues,
+ i2 * numberOfComponents,
+ v2Scratch2
+ );
+ CartesianType.multiplyByScalar(v02, coords.x, v02);
+ CartesianType.multiplyByScalar(v13, coords.y, v13);
+ CartesianType.multiplyByScalar(v23, coords.z, v23);
+ const value = CartesianType.add(v02, v13, v02);
+ CartesianType.add(value, v23, value);
+ if (normalize2) {
+ CartesianType.normalize(value, value);
+ }
+ CartesianType.pack(
+ value,
+ currentValues,
+ insertedIndex * numberOfComponents
+ );
+ };
+}
+var interpolateAndPackCartesian4 = generateBarycentricInterpolateFunction(
+ Cartesian4_default,
+ 4
+);
+var interpolateAndPackCartesian3 = generateBarycentricInterpolateFunction(
+ Cartesian3_default,
+ 3
+);
+var interpolateAndPackCartesian2 = generateBarycentricInterpolateFunction(
+ Cartesian2_default,
+ 2
+);
+var interpolateAndPackBoolean = function(i0, i1, i2, coords, sourceValues, currentValues, insertedIndex) {
+ const v13 = sourceValues[i0] * coords.x;
+ const v23 = sourceValues[i1] * coords.y;
+ const v32 = sourceValues[i2] * coords.z;
+ currentValues[insertedIndex] = v13 + v23 + v32 > Math_default.EPSILON6 ? 1 : 0;
+};
+var p0Scratch = new Cartesian3_default();
+var p1Scratch = new Cartesian3_default();
+var p2Scratch = new Cartesian3_default();
+var barycentricScratch = new Cartesian3_default();
+function computeTriangleAttributes(i0, i1, i2, point, positions, normals, tangents, bitangents, texCoords, extrudeDirections, applyOffset, currentAttributes, customAttributeNames, customAttributesLength, allAttributes, insertedIndex) {
+ if (!defined_default(normals) && !defined_default(tangents) && !defined_default(bitangents) && !defined_default(texCoords) && !defined_default(extrudeDirections) && customAttributesLength === 0) {
+ return;
+ }
+ const p0 = Cartesian3_default.fromArray(positions, i0 * 3, p0Scratch);
+ const p1 = Cartesian3_default.fromArray(positions, i1 * 3, p1Scratch);
+ const p2 = Cartesian3_default.fromArray(positions, i2 * 3, p2Scratch);
+ const coords = barycentricCoordinates_default(point, p0, p1, p2, barycentricScratch);
+ if (!defined_default(coords)) {
+ return;
+ }
+ if (defined_default(normals)) {
+ interpolateAndPackCartesian3(
+ i0,
+ i1,
+ i2,
+ coords,
+ normals,
+ currentAttributes.normal.values,
+ insertedIndex,
+ true
+ );
+ }
+ if (defined_default(extrudeDirections)) {
+ const d0 = Cartesian3_default.fromArray(extrudeDirections, i0 * 3, p0Scratch);
+ const d1 = Cartesian3_default.fromArray(extrudeDirections, i1 * 3, p1Scratch);
+ const d2 = Cartesian3_default.fromArray(extrudeDirections, i2 * 3, p2Scratch);
+ Cartesian3_default.multiplyByScalar(d0, coords.x, d0);
+ Cartesian3_default.multiplyByScalar(d1, coords.y, d1);
+ Cartesian3_default.multiplyByScalar(d2, coords.z, d2);
+ let direction2;
+ if (!Cartesian3_default.equals(d0, Cartesian3_default.ZERO) || !Cartesian3_default.equals(d1, Cartesian3_default.ZERO) || !Cartesian3_default.equals(d2, Cartesian3_default.ZERO)) {
+ direction2 = Cartesian3_default.add(d0, d1, d0);
+ Cartesian3_default.add(direction2, d2, direction2);
+ Cartesian3_default.normalize(direction2, direction2);
+ } else {
+ direction2 = p0Scratch;
+ direction2.x = 0;
+ direction2.y = 0;
+ direction2.z = 0;
+ }
+ Cartesian3_default.pack(
+ direction2,
+ currentAttributes.extrudeDirection.values,
+ insertedIndex * 3
+ );
+ }
+ if (defined_default(applyOffset)) {
+ interpolateAndPackBoolean(
+ i0,
+ i1,
+ i2,
+ coords,
+ applyOffset,
+ currentAttributes.applyOffset.values,
+ insertedIndex
+ );
+ }
+ if (defined_default(tangents)) {
+ interpolateAndPackCartesian3(
+ i0,
+ i1,
+ i2,
+ coords,
+ tangents,
+ currentAttributes.tangent.values,
+ insertedIndex,
+ true
+ );
+ }
+ if (defined_default(bitangents)) {
+ interpolateAndPackCartesian3(
+ i0,
+ i1,
+ i2,
+ coords,
+ bitangents,
+ currentAttributes.bitangent.values,
+ insertedIndex,
+ true
+ );
+ }
+ if (defined_default(texCoords)) {
+ interpolateAndPackCartesian2(
+ i0,
+ i1,
+ i2,
+ coords,
+ texCoords,
+ currentAttributes.st.values,
+ insertedIndex
+ );
+ }
+ if (customAttributesLength > 0) {
+ for (let i = 0; i < customAttributesLength; i++) {
+ const attributeName = customAttributeNames[i];
+ genericInterpolate(
+ i0,
+ i1,
+ i2,
+ coords,
+ insertedIndex,
+ allAttributes[attributeName],
+ currentAttributes[attributeName]
+ );
+ }
+ }
+}
+function genericInterpolate(i0, i1, i2, coords, insertedIndex, sourceAttribute, currentAttribute) {
+ const componentsPerAttribute = sourceAttribute.componentsPerAttribute;
+ const sourceValues = sourceAttribute.values;
+ const currentValues = currentAttribute.values;
+ switch (componentsPerAttribute) {
+ case 4:
+ interpolateAndPackCartesian4(
+ i0,
+ i1,
+ i2,
+ coords,
+ sourceValues,
+ currentValues,
+ insertedIndex,
+ false
+ );
+ break;
+ case 3:
+ interpolateAndPackCartesian3(
+ i0,
+ i1,
+ i2,
+ coords,
+ sourceValues,
+ currentValues,
+ insertedIndex,
+ false
+ );
+ break;
+ case 2:
+ interpolateAndPackCartesian2(
+ i0,
+ i1,
+ i2,
+ coords,
+ sourceValues,
+ currentValues,
+ insertedIndex,
+ false
+ );
+ break;
+ default:
+ currentValues[insertedIndex] = sourceValues[i0] * coords.x + sourceValues[i1] * coords.y + sourceValues[i2] * coords.z;
+ }
+}
+function insertSplitPoint(currentAttributes, currentIndices, currentIndexMap, indices2, currentIndex, point) {
+ const insertIndex = currentAttributes.position.values.length / 3;
+ if (currentIndex !== -1) {
+ const prevIndex = indices2[currentIndex];
+ const newIndex = currentIndexMap[prevIndex];
+ if (newIndex === -1) {
+ currentIndexMap[prevIndex] = insertIndex;
+ currentAttributes.position.values.push(point.x, point.y, point.z);
+ currentIndices.push(insertIndex);
+ return insertIndex;
+ }
+ currentIndices.push(newIndex);
+ return newIndex;
+ }
+ currentAttributes.position.values.push(point.x, point.y, point.z);
+ currentIndices.push(insertIndex);
+ return insertIndex;
+}
+var NAMED_ATTRIBUTES = {
+ position: true,
+ normal: true,
+ bitangent: true,
+ tangent: true,
+ st: true,
+ extrudeDirection: true,
+ applyOffset: true
+};
+function splitLongitudeTriangles(instance) {
+ const geometry = instance.geometry;
+ const attributes = geometry.attributes;
+ const positions = attributes.position.values;
+ const normals = defined_default(attributes.normal) ? attributes.normal.values : void 0;
+ const bitangents = defined_default(attributes.bitangent) ? attributes.bitangent.values : void 0;
+ const tangents = defined_default(attributes.tangent) ? attributes.tangent.values : void 0;
+ const texCoords = defined_default(attributes.st) ? attributes.st.values : void 0;
+ const extrudeDirections = defined_default(attributes.extrudeDirection) ? attributes.extrudeDirection.values : void 0;
+ const applyOffset = defined_default(attributes.applyOffset) ? attributes.applyOffset.values : void 0;
+ const indices2 = geometry.indices;
+ const customAttributeNames = [];
+ for (const attributeName in attributes) {
+ if (attributes.hasOwnProperty(attributeName) && !NAMED_ATTRIBUTES[attributeName] && defined_default(attributes[attributeName])) {
+ customAttributeNames.push(attributeName);
+ }
+ }
+ const customAttributesLength = customAttributeNames.length;
+ const eastGeometry = copyGeometryForSplit(geometry);
+ const westGeometry = copyGeometryForSplit(geometry);
+ let currentAttributes;
+ let currentIndices;
+ let currentIndexMap;
+ let insertedIndex;
+ let i;
+ const westGeometryIndexMap = [];
+ westGeometryIndexMap.length = positions.length / 3;
+ const eastGeometryIndexMap = [];
+ eastGeometryIndexMap.length = positions.length / 3;
+ for (i = 0; i < westGeometryIndexMap.length; ++i) {
+ westGeometryIndexMap[i] = -1;
+ eastGeometryIndexMap[i] = -1;
+ }
+ const len = indices2.length;
+ for (i = 0; i < len; i += 3) {
+ const i0 = indices2[i];
+ const i1 = indices2[i + 1];
+ const i2 = indices2[i + 2];
+ let p0 = Cartesian3_default.fromArray(positions, i0 * 3);
+ let p1 = Cartesian3_default.fromArray(positions, i1 * 3);
+ let p2 = Cartesian3_default.fromArray(positions, i2 * 3);
+ const result = splitTriangle(p0, p1, p2);
+ if (defined_default(result) && result.positions.length > 3) {
+ const resultPositions = result.positions;
+ const resultIndices = result.indices;
+ const resultLength = resultIndices.length;
+ for (let j = 0; j < resultLength; ++j) {
+ const resultIndex = resultIndices[j];
+ const point = resultPositions[resultIndex];
+ if (point.y < 0) {
+ currentAttributes = westGeometry.attributes;
+ currentIndices = westGeometry.indices;
+ currentIndexMap = westGeometryIndexMap;
+ } else {
+ currentAttributes = eastGeometry.attributes;
+ currentIndices = eastGeometry.indices;
+ currentIndexMap = eastGeometryIndexMap;
+ }
+ insertedIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices2,
+ resultIndex < 3 ? i + resultIndex : -1,
+ point
+ );
+ computeTriangleAttributes(
+ i0,
+ i1,
+ i2,
+ point,
+ positions,
+ normals,
+ tangents,
+ bitangents,
+ texCoords,
+ extrudeDirections,
+ applyOffset,
+ currentAttributes,
+ customAttributeNames,
+ customAttributesLength,
+ attributes,
+ insertedIndex
+ );
+ }
+ } else {
+ if (defined_default(result)) {
+ p0 = result.positions[0];
+ p1 = result.positions[1];
+ p2 = result.positions[2];
+ }
+ if (p0.y < 0) {
+ currentAttributes = westGeometry.attributes;
+ currentIndices = westGeometry.indices;
+ currentIndexMap = westGeometryIndexMap;
+ } else {
+ currentAttributes = eastGeometry.attributes;
+ currentIndices = eastGeometry.indices;
+ currentIndexMap = eastGeometryIndexMap;
+ }
+ insertedIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices2,
+ i,
+ p0
+ );
+ computeTriangleAttributes(
+ i0,
+ i1,
+ i2,
+ p0,
+ positions,
+ normals,
+ tangents,
+ bitangents,
+ texCoords,
+ extrudeDirections,
+ applyOffset,
+ currentAttributes,
+ customAttributeNames,
+ customAttributesLength,
+ attributes,
+ insertedIndex
+ );
+ insertedIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices2,
+ i + 1,
+ p1
+ );
+ computeTriangleAttributes(
+ i0,
+ i1,
+ i2,
+ p1,
+ positions,
+ normals,
+ tangents,
+ bitangents,
+ texCoords,
+ extrudeDirections,
+ applyOffset,
+ currentAttributes,
+ customAttributeNames,
+ customAttributesLength,
+ attributes,
+ insertedIndex
+ );
+ insertedIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices2,
+ i + 2,
+ p2
+ );
+ computeTriangleAttributes(
+ i0,
+ i1,
+ i2,
+ p2,
+ positions,
+ normals,
+ tangents,
+ bitangents,
+ texCoords,
+ extrudeDirections,
+ applyOffset,
+ currentAttributes,
+ customAttributeNames,
+ customAttributesLength,
+ attributes,
+ insertedIndex
+ );
+ }
+ }
+ updateInstanceAfterSplit(instance, westGeometry, eastGeometry);
+}
+var xzPlane = Plane_default.fromPointNormal(Cartesian3_default.ZERO, Cartesian3_default.UNIT_Y);
+var offsetScratch = new Cartesian3_default();
+var offsetPointScratch = new Cartesian3_default();
+function computeLineAttributes(i0, i1, point, positions, insertIndex, currentAttributes, applyOffset) {
+ if (!defined_default(applyOffset)) {
+ return;
+ }
+ const p0 = Cartesian3_default.fromArray(positions, i0 * 3, p0Scratch);
+ if (Cartesian3_default.equalsEpsilon(p0, point, Math_default.EPSILON10)) {
+ currentAttributes.applyOffset.values[insertIndex] = applyOffset[i0];
+ } else {
+ currentAttributes.applyOffset.values[insertIndex] = applyOffset[i1];
+ }
+}
+function splitLongitudeLines(instance) {
+ const geometry = instance.geometry;
+ const attributes = geometry.attributes;
+ const positions = attributes.position.values;
+ const applyOffset = defined_default(attributes.applyOffset) ? attributes.applyOffset.values : void 0;
+ const indices2 = geometry.indices;
+ const eastGeometry = copyGeometryForSplit(geometry);
+ const westGeometry = copyGeometryForSplit(geometry);
+ let i;
+ const length3 = indices2.length;
+ const westGeometryIndexMap = [];
+ westGeometryIndexMap.length = positions.length / 3;
+ const eastGeometryIndexMap = [];
+ eastGeometryIndexMap.length = positions.length / 3;
+ for (i = 0; i < westGeometryIndexMap.length; ++i) {
+ westGeometryIndexMap[i] = -1;
+ eastGeometryIndexMap[i] = -1;
+ }
+ for (i = 0; i < length3; i += 2) {
+ const i0 = indices2[i];
+ const i1 = indices2[i + 1];
+ const p0 = Cartesian3_default.fromArray(positions, i0 * 3, p0Scratch);
+ const p1 = Cartesian3_default.fromArray(positions, i1 * 3, p1Scratch);
+ let insertIndex;
+ if (Math.abs(p0.y) < Math_default.EPSILON6) {
+ if (p0.y < 0) {
+ p0.y = -Math_default.EPSILON6;
+ } else {
+ p0.y = Math_default.EPSILON6;
+ }
+ }
+ if (Math.abs(p1.y) < Math_default.EPSILON6) {
+ if (p1.y < 0) {
+ p1.y = -Math_default.EPSILON6;
+ } else {
+ p1.y = Math_default.EPSILON6;
+ }
+ }
+ let p0Attributes = eastGeometry.attributes;
+ let p0Indices = eastGeometry.indices;
+ let p0IndexMap = eastGeometryIndexMap;
+ let p1Attributes = westGeometry.attributes;
+ let p1Indices = westGeometry.indices;
+ let p1IndexMap = westGeometryIndexMap;
+ const intersection = IntersectionTests_default.lineSegmentPlane(
+ p0,
+ p1,
+ xzPlane,
+ p2Scratch
+ );
+ if (defined_default(intersection)) {
+ const offset2 = Cartesian3_default.multiplyByScalar(
+ Cartesian3_default.UNIT_Y,
+ 5 * Math_default.EPSILON9,
+ offsetScratch
+ );
+ if (p0.y < 0) {
+ Cartesian3_default.negate(offset2, offset2);
+ p0Attributes = westGeometry.attributes;
+ p0Indices = westGeometry.indices;
+ p0IndexMap = westGeometryIndexMap;
+ p1Attributes = eastGeometry.attributes;
+ p1Indices = eastGeometry.indices;
+ p1IndexMap = eastGeometryIndexMap;
+ }
+ const offsetPoint = Cartesian3_default.add(
+ intersection,
+ offset2,
+ offsetPointScratch
+ );
+ insertIndex = insertSplitPoint(
+ p0Attributes,
+ p0Indices,
+ p0IndexMap,
+ indices2,
+ i,
+ p0
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ p0,
+ positions,
+ insertIndex,
+ p0Attributes,
+ applyOffset
+ );
+ insertIndex = insertSplitPoint(
+ p0Attributes,
+ p0Indices,
+ p0IndexMap,
+ indices2,
+ -1,
+ offsetPoint
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ offsetPoint,
+ positions,
+ insertIndex,
+ p0Attributes,
+ applyOffset
+ );
+ Cartesian3_default.negate(offset2, offset2);
+ Cartesian3_default.add(intersection, offset2, offsetPoint);
+ insertIndex = insertSplitPoint(
+ p1Attributes,
+ p1Indices,
+ p1IndexMap,
+ indices2,
+ -1,
+ offsetPoint
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ offsetPoint,
+ positions,
+ insertIndex,
+ p1Attributes,
+ applyOffset
+ );
+ insertIndex = insertSplitPoint(
+ p1Attributes,
+ p1Indices,
+ p1IndexMap,
+ indices2,
+ i + 1,
+ p1
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ p1,
+ positions,
+ insertIndex,
+ p1Attributes,
+ applyOffset
+ );
+ } else {
+ let currentAttributes;
+ let currentIndices;
+ let currentIndexMap;
+ if (p0.y < 0) {
+ currentAttributes = westGeometry.attributes;
+ currentIndices = westGeometry.indices;
+ currentIndexMap = westGeometryIndexMap;
+ } else {
+ currentAttributes = eastGeometry.attributes;
+ currentIndices = eastGeometry.indices;
+ currentIndexMap = eastGeometryIndexMap;
+ }
+ insertIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices2,
+ i,
+ p0
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ p0,
+ positions,
+ insertIndex,
+ currentAttributes,
+ applyOffset
+ );
+ insertIndex = insertSplitPoint(
+ currentAttributes,
+ currentIndices,
+ currentIndexMap,
+ indices2,
+ i + 1,
+ p1
+ );
+ computeLineAttributes(
+ i0,
+ i1,
+ p1,
+ positions,
+ insertIndex,
+ currentAttributes,
+ applyOffset
+ );
+ }
+ }
+ updateInstanceAfterSplit(instance, westGeometry, eastGeometry);
+}
+var cartesian2Scratch0 = new Cartesian2_default();
+var cartesian2Scratch1 = new Cartesian2_default();
+var cartesian3Scratch0 = new Cartesian3_default();
+var cartesian3Scratch2 = new Cartesian3_default();
+var cartesian3Scratch3 = new Cartesian3_default();
+var cartesian3Scratch4 = new Cartesian3_default();
+var cartesian3Scratch5 = new Cartesian3_default();
+var cartesian3Scratch6 = new Cartesian3_default();
+var cartesian4Scratch0 = new Cartesian4_default();
+function updateAdjacencyAfterSplit(geometry) {
+ const attributes = geometry.attributes;
+ const positions = attributes.position.values;
+ const prevPositions = attributes.prevPosition.values;
+ const nextPositions = attributes.nextPosition.values;
+ const length3 = positions.length;
+ for (let j = 0; j < length3; j += 3) {
+ const position = Cartesian3_default.unpack(positions, j, cartesian3Scratch0);
+ if (position.x > 0) {
+ continue;
+ }
+ const prevPosition = Cartesian3_default.unpack(
+ prevPositions,
+ j,
+ cartesian3Scratch2
+ );
+ if (position.y < 0 && prevPosition.y > 0 || position.y > 0 && prevPosition.y < 0) {
+ if (j - 3 > 0) {
+ prevPositions[j] = positions[j - 3];
+ prevPositions[j + 1] = positions[j - 2];
+ prevPositions[j + 2] = positions[j - 1];
+ } else {
+ Cartesian3_default.pack(position, prevPositions, j);
+ }
+ }
+ const nextPosition = Cartesian3_default.unpack(
+ nextPositions,
+ j,
+ cartesian3Scratch3
+ );
+ if (position.y < 0 && nextPosition.y > 0 || position.y > 0 && nextPosition.y < 0) {
+ if (j + 3 < length3) {
+ nextPositions[j] = positions[j + 3];
+ nextPositions[j + 1] = positions[j + 4];
+ nextPositions[j + 2] = positions[j + 5];
+ } else {
+ Cartesian3_default.pack(position, nextPositions, j);
+ }
+ }
+ }
+}
+var offsetScalar = 5 * Math_default.EPSILON9;
+var coplanarOffset = Math_default.EPSILON6;
+function splitLongitudePolyline(instance) {
+ const geometry = instance.geometry;
+ const attributes = geometry.attributes;
+ const positions = attributes.position.values;
+ const prevPositions = attributes.prevPosition.values;
+ const nextPositions = attributes.nextPosition.values;
+ const expandAndWidths = attributes.expandAndWidth.values;
+ const texCoords = defined_default(attributes.st) ? attributes.st.values : void 0;
+ const colors = defined_default(attributes.color) ? attributes.color.values : void 0;
+ const eastGeometry = copyGeometryForSplit(geometry);
+ const westGeometry = copyGeometryForSplit(geometry);
+ let i;
+ let j;
+ let index;
+ let intersectionFound = false;
+ const length3 = positions.length / 3;
+ for (i = 0; i < length3; i += 4) {
+ const i0 = i;
+ const i2 = i + 2;
+ const p0 = Cartesian3_default.fromArray(positions, i0 * 3, cartesian3Scratch0);
+ const p2 = Cartesian3_default.fromArray(positions, i2 * 3, cartesian3Scratch2);
+ if (Math.abs(p0.y) < coplanarOffset) {
+ p0.y = coplanarOffset * (p2.y < 0 ? -1 : 1);
+ positions[i * 3 + 1] = p0.y;
+ positions[(i + 1) * 3 + 1] = p0.y;
+ for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {
+ prevPositions[j] = positions[i * 3];
+ prevPositions[j + 1] = positions[i * 3 + 1];
+ prevPositions[j + 2] = positions[i * 3 + 2];
+ }
+ }
+ if (Math.abs(p2.y) < coplanarOffset) {
+ p2.y = coplanarOffset * (p0.y < 0 ? -1 : 1);
+ positions[(i + 2) * 3 + 1] = p2.y;
+ positions[(i + 3) * 3 + 1] = p2.y;
+ for (j = i0 * 3; j < i0 * 3 + 4 * 3; j += 3) {
+ nextPositions[j] = positions[(i + 2) * 3];
+ nextPositions[j + 1] = positions[(i + 2) * 3 + 1];
+ nextPositions[j + 2] = positions[(i + 2) * 3 + 2];
+ }
+ }
+ let p0Attributes = eastGeometry.attributes;
+ let p0Indices = eastGeometry.indices;
+ let p2Attributes = westGeometry.attributes;
+ let p2Indices = westGeometry.indices;
+ const intersection = IntersectionTests_default.lineSegmentPlane(
+ p0,
+ p2,
+ xzPlane,
+ cartesian3Scratch4
+ );
+ if (defined_default(intersection)) {
+ intersectionFound = true;
+ const offset2 = Cartesian3_default.multiplyByScalar(
+ Cartesian3_default.UNIT_Y,
+ offsetScalar,
+ cartesian3Scratch5
+ );
+ if (p0.y < 0) {
+ Cartesian3_default.negate(offset2, offset2);
+ p0Attributes = westGeometry.attributes;
+ p0Indices = westGeometry.indices;
+ p2Attributes = eastGeometry.attributes;
+ p2Indices = eastGeometry.indices;
+ }
+ const offsetPoint = Cartesian3_default.add(
+ intersection,
+ offset2,
+ cartesian3Scratch6
+ );
+ p0Attributes.position.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);
+ p0Attributes.position.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p0Attributes.position.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p0Attributes.prevPosition.values.push(
+ prevPositions[i0 * 3],
+ prevPositions[i0 * 3 + 1],
+ prevPositions[i0 * 3 + 2]
+ );
+ p0Attributes.prevPosition.values.push(
+ prevPositions[i0 * 3 + 3],
+ prevPositions[i0 * 3 + 4],
+ prevPositions[i0 * 3 + 5]
+ );
+ p0Attributes.prevPosition.values.push(p0.x, p0.y, p0.z, p0.x, p0.y, p0.z);
+ p0Attributes.nextPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p0Attributes.nextPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p0Attributes.nextPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p0Attributes.nextPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ Cartesian3_default.negate(offset2, offset2);
+ Cartesian3_default.add(intersection, offset2, offsetPoint);
+ p2Attributes.position.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.position.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.position.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);
+ p2Attributes.prevPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.prevPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.prevPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.prevPosition.values.push(
+ offsetPoint.x,
+ offsetPoint.y,
+ offsetPoint.z
+ );
+ p2Attributes.nextPosition.values.push(p2.x, p2.y, p2.z, p2.x, p2.y, p2.z);
+ p2Attributes.nextPosition.values.push(
+ nextPositions[i2 * 3],
+ nextPositions[i2 * 3 + 1],
+ nextPositions[i2 * 3 + 2]
+ );
+ p2Attributes.nextPosition.values.push(
+ nextPositions[i2 * 3 + 3],
+ nextPositions[i2 * 3 + 4],
+ nextPositions[i2 * 3 + 5]
+ );
+ const ew0 = Cartesian2_default.fromArray(
+ expandAndWidths,
+ i0 * 2,
+ cartesian2Scratch0
+ );
+ const width = Math.abs(ew0.y);
+ p0Attributes.expandAndWidth.values.push(-1, width, 1, width);
+ p0Attributes.expandAndWidth.values.push(-1, -width, 1, -width);
+ p2Attributes.expandAndWidth.values.push(-1, width, 1, width);
+ p2Attributes.expandAndWidth.values.push(-1, -width, 1, -width);
+ let t = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(intersection, p0, cartesian3Scratch3)
+ );
+ t /= Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(p2, p0, cartesian3Scratch3)
+ );
+ if (defined_default(colors)) {
+ const c0 = Cartesian4_default.fromArray(colors, i0 * 4, cartesian4Scratch0);
+ const c22 = Cartesian4_default.fromArray(colors, i2 * 4, cartesian4Scratch0);
+ const r = Math_default.lerp(c0.x, c22.x, t);
+ const g = Math_default.lerp(c0.y, c22.y, t);
+ const b = Math_default.lerp(c0.z, c22.z, t);
+ const a3 = Math_default.lerp(c0.w, c22.w, t);
+ for (j = i0 * 4; j < i0 * 4 + 2 * 4; ++j) {
+ p0Attributes.color.values.push(colors[j]);
+ }
+ p0Attributes.color.values.push(r, g, b, a3);
+ p0Attributes.color.values.push(r, g, b, a3);
+ p2Attributes.color.values.push(r, g, b, a3);
+ p2Attributes.color.values.push(r, g, b, a3);
+ for (j = i2 * 4; j < i2 * 4 + 2 * 4; ++j) {
+ p2Attributes.color.values.push(colors[j]);
+ }
+ }
+ if (defined_default(texCoords)) {
+ const s0 = Cartesian2_default.fromArray(texCoords, i0 * 2, cartesian2Scratch0);
+ const s3 = Cartesian2_default.fromArray(
+ texCoords,
+ (i + 3) * 2,
+ cartesian2Scratch1
+ );
+ const sx = Math_default.lerp(s0.x, s3.x, t);
+ for (j = i0 * 2; j < i0 * 2 + 2 * 2; ++j) {
+ p0Attributes.st.values.push(texCoords[j]);
+ }
+ p0Attributes.st.values.push(sx, s0.y);
+ p0Attributes.st.values.push(sx, s3.y);
+ p2Attributes.st.values.push(sx, s0.y);
+ p2Attributes.st.values.push(sx, s3.y);
+ for (j = i2 * 2; j < i2 * 2 + 2 * 2; ++j) {
+ p2Attributes.st.values.push(texCoords[j]);
+ }
+ }
+ index = p0Attributes.position.values.length / 3 - 4;
+ p0Indices.push(index, index + 2, index + 1);
+ p0Indices.push(index + 1, index + 2, index + 3);
+ index = p2Attributes.position.values.length / 3 - 4;
+ p2Indices.push(index, index + 2, index + 1);
+ p2Indices.push(index + 1, index + 2, index + 3);
+ } else {
+ let currentAttributes;
+ let currentIndices;
+ if (p0.y < 0) {
+ currentAttributes = westGeometry.attributes;
+ currentIndices = westGeometry.indices;
+ } else {
+ currentAttributes = eastGeometry.attributes;
+ currentIndices = eastGeometry.indices;
+ }
+ currentAttributes.position.values.push(p0.x, p0.y, p0.z);
+ currentAttributes.position.values.push(p0.x, p0.y, p0.z);
+ currentAttributes.position.values.push(p2.x, p2.y, p2.z);
+ currentAttributes.position.values.push(p2.x, p2.y, p2.z);
+ for (j = i * 3; j < i * 3 + 4 * 3; ++j) {
+ currentAttributes.prevPosition.values.push(prevPositions[j]);
+ currentAttributes.nextPosition.values.push(nextPositions[j]);
+ }
+ for (j = i * 2; j < i * 2 + 4 * 2; ++j) {
+ currentAttributes.expandAndWidth.values.push(expandAndWidths[j]);
+ if (defined_default(texCoords)) {
+ currentAttributes.st.values.push(texCoords[j]);
+ }
+ }
+ if (defined_default(colors)) {
+ for (j = i * 4; j < i * 4 + 4 * 4; ++j) {
+ currentAttributes.color.values.push(colors[j]);
+ }
+ }
+ index = currentAttributes.position.values.length / 3 - 4;
+ currentIndices.push(index, index + 2, index + 1);
+ currentIndices.push(index + 1, index + 2, index + 3);
+ }
+ }
+ if (intersectionFound) {
+ updateAdjacencyAfterSplit(westGeometry);
+ updateAdjacencyAfterSplit(eastGeometry);
+ }
+ updateInstanceAfterSplit(instance, westGeometry, eastGeometry);
+}
+GeometryPipeline.splitLongitude = function(instance) {
+ if (!defined_default(instance)) {
+ throw new DeveloperError_default("instance is required.");
+ }
+ const geometry = instance.geometry;
+ const boundingSphere = geometry.boundingSphere;
+ if (defined_default(boundingSphere)) {
+ const minX = boundingSphere.center.x - boundingSphere.radius;
+ if (minX > 0 || BoundingSphere_default.intersectPlane(boundingSphere, Plane_default.ORIGIN_ZX_PLANE) !== Intersect_default.INTERSECTING) {
+ return instance;
+ }
+ }
+ if (geometry.geometryType !== GeometryType_default.NONE) {
+ switch (geometry.geometryType) {
+ case GeometryType_default.POLYLINES:
+ splitLongitudePolyline(instance);
+ break;
+ case GeometryType_default.TRIANGLES:
+ splitLongitudeTriangles(instance);
+ break;
+ case GeometryType_default.LINES:
+ splitLongitudeLines(instance);
+ break;
+ }
+ } else {
+ indexPrimitive(geometry);
+ if (geometry.primitiveType === PrimitiveType_default.TRIANGLES) {
+ splitLongitudeTriangles(instance);
+ } else if (geometry.primitiveType === PrimitiveType_default.LINES) {
+ splitLongitudeLines(instance);
+ }
+ }
+ return instance;
+};
+var GeometryPipeline_default = GeometryPipeline;
+
+// Source/Core/WebMercatorProjection.js
+function WebMercatorProjection(ellipsoid) {
+ this._ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ this._semimajorAxis = this._ellipsoid.maximumRadius;
+ this._oneOverSemimajorAxis = 1 / this._semimajorAxis;
+}
+Object.defineProperties(WebMercatorProjection.prototype, {
+ ellipsoid: {
+ get: function() {
+ return this._ellipsoid;
+ }
+ }
+});
+WebMercatorProjection.mercatorAngleToGeodeticLatitude = function(mercatorAngle) {
+ return Math_default.PI_OVER_TWO - 2 * Math.atan(Math.exp(-mercatorAngle));
+};
+WebMercatorProjection.geodeticLatitudeToMercatorAngle = function(latitude) {
+ if (latitude > WebMercatorProjection.MaximumLatitude) {
+ latitude = WebMercatorProjection.MaximumLatitude;
+ } else if (latitude < -WebMercatorProjection.MaximumLatitude) {
+ latitude = -WebMercatorProjection.MaximumLatitude;
+ }
+ const sinLatitude = Math.sin(latitude);
+ return 0.5 * Math.log((1 + sinLatitude) / (1 - sinLatitude));
+};
+WebMercatorProjection.MaximumLatitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(
+ Math.PI
+);
+WebMercatorProjection.prototype.project = function(cartographic2, result) {
+ const semimajorAxis = this._semimajorAxis;
+ const x = cartographic2.longitude * semimajorAxis;
+ const y = WebMercatorProjection.geodeticLatitudeToMercatorAngle(
+ cartographic2.latitude
+ ) * semimajorAxis;
+ const z = cartographic2.height;
+ if (!defined_default(result)) {
+ return new Cartesian3_default(x, y, z);
+ }
+ result.x = x;
+ result.y = y;
+ result.z = z;
+ return result;
+};
+WebMercatorProjection.prototype.unproject = function(cartesian11, result) {
+ if (!defined_default(cartesian11)) {
+ throw new DeveloperError_default("cartesian is required");
+ }
+ const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;
+ const longitude = cartesian11.x * oneOverEarthSemimajorAxis;
+ const latitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(
+ cartesian11.y * oneOverEarthSemimajorAxis
+ );
+ const height = cartesian11.z;
+ if (!defined_default(result)) {
+ return new Cartographic_default(longitude, latitude, height);
+ }
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = height;
+ return result;
+};
+var WebMercatorProjection_default = WebMercatorProjection;
+
+// Source/Scene/PrimitivePipeline.js
+function transformToWorldCoordinates(instances, primitiveModelMatrix, scene3DOnly) {
+ let toWorld = !scene3DOnly;
+ const length3 = instances.length;
+ let i;
+ if (!toWorld && length3 > 1) {
+ const modelMatrix = instances[0].modelMatrix;
+ for (i = 1; i < length3; ++i) {
+ if (!Matrix4_default.equals(modelMatrix, instances[i].modelMatrix)) {
+ toWorld = true;
+ break;
+ }
+ }
+ }
+ if (toWorld) {
+ for (i = 0; i < length3; ++i) {
+ if (defined_default(instances[i].geometry)) {
+ GeometryPipeline_default.transformToWorldCoordinates(instances[i]);
+ }
+ }
+ } else {
+ Matrix4_default.multiplyTransformation(
+ primitiveModelMatrix,
+ instances[0].modelMatrix,
+ primitiveModelMatrix
+ );
+ }
+}
+function addGeometryBatchId(geometry, batchId) {
+ const attributes = geometry.attributes;
+ const positionAttr = attributes.position;
+ const numberOfComponents = positionAttr.values.length / positionAttr.componentsPerAttribute;
+ attributes.batchId = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 1,
+ values: new Float32Array(numberOfComponents)
+ });
+ const values = attributes.batchId.values;
+ for (let j = 0; j < numberOfComponents; ++j) {
+ values[j] = batchId;
+ }
+}
+function addBatchIds(instances) {
+ const length3 = instances.length;
+ for (let i = 0; i < length3; ++i) {
+ const instance = instances[i];
+ if (defined_default(instance.geometry)) {
+ addGeometryBatchId(instance.geometry, i);
+ } else if (defined_default(instance.westHemisphereGeometry) && defined_default(instance.eastHemisphereGeometry)) {
+ addGeometryBatchId(instance.westHemisphereGeometry, i);
+ addGeometryBatchId(instance.eastHemisphereGeometry, i);
+ }
+ }
+}
+function geometryPipeline(parameters) {
+ const instances = parameters.instances;
+ const projection = parameters.projection;
+ const uintIndexSupport = parameters.elementIndexUintSupported;
+ const scene3DOnly = parameters.scene3DOnly;
+ const vertexCacheOptimize = parameters.vertexCacheOptimize;
+ const compressVertices = parameters.compressVertices;
+ const modelMatrix = parameters.modelMatrix;
+ let i;
+ let geometry;
+ let primitiveType;
+ let length3 = instances.length;
+ for (i = 0; i < length3; ++i) {
+ if (defined_default(instances[i].geometry)) {
+ primitiveType = instances[i].geometry.primitiveType;
+ break;
+ }
+ }
+ for (i = 1; i < length3; ++i) {
+ if (defined_default(instances[i].geometry) && instances[i].geometry.primitiveType !== primitiveType) {
+ throw new DeveloperError_default(
+ "All instance geometries must have the same primitiveType."
+ );
+ }
+ }
+ transformToWorldCoordinates(instances, modelMatrix, scene3DOnly);
+ if (!scene3DOnly) {
+ for (i = 0; i < length3; ++i) {
+ if (defined_default(instances[i].geometry)) {
+ GeometryPipeline_default.splitLongitude(instances[i]);
+ }
+ }
+ }
+ addBatchIds(instances);
+ if (vertexCacheOptimize) {
+ for (i = 0; i < length3; ++i) {
+ const instance = instances[i];
+ if (defined_default(instance.geometry)) {
+ GeometryPipeline_default.reorderForPostVertexCache(instance.geometry);
+ GeometryPipeline_default.reorderForPreVertexCache(instance.geometry);
+ } else if (defined_default(instance.westHemisphereGeometry) && defined_default(instance.eastHemisphereGeometry)) {
+ GeometryPipeline_default.reorderForPostVertexCache(
+ instance.westHemisphereGeometry
+ );
+ GeometryPipeline_default.reorderForPreVertexCache(
+ instance.westHemisphereGeometry
+ );
+ GeometryPipeline_default.reorderForPostVertexCache(
+ instance.eastHemisphereGeometry
+ );
+ GeometryPipeline_default.reorderForPreVertexCache(
+ instance.eastHemisphereGeometry
+ );
+ }
+ }
+ }
+ let geometries = GeometryPipeline_default.combineInstances(instances);
+ length3 = geometries.length;
+ for (i = 0; i < length3; ++i) {
+ geometry = geometries[i];
+ const attributes = geometry.attributes;
+ if (!scene3DOnly) {
+ for (const name in attributes) {
+ if (attributes.hasOwnProperty(name) && attributes[name].componentDatatype === ComponentDatatype_default.DOUBLE) {
+ const name3D = `${name}3D`;
+ const name2D = `${name}2D`;
+ GeometryPipeline_default.projectTo2D(
+ geometry,
+ name,
+ name3D,
+ name2D,
+ projection
+ );
+ if (defined_default(geometry.boundingSphere) && name === "position") {
+ geometry.boundingSphereCV = BoundingSphere_default.fromVertices(
+ geometry.attributes.position2D.values
+ );
+ }
+ GeometryPipeline_default.encodeAttribute(
+ geometry,
+ name3D,
+ `${name3D}High`,
+ `${name3D}Low`
+ );
+ GeometryPipeline_default.encodeAttribute(
+ geometry,
+ name2D,
+ `${name2D}High`,
+ `${name2D}Low`
+ );
+ }
+ }
+ } else {
+ for (const name in attributes) {
+ if (attributes.hasOwnProperty(name) && attributes[name].componentDatatype === ComponentDatatype_default.DOUBLE) {
+ GeometryPipeline_default.encodeAttribute(
+ geometry,
+ name,
+ `${name}3DHigh`,
+ `${name}3DLow`
+ );
+ }
+ }
+ }
+ if (compressVertices) {
+ GeometryPipeline_default.compressVertices(geometry);
+ }
+ }
+ if (!uintIndexSupport) {
+ let splitGeometries = [];
+ length3 = geometries.length;
+ for (i = 0; i < length3; ++i) {
+ geometry = geometries[i];
+ splitGeometries = splitGeometries.concat(
+ GeometryPipeline_default.fitToUnsignedShortIndices(geometry)
+ );
+ }
+ geometries = splitGeometries;
+ }
+ return geometries;
+}
+function createPickOffsets(instances, geometryName, geometries, pickOffsets) {
+ let offset2;
+ let indexCount;
+ let geometryIndex;
+ const offsetIndex = pickOffsets.length - 1;
+ if (offsetIndex >= 0) {
+ const pickOffset = pickOffsets[offsetIndex];
+ offset2 = pickOffset.offset + pickOffset.count;
+ geometryIndex = pickOffset.index;
+ indexCount = geometries[geometryIndex].indices.length;
+ } else {
+ offset2 = 0;
+ geometryIndex = 0;
+ indexCount = geometries[geometryIndex].indices.length;
+ }
+ const length3 = instances.length;
+ for (let i = 0; i < length3; ++i) {
+ const instance = instances[i];
+ const geometry = instance[geometryName];
+ if (!defined_default(geometry)) {
+ continue;
+ }
+ const count = geometry.indices.length;
+ if (offset2 + count > indexCount) {
+ offset2 = 0;
+ indexCount = geometries[++geometryIndex].indices.length;
+ }
+ pickOffsets.push({
+ index: geometryIndex,
+ offset: offset2,
+ count
+ });
+ offset2 += count;
+ }
+}
+function createInstancePickOffsets(instances, geometries) {
+ const pickOffsets = [];
+ createPickOffsets(instances, "geometry", geometries, pickOffsets);
+ createPickOffsets(
+ instances,
+ "westHemisphereGeometry",
+ geometries,
+ pickOffsets
+ );
+ createPickOffsets(
+ instances,
+ "eastHemisphereGeometry",
+ geometries,
+ pickOffsets
+ );
+ return pickOffsets;
+}
+var PrimitivePipeline = {};
+PrimitivePipeline.combineGeometry = function(parameters) {
+ let geometries;
+ let attributeLocations8;
+ const instances = parameters.instances;
+ const length3 = instances.length;
+ let pickOffsets;
+ let offsetInstanceExtend;
+ let hasOffset = false;
+ if (length3 > 0) {
+ geometries = geometryPipeline(parameters);
+ if (geometries.length > 0) {
+ attributeLocations8 = GeometryPipeline_default.createAttributeLocations(
+ geometries[0]
+ );
+ if (parameters.createPickOffsets) {
+ pickOffsets = createInstancePickOffsets(instances, geometries);
+ }
+ }
+ if (defined_default(instances[0].attributes) && defined_default(instances[0].attributes.offset)) {
+ offsetInstanceExtend = new Array(length3);
+ hasOffset = true;
+ }
+ }
+ const boundingSpheres = new Array(length3);
+ const boundingSpheresCV = new Array(length3);
+ for (let i = 0; i < length3; ++i) {
+ const instance = instances[i];
+ const geometry = instance.geometry;
+ if (defined_default(geometry)) {
+ boundingSpheres[i] = geometry.boundingSphere;
+ boundingSpheresCV[i] = geometry.boundingSphereCV;
+ if (hasOffset) {
+ offsetInstanceExtend[i] = instance.geometry.offsetAttribute;
+ }
+ }
+ const eastHemisphereGeometry = instance.eastHemisphereGeometry;
+ const westHemisphereGeometry = instance.westHemisphereGeometry;
+ if (defined_default(eastHemisphereGeometry) && defined_default(westHemisphereGeometry)) {
+ if (defined_default(eastHemisphereGeometry.boundingSphere) && defined_default(westHemisphereGeometry.boundingSphere)) {
+ boundingSpheres[i] = BoundingSphere_default.union(
+ eastHemisphereGeometry.boundingSphere,
+ westHemisphereGeometry.boundingSphere
+ );
+ }
+ if (defined_default(eastHemisphereGeometry.boundingSphereCV) && defined_default(westHemisphereGeometry.boundingSphereCV)) {
+ boundingSpheresCV[i] = BoundingSphere_default.union(
+ eastHemisphereGeometry.boundingSphereCV,
+ westHemisphereGeometry.boundingSphereCV
+ );
+ }
+ }
+ }
+ return {
+ geometries,
+ modelMatrix: parameters.modelMatrix,
+ attributeLocations: attributeLocations8,
+ pickOffsets,
+ offsetInstanceExtend,
+ boundingSpheres,
+ boundingSpheresCV
+ };
+};
+function transferGeometry(geometry, transferableObjects) {
+ const attributes = geometry.attributes;
+ for (const name in attributes) {
+ if (attributes.hasOwnProperty(name)) {
+ const attribute = attributes[name];
+ if (defined_default(attribute) && defined_default(attribute.values)) {
+ transferableObjects.push(attribute.values.buffer);
+ }
+ }
+ }
+ if (defined_default(geometry.indices)) {
+ transferableObjects.push(geometry.indices.buffer);
+ }
+}
+function transferGeometries(geometries, transferableObjects) {
+ const length3 = geometries.length;
+ for (let i = 0; i < length3; ++i) {
+ transferGeometry(geometries[i], transferableObjects);
+ }
+}
+function countCreateGeometryResults(items) {
+ let count = 1;
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ const geometry = items[i];
+ ++count;
+ if (!defined_default(geometry)) {
+ continue;
+ }
+ const attributes = geometry.attributes;
+ count += 7 + 2 * BoundingSphere_default.packedLength + (defined_default(geometry.indices) ? geometry.indices.length : 0);
+ for (const property in attributes) {
+ if (attributes.hasOwnProperty(property) && defined_default(attributes[property])) {
+ const attribute = attributes[property];
+ count += 5 + attribute.values.length;
+ }
+ }
+ }
+ return count;
+}
+PrimitivePipeline.packCreateGeometryResults = function(items, transferableObjects) {
+ const packedData = new Float64Array(countCreateGeometryResults(items));
+ const stringTable = [];
+ const stringHash = {};
+ const length3 = items.length;
+ let count = 0;
+ packedData[count++] = length3;
+ for (let i = 0; i < length3; i++) {
+ const geometry = items[i];
+ const validGeometry = defined_default(geometry);
+ packedData[count++] = validGeometry ? 1 : 0;
+ if (!validGeometry) {
+ continue;
+ }
+ packedData[count++] = geometry.primitiveType;
+ packedData[count++] = geometry.geometryType;
+ packedData[count++] = defaultValue_default(geometry.offsetAttribute, -1);
+ const validBoundingSphere = defined_default(geometry.boundingSphere) ? 1 : 0;
+ packedData[count++] = validBoundingSphere;
+ if (validBoundingSphere) {
+ BoundingSphere_default.pack(geometry.boundingSphere, packedData, count);
+ }
+ count += BoundingSphere_default.packedLength;
+ const validBoundingSphereCV = defined_default(geometry.boundingSphereCV) ? 1 : 0;
+ packedData[count++] = validBoundingSphereCV;
+ if (validBoundingSphereCV) {
+ BoundingSphere_default.pack(geometry.boundingSphereCV, packedData, count);
+ }
+ count += BoundingSphere_default.packedLength;
+ const attributes = geometry.attributes;
+ const attributesToWrite = [];
+ for (const property in attributes) {
+ if (attributes.hasOwnProperty(property) && defined_default(attributes[property])) {
+ attributesToWrite.push(property);
+ if (!defined_default(stringHash[property])) {
+ stringHash[property] = stringTable.length;
+ stringTable.push(property);
+ }
+ }
+ }
+ packedData[count++] = attributesToWrite.length;
+ for (let q = 0; q < attributesToWrite.length; q++) {
+ const name = attributesToWrite[q];
+ const attribute = attributes[name];
+ packedData[count++] = stringHash[name];
+ packedData[count++] = attribute.componentDatatype;
+ packedData[count++] = attribute.componentsPerAttribute;
+ packedData[count++] = attribute.normalize ? 1 : 0;
+ packedData[count++] = attribute.values.length;
+ packedData.set(attribute.values, count);
+ count += attribute.values.length;
+ }
+ const indicesLength = defined_default(geometry.indices) ? geometry.indices.length : 0;
+ packedData[count++] = indicesLength;
+ if (indicesLength > 0) {
+ packedData.set(geometry.indices, count);
+ count += indicesLength;
+ }
+ }
+ transferableObjects.push(packedData.buffer);
+ return {
+ stringTable,
+ packedData
+ };
+};
+PrimitivePipeline.unpackCreateGeometryResults = function(createGeometryResult) {
+ const stringTable = createGeometryResult.stringTable;
+ const packedGeometry = createGeometryResult.packedData;
+ let i;
+ const result = new Array(packedGeometry[0]);
+ let resultIndex = 0;
+ let packedGeometryIndex = 1;
+ while (packedGeometryIndex < packedGeometry.length) {
+ const valid = packedGeometry[packedGeometryIndex++] === 1;
+ if (!valid) {
+ result[resultIndex++] = void 0;
+ continue;
+ }
+ const primitiveType = packedGeometry[packedGeometryIndex++];
+ const geometryType = packedGeometry[packedGeometryIndex++];
+ let offsetAttribute = packedGeometry[packedGeometryIndex++];
+ if (offsetAttribute === -1) {
+ offsetAttribute = void 0;
+ }
+ let boundingSphere;
+ let boundingSphereCV;
+ const validBoundingSphere = packedGeometry[packedGeometryIndex++] === 1;
+ if (validBoundingSphere) {
+ boundingSphere = BoundingSphere_default.unpack(
+ packedGeometry,
+ packedGeometryIndex
+ );
+ }
+ packedGeometryIndex += BoundingSphere_default.packedLength;
+ const validBoundingSphereCV = packedGeometry[packedGeometryIndex++] === 1;
+ if (validBoundingSphereCV) {
+ boundingSphereCV = BoundingSphere_default.unpack(
+ packedGeometry,
+ packedGeometryIndex
+ );
+ }
+ packedGeometryIndex += BoundingSphere_default.packedLength;
+ let length3;
+ let values;
+ let componentsPerAttribute;
+ const attributes = new GeometryAttributes_default();
+ const numAttributes = packedGeometry[packedGeometryIndex++];
+ for (i = 0; i < numAttributes; i++) {
+ const name = stringTable[packedGeometry[packedGeometryIndex++]];
+ const componentDatatype = packedGeometry[packedGeometryIndex++];
+ componentsPerAttribute = packedGeometry[packedGeometryIndex++];
+ const normalize2 = packedGeometry[packedGeometryIndex++] !== 0;
+ length3 = packedGeometry[packedGeometryIndex++];
+ values = ComponentDatatype_default.createTypedArray(componentDatatype, length3);
+ for (let valuesIndex = 0; valuesIndex < length3; valuesIndex++) {
+ values[valuesIndex] = packedGeometry[packedGeometryIndex++];
+ }
+ attributes[name] = new GeometryAttribute_default({
+ componentDatatype,
+ componentsPerAttribute,
+ normalize: normalize2,
+ values
+ });
+ }
+ let indices2;
+ length3 = packedGeometry[packedGeometryIndex++];
+ if (length3 > 0) {
+ const numberOfVertices = values.length / componentsPerAttribute;
+ indices2 = IndexDatatype_default.createTypedArray(numberOfVertices, length3);
+ for (i = 0; i < length3; i++) {
+ indices2[i] = packedGeometry[packedGeometryIndex++];
+ }
+ }
+ result[resultIndex++] = new Geometry_default({
+ primitiveType,
+ geometryType,
+ boundingSphere,
+ boundingSphereCV,
+ indices: indices2,
+ attributes,
+ offsetAttribute
+ });
+ }
+ return result;
+};
+function packInstancesForCombine(instances, transferableObjects) {
+ const length3 = instances.length;
+ const packedData = new Float64Array(1 + length3 * 19);
+ let count = 0;
+ packedData[count++] = length3;
+ for (let i = 0; i < length3; i++) {
+ const instance = instances[i];
+ Matrix4_default.pack(instance.modelMatrix, packedData, count);
+ count += Matrix4_default.packedLength;
+ if (defined_default(instance.attributes) && defined_default(instance.attributes.offset)) {
+ const values = instance.attributes.offset.value;
+ packedData[count] = values[0];
+ packedData[count + 1] = values[1];
+ packedData[count + 2] = values[2];
+ }
+ count += 3;
+ }
+ transferableObjects.push(packedData.buffer);
+ return packedData;
+}
+function unpackInstancesForCombine(data) {
+ const packedInstances = data;
+ const result = new Array(packedInstances[0]);
+ let count = 0;
+ let i = 1;
+ while (i < packedInstances.length) {
+ const modelMatrix = Matrix4_default.unpack(packedInstances, i);
+ let attributes;
+ i += Matrix4_default.packedLength;
+ if (defined_default(packedInstances[i])) {
+ attributes = {
+ offset: new OffsetGeometryInstanceAttribute_default(
+ packedInstances[i],
+ packedInstances[i + 1],
+ packedInstances[i + 2]
+ )
+ };
+ }
+ i += 3;
+ result[count++] = {
+ modelMatrix,
+ attributes
+ };
+ }
+ return result;
+}
+PrimitivePipeline.packCombineGeometryParameters = function(parameters, transferableObjects) {
+ const createGeometryResults = parameters.createGeometryResults;
+ const length3 = createGeometryResults.length;
+ for (let i = 0; i < length3; i++) {
+ transferableObjects.push(createGeometryResults[i].packedData.buffer);
+ }
+ return {
+ createGeometryResults: parameters.createGeometryResults,
+ packedInstances: packInstancesForCombine(
+ parameters.instances,
+ transferableObjects
+ ),
+ ellipsoid: parameters.ellipsoid,
+ isGeographic: parameters.projection instanceof GeographicProjection_default,
+ elementIndexUintSupported: parameters.elementIndexUintSupported,
+ scene3DOnly: parameters.scene3DOnly,
+ vertexCacheOptimize: parameters.vertexCacheOptimize,
+ compressVertices: parameters.compressVertices,
+ modelMatrix: parameters.modelMatrix,
+ createPickOffsets: parameters.createPickOffsets
+ };
+};
+PrimitivePipeline.unpackCombineGeometryParameters = function(packedParameters) {
+ const instances = unpackInstancesForCombine(packedParameters.packedInstances);
+ const createGeometryResults = packedParameters.createGeometryResults;
+ const length3 = createGeometryResults.length;
+ let instanceIndex = 0;
+ for (let resultIndex = 0; resultIndex < length3; resultIndex++) {
+ const geometries = PrimitivePipeline.unpackCreateGeometryResults(
+ createGeometryResults[resultIndex]
+ );
+ const geometriesLength = geometries.length;
+ for (let geometryIndex = 0; geometryIndex < geometriesLength; geometryIndex++) {
+ const geometry = geometries[geometryIndex];
+ const instance = instances[instanceIndex];
+ instance.geometry = geometry;
+ ++instanceIndex;
+ }
+ }
+ const ellipsoid = Ellipsoid_default.clone(packedParameters.ellipsoid);
+ const projection = packedParameters.isGeographic ? new GeographicProjection_default(ellipsoid) : new WebMercatorProjection_default(ellipsoid);
+ return {
+ instances,
+ ellipsoid,
+ projection,
+ elementIndexUintSupported: packedParameters.elementIndexUintSupported,
+ scene3DOnly: packedParameters.scene3DOnly,
+ vertexCacheOptimize: packedParameters.vertexCacheOptimize,
+ compressVertices: packedParameters.compressVertices,
+ modelMatrix: Matrix4_default.clone(packedParameters.modelMatrix),
+ createPickOffsets: packedParameters.createPickOffsets
+ };
+};
+function packBoundingSpheres(boundingSpheres) {
+ const length3 = boundingSpheres.length;
+ const bufferLength = 1 + (BoundingSphere_default.packedLength + 1) * length3;
+ const buffer = new Float32Array(bufferLength);
+ let bufferIndex = 0;
+ buffer[bufferIndex++] = length3;
+ for (let i = 0; i < length3; ++i) {
+ const bs = boundingSpheres[i];
+ if (!defined_default(bs)) {
+ buffer[bufferIndex++] = 0;
+ } else {
+ buffer[bufferIndex++] = 1;
+ BoundingSphere_default.pack(boundingSpheres[i], buffer, bufferIndex);
+ }
+ bufferIndex += BoundingSphere_default.packedLength;
+ }
+ return buffer;
+}
+function unpackBoundingSpheres(buffer) {
+ const result = new Array(buffer[0]);
+ let count = 0;
+ let i = 1;
+ while (i < buffer.length) {
+ if (buffer[i++] === 1) {
+ result[count] = BoundingSphere_default.unpack(buffer, i);
+ }
+ ++count;
+ i += BoundingSphere_default.packedLength;
+ }
+ return result;
+}
+PrimitivePipeline.packCombineGeometryResults = function(results, transferableObjects) {
+ if (defined_default(results.geometries)) {
+ transferGeometries(results.geometries, transferableObjects);
+ }
+ const packedBoundingSpheres = packBoundingSpheres(results.boundingSpheres);
+ const packedBoundingSpheresCV = packBoundingSpheres(
+ results.boundingSpheresCV
+ );
+ transferableObjects.push(
+ packedBoundingSpheres.buffer,
+ packedBoundingSpheresCV.buffer
+ );
+ return {
+ geometries: results.geometries,
+ attributeLocations: results.attributeLocations,
+ modelMatrix: results.modelMatrix,
+ pickOffsets: results.pickOffsets,
+ offsetInstanceExtend: results.offsetInstanceExtend,
+ boundingSpheres: packedBoundingSpheres,
+ boundingSpheresCV: packedBoundingSpheresCV
+ };
+};
+PrimitivePipeline.unpackCombineGeometryResults = function(packedResult) {
+ return {
+ geometries: packedResult.geometries,
+ attributeLocations: packedResult.attributeLocations,
+ modelMatrix: packedResult.modelMatrix,
+ pickOffsets: packedResult.pickOffsets,
+ offsetInstanceExtend: packedResult.offsetInstanceExtend,
+ boundingSpheres: unpackBoundingSpheres(packedResult.boundingSpheres),
+ boundingSpheresCV: unpackBoundingSpheres(packedResult.boundingSpheresCV)
+ };
+};
+var PrimitivePipeline_default = PrimitivePipeline;
+
+// Source/Scene/PrimitiveState.js
+var PrimitiveState = {
+ READY: 0,
+ CREATING: 1,
+ CREATED: 2,
+ COMBINING: 3,
+ COMBINED: 4,
+ COMPLETE: 5,
+ FAILED: 6
+};
+var PrimitiveState_default = Object.freeze(PrimitiveState);
+
+// Source/Scene/ShadowMode.js
+var ShadowMode = {
+ DISABLED: 0,
+ ENABLED: 1,
+ CAST_ONLY: 2,
+ RECEIVE_ONLY: 3
+};
+ShadowMode.NUMBER_OF_SHADOW_MODES = 4;
+ShadowMode.castShadows = function(shadowMode) {
+ return shadowMode === ShadowMode.ENABLED || shadowMode === ShadowMode.CAST_ONLY;
+};
+ShadowMode.receiveShadows = function(shadowMode) {
+ return shadowMode === ShadowMode.ENABLED || shadowMode === ShadowMode.RECEIVE_ONLY;
+};
+ShadowMode.fromCastReceive = function(castShadows, receiveShadows) {
+ if (castShadows && receiveShadows) {
+ return ShadowMode.ENABLED;
+ } else if (castShadows) {
+ return ShadowMode.CAST_ONLY;
+ } else if (receiveShadows) {
+ return ShadowMode.RECEIVE_ONLY;
+ }
+ return ShadowMode.DISABLED;
+};
+var ShadowMode_default = Object.freeze(ShadowMode);
+
+// Source/Scene/Primitive.js
+function Primitive(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.geometryInstances = options.geometryInstances;
+ this.appearance = options.appearance;
+ this._appearance = void 0;
+ this._material = void 0;
+ this.depthFailAppearance = options.depthFailAppearance;
+ this._depthFailAppearance = void 0;
+ this._depthFailMaterial = void 0;
+ this.modelMatrix = Matrix4_default.clone(
+ defaultValue_default(options.modelMatrix, Matrix4_default.IDENTITY)
+ );
+ this._modelMatrix = new Matrix4_default();
+ this.show = defaultValue_default(options.show, true);
+ this._vertexCacheOptimize = defaultValue_default(options.vertexCacheOptimize, false);
+ this._interleave = defaultValue_default(options.interleave, false);
+ this._releaseGeometryInstances = defaultValue_default(
+ options.releaseGeometryInstances,
+ true
+ );
+ this._allowPicking = defaultValue_default(options.allowPicking, true);
+ this._asynchronous = defaultValue_default(options.asynchronous, true);
+ this._compressVertices = defaultValue_default(options.compressVertices, true);
+ this.cull = defaultValue_default(options.cull, true);
+ this.debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this.rtcCenter = options.rtcCenter;
+ if (defined_default(this.rtcCenter) && (!defined_default(this.geometryInstances) || Array.isArray(this.geometryInstances) && this.geometryInstances.length !== 1)) {
+ throw new DeveloperError_default(
+ "Relative-to-center rendering only supports one geometry instance."
+ );
+ }
+ this.shadows = defaultValue_default(options.shadows, ShadowMode_default.DISABLED);
+ this._translucent = void 0;
+ this._state = PrimitiveState_default.READY;
+ this._geometries = [];
+ this._error = void 0;
+ this._numberOfInstances = 0;
+ this._boundingSpheres = [];
+ this._boundingSphereWC = [];
+ this._boundingSphereCV = [];
+ this._boundingSphere2D = [];
+ this._boundingSphereMorph = [];
+ this._perInstanceAttributeCache = [];
+ this._instanceIds = [];
+ this._lastPerInstanceAttributeIndex = 0;
+ this._va = [];
+ this._attributeLocations = void 0;
+ this._primitiveType = void 0;
+ this._frontFaceRS = void 0;
+ this._backFaceRS = void 0;
+ this._sp = void 0;
+ this._depthFailAppearance = void 0;
+ this._spDepthFail = void 0;
+ this._frontFaceDepthFailRS = void 0;
+ this._backFaceDepthFailRS = void 0;
+ this._pickIds = [];
+ this._colorCommands = [];
+ this._pickCommands = [];
+ this._createBoundingVolumeFunction = options._createBoundingVolumeFunction;
+ this._createRenderStatesFunction = options._createRenderStatesFunction;
+ this._createShaderProgramFunction = options._createShaderProgramFunction;
+ this._createCommandsFunction = options._createCommandsFunction;
+ this._updateAndQueueCommandsFunction = options._updateAndQueueCommandsFunction;
+ this._createPickOffsets = options._createPickOffsets;
+ this._pickOffsets = void 0;
+ this._createGeometryResults = void 0;
+ this._ready = false;
+ const primitive = this;
+ this._readyPromise = new Promise((resolve2, reject) => {
+ primitive._completeLoad = (frameState, state, error) => {
+ this._error = error;
+ this._state = state;
+ frameState.afterRender.push(function() {
+ primitive._ready = primitive._state === PrimitiveState_default.COMPLETE || primitive._state === PrimitiveState_default.FAILED;
+ if (!defined_default(error)) {
+ resolve2(primitive);
+ return true;
+ }
+ reject(error);
+ });
+ };
+ });
+ this._batchTable = void 0;
+ this._batchTableAttributeIndices = void 0;
+ this._offsetInstanceExtend = void 0;
+ this._batchTableOffsetAttribute2DIndex = void 0;
+ this._batchTableOffsetsUpdated = false;
+ this._instanceBoundingSpheres = void 0;
+ this._instanceBoundingSpheresCV = void 0;
+ this._tempBoundingSpheres = void 0;
+ this._recomputeBoundingSpheres = false;
+ this._batchTableBoundingSpheresUpdated = false;
+ this._batchTableBoundingSphereAttributeIndices = void 0;
+}
+Object.defineProperties(Primitive.prototype, {
+ vertexCacheOptimize: {
+ get: function() {
+ return this._vertexCacheOptimize;
+ }
+ },
+ interleave: {
+ get: function() {
+ return this._interleave;
+ }
+ },
+ releaseGeometryInstances: {
+ get: function() {
+ return this._releaseGeometryInstances;
+ }
+ },
+ allowPicking: {
+ get: function() {
+ return this._allowPicking;
+ }
+ },
+ asynchronous: {
+ get: function() {
+ return this._asynchronous;
+ }
+ },
+ compressVertices: {
+ get: function() {
+ return this._compressVertices;
+ }
+ },
+ ready: {
+ get: function() {
+ return this._ready;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ }
+});
+function getCommonPerInstanceAttributeNames(instances) {
+ const length3 = instances.length;
+ const attributesInAllInstances = [];
+ const attributes0 = instances[0].attributes;
+ let name;
+ for (name in attributes0) {
+ if (attributes0.hasOwnProperty(name) && defined_default(attributes0[name])) {
+ const attribute = attributes0[name];
+ let inAllInstances = true;
+ for (let i = 1; i < length3; ++i) {
+ const otherAttribute = instances[i].attributes[name];
+ if (!defined_default(otherAttribute) || attribute.componentDatatype !== otherAttribute.componentDatatype || attribute.componentsPerAttribute !== otherAttribute.componentsPerAttribute || attribute.normalize !== otherAttribute.normalize) {
+ inAllInstances = false;
+ break;
+ }
+ }
+ if (inAllInstances) {
+ attributesInAllInstances.push(name);
+ }
+ }
+ }
+ return attributesInAllInstances;
+}
+var scratchGetAttributeCartesian2 = new Cartesian2_default();
+var scratchGetAttributeCartesian3 = new Cartesian3_default();
+var scratchGetAttributeCartesian42 = new Cartesian4_default();
+function getAttributeValue(value) {
+ const componentsPerAttribute = value.length;
+ if (componentsPerAttribute === 1) {
+ return value[0];
+ } else if (componentsPerAttribute === 2) {
+ return Cartesian2_default.unpack(value, 0, scratchGetAttributeCartesian2);
+ } else if (componentsPerAttribute === 3) {
+ return Cartesian3_default.unpack(value, 0, scratchGetAttributeCartesian3);
+ } else if (componentsPerAttribute === 4) {
+ return Cartesian4_default.unpack(value, 0, scratchGetAttributeCartesian42);
+ }
+}
+function createBatchTable(primitive, context) {
+ const geometryInstances = primitive.geometryInstances;
+ const instances = Array.isArray(geometryInstances) ? geometryInstances : [geometryInstances];
+ const numberOfInstances = instances.length;
+ if (numberOfInstances === 0) {
+ return;
+ }
+ const names = getCommonPerInstanceAttributeNames(instances);
+ const length3 = names.length;
+ const attributes = [];
+ const attributeIndices = {};
+ const boundingSphereAttributeIndices = {};
+ let offset2DIndex;
+ const firstInstance = instances[0];
+ let instanceAttributes = firstInstance.attributes;
+ let i;
+ let name;
+ let attribute;
+ for (i = 0; i < length3; ++i) {
+ name = names[i];
+ attribute = instanceAttributes[name];
+ attributeIndices[name] = i;
+ attributes.push({
+ functionName: `czm_batchTable_${name}`,
+ componentDatatype: attribute.componentDatatype,
+ componentsPerAttribute: attribute.componentsPerAttribute,
+ normalize: attribute.normalize
+ });
+ }
+ if (names.indexOf("distanceDisplayCondition") !== -1) {
+ attributes.push(
+ {
+ functionName: "czm_batchTable_boundingSphereCenter3DHigh",
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ },
+ {
+ functionName: "czm_batchTable_boundingSphereCenter3DLow",
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ },
+ {
+ functionName: "czm_batchTable_boundingSphereCenter2DHigh",
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ },
+ {
+ functionName: "czm_batchTable_boundingSphereCenter2DLow",
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ },
+ {
+ functionName: "czm_batchTable_boundingSphereRadius",
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 1
+ }
+ );
+ boundingSphereAttributeIndices.center3DHigh = attributes.length - 5;
+ boundingSphereAttributeIndices.center3DLow = attributes.length - 4;
+ boundingSphereAttributeIndices.center2DHigh = attributes.length - 3;
+ boundingSphereAttributeIndices.center2DLow = attributes.length - 2;
+ boundingSphereAttributeIndices.radius = attributes.length - 1;
+ }
+ if (names.indexOf("offset") !== -1) {
+ attributes.push({
+ functionName: "czm_batchTable_offset2D",
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ });
+ offset2DIndex = attributes.length - 1;
+ }
+ attributes.push({
+ functionName: "czm_batchTable_pickColor",
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 4,
+ normalize: true
+ });
+ const attributesLength = attributes.length;
+ const batchTable = new BatchTable_default(context, attributes, numberOfInstances);
+ for (i = 0; i < numberOfInstances; ++i) {
+ const instance = instances[i];
+ instanceAttributes = instance.attributes;
+ for (let j = 0; j < length3; ++j) {
+ name = names[j];
+ attribute = instanceAttributes[name];
+ const value = getAttributeValue(attribute.value);
+ const attributeIndex = attributeIndices[name];
+ batchTable.setBatchedAttribute(i, attributeIndex, value);
+ }
+ const pickObject = {
+ primitive: defaultValue_default(instance.pickPrimitive, primitive)
+ };
+ if (defined_default(instance.id)) {
+ pickObject.id = instance.id;
+ }
+ const pickId = context.createPickId(pickObject);
+ primitive._pickIds.push(pickId);
+ const pickColor = pickId.color;
+ const color = scratchGetAttributeCartesian42;
+ color.x = Color_default.floatToByte(pickColor.red);
+ color.y = Color_default.floatToByte(pickColor.green);
+ color.z = Color_default.floatToByte(pickColor.blue);
+ color.w = Color_default.floatToByte(pickColor.alpha);
+ batchTable.setBatchedAttribute(i, attributesLength - 1, color);
+ }
+ primitive._batchTable = batchTable;
+ primitive._batchTableAttributeIndices = attributeIndices;
+ primitive._batchTableBoundingSphereAttributeIndices = boundingSphereAttributeIndices;
+ primitive._batchTableOffsetAttribute2DIndex = offset2DIndex;
+}
+function cloneAttribute(attribute) {
+ let clonedValues;
+ if (Array.isArray(attribute.values)) {
+ clonedValues = attribute.values.slice(0);
+ } else {
+ clonedValues = new attribute.values.constructor(attribute.values);
+ }
+ return new GeometryAttribute_default({
+ componentDatatype: attribute.componentDatatype,
+ componentsPerAttribute: attribute.componentsPerAttribute,
+ normalize: attribute.normalize,
+ values: clonedValues
+ });
+}
+function cloneGeometry(geometry) {
+ const attributes = geometry.attributes;
+ const newAttributes = new GeometryAttributes_default();
+ for (const property in attributes) {
+ if (attributes.hasOwnProperty(property) && defined_default(attributes[property])) {
+ newAttributes[property] = cloneAttribute(attributes[property]);
+ }
+ }
+ let indices2;
+ if (defined_default(geometry.indices)) {
+ const sourceValues = geometry.indices;
+ if (Array.isArray(sourceValues)) {
+ indices2 = sourceValues.slice(0);
+ } else {
+ indices2 = new sourceValues.constructor(sourceValues);
+ }
+ }
+ return new Geometry_default({
+ attributes: newAttributes,
+ indices: indices2,
+ primitiveType: geometry.primitiveType,
+ boundingSphere: BoundingSphere_default.clone(geometry.boundingSphere)
+ });
+}
+function cloneInstance(instance, geometry) {
+ return {
+ geometry,
+ attributes: instance.attributes,
+ modelMatrix: Matrix4_default.clone(instance.modelMatrix),
+ pickPrimitive: instance.pickPrimitive,
+ id: instance.id
+ };
+}
+var positionRegex = /attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;
+Primitive._modifyShaderPosition = function(primitive, vertexShaderSource, scene3DOnly) {
+ let match;
+ let forwardDecl = "";
+ let attributes = "";
+ let computeFunctions = "";
+ while ((match = positionRegex.exec(vertexShaderSource)) !== null) {
+ const name = match[1];
+ const functionName = `vec4 czm_compute${name[0].toUpperCase()}${name.substr(
+ 1
+ )}()`;
+ if (functionName !== "vec4 czm_computePosition()") {
+ forwardDecl += `${functionName};
+`;
+ }
+ if (!defined_default(primitive.rtcCenter)) {
+ if (!scene3DOnly) {
+ attributes += `attribute vec3 ${name}2DHigh;
+attribute vec3 ${name}2DLow;
+`;
+ computeFunctions += `${functionName}
+{
+ vec4 p;
+ if (czm_morphTime == 1.0)
+ {
+ p = czm_translateRelativeToEye(${name}3DHigh, ${name}3DLow);
+ }
+ else if (czm_morphTime == 0.0)
+ {
+ p = czm_translateRelativeToEye(${name}2DHigh.zxy, ${name}2DLow.zxy);
+ }
+ else
+ {
+ p = czm_columbusViewMorph(
+ czm_translateRelativeToEye(${name}2DHigh.zxy, ${name}2DLow.zxy),
+ czm_translateRelativeToEye(${name}3DHigh, ${name}3DLow),
+ czm_morphTime);
+ }
+ return p;
+}
+
+`;
+ } else {
+ computeFunctions += `${functionName}
+{
+ return czm_translateRelativeToEye(${name}3DHigh, ${name}3DLow);
+}
+
+`;
+ }
+ } else {
+ vertexShaderSource = vertexShaderSource.replace(
+ /attribute\s+vec(?:3|4)\s+position3DHigh;/g,
+ ""
+ );
+ vertexShaderSource = vertexShaderSource.replace(
+ /attribute\s+vec(?:3|4)\s+position3DLow;/g,
+ ""
+ );
+ forwardDecl += "uniform mat4 u_modifiedModelView;\n";
+ attributes += "attribute vec4 position;\n";
+ computeFunctions += `${functionName}
+{
+ return u_modifiedModelView * position;
+}
+
+`;
+ vertexShaderSource = vertexShaderSource.replace(
+ /czm_modelViewRelativeToEye\s+\*\s+/g,
+ ""
+ );
+ vertexShaderSource = vertexShaderSource.replace(
+ /czm_modelViewProjectionRelativeToEye/g,
+ "czm_projection"
+ );
+ }
+ }
+ return [forwardDecl, attributes, vertexShaderSource, computeFunctions].join(
+ "\n"
+ );
+};
+Primitive._appendShowToShader = function(primitive, vertexShaderSource) {
+ if (!defined_default(primitive._batchTableAttributeIndices.show)) {
+ return vertexShaderSource;
+ }
+ const renamedVS = ShaderSource_default.replaceMain(
+ vertexShaderSource,
+ "czm_non_show_main"
+ );
+ const showMain = "void main() \n{ \n czm_non_show_main(); \n gl_Position *= czm_batchTable_show(batchId); \n}";
+ return `${renamedVS}
+${showMain}`;
+};
+Primitive._updateColorAttribute = function(primitive, vertexShaderSource, isDepthFail) {
+ if (!defined_default(primitive._batchTableAttributeIndices.color) && !defined_default(primitive._batchTableAttributeIndices.depthFailColor)) {
+ return vertexShaderSource;
+ }
+ if (vertexShaderSource.search(/attribute\s+vec4\s+color;/g) === -1) {
+ return vertexShaderSource;
+ }
+ if (isDepthFail && !defined_default(primitive._batchTableAttributeIndices.depthFailColor)) {
+ throw new DeveloperError_default(
+ "A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute."
+ );
+ }
+ let modifiedVS = vertexShaderSource;
+ modifiedVS = modifiedVS.replace(/attribute\s+vec4\s+color;/g, "");
+ if (!isDepthFail) {
+ modifiedVS = modifiedVS.replace(
+ /(\b)color(\b)/g,
+ "$1czm_batchTable_color(batchId)$2"
+ );
+ } else {
+ modifiedVS = modifiedVS.replace(
+ /(\b)color(\b)/g,
+ "$1czm_batchTable_depthFailColor(batchId)$2"
+ );
+ }
+ return modifiedVS;
+};
+function appendPickToVertexShader(source) {
+ const renamedVS = ShaderSource_default.replaceMain(source, "czm_non_pick_main");
+ const pickMain = "varying vec4 v_pickColor; \nvoid main() \n{ \n czm_non_pick_main(); \n v_pickColor = czm_batchTable_pickColor(batchId); \n}";
+ return `${renamedVS}
+${pickMain}`;
+}
+function appendPickToFragmentShader(source) {
+ return `varying vec4 v_pickColor;
+${source}`;
+}
+Primitive._updatePickColorAttribute = function(source) {
+ let vsPick = source.replace(/attribute\s+vec4\s+pickColor;/g, "");
+ vsPick = vsPick.replace(
+ /(\b)pickColor(\b)/g,
+ "$1czm_batchTable_pickColor(batchId)$2"
+ );
+ return vsPick;
+};
+Primitive._appendOffsetToShader = function(primitive, vertexShaderSource) {
+ if (!defined_default(primitive._batchTableAttributeIndices.offset)) {
+ return vertexShaderSource;
+ }
+ let attr = "attribute float batchId;\n";
+ attr += "attribute float applyOffset;";
+ let modifiedShader = vertexShaderSource.replace(
+ /attribute\s+float\s+batchId;/g,
+ attr
+ );
+ let str = "vec4 $1 = czm_computePosition();\n";
+ str += " if (czm_sceneMode == czm_sceneMode3D)\n";
+ str += " {\n";
+ str += " $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);";
+ str += " }\n";
+ str += " else\n";
+ str += " {\n";
+ str += " $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);";
+ str += " }\n";
+ modifiedShader = modifiedShader.replace(
+ /vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,
+ str
+ );
+ return modifiedShader;
+};
+Primitive._appendDistanceDisplayConditionToShader = function(primitive, vertexShaderSource, scene3DOnly) {
+ if (!defined_default(primitive._batchTableAttributeIndices.distanceDisplayCondition)) {
+ return vertexShaderSource;
+ }
+ const renamedVS = ShaderSource_default.replaceMain(
+ vertexShaderSource,
+ "czm_non_distanceDisplayCondition_main"
+ );
+ let distanceDisplayConditionMain = "void main() \n{ \n czm_non_distanceDisplayCondition_main(); \n vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);\n vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);\n vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);\n float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";
+ if (!scene3DOnly) {
+ distanceDisplayConditionMain += " vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n vec4 centerRTE;\n if (czm_morphTime == 1.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);\n }\n else\n {\n centerRTE = czm_columbusViewMorph(\n czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),\n czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),\n czm_morphTime);\n }\n";
+ } else {
+ distanceDisplayConditionMain += " vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\n";
+ }
+ distanceDisplayConditionMain += " float radiusSq = boundingSphereRadius * boundingSphereRadius; \n float distanceSq; \n if (czm_sceneMode == czm_sceneMode2D) \n { \n distanceSq = czm_eyeHeight2D.y - radiusSq; \n } \n else \n { \n distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq; \n } \n distanceSq = max(distanceSq, 0.0); \n float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x; \n float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y; \n float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; \n gl_Position *= show; \n}";
+ return `${renamedVS}
+${distanceDisplayConditionMain}`;
+};
+function modifyForEncodedNormals(primitive, vertexShaderSource) {
+ if (!primitive.compressVertices) {
+ return vertexShaderSource;
+ }
+ const containsNormal = vertexShaderSource.search(/attribute\s+vec3\s+normal;/g) !== -1;
+ const containsSt = vertexShaderSource.search(/attribute\s+vec2\s+st;/g) !== -1;
+ if (!containsNormal && !containsSt) {
+ return vertexShaderSource;
+ }
+ const containsTangent = vertexShaderSource.search(/attribute\s+vec3\s+tangent;/g) !== -1;
+ const containsBitangent = vertexShaderSource.search(/attribute\s+vec3\s+bitangent;/g) !== -1;
+ let numComponents = containsSt && containsNormal ? 2 : 1;
+ numComponents += containsTangent || containsBitangent ? 1 : 0;
+ const type = numComponents > 1 ? `vec${numComponents}` : "float";
+ const attributeName = "compressedAttributes";
+ const attributeDecl = `attribute ${type} ${attributeName};`;
+ let globalDecl = "";
+ let decode = "";
+ if (containsSt) {
+ globalDecl += "vec2 st;\n";
+ const stComponent = numComponents > 1 ? `${attributeName}.x` : attributeName;
+ decode += ` st = czm_decompressTextureCoordinates(${stComponent});
+`;
+ }
+ if (containsNormal && containsTangent && containsBitangent) {
+ globalDecl += "vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n";
+ decode += ` czm_octDecode(${attributeName}.${containsSt ? "yz" : "xy"}, normal, tangent, bitangent);
+`;
+ } else {
+ if (containsNormal) {
+ globalDecl += "vec3 normal;\n";
+ decode += ` normal = czm_octDecode(${attributeName}${numComponents > 1 ? `.${containsSt ? "y" : "x"}` : ""});
+`;
+ }
+ if (containsTangent) {
+ globalDecl += "vec3 tangent;\n";
+ decode += ` tangent = czm_octDecode(${attributeName}.${containsSt && containsNormal ? "z" : "y"});
+`;
+ }
+ if (containsBitangent) {
+ globalDecl += "vec3 bitangent;\n";
+ decode += ` bitangent = czm_octDecode(${attributeName}.${containsSt && containsNormal ? "z" : "y"});
+`;
+ }
+ }
+ let modifiedVS = vertexShaderSource;
+ modifiedVS = modifiedVS.replace(/attribute\s+vec3\s+normal;/g, "");
+ modifiedVS = modifiedVS.replace(/attribute\s+vec2\s+st;/g, "");
+ modifiedVS = modifiedVS.replace(/attribute\s+vec3\s+tangent;/g, "");
+ modifiedVS = modifiedVS.replace(/attribute\s+vec3\s+bitangent;/g, "");
+ modifiedVS = ShaderSource_default.replaceMain(modifiedVS, "czm_non_compressed_main");
+ const compressedMain = `${"void main() \n{ \n"}${decode} czm_non_compressed_main();
+}`;
+ return [attributeDecl, globalDecl, modifiedVS, compressedMain].join("\n");
+}
+function depthClampVS(vertexShaderSource) {
+ let modifiedVS = ShaderSource_default.replaceMain(
+ vertexShaderSource,
+ "czm_non_depth_clamp_main"
+ );
+ modifiedVS += "void main() {\n czm_non_depth_clamp_main();\n gl_Position = czm_depthClamp(gl_Position);}\n";
+ return modifiedVS;
+}
+function depthClampFS(fragmentShaderSource) {
+ let modifiedFS = ShaderSource_default.replaceMain(
+ fragmentShaderSource,
+ "czm_non_depth_clamp_main"
+ );
+ modifiedFS += "void main() {\n czm_non_depth_clamp_main();\n#if defined(GL_EXT_frag_depth)\n #if defined(LOG_DEPTH)\n czm_writeLogDepth();\n #else\n czm_writeDepthClamp();\n #endif\n#endif\n}\n";
+ modifiedFS = `${"#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n"}${modifiedFS}`;
+ return modifiedFS;
+}
+function validateShaderMatching(shaderProgram, attributeLocations8) {
+ const shaderAttributes = shaderProgram.vertexAttributes;
+ for (const name in shaderAttributes) {
+ if (shaderAttributes.hasOwnProperty(name)) {
+ if (!defined_default(attributeLocations8[name])) {
+ throw new DeveloperError_default(
+ `Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${name}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`
+ );
+ }
+ }
+ }
+}
+function getUniformFunction(uniforms, name) {
+ return function() {
+ return uniforms[name];
+ };
+}
+var numberOfCreationWorkers = Math.max(
+ FeatureDetection_default.hardwareConcurrency - 1,
+ 1
+);
+var createGeometryTaskProcessors;
+var combineGeometryTaskProcessor = new TaskProcessor_default("combineGeometry");
+function loadAsynchronous(primitive, frameState) {
+ let instances;
+ let geometry;
+ let i;
+ let j;
+ const instanceIds = primitive._instanceIds;
+ if (primitive._state === PrimitiveState_default.READY) {
+ instances = Array.isArray(primitive.geometryInstances) ? primitive.geometryInstances : [primitive.geometryInstances];
+ const length3 = primitive._numberOfInstances = instances.length;
+ const promises = [];
+ let subTasks = [];
+ for (i = 0; i < length3; ++i) {
+ geometry = instances[i].geometry;
+ instanceIds.push(instances[i].id);
+ if (!defined_default(geometry._workerName)) {
+ throw new DeveloperError_default(
+ "_workerName must be defined for asynchronous geometry."
+ );
+ }
+ subTasks.push({
+ moduleName: geometry._workerName,
+ geometry
+ });
+ }
+ if (!defined_default(createGeometryTaskProcessors)) {
+ createGeometryTaskProcessors = new Array(numberOfCreationWorkers);
+ for (i = 0; i < numberOfCreationWorkers; i++) {
+ createGeometryTaskProcessors[i] = new TaskProcessor_default("createGeometry");
+ }
+ }
+ let subTask;
+ subTasks = subdivideArray_default(subTasks, numberOfCreationWorkers);
+ for (i = 0; i < subTasks.length; i++) {
+ let packedLength = 0;
+ const workerSubTasks = subTasks[i];
+ const workerSubTasksLength = workerSubTasks.length;
+ for (j = 0; j < workerSubTasksLength; ++j) {
+ subTask = workerSubTasks[j];
+ geometry = subTask.geometry;
+ if (defined_default(geometry.constructor.pack)) {
+ subTask.offset = packedLength;
+ packedLength += defaultValue_default(
+ geometry.constructor.packedLength,
+ geometry.packedLength
+ );
+ }
+ }
+ let subTaskTransferableObjects;
+ if (packedLength > 0) {
+ const array = new Float64Array(packedLength);
+ subTaskTransferableObjects = [array.buffer];
+ for (j = 0; j < workerSubTasksLength; ++j) {
+ subTask = workerSubTasks[j];
+ geometry = subTask.geometry;
+ if (defined_default(geometry.constructor.pack)) {
+ geometry.constructor.pack(geometry, array, subTask.offset);
+ subTask.geometry = array;
+ }
+ }
+ }
+ promises.push(
+ createGeometryTaskProcessors[i].scheduleTask(
+ {
+ subTasks: subTasks[i]
+ },
+ subTaskTransferableObjects
+ )
+ );
+ }
+ primitive._state = PrimitiveState_default.CREATING;
+ Promise.all(promises).then(function(results) {
+ primitive._createGeometryResults = results;
+ primitive._state = PrimitiveState_default.CREATED;
+ }).catch(function(error) {
+ setReady(primitive, frameState, PrimitiveState_default.FAILED, error);
+ });
+ } else if (primitive._state === PrimitiveState_default.CREATED) {
+ const transferableObjects = [];
+ instances = Array.isArray(primitive.geometryInstances) ? primitive.geometryInstances : [primitive.geometryInstances];
+ const scene3DOnly = frameState.scene3DOnly;
+ const projection = frameState.mapProjection;
+ const promise = combineGeometryTaskProcessor.scheduleTask(
+ PrimitivePipeline_default.packCombineGeometryParameters(
+ {
+ createGeometryResults: primitive._createGeometryResults,
+ instances,
+ ellipsoid: projection.ellipsoid,
+ projection,
+ elementIndexUintSupported: frameState.context.elementIndexUint,
+ scene3DOnly,
+ vertexCacheOptimize: primitive.vertexCacheOptimize,
+ compressVertices: primitive.compressVertices,
+ modelMatrix: primitive.modelMatrix,
+ createPickOffsets: primitive._createPickOffsets
+ },
+ transferableObjects
+ ),
+ transferableObjects
+ );
+ primitive._createGeometryResults = void 0;
+ primitive._state = PrimitiveState_default.COMBINING;
+ Promise.resolve(promise).then(function(packedResult) {
+ const result = PrimitivePipeline_default.unpackCombineGeometryResults(
+ packedResult
+ );
+ primitive._geometries = result.geometries;
+ primitive._attributeLocations = result.attributeLocations;
+ primitive.modelMatrix = Matrix4_default.clone(
+ result.modelMatrix,
+ primitive.modelMatrix
+ );
+ primitive._pickOffsets = result.pickOffsets;
+ primitive._offsetInstanceExtend = result.offsetInstanceExtend;
+ primitive._instanceBoundingSpheres = result.boundingSpheres;
+ primitive._instanceBoundingSpheresCV = result.boundingSpheresCV;
+ if (defined_default(primitive._geometries) && primitive._geometries.length > 0) {
+ primitive._recomputeBoundingSpheres = true;
+ primitive._state = PrimitiveState_default.COMBINED;
+ } else {
+ setReady(primitive, frameState, PrimitiveState_default.FAILED, void 0);
+ }
+ }).catch(function(error) {
+ setReady(primitive, frameState, PrimitiveState_default.FAILED, error);
+ });
+ }
+}
+function loadSynchronous(primitive, frameState) {
+ const instances = Array.isArray(primitive.geometryInstances) ? primitive.geometryInstances : [primitive.geometryInstances];
+ const length3 = primitive._numberOfInstances = instances.length;
+ const clonedInstances = new Array(length3);
+ const instanceIds = primitive._instanceIds;
+ let instance;
+ let i;
+ let geometryIndex = 0;
+ for (i = 0; i < length3; i++) {
+ instance = instances[i];
+ const geometry = instance.geometry;
+ let createdGeometry;
+ if (defined_default(geometry.attributes) && defined_default(geometry.primitiveType)) {
+ createdGeometry = cloneGeometry(geometry);
+ } else {
+ createdGeometry = geometry.constructor.createGeometry(geometry);
+ }
+ clonedInstances[geometryIndex++] = cloneInstance(instance, createdGeometry);
+ instanceIds.push(instance.id);
+ }
+ clonedInstances.length = geometryIndex;
+ const scene3DOnly = frameState.scene3DOnly;
+ const projection = frameState.mapProjection;
+ const result = PrimitivePipeline_default.combineGeometry({
+ instances: clonedInstances,
+ ellipsoid: projection.ellipsoid,
+ projection,
+ elementIndexUintSupported: frameState.context.elementIndexUint,
+ scene3DOnly,
+ vertexCacheOptimize: primitive.vertexCacheOptimize,
+ compressVertices: primitive.compressVertices,
+ modelMatrix: primitive.modelMatrix,
+ createPickOffsets: primitive._createPickOffsets
+ });
+ primitive._geometries = result.geometries;
+ primitive._attributeLocations = result.attributeLocations;
+ primitive.modelMatrix = Matrix4_default.clone(
+ result.modelMatrix,
+ primitive.modelMatrix
+ );
+ primitive._pickOffsets = result.pickOffsets;
+ primitive._offsetInstanceExtend = result.offsetInstanceExtend;
+ primitive._instanceBoundingSpheres = result.boundingSpheres;
+ primitive._instanceBoundingSpheresCV = result.boundingSpheresCV;
+ if (defined_default(primitive._geometries) && primitive._geometries.length > 0) {
+ primitive._recomputeBoundingSpheres = true;
+ primitive._state = PrimitiveState_default.COMBINED;
+ } else {
+ setReady(primitive, frameState, PrimitiveState_default.FAILED, void 0);
+ }
+}
+function recomputeBoundingSpheres(primitive, frameState) {
+ const offsetIndex = primitive._batchTableAttributeIndices.offset;
+ if (!primitive._recomputeBoundingSpheres || !defined_default(offsetIndex)) {
+ primitive._recomputeBoundingSpheres = false;
+ return;
+ }
+ let i;
+ const offsetInstanceExtend = primitive._offsetInstanceExtend;
+ const boundingSpheres = primitive._instanceBoundingSpheres;
+ const length3 = boundingSpheres.length;
+ let newBoundingSpheres = primitive._tempBoundingSpheres;
+ if (!defined_default(newBoundingSpheres)) {
+ newBoundingSpheres = new Array(length3);
+ for (i = 0; i < length3; i++) {
+ newBoundingSpheres[i] = new BoundingSphere_default();
+ }
+ primitive._tempBoundingSpheres = newBoundingSpheres;
+ }
+ for (i = 0; i < length3; ++i) {
+ let newBS = newBoundingSpheres[i];
+ const offset2 = primitive._batchTable.getBatchedAttribute(
+ i,
+ offsetIndex,
+ new Cartesian3_default()
+ );
+ newBS = boundingSpheres[i].clone(newBS);
+ transformBoundingSphere(newBS, offset2, offsetInstanceExtend[i]);
+ }
+ const combinedBS = [];
+ const combinedWestBS = [];
+ const combinedEastBS = [];
+ for (i = 0; i < length3; ++i) {
+ const bs = newBoundingSpheres[i];
+ const minX = bs.center.x - bs.radius;
+ if (minX > 0 || BoundingSphere_default.intersectPlane(bs, Plane_default.ORIGIN_ZX_PLANE) !== Intersect_default.INTERSECTING) {
+ combinedBS.push(bs);
+ } else {
+ combinedWestBS.push(bs);
+ combinedEastBS.push(bs);
+ }
+ }
+ let resultBS1 = combinedBS[0];
+ let resultBS2 = combinedEastBS[0];
+ let resultBS3 = combinedWestBS[0];
+ for (i = 1; i < combinedBS.length; i++) {
+ resultBS1 = BoundingSphere_default.union(resultBS1, combinedBS[i]);
+ }
+ for (i = 1; i < combinedEastBS.length; i++) {
+ resultBS2 = BoundingSphere_default.union(resultBS2, combinedEastBS[i]);
+ }
+ for (i = 1; i < combinedWestBS.length; i++) {
+ resultBS3 = BoundingSphere_default.union(resultBS3, combinedWestBS[i]);
+ }
+ const result = [];
+ if (defined_default(resultBS1)) {
+ result.push(resultBS1);
+ }
+ if (defined_default(resultBS2)) {
+ result.push(resultBS2);
+ }
+ if (defined_default(resultBS3)) {
+ result.push(resultBS3);
+ }
+ for (i = 0; i < result.length; i++) {
+ const boundingSphere = result[i].clone(primitive._boundingSpheres[i]);
+ primitive._boundingSpheres[i] = boundingSphere;
+ primitive._boundingSphereCV[i] = BoundingSphere_default.projectTo2D(
+ boundingSphere,
+ frameState.mapProjection,
+ primitive._boundingSphereCV[i]
+ );
+ }
+ Primitive._updateBoundingVolumes(
+ primitive,
+ frameState,
+ primitive.modelMatrix,
+ true
+ );
+ primitive._recomputeBoundingSpheres = false;
+}
+var scratchBoundingSphereCenterEncoded = new EncodedCartesian3_default();
+var scratchBoundingSphereCartographic = new Cartographic_default();
+var scratchBoundingSphereCenter2D = new Cartesian3_default();
+var scratchBoundingSphere3 = new BoundingSphere_default();
+function updateBatchTableBoundingSpheres(primitive, frameState) {
+ const hasDistanceDisplayCondition = defined_default(
+ primitive._batchTableAttributeIndices.distanceDisplayCondition
+ );
+ if (!hasDistanceDisplayCondition || primitive._batchTableBoundingSpheresUpdated) {
+ return;
+ }
+ const indices2 = primitive._batchTableBoundingSphereAttributeIndices;
+ const center3DHighIndex = indices2.center3DHigh;
+ const center3DLowIndex = indices2.center3DLow;
+ const center2DHighIndex = indices2.center2DHigh;
+ const center2DLowIndex = indices2.center2DLow;
+ const radiusIndex = indices2.radius;
+ const projection = frameState.mapProjection;
+ const ellipsoid = projection.ellipsoid;
+ const batchTable = primitive._batchTable;
+ const boundingSpheres = primitive._instanceBoundingSpheres;
+ const length3 = boundingSpheres.length;
+ for (let i = 0; i < length3; ++i) {
+ let boundingSphere = boundingSpheres[i];
+ if (!defined_default(boundingSphere)) {
+ continue;
+ }
+ const modelMatrix = primitive.modelMatrix;
+ if (defined_default(modelMatrix)) {
+ boundingSphere = BoundingSphere_default.transform(
+ boundingSphere,
+ modelMatrix,
+ scratchBoundingSphere3
+ );
+ }
+ const center = boundingSphere.center;
+ const radius = boundingSphere.radius;
+ let encodedCenter = EncodedCartesian3_default.fromCartesian(
+ center,
+ scratchBoundingSphereCenterEncoded
+ );
+ batchTable.setBatchedAttribute(i, center3DHighIndex, encodedCenter.high);
+ batchTable.setBatchedAttribute(i, center3DLowIndex, encodedCenter.low);
+ if (!frameState.scene3DOnly) {
+ const cartographic2 = ellipsoid.cartesianToCartographic(
+ center,
+ scratchBoundingSphereCartographic
+ );
+ const center2D = projection.project(
+ cartographic2,
+ scratchBoundingSphereCenter2D
+ );
+ encodedCenter = EncodedCartesian3_default.fromCartesian(
+ center2D,
+ scratchBoundingSphereCenterEncoded
+ );
+ batchTable.setBatchedAttribute(i, center2DHighIndex, encodedCenter.high);
+ batchTable.setBatchedAttribute(i, center2DLowIndex, encodedCenter.low);
+ }
+ batchTable.setBatchedAttribute(i, radiusIndex, radius);
+ }
+ primitive._batchTableBoundingSpheresUpdated = true;
+}
+var offsetScratchCartesian = new Cartesian3_default();
+var offsetCenterScratch = new Cartesian3_default();
+function updateBatchTableOffsets(primitive, frameState) {
+ const hasOffset = defined_default(primitive._batchTableAttributeIndices.offset);
+ if (!hasOffset || primitive._batchTableOffsetsUpdated || frameState.scene3DOnly) {
+ return;
+ }
+ const index2D = primitive._batchTableOffsetAttribute2DIndex;
+ const projection = frameState.mapProjection;
+ const ellipsoid = projection.ellipsoid;
+ const batchTable = primitive._batchTable;
+ const boundingSpheres = primitive._instanceBoundingSpheres;
+ const length3 = boundingSpheres.length;
+ for (let i = 0; i < length3; ++i) {
+ let boundingSphere = boundingSpheres[i];
+ if (!defined_default(boundingSphere)) {
+ continue;
+ }
+ const offset2 = batchTable.getBatchedAttribute(
+ i,
+ primitive._batchTableAttributeIndices.offset
+ );
+ if (Cartesian3_default.equals(offset2, Cartesian3_default.ZERO)) {
+ batchTable.setBatchedAttribute(i, index2D, Cartesian3_default.ZERO);
+ continue;
+ }
+ const modelMatrix = primitive.modelMatrix;
+ if (defined_default(modelMatrix)) {
+ boundingSphere = BoundingSphere_default.transform(
+ boundingSphere,
+ modelMatrix,
+ scratchBoundingSphere3
+ );
+ }
+ let center = boundingSphere.center;
+ center = ellipsoid.scaleToGeodeticSurface(center, offsetCenterScratch);
+ let cartographic2 = ellipsoid.cartesianToCartographic(
+ center,
+ scratchBoundingSphereCartographic
+ );
+ const center2D = projection.project(
+ cartographic2,
+ scratchBoundingSphereCenter2D
+ );
+ const newPoint = Cartesian3_default.add(offset2, center, offsetScratchCartesian);
+ cartographic2 = ellipsoid.cartesianToCartographic(newPoint, cartographic2);
+ const newPointProjected = projection.project(
+ cartographic2,
+ offsetScratchCartesian
+ );
+ const newVector = Cartesian3_default.subtract(
+ newPointProjected,
+ center2D,
+ offsetScratchCartesian
+ );
+ const x = newVector.x;
+ newVector.x = newVector.z;
+ newVector.z = newVector.y;
+ newVector.y = x;
+ batchTable.setBatchedAttribute(i, index2D, newVector);
+ }
+ primitive._batchTableOffsetsUpdated = true;
+}
+function createVertexArray(primitive, frameState) {
+ const attributeLocations8 = primitive._attributeLocations;
+ const geometries = primitive._geometries;
+ const scene3DOnly = frameState.scene3DOnly;
+ const context = frameState.context;
+ const va = [];
+ const length3 = geometries.length;
+ for (let i = 0; i < length3; ++i) {
+ const geometry = geometries[i];
+ va.push(
+ VertexArray_default.fromGeometry({
+ context,
+ geometry,
+ attributeLocations: attributeLocations8,
+ bufferUsage: BufferUsage_default.STATIC_DRAW,
+ interleave: primitive._interleave
+ })
+ );
+ if (defined_default(primitive._createBoundingVolumeFunction)) {
+ primitive._createBoundingVolumeFunction(frameState, geometry);
+ } else {
+ primitive._boundingSpheres.push(
+ BoundingSphere_default.clone(geometry.boundingSphere)
+ );
+ primitive._boundingSphereWC.push(new BoundingSphere_default());
+ if (!scene3DOnly) {
+ const center = geometry.boundingSphereCV.center;
+ const x = center.x;
+ const y = center.y;
+ const z = center.z;
+ center.x = z;
+ center.y = x;
+ center.z = y;
+ primitive._boundingSphereCV.push(
+ BoundingSphere_default.clone(geometry.boundingSphereCV)
+ );
+ primitive._boundingSphere2D.push(new BoundingSphere_default());
+ primitive._boundingSphereMorph.push(new BoundingSphere_default());
+ }
+ }
+ }
+ primitive._va = va;
+ primitive._primitiveType = geometries[0].primitiveType;
+ if (primitive.releaseGeometryInstances) {
+ primitive.geometryInstances = void 0;
+ }
+ primitive._geometries = void 0;
+ setReady(primitive, frameState, PrimitiveState_default.COMPLETE, void 0);
+}
+function createRenderStates(primitive, context, appearance, twoPasses) {
+ let renderState = appearance.getRenderState();
+ let rs;
+ if (twoPasses) {
+ rs = clone_default(renderState, false);
+ rs.cull = {
+ enabled: true,
+ face: CullFace_default.BACK
+ };
+ primitive._frontFaceRS = RenderState_default.fromCache(rs);
+ rs.cull.face = CullFace_default.FRONT;
+ primitive._backFaceRS = RenderState_default.fromCache(rs);
+ } else {
+ primitive._frontFaceRS = RenderState_default.fromCache(renderState);
+ primitive._backFaceRS = primitive._frontFaceRS;
+ }
+ rs = clone_default(renderState, false);
+ if (defined_default(primitive._depthFailAppearance)) {
+ rs.depthTest.enabled = false;
+ }
+ if (defined_default(primitive._depthFailAppearance)) {
+ renderState = primitive._depthFailAppearance.getRenderState();
+ rs = clone_default(renderState, false);
+ rs.depthTest.func = DepthFunction_default.GREATER;
+ if (twoPasses) {
+ rs.cull = {
+ enabled: true,
+ face: CullFace_default.BACK
+ };
+ primitive._frontFaceDepthFailRS = RenderState_default.fromCache(rs);
+ rs.cull.face = CullFace_default.FRONT;
+ primitive._backFaceDepthFailRS = RenderState_default.fromCache(rs);
+ } else {
+ primitive._frontFaceDepthFailRS = RenderState_default.fromCache(rs);
+ primitive._backFaceDepthFailRS = primitive._frontFaceRS;
+ }
+ }
+}
+function createShaderProgram(primitive, frameState, appearance) {
+ const context = frameState.context;
+ const attributeLocations8 = primitive._attributeLocations;
+ let vs = primitive._batchTable.getVertexShaderCallback()(
+ appearance.vertexShaderSource
+ );
+ vs = Primitive._appendOffsetToShader(primitive, vs);
+ vs = Primitive._appendShowToShader(primitive, vs);
+ vs = Primitive._appendDistanceDisplayConditionToShader(
+ primitive,
+ vs,
+ frameState.scene3DOnly
+ );
+ vs = appendPickToVertexShader(vs);
+ vs = Primitive._updateColorAttribute(primitive, vs, false);
+ vs = modifyForEncodedNormals(primitive, vs);
+ vs = Primitive._modifyShaderPosition(primitive, vs, frameState.scene3DOnly);
+ let fs = appearance.getFragmentShaderSource();
+ fs = appendPickToFragmentShader(fs);
+ primitive._sp = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: primitive._sp,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations8
+ });
+ validateShaderMatching(primitive._sp, attributeLocations8);
+ if (defined_default(primitive._depthFailAppearance)) {
+ vs = primitive._batchTable.getVertexShaderCallback()(
+ primitive._depthFailAppearance.vertexShaderSource
+ );
+ vs = Primitive._appendShowToShader(primitive, vs);
+ vs = Primitive._appendDistanceDisplayConditionToShader(
+ primitive,
+ vs,
+ frameState.scene3DOnly
+ );
+ vs = appendPickToVertexShader(vs);
+ vs = Primitive._updateColorAttribute(primitive, vs, true);
+ vs = modifyForEncodedNormals(primitive, vs);
+ vs = Primitive._modifyShaderPosition(primitive, vs, frameState.scene3DOnly);
+ vs = depthClampVS(vs);
+ fs = primitive._depthFailAppearance.getFragmentShaderSource();
+ fs = appendPickToFragmentShader(fs);
+ fs = depthClampFS(fs);
+ primitive._spDepthFail = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: primitive._spDepthFail,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations8
+ });
+ validateShaderMatching(primitive._spDepthFail, attributeLocations8);
+ }
+}
+var modifiedModelViewScratch = new Matrix4_default();
+var rtcScratch = new Cartesian3_default();
+function getUniforms(primitive, appearance, material, frameState) {
+ const materialUniformMap = defined_default(material) ? material._uniforms : void 0;
+ const appearanceUniformMap = {};
+ const appearanceUniforms = appearance.uniforms;
+ if (defined_default(appearanceUniforms)) {
+ for (const name in appearanceUniforms) {
+ if (appearanceUniforms.hasOwnProperty(name)) {
+ if (defined_default(materialUniformMap) && defined_default(materialUniformMap[name])) {
+ throw new DeveloperError_default(
+ `Appearance and material have a uniform with the same name: ${name}`
+ );
+ }
+ appearanceUniformMap[name] = getUniformFunction(
+ appearanceUniforms,
+ name
+ );
+ }
+ }
+ }
+ let uniforms = combine_default(appearanceUniformMap, materialUniformMap);
+ uniforms = primitive._batchTable.getUniformMapCallback()(uniforms);
+ if (defined_default(primitive.rtcCenter)) {
+ uniforms.u_modifiedModelView = function() {
+ const viewMatrix = frameState.context.uniformState.view;
+ Matrix4_default.multiply(
+ viewMatrix,
+ primitive._modelMatrix,
+ modifiedModelViewScratch
+ );
+ Matrix4_default.multiplyByPoint(
+ modifiedModelViewScratch,
+ primitive.rtcCenter,
+ rtcScratch
+ );
+ Matrix4_default.setTranslation(
+ modifiedModelViewScratch,
+ rtcScratch,
+ modifiedModelViewScratch
+ );
+ return modifiedModelViewScratch;
+ };
+ }
+ return uniforms;
+}
+function createCommands(primitive, appearance, material, translucent, twoPasses, colorCommands, pickCommands, frameState) {
+ const uniforms = getUniforms(primitive, appearance, material, frameState);
+ let depthFailUniforms;
+ if (defined_default(primitive._depthFailAppearance)) {
+ depthFailUniforms = getUniforms(
+ primitive,
+ primitive._depthFailAppearance,
+ primitive._depthFailAppearance.material,
+ frameState
+ );
+ }
+ const pass = translucent ? Pass_default.TRANSLUCENT : Pass_default.OPAQUE;
+ let multiplier = twoPasses ? 2 : 1;
+ multiplier *= defined_default(primitive._depthFailAppearance) ? 2 : 1;
+ colorCommands.length = primitive._va.length * multiplier;
+ const length3 = colorCommands.length;
+ let vaIndex = 0;
+ for (let i = 0; i < length3; ++i) {
+ let colorCommand;
+ if (twoPasses) {
+ colorCommand = colorCommands[i];
+ if (!defined_default(colorCommand)) {
+ colorCommand = colorCommands[i] = new DrawCommand_default({
+ owner: primitive,
+ primitiveType: primitive._primitiveType
+ });
+ }
+ colorCommand.vertexArray = primitive._va[vaIndex];
+ colorCommand.renderState = primitive._backFaceRS;
+ colorCommand.shaderProgram = primitive._sp;
+ colorCommand.uniformMap = uniforms;
+ colorCommand.pass = pass;
+ ++i;
+ }
+ colorCommand = colorCommands[i];
+ if (!defined_default(colorCommand)) {
+ colorCommand = colorCommands[i] = new DrawCommand_default({
+ owner: primitive,
+ primitiveType: primitive._primitiveType
+ });
+ }
+ colorCommand.vertexArray = primitive._va[vaIndex];
+ colorCommand.renderState = primitive._frontFaceRS;
+ colorCommand.shaderProgram = primitive._sp;
+ colorCommand.uniformMap = uniforms;
+ colorCommand.pass = pass;
+ if (defined_default(primitive._depthFailAppearance)) {
+ if (twoPasses) {
+ ++i;
+ colorCommand = colorCommands[i];
+ if (!defined_default(colorCommand)) {
+ colorCommand = colorCommands[i] = new DrawCommand_default({
+ owner: primitive,
+ primitiveType: primitive._primitiveType
+ });
+ }
+ colorCommand.vertexArray = primitive._va[vaIndex];
+ colorCommand.renderState = primitive._backFaceDepthFailRS;
+ colorCommand.shaderProgram = primitive._spDepthFail;
+ colorCommand.uniformMap = depthFailUniforms;
+ colorCommand.pass = pass;
+ }
+ ++i;
+ colorCommand = colorCommands[i];
+ if (!defined_default(colorCommand)) {
+ colorCommand = colorCommands[i] = new DrawCommand_default({
+ owner: primitive,
+ primitiveType: primitive._primitiveType
+ });
+ }
+ colorCommand.vertexArray = primitive._va[vaIndex];
+ colorCommand.renderState = primitive._frontFaceDepthFailRS;
+ colorCommand.shaderProgram = primitive._spDepthFail;
+ colorCommand.uniformMap = depthFailUniforms;
+ colorCommand.pass = pass;
+ }
+ ++vaIndex;
+ }
+}
+Primitive._updateBoundingVolumes = function(primitive, frameState, modelMatrix, forceUpdate) {
+ let i;
+ let length3;
+ let boundingSphere;
+ if (forceUpdate || !Matrix4_default.equals(modelMatrix, primitive._modelMatrix)) {
+ Matrix4_default.clone(modelMatrix, primitive._modelMatrix);
+ length3 = primitive._boundingSpheres.length;
+ for (i = 0; i < length3; ++i) {
+ boundingSphere = primitive._boundingSpheres[i];
+ if (defined_default(boundingSphere)) {
+ primitive._boundingSphereWC[i] = BoundingSphere_default.transform(
+ boundingSphere,
+ modelMatrix,
+ primitive._boundingSphereWC[i]
+ );
+ if (!frameState.scene3DOnly) {
+ primitive._boundingSphere2D[i] = BoundingSphere_default.clone(
+ primitive._boundingSphereCV[i],
+ primitive._boundingSphere2D[i]
+ );
+ primitive._boundingSphere2D[i].center.x = 0;
+ primitive._boundingSphereMorph[i] = BoundingSphere_default.union(
+ primitive._boundingSphereWC[i],
+ primitive._boundingSphereCV[i]
+ );
+ }
+ }
+ }
+ }
+ const pixelSize = primitive.appearance.pixelSize;
+ if (defined_default(pixelSize)) {
+ length3 = primitive._boundingSpheres.length;
+ for (i = 0; i < length3; ++i) {
+ boundingSphere = primitive._boundingSpheres[i];
+ const boundingSphereWC = primitive._boundingSphereWC[i];
+ const pixelSizeInMeters = frameState.camera.getPixelSize(
+ boundingSphere,
+ frameState.context.drawingBufferWidth,
+ frameState.context.drawingBufferHeight
+ );
+ const sizeInMeters = pixelSizeInMeters * pixelSize;
+ boundingSphereWC.radius = boundingSphere.radius + sizeInMeters;
+ }
+ }
+};
+function updateAndQueueCommands(primitive, frameState, colorCommands, pickCommands, modelMatrix, cull, debugShowBoundingVolume2, twoPasses) {
+ if (frameState.mode !== SceneMode_default.SCENE3D && !Matrix4_default.equals(modelMatrix, Matrix4_default.IDENTITY)) {
+ throw new DeveloperError_default(
+ "Primitive.modelMatrix is only supported in 3D mode."
+ );
+ }
+ Primitive._updateBoundingVolumes(primitive, frameState, modelMatrix);
+ let boundingSpheres;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ boundingSpheres = primitive._boundingSphereWC;
+ } else if (frameState.mode === SceneMode_default.COLUMBUS_VIEW) {
+ boundingSpheres = primitive._boundingSphereCV;
+ } else if (frameState.mode === SceneMode_default.SCENE2D && defined_default(primitive._boundingSphere2D)) {
+ boundingSpheres = primitive._boundingSphere2D;
+ } else if (defined_default(primitive._boundingSphereMorph)) {
+ boundingSpheres = primitive._boundingSphereMorph;
+ }
+ const commandList = frameState.commandList;
+ const passes = frameState.passes;
+ if (passes.render || passes.pick) {
+ const allowPicking = primitive.allowPicking;
+ const castShadows = ShadowMode_default.castShadows(primitive.shadows);
+ const receiveShadows = ShadowMode_default.receiveShadows(primitive.shadows);
+ const colorLength = colorCommands.length;
+ let factor2 = twoPasses ? 2 : 1;
+ factor2 *= defined_default(primitive._depthFailAppearance) ? 2 : 1;
+ for (let j = 0; j < colorLength; ++j) {
+ const sphereIndex = Math.floor(j / factor2);
+ const colorCommand = colorCommands[j];
+ colorCommand.modelMatrix = modelMatrix;
+ colorCommand.boundingVolume = boundingSpheres[sphereIndex];
+ colorCommand.cull = cull;
+ colorCommand.debugShowBoundingVolume = debugShowBoundingVolume2;
+ colorCommand.castShadows = castShadows;
+ colorCommand.receiveShadows = receiveShadows;
+ if (allowPicking) {
+ colorCommand.pickId = "v_pickColor";
+ } else {
+ colorCommand.pickId = void 0;
+ }
+ commandList.push(colorCommand);
+ }
+ }
+}
+Primitive.prototype.update = function(frameState) {
+ if (!defined_default(this.geometryInstances) && this._va.length === 0 || defined_default(this.geometryInstances) && Array.isArray(this.geometryInstances) && this.geometryInstances.length === 0 || !defined_default(this.appearance) || frameState.mode !== SceneMode_default.SCENE3D && frameState.scene3DOnly || !frameState.passes.render && !frameState.passes.pick) {
+ return;
+ }
+ if (defined_default(this._error)) {
+ throw this._error;
+ }
+ if (defined_default(this.rtcCenter) && !frameState.scene3DOnly) {
+ throw new DeveloperError_default(
+ "RTC rendering is only available for 3D only scenes."
+ );
+ }
+ if (this._state === PrimitiveState_default.FAILED) {
+ return;
+ }
+ const context = frameState.context;
+ if (!defined_default(this._batchTable)) {
+ createBatchTable(this, context);
+ }
+ if (this._batchTable.attributes.length > 0) {
+ if (ContextLimits_default.maximumVertexTextureImageUnits === 0) {
+ throw new RuntimeError_default(
+ "Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero."
+ );
+ }
+ this._batchTable.update(frameState);
+ }
+ if (this._state !== PrimitiveState_default.COMPLETE && this._state !== PrimitiveState_default.COMBINED) {
+ if (this.asynchronous) {
+ loadAsynchronous(this, frameState);
+ } else {
+ loadSynchronous(this, frameState);
+ }
+ }
+ if (this._state === PrimitiveState_default.COMBINED) {
+ updateBatchTableBoundingSpheres(this, frameState);
+ updateBatchTableOffsets(this, frameState);
+ createVertexArray(this, frameState);
+ }
+ if (!this.show || this._state !== PrimitiveState_default.COMPLETE) {
+ return;
+ }
+ if (!this._batchTableOffsetsUpdated) {
+ updateBatchTableOffsets(this, frameState);
+ }
+ if (this._recomputeBoundingSpheres) {
+ recomputeBoundingSpheres(this, frameState);
+ }
+ const appearance = this.appearance;
+ const material = appearance.material;
+ let createRS = false;
+ let createSP = false;
+ if (this._appearance !== appearance) {
+ this._appearance = appearance;
+ this._material = material;
+ createRS = true;
+ createSP = true;
+ } else if (this._material !== material) {
+ this._material = material;
+ createSP = true;
+ }
+ const depthFailAppearance = this.depthFailAppearance;
+ const depthFailMaterial = defined_default(depthFailAppearance) ? depthFailAppearance.material : void 0;
+ if (this._depthFailAppearance !== depthFailAppearance) {
+ this._depthFailAppearance = depthFailAppearance;
+ this._depthFailMaterial = depthFailMaterial;
+ createRS = true;
+ createSP = true;
+ } else if (this._depthFailMaterial !== depthFailMaterial) {
+ this._depthFailMaterial = depthFailMaterial;
+ createSP = true;
+ }
+ const translucent = this._appearance.isTranslucent();
+ if (this._translucent !== translucent) {
+ this._translucent = translucent;
+ createRS = true;
+ }
+ if (defined_default(this._material)) {
+ this._material.update(context);
+ }
+ const twoPasses = appearance.closed && translucent;
+ if (createRS) {
+ const rsFunc = defaultValue_default(
+ this._createRenderStatesFunction,
+ createRenderStates
+ );
+ rsFunc(this, context, appearance, twoPasses);
+ }
+ if (createSP) {
+ const spFunc = defaultValue_default(
+ this._createShaderProgramFunction,
+ createShaderProgram
+ );
+ spFunc(this, frameState, appearance);
+ }
+ if (createRS || createSP) {
+ const commandFunc = defaultValue_default(
+ this._createCommandsFunction,
+ createCommands
+ );
+ commandFunc(
+ this,
+ appearance,
+ material,
+ translucent,
+ twoPasses,
+ this._colorCommands,
+ this._pickCommands,
+ frameState
+ );
+ }
+ const updateAndQueueCommandsFunc = defaultValue_default(
+ this._updateAndQueueCommandsFunction,
+ updateAndQueueCommands
+ );
+ updateAndQueueCommandsFunc(
+ this,
+ frameState,
+ this._colorCommands,
+ this._pickCommands,
+ this.modelMatrix,
+ this.cull,
+ this.debugShowBoundingVolume,
+ twoPasses
+ );
+};
+var offsetBoundingSphereScratch1 = new BoundingSphere_default();
+var offsetBoundingSphereScratch2 = new BoundingSphere_default();
+function transformBoundingSphere(boundingSphere, offset2, offsetAttribute) {
+ if (offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ const origBS = BoundingSphere_default.clone(
+ boundingSphere,
+ offsetBoundingSphereScratch1
+ );
+ const offsetBS = BoundingSphere_default.clone(
+ boundingSphere,
+ offsetBoundingSphereScratch2
+ );
+ offsetBS.center = Cartesian3_default.add(offsetBS.center, offset2, offsetBS.center);
+ boundingSphere = BoundingSphere_default.union(origBS, offsetBS, boundingSphere);
+ } else if (offsetAttribute === GeometryOffsetAttribute_default.ALL) {
+ boundingSphere.center = Cartesian3_default.add(
+ boundingSphere.center,
+ offset2,
+ boundingSphere.center
+ );
+ }
+ return boundingSphere;
+}
+function createGetFunction(batchTable, instanceIndex, attributeIndex) {
+ return function() {
+ const attributeValue = batchTable.getBatchedAttribute(
+ instanceIndex,
+ attributeIndex
+ );
+ const attribute = batchTable.attributes[attributeIndex];
+ const componentsPerAttribute = attribute.componentsPerAttribute;
+ const value = ComponentDatatype_default.createTypedArray(
+ attribute.componentDatatype,
+ componentsPerAttribute
+ );
+ if (defined_default(attributeValue.constructor.pack)) {
+ attributeValue.constructor.pack(attributeValue, value, 0);
+ } else {
+ value[0] = attributeValue;
+ }
+ return value;
+ };
+}
+function createSetFunction(batchTable, instanceIndex, attributeIndex, primitive, name) {
+ return function(value) {
+ if (!defined_default(value) || !defined_default(value.length) || value.length < 1 || value.length > 4) {
+ throw new DeveloperError_default(
+ "value must be and array with length between 1 and 4."
+ );
+ }
+ const attributeValue = getAttributeValue(value);
+ batchTable.setBatchedAttribute(
+ instanceIndex,
+ attributeIndex,
+ attributeValue
+ );
+ if (name === "offset") {
+ primitive._recomputeBoundingSpheres = true;
+ primitive._batchTableOffsetsUpdated = false;
+ }
+ };
+}
+var offsetScratch2 = new Cartesian3_default();
+function createBoundingSphereProperties(primitive, properties, index) {
+ properties.boundingSphere = {
+ get: function() {
+ let boundingSphere = primitive._instanceBoundingSpheres[index];
+ if (defined_default(boundingSphere)) {
+ boundingSphere = boundingSphere.clone();
+ const modelMatrix = primitive.modelMatrix;
+ const offset2 = properties.offset;
+ if (defined_default(offset2)) {
+ transformBoundingSphere(
+ boundingSphere,
+ Cartesian3_default.fromArray(offset2.get(), 0, offsetScratch2),
+ primitive._offsetInstanceExtend[index]
+ );
+ }
+ if (defined_default(modelMatrix)) {
+ boundingSphere = BoundingSphere_default.transform(
+ boundingSphere,
+ modelMatrix
+ );
+ }
+ }
+ return boundingSphere;
+ }
+ };
+ properties.boundingSphereCV = {
+ get: function() {
+ return primitive._instanceBoundingSpheresCV[index];
+ }
+ };
+}
+function createPickIdProperty(primitive, properties, index) {
+ properties.pickId = {
+ get: function() {
+ return primitive._pickIds[index];
+ }
+ };
+}
+Primitive.prototype.getGeometryInstanceAttributes = function(id) {
+ if (!defined_default(id)) {
+ throw new DeveloperError_default("id is required");
+ }
+ if (!defined_default(this._batchTable)) {
+ throw new DeveloperError_default(
+ "must call update before calling getGeometryInstanceAttributes"
+ );
+ }
+ let index = -1;
+ const lastIndex = this._lastPerInstanceAttributeIndex;
+ const ids = this._instanceIds;
+ const length3 = ids.length;
+ for (let i = 0; i < length3; ++i) {
+ const curIndex = (lastIndex + i) % length3;
+ if (id === ids[curIndex]) {
+ index = curIndex;
+ break;
+ }
+ }
+ if (index === -1) {
+ return void 0;
+ }
+ let attributes = this._perInstanceAttributeCache[index];
+ if (defined_default(attributes)) {
+ return attributes;
+ }
+ const batchTable = this._batchTable;
+ const perInstanceAttributeIndices = this._batchTableAttributeIndices;
+ attributes = {};
+ const properties = {};
+ for (const name in perInstanceAttributeIndices) {
+ if (perInstanceAttributeIndices.hasOwnProperty(name)) {
+ const attributeIndex = perInstanceAttributeIndices[name];
+ properties[name] = {
+ get: createGetFunction(batchTable, index, attributeIndex),
+ set: createSetFunction(batchTable, index, attributeIndex, this, name)
+ };
+ }
+ }
+ createBoundingSphereProperties(this, properties, index);
+ createPickIdProperty(this, properties, index);
+ Object.defineProperties(attributes, properties);
+ this._lastPerInstanceAttributeIndex = index;
+ this._perInstanceAttributeCache[index] = attributes;
+ return attributes;
+};
+Primitive.prototype.isDestroyed = function() {
+ return false;
+};
+Primitive.prototype.destroy = function() {
+ let length3;
+ let i;
+ this._sp = this._sp && this._sp.destroy();
+ this._spDepthFail = this._spDepthFail && this._spDepthFail.destroy();
+ const va = this._va;
+ length3 = va.length;
+ for (i = 0; i < length3; ++i) {
+ va[i].destroy();
+ }
+ this._va = void 0;
+ const pickIds = this._pickIds;
+ length3 = pickIds.length;
+ for (i = 0; i < length3; ++i) {
+ pickIds[i].destroy();
+ }
+ this._pickIds = void 0;
+ this._batchTable = this._batchTable && this._batchTable.destroy();
+ this._instanceIds = void 0;
+ this._perInstanceAttributeCache = void 0;
+ this._attributeLocations = void 0;
+ return destroyObject_default(this);
+};
+function setReady(primitive, frameState, state, error) {
+ primitive._completeLoad(frameState, state, error);
+}
+var Primitive_default = Primitive;
+
+// Source/Core/GeometryInstanceAttribute.js
+function GeometryInstanceAttribute(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ if (!defined_default(options.componentDatatype)) {
+ throw new DeveloperError_default("options.componentDatatype is required.");
+ }
+ if (!defined_default(options.componentsPerAttribute)) {
+ throw new DeveloperError_default("options.componentsPerAttribute is required.");
+ }
+ if (options.componentsPerAttribute < 1 || options.componentsPerAttribute > 4) {
+ throw new DeveloperError_default(
+ "options.componentsPerAttribute must be between 1 and 4."
+ );
+ }
+ if (!defined_default(options.value)) {
+ throw new DeveloperError_default("options.value is required.");
+ }
+ this.componentDatatype = options.componentDatatype;
+ this.componentsPerAttribute = options.componentsPerAttribute;
+ this.normalize = defaultValue_default(options.normalize, false);
+ this.value = options.value;
+}
+var GeometryInstanceAttribute_default = GeometryInstanceAttribute;
+
+// Source/Shaders/ShadowVolumeAppearanceFS.js
+var ShadowVolumeAppearanceFS_default = "#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n\n#ifdef TEXTURE_COORDINATES\n#ifdef SPHERICAL\nvarying vec4 v_sphericalExtents;\n#else // SPHERICAL\nvarying vec2 v_inversePlaneExtents;\nvarying vec4 v_westPlane;\nvarying vec4 v_southPlane;\n#endif // SPHERICAL\nvarying vec3 v_uvMinAndSphericalLongitudeRotation;\nvarying vec3 v_uMaxAndInverseDistance;\nvarying vec3 v_vMaxAndInverseDistance;\n#endif // TEXTURE_COORDINATES\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\n\n#ifdef NORMAL_EC\nvec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);\n return eyeCoordinate.xyz / eyeCoordinate.w;\n}\n\nvec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {\n vec2 glFragCoordXY = gl_FragCoord.xy;\n // Sample depths at both offset and negative offset\n float upOrRightLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));\n float downOrLeftLogDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));\n // Explicitly evaluate both paths\n // Necessary for multifrustum and for edges of the screen\n bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);\n float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);\n float useDownOrLeft = float(useUpOrRight == 0.0);\n vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);\n vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);\n return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;\n}\n#endif // NORMAL_EC\n\nvoid main(void)\n{\n#ifdef REQUIRES_EC\n float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n#endif\n\n#ifdef REQUIRES_WC\n vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;\n vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;\n#endif\n\n#ifdef TEXTURE_COORDINATES\n vec2 uv;\n#ifdef SPHERICAL\n // Treat world coords as a sphere normal for spherical coordinates\n vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);\n sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;\n sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);\n uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;\n uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;\n#else // SPHERICAL\n // Unpack planes and transform to eye space\n uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;\n uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;\n#endif // SPHERICAL\n#endif // TEXTURE_COORDINATES\n\n#ifdef PICK\n#ifdef CULL_FRAGMENTS\n // When classifying translucent geometry, logDepthOrDepth == 0.0\n // indicates a region that should not be classified, possibly due to there\n // being opaque pixels there in another buffer.\n // Check for logDepthOrDepth != 0.0 to make sure this should be classified.\n if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {\n gl_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource\n czm_writeDepthClamp();\n }\n#else // CULL_FRAGMENTS\n gl_FragColor.a = 1.0;\n#endif // CULL_FRAGMENTS\n#else // PICK\n\n#ifdef CULL_FRAGMENTS\n // When classifying translucent geometry, logDepthOrDepth == 0.0\n // indicates a region that should not be classified, possibly due to there\n // being opaque pixels there in another buffer.\n if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {\n discard;\n }\n#endif\n\n#ifdef NORMAL_EC\n // Compute normal by sampling adjacent pixels in 2x2 block in screen space\n vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));\n vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));\n vec3 normalEC = normalize(cross(leftRight, downUp));\n#endif\n\n\n#ifdef PER_INSTANCE_COLOR\n\n vec4 color = czm_gammaCorrect(v_color);\n#ifdef FLAT\n gl_FragColor = color;\n#else // FLAT\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = -eyeCoordinate.xyz;\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = color.rgb;\n material.alpha = color.a;\n\n gl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\n\n // Premultiply alpha. Required for classification primitives on translucent globe.\n gl_FragColor.rgb *= gl_FragColor.a;\n\n#else // PER_INSTANCE_COLOR\n\n // Material support.\n // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or\n // dependencies for culling but might not actually be used by the material.\n\n czm_materialInput materialInput;\n\n#ifdef USES_NORMAL_EC\n materialInput.normalEC = normalEC;\n#endif\n\n#ifdef USES_POSITION_TO_EYE_EC\n materialInput.positionToEyeEC = -eyeCoordinate.xyz;\n#endif\n\n#ifdef USES_TANGENT_TO_EYE\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);\n#endif\n\n#ifdef USES_ST\n // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired\n // texture coordinate system, which typically forms a tight oriented bounding box around the geometry.\n // Shader is provided a set of reference points for remapping.\n materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;\n materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;\n#endif\n\n czm_material material = czm_getMaterial(materialInput);\n\n#ifdef FLAT\n gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else // FLAT\n gl_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);\n#endif // FLAT\n\n // Premultiply alpha. Required for classification primitives on translucent globe.\n gl_FragColor.rgb *= gl_FragColor.a;\n\n#endif // PER_INSTANCE_COLOR\n czm_writeDepthClamp();\n#endif // PICK\n}\n";
+
+// Source/Scene/ShadowVolumeAppearance.js
+function ShadowVolumeAppearance(extentsCulling, planarExtents, appearance) {
+ Check_default.typeOf.bool("extentsCulling", extentsCulling);
+ Check_default.typeOf.bool("planarExtents", planarExtents);
+ Check_default.typeOf.object("appearance", appearance);
+ this._projectionExtentDefines = {
+ eastMostYhighDefine: "",
+ eastMostYlowDefine: "",
+ westMostYhighDefine: "",
+ westMostYlowDefine: ""
+ };
+ const colorShaderDependencies = new ShaderDependencies();
+ colorShaderDependencies.requiresTextureCoordinates = extentsCulling;
+ colorShaderDependencies.requiresEC = !appearance.flat;
+ const pickShaderDependencies = new ShaderDependencies();
+ pickShaderDependencies.requiresTextureCoordinates = extentsCulling;
+ if (appearance instanceof PerInstanceColorAppearance_default) {
+ colorShaderDependencies.requiresNormalEC = !appearance.flat;
+ } else {
+ const materialShaderSource = `${appearance.material.shaderSource}
+${appearance.fragmentShaderSource}`;
+ colorShaderDependencies.normalEC = materialShaderSource.indexOf("materialInput.normalEC") !== -1 || materialShaderSource.indexOf("czm_getDefaultMaterial") !== -1;
+ colorShaderDependencies.positionToEyeEC = materialShaderSource.indexOf("materialInput.positionToEyeEC") !== -1;
+ colorShaderDependencies.tangentToEyeMatrix = materialShaderSource.indexOf("materialInput.tangentToEyeMatrix") !== -1;
+ colorShaderDependencies.st = materialShaderSource.indexOf("materialInput.st") !== -1;
+ }
+ this._colorShaderDependencies = colorShaderDependencies;
+ this._pickShaderDependencies = pickShaderDependencies;
+ this._appearance = appearance;
+ this._extentsCulling = extentsCulling;
+ this._planarExtents = planarExtents;
+}
+ShadowVolumeAppearance.prototype.createFragmentShader = function(columbusView2D) {
+ Check_default.typeOf.bool("columbusView2D", columbusView2D);
+ const appearance = this._appearance;
+ const dependencies = this._colorShaderDependencies;
+ const defines = [];
+ if (!columbusView2D && !this._planarExtents) {
+ defines.push("SPHERICAL");
+ }
+ if (dependencies.requiresEC) {
+ defines.push("REQUIRES_EC");
+ }
+ if (dependencies.requiresWC) {
+ defines.push("REQUIRES_WC");
+ }
+ if (dependencies.requiresTextureCoordinates) {
+ defines.push("TEXTURE_COORDINATES");
+ }
+ if (this._extentsCulling) {
+ defines.push("CULL_FRAGMENTS");
+ }
+ if (dependencies.requiresNormalEC) {
+ defines.push("NORMAL_EC");
+ }
+ if (appearance instanceof PerInstanceColorAppearance_default) {
+ defines.push("PER_INSTANCE_COLOR");
+ }
+ if (dependencies.normalEC) {
+ defines.push("USES_NORMAL_EC");
+ }
+ if (dependencies.positionToEyeEC) {
+ defines.push("USES_POSITION_TO_EYE_EC");
+ }
+ if (dependencies.tangentToEyeMatrix) {
+ defines.push("USES_TANGENT_TO_EYE");
+ }
+ if (dependencies.st) {
+ defines.push("USES_ST");
+ }
+ if (appearance.flat) {
+ defines.push("FLAT");
+ }
+ let materialSource = "";
+ if (!(appearance instanceof PerInstanceColorAppearance_default)) {
+ materialSource = appearance.material.shaderSource;
+ }
+ return new ShaderSource_default({
+ defines,
+ sources: [materialSource, ShadowVolumeAppearanceFS_default]
+ });
+};
+ShadowVolumeAppearance.prototype.createPickFragmentShader = function(columbusView2D) {
+ Check_default.typeOf.bool("columbusView2D", columbusView2D);
+ const dependencies = this._pickShaderDependencies;
+ const defines = ["PICK"];
+ if (!columbusView2D && !this._planarExtents) {
+ defines.push("SPHERICAL");
+ }
+ if (dependencies.requiresEC) {
+ defines.push("REQUIRES_EC");
+ }
+ if (dependencies.requiresWC) {
+ defines.push("REQUIRES_WC");
+ }
+ if (dependencies.requiresTextureCoordinates) {
+ defines.push("TEXTURE_COORDINATES");
+ }
+ if (this._extentsCulling) {
+ defines.push("CULL_FRAGMENTS");
+ }
+ return new ShaderSource_default({
+ defines,
+ sources: [ShadowVolumeAppearanceFS_default],
+ pickColorQualifier: "varying"
+ });
+};
+ShadowVolumeAppearance.prototype.createVertexShader = function(defines, vertexShaderSource, columbusView2D, mapProjection) {
+ Check_default.defined("defines", defines);
+ Check_default.typeOf.string("vertexShaderSource", vertexShaderSource);
+ Check_default.typeOf.bool("columbusView2D", columbusView2D);
+ Check_default.defined("mapProjection", mapProjection);
+ return createShadowVolumeAppearanceVS(
+ this._colorShaderDependencies,
+ this._planarExtents,
+ columbusView2D,
+ defines,
+ vertexShaderSource,
+ this._appearance,
+ mapProjection,
+ this._projectionExtentDefines
+ );
+};
+ShadowVolumeAppearance.prototype.createPickVertexShader = function(defines, vertexShaderSource, columbusView2D, mapProjection) {
+ Check_default.defined("defines", defines);
+ Check_default.typeOf.string("vertexShaderSource", vertexShaderSource);
+ Check_default.typeOf.bool("columbusView2D", columbusView2D);
+ Check_default.defined("mapProjection", mapProjection);
+ return createShadowVolumeAppearanceVS(
+ this._pickShaderDependencies,
+ this._planarExtents,
+ columbusView2D,
+ defines,
+ vertexShaderSource,
+ void 0,
+ mapProjection,
+ this._projectionExtentDefines
+ );
+};
+var longitudeExtentsCartesianScratch = new Cartesian3_default();
+var longitudeExtentsCartographicScratch = new Cartographic_default();
+var longitudeExtentsEncodeScratch = {
+ high: 0,
+ low: 0
+};
+function createShadowVolumeAppearanceVS(shaderDependencies, planarExtents, columbusView2D, defines, vertexShaderSource, appearance, mapProjection, projectionExtentDefines) {
+ const allDefines = defines.slice();
+ if (projectionExtentDefines.eastMostYhighDefine === "") {
+ const eastMostCartographic = longitudeExtentsCartographicScratch;
+ eastMostCartographic.longitude = Math_default.PI;
+ eastMostCartographic.latitude = 0;
+ eastMostCartographic.height = 0;
+ const eastMostCartesian = mapProjection.project(
+ eastMostCartographic,
+ longitudeExtentsCartesianScratch
+ );
+ let encoded = EncodedCartesian3_default.encode(
+ eastMostCartesian.x,
+ longitudeExtentsEncodeScratch
+ );
+ projectionExtentDefines.eastMostYhighDefine = `EAST_MOST_X_HIGH ${encoded.high.toFixed(
+ `${encoded.high}`.length + 1
+ )}`;
+ projectionExtentDefines.eastMostYlowDefine = `EAST_MOST_X_LOW ${encoded.low.toFixed(
+ `${encoded.low}`.length + 1
+ )}`;
+ const westMostCartographic = longitudeExtentsCartographicScratch;
+ westMostCartographic.longitude = -Math_default.PI;
+ westMostCartographic.latitude = 0;
+ westMostCartographic.height = 0;
+ const westMostCartesian = mapProjection.project(
+ westMostCartographic,
+ longitudeExtentsCartesianScratch
+ );
+ encoded = EncodedCartesian3_default.encode(
+ westMostCartesian.x,
+ longitudeExtentsEncodeScratch
+ );
+ projectionExtentDefines.westMostYhighDefine = `WEST_MOST_X_HIGH ${encoded.high.toFixed(
+ `${encoded.high}`.length + 1
+ )}`;
+ projectionExtentDefines.westMostYlowDefine = `WEST_MOST_X_LOW ${encoded.low.toFixed(
+ `${encoded.low}`.length + 1
+ )}`;
+ }
+ if (columbusView2D) {
+ allDefines.push(projectionExtentDefines.eastMostYhighDefine);
+ allDefines.push(projectionExtentDefines.eastMostYlowDefine);
+ allDefines.push(projectionExtentDefines.westMostYhighDefine);
+ allDefines.push(projectionExtentDefines.westMostYlowDefine);
+ }
+ if (defined_default(appearance) && appearance instanceof PerInstanceColorAppearance_default) {
+ allDefines.push("PER_INSTANCE_COLOR");
+ }
+ if (shaderDependencies.requiresTextureCoordinates) {
+ allDefines.push("TEXTURE_COORDINATES");
+ if (!(planarExtents || columbusView2D)) {
+ allDefines.push("SPHERICAL");
+ }
+ if (columbusView2D) {
+ allDefines.push("COLUMBUS_VIEW_2D");
+ }
+ }
+ return new ShaderSource_default({
+ defines: allDefines,
+ sources: [vertexShaderSource]
+ });
+}
+function ShaderDependencies() {
+ this._requiresEC = false;
+ this._requiresWC = false;
+ this._requiresNormalEC = false;
+ this._requiresTextureCoordinates = false;
+ this._usesNormalEC = false;
+ this._usesPositionToEyeEC = false;
+ this._usesTangentToEyeMat = false;
+ this._usesSt = false;
+}
+Object.defineProperties(ShaderDependencies.prototype, {
+ requiresEC: {
+ get: function() {
+ return this._requiresEC;
+ },
+ set: function(value) {
+ this._requiresEC = value || this._requiresEC;
+ }
+ },
+ requiresWC: {
+ get: function() {
+ return this._requiresWC;
+ },
+ set: function(value) {
+ this._requiresWC = value || this._requiresWC;
+ this.requiresEC = this._requiresWC;
+ }
+ },
+ requiresNormalEC: {
+ get: function() {
+ return this._requiresNormalEC;
+ },
+ set: function(value) {
+ this._requiresNormalEC = value || this._requiresNormalEC;
+ this.requiresEC = this._requiresNormalEC;
+ }
+ },
+ requiresTextureCoordinates: {
+ get: function() {
+ return this._requiresTextureCoordinates;
+ },
+ set: function(value) {
+ this._requiresTextureCoordinates = value || this._requiresTextureCoordinates;
+ this.requiresWC = this._requiresTextureCoordinates;
+ }
+ },
+ normalEC: {
+ set: function(value) {
+ this.requiresNormalEC = value;
+ this._usesNormalEC = value;
+ },
+ get: function() {
+ return this._usesNormalEC;
+ }
+ },
+ tangentToEyeMatrix: {
+ set: function(value) {
+ this.requiresWC = value;
+ this.requiresNormalEC = value;
+ this._usesTangentToEyeMat = value;
+ },
+ get: function() {
+ return this._usesTangentToEyeMat;
+ }
+ },
+ positionToEyeEC: {
+ set: function(value) {
+ this.requiresEC = value;
+ this._usesPositionToEyeEC = value;
+ },
+ get: function() {
+ return this._usesPositionToEyeEC;
+ }
+ },
+ st: {
+ set: function(value) {
+ this.requiresTextureCoordinates = value;
+ this._usesSt = value;
+ },
+ get: function() {
+ return this._usesSt;
+ }
+ }
+});
+function pointLineDistance(point1, point2, point) {
+ return Math.abs(
+ (point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x
+ ) / Cartesian2_default.distance(point2, point1);
+}
+var points2DScratch2 = [
+ new Cartesian2_default(),
+ new Cartesian2_default(),
+ new Cartesian2_default(),
+ new Cartesian2_default()
+];
+function addTextureCoordinateRotationAttributes(attributes, textureCoordinateRotationPoints4) {
+ const points2D = points2DScratch2;
+ const minXYCorner = Cartesian2_default.unpack(
+ textureCoordinateRotationPoints4,
+ 0,
+ points2D[0]
+ );
+ const maxYCorner = Cartesian2_default.unpack(
+ textureCoordinateRotationPoints4,
+ 2,
+ points2D[1]
+ );
+ const maxXCorner = Cartesian2_default.unpack(
+ textureCoordinateRotationPoints4,
+ 4,
+ points2D[2]
+ );
+ attributes.uMaxVmax = new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4,
+ normalize: false,
+ value: [maxYCorner.x, maxYCorner.y, maxXCorner.x, maxXCorner.y]
+ });
+ const inverseExtentX = 1 / pointLineDistance(minXYCorner, maxYCorner, maxXCorner);
+ const inverseExtentY = 1 / pointLineDistance(minXYCorner, maxXCorner, maxYCorner);
+ attributes.uvMinAndExtents = new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4,
+ normalize: false,
+ value: [minXYCorner.x, minXYCorner.y, inverseExtentX, inverseExtentY]
+ });
+}
+var cartographicScratch = new Cartographic_default();
+var cornerScratch = new Cartesian3_default();
+var northWestScratch = new Cartesian3_default();
+var southEastScratch = new Cartesian3_default();
+var highLowScratch = { high: 0, low: 0 };
+function add2DTextureCoordinateAttributes(rectangle, projection, attributes) {
+ const carto = cartographicScratch;
+ carto.height = 0;
+ carto.longitude = rectangle.west;
+ carto.latitude = rectangle.south;
+ const southWestCorner = projection.project(carto, cornerScratch);
+ carto.latitude = rectangle.north;
+ const northWest = projection.project(carto, northWestScratch);
+ carto.longitude = rectangle.east;
+ carto.latitude = rectangle.south;
+ const southEast = projection.project(carto, southEastScratch);
+ const valuesHigh = [0, 0, 0, 0];
+ const valuesLow = [0, 0, 0, 0];
+ let encoded = EncodedCartesian3_default.encode(southWestCorner.x, highLowScratch);
+ valuesHigh[0] = encoded.high;
+ valuesLow[0] = encoded.low;
+ encoded = EncodedCartesian3_default.encode(southWestCorner.y, highLowScratch);
+ valuesHigh[1] = encoded.high;
+ valuesLow[1] = encoded.low;
+ encoded = EncodedCartesian3_default.encode(northWest.y, highLowScratch);
+ valuesHigh[2] = encoded.high;
+ valuesLow[2] = encoded.low;
+ encoded = EncodedCartesian3_default.encode(southEast.x, highLowScratch);
+ valuesHigh[3] = encoded.high;
+ valuesLow[3] = encoded.low;
+ attributes.planes2D_HIGH = new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4,
+ normalize: false,
+ value: valuesHigh
+ });
+ attributes.planes2D_LOW = new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4,
+ normalize: false,
+ value: valuesLow
+ });
+}
+var enuMatrixScratch = new Matrix4_default();
+var inverseEnuScratch = new Matrix4_default();
+var rectanglePointCartesianScratch = new Cartesian3_default();
+var rectangleCenterScratch2 = new Cartographic_default();
+var pointsCartographicScratch = [
+ new Cartographic_default(),
+ new Cartographic_default(),
+ new Cartographic_default(),
+ new Cartographic_default(),
+ new Cartographic_default(),
+ new Cartographic_default(),
+ new Cartographic_default(),
+ new Cartographic_default()
+];
+function computeRectangleBounds(rectangle, ellipsoid, height, southWestCornerResult, eastVectorResult, northVectorResult) {
+ const centerCartographic = Rectangle_default.center(
+ rectangle,
+ rectangleCenterScratch2
+ );
+ centerCartographic.height = height;
+ const centerCartesian2 = Cartographic_default.toCartesian(
+ centerCartographic,
+ ellipsoid,
+ rectanglePointCartesianScratch
+ );
+ const enuMatrix = Transforms_default.eastNorthUpToFixedFrame(
+ centerCartesian2,
+ ellipsoid,
+ enuMatrixScratch
+ );
+ const inverseEnu = Matrix4_default.inverse(enuMatrix, inverseEnuScratch);
+ const west = rectangle.west;
+ const east = rectangle.east;
+ const north = rectangle.north;
+ const south = rectangle.south;
+ const cartographics = pointsCartographicScratch;
+ cartographics[0].latitude = south;
+ cartographics[0].longitude = west;
+ cartographics[1].latitude = north;
+ cartographics[1].longitude = west;
+ cartographics[2].latitude = north;
+ cartographics[2].longitude = east;
+ cartographics[3].latitude = south;
+ cartographics[3].longitude = east;
+ const longitudeCenter = (west + east) * 0.5;
+ const latitudeCenter = (north + south) * 0.5;
+ cartographics[4].latitude = south;
+ cartographics[4].longitude = longitudeCenter;
+ cartographics[5].latitude = north;
+ cartographics[5].longitude = longitudeCenter;
+ cartographics[6].latitude = latitudeCenter;
+ cartographics[6].longitude = west;
+ cartographics[7].latitude = latitudeCenter;
+ cartographics[7].longitude = east;
+ let minX = Number.POSITIVE_INFINITY;
+ let maxX = Number.NEGATIVE_INFINITY;
+ let minY = Number.POSITIVE_INFINITY;
+ let maxY = Number.NEGATIVE_INFINITY;
+ for (let i = 0; i < 8; i++) {
+ cartographics[i].height = height;
+ const pointCartesian = Cartographic_default.toCartesian(
+ cartographics[i],
+ ellipsoid,
+ rectanglePointCartesianScratch
+ );
+ Matrix4_default.multiplyByPoint(inverseEnu, pointCartesian, pointCartesian);
+ pointCartesian.z = 0;
+ minX = Math.min(minX, pointCartesian.x);
+ maxX = Math.max(maxX, pointCartesian.x);
+ minY = Math.min(minY, pointCartesian.y);
+ maxY = Math.max(maxY, pointCartesian.y);
+ }
+ const southWestCorner = southWestCornerResult;
+ southWestCorner.x = minX;
+ southWestCorner.y = minY;
+ southWestCorner.z = 0;
+ Matrix4_default.multiplyByPoint(enuMatrix, southWestCorner, southWestCorner);
+ const southEastCorner = eastVectorResult;
+ southEastCorner.x = maxX;
+ southEastCorner.y = minY;
+ southEastCorner.z = 0;
+ Matrix4_default.multiplyByPoint(enuMatrix, southEastCorner, southEastCorner);
+ Cartesian3_default.subtract(southEastCorner, southWestCorner, eastVectorResult);
+ const northWestCorner = northVectorResult;
+ northWestCorner.x = minX;
+ northWestCorner.y = maxY;
+ northWestCorner.z = 0;
+ Matrix4_default.multiplyByPoint(enuMatrix, northWestCorner, northWestCorner);
+ Cartesian3_default.subtract(northWestCorner, southWestCorner, northVectorResult);
+}
+var eastwardScratch = new Cartesian3_default();
+var northwardScratch = new Cartesian3_default();
+var encodeScratch = new EncodedCartesian3_default();
+ShadowVolumeAppearance.getPlanarTextureCoordinateAttributes = function(boundingRectangle, textureCoordinateRotationPoints4, ellipsoid, projection, height) {
+ Check_default.typeOf.object("boundingRectangle", boundingRectangle);
+ Check_default.defined(
+ "textureCoordinateRotationPoints",
+ textureCoordinateRotationPoints4
+ );
+ Check_default.typeOf.object("ellipsoid", ellipsoid);
+ Check_default.typeOf.object("projection", projection);
+ const corner = cornerScratch;
+ const eastward = eastwardScratch;
+ const northward = northwardScratch;
+ computeRectangleBounds(
+ boundingRectangle,
+ ellipsoid,
+ defaultValue_default(height, 0),
+ corner,
+ eastward,
+ northward
+ );
+ const attributes = {};
+ addTextureCoordinateRotationAttributes(
+ attributes,
+ textureCoordinateRotationPoints4
+ );
+ const encoded = EncodedCartesian3_default.fromCartesian(corner, encodeScratch);
+ attributes.southWest_HIGH = new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ normalize: false,
+ value: Cartesian3_default.pack(encoded.high, [0, 0, 0])
+ });
+ attributes.southWest_LOW = new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ normalize: false,
+ value: Cartesian3_default.pack(encoded.low, [0, 0, 0])
+ });
+ attributes.eastward = new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ normalize: false,
+ value: Cartesian3_default.pack(eastward, [0, 0, 0])
+ });
+ attributes.northward = new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ normalize: false,
+ value: Cartesian3_default.pack(northward, [0, 0, 0])
+ });
+ add2DTextureCoordinateAttributes(boundingRectangle, projection, attributes);
+ return attributes;
+};
+var spherePointScratch = new Cartesian3_default();
+function latLongToSpherical(latitude, longitude, ellipsoid, result) {
+ const cartographic2 = cartographicScratch;
+ cartographic2.latitude = latitude;
+ cartographic2.longitude = longitude;
+ cartographic2.height = 0;
+ const spherePoint = Cartographic_default.toCartesian(
+ cartographic2,
+ ellipsoid,
+ spherePointScratch
+ );
+ const magXY = Math.sqrt(
+ spherePoint.x * spherePoint.x + spherePoint.y * spherePoint.y
+ );
+ const sphereLatitude = Math_default.fastApproximateAtan2(magXY, spherePoint.z);
+ const sphereLongitude = Math_default.fastApproximateAtan2(
+ spherePoint.x,
+ spherePoint.y
+ );
+ result.x = sphereLatitude;
+ result.y = sphereLongitude;
+ return result;
+}
+var sphericalScratch = new Cartesian2_default();
+ShadowVolumeAppearance.getSphericalExtentGeometryInstanceAttributes = function(boundingRectangle, textureCoordinateRotationPoints4, ellipsoid, projection) {
+ Check_default.typeOf.object("boundingRectangle", boundingRectangle);
+ Check_default.defined(
+ "textureCoordinateRotationPoints",
+ textureCoordinateRotationPoints4
+ );
+ Check_default.typeOf.object("ellipsoid", ellipsoid);
+ Check_default.typeOf.object("projection", projection);
+ const southWestExtents = latLongToSpherical(
+ boundingRectangle.south,
+ boundingRectangle.west,
+ ellipsoid,
+ sphericalScratch
+ );
+ let south = southWestExtents.x;
+ let west = southWestExtents.y;
+ const northEastExtents = latLongToSpherical(
+ boundingRectangle.north,
+ boundingRectangle.east,
+ ellipsoid,
+ sphericalScratch
+ );
+ let north = northEastExtents.x;
+ let east = northEastExtents.y;
+ let rotationRadians = 0;
+ if (west > east) {
+ rotationRadians = Math_default.PI - west;
+ west = -Math_default.PI;
+ east += rotationRadians;
+ }
+ south -= Math_default.EPSILON5;
+ west -= Math_default.EPSILON5;
+ north += Math_default.EPSILON5;
+ east += Math_default.EPSILON5;
+ const longitudeRangeInverse = 1 / (east - west);
+ const latitudeRangeInverse = 1 / (north - south);
+ const attributes = {
+ sphericalExtents: new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4,
+ normalize: false,
+ value: [south, west, latitudeRangeInverse, longitudeRangeInverse]
+ }),
+ longitudeRotation: new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 1,
+ normalize: false,
+ value: [rotationRadians]
+ })
+ };
+ addTextureCoordinateRotationAttributes(
+ attributes,
+ textureCoordinateRotationPoints4
+ );
+ add2DTextureCoordinateAttributes(boundingRectangle, projection, attributes);
+ return attributes;
+};
+ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes = function(attributes) {
+ return defined_default(attributes.southWest_HIGH) && defined_default(attributes.southWest_LOW) && defined_default(attributes.northward) && defined_default(attributes.eastward) && defined_default(attributes.planes2D_HIGH) && defined_default(attributes.planes2D_LOW) && defined_default(attributes.uMaxVmax) && defined_default(attributes.uvMinAndExtents);
+};
+ShadowVolumeAppearance.hasAttributesForSphericalExtents = function(attributes) {
+ return defined_default(attributes.sphericalExtents) && defined_default(attributes.longitudeRotation) && defined_default(attributes.planes2D_HIGH) && defined_default(attributes.planes2D_LOW) && defined_default(attributes.uMaxVmax) && defined_default(attributes.uvMinAndExtents);
+};
+function shouldUseSpherical(rectangle) {
+ return Math.max(rectangle.width, rectangle.height) > ShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS;
+}
+ShadowVolumeAppearance.shouldUseSphericalCoordinates = function(rectangle) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ return shouldUseSpherical(rectangle);
+};
+ShadowVolumeAppearance.MAX_WIDTH_FOR_PLANAR_EXTENTS = Math_default.toRadians(1);
+var ShadowVolumeAppearance_default = ShadowVolumeAppearance;
+
+// Source/Scene/StencilFunction.js
+var StencilFunction = {
+ NEVER: WebGLConstants_default.NEVER,
+ LESS: WebGLConstants_default.LESS,
+ EQUAL: WebGLConstants_default.EQUAL,
+ LESS_OR_EQUAL: WebGLConstants_default.LEQUAL,
+ GREATER: WebGLConstants_default.GREATER,
+ NOT_EQUAL: WebGLConstants_default.NOTEQUAL,
+ GREATER_OR_EQUAL: WebGLConstants_default.GEQUAL,
+ ALWAYS: WebGLConstants_default.ALWAYS
+};
+var StencilFunction_default = Object.freeze(StencilFunction);
+
+// Source/Scene/StencilOperation.js
+var StencilOperation = {
+ ZERO: WebGLConstants_default.ZERO,
+ KEEP: WebGLConstants_default.KEEP,
+ REPLACE: WebGLConstants_default.REPLACE,
+ INCREMENT: WebGLConstants_default.INCR,
+ DECREMENT: WebGLConstants_default.DECR,
+ INVERT: WebGLConstants_default.INVERT,
+ INCREMENT_WRAP: WebGLConstants_default.INCR_WRAP,
+ DECREMENT_WRAP: WebGLConstants_default.DECR_WRAP
+};
+var StencilOperation_default = Object.freeze(StencilOperation);
+
+// Source/Scene/StencilConstants.js
+var StencilConstants = {
+ CESIUM_3D_TILE_MASK: 128,
+ SKIP_LOD_MASK: 112,
+ SKIP_LOD_BIT_SHIFT: 4,
+ CLASSIFICATION_MASK: 15
+};
+StencilConstants.setCesium3DTileBit = function() {
+ return {
+ enabled: true,
+ frontFunction: StencilFunction_default.ALWAYS,
+ frontOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.KEEP,
+ zPass: StencilOperation_default.REPLACE
+ },
+ backFunction: StencilFunction_default.ALWAYS,
+ backOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.KEEP,
+ zPass: StencilOperation_default.REPLACE
+ },
+ reference: StencilConstants.CESIUM_3D_TILE_MASK,
+ mask: StencilConstants.CESIUM_3D_TILE_MASK
+ };
+};
+var StencilConstants_default = Object.freeze(StencilConstants);
+
+// Source/Scene/ClassificationPrimitive.js
+function ClassificationPrimitive(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const geometryInstances = options.geometryInstances;
+ this.geometryInstances = geometryInstances;
+ this.show = defaultValue_default(options.show, true);
+ this.classificationType = defaultValue_default(
+ options.classificationType,
+ ClassificationType_default.BOTH
+ );
+ this.debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this.debugShowShadowVolume = defaultValue_default(
+ options.debugShowShadowVolume,
+ false
+ );
+ this._debugShowShadowVolume = false;
+ this._extruded = defaultValue_default(options._extruded, false);
+ this._uniformMap = options._uniformMap;
+ this._sp = void 0;
+ this._spStencil = void 0;
+ this._spPick = void 0;
+ this._spColor = void 0;
+ this._spPick2D = void 0;
+ this._spColor2D = void 0;
+ this._rsStencilDepthPass = void 0;
+ this._rsStencilDepthPass3DTiles = void 0;
+ this._rsColorPass = void 0;
+ this._rsPickPass = void 0;
+ this._commandsIgnoreShow = [];
+ this._ready = false;
+ const classificationPrimitive = this;
+ this._readyPromise = new Promise((resolve2, reject) => {
+ classificationPrimitive._completeLoad = () => {
+ if (this._ready) {
+ return;
+ }
+ this._ready = true;
+ if (this.releaseGeometryInstances) {
+ this.geometryInstances = void 0;
+ }
+ const error = this._error;
+ if (!defined_default(error)) {
+ resolve2(this);
+ } else {
+ reject(error);
+ }
+ };
+ });
+ this._primitive = void 0;
+ this._pickPrimitive = options._pickPrimitive;
+ this._hasSphericalExtentsAttribute = false;
+ this._hasPlanarExtentsAttributes = false;
+ this._hasPerColorAttribute = false;
+ this.appearance = options.appearance;
+ this._createBoundingVolumeFunction = options._createBoundingVolumeFunction;
+ this._updateAndQueueCommandsFunction = options._updateAndQueueCommandsFunction;
+ this._usePickOffsets = false;
+ this._primitiveOptions = {
+ geometryInstances: void 0,
+ appearance: void 0,
+ vertexCacheOptimize: defaultValue_default(options.vertexCacheOptimize, false),
+ interleave: defaultValue_default(options.interleave, false),
+ releaseGeometryInstances: defaultValue_default(
+ options.releaseGeometryInstances,
+ true
+ ),
+ allowPicking: defaultValue_default(options.allowPicking, true),
+ asynchronous: defaultValue_default(options.asynchronous, true),
+ compressVertices: defaultValue_default(options.compressVertices, true),
+ _createBoundingVolumeFunction: void 0,
+ _createRenderStatesFunction: void 0,
+ _createShaderProgramFunction: void 0,
+ _createCommandsFunction: void 0,
+ _updateAndQueueCommandsFunction: void 0,
+ _createPickOffsets: true
+ };
+}
+Object.defineProperties(ClassificationPrimitive.prototype, {
+ vertexCacheOptimize: {
+ get: function() {
+ return this._primitiveOptions.vertexCacheOptimize;
+ }
+ },
+ interleave: {
+ get: function() {
+ return this._primitiveOptions.interleave;
+ }
+ },
+ releaseGeometryInstances: {
+ get: function() {
+ return this._primitiveOptions.releaseGeometryInstances;
+ }
+ },
+ allowPicking: {
+ get: function() {
+ return this._primitiveOptions.allowPicking;
+ }
+ },
+ asynchronous: {
+ get: function() {
+ return this._primitiveOptions.asynchronous;
+ }
+ },
+ compressVertices: {
+ get: function() {
+ return this._primitiveOptions.compressVertices;
+ }
+ },
+ ready: {
+ get: function() {
+ return this._ready;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ },
+ _needs2DShader: {
+ get: function() {
+ return this._hasPlanarExtentsAttributes || this._hasSphericalExtentsAttribute;
+ }
+ }
+});
+ClassificationPrimitive.isSupported = function(scene) {
+ return scene.context.stencilBuffer;
+};
+function getStencilDepthRenderState(enableStencil, mask3DTiles) {
+ const stencilFunction = mask3DTiles ? StencilFunction_default.EQUAL : StencilFunction_default.ALWAYS;
+ return {
+ colorMask: {
+ red: false,
+ green: false,
+ blue: false,
+ alpha: false
+ },
+ stencilTest: {
+ enabled: enableStencil,
+ frontFunction: stencilFunction,
+ frontOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.DECREMENT_WRAP,
+ zPass: StencilOperation_default.KEEP
+ },
+ backFunction: stencilFunction,
+ backOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.INCREMENT_WRAP,
+ zPass: StencilOperation_default.KEEP
+ },
+ reference: StencilConstants_default.CESIUM_3D_TILE_MASK,
+ mask: StencilConstants_default.CESIUM_3D_TILE_MASK
+ },
+ stencilMask: StencilConstants_default.CLASSIFICATION_MASK,
+ depthTest: {
+ enabled: true,
+ func: DepthFunction_default.LESS_OR_EQUAL
+ },
+ depthMask: false
+ };
+}
+function getColorRenderState(enableStencil) {
+ return {
+ stencilTest: {
+ enabled: enableStencil,
+ frontFunction: StencilFunction_default.NOT_EQUAL,
+ frontOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ backFunction: StencilFunction_default.NOT_EQUAL,
+ backOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ reference: 0,
+ mask: StencilConstants_default.CLASSIFICATION_MASK
+ },
+ stencilMask: StencilConstants_default.CLASSIFICATION_MASK,
+ depthTest: {
+ enabled: false
+ },
+ depthMask: false,
+ blending: BlendingState_default.PRE_MULTIPLIED_ALPHA_BLEND
+ };
+}
+var pickRenderState = {
+ stencilTest: {
+ enabled: true,
+ frontFunction: StencilFunction_default.NOT_EQUAL,
+ frontOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ backFunction: StencilFunction_default.NOT_EQUAL,
+ backOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ reference: 0,
+ mask: StencilConstants_default.CLASSIFICATION_MASK
+ },
+ stencilMask: StencilConstants_default.CLASSIFICATION_MASK,
+ depthTest: {
+ enabled: false
+ },
+ depthMask: false
+};
+function createRenderStates2(classificationPrimitive, context, appearance, twoPasses) {
+ if (defined_default(classificationPrimitive._rsStencilDepthPass)) {
+ return;
+ }
+ const stencilEnabled = !classificationPrimitive.debugShowShadowVolume;
+ classificationPrimitive._rsStencilDepthPass = RenderState_default.fromCache(
+ getStencilDepthRenderState(stencilEnabled, false)
+ );
+ classificationPrimitive._rsStencilDepthPass3DTiles = RenderState_default.fromCache(
+ getStencilDepthRenderState(stencilEnabled, true)
+ );
+ classificationPrimitive._rsColorPass = RenderState_default.fromCache(
+ getColorRenderState(stencilEnabled, false)
+ );
+ classificationPrimitive._rsPickPass = RenderState_default.fromCache(pickRenderState);
+}
+function modifyForEncodedNormals2(primitive, vertexShaderSource) {
+ if (!primitive.compressVertices) {
+ return vertexShaderSource;
+ }
+ if (vertexShaderSource.search(/attribute\s+vec3\s+extrudeDirection;/g) !== -1) {
+ const attributeName = "compressedAttributes";
+ const attributeDecl = `attribute vec2 ${attributeName};`;
+ const globalDecl = "vec3 extrudeDirection;\n";
+ const decode = ` extrudeDirection = czm_octDecode(${attributeName}, 65535.0);
+`;
+ let modifiedVS = vertexShaderSource;
+ modifiedVS = modifiedVS.replace(
+ /attribute\s+vec3\s+extrudeDirection;/g,
+ ""
+ );
+ modifiedVS = ShaderSource_default.replaceMain(
+ modifiedVS,
+ "czm_non_compressed_main"
+ );
+ const compressedMain = `${"void main() \n{ \n"}${decode} czm_non_compressed_main();
+}`;
+ return [attributeDecl, globalDecl, modifiedVS, compressedMain].join("\n");
+ }
+}
+function createShaderProgram2(classificationPrimitive, frameState) {
+ const context = frameState.context;
+ const primitive = classificationPrimitive._primitive;
+ let vs = ShadowVolumeAppearanceVS_default;
+ vs = classificationPrimitive._primitive._batchTable.getVertexShaderCallback()(
+ vs
+ );
+ vs = Primitive_default._appendDistanceDisplayConditionToShader(primitive, vs);
+ vs = Primitive_default._modifyShaderPosition(
+ classificationPrimitive,
+ vs,
+ frameState.scene3DOnly
+ );
+ vs = Primitive_default._updateColorAttribute(primitive, vs);
+ const planarExtents = classificationPrimitive._hasPlanarExtentsAttributes;
+ const cullFragmentsUsingExtents = planarExtents || classificationPrimitive._hasSphericalExtentsAttribute;
+ if (classificationPrimitive._extruded) {
+ vs = modifyForEncodedNormals2(primitive, vs);
+ }
+ const extrudedDefine = classificationPrimitive._extruded ? "EXTRUDED_GEOMETRY" : "";
+ let vsSource = new ShaderSource_default({
+ defines: [extrudedDefine],
+ sources: [vs]
+ });
+ const fsSource = new ShaderSource_default({
+ sources: [ShadowVolumeFS_default]
+ });
+ const attributeLocations8 = classificationPrimitive._primitive._attributeLocations;
+ const shadowVolumeAppearance = new ShadowVolumeAppearance_default(
+ cullFragmentsUsingExtents,
+ planarExtents,
+ classificationPrimitive.appearance
+ );
+ classificationPrimitive._spStencil = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: classificationPrimitive._spStencil,
+ vertexShaderSource: vsSource,
+ fragmentShaderSource: fsSource,
+ attributeLocations: attributeLocations8
+ });
+ if (classificationPrimitive._primitive.allowPicking) {
+ let vsPick = ShaderSource_default.createPickVertexShaderSource(vs);
+ vsPick = Primitive_default._appendShowToShader(primitive, vsPick);
+ vsPick = Primitive_default._updatePickColorAttribute(vsPick);
+ const pickFS3D = shadowVolumeAppearance.createPickFragmentShader(false);
+ const pickVS3D = shadowVolumeAppearance.createPickVertexShader(
+ [extrudedDefine],
+ vsPick,
+ false,
+ frameState.mapProjection
+ );
+ classificationPrimitive._spPick = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: classificationPrimitive._spPick,
+ vertexShaderSource: pickVS3D,
+ fragmentShaderSource: pickFS3D,
+ attributeLocations: attributeLocations8
+ });
+ if (cullFragmentsUsingExtents) {
+ let pickProgram2D = context.shaderCache.getDerivedShaderProgram(
+ classificationPrimitive._spPick,
+ "2dPick"
+ );
+ if (!defined_default(pickProgram2D)) {
+ const pickFS2D = shadowVolumeAppearance.createPickFragmentShader(true);
+ const pickVS2D = shadowVolumeAppearance.createPickVertexShader(
+ [extrudedDefine],
+ vsPick,
+ true,
+ frameState.mapProjection
+ );
+ pickProgram2D = context.shaderCache.createDerivedShaderProgram(
+ classificationPrimitive._spPick,
+ "2dPick",
+ {
+ vertexShaderSource: pickVS2D,
+ fragmentShaderSource: pickFS2D,
+ attributeLocations: attributeLocations8
+ }
+ );
+ }
+ classificationPrimitive._spPick2D = pickProgram2D;
+ }
+ } else {
+ classificationPrimitive._spPick = ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource: vsSource,
+ fragmentShaderSource: fsSource,
+ attributeLocations: attributeLocations8
+ });
+ }
+ vs = Primitive_default._appendShowToShader(primitive, vs);
+ vsSource = new ShaderSource_default({
+ defines: [extrudedDefine],
+ sources: [vs]
+ });
+ classificationPrimitive._sp = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: classificationPrimitive._sp,
+ vertexShaderSource: vsSource,
+ fragmentShaderSource: fsSource,
+ attributeLocations: attributeLocations8
+ });
+ const fsColorSource = shadowVolumeAppearance.createFragmentShader(false);
+ const vsColorSource = shadowVolumeAppearance.createVertexShader(
+ [extrudedDefine],
+ vs,
+ false,
+ frameState.mapProjection
+ );
+ classificationPrimitive._spColor = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: classificationPrimitive._spColor,
+ vertexShaderSource: vsColorSource,
+ fragmentShaderSource: fsColorSource,
+ attributeLocations: attributeLocations8
+ });
+ if (cullFragmentsUsingExtents) {
+ let colorProgram2D = context.shaderCache.getDerivedShaderProgram(
+ classificationPrimitive._spColor,
+ "2dColor"
+ );
+ if (!defined_default(colorProgram2D)) {
+ const fsColorSource2D = shadowVolumeAppearance.createFragmentShader(true);
+ const vsColorSource2D = shadowVolumeAppearance.createVertexShader(
+ [extrudedDefine],
+ vs,
+ true,
+ frameState.mapProjection
+ );
+ colorProgram2D = context.shaderCache.createDerivedShaderProgram(
+ classificationPrimitive._spColor,
+ "2dColor",
+ {
+ vertexShaderSource: vsColorSource2D,
+ fragmentShaderSource: fsColorSource2D,
+ attributeLocations: attributeLocations8
+ }
+ );
+ }
+ classificationPrimitive._spColor2D = colorProgram2D;
+ }
+}
+function createColorCommands(classificationPrimitive, colorCommands) {
+ const primitive = classificationPrimitive._primitive;
+ let length3 = primitive._va.length * 2;
+ colorCommands.length = length3;
+ let i;
+ let command;
+ let derivedCommand;
+ let vaIndex = 0;
+ let uniformMap2 = primitive._batchTable.getUniformMapCallback()(
+ classificationPrimitive._uniformMap
+ );
+ const needs2DShader = classificationPrimitive._needs2DShader;
+ for (i = 0; i < length3; i += 2) {
+ const vertexArray = primitive._va[vaIndex++];
+ command = colorCommands[i];
+ if (!defined_default(command)) {
+ command = colorCommands[i] = new DrawCommand_default({
+ owner: classificationPrimitive,
+ primitiveType: primitive._primitiveType
+ });
+ }
+ command.vertexArray = vertexArray;
+ command.renderState = classificationPrimitive._rsStencilDepthPass;
+ command.shaderProgram = classificationPrimitive._sp;
+ command.uniformMap = uniformMap2;
+ command.pass = Pass_default.TERRAIN_CLASSIFICATION;
+ derivedCommand = DrawCommand_default.shallowClone(
+ command,
+ command.derivedCommands.tileset
+ );
+ derivedCommand.renderState = classificationPrimitive._rsStencilDepthPass3DTiles;
+ derivedCommand.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ command.derivedCommands.tileset = derivedCommand;
+ command = colorCommands[i + 1];
+ if (!defined_default(command)) {
+ command = colorCommands[i + 1] = new DrawCommand_default({
+ owner: classificationPrimitive,
+ primitiveType: primitive._primitiveType
+ });
+ }
+ command.vertexArray = vertexArray;
+ command.renderState = classificationPrimitive._rsColorPass;
+ command.shaderProgram = classificationPrimitive._spColor;
+ command.pass = Pass_default.TERRAIN_CLASSIFICATION;
+ const appearance = classificationPrimitive.appearance;
+ const material = appearance.material;
+ if (defined_default(material)) {
+ uniformMap2 = combine_default(uniformMap2, material._uniforms);
+ }
+ command.uniformMap = uniformMap2;
+ derivedCommand = DrawCommand_default.shallowClone(
+ command,
+ command.derivedCommands.tileset
+ );
+ derivedCommand.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ command.derivedCommands.tileset = derivedCommand;
+ if (needs2DShader) {
+ let derived2DCommand = DrawCommand_default.shallowClone(
+ command,
+ command.derivedCommands.appearance2D
+ );
+ derived2DCommand.shaderProgram = classificationPrimitive._spColor2D;
+ command.derivedCommands.appearance2D = derived2DCommand;
+ derived2DCommand = DrawCommand_default.shallowClone(
+ derivedCommand,
+ derivedCommand.derivedCommands.appearance2D
+ );
+ derived2DCommand.shaderProgram = classificationPrimitive._spColor2D;
+ derivedCommand.derivedCommands.appearance2D = derived2DCommand;
+ }
+ }
+ const commandsIgnoreShow = classificationPrimitive._commandsIgnoreShow;
+ const spStencil = classificationPrimitive._spStencil;
+ let commandIndex = 0;
+ length3 = commandsIgnoreShow.length = length3 / 2;
+ for (let j = 0; j < length3; ++j) {
+ const commandIgnoreShow = commandsIgnoreShow[j] = DrawCommand_default.shallowClone(
+ colorCommands[commandIndex],
+ commandsIgnoreShow[j]
+ );
+ commandIgnoreShow.shaderProgram = spStencil;
+ commandIgnoreShow.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW;
+ commandIndex += 2;
+ }
+}
+function createPickCommands(classificationPrimitive, pickCommands) {
+ const usePickOffsets = classificationPrimitive._usePickOffsets;
+ const primitive = classificationPrimitive._primitive;
+ let length3 = primitive._va.length * 2;
+ let pickOffsets;
+ let pickIndex = 0;
+ let pickOffset;
+ if (usePickOffsets) {
+ pickOffsets = primitive._pickOffsets;
+ length3 = pickOffsets.length * 2;
+ }
+ pickCommands.length = length3;
+ let j;
+ let command;
+ let derivedCommand;
+ let vaIndex = 0;
+ const uniformMap2 = primitive._batchTable.getUniformMapCallback()(
+ classificationPrimitive._uniformMap
+ );
+ const needs2DShader = classificationPrimitive._needs2DShader;
+ for (j = 0; j < length3; j += 2) {
+ let vertexArray = primitive._va[vaIndex++];
+ if (usePickOffsets) {
+ pickOffset = pickOffsets[pickIndex++];
+ vertexArray = primitive._va[pickOffset.index];
+ }
+ command = pickCommands[j];
+ if (!defined_default(command)) {
+ command = pickCommands[j] = new DrawCommand_default({
+ owner: classificationPrimitive,
+ primitiveType: primitive._primitiveType,
+ pickOnly: true
+ });
+ }
+ command.vertexArray = vertexArray;
+ command.renderState = classificationPrimitive._rsStencilDepthPass;
+ command.shaderProgram = classificationPrimitive._sp;
+ command.uniformMap = uniformMap2;
+ command.pass = Pass_default.TERRAIN_CLASSIFICATION;
+ if (usePickOffsets) {
+ command.offset = pickOffset.offset;
+ command.count = pickOffset.count;
+ }
+ derivedCommand = DrawCommand_default.shallowClone(
+ command,
+ command.derivedCommands.tileset
+ );
+ derivedCommand.renderState = classificationPrimitive._rsStencilDepthPass3DTiles;
+ derivedCommand.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ command.derivedCommands.tileset = derivedCommand;
+ command = pickCommands[j + 1];
+ if (!defined_default(command)) {
+ command = pickCommands[j + 1] = new DrawCommand_default({
+ owner: classificationPrimitive,
+ primitiveType: primitive._primitiveType,
+ pickOnly: true
+ });
+ }
+ command.vertexArray = vertexArray;
+ command.renderState = classificationPrimitive._rsPickPass;
+ command.shaderProgram = classificationPrimitive._spPick;
+ command.uniformMap = uniformMap2;
+ command.pass = Pass_default.TERRAIN_CLASSIFICATION;
+ if (usePickOffsets) {
+ command.offset = pickOffset.offset;
+ command.count = pickOffset.count;
+ }
+ derivedCommand = DrawCommand_default.shallowClone(
+ command,
+ command.derivedCommands.tileset
+ );
+ derivedCommand.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ command.derivedCommands.tileset = derivedCommand;
+ if (needs2DShader) {
+ let derived2DCommand = DrawCommand_default.shallowClone(
+ command,
+ command.derivedCommands.pick2D
+ );
+ derived2DCommand.shaderProgram = classificationPrimitive._spPick2D;
+ command.derivedCommands.pick2D = derived2DCommand;
+ derived2DCommand = DrawCommand_default.shallowClone(
+ derivedCommand,
+ derivedCommand.derivedCommands.pick2D
+ );
+ derived2DCommand.shaderProgram = classificationPrimitive._spPick2D;
+ derivedCommand.derivedCommands.pick2D = derived2DCommand;
+ }
+ }
+}
+function createCommands2(classificationPrimitive, appearance, material, translucent, twoPasses, colorCommands, pickCommands) {
+ createColorCommands(classificationPrimitive, colorCommands);
+ createPickCommands(classificationPrimitive, pickCommands);
+}
+function boundingVolumeIndex(commandIndex, length3) {
+ return Math.floor(commandIndex % length3 / 2);
+}
+function updateAndQueueRenderCommand(command, frameState, modelMatrix, cull, boundingVolume, debugShowBoundingVolume2) {
+ command.modelMatrix = modelMatrix;
+ command.boundingVolume = boundingVolume;
+ command.cull = cull;
+ command.debugShowBoundingVolume = debugShowBoundingVolume2;
+ frameState.commandList.push(command);
+}
+function updateAndQueuePickCommand(command, frameState, modelMatrix, cull, boundingVolume) {
+ command.modelMatrix = modelMatrix;
+ command.boundingVolume = boundingVolume;
+ command.cull = cull;
+ frameState.commandList.push(command);
+}
+function updateAndQueueCommands2(classificationPrimitive, frameState, colorCommands, pickCommands, modelMatrix, cull, debugShowBoundingVolume2, twoPasses) {
+ const primitive = classificationPrimitive._primitive;
+ Primitive_default._updateBoundingVolumes(primitive, frameState, modelMatrix);
+ let boundingVolumes;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ boundingVolumes = primitive._boundingSphereWC;
+ } else if (frameState.mode === SceneMode_default.COLUMBUS_VIEW) {
+ boundingVolumes = primitive._boundingSphereCV;
+ } else if (frameState.mode === SceneMode_default.SCENE2D && defined_default(primitive._boundingSphere2D)) {
+ boundingVolumes = primitive._boundingSphere2D;
+ } else if (defined_default(primitive._boundingSphereMorph)) {
+ boundingVolumes = primitive._boundingSphereMorph;
+ }
+ const classificationType = classificationPrimitive.classificationType;
+ const queueTerrainCommands = classificationType !== ClassificationType_default.CESIUM_3D_TILE;
+ const queue3DTilesCommands = classificationType !== ClassificationType_default.TERRAIN;
+ const passes = frameState.passes;
+ let i;
+ let boundingVolume;
+ let command;
+ if (passes.render) {
+ const colorLength = colorCommands.length;
+ for (i = 0; i < colorLength; ++i) {
+ boundingVolume = boundingVolumes[boundingVolumeIndex(i, colorLength)];
+ if (queueTerrainCommands) {
+ command = colorCommands[i];
+ updateAndQueueRenderCommand(
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume,
+ debugShowBoundingVolume2
+ );
+ }
+ if (queue3DTilesCommands) {
+ command = colorCommands[i].derivedCommands.tileset;
+ updateAndQueueRenderCommand(
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume,
+ debugShowBoundingVolume2
+ );
+ }
+ }
+ if (frameState.invertClassification) {
+ const ignoreShowCommands = classificationPrimitive._commandsIgnoreShow;
+ const ignoreShowCommandsLength = ignoreShowCommands.length;
+ for (i = 0; i < ignoreShowCommandsLength; ++i) {
+ boundingVolume = boundingVolumes[i];
+ command = ignoreShowCommands[i];
+ updateAndQueueRenderCommand(
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume,
+ debugShowBoundingVolume2
+ );
+ }
+ }
+ }
+ if (passes.pick) {
+ const pickLength = pickCommands.length;
+ const pickOffsets = primitive._pickOffsets;
+ for (i = 0; i < pickLength; ++i) {
+ const pickOffset = pickOffsets[boundingVolumeIndex(i, pickLength)];
+ boundingVolume = boundingVolumes[pickOffset.index];
+ if (queueTerrainCommands) {
+ command = pickCommands[i];
+ updateAndQueuePickCommand(
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume
+ );
+ }
+ if (queue3DTilesCommands) {
+ command = pickCommands[i].derivedCommands.tileset;
+ updateAndQueuePickCommand(
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume
+ );
+ }
+ }
+ }
+}
+ClassificationPrimitive.prototype.update = function(frameState) {
+ if (!defined_default(this._primitive) && !defined_default(this.geometryInstances)) {
+ return;
+ }
+ let appearance = this.appearance;
+ if (defined_default(appearance) && defined_default(appearance.material)) {
+ appearance.material.update(frameState.context);
+ }
+ const that = this;
+ const primitiveOptions = this._primitiveOptions;
+ if (!defined_default(this._primitive)) {
+ const instances = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances];
+ const length3 = instances.length;
+ let i;
+ let instance;
+ let attributes;
+ let hasPerColorAttribute = false;
+ let allColorsSame = true;
+ let firstColor;
+ let hasSphericalExtentsAttribute = false;
+ let hasPlanarExtentsAttributes = false;
+ if (length3 > 0) {
+ attributes = instances[0].attributes;
+ hasSphericalExtentsAttribute = ShadowVolumeAppearance_default.hasAttributesForSphericalExtents(
+ attributes
+ );
+ hasPlanarExtentsAttributes = ShadowVolumeAppearance_default.hasAttributesForTextureCoordinatePlanes(
+ attributes
+ );
+ firstColor = attributes.color;
+ }
+ for (i = 0; i < length3; i++) {
+ instance = instances[i];
+ const color = instance.attributes.color;
+ if (defined_default(color)) {
+ hasPerColorAttribute = true;
+ } else if (hasPerColorAttribute) {
+ throw new DeveloperError_default(
+ "All GeometryInstances must have color attributes to use per-instance color."
+ );
+ }
+ allColorsSame = allColorsSame && defined_default(color) && ColorGeometryInstanceAttribute_default.equals(firstColor, color);
+ }
+ if (!allColorsSame && !hasSphericalExtentsAttribute && !hasPlanarExtentsAttributes) {
+ throw new DeveloperError_default(
+ "All GeometryInstances must have the same color attribute except via GroundPrimitives"
+ );
+ }
+ if (hasPerColorAttribute && !defined_default(appearance)) {
+ appearance = new PerInstanceColorAppearance_default({
+ flat: true
+ });
+ this.appearance = appearance;
+ }
+ if (!hasPerColorAttribute && appearance instanceof PerInstanceColorAppearance_default) {
+ throw new DeveloperError_default(
+ "PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances"
+ );
+ }
+ if (defined_default(appearance.material) && !hasSphericalExtentsAttribute && !hasPlanarExtentsAttributes) {
+ throw new DeveloperError_default(
+ "Materials on ClassificationPrimitives are not supported except via GroundPrimitives"
+ );
+ }
+ this._usePickOffsets = !hasSphericalExtentsAttribute && !hasPlanarExtentsAttributes;
+ this._hasSphericalExtentsAttribute = hasSphericalExtentsAttribute;
+ this._hasPlanarExtentsAttributes = hasPlanarExtentsAttributes;
+ this._hasPerColorAttribute = hasPerColorAttribute;
+ const geometryInstances = new Array(length3);
+ for (i = 0; i < length3; ++i) {
+ instance = instances[i];
+ geometryInstances[i] = new GeometryInstance_default({
+ geometry: instance.geometry,
+ attributes: instance.attributes,
+ modelMatrix: instance.modelMatrix,
+ id: instance.id,
+ pickPrimitive: defaultValue_default(this._pickPrimitive, that)
+ });
+ }
+ primitiveOptions.appearance = appearance;
+ primitiveOptions.geometryInstances = geometryInstances;
+ if (defined_default(this._createBoundingVolumeFunction)) {
+ primitiveOptions._createBoundingVolumeFunction = function(frameState2, geometry) {
+ that._createBoundingVolumeFunction(frameState2, geometry);
+ };
+ }
+ primitiveOptions._createRenderStatesFunction = function(primitive, context, appearance2, twoPasses) {
+ createRenderStates2(that, context);
+ };
+ primitiveOptions._createShaderProgramFunction = function(primitive, frameState2, appearance2) {
+ createShaderProgram2(that, frameState2);
+ };
+ primitiveOptions._createCommandsFunction = function(primitive, appearance2, material, translucent, twoPasses, colorCommands, pickCommands) {
+ createCommands2(
+ that,
+ void 0,
+ void 0,
+ true,
+ false,
+ colorCommands,
+ pickCommands
+ );
+ };
+ if (defined_default(this._updateAndQueueCommandsFunction)) {
+ primitiveOptions._updateAndQueueCommandsFunction = function(primitive, frameState2, colorCommands, pickCommands, modelMatrix, cull, debugShowBoundingVolume2, twoPasses) {
+ that._updateAndQueueCommandsFunction(
+ primitive,
+ frameState2,
+ colorCommands,
+ pickCommands,
+ modelMatrix,
+ cull,
+ debugShowBoundingVolume2,
+ twoPasses
+ );
+ };
+ } else {
+ primitiveOptions._updateAndQueueCommandsFunction = function(primitive, frameState2, colorCommands, pickCommands, modelMatrix, cull, debugShowBoundingVolume2, twoPasses) {
+ updateAndQueueCommands2(
+ that,
+ frameState2,
+ colorCommands,
+ pickCommands,
+ modelMatrix,
+ cull,
+ debugShowBoundingVolume2,
+ twoPasses
+ );
+ };
+ }
+ this._primitive = new Primitive_default(primitiveOptions);
+ }
+ if (this.debugShowShadowVolume && !this._debugShowShadowVolume && this._ready) {
+ this._debugShowShadowVolume = true;
+ this._rsStencilDepthPass = RenderState_default.fromCache(
+ getStencilDepthRenderState(false, false)
+ );
+ this._rsStencilDepthPass3DTiles = RenderState_default.fromCache(
+ getStencilDepthRenderState(false, true)
+ );
+ this._rsColorPass = RenderState_default.fromCache(getColorRenderState(false));
+ } else if (!this.debugShowShadowVolume && this._debugShowShadowVolume) {
+ this._debugShowShadowVolume = false;
+ this._rsStencilDepthPass = RenderState_default.fromCache(
+ getStencilDepthRenderState(true, false)
+ );
+ this._rsStencilDepthPass3DTiles = RenderState_default.fromCache(
+ getStencilDepthRenderState(true, true)
+ );
+ this._rsColorPass = RenderState_default.fromCache(getColorRenderState(true));
+ }
+ if (this._primitive.appearance !== appearance) {
+ if (!this._hasSphericalExtentsAttribute && !this._hasPlanarExtentsAttributes && defined_default(appearance.material)) {
+ throw new DeveloperError_default(
+ "Materials on ClassificationPrimitives are not supported except via GroundPrimitive"
+ );
+ }
+ if (!this._hasPerColorAttribute && appearance instanceof PerInstanceColorAppearance_default) {
+ throw new DeveloperError_default(
+ "PerInstanceColorAppearance requires color GeometryInstanceAttribute"
+ );
+ }
+ this._primitive.appearance = appearance;
+ }
+ this._primitive.show = this.show;
+ this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;
+ this._primitive.update(frameState);
+ frameState.afterRender.push(() => {
+ if (defined_default(this._primitive) && this._primitive.ready) {
+ this._completeLoad();
+ }
+ });
+};
+ClassificationPrimitive.prototype.getGeometryInstanceAttributes = function(id) {
+ if (!defined_default(this._primitive)) {
+ throw new DeveloperError_default(
+ "must call update before calling getGeometryInstanceAttributes"
+ );
+ }
+ return this._primitive.getGeometryInstanceAttributes(id);
+};
+ClassificationPrimitive.prototype.isDestroyed = function() {
+ return false;
+};
+ClassificationPrimitive.prototype.destroy = function() {
+ this._primitive = this._primitive && this._primitive.destroy();
+ this._sp = this._sp && this._sp.destroy();
+ this._spPick = this._spPick && this._spPick.destroy();
+ this._spColor = this._spColor && this._spColor.destroy();
+ this._spPick2D = void 0;
+ this._spColor2D = void 0;
+ return destroyObject_default(this);
+};
+var ClassificationPrimitive_default = ClassificationPrimitive;
+
+// Source/Scene/GroundPrimitive.js
+var GroundPrimitiveUniformMap = {
+ u_globeMinimumAltitude: function() {
+ return 55e3;
+ }
+};
+function GroundPrimitive(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ let appearance = options.appearance;
+ const geometryInstances = options.geometryInstances;
+ if (!defined_default(appearance) && defined_default(geometryInstances)) {
+ const geometryInstancesArray = Array.isArray(geometryInstances) ? geometryInstances : [geometryInstances];
+ const geometryInstanceCount = geometryInstancesArray.length;
+ for (let i = 0; i < geometryInstanceCount; i++) {
+ const attributes = geometryInstancesArray[i].attributes;
+ if (defined_default(attributes) && defined_default(attributes.color)) {
+ appearance = new PerInstanceColorAppearance_default({
+ flat: true
+ });
+ break;
+ }
+ }
+ }
+ this.appearance = appearance;
+ this.geometryInstances = options.geometryInstances;
+ this.show = defaultValue_default(options.show, true);
+ this.classificationType = defaultValue_default(
+ options.classificationType,
+ ClassificationType_default.BOTH
+ );
+ this.debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this.debugShowShadowVolume = defaultValue_default(
+ options.debugShowShadowVolume,
+ false
+ );
+ this._boundingVolumes = [];
+ this._boundingVolumes2D = [];
+ this._ready = false;
+ const groundPrimitive = this;
+ this._readyPromise = new Promise((resolve2, reject) => {
+ groundPrimitive._completeLoad = () => {
+ if (this._ready) {
+ return;
+ }
+ this._ready = true;
+ if (this.releaseGeometryInstances) {
+ this.geometryInstances = void 0;
+ }
+ const error = this._error;
+ if (!defined_default(error)) {
+ resolve2(this);
+ } else {
+ reject(error);
+ }
+ };
+ });
+ this._primitive = void 0;
+ this._maxHeight = void 0;
+ this._minHeight = void 0;
+ this._maxTerrainHeight = ApproximateTerrainHeights_default._defaultMaxTerrainHeight;
+ this._minTerrainHeight = ApproximateTerrainHeights_default._defaultMinTerrainHeight;
+ this._boundingSpheresKeys = [];
+ this._boundingSpheres = [];
+ this._useFragmentCulling = false;
+ this._zIndex = void 0;
+ const that = this;
+ this._classificationPrimitiveOptions = {
+ geometryInstances: void 0,
+ appearance: void 0,
+ vertexCacheOptimize: defaultValue_default(options.vertexCacheOptimize, false),
+ interleave: defaultValue_default(options.interleave, false),
+ releaseGeometryInstances: defaultValue_default(
+ options.releaseGeometryInstances,
+ true
+ ),
+ allowPicking: defaultValue_default(options.allowPicking, true),
+ asynchronous: defaultValue_default(options.asynchronous, true),
+ compressVertices: defaultValue_default(options.compressVertices, true),
+ _createBoundingVolumeFunction: void 0,
+ _updateAndQueueCommandsFunction: void 0,
+ _pickPrimitive: that,
+ _extruded: true,
+ _uniformMap: GroundPrimitiveUniformMap
+ };
+}
+Object.defineProperties(GroundPrimitive.prototype, {
+ vertexCacheOptimize: {
+ get: function() {
+ return this._classificationPrimitiveOptions.vertexCacheOptimize;
+ }
+ },
+ interleave: {
+ get: function() {
+ return this._classificationPrimitiveOptions.interleave;
+ }
+ },
+ releaseGeometryInstances: {
+ get: function() {
+ return this._classificationPrimitiveOptions.releaseGeometryInstances;
+ }
+ },
+ allowPicking: {
+ get: function() {
+ return this._classificationPrimitiveOptions.allowPicking;
+ }
+ },
+ asynchronous: {
+ get: function() {
+ return this._classificationPrimitiveOptions.asynchronous;
+ }
+ },
+ compressVertices: {
+ get: function() {
+ return this._classificationPrimitiveOptions.compressVertices;
+ }
+ },
+ ready: {
+ get: function() {
+ return this._ready;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ }
+});
+GroundPrimitive.isSupported = ClassificationPrimitive_default.isSupported;
+function getComputeMaximumHeightFunction(primitive) {
+ return function(granularity, ellipsoid) {
+ const r = ellipsoid.maximumRadius;
+ const delta = r / Math.cos(granularity * 0.5) - r;
+ return primitive._maxHeight + delta;
+ };
+}
+function getComputeMinimumHeightFunction(primitive) {
+ return function(granularity, ellipsoid) {
+ return primitive._minHeight;
+ };
+}
+var scratchBVCartesianHigh = new Cartesian3_default();
+var scratchBVCartesianLow = new Cartesian3_default();
+var scratchBVCartesian = new Cartesian3_default();
+var scratchBVCartographic = new Cartographic_default();
+var scratchBVRectangle = new Rectangle_default();
+function getRectangle(frameState, geometry) {
+ const ellipsoid = frameState.mapProjection.ellipsoid;
+ if (!defined_default(geometry.attributes) || !defined_default(geometry.attributes.position3DHigh)) {
+ if (defined_default(geometry.rectangle)) {
+ return geometry.rectangle;
+ }
+ return void 0;
+ }
+ const highPositions = geometry.attributes.position3DHigh.values;
+ const lowPositions = geometry.attributes.position3DLow.values;
+ const length3 = highPositions.length;
+ let minLat = Number.POSITIVE_INFINITY;
+ let minLon = Number.POSITIVE_INFINITY;
+ let maxLat = Number.NEGATIVE_INFINITY;
+ let maxLon = Number.NEGATIVE_INFINITY;
+ for (let i = 0; i < length3; i += 3) {
+ const highPosition = Cartesian3_default.unpack(
+ highPositions,
+ i,
+ scratchBVCartesianHigh
+ );
+ const lowPosition = Cartesian3_default.unpack(
+ lowPositions,
+ i,
+ scratchBVCartesianLow
+ );
+ const position = Cartesian3_default.add(
+ highPosition,
+ lowPosition,
+ scratchBVCartesian
+ );
+ const cartographic2 = ellipsoid.cartesianToCartographic(
+ position,
+ scratchBVCartographic
+ );
+ const latitude = cartographic2.latitude;
+ const longitude = cartographic2.longitude;
+ minLat = Math.min(minLat, latitude);
+ minLon = Math.min(minLon, longitude);
+ maxLat = Math.max(maxLat, latitude);
+ maxLon = Math.max(maxLon, longitude);
+ }
+ const rectangle = scratchBVRectangle;
+ rectangle.north = maxLat;
+ rectangle.south = minLat;
+ rectangle.east = maxLon;
+ rectangle.west = minLon;
+ return rectangle;
+}
+function setMinMaxTerrainHeights(primitive, rectangle, ellipsoid) {
+ const result = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ rectangle,
+ ellipsoid
+ );
+ primitive._minTerrainHeight = result.minimumTerrainHeight;
+ primitive._maxTerrainHeight = result.maximumTerrainHeight;
+}
+function createBoundingVolume(groundPrimitive, frameState, geometry) {
+ const ellipsoid = frameState.mapProjection.ellipsoid;
+ const rectangle = getRectangle(frameState, geometry);
+ const obb = OrientedBoundingBox_default.fromRectangle(
+ rectangle,
+ groundPrimitive._minHeight,
+ groundPrimitive._maxHeight,
+ ellipsoid
+ );
+ groundPrimitive._boundingVolumes.push(obb);
+ if (!frameState.scene3DOnly) {
+ const projection = frameState.mapProjection;
+ const boundingVolume = BoundingSphere_default.fromRectangleWithHeights2D(
+ rectangle,
+ projection,
+ groundPrimitive._maxHeight,
+ groundPrimitive._minHeight
+ );
+ Cartesian3_default.fromElements(
+ boundingVolume.center.z,
+ boundingVolume.center.x,
+ boundingVolume.center.y,
+ boundingVolume.center
+ );
+ groundPrimitive._boundingVolumes2D.push(boundingVolume);
+ }
+}
+function boundingVolumeIndex2(commandIndex, length3) {
+ return Math.floor(commandIndex % length3 / 2);
+}
+function updateAndQueueRenderCommand2(groundPrimitive, command, frameState, modelMatrix, cull, boundingVolume, debugShowBoundingVolume2) {
+ const classificationPrimitive = groundPrimitive._primitive;
+ if (frameState.mode !== SceneMode_default.SCENE3D && command.shaderProgram === classificationPrimitive._spColor && classificationPrimitive._needs2DShader) {
+ command = command.derivedCommands.appearance2D;
+ }
+ command.owner = groundPrimitive;
+ command.modelMatrix = modelMatrix;
+ command.boundingVolume = boundingVolume;
+ command.cull = cull;
+ command.debugShowBoundingVolume = debugShowBoundingVolume2;
+ frameState.commandList.push(command);
+}
+function updateAndQueuePickCommand2(groundPrimitive, command, frameState, modelMatrix, cull, boundingVolume) {
+ const classificationPrimitive = groundPrimitive._primitive;
+ if (frameState.mode !== SceneMode_default.SCENE3D && command.shaderProgram === classificationPrimitive._spPick && classificationPrimitive._needs2DShader) {
+ command = command.derivedCommands.pick2D;
+ }
+ command.owner = groundPrimitive;
+ command.modelMatrix = modelMatrix;
+ command.boundingVolume = boundingVolume;
+ command.cull = cull;
+ frameState.commandList.push(command);
+}
+function updateAndQueueCommands3(groundPrimitive, frameState, colorCommands, pickCommands, modelMatrix, cull, debugShowBoundingVolume2, twoPasses) {
+ let boundingVolumes;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ boundingVolumes = groundPrimitive._boundingVolumes;
+ } else {
+ boundingVolumes = groundPrimitive._boundingVolumes2D;
+ }
+ const classificationType = groundPrimitive.classificationType;
+ const queueTerrainCommands = classificationType !== ClassificationType_default.CESIUM_3D_TILE;
+ const queue3DTilesCommands = classificationType !== ClassificationType_default.TERRAIN;
+ const passes = frameState.passes;
+ const classificationPrimitive = groundPrimitive._primitive;
+ let i;
+ let boundingVolume;
+ let command;
+ if (passes.render) {
+ const colorLength = colorCommands.length;
+ for (i = 0; i < colorLength; ++i) {
+ boundingVolume = boundingVolumes[boundingVolumeIndex2(i, colorLength)];
+ if (queueTerrainCommands) {
+ command = colorCommands[i];
+ updateAndQueueRenderCommand2(
+ groundPrimitive,
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume,
+ debugShowBoundingVolume2
+ );
+ }
+ if (queue3DTilesCommands) {
+ command = colorCommands[i].derivedCommands.tileset;
+ updateAndQueueRenderCommand2(
+ groundPrimitive,
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume,
+ debugShowBoundingVolume2
+ );
+ }
+ }
+ if (frameState.invertClassification) {
+ const ignoreShowCommands = classificationPrimitive._commandsIgnoreShow;
+ const ignoreShowCommandsLength = ignoreShowCommands.length;
+ for (i = 0; i < ignoreShowCommandsLength; ++i) {
+ boundingVolume = boundingVolumes[i];
+ command = ignoreShowCommands[i];
+ updateAndQueueRenderCommand2(
+ groundPrimitive,
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume,
+ debugShowBoundingVolume2
+ );
+ }
+ }
+ }
+ if (passes.pick) {
+ const pickLength = pickCommands.length;
+ let pickOffsets;
+ if (!groundPrimitive._useFragmentCulling) {
+ pickOffsets = classificationPrimitive._primitive._pickOffsets;
+ }
+ for (i = 0; i < pickLength; ++i) {
+ boundingVolume = boundingVolumes[boundingVolumeIndex2(i, pickLength)];
+ if (!groundPrimitive._useFragmentCulling) {
+ const pickOffset = pickOffsets[boundingVolumeIndex2(i, pickLength)];
+ boundingVolume = boundingVolumes[pickOffset.index];
+ }
+ if (queueTerrainCommands) {
+ command = pickCommands[i];
+ updateAndQueuePickCommand2(
+ groundPrimitive,
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume
+ );
+ }
+ if (queue3DTilesCommands) {
+ command = pickCommands[i].derivedCommands.tileset;
+ updateAndQueuePickCommand2(
+ groundPrimitive,
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume
+ );
+ }
+ }
+ }
+}
+GroundPrimitive.initializeTerrainHeights = function() {
+ return ApproximateTerrainHeights_default.initialize();
+};
+GroundPrimitive.prototype.update = function(frameState) {
+ if (!defined_default(this._primitive) && !defined_default(this.geometryInstances)) {
+ return;
+ }
+ if (!ApproximateTerrainHeights_default.initialized) {
+ if (!this.asynchronous) {
+ throw new DeveloperError_default(
+ "For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve."
+ );
+ }
+ GroundPrimitive.initializeTerrainHeights();
+ return;
+ }
+ const that = this;
+ const primitiveOptions = this._classificationPrimitiveOptions;
+ if (!defined_default(this._primitive)) {
+ const ellipsoid = frameState.mapProjection.ellipsoid;
+ let instance;
+ let geometry;
+ let instanceType;
+ const instances = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances];
+ const length3 = instances.length;
+ const groundInstances = new Array(length3);
+ let i;
+ let rectangle;
+ for (i = 0; i < length3; ++i) {
+ instance = instances[i];
+ geometry = instance.geometry;
+ const instanceRectangle = getRectangle(frameState, geometry);
+ if (!defined_default(rectangle)) {
+ rectangle = Rectangle_default.clone(instanceRectangle);
+ } else if (defined_default(instanceRectangle)) {
+ Rectangle_default.union(rectangle, instanceRectangle, rectangle);
+ }
+ const id = instance.id;
+ if (defined_default(id) && defined_default(instanceRectangle)) {
+ const boundingSphere = ApproximateTerrainHeights_default.getBoundingSphere(
+ instanceRectangle,
+ ellipsoid
+ );
+ this._boundingSpheresKeys.push(id);
+ this._boundingSpheres.push(boundingSphere);
+ }
+ instanceType = geometry.constructor;
+ if (!defined_default(instanceType) || !defined_default(instanceType.createShadowVolume)) {
+ throw new DeveloperError_default(
+ "Not all of the geometry instances have GroundPrimitive support."
+ );
+ }
+ }
+ setMinMaxTerrainHeights(this, rectangle, ellipsoid);
+ const exaggeration = frameState.terrainExaggeration;
+ const exaggerationRelativeHeight = frameState.terrainExaggerationRelativeHeight;
+ this._minHeight = TerrainExaggeration_default.getHeight(
+ this._minTerrainHeight,
+ exaggeration,
+ exaggerationRelativeHeight
+ );
+ this._maxHeight = TerrainExaggeration_default.getHeight(
+ this._maxTerrainHeight,
+ exaggeration,
+ exaggerationRelativeHeight
+ );
+ const useFragmentCulling = GroundPrimitive._supportsMaterials(
+ frameState.context
+ );
+ this._useFragmentCulling = useFragmentCulling;
+ if (useFragmentCulling) {
+ let attributes;
+ let usePlanarExtents = true;
+ for (i = 0; i < length3; ++i) {
+ instance = instances[i];
+ geometry = instance.geometry;
+ rectangle = getRectangle(frameState, geometry);
+ if (ShadowVolumeAppearance_default.shouldUseSphericalCoordinates(rectangle)) {
+ usePlanarExtents = false;
+ break;
+ }
+ }
+ for (i = 0; i < length3; ++i) {
+ instance = instances[i];
+ geometry = instance.geometry;
+ instanceType = geometry.constructor;
+ const boundingRectangle = getRectangle(frameState, geometry);
+ const textureCoordinateRotationPoints4 = geometry.textureCoordinateRotationPoints;
+ if (usePlanarExtents) {
+ attributes = ShadowVolumeAppearance_default.getPlanarTextureCoordinateAttributes(
+ boundingRectangle,
+ textureCoordinateRotationPoints4,
+ ellipsoid,
+ frameState.mapProjection,
+ this._maxHeight
+ );
+ } else {
+ attributes = ShadowVolumeAppearance_default.getSphericalExtentGeometryInstanceAttributes(
+ boundingRectangle,
+ textureCoordinateRotationPoints4,
+ ellipsoid,
+ frameState.mapProjection
+ );
+ }
+ const instanceAttributes = instance.attributes;
+ for (const attributeKey in instanceAttributes) {
+ if (instanceAttributes.hasOwnProperty(attributeKey)) {
+ attributes[attributeKey] = instanceAttributes[attributeKey];
+ }
+ }
+ groundInstances[i] = new GeometryInstance_default({
+ geometry: instanceType.createShadowVolume(
+ geometry,
+ getComputeMinimumHeightFunction(this),
+ getComputeMaximumHeightFunction(this)
+ ),
+ attributes,
+ id: instance.id
+ });
+ }
+ } else {
+ for (i = 0; i < length3; ++i) {
+ instance = instances[i];
+ geometry = instance.geometry;
+ instanceType = geometry.constructor;
+ groundInstances[i] = new GeometryInstance_default({
+ geometry: instanceType.createShadowVolume(
+ geometry,
+ getComputeMinimumHeightFunction(this),
+ getComputeMaximumHeightFunction(this)
+ ),
+ attributes: instance.attributes,
+ id: instance.id
+ });
+ }
+ }
+ primitiveOptions.geometryInstances = groundInstances;
+ primitiveOptions.appearance = this.appearance;
+ primitiveOptions._createBoundingVolumeFunction = function(frameState2, geometry2) {
+ createBoundingVolume(that, frameState2, geometry2);
+ };
+ primitiveOptions._updateAndQueueCommandsFunction = function(primitive, frameState2, colorCommands, pickCommands, modelMatrix, cull, debugShowBoundingVolume2, twoPasses) {
+ updateAndQueueCommands3(
+ that,
+ frameState2,
+ colorCommands,
+ pickCommands,
+ modelMatrix,
+ cull,
+ debugShowBoundingVolume2,
+ twoPasses
+ );
+ };
+ this._primitive = new ClassificationPrimitive_default(primitiveOptions);
+ }
+ this._primitive.appearance = this.appearance;
+ this._primitive.show = this.show;
+ this._primitive.debugShowShadowVolume = this.debugShowShadowVolume;
+ this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;
+ this._primitive.update(frameState);
+ frameState.afterRender.push(() => {
+ if (defined_default(this._primitive) && this._primitive.ready) {
+ this._completeLoad();
+ }
+ });
+};
+GroundPrimitive.prototype.getBoundingSphere = function(id) {
+ const index = this._boundingSpheresKeys.indexOf(id);
+ if (index !== -1) {
+ return this._boundingSpheres[index];
+ }
+ return void 0;
+};
+GroundPrimitive.prototype.getGeometryInstanceAttributes = function(id) {
+ if (!defined_default(this._primitive)) {
+ throw new DeveloperError_default(
+ "must call update before calling getGeometryInstanceAttributes"
+ );
+ }
+ return this._primitive.getGeometryInstanceAttributes(id);
+};
+GroundPrimitive.prototype.isDestroyed = function() {
+ return false;
+};
+GroundPrimitive.prototype.destroy = function() {
+ this._primitive = this._primitive && this._primitive.destroy();
+ return destroyObject_default(this);
+};
+GroundPrimitive._supportsMaterials = function(context) {
+ return context.depthTexture;
+};
+GroundPrimitive.supportsMaterials = function(scene) {
+ Check_default.typeOf.object("scene", scene);
+ return GroundPrimitive._supportsMaterials(scene.frameState.context);
+};
+var GroundPrimitive_default = GroundPrimitive;
+
+// Source/DataSources/MaterialProperty.js
+function MaterialProperty() {
+ DeveloperError_default.throwInstantiationError();
+}
+Object.defineProperties(MaterialProperty.prototype, {
+ isConstant: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ definitionChanged: {
+ get: DeveloperError_default.throwInstantiationError
+ }
+});
+MaterialProperty.prototype.getType = DeveloperError_default.throwInstantiationError;
+MaterialProperty.prototype.getValue = DeveloperError_default.throwInstantiationError;
+MaterialProperty.prototype.equals = DeveloperError_default.throwInstantiationError;
+MaterialProperty.getValue = function(time, materialProperty, material) {
+ let type;
+ if (defined_default(materialProperty)) {
+ type = materialProperty.getType(time);
+ if (defined_default(type)) {
+ if (!defined_default(material) || material.type !== type) {
+ material = Material_default.fromType(type);
+ }
+ materialProperty.getValue(time, material.uniforms);
+ return material;
+ }
+ }
+ if (!defined_default(material) || material.type !== Material_default.ColorType) {
+ material = Material_default.fromType(Material_default.ColorType);
+ }
+ Color_default.clone(Color_default.WHITE, material.uniforms.color);
+ return material;
+};
+var MaterialProperty_default = MaterialProperty;
+
+// Source/DataSources/DynamicGeometryUpdater.js
+function DynamicGeometryUpdater(geometryUpdater, primitives, orderedGroundPrimitives) {
+ Check_default.defined("geometryUpdater", geometryUpdater);
+ Check_default.defined("primitives", primitives);
+ Check_default.defined("orderedGroundPrimitives", orderedGroundPrimitives);
+ this._primitives = primitives;
+ this._orderedGroundPrimitives = orderedGroundPrimitives;
+ this._primitive = void 0;
+ this._outlinePrimitive = void 0;
+ this._geometryUpdater = geometryUpdater;
+ this._options = geometryUpdater._options;
+ this._entity = geometryUpdater._entity;
+ this._material = void 0;
+}
+DynamicGeometryUpdater.prototype._isHidden = function(entity, geometry, time) {
+ return !entity.isShowing || !entity.isAvailable(time) || !Property_default.getValueOrDefault(geometry.show, time, true);
+};
+DynamicGeometryUpdater.prototype._setOptions = DeveloperError_default.throwInstantiationError;
+DynamicGeometryUpdater.prototype.update = function(time) {
+ Check_default.defined("time", time);
+ const geometryUpdater = this._geometryUpdater;
+ const onTerrain = geometryUpdater._onTerrain;
+ const primitives = this._primitives;
+ const orderedGroundPrimitives = this._orderedGroundPrimitives;
+ if (onTerrain) {
+ orderedGroundPrimitives.remove(this._primitive);
+ } else {
+ primitives.removeAndDestroy(this._primitive);
+ primitives.removeAndDestroy(this._outlinePrimitive);
+ this._outlinePrimitive = void 0;
+ }
+ this._primitive = void 0;
+ const entity = this._entity;
+ const geometry = entity[this._geometryUpdater._geometryPropertyName];
+ this._setOptions(entity, geometry, time);
+ if (this._isHidden(entity, geometry, time)) {
+ return;
+ }
+ const shadows = this._geometryUpdater.shadowsProperty.getValue(time);
+ const options = this._options;
+ if (!defined_default(geometry.fill) || geometry.fill.getValue(time)) {
+ const fillMaterialProperty = geometryUpdater.fillMaterialProperty;
+ const isColorAppearance = fillMaterialProperty instanceof ColorMaterialProperty_default;
+ let appearance;
+ const closed = geometryUpdater._getIsClosed(options);
+ if (isColorAppearance) {
+ appearance = new PerInstanceColorAppearance_default({
+ closed,
+ flat: onTerrain && !geometryUpdater._supportsMaterialsforEntitiesOnTerrain
+ });
+ } else {
+ const material = MaterialProperty_default.getValue(
+ time,
+ fillMaterialProperty,
+ this._material
+ );
+ this._material = material;
+ appearance = new MaterialAppearance_default({
+ material,
+ translucent: material.isTranslucent(),
+ closed
+ });
+ }
+ if (onTerrain) {
+ options.vertexFormat = PerInstanceColorAppearance_default.VERTEX_FORMAT;
+ this._primitive = orderedGroundPrimitives.add(
+ new GroundPrimitive_default({
+ geometryInstances: this._geometryUpdater.createFillGeometryInstance(
+ time
+ ),
+ appearance,
+ asynchronous: false,
+ shadows,
+ classificationType: this._geometryUpdater.classificationTypeProperty.getValue(
+ time
+ )
+ }),
+ Property_default.getValueOrUndefined(this._geometryUpdater.zIndex, time)
+ );
+ } else {
+ options.vertexFormat = appearance.vertexFormat;
+ const fillInstance = this._geometryUpdater.createFillGeometryInstance(
+ time
+ );
+ if (isColorAppearance) {
+ appearance.translucent = fillInstance.attributes.color.value[3] !== 255;
+ }
+ this._primitive = primitives.add(
+ new Primitive_default({
+ geometryInstances: fillInstance,
+ appearance,
+ asynchronous: false,
+ shadows
+ })
+ );
+ }
+ }
+ if (!onTerrain && defined_default(geometry.outline) && geometry.outline.getValue(time)) {
+ const outlineInstance = this._geometryUpdater.createOutlineGeometryInstance(
+ time
+ );
+ const outlineWidth = Property_default.getValueOrDefault(
+ geometry.outlineWidth,
+ time,
+ 1
+ );
+ this._outlinePrimitive = primitives.add(
+ new Primitive_default({
+ geometryInstances: outlineInstance,
+ appearance: new PerInstanceColorAppearance_default({
+ flat: true,
+ translucent: outlineInstance.attributes.color.value[3] !== 255,
+ renderState: {
+ lineWidth: geometryUpdater._scene.clampLineWidth(outlineWidth)
+ }
+ }),
+ asynchronous: false,
+ shadows
+ })
+ );
+ }
+};
+DynamicGeometryUpdater.prototype.getBoundingSphere = function(result) {
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const entity = this._entity;
+ const primitive = this._primitive;
+ const outlinePrimitive = this._outlinePrimitive;
+ let attributes;
+ if (defined_default(primitive) && primitive.show && primitive.ready) {
+ attributes = primitive.getGeometryInstanceAttributes(entity);
+ if (defined_default(attributes) && defined_default(attributes.boundingSphere)) {
+ BoundingSphere_default.clone(attributes.boundingSphere, result);
+ return BoundingSphereState_default.DONE;
+ }
+ }
+ if (defined_default(outlinePrimitive) && outlinePrimitive.show && outlinePrimitive.ready) {
+ attributes = outlinePrimitive.getGeometryInstanceAttributes(entity);
+ if (defined_default(attributes) && defined_default(attributes.boundingSphere)) {
+ BoundingSphere_default.clone(attributes.boundingSphere, result);
+ return BoundingSphereState_default.DONE;
+ }
+ }
+ if (defined_default(primitive) && !primitive.ready || defined_default(outlinePrimitive) && !outlinePrimitive.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ return BoundingSphereState_default.FAILED;
+};
+DynamicGeometryUpdater.prototype.isDestroyed = function() {
+ return false;
+};
+DynamicGeometryUpdater.prototype.destroy = function() {
+ const primitives = this._primitives;
+ const orderedGroundPrimitives = this._orderedGroundPrimitives;
+ if (this._geometryUpdater._onTerrain) {
+ orderedGroundPrimitives.remove(this._primitive);
+ } else {
+ primitives.removeAndDestroy(this._primitive);
+ }
+ primitives.removeAndDestroy(this._outlinePrimitive);
+ destroyObject_default(this);
+};
+var DynamicGeometryUpdater_default = DynamicGeometryUpdater;
+
+// Source/Core/oneTimeWarning.js
+var warnings = {};
+function oneTimeWarning(identifier, message) {
+ if (!defined_default(identifier)) {
+ throw new DeveloperError_default("identifier is required.");
+ }
+ if (!defined_default(warnings[identifier])) {
+ warnings[identifier] = true;
+ console.warn(defaultValue_default(message, identifier));
+ }
+}
+oneTimeWarning.geometryOutlines = "Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";
+oneTimeWarning.geometryZIndex = "Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";
+oneTimeWarning.geometryHeightReference = "Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";
+oneTimeWarning.geometryExtrudedHeightReference = "Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";
+var oneTimeWarning_default = oneTimeWarning;
+
+// Source/Core/ArcType.js
+var ArcType = {
+ NONE: 0,
+ GEODESIC: 1,
+ RHUMB: 2
+};
+var ArcType_default = Object.freeze(ArcType);
+
+// Source/Core/arrayRemoveDuplicates.js
+var removeDuplicatesEpsilon = Math_default.EPSILON10;
+function arrayRemoveDuplicates(values, equalsEpsilon, wrapAround, removedIndices) {
+ Check_default.defined("equalsEpsilon", equalsEpsilon);
+ if (!defined_default(values)) {
+ return void 0;
+ }
+ wrapAround = defaultValue_default(wrapAround, false);
+ const storeRemovedIndices = defined_default(removedIndices);
+ const length3 = values.length;
+ if (length3 < 2) {
+ return values;
+ }
+ let i;
+ let v02 = values[0];
+ let v13;
+ let cleanedValues;
+ let lastCleanIndex = 0;
+ let removedIndexLCI = -1;
+ for (i = 1; i < length3; ++i) {
+ v13 = values[i];
+ if (equalsEpsilon(v02, v13, removeDuplicatesEpsilon)) {
+ if (!defined_default(cleanedValues)) {
+ cleanedValues = values.slice(0, i);
+ lastCleanIndex = i - 1;
+ removedIndexLCI = 0;
+ }
+ if (storeRemovedIndices) {
+ removedIndices.push(i);
+ }
+ } else {
+ if (defined_default(cleanedValues)) {
+ cleanedValues.push(v13);
+ lastCleanIndex = i;
+ if (storeRemovedIndices) {
+ removedIndexLCI = removedIndices.length;
+ }
+ }
+ v02 = v13;
+ }
+ }
+ if (wrapAround && equalsEpsilon(values[0], values[length3 - 1], removeDuplicatesEpsilon)) {
+ if (storeRemovedIndices) {
+ if (defined_default(cleanedValues)) {
+ removedIndices.splice(removedIndexLCI, 0, lastCleanIndex);
+ } else {
+ removedIndices.push(length3 - 1);
+ }
+ }
+ if (defined_default(cleanedValues)) {
+ cleanedValues.length -= 1;
+ } else {
+ cleanedValues = values.slice(0, -1);
+ }
+ }
+ return defined_default(cleanedValues) ? cleanedValues : values;
+}
+var arrayRemoveDuplicates_default = arrayRemoveDuplicates;
+
+// Source/Core/EllipsoidGeodesic.js
+function setConstants(ellipsoidGeodesic3) {
+ const uSquared = ellipsoidGeodesic3._uSquared;
+ const a3 = ellipsoidGeodesic3._ellipsoid.maximumRadius;
+ const b = ellipsoidGeodesic3._ellipsoid.minimumRadius;
+ const f = (a3 - b) / a3;
+ const cosineHeading = Math.cos(ellipsoidGeodesic3._startHeading);
+ const sineHeading = Math.sin(ellipsoidGeodesic3._startHeading);
+ const tanU = (1 - f) * Math.tan(ellipsoidGeodesic3._start.latitude);
+ const cosineU = 1 / Math.sqrt(1 + tanU * tanU);
+ const sineU = cosineU * tanU;
+ const sigma = Math.atan2(tanU, cosineHeading);
+ const sineAlpha = cosineU * sineHeading;
+ const sineSquaredAlpha = sineAlpha * sineAlpha;
+ const cosineSquaredAlpha = 1 - sineSquaredAlpha;
+ const cosineAlpha = Math.sqrt(cosineSquaredAlpha);
+ const u2Over4 = uSquared / 4;
+ const u4Over16 = u2Over4 * u2Over4;
+ const u6Over64 = u4Over16 * u2Over4;
+ const u8Over256 = u4Over16 * u4Over16;
+ const a0 = 1 + u2Over4 - 3 * u4Over16 / 4 + 5 * u6Over64 / 4 - 175 * u8Over256 / 64;
+ const a1 = 1 - u2Over4 + 15 * u4Over16 / 8 - 35 * u6Over64 / 8;
+ const a22 = 1 - 3 * u2Over4 + 35 * u4Over16 / 4;
+ const a32 = 1 - 5 * u2Over4;
+ const distanceRatio = a0 * sigma - a1 * Math.sin(2 * sigma) * u2Over4 / 2 - a22 * Math.sin(4 * sigma) * u4Over16 / 16 - a32 * Math.sin(6 * sigma) * u6Over64 / 48 - Math.sin(8 * sigma) * 5 * u8Over256 / 512;
+ const constants = ellipsoidGeodesic3._constants;
+ constants.a = a3;
+ constants.b = b;
+ constants.f = f;
+ constants.cosineHeading = cosineHeading;
+ constants.sineHeading = sineHeading;
+ constants.tanU = tanU;
+ constants.cosineU = cosineU;
+ constants.sineU = sineU;
+ constants.sigma = sigma;
+ constants.sineAlpha = sineAlpha;
+ constants.sineSquaredAlpha = sineSquaredAlpha;
+ constants.cosineSquaredAlpha = cosineSquaredAlpha;
+ constants.cosineAlpha = cosineAlpha;
+ constants.u2Over4 = u2Over4;
+ constants.u4Over16 = u4Over16;
+ constants.u6Over64 = u6Over64;
+ constants.u8Over256 = u8Over256;
+ constants.a0 = a0;
+ constants.a1 = a1;
+ constants.a2 = a22;
+ constants.a3 = a32;
+ constants.distanceRatio = distanceRatio;
+}
+function computeC(f, cosineSquaredAlpha) {
+ return f * cosineSquaredAlpha * (4 + f * (4 - 3 * cosineSquaredAlpha)) / 16;
+}
+function computeDeltaLambda(f, sineAlpha, cosineSquaredAlpha, sigma, sineSigma, cosineSigma, cosineTwiceSigmaMidpoint) {
+ const C = computeC(f, cosineSquaredAlpha);
+ return (1 - C) * f * sineAlpha * (sigma + C * sineSigma * (cosineTwiceSigmaMidpoint + C * cosineSigma * (2 * cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint - 1)));
+}
+function vincentyInverseFormula(ellipsoidGeodesic3, major, minor, firstLongitude, firstLatitude, secondLongitude, secondLatitude) {
+ const eff = (major - minor) / major;
+ const l = secondLongitude - firstLongitude;
+ const u12 = Math.atan((1 - eff) * Math.tan(firstLatitude));
+ const u22 = Math.atan((1 - eff) * Math.tan(secondLatitude));
+ const cosineU1 = Math.cos(u12);
+ const sineU1 = Math.sin(u12);
+ const cosineU2 = Math.cos(u22);
+ const sineU2 = Math.sin(u22);
+ const cc = cosineU1 * cosineU2;
+ const cs = cosineU1 * sineU2;
+ const ss = sineU1 * sineU2;
+ const sc = sineU1 * cosineU2;
+ let lambda = l;
+ let lambdaDot = Math_default.TWO_PI;
+ let cosineLambda = Math.cos(lambda);
+ let sineLambda = Math.sin(lambda);
+ let sigma;
+ let cosineSigma;
+ let sineSigma;
+ let cosineSquaredAlpha;
+ let cosineTwiceSigmaMidpoint;
+ do {
+ cosineLambda = Math.cos(lambda);
+ sineLambda = Math.sin(lambda);
+ const temp = cs - sc * cosineLambda;
+ sineSigma = Math.sqrt(
+ cosineU2 * cosineU2 * sineLambda * sineLambda + temp * temp
+ );
+ cosineSigma = ss + cc * cosineLambda;
+ sigma = Math.atan2(sineSigma, cosineSigma);
+ let sineAlpha;
+ if (sineSigma === 0) {
+ sineAlpha = 0;
+ cosineSquaredAlpha = 1;
+ } else {
+ sineAlpha = cc * sineLambda / sineSigma;
+ cosineSquaredAlpha = 1 - sineAlpha * sineAlpha;
+ }
+ lambdaDot = lambda;
+ cosineTwiceSigmaMidpoint = cosineSigma - 2 * ss / cosineSquaredAlpha;
+ if (!isFinite(cosineTwiceSigmaMidpoint)) {
+ cosineTwiceSigmaMidpoint = 0;
+ }
+ lambda = l + computeDeltaLambda(
+ eff,
+ sineAlpha,
+ cosineSquaredAlpha,
+ sigma,
+ sineSigma,
+ cosineSigma,
+ cosineTwiceSigmaMidpoint
+ );
+ } while (Math.abs(lambda - lambdaDot) > Math_default.EPSILON12);
+ const uSquared = cosineSquaredAlpha * (major * major - minor * minor) / (minor * minor);
+ const A = 1 + uSquared * (4096 + uSquared * (uSquared * (320 - 175 * uSquared) - 768)) / 16384;
+ const B = uSquared * (256 + uSquared * (uSquared * (74 - 47 * uSquared) - 128)) / 1024;
+ const cosineSquaredTwiceSigmaMidpoint = cosineTwiceSigmaMidpoint * cosineTwiceSigmaMidpoint;
+ const deltaSigma = B * sineSigma * (cosineTwiceSigmaMidpoint + B * (cosineSigma * (2 * cosineSquaredTwiceSigmaMidpoint - 1) - B * cosineTwiceSigmaMidpoint * (4 * sineSigma * sineSigma - 3) * (4 * cosineSquaredTwiceSigmaMidpoint - 3) / 6) / 4);
+ const distance2 = minor * A * (sigma - deltaSigma);
+ const startHeading = Math.atan2(
+ cosineU2 * sineLambda,
+ cs - sc * cosineLambda
+ );
+ const endHeading = Math.atan2(cosineU1 * sineLambda, cs * cosineLambda - sc);
+ ellipsoidGeodesic3._distance = distance2;
+ ellipsoidGeodesic3._startHeading = startHeading;
+ ellipsoidGeodesic3._endHeading = endHeading;
+ ellipsoidGeodesic3._uSquared = uSquared;
+}
+var scratchCart1 = new Cartesian3_default();
+var scratchCart2 = new Cartesian3_default();
+function computeProperties(ellipsoidGeodesic3, start, end, ellipsoid) {
+ const firstCartesian = Cartesian3_default.normalize(
+ ellipsoid.cartographicToCartesian(start, scratchCart2),
+ scratchCart1
+ );
+ const lastCartesian = Cartesian3_default.normalize(
+ ellipsoid.cartographicToCartesian(end, scratchCart2),
+ scratchCart2
+ );
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "value",
+ Math.abs(
+ Math.abs(Cartesian3_default.angleBetween(firstCartesian, lastCartesian)) - Math.PI
+ ),
+ 0.0125
+ );
+ vincentyInverseFormula(
+ ellipsoidGeodesic3,
+ ellipsoid.maximumRadius,
+ ellipsoid.minimumRadius,
+ start.longitude,
+ start.latitude,
+ end.longitude,
+ end.latitude
+ );
+ ellipsoidGeodesic3._start = Cartographic_default.clone(
+ start,
+ ellipsoidGeodesic3._start
+ );
+ ellipsoidGeodesic3._end = Cartographic_default.clone(end, ellipsoidGeodesic3._end);
+ ellipsoidGeodesic3._start.height = 0;
+ ellipsoidGeodesic3._end.height = 0;
+ setConstants(ellipsoidGeodesic3);
+}
+function EllipsoidGeodesic(start, end, ellipsoid) {
+ const e = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ this._ellipsoid = e;
+ this._start = new Cartographic_default();
+ this._end = new Cartographic_default();
+ this._constants = {};
+ this._startHeading = void 0;
+ this._endHeading = void 0;
+ this._distance = void 0;
+ this._uSquared = void 0;
+ if (defined_default(start) && defined_default(end)) {
+ computeProperties(this, start, end, e);
+ }
+}
+Object.defineProperties(EllipsoidGeodesic.prototype, {
+ ellipsoid: {
+ get: function() {
+ return this._ellipsoid;
+ }
+ },
+ surfaceDistance: {
+ get: function() {
+ Check_default.defined("distance", this._distance);
+ return this._distance;
+ }
+ },
+ start: {
+ get: function() {
+ return this._start;
+ }
+ },
+ end: {
+ get: function() {
+ return this._end;
+ }
+ },
+ startHeading: {
+ get: function() {
+ Check_default.defined("distance", this._distance);
+ return this._startHeading;
+ }
+ },
+ endHeading: {
+ get: function() {
+ Check_default.defined("distance", this._distance);
+ return this._endHeading;
+ }
+ }
+});
+EllipsoidGeodesic.prototype.setEndPoints = function(start, end) {
+ Check_default.defined("start", start);
+ Check_default.defined("end", end);
+ computeProperties(this, start, end, this._ellipsoid);
+};
+EllipsoidGeodesic.prototype.interpolateUsingFraction = function(fraction, result) {
+ return this.interpolateUsingSurfaceDistance(
+ this._distance * fraction,
+ result
+ );
+};
+EllipsoidGeodesic.prototype.interpolateUsingSurfaceDistance = function(distance2, result) {
+ Check_default.defined("distance", this._distance);
+ const constants = this._constants;
+ const s = constants.distanceRatio + distance2 / constants.b;
+ const cosine2S = Math.cos(2 * s);
+ const cosine4S = Math.cos(4 * s);
+ const cosine6S = Math.cos(6 * s);
+ const sine2S = Math.sin(2 * s);
+ const sine4S = Math.sin(4 * s);
+ const sine6S = Math.sin(6 * s);
+ const sine8S = Math.sin(8 * s);
+ const s2 = s * s;
+ const s3 = s * s2;
+ const u8Over256 = constants.u8Over256;
+ const u2Over4 = constants.u2Over4;
+ const u6Over64 = constants.u6Over64;
+ const u4Over16 = constants.u4Over16;
+ let sigma = 2 * s3 * u8Over256 * cosine2S / 3 + s * (1 - u2Over4 + 7 * u4Over16 / 4 - 15 * u6Over64 / 4 + 579 * u8Over256 / 64 - (u4Over16 - 15 * u6Over64 / 4 + 187 * u8Over256 / 16) * cosine2S - (5 * u6Over64 / 4 - 115 * u8Over256 / 16) * cosine4S - 29 * u8Over256 * cosine6S / 16) + (u2Over4 / 2 - u4Over16 + 71 * u6Over64 / 32 - 85 * u8Over256 / 16) * sine2S + (5 * u4Over16 / 16 - 5 * u6Over64 / 4 + 383 * u8Over256 / 96) * sine4S - s2 * ((u6Over64 - 11 * u8Over256 / 2) * sine2S + 5 * u8Over256 * sine4S / 2) + (29 * u6Over64 / 96 - 29 * u8Over256 / 16) * sine6S + 539 * u8Over256 * sine8S / 1536;
+ const theta = Math.asin(Math.sin(sigma) * constants.cosineAlpha);
+ const latitude = Math.atan(constants.a / constants.b * Math.tan(theta));
+ sigma = sigma - constants.sigma;
+ const cosineTwiceSigmaMidpoint = Math.cos(2 * constants.sigma + sigma);
+ const sineSigma = Math.sin(sigma);
+ const cosineSigma = Math.cos(sigma);
+ const cc = constants.cosineU * cosineSigma;
+ const ss = constants.sineU * sineSigma;
+ const lambda = Math.atan2(
+ sineSigma * constants.sineHeading,
+ cc - ss * constants.cosineHeading
+ );
+ const l = lambda - computeDeltaLambda(
+ constants.f,
+ constants.sineAlpha,
+ constants.cosineSquaredAlpha,
+ sigma,
+ sineSigma,
+ cosineSigma,
+ cosineTwiceSigmaMidpoint
+ );
+ if (defined_default(result)) {
+ result.longitude = this._start.longitude + l;
+ result.latitude = latitude;
+ result.height = 0;
+ return result;
+ }
+ return new Cartographic_default(this._start.longitude + l, latitude, 0);
+};
+var EllipsoidGeodesic_default = EllipsoidGeodesic;
+
+// Source/Core/EllipsoidRhumbLine.js
+function calculateM(ellipticity, major, latitude) {
+ if (ellipticity === 0) {
+ return major * latitude;
+ }
+ const e2 = ellipticity * ellipticity;
+ const e4 = e2 * e2;
+ const e6 = e4 * e2;
+ const e8 = e6 * e2;
+ const e10 = e8 * e2;
+ const e12 = e10 * e2;
+ const phi = latitude;
+ const sin2Phi = Math.sin(2 * phi);
+ const sin4Phi = Math.sin(4 * phi);
+ const sin6Phi = Math.sin(6 * phi);
+ const sin8Phi = Math.sin(8 * phi);
+ const sin10Phi = Math.sin(10 * phi);
+ const sin12Phi = Math.sin(12 * phi);
+ return major * ((1 - e2 / 4 - 3 * e4 / 64 - 5 * e6 / 256 - 175 * e8 / 16384 - 441 * e10 / 65536 - 4851 * e12 / 1048576) * phi - (3 * e2 / 8 + 3 * e4 / 32 + 45 * e6 / 1024 + 105 * e8 / 4096 + 2205 * e10 / 131072 + 6237 * e12 / 524288) * sin2Phi + (15 * e4 / 256 + 45 * e6 / 1024 + 525 * e8 / 16384 + 1575 * e10 / 65536 + 155925 * e12 / 8388608) * sin4Phi - (35 * e6 / 3072 + 175 * e8 / 12288 + 3675 * e10 / 262144 + 13475 * e12 / 1048576) * sin6Phi + (315 * e8 / 131072 + 2205 * e10 / 524288 + 43659 * e12 / 8388608) * sin8Phi - (693 * e10 / 1310720 + 6237 * e12 / 5242880) * sin10Phi + 1001 * e12 / 8388608 * sin12Phi);
+}
+function calculateInverseM(M, ellipticity, major) {
+ const d = M / major;
+ if (ellipticity === 0) {
+ return d;
+ }
+ const d2 = d * d;
+ const d3 = d2 * d;
+ const d4 = d3 * d;
+ const e = ellipticity;
+ const e2 = e * e;
+ const e4 = e2 * e2;
+ const e6 = e4 * e2;
+ const e8 = e6 * e2;
+ const e10 = e8 * e2;
+ const e12 = e10 * e2;
+ const sin2D = Math.sin(2 * d);
+ const cos2D = Math.cos(2 * d);
+ const sin4D = Math.sin(4 * d);
+ const cos4D = Math.cos(4 * d);
+ const sin6D = Math.sin(6 * d);
+ const cos6D = Math.cos(6 * d);
+ const sin8D = Math.sin(8 * d);
+ const cos8D = Math.cos(8 * d);
+ const sin10D = Math.sin(10 * d);
+ const cos10D = Math.cos(10 * d);
+ const sin12D = Math.sin(12 * d);
+ return d + d * e2 / 4 + 7 * d * e4 / 64 + 15 * d * e6 / 256 + 579 * d * e8 / 16384 + 1515 * d * e10 / 65536 + 16837 * d * e12 / 1048576 + (3 * d * e4 / 16 + 45 * d * e6 / 256 - d * (32 * d2 - 561) * e8 / 4096 - d * (232 * d2 - 1677) * e10 / 16384 + d * (399985 - 90560 * d2 + 512 * d4) * e12 / 5242880) * cos2D + (21 * d * e6 / 256 + 483 * d * e8 / 4096 - d * (224 * d2 - 1969) * e10 / 16384 - d * (33152 * d2 - 112599) * e12 / 1048576) * cos4D + (151 * d * e8 / 4096 + 4681 * d * e10 / 65536 + 1479 * d * e12 / 16384 - 453 * d3 * e12 / 32768) * cos6D + (1097 * d * e10 / 65536 + 42783 * d * e12 / 1048576) * cos8D + 8011 * d * e12 / 1048576 * cos10D + (3 * e2 / 8 + 3 * e4 / 16 + 213 * e6 / 2048 - 3 * d2 * e6 / 64 + 255 * e8 / 4096 - 33 * d2 * e8 / 512 + 20861 * e10 / 524288 - 33 * d2 * e10 / 512 + d4 * e10 / 1024 + 28273 * e12 / 1048576 - 471 * d2 * e12 / 8192 + 9 * d4 * e12 / 4096) * sin2D + (21 * e4 / 256 + 21 * e6 / 256 + 533 * e8 / 8192 - 21 * d2 * e8 / 512 + 197 * e10 / 4096 - 315 * d2 * e10 / 4096 + 584039 * e12 / 16777216 - 12517 * d2 * e12 / 131072 + 7 * d4 * e12 / 2048) * sin4D + (151 * e6 / 6144 + 151 * e8 / 4096 + 5019 * e10 / 131072 - 453 * d2 * e10 / 16384 + 26965 * e12 / 786432 - 8607 * d2 * e12 / 131072) * sin6D + (1097 * e8 / 131072 + 1097 * e10 / 65536 + 225797 * e12 / 10485760 - 1097 * d2 * e12 / 65536) * sin8D + (8011 * e10 / 2621440 + 8011 * e12 / 1048576) * sin10D + 293393 * e12 / 251658240 * sin12D;
+}
+function calculateSigma(ellipticity, latitude) {
+ if (ellipticity === 0) {
+ return Math.log(Math.tan(0.5 * (Math_default.PI_OVER_TWO + latitude)));
+ }
+ const eSinL = ellipticity * Math.sin(latitude);
+ return Math.log(Math.tan(0.5 * (Math_default.PI_OVER_TWO + latitude))) - ellipticity / 2 * Math.log((1 + eSinL) / (1 - eSinL));
+}
+function calculateHeading(ellipsoidRhumbLine, firstLongitude, firstLatitude, secondLongitude, secondLatitude) {
+ const sigma1 = calculateSigma(ellipsoidRhumbLine._ellipticity, firstLatitude);
+ const sigma2 = calculateSigma(
+ ellipsoidRhumbLine._ellipticity,
+ secondLatitude
+ );
+ return Math.atan2(
+ Math_default.negativePiToPi(secondLongitude - firstLongitude),
+ sigma2 - sigma1
+ );
+}
+function calculateArcLength(ellipsoidRhumbLine, major, minor, firstLongitude, firstLatitude, secondLongitude, secondLatitude) {
+ const heading = ellipsoidRhumbLine._heading;
+ const deltaLongitude = secondLongitude - firstLongitude;
+ let distance2 = 0;
+ if (Math_default.equalsEpsilon(
+ Math.abs(heading),
+ Math_default.PI_OVER_TWO,
+ Math_default.EPSILON8
+ )) {
+ if (major === minor) {
+ distance2 = major * Math.cos(firstLatitude) * Math_default.negativePiToPi(deltaLongitude);
+ } else {
+ const sinPhi = Math.sin(firstLatitude);
+ distance2 = major * Math.cos(firstLatitude) * Math_default.negativePiToPi(deltaLongitude) / Math.sqrt(1 - ellipsoidRhumbLine._ellipticitySquared * sinPhi * sinPhi);
+ }
+ } else {
+ const M1 = calculateM(
+ ellipsoidRhumbLine._ellipticity,
+ major,
+ firstLatitude
+ );
+ const M2 = calculateM(
+ ellipsoidRhumbLine._ellipticity,
+ major,
+ secondLatitude
+ );
+ distance2 = (M2 - M1) / Math.cos(heading);
+ }
+ return Math.abs(distance2);
+}
+var scratchCart12 = new Cartesian3_default();
+var scratchCart22 = new Cartesian3_default();
+function computeProperties2(ellipsoidRhumbLine, start, end, ellipsoid) {
+ const firstCartesian = Cartesian3_default.normalize(
+ ellipsoid.cartographicToCartesian(start, scratchCart22),
+ scratchCart12
+ );
+ const lastCartesian = Cartesian3_default.normalize(
+ ellipsoid.cartographicToCartesian(end, scratchCart22),
+ scratchCart22
+ );
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "value",
+ Math.abs(
+ Math.abs(Cartesian3_default.angleBetween(firstCartesian, lastCartesian)) - Math.PI
+ ),
+ 0.0125
+ );
+ const major = ellipsoid.maximumRadius;
+ const minor = ellipsoid.minimumRadius;
+ const majorSquared = major * major;
+ const minorSquared = minor * minor;
+ ellipsoidRhumbLine._ellipticitySquared = (majorSquared - minorSquared) / majorSquared;
+ ellipsoidRhumbLine._ellipticity = Math.sqrt(
+ ellipsoidRhumbLine._ellipticitySquared
+ );
+ ellipsoidRhumbLine._start = Cartographic_default.clone(
+ start,
+ ellipsoidRhumbLine._start
+ );
+ ellipsoidRhumbLine._start.height = 0;
+ ellipsoidRhumbLine._end = Cartographic_default.clone(end, ellipsoidRhumbLine._end);
+ ellipsoidRhumbLine._end.height = 0;
+ ellipsoidRhumbLine._heading = calculateHeading(
+ ellipsoidRhumbLine,
+ start.longitude,
+ start.latitude,
+ end.longitude,
+ end.latitude
+ );
+ ellipsoidRhumbLine._distance = calculateArcLength(
+ ellipsoidRhumbLine,
+ ellipsoid.maximumRadius,
+ ellipsoid.minimumRadius,
+ start.longitude,
+ start.latitude,
+ end.longitude,
+ end.latitude
+ );
+}
+function interpolateUsingSurfaceDistance(start, heading, distance2, major, ellipticity, result) {
+ if (distance2 === 0) {
+ return Cartographic_default.clone(start, result);
+ }
+ const ellipticitySquared = ellipticity * ellipticity;
+ let longitude;
+ let latitude;
+ let deltaLongitude;
+ if (Math.abs(Math_default.PI_OVER_TWO - Math.abs(heading)) > Math_default.EPSILON8) {
+ const M1 = calculateM(ellipticity, major, start.latitude);
+ const deltaM = distance2 * Math.cos(heading);
+ const M2 = M1 + deltaM;
+ latitude = calculateInverseM(M2, ellipticity, major);
+ const sigma1 = calculateSigma(ellipticity, start.latitude);
+ const sigma2 = calculateSigma(ellipticity, latitude);
+ deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);
+ longitude = Math_default.negativePiToPi(start.longitude + deltaLongitude);
+ } else {
+ latitude = start.latitude;
+ let localRad;
+ if (ellipticity === 0) {
+ localRad = major * Math.cos(start.latitude);
+ } else {
+ const sinPhi = Math.sin(start.latitude);
+ localRad = major * Math.cos(start.latitude) / Math.sqrt(1 - ellipticitySquared * sinPhi * sinPhi);
+ }
+ deltaLongitude = distance2 / localRad;
+ if (heading > 0) {
+ longitude = Math_default.negativePiToPi(start.longitude + deltaLongitude);
+ } else {
+ longitude = Math_default.negativePiToPi(start.longitude - deltaLongitude);
+ }
+ }
+ if (defined_default(result)) {
+ result.longitude = longitude;
+ result.latitude = latitude;
+ result.height = 0;
+ return result;
+ }
+ return new Cartographic_default(longitude, latitude, 0);
+}
+function EllipsoidRhumbLine(start, end, ellipsoid) {
+ const e = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ this._ellipsoid = e;
+ this._start = new Cartographic_default();
+ this._end = new Cartographic_default();
+ this._heading = void 0;
+ this._distance = void 0;
+ this._ellipticity = void 0;
+ this._ellipticitySquared = void 0;
+ if (defined_default(start) && defined_default(end)) {
+ computeProperties2(this, start, end, e);
+ }
+}
+Object.defineProperties(EllipsoidRhumbLine.prototype, {
+ ellipsoid: {
+ get: function() {
+ return this._ellipsoid;
+ }
+ },
+ surfaceDistance: {
+ get: function() {
+ Check_default.defined("distance", this._distance);
+ return this._distance;
+ }
+ },
+ start: {
+ get: function() {
+ return this._start;
+ }
+ },
+ end: {
+ get: function() {
+ return this._end;
+ }
+ },
+ heading: {
+ get: function() {
+ Check_default.defined("distance", this._distance);
+ return this._heading;
+ }
+ }
+});
+EllipsoidRhumbLine.fromStartHeadingDistance = function(start, heading, distance2, ellipsoid, result) {
+ Check_default.defined("start", start);
+ Check_default.defined("heading", heading);
+ Check_default.defined("distance", distance2);
+ Check_default.typeOf.number.greaterThan("distance", distance2, 0);
+ const e = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ const major = e.maximumRadius;
+ const minor = e.minimumRadius;
+ const majorSquared = major * major;
+ const minorSquared = minor * minor;
+ const ellipticity = Math.sqrt((majorSquared - minorSquared) / majorSquared);
+ heading = Math_default.negativePiToPi(heading);
+ const end = interpolateUsingSurfaceDistance(
+ start,
+ heading,
+ distance2,
+ e.maximumRadius,
+ ellipticity
+ );
+ if (!defined_default(result) || defined_default(ellipsoid) && !ellipsoid.equals(result.ellipsoid)) {
+ return new EllipsoidRhumbLine(start, end, e);
+ }
+ result.setEndPoints(start, end);
+ return result;
+};
+EllipsoidRhumbLine.prototype.setEndPoints = function(start, end) {
+ Check_default.defined("start", start);
+ Check_default.defined("end", end);
+ computeProperties2(this, start, end, this._ellipsoid);
+};
+EllipsoidRhumbLine.prototype.interpolateUsingFraction = function(fraction, result) {
+ return this.interpolateUsingSurfaceDistance(
+ fraction * this._distance,
+ result
+ );
+};
+EllipsoidRhumbLine.prototype.interpolateUsingSurfaceDistance = function(distance2, result) {
+ Check_default.typeOf.number("distance", distance2);
+ if (!defined_default(this._distance) || this._distance === 0) {
+ throw new DeveloperError_default(
+ "EllipsoidRhumbLine must have distinct start and end set."
+ );
+ }
+ return interpolateUsingSurfaceDistance(
+ this._start,
+ this._heading,
+ distance2,
+ this._ellipsoid.maximumRadius,
+ this._ellipticity,
+ result
+ );
+};
+EllipsoidRhumbLine.prototype.findIntersectionWithLongitude = function(intersectionLongitude, result) {
+ Check_default.typeOf.number("intersectionLongitude", intersectionLongitude);
+ if (!defined_default(this._distance) || this._distance === 0) {
+ throw new DeveloperError_default(
+ "EllipsoidRhumbLine must have distinct start and end set."
+ );
+ }
+ const ellipticity = this._ellipticity;
+ const heading = this._heading;
+ const absHeading = Math.abs(heading);
+ const start = this._start;
+ intersectionLongitude = Math_default.negativePiToPi(intersectionLongitude);
+ if (Math_default.equalsEpsilon(
+ Math.abs(intersectionLongitude),
+ Math.PI,
+ Math_default.EPSILON14
+ )) {
+ intersectionLongitude = Math_default.sign(start.longitude) * Math.PI;
+ }
+ if (!defined_default(result)) {
+ result = new Cartographic_default();
+ }
+ if (Math.abs(Math_default.PI_OVER_TWO - absHeading) <= Math_default.EPSILON8) {
+ result.longitude = intersectionLongitude;
+ result.latitude = start.latitude;
+ result.height = 0;
+ return result;
+ } else if (Math_default.equalsEpsilon(
+ Math.abs(Math_default.PI_OVER_TWO - absHeading),
+ Math_default.PI_OVER_TWO,
+ Math_default.EPSILON8
+ )) {
+ if (Math_default.equalsEpsilon(
+ intersectionLongitude,
+ start.longitude,
+ Math_default.EPSILON12
+ )) {
+ return void 0;
+ }
+ result.longitude = intersectionLongitude;
+ result.latitude = Math_default.PI_OVER_TWO * Math_default.sign(Math_default.PI_OVER_TWO - heading);
+ result.height = 0;
+ return result;
+ }
+ const phi1 = start.latitude;
+ const eSinPhi1 = ellipticity * Math.sin(phi1);
+ const leftComponent = Math.tan(0.5 * (Math_default.PI_OVER_TWO + phi1)) * Math.exp((intersectionLongitude - start.longitude) / Math.tan(heading));
+ const denominator = (1 + eSinPhi1) / (1 - eSinPhi1);
+ let newPhi = start.latitude;
+ let phi;
+ do {
+ phi = newPhi;
+ const eSinPhi = ellipticity * Math.sin(phi);
+ const numerator = (1 + eSinPhi) / (1 - eSinPhi);
+ newPhi = 2 * Math.atan(
+ leftComponent * Math.pow(numerator / denominator, ellipticity / 2)
+ ) - Math_default.PI_OVER_TWO;
+ } while (!Math_default.equalsEpsilon(newPhi, phi, Math_default.EPSILON12));
+ result.longitude = intersectionLongitude;
+ result.latitude = newPhi;
+ result.height = 0;
+ return result;
+};
+EllipsoidRhumbLine.prototype.findIntersectionWithLatitude = function(intersectionLatitude, result) {
+ Check_default.typeOf.number("intersectionLatitude", intersectionLatitude);
+ if (!defined_default(this._distance) || this._distance === 0) {
+ throw new DeveloperError_default(
+ "EllipsoidRhumbLine must have distinct start and end set."
+ );
+ }
+ const ellipticity = this._ellipticity;
+ const heading = this._heading;
+ const start = this._start;
+ if (Math_default.equalsEpsilon(
+ Math.abs(heading),
+ Math_default.PI_OVER_TWO,
+ Math_default.EPSILON8
+ )) {
+ return;
+ }
+ const sigma1 = calculateSigma(ellipticity, start.latitude);
+ const sigma2 = calculateSigma(ellipticity, intersectionLatitude);
+ const deltaLongitude = Math.tan(heading) * (sigma2 - sigma1);
+ const longitude = Math_default.negativePiToPi(start.longitude + deltaLongitude);
+ if (defined_default(result)) {
+ result.longitude = longitude;
+ result.latitude = intersectionLatitude;
+ result.height = 0;
+ return result;
+ }
+ return new Cartographic_default(longitude, intersectionLatitude, 0);
+};
+var EllipsoidRhumbLine_default = EllipsoidRhumbLine;
+
+// Source/Core/GroundPolylineGeometry.js
+var PROJECTIONS = [GeographicProjection_default, WebMercatorProjection_default];
+var PROJECTION_COUNT = PROJECTIONS.length;
+var MITER_BREAK_SMALL = Math.cos(Math_default.toRadians(30));
+var MITER_BREAK_LARGE = Math.cos(Math_default.toRadians(150));
+var WALL_INITIAL_MIN_HEIGHT = 0;
+var WALL_INITIAL_MAX_HEIGHT = 1e3;
+function GroundPolylineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const positions = options.positions;
+ if (!defined_default(positions) || positions.length < 2) {
+ throw new DeveloperError_default("At least two positions are required.");
+ }
+ if (defined_default(options.arcType) && options.arcType !== ArcType_default.GEODESIC && options.arcType !== ArcType_default.RHUMB) {
+ throw new DeveloperError_default(
+ "Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB."
+ );
+ }
+ this.width = defaultValue_default(options.width, 1);
+ this._positions = positions;
+ this.granularity = defaultValue_default(options.granularity, 9999);
+ this.loop = defaultValue_default(options.loop, false);
+ this.arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
+ this._ellipsoid = Ellipsoid_default.WGS84;
+ this._projectionIndex = 0;
+ this._workerName = "createGroundPolylineGeometry";
+ this._scene3DOnly = false;
+}
+Object.defineProperties(GroundPolylineGeometry.prototype, {
+ packedLength: {
+ get: function() {
+ return 1 + this._positions.length * 3 + 1 + 1 + 1 + Ellipsoid_default.packedLength + 1 + 1;
+ }
+ }
+});
+GroundPolylineGeometry.setProjectionAndEllipsoid = function(groundPolylineGeometry, mapProjection) {
+ let projectionIndex = 0;
+ for (let i = 0; i < PROJECTION_COUNT; i++) {
+ if (mapProjection instanceof PROJECTIONS[i]) {
+ projectionIndex = i;
+ break;
+ }
+ }
+ groundPolylineGeometry._projectionIndex = projectionIndex;
+ groundPolylineGeometry._ellipsoid = mapProjection.ellipsoid;
+};
+var cart3Scratch1 = new Cartesian3_default();
+var cart3Scratch2 = new Cartesian3_default();
+var cart3Scratch3 = new Cartesian3_default();
+function computeRightNormal(start, end, maxHeight, ellipsoid, result) {
+ const startBottom = getPosition(ellipsoid, start, 0, cart3Scratch1);
+ const startTop = getPosition(ellipsoid, start, maxHeight, cart3Scratch2);
+ const endBottom = getPosition(ellipsoid, end, 0, cart3Scratch3);
+ const up = direction(startTop, startBottom, cart3Scratch2);
+ const forward = direction(endBottom, startBottom, cart3Scratch3);
+ Cartesian3_default.cross(forward, up, result);
+ return Cartesian3_default.normalize(result, result);
+}
+var interpolatedCartographicScratch = new Cartographic_default();
+var interpolatedBottomScratch = new Cartesian3_default();
+var interpolatedTopScratch = new Cartesian3_default();
+var interpolatedNormalScratch = new Cartesian3_default();
+function interpolateSegment(start, end, minHeight, maxHeight, granularity, arcType, ellipsoid, normalsArray, bottomPositionsArray, topPositionsArray, cartographicsArray) {
+ if (granularity === 0) {
+ return;
+ }
+ let ellipsoidLine;
+ if (arcType === ArcType_default.GEODESIC) {
+ ellipsoidLine = new EllipsoidGeodesic_default(start, end, ellipsoid);
+ } else if (arcType === ArcType_default.RHUMB) {
+ ellipsoidLine = new EllipsoidRhumbLine_default(start, end, ellipsoid);
+ }
+ const surfaceDistance = ellipsoidLine.surfaceDistance;
+ if (surfaceDistance < granularity) {
+ return;
+ }
+ const interpolatedNormal = computeRightNormal(
+ start,
+ end,
+ maxHeight,
+ ellipsoid,
+ interpolatedNormalScratch
+ );
+ const segments = Math.ceil(surfaceDistance / granularity);
+ const interpointDistance = surfaceDistance / segments;
+ let distanceFromStart = interpointDistance;
+ const pointsToAdd = segments - 1;
+ let packIndex = normalsArray.length;
+ for (let i = 0; i < pointsToAdd; i++) {
+ const interpolatedCartographic = ellipsoidLine.interpolateUsingSurfaceDistance(
+ distanceFromStart,
+ interpolatedCartographicScratch
+ );
+ const interpolatedBottom = getPosition(
+ ellipsoid,
+ interpolatedCartographic,
+ minHeight,
+ interpolatedBottomScratch
+ );
+ const interpolatedTop = getPosition(
+ ellipsoid,
+ interpolatedCartographic,
+ maxHeight,
+ interpolatedTopScratch
+ );
+ Cartesian3_default.pack(interpolatedNormal, normalsArray, packIndex);
+ Cartesian3_default.pack(interpolatedBottom, bottomPositionsArray, packIndex);
+ Cartesian3_default.pack(interpolatedTop, topPositionsArray, packIndex);
+ cartographicsArray.push(interpolatedCartographic.latitude);
+ cartographicsArray.push(interpolatedCartographic.longitude);
+ packIndex += 3;
+ distanceFromStart += interpointDistance;
+ }
+}
+var heightlessCartographicScratch = new Cartographic_default();
+function getPosition(ellipsoid, cartographic2, height, result) {
+ Cartographic_default.clone(cartographic2, heightlessCartographicScratch);
+ heightlessCartographicScratch.height = height;
+ return Cartographic_default.toCartesian(
+ heightlessCartographicScratch,
+ ellipsoid,
+ result
+ );
+}
+GroundPolylineGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ let index = defaultValue_default(startingIndex, 0);
+ const positions = value._positions;
+ const positionsLength = positions.length;
+ array[index++] = positionsLength;
+ for (let i = 0; i < positionsLength; ++i) {
+ const cartesian11 = positions[i];
+ Cartesian3_default.pack(cartesian11, array, index);
+ index += 3;
+ }
+ array[index++] = value.granularity;
+ array[index++] = value.loop ? 1 : 0;
+ array[index++] = value.arcType;
+ Ellipsoid_default.pack(value._ellipsoid, array, index);
+ index += Ellipsoid_default.packedLength;
+ array[index++] = value._projectionIndex;
+ array[index++] = value._scene3DOnly ? 1 : 0;
+ return array;
+};
+GroundPolylineGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ let index = defaultValue_default(startingIndex, 0);
+ const positionsLength = array[index++];
+ const positions = new Array(positionsLength);
+ for (let i = 0; i < positionsLength; i++) {
+ positions[i] = Cartesian3_default.unpack(array, index);
+ index += 3;
+ }
+ const granularity = array[index++];
+ const loop = array[index++] === 1;
+ const arcType = array[index++];
+ const ellipsoid = Ellipsoid_default.unpack(array, index);
+ index += Ellipsoid_default.packedLength;
+ const projectionIndex = array[index++];
+ const scene3DOnly = array[index++] === 1;
+ if (!defined_default(result)) {
+ result = new GroundPolylineGeometry({
+ positions
+ });
+ }
+ result._positions = positions;
+ result.granularity = granularity;
+ result.loop = loop;
+ result.arcType = arcType;
+ result._ellipsoid = ellipsoid;
+ result._projectionIndex = projectionIndex;
+ result._scene3DOnly = scene3DOnly;
+ return result;
+};
+function direction(target, origin, result) {
+ Cartesian3_default.subtract(target, origin, result);
+ Cartesian3_default.normalize(result, result);
+ return result;
+}
+function tangentDirection(target, origin, up, result) {
+ result = direction(target, origin, result);
+ result = Cartesian3_default.cross(result, up, result);
+ result = Cartesian3_default.normalize(result, result);
+ result = Cartesian3_default.cross(up, result, result);
+ return result;
+}
+var toPreviousScratch = new Cartesian3_default();
+var toNextScratch = new Cartesian3_default();
+var forwardScratch = new Cartesian3_default();
+var vertexUpScratch = new Cartesian3_default();
+var cosine90 = 0;
+var cosine180 = -1;
+function computeVertexMiterNormal(previousBottom, vertexBottom, vertexTop, nextBottom, result) {
+ const up = direction(vertexTop, vertexBottom, vertexUpScratch);
+ const toPrevious = tangentDirection(
+ previousBottom,
+ vertexBottom,
+ up,
+ toPreviousScratch
+ );
+ const toNext = tangentDirection(nextBottom, vertexBottom, up, toNextScratch);
+ if (Math_default.equalsEpsilon(
+ Cartesian3_default.dot(toPrevious, toNext),
+ cosine180,
+ Math_default.EPSILON5
+ )) {
+ result = Cartesian3_default.cross(up, toPrevious, result);
+ result = Cartesian3_default.normalize(result, result);
+ return result;
+ }
+ result = Cartesian3_default.add(toNext, toPrevious, result);
+ result = Cartesian3_default.normalize(result, result);
+ const forward = Cartesian3_default.cross(up, result, forwardScratch);
+ if (Cartesian3_default.dot(toNext, forward) < cosine90) {
+ result = Cartesian3_default.negate(result, result);
+ }
+ return result;
+}
+var XZ_PLANE = Plane_default.fromPointNormal(Cartesian3_default.ZERO, Cartesian3_default.UNIT_Y);
+var previousBottomScratch = new Cartesian3_default();
+var vertexBottomScratch = new Cartesian3_default();
+var vertexTopScratch = new Cartesian3_default();
+var nextBottomScratch = new Cartesian3_default();
+var vertexNormalScratch = new Cartesian3_default();
+var intersectionScratch = new Cartesian3_default();
+var cartographicScratch0 = new Cartographic_default();
+var cartographicScratch1 = new Cartographic_default();
+var cartographicIntersectionScratch = new Cartographic_default();
+GroundPolylineGeometry.createGeometry = function(groundPolylineGeometry) {
+ const compute2dAttributes = !groundPolylineGeometry._scene3DOnly;
+ let loop = groundPolylineGeometry.loop;
+ const ellipsoid = groundPolylineGeometry._ellipsoid;
+ const granularity = groundPolylineGeometry.granularity;
+ const arcType = groundPolylineGeometry.arcType;
+ const projection = new PROJECTIONS[groundPolylineGeometry._projectionIndex](
+ ellipsoid
+ );
+ const minHeight = WALL_INITIAL_MIN_HEIGHT;
+ const maxHeight = WALL_INITIAL_MAX_HEIGHT;
+ let index;
+ let i;
+ const positions = groundPolylineGeometry._positions;
+ const positionsLength = positions.length;
+ if (positionsLength === 2) {
+ loop = false;
+ }
+ let p0;
+ let p1;
+ let c0;
+ let c14;
+ const rhumbLine = new EllipsoidRhumbLine_default(void 0, void 0, ellipsoid);
+ let intersection;
+ let intersectionCartographic;
+ let intersectionLongitude;
+ const splitPositions = [positions[0]];
+ for (i = 0; i < positionsLength - 1; i++) {
+ p0 = positions[i];
+ p1 = positions[i + 1];
+ intersection = IntersectionTests_default.lineSegmentPlane(
+ p0,
+ p1,
+ XZ_PLANE,
+ intersectionScratch
+ );
+ if (defined_default(intersection) && !Cartesian3_default.equalsEpsilon(intersection, p0, Math_default.EPSILON7) && !Cartesian3_default.equalsEpsilon(intersection, p1, Math_default.EPSILON7)) {
+ if (groundPolylineGeometry.arcType === ArcType_default.GEODESIC) {
+ splitPositions.push(Cartesian3_default.clone(intersection));
+ } else if (groundPolylineGeometry.arcType === ArcType_default.RHUMB) {
+ intersectionLongitude = ellipsoid.cartesianToCartographic(
+ intersection,
+ cartographicScratch0
+ ).longitude;
+ c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);
+ c14 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);
+ rhumbLine.setEndPoints(c0, c14);
+ intersectionCartographic = rhumbLine.findIntersectionWithLongitude(
+ intersectionLongitude,
+ cartographicIntersectionScratch
+ );
+ intersection = ellipsoid.cartographicToCartesian(
+ intersectionCartographic,
+ intersectionScratch
+ );
+ if (defined_default(intersection) && !Cartesian3_default.equalsEpsilon(intersection, p0, Math_default.EPSILON7) && !Cartesian3_default.equalsEpsilon(intersection, p1, Math_default.EPSILON7)) {
+ splitPositions.push(Cartesian3_default.clone(intersection));
+ }
+ }
+ }
+ splitPositions.push(p1);
+ }
+ if (loop) {
+ p0 = positions[positionsLength - 1];
+ p1 = positions[0];
+ intersection = IntersectionTests_default.lineSegmentPlane(
+ p0,
+ p1,
+ XZ_PLANE,
+ intersectionScratch
+ );
+ if (defined_default(intersection) && !Cartesian3_default.equalsEpsilon(intersection, p0, Math_default.EPSILON7) && !Cartesian3_default.equalsEpsilon(intersection, p1, Math_default.EPSILON7)) {
+ if (groundPolylineGeometry.arcType === ArcType_default.GEODESIC) {
+ splitPositions.push(Cartesian3_default.clone(intersection));
+ } else if (groundPolylineGeometry.arcType === ArcType_default.RHUMB) {
+ intersectionLongitude = ellipsoid.cartesianToCartographic(
+ intersection,
+ cartographicScratch0
+ ).longitude;
+ c0 = ellipsoid.cartesianToCartographic(p0, cartographicScratch0);
+ c14 = ellipsoid.cartesianToCartographic(p1, cartographicScratch1);
+ rhumbLine.setEndPoints(c0, c14);
+ intersectionCartographic = rhumbLine.findIntersectionWithLongitude(
+ intersectionLongitude,
+ cartographicIntersectionScratch
+ );
+ intersection = ellipsoid.cartographicToCartesian(
+ intersectionCartographic,
+ intersectionScratch
+ );
+ if (defined_default(intersection) && !Cartesian3_default.equalsEpsilon(intersection, p0, Math_default.EPSILON7) && !Cartesian3_default.equalsEpsilon(intersection, p1, Math_default.EPSILON7)) {
+ splitPositions.push(Cartesian3_default.clone(intersection));
+ }
+ }
+ }
+ }
+ let cartographicsLength = splitPositions.length;
+ let cartographics = new Array(cartographicsLength);
+ for (i = 0; i < cartographicsLength; i++) {
+ const cartographic2 = Cartographic_default.fromCartesian(
+ splitPositions[i],
+ ellipsoid
+ );
+ cartographic2.height = 0;
+ cartographics[i] = cartographic2;
+ }
+ cartographics = arrayRemoveDuplicates_default(
+ cartographics,
+ Cartographic_default.equalsEpsilon
+ );
+ cartographicsLength = cartographics.length;
+ if (cartographicsLength < 2) {
+ return void 0;
+ }
+ const cartographicsArray = [];
+ const normalsArray = [];
+ const bottomPositionsArray = [];
+ const topPositionsArray = [];
+ let previousBottom = previousBottomScratch;
+ let vertexBottom = vertexBottomScratch;
+ let vertexTop = vertexTopScratch;
+ let nextBottom = nextBottomScratch;
+ let vertexNormal = vertexNormalScratch;
+ const startCartographic = cartographics[0];
+ const nextCartographic = cartographics[1];
+ const prestartCartographic = cartographics[cartographicsLength - 1];
+ previousBottom = getPosition(
+ ellipsoid,
+ prestartCartographic,
+ minHeight,
+ previousBottom
+ );
+ nextBottom = getPosition(ellipsoid, nextCartographic, minHeight, nextBottom);
+ vertexBottom = getPosition(
+ ellipsoid,
+ startCartographic,
+ minHeight,
+ vertexBottom
+ );
+ vertexTop = getPosition(ellipsoid, startCartographic, maxHeight, vertexTop);
+ if (loop) {
+ vertexNormal = computeVertexMiterNormal(
+ previousBottom,
+ vertexBottom,
+ vertexTop,
+ nextBottom,
+ vertexNormal
+ );
+ } else {
+ vertexNormal = computeRightNormal(
+ startCartographic,
+ nextCartographic,
+ maxHeight,
+ ellipsoid,
+ vertexNormal
+ );
+ }
+ Cartesian3_default.pack(vertexNormal, normalsArray, 0);
+ Cartesian3_default.pack(vertexBottom, bottomPositionsArray, 0);
+ Cartesian3_default.pack(vertexTop, topPositionsArray, 0);
+ cartographicsArray.push(startCartographic.latitude);
+ cartographicsArray.push(startCartographic.longitude);
+ interpolateSegment(
+ startCartographic,
+ nextCartographic,
+ minHeight,
+ maxHeight,
+ granularity,
+ arcType,
+ ellipsoid,
+ normalsArray,
+ bottomPositionsArray,
+ topPositionsArray,
+ cartographicsArray
+ );
+ for (i = 1; i < cartographicsLength - 1; ++i) {
+ previousBottom = Cartesian3_default.clone(vertexBottom, previousBottom);
+ vertexBottom = Cartesian3_default.clone(nextBottom, vertexBottom);
+ const vertexCartographic = cartographics[i];
+ getPosition(ellipsoid, vertexCartographic, maxHeight, vertexTop);
+ getPosition(ellipsoid, cartographics[i + 1], minHeight, nextBottom);
+ computeVertexMiterNormal(
+ previousBottom,
+ vertexBottom,
+ vertexTop,
+ nextBottom,
+ vertexNormal
+ );
+ index = normalsArray.length;
+ Cartesian3_default.pack(vertexNormal, normalsArray, index);
+ Cartesian3_default.pack(vertexBottom, bottomPositionsArray, index);
+ Cartesian3_default.pack(vertexTop, topPositionsArray, index);
+ cartographicsArray.push(vertexCartographic.latitude);
+ cartographicsArray.push(vertexCartographic.longitude);
+ interpolateSegment(
+ cartographics[i],
+ cartographics[i + 1],
+ minHeight,
+ maxHeight,
+ granularity,
+ arcType,
+ ellipsoid,
+ normalsArray,
+ bottomPositionsArray,
+ topPositionsArray,
+ cartographicsArray
+ );
+ }
+ const endCartographic = cartographics[cartographicsLength - 1];
+ const preEndCartographic = cartographics[cartographicsLength - 2];
+ vertexBottom = getPosition(
+ ellipsoid,
+ endCartographic,
+ minHeight,
+ vertexBottom
+ );
+ vertexTop = getPosition(ellipsoid, endCartographic, maxHeight, vertexTop);
+ if (loop) {
+ const postEndCartographic = cartographics[0];
+ previousBottom = getPosition(
+ ellipsoid,
+ preEndCartographic,
+ minHeight,
+ previousBottom
+ );
+ nextBottom = getPosition(
+ ellipsoid,
+ postEndCartographic,
+ minHeight,
+ nextBottom
+ );
+ vertexNormal = computeVertexMiterNormal(
+ previousBottom,
+ vertexBottom,
+ vertexTop,
+ nextBottom,
+ vertexNormal
+ );
+ } else {
+ vertexNormal = computeRightNormal(
+ preEndCartographic,
+ endCartographic,
+ maxHeight,
+ ellipsoid,
+ vertexNormal
+ );
+ }
+ index = normalsArray.length;
+ Cartesian3_default.pack(vertexNormal, normalsArray, index);
+ Cartesian3_default.pack(vertexBottom, bottomPositionsArray, index);
+ Cartesian3_default.pack(vertexTop, topPositionsArray, index);
+ cartographicsArray.push(endCartographic.latitude);
+ cartographicsArray.push(endCartographic.longitude);
+ if (loop) {
+ interpolateSegment(
+ endCartographic,
+ startCartographic,
+ minHeight,
+ maxHeight,
+ granularity,
+ arcType,
+ ellipsoid,
+ normalsArray,
+ bottomPositionsArray,
+ topPositionsArray,
+ cartographicsArray
+ );
+ index = normalsArray.length;
+ for (i = 0; i < 3; ++i) {
+ normalsArray[index + i] = normalsArray[i];
+ bottomPositionsArray[index + i] = bottomPositionsArray[i];
+ topPositionsArray[index + i] = topPositionsArray[i];
+ }
+ cartographicsArray.push(startCartographic.latitude);
+ cartographicsArray.push(startCartographic.longitude);
+ }
+ return generateGeometryAttributes(
+ loop,
+ projection,
+ bottomPositionsArray,
+ topPositionsArray,
+ normalsArray,
+ cartographicsArray,
+ compute2dAttributes
+ );
+};
+var lineDirectionScratch = new Cartesian3_default();
+var matrix3Scratch = new Matrix3_default();
+var quaternionScratch = new Quaternion_default();
+function breakMiter(endGeometryNormal, startBottom, endBottom, endTop) {
+ const lineDirection = direction(endBottom, startBottom, lineDirectionScratch);
+ const dot2 = Cartesian3_default.dot(lineDirection, endGeometryNormal);
+ if (dot2 > MITER_BREAK_SMALL || dot2 < MITER_BREAK_LARGE) {
+ const vertexUp = direction(endTop, endBottom, vertexUpScratch);
+ const angle = dot2 < MITER_BREAK_LARGE ? Math_default.PI_OVER_TWO : -Math_default.PI_OVER_TWO;
+ const quaternion = Quaternion_default.fromAxisAngle(
+ vertexUp,
+ angle,
+ quaternionScratch
+ );
+ const rotationMatrix = Matrix3_default.fromQuaternion(quaternion, matrix3Scratch);
+ Matrix3_default.multiplyByVector(
+ rotationMatrix,
+ endGeometryNormal,
+ endGeometryNormal
+ );
+ return true;
+ }
+ return false;
+}
+var endPosCartographicScratch = new Cartographic_default();
+var normalStartpointScratch = new Cartesian3_default();
+var normalEndpointScratch = new Cartesian3_default();
+function projectNormal(projection, cartographic2, normal2, projectedPosition2, result) {
+ const position = Cartographic_default.toCartesian(
+ cartographic2,
+ projection._ellipsoid,
+ normalStartpointScratch
+ );
+ let normalEndpoint = Cartesian3_default.add(position, normal2, normalEndpointScratch);
+ let flipNormal = false;
+ const ellipsoid = projection._ellipsoid;
+ let normalEndpointCartographic = ellipsoid.cartesianToCartographic(
+ normalEndpoint,
+ endPosCartographicScratch
+ );
+ if (Math.abs(cartographic2.longitude - normalEndpointCartographic.longitude) > Math_default.PI_OVER_TWO) {
+ flipNormal = true;
+ normalEndpoint = Cartesian3_default.subtract(
+ position,
+ normal2,
+ normalEndpointScratch
+ );
+ normalEndpointCartographic = ellipsoid.cartesianToCartographic(
+ normalEndpoint,
+ endPosCartographicScratch
+ );
+ }
+ normalEndpointCartographic.height = 0;
+ const normalEndpointProjected = projection.project(
+ normalEndpointCartographic,
+ result
+ );
+ result = Cartesian3_default.subtract(
+ normalEndpointProjected,
+ projectedPosition2,
+ result
+ );
+ result.z = 0;
+ result = Cartesian3_default.normalize(result, result);
+ if (flipNormal) {
+ Cartesian3_default.negate(result, result);
+ }
+ return result;
+}
+var adjustHeightNormalScratch = new Cartesian3_default();
+var adjustHeightOffsetScratch = new Cartesian3_default();
+function adjustHeights(bottom, top, minHeight, maxHeight, adjustHeightBottom, adjustHeightTop) {
+ const adjustHeightNormal = Cartesian3_default.subtract(
+ top,
+ bottom,
+ adjustHeightNormalScratch
+ );
+ Cartesian3_default.normalize(adjustHeightNormal, adjustHeightNormal);
+ const distanceForBottom = minHeight - WALL_INITIAL_MIN_HEIGHT;
+ let adjustHeightOffset = Cartesian3_default.multiplyByScalar(
+ adjustHeightNormal,
+ distanceForBottom,
+ adjustHeightOffsetScratch
+ );
+ Cartesian3_default.add(bottom, adjustHeightOffset, adjustHeightBottom);
+ const distanceForTop = maxHeight - WALL_INITIAL_MAX_HEIGHT;
+ adjustHeightOffset = Cartesian3_default.multiplyByScalar(
+ adjustHeightNormal,
+ distanceForTop,
+ adjustHeightOffsetScratch
+ );
+ Cartesian3_default.add(top, adjustHeightOffset, adjustHeightTop);
+}
+var nudgeDirectionScratch = new Cartesian3_default();
+function nudgeXZ(start, end) {
+ const startToXZdistance = Plane_default.getPointDistance(XZ_PLANE, start);
+ const endToXZdistance = Plane_default.getPointDistance(XZ_PLANE, end);
+ let offset2 = nudgeDirectionScratch;
+ if (Math_default.equalsEpsilon(startToXZdistance, 0, Math_default.EPSILON2)) {
+ offset2 = direction(end, start, offset2);
+ Cartesian3_default.multiplyByScalar(offset2, Math_default.EPSILON2, offset2);
+ Cartesian3_default.add(start, offset2, start);
+ } else if (Math_default.equalsEpsilon(endToXZdistance, 0, Math_default.EPSILON2)) {
+ offset2 = direction(start, end, offset2);
+ Cartesian3_default.multiplyByScalar(offset2, Math_default.EPSILON2, offset2);
+ Cartesian3_default.add(end, offset2, end);
+ }
+}
+function nudgeCartographic(start, end) {
+ const absStartLon = Math.abs(start.longitude);
+ const absEndLon = Math.abs(end.longitude);
+ if (Math_default.equalsEpsilon(absStartLon, Math_default.PI, Math_default.EPSILON11)) {
+ const endSign = Math_default.sign(end.longitude);
+ start.longitude = endSign * (absStartLon - Math_default.EPSILON11);
+ return 1;
+ } else if (Math_default.equalsEpsilon(absEndLon, Math_default.PI, Math_default.EPSILON11)) {
+ const startSign = Math_default.sign(start.longitude);
+ end.longitude = startSign * (absEndLon - Math_default.EPSILON11);
+ return 2;
+ }
+ return 0;
+}
+var startCartographicScratch = new Cartographic_default();
+var endCartographicScratch = new Cartographic_default();
+var segmentStartTopScratch = new Cartesian3_default();
+var segmentEndTopScratch = new Cartesian3_default();
+var segmentStartBottomScratch = new Cartesian3_default();
+var segmentEndBottomScratch = new Cartesian3_default();
+var segmentStartNormalScratch = new Cartesian3_default();
+var segmentEndNormalScratch = new Cartesian3_default();
+var getHeightCartographics = [
+ startCartographicScratch,
+ endCartographicScratch
+];
+var getHeightRectangleScratch = new Rectangle_default();
+var adjustHeightStartTopScratch = new Cartesian3_default();
+var adjustHeightEndTopScratch = new Cartesian3_default();
+var adjustHeightStartBottomScratch = new Cartesian3_default();
+var adjustHeightEndBottomScratch = new Cartesian3_default();
+var segmentStart2DScratch = new Cartesian3_default();
+var segmentEnd2DScratch = new Cartesian3_default();
+var segmentStartNormal2DScratch = new Cartesian3_default();
+var segmentEndNormal2DScratch = new Cartesian3_default();
+var offsetScratch3 = new Cartesian3_default();
+var startUpScratch = new Cartesian3_default();
+var endUpScratch = new Cartesian3_default();
+var rightScratch2 = new Cartesian3_default();
+var startPlaneNormalScratch = new Cartesian3_default();
+var endPlaneNormalScratch = new Cartesian3_default();
+var encodeScratch2 = new EncodedCartesian3_default();
+var encodeScratch2D = new EncodedCartesian3_default();
+var forwardOffset2DScratch = new Cartesian3_default();
+var right2DScratch = new Cartesian3_default();
+var normalNudgeScratch = new Cartesian3_default();
+var scratchBoundingSpheres = [new BoundingSphere_default(), new BoundingSphere_default()];
+var REFERENCE_INDICES = [
+ 0,
+ 2,
+ 1,
+ 0,
+ 3,
+ 2,
+ 0,
+ 7,
+ 3,
+ 0,
+ 4,
+ 7,
+ 0,
+ 5,
+ 4,
+ 0,
+ 1,
+ 5,
+ 5,
+ 7,
+ 4,
+ 5,
+ 6,
+ 7,
+ 5,
+ 2,
+ 6,
+ 5,
+ 1,
+ 2,
+ 3,
+ 6,
+ 2,
+ 3,
+ 7,
+ 6
+];
+var REFERENCE_INDICES_LENGTH = REFERENCE_INDICES.length;
+function generateGeometryAttributes(loop, projection, bottomPositionsArray, topPositionsArray, normalsArray, cartographicsArray, compute2dAttributes) {
+ let i;
+ let index;
+ const ellipsoid = projection._ellipsoid;
+ const segmentCount = bottomPositionsArray.length / 3 - 1;
+ const vertexCount = segmentCount * 8;
+ const arraySizeVec4 = vertexCount * 4;
+ const indexCount = segmentCount * 36;
+ const indices2 = vertexCount > 65535 ? new Uint32Array(indexCount) : new Uint16Array(indexCount);
+ const positionsArray = new Float64Array(vertexCount * 3);
+ const startHiAndForwardOffsetX = new Float32Array(arraySizeVec4);
+ const startLoAndForwardOffsetY = new Float32Array(arraySizeVec4);
+ const startNormalAndForwardOffsetZ = new Float32Array(arraySizeVec4);
+ const endNormalAndTextureCoordinateNormalizationX = new Float32Array(
+ arraySizeVec4
+ );
+ const rightNormalAndTextureCoordinateNormalizationY = new Float32Array(
+ arraySizeVec4
+ );
+ let startHiLo2D;
+ let offsetAndRight2D;
+ let startEndNormals2D;
+ let texcoordNormalization2D;
+ if (compute2dAttributes) {
+ startHiLo2D = new Float32Array(arraySizeVec4);
+ offsetAndRight2D = new Float32Array(arraySizeVec4);
+ startEndNormals2D = new Float32Array(arraySizeVec4);
+ texcoordNormalization2D = new Float32Array(vertexCount * 2);
+ }
+ const cartographicsLength = cartographicsArray.length / 2;
+ let length2D = 0;
+ const startCartographic = startCartographicScratch;
+ startCartographic.height = 0;
+ const endCartographic = endCartographicScratch;
+ endCartographic.height = 0;
+ let segmentStartCartesian = segmentStartTopScratch;
+ let segmentEndCartesian = segmentEndTopScratch;
+ if (compute2dAttributes) {
+ index = 0;
+ for (i = 1; i < cartographicsLength; i++) {
+ startCartographic.latitude = cartographicsArray[index];
+ startCartographic.longitude = cartographicsArray[index + 1];
+ endCartographic.latitude = cartographicsArray[index + 2];
+ endCartographic.longitude = cartographicsArray[index + 3];
+ segmentStartCartesian = projection.project(
+ startCartographic,
+ segmentStartCartesian
+ );
+ segmentEndCartesian = projection.project(
+ endCartographic,
+ segmentEndCartesian
+ );
+ length2D += Cartesian3_default.distance(
+ segmentStartCartesian,
+ segmentEndCartesian
+ );
+ index += 2;
+ }
+ }
+ const positionsLength = topPositionsArray.length / 3;
+ segmentEndCartesian = Cartesian3_default.unpack(
+ topPositionsArray,
+ 0,
+ segmentEndCartesian
+ );
+ let length3D = 0;
+ index = 3;
+ for (i = 1; i < positionsLength; i++) {
+ segmentStartCartesian = Cartesian3_default.clone(
+ segmentEndCartesian,
+ segmentStartCartesian
+ );
+ segmentEndCartesian = Cartesian3_default.unpack(
+ topPositionsArray,
+ index,
+ segmentEndCartesian
+ );
+ length3D += Cartesian3_default.distance(segmentStartCartesian, segmentEndCartesian);
+ index += 3;
+ }
+ let j;
+ index = 3;
+ let cartographicsIndex = 0;
+ let vec2sWriteIndex = 0;
+ let vec3sWriteIndex = 0;
+ let vec4sWriteIndex = 0;
+ let miterBroken = false;
+ let endBottom = Cartesian3_default.unpack(
+ bottomPositionsArray,
+ 0,
+ segmentEndBottomScratch
+ );
+ let endTop = Cartesian3_default.unpack(topPositionsArray, 0, segmentEndTopScratch);
+ let endGeometryNormal = Cartesian3_default.unpack(
+ normalsArray,
+ 0,
+ segmentEndNormalScratch
+ );
+ if (loop) {
+ const preEndBottom = Cartesian3_default.unpack(
+ bottomPositionsArray,
+ bottomPositionsArray.length - 6,
+ segmentStartBottomScratch
+ );
+ if (breakMiter(endGeometryNormal, preEndBottom, endBottom, endTop)) {
+ endGeometryNormal = Cartesian3_default.negate(
+ endGeometryNormal,
+ endGeometryNormal
+ );
+ }
+ }
+ let lengthSoFar3D = 0;
+ let lengthSoFar2D = 0;
+ let sumHeights = 0;
+ for (i = 0; i < segmentCount; i++) {
+ const startBottom = Cartesian3_default.clone(endBottom, segmentStartBottomScratch);
+ const startTop = Cartesian3_default.clone(endTop, segmentStartTopScratch);
+ let startGeometryNormal = Cartesian3_default.clone(
+ endGeometryNormal,
+ segmentStartNormalScratch
+ );
+ if (miterBroken) {
+ startGeometryNormal = Cartesian3_default.negate(
+ startGeometryNormal,
+ startGeometryNormal
+ );
+ }
+ endBottom = Cartesian3_default.unpack(
+ bottomPositionsArray,
+ index,
+ segmentEndBottomScratch
+ );
+ endTop = Cartesian3_default.unpack(topPositionsArray, index, segmentEndTopScratch);
+ endGeometryNormal = Cartesian3_default.unpack(
+ normalsArray,
+ index,
+ segmentEndNormalScratch
+ );
+ miterBroken = breakMiter(endGeometryNormal, startBottom, endBottom, endTop);
+ startCartographic.latitude = cartographicsArray[cartographicsIndex];
+ startCartographic.longitude = cartographicsArray[cartographicsIndex + 1];
+ endCartographic.latitude = cartographicsArray[cartographicsIndex + 2];
+ endCartographic.longitude = cartographicsArray[cartographicsIndex + 3];
+ let start2D;
+ let end2D;
+ let startGeometryNormal2D;
+ let endGeometryNormal2D;
+ if (compute2dAttributes) {
+ const nudgeResult = nudgeCartographic(startCartographic, endCartographic);
+ start2D = projection.project(startCartographic, segmentStart2DScratch);
+ end2D = projection.project(endCartographic, segmentEnd2DScratch);
+ const direction2D = direction(end2D, start2D, forwardOffset2DScratch);
+ direction2D.y = Math.abs(direction2D.y);
+ startGeometryNormal2D = segmentStartNormal2DScratch;
+ endGeometryNormal2D = segmentEndNormal2DScratch;
+ if (nudgeResult === 0 || Cartesian3_default.dot(direction2D, Cartesian3_default.UNIT_Y) > MITER_BREAK_SMALL) {
+ startGeometryNormal2D = projectNormal(
+ projection,
+ startCartographic,
+ startGeometryNormal,
+ start2D,
+ segmentStartNormal2DScratch
+ );
+ endGeometryNormal2D = projectNormal(
+ projection,
+ endCartographic,
+ endGeometryNormal,
+ end2D,
+ segmentEndNormal2DScratch
+ );
+ } else if (nudgeResult === 1) {
+ endGeometryNormal2D = projectNormal(
+ projection,
+ endCartographic,
+ endGeometryNormal,
+ end2D,
+ segmentEndNormal2DScratch
+ );
+ startGeometryNormal2D.x = 0;
+ startGeometryNormal2D.y = Math_default.sign(
+ startCartographic.longitude - Math.abs(endCartographic.longitude)
+ );
+ startGeometryNormal2D.z = 0;
+ } else {
+ startGeometryNormal2D = projectNormal(
+ projection,
+ startCartographic,
+ startGeometryNormal,
+ start2D,
+ segmentStartNormal2DScratch
+ );
+ endGeometryNormal2D.x = 0;
+ endGeometryNormal2D.y = Math_default.sign(
+ startCartographic.longitude - endCartographic.longitude
+ );
+ endGeometryNormal2D.z = 0;
+ }
+ }
+ const segmentLength3D = Cartesian3_default.distance(startTop, endTop);
+ const encodedStart = EncodedCartesian3_default.fromCartesian(
+ startBottom,
+ encodeScratch2
+ );
+ const forwardOffset = Cartesian3_default.subtract(
+ endBottom,
+ startBottom,
+ offsetScratch3
+ );
+ const forward = Cartesian3_default.normalize(forwardOffset, rightScratch2);
+ let startUp = Cartesian3_default.subtract(startTop, startBottom, startUpScratch);
+ startUp = Cartesian3_default.normalize(startUp, startUp);
+ let rightNormal = Cartesian3_default.cross(forward, startUp, rightScratch2);
+ rightNormal = Cartesian3_default.normalize(rightNormal, rightNormal);
+ let startPlaneNormal = Cartesian3_default.cross(
+ startUp,
+ startGeometryNormal,
+ startPlaneNormalScratch
+ );
+ startPlaneNormal = Cartesian3_default.normalize(startPlaneNormal, startPlaneNormal);
+ let endUp = Cartesian3_default.subtract(endTop, endBottom, endUpScratch);
+ endUp = Cartesian3_default.normalize(endUp, endUp);
+ let endPlaneNormal = Cartesian3_default.cross(
+ endGeometryNormal,
+ endUp,
+ endPlaneNormalScratch
+ );
+ endPlaneNormal = Cartesian3_default.normalize(endPlaneNormal, endPlaneNormal);
+ const texcoordNormalization3DX = segmentLength3D / length3D;
+ const texcoordNormalization3DY = lengthSoFar3D / length3D;
+ let segmentLength2D = 0;
+ let encodedStart2D;
+ let forwardOffset2D;
+ let right2D;
+ let texcoordNormalization2DX = 0;
+ let texcoordNormalization2DY = 0;
+ if (compute2dAttributes) {
+ segmentLength2D = Cartesian3_default.distance(start2D, end2D);
+ encodedStart2D = EncodedCartesian3_default.fromCartesian(
+ start2D,
+ encodeScratch2D
+ );
+ forwardOffset2D = Cartesian3_default.subtract(
+ end2D,
+ start2D,
+ forwardOffset2DScratch
+ );
+ right2D = Cartesian3_default.normalize(forwardOffset2D, right2DScratch);
+ const swap4 = right2D.x;
+ right2D.x = right2D.y;
+ right2D.y = -swap4;
+ texcoordNormalization2DX = segmentLength2D / length2D;
+ texcoordNormalization2DY = lengthSoFar2D / length2D;
+ }
+ for (j = 0; j < 8; j++) {
+ const vec4Index = vec4sWriteIndex + j * 4;
+ const vec2Index = vec2sWriteIndex + j * 2;
+ const wIndex = vec4Index + 3;
+ const rightPlaneSide = j < 4 ? 1 : -1;
+ const topBottomSide = j === 2 || j === 3 || j === 6 || j === 7 ? 1 : -1;
+ Cartesian3_default.pack(encodedStart.high, startHiAndForwardOffsetX, vec4Index);
+ startHiAndForwardOffsetX[wIndex] = forwardOffset.x;
+ Cartesian3_default.pack(encodedStart.low, startLoAndForwardOffsetY, vec4Index);
+ startLoAndForwardOffsetY[wIndex] = forwardOffset.y;
+ Cartesian3_default.pack(
+ startPlaneNormal,
+ startNormalAndForwardOffsetZ,
+ vec4Index
+ );
+ startNormalAndForwardOffsetZ[wIndex] = forwardOffset.z;
+ Cartesian3_default.pack(
+ endPlaneNormal,
+ endNormalAndTextureCoordinateNormalizationX,
+ vec4Index
+ );
+ endNormalAndTextureCoordinateNormalizationX[wIndex] = texcoordNormalization3DX * rightPlaneSide;
+ Cartesian3_default.pack(
+ rightNormal,
+ rightNormalAndTextureCoordinateNormalizationY,
+ vec4Index
+ );
+ let texcoordNormalization = texcoordNormalization3DY * topBottomSide;
+ if (texcoordNormalization === 0 && topBottomSide < 0) {
+ texcoordNormalization = 9;
+ }
+ rightNormalAndTextureCoordinateNormalizationY[wIndex] = texcoordNormalization;
+ if (compute2dAttributes) {
+ startHiLo2D[vec4Index] = encodedStart2D.high.x;
+ startHiLo2D[vec4Index + 1] = encodedStart2D.high.y;
+ startHiLo2D[vec4Index + 2] = encodedStart2D.low.x;
+ startHiLo2D[vec4Index + 3] = encodedStart2D.low.y;
+ startEndNormals2D[vec4Index] = -startGeometryNormal2D.y;
+ startEndNormals2D[vec4Index + 1] = startGeometryNormal2D.x;
+ startEndNormals2D[vec4Index + 2] = endGeometryNormal2D.y;
+ startEndNormals2D[vec4Index + 3] = -endGeometryNormal2D.x;
+ offsetAndRight2D[vec4Index] = forwardOffset2D.x;
+ offsetAndRight2D[vec4Index + 1] = forwardOffset2D.y;
+ offsetAndRight2D[vec4Index + 2] = right2D.x;
+ offsetAndRight2D[vec4Index + 3] = right2D.y;
+ texcoordNormalization2D[vec2Index] = texcoordNormalization2DX * rightPlaneSide;
+ texcoordNormalization = texcoordNormalization2DY * topBottomSide;
+ if (texcoordNormalization === 0 && topBottomSide < 0) {
+ texcoordNormalization = 9;
+ }
+ texcoordNormalization2D[vec2Index + 1] = texcoordNormalization;
+ }
+ }
+ const adjustHeightStartBottom = adjustHeightStartBottomScratch;
+ const adjustHeightEndBottom = adjustHeightEndBottomScratch;
+ const adjustHeightStartTop = adjustHeightStartTopScratch;
+ const adjustHeightEndTop = adjustHeightEndTopScratch;
+ const getHeightsRectangle = Rectangle_default.fromCartographicArray(
+ getHeightCartographics,
+ getHeightRectangleScratch
+ );
+ const minMaxHeights = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ getHeightsRectangle,
+ ellipsoid
+ );
+ const minHeight = minMaxHeights.minimumTerrainHeight;
+ const maxHeight = minMaxHeights.maximumTerrainHeight;
+ sumHeights += minHeight;
+ sumHeights += maxHeight;
+ adjustHeights(
+ startBottom,
+ startTop,
+ minHeight,
+ maxHeight,
+ adjustHeightStartBottom,
+ adjustHeightStartTop
+ );
+ adjustHeights(
+ endBottom,
+ endTop,
+ minHeight,
+ maxHeight,
+ adjustHeightEndBottom,
+ adjustHeightEndTop
+ );
+ let normalNudge = Cartesian3_default.multiplyByScalar(
+ rightNormal,
+ Math_default.EPSILON5,
+ normalNudgeScratch
+ );
+ Cartesian3_default.add(
+ adjustHeightStartBottom,
+ normalNudge,
+ adjustHeightStartBottom
+ );
+ Cartesian3_default.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);
+ Cartesian3_default.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);
+ Cartesian3_default.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);
+ nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);
+ nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);
+ Cartesian3_default.pack(adjustHeightStartBottom, positionsArray, vec3sWriteIndex);
+ Cartesian3_default.pack(adjustHeightEndBottom, positionsArray, vec3sWriteIndex + 3);
+ Cartesian3_default.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 6);
+ Cartesian3_default.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 9);
+ normalNudge = Cartesian3_default.multiplyByScalar(
+ rightNormal,
+ -2 * Math_default.EPSILON5,
+ normalNudgeScratch
+ );
+ Cartesian3_default.add(
+ adjustHeightStartBottom,
+ normalNudge,
+ adjustHeightStartBottom
+ );
+ Cartesian3_default.add(adjustHeightEndBottom, normalNudge, adjustHeightEndBottom);
+ Cartesian3_default.add(adjustHeightStartTop, normalNudge, adjustHeightStartTop);
+ Cartesian3_default.add(adjustHeightEndTop, normalNudge, adjustHeightEndTop);
+ nudgeXZ(adjustHeightStartBottom, adjustHeightEndBottom);
+ nudgeXZ(adjustHeightStartTop, adjustHeightEndTop);
+ Cartesian3_default.pack(
+ adjustHeightStartBottom,
+ positionsArray,
+ vec3sWriteIndex + 12
+ );
+ Cartesian3_default.pack(
+ adjustHeightEndBottom,
+ positionsArray,
+ vec3sWriteIndex + 15
+ );
+ Cartesian3_default.pack(adjustHeightEndTop, positionsArray, vec3sWriteIndex + 18);
+ Cartesian3_default.pack(adjustHeightStartTop, positionsArray, vec3sWriteIndex + 21);
+ cartographicsIndex += 2;
+ index += 3;
+ vec2sWriteIndex += 16;
+ vec3sWriteIndex += 24;
+ vec4sWriteIndex += 32;
+ lengthSoFar3D += segmentLength3D;
+ lengthSoFar2D += segmentLength2D;
+ }
+ index = 0;
+ let indexOffset = 0;
+ for (i = 0; i < segmentCount; i++) {
+ for (j = 0; j < REFERENCE_INDICES_LENGTH; j++) {
+ indices2[index + j] = REFERENCE_INDICES[j] + indexOffset;
+ }
+ indexOffset += 8;
+ index += REFERENCE_INDICES_LENGTH;
+ }
+ const boundingSpheres = scratchBoundingSpheres;
+ BoundingSphere_default.fromVertices(
+ bottomPositionsArray,
+ Cartesian3_default.ZERO,
+ 3,
+ boundingSpheres[0]
+ );
+ BoundingSphere_default.fromVertices(
+ topPositionsArray,
+ Cartesian3_default.ZERO,
+ 3,
+ boundingSpheres[1]
+ );
+ const boundingSphere = BoundingSphere_default.fromBoundingSpheres(boundingSpheres);
+ boundingSphere.radius += sumHeights / (segmentCount * 2);
+ const attributes = {
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ normalize: false,
+ values: positionsArray
+ }),
+ startHiAndForwardOffsetX: getVec4GeometryAttribute(
+ startHiAndForwardOffsetX
+ ),
+ startLoAndForwardOffsetY: getVec4GeometryAttribute(
+ startLoAndForwardOffsetY
+ ),
+ startNormalAndForwardOffsetZ: getVec4GeometryAttribute(
+ startNormalAndForwardOffsetZ
+ ),
+ endNormalAndTextureCoordinateNormalizationX: getVec4GeometryAttribute(
+ endNormalAndTextureCoordinateNormalizationX
+ ),
+ rightNormalAndTextureCoordinateNormalizationY: getVec4GeometryAttribute(
+ rightNormalAndTextureCoordinateNormalizationY
+ )
+ };
+ if (compute2dAttributes) {
+ attributes.startHiLo2D = getVec4GeometryAttribute(startHiLo2D);
+ attributes.offsetAndRight2D = getVec4GeometryAttribute(offsetAndRight2D);
+ attributes.startEndNormals2D = getVec4GeometryAttribute(startEndNormals2D);
+ attributes.texcoordNormalization2D = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ normalize: false,
+ values: texcoordNormalization2D
+ });
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ boundingSphere
+ });
+}
+function getVec4GeometryAttribute(typedArray) {
+ return new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4,
+ normalize: false,
+ values: typedArray
+ });
+}
+GroundPolylineGeometry._projectNormal = projectNormal;
+var GroundPolylineGeometry_default = GroundPolylineGeometry;
+
+// Source/Shaders/PolylineShadowVolumeFS.js
+var PolylineShadowVolumeFS_default = '#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\nvarying vec4 v_endPlaneNormalEcAndBatchId;\nvarying vec4 v_rightPlaneEC; // Technically can compute distance for this here\nvarying vec4 v_endEcAndStartEcX;\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\n\nvoid main(void)\n{\n float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\n vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);\n\n // Discard for sky\n if (logDepthOrDepth == 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n gl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\n return;\n#else // DEBUG_SHOW_VOLUME\n discard;\n#endif // DEBUG_SHOW_VOLUME\n }\n\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n eyeCoordinate /= eyeCoordinate.w;\n\n float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);\n // Check distance of the eye coordinate against the right-facing plane\n float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\n\n // Check eye coordinate against the mitering planes\n float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);\n float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);\n\n if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n gl_FragColor = vec4(1.0, 0.0, 0.0, 0.5);\n return;\n#else // DEBUG_SHOW_VOLUME\n discard;\n#endif // DEBUG_SHOW_VOLUME\n }\n\n // Check distance of the eye coordinate against start and end planes with normals in the right plane.\n // For computing unskewed lengthwise texture coordinate.\n // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.\n\n // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"\n vec3 alignedPlaneNormal;\n\n // start aligned plane\n alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);\n alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\n distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);\n\n // end aligned plane\n alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);\n alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));\n distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);\n\n#ifdef PER_INSTANCE_COLOR\n gl_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\n // Clamp - distance to aligned planes may be negative due to mitering,\n // so fragment texture coordinate might be out-of-bounds.\n float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);\n s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;\n float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);\n\n czm_materialInput materialInput;\n\n materialInput.s = s;\n materialInput.st = vec2(s, t);\n materialInput.str = vec3(s, t, 0.0);\n\n czm_material material = czm_getMaterial(materialInput);\n gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\n\n // Premultiply alpha. Required for classification primitives on translucent globe.\n gl_FragColor.rgb *= gl_FragColor.a;\n\n czm_writeDepthClamp();\n}\n';
+
+// Source/Shaders/PolylineShadowVolumeMorphFS.js
+var PolylineShadowVolumeMorphFS_default = "varying vec3 v_forwardDirectionEC;\nvarying vec3 v_texcoordNormalizationAndHalfWidth;\nvarying float v_batchId;\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#else\nvarying vec2 v_alignedPlaneDistances;\nvarying float v_texcoordT;\n#endif\n\nfloat rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {\n // We don't expect the ray to ever be parallel to the plane\n return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);\n}\n\nvoid main(void)\n{\n vec4 eyeCoordinate = gl_FragCoord;\n eyeCoordinate /= eyeCoordinate.w;\n\n#ifdef PER_INSTANCE_COLOR\n gl_FragColor = czm_gammaCorrect(v_color);\n#else // PER_INSTANCE_COLOR\n // Use distances for planes aligned with segment to prevent skew in dashing\n float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);\n float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);\n\n // Clamp - distance to aligned planes may be negative due to mitering\n distanceFromStart = max(0.0, distanceFromStart);\n distanceFromEnd = max(0.0, distanceFromEnd);\n\n float s = distanceFromStart / (distanceFromStart + distanceFromEnd);\n s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;\n\n czm_materialInput materialInput;\n\n materialInput.s = s;\n materialInput.st = vec2(s, v_texcoordT);\n materialInput.str = vec3(s, v_texcoordT, 0.0);\n\n czm_material material = czm_getMaterial(materialInput);\n gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#endif // PER_INSTANCE_COLOR\n}\n";
+
+// Source/Shaders/PolylineShadowVolumeMorphVS.js
+var PolylineShadowVolumeMorphVS_default = `attribute vec3 position3DHigh;
+attribute vec3 position3DLow;
+
+attribute vec4 startHiAndForwardOffsetX;
+attribute vec4 startLoAndForwardOffsetY;
+attribute vec4 startNormalAndForwardOffsetZ;
+attribute vec4 endNormalAndTextureCoordinateNormalizationX;
+attribute vec4 rightNormalAndTextureCoordinateNormalizationY;
+attribute vec4 startHiLo2D;
+attribute vec4 offsetAndRight2D;
+attribute vec4 startEndNormals2D;
+attribute vec2 texcoordNormalization2D;
+
+attribute float batchId;
+
+varying vec3 v_forwardDirectionEC;
+varying vec3 v_texcoordNormalizationAndHalfWidth;
+varying float v_batchId;
+
+// For materials
+#ifdef WIDTH_VARYING
+varying float v_width;
+#endif
+#ifdef ANGLE_VARYING
+varying float v_polylineAngle;
+#endif
+
+#ifdef PER_INSTANCE_COLOR
+varying vec4 v_color;
+#else
+varying vec2 v_alignedPlaneDistances;
+varying float v_texcoordT;
+#endif
+
+// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume.
+// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient.
+void main()
+{
+ v_batchId = batchId;
+
+ // Start position
+ vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));
+ vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);
+ vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
+ vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
+ vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
+ vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
+
+ // Start plane
+ vec4 startPlane2D;
+ vec4 startPlane3D;
+ startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
+ startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
+ startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);
+ startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);
+
+ // Right plane
+ vec4 rightPlane2D;
+ vec4 rightPlane3D;
+ rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
+ rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
+ rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);
+ rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);
+
+ // End position
+ posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);
+ posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);
+ posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
+ posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
+ posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
+ vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
+ vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));
+ vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));
+
+ // End plane
+ vec4 endPlane2D;
+ vec4 endPlane3D;
+ endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
+ endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
+ endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);
+ endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);
+
+ // Forward direction
+ v_forwardDirectionEC = normalize(endEC - startEC);
+
+ vec2 cleanTexcoordNormalization2D;
+ cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);
+ cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));
+ vec2 cleanTexcoordNormalization3D;
+ cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
+ cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;
+ cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));
+
+ v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);
+
+#ifdef PER_INSTANCE_COLOR
+ v_color = czm_batchTable_color(batchId);
+#else // PER_INSTANCE_COLOR
+ // For computing texture coordinates
+
+ v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);
+ v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);
+#endif // PER_INSTANCE_COLOR
+
+#ifdef WIDTH_VARYING
+ float width = czm_batchTable_width(batchId);
+ float halfWidth = width * 0.5;
+ v_width = width;
+ v_texcoordNormalizationAndHalfWidth.z = halfWidth;
+#else
+ float halfWidth = 0.5 * czm_batchTable_width(batchId);
+ v_texcoordNormalizationAndHalfWidth.z = halfWidth;
+#endif
+
+ // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
+ // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
+ // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
+ // Since this is morphing, compute both 3D and 2D positions and then blend.
+
+ // ****** 3D ******
+ // Check distance to the end plane and start plane, pick the plane that is closer
+ vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition
+ float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));
+ float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));
+ vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);
+ vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
+ vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
+
+ // Nudge the top vertex upwards to prevent flickering
+ vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
+ geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
+ geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
+ positionEc3D.xyz += geodeticSurfaceNormal;
+
+ // Determine if this vertex is on the "left" or "right"
+ normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
+
+ // A "perfect" implementation would push along normals according to the angle against forward.
+ // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
+ positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
+
+ // ****** 2D ******
+ // Check distance to the end plane and start plane, pick the plane that is closer
+ vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition
+ absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));
+ absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));
+ planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);
+ upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
+ normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
+
+ // Nudge the top vertex upwards to prevent flickering
+ geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
+ geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
+ geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
+ positionEc2D.xyz += geodeticSurfaceNormal;
+
+ // Determine if this vertex is on the "left" or "right"
+ normalEC *= sign(texcoordNormalization2D.x);
+#ifndef PER_INSTANCE_COLOR
+ // Use vertex's sidedness to compute its texture coordinate.
+ v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
+#endif
+
+ // A "perfect" implementation would push along normals according to the angle against forward.
+ // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
+ positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
+
+ // Blend for actual position
+ gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);
+
+#ifdef ANGLE_VARYING
+ // Approximate relative screen space direction of the line.
+ vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));
+ approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
+ v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
+#endif
+}
+`;
+
+// Source/Shaders/PolylineShadowVolumeVS.js
+var PolylineShadowVolumeVS_default = 'attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\n\n// In 2D and in 3D, texture coordinate normalization component signs encodes:\n// * X sign - sidedness relative to right plane\n// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume\n#ifndef COLUMBUS_VIEW_2D\nattribute vec4 startHiAndForwardOffsetX;\nattribute vec4 startLoAndForwardOffsetY;\nattribute vec4 startNormalAndForwardOffsetZ;\nattribute vec4 endNormalAndTextureCoordinateNormalizationX;\nattribute vec4 rightNormalAndTextureCoordinateNormalizationY;\n#else\nattribute vec4 startHiLo2D;\nattribute vec4 offsetAndRight2D;\nattribute vec4 startEndNormals2D;\nattribute vec2 texcoordNormalization2D;\n#endif\n\nattribute float batchId;\n\nvarying vec4 v_startPlaneNormalEcAndHalfWidth;\nvarying vec4 v_endPlaneNormalEcAndBatchId;\nvarying vec4 v_rightPlaneEC;\nvarying vec4 v_endEcAndStartEcX;\nvarying vec4 v_texcoordNormalizationAndStartEcYZ;\n\n// For materials\n#ifdef WIDTH_VARYING\nvarying float v_width;\n#endif\n#ifdef ANGLE_VARYING\nvarying float v_polylineAngle;\n#endif\n\n#ifdef PER_INSTANCE_COLOR\nvarying vec4 v_color;\n#endif\n\nvoid main()\n{\n#ifdef COLUMBUS_VIEW_2D\n vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;\n\n vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);\n vec3 ecEnd = forwardDirectionEC + ecStart;\n forwardDirectionEC = normalize(forwardDirectionEC);\n\n // Right plane\n v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);\n v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\n\n // start plane\n vec4 startPlaneEC;\n startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);\n startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\n\n // end plane\n vec4 endPlaneEC;\n endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);\n endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\n\n v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);\n v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;\n\n#else // COLUMBUS_VIEW_2D\n vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;\n vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);\n vec3 ecEnd = ecStart + offset;\n\n vec3 forwardDirectionEC = normalize(offset);\n\n // start plane\n vec4 startPlaneEC;\n startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;\n startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);\n\n // end plane\n vec4 endPlaneEC;\n endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;\n endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);\n\n // Right plane\n v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;\n v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);\n\n v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);\n v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;\n\n#endif // COLUMBUS_VIEW_2D\n\n v_endEcAndStartEcX.xyz = ecEnd;\n v_endEcAndStartEcX.w = ecStart.x;\n v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;\n\n#ifdef PER_INSTANCE_COLOR\n v_color = czm_batchTable_color(batchId);\n#endif // PER_INSTANCE_COLOR\n\n // Compute a normal along which to "push" the position out, extending the miter depending on view distance.\n // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.\n // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.\n vec4 positionRelativeToEye = czm_computePosition();\n\n // Check distance to the end plane and start plane, pick the plane that is closer\n vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition\n float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));\n float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));\n vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);\n vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.\n vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.\n\n // Extrude bottom vertices downward for far view distances, like for GroundPrimitives\n upOrDown = cross(forwardDirectionEC, normalEC);\n upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;\n upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;\n upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;\n positionEC.xyz += upOrDown;\n\n v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));\n\n // Determine distance along normalEC to push for a volume of appropriate width.\n // Make volumes about double pixel width for a conservative fit - in practice the\n // extra cost here is minimal compared to the loose volume heights.\n //\n // N = normalEC (guaranteed "right-facing")\n // R = rightEC\n // p = angle between N and R\n // w = distance to push along R if R == N\n // d = distance to push along N\n //\n // N R\n // { p| } * cos(p) = dot(N, R) = w / d\n // d | |w * d = w / dot(N, R)\n // { | }\n // o---------- polyline segment ---->\n //\n float width = czm_batchTable_width(batchId);\n#ifdef WIDTH_VARYING\n v_width = width;\n#endif\n\n v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;\n v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;\n\n v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;\n v_endPlaneNormalEcAndBatchId.w = batchId;\n\n width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R\n width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N\n\n // Determine if this vertex is on the "left" or "right"\n#ifdef COLUMBUS_VIEW_2D\n normalEC *= sign(texcoordNormalization2D.x);\n#else\n normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);\n#endif\n\n positionEC.xyz += width * normalEC;\n gl_Position = czm_depthClamp(czm_projection * positionEC);\n\n#ifdef ANGLE_VARYING\n // Approximate relative screen space direction of the line.\n vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));\n approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);\n v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);\n#endif\n}\n';
+
+// Source/Shaders/Appearances/PolylineColorAppearanceVS.js
+var PolylineColorAppearanceVS_default = "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\n\nvarying vec4 v_color;\n\nvoid main()\n{\n float expandDir = expandAndWidth.x;\n float width = abs(expandAndWidth.y) + 0.5;\n bool usePrev = expandAndWidth.y < 0.0;\n\n vec4 p = czm_computePosition();\n vec4 prev = czm_computePrevPosition();\n vec4 next = czm_computeNextPosition();\n\n float angle;\n vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\n gl_Position = czm_viewportOrthographic * positionWC;\n\n v_color = color;\n}\n";
+
+// Source/Shaders/PolylineCommon.js
+var PolylineCommon_default = "void clipLineSegmentToNearPlane(\n vec3 p0,\n vec3 p1,\n out vec4 positionWC,\n out bool clipped,\n out bool culledByNearPlane,\n out vec4 clippedPositionEC)\n{\n culledByNearPlane = false;\n clipped = false;\n\n vec3 p0ToP1 = p1 - p0;\n float magnitude = length(p0ToP1);\n vec3 direction = normalize(p0ToP1);\n\n // Distance that p0 is behind the near plane. Negative means p0 is\n // in front of the near plane.\n float endPoint0Distance = czm_currentFrustum.x + p0.z;\n\n // Camera looks down -Z.\n // When moving a point along +Z: LESS VISIBLE\n // * Points in front of the camera move closer to the camera.\n // * Points behind the camrea move farther away from the camera.\n // When moving a point along -Z: MORE VISIBLE\n // * Points in front of the camera move farther away from the camera.\n // * Points behind the camera move closer to the camera.\n\n // Positive denominator: -Z, becoming more visible\n // Negative denominator: +Z, becoming less visible\n // Nearly zero: parallel to near plane\n float denominator = -direction.z;\n\n if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)\n {\n // p0 is behind the near plane and the line to p1 is nearly parallel to\n // the near plane, so cull the segment completely.\n culledByNearPlane = true;\n }\n else if (endPoint0Distance > 0.0)\n {\n // p0 is behind the near plane, and the line to p1 is moving distinctly\n // toward or away from it.\n\n // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)\n float t = endPoint0Distance / denominator;\n if (t < 0.0 || t > magnitude)\n {\n // Near plane intersection is not between the two points.\n // We already confirmed p0 is behind the naer plane, so now\n // we know the entire segment is behind it.\n culledByNearPlane = true;\n }\n else\n {\n // Segment crosses the near plane, update p0 to lie exactly on it.\n p0 = p0 + t * direction;\n\n // Numerical noise might put us a bit on the wrong side of the near plane.\n // Don't let that happen.\n p0.z = min(p0.z, -czm_currentFrustum.x);\n\n clipped = true;\n }\n }\n\n clippedPositionEC = vec4(p0, 1.0);\n positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);\n}\n\nvec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)\n{\n // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.\n\n#ifdef POLYLINE_DASH\n // Compute the window coordinates of the points.\n vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\n vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\n vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\n\n // Determine the relative screen space direction of the line.\n vec2 lineDir;\n if (usePrevious) {\n lineDir = normalize(positionWindow.xy - previousWindow.xy);\n }\n else {\n lineDir = normalize(nextWindow.xy - positionWindow.xy);\n }\n angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)\n\n // Quantize the angle so it doesn't change rapidly between segments.\n angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n#endif\n\n vec4 clippedPrevWC, clippedPrevEC;\n bool prevSegmentClipped, prevSegmentCulled;\n clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);\n\n vec4 clippedNextWC, clippedNextEC;\n bool nextSegmentClipped, nextSegmentCulled;\n clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);\n\n bool segmentClipped, segmentCulled;\n vec4 clippedPositionWC, clippedPositionEC;\n clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);\n\n if (segmentCulled)\n {\n return vec4(0.0, 0.0, 0.0, 1.0);\n }\n\n vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);\n vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);\n\n // If a segment was culled, we can't use the corresponding direction\n // computed above. We should never see both of these be true without\n // `segmentCulled` above also being true.\n if (prevSegmentCulled)\n {\n directionToPrevWC = -directionToNextWC;\n }\n else if (nextSegmentCulled)\n {\n directionToNextWC = -directionToPrevWC;\n }\n\n vec2 thisSegmentForwardWC, otherSegmentForwardWC;\n if (usePrevious)\n {\n thisSegmentForwardWC = -directionToPrevWC;\n otherSegmentForwardWC = directionToNextWC;\n }\n else\n {\n thisSegmentForwardWC = directionToNextWC;\n otherSegmentForwardWC = -directionToPrevWC;\n }\n\n vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);\n\n vec2 leftWC = thisSegmentLeftWC;\n float expandWidth = width * 0.5;\n\n // When lines are split at the anti-meridian, the position may be at the\n // same location as the next or previous position, and we need to handle\n // that to avoid producing NaNs.\n if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))\n {\n vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);\n\n vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;\n float leftSumLength = length(leftSumWC);\n leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);\n\n // The sine of the angle between the two vectors is given by the formula\n // |a x b| = |a||b|sin(theta)\n // which is\n // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));\n // Because the z components of both vectors are zero, the x and y coordinate will be zero.\n // Therefore, the sine of the angle is just the z component of the cross product.\n vec2 u = -thisSegmentForwardWC;\n vec2 v = leftWC;\n float sinAngle = abs(u.x * v.y - u.y * v.x);\n expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n }\n\n vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;\n return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;\n}\n\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)\n{\n vec4 positionEC = czm_modelViewRelativeToEye * position;\n vec4 prevEC = czm_modelViewRelativeToEye * previous;\n vec4 nextEC = czm_modelViewRelativeToEye * next;\n return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);\n}\n";
+
+// Source/Scene/PolylineColorAppearance.js
+var defaultVertexShaderSource = `${PolylineCommon_default}
+${PolylineColorAppearanceVS_default}`;
+var defaultFragmentShaderSource = PerInstanceFlatColorAppearanceFS_default;
+if (!FeatureDetection_default.isInternetExplorer()) {
+ defaultVertexShaderSource = `#define CLIP_POLYLINE
+${defaultVertexShaderSource}`;
+}
+function PolylineColorAppearance(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const translucent = defaultValue_default(options.translucent, true);
+ const closed = false;
+ const vertexFormat = PolylineColorAppearance.VERTEX_FORMAT;
+ this.material = void 0;
+ this.translucent = translucent;
+ this._vertexShaderSource = defaultValue_default(
+ options.vertexShaderSource,
+ defaultVertexShaderSource
+ );
+ this._fragmentShaderSource = defaultValue_default(
+ options.fragmentShaderSource,
+ defaultFragmentShaderSource
+ );
+ this._renderState = Appearance_default.getDefaultRenderState(
+ translucent,
+ closed,
+ options.renderState
+ );
+ this._closed = closed;
+ this._vertexFormat = vertexFormat;
+}
+Object.defineProperties(PolylineColorAppearance.prototype, {
+ vertexShaderSource: {
+ get: function() {
+ return this._vertexShaderSource;
+ }
+ },
+ fragmentShaderSource: {
+ get: function() {
+ return this._fragmentShaderSource;
+ }
+ },
+ renderState: {
+ get: function() {
+ return this._renderState;
+ }
+ },
+ closed: {
+ get: function() {
+ return this._closed;
+ }
+ },
+ vertexFormat: {
+ get: function() {
+ return this._vertexFormat;
+ }
+ }
+});
+PolylineColorAppearance.VERTEX_FORMAT = VertexFormat_default.POSITION_ONLY;
+PolylineColorAppearance.prototype.getFragmentShaderSource = Appearance_default.prototype.getFragmentShaderSource;
+PolylineColorAppearance.prototype.isTranslucent = Appearance_default.prototype.isTranslucent;
+PolylineColorAppearance.prototype.getRenderState = Appearance_default.prototype.getRenderState;
+var PolylineColorAppearance_default = PolylineColorAppearance;
+
+// Source/Shaders/Appearances/PolylineMaterialAppearanceVS.js
+var PolylineMaterialAppearanceVS_default = "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\n\nvarying float v_width;\nvarying vec2 v_st;\nvarying float v_polylineAngle;\n\nvoid main()\n{\n float expandDir = expandAndWidth.x;\n float width = abs(expandAndWidth.y) + 0.5;\n bool usePrev = expandAndWidth.y < 0.0;\n\n vec4 p = czm_computePosition();\n vec4 prev = czm_computePrevPosition();\n vec4 next = czm_computeNextPosition();\n\n float angle;\n vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\n gl_Position = czm_viewportOrthographic * positionWC;\n\n v_width = width;\n v_st.s = st.s;\n v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);\n v_polylineAngle = angle;\n}\n";
+
+// Source/Shaders/PolylineFS.js
+var PolylineFS_default = "#ifdef VECTOR_TILE\nuniform vec4 u_highlightColor;\n#endif\n\nvarying vec2 v_st;\n\nvoid main()\n{\n czm_materialInput materialInput;\n\n vec2 st = v_st;\n st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);\n\n materialInput.s = st.s;\n materialInput.st = st;\n materialInput.str = vec3(st, 0.0);\n\n czm_material material = czm_getMaterial(materialInput);\n gl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#ifdef VECTOR_TILE\n gl_FragColor *= u_highlightColor;\n#endif\n\n czm_writeLogDepth();\n}\n";
+
+// Source/Scene/PolylineMaterialAppearance.js
+var defaultVertexShaderSource2 = `${PolylineCommon_default}
+${PolylineMaterialAppearanceVS_default}`;
+var defaultFragmentShaderSource2 = PolylineFS_default;
+if (!FeatureDetection_default.isInternetExplorer()) {
+ defaultVertexShaderSource2 = `#define CLIP_POLYLINE
+${defaultVertexShaderSource2}`;
+}
+function PolylineMaterialAppearance(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const translucent = defaultValue_default(options.translucent, true);
+ const closed = false;
+ const vertexFormat = PolylineMaterialAppearance.VERTEX_FORMAT;
+ this.material = defined_default(options.material) ? options.material : Material_default.fromType(Material_default.ColorType);
+ this.translucent = translucent;
+ this._vertexShaderSource = defaultValue_default(
+ options.vertexShaderSource,
+ defaultVertexShaderSource2
+ );
+ this._fragmentShaderSource = defaultValue_default(
+ options.fragmentShaderSource,
+ defaultFragmentShaderSource2
+ );
+ this._renderState = Appearance_default.getDefaultRenderState(
+ translucent,
+ closed,
+ options.renderState
+ );
+ this._closed = closed;
+ this._vertexFormat = vertexFormat;
+}
+Object.defineProperties(PolylineMaterialAppearance.prototype, {
+ vertexShaderSource: {
+ get: function() {
+ let vs = this._vertexShaderSource;
+ if (this.material.shaderSource.search(
+ /varying\s+float\s+v_polylineAngle;/g
+ ) !== -1) {
+ vs = `#define POLYLINE_DASH
+${vs}`;
+ }
+ return vs;
+ }
+ },
+ fragmentShaderSource: {
+ get: function() {
+ return this._fragmentShaderSource;
+ }
+ },
+ renderState: {
+ get: function() {
+ return this._renderState;
+ }
+ },
+ closed: {
+ get: function() {
+ return this._closed;
+ }
+ },
+ vertexFormat: {
+ get: function() {
+ return this._vertexFormat;
+ }
+ }
+});
+PolylineMaterialAppearance.VERTEX_FORMAT = VertexFormat_default.POSITION_AND_ST;
+PolylineMaterialAppearance.prototype.getFragmentShaderSource = Appearance_default.prototype.getFragmentShaderSource;
+PolylineMaterialAppearance.prototype.isTranslucent = Appearance_default.prototype.isTranslucent;
+PolylineMaterialAppearance.prototype.getRenderState = Appearance_default.prototype.getRenderState;
+var PolylineMaterialAppearance_default = PolylineMaterialAppearance;
+
+// Source/Scene/GroundPolylinePrimitive.js
+function GroundPolylinePrimitive(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.geometryInstances = options.geometryInstances;
+ this._hasPerInstanceColors = true;
+ let appearance = options.appearance;
+ if (!defined_default(appearance)) {
+ appearance = new PolylineMaterialAppearance_default();
+ }
+ this.appearance = appearance;
+ this.show = defaultValue_default(options.show, true);
+ this.classificationType = defaultValue_default(
+ options.classificationType,
+ ClassificationType_default.BOTH
+ );
+ this.debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this._debugShowShadowVolume = defaultValue_default(
+ options.debugShowShadowVolume,
+ false
+ );
+ this._primitiveOptions = {
+ geometryInstances: void 0,
+ appearance: void 0,
+ vertexCacheOptimize: false,
+ interleave: defaultValue_default(options.interleave, false),
+ releaseGeometryInstances: defaultValue_default(
+ options.releaseGeometryInstances,
+ true
+ ),
+ allowPicking: defaultValue_default(options.allowPicking, true),
+ asynchronous: defaultValue_default(options.asynchronous, true),
+ compressVertices: false,
+ _createShaderProgramFunction: void 0,
+ _createCommandsFunction: void 0,
+ _updateAndQueueCommandsFunction: void 0
+ };
+ this._zIndex = void 0;
+ this._ready = false;
+ const groundPolylinePrimitive = this;
+ this._readyPromise = new Promise((resolve2, reject) => {
+ groundPolylinePrimitive._completeLoad = () => {
+ this._ready = true;
+ if (this.releaseGeometryInstances) {
+ this.geometryInstances = void 0;
+ }
+ const error = this._error;
+ if (!defined_default(error)) {
+ resolve2(this);
+ } else {
+ reject(error);
+ }
+ };
+ });
+ this._primitive = void 0;
+ this._sp = void 0;
+ this._sp2D = void 0;
+ this._spMorph = void 0;
+ this._renderState = getRenderState(false);
+ this._renderState3DTiles = getRenderState(true);
+ this._renderStateMorph = RenderState_default.fromCache({
+ cull: {
+ enabled: true,
+ face: CullFace_default.FRONT
+ },
+ depthTest: {
+ enabled: true
+ },
+ blending: BlendingState_default.PRE_MULTIPLIED_ALPHA_BLEND,
+ depthMask: false
+ });
+}
+Object.defineProperties(GroundPolylinePrimitive.prototype, {
+ interleave: {
+ get: function() {
+ return this._primitiveOptions.interleave;
+ }
+ },
+ releaseGeometryInstances: {
+ get: function() {
+ return this._primitiveOptions.releaseGeometryInstances;
+ }
+ },
+ allowPicking: {
+ get: function() {
+ return this._primitiveOptions.allowPicking;
+ }
+ },
+ asynchronous: {
+ get: function() {
+ return this._primitiveOptions.asynchronous;
+ }
+ },
+ ready: {
+ get: function() {
+ return this._ready;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ },
+ debugShowShadowVolume: {
+ get: function() {
+ return this._debugShowShadowVolume;
+ }
+ }
+});
+GroundPolylinePrimitive.initializeTerrainHeights = function() {
+ return ApproximateTerrainHeights_default.initialize();
+};
+function createShaderProgram3(groundPolylinePrimitive, frameState, appearance) {
+ const context = frameState.context;
+ const primitive = groundPolylinePrimitive._primitive;
+ const attributeLocations8 = primitive._attributeLocations;
+ let vs = primitive._batchTable.getVertexShaderCallback()(
+ PolylineShadowVolumeVS_default
+ );
+ vs = Primitive_default._appendShowToShader(primitive, vs);
+ vs = Primitive_default._appendDistanceDisplayConditionToShader(primitive, vs);
+ vs = Primitive_default._modifyShaderPosition(
+ groundPolylinePrimitive,
+ vs,
+ frameState.scene3DOnly
+ );
+ let vsMorph = primitive._batchTable.getVertexShaderCallback()(
+ PolylineShadowVolumeMorphVS_default
+ );
+ vsMorph = Primitive_default._appendShowToShader(primitive, vsMorph);
+ vsMorph = Primitive_default._appendDistanceDisplayConditionToShader(
+ primitive,
+ vsMorph
+ );
+ vsMorph = Primitive_default._modifyShaderPosition(
+ groundPolylinePrimitive,
+ vsMorph,
+ frameState.scene3DOnly
+ );
+ let fs = primitive._batchTable.getVertexShaderCallback()(
+ PolylineShadowVolumeFS_default
+ );
+ const vsDefines = [
+ `GLOBE_MINIMUM_ALTITUDE ${frameState.mapProjection.ellipsoid.minimumRadius.toFixed(
+ 1
+ )}`
+ ];
+ let colorDefine = "";
+ let materialShaderSource = "";
+ if (defined_default(appearance.material)) {
+ materialShaderSource = defined_default(appearance.material) ? appearance.material.shaderSource : "";
+ if (materialShaderSource.search(/varying\s+float\s+v_polylineAngle;/g) !== -1) {
+ vsDefines.push("ANGLE_VARYING");
+ }
+ if (materialShaderSource.search(/varying\s+float\s+v_width;/g) !== -1) {
+ vsDefines.push("WIDTH_VARYING");
+ }
+ } else {
+ colorDefine = "PER_INSTANCE_COLOR";
+ }
+ vsDefines.push(colorDefine);
+ const fsDefines = groundPolylinePrimitive.debugShowShadowVolume ? ["DEBUG_SHOW_VOLUME", colorDefine] : [colorDefine];
+ const vsColor3D = new ShaderSource_default({
+ defines: vsDefines,
+ sources: [vs]
+ });
+ const fsColor3D = new ShaderSource_default({
+ defines: fsDefines,
+ sources: [materialShaderSource, fs]
+ });
+ groundPolylinePrimitive._sp = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: primitive._sp,
+ vertexShaderSource: vsColor3D,
+ fragmentShaderSource: fsColor3D,
+ attributeLocations: attributeLocations8
+ });
+ let colorProgram2D = context.shaderCache.getDerivedShaderProgram(
+ groundPolylinePrimitive._sp,
+ "2dColor"
+ );
+ if (!defined_default(colorProgram2D)) {
+ const vsColor2D = new ShaderSource_default({
+ defines: vsDefines.concat(["COLUMBUS_VIEW_2D"]),
+ sources: [vs]
+ });
+ colorProgram2D = context.shaderCache.createDerivedShaderProgram(
+ groundPolylinePrimitive._sp,
+ "2dColor",
+ {
+ context,
+ shaderProgram: groundPolylinePrimitive._sp2D,
+ vertexShaderSource: vsColor2D,
+ fragmentShaderSource: fsColor3D,
+ attributeLocations: attributeLocations8
+ }
+ );
+ }
+ groundPolylinePrimitive._sp2D = colorProgram2D;
+ let colorProgramMorph = context.shaderCache.getDerivedShaderProgram(
+ groundPolylinePrimitive._sp,
+ "MorphColor"
+ );
+ if (!defined_default(colorProgramMorph)) {
+ const vsColorMorph = new ShaderSource_default({
+ defines: vsDefines.concat([
+ `MAX_TERRAIN_HEIGHT ${ApproximateTerrainHeights_default._defaultMaxTerrainHeight.toFixed(
+ 1
+ )}`
+ ]),
+ sources: [vsMorph]
+ });
+ fs = primitive._batchTable.getVertexShaderCallback()(
+ PolylineShadowVolumeMorphFS_default
+ );
+ const fsColorMorph = new ShaderSource_default({
+ defines: fsDefines,
+ sources: [materialShaderSource, fs]
+ });
+ colorProgramMorph = context.shaderCache.createDerivedShaderProgram(
+ groundPolylinePrimitive._sp,
+ "MorphColor",
+ {
+ context,
+ shaderProgram: groundPolylinePrimitive._spMorph,
+ vertexShaderSource: vsColorMorph,
+ fragmentShaderSource: fsColorMorph,
+ attributeLocations: attributeLocations8
+ }
+ );
+ }
+ groundPolylinePrimitive._spMorph = colorProgramMorph;
+}
+function getRenderState(mask3DTiles) {
+ return RenderState_default.fromCache({
+ cull: {
+ enabled: true
+ },
+ blending: BlendingState_default.PRE_MULTIPLIED_ALPHA_BLEND,
+ depthMask: false,
+ stencilTest: {
+ enabled: mask3DTiles,
+ frontFunction: StencilFunction_default.EQUAL,
+ frontOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.KEEP,
+ zPass: StencilOperation_default.KEEP
+ },
+ backFunction: StencilFunction_default.EQUAL,
+ backOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.KEEP,
+ zPass: StencilOperation_default.KEEP
+ },
+ reference: StencilConstants_default.CESIUM_3D_TILE_MASK,
+ mask: StencilConstants_default.CESIUM_3D_TILE_MASK
+ }
+ });
+}
+function createCommands3(groundPolylinePrimitive, appearance, material, translucent, colorCommands, pickCommands) {
+ const primitive = groundPolylinePrimitive._primitive;
+ const length3 = primitive._va.length;
+ colorCommands.length = length3;
+ pickCommands.length = length3;
+ const isPolylineColorAppearance = appearance instanceof PolylineColorAppearance_default;
+ const materialUniforms = isPolylineColorAppearance ? {} : material._uniforms;
+ const uniformMap2 = primitive._batchTable.getUniformMapCallback()(
+ materialUniforms
+ );
+ for (let i = 0; i < length3; i++) {
+ const vertexArray = primitive._va[i];
+ let command = colorCommands[i];
+ if (!defined_default(command)) {
+ command = colorCommands[i] = new DrawCommand_default({
+ owner: groundPolylinePrimitive,
+ primitiveType: primitive._primitiveType
+ });
+ }
+ command.vertexArray = vertexArray;
+ command.renderState = groundPolylinePrimitive._renderState;
+ command.shaderProgram = groundPolylinePrimitive._sp;
+ command.uniformMap = uniformMap2;
+ command.pass = Pass_default.TERRAIN_CLASSIFICATION;
+ command.pickId = "czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";
+ const derivedTilesetCommand = DrawCommand_default.shallowClone(
+ command,
+ command.derivedCommands.tileset
+ );
+ derivedTilesetCommand.renderState = groundPolylinePrimitive._renderState3DTiles;
+ derivedTilesetCommand.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ command.derivedCommands.tileset = derivedTilesetCommand;
+ const derived2DCommand = DrawCommand_default.shallowClone(
+ command,
+ command.derivedCommands.color2D
+ );
+ derived2DCommand.shaderProgram = groundPolylinePrimitive._sp2D;
+ command.derivedCommands.color2D = derived2DCommand;
+ const derived2DTilesetCommand = DrawCommand_default.shallowClone(
+ derivedTilesetCommand,
+ derivedTilesetCommand.derivedCommands.color2D
+ );
+ derived2DTilesetCommand.shaderProgram = groundPolylinePrimitive._sp2D;
+ derivedTilesetCommand.derivedCommands.color2D = derived2DTilesetCommand;
+ const derivedMorphCommand = DrawCommand_default.shallowClone(
+ command,
+ command.derivedCommands.colorMorph
+ );
+ derivedMorphCommand.renderState = groundPolylinePrimitive._renderStateMorph;
+ derivedMorphCommand.shaderProgram = groundPolylinePrimitive._spMorph;
+ derivedMorphCommand.pickId = "czm_batchTable_pickColor(v_batchId)";
+ command.derivedCommands.colorMorph = derivedMorphCommand;
+ }
+}
+function updateAndQueueCommand(groundPolylinePrimitive, command, frameState, modelMatrix, cull, boundingVolume, debugShowBoundingVolume2) {
+ if (frameState.mode === SceneMode_default.MORPHING) {
+ command = command.derivedCommands.colorMorph;
+ } else if (frameState.mode !== SceneMode_default.SCENE3D) {
+ command = command.derivedCommands.color2D;
+ }
+ command.modelMatrix = modelMatrix;
+ command.boundingVolume = boundingVolume;
+ command.cull = cull;
+ command.debugShowBoundingVolume = debugShowBoundingVolume2;
+ frameState.commandList.push(command);
+}
+function updateAndQueueCommands4(groundPolylinePrimitive, frameState, colorCommands, pickCommands, modelMatrix, cull, debugShowBoundingVolume2) {
+ const primitive = groundPolylinePrimitive._primitive;
+ Primitive_default._updateBoundingVolumes(primitive, frameState, modelMatrix);
+ let boundingSpheres;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ boundingSpheres = primitive._boundingSphereWC;
+ } else if (frameState.mode === SceneMode_default.COLUMBUS_VIEW) {
+ boundingSpheres = primitive._boundingSphereCV;
+ } else if (frameState.mode === SceneMode_default.SCENE2D && defined_default(primitive._boundingSphere2D)) {
+ boundingSpheres = primitive._boundingSphere2D;
+ } else if (defined_default(primitive._boundingSphereMorph)) {
+ boundingSpheres = primitive._boundingSphereMorph;
+ }
+ const morphing = frameState.mode === SceneMode_default.MORPHING;
+ const classificationType = groundPolylinePrimitive.classificationType;
+ const queueTerrainCommands = classificationType !== ClassificationType_default.CESIUM_3D_TILE;
+ const queue3DTilesCommands = classificationType !== ClassificationType_default.TERRAIN && !morphing;
+ let command;
+ const passes = frameState.passes;
+ if (passes.render || passes.pick && primitive.allowPicking) {
+ const colorLength = colorCommands.length;
+ for (let j = 0; j < colorLength; ++j) {
+ const boundingVolume = boundingSpheres[j];
+ if (queueTerrainCommands) {
+ command = colorCommands[j];
+ updateAndQueueCommand(
+ groundPolylinePrimitive,
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume,
+ debugShowBoundingVolume2
+ );
+ }
+ if (queue3DTilesCommands) {
+ command = colorCommands[j].derivedCommands.tileset;
+ updateAndQueueCommand(
+ groundPolylinePrimitive,
+ command,
+ frameState,
+ modelMatrix,
+ cull,
+ boundingVolume,
+ debugShowBoundingVolume2
+ );
+ }
+ }
+ }
+}
+GroundPolylinePrimitive.prototype.update = function(frameState) {
+ if (!defined_default(this._primitive) && !defined_default(this.geometryInstances)) {
+ return;
+ }
+ if (!ApproximateTerrainHeights_default.initialized) {
+ if (!this.asynchronous) {
+ throw new DeveloperError_default(
+ "For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve."
+ );
+ }
+ GroundPolylinePrimitive.initializeTerrainHeights();
+ return;
+ }
+ let i;
+ const that = this;
+ const primitiveOptions = this._primitiveOptions;
+ if (!defined_default(this._primitive)) {
+ const geometryInstances = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances];
+ const geometryInstancesLength = geometryInstances.length;
+ const groundInstances = new Array(geometryInstancesLength);
+ let attributes;
+ for (i = 0; i < geometryInstancesLength; ++i) {
+ attributes = geometryInstances[i].attributes;
+ if (!defined_default(attributes) || !defined_default(attributes.color)) {
+ this._hasPerInstanceColors = false;
+ break;
+ }
+ }
+ for (i = 0; i < geometryInstancesLength; ++i) {
+ const geometryInstance = geometryInstances[i];
+ attributes = {};
+ const instanceAttributes = geometryInstance.attributes;
+ for (const attributeKey in instanceAttributes) {
+ if (instanceAttributes.hasOwnProperty(attributeKey)) {
+ attributes[attributeKey] = instanceAttributes[attributeKey];
+ }
+ }
+ if (!defined_default(attributes.width)) {
+ attributes.width = new GeometryInstanceAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ value: [geometryInstance.geometry.width]
+ });
+ }
+ geometryInstance.geometry._scene3DOnly = frameState.scene3DOnly;
+ GroundPolylineGeometry_default.setProjectionAndEllipsoid(
+ geometryInstance.geometry,
+ frameState.mapProjection
+ );
+ groundInstances[i] = new GeometryInstance_default({
+ geometry: geometryInstance.geometry,
+ attributes,
+ id: geometryInstance.id,
+ pickPrimitive: that
+ });
+ }
+ primitiveOptions.geometryInstances = groundInstances;
+ primitiveOptions.appearance = this.appearance;
+ primitiveOptions._createShaderProgramFunction = function(primitive, frameState2, appearance) {
+ createShaderProgram3(that, frameState2, appearance);
+ };
+ primitiveOptions._createCommandsFunction = function(primitive, appearance, material, translucent, twoPasses, colorCommands, pickCommands) {
+ createCommands3(
+ that,
+ appearance,
+ material,
+ translucent,
+ colorCommands,
+ pickCommands
+ );
+ };
+ primitiveOptions._updateAndQueueCommandsFunction = function(primitive, frameState2, colorCommands, pickCommands, modelMatrix, cull, debugShowBoundingVolume2, twoPasses) {
+ updateAndQueueCommands4(
+ that,
+ frameState2,
+ colorCommands,
+ pickCommands,
+ modelMatrix,
+ cull,
+ debugShowBoundingVolume2
+ );
+ };
+ this._primitive = new Primitive_default(primitiveOptions);
+ this._primitive.readyPromise.then(this._completeLoad);
+ }
+ if (this.appearance instanceof PolylineColorAppearance_default && !this._hasPerInstanceColors) {
+ throw new DeveloperError_default(
+ "All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive."
+ );
+ }
+ this._primitive.appearance = this.appearance;
+ this._primitive.show = this.show;
+ this._primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;
+ this._primitive.update(frameState);
+};
+GroundPolylinePrimitive.prototype.getGeometryInstanceAttributes = function(id) {
+ if (!defined_default(this._primitive)) {
+ throw new DeveloperError_default(
+ "must call update before calling getGeometryInstanceAttributes"
+ );
+ }
+ return this._primitive.getGeometryInstanceAttributes(id);
+};
+GroundPolylinePrimitive.isSupported = function(scene) {
+ return scene.frameState.context.depthTexture;
+};
+GroundPolylinePrimitive.prototype.isDestroyed = function() {
+ return false;
+};
+GroundPolylinePrimitive.prototype.destroy = function() {
+ this._primitive = this._primitive && this._primitive.destroy();
+ this._sp = this._sp && this._sp.destroy();
+ this._sp2D = void 0;
+ this._spMorph = void 0;
+ return destroyObject_default(this);
+};
+var GroundPolylinePrimitive_default = GroundPolylinePrimitive;
+
+// Source/DataSources/ImageMaterialProperty.js
+var defaultRepeat = new Cartesian2_default(1, 1);
+var defaultTransparent = false;
+var defaultColor2 = Color_default.WHITE;
+function ImageMaterialProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._definitionChanged = new Event_default();
+ this._image = void 0;
+ this._imageSubscription = void 0;
+ this._repeat = void 0;
+ this._repeatSubscription = void 0;
+ this._color = void 0;
+ this._colorSubscription = void 0;
+ this._transparent = void 0;
+ this._transparentSubscription = void 0;
+ this.image = options.image;
+ this.repeat = options.repeat;
+ this.color = options.color;
+ this.transparent = options.transparent;
+}
+Object.defineProperties(ImageMaterialProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._image) && Property_default.isConstant(this._repeat);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ image: createPropertyDescriptor_default("image"),
+ repeat: createPropertyDescriptor_default("repeat"),
+ color: createPropertyDescriptor_default("color"),
+ transparent: createPropertyDescriptor_default("transparent")
+});
+ImageMaterialProperty.prototype.getType = function(time) {
+ return "Image";
+};
+ImageMaterialProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(result)) {
+ result = {};
+ }
+ result.image = Property_default.getValueOrUndefined(this._image, time);
+ result.repeat = Property_default.getValueOrClonedDefault(
+ this._repeat,
+ time,
+ defaultRepeat,
+ result.repeat
+ );
+ result.color = Property_default.getValueOrClonedDefault(
+ this._color,
+ time,
+ defaultColor2,
+ result.color
+ );
+ if (Property_default.getValueOrDefault(this._transparent, time, defaultTransparent)) {
+ result.color.alpha = Math.min(0.99, result.color.alpha);
+ }
+ return result;
+};
+ImageMaterialProperty.prototype.equals = function(other) {
+ return this === other || other instanceof ImageMaterialProperty && Property_default.equals(this._image, other._image) && Property_default.equals(this._repeat, other._repeat) && Property_default.equals(this._color, other._color) && Property_default.equals(this._transparent, other._transparent);
+};
+var ImageMaterialProperty_default = ImageMaterialProperty;
+
+// Source/DataSources/createMaterialPropertyDescriptor.js
+function createMaterialProperty(value) {
+ if (value instanceof Color_default) {
+ return new ColorMaterialProperty_default(value);
+ }
+ if (typeof value === "string" || value instanceof Resource_default || value instanceof HTMLCanvasElement || value instanceof HTMLVideoElement) {
+ const result = new ImageMaterialProperty_default();
+ result.image = value;
+ return result;
+ }
+ throw new DeveloperError_default(`Unable to infer material type: ${value}`);
+}
+function createMaterialPropertyDescriptor(name, configurable) {
+ return createPropertyDescriptor_default(name, configurable, createMaterialProperty);
+}
+var createMaterialPropertyDescriptor_default = createMaterialPropertyDescriptor;
+
+// Source/DataSources/BoxGraphics.js
+function BoxGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._dimensions = void 0;
+ this._dimensionsSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._fill = void 0;
+ this._fillSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._outline = void 0;
+ this._outlineSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(BoxGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ dimensions: createPropertyDescriptor_default("dimensions"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ fill: createPropertyDescriptor_default("fill"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ outline: createPropertyDescriptor_default("outline"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ )
+});
+BoxGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new BoxGraphics(this);
+ }
+ result.show = this.show;
+ result.dimensions = this.dimensions;
+ result.heightReference = this.heightReference;
+ result.fill = this.fill;
+ result.material = this.material;
+ result.outline = this.outline;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ return result;
+};
+BoxGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.dimensions = defaultValue_default(this.dimensions, source.dimensions);
+ this.heightReference = defaultValue_default(
+ this.heightReference,
+ source.heightReference
+ );
+ this.fill = defaultValue_default(this.fill, source.fill);
+ this.material = defaultValue_default(this.material, source.material);
+ this.outline = defaultValue_default(this.outline, source.outline);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+};
+var BoxGraphics_default = BoxGraphics;
+
+// Source/Core/ReferenceFrame.js
+var ReferenceFrame = {
+ FIXED: 0,
+ INERTIAL: 1
+};
+var ReferenceFrame_default = Object.freeze(ReferenceFrame);
+
+// Source/DataSources/PositionProperty.js
+function PositionProperty() {
+ DeveloperError_default.throwInstantiationError();
+}
+Object.defineProperties(PositionProperty.prototype, {
+ isConstant: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ definitionChanged: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ referenceFrame: {
+ get: DeveloperError_default.throwInstantiationError
+ }
+});
+PositionProperty.prototype.getValue = DeveloperError_default.throwInstantiationError;
+PositionProperty.prototype.getValueInReferenceFrame = DeveloperError_default.throwInstantiationError;
+PositionProperty.prototype.equals = DeveloperError_default.throwInstantiationError;
+var scratchMatrix3 = new Matrix3_default();
+PositionProperty.convertToReferenceFrame = function(time, value, inputFrame, outputFrame, result) {
+ if (!defined_default(value)) {
+ return value;
+ }
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ if (inputFrame === outputFrame) {
+ return Cartesian3_default.clone(value, result);
+ }
+ let icrfToFixed2 = Transforms_default.computeIcrfToFixedMatrix(time, scratchMatrix3);
+ if (!defined_default(icrfToFixed2)) {
+ icrfToFixed2 = Transforms_default.computeTemeToPseudoFixedMatrix(
+ time,
+ scratchMatrix3
+ );
+ }
+ if (inputFrame === ReferenceFrame_default.INERTIAL) {
+ return Matrix3_default.multiplyByVector(icrfToFixed2, value, result);
+ }
+ if (inputFrame === ReferenceFrame_default.FIXED) {
+ return Matrix3_default.multiplyByVector(
+ Matrix3_default.transpose(icrfToFixed2, scratchMatrix3),
+ value,
+ result
+ );
+ }
+};
+var PositionProperty_default = PositionProperty;
+
+// Source/DataSources/ConstantPositionProperty.js
+function ConstantPositionProperty(value, referenceFrame) {
+ this._definitionChanged = new Event_default();
+ this._value = Cartesian3_default.clone(value);
+ this._referenceFrame = defaultValue_default(referenceFrame, ReferenceFrame_default.FIXED);
+}
+Object.defineProperties(ConstantPositionProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return !defined_default(this._value) || this._referenceFrame === ReferenceFrame_default.FIXED;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ referenceFrame: {
+ get: function() {
+ return this._referenceFrame;
+ }
+ }
+});
+ConstantPositionProperty.prototype.getValue = function(time, result) {
+ return this.getValueInReferenceFrame(time, ReferenceFrame_default.FIXED, result);
+};
+ConstantPositionProperty.prototype.setValue = function(value, referenceFrame) {
+ let definitionChanged = false;
+ if (!Cartesian3_default.equals(this._value, value)) {
+ definitionChanged = true;
+ this._value = Cartesian3_default.clone(value);
+ }
+ if (defined_default(referenceFrame) && this._referenceFrame !== referenceFrame) {
+ definitionChanged = true;
+ this._referenceFrame = referenceFrame;
+ }
+ if (definitionChanged) {
+ this._definitionChanged.raiseEvent(this);
+ }
+};
+ConstantPositionProperty.prototype.getValueInReferenceFrame = function(time, referenceFrame, result) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ if (!defined_default(referenceFrame)) {
+ throw new DeveloperError_default("referenceFrame is required.");
+ }
+ return PositionProperty_default.convertToReferenceFrame(
+ time,
+ this._value,
+ this._referenceFrame,
+ referenceFrame,
+ result
+ );
+};
+ConstantPositionProperty.prototype.equals = function(other) {
+ return this === other || other instanceof ConstantPositionProperty && Cartesian3_default.equals(this._value, other._value) && this._referenceFrame === other._referenceFrame;
+};
+var ConstantPositionProperty_default = ConstantPositionProperty;
+
+// Source/DataSources/CorridorGraphics.js
+function CorridorGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._positions = void 0;
+ this._positionsSubscription = void 0;
+ this._width = void 0;
+ this._widthSubscription = void 0;
+ this._height = void 0;
+ this._heightSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._extrudedHeight = void 0;
+ this._extrudedHeightSubscription = void 0;
+ this._extrudedHeightReference = void 0;
+ this._extrudedHeightReferenceSubscription = void 0;
+ this._cornerType = void 0;
+ this._cornerTypeSubscription = void 0;
+ this._granularity = void 0;
+ this._granularitySubscription = void 0;
+ this._fill = void 0;
+ this._fillSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._outline = void 0;
+ this._outlineSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this._classificationType = void 0;
+ this._classificationTypeSubscription = void 0;
+ this._zIndex = void 0;
+ this._zIndexSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(CorridorGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ positions: createPropertyDescriptor_default("positions"),
+ width: createPropertyDescriptor_default("width"),
+ height: createPropertyDescriptor_default("height"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ extrudedHeight: createPropertyDescriptor_default("extrudedHeight"),
+ extrudedHeightReference: createPropertyDescriptor_default("extrudedHeightReference"),
+ cornerType: createPropertyDescriptor_default("cornerType"),
+ granularity: createPropertyDescriptor_default("granularity"),
+ fill: createPropertyDescriptor_default("fill"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ outline: createPropertyDescriptor_default("outline"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ ),
+ classificationType: createPropertyDescriptor_default("classificationType"),
+ zIndex: createPropertyDescriptor_default("zIndex")
+});
+CorridorGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new CorridorGraphics(this);
+ }
+ result.show = this.show;
+ result.positions = this.positions;
+ result.width = this.width;
+ result.height = this.height;
+ result.heightReference = this.heightReference;
+ result.extrudedHeight = this.extrudedHeight;
+ result.extrudedHeightReference = this.extrudedHeightReference;
+ result.cornerType = this.cornerType;
+ result.granularity = this.granularity;
+ result.fill = this.fill;
+ result.material = this.material;
+ result.outline = this.outline;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ result.classificationType = this.classificationType;
+ result.zIndex = this.zIndex;
+ return result;
+};
+CorridorGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.positions = defaultValue_default(this.positions, source.positions);
+ this.width = defaultValue_default(this.width, source.width);
+ this.height = defaultValue_default(this.height, source.height);
+ this.heightReference = defaultValue_default(
+ this.heightReference,
+ source.heightReference
+ );
+ this.extrudedHeight = defaultValue_default(
+ this.extrudedHeight,
+ source.extrudedHeight
+ );
+ this.extrudedHeightReference = defaultValue_default(
+ this.extrudedHeightReference,
+ source.extrudedHeightReference
+ );
+ this.cornerType = defaultValue_default(this.cornerType, source.cornerType);
+ this.granularity = defaultValue_default(this.granularity, source.granularity);
+ this.fill = defaultValue_default(this.fill, source.fill);
+ this.material = defaultValue_default(this.material, source.material);
+ this.outline = defaultValue_default(this.outline, source.outline);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+ this.classificationType = defaultValue_default(
+ this.classificationType,
+ source.classificationType
+ );
+ this.zIndex = defaultValue_default(this.zIndex, source.zIndex);
+};
+var CorridorGraphics_default = CorridorGraphics;
+
+// Source/DataSources/createRawPropertyDescriptor.js
+function createRawProperty(value) {
+ return value;
+}
+function createRawPropertyDescriptor(name, configurable) {
+ return createPropertyDescriptor_default(name, configurable, createRawProperty);
+}
+var createRawPropertyDescriptor_default = createRawPropertyDescriptor;
+
+// Source/DataSources/CylinderGraphics.js
+function CylinderGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._length = void 0;
+ this._lengthSubscription = void 0;
+ this._topRadius = void 0;
+ this._topRadiusSubscription = void 0;
+ this._bottomRadius = void 0;
+ this._bottomRadiusSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._fill = void 0;
+ this._fillSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._outline = void 0;
+ this._outlineSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._numberOfVerticalLines = void 0;
+ this._numberOfVerticalLinesSubscription = void 0;
+ this._slices = void 0;
+ this._slicesSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(CylinderGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ length: createPropertyDescriptor_default("length"),
+ topRadius: createPropertyDescriptor_default("topRadius"),
+ bottomRadius: createPropertyDescriptor_default("bottomRadius"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ fill: createPropertyDescriptor_default("fill"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ outline: createPropertyDescriptor_default("outline"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ numberOfVerticalLines: createPropertyDescriptor_default("numberOfVerticalLines"),
+ slices: createPropertyDescriptor_default("slices"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ )
+});
+CylinderGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new CylinderGraphics(this);
+ }
+ result.show = this.show;
+ result.length = this.length;
+ result.topRadius = this.topRadius;
+ result.bottomRadius = this.bottomRadius;
+ result.heightReference = this.heightReference;
+ result.fill = this.fill;
+ result.material = this.material;
+ result.outline = this.outline;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.numberOfVerticalLines = this.numberOfVerticalLines;
+ result.slices = this.slices;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ return result;
+};
+CylinderGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.length = defaultValue_default(this.length, source.length);
+ this.topRadius = defaultValue_default(this.topRadius, source.topRadius);
+ this.bottomRadius = defaultValue_default(this.bottomRadius, source.bottomRadius);
+ this.heightReference = defaultValue_default(
+ this.heightReference,
+ source.heightReference
+ );
+ this.fill = defaultValue_default(this.fill, source.fill);
+ this.material = defaultValue_default(this.material, source.material);
+ this.outline = defaultValue_default(this.outline, source.outline);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.numberOfVerticalLines = defaultValue_default(
+ this.numberOfVerticalLines,
+ source.numberOfVerticalLines
+ );
+ this.slices = defaultValue_default(this.slices, source.slices);
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+};
+var CylinderGraphics_default = CylinderGraphics;
+
+// Source/DataSources/EllipseGraphics.js
+function EllipseGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._semiMajorAxis = void 0;
+ this._semiMajorAxisSubscription = void 0;
+ this._semiMinorAxis = void 0;
+ this._semiMinorAxisSubscription = void 0;
+ this._height = void 0;
+ this._heightSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._extrudedHeight = void 0;
+ this._extrudedHeightSubscription = void 0;
+ this._extrudedHeightReference = void 0;
+ this._extrudedHeightReferenceSubscription = void 0;
+ this._rotation = void 0;
+ this._rotationSubscription = void 0;
+ this._stRotation = void 0;
+ this._stRotationSubscription = void 0;
+ this._granularity = void 0;
+ this._granularitySubscription = void 0;
+ this._fill = void 0;
+ this._fillSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._outline = void 0;
+ this._outlineSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._numberOfVerticalLines = void 0;
+ this._numberOfVerticalLinesSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this._classificationType = void 0;
+ this._classificationTypeSubscription = void 0;
+ this._zIndex = void 0;
+ this._zIndexSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(EllipseGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ semiMajorAxis: createPropertyDescriptor_default("semiMajorAxis"),
+ semiMinorAxis: createPropertyDescriptor_default("semiMinorAxis"),
+ height: createPropertyDescriptor_default("height"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ extrudedHeight: createPropertyDescriptor_default("extrudedHeight"),
+ extrudedHeightReference: createPropertyDescriptor_default("extrudedHeightReference"),
+ rotation: createPropertyDescriptor_default("rotation"),
+ stRotation: createPropertyDescriptor_default("stRotation"),
+ granularity: createPropertyDescriptor_default("granularity"),
+ fill: createPropertyDescriptor_default("fill"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ outline: createPropertyDescriptor_default("outline"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ numberOfVerticalLines: createPropertyDescriptor_default("numberOfVerticalLines"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ ),
+ classificationType: createPropertyDescriptor_default("classificationType"),
+ zIndex: createPropertyDescriptor_default("zIndex")
+});
+EllipseGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new EllipseGraphics(this);
+ }
+ result.show = this.show;
+ result.semiMajorAxis = this.semiMajorAxis;
+ result.semiMinorAxis = this.semiMinorAxis;
+ result.height = this.height;
+ result.heightReference = this.heightReference;
+ result.extrudedHeight = this.extrudedHeight;
+ result.extrudedHeightReference = this.extrudedHeightReference;
+ result.rotation = this.rotation;
+ result.stRotation = this.stRotation;
+ result.granularity = this.granularity;
+ result.fill = this.fill;
+ result.material = this.material;
+ result.outline = this.outline;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.numberOfVerticalLines = this.numberOfVerticalLines;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ result.classificationType = this.classificationType;
+ result.zIndex = this.zIndex;
+ return result;
+};
+EllipseGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.semiMajorAxis = defaultValue_default(this.semiMajorAxis, source.semiMajorAxis);
+ this.semiMinorAxis = defaultValue_default(this.semiMinorAxis, source.semiMinorAxis);
+ this.height = defaultValue_default(this.height, source.height);
+ this.heightReference = defaultValue_default(
+ this.heightReference,
+ source.heightReference
+ );
+ this.extrudedHeight = defaultValue_default(
+ this.extrudedHeight,
+ source.extrudedHeight
+ );
+ this.extrudedHeightReference = defaultValue_default(
+ this.extrudedHeightReference,
+ source.extrudedHeightReference
+ );
+ this.rotation = defaultValue_default(this.rotation, source.rotation);
+ this.stRotation = defaultValue_default(this.stRotation, source.stRotation);
+ this.granularity = defaultValue_default(this.granularity, source.granularity);
+ this.fill = defaultValue_default(this.fill, source.fill);
+ this.material = defaultValue_default(this.material, source.material);
+ this.outline = defaultValue_default(this.outline, source.outline);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.numberOfVerticalLines = defaultValue_default(
+ this.numberOfVerticalLines,
+ source.numberOfVerticalLines
+ );
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+ this.classificationType = defaultValue_default(
+ this.classificationType,
+ source.classificationType
+ );
+ this.zIndex = defaultValue_default(this.zIndex, source.zIndex);
+};
+var EllipseGraphics_default = EllipseGraphics;
+
+// Source/DataSources/EllipsoidGraphics.js
+function EllipsoidGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._radii = void 0;
+ this._radiiSubscription = void 0;
+ this._innerRadii = void 0;
+ this._innerRadiiSubscription = void 0;
+ this._minimumClock = void 0;
+ this._minimumClockSubscription = void 0;
+ this._maximumClock = void 0;
+ this._maximumClockSubscription = void 0;
+ this._minimumCone = void 0;
+ this._minimumConeSubscription = void 0;
+ this._maximumCone = void 0;
+ this._maximumConeSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._fill = void 0;
+ this._fillSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._outline = void 0;
+ this._outlineSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._stackPartitions = void 0;
+ this._stackPartitionsSubscription = void 0;
+ this._slicePartitions = void 0;
+ this._slicePartitionsSubscription = void 0;
+ this._subdivisions = void 0;
+ this._subdivisionsSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(EllipsoidGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ radii: createPropertyDescriptor_default("radii"),
+ innerRadii: createPropertyDescriptor_default("innerRadii"),
+ minimumClock: createPropertyDescriptor_default("minimumClock"),
+ maximumClock: createPropertyDescriptor_default("maximumClock"),
+ minimumCone: createPropertyDescriptor_default("minimumCone"),
+ maximumCone: createPropertyDescriptor_default("maximumCone"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ fill: createPropertyDescriptor_default("fill"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ outline: createPropertyDescriptor_default("outline"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ stackPartitions: createPropertyDescriptor_default("stackPartitions"),
+ slicePartitions: createPropertyDescriptor_default("slicePartitions"),
+ subdivisions: createPropertyDescriptor_default("subdivisions"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ )
+});
+EllipsoidGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new EllipsoidGraphics(this);
+ }
+ result.show = this.show;
+ result.radii = this.radii;
+ result.innerRadii = this.innerRadii;
+ result.minimumClock = this.minimumClock;
+ result.maximumClock = this.maximumClock;
+ result.minimumCone = this.minimumCone;
+ result.maximumCone = this.maximumCone;
+ result.heightReference = this.heightReference;
+ result.fill = this.fill;
+ result.material = this.material;
+ result.outline = this.outline;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.stackPartitions = this.stackPartitions;
+ result.slicePartitions = this.slicePartitions;
+ result.subdivisions = this.subdivisions;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ return result;
+};
+EllipsoidGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.radii = defaultValue_default(this.radii, source.radii);
+ this.innerRadii = defaultValue_default(this.innerRadii, source.innerRadii);
+ this.minimumClock = defaultValue_default(this.minimumClock, source.minimumClock);
+ this.maximumClock = defaultValue_default(this.maximumClock, source.maximumClock);
+ this.minimumCone = defaultValue_default(this.minimumCone, source.minimumCone);
+ this.maximumCone = defaultValue_default(this.maximumCone, source.maximumCone);
+ this.heightReference = defaultValue_default(
+ this.heightReference,
+ source.heightReference
+ );
+ this.fill = defaultValue_default(this.fill, source.fill);
+ this.material = defaultValue_default(this.material, source.material);
+ this.outline = defaultValue_default(this.outline, source.outline);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.stackPartitions = defaultValue_default(
+ this.stackPartitions,
+ source.stackPartitions
+ );
+ this.slicePartitions = defaultValue_default(
+ this.slicePartitions,
+ source.slicePartitions
+ );
+ this.subdivisions = defaultValue_default(this.subdivisions, source.subdivisions);
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+};
+var EllipsoidGraphics_default = EllipsoidGraphics;
+
+// Source/DataSources/LabelGraphics.js
+function LabelGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._text = void 0;
+ this._textSubscription = void 0;
+ this._font = void 0;
+ this._fontSubscription = void 0;
+ this._style = void 0;
+ this._styleSubscription = void 0;
+ this._scale = void 0;
+ this._scaleSubscription = void 0;
+ this._showBackground = void 0;
+ this._showBackgroundSubscription = void 0;
+ this._backgroundColor = void 0;
+ this._backgroundColorSubscription = void 0;
+ this._backgroundPadding = void 0;
+ this._backgroundPaddingSubscription = void 0;
+ this._pixelOffset = void 0;
+ this._pixelOffsetSubscription = void 0;
+ this._eyeOffset = void 0;
+ this._eyeOffsetSubscription = void 0;
+ this._horizontalOrigin = void 0;
+ this._horizontalOriginSubscription = void 0;
+ this._verticalOrigin = void 0;
+ this._verticalOriginSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._fillColor = void 0;
+ this._fillColorSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._translucencyByDistance = void 0;
+ this._translucencyByDistanceSubscription = void 0;
+ this._pixelOffsetScaleByDistance = void 0;
+ this._pixelOffsetScaleByDistanceSubscription = void 0;
+ this._scaleByDistance = void 0;
+ this._scaleByDistanceSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this._disableDepthTestDistance = void 0;
+ this._disableDepthTestDistanceSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(LabelGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ text: createPropertyDescriptor_default("text"),
+ font: createPropertyDescriptor_default("font"),
+ style: createPropertyDescriptor_default("style"),
+ scale: createPropertyDescriptor_default("scale"),
+ showBackground: createPropertyDescriptor_default("showBackground"),
+ backgroundColor: createPropertyDescriptor_default("backgroundColor"),
+ backgroundPadding: createPropertyDescriptor_default("backgroundPadding"),
+ pixelOffset: createPropertyDescriptor_default("pixelOffset"),
+ eyeOffset: createPropertyDescriptor_default("eyeOffset"),
+ horizontalOrigin: createPropertyDescriptor_default("horizontalOrigin"),
+ verticalOrigin: createPropertyDescriptor_default("verticalOrigin"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ fillColor: createPropertyDescriptor_default("fillColor"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ translucencyByDistance: createPropertyDescriptor_default("translucencyByDistance"),
+ pixelOffsetScaleByDistance: createPropertyDescriptor_default(
+ "pixelOffsetScaleByDistance"
+ ),
+ scaleByDistance: createPropertyDescriptor_default("scaleByDistance"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ ),
+ disableDepthTestDistance: createPropertyDescriptor_default(
+ "disableDepthTestDistance"
+ )
+});
+LabelGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new LabelGraphics(this);
+ }
+ result.show = this.show;
+ result.text = this.text;
+ result.font = this.font;
+ result.style = this.style;
+ result.scale = this.scale;
+ result.showBackground = this.showBackground;
+ result.backgroundColor = this.backgroundColor;
+ result.backgroundPadding = this.backgroundPadding;
+ result.pixelOffset = this.pixelOffset;
+ result.eyeOffset = this.eyeOffset;
+ result.horizontalOrigin = this.horizontalOrigin;
+ result.verticalOrigin = this.verticalOrigin;
+ result.heightReference = this.heightReference;
+ result.fillColor = this.fillColor;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.translucencyByDistance = this.translucencyByDistance;
+ result.pixelOffsetScaleByDistance = this.pixelOffsetScaleByDistance;
+ result.scaleByDistance = this.scaleByDistance;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ result.disableDepthTestDistance = this.disableDepthTestDistance;
+ return result;
+};
+LabelGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.text = defaultValue_default(this.text, source.text);
+ this.font = defaultValue_default(this.font, source.font);
+ this.style = defaultValue_default(this.style, source.style);
+ this.scale = defaultValue_default(this.scale, source.scale);
+ this.showBackground = defaultValue_default(
+ this.showBackground,
+ source.showBackground
+ );
+ this.backgroundColor = defaultValue_default(
+ this.backgroundColor,
+ source.backgroundColor
+ );
+ this.backgroundPadding = defaultValue_default(
+ this.backgroundPadding,
+ source.backgroundPadding
+ );
+ this.pixelOffset = defaultValue_default(this.pixelOffset, source.pixelOffset);
+ this.eyeOffset = defaultValue_default(this.eyeOffset, source.eyeOffset);
+ this.horizontalOrigin = defaultValue_default(
+ this.horizontalOrigin,
+ source.horizontalOrigin
+ );
+ this.verticalOrigin = defaultValue_default(
+ this.verticalOrigin,
+ source.verticalOrigin
+ );
+ this.heightReference = defaultValue_default(
+ this.heightReference,
+ source.heightReference
+ );
+ this.fillColor = defaultValue_default(this.fillColor, source.fillColor);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.translucencyByDistance = defaultValue_default(
+ this.translucencyByDistance,
+ source.translucencyByDistance
+ );
+ this.pixelOffsetScaleByDistance = defaultValue_default(
+ this.pixelOffsetScaleByDistance,
+ source.pixelOffsetScaleByDistance
+ );
+ this.scaleByDistance = defaultValue_default(
+ this.scaleByDistance,
+ source.scaleByDistance
+ );
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+ this.disableDepthTestDistance = defaultValue_default(
+ this.disableDepthTestDistance,
+ source.disableDepthTestDistance
+ );
+};
+var LabelGraphics_default = LabelGraphics;
+
+// Source/Core/TranslationRotationScale.js
+var defaultScale2 = new Cartesian3_default(1, 1, 1);
+var defaultTranslation = Cartesian3_default.ZERO;
+var defaultRotation2 = Quaternion_default.IDENTITY;
+function TranslationRotationScale(translation3, rotation, scale) {
+ this.translation = Cartesian3_default.clone(
+ defaultValue_default(translation3, defaultTranslation)
+ );
+ this.rotation = Quaternion_default.clone(defaultValue_default(rotation, defaultRotation2));
+ this.scale = Cartesian3_default.clone(defaultValue_default(scale, defaultScale2));
+}
+TranslationRotationScale.prototype.equals = function(right) {
+ return this === right || defined_default(right) && Cartesian3_default.equals(this.translation, right.translation) && Quaternion_default.equals(this.rotation, right.rotation) && Cartesian3_default.equals(this.scale, right.scale);
+};
+var TranslationRotationScale_default = TranslationRotationScale;
+
+// Source/DataSources/NodeTransformationProperty.js
+var defaultNodeTransformation = new TranslationRotationScale_default();
+function NodeTransformationProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._definitionChanged = new Event_default();
+ this._translation = void 0;
+ this._translationSubscription = void 0;
+ this._rotation = void 0;
+ this._rotationSubscription = void 0;
+ this._scale = void 0;
+ this._scaleSubscription = void 0;
+ this.translation = options.translation;
+ this.rotation = options.rotation;
+ this.scale = options.scale;
+}
+Object.defineProperties(NodeTransformationProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._translation) && Property_default.isConstant(this._rotation) && Property_default.isConstant(this._scale);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ translation: createPropertyDescriptor_default("translation"),
+ rotation: createPropertyDescriptor_default("rotation"),
+ scale: createPropertyDescriptor_default("scale")
+});
+NodeTransformationProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(result)) {
+ result = new TranslationRotationScale_default();
+ }
+ result.translation = Property_default.getValueOrClonedDefault(
+ this._translation,
+ time,
+ defaultNodeTransformation.translation,
+ result.translation
+ );
+ result.rotation = Property_default.getValueOrClonedDefault(
+ this._rotation,
+ time,
+ defaultNodeTransformation.rotation,
+ result.rotation
+ );
+ result.scale = Property_default.getValueOrClonedDefault(
+ this._scale,
+ time,
+ defaultNodeTransformation.scale,
+ result.scale
+ );
+ return result;
+};
+NodeTransformationProperty.prototype.equals = function(other) {
+ return this === other || other instanceof NodeTransformationProperty && Property_default.equals(this._translation, other._translation) && Property_default.equals(this._rotation, other._rotation) && Property_default.equals(this._scale, other._scale);
+};
+var NodeTransformationProperty_default = NodeTransformationProperty;
+
+// Source/DataSources/PropertyBag.js
+function PropertyBag(value, createPropertyCallback) {
+ this._propertyNames = [];
+ this._definitionChanged = new Event_default();
+ if (defined_default(value)) {
+ this.merge(value, createPropertyCallback);
+ }
+}
+Object.defineProperties(PropertyBag.prototype, {
+ propertyNames: {
+ get: function() {
+ return this._propertyNames;
+ }
+ },
+ isConstant: {
+ get: function() {
+ const propertyNames = this._propertyNames;
+ for (let i = 0, len = propertyNames.length; i < len; i++) {
+ if (!Property_default.isConstant(this[propertyNames[i]])) {
+ return false;
+ }
+ }
+ return true;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ }
+});
+PropertyBag.prototype.hasProperty = function(propertyName) {
+ return this._propertyNames.indexOf(propertyName) !== -1;
+};
+function createConstantProperty2(value) {
+ return new ConstantProperty_default(value);
+}
+PropertyBag.prototype.addProperty = function(propertyName, value, createPropertyCallback) {
+ const propertyNames = this._propertyNames;
+ if (!defined_default(propertyName)) {
+ throw new DeveloperError_default("propertyName is required.");
+ }
+ if (propertyNames.indexOf(propertyName) !== -1) {
+ throw new DeveloperError_default(
+ `${propertyName} is already a registered property.`
+ );
+ }
+ propertyNames.push(propertyName);
+ Object.defineProperty(
+ this,
+ propertyName,
+ createPropertyDescriptor_default(
+ propertyName,
+ true,
+ defaultValue_default(createPropertyCallback, createConstantProperty2)
+ )
+ );
+ if (defined_default(value)) {
+ this[propertyName] = value;
+ }
+ this._definitionChanged.raiseEvent(this);
+};
+PropertyBag.prototype.removeProperty = function(propertyName) {
+ const propertyNames = this._propertyNames;
+ const index = propertyNames.indexOf(propertyName);
+ if (!defined_default(propertyName)) {
+ throw new DeveloperError_default("propertyName is required.");
+ }
+ if (index === -1) {
+ throw new DeveloperError_default(`${propertyName} is not a registered property.`);
+ }
+ this._propertyNames.splice(index, 1);
+ delete this[propertyName];
+ this._definitionChanged.raiseEvent(this);
+};
+PropertyBag.prototype.getValue = function(time, result) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ if (!defined_default(result)) {
+ result = {};
+ }
+ const propertyNames = this._propertyNames;
+ for (let i = 0, len = propertyNames.length; i < len; i++) {
+ const propertyName = propertyNames[i];
+ result[propertyName] = Property_default.getValueOrUndefined(
+ this[propertyName],
+ time,
+ result[propertyName]
+ );
+ }
+ return result;
+};
+PropertyBag.prototype.merge = function(source, createPropertyCallback) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ const propertyNames = this._propertyNames;
+ const sourcePropertyNames = defined_default(source._propertyNames) ? source._propertyNames : Object.keys(source);
+ for (let i = 0, len = sourcePropertyNames.length; i < len; i++) {
+ const name = sourcePropertyNames[i];
+ const targetProperty = this[name];
+ const sourceProperty = source[name];
+ if (targetProperty === void 0 && propertyNames.indexOf(name) === -1) {
+ this.addProperty(name, void 0, createPropertyCallback);
+ }
+ if (sourceProperty !== void 0) {
+ if (targetProperty !== void 0) {
+ if (defined_default(targetProperty) && defined_default(targetProperty.merge)) {
+ targetProperty.merge(sourceProperty);
+ }
+ } else if (defined_default(sourceProperty) && defined_default(sourceProperty.merge) && defined_default(sourceProperty.clone)) {
+ this[name] = sourceProperty.clone();
+ } else {
+ this[name] = sourceProperty;
+ }
+ }
+ }
+};
+function propertiesEqual(a3, b) {
+ const aPropertyNames = a3._propertyNames;
+ const bPropertyNames = b._propertyNames;
+ const len = aPropertyNames.length;
+ if (len !== bPropertyNames.length) {
+ return false;
+ }
+ for (let aIndex = 0; aIndex < len; ++aIndex) {
+ const name = aPropertyNames[aIndex];
+ const bIndex = bPropertyNames.indexOf(name);
+ if (bIndex === -1) {
+ return false;
+ }
+ if (!Property_default.equals(a3[name], b[name])) {
+ return false;
+ }
+ }
+ return true;
+}
+PropertyBag.prototype.equals = function(other) {
+ return this === other || other instanceof PropertyBag && propertiesEqual(this, other);
+};
+var PropertyBag_default = PropertyBag;
+
+// Source/DataSources/ModelGraphics.js
+function createNodeTransformationProperty(value) {
+ return new NodeTransformationProperty_default(value);
+}
+function createNodeTransformationPropertyBag(value) {
+ return new PropertyBag_default(value, createNodeTransformationProperty);
+}
+function createArticulationStagePropertyBag(value) {
+ return new PropertyBag_default(value);
+}
+function ModelGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._uri = void 0;
+ this._uriSubscription = void 0;
+ this._scale = void 0;
+ this._scaleSubscription = void 0;
+ this._minimumPixelSize = void 0;
+ this._minimumPixelSizeSubscription = void 0;
+ this._maximumScale = void 0;
+ this._maximumScaleSubscription = void 0;
+ this._incrementallyLoadTextures = void 0;
+ this._incrementallyLoadTexturesSubscription = void 0;
+ this._runAnimations = void 0;
+ this._runAnimationsSubscription = void 0;
+ this._clampAnimations = void 0;
+ this._clampAnimationsSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._silhouetteColor = void 0;
+ this._silhouetteColorSubscription = void 0;
+ this._silhouetteSize = void 0;
+ this._silhouetteSizeSubscription = void 0;
+ this._color = void 0;
+ this._colorSubscription = void 0;
+ this._colorBlendMode = void 0;
+ this._colorBlendModeSubscription = void 0;
+ this._colorBlendAmount = void 0;
+ this._colorBlendAmountSubscription = void 0;
+ this._imageBasedLightingFactor = void 0;
+ this._imageBasedLightingFactorSubscription = void 0;
+ this._lightColor = void 0;
+ this._lightColorSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this._nodeTransformations = void 0;
+ this._nodeTransformationsSubscription = void 0;
+ this._articulations = void 0;
+ this._articulationsSubscription = void 0;
+ this._clippingPlanes = void 0;
+ this._clippingPlanesSubscription = void 0;
+ this._customShader = void 0;
+ this._customShaderSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(ModelGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ uri: createPropertyDescriptor_default("uri"),
+ scale: createPropertyDescriptor_default("scale"),
+ minimumPixelSize: createPropertyDescriptor_default("minimumPixelSize"),
+ maximumScale: createPropertyDescriptor_default("maximumScale"),
+ incrementallyLoadTextures: createPropertyDescriptor_default(
+ "incrementallyLoadTextures"
+ ),
+ runAnimations: createPropertyDescriptor_default("runAnimations"),
+ clampAnimations: createPropertyDescriptor_default("clampAnimations"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ silhouetteColor: createPropertyDescriptor_default("silhouetteColor"),
+ silhouetteSize: createPropertyDescriptor_default("silhouetteSize"),
+ color: createPropertyDescriptor_default("color"),
+ colorBlendMode: createPropertyDescriptor_default("colorBlendMode"),
+ colorBlendAmount: createPropertyDescriptor_default("colorBlendAmount"),
+ imageBasedLightingFactor: createPropertyDescriptor_default(
+ "imageBasedLightingFactor"
+ ),
+ lightColor: createPropertyDescriptor_default("lightColor"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ ),
+ nodeTransformations: createPropertyDescriptor_default(
+ "nodeTransformations",
+ void 0,
+ createNodeTransformationPropertyBag
+ ),
+ articulations: createPropertyDescriptor_default(
+ "articulations",
+ void 0,
+ createArticulationStagePropertyBag
+ ),
+ clippingPlanes: createPropertyDescriptor_default("clippingPlanes"),
+ customShader: createPropertyDescriptor_default("customShader")
+});
+ModelGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new ModelGraphics(this);
+ }
+ result.show = this.show;
+ result.uri = this.uri;
+ result.scale = this.scale;
+ result.minimumPixelSize = this.minimumPixelSize;
+ result.maximumScale = this.maximumScale;
+ result.incrementallyLoadTextures = this.incrementallyLoadTextures;
+ result.runAnimations = this.runAnimations;
+ result.clampAnimations = this.clampAnimations;
+ result.heightReference = this._heightReference;
+ result.silhouetteColor = this.silhouetteColor;
+ result.silhouetteSize = this.silhouetteSize;
+ result.color = this.color;
+ result.colorBlendMode = this.colorBlendMode;
+ result.colorBlendAmount = this.colorBlendAmount;
+ result.imageBasedLightingFactor = this.imageBasedLightingFactor;
+ result.lightColor = this.lightColor;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ result.nodeTransformations = this.nodeTransformations;
+ result.articulations = this.articulations;
+ result.clippingPlanes = this.clippingPlanes;
+ result.customShader = this.customShader;
+ return result;
+};
+ModelGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.uri = defaultValue_default(this.uri, source.uri);
+ this.scale = defaultValue_default(this.scale, source.scale);
+ this.minimumPixelSize = defaultValue_default(
+ this.minimumPixelSize,
+ source.minimumPixelSize
+ );
+ this.maximumScale = defaultValue_default(this.maximumScale, source.maximumScale);
+ this.incrementallyLoadTextures = defaultValue_default(
+ this.incrementallyLoadTextures,
+ source.incrementallyLoadTextures
+ );
+ this.runAnimations = defaultValue_default(this.runAnimations, source.runAnimations);
+ this.clampAnimations = defaultValue_default(
+ this.clampAnimations,
+ source.clampAnimations
+ );
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.heightReference = defaultValue_default(
+ this.heightReference,
+ source.heightReference
+ );
+ this.silhouetteColor = defaultValue_default(
+ this.silhouetteColor,
+ source.silhouetteColor
+ );
+ this.silhouetteSize = defaultValue_default(
+ this.silhouetteSize,
+ source.silhouetteSize
+ );
+ this.color = defaultValue_default(this.color, source.color);
+ this.colorBlendMode = defaultValue_default(
+ this.colorBlendMode,
+ source.colorBlendMode
+ );
+ this.colorBlendAmount = defaultValue_default(
+ this.colorBlendAmount,
+ source.colorBlendAmount
+ );
+ this.imageBasedLightingFactor = defaultValue_default(
+ this.imageBasedLightingFactor,
+ source.imageBasedLightingFactor
+ );
+ this.lightColor = defaultValue_default(this.lightColor, source.lightColor);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+ this.clippingPlanes = defaultValue_default(
+ this.clippingPlanes,
+ source.clippingPlanes
+ );
+ this.customShader = defaultValue_default(this.customShader, source.customShader);
+ const sourceNodeTransformations = source.nodeTransformations;
+ if (defined_default(sourceNodeTransformations)) {
+ const targetNodeTransformations = this.nodeTransformations;
+ if (defined_default(targetNodeTransformations)) {
+ targetNodeTransformations.merge(sourceNodeTransformations);
+ } else {
+ this.nodeTransformations = new PropertyBag_default(
+ sourceNodeTransformations,
+ createNodeTransformationProperty
+ );
+ }
+ }
+ const sourceArticulations = source.articulations;
+ if (defined_default(sourceArticulations)) {
+ const targetArticulations = this.articulations;
+ if (defined_default(targetArticulations)) {
+ targetArticulations.merge(sourceArticulations);
+ } else {
+ this.articulations = new PropertyBag_default(sourceArticulations);
+ }
+ }
+};
+var ModelGraphics_default = ModelGraphics;
+
+// Source/DataSources/Cesium3DTilesetGraphics.js
+function Cesium3DTilesetGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._uri = void 0;
+ this._uriSubscription = void 0;
+ this._maximumScreenSpaceError = void 0;
+ this._maximumScreenSpaceErrorSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(Cesium3DTilesetGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ uri: createPropertyDescriptor_default("uri"),
+ maximumScreenSpaceError: createPropertyDescriptor_default("maximumScreenSpaceError")
+});
+Cesium3DTilesetGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new Cesium3DTilesetGraphics(this);
+ }
+ result.show = this.show;
+ result.uri = this.uri;
+ result.maximumScreenSpaceError = this.maximumScreenSpaceError;
+ return result;
+};
+Cesium3DTilesetGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.uri = defaultValue_default(this.uri, source.uri);
+ this.maximumScreenSpaceError = defaultValue_default(
+ this.maximumScreenSpaceError,
+ source.maximumScreenSpaceError
+ );
+};
+var Cesium3DTilesetGraphics_default = Cesium3DTilesetGraphics;
+
+// Source/DataSources/PathGraphics.js
+function PathGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._leadTime = void 0;
+ this._leadTimeSubscription = void 0;
+ this._trailTime = void 0;
+ this._trailTimeSubscription = void 0;
+ this._width = void 0;
+ this._widthSubscription = void 0;
+ this._resolution = void 0;
+ this._resolutionSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(PathGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ leadTime: createPropertyDescriptor_default("leadTime"),
+ trailTime: createPropertyDescriptor_default("trailTime"),
+ width: createPropertyDescriptor_default("width"),
+ resolution: createPropertyDescriptor_default("resolution"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ )
+});
+PathGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new PathGraphics(this);
+ }
+ result.show = this.show;
+ result.leadTime = this.leadTime;
+ result.trailTime = this.trailTime;
+ result.width = this.width;
+ result.resolution = this.resolution;
+ result.material = this.material;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ return result;
+};
+PathGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.leadTime = defaultValue_default(this.leadTime, source.leadTime);
+ this.trailTime = defaultValue_default(this.trailTime, source.trailTime);
+ this.width = defaultValue_default(this.width, source.width);
+ this.resolution = defaultValue_default(this.resolution, source.resolution);
+ this.material = defaultValue_default(this.material, source.material);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+};
+var PathGraphics_default = PathGraphics;
+
+// Source/DataSources/PlaneGraphics.js
+function PlaneGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._plane = void 0;
+ this._planeSubscription = void 0;
+ this._dimensions = void 0;
+ this._dimensionsSubscription = void 0;
+ this._fill = void 0;
+ this._fillSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._outline = void 0;
+ this._outlineSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(PlaneGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ plane: createPropertyDescriptor_default("plane"),
+ dimensions: createPropertyDescriptor_default("dimensions"),
+ fill: createPropertyDescriptor_default("fill"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ outline: createPropertyDescriptor_default("outline"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ )
+});
+PlaneGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new PlaneGraphics(this);
+ }
+ result.show = this.show;
+ result.plane = this.plane;
+ result.dimensions = this.dimensions;
+ result.fill = this.fill;
+ result.material = this.material;
+ result.outline = this.outline;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ return result;
+};
+PlaneGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.plane = defaultValue_default(this.plane, source.plane);
+ this.dimensions = defaultValue_default(this.dimensions, source.dimensions);
+ this.fill = defaultValue_default(this.fill, source.fill);
+ this.material = defaultValue_default(this.material, source.material);
+ this.outline = defaultValue_default(this.outline, source.outline);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+};
+var PlaneGraphics_default = PlaneGraphics;
+
+// Source/DataSources/PointGraphics.js
+function PointGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._pixelSize = void 0;
+ this._pixelSizeSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._color = void 0;
+ this._colorSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._scaleByDistance = void 0;
+ this._scaleByDistanceSubscription = void 0;
+ this._translucencyByDistance = void 0;
+ this._translucencyByDistanceSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this._disableDepthTestDistance = void 0;
+ this._disableDepthTestDistanceSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(PointGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ pixelSize: createPropertyDescriptor_default("pixelSize"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ color: createPropertyDescriptor_default("color"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ scaleByDistance: createPropertyDescriptor_default("scaleByDistance"),
+ translucencyByDistance: createPropertyDescriptor_default("translucencyByDistance"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ ),
+ disableDepthTestDistance: createPropertyDescriptor_default(
+ "disableDepthTestDistance"
+ )
+});
+PointGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new PointGraphics(this);
+ }
+ result.show = this.show;
+ result.pixelSize = this.pixelSize;
+ result.heightReference = this.heightReference;
+ result.color = this.color;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.scaleByDistance = this.scaleByDistance;
+ result.translucencyByDistance = this._translucencyByDistance;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ result.disableDepthTestDistance = this.disableDepthTestDistance;
+ return result;
+};
+PointGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.pixelSize = defaultValue_default(this.pixelSize, source.pixelSize);
+ this.heightReference = defaultValue_default(
+ this.heightReference,
+ source.heightReference
+ );
+ this.color = defaultValue_default(this.color, source.color);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.scaleByDistance = defaultValue_default(
+ this.scaleByDistance,
+ source.scaleByDistance
+ );
+ this.translucencyByDistance = defaultValue_default(
+ this._translucencyByDistance,
+ source.translucencyByDistance
+ );
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+ this.disableDepthTestDistance = defaultValue_default(
+ this.disableDepthTestDistance,
+ source.disableDepthTestDistance
+ );
+};
+var PointGraphics_default = PointGraphics;
+
+// Source/Core/PolygonHierarchy.js
+function PolygonHierarchy(positions, holes) {
+ this.positions = defined_default(positions) ? positions : [];
+ this.holes = defined_default(holes) ? holes : [];
+}
+var PolygonHierarchy_default = PolygonHierarchy;
+
+// Source/DataSources/PolygonGraphics.js
+function createPolygonHierarchyProperty(value) {
+ if (Array.isArray(value)) {
+ value = new PolygonHierarchy_default(value);
+ }
+ return new ConstantProperty_default(value);
+}
+function PolygonGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._hierarchy = void 0;
+ this._hierarchySubscription = void 0;
+ this._height = void 0;
+ this._heightSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._extrudedHeight = void 0;
+ this._extrudedHeightSubscription = void 0;
+ this._extrudedHeightReference = void 0;
+ this._extrudedHeightReferenceSubscription = void 0;
+ this._stRotation = void 0;
+ this._stRotationSubscription = void 0;
+ this._granularity = void 0;
+ this._granularitySubscription = void 0;
+ this._fill = void 0;
+ this._fillSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._outline = void 0;
+ this._outlineSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._perPositionHeight = void 0;
+ this._perPositionHeightSubscription = void 0;
+ this._closeTop = void 0;
+ this._closeTopSubscription = void 0;
+ this._closeBottom = void 0;
+ this._closeBottomSubscription = void 0;
+ this._arcType = void 0;
+ this._arcTypeSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this._classificationType = void 0;
+ this._classificationTypeSubscription = void 0;
+ this._zIndex = void 0;
+ this._zIndexSubscription = void 0;
+ this._textureCoordinates = void 0;
+ this._textureCoordinatesSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(PolygonGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ hierarchy: createPropertyDescriptor_default(
+ "hierarchy",
+ void 0,
+ createPolygonHierarchyProperty
+ ),
+ height: createPropertyDescriptor_default("height"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ extrudedHeight: createPropertyDescriptor_default("extrudedHeight"),
+ extrudedHeightReference: createPropertyDescriptor_default("extrudedHeightReference"),
+ stRotation: createPropertyDescriptor_default("stRotation"),
+ granularity: createPropertyDescriptor_default("granularity"),
+ fill: createPropertyDescriptor_default("fill"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ outline: createPropertyDescriptor_default("outline"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ perPositionHeight: createPropertyDescriptor_default("perPositionHeight"),
+ closeTop: createPropertyDescriptor_default("closeTop"),
+ closeBottom: createPropertyDescriptor_default("closeBottom"),
+ arcType: createPropertyDescriptor_default("arcType"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ ),
+ classificationType: createPropertyDescriptor_default("classificationType"),
+ zIndex: createPropertyDescriptor_default("zIndex"),
+ textureCoordinates: createPropertyDescriptor_default("textureCoordinates")
+});
+PolygonGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new PolygonGraphics(this);
+ }
+ result.show = this.show;
+ result.hierarchy = this.hierarchy;
+ result.height = this.height;
+ result.heightReference = this.heightReference;
+ result.extrudedHeight = this.extrudedHeight;
+ result.extrudedHeightReference = this.extrudedHeightReference;
+ result.stRotation = this.stRotation;
+ result.granularity = this.granularity;
+ result.fill = this.fill;
+ result.material = this.material;
+ result.outline = this.outline;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.perPositionHeight = this.perPositionHeight;
+ result.closeTop = this.closeTop;
+ result.closeBottom = this.closeBottom;
+ result.arcType = this.arcType;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ result.classificationType = this.classificationType;
+ result.zIndex = this.zIndex;
+ result.textureCoordinates = this.textureCoordinates;
+ return result;
+};
+PolygonGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.hierarchy = defaultValue_default(this.hierarchy, source.hierarchy);
+ this.height = defaultValue_default(this.height, source.height);
+ this.heightReference = defaultValue_default(
+ this.heightReference,
+ source.heightReference
+ );
+ this.extrudedHeight = defaultValue_default(
+ this.extrudedHeight,
+ source.extrudedHeight
+ );
+ this.extrudedHeightReference = defaultValue_default(
+ this.extrudedHeightReference,
+ source.extrudedHeightReference
+ );
+ this.stRotation = defaultValue_default(this.stRotation, source.stRotation);
+ this.granularity = defaultValue_default(this.granularity, source.granularity);
+ this.fill = defaultValue_default(this.fill, source.fill);
+ this.material = defaultValue_default(this.material, source.material);
+ this.outline = defaultValue_default(this.outline, source.outline);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.perPositionHeight = defaultValue_default(
+ this.perPositionHeight,
+ source.perPositionHeight
+ );
+ this.closeTop = defaultValue_default(this.closeTop, source.closeTop);
+ this.closeBottom = defaultValue_default(this.closeBottom, source.closeBottom);
+ this.arcType = defaultValue_default(this.arcType, source.arcType);
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+ this.classificationType = defaultValue_default(
+ this.classificationType,
+ source.classificationType
+ );
+ this.zIndex = defaultValue_default(this.zIndex, source.zIndex);
+ this.textureCoordinates = defaultValue_default(
+ this.textureCoordinates,
+ source.textureCoordinates
+ );
+};
+var PolygonGraphics_default = PolygonGraphics;
+
+// Source/DataSources/PolylineGraphics.js
+function PolylineGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._positions = void 0;
+ this._positionsSubscription = void 0;
+ this._width = void 0;
+ this._widthSubscription = void 0;
+ this._granularity = void 0;
+ this._granularitySubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._depthFailMaterial = void 0;
+ this._depthFailMaterialSubscription = void 0;
+ this._arcType = void 0;
+ this._arcTypeSubscription = void 0;
+ this._clampToGround = void 0;
+ this._clampToGroundSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this._classificationType = void 0;
+ this._classificationTypeSubscription = void 0;
+ this._zIndex = void 0;
+ this._zIndexSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(PolylineGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ positions: createPropertyDescriptor_default("positions"),
+ width: createPropertyDescriptor_default("width"),
+ granularity: createPropertyDescriptor_default("granularity"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ depthFailMaterial: createMaterialPropertyDescriptor_default("depthFailMaterial"),
+ arcType: createPropertyDescriptor_default("arcType"),
+ clampToGround: createPropertyDescriptor_default("clampToGround"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ ),
+ classificationType: createPropertyDescriptor_default("classificationType"),
+ zIndex: createPropertyDescriptor_default("zIndex")
+});
+PolylineGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new PolylineGraphics(this);
+ }
+ result.show = this.show;
+ result.positions = this.positions;
+ result.width = this.width;
+ result.granularity = this.granularity;
+ result.material = this.material;
+ result.depthFailMaterial = this.depthFailMaterial;
+ result.arcType = this.arcType;
+ result.clampToGround = this.clampToGround;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ result.classificationType = this.classificationType;
+ result.zIndex = this.zIndex;
+ return result;
+};
+PolylineGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.positions = defaultValue_default(this.positions, source.positions);
+ this.width = defaultValue_default(this.width, source.width);
+ this.granularity = defaultValue_default(this.granularity, source.granularity);
+ this.material = defaultValue_default(this.material, source.material);
+ this.depthFailMaterial = defaultValue_default(
+ this.depthFailMaterial,
+ source.depthFailMaterial
+ );
+ this.arcType = defaultValue_default(this.arcType, source.arcType);
+ this.clampToGround = defaultValue_default(this.clampToGround, source.clampToGround);
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+ this.classificationType = defaultValue_default(
+ this.classificationType,
+ source.classificationType
+ );
+ this.zIndex = defaultValue_default(this.zIndex, source.zIndex);
+};
+var PolylineGraphics_default = PolylineGraphics;
+
+// Source/DataSources/PolylineVolumeGraphics.js
+function PolylineVolumeGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._positions = void 0;
+ this._positionsSubscription = void 0;
+ this._shape = void 0;
+ this._shapeSubscription = void 0;
+ this._cornerType = void 0;
+ this._cornerTypeSubscription = void 0;
+ this._granularity = void 0;
+ this._granularitySubscription = void 0;
+ this._fill = void 0;
+ this._fillSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._outline = void 0;
+ this._outlineSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubsription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(PolylineVolumeGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ positions: createPropertyDescriptor_default("positions"),
+ shape: createPropertyDescriptor_default("shape"),
+ cornerType: createPropertyDescriptor_default("cornerType"),
+ granularity: createPropertyDescriptor_default("granularity"),
+ fill: createPropertyDescriptor_default("fill"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ outline: createPropertyDescriptor_default("outline"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ )
+});
+PolylineVolumeGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new PolylineVolumeGraphics(this);
+ }
+ result.show = this.show;
+ result.positions = this.positions;
+ result.shape = this.shape;
+ result.cornerType = this.cornerType;
+ result.granularity = this.granularity;
+ result.fill = this.fill;
+ result.material = this.material;
+ result.outline = this.outline;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ return result;
+};
+PolylineVolumeGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.positions = defaultValue_default(this.positions, source.positions);
+ this.shape = defaultValue_default(this.shape, source.shape);
+ this.cornerType = defaultValue_default(this.cornerType, source.cornerType);
+ this.granularity = defaultValue_default(this.granularity, source.granularity);
+ this.fill = defaultValue_default(this.fill, source.fill);
+ this.material = defaultValue_default(this.material, source.material);
+ this.outline = defaultValue_default(this.outline, source.outline);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+};
+var PolylineVolumeGraphics_default = PolylineVolumeGraphics;
+
+// Source/DataSources/RectangleGraphics.js
+function RectangleGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._coordinates = void 0;
+ this._coordinatesSubscription = void 0;
+ this._height = void 0;
+ this._heightSubscription = void 0;
+ this._heightReference = void 0;
+ this._heightReferenceSubscription = void 0;
+ this._extrudedHeight = void 0;
+ this._extrudedHeightSubscription = void 0;
+ this._extrudedHeightReference = void 0;
+ this._extrudedHeightReferenceSubscription = void 0;
+ this._rotation = void 0;
+ this._rotationSubscription = void 0;
+ this._stRotation = void 0;
+ this._stRotationSubscription = void 0;
+ this._granularity = void 0;
+ this._granularitySubscription = void 0;
+ this._fill = void 0;
+ this._fillSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._outline = void 0;
+ this._outlineSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distancedisplayConditionSubscription = void 0;
+ this._classificationType = void 0;
+ this._classificationTypeSubscription = void 0;
+ this._zIndex = void 0;
+ this._zIndexSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(RectangleGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ coordinates: createPropertyDescriptor_default("coordinates"),
+ height: createPropertyDescriptor_default("height"),
+ heightReference: createPropertyDescriptor_default("heightReference"),
+ extrudedHeight: createPropertyDescriptor_default("extrudedHeight"),
+ extrudedHeightReference: createPropertyDescriptor_default("extrudedHeightReference"),
+ rotation: createPropertyDescriptor_default("rotation"),
+ stRotation: createPropertyDescriptor_default("stRotation"),
+ granularity: createPropertyDescriptor_default("granularity"),
+ fill: createPropertyDescriptor_default("fill"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ outline: createPropertyDescriptor_default("outline"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ ),
+ classificationType: createPropertyDescriptor_default("classificationType"),
+ zIndex: createPropertyDescriptor_default("zIndex")
+});
+RectangleGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new RectangleGraphics(this);
+ }
+ result.show = this.show;
+ result.coordinates = this.coordinates;
+ result.height = this.height;
+ result.heightReference = this.heightReference;
+ result.extrudedHeight = this.extrudedHeight;
+ result.extrudedHeightReference = this.extrudedHeightReference;
+ result.rotation = this.rotation;
+ result.stRotation = this.stRotation;
+ result.granularity = this.granularity;
+ result.fill = this.fill;
+ result.material = this.material;
+ result.outline = this.outline;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ result.classificationType = this.classificationType;
+ result.zIndex = this.zIndex;
+ return result;
+};
+RectangleGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.coordinates = defaultValue_default(this.coordinates, source.coordinates);
+ this.height = defaultValue_default(this.height, source.height);
+ this.heightReference = defaultValue_default(
+ this.heightReference,
+ source.heightReference
+ );
+ this.extrudedHeight = defaultValue_default(
+ this.extrudedHeight,
+ source.extrudedHeight
+ );
+ this.extrudedHeightReference = defaultValue_default(
+ this.extrudedHeightReference,
+ source.extrudedHeightReference
+ );
+ this.rotation = defaultValue_default(this.rotation, source.rotation);
+ this.stRotation = defaultValue_default(this.stRotation, source.stRotation);
+ this.granularity = defaultValue_default(this.granularity, source.granularity);
+ this.fill = defaultValue_default(this.fill, source.fill);
+ this.material = defaultValue_default(this.material, source.material);
+ this.outline = defaultValue_default(this.outline, source.outline);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+ this.classificationType = defaultValue_default(
+ this.classificationType,
+ source.classificationType
+ );
+ this.zIndex = defaultValue_default(this.zIndex, source.zIndex);
+};
+var RectangleGraphics_default = RectangleGraphics;
+
+// Source/DataSources/WallGraphics.js
+function WallGraphics(options) {
+ this._definitionChanged = new Event_default();
+ this._show = void 0;
+ this._showSubscription = void 0;
+ this._positions = void 0;
+ this._positionsSubscription = void 0;
+ this._minimumHeights = void 0;
+ this._minimumHeightsSubscription = void 0;
+ this._maximumHeights = void 0;
+ this._maximumHeightsSubscription = void 0;
+ this._granularity = void 0;
+ this._granularitySubscription = void 0;
+ this._fill = void 0;
+ this._fillSubscription = void 0;
+ this._material = void 0;
+ this._materialSubscription = void 0;
+ this._outline = void 0;
+ this._outlineSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this._shadows = void 0;
+ this._shadowsSubscription = void 0;
+ this._distanceDisplayCondition = void 0;
+ this._distanceDisplayConditionSubscription = void 0;
+ this.merge(defaultValue_default(options, defaultValue_default.EMPTY_OBJECT));
+}
+Object.defineProperties(WallGraphics.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ show: createPropertyDescriptor_default("show"),
+ positions: createPropertyDescriptor_default("positions"),
+ minimumHeights: createPropertyDescriptor_default("minimumHeights"),
+ maximumHeights: createPropertyDescriptor_default("maximumHeights"),
+ granularity: createPropertyDescriptor_default("granularity"),
+ fill: createPropertyDescriptor_default("fill"),
+ material: createMaterialPropertyDescriptor_default("material"),
+ outline: createPropertyDescriptor_default("outline"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth"),
+ shadows: createPropertyDescriptor_default("shadows"),
+ distanceDisplayCondition: createPropertyDescriptor_default(
+ "distanceDisplayCondition"
+ )
+});
+WallGraphics.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ return new WallGraphics(this);
+ }
+ result.show = this.show;
+ result.positions = this.positions;
+ result.minimumHeights = this.minimumHeights;
+ result.maximumHeights = this.maximumHeights;
+ result.granularity = this.granularity;
+ result.fill = this.fill;
+ result.material = this.material;
+ result.outline = this.outline;
+ result.outlineColor = this.outlineColor;
+ result.outlineWidth = this.outlineWidth;
+ result.shadows = this.shadows;
+ result.distanceDisplayCondition = this.distanceDisplayCondition;
+ return result;
+};
+WallGraphics.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.show = defaultValue_default(this.show, source.show);
+ this.positions = defaultValue_default(this.positions, source.positions);
+ this.minimumHeights = defaultValue_default(
+ this.minimumHeights,
+ source.minimumHeights
+ );
+ this.maximumHeights = defaultValue_default(
+ this.maximumHeights,
+ source.maximumHeights
+ );
+ this.granularity = defaultValue_default(this.granularity, source.granularity);
+ this.fill = defaultValue_default(this.fill, source.fill);
+ this.material = defaultValue_default(this.material, source.material);
+ this.outline = defaultValue_default(this.outline, source.outline);
+ this.outlineColor = defaultValue_default(this.outlineColor, source.outlineColor);
+ this.outlineWidth = defaultValue_default(this.outlineWidth, source.outlineWidth);
+ this.shadows = defaultValue_default(this.shadows, source.shadows);
+ this.distanceDisplayCondition = defaultValue_default(
+ this.distanceDisplayCondition,
+ source.distanceDisplayCondition
+ );
+};
+var WallGraphics_default = WallGraphics;
+
+// Source/DataSources/Entity.js
+var cartoScratch = new Cartographic_default();
+function createConstantPositionProperty(value) {
+ return new ConstantPositionProperty_default(value);
+}
+function createPositionPropertyDescriptor(name) {
+ return createPropertyDescriptor_default(
+ name,
+ void 0,
+ createConstantPositionProperty
+ );
+}
+function createPropertyTypeDescriptor(name, Type) {
+ return createPropertyDescriptor_default(name, void 0, function(value) {
+ if (value instanceof Type) {
+ return value;
+ }
+ return new Type(value);
+ });
+}
+function Entity(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ let id = options.id;
+ if (!defined_default(id)) {
+ id = createGuid_default();
+ }
+ this._availability = void 0;
+ this._id = id;
+ this._definitionChanged = new Event_default();
+ this._name = options.name;
+ this._show = defaultValue_default(options.show, true);
+ this._parent = void 0;
+ this._propertyNames = [
+ "billboard",
+ "box",
+ "corridor",
+ "cylinder",
+ "description",
+ "ellipse",
+ "ellipsoid",
+ "label",
+ "model",
+ "tileset",
+ "orientation",
+ "path",
+ "plane",
+ "point",
+ "polygon",
+ "polyline",
+ "polylineVolume",
+ "position",
+ "properties",
+ "rectangle",
+ "viewFrom",
+ "wall"
+ ];
+ this._billboard = void 0;
+ this._billboardSubscription = void 0;
+ this._box = void 0;
+ this._boxSubscription = void 0;
+ this._corridor = void 0;
+ this._corridorSubscription = void 0;
+ this._cylinder = void 0;
+ this._cylinderSubscription = void 0;
+ this._description = void 0;
+ this._descriptionSubscription = void 0;
+ this._ellipse = void 0;
+ this._ellipseSubscription = void 0;
+ this._ellipsoid = void 0;
+ this._ellipsoidSubscription = void 0;
+ this._label = void 0;
+ this._labelSubscription = void 0;
+ this._model = void 0;
+ this._modelSubscription = void 0;
+ this._tileset = void 0;
+ this._tilesetSubscription = void 0;
+ this._orientation = void 0;
+ this._orientationSubscription = void 0;
+ this._path = void 0;
+ this._pathSubscription = void 0;
+ this._plane = void 0;
+ this._planeSubscription = void 0;
+ this._point = void 0;
+ this._pointSubscription = void 0;
+ this._polygon = void 0;
+ this._polygonSubscription = void 0;
+ this._polyline = void 0;
+ this._polylineSubscription = void 0;
+ this._polylineVolume = void 0;
+ this._polylineVolumeSubscription = void 0;
+ this._position = void 0;
+ this._positionSubscription = void 0;
+ this._properties = void 0;
+ this._propertiesSubscription = void 0;
+ this._rectangle = void 0;
+ this._rectangleSubscription = void 0;
+ this._viewFrom = void 0;
+ this._viewFromSubscription = void 0;
+ this._wall = void 0;
+ this._wallSubscription = void 0;
+ this._children = [];
+ this.entityCollection = void 0;
+ this.parent = options.parent;
+ this.merge(options);
+}
+function updateShow(entity, children, isShowing) {
+ const length3 = children.length;
+ for (let i = 0; i < length3; i++) {
+ const child = children[i];
+ const childShow = child._show;
+ const oldValue2 = !isShowing && childShow;
+ const newValue = isShowing && childShow;
+ if (oldValue2 !== newValue) {
+ updateShow(child, child._children, isShowing);
+ }
+ }
+ entity._definitionChanged.raiseEvent(
+ entity,
+ "isShowing",
+ isShowing,
+ !isShowing
+ );
+}
+Object.defineProperties(Entity.prototype, {
+ availability: createRawPropertyDescriptor_default("availability"),
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ name: createRawPropertyDescriptor_default("name"),
+ show: {
+ get: function() {
+ return this._show;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (value === this._show) {
+ return;
+ }
+ const wasShowing = this.isShowing;
+ this._show = value;
+ const isShowing = this.isShowing;
+ if (wasShowing !== isShowing) {
+ updateShow(this, this._children, isShowing);
+ }
+ this._definitionChanged.raiseEvent(this, "show", value, !value);
+ }
+ },
+ isShowing: {
+ get: function() {
+ return this._show && (!defined_default(this.entityCollection) || this.entityCollection.show) && (!defined_default(this._parent) || this._parent.isShowing);
+ }
+ },
+ parent: {
+ get: function() {
+ return this._parent;
+ },
+ set: function(value) {
+ const oldValue2 = this._parent;
+ if (oldValue2 === value) {
+ return;
+ }
+ const wasShowing = this.isShowing;
+ if (defined_default(oldValue2)) {
+ const index = oldValue2._children.indexOf(this);
+ oldValue2._children.splice(index, 1);
+ }
+ this._parent = value;
+ if (defined_default(value)) {
+ value._children.push(this);
+ }
+ const isShowing = this.isShowing;
+ if (wasShowing !== isShowing) {
+ updateShow(this, this._children, isShowing);
+ }
+ this._definitionChanged.raiseEvent(this, "parent", value, oldValue2);
+ }
+ },
+ propertyNames: {
+ get: function() {
+ return this._propertyNames;
+ }
+ },
+ billboard: createPropertyTypeDescriptor("billboard", BillboardGraphics_default),
+ box: createPropertyTypeDescriptor("box", BoxGraphics_default),
+ corridor: createPropertyTypeDescriptor("corridor", CorridorGraphics_default),
+ cylinder: createPropertyTypeDescriptor("cylinder", CylinderGraphics_default),
+ description: createPropertyDescriptor_default("description"),
+ ellipse: createPropertyTypeDescriptor("ellipse", EllipseGraphics_default),
+ ellipsoid: createPropertyTypeDescriptor("ellipsoid", EllipsoidGraphics_default),
+ label: createPropertyTypeDescriptor("label", LabelGraphics_default),
+ model: createPropertyTypeDescriptor("model", ModelGraphics_default),
+ tileset: createPropertyTypeDescriptor("tileset", Cesium3DTilesetGraphics_default),
+ orientation: createPropertyDescriptor_default("orientation"),
+ path: createPropertyTypeDescriptor("path", PathGraphics_default),
+ plane: createPropertyTypeDescriptor("plane", PlaneGraphics_default),
+ point: createPropertyTypeDescriptor("point", PointGraphics_default),
+ polygon: createPropertyTypeDescriptor("polygon", PolygonGraphics_default),
+ polyline: createPropertyTypeDescriptor("polyline", PolylineGraphics_default),
+ polylineVolume: createPropertyTypeDescriptor(
+ "polylineVolume",
+ PolylineVolumeGraphics_default
+ ),
+ properties: createPropertyTypeDescriptor("properties", PropertyBag_default),
+ position: createPositionPropertyDescriptor("position"),
+ rectangle: createPropertyTypeDescriptor("rectangle", RectangleGraphics_default),
+ viewFrom: createPropertyDescriptor_default("viewFrom"),
+ wall: createPropertyTypeDescriptor("wall", WallGraphics_default)
+});
+Entity.prototype.isAvailable = function(time) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ const availability = this._availability;
+ return !defined_default(availability) || availability.contains(time);
+};
+Entity.prototype.addProperty = function(propertyName) {
+ const propertyNames = this._propertyNames;
+ if (!defined_default(propertyName)) {
+ throw new DeveloperError_default("propertyName is required.");
+ }
+ if (propertyNames.indexOf(propertyName) !== -1) {
+ throw new DeveloperError_default(
+ `${propertyName} is already a registered property.`
+ );
+ }
+ if (propertyName in this) {
+ throw new DeveloperError_default(`${propertyName} is a reserved property name.`);
+ }
+ propertyNames.push(propertyName);
+ Object.defineProperty(
+ this,
+ propertyName,
+ createRawPropertyDescriptor_default(propertyName, true)
+ );
+};
+Entity.prototype.removeProperty = function(propertyName) {
+ const propertyNames = this._propertyNames;
+ const index = propertyNames.indexOf(propertyName);
+ if (!defined_default(propertyName)) {
+ throw new DeveloperError_default("propertyName is required.");
+ }
+ if (index === -1) {
+ throw new DeveloperError_default(`${propertyName} is not a registered property.`);
+ }
+ this._propertyNames.splice(index, 1);
+ delete this[propertyName];
+};
+Entity.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.name = defaultValue_default(this.name, source.name);
+ this.availability = defaultValue_default(this.availability, source.availability);
+ const propertyNames = this._propertyNames;
+ const sourcePropertyNames = defined_default(source._propertyNames) ? source._propertyNames : Object.keys(source);
+ const propertyNamesLength = sourcePropertyNames.length;
+ for (let i = 0; i < propertyNamesLength; i++) {
+ const name = sourcePropertyNames[i];
+ if (name === "parent" || name === "name" || name === "availability") {
+ continue;
+ }
+ const targetProperty = this[name];
+ const sourceProperty = source[name];
+ if (!defined_default(targetProperty) && propertyNames.indexOf(name) === -1) {
+ this.addProperty(name);
+ }
+ if (defined_default(sourceProperty)) {
+ if (defined_default(targetProperty)) {
+ if (defined_default(targetProperty.merge)) {
+ targetProperty.merge(sourceProperty);
+ }
+ } else if (defined_default(sourceProperty.merge) && defined_default(sourceProperty.clone)) {
+ this[name] = sourceProperty.clone();
+ } else {
+ this[name] = sourceProperty;
+ }
+ }
+ }
+};
+var matrix3Scratch2 = new Matrix3_default();
+var positionScratch2 = new Cartesian3_default();
+var orientationScratch = new Quaternion_default();
+Entity.prototype.computeModelMatrix = function(time, result) {
+ Check_default.typeOf.object("time", time);
+ const position = Property_default.getValueOrUndefined(
+ this._position,
+ time,
+ positionScratch2
+ );
+ if (!defined_default(position)) {
+ return void 0;
+ }
+ const orientation = Property_default.getValueOrUndefined(
+ this._orientation,
+ time,
+ orientationScratch
+ );
+ if (!defined_default(orientation)) {
+ result = Transforms_default.eastNorthUpToFixedFrame(position, void 0, result);
+ } else {
+ result = Matrix4_default.fromRotationTranslation(
+ Matrix3_default.fromQuaternion(orientation, matrix3Scratch2),
+ position,
+ result
+ );
+ }
+ return result;
+};
+Entity.prototype.computeModelMatrixForHeightReference = function(time, heightReferenceProperty, heightOffset, ellipsoid, result) {
+ Check_default.typeOf.object("time", time);
+ const heightReference = Property_default.getValueOrDefault(
+ heightReferenceProperty,
+ time,
+ HeightReference_default.NONE
+ );
+ let position = Property_default.getValueOrUndefined(
+ this._position,
+ time,
+ positionScratch2
+ );
+ if (heightReference === HeightReference_default.NONE || !defined_default(position) || Cartesian3_default.equalsEpsilon(position, Cartesian3_default.ZERO, Math_default.EPSILON8)) {
+ return this.computeModelMatrix(time, result);
+ }
+ const carto = ellipsoid.cartesianToCartographic(position, cartoScratch);
+ if (heightReference === HeightReference_default.CLAMP_TO_GROUND) {
+ carto.height = heightOffset;
+ } else {
+ carto.height += heightOffset;
+ }
+ position = ellipsoid.cartographicToCartesian(carto, position);
+ const orientation = Property_default.getValueOrUndefined(
+ this._orientation,
+ time,
+ orientationScratch
+ );
+ if (!defined_default(orientation)) {
+ result = Transforms_default.eastNorthUpToFixedFrame(position, void 0, result);
+ } else {
+ result = Matrix4_default.fromRotationTranslation(
+ Matrix3_default.fromQuaternion(orientation, matrix3Scratch2),
+ position,
+ result
+ );
+ }
+ return result;
+};
+Entity.supportsMaterialsforEntitiesOnTerrain = function(scene) {
+ return GroundPrimitive_default.supportsMaterials(scene);
+};
+Entity.supportsPolylinesOnTerrain = function(scene) {
+ return GroundPolylinePrimitive_default.isSupported(scene);
+};
+var Entity_default = Entity;
+
+// Source/DataSources/GeometryUpdater.js
+var defaultMaterial = new ColorMaterialProperty_default(Color_default.WHITE);
+var defaultShow = new ConstantProperty_default(true);
+var defaultFill = new ConstantProperty_default(true);
+var defaultOutline = new ConstantProperty_default(false);
+var defaultOutlineColor = new ConstantProperty_default(Color_default.BLACK);
+var defaultShadows = new ConstantProperty_default(ShadowMode_default.DISABLED);
+var defaultDistanceDisplayCondition = new ConstantProperty_default(
+ new DistanceDisplayCondition_default()
+);
+var defaultClassificationType = new ConstantProperty_default(ClassificationType_default.BOTH);
+function GeometryUpdater(options) {
+ Check_default.defined("options.entity", options.entity);
+ Check_default.defined("options.scene", options.scene);
+ Check_default.defined("options.geometryOptions", options.geometryOptions);
+ Check_default.defined("options.geometryPropertyName", options.geometryPropertyName);
+ Check_default.defined("options.observedPropertyNames", options.observedPropertyNames);
+ const entity = options.entity;
+ const geometryPropertyName = options.geometryPropertyName;
+ this._entity = entity;
+ this._scene = options.scene;
+ this._fillEnabled = false;
+ this._isClosed = false;
+ this._onTerrain = false;
+ this._dynamic = false;
+ this._outlineEnabled = false;
+ this._geometryChanged = new Event_default();
+ this._showProperty = void 0;
+ this._materialProperty = void 0;
+ this._showOutlineProperty = void 0;
+ this._outlineColorProperty = void 0;
+ this._outlineWidth = 1;
+ this._shadowsProperty = void 0;
+ this._distanceDisplayConditionProperty = void 0;
+ this._classificationTypeProperty = void 0;
+ this._options = options.geometryOptions;
+ this._geometryPropertyName = geometryPropertyName;
+ this._id = `${geometryPropertyName}-${entity.id}`;
+ this._observedPropertyNames = options.observedPropertyNames;
+ this._supportsMaterialsforEntitiesOnTerrain = Entity_default.supportsMaterialsforEntitiesOnTerrain(
+ options.scene
+ );
+}
+Object.defineProperties(GeometryUpdater.prototype, {
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ entity: {
+ get: function() {
+ return this._entity;
+ }
+ },
+ fillEnabled: {
+ get: function() {
+ return this._fillEnabled;
+ }
+ },
+ hasConstantFill: {
+ get: function() {
+ return !this._fillEnabled || !defined_default(this._entity.availability) && Property_default.isConstant(this._showProperty) && Property_default.isConstant(this._fillProperty);
+ }
+ },
+ fillMaterialProperty: {
+ get: function() {
+ return this._materialProperty;
+ }
+ },
+ outlineEnabled: {
+ get: function() {
+ return this._outlineEnabled;
+ }
+ },
+ hasConstantOutline: {
+ get: function() {
+ return !this._outlineEnabled || !defined_default(this._entity.availability) && Property_default.isConstant(this._showProperty) && Property_default.isConstant(this._showOutlineProperty);
+ }
+ },
+ outlineColorProperty: {
+ get: function() {
+ return this._outlineColorProperty;
+ }
+ },
+ outlineWidth: {
+ get: function() {
+ return this._outlineWidth;
+ }
+ },
+ shadowsProperty: {
+ get: function() {
+ return this._shadowsProperty;
+ }
+ },
+ distanceDisplayConditionProperty: {
+ get: function() {
+ return this._distanceDisplayConditionProperty;
+ }
+ },
+ classificationTypeProperty: {
+ get: function() {
+ return this._classificationTypeProperty;
+ }
+ },
+ isDynamic: {
+ get: function() {
+ return this._dynamic;
+ }
+ },
+ isClosed: {
+ get: function() {
+ return this._isClosed;
+ }
+ },
+ onTerrain: {
+ get: function() {
+ return this._onTerrain;
+ }
+ },
+ geometryChanged: {
+ get: function() {
+ return this._geometryChanged;
+ }
+ }
+});
+GeometryUpdater.prototype.isOutlineVisible = function(time) {
+ const entity = this._entity;
+ const visible = this._outlineEnabled && entity.isAvailable(time) && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time);
+ return defaultValue_default(visible, false);
+};
+GeometryUpdater.prototype.isFilled = function(time) {
+ const entity = this._entity;
+ const visible = this._fillEnabled && entity.isAvailable(time) && this._showProperty.getValue(time) && this._fillProperty.getValue(time);
+ return defaultValue_default(visible, false);
+};
+GeometryUpdater.prototype.createFillGeometryInstance = DeveloperError_default.throwInstantiationError;
+GeometryUpdater.prototype.createOutlineGeometryInstance = DeveloperError_default.throwInstantiationError;
+GeometryUpdater.prototype.isDestroyed = function() {
+ return false;
+};
+GeometryUpdater.prototype.destroy = function() {
+ destroyObject_default(this);
+};
+GeometryUpdater.prototype._isHidden = function(entity, geometry) {
+ const show = geometry.show;
+ return defined_default(show) && show.isConstant && !show.getValue(Iso8601_default.MINIMUM_VALUE);
+};
+GeometryUpdater.prototype._isOnTerrain = function(entity, geometry) {
+ return false;
+};
+GeometryUpdater.prototype._getIsClosed = function(options) {
+ return true;
+};
+GeometryUpdater.prototype._isDynamic = DeveloperError_default.throwInstantiationError;
+GeometryUpdater.prototype._setStaticOptions = DeveloperError_default.throwInstantiationError;
+GeometryUpdater.prototype._onEntityPropertyChanged = function(entity, propertyName, newValue, oldValue2) {
+ if (this._observedPropertyNames.indexOf(propertyName) === -1) {
+ return;
+ }
+ const geometry = this._entity[this._geometryPropertyName];
+ if (!defined_default(geometry)) {
+ if (this._fillEnabled || this._outlineEnabled) {
+ this._fillEnabled = false;
+ this._outlineEnabled = false;
+ this._geometryChanged.raiseEvent(this);
+ }
+ return;
+ }
+ const fillProperty = geometry.fill;
+ const fillEnabled = defined_default(fillProperty) && fillProperty.isConstant ? fillProperty.getValue(Iso8601_default.MINIMUM_VALUE) : true;
+ const outlineProperty = geometry.outline;
+ let outlineEnabled = defined_default(outlineProperty);
+ if (outlineEnabled && outlineProperty.isConstant) {
+ outlineEnabled = outlineProperty.getValue(Iso8601_default.MINIMUM_VALUE);
+ }
+ if (!fillEnabled && !outlineEnabled) {
+ if (this._fillEnabled || this._outlineEnabled) {
+ this._fillEnabled = false;
+ this._outlineEnabled = false;
+ this._geometryChanged.raiseEvent(this);
+ }
+ return;
+ }
+ const show = geometry.show;
+ if (this._isHidden(entity, geometry)) {
+ if (this._fillEnabled || this._outlineEnabled) {
+ this._fillEnabled = false;
+ this._outlineEnabled = false;
+ this._geometryChanged.raiseEvent(this);
+ }
+ return;
+ }
+ this._materialProperty = defaultValue_default(geometry.material, defaultMaterial);
+ this._fillProperty = defaultValue_default(fillProperty, defaultFill);
+ this._showProperty = defaultValue_default(show, defaultShow);
+ this._showOutlineProperty = defaultValue_default(geometry.outline, defaultOutline);
+ this._outlineColorProperty = outlineEnabled ? defaultValue_default(geometry.outlineColor, defaultOutlineColor) : void 0;
+ this._shadowsProperty = defaultValue_default(geometry.shadows, defaultShadows);
+ this._distanceDisplayConditionProperty = defaultValue_default(
+ geometry.distanceDisplayCondition,
+ defaultDistanceDisplayCondition
+ );
+ this._classificationTypeProperty = defaultValue_default(
+ geometry.classificationType,
+ defaultClassificationType
+ );
+ this._fillEnabled = fillEnabled;
+ const onTerrain = this._isOnTerrain(entity, geometry) && (this._supportsMaterialsforEntitiesOnTerrain || this._materialProperty instanceof ColorMaterialProperty_default);
+ if (outlineEnabled && onTerrain) {
+ oneTimeWarning_default(oneTimeWarning_default.geometryOutlines);
+ outlineEnabled = false;
+ }
+ this._onTerrain = onTerrain;
+ this._outlineEnabled = outlineEnabled;
+ if (this._isDynamic(entity, geometry)) {
+ if (!this._dynamic) {
+ this._dynamic = true;
+ this._geometryChanged.raiseEvent(this);
+ }
+ } else {
+ this._setStaticOptions(entity, geometry);
+ this._isClosed = this._getIsClosed(this._options);
+ const outlineWidth = geometry.outlineWidth;
+ this._outlineWidth = defined_default(outlineWidth) ? outlineWidth.getValue(Iso8601_default.MINIMUM_VALUE) : 1;
+ this._dynamic = false;
+ this._geometryChanged.raiseEvent(this);
+ }
+};
+GeometryUpdater.prototype.createDynamicUpdater = function(primitives, groundPrimitives) {
+ Check_default.defined("primitives", primitives);
+ Check_default.defined("groundPrimitives", groundPrimitives);
+ if (!this._dynamic) {
+ throw new DeveloperError_default(
+ "This instance does not represent dynamic geometry."
+ );
+ }
+ return new this.constructor.DynamicGeometryUpdater(
+ this,
+ primitives,
+ groundPrimitives
+ );
+};
+var GeometryUpdater_default = GeometryUpdater;
+
+// Source/DataSources/CallbackProperty.js
+function CallbackProperty(callback, isConstant) {
+ this._callback = void 0;
+ this._isConstant = void 0;
+ this._definitionChanged = new Event_default();
+ this.setCallback(callback, isConstant);
+}
+Object.defineProperties(CallbackProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return this._isConstant;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ }
+});
+CallbackProperty.prototype.getValue = function(time, result) {
+ return this._callback(time, result);
+};
+CallbackProperty.prototype.setCallback = function(callback, isConstant) {
+ if (!defined_default(callback)) {
+ throw new DeveloperError_default("callback is required.");
+ }
+ if (!defined_default(isConstant)) {
+ throw new DeveloperError_default("isConstant is required.");
+ }
+ const changed = this._callback !== callback || this._isConstant !== isConstant;
+ this._callback = callback;
+ this._isConstant = isConstant;
+ if (changed) {
+ this._definitionChanged.raiseEvent(this);
+ }
+};
+CallbackProperty.prototype.equals = function(other) {
+ return this === other || other instanceof CallbackProperty && this._callback === other._callback && this._isConstant === other._isConstant;
+};
+var CallbackProperty_default = CallbackProperty;
+
+// Source/DataSources/TerrainOffsetProperty.js
+var scratchPosition = new Cartesian3_default();
+var scratchCarto = new Cartographic_default();
+function TerrainOffsetProperty(scene, positionProperty, heightReferenceProperty, extrudedHeightReferenceProperty) {
+ Check_default.defined("scene", scene);
+ Check_default.defined("positionProperty", positionProperty);
+ this._scene = scene;
+ this._heightReference = heightReferenceProperty;
+ this._extrudedHeightReference = extrudedHeightReferenceProperty;
+ this._positionProperty = positionProperty;
+ this._position = new Cartesian3_default();
+ this._cartographicPosition = new Cartographic_default();
+ this._normal = new Cartesian3_default();
+ this._definitionChanged = new Event_default();
+ this._terrainHeight = 0;
+ this._removeCallbackFunc = void 0;
+ this._removeEventListener = void 0;
+ this._removeModeListener = void 0;
+ const that = this;
+ if (defined_default(scene.globe)) {
+ this._removeEventListener = scene.terrainProviderChanged.addEventListener(
+ function() {
+ that._updateClamping();
+ }
+ );
+ this._removeModeListener = scene.morphComplete.addEventListener(
+ function() {
+ that._updateClamping();
+ }
+ );
+ }
+ if (positionProperty.isConstant) {
+ const position = positionProperty.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ scratchPosition
+ );
+ if (!defined_default(position) || Cartesian3_default.equals(position, Cartesian3_default.ZERO) || !defined_default(scene.globe)) {
+ return;
+ }
+ this._position = Cartesian3_default.clone(position, this._position);
+ this._updateClamping();
+ this._normal = scene.globe.ellipsoid.geodeticSurfaceNormal(
+ position,
+ this._normal
+ );
+ }
+}
+Object.defineProperties(TerrainOffsetProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return false;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ }
+});
+TerrainOffsetProperty.prototype._updateClamping = function() {
+ if (defined_default(this._removeCallbackFunc)) {
+ this._removeCallbackFunc();
+ }
+ const scene = this._scene;
+ const globe = scene.globe;
+ const position = this._position;
+ if (!defined_default(globe) || Cartesian3_default.equals(position, Cartesian3_default.ZERO)) {
+ this._terrainHeight = 0;
+ return;
+ }
+ const ellipsoid = globe.ellipsoid;
+ const surface = globe._surface;
+ const that = this;
+ const cartographicPosition = ellipsoid.cartesianToCartographic(
+ position,
+ this._cartographicPosition
+ );
+ const height = globe.getHeight(cartographicPosition);
+ if (defined_default(height)) {
+ this._terrainHeight = height;
+ } else {
+ this._terrainHeight = 0;
+ }
+ function updateFunction(clampedPosition) {
+ if (scene.mode === SceneMode_default.SCENE3D) {
+ const carto = ellipsoid.cartesianToCartographic(
+ clampedPosition,
+ scratchCarto
+ );
+ that._terrainHeight = carto.height;
+ } else {
+ that._terrainHeight = clampedPosition.x;
+ }
+ that.definitionChanged.raiseEvent();
+ }
+ this._removeCallbackFunc = surface.updateHeight(
+ cartographicPosition,
+ updateFunction
+ );
+};
+TerrainOffsetProperty.prototype.getValue = function(time, result) {
+ const heightReference = Property_default.getValueOrDefault(
+ this._heightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ const extrudedHeightReference = Property_default.getValueOrDefault(
+ this._extrudedHeightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ if (heightReference === HeightReference_default.NONE && extrudedHeightReference !== HeightReference_default.RELATIVE_TO_GROUND) {
+ this._position = Cartesian3_default.clone(Cartesian3_default.ZERO, this._position);
+ return Cartesian3_default.clone(Cartesian3_default.ZERO, result);
+ }
+ if (this._positionProperty.isConstant) {
+ return Cartesian3_default.multiplyByScalar(
+ this._normal,
+ this._terrainHeight,
+ result
+ );
+ }
+ const scene = this._scene;
+ const position = this._positionProperty.getValue(time, scratchPosition);
+ if (!defined_default(position) || Cartesian3_default.equals(position, Cartesian3_default.ZERO) || !defined_default(scene.globe)) {
+ return Cartesian3_default.clone(Cartesian3_default.ZERO, result);
+ }
+ if (Cartesian3_default.equalsEpsilon(this._position, position, Math_default.EPSILON10)) {
+ return Cartesian3_default.multiplyByScalar(
+ this._normal,
+ this._terrainHeight,
+ result
+ );
+ }
+ this._position = Cartesian3_default.clone(position, this._position);
+ this._updateClamping();
+ const normal2 = scene.globe.ellipsoid.geodeticSurfaceNormal(
+ position,
+ this._normal
+ );
+ return Cartesian3_default.multiplyByScalar(normal2, this._terrainHeight, result);
+};
+TerrainOffsetProperty.prototype.isDestroyed = function() {
+ return false;
+};
+TerrainOffsetProperty.prototype.destroy = function() {
+ if (defined_default(this._removeEventListener)) {
+ this._removeEventListener();
+ }
+ if (defined_default(this._removeModeListener)) {
+ this._removeModeListener();
+ }
+ if (defined_default(this._removeCallbackFunc)) {
+ this._removeCallbackFunc();
+ }
+ return destroyObject_default(this);
+};
+var TerrainOffsetProperty_default = TerrainOffsetProperty;
+
+// Source/DataSources/heightReferenceOnEntityPropertyChanged.js
+function heightReferenceOnEntityPropertyChanged(entity, propertyName, newValue, oldValue2) {
+ GeometryUpdater_default.prototype._onEntityPropertyChanged.call(
+ this,
+ entity,
+ propertyName,
+ newValue,
+ oldValue2
+ );
+ if (this._observedPropertyNames.indexOf(propertyName) === -1) {
+ return;
+ }
+ const geometry = this._entity[this._geometryPropertyName];
+ if (!defined_default(geometry)) {
+ return;
+ }
+ if (defined_default(this._terrainOffsetProperty)) {
+ this._terrainOffsetProperty.destroy();
+ this._terrainOffsetProperty = void 0;
+ }
+ const heightReferenceProperty = geometry.heightReference;
+ if (defined_default(heightReferenceProperty)) {
+ const centerPosition = new CallbackProperty_default(
+ this._computeCenter.bind(this),
+ !this._dynamic
+ );
+ this._terrainOffsetProperty = new TerrainOffsetProperty_default(
+ this._scene,
+ centerPosition,
+ heightReferenceProperty
+ );
+ }
+}
+var heightReferenceOnEntityPropertyChanged_default = heightReferenceOnEntityPropertyChanged;
+
+// Source/DataSources/BoxGeometryUpdater.js
+var defaultOffset = Cartesian3_default.ZERO;
+var offsetScratch4 = new Cartesian3_default();
+var positionScratch3 = new Cartesian3_default();
+var scratchColor = new Color_default();
+function BoxGeometryOptions(entity) {
+ this.id = entity;
+ this.vertexFormat = void 0;
+ this.dimensions = void 0;
+ this.offsetAttribute = void 0;
+}
+function BoxGeometryUpdater(entity, scene) {
+ GeometryUpdater_default.call(this, {
+ entity,
+ scene,
+ geometryOptions: new BoxGeometryOptions(entity),
+ geometryPropertyName: "box",
+ observedPropertyNames: ["availability", "position", "orientation", "box"]
+ });
+ this._onEntityPropertyChanged(entity, "box", entity.box, void 0);
+}
+if (defined_default(Object.create)) {
+ BoxGeometryUpdater.prototype = Object.create(GeometryUpdater_default.prototype);
+ BoxGeometryUpdater.prototype.constructor = BoxGeometryUpdater;
+}
+Object.defineProperties(BoxGeometryUpdater.prototype, {
+ terrainOffsetProperty: {
+ get: function() {
+ return this._terrainOffsetProperty;
+ }
+ }
+});
+BoxGeometryUpdater.prototype.createFillGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._fillEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent a filled geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const show = new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time)
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ );
+ const attributes = {
+ show,
+ distanceDisplayCondition: distanceDisplayConditionAttribute,
+ color: void 0,
+ offset: void 0
+ };
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ let currentColor;
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ attributes.color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ }
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset,
+ offsetScratch4
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: BoxGeometry_default.fromDimensions(this._options),
+ modelMatrix: entity.computeModelMatrixForHeightReference(
+ time,
+ entity.box.heightReference,
+ this._options.dimensions.z * 0.5,
+ this._scene.mapProjection.ellipsoid
+ ),
+ attributes
+ });
+};
+BoxGeometryUpdater.prototype.createOutlineGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._outlineEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent an outlined geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const outlineColor = Property_default.getValueOrDefault(
+ this._outlineColorProperty,
+ time,
+ Color_default.BLACK,
+ scratchColor
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)
+ ),
+ color: ColorGeometryInstanceAttribute_default.fromColor(outlineColor),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ ),
+ offset: void 0
+ };
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset,
+ offsetScratch4
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: BoxOutlineGeometry_default.fromDimensions(this._options),
+ modelMatrix: entity.computeModelMatrixForHeightReference(
+ time,
+ entity.box.heightReference,
+ this._options.dimensions.z * 0.5,
+ this._scene.mapProjection.ellipsoid
+ ),
+ attributes
+ });
+};
+BoxGeometryUpdater.prototype._computeCenter = function(time, result) {
+ return Property_default.getValueOrUndefined(this._entity.position, time, result);
+};
+BoxGeometryUpdater.prototype._isHidden = function(entity, box) {
+ return !defined_default(box.dimensions) || !defined_default(entity.position) || GeometryUpdater_default.prototype._isHidden.call(this, entity, box);
+};
+BoxGeometryUpdater.prototype._isDynamic = function(entity, box) {
+ return !entity.position.isConstant || !Property_default.isConstant(entity.orientation) || !box.dimensions.isConstant || !Property_default.isConstant(box.outlineWidth);
+};
+BoxGeometryUpdater.prototype._setStaticOptions = function(entity, box) {
+ const heightReference = Property_default.getValueOrDefault(
+ box.heightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ const options = this._options;
+ options.vertexFormat = this._materialProperty instanceof ColorMaterialProperty_default ? PerInstanceColorAppearance_default.VERTEX_FORMAT : MaterialAppearance_default.MaterialSupport.TEXTURED.vertexFormat;
+ options.dimensions = box.dimensions.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.dimensions
+ );
+ options.offsetAttribute = heightReference !== HeightReference_default.NONE ? GeometryOffsetAttribute_default.ALL : void 0;
+};
+BoxGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged_default;
+BoxGeometryUpdater.DynamicGeometryUpdater = DynamicBoxGeometryUpdater;
+function DynamicBoxGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
+ DynamicGeometryUpdater_default.call(
+ this,
+ geometryUpdater,
+ primitives,
+ groundPrimitives
+ );
+}
+if (defined_default(Object.create)) {
+ DynamicBoxGeometryUpdater.prototype = Object.create(
+ DynamicGeometryUpdater_default.prototype
+ );
+ DynamicBoxGeometryUpdater.prototype.constructor = DynamicBoxGeometryUpdater;
+}
+DynamicBoxGeometryUpdater.prototype._isHidden = function(entity, box, time) {
+ const position = Property_default.getValueOrUndefined(
+ entity.position,
+ time,
+ positionScratch3
+ );
+ const dimensions = this._options.dimensions;
+ return !defined_default(position) || !defined_default(dimensions) || DynamicGeometryUpdater_default.prototype._isHidden.call(this, entity, box, time);
+};
+DynamicBoxGeometryUpdater.prototype._setOptions = function(entity, box, time) {
+ const heightReference = Property_default.getValueOrDefault(
+ box.heightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ const options = this._options;
+ options.dimensions = Property_default.getValueOrUndefined(
+ box.dimensions,
+ time,
+ options.dimensions
+ );
+ options.offsetAttribute = heightReference !== HeightReference_default.NONE ? GeometryOffsetAttribute_default.ALL : void 0;
+};
+var BoxGeometryUpdater_default = BoxGeometryUpdater;
+
+// Source/Core/Credit.js
+var import_dompurify = __toESM(require_purify(), 1);
+var nextCreditId = 0;
+var creditToId = {};
+function Credit(html, showOnScreen) {
+ Check_default.typeOf.string("html", html);
+ let id;
+ const key = html;
+ if (defined_default(creditToId[key])) {
+ id = creditToId[key];
+ } else {
+ id = nextCreditId++;
+ creditToId[key] = id;
+ }
+ showOnScreen = defaultValue_default(showOnScreen, false);
+ this._id = id;
+ this._html = html;
+ this._showOnScreen = showOnScreen;
+ this._element = void 0;
+}
+Object.defineProperties(Credit.prototype, {
+ html: {
+ get: function() {
+ return this._html;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ showOnScreen: {
+ get: function() {
+ return this._showOnScreen;
+ },
+ set: function(value) {
+ this._showOnScreen = value;
+ }
+ },
+ element: {
+ get: function() {
+ if (!defined_default(this._element)) {
+ const html = import_dompurify.default.sanitize(this._html);
+ const div = document.createElement("div");
+ div._creditId = this._id;
+ div.style.display = "inline";
+ div.innerHTML = html;
+ const links = div.querySelectorAll("a");
+ for (let i = 0; i < links.length; i++) {
+ links[i].setAttribute("target", "_blank");
+ }
+ this._element = div;
+ }
+ return this._element;
+ }
+ }
+});
+Credit.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left._id === right._id && left._showOnScreen === right._showOnScreen;
+};
+Credit.prototype.equals = function(credit) {
+ return Credit.equals(this, credit);
+};
+Credit.getIonCredit = function(attribution) {
+ const showOnScreen = defined_default(attribution.collapsible) && !attribution.collapsible;
+ const credit = new Credit(attribution.html, showOnScreen);
+ credit._isIon = credit.html.indexOf("ion-credit.png") !== -1;
+ return credit;
+};
+Credit.clone = function(credit) {
+ if (defined_default(credit)) {
+ return new Credit(credit.html, credit.showOnScreen);
+ }
+};
+var Credit_default = Credit;
+
+// Source/Core/deprecationWarning.js
+function deprecationWarning(identifier, message) {
+ if (!defined_default(identifier) || !defined_default(message)) {
+ throw new DeveloperError_default("identifier and message are required.");
+ }
+ oneTimeWarning_default(identifier, message);
+}
+var deprecationWarning_default = deprecationWarning;
+
+// Source/Shaders/OctahedralProjectionAtlasFS.js
+var OctahedralProjectionAtlasFS_default = "varying vec2 v_textureCoordinates;\n\nuniform float originalSize;\nuniform sampler2D texture0;\nuniform sampler2D texture1;\nuniform sampler2D texture2;\nuniform sampler2D texture3;\nuniform sampler2D texture4;\nuniform sampler2D texture5;\n\nconst float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0));\nconst float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0));\nconst float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0));\nconst float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0));\n\nvoid main()\n{\n vec2 uv = v_textureCoordinates;\n vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize);\n vec2 pixel = 1.0 / textureSize;\n\n float mipLevel = 0.0;\n\n if (uv.x - pixel.x > (textureSize.y / textureSize.x))\n {\n mipLevel = 1.0;\n if (uv.y - pixel.y > yMipLevel1)\n {\n mipLevel = 2.0;\n if (uv.y - pixel.y * 3.0 > yMipLevel2)\n {\n mipLevel = 3.0;\n if (uv.y - pixel.y * 5.0 > yMipLevel3)\n {\n mipLevel = 4.0;\n if (uv.y - pixel.y * 7.0 > yMipLevel4)\n {\n mipLevel = 5.0;\n }\n }\n }\n }\n }\n\n if (mipLevel > 0.0)\n {\n float scale = pow(2.0, mipLevel);\n\n uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0);\n uv.x *= ((textureSize.x - 2.0) / textureSize.y);\n\n uv.x -= 1.0 + pixel.x;\n uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0)));\n uv *= scale;\n }\n else\n {\n uv.x *= (textureSize.x / textureSize.y);\n }\n\n if(mipLevel == 0.0)\n {\n gl_FragColor = texture2D(texture0, uv);\n }\n else if(mipLevel == 1.0)\n {\n gl_FragColor = texture2D(texture1, uv);\n }\n else if(mipLevel == 2.0)\n {\n gl_FragColor = texture2D(texture2, uv);\n }\n else if(mipLevel == 3.0)\n {\n gl_FragColor = texture2D(texture3, uv);\n }\n else if(mipLevel == 4.0)\n {\n gl_FragColor = texture2D(texture4, uv);\n }\n else if(mipLevel == 5.0)\n {\n gl_FragColor = texture2D(texture5, uv);\n }\n else\n {\n gl_FragColor = vec4(0.0);\n }\n}\n";
+
+// Source/Shaders/OctahedralProjectionFS.js
+var OctahedralProjectionFS_default = "varying vec3 v_cubeMapCoordinates;\nuniform samplerCube cubeMap;\n\nvoid main()\n{\n vec4 rgba = textureCube(cubeMap, v_cubeMapCoordinates);\n #ifdef RGBA_NORMALIZED\n gl_FragColor = vec4(rgba.rgb, 1.0);\n #else\n float m = rgba.a * 16.0;\n vec3 r = rgba.rgb * m;\n gl_FragColor = vec4(r * r, 1.0);\n #endif\n}\n";
+
+// Source/Shaders/OctahedralProjectionVS.js
+var OctahedralProjectionVS_default = "attribute vec4 position;\nattribute vec3 cubeMapCoordinates;\n\nvarying vec3 v_cubeMapCoordinates;\n\nvoid main()\n{\n gl_Position = position;\n v_cubeMapCoordinates = cubeMapCoordinates;\n}\n";
+
+// Source/Scene/OctahedralProjectedCubeMap.js
+function OctahedralProjectedCubeMap(url2) {
+ this._url = url2;
+ this._cubeMapBuffers = void 0;
+ this._cubeMaps = void 0;
+ this._texture = void 0;
+ this._mipTextures = void 0;
+ this._va = void 0;
+ this._sp = void 0;
+ this._maximumMipmapLevel = void 0;
+ this._loading = false;
+ this._ready = false;
+ const cubeMap = this;
+ this._readyPromise = new Promise((resolve2, reject) => {
+ cubeMap._completeLoadFromCache = (cachedTexture) => {
+ cleanupResources(this);
+ this._texture = cachedTexture;
+ this._maximumMipmapLevel = this._texture.maximumMipmapLevel;
+ this._ready = true;
+ resolve2();
+ return;
+ };
+ cubeMap._failLoad = (error) => {
+ reject(error);
+ };
+ cubeMap._completeLoad = () => {
+ this._ready = true;
+ resolve2();
+ };
+ });
+}
+Object.defineProperties(OctahedralProjectedCubeMap.prototype, {
+ url: {
+ get: function() {
+ return this._url;
+ }
+ },
+ texture: {
+ get: function() {
+ return this._texture;
+ }
+ },
+ maximumMipmapLevel: {
+ get: function() {
+ return this._maximumMipmapLevel;
+ }
+ },
+ ready: {
+ get: function() {
+ return this._ready;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ }
+});
+OctahedralProjectedCubeMap.isSupported = function(context) {
+ return context.colorBufferHalfFloat && context.halfFloatingPointTexture || context.floatingPointTexture && context.colorBufferFloat;
+};
+var v12 = new Cartesian3_default(1, 0, 0);
+var v22 = new Cartesian3_default(0, 0, 1);
+var v3 = new Cartesian3_default(-1, 0, 0);
+var v4 = new Cartesian3_default(0, 0, -1);
+var v5 = new Cartesian3_default(0, 1, 0);
+var v6 = new Cartesian3_default(0, -1, 0);
+var cubeMapCoordinates = [v5, v3, v22, v6, v12, v5, v4, v5, v5];
+var length = cubeMapCoordinates.length;
+var flatCubeMapCoordinates = new Float32Array(length * 3);
+var offset = 0;
+for (let i = 0; i < length; ++i, offset += 3) {
+ Cartesian3_default.pack(cubeMapCoordinates[i], flatCubeMapCoordinates, offset);
+}
+var flatPositions = new Float32Array([
+ -1,
+ 1,
+ -1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 1,
+ 0,
+ 1,
+ 1,
+ 0,
+ -1,
+ -1,
+ -1,
+ 1,
+ -1
+]);
+var indices = new Uint16Array([
+ 0,
+ 1,
+ 2,
+ 2,
+ 3,
+ 1,
+ 7,
+ 6,
+ 1,
+ 3,
+ 6,
+ 1,
+ 2,
+ 5,
+ 4,
+ 3,
+ 4,
+ 2,
+ 4,
+ 8,
+ 6,
+ 3,
+ 4,
+ 6
+]);
+function createVertexArray2(context) {
+ const positionBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: flatPositions,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const cubeMapCoordinatesBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: flatCubeMapCoordinates,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const indexBuffer = Buffer_default.createIndexBuffer({
+ context,
+ typedArray: indices,
+ usage: BufferUsage_default.STATIC_DRAW,
+ indexDatatype: IndexDatatype_default.UNSIGNED_SHORT
+ });
+ const attributes = [
+ {
+ index: 0,
+ vertexBuffer: positionBuffer,
+ componentsPerAttribute: 2,
+ componentDatatype: ComponentDatatype_default.FLOAT
+ },
+ {
+ index: 1,
+ vertexBuffer: cubeMapCoordinatesBuffer,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT
+ }
+ ];
+ return new VertexArray_default({
+ context,
+ attributes,
+ indexBuffer
+ });
+}
+function createUniformTexture(texture) {
+ return function() {
+ return texture;
+ };
+}
+function cleanupResources(map) {
+ map._va = map._va && map._va.destroy();
+ map._sp = map._sp && map._sp.destroy();
+ let i;
+ let length3;
+ const cubeMaps = map._cubeMaps;
+ if (defined_default(cubeMaps)) {
+ length3 = cubeMaps.length;
+ for (i = 0; i < length3; ++i) {
+ cubeMaps[i].destroy();
+ }
+ }
+ const mipTextures = map._mipTextures;
+ if (defined_default(mipTextures)) {
+ length3 = mipTextures.length;
+ for (i = 0; i < length3; ++i) {
+ mipTextures[i].destroy();
+ }
+ }
+ map._va = void 0;
+ map._sp = void 0;
+ map._cubeMaps = void 0;
+ map._cubeMapBuffers = void 0;
+ map._mipTextures = void 0;
+}
+OctahedralProjectedCubeMap.prototype.update = function(frameState) {
+ const context = frameState.context;
+ if (!OctahedralProjectedCubeMap.isSupported(context)) {
+ return;
+ }
+ if (defined_default(this._texture) && defined_default(this._va)) {
+ cleanupResources(this);
+ }
+ if (defined_default(this._texture)) {
+ return;
+ }
+ if (!defined_default(this._texture) && !this._loading) {
+ const cachedTexture = frameState.context.textureCache.getTexture(this._url);
+ if (defined_default(cachedTexture)) {
+ this._completeLoadFromCache(cachedTexture);
+ }
+ }
+ const cubeMapBuffers = this._cubeMapBuffers;
+ if (!defined_default(cubeMapBuffers) && !this._loading) {
+ const that = this;
+ loadKTX2_default(this._url).then(function(buffers) {
+ that._cubeMapBuffers = buffers;
+ that._loading = false;
+ }).catch(function(e) {
+ that._failLoad(e);
+ });
+ this._loading = true;
+ }
+ if (!defined_default(this._cubeMapBuffers)) {
+ return;
+ }
+ const defines = [];
+ let pixelDatatype = cubeMapBuffers[0].positiveX.pixelDatatype;
+ if (!defined_default(pixelDatatype)) {
+ pixelDatatype = context.halfFloatingPointTexture ? PixelDatatype_default.HALF_FLOAT : PixelDatatype_default.FLOAT;
+ } else {
+ defines.push("RGBA_NORMALIZED");
+ }
+ const pixelFormat = PixelFormat_default.RGBA;
+ const fs = new ShaderSource_default({
+ defines,
+ sources: [OctahedralProjectionFS_default]
+ });
+ this._va = createVertexArray2(context);
+ this._sp = ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource: OctahedralProjectionVS_default,
+ fragmentShaderSource: fs,
+ attributeLocations: {
+ position: 0,
+ cubeMapCoordinates: 1
+ }
+ });
+ const length3 = Math.min(cubeMapBuffers.length, 6);
+ this._maximumMipmapLevel = length3 - 1;
+ const cubeMaps = this._cubeMaps = new Array(length3);
+ const mipTextures = this._mipTextures = new Array(length3);
+ const originalSize = cubeMapBuffers[0].positiveX.width * 2;
+ const uniformMap2 = {
+ originalSize: function() {
+ return originalSize;
+ }
+ };
+ for (let i = 0; i < length3; ++i) {
+ const positiveY = cubeMapBuffers[i].positiveY;
+ cubeMapBuffers[i].positiveY = cubeMapBuffers[i].negativeY;
+ cubeMapBuffers[i].negativeY = positiveY;
+ const cubeMap = cubeMaps[i] = new CubeMap_default({
+ context,
+ source: cubeMapBuffers[i],
+ pixelDatatype
+ });
+ const size = cubeMaps[i].width * 2;
+ const mipTexture = mipTextures[i] = new Texture_default({
+ context,
+ width: size,
+ height: size,
+ pixelDatatype,
+ pixelFormat
+ });
+ const command = new ComputeCommand_default({
+ vertexArray: this._va,
+ shaderProgram: this._sp,
+ uniformMap: {
+ cubeMap: createUniformTexture(cubeMap)
+ },
+ outputTexture: mipTexture,
+ persists: true,
+ owner: this
+ });
+ frameState.commandList.push(command);
+ uniformMap2[`texture${i}`] = createUniformTexture(mipTexture);
+ }
+ this._texture = new Texture_default({
+ context,
+ width: originalSize * 1.5 + 2,
+ height: originalSize,
+ pixelDatatype,
+ pixelFormat
+ });
+ this._texture.maximumMipmapLevel = this._maximumMipmapLevel;
+ context.textureCache.addTexture(this._url, this._texture);
+ const atlasCommand = new ComputeCommand_default({
+ fragmentShaderSource: OctahedralProjectionAtlasFS_default,
+ uniformMap: uniformMap2,
+ outputTexture: this._texture,
+ persists: false,
+ owner: this
+ });
+ frameState.commandList.push(atlasCommand);
+ this._completeLoad();
+};
+OctahedralProjectedCubeMap.prototype.isDestroyed = function() {
+ return false;
+};
+OctahedralProjectedCubeMap.prototype.destroy = function() {
+ cleanupResources(this);
+ this._texture = this._texture && this._texture.destroy();
+ return destroyObject_default(this);
+};
+var OctahedralProjectedCubeMap_default = OctahedralProjectedCubeMap;
+
+// Source/Scene/ImageBasedLighting.js
+function ImageBasedLighting(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const imageBasedLightingFactor = defined_default(options.imageBasedLightingFactor) ? Cartesian2_default.clone(options.imageBasedLightingFactor) : new Cartesian2_default(1, 1);
+ Check_default.typeOf.object(
+ "options.imageBasedLightingFactor",
+ imageBasedLightingFactor
+ );
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "options.imageBasedLightingFactor.x",
+ imageBasedLightingFactor.x,
+ 0
+ );
+ Check_default.typeOf.number.lessThanOrEquals(
+ "options.imageBasedLightingFactor.x",
+ imageBasedLightingFactor.x,
+ 1
+ );
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "options.imageBasedLightingFactor.y",
+ imageBasedLightingFactor.y,
+ 0
+ );
+ Check_default.typeOf.number.lessThanOrEquals(
+ "options.imageBasedLightingFactor.y",
+ imageBasedLightingFactor.y,
+ 1
+ );
+ this._imageBasedLightingFactor = imageBasedLightingFactor;
+ const luminanceAtZenith = defaultValue_default(options.luminanceAtZenith, 0.2);
+ Check_default.typeOf.number("options.luminanceAtZenith", luminanceAtZenith);
+ this._luminanceAtZenith = luminanceAtZenith;
+ const sphericalHarmonicCoefficients = options.sphericalHarmonicCoefficients;
+ if (defined_default(sphericalHarmonicCoefficients) && (!Array.isArray(sphericalHarmonicCoefficients) || sphericalHarmonicCoefficients.length !== 9)) {
+ throw new DeveloperError_default(
+ "options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values."
+ );
+ }
+ this._sphericalHarmonicCoefficients = sphericalHarmonicCoefficients;
+ this._specularEnvironmentMaps = options.specularEnvironmentMaps;
+ this._specularEnvironmentMapAtlas = void 0;
+ this._specularEnvironmentMapAtlasDirty = true;
+ this._specularEnvironmentMapLoaded = false;
+ this._previousSpecularEnvironmentMapLoaded = false;
+ this._useDefaultSpecularMaps = false;
+ this._useDefaultSphericalHarmonics = false;
+ this._shouldRegenerateShaders = false;
+ this._previousFrameNumber = void 0;
+ this._previousImageBasedLightingFactor = Cartesian2_default.clone(
+ imageBasedLightingFactor
+ );
+ this._previousLuminanceAtZenith = luminanceAtZenith;
+ this._previousSphericalHarmonicCoefficients = sphericalHarmonicCoefficients;
+}
+Object.defineProperties(ImageBasedLighting.prototype, {
+ imageBasedLightingFactor: {
+ get: function() {
+ return this._imageBasedLightingFactor;
+ },
+ set: function(value) {
+ Check_default.typeOf.object("imageBasedLightingFactor", value);
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "imageBasedLightingFactor.x",
+ value.x,
+ 0
+ );
+ Check_default.typeOf.number.lessThanOrEquals(
+ "imageBasedLightingFactor.x",
+ value.x,
+ 1
+ );
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "imageBasedLightingFactor.y",
+ value.y,
+ 0
+ );
+ Check_default.typeOf.number.lessThanOrEquals(
+ "imageBasedLightingFactor.y",
+ value.y,
+ 1
+ );
+ this._previousImageBasedLightingFactor = Cartesian2_default.clone(
+ this._imageBasedLightingFactor,
+ this._previousImageBasedLightingFactor
+ );
+ this._imageBasedLightingFactor = Cartesian2_default.clone(
+ value,
+ this._imageBasedLightingFactor
+ );
+ }
+ },
+ luminanceAtZenith: {
+ get: function() {
+ return this._luminanceAtZenith;
+ },
+ set: function(value) {
+ this._previousLuminanceAtZenith = this._luminanceAtZenith;
+ this._luminanceAtZenith = value;
+ }
+ },
+ sphericalHarmonicCoefficients: {
+ get: function() {
+ return this._sphericalHarmonicCoefficients;
+ },
+ set: function(value) {
+ if (defined_default(value) && (!Array.isArray(value) || value.length !== 9)) {
+ throw new DeveloperError_default(
+ "sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values."
+ );
+ }
+ this._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients;
+ this._sphericalHarmonicCoefficients = value;
+ }
+ },
+ specularEnvironmentMaps: {
+ get: function() {
+ return this._specularEnvironmentMaps;
+ },
+ set: function(value) {
+ if (value !== this._specularEnvironmentMaps) {
+ this._specularEnvironmentMapAtlasDirty = this._specularEnvironmentMapAtlasDirty || value !== this._specularEnvironmentMaps;
+ this._specularEnvironmentMapLoaded = false;
+ }
+ this._specularEnvironmentMaps = value;
+ }
+ },
+ enabled: {
+ get: function() {
+ return this._imageBasedLightingFactor.x > 0 || this._imageBasedLightingFactor.y > 0;
+ }
+ },
+ shouldRegenerateShaders: {
+ get: function() {
+ return this._shouldRegenerateShaders;
+ }
+ },
+ useDefaultSphericalHarmonics: {
+ get: function() {
+ return this._useDefaultSphericalHarmonics;
+ }
+ },
+ useSphericalHarmonicCoefficients: {
+ get: function() {
+ return defined_default(this._sphericalHarmonicCoefficients) || this._useDefaultSphericalHarmonics;
+ }
+ },
+ specularEnvironmentMapAtlas: {
+ get: function() {
+ return this._specularEnvironmentMapAtlas;
+ }
+ },
+ useDefaultSpecularMaps: {
+ get: function() {
+ return this._useDefaultSpecularMaps;
+ }
+ },
+ useSpecularEnvironmentMaps: {
+ get: function() {
+ return defined_default(this._specularEnvironmentMapAtlas) && this._specularEnvironmentMapAtlas.ready || this._useDefaultSpecularMaps;
+ }
+ }
+});
+function createSpecularEnvironmentMapAtlas(imageBasedLighting, context) {
+ if (!OctahedralProjectedCubeMap_default.isSupported(context)) {
+ return;
+ }
+ imageBasedLighting._specularEnvironmentMapAtlas = imageBasedLighting._specularEnvironmentMapAtlas && imageBasedLighting._specularEnvironmentMapAtlas.destroy();
+ if (defined_default(imageBasedLighting._specularEnvironmentMaps)) {
+ const atlas = new OctahedralProjectedCubeMap_default(
+ imageBasedLighting._specularEnvironmentMaps
+ );
+ imageBasedLighting._specularEnvironmentMapAtlas = atlas;
+ atlas.readyPromise.then(function() {
+ imageBasedLighting._specularEnvironmentMapLoaded = true;
+ }).catch(function(error) {
+ console.error(`Error loading specularEnvironmentMaps: ${error}`);
+ });
+ }
+ imageBasedLighting._shouldRegenerateShaders = true;
+}
+ImageBasedLighting.prototype.update = function(frameState) {
+ if (frameState.frameNumber === this._previousFrameNumber) {
+ return;
+ }
+ this._previousFrameNumber = frameState.frameNumber;
+ const context = frameState.context;
+ frameState.brdfLutGenerator.update(frameState);
+ this._shouldRegenerateShaders = false;
+ const iblFactor = this._imageBasedLightingFactor;
+ const previousIBLFactor = this._previousImageBasedLightingFactor;
+ if (!Cartesian2_default.equals(iblFactor, previousIBLFactor)) {
+ this._shouldRegenerateShaders = iblFactor.x > 0 && previousIBLFactor.x === 0 || iblFactor.x === 0 && previousIBLFactor.x > 0;
+ this._shouldRegenerateShaders = this._shouldRegenerateShaders || iblFactor.y > 0 && previousIBLFactor.y === 0 || iblFactor.y === 0 && previousIBLFactor.y > 0;
+ this._previousImageBasedLightingFactor = Cartesian2_default.clone(
+ this._imageBasedLightingFactor,
+ this._previousImageBasedLightingFactor
+ );
+ }
+ if (this._luminanceAtZenith !== this._previousLuminanceAtZenith) {
+ this._shouldRegenerateShaders = this._shouldRegenerateShaders || defined_default(this._luminanceAtZenith) !== defined_default(this._previousLuminanceAtZenith);
+ this._previousLuminanceAtZenith = this._luminanceAtZenith;
+ }
+ if (this._previousSphericalHarmonicCoefficients !== this._sphericalHarmonicCoefficients) {
+ this._shouldRegenerateShaders = this._shouldRegenerateShaders || defined_default(this._previousSphericalHarmonicCoefficients) !== defined_default(this._sphericalHarmonicCoefficients);
+ this._previousSphericalHarmonicCoefficients = this._sphericalHarmonicCoefficients;
+ }
+ this._shouldRegenerateShaders = this._shouldRegenerateShaders || this._previousSpecularEnvironmentMapLoaded !== this._specularEnvironmentMapLoaded;
+ this._previousSpecularEnvironmentMapLoaded = this._specularEnvironmentMapLoaded;
+ if (this._specularEnvironmentMapAtlasDirty) {
+ createSpecularEnvironmentMapAtlas(this, context);
+ this._specularEnvironmentMapAtlasDirty = false;
+ }
+ if (defined_default(this._specularEnvironmentMapAtlas)) {
+ this._specularEnvironmentMapAtlas.update(frameState);
+ }
+ const recompileWithDefaultAtlas = !defined_default(this._specularEnvironmentMapAtlas) && defined_default(frameState.specularEnvironmentMaps) && !this._useDefaultSpecularMaps;
+ const recompileWithoutDefaultAtlas = !defined_default(frameState.specularEnvironmentMaps) && this._useDefaultSpecularMaps;
+ const recompileWithDefaultSHCoeffs = !defined_default(this._sphericalHarmonicCoefficients) && defined_default(frameState.sphericalHarmonicCoefficients) && !this._useDefaultSphericalHarmonics;
+ const recompileWithoutDefaultSHCoeffs = !defined_default(frameState.sphericalHarmonicCoefficients) && this._useDefaultSphericalHarmonics;
+ this._shouldRegenerateShaders = this._shouldRegenerateShaders || recompileWithDefaultAtlas || recompileWithoutDefaultAtlas || recompileWithDefaultSHCoeffs || recompileWithoutDefaultSHCoeffs;
+ this._useDefaultSpecularMaps = !defined_default(this._specularEnvironmentMapAtlas) && defined_default(frameState.specularEnvironmentMaps);
+ this._useDefaultSphericalHarmonics = !defined_default(this._sphericalHarmonicCoefficients) && defined_default(frameState.sphericalHarmonicCoefficients);
+};
+ImageBasedLighting.prototype.isDestroyed = function() {
+ return false;
+};
+ImageBasedLighting.prototype.destroy = function() {
+ this._specularEnvironmentMapAtlas = this._specularEnvironmentMapAtlas && this._specularEnvironmentMapAtlas.destroy();
+ return destroyObject_default(this);
+};
+var ImageBasedLighting_default = ImageBasedLighting;
+
+// Source/Core/ManagedArray.js
+function ManagedArray(length3) {
+ length3 = defaultValue_default(length3, 0);
+ this._array = new Array(length3);
+ this._length = length3;
+}
+Object.defineProperties(ManagedArray.prototype, {
+ length: {
+ get: function() {
+ return this._length;
+ },
+ set: function(length3) {
+ Check_default.typeOf.number.greaterThanOrEquals("length", length3, 0);
+ const array = this._array;
+ const originalLength = this._length;
+ if (length3 < originalLength) {
+ for (let i = length3; i < originalLength; ++i) {
+ array[i] = void 0;
+ }
+ } else if (length3 > array.length) {
+ array.length = length3;
+ }
+ this._length = length3;
+ }
+ },
+ values: {
+ get: function() {
+ return this._array;
+ }
+ }
+});
+ManagedArray.prototype.get = function(index) {
+ Check_default.typeOf.number.lessThan("index", index, this._array.length);
+ return this._array[index];
+};
+ManagedArray.prototype.set = function(index, element) {
+ Check_default.typeOf.number("index", index);
+ if (index >= this._length) {
+ this.length = index + 1;
+ }
+ this._array[index] = element;
+};
+ManagedArray.prototype.peek = function() {
+ return this._array[this._length - 1];
+};
+ManagedArray.prototype.push = function(element) {
+ const index = this.length++;
+ this._array[index] = element;
+};
+ManagedArray.prototype.pop = function() {
+ if (this._length === 0) {
+ return void 0;
+ }
+ const element = this._array[this._length - 1];
+ --this.length;
+ return element;
+};
+ManagedArray.prototype.reserve = function(length3) {
+ Check_default.typeOf.number.greaterThanOrEquals("length", length3, 0);
+ if (length3 > this._array.length) {
+ this._array.length = length3;
+ }
+};
+ManagedArray.prototype.resize = function(length3) {
+ Check_default.typeOf.number.greaterThanOrEquals("length", length3, 0);
+ this.length = length3;
+};
+ManagedArray.prototype.trim = function(length3) {
+ length3 = defaultValue_default(length3, this._length);
+ this._array.length = length3;
+};
+var ManagedArray_default = ManagedArray;
+
+// Source/Scene/Axis.js
+var Axis = {
+ X: 0,
+ Y: 1,
+ Z: 2
+};
+Axis.Y_UP_TO_Z_UP = Matrix4_default.fromRotationTranslation(
+ Matrix3_default.fromRotationX(Math_default.PI_OVER_TWO)
+);
+Axis.Z_UP_TO_Y_UP = Matrix4_default.fromRotationTranslation(
+ Matrix3_default.fromRotationX(-Math_default.PI_OVER_TWO)
+);
+Axis.X_UP_TO_Z_UP = Matrix4_default.fromRotationTranslation(
+ Matrix3_default.fromRotationY(-Math_default.PI_OVER_TWO)
+);
+Axis.Z_UP_TO_X_UP = Matrix4_default.fromRotationTranslation(
+ Matrix3_default.fromRotationY(Math_default.PI_OVER_TWO)
+);
+Axis.X_UP_TO_Y_UP = Matrix4_default.fromRotationTranslation(
+ Matrix3_default.fromRotationZ(Math_default.PI_OVER_TWO)
+);
+Axis.Y_UP_TO_X_UP = Matrix4_default.fromRotationTranslation(
+ Matrix3_default.fromRotationZ(-Math_default.PI_OVER_TWO)
+);
+Axis.fromName = function(name) {
+ Check_default.typeOf.string("name", name);
+ return Axis[name];
+};
+var Axis_default = Object.freeze(Axis);
+
+// Source/Scene/Cesium3DContentGroup.js
+function Cesium3DContentGroup(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.typeOf.object("options.metadata", options.metadata);
+ this._metadata = options.metadata;
+}
+Object.defineProperties(Cesium3DContentGroup.prototype, {
+ metadata: {
+ get: function() {
+ return this._metadata;
+ }
+ }
+});
+var Cesium3DContentGroup_default = Cesium3DContentGroup;
+
+// Source/Core/getStringFromTypedArray.js
+function getStringFromTypedArray(uint8Array, byteOffset, byteLength) {
+ if (!defined_default(uint8Array)) {
+ throw new DeveloperError_default("uint8Array is required.");
+ }
+ if (byteOffset < 0) {
+ throw new DeveloperError_default("byteOffset cannot be negative.");
+ }
+ if (byteLength < 0) {
+ throw new DeveloperError_default("byteLength cannot be negative.");
+ }
+ if (byteOffset + byteLength > uint8Array.byteLength) {
+ throw new DeveloperError_default("sub-region exceeds array bounds.");
+ }
+ byteOffset = defaultValue_default(byteOffset, 0);
+ byteLength = defaultValue_default(byteLength, uint8Array.byteLength - byteOffset);
+ uint8Array = uint8Array.subarray(byteOffset, byteOffset + byteLength);
+ return getStringFromTypedArray.decode(uint8Array);
+}
+getStringFromTypedArray.decodeWithTextDecoder = function(view) {
+ const decoder = new TextDecoder("utf-8");
+ return decoder.decode(view);
+};
+getStringFromTypedArray.decodeWithFromCharCode = function(view) {
+ let result = "";
+ const codePoints = utf8Handler(view);
+ const length3 = codePoints.length;
+ for (let i = 0; i < length3; ++i) {
+ let cp = codePoints[i];
+ if (cp <= 65535) {
+ result += String.fromCharCode(cp);
+ } else {
+ cp -= 65536;
+ result += String.fromCharCode((cp >> 10) + 55296, (cp & 1023) + 56320);
+ }
+ }
+ return result;
+};
+function inRange(a3, min3, max3) {
+ return min3 <= a3 && a3 <= max3;
+}
+function utf8Handler(utfBytes) {
+ let codePoint = 0;
+ let bytesSeen = 0;
+ let bytesNeeded = 0;
+ let lowerBoundary = 128;
+ let upperBoundary = 191;
+ const codePoints = [];
+ const length3 = utfBytes.length;
+ for (let i = 0; i < length3; ++i) {
+ const currentByte = utfBytes[i];
+ if (bytesNeeded === 0) {
+ if (inRange(currentByte, 0, 127)) {
+ codePoints.push(currentByte);
+ continue;
+ }
+ if (inRange(currentByte, 194, 223)) {
+ bytesNeeded = 1;
+ codePoint = currentByte & 31;
+ continue;
+ }
+ if (inRange(currentByte, 224, 239)) {
+ if (currentByte === 224) {
+ lowerBoundary = 160;
+ }
+ if (currentByte === 237) {
+ upperBoundary = 159;
+ }
+ bytesNeeded = 2;
+ codePoint = currentByte & 15;
+ continue;
+ }
+ if (inRange(currentByte, 240, 244)) {
+ if (currentByte === 240) {
+ lowerBoundary = 144;
+ }
+ if (currentByte === 244) {
+ upperBoundary = 143;
+ }
+ bytesNeeded = 3;
+ codePoint = currentByte & 7;
+ continue;
+ }
+ throw new RuntimeError_default("String decoding failed.");
+ }
+ if (!inRange(currentByte, lowerBoundary, upperBoundary)) {
+ codePoint = bytesNeeded = bytesSeen = 0;
+ lowerBoundary = 128;
+ upperBoundary = 191;
+ --i;
+ continue;
+ }
+ lowerBoundary = 128;
+ upperBoundary = 191;
+ codePoint = codePoint << 6 | currentByte & 63;
+ ++bytesSeen;
+ if (bytesSeen === bytesNeeded) {
+ codePoints.push(codePoint);
+ codePoint = bytesNeeded = bytesSeen = 0;
+ }
+ }
+ return codePoints;
+}
+if (typeof TextDecoder !== "undefined") {
+ getStringFromTypedArray.decode = getStringFromTypedArray.decodeWithTextDecoder;
+} else {
+ getStringFromTypedArray.decode = getStringFromTypedArray.decodeWithFromCharCode;
+}
+var getStringFromTypedArray_default = getStringFromTypedArray;
+
+// Source/Core/getMagic.js
+function getMagic(uint8Array, byteOffset) {
+ byteOffset = defaultValue_default(byteOffset, 0);
+ return getStringFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ Math.min(4, uint8Array.length)
+ );
+}
+var getMagic_default = getMagic;
+
+// Source/Scene/Composite3DTileContent.js
+function Composite3DTileContent(tileset, tile, resource, arrayBuffer, byteOffset, factory) {
+ this._tileset = tileset;
+ this._tile = tile;
+ this._resource = resource;
+ this._contents = [];
+ this._metadata = void 0;
+ this._group = void 0;
+ this._readyPromise = initialize3(this, arrayBuffer, byteOffset, factory);
+}
+Object.defineProperties(Composite3DTileContent.prototype, {
+ featurePropertiesDirty: {
+ get: function() {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ if (contents[i].featurePropertiesDirty) {
+ return true;
+ }
+ }
+ return false;
+ },
+ set: function(value) {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].featurePropertiesDirty = value;
+ }
+ }
+ },
+ featuresLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ pointsLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ trianglesLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ texturesByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ batchTableByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ innerContents: {
+ get: function() {
+ return this._contents;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._tileset;
+ }
+ },
+ tile: {
+ get: function() {
+ return this._tile;
+ }
+ },
+ url: {
+ get: function() {
+ return this._resource.getUrlComponent(true);
+ }
+ },
+ metadata: {
+ get: function() {
+ return this._metadata;
+ },
+ set: function(value) {
+ this._metadata = value;
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].metadata = value;
+ }
+ }
+ },
+ batchTable: {
+ get: function() {
+ return void 0;
+ }
+ },
+ group: {
+ get: function() {
+ return this._group;
+ },
+ set: function(value) {
+ this._group = value;
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].group = value;
+ }
+ }
+ }
+});
+var sizeOfUint32 = Uint32Array.BYTES_PER_ELEMENT;
+function initialize3(content, arrayBuffer, byteOffset, factory) {
+ byteOffset = defaultValue_default(byteOffset, 0);
+ const uint8Array = new Uint8Array(arrayBuffer);
+ const view = new DataView(arrayBuffer);
+ byteOffset += sizeOfUint32;
+ const version2 = view.getUint32(byteOffset, true);
+ if (version2 !== 1) {
+ throw new RuntimeError_default(
+ `Only Composite Tile version 1 is supported. Version ${version2} is not.`
+ );
+ }
+ byteOffset += sizeOfUint32;
+ byteOffset += sizeOfUint32;
+ const tilesLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint32;
+ const contentPromises = [];
+ const resource = content._resource;
+ let prefix = resource.queryParameters.compositeIndex;
+ if (defined_default(prefix)) {
+ prefix = `${prefix}_`;
+ } else {
+ prefix = "";
+ }
+ for (let i = 0; i < tilesLength; ++i) {
+ const tileType = getMagic_default(uint8Array, byteOffset);
+ const tileByteLength = view.getUint32(byteOffset + sizeOfUint32 * 2, true);
+ const contentFactory = factory[tileType];
+ const compositeIndex = `${prefix}${i}`;
+ const childResource = resource.getDerivedResource({
+ queryParameters: {
+ compositeIndex
+ }
+ });
+ if (defined_default(contentFactory)) {
+ const innerContent = contentFactory(
+ content._tileset,
+ content._tile,
+ childResource,
+ arrayBuffer,
+ byteOffset
+ );
+ content._contents.push(innerContent);
+ contentPromises.push(innerContent.readyPromise);
+ } else {
+ throw new RuntimeError_default(
+ `Unknown tile content type, ${tileType}, inside Composite tile`
+ );
+ }
+ byteOffset += tileByteLength;
+ }
+ return Promise.all(contentPromises).then(function() {
+ return content;
+ });
+}
+Composite3DTileContent.prototype.hasProperty = function(batchId, name) {
+ return false;
+};
+Composite3DTileContent.prototype.getFeature = function(batchId) {
+ return void 0;
+};
+Composite3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].applyDebugSettings(enabled, color);
+ }
+};
+Composite3DTileContent.prototype.applyStyle = function(style) {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].applyStyle(style);
+ }
+};
+Composite3DTileContent.prototype.update = function(tileset, frameState) {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].update(tileset, frameState);
+ }
+};
+Composite3DTileContent.prototype.isDestroyed = function() {
+ return false;
+};
+Composite3DTileContent.prototype.destroy = function() {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].destroy();
+ }
+ return destroyObject_default(this);
+};
+var Composite3DTileContent_default = Composite3DTileContent;
+
+// Source/Core/getJsonFromTypedArray.js
+function getJsonFromTypedArray(uint8Array, byteOffset, byteLength) {
+ return JSON.parse(
+ getStringFromTypedArray_default(uint8Array, byteOffset, byteLength)
+ );
+}
+var getJsonFromTypedArray_default = getJsonFromTypedArray;
+
+// Source/Scene/BatchTexture.js
+function BatchTexture(options) {
+ Check_default.typeOf.number("options.featuresLength", options.featuresLength);
+ Check_default.typeOf.object("options.owner", options.owner);
+ this._id = createGuid_default();
+ const featuresLength = options.featuresLength;
+ this._showAlphaProperties = void 0;
+ this._batchValues = void 0;
+ this._batchValuesDirty = false;
+ this._batchTexture = void 0;
+ this._defaultTexture = void 0;
+ this._pickTexture = void 0;
+ this._pickIds = [];
+ let textureDimensions;
+ let textureStep;
+ if (featuresLength > 0) {
+ const width = Math.min(featuresLength, ContextLimits_default.maximumTextureSize);
+ const height = Math.ceil(featuresLength / ContextLimits_default.maximumTextureSize);
+ const stepX = 1 / width;
+ const centerX = stepX * 0.5;
+ const stepY = 1 / height;
+ const centerY = stepY * 0.5;
+ textureDimensions = new Cartesian2_default(width, height);
+ textureStep = new Cartesian4_default(stepX, centerX, stepY, centerY);
+ }
+ this._translucentFeaturesLength = 0;
+ this._featuresLength = featuresLength;
+ this._textureDimensions = textureDimensions;
+ this._textureStep = textureStep;
+ this._owner = options.owner;
+ this._statistics = options.statistics;
+ this._colorChangedCallback = options.colorChangedCallback;
+}
+Object.defineProperties(BatchTexture.prototype, {
+ translucentFeaturesLength: {
+ get: function() {
+ return this._translucentFeaturesLength;
+ }
+ },
+ byteLength: {
+ get: function() {
+ let memory = 0;
+ if (defined_default(this._pickTexture)) {
+ memory += this._pickTexture.sizeInBytes;
+ }
+ if (defined_default(this._batchTexture)) {
+ memory += this._batchTexture.sizeInBytes;
+ }
+ return memory;
+ }
+ },
+ textureDimensions: {
+ get: function() {
+ return this._textureDimensions;
+ }
+ },
+ textureStep: {
+ get: function() {
+ return this._textureStep;
+ }
+ },
+ batchTexture: {
+ get: function() {
+ return this._batchTexture;
+ }
+ },
+ defaultTexture: {
+ get: function() {
+ return this._defaultTexture;
+ }
+ },
+ pickTexture: {
+ get: function() {
+ return this._pickTexture;
+ }
+ }
+});
+BatchTexture.DEFAULT_COLOR_VALUE = Color_default.WHITE;
+BatchTexture.DEFAULT_SHOW_VALUE = true;
+function getByteLength(batchTexture) {
+ const dimensions = batchTexture._textureDimensions;
+ return dimensions.x * dimensions.y * 4;
+}
+function getBatchValues(batchTexture) {
+ if (!defined_default(batchTexture._batchValues)) {
+ const byteLength = getByteLength(batchTexture);
+ const bytes = new Uint8Array(byteLength).fill(255);
+ batchTexture._batchValues = bytes;
+ }
+ return batchTexture._batchValues;
+}
+function getShowAlphaProperties(batchTexture) {
+ if (!defined_default(batchTexture._showAlphaProperties)) {
+ const byteLength = 2 * batchTexture._featuresLength;
+ const bytes = new Uint8Array(byteLength).fill(255);
+ batchTexture._showAlphaProperties = bytes;
+ }
+ return batchTexture._showAlphaProperties;
+}
+function checkBatchId(batchId, featuresLength) {
+ if (!defined_default(batchId) || batchId < 0 || batchId >= featuresLength) {
+ throw new DeveloperError_default(
+ `batchId is required and between zero and featuresLength - 1 (${featuresLength}` - +")."
+ );
+ }
+}
+BatchTexture.prototype.setShow = function(batchId, show) {
+ checkBatchId(batchId, this._featuresLength);
+ Check_default.typeOf.bool("show", show);
+ if (show && !defined_default(this._showAlphaProperties)) {
+ return;
+ }
+ const showAlphaProperties = getShowAlphaProperties(this);
+ const propertyOffset = batchId * 2;
+ const newShow = show ? 255 : 0;
+ if (showAlphaProperties[propertyOffset] !== newShow) {
+ showAlphaProperties[propertyOffset] = newShow;
+ const batchValues = getBatchValues(this);
+ const offset2 = batchId * 4 + 3;
+ batchValues[offset2] = show ? showAlphaProperties[propertyOffset + 1] : 0;
+ this._batchValuesDirty = true;
+ }
+};
+BatchTexture.prototype.setAllShow = function(show) {
+ Check_default.typeOf.bool("show", show);
+ const featuresLength = this._featuresLength;
+ for (let i = 0; i < featuresLength; ++i) {
+ this.setShow(i, show);
+ }
+};
+BatchTexture.prototype.getShow = function(batchId) {
+ checkBatchId(batchId, this._featuresLength);
+ if (!defined_default(this._showAlphaProperties)) {
+ return true;
+ }
+ const offset2 = batchId * 2;
+ return this._showAlphaProperties[offset2] === 255;
+};
+var scratchColorBytes = new Array(4);
+BatchTexture.prototype.setColor = function(batchId, color) {
+ checkBatchId(batchId, this._featuresLength);
+ Check_default.typeOf.object("color", color);
+ if (Color_default.equals(color, BatchTexture.DEFAULT_COLOR_VALUE) && !defined_default(this._batchValues)) {
+ return;
+ }
+ const newColor = color.toBytes(scratchColorBytes);
+ const newAlpha = newColor[3];
+ const batchValues = getBatchValues(this);
+ const offset2 = batchId * 4;
+ const showAlphaProperties = getShowAlphaProperties(this);
+ const propertyOffset = batchId * 2;
+ if (batchValues[offset2] !== newColor[0] || batchValues[offset2 + 1] !== newColor[1] || batchValues[offset2 + 2] !== newColor[2] || showAlphaProperties[propertyOffset + 1] !== newAlpha) {
+ batchValues[offset2] = newColor[0];
+ batchValues[offset2 + 1] = newColor[1];
+ batchValues[offset2 + 2] = newColor[2];
+ const wasTranslucent = showAlphaProperties[propertyOffset + 1] !== 255;
+ const show = showAlphaProperties[propertyOffset] !== 0;
+ batchValues[offset2 + 3] = show ? newAlpha : 0;
+ showAlphaProperties[propertyOffset + 1] = newAlpha;
+ const isTranslucent = newAlpha !== 255;
+ if (isTranslucent && !wasTranslucent) {
+ ++this._translucentFeaturesLength;
+ } else if (!isTranslucent && wasTranslucent) {
+ --this._translucentFeaturesLength;
+ }
+ this._batchValuesDirty = true;
+ if (defined_default(this._colorChangedCallback)) {
+ this._colorChangedCallback(batchId, color);
+ }
+ }
+};
+BatchTexture.prototype.setAllColor = function(color) {
+ Check_default.typeOf.object("color", color);
+ const featuresLength = this._featuresLength;
+ for (let i = 0; i < featuresLength; ++i) {
+ this.setColor(i, color);
+ }
+};
+BatchTexture.prototype.getColor = function(batchId, result) {
+ checkBatchId(batchId, this._featuresLength);
+ Check_default.typeOf.object("result", result);
+ if (!defined_default(this._batchValues)) {
+ return Color_default.clone(BatchTexture.DEFAULT_COLOR_VALUE, result);
+ }
+ const batchValues = this._batchValues;
+ const offset2 = batchId * 4;
+ const showAlphaProperties = this._showAlphaProperties;
+ const propertyOffset = batchId * 2;
+ return Color_default.fromBytes(
+ batchValues[offset2],
+ batchValues[offset2 + 1],
+ batchValues[offset2 + 2],
+ showAlphaProperties[propertyOffset + 1],
+ result
+ );
+};
+BatchTexture.prototype.getPickColor = function(batchId) {
+ checkBatchId(batchId, this._featuresLength);
+ return this._pickIds[batchId];
+};
+function createTexture2(batchTexture, context, bytes) {
+ const dimensions = batchTexture._textureDimensions;
+ return new Texture_default({
+ context,
+ pixelFormat: PixelFormat_default.RGBA,
+ pixelDatatype: PixelDatatype_default.UNSIGNED_BYTE,
+ source: {
+ width: dimensions.x,
+ height: dimensions.y,
+ arrayBufferView: bytes
+ },
+ flipY: false,
+ sampler: Sampler_default.NEAREST
+ });
+}
+function createPickTexture(batchTexture, context) {
+ const featuresLength = batchTexture._featuresLength;
+ if (!defined_default(batchTexture._pickTexture) && featuresLength > 0) {
+ const pickIds = batchTexture._pickIds;
+ const byteLength = getByteLength(batchTexture);
+ const bytes = new Uint8Array(byteLength);
+ const owner = batchTexture._owner;
+ const statistics2 = batchTexture._statistics;
+ for (let i = 0; i < featuresLength; ++i) {
+ const pickId = context.createPickId(owner.getFeature(i));
+ pickIds.push(pickId);
+ const pickColor = pickId.color;
+ const offset2 = i * 4;
+ bytes[offset2] = Color_default.floatToByte(pickColor.red);
+ bytes[offset2 + 1] = Color_default.floatToByte(pickColor.green);
+ bytes[offset2 + 2] = Color_default.floatToByte(pickColor.blue);
+ bytes[offset2 + 3] = Color_default.floatToByte(pickColor.alpha);
+ }
+ batchTexture._pickTexture = createTexture2(batchTexture, context, bytes);
+ if (defined_default(statistics2)) {
+ statistics2.batchTableByteLength += batchTexture._pickTexture.sizeInBytes;
+ }
+ }
+}
+function updateBatchTexture(batchTexture) {
+ const dimensions = batchTexture._textureDimensions;
+ batchTexture._batchTexture.copyFrom({
+ source: {
+ width: dimensions.x,
+ height: dimensions.y,
+ arrayBufferView: batchTexture._batchValues
+ }
+ });
+}
+BatchTexture.prototype.update = function(tileset, frameState) {
+ const context = frameState.context;
+ this._defaultTexture = context.defaultTexture;
+ const passes = frameState.passes;
+ if (passes.pick || passes.postProcess) {
+ createPickTexture(this, context);
+ }
+ if (this._batchValuesDirty) {
+ this._batchValuesDirty = false;
+ if (!defined_default(this._batchTexture)) {
+ this._batchTexture = createTexture2(this, context, this._batchValues);
+ if (defined_default(this._statistics)) {
+ this._statistics.batchTableByteLength += this._batchTexture.sizeInBytes;
+ }
+ }
+ updateBatchTexture(this);
+ }
+};
+BatchTexture.prototype.isDestroyed = function() {
+ return false;
+};
+BatchTexture.prototype.destroy = function() {
+ this._batchTexture = this._batchTexture && this._batchTexture.destroy();
+ this._pickTexture = this._pickTexture && this._pickTexture.destroy();
+ const pickIds = this._pickIds;
+ const length3 = pickIds.length;
+ for (let i = 0; i < length3; ++i) {
+ pickIds[i].destroy();
+ }
+ return destroyObject_default(this);
+};
+var BatchTexture_default = BatchTexture;
+
+// Source/Scene/getBinaryAccessor.js
+var ComponentsPerAttribute = {
+ SCALAR: 1,
+ VEC2: 2,
+ VEC3: 3,
+ VEC4: 4,
+ MAT2: 4,
+ MAT3: 9,
+ MAT4: 16
+};
+var ClassPerType = {
+ SCALAR: void 0,
+ VEC2: Cartesian2_default,
+ VEC3: Cartesian3_default,
+ VEC4: Cartesian4_default,
+ MAT2: Matrix2_default,
+ MAT3: Matrix3_default,
+ MAT4: Matrix4_default
+};
+function getBinaryAccessor(accessor) {
+ const componentType = accessor.componentType;
+ let componentDatatype;
+ if (typeof componentType === "string") {
+ componentDatatype = ComponentDatatype_default.fromName(componentType);
+ } else {
+ componentDatatype = componentType;
+ }
+ const componentsPerAttribute = ComponentsPerAttribute[accessor.type];
+ const classType = ClassPerType[accessor.type];
+ return {
+ componentsPerAttribute,
+ classType,
+ createArrayBufferView: function(buffer, byteOffset, length3) {
+ return ComponentDatatype_default.createArrayBufferView(
+ componentDatatype,
+ buffer,
+ byteOffset,
+ componentsPerAttribute * length3
+ );
+ }
+ };
+}
+var getBinaryAccessor_default = getBinaryAccessor;
+
+// Source/Scene/BatchTableHierarchy.js
+function BatchTableHierarchy(options) {
+ this._classes = void 0;
+ this._classIds = void 0;
+ this._classIndexes = void 0;
+ this._parentCounts = void 0;
+ this._parentIndexes = void 0;
+ this._parentIds = void 0;
+ this._byteLength = 0;
+ Check_default.typeOf.object("options.extension", options.extension);
+ initialize4(this, options.extension, options.binaryBody);
+ validateHierarchy(this);
+}
+Object.defineProperties(BatchTableHierarchy.prototype, {
+ byteLength: {
+ get: function() {
+ return this._byteLength;
+ }
+ }
+});
+function initialize4(hierarchy, hierarchyJson, binaryBody) {
+ let i;
+ let classId;
+ let binaryAccessor;
+ const instancesLength = hierarchyJson.instancesLength;
+ const classes = hierarchyJson.classes;
+ let classIds = hierarchyJson.classIds;
+ let parentCounts = hierarchyJson.parentCounts;
+ let parentIds = hierarchyJson.parentIds;
+ let parentIdsLength = instancesLength;
+ let byteLength = 0;
+ if (defined_default(classIds.byteOffset)) {
+ classIds.componentType = defaultValue_default(
+ classIds.componentType,
+ ComponentDatatype_default.UNSIGNED_SHORT
+ );
+ classIds.type = AttributeType_default.SCALAR;
+ binaryAccessor = getBinaryAccessor_default(classIds);
+ classIds = binaryAccessor.createArrayBufferView(
+ binaryBody.buffer,
+ binaryBody.byteOffset + classIds.byteOffset,
+ instancesLength
+ );
+ byteLength += classIds.byteLength;
+ }
+ let parentIndexes;
+ if (defined_default(parentCounts)) {
+ if (defined_default(parentCounts.byteOffset)) {
+ parentCounts.componentType = defaultValue_default(
+ parentCounts.componentType,
+ ComponentDatatype_default.UNSIGNED_SHORT
+ );
+ parentCounts.type = AttributeType_default.SCALAR;
+ binaryAccessor = getBinaryAccessor_default(parentCounts);
+ parentCounts = binaryAccessor.createArrayBufferView(
+ binaryBody.buffer,
+ binaryBody.byteOffset + parentCounts.byteOffset,
+ instancesLength
+ );
+ byteLength += parentCounts.byteLength;
+ }
+ parentIndexes = new Uint16Array(instancesLength);
+ parentIdsLength = 0;
+ for (i = 0; i < instancesLength; ++i) {
+ parentIndexes[i] = parentIdsLength;
+ parentIdsLength += parentCounts[i];
+ }
+ byteLength += parentIndexes.byteLength;
+ }
+ if (defined_default(parentIds) && defined_default(parentIds.byteOffset)) {
+ parentIds.componentType = defaultValue_default(
+ parentIds.componentType,
+ ComponentDatatype_default.UNSIGNED_SHORT
+ );
+ parentIds.type = AttributeType_default.SCALAR;
+ binaryAccessor = getBinaryAccessor_default(parentIds);
+ parentIds = binaryAccessor.createArrayBufferView(
+ binaryBody.buffer,
+ binaryBody.byteOffset + parentIds.byteOffset,
+ parentIdsLength
+ );
+ byteLength += parentIds.byteLength;
+ }
+ const classesLength = classes.length;
+ for (i = 0; i < classesLength; ++i) {
+ const classInstancesLength = classes[i].length;
+ const properties = classes[i].instances;
+ const binaryProperties = getBinaryProperties(
+ classInstancesLength,
+ properties,
+ binaryBody
+ );
+ byteLength += countBinaryPropertyMemory(binaryProperties);
+ classes[i].instances = combine_default(binaryProperties, properties);
+ }
+ const classCounts = new Array(classesLength).fill(0);
+ const classIndexes = new Uint16Array(instancesLength);
+ for (i = 0; i < instancesLength; ++i) {
+ classId = classIds[i];
+ classIndexes[i] = classCounts[classId];
+ ++classCounts[classId];
+ }
+ byteLength += classIndexes.byteLength;
+ hierarchy._classes = classes;
+ hierarchy._classIds = classIds;
+ hierarchy._classIndexes = classIndexes;
+ hierarchy._parentCounts = parentCounts;
+ hierarchy._parentIndexes = parentIndexes;
+ hierarchy._parentIds = parentIds;
+ hierarchy._byteLength = byteLength;
+}
+function getBinaryProperties(featuresLength, properties, binaryBody) {
+ let binaryProperties;
+ for (const name in properties) {
+ if (properties.hasOwnProperty(name)) {
+ const property = properties[name];
+ const byteOffset = property.byteOffset;
+ if (defined_default(byteOffset)) {
+ const componentType = property.componentType;
+ const type = property.type;
+ if (!defined_default(componentType)) {
+ throw new RuntimeError_default("componentType is required.");
+ }
+ if (!defined_default(type)) {
+ throw new RuntimeError_default("type is required.");
+ }
+ if (!defined_default(binaryBody)) {
+ throw new RuntimeError_default(
+ `Property ${name} requires a batch table binary.`
+ );
+ }
+ const binaryAccessor = getBinaryAccessor_default(property);
+ const componentCount = binaryAccessor.componentsPerAttribute;
+ const classType = binaryAccessor.classType;
+ const typedArray = binaryAccessor.createArrayBufferView(
+ binaryBody.buffer,
+ binaryBody.byteOffset + byteOffset,
+ featuresLength
+ );
+ if (!defined_default(binaryProperties)) {
+ binaryProperties = {};
+ }
+ binaryProperties[name] = {
+ typedArray,
+ componentCount,
+ type: classType
+ };
+ }
+ }
+ }
+ return binaryProperties;
+}
+function countBinaryPropertyMemory(binaryProperties) {
+ let byteLength = 0;
+ for (const name in binaryProperties) {
+ if (binaryProperties.hasOwnProperty(name)) {
+ byteLength += binaryProperties[name].typedArray.byteLength;
+ }
+ }
+ return byteLength;
+}
+var scratchValidateStack = [];
+function validateHierarchy(hierarchy) {
+ const stack = scratchValidateStack;
+ stack.length = 0;
+ const classIds = hierarchy._classIds;
+ const instancesLength = classIds.length;
+ for (let i = 0; i < instancesLength; ++i) {
+ validateInstance(hierarchy, i, stack);
+ }
+}
+function validateInstance(hierarchy, instanceIndex, stack) {
+ const parentCounts = hierarchy._parentCounts;
+ const parentIds = hierarchy._parentIds;
+ const parentIndexes = hierarchy._parentIndexes;
+ const classIds = hierarchy._classIds;
+ const instancesLength = classIds.length;
+ if (!defined_default(parentIds)) {
+ return;
+ }
+ if (instanceIndex >= instancesLength) {
+ throw new DeveloperError_default(
+ `Parent index ${instanceIndex} exceeds the total number of instances: ${instancesLength}`
+ );
+ }
+ if (stack.indexOf(instanceIndex) > -1) {
+ throw new DeveloperError_default(
+ "Circular dependency detected in the batch table hierarchy."
+ );
+ }
+ stack.push(instanceIndex);
+ const parentCount = defined_default(parentCounts) ? parentCounts[instanceIndex] : 1;
+ const parentIndex = defined_default(parentCounts) ? parentIndexes[instanceIndex] : instanceIndex;
+ for (let i = 0; i < parentCount; ++i) {
+ const parentId = parentIds[parentIndex + i];
+ if (parentId !== instanceIndex) {
+ validateInstance(hierarchy, parentId, stack);
+ }
+ }
+ stack.pop(instanceIndex);
+}
+var scratchVisited = [];
+var scratchStack = [];
+var marker = 0;
+function traverseHierarchyMultipleParents(hierarchy, instanceIndex, endConditionCallback) {
+ const classIds = hierarchy._classIds;
+ const parentCounts = hierarchy._parentCounts;
+ const parentIds = hierarchy._parentIds;
+ const parentIndexes = hierarchy._parentIndexes;
+ const instancesLength = classIds.length;
+ const visited = scratchVisited;
+ visited.length = Math.max(visited.length, instancesLength);
+ const visitedMarker = ++marker;
+ const stack = scratchStack;
+ stack.length = 0;
+ stack.push(instanceIndex);
+ while (stack.length > 0) {
+ instanceIndex = stack.pop();
+ if (visited[instanceIndex] === visitedMarker) {
+ continue;
+ }
+ visited[instanceIndex] = visitedMarker;
+ const result = endConditionCallback(hierarchy, instanceIndex);
+ if (defined_default(result)) {
+ return result;
+ }
+ const parentCount = parentCounts[instanceIndex];
+ const parentIndex = parentIndexes[instanceIndex];
+ for (let i = 0; i < parentCount; ++i) {
+ const parentId = parentIds[parentIndex + i];
+ if (parentId !== instanceIndex) {
+ stack.push(parentId);
+ }
+ }
+ }
+}
+function traverseHierarchySingleParent(hierarchy, instanceIndex, endConditionCallback) {
+ let hasParent = true;
+ while (hasParent) {
+ const result = endConditionCallback(hierarchy, instanceIndex);
+ if (defined_default(result)) {
+ return result;
+ }
+ const parentId = hierarchy._parentIds[instanceIndex];
+ hasParent = parentId !== instanceIndex;
+ instanceIndex = parentId;
+ }
+}
+function traverseHierarchy(hierarchy, instanceIndex, endConditionCallback) {
+ const parentCounts = hierarchy._parentCounts;
+ const parentIds = hierarchy._parentIds;
+ if (!defined_default(parentIds)) {
+ return endConditionCallback(hierarchy, instanceIndex);
+ } else if (defined_default(parentCounts)) {
+ return traverseHierarchyMultipleParents(
+ hierarchy,
+ instanceIndex,
+ endConditionCallback
+ );
+ }
+ return traverseHierarchySingleParent(
+ hierarchy,
+ instanceIndex,
+ endConditionCallback
+ );
+}
+BatchTableHierarchy.prototype.hasProperty = function(batchId, propertyId) {
+ const result = traverseHierarchy(this, batchId, function(hierarchy, instanceIndex) {
+ const classId = hierarchy._classIds[instanceIndex];
+ const instances = hierarchy._classes[classId].instances;
+ if (defined_default(instances[propertyId])) {
+ return true;
+ }
+ });
+ return defined_default(result);
+};
+BatchTableHierarchy.prototype.propertyExists = function(propertyId) {
+ const classes = this._classes;
+ const classesLength = classes.length;
+ for (let i = 0; i < classesLength; ++i) {
+ const instances = classes[i].instances;
+ if (defined_default(instances[propertyId])) {
+ return true;
+ }
+ }
+ return false;
+};
+BatchTableHierarchy.prototype.getPropertyIds = function(batchId, results) {
+ results = defined_default(results) ? results : [];
+ results.length = 0;
+ traverseHierarchy(this, batchId, function(hierarchy, instanceIndex) {
+ const classId = hierarchy._classIds[instanceIndex];
+ const instances = hierarchy._classes[classId].instances;
+ for (const name in instances) {
+ if (instances.hasOwnProperty(name)) {
+ if (results.indexOf(name) === -1) {
+ results.push(name);
+ }
+ }
+ }
+ });
+ return results;
+};
+BatchTableHierarchy.prototype.getProperty = function(batchId, propertyId) {
+ return traverseHierarchy(this, batchId, function(hierarchy, instanceIndex) {
+ const classId = hierarchy._classIds[instanceIndex];
+ const instanceClass = hierarchy._classes[classId];
+ const indexInClass = hierarchy._classIndexes[instanceIndex];
+ const propertyValues = instanceClass.instances[propertyId];
+ if (defined_default(propertyValues)) {
+ if (defined_default(propertyValues.typedArray)) {
+ return getBinaryProperty(propertyValues, indexInClass);
+ }
+ return clone_default(propertyValues[indexInClass], true);
+ }
+ });
+};
+function getBinaryProperty(binaryProperty, index) {
+ const typedArray = binaryProperty.typedArray;
+ const componentCount = binaryProperty.componentCount;
+ if (componentCount === 1) {
+ return typedArray[index];
+ }
+ return binaryProperty.type.unpack(typedArray, index * componentCount);
+}
+BatchTableHierarchy.prototype.setProperty = function(batchId, propertyId, value) {
+ const result = traverseHierarchy(this, batchId, function(hierarchy, instanceIndex) {
+ const classId = hierarchy._classIds[instanceIndex];
+ const instanceClass = hierarchy._classes[classId];
+ const indexInClass = hierarchy._classIndexes[instanceIndex];
+ const propertyValues = instanceClass.instances[propertyId];
+ if (defined_default(propertyValues)) {
+ if (instanceIndex !== batchId) {
+ throw new DeveloperError_default(
+ `Inherited property "${propertyId}" is read-only.`
+ );
+ }
+ if (defined_default(propertyValues.typedArray)) {
+ setBinaryProperty(propertyValues, indexInClass, value);
+ } else {
+ propertyValues[indexInClass] = clone_default(value, true);
+ }
+ return true;
+ }
+ });
+ return defined_default(result);
+};
+function setBinaryProperty(binaryProperty, index, value) {
+ const typedArray = binaryProperty.typedArray;
+ const componentCount = binaryProperty.componentCount;
+ if (componentCount === 1) {
+ typedArray[index] = value;
+ } else {
+ binaryProperty.type.pack(value, typedArray, index * componentCount);
+ }
+}
+BatchTableHierarchy.prototype.isClass = function(batchId, className) {
+ const result = traverseHierarchy(this, batchId, function(hierarchy, instanceIndex) {
+ const classId = hierarchy._classIds[instanceIndex];
+ const instanceClass = hierarchy._classes[classId];
+ if (instanceClass.name === className) {
+ return true;
+ }
+ });
+ return defined_default(result);
+};
+BatchTableHierarchy.prototype.getClassName = function(batchId) {
+ const classId = this._classIds[batchId];
+ const instanceClass = this._classes[classId];
+ return instanceClass.name;
+};
+var BatchTableHierarchy_default = BatchTableHierarchy;
+
+// Source/Scene/Cesium3DTileColorBlendMode.js
+var Cesium3DTileColorBlendMode = {
+ HIGHLIGHT: 0,
+ REPLACE: 1,
+ MIX: 2
+};
+var Cesium3DTileColorBlendMode_default = Object.freeze(Cesium3DTileColorBlendMode);
+
+// Source/Scene/Cesium3DTileBatchTable.js
+var DEFAULT_COLOR_VALUE = BatchTexture_default.DEFAULT_COLOR_VALUE;
+var DEFAULT_SHOW_VALUE = BatchTexture_default.DEFAULT_SHOW_VALUE;
+function Cesium3DTileBatchTable(content, featuresLength, batchTableJson, batchTableBinary, colorChangedCallback) {
+ this.featuresLength = featuresLength;
+ let extensions;
+ if (defined_default(batchTableJson)) {
+ extensions = batchTableJson.extensions;
+ }
+ this._extensions = defaultValue_default(extensions, {});
+ const properties = initializeProperties(batchTableJson);
+ this._properties = properties;
+ this._batchTableHierarchy = initializeHierarchy(
+ this,
+ batchTableJson,
+ batchTableBinary
+ );
+ const binaryProperties = getBinaryProperties2(
+ featuresLength,
+ properties,
+ batchTableBinary
+ );
+ this._binaryPropertiesByteLength = countBinaryPropertyMemory2(
+ binaryProperties
+ );
+ this._batchTableBinaryProperties = binaryProperties;
+ this._content = content;
+ this._batchTexture = new BatchTexture_default({
+ featuresLength,
+ colorChangedCallback,
+ owner: content,
+ statistics: content.tileset.statistics
+ });
+}
+Cesium3DTileBatchTable._deprecationWarning = deprecationWarning_default;
+Object.defineProperties(Cesium3DTileBatchTable.prototype, {
+ batchTableByteLength: {
+ get: function() {
+ let totalByteLength = this._binaryPropertiesByteLength;
+ if (defined_default(this._batchTableHierarchy)) {
+ totalByteLength += this._batchTableHierarchy.byteLength;
+ }
+ totalByteLength += this._batchTexture.byteLength;
+ return totalByteLength;
+ }
+ }
+});
+function initializeProperties(jsonHeader) {
+ const properties = {};
+ if (!defined_default(jsonHeader)) {
+ return properties;
+ }
+ for (const propertyName in jsonHeader) {
+ if (jsonHeader.hasOwnProperty(propertyName) && propertyName !== "HIERARCHY" && propertyName !== "extensions" && propertyName !== "extras") {
+ properties[propertyName] = clone_default(jsonHeader[propertyName], true);
+ }
+ }
+ return properties;
+}
+function initializeHierarchy(batchTable, jsonHeader, binaryBody) {
+ if (!defined_default(jsonHeader)) {
+ return;
+ }
+ let hierarchy = batchTable._extensions["3DTILES_batch_table_hierarchy"];
+ const legacyHierarchy = jsonHeader.HIERARCHY;
+ if (defined_default(legacyHierarchy)) {
+ Cesium3DTileBatchTable._deprecationWarning(
+ "batchTableHierarchyExtension",
+ "The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."
+ );
+ batchTable._extensions["3DTILES_batch_table_hierarchy"] = legacyHierarchy;
+ hierarchy = legacyHierarchy;
+ }
+ if (!defined_default(hierarchy)) {
+ return;
+ }
+ return new BatchTableHierarchy_default({
+ extension: hierarchy,
+ binaryBody
+ });
+}
+function getBinaryProperties2(featuresLength, properties, binaryBody) {
+ let binaryProperties;
+ for (const name in properties) {
+ if (properties.hasOwnProperty(name)) {
+ const property = properties[name];
+ const byteOffset = property.byteOffset;
+ if (defined_default(byteOffset)) {
+ const componentType = property.componentType;
+ const type = property.type;
+ if (!defined_default(componentType)) {
+ throw new RuntimeError_default("componentType is required.");
+ }
+ if (!defined_default(type)) {
+ throw new RuntimeError_default("type is required.");
+ }
+ if (!defined_default(binaryBody)) {
+ throw new RuntimeError_default(
+ `Property ${name} requires a batch table binary.`
+ );
+ }
+ const binaryAccessor = getBinaryAccessor_default(property);
+ const componentCount = binaryAccessor.componentsPerAttribute;
+ const classType = binaryAccessor.classType;
+ const typedArray = binaryAccessor.createArrayBufferView(
+ binaryBody.buffer,
+ binaryBody.byteOffset + byteOffset,
+ featuresLength
+ );
+ if (!defined_default(binaryProperties)) {
+ binaryProperties = {};
+ }
+ binaryProperties[name] = {
+ typedArray,
+ componentCount,
+ type: classType
+ };
+ }
+ }
+ }
+ return binaryProperties;
+}
+function countBinaryPropertyMemory2(binaryProperties) {
+ if (!defined_default(binaryProperties)) {
+ return 0;
+ }
+ let byteLength = 0;
+ for (const name in binaryProperties) {
+ if (binaryProperties.hasOwnProperty(name)) {
+ byteLength += binaryProperties[name].typedArray.byteLength;
+ }
+ }
+ return byteLength;
+}
+Cesium3DTileBatchTable.getBinaryProperties = function(featuresLength, batchTableJson, batchTableBinary) {
+ return getBinaryProperties2(featuresLength, batchTableJson, batchTableBinary);
+};
+Cesium3DTileBatchTable.prototype.setShow = function(batchId, show) {
+ this._batchTexture.setShow(batchId, show);
+};
+Cesium3DTileBatchTable.prototype.setAllShow = function(show) {
+ this._batchTexture.setAllShow(show);
+};
+Cesium3DTileBatchTable.prototype.getShow = function(batchId) {
+ return this._batchTexture.getShow(batchId);
+};
+Cesium3DTileBatchTable.prototype.setColor = function(batchId, color) {
+ this._batchTexture.setColor(batchId, color);
+};
+Cesium3DTileBatchTable.prototype.setAllColor = function(color) {
+ this._batchTexture.setAllColor(color);
+};
+Cesium3DTileBatchTable.prototype.getColor = function(batchId, result) {
+ return this._batchTexture.getColor(batchId, result);
+};
+Cesium3DTileBatchTable.prototype.getPickColor = function(batchId) {
+ return this._batchTexture.getPickColor(batchId);
+};
+var scratchColor2 = new Color_default();
+Cesium3DTileBatchTable.prototype.applyStyle = function(style) {
+ if (!defined_default(style)) {
+ this.setAllColor(DEFAULT_COLOR_VALUE);
+ this.setAllShow(DEFAULT_SHOW_VALUE);
+ return;
+ }
+ const content = this._content;
+ const length3 = this.featuresLength;
+ for (let i = 0; i < length3; ++i) {
+ const feature2 = content.getFeature(i);
+ const color = defined_default(style.color) ? defaultValue_default(
+ style.color.evaluateColor(feature2, scratchColor2),
+ DEFAULT_COLOR_VALUE
+ ) : DEFAULT_COLOR_VALUE;
+ const show = defined_default(style.show) ? defaultValue_default(style.show.evaluate(feature2), DEFAULT_SHOW_VALUE) : DEFAULT_SHOW_VALUE;
+ this.setColor(i, color);
+ this.setShow(i, show);
+ }
+};
+function getBinaryProperty2(binaryProperty, index) {
+ const typedArray = binaryProperty.typedArray;
+ const componentCount = binaryProperty.componentCount;
+ if (componentCount === 1) {
+ return typedArray[index];
+ }
+ return binaryProperty.type.unpack(typedArray, index * componentCount);
+}
+function setBinaryProperty2(binaryProperty, index, value) {
+ const typedArray = binaryProperty.typedArray;
+ const componentCount = binaryProperty.componentCount;
+ if (componentCount === 1) {
+ typedArray[index] = value;
+ } else {
+ binaryProperty.type.pack(value, typedArray, index * componentCount);
+ }
+}
+function checkBatchId2(batchId, featuresLength) {
+ if (!defined_default(batchId) || batchId < 0 || batchId >= featuresLength) {
+ throw new DeveloperError_default(
+ `batchId is required and must be between zero and featuresLength - 1 (${featuresLength}` - +")."
+ );
+ }
+}
+Cesium3DTileBatchTable.prototype.isClass = function(batchId, className) {
+ checkBatchId2(batchId, this.featuresLength);
+ Check_default.typeOf.string("className", className);
+ const hierarchy = this._batchTableHierarchy;
+ if (!defined_default(hierarchy)) {
+ return false;
+ }
+ return hierarchy.isClass(batchId, className);
+};
+Cesium3DTileBatchTable.prototype.isExactClass = function(batchId, className) {
+ Check_default.typeOf.string("className", className);
+ return this.getExactClassName(batchId) === className;
+};
+Cesium3DTileBatchTable.prototype.getExactClassName = function(batchId) {
+ checkBatchId2(batchId, this.featuresLength);
+ const hierarchy = this._batchTableHierarchy;
+ if (!defined_default(hierarchy)) {
+ return void 0;
+ }
+ return hierarchy.getClassName(batchId);
+};
+Cesium3DTileBatchTable.prototype.hasProperty = function(batchId, name) {
+ checkBatchId2(batchId, this.featuresLength);
+ Check_default.typeOf.string("name", name);
+ return defined_default(this._properties[name]) || defined_default(this._batchTableHierarchy) && this._batchTableHierarchy.hasProperty(batchId, name);
+};
+Cesium3DTileBatchTable.prototype.hasPropertyBySemantic = function() {
+ return false;
+};
+Cesium3DTileBatchTable.prototype.getPropertyIds = function(batchId, results) {
+ checkBatchId2(batchId, this.featuresLength);
+ results = defined_default(results) ? results : [];
+ results.length = 0;
+ const scratchPropertyIds = Object.keys(this._properties);
+ results.push.apply(results, scratchPropertyIds);
+ if (defined_default(this._batchTableHierarchy)) {
+ results.push.apply(
+ results,
+ this._batchTableHierarchy.getPropertyIds(batchId, scratchPropertyIds)
+ );
+ }
+ return results;
+};
+Cesium3DTileBatchTable.prototype.getPropertyBySemantic = function(batchId, name) {
+ return void 0;
+};
+Cesium3DTileBatchTable.prototype.getProperty = function(batchId, name) {
+ checkBatchId2(batchId, this.featuresLength);
+ Check_default.typeOf.string("name", name);
+ if (defined_default(this._batchTableBinaryProperties)) {
+ const binaryProperty = this._batchTableBinaryProperties[name];
+ if (defined_default(binaryProperty)) {
+ return getBinaryProperty2(binaryProperty, batchId);
+ }
+ }
+ const propertyValues = this._properties[name];
+ if (defined_default(propertyValues)) {
+ return clone_default(propertyValues[batchId], true);
+ }
+ if (defined_default(this._batchTableHierarchy)) {
+ const hierarchyProperty = this._batchTableHierarchy.getProperty(
+ batchId,
+ name
+ );
+ if (defined_default(hierarchyProperty)) {
+ return hierarchyProperty;
+ }
+ }
+ return void 0;
+};
+Cesium3DTileBatchTable.prototype.setProperty = function(batchId, name, value) {
+ const featuresLength = this.featuresLength;
+ checkBatchId2(batchId, featuresLength);
+ Check_default.typeOf.string("name", name);
+ if (defined_default(this._batchTableBinaryProperties)) {
+ const binaryProperty = this._batchTableBinaryProperties[name];
+ if (defined_default(binaryProperty)) {
+ setBinaryProperty2(binaryProperty, batchId, value);
+ return;
+ }
+ }
+ if (defined_default(this._batchTableHierarchy)) {
+ if (this._batchTableHierarchy.setProperty(batchId, name, value)) {
+ return;
+ }
+ }
+ let propertyValues = this._properties[name];
+ if (!defined_default(propertyValues)) {
+ this._properties[name] = new Array(featuresLength);
+ propertyValues = this._properties[name];
+ }
+ propertyValues[batchId] = clone_default(value, true);
+};
+function getGlslComputeSt2(batchTable) {
+ if (batchTable._batchTexture.textureDimensions.y === 1) {
+ return "uniform vec4 tile_textureStep; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n return vec2(centerX + (batchId * stepX), 0.5); \n} \n";
+ }
+ return "uniform vec4 tile_textureStep; \nuniform vec2 tile_textureDimensions; \nvec2 computeSt(float batchId) \n{ \n float stepX = tile_textureStep.x; \n float centerX = tile_textureStep.y; \n float stepY = tile_textureStep.z; \n float centerY = tile_textureStep.w; \n float xId = mod(batchId, tile_textureDimensions.x); \n float yId = floor(batchId / tile_textureDimensions.x); \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); \n} \n";
+}
+Cesium3DTileBatchTable.prototype.getVertexShaderCallback = function(handleTranslucent, batchIdAttributeName, diffuseAttributeOrUniformName) {
+ if (this.featuresLength === 0) {
+ return;
+ }
+ const that = this;
+ return function(source) {
+ const renamedSource = modifyDiffuse(
+ source,
+ diffuseAttributeOrUniformName,
+ false
+ );
+ let newMain;
+ if (ContextLimits_default.maximumVertexTextureImageUnits > 0) {
+ newMain = "";
+ if (handleTranslucent) {
+ newMain += "uniform bool tile_translucentCommand; \n";
+ }
+ newMain += `${"uniform sampler2D tile_batchTexture; \nvarying vec4 tile_featureColor; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec2 st = computeSt("}${batchIdAttributeName});
+ vec4 featureProperties = texture2D(tile_batchTexture, st);
+ tile_color(featureProperties);
+ float show = ceil(featureProperties.a);
+ gl_Position *= show;
+`;
+ if (handleTranslucent) {
+ newMain += " bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n gl_Position *= 0.0; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n gl_Position *= 0.0; \n } \n } \n";
+ }
+ newMain += " tile_featureColor = featureProperties; \n tile_featureSt = st; \n}";
+ } else {
+ newMain = `${"varying vec2 tile_featureSt; \nvoid main() \n{ \n tile_color(vec4(1.0)); \n tile_featureSt = computeSt("}${batchIdAttributeName});
+}`;
+ }
+ return `${renamedSource}
+${getGlslComputeSt2(that)}${newMain}`;
+ };
+};
+function getDefaultShader(source, applyHighlight) {
+ source = ShaderSource_default.replaceMain(source, "tile_main");
+ if (!applyHighlight) {
+ return `${source}void tile_color(vec4 tile_featureColor)
+{
+ tile_main();
+}
+`;
+ }
+ return `${source}uniform float tile_colorBlend;
+void tile_color(vec4 tile_featureColor)
+{
+ tile_main();
+ tile_featureColor = czm_gammaCorrect(tile_featureColor);
+ gl_FragColor.a *= tile_featureColor.a;
+ float highlight = ceil(tile_colorBlend);
+ gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
+}
+`;
+}
+function replaceDiffuseTextureCalls(source, diffuseAttributeOrUniformName) {
+ const functionCall = `texture2D(${diffuseAttributeOrUniformName}`;
+ let fromIndex = 0;
+ let startIndex = source.indexOf(functionCall, fromIndex);
+ let endIndex;
+ while (startIndex > -1) {
+ let nestedLevel = 0;
+ for (let i = startIndex; i < source.length; ++i) {
+ const character = source.charAt(i);
+ if (character === "(") {
+ ++nestedLevel;
+ } else if (character === ")") {
+ --nestedLevel;
+ if (nestedLevel === 0) {
+ endIndex = i + 1;
+ break;
+ }
+ }
+ }
+ const extractedFunction = source.slice(startIndex, endIndex);
+ const replacedFunction = `tile_diffuse_final(${extractedFunction}, tile_diffuse)`;
+ source = source.slice(0, startIndex) + replacedFunction + source.slice(endIndex);
+ fromIndex = startIndex + replacedFunction.length;
+ startIndex = source.indexOf(functionCall, fromIndex);
+ }
+ return source;
+}
+function modifyDiffuse(source, diffuseAttributeOrUniformName, applyHighlight) {
+ if (!defined_default(diffuseAttributeOrUniformName)) {
+ return getDefaultShader(source, applyHighlight);
+ }
+ let regex = new RegExp(
+ `(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${diffuseAttributeOrUniformName};`
+ );
+ const uniformMatch = source.match(regex);
+ if (!defined_default(uniformMatch)) {
+ return getDefaultShader(source, applyHighlight);
+ }
+ const declaration = uniformMatch[0];
+ const type = uniformMatch[2];
+ source = ShaderSource_default.replaceMain(source, "tile_main");
+ source = source.replace(declaration, "");
+ const finalDiffuseFunction = "bool isWhite(vec3 color) \n{ \n return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); \n} \nvec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) \n{ \n vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); \n vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; \n return vec4(diffuse.rgb, sourceDiffuse.a); \n} \n";
+ const highlight = " tile_featureColor = czm_gammaCorrect(tile_featureColor); \n gl_FragColor.a *= tile_featureColor.a; \n float highlight = ceil(tile_colorBlend); \n gl_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); \n";
+ let setColor;
+ if (type === "vec3" || type === "vec4") {
+ const sourceDiffuse = type === "vec3" ? `vec4(${diffuseAttributeOrUniformName}, 1.0)` : diffuseAttributeOrUniformName;
+ const replaceDiffuse = type === "vec3" ? "tile_diffuse.xyz" : "tile_diffuse";
+ regex = new RegExp(diffuseAttributeOrUniformName, "g");
+ source = source.replace(regex, replaceDiffuse);
+ setColor = ` vec4 source = ${sourceDiffuse};
+ tile_diffuse = tile_diffuse_final(source, tile_featureColor);
+ tile_main();
+`;
+ } else if (type === "sampler2D") {
+ source = replaceDiffuseTextureCalls(source, diffuseAttributeOrUniformName);
+ setColor = " tile_diffuse = tile_featureColor; \n tile_main(); \n";
+ }
+ source = `${"uniform float tile_colorBlend; \nvec4 tile_diffuse = vec4(1.0); \n"}${finalDiffuseFunction}${declaration}
+${source}
+void tile_color(vec4 tile_featureColor)
+{
+${setColor}`;
+ if (applyHighlight) {
+ source += highlight;
+ }
+ source += "} \n";
+ return source;
+}
+Cesium3DTileBatchTable.prototype.getFragmentShaderCallback = function(handleTranslucent, diffuseAttributeOrUniformName, hasPremultipliedAlpha) {
+ if (this.featuresLength === 0) {
+ return;
+ }
+ return function(source) {
+ source = modifyDiffuse(source, diffuseAttributeOrUniformName, true);
+ if (ContextLimits_default.maximumVertexTextureImageUnits > 0) {
+ source += "uniform sampler2D tile_pickTexture; \nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_color(tile_featureColor); \n";
+ if (hasPremultipliedAlpha) {
+ source += " gl_FragColor.rgb *= gl_FragColor.a; \n";
+ }
+ source += "}";
+ } else {
+ if (handleTranslucent) {
+ source += "uniform bool tile_translucentCommand; \n";
+ }
+ source += "uniform sampler2D tile_pickTexture; \nuniform sampler2D tile_batchTexture; \nvarying vec2 tile_featureSt; \nvoid main() \n{ \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n";
+ if (handleTranslucent) {
+ source += " bool isStyleTranslucent = (featureProperties.a != 1.0); \n if (czm_pass == czm_passTranslucent) \n { \n if (!isStyleTranslucent && !tile_translucentCommand) \n { \n discard; \n } \n } \n else \n { \n if (isStyleTranslucent) \n { \n discard; \n } \n } \n";
+ }
+ source += " tile_color(featureProperties); \n";
+ if (hasPremultipliedAlpha) {
+ source += " gl_FragColor.rgb *= gl_FragColor.a; \n";
+ }
+ source += "} \n";
+ }
+ return source;
+ };
+};
+Cesium3DTileBatchTable.prototype.getClassificationFragmentShaderCallback = function() {
+ if (this.featuresLength === 0) {
+ return;
+ }
+ return function(source) {
+ source = ShaderSource_default.replaceMain(source, "tile_main");
+ if (ContextLimits_default.maximumVertexTextureImageUnits > 0) {
+ source += "uniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvarying vec4 tile_featureColor; \nvoid main() \n{ \n tile_main(); \n gl_FragColor = tile_featureColor; \n gl_FragColor.rgb *= gl_FragColor.a; \n}";
+ } else {
+ source += "uniform sampler2D tile_batchTexture; \nuniform sampler2D tile_pickTexture;\nvarying vec2 tile_featureSt; \nvoid main() \n{ \n tile_main(); \n vec4 featureProperties = texture2D(tile_batchTexture, tile_featureSt); \n if (featureProperties.a == 0.0) { \n discard; \n } \n gl_FragColor = featureProperties; \n gl_FragColor.rgb *= gl_FragColor.a; \n} \n";
+ }
+ return source;
+ };
+};
+function getColorBlend(batchTable) {
+ const tileset = batchTable._content.tileset;
+ const colorBlendMode = tileset.colorBlendMode;
+ const colorBlendAmount = tileset.colorBlendAmount;
+ if (colorBlendMode === Cesium3DTileColorBlendMode_default.HIGHLIGHT) {
+ return 0;
+ }
+ if (colorBlendMode === Cesium3DTileColorBlendMode_default.REPLACE) {
+ return 1;
+ }
+ if (colorBlendMode === Cesium3DTileColorBlendMode_default.MIX) {
+ return Math_default.clamp(colorBlendAmount, Math_default.EPSILON4, 1);
+ }
+ throw new DeveloperError_default(`Invalid color blend mode "${colorBlendMode}".`);
+}
+Cesium3DTileBatchTable.prototype.getUniformMapCallback = function() {
+ if (this.featuresLength === 0) {
+ return;
+ }
+ const that = this;
+ return function(uniformMap2) {
+ const batchUniformMap = {
+ tile_batchTexture: function() {
+ return defaultValue_default(
+ that._batchTexture.batchTexture,
+ that._batchTexture.defaultTexture
+ );
+ },
+ tile_textureDimensions: function() {
+ return that._batchTexture.textureDimensions;
+ },
+ tile_textureStep: function() {
+ return that._batchTexture.textureStep;
+ },
+ tile_colorBlend: function() {
+ return getColorBlend(that);
+ },
+ tile_pickTexture: function() {
+ return that._batchTexture.pickTexture;
+ }
+ };
+ return combine_default(uniformMap2, batchUniformMap);
+ };
+};
+Cesium3DTileBatchTable.prototype.getPickId = function() {
+ return "texture2D(tile_pickTexture, tile_featureSt)";
+};
+var StyleCommandsNeeded = {
+ ALL_OPAQUE: 0,
+ ALL_TRANSLUCENT: 1,
+ OPAQUE_AND_TRANSLUCENT: 2
+};
+Cesium3DTileBatchTable.prototype.addDerivedCommands = function(frameState, commandStart) {
+ const commandList = frameState.commandList;
+ const commandEnd = commandList.length;
+ const tile = this._content._tile;
+ const finalResolution = tile._finalResolution;
+ const tileset = tile.tileset;
+ const bivariateVisibilityTest = tileset._skipLevelOfDetail && tileset._hasMixedContent && frameState.context.stencilBuffer;
+ const styleCommandsNeeded = getStyleCommandsNeeded(this);
+ for (let i = commandStart; i < commandEnd; ++i) {
+ const command = commandList[i];
+ if (command.pass === Pass_default.COMPUTE) {
+ continue;
+ }
+ let derivedCommands = command.derivedCommands.tileset;
+ if (!defined_default(derivedCommands) || command.dirty) {
+ derivedCommands = {};
+ command.derivedCommands.tileset = derivedCommands;
+ derivedCommands.originalCommand = deriveCommand(command);
+ command.dirty = false;
+ }
+ const originalCommand = derivedCommands.originalCommand;
+ if (styleCommandsNeeded !== StyleCommandsNeeded.ALL_OPAQUE && command.pass !== Pass_default.TRANSLUCENT) {
+ if (!defined_default(derivedCommands.translucent)) {
+ derivedCommands.translucent = deriveTranslucentCommand(originalCommand);
+ }
+ }
+ if (styleCommandsNeeded !== StyleCommandsNeeded.ALL_TRANSLUCENT && command.pass !== Pass_default.TRANSLUCENT) {
+ if (!defined_default(derivedCommands.opaque)) {
+ derivedCommands.opaque = deriveOpaqueCommand(originalCommand);
+ }
+ if (bivariateVisibilityTest) {
+ if (!finalResolution) {
+ if (!defined_default(derivedCommands.zback)) {
+ derivedCommands.zback = deriveZBackfaceCommand(
+ frameState.context,
+ originalCommand
+ );
+ }
+ tileset._backfaceCommands.push(derivedCommands.zback);
+ }
+ if (!defined_default(derivedCommands.stencil) || tile._selectionDepth !== getLastSelectionDepth(derivedCommands.stencil)) {
+ if (command.renderState.depthMask) {
+ derivedCommands.stencil = deriveStencilCommand(
+ originalCommand,
+ tile._selectionDepth
+ );
+ } else {
+ derivedCommands.stencil = derivedCommands.opaque;
+ }
+ }
+ }
+ }
+ const opaqueCommand = bivariateVisibilityTest ? derivedCommands.stencil : derivedCommands.opaque;
+ const translucentCommand = derivedCommands.translucent;
+ if (command.pass !== Pass_default.TRANSLUCENT) {
+ if (styleCommandsNeeded === StyleCommandsNeeded.ALL_OPAQUE) {
+ commandList[i] = opaqueCommand;
+ }
+ if (styleCommandsNeeded === StyleCommandsNeeded.ALL_TRANSLUCENT) {
+ commandList[i] = translucentCommand;
+ }
+ if (styleCommandsNeeded === StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT) {
+ commandList[i] = opaqueCommand;
+ commandList.push(translucentCommand);
+ }
+ } else {
+ commandList[i] = originalCommand;
+ }
+ }
+};
+function getStyleCommandsNeeded(batchTable) {
+ const translucentFeaturesLength = batchTable._batchTexture.translucentFeaturesLength;
+ if (translucentFeaturesLength === 0) {
+ return StyleCommandsNeeded.ALL_OPAQUE;
+ } else if (translucentFeaturesLength === batchTable.featuresLength) {
+ return StyleCommandsNeeded.ALL_TRANSLUCENT;
+ }
+ return StyleCommandsNeeded.OPAQUE_AND_TRANSLUCENT;
+}
+function deriveCommand(command) {
+ const derivedCommand = DrawCommand_default.shallowClone(command);
+ const translucentCommand = derivedCommand.pass === Pass_default.TRANSLUCENT;
+ derivedCommand.uniformMap = defined_default(derivedCommand.uniformMap) ? derivedCommand.uniformMap : {};
+ derivedCommand.uniformMap.tile_translucentCommand = function() {
+ return translucentCommand;
+ };
+ return derivedCommand;
+}
+function deriveTranslucentCommand(command) {
+ const derivedCommand = DrawCommand_default.shallowClone(command);
+ derivedCommand.pass = Pass_default.TRANSLUCENT;
+ derivedCommand.renderState = getTranslucentRenderState(command.renderState);
+ return derivedCommand;
+}
+function deriveOpaqueCommand(command) {
+ const derivedCommand = DrawCommand_default.shallowClone(command);
+ derivedCommand.renderState = getOpaqueRenderState(command.renderState);
+ return derivedCommand;
+}
+function getLogDepthPolygonOffsetFragmentShaderProgram(context, shaderProgram) {
+ let shader = context.shaderCache.getDerivedShaderProgram(
+ shaderProgram,
+ "zBackfaceLogDepth"
+ );
+ if (!defined_default(shader)) {
+ const fs = shaderProgram.fragmentShaderSource.clone();
+ fs.defines = defined_default(fs.defines) ? fs.defines.slice(0) : [];
+ fs.defines.push("POLYGON_OFFSET");
+ fs.sources.unshift(
+ "#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n"
+ );
+ shader = context.shaderCache.createDerivedShaderProgram(
+ shaderProgram,
+ "zBackfaceLogDepth",
+ {
+ vertexShaderSource: shaderProgram.vertexShaderSource,
+ fragmentShaderSource: fs,
+ attributeLocations: shaderProgram._attributeLocations
+ }
+ );
+ }
+ return shader;
+}
+function deriveZBackfaceCommand(context, command) {
+ const derivedCommand = DrawCommand_default.shallowClone(command);
+ const rs = clone_default(derivedCommand.renderState, true);
+ rs.cull.enabled = true;
+ rs.cull.face = CullFace_default.FRONT;
+ rs.colorMask = {
+ red: false,
+ green: false,
+ blue: false,
+ alpha: false
+ };
+ rs.polygonOffset = {
+ enabled: true,
+ factor: 5,
+ units: 5
+ };
+ rs.stencilTest = StencilConstants_default.setCesium3DTileBit();
+ rs.stencilMask = StencilConstants_default.CESIUM_3D_TILE_MASK;
+ derivedCommand.renderState = RenderState_default.fromCache(rs);
+ derivedCommand.castShadows = false;
+ derivedCommand.receiveShadows = false;
+ derivedCommand.uniformMap = clone_default(command.uniformMap);
+ const polygonOffset = new Cartesian2_default(5, 5);
+ derivedCommand.uniformMap.u_polygonOffset = function() {
+ return polygonOffset;
+ };
+ derivedCommand.shaderProgram = getLogDepthPolygonOffsetFragmentShaderProgram(
+ context,
+ command.shaderProgram
+ );
+ return derivedCommand;
+}
+function deriveStencilCommand(command, reference) {
+ const derivedCommand = DrawCommand_default.shallowClone(command);
+ const rs = clone_default(derivedCommand.renderState, true);
+ rs.stencilTest.enabled = true;
+ rs.stencilTest.mask = StencilConstants_default.SKIP_LOD_MASK;
+ rs.stencilTest.reference = StencilConstants_default.CESIUM_3D_TILE_MASK | reference << StencilConstants_default.SKIP_LOD_BIT_SHIFT;
+ rs.stencilTest.frontFunction = StencilFunction_default.GREATER_OR_EQUAL;
+ rs.stencilTest.frontOperation.zPass = StencilOperation_default.REPLACE;
+ rs.stencilTest.backFunction = StencilFunction_default.GREATER_OR_EQUAL;
+ rs.stencilTest.backOperation.zPass = StencilOperation_default.REPLACE;
+ rs.stencilMask = StencilConstants_default.CESIUM_3D_TILE_MASK | StencilConstants_default.SKIP_LOD_MASK;
+ derivedCommand.renderState = RenderState_default.fromCache(rs);
+ return derivedCommand;
+}
+function getLastSelectionDepth(stencilCommand) {
+ const reference = stencilCommand.renderState.stencilTest.reference;
+ return (reference & StencilConstants_default.SKIP_LOD_MASK) >>> StencilConstants_default.SKIP_LOD_BIT_SHIFT;
+}
+function getTranslucentRenderState(renderState) {
+ const rs = clone_default(renderState, true);
+ rs.cull.enabled = false;
+ rs.depthTest.enabled = true;
+ rs.depthMask = false;
+ rs.blending = BlendingState_default.ALPHA_BLEND;
+ rs.stencilTest = StencilConstants_default.setCesium3DTileBit();
+ rs.stencilMask = StencilConstants_default.CESIUM_3D_TILE_MASK;
+ return RenderState_default.fromCache(rs);
+}
+function getOpaqueRenderState(renderState) {
+ const rs = clone_default(renderState, true);
+ rs.stencilTest = StencilConstants_default.setCesium3DTileBit();
+ rs.stencilMask = StencilConstants_default.CESIUM_3D_TILE_MASK;
+ return RenderState_default.fromCache(rs);
+}
+Cesium3DTileBatchTable.prototype.update = function(tileset, frameState) {
+ this._batchTexture.update(tileset, frameState);
+};
+Cesium3DTileBatchTable.prototype.isDestroyed = function() {
+ return false;
+};
+Cesium3DTileBatchTable.prototype.destroy = function() {
+ this._batchTexture = this._batchTexture && this._batchTexture.destroy();
+ return destroyObject_default(this);
+};
+var Cesium3DTileBatchTable_default = Cesium3DTileBatchTable;
+
+// Source/Scene/Vector3DTileBatch.js
+function Vector3DTileBatch(options) {
+ this.offset = options.offset;
+ this.count = options.count;
+ this.color = options.color;
+ this.batchIds = options.batchIds;
+}
+var Vector3DTileBatch_default = Vector3DTileBatch;
+
+// Source/Shaders/VectorTileVS.js
+var VectorTileVS_default = "attribute vec3 position;\nattribute float a_batchId;\n\nuniform mat4 u_modifiedModelViewProjection;\n\nvoid main()\n{\n gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));\n}\n";
+
+// Source/Scene/Cesium3DTileFeature.js
+function Cesium3DTileFeature(content, batchId) {
+ this._content = content;
+ this._batchId = batchId;
+ this._color = void 0;
+}
+Object.defineProperties(Cesium3DTileFeature.prototype, {
+ show: {
+ get: function() {
+ return this._content.batchTable.getShow(this._batchId);
+ },
+ set: function(value) {
+ this._content.batchTable.setShow(this._batchId, value);
+ }
+ },
+ color: {
+ get: function() {
+ if (!defined_default(this._color)) {
+ this._color = new Color_default();
+ }
+ return this._content.batchTable.getColor(this._batchId, this._color);
+ },
+ set: function(value) {
+ this._content.batchTable.setColor(this._batchId, value);
+ }
+ },
+ polylinePositions: {
+ get: function() {
+ if (!defined_default(this._content.getPolylinePositions)) {
+ return void 0;
+ }
+ return this._content.getPolylinePositions(this._batchId);
+ }
+ },
+ content: {
+ get: function() {
+ return this._content;
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._content.tileset;
+ }
+ },
+ primitive: {
+ get: function() {
+ return this._content.tileset;
+ }
+ },
+ featureId: {
+ get: function() {
+ return this._batchId;
+ }
+ },
+ pickId: {
+ get: function() {
+ return this._content.batchTable.getPickColor(this._batchId);
+ }
+ }
+});
+Cesium3DTileFeature.prototype.hasProperty = function(name) {
+ return this._content.batchTable.hasProperty(this._batchId, name);
+};
+Cesium3DTileFeature.prototype.getPropertyIds = function(results) {
+ return this._content.batchTable.getPropertyIds(this._batchId, results);
+};
+Cesium3DTileFeature.prototype.getProperty = function(name) {
+ return this._content.batchTable.getProperty(this._batchId, name);
+};
+Cesium3DTileFeature.getPropertyInherited = function(content, batchId, name) {
+ const batchTable = content.batchTable;
+ if (defined_default(batchTable)) {
+ if (batchTable.hasPropertyBySemantic(batchId, name)) {
+ return batchTable.getPropertyBySemantic(batchId, name);
+ }
+ if (batchTable.hasProperty(batchId, name)) {
+ return batchTable.getProperty(batchId, name);
+ }
+ }
+ const contentMetadata = content.metadata;
+ if (defined_default(contentMetadata)) {
+ if (contentMetadata.hasPropertyBySemantic(name)) {
+ return contentMetadata.getPropertyBySemantic(name);
+ }
+ if (contentMetadata.hasProperty(name)) {
+ return contentMetadata.getProperty(name);
+ }
+ }
+ const tile = content.tile;
+ const tileMetadata = tile.metadata;
+ if (defined_default(tileMetadata)) {
+ if (tileMetadata.hasPropertyBySemantic(name)) {
+ return tileMetadata.getPropertyBySemantic(name);
+ }
+ if (tileMetadata.hasProperty(name)) {
+ return tileMetadata.getProperty(name);
+ }
+ }
+ let subtreeMetadata;
+ if (defined_default(tile.implicitSubtree)) {
+ subtreeMetadata = tile.implicitSubtree.metadata;
+ }
+ if (defined_default(subtreeMetadata)) {
+ if (subtreeMetadata.hasPropertyBySemantic(name)) {
+ return subtreeMetadata.getPropertyBySemantic(name);
+ }
+ if (subtreeMetadata.hasProperty(name)) {
+ return subtreeMetadata.getProperty(name);
+ }
+ }
+ const groupMetadata = defined_default(content.group) ? content.group.metadata : void 0;
+ if (defined_default(groupMetadata)) {
+ if (groupMetadata.hasPropertyBySemantic(name)) {
+ return groupMetadata.getPropertyBySemantic(name);
+ }
+ if (groupMetadata.hasProperty(name)) {
+ return groupMetadata.getProperty(name);
+ }
+ }
+ const tilesetMetadata = content.tileset.metadata;
+ if (defined_default(tilesetMetadata)) {
+ if (tilesetMetadata.hasPropertyBySemantic(name)) {
+ return tilesetMetadata.getPropertyBySemantic(name);
+ }
+ if (tilesetMetadata.hasProperty(name)) {
+ return tilesetMetadata.getProperty(name);
+ }
+ }
+ return void 0;
+};
+Cesium3DTileFeature.prototype.getPropertyInherited = function(name) {
+ return Cesium3DTileFeature.getPropertyInherited(
+ this._content,
+ this._batchId,
+ name
+ );
+};
+Cesium3DTileFeature.prototype.setProperty = function(name, value) {
+ this._content.batchTable.setProperty(this._batchId, name, value);
+ this._content.featurePropertiesDirty = true;
+};
+Cesium3DTileFeature.prototype.isExactClass = function(className) {
+ return this._content.batchTable.isExactClass(this._batchId, className);
+};
+Cesium3DTileFeature.prototype.isClass = function(className) {
+ return this._content.batchTable.isClass(this._batchId, className);
+};
+Cesium3DTileFeature.prototype.getExactClassName = function() {
+ return this._content.batchTable.getExactClassName(this._batchId);
+};
+var Cesium3DTileFeature_default = Cesium3DTileFeature;
+
+// Source/Scene/Expression.js
+var import_jsep = __toESM(require_jsep(), 1);
+
+// Source/Scene/ExpressionNodeType.js
+var ExpressionNodeType = {
+ VARIABLE: 0,
+ UNARY: 1,
+ BINARY: 2,
+ TERNARY: 3,
+ CONDITIONAL: 4,
+ MEMBER: 5,
+ FUNCTION_CALL: 6,
+ ARRAY: 7,
+ REGEX: 8,
+ VARIABLE_IN_STRING: 9,
+ LITERAL_NULL: 10,
+ LITERAL_BOOLEAN: 11,
+ LITERAL_NUMBER: 12,
+ LITERAL_STRING: 13,
+ LITERAL_COLOR: 14,
+ LITERAL_VECTOR: 15,
+ LITERAL_REGEX: 16,
+ LITERAL_UNDEFINED: 17,
+ BUILTIN_VARIABLE: 18
+};
+var ExpressionNodeType_default = Object.freeze(ExpressionNodeType);
+
+// Source/Scene/Expression.js
+function Expression(expression, defines) {
+ Check_default.typeOf.string("expression", expression);
+ this._expression = expression;
+ expression = replaceDefines(expression, defines);
+ expression = replaceVariables(removeBackslashes(expression));
+ import_jsep.default.addBinaryOp("=~", 0);
+ import_jsep.default.addBinaryOp("!~", 0);
+ let ast;
+ try {
+ ast = (0, import_jsep.default)(expression);
+ } catch (e) {
+ throw new RuntimeError_default(e);
+ }
+ this._runtimeAst = createRuntimeAst(this, ast);
+}
+Object.defineProperties(Expression.prototype, {
+ expression: {
+ get: function() {
+ return this._expression;
+ }
+ }
+});
+var scratchStorage = {
+ arrayIndex: 0,
+ arrayArray: [[]],
+ cartesian2Index: 0,
+ cartesian3Index: 0,
+ cartesian4Index: 0,
+ cartesian2Array: [new Cartesian2_default()],
+ cartesian3Array: [new Cartesian3_default()],
+ cartesian4Array: [new Cartesian4_default()],
+ reset: function() {
+ this.arrayIndex = 0;
+ this.cartesian2Index = 0;
+ this.cartesian3Index = 0;
+ this.cartesian4Index = 0;
+ },
+ getArray: function() {
+ if (this.arrayIndex >= this.arrayArray.length) {
+ this.arrayArray.push([]);
+ }
+ const array = this.arrayArray[this.arrayIndex++];
+ array.length = 0;
+ return array;
+ },
+ getCartesian2: function() {
+ if (this.cartesian2Index >= this.cartesian2Array.length) {
+ this.cartesian2Array.push(new Cartesian2_default());
+ }
+ return this.cartesian2Array[this.cartesian2Index++];
+ },
+ getCartesian3: function() {
+ if (this.cartesian3Index >= this.cartesian3Array.length) {
+ this.cartesian3Array.push(new Cartesian3_default());
+ }
+ return this.cartesian3Array[this.cartesian3Index++];
+ },
+ getCartesian4: function() {
+ if (this.cartesian4Index >= this.cartesian4Array.length) {
+ this.cartesian4Array.push(new Cartesian4_default());
+ }
+ return this.cartesian4Array[this.cartesian4Index++];
+ }
+};
+Expression.prototype.evaluate = function(feature2, result) {
+ scratchStorage.reset();
+ const value = this._runtimeAst.evaluate(feature2);
+ if (result instanceof Color_default && value instanceof Cartesian4_default) {
+ return Color_default.fromCartesian4(value, result);
+ }
+ if (value instanceof Cartesian2_default || value instanceof Cartesian3_default || value instanceof Cartesian4_default) {
+ return value.clone(result);
+ }
+ return value;
+};
+Expression.prototype.evaluateColor = function(feature2, result) {
+ scratchStorage.reset();
+ const color = this._runtimeAst.evaluate(feature2);
+ return Color_default.fromCartesian4(color, result);
+};
+Expression.prototype.getShaderFunction = function(functionSignature, variableSubstitutionMap, shaderState, returnType) {
+ let shaderExpression = this.getShaderExpression(
+ variableSubstitutionMap,
+ shaderState
+ );
+ shaderExpression = `${returnType} ${functionSignature}
+{
+ return ${shaderExpression};
+}
+`;
+ return shaderExpression;
+};
+Expression.prototype.getShaderExpression = function(variableSubstitutionMap, shaderState) {
+ return this._runtimeAst.getShaderExpression(
+ variableSubstitutionMap,
+ shaderState
+ );
+};
+Expression.prototype.getVariables = function() {
+ let variables = [];
+ this._runtimeAst.getVariables(variables);
+ variables = variables.filter(function(variable, index, variables2) {
+ return variables2.indexOf(variable) === index;
+ });
+ return variables;
+};
+var unaryOperators = ["!", "-", "+"];
+var binaryOperators = [
+ "+",
+ "-",
+ "*",
+ "/",
+ "%",
+ "===",
+ "!==",
+ ">",
+ ">=",
+ "<",
+ "<=",
+ "&&",
+ "||",
+ "!~",
+ "=~"
+];
+var variableRegex = /\${(.*?)}/g;
+var backslashRegex = /\\/g;
+var backslashReplacement = "@#%";
+var replacementRegex = /@#%/g;
+var scratchColor3 = new Color_default();
+var unaryFunctions = {
+ abs: getEvaluateUnaryComponentwise(Math.abs),
+ sqrt: getEvaluateUnaryComponentwise(Math.sqrt),
+ cos: getEvaluateUnaryComponentwise(Math.cos),
+ sin: getEvaluateUnaryComponentwise(Math.sin),
+ tan: getEvaluateUnaryComponentwise(Math.tan),
+ acos: getEvaluateUnaryComponentwise(Math.acos),
+ asin: getEvaluateUnaryComponentwise(Math.asin),
+ atan: getEvaluateUnaryComponentwise(Math.atan),
+ radians: getEvaluateUnaryComponentwise(Math_default.toRadians),
+ degrees: getEvaluateUnaryComponentwise(Math_default.toDegrees),
+ sign: getEvaluateUnaryComponentwise(Math_default.sign),
+ floor: getEvaluateUnaryComponentwise(Math.floor),
+ ceil: getEvaluateUnaryComponentwise(Math.ceil),
+ round: getEvaluateUnaryComponentwise(Math.round),
+ exp: getEvaluateUnaryComponentwise(Math.exp),
+ exp2: getEvaluateUnaryComponentwise(exp2),
+ log: getEvaluateUnaryComponentwise(Math.log),
+ log2: getEvaluateUnaryComponentwise(log22),
+ fract: getEvaluateUnaryComponentwise(fract),
+ length: length2,
+ normalize
+};
+var binaryFunctions = {
+ atan2: getEvaluateBinaryComponentwise(Math.atan2, false),
+ pow: getEvaluateBinaryComponentwise(Math.pow, false),
+ min: getEvaluateBinaryComponentwise(Math.min, true),
+ max: getEvaluateBinaryComponentwise(Math.max, true),
+ distance,
+ dot,
+ cross
+};
+var ternaryFunctions = {
+ clamp: getEvaluateTernaryComponentwise(Math_default.clamp, true),
+ mix: getEvaluateTernaryComponentwise(Math_default.lerp, true)
+};
+function fract(number) {
+ return number - Math.floor(number);
+}
+function exp2(exponent) {
+ return Math.pow(2, exponent);
+}
+function log22(number) {
+ return Math_default.log2(number);
+}
+function getEvaluateUnaryComponentwise(operation) {
+ return function(call, left) {
+ if (typeof left === "number") {
+ return operation(left);
+ } else if (left instanceof Cartesian2_default) {
+ return Cartesian2_default.fromElements(
+ operation(left.x),
+ operation(left.y),
+ scratchStorage.getCartesian2()
+ );
+ } else if (left instanceof Cartesian3_default) {
+ return Cartesian3_default.fromElements(
+ operation(left.x),
+ operation(left.y),
+ operation(left.z),
+ scratchStorage.getCartesian3()
+ );
+ } else if (left instanceof Cartesian4_default) {
+ return Cartesian4_default.fromElements(
+ operation(left.x),
+ operation(left.y),
+ operation(left.z),
+ operation(left.w),
+ scratchStorage.getCartesian4()
+ );
+ }
+ throw new RuntimeError_default(
+ `Function "${call}" requires a vector or number argument. Argument is ${left}.`
+ );
+ };
+}
+function getEvaluateBinaryComponentwise(operation, allowScalar) {
+ return function(call, left, right) {
+ if (allowScalar && typeof right === "number") {
+ if (typeof left === "number") {
+ return operation(left, right);
+ } else if (left instanceof Cartesian2_default) {
+ return Cartesian2_default.fromElements(
+ operation(left.x, right),
+ operation(left.y, right),
+ scratchStorage.getCartesian2()
+ );
+ } else if (left instanceof Cartesian3_default) {
+ return Cartesian3_default.fromElements(
+ operation(left.x, right),
+ operation(left.y, right),
+ operation(left.z, right),
+ scratchStorage.getCartesian3()
+ );
+ } else if (left instanceof Cartesian4_default) {
+ return Cartesian4_default.fromElements(
+ operation(left.x, right),
+ operation(left.y, right),
+ operation(left.z, right),
+ operation(left.w, right),
+ scratchStorage.getCartesian4()
+ );
+ }
+ }
+ if (typeof left === "number" && typeof right === "number") {
+ return operation(left, right);
+ } else if (left instanceof Cartesian2_default && right instanceof Cartesian2_default) {
+ return Cartesian2_default.fromElements(
+ operation(left.x, right.x),
+ operation(left.y, right.y),
+ scratchStorage.getCartesian2()
+ );
+ } else if (left instanceof Cartesian3_default && right instanceof Cartesian3_default) {
+ return Cartesian3_default.fromElements(
+ operation(left.x, right.x),
+ operation(left.y, right.y),
+ operation(left.z, right.z),
+ scratchStorage.getCartesian3()
+ );
+ } else if (left instanceof Cartesian4_default && right instanceof Cartesian4_default) {
+ return Cartesian4_default.fromElements(
+ operation(left.x, right.x),
+ operation(left.y, right.y),
+ operation(left.z, right.z),
+ operation(left.w, right.w),
+ scratchStorage.getCartesian4()
+ );
+ }
+ throw new RuntimeError_default(
+ `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`
+ );
+ };
+}
+function getEvaluateTernaryComponentwise(operation, allowScalar) {
+ return function(call, left, right, test) {
+ if (allowScalar && typeof test === "number") {
+ if (typeof left === "number" && typeof right === "number") {
+ return operation(left, right, test);
+ } else if (left instanceof Cartesian2_default && right instanceof Cartesian2_default) {
+ return Cartesian2_default.fromElements(
+ operation(left.x, right.x, test),
+ operation(left.y, right.y, test),
+ scratchStorage.getCartesian2()
+ );
+ } else if (left instanceof Cartesian3_default && right instanceof Cartesian3_default) {
+ return Cartesian3_default.fromElements(
+ operation(left.x, right.x, test),
+ operation(left.y, right.y, test),
+ operation(left.z, right.z, test),
+ scratchStorage.getCartesian3()
+ );
+ } else if (left instanceof Cartesian4_default && right instanceof Cartesian4_default) {
+ return Cartesian4_default.fromElements(
+ operation(left.x, right.x, test),
+ operation(left.y, right.y, test),
+ operation(left.z, right.z, test),
+ operation(left.w, right.w, test),
+ scratchStorage.getCartesian4()
+ );
+ }
+ }
+ if (typeof left === "number" && typeof right === "number" && typeof test === "number") {
+ return operation(left, right, test);
+ } else if (left instanceof Cartesian2_default && right instanceof Cartesian2_default && test instanceof Cartesian2_default) {
+ return Cartesian2_default.fromElements(
+ operation(left.x, right.x, test.x),
+ operation(left.y, right.y, test.y),
+ scratchStorage.getCartesian2()
+ );
+ } else if (left instanceof Cartesian3_default && right instanceof Cartesian3_default && test instanceof Cartesian3_default) {
+ return Cartesian3_default.fromElements(
+ operation(left.x, right.x, test.x),
+ operation(left.y, right.y, test.y),
+ operation(left.z, right.z, test.z),
+ scratchStorage.getCartesian3()
+ );
+ } else if (left instanceof Cartesian4_default && right instanceof Cartesian4_default && test instanceof Cartesian4_default) {
+ return Cartesian4_default.fromElements(
+ operation(left.x, right.x, test.x),
+ operation(left.y, right.y, test.y),
+ operation(left.z, right.z, test.z),
+ operation(left.w, right.w, test.w),
+ scratchStorage.getCartesian4()
+ );
+ }
+ throw new RuntimeError_default(
+ `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left}, ${right}, and ${test}.`
+ );
+ };
+}
+function length2(call, left) {
+ if (typeof left === "number") {
+ return Math.abs(left);
+ } else if (left instanceof Cartesian2_default) {
+ return Cartesian2_default.magnitude(left);
+ } else if (left instanceof Cartesian3_default) {
+ return Cartesian3_default.magnitude(left);
+ } else if (left instanceof Cartesian4_default) {
+ return Cartesian4_default.magnitude(left);
+ }
+ throw new RuntimeError_default(
+ `Function "${call}" requires a vector or number argument. Argument is ${left}.`
+ );
+}
+function normalize(call, left) {
+ if (typeof left === "number") {
+ return 1;
+ } else if (left instanceof Cartesian2_default) {
+ return Cartesian2_default.normalize(left, scratchStorage.getCartesian2());
+ } else if (left instanceof Cartesian3_default) {
+ return Cartesian3_default.normalize(left, scratchStorage.getCartesian3());
+ } else if (left instanceof Cartesian4_default) {
+ return Cartesian4_default.normalize(left, scratchStorage.getCartesian4());
+ }
+ throw new RuntimeError_default(
+ `Function "${call}" requires a vector or number argument. Argument is ${left}.`
+ );
+}
+function distance(call, left, right) {
+ if (typeof left === "number" && typeof right === "number") {
+ return Math.abs(left - right);
+ } else if (left instanceof Cartesian2_default && right instanceof Cartesian2_default) {
+ return Cartesian2_default.distance(left, right);
+ } else if (left instanceof Cartesian3_default && right instanceof Cartesian3_default) {
+ return Cartesian3_default.distance(left, right);
+ } else if (left instanceof Cartesian4_default && right instanceof Cartesian4_default) {
+ return Cartesian4_default.distance(left, right);
+ }
+ throw new RuntimeError_default(
+ `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`
+ );
+}
+function dot(call, left, right) {
+ if (typeof left === "number" && typeof right === "number") {
+ return left * right;
+ } else if (left instanceof Cartesian2_default && right instanceof Cartesian2_default) {
+ return Cartesian2_default.dot(left, right);
+ } else if (left instanceof Cartesian3_default && right instanceof Cartesian3_default) {
+ return Cartesian3_default.dot(left, right);
+ } else if (left instanceof Cartesian4_default && right instanceof Cartesian4_default) {
+ return Cartesian4_default.dot(left, right);
+ }
+ throw new RuntimeError_default(
+ `Function "${call}" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`
+ );
+}
+function cross(call, left, right) {
+ if (left instanceof Cartesian3_default && right instanceof Cartesian3_default) {
+ return Cartesian3_default.cross(left, right, scratchStorage.getCartesian3());
+ }
+ throw new RuntimeError_default(
+ `Function "${call}" requires vec3 arguments. Arguments are ${left} and ${right}.`
+ );
+}
+function Node2(type, value, left, right, test) {
+ this._type = type;
+ this._value = value;
+ this._left = left;
+ this._right = right;
+ this._test = test;
+ this.evaluate = void 0;
+ setEvaluateFunction(this);
+}
+function replaceDefines(expression, defines) {
+ if (!defined_default(defines)) {
+ return expression;
+ }
+ for (const key in defines) {
+ if (defines.hasOwnProperty(key)) {
+ const definePlaceholder = new RegExp(`\\$\\{${key}\\}`, "g");
+ const defineReplace = `(${defines[key]})`;
+ if (defined_default(defineReplace)) {
+ expression = expression.replace(definePlaceholder, defineReplace);
+ }
+ }
+ }
+ return expression;
+}
+function removeBackslashes(expression) {
+ return expression.replace(backslashRegex, backslashReplacement);
+}
+function replaceBackslashes(expression) {
+ return expression.replace(replacementRegex, "\\");
+}
+function replaceVariables(expression) {
+ let exp = expression;
+ let result = "";
+ let i = exp.indexOf("${");
+ while (i >= 0) {
+ const openSingleQuote = exp.indexOf("'");
+ const openDoubleQuote = exp.indexOf('"');
+ let closeQuote;
+ if (openSingleQuote >= 0 && openSingleQuote < i) {
+ closeQuote = exp.indexOf("'", openSingleQuote + 1);
+ result += exp.substr(0, closeQuote + 1);
+ exp = exp.substr(closeQuote + 1);
+ i = exp.indexOf("${");
+ } else if (openDoubleQuote >= 0 && openDoubleQuote < i) {
+ closeQuote = exp.indexOf('"', openDoubleQuote + 1);
+ result += exp.substr(0, closeQuote + 1);
+ exp = exp.substr(closeQuote + 1);
+ i = exp.indexOf("${");
+ } else {
+ result += exp.substr(0, i);
+ const j = exp.indexOf("}");
+ if (j < 0) {
+ throw new RuntimeError_default("Unmatched {.");
+ }
+ result += `czm_${exp.substr(i + 2, j - (i + 2))}`;
+ exp = exp.substr(j + 1);
+ i = exp.indexOf("${");
+ }
+ }
+ result += exp;
+ return result;
+}
+function parseLiteral(ast) {
+ const type = typeof ast.value;
+ if (ast.value === null) {
+ return new Node2(ExpressionNodeType_default.LITERAL_NULL, null);
+ } else if (type === "boolean") {
+ return new Node2(ExpressionNodeType_default.LITERAL_BOOLEAN, ast.value);
+ } else if (type === "number") {
+ return new Node2(ExpressionNodeType_default.LITERAL_NUMBER, ast.value);
+ } else if (type === "string") {
+ if (ast.value.indexOf("${") >= 0) {
+ return new Node2(ExpressionNodeType_default.VARIABLE_IN_STRING, ast.value);
+ }
+ return new Node2(
+ ExpressionNodeType_default.LITERAL_STRING,
+ replaceBackslashes(ast.value)
+ );
+ }
+}
+function parseCall(expression, ast) {
+ const args = ast.arguments;
+ const argsLength = args.length;
+ let call;
+ let val, left, right;
+ if (ast.callee.type === "MemberExpression") {
+ call = ast.callee.property.name;
+ const object2 = ast.callee.object;
+ if (call === "test" || call === "exec") {
+ if (object2.callee.name !== "regExp") {
+ throw new RuntimeError_default(`${call} is not a function.`);
+ }
+ if (argsLength === 0) {
+ if (call === "test") {
+ return new Node2(ExpressionNodeType_default.LITERAL_BOOLEAN, false);
+ }
+ return new Node2(ExpressionNodeType_default.LITERAL_NULL, null);
+ }
+ left = createRuntimeAst(expression, object2);
+ right = createRuntimeAst(expression, args[0]);
+ return new Node2(ExpressionNodeType_default.FUNCTION_CALL, call, left, right);
+ } else if (call === "toString") {
+ val = createRuntimeAst(expression, object2);
+ return new Node2(ExpressionNodeType_default.FUNCTION_CALL, call, val);
+ }
+ throw new RuntimeError_default(`Unexpected function call "${call}".`);
+ }
+ call = ast.callee.name;
+ if (call === "color") {
+ if (argsLength === 0) {
+ return new Node2(ExpressionNodeType_default.LITERAL_COLOR, call);
+ }
+ val = createRuntimeAst(expression, args[0]);
+ if (defined_default(args[1])) {
+ const alpha = createRuntimeAst(expression, args[1]);
+ return new Node2(ExpressionNodeType_default.LITERAL_COLOR, call, [val, alpha]);
+ }
+ return new Node2(ExpressionNodeType_default.LITERAL_COLOR, call, [val]);
+ } else if (call === "rgb" || call === "hsl") {
+ if (argsLength < 3) {
+ throw new RuntimeError_default(`${call} requires three arguments.`);
+ }
+ val = [
+ createRuntimeAst(expression, args[0]),
+ createRuntimeAst(expression, args[1]),
+ createRuntimeAst(expression, args[2])
+ ];
+ return new Node2(ExpressionNodeType_default.LITERAL_COLOR, call, val);
+ } else if (call === "rgba" || call === "hsla") {
+ if (argsLength < 4) {
+ throw new RuntimeError_default(`${call} requires four arguments.`);
+ }
+ val = [
+ createRuntimeAst(expression, args[0]),
+ createRuntimeAst(expression, args[1]),
+ createRuntimeAst(expression, args[2]),
+ createRuntimeAst(expression, args[3])
+ ];
+ return new Node2(ExpressionNodeType_default.LITERAL_COLOR, call, val);
+ } else if (call === "vec2" || call === "vec3" || call === "vec4") {
+ val = new Array(argsLength);
+ for (let i = 0; i < argsLength; ++i) {
+ val[i] = createRuntimeAst(expression, args[i]);
+ }
+ return new Node2(ExpressionNodeType_default.LITERAL_VECTOR, call, val);
+ } else if (call === "isNaN" || call === "isFinite") {
+ if (argsLength === 0) {
+ if (call === "isNaN") {
+ return new Node2(ExpressionNodeType_default.LITERAL_BOOLEAN, true);
+ }
+ return new Node2(ExpressionNodeType_default.LITERAL_BOOLEAN, false);
+ }
+ val = createRuntimeAst(expression, args[0]);
+ return new Node2(ExpressionNodeType_default.UNARY, call, val);
+ } else if (call === "isExactClass" || call === "isClass") {
+ if (argsLength < 1 || argsLength > 1) {
+ throw new RuntimeError_default(`${call} requires exactly one argument.`);
+ }
+ val = createRuntimeAst(expression, args[0]);
+ return new Node2(ExpressionNodeType_default.UNARY, call, val);
+ } else if (call === "getExactClassName") {
+ if (argsLength > 0) {
+ throw new RuntimeError_default(`${call} does not take any argument.`);
+ }
+ return new Node2(ExpressionNodeType_default.UNARY, call);
+ } else if (defined_default(unaryFunctions[call])) {
+ if (argsLength !== 1) {
+ throw new RuntimeError_default(`${call} requires exactly one argument.`);
+ }
+ val = createRuntimeAst(expression, args[0]);
+ return new Node2(ExpressionNodeType_default.UNARY, call, val);
+ } else if (defined_default(binaryFunctions[call])) {
+ if (argsLength !== 2) {
+ throw new RuntimeError_default(`${call} requires exactly two arguments.`);
+ }
+ left = createRuntimeAst(expression, args[0]);
+ right = createRuntimeAst(expression, args[1]);
+ return new Node2(ExpressionNodeType_default.BINARY, call, left, right);
+ } else if (defined_default(ternaryFunctions[call])) {
+ if (argsLength !== 3) {
+ throw new RuntimeError_default(`${call} requires exactly three arguments.`);
+ }
+ left = createRuntimeAst(expression, args[0]);
+ right = createRuntimeAst(expression, args[1]);
+ const test = createRuntimeAst(expression, args[2]);
+ return new Node2(ExpressionNodeType_default.TERNARY, call, left, right, test);
+ } else if (call === "Boolean") {
+ if (argsLength === 0) {
+ return new Node2(ExpressionNodeType_default.LITERAL_BOOLEAN, false);
+ }
+ val = createRuntimeAst(expression, args[0]);
+ return new Node2(ExpressionNodeType_default.UNARY, call, val);
+ } else if (call === "Number") {
+ if (argsLength === 0) {
+ return new Node2(ExpressionNodeType_default.LITERAL_NUMBER, 0);
+ }
+ val = createRuntimeAst(expression, args[0]);
+ return new Node2(ExpressionNodeType_default.UNARY, call, val);
+ } else if (call === "String") {
+ if (argsLength === 0) {
+ return new Node2(ExpressionNodeType_default.LITERAL_STRING, "");
+ }
+ val = createRuntimeAst(expression, args[0]);
+ return new Node2(ExpressionNodeType_default.UNARY, call, val);
+ } else if (call === "regExp") {
+ return parseRegex(expression, ast);
+ }
+ throw new RuntimeError_default(`Unexpected function call "${call}".`);
+}
+function parseRegex(expression, ast) {
+ const args = ast.arguments;
+ if (args.length === 0) {
+ return new Node2(ExpressionNodeType_default.LITERAL_REGEX, new RegExp());
+ }
+ const pattern = createRuntimeAst(expression, args[0]);
+ let exp;
+ if (args.length > 1) {
+ const flags = createRuntimeAst(expression, args[1]);
+ if (isLiteralType(pattern) && isLiteralType(flags)) {
+ try {
+ exp = new RegExp(
+ replaceBackslashes(String(pattern._value)),
+ flags._value
+ );
+ } catch (e) {
+ throw new RuntimeError_default(e);
+ }
+ return new Node2(ExpressionNodeType_default.LITERAL_REGEX, exp);
+ }
+ return new Node2(ExpressionNodeType_default.REGEX, pattern, flags);
+ }
+ if (isLiteralType(pattern)) {
+ try {
+ exp = new RegExp(replaceBackslashes(String(pattern._value)));
+ } catch (e) {
+ throw new RuntimeError_default(e);
+ }
+ return new Node2(ExpressionNodeType_default.LITERAL_REGEX, exp);
+ }
+ return new Node2(ExpressionNodeType_default.REGEX, pattern);
+}
+function parseKeywordsAndVariables(ast) {
+ if (isVariable(ast.name)) {
+ const name = getPropertyName(ast.name);
+ if (name.substr(0, 8) === "tiles3d_") {
+ return new Node2(ExpressionNodeType_default.BUILTIN_VARIABLE, name);
+ }
+ return new Node2(ExpressionNodeType_default.VARIABLE, name);
+ } else if (ast.name === "NaN") {
+ return new Node2(ExpressionNodeType_default.LITERAL_NUMBER, NaN);
+ } else if (ast.name === "Infinity") {
+ return new Node2(ExpressionNodeType_default.LITERAL_NUMBER, Infinity);
+ } else if (ast.name === "undefined") {
+ return new Node2(ExpressionNodeType_default.LITERAL_UNDEFINED, void 0);
+ }
+ throw new RuntimeError_default(`${ast.name} is not defined.`);
+}
+function parseMathConstant(ast) {
+ const name = ast.property.name;
+ if (name === "PI") {
+ return new Node2(ExpressionNodeType_default.LITERAL_NUMBER, Math.PI);
+ } else if (name === "E") {
+ return new Node2(ExpressionNodeType_default.LITERAL_NUMBER, Math.E);
+ }
+}
+function parseNumberConstant(ast) {
+ const name = ast.property.name;
+ if (name === "POSITIVE_INFINITY") {
+ return new Node2(
+ ExpressionNodeType_default.LITERAL_NUMBER,
+ Number.POSITIVE_INFINITY
+ );
+ }
+}
+function parseMemberExpression(expression, ast) {
+ if (ast.object.name === "Math") {
+ return parseMathConstant(ast);
+ } else if (ast.object.name === "Number") {
+ return parseNumberConstant(ast);
+ }
+ let val;
+ const obj = createRuntimeAst(expression, ast.object);
+ if (ast.computed) {
+ val = createRuntimeAst(expression, ast.property);
+ return new Node2(ExpressionNodeType_default.MEMBER, "brackets", obj, val);
+ }
+ val = new Node2(ExpressionNodeType_default.LITERAL_STRING, ast.property.name);
+ return new Node2(ExpressionNodeType_default.MEMBER, "dot", obj, val);
+}
+function isLiteralType(node) {
+ return node._type >= ExpressionNodeType_default.LITERAL_NULL;
+}
+function isVariable(name) {
+ return name.substr(0, 4) === "czm_";
+}
+function getPropertyName(variable) {
+ return variable.substr(4);
+}
+function createRuntimeAst(expression, ast) {
+ let node;
+ let op;
+ let left;
+ let right;
+ if (ast.type === "Literal") {
+ node = parseLiteral(ast);
+ } else if (ast.type === "CallExpression") {
+ node = parseCall(expression, ast);
+ } else if (ast.type === "Identifier") {
+ node = parseKeywordsAndVariables(ast);
+ } else if (ast.type === "UnaryExpression") {
+ op = ast.operator;
+ const child = createRuntimeAst(expression, ast.argument);
+ if (unaryOperators.indexOf(op) > -1) {
+ node = new Node2(ExpressionNodeType_default.UNARY, op, child);
+ } else {
+ throw new RuntimeError_default(`Unexpected operator "${op}".`);
+ }
+ } else if (ast.type === "BinaryExpression") {
+ op = ast.operator;
+ left = createRuntimeAst(expression, ast.left);
+ right = createRuntimeAst(expression, ast.right);
+ if (binaryOperators.indexOf(op) > -1) {
+ node = new Node2(ExpressionNodeType_default.BINARY, op, left, right);
+ } else {
+ throw new RuntimeError_default(`Unexpected operator "${op}".`);
+ }
+ } else if (ast.type === "LogicalExpression") {
+ op = ast.operator;
+ left = createRuntimeAst(expression, ast.left);
+ right = createRuntimeAst(expression, ast.right);
+ if (binaryOperators.indexOf(op) > -1) {
+ node = new Node2(ExpressionNodeType_default.BINARY, op, left, right);
+ }
+ } else if (ast.type === "ConditionalExpression") {
+ const test = createRuntimeAst(expression, ast.test);
+ left = createRuntimeAst(expression, ast.consequent);
+ right = createRuntimeAst(expression, ast.alternate);
+ node = new Node2(ExpressionNodeType_default.CONDITIONAL, "?", left, right, test);
+ } else if (ast.type === "MemberExpression") {
+ node = parseMemberExpression(expression, ast);
+ } else if (ast.type === "ArrayExpression") {
+ const val = [];
+ for (let i = 0; i < ast.elements.length; i++) {
+ val[i] = createRuntimeAst(expression, ast.elements[i]);
+ }
+ node = new Node2(ExpressionNodeType_default.ARRAY, val);
+ } else if (ast.type === "Compound") {
+ throw new RuntimeError_default("Provide exactly one expression.");
+ } else {
+ throw new RuntimeError_default("Cannot parse expression.");
+ }
+ return node;
+}
+function setEvaluateFunction(node) {
+ if (node._type === ExpressionNodeType_default.CONDITIONAL) {
+ node.evaluate = node._evaluateConditional;
+ } else if (node._type === ExpressionNodeType_default.FUNCTION_CALL) {
+ if (node._value === "test") {
+ node.evaluate = node._evaluateRegExpTest;
+ } else if (node._value === "exec") {
+ node.evaluate = node._evaluateRegExpExec;
+ } else if (node._value === "toString") {
+ node.evaluate = node._evaluateToString;
+ }
+ } else if (node._type === ExpressionNodeType_default.UNARY) {
+ if (node._value === "!") {
+ node.evaluate = node._evaluateNot;
+ } else if (node._value === "-") {
+ node.evaluate = node._evaluateNegative;
+ } else if (node._value === "+") {
+ node.evaluate = node._evaluatePositive;
+ } else if (node._value === "isNaN") {
+ node.evaluate = node._evaluateNaN;
+ } else if (node._value === "isFinite") {
+ node.evaluate = node._evaluateIsFinite;
+ } else if (node._value === "isExactClass") {
+ node.evaluate = node._evaluateIsExactClass;
+ } else if (node._value === "isClass") {
+ node.evaluate = node._evaluateIsClass;
+ } else if (node._value === "getExactClassName") {
+ node.evaluate = node._evaluateGetExactClassName;
+ } else if (node._value === "Boolean") {
+ node.evaluate = node._evaluateBooleanConversion;
+ } else if (node._value === "Number") {
+ node.evaluate = node._evaluateNumberConversion;
+ } else if (node._value === "String") {
+ node.evaluate = node._evaluateStringConversion;
+ } else if (defined_default(unaryFunctions[node._value])) {
+ node.evaluate = getEvaluateUnaryFunction(node._value);
+ }
+ } else if (node._type === ExpressionNodeType_default.BINARY) {
+ if (node._value === "+") {
+ node.evaluate = node._evaluatePlus;
+ } else if (node._value === "-") {
+ node.evaluate = node._evaluateMinus;
+ } else if (node._value === "*") {
+ node.evaluate = node._evaluateTimes;
+ } else if (node._value === "/") {
+ node.evaluate = node._evaluateDivide;
+ } else if (node._value === "%") {
+ node.evaluate = node._evaluateMod;
+ } else if (node._value === "===") {
+ node.evaluate = node._evaluateEqualsStrict;
+ } else if (node._value === "!==") {
+ node.evaluate = node._evaluateNotEqualsStrict;
+ } else if (node._value === "<") {
+ node.evaluate = node._evaluateLessThan;
+ } else if (node._value === "<=") {
+ node.evaluate = node._evaluateLessThanOrEquals;
+ } else if (node._value === ">") {
+ node.evaluate = node._evaluateGreaterThan;
+ } else if (node._value === ">=") {
+ node.evaluate = node._evaluateGreaterThanOrEquals;
+ } else if (node._value === "&&") {
+ node.evaluate = node._evaluateAnd;
+ } else if (node._value === "||") {
+ node.evaluate = node._evaluateOr;
+ } else if (node._value === "=~") {
+ node.evaluate = node._evaluateRegExpMatch;
+ } else if (node._value === "!~") {
+ node.evaluate = node._evaluateRegExpNotMatch;
+ } else if (defined_default(binaryFunctions[node._value])) {
+ node.evaluate = getEvaluateBinaryFunction(node._value);
+ }
+ } else if (node._type === ExpressionNodeType_default.TERNARY) {
+ node.evaluate = getEvaluateTernaryFunction(node._value);
+ } else if (node._type === ExpressionNodeType_default.MEMBER) {
+ if (node._value === "brackets") {
+ node.evaluate = node._evaluateMemberBrackets;
+ } else {
+ node.evaluate = node._evaluateMemberDot;
+ }
+ } else if (node._type === ExpressionNodeType_default.ARRAY) {
+ node.evaluate = node._evaluateArray;
+ } else if (node._type === ExpressionNodeType_default.VARIABLE) {
+ node.evaluate = node._evaluateVariable;
+ } else if (node._type === ExpressionNodeType_default.VARIABLE_IN_STRING) {
+ node.evaluate = node._evaluateVariableString;
+ } else if (node._type === ExpressionNodeType_default.LITERAL_COLOR) {
+ node.evaluate = node._evaluateLiteralColor;
+ } else if (node._type === ExpressionNodeType_default.LITERAL_VECTOR) {
+ node.evaluate = node._evaluateLiteralVector;
+ } else if (node._type === ExpressionNodeType_default.LITERAL_STRING) {
+ node.evaluate = node._evaluateLiteralString;
+ } else if (node._type === ExpressionNodeType_default.REGEX) {
+ node.evaluate = node._evaluateRegExp;
+ } else if (node._type === ExpressionNodeType_default.BUILTIN_VARIABLE) {
+ if (node._value === "tiles3d_tileset_time") {
+ node.evaluate = evaluateTilesetTime;
+ }
+ } else {
+ node.evaluate = node._evaluateLiteral;
+ }
+}
+function evaluateTilesetTime(feature2) {
+ if (!defined_default(feature2)) {
+ return 0;
+ }
+ return feature2.content.tileset.timeSinceLoad;
+}
+function getEvaluateUnaryFunction(call) {
+ const evaluate = unaryFunctions[call];
+ return function(feature2) {
+ const left = this._left.evaluate(feature2);
+ return evaluate(call, left);
+ };
+}
+function getEvaluateBinaryFunction(call) {
+ const evaluate = binaryFunctions[call];
+ return function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ return evaluate(call, left, right);
+ };
+}
+function getEvaluateTernaryFunction(call) {
+ const evaluate = ternaryFunctions[call];
+ return function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ const test = this._test.evaluate(feature2);
+ return evaluate(call, left, right, test);
+ };
+}
+function getFeatureProperty(feature2, name) {
+ if (defined_default(feature2)) {
+ return feature2.getPropertyInherited(name);
+ }
+}
+Node2.prototype._evaluateLiteral = function() {
+ return this._value;
+};
+Node2.prototype._evaluateLiteralColor = function(feature2) {
+ const color = scratchColor3;
+ const args = this._left;
+ if (this._value === "color") {
+ if (!defined_default(args)) {
+ Color_default.fromBytes(255, 255, 255, 255, color);
+ } else if (args.length > 1) {
+ Color_default.fromCssColorString(args[0].evaluate(feature2), color);
+ color.alpha = args[1].evaluate(feature2);
+ } else {
+ Color_default.fromCssColorString(args[0].evaluate(feature2), color);
+ }
+ } else if (this._value === "rgb") {
+ Color_default.fromBytes(
+ args[0].evaluate(feature2),
+ args[1].evaluate(feature2),
+ args[2].evaluate(feature2),
+ 255,
+ color
+ );
+ } else if (this._value === "rgba") {
+ const a3 = args[3].evaluate(feature2) * 255;
+ Color_default.fromBytes(
+ args[0].evaluate(feature2),
+ args[1].evaluate(feature2),
+ args[2].evaluate(feature2),
+ a3,
+ color
+ );
+ } else if (this._value === "hsl") {
+ Color_default.fromHsl(
+ args[0].evaluate(feature2),
+ args[1].evaluate(feature2),
+ args[2].evaluate(feature2),
+ 1,
+ color
+ );
+ } else if (this._value === "hsla") {
+ Color_default.fromHsl(
+ args[0].evaluate(feature2),
+ args[1].evaluate(feature2),
+ args[2].evaluate(feature2),
+ args[3].evaluate(feature2),
+ color
+ );
+ }
+ return Cartesian4_default.fromColor(color, scratchStorage.getCartesian4());
+};
+Node2.prototype._evaluateLiteralVector = function(feature2) {
+ const components = scratchStorage.getArray();
+ const call = this._value;
+ const args = this._left;
+ const argsLength = args.length;
+ for (let i = 0; i < argsLength; ++i) {
+ const value = args[i].evaluate(feature2);
+ if (typeof value === "number") {
+ components.push(value);
+ } else if (value instanceof Cartesian2_default) {
+ components.push(value.x, value.y);
+ } else if (value instanceof Cartesian3_default) {
+ components.push(value.x, value.y, value.z);
+ } else if (value instanceof Cartesian4_default) {
+ components.push(value.x, value.y, value.z, value.w);
+ } else {
+ throw new RuntimeError_default(
+ `${call} argument must be a vector or number. Argument is ${value}.`
+ );
+ }
+ }
+ const componentsLength = components.length;
+ const vectorLength = parseInt(call.charAt(3));
+ if (componentsLength === 0) {
+ throw new RuntimeError_default(`Invalid ${call} constructor. No valid arguments.`);
+ } else if (componentsLength < vectorLength && componentsLength > 1) {
+ throw new RuntimeError_default(
+ `Invalid ${call} constructor. Not enough arguments.`
+ );
+ } else if (componentsLength > vectorLength && argsLength > 1) {
+ throw new RuntimeError_default(`Invalid ${call} constructor. Too many arguments.`);
+ }
+ if (componentsLength === 1) {
+ const component = components[0];
+ components.push(component, component, component);
+ }
+ if (call === "vec2") {
+ return Cartesian2_default.fromArray(components, 0, scratchStorage.getCartesian2());
+ } else if (call === "vec3") {
+ return Cartesian3_default.fromArray(components, 0, scratchStorage.getCartesian3());
+ } else if (call === "vec4") {
+ return Cartesian4_default.fromArray(components, 0, scratchStorage.getCartesian4());
+ }
+};
+Node2.prototype._evaluateLiteralString = function() {
+ return this._value;
+};
+Node2.prototype._evaluateVariableString = function(feature2) {
+ let result = this._value;
+ let match = variableRegex.exec(result);
+ while (match !== null) {
+ const placeholder = match[0];
+ const variableName = match[1];
+ let property = getFeatureProperty(feature2, variableName);
+ if (!defined_default(property)) {
+ property = "";
+ }
+ result = result.replace(placeholder, property);
+ match = variableRegex.exec(result);
+ }
+ return result;
+};
+Node2.prototype._evaluateVariable = function(feature2) {
+ return getFeatureProperty(feature2, this._value);
+};
+function checkFeature(ast) {
+ return ast._value === "feature";
+}
+Node2.prototype._evaluateMemberDot = function(feature2) {
+ if (checkFeature(this._left)) {
+ return getFeatureProperty(feature2, this._right.evaluate(feature2));
+ }
+ const property = this._left.evaluate(feature2);
+ if (!defined_default(property)) {
+ return void 0;
+ }
+ const member = this._right.evaluate(feature2);
+ if (property instanceof Cartesian2_default || property instanceof Cartesian3_default || property instanceof Cartesian4_default) {
+ if (member === "r") {
+ return property.x;
+ } else if (member === "g") {
+ return property.y;
+ } else if (member === "b") {
+ return property.z;
+ } else if (member === "a") {
+ return property.w;
+ }
+ }
+ return property[member];
+};
+Node2.prototype._evaluateMemberBrackets = function(feature2) {
+ if (checkFeature(this._left)) {
+ return getFeatureProperty(feature2, this._right.evaluate(feature2));
+ }
+ const property = this._left.evaluate(feature2);
+ if (!defined_default(property)) {
+ return void 0;
+ }
+ const member = this._right.evaluate(feature2);
+ if (property instanceof Cartesian2_default || property instanceof Cartesian3_default || property instanceof Cartesian4_default) {
+ if (member === 0 || member === "r") {
+ return property.x;
+ } else if (member === 1 || member === "g") {
+ return property.y;
+ } else if (member === 2 || member === "b") {
+ return property.z;
+ } else if (member === 3 || member === "a") {
+ return property.w;
+ }
+ }
+ return property[member];
+};
+Node2.prototype._evaluateArray = function(feature2) {
+ const array = [];
+ for (let i = 0; i < this._value.length; i++) {
+ array[i] = this._value[i].evaluate(feature2);
+ }
+ return array;
+};
+Node2.prototype._evaluateNot = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ if (typeof left !== "boolean") {
+ throw new RuntimeError_default(
+ `Operator "!" requires a boolean argument. Argument is ${left}.`
+ );
+ }
+ return !left;
+};
+Node2.prototype._evaluateNegative = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ if (left instanceof Cartesian2_default) {
+ return Cartesian2_default.negate(left, scratchStorage.getCartesian2());
+ } else if (left instanceof Cartesian3_default) {
+ return Cartesian3_default.negate(left, scratchStorage.getCartesian3());
+ } else if (left instanceof Cartesian4_default) {
+ return Cartesian4_default.negate(left, scratchStorage.getCartesian4());
+ } else if (typeof left === "number") {
+ return -left;
+ }
+ throw new RuntimeError_default(
+ `Operator "-" requires a vector or number argument. Argument is ${left}.`
+ );
+};
+Node2.prototype._evaluatePositive = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ if (!(left instanceof Cartesian2_default || left instanceof Cartesian3_default || left instanceof Cartesian4_default || typeof left === "number")) {
+ throw new RuntimeError_default(
+ `Operator "+" requires a vector or number argument. Argument is ${left}.`
+ );
+ }
+ return left;
+};
+Node2.prototype._evaluateLessThan = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (typeof left !== "number" || typeof right !== "number") {
+ throw new RuntimeError_default(
+ `Operator "<" requires number arguments. Arguments are ${left} and ${right}.`
+ );
+ }
+ return left < right;
+};
+Node2.prototype._evaluateLessThanOrEquals = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (typeof left !== "number" || typeof right !== "number") {
+ throw new RuntimeError_default(
+ `Operator "<=" requires number arguments. Arguments are ${left} and ${right}.`
+ );
+ }
+ return left <= right;
+};
+Node2.prototype._evaluateGreaterThan = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (typeof left !== "number" || typeof right !== "number") {
+ throw new RuntimeError_default(
+ `Operator ">" requires number arguments. Arguments are ${left} and ${right}.`
+ );
+ }
+ return left > right;
+};
+Node2.prototype._evaluateGreaterThanOrEquals = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (typeof left !== "number" || typeof right !== "number") {
+ throw new RuntimeError_default(
+ `Operator ">=" requires number arguments. Arguments are ${left} and ${right}.`
+ );
+ }
+ return left >= right;
+};
+Node2.prototype._evaluateOr = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ if (typeof left !== "boolean") {
+ throw new RuntimeError_default(
+ `Operator "||" requires boolean arguments. First argument is ${left}.`
+ );
+ }
+ if (left) {
+ return true;
+ }
+ const right = this._right.evaluate(feature2);
+ if (typeof right !== "boolean") {
+ throw new RuntimeError_default(
+ `Operator "||" requires boolean arguments. Second argument is ${right}.`
+ );
+ }
+ return left || right;
+};
+Node2.prototype._evaluateAnd = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ if (typeof left !== "boolean") {
+ throw new RuntimeError_default(
+ `Operator "&&" requires boolean arguments. First argument is ${left}.`
+ );
+ }
+ if (!left) {
+ return false;
+ }
+ const right = this._right.evaluate(feature2);
+ if (typeof right !== "boolean") {
+ throw new RuntimeError_default(
+ `Operator "&&" requires boolean arguments. Second argument is ${right}.`
+ );
+ }
+ return left && right;
+};
+Node2.prototype._evaluatePlus = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (right instanceof Cartesian2_default && left instanceof Cartesian2_default) {
+ return Cartesian2_default.add(left, right, scratchStorage.getCartesian2());
+ } else if (right instanceof Cartesian3_default && left instanceof Cartesian3_default) {
+ return Cartesian3_default.add(left, right, scratchStorage.getCartesian3());
+ } else if (right instanceof Cartesian4_default && left instanceof Cartesian4_default) {
+ return Cartesian4_default.add(left, right, scratchStorage.getCartesian4());
+ } else if (typeof left === "string" || typeof right === "string") {
+ return left + right;
+ } else if (typeof left === "number" && typeof right === "number") {
+ return left + right;
+ }
+ throw new RuntimeError_default(
+ `Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${left} and ${right}.`
+ );
+};
+Node2.prototype._evaluateMinus = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (right instanceof Cartesian2_default && left instanceof Cartesian2_default) {
+ return Cartesian2_default.subtract(left, right, scratchStorage.getCartesian2());
+ } else if (right instanceof Cartesian3_default && left instanceof Cartesian3_default) {
+ return Cartesian3_default.subtract(left, right, scratchStorage.getCartesian3());
+ } else if (right instanceof Cartesian4_default && left instanceof Cartesian4_default) {
+ return Cartesian4_default.subtract(left, right, scratchStorage.getCartesian4());
+ } else if (typeof left === "number" && typeof right === "number") {
+ return left - right;
+ }
+ throw new RuntimeError_default(
+ `Operator "-" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`
+ );
+};
+Node2.prototype._evaluateTimes = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (right instanceof Cartesian2_default && left instanceof Cartesian2_default) {
+ return Cartesian2_default.multiplyComponents(
+ left,
+ right,
+ scratchStorage.getCartesian2()
+ );
+ } else if (right instanceof Cartesian2_default && typeof left === "number") {
+ return Cartesian2_default.multiplyByScalar(
+ right,
+ left,
+ scratchStorage.getCartesian2()
+ );
+ } else if (left instanceof Cartesian2_default && typeof right === "number") {
+ return Cartesian2_default.multiplyByScalar(
+ left,
+ right,
+ scratchStorage.getCartesian2()
+ );
+ } else if (right instanceof Cartesian3_default && left instanceof Cartesian3_default) {
+ return Cartesian3_default.multiplyComponents(
+ left,
+ right,
+ scratchStorage.getCartesian3()
+ );
+ } else if (right instanceof Cartesian3_default && typeof left === "number") {
+ return Cartesian3_default.multiplyByScalar(
+ right,
+ left,
+ scratchStorage.getCartesian3()
+ );
+ } else if (left instanceof Cartesian3_default && typeof right === "number") {
+ return Cartesian3_default.multiplyByScalar(
+ left,
+ right,
+ scratchStorage.getCartesian3()
+ );
+ } else if (right instanceof Cartesian4_default && left instanceof Cartesian4_default) {
+ return Cartesian4_default.multiplyComponents(
+ left,
+ right,
+ scratchStorage.getCartesian4()
+ );
+ } else if (right instanceof Cartesian4_default && typeof left === "number") {
+ return Cartesian4_default.multiplyByScalar(
+ right,
+ left,
+ scratchStorage.getCartesian4()
+ );
+ } else if (left instanceof Cartesian4_default && typeof right === "number") {
+ return Cartesian4_default.multiplyByScalar(
+ left,
+ right,
+ scratchStorage.getCartesian4()
+ );
+ } else if (typeof left === "number" && typeof right === "number") {
+ return left * right;
+ }
+ throw new RuntimeError_default(
+ `Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${left} and ${right}.`
+ );
+};
+Node2.prototype._evaluateDivide = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (right instanceof Cartesian2_default && left instanceof Cartesian2_default) {
+ return Cartesian2_default.divideComponents(
+ left,
+ right,
+ scratchStorage.getCartesian2()
+ );
+ } else if (left instanceof Cartesian2_default && typeof right === "number") {
+ return Cartesian2_default.divideByScalar(
+ left,
+ right,
+ scratchStorage.getCartesian2()
+ );
+ } else if (right instanceof Cartesian3_default && left instanceof Cartesian3_default) {
+ return Cartesian3_default.divideComponents(
+ left,
+ right,
+ scratchStorage.getCartesian3()
+ );
+ } else if (left instanceof Cartesian3_default && typeof right === "number") {
+ return Cartesian3_default.divideByScalar(
+ left,
+ right,
+ scratchStorage.getCartesian3()
+ );
+ } else if (right instanceof Cartesian4_default && left instanceof Cartesian4_default) {
+ return Cartesian4_default.divideComponents(
+ left,
+ right,
+ scratchStorage.getCartesian4()
+ );
+ } else if (left instanceof Cartesian4_default && typeof right === "number") {
+ return Cartesian4_default.divideByScalar(
+ left,
+ right,
+ scratchStorage.getCartesian4()
+ );
+ } else if (typeof left === "number" && typeof right === "number") {
+ return left / right;
+ }
+ throw new RuntimeError_default(
+ `Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${left} and ${right}.`
+ );
+};
+Node2.prototype._evaluateMod = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (right instanceof Cartesian2_default && left instanceof Cartesian2_default) {
+ return Cartesian2_default.fromElements(
+ left.x % right.x,
+ left.y % right.y,
+ scratchStorage.getCartesian2()
+ );
+ } else if (right instanceof Cartesian3_default && left instanceof Cartesian3_default) {
+ return Cartesian3_default.fromElements(
+ left.x % right.x,
+ left.y % right.y,
+ left.z % right.z,
+ scratchStorage.getCartesian3()
+ );
+ } else if (right instanceof Cartesian4_default && left instanceof Cartesian4_default) {
+ return Cartesian4_default.fromElements(
+ left.x % right.x,
+ left.y % right.y,
+ left.z % right.z,
+ left.w % right.w,
+ scratchStorage.getCartesian4()
+ );
+ } else if (typeof left === "number" && typeof right === "number") {
+ return left % right;
+ }
+ throw new RuntimeError_default(
+ `Operator "%" requires vector or number arguments of matching types. Arguments are ${left} and ${right}.`
+ );
+};
+Node2.prototype._evaluateEqualsStrict = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (right instanceof Cartesian2_default && left instanceof Cartesian2_default || right instanceof Cartesian3_default && left instanceof Cartesian3_default || right instanceof Cartesian4_default && left instanceof Cartesian4_default) {
+ return left.equals(right);
+ }
+ return left === right;
+};
+Node2.prototype._evaluateNotEqualsStrict = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (right instanceof Cartesian2_default && left instanceof Cartesian2_default || right instanceof Cartesian3_default && left instanceof Cartesian3_default || right instanceof Cartesian4_default && left instanceof Cartesian4_default) {
+ return !left.equals(right);
+ }
+ return left !== right;
+};
+Node2.prototype._evaluateConditional = function(feature2) {
+ const test = this._test.evaluate(feature2);
+ if (typeof test !== "boolean") {
+ throw new RuntimeError_default(
+ `Conditional argument of conditional expression must be a boolean. Argument is ${test}.`
+ );
+ }
+ if (test) {
+ return this._left.evaluate(feature2);
+ }
+ return this._right.evaluate(feature2);
+};
+Node2.prototype._evaluateNaN = function(feature2) {
+ return isNaN(this._left.evaluate(feature2));
+};
+Node2.prototype._evaluateIsFinite = function(feature2) {
+ return isFinite(this._left.evaluate(feature2));
+};
+Node2.prototype._evaluateIsExactClass = function(feature2) {
+ if (defined_default(feature2)) {
+ return feature2.isExactClass(this._left.evaluate(feature2));
+ }
+ return false;
+};
+Node2.prototype._evaluateIsClass = function(feature2) {
+ if (defined_default(feature2)) {
+ return feature2.isClass(this._left.evaluate(feature2));
+ }
+ return false;
+};
+Node2.prototype._evaluateGetExactClassName = function(feature2) {
+ if (defined_default(feature2)) {
+ return feature2.getExactClassName();
+ }
+};
+Node2.prototype._evaluateBooleanConversion = function(feature2) {
+ return Boolean(this._left.evaluate(feature2));
+};
+Node2.prototype._evaluateNumberConversion = function(feature2) {
+ return Number(this._left.evaluate(feature2));
+};
+Node2.prototype._evaluateStringConversion = function(feature2) {
+ return String(this._left.evaluate(feature2));
+};
+Node2.prototype._evaluateRegExp = function(feature2) {
+ const pattern = this._value.evaluate(feature2);
+ let flags = "";
+ if (defined_default(this._left)) {
+ flags = this._left.evaluate(feature2);
+ }
+ let exp;
+ try {
+ exp = new RegExp(pattern, flags);
+ } catch (e) {
+ throw new RuntimeError_default(e);
+ }
+ return exp;
+};
+Node2.prototype._evaluateRegExpTest = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (!(left instanceof RegExp && typeof right === "string")) {
+ throw new RuntimeError_default(
+ `RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${left} and ${right}.`
+ );
+ }
+ return left.test(right);
+};
+Node2.prototype._evaluateRegExpMatch = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (left instanceof RegExp && typeof right === "string") {
+ return left.test(right);
+ } else if (right instanceof RegExp && typeof left === "string") {
+ return right.test(left);
+ }
+ throw new RuntimeError_default(
+ `Operator "=~" requires one RegExp argument and one string argument. Arguments are ${left} and ${right}.`
+ );
+};
+Node2.prototype._evaluateRegExpNotMatch = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (left instanceof RegExp && typeof right === "string") {
+ return !left.test(right);
+ } else if (right instanceof RegExp && typeof left === "string") {
+ return !right.test(left);
+ }
+ throw new RuntimeError_default(
+ `Operator "!~" requires one RegExp argument and one string argument. Arguments are ${left} and ${right}.`
+ );
+};
+Node2.prototype._evaluateRegExpExec = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ const right = this._right.evaluate(feature2);
+ if (!(left instanceof RegExp && typeof right === "string")) {
+ throw new RuntimeError_default(
+ `RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${left} and ${right}.`
+ );
+ }
+ const exec = left.exec(right);
+ if (!defined_default(exec)) {
+ return null;
+ }
+ return exec[1];
+};
+Node2.prototype._evaluateToString = function(feature2) {
+ const left = this._left.evaluate(feature2);
+ if (left instanceof RegExp || left instanceof Cartesian2_default || left instanceof Cartesian3_default || left instanceof Cartesian4_default) {
+ return String(left);
+ }
+ throw new RuntimeError_default(`Unexpected function call "${this._value}".`);
+};
+function convertHSLToRGB(ast) {
+ const channels = ast._left;
+ const length3 = channels.length;
+ for (let i = 0; i < length3; ++i) {
+ if (channels[i]._type !== ExpressionNodeType_default.LITERAL_NUMBER) {
+ return void 0;
+ }
+ }
+ const h = channels[0]._value;
+ const s = channels[1]._value;
+ const l = channels[2]._value;
+ const a3 = length3 === 4 ? channels[3]._value : 1;
+ return Color_default.fromHsl(h, s, l, a3, scratchColor3);
+}
+function convertRGBToColor(ast) {
+ const channels = ast._left;
+ const length3 = channels.length;
+ for (let i = 0; i < length3; ++i) {
+ if (channels[i]._type !== ExpressionNodeType_default.LITERAL_NUMBER) {
+ return void 0;
+ }
+ }
+ const color = scratchColor3;
+ color.red = channels[0]._value / 255;
+ color.green = channels[1]._value / 255;
+ color.blue = channels[2]._value / 255;
+ color.alpha = length3 === 4 ? channels[3]._value : 1;
+ return color;
+}
+function numberToString(number) {
+ if (number % 1 === 0) {
+ return number.toFixed(1);
+ }
+ return number.toString();
+}
+function colorToVec3(color) {
+ const r = numberToString(color.red);
+ const g = numberToString(color.green);
+ const b = numberToString(color.blue);
+ return `vec3(${r}, ${g}, ${b})`;
+}
+function colorToVec4(color) {
+ const r = numberToString(color.red);
+ const g = numberToString(color.green);
+ const b = numberToString(color.blue);
+ const a3 = numberToString(color.alpha);
+ return `vec4(${r}, ${g}, ${b}, ${a3})`;
+}
+function getExpressionArray(array, variableSubstitutionMap, shaderState, parent) {
+ const length3 = array.length;
+ const expressions = new Array(length3);
+ for (let i = 0; i < length3; ++i) {
+ expressions[i] = array[i].getShaderExpression(
+ variableSubstitutionMap,
+ shaderState,
+ parent
+ );
+ }
+ return expressions;
+}
+function getVariableName(variableName, variableSubstitutionMap) {
+ if (!defined_default(variableSubstitutionMap[variableName])) {
+ return Expression.NULL_SENTINEL;
+ }
+ return variableSubstitutionMap[variableName];
+}
+Expression.NULL_SENTINEL = "czm_infinity";
+Node2.prototype.getShaderExpression = function(variableSubstitutionMap, shaderState, parent) {
+ let color;
+ let left;
+ let right;
+ let test;
+ const type = this._type;
+ let value = this._value;
+ if (defined_default(this._left)) {
+ if (Array.isArray(this._left)) {
+ left = getExpressionArray(
+ this._left,
+ variableSubstitutionMap,
+ shaderState,
+ this
+ );
+ } else {
+ left = this._left.getShaderExpression(
+ variableSubstitutionMap,
+ shaderState,
+ this
+ );
+ }
+ }
+ if (defined_default(this._right)) {
+ right = this._right.getShaderExpression(
+ variableSubstitutionMap,
+ shaderState,
+ this
+ );
+ }
+ if (defined_default(this._test)) {
+ test = this._test.getShaderExpression(
+ variableSubstitutionMap,
+ shaderState,
+ this
+ );
+ }
+ if (Array.isArray(this._value)) {
+ value = getExpressionArray(
+ this._value,
+ variableSubstitutionMap,
+ shaderState,
+ this
+ );
+ }
+ let args;
+ let length3;
+ let vectorExpression;
+ switch (type) {
+ case ExpressionNodeType_default.VARIABLE:
+ if (checkFeature(this)) {
+ return void 0;
+ }
+ return getVariableName(value, variableSubstitutionMap);
+ case ExpressionNodeType_default.UNARY:
+ if (value === "Boolean") {
+ return `bool(${left})`;
+ } else if (value === "Number") {
+ return `float(${left})`;
+ } else if (value === "round") {
+ return `floor(${left} + 0.5)`;
+ } else if (defined_default(unaryFunctions[value])) {
+ return `${value}(${left})`;
+ } else if (value === "isNaN") {
+ return `(${left} != ${left})`;
+ } else if (value === "isFinite") {
+ return `(abs(${left}) < czm_infinity)`;
+ } else if (value === "String" || value === "isExactClass" || value === "isClass" || value === "getExactClassName") {
+ throw new RuntimeError_default(
+ `Error generating style shader: "${value}" is not supported.`
+ );
+ }
+ return value + left;
+ case ExpressionNodeType_default.BINARY:
+ if (value === "%") {
+ return `mod(${left}, ${right})`;
+ } else if (value === "===") {
+ return `(${left} == ${right})`;
+ } else if (value === "!==") {
+ return `(${left} != ${right})`;
+ } else if (value === "atan2") {
+ return `atan(${left}, ${right})`;
+ } else if (defined_default(binaryFunctions[value])) {
+ return `${value}(${left}, ${right})`;
+ }
+ return `(${left} ${value} ${right})`;
+ case ExpressionNodeType_default.TERNARY:
+ if (defined_default(ternaryFunctions[value])) {
+ return `${value}(${left}, ${right}, ${test})`;
+ }
+ break;
+ case ExpressionNodeType_default.CONDITIONAL:
+ return `(${test} ? ${left} : ${right})`;
+ case ExpressionNodeType_default.MEMBER:
+ if (checkFeature(this._left)) {
+ return getVariableName(right, variableSubstitutionMap);
+ }
+ if (right === "r" || right === "x" || right === "0.0") {
+ return `${left}[0]`;
+ } else if (right === "g" || right === "y" || right === "1.0") {
+ return `${left}[1]`;
+ } else if (right === "b" || right === "z" || right === "2.0") {
+ return `${left}[2]`;
+ } else if (right === "a" || right === "w" || right === "3.0") {
+ return `${left}[3]`;
+ }
+ return `${left}[int(${right})]`;
+ case ExpressionNodeType_default.FUNCTION_CALL:
+ throw new RuntimeError_default(
+ `Error generating style shader: "${value}" is not supported.`
+ );
+ case ExpressionNodeType_default.ARRAY:
+ if (value.length === 4) {
+ return `vec4(${value[0]}, ${value[1]}, ${value[2]}, ${value[3]})`;
+ } else if (value.length === 3) {
+ return `vec3(${value[0]}, ${value[1]}, ${value[2]})`;
+ } else if (value.length === 2) {
+ return `vec2(${value[0]}, ${value[1]})`;
+ }
+ throw new RuntimeError_default(
+ "Error generating style shader: Invalid array length. Array length should be 2, 3, or 4."
+ );
+ case ExpressionNodeType_default.REGEX:
+ throw new RuntimeError_default(
+ "Error generating style shader: Regular expressions are not supported."
+ );
+ case ExpressionNodeType_default.VARIABLE_IN_STRING:
+ throw new RuntimeError_default(
+ "Error generating style shader: Converting a variable to a string is not supported."
+ );
+ case ExpressionNodeType_default.LITERAL_NULL:
+ return Expression.NULL_SENTINEL;
+ case ExpressionNodeType_default.LITERAL_BOOLEAN:
+ return value ? "true" : "false";
+ case ExpressionNodeType_default.LITERAL_NUMBER:
+ return numberToString(value);
+ case ExpressionNodeType_default.LITERAL_STRING:
+ if (defined_default(parent) && parent._type === ExpressionNodeType_default.MEMBER) {
+ if (value === "r" || value === "g" || value === "b" || value === "a" || value === "x" || value === "y" || value === "z" || value === "w" || checkFeature(parent._left)) {
+ return value;
+ }
+ }
+ color = Color_default.fromCssColorString(value, scratchColor3);
+ if (defined_default(color)) {
+ return colorToVec3(color);
+ }
+ throw new RuntimeError_default(
+ "Error generating style shader: String literals are not supported."
+ );
+ case ExpressionNodeType_default.LITERAL_COLOR:
+ args = left;
+ if (value === "color") {
+ if (!defined_default(args)) {
+ return "vec4(1.0)";
+ } else if (args.length > 1) {
+ const rgb = args[0];
+ const alpha = args[1];
+ if (alpha !== "1.0") {
+ shaderState.translucent = true;
+ }
+ return `vec4(${rgb}, ${alpha})`;
+ }
+ return `vec4(${args[0]}, 1.0)`;
+ } else if (value === "rgb") {
+ color = convertRGBToColor(this);
+ if (defined_default(color)) {
+ return colorToVec4(color);
+ }
+ return `vec4(${args[0]} / 255.0, ${args[1]} / 255.0, ${args[2]} / 255.0, 1.0)`;
+ } else if (value === "rgba") {
+ if (args[3] !== "1.0") {
+ shaderState.translucent = true;
+ }
+ color = convertRGBToColor(this);
+ if (defined_default(color)) {
+ return colorToVec4(color);
+ }
+ return `vec4(${args[0]} / 255.0, ${args[1]} / 255.0, ${args[2]} / 255.0, ${args[3]})`;
+ } else if (value === "hsl") {
+ color = convertHSLToRGB(this);
+ if (defined_default(color)) {
+ return colorToVec4(color);
+ }
+ return `vec4(czm_HSLToRGB(vec3(${args[0]}, ${args[1]}, ${args[2]})), 1.0)`;
+ } else if (value === "hsla") {
+ color = convertHSLToRGB(this);
+ if (defined_default(color)) {
+ if (color.alpha !== 1) {
+ shaderState.translucent = true;
+ }
+ return colorToVec4(color);
+ }
+ if (args[3] !== "1.0") {
+ shaderState.translucent = true;
+ }
+ return `vec4(czm_HSLToRGB(vec3(${args[0]}, ${args[1]}, ${args[2]})), ${args[3]})`;
+ }
+ break;
+ case ExpressionNodeType_default.LITERAL_VECTOR:
+ if (!defined_default(left)) {
+ throw new DeveloperError_default(
+ "left should always be defined for type ExpressionNodeType.LITERAL_VECTOR"
+ );
+ }
+ length3 = left.length;
+ vectorExpression = `${value}(`;
+ for (let i = 0; i < length3; ++i) {
+ vectorExpression += left[i];
+ if (i < length3 - 1) {
+ vectorExpression += ", ";
+ }
+ }
+ vectorExpression += ")";
+ return vectorExpression;
+ case ExpressionNodeType_default.LITERAL_REGEX:
+ throw new RuntimeError_default(
+ "Error generating style shader: Regular expressions are not supported."
+ );
+ case ExpressionNodeType_default.LITERAL_UNDEFINED:
+ return Expression.NULL_SENTINEL;
+ case ExpressionNodeType_default.BUILTIN_VARIABLE:
+ if (value === "tiles3d_tileset_time") {
+ return value;
+ }
+ }
+};
+Node2.prototype.getVariables = function(variables, parent) {
+ let array;
+ let length3;
+ let i;
+ const type = this._type;
+ const value = this._value;
+ if (defined_default(this._left)) {
+ if (Array.isArray(this._left)) {
+ array = this._left;
+ length3 = array.length;
+ for (i = 0; i < length3; ++i) {
+ array[i].getVariables(variables, this);
+ }
+ } else {
+ this._left.getVariables(variables, this);
+ }
+ }
+ if (defined_default(this._right)) {
+ this._right.getVariables(variables, this);
+ }
+ if (defined_default(this._test)) {
+ this._test.getVariables(variables, this);
+ }
+ if (Array.isArray(this._value)) {
+ array = this._value;
+ length3 = array.length;
+ for (i = 0; i < length3; ++i) {
+ array[i].getVariables(variables, this);
+ }
+ }
+ let match;
+ switch (type) {
+ case ExpressionNodeType_default.VARIABLE:
+ if (!checkFeature(this)) {
+ variables.push(value);
+ }
+ break;
+ case ExpressionNodeType_default.VARIABLE_IN_STRING:
+ match = variableRegex.exec(value);
+ while (match !== null) {
+ variables.push(match[1]);
+ match = variableRegex.exec(value);
+ }
+ break;
+ case ExpressionNodeType_default.LITERAL_STRING:
+ if (defined_default(parent) && parent._type === ExpressionNodeType_default.MEMBER && checkFeature(parent._left)) {
+ variables.push(value);
+ }
+ break;
+ }
+};
+var Expression_default = Expression;
+
+// Source/Scene/Vector3DTilePrimitive.js
+function Vector3DTilePrimitive(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._batchTable = options.batchTable;
+ this._batchIds = options.batchIds;
+ this._positions = options.positions;
+ this._vertexBatchIds = options.vertexBatchIds;
+ this._indices = options.indices;
+ this._indexCounts = options.indexCounts;
+ this._indexOffsets = options.indexOffsets;
+ this._batchedIndices = options.batchedIndices;
+ this._boundingVolume = options.boundingVolume;
+ this._boundingVolumes = options.boundingVolumes;
+ this._center = defaultValue_default(options.center, Cartesian3_default.ZERO);
+ this._va = void 0;
+ this._sp = void 0;
+ this._spStencil = void 0;
+ this._spPick = void 0;
+ this._uniformMap = void 0;
+ this._vaSwap = void 0;
+ this._rsStencilDepthPass = void 0;
+ this._rsStencilDepthPass3DTiles = void 0;
+ this._rsColorPass = void 0;
+ this._rsPickPass = void 0;
+ this._rsWireframe = void 0;
+ this._commands = [];
+ this._commandsIgnoreShow = [];
+ this._pickCommands = [];
+ this._constantColor = Color_default.clone(Color_default.WHITE);
+ this._highlightColor = this._constantColor;
+ this._batchDirty = true;
+ this._pickCommandsDirty = true;
+ this._framesSinceLastRebatch = 0;
+ this._updatingAllCommands = false;
+ this._trianglesLength = this._indices.length / 3;
+ this._geometryByteLength = this._indices.byteLength + this._positions.byteLength + this._vertexBatchIds.byteLength;
+ this.debugWireframe = false;
+ this._debugWireframe = this.debugWireframe;
+ this._wireframeDirty = false;
+ this.forceRebatch = false;
+ this.classificationType = defaultValue_default(
+ options.classificationType,
+ ClassificationType_default.BOTH
+ );
+ this._vertexShaderSource = options._vertexShaderSource;
+ this._fragmentShaderSource = options._fragmentShaderSource;
+ this._attributeLocations = options._attributeLocations;
+ this._uniformMap = options._uniformMap;
+ this._pickId = options._pickId;
+ this._modelMatrix = options._modelMatrix;
+ this._boundingSphere = options._boundingSphere;
+ this._batchIdLookUp = {};
+ const length3 = this._batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = this._batchIds[i];
+ this._batchIdLookUp[batchId] = i;
+ }
+}
+Object.defineProperties(Vector3DTilePrimitive.prototype, {
+ trianglesLength: {
+ get: function() {
+ return this._trianglesLength;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ return this._geometryByteLength;
+ }
+ }
+});
+var defaultAttributeLocations = {
+ position: 0,
+ a_batchId: 1
+};
+function createVertexArray3(primitive, context) {
+ if (defined_default(primitive._va)) {
+ return;
+ }
+ const positionBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: primitive._positions,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const idBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: primitive._vertexBatchIds,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const indexBuffer = Buffer_default.createIndexBuffer({
+ context,
+ typedArray: primitive._indices,
+ usage: BufferUsage_default.DYNAMIC_DRAW,
+ indexDatatype: primitive._indices.BYTES_PER_ELEMENT === 2 ? IndexDatatype_default.UNSIGNED_SHORT : IndexDatatype_default.UNSIGNED_INT
+ });
+ const vertexAttributes = [
+ {
+ index: 0,
+ vertexBuffer: positionBuffer,
+ componentDatatype: ComponentDatatype_default.fromTypedArray(primitive._positions),
+ componentsPerAttribute: 3
+ },
+ {
+ index: 1,
+ vertexBuffer: idBuffer,
+ componentDatatype: ComponentDatatype_default.fromTypedArray(
+ primitive._vertexBatchIds
+ ),
+ componentsPerAttribute: 1
+ }
+ ];
+ primitive._va = new VertexArray_default({
+ context,
+ attributes: vertexAttributes,
+ indexBuffer
+ });
+ if (context.webgl2) {
+ primitive._vaSwap = new VertexArray_default({
+ context,
+ attributes: vertexAttributes,
+ indexBuffer: Buffer_default.createIndexBuffer({
+ context,
+ sizeInBytes: indexBuffer.sizeInBytes,
+ usage: BufferUsage_default.DYNAMIC_DRAW,
+ indexDatatype: indexBuffer.indexDatatype
+ })
+ });
+ }
+ primitive._batchedPositions = void 0;
+ primitive._transferrableBatchIds = void 0;
+ primitive._vertexBatchIds = void 0;
+ primitive._verticesPromise = void 0;
+}
+function createShaders(primitive, context) {
+ if (defined_default(primitive._sp)) {
+ return;
+ }
+ const batchTable = primitive._batchTable;
+ const attributeLocations8 = defaultValue_default(
+ primitive._attributeLocations,
+ defaultAttributeLocations
+ );
+ let pickId = primitive._pickId;
+ const vertexShaderSource = primitive._vertexShaderSource;
+ let fragmentShaderSource = primitive._fragmentShaderSource;
+ if (defined_default(vertexShaderSource)) {
+ primitive._sp = ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource,
+ fragmentShaderSource,
+ attributeLocations: attributeLocations8
+ });
+ primitive._spStencil = primitive._sp;
+ fragmentShaderSource = ShaderSource_default.replaceMain(
+ fragmentShaderSource,
+ "czm_non_pick_main"
+ );
+ fragmentShaderSource = `${fragmentShaderSource}void main()
+{
+ czm_non_pick_main();
+ gl_FragColor = ${pickId};
+}
+`;
+ primitive._spPick = ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource,
+ fragmentShaderSource,
+ attributeLocations: attributeLocations8
+ });
+ return;
+ }
+ const vsSource = batchTable.getVertexShaderCallback(
+ false,
+ "a_batchId",
+ void 0
+ )(VectorTileVS_default);
+ let fsSource = batchTable.getFragmentShaderCallback(
+ false,
+ void 0,
+ true
+ )(ShadowVolumeFS_default);
+ pickId = batchTable.getPickId();
+ let vs = new ShaderSource_default({
+ sources: [vsSource]
+ });
+ let fs = new ShaderSource_default({
+ defines: ["VECTOR_TILE"],
+ sources: [fsSource]
+ });
+ primitive._sp = ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations8
+ });
+ vs = new ShaderSource_default({
+ sources: [VectorTileVS_default]
+ });
+ fs = new ShaderSource_default({
+ defines: ["VECTOR_TILE"],
+ sources: [ShadowVolumeFS_default]
+ });
+ primitive._spStencil = ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations8
+ });
+ fsSource = ShaderSource_default.replaceMain(fsSource, "czm_non_pick_main");
+ fsSource = `${fsSource}
+void main()
+{
+ czm_non_pick_main();
+ gl_FragColor = ${pickId};
+}
+`;
+ const pickVS = new ShaderSource_default({
+ sources: [vsSource]
+ });
+ const pickFS = new ShaderSource_default({
+ defines: ["VECTOR_TILE"],
+ sources: [fsSource]
+ });
+ primitive._spPick = ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource: pickVS,
+ fragmentShaderSource: pickFS,
+ attributeLocations: attributeLocations8
+ });
+}
+function getStencilDepthRenderState2(mask3DTiles) {
+ const stencilFunction = mask3DTiles ? StencilFunction_default.EQUAL : StencilFunction_default.ALWAYS;
+ return {
+ colorMask: {
+ red: false,
+ green: false,
+ blue: false,
+ alpha: false
+ },
+ stencilTest: {
+ enabled: true,
+ frontFunction: stencilFunction,
+ frontOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.DECREMENT_WRAP,
+ zPass: StencilOperation_default.KEEP
+ },
+ backFunction: stencilFunction,
+ backOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.INCREMENT_WRAP,
+ zPass: StencilOperation_default.KEEP
+ },
+ reference: StencilConstants_default.CESIUM_3D_TILE_MASK,
+ mask: StencilConstants_default.CESIUM_3D_TILE_MASK
+ },
+ stencilMask: StencilConstants_default.CLASSIFICATION_MASK,
+ depthTest: {
+ enabled: true,
+ func: DepthFunction_default.LESS_OR_EQUAL
+ },
+ depthMask: false
+ };
+}
+var colorRenderState = {
+ stencilTest: {
+ enabled: true,
+ frontFunction: StencilFunction_default.NOT_EQUAL,
+ frontOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ backFunction: StencilFunction_default.NOT_EQUAL,
+ backOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ reference: 0,
+ mask: StencilConstants_default.CLASSIFICATION_MASK
+ },
+ stencilMask: StencilConstants_default.CLASSIFICATION_MASK,
+ depthTest: {
+ enabled: false
+ },
+ depthMask: false,
+ blending: BlendingState_default.PRE_MULTIPLIED_ALPHA_BLEND
+};
+var pickRenderState2 = {
+ stencilTest: {
+ enabled: true,
+ frontFunction: StencilFunction_default.NOT_EQUAL,
+ frontOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ backFunction: StencilFunction_default.NOT_EQUAL,
+ backOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ reference: 0,
+ mask: StencilConstants_default.CLASSIFICATION_MASK
+ },
+ stencilMask: StencilConstants_default.CLASSIFICATION_MASK,
+ depthTest: {
+ enabled: false
+ },
+ depthMask: false
+};
+function createRenderStates3(primitive) {
+ if (defined_default(primitive._rsStencilDepthPass)) {
+ return;
+ }
+ primitive._rsStencilDepthPass = RenderState_default.fromCache(
+ getStencilDepthRenderState2(false)
+ );
+ primitive._rsStencilDepthPass3DTiles = RenderState_default.fromCache(
+ getStencilDepthRenderState2(true)
+ );
+ primitive._rsColorPass = RenderState_default.fromCache(colorRenderState);
+ primitive._rsPickPass = RenderState_default.fromCache(pickRenderState2);
+}
+var modifiedModelViewScratch2 = new Matrix4_default();
+var rtcScratch2 = new Cartesian3_default();
+function createUniformMap(primitive, context) {
+ if (defined_default(primitive._uniformMap)) {
+ return;
+ }
+ const uniformMap2 = {
+ u_modifiedModelViewProjection: function() {
+ const viewMatrix = context.uniformState.view;
+ const projectionMatrix = context.uniformState.projection;
+ Matrix4_default.clone(viewMatrix, modifiedModelViewScratch2);
+ Matrix4_default.multiplyByPoint(
+ modifiedModelViewScratch2,
+ primitive._center,
+ rtcScratch2
+ );
+ Matrix4_default.setTranslation(
+ modifiedModelViewScratch2,
+ rtcScratch2,
+ modifiedModelViewScratch2
+ );
+ Matrix4_default.multiply(
+ projectionMatrix,
+ modifiedModelViewScratch2,
+ modifiedModelViewScratch2
+ );
+ return modifiedModelViewScratch2;
+ },
+ u_highlightColor: function() {
+ return primitive._highlightColor;
+ }
+ };
+ primitive._uniformMap = primitive._batchTable.getUniformMapCallback()(
+ uniformMap2
+ );
+}
+function copyIndicesCPU(indices2, newIndices, currentOffset, offsets, counts, batchIds, batchIdLookUp) {
+ const sizeInBytes = indices2.constructor.BYTES_PER_ELEMENT;
+ const batchedIdsLength = batchIds.length;
+ for (let j = 0; j < batchedIdsLength; ++j) {
+ const batchedId = batchIds[j];
+ const index = batchIdLookUp[batchedId];
+ const offset2 = offsets[index];
+ const count = counts[index];
+ const subarray2 = new indices2.constructor(
+ indices2.buffer,
+ sizeInBytes * offset2,
+ count
+ );
+ newIndices.set(subarray2, currentOffset);
+ offsets[index] = currentOffset;
+ currentOffset += count;
+ }
+ return currentOffset;
+}
+function rebatchCPU(primitive, batchedIndices) {
+ const indices2 = primitive._indices;
+ const indexOffsets = primitive._indexOffsets;
+ const indexCounts = primitive._indexCounts;
+ const batchIdLookUp = primitive._batchIdLookUp;
+ const newIndices = new indices2.constructor(indices2.length);
+ let current = batchedIndices.pop();
+ const newBatchedIndices = [current];
+ let currentOffset = copyIndicesCPU(
+ indices2,
+ newIndices,
+ 0,
+ indexOffsets,
+ indexCounts,
+ current.batchIds,
+ batchIdLookUp
+ );
+ current.offset = 0;
+ current.count = currentOffset;
+ while (batchedIndices.length > 0) {
+ const next = batchedIndices.pop();
+ if (Color_default.equals(next.color, current.color)) {
+ currentOffset = copyIndicesCPU(
+ indices2,
+ newIndices,
+ currentOffset,
+ indexOffsets,
+ indexCounts,
+ next.batchIds,
+ batchIdLookUp
+ );
+ current.batchIds = current.batchIds.concat(next.batchIds);
+ current.count = currentOffset - current.offset;
+ } else {
+ const offset2 = currentOffset;
+ currentOffset = copyIndicesCPU(
+ indices2,
+ newIndices,
+ currentOffset,
+ indexOffsets,
+ indexCounts,
+ next.batchIds,
+ batchIdLookUp
+ );
+ next.offset = offset2;
+ next.count = currentOffset - offset2;
+ newBatchedIndices.push(next);
+ current = next;
+ }
+ }
+ primitive._va.indexBuffer.copyFromArrayView(newIndices);
+ primitive._indices = newIndices;
+ primitive._batchedIndices = newBatchedIndices;
+}
+function copyIndicesGPU(readBuffer, writeBuffer, currentOffset, offsets, counts, batchIds, batchIdLookUp) {
+ const sizeInBytes = readBuffer.bytesPerIndex;
+ const batchedIdsLength = batchIds.length;
+ for (let j = 0; j < batchedIdsLength; ++j) {
+ const batchedId = batchIds[j];
+ const index = batchIdLookUp[batchedId];
+ const offset2 = offsets[index];
+ const count = counts[index];
+ writeBuffer.copyFromBuffer(
+ readBuffer,
+ offset2 * sizeInBytes,
+ currentOffset * sizeInBytes,
+ count * sizeInBytes
+ );
+ offsets[index] = currentOffset;
+ currentOffset += count;
+ }
+ return currentOffset;
+}
+function rebatchGPU(primitive, batchedIndices) {
+ const indexOffsets = primitive._indexOffsets;
+ const indexCounts = primitive._indexCounts;
+ const batchIdLookUp = primitive._batchIdLookUp;
+ let current = batchedIndices.pop();
+ const newBatchedIndices = [current];
+ const readBuffer = primitive._va.indexBuffer;
+ const writeBuffer = primitive._vaSwap.indexBuffer;
+ let currentOffset = copyIndicesGPU(
+ readBuffer,
+ writeBuffer,
+ 0,
+ indexOffsets,
+ indexCounts,
+ current.batchIds,
+ batchIdLookUp
+ );
+ current.offset = 0;
+ current.count = currentOffset;
+ while (batchedIndices.length > 0) {
+ const next = batchedIndices.pop();
+ if (Color_default.equals(next.color, current.color)) {
+ currentOffset = copyIndicesGPU(
+ readBuffer,
+ writeBuffer,
+ currentOffset,
+ indexOffsets,
+ indexCounts,
+ next.batchIds,
+ batchIdLookUp
+ );
+ current.batchIds = current.batchIds.concat(next.batchIds);
+ current.count = currentOffset - current.offset;
+ } else {
+ const offset2 = currentOffset;
+ currentOffset = copyIndicesGPU(
+ readBuffer,
+ writeBuffer,
+ currentOffset,
+ indexOffsets,
+ indexCounts,
+ next.batchIds,
+ batchIdLookUp
+ );
+ next.offset = offset2;
+ next.count = currentOffset - offset2;
+ newBatchedIndices.push(next);
+ current = next;
+ }
+ }
+ const temp = primitive._va;
+ primitive._va = primitive._vaSwap;
+ primitive._vaSwap = temp;
+ primitive._batchedIndices = newBatchedIndices;
+}
+function compareColors(a3, b) {
+ return b.color.toRgba() - a3.color.toRgba();
+}
+function rebatchCommands(primitive, context) {
+ if (!primitive._batchDirty) {
+ return false;
+ }
+ const batchedIndices = primitive._batchedIndices;
+ const length3 = batchedIndices.length;
+ let needToRebatch = false;
+ const colorCounts = {};
+ for (let i = 0; i < length3; ++i) {
+ const color = batchedIndices[i].color;
+ const rgba = color.toRgba();
+ if (defined_default(colorCounts[rgba])) {
+ needToRebatch = true;
+ break;
+ } else {
+ colorCounts[rgba] = true;
+ }
+ }
+ if (!needToRebatch) {
+ primitive._batchDirty = false;
+ return false;
+ }
+ if (needToRebatch && !primitive.forceRebatch && primitive._framesSinceLastRebatch < 120) {
+ ++primitive._framesSinceLastRebatch;
+ return;
+ }
+ batchedIndices.sort(compareColors);
+ if (context.webgl2) {
+ rebatchGPU(primitive, batchedIndices);
+ } else {
+ rebatchCPU(primitive, batchedIndices);
+ }
+ primitive._framesSinceLastRebatch = 0;
+ primitive._batchDirty = false;
+ primitive._pickCommandsDirty = true;
+ primitive._wireframeDirty = true;
+ return true;
+}
+function createColorCommands2(primitive, context) {
+ const needsRebatch = rebatchCommands(primitive, context);
+ const commands = primitive._commands;
+ const batchedIndices = primitive._batchedIndices;
+ const length3 = batchedIndices.length;
+ const commandsLength = length3 * 2;
+ if (defined_default(commands) && !needsRebatch && commands.length === commandsLength) {
+ return;
+ }
+ commands.length = commandsLength;
+ const vertexArray = primitive._va;
+ const sp = primitive._sp;
+ const modelMatrix = defaultValue_default(primitive._modelMatrix, Matrix4_default.IDENTITY);
+ const uniformMap2 = primitive._uniformMap;
+ const bv = primitive._boundingVolume;
+ for (let j = 0; j < length3; ++j) {
+ const offset2 = batchedIndices[j].offset;
+ const count = batchedIndices[j].count;
+ let stencilDepthCommand = commands[j * 2];
+ if (!defined_default(stencilDepthCommand)) {
+ stencilDepthCommand = commands[j * 2] = new DrawCommand_default({
+ owner: primitive
+ });
+ }
+ stencilDepthCommand.vertexArray = vertexArray;
+ stencilDepthCommand.modelMatrix = modelMatrix;
+ stencilDepthCommand.offset = offset2;
+ stencilDepthCommand.count = count;
+ stencilDepthCommand.renderState = primitive._rsStencilDepthPass;
+ stencilDepthCommand.shaderProgram = sp;
+ stencilDepthCommand.uniformMap = uniformMap2;
+ stencilDepthCommand.boundingVolume = bv;
+ stencilDepthCommand.cull = false;
+ stencilDepthCommand.pass = Pass_default.TERRAIN_CLASSIFICATION;
+ const stencilDepthDerivedCommand = DrawCommand_default.shallowClone(
+ stencilDepthCommand,
+ stencilDepthCommand.derivedCommands.tileset
+ );
+ stencilDepthDerivedCommand.renderState = primitive._rsStencilDepthPass3DTiles;
+ stencilDepthDerivedCommand.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ stencilDepthCommand.derivedCommands.tileset = stencilDepthDerivedCommand;
+ let colorCommand = commands[j * 2 + 1];
+ if (!defined_default(colorCommand)) {
+ colorCommand = commands[j * 2 + 1] = new DrawCommand_default({
+ owner: primitive
+ });
+ }
+ colorCommand.vertexArray = vertexArray;
+ colorCommand.modelMatrix = modelMatrix;
+ colorCommand.offset = offset2;
+ colorCommand.count = count;
+ colorCommand.renderState = primitive._rsColorPass;
+ colorCommand.shaderProgram = sp;
+ colorCommand.uniformMap = uniformMap2;
+ colorCommand.boundingVolume = bv;
+ colorCommand.cull = false;
+ colorCommand.pass = Pass_default.TERRAIN_CLASSIFICATION;
+ const colorDerivedCommand = DrawCommand_default.shallowClone(
+ colorCommand,
+ colorCommand.derivedCommands.tileset
+ );
+ colorDerivedCommand.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ colorCommand.derivedCommands.tileset = colorDerivedCommand;
+ }
+ primitive._commandsDirty = true;
+}
+function createColorCommandsIgnoreShow(primitive, frameState) {
+ if (primitive.classificationType === ClassificationType_default.TERRAIN || !frameState.invertClassification || defined_default(primitive._commandsIgnoreShow) && !primitive._commandsDirty) {
+ return;
+ }
+ const commands = primitive._commands;
+ const commandsIgnoreShow = primitive._commandsIgnoreShow;
+ const spStencil = primitive._spStencil;
+ const commandsLength = commands.length;
+ const length3 = commandsIgnoreShow.length = commandsLength / 2;
+ let commandIndex = 0;
+ for (let j = 0; j < length3; ++j) {
+ const commandIgnoreShow = commandsIgnoreShow[j] = DrawCommand_default.shallowClone(
+ commands[commandIndex],
+ commandsIgnoreShow[j]
+ );
+ commandIgnoreShow.shaderProgram = spStencil;
+ commandIgnoreShow.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW;
+ commandIndex += 2;
+ }
+ primitive._commandsDirty = false;
+}
+function createPickCommands2(primitive) {
+ if (!primitive._pickCommandsDirty) {
+ return;
+ }
+ const length3 = primitive._indexOffsets.length;
+ const pickCommands = primitive._pickCommands;
+ pickCommands.length = length3 * 2;
+ const vertexArray = primitive._va;
+ const spStencil = primitive._spStencil;
+ const spPick = primitive._spPick;
+ const modelMatrix = defaultValue_default(primitive._modelMatrix, Matrix4_default.IDENTITY);
+ const uniformMap2 = primitive._uniformMap;
+ for (let j = 0; j < length3; ++j) {
+ const offset2 = primitive._indexOffsets[j];
+ const count = primitive._indexCounts[j];
+ const bv = defined_default(primitive._boundingVolumes) ? primitive._boundingVolumes[j] : primitive.boundingVolume;
+ let stencilDepthCommand = pickCommands[j * 2];
+ if (!defined_default(stencilDepthCommand)) {
+ stencilDepthCommand = pickCommands[j * 2] = new DrawCommand_default({
+ owner: primitive,
+ pickOnly: true
+ });
+ }
+ stencilDepthCommand.vertexArray = vertexArray;
+ stencilDepthCommand.modelMatrix = modelMatrix;
+ stencilDepthCommand.offset = offset2;
+ stencilDepthCommand.count = count;
+ stencilDepthCommand.renderState = primitive._rsStencilDepthPass;
+ stencilDepthCommand.shaderProgram = spStencil;
+ stencilDepthCommand.uniformMap = uniformMap2;
+ stencilDepthCommand.boundingVolume = bv;
+ stencilDepthCommand.pass = Pass_default.TERRAIN_CLASSIFICATION;
+ const stencilDepthDerivedCommand = DrawCommand_default.shallowClone(
+ stencilDepthCommand,
+ stencilDepthCommand.derivedCommands.tileset
+ );
+ stencilDepthDerivedCommand.renderState = primitive._rsStencilDepthPass3DTiles;
+ stencilDepthDerivedCommand.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ stencilDepthCommand.derivedCommands.tileset = stencilDepthDerivedCommand;
+ let colorCommand = pickCommands[j * 2 + 1];
+ if (!defined_default(colorCommand)) {
+ colorCommand = pickCommands[j * 2 + 1] = new DrawCommand_default({
+ owner: primitive,
+ pickOnly: true
+ });
+ }
+ colorCommand.vertexArray = vertexArray;
+ colorCommand.modelMatrix = modelMatrix;
+ colorCommand.offset = offset2;
+ colorCommand.count = count;
+ colorCommand.renderState = primitive._rsPickPass;
+ colorCommand.shaderProgram = spPick;
+ colorCommand.uniformMap = uniformMap2;
+ colorCommand.boundingVolume = bv;
+ colorCommand.pass = Pass_default.TERRAIN_CLASSIFICATION;
+ const colorDerivedCommand = DrawCommand_default.shallowClone(
+ colorCommand,
+ colorCommand.derivedCommands.tileset
+ );
+ colorDerivedCommand.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ colorCommand.derivedCommands.tileset = colorDerivedCommand;
+ }
+ primitive._pickCommandsDirty = false;
+}
+Vector3DTilePrimitive.prototype.createFeatures = function(content, features) {
+ const batchIds = this._batchIds;
+ const length3 = batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ features[batchId] = new Cesium3DTileFeature_default(content, batchId);
+ }
+};
+Vector3DTilePrimitive.prototype.applyDebugSettings = function(enabled, color) {
+ this._highlightColor = enabled ? color : this._constantColor;
+};
+function clearStyle(polygons, features) {
+ polygons._updatingAllCommands = true;
+ const batchIds = polygons._batchIds;
+ let length3 = batchIds.length;
+ let i;
+ for (i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ const feature2 = features[batchId];
+ feature2.show = true;
+ feature2.color = Color_default.WHITE;
+ }
+ const batchedIndices = polygons._batchedIndices;
+ length3 = batchedIndices.length;
+ for (i = 0; i < length3; ++i) {
+ batchedIndices[i].color = Color_default.clone(Color_default.WHITE);
+ }
+ polygons._updatingAllCommands = false;
+ polygons._batchDirty = true;
+}
+var scratchColor4 = new Color_default();
+var DEFAULT_COLOR_VALUE2 = Color_default.WHITE;
+var DEFAULT_SHOW_VALUE2 = true;
+var complexExpressionReg = /\$/;
+Vector3DTilePrimitive.prototype.applyStyle = function(style, features) {
+ if (!defined_default(style)) {
+ clearStyle(this, features);
+ return;
+ }
+ const colorExpression = style.color;
+ const isSimpleStyle = colorExpression instanceof Expression_default && !complexExpressionReg.test(colorExpression.expression);
+ this._updatingAllCommands = isSimpleStyle;
+ const batchIds = this._batchIds;
+ let length3 = batchIds.length;
+ let i;
+ for (i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ const feature2 = features[batchId];
+ feature2.color = defined_default(style.color) ? style.color.evaluateColor(feature2, scratchColor4) : DEFAULT_COLOR_VALUE2;
+ feature2.show = defined_default(style.show) ? style.show.evaluate(feature2) : DEFAULT_SHOW_VALUE2;
+ }
+ if (isSimpleStyle) {
+ const batchedIndices = this._batchedIndices;
+ length3 = batchedIndices.length;
+ for (i = 0; i < length3; ++i) {
+ batchedIndices[i].color = Color_default.clone(Color_default.WHITE);
+ }
+ this._updatingAllCommands = false;
+ this._batchDirty = true;
+ }
+};
+Vector3DTilePrimitive.prototype.updateCommands = function(batchId, color) {
+ if (this._updatingAllCommands) {
+ return;
+ }
+ const batchIdLookUp = this._batchIdLookUp;
+ const index = batchIdLookUp[batchId];
+ if (!defined_default(index)) {
+ return;
+ }
+ const indexOffsets = this._indexOffsets;
+ const indexCounts = this._indexCounts;
+ const offset2 = indexOffsets[index];
+ const count = indexCounts[index];
+ const batchedIndices = this._batchedIndices;
+ const length3 = batchedIndices.length;
+ let i;
+ for (i = 0; i < length3; ++i) {
+ const batchedOffset = batchedIndices[i].offset;
+ const batchedCount = batchedIndices[i].count;
+ if (offset2 >= batchedOffset && offset2 < batchedOffset + batchedCount) {
+ break;
+ }
+ }
+ batchedIndices.push(
+ new Vector3DTileBatch_default({
+ color: Color_default.clone(color),
+ offset: offset2,
+ count,
+ batchIds: [batchId]
+ })
+ );
+ const startIds = [];
+ const endIds = [];
+ const batchIds = batchedIndices[i].batchIds;
+ const batchIdsLength = batchIds.length;
+ for (let j = 0; j < batchIdsLength; ++j) {
+ const id = batchIds[j];
+ if (id === batchId) {
+ continue;
+ }
+ const offsetIndex = batchIdLookUp[id];
+ if (indexOffsets[offsetIndex] < offset2) {
+ startIds.push(id);
+ } else {
+ endIds.push(id);
+ }
+ }
+ if (endIds.length !== 0) {
+ batchedIndices.push(
+ new Vector3DTileBatch_default({
+ color: Color_default.clone(batchedIndices[i].color),
+ offset: offset2 + count,
+ count: batchedIndices[i].offset + batchedIndices[i].count - (offset2 + count),
+ batchIds: endIds
+ })
+ );
+ }
+ if (startIds.length !== 0) {
+ batchedIndices[i].count = offset2 - batchedIndices[i].offset;
+ batchedIndices[i].batchIds = startIds;
+ } else {
+ batchedIndices.splice(i, 1);
+ }
+ this._batchDirty = true;
+};
+function queueCommands(primitive, frameState, commands, commandsIgnoreShow) {
+ const classificationType = primitive.classificationType;
+ const queueTerrainCommands = classificationType !== ClassificationType_default.CESIUM_3D_TILE;
+ const queue3DTilesCommands = classificationType !== ClassificationType_default.TERRAIN;
+ const commandList = frameState.commandList;
+ let commandLength = commands.length;
+ let command;
+ let i;
+ for (i = 0; i < commandLength; ++i) {
+ if (queueTerrainCommands) {
+ command = commands[i];
+ command.pass = Pass_default.TERRAIN_CLASSIFICATION;
+ commandList.push(command);
+ }
+ if (queue3DTilesCommands) {
+ command = commands[i].derivedCommands.tileset;
+ command.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ commandList.push(command);
+ }
+ }
+ if (!frameState.invertClassification || !defined_default(commandsIgnoreShow)) {
+ return;
+ }
+ commandLength = commandsIgnoreShow.length;
+ for (i = 0; i < commandLength; ++i) {
+ commandList.push(commandsIgnoreShow[i]);
+ }
+}
+function queueWireframeCommands(frameState, commands) {
+ const commandList = frameState.commandList;
+ const commandLength = commands.length;
+ for (let i = 0; i < commandLength; i += 2) {
+ const command = commands[i + 1];
+ command.pass = Pass_default.OPAQUE;
+ commandList.push(command);
+ }
+}
+function updateWireframe(primitive) {
+ let earlyExit = primitive.debugWireframe === primitive._debugWireframe;
+ earlyExit = earlyExit && !(primitive.debugWireframe && primitive._wireframeDirty);
+ if (earlyExit) {
+ return;
+ }
+ if (!defined_default(primitive._rsWireframe)) {
+ primitive._rsWireframe = RenderState_default.fromCache({});
+ }
+ let rs;
+ let type;
+ if (primitive.debugWireframe) {
+ rs = primitive._rsWireframe;
+ type = PrimitiveType_default.LINES;
+ } else {
+ rs = primitive._rsColorPass;
+ type = PrimitiveType_default.TRIANGLES;
+ }
+ const commands = primitive._commands;
+ const commandLength = commands.length;
+ for (let i = 0; i < commandLength; i += 2) {
+ const command = commands[i + 1];
+ command.renderState = rs;
+ command.primitiveType = type;
+ }
+ primitive._debugWireframe = primitive.debugWireframe;
+ primitive._wireframeDirty = false;
+}
+Vector3DTilePrimitive.prototype.update = function(frameState) {
+ const context = frameState.context;
+ createVertexArray3(this, context);
+ createShaders(this, context);
+ createRenderStates3(this);
+ createUniformMap(this, context);
+ const passes = frameState.passes;
+ if (passes.render) {
+ createColorCommands2(this, context);
+ createColorCommandsIgnoreShow(this, frameState);
+ updateWireframe(this);
+ if (this._debugWireframe) {
+ queueWireframeCommands(frameState, this._commands);
+ } else {
+ queueCommands(this, frameState, this._commands, this._commandsIgnoreShow);
+ }
+ }
+ if (passes.pick) {
+ createPickCommands2(this);
+ queueCommands(this, frameState, this._pickCommands);
+ }
+};
+Vector3DTilePrimitive.prototype.isDestroyed = function() {
+ return false;
+};
+Vector3DTilePrimitive.prototype.destroy = function() {
+ this._va = this._va && this._va.destroy();
+ this._sp = this._sp && this._sp.destroy();
+ this._spPick = this._spPick && this._spPick.destroy();
+ this._vaSwap = this._vaSwap && this._vaSwap.destroy();
+ return destroyObject_default(this);
+};
+var Vector3DTilePrimitive_default = Vector3DTilePrimitive;
+
+// Source/Scene/Vector3DTileGeometry.js
+function Vector3DTileGeometry(options) {
+ this._boxes = options.boxes;
+ this._boxBatchIds = options.boxBatchIds;
+ this._cylinders = options.cylinders;
+ this._cylinderBatchIds = options.cylinderBatchIds;
+ this._ellipsoids = options.ellipsoids;
+ this._ellipsoidBatchIds = options.ellipsoidBatchIds;
+ this._spheres = options.spheres;
+ this._sphereBatchIds = options.sphereBatchIds;
+ this._modelMatrix = options.modelMatrix;
+ this._batchTable = options.batchTable;
+ this._boundingVolume = options.boundingVolume;
+ this._center = options.center;
+ if (!defined_default(this._center)) {
+ if (defined_default(this._boundingVolume)) {
+ this._center = Cartesian3_default.clone(this._boundingVolume.center);
+ } else {
+ this._center = Cartesian3_default.clone(Cartesian3_default.ZERO);
+ }
+ }
+ this._boundingVolumes = void 0;
+ this._batchedIndices = void 0;
+ this._indices = void 0;
+ this._indexOffsets = void 0;
+ this._indexCounts = void 0;
+ this._positions = void 0;
+ this._vertexBatchIds = void 0;
+ this._batchIds = void 0;
+ this._batchTableColors = void 0;
+ this._packedBuffer = void 0;
+ this._ready = false;
+ this._update = function(geometries, frameState) {
+ };
+ this._readyPromise = initialize5(this);
+ this._verticesPromise = void 0;
+ this._primitive = void 0;
+ this.debugWireframe = false;
+ this.forceRebatch = false;
+ this.classificationType = ClassificationType_default.BOTH;
+}
+Object.defineProperties(Vector3DTileGeometry.prototype, {
+ trianglesLength: {
+ get: function() {
+ if (defined_default(this._primitive)) {
+ return this._primitive.trianglesLength;
+ }
+ return 0;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ if (defined_default(this._primitive)) {
+ return this._primitive.geometryByteLength;
+ }
+ return 0;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ }
+});
+Vector3DTileGeometry.packedBoxLength = Matrix4_default.packedLength + Cartesian3_default.packedLength;
+Vector3DTileGeometry.packedCylinderLength = Matrix4_default.packedLength + 2;
+Vector3DTileGeometry.packedEllipsoidLength = Matrix4_default.packedLength + Cartesian3_default.packedLength;
+Vector3DTileGeometry.packedSphereLength = Cartesian3_default.packedLength + 1;
+function packBuffer(geometries) {
+ const packedBuffer = new Float64Array(
+ Matrix4_default.packedLength + Cartesian3_default.packedLength
+ );
+ let offset2 = 0;
+ Cartesian3_default.pack(geometries._center, packedBuffer, offset2);
+ offset2 += Cartesian3_default.packedLength;
+ Matrix4_default.pack(geometries._modelMatrix, packedBuffer, offset2);
+ return packedBuffer;
+}
+function unpackBuffer(geometries, packedBuffer) {
+ let offset2 = 0;
+ const indicesBytesPerElement = packedBuffer[offset2++];
+ const numBVS = packedBuffer[offset2++];
+ const bvs = geometries._boundingVolumes = new Array(numBVS);
+ for (let i = 0; i < numBVS; ++i) {
+ bvs[i] = BoundingSphere_default.unpack(packedBuffer, offset2);
+ offset2 += BoundingSphere_default.packedLength;
+ }
+ const numBatchedIndices = packedBuffer[offset2++];
+ const bis = geometries._batchedIndices = new Array(numBatchedIndices);
+ for (let j = 0; j < numBatchedIndices; ++j) {
+ const color = Color_default.unpack(packedBuffer, offset2);
+ offset2 += Color_default.packedLength;
+ const indexOffset = packedBuffer[offset2++];
+ const count = packedBuffer[offset2++];
+ const length3 = packedBuffer[offset2++];
+ const batchIds = new Array(length3);
+ for (let k = 0; k < length3; ++k) {
+ batchIds[k] = packedBuffer[offset2++];
+ }
+ bis[j] = new Vector3DTileBatch_default({
+ color,
+ offset: indexOffset,
+ count,
+ batchIds
+ });
+ }
+ return indicesBytesPerElement;
+}
+var createVerticesTaskProcessor = new TaskProcessor_default(
+ "createVectorTileGeometries",
+ 5
+);
+var scratchColor5 = new Color_default();
+function createPrimitive(geometries) {
+ if (defined_default(geometries._primitive)) {
+ return;
+ }
+ if (!defined_default(geometries._verticesPromise)) {
+ let boxes = geometries._boxes;
+ let boxBatchIds = geometries._boxBatchIds;
+ let cylinders = geometries._cylinders;
+ let cylinderBatchIds = geometries._cylinderBatchIds;
+ let ellipsoids = geometries._ellipsoids;
+ let ellipsoidBatchIds = geometries._ellipsoidBatchIds;
+ let spheres = geometries._spheres;
+ let sphereBatchIds = geometries._sphereBatchIds;
+ let batchTableColors = geometries._batchTableColors;
+ let packedBuffer = geometries._packedBuffer;
+ if (!defined_default(batchTableColors)) {
+ let length3 = 0;
+ if (defined_default(geometries._boxes)) {
+ boxes = geometries._boxes = boxes.slice();
+ boxBatchIds = geometries._boxBatchIds = boxBatchIds.slice();
+ length3 += boxBatchIds.length;
+ }
+ if (defined_default(geometries._cylinders)) {
+ cylinders = geometries._cylinders = cylinders.slice();
+ cylinderBatchIds = geometries._cylinderBatchIds = cylinderBatchIds.slice();
+ length3 += cylinderBatchIds.length;
+ }
+ if (defined_default(geometries._ellipsoids)) {
+ ellipsoids = geometries._ellipsoids = ellipsoids.slice();
+ ellipsoidBatchIds = geometries._ellipsoidBatchIds = ellipsoidBatchIds.slice();
+ length3 += ellipsoidBatchIds.length;
+ }
+ if (defined_default(geometries._spheres)) {
+ spheres = geometries._sphere = spheres.slice();
+ sphereBatchIds = geometries._sphereBatchIds = sphereBatchIds.slice();
+ length3 += sphereBatchIds.length;
+ }
+ batchTableColors = geometries._batchTableColors = new Uint32Array(length3);
+ const batchTable = geometries._batchTable;
+ for (let i = 0; i < length3; ++i) {
+ const color = batchTable.getColor(i, scratchColor5);
+ batchTableColors[i] = color.toRgba();
+ }
+ packedBuffer = geometries._packedBuffer = packBuffer(geometries);
+ }
+ const transferrableObjects = [];
+ if (defined_default(boxes)) {
+ transferrableObjects.push(boxes.buffer, boxBatchIds.buffer);
+ }
+ if (defined_default(cylinders)) {
+ transferrableObjects.push(cylinders.buffer, cylinderBatchIds.buffer);
+ }
+ if (defined_default(ellipsoids)) {
+ transferrableObjects.push(ellipsoids.buffer, ellipsoidBatchIds.buffer);
+ }
+ if (defined_default(spheres)) {
+ transferrableObjects.push(spheres.buffer, sphereBatchIds.buffer);
+ }
+ transferrableObjects.push(batchTableColors.buffer, packedBuffer.buffer);
+ const parameters = {
+ boxes: defined_default(boxes) ? boxes.buffer : void 0,
+ boxBatchIds: defined_default(boxes) ? boxBatchIds.buffer : void 0,
+ cylinders: defined_default(cylinders) ? cylinders.buffer : void 0,
+ cylinderBatchIds: defined_default(cylinders) ? cylinderBatchIds.buffer : void 0,
+ ellipsoids: defined_default(ellipsoids) ? ellipsoids.buffer : void 0,
+ ellipsoidBatchIds: defined_default(ellipsoids) ? ellipsoidBatchIds.buffer : void 0,
+ spheres: defined_default(spheres) ? spheres.buffer : void 0,
+ sphereBatchIds: defined_default(spheres) ? sphereBatchIds.buffer : void 0,
+ batchTableColors: batchTableColors.buffer,
+ packedBuffer: packedBuffer.buffer
+ };
+ const verticesPromise = geometries._verticesPromise = createVerticesTaskProcessor.scheduleTask(
+ parameters,
+ transferrableObjects
+ );
+ if (!defined_default(verticesPromise)) {
+ return;
+ }
+ return verticesPromise.then(function(result) {
+ const packedBuffer2 = new Float64Array(result.packedBuffer);
+ const indicesBytesPerElement = unpackBuffer(geometries, packedBuffer2);
+ if (indicesBytesPerElement === 2) {
+ geometries._indices = new Uint16Array(result.indices);
+ } else {
+ geometries._indices = new Uint32Array(result.indices);
+ }
+ geometries._indexOffsets = new Uint32Array(result.indexOffsets);
+ geometries._indexCounts = new Uint32Array(result.indexCounts);
+ geometries._positions = new Float32Array(result.positions);
+ geometries._vertexBatchIds = new Uint16Array(result.vertexBatchIds);
+ geometries._batchIds = new Uint16Array(result.batchIds);
+ geometries._ready = true;
+ });
+ }
+}
+function finishPrimitive(geometries) {
+ if (geometries._ready && !defined_default(geometries._primitive)) {
+ geometries._primitive = new Vector3DTilePrimitive_default({
+ batchTable: geometries._batchTable,
+ positions: geometries._positions,
+ batchIds: geometries._batchIds,
+ vertexBatchIds: geometries._vertexBatchIds,
+ indices: geometries._indices,
+ indexOffsets: geometries._indexOffsets,
+ indexCounts: geometries._indexCounts,
+ batchedIndices: geometries._batchedIndices,
+ boundingVolume: geometries._boundingVolume,
+ boundingVolumes: geometries._boundingVolumes,
+ center: geometries._center,
+ pickObject: defaultValue_default(geometries._pickObject, geometries)
+ });
+ geometries._boxes = void 0;
+ geometries._boxBatchIds = void 0;
+ geometries._cylinders = void 0;
+ geometries._cylinderBatchIds = void 0;
+ geometries._ellipsoids = void 0;
+ geometries._ellipsoidBatchIds = void 0;
+ geometries._spheres = void 0;
+ geometries._sphereBatchIds = void 0;
+ geometries._center = void 0;
+ geometries._modelMatrix = void 0;
+ geometries._batchTable = void 0;
+ geometries._boundingVolume = void 0;
+ geometries._boundingVolumes = void 0;
+ geometries._batchedIndices = void 0;
+ geometries._indices = void 0;
+ geometries._indexOffsets = void 0;
+ geometries._indexCounts = void 0;
+ geometries._positions = void 0;
+ geometries._vertexBatchIds = void 0;
+ geometries._batchIds = void 0;
+ geometries._batchTableColors = void 0;
+ geometries._packedBuffer = void 0;
+ geometries._verticesPromise = void 0;
+ }
+}
+Vector3DTileGeometry.prototype.createFeatures = function(content, features) {
+ this._primitive.createFeatures(content, features);
+};
+Vector3DTileGeometry.prototype.applyDebugSettings = function(enabled, color) {
+ this._primitive.applyDebugSettings(enabled, color);
+};
+Vector3DTileGeometry.prototype.applyStyle = function(style, features) {
+ this._primitive.applyStyle(style, features);
+};
+Vector3DTileGeometry.prototype.updateCommands = function(batchId, color) {
+ this._primitive.updateCommands(batchId, color);
+};
+function initialize5(geometries) {
+ return new Promise(function(resolve2, reject) {
+ geometries._update = function(geometries2, frameState) {
+ const promise = createPrimitive(geometries2);
+ if (geometries2._ready) {
+ geometries2._primitive.debugWireframe = geometries2.debugWireframe;
+ geometries2._primitive.forceRebatch = geometries2.forceRebatch;
+ geometries2._primitive.classificationType = geometries2.classificationType;
+ geometries2._primitive.update(frameState);
+ }
+ if (!defined_default(promise)) {
+ return;
+ }
+ promise.then(function() {
+ finishPrimitive(geometries2);
+ resolve2(geometries2);
+ }).catch(function(e) {
+ reject(e);
+ });
+ };
+ });
+}
+Vector3DTileGeometry.prototype.update = function(frameState) {
+ this._update(this, frameState);
+};
+Vector3DTileGeometry.prototype.isDestroyed = function() {
+ return false;
+};
+Vector3DTileGeometry.prototype.destroy = function() {
+ this._primitive = this._primitive && this._primitive.destroy();
+ return destroyObject_default(this);
+};
+var Vector3DTileGeometry_default = Vector3DTileGeometry;
+
+// Source/Scene/Geometry3DTileContent.js
+function Geometry3DTileContent(tileset, tile, resource, arrayBuffer, byteOffset) {
+ this._tileset = tileset;
+ this._tile = tile;
+ this._resource = resource;
+ this._geometries = void 0;
+ this._metadata = void 0;
+ this._batchTable = void 0;
+ this._features = void 0;
+ this.featurePropertiesDirty = false;
+ this._group = void 0;
+ this._readyPromise = initialize6(this, arrayBuffer, byteOffset);
+}
+Object.defineProperties(Geometry3DTileContent.prototype, {
+ featuresLength: {
+ get: function() {
+ return defined_default(this._batchTable) ? this._batchTable.featuresLength : 0;
+ }
+ },
+ pointsLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ trianglesLength: {
+ get: function() {
+ if (defined_default(this._geometries)) {
+ return this._geometries.trianglesLength;
+ }
+ return 0;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ if (defined_default(this._geometries)) {
+ return this._geometries.geometryByteLength;
+ }
+ return 0;
+ }
+ },
+ texturesByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ batchTableByteLength: {
+ get: function() {
+ return defined_default(this._batchTable) ? this._batchTable.batchTableByteLength : 0;
+ }
+ },
+ innerContents: {
+ get: function() {
+ return void 0;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._tileset;
+ }
+ },
+ tile: {
+ get: function() {
+ return this._tile;
+ }
+ },
+ url: {
+ get: function() {
+ return this._resource.getUrlComponent(true);
+ }
+ },
+ metadata: {
+ get: function() {
+ return this._metadata;
+ },
+ set: function(value) {
+ this._metadata = value;
+ }
+ },
+ batchTable: {
+ get: function() {
+ return this._batchTable;
+ }
+ },
+ group: {
+ get: function() {
+ return this._group;
+ },
+ set: function(value) {
+ this._group = value;
+ }
+ }
+});
+function createColorChangedCallback(content) {
+ return function(batchId, color) {
+ if (defined_default(content._geometries)) {
+ content._geometries.updateCommands(batchId, color);
+ }
+ };
+}
+function getBatchIds(featureTableJson, featureTableBinary) {
+ let boxBatchIds;
+ let cylinderBatchIds;
+ let ellipsoidBatchIds;
+ let sphereBatchIds;
+ let i;
+ const numberOfBoxes = defaultValue_default(featureTableJson.BOXES_LENGTH, 0);
+ const numberOfCylinders = defaultValue_default(featureTableJson.CYLINDERS_LENGTH, 0);
+ const numberOfEllipsoids = defaultValue_default(
+ featureTableJson.ELLIPSOIDS_LENGTH,
+ 0
+ );
+ const numberOfSpheres = defaultValue_default(featureTableJson.SPHERES_LENGTH, 0);
+ if (numberOfBoxes > 0 && defined_default(featureTableJson.BOX_BATCH_IDS)) {
+ const boxBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.BOX_BATCH_IDS.byteOffset;
+ boxBatchIds = new Uint16Array(
+ featureTableBinary.buffer,
+ boxBatchIdsByteOffset,
+ numberOfBoxes
+ );
+ }
+ if (numberOfCylinders > 0 && defined_default(featureTableJson.CYLINDER_BATCH_IDS)) {
+ const cylinderBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.CYLINDER_BATCH_IDS.byteOffset;
+ cylinderBatchIds = new Uint16Array(
+ featureTableBinary.buffer,
+ cylinderBatchIdsByteOffset,
+ numberOfCylinders
+ );
+ }
+ if (numberOfEllipsoids > 0 && defined_default(featureTableJson.ELLIPSOID_BATCH_IDS)) {
+ const ellipsoidBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.ELLIPSOID_BATCH_IDS.byteOffset;
+ ellipsoidBatchIds = new Uint16Array(
+ featureTableBinary.buffer,
+ ellipsoidBatchIdsByteOffset,
+ numberOfEllipsoids
+ );
+ }
+ if (numberOfSpheres > 0 && defined_default(featureTableJson.SPHERE_BATCH_IDS)) {
+ const sphereBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.SPHERE_BATCH_IDS.byteOffset;
+ sphereBatchIds = new Uint16Array(
+ featureTableBinary.buffer,
+ sphereBatchIdsByteOffset,
+ numberOfSpheres
+ );
+ }
+ const atLeastOneDefined = defined_default(boxBatchIds) || defined_default(cylinderBatchIds) || defined_default(ellipsoidBatchIds) || defined_default(sphereBatchIds);
+ const atLeastOneUndefined = numberOfBoxes > 0 && !defined_default(boxBatchIds) || numberOfCylinders > 0 && !defined_default(cylinderBatchIds) || numberOfEllipsoids > 0 && !defined_default(ellipsoidBatchIds) || numberOfSpheres > 0 && !defined_default(sphereBatchIds);
+ if (atLeastOneDefined && atLeastOneUndefined) {
+ throw new RuntimeError_default(
+ "If one group of batch ids is defined, then all batch ids must be defined."
+ );
+ }
+ const allUndefinedBatchIds = !defined_default(boxBatchIds) && !defined_default(cylinderBatchIds) && !defined_default(ellipsoidBatchIds) && !defined_default(sphereBatchIds);
+ if (allUndefinedBatchIds) {
+ let id = 0;
+ if (!defined_default(boxBatchIds) && numberOfBoxes > 0) {
+ boxBatchIds = new Uint16Array(numberOfBoxes);
+ for (i = 0; i < numberOfBoxes; ++i) {
+ boxBatchIds[i] = id++;
+ }
+ }
+ if (!defined_default(cylinderBatchIds) && numberOfCylinders > 0) {
+ cylinderBatchIds = new Uint16Array(numberOfCylinders);
+ for (i = 0; i < numberOfCylinders; ++i) {
+ cylinderBatchIds[i] = id++;
+ }
+ }
+ if (!defined_default(ellipsoidBatchIds) && numberOfEllipsoids > 0) {
+ ellipsoidBatchIds = new Uint16Array(numberOfEllipsoids);
+ for (i = 0; i < numberOfEllipsoids; ++i) {
+ ellipsoidBatchIds[i] = id++;
+ }
+ }
+ if (!defined_default(sphereBatchIds) && numberOfSpheres > 0) {
+ sphereBatchIds = new Uint16Array(numberOfSpheres);
+ for (i = 0; i < numberOfSpheres; ++i) {
+ sphereBatchIds[i] = id++;
+ }
+ }
+ }
+ return {
+ boxes: boxBatchIds,
+ cylinders: cylinderBatchIds,
+ ellipsoids: ellipsoidBatchIds,
+ spheres: sphereBatchIds
+ };
+}
+var sizeOfUint322 = Uint32Array.BYTES_PER_ELEMENT;
+function initialize6(content, arrayBuffer, byteOffset) {
+ byteOffset = defaultValue_default(byteOffset, 0);
+ const uint8Array = new Uint8Array(arrayBuffer);
+ const view = new DataView(arrayBuffer);
+ byteOffset += sizeOfUint322;
+ const version2 = view.getUint32(byteOffset, true);
+ if (version2 !== 1) {
+ throw new RuntimeError_default(
+ `Only Geometry tile version 1 is supported. Version ${version2} is not.`
+ );
+ }
+ byteOffset += sizeOfUint322;
+ const byteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint322;
+ if (byteLength === 0) {
+ content._readyPromise.resolve(content);
+ return;
+ }
+ const featureTableJSONByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint322;
+ if (featureTableJSONByteLength === 0) {
+ throw new RuntimeError_default(
+ "Feature table must have a byte length greater than zero"
+ );
+ }
+ const featureTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint322;
+ const batchTableJSONByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint322;
+ const batchTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint322;
+ const featureTableJson = getJsonFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ featureTableJSONByteLength
+ );
+ byteOffset += featureTableJSONByteLength;
+ const featureTableBinary = new Uint8Array(
+ arrayBuffer,
+ byteOffset,
+ featureTableBinaryByteLength
+ );
+ byteOffset += featureTableBinaryByteLength;
+ let batchTableJson;
+ let batchTableBinary;
+ if (batchTableJSONByteLength > 0) {
+ batchTableJson = getJsonFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ batchTableJSONByteLength
+ );
+ byteOffset += batchTableJSONByteLength;
+ if (batchTableBinaryByteLength > 0) {
+ batchTableBinary = new Uint8Array(
+ arrayBuffer,
+ byteOffset,
+ batchTableBinaryByteLength
+ );
+ batchTableBinary = new Uint8Array(batchTableBinary);
+ }
+ }
+ const numberOfBoxes = defaultValue_default(featureTableJson.BOXES_LENGTH, 0);
+ const numberOfCylinders = defaultValue_default(featureTableJson.CYLINDERS_LENGTH, 0);
+ const numberOfEllipsoids = defaultValue_default(
+ featureTableJson.ELLIPSOIDS_LENGTH,
+ 0
+ );
+ const numberOfSpheres = defaultValue_default(featureTableJson.SPHERES_LENGTH, 0);
+ const totalPrimitives = numberOfBoxes + numberOfCylinders + numberOfEllipsoids + numberOfSpheres;
+ const batchTable = new Cesium3DTileBatchTable_default(
+ content,
+ totalPrimitives,
+ batchTableJson,
+ batchTableBinary,
+ createColorChangedCallback(content)
+ );
+ content._batchTable = batchTable;
+ if (totalPrimitives === 0) {
+ return;
+ }
+ const modelMatrix = content.tile.computedTransform;
+ let center;
+ if (defined_default(featureTableJson.RTC_CENTER)) {
+ center = Cartesian3_default.unpack(featureTableJson.RTC_CENTER);
+ Matrix4_default.multiplyByPoint(modelMatrix, center, center);
+ }
+ const batchIds = getBatchIds(featureTableJson, featureTableBinary);
+ if (numberOfBoxes > 0 || numberOfCylinders > 0 || numberOfEllipsoids > 0 || numberOfSpheres > 0) {
+ let boxes;
+ let cylinders;
+ let ellipsoids;
+ let spheres;
+ if (numberOfBoxes > 0) {
+ const boxesByteOffset = featureTableBinary.byteOffset + featureTableJson.BOXES.byteOffset;
+ boxes = new Float32Array(
+ featureTableBinary.buffer,
+ boxesByteOffset,
+ Vector3DTileGeometry_default.packedBoxLength * numberOfBoxes
+ );
+ }
+ if (numberOfCylinders > 0) {
+ const cylindersByteOffset = featureTableBinary.byteOffset + featureTableJson.CYLINDERS.byteOffset;
+ cylinders = new Float32Array(
+ featureTableBinary.buffer,
+ cylindersByteOffset,
+ Vector3DTileGeometry_default.packedCylinderLength * numberOfCylinders
+ );
+ }
+ if (numberOfEllipsoids > 0) {
+ const ellipsoidsByteOffset = featureTableBinary.byteOffset + featureTableJson.ELLIPSOIDS.byteOffset;
+ ellipsoids = new Float32Array(
+ featureTableBinary.buffer,
+ ellipsoidsByteOffset,
+ Vector3DTileGeometry_default.packedEllipsoidLength * numberOfEllipsoids
+ );
+ }
+ if (numberOfSpheres > 0) {
+ const spheresByteOffset = featureTableBinary.byteOffset + featureTableJson.SPHERES.byteOffset;
+ spheres = new Float32Array(
+ featureTableBinary.buffer,
+ spheresByteOffset,
+ Vector3DTileGeometry_default.packedSphereLength * numberOfSpheres
+ );
+ }
+ content._geometries = new Vector3DTileGeometry_default({
+ boxes,
+ boxBatchIds: batchIds.boxes,
+ cylinders,
+ cylinderBatchIds: batchIds.cylinders,
+ ellipsoids,
+ ellipsoidBatchIds: batchIds.ellipsoids,
+ spheres,
+ sphereBatchIds: batchIds.spheres,
+ center,
+ modelMatrix,
+ batchTable,
+ boundingVolume: content.tile.boundingVolume.boundingVolume
+ });
+ return content._geometries.readyPromise.then(function() {
+ return content;
+ });
+ }
+ return Promise.resolve(content);
+}
+function createFeatures(content) {
+ const featuresLength = content.featuresLength;
+ if (!defined_default(content._features) && featuresLength > 0) {
+ const features = new Array(featuresLength);
+ if (defined_default(content._geometries)) {
+ content._geometries.createFeatures(content, features);
+ }
+ content._features = features;
+ }
+}
+Geometry3DTileContent.prototype.hasProperty = function(batchId, name) {
+ return this._batchTable.hasProperty(batchId, name);
+};
+Geometry3DTileContent.prototype.getFeature = function(batchId) {
+ const featuresLength = this.featuresLength;
+ if (!defined_default(batchId) || batchId < 0 || batchId >= featuresLength) {
+ throw new DeveloperError_default(
+ `batchId is required and between zero and featuresLength - 1 (${featuresLength - 1}).`
+ );
+ }
+ createFeatures(this);
+ return this._features[batchId];
+};
+Geometry3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
+ if (defined_default(this._geometries)) {
+ this._geometries.applyDebugSettings(enabled, color);
+ }
+};
+Geometry3DTileContent.prototype.applyStyle = function(style) {
+ createFeatures(this);
+ if (defined_default(this._geometries)) {
+ this._geometries.applyStyle(style, this._features);
+ }
+};
+Geometry3DTileContent.prototype.update = function(tileset, frameState) {
+ if (defined_default(this._geometries)) {
+ this._geometries.classificationType = this._tileset.classificationType;
+ this._geometries.debugWireframe = this._tileset.debugWireframe;
+ this._geometries.update(frameState);
+ }
+ if (defined_default(this._batchTable) && this._geometries._ready) {
+ this._batchTable.update(tileset, frameState);
+ }
+};
+Geometry3DTileContent.prototype.isDestroyed = function() {
+ return false;
+};
+Geometry3DTileContent.prototype.destroy = function() {
+ this._geometries = this._geometries && this._geometries.destroy();
+ this._batchTable = this._batchTable && this._batchTable.destroy();
+ return destroyObject_default(this);
+};
+var Geometry3DTileContent_default = Geometry3DTileContent;
+
+// Source/Core/HilbertOrder.js
+var HilbertOrder = {};
+HilbertOrder.encode2D = function(level, x, y) {
+ const n = Math.pow(2, level);
+ Check_default.typeOf.number("level", level);
+ Check_default.typeOf.number("x", x);
+ Check_default.typeOf.number("y", y);
+ if (level < 1) {
+ throw new DeveloperError_default("Hilbert level cannot be less than 1.");
+ }
+ if (x < 0 || x >= n || y < 0 || y >= n) {
+ throw new DeveloperError_default("Invalid coordinates for given level.");
+ }
+ const p = {
+ x,
+ y
+ };
+ let rx, ry, s, index = BigInt(0);
+ for (s = n / 2; s > 0; s /= 2) {
+ rx = (p.x & s) > 0 ? 1 : 0;
+ ry = (p.y & s) > 0 ? 1 : 0;
+ index += BigInt((3 * rx ^ ry) * s * s);
+ rotate(n, p, rx, ry);
+ }
+ return index;
+};
+HilbertOrder.decode2D = function(level, index) {
+ Check_default.typeOf.number("level", level);
+ Check_default.typeOf.bigint("index", index);
+ if (level < 1) {
+ throw new DeveloperError_default("Hilbert level cannot be less than 1.");
+ }
+ if (index < BigInt(0) || index >= BigInt(Math.pow(4, level))) {
+ throw new DeveloperError_default(
+ "Hilbert index exceeds valid maximum for given level."
+ );
+ }
+ const n = Math.pow(2, level);
+ const p = {
+ x: 0,
+ y: 0
+ };
+ let rx, ry, s, t;
+ for (s = 1, t = index; s < n; s *= 2) {
+ rx = 1 & Number(t / BigInt(2));
+ ry = 1 & Number(t ^ BigInt(rx));
+ rotate(s, p, rx, ry);
+ p.x += s * rx;
+ p.y += s * ry;
+ t /= BigInt(4);
+ }
+ return [p.x, p.y];
+};
+function rotate(n, p, rx, ry) {
+ if (ry !== 0) {
+ return;
+ }
+ if (rx === 1) {
+ p.x = n - 1 - p.x;
+ p.y = n - 1 - p.y;
+ }
+ const t = p.x;
+ p.x = p.y;
+ p.y = t;
+}
+var HilbertOrder_default = HilbertOrder;
+
+// Source/Core/S2Cell.js
+var S2_MAX_LEVEL = 30;
+var S2_LIMIT_IJ = 1 << S2_MAX_LEVEL;
+var S2_MAX_SITI = 1 << S2_MAX_LEVEL + 1 >>> 0;
+var S2_POSITION_BITS = 2 * S2_MAX_LEVEL + 1;
+var S2_LOOKUP_BITS = 4;
+var S2_LOOKUP_POSITIONS = [];
+var S2_LOOKUP_IJ = [];
+var S2_POSITION_TO_IJ = [
+ [0, 1, 3, 2],
+ [0, 2, 3, 1],
+ [3, 2, 0, 1],
+ [3, 1, 0, 2]
+];
+var S2_SWAP_MASK = 1;
+var S2_INVERT_MASK = 2;
+var S2_POSITION_TO_ORIENTATION_MASK = [
+ S2_SWAP_MASK,
+ 0,
+ 0,
+ S2_SWAP_MASK | S2_INVERT_MASK
+];
+function S2Cell(cellId) {
+ if (!FeatureDetection_default.supportsBigInt()) {
+ throw new RuntimeError_default("S2 required BigInt support");
+ }
+ if (!defined_default(cellId)) {
+ throw new DeveloperError_default("cell ID is required.");
+ }
+ if (!S2Cell.isValidId(cellId)) {
+ throw new DeveloperError_default("cell ID is invalid.");
+ }
+ this._cellId = cellId;
+ this._level = S2Cell.getLevel(cellId);
+}
+S2Cell.fromToken = function(token) {
+ Check_default.typeOf.string("token", token);
+ if (!S2Cell.isValidToken(token)) {
+ throw new DeveloperError_default("token is invalid.");
+ }
+ return new S2Cell(S2Cell.getIdFromToken(token));
+};
+S2Cell.isValidId = function(cellId) {
+ Check_default.typeOf.bigint("cellId", cellId);
+ if (cellId <= 0) {
+ return false;
+ }
+ if (cellId >> BigInt(S2_POSITION_BITS) > 5) {
+ return false;
+ }
+ const lowestSetBit = cellId & ~cellId + BigInt(1);
+ if (!(lowestSetBit & BigInt("0x1555555555555555"))) {
+ return false;
+ }
+ return true;
+};
+S2Cell.isValidToken = function(token) {
+ Check_default.typeOf.string("token", token);
+ if (!/^[0-9a-fA-F]{1,16}$/.test(token)) {
+ return false;
+ }
+ return S2Cell.isValidId(S2Cell.getIdFromToken(token));
+};
+S2Cell.getIdFromToken = function(token) {
+ Check_default.typeOf.string("token", token);
+ return BigInt("0x" + token + "0".repeat(16 - token.length));
+};
+S2Cell.getTokenFromId = function(cellId) {
+ Check_default.typeOf.bigint("cellId", cellId);
+ const trailingZeroHexChars = Math.floor(countTrailingZeroBits(cellId) / 4);
+ const hexString = cellId.toString(16).replace(/0*$/, "");
+ const zeroString = Array(17 - trailingZeroHexChars - hexString.length).join(
+ "0"
+ );
+ return zeroString + hexString;
+};
+S2Cell.getLevel = function(cellId) {
+ Check_default.typeOf.bigint("cellId", cellId);
+ if (!S2Cell.isValidId(cellId)) {
+ throw new DeveloperError_default();
+ }
+ let lsbPosition = 0;
+ while (cellId !== BigInt(0)) {
+ if (cellId & BigInt(1)) {
+ break;
+ }
+ lsbPosition++;
+ cellId = cellId >> BigInt(1);
+ }
+ return S2_MAX_LEVEL - (lsbPosition >> 1);
+};
+S2Cell.prototype.getChild = function(index) {
+ Check_default.typeOf.number("index", index);
+ if (index < 0 || index > 3) {
+ throw new DeveloperError_default("child index must be in the range [0-3].");
+ }
+ if (this._level === 30) {
+ throw new DeveloperError_default("cannot get child of leaf cell.");
+ }
+ const newLsb = lsb(this._cellId) >> BigInt(2);
+ const childCellId = this._cellId + BigInt(2 * index + 1 - 4) * newLsb;
+ return new S2Cell(childCellId);
+};
+S2Cell.prototype.getParent = function() {
+ if (this._level === 0) {
+ throw new DeveloperError_default("cannot get parent of root cell.");
+ }
+ const newLsb = lsb(this._cellId) << BigInt(2);
+ return new S2Cell(this._cellId & ~newLsb + BigInt(1) | newLsb);
+};
+S2Cell.prototype.getParentAtLevel = function(level) {
+ if (this._level === 0 || level < 0 || this._level < level) {
+ throw new DeveloperError_default("cannot get parent at invalid level.");
+ }
+ const newLsb = lsbForLevel(level);
+ return new S2Cell(this._cellId & -newLsb | newLsb);
+};
+S2Cell.prototype.getCenter = function(ellipsoid) {
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ let center = getS2Center(this._cellId, this._level);
+ center = Cartesian3_default.normalize(center, center);
+ const cartographic2 = new Cartographic_default.fromCartesian(
+ center,
+ Ellipsoid_default.UNIT_SPHERE
+ );
+ return Cartographic_default.toCartesian(cartographic2, ellipsoid, new Cartesian3_default());
+};
+S2Cell.prototype.getVertex = function(index, ellipsoid) {
+ Check_default.typeOf.number("index", index);
+ if (index < 0 || index > 3) {
+ throw new DeveloperError_default("vertex index must be in the range [0-3].");
+ }
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ let vertex = getS2Vertex(this._cellId, this._level, index);
+ vertex = Cartesian3_default.normalize(vertex, vertex);
+ const cartographic2 = new Cartographic_default.fromCartesian(
+ vertex,
+ Ellipsoid_default.UNIT_SPHERE
+ );
+ return Cartographic_default.toCartesian(cartographic2, ellipsoid, new Cartesian3_default());
+};
+S2Cell.fromFacePositionLevel = function(face, position, level) {
+ Check_default.typeOf.bigint("position", position);
+ if (face < 0 || face > 5) {
+ throw new DeveloperError_default("Invalid S2 Face (must be within 0-5)");
+ }
+ if (level < 0 || level > S2_MAX_LEVEL) {
+ throw new DeveloperError_default("Invalid level (must be within 0-30)");
+ }
+ if (position < 0 || position >= Math.pow(4, level)) {
+ throw new DeveloperError_default("Invalid Hilbert position for level");
+ }
+ const faceBitString = (face < 4 ? "0" : "") + (face < 2 ? "0" : "") + face.toString(2);
+ const positionBitString = position.toString(2);
+ const positionPrefixPadding = Array(
+ 2 * level - positionBitString.length + 1
+ ).join("0");
+ const positionSuffixPadding = Array(S2_POSITION_BITS - 2 * level).join("0");
+ const cellId = BigInt(
+ `0b${faceBitString}${positionPrefixPadding}${positionBitString}1${positionSuffixPadding}`
+ );
+ return new S2Cell(cellId);
+};
+function getS2Center(cellId, level) {
+ const faceSiTi = convertCellIdToFaceSiTi(cellId, level);
+ return convertFaceSiTitoXYZ(faceSiTi[0], faceSiTi[1], faceSiTi[2]);
+}
+function getS2Vertex(cellId, level, index) {
+ const faceIJ = convertCellIdToFaceIJ(cellId, level);
+ const uv = convertIJLeveltoBoundUV([faceIJ[1], faceIJ[2]], level);
+ const y = index >> 1 & 1;
+ return convertFaceUVtoXYZ(faceIJ[0], uv[0][y ^ index & 1], uv[1][y]);
+}
+function convertCellIdToFaceSiTi(cellId, level) {
+ const faceIJ = convertCellIdToFaceIJ(cellId);
+ const face = faceIJ[0];
+ const i = faceIJ[1];
+ const j = faceIJ[2];
+ const isLeaf = level === 30;
+ const shouldCorrect = !isLeaf && (BigInt(i) ^ cellId >> BigInt(2)) & BigInt(1);
+ const correction = isLeaf ? 1 : shouldCorrect ? 2 : 0;
+ const si = (i << 1) + correction;
+ const ti = (j << 1) + correction;
+ return [face, si, ti];
+}
+function convertCellIdToFaceIJ(cellId) {
+ if (S2_LOOKUP_POSITIONS.length === 0) {
+ generateLookupTable();
+ }
+ const face = Number(cellId >> BigInt(S2_POSITION_BITS));
+ let bits = face & S2_SWAP_MASK;
+ const lookupMask = (1 << S2_LOOKUP_BITS) - 1;
+ let i = 0;
+ let j = 0;
+ for (let k = 7; k >= 0; k--) {
+ const numberOfBits = k === 7 ? S2_MAX_LEVEL - 7 * S2_LOOKUP_BITS : S2_LOOKUP_BITS;
+ const extractMask = (1 << 2 * numberOfBits) - 1;
+ bits += Number(
+ cellId >> BigInt(k * 2 * S2_LOOKUP_BITS + 1) & BigInt(extractMask)
+ ) << 2;
+ bits = S2_LOOKUP_IJ[bits];
+ const offset2 = k * S2_LOOKUP_BITS;
+ i += bits >> S2_LOOKUP_BITS + 2 << offset2;
+ j += (bits >> 2 & lookupMask) << offset2;
+ bits &= S2_SWAP_MASK | S2_INVERT_MASK;
+ }
+ return [face, i, j];
+}
+function convertFaceSiTitoXYZ(face, si, ti) {
+ const s = convertSiTitoST(si);
+ const t = convertSiTitoST(ti);
+ const u3 = convertSTtoUV(s);
+ const v7 = convertSTtoUV(t);
+ return convertFaceUVtoXYZ(face, u3, v7);
+}
+function convertFaceUVtoXYZ(face, u3, v7) {
+ switch (face) {
+ case 0:
+ return new Cartesian3_default(1, u3, v7);
+ case 1:
+ return new Cartesian3_default(-u3, 1, v7);
+ case 2:
+ return new Cartesian3_default(-u3, -v7, 1);
+ case 3:
+ return new Cartesian3_default(-1, -v7, -u3);
+ case 4:
+ return new Cartesian3_default(v7, -1, -u3);
+ default:
+ return new Cartesian3_default(v7, u3, -1);
+ }
+}
+function convertSTtoUV(s) {
+ if (s >= 0.5) {
+ return 1 / 3 * (4 * s * s - 1);
+ }
+ return 1 / 3 * (1 - 4 * (1 - s) * (1 - s));
+}
+function convertSiTitoST(si) {
+ return 1 / S2_MAX_SITI * si;
+}
+function convertIJLeveltoBoundUV(ij, level) {
+ const result = [[], []];
+ const cellSize = getSizeIJ(level);
+ for (let d = 0; d < 2; ++d) {
+ const ijLow = ij[d] & -cellSize;
+ const ijHigh = ijLow + cellSize;
+ result[d][0] = convertSTtoUV(convertIJtoSTMinimum(ijLow));
+ result[d][1] = convertSTtoUV(convertIJtoSTMinimum(ijHigh));
+ }
+ return result;
+}
+function getSizeIJ(level) {
+ return 1 << S2_MAX_LEVEL - level >>> 0;
+}
+function convertIJtoSTMinimum(i) {
+ return 1 / S2_LIMIT_IJ * i;
+}
+function generateLookupCell(level, i, j, originalOrientation, position, orientation) {
+ if (level === S2_LOOKUP_BITS) {
+ const ij = (i << S2_LOOKUP_BITS) + j;
+ S2_LOOKUP_POSITIONS[(ij << 2) + originalOrientation] = (position << 2) + orientation;
+ S2_LOOKUP_IJ[(position << 2) + originalOrientation] = (ij << 2) + orientation;
+ } else {
+ level++;
+ i <<= 1;
+ j <<= 1;
+ position <<= 2;
+ const r = S2_POSITION_TO_IJ[orientation];
+ generateLookupCell(
+ level,
+ i + (r[0] >> 1),
+ j + (r[0] & 1),
+ originalOrientation,
+ position,
+ orientation ^ S2_POSITION_TO_ORIENTATION_MASK[0]
+ );
+ generateLookupCell(
+ level,
+ i + (r[1] >> 1),
+ j + (r[1] & 1),
+ originalOrientation,
+ position + 1,
+ orientation ^ S2_POSITION_TO_ORIENTATION_MASK[1]
+ );
+ generateLookupCell(
+ level,
+ i + (r[2] >> 1),
+ j + (r[2] & 1),
+ originalOrientation,
+ position + 2,
+ orientation ^ S2_POSITION_TO_ORIENTATION_MASK[2]
+ );
+ generateLookupCell(
+ level,
+ i + (r[3] >> 1),
+ j + (r[3] & 1),
+ originalOrientation,
+ position + 3,
+ orientation ^ S2_POSITION_TO_ORIENTATION_MASK[3]
+ );
+ }
+}
+function generateLookupTable() {
+ generateLookupCell(0, 0, 0, 0, 0, 0);
+ generateLookupCell(0, 0, 0, S2_SWAP_MASK, 0, S2_SWAP_MASK);
+ generateLookupCell(0, 0, 0, S2_INVERT_MASK, 0, S2_INVERT_MASK);
+ generateLookupCell(
+ 0,
+ 0,
+ 0,
+ S2_SWAP_MASK | S2_INVERT_MASK,
+ 0,
+ S2_SWAP_MASK | S2_INVERT_MASK
+ );
+}
+function lsb(cellId) {
+ return cellId & ~cellId + BigInt(1);
+}
+function lsbForLevel(level) {
+ return BigInt(1) << BigInt(2 * (S2_MAX_LEVEL - level));
+}
+var Mod67BitPosition = [
+ 64,
+ 0,
+ 1,
+ 39,
+ 2,
+ 15,
+ 40,
+ 23,
+ 3,
+ 12,
+ 16,
+ 59,
+ 41,
+ 19,
+ 24,
+ 54,
+ 4,
+ 64,
+ 13,
+ 10,
+ 17,
+ 62,
+ 60,
+ 28,
+ 42,
+ 30,
+ 20,
+ 51,
+ 25,
+ 44,
+ 55,
+ 47,
+ 5,
+ 32,
+ 65,
+ 38,
+ 14,
+ 22,
+ 11,
+ 58,
+ 18,
+ 53,
+ 63,
+ 9,
+ 61,
+ 27,
+ 29,
+ 50,
+ 43,
+ 46,
+ 31,
+ 37,
+ 21,
+ 57,
+ 52,
+ 8,
+ 26,
+ 49,
+ 45,
+ 36,
+ 56,
+ 7,
+ 48,
+ 35,
+ 6,
+ 34,
+ 33,
+ 0
+];
+function countTrailingZeroBits(x) {
+ return Mod67BitPosition[(-x & x) % BigInt(67)];
+}
+var S2Cell_default = S2Cell;
+
+// Source/Scene/hasExtension.js
+function hasExtension(json, extensionName) {
+ return defined_default(json) && defined_default(json.extensions) && defined_default(json.extensions[extensionName]);
+}
+var hasExtension_default = hasExtension;
+
+// Source/Scene/ImplicitAvailabilityBitstream.js
+function ImplicitAvailabilityBitstream(options) {
+ const lengthBits = options.lengthBits;
+ let availableCount = options.availableCount;
+ Check_default.typeOf.number("options.lengthBits", lengthBits);
+ const constant = options.constant;
+ const bitstream = options.bitstream;
+ if (defined_default(constant)) {
+ availableCount = lengthBits;
+ } else {
+ const expectedLength = Math.ceil(lengthBits / 8);
+ if (bitstream.length !== expectedLength) {
+ throw new RuntimeError_default(
+ `Availability bitstream must be exactly ${expectedLength} bytes long to store ${lengthBits} bits. Actual bitstream was ${bitstream.length} bytes long.`
+ );
+ }
+ const computeAvailableCountEnabled = defaultValue_default(
+ options.computeAvailableCountEnabled,
+ false
+ );
+ if (!defined_default(availableCount) && computeAvailableCountEnabled) {
+ availableCount = count1Bits(bitstream, lengthBits);
+ }
+ }
+ this._lengthBits = lengthBits;
+ this._availableCount = availableCount;
+ this._constant = constant;
+ this._bitstream = bitstream;
+}
+function count1Bits(bitstream, lengthBits) {
+ let count = 0;
+ for (let i = 0; i < lengthBits; i++) {
+ const byteIndex = i >> 3;
+ const bitIndex = i % 8;
+ count += bitstream[byteIndex] >> bitIndex & 1;
+ }
+ return count;
+}
+Object.defineProperties(ImplicitAvailabilityBitstream.prototype, {
+ lengthBits: {
+ get: function() {
+ return this._lengthBits;
+ }
+ },
+ availableCount: {
+ get: function() {
+ return this._availableCount;
+ }
+ }
+});
+ImplicitAvailabilityBitstream.prototype.getBit = function(index) {
+ if (index < 0 || index >= this._lengthBits) {
+ throw new DeveloperError_default("Bit index out of bounds.");
+ }
+ if (defined_default(this._constant)) {
+ return this._constant;
+ }
+ const byteIndex = index >> 3;
+ const bitIndex = index % 8;
+ return (this._bitstream[byteIndex] >> bitIndex & 1) === 1;
+};
+var ImplicitAvailabilityBitstream_default = ImplicitAvailabilityBitstream;
+
+// Source/Scene/ImplicitMetadataView.js
+function ImplicitMetadataView(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const metadataTable = options.metadataTable;
+ const metadataClass = options.class;
+ const entityId = options.entityId;
+ const propertyTableJson = options.propertyTableJson;
+ Check_default.typeOf.object("options.metadataTable", metadataTable);
+ Check_default.typeOf.object("options.class", metadataClass);
+ Check_default.typeOf.number("options.entityId", entityId);
+ Check_default.typeOf.object("options.propertyTableJson", propertyTableJson);
+ this._class = metadataClass;
+ this._metadataTable = metadataTable;
+ this._entityId = entityId;
+ this._extensions = propertyTableJson.extensions;
+ this._extras = propertyTableJson.extras;
+}
+Object.defineProperties(ImplicitMetadataView.prototype, {
+ class: {
+ get: function() {
+ return this._class;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+ImplicitMetadataView.prototype.hasProperty = function(propertyId) {
+ return this._metadataTable.hasProperty(propertyId);
+};
+ImplicitMetadataView.prototype.hasPropertyBySemantic = function(semantic) {
+ return this._metadataTable.hasPropertyBySemantic(semantic);
+};
+ImplicitMetadataView.prototype.getPropertyIds = function(results) {
+ return this._metadataTable.getPropertyIds(results);
+};
+ImplicitMetadataView.prototype.getProperty = function(propertyId) {
+ return this._metadataTable.getProperty(this._entityId, propertyId);
+};
+ImplicitMetadataView.prototype.setProperty = function(propertyId, value) {
+ return this._metadataTable.setProperty(this._entityId, propertyId, value);
+};
+ImplicitMetadataView.prototype.getPropertyBySemantic = function(semantic) {
+ return this._metadataTable.getPropertyBySemantic(this._entityId, semantic);
+};
+ImplicitMetadataView.prototype.setPropertyBySemantic = function(semantic, value) {
+ return this._metadataTable.setPropertyBySemantic(
+ this._entityId,
+ semantic,
+ value
+ );
+};
+var ImplicitMetadataView_default = ImplicitMetadataView;
+
+// Source/Scene/ImplicitSubdivisionScheme.js
+var ImplicitSubdivisionScheme = {
+ QUADTREE: "QUADTREE",
+ OCTREE: "OCTREE"
+};
+ImplicitSubdivisionScheme.getBranchingFactor = function(subdivisionScheme) {
+ switch (subdivisionScheme) {
+ case ImplicitSubdivisionScheme.OCTREE:
+ return 8;
+ case ImplicitSubdivisionScheme.QUADTREE:
+ return 4;
+ default:
+ throw new DeveloperError_default("subdivisionScheme is not a valid value.");
+ }
+};
+var ImplicitSubdivisionScheme_default = Object.freeze(ImplicitSubdivisionScheme);
+
+// Source/Scene/MetadataEntity.js
+function MetadataEntity() {
+}
+Object.defineProperties(MetadataEntity.prototype, {
+ class: {
+ get: function() {
+ DeveloperError_default.throwInstantiationError();
+ }
+ }
+});
+MetadataEntity.prototype.hasProperty = function(propertyId) {
+ DeveloperError_default.throwInstantiationError();
+};
+MetadataEntity.prototype.hasPropertyBySemantic = function(semantic) {
+ DeveloperError_default.throwInstantiationError();
+};
+MetadataEntity.prototype.getPropertyIds = function(results) {
+ DeveloperError_default.throwInstantiationError();
+};
+MetadataEntity.prototype.getProperty = function(propertyId) {
+ DeveloperError_default.throwInstantiationError();
+};
+MetadataEntity.prototype.setProperty = function(propertyId, value) {
+ DeveloperError_default.throwInstantiationError();
+};
+MetadataEntity.prototype.getPropertyBySemantic = function(semantic) {
+ DeveloperError_default.throwInstantiationError();
+};
+MetadataEntity.prototype.setPropertyBySemantic = function(semantic, value) {
+ DeveloperError_default.throwInstantiationError();
+};
+MetadataEntity.hasProperty = function(propertyId, properties, classDefinition) {
+ Check_default.typeOf.string("propertyId", propertyId);
+ Check_default.typeOf.object("properties", properties);
+ Check_default.typeOf.object("classDefinition", classDefinition);
+ if (defined_default(properties[propertyId])) {
+ return true;
+ }
+ const classProperties = classDefinition.properties;
+ if (!defined_default(classProperties)) {
+ return false;
+ }
+ const classProperty = classProperties[propertyId];
+ if (defined_default(classProperty) && defined_default(classProperty.default)) {
+ return true;
+ }
+ return false;
+};
+MetadataEntity.hasPropertyBySemantic = function(semantic, properties, classDefinition) {
+ Check_default.typeOf.string("semantic", semantic);
+ Check_default.typeOf.object("properties", properties);
+ Check_default.typeOf.object("classDefinition", classDefinition);
+ const propertiesBySemantic = classDefinition.propertiesBySemantic;
+ if (!defined_default(propertiesBySemantic)) {
+ return false;
+ }
+ const property = propertiesBySemantic[semantic];
+ return defined_default(property);
+};
+MetadataEntity.getPropertyIds = function(properties, classDefinition, results) {
+ Check_default.typeOf.object("properties", properties);
+ Check_default.typeOf.object("classDefinition", classDefinition);
+ results = defined_default(results) ? results : [];
+ results.length = 0;
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId) && defined_default(properties[propertyId])) {
+ results.push(propertyId);
+ }
+ }
+ const classProperties = classDefinition.properties;
+ if (defined_default(classProperties)) {
+ for (const classPropertyId in classProperties) {
+ if (classProperties.hasOwnProperty(classPropertyId) && !defined_default(properties[classPropertyId]) && defined_default(classProperties[classPropertyId].default)) {
+ results.push(classPropertyId);
+ }
+ }
+ }
+ return results;
+};
+MetadataEntity.getProperty = function(propertyId, properties, classDefinition) {
+ Check_default.typeOf.string("propertyId", propertyId);
+ Check_default.typeOf.object("properties", properties);
+ Check_default.typeOf.object("classDefinition", classDefinition);
+ if (!defined_default(classDefinition.properties[propertyId])) {
+ throw new DeveloperError_default(`Class definition missing property ${propertyId}`);
+ }
+ const classProperty = classDefinition.properties[propertyId];
+ let value = properties[propertyId];
+ if (Array.isArray(value)) {
+ value = value.slice();
+ }
+ const enableNestedArrays = true;
+ value = classProperty.handleNoData(value);
+ if (!defined_default(value) && defined_default(classProperty.default)) {
+ value = clone_default(classProperty.default, true);
+ return classProperty.unpackVectorAndMatrixTypes(value, enableNestedArrays);
+ }
+ if (!defined_default(value)) {
+ return void 0;
+ }
+ value = classProperty.normalize(value);
+ value = classProperty.applyValueTransform(value);
+ return classProperty.unpackVectorAndMatrixTypes(value, enableNestedArrays);
+};
+MetadataEntity.setProperty = function(propertyId, value, properties, classDefinition) {
+ Check_default.typeOf.string("propertyId", propertyId);
+ Check_default.defined("value", value);
+ Check_default.typeOf.object("properties", properties);
+ Check_default.typeOf.object("classDefinition", classDefinition);
+ if (!defined_default(properties[propertyId])) {
+ return false;
+ }
+ if (Array.isArray(value)) {
+ value = value.slice();
+ }
+ let classProperty;
+ const classProperties = classDefinition.properties;
+ if (defined_default(classProperties)) {
+ classProperty = classProperties[propertyId];
+ }
+ const enableNestedArrays = true;
+ if (defined_default(classProperty)) {
+ value = classProperty.packVectorAndMatrixTypes(value, enableNestedArrays);
+ value = classProperty.unapplyValueTransform(value);
+ value = classProperty.unnormalize(value);
+ }
+ properties[propertyId] = value;
+ return true;
+};
+MetadataEntity.getPropertyBySemantic = function(semantic, properties, classDefinition) {
+ Check_default.typeOf.string("semantic", semantic);
+ Check_default.typeOf.object("properties", properties);
+ Check_default.typeOf.object("classDefinition", classDefinition);
+ const propertiesBySemantic = classDefinition.propertiesBySemantic;
+ if (!defined_default(propertiesBySemantic)) {
+ return void 0;
+ }
+ const property = propertiesBySemantic[semantic];
+ if (defined_default(property)) {
+ return MetadataEntity.getProperty(property.id, properties, classDefinition);
+ }
+ return void 0;
+};
+MetadataEntity.setPropertyBySemantic = function(semantic, value, properties, classDefinition) {
+ Check_default.typeOf.string("semantic", semantic);
+ Check_default.defined("value", value);
+ Check_default.typeOf.object("properties", properties);
+ Check_default.typeOf.object("classDefinition", classDefinition);
+ const propertiesBySemantic = classDefinition.propertiesBySemantic;
+ if (!defined_default(propertiesBySemantic)) {
+ return false;
+ }
+ const property = classDefinition.propertiesBySemantic[semantic];
+ if (defined_default(property)) {
+ return MetadataEntity.setProperty(
+ property.id,
+ value,
+ properties,
+ classDefinition
+ );
+ }
+ return false;
+};
+var MetadataEntity_default = MetadataEntity;
+
+// Source/Scene/ImplicitSubtreeMetadata.js
+function ImplicitSubtreeMetadata(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const subtreeMetadata = options.subtreeMetadata;
+ const metadataClass = options.class;
+ Check_default.typeOf.object("options.subtreeMetadata", subtreeMetadata);
+ Check_default.typeOf.object("options.class", metadataClass);
+ const properties = defined_default(subtreeMetadata.properties) ? subtreeMetadata.properties : {};
+ this._class = metadataClass;
+ this._properties = properties;
+ this._extras = subtreeMetadata.extras;
+ this._extensions = subtreeMetadata.extensions;
+}
+Object.defineProperties(ImplicitSubtreeMetadata.prototype, {
+ class: {
+ get: function() {
+ return this._class;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+ImplicitSubtreeMetadata.prototype.hasProperty = function(propertyId) {
+ return MetadataEntity_default.hasProperty(propertyId, this._properties, this._class);
+};
+ImplicitSubtreeMetadata.prototype.hasPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.hasPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+ImplicitSubtreeMetadata.prototype.getPropertyIds = function(results) {
+ return MetadataEntity_default.getPropertyIds(this._properties, this._class, results);
+};
+ImplicitSubtreeMetadata.prototype.getProperty = function(propertyId) {
+ return MetadataEntity_default.getProperty(propertyId, this._properties, this._class);
+};
+ImplicitSubtreeMetadata.prototype.setProperty = function(propertyId, value) {
+ return MetadataEntity_default.setProperty(
+ propertyId,
+ value,
+ this._properties,
+ this._class
+ );
+};
+ImplicitSubtreeMetadata.prototype.getPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.getPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+ImplicitSubtreeMetadata.prototype.setPropertyBySemantic = function(semantic, value) {
+ return MetadataEntity_default.setPropertyBySemantic(
+ semantic,
+ value,
+ this._properties,
+ this._class
+ );
+};
+var ImplicitSubtreeMetadata_default = ImplicitSubtreeMetadata;
+
+// Source/Scene/MetadataComponentType.js
+var MetadataComponentType = {
+ INT8: "INT8",
+ UINT8: "UINT8",
+ INT16: "INT16",
+ UINT16: "UINT16",
+ INT32: "INT32",
+ UINT32: "UINT32",
+ INT64: "INT64",
+ UINT64: "UINT64",
+ FLOAT32: "FLOAT32",
+ FLOAT64: "FLOAT64"
+};
+MetadataComponentType.getMinimum = function(type) {
+ if (!MetadataComponentType.isNumericType(type)) {
+ throw new DeveloperError_default("type must be a numeric type");
+ }
+ switch (type) {
+ case MetadataComponentType.INT8:
+ return -128;
+ case MetadataComponentType.UINT8:
+ return 0;
+ case MetadataComponentType.INT16:
+ return -32768;
+ case MetadataComponentType.UINT16:
+ return 0;
+ case MetadataComponentType.INT32:
+ return -2147483648;
+ case MetadataComponentType.UINT32:
+ return 0;
+ case MetadataComponentType.INT64:
+ if (FeatureDetection_default.supportsBigInt()) {
+ return BigInt("-9223372036854775808");
+ }
+ return -Math.pow(2, 63);
+ case MetadataComponentType.UINT64:
+ if (FeatureDetection_default.supportsBigInt()) {
+ return BigInt(0);
+ }
+ return 0;
+ case MetadataComponentType.FLOAT32:
+ return -34028234663852886e22;
+ case MetadataComponentType.FLOAT64:
+ return -Number.MAX_VALUE;
+ }
+};
+MetadataComponentType.getMaximum = function(type) {
+ if (!MetadataComponentType.isNumericType(type)) {
+ throw new DeveloperError_default("type must be a numeric type");
+ }
+ switch (type) {
+ case MetadataComponentType.INT8:
+ return 127;
+ case MetadataComponentType.UINT8:
+ return 255;
+ case MetadataComponentType.INT16:
+ return 32767;
+ case MetadataComponentType.UINT16:
+ return 65535;
+ case MetadataComponentType.INT32:
+ return 2147483647;
+ case MetadataComponentType.UINT32:
+ return 4294967295;
+ case MetadataComponentType.INT64:
+ if (FeatureDetection_default.supportsBigInt()) {
+ return BigInt("9223372036854775807");
+ }
+ return Math.pow(2, 63) - 1;
+ case MetadataComponentType.UINT64:
+ if (FeatureDetection_default.supportsBigInt()) {
+ return BigInt("18446744073709551615");
+ }
+ return Math.pow(2, 64) - 1;
+ case MetadataComponentType.FLOAT32:
+ return 34028234663852886e22;
+ case MetadataComponentType.FLOAT64:
+ return Number.MAX_VALUE;
+ }
+};
+MetadataComponentType.isNumericType = function(type) {
+ Check_default.typeOf.string("type", type);
+ switch (type) {
+ case MetadataComponentType.INT8:
+ case MetadataComponentType.UINT8:
+ case MetadataComponentType.INT16:
+ case MetadataComponentType.UINT16:
+ case MetadataComponentType.INT32:
+ case MetadataComponentType.UINT32:
+ case MetadataComponentType.INT64:
+ case MetadataComponentType.UINT64:
+ case MetadataComponentType.FLOAT32:
+ case MetadataComponentType.FLOAT64:
+ return true;
+ default:
+ return false;
+ }
+};
+MetadataComponentType.isIntegerType = function(type) {
+ Check_default.typeOf.string("type", type);
+ switch (type) {
+ case MetadataComponentType.INT8:
+ case MetadataComponentType.UINT8:
+ case MetadataComponentType.INT16:
+ case MetadataComponentType.UINT16:
+ case MetadataComponentType.INT32:
+ case MetadataComponentType.UINT32:
+ case MetadataComponentType.INT64:
+ case MetadataComponentType.UINT64:
+ return true;
+ default:
+ return false;
+ }
+};
+MetadataComponentType.isUnsignedIntegerType = function(type) {
+ Check_default.typeOf.string("type", type);
+ switch (type) {
+ case MetadataComponentType.UINT8:
+ case MetadataComponentType.UINT16:
+ case MetadataComponentType.UINT32:
+ case MetadataComponentType.UINT64:
+ return true;
+ default:
+ return false;
+ }
+};
+MetadataComponentType.isVectorCompatible = function(type) {
+ Check_default.typeOf.string("type", type);
+ switch (type) {
+ case MetadataComponentType.INT8:
+ case MetadataComponentType.UINT8:
+ case MetadataComponentType.INT16:
+ case MetadataComponentType.UINT16:
+ case MetadataComponentType.INT32:
+ case MetadataComponentType.UINT32:
+ case MetadataComponentType.FLOAT32:
+ case MetadataComponentType.FLOAT64:
+ return true;
+ default:
+ return false;
+ }
+};
+MetadataComponentType.normalize = function(value, type) {
+ if (typeof value !== "number" && typeof value !== "bigint") {
+ throw new DeveloperError_default("value must be a number or a BigInt");
+ }
+ if (!MetadataComponentType.isIntegerType(type)) {
+ throw new DeveloperError_default("type must be an integer type");
+ }
+ return Math.max(
+ Number(value) / Number(MetadataComponentType.getMaximum(type)),
+ -1
+ );
+};
+MetadataComponentType.unnormalize = function(value, type) {
+ Check_default.typeOf.number("value", value);
+ if (!MetadataComponentType.isIntegerType(type)) {
+ throw new DeveloperError_default("type must be an integer type");
+ }
+ const max3 = MetadataComponentType.getMaximum(type);
+ const min3 = MetadataComponentType.isUnsignedIntegerType(type) ? 0 : -max3;
+ value = Math_default.sign(value) * Math.round(Math.abs(value) * Number(max3));
+ if ((type === MetadataComponentType.INT64 || type === MetadataComponentType.UINT64) && FeatureDetection_default.supportsBigInt()) {
+ value = BigInt(value);
+ }
+ if (value > max3) {
+ return max3;
+ }
+ if (value < min3) {
+ return min3;
+ }
+ return value;
+};
+MetadataComponentType.applyValueTransform = function(value, offset2, scale) {
+ return scale * value + offset2;
+};
+MetadataComponentType.unapplyValueTransform = function(value, offset2, scale) {
+ if (scale === 0) {
+ return 0;
+ }
+ return (value - offset2) / scale;
+};
+MetadataComponentType.getSizeInBytes = function(type) {
+ if (!MetadataComponentType.isNumericType(type)) {
+ throw new DeveloperError_default("type must be a numeric type");
+ }
+ switch (type) {
+ case MetadataComponentType.INT8:
+ case MetadataComponentType.UINT8:
+ return 1;
+ case MetadataComponentType.INT16:
+ case MetadataComponentType.UINT16:
+ return 2;
+ case MetadataComponentType.INT32:
+ case MetadataComponentType.UINT32:
+ return 4;
+ case MetadataComponentType.INT64:
+ case MetadataComponentType.UINT64:
+ return 8;
+ case MetadataComponentType.FLOAT32:
+ return 4;
+ case MetadataComponentType.FLOAT64:
+ return 8;
+ }
+};
+var MetadataComponentType_default = Object.freeze(MetadataComponentType);
+
+// Source/Scene/MetadataType.js
+var MetadataType = {
+ SCALAR: "SCALAR",
+ VEC2: "VEC2",
+ VEC3: "VEC3",
+ VEC4: "VEC4",
+ MAT2: "MAT2",
+ MAT3: "MAT3",
+ MAT4: "MAT4",
+ BOOLEAN: "BOOLEAN",
+ STRING: "STRING",
+ ENUM: "ENUM"
+};
+MetadataType.isVectorType = function(type) {
+ Check_default.typeOf.string("type", type);
+ switch (type) {
+ case MetadataType.VEC2:
+ case MetadataType.VEC3:
+ case MetadataType.VEC4:
+ return true;
+ default:
+ return false;
+ }
+};
+MetadataType.isMatrixType = function(type) {
+ Check_default.typeOf.string("type", type);
+ switch (type) {
+ case MetadataType.MAT2:
+ case MetadataType.MAT3:
+ case MetadataType.MAT4:
+ return true;
+ default:
+ return false;
+ }
+};
+MetadataType.getComponentCount = function(type) {
+ Check_default.typeOf.string("type", type);
+ switch (type) {
+ case MetadataType.SCALAR:
+ case MetadataType.STRING:
+ case MetadataType.ENUM:
+ case MetadataType.BOOLEAN:
+ return 1;
+ case MetadataType.VEC2:
+ return 2;
+ case MetadataType.VEC3:
+ return 3;
+ case MetadataType.VEC4:
+ return 4;
+ case MetadataType.MAT2:
+ return 4;
+ case MetadataType.MAT3:
+ return 9;
+ case MetadataType.MAT4:
+ return 16;
+ default:
+ throw new DeveloperError_default(`Invalid metadata type ${type}`);
+ }
+};
+MetadataType.getMathType = function(type) {
+ switch (type) {
+ case MetadataType.VEC2:
+ return Cartesian2_default;
+ case MetadataType.VEC3:
+ return Cartesian3_default;
+ case MetadataType.VEC4:
+ return Cartesian4_default;
+ case MetadataType.MAT2:
+ return Matrix2_default;
+ case MetadataType.MAT3:
+ return Matrix3_default;
+ case MetadataType.MAT4:
+ return Matrix4_default;
+ default:
+ return void 0;
+ }
+};
+var MetadataType_default = Object.freeze(MetadataType);
+
+// Source/Scene/MetadataClassProperty.js
+function MetadataClassProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const id = options.id;
+ const property = options.property;
+ Check_default.typeOf.string("options.id", id);
+ Check_default.typeOf.object("options.property", property);
+ Check_default.typeOf.string("options.property.type", property.type);
+ const isLegacyExtension = isLegacy(property);
+ const parsedType = parseType(property, options.enums);
+ const componentType = parsedType.componentType;
+ const normalized = defined_default(componentType) && MetadataComponentType_default.isIntegerType(componentType) && defaultValue_default(property.normalized, false);
+ this._id = id;
+ this._name = property.name;
+ this._description = property.description;
+ this._semantic = property.semantic;
+ this._isLegacyExtension = isLegacyExtension;
+ this._type = parsedType.type;
+ this._componentType = componentType;
+ this._enumType = parsedType.enumType;
+ this._valueType = parsedType.valueType;
+ this._isArray = parsedType.isArray;
+ this._isVariableLengthArray = parsedType.isVariableLengthArray;
+ this._arrayLength = parsedType.arrayLength;
+ this._min = property.min;
+ this._max = property.max;
+ this._normalized = normalized;
+ let offset2 = property.offset;
+ let scale = property.scale;
+ const hasValueTransform = defined_default(offset2) || defined_default(scale);
+ const enableNestedArrays = true;
+ if (!defined_default(offset2)) {
+ offset2 = this.expandConstant(0, enableNestedArrays);
+ }
+ if (!defined_default(scale)) {
+ scale = this.expandConstant(1, enableNestedArrays);
+ }
+ this._offset = offset2;
+ this._scale = scale;
+ this._hasValueTransform = hasValueTransform;
+ this._noData = property.noData;
+ this._default = property.default;
+ let required;
+ if (!defined_default(isLegacyExtension)) {
+ required = false;
+ } else if (isLegacyExtension) {
+ required = defined_default(property.optional) ? !property.optional : true;
+ } else {
+ required = defaultValue_default(property.required, false);
+ }
+ this._required = required;
+ this._extras = property.extras;
+ this._extensions = property.extensions;
+}
+Object.defineProperties(MetadataClassProperty.prototype, {
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ description: {
+ get: function() {
+ return this._description;
+ }
+ },
+ type: {
+ get: function() {
+ return this._type;
+ }
+ },
+ enumType: {
+ get: function() {
+ return this._enumType;
+ }
+ },
+ componentType: {
+ get: function() {
+ return this._componentType;
+ }
+ },
+ valueType: {
+ get: function() {
+ return this._valueType;
+ }
+ },
+ isArray: {
+ get: function() {
+ return this._isArray;
+ }
+ },
+ isVariableLengthArray: {
+ get: function() {
+ return this._isVariableLengthArray;
+ }
+ },
+ arrayLength: {
+ get: function() {
+ return this._arrayLength;
+ }
+ },
+ normalized: {
+ get: function() {
+ return this._normalized;
+ }
+ },
+ max: {
+ get: function() {
+ return this._max;
+ }
+ },
+ min: {
+ get: function() {
+ return this._min;
+ }
+ },
+ noData: {
+ get: function() {
+ return this._noData;
+ }
+ },
+ default: {
+ get: function() {
+ return this._default;
+ }
+ },
+ required: {
+ get: function() {
+ return this._required;
+ }
+ },
+ semantic: {
+ get: function() {
+ return this._semantic;
+ }
+ },
+ hasValueTransform: {
+ get: function() {
+ return this._hasValueTransform;
+ }
+ },
+ offset: {
+ get: function() {
+ return this._offset;
+ }
+ },
+ scale: {
+ get: function() {
+ return this._scale;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+function isLegacy(property) {
+ if (property.type === "ARRAY") {
+ return true;
+ }
+ const type = property.type;
+ if (type === MetadataType_default.SCALAR || MetadataType_default.isMatrixType(type) || MetadataType_default.isVectorType(type)) {
+ return false;
+ }
+ if (MetadataComponentType_default.isNumericType(type)) {
+ return true;
+ }
+ if (defined_default(property.noData) || defined_default(property.scale) || defined_default(property.offset) || defined_default(property.required) || defined_default(property.count) || defined_default(property.array)) {
+ return false;
+ }
+ if (defined_default(property.optional)) {
+ return false;
+ }
+ return void 0;
+}
+function parseType(property, enums) {
+ const type = property.type;
+ const componentType = property.componentType;
+ const isLegacyArray = type === "ARRAY";
+ let isArray;
+ let arrayLength;
+ let isVariableLengthArray;
+ if (isLegacyArray) {
+ isArray = true;
+ arrayLength = property.componentCount;
+ isVariableLengthArray = !defined_default(arrayLength);
+ } else if (property.array) {
+ isArray = true;
+ arrayLength = property.count;
+ isVariableLengthArray = !defined_default(property.count);
+ } else {
+ isArray = false;
+ arrayLength = void 0;
+ isVariableLengthArray = false;
+ }
+ let enumType;
+ if (defined_default(property.enumType)) {
+ enumType = enums[property.enumType];
+ }
+ if (type === MetadataType_default.ENUM) {
+ return {
+ type,
+ componentType: void 0,
+ enumType,
+ valueType: enumType.valueType,
+ isArray,
+ isVariableLengthArray,
+ arrayLength
+ };
+ }
+ if (isLegacyArray && componentType === MetadataType_default.ENUM) {
+ return {
+ type: componentType,
+ componentType: void 0,
+ enumType,
+ valueType: enumType.valueType,
+ isArray,
+ isVariableLengthArray,
+ arrayLength
+ };
+ }
+ if (type === MetadataType_default.SCALAR || MetadataType_default.isMatrixType(type) || MetadataType_default.isVectorType(type)) {
+ return {
+ type,
+ componentType,
+ enumType: void 0,
+ valueType: componentType,
+ isArray,
+ isVariableLengthArray,
+ arrayLength
+ };
+ }
+ if (type === MetadataType_default.BOOLEAN || type === MetadataType_default.STRING) {
+ return {
+ type,
+ componentType: void 0,
+ enumType: void 0,
+ valueType: void 0,
+ isArray,
+ isVariableLengthArray,
+ arrayLength
+ };
+ }
+ if (isLegacyArray && (componentType === MetadataType_default.BOOLEAN || componentType === MetadataType_default.STRING)) {
+ return {
+ type: componentType,
+ componentType: void 0,
+ enumType: void 0,
+ valueType: void 0,
+ isArray,
+ isVariableLengthArray,
+ arrayLength
+ };
+ }
+ if (defined_default(componentType) && MetadataComponentType_default.isNumericType(componentType)) {
+ return {
+ type: MetadataType_default.SCALAR,
+ componentType,
+ enumType: void 0,
+ valueType: componentType,
+ isArray,
+ isVariableLengthArray,
+ arrayLength
+ };
+ }
+ if (MetadataComponentType_default.isNumericType(type)) {
+ return {
+ type: MetadataType_default.SCALAR,
+ componentType: type,
+ enumType: void 0,
+ valueType: type,
+ isArray,
+ isVariableLengthArray,
+ arrayLength
+ };
+ }
+ throw new DeveloperError_default(
+ `unknown metadata type {type: ${type}, componentType: ${componentType})`
+ );
+}
+MetadataClassProperty.prototype.normalize = function(value) {
+ if (!this._normalized) {
+ return value;
+ }
+ return normalizeInPlace(
+ value,
+ this._valueType,
+ MetadataComponentType_default.normalize
+ );
+};
+MetadataClassProperty.prototype.unnormalize = function(value) {
+ if (!this._normalized) {
+ return value;
+ }
+ return normalizeInPlace(
+ value,
+ this._valueType,
+ MetadataComponentType_default.unnormalize
+ );
+};
+MetadataClassProperty.prototype.applyValueTransform = function(value) {
+ if (!this._hasValueTransform || this._isVariableLengthArray) {
+ return value;
+ }
+ return MetadataClassProperty.valueTransformInPlace(
+ value,
+ this._offset,
+ this._scale,
+ MetadataComponentType_default.applyValueTransform
+ );
+};
+MetadataClassProperty.prototype.unapplyValueTransform = function(value) {
+ if (!this._hasValueTransform || this._isVariableLengthArray) {
+ return value;
+ }
+ return MetadataClassProperty.valueTransformInPlace(
+ value,
+ this._offset,
+ this._scale,
+ MetadataComponentType_default.unapplyValueTransform
+ );
+};
+MetadataClassProperty.prototype.expandConstant = function(constant, enableNestedArrays) {
+ enableNestedArrays = defaultValue_default(enableNestedArrays, false);
+ const isArray = this._isArray;
+ const arrayLength = this._arrayLength;
+ const componentCount = MetadataType_default.getComponentCount(this._type);
+ const isNested = isArray && componentCount > 1;
+ if (!isArray && componentCount === 1) {
+ return constant;
+ }
+ if (!isArray) {
+ return new Array(componentCount).fill(constant);
+ }
+ if (!isNested) {
+ return new Array(arrayLength).fill(constant);
+ }
+ if (!enableNestedArrays) {
+ return new Array(this._arrayLength * componentCount).fill(constant);
+ }
+ const innerConstant = new Array(componentCount).fill(constant);
+ return new Array(this._arrayLength).fill(innerConstant);
+};
+MetadataClassProperty.prototype.handleNoData = function(value) {
+ const sentinel = this._noData;
+ if (!defined_default(sentinel)) {
+ return value;
+ }
+ if (arrayEquals(value, sentinel)) {
+ return void 0;
+ }
+ return value;
+};
+function arrayEquals(left, right) {
+ if (!Array.isArray(left)) {
+ return left === right;
+ }
+ if (!Array.isArray(right)) {
+ return false;
+ }
+ if (left.length !== right.length) {
+ return false;
+ }
+ for (let i = 0; i < left.length; i++) {
+ if (!arrayEquals(left[i], right[i])) {
+ return false;
+ }
+ }
+ return true;
+}
+MetadataClassProperty.prototype.unpackVectorAndMatrixTypes = function(value, enableNestedArrays) {
+ enableNestedArrays = defaultValue_default(enableNestedArrays, false);
+ const MathType = MetadataType_default.getMathType(this._type);
+ const isArray = this._isArray;
+ const componentCount = MetadataType_default.getComponentCount(this._type);
+ const isNested = isArray && componentCount > 1;
+ if (!defined_default(MathType)) {
+ return value;
+ }
+ if (enableNestedArrays && isNested) {
+ return value.map(function(x) {
+ return MathType.unpack(x);
+ });
+ }
+ if (isArray) {
+ return MathType.unpackArray(value);
+ }
+ return MathType.unpack(value);
+};
+MetadataClassProperty.prototype.packVectorAndMatrixTypes = function(value, enableNestedArrays) {
+ enableNestedArrays = defaultValue_default(enableNestedArrays, false);
+ const MathType = MetadataType_default.getMathType(this._type);
+ const isArray = this._isArray;
+ const componentCount = MetadataType_default.getComponentCount(this._type);
+ const isNested = isArray && componentCount > 1;
+ if (!defined_default(MathType)) {
+ return value;
+ }
+ if (enableNestedArrays && isNested) {
+ return value.map(function(x) {
+ return MathType.pack(x, []);
+ });
+ }
+ if (isArray) {
+ return MathType.packArray(value, []);
+ }
+ return MathType.pack(value, []);
+};
+MetadataClassProperty.prototype.validate = function(value) {
+ if (!defined_default(value) && defined_default(this._default)) {
+ return void 0;
+ }
+ if (this._required && !defined_default(value)) {
+ return `required property must have a value`;
+ }
+ if (this._isArray) {
+ return validateArray(this, value);
+ }
+ return validateSingleValue(this, value);
+};
+function validateArray(classProperty, value) {
+ if (!Array.isArray(value)) {
+ return `value ${value} must be an array`;
+ }
+ const length3 = value.length;
+ if (!classProperty._isVariableLengthArray && length3 !== classProperty._arrayLength) {
+ return "Array length does not match property.arrayLength";
+ }
+ for (let i = 0; i < length3; i++) {
+ const message = validateSingleValue(classProperty, value[i]);
+ if (defined_default(message)) {
+ return message;
+ }
+ }
+}
+function validateSingleValue(classProperty, value) {
+ const type = classProperty._type;
+ const componentType = classProperty._componentType;
+ const enumType = classProperty._enumType;
+ const normalized = classProperty._normalized;
+ if (MetadataType_default.isVectorType(type)) {
+ return validateVector(value, type, componentType);
+ } else if (MetadataType_default.isMatrixType(type)) {
+ return validateMatrix(value, type, componentType);
+ } else if (type === MetadataType_default.STRING) {
+ return validateString(value);
+ } else if (type === MetadataType_default.BOOLEAN) {
+ return validateBoolean(value);
+ } else if (type === MetadataType_default.ENUM) {
+ return validateEnum(value, enumType);
+ }
+ return validateScalar(value, componentType, normalized);
+}
+function validateVector(value, type, componentType) {
+ if (!MetadataComponentType_default.isVectorCompatible(componentType)) {
+ return `componentType ${componentType} is incompatible with vector type ${type}`;
+ }
+ if (type === MetadataType_default.VEC2 && !(value instanceof Cartesian2_default)) {
+ return `vector value ${value} must be a Cartesian2`;
+ }
+ if (type === MetadataType_default.VEC3 && !(value instanceof Cartesian3_default)) {
+ return `vector value ${value} must be a Cartesian3`;
+ }
+ if (type === MetadataType_default.VEC4 && !(value instanceof Cartesian4_default)) {
+ return `vector value ${value} must be a Cartesian4`;
+ }
+}
+function validateMatrix(value, type, componentType) {
+ if (!MetadataComponentType_default.isVectorCompatible(componentType)) {
+ return `componentType ${componentType} is incompatible with matrix type ${type}`;
+ }
+ if (type === MetadataType_default.MAT2 && !(value instanceof Matrix2_default)) {
+ return `matrix value ${value} must be a Matrix2`;
+ }
+ if (type === MetadataType_default.MAT3 && !(value instanceof Matrix3_default)) {
+ return `matrix value ${value} must be a Matrix3`;
+ }
+ if (type === MetadataType_default.MAT4 && !(value instanceof Matrix4_default)) {
+ return `matrix value ${value} must be a Matrix4`;
+ }
+}
+function validateString(value) {
+ if (typeof value !== "string") {
+ return getTypeErrorMessage(value, MetadataType_default.STRING);
+ }
+}
+function validateBoolean(value) {
+ if (typeof value !== "boolean") {
+ return getTypeErrorMessage(value, MetadataType_default.BOOLEAN);
+ }
+}
+function validateEnum(value, enumType) {
+ const javascriptType = typeof value;
+ if (defined_default(enumType)) {
+ if (javascriptType !== "string" || !defined_default(enumType.valuesByName[value])) {
+ return `value ${value} is not a valid enum name for ${enumType.id}`;
+ }
+ return;
+ }
+}
+function validateScalar(value, componentType, normalized) {
+ const javascriptType = typeof value;
+ switch (componentType) {
+ case MetadataComponentType_default.INT8:
+ case MetadataComponentType_default.UINT8:
+ case MetadataComponentType_default.INT16:
+ case MetadataComponentType_default.UINT16:
+ case MetadataComponentType_default.INT32:
+ case MetadataComponentType_default.UINT32:
+ case MetadataComponentType_default.FLOAT32:
+ case MetadataComponentType_default.FLOAT64:
+ if (javascriptType !== "number") {
+ return getTypeErrorMessage(value, componentType);
+ }
+ if (!isFinite(value)) {
+ return getNonFiniteErrorMessage(value, componentType);
+ }
+ return checkInRange(value, componentType, normalized);
+ case MetadataComponentType_default.INT64:
+ case MetadataComponentType_default.UINT64:
+ if (javascriptType !== "number" && javascriptType !== "bigint") {
+ return getTypeErrorMessage(value, componentType);
+ }
+ if (javascriptType === "number" && !isFinite(value)) {
+ return getNonFiniteErrorMessage(value, componentType);
+ }
+ return checkInRange(value, componentType, normalized);
+ }
+}
+function getTypeErrorMessage(value, type) {
+ return `value ${value} does not match type ${type}`;
+}
+function getOutOfRangeErrorMessage(value, type, normalized) {
+ let errorMessage = `value ${value} is out of range for type ${type}`;
+ if (normalized) {
+ errorMessage += " (normalized)";
+ }
+ return errorMessage;
+}
+function checkInRange(value, componentType, normalized) {
+ if (normalized) {
+ const min3 = MetadataComponentType_default.isUnsignedIntegerType(componentType) ? 0 : -1;
+ const max3 = 1;
+ if (value < min3 || value > max3) {
+ return getOutOfRangeErrorMessage(value, componentType, normalized);
+ }
+ return;
+ }
+ if (value < MetadataComponentType_default.getMinimum(componentType) || value > MetadataComponentType_default.getMaximum(componentType)) {
+ return getOutOfRangeErrorMessage(value, componentType, normalized);
+ }
+}
+function getNonFiniteErrorMessage(value, type) {
+ return `value ${value} of type ${type} must be finite`;
+}
+function normalizeInPlace(values, valueType, normalizeFunction) {
+ if (!Array.isArray(values)) {
+ return normalizeFunction(values, valueType);
+ }
+ for (let i = 0; i < values.length; i++) {
+ values[i] = normalizeInPlace(values[i], valueType, normalizeFunction);
+ }
+ return values;
+}
+MetadataClassProperty.valueTransformInPlace = function(values, offsets, scales, transformationFunction) {
+ if (!Array.isArray(values)) {
+ return transformationFunction(values, offsets, scales);
+ }
+ for (let i = 0; i < values.length; i++) {
+ values[i] = MetadataClassProperty.valueTransformInPlace(
+ values[i],
+ offsets[i],
+ scales[i],
+ transformationFunction
+ );
+ }
+ return values;
+};
+var MetadataClassProperty_default = MetadataClassProperty;
+
+// Source/Scene/MetadataTableProperty.js
+function MetadataTableProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const count = options.count;
+ const property = options.property;
+ const classProperty = options.classProperty;
+ const bufferViews = options.bufferViews;
+ Check_default.typeOf.number.greaterThan("options.count", count, 0);
+ Check_default.typeOf.object("options.property", property);
+ Check_default.typeOf.object("options.classProperty", classProperty);
+ Check_default.typeOf.object("options.bufferViews", bufferViews);
+ const type = classProperty.type;
+ const isArray = classProperty.isArray;
+ const isVariableLengthArray = classProperty.isVariableLengthArray;
+ let valueType = classProperty.valueType;
+ const enumType = classProperty.enumType;
+ const hasStrings = type === MetadataType_default.STRING;
+ const hasBooleans = type === MetadataType_default.BOOLEAN;
+ let byteLength = 0;
+ let arrayOffsets;
+ if (isVariableLengthArray) {
+ let arrayOffsetType = defaultValue_default(
+ property.arrayOffsetType,
+ property.offsetType
+ );
+ arrayOffsetType = defaultValue_default(
+ MetadataComponentType_default[arrayOffsetType],
+ MetadataComponentType_default.UINT32
+ );
+ const arrayOffsetBufferView = defaultValue_default(
+ property.arrayOffsets,
+ property.arrayOffsetBufferView
+ );
+ arrayOffsets = new BufferView(
+ bufferViews[arrayOffsetBufferView],
+ arrayOffsetType,
+ count + 1
+ );
+ byteLength += arrayOffsets.typedArray.byteLength;
+ }
+ const vectorComponentCount = MetadataType_default.getComponentCount(type);
+ let arrayComponentCount;
+ if (isVariableLengthArray) {
+ arrayComponentCount = arrayOffsets.get(count) - arrayOffsets.get(0);
+ } else if (isArray) {
+ arrayComponentCount = count * classProperty.arrayLength;
+ } else {
+ arrayComponentCount = count;
+ }
+ const componentCount = vectorComponentCount * arrayComponentCount;
+ let stringOffsets;
+ if (hasStrings) {
+ let stringOffsetType = defaultValue_default(
+ property.stringOffsetType,
+ property.offsetType
+ );
+ stringOffsetType = defaultValue_default(
+ MetadataComponentType_default[stringOffsetType],
+ MetadataComponentType_default.UINT32
+ );
+ const stringOffsetBufferView = defaultValue_default(
+ property.stringOffsets,
+ property.stringOffsetBufferView
+ );
+ stringOffsets = new BufferView(
+ bufferViews[stringOffsetBufferView],
+ stringOffsetType,
+ componentCount + 1
+ );
+ byteLength += stringOffsets.typedArray.byteLength;
+ }
+ if (hasStrings || hasBooleans) {
+ valueType = MetadataComponentType_default.UINT8;
+ }
+ let valueCount;
+ if (hasStrings) {
+ valueCount = stringOffsets.get(componentCount) - stringOffsets.get(0);
+ } else if (hasBooleans) {
+ valueCount = Math.ceil(componentCount / 8);
+ } else {
+ valueCount = componentCount;
+ }
+ const valuesBufferView = defaultValue_default(property.values, property.bufferView);
+ const values = new BufferView(
+ bufferViews[valuesBufferView],
+ valueType,
+ valueCount
+ );
+ byteLength += values.typedArray.byteLength;
+ let offset2 = property.offset;
+ let scale = property.scale;
+ const hasValueTransform = classProperty.hasValueTransform || defined_default(offset2) || defined_default(scale);
+ offset2 = defaultValue_default(offset2, classProperty.offset);
+ scale = defaultValue_default(scale, classProperty.scale);
+ offset2 = flatten(offset2);
+ scale = flatten(scale);
+ let getValueFunction;
+ let setValueFunction;
+ const that = this;
+ if (hasStrings) {
+ getValueFunction = function(index) {
+ return getString(index, that._values, that._stringOffsets);
+ };
+ } else if (hasBooleans) {
+ getValueFunction = function(index) {
+ return getBoolean(index, that._values);
+ };
+ setValueFunction = function(index, value) {
+ setBoolean(index, that._values, value);
+ };
+ } else if (defined_default(enumType)) {
+ getValueFunction = function(index) {
+ const integer = that._values.get(index);
+ return enumType.namesByValue[integer];
+ };
+ setValueFunction = function(index, value) {
+ const integer = enumType.valuesByName[value];
+ that._values.set(index, integer);
+ };
+ } else {
+ getValueFunction = function(index) {
+ return that._values.get(index);
+ };
+ setValueFunction = function(index, value) {
+ that._values.set(index, value);
+ };
+ }
+ this._arrayOffsets = arrayOffsets;
+ this._stringOffsets = stringOffsets;
+ this._values = values;
+ this._classProperty = classProperty;
+ this._count = count;
+ this._vectorComponentCount = vectorComponentCount;
+ this._min = property.min;
+ this._max = property.max;
+ this._offset = offset2;
+ this._scale = scale;
+ this._hasValueTransform = hasValueTransform;
+ this._getValue = getValueFunction;
+ this._setValue = setValueFunction;
+ this._unpackedValues = void 0;
+ this._extras = property.extras;
+ this._extensions = property.extensions;
+ this._byteLength = byteLength;
+}
+Object.defineProperties(MetadataTableProperty.prototype, {
+ hasValueTransform: {
+ get: function() {
+ return this._hasValueTransform;
+ }
+ },
+ offset: {
+ get: function() {
+ return this._offset;
+ }
+ },
+ scale: {
+ get: function() {
+ return this._scale;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ },
+ byteLength: {
+ get: function() {
+ return this._byteLength;
+ }
+ }
+});
+MetadataTableProperty.prototype.get = function(index) {
+ checkIndex(this, index);
+ let value = get(this, index);
+ value = this._classProperty.handleNoData(value);
+ if (!defined_default(value)) {
+ value = this._classProperty.default;
+ return this._classProperty.unpackVectorAndMatrixTypes(value);
+ }
+ value = this._classProperty.normalize(value);
+ value = applyValueTransform(this, value);
+ return this._classProperty.unpackVectorAndMatrixTypes(value);
+};
+MetadataTableProperty.prototype.set = function(index, value) {
+ const classProperty = this._classProperty;
+ Check_default.defined("value", value);
+ checkIndex(this, index);
+ const errorMessage = classProperty.validate(value);
+ if (defined_default(errorMessage)) {
+ throw new DeveloperError_default(errorMessage);
+ }
+ value = classProperty.packVectorAndMatrixTypes(value);
+ value = unapplyValueTransform(this, value);
+ value = classProperty.unnormalize(value);
+ set(this, index, value);
+};
+MetadataTableProperty.prototype.getTypedArray = function() {
+ if (defined_default(this._values)) {
+ return this._values.typedArray;
+ }
+ return void 0;
+};
+function flatten(values) {
+ if (!Array.isArray(values)) {
+ return values;
+ }
+ const result = [];
+ for (let i = 0; i < values.length; i++) {
+ const value = values[i];
+ if (Array.isArray(value)) {
+ result.push.apply(result, value);
+ } else {
+ result.push(value);
+ }
+ }
+ return result;
+}
+function checkIndex(table2, index) {
+ const count = table2._count;
+ if (!defined_default(index) || index < 0 || index >= count) {
+ const maximumIndex = count - 1;
+ throw new DeveloperError_default(
+ `index is required and between zero and count - 1. Actual value: ${maximumIndex}`
+ );
+ }
+}
+function get(property, index) {
+ if (requiresUnpackForGet(property)) {
+ unpackProperty(property);
+ }
+ const classProperty = property._classProperty;
+ const isArray = classProperty.isArray;
+ const type = classProperty.type;
+ const componentCount = MetadataType_default.getComponentCount(type);
+ if (defined_default(property._unpackedValues)) {
+ const value = property._unpackedValues[index];
+ if (isArray) {
+ return clone_default(value, true);
+ }
+ return value;
+ }
+ if (!isArray && componentCount === 1) {
+ return property._getValue(index);
+ }
+ return getArrayValues(property, classProperty, index);
+}
+function getArrayValues(property, classProperty, index) {
+ let offset2;
+ let length3;
+ if (classProperty.isVariableLengthArray) {
+ offset2 = property._arrayOffsets.get(index);
+ length3 = property._arrayOffsets.get(index + 1) - offset2;
+ const componentCount = MetadataType_default.getComponentCount(classProperty.type);
+ offset2 *= componentCount;
+ length3 *= componentCount;
+ } else {
+ const arrayLength = defaultValue_default(classProperty.arrayLength, 1);
+ const componentCount = arrayLength * property._vectorComponentCount;
+ offset2 = index * componentCount;
+ length3 = componentCount;
+ }
+ const values = new Array(length3);
+ for (let i = 0; i < length3; i++) {
+ values[i] = property._getValue(offset2 + i);
+ }
+ return values;
+}
+function set(property, index, value) {
+ if (requiresUnpackForSet(property, index, value)) {
+ unpackProperty(property);
+ }
+ const classProperty = property._classProperty;
+ const isArray = classProperty.isArray;
+ const type = classProperty.type;
+ const componentCount = MetadataType_default.getComponentCount(type);
+ if (defined_default(property._unpackedValues)) {
+ if (classProperty.isArray) {
+ value = clone_default(value, true);
+ }
+ property._unpackedValues[index] = value;
+ return;
+ }
+ if (!isArray && componentCount === 1) {
+ property._setValue(index, value);
+ return;
+ }
+ let offset2;
+ let length3;
+ if (classProperty.isVariableLengthArray) {
+ offset2 = property._arrayOffsets.get(index);
+ length3 = property._arrayOffsets.get(index + 1) - offset2;
+ } else {
+ const arrayLength = defaultValue_default(classProperty.arrayLength, 1);
+ const componentCount2 = arrayLength * property._vectorComponentCount;
+ offset2 = index * componentCount2;
+ length3 = componentCount2;
+ }
+ for (let i = 0; i < length3; ++i) {
+ property._setValue(offset2 + i, value[i]);
+ }
+}
+function getString(index, values, stringOffsets) {
+ const stringByteOffset = stringOffsets.get(index);
+ const stringByteLength = stringOffsets.get(index + 1) - stringByteOffset;
+ return getStringFromTypedArray_default(
+ values.typedArray,
+ stringByteOffset,
+ stringByteLength
+ );
+}
+function getBoolean(index, values) {
+ const byteIndex = index >> 3;
+ const bitIndex = index % 8;
+ return (values.typedArray[byteIndex] >> bitIndex & 1) === 1;
+}
+function setBoolean(index, values, value) {
+ const byteIndex = index >> 3;
+ const bitIndex = index % 8;
+ if (value) {
+ values.typedArray[byteIndex] |= 1 << bitIndex;
+ } else {
+ values.typedArray[byteIndex] &= ~(1 << bitIndex);
+ }
+}
+function getInt64NumberFallback(index, values) {
+ const dataView = values.dataView;
+ const byteOffset = index * 8;
+ let value = 0;
+ const isNegative = (dataView.getUint8(byteOffset + 7) & 128) > 0;
+ let carrying = true;
+ for (let i = 0; i < 8; ++i) {
+ let byte = dataView.getUint8(byteOffset + i);
+ if (isNegative) {
+ if (carrying) {
+ if (byte !== 0) {
+ byte = ~(byte - 1) & 255;
+ carrying = false;
+ }
+ } else {
+ byte = ~byte & 255;
+ }
+ }
+ value += byte * Math.pow(256, i);
+ }
+ if (isNegative) {
+ value = -value;
+ }
+ return value;
+}
+function getInt64BigIntFallback(index, values) {
+ const dataView = values.dataView;
+ const byteOffset = index * 8;
+ let value = BigInt(0);
+ const isNegative = (dataView.getUint8(byteOffset + 7) & 128) > 0;
+ let carrying = true;
+ for (let i = 0; i < 8; ++i) {
+ let byte = dataView.getUint8(byteOffset + i);
+ if (isNegative) {
+ if (carrying) {
+ if (byte !== 0) {
+ byte = ~(byte - 1) & 255;
+ carrying = false;
+ }
+ } else {
+ byte = ~byte & 255;
+ }
+ }
+ value += BigInt(byte) * (BigInt(1) << BigInt(i * 8));
+ }
+ if (isNegative) {
+ value = -value;
+ }
+ return value;
+}
+function getUint64NumberFallback(index, values) {
+ const dataView = values.dataView;
+ const byteOffset = index * 8;
+ const left = dataView.getUint32(byteOffset, true);
+ const right = dataView.getUint32(byteOffset + 4, true);
+ const value = left + 4294967296 * right;
+ return value;
+}
+function getUint64BigIntFallback(index, values) {
+ const dataView = values.dataView;
+ const byteOffset = index * 8;
+ const left = BigInt(dataView.getUint32(byteOffset, true));
+ const right = BigInt(dataView.getUint32(byteOffset + 4, true));
+ const value = left + BigInt(4294967296) * right;
+ return value;
+}
+function getComponentDatatype(componentType) {
+ switch (componentType) {
+ case MetadataComponentType_default.INT8:
+ return ComponentDatatype_default.BYTE;
+ case MetadataComponentType_default.UINT8:
+ return ComponentDatatype_default.UNSIGNED_BYTE;
+ case MetadataComponentType_default.INT16:
+ return ComponentDatatype_default.SHORT;
+ case MetadataComponentType_default.UINT16:
+ return ComponentDatatype_default.UNSIGNED_SHORT;
+ case MetadataComponentType_default.INT32:
+ return ComponentDatatype_default.INT;
+ case MetadataComponentType_default.UINT32:
+ return ComponentDatatype_default.UNSIGNED_INT;
+ case MetadataComponentType_default.FLOAT32:
+ return ComponentDatatype_default.FLOAT;
+ case MetadataComponentType_default.FLOAT64:
+ return ComponentDatatype_default.DOUBLE;
+ }
+}
+function requiresUnpackForGet(property) {
+ if (defined_default(property._unpackedValues)) {
+ return false;
+ }
+ const classProperty = property._classProperty;
+ const type = classProperty.type;
+ const valueType = classProperty.valueType;
+ if (type === MetadataType_default.STRING) {
+ return true;
+ }
+ if (valueType === MetadataComponentType_default.INT64 && !FeatureDetection_default.supportsBigInt64Array()) {
+ return true;
+ }
+ if (valueType === MetadataComponentType_default.UINT64 && !FeatureDetection_default.supportsBigUint64Array()) {
+ return true;
+ }
+ return false;
+}
+function requiresUnpackForSet(property, index, value) {
+ if (requiresUnpackForGet(property)) {
+ return true;
+ }
+ const arrayOffsets = property._arrayOffsets;
+ if (defined_default(arrayOffsets)) {
+ const oldLength = arrayOffsets.get(index + 1) - arrayOffsets.get(index);
+ const newLength = value.length;
+ if (oldLength !== newLength) {
+ return true;
+ }
+ }
+ return false;
+}
+function unpackProperty(property) {
+ property._unpackedValues = unpackValues(property);
+ property._arrayOffsets = void 0;
+ property._stringOffsets = void 0;
+ property._values = void 0;
+}
+function unpackValues(property) {
+ const count = property._count;
+ const unpackedValues = new Array(count);
+ const classProperty = property._classProperty;
+ const isArray = classProperty.isArray;
+ const type = classProperty.type;
+ const componentCount = MetadataType_default.getComponentCount(type);
+ if (!isArray && componentCount === 1) {
+ for (let i = 0; i < count; ++i) {
+ unpackedValues[i] = property._getValue(i);
+ }
+ return unpackedValues;
+ }
+ for (let i = 0; i < count; i++) {
+ unpackedValues[i] = getArrayValues(property, classProperty, i);
+ }
+ return unpackedValues;
+}
+function applyValueTransform(property, value) {
+ const classProperty = property._classProperty;
+ const isVariableLengthArray = classProperty.isVariableLengthArray;
+ if (!property._hasValueTransform || isVariableLengthArray) {
+ return value;
+ }
+ return MetadataClassProperty_default.valueTransformInPlace(
+ value,
+ property._offset,
+ property._scale,
+ MetadataComponentType_default.applyValueTransform
+ );
+}
+function unapplyValueTransform(property, value) {
+ const classProperty = property._classProperty;
+ const isVariableLengthArray = classProperty.isVariableLengthArray;
+ if (!property._hasValueTransform || isVariableLengthArray) {
+ return value;
+ }
+ return MetadataClassProperty_default.valueTransformInPlace(
+ value,
+ property._offset,
+ property._scale,
+ MetadataComponentType_default.unapplyValueTransform
+ );
+}
+function BufferView(bufferView, componentType, length3) {
+ const that = this;
+ let typedArray;
+ let getFunction;
+ let setFunction;
+ if (componentType === MetadataComponentType_default.INT64) {
+ if (!FeatureDetection_default.supportsBigInt()) {
+ oneTimeWarning_default(
+ "INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."
+ );
+ typedArray = new Uint8Array(
+ bufferView.buffer,
+ bufferView.byteOffset,
+ length3 * 8
+ );
+ getFunction = function(index) {
+ return getInt64NumberFallback(index, that);
+ };
+ } else if (!FeatureDetection_default.supportsBigInt64Array()) {
+ typedArray = new Uint8Array(
+ bufferView.buffer,
+ bufferView.byteOffset,
+ length3 * 8
+ );
+ getFunction = function(index) {
+ return getInt64BigIntFallback(index, that);
+ };
+ } else {
+ typedArray = new BigInt64Array(
+ bufferView.buffer,
+ bufferView.byteOffset,
+ length3
+ );
+ setFunction = function(index, value) {
+ that.typedArray[index] = BigInt(value);
+ };
+ }
+ } else if (componentType === MetadataComponentType_default.UINT64) {
+ if (!FeatureDetection_default.supportsBigInt()) {
+ oneTimeWarning_default(
+ "UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."
+ );
+ typedArray = new Uint8Array(
+ bufferView.buffer,
+ bufferView.byteOffset,
+ length3 * 8
+ );
+ getFunction = function(index) {
+ return getUint64NumberFallback(index, that);
+ };
+ } else if (!FeatureDetection_default.supportsBigUint64Array()) {
+ typedArray = new Uint8Array(
+ bufferView.buffer,
+ bufferView.byteOffset,
+ length3 * 8
+ );
+ getFunction = function(index) {
+ return getUint64BigIntFallback(index, that);
+ };
+ } else {
+ typedArray = new BigUint64Array(
+ bufferView.buffer,
+ bufferView.byteOffset,
+ length3
+ );
+ setFunction = function(index, value) {
+ that.typedArray[index] = BigInt(value);
+ };
+ }
+ } else {
+ const componentDatatype = getComponentDatatype(componentType);
+ typedArray = ComponentDatatype_default.createArrayBufferView(
+ componentDatatype,
+ bufferView.buffer,
+ bufferView.byteOffset,
+ length3
+ );
+ setFunction = function(index, value) {
+ that.typedArray[index] = value;
+ };
+ }
+ if (!defined_default(getFunction)) {
+ getFunction = function(index) {
+ return that.typedArray[index];
+ };
+ }
+ this.typedArray = typedArray;
+ this.dataView = new DataView(typedArray.buffer, typedArray.byteOffset);
+ this.get = getFunction;
+ this.set = setFunction;
+ this._componentType = componentType;
+}
+var MetadataTableProperty_default = MetadataTableProperty;
+
+// Source/Scene/MetadataTable.js
+function MetadataTable(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const count = options.count;
+ const metadataClass = options.class;
+ Check_default.typeOf.number.greaterThan("options.count", count, 0);
+ Check_default.typeOf.object("options.class", metadataClass);
+ let byteLength = 0;
+ const properties = {};
+ if (defined_default(options.properties)) {
+ for (const propertyId in options.properties) {
+ if (options.properties.hasOwnProperty(propertyId)) {
+ const property = new MetadataTableProperty_default({
+ count,
+ property: options.properties[propertyId],
+ classProperty: metadataClass.properties[propertyId],
+ bufferViews: options.bufferViews
+ });
+ properties[propertyId] = property;
+ byteLength += property.byteLength;
+ }
+ }
+ }
+ this._count = count;
+ this._class = metadataClass;
+ this._properties = properties;
+ this._byteLength = byteLength;
+}
+Object.defineProperties(MetadataTable.prototype, {
+ count: {
+ get: function() {
+ return this._count;
+ }
+ },
+ class: {
+ get: function() {
+ return this._class;
+ }
+ },
+ byteLength: {
+ get: function() {
+ return this._byteLength;
+ }
+ }
+});
+MetadataTable.prototype.hasProperty = function(propertyId) {
+ return MetadataEntity_default.hasProperty(propertyId, this._properties, this._class);
+};
+MetadataTable.prototype.hasPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.hasPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+MetadataTable.prototype.getPropertyIds = function(results) {
+ return MetadataEntity_default.getPropertyIds(this._properties, this._class, results);
+};
+MetadataTable.prototype.getProperty = function(index, propertyId) {
+ Check_default.typeOf.string("propertyId", propertyId);
+ const property = this._properties[propertyId];
+ let value;
+ if (defined_default(property)) {
+ value = property.get(index);
+ } else {
+ value = getDefault(this._class, propertyId);
+ }
+ return value;
+};
+MetadataTable.prototype.setProperty = function(index, propertyId, value) {
+ Check_default.typeOf.string("propertyId", propertyId);
+ const property = this._properties[propertyId];
+ if (defined_default(property)) {
+ property.set(index, value);
+ return true;
+ }
+ return false;
+};
+MetadataTable.prototype.getPropertyBySemantic = function(index, semantic) {
+ Check_default.typeOf.string("semantic", semantic);
+ let property;
+ const propertiesBySemantic = this._class.propertiesBySemantic;
+ if (defined_default(propertiesBySemantic)) {
+ property = propertiesBySemantic[semantic];
+ }
+ if (defined_default(property)) {
+ return this.getProperty(index, property.id);
+ }
+ return void 0;
+};
+MetadataTable.prototype.setPropertyBySemantic = function(index, semantic, value) {
+ Check_default.typeOf.string("semantic", semantic);
+ let property;
+ const propertiesBySemantic = this._class.propertiesBySemantic;
+ if (defined_default(propertiesBySemantic)) {
+ property = propertiesBySemantic[semantic];
+ }
+ if (defined_default(property)) {
+ return this.setProperty(index, property.id, value);
+ }
+ return false;
+};
+MetadataTable.prototype.getPropertyTypedArray = function(propertyId) {
+ Check_default.typeOf.string("propertyId", propertyId);
+ const property = this._properties[propertyId];
+ if (defined_default(property)) {
+ return property.getTypedArray();
+ }
+ return void 0;
+};
+MetadataTable.prototype.getPropertyTypedArrayBySemantic = function(semantic) {
+ Check_default.typeOf.string("semantic", semantic);
+ let property;
+ const propertiesBySemantic = this._class.propertiesBySemantic;
+ if (defined_default(propertiesBySemantic)) {
+ property = propertiesBySemantic[semantic];
+ }
+ if (defined_default(property)) {
+ return this.getPropertyTypedArray(property.id);
+ }
+ return void 0;
+};
+function getDefault(classDefinition, propertyId) {
+ const classProperties = classDefinition.properties;
+ if (!defined_default(classProperties)) {
+ return void 0;
+ }
+ const classProperty = classProperties[propertyId];
+ if (defined_default(classProperty) && defined_default(classProperty.default)) {
+ let value = classProperty.default;
+ if (classProperty.isArray) {
+ value = clone_default(value, true);
+ }
+ value = classProperty.normalize(value);
+ return classProperty.unpackVectorAndMatrixTypes(value);
+ }
+}
+var MetadataTable_default = MetadataTable;
+
+// Source/Scene/ResourceLoader.js
+function ResourceLoader() {
+}
+Object.defineProperties(ResourceLoader.prototype, {
+ promise: {
+ get: function() {
+ DeveloperError_default.throwInstantiationError();
+ }
+ },
+ cacheKey: {
+ get: function() {
+ DeveloperError_default.throwInstantiationError();
+ }
+ }
+});
+ResourceLoader.prototype.load = function() {
+ DeveloperError_default.throwInstantiationError();
+};
+ResourceLoader.prototype.unload = function() {
+};
+ResourceLoader.prototype.process = function(frameState) {
+};
+ResourceLoader.prototype.getError = function(errorMessage, error) {
+ Check_default.typeOf.string("errorMessage", errorMessage);
+ if (defined_default(error)) {
+ errorMessage += `
+${error.message}`;
+ }
+ const runtimeError = new RuntimeError_default(errorMessage);
+ if (defined_default(error)) {
+ runtimeError.stack = `Original stack:
+${error.stack}
+Handler stack:
+${runtimeError.stack}`;
+ }
+ return runtimeError;
+};
+ResourceLoader.prototype.isDestroyed = function() {
+ return false;
+};
+ResourceLoader.prototype.destroy = function() {
+ this.unload();
+ return destroyObject_default(this);
+};
+var ResourceLoader_default = ResourceLoader;
+
+// Source/Scene/ResourceLoaderState.js
+var ResourceLoaderState = {
+ UNLOADED: 0,
+ LOADING: 1,
+ PROCESSING: 2,
+ READY: 3,
+ FAILED: 4
+};
+var ResourceLoaderState_default = Object.freeze(ResourceLoaderState);
+
+// Source/Scene/BufferLoader.js
+function BufferLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const typedArray = options.typedArray;
+ const resource = options.resource;
+ const cacheKey = options.cacheKey;
+ if (defined_default(typedArray) === defined_default(resource)) {
+ throw new DeveloperError_default(
+ "One of options.typedArray and options.resource must be defined."
+ );
+ }
+ this._typedArray = typedArray;
+ this._resource = resource;
+ this._cacheKey = cacheKey;
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._promise = void 0;
+}
+if (defined_default(Object.create)) {
+ BufferLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ BufferLoader.prototype.constructor = BufferLoader;
+}
+Object.defineProperties(BufferLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return this._cacheKey;
+ }
+ },
+ typedArray: {
+ get: function() {
+ return this._typedArray;
+ }
+ }
+});
+BufferLoader.prototype.load = function() {
+ if (defined_default(this._typedArray)) {
+ this._promise = Promise.resolve(this);
+ } else {
+ this._promise = loadExternalBuffer(this);
+ }
+ return this._promise;
+};
+function loadExternalBuffer(bufferLoader) {
+ const resource = bufferLoader._resource;
+ bufferLoader._state = ResourceLoaderState_default.LOADING;
+ return BufferLoader._fetchArrayBuffer(resource).then(function(arrayBuffer) {
+ if (bufferLoader.isDestroyed()) {
+ return;
+ }
+ bufferLoader._typedArray = new Uint8Array(arrayBuffer);
+ bufferLoader._state = ResourceLoaderState_default.READY;
+ return bufferLoader;
+ }).catch(function(error) {
+ if (bufferLoader.isDestroyed()) {
+ return;
+ }
+ bufferLoader._state = ResourceLoaderState_default.FAILED;
+ const errorMessage = `Failed to load external buffer: ${resource.url}`;
+ return Promise.reject(bufferLoader.getError(errorMessage, error));
+ });
+}
+BufferLoader._fetchArrayBuffer = function(resource) {
+ return resource.fetchArrayBuffer();
+};
+BufferLoader.prototype.unload = function() {
+ this._typedArray = void 0;
+};
+var BufferLoader_default = BufferLoader;
+
+// node_modules/meshoptimizer/meshopt_encoder.module.js
+var MeshoptEncoder = function() {
+ "use strict";
+ var wasm = "B9h79tEBBBENQ9gEUEU9gEUB9gBB9gVUUUUUEU9gDUUEU9gLUUUUEU9gVUUUUUB9gLUUUUB9gIUUUEU9gD99UE99I8ayDILEVLEVLOOOOORRVBWWBEdddLVE9wEIIVIEBEOWEUEC+g/KEKR/QIhO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwvBE8f9tw79o9v9wT9fw9u9j9v9kw9WwvTw949C919m9mwv9C9v919u9kBDe9tw79o9v9wT9fw9u9j9v9kw9WwvTw949Wwv79p9v9uBIy9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwvBL8e9tw79o9v9wT9fw9u9j9v9kw69u9kw949C919m9mwv9C9v919u9kBV8a9tw79o9v9wT9fw9u9j9v9kw69u9kw949Wwv79p9v9uBOe9tw79o9v9wT9fw9u9j9v9kw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+EDB4+H9W9n94+p+Gw+J9o+YE9pBBBBBBEBBBDBBBEBBBDBBBBBBBDBBBBBBBEBBBBBBB+L29Hz/69+9Kz/n/76z/RG97z/Z/O9Xz8j/b85z/+/U9Yz/B/K9hz+2/z9dz9E+L9Mz59a8kz+R/t3z+a+Zyz79ohz/J4++8++y+d9v8+BBBB9S+49+z8r+Hbz9m9m/m8+l/Z/O8+/8+pg89Q/X+j878r+Hq8++m+b/E87BBBBBBJzBBJzBBJz+e/v/n8++y+dSz9I/h/68+XD/r8+/H0838+/w+nOzBBBB+wv9o8+UF888+9I/h/68+9C9g/l89/N/M9M89/d8kO8+BBBBF+8Tz9M836zs+2azl/Zpzz818ez9E+LXz/u98f8+819e/68+BC+EQKXEBBBDBBBAwBB";
+ var wasmpack = new Uint8Array([32, 0, 65, 2, 1, 106, 34, 33, 3, 128, 11, 4, 13, 64, 6, 253, 10, 7, 15, 116, 127, 5, 8, 12, 40, 16, 19, 54, 20, 9, 27, 255, 113, 17, 42, 67, 24, 23, 146, 148, 18, 14, 22, 45, 70, 69, 56, 114, 101, 21, 25, 63, 75, 136, 108, 28, 118, 29, 73, 115]);
+ if (typeof WebAssembly !== "object") {
+ return {
+ supported: false
+ };
+ }
+ var instance;
+ var promise = WebAssembly.instantiate(unpack(wasm), {}).then(function(result) {
+ instance = result.instance;
+ instance.exports.__wasm_call_ctors();
+ instance.exports.meshopt_encodeVertexVersion(0);
+ instance.exports.meshopt_encodeIndexVersion(1);
+ });
+ function unpack(data) {
+ var result = new Uint8Array(data.length);
+ for (var i = 0; i < data.length; ++i) {
+ var ch = data.charCodeAt(i);
+ result[i] = ch > 96 ? ch - 71 : ch > 64 ? ch - 65 : ch > 47 ? ch + 4 : ch > 46 ? 63 : 62;
+ }
+ var write = 0;
+ for (var i = 0; i < data.length; ++i) {
+ result[write++] = result[i] < 60 ? wasmpack[result[i]] : (result[i] - 60) * 64 + result[++i];
+ }
+ return result.buffer.slice(0, write);
+ }
+ function assert(cond) {
+ if (!cond) {
+ throw new Error("Assertion failed");
+ }
+ }
+ function bytes(view) {
+ return new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
+ }
+ function reorder(indices2, vertices, optf) {
+ var sbrk = instance.exports.sbrk;
+ var ip = sbrk(indices2.length * 4);
+ var rp = sbrk(vertices * 4);
+ var heap = new Uint8Array(instance.exports.memory.buffer);
+ var indices8 = bytes(indices2);
+ heap.set(indices8, ip);
+ if (optf) {
+ optf(ip, ip, indices2.length, vertices);
+ }
+ var unique = instance.exports.meshopt_optimizeVertexFetchRemap(rp, ip, indices2.length, vertices);
+ heap = new Uint8Array(instance.exports.memory.buffer);
+ var remap = new Uint32Array(vertices);
+ new Uint8Array(remap.buffer).set(heap.subarray(rp, rp + vertices * 4));
+ indices8.set(heap.subarray(ip, ip + indices2.length * 4));
+ sbrk(ip - sbrk(0));
+ for (var i = 0; i < indices2.length; ++i)
+ indices2[i] = remap[indices2[i]];
+ return [remap, unique];
+ }
+ function encode(fun, bound, source, count, size) {
+ var sbrk = instance.exports.sbrk;
+ var tp = sbrk(bound);
+ var sp = sbrk(count * size);
+ var heap = new Uint8Array(instance.exports.memory.buffer);
+ heap.set(bytes(source), sp);
+ var res = fun(tp, bound, sp, count, size);
+ var target = new Uint8Array(res);
+ target.set(heap.subarray(tp, tp + res));
+ sbrk(tp - sbrk(0));
+ return target;
+ }
+ function maxindex(source) {
+ var result = 0;
+ for (var i = 0; i < source.length; ++i) {
+ var index = source[i];
+ result = result < index ? index : result;
+ }
+ return result;
+ }
+ function index32(source, size) {
+ assert(size == 2 || size == 4);
+ if (size == 4) {
+ return new Uint32Array(source.buffer, source.byteOffset, source.byteLength / 4);
+ } else {
+ var view = new Uint16Array(source.buffer, source.byteOffset, source.byteLength / 2);
+ return new Uint32Array(view);
+ }
+ }
+ function filter(fun, source, count, stride, bits, insize) {
+ var sbrk = instance.exports.sbrk;
+ var tp = sbrk(count * stride);
+ var sp = sbrk(count * insize);
+ var heap = new Uint8Array(instance.exports.memory.buffer);
+ heap.set(bytes(source), sp);
+ fun(tp, count, stride, bits, sp);
+ var target = new Uint8Array(count * stride);
+ target.set(heap.subarray(tp, tp + count * stride));
+ sbrk(tp - sbrk(0));
+ return target;
+ }
+ return {
+ ready: promise,
+ supported: true,
+ reorderMesh: function(indices2, triangles, optsize) {
+ var optf = triangles ? optsize ? instance.exports.meshopt_optimizeVertexCacheStrip : instance.exports.meshopt_optimizeVertexCache : void 0;
+ return reorder(indices2, maxindex(indices2) + 1, optf);
+ },
+ encodeVertexBuffer: function(source, count, size) {
+ assert(size > 0 && size <= 256);
+ assert(size % 4 == 0);
+ var bound = instance.exports.meshopt_encodeVertexBufferBound(count, size);
+ return encode(instance.exports.meshopt_encodeVertexBuffer, bound, source, count, size);
+ },
+ encodeIndexBuffer: function(source, count, size) {
+ assert(size == 2 || size == 4);
+ assert(count % 3 == 0);
+ var indices2 = index32(source, size);
+ var bound = instance.exports.meshopt_encodeIndexBufferBound(count, maxindex(indices2) + 1);
+ return encode(instance.exports.meshopt_encodeIndexBuffer, bound, indices2, count, 4);
+ },
+ encodeIndexSequence: function(source, count, size) {
+ assert(size == 2 || size == 4);
+ var indices2 = index32(source, size);
+ var bound = instance.exports.meshopt_encodeIndexSequenceBound(count, maxindex(indices2) + 1);
+ return encode(instance.exports.meshopt_encodeIndexSequence, bound, indices2, count, 4);
+ },
+ encodeGltfBuffer: function(source, count, size, mode2) {
+ var table2 = {
+ ATTRIBUTES: this.encodeVertexBuffer,
+ TRIANGLES: this.encodeIndexBuffer,
+ INDICES: this.encodeIndexSequence
+ };
+ assert(table2[mode2]);
+ return table2[mode2](source, count, size);
+ },
+ encodeFilterOct: function(source, count, stride, bits) {
+ assert(stride == 4 || stride == 8);
+ assert(bits >= 1 && bits <= 16);
+ return filter(instance.exports.meshopt_encodeFilterOct, source, count, stride, bits, 16);
+ },
+ encodeFilterQuat: function(source, count, stride, bits) {
+ assert(stride == 8);
+ assert(bits >= 4 && bits <= 16);
+ return filter(instance.exports.meshopt_encodeFilterQuat, source, count, stride, bits, 16);
+ },
+ encodeFilterExp: function(source, count, stride, bits) {
+ assert(stride > 0 && stride % 4 == 0);
+ assert(bits >= 1 && bits <= 24);
+ return filter(instance.exports.meshopt_encodeFilterExp, source, count, stride, bits, stride);
+ }
+ };
+}();
+
+// node_modules/meshoptimizer/meshopt_decoder.module.js
+var MeshoptDecoder = function() {
+ "use strict";
+ var wasm_base = "B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+p8yQDBK/3SEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uHOAICEFHLDNADtMBAOC/wfBgGOCJDAOCJD6eHdCBHQINAQAE9PMEAdAEAQ9rAQAdFAE6eGKCSFGOCL4CIFCD4HXDNDNDNDNAOC9wgGMtMBCBHpCEHSAWCJDFHZALHhINARAh9rAX6MIDNARAhAXFGL9rCk6MBCZHOINAWCJ/CBFAOGIFGOC9wFHoDNDNDNDNDNAhAIC9wFGaCO4FrBBAaCI4COg4CIgpLBEDIBKAo9CB83IBAoCWF9CB83IBXIKAoALrBLALrBBGaCO4GcAcCIsGce86BBAOCgFALCLFAcFGorBBAaCL4CIgGcAcCIsGce86BBAOCvFAoAcFGorBBAaCD4CIgGcAcCIsGce86BBAOC7FAoAcFGorBBAaCIgGaAaCIsGae86BBAOCTFAoAaFGarBBALrBEGoCO4GcAcCIsGce86BBAOC91FAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOC4FAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOC93FAaAcFGarBBAoCIgGoAoCIsGoe86BBAOC94FAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOC95FAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOC96FAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOC97FAaAcFGarBBAoCIgGoAoCIsGoe86BBAOC98FAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOC99FAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOC9+FAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCUFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAoALrBWALrBBGaCL4GcAcCSsGce86BBAOCgFALCWFAcFGorBBAaCSgGaAaCSsGae86BBAOCvFAoAaFGorBBALrBEGaCL4GcAcCSsGce86BBAOC7FAoAcFGorBBAaCSgGaAaCSsGae86BBAOCTFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOC91FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC4FAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOC93FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC94FAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOC95FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC96FAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOC97FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC98FAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOC99FAoAcFGorBBAaCSgGaAaCSsGae86BBAOC9+FAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCUFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAoAL8pBB83BBAoCWFALCWF8pBB83BBALCZFHLKDNAIAM9PMBAICZFHOARAL9rCl0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/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK9MBDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCE91CJJJ/8IFCJJJ98g++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB";
+ var wasm_simd = "B9h79tEBBBEkL9gBB9gVUUUUUEU9gIUUUB9gEUEUIKQBBEBEEDDDILVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f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new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 3, 2, 0, 0, 5, 3, 1, 0, 1, 12, 1, 0, 10, 22, 2, 12, 0, 65, 0, 65, 0, 65, 0, 252, 10, 0, 0, 11, 7, 0, 65, 0, 253, 15, 26, 11]);
+ var wasmpack = new Uint8Array([32, 0, 65, 2, 1, 106, 34, 33, 3, 128, 11, 4, 13, 64, 6, 253, 10, 7, 15, 116, 127, 5, 8, 12, 40, 16, 19, 54, 20, 9, 27, 255, 113, 17, 42, 67, 24, 23, 146, 148, 18, 14, 22, 45, 70, 69, 56, 114, 101, 21, 25, 63, 75, 136, 108, 28, 118, 29, 73, 115]);
+ if (typeof WebAssembly !== "object") {
+ return {
+ supported: false
+ };
+ }
+ var wasm = wasm_base;
+ if (WebAssembly.validate(detector)) {
+ wasm = wasm_simd;
+ }
+ var instance;
+ var promise = WebAssembly.instantiate(unpack(wasm), {}).then(function(result) {
+ instance = result.instance;
+ instance.exports.__wasm_call_ctors();
+ });
+ function unpack(data) {
+ var result = new Uint8Array(data.length);
+ for (var i = 0; i < data.length; ++i) {
+ var ch = data.charCodeAt(i);
+ result[i] = ch > 96 ? ch - 71 : ch > 64 ? ch - 65 : ch > 47 ? ch + 4 : ch > 46 ? 63 : 62;
+ }
+ var write = 0;
+ for (var i = 0; i < data.length; ++i) {
+ result[write++] = result[i] < 60 ? wasmpack[result[i]] : (result[i] - 60) * 64 + result[++i];
+ }
+ return result.buffer.slice(0, write);
+ }
+ function decode(fun, target, count, size, source, filter) {
+ var sbrk = instance.exports.sbrk;
+ var count4 = count + 3 & ~3;
+ var tp = sbrk(count4 * size);
+ var sp = sbrk(source.length);
+ var heap = new Uint8Array(instance.exports.memory.buffer);
+ heap.set(source, sp);
+ var res = fun(tp, count, size, sp, source.length);
+ if (res == 0 && filter) {
+ filter(tp, count4, size);
+ }
+ target.set(heap.subarray(tp, tp + count * size));
+ sbrk(tp - sbrk(0));
+ if (res != 0) {
+ throw new Error("Malformed buffer data: " + res);
+ }
+ }
+ ;
+ var filters = {
+ 0: "",
+ 1: "meshopt_decodeFilterOct",
+ 2: "meshopt_decodeFilterQuat",
+ 3: "meshopt_decodeFilterExp",
+ NONE: "",
+ OCTAHEDRAL: "meshopt_decodeFilterOct",
+ QUATERNION: "meshopt_decodeFilterQuat",
+ EXPONENTIAL: "meshopt_decodeFilterExp"
+ };
+ var decoders = {
+ 0: "meshopt_decodeVertexBuffer",
+ 1: "meshopt_decodeIndexBuffer",
+ 2: "meshopt_decodeIndexSequence",
+ ATTRIBUTES: "meshopt_decodeVertexBuffer",
+ TRIANGLES: "meshopt_decodeIndexBuffer",
+ INDICES: "meshopt_decodeIndexSequence"
+ };
+ return {
+ ready: promise,
+ supported: true,
+ decodeVertexBuffer: function(target, count, size, source, filter) {
+ decode(instance.exports.meshopt_decodeVertexBuffer, target, count, size, source, instance.exports[filters[filter]]);
+ },
+ decodeIndexBuffer: function(target, count, size, source) {
+ decode(instance.exports.meshopt_decodeIndexBuffer, target, count, size, source);
+ },
+ decodeIndexSequence: function(target, count, size, source) {
+ decode(instance.exports.meshopt_decodeIndexSequence, target, count, size, source);
+ },
+ decodeGltfBuffer: function(target, count, size, source, mode2, filter) {
+ decode(instance.exports[decoders[mode2]], target, count, size, source, instance.exports[filters[filter]]);
+ }
+ };
+}();
+
+// node_modules/meshoptimizer/meshopt_simplifier.module.js
+var MeshoptSimplifier = function() {
+ "use strict";
+ var wasm = "B9h79tEBBBECd9gEUEU9gEUB9gBB9gQUUUUUUU99UUEU9gVUUUUUB9gLUUUUE999gIUUUE999gLUUUUEU9gIUUUEUIMXDILVORBWWBEWLVE9wEIIVIEBEOWEUECJ/JEKR7OO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BBZ9tw79o9v9wT9f79p9t9w29p9m95BEx9tw79o9v9wT9f79p9t9w29p9m959T9j9h2wBLA9tw79o9v9wT9f9v9wT9p9t9p96w9WwvTw94swT9j9o9Sw9t9h9w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DNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABK9TEIUCBCBYD/01JJBGEABCIFC98gFGBbD/01JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK9+EIUzBHEDNDNCBYD/01JJBGDAECZTGI9NMBCUHEADAI9rCffIFCZ4NBCUsMEKADHEKCBABAE9rCIFC98gCBYD/01JJBFGDbD/01JJBDNADzBCZTGE9NMBADAE9rCffIFCZ4NB8aKK6EIUCBHIDNADtMBDNINABrBBGLAErBBGV9HMEAECEFHEABCEFHBADCUFGDMBXDKKALAV9rHIKAIKK+CEDBCJWK9pffUUffUUffUUffUfffUfffUfBBBBBBBBEEEBEEBEBBEEEBEBBBBBEBEBBBBBEBBBDBBBBBBBBBBBBBBBEEEEEBEBBBBBEBBBBBEEBBBBBBC/sWKXEBBBDBBBJ9kBB";
+ var wasmpack = new Uint8Array([32, 0, 65, 2, 1, 106, 34, 33, 3, 128, 11, 4, 13, 64, 6, 253, 10, 7, 15, 116, 127, 5, 8, 12, 40, 16, 19, 54, 20, 9, 27, 255, 113, 17, 42, 67, 24, 23, 146, 148, 18, 14, 22, 45, 70, 69, 56, 114, 101, 21, 25, 63, 75, 136, 108, 28, 118, 29, 73, 115]);
+ if (typeof WebAssembly !== "object") {
+ return {
+ supported: false
+ };
+ }
+ var instance;
+ var promise = WebAssembly.instantiate(unpack(wasm), {}).then(function(result) {
+ instance = result.instance;
+ instance.exports.__wasm_call_ctors();
+ });
+ function unpack(data) {
+ var result = new Uint8Array(data.length);
+ for (var i = 0; i < data.length; ++i) {
+ var ch = data.charCodeAt(i);
+ result[i] = ch > 96 ? ch - 71 : ch > 64 ? ch - 65 : ch > 47 ? ch + 4 : ch > 46 ? 63 : 62;
+ }
+ var write = 0;
+ for (var i = 0; i < data.length; ++i) {
+ result[write++] = result[i] < 60 ? wasmpack[result[i]] : (result[i] - 60) * 64 + result[++i];
+ }
+ return result.buffer.slice(0, write);
+ }
+ function assert(cond) {
+ if (!cond) {
+ throw new Error("Assertion failed");
+ }
+ }
+ function bytes(view) {
+ return new Uint8Array(view.buffer, view.byteOffset, view.byteLength);
+ }
+ function reorder(indices2, vertices) {
+ var sbrk = instance.exports.sbrk;
+ var ip = sbrk(indices2.length * 4);
+ var rp = sbrk(vertices * 4);
+ var heap = new Uint8Array(instance.exports.memory.buffer);
+ var indices8 = bytes(indices2);
+ heap.set(indices8, ip);
+ var unique = instance.exports.meshopt_optimizeVertexFetchRemap(rp, ip, indices2.length, vertices);
+ heap = new Uint8Array(instance.exports.memory.buffer);
+ var remap = new Uint32Array(vertices);
+ new Uint8Array(remap.buffer).set(heap.subarray(rp, rp + vertices * 4));
+ indices8.set(heap.subarray(ip, ip + indices2.length * 4));
+ sbrk(ip - sbrk(0));
+ for (var i = 0; i < indices2.length; ++i)
+ indices2[i] = remap[indices2[i]];
+ return [remap, unique];
+ }
+ function maxindex(source) {
+ var result = 0;
+ for (var i = 0; i < source.length; ++i) {
+ var index = source[i];
+ result = result < index ? index : result;
+ }
+ return result;
+ }
+ function simplify(fun, indices2, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, options) {
+ var sbrk = instance.exports.sbrk;
+ var te = sbrk(4);
+ var ti = sbrk(index_count * 4);
+ var sp = sbrk(vertex_count * vertex_positions_stride);
+ var si = sbrk(index_count * 4);
+ var heap = new Uint8Array(instance.exports.memory.buffer);
+ heap.set(bytes(vertex_positions), sp);
+ heap.set(bytes(indices2), si);
+ var result = fun(ti, si, index_count, sp, vertex_count, vertex_positions_stride, target_index_count, target_error, options, te);
+ heap = new Uint8Array(instance.exports.memory.buffer);
+ var target = new Uint32Array(result);
+ bytes(target).set(heap.subarray(ti, ti + result * 4));
+ var error = new Float32Array(1);
+ bytes(error).set(heap.subarray(te, te + 4));
+ sbrk(te - sbrk(0));
+ return [target, error[0]];
+ }
+ function simplifyScale(fun, vertex_positions, vertex_count, vertex_positions_stride) {
+ var sbrk = instance.exports.sbrk;
+ var sp = sbrk(vertex_count * vertex_positions_stride);
+ var heap = new Uint8Array(instance.exports.memory.buffer);
+ heap.set(bytes(vertex_positions), sp);
+ var result = fun(sp, vertex_count, vertex_positions_stride);
+ sbrk(sp - sbrk(0));
+ return result;
+ }
+ var simplifyOptions = {
+ LockBorder: 1
+ };
+ return {
+ ready: promise,
+ supported: true,
+ compactMesh: function(indices2) {
+ assert(indices2 instanceof Uint32Array || indices2 instanceof Int32Array || indices2 instanceof Uint16Array || indices2 instanceof Int16Array);
+ assert(indices2.length % 3 == 0);
+ var indices32 = indices2.BYTES_PER_ELEMENT == 4 ? indices2 : new Uint32Array(indices2);
+ return reorder(indices32, maxindex(indices2) + 1);
+ },
+ simplify: function(indices2, vertex_positions, vertex_positions_stride, target_index_count, target_error, flags) {
+ assert(indices2 instanceof Uint32Array || indices2 instanceof Int32Array || indices2 instanceof Uint16Array || indices2 instanceof Int16Array);
+ assert(indices2.length % 3 == 0);
+ assert(vertex_positions instanceof Float32Array);
+ assert(vertex_positions.length % vertex_positions_stride == 0);
+ assert(vertex_positions_stride >= 3);
+ assert(target_index_count % 3 == 0);
+ var options = 0;
+ for (var i = 0; i < (flags ? flags.length : 0); ++i) {
+ options |= simplifyOptions[flags[i]];
+ }
+ var indices32 = indices2.BYTES_PER_ELEMENT == 4 ? indices2 : new Uint32Array(indices2);
+ var result = simplify(instance.exports.meshopt_simplify, indices32, indices2.length, vertex_positions, vertex_positions.length, vertex_positions_stride * 4, target_index_count, target_error, options);
+ result[0] = indices2 instanceof Uint32Array ? result[0] : new indices2.constructor(result[0]);
+ return result;
+ },
+ getScale: function(vertex_positions, vertex_positions_stride) {
+ assert(vertex_positions instanceof Float32Array);
+ assert(vertex_positions.length % vertex_positions_stride == 0);
+ return simplifyScale(instance.exports.meshopt_simplifyScale, vertex_positions, vertex_positions.length, vertex_positions_stride * 4);
+ }
+ };
+}();
+
+// Source/Scene/GltfBufferViewLoader.js
+function GltfBufferViewLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const resourceCache = options.resourceCache;
+ const gltf = options.gltf;
+ const bufferViewId = options.bufferViewId;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const cacheKey = options.cacheKey;
+ Check_default.typeOf.func("options.resourceCache", resourceCache);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.number("options.bufferViewId", bufferViewId);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ const bufferView = gltf.bufferViews[bufferViewId];
+ let bufferId = bufferView.buffer;
+ let byteOffset = bufferView.byteOffset;
+ let byteLength = bufferView.byteLength;
+ let hasMeshopt = false;
+ let meshoptByteStride;
+ let meshoptCount;
+ let meshoptMode;
+ let meshoptFilter;
+ if (hasExtension_default(bufferView, "EXT_meshopt_compression")) {
+ const meshopt = bufferView.extensions.EXT_meshopt_compression;
+ bufferId = meshopt.buffer;
+ byteOffset = defaultValue_default(meshopt.byteOffset, 0);
+ byteLength = meshopt.byteLength;
+ hasMeshopt = true;
+ meshoptByteStride = meshopt.byteStride;
+ meshoptCount = meshopt.count;
+ meshoptMode = meshopt.mode;
+ meshoptFilter = defaultValue_default(meshopt.filter, "NONE");
+ }
+ const buffer = gltf.buffers[bufferId];
+ this._hasMeshopt = hasMeshopt;
+ this._meshoptByteStride = meshoptByteStride;
+ this._meshoptCount = meshoptCount;
+ this._meshoptMode = meshoptMode;
+ this._meshoptFilter = meshoptFilter;
+ this._resourceCache = resourceCache;
+ this._gltfResource = gltfResource;
+ this._baseResource = baseResource2;
+ this._buffer = buffer;
+ this._bufferId = bufferId;
+ this._byteOffset = byteOffset;
+ this._byteLength = byteLength;
+ this._cacheKey = cacheKey;
+ this._bufferLoader = void 0;
+ this._typedArray = void 0;
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._promise = void 0;
+ this._process = function(loader, frameState) {
+ };
+}
+if (defined_default(Object.create)) {
+ GltfBufferViewLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ GltfBufferViewLoader.prototype.constructor = GltfBufferViewLoader;
+}
+Object.defineProperties(GltfBufferViewLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return this._cacheKey;
+ }
+ },
+ typedArray: {
+ get: function() {
+ return this._typedArray;
+ }
+ }
+});
+GltfBufferViewLoader.prototype.load = function() {
+ const bufferLoader = getBufferLoader(this);
+ this._bufferLoader = bufferLoader;
+ this._state = ResourceLoaderState_default.LOADING;
+ const that = this;
+ const bufferViewPromise = new Promise(function(resolve2) {
+ that._process = function(loader, frameState) {
+ if (!loader._hasMeshopt) {
+ return;
+ }
+ if (!defined_default(loader._typedArray)) {
+ return;
+ }
+ if (loader._state !== ResourceLoaderState_default.PROCESSING) {
+ return;
+ }
+ const count = loader._meshoptCount;
+ const byteStride = loader._meshoptByteStride;
+ const result = new Uint8Array(count * byteStride);
+ MeshoptDecoder.decodeGltfBuffer(
+ result,
+ count,
+ byteStride,
+ loader._typedArray,
+ loader._meshoptMode,
+ loader._meshoptFilter
+ );
+ loader._typedArray = result;
+ loader._state = ResourceLoaderState_default.READY;
+ resolve2(loader);
+ };
+ });
+ this._promise = bufferLoader.promise.then(function() {
+ if (that.isDestroyed()) {
+ return;
+ }
+ const bufferTypedArray = bufferLoader.typedArray;
+ const bufferViewTypedArray = new Uint8Array(
+ bufferTypedArray.buffer,
+ bufferTypedArray.byteOffset + that._byteOffset,
+ that._byteLength
+ );
+ that.unload();
+ that._typedArray = bufferViewTypedArray;
+ if (that._hasMeshopt) {
+ that._state = ResourceLoaderState_default.PROCESSING;
+ return bufferViewPromise;
+ }
+ that._state = ResourceLoaderState_default.READY;
+ return that;
+ }).catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that.unload();
+ that._state = ResourceLoaderState_default.FAILED;
+ const errorMessage = "Failed to load buffer view";
+ return Promise.reject(that.getError(errorMessage, error));
+ });
+ return this._promise;
+};
+function getBufferLoader(bufferViewLoader) {
+ const resourceCache = bufferViewLoader._resourceCache;
+ const buffer = bufferViewLoader._buffer;
+ if (defined_default(buffer.uri)) {
+ const baseResource2 = bufferViewLoader._baseResource;
+ const resource = baseResource2.getDerivedResource({
+ url: buffer.uri
+ });
+ return resourceCache.loadExternalBuffer({
+ resource
+ });
+ }
+ return resourceCache.loadEmbeddedBuffer({
+ parentResource: bufferViewLoader._gltfResource,
+ bufferId: bufferViewLoader._bufferId
+ });
+}
+GltfBufferViewLoader.prototype.process = function(frameState) {
+ Check_default.typeOf.object("frameState", frameState);
+ return this._process(this, frameState);
+};
+GltfBufferViewLoader.prototype.unload = function() {
+ if (defined_default(this._bufferLoader)) {
+ this._resourceCache.unload(this._bufferLoader);
+ }
+ this._bufferLoader = void 0;
+ this._typedArray = void 0;
+};
+var GltfBufferViewLoader_default = GltfBufferViewLoader;
+
+// Source/Scene/DracoLoader.js
+function DracoLoader() {
+}
+DracoLoader._maxDecodingConcurrency = Math.max(
+ FeatureDetection_default.hardwareConcurrency - 1,
+ 1
+);
+DracoLoader._decoderTaskProcessor = void 0;
+DracoLoader._taskProcessorReady = false;
+DracoLoader._getDecoderTaskProcessor = function() {
+ if (!defined_default(DracoLoader._decoderTaskProcessor)) {
+ const processor = new TaskProcessor_default(
+ "decodeDraco",
+ DracoLoader._maxDecodingConcurrency
+ );
+ processor.initWebAssemblyModule({
+ modulePath: "ThirdParty/Workers/draco_decoder_nodejs.js",
+ wasmBinaryFile: "ThirdParty/draco_decoder.wasm"
+ }).then(function() {
+ DracoLoader._taskProcessorReady = true;
+ });
+ DracoLoader._decoderTaskProcessor = processor;
+ }
+ return DracoLoader._decoderTaskProcessor;
+};
+DracoLoader.decodePointCloud = function(parameters) {
+ const decoderTaskProcessor = DracoLoader._getDecoderTaskProcessor();
+ if (!DracoLoader._taskProcessorReady) {
+ return;
+ }
+ return decoderTaskProcessor.scheduleTask(parameters, [
+ parameters.buffer.buffer
+ ]);
+};
+DracoLoader.decodeBufferView = function(options) {
+ const decoderTaskProcessor = DracoLoader._getDecoderTaskProcessor();
+ if (!DracoLoader._taskProcessorReady) {
+ return;
+ }
+ return decoderTaskProcessor.scheduleTask(options, [options.array.buffer]);
+};
+var DracoLoader_default = DracoLoader;
+
+// Source/Scene/GltfDracoLoader.js
+function GltfDracoLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const resourceCache = options.resourceCache;
+ const gltf = options.gltf;
+ const draco = options.draco;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const cacheKey = options.cacheKey;
+ Check_default.typeOf.func("options.resourceCache", resourceCache);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.draco", draco);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ this._resourceCache = resourceCache;
+ this._gltfResource = gltfResource;
+ this._baseResource = baseResource2;
+ this._gltf = gltf;
+ this._draco = draco;
+ this._cacheKey = cacheKey;
+ this._bufferViewLoader = void 0;
+ this._bufferViewTypedArray = void 0;
+ this._decodePromise = void 0;
+ this._decodedData = void 0;
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._promise = void 0;
+ this._process = function(loader, frameState) {
+ };
+}
+if (defined_default(Object.create)) {
+ GltfDracoLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ GltfDracoLoader.prototype.constructor = GltfDracoLoader;
+}
+Object.defineProperties(GltfDracoLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return this._cacheKey;
+ }
+ },
+ decodedData: {
+ get: function() {
+ return this._decodedData;
+ }
+ }
+});
+GltfDracoLoader.prototype.load = function() {
+ const resourceCache = this._resourceCache;
+ const bufferViewLoader = resourceCache.loadBufferView({
+ gltf: this._gltf,
+ bufferViewId: this._draco.bufferView,
+ gltfResource: this._gltfResource,
+ baseResource: this._baseResource
+ });
+ this._bufferViewLoader = bufferViewLoader;
+ this._state = ResourceLoaderState_default.LOADING;
+ const that = this;
+ const dracoPromise = new Promise(function(resolve2, reject) {
+ that._process = function(loader, frameState) {
+ if (!defined_default(loader._bufferViewTypedArray)) {
+ return;
+ }
+ if (defined_default(loader._decodePromise)) {
+ return;
+ }
+ const draco = loader._draco;
+ const gltf = loader._gltf;
+ const bufferViews = gltf.bufferViews;
+ const bufferViewId = draco.bufferView;
+ const bufferView = bufferViews[bufferViewId];
+ const compressedAttributes = draco.attributes;
+ const decodeOptions = {
+ array: new Uint8Array(loader._bufferViewTypedArray),
+ bufferView,
+ compressedAttributes,
+ dequantizeInShader: true
+ };
+ const decodePromise = DracoLoader_default.decodeBufferView(decodeOptions);
+ if (!defined_default(decodePromise)) {
+ return;
+ }
+ loader._decodePromise = decodePromise.then(function(results) {
+ if (loader.isDestroyed()) {
+ resolve2();
+ return;
+ }
+ loader.unload();
+ loader._decodedData = {
+ indices: results.indexArray,
+ vertexAttributes: results.attributeData
+ };
+ loader._state = ResourceLoaderState_default.READY;
+ resolve2(loader);
+ }).catch(function(e) {
+ if (loader.isDestroyed()) {
+ resolve2();
+ return;
+ }
+ reject(e);
+ });
+ };
+ });
+ this._promise = bufferViewLoader.promise.then(function() {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that._bufferViewTypedArray = bufferViewLoader.typedArray;
+ that._state = ResourceLoaderState_default.PROCESSING;
+ return dracoPromise;
+ }).catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ return handleError(that, error);
+ });
+ return this._promise;
+};
+function handleError(dracoLoader, error) {
+ dracoLoader.unload();
+ dracoLoader._state = ResourceLoaderState_default.FAILED;
+ const errorMessage = "Failed to load Draco";
+ return Promise.reject(dracoLoader.getError(errorMessage, error));
+}
+GltfDracoLoader.prototype.process = function(frameState) {
+ Check_default.typeOf.object("frameState", frameState);
+ return this._process(this, frameState);
+};
+GltfDracoLoader.prototype.unload = function() {
+ if (defined_default(this._bufferViewLoader)) {
+ this._resourceCache.unload(this._bufferViewLoader);
+ }
+ this._bufferViewLoader = void 0;
+ this._bufferViewTypedArray = void 0;
+ this._decodedData = void 0;
+ this._gltf = void 0;
+};
+var GltfDracoLoader_default = GltfDracoLoader;
+
+// Source/Core/loadImageFromTypedArray.js
+function loadImageFromTypedArray(options) {
+ const uint8Array = options.uint8Array;
+ const format = options.format;
+ const request = options.request;
+ const flipY = defaultValue_default(options.flipY, false);
+ const skipColorSpaceConversion = defaultValue_default(
+ options.skipColorSpaceConversion,
+ false
+ );
+ Check_default.typeOf.object("uint8Array", uint8Array);
+ Check_default.typeOf.string("format", format);
+ const blob = new Blob([uint8Array], {
+ type: format
+ });
+ let blobUrl;
+ return Resource_default.supportsImageBitmapOptions().then(function(result) {
+ if (result) {
+ return Promise.resolve(
+ Resource_default.createImageBitmapFromBlob(blob, {
+ flipY,
+ premultiplyAlpha: false,
+ skipColorSpaceConversion
+ })
+ );
+ }
+ blobUrl = window.URL.createObjectURL(blob);
+ const resource = new Resource_default({
+ url: blobUrl,
+ request
+ });
+ return resource.fetchImage({
+ flipY,
+ skipColorSpaceConversion
+ });
+ }).then(function(result) {
+ if (defined_default(blobUrl)) {
+ window.URL.revokeObjectURL(blobUrl);
+ }
+ return result;
+ }).catch(function(error) {
+ if (defined_default(blobUrl)) {
+ window.URL.revokeObjectURL(blobUrl);
+ }
+ return Promise.reject(error);
+ });
+}
+var loadImageFromTypedArray_default = loadImageFromTypedArray;
+
+// Source/Scene/GltfImageLoader.js
+function GltfImageLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const resourceCache = options.resourceCache;
+ const gltf = options.gltf;
+ const imageId = options.imageId;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const cacheKey = options.cacheKey;
+ Check_default.typeOf.func("options.resourceCache", resourceCache);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.number("options.imageId", imageId);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ const image = gltf.images[imageId];
+ const bufferViewId = image.bufferView;
+ const uri = image.uri;
+ this._resourceCache = resourceCache;
+ this._gltfResource = gltfResource;
+ this._baseResource = baseResource2;
+ this._gltf = gltf;
+ this._bufferViewId = bufferViewId;
+ this._uri = uri;
+ this._cacheKey = cacheKey;
+ this._bufferViewLoader = void 0;
+ this._image = void 0;
+ this._mipLevels = void 0;
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._promise = void 0;
+}
+if (defined_default(Object.create)) {
+ GltfImageLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ GltfImageLoader.prototype.constructor = GltfImageLoader;
+}
+Object.defineProperties(GltfImageLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return this._cacheKey;
+ }
+ },
+ image: {
+ get: function() {
+ return this._image;
+ }
+ },
+ mipLevels: {
+ get: function() {
+ return this._mipLevels;
+ }
+ }
+});
+GltfImageLoader.prototype.load = function() {
+ if (defined_default(this._bufferViewId)) {
+ this._promise = loadFromBufferView(this);
+ return this._promise;
+ }
+ this._promise = loadFromUri(this);
+ return this._promise;
+};
+function getImageAndMipLevels(image) {
+ let mipLevels;
+ if (Array.isArray(image)) {
+ mipLevels = image.slice(1, image.length).map(function(mipLevel) {
+ return mipLevel.bufferView;
+ });
+ image = image[0];
+ }
+ return {
+ image,
+ mipLevels
+ };
+}
+function loadFromBufferView(imageLoader) {
+ const resourceCache = imageLoader._resourceCache;
+ const bufferViewLoader = resourceCache.loadBufferView({
+ gltf: imageLoader._gltf,
+ bufferViewId: imageLoader._bufferViewId,
+ gltfResource: imageLoader._gltfResource,
+ baseResource: imageLoader._baseResource
+ });
+ imageLoader._bufferViewLoader = bufferViewLoader;
+ imageLoader._state = ResourceLoaderState_default.LOADING;
+ return bufferViewLoader.promise.then(function() {
+ if (imageLoader.isDestroyed()) {
+ return;
+ }
+ const typedArray = bufferViewLoader.typedArray;
+ return loadImageFromBufferTypedArray(typedArray).then(function(image) {
+ if (imageLoader.isDestroyed()) {
+ return;
+ }
+ const imageAndMipLevels = getImageAndMipLevels(image);
+ imageLoader.unload();
+ imageLoader._image = imageAndMipLevels.image;
+ imageLoader._mipLevels = imageAndMipLevels.mipLevels;
+ imageLoader._state = ResourceLoaderState_default.READY;
+ return imageLoader;
+ });
+ }).catch(function(error) {
+ if (imageLoader.isDestroyed()) {
+ return;
+ }
+ return handleError2(imageLoader, error, "Failed to load embedded image");
+ });
+}
+function loadFromUri(imageLoader) {
+ const baseResource2 = imageLoader._baseResource;
+ const uri = imageLoader._uri;
+ const resource = baseResource2.getDerivedResource({
+ url: uri
+ });
+ imageLoader._state = ResourceLoaderState_default.LOADING;
+ return loadImageFromUri(resource).then(function(image) {
+ if (imageLoader.isDestroyed()) {
+ return;
+ }
+ const imageAndMipLevels = getImageAndMipLevels(image);
+ imageLoader.unload();
+ imageLoader._image = imageAndMipLevels.image;
+ imageLoader._mipLevels = imageAndMipLevels.mipLevels;
+ imageLoader._state = ResourceLoaderState_default.READY;
+ return imageLoader;
+ }).catch(function(error) {
+ if (imageLoader.isDestroyed()) {
+ return;
+ }
+ return handleError2(imageLoader, error, `Failed to load image: ${uri}`);
+ });
+}
+function handleError2(imageLoader, error, errorMessage) {
+ imageLoader.unload();
+ imageLoader._state = ResourceLoaderState_default.FAILED;
+ return Promise.reject(imageLoader.getError(errorMessage, error));
+}
+function getMimeTypeFromTypedArray(typedArray) {
+ const header = typedArray.subarray(0, 2);
+ const webpHeaderRIFFChars = typedArray.subarray(0, 4);
+ const webpHeaderWEBPChars = typedArray.subarray(8, 12);
+ if (header[0] === 255 && header[1] === 216) {
+ return "image/jpeg";
+ } else if (header[0] === 137 && header[1] === 80) {
+ return "image/png";
+ } else if (header[0] === 171 && header[1] === 75) {
+ return "image/ktx2";
+ } else if (webpHeaderRIFFChars[0] === 82 && webpHeaderRIFFChars[1] === 73 && webpHeaderRIFFChars[2] === 70 && webpHeaderRIFFChars[3] === 70 && webpHeaderWEBPChars[0] === 87 && webpHeaderWEBPChars[1] === 69 && webpHeaderWEBPChars[2] === 66 && webpHeaderWEBPChars[3] === 80) {
+ return "image/webp";
+ }
+ throw new RuntimeError_default("Image format is not recognized");
+}
+function loadImageFromBufferTypedArray(typedArray) {
+ const mimeType = getMimeTypeFromTypedArray(typedArray);
+ if (mimeType === "image/ktx2") {
+ const ktxBuffer = new Uint8Array(typedArray);
+ return loadKTX2_default(ktxBuffer);
+ }
+ return GltfImageLoader._loadImageFromTypedArray({
+ uint8Array: typedArray,
+ format: mimeType,
+ flipY: false,
+ skipColorSpaceConversion: true
+ });
+}
+var ktx2Regex2 = /(^data:image\/ktx2)|(\.ktx2$)/i;
+function loadImageFromUri(resource) {
+ const uri = resource.url;
+ if (ktx2Regex2.test(uri)) {
+ return loadKTX2_default(resource);
+ }
+ return resource.fetchImage({
+ skipColorSpaceConversion: true,
+ preferImageBitmap: true
+ });
+}
+GltfImageLoader.prototype.unload = function() {
+ if (defined_default(this._bufferViewLoader)) {
+ this._resourceCache.unload(this._bufferViewLoader);
+ }
+ this._bufferViewLoader = void 0;
+ this._uri = void 0;
+ this._image = void 0;
+ this._mipLevels = void 0;
+ this._gltf = void 0;
+};
+GltfImageLoader._loadImageFromTypedArray = loadImageFromTypedArray_default;
+var GltfImageLoader_default = GltfImageLoader;
+
+// Source/Scene/JobType.js
+var JobType = {
+ TEXTURE: 0,
+ PROGRAM: 1,
+ BUFFER: 2,
+ NUMBER_OF_JOB_TYPES: 3
+};
+var JobType_default = Object.freeze(JobType);
+
+// Source/Scene/GltfIndexBufferLoader.js
+function GltfIndexBufferLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const resourceCache = options.resourceCache;
+ const gltf = options.gltf;
+ const accessorId = options.accessorId;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const draco = options.draco;
+ const cacheKey = options.cacheKey;
+ const asynchronous = defaultValue_default(options.asynchronous, true);
+ const loadBuffer = defaultValue_default(options.loadBuffer, false);
+ const loadTypedArray = defaultValue_default(options.loadTypedArray, false);
+ Check_default.typeOf.func("options.resourceCache", resourceCache);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.number("options.accessorId", accessorId);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ if (!loadBuffer && !loadTypedArray) {
+ throw new DeveloperError_default(
+ "At least one of loadBuffer and loadTypedArray must be true."
+ );
+ }
+ const indexDatatype = gltf.accessors[accessorId].componentType;
+ this._resourceCache = resourceCache;
+ this._gltfResource = gltfResource;
+ this._baseResource = baseResource2;
+ this._gltf = gltf;
+ this._accessorId = accessorId;
+ this._indexDatatype = indexDatatype;
+ this._draco = draco;
+ this._cacheKey = cacheKey;
+ this._asynchronous = asynchronous;
+ this._loadBuffer = loadBuffer;
+ this._loadTypedArray = loadTypedArray;
+ this._bufferViewLoader = void 0;
+ this._dracoLoader = void 0;
+ this._typedArray = void 0;
+ this._buffer = void 0;
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._promise = void 0;
+ this._process = function(loader, frameState) {
+ };
+}
+if (defined_default(Object.create)) {
+ GltfIndexBufferLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ GltfIndexBufferLoader.prototype.constructor = GltfIndexBufferLoader;
+}
+Object.defineProperties(GltfIndexBufferLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return this._cacheKey;
+ }
+ },
+ buffer: {
+ get: function() {
+ return this._buffer;
+ }
+ },
+ typedArray: {
+ get: function() {
+ return this._typedArray;
+ }
+ },
+ indexDatatype: {
+ get: function() {
+ return this._indexDatatype;
+ }
+ }
+});
+var scratchIndexBufferJob = new CreateIndexBufferJob();
+GltfIndexBufferLoader.prototype.load = function() {
+ let promise;
+ if (defined_default(this._draco)) {
+ promise = loadFromDraco(this);
+ } else {
+ promise = loadFromBufferView2(this);
+ }
+ const that = this;
+ const processPromise = new Promise(function(resolve2) {
+ that._process = function(loader, frameState) {
+ if (loader._state === ResourceLoaderState_default.READY) {
+ return;
+ }
+ const typedArray = loader._typedArray;
+ const indexDatatype = loader._indexDatatype;
+ if (defined_default(loader._dracoLoader)) {
+ loader._dracoLoader.process(frameState);
+ }
+ if (defined_default(loader._bufferViewLoader)) {
+ loader._bufferViewLoader.process(frameState);
+ }
+ if (!defined_default(typedArray)) {
+ return;
+ }
+ let buffer;
+ if (loader._loadBuffer && loader._asynchronous) {
+ const indexBufferJob = scratchIndexBufferJob;
+ indexBufferJob.set(typedArray, indexDatatype, frameState.context);
+ const jobScheduler = frameState.jobScheduler;
+ if (!jobScheduler.execute(indexBufferJob, JobType_default.BUFFER)) {
+ return;
+ }
+ buffer = indexBufferJob.buffer;
+ } else if (loader._loadBuffer) {
+ buffer = createIndexBuffer(
+ typedArray,
+ indexDatatype,
+ frameState.context
+ );
+ }
+ loader.unload();
+ loader._buffer = buffer;
+ loader._typedArray = loader._loadTypedArray ? typedArray : void 0;
+ loader._state = ResourceLoaderState_default.READY;
+ resolve2(loader);
+ };
+ });
+ this._promise = promise.then(function() {
+ if (that.isDestroyed()) {
+ return;
+ }
+ return processPromise;
+ }).catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ return handleError3(that, error);
+ });
+ return this._promise;
+};
+function loadFromDraco(indexBufferLoader) {
+ const resourceCache = indexBufferLoader._resourceCache;
+ const dracoLoader = resourceCache.loadDraco({
+ gltf: indexBufferLoader._gltf,
+ draco: indexBufferLoader._draco,
+ gltfResource: indexBufferLoader._gltfResource,
+ baseResource: indexBufferLoader._baseResource
+ });
+ indexBufferLoader._dracoLoader = dracoLoader;
+ indexBufferLoader._state = ResourceLoaderState_default.LOADING;
+ return dracoLoader.promise.then(function() {
+ if (indexBufferLoader.isDestroyed()) {
+ return;
+ }
+ const typedArray = dracoLoader.decodedData.indices.typedArray;
+ indexBufferLoader._typedArray = typedArray;
+ indexBufferLoader._indexDatatype = ComponentDatatype_default.fromTypedArray(
+ typedArray
+ );
+ indexBufferLoader._state = ResourceLoaderState_default.PROCESSING;
+ return indexBufferLoader;
+ });
+}
+function loadFromBufferView2(indexBufferLoader) {
+ const gltf = indexBufferLoader._gltf;
+ const accessorId = indexBufferLoader._accessorId;
+ const accessor = gltf.accessors[accessorId];
+ const bufferViewId = accessor.bufferView;
+ const resourceCache = indexBufferLoader._resourceCache;
+ const bufferViewLoader = resourceCache.loadBufferView({
+ gltf,
+ bufferViewId,
+ gltfResource: indexBufferLoader._gltfResource,
+ baseResource: indexBufferLoader._baseResource
+ });
+ indexBufferLoader._state = ResourceLoaderState_default.LOADING;
+ indexBufferLoader._bufferViewLoader = bufferViewLoader;
+ return bufferViewLoader.promise.then(function() {
+ if (indexBufferLoader.isDestroyed()) {
+ return;
+ }
+ const bufferViewTypedArray = bufferViewLoader.typedArray;
+ indexBufferLoader._typedArray = createIndicesTypedArray(
+ indexBufferLoader,
+ bufferViewTypedArray
+ );
+ indexBufferLoader._state = ResourceLoaderState_default.PROCESSING;
+ return indexBufferLoader;
+ });
+}
+function createIndicesTypedArray(indexBufferLoader, bufferViewTypedArray) {
+ const gltf = indexBufferLoader._gltf;
+ const accessorId = indexBufferLoader._accessorId;
+ const accessor = gltf.accessors[accessorId];
+ const count = accessor.count;
+ const indexDatatype = accessor.componentType;
+ const indexSize = IndexDatatype_default.getSizeInBytes(indexDatatype);
+ let arrayBuffer = bufferViewTypedArray.buffer;
+ let byteOffset = bufferViewTypedArray.byteOffset + accessor.byteOffset;
+ if (byteOffset % indexSize !== 0) {
+ const byteLength = count * indexSize;
+ const view = new Uint8Array(arrayBuffer, byteOffset, byteLength);
+ const copy = new Uint8Array(view);
+ arrayBuffer = copy.buffer;
+ byteOffset = 0;
+ deprecationWarning_default(
+ "index-buffer-unaligned",
+ `The index array is not aligned to a ${indexSize}-byte boundary.`
+ );
+ }
+ let typedArray;
+ if (indexDatatype === IndexDatatype_default.UNSIGNED_BYTE) {
+ typedArray = new Uint8Array(arrayBuffer, byteOffset, count);
+ } else if (indexDatatype === IndexDatatype_default.UNSIGNED_SHORT) {
+ typedArray = new Uint16Array(arrayBuffer, byteOffset, count);
+ } else if (indexDatatype === IndexDatatype_default.UNSIGNED_INT) {
+ typedArray = new Uint32Array(arrayBuffer, byteOffset, count);
+ }
+ return typedArray;
+}
+function handleError3(indexBufferLoader, error) {
+ indexBufferLoader.unload();
+ indexBufferLoader._state = ResourceLoaderState_default.FAILED;
+ const errorMessage = "Failed to load index buffer";
+ error = indexBufferLoader.getError(errorMessage, error);
+ return Promise.reject(error);
+}
+function CreateIndexBufferJob() {
+ this.typedArray = void 0;
+ this.indexDatatype = void 0;
+ this.context = void 0;
+ this.buffer = void 0;
+}
+CreateIndexBufferJob.prototype.set = function(typedArray, indexDatatype, context) {
+ this.typedArray = typedArray;
+ this.indexDatatype = indexDatatype;
+ this.context = context;
+};
+CreateIndexBufferJob.prototype.execute = function() {
+ this.buffer = createIndexBuffer(
+ this.typedArray,
+ this.indexDatatype,
+ this.context
+ );
+};
+function createIndexBuffer(typedArray, indexDatatype, context) {
+ const buffer = Buffer_default.createIndexBuffer({
+ typedArray,
+ context,
+ usage: BufferUsage_default.STATIC_DRAW,
+ indexDatatype
+ });
+ buffer.vertexArrayDestroyable = false;
+ return buffer;
+}
+GltfIndexBufferLoader.prototype.process = function(frameState) {
+ Check_default.typeOf.object("frameState", frameState);
+ return this._process(this, frameState);
+};
+GltfIndexBufferLoader.prototype.unload = function() {
+ if (defined_default(this._buffer)) {
+ this._buffer.destroy();
+ }
+ const resourceCache = this._resourceCache;
+ if (defined_default(this._bufferViewLoader)) {
+ resourceCache.unload(this._bufferViewLoader);
+ }
+ if (defined_default(this._dracoLoader)) {
+ resourceCache.unload(this._dracoLoader);
+ }
+ this._bufferViewLoader = void 0;
+ this._dracoLoader = void 0;
+ this._typedArray = void 0;
+ this._buffer = void 0;
+ this._gltf = void 0;
+};
+var GltfIndexBufferLoader_default = GltfIndexBufferLoader;
+
+// Source/Scene/GltfPipeline/addToArray.js
+function addToArray(array, element, checkDuplicates) {
+ checkDuplicates = defaultValue_default(checkDuplicates, false);
+ if (checkDuplicates) {
+ const index = array.indexOf(element);
+ if (index > -1) {
+ return index;
+ }
+ }
+ array.push(element);
+ return array.length - 1;
+}
+var addToArray_default = addToArray;
+
+// Source/Scene/GltfPipeline/usesExtension.js
+function usesExtension(gltf, extension) {
+ return defined_default(gltf.extensionsUsed) && gltf.extensionsUsed.indexOf(extension) >= 0;
+}
+var usesExtension_default = usesExtension;
+
+// Source/Scene/GltfPipeline/ForEach.js
+function ForEach() {
+}
+ForEach.objectLegacy = function(objects, handler) {
+ if (defined_default(objects)) {
+ for (const objectId in objects) {
+ if (Object.prototype.hasOwnProperty.call(objects, objectId)) {
+ const object2 = objects[objectId];
+ const value = handler(object2, objectId);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+ }
+};
+ForEach.object = function(arrayOfObjects, handler) {
+ if (defined_default(arrayOfObjects)) {
+ const length3 = arrayOfObjects.length;
+ for (let i = 0; i < length3; i++) {
+ const object2 = arrayOfObjects[i];
+ const value = handler(object2, i);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+};
+ForEach.topLevel = function(gltf, name, handler) {
+ const gltfProperty = gltf[name];
+ if (defined_default(gltfProperty) && !Array.isArray(gltfProperty)) {
+ return ForEach.objectLegacy(gltfProperty, handler);
+ }
+ return ForEach.object(gltfProperty, handler);
+};
+ForEach.accessor = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "accessors", handler);
+};
+ForEach.accessorWithSemantic = function(gltf, semantic, handler) {
+ const visited = {};
+ return ForEach.mesh(gltf, function(mesh) {
+ return ForEach.meshPrimitive(mesh, function(primitive) {
+ const valueForEach = ForEach.meshPrimitiveAttribute(
+ primitive,
+ function(accessorId, attributeSemantic) {
+ if (attributeSemantic.indexOf(semantic) === 0 && !defined_default(visited[accessorId])) {
+ visited[accessorId] = true;
+ const value = handler(accessorId);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+ );
+ if (defined_default(valueForEach)) {
+ return valueForEach;
+ }
+ return ForEach.meshPrimitiveTarget(primitive, function(target) {
+ return ForEach.meshPrimitiveTargetAttribute(
+ target,
+ function(accessorId, attributeSemantic) {
+ if (attributeSemantic.indexOf(semantic) === 0 && !defined_default(visited[accessorId])) {
+ visited[accessorId] = true;
+ const value = handler(accessorId);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+ );
+ });
+ });
+ });
+};
+ForEach.accessorContainingVertexAttributeData = function(gltf, handler) {
+ const visited = {};
+ return ForEach.mesh(gltf, function(mesh) {
+ return ForEach.meshPrimitive(mesh, function(primitive) {
+ const valueForEach = ForEach.meshPrimitiveAttribute(
+ primitive,
+ function(accessorId) {
+ if (!defined_default(visited[accessorId])) {
+ visited[accessorId] = true;
+ const value = handler(accessorId);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+ );
+ if (defined_default(valueForEach)) {
+ return valueForEach;
+ }
+ return ForEach.meshPrimitiveTarget(primitive, function(target) {
+ return ForEach.meshPrimitiveTargetAttribute(
+ target,
+ function(accessorId) {
+ if (!defined_default(visited[accessorId])) {
+ visited[accessorId] = true;
+ const value = handler(accessorId);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+ );
+ });
+ });
+ });
+};
+ForEach.accessorContainingIndexData = function(gltf, handler) {
+ const visited = {};
+ return ForEach.mesh(gltf, function(mesh) {
+ return ForEach.meshPrimitive(mesh, function(primitive) {
+ const indices2 = primitive.indices;
+ if (defined_default(indices2) && !defined_default(visited[indices2])) {
+ visited[indices2] = true;
+ const value = handler(indices2);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ });
+ });
+};
+ForEach.animation = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "animations", handler);
+};
+ForEach.animationChannel = function(animation, handler) {
+ const channels = animation.channels;
+ return ForEach.object(channels, handler);
+};
+ForEach.animationSampler = function(animation, handler) {
+ const samplers = animation.samplers;
+ return ForEach.object(samplers, handler);
+};
+ForEach.buffer = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "buffers", handler);
+};
+ForEach.bufferView = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "bufferViews", handler);
+};
+ForEach.camera = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "cameras", handler);
+};
+ForEach.image = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "images", handler);
+};
+ForEach.material = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "materials", handler);
+};
+ForEach.materialValue = function(material, handler) {
+ let values = material.values;
+ if (defined_default(material.extensions) && defined_default(material.extensions.KHR_techniques_webgl)) {
+ values = material.extensions.KHR_techniques_webgl.values;
+ }
+ for (const name in values) {
+ if (Object.prototype.hasOwnProperty.call(values, name)) {
+ const value = handler(values[name], name);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+};
+ForEach.mesh = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "meshes", handler);
+};
+ForEach.meshPrimitive = function(mesh, handler) {
+ const primitives = mesh.primitives;
+ if (defined_default(primitives)) {
+ const primitivesLength = primitives.length;
+ for (let i = 0; i < primitivesLength; i++) {
+ const primitive = primitives[i];
+ const value = handler(primitive, i);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+};
+ForEach.meshPrimitiveAttribute = function(primitive, handler) {
+ const attributes = primitive.attributes;
+ for (const semantic in attributes) {
+ if (Object.prototype.hasOwnProperty.call(attributes, semantic)) {
+ const value = handler(attributes[semantic], semantic);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+};
+ForEach.meshPrimitiveTarget = function(primitive, handler) {
+ const targets = primitive.targets;
+ if (defined_default(targets)) {
+ const length3 = targets.length;
+ for (let i = 0; i < length3; ++i) {
+ const value = handler(targets[i], i);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+};
+ForEach.meshPrimitiveTargetAttribute = function(target, handler) {
+ for (const semantic in target) {
+ if (Object.prototype.hasOwnProperty.call(target, semantic)) {
+ const accessorId = target[semantic];
+ const value = handler(accessorId, semantic);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+};
+ForEach.node = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "nodes", handler);
+};
+ForEach.nodeInTree = function(gltf, nodeIds, handler) {
+ const nodes = gltf.nodes;
+ if (defined_default(nodes)) {
+ const length3 = nodeIds.length;
+ for (let i = 0; i < length3; i++) {
+ const nodeId = nodeIds[i];
+ const node = nodes[nodeId];
+ if (defined_default(node)) {
+ let value = handler(node, nodeId);
+ if (defined_default(value)) {
+ return value;
+ }
+ const children = node.children;
+ if (defined_default(children)) {
+ value = ForEach.nodeInTree(gltf, children, handler);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+ }
+ }
+};
+ForEach.nodeInScene = function(gltf, scene, handler) {
+ const sceneNodeIds = scene.nodes;
+ if (defined_default(sceneNodeIds)) {
+ return ForEach.nodeInTree(gltf, sceneNodeIds, handler);
+ }
+};
+ForEach.program = function(gltf, handler) {
+ if (usesExtension_default(gltf, "KHR_techniques_webgl")) {
+ return ForEach.object(
+ gltf.extensions.KHR_techniques_webgl.programs,
+ handler
+ );
+ }
+ return ForEach.topLevel(gltf, "programs", handler);
+};
+ForEach.sampler = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "samplers", handler);
+};
+ForEach.scene = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "scenes", handler);
+};
+ForEach.shader = function(gltf, handler) {
+ if (usesExtension_default(gltf, "KHR_techniques_webgl")) {
+ return ForEach.object(
+ gltf.extensions.KHR_techniques_webgl.shaders,
+ handler
+ );
+ }
+ return ForEach.topLevel(gltf, "shaders", handler);
+};
+ForEach.skin = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "skins", handler);
+};
+ForEach.skinJoint = function(skin, handler) {
+ const joints = skin.joints;
+ if (defined_default(joints)) {
+ const jointsLength = joints.length;
+ for (let i = 0; i < jointsLength; i++) {
+ const joint = joints[i];
+ const value = handler(joint);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+};
+ForEach.techniqueAttribute = function(technique, handler) {
+ const attributes = technique.attributes;
+ for (const attributeName in attributes) {
+ if (Object.prototype.hasOwnProperty.call(attributes, attributeName)) {
+ const value = handler(attributes[attributeName], attributeName);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+};
+ForEach.techniqueUniform = function(technique, handler) {
+ const uniforms = technique.uniforms;
+ for (const uniformName in uniforms) {
+ if (Object.prototype.hasOwnProperty.call(uniforms, uniformName)) {
+ const value = handler(uniforms[uniformName], uniformName);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+};
+ForEach.techniqueParameter = function(technique, handler) {
+ const parameters = technique.parameters;
+ for (const parameterName in parameters) {
+ if (Object.prototype.hasOwnProperty.call(parameters, parameterName)) {
+ const value = handler(parameters[parameterName], parameterName);
+ if (defined_default(value)) {
+ return value;
+ }
+ }
+ }
+};
+ForEach.technique = function(gltf, handler) {
+ if (usesExtension_default(gltf, "KHR_techniques_webgl")) {
+ return ForEach.object(
+ gltf.extensions.KHR_techniques_webgl.techniques,
+ handler
+ );
+ }
+ return ForEach.topLevel(gltf, "techniques", handler);
+};
+ForEach.texture = function(gltf, handler) {
+ return ForEach.topLevel(gltf, "textures", handler);
+};
+var ForEach_default = ForEach;
+
+// Source/Scene/GltfPipeline/numberOfComponentsForType.js
+function numberOfComponentsForType(type) {
+ switch (type) {
+ case "SCALAR":
+ return 1;
+ case "VEC2":
+ return 2;
+ case "VEC3":
+ return 3;
+ case "VEC4":
+ case "MAT2":
+ return 4;
+ case "MAT3":
+ return 9;
+ case "MAT4":
+ return 16;
+ }
+}
+var numberOfComponentsForType_default = numberOfComponentsForType;
+
+// Source/Scene/GltfPipeline/getAccessorByteStride.js
+function getAccessorByteStride(gltf, accessor) {
+ const bufferViewId = accessor.bufferView;
+ if (defined_default(bufferViewId)) {
+ const bufferView = gltf.bufferViews[bufferViewId];
+ if (defined_default(bufferView.byteStride) && bufferView.byteStride > 0) {
+ return bufferView.byteStride;
+ }
+ }
+ return ComponentDatatype_default.getSizeInBytes(accessor.componentType) * numberOfComponentsForType_default(accessor.type);
+}
+var getAccessorByteStride_default = getAccessorByteStride;
+
+// Source/Scene/GltfPipeline/addDefaults.js
+function addDefaults(gltf) {
+ ForEach_default.accessor(gltf, function(accessor) {
+ if (defined_default(accessor.bufferView)) {
+ accessor.byteOffset = defaultValue_default(accessor.byteOffset, 0);
+ }
+ });
+ ForEach_default.bufferView(gltf, function(bufferView) {
+ if (defined_default(bufferView.buffer)) {
+ bufferView.byteOffset = defaultValue_default(bufferView.byteOffset, 0);
+ }
+ });
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ primitive.mode = defaultValue_default(primitive.mode, WebGLConstants_default.TRIANGLES);
+ if (!defined_default(primitive.material)) {
+ if (!defined_default(gltf.materials)) {
+ gltf.materials = [];
+ }
+ const defaultMaterial4 = {
+ name: "default"
+ };
+ primitive.material = addToArray_default(gltf.materials, defaultMaterial4);
+ }
+ });
+ });
+ ForEach_default.accessorContainingVertexAttributeData(gltf, function(accessorId) {
+ const accessor = gltf.accessors[accessorId];
+ const bufferViewId = accessor.bufferView;
+ accessor.normalized = defaultValue_default(accessor.normalized, false);
+ if (defined_default(bufferViewId)) {
+ const bufferView = gltf.bufferViews[bufferViewId];
+ bufferView.byteStride = getAccessorByteStride_default(gltf, accessor);
+ bufferView.target = WebGLConstants_default.ARRAY_BUFFER;
+ }
+ });
+ ForEach_default.accessorContainingIndexData(gltf, function(accessorId) {
+ const accessor = gltf.accessors[accessorId];
+ const bufferViewId = accessor.bufferView;
+ if (defined_default(bufferViewId)) {
+ const bufferView = gltf.bufferViews[bufferViewId];
+ bufferView.target = WebGLConstants_default.ELEMENT_ARRAY_BUFFER;
+ }
+ });
+ ForEach_default.material(gltf, function(material) {
+ const extensions = defaultValue_default(
+ material.extensions,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ const materialsCommon = extensions.KHR_materials_common;
+ if (defined_default(materialsCommon)) {
+ const technique = materialsCommon.technique;
+ const values = defined_default(materialsCommon.values) ? materialsCommon.values : {};
+ materialsCommon.values = values;
+ values.ambient = defined_default(values.ambient) ? values.ambient : [0, 0, 0, 1];
+ values.emission = defined_default(values.emission) ? values.emission : [0, 0, 0, 1];
+ values.transparency = defaultValue_default(values.transparency, 1);
+ if (technique !== "CONSTANT") {
+ values.diffuse = defined_default(values.diffuse) ? values.diffuse : [0, 0, 0, 1];
+ if (technique !== "LAMBERT") {
+ values.specular = defined_default(values.specular) ? values.specular : [0, 0, 0, 1];
+ values.shininess = defaultValue_default(values.shininess, 0);
+ }
+ }
+ materialsCommon.transparent = defaultValue_default(
+ materialsCommon.transparent,
+ false
+ );
+ materialsCommon.doubleSided = defaultValue_default(
+ materialsCommon.doubleSided,
+ false
+ );
+ return;
+ }
+ material.emissiveFactor = defaultValue_default(
+ material.emissiveFactor,
+ [0, 0, 0]
+ );
+ material.alphaMode = defaultValue_default(material.alphaMode, "OPAQUE");
+ material.doubleSided = defaultValue_default(material.doubleSided, false);
+ if (material.alphaMode === "MASK") {
+ material.alphaCutoff = defaultValue_default(material.alphaCutoff, 0.5);
+ }
+ const techniquesExtension = extensions.KHR_techniques_webgl;
+ if (defined_default(techniquesExtension)) {
+ ForEach_default.materialValue(material, function(materialValue) {
+ if (defined_default(materialValue.index)) {
+ addTextureDefaults(materialValue);
+ }
+ });
+ }
+ addTextureDefaults(material.emissiveTexture);
+ addTextureDefaults(material.normalTexture);
+ addTextureDefaults(material.occlusionTexture);
+ const pbrMetallicRoughness = material.pbrMetallicRoughness;
+ if (defined_default(pbrMetallicRoughness)) {
+ pbrMetallicRoughness.baseColorFactor = defaultValue_default(
+ pbrMetallicRoughness.baseColorFactor,
+ [1, 1, 1, 1]
+ );
+ pbrMetallicRoughness.metallicFactor = defaultValue_default(
+ pbrMetallicRoughness.metallicFactor,
+ 1
+ );
+ pbrMetallicRoughness.roughnessFactor = defaultValue_default(
+ pbrMetallicRoughness.roughnessFactor,
+ 1
+ );
+ addTextureDefaults(pbrMetallicRoughness.baseColorTexture);
+ addTextureDefaults(pbrMetallicRoughness.metallicRoughnessTexture);
+ }
+ const pbrSpecularGlossiness = extensions.KHR_materials_pbrSpecularGlossiness;
+ if (defined_default(pbrSpecularGlossiness)) {
+ pbrSpecularGlossiness.diffuseFactor = defaultValue_default(
+ pbrSpecularGlossiness.diffuseFactor,
+ [1, 1, 1, 1]
+ );
+ pbrSpecularGlossiness.specularFactor = defaultValue_default(
+ pbrSpecularGlossiness.specularFactor,
+ [1, 1, 1]
+ );
+ pbrSpecularGlossiness.glossinessFactor = defaultValue_default(
+ pbrSpecularGlossiness.glossinessFactor,
+ 1
+ );
+ addTextureDefaults(pbrSpecularGlossiness.specularGlossinessTexture);
+ }
+ });
+ ForEach_default.animation(gltf, function(animation) {
+ ForEach_default.animationSampler(animation, function(sampler) {
+ sampler.interpolation = defaultValue_default(sampler.interpolation, "LINEAR");
+ });
+ });
+ const animatedNodes = getAnimatedNodes(gltf);
+ ForEach_default.node(gltf, function(node, id) {
+ const animated = defined_default(animatedNodes[id]);
+ if (animated || defined_default(node.translation) || defined_default(node.rotation) || defined_default(node.scale)) {
+ node.translation = defaultValue_default(node.translation, [0, 0, 0]);
+ node.rotation = defaultValue_default(node.rotation, [0, 0, 0, 1]);
+ node.scale = defaultValue_default(node.scale, [1, 1, 1]);
+ } else {
+ node.matrix = defaultValue_default(
+ node.matrix,
+ [
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 0,
+ 0,
+ 0,
+ 0,
+ 1
+ ]
+ );
+ }
+ });
+ ForEach_default.sampler(gltf, function(sampler) {
+ sampler.wrapS = defaultValue_default(sampler.wrapS, WebGLConstants_default.REPEAT);
+ sampler.wrapT = defaultValue_default(sampler.wrapT, WebGLConstants_default.REPEAT);
+ });
+ if (defined_default(gltf.scenes) && !defined_default(gltf.scene)) {
+ gltf.scene = 0;
+ }
+ return gltf;
+}
+function getAnimatedNodes(gltf) {
+ const nodes = {};
+ ForEach_default.animation(gltf, function(animation) {
+ ForEach_default.animationChannel(animation, function(channel) {
+ const target = channel.target;
+ const nodeId = target.node;
+ const path = target.path;
+ if (path === "translation" || path === "rotation" || path === "scale") {
+ nodes[nodeId] = true;
+ }
+ });
+ });
+ return nodes;
+}
+function addTextureDefaults(texture) {
+ if (defined_default(texture)) {
+ texture.texCoord = defaultValue_default(texture.texCoord, 0);
+ }
+}
+var addDefaults_default = addDefaults;
+
+// Source/Scene/GltfPipeline/addPipelineExtras.js
+function addPipelineExtras(gltf) {
+ ForEach_default.shader(gltf, function(shader) {
+ addExtras(shader);
+ });
+ ForEach_default.buffer(gltf, function(buffer) {
+ addExtras(buffer);
+ });
+ ForEach_default.image(gltf, function(image) {
+ addExtras(image);
+ });
+ addExtras(gltf);
+ return gltf;
+}
+function addExtras(object2) {
+ object2.extras = defined_default(object2.extras) ? object2.extras : {};
+ object2.extras._pipeline = defined_default(object2.extras._pipeline) ? object2.extras._pipeline : {};
+}
+var addPipelineExtras_default = addPipelineExtras;
+
+// Source/Scene/GltfPipeline/removeExtensionsRequired.js
+function removeExtensionsRequired(gltf, extension) {
+ const extensionsRequired = gltf.extensionsRequired;
+ if (defined_default(extensionsRequired)) {
+ const index = extensionsRequired.indexOf(extension);
+ if (index >= 0) {
+ extensionsRequired.splice(index, 1);
+ }
+ if (extensionsRequired.length === 0) {
+ delete gltf.extensionsRequired;
+ }
+ }
+}
+var removeExtensionsRequired_default = removeExtensionsRequired;
+
+// Source/Scene/GltfPipeline/removeExtensionsUsed.js
+function removeExtensionsUsed(gltf, extension) {
+ const extensionsUsed = gltf.extensionsUsed;
+ if (defined_default(extensionsUsed)) {
+ const index = extensionsUsed.indexOf(extension);
+ if (index >= 0) {
+ extensionsUsed.splice(index, 1);
+ }
+ removeExtensionsRequired_default(gltf, extension);
+ if (extensionsUsed.length === 0) {
+ delete gltf.extensionsUsed;
+ }
+ }
+}
+var removeExtensionsUsed_default = removeExtensionsUsed;
+
+// Source/Scene/GltfPipeline/parseGlb.js
+var sizeOfUint323 = 4;
+function parseGlb(glb) {
+ const magic = getMagic_default(glb);
+ if (magic !== "glTF") {
+ throw new RuntimeError_default("File is not valid binary glTF");
+ }
+ const header = readHeader(glb, 0, 5);
+ const version2 = header[1];
+ if (version2 !== 1 && version2 !== 2) {
+ throw new RuntimeError_default("Binary glTF version is not 1 or 2");
+ }
+ if (version2 === 1) {
+ return parseGlbVersion1(glb, header);
+ }
+ return parseGlbVersion2(glb, header);
+}
+function readHeader(glb, byteOffset, count) {
+ const dataView = new DataView(glb.buffer);
+ const header = new Array(count);
+ for (let i = 0; i < count; ++i) {
+ header[i] = dataView.getUint32(
+ glb.byteOffset + byteOffset + i * sizeOfUint323,
+ true
+ );
+ }
+ return header;
+}
+function parseGlbVersion1(glb, header) {
+ const length3 = header[2];
+ const contentLength = header[3];
+ const contentFormat = header[4];
+ if (contentFormat !== 0) {
+ throw new RuntimeError_default("Binary glTF scene format is not JSON");
+ }
+ const jsonStart = 20;
+ const binaryStart = jsonStart + contentLength;
+ const contentString = getStringFromTypedArray_default(glb, jsonStart, contentLength);
+ const gltf = JSON.parse(contentString);
+ addPipelineExtras_default(gltf);
+ const binaryBuffer = glb.subarray(binaryStart, length3);
+ const buffers = gltf.buffers;
+ if (defined_default(buffers) && Object.keys(buffers).length > 0) {
+ const binaryGltfBuffer = defaultValue_default(
+ buffers.binary_glTF,
+ buffers.KHR_binary_glTF
+ );
+ if (defined_default(binaryGltfBuffer)) {
+ binaryGltfBuffer.extras._pipeline.source = binaryBuffer;
+ delete binaryGltfBuffer.uri;
+ }
+ }
+ removeExtensionsUsed_default(gltf, "KHR_binary_glTF");
+ return gltf;
+}
+function parseGlbVersion2(glb, header) {
+ const length3 = header[2];
+ let byteOffset = 12;
+ let gltf;
+ let binaryBuffer;
+ while (byteOffset < length3) {
+ const chunkHeader = readHeader(glb, byteOffset, 2);
+ const chunkLength = chunkHeader[0];
+ const chunkType = chunkHeader[1];
+ byteOffset += 8;
+ const chunkBuffer = glb.subarray(byteOffset, byteOffset + chunkLength);
+ byteOffset += chunkLength;
+ if (chunkType === 1313821514) {
+ const jsonString = getStringFromTypedArray_default(chunkBuffer);
+ gltf = JSON.parse(jsonString);
+ addPipelineExtras_default(gltf);
+ } else if (chunkType === 5130562) {
+ binaryBuffer = chunkBuffer;
+ }
+ }
+ if (defined_default(gltf) && defined_default(binaryBuffer)) {
+ const buffers = gltf.buffers;
+ if (defined_default(buffers) && buffers.length > 0) {
+ const buffer = buffers[0];
+ buffer.extras._pipeline.source = binaryBuffer;
+ }
+ }
+ return gltf;
+}
+var parseGlb_default = parseGlb;
+
+// Source/Scene/GltfPipeline/removePipelineExtras.js
+function removePipelineExtras(gltf) {
+ ForEach_default.shader(gltf, function(shader) {
+ removeExtras(shader);
+ });
+ ForEach_default.buffer(gltf, function(buffer) {
+ removeExtras(buffer);
+ });
+ ForEach_default.image(gltf, function(image) {
+ removeExtras(image);
+ });
+ removeExtras(gltf);
+ return gltf;
+}
+function removeExtras(object2) {
+ if (!defined_default(object2.extras)) {
+ return;
+ }
+ if (defined_default(object2.extras._pipeline)) {
+ delete object2.extras._pipeline;
+ }
+ if (Object.keys(object2.extras).length === 0) {
+ delete object2.extras;
+ }
+}
+var removePipelineExtras_default = removePipelineExtras;
+
+// Source/Scene/GltfPipeline/addExtensionsUsed.js
+function addExtensionsUsed(gltf, extension) {
+ let extensionsUsed = gltf.extensionsUsed;
+ if (!defined_default(extensionsUsed)) {
+ extensionsUsed = [];
+ gltf.extensionsUsed = extensionsUsed;
+ }
+ addToArray_default(extensionsUsed, extension, true);
+}
+var addExtensionsUsed_default = addExtensionsUsed;
+
+// Source/Scene/GltfPipeline/getComponentReader.js
+function getComponentReader(componentType) {
+ switch (componentType) {
+ case ComponentDatatype_default.BYTE:
+ return function(dataView, byteOffset, numberOfComponents, componentTypeByteLength, result) {
+ for (let i = 0; i < numberOfComponents; ++i) {
+ result[i] = dataView.getInt8(
+ byteOffset + i * componentTypeByteLength
+ );
+ }
+ };
+ case ComponentDatatype_default.UNSIGNED_BYTE:
+ return function(dataView, byteOffset, numberOfComponents, componentTypeByteLength, result) {
+ for (let i = 0; i < numberOfComponents; ++i) {
+ result[i] = dataView.getUint8(
+ byteOffset + i * componentTypeByteLength
+ );
+ }
+ };
+ case ComponentDatatype_default.SHORT:
+ return function(dataView, byteOffset, numberOfComponents, componentTypeByteLength, result) {
+ for (let i = 0; i < numberOfComponents; ++i) {
+ result[i] = dataView.getInt16(
+ byteOffset + i * componentTypeByteLength,
+ true
+ );
+ }
+ };
+ case ComponentDatatype_default.UNSIGNED_SHORT:
+ return function(dataView, byteOffset, numberOfComponents, componentTypeByteLength, result) {
+ for (let i = 0; i < numberOfComponents; ++i) {
+ result[i] = dataView.getUint16(
+ byteOffset + i * componentTypeByteLength,
+ true
+ );
+ }
+ };
+ case ComponentDatatype_default.INT:
+ return function(dataView, byteOffset, numberOfComponents, componentTypeByteLength, result) {
+ for (let i = 0; i < numberOfComponents; ++i) {
+ result[i] = dataView.getInt32(
+ byteOffset + i * componentTypeByteLength,
+ true
+ );
+ }
+ };
+ case ComponentDatatype_default.UNSIGNED_INT:
+ return function(dataView, byteOffset, numberOfComponents, componentTypeByteLength, result) {
+ for (let i = 0; i < numberOfComponents; ++i) {
+ result[i] = dataView.getUint32(
+ byteOffset + i * componentTypeByteLength,
+ true
+ );
+ }
+ };
+ case ComponentDatatype_default.FLOAT:
+ return function(dataView, byteOffset, numberOfComponents, componentTypeByteLength, result) {
+ for (let i = 0; i < numberOfComponents; ++i) {
+ result[i] = dataView.getFloat32(
+ byteOffset + i * componentTypeByteLength,
+ true
+ );
+ }
+ };
+ case ComponentDatatype_default.DOUBLE:
+ return function(dataView, byteOffset, numberOfComponents, componentTypeByteLength, result) {
+ for (let i = 0; i < numberOfComponents; ++i) {
+ result[i] = dataView.getFloat64(
+ byteOffset + i * componentTypeByteLength,
+ true
+ );
+ }
+ };
+ }
+}
+var getComponentReader_default = getComponentReader;
+
+// Source/Scene/GltfPipeline/findAccessorMinMax.js
+function findAccessorMinMax(gltf, accessor) {
+ const bufferViews = gltf.bufferViews;
+ const buffers = gltf.buffers;
+ const bufferViewId = accessor.bufferView;
+ const numberOfComponents = numberOfComponentsForType_default(accessor.type);
+ if (!defined_default(accessor.bufferView)) {
+ return {
+ min: new Array(numberOfComponents).fill(0),
+ max: new Array(numberOfComponents).fill(0)
+ };
+ }
+ const min3 = new Array(numberOfComponents).fill(Number.POSITIVE_INFINITY);
+ const max3 = new Array(numberOfComponents).fill(Number.NEGATIVE_INFINITY);
+ const bufferView = bufferViews[bufferViewId];
+ const bufferId = bufferView.buffer;
+ const buffer = buffers[bufferId];
+ const source = buffer.extras._pipeline.source;
+ const count = accessor.count;
+ const byteStride = getAccessorByteStride_default(gltf, accessor);
+ let byteOffset = accessor.byteOffset + bufferView.byteOffset + source.byteOffset;
+ const componentType = accessor.componentType;
+ const componentTypeByteLength = ComponentDatatype_default.getSizeInBytes(componentType);
+ const dataView = new DataView(source.buffer);
+ const components = new Array(numberOfComponents);
+ const componentReader = getComponentReader_default(componentType);
+ for (let i = 0; i < count; i++) {
+ componentReader(
+ dataView,
+ byteOffset,
+ numberOfComponents,
+ componentTypeByteLength,
+ components
+ );
+ for (let j = 0; j < numberOfComponents; j++) {
+ const value = components[j];
+ min3[j] = Math.min(min3[j], value);
+ max3[j] = Math.max(max3[j], value);
+ }
+ byteOffset += byteStride;
+ }
+ return {
+ min: min3,
+ max: max3
+ };
+}
+var findAccessorMinMax_default = findAccessorMinMax;
+
+// Source/Scene/GltfPipeline/moveTechniqueRenderStates.js
+var defaultBlendEquation = [WebGLConstants_default.FUNC_ADD, WebGLConstants_default.FUNC_ADD];
+var defaultBlendFactors = [
+ WebGLConstants_default.ONE,
+ WebGLConstants_default.ZERO,
+ WebGLConstants_default.ONE,
+ WebGLConstants_default.ZERO
+];
+function isStateEnabled(renderStates, state) {
+ const enabled = renderStates.enable;
+ if (!defined_default(enabled)) {
+ return false;
+ }
+ return enabled.indexOf(state) > -1;
+}
+var supportedBlendFactors = [
+ WebGLConstants_default.ZERO,
+ WebGLConstants_default.ONE,
+ WebGLConstants_default.SRC_COLOR,
+ WebGLConstants_default.ONE_MINUS_SRC_COLOR,
+ WebGLConstants_default.SRC_ALPHA,
+ WebGLConstants_default.ONE_MINUS_SRC_ALPHA,
+ WebGLConstants_default.DST_ALPHA,
+ WebGLConstants_default.ONE_MINUS_DST_ALPHA,
+ WebGLConstants_default.DST_COLOR,
+ WebGLConstants_default.ONE_MINUS_DST_COLOR
+];
+function getSupportedBlendFactors(value, defaultValue2) {
+ if (!defined_default(value)) {
+ return defaultValue2;
+ }
+ for (let i = 0; i < 4; i++) {
+ if (supportedBlendFactors.indexOf(value[i]) === -1) {
+ return defaultValue2;
+ }
+ }
+ return value;
+}
+function moveTechniqueRenderStates(gltf) {
+ const blendingForTechnique = {};
+ const materialPropertiesForTechnique = {};
+ const techniquesLegacy = gltf.techniques;
+ if (!defined_default(techniquesLegacy)) {
+ return gltf;
+ }
+ ForEach_default.technique(gltf, function(techniqueLegacy, techniqueIndex) {
+ const renderStates = techniqueLegacy.states;
+ if (defined_default(renderStates)) {
+ const materialProperties = materialPropertiesForTechnique[techniqueIndex] = {};
+ if (isStateEnabled(renderStates, WebGLConstants_default.BLEND)) {
+ materialProperties.alphaMode = "BLEND";
+ const blendFunctions = renderStates.functions;
+ if (defined_default(blendFunctions) && (defined_default(blendFunctions.blendEquationSeparate) || defined_default(blendFunctions.blendFuncSeparate))) {
+ blendingForTechnique[techniqueIndex] = {
+ blendEquation: defaultValue_default(
+ blendFunctions.blendEquationSeparate,
+ defaultBlendEquation
+ ),
+ blendFactors: getSupportedBlendFactors(
+ blendFunctions.blendFuncSeparate,
+ defaultBlendFactors
+ )
+ };
+ }
+ }
+ if (!isStateEnabled(renderStates, WebGLConstants_default.CULL_FACE)) {
+ materialProperties.doubleSided = true;
+ }
+ delete techniqueLegacy.states;
+ }
+ });
+ if (Object.keys(blendingForTechnique).length > 0) {
+ if (!defined_default(gltf.extensions)) {
+ gltf.extensions = {};
+ }
+ addExtensionsUsed_default(gltf, "KHR_blend");
+ }
+ ForEach_default.material(gltf, function(material) {
+ if (defined_default(material.technique)) {
+ const materialProperties = materialPropertiesForTechnique[material.technique];
+ ForEach_default.objectLegacy(materialProperties, function(value, property) {
+ material[property] = value;
+ });
+ const blending = blendingForTechnique[material.technique];
+ if (defined_default(blending)) {
+ if (!defined_default(material.extensions)) {
+ material.extensions = {};
+ }
+ material.extensions.KHR_blend = blending;
+ }
+ }
+ });
+ return gltf;
+}
+var moveTechniqueRenderStates_default = moveTechniqueRenderStates;
+
+// Source/Scene/GltfPipeline/addExtensionsRequired.js
+function addExtensionsRequired(gltf, extension) {
+ let extensionsRequired = gltf.extensionsRequired;
+ if (!defined_default(extensionsRequired)) {
+ extensionsRequired = [];
+ gltf.extensionsRequired = extensionsRequired;
+ }
+ addToArray_default(extensionsRequired, extension, true);
+ addExtensionsUsed_default(gltf, extension);
+}
+var addExtensionsRequired_default = addExtensionsRequired;
+
+// Source/Scene/GltfPipeline/moveTechniquesToExtension.js
+function moveTechniquesToExtension(gltf) {
+ const techniquesLegacy = gltf.techniques;
+ const mappedUniforms = {};
+ const updatedTechniqueIndices = {};
+ const seenPrograms = {};
+ if (defined_default(techniquesLegacy)) {
+ const extension = {
+ programs: [],
+ shaders: [],
+ techniques: []
+ };
+ const glExtensions = gltf.glExtensionsUsed;
+ delete gltf.glExtensionsUsed;
+ ForEach_default.technique(gltf, function(techniqueLegacy, techniqueId) {
+ const technique = {
+ name: techniqueLegacy.name,
+ program: void 0,
+ attributes: {},
+ uniforms: {}
+ };
+ let parameterLegacy;
+ ForEach_default.techniqueAttribute(
+ techniqueLegacy,
+ function(parameterName, attributeName) {
+ parameterLegacy = techniqueLegacy.parameters[parameterName];
+ technique.attributes[attributeName] = {
+ semantic: parameterLegacy.semantic
+ };
+ }
+ );
+ ForEach_default.techniqueUniform(
+ techniqueLegacy,
+ function(parameterName, uniformName) {
+ parameterLegacy = techniqueLegacy.parameters[parameterName];
+ technique.uniforms[uniformName] = {
+ count: parameterLegacy.count,
+ node: parameterLegacy.node,
+ type: parameterLegacy.type,
+ semantic: parameterLegacy.semantic,
+ value: parameterLegacy.value
+ };
+ if (!defined_default(mappedUniforms[techniqueId])) {
+ mappedUniforms[techniqueId] = {};
+ }
+ mappedUniforms[techniqueId][parameterName] = uniformName;
+ }
+ );
+ if (!defined_default(seenPrograms[techniqueLegacy.program])) {
+ const programLegacy = gltf.programs[techniqueLegacy.program];
+ const program = {
+ name: programLegacy.name,
+ fragmentShader: void 0,
+ vertexShader: void 0,
+ glExtensions
+ };
+ const fs = gltf.shaders[programLegacy.fragmentShader];
+ program.fragmentShader = addToArray_default(extension.shaders, fs, true);
+ const vs = gltf.shaders[programLegacy.vertexShader];
+ program.vertexShader = addToArray_default(extension.shaders, vs, true);
+ technique.program = addToArray_default(extension.programs, program);
+ seenPrograms[techniqueLegacy.program] = technique.program;
+ } else {
+ technique.program = seenPrograms[techniqueLegacy.program];
+ }
+ updatedTechniqueIndices[techniqueId] = addToArray_default(
+ extension.techniques,
+ technique
+ );
+ });
+ if (extension.techniques.length > 0) {
+ if (!defined_default(gltf.extensions)) {
+ gltf.extensions = {};
+ }
+ gltf.extensions.KHR_techniques_webgl = extension;
+ addExtensionsUsed_default(gltf, "KHR_techniques_webgl");
+ addExtensionsRequired_default(gltf, "KHR_techniques_webgl");
+ }
+ }
+ ForEach_default.material(gltf, function(material) {
+ if (defined_default(material.technique)) {
+ const materialExtension = {
+ technique: updatedTechniqueIndices[material.technique]
+ };
+ ForEach_default.objectLegacy(material.values, function(value, parameterName) {
+ if (!defined_default(materialExtension.values)) {
+ materialExtension.values = {};
+ }
+ const uniformName = mappedUniforms[material.technique][parameterName];
+ if (defined_default(uniformName)) {
+ materialExtension.values[uniformName] = value;
+ }
+ });
+ if (!defined_default(material.extensions)) {
+ material.extensions = {};
+ }
+ material.extensions.KHR_techniques_webgl = materialExtension;
+ }
+ delete material.technique;
+ delete material.values;
+ });
+ delete gltf.techniques;
+ delete gltf.programs;
+ delete gltf.shaders;
+ return gltf;
+}
+var moveTechniquesToExtension_default = moveTechniquesToExtension;
+
+// Source/Scene/GltfPipeline/forEachTextureInMaterial.js
+function forEachTextureInMaterial(material, handler) {
+ Check_default.typeOf.object("material", material);
+ Check_default.defined("handler", handler);
+ const pbrMetallicRoughness = material.pbrMetallicRoughness;
+ if (defined_default(pbrMetallicRoughness)) {
+ if (defined_default(pbrMetallicRoughness.baseColorTexture)) {
+ const textureInfo = pbrMetallicRoughness.baseColorTexture;
+ const value2 = handler(textureInfo.index, textureInfo);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ if (defined_default(pbrMetallicRoughness.metallicRoughnessTexture)) {
+ const textureInfo = pbrMetallicRoughness.metallicRoughnessTexture;
+ const value2 = handler(textureInfo.index, textureInfo);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ }
+ if (defined_default(material.extensions)) {
+ const pbrSpecularGlossiness = material.extensions.KHR_materials_pbrSpecularGlossiness;
+ if (defined_default(pbrSpecularGlossiness)) {
+ if (defined_default(pbrSpecularGlossiness.diffuseTexture)) {
+ const textureInfo = pbrSpecularGlossiness.diffuseTexture;
+ const value2 = handler(textureInfo.index, textureInfo);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ if (defined_default(pbrSpecularGlossiness.specularGlossinessTexture)) {
+ const textureInfo = pbrSpecularGlossiness.specularGlossinessTexture;
+ const value2 = handler(textureInfo.index, textureInfo);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ }
+ const materialsCommon = material.extensions.KHR_materials_common;
+ if (defined_default(materialsCommon) && defined_default(materialsCommon.values)) {
+ const diffuse = materialsCommon.values.diffuse;
+ const ambient = materialsCommon.values.ambient;
+ const emission = materialsCommon.values.emission;
+ const specular = materialsCommon.values.specular;
+ if (defined_default(diffuse) && defined_default(diffuse.index)) {
+ const value2 = handler(diffuse.index, diffuse);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ if (defined_default(ambient) && defined_default(ambient.index)) {
+ const value2 = handler(ambient.index, ambient);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ if (defined_default(emission) && defined_default(emission.index)) {
+ const value2 = handler(emission.index, emission);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ if (defined_default(specular) && defined_default(specular.index)) {
+ const value2 = handler(specular.index, specular);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ }
+ }
+ const value = ForEach_default.materialValue(material, function(materialValue) {
+ if (defined_default(materialValue.index)) {
+ const value2 = handler(materialValue.index, materialValue);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ });
+ if (defined_default(value)) {
+ return value;
+ }
+ if (defined_default(material.emissiveTexture)) {
+ const textureInfo = material.emissiveTexture;
+ const value2 = handler(textureInfo.index, textureInfo);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ if (defined_default(material.normalTexture)) {
+ const textureInfo = material.normalTexture;
+ const value2 = handler(textureInfo.index, textureInfo);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+ if (defined_default(material.occlusionTexture)) {
+ const textureInfo = material.occlusionTexture;
+ const value2 = handler(textureInfo.index, textureInfo);
+ if (defined_default(value2)) {
+ return value2;
+ }
+ }
+}
+var forEachTextureInMaterial_default = forEachTextureInMaterial;
+
+// Source/Scene/GltfPipeline/removeUnusedElements.js
+var allElementTypes = [
+ "mesh",
+ "node",
+ "material",
+ "accessor",
+ "bufferView",
+ "buffer",
+ "texture",
+ "sampler",
+ "image"
+];
+function removeUnusedElements(gltf, elementTypes) {
+ elementTypes = defaultValue_default(elementTypes, allElementTypes);
+ allElementTypes.forEach(function(type) {
+ if (elementTypes.indexOf(type) > -1) {
+ removeUnusedElementsByType(gltf, type);
+ }
+ });
+ return gltf;
+}
+var TypeToGltfElementName = {
+ accessor: "accessors",
+ buffer: "buffers",
+ bufferView: "bufferViews",
+ image: "images",
+ node: "nodes",
+ material: "materials",
+ mesh: "meshes",
+ sampler: "samplers",
+ texture: "textures"
+};
+function removeUnusedElementsByType(gltf, type) {
+ const name = TypeToGltfElementName[type];
+ const arrayOfObjects = gltf[name];
+ if (defined_default(arrayOfObjects)) {
+ let removed = 0;
+ const usedIds = getListOfElementsIdsInUse[type](gltf);
+ const length3 = arrayOfObjects.length;
+ for (let i = 0; i < length3; ++i) {
+ if (!usedIds[i]) {
+ Remove[type](gltf, i - removed);
+ removed++;
+ }
+ }
+ }
+}
+function Remove() {
+}
+Remove.accessor = function(gltf, accessorId) {
+ const accessors = gltf.accessors;
+ accessors.splice(accessorId, 1);
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ ForEach_default.meshPrimitiveAttribute(
+ primitive,
+ function(attributeAccessorId, semantic) {
+ if (attributeAccessorId > accessorId) {
+ primitive.attributes[semantic]--;
+ }
+ }
+ );
+ ForEach_default.meshPrimitiveTarget(primitive, function(target) {
+ ForEach_default.meshPrimitiveTargetAttribute(
+ target,
+ function(attributeAccessorId, semantic) {
+ if (attributeAccessorId > accessorId) {
+ target[semantic]--;
+ }
+ }
+ );
+ });
+ const indices2 = primitive.indices;
+ if (defined_default(indices2) && indices2 > accessorId) {
+ primitive.indices--;
+ }
+ });
+ });
+ ForEach_default.skin(gltf, function(skin) {
+ if (defined_default(skin.inverseBindMatrices) && skin.inverseBindMatrices > accessorId) {
+ skin.inverseBindMatrices--;
+ }
+ });
+ ForEach_default.animation(gltf, function(animation) {
+ ForEach_default.animationSampler(animation, function(sampler) {
+ if (defined_default(sampler.input) && sampler.input > accessorId) {
+ sampler.input--;
+ }
+ if (defined_default(sampler.output) && sampler.output > accessorId) {
+ sampler.output--;
+ }
+ });
+ });
+};
+Remove.buffer = function(gltf, bufferId) {
+ const buffers = gltf.buffers;
+ buffers.splice(bufferId, 1);
+ ForEach_default.bufferView(gltf, function(bufferView) {
+ if (defined_default(bufferView.buffer) && bufferView.buffer > bufferId) {
+ bufferView.buffer--;
+ }
+ if (defined_default(bufferView.extensions) && defined_default(bufferView.extensions.EXT_meshopt_compression)) {
+ bufferView.extensions.EXT_meshopt_compression.buffer--;
+ }
+ });
+};
+Remove.bufferView = function(gltf, bufferViewId) {
+ const bufferViews = gltf.bufferViews;
+ bufferViews.splice(bufferViewId, 1);
+ ForEach_default.accessor(gltf, function(accessor) {
+ if (defined_default(accessor.bufferView) && accessor.bufferView > bufferViewId) {
+ accessor.bufferView--;
+ }
+ });
+ ForEach_default.shader(gltf, function(shader) {
+ if (defined_default(shader.bufferView) && shader.bufferView > bufferViewId) {
+ shader.bufferView--;
+ }
+ });
+ ForEach_default.image(gltf, function(image) {
+ if (defined_default(image.bufferView) && image.bufferView > bufferViewId) {
+ image.bufferView--;
+ }
+ });
+ if (usesExtension_default(gltf, "KHR_draco_mesh_compression")) {
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ if (defined_default(primitive.extensions) && defined_default(primitive.extensions.KHR_draco_mesh_compression)) {
+ if (primitive.extensions.KHR_draco_mesh_compression.bufferView > bufferViewId) {
+ primitive.extensions.KHR_draco_mesh_compression.bufferView--;
+ }
+ }
+ });
+ });
+ }
+ if (usesExtension_default(gltf, "EXT_feature_metadata")) {
+ const extension = gltf.extensions.EXT_feature_metadata;
+ const featureTables = extension.featureTables;
+ for (const featureTableId in featureTables) {
+ if (featureTables.hasOwnProperty(featureTableId)) {
+ const featureTable = featureTables[featureTableId];
+ const properties = featureTable.properties;
+ if (defined_default(properties)) {
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ if (defined_default(property.bufferView) && property.bufferView > bufferViewId) {
+ property.bufferView--;
+ }
+ if (defined_default(property.arrayOffsetBufferView) && property.arrayOffsetBufferView > bufferViewId) {
+ property.arrayOffsetBufferView--;
+ }
+ if (defined_default(property.stringOffsetBufferView) && property.stringOffsetBufferView > bufferViewId) {
+ property.stringOffsetBufferView--;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if (usesExtension_default(gltf, "EXT_structural_metadata")) {
+ const extension = gltf.extensions.EXT_structural_metadata;
+ const propertyTables = extension.propertyTables;
+ if (defined_default(propertyTables)) {
+ const propertyTablesLength = propertyTables.length;
+ for (let i = 0; i < propertyTablesLength; ++i) {
+ const propertyTable = propertyTables[i];
+ const properties = propertyTable.properties;
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ if (defined_default(property.values) && property.values > bufferViewId) {
+ property.values--;
+ }
+ if (defined_default(property.arrayOffsets) && property.arrayOffsets > bufferViewId) {
+ property.arrayOffsets--;
+ }
+ if (defined_default(property.stringOffsets) && property.stringOffsets > bufferViewId) {
+ property.stringOffsets--;
+ }
+ }
+ }
+ }
+ }
+ }
+};
+Remove.image = function(gltf, imageId) {
+ const images = gltf.images;
+ images.splice(imageId, 1);
+ ForEach_default.texture(gltf, function(texture) {
+ if (defined_default(texture.source)) {
+ if (texture.source > imageId) {
+ --texture.source;
+ }
+ }
+ const ext = texture.extensions;
+ if (defined_default(ext) && defined_default(ext.EXT_texture_webp) && ext.EXT_texture_webp.source > imageId) {
+ --texture.extensions.EXT_texture_webp.source;
+ } else if (defined_default(ext) && defined_default(ext.KHR_texture_basisu) && ext.KHR_texture_basisu.source > imageId) {
+ --texture.extensions.KHR_texture_basisu.source;
+ }
+ });
+};
+Remove.mesh = function(gltf, meshId) {
+ const meshes = gltf.meshes;
+ meshes.splice(meshId, 1);
+ ForEach_default.node(gltf, function(node) {
+ if (defined_default(node.mesh)) {
+ if (node.mesh > meshId) {
+ node.mesh--;
+ } else if (node.mesh === meshId) {
+ delete node.mesh;
+ }
+ }
+ });
+};
+Remove.node = function(gltf, nodeId) {
+ const nodes = gltf.nodes;
+ nodes.splice(nodeId, 1);
+ ForEach_default.skin(gltf, function(skin) {
+ if (defined_default(skin.skeleton) && skin.skeleton > nodeId) {
+ skin.skeleton--;
+ }
+ skin.joints = skin.joints.map(function(x) {
+ return x > nodeId ? x - 1 : x;
+ });
+ });
+ ForEach_default.animation(gltf, function(animation) {
+ ForEach_default.animationChannel(animation, function(channel) {
+ if (defined_default(channel.target) && defined_default(channel.target.node) && channel.target.node > nodeId) {
+ channel.target.node--;
+ }
+ });
+ });
+ ForEach_default.technique(gltf, function(technique) {
+ ForEach_default.techniqueUniform(technique, function(uniform) {
+ if (defined_default(uniform.node) && uniform.node > nodeId) {
+ uniform.node--;
+ }
+ });
+ });
+ ForEach_default.node(gltf, function(node) {
+ if (!defined_default(node.children)) {
+ return;
+ }
+ node.children = node.children.filter(function(x) {
+ return x !== nodeId;
+ }).map(function(x) {
+ return x > nodeId ? x - 1 : x;
+ });
+ });
+ ForEach_default.scene(gltf, function(scene) {
+ scene.nodes = scene.nodes.filter(function(x) {
+ return x !== nodeId;
+ }).map(function(x) {
+ return x > nodeId ? x - 1 : x;
+ });
+ });
+};
+Remove.material = function(gltf, materialId) {
+ const materials = gltf.materials;
+ materials.splice(materialId, 1);
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ if (defined_default(primitive.material) && primitive.material > materialId) {
+ primitive.material--;
+ }
+ });
+ });
+};
+Remove.sampler = function(gltf, samplerId) {
+ const samplers = gltf.samplers;
+ samplers.splice(samplerId, 1);
+ ForEach_default.texture(gltf, function(texture) {
+ if (defined_default(texture.sampler)) {
+ if (texture.sampler > samplerId) {
+ --texture.sampler;
+ }
+ }
+ });
+};
+Remove.texture = function(gltf, textureId) {
+ const textures = gltf.textures;
+ textures.splice(textureId, 1);
+ ForEach_default.material(gltf, function(material) {
+ forEachTextureInMaterial_default(material, function(textureIndex, textureInfo) {
+ if (textureInfo.index > textureId) {
+ --textureInfo.index;
+ }
+ });
+ });
+ if (usesExtension_default(gltf, "EXT_feature_metadata")) {
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ const extensions = primitive.extensions;
+ if (defined_default(extensions) && defined_default(extensions.EXT_feature_metadata)) {
+ const extension2 = extensions.EXT_feature_metadata;
+ const featureIdTextures = extension2.featureIdTextures;
+ if (defined_default(featureIdTextures)) {
+ const featureIdTexturesLength = featureIdTextures.length;
+ for (let i = 0; i < featureIdTexturesLength; ++i) {
+ const featureIdTexture = featureIdTextures[i];
+ const textureInfo = featureIdTexture.featureIds.texture;
+ if (textureInfo.index > textureId) {
+ --textureInfo.index;
+ }
+ }
+ }
+ }
+ });
+ });
+ const extension = gltf.extensions.EXT_feature_metadata;
+ const featureTextures = extension.featureTextures;
+ for (const featureTextureId in featureTextures) {
+ if (featureTextures.hasOwnProperty(featureTextureId)) {
+ const featureTexture = featureTextures[featureTextureId];
+ const properties = featureTexture.properties;
+ if (defined_default(properties)) {
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ const textureInfo = property.texture;
+ if (textureInfo.index > textureId) {
+ --textureInfo.index;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if (usesExtension_default(gltf, "EXT_mesh_features")) {
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ const extensions = primitive.extensions;
+ if (defined_default(extensions) && defined_default(extensions.EXT_mesh_features)) {
+ const extension = extensions.EXT_mesh_features;
+ const featureIds = extension.featureIds;
+ if (defined_default(featureIds)) {
+ const featureIdsLength = featureIds.length;
+ for (let i = 0; i < featureIdsLength; ++i) {
+ const featureId = featureIds[i];
+ if (defined_default(featureId.texture)) {
+ if (featureId.texture.index > textureId) {
+ --featureId.texture.index;
+ }
+ }
+ }
+ }
+ }
+ });
+ });
+ }
+ if (usesExtension_default(gltf, "EXT_structural_metadata")) {
+ const extension = gltf.extensions.EXT_structural_metadata;
+ const propertyTextures = extension.propertyTextures;
+ if (defined_default(propertyTextures)) {
+ const propertyTexturesLength = propertyTextures.length;
+ for (let i = 0; i < propertyTexturesLength; ++i) {
+ const propertyTexture = propertyTextures[i];
+ const properties = propertyTexture.properties;
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ if (property.index > textureId) {
+ --property.index;
+ }
+ }
+ }
+ }
+ }
+ }
+};
+function getListOfElementsIdsInUse() {
+}
+getListOfElementsIdsInUse.accessor = function(gltf) {
+ const usedAccessorIds = {};
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ ForEach_default.meshPrimitiveAttribute(primitive, function(accessorId) {
+ usedAccessorIds[accessorId] = true;
+ });
+ ForEach_default.meshPrimitiveTarget(primitive, function(target) {
+ ForEach_default.meshPrimitiveTargetAttribute(target, function(accessorId) {
+ usedAccessorIds[accessorId] = true;
+ });
+ });
+ const indices2 = primitive.indices;
+ if (defined_default(indices2)) {
+ usedAccessorIds[indices2] = true;
+ }
+ });
+ });
+ ForEach_default.skin(gltf, function(skin) {
+ if (defined_default(skin.inverseBindMatrices)) {
+ usedAccessorIds[skin.inverseBindMatrices] = true;
+ }
+ });
+ ForEach_default.animation(gltf, function(animation) {
+ ForEach_default.animationSampler(animation, function(sampler) {
+ if (defined_default(sampler.input)) {
+ usedAccessorIds[sampler.input] = true;
+ }
+ if (defined_default(sampler.output)) {
+ usedAccessorIds[sampler.output] = true;
+ }
+ });
+ });
+ if (usesExtension_default(gltf, "EXT_mesh_gpu_instancing")) {
+ ForEach_default.node(gltf, function(node) {
+ if (defined_default(node.extensions) && defined_default(node.extensions.EXT_mesh_gpu_instancing)) {
+ Object.keys(node.extensions.EXT_mesh_gpu_instancing.attributes).forEach(
+ function(key) {
+ const attributeAccessorId = node.extensions.EXT_mesh_gpu_instancing.attributes[key];
+ usedAccessorIds[attributeAccessorId] = true;
+ }
+ );
+ }
+ });
+ }
+ return usedAccessorIds;
+};
+getListOfElementsIdsInUse.buffer = function(gltf) {
+ const usedBufferIds = {};
+ ForEach_default.bufferView(gltf, function(bufferView) {
+ if (defined_default(bufferView.buffer)) {
+ usedBufferIds[bufferView.buffer] = true;
+ }
+ if (defined_default(bufferView.extensions) && defined_default(bufferView.extensions.EXT_meshopt_compression)) {
+ usedBufferIds[bufferView.extensions.EXT_meshopt_compression.buffer] = true;
+ }
+ });
+ return usedBufferIds;
+};
+getListOfElementsIdsInUse.bufferView = function(gltf) {
+ const usedBufferViewIds = {};
+ ForEach_default.accessor(gltf, function(accessor) {
+ if (defined_default(accessor.bufferView)) {
+ usedBufferViewIds[accessor.bufferView] = true;
+ }
+ });
+ ForEach_default.shader(gltf, function(shader) {
+ if (defined_default(shader.bufferView)) {
+ usedBufferViewIds[shader.bufferView] = true;
+ }
+ });
+ ForEach_default.image(gltf, function(image) {
+ if (defined_default(image.bufferView)) {
+ usedBufferViewIds[image.bufferView] = true;
+ }
+ });
+ if (usesExtension_default(gltf, "KHR_draco_mesh_compression")) {
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ if (defined_default(primitive.extensions) && defined_default(primitive.extensions.KHR_draco_mesh_compression)) {
+ usedBufferViewIds[primitive.extensions.KHR_draco_mesh_compression.bufferView] = true;
+ }
+ });
+ });
+ }
+ if (usesExtension_default(gltf, "EXT_feature_metadata")) {
+ const extension = gltf.extensions.EXT_feature_metadata;
+ const featureTables = extension.featureTables;
+ for (const featureTableId in featureTables) {
+ if (featureTables.hasOwnProperty(featureTableId)) {
+ const featureTable = featureTables[featureTableId];
+ const properties = featureTable.properties;
+ if (defined_default(properties)) {
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ if (defined_default(property.bufferView)) {
+ usedBufferViewIds[property.bufferView] = true;
+ }
+ if (defined_default(property.arrayOffsetBufferView)) {
+ usedBufferViewIds[property.arrayOffsetBufferView] = true;
+ }
+ if (defined_default(property.stringOffsetBufferView)) {
+ usedBufferViewIds[property.stringOffsetBufferView] = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ if (usesExtension_default(gltf, "EXT_structural_metadata")) {
+ const extension = gltf.extensions.EXT_structural_metadata;
+ const propertyTables = extension.propertyTables;
+ if (defined_default(propertyTables)) {
+ const propertyTablesLength = propertyTables.length;
+ for (let i = 0; i < propertyTablesLength; ++i) {
+ const propertyTable = propertyTables[i];
+ const properties = propertyTable.properties;
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ if (defined_default(property.values)) {
+ usedBufferViewIds[property.values] = true;
+ }
+ if (defined_default(property.arrayOffsets)) {
+ usedBufferViewIds[property.arrayOffsets] = true;
+ }
+ if (defined_default(property.stringOffsets)) {
+ usedBufferViewIds[property.stringOffsets] = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ return usedBufferViewIds;
+};
+getListOfElementsIdsInUse.image = function(gltf) {
+ const usedImageIds = {};
+ ForEach_default.texture(gltf, function(texture) {
+ if (defined_default(texture.source)) {
+ usedImageIds[texture.source] = true;
+ }
+ if (defined_default(texture.extensions) && defined_default(texture.extensions.EXT_texture_webp)) {
+ usedImageIds[texture.extensions.EXT_texture_webp.source] = true;
+ } else if (defined_default(texture.extensions) && defined_default(texture.extensions.KHR_texture_basisu)) {
+ usedImageIds[texture.extensions.KHR_texture_basisu.source] = true;
+ }
+ });
+ return usedImageIds;
+};
+getListOfElementsIdsInUse.mesh = function(gltf) {
+ const usedMeshIds = {};
+ ForEach_default.node(gltf, function(node) {
+ if (defined_default(node.mesh && defined_default(gltf.meshes))) {
+ const mesh = gltf.meshes[node.mesh];
+ if (defined_default(mesh) && defined_default(mesh.primitives) && mesh.primitives.length > 0) {
+ usedMeshIds[node.mesh] = true;
+ }
+ }
+ });
+ return usedMeshIds;
+};
+function nodeIsEmpty(gltf, nodeId, usedNodeIds) {
+ const node = gltf.nodes[nodeId];
+ if (defined_default(node.mesh) || defined_default(node.camera) || defined_default(node.skin) || defined_default(node.weights) || defined_default(node.extras) || defined_default(node.extensions) && Object.keys(node.extensions).length !== 0 || defined_default(usedNodeIds[nodeId])) {
+ return false;
+ }
+ return !defined_default(node.children) || node.children.filter(function(n) {
+ return !nodeIsEmpty(gltf, n, usedNodeIds);
+ }).length === 0;
+}
+getListOfElementsIdsInUse.node = function(gltf) {
+ const usedNodeIds = {};
+ ForEach_default.skin(gltf, function(skin) {
+ if (defined_default(skin.skeleton)) {
+ usedNodeIds[skin.skeleton] = true;
+ }
+ ForEach_default.skinJoint(skin, function(joint) {
+ usedNodeIds[joint] = true;
+ });
+ });
+ ForEach_default.animation(gltf, function(animation) {
+ ForEach_default.animationChannel(animation, function(channel) {
+ if (defined_default(channel.target) && defined_default(channel.target.node)) {
+ usedNodeIds[channel.target.node] = true;
+ }
+ });
+ });
+ ForEach_default.technique(gltf, function(technique) {
+ ForEach_default.techniqueUniform(technique, function(uniform) {
+ if (defined_default(uniform.node)) {
+ usedNodeIds[uniform.node] = true;
+ }
+ });
+ });
+ ForEach_default.node(gltf, function(node, nodeId) {
+ if (!nodeIsEmpty(gltf, nodeId, usedNodeIds)) {
+ usedNodeIds[nodeId] = true;
+ }
+ });
+ return usedNodeIds;
+};
+getListOfElementsIdsInUse.material = function(gltf) {
+ const usedMaterialIds = {};
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ if (defined_default(primitive.material)) {
+ usedMaterialIds[primitive.material] = true;
+ }
+ });
+ });
+ return usedMaterialIds;
+};
+getListOfElementsIdsInUse.texture = function(gltf) {
+ const usedTextureIds = {};
+ ForEach_default.material(gltf, function(material) {
+ forEachTextureInMaterial_default(material, function(textureId) {
+ usedTextureIds[textureId] = true;
+ });
+ });
+ if (usesExtension_default(gltf, "EXT_feature_metadata")) {
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ const extensions = primitive.extensions;
+ if (defined_default(extensions) && defined_default(extensions.EXT_feature_metadata)) {
+ const extension2 = extensions.EXT_feature_metadata;
+ const featureIdTextures = extension2.featureIdTextures;
+ if (defined_default(featureIdTextures)) {
+ const featureIdTexturesLength = featureIdTextures.length;
+ for (let i = 0; i < featureIdTexturesLength; ++i) {
+ const featureIdTexture = featureIdTextures[i];
+ const textureInfo = featureIdTexture.featureIds.texture;
+ usedTextureIds[textureInfo.index] = true;
+ }
+ }
+ }
+ });
+ });
+ const extension = gltf.extensions.EXT_feature_metadata;
+ const featureTextures = extension.featureTextures;
+ for (const featureTextureId in featureTextures) {
+ if (featureTextures.hasOwnProperty(featureTextureId)) {
+ const featureTexture = featureTextures[featureTextureId];
+ const properties = featureTexture.properties;
+ if (defined_default(properties)) {
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ const textureInfo = property.texture;
+ usedTextureIds[textureInfo.index] = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (usesExtension_default(gltf, "EXT_mesh_features")) {
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ const extensions = primitive.extensions;
+ if (defined_default(extensions) && defined_default(extensions.EXT_mesh_features)) {
+ const extension = extensions.EXT_mesh_features;
+ const featureIds = extension.featureIds;
+ if (defined_default(featureIds)) {
+ const featureIdsLength = featureIds.length;
+ for (let i = 0; i < featureIdsLength; ++i) {
+ const featureId = featureIds[i];
+ if (defined_default(featureId.texture)) {
+ usedTextureIds[featureId.texture.index] = true;
+ }
+ }
+ }
+ }
+ });
+ });
+ }
+ if (usesExtension_default(gltf, "EXT_structural_metadata")) {
+ const extension = gltf.extensions.EXT_structural_metadata;
+ const propertyTextures = extension.propertyTextures;
+ if (defined_default(propertyTextures)) {
+ const propertyTexturesLength = propertyTextures.length;
+ for (let i = 0; i < propertyTexturesLength; ++i) {
+ const propertyTexture = propertyTextures[i];
+ const properties = propertyTexture.properties;
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ usedTextureIds[property.index] = true;
+ }
+ }
+ }
+ }
+ }
+ return usedTextureIds;
+};
+getListOfElementsIdsInUse.sampler = function(gltf) {
+ const usedSamplerIds = {};
+ ForEach_default.texture(gltf, function(texture) {
+ if (defined_default(texture.sampler)) {
+ usedSamplerIds[texture.sampler] = true;
+ }
+ });
+ return usedSamplerIds;
+};
+var removeUnusedElements_default = removeUnusedElements;
+
+// Source/Scene/GltfPipeline/addBuffer.js
+function addBuffer(gltf, buffer) {
+ const newBuffer = {
+ byteLength: buffer.length,
+ extras: {
+ _pipeline: {
+ source: buffer
+ }
+ }
+ };
+ const bufferId = addToArray_default(gltf.buffers, newBuffer);
+ const bufferView = {
+ buffer: bufferId,
+ byteOffset: 0,
+ byteLength: buffer.length
+ };
+ return addToArray_default(gltf.bufferViews, bufferView);
+}
+var addBuffer_default = addBuffer;
+
+// Source/Scene/GltfPipeline/readAccessorPacked.js
+function readAccessorPacked(gltf, accessor) {
+ const byteStride = getAccessorByteStride_default(gltf, accessor);
+ const componentTypeByteLength = ComponentDatatype_default.getSizeInBytes(
+ accessor.componentType
+ );
+ const numberOfComponents = numberOfComponentsForType_default(accessor.type);
+ const count = accessor.count;
+ const values = new Array(numberOfComponents * count);
+ if (!defined_default(accessor.bufferView)) {
+ return values.fill(0);
+ }
+ const bufferView = gltf.bufferViews[accessor.bufferView];
+ const source = gltf.buffers[bufferView.buffer].extras._pipeline.source;
+ let byteOffset = accessor.byteOffset + bufferView.byteOffset + source.byteOffset;
+ const dataView = new DataView(source.buffer);
+ const components = new Array(numberOfComponents);
+ const componentReader = getComponentReader_default(accessor.componentType);
+ for (let i = 0; i < count; ++i) {
+ componentReader(
+ dataView,
+ byteOffset,
+ numberOfComponents,
+ componentTypeByteLength,
+ components
+ );
+ for (let j = 0; j < numberOfComponents; ++j) {
+ values[i * numberOfComponents + j] = components[j];
+ }
+ byteOffset += byteStride;
+ }
+ return values;
+}
+var readAccessorPacked_default = readAccessorPacked;
+
+// Source/Scene/GltfPipeline/updateAccessorComponentTypes.js
+function updateAccessorComponentTypes(gltf) {
+ let componentType;
+ ForEach_default.accessorWithSemantic(gltf, "JOINTS_0", function(accessorId) {
+ const accessor = gltf.accessors[accessorId];
+ componentType = accessor.componentType;
+ if (componentType === WebGLConstants_default.BYTE) {
+ convertType(gltf, accessor, ComponentDatatype_default.UNSIGNED_BYTE);
+ } else if (componentType !== WebGLConstants_default.UNSIGNED_BYTE && componentType !== WebGLConstants_default.UNSIGNED_SHORT) {
+ convertType(gltf, accessor, ComponentDatatype_default.UNSIGNED_SHORT);
+ }
+ });
+ ForEach_default.accessorWithSemantic(gltf, "WEIGHTS_0", function(accessorId) {
+ const accessor = gltf.accessors[accessorId];
+ componentType = accessor.componentType;
+ if (componentType === WebGLConstants_default.BYTE) {
+ convertType(gltf, accessor, ComponentDatatype_default.UNSIGNED_BYTE);
+ } else if (componentType === WebGLConstants_default.SHORT) {
+ convertType(gltf, accessor, ComponentDatatype_default.UNSIGNED_SHORT);
+ }
+ });
+ return gltf;
+}
+function convertType(gltf, accessor, updatedComponentType) {
+ const typedArray = ComponentDatatype_default.createTypedArray(
+ updatedComponentType,
+ readAccessorPacked_default(gltf, accessor)
+ );
+ const newBuffer = new Uint8Array(typedArray.buffer);
+ accessor.bufferView = addBuffer_default(gltf, newBuffer);
+ accessor.componentType = updatedComponentType;
+ accessor.byteOffset = 0;
+}
+var updateAccessorComponentTypes_default = updateAccessorComponentTypes;
+
+// Source/Scene/GltfPipeline/removeExtension.js
+function removeExtension2(gltf, extension) {
+ removeExtensionsUsed_default(gltf, extension);
+ if (extension === "CESIUM_RTC") {
+ removeCesiumRTC(gltf);
+ }
+ return removeExtensionAndTraverse(gltf, extension);
+}
+function removeCesiumRTC(gltf) {
+ ForEach_default.technique(gltf, function(technique) {
+ ForEach_default.techniqueUniform(technique, function(uniform) {
+ if (uniform.semantic === "CESIUM_RTC_MODELVIEW") {
+ uniform.semantic = "MODELVIEW";
+ }
+ });
+ });
+}
+function removeExtensionAndTraverse(object2, extension) {
+ if (Array.isArray(object2)) {
+ const length3 = object2.length;
+ for (let i = 0; i < length3; ++i) {
+ removeExtensionAndTraverse(object2[i], extension);
+ }
+ } else if (object2 !== null && typeof object2 === "object" && object2.constructor === Object) {
+ const extensions = object2.extensions;
+ let extensionData;
+ if (defined_default(extensions)) {
+ extensionData = extensions[extension];
+ if (defined_default(extensionData)) {
+ delete extensions[extension];
+ if (Object.keys(extensions).length === 0) {
+ delete object2.extensions;
+ }
+ }
+ }
+ for (const key in object2) {
+ if (Object.prototype.hasOwnProperty.call(object2, key)) {
+ removeExtensionAndTraverse(object2[key], extension);
+ }
+ }
+ return extensionData;
+ }
+}
+var removeExtension_default = removeExtension2;
+
+// Source/Scene/GltfPipeline/updateVersion.js
+var updateFunctions = {
+ 0.8: glTF08to10,
+ "1.0": glTF10to20,
+ "2.0": void 0
+};
+function updateVersion(gltf, options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const targetVersion = options.targetVersion;
+ let version2 = gltf.version;
+ gltf.asset = defaultValue_default(gltf.asset, {
+ version: "1.0"
+ });
+ gltf.asset.version = defaultValue_default(gltf.asset.version, "1.0");
+ version2 = defaultValue_default(version2, gltf.asset.version).toString();
+ if (!Object.prototype.hasOwnProperty.call(updateFunctions, version2)) {
+ if (defined_default(version2)) {
+ version2 = version2.substring(0, 3);
+ }
+ if (!Object.prototype.hasOwnProperty.call(updateFunctions, version2)) {
+ version2 = "1.0";
+ }
+ }
+ let updateFunction = updateFunctions[version2];
+ while (defined_default(updateFunction)) {
+ if (version2 === targetVersion) {
+ break;
+ }
+ updateFunction(gltf, options);
+ version2 = gltf.asset.version;
+ updateFunction = updateFunctions[version2];
+ }
+ if (!options.keepLegacyExtensions) {
+ convertTechniquesToPbr(gltf);
+ convertMaterialsCommonToPbr(gltf);
+ }
+ return gltf;
+}
+function updateInstanceTechniques(gltf) {
+ const materials = gltf.materials;
+ for (const materialId in materials) {
+ if (Object.prototype.hasOwnProperty.call(materials, materialId)) {
+ const material = materials[materialId];
+ const instanceTechnique = material.instanceTechnique;
+ if (defined_default(instanceTechnique)) {
+ material.technique = instanceTechnique.technique;
+ material.values = instanceTechnique.values;
+ delete material.instanceTechnique;
+ }
+ }
+ }
+}
+function setPrimitiveModes(gltf) {
+ const meshes = gltf.meshes;
+ for (const meshId in meshes) {
+ if (Object.prototype.hasOwnProperty.call(meshes, meshId)) {
+ const mesh = meshes[meshId];
+ const primitives = mesh.primitives;
+ if (defined_default(primitives)) {
+ const primitivesLength = primitives.length;
+ for (let i = 0; i < primitivesLength; ++i) {
+ const primitive = primitives[i];
+ const defaultMode = defaultValue_default(
+ primitive.primitive,
+ WebGLConstants_default.TRIANGLES
+ );
+ primitive.mode = defaultValue_default(primitive.mode, defaultMode);
+ delete primitive.primitive;
+ }
+ }
+ }
+ }
+}
+function updateNodes(gltf) {
+ const nodes = gltf.nodes;
+ const axis = new Cartesian3_default();
+ const quat = new Quaternion_default();
+ for (const nodeId in nodes) {
+ if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {
+ const node = nodes[nodeId];
+ if (defined_default(node.rotation)) {
+ const rotation = node.rotation;
+ Cartesian3_default.fromArray(rotation, 0, axis);
+ Quaternion_default.fromAxisAngle(axis, rotation[3], quat);
+ node.rotation = [quat.x, quat.y, quat.z, quat.w];
+ }
+ const instanceSkin = node.instanceSkin;
+ if (defined_default(instanceSkin)) {
+ node.skeletons = instanceSkin.skeletons;
+ node.skin = instanceSkin.skin;
+ node.meshes = instanceSkin.meshes;
+ delete node.instanceSkin;
+ }
+ }
+ }
+}
+function updateAnimations(gltf) {
+ const animations = gltf.animations;
+ const accessors = gltf.accessors;
+ const bufferViews = gltf.bufferViews;
+ const buffers = gltf.buffers;
+ const updatedAccessors = {};
+ const axis = new Cartesian3_default();
+ const quat = new Quaternion_default();
+ for (const animationId in animations) {
+ if (Object.prototype.hasOwnProperty.call(animations, animationId)) {
+ const animation = animations[animationId];
+ const channels = animation.channels;
+ const parameters = animation.parameters;
+ const samplers = animation.samplers;
+ if (defined_default(channels)) {
+ const channelsLength = channels.length;
+ for (let i = 0; i < channelsLength; ++i) {
+ const channel = channels[i];
+ if (channel.target.path === "rotation") {
+ const accessorId = parameters[samplers[channel.sampler].output];
+ if (defined_default(updatedAccessors[accessorId])) {
+ continue;
+ }
+ updatedAccessors[accessorId] = true;
+ const accessor = accessors[accessorId];
+ const bufferView = bufferViews[accessor.bufferView];
+ const buffer = buffers[bufferView.buffer];
+ const source = buffer.extras._pipeline.source;
+ const byteOffset = source.byteOffset + bufferView.byteOffset + accessor.byteOffset;
+ const componentType = accessor.componentType;
+ const count = accessor.count;
+ const componentsLength = numberOfComponentsForType_default(accessor.type);
+ const length3 = accessor.count * componentsLength;
+ const typedArray = ComponentDatatype_default.createArrayBufferView(
+ componentType,
+ source.buffer,
+ byteOffset,
+ length3
+ );
+ for (let j = 0; j < count; j++) {
+ const offset2 = j * componentsLength;
+ Cartesian3_default.unpack(typedArray, offset2, axis);
+ const angle = typedArray[offset2 + 3];
+ Quaternion_default.fromAxisAngle(axis, angle, quat);
+ Quaternion_default.pack(quat, typedArray, offset2);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+function removeTechniquePasses(gltf) {
+ const techniques = gltf.techniques;
+ for (const techniqueId in techniques) {
+ if (Object.prototype.hasOwnProperty.call(techniques, techniqueId)) {
+ const technique = techniques[techniqueId];
+ const passes = technique.passes;
+ if (defined_default(passes)) {
+ const passName = defaultValue_default(technique.pass, "defaultPass");
+ if (Object.prototype.hasOwnProperty.call(passes, passName)) {
+ const pass = passes[passName];
+ const instanceProgram = pass.instanceProgram;
+ technique.attributes = defaultValue_default(
+ technique.attributes,
+ instanceProgram.attributes
+ );
+ technique.program = defaultValue_default(
+ technique.program,
+ instanceProgram.program
+ );
+ technique.uniforms = defaultValue_default(
+ technique.uniforms,
+ instanceProgram.uniforms
+ );
+ technique.states = defaultValue_default(technique.states, pass.states);
+ }
+ delete technique.passes;
+ delete technique.pass;
+ }
+ }
+ }
+}
+function glTF08to10(gltf) {
+ if (!defined_default(gltf.asset)) {
+ gltf.asset = {};
+ }
+ const asset = gltf.asset;
+ asset.version = "1.0";
+ if (typeof asset.profile === "string") {
+ const split = asset.profile.split(" ");
+ asset.profile = {
+ api: split[0],
+ version: split[1]
+ };
+ } else {
+ asset.profile = {};
+ }
+ if (defined_default(gltf.version)) {
+ delete gltf.version;
+ }
+ updateInstanceTechniques(gltf);
+ setPrimitiveModes(gltf);
+ updateNodes(gltf);
+ updateAnimations(gltf);
+ removeTechniquePasses(gltf);
+ if (defined_default(gltf.allExtensions)) {
+ gltf.extensionsUsed = gltf.allExtensions;
+ delete gltf.allExtensions;
+ }
+ if (defined_default(gltf.lights)) {
+ const extensions = defaultValue_default(gltf.extensions, {});
+ gltf.extensions = extensions;
+ const materialsCommon = defaultValue_default(extensions.KHR_materials_common, {});
+ extensions.KHR_materials_common = materialsCommon;
+ materialsCommon.lights = gltf.lights;
+ delete gltf.lights;
+ addExtensionsUsed_default(gltf, "KHR_materials_common");
+ }
+}
+function removeAnimationSamplersIndirection(gltf) {
+ const animations = gltf.animations;
+ for (const animationId in animations) {
+ if (Object.prototype.hasOwnProperty.call(animations, animationId)) {
+ const animation = animations[animationId];
+ const parameters = animation.parameters;
+ if (defined_default(parameters)) {
+ const samplers = animation.samplers;
+ for (const samplerId in samplers) {
+ if (Object.prototype.hasOwnProperty.call(samplers, samplerId)) {
+ const sampler = samplers[samplerId];
+ sampler.input = parameters[sampler.input];
+ sampler.output = parameters[sampler.output];
+ }
+ }
+ delete animation.parameters;
+ }
+ }
+ }
+}
+function objectToArray(object2, mapping) {
+ const array = [];
+ for (const id in object2) {
+ if (Object.prototype.hasOwnProperty.call(object2, id)) {
+ const value = object2[id];
+ mapping[id] = array.length;
+ array.push(value);
+ if (!defined_default(value.name)) {
+ value.name = id;
+ }
+ }
+ }
+ return array;
+}
+function objectsToArrays(gltf) {
+ let i;
+ const globalMapping = {
+ accessors: {},
+ animations: {},
+ buffers: {},
+ bufferViews: {},
+ cameras: {},
+ images: {},
+ materials: {},
+ meshes: {},
+ nodes: {},
+ programs: {},
+ samplers: {},
+ scenes: {},
+ shaders: {},
+ skins: {},
+ textures: {},
+ techniques: {}
+ };
+ let jointName;
+ const jointNameToId = {};
+ const nodes = gltf.nodes;
+ for (const id in nodes) {
+ if (Object.prototype.hasOwnProperty.call(nodes, id)) {
+ jointName = nodes[id].jointName;
+ if (defined_default(jointName)) {
+ jointNameToId[jointName] = id;
+ }
+ }
+ }
+ for (const topLevelId in gltf) {
+ if (Object.prototype.hasOwnProperty.call(gltf, topLevelId) && defined_default(globalMapping[topLevelId])) {
+ const objectMapping = {};
+ const object2 = gltf[topLevelId];
+ gltf[topLevelId] = objectToArray(object2, objectMapping);
+ globalMapping[topLevelId] = objectMapping;
+ }
+ }
+ for (jointName in jointNameToId) {
+ if (Object.prototype.hasOwnProperty.call(jointNameToId, jointName)) {
+ jointNameToId[jointName] = globalMapping.nodes[jointNameToId[jointName]];
+ }
+ }
+ if (defined_default(gltf.scene)) {
+ gltf.scene = globalMapping.scenes[gltf.scene];
+ }
+ ForEach_default.bufferView(gltf, function(bufferView) {
+ if (defined_default(bufferView.buffer)) {
+ bufferView.buffer = globalMapping.buffers[bufferView.buffer];
+ }
+ });
+ ForEach_default.accessor(gltf, function(accessor) {
+ if (defined_default(accessor.bufferView)) {
+ accessor.bufferView = globalMapping.bufferViews[accessor.bufferView];
+ }
+ });
+ ForEach_default.shader(gltf, function(shader) {
+ const extensions = shader.extensions;
+ if (defined_default(extensions)) {
+ const binaryGltf = extensions.KHR_binary_glTF;
+ if (defined_default(binaryGltf)) {
+ shader.bufferView = globalMapping.bufferViews[binaryGltf.bufferView];
+ delete extensions.KHR_binary_glTF;
+ }
+ if (Object.keys(extensions).length === 0) {
+ delete shader.extensions;
+ }
+ }
+ });
+ ForEach_default.program(gltf, function(program) {
+ if (defined_default(program.vertexShader)) {
+ program.vertexShader = globalMapping.shaders[program.vertexShader];
+ }
+ if (defined_default(program.fragmentShader)) {
+ program.fragmentShader = globalMapping.shaders[program.fragmentShader];
+ }
+ });
+ ForEach_default.technique(gltf, function(technique) {
+ if (defined_default(technique.program)) {
+ technique.program = globalMapping.programs[technique.program];
+ }
+ ForEach_default.techniqueParameter(technique, function(parameter) {
+ if (defined_default(parameter.node)) {
+ parameter.node = globalMapping.nodes[parameter.node];
+ }
+ const value = parameter.value;
+ if (typeof value === "string") {
+ parameter.value = {
+ index: globalMapping.textures[value]
+ };
+ }
+ });
+ });
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ if (defined_default(primitive.indices)) {
+ primitive.indices = globalMapping.accessors[primitive.indices];
+ }
+ ForEach_default.meshPrimitiveAttribute(
+ primitive,
+ function(accessorId, semantic) {
+ primitive.attributes[semantic] = globalMapping.accessors[accessorId];
+ }
+ );
+ if (defined_default(primitive.material)) {
+ primitive.material = globalMapping.materials[primitive.material];
+ }
+ });
+ });
+ ForEach_default.node(gltf, function(node) {
+ let children = node.children;
+ if (defined_default(children)) {
+ const childrenLength = children.length;
+ for (i = 0; i < childrenLength; ++i) {
+ children[i] = globalMapping.nodes[children[i]];
+ }
+ }
+ if (defined_default(node.meshes)) {
+ const meshes = node.meshes;
+ const meshesLength = meshes.length;
+ if (meshesLength > 0) {
+ node.mesh = globalMapping.meshes[meshes[0]];
+ for (i = 1; i < meshesLength; ++i) {
+ const meshNode = {
+ mesh: globalMapping.meshes[meshes[i]]
+ };
+ const meshNodeId = addToArray_default(gltf.nodes, meshNode);
+ if (!defined_default(children)) {
+ children = [];
+ node.children = children;
+ }
+ children.push(meshNodeId);
+ }
+ }
+ delete node.meshes;
+ }
+ if (defined_default(node.camera)) {
+ node.camera = globalMapping.cameras[node.camera];
+ }
+ if (defined_default(node.skin)) {
+ node.skin = globalMapping.skins[node.skin];
+ }
+ if (defined_default(node.skeletons)) {
+ const skeletons = node.skeletons;
+ const skeletonsLength = skeletons.length;
+ if (skeletonsLength > 0 && defined_default(node.skin)) {
+ const skin = gltf.skins[node.skin];
+ skin.skeleton = globalMapping.nodes[skeletons[0]];
+ }
+ delete node.skeletons;
+ }
+ if (defined_default(node.jointName)) {
+ delete node.jointName;
+ }
+ });
+ ForEach_default.skin(gltf, function(skin) {
+ if (defined_default(skin.inverseBindMatrices)) {
+ skin.inverseBindMatrices = globalMapping.accessors[skin.inverseBindMatrices];
+ }
+ const jointNames = skin.jointNames;
+ if (defined_default(jointNames)) {
+ const joints = [];
+ const jointNamesLength = jointNames.length;
+ for (i = 0; i < jointNamesLength; ++i) {
+ joints[i] = jointNameToId[jointNames[i]];
+ }
+ skin.joints = joints;
+ delete skin.jointNames;
+ }
+ });
+ ForEach_default.scene(gltf, function(scene) {
+ const sceneNodes = scene.nodes;
+ if (defined_default(sceneNodes)) {
+ const sceneNodesLength = sceneNodes.length;
+ for (i = 0; i < sceneNodesLength; ++i) {
+ sceneNodes[i] = globalMapping.nodes[sceneNodes[i]];
+ }
+ }
+ });
+ ForEach_default.animation(gltf, function(animation) {
+ const samplerMapping = {};
+ animation.samplers = objectToArray(animation.samplers, samplerMapping);
+ ForEach_default.animationSampler(animation, function(sampler) {
+ sampler.input = globalMapping.accessors[sampler.input];
+ sampler.output = globalMapping.accessors[sampler.output];
+ });
+ ForEach_default.animationChannel(animation, function(channel) {
+ channel.sampler = samplerMapping[channel.sampler];
+ const target = channel.target;
+ if (defined_default(target)) {
+ target.node = globalMapping.nodes[target.id];
+ delete target.id;
+ }
+ });
+ });
+ ForEach_default.material(gltf, function(material) {
+ if (defined_default(material.technique)) {
+ material.technique = globalMapping.techniques[material.technique];
+ }
+ ForEach_default.materialValue(material, function(value, name) {
+ if (typeof value === "string") {
+ material.values[name] = {
+ index: globalMapping.textures[value]
+ };
+ }
+ });
+ const extensions = material.extensions;
+ if (defined_default(extensions)) {
+ const materialsCommon = extensions.KHR_materials_common;
+ if (defined_default(materialsCommon) && defined_default(materialsCommon.values)) {
+ ForEach_default.materialValue(materialsCommon, function(value, name) {
+ if (typeof value === "string") {
+ materialsCommon.values[name] = {
+ index: globalMapping.textures[value]
+ };
+ }
+ });
+ }
+ }
+ });
+ ForEach_default.image(gltf, function(image) {
+ const extensions = image.extensions;
+ if (defined_default(extensions)) {
+ const binaryGltf = extensions.KHR_binary_glTF;
+ if (defined_default(binaryGltf)) {
+ image.bufferView = globalMapping.bufferViews[binaryGltf.bufferView];
+ image.mimeType = binaryGltf.mimeType;
+ delete extensions.KHR_binary_glTF;
+ }
+ if (Object.keys(extensions).length === 0) {
+ delete image.extensions;
+ }
+ }
+ });
+ ForEach_default.texture(gltf, function(texture) {
+ if (defined_default(texture.sampler)) {
+ texture.sampler = globalMapping.samplers[texture.sampler];
+ }
+ if (defined_default(texture.source)) {
+ texture.source = globalMapping.images[texture.source];
+ }
+ });
+}
+function removeAnimationSamplerNames(gltf) {
+ ForEach_default.animation(gltf, function(animation) {
+ ForEach_default.animationSampler(animation, function(sampler) {
+ delete sampler.name;
+ });
+ });
+}
+function removeEmptyArrays(gltf) {
+ for (const topLevelId in gltf) {
+ if (Object.prototype.hasOwnProperty.call(gltf, topLevelId)) {
+ const array = gltf[topLevelId];
+ if (Array.isArray(array) && array.length === 0) {
+ delete gltf[topLevelId];
+ }
+ }
+ }
+ ForEach_default.node(gltf, function(node) {
+ if (defined_default(node.children) && node.children.length === 0) {
+ delete node.children;
+ }
+ });
+}
+function stripAsset(gltf) {
+ const asset = gltf.asset;
+ delete asset.profile;
+ delete asset.premultipliedAlpha;
+}
+var knownExtensions = {
+ CESIUM_RTC: true,
+ KHR_materials_common: true,
+ WEB3D_quantized_attributes: true
+};
+function requireKnownExtensions(gltf) {
+ const extensionsUsed = gltf.extensionsUsed;
+ gltf.extensionsRequired = defaultValue_default(gltf.extensionsRequired, []);
+ if (defined_default(extensionsUsed)) {
+ const extensionsUsedLength = extensionsUsed.length;
+ for (let i = 0; i < extensionsUsedLength; ++i) {
+ const extension = extensionsUsed[i];
+ if (defined_default(knownExtensions[extension])) {
+ gltf.extensionsRequired.push(extension);
+ }
+ }
+ }
+}
+function removeBufferType(gltf) {
+ ForEach_default.buffer(gltf, function(buffer) {
+ delete buffer.type;
+ });
+}
+function removeTextureProperties(gltf) {
+ ForEach_default.texture(gltf, function(texture) {
+ delete texture.format;
+ delete texture.internalFormat;
+ delete texture.target;
+ delete texture.type;
+ });
+}
+function requireAttributeSetIndex(gltf) {
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ ForEach_default.meshPrimitiveAttribute(
+ primitive,
+ function(accessorId, semantic) {
+ if (semantic === "TEXCOORD") {
+ primitive.attributes.TEXCOORD_0 = accessorId;
+ } else if (semantic === "COLOR") {
+ primitive.attributes.COLOR_0 = accessorId;
+ }
+ }
+ );
+ delete primitive.attributes.TEXCOORD;
+ delete primitive.attributes.COLOR;
+ });
+ });
+ ForEach_default.technique(gltf, function(technique) {
+ ForEach_default.techniqueParameter(technique, function(parameter) {
+ const semantic = parameter.semantic;
+ if (defined_default(semantic)) {
+ if (semantic === "TEXCOORD") {
+ parameter.semantic = "TEXCOORD_0";
+ } else if (semantic === "COLOR") {
+ parameter.semantic = "COLOR_0";
+ }
+ }
+ });
+ });
+}
+var knownSemantics = {
+ POSITION: true,
+ NORMAL: true,
+ TANGENT: true
+};
+var indexedSemantics = {
+ COLOR: "COLOR",
+ JOINT: "JOINTS",
+ JOINTS: "JOINTS",
+ TEXCOORD: "TEXCOORD",
+ WEIGHT: "WEIGHTS",
+ WEIGHTS: "WEIGHTS"
+};
+function underscoreApplicationSpecificSemantics(gltf) {
+ const mappedSemantics = {};
+ ForEach_default.mesh(gltf, function(mesh) {
+ ForEach_default.meshPrimitive(mesh, function(primitive) {
+ ForEach_default.meshPrimitiveAttribute(
+ primitive,
+ function(accessorId, semantic) {
+ if (semantic.charAt(0) !== "_") {
+ const setIndex = semantic.search(/_[0-9]+/g);
+ let strippedSemantic = semantic;
+ let suffix = "_0";
+ if (setIndex >= 0) {
+ strippedSemantic = semantic.substring(0, setIndex);
+ suffix = semantic.substring(setIndex);
+ }
+ let newSemantic;
+ const indexedSemantic = indexedSemantics[strippedSemantic];
+ if (defined_default(indexedSemantic)) {
+ newSemantic = indexedSemantic + suffix;
+ mappedSemantics[semantic] = newSemantic;
+ } else if (!defined_default(knownSemantics[strippedSemantic])) {
+ newSemantic = `_${semantic}`;
+ mappedSemantics[semantic] = newSemantic;
+ }
+ }
+ }
+ );
+ for (const semantic in mappedSemantics) {
+ if (Object.prototype.hasOwnProperty.call(mappedSemantics, semantic)) {
+ const mappedSemantic = mappedSemantics[semantic];
+ const accessorId = primitive.attributes[semantic];
+ if (defined_default(accessorId)) {
+ delete primitive.attributes[semantic];
+ primitive.attributes[mappedSemantic] = accessorId;
+ }
+ }
+ }
+ });
+ });
+ ForEach_default.technique(gltf, function(technique) {
+ ForEach_default.techniqueParameter(technique, function(parameter) {
+ const mappedSemantic = mappedSemantics[parameter.semantic];
+ if (defined_default(mappedSemantic)) {
+ parameter.semantic = mappedSemantic;
+ }
+ });
+ });
+}
+function clampCameraParameters(gltf) {
+ ForEach_default.camera(gltf, function(camera) {
+ const perspective = camera.perspective;
+ if (defined_default(perspective)) {
+ const aspectRatio = perspective.aspectRatio;
+ if (defined_default(aspectRatio) && aspectRatio === 0) {
+ delete perspective.aspectRatio;
+ }
+ const yfov = perspective.yfov;
+ if (defined_default(yfov) && yfov === 0) {
+ perspective.yfov = 1;
+ }
+ }
+ });
+}
+function computeAccessorByteStride(gltf, accessor) {
+ return defined_default(accessor.byteStride) && accessor.byteStride !== 0 ? accessor.byteStride : getAccessorByteStride_default(gltf, accessor);
+}
+function requireByteLength(gltf) {
+ ForEach_default.buffer(gltf, function(buffer) {
+ if (!defined_default(buffer.byteLength)) {
+ buffer.byteLength = buffer.extras._pipeline.source.length;
+ }
+ });
+ ForEach_default.accessor(gltf, function(accessor) {
+ const bufferViewId = accessor.bufferView;
+ if (defined_default(bufferViewId)) {
+ const bufferView = gltf.bufferViews[bufferViewId];
+ const accessorByteStride = computeAccessorByteStride(gltf, accessor);
+ const accessorByteEnd = accessor.byteOffset + accessor.count * accessorByteStride;
+ bufferView.byteLength = Math.max(
+ defaultValue_default(bufferView.byteLength, 0),
+ accessorByteEnd
+ );
+ }
+ });
+}
+function moveByteStrideToBufferView(gltf) {
+ let i;
+ let j;
+ let bufferView;
+ const bufferViews = gltf.bufferViews;
+ const bufferViewHasVertexAttributes = {};
+ ForEach_default.accessorContainingVertexAttributeData(gltf, function(accessorId) {
+ const accessor = gltf.accessors[accessorId];
+ if (defined_default(accessor.bufferView)) {
+ bufferViewHasVertexAttributes[accessor.bufferView] = true;
+ }
+ });
+ const bufferViewMap = {};
+ ForEach_default.accessor(gltf, function(accessor) {
+ if (defined_default(accessor.bufferView)) {
+ bufferViewMap[accessor.bufferView] = defaultValue_default(
+ bufferViewMap[accessor.bufferView],
+ []
+ );
+ bufferViewMap[accessor.bufferView].push(accessor);
+ }
+ });
+ for (const bufferViewId in bufferViewMap) {
+ if (Object.prototype.hasOwnProperty.call(bufferViewMap, bufferViewId)) {
+ bufferView = bufferViews[bufferViewId];
+ const accessors = bufferViewMap[bufferViewId];
+ accessors.sort(function(a3, b) {
+ return a3.byteOffset - b.byteOffset;
+ });
+ let currentByteOffset = 0;
+ let currentIndex = 0;
+ const accessorsLength = accessors.length;
+ for (i = 0; i < accessorsLength; ++i) {
+ let accessor = accessors[i];
+ const accessorByteStride = computeAccessorByteStride(gltf, accessor);
+ const accessorByteOffset = accessor.byteOffset;
+ const accessorByteLength = accessor.count * accessorByteStride;
+ delete accessor.byteStride;
+ const hasNextAccessor = i < accessorsLength - 1;
+ const nextAccessorByteStride = hasNextAccessor ? computeAccessorByteStride(gltf, accessors[i + 1]) : void 0;
+ if (accessorByteStride !== nextAccessorByteStride) {
+ const newBufferView = clone_default(bufferView, true);
+ if (bufferViewHasVertexAttributes[bufferViewId]) {
+ newBufferView.byteStride = accessorByteStride;
+ }
+ newBufferView.byteOffset += currentByteOffset;
+ newBufferView.byteLength = accessorByteOffset + accessorByteLength - currentByteOffset;
+ const newBufferViewId = addToArray_default(bufferViews, newBufferView);
+ for (j = currentIndex; j <= i; ++j) {
+ accessor = accessors[j];
+ accessor.bufferView = newBufferViewId;
+ accessor.byteOffset = accessor.byteOffset - currentByteOffset;
+ }
+ currentByteOffset = hasNextAccessor ? accessors[i + 1].byteOffset : void 0;
+ currentIndex = i + 1;
+ }
+ }
+ }
+ }
+ removeUnusedElements_default(gltf, ["accessor", "bufferView", "buffer"]);
+}
+function requirePositionAccessorMinMax(gltf) {
+ ForEach_default.accessorWithSemantic(gltf, "POSITION", function(accessorId) {
+ const accessor = gltf.accessors[accessorId];
+ if (!defined_default(accessor.min) || !defined_default(accessor.max)) {
+ const minMax = findAccessorMinMax_default(gltf, accessor);
+ accessor.min = minMax.min;
+ accessor.max = minMax.max;
+ }
+ });
+}
+function isNodeEmpty(node) {
+ return (!defined_default(node.children) || node.children.length === 0) && (!defined_default(node.meshes) || node.meshes.length === 0) && !defined_default(node.camera) && !defined_default(node.skin) && !defined_default(node.skeletons) && !defined_default(node.jointName) && (!defined_default(node.translation) || Cartesian3_default.fromArray(node.translation).equals(Cartesian3_default.ZERO)) && (!defined_default(node.scale) || Cartesian3_default.fromArray(node.scale).equals(new Cartesian3_default(1, 1, 1))) && (!defined_default(node.rotation) || Cartesian4_default.fromArray(node.rotation).equals(
+ new Cartesian4_default(0, 0, 0, 1)
+ )) && (!defined_default(node.matrix) || Matrix4_default.fromColumnMajorArray(node.matrix).equals(Matrix4_default.IDENTITY)) && !defined_default(node.extensions) && !defined_default(node.extras);
+}
+function deleteNode(gltf, nodeId) {
+ ForEach_default.scene(gltf, function(scene) {
+ const sceneNodes = scene.nodes;
+ if (defined_default(sceneNodes)) {
+ const sceneNodesLength = sceneNodes.length;
+ for (let i = sceneNodesLength; i >= 0; --i) {
+ if (sceneNodes[i] === nodeId) {
+ sceneNodes.splice(i, 1);
+ return;
+ }
+ }
+ }
+ });
+ ForEach_default.node(gltf, function(parentNode, parentNodeId) {
+ if (defined_default(parentNode.children)) {
+ const index = parentNode.children.indexOf(nodeId);
+ if (index > -1) {
+ parentNode.children.splice(index, 1);
+ if (isNodeEmpty(parentNode)) {
+ deleteNode(gltf, parentNodeId);
+ }
+ }
+ }
+ });
+ delete gltf.nodes[nodeId];
+}
+function removeEmptyNodes(gltf) {
+ ForEach_default.node(gltf, function(node, nodeId) {
+ if (isNodeEmpty(node)) {
+ deleteNode(gltf, nodeId);
+ }
+ });
+ return gltf;
+}
+function requireAnimationAccessorMinMax(gltf) {
+ ForEach_default.animation(gltf, function(animation) {
+ ForEach_default.animationSampler(animation, function(sampler) {
+ const accessor = gltf.accessors[sampler.input];
+ if (!defined_default(accessor.min) || !defined_default(accessor.max)) {
+ const minMax = findAccessorMinMax_default(gltf, accessor);
+ accessor.min = minMax.min;
+ accessor.max = minMax.max;
+ }
+ });
+ });
+}
+function validatePresentAccessorMinMax(gltf) {
+ ForEach_default.accessor(gltf, function(accessor) {
+ if (defined_default(accessor.min) || defined_default(accessor.max)) {
+ const minMax = findAccessorMinMax_default(gltf, accessor);
+ if (defined_default(accessor.min)) {
+ accessor.min = minMax.min;
+ }
+ if (defined_default(accessor.max)) {
+ accessor.max = minMax.max;
+ }
+ }
+ });
+}
+function glTF10to20(gltf) {
+ gltf.asset = defaultValue_default(gltf.asset, {});
+ gltf.asset.version = "2.0";
+ updateInstanceTechniques(gltf);
+ removeAnimationSamplersIndirection(gltf);
+ removeEmptyNodes(gltf);
+ objectsToArrays(gltf);
+ removeAnimationSamplerNames(gltf);
+ stripAsset(gltf);
+ requireKnownExtensions(gltf);
+ requireByteLength(gltf);
+ moveByteStrideToBufferView(gltf);
+ requirePositionAccessorMinMax(gltf);
+ requireAnimationAccessorMinMax(gltf);
+ validatePresentAccessorMinMax(gltf);
+ removeBufferType(gltf);
+ removeTextureProperties(gltf);
+ requireAttributeSetIndex(gltf);
+ underscoreApplicationSpecificSemantics(gltf);
+ updateAccessorComponentTypes_default(gltf);
+ clampCameraParameters(gltf);
+ moveTechniqueRenderStates_default(gltf);
+ moveTechniquesToExtension_default(gltf);
+ removeEmptyArrays(gltf);
+}
+var baseColorTextureNames = ["u_tex", "u_diffuse", "u_emission"];
+var baseColorFactorNames = ["u_diffuse"];
+function initializePbrMaterial(material) {
+ material.pbrMetallicRoughness = defined_default(material.pbrMetallicRoughness) ? material.pbrMetallicRoughness : {};
+ material.pbrMetallicRoughness.roughnessFactor = 1;
+ material.pbrMetallicRoughness.metallicFactor = 0;
+}
+function isTexture(value) {
+ return defined_default(value.index);
+}
+function isVec4(value) {
+ return Array.isArray(value) && value.length === 4;
+}
+function srgbToLinear(srgb) {
+ const linear = new Array(4);
+ linear[3] = srgb[3];
+ for (let i = 0; i < 3; i++) {
+ const c = srgb[i];
+ if (c <= 0.04045) {
+ linear[i] = srgb[i] * 0.07739938080495357;
+ } else {
+ linear[i] = Math.pow(
+ (c + 0.055) * 0.9478672985781991,
+ 2.4
+ );
+ }
+ }
+ return linear;
+}
+function convertTechniquesToPbr(gltf) {
+ ForEach_default.material(gltf, function(material) {
+ ForEach_default.materialValue(material, function(value, name) {
+ if (baseColorTextureNames.indexOf(name) !== -1 && isTexture(value)) {
+ initializePbrMaterial(material);
+ material.pbrMetallicRoughness.baseColorTexture = value;
+ } else if (baseColorFactorNames.indexOf(name) !== -1 && isVec4(value)) {
+ initializePbrMaterial(material);
+ material.pbrMetallicRoughness.baseColorFactor = srgbToLinear(value);
+ }
+ });
+ });
+ removeExtension_default(gltf, "KHR_techniques_webgl");
+ removeExtension_default(gltf, "KHR_blend");
+}
+function convertMaterialsCommonToPbr(gltf) {
+ ForEach_default.material(gltf, function(material) {
+ const materialsCommon = defaultValue_default(
+ material.extensions,
+ defaultValue_default.EMPTY_OBJECT
+ ).KHR_materials_common;
+ if (defined_default(materialsCommon)) {
+ const technique = materialsCommon.technique;
+ if (technique === "CONSTANT") {
+ addExtensionsUsed_default(gltf, "KHR_materials_unlit");
+ material.extensions = defined_default(material.extensions) ? material.extensions : {};
+ material.extensions["KHR_materials_unlit"] = {};
+ }
+ const values = defined_default(materialsCommon.values) ? materialsCommon.values : {};
+ const ambient = values.ambient;
+ const diffuse = values.diffuse;
+ const emission = values.emission;
+ const transparency = values.transparency;
+ const doubleSided = materialsCommon.doubleSided;
+ const transparent = materialsCommon.transparent;
+ initializePbrMaterial(material);
+ if (defined_default(ambient)) {
+ if (isVec4(ambient)) {
+ material.emissiveFactor = ambient.slice(0, 3);
+ } else if (isTexture(ambient)) {
+ material.emissiveTexture = ambient;
+ }
+ }
+ if (defined_default(diffuse)) {
+ if (isVec4(diffuse)) {
+ material.pbrMetallicRoughness.baseColorFactor = srgbToLinear(diffuse);
+ } else if (isTexture(diffuse)) {
+ material.pbrMetallicRoughness.baseColorTexture = diffuse;
+ }
+ }
+ if (defined_default(doubleSided)) {
+ material.doubleSided = doubleSided;
+ }
+ if (defined_default(emission)) {
+ if (isVec4(emission)) {
+ material.emissiveFactor = emission.slice(0, 3);
+ } else if (isTexture(emission)) {
+ material.emissiveTexture = emission;
+ }
+ }
+ if (defined_default(transparency)) {
+ if (defined_default(material.pbrMetallicRoughness.baseColorFactor)) {
+ material.pbrMetallicRoughness.baseColorFactor[3] *= transparency;
+ } else {
+ material.pbrMetallicRoughness.baseColorFactor = [
+ 1,
+ 1,
+ 1,
+ transparency
+ ];
+ }
+ }
+ if (defined_default(transparent)) {
+ material.alphaMode = transparent ? "BLEND" : "OPAQUE";
+ }
+ }
+ });
+ removeExtension_default(gltf, "KHR_materials_common");
+}
+var updateVersion_default = updateVersion;
+
+// Source/Scene/GltfJsonLoader.js
+function GltfJsonLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const resourceCache = options.resourceCache;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const typedArray = options.typedArray;
+ const gltfJson = options.gltfJson;
+ const cacheKey = options.cacheKey;
+ Check_default.typeOf.func("options.resourceCache", resourceCache);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ this._resourceCache = resourceCache;
+ this._gltfResource = gltfResource;
+ this._baseResource = baseResource2;
+ this._typedArray = typedArray;
+ this._gltfJson = gltfJson;
+ this._cacheKey = cacheKey;
+ this._gltf = void 0;
+ this._bufferLoaders = [];
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._promise = void 0;
+}
+if (defined_default(Object.create)) {
+ GltfJsonLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ GltfJsonLoader.prototype.constructor = GltfJsonLoader;
+}
+Object.defineProperties(GltfJsonLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return this._cacheKey;
+ }
+ },
+ gltf: {
+ get: function() {
+ return this._gltf;
+ }
+ }
+});
+GltfJsonLoader.prototype.load = function() {
+ this._state = ResourceLoaderState_default.LOADING;
+ let processPromise;
+ if (defined_default(this._gltfJson)) {
+ processPromise = processGltfJson(this, this._gltfJson);
+ } else if (defined_default(this._typedArray)) {
+ processPromise = processGltfTypedArray(this, this._typedArray);
+ } else {
+ processPromise = loadFromUri2(this);
+ }
+ const that = this;
+ this._promise = processPromise.then(function(gltf) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that._gltf = gltf;
+ that._state = ResourceLoaderState_default.READY;
+ return that;
+ }).catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ return handleError4(that, error);
+ });
+ return this._promise;
+};
+function loadFromUri2(gltfJsonLoader) {
+ return gltfJsonLoader._fetchGltf().then(function(arrayBuffer) {
+ if (gltfJsonLoader.isDestroyed()) {
+ return;
+ }
+ const typedArray = new Uint8Array(arrayBuffer);
+ return processGltfTypedArray(gltfJsonLoader, typedArray);
+ });
+}
+function handleError4(gltfJsonLoader, error) {
+ gltfJsonLoader.unload();
+ gltfJsonLoader._state = ResourceLoaderState_default.FAILED;
+ const errorMessage = `Failed to load glTF: ${gltfJsonLoader._gltfResource.url}`;
+ return Promise.reject(gltfJsonLoader.getError(errorMessage, error));
+}
+function upgradeVersion(gltfJsonLoader, gltf) {
+ if (defined_default(gltf.asset) && gltf.asset.version === "2.0" && !usesExtension_default(gltf, "KHR_techniques_webgl") && !usesExtension_default(gltf, "KHR_materials_common")) {
+ return Promise.resolve();
+ }
+ const promises = [];
+ ForEach_default.buffer(gltf, function(buffer) {
+ if (!defined_default(buffer.extras._pipeline.source) && defined_default(buffer.uri)) {
+ const resource = gltfJsonLoader._baseResource.getDerivedResource({
+ url: buffer.uri
+ });
+ const resourceCache = gltfJsonLoader._resourceCache;
+ const bufferLoader = resourceCache.loadExternalBuffer({
+ resource
+ });
+ gltfJsonLoader._bufferLoaders.push(bufferLoader);
+ promises.push(
+ bufferLoader.promise.then(function(bufferLoader2) {
+ buffer.extras._pipeline.source = bufferLoader2.typedArray;
+ })
+ );
+ }
+ });
+ return Promise.all(promises).then(function() {
+ updateVersion_default(gltf);
+ });
+}
+function decodeDataUris(gltf) {
+ const promises = [];
+ ForEach_default.buffer(gltf, function(buffer) {
+ const bufferUri = buffer.uri;
+ if (!defined_default(buffer.extras._pipeline.source) && defined_default(bufferUri) && isDataUri_default(bufferUri)) {
+ delete buffer.uri;
+ promises.push(
+ Resource_default.fetchArrayBuffer(bufferUri).then(function(arrayBuffer) {
+ buffer.extras._pipeline.source = new Uint8Array(arrayBuffer);
+ })
+ );
+ }
+ });
+ return Promise.all(promises);
+}
+function loadEmbeddedBuffers(gltfJsonLoader, gltf) {
+ const promises = [];
+ ForEach_default.buffer(gltf, function(buffer, bufferId) {
+ const source = buffer.extras._pipeline.source;
+ if (defined_default(source) && !defined_default(buffer.uri)) {
+ const resourceCache = gltfJsonLoader._resourceCache;
+ const bufferLoader = resourceCache.loadEmbeddedBuffer({
+ parentResource: gltfJsonLoader._gltfResource,
+ bufferId,
+ typedArray: source
+ });
+ gltfJsonLoader._bufferLoaders.push(bufferLoader);
+ promises.push(bufferLoader.promise);
+ }
+ });
+ return Promise.all(promises);
+}
+function processGltfJson(gltfJsonLoader, gltf) {
+ addPipelineExtras_default(gltf);
+ return decodeDataUris(gltf).then(function() {
+ return upgradeVersion(gltfJsonLoader, gltf);
+ }).then(function() {
+ addDefaults_default(gltf);
+ return loadEmbeddedBuffers(gltfJsonLoader, gltf);
+ }).then(function() {
+ removePipelineExtras_default(gltf);
+ return gltf;
+ });
+}
+function processGltfTypedArray(gltfJsonLoader, typedArray) {
+ let gltf;
+ if (getMagic_default(typedArray) === "glTF") {
+ gltf = parseGlb_default(typedArray);
+ } else {
+ gltf = getJsonFromTypedArray_default(typedArray);
+ }
+ return processGltfJson(gltfJsonLoader, gltf);
+}
+GltfJsonLoader.prototype.unload = function() {
+ const bufferLoaders = this._bufferLoaders;
+ const bufferLoadersLength = bufferLoaders.length;
+ for (let i = 0; i < bufferLoadersLength; ++i) {
+ this._resourceCache.unload(bufferLoaders[i]);
+ }
+ this._bufferLoaders.length = 0;
+ this._gltf = void 0;
+};
+GltfJsonLoader.prototype._fetchGltf = function() {
+ return this._gltfResource.fetchArrayBuffer();
+};
+var GltfJsonLoader_default = GltfJsonLoader;
+
+// Source/Scene/AlphaMode.js
+var AlphaMode = {
+ OPAQUE: "OPAQUE",
+ MASK: "MASK",
+ BLEND: "BLEND"
+};
+var AlphaMode_default = Object.freeze(AlphaMode);
+
+// Source/Scene/ModelComponents.js
+var ModelComponents = {};
+function Quantization() {
+ this.octEncoded = false;
+ this.octEncodedZXY = false;
+ this.normalizationRange = void 0;
+ this.quantizedVolumeOffset = void 0;
+ this.quantizedVolumeDimensions = void 0;
+ this.quantizedVolumeStepSize = void 0;
+ this.componentDatatype = void 0;
+ this.type = void 0;
+}
+function Attribute() {
+ this.name = void 0;
+ this.semantic = void 0;
+ this.setIndex = void 0;
+ this.componentDatatype = void 0;
+ this.type = void 0;
+ this.normalized = false;
+ this.count = void 0;
+ this.min = void 0;
+ this.max = void 0;
+ this.constant = void 0;
+ this.quantization = void 0;
+ this.typedArray = void 0;
+ this.buffer = void 0;
+ this.byteOffset = 0;
+ this.byteStride = void 0;
+}
+function Indices() {
+ this.indexDatatype = void 0;
+ this.count = void 0;
+ this.buffer = void 0;
+ this.typedArray = void 0;
+}
+function FeatureIdAttribute() {
+ this.featureCount = void 0;
+ this.nullFeatureId = void 0;
+ this.propertyTableId = void 0;
+ this.setIndex = void 0;
+ this.label = void 0;
+ this.positionalLabel = void 0;
+}
+function FeatureIdImplicitRange() {
+ this.featureCount = void 0;
+ this.nullFeatureId = void 0;
+ this.propertyTableId = void 0;
+ this.offset = 0;
+ this.repeat = void 0;
+ this.label = void 0;
+ this.positionalLabel = void 0;
+}
+function FeatureIdTexture() {
+ this.featureCount = void 0;
+ this.nullFeatureId = void 0;
+ this.propertyTableId = void 0;
+ this.textureReader = void 0;
+ this.label = void 0;
+ this.positionalLabel = void 0;
+}
+function MorphTarget() {
+ this.attributes = [];
+}
+function Primitive2() {
+ this.attributes = [];
+ this.morphTargets = [];
+ this.indices = void 0;
+ this.material = void 0;
+ this.primitiveType = void 0;
+ this.featureIds = [];
+ this.propertyTextureIds = [];
+ this.propertyAttributeIds = [];
+ this.outlineCoordinates = void 0;
+}
+function Instances() {
+ this.attributes = [];
+ this.featureIds = [];
+ this.transformInWorldSpace = false;
+}
+function Skin() {
+ this.index = void 0;
+ this.joints = [];
+ this.inverseBindMatrices = [];
+}
+function Node3() {
+ this.name = void 0;
+ this.index = void 0;
+ this.children = [];
+ this.primitives = [];
+ this.instances = void 0;
+ this.skin = void 0;
+ this.matrix = void 0;
+ this.translation = void 0;
+ this.rotation = void 0;
+ this.scale = void 0;
+ this.morphWeights = [];
+ this.articulationName = void 0;
+}
+function Scene() {
+ this.nodes = [];
+}
+var AnimatedPropertyType = {
+ TRANSLATION: "translation",
+ ROTATION: "rotation",
+ SCALE: "scale",
+ WEIGHTS: "weights"
+};
+function AnimationSampler() {
+ this.input = [];
+ this.interpolation = void 0;
+ this.output = [];
+}
+function AnimationTarget() {
+ this.node = void 0;
+ this.path = void 0;
+}
+function AnimationChannel() {
+ this.sampler = void 0;
+ this.target = void 0;
+}
+function Animation() {
+ this.name = void 0;
+ this.samplers = [];
+ this.channels = [];
+}
+function ArticulationStage() {
+ this.name = void 0;
+ this.type = void 0;
+ this.minimumValue = void 0;
+ this.maximumValue = void 0;
+ this.initialValue = void 0;
+}
+function Articulation() {
+ this.name = void 0;
+ this.stages = [];
+}
+function Asset() {
+ this.credits = [];
+}
+function Components() {
+ this.asset = new Asset();
+ this.scene = void 0;
+ this.nodes = [];
+ this.skins = [];
+ this.animations = [];
+ this.articulations = [];
+ this.structuralMetadata = void 0;
+ this.upAxis = void 0;
+ this.forwardAxis = void 0;
+ this.transform = Matrix4_default.clone(Matrix4_default.IDENTITY);
+}
+function TextureReader() {
+ this.texture = void 0;
+ this.index = void 0;
+ this.texCoord = 0;
+ this.transform = Matrix3_default.clone(Matrix3_default.IDENTITY);
+ this.channels = void 0;
+}
+function MetallicRoughness() {
+ this.baseColorTexture = void 0;
+ this.metallicRoughnessTexture = void 0;
+ this.baseColorFactor = Cartesian4_default.clone(
+ MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR
+ );
+ this.metallicFactor = MetallicRoughness.DEFAULT_METALLIC_FACTOR;
+ this.roughnessFactor = MetallicRoughness.DEFAULT_ROUGHNESS_FACTOR;
+}
+MetallicRoughness.DEFAULT_BASE_COLOR_FACTOR = Cartesian4_default.ONE;
+MetallicRoughness.DEFAULT_METALLIC_FACTOR = 1;
+MetallicRoughness.DEFAULT_ROUGHNESS_FACTOR = 1;
+function SpecularGlossiness() {
+ this.diffuseTexture = void 0;
+ this.specularGlossinessTexture = void 0;
+ this.diffuseFactor = Cartesian4_default.clone(
+ SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR
+ );
+ this.specularFactor = Cartesian3_default.clone(
+ SpecularGlossiness.DEFAULT_SPECULAR_FACTOR
+ );
+ this.glossinessFactor = SpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR;
+}
+SpecularGlossiness.DEFAULT_DIFFUSE_FACTOR = Cartesian4_default.ONE;
+SpecularGlossiness.DEFAULT_SPECULAR_FACTOR = Cartesian3_default.ONE;
+SpecularGlossiness.DEFAULT_GLOSSINESS_FACTOR = 1;
+function Material2() {
+ this.metallicRoughness = new MetallicRoughness();
+ this.specularGlossiness = void 0;
+ this.emissiveTexture = void 0;
+ this.normalTexture = void 0;
+ this.occlusionTexture = void 0;
+ this.emissiveFactor = Cartesian3_default.clone(Material2.DEFAULT_EMISSIVE_FACTOR);
+ this.alphaMode = AlphaMode_default.OPAQUE;
+ this.alphaCutoff = 0.5;
+ this.doubleSided = false;
+ this.unlit = false;
+}
+Material2.DEFAULT_EMISSIVE_FACTOR = Cartesian3_default.ZERO;
+ModelComponents.Quantization = Quantization;
+ModelComponents.Attribute = Attribute;
+ModelComponents.Indices = Indices;
+ModelComponents.FeatureIdAttribute = FeatureIdAttribute;
+ModelComponents.FeatureIdTexture = FeatureIdTexture;
+ModelComponents.FeatureIdImplicitRange = FeatureIdImplicitRange;
+ModelComponents.MorphTarget = MorphTarget;
+ModelComponents.Primitive = Primitive2;
+ModelComponents.Instances = Instances;
+ModelComponents.Skin = Skin;
+ModelComponents.Node = Node3;
+ModelComponents.Scene = Scene;
+ModelComponents.AnimatedPropertyType = Object.freeze(AnimatedPropertyType);
+ModelComponents.AnimationSampler = AnimationSampler;
+ModelComponents.AnimationTarget = AnimationTarget;
+ModelComponents.AnimationChannel = AnimationChannel;
+ModelComponents.Animation = Animation;
+ModelComponents.ArticulationStage = ArticulationStage;
+ModelComponents.Articulation = Articulation;
+ModelComponents.Asset = Asset;
+ModelComponents.Components = Components;
+ModelComponents.TextureReader = TextureReader;
+ModelComponents.MetallicRoughness = MetallicRoughness;
+ModelComponents.SpecularGlossiness = SpecularGlossiness;
+ModelComponents.Material = Material2;
+var ModelComponents_default = ModelComponents;
+
+// Source/Scene/GltfLoaderUtil.js
+var GltfLoaderUtil = {};
+GltfLoaderUtil.getImageIdFromTexture = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const textureId = options.textureId;
+ const supportedImageFormats = options.supportedImageFormats;
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.number("options.textureId", textureId);
+ Check_default.typeOf.object("options.supportedImageFormats", supportedImageFormats);
+ const texture = gltf.textures[textureId];
+ const extensions = texture.extensions;
+ if (defined_default(extensions)) {
+ if (supportedImageFormats.webp && defined_default(extensions.EXT_texture_webp)) {
+ return extensions.EXT_texture_webp.source;
+ } else if (supportedImageFormats.basis && defined_default(extensions.KHR_texture_basisu)) {
+ return extensions.KHR_texture_basisu.source;
+ }
+ }
+ return texture.source;
+};
+GltfLoaderUtil.createSampler = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const textureInfo = options.textureInfo;
+ const compressedTextureNoMipmap = defaultValue_default(
+ options.compressedTextureNoMipmap,
+ false
+ );
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.textureInfo", textureInfo);
+ let wrapS = TextureWrap_default.REPEAT;
+ let wrapT = TextureWrap_default.REPEAT;
+ let minFilter = TextureMinificationFilter_default.LINEAR;
+ let magFilter = TextureMagnificationFilter_default.LINEAR;
+ const textureId = textureInfo.index;
+ const texture = gltf.textures[textureId];
+ const samplerId = texture.sampler;
+ if (defined_default(samplerId)) {
+ const sampler = gltf.samplers[samplerId];
+ wrapS = defaultValue_default(sampler.wrapS, wrapS);
+ wrapT = defaultValue_default(sampler.wrapT, wrapT);
+ minFilter = defaultValue_default(sampler.minFilter, minFilter);
+ magFilter = defaultValue_default(sampler.magFilter, magFilter);
+ }
+ let usesTextureTransform = false;
+ const extensions = textureInfo.extensions;
+ if (defined_default(extensions) && defined_default(extensions.KHR_texture_transform)) {
+ usesTextureTransform = true;
+ }
+ if ((compressedTextureNoMipmap || usesTextureTransform) && minFilter !== TextureMinificationFilter_default.LINEAR && minFilter !== TextureMinificationFilter_default.NEAREST) {
+ if (minFilter === TextureMinificationFilter_default.NEAREST_MIPMAP_NEAREST || minFilter === TextureMinificationFilter_default.NEAREST_MIPMAP_LINEAR) {
+ minFilter = TextureMinificationFilter_default.NEAREST;
+ } else {
+ minFilter = TextureMinificationFilter_default.LINEAR;
+ }
+ }
+ return new Sampler_default({
+ wrapS,
+ wrapT,
+ minificationFilter: minFilter,
+ magnificationFilter: magFilter
+ });
+};
+var defaultScale3 = new Cartesian2_default(1, 1);
+GltfLoaderUtil.createModelTextureReader = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const textureInfo = options.textureInfo;
+ const channels = options.channels;
+ const texture = options.texture;
+ Check_default.typeOf.object("options.textureInfo", textureInfo);
+ let texCoord = defaultValue_default(textureInfo.texCoord, 0);
+ let transform3;
+ const textureTransform = defaultValue_default(
+ textureInfo.extensions,
+ defaultValue_default.EMPTY_OBJECT
+ ).KHR_texture_transform;
+ if (defined_default(textureTransform)) {
+ texCoord = defaultValue_default(textureTransform.texCoord, texCoord);
+ const offset2 = defined_default(textureTransform.offset) ? Cartesian2_default.unpack(textureTransform.offset) : Cartesian2_default.ZERO;
+ let rotation = defaultValue_default(textureTransform.rotation, 0);
+ const scale = defined_default(textureTransform.scale) ? Cartesian2_default.unpack(textureTransform.scale) : defaultScale3;
+ rotation = -rotation;
+ transform3 = new Matrix3_default(
+ Math.cos(rotation) * scale.x,
+ -Math.sin(rotation) * scale.y,
+ offset2.x,
+ Math.sin(rotation) * scale.x,
+ Math.cos(rotation) * scale.y,
+ offset2.y,
+ 0,
+ 0,
+ 1
+ );
+ }
+ const modelTextureReader = new ModelComponents_default.TextureReader();
+ modelTextureReader.index = textureInfo.index;
+ modelTextureReader.texture = texture;
+ modelTextureReader.texCoord = texCoord;
+ modelTextureReader.transform = transform3;
+ modelTextureReader.channels = channels;
+ return modelTextureReader;
+};
+var GltfLoaderUtil_default = GltfLoaderUtil;
+
+// Source/Core/resizeImageToNextPowerOfTwo.js
+function resizeImageToNextPowerOfTwo(image) {
+ const canvas = document.createElement("canvas");
+ canvas.width = Math_default.nextPowerOfTwo(image.width);
+ canvas.height = Math_default.nextPowerOfTwo(image.height);
+ const canvasContext = canvas.getContext("2d");
+ canvasContext.drawImage(
+ image,
+ 0,
+ 0,
+ image.width,
+ image.height,
+ 0,
+ 0,
+ canvas.width,
+ canvas.height
+ );
+ return canvas;
+}
+var resizeImageToNextPowerOfTwo_default = resizeImageToNextPowerOfTwo;
+
+// Source/Scene/GltfTextureLoader.js
+function GltfTextureLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const resourceCache = options.resourceCache;
+ const gltf = options.gltf;
+ const textureInfo = options.textureInfo;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const supportedImageFormats = options.supportedImageFormats;
+ const cacheKey = options.cacheKey;
+ const asynchronous = defaultValue_default(options.asynchronous, true);
+ Check_default.typeOf.func("options.resourceCache", resourceCache);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.textureInfo", textureInfo);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ Check_default.typeOf.object("options.supportedImageFormats", supportedImageFormats);
+ const textureId = textureInfo.index;
+ const imageId = GltfLoaderUtil_default.getImageIdFromTexture({
+ gltf,
+ textureId,
+ supportedImageFormats
+ });
+ this._resourceCache = resourceCache;
+ this._gltf = gltf;
+ this._textureInfo = textureInfo;
+ this._imageId = imageId;
+ this._gltfResource = gltfResource;
+ this._baseResource = baseResource2;
+ this._cacheKey = cacheKey;
+ this._asynchronous = asynchronous;
+ this._imageLoader = void 0;
+ this._image = void 0;
+ this._mipLevels = void 0;
+ this._texture = void 0;
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._promise = void 0;
+ this._process = function(loader, frameState) {
+ };
+}
+if (defined_default(Object.create)) {
+ GltfTextureLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ GltfTextureLoader.prototype.constructor = GltfTextureLoader;
+}
+Object.defineProperties(GltfTextureLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return this._cacheKey;
+ }
+ },
+ texture: {
+ get: function() {
+ return this._texture;
+ }
+ }
+});
+var scratchTextureJob = new CreateTextureJob();
+GltfTextureLoader.prototype.load = function() {
+ const resourceCache = this._resourceCache;
+ const imageLoader = resourceCache.loadImage({
+ gltf: this._gltf,
+ imageId: this._imageId,
+ gltfResource: this._gltfResource,
+ baseResource: this._baseResource
+ });
+ this._imageLoader = imageLoader;
+ this._state = ResourceLoaderState_default.LOADING;
+ const that = this;
+ const processPromise = new Promise(function(resolve2) {
+ that._process = function(loader, frameState) {
+ if (defined_default(loader._texture)) {
+ return;
+ }
+ if (!defined_default(loader._image)) {
+ return;
+ }
+ let texture;
+ if (loader._asynchronous) {
+ const textureJob = scratchTextureJob;
+ textureJob.set(
+ loader._gltf,
+ loader._textureInfo,
+ loader._image,
+ loader._mipLevels,
+ frameState.context
+ );
+ const jobScheduler = frameState.jobScheduler;
+ if (!jobScheduler.execute(textureJob, JobType_default.TEXTURE)) {
+ return;
+ }
+ texture = textureJob.texture;
+ } else {
+ texture = createTexture3(
+ loader._gltf,
+ loader._textureInfo,
+ loader._image,
+ loader._mipLevels,
+ frameState.context
+ );
+ }
+ loader.unload();
+ loader._texture = texture;
+ loader._state = ResourceLoaderState_default.READY;
+ resolve2(loader);
+ };
+ });
+ this._promise = imageLoader.promise.then(function() {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that._image = imageLoader.image;
+ that._mipLevels = imageLoader.mipLevels;
+ that._state = ResourceLoaderState_default.PROCESSING;
+ return processPromise;
+ }).catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that.unload();
+ that._state = ResourceLoaderState_default.FAILED;
+ const errorMessage = "Failed to load texture";
+ return Promise.reject(that.getError(errorMessage, error));
+ });
+ return this._promise;
+};
+function CreateTextureJob() {
+ this.gltf = void 0;
+ this.textureInfo = void 0;
+ this.image = void 0;
+ this.context = void 0;
+ this.texture = void 0;
+}
+CreateTextureJob.prototype.set = function(gltf, textureInfo, image, mipLevels, context) {
+ this.gltf = gltf;
+ this.textureInfo = textureInfo;
+ this.image = image;
+ this.mipLevels = mipLevels;
+ this.context = context;
+};
+CreateTextureJob.prototype.execute = function() {
+ this.texture = createTexture3(
+ this.gltf,
+ this.textureInfo,
+ this.image,
+ this.mipLevels,
+ this.context
+ );
+};
+function createTexture3(gltf, textureInfo, image, mipLevels, context) {
+ const internalFormat = image.internalFormat;
+ let compressedTextureNoMipmap = false;
+ if (PixelFormat_default.isCompressedFormat(internalFormat) && !defined_default(mipLevels)) {
+ compressedTextureNoMipmap = true;
+ }
+ const sampler = GltfLoaderUtil_default.createSampler({
+ gltf,
+ textureInfo,
+ compressedTextureNoMipmap
+ });
+ const minFilter = sampler.minificationFilter;
+ const wrapS = sampler.wrapS;
+ const wrapT = sampler.wrapT;
+ const samplerRequiresMipmap2 = minFilter === TextureMinificationFilter_default.NEAREST_MIPMAP_NEAREST || minFilter === TextureMinificationFilter_default.NEAREST_MIPMAP_LINEAR || minFilter === TextureMinificationFilter_default.LINEAR_MIPMAP_NEAREST || minFilter === TextureMinificationFilter_default.LINEAR_MIPMAP_LINEAR;
+ const generateMipmap = !defined_default(internalFormat) && samplerRequiresMipmap2;
+ const requiresPowerOfTwo = generateMipmap || wrapS === TextureWrap_default.REPEAT || wrapS === TextureWrap_default.MIRRORED_REPEAT || wrapT === TextureWrap_default.REPEAT || wrapT === TextureWrap_default.MIRRORED_REPEAT;
+ const nonPowerOfTwo = !Math_default.isPowerOfTwo(image.width) || !Math_default.isPowerOfTwo(image.height);
+ const requiresResize = requiresPowerOfTwo && nonPowerOfTwo;
+ let texture;
+ if (defined_default(internalFormat)) {
+ if (!context.webgl2 && PixelFormat_default.isCompressedFormat(internalFormat) && nonPowerOfTwo && requiresPowerOfTwo) {
+ console.warn(
+ "Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."
+ );
+ }
+ texture = Texture_default.create({
+ context,
+ source: {
+ arrayBufferView: image.bufferView,
+ mipLevels
+ },
+ width: image.width,
+ height: image.height,
+ pixelFormat: image.internalFormat,
+ sampler
+ });
+ } else {
+ if (requiresResize) {
+ image = resizeImageToNextPowerOfTwo_default(image);
+ }
+ texture = Texture_default.create({
+ context,
+ source: image,
+ sampler,
+ flipY: false,
+ skipColorSpaceConversion: true
+ });
+ }
+ if (generateMipmap) {
+ texture.generateMipmap();
+ }
+ return texture;
+}
+GltfTextureLoader.prototype.process = function(frameState) {
+ Check_default.typeOf.object("frameState", frameState);
+ return this._process(this, frameState);
+};
+GltfTextureLoader.prototype.unload = function() {
+ if (defined_default(this._texture)) {
+ this._texture.destroy();
+ }
+ if (defined_default(this._imageLoader)) {
+ this._resourceCache.unload(this._imageLoader);
+ }
+ this._imageLoader = void 0;
+ this._image = void 0;
+ this._mipLevels = void 0;
+ this._texture = void 0;
+ this._gltf = void 0;
+};
+var GltfTextureLoader_default = GltfTextureLoader;
+
+// Source/Scene/GltfVertexBufferLoader.js
+function GltfVertexBufferLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const resourceCache = options.resourceCache;
+ const gltf = options.gltf;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const bufferViewId = options.bufferViewId;
+ const draco = options.draco;
+ const attributeSemantic = options.attributeSemantic;
+ const accessorId = options.accessorId;
+ const cacheKey = options.cacheKey;
+ const asynchronous = defaultValue_default(options.asynchronous, true);
+ const loadBuffer = defaultValue_default(options.loadBuffer, false);
+ const loadTypedArray = defaultValue_default(options.loadTypedArray, false);
+ Check_default.typeOf.func("options.resourceCache", resourceCache);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ if (!loadBuffer && !loadTypedArray) {
+ throw new DeveloperError_default(
+ "At least one of loadBuffer and loadTypedArray must be true."
+ );
+ }
+ const hasBufferViewId = defined_default(bufferViewId);
+ const hasDraco = defined_default(draco);
+ const hasAttributeSemantic = defined_default(attributeSemantic);
+ const hasAccessorId = defined_default(accessorId);
+ if (hasBufferViewId === hasDraco) {
+ throw new DeveloperError_default(
+ "One of options.bufferViewId and options.draco must be defined."
+ );
+ }
+ if (hasDraco && !hasAttributeSemantic) {
+ throw new DeveloperError_default(
+ "When options.draco is defined options.attributeSemantic must also be defined."
+ );
+ }
+ if (hasDraco && !hasAccessorId) {
+ throw new DeveloperError_default(
+ "When options.draco is defined options.accessorId must also be defined."
+ );
+ }
+ if (hasDraco) {
+ Check_default.typeOf.object("options.draco", draco);
+ Check_default.typeOf.string("options.attributeSemantic", attributeSemantic);
+ Check_default.typeOf.number("options.accessorId", accessorId);
+ }
+ this._resourceCache = resourceCache;
+ this._gltfResource = gltfResource;
+ this._baseResource = baseResource2;
+ this._gltf = gltf;
+ this._bufferViewId = bufferViewId;
+ this._draco = draco;
+ this._attributeSemantic = attributeSemantic;
+ this._accessorId = accessorId;
+ this._cacheKey = cacheKey;
+ this._asynchronous = asynchronous;
+ this._loadBuffer = loadBuffer;
+ this._loadTypedArray = loadTypedArray;
+ this._bufferViewLoader = void 0;
+ this._dracoLoader = void 0;
+ this._quantization = void 0;
+ this._typedArray = void 0;
+ this._buffer = void 0;
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._promise = void 0;
+ this._process = function(loader, frameState) {
+ };
+}
+if (defined_default(Object.create)) {
+ GltfVertexBufferLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ GltfVertexBufferLoader.prototype.constructor = GltfVertexBufferLoader;
+}
+Object.defineProperties(GltfVertexBufferLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return this._cacheKey;
+ }
+ },
+ buffer: {
+ get: function() {
+ return this._buffer;
+ }
+ },
+ typedArray: {
+ get: function() {
+ return this._typedArray;
+ }
+ },
+ quantization: {
+ get: function() {
+ return this._quantization;
+ }
+ }
+});
+GltfVertexBufferLoader.prototype.load = function() {
+ let promise;
+ if (defined_default(this._draco)) {
+ promise = loadFromDraco2(this);
+ } else {
+ promise = loadFromBufferView3(this);
+ }
+ const that = this;
+ const scratchVertexBufferJob = new CreateVertexBufferJob();
+ const processPromise = new Promise(function(resolve2) {
+ that._process = function(loader, frameState) {
+ if (loader._state === ResourceLoaderState_default.READY) {
+ return;
+ }
+ const typedArray = loader._typedArray;
+ if (defined_default(loader._dracoLoader)) {
+ loader._dracoLoader.process(frameState);
+ }
+ if (defined_default(loader._bufferViewLoader)) {
+ loader._bufferViewLoader.process(frameState);
+ }
+ if (!defined_default(typedArray)) {
+ return;
+ }
+ let buffer;
+ if (loader._loadBuffer && loader._asynchronous) {
+ const vertexBufferJob = scratchVertexBufferJob;
+ vertexBufferJob.set(typedArray, frameState.context);
+ const jobScheduler = frameState.jobScheduler;
+ if (!jobScheduler.execute(vertexBufferJob, JobType_default.BUFFER)) {
+ return;
+ }
+ buffer = vertexBufferJob.buffer;
+ } else if (loader._loadBuffer) {
+ buffer = createVertexBuffer(typedArray, frameState.context);
+ }
+ loader.unload();
+ loader._buffer = buffer;
+ loader._typedArray = loader._loadTypedArray ? typedArray : void 0;
+ loader._state = ResourceLoaderState_default.READY;
+ resolve2(loader);
+ };
+ });
+ this._promise = promise.then(function() {
+ if (that.isDestroyed()) {
+ return;
+ }
+ return processPromise;
+ }).catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ return handleError5(that, error);
+ });
+ return this._promise;
+};
+function getQuantizationInformation(dracoQuantization, componentDatatype, componentCount, type) {
+ const quantizationBits = dracoQuantization.quantizationBits;
+ const normalizationRange = (1 << quantizationBits) - 1;
+ const normalizationDivisor = 1 / normalizationRange;
+ const quantization = new ModelComponents_default.Quantization();
+ quantization.componentDatatype = componentDatatype;
+ quantization.octEncoded = dracoQuantization.octEncoded;
+ quantization.octEncodedZXY = true;
+ quantization.type = type;
+ if (quantization.octEncoded) {
+ quantization.type = AttributeType_default.VEC2;
+ quantization.normalizationRange = normalizationRange;
+ } else {
+ const MathType = AttributeType_default.getMathType(type);
+ if (MathType === Number) {
+ const dimensions = dracoQuantization.range;
+ quantization.quantizedVolumeOffset = dracoQuantization.minValues[0];
+ quantization.quantizedVolumeDimensions = dimensions;
+ quantization.normalizationRange = normalizationRange;
+ quantization.quantizedVolumeStepSize = dimensions * normalizationDivisor;
+ } else {
+ quantization.quantizedVolumeOffset = MathType.unpack(
+ dracoQuantization.minValues
+ );
+ quantization.normalizationRange = MathType.unpack(
+ new Array(componentCount).fill(normalizationRange)
+ );
+ const packedDimensions = new Array(componentCount).fill(
+ dracoQuantization.range
+ );
+ quantization.quantizedVolumeDimensions = MathType.unpack(
+ packedDimensions
+ );
+ const packedSteps = packedDimensions.map(function(dimension) {
+ return dimension * normalizationDivisor;
+ });
+ quantization.quantizedVolumeStepSize = MathType.unpack(packedSteps);
+ }
+ }
+ return quantization;
+}
+function loadFromDraco2(vertexBufferLoader) {
+ const resourceCache = vertexBufferLoader._resourceCache;
+ const dracoLoader = resourceCache.loadDraco({
+ gltf: vertexBufferLoader._gltf,
+ draco: vertexBufferLoader._draco,
+ gltfResource: vertexBufferLoader._gltfResource,
+ baseResource: vertexBufferLoader._baseResource
+ });
+ vertexBufferLoader._dracoLoader = dracoLoader;
+ vertexBufferLoader._state = ResourceLoaderState_default.LOADING;
+ return dracoLoader.promise.then(function() {
+ if (vertexBufferLoader.isDestroyed()) {
+ return;
+ }
+ const decodedVertexAttributes = dracoLoader.decodedData.vertexAttributes;
+ const attributeSemantic = vertexBufferLoader._attributeSemantic;
+ const dracoAttribute = decodedVertexAttributes[attributeSemantic];
+ const accessorId = vertexBufferLoader._accessorId;
+ const accessor = vertexBufferLoader._gltf.accessors[accessorId];
+ const type = accessor.type;
+ const typedArray = dracoAttribute.array;
+ const dracoQuantization = dracoAttribute.data.quantization;
+ if (defined_default(dracoQuantization)) {
+ vertexBufferLoader._quantization = getQuantizationInformation(
+ dracoQuantization,
+ dracoAttribute.data.componentDatatype,
+ dracoAttribute.data.componentsPerAttribute,
+ type
+ );
+ }
+ vertexBufferLoader._typedArray = new Uint8Array(
+ typedArray.buffer,
+ typedArray.byteOffset,
+ typedArray.byteLength
+ );
+ vertexBufferLoader._state = ResourceLoaderState_default.PROCESSING;
+ return vertexBufferLoader;
+ });
+}
+function loadFromBufferView3(vertexBufferLoader) {
+ const resourceCache = vertexBufferLoader._resourceCache;
+ const bufferViewLoader = resourceCache.loadBufferView({
+ gltf: vertexBufferLoader._gltf,
+ bufferViewId: vertexBufferLoader._bufferViewId,
+ gltfResource: vertexBufferLoader._gltfResource,
+ baseResource: vertexBufferLoader._baseResource
+ });
+ vertexBufferLoader._state = ResourceLoaderState_default.LOADING;
+ vertexBufferLoader._bufferViewLoader = bufferViewLoader;
+ return bufferViewLoader.promise.then(function() {
+ if (vertexBufferLoader.isDestroyed()) {
+ return;
+ }
+ vertexBufferLoader._typedArray = bufferViewLoader.typedArray;
+ vertexBufferLoader._state = ResourceLoaderState_default.PROCESSING;
+ return vertexBufferLoader;
+ });
+}
+function handleError5(vertexBufferLoader, error) {
+ vertexBufferLoader.unload();
+ vertexBufferLoader._state = ResourceLoaderState_default.FAILED;
+ const errorMessage = "Failed to load vertex buffer";
+ error = vertexBufferLoader.getError(errorMessage, error);
+ return Promise.reject(error);
+}
+function CreateVertexBufferJob() {
+ this.typedArray = void 0;
+ this.context = void 0;
+ this.buffer = void 0;
+}
+CreateVertexBufferJob.prototype.set = function(typedArray, context) {
+ this.typedArray = typedArray;
+ this.context = context;
+};
+CreateVertexBufferJob.prototype.execute = function() {
+ this.buffer = createVertexBuffer(this.typedArray, this.context);
+};
+function createVertexBuffer(typedArray, context) {
+ const buffer = Buffer_default.createVertexBuffer({
+ typedArray,
+ context,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ buffer.vertexArrayDestroyable = false;
+ return buffer;
+}
+GltfVertexBufferLoader.prototype.process = function(frameState) {
+ Check_default.typeOf.object("frameState", frameState);
+ return this._process(this, frameState);
+};
+GltfVertexBufferLoader.prototype.unload = function() {
+ if (defined_default(this._buffer)) {
+ this._buffer.destroy();
+ }
+ const resourceCache = this._resourceCache;
+ if (defined_default(this._bufferViewLoader)) {
+ resourceCache.unload(this._bufferViewLoader);
+ }
+ if (defined_default(this._dracoLoader)) {
+ resourceCache.unload(this._dracoLoader);
+ }
+ this._bufferViewLoader = void 0;
+ this._dracoLoader = void 0;
+ this._typedArray = void 0;
+ this._buffer = void 0;
+ this._gltf = void 0;
+};
+var GltfVertexBufferLoader_default = GltfVertexBufferLoader;
+
+// Source/Scene/MetadataClass.js
+function MetadataClass(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const id = options.id;
+ const classDefinition = options.class;
+ Check_default.typeOf.string("options.id", id);
+ Check_default.typeOf.object("options.class", classDefinition);
+ const properties = {};
+ const propertiesBySemantic = {};
+ for (const propertyId in classDefinition.properties) {
+ if (classDefinition.properties.hasOwnProperty(propertyId)) {
+ const property = new MetadataClassProperty_default({
+ id: propertyId,
+ property: classDefinition.properties[propertyId],
+ enums: options.enums
+ });
+ properties[propertyId] = property;
+ if (defined_default(property.semantic)) {
+ propertiesBySemantic[property.semantic] = property;
+ }
+ }
+ }
+ this._properties = properties;
+ this._propertiesBySemantic = propertiesBySemantic;
+ this._id = id;
+ this._name = classDefinition.name;
+ this._description = classDefinition.description;
+ this._extras = classDefinition.extras;
+ this._extensions = classDefinition.extensions;
+}
+Object.defineProperties(MetadataClass.prototype, {
+ properties: {
+ get: function() {
+ return this._properties;
+ }
+ },
+ propertiesBySemantic: {
+ get: function() {
+ return this._propertiesBySemantic;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ description: {
+ get: function() {
+ return this._description;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+MetadataClass.BATCH_TABLE_CLASS_NAME = "_batchTable";
+var MetadataClass_default = MetadataClass;
+
+// Source/Scene/MetadataEnumValue.js
+function MetadataEnumValue(value) {
+ Check_default.typeOf.object("value", value);
+ this._value = value.value;
+ this._name = value.name;
+ this._description = value.description;
+ this._extras = value.extras;
+ this._extensions = value.extensions;
+}
+Object.defineProperties(MetadataEnumValue.prototype, {
+ value: {
+ get: function() {
+ return this._value;
+ }
+ },
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ description: {
+ get: function() {
+ return this._description;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+var MetadataEnumValue_default = MetadataEnumValue;
+
+// Source/Scene/MetadataEnum.js
+function MetadataEnum(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const id = options.id;
+ const enumDefinition = options.enum;
+ Check_default.typeOf.string("options.id", id);
+ Check_default.typeOf.object("options.enum", enumDefinition);
+ const namesByValue = {};
+ const valuesByName = {};
+ const values = enumDefinition.values.map(function(value) {
+ namesByValue[value.value] = value.name;
+ valuesByName[value.name] = value.value;
+ return new MetadataEnumValue_default(value);
+ });
+ const valueType = defaultValue_default(
+ MetadataComponentType_default[enumDefinition.valueType],
+ MetadataComponentType_default.UINT16
+ );
+ this._values = values;
+ this._namesByValue = namesByValue;
+ this._valuesByName = valuesByName;
+ this._valueType = valueType;
+ this._id = id;
+ this._name = enumDefinition.name;
+ this._description = enumDefinition.description;
+ this._extras = enumDefinition.extras;
+ this._extensions = enumDefinition.extensions;
+}
+Object.defineProperties(MetadataEnum.prototype, {
+ values: {
+ get: function() {
+ return this._values;
+ }
+ },
+ namesByValue: {
+ get: function() {
+ return this._namesByValue;
+ }
+ },
+ valuesByName: {
+ get: function() {
+ return this._valuesByName;
+ }
+ },
+ valueType: {
+ get: function() {
+ return this._valueType;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ description: {
+ get: function() {
+ return this._description;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+var MetadataEnum_default = MetadataEnum;
+
+// Source/Scene/MetadataSchema.js
+function MetadataSchema(schema) {
+ Check_default.typeOf.object("schema", schema);
+ const enums = {};
+ if (defined_default(schema.enums)) {
+ for (const enumId in schema.enums) {
+ if (schema.enums.hasOwnProperty(enumId)) {
+ enums[enumId] = new MetadataEnum_default({
+ id: enumId,
+ enum: schema.enums[enumId]
+ });
+ }
+ }
+ }
+ const classes = {};
+ if (defined_default(schema.classes)) {
+ for (const classId in schema.classes) {
+ if (schema.classes.hasOwnProperty(classId)) {
+ classes[classId] = new MetadataClass_default({
+ id: classId,
+ class: schema.classes[classId],
+ enums
+ });
+ }
+ }
+ }
+ this._classes = classes;
+ this._enums = enums;
+ this._id = schema.id;
+ this._name = schema.name;
+ this._description = schema.description;
+ this._version = schema.version;
+ this._extras = schema.extras;
+ this._extensions = schema.extensions;
+}
+Object.defineProperties(MetadataSchema.prototype, {
+ classes: {
+ get: function() {
+ return this._classes;
+ }
+ },
+ enums: {
+ get: function() {
+ return this._enums;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ description: {
+ get: function() {
+ return this._description;
+ }
+ },
+ version: {
+ get: function() {
+ return this._version;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+var MetadataSchema_default = MetadataSchema;
+
+// Source/Scene/MetadataSchemaLoader.js
+function MetadataSchemaLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const schema = options.schema;
+ const resource = options.resource;
+ const cacheKey = options.cacheKey;
+ if (defined_default(schema) === defined_default(resource)) {
+ throw new DeveloperError_default(
+ "One of options.schema and options.resource must be defined."
+ );
+ }
+ this._schema = defined_default(schema) ? new MetadataSchema_default(schema) : void 0;
+ this._resource = resource;
+ this._cacheKey = cacheKey;
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._promise = void 0;
+}
+if (defined_default(Object.create)) {
+ MetadataSchemaLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ MetadataSchemaLoader.prototype.constructor = MetadataSchemaLoader;
+}
+Object.defineProperties(MetadataSchemaLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return this._cacheKey;
+ }
+ },
+ schema: {
+ get: function() {
+ return this._schema;
+ }
+ }
+});
+MetadataSchemaLoader.prototype.load = function() {
+ if (defined_default(this._schema)) {
+ this._promise = Promise.resolve(this);
+ } else {
+ this._promise = loadExternalSchema(this);
+ }
+ return this._promise;
+};
+function loadExternalSchema(schemaLoader) {
+ const resource = schemaLoader._resource;
+ schemaLoader._state = ResourceLoaderState_default.LOADING;
+ return resource.fetchJson().then(function(json) {
+ if (schemaLoader.isDestroyed()) {
+ return;
+ }
+ schemaLoader._schema = new MetadataSchema_default(json);
+ schemaLoader._state = ResourceLoaderState_default.READY;
+ return schemaLoader;
+ }).catch(function(error) {
+ if (schemaLoader.isDestroyed()) {
+ return;
+ }
+ schemaLoader._state = ResourceLoaderState_default.FAILED;
+ const errorMessage = `Failed to load schema: ${resource.url}`;
+ return Promise.reject(schemaLoader.getError(errorMessage, error));
+ });
+}
+MetadataSchemaLoader.prototype.unload = function() {
+ this._schema = void 0;
+};
+var MetadataSchemaLoader_default = MetadataSchemaLoader;
+
+// Source/Scene/ResourceCacheKey.js
+var ResourceCacheKey = {};
+function getExternalResourceCacheKey(resource) {
+ return getAbsoluteUri_default(resource.url);
+}
+function getBufferViewCacheKey(bufferView) {
+ let byteOffset = bufferView.byteOffset;
+ let byteLength = bufferView.byteLength;
+ if (hasExtension_default(bufferView, "EXT_meshopt_compression")) {
+ const meshopt = bufferView.extensions.EXT_meshopt_compression;
+ byteOffset = defaultValue_default(meshopt.byteOffset, 0);
+ byteLength = meshopt.byteLength;
+ }
+ return `${byteOffset}-${byteOffset + byteLength}`;
+}
+function getAccessorCacheKey(accessor, bufferView) {
+ const byteOffset = bufferView.byteOffset + accessor.byteOffset;
+ const componentType = accessor.componentType;
+ const type = accessor.type;
+ const count = accessor.count;
+ return `${byteOffset}-${componentType}-${type}-${count}`;
+}
+function getExternalBufferCacheKey(resource) {
+ return getExternalResourceCacheKey(resource);
+}
+function getEmbeddedBufferCacheKey(parentResource, bufferId) {
+ const parentCacheKey = getExternalResourceCacheKey(parentResource);
+ return `${parentCacheKey}-buffer-id-${bufferId}`;
+}
+function getBufferCacheKey(buffer, bufferId, gltfResource, baseResource2) {
+ if (defined_default(buffer.uri)) {
+ const resource = baseResource2.getDerivedResource({
+ url: buffer.uri
+ });
+ return getExternalBufferCacheKey(resource);
+ }
+ return getEmbeddedBufferCacheKey(gltfResource, bufferId);
+}
+function getDracoCacheKey(gltf, draco, gltfResource, baseResource2) {
+ const bufferViewId = draco.bufferView;
+ const bufferView = gltf.bufferViews[bufferViewId];
+ const bufferId = bufferView.buffer;
+ const buffer = gltf.buffers[bufferId];
+ const bufferCacheKey = getBufferCacheKey(
+ buffer,
+ bufferId,
+ gltfResource,
+ baseResource2
+ );
+ const bufferViewCacheKey = getBufferViewCacheKey(bufferView);
+ return `${bufferCacheKey}-range-${bufferViewCacheKey}`;
+}
+function getImageCacheKey(gltf, imageId, gltfResource, baseResource2) {
+ const image = gltf.images[imageId];
+ const bufferViewId = image.bufferView;
+ const uri = image.uri;
+ if (defined_default(uri)) {
+ const resource = baseResource2.getDerivedResource({
+ url: uri
+ });
+ return getExternalResourceCacheKey(resource);
+ }
+ const bufferView = gltf.bufferViews[bufferViewId];
+ const bufferId = bufferView.buffer;
+ const buffer = gltf.buffers[bufferId];
+ const bufferCacheKey = getBufferCacheKey(
+ buffer,
+ bufferId,
+ gltfResource,
+ baseResource2
+ );
+ const bufferViewCacheKey = getBufferViewCacheKey(bufferView);
+ return `${bufferCacheKey}-range-${bufferViewCacheKey}`;
+}
+function getSamplerCacheKey(gltf, textureInfo) {
+ const sampler = GltfLoaderUtil_default.createSampler({
+ gltf,
+ textureInfo
+ });
+ return `${sampler.wrapS}-${sampler.wrapT}-${sampler.minificationFilter}-${sampler.magnificationFilter}`;
+}
+ResourceCacheKey.getSchemaCacheKey = function(options) {
+ const schema = options.schema;
+ const resource = options.resource;
+ if (defined_default(schema) === defined_default(resource)) {
+ throw new DeveloperError_default(
+ "One of options.schema and options.resource must be defined."
+ );
+ }
+ if (defined_default(schema)) {
+ return `embedded-schema:${JSON.stringify(schema)}`;
+ }
+ return `external-schema:${getExternalResourceCacheKey(resource)}`;
+};
+ResourceCacheKey.getExternalBufferCacheKey = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const resource = options.resource;
+ Check_default.typeOf.object("options.resource", resource);
+ return `external-buffer:${getExternalBufferCacheKey(resource)}`;
+};
+ResourceCacheKey.getEmbeddedBufferCacheKey = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const parentResource = options.parentResource;
+ const bufferId = options.bufferId;
+ Check_default.typeOf.object("options.parentResource", parentResource);
+ Check_default.typeOf.number("options.bufferId", bufferId);
+ return `embedded-buffer:${getEmbeddedBufferCacheKey(
+ parentResource,
+ bufferId
+ )}`;
+};
+ResourceCacheKey.getGltfCacheKey = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltfResource = options.gltfResource;
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ return `gltf:${getExternalResourceCacheKey(gltfResource)}`;
+};
+ResourceCacheKey.getBufferViewCacheKey = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const bufferViewId = options.bufferViewId;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.number("options.bufferViewId", bufferViewId);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ const bufferView = gltf.bufferViews[bufferViewId];
+ let bufferId = bufferView.buffer;
+ const buffer = gltf.buffers[bufferId];
+ if (hasExtension_default(bufferView, "EXT_meshopt_compression")) {
+ const meshopt = bufferView.extensions.EXT_meshopt_compression;
+ bufferId = meshopt.buffer;
+ }
+ const bufferCacheKey = getBufferCacheKey(
+ buffer,
+ bufferId,
+ gltfResource,
+ baseResource2
+ );
+ const bufferViewCacheKey = getBufferViewCacheKey(bufferView);
+ return `buffer-view:${bufferCacheKey}-range-${bufferViewCacheKey}`;
+};
+ResourceCacheKey.getDracoCacheKey = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const draco = options.draco;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.draco", draco);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ return `draco:${getDracoCacheKey(gltf, draco, gltfResource, baseResource2)}`;
+};
+ResourceCacheKey.getVertexBufferCacheKey = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const frameState = options.frameState;
+ const bufferViewId = options.bufferViewId;
+ const draco = options.draco;
+ const attributeSemantic = options.attributeSemantic;
+ const dequantize = defaultValue_default(options.dequantize, false);
+ const loadBuffer = defaultValue_default(options.loadBuffer, false);
+ const loadTypedArray = defaultValue_default(options.loadTypedArray, false);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ Check_default.typeOf.object("options.frameState", frameState);
+ const hasBufferViewId = defined_default(bufferViewId);
+ const hasDraco = defined_default(draco);
+ const hasAttributeSemantic = defined_default(attributeSemantic);
+ if (hasBufferViewId === hasDraco) {
+ throw new DeveloperError_default(
+ "One of options.bufferViewId and options.draco must be defined."
+ );
+ }
+ if (hasDraco && !hasAttributeSemantic) {
+ throw new DeveloperError_default(
+ "When options.draco is defined options.attributeSemantic must also be defined."
+ );
+ }
+ if (hasDraco) {
+ Check_default.typeOf.object("options.draco", draco);
+ Check_default.typeOf.string("options.attributeSemantic", attributeSemantic);
+ }
+ if (!loadBuffer && !loadTypedArray) {
+ throw new DeveloperError_default(
+ "At least one of loadBuffer and loadTypedArray must be true."
+ );
+ }
+ let cacheKeySuffix = "";
+ if (dequantize) {
+ cacheKeySuffix += "-dequantize";
+ }
+ if (loadBuffer) {
+ cacheKeySuffix += "-buffer";
+ cacheKeySuffix += `-context-${frameState.context.id}`;
+ }
+ if (loadTypedArray) {
+ cacheKeySuffix += "-typed-array";
+ }
+ if (defined_default(draco)) {
+ const dracoCacheKey = getDracoCacheKey(
+ gltf,
+ draco,
+ gltfResource,
+ baseResource2
+ );
+ return `vertex-buffer:${dracoCacheKey}-draco-${attributeSemantic}${cacheKeySuffix}`;
+ }
+ const bufferView = gltf.bufferViews[bufferViewId];
+ const bufferId = bufferView.buffer;
+ const buffer = gltf.buffers[bufferId];
+ const bufferCacheKey = getBufferCacheKey(
+ buffer,
+ bufferId,
+ gltfResource,
+ baseResource2
+ );
+ const bufferViewCacheKey = getBufferViewCacheKey(bufferView);
+ return `vertex-buffer:${bufferCacheKey}-range-${bufferViewCacheKey}${cacheKeySuffix}`;
+};
+ResourceCacheKey.getIndexBufferCacheKey = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const accessorId = options.accessorId;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const frameState = options.frameState;
+ const draco = options.draco;
+ const loadBuffer = defaultValue_default(options.loadBuffer, false);
+ const loadTypedArray = defaultValue_default(options.loadTypedArray, false);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.number("options.accessorId", accessorId);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ Check_default.typeOf.object("options.frameState", frameState);
+ if (!loadBuffer && !loadTypedArray) {
+ throw new DeveloperError_default(
+ "At least one of loadBuffer and loadTypedArray must be true."
+ );
+ }
+ let cacheKeySuffix = "";
+ if (loadBuffer) {
+ cacheKeySuffix += "-buffer";
+ cacheKeySuffix += `-context-${frameState.context.id}`;
+ }
+ if (loadTypedArray) {
+ cacheKeySuffix += "-typed-array";
+ }
+ if (defined_default(draco)) {
+ const dracoCacheKey = getDracoCacheKey(
+ gltf,
+ draco,
+ gltfResource,
+ baseResource2
+ );
+ return `index-buffer:${dracoCacheKey}-draco${cacheKeySuffix}`;
+ }
+ const accessor = gltf.accessors[accessorId];
+ const bufferViewId = accessor.bufferView;
+ const bufferView = gltf.bufferViews[bufferViewId];
+ const bufferId = bufferView.buffer;
+ const buffer = gltf.buffers[bufferId];
+ const bufferCacheKey = getBufferCacheKey(
+ buffer,
+ bufferId,
+ gltfResource,
+ baseResource2
+ );
+ const accessorCacheKey = getAccessorCacheKey(accessor, bufferView);
+ return `index-buffer:${bufferCacheKey}-accessor-${accessorCacheKey}${cacheKeySuffix}`;
+};
+ResourceCacheKey.getImageCacheKey = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const imageId = options.imageId;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.number("options.imageId", imageId);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ const imageCacheKey = getImageCacheKey(
+ gltf,
+ imageId,
+ gltfResource,
+ baseResource2
+ );
+ return `image:${imageCacheKey}`;
+};
+ResourceCacheKey.getTextureCacheKey = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const textureInfo = options.textureInfo;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const supportedImageFormats = options.supportedImageFormats;
+ const frameState = options.frameState;
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.textureInfo", textureInfo);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ Check_default.typeOf.object("options.supportedImageFormats", supportedImageFormats);
+ Check_default.typeOf.object("options.frameState", frameState);
+ const textureId = textureInfo.index;
+ const imageId = GltfLoaderUtil_default.getImageIdFromTexture({
+ gltf,
+ textureId,
+ supportedImageFormats
+ });
+ const imageCacheKey = getImageCacheKey(
+ gltf,
+ imageId,
+ gltfResource,
+ baseResource2
+ );
+ const samplerCacheKey = getSamplerCacheKey(gltf, textureInfo);
+ return `texture:${imageCacheKey}-sampler-${samplerCacheKey}-context-${frameState.context.id}`;
+};
+var ResourceCacheKey_default = ResourceCacheKey;
+
+// Source/Scene/ResourceCacheStatistics.js
+function ResourceCacheStatistics() {
+ this.geometryByteLength = 0;
+ this.texturesByteLength = 0;
+ this._geometrySizes = {};
+ this._textureSizes = {};
+}
+ResourceCacheStatistics.prototype.clear = function() {
+ this.geometryByteLength = 0;
+ this.texturesByteLength = 0;
+ this._geometrySizes = {};
+ this._textureSizes = {};
+};
+ResourceCacheStatistics.prototype.addGeometryLoader = function(loader) {
+ Check_default.typeOf.object("loader", loader);
+ const cacheKey = loader.cacheKey;
+ if (this._geometrySizes.hasOwnProperty(cacheKey)) {
+ return;
+ }
+ this._geometrySizes[cacheKey] = 0;
+ const that = this;
+ return loader.promise.then(function(loader2) {
+ if (!that._geometrySizes.hasOwnProperty(cacheKey)) {
+ return;
+ }
+ const buffer = loader2.buffer;
+ const typedArray = loader2.typedArray;
+ let totalSize = 0;
+ if (defined_default(buffer)) {
+ totalSize += buffer.sizeInBytes;
+ }
+ if (defined_default(typedArray)) {
+ totalSize += typedArray.byteLength;
+ }
+ that.geometryByteLength += totalSize;
+ that._geometrySizes[cacheKey] = totalSize;
+ }).catch(function() {
+ delete that._geometrySizes[cacheKey];
+ });
+};
+ResourceCacheStatistics.prototype.addTextureLoader = function(loader) {
+ Check_default.typeOf.object("loader", loader);
+ const cacheKey = loader.cacheKey;
+ if (this._textureSizes.hasOwnProperty(cacheKey)) {
+ return;
+ }
+ this._textureSizes[cacheKey] = 0;
+ const that = this;
+ return loader.promise.then(function(loader2) {
+ if (!that._textureSizes.hasOwnProperty(cacheKey)) {
+ return;
+ }
+ const totalSize = loader2.texture.sizeInBytes;
+ that.texturesByteLength += loader2.texture.sizeInBytes;
+ that._textureSizes[cacheKey] = totalSize;
+ }).catch(function() {
+ delete that._textureSizes[cacheKey];
+ });
+};
+ResourceCacheStatistics.prototype.removeLoader = function(loader) {
+ Check_default.typeOf.object("loader", loader);
+ const cacheKey = loader.cacheKey;
+ const geometrySize = this._geometrySizes[cacheKey];
+ delete this._geometrySizes[cacheKey];
+ if (defined_default(geometrySize)) {
+ this.geometryByteLength -= geometrySize;
+ }
+ const textureSize = this._textureSizes[cacheKey];
+ delete this._textureSizes[cacheKey];
+ if (defined_default(textureSize)) {
+ this.texturesByteLength -= textureSize;
+ }
+};
+var ResourceCacheStatistics_default = ResourceCacheStatistics;
+
+// Source/Scene/ResourceCache.js
+function ResourceCache() {
+}
+ResourceCache.cacheEntries = {};
+ResourceCache.statistics = new ResourceCacheStatistics_default();
+function CacheEntry(resourceLoader) {
+ this.referenceCount = 1;
+ this.resourceLoader = resourceLoader;
+ this._statisticsPromise = void 0;
+}
+ResourceCache.get = function(cacheKey) {
+ Check_default.typeOf.string("cacheKey", cacheKey);
+ const cacheEntry = ResourceCache.cacheEntries[cacheKey];
+ if (defined_default(cacheEntry)) {
+ ++cacheEntry.referenceCount;
+ return cacheEntry.resourceLoader;
+ }
+ return void 0;
+};
+ResourceCache.load = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const resourceLoader = options.resourceLoader;
+ Check_default.typeOf.object("options.resourceLoader", resourceLoader);
+ const cacheKey = resourceLoader.cacheKey;
+ Check_default.typeOf.string("options.resourceLoader.cacheKey", cacheKey);
+ if (defined_default(ResourceCache.cacheEntries[cacheKey])) {
+ throw new DeveloperError_default(
+ `Resource with this cacheKey is already in the cache: ${cacheKey}`
+ );
+ }
+ ResourceCache.cacheEntries[cacheKey] = new CacheEntry(resourceLoader);
+ resourceLoader.load();
+};
+ResourceCache.unload = function(resourceLoader) {
+ Check_default.typeOf.object("resourceLoader", resourceLoader);
+ const cacheKey = resourceLoader.cacheKey;
+ const cacheEntry = ResourceCache.cacheEntries[cacheKey];
+ if (!defined_default(cacheEntry)) {
+ throw new DeveloperError_default(`Resource is not in the cache: ${cacheKey}`);
+ }
+ --cacheEntry.referenceCount;
+ if (cacheEntry.referenceCount === 0) {
+ ResourceCache.statistics.removeLoader(resourceLoader);
+ resourceLoader.destroy();
+ delete ResourceCache.cacheEntries[cacheKey];
+ }
+};
+ResourceCache.loadSchema = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const schema = options.schema;
+ const resource = options.resource;
+ if (defined_default(schema) === defined_default(resource)) {
+ throw new DeveloperError_default(
+ "One of options.schema and options.resource must be defined."
+ );
+ }
+ const cacheKey = ResourceCacheKey_default.getSchemaCacheKey({
+ schema,
+ resource
+ });
+ let schemaLoader = ResourceCache.get(cacheKey);
+ if (defined_default(schemaLoader)) {
+ return schemaLoader;
+ }
+ schemaLoader = new MetadataSchemaLoader_default({
+ schema,
+ resource,
+ cacheKey
+ });
+ ResourceCache.load({
+ resourceLoader: schemaLoader
+ });
+ return schemaLoader;
+};
+ResourceCache.loadEmbeddedBuffer = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const parentResource = options.parentResource;
+ const bufferId = options.bufferId;
+ const typedArray = options.typedArray;
+ Check_default.typeOf.object("options.parentResource", parentResource);
+ Check_default.typeOf.number("options.bufferId", bufferId);
+ const cacheKey = ResourceCacheKey_default.getEmbeddedBufferCacheKey({
+ parentResource,
+ bufferId
+ });
+ let bufferLoader = ResourceCache.get(cacheKey);
+ if (defined_default(bufferLoader)) {
+ return bufferLoader;
+ }
+ Check_default.typeOf.object("options.typedArray", typedArray);
+ bufferLoader = new BufferLoader_default({
+ typedArray,
+ cacheKey
+ });
+ ResourceCache.load({
+ resourceLoader: bufferLoader
+ });
+ return bufferLoader;
+};
+ResourceCache.loadExternalBuffer = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const resource = options.resource;
+ Check_default.typeOf.object("options.resource", resource);
+ const cacheKey = ResourceCacheKey_default.getExternalBufferCacheKey({
+ resource
+ });
+ let bufferLoader = ResourceCache.get(cacheKey);
+ if (defined_default(bufferLoader)) {
+ return bufferLoader;
+ }
+ bufferLoader = new BufferLoader_default({
+ resource,
+ cacheKey
+ });
+ ResourceCache.load({
+ resourceLoader: bufferLoader
+ });
+ return bufferLoader;
+};
+ResourceCache.loadGltfJson = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const typedArray = options.typedArray;
+ const gltfJson = options.gltfJson;
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ const cacheKey = ResourceCacheKey_default.getGltfCacheKey({
+ gltfResource
+ });
+ let gltfJsonLoader = ResourceCache.get(cacheKey);
+ if (defined_default(gltfJsonLoader)) {
+ return gltfJsonLoader;
+ }
+ gltfJsonLoader = new GltfJsonLoader_default({
+ resourceCache: ResourceCache,
+ gltfResource,
+ baseResource: baseResource2,
+ typedArray,
+ gltfJson,
+ cacheKey
+ });
+ ResourceCache.load({
+ resourceLoader: gltfJsonLoader
+ });
+ return gltfJsonLoader;
+};
+ResourceCache.loadBufferView = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const bufferViewId = options.bufferViewId;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.number("options.bufferViewId", bufferViewId);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ const cacheKey = ResourceCacheKey_default.getBufferViewCacheKey({
+ gltf,
+ bufferViewId,
+ gltfResource,
+ baseResource: baseResource2
+ });
+ let bufferViewLoader = ResourceCache.get(cacheKey);
+ if (defined_default(bufferViewLoader)) {
+ return bufferViewLoader;
+ }
+ bufferViewLoader = new GltfBufferViewLoader_default({
+ resourceCache: ResourceCache,
+ gltf,
+ bufferViewId,
+ gltfResource,
+ baseResource: baseResource2,
+ cacheKey
+ });
+ ResourceCache.load({
+ resourceLoader: bufferViewLoader
+ });
+ return bufferViewLoader;
+};
+ResourceCache.loadDraco = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const draco = options.draco;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.draco", draco);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ const cacheKey = ResourceCacheKey_default.getDracoCacheKey({
+ gltf,
+ draco,
+ gltfResource,
+ baseResource: baseResource2
+ });
+ let dracoLoader = ResourceCache.get(cacheKey);
+ if (defined_default(dracoLoader)) {
+ return dracoLoader;
+ }
+ dracoLoader = new GltfDracoLoader_default({
+ resourceCache: ResourceCache,
+ gltf,
+ draco,
+ gltfResource,
+ baseResource: baseResource2,
+ cacheKey
+ });
+ ResourceCache.load({
+ resourceLoader: dracoLoader
+ });
+ return dracoLoader;
+};
+ResourceCache.loadVertexBuffer = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const frameState = options.frameState;
+ const bufferViewId = options.bufferViewId;
+ const draco = options.draco;
+ const attributeSemantic = options.attributeSemantic;
+ const accessorId = options.accessorId;
+ const asynchronous = defaultValue_default(options.asynchronous, true);
+ const dequantize = defaultValue_default(options.dequantize, false);
+ const loadBuffer = defaultValue_default(options.loadBuffer, false);
+ const loadTypedArray = defaultValue_default(options.loadTypedArray, false);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ Check_default.typeOf.object("options.frameState", frameState);
+ if (!loadBuffer && !loadTypedArray) {
+ throw new DeveloperError_default(
+ "At least one of loadBuffer and loadTypedArray must be true."
+ );
+ }
+ const hasBufferViewId = defined_default(bufferViewId);
+ const hasDraco = defined_default(draco);
+ const hasAttributeSemantic = defined_default(attributeSemantic);
+ const hasAccessorId = defined_default(accessorId);
+ if (hasBufferViewId === hasDraco) {
+ throw new DeveloperError_default(
+ "One of options.bufferViewId and options.draco must be defined."
+ );
+ }
+ if (hasDraco && !hasAttributeSemantic) {
+ throw new DeveloperError_default(
+ "When options.draco is defined options.attributeSemantic must also be defined."
+ );
+ }
+ if (hasDraco && !hasAccessorId) {
+ throw new DeveloperError_default(
+ "When options.draco is defined options.haAccessorId must also be defined."
+ );
+ }
+ if (hasDraco) {
+ Check_default.typeOf.object("options.draco", draco);
+ Check_default.typeOf.string("options.attributeSemantic", attributeSemantic);
+ Check_default.typeOf.number("options.accessorId", accessorId);
+ }
+ const cacheKey = ResourceCacheKey_default.getVertexBufferCacheKey({
+ gltf,
+ gltfResource,
+ baseResource: baseResource2,
+ frameState,
+ bufferViewId,
+ draco,
+ attributeSemantic,
+ dequantize,
+ loadBuffer,
+ loadTypedArray
+ });
+ let vertexBufferLoader = ResourceCache.get(cacheKey);
+ if (defined_default(vertexBufferLoader)) {
+ return vertexBufferLoader;
+ }
+ vertexBufferLoader = new GltfVertexBufferLoader_default({
+ resourceCache: ResourceCache,
+ gltf,
+ gltfResource,
+ baseResource: baseResource2,
+ bufferViewId,
+ draco,
+ attributeSemantic,
+ accessorId,
+ cacheKey,
+ asynchronous,
+ dequantize,
+ loadBuffer,
+ loadTypedArray
+ });
+ ResourceCache.load({
+ resourceLoader: vertexBufferLoader
+ });
+ const promise = ResourceCache.statistics.addGeometryLoader(
+ vertexBufferLoader
+ );
+ ResourceCache.cacheEntries[cacheKey]._statisticsPromise = promise;
+ return vertexBufferLoader;
+};
+ResourceCache.loadIndexBuffer = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const accessorId = options.accessorId;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const frameState = options.frameState;
+ const draco = options.draco;
+ const asynchronous = defaultValue_default(options.asynchronous, true);
+ const loadBuffer = defaultValue_default(options.loadBuffer, false);
+ const loadTypedArray = defaultValue_default(options.loadTypedArray, false);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.number("options.accessorId", accessorId);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ Check_default.typeOf.object("options.frameState", frameState);
+ if (!loadBuffer && !loadTypedArray) {
+ throw new DeveloperError_default(
+ "At least one of loadBuffer and loadTypedArray must be true."
+ );
+ }
+ const cacheKey = ResourceCacheKey_default.getIndexBufferCacheKey({
+ gltf,
+ accessorId,
+ gltfResource,
+ baseResource: baseResource2,
+ frameState,
+ draco,
+ loadBuffer,
+ loadTypedArray
+ });
+ let indexBufferLoader = ResourceCache.get(cacheKey);
+ if (defined_default(indexBufferLoader)) {
+ return indexBufferLoader;
+ }
+ indexBufferLoader = new GltfIndexBufferLoader_default({
+ resourceCache: ResourceCache,
+ gltf,
+ accessorId,
+ gltfResource,
+ baseResource: baseResource2,
+ draco,
+ cacheKey,
+ asynchronous,
+ loadBuffer,
+ loadTypedArray
+ });
+ ResourceCache.load({
+ resourceLoader: indexBufferLoader
+ });
+ const promise = ResourceCache.statistics.addGeometryLoader(indexBufferLoader);
+ ResourceCache.cacheEntries[cacheKey]._statisticsPromise = promise;
+ return indexBufferLoader;
+};
+ResourceCache.loadImage = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const imageId = options.imageId;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.number("options.imageId", imageId);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ const cacheKey = ResourceCacheKey_default.getImageCacheKey({
+ gltf,
+ imageId,
+ gltfResource,
+ baseResource: baseResource2
+ });
+ let imageLoader = ResourceCache.get(cacheKey);
+ if (defined_default(imageLoader)) {
+ return imageLoader;
+ }
+ imageLoader = new GltfImageLoader_default({
+ resourceCache: ResourceCache,
+ gltf,
+ imageId,
+ gltfResource,
+ baseResource: baseResource2,
+ cacheKey
+ });
+ ResourceCache.load({
+ resourceLoader: imageLoader
+ });
+ return imageLoader;
+};
+ResourceCache.loadTexture = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const textureInfo = options.textureInfo;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const supportedImageFormats = options.supportedImageFormats;
+ const frameState = options.frameState;
+ const asynchronous = defaultValue_default(options.asynchronous, true);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.textureInfo", textureInfo);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ Check_default.typeOf.object("options.supportedImageFormats", supportedImageFormats);
+ Check_default.typeOf.object("options.frameState", frameState);
+ const cacheKey = ResourceCacheKey_default.getTextureCacheKey({
+ gltf,
+ textureInfo,
+ gltfResource,
+ baseResource: baseResource2,
+ supportedImageFormats,
+ frameState
+ });
+ let textureLoader = ResourceCache.get(cacheKey);
+ if (defined_default(textureLoader)) {
+ return textureLoader;
+ }
+ textureLoader = new GltfTextureLoader_default({
+ resourceCache: ResourceCache,
+ gltf,
+ textureInfo,
+ gltfResource,
+ baseResource: baseResource2,
+ supportedImageFormats,
+ cacheKey,
+ asynchronous
+ });
+ ResourceCache.load({
+ resourceLoader: textureLoader
+ });
+ const promise = ResourceCache.statistics.addTextureLoader(textureLoader);
+ ResourceCache.cacheEntries[cacheKey]._statisticsPromise = promise;
+ return textureLoader;
+};
+ResourceCache.clearForSpecs = function() {
+ const precedence = [
+ GltfVertexBufferLoader_default,
+ GltfIndexBufferLoader_default,
+ GltfDracoLoader_default,
+ GltfTextureLoader_default,
+ GltfImageLoader_default,
+ GltfBufferViewLoader_default,
+ BufferLoader_default,
+ MetadataSchemaLoader_default,
+ GltfJsonLoader_default
+ ];
+ let cacheKey;
+ const cacheEntries = ResourceCache.cacheEntries;
+ const cacheEntriesSorted = [];
+ for (cacheKey in cacheEntries) {
+ if (cacheEntries.hasOwnProperty(cacheKey)) {
+ cacheEntriesSorted.push(cacheEntries[cacheKey]);
+ }
+ }
+ cacheEntriesSorted.sort(function(a3, b) {
+ const indexA = precedence.indexOf(a3.resourceLoader.constructor);
+ const indexB = precedence.indexOf(b.resourceLoader.constructor);
+ return indexA - indexB;
+ });
+ const cacheEntriesLength = cacheEntriesSorted.length;
+ for (let i = 0; i < cacheEntriesLength; ++i) {
+ const cacheEntry = cacheEntriesSorted[i];
+ cacheKey = cacheEntry.resourceLoader.cacheKey;
+ if (defined_default(cacheEntries[cacheKey])) {
+ cacheEntry.resourceLoader.destroy();
+ delete cacheEntries[cacheKey];
+ }
+ }
+ ResourceCache.statistics.clear();
+};
+var ResourceCache_default = ResourceCache;
+
+// Source/Scene/ImplicitSubtree.js
+function ImplicitSubtree(resource, json, subtreeView, implicitTileset, implicitCoordinates) {
+ Check_default.typeOf.object("resource", resource);
+ if (defined_default(json) === defined_default(subtreeView)) {
+ throw new DeveloperError_default("One of json and subtreeView must be defined.");
+ }
+ Check_default.typeOf.object("implicitTileset", implicitTileset);
+ Check_default.typeOf.object("implicitCoordinates", implicitCoordinates);
+ this._resource = resource;
+ this._subtreeJson = void 0;
+ this._bufferLoader = void 0;
+ this._tileAvailability = void 0;
+ this._contentAvailabilityBitstreams = [];
+ this._childSubtreeAvailability = void 0;
+ this._implicitCoordinates = implicitCoordinates;
+ this._subtreeLevels = implicitTileset.subtreeLevels;
+ this._subdivisionScheme = implicitTileset.subdivisionScheme;
+ this._branchingFactor = implicitTileset.branchingFactor;
+ this._metadata = void 0;
+ this._tileMetadataTable = void 0;
+ this._tilePropertyTableJson = void 0;
+ this._contentMetadataTables = [];
+ this._contentPropertyTableJsons = [];
+ this._tileJumpBuffer = void 0;
+ this._contentJumpBuffers = [];
+ this._readyPromise = initialize7(this, json, subtreeView, implicitTileset);
+}
+Object.defineProperties(ImplicitSubtree.prototype, {
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ },
+ metadata: {
+ get: function() {
+ return this._metadata;
+ }
+ },
+ tileMetadataTable: {
+ get: function() {
+ return this._tileMetadataTable;
+ }
+ },
+ tilePropertyTableJson: {
+ get: function() {
+ return this._tilePropertyTableJson;
+ }
+ },
+ contentMetadataTables: {
+ get: function() {
+ return this._contentMetadataTables;
+ }
+ },
+ contentPropertyTableJsons: {
+ get: function() {
+ return this._contentPropertyTableJsons;
+ }
+ },
+ implicitCoordinates: {
+ get: function() {
+ return this._implicitCoordinates;
+ }
+ }
+});
+ImplicitSubtree.prototype.tileIsAvailableAtIndex = function(index) {
+ return this._tileAvailability.getBit(index);
+};
+ImplicitSubtree.prototype.tileIsAvailableAtCoordinates = function(implicitCoordinates) {
+ const index = this.getTileIndex(implicitCoordinates);
+ return this.tileIsAvailableAtIndex(index);
+};
+ImplicitSubtree.prototype.contentIsAvailableAtIndex = function(index, contentIndex) {
+ contentIndex = defaultValue_default(contentIndex, 0);
+ if (contentIndex < 0 || contentIndex >= this._contentAvailabilityBitstreams.length) {
+ throw new DeveloperError_default("contentIndex out of bounds.");
+ }
+ return this._contentAvailabilityBitstreams[contentIndex].getBit(index);
+};
+ImplicitSubtree.prototype.contentIsAvailableAtCoordinates = function(implicitCoordinates, contentIndex) {
+ const index = this.getTileIndex(implicitCoordinates);
+ return this.contentIsAvailableAtIndex(index, contentIndex);
+};
+ImplicitSubtree.prototype.childSubtreeIsAvailableAtIndex = function(index) {
+ return this._childSubtreeAvailability.getBit(index);
+};
+ImplicitSubtree.prototype.childSubtreeIsAvailableAtCoordinates = function(implicitCoordinates) {
+ const index = this.getChildSubtreeIndex(implicitCoordinates);
+ return this.childSubtreeIsAvailableAtIndex(index);
+};
+ImplicitSubtree.prototype.getLevelOffset = function(level) {
+ const branchingFactor = this._branchingFactor;
+ return (Math.pow(branchingFactor, level) - 1) / (branchingFactor - 1);
+};
+ImplicitSubtree.prototype.getParentMortonIndex = function(mortonIndex) {
+ let bitsPerLevel = 2;
+ if (this._subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ bitsPerLevel = 3;
+ }
+ return mortonIndex >> bitsPerLevel;
+};
+function initialize7(subtree, json, subtreeView, implicitTileset) {
+ let chunks;
+ if (defined_default(json)) {
+ chunks = {
+ json,
+ binary: void 0
+ };
+ } else {
+ chunks = parseSubtreeChunks(subtreeView);
+ }
+ const subtreeJson = chunks.json;
+ subtree._subtreeJson = subtreeJson;
+ let tilePropertyTableJson;
+ if (hasExtension_default(subtreeJson, "3DTILES_metadata")) {
+ tilePropertyTableJson = subtreeJson.extensions["3DTILES_metadata"];
+ } else if (defined_default(subtreeJson.tileMetadata)) {
+ const propertyTableIndex = subtreeJson.tileMetadata;
+ tilePropertyTableJson = subtreeJson.propertyTables[propertyTableIndex];
+ }
+ const contentPropertyTableJsons = [];
+ if (defined_default(subtreeJson.contentMetadata)) {
+ const length3 = subtreeJson.contentMetadata.length;
+ for (let i = 0; i < length3; i++) {
+ const propertyTableIndex = subtreeJson.contentMetadata[i];
+ contentPropertyTableJsons.push(
+ subtreeJson.propertyTables[propertyTableIndex]
+ );
+ }
+ }
+ let metadata;
+ const schema = implicitTileset.metadataSchema;
+ const subtreeMetadata = subtreeJson.subtreeMetadata;
+ if (defined_default(subtreeMetadata)) {
+ const metadataClass = subtreeMetadata.class;
+ const subtreeMetadataClass = schema.classes[metadataClass];
+ metadata = new ImplicitSubtreeMetadata_default({
+ subtreeMetadata,
+ class: subtreeMetadataClass
+ });
+ }
+ subtree._metadata = metadata;
+ subtree._tilePropertyTableJson = tilePropertyTableJson;
+ subtree._contentPropertyTableJsons = contentPropertyTableJsons;
+ const defaultContentAvailability = {
+ constant: 0
+ };
+ subtreeJson.contentAvailabilityHeaders = [];
+ if (hasExtension_default(subtreeJson, "3DTILES_multiple_contents")) {
+ subtreeJson.contentAvailabilityHeaders = subtreeJson.extensions["3DTILES_multiple_contents"].contentAvailability;
+ } else if (Array.isArray(subtreeJson.contentAvailability)) {
+ subtreeJson.contentAvailabilityHeaders = subtreeJson.contentAvailability;
+ } else {
+ subtreeJson.contentAvailabilityHeaders.push(
+ defaultValue_default(subtreeJson.contentAvailability, defaultContentAvailability)
+ );
+ }
+ const bufferHeaders = preprocessBuffers(subtreeJson.buffers);
+ const bufferViewHeaders = preprocessBufferViews(
+ subtreeJson.bufferViews,
+ bufferHeaders
+ );
+ markActiveBufferViews(subtreeJson, bufferViewHeaders);
+ if (defined_default(tilePropertyTableJson)) {
+ markActiveMetadataBufferViews(tilePropertyTableJson, bufferViewHeaders);
+ }
+ for (let i = 0; i < contentPropertyTableJsons.length; i++) {
+ const contentPropertyTableJson = contentPropertyTableJsons[i];
+ markActiveMetadataBufferViews(contentPropertyTableJson, bufferViewHeaders);
+ }
+ return requestActiveBuffers(subtree, bufferHeaders, chunks.binary).then(
+ function(buffersU8) {
+ const bufferViewsU8 = parseActiveBufferViews(
+ bufferViewHeaders,
+ buffersU8
+ );
+ parseAvailability(subtree, subtreeJson, implicitTileset, bufferViewsU8);
+ if (defined_default(tilePropertyTableJson)) {
+ parseTileMetadataTable(subtree, implicitTileset, bufferViewsU8);
+ makeTileJumpBuffer(subtree);
+ }
+ parseContentMetadataTables(subtree, implicitTileset, bufferViewsU8);
+ makeContentJumpBuffers(subtree);
+ return subtree;
+ }
+ );
+}
+function parseSubtreeChunks(subtreeView) {
+ const littleEndian2 = true;
+ const subtreeReader = new DataView(
+ subtreeView.buffer,
+ subtreeView.byteOffset
+ );
+ let byteOffset = 8;
+ const jsonByteLength = subtreeReader.getUint32(byteOffset, littleEndian2);
+ byteOffset += 8;
+ const binaryByteLength = subtreeReader.getUint32(byteOffset, littleEndian2);
+ byteOffset += 8;
+ const subtreeJson = getJsonFromTypedArray_default(
+ subtreeView,
+ byteOffset,
+ jsonByteLength
+ );
+ byteOffset += jsonByteLength;
+ const subtreeBinary = subtreeView.subarray(
+ byteOffset,
+ byteOffset + binaryByteLength
+ );
+ return {
+ json: subtreeJson,
+ binary: subtreeBinary
+ };
+}
+function preprocessBuffers(bufferHeaders) {
+ bufferHeaders = defined_default(bufferHeaders) ? bufferHeaders : [];
+ for (let i = 0; i < bufferHeaders.length; i++) {
+ const bufferHeader = bufferHeaders[i];
+ bufferHeader.isExternal = defined_default(bufferHeader.uri);
+ bufferHeader.isActive = false;
+ }
+ return bufferHeaders;
+}
+function preprocessBufferViews(bufferViewHeaders, bufferHeaders) {
+ bufferViewHeaders = defined_default(bufferViewHeaders) ? bufferViewHeaders : [];
+ for (let i = 0; i < bufferViewHeaders.length; i++) {
+ const bufferViewHeader = bufferViewHeaders[i];
+ const bufferHeader = bufferHeaders[bufferViewHeader.buffer];
+ bufferViewHeader.bufferHeader = bufferHeader;
+ bufferViewHeader.isActive = false;
+ }
+ return bufferViewHeaders;
+}
+function markActiveBufferViews(subtreeJson, bufferViewHeaders) {
+ let header;
+ const tileAvailabilityHeader = subtreeJson.tileAvailability;
+ if (defined_default(tileAvailabilityHeader.bitstream)) {
+ header = bufferViewHeaders[tileAvailabilityHeader.bitstream];
+ } else if (defined_default(tileAvailabilityHeader.bufferView)) {
+ header = bufferViewHeaders[tileAvailabilityHeader.bufferView];
+ }
+ if (defined_default(header)) {
+ header.isActive = true;
+ header.bufferHeader.isActive = true;
+ }
+ const contentAvailabilityHeaders = subtreeJson.contentAvailabilityHeaders;
+ for (let i = 0; i < contentAvailabilityHeaders.length; i++) {
+ header = void 0;
+ if (defined_default(contentAvailabilityHeaders[i].bitstream)) {
+ header = bufferViewHeaders[contentAvailabilityHeaders[i].bitstream];
+ } else if (defined_default(contentAvailabilityHeaders[i].bufferView)) {
+ header = bufferViewHeaders[contentAvailabilityHeaders[i].bufferView];
+ }
+ if (defined_default(header)) {
+ header.isActive = true;
+ header.bufferHeader.isActive = true;
+ }
+ }
+ header = void 0;
+ const childSubtreeAvailabilityHeader = subtreeJson.childSubtreeAvailability;
+ if (defined_default(childSubtreeAvailabilityHeader.bitstream)) {
+ header = bufferViewHeaders[childSubtreeAvailabilityHeader.bitstream];
+ } else if (defined_default(childSubtreeAvailabilityHeader.bufferView)) {
+ header = bufferViewHeaders[childSubtreeAvailabilityHeader.bufferView];
+ }
+ if (defined_default(header)) {
+ header.isActive = true;
+ header.bufferHeader.isActive = true;
+ }
+}
+function markActiveMetadataBufferViews(propertyTableJson, bufferViewHeaders) {
+ const properties = propertyTableJson.properties;
+ let header;
+ for (const key in properties) {
+ if (properties.hasOwnProperty(key)) {
+ const metadataHeader = properties[key];
+ const valuesBufferView = defaultValue_default(
+ metadataHeader.values,
+ metadataHeader.bufferView
+ );
+ header = bufferViewHeaders[valuesBufferView];
+ header.isActive = true;
+ header.bufferHeader.isActive = true;
+ const stringOffsetBufferView = defaultValue_default(
+ metadataHeader.stringOffsets,
+ metadataHeader.stringOffsetBufferView
+ );
+ if (defined_default(stringOffsetBufferView)) {
+ header = bufferViewHeaders[stringOffsetBufferView];
+ header.isActive = true;
+ header.bufferHeader.isActive = true;
+ }
+ const arrayOffsetBufferView = defaultValue_default(
+ metadataHeader.arrayOffsets,
+ metadataHeader.arrayOffsetBufferView
+ );
+ if (defined_default(arrayOffsetBufferView)) {
+ header = bufferViewHeaders[arrayOffsetBufferView];
+ header.isActive = true;
+ header.bufferHeader.isActive = true;
+ }
+ }
+ }
+}
+function requestActiveBuffers(subtree, bufferHeaders, internalBuffer) {
+ const promises = [];
+ for (let i = 0; i < bufferHeaders.length; i++) {
+ const bufferHeader = bufferHeaders[i];
+ if (!bufferHeader.isActive) {
+ promises.push(Promise.resolve(void 0));
+ } else if (bufferHeader.isExternal) {
+ const promise = requestExternalBuffer(subtree, bufferHeader);
+ promises.push(promise);
+ } else {
+ promises.push(Promise.resolve(internalBuffer));
+ }
+ }
+ return Promise.all(promises).then(function(bufferResults) {
+ const buffersU8 = {};
+ for (let i = 0; i < bufferResults.length; i++) {
+ const result = bufferResults[i];
+ if (defined_default(result)) {
+ buffersU8[i] = result;
+ }
+ }
+ return buffersU8;
+ });
+}
+function requestExternalBuffer(subtree, bufferHeader) {
+ const baseResource2 = subtree._resource;
+ const bufferResource = baseResource2.getDerivedResource({
+ url: bufferHeader.uri
+ });
+ const bufferLoader = ResourceCache_default.loadExternalBuffer({
+ resource: bufferResource
+ });
+ subtree._bufferLoader = bufferLoader;
+ return bufferLoader.promise.then(function(bufferLoader2) {
+ return bufferLoader2.typedArray;
+ });
+}
+function parseActiveBufferViews(bufferViewHeaders, buffersU8) {
+ const bufferViewsU8 = {};
+ for (let i = 0; i < bufferViewHeaders.length; i++) {
+ const bufferViewHeader = bufferViewHeaders[i];
+ if (!bufferViewHeader.isActive) {
+ continue;
+ }
+ const start = bufferViewHeader.byteOffset;
+ const end = start + bufferViewHeader.byteLength;
+ const buffer = buffersU8[bufferViewHeader.buffer];
+ const bufferView = buffer.subarray(start, end);
+ bufferViewsU8[i] = bufferView;
+ }
+ return bufferViewsU8;
+}
+function parseAvailability(subtree, subtreeJson, implicitTileset, bufferViewsU8) {
+ const branchingFactor = implicitTileset.branchingFactor;
+ const subtreeLevels = implicitTileset.subtreeLevels;
+ const tileAvailabilityBits = (Math.pow(branchingFactor, subtreeLevels) - 1) / (branchingFactor - 1);
+ const childSubtreeBits = Math.pow(branchingFactor, subtreeLevels);
+ const hasMetadataExtension = hasExtension_default(subtreeJson, "3DTILES_metadata");
+ const hasTileMetadata = defined_default(subtree._tilePropertyTableJson);
+ let computeAvailableCountEnabled = hasMetadataExtension || hasTileMetadata;
+ subtree._tileAvailability = parseAvailabilityBitstream(
+ subtreeJson.tileAvailability,
+ bufferViewsU8,
+ tileAvailabilityBits,
+ computeAvailableCountEnabled
+ );
+ const hasContentMetadata = subtree._contentPropertyTableJsons.length > 0;
+ computeAvailableCountEnabled = computeAvailableCountEnabled || hasContentMetadata;
+ for (let i = 0; i < subtreeJson.contentAvailabilityHeaders.length; i++) {
+ const bitstream = parseAvailabilityBitstream(
+ subtreeJson.contentAvailabilityHeaders[i],
+ bufferViewsU8,
+ tileAvailabilityBits,
+ computeAvailableCountEnabled
+ );
+ subtree._contentAvailabilityBitstreams.push(bitstream);
+ }
+ subtree._childSubtreeAvailability = parseAvailabilityBitstream(
+ subtreeJson.childSubtreeAvailability,
+ bufferViewsU8,
+ childSubtreeBits
+ );
+}
+function parseAvailabilityBitstream(availabilityJson, bufferViewsU8, lengthBits, computeAvailableCountEnabled) {
+ if (defined_default(availabilityJson.constant)) {
+ return new ImplicitAvailabilityBitstream_default({
+ constant: Boolean(availabilityJson.constant),
+ lengthBits,
+ availableCount: availabilityJson.availableCount
+ });
+ }
+ let bufferView;
+ if (defined_default(availabilityJson.bitstream)) {
+ bufferView = bufferViewsU8[availabilityJson.bitstream];
+ } else if (defined_default(availabilityJson.bufferView)) {
+ bufferView = bufferViewsU8[availabilityJson.bufferView];
+ }
+ return new ImplicitAvailabilityBitstream_default({
+ bitstream: bufferView,
+ lengthBits,
+ availableCount: availabilityJson.availableCount,
+ computeAvailableCountEnabled
+ });
+}
+function parseTileMetadataTable(subtree, implicitTileset, bufferViewsU8) {
+ const tilePropertyTableJson = subtree._tilePropertyTableJson;
+ const tileCount = subtree._tileAvailability.availableCount;
+ const metadataSchema = implicitTileset.metadataSchema;
+ const tileMetadataClassName = tilePropertyTableJson.class;
+ const tileMetadataClass = metadataSchema.classes[tileMetadataClassName];
+ subtree._tileMetadataTable = new MetadataTable_default({
+ class: tileMetadataClass,
+ count: tileCount,
+ properties: tilePropertyTableJson.properties,
+ bufferViews: bufferViewsU8
+ });
+}
+function parseContentMetadataTables(subtree, implicitTileset, bufferViewsU8) {
+ const contentPropertyTableJsons = subtree._contentPropertyTableJsons;
+ const contentAvailabilityBitstreams = subtree._contentAvailabilityBitstreams;
+ const metadataSchema = implicitTileset.metadataSchema;
+ const contentMetadataTables = subtree._contentMetadataTables;
+ for (let i = 0; i < contentPropertyTableJsons.length; i++) {
+ const contentPropertyTableJson = contentPropertyTableJsons[i];
+ const contentAvailabilityBitsteam = contentAvailabilityBitstreams[i];
+ const contentCount = contentAvailabilityBitsteam.availableCount;
+ const contentMetadataClassName = contentPropertyTableJson.class;
+ const contentMetadataClass = metadataSchema.classes[contentMetadataClassName];
+ const metadataTable = new MetadataTable_default({
+ class: contentMetadataClass,
+ count: contentCount,
+ properties: contentPropertyTableJson.properties,
+ bufferViews: bufferViewsU8
+ });
+ contentMetadataTables.push(metadataTable);
+ }
+}
+function makeJumpBuffer(availability) {
+ let entityId = 0;
+ const bufferLength = availability.lengthBits;
+ const availableCount = availability.availableCount;
+ let jumpBuffer;
+ if (availableCount < 256) {
+ jumpBuffer = new Uint8Array(bufferLength);
+ } else if (availableCount < 65536) {
+ jumpBuffer = new Uint16Array(bufferLength);
+ } else {
+ jumpBuffer = new Uint32Array(bufferLength);
+ }
+ for (let i = 0; i < availability.lengthBits; i++) {
+ if (availability.getBit(i)) {
+ jumpBuffer[i] = entityId;
+ entityId++;
+ }
+ }
+ return jumpBuffer;
+}
+function makeTileJumpBuffer(subtree) {
+ const tileJumpBuffer = makeJumpBuffer(subtree._tileAvailability);
+ subtree._tileJumpBuffer = tileJumpBuffer;
+}
+function makeContentJumpBuffers(subtree) {
+ const contentJumpBuffers = subtree._contentJumpBuffers;
+ const contentAvailabilityBitstreams = subtree._contentAvailabilityBitstreams;
+ for (let i = 0; i < contentAvailabilityBitstreams.length; i++) {
+ const contentAvailability = contentAvailabilityBitstreams[i];
+ const contentJumpBuffer = makeJumpBuffer(contentAvailability);
+ contentJumpBuffers.push(contentJumpBuffer);
+ }
+}
+ImplicitSubtree.prototype.getTileIndex = function(implicitCoordinates) {
+ const localLevel = implicitCoordinates.level - this._implicitCoordinates.level;
+ if (localLevel < 0 || this._subtreeLevels <= localLevel) {
+ throw new RuntimeError_default("level is out of bounds for this subtree");
+ }
+ const subtreeCoordinates = implicitCoordinates.getSubtreeCoordinates();
+ const offsetCoordinates = subtreeCoordinates.getOffsetCoordinates(
+ implicitCoordinates
+ );
+ const index = offsetCoordinates.tileIndex;
+ return index;
+};
+ImplicitSubtree.prototype.getChildSubtreeIndex = function(implicitCoordinates) {
+ const localLevel = implicitCoordinates.level - this._implicitCoordinates.level;
+ if (localLevel !== this._implicitCoordinates.subtreeLevels) {
+ throw new RuntimeError_default("level is out of bounds for this subtree");
+ }
+ const parentSubtreeCoordinates = implicitCoordinates.getParentSubtreeCoordinates();
+ const offsetCoordinates = parentSubtreeCoordinates.getOffsetCoordinates(
+ implicitCoordinates
+ );
+ const index = offsetCoordinates.mortonIndex;
+ return index;
+};
+function getTileEntityId(subtree, implicitCoordinates) {
+ if (!defined_default(subtree._tileMetadataTable)) {
+ return void 0;
+ }
+ const tileIndex = subtree.getTileIndex(implicitCoordinates);
+ if (subtree._tileAvailability.getBit(tileIndex)) {
+ return subtree._tileJumpBuffer[tileIndex];
+ }
+ return void 0;
+}
+function getContentEntityId(subtree, implicitCoordinates, contentIndex) {
+ const metadataTables = subtree._contentMetadataTables;
+ if (!defined_default(metadataTables)) {
+ return void 0;
+ }
+ const metadataTable = metadataTables[contentIndex];
+ if (!defined_default(metadataTable)) {
+ return void 0;
+ }
+ const availability = subtree._contentAvailabilityBitstreams[contentIndex];
+ const tileIndex = subtree.getTileIndex(implicitCoordinates);
+ if (availability.getBit(tileIndex)) {
+ const contentJumpBuffer = subtree._contentJumpBuffers[contentIndex];
+ return contentJumpBuffer[tileIndex];
+ }
+ return void 0;
+}
+ImplicitSubtree.prototype.getTileMetadataView = function(implicitCoordinates) {
+ const entityId = getTileEntityId(this, implicitCoordinates);
+ if (!defined_default(entityId)) {
+ return void 0;
+ }
+ const metadataTable = this._tileMetadataTable;
+ return new ImplicitMetadataView_default({
+ class: metadataTable.class,
+ metadataTable,
+ entityId,
+ propertyTableJson: this._tilePropertyTableJson
+ });
+};
+ImplicitSubtree.prototype.getContentMetadataView = function(implicitCoordinates, contentIndex) {
+ const entityId = getContentEntityId(this, implicitCoordinates, contentIndex);
+ if (!defined_default(entityId)) {
+ return void 0;
+ }
+ const metadataTable = this._contentMetadataTables[contentIndex];
+ const propertyTableJson = this._contentPropertyTableJsons[contentIndex];
+ return new ImplicitMetadataView_default({
+ class: metadataTable.class,
+ metadataTable,
+ entityId,
+ contentIndex,
+ propertyTableJson
+ });
+};
+ImplicitSubtree.prototype.isDestroyed = function() {
+ return false;
+};
+ImplicitSubtree.prototype.destroy = function() {
+ if (defined_default(this._bufferLoader)) {
+ ResourceCache_default.unload(this._bufferLoader);
+ }
+ return destroyObject_default(this);
+};
+var ImplicitSubtree_default = ImplicitSubtree;
+
+// Source/Scene/MetadataSemantic.js
+var MetadataSemantic = {
+ ID: "ID",
+ NAME: "NAME",
+ DESCRIPTION: "DESCRIPTION",
+ TILE_BOUNDING_BOX: "TILE_BOUNDING_BOX",
+ TILE_BOUNDING_REGION: "TILE_BOUNDING_REGION",
+ TILE_BOUNDING_SPHERE: "TILE_BOUNDING_SPHERE",
+ TILE_MINIMUM_HEIGHT: "TILE_MINIMUM_HEIGHT",
+ TILE_MAXIMUM_HEIGHT: "TILE_MAXIMUM_HEIGHT",
+ TILE_HORIZON_OCCLUSION_POINT: "TILE_HORIZON_OCCLUSION_POINT",
+ TILE_GEOMETRIC_ERROR: "TILE_GEOMETRIC_ERROR",
+ CONTENT_BOUNDING_BOX: "CONTENT_BOUNDING_BOX",
+ CONTENT_BOUNDING_REGION: "CONTENT_BOUNDING_REGION",
+ CONTENT_BOUNDING_SPHERE: "CONTENT_BOUNDING_SPHERE",
+ CONTENT_MINIMUM_HEIGHT: "CONTENT_MINIMUM_HEIGHT",
+ CONTENT_MAXIMUM_HEIGHT: "CONTENT_MAXIMUM_HEIGHT",
+ CONTENT_HORIZON_OCCLUSION_POINT: "CONTENT_HORIZON_OCCLUSION_POINT"
+};
+var MetadataSemantic_default = Object.freeze(MetadataSemantic);
+
+// Source/Scene/parseBoundingVolumeSemantics.js
+function parseBoundingVolumeSemantics(tileMetadata) {
+ Check_default.typeOf.object("tileMetadata", tileMetadata);
+ return {
+ tile: {
+ boundingVolume: parseBoundingVolume("TILE", tileMetadata),
+ minimumHeight: parseMinimumHeight("TILE", tileMetadata),
+ maximumHeight: parseMaximumHeight("TILE", tileMetadata)
+ },
+ content: {
+ boundingVolume: parseBoundingVolume("CONTENT", tileMetadata),
+ minimumHeight: parseMinimumHeight("CONTENT", tileMetadata),
+ maximumHeight: parseMaximumHeight("CONTENT", tileMetadata)
+ }
+ };
+}
+function parseBoundingVolume(prefix, tileMetadata) {
+ const boundingBoxSemantic = `${prefix}_BOUNDING_BOX`;
+ const boundingBox = tileMetadata.getPropertyBySemantic(boundingBoxSemantic);
+ if (defined_default(boundingBox)) {
+ return {
+ box: boundingBox
+ };
+ }
+ const boundingRegionSemantic = `${prefix}_BOUNDING_REGION`;
+ const boundingRegion = tileMetadata.getPropertyBySemantic(
+ boundingRegionSemantic
+ );
+ if (defined_default(boundingRegion)) {
+ return {
+ region: boundingRegion
+ };
+ }
+ const boundingSphereSemantic = `${prefix}_BOUNDING_SPHERE`;
+ const boundingSphere = tileMetadata.getPropertyBySemantic(
+ boundingSphereSemantic
+ );
+ if (defined_default(boundingSphere)) {
+ return {
+ sphere: boundingSphere
+ };
+ }
+ return void 0;
+}
+function parseMinimumHeight(prefix, tileMetadata) {
+ const minimumHeightSemantic = `${prefix}_MINIMUM_HEIGHT`;
+ return tileMetadata.getPropertyBySemantic(minimumHeightSemantic);
+}
+function parseMaximumHeight(prefix, tileMetadata) {
+ const maximumHeightSemantic = `${prefix}_MAXIMUM_HEIGHT`;
+ return tileMetadata.getPropertyBySemantic(maximumHeightSemantic);
+}
+var parseBoundingVolumeSemantics_default = parseBoundingVolumeSemantics;
+
+// Source/Scene/Implicit3DTileContent.js
+function Implicit3DTileContent(tileset, tile, resource, json, arrayBuffer, byteOffset) {
+ Check_default.defined("tile.implicitTileset", tile.implicitTileset);
+ Check_default.defined("tile.implicitCoordinates", tile.implicitCoordinates);
+ if (defined_default(json) === defined_default(arrayBuffer)) {
+ throw new DeveloperError_default("One of json and arrayBuffer must be defined.");
+ }
+ const implicitTileset = tile.implicitTileset;
+ const implicitCoordinates = tile.implicitCoordinates;
+ this._implicitTileset = implicitTileset;
+ this._implicitCoordinates = implicitCoordinates;
+ this._implicitSubtree = void 0;
+ this._tileset = tileset;
+ this._tile = tile;
+ this._resource = resource;
+ this._metadata = void 0;
+ this.featurePropertiesDirty = false;
+ this._group = void 0;
+ const templateValues = implicitCoordinates.getTemplateValues();
+ const subtreeResource = implicitTileset.subtreeUriTemplate.getDerivedResource(
+ {
+ templateValues
+ }
+ );
+ this._url = subtreeResource.getUrlComponent(true);
+ this._readyPromise = initialize8(this, json, arrayBuffer, byteOffset);
+}
+Object.defineProperties(Implicit3DTileContent.prototype, {
+ featuresLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ pointsLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ trianglesLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ texturesByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ batchTableByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ innerContents: {
+ get: function() {
+ return void 0;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._tileset;
+ }
+ },
+ tile: {
+ get: function() {
+ return this._tile;
+ }
+ },
+ url: {
+ get: function() {
+ return this._url;
+ }
+ },
+ metadata: {
+ get: function() {
+ return void 0;
+ },
+ set: function() {
+ throw new DeveloperError_default("Implicit3DTileContent cannot have metadata");
+ }
+ },
+ batchTable: {
+ get: function() {
+ return void 0;
+ }
+ },
+ group: {
+ get: function() {
+ return this._group;
+ },
+ set: function(value) {
+ this._group = value;
+ }
+ }
+});
+function initialize8(content, json, arrayBuffer, byteOffset) {
+ byteOffset = defaultValue_default(byteOffset, 0);
+ let uint8Array;
+ if (defined_default(arrayBuffer)) {
+ uint8Array = new Uint8Array(arrayBuffer, byteOffset);
+ }
+ const subtree = new ImplicitSubtree_default(
+ content._resource,
+ json,
+ uint8Array,
+ content._implicitTileset,
+ content._implicitCoordinates
+ );
+ content._implicitSubtree = subtree;
+ return subtree.readyPromise.then(function() {
+ expandSubtree(content, subtree);
+ return content;
+ });
+}
+function expandSubtree(content, subtree) {
+ const placeholderTile = content._tile;
+ const childIndex = content._implicitCoordinates.childIndex;
+ const results = transcodeSubtreeTiles(
+ content,
+ subtree,
+ placeholderTile,
+ childIndex
+ );
+ const statistics2 = content._tileset.statistics;
+ placeholderTile.children.push(results.rootTile);
+ statistics2.numberOfTilesTotal++;
+ const childSubtrees = listChildSubtrees(content, subtree, results.bottomRow);
+ for (let i = 0; i < childSubtrees.length; i++) {
+ const subtreeLocator = childSubtrees[i];
+ const leafTile = subtreeLocator.tile;
+ const implicitChildTile = makePlaceholderChildSubtree(
+ content,
+ leafTile,
+ subtreeLocator.childIndex
+ );
+ leafTile.children.push(implicitChildTile);
+ statistics2.numberOfTilesTotal++;
+ }
+}
+function listChildSubtrees(content, subtree, bottomRow) {
+ const results = [];
+ const branchingFactor = content._implicitTileset.branchingFactor;
+ for (let i = 0; i < bottomRow.length; i++) {
+ const leafTile = bottomRow[i];
+ if (!defined_default(leafTile)) {
+ continue;
+ }
+ for (let j = 0; j < branchingFactor; j++) {
+ const index = i * branchingFactor + j;
+ if (subtree.childSubtreeIsAvailableAtIndex(index)) {
+ results.push({
+ tile: leafTile,
+ childIndex: j
+ });
+ }
+ }
+ }
+ return results;
+}
+function transcodeSubtreeTiles(content, subtree, placeholderTile, childIndex) {
+ const rootBitIndex = 0;
+ const rootParentIsPlaceholder = true;
+ const rootTile = deriveChildTile(
+ content,
+ subtree,
+ placeholderTile,
+ childIndex,
+ rootBitIndex,
+ rootParentIsPlaceholder
+ );
+ const statistics2 = content._tileset.statistics;
+ let parentRow = [rootTile];
+ let currentRow = [];
+ const implicitTileset = content._implicitTileset;
+ for (let level = 1; level < implicitTileset.subtreeLevels; level++) {
+ const levelOffset = subtree.getLevelOffset(level);
+ const numberOfChildren = implicitTileset.branchingFactor * parentRow.length;
+ for (let childMortonIndex = 0; childMortonIndex < numberOfChildren; childMortonIndex++) {
+ const childBitIndex = levelOffset + childMortonIndex;
+ if (!subtree.tileIsAvailableAtIndex(childBitIndex)) {
+ currentRow.push(void 0);
+ continue;
+ }
+ const parentMortonIndex = subtree.getParentMortonIndex(childMortonIndex);
+ const parentTile = parentRow[parentMortonIndex];
+ const childChildIndex = childMortonIndex % implicitTileset.branchingFactor;
+ const childTile = deriveChildTile(
+ content,
+ subtree,
+ parentTile,
+ childChildIndex,
+ childBitIndex
+ );
+ parentTile.children.push(childTile);
+ statistics2.numberOfTilesTotal++;
+ currentRow.push(childTile);
+ }
+ parentRow = currentRow;
+ currentRow = [];
+ }
+ return {
+ rootTile,
+ bottomRow: parentRow
+ };
+}
+function getGeometricError(tileMetadata, implicitTileset, implicitCoordinates) {
+ const semantic = MetadataSemantic_default.TILE_GEOMETRIC_ERROR;
+ if (defined_default(tileMetadata) && tileMetadata.hasPropertyBySemantic(semantic)) {
+ return tileMetadata.getPropertyBySemantic(semantic);
+ }
+ return implicitTileset.geometricError / Math.pow(2, implicitCoordinates.level);
+}
+function deriveChildTile(implicitContent, subtree, parentTile, childIndex, childBitIndex, parentIsPlaceholderTile) {
+ const implicitTileset = implicitContent._implicitTileset;
+ let implicitCoordinates;
+ if (defaultValue_default(parentIsPlaceholderTile, false)) {
+ implicitCoordinates = parentTile.implicitCoordinates;
+ } else {
+ implicitCoordinates = parentTile.implicitCoordinates.getChildCoordinates(
+ childIndex
+ );
+ }
+ let tileMetadata;
+ let tileBounds;
+ let contentBounds;
+ if (defined_default(subtree.tilePropertyTableJson)) {
+ tileMetadata = subtree.getTileMetadataView(implicitCoordinates);
+ const boundingVolumeSemantics = parseBoundingVolumeSemantics_default(tileMetadata);
+ tileBounds = boundingVolumeSemantics.tile;
+ contentBounds = boundingVolumeSemantics.content;
+ }
+ const contentPropertyTableJsons = subtree.contentPropertyTableJsons;
+ const length3 = contentPropertyTableJsons.length;
+ let hasImplicitContentMetadata = false;
+ for (let i = 0; i < length3; i++) {
+ if (subtree.contentIsAvailableAtCoordinates(implicitCoordinates, i)) {
+ hasImplicitContentMetadata = true;
+ break;
+ }
+ }
+ const boundingVolume = getTileBoundingVolume(
+ implicitTileset,
+ implicitCoordinates,
+ childIndex,
+ parentIsPlaceholderTile,
+ parentTile,
+ tileBounds
+ );
+ const contentJsons = [];
+ for (let i = 0; i < implicitTileset.contentCount; i++) {
+ if (!subtree.contentIsAvailableAtIndex(childBitIndex, i)) {
+ continue;
+ }
+ const childContentTemplate = implicitTileset.contentUriTemplates[i];
+ const childContentUri = childContentTemplate.getDerivedResource({
+ templateValues: implicitCoordinates.getTemplateValues()
+ }).url;
+ const contentJson = {
+ uri: childContentUri
+ };
+ const contentBoundingVolume = getContentBoundingVolume(
+ boundingVolume,
+ contentBounds
+ );
+ if (defined_default(contentBoundingVolume)) {
+ contentJson.boundingVolume = contentBoundingVolume;
+ }
+ contentJsons.push(combine_default(contentJson, implicitTileset.contentHeaders[i]));
+ }
+ const childGeometricError = getGeometricError(
+ tileMetadata,
+ implicitTileset,
+ implicitCoordinates
+ );
+ const tileJson = {
+ boundingVolume,
+ geometricError: childGeometricError,
+ refine: implicitTileset.refine,
+ contents: contentJsons
+ };
+ const deep = true;
+ const rootHeader = clone_default(implicitTileset.tileHeader, deep);
+ delete rootHeader.boundingVolume;
+ delete rootHeader.transform;
+ const combinedTileJson = combine_default(tileJson, rootHeader, deep);
+ const childTile = makeTile(
+ implicitContent,
+ implicitTileset.baseResource,
+ combinedTileJson,
+ parentTile
+ );
+ childTile.implicitCoordinates = implicitCoordinates;
+ childTile.implicitSubtree = subtree;
+ childTile.metadata = tileMetadata;
+ childTile.hasImplicitContentMetadata = hasImplicitContentMetadata;
+ return childTile;
+}
+function canUpdateHeights(boundingVolume, tileBounds) {
+ return defined_default(boundingVolume) && defined_default(tileBounds) && (defined_default(tileBounds.minimumHeight) || defined_default(tileBounds.maximumHeight)) && (hasExtension_default(boundingVolume, "3DTILES_bounding_volume_S2") || defined_default(boundingVolume.region));
+}
+function updateHeights(boundingVolume, tileBounds) {
+ if (!defined_default(tileBounds)) {
+ return;
+ }
+ if (hasExtension_default(boundingVolume, "3DTILES_bounding_volume_S2")) {
+ updateS2CellHeights(
+ boundingVolume.extensions["3DTILES_bounding_volume_S2"],
+ tileBounds.minimumHeight,
+ tileBounds.maximumHeight
+ );
+ } else if (defined_default(boundingVolume.region)) {
+ updateRegionHeights(
+ boundingVolume.region,
+ tileBounds.minimumHeight,
+ tileBounds.maximumHeight
+ );
+ }
+}
+function updateRegionHeights(region, minimumHeight, maximumHeight) {
+ if (defined_default(minimumHeight)) {
+ region[4] = minimumHeight;
+ }
+ if (defined_default(maximumHeight)) {
+ region[5] = maximumHeight;
+ }
+}
+function updateS2CellHeights(s2CellVolume, minimumHeight, maximumHeight) {
+ if (defined_default(minimumHeight)) {
+ s2CellVolume.minimumHeight = minimumHeight;
+ }
+ if (defined_default(maximumHeight)) {
+ s2CellVolume.maximumHeight = maximumHeight;
+ }
+}
+function getTileBoundingVolume(implicitTileset, implicitCoordinates, childIndex, parentIsPlaceholderTile, parentTile, tileBounds) {
+ let boundingVolume;
+ if (!defined_default(tileBounds) || !defined_default(tileBounds.boundingVolume) || !canUpdateHeights(tileBounds.boundingVolume, tileBounds) && canUpdateHeights(implicitTileset.boundingVolume, tileBounds)) {
+ boundingVolume = deriveBoundingVolume(
+ implicitTileset,
+ implicitCoordinates,
+ childIndex,
+ defaultValue_default(parentIsPlaceholderTile, false),
+ parentTile
+ );
+ } else {
+ boundingVolume = tileBounds.boundingVolume;
+ }
+ updateHeights(boundingVolume, tileBounds);
+ return boundingVolume;
+}
+function getContentBoundingVolume(tileBoundingVolume, contentBounds) {
+ let contentBoundingVolume;
+ if (defined_default(contentBounds)) {
+ contentBoundingVolume = contentBounds.boundingVolume;
+ }
+ if (canUpdateHeights(contentBoundingVolume, contentBounds)) {
+ updateHeights(contentBoundingVolume, contentBounds);
+ } else if (canUpdateHeights(tileBoundingVolume, contentBounds)) {
+ contentBoundingVolume = clone_default(tileBoundingVolume, true);
+ updateHeights(contentBoundingVolume, contentBounds);
+ }
+ return contentBoundingVolume;
+}
+function deriveBoundingVolume(implicitTileset, implicitCoordinates, childIndex, parentIsPlaceholderTile, parentTile) {
+ const rootBoundingVolume = implicitTileset.boundingVolume;
+ if (hasExtension_default(rootBoundingVolume, "3DTILES_bounding_volume_S2")) {
+ return deriveBoundingVolumeS2(
+ parentIsPlaceholderTile,
+ parentTile,
+ childIndex,
+ implicitCoordinates.level,
+ implicitCoordinates.x,
+ implicitCoordinates.y,
+ implicitCoordinates.z
+ );
+ }
+ if (defined_default(rootBoundingVolume.region)) {
+ const childRegion = deriveBoundingRegion(
+ rootBoundingVolume.region,
+ implicitCoordinates.level,
+ implicitCoordinates.x,
+ implicitCoordinates.y,
+ implicitCoordinates.z
+ );
+ return {
+ region: childRegion
+ };
+ }
+ const childBox = deriveBoundingBox(
+ rootBoundingVolume.box,
+ implicitCoordinates.level,
+ implicitCoordinates.x,
+ implicitCoordinates.y,
+ implicitCoordinates.z
+ );
+ return {
+ box: childBox
+ };
+}
+function deriveBoundingVolumeS2(parentIsPlaceholderTile, parentTile, childIndex, level, x, y, z) {
+ Check_default.typeOf.bool("parentIsPlaceholderTile", parentIsPlaceholderTile);
+ Check_default.typeOf.object("parentTile", parentTile);
+ Check_default.typeOf.number("childIndex", childIndex);
+ Check_default.typeOf.number("level", level);
+ Check_default.typeOf.number("x", x);
+ Check_default.typeOf.number("y", y);
+ if (defined_default(z)) {
+ Check_default.typeOf.number("z", z);
+ }
+ const boundingVolumeS2 = parentTile._boundingVolume;
+ if (parentIsPlaceholderTile) {
+ return {
+ extensions: {
+ "3DTILES_bounding_volume_S2": {
+ token: S2Cell_default.getTokenFromId(boundingVolumeS2.s2Cell._cellId),
+ minimumHeight: boundingVolumeS2.minimumHeight,
+ maximumHeight: boundingVolumeS2.maximumHeight
+ }
+ }
+ };
+ }
+ const face = Number(parentTile._boundingVolume.s2Cell._cellId >> BigInt(61));
+ const position = face % 2 === 0 ? HilbertOrder_default.encode2D(level, x, y) : HilbertOrder_default.encode2D(level, y, x);
+ const cell = S2Cell_default.fromFacePositionLevel(face, BigInt(position), level);
+ let minHeight, maxHeight;
+ if (defined_default(z)) {
+ const midpointHeight = (boundingVolumeS2.maximumHeight + boundingVolumeS2.minimumHeight) / 2;
+ minHeight = childIndex < 4 ? boundingVolumeS2.minimumHeight : midpointHeight;
+ maxHeight = childIndex < 4 ? midpointHeight : boundingVolumeS2.maximumHeight;
+ } else {
+ minHeight = boundingVolumeS2.minimumHeight;
+ maxHeight = boundingVolumeS2.maximumHeight;
+ }
+ return {
+ extensions: {
+ "3DTILES_bounding_volume_S2": {
+ token: S2Cell_default.getTokenFromId(cell._cellId),
+ minimumHeight: minHeight,
+ maximumHeight: maxHeight
+ }
+ }
+ };
+}
+var scratchScaleFactors = new Cartesian3_default();
+var scratchRootCenter = new Cartesian3_default();
+var scratchCenter2 = new Cartesian3_default();
+var scratchHalfAxes = new Matrix3_default();
+function deriveBoundingBox(rootBox, level, x, y, z) {
+ Check_default.typeOf.object("rootBox", rootBox);
+ Check_default.typeOf.number("level", level);
+ Check_default.typeOf.number("x", x);
+ Check_default.typeOf.number("y", y);
+ if (defined_default(z)) {
+ Check_default.typeOf.number("z", z);
+ }
+ if (level === 0) {
+ return rootBox;
+ }
+ const rootCenter = Cartesian3_default.unpack(rootBox, 0, scratchRootCenter);
+ const rootHalfAxes = Matrix3_default.unpack(rootBox, 3, scratchHalfAxes);
+ const tileScale = Math.pow(2, -level);
+ const modelSpaceX = -1 + (2 * x + 1) * tileScale;
+ const modelSpaceY = -1 + (2 * y + 1) * tileScale;
+ let modelSpaceZ = 0;
+ const scaleFactors = Cartesian3_default.fromElements(
+ tileScale,
+ tileScale,
+ 1,
+ scratchScaleFactors
+ );
+ if (defined_default(z)) {
+ modelSpaceZ = -1 + (2 * z + 1) * tileScale;
+ scaleFactors.z = tileScale;
+ }
+ let center = Cartesian3_default.fromElements(
+ modelSpaceX,
+ modelSpaceY,
+ modelSpaceZ,
+ scratchCenter2
+ );
+ center = Matrix3_default.multiplyByVector(rootHalfAxes, center, scratchCenter2);
+ center = Cartesian3_default.add(center, rootCenter, scratchCenter2);
+ let halfAxes = Matrix3_default.clone(rootHalfAxes);
+ halfAxes = Matrix3_default.multiplyByScale(halfAxes, scaleFactors, halfAxes);
+ const childBox = new Array(12);
+ Cartesian3_default.pack(center, childBox);
+ Matrix3_default.pack(halfAxes, childBox, 3);
+ return childBox;
+}
+var scratchRectangle = new Rectangle_default();
+function deriveBoundingRegion(rootRegion, level, x, y, z) {
+ Check_default.typeOf.object("rootRegion", rootRegion);
+ Check_default.typeOf.number("level", level);
+ Check_default.typeOf.number("x", x);
+ Check_default.typeOf.number("y", y);
+ if (defined_default(z)) {
+ Check_default.typeOf.number("z", z);
+ }
+ if (level === 0) {
+ return rootRegion.slice();
+ }
+ const rectangle = Rectangle_default.unpack(rootRegion, 0, scratchRectangle);
+ const rootMinimumHeight = rootRegion[4];
+ const rootMaximumHeight = rootRegion[5];
+ const tileScale = Math.pow(2, -level);
+ const childWidth = tileScale * rectangle.width;
+ const west = Math_default.negativePiToPi(rectangle.west + x * childWidth);
+ const east = Math_default.negativePiToPi(west + childWidth);
+ const childHeight = tileScale * rectangle.height;
+ const south = Math_default.negativePiToPi(rectangle.south + y * childHeight);
+ const north = Math_default.negativePiToPi(south + childHeight);
+ let minimumHeight = rootMinimumHeight;
+ let maximumHeight = rootMaximumHeight;
+ if (defined_default(z)) {
+ const childThickness = tileScale * (rootMaximumHeight - rootMinimumHeight);
+ minimumHeight += z * childThickness;
+ maximumHeight = minimumHeight + childThickness;
+ }
+ return [west, south, east, north, minimumHeight, maximumHeight];
+}
+function makePlaceholderChildSubtree(content, parentTile, childIndex) {
+ const implicitTileset = content._implicitTileset;
+ const implicitCoordinates = parentTile.implicitCoordinates.getChildCoordinates(
+ childIndex
+ );
+ const childBoundingVolume = deriveBoundingVolume(
+ implicitTileset,
+ implicitCoordinates,
+ childIndex,
+ false,
+ parentTile
+ );
+ const childGeometricError = getGeometricError(
+ void 0,
+ implicitTileset,
+ implicitCoordinates
+ );
+ const childContentUri = implicitTileset.subtreeUriTemplate.getDerivedResource(
+ {
+ templateValues: implicitCoordinates.getTemplateValues()
+ }
+ ).url;
+ const tileJson = {
+ boundingVolume: childBoundingVolume,
+ geometricError: childGeometricError,
+ refine: implicitTileset.refine,
+ contents: [
+ {
+ uri: childContentUri
+ }
+ ]
+ };
+ const tile = makeTile(
+ content,
+ implicitTileset.baseResource,
+ tileJson,
+ parentTile
+ );
+ tile.implicitTileset = implicitTileset;
+ tile.implicitCoordinates = implicitCoordinates;
+ return tile;
+}
+function makeTile(content, baseResource2, tileJson, parentTile) {
+ const Cesium3DTile2 = content._tile.constructor;
+ return new Cesium3DTile2(content._tileset, baseResource2, tileJson, parentTile);
+}
+Implicit3DTileContent.prototype.hasProperty = function(batchId, name) {
+ return false;
+};
+Implicit3DTileContent.prototype.getFeature = function(batchId) {
+ return void 0;
+};
+Implicit3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
+};
+Implicit3DTileContent.prototype.applyStyle = function(style) {
+};
+Implicit3DTileContent.prototype.update = function(tileset, frameState) {
+};
+Implicit3DTileContent.prototype.isDestroyed = function() {
+ return false;
+};
+Implicit3DTileContent.prototype.destroy = function() {
+ this._implicitSubtree = this._implicitSubtree && this._implicitSubtree.destroy();
+ return destroyObject_default(this);
+};
+Implicit3DTileContent._deriveBoundingBox = deriveBoundingBox;
+Implicit3DTileContent._deriveBoundingRegion = deriveBoundingRegion;
+Implicit3DTileContent._deriveBoundingVolumeS2 = deriveBoundingVolumeS2;
+var Implicit3DTileContent_default = Implicit3DTileContent;
+
+// Source/Scene/ModelAnimationLoop.js
+var ModelAnimationLoop = {
+ NONE: 0,
+ REPEAT: 1,
+ MIRRORED_REPEAT: 2
+};
+var ModelAnimationLoop_default = Object.freeze(ModelAnimationLoop);
+
+// Source/Scene/ClippingPlane.js
+function ClippingPlane(normal2, distance2) {
+ Check_default.typeOf.object("normal", normal2);
+ Check_default.typeOf.number("distance", distance2);
+ this._distance = distance2;
+ this._normal = new UpdateChangedCartesian3(normal2, this);
+ this.onChangeCallback = void 0;
+ this.index = -1;
+}
+Object.defineProperties(ClippingPlane.prototype, {
+ distance: {
+ get: function() {
+ return this._distance;
+ },
+ set: function(value) {
+ Check_default.typeOf.number("value", value);
+ if (defined_default(this.onChangeCallback) && value !== this._distance) {
+ this.onChangeCallback(this.index);
+ }
+ this._distance = value;
+ }
+ },
+ normal: {
+ get: function() {
+ return this._normal;
+ },
+ set: function(value) {
+ Check_default.typeOf.object("value", value);
+ if (defined_default(this.onChangeCallback) && !Cartesian3_default.equals(this._normal._cartesian3, value)) {
+ this.onChangeCallback(this.index);
+ }
+ Cartesian3_default.clone(value, this._normal._cartesian3);
+ }
+ }
+});
+ClippingPlane.fromPlane = function(plane, result) {
+ Check_default.typeOf.object("plane", plane);
+ if (!defined_default(result)) {
+ result = new ClippingPlane(plane.normal, plane.distance);
+ } else {
+ result.normal = plane.normal;
+ result.distance = plane.distance;
+ }
+ return result;
+};
+ClippingPlane.clone = function(clippingPlane, result) {
+ if (!defined_default(result)) {
+ return new ClippingPlane(clippingPlane.normal, clippingPlane.distance);
+ }
+ result.normal = clippingPlane.normal;
+ result.distance = clippingPlane.distance;
+ return result;
+};
+function UpdateChangedCartesian3(normal2, clippingPlane) {
+ this._clippingPlane = clippingPlane;
+ this._cartesian3 = Cartesian3_default.clone(normal2);
+}
+Object.defineProperties(UpdateChangedCartesian3.prototype, {
+ x: {
+ get: function() {
+ return this._cartesian3.x;
+ },
+ set: function(value) {
+ Check_default.typeOf.number("value", value);
+ if (defined_default(this._clippingPlane.onChangeCallback) && value !== this._cartesian3.x) {
+ this._clippingPlane.onChangeCallback(this._clippingPlane.index);
+ }
+ this._cartesian3.x = value;
+ }
+ },
+ y: {
+ get: function() {
+ return this._cartesian3.y;
+ },
+ set: function(value) {
+ Check_default.typeOf.number("value", value);
+ if (defined_default(this._clippingPlane.onChangeCallback) && value !== this._cartesian3.y) {
+ this._clippingPlane.onChangeCallback(this._clippingPlane.index);
+ }
+ this._cartesian3.y = value;
+ }
+ },
+ z: {
+ get: function() {
+ return this._cartesian3.z;
+ },
+ set: function(value) {
+ Check_default.typeOf.number("value", value);
+ if (defined_default(this._clippingPlane.onChangeCallback) && value !== this._cartesian3.z) {
+ this._clippingPlane.onChangeCallback(this._clippingPlane.index);
+ }
+ this._cartesian3.z = value;
+ }
+ }
+});
+var ClippingPlane_default = ClippingPlane;
+
+// Source/Scene/ClippingPlaneCollection.js
+function ClippingPlaneCollection(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._planes = [];
+ this._dirtyIndex = -1;
+ this._multipleDirtyPlanes = false;
+ this._enabled = defaultValue_default(options.enabled, true);
+ this.modelMatrix = Matrix4_default.clone(
+ defaultValue_default(options.modelMatrix, Matrix4_default.IDENTITY)
+ );
+ this.edgeColor = Color_default.clone(defaultValue_default(options.edgeColor, Color_default.WHITE));
+ this.edgeWidth = defaultValue_default(options.edgeWidth, 0);
+ this.planeAdded = new Event_default();
+ this.planeRemoved = new Event_default();
+ this._owner = void 0;
+ const unionClippingRegions = defaultValue_default(
+ options.unionClippingRegions,
+ false
+ );
+ this._unionClippingRegions = unionClippingRegions;
+ this._testIntersection = unionClippingRegions ? unionIntersectFunction : defaultIntersectFunction;
+ this._uint8View = void 0;
+ this._float32View = void 0;
+ this._clippingPlanesTexture = void 0;
+ const planes = options.planes;
+ if (defined_default(planes)) {
+ const planesLength = planes.length;
+ for (let i = 0; i < planesLength; ++i) {
+ this.add(planes[i]);
+ }
+ }
+}
+function unionIntersectFunction(value) {
+ return value === Intersect_default.OUTSIDE;
+}
+function defaultIntersectFunction(value) {
+ return value === Intersect_default.INSIDE;
+}
+Object.defineProperties(ClippingPlaneCollection.prototype, {
+ length: {
+ get: function() {
+ return this._planes.length;
+ }
+ },
+ unionClippingRegions: {
+ get: function() {
+ return this._unionClippingRegions;
+ },
+ set: function(value) {
+ if (this._unionClippingRegions === value) {
+ return;
+ }
+ this._unionClippingRegions = value;
+ this._testIntersection = value ? unionIntersectFunction : defaultIntersectFunction;
+ }
+ },
+ enabled: {
+ get: function() {
+ return this._enabled;
+ },
+ set: function(value) {
+ if (this._enabled === value) {
+ return;
+ }
+ this._enabled = value;
+ }
+ },
+ texture: {
+ get: function() {
+ return this._clippingPlanesTexture;
+ }
+ },
+ owner: {
+ get: function() {
+ return this._owner;
+ }
+ },
+ clippingPlanesState: {
+ get: function() {
+ return this._unionClippingRegions ? this._planes.length : -this._planes.length;
+ }
+ }
+});
+function setIndexDirty(collection, index) {
+ collection._multipleDirtyPlanes = collection._multipleDirtyPlanes || collection._dirtyIndex !== -1 && collection._dirtyIndex !== index;
+ collection._dirtyIndex = index;
+}
+ClippingPlaneCollection.prototype.add = function(plane) {
+ const newPlaneIndex = this._planes.length;
+ const that = this;
+ plane.onChangeCallback = function(index) {
+ setIndexDirty(that, index);
+ };
+ plane.index = newPlaneIndex;
+ setIndexDirty(this, newPlaneIndex);
+ this._planes.push(plane);
+ this.planeAdded.raiseEvent(plane, newPlaneIndex);
+};
+ClippingPlaneCollection.prototype.get = function(index) {
+ Check_default.typeOf.number("index", index);
+ return this._planes[index];
+};
+function indexOf(planes, plane) {
+ const length3 = planes.length;
+ for (let i = 0; i < length3; ++i) {
+ if (Plane_default.equals(planes[i], plane)) {
+ return i;
+ }
+ }
+ return -1;
+}
+ClippingPlaneCollection.prototype.contains = function(clippingPlane) {
+ return indexOf(this._planes, clippingPlane) !== -1;
+};
+ClippingPlaneCollection.prototype.remove = function(clippingPlane) {
+ const planes = this._planes;
+ const index = indexOf(planes, clippingPlane);
+ if (index === -1) {
+ return false;
+ }
+ if (clippingPlane instanceof ClippingPlane_default) {
+ clippingPlane.onChangeCallback = void 0;
+ clippingPlane.index = -1;
+ }
+ const length3 = planes.length - 1;
+ for (let i = index; i < length3; ++i) {
+ const planeToKeep = planes[i + 1];
+ planes[i] = planeToKeep;
+ if (planeToKeep instanceof ClippingPlane_default) {
+ planeToKeep.index = i;
+ }
+ }
+ this._multipleDirtyPlanes = true;
+ planes.length = length3;
+ this.planeRemoved.raiseEvent(clippingPlane, index);
+ return true;
+};
+ClippingPlaneCollection.prototype.removeAll = function() {
+ const planes = this._planes;
+ const planesCount = planes.length;
+ for (let i = 0; i < planesCount; ++i) {
+ const plane = planes[i];
+ if (plane instanceof ClippingPlane_default) {
+ plane.onChangeCallback = void 0;
+ plane.index = -1;
+ }
+ this.planeRemoved.raiseEvent(plane, i);
+ }
+ this._multipleDirtyPlanes = true;
+ this._planes = [];
+};
+var distanceEncodeScratch = new Cartesian4_default();
+var oct32EncodeScratch = new Cartesian4_default();
+function packPlanesAsUint8(clippingPlaneCollection, startIndex, endIndex) {
+ const uint8View = clippingPlaneCollection._uint8View;
+ const planes = clippingPlaneCollection._planes;
+ let byteIndex = 0;
+ for (let i = startIndex; i < endIndex; ++i) {
+ const plane = planes[i];
+ const oct32Normal = AttributeCompression_default.octEncodeToCartesian4(
+ plane.normal,
+ oct32EncodeScratch
+ );
+ uint8View[byteIndex] = oct32Normal.x;
+ uint8View[byteIndex + 1] = oct32Normal.y;
+ uint8View[byteIndex + 2] = oct32Normal.z;
+ uint8View[byteIndex + 3] = oct32Normal.w;
+ const encodedDistance = Cartesian4_default.packFloat(
+ plane.distance,
+ distanceEncodeScratch
+ );
+ uint8View[byteIndex + 4] = encodedDistance.x;
+ uint8View[byteIndex + 5] = encodedDistance.y;
+ uint8View[byteIndex + 6] = encodedDistance.z;
+ uint8View[byteIndex + 7] = encodedDistance.w;
+ byteIndex += 8;
+ }
+}
+function packPlanesAsFloats(clippingPlaneCollection, startIndex, endIndex) {
+ const float32View = clippingPlaneCollection._float32View;
+ const planes = clippingPlaneCollection._planes;
+ let floatIndex = 0;
+ for (let i = startIndex; i < endIndex; ++i) {
+ const plane = planes[i];
+ const normal2 = plane.normal;
+ float32View[floatIndex] = normal2.x;
+ float32View[floatIndex + 1] = normal2.y;
+ float32View[floatIndex + 2] = normal2.z;
+ float32View[floatIndex + 3] = plane.distance;
+ floatIndex += 4;
+ }
+}
+function computeTextureResolution(pixelsNeeded, result) {
+ const maxSize = ContextLimits_default.maximumTextureSize;
+ result.x = Math.min(pixelsNeeded, maxSize);
+ result.y = Math.ceil(pixelsNeeded / result.x);
+ return result;
+}
+var textureResolutionScratch = new Cartesian2_default();
+ClippingPlaneCollection.prototype.update = function(frameState) {
+ let clippingPlanesTexture = this._clippingPlanesTexture;
+ const context = frameState.context;
+ const useFloatTexture = ClippingPlaneCollection.useFloatTexture(context);
+ const pixelsNeeded = useFloatTexture ? this.length : this.length * 2;
+ if (defined_default(clippingPlanesTexture)) {
+ const currentPixelCount = clippingPlanesTexture.width * clippingPlanesTexture.height;
+ if (currentPixelCount < pixelsNeeded || pixelsNeeded < 0.25 * currentPixelCount) {
+ clippingPlanesTexture.destroy();
+ clippingPlanesTexture = void 0;
+ this._clippingPlanesTexture = void 0;
+ }
+ }
+ if (this.length === 0) {
+ return;
+ }
+ if (!defined_default(clippingPlanesTexture)) {
+ const requiredResolution = computeTextureResolution(
+ pixelsNeeded,
+ textureResolutionScratch
+ );
+ requiredResolution.y *= 2;
+ if (useFloatTexture) {
+ clippingPlanesTexture = new Texture_default({
+ context,
+ width: requiredResolution.x,
+ height: requiredResolution.y,
+ pixelFormat: PixelFormat_default.RGBA,
+ pixelDatatype: PixelDatatype_default.FLOAT,
+ sampler: Sampler_default.NEAREST,
+ flipY: false
+ });
+ this._float32View = new Float32Array(
+ requiredResolution.x * requiredResolution.y * 4
+ );
+ } else {
+ clippingPlanesTexture = new Texture_default({
+ context,
+ width: requiredResolution.x,
+ height: requiredResolution.y,
+ pixelFormat: PixelFormat_default.RGBA,
+ pixelDatatype: PixelDatatype_default.UNSIGNED_BYTE,
+ sampler: Sampler_default.NEAREST,
+ flipY: false
+ });
+ this._uint8View = new Uint8Array(
+ requiredResolution.x * requiredResolution.y * 4
+ );
+ }
+ this._clippingPlanesTexture = clippingPlanesTexture;
+ this._multipleDirtyPlanes = true;
+ }
+ const dirtyIndex = this._dirtyIndex;
+ if (!this._multipleDirtyPlanes && dirtyIndex === -1) {
+ return;
+ }
+ if (!this._multipleDirtyPlanes) {
+ let offsetX = 0;
+ let offsetY = 0;
+ if (useFloatTexture) {
+ offsetY = Math.floor(dirtyIndex / clippingPlanesTexture.width);
+ offsetX = Math.floor(dirtyIndex - offsetY * clippingPlanesTexture.width);
+ packPlanesAsFloats(this, dirtyIndex, dirtyIndex + 1);
+ clippingPlanesTexture.copyFrom({
+ source: {
+ width: 1,
+ height: 1,
+ arrayBufferView: this._float32View
+ },
+ xOffset: offsetX,
+ yOffset: offsetY
+ });
+ } else {
+ offsetY = Math.floor(dirtyIndex * 2 / clippingPlanesTexture.width);
+ offsetX = Math.floor(
+ dirtyIndex * 2 - offsetY * clippingPlanesTexture.width
+ );
+ packPlanesAsUint8(this, dirtyIndex, dirtyIndex + 1);
+ clippingPlanesTexture.copyFrom({
+ source: {
+ width: 2,
+ height: 1,
+ arrayBufferView: this._uint8View
+ },
+ xOffset: offsetX,
+ yOffset: offsetY
+ });
+ }
+ } else if (useFloatTexture) {
+ packPlanesAsFloats(this, 0, this._planes.length);
+ clippingPlanesTexture.copyFrom({
+ source: {
+ width: clippingPlanesTexture.width,
+ height: clippingPlanesTexture.height,
+ arrayBufferView: this._float32View
+ }
+ });
+ } else {
+ packPlanesAsUint8(this, 0, this._planes.length);
+ clippingPlanesTexture.copyFrom({
+ source: {
+ width: clippingPlanesTexture.width,
+ height: clippingPlanesTexture.height,
+ arrayBufferView: this._uint8View
+ }
+ });
+ }
+ this._multipleDirtyPlanes = false;
+ this._dirtyIndex = -1;
+};
+var scratchMatrix = new Matrix4_default();
+var scratchPlane3 = new Plane_default(Cartesian3_default.UNIT_X, 0);
+ClippingPlaneCollection.prototype.computeIntersectionWithBoundingVolume = function(tileBoundingVolume, transform3) {
+ const planes = this._planes;
+ const length3 = planes.length;
+ let modelMatrix = this.modelMatrix;
+ if (defined_default(transform3)) {
+ modelMatrix = Matrix4_default.multiply(transform3, modelMatrix, scratchMatrix);
+ }
+ let intersection = Intersect_default.INSIDE;
+ if (!this.unionClippingRegions && length3 > 0) {
+ intersection = Intersect_default.OUTSIDE;
+ }
+ for (let i = 0; i < length3; ++i) {
+ const plane = planes[i];
+ Plane_default.transform(plane, modelMatrix, scratchPlane3);
+ const value = tileBoundingVolume.intersectPlane(scratchPlane3);
+ if (value === Intersect_default.INTERSECTING) {
+ intersection = value;
+ } else if (this._testIntersection(value)) {
+ return value;
+ }
+ }
+ return intersection;
+};
+ClippingPlaneCollection.setOwner = function(clippingPlaneCollection, owner, key) {
+ if (clippingPlaneCollection === owner[key]) {
+ return;
+ }
+ owner[key] = owner[key] && owner[key].destroy();
+ if (defined_default(clippingPlaneCollection)) {
+ if (defined_default(clippingPlaneCollection._owner)) {
+ throw new DeveloperError_default(
+ "ClippingPlaneCollection should only be assigned to one object"
+ );
+ }
+ clippingPlaneCollection._owner = owner;
+ owner[key] = clippingPlaneCollection;
+ }
+};
+ClippingPlaneCollection.useFloatTexture = function(context) {
+ return context.floatingPointTexture;
+};
+ClippingPlaneCollection.getTextureResolution = function(clippingPlaneCollection, context, result) {
+ const texture = clippingPlaneCollection.texture;
+ if (defined_default(texture)) {
+ result.x = texture.width;
+ result.y = texture.height;
+ return result;
+ }
+ const pixelsNeeded = ClippingPlaneCollection.useFloatTexture(context) ? clippingPlaneCollection.length : clippingPlaneCollection.length * 2;
+ const requiredResolution = computeTextureResolution(pixelsNeeded, result);
+ requiredResolution.y *= 2;
+ return requiredResolution;
+};
+ClippingPlaneCollection.prototype.isDestroyed = function() {
+ return false;
+};
+ClippingPlaneCollection.prototype.destroy = function() {
+ this._clippingPlanesTexture = this._clippingPlanesTexture && this._clippingPlanesTexture.destroy();
+ return destroyObject_default(this);
+};
+var ClippingPlaneCollection_default = ClippingPlaneCollection;
+
+// Source/Scene/ColorBlendMode.js
+var ColorBlendMode = {
+ HIGHLIGHT: 0,
+ REPLACE: 1,
+ MIX: 2
+};
+ColorBlendMode.getColorBlend = function(colorBlendMode, colorBlendAmount) {
+ if (colorBlendMode === ColorBlendMode.HIGHLIGHT) {
+ return 0;
+ } else if (colorBlendMode === ColorBlendMode.REPLACE) {
+ return 1;
+ } else if (colorBlendMode === ColorBlendMode.MIX) {
+ return Math_default.clamp(colorBlendAmount, Math_default.EPSILON4, 1);
+ }
+};
+var ColorBlendMode_default = Object.freeze(ColorBlendMode);
+
+// Source/Core/ArticulationStageType.js
+var ArticulationStageType = {
+ XTRANSLATE: "xTranslate",
+ YTRANSLATE: "yTranslate",
+ ZTRANSLATE: "zTranslate",
+ XROTATE: "xRotate",
+ YROTATE: "yRotate",
+ ZROTATE: "zRotate",
+ XSCALE: "xScale",
+ YSCALE: "yScale",
+ ZSCALE: "zScale",
+ UNIFORMSCALE: "uniformScale"
+};
+var ArticulationStageType_default = Object.freeze(ArticulationStageType);
+
+// Source/Core/InterpolationType.js
+var InterpolationType = {
+ STEP: 0,
+ LINEAR: 1,
+ CUBICSPLINE: 2
+};
+var InterpolationType_default = Object.freeze(InterpolationType);
+
+// Source/Scene/JsonMetadataTable.js
+var emptyClass = {};
+function JsonMetadataTable(options) {
+ Check_default.typeOf.number.greaterThan("options.count", options.count, 0);
+ Check_default.typeOf.object("options.properties", options.properties);
+ this._count = options.count;
+ this._properties = clone_default(options.properties, true);
+}
+JsonMetadataTable.prototype.hasProperty = function(propertyId) {
+ return MetadataEntity_default.hasProperty(propertyId, this._properties, emptyClass);
+};
+JsonMetadataTable.prototype.getPropertyIds = function(results) {
+ return MetadataEntity_default.getPropertyIds(this._properties, emptyClass, results);
+};
+JsonMetadataTable.prototype.getProperty = function(index, propertyId) {
+ Check_default.typeOf.number("index", index);
+ Check_default.typeOf.string("propertyId", propertyId);
+ if (index < 0 || index >= this._count) {
+ throw new DeveloperError_default(`index must be in the range [0, ${this._count})`);
+ }
+ const property = this._properties[propertyId];
+ if (defined_default(property)) {
+ return clone_default(property[index], true);
+ }
+ return void 0;
+};
+JsonMetadataTable.prototype.setProperty = function(index, propertyId, value) {
+ Check_default.typeOf.number("index", index);
+ Check_default.typeOf.string("propertyId", propertyId);
+ if (index < 0 || index >= this._count) {
+ throw new DeveloperError_default(`index must be in the range [0, ${this._count})`);
+ }
+ let property = this._properties[propertyId];
+ if (!defined_default(property)) {
+ property = new Array(this._count);
+ this._properties[propertyId] = property;
+ }
+ property[index] = clone_default(value, true);
+};
+var JsonMetadataTable_default = JsonMetadataTable;
+
+// Source/Scene/PropertyTable.js
+function PropertyTable(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.typeOf.number("options.count", options.count);
+ this._name = options.name;
+ this._id = options.id;
+ this._count = options.count;
+ this._extras = options.extras;
+ this._extensions = options.extensions;
+ this._metadataTable = options.metadataTable;
+ this._jsonMetadataTable = options.jsonMetadataTable;
+ this._batchTableHierarchy = options.batchTableHierarchy;
+}
+Object.defineProperties(PropertyTable.prototype, {
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ count: {
+ get: function() {
+ return this._count;
+ }
+ },
+ class: {
+ get: function() {
+ if (defined_default(this._metadataTable)) {
+ return this._metadataTable.class;
+ }
+ return void 0;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ },
+ byteLength: {
+ get: function() {
+ let totalByteLength = 0;
+ if (defined_default(this._metadataTable)) {
+ totalByteLength += this._metadataTable.byteLength;
+ }
+ if (defined_default(this._batchTableHierarchy)) {
+ totalByteLength += this._batchTableHierarchy.byteLength;
+ }
+ return totalByteLength;
+ }
+ }
+});
+PropertyTable.prototype.hasProperty = function(index, propertyId) {
+ Check_default.typeOf.number("index", index);
+ Check_default.typeOf.string("propertyId", propertyId);
+ if (defined_default(this._metadataTable) && this._metadataTable.hasProperty(propertyId)) {
+ return true;
+ }
+ if (defined_default(this._batchTableHierarchy) && this._batchTableHierarchy.hasProperty(index, propertyId)) {
+ return true;
+ }
+ if (defined_default(this._jsonMetadataTable) && this._jsonMetadataTable.hasProperty(propertyId)) {
+ return true;
+ }
+ return false;
+};
+PropertyTable.prototype.hasPropertyBySemantic = function(index, semantic) {
+ Check_default.typeOf.number("index", index);
+ Check_default.typeOf.string("semantic", semantic);
+ if (defined_default(this._metadataTable)) {
+ return this._metadataTable.hasPropertyBySemantic(semantic);
+ }
+ return false;
+};
+PropertyTable.prototype.propertyExists = function(propertyId) {
+ Check_default.typeOf.string("propertyId", propertyId);
+ if (defined_default(this._metadataTable) && this._metadataTable.hasProperty(propertyId)) {
+ return true;
+ }
+ if (defined_default(this._batchTableHierarchy) && this._batchTableHierarchy.propertyExists(propertyId)) {
+ return true;
+ }
+ if (defined_default(this._jsonMetadataTable) && this._jsonMetadataTable.hasProperty(propertyId)) {
+ return true;
+ }
+ return false;
+};
+PropertyTable.prototype.propertyExistsBySemantic = function(semantic) {
+ Check_default.typeOf.string("semantic", semantic);
+ if (defined_default(this._metadataTable)) {
+ return this._metadataTable.hasPropertyBySemantic(semantic);
+ }
+ return false;
+};
+var scratchResults = [];
+PropertyTable.prototype.getPropertyIds = function(index, results) {
+ results = defined_default(results) ? results : [];
+ results.length = 0;
+ if (defined_default(this._metadataTable)) {
+ results.push.apply(
+ results,
+ this._metadataTable.getPropertyIds(scratchResults)
+ );
+ }
+ if (defined_default(this._batchTableHierarchy)) {
+ results.push.apply(
+ results,
+ this._batchTableHierarchy.getPropertyIds(index, scratchResults)
+ );
+ }
+ if (defined_default(this._jsonMetadataTable)) {
+ results.push.apply(
+ results,
+ this._jsonMetadataTable.getPropertyIds(scratchResults)
+ );
+ }
+ return results;
+};
+PropertyTable.prototype.getProperty = function(index, propertyId) {
+ let result;
+ if (defined_default(this._metadataTable)) {
+ result = this._metadataTable.getProperty(index, propertyId);
+ if (defined_default(result)) {
+ return result;
+ }
+ }
+ if (defined_default(this._batchTableHierarchy)) {
+ result = this._batchTableHierarchy.getProperty(index, propertyId);
+ if (defined_default(result)) {
+ return result;
+ }
+ }
+ if (defined_default(this._jsonMetadataTable)) {
+ result = this._jsonMetadataTable.getProperty(index, propertyId);
+ if (defined_default(result)) {
+ return result;
+ }
+ }
+ return void 0;
+};
+PropertyTable.prototype.setProperty = function(index, propertyId, value) {
+ if (defined_default(this._metadataTable) && this._metadataTable.setProperty(index, propertyId, value)) {
+ return;
+ }
+ if (defined_default(this._batchTableHierarchy) && this._batchTableHierarchy.setProperty(index, propertyId, value)) {
+ return;
+ }
+ if (!defined_default(this._jsonMetadataTable)) {
+ this._jsonMetadataTable = new JsonMetadataTable_default({
+ count: this._count,
+ properties: {}
+ });
+ }
+ this._jsonMetadataTable.setProperty(index, propertyId, value);
+};
+PropertyTable.prototype.getPropertyBySemantic = function(index, semantic) {
+ if (defined_default(this._metadataTable)) {
+ return this._metadataTable.getPropertyBySemantic(index, semantic);
+ }
+ return void 0;
+};
+PropertyTable.prototype.setPropertyBySemantic = function(index, semantic, value) {
+ if (defined_default(this._metadataTable)) {
+ return this._metadataTable.setPropertyBySemantic(index, semantic, value);
+ }
+ return false;
+};
+PropertyTable.prototype.getPropertyTypedArray = function(propertyId) {
+ Check_default.typeOf.string("propertyId", propertyId);
+ if (defined_default(this._metadataTable)) {
+ return this._metadataTable.getPropertyTypedArray(propertyId);
+ }
+ return void 0;
+};
+PropertyTable.prototype.getPropertyTypedArrayBySemantic = function(semantic) {
+ Check_default.typeOf.string("semantic", semantic);
+ if (defined_default(this._metadataTable)) {
+ return this._metadataTable.getPropertyTypedArrayBySemantic(semantic);
+ }
+ return void 0;
+};
+function checkFeatureId(featureId, featuresLength) {
+ if (!defined_default(featureId) || featureId < 0 || featureId >= featuresLength) {
+ throw new DeveloperError_default(
+ `featureId is required and must be between zero and featuresLength - 1 (${featuresLength}` - +")."
+ );
+ }
+}
+PropertyTable.prototype.isClass = function(featureId, className) {
+ checkFeatureId(featureId, this.count);
+ Check_default.typeOf.string("className", className);
+ const hierarchy = this._batchTableHierarchy;
+ if (!defined_default(hierarchy)) {
+ return false;
+ }
+ return hierarchy.isClass(featureId, className);
+};
+PropertyTable.prototype.isExactClass = function(featureId, className) {
+ checkFeatureId(featureId, this.count);
+ Check_default.typeOf.string("className", className);
+ return this.getExactClassName(featureId) === className;
+};
+PropertyTable.prototype.getExactClassName = function(featureId) {
+ checkFeatureId(featureId, this.count);
+ const hierarchy = this._batchTableHierarchy;
+ if (!defined_default(hierarchy)) {
+ return void 0;
+ }
+ return hierarchy.getClassName(featureId);
+};
+var PropertyTable_default = PropertyTable;
+
+// Source/Scene/PropertyTextureProperty.js
+function PropertyTextureProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const property = options.property;
+ const classProperty = options.classProperty;
+ const textures = options.textures;
+ Check_default.typeOf.object("options.property", property);
+ Check_default.typeOf.object("options.classProperty", classProperty);
+ Check_default.typeOf.object("options.textures", textures);
+ const channels = defined_default(property.channels) ? property.channels : [0];
+ const textureInfo = property;
+ const textureReader = GltfLoaderUtil_default.createModelTextureReader({
+ textureInfo,
+ channels: reformatChannels(channels),
+ texture: textures[textureInfo.index]
+ });
+ this._min = property.min;
+ this._max = property.max;
+ let offset2 = property.offset;
+ let scale = property.scale;
+ const hasValueTransform = classProperty.hasValueTransform || defined_default(offset2) || defined_default(scale);
+ offset2 = defaultValue_default(offset2, classProperty.offset);
+ scale = defaultValue_default(scale, classProperty.scale);
+ offset2 = classProperty.unpackVectorAndMatrixTypes(offset2);
+ scale = classProperty.unpackVectorAndMatrixTypes(scale);
+ this._offset = offset2;
+ this._scale = scale;
+ this._hasValueTransform = hasValueTransform;
+ this._textureReader = textureReader;
+ this._classProperty = classProperty;
+ this._extras = property.extras;
+ this._extensions = property.extensions;
+}
+Object.defineProperties(PropertyTextureProperty.prototype, {
+ textureReader: {
+ get: function() {
+ return this._textureReader;
+ }
+ },
+ hasValueTransform: {
+ get: function() {
+ return this._hasValueTransform;
+ }
+ },
+ offset: {
+ get: function() {
+ return this._offset;
+ }
+ },
+ scale: {
+ get: function() {
+ return this._scale;
+ }
+ },
+ classProperty: {
+ get: function() {
+ return this._classProperty;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+PropertyTextureProperty.prototype.isGpuCompatible = function() {
+ const classProperty = this._classProperty;
+ const type = classProperty.type;
+ const componentType = classProperty.componentType;
+ if (classProperty.isArray) {
+ return !classProperty.isVariableLengthArray && classProperty.arrayLength <= 4 && type === MetadataType_default.SCALAR && componentType === MetadataComponentType_default.UINT8;
+ }
+ if (MetadataType_default.isVectorType(type) || type === MetadataType_default.SCALAR) {
+ return componentType === MetadataComponentType_default.UINT8;
+ }
+ return false;
+};
+var floatTypesByComponentCount = [void 0, "float", "vec2", "vec3", "vec4"];
+var integerTypesByComponentCount = [
+ void 0,
+ "int",
+ "ivec2",
+ "ivec3",
+ "ivec4"
+];
+PropertyTextureProperty.prototype.getGlslType = function() {
+ const classProperty = this._classProperty;
+ let componentCount = MetadataType_default.getComponentCount(classProperty.type);
+ if (classProperty.isArray) {
+ componentCount = classProperty.arrayLength;
+ }
+ if (classProperty.normalized) {
+ return floatTypesByComponentCount[componentCount];
+ }
+ return integerTypesByComponentCount[componentCount];
+};
+PropertyTextureProperty.prototype.unpackInShader = function(packedValueGlsl) {
+ const classProperty = this._classProperty;
+ if (classProperty.normalized) {
+ return packedValueGlsl;
+ }
+ const glslType = this.getGlslType();
+ return `${glslType}(255.0 * ${packedValueGlsl})`;
+};
+function reformatChannels(channels) {
+ return channels.map(function(channelIndex) {
+ return "rgba".charAt(channelIndex);
+ }).join("");
+}
+var PropertyTextureProperty_default = PropertyTextureProperty;
+
+// Source/Scene/PropertyTexture.js
+function PropertyTexture(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const propertyTexture = options.propertyTexture;
+ const classDefinition = options.class;
+ const textures = options.textures;
+ Check_default.typeOf.object("options.propertyTexture", propertyTexture);
+ Check_default.typeOf.object("options.class", classDefinition);
+ Check_default.typeOf.object("options.textures", textures);
+ const extensions = propertyTexture.extensions;
+ const extras = propertyTexture.extras;
+ const properties = {};
+ if (defined_default(propertyTexture.properties)) {
+ for (const propertyId in propertyTexture.properties) {
+ if (propertyTexture.properties.hasOwnProperty(propertyId)) {
+ properties[propertyId] = new PropertyTextureProperty_default({
+ property: propertyTexture.properties[propertyId],
+ classProperty: classDefinition.properties[propertyId],
+ textures
+ });
+ }
+ }
+ }
+ this._name = options.name;
+ this._id = options.id;
+ this._class = classDefinition;
+ this._properties = properties;
+ this._extras = extras;
+ this._extensions = extensions;
+}
+Object.defineProperties(PropertyTexture.prototype, {
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ class: {
+ get: function() {
+ return this._class;
+ }
+ },
+ properties: {
+ get: function() {
+ return this._properties;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+PropertyTexture.prototype.getProperty = function(propertyId) {
+ Check_default.typeOf.string("propertyId", propertyId);
+ return this._properties[propertyId];
+};
+var PropertyTexture_default = PropertyTexture;
+
+// Source/Scene/PropertyAttributeProperty.js
+function PropertyAttributeProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const property = options.property;
+ const classProperty = options.classProperty;
+ Check_default.typeOf.object("options.property", property);
+ Check_default.typeOf.object("options.classProperty", classProperty);
+ this._attribute = property.attribute;
+ this._classProperty = classProperty;
+ this._min = property.min;
+ this._max = property.max;
+ let offset2 = property.offset;
+ let scale = property.scale;
+ const hasValueTransform = classProperty.hasValueTransform || defined_default(offset2) || defined_default(scale);
+ offset2 = defaultValue_default(offset2, classProperty.offset);
+ scale = defaultValue_default(scale, classProperty.scale);
+ offset2 = classProperty.unpackVectorAndMatrixTypes(offset2);
+ scale = classProperty.unpackVectorAndMatrixTypes(scale);
+ this._offset = offset2;
+ this._scale = scale;
+ this._hasValueTransform = hasValueTransform;
+ this._extras = property.extras;
+ this._extensions = property.extensions;
+}
+Object.defineProperties(PropertyAttributeProperty.prototype, {
+ attribute: {
+ get: function() {
+ return this._attribute;
+ }
+ },
+ hasValueTransform: {
+ get: function() {
+ return this._hasValueTransform;
+ }
+ },
+ offset: {
+ get: function() {
+ return this._offset;
+ }
+ },
+ scale: {
+ get: function() {
+ return this._scale;
+ }
+ },
+ classProperty: {
+ get: function() {
+ return this._classProperty;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+var PropertyAttributeProperty_default = PropertyAttributeProperty;
+
+// Source/Scene/PropertyAttribute.js
+function PropertyAttribute(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const propertyAttribute = options.propertyAttribute;
+ const classDefinition = options.class;
+ Check_default.typeOf.object("options.propertyAttribute", propertyAttribute);
+ Check_default.typeOf.object("options.class", classDefinition);
+ const properties = {};
+ if (defined_default(propertyAttribute.properties)) {
+ for (const propertyId in propertyAttribute.properties) {
+ if (propertyAttribute.properties.hasOwnProperty(propertyId)) {
+ properties[propertyId] = new PropertyAttributeProperty_default({
+ property: propertyAttribute.properties[propertyId],
+ classProperty: classDefinition.properties[propertyId]
+ });
+ }
+ }
+ }
+ this._name = options.name;
+ this._id = options.id;
+ this._class = classDefinition;
+ this._properties = properties;
+ this._extras = propertyAttribute.extras;
+ this._extensions = propertyAttribute.extensions;
+}
+Object.defineProperties(PropertyAttribute.prototype, {
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ class: {
+ get: function() {
+ return this._class;
+ }
+ },
+ properties: {
+ get: function() {
+ return this._properties;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+PropertyAttribute.prototype.getProperty = function(propertyId) {
+ Check_default.typeOf.string("propertyId", propertyId);
+ return this._properties[propertyId];
+};
+var PropertyAttribute_default = PropertyAttribute;
+
+// Source/Scene/StructuralMetadata.js
+function StructuralMetadata(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.typeOf.object("options.schema", options.schema);
+ this._schema = options.schema;
+ const propertyTables = options.propertyTables;
+ this._propertyTableCount = defined_default(propertyTables) ? propertyTables.length : 0;
+ this._propertyTables = propertyTables;
+ this._propertyTextures = options.propertyTextures;
+ this._propertyAttributes = options.propertyAttributes;
+ this._statistics = options.statistics;
+ this._extras = options.extras;
+ this._extensions = options.extensions;
+}
+Object.defineProperties(StructuralMetadata.prototype, {
+ schema: {
+ get: function() {
+ return this._schema;
+ }
+ },
+ statistics: {
+ get: function() {
+ return this._statistics;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ },
+ propertyTableCount: {
+ get: function() {
+ return this._propertyTableCount;
+ }
+ },
+ propertyTables: {
+ get: function() {
+ return this._propertyTables;
+ }
+ },
+ propertyTextures: {
+ get: function() {
+ return this._propertyTextures;
+ }
+ },
+ propertyAttributes: {
+ get: function() {
+ return this._propertyAttributes;
+ }
+ },
+ propertyTablesByteLength: {
+ get: function() {
+ if (!defined_default(this._propertyTables)) {
+ return 0;
+ }
+ let totalByteLength = 0;
+ const length3 = this._propertyTables.length;
+ for (let i = 0; i < length3; i++) {
+ totalByteLength += this._propertyTables[i].byteLength;
+ }
+ return totalByteLength;
+ }
+ }
+});
+StructuralMetadata.prototype.getPropertyTable = function(propertyTableId) {
+ Check_default.typeOf.number("propertyTableId", propertyTableId);
+ return this._propertyTables[propertyTableId];
+};
+StructuralMetadata.prototype.getPropertyTexture = function(propertyTextureId) {
+ Check_default.typeOf.number("propertyTextureId", propertyTextureId);
+ return this._propertyTextures[propertyTextureId];
+};
+StructuralMetadata.prototype.getPropertyAttribute = function(propertyAttributeId) {
+ Check_default.typeOf.number("propertyAttributeId", propertyAttributeId);
+ return this._propertyAttributes[propertyAttributeId];
+};
+var StructuralMetadata_default = StructuralMetadata;
+
+// Source/Scene/parseStructuralMetadata.js
+function parseStructuralMetadata(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const extension = options.extension;
+ const schema = options.schema;
+ Check_default.typeOf.object("options.extension", extension);
+ Check_default.typeOf.object("options.schema", schema);
+ const propertyTables = [];
+ if (defined_default(extension.propertyTables)) {
+ for (let i = 0; i < extension.propertyTables.length; i++) {
+ const propertyTable = extension.propertyTables[i];
+ const classDefinition = schema.classes[propertyTable.class];
+ const metadataTable = new MetadataTable_default({
+ count: propertyTable.count,
+ properties: propertyTable.properties,
+ class: classDefinition,
+ bufferViews: options.bufferViews
+ });
+ propertyTables.push(
+ new PropertyTable_default({
+ id: i,
+ name: propertyTable.name,
+ count: propertyTable.count,
+ metadataTable,
+ extras: propertyTable.extras,
+ extensions: propertyTable.extensions
+ })
+ );
+ }
+ }
+ const propertyTextures = [];
+ if (defined_default(extension.propertyTextures)) {
+ for (let i = 0; i < extension.propertyTextures.length; i++) {
+ const propertyTexture = extension.propertyTextures[i];
+ propertyTextures.push(
+ new PropertyTexture_default({
+ id: i,
+ name: propertyTexture.name,
+ propertyTexture,
+ class: schema.classes[propertyTexture.class],
+ textures: options.textures
+ })
+ );
+ }
+ }
+ const propertyAttributes = [];
+ if (defined_default(extension.propertyAttributes)) {
+ for (let i = 0; i < extension.propertyAttributes.length; i++) {
+ const propertyAttribute = extension.propertyAttributes[i];
+ propertyAttributes.push(
+ new PropertyAttribute_default({
+ id: i,
+ name: propertyAttribute.name,
+ class: schema.classes[propertyAttribute.class],
+ propertyAttribute
+ })
+ );
+ }
+ }
+ return new StructuralMetadata_default({
+ schema,
+ propertyTables,
+ propertyTextures,
+ propertyAttributes,
+ statistics: extension.statistics,
+ extras: extension.extras,
+ extensions: extension.extensions
+ });
+}
+var parseStructuralMetadata_default = parseStructuralMetadata;
+
+// Source/Scene/parseFeatureMetadataLegacy.js
+function parseFeatureMetadataLegacy(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const extension = options.extension;
+ const schema = options.schema;
+ Check_default.typeOf.object("options.extension", extension);
+ Check_default.typeOf.object("options.schema", schema);
+ let i;
+ const propertyTables = [];
+ let sortedIds;
+ if (defined_default(extension.featureTables)) {
+ sortedIds = Object.keys(extension.featureTables).sort();
+ for (i = 0; i < sortedIds.length; i++) {
+ const featureTableId = sortedIds[i];
+ const featureTable = extension.featureTables[featureTableId];
+ const classDefinition = schema.classes[featureTable.class];
+ const metadataTable = new MetadataTable_default({
+ count: featureTable.count,
+ properties: featureTable.properties,
+ class: classDefinition,
+ bufferViews: options.bufferViews
+ });
+ propertyTables.push(
+ new PropertyTable_default({
+ id: featureTableId,
+ count: featureTable.count,
+ metadataTable,
+ extras: featureTable.extras,
+ extensions: featureTable.extensions
+ })
+ );
+ }
+ }
+ const propertyTextures = [];
+ if (defined_default(extension.featureTextures)) {
+ sortedIds = Object.keys(extension.featureTextures).sort();
+ for (i = 0; i < sortedIds.length; i++) {
+ const featureTextureId = sortedIds[i];
+ const featureTexture = extension.featureTextures[featureTextureId];
+ propertyTextures.push(
+ new PropertyTexture_default({
+ id: featureTextureId,
+ propertyTexture: transcodeToPropertyTexture(featureTexture),
+ class: schema.classes[featureTexture.class],
+ textures: options.textures
+ })
+ );
+ }
+ }
+ return new StructuralMetadata_default({
+ schema,
+ propertyTables,
+ propertyTextures,
+ statistics: extension.statistics,
+ extras: extension.extras,
+ extensions: extension.extensions
+ });
+}
+function transcodeToPropertyTexture(featureTexture) {
+ const propertyTexture = {
+ class: featureTexture.class,
+ properties: {}
+ };
+ const properties = featureTexture.properties;
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const oldProperty = properties[propertyId];
+ const property = {
+ channels: reformatChannels2(oldProperty.channels),
+ extras: oldProperty.extras,
+ extensions: oldProperty.extensions
+ };
+ propertyTexture.properties[propertyId] = combine_default(
+ oldProperty.texture,
+ property,
+ true
+ );
+ }
+ }
+ return propertyTexture;
+}
+function reformatChannels2(channelsString) {
+ const length3 = channelsString.length;
+ const result = new Array(length3);
+ for (let i = 0; i < length3; i++) {
+ result[i] = "rgba".indexOf(channelsString[i]);
+ }
+ return result;
+}
+var parseFeatureMetadataLegacy_default = parseFeatureMetadataLegacy;
+
+// Source/Scene/GltfStructuralMetadataLoader.js
+function GltfStructuralMetadataLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltf = options.gltf;
+ const extension = options.extension;
+ const extensionLegacy = options.extensionLegacy;
+ const gltfResource = options.gltfResource;
+ const baseResource2 = options.baseResource;
+ const supportedImageFormats = options.supportedImageFormats;
+ const frameState = options.frameState;
+ const cacheKey = options.cacheKey;
+ const asynchronous = defaultValue_default(options.asynchronous, true);
+ Check_default.typeOf.object("options.gltf", gltf);
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ Check_default.typeOf.object("options.baseResource", baseResource2);
+ Check_default.typeOf.object("options.supportedImageFormats", supportedImageFormats);
+ Check_default.typeOf.object("options.frameState", frameState);
+ if (!defined_default(options.extension) && !defined_default(options.extensionLegacy)) {
+ throw new DeveloperError_default(
+ "One of options.extension or options.extensionLegacy must be specified"
+ );
+ }
+ this._gltfResource = gltfResource;
+ this._baseResource = baseResource2;
+ this._gltf = gltf;
+ this._extension = extension;
+ this._extensionLegacy = extensionLegacy;
+ this._supportedImageFormats = supportedImageFormats;
+ this._frameState = frameState;
+ this._cacheKey = cacheKey;
+ this._asynchronous = asynchronous;
+ this._bufferViewLoaders = [];
+ this._textureLoaders = [];
+ this._schemaLoader = void 0;
+ this._structuralMetadata = void 0;
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._promise = void 0;
+}
+if (defined_default(Object.create)) {
+ GltfStructuralMetadataLoader.prototype = Object.create(
+ ResourceLoader_default.prototype
+ );
+ GltfStructuralMetadataLoader.prototype.constructor = GltfStructuralMetadataLoader;
+}
+Object.defineProperties(GltfStructuralMetadataLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return this._cacheKey;
+ }
+ },
+ structuralMetadata: {
+ get: function() {
+ return this._structuralMetadata;
+ }
+ }
+});
+GltfStructuralMetadataLoader.prototype.load = function() {
+ const bufferViewsPromise = loadBufferViews(this);
+ const texturesPromise = loadTextures(this);
+ const schemaPromise = loadSchema(this);
+ this._gltf = void 0;
+ this._state = ResourceLoaderState_default.LOADING;
+ const that = this;
+ this._promise = Promise.all([
+ bufferViewsPromise,
+ texturesPromise,
+ schemaPromise
+ ]).then(function(results) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ const bufferViews = results[0];
+ const textures = results[1];
+ const schema = results[2];
+ if (defined_default(that._extension)) {
+ that._structuralMetadata = parseStructuralMetadata_default({
+ extension: that._extension,
+ schema,
+ bufferViews,
+ textures
+ });
+ } else {
+ that._structuralMetadata = parseFeatureMetadataLegacy_default({
+ extension: that._extensionLegacy,
+ schema,
+ bufferViews,
+ textures
+ });
+ }
+ that._state = ResourceLoaderState_default.READY;
+ return that;
+ }).catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that.unload();
+ that._state = ResourceLoaderState_default.FAILED;
+ const errorMessage = "Failed to load structural metadata";
+ return Promise.reject(that.getError(errorMessage, error));
+ });
+};
+function gatherBufferViewIdsFromProperties(properties, bufferViewIdSet) {
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ const values = property.values;
+ const arrayOffsets = property.arrayOffsets;
+ const stringOffsets = property.stringOffsets;
+ if (defined_default(values)) {
+ bufferViewIdSet[values] = true;
+ }
+ if (defined_default(arrayOffsets)) {
+ bufferViewIdSet[arrayOffsets] = true;
+ }
+ if (defined_default(stringOffsets)) {
+ bufferViewIdSet[stringOffsets] = true;
+ }
+ }
+ }
+}
+function gatherBufferViewIdsFromPropertiesLegacy(properties, bufferViewIdSet) {
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ const bufferView = property.bufferView;
+ const arrayOffsetBufferView = property.arrayOffsetBufferView;
+ const stringOffsetBufferView = property.stringOffsetBufferView;
+ if (defined_default(bufferView)) {
+ bufferViewIdSet[bufferView] = true;
+ }
+ if (defined_default(arrayOffsetBufferView)) {
+ bufferViewIdSet[arrayOffsetBufferView] = true;
+ }
+ if (defined_default(stringOffsetBufferView)) {
+ bufferViewIdSet[stringOffsetBufferView] = true;
+ }
+ }
+ }
+}
+function gatherUsedBufferViewIds(extension) {
+ const propertyTables = extension.propertyTables;
+ const bufferViewIdSet = {};
+ if (defined_default(propertyTables)) {
+ for (let i = 0; i < propertyTables.length; i++) {
+ const propertyTable = propertyTables[i];
+ gatherBufferViewIdsFromProperties(
+ propertyTable.properties,
+ bufferViewIdSet
+ );
+ }
+ }
+ return bufferViewIdSet;
+}
+function gatherUsedBufferViewIdsLegacy(extensionLegacy) {
+ const featureTables = extensionLegacy.featureTables;
+ const bufferViewIdSet = {};
+ if (defined_default(featureTables)) {
+ for (const featureTableId in featureTables) {
+ if (featureTables.hasOwnProperty(featureTableId)) {
+ const featureTable = featureTables[featureTableId];
+ const properties = featureTable.properties;
+ if (defined_default(properties)) {
+ gatherBufferViewIdsFromPropertiesLegacy(properties, bufferViewIdSet);
+ }
+ }
+ }
+ }
+ return bufferViewIdSet;
+}
+function loadBufferViews(structuralMetadataLoader) {
+ let bufferViewIds;
+ if (defined_default(structuralMetadataLoader._extension)) {
+ bufferViewIds = gatherUsedBufferViewIds(
+ structuralMetadataLoader._extension
+ );
+ } else {
+ bufferViewIds = gatherUsedBufferViewIdsLegacy(
+ structuralMetadataLoader._extensionLegacy
+ );
+ }
+ const bufferViewPromises = [];
+ const bufferViewLoaders = {};
+ for (const bufferViewId in bufferViewIds) {
+ if (bufferViewIds.hasOwnProperty(bufferViewId)) {
+ const bufferViewLoader = ResourceCache_default.loadBufferView({
+ gltf: structuralMetadataLoader._gltf,
+ bufferViewId: parseInt(bufferViewId),
+ gltfResource: structuralMetadataLoader._gltfResource,
+ baseResource: structuralMetadataLoader._baseResource
+ });
+ bufferViewPromises.push(bufferViewLoader.promise);
+ structuralMetadataLoader._bufferViewLoaders.push(bufferViewLoader);
+ bufferViewLoaders[bufferViewId] = bufferViewLoader;
+ }
+ }
+ return Promise.all(bufferViewPromises).then(function() {
+ const bufferViews = {};
+ for (const bufferViewId in bufferViewLoaders) {
+ if (bufferViewLoaders.hasOwnProperty(bufferViewId)) {
+ const bufferViewLoader = bufferViewLoaders[bufferViewId];
+ const bufferViewTypedArray = new Uint8Array(
+ bufferViewLoader.typedArray
+ );
+ bufferViews[bufferViewId] = bufferViewTypedArray;
+ }
+ }
+ unloadBufferViews(structuralMetadataLoader);
+ return bufferViews;
+ });
+}
+function gatherUsedTextureIds(structuralMetadataExtension) {
+ const textureIds = {};
+ const propertyTextures = structuralMetadataExtension.propertyTextures;
+ if (defined_default(propertyTextures)) {
+ for (let i = 0; i < propertyTextures.length; i++) {
+ const propertyTexture = propertyTextures[i];
+ const properties = propertyTexture.properties;
+ if (defined_default(properties)) {
+ gatherTextureIdsFromProperties(properties, textureIds);
+ }
+ }
+ }
+ return textureIds;
+}
+function gatherTextureIdsFromProperties(properties, textureIds) {
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const textureInfo = properties[propertyId];
+ textureIds[textureInfo.index] = textureInfo;
+ }
+ }
+}
+function gatherUsedTextureIdsLegacy(extensionLegacy) {
+ const textureIds = {};
+ const featureTextures = extensionLegacy.featureTextures;
+ if (defined_default(featureTextures)) {
+ for (const featureTextureId in featureTextures) {
+ if (featureTextures.hasOwnProperty(featureTextureId)) {
+ const featureTexture = featureTextures[featureTextureId];
+ const properties = featureTexture.properties;
+ if (defined_default(properties)) {
+ gatherTextureIdsFromPropertiesLegacy(properties, textureIds);
+ }
+ }
+ }
+ }
+ return textureIds;
+}
+function gatherTextureIdsFromPropertiesLegacy(properties, textureIds) {
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ const textureInfo = property.texture;
+ textureIds[textureInfo.index] = textureInfo;
+ }
+ }
+}
+function loadTextures(structuralMetadataLoader) {
+ let textureIds;
+ if (defined_default(structuralMetadataLoader._extension)) {
+ textureIds = gatherUsedTextureIds(structuralMetadataLoader._extension);
+ } else {
+ textureIds = gatherUsedTextureIdsLegacy(
+ structuralMetadataLoader._extensionLegacy
+ );
+ }
+ const gltf = structuralMetadataLoader._gltf;
+ const gltfResource = structuralMetadataLoader._gltfResource;
+ const baseResource2 = structuralMetadataLoader._baseResource;
+ const supportedImageFormats = structuralMetadataLoader._supportedImageFormats;
+ const frameState = structuralMetadataLoader._frameState;
+ const asynchronous = structuralMetadataLoader._asynchronous;
+ const texturePromises = [];
+ const textureLoaders = {};
+ for (const textureId in textureIds) {
+ if (textureIds.hasOwnProperty(textureId)) {
+ const textureLoader = ResourceCache_default.loadTexture({
+ gltf,
+ textureInfo: textureIds[textureId],
+ gltfResource,
+ baseResource: baseResource2,
+ supportedImageFormats,
+ frameState,
+ asynchronous
+ });
+ texturePromises.push(textureLoader.promise);
+ structuralMetadataLoader._textureLoaders.push(textureLoader);
+ textureLoaders[textureId] = textureLoader;
+ }
+ }
+ return Promise.all(texturePromises).then(function() {
+ const textures = {};
+ for (const textureId in textureLoaders) {
+ if (textureLoaders.hasOwnProperty(textureId)) {
+ const textureLoader = textureLoaders[textureId];
+ textures[textureId] = textureLoader.texture;
+ }
+ }
+ return textures;
+ });
+}
+function loadSchema(structuralMetadataLoader) {
+ const extension = defaultValue_default(
+ structuralMetadataLoader._extension,
+ structuralMetadataLoader._extensionLegacy
+ );
+ let schemaLoader;
+ if (defined_default(extension.schemaUri)) {
+ const resource = structuralMetadataLoader._baseResource.getDerivedResource({
+ url: extension.schemaUri
+ });
+ schemaLoader = ResourceCache_default.loadSchema({
+ resource
+ });
+ } else {
+ schemaLoader = ResourceCache_default.loadSchema({
+ schema: extension.schema
+ });
+ }
+ structuralMetadataLoader._schemaLoader = schemaLoader;
+ return schemaLoader.promise.then(function(schemaLoader2) {
+ return schemaLoader2.schema;
+ });
+}
+GltfStructuralMetadataLoader.prototype.process = function(frameState) {
+ Check_default.typeOf.object("frameState", frameState);
+ if (this._state !== ResourceLoaderState_default.LOADING) {
+ return;
+ }
+ const textureLoaders = this._textureLoaders;
+ const textureLoadersLength = textureLoaders.length;
+ for (let i = 0; i < textureLoadersLength; ++i) {
+ const textureLoader = textureLoaders[i];
+ textureLoader.process(frameState);
+ }
+};
+function unloadBufferViews(structuralMetadataLoader) {
+ const bufferViewLoaders = structuralMetadataLoader._bufferViewLoaders;
+ const bufferViewLoadersLength = bufferViewLoaders.length;
+ for (let i = 0; i < bufferViewLoadersLength; ++i) {
+ ResourceCache_default.unload(bufferViewLoaders[i]);
+ }
+ structuralMetadataLoader._bufferViewLoaders.length = 0;
+}
+function unloadTextures(structuralMetadataLoader) {
+ const textureLoaders = structuralMetadataLoader._textureLoaders;
+ const textureLoadersLength = textureLoaders.length;
+ for (let i = 0; i < textureLoadersLength; ++i) {
+ ResourceCache_default.unload(textureLoaders[i]);
+ }
+ structuralMetadataLoader._textureLoaders.length = 0;
+}
+GltfStructuralMetadataLoader.prototype.unload = function() {
+ unloadBufferViews(this);
+ unloadTextures(this);
+ if (defined_default(this._schemaLoader)) {
+ ResourceCache_default.unload(this._schemaLoader);
+ }
+ this._schemaLoader = void 0;
+ this._structuralMetadata = void 0;
+};
+var GltfStructuralMetadataLoader_default = GltfStructuralMetadataLoader;
+
+// Source/Scene/VertexAttributeSemantic.js
+var VertexAttributeSemantic = {
+ POSITION: "POSITION",
+ NORMAL: "NORMAL",
+ TANGENT: "TANGENT",
+ TEXCOORD: "TEXCOORD",
+ COLOR: "COLOR",
+ JOINTS: "JOINTS",
+ WEIGHTS: "WEIGHTS",
+ FEATURE_ID: "_FEATURE_ID"
+};
+function semanticToVariableName(semantic) {
+ switch (semantic) {
+ case VertexAttributeSemantic.POSITION:
+ return "positionMC";
+ case VertexAttributeSemantic.NORMAL:
+ return "normalMC";
+ case VertexAttributeSemantic.TANGENT:
+ return "tangentMC";
+ case VertexAttributeSemantic.TEXCOORD:
+ return "texCoord";
+ case VertexAttributeSemantic.COLOR:
+ return "color";
+ case VertexAttributeSemantic.JOINTS:
+ return "joints";
+ case VertexAttributeSemantic.WEIGHTS:
+ return "weights";
+ case VertexAttributeSemantic.FEATURE_ID:
+ return "featureId";
+ default:
+ throw new DeveloperError_default("semantic is not a valid value.");
+ }
+}
+VertexAttributeSemantic.hasSetIndex = function(semantic) {
+ Check_default.typeOf.string("semantic", semantic);
+ switch (semantic) {
+ case VertexAttributeSemantic.POSITION:
+ case VertexAttributeSemantic.NORMAL:
+ case VertexAttributeSemantic.TANGENT:
+ return false;
+ case VertexAttributeSemantic.TEXCOORD:
+ case VertexAttributeSemantic.COLOR:
+ case VertexAttributeSemantic.JOINTS:
+ case VertexAttributeSemantic.WEIGHTS:
+ case VertexAttributeSemantic.FEATURE_ID:
+ return true;
+ default:
+ throw new DeveloperError_default("semantic is not a valid value.");
+ }
+};
+VertexAttributeSemantic.fromGltfSemantic = function(gltfSemantic) {
+ Check_default.typeOf.string("gltfSemantic", gltfSemantic);
+ let semantic = gltfSemantic;
+ const setIndexRegex = /^(\w+)_\d+$/;
+ const setIndexMatch = setIndexRegex.exec(gltfSemantic);
+ if (setIndexMatch !== null) {
+ semantic = setIndexMatch[1];
+ }
+ switch (semantic) {
+ case "POSITION":
+ return VertexAttributeSemantic.POSITION;
+ case "NORMAL":
+ return VertexAttributeSemantic.NORMAL;
+ case "TANGENT":
+ return VertexAttributeSemantic.TANGENT;
+ case "TEXCOORD":
+ return VertexAttributeSemantic.TEXCOORD;
+ case "COLOR":
+ return VertexAttributeSemantic.COLOR;
+ case "JOINTS":
+ return VertexAttributeSemantic.JOINTS;
+ case "WEIGHTS":
+ return VertexAttributeSemantic.WEIGHTS;
+ case "_FEATURE_ID":
+ return VertexAttributeSemantic.FEATURE_ID;
+ }
+ return void 0;
+};
+VertexAttributeSemantic.fromPntsSemantic = function(pntsSemantic) {
+ Check_default.typeOf.string("pntsSemantic", pntsSemantic);
+ switch (pntsSemantic) {
+ case "POSITION":
+ case "POSITION_QUANTIZED":
+ return VertexAttributeSemantic.POSITION;
+ case "RGBA":
+ case "RGB":
+ case "RGB565":
+ return VertexAttributeSemantic.COLOR;
+ case "NORMAL":
+ case "NORMAL_OCT16P":
+ return VertexAttributeSemantic.NORMAL;
+ case "BATCH_ID":
+ return VertexAttributeSemantic.FEATURE_ID;
+ default:
+ throw new DeveloperError_default("pntsSemantic is not a valid value.");
+ }
+};
+VertexAttributeSemantic.getGlslType = function(semantic) {
+ Check_default.typeOf.string("semantic", semantic);
+ switch (semantic) {
+ case VertexAttributeSemantic.POSITION:
+ case VertexAttributeSemantic.NORMAL:
+ case VertexAttributeSemantic.TANGENT:
+ return "vec3";
+ case VertexAttributeSemantic.TEXCOORD:
+ return "vec2";
+ case VertexAttributeSemantic.COLOR:
+ return "vec4";
+ case VertexAttributeSemantic.JOINTS:
+ return "ivec4";
+ case VertexAttributeSemantic.WEIGHTS:
+ return "vec4";
+ case VertexAttributeSemantic.FEATURE_ID:
+ return "int";
+ default:
+ throw new DeveloperError_default("semantic is not a valid value.");
+ }
+};
+VertexAttributeSemantic.getVariableName = function(semantic, setIndex) {
+ Check_default.typeOf.string("semantic", semantic);
+ let variableName = semanticToVariableName(semantic);
+ if (defined_default(setIndex)) {
+ variableName += `_${setIndex}`;
+ }
+ return variableName;
+};
+var VertexAttributeSemantic_default = Object.freeze(VertexAttributeSemantic);
+
+// Source/Scene/Model/ModelUtility.js
+function ModelUtility() {
+}
+ModelUtility.getFailedLoadFunction = function(model, type, path) {
+ return function(error) {
+ let message = `Failed to load ${type}: ${path}`;
+ if (defined_default(error)) {
+ message += `
+${error.message}`;
+ }
+ const runtimeError = new RuntimeError_default(message);
+ if (defined_default(error)) {
+ runtimeError.stack = `Original stack:
+${error.stack}
+Handler stack:
+${runtimeError.stack}`;
+ }
+ return Promise.reject(runtimeError);
+ };
+};
+ModelUtility.getNodeTransform = function(node) {
+ if (defined_default(node.matrix)) {
+ return node.matrix;
+ }
+ return Matrix4_default.fromTranslationQuaternionRotationScale(
+ defined_default(node.translation) ? node.translation : Cartesian3_default.ZERO,
+ defined_default(node.rotation) ? node.rotation : Quaternion_default.IDENTITY,
+ defined_default(node.scale) ? node.scale : Cartesian3_default.ONE
+ );
+};
+ModelUtility.getAttributeBySemantic = function(object2, semantic, setIndex) {
+ const attributes = object2.attributes;
+ const attributesLength = attributes.length;
+ for (let i = 0; i < attributesLength; ++i) {
+ const attribute = attributes[i];
+ const matchesSetIndex = defined_default(setIndex) ? attribute.setIndex === setIndex : true;
+ if (attribute.semantic === semantic && matchesSetIndex) {
+ return attribute;
+ }
+ }
+ return void 0;
+};
+ModelUtility.getAttributeByName = function(object2, name) {
+ const attributes = object2.attributes;
+ const attributesLength = attributes.length;
+ for (let i = 0; i < attributesLength; ++i) {
+ const attribute = attributes[i];
+ if (attribute.name === name) {
+ return attribute;
+ }
+ }
+ return void 0;
+};
+ModelUtility.getFeatureIdsByLabel = function(featureIds, label) {
+ for (let i = 0; i < featureIds.length; i++) {
+ const featureIdSet = featureIds[i];
+ if (featureIdSet.positionalLabel === label || featureIdSet.label === label) {
+ return featureIdSet;
+ }
+ }
+ return void 0;
+};
+ModelUtility.hasQuantizedAttributes = function(attributes) {
+ if (!defined_default(attributes)) {
+ return false;
+ }
+ for (let i = 0; i < attributes.length; i++) {
+ const attribute = attributes[i];
+ if (defined_default(attribute.quantization)) {
+ return true;
+ }
+ }
+ return false;
+};
+ModelUtility.getAttributeInfo = function(attribute) {
+ const semantic = attribute.semantic;
+ const setIndex = attribute.setIndex;
+ let variableName;
+ let hasSemantic = false;
+ if (defined_default(semantic)) {
+ variableName = VertexAttributeSemantic_default.getVariableName(semantic, setIndex);
+ hasSemantic = true;
+ } else {
+ variableName = attribute.name;
+ variableName = variableName.replace(/^_/, "");
+ variableName = variableName.toLowerCase();
+ }
+ const isVertexColor = /^color_\d+$/.test(variableName);
+ const attributeType = attribute.type;
+ let glslType = AttributeType_default.getGlslType(attributeType);
+ if (isVertexColor) {
+ glslType = "vec4";
+ }
+ const isQuantized = defined_default(attribute.quantization);
+ let quantizedGlslType;
+ if (isQuantized) {
+ quantizedGlslType = isVertexColor ? "vec4" : AttributeType_default.getGlslType(attribute.quantization.type);
+ }
+ return {
+ attribute,
+ isQuantized,
+ variableName,
+ hasSemantic,
+ glslType,
+ quantizedGlslType
+ };
+};
+var cartesianMaxScratch = new Cartesian3_default();
+var cartesianMinScratch = new Cartesian3_default();
+ModelUtility.getPositionMinMax = function(primitive, instancingTranslationMin, instancingTranslationMax) {
+ const positionGltfAttribute = ModelUtility.getAttributeBySemantic(
+ primitive,
+ "POSITION"
+ );
+ let positionMax = positionGltfAttribute.max;
+ let positionMin = positionGltfAttribute.min;
+ if (defined_default(instancingTranslationMax) && defined_default(instancingTranslationMin)) {
+ positionMin = Cartesian3_default.add(
+ positionMin,
+ instancingTranslationMin,
+ cartesianMinScratch
+ );
+ positionMax = Cartesian3_default.add(
+ positionMax,
+ instancingTranslationMax,
+ cartesianMaxScratch
+ );
+ }
+ return {
+ min: positionMin,
+ max: positionMax
+ };
+};
+ModelUtility.getAxisCorrectionMatrix = function(upAxis, forwardAxis, result) {
+ result = Matrix4_default.clone(Matrix4_default.IDENTITY, result);
+ if (upAxis === Axis_default.Y) {
+ result = Matrix4_default.clone(Axis_default.Y_UP_TO_Z_UP, result);
+ } else if (upAxis === Axis_default.X) {
+ result = Matrix4_default.clone(Axis_default.X_UP_TO_Z_UP, result);
+ }
+ if (forwardAxis === Axis_default.Z) {
+ result = Matrix4_default.multiplyTransformation(result, Axis_default.Z_UP_TO_X_UP, result);
+ }
+ return result;
+};
+var scratchMatrix32 = new Matrix3_default();
+ModelUtility.getCullFace = function(modelMatrix, primitiveType) {
+ if (!PrimitiveType_default.isTriangles(primitiveType)) {
+ return CullFace_default.BACK;
+ }
+ const matrix3 = Matrix4_default.getMatrix3(modelMatrix, scratchMatrix32);
+ return Matrix3_default.determinant(matrix3) < 0 ? CullFace_default.FRONT : CullFace_default.BACK;
+};
+ModelUtility.sanitizeGlslIdentifier = function(identifier) {
+ let sanitizedIdentifier = identifier.replaceAll(/[^A-Za-z0-9]+/g, "_");
+ sanitizedIdentifier = sanitizedIdentifier.replace(/^gl_/, "");
+ if (/^\d/.test(sanitizedIdentifier)) {
+ sanitizedIdentifier = `_${sanitizedIdentifier}`;
+ }
+ return sanitizedIdentifier;
+};
+ModelUtility.supportedExtensions = {
+ AGI_articulations: true,
+ CESIUM_primitive_outline: true,
+ CESIUM_RTC: true,
+ EXT_feature_metadata: true,
+ EXT_instance_features: true,
+ EXT_mesh_features: true,
+ EXT_mesh_gpu_instancing: true,
+ EXT_meshopt_compression: true,
+ EXT_structural_metadata: true,
+ EXT_texture_webp: true,
+ KHR_blend: true,
+ KHR_draco_mesh_compression: true,
+ KHR_techniques_webgl: true,
+ KHR_materials_common: true,
+ KHR_materials_pbrSpecularGlossiness: true,
+ KHR_materials_unlit: true,
+ KHR_mesh_quantization: true,
+ KHR_texture_basisu: true,
+ KHR_texture_transform: true,
+ WEB3D_quantized_attributes: true
+};
+ModelUtility.checkSupportedExtensions = function(extensionsRequired) {
+ const length3 = extensionsRequired.length;
+ for (let i = 0; i < length3; i++) {
+ const extension = extensionsRequired[i];
+ if (!ModelUtility.supportedExtensions[extension]) {
+ throw new RuntimeError_default(`Unsupported glTF Extension: ${extension}`);
+ }
+ }
+};
+var ModelUtility_default = ModelUtility;
+
+// Source/Scene/InstanceAttributeSemantic.js
+var InstanceAttributeSemantic = {
+ TRANSLATION: "TRANSLATION",
+ ROTATION: "ROTATION",
+ SCALE: "SCALE",
+ FEATURE_ID: "_FEATURE_ID"
+};
+InstanceAttributeSemantic.fromGltfSemantic = function(gltfSemantic) {
+ Check_default.typeOf.string("gltfSemantic", gltfSemantic);
+ let semantic = gltfSemantic;
+ const setIndexRegex = /^(\w+)_\d+$/;
+ const setIndexMatch = setIndexRegex.exec(gltfSemantic);
+ if (setIndexMatch !== null) {
+ semantic = setIndexMatch[1];
+ }
+ switch (semantic) {
+ case "TRANSLATION":
+ return InstanceAttributeSemantic.TRANSLATION;
+ case "ROTATION":
+ return InstanceAttributeSemantic.ROTATION;
+ case "SCALE":
+ return InstanceAttributeSemantic.SCALE;
+ case "_FEATURE_ID":
+ return InstanceAttributeSemantic.FEATURE_ID;
+ }
+ return void 0;
+};
+var InstanceAttributeSemantic_default = Object.freeze(InstanceAttributeSemantic);
+
+// Source/Scene/Model/PrimitiveOutlineGenerator.js
+var MAX_GLTF_UINT16_INDEX = 65534;
+var MAX_GLTF_UINT8_INDEX = 255;
+function PrimitiveOutlineGenerator(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const triangleIndices = options.triangleIndices;
+ const outlineIndices = options.outlineIndices;
+ const originalVertexCount = options.originalVertexCount;
+ Check_default.typeOf.object("options.triangleIndices", triangleIndices);
+ Check_default.typeOf.object("options.outlineIndices", outlineIndices);
+ Check_default.typeOf.number("options.originalVertexCount", originalVertexCount);
+ this._triangleIndices = triangleIndices;
+ this._originalVertexCount = originalVertexCount;
+ this._edges = new EdgeSet(outlineIndices, originalVertexCount);
+ this._outlineCoordinatesTypedArray = void 0;
+ this._extraVertices = [];
+ initialize9(this);
+}
+Object.defineProperties(PrimitiveOutlineGenerator.prototype, {
+ updatedTriangleIndices: {
+ get: function() {
+ return this._triangleIndices;
+ }
+ },
+ outlineCoordinates: {
+ get: function() {
+ return this._outlineCoordinatesTypedArray;
+ }
+ }
+});
+function initialize9(outlineGenerator) {
+ let triangleIndices = outlineGenerator._triangleIndices;
+ const edges = outlineGenerator._edges;
+ const outlineCoordinates = [];
+ const extraVertices = outlineGenerator._extraVertices;
+ const vertexCount = outlineGenerator._originalVertexCount;
+ const vertexCopies = {};
+ for (let i = 0; i < triangleIndices.length; i += 3) {
+ let i0 = triangleIndices[i];
+ let i1 = triangleIndices[i + 1];
+ let i2 = triangleIndices[i + 2];
+ const all = false;
+ const hasEdge01 = all || edges.hasEdge(i0, i1);
+ const hasEdge12 = all || edges.hasEdge(i1, i2);
+ const hasEdge20 = all || edges.hasEdge(i2, i0);
+ let unmatchableVertexIndex = matchAndStoreCoordinates(
+ outlineCoordinates,
+ i0,
+ i1,
+ i2,
+ hasEdge01,
+ hasEdge12,
+ hasEdge20
+ );
+ while (defined_default(unmatchableVertexIndex)) {
+ let copy = vertexCopies[unmatchableVertexIndex];
+ if (!defined_default(copy)) {
+ copy = vertexCount + extraVertices.length;
+ let original2 = unmatchableVertexIndex;
+ while (original2 >= vertexCount) {
+ original2 = extraVertices[original2 - vertexCount];
+ }
+ extraVertices.push(original2);
+ vertexCopies[unmatchableVertexIndex] = copy;
+ }
+ if (copy > MAX_GLTF_UINT16_INDEX && (triangleIndices instanceof Uint16Array || triangleIndices instanceof Uint8Array)) {
+ triangleIndices = new Uint32Array(triangleIndices);
+ } else if (copy > MAX_GLTF_UINT8_INDEX && triangleIndices instanceof Uint8Array) {
+ triangleIndices = new Uint16Array(triangleIndices);
+ }
+ if (unmatchableVertexIndex === i0) {
+ i0 = copy;
+ triangleIndices[i] = copy;
+ } else if (unmatchableVertexIndex === i1) {
+ i1 = copy;
+ triangleIndices[i + 1] = copy;
+ } else {
+ i2 = copy;
+ triangleIndices[i + 2] = copy;
+ }
+ unmatchableVertexIndex = matchAndStoreCoordinates(
+ outlineCoordinates,
+ i0,
+ i1,
+ i2,
+ hasEdge01,
+ hasEdge12,
+ hasEdge20
+ );
+ }
+ }
+ outlineGenerator._triangleIndices = triangleIndices;
+ outlineGenerator._outlineCoordinatesTypedArray = new Float32Array(
+ outlineCoordinates
+ );
+}
+function matchAndStoreCoordinates(outlineCoordinates, i0, i1, i2, hasEdge01, hasEdge12, hasEdge20) {
+ const a0 = hasEdge20 ? 1 : 0;
+ const b0 = hasEdge01 ? 1 : 0;
+ const c0 = 0;
+ const i0Mask = computeOrderMask(outlineCoordinates, i0, a0, b0, c0);
+ if (i0Mask === 0) {
+ return i0;
+ }
+ const a1 = 0;
+ const b1 = hasEdge01 ? 1 : 0;
+ const c14 = hasEdge12 ? 1 : 0;
+ const i1Mask = computeOrderMask(outlineCoordinates, i1, a1, b1, c14);
+ if (i1Mask === 0) {
+ return i1;
+ }
+ const a22 = hasEdge20 ? 1 : 0;
+ const b2 = 0;
+ const c22 = hasEdge12 ? 1 : 0;
+ const i2Mask = computeOrderMask(outlineCoordinates, i2, a22, b2, c22);
+ if (i2Mask === 0) {
+ return i2;
+ }
+ const workingOrders = i0Mask & i1Mask & i2Mask;
+ let a3, b, c;
+ if (workingOrders & 1 << 0) {
+ a3 = 0;
+ b = 1;
+ c = 2;
+ } else if (workingOrders & 1 << 1) {
+ a3 = 0;
+ c = 1;
+ b = 2;
+ } else if (workingOrders & 1 << 2) {
+ b = 0;
+ a3 = 1;
+ c = 2;
+ } else if (workingOrders & 1 << 3) {
+ b = 0;
+ c = 1;
+ a3 = 2;
+ } else if (workingOrders & 1 << 4) {
+ c = 0;
+ a3 = 1;
+ b = 2;
+ } else if (workingOrders & 1 << 5) {
+ c = 0;
+ b = 1;
+ a3 = 2;
+ } else {
+ const i0ValidOrderCount = popcount6Bit(i0Mask);
+ const i1ValidOrderCount = popcount6Bit(i1Mask);
+ const i2ValidOrderCount = popcount6Bit(i2Mask);
+ if (i0ValidOrderCount < i1ValidOrderCount && i0ValidOrderCount < i2ValidOrderCount) {
+ return i0;
+ } else if (i1ValidOrderCount < i2ValidOrderCount) {
+ return i1;
+ }
+ return i2;
+ }
+ const i0Start = i0 * 3;
+ outlineCoordinates[i0Start + a3] = a0;
+ outlineCoordinates[i0Start + b] = b0;
+ outlineCoordinates[i0Start + c] = c0;
+ const i1Start = i1 * 3;
+ outlineCoordinates[i1Start + a3] = a1;
+ outlineCoordinates[i1Start + b] = b1;
+ outlineCoordinates[i1Start + c] = c14;
+ const i2Start = i2 * 3;
+ outlineCoordinates[i2Start + a3] = a22;
+ outlineCoordinates[i2Start + b] = b2;
+ outlineCoordinates[i2Start + c] = c22;
+ return void 0;
+}
+function computeOrderMask(outlineCoordinates, vertexIndex, a3, b, c) {
+ const startIndex = vertexIndex * 3;
+ const first = outlineCoordinates[startIndex];
+ const second = outlineCoordinates[startIndex + 1];
+ const third = outlineCoordinates[startIndex + 2];
+ if (!defined_default(first)) {
+ return 63;
+ }
+ return (first === a3 && second === b && third === c) << 0 | (first === a3 && second === c && third === b) << 1 | (first === b && second === a3 && third === c) << 2 | (first === b && second === c && third === a3) << 3 | (first === c && second === a3 && third === b) << 4 | (first === c && second === b && third === a3) << 5;
+}
+function popcount6Bit(value) {
+ return (value & 1) + (value >> 1 & 1) + (value >> 2 & 1) + (value >> 3 & 1) + (value >> 4 & 1) + (value >> 5 & 1);
+}
+PrimitiveOutlineGenerator.prototype.updateAttribute = function(attributeTypedArray) {
+ const extraVertices = this._extraVertices;
+ const originalLength = attributeTypedArray.length;
+ const stride = originalLength / this._originalVertexCount;
+ const extraVerticesLength = extraVertices.length;
+ const ArrayType = attributeTypedArray.constructor;
+ const result = new ArrayType(
+ attributeTypedArray.length + extraVerticesLength * stride
+ );
+ result.set(attributeTypedArray);
+ for (let i = 0; i < extraVerticesLength; i++) {
+ const sourceIndex = extraVertices[i] * stride;
+ const resultIndex = originalLength + i * stride;
+ for (let j = 0; j < stride; j++) {
+ result[resultIndex + j] = result[sourceIndex + j];
+ }
+ }
+ return result;
+};
+PrimitiveOutlineGenerator.createTexture = function(context) {
+ let cache = context.cache.modelOutliningCache;
+ if (!defined_default(cache)) {
+ cache = context.cache.modelOutliningCache = {};
+ }
+ if (defined_default(cache.outlineTexture)) {
+ return cache.outlineTexture;
+ }
+ const maxSize = Math.min(4096, ContextLimits_default.maximumTextureSize);
+ let size = maxSize;
+ const levelZero = createMipLevel(size);
+ const mipLevels = [];
+ while (size > 1) {
+ size >>= 1;
+ mipLevels.push(createMipLevel(size));
+ }
+ const texture = new Texture_default({
+ context,
+ source: {
+ arrayBufferView: levelZero,
+ mipLevels
+ },
+ width: maxSize,
+ height: 1,
+ pixelFormat: PixelFormat_default.LUMINANCE,
+ sampler: new Sampler_default({
+ wrapS: TextureWrap_default.CLAMP_TO_EDGE,
+ wrapT: TextureWrap_default.CLAMP_TO_EDGE,
+ minificationFilter: TextureMinificationFilter_default.LINEAR_MIPMAP_LINEAR,
+ magnificationFilter: TextureMagnificationFilter_default.LINEAR
+ })
+ });
+ cache.outlineTexture = texture;
+ return texture;
+};
+function createMipLevel(size) {
+ const texture = new Uint8Array(size);
+ texture[size - 1] = 192;
+ if (size === 8) {
+ texture[size - 1] = 96;
+ } else if (size === 4) {
+ texture[size - 1] = 48;
+ } else if (size === 2) {
+ texture[size - 1] = 24;
+ } else if (size === 1) {
+ texture[size - 1] = 12;
+ }
+ return texture;
+}
+function EdgeSet(edgeIndices, originalVertexCount) {
+ this._originalVertexCount = originalVertexCount;
+ this._edges = /* @__PURE__ */ new Set();
+ for (let i = 0; i < edgeIndices.length; i += 2) {
+ const a3 = edgeIndices[i];
+ const b = edgeIndices[i + 1];
+ const small = Math.min(a3, b);
+ const big = Math.max(a3, b);
+ const hash2 = small * this._originalVertexCount + big;
+ this._edges.add(hash2);
+ }
+}
+EdgeSet.prototype.hasEdge = function(a3, b) {
+ const small = Math.min(a3, b);
+ const big = Math.max(a3, b);
+ const hash2 = small * this._originalVertexCount + big;
+ return this._edges.has(hash2);
+};
+var PrimitiveOutlineGenerator_default = PrimitiveOutlineGenerator;
+
+// Source/Scene/PrimitiveLoadPlan.js
+function AttributeLoadPlan(attribute) {
+ Check_default.typeOf.object("attribute", attribute);
+ this.attribute = attribute;
+ this.loadBuffer = false;
+ this.loadTypedArray = false;
+}
+function IndicesLoadPlan(indices2) {
+ Check_default.typeOf.object("indices", indices2);
+ this.indices = indices2;
+ this.loadBuffer = false;
+ this.loadTypedArray = false;
+}
+function PrimitiveLoadPlan(primitive) {
+ Check_default.typeOf.object("primitive", primitive);
+ this.primitive = primitive;
+ this.attributePlans = [];
+ this.indicesPlan = void 0;
+ this.needsOutlines = false;
+ this.outlineIndices = void 0;
+}
+PrimitiveLoadPlan.prototype.postProcess = function(context) {
+ if (this.needsOutlines) {
+ generateOutlines(this);
+ generateBuffers(this, context);
+ }
+};
+function generateOutlines(loadPlan) {
+ const primitive = loadPlan.primitive;
+ const indices2 = primitive.indices;
+ const vertexCount = primitive.attributes[0].count;
+ const generator = new PrimitiveOutlineGenerator_default({
+ triangleIndices: indices2.typedArray,
+ outlineIndices: loadPlan.outlineIndices,
+ originalVertexCount: vertexCount
+ });
+ indices2.typedArray = generator.updatedTriangleIndices;
+ indices2.indexDatatype = IndexDatatype_default.fromTypedArray(indices2.typedArray);
+ const outlineCoordinates = makeOutlineCoordinatesAttribute(
+ generator.outlineCoordinates
+ );
+ const outlineCoordinatesPlan = new AttributeLoadPlan(outlineCoordinates);
+ outlineCoordinatesPlan.loadBuffer = true;
+ outlineCoordinatesPlan.loadTypedArray = false;
+ loadPlan.attributePlans.push(outlineCoordinatesPlan);
+ primitive.outlineCoordinates = outlineCoordinatesPlan.attribute;
+ const attributePlans = loadPlan.attributePlans;
+ const attributesLength = loadPlan.attributePlans.length;
+ for (let i = 0; i < attributesLength; i++) {
+ const attribute = attributePlans[i].attribute;
+ attribute.typedArray = generator.updateAttribute(attribute.typedArray);
+ }
+}
+function makeOutlineCoordinatesAttribute(outlineCoordinatesTypedArray) {
+ const attribute = new ModelComponents_default.Attribute();
+ attribute.name = "_OUTLINE_COORDINATES";
+ attribute.typedArray = outlineCoordinatesTypedArray;
+ attribute.componentDatatype = ComponentDatatype_default.FLOAT;
+ attribute.type = AttributeType_default.VEC3;
+ attribute.normalized = false;
+ attribute.count = outlineCoordinatesTypedArray.length / 3;
+ return attribute;
+}
+function generateBuffers(loadPlan, context) {
+ generateAttributeBuffers(loadPlan.attributePlans, context);
+ if (defined_default(loadPlan.indicesPlan)) {
+ generateIndexBuffers(loadPlan.indicesPlan, context);
+ }
+}
+function generateAttributeBuffers(attributePlans, context) {
+ const attributesLength = attributePlans.length;
+ for (let i = 0; i < attributesLength; i++) {
+ const attributePlan = attributePlans[i];
+ const attribute = attributePlan.attribute;
+ const typedArray = attribute.typedArray;
+ if (attributePlan.loadBuffer) {
+ const buffer = Buffer_default.createVertexBuffer({
+ typedArray,
+ context,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ buffer.vertexArrayDestroyable = false;
+ attribute.buffer = buffer;
+ }
+ if (!attributePlan.loadTypedArray) {
+ attribute.typedArray = void 0;
+ }
+ }
+}
+function generateIndexBuffers(indicesPlan, context) {
+ const indices2 = indicesPlan.indices;
+ if (indicesPlan.loadBuffer) {
+ const buffer = Buffer_default.createIndexBuffer({
+ typedArray: indices2.typedArray,
+ context,
+ usage: BufferUsage_default.STATIC_DRAW,
+ indexDatatype: indices2.indexDatatype
+ });
+ indices2.buffer = buffer;
+ buffer.vertexArrayDestroyable = false;
+ }
+ if (!indicesPlan.loadTypedArray) {
+ indices2.typedArray = void 0;
+ }
+}
+PrimitiveLoadPlan.AttributeLoadPlan = AttributeLoadPlan;
+PrimitiveLoadPlan.IndicesLoadPlan = IndicesLoadPlan;
+var PrimitiveLoadPlan_default = PrimitiveLoadPlan;
+
+// Source/Scene/SupportedImageFormats.js
+function SupportedImageFormats(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.webp = defaultValue_default(options.webp, false);
+ this.basis = defaultValue_default(options.basis, false);
+}
+var SupportedImageFormats_default = SupportedImageFormats;
+
+// Source/Scene/GltfLoader.js
+var Attribute2 = ModelComponents_default.Attribute;
+var Indices2 = ModelComponents_default.Indices;
+var FeatureIdAttribute2 = ModelComponents_default.FeatureIdAttribute;
+var FeatureIdTexture2 = ModelComponents_default.FeatureIdTexture;
+var FeatureIdImplicitRange2 = ModelComponents_default.FeatureIdImplicitRange;
+var MorphTarget2 = ModelComponents_default.MorphTarget;
+var Primitive3 = ModelComponents_default.Primitive;
+var Instances2 = ModelComponents_default.Instances;
+var Skin2 = ModelComponents_default.Skin;
+var Node4 = ModelComponents_default.Node;
+var AnimatedPropertyType2 = ModelComponents_default.AnimatedPropertyType;
+var AnimationSampler2 = ModelComponents_default.AnimationSampler;
+var AnimationTarget2 = ModelComponents_default.AnimationTarget;
+var AnimationChannel2 = ModelComponents_default.AnimationChannel;
+var Animation2 = ModelComponents_default.Animation;
+var ArticulationStage2 = ModelComponents_default.ArticulationStage;
+var Articulation2 = ModelComponents_default.Articulation;
+var Asset2 = ModelComponents_default.Asset;
+var Scene2 = ModelComponents_default.Scene;
+var Components2 = ModelComponents_default.Components;
+var MetallicRoughness2 = ModelComponents_default.MetallicRoughness;
+var SpecularGlossiness2 = ModelComponents_default.SpecularGlossiness;
+var Material3 = ModelComponents_default.Material;
+var GltfLoaderState = {
+ NOT_LOADED: 0,
+ LOADING: 1,
+ LOADED: 2,
+ PROCESSING: 3,
+ POST_PROCESSING: 4,
+ PROCESSED: 5,
+ READY: 6,
+ FAILED: 7,
+ UNLOADED: 8
+};
+function GltfLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const gltfResource = options.gltfResource;
+ let baseResource2 = options.baseResource;
+ const typedArray = options.typedArray;
+ const releaseGltfJson = defaultValue_default(options.releaseGltfJson, false);
+ const asynchronous = defaultValue_default(options.asynchronous, true);
+ const incrementallyLoadTextures = defaultValue_default(
+ options.incrementallyLoadTextures,
+ true
+ );
+ const upAxis = defaultValue_default(options.upAxis, Axis_default.Y);
+ const forwardAxis = defaultValue_default(options.forwardAxis, Axis_default.Z);
+ const loadAttributesAsTypedArray = defaultValue_default(
+ options.loadAttributesAsTypedArray,
+ false
+ );
+ const loadAttributesFor2D = defaultValue_default(options.loadAttributesFor2D, false);
+ const loadIndicesForWireframe = defaultValue_default(
+ options.loadIndicesForWireframe,
+ false
+ );
+ const loadPrimitiveOutline2 = defaultValue_default(options.loadPrimitiveOutline, true);
+ const loadForClassification = defaultValue_default(
+ options.loadForClassification,
+ false
+ );
+ const renameBatchIdSemantic = defaultValue_default(
+ options.renameBatchIdSemantic,
+ false
+ );
+ Check_default.typeOf.object("options.gltfResource", gltfResource);
+ baseResource2 = defined_default(baseResource2) ? baseResource2 : gltfResource.clone();
+ this._gltfJson = options.gltfJson;
+ this._gltfResource = gltfResource;
+ this._baseResource = baseResource2;
+ this._typedArray = typedArray;
+ this._releaseGltfJson = releaseGltfJson;
+ this._asynchronous = asynchronous;
+ this._incrementallyLoadTextures = incrementallyLoadTextures;
+ this._upAxis = upAxis;
+ this._forwardAxis = forwardAxis;
+ this._loadAttributesAsTypedArray = loadAttributesAsTypedArray;
+ this._loadAttributesFor2D = loadAttributesFor2D;
+ this._loadIndicesForWireframe = loadIndicesForWireframe;
+ this._loadPrimitiveOutline = loadPrimitiveOutline2;
+ this._loadForClassification = loadForClassification;
+ this._renameBatchIdSemantic = renameBatchIdSemantic;
+ this._hasKhrMeshQuantization = false;
+ this._sortedPropertyTableIds = void 0;
+ this._sortedFeatureTextureIds = void 0;
+ this._gltfJsonLoader = void 0;
+ this._state = GltfLoaderState.NOT_LOADED;
+ this._textureState = GltfLoaderState.NOT_LOADED;
+ this._promise = void 0;
+ this._texturesLoadedPromise = void 0;
+ this._process = function(loader, frameState) {
+ };
+ this._processTextures = function(loader, frameState) {
+ };
+ this._primitiveLoadPlans = [];
+ this._loaderPromises = [];
+ this._textureLoaders = [];
+ this._texturesPromises = [];
+ this._bufferViewLoaders = [];
+ this._geometryLoaders = [];
+ this._structuralMetadataLoader = void 0;
+ this._postProcessBuffers = [];
+ this._components = void 0;
+}
+if (defined_default(Object.create)) {
+ GltfLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ GltfLoader.prototype.constructor = GltfLoader;
+}
+Object.defineProperties(GltfLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return void 0;
+ }
+ },
+ components: {
+ get: function() {
+ return this._components;
+ }
+ },
+ texturesLoadedPromise: {
+ get: function() {
+ return this._texturesLoadedPromise;
+ }
+ }
+});
+GltfLoader.prototype.load = function() {
+ const gltfJsonLoader = ResourceCache_default.loadGltfJson({
+ gltfResource: this._gltfResource,
+ baseResource: this._baseResource,
+ typedArray: this._typedArray,
+ gltfJson: this._gltfJson
+ });
+ this._gltfJsonLoader = gltfJsonLoader;
+ this._state = GltfLoaderState.LOADING;
+ this._textureState = GltfLoaderState.LOADING;
+ const that = this;
+ let textureProcessPromise;
+ const processPromise = new Promise(function(resolve2, reject) {
+ textureProcessPromise = new Promise(function(resolveTextures, rejectTextures) {
+ that._process = function(loader, frameState) {
+ if (!FeatureDetection_default.supportsWebP.initialized) {
+ FeatureDetection_default.supportsWebP.initialize();
+ return;
+ }
+ if (loader._state === GltfLoaderState.LOADED) {
+ loader._state = GltfLoaderState.PROCESSING;
+ const supportedImageFormats = new SupportedImageFormats_default({
+ webp: FeatureDetection_default.supportsWebP(),
+ basis: frameState.context.supportsBasis
+ });
+ let gltf;
+ if (defined_default(loader._gltfJsonLoader)) {
+ gltf = loader._gltfJsonLoader.gltf;
+ } else {
+ gltf = loader._gltfJson;
+ }
+ parse(
+ loader,
+ gltf,
+ supportedImageFormats,
+ frameState,
+ reject,
+ rejectTextures
+ );
+ if (defined_default(loader._gltfJsonLoader) && loader._releaseGltfJson) {
+ ResourceCache_default.unload(loader._gltfJsonLoader);
+ loader._gltfJsonLoader = void 0;
+ }
+ }
+ if (loader._state === GltfLoaderState.PROCESSING) {
+ processLoaders(loader, frameState);
+ }
+ if (loader._state === GltfLoaderState.POST_PROCESSING) {
+ postProcessGeometry(loader, frameState.context);
+ loader._state = GltfLoaderState.PROCESSED;
+ }
+ if (loader._state === GltfLoaderState.PROCESSED) {
+ unloadBufferViews2(loader);
+ loader._typedArray = void 0;
+ loader._state = GltfLoaderState.READY;
+ resolve2(loader);
+ }
+ };
+ that._processTextures = function(loader, frameState) {
+ if (loader._textureState === GltfLoaderState.LOADED) {
+ loader._textureState = GltfLoaderState.PROCESSING;
+ }
+ if (loader._textureState === GltfLoaderState.PROCESSING) {
+ let i;
+ const textureLoaders = loader._textureLoaders;
+ const textureLoadersLength = textureLoaders.length;
+ for (i = 0; i < textureLoadersLength; ++i) {
+ textureLoaders[i].process(frameState);
+ }
+ }
+ if (loader._textureState === GltfLoaderState.PROCESSED) {
+ loader._textureState = GltfLoaderState.READY;
+ resolveTextures(loader);
+ }
+ };
+ });
+ });
+ this._promise = gltfJsonLoader.promise.then(function() {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that._state = GltfLoaderState.LOADED;
+ that._textureState = GltfLoaderState.LOADED;
+ return processPromise;
+ }).catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that._state = GltfLoaderState.FAILED;
+ that._textureState = GltfLoaderState.FAILED;
+ return handleError6(that, error);
+ });
+ this._texturesLoadedPromise = textureProcessPromise.catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that._textureState = GltfLoaderState.FAILED;
+ return handleError6(that, error);
+ });
+ return this._promise;
+};
+function handleError6(gltfLoader, error) {
+ gltfLoader.unload();
+ const errorMessage = "Failed to load glTF";
+ error = gltfLoader.getError(errorMessage, error);
+ return Promise.reject(error);
+}
+function processLoaders(loader, frameState) {
+ const bufferViewLoaders = loader._bufferViewLoaders;
+ const bufferViewLoadersLength = bufferViewLoaders.length;
+ for (let i = 0; i < bufferViewLoadersLength; ++i) {
+ bufferViewLoaders[i].process(frameState);
+ }
+ const geometryLoaders = loader._geometryLoaders;
+ const geometryLoadersLength = geometryLoaders.length;
+ for (let i = 0; i < geometryLoadersLength; ++i) {
+ geometryLoaders[i].process(frameState);
+ }
+ if (defined_default(loader._structuralMetadataLoader)) {
+ loader._structuralMetadataLoader.process(frameState);
+ }
+}
+function postProcessGeometry(loader, context) {
+ const loadPlans = loader._primitiveLoadPlans;
+ const length3 = loadPlans.length;
+ for (let i = 0; i < length3; i++) {
+ const loadPlan = loadPlans[i];
+ loadPlan.postProcess(context);
+ if (loadPlan.needsOutlines) {
+ gatherPostProcessBuffers(loader, loadPlan);
+ }
+ }
+}
+function gatherPostProcessBuffers(loader, primitiveLoadPlan) {
+ const buffers = loader._postProcessBuffers;
+ const primitive = primitiveLoadPlan.primitive;
+ const outlineCoordinates = primitive.outlineCoordinates;
+ if (defined_default(outlineCoordinates)) {
+ buffers.push(outlineCoordinates.buffer);
+ }
+ const attributes = primitive.attributes;
+ const length3 = attributes.length;
+ for (let i = 0; i < length3; i++) {
+ const attribute = attributes[i];
+ if (defined_default(attribute.buffer)) {
+ buffers.push(attribute.buffer);
+ }
+ }
+ const indices2 = primitive.indices;
+ if (defined_default(indices2) && defined_default(indices2.buffer)) {
+ buffers.push(indices2.buffer);
+ }
+}
+GltfLoader.prototype.process = function(frameState) {
+ Check_default.typeOf.object("frameState", frameState);
+ this._process(this, frameState);
+ this._processTextures(this, frameState);
+};
+function loadVertexBuffer(loader, gltf, accessorId, semantic, draco, loadBuffer, loadTypedArray, frameState) {
+ const accessor = gltf.accessors[accessorId];
+ const bufferViewId = accessor.bufferView;
+ const vertexBufferLoader = ResourceCache_default.loadVertexBuffer({
+ gltf,
+ gltfResource: loader._gltfResource,
+ baseResource: loader._baseResource,
+ frameState,
+ bufferViewId,
+ draco,
+ attributeSemantic: semantic,
+ accessorId,
+ asynchronous: loader._asynchronous,
+ loadBuffer,
+ loadTypedArray
+ });
+ loader._geometryLoaders.push(vertexBufferLoader);
+ return vertexBufferLoader;
+}
+function loadIndexBuffer(loader, gltf, accessorId, draco, loadBuffer, loadTypedArray, frameState) {
+ const indexBufferLoader = ResourceCache_default.loadIndexBuffer({
+ gltf,
+ accessorId,
+ gltfResource: loader._gltfResource,
+ baseResource: loader._baseResource,
+ frameState,
+ draco,
+ asynchronous: loader._asynchronous,
+ loadBuffer,
+ loadTypedArray
+ });
+ loader._geometryLoaders.push(indexBufferLoader);
+ return indexBufferLoader;
+}
+function loadBufferView(loader, gltf, bufferViewId) {
+ const bufferViewLoader = ResourceCache_default.loadBufferView({
+ gltf,
+ bufferViewId,
+ gltfResource: loader._gltfResource,
+ baseResource: loader._baseResource
+ });
+ loader._bufferViewLoaders.push(bufferViewLoader);
+ return bufferViewLoader;
+}
+function getPackedTypedArray(gltf, accessor, bufferViewTypedArray) {
+ let byteOffset = accessor.byteOffset;
+ const byteStride = getAccessorByteStride_default(gltf, accessor);
+ const count = accessor.count;
+ const componentCount = numberOfComponentsForType_default(accessor.type);
+ const componentType = accessor.componentType;
+ const componentByteLength = ComponentDatatype_default.getSizeInBytes(componentType);
+ const defaultByteStride = componentByteLength * componentCount;
+ const componentsLength = count * componentCount;
+ if (byteStride === defaultByteStride) {
+ bufferViewTypedArray = new Uint8Array(bufferViewTypedArray);
+ return ComponentDatatype_default.createArrayBufferView(
+ componentType,
+ bufferViewTypedArray.buffer,
+ bufferViewTypedArray.byteOffset + byteOffset,
+ componentsLength
+ );
+ }
+ const accessorTypedArray = ComponentDatatype_default.createTypedArray(
+ componentType,
+ componentsLength
+ );
+ const dataView = new DataView(bufferViewTypedArray.buffer);
+ const components = new Array(componentCount);
+ const componentReader = getComponentReader_default(accessor.componentType);
+ byteOffset = bufferViewTypedArray.byteOffset + byteOffset;
+ for (let i = 0; i < count; ++i) {
+ componentReader(
+ dataView,
+ byteOffset,
+ componentCount,
+ componentByteLength,
+ components
+ );
+ for (let j = 0; j < componentCount; ++j) {
+ accessorTypedArray[i * componentCount + j] = components[j];
+ }
+ byteOffset += byteStride;
+ }
+ return accessorTypedArray;
+}
+function loadDefaultAccessorValues(accessor, values) {
+ const accessorType = accessor.type;
+ if (accessorType === AttributeType_default.SCALAR) {
+ return values.fill(0);
+ }
+ const MathType = AttributeType_default.getMathType(accessorType);
+ return values.fill(MathType.clone(MathType.ZERO));
+}
+function loadAccessorValues(accessor, typedArray, values, useQuaternion) {
+ const accessorType = accessor.type;
+ const accessorCount = accessor.count;
+ if (accessorType === AttributeType_default.SCALAR) {
+ for (let i = 0; i < accessorCount; i++) {
+ values[i] = typedArray[i];
+ }
+ } else if (accessorType === AttributeType_default.VEC4 && useQuaternion) {
+ for (let i = 0; i < accessorCount; i++) {
+ values[i] = Quaternion_default.unpack(typedArray, i * 4);
+ }
+ } else {
+ const MathType = AttributeType_default.getMathType(accessorType);
+ const numberOfComponents = AttributeType_default.getNumberOfComponents(
+ accessorType
+ );
+ for (let i = 0; i < accessorCount; i++) {
+ values[i] = MathType.unpack(typedArray, i * numberOfComponents);
+ }
+ }
+ return values;
+}
+function loadAccessor(loader, gltf, accessorId, useQuaternion) {
+ const accessor = gltf.accessors[accessorId];
+ const accessorCount = accessor.count;
+ const values = new Array(accessorCount);
+ const bufferViewId = accessor.bufferView;
+ if (defined_default(bufferViewId)) {
+ const bufferViewLoader = loadBufferView(loader, gltf, bufferViewId);
+ const promise = bufferViewLoader.promise.then(function(bufferViewLoader2) {
+ if (loader.isDestroyed()) {
+ return;
+ }
+ const bufferViewTypedArray = bufferViewLoader2.typedArray;
+ const typedArray = getPackedTypedArray(
+ gltf,
+ accessor,
+ bufferViewTypedArray
+ );
+ useQuaternion = defaultValue_default(useQuaternion, false);
+ loadAccessorValues(accessor, typedArray, values, useQuaternion);
+ });
+ loader._loaderPromises.push(promise);
+ return values;
+ }
+ return loadDefaultAccessorValues(accessor, values);
+}
+function fromArray(MathType, values) {
+ if (!defined_default(values)) {
+ return void 0;
+ }
+ if (MathType === Number) {
+ return values[0];
+ }
+ return MathType.unpack(values);
+}
+function getDefault2(MathType) {
+ if (MathType === Number) {
+ return 0;
+ }
+ return new MathType();
+}
+function getQuantizationDivisor(componentDatatype) {
+ switch (componentDatatype) {
+ case ComponentDatatype_default.BYTE:
+ return 127;
+ case ComponentDatatype_default.UNSIGNED_BYTE:
+ return 255;
+ case ComponentDatatype_default.SHORT:
+ return 32767;
+ case ComponentDatatype_default.UNSIGNED_SHORT:
+ return 65535;
+ default:
+ return 1;
+ }
+}
+var minimumBoundsByType = {
+ VEC2: new Cartesian2_default(-1, -1),
+ VEC3: new Cartesian3_default(-1, -1, -1),
+ VEC4: new Cartesian4_default(-1, -1, -1, -1)
+};
+function dequantizeMinMax(attribute, VectorType) {
+ const divisor = getQuantizationDivisor(attribute.componentDatatype);
+ const minimumBound = minimumBoundsByType[attribute.type];
+ let min3 = attribute.min;
+ if (defined_default(min3)) {
+ min3 = VectorType.divideByScalar(min3, divisor, min3);
+ min3 = VectorType.maximumByComponent(min3, minimumBound, min3);
+ }
+ let max3 = attribute.max;
+ if (defined_default(max3)) {
+ max3 = VectorType.divideByScalar(max3, divisor, max3);
+ max3 = VectorType.maximumByComponent(max3, minimumBound, max3);
+ }
+ attribute.min = min3;
+ attribute.max = max3;
+}
+function setQuantizationFromWeb3dQuantizedAttributes(extension, attribute, MathType) {
+ const decodeMatrix = extension.decodeMatrix;
+ const decodedMin = fromArray(MathType, extension.decodedMin);
+ const decodedMax = fromArray(MathType, extension.decodedMax);
+ if (defined_default(decodedMin) && defined_default(decodedMax)) {
+ attribute.min = decodedMin;
+ attribute.max = decodedMax;
+ }
+ const quantization = new ModelComponents_default.Quantization();
+ quantization.componentDatatype = attribute.componentDatatype;
+ quantization.type = attribute.type;
+ if (decodeMatrix.length === 4) {
+ quantization.quantizedVolumeOffset = decodeMatrix[2];
+ quantization.quantizedVolumeStepSize = decodeMatrix[0];
+ } else if (decodeMatrix.length === 9) {
+ quantization.quantizedVolumeOffset = new Cartesian2_default(
+ decodeMatrix[6],
+ decodeMatrix[7]
+ );
+ quantization.quantizedVolumeStepSize = new Cartesian2_default(
+ decodeMatrix[0],
+ decodeMatrix[4]
+ );
+ } else if (decodeMatrix.length === 16) {
+ quantization.quantizedVolumeOffset = new Cartesian3_default(
+ decodeMatrix[12],
+ decodeMatrix[13],
+ decodeMatrix[14]
+ );
+ quantization.quantizedVolumeStepSize = new Cartesian3_default(
+ decodeMatrix[0],
+ decodeMatrix[5],
+ decodeMatrix[10]
+ );
+ } else if (decodeMatrix.length === 25) {
+ quantization.quantizedVolumeOffset = new Cartesian4_default(
+ decodeMatrix[20],
+ decodeMatrix[21],
+ decodeMatrix[22],
+ decodeMatrix[23]
+ );
+ quantization.quantizedVolumeStepSize = new Cartesian4_default(
+ decodeMatrix[0],
+ decodeMatrix[6],
+ decodeMatrix[12],
+ decodeMatrix[18]
+ );
+ }
+ attribute.quantization = quantization;
+}
+function createAttribute(gltf, accessorId, name, semantic, setIndex, hasKhrMeshQuantization) {
+ const accessor = gltf.accessors[accessorId];
+ const MathType = AttributeType_default.getMathType(accessor.type);
+ const normalized = defaultValue_default(accessor.normalized, false);
+ const attribute = new Attribute2();
+ attribute.name = name;
+ attribute.semantic = semantic;
+ attribute.setIndex = setIndex;
+ attribute.constant = getDefault2(MathType);
+ attribute.componentDatatype = accessor.componentType;
+ attribute.normalized = normalized;
+ attribute.count = accessor.count;
+ attribute.type = accessor.type;
+ attribute.min = fromArray(MathType, accessor.min);
+ attribute.max = fromArray(MathType, accessor.max);
+ attribute.byteOffset = accessor.byteOffset;
+ attribute.byteStride = getAccessorByteStride_default(gltf, accessor);
+ if (hasExtension_default(accessor, "WEB3D_quantized_attributes")) {
+ setQuantizationFromWeb3dQuantizedAttributes(
+ accessor.extensions.WEB3D_quantized_attributes,
+ attribute,
+ MathType
+ );
+ }
+ const isQuantizable = attribute.semantic === VertexAttributeSemantic_default.POSITION || attribute.semantic === VertexAttributeSemantic_default.NORMAL || attribute.semantic === VertexAttributeSemantic_default.TANGENT || attribute.semantic === VertexAttributeSemantic_default.TEXCOORD;
+ if (hasKhrMeshQuantization && normalized && isQuantizable) {
+ dequantizeMinMax(attribute, MathType);
+ }
+ return attribute;
+}
+function getSetIndex(gltfSemantic) {
+ const setIndexRegex = /^\w+_(\d+)$/;
+ const setIndexMatch = setIndexRegex.exec(gltfSemantic);
+ if (setIndexMatch !== null) {
+ return parseInt(setIndexMatch[1]);
+ }
+ return void 0;
+}
+var scratchSemanticInfo = {
+ gltfSemantic: void 0,
+ renamedSemantic: void 0,
+ modelSemantic: void 0
+};
+function getSemanticInfo(loader, semanticType, gltfSemantic) {
+ let renamedSemantic = gltfSemantic;
+ if (loader._renameBatchIdSemantic && (gltfSemantic === "_BATCHID" || gltfSemantic === "BATCHID")) {
+ renamedSemantic = "_FEATURE_ID_0";
+ }
+ const modelSemantic = semanticType.fromGltfSemantic(renamedSemantic);
+ const semanticInfo = scratchSemanticInfo;
+ semanticInfo.gltfSemantic = gltfSemantic;
+ semanticInfo.renamedSemantic = renamedSemantic;
+ semanticInfo.modelSemantic = modelSemantic;
+ return semanticInfo;
+}
+function isClassificationAttribute(attributeSemantic) {
+ const isPositionAttribute = attributeSemantic === VertexAttributeSemantic_default.POSITION;
+ const isFeatureIdAttribute = attributeSemantic === VertexAttributeSemantic_default.FEATURE_ID;
+ const isTexcoordAttribute = attributeSemantic === VertexAttributeSemantic_default.TEXCOORD;
+ return isPositionAttribute || isFeatureIdAttribute || isTexcoordAttribute;
+}
+function finalizeDracoAttribute(attribute, vertexBufferLoader, loadBuffer, loadTypedArray) {
+ attribute.byteOffset = 0;
+ attribute.byteStride = void 0;
+ attribute.quantization = vertexBufferLoader.quantization;
+ if (loadBuffer) {
+ attribute.buffer = vertexBufferLoader.buffer;
+ }
+ if (loadTypedArray) {
+ const componentDatatype = defined_default(vertexBufferLoader.quantization) ? vertexBufferLoader.quantization.componentDatatype : attribute.componentDatatype;
+ attribute.typedArray = ComponentDatatype_default.createArrayBufferView(
+ componentDatatype,
+ vertexBufferLoader.typedArray.buffer
+ );
+ }
+}
+function finalizeAttribute(gltf, accessor, attribute, vertexBufferLoader, loadBuffer, loadTypedArray) {
+ if (loadBuffer) {
+ attribute.buffer = vertexBufferLoader.buffer;
+ }
+ if (loadTypedArray) {
+ const bufferViewTypedArray = vertexBufferLoader.typedArray;
+ attribute.typedArray = getPackedTypedArray(
+ gltf,
+ accessor,
+ bufferViewTypedArray
+ );
+ if (!loadBuffer) {
+ attribute.byteOffset = 0;
+ attribute.byteStride = void 0;
+ }
+ }
+}
+function loadAttribute(loader, gltf, accessorId, semanticInfo, draco, loadBuffer, loadTypedArray, frameState) {
+ const accessor = gltf.accessors[accessorId];
+ const bufferViewId = accessor.bufferView;
+ const gltfSemantic = semanticInfo.gltfSemantic;
+ const renamedSemantic = semanticInfo.renamedSemantic;
+ const modelSemantic = semanticInfo.modelSemantic;
+ const setIndex = defined_default(modelSemantic) ? getSetIndex(renamedSemantic) : void 0;
+ const name = gltfSemantic;
+ const attribute = createAttribute(
+ gltf,
+ accessorId,
+ name,
+ modelSemantic,
+ setIndex,
+ loader._hasKhrMeshQuantization
+ );
+ if (!defined_default(draco) && !defined_default(bufferViewId)) {
+ return attribute;
+ }
+ const vertexBufferLoader = loadVertexBuffer(
+ loader,
+ gltf,
+ accessorId,
+ gltfSemantic,
+ draco,
+ loadBuffer,
+ loadTypedArray,
+ frameState
+ );
+ const promise = vertexBufferLoader.promise.then(function(vertexBufferLoader2) {
+ if (loader.isDestroyed()) {
+ return;
+ }
+ if (defined_default(draco) && defined_default(draco.attributes) && defined_default(draco.attributes[gltfSemantic])) {
+ finalizeDracoAttribute(
+ attribute,
+ vertexBufferLoader2,
+ loadBuffer,
+ loadTypedArray
+ );
+ } else {
+ finalizeAttribute(
+ gltf,
+ accessor,
+ attribute,
+ vertexBufferLoader2,
+ loadBuffer,
+ loadTypedArray
+ );
+ }
+ });
+ loader._loaderPromises.push(promise);
+ return attribute;
+}
+function loadVertexAttribute(loader, gltf, accessorId, semanticInfo, draco, hasInstances, needsPostProcessing, frameState) {
+ const modelSemantic = semanticInfo.modelSemantic;
+ const isPositionAttribute = modelSemantic === VertexAttributeSemantic_default.POSITION;
+ const isFeatureIdAttribute = modelSemantic === VertexAttributeSemantic_default.FEATURE_ID;
+ const loadTypedArrayFor2D = isPositionAttribute && !hasInstances && loader._loadAttributesFor2D && !frameState.scene3DOnly;
+ const loadTypedArrayForClassification = loader._loadForClassification && isFeatureIdAttribute;
+ const outputTypedArrayOnly = loader._loadAttributesAsTypedArray;
+ const outputBuffer = !outputTypedArrayOnly;
+ const outputTypedArray = outputTypedArrayOnly || loadTypedArrayFor2D || loadTypedArrayForClassification;
+ const loadBuffer = needsPostProcessing ? false : outputBuffer;
+ const loadTypedArray = needsPostProcessing ? true : outputTypedArray;
+ const attribute = loadAttribute(
+ loader,
+ gltf,
+ accessorId,
+ semanticInfo,
+ draco,
+ loadBuffer,
+ loadTypedArray,
+ frameState
+ );
+ const attributePlan = new PrimitiveLoadPlan_default.AttributeLoadPlan(attribute);
+ attributePlan.loadBuffer = outputBuffer;
+ attributePlan.loadTypedArray = outputTypedArray;
+ return attributePlan;
+}
+function loadInstancedAttribute(loader, gltf, accessorId, attributes, gltfSemantic, frameState) {
+ const hasRotation = defined_default(attributes.ROTATION);
+ const hasTranslationMinMax = defined_default(attributes.TRANSLATION) && defined_default(gltf.accessors[attributes.TRANSLATION].min) && defined_default(gltf.accessors[attributes.TRANSLATION].max);
+ const semanticInfo = getSemanticInfo(
+ loader,
+ InstanceAttributeSemantic_default,
+ gltfSemantic
+ );
+ const modelSemantic = semanticInfo.modelSemantic;
+ const isTransformAttribute = modelSemantic === InstanceAttributeSemantic_default.TRANSLATION || modelSemantic === InstanceAttributeSemantic_default.ROTATION || modelSemantic === InstanceAttributeSemantic_default.SCALE;
+ const isTranslationAttribute = modelSemantic === InstanceAttributeSemantic_default.TRANSLATION;
+ const loadAsTypedArrayOnly = loader._loadAttributesAsTypedArray || hasRotation && isTransformAttribute || !frameState.context.instancedArrays;
+ const loadBuffer = !loadAsTypedArrayOnly;
+ const loadFor2D = loader._loadAttributesFor2D && !frameState.scene3DOnly;
+ const loadTranslationAsTypedArray = isTranslationAttribute && (!hasTranslationMinMax || loadFor2D);
+ const loadTypedArray = loadAsTypedArrayOnly || loadTranslationAsTypedArray;
+ return loadAttribute(
+ loader,
+ gltf,
+ accessorId,
+ semanticInfo,
+ void 0,
+ loadBuffer,
+ loadTypedArray,
+ frameState
+ );
+}
+function loadIndices(loader, gltf, accessorId, draco, hasFeatureIds, needsPostProcessing, frameState) {
+ const accessor = gltf.accessors[accessorId];
+ const bufferViewId = accessor.bufferView;
+ if (!defined_default(draco) && !defined_default(bufferViewId)) {
+ return void 0;
+ }
+ const indices2 = new Indices2();
+ indices2.count = accessor.count;
+ const loadAttributesAsTypedArray = loader._loadAttributesAsTypedArray;
+ const loadForWireframe = loader._loadIndicesForWireframe && !frameState.context.webgl2;
+ const loadForClassification = loader._loadForClassification && hasFeatureIds;
+ const outputTypedArrayOnly = loadAttributesAsTypedArray;
+ const outputBuffer = !outputTypedArrayOnly;
+ const outputTypedArray = loadAttributesAsTypedArray || loadForWireframe || loadForClassification;
+ const loadBuffer = needsPostProcessing ? false : outputBuffer;
+ const loadTypedArray = needsPostProcessing ? true : outputTypedArray;
+ const indexBufferLoader = loadIndexBuffer(
+ loader,
+ gltf,
+ accessorId,
+ draco,
+ loadBuffer,
+ loadTypedArray,
+ frameState
+ );
+ const promise = indexBufferLoader.promise.then(function(indexBufferLoader2) {
+ if (loader.isDestroyed()) {
+ return;
+ }
+ indices2.indexDatatype = indexBufferLoader2.indexDatatype;
+ indices2.buffer = indexBufferLoader2.buffer;
+ indices2.typedArray = indexBufferLoader2.typedArray;
+ });
+ loader._loaderPromises.push(promise);
+ const indicesPlan = new PrimitiveLoadPlan_default.IndicesLoadPlan(indices2);
+ indicesPlan.loadBuffer = outputBuffer;
+ indicesPlan.loadTypedArray = outputTypedArray;
+ return indicesPlan;
+}
+function loadTexture(loader, gltf, textureInfo, supportedImageFormats, frameState, samplerOverride) {
+ const imageId = GltfLoaderUtil_default.getImageIdFromTexture({
+ gltf,
+ textureId: textureInfo.index,
+ supportedImageFormats
+ });
+ if (!defined_default(imageId)) {
+ return void 0;
+ }
+ const textureLoader = ResourceCache_default.loadTexture({
+ gltf,
+ textureInfo,
+ gltfResource: loader._gltfResource,
+ baseResource: loader._baseResource,
+ supportedImageFormats,
+ frameState,
+ asynchronous: loader._asynchronous
+ });
+ loader._textureLoaders.push(textureLoader);
+ const textureReader = GltfLoaderUtil_default.createModelTextureReader({
+ textureInfo
+ });
+ const promise = textureLoader.promise.then(function(textureLoader2) {
+ if (loader.isUnloaded() || loader.isDestroyed()) {
+ return;
+ }
+ textureReader.texture = textureLoader2.texture;
+ if (defined_default(samplerOverride)) {
+ textureReader.texture.sampler = samplerOverride;
+ }
+ });
+ loader._texturesPromises.push(promise);
+ return textureReader;
+}
+function loadMaterial(loader, gltf, gltfMaterial, supportedImageFormats, frameState) {
+ const material = new Material3();
+ const extensions = defaultValue_default(
+ gltfMaterial.extensions,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ const pbrSpecularGlossiness = extensions.KHR_materials_pbrSpecularGlossiness;
+ const pbrMetallicRoughness = gltfMaterial.pbrMetallicRoughness;
+ material.unlit = defined_default(extensions.KHR_materials_unlit);
+ if (defined_default(pbrSpecularGlossiness)) {
+ const specularGlossiness = new SpecularGlossiness2();
+ material.specularGlossiness = specularGlossiness;
+ if (defined_default(pbrSpecularGlossiness.diffuseTexture)) {
+ specularGlossiness.diffuseTexture = loadTexture(
+ loader,
+ gltf,
+ pbrSpecularGlossiness.diffuseTexture,
+ supportedImageFormats,
+ frameState
+ );
+ }
+ if (defined_default(pbrSpecularGlossiness.specularGlossinessTexture)) {
+ if (defined_default(pbrSpecularGlossiness.specularGlossinessTexture)) {
+ specularGlossiness.specularGlossinessTexture = loadTexture(
+ loader,
+ gltf,
+ pbrSpecularGlossiness.specularGlossinessTexture,
+ supportedImageFormats,
+ frameState
+ );
+ }
+ }
+ specularGlossiness.diffuseFactor = fromArray(
+ Cartesian4_default,
+ pbrSpecularGlossiness.diffuseFactor
+ );
+ specularGlossiness.specularFactor = fromArray(
+ Cartesian3_default,
+ pbrSpecularGlossiness.specularFactor
+ );
+ specularGlossiness.glossinessFactor = pbrSpecularGlossiness.glossinessFactor;
+ material.pbrSpecularGlossiness = pbrSpecularGlossiness;
+ } else if (defined_default(pbrMetallicRoughness)) {
+ const metallicRoughness = new MetallicRoughness2();
+ if (defined_default(pbrMetallicRoughness.baseColorTexture)) {
+ metallicRoughness.baseColorTexture = loadTexture(
+ loader,
+ gltf,
+ pbrMetallicRoughness.baseColorTexture,
+ supportedImageFormats,
+ frameState
+ );
+ }
+ if (defined_default(pbrMetallicRoughness.metallicRoughnessTexture)) {
+ metallicRoughness.metallicRoughnessTexture = loadTexture(
+ loader,
+ gltf,
+ pbrMetallicRoughness.metallicRoughnessTexture,
+ supportedImageFormats,
+ frameState
+ );
+ }
+ metallicRoughness.baseColorFactor = fromArray(
+ Cartesian4_default,
+ pbrMetallicRoughness.baseColorFactor
+ );
+ metallicRoughness.metallicFactor = pbrMetallicRoughness.metallicFactor;
+ metallicRoughness.roughnessFactor = pbrMetallicRoughness.roughnessFactor;
+ material.metallicRoughness = metallicRoughness;
+ }
+ if (defined_default(gltfMaterial.emissiveTexture)) {
+ material.emissiveTexture = loadTexture(
+ loader,
+ gltf,
+ gltfMaterial.emissiveTexture,
+ supportedImageFormats,
+ frameState
+ );
+ }
+ if (defined_default(gltfMaterial.normalTexture) && !loader._loadForClassification) {
+ material.normalTexture = loadTexture(
+ loader,
+ gltf,
+ gltfMaterial.normalTexture,
+ supportedImageFormats,
+ frameState
+ );
+ }
+ if (defined_default(gltfMaterial.occlusionTexture)) {
+ material.occlusionTexture = loadTexture(
+ loader,
+ gltf,
+ gltfMaterial.occlusionTexture,
+ supportedImageFormats,
+ frameState
+ );
+ }
+ material.emissiveFactor = fromArray(Cartesian3_default, gltfMaterial.emissiveFactor);
+ material.alphaMode = gltfMaterial.alphaMode;
+ material.alphaCutoff = gltfMaterial.alphaCutoff;
+ material.doubleSided = gltfMaterial.doubleSided;
+ return material;
+}
+function loadFeatureIdAttribute(featureIds, positionalLabel) {
+ const featureIdAttribute = new FeatureIdAttribute2();
+ featureIdAttribute.featureCount = featureIds.featureCount;
+ featureIdAttribute.nullFeatureId = featureIds.nullFeatureId;
+ featureIdAttribute.propertyTableId = featureIds.propertyTable;
+ featureIdAttribute.setIndex = featureIds.attribute;
+ featureIdAttribute.label = featureIds.label;
+ featureIdAttribute.positionalLabel = positionalLabel;
+ return featureIdAttribute;
+}
+function loadFeatureIdAttributeLegacy(gltfFeatureIdAttribute, featureTableId, featureCount, positionalLabel) {
+ const featureIdAttribute = new FeatureIdAttribute2();
+ const featureIds = gltfFeatureIdAttribute.featureIds;
+ featureIdAttribute.featureCount = featureCount;
+ featureIdAttribute.propertyTableId = featureTableId;
+ featureIdAttribute.setIndex = getSetIndex(featureIds.attribute);
+ featureIdAttribute.positionalLabel = positionalLabel;
+ return featureIdAttribute;
+}
+function loadDefaultFeatureIds(featureIds, positionalLabel) {
+ const featureIdRange = new FeatureIdImplicitRange2();
+ featureIdRange.propertyTableId = featureIds.propertyTable;
+ featureIdRange.featureCount = featureIds.featureCount;
+ featureIdRange.nullFeatureId = featureIds.nullFeatureId;
+ featureIdRange.label = featureIds.label;
+ featureIdRange.positionalLabel = positionalLabel;
+ featureIdRange.offset = 0;
+ featureIdRange.repeat = 1;
+ return featureIdRange;
+}
+function loadFeatureIdImplicitRangeLegacy(gltfFeatureIdAttribute, featureTableId, featureCount, positionalLabel) {
+ const featureIdRange = new FeatureIdImplicitRange2();
+ const featureIds = gltfFeatureIdAttribute.featureIds;
+ featureIdRange.propertyTableId = featureTableId;
+ featureIdRange.featureCount = featureCount;
+ featureIdRange.offset = defaultValue_default(featureIds.constant, 0);
+ const divisor = defaultValue_default(featureIds.divisor, 0);
+ featureIdRange.repeat = divisor === 0 ? void 0 : divisor;
+ featureIdRange.positionalLabel = positionalLabel;
+ return featureIdRange;
+}
+function loadFeatureIdTexture(loader, gltf, gltfFeatureIdTexture, supportedImageFormats, frameState, positionalLabel) {
+ const featureIdTexture = new FeatureIdTexture2();
+ featureIdTexture.featureCount = gltfFeatureIdTexture.featureCount;
+ featureIdTexture.nullFeatureId = gltfFeatureIdTexture.nullFeatureId;
+ featureIdTexture.propertyTableId = gltfFeatureIdTexture.propertyTable;
+ featureIdTexture.label = gltfFeatureIdTexture.label;
+ featureIdTexture.positionalLabel = positionalLabel;
+ const textureInfo = gltfFeatureIdTexture.texture;
+ featureIdTexture.textureReader = loadTexture(
+ loader,
+ gltf,
+ textureInfo,
+ supportedImageFormats,
+ frameState,
+ Sampler_default.NEAREST
+ );
+ const channels = defined_default(textureInfo.channels) ? textureInfo.channels : [0];
+ const channelString = channels.map(function(channelIndex) {
+ return "rgba".charAt(channelIndex);
+ }).join("");
+ featureIdTexture.textureReader.channels = channelString;
+ return featureIdTexture;
+}
+function loadFeatureIdTextureLegacy(loader, gltf, gltfFeatureIdTexture, featureTableId, supportedImageFormats, frameState, featureCount, positionalLabel) {
+ const featureIdTexture = new FeatureIdTexture2();
+ const featureIds = gltfFeatureIdTexture.featureIds;
+ const textureInfo = featureIds.texture;
+ featureIdTexture.featureCount = featureCount;
+ featureIdTexture.propertyTableId = featureTableId;
+ featureIdTexture.textureReader = loadTexture(
+ loader,
+ gltf,
+ textureInfo,
+ supportedImageFormats,
+ frameState,
+ Sampler_default.NEAREST
+ );
+ featureIdTexture.textureReader.channels = featureIds.channels;
+ featureIdTexture.positionalLabel = positionalLabel;
+ return featureIdTexture;
+}
+function loadMorphTarget(loader, gltf, target, needsPostProcessing, primitiveLoadPlan, frameState) {
+ const morphTarget = new MorphTarget2();
+ const draco = void 0;
+ const hasInstances = false;
+ for (const semantic in target) {
+ if (target.hasOwnProperty(semantic)) {
+ const accessorId = target[semantic];
+ const semanticInfo = getSemanticInfo(
+ loader,
+ VertexAttributeSemantic_default,
+ semantic
+ );
+ const attributePlan = loadVertexAttribute(
+ loader,
+ gltf,
+ accessorId,
+ semanticInfo,
+ draco,
+ hasInstances,
+ needsPostProcessing,
+ frameState
+ );
+ morphTarget.attributes.push(attributePlan.attribute);
+ primitiveLoadPlan.attributePlans.push(attributePlan);
+ }
+ }
+ return morphTarget;
+}
+function loadPrimitive(loader, gltf, gltfPrimitive, hasInstances, supportedImageFormats, frameState) {
+ const primitive = new Primitive3();
+ const primitivePlan = new PrimitiveLoadPlan_default(primitive);
+ loader._primitiveLoadPlans.push(primitivePlan);
+ const materialId = gltfPrimitive.material;
+ if (defined_default(materialId)) {
+ primitive.material = loadMaterial(
+ loader,
+ gltf,
+ gltf.materials[materialId],
+ supportedImageFormats,
+ frameState
+ );
+ }
+ const extensions = defaultValue_default(
+ gltfPrimitive.extensions,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ let needsPostProcessing = false;
+ const outlineExtension = extensions.CESIUM_primitive_outline;
+ if (loader._loadPrimitiveOutline && defined_default(outlineExtension)) {
+ needsPostProcessing = true;
+ primitivePlan.needsOutlines = true;
+ primitivePlan.outlineIndices = loadPrimitiveOutline(
+ loader,
+ gltf,
+ outlineExtension,
+ primitivePlan
+ );
+ }
+ const loadForClassification = loader._loadForClassification;
+ const draco = extensions.KHR_draco_mesh_compression;
+ let hasFeatureIds = false;
+ const attributes = gltfPrimitive.attributes;
+ if (defined_default(attributes)) {
+ for (const semantic in attributes) {
+ if (attributes.hasOwnProperty(semantic)) {
+ const accessorId = attributes[semantic];
+ const semanticInfo = getSemanticInfo(
+ loader,
+ VertexAttributeSemantic_default,
+ semantic
+ );
+ const modelSemantic = semanticInfo.modelSemantic;
+ if (loadForClassification && !isClassificationAttribute(modelSemantic)) {
+ continue;
+ }
+ if (modelSemantic === VertexAttributeSemantic_default.FEATURE_ID) {
+ hasFeatureIds = true;
+ }
+ const attributePlan = loadVertexAttribute(
+ loader,
+ gltf,
+ accessorId,
+ semanticInfo,
+ draco,
+ hasInstances,
+ needsPostProcessing,
+ frameState
+ );
+ primitivePlan.attributePlans.push(attributePlan);
+ primitive.attributes.push(attributePlan.attribute);
+ }
+ }
+ }
+ const targets = gltfPrimitive.targets;
+ if (defined_default(targets) && !loadForClassification) {
+ const targetsLength = targets.length;
+ for (let i = 0; i < targetsLength; ++i) {
+ primitive.morphTargets.push(
+ loadMorphTarget(
+ loader,
+ gltf,
+ targets[i],
+ needsPostProcessing,
+ primitivePlan,
+ frameState
+ )
+ );
+ }
+ }
+ const indices2 = gltfPrimitive.indices;
+ if (defined_default(indices2)) {
+ const indicesPlan = loadIndices(
+ loader,
+ gltf,
+ indices2,
+ draco,
+ hasFeatureIds,
+ needsPostProcessing,
+ frameState
+ );
+ if (defined_default(indicesPlan)) {
+ primitivePlan.indicesPlan = indicesPlan;
+ primitive.indices = indicesPlan.indices;
+ }
+ }
+ const structuralMetadata = extensions.EXT_structural_metadata;
+ const meshFeatures = extensions.EXT_mesh_features;
+ const featureMetadataLegacy = extensions.EXT_feature_metadata;
+ const hasFeatureMetadataLegacy = defined_default(featureMetadataLegacy);
+ if (defined_default(meshFeatures)) {
+ loadPrimitiveFeatures(
+ loader,
+ gltf,
+ primitive,
+ meshFeatures,
+ supportedImageFormats,
+ frameState
+ );
+ } else if (hasFeatureMetadataLegacy) {
+ loadPrimitiveFeaturesLegacy(
+ loader,
+ gltf,
+ primitive,
+ featureMetadataLegacy,
+ supportedImageFormats,
+ frameState
+ );
+ }
+ if (defined_default(structuralMetadata)) {
+ loadPrimitiveMetadata(primitive, structuralMetadata);
+ } else if (hasFeatureMetadataLegacy) {
+ loadPrimitiveMetadataLegacy(loader, primitive, featureMetadataLegacy);
+ }
+ const primitiveType = gltfPrimitive.mode;
+ if (loadForClassification && primitiveType !== PrimitiveType_default.TRIANGLES) {
+ throw new RuntimeError_default(
+ "Only triangle meshes can be used for classification."
+ );
+ }
+ primitive.primitiveType = primitiveType;
+ return primitive;
+}
+function loadPrimitiveOutline(loader, gltf, outlineExtension) {
+ const accessorId = outlineExtension.indices;
+ const useQuaternion = false;
+ return loadAccessor(loader, gltf, accessorId, useQuaternion);
+}
+function loadPrimitiveFeatures(loader, gltf, primitive, meshFeaturesExtension, supportedImageFormats, frameState) {
+ let featureIdsArray;
+ if (defined_default(meshFeaturesExtension) && defined_default(meshFeaturesExtension.featureIds)) {
+ featureIdsArray = meshFeaturesExtension.featureIds;
+ } else {
+ featureIdsArray = [];
+ }
+ for (let i = 0; i < featureIdsArray.length; i++) {
+ const featureIds = featureIdsArray[i];
+ const label = `featureId_${i}`;
+ let featureIdComponent;
+ if (defined_default(featureIds.texture)) {
+ featureIdComponent = loadFeatureIdTexture(
+ loader,
+ gltf,
+ featureIds,
+ supportedImageFormats,
+ frameState,
+ label
+ );
+ } else if (defined_default(featureIds.attribute)) {
+ featureIdComponent = loadFeatureIdAttribute(featureIds, label);
+ } else {
+ featureIdComponent = loadDefaultFeatureIds(featureIds, label);
+ }
+ primitive.featureIds.push(featureIdComponent);
+ }
+}
+function loadPrimitiveFeaturesLegacy(loader, gltf, primitive, metadataExtension, supportedImageFormats, frameState) {
+ const featureTables = gltf.extensions.EXT_feature_metadata.featureTables;
+ let nextFeatureIdIndex = 0;
+ const featureIdAttributes = metadataExtension.featureIdAttributes;
+ if (defined_default(featureIdAttributes)) {
+ const featureIdAttributesLength = featureIdAttributes.length;
+ for (let i = 0; i < featureIdAttributesLength; ++i) {
+ const featureIdAttribute = featureIdAttributes[i];
+ const featureTableId = featureIdAttribute.featureTable;
+ const propertyTableId = loader._sortedPropertyTableIds.indexOf(
+ featureTableId
+ );
+ const featureCount = featureTables[featureTableId].count;
+ const label = `featureId_${nextFeatureIdIndex}`;
+ nextFeatureIdIndex++;
+ let featureIdComponent;
+ if (defined_default(featureIdAttribute.featureIds.attribute)) {
+ featureIdComponent = loadFeatureIdAttributeLegacy(
+ featureIdAttribute,
+ propertyTableId,
+ featureCount,
+ label
+ );
+ } else {
+ featureIdComponent = loadFeatureIdImplicitRangeLegacy(
+ featureIdAttribute,
+ propertyTableId,
+ featureCount,
+ label
+ );
+ }
+ primitive.featureIds.push(featureIdComponent);
+ }
+ }
+ const featureIdTextures = metadataExtension.featureIdTextures;
+ if (defined_default(featureIdTextures)) {
+ const featureIdTexturesLength = featureIdTextures.length;
+ for (let i = 0; i < featureIdTexturesLength; ++i) {
+ const featureIdTexture = featureIdTextures[i];
+ const featureTableId = featureIdTexture.featureTable;
+ const propertyTableId = loader._sortedPropertyTableIds.indexOf(
+ featureTableId
+ );
+ const featureCount = featureTables[featureTableId].count;
+ const featureIdLabel = `featureId_${nextFeatureIdIndex}`;
+ nextFeatureIdIndex++;
+ const featureIdComponent = loadFeatureIdTextureLegacy(
+ loader,
+ gltf,
+ featureIdTexture,
+ propertyTableId,
+ supportedImageFormats,
+ frameState,
+ featureCount,
+ featureIdLabel
+ );
+ primitive.featureIds.push(featureIdComponent);
+ }
+ }
+}
+function loadPrimitiveMetadata(primitive, structuralMetadataExtension) {
+ if (!defined_default(structuralMetadataExtension)) {
+ return;
+ }
+ if (defined_default(structuralMetadataExtension.propertyTextures)) {
+ primitive.propertyTextureIds = structuralMetadataExtension.propertyTextures;
+ }
+ if (defined_default(structuralMetadataExtension.propertyAttributes)) {
+ primitive.propertyAttributeIds = structuralMetadataExtension.propertyAttributes;
+ }
+}
+function loadPrimitiveMetadataLegacy(loader, primitive, metadataExtension) {
+ if (defined_default(metadataExtension.featureTextures)) {
+ primitive.propertyTextureIds = metadataExtension.featureTextures.map(
+ function(id) {
+ return loader._sortedFeatureTextureIds.indexOf(id);
+ }
+ );
+ }
+}
+function loadInstances(loader, gltf, nodeExtensions, frameState) {
+ const instancingExtension = nodeExtensions.EXT_mesh_gpu_instancing;
+ const instances = new Instances2();
+ const attributes = instancingExtension.attributes;
+ if (defined_default(attributes)) {
+ for (const semantic in attributes) {
+ if (attributes.hasOwnProperty(semantic)) {
+ const accessorId = attributes[semantic];
+ instances.attributes.push(
+ loadInstancedAttribute(
+ loader,
+ gltf,
+ accessorId,
+ attributes,
+ semantic,
+ frameState
+ )
+ );
+ }
+ }
+ }
+ const instancingExtExtensions = defaultValue_default(
+ instancingExtension.extensions,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ const instanceFeatures = nodeExtensions.EXT_instance_features;
+ const featureMetadataLegacy = instancingExtExtensions.EXT_feature_metadata;
+ if (defined_default(instanceFeatures)) {
+ loadInstanceFeatures(instances, instanceFeatures);
+ } else if (defined_default(featureMetadataLegacy)) {
+ loadInstanceFeaturesLegacy(
+ gltf,
+ instances,
+ featureMetadataLegacy,
+ loader._sortedPropertyTableIds
+ );
+ }
+ return instances;
+}
+function loadInstanceFeatures(instances, instanceFeaturesExtension) {
+ const featureIdsArray = instanceFeaturesExtension.featureIds;
+ for (let i = 0; i < featureIdsArray.length; i++) {
+ const featureIds = featureIdsArray[i];
+ const label = `instanceFeatureId_${i}`;
+ let featureIdComponent;
+ if (defined_default(featureIds.attribute)) {
+ featureIdComponent = loadFeatureIdAttribute(featureIds, label);
+ } else {
+ featureIdComponent = loadDefaultFeatureIds(featureIds, label);
+ }
+ instances.featureIds.push(featureIdComponent);
+ }
+}
+function loadInstanceFeaturesLegacy(gltf, instances, metadataExtension, sortedPropertyTableIds) {
+ const featureTables = gltf.extensions.EXT_feature_metadata.featureTables;
+ const featureIdAttributes = metadataExtension.featureIdAttributes;
+ if (defined_default(featureIdAttributes)) {
+ const featureIdAttributesLength = featureIdAttributes.length;
+ for (let i = 0; i < featureIdAttributesLength; ++i) {
+ const featureIdAttribute = featureIdAttributes[i];
+ const featureTableId = featureIdAttribute.featureTable;
+ const propertyTableId = sortedPropertyTableIds.indexOf(featureTableId);
+ const featureCount = featureTables[featureTableId].count;
+ const label = `instanceFeatureId_${i}`;
+ let featureIdComponent;
+ if (defined_default(featureIdAttribute.featureIds.attribute)) {
+ featureIdComponent = loadFeatureIdAttributeLegacy(
+ featureIdAttribute,
+ propertyTableId,
+ featureCount,
+ label
+ );
+ } else {
+ featureIdComponent = loadFeatureIdImplicitRangeLegacy(
+ featureIdAttribute,
+ propertyTableId,
+ featureCount,
+ label
+ );
+ }
+ instances.featureIds.push(featureIdComponent);
+ }
+ }
+}
+function loadNode(loader, gltf, gltfNode, supportedImageFormats, frameState) {
+ const node = new Node4();
+ node.name = gltfNode.name;
+ node.matrix = fromArray(Matrix4_default, gltfNode.matrix);
+ node.translation = fromArray(Cartesian3_default, gltfNode.translation);
+ node.rotation = fromArray(Quaternion_default, gltfNode.rotation);
+ node.scale = fromArray(Cartesian3_default, gltfNode.scale);
+ const nodeExtensions = defaultValue_default(
+ gltfNode.extensions,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ const instancingExtension = nodeExtensions.EXT_mesh_gpu_instancing;
+ const articulationsExtension = nodeExtensions.AGI_articulations;
+ if (defined_default(instancingExtension)) {
+ if (loader._loadForClassification) {
+ throw new RuntimeError_default(
+ "Models with the EXT_mesh_gpu_instancing extension cannot be used for classification."
+ );
+ }
+ node.instances = loadInstances(loader, gltf, nodeExtensions, frameState);
+ }
+ if (defined_default(articulationsExtension)) {
+ node.articulationName = articulationsExtension.articulationName;
+ }
+ const meshId = gltfNode.mesh;
+ if (defined_default(meshId)) {
+ const mesh = gltf.meshes[meshId];
+ const primitives = mesh.primitives;
+ const primitivesLength = primitives.length;
+ for (let i = 0; i < primitivesLength; ++i) {
+ node.primitives.push(
+ loadPrimitive(
+ loader,
+ gltf,
+ primitives[i],
+ defined_default(node.instances),
+ supportedImageFormats,
+ frameState
+ )
+ );
+ }
+ const morphWeights = defaultValue_default(gltfNode.weights, mesh.weights);
+ const targets = node.primitives[0].morphTargets;
+ const targetsLength = targets.length;
+ node.morphWeights = defined_default(morphWeights) ? morphWeights.slice() : new Array(targetsLength).fill(0);
+ }
+ return node;
+}
+function loadNodes(loader, gltf, supportedImageFormats, frameState) {
+ if (!defined_default(gltf.nodes)) {
+ return [];
+ }
+ let i;
+ let j;
+ const nodesLength = gltf.nodes.length;
+ const nodes = new Array(nodesLength);
+ for (i = 0; i < nodesLength; ++i) {
+ const node = loadNode(
+ loader,
+ gltf,
+ gltf.nodes[i],
+ supportedImageFormats,
+ frameState
+ );
+ node.index = i;
+ nodes[i] = node;
+ }
+ for (i = 0; i < nodesLength; ++i) {
+ const childrenNodeIds = gltf.nodes[i].children;
+ if (defined_default(childrenNodeIds)) {
+ const childrenLength = childrenNodeIds.length;
+ for (j = 0; j < childrenLength; ++j) {
+ nodes[i].children.push(nodes[childrenNodeIds[j]]);
+ }
+ }
+ }
+ return nodes;
+}
+function loadSkin(loader, gltf, gltfSkin, nodes) {
+ const skin = new Skin2();
+ const jointIds = gltfSkin.joints;
+ const jointsLength = jointIds.length;
+ const joints = new Array(jointsLength);
+ for (let i = 0; i < jointsLength; ++i) {
+ joints[i] = nodes[jointIds[i]];
+ }
+ skin.joints = joints;
+ const inverseBindMatricesAccessorId = gltfSkin.inverseBindMatrices;
+ if (defined_default(inverseBindMatricesAccessorId)) {
+ skin.inverseBindMatrices = loadAccessor(
+ loader,
+ gltf,
+ inverseBindMatricesAccessorId
+ );
+ } else {
+ skin.inverseBindMatrices = new Array(jointsLength).fill(Matrix4_default.IDENTITY);
+ }
+ return skin;
+}
+function loadSkins(loader, gltf, nodes) {
+ const gltfSkins = gltf.skins;
+ if (loader._loadForClassification || !defined_default(gltfSkins)) {
+ return [];
+ }
+ const skinsLength = gltf.skins.length;
+ const skins = new Array(skinsLength);
+ for (let i = 0; i < skinsLength; ++i) {
+ const skin = loadSkin(loader, gltf, gltf.skins[i], nodes);
+ skin.index = i;
+ skins[i] = skin;
+ }
+ const nodesLength = nodes.length;
+ for (let i = 0; i < nodesLength; ++i) {
+ const skinId = gltf.nodes[i].skin;
+ if (defined_default(skinId)) {
+ nodes[i].skin = skins[skinId];
+ }
+ }
+ return skins;
+}
+function loadStructuralMetadata(loader, gltf, extension, extensionLegacy, supportedImageFormats, frameState) {
+ const structuralMetadataLoader = new GltfStructuralMetadataLoader_default({
+ gltf,
+ extension,
+ extensionLegacy,
+ gltfResource: loader._gltfResource,
+ baseResource: loader._baseResource,
+ supportedImageFormats,
+ frameState,
+ asynchronous: loader._asynchronous
+ });
+ structuralMetadataLoader.load();
+ loader._structuralMetadataLoader = structuralMetadataLoader;
+ return structuralMetadataLoader;
+}
+function loadAnimationSampler(loader, gltf, gltfSampler) {
+ const animationSampler = new AnimationSampler2();
+ const inputAccessorId = gltfSampler.input;
+ animationSampler.input = loadAccessor(loader, gltf, inputAccessorId);
+ const gltfInterpolation = gltfSampler.interpolation;
+ animationSampler.interpolation = defaultValue_default(
+ InterpolationType_default[gltfInterpolation],
+ InterpolationType_default.LINEAR
+ );
+ const outputAccessorId = gltfSampler.output;
+ animationSampler.output = loadAccessor(loader, gltf, outputAccessorId, true);
+ return animationSampler;
+}
+function loadAnimationTarget(gltfTarget, nodes) {
+ const animationTarget = new AnimationTarget2();
+ const nodeIndex = gltfTarget.node;
+ if (!defined_default(nodeIndex)) {
+ return void 0;
+ }
+ animationTarget.node = nodes[nodeIndex];
+ const path = gltfTarget.path.toUpperCase();
+ animationTarget.path = AnimatedPropertyType2[path];
+ return animationTarget;
+}
+function loadAnimationChannel(gltfChannel, samplers, nodes) {
+ const animationChannel = new AnimationChannel2();
+ const samplerIndex = gltfChannel.sampler;
+ animationChannel.sampler = samplers[samplerIndex];
+ animationChannel.target = loadAnimationTarget(gltfChannel.target, nodes);
+ return animationChannel;
+}
+function loadAnimation(loader, gltf, gltfAnimation, nodes) {
+ let i;
+ const animation = new Animation2();
+ animation.name = gltfAnimation.name;
+ const gltfSamplers = gltfAnimation.samplers;
+ const samplersLength = gltfSamplers.length;
+ const samplers = new Array(samplersLength);
+ for (i = 0; i < samplersLength; i++) {
+ const sampler = loadAnimationSampler(loader, gltf, gltfSamplers[i]);
+ sampler.index = i;
+ samplers[i] = sampler;
+ }
+ const gltfChannels = gltfAnimation.channels;
+ const channelsLength = gltfChannels.length;
+ const channels = new Array(channelsLength);
+ for (i = 0; i < channelsLength; i++) {
+ channels[i] = loadAnimationChannel(gltfChannels[i], samplers, nodes);
+ }
+ animation.samplers = samplers;
+ animation.channels = channels;
+ return animation;
+}
+function loadAnimations(loader, gltf, nodes) {
+ const gltfAnimations = gltf.animations;
+ if (loader._loadForClassification || !defined_default(gltfAnimations)) {
+ return [];
+ }
+ const animationsLength = gltf.animations.length;
+ const animations = new Array(animationsLength);
+ for (let i = 0; i < animationsLength; ++i) {
+ const animation = loadAnimation(loader, gltf, gltf.animations[i], nodes);
+ animation.index = i;
+ animations[i] = animation;
+ }
+ return animations;
+}
+function loadArticulationStage(gltfStage) {
+ const stage = new ArticulationStage2();
+ stage.name = gltfStage.name;
+ const type = gltfStage.type.toUpperCase();
+ stage.type = ArticulationStageType_default[type];
+ stage.minimumValue = gltfStage.minimumValue;
+ stage.maximumValue = gltfStage.maximumValue;
+ stage.initialValue = gltfStage.initialValue;
+ return stage;
+}
+function loadArticulation(gltfArticulation) {
+ const articulation = new Articulation2();
+ articulation.name = gltfArticulation.name;
+ const gltfStages = gltfArticulation.stages;
+ const gltfStagesLength = gltfStages.length;
+ const stages = new Array(gltfStagesLength);
+ for (let i = 0; i < gltfStagesLength; i++) {
+ const stage = loadArticulationStage(gltfStages[i]);
+ stages[i] = stage;
+ }
+ articulation.stages = stages;
+ return articulation;
+}
+function loadArticulations(gltf) {
+ const extensions = defaultValue_default(gltf.extensions, defaultValue_default.EMPTY_OBJECT);
+ const articulationsExtension = extensions.AGI_articulations;
+ if (!defined_default(articulationsExtension)) {
+ return [];
+ }
+ const gltfArticulations = articulationsExtension.articulations;
+ if (!defined_default(gltfArticulations)) {
+ return [];
+ }
+ const gltfArticulationsLength = gltfArticulations.length;
+ const articulations = new Array(gltfArticulationsLength);
+ for (let i = 0; i < gltfArticulationsLength; i++) {
+ const articulation = loadArticulation(gltfArticulations[i]);
+ articulations[i] = articulation;
+ }
+ return articulations;
+}
+function getSceneNodeIds(gltf) {
+ let nodesIds;
+ if (defined_default(gltf.scenes) && defined_default(gltf.scene)) {
+ nodesIds = gltf.scenes[gltf.scene].nodes;
+ }
+ nodesIds = defaultValue_default(nodesIds, gltf.nodes);
+ nodesIds = defined_default(nodesIds) ? nodesIds : [];
+ return nodesIds;
+}
+function loadScene(gltf, nodes) {
+ const scene = new Scene2();
+ const sceneNodeIds = getSceneNodeIds(gltf);
+ scene.nodes = sceneNodeIds.map(function(sceneNodeId) {
+ return nodes[sceneNodeId];
+ });
+ return scene;
+}
+var scratchCenter3 = new Cartesian3_default();
+function parse(loader, gltf, supportedImageFormats, frameState, rejectPromise, rejectTexturesPromise) {
+ const version2 = gltf.asset.version;
+ if (version2 !== "1.0" && version2 !== "2.0") {
+ const url2 = loader._gltfResource.url;
+ throw new RuntimeError_default(
+ `Failed to load ${url2}:
+Unsupported glTF version: ${version2}`
+ );
+ }
+ const extensionsRequired = gltf.extensionsRequired;
+ if (defined_default(extensionsRequired)) {
+ ModelUtility_default.checkSupportedExtensions(extensionsRequired);
+ loader._hasKhrMeshQuantization = extensionsRequired.includes(
+ "KHR_mesh_quantization"
+ );
+ }
+ const extensions = defaultValue_default(gltf.extensions, defaultValue_default.EMPTY_OBJECT);
+ const structuralMetadataExtension = extensions.EXT_structural_metadata;
+ const featureMetadataExtensionLegacy = extensions.EXT_feature_metadata;
+ const cesiumRtcExtension = extensions.CESIUM_RTC;
+ if (defined_default(featureMetadataExtensionLegacy)) {
+ const featureTables = featureMetadataExtensionLegacy.featureTables;
+ const featureTextures = featureMetadataExtensionLegacy.featureTextures;
+ const allPropertyTableIds = defined_default(featureTables) ? featureTables : [];
+ const allFeatureTextureIds = defined_default(featureTextures) ? featureTextures : [];
+ loader._sortedPropertyTableIds = Object.keys(allPropertyTableIds).sort();
+ loader._sortedFeatureTextureIds = Object.keys(allFeatureTextureIds).sort();
+ }
+ const nodes = loadNodes(loader, gltf, supportedImageFormats, frameState);
+ const skins = loadSkins(loader, gltf, nodes);
+ const animations = loadAnimations(loader, gltf, nodes);
+ const articulations = loadArticulations(gltf);
+ const scene = loadScene(gltf, nodes);
+ const components = new Components2();
+ const asset = new Asset2();
+ const copyright = gltf.asset.copyright;
+ if (defined_default(copyright)) {
+ const credits = copyright.split(";").map(function(string) {
+ return new Credit_default(string.trim());
+ });
+ asset.credits = credits;
+ }
+ components.asset = asset;
+ components.scene = scene;
+ components.nodes = nodes;
+ components.skins = skins;
+ components.animations = animations;
+ components.articulations = articulations;
+ components.upAxis = loader._upAxis;
+ components.forwardAxis = loader._forwardAxis;
+ if (defined_default(cesiumRtcExtension)) {
+ const center = Cartesian3_default.fromArray(
+ cesiumRtcExtension.center,
+ 0,
+ scratchCenter3
+ );
+ components.transform = Matrix4_default.fromTranslation(
+ center,
+ components.transform
+ );
+ }
+ loader._components = components;
+ if (defined_default(structuralMetadataExtension) || defined_default(featureMetadataExtensionLegacy)) {
+ const structuralMetadataLoader = loadStructuralMetadata(
+ loader,
+ gltf,
+ structuralMetadataExtension,
+ featureMetadataExtensionLegacy,
+ supportedImageFormats,
+ frameState
+ );
+ const promise = structuralMetadataLoader.promise.then(function(structuralMetadataLoader2) {
+ if (loader.isDestroyed()) {
+ return;
+ }
+ components.structuralMetadata = structuralMetadataLoader2.structuralMetadata;
+ });
+ loader._loaderPromises.push(promise);
+ }
+ const readyPromises = [];
+ readyPromises.push.apply(readyPromises, loader._loaderPromises);
+ if (!loader._incrementallyLoadTextures) {
+ readyPromises.push.apply(readyPromises, loader._texturesPromises);
+ }
+ Promise.all(readyPromises).then(function() {
+ if (loader.isDestroyed()) {
+ return;
+ }
+ loader._state = GltfLoaderState.POST_PROCESSING;
+ }).catch(rejectPromise);
+ Promise.all(loader._texturesPromises).then(function() {
+ if (loader.isDestroyed()) {
+ return;
+ }
+ loader._textureState = GltfLoaderState.PROCESSED;
+ }).catch(rejectTexturesPromise);
+}
+function unloadTextures2(loader) {
+ const textureLoaders = loader._textureLoaders;
+ const textureLoadersLength = textureLoaders.length;
+ for (let i = 0; i < textureLoadersLength; ++i) {
+ ResourceCache_default.unload(textureLoaders[i]);
+ }
+ loader._textureLoaders.length = 0;
+}
+function unloadBufferViews2(loader) {
+ const bufferViewLoaders = loader._bufferViewLoaders;
+ const bufferViewLoadersLength = bufferViewLoaders.length;
+ for (let i = 0; i < bufferViewLoadersLength; ++i) {
+ ResourceCache_default.unload(bufferViewLoaders[i]);
+ }
+ loader._bufferViewLoaders.length = 0;
+}
+function unloadGeometry(loader) {
+ const geometryLoaders = loader._geometryLoaders;
+ const geometryLoadersLength = geometryLoaders.length;
+ for (let i = 0; i < geometryLoadersLength; ++i) {
+ ResourceCache_default.unload(geometryLoaders[i]);
+ }
+ loader._geometryLoaders.length = 0;
+}
+function unloadGeneratedAttributes(loader) {
+ const buffers = loader._postProcessBuffers;
+ const length3 = buffers.length;
+ for (let i = 0; i < length3; i++) {
+ const buffer = buffers[i];
+ if (!buffer.isDestroyed()) {
+ buffer.destroy();
+ }
+ }
+ buffers.length = 0;
+}
+function unloadStructuralMetadata(loader) {
+ if (defined_default(loader._structuralMetadataLoader)) {
+ loader._structuralMetadataLoader.destroy();
+ loader._structuralMetadataLoader = void 0;
+ }
+}
+GltfLoader.prototype.isUnloaded = function() {
+ return this._state === GltfLoaderState.UNLOADED;
+};
+GltfLoader.prototype.unload = function() {
+ if (defined_default(this._gltfJsonLoader)) {
+ ResourceCache_default.unload(this._gltfJsonLoader);
+ }
+ this._gltfJsonLoader = void 0;
+ unloadTextures2(this);
+ unloadBufferViews2(this);
+ unloadGeometry(this);
+ unloadGeneratedAttributes(this);
+ unloadStructuralMetadata(this);
+ this._components = void 0;
+ this._typedArray = void 0;
+ this._state = GltfLoaderState.UNLOADED;
+};
+var GltfLoader_default = GltfLoader;
+
+// Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js
+var PointCloudEyeDomeLighting_default = "#extension GL_EXT_frag_depth : enable\n\nuniform sampler2D u_pointCloud_colorGBuffer;\nuniform sampler2D u_pointCloud_depthGBuffer;\nuniform vec2 u_distanceAndEdlStrength;\nvarying vec2 v_textureCoordinates;\n\nvec2 neighborContribution(float log2Depth, vec2 offset)\n{\n float dist = u_distanceAndEdlStrength.x;\n vec2 texCoordOrig = v_textureCoordinates + offset * dist;\n vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);\n vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);\n\n float depthOrLogDepth0 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord0));\n float depthOrLogDepth1 = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, texCoord1));\n\n // ignore depth values that are the clear depth\n if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {\n return vec2(0.0);\n }\n\n // interpolate the two adjacent depth values\n float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);\n return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);\n}\n\nvoid main()\n{\n float depthOrLogDepth = czm_unpackDepth(texture2D(u_pointCloud_depthGBuffer, v_textureCoordinates));\n\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);\n eyeCoordinate /= eyeCoordinate.w;\n\n float log2Depth = log2(-eyeCoordinate.z);\n\n if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer\n {\n discard;\n }\n\n vec4 color = texture2D(u_pointCloud_colorGBuffer, v_textureCoordinates);\n\n // sample from neighbors left, right, down, up\n vec2 texelSize = 1.0 / czm_viewport.zw;\n\n vec2 responseAndCount = vec2(0.0);\n\n responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));\n responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));\n responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));\n responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));\n\n float response = responseAndCount.x / responseAndCount.y;\n float strength = u_distanceAndEdlStrength.y;\n float shade = exp(-response * 300.0 * strength);\n color.rgb *= shade;\n gl_FragColor = vec4(color);\n\n // Input and output depth are the same.\n gl_FragDepthEXT = depthOrLogDepth;\n}\n";
+
+// Source/Scene/PointCloudEyeDomeLighting.js
+function PointCloudEyeDomeLighting() {
+ this._framebuffer = new FramebufferManager_default({
+ colorAttachmentsLength: 2,
+ depth: true,
+ supportsDepthTexture: true
+ });
+ this._drawCommand = void 0;
+ this._clearCommand = void 0;
+ this._strength = 1;
+ this._radius = 1;
+}
+Object.defineProperties(PointCloudEyeDomeLighting.prototype, {
+ framebuffer: {
+ get: function() {
+ return this._framebuffer.framebuffer;
+ }
+ },
+ colorGBuffer: {
+ get: function() {
+ return this._framebuffer.getColorTexture(0);
+ }
+ },
+ depthGBuffer: {
+ get: function() {
+ return this._framebuffer.getColorTexture(1);
+ }
+ }
+});
+function destroyFramebuffer(processor) {
+ processor._framebuffer.destroy();
+ processor._drawCommand = void 0;
+ processor._clearCommand = void 0;
+}
+var distanceAndEdlStrengthScratch = new Cartesian2_default();
+function createCommands4(processor, context) {
+ const blendFS = new ShaderSource_default({
+ defines: ["LOG_DEPTH_WRITE"],
+ sources: [PointCloudEyeDomeLighting_default]
+ });
+ const blendUniformMap = {
+ u_pointCloud_colorGBuffer: function() {
+ return processor.colorGBuffer;
+ },
+ u_pointCloud_depthGBuffer: function() {
+ return processor.depthGBuffer;
+ },
+ u_distanceAndEdlStrength: function() {
+ distanceAndEdlStrengthScratch.x = processor._radius;
+ distanceAndEdlStrengthScratch.y = processor._strength;
+ return distanceAndEdlStrengthScratch;
+ }
+ };
+ const blendRenderState = RenderState_default.fromCache({
+ blending: BlendingState_default.ALPHA_BLEND,
+ depthMask: true,
+ depthTest: {
+ enabled: true
+ },
+ stencilTest: StencilConstants_default.setCesium3DTileBit(),
+ stencilMask: StencilConstants_default.CESIUM_3D_TILE_MASK
+ });
+ processor._drawCommand = context.createViewportQuadCommand(blendFS, {
+ uniformMap: blendUniformMap,
+ renderState: blendRenderState,
+ pass: Pass_default.CESIUM_3D_TILE,
+ owner: processor
+ });
+ processor._clearCommand = new ClearCommand_default({
+ framebuffer: processor.framebuffer,
+ color: new Color_default(0, 0, 0, 0),
+ depth: 1,
+ renderState: RenderState_default.fromCache(),
+ pass: Pass_default.CESIUM_3D_TILE,
+ owner: processor
+ });
+}
+function createResources(processor, context) {
+ const width = context.drawingBufferWidth;
+ const height = context.drawingBufferHeight;
+ processor._framebuffer.update(context, width, height);
+ createCommands4(processor, context);
+}
+function isSupported(context) {
+ return context.drawBuffers && context.fragmentDepth;
+}
+PointCloudEyeDomeLighting.isSupported = isSupported;
+function getECShaderProgram(context, shaderProgram) {
+ let shader = context.shaderCache.getDerivedShaderProgram(shaderProgram, "EC");
+ if (!defined_default(shader)) {
+ const attributeLocations8 = shaderProgram._attributeLocations;
+ const fs = shaderProgram.fragmentShaderSource.clone();
+ fs.sources = fs.sources.map(function(source) {
+ source = ShaderSource_default.replaceMain(
+ source,
+ "czm_point_cloud_post_process_main"
+ );
+ source = source.replace(/gl_FragColor/g, "gl_FragData[0]");
+ return source;
+ });
+ fs.sources.unshift("#extension GL_EXT_draw_buffers : enable \n");
+ fs.sources.push(
+ "void main() \n{ \n czm_point_cloud_post_process_main(); \n#ifdef LOG_DEPTH\n czm_writeLogDepth();\n gl_FragData[1] = czm_packDepth(gl_FragDepthEXT); \n#else\n gl_FragData[1] = czm_packDepth(gl_FragCoord.z);\n#endif\n}"
+ );
+ shader = context.shaderCache.createDerivedShaderProgram(
+ shaderProgram,
+ "EC",
+ {
+ vertexShaderSource: shaderProgram.vertexShaderSource,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations8
+ }
+ );
+ }
+ return shader;
+}
+PointCloudEyeDomeLighting.prototype.update = function(frameState, commandStart, pointCloudShading, boundingVolume) {
+ if (!isSupported(frameState.context)) {
+ return;
+ }
+ this._strength = pointCloudShading.eyeDomeLightingStrength;
+ this._radius = pointCloudShading.eyeDomeLightingRadius * frameState.pixelRatio;
+ createResources(this, frameState.context);
+ let i;
+ const commandList = frameState.commandList;
+ const commandEnd = commandList.length;
+ for (i = commandStart; i < commandEnd; ++i) {
+ const command = commandList[i];
+ if (command.primitiveType !== PrimitiveType_default.POINTS || command.pass === Pass_default.TRANSLUCENT) {
+ continue;
+ }
+ let derivedCommand;
+ let originalShaderProgram;
+ let derivedCommandObject = command.derivedCommands.pointCloudProcessor;
+ if (defined_default(derivedCommandObject)) {
+ derivedCommand = derivedCommandObject.command;
+ originalShaderProgram = derivedCommandObject.originalShaderProgram;
+ }
+ if (!defined_default(derivedCommand) || command.dirty || originalShaderProgram !== command.shaderProgram || derivedCommand.framebuffer !== this.framebuffer) {
+ derivedCommand = DrawCommand_default.shallowClone(command, derivedCommand);
+ derivedCommand.framebuffer = this.framebuffer;
+ derivedCommand.shaderProgram = getECShaderProgram(
+ frameState.context,
+ command.shaderProgram
+ );
+ derivedCommand.castShadows = false;
+ derivedCommand.receiveShadows = false;
+ if (!defined_default(derivedCommandObject)) {
+ derivedCommandObject = {
+ command: derivedCommand,
+ originalShaderProgram: command.shaderProgram
+ };
+ command.derivedCommands.pointCloudProcessor = derivedCommandObject;
+ }
+ derivedCommandObject.originalShaderProgram = command.shaderProgram;
+ }
+ commandList[i] = derivedCommand;
+ }
+ const clearCommand = this._clearCommand;
+ const blendCommand = this._drawCommand;
+ blendCommand.boundingVolume = boundingVolume;
+ commandList.push(blendCommand);
+ commandList.push(clearCommand);
+};
+PointCloudEyeDomeLighting.prototype.isDestroyed = function() {
+ return false;
+};
+PointCloudEyeDomeLighting.prototype.destroy = function() {
+ destroyFramebuffer(this);
+ return destroyObject_default(this);
+};
+var PointCloudEyeDomeLighting_default2 = PointCloudEyeDomeLighting;
+
+// Source/Scene/PointCloudShading.js
+function PointCloudShading(options) {
+ const pointCloudShading = defaultValue_default(options, {});
+ this.attenuation = defaultValue_default(pointCloudShading.attenuation, false);
+ this.geometricErrorScale = defaultValue_default(
+ pointCloudShading.geometricErrorScale,
+ 1
+ );
+ this.maximumAttenuation = pointCloudShading.maximumAttenuation;
+ this.baseResolution = pointCloudShading.baseResolution;
+ this.eyeDomeLighting = defaultValue_default(pointCloudShading.eyeDomeLighting, true);
+ this.eyeDomeLightingStrength = defaultValue_default(
+ pointCloudShading.eyeDomeLightingStrength,
+ 1
+ );
+ this.eyeDomeLightingRadius = defaultValue_default(
+ pointCloudShading.eyeDomeLightingRadius,
+ 1
+ );
+ this.backFaceCulling = defaultValue_default(pointCloudShading.backFaceCulling, false);
+ this.normalShading = defaultValue_default(pointCloudShading.normalShading, true);
+}
+PointCloudShading.isSupported = function(scene) {
+ return PointCloudEyeDomeLighting_default2.isSupported(scene.context);
+};
+var PointCloudShading_default = PointCloudShading;
+
+// Source/Scene/SceneTransforms.js
+var SceneTransforms = {};
+var actualPositionScratch = new Cartesian4_default(0, 0, 0, 1);
+var positionCC = new Cartesian4_default();
+var scratchViewport2 = new BoundingRectangle_default();
+var scratchWindowCoord0 = new Cartesian2_default();
+var scratchWindowCoord1 = new Cartesian2_default();
+SceneTransforms.wgs84ToWindowCoordinates = function(scene, position, result) {
+ return SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(
+ scene,
+ position,
+ Cartesian3_default.ZERO,
+ result
+ );
+};
+var scratchCartesian42 = new Cartesian4_default();
+var scratchEyeOffset = new Cartesian3_default();
+function worldToClip(position, eyeOffset, camera, result) {
+ const viewMatrix = camera.viewMatrix;
+ const positionEC = Matrix4_default.multiplyByVector(
+ viewMatrix,
+ Cartesian4_default.fromElements(
+ position.x,
+ position.y,
+ position.z,
+ 1,
+ scratchCartesian42
+ ),
+ scratchCartesian42
+ );
+ const zEyeOffset = Cartesian3_default.multiplyComponents(
+ eyeOffset,
+ Cartesian3_default.normalize(positionEC, scratchEyeOffset),
+ scratchEyeOffset
+ );
+ positionEC.x += eyeOffset.x + zEyeOffset.x;
+ positionEC.y += eyeOffset.y + zEyeOffset.y;
+ positionEC.z += zEyeOffset.z;
+ return Matrix4_default.multiplyByVector(
+ camera.frustum.projectionMatrix,
+ positionEC,
+ result
+ );
+}
+var scratchMaxCartographic = new Cartographic_default(
+ Math.PI,
+ Math_default.PI_OVER_TWO
+);
+var scratchProjectedCartesian = new Cartesian3_default();
+var scratchCameraPosition = new Cartesian3_default();
+SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates = function(scene, position, eyeOffset, result) {
+ if (!defined_default(scene)) {
+ throw new DeveloperError_default("scene is required.");
+ }
+ if (!defined_default(position)) {
+ throw new DeveloperError_default("position is required.");
+ }
+ const frameState = scene.frameState;
+ const actualPosition = SceneTransforms.computeActualWgs84Position(
+ frameState,
+ position,
+ actualPositionScratch
+ );
+ if (!defined_default(actualPosition)) {
+ return void 0;
+ }
+ const canvas = scene.canvas;
+ const viewport = scratchViewport2;
+ viewport.x = 0;
+ viewport.y = 0;
+ viewport.width = canvas.clientWidth;
+ viewport.height = canvas.clientHeight;
+ const camera = scene.camera;
+ let cameraCentered = false;
+ if (frameState.mode === SceneMode_default.SCENE2D) {
+ const projection = scene.mapProjection;
+ const maxCartographic = scratchMaxCartographic;
+ const maxCoord = projection.project(
+ maxCartographic,
+ scratchProjectedCartesian
+ );
+ const cameraPosition = Cartesian3_default.clone(
+ camera.position,
+ scratchCameraPosition
+ );
+ const frustum = camera.frustum.clone();
+ const viewportTransformation = Matrix4_default.computeViewportTransformation(
+ viewport,
+ 0,
+ 1,
+ new Matrix4_default()
+ );
+ const projectionMatrix = camera.frustum.projectionMatrix;
+ const x = camera.positionWC.y;
+ const eyePoint = Cartesian3_default.fromElements(
+ Math_default.sign(x) * maxCoord.x - x,
+ 0,
+ -camera.positionWC.x
+ );
+ const windowCoordinates = Transforms_default.pointToGLWindowCoordinates(
+ projectionMatrix,
+ viewportTransformation,
+ eyePoint
+ );
+ if (x === 0 || windowCoordinates.x <= 0 || windowCoordinates.x >= canvas.clientWidth) {
+ cameraCentered = true;
+ } else {
+ if (windowCoordinates.x > canvas.clientWidth * 0.5) {
+ viewport.width = windowCoordinates.x;
+ camera.frustum.right = maxCoord.x - x;
+ positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);
+ SceneTransforms.clipToGLWindowCoordinates(
+ viewport,
+ positionCC,
+ scratchWindowCoord0
+ );
+ viewport.x += windowCoordinates.x;
+ camera.position.x = -camera.position.x;
+ const right = camera.frustum.right;
+ camera.frustum.right = -camera.frustum.left;
+ camera.frustum.left = -right;
+ positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);
+ SceneTransforms.clipToGLWindowCoordinates(
+ viewport,
+ positionCC,
+ scratchWindowCoord1
+ );
+ } else {
+ viewport.x += windowCoordinates.x;
+ viewport.width -= windowCoordinates.x;
+ camera.frustum.left = -maxCoord.x - x;
+ positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);
+ SceneTransforms.clipToGLWindowCoordinates(
+ viewport,
+ positionCC,
+ scratchWindowCoord0
+ );
+ viewport.x = viewport.x - viewport.width;
+ camera.position.x = -camera.position.x;
+ const left = camera.frustum.left;
+ camera.frustum.left = -camera.frustum.right;
+ camera.frustum.right = -left;
+ positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);
+ SceneTransforms.clipToGLWindowCoordinates(
+ viewport,
+ positionCC,
+ scratchWindowCoord1
+ );
+ }
+ Cartesian3_default.clone(cameraPosition, camera.position);
+ camera.frustum = frustum.clone();
+ result = Cartesian2_default.clone(scratchWindowCoord0, result);
+ if (result.x < 0 || result.x > canvas.clientWidth) {
+ result.x = scratchWindowCoord1.x;
+ }
+ }
+ }
+ if (frameState.mode !== SceneMode_default.SCENE2D || cameraCentered) {
+ positionCC = worldToClip(actualPosition, eyeOffset, camera, positionCC);
+ if (positionCC.z < 0 && !(camera.frustum instanceof OrthographicFrustum_default) && !(camera.frustum instanceof OrthographicOffCenterFrustum_default)) {
+ return void 0;
+ }
+ result = SceneTransforms.clipToGLWindowCoordinates(
+ viewport,
+ positionCC,
+ result
+ );
+ }
+ result.y = canvas.clientHeight - result.y;
+ return result;
+};
+SceneTransforms.wgs84ToDrawingBufferCoordinates = function(scene, position, result) {
+ result = SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);
+ if (!defined_default(result)) {
+ return void 0;
+ }
+ return SceneTransforms.transformWindowToDrawingBuffer(scene, result, result);
+};
+var projectedPosition = new Cartesian3_default();
+var positionInCartographic = new Cartographic_default();
+SceneTransforms.computeActualWgs84Position = function(frameState, position, result) {
+ const mode2 = frameState.mode;
+ if (mode2 === SceneMode_default.SCENE3D) {
+ return Cartesian3_default.clone(position, result);
+ }
+ const projection = frameState.mapProjection;
+ const cartographic2 = projection.ellipsoid.cartesianToCartographic(
+ position,
+ positionInCartographic
+ );
+ if (!defined_default(cartographic2)) {
+ return void 0;
+ }
+ projection.project(cartographic2, projectedPosition);
+ if (mode2 === SceneMode_default.COLUMBUS_VIEW) {
+ return Cartesian3_default.fromElements(
+ projectedPosition.z,
+ projectedPosition.x,
+ projectedPosition.y,
+ result
+ );
+ }
+ if (mode2 === SceneMode_default.SCENE2D) {
+ return Cartesian3_default.fromElements(
+ 0,
+ projectedPosition.x,
+ projectedPosition.y,
+ result
+ );
+ }
+ const morphTime = frameState.morphTime;
+ return Cartesian3_default.fromElements(
+ Math_default.lerp(projectedPosition.z, position.x, morphTime),
+ Math_default.lerp(projectedPosition.x, position.y, morphTime),
+ Math_default.lerp(projectedPosition.y, position.z, morphTime),
+ result
+ );
+};
+var positionNDC = new Cartesian3_default();
+var positionWC = new Cartesian3_default();
+var viewportTransform = new Matrix4_default();
+SceneTransforms.clipToGLWindowCoordinates = function(viewport, position, result) {
+ Cartesian3_default.divideByScalar(position, position.w, positionNDC);
+ Matrix4_default.computeViewportTransformation(viewport, 0, 1, viewportTransform);
+ Matrix4_default.multiplyByPoint(viewportTransform, positionNDC, positionWC);
+ return Cartesian2_default.fromCartesian3(positionWC, result);
+};
+SceneTransforms.transformWindowToDrawingBuffer = function(scene, windowPosition, result) {
+ const canvas = scene.canvas;
+ const xScale = scene.drawingBufferWidth / canvas.clientWidth;
+ const yScale = scene.drawingBufferHeight / canvas.clientHeight;
+ return Cartesian2_default.fromElements(
+ windowPosition.x * xScale,
+ windowPosition.y * yScale,
+ result
+ );
+};
+var scratchNDC = new Cartesian4_default();
+var scratchWorldCoords = new Cartesian4_default();
+SceneTransforms.drawingBufferToWgs84Coordinates = function(scene, drawingBufferPosition, depth, result) {
+ const context = scene.context;
+ const uniformState = context.uniformState;
+ const currentFrustum = uniformState.currentFrustum;
+ const near = currentFrustum.x;
+ const far = currentFrustum.y;
+ if (scene.frameState.useLogDepth) {
+ const log2Depth = depth * uniformState.log2FarDepthFromNearPlusOne;
+ const depthFromNear = Math.pow(2, log2Depth) - 1;
+ depth = far * (1 - near / (depthFromNear + near)) / (far - near);
+ }
+ const viewport = scene.view.passState.viewport;
+ const ndc = Cartesian4_default.clone(Cartesian4_default.UNIT_W, scratchNDC);
+ ndc.x = (drawingBufferPosition.x - viewport.x) / viewport.width * 2 - 1;
+ ndc.y = (drawingBufferPosition.y - viewport.y) / viewport.height * 2 - 1;
+ ndc.z = depth * 2 - 1;
+ ndc.w = 1;
+ let worldCoords;
+ let frustum = scene.camera.frustum;
+ if (!defined_default(frustum.fovy)) {
+ if (defined_default(frustum._offCenterFrustum)) {
+ frustum = frustum._offCenterFrustum;
+ }
+ worldCoords = scratchWorldCoords;
+ worldCoords.x = (ndc.x * (frustum.right - frustum.left) + frustum.left + frustum.right) * 0.5;
+ worldCoords.y = (ndc.y * (frustum.top - frustum.bottom) + frustum.bottom + frustum.top) * 0.5;
+ worldCoords.z = (ndc.z * (near - far) - near - far) * 0.5;
+ worldCoords.w = 1;
+ worldCoords = Matrix4_default.multiplyByVector(
+ uniformState.inverseView,
+ worldCoords,
+ worldCoords
+ );
+ } else {
+ worldCoords = Matrix4_default.multiplyByVector(
+ uniformState.inverseViewProjection,
+ ndc,
+ scratchWorldCoords
+ );
+ const w = 1 / worldCoords.w;
+ Cartesian3_default.multiplyByScalar(worldCoords, w, worldCoords);
+ }
+ return Cartesian3_default.fromCartesian4(worldCoords, result);
+};
+var SceneTransforms_default = SceneTransforms;
+
+// Source/Scene/SplitDirection.js
+var SplitDirection = {
+ LEFT: -1,
+ NONE: 0,
+ RIGHT: 1
+};
+var SplitDirection_default = Object.freeze(SplitDirection);
+
+// Source/Scene/B3dmParser.js
+var B3dmParser = {};
+B3dmParser._deprecationWarning = deprecationWarning_default;
+var sizeOfUint324 = Uint32Array.BYTES_PER_ELEMENT;
+B3dmParser.parse = function(arrayBuffer, byteOffset) {
+ const byteStart = defaultValue_default(byteOffset, 0);
+ Check_default.defined("arrayBuffer", arrayBuffer);
+ byteOffset = byteStart;
+ const uint8Array = new Uint8Array(arrayBuffer);
+ const view = new DataView(arrayBuffer);
+ byteOffset += sizeOfUint324;
+ const version2 = view.getUint32(byteOffset, true);
+ if (version2 !== 1) {
+ throw new RuntimeError_default(
+ `Only Batched 3D Model version 1 is supported. Version ${version2} is not.`
+ );
+ }
+ byteOffset += sizeOfUint324;
+ const byteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint324;
+ let featureTableJsonByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint324;
+ let featureTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint324;
+ let batchTableJsonByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint324;
+ let batchTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint324;
+ let batchLength;
+ if (batchTableJsonByteLength >= 570425344) {
+ byteOffset -= sizeOfUint324 * 2;
+ batchLength = featureTableJsonByteLength;
+ batchTableJsonByteLength = featureTableBinaryByteLength;
+ batchTableBinaryByteLength = 0;
+ featureTableJsonByteLength = 0;
+ featureTableBinaryByteLength = 0;
+ B3dmParser._deprecationWarning(
+ "b3dm-legacy-header",
+ "This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."
+ );
+ } else if (batchTableBinaryByteLength >= 570425344) {
+ byteOffset -= sizeOfUint324;
+ batchLength = batchTableJsonByteLength;
+ batchTableJsonByteLength = featureTableJsonByteLength;
+ batchTableBinaryByteLength = featureTableBinaryByteLength;
+ featureTableJsonByteLength = 0;
+ featureTableBinaryByteLength = 0;
+ B3dmParser._deprecationWarning(
+ "b3dm-legacy-header",
+ "This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."
+ );
+ }
+ let featureTableJson;
+ if (featureTableJsonByteLength === 0) {
+ featureTableJson = {
+ BATCH_LENGTH: defaultValue_default(batchLength, 0)
+ };
+ } else {
+ featureTableJson = getJsonFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ featureTableJsonByteLength
+ );
+ byteOffset += featureTableJsonByteLength;
+ }
+ const featureTableBinary = new Uint8Array(
+ arrayBuffer,
+ byteOffset,
+ featureTableBinaryByteLength
+ );
+ byteOffset += featureTableBinaryByteLength;
+ let batchTableJson;
+ let batchTableBinary;
+ if (batchTableJsonByteLength > 0) {
+ batchTableJson = getJsonFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ batchTableJsonByteLength
+ );
+ byteOffset += batchTableJsonByteLength;
+ if (batchTableBinaryByteLength > 0) {
+ batchTableBinary = new Uint8Array(
+ arrayBuffer,
+ byteOffset,
+ batchTableBinaryByteLength
+ );
+ batchTableBinary = new Uint8Array(batchTableBinary);
+ byteOffset += batchTableBinaryByteLength;
+ }
+ }
+ const gltfByteLength = byteStart + byteLength - byteOffset;
+ if (gltfByteLength === 0) {
+ throw new RuntimeError_default("glTF byte length must be greater than 0.");
+ }
+ let gltfView;
+ if (byteOffset % 4 === 0) {
+ gltfView = new Uint8Array(arrayBuffer, byteOffset, gltfByteLength);
+ } else {
+ B3dmParser._deprecationWarning(
+ "b3dm-glb-unaligned",
+ "The embedded glb is not aligned to a 4-byte boundary."
+ );
+ gltfView = new Uint8Array(
+ uint8Array.subarray(byteOffset, byteOffset + gltfByteLength)
+ );
+ }
+ return {
+ batchLength,
+ featureTableJson,
+ featureTableBinary,
+ batchTableJson,
+ batchTableBinary,
+ gltf: gltfView
+ };
+};
+var B3dmParser_default = B3dmParser;
+
+// Source/Scene/Cesium3DTileFeatureTable.js
+function Cesium3DTileFeatureTable(featureTableJson, featureTableBinary) {
+ this.json = featureTableJson;
+ this.buffer = featureTableBinary;
+ this._cachedTypedArrays = {};
+ this.featuresLength = 0;
+}
+function getTypedArrayFromBinary(featureTable, semantic, componentType, componentLength, count, byteOffset) {
+ const cachedTypedArrays = featureTable._cachedTypedArrays;
+ let typedArray = cachedTypedArrays[semantic];
+ if (!defined_default(typedArray)) {
+ typedArray = ComponentDatatype_default.createArrayBufferView(
+ componentType,
+ featureTable.buffer.buffer,
+ featureTable.buffer.byteOffset + byteOffset,
+ count * componentLength
+ );
+ cachedTypedArrays[semantic] = typedArray;
+ }
+ return typedArray;
+}
+function getTypedArrayFromArray(featureTable, semantic, componentType, array) {
+ const cachedTypedArrays = featureTable._cachedTypedArrays;
+ let typedArray = cachedTypedArrays[semantic];
+ if (!defined_default(typedArray)) {
+ typedArray = ComponentDatatype_default.createTypedArray(componentType, array);
+ cachedTypedArrays[semantic] = typedArray;
+ }
+ return typedArray;
+}
+Cesium3DTileFeatureTable.prototype.getGlobalProperty = function(semantic, componentType, componentLength) {
+ const jsonValue = this.json[semantic];
+ if (!defined_default(jsonValue)) {
+ return void 0;
+ }
+ if (defined_default(jsonValue.byteOffset)) {
+ componentType = defaultValue_default(componentType, ComponentDatatype_default.UNSIGNED_INT);
+ componentLength = defaultValue_default(componentLength, 1);
+ return getTypedArrayFromBinary(
+ this,
+ semantic,
+ componentType,
+ componentLength,
+ 1,
+ jsonValue.byteOffset
+ );
+ }
+ return jsonValue;
+};
+Cesium3DTileFeatureTable.prototype.hasProperty = function(semantic) {
+ return defined_default(this.json[semantic]);
+};
+Cesium3DTileFeatureTable.prototype.getPropertyArray = function(semantic, componentType, componentLength) {
+ const jsonValue = this.json[semantic];
+ if (!defined_default(jsonValue)) {
+ return void 0;
+ }
+ if (defined_default(jsonValue.byteOffset)) {
+ if (defined_default(jsonValue.componentType)) {
+ componentType = ComponentDatatype_default.fromName(jsonValue.componentType);
+ }
+ return getTypedArrayFromBinary(
+ this,
+ semantic,
+ componentType,
+ componentLength,
+ this.featuresLength,
+ jsonValue.byteOffset
+ );
+ }
+ return getTypedArrayFromArray(this, semantic, componentType, jsonValue);
+};
+Cesium3DTileFeatureTable.prototype.getProperty = function(semantic, componentType, componentLength, featureId, result) {
+ const jsonValue = this.json[semantic];
+ if (!defined_default(jsonValue)) {
+ return void 0;
+ }
+ const typedArray = this.getPropertyArray(
+ semantic,
+ componentType,
+ componentLength
+ );
+ if (componentLength === 1) {
+ return typedArray[featureId];
+ }
+ for (let i = 0; i < componentLength; ++i) {
+ result[i] = typedArray[componentLength * featureId + i];
+ }
+ return result;
+};
+var Cesium3DTileFeatureTable_default = Cesium3DTileFeatureTable;
+
+// Source/Scene/parseBatchTable.js
+function parseBatchTable(options) {
+ Check_default.typeOf.number("options.count", options.count);
+ Check_default.typeOf.object("options.batchTable", options.batchTable);
+ const featureCount = options.count;
+ const batchTable = options.batchTable;
+ const binaryBody = options.binaryBody;
+ const parseAsPropertyAttributes = defaultValue_default(
+ options.parseAsPropertyAttributes,
+ false
+ );
+ const customAttributeOutput = options.customAttributeOutput;
+ if (parseAsPropertyAttributes && !defined_default(customAttributeOutput)) {
+ throw new DeveloperError_default(
+ "customAttributeOutput is required when parsing batch table as property attributes"
+ );
+ }
+ const partitionResults = partitionProperties(batchTable);
+ let jsonMetadataTable;
+ if (defined_default(partitionResults.jsonProperties)) {
+ jsonMetadataTable = new JsonMetadataTable_default({
+ count: featureCount,
+ properties: partitionResults.jsonProperties
+ });
+ }
+ let hierarchy;
+ if (defined_default(partitionResults.hierarchy)) {
+ hierarchy = new BatchTableHierarchy_default({
+ extension: partitionResults.hierarchy,
+ binaryBody
+ });
+ }
+ const className = MetadataClass_default.BATCH_TABLE_CLASS_NAME;
+ const binaryProperties = partitionResults.binaryProperties;
+ let metadataTable;
+ let propertyAttributes;
+ let transcodedSchema;
+ if (parseAsPropertyAttributes) {
+ const attributeResults = transcodeBinaryPropertiesAsPropertyAttributes(
+ featureCount,
+ className,
+ binaryProperties,
+ binaryBody,
+ customAttributeOutput
+ );
+ transcodedSchema = attributeResults.transcodedSchema;
+ const propertyAttribute = new PropertyAttribute_default({
+ propertyAttribute: attributeResults.propertyAttributeJson,
+ class: attributeResults.transcodedClass
+ });
+ propertyAttributes = [propertyAttribute];
+ } else {
+ const binaryResults = transcodeBinaryProperties(
+ featureCount,
+ className,
+ binaryProperties,
+ binaryBody
+ );
+ transcodedSchema = binaryResults.transcodedSchema;
+ const featureTableJson = binaryResults.featureTableJson;
+ metadataTable = new MetadataTable_default({
+ count: featureTableJson.count,
+ properties: featureTableJson.properties,
+ class: binaryResults.transcodedClass,
+ bufferViews: binaryResults.bufferViewsTypedArrays
+ });
+ propertyAttributes = [];
+ }
+ const propertyTables = [];
+ if (defined_default(metadataTable) || defined_default(jsonMetadataTable) || defined_default(hierarchy)) {
+ const propertyTable = new PropertyTable_default({
+ id: 0,
+ name: "Batch Table",
+ count: featureCount,
+ metadataTable,
+ jsonMetadataTable,
+ batchTableHierarchy: hierarchy
+ });
+ propertyTables.push(propertyTable);
+ }
+ const metadataOptions = {
+ schema: transcodedSchema,
+ propertyTables,
+ propertyAttributes,
+ extensions: partitionResults.extensions,
+ extras: partitionResults.extras
+ };
+ return new StructuralMetadata_default(metadataOptions);
+}
+function partitionProperties(batchTable) {
+ const legacyHierarchy = batchTable.HIERARCHY;
+ const extras = batchTable.extras;
+ const extensions = batchTable.extensions;
+ let hierarchyExtension;
+ if (defined_default(legacyHierarchy)) {
+ parseBatchTable._deprecationWarning(
+ "batchTableHierarchyExtension",
+ "The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."
+ );
+ hierarchyExtension = legacyHierarchy;
+ } else if (defined_default(extensions)) {
+ hierarchyExtension = extensions["3DTILES_batch_table_hierarchy"];
+ }
+ let jsonProperties;
+ const binaryProperties = {};
+ for (const propertyId in batchTable) {
+ if (!batchTable.hasOwnProperty(propertyId) || propertyId === "HIERARCHY" || propertyId === "extensions" || propertyId === "extras") {
+ continue;
+ }
+ const property = batchTable[propertyId];
+ if (Array.isArray(property)) {
+ jsonProperties = defined_default(jsonProperties) ? jsonProperties : {};
+ jsonProperties[propertyId] = property;
+ } else {
+ binaryProperties[propertyId] = property;
+ }
+ }
+ return {
+ binaryProperties,
+ jsonProperties,
+ hierarchy: hierarchyExtension,
+ extras,
+ extensions
+ };
+}
+function transcodeBinaryProperties(featureCount, className, binaryProperties, binaryBody) {
+ const classProperties = {};
+ const featureTableProperties = {};
+ const bufferViewsTypedArrays = {};
+ let bufferViewCount = 0;
+ for (const propertyId in binaryProperties) {
+ if (!binaryProperties.hasOwnProperty(propertyId)) {
+ continue;
+ }
+ if (!defined_default(binaryBody)) {
+ throw new RuntimeError_default(
+ `Property ${propertyId} requires a batch table binary.`
+ );
+ }
+ const property = binaryProperties[propertyId];
+ const binaryAccessor = getBinaryAccessor_default(property);
+ featureTableProperties[propertyId] = {
+ bufferView: bufferViewCount
+ };
+ classProperties[propertyId] = transcodePropertyType(property);
+ bufferViewsTypedArrays[bufferViewCount] = binaryAccessor.createArrayBufferView(
+ binaryBody.buffer,
+ binaryBody.byteOffset + property.byteOffset,
+ featureCount
+ );
+ bufferViewCount++;
+ }
+ const schemaJson = {
+ classes: {}
+ };
+ schemaJson.classes[className] = {
+ properties: classProperties
+ };
+ const transcodedSchema = new MetadataSchema_default(schemaJson);
+ const featureTableJson = {
+ class: className,
+ count: featureCount,
+ properties: featureTableProperties
+ };
+ return {
+ featureTableJson,
+ bufferViewsTypedArrays,
+ transcodedSchema,
+ transcodedClass: transcodedSchema.classes[className]
+ };
+}
+function transcodeBinaryPropertiesAsPropertyAttributes(featureCount, className, binaryProperties, binaryBody, customAttributeOutput) {
+ const classProperties = {};
+ const propertyAttributeProperties = {};
+ let nextPlaceholderId = 0;
+ for (const propertyId in binaryProperties) {
+ if (!binaryProperties.hasOwnProperty(propertyId)) {
+ continue;
+ }
+ const property = binaryProperties[propertyId];
+ if (!defined_default(binaryBody) && !defined_default(property.typedArray)) {
+ throw new RuntimeError_default(
+ `Property ${propertyId} requires a batch table binary.`
+ );
+ }
+ let sanitizedPropertyId = ModelUtility_default.sanitizeGlslIdentifier(propertyId);
+ if (sanitizedPropertyId === "" || classProperties.hasOwnProperty(sanitizedPropertyId)) {
+ sanitizedPropertyId = `property_${nextPlaceholderId}`;
+ nextPlaceholderId++;
+ }
+ const classProperty = transcodePropertyType(property);
+ classProperty.name = propertyId;
+ classProperties[sanitizedPropertyId] = classProperty;
+ let customAttributeName = sanitizedPropertyId.toUpperCase();
+ if (!customAttributeName.startsWith("_")) {
+ customAttributeName = `_${customAttributeName}`;
+ }
+ let attributeTypedArray = property.typedArray;
+ if (!defined_default(attributeTypedArray)) {
+ const binaryAccessor = getBinaryAccessor_default(property);
+ attributeTypedArray = binaryAccessor.createArrayBufferView(
+ binaryBody.buffer,
+ binaryBody.byteOffset + property.byteOffset,
+ featureCount
+ );
+ }
+ const attribute = new ModelComponents_default.Attribute();
+ attribute.name = customAttributeName;
+ attribute.count = featureCount;
+ attribute.type = property.type;
+ attribute.componentDatatype = ComponentDatatype_default.fromTypedArray(
+ attributeTypedArray
+ );
+ attribute.typedArray = attributeTypedArray;
+ customAttributeOutput.push(attribute);
+ propertyAttributeProperties[sanitizedPropertyId] = {
+ attribute: customAttributeName
+ };
+ }
+ const schemaJson = {
+ classes: {}
+ };
+ schemaJson.classes[className] = {
+ properties: classProperties
+ };
+ const transcodedSchema = new MetadataSchema_default(schemaJson);
+ const propertyAttributeJson = {
+ properties: propertyAttributeProperties
+ };
+ return {
+ class: className,
+ propertyAttributeJson,
+ transcodedSchema,
+ transcodedClass: transcodedSchema.classes[className]
+ };
+}
+function transcodePropertyType(property) {
+ const componentType = transcodeComponentType(property.componentType);
+ return {
+ type: property.type,
+ componentType
+ };
+}
+function transcodeComponentType(componentType) {
+ switch (componentType) {
+ case "BYTE":
+ return "INT8";
+ case "UNSIGNED_BYTE":
+ return "UINT8";
+ case "SHORT":
+ return "INT16";
+ case "UNSIGNED_SHORT":
+ return "UINT16";
+ case "INT":
+ return "INT32";
+ case "UNSIGNED_INT":
+ return "UINT32";
+ case "FLOAT":
+ return "FLOAT32";
+ case "DOUBLE":
+ return "FLOAT64";
+ }
+}
+parseBatchTable._deprecationWarning = deprecationWarning_default;
+var parseBatchTable_default = parseBatchTable;
+
+// Source/Scene/Model/B3dmLoader.js
+var B3dmLoaderState = {
+ UNLOADED: 0,
+ LOADING: 1,
+ PROCESSING: 2,
+ READY: 3,
+ FAILED: 4
+};
+var FeatureIdAttribute3 = ModelComponents_default.FeatureIdAttribute;
+function B3dmLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const b3dmResource = options.b3dmResource;
+ let baseResource2 = options.baseResource;
+ const arrayBuffer = options.arrayBuffer;
+ const byteOffset = defaultValue_default(options.byteOffset, 0);
+ const releaseGltfJson = defaultValue_default(options.releaseGltfJson, false);
+ const asynchronous = defaultValue_default(options.asynchronous, true);
+ const incrementallyLoadTextures = defaultValue_default(
+ options.incrementallyLoadTextures,
+ true
+ );
+ const upAxis = defaultValue_default(options.upAxis, Axis_default.Y);
+ const forwardAxis = defaultValue_default(options.forwardAxis, Axis_default.X);
+ const loadAttributesAsTypedArray = defaultValue_default(
+ options.loadAttributesAsTypedArray,
+ false
+ );
+ const loadAttributesFor2D = defaultValue_default(options.loadAttributesFor2D, false);
+ const loadIndicesForWireframe = defaultValue_default(
+ options.loadIndicesForWireframe,
+ false
+ );
+ const loadPrimitiveOutline2 = defaultValue_default(options.loadPrimitiveOutline, true);
+ const loadForClassification = defaultValue_default(
+ options.loadForClassification,
+ false
+ );
+ Check_default.typeOf.object("options.b3dmResource", b3dmResource);
+ Check_default.typeOf.object("options.arrayBuffer", arrayBuffer);
+ baseResource2 = defined_default(baseResource2) ? baseResource2 : b3dmResource.clone();
+ this._b3dmResource = b3dmResource;
+ this._baseResource = baseResource2;
+ this._arrayBuffer = arrayBuffer;
+ this._byteOffset = byteOffset;
+ this._releaseGltfJson = releaseGltfJson;
+ this._asynchronous = asynchronous;
+ this._incrementallyLoadTextures = incrementallyLoadTextures;
+ this._upAxis = upAxis;
+ this._forwardAxis = forwardAxis;
+ this._loadAttributesAsTypedArray = loadAttributesAsTypedArray;
+ this._loadAttributesFor2D = loadAttributesFor2D;
+ this._loadIndicesForWireframe = loadIndicesForWireframe;
+ this._loadPrimitiveOutline = loadPrimitiveOutline2;
+ this._loadForClassification = loadForClassification;
+ this._state = B3dmLoaderState.UNLOADED;
+ this._promise = void 0;
+ this._gltfLoader = void 0;
+ this._batchLength = 0;
+ this._propertyTable = void 0;
+ this._batchTable = void 0;
+ this._components = void 0;
+ this._transform = Matrix4_default.IDENTITY;
+}
+if (defined_default(Object.create)) {
+ B3dmLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ B3dmLoader.prototype.constructor = B3dmLoader;
+}
+Object.defineProperties(B3dmLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ texturesLoadedPromise: {
+ get: function() {
+ return this._gltfLoader.texturesLoadedPromise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return void 0;
+ }
+ },
+ components: {
+ get: function() {
+ return this._components;
+ }
+ }
+});
+B3dmLoader.prototype.load = function() {
+ const b3dm = B3dmParser_default.parse(this._arrayBuffer, this._byteOffset);
+ let batchLength = b3dm.batchLength;
+ const featureTableJson = b3dm.featureTableJson;
+ const featureTableBinary = b3dm.featureTableBinary;
+ const batchTableJson = b3dm.batchTableJson;
+ const batchTableBinary = b3dm.batchTableBinary;
+ const featureTable = new Cesium3DTileFeatureTable_default(
+ featureTableJson,
+ featureTableBinary
+ );
+ batchLength = featureTable.getGlobalProperty("BATCH_LENGTH");
+ this._batchLength = batchLength;
+ const rtcCenter = featureTable.getGlobalProperty(
+ "RTC_CENTER",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ if (defined_default(rtcCenter)) {
+ this._transform = Matrix4_default.fromTranslation(Cartesian3_default.fromArray(rtcCenter));
+ }
+ this._batchTable = {
+ json: batchTableJson,
+ binary: batchTableBinary
+ };
+ const gltfLoader = new GltfLoader_default({
+ typedArray: b3dm.gltf,
+ upAxis: this._upAxis,
+ forwardAxis: this._forwardAxis,
+ gltfResource: this._b3dmResource,
+ baseResource: this._baseResource,
+ releaseGltfJson: this._releaseGltfJson,
+ incrementallyLoadTextures: this._incrementallyLoadTextures,
+ loadAttributesAsTypedArray: this._loadAttributesAsTypedArray,
+ loadAttributesFor2D: this._loadAttributesFor2D,
+ loadIndicesForWireframe: this._loadIndicesForWireframe,
+ loadPrimitiveOutline: this._loadPrimitiveOutline,
+ loadForClassification: this._loadForClassification,
+ renameBatchIdSemantic: true
+ });
+ this._gltfLoader = gltfLoader;
+ this._state = B3dmLoaderState.LOADING;
+ const that = this;
+ gltfLoader.load();
+ this._promise = gltfLoader.promise.then(function() {
+ if (that.isDestroyed()) {
+ return;
+ }
+ const components = gltfLoader.components;
+ components.transform = Matrix4_default.multiplyTransformation(
+ that._transform,
+ components.transform,
+ components.transform
+ );
+ createStructuralMetadata(that, components);
+ that._components = components;
+ that._arrayBuffer = void 0;
+ that._state = B3dmLoaderState.READY;
+ return that;
+ }).catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ return handleError7(that, error);
+ });
+ return this._promise;
+};
+function handleError7(b3dmLoader, error) {
+ b3dmLoader.unload();
+ b3dmLoader._state = B3dmLoaderState.FAILED;
+ const errorMessage = "Failed to load b3dm";
+ error = b3dmLoader.getError(errorMessage, error);
+ return Promise.reject(error);
+}
+B3dmLoader.prototype.process = function(frameState) {
+ Check_default.typeOf.object("frameState", frameState);
+ if (this._state === B3dmLoaderState.LOADING) {
+ this._state = B3dmLoaderState.PROCESSING;
+ }
+ if (this._state === B3dmLoaderState.PROCESSING) {
+ this._gltfLoader.process(frameState);
+ }
+};
+function createStructuralMetadata(loader, components) {
+ const batchTable = loader._batchTable;
+ const batchLength = loader._batchLength;
+ if (batchLength === 0) {
+ return;
+ }
+ let structuralMetadata;
+ if (defined_default(batchTable.json)) {
+ structuralMetadata = parseBatchTable_default({
+ count: batchLength,
+ batchTable: batchTable.json,
+ binaryBody: batchTable.binary
+ });
+ } else {
+ const emptyPropertyTable = new PropertyTable_default({
+ name: MetadataClass_default.BATCH_TABLE_CLASS_NAME,
+ count: batchLength
+ });
+ structuralMetadata = new StructuralMetadata_default({
+ schema: {},
+ propertyTables: [emptyPropertyTable]
+ });
+ }
+ const nodes = components.scene.nodes;
+ const length3 = nodes.length;
+ for (let i = 0; i < length3; i++) {
+ processNode(nodes[i]);
+ }
+ components.structuralMetadata = structuralMetadata;
+}
+function processNode(node) {
+ const childrenLength = node.children.length;
+ for (let i = 0; i < childrenLength; i++) {
+ processNode(node.children[i]);
+ }
+ const primitivesLength = node.primitives.length;
+ for (let i = 0; i < primitivesLength; i++) {
+ const primitive = node.primitives[i];
+ const featureIdVertexAttribute = ModelUtility_default.getAttributeBySemantic(
+ primitive,
+ VertexAttributeSemantic_default.FEATURE_ID
+ );
+ if (defined_default(featureIdVertexAttribute)) {
+ featureIdVertexAttribute.setIndex = 0;
+ const featureIdAttribute = new FeatureIdAttribute3();
+ featureIdAttribute.propertyTableId = 0;
+ featureIdAttribute.setIndex = 0;
+ featureIdAttribute.positionalLabel = "featureId_0";
+ primitive.featureIds.push(featureIdAttribute);
+ }
+ }
+}
+B3dmLoader.prototype.unload = function() {
+ if (defined_default(this._gltfLoader)) {
+ this._gltfLoader.unload();
+ }
+ this._components = void 0;
+ this._arrayBuffer = void 0;
+};
+var B3dmLoader_default = B3dmLoader;
+
+// Source/Scene/Model/GeoJsonLoader.js
+function GeoJsonLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.typeOf.object("options.geoJson", options.geoJson);
+ this._geoJson = options.geoJson;
+ this._promise = void 0;
+ this._process = function(loader, frameState) {
+ };
+ this._components = void 0;
+}
+if (defined_default(Object.create)) {
+ GeoJsonLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ GeoJsonLoader.prototype.constructor = GeoJsonLoader;
+}
+Object.defineProperties(GeoJsonLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return void 0;
+ }
+ },
+ components: {
+ get: function() {
+ return this._components;
+ }
+ }
+});
+GeoJsonLoader.prototype.load = function() {
+ const loader = this;
+ const promise = new Promise(function(resolve2) {
+ loader._process = function(loader2, frameState) {
+ if (defined_default(loader2._components)) {
+ return;
+ }
+ loader2._components = parse2(loader2._geoJson, frameState);
+ loader2._geoJson = void 0;
+ resolve2(loader2);
+ };
+ });
+ this._promise = promise;
+ return promise;
+};
+GeoJsonLoader.prototype.process = function(frameState) {
+ Check_default.typeOf.object("frameState", frameState);
+ this._process(this, frameState);
+};
+function ParsedFeature() {
+ this.lines = void 0;
+ this.points = void 0;
+ this.properties = void 0;
+}
+function ParseResult() {
+ this.features = [];
+}
+function parsePosition(position) {
+ const x = position[0];
+ const y = position[1];
+ const z = defaultValue_default(position[2], 0);
+ return new Cartesian3_default(x, y, z);
+}
+function parseLineString(coordinates) {
+ const positionsLength = coordinates.length;
+ const line = new Array(positionsLength);
+ for (let i = 0; i < positionsLength; i++) {
+ line[i] = parsePosition(coordinates[i]);
+ }
+ const lines = [line];
+ return lines;
+}
+function parseMultiLineString(coordinates) {
+ const linesLength = coordinates.length;
+ const lines = new Array(linesLength);
+ for (let i = 0; i < linesLength; i++) {
+ lines[i] = parseLineString(coordinates[i])[0];
+ }
+ return lines;
+}
+function parsePolygon(coordinates) {
+ const linesLength = coordinates.length;
+ const lines = new Array(linesLength);
+ for (let i = 0; i < linesLength; i++) {
+ lines[i] = parseLineString(coordinates[i])[0];
+ }
+ return lines;
+}
+function parseMultiPolygon(coordinates) {
+ const polygonsLength = coordinates.length;
+ const lines = [];
+ for (let i = 0; i < polygonsLength; i++) {
+ Array.prototype.push.apply(lines, parsePolygon(coordinates[i]));
+ }
+ return lines;
+}
+function parsePoint(coordinates) {
+ return [parsePosition(coordinates)];
+}
+function parseMultiPoint(coordinates) {
+ const pointsLength = coordinates.length;
+ const points = new Array(pointsLength);
+ for (let i = 0; i < pointsLength; i++) {
+ points[i] = parsePosition(coordinates[i]);
+ }
+ return points;
+}
+var geometryTypes = {
+ LineString: parseLineString,
+ MultiLineString: parseMultiLineString,
+ MultiPolygon: parseMultiPolygon,
+ Polygon: parsePolygon,
+ MultiPoint: parseMultiPoint,
+ Point: parsePoint
+};
+var primitiveTypes = {
+ LineString: PrimitiveType_default.LINES,
+ MultiLineString: PrimitiveType_default.LINES,
+ MultiPolygon: PrimitiveType_default.LINES,
+ Polygon: PrimitiveType_default.LINES,
+ MultiPoint: PrimitiveType_default.POINTS,
+ Point: PrimitiveType_default.POINTS
+};
+function parseFeature(feature2, result) {
+ if (!defined_default(feature2.geometry)) {
+ return;
+ }
+ const geometryType = feature2.geometry.type;
+ const geometryFunction = geometryTypes[geometryType];
+ const primitiveType = primitiveTypes[geometryType];
+ const coordinates = feature2.geometry.coordinates;
+ if (!defined_default(geometryFunction)) {
+ return;
+ }
+ if (!defined_default(coordinates)) {
+ return;
+ }
+ const parsedFeature = new ParsedFeature();
+ if (primitiveType === PrimitiveType_default.LINES) {
+ parsedFeature.lines = geometryFunction(coordinates);
+ } else if (primitiveType === PrimitiveType_default.POINTS) {
+ parsedFeature.points = geometryFunction(coordinates);
+ }
+ parsedFeature.properties = feature2.properties;
+ result.features.push(parsedFeature);
+}
+function parseFeatureCollection(featureCollection, result) {
+ const features = featureCollection.features;
+ const featuresLength = features.length;
+ for (let i = 0; i < featuresLength; i++) {
+ parseFeature(features[i], result);
+ }
+}
+var geoJsonObjectTypes = {
+ FeatureCollection: parseFeatureCollection,
+ Feature: parseFeature
+};
+var scratchCartesian7 = new Cartesian3_default();
+function createLinesPrimitive(features, toLocal, frameState) {
+ let vertexCount = 0;
+ let indexCount = 0;
+ const featureCount = features.length;
+ for (let i = 0; i < featureCount; i++) {
+ const feature2 = features[i];
+ if (defined_default(feature2.lines)) {
+ const linesLength = feature2.lines.length;
+ for (let j = 0; j < linesLength; j++) {
+ const line = feature2.lines[j];
+ vertexCount += line.length;
+ indexCount += (line.length - 1) * 2;
+ }
+ }
+ }
+ const positionsTypedArray = new Float32Array(vertexCount * 3);
+ const featureIdsTypedArray = new Float32Array(vertexCount);
+ const indicesTypedArray = IndexDatatype_default.createTypedArray(
+ vertexCount,
+ indexCount
+ );
+ const indexDatatype = IndexDatatype_default.fromTypedArray(indicesTypedArray);
+ const localMin = new Cartesian3_default(
+ Number.POSITIVE_INFINITY,
+ Number.POSITIVE_INFINITY,
+ Number.POSITIVE_INFINITY
+ );
+ const localMax = new Cartesian3_default(
+ Number.NEGATIVE_INFINITY,
+ Number.NEGATIVE_INFINITY,
+ Number.NEGATIVE_INFINITY
+ );
+ let vertexCounter = 0;
+ let segmentCounter = 0;
+ for (let i = 0; i < featureCount; i++) {
+ const feature2 = features[i];
+ if (!defined_default(feature2.lines)) {
+ continue;
+ }
+ const linesLength = feature2.lines.length;
+ for (let j = 0; j < linesLength; j++) {
+ const line = feature2.lines[j];
+ const positionsLength = line.length;
+ for (let k = 0; k < positionsLength; k++) {
+ const cartographic2 = line[k];
+ const globalCartesian = Cartesian3_default.fromDegrees(
+ cartographic2.x,
+ cartographic2.y,
+ cartographic2.z,
+ Ellipsoid_default.WGS84,
+ scratchCartesian7
+ );
+ const localCartesian = Matrix4_default.multiplyByPoint(
+ toLocal,
+ globalCartesian,
+ scratchCartesian7
+ );
+ Cartesian3_default.minimumByComponent(localMin, localCartesian, localMin);
+ Cartesian3_default.maximumByComponent(localMax, localCartesian, localMax);
+ Cartesian3_default.pack(localCartesian, positionsTypedArray, vertexCounter * 3);
+ featureIdsTypedArray[vertexCounter] = i;
+ if (k < positionsLength - 1) {
+ indicesTypedArray[segmentCounter * 2] = vertexCounter;
+ indicesTypedArray[segmentCounter * 2 + 1] = vertexCounter + 1;
+ segmentCounter++;
+ }
+ vertexCounter++;
+ }
+ }
+ }
+ const positionBuffer = Buffer_default.createVertexBuffer({
+ typedArray: positionsTypedArray,
+ context: frameState.context,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ positionBuffer.vertexArrayDestroyable = false;
+ const featureIdBuffer = Buffer_default.createVertexBuffer({
+ typedArray: featureIdsTypedArray,
+ context: frameState.context,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ featureIdBuffer.vertexArrayDestroyable = false;
+ const indexBuffer = Buffer_default.createIndexBuffer({
+ typedArray: indicesTypedArray,
+ context: frameState.context,
+ usage: BufferUsage_default.STATIC_DRAW,
+ indexDatatype
+ });
+ indexBuffer.vertexArrayDestroyable = false;
+ const positionAttribute = new ModelComponents_default.Attribute();
+ positionAttribute.semantic = VertexAttributeSemantic_default.POSITION;
+ positionAttribute.componentDatatype = ComponentDatatype_default.FLOAT;
+ positionAttribute.type = AttributeType_default.VEC3;
+ positionAttribute.count = vertexCount;
+ positionAttribute.min = localMin;
+ positionAttribute.max = localMax;
+ positionAttribute.buffer = positionBuffer;
+ const featureIdAttribute = new ModelComponents_default.Attribute();
+ featureIdAttribute.semantic = VertexAttributeSemantic_default.FEATURE_ID;
+ featureIdAttribute.setIndex = 0;
+ featureIdAttribute.componentDatatype = ComponentDatatype_default.FLOAT;
+ featureIdAttribute.type = AttributeType_default.SCALAR;
+ featureIdAttribute.count = vertexCount;
+ featureIdAttribute.buffer = featureIdBuffer;
+ const attributes = [positionAttribute, featureIdAttribute];
+ const material = new ModelComponents_default.Material();
+ material.unlit = true;
+ const indices2 = new ModelComponents_default.Indices();
+ indices2.indexDatatype = indexDatatype;
+ indices2.count = indicesTypedArray.length;
+ indices2.buffer = indexBuffer;
+ const featureId = new ModelComponents_default.FeatureIdAttribute();
+ featureId.featureCount = featureCount;
+ featureId.propertyTableId = 0;
+ featureId.setIndex = 0;
+ featureId.positionalLabel = "featureId_0";
+ const featureIds = [featureId];
+ const primitive = new ModelComponents_default.Primitive();
+ primitive.attributes = attributes;
+ primitive.indices = indices2;
+ primitive.featureIds = featureIds;
+ primitive.primitiveType = PrimitiveType_default.LINES;
+ primitive.material = material;
+ return primitive;
+}
+function createPointsPrimitive(features, toLocal, frameState) {
+ let vertexCount = 0;
+ const featureCount = features.length;
+ for (let i = 0; i < featureCount; i++) {
+ const feature2 = features[i];
+ if (defined_default(feature2.points)) {
+ vertexCount += feature2.points.length;
+ }
+ }
+ const positionsTypedArray = new Float32Array(vertexCount * 3);
+ const featureIdsTypedArray = new Float32Array(vertexCount);
+ const localMin = new Cartesian3_default(
+ Number.POSITIVE_INFINITY,
+ Number.POSITIVE_INFINITY,
+ Number.POSITIVE_INFINITY
+ );
+ const localMax = new Cartesian3_default(
+ Number.NEGATIVE_INFINITY,
+ Number.NEGATIVE_INFINITY,
+ Number.NEGATIVE_INFINITY
+ );
+ let vertexCounter = 0;
+ for (let i = 0; i < featureCount; i++) {
+ const feature2 = features[i];
+ if (!defined_default(feature2.points)) {
+ continue;
+ }
+ const pointsLength = feature2.points.length;
+ for (let j = 0; j < pointsLength; j++) {
+ const cartographic2 = feature2.points[j];
+ const globalCartesian = Cartesian3_default.fromDegrees(
+ cartographic2.x,
+ cartographic2.y,
+ cartographic2.z,
+ Ellipsoid_default.WGS84,
+ scratchCartesian7
+ );
+ const localCartesian = Matrix4_default.multiplyByPoint(
+ toLocal,
+ globalCartesian,
+ scratchCartesian7
+ );
+ Cartesian3_default.minimumByComponent(localMin, localCartesian, localMin);
+ Cartesian3_default.maximumByComponent(localMax, localCartesian, localMax);
+ Cartesian3_default.pack(localCartesian, positionsTypedArray, vertexCounter * 3);
+ featureIdsTypedArray[vertexCounter] = i;
+ vertexCounter++;
+ }
+ }
+ const positionBuffer = Buffer_default.createVertexBuffer({
+ typedArray: positionsTypedArray,
+ context: frameState.context,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ positionBuffer.vertexArrayDestroyable = false;
+ const featureIdBuffer = Buffer_default.createVertexBuffer({
+ typedArray: featureIdsTypedArray,
+ context: frameState.context,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ featureIdBuffer.vertexArrayDestroyable = false;
+ const positionAttribute = new ModelComponents_default.Attribute();
+ positionAttribute.semantic = VertexAttributeSemantic_default.POSITION;
+ positionAttribute.componentDatatype = ComponentDatatype_default.FLOAT;
+ positionAttribute.type = AttributeType_default.VEC3;
+ positionAttribute.count = vertexCount;
+ positionAttribute.min = localMin;
+ positionAttribute.max = localMax;
+ positionAttribute.buffer = positionBuffer;
+ const featureIdAttribute = new ModelComponents_default.Attribute();
+ featureIdAttribute.semantic = VertexAttributeSemantic_default.FEATURE_ID;
+ featureIdAttribute.setIndex = 0;
+ featureIdAttribute.componentDatatype = ComponentDatatype_default.FLOAT;
+ featureIdAttribute.type = AttributeType_default.SCALAR;
+ featureIdAttribute.count = vertexCount;
+ featureIdAttribute.buffer = featureIdBuffer;
+ const attributes = [positionAttribute, featureIdAttribute];
+ const material = new ModelComponents_default.Material();
+ material.unlit = true;
+ const featureId = new ModelComponents_default.FeatureIdAttribute();
+ featureId.featureCount = featureCount;
+ featureId.propertyTableId = 0;
+ featureId.setIndex = 0;
+ featureId.positionalLabel = "featureId_0";
+ const featureIds = [featureId];
+ const primitive = new ModelComponents_default.Primitive();
+ primitive.attributes = attributes;
+ primitive.featureIds = featureIds;
+ primitive.primitiveType = PrimitiveType_default.POINTS;
+ primitive.material = material;
+ return primitive;
+}
+function parse2(geoJson, frameState) {
+ const result = new ParseResult();
+ const parseFunction = geoJsonObjectTypes[geoJson.type];
+ if (defined_default(parseFunction)) {
+ parseFunction(geoJson, result);
+ }
+ const features = result.features;
+ const featureCount = features.length;
+ if (featureCount === 0) {
+ throw new RuntimeError_default("GeoJSON must have at least one feature");
+ }
+ const properties = {};
+ for (let i = 0; i < featureCount; i++) {
+ const feature2 = features[i];
+ const featureProperties = defaultValue_default(
+ feature2.properties,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ for (const propertyId in featureProperties) {
+ if (featureProperties.hasOwnProperty(propertyId)) {
+ if (!defined_default(properties[propertyId])) {
+ properties[propertyId] = new Array(featureCount);
+ }
+ }
+ }
+ }
+ for (let i = 0; i < featureCount; i++) {
+ const feature2 = features[i];
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const value = defaultValue_default(feature2.properties[propertyId], "");
+ properties[propertyId][i] = value;
+ }
+ }
+ }
+ const jsonMetadataTable = new JsonMetadataTable_default({
+ count: featureCount,
+ properties
+ });
+ const propertyTable = new PropertyTable_default({
+ id: 0,
+ count: featureCount,
+ jsonMetadataTable
+ });
+ const propertyTables = [propertyTable];
+ const schema = new MetadataSchema_default({});
+ const structuralMetadata = new StructuralMetadata_default({
+ schema,
+ propertyTables
+ });
+ const cartographicMin = new Cartesian3_default(
+ Number.POSITIVE_INFINITY,
+ Number.POSITIVE_INFINITY,
+ Number.POSITIVE_INFINITY
+ );
+ const cartographicMax = new Cartesian3_default(
+ Number.NEGATIVE_INFINITY,
+ Number.NEGATIVE_INFINITY,
+ Number.NEGATIVE_INFINITY
+ );
+ let hasLines = false;
+ let hasPoints = false;
+ for (let i = 0; i < featureCount; i++) {
+ const feature2 = features[i];
+ if (defined_default(feature2.lines)) {
+ hasLines = true;
+ const linesLength = feature2.lines.length;
+ for (let j = 0; j < linesLength; j++) {
+ const line = feature2.lines[j];
+ const positionsLength = line.length;
+ for (let k = 0; k < positionsLength; k++) {
+ Cartesian3_default.minimumByComponent(
+ cartographicMin,
+ line[k],
+ cartographicMin
+ );
+ Cartesian3_default.maximumByComponent(
+ cartographicMax,
+ line[k],
+ cartographicMax
+ );
+ }
+ }
+ }
+ if (defined_default(feature2.points)) {
+ hasPoints = true;
+ const pointsLength = feature2.points.length;
+ for (let j = 0; j < pointsLength; j++) {
+ const point = feature2.points[j];
+ Cartesian3_default.minimumByComponent(cartographicMin, point, cartographicMin);
+ Cartesian3_default.maximumByComponent(cartographicMax, point, cartographicMax);
+ }
+ }
+ }
+ const cartographicCenter = Cartesian3_default.midpoint(
+ cartographicMin,
+ cartographicMax,
+ new Cartesian3_default()
+ );
+ const ecefCenter = Cartesian3_default.fromDegrees(
+ cartographicCenter.x,
+ cartographicCenter.y,
+ cartographicCenter.z,
+ Ellipsoid_default.WGS84,
+ new Cartesian3_default()
+ );
+ const toGlobal = Transforms_default.eastNorthUpToFixedFrame(
+ ecefCenter,
+ Ellipsoid_default.WGS84,
+ new Matrix4_default()
+ );
+ const toLocal = Matrix4_default.inverseTransformation(toGlobal, new Matrix4_default());
+ const primitives = [];
+ if (hasLines) {
+ primitives.push(createLinesPrimitive(features, toLocal, frameState));
+ }
+ if (hasPoints) {
+ primitives.push(createPointsPrimitive(features, toLocal, frameState));
+ }
+ const node = new ModelComponents_default.Node();
+ node.index = 0;
+ node.primitives = primitives;
+ const nodes = [node];
+ const scene = new ModelComponents_default.Scene();
+ scene.nodes = nodes;
+ const components = new ModelComponents_default.Components();
+ components.scene = scene;
+ components.nodes = nodes;
+ components.transform = toGlobal;
+ components.structuralMetadata = structuralMetadata;
+ return components;
+}
+GeoJsonLoader.prototype.unload = function() {
+ this._components = void 0;
+};
+var GeoJsonLoader_default = GeoJsonLoader;
+
+// Source/Scene/I3dmParser.js
+var I3dmParser = {};
+I3dmParser._deprecationWarning = deprecationWarning_default;
+var sizeOfUint325 = Uint32Array.BYTES_PER_ELEMENT;
+I3dmParser.parse = function(arrayBuffer, byteOffset) {
+ Check_default.defined("arrayBuffer", arrayBuffer);
+ const byteStart = defaultValue_default(byteOffset, 0);
+ byteOffset = byteStart;
+ const uint8Array = new Uint8Array(arrayBuffer);
+ const view = new DataView(arrayBuffer);
+ byteOffset += sizeOfUint325;
+ const version2 = view.getUint32(byteOffset, true);
+ if (version2 !== 1) {
+ throw new RuntimeError_default(
+ `Only Instanced 3D Model version 1 is supported. Version ${version2} is not.`
+ );
+ }
+ byteOffset += sizeOfUint325;
+ const byteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint325;
+ const featureTableJsonByteLength = view.getUint32(byteOffset, true);
+ if (featureTableJsonByteLength === 0) {
+ throw new RuntimeError_default(
+ "featureTableJsonByteLength is zero, the feature table must be defined."
+ );
+ }
+ byteOffset += sizeOfUint325;
+ const featureTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint325;
+ const batchTableJsonByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint325;
+ const batchTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint325;
+ const gltfFormat = view.getUint32(byteOffset, true);
+ if (gltfFormat !== 1 && gltfFormat !== 0) {
+ throw new RuntimeError_default(
+ `Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${gltfFormat} is not.`
+ );
+ }
+ byteOffset += sizeOfUint325;
+ const featureTableJson = getJsonFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ featureTableJsonByteLength
+ );
+ byteOffset += featureTableJsonByteLength;
+ const featureTableBinary = new Uint8Array(
+ arrayBuffer,
+ byteOffset,
+ featureTableBinaryByteLength
+ );
+ byteOffset += featureTableBinaryByteLength;
+ let batchTableJson;
+ let batchTableBinary;
+ if (batchTableJsonByteLength > 0) {
+ batchTableJson = getJsonFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ batchTableJsonByteLength
+ );
+ byteOffset += batchTableJsonByteLength;
+ if (batchTableBinaryByteLength > 0) {
+ batchTableBinary = new Uint8Array(
+ arrayBuffer,
+ byteOffset,
+ batchTableBinaryByteLength
+ );
+ batchTableBinary = new Uint8Array(batchTableBinary);
+ byteOffset += batchTableBinaryByteLength;
+ }
+ }
+ const gltfByteLength = byteStart + byteLength - byteOffset;
+ if (gltfByteLength === 0) {
+ throw new RuntimeError_default("glTF byte length must be greater than 0.");
+ }
+ let gltfView;
+ if (byteOffset % 4 === 0) {
+ gltfView = new Uint8Array(arrayBuffer, byteOffset, gltfByteLength);
+ } else {
+ I3dmParser._deprecationWarning(
+ "i3dm-glb-unaligned",
+ "The embedded glb is not aligned to a 4-byte boundary."
+ );
+ gltfView = new Uint8Array(
+ uint8Array.subarray(byteOffset, byteOffset + gltfByteLength)
+ );
+ }
+ return {
+ gltfFormat,
+ featureTableJson,
+ featureTableBinary,
+ batchTableJson,
+ batchTableBinary,
+ gltf: gltfView
+ };
+};
+var I3dmParser_default = I3dmParser;
+
+// Source/Scene/Model/I3dmLoader.js
+var I3dmLoaderState = {
+ NOT_LOADED: 0,
+ LOADING: 1,
+ PROCESSING: 2,
+ POST_PROCESSING: 3,
+ READY: 4,
+ FAILED: 5,
+ UNLOADED: 6
+};
+var Attribute3 = ModelComponents_default.Attribute;
+var FeatureIdAttribute4 = ModelComponents_default.FeatureIdAttribute;
+var Instances3 = ModelComponents_default.Instances;
+function I3dmLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const i3dmResource = options.i3dmResource;
+ const arrayBuffer = options.arrayBuffer;
+ let baseResource2 = options.baseResource;
+ const byteOffset = defaultValue_default(options.byteOffset, 0);
+ const releaseGltfJson = defaultValue_default(options.releaseGltfJson, false);
+ const asynchronous = defaultValue_default(options.asynchronous, true);
+ const incrementallyLoadTextures = defaultValue_default(
+ options.incrementallyLoadTextures,
+ true
+ );
+ const upAxis = defaultValue_default(options.upAxis, Axis_default.Y);
+ const forwardAxis = defaultValue_default(options.forwardAxis, Axis_default.X);
+ const loadAttributesAsTypedArray = defaultValue_default(
+ options.loadAttributesAsTypedArray,
+ false
+ );
+ const loadIndicesForWireframe = defaultValue_default(
+ options.loadIndicesForWireframe,
+ false
+ );
+ const loadPrimitiveOutline2 = defaultValue_default(options.loadPrimitiveOutline, true);
+ Check_default.typeOf.object("options.i3dmResource", i3dmResource);
+ Check_default.typeOf.object("options.arrayBuffer", arrayBuffer);
+ baseResource2 = defined_default(baseResource2) ? baseResource2 : i3dmResource.clone();
+ this._i3dmResource = i3dmResource;
+ this._baseResource = baseResource2;
+ this._arrayBuffer = arrayBuffer;
+ this._byteOffset = byteOffset;
+ this._releaseGltfJson = releaseGltfJson;
+ this._asynchronous = asynchronous;
+ this._incrementallyLoadTextures = incrementallyLoadTextures;
+ this._upAxis = upAxis;
+ this._forwardAxis = forwardAxis;
+ this._loadAttributesAsTypedArray = loadAttributesAsTypedArray;
+ this._loadIndicesForWireframe = loadIndicesForWireframe;
+ this._loadPrimitiveOutline = loadPrimitiveOutline2;
+ this._state = I3dmLoaderState.NOT_LOADED;
+ this._promise = void 0;
+ this._gltfLoader = void 0;
+ this._gltfLoaderPromise = void 0;
+ this._process = function(loader, frameState) {
+ };
+ this._postProcess = function(loader, frameState) {
+ };
+ this._buffers = [];
+ this._components = void 0;
+ this._transform = Matrix4_default.IDENTITY;
+ this._batchTable = void 0;
+ this._featureTable = void 0;
+ this._instancesLength = 0;
+}
+if (defined_default(Object.create)) {
+ I3dmLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ I3dmLoader.prototype.constructor = I3dmLoader;
+}
+Object.defineProperties(I3dmLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ texturesLoadedPromise: {
+ get: function() {
+ return this._gltfLoader.texturesLoadedPromise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return void 0;
+ }
+ },
+ components: {
+ get: function() {
+ return this._components;
+ }
+ }
+});
+I3dmLoader.prototype.load = function() {
+ const i3dm = I3dmParser_default.parse(this._arrayBuffer, this._byteOffset);
+ const featureTableJson = i3dm.featureTableJson;
+ const featureTableBinary = i3dm.featureTableBinary;
+ const batchTableJson = i3dm.batchTableJson;
+ const batchTableBinary = i3dm.batchTableBinary;
+ const gltfFormat = i3dm.gltfFormat;
+ const featureTable = new Cesium3DTileFeatureTable_default(
+ featureTableJson,
+ featureTableBinary
+ );
+ this._featureTable = featureTable;
+ const instancesLength = featureTable.getGlobalProperty("INSTANCES_LENGTH");
+ featureTable.featuresLength = instancesLength;
+ if (!defined_default(instancesLength)) {
+ throw new RuntimeError_default(
+ "Feature table global property: INSTANCES_LENGTH must be defined"
+ );
+ }
+ this._instancesLength = instancesLength;
+ const rtcCenter = featureTable.getGlobalProperty(
+ "RTC_CENTER",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ if (defined_default(rtcCenter)) {
+ this._transform = Matrix4_default.fromTranslation(Cartesian3_default.fromArray(rtcCenter));
+ }
+ this._batchTable = {
+ json: batchTableJson,
+ binary: batchTableBinary
+ };
+ const loaderOptions = {
+ upAxis: this._upAxis,
+ forwardAxis: this._forwardAxis,
+ releaseGltfJson: this._releaseGltfJson,
+ incrementallyLoadTextures: this._incrementallyLoadTextures,
+ loadAttributesAsTypedArray: this._loadAttributesAsTypedArray,
+ loadIndicesForWireframe: this._loadIndicesForWireframe,
+ loadPrimitiveOutline: this._loadPrimitiveOutline
+ };
+ if (gltfFormat === 0) {
+ let gltfUrl = getStringFromTypedArray_default(i3dm.gltf);
+ gltfUrl = gltfUrl.replace(/[\s\0]+$/, "");
+ const gltfResource = this._baseResource.getDerivedResource({
+ url: gltfUrl
+ });
+ loaderOptions.gltfResource = gltfResource;
+ loaderOptions.baseResource = gltfResource;
+ } else {
+ loaderOptions.gltfResource = this._i3dmResource;
+ loaderOptions.typedArray = i3dm.gltf;
+ }
+ const gltfLoader = new GltfLoader_default(loaderOptions);
+ this._gltfLoader = gltfLoader;
+ this._state = I3dmLoaderState.LOADING;
+ gltfLoader.load();
+ const that = this;
+ const processPromise = new Promise(function(resolve2) {
+ that._process = function(loader, frameState) {
+ loader._gltfLoader.process(frameState);
+ };
+ that._postProcess = function(loader, frameState) {
+ const gltfLoader2 = loader._gltfLoader;
+ const components = gltfLoader2.components;
+ components.transform = Matrix4_default.multiplyTransformation(
+ loader._transform,
+ components.transform,
+ components.transform
+ );
+ createInstances(loader, components, frameState);
+ createStructuralMetadata2(loader, components);
+ loader._components = components;
+ loader._arrayBuffer = void 0;
+ loader._state = I3dmLoaderState.READY;
+ resolve2(loader);
+ };
+ });
+ this._promise = gltfLoader.promise.then(function() {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that._state = I3dmLoaderState.POST_PROCESSING;
+ return processPromise;
+ }).catch(function(error) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ return handleError8(that, error);
+ });
+ return this._promise;
+};
+function handleError8(i3dmLoader, error) {
+ i3dmLoader.unload();
+ i3dmLoader._state = I3dmLoaderState.FAILED;
+ const errorMessage = "Failed to load i3dm";
+ error = i3dmLoader.getError(errorMessage, error);
+ return Promise.reject(error);
+}
+I3dmLoader.prototype.process = function(frameState) {
+ Check_default.typeOf.object("frameState", frameState);
+ if (this._state === I3dmLoaderState.LOADING) {
+ this._state = I3dmLoaderState.PROCESSING;
+ }
+ if (this._state === I3dmLoaderState.PROCESSING) {
+ this._process(this, frameState);
+ }
+ if (this._state === I3dmLoaderState.POST_PROCESSING) {
+ this._postProcess(this, frameState);
+ }
+};
+function createStructuralMetadata2(loader, components) {
+ const batchTable = loader._batchTable;
+ const instancesLength = loader._instancesLength;
+ if (instancesLength === 0) {
+ return;
+ }
+ let structuralMetadata;
+ if (defined_default(batchTable.json)) {
+ structuralMetadata = parseBatchTable_default({
+ count: instancesLength,
+ batchTable: batchTable.json,
+ binaryBody: batchTable.binary
+ });
+ } else {
+ const emptyPropertyTable = new PropertyTable_default({
+ name: MetadataClass_default.BATCH_TABLE_CLASS_NAME,
+ count: instancesLength
+ });
+ structuralMetadata = new StructuralMetadata_default({
+ schema: {},
+ propertyTables: [emptyPropertyTable]
+ });
+ }
+ components.structuralMetadata = structuralMetadata;
+}
+var positionScratch4 = new Cartesian3_default();
+var propertyScratch1 = new Array(4);
+var transformScratch = new Matrix4_default();
+function createInstances(loader, components, frameState) {
+ let i;
+ const featureTable = loader._featureTable;
+ const instancesLength = loader._instancesLength;
+ if (instancesLength === 0) {
+ return;
+ }
+ const rtcCenter = featureTable.getGlobalProperty(
+ "RTC_CENTER",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ const eastNorthUp = featureTable.getGlobalProperty("EAST_NORTH_UP");
+ const hasRotation = featureTable.hasProperty("NORMAL_UP") || featureTable.hasProperty("NORMAL_UP_OCT32P") || eastNorthUp;
+ const hasScale = featureTable.hasProperty("SCALE") || featureTable.hasProperty("SCALE_NON_UNIFORM");
+ const translationTypedArray = getPositions(featureTable, instancesLength);
+ let rotationTypedArray;
+ if (hasRotation) {
+ rotationTypedArray = new Float32Array(4 * instancesLength);
+ }
+ let scaleTypedArray;
+ if (hasScale) {
+ scaleTypedArray = new Float32Array(3 * instancesLength);
+ }
+ const featureIdArray = new Float32Array(instancesLength);
+ const instancePositions = Cartesian3_default.unpackArray(translationTypedArray);
+ let instancePosition = new Cartesian3_default();
+ const instanceNormalRight = new Cartesian3_default();
+ const instanceNormalUp = new Cartesian3_default();
+ const instanceNormalForward = new Cartesian3_default();
+ const instanceRotation = new Matrix3_default();
+ const instanceQuaternion = new Quaternion_default();
+ const instanceQuaternionArray = new Array(4);
+ const instanceScale = new Cartesian3_default();
+ const instanceScaleArray = new Array(3);
+ const instanceTransform = new Matrix4_default();
+ if (!defined_default(rtcCenter)) {
+ const positionBoundingSphere = BoundingSphere_default.fromPoints(instancePositions);
+ for (i = 0; i < instancePositions.length; i++) {
+ Cartesian3_default.subtract(
+ instancePositions[i],
+ positionBoundingSphere.center,
+ positionScratch4
+ );
+ translationTypedArray[3 * i + 0] = positionScratch4.x;
+ translationTypedArray[3 * i + 1] = positionScratch4.y;
+ translationTypedArray[3 * i + 2] = positionScratch4.z;
+ }
+ const centerTransform = Matrix4_default.fromTranslation(
+ positionBoundingSphere.center,
+ transformScratch
+ );
+ components.transform = Matrix4_default.multiplyTransformation(
+ centerTransform,
+ components.transform,
+ components.transform
+ );
+ }
+ for (i = 0; i < instancesLength; i++) {
+ instancePosition = Cartesian3_default.clone(instancePositions[i]);
+ if (defined_default(rtcCenter)) {
+ Cartesian3_default.add(
+ instancePosition,
+ Cartesian3_default.unpack(rtcCenter),
+ instancePosition
+ );
+ }
+ if (hasRotation) {
+ processRotation(
+ featureTable,
+ eastNorthUp,
+ i,
+ instanceQuaternion,
+ instancePosition,
+ instanceNormalUp,
+ instanceNormalRight,
+ instanceNormalForward,
+ instanceRotation,
+ instanceTransform
+ );
+ Quaternion_default.pack(instanceQuaternion, instanceQuaternionArray, 0);
+ rotationTypedArray[4 * i + 0] = instanceQuaternionArray[0];
+ rotationTypedArray[4 * i + 1] = instanceQuaternionArray[1];
+ rotationTypedArray[4 * i + 2] = instanceQuaternionArray[2];
+ rotationTypedArray[4 * i + 3] = instanceQuaternionArray[3];
+ }
+ if (hasScale) {
+ processScale(featureTable, i, instanceScale);
+ Cartesian3_default.pack(instanceScale, instanceScaleArray, 0);
+ scaleTypedArray[3 * i + 0] = instanceScaleArray[0];
+ scaleTypedArray[3 * i + 1] = instanceScaleArray[1];
+ scaleTypedArray[3 * i + 2] = instanceScaleArray[2];
+ }
+ let batchId = featureTable.getProperty(
+ "BATCH_ID",
+ ComponentDatatype_default.UNSIGNED_SHORT,
+ 1,
+ i
+ );
+ if (!defined_default(batchId)) {
+ batchId = i;
+ }
+ featureIdArray[i] = batchId;
+ }
+ const instances = new Instances3();
+ instances.transformInWorldSpace = true;
+ const buffers = loader._buffers;
+ const translationAttribute = new Attribute3();
+ translationAttribute.name = "Instance Translation";
+ translationAttribute.semantic = InstanceAttributeSemantic_default.TRANSLATION;
+ translationAttribute.componentDatatype = ComponentDatatype_default.FLOAT;
+ translationAttribute.type = AttributeType_default.VEC3;
+ translationAttribute.count = instancesLength;
+ translationAttribute.typedArray = translationTypedArray;
+ if (!hasRotation) {
+ const buffer2 = Buffer_default.createVertexBuffer({
+ context: frameState.context,
+ typedArray: translationTypedArray,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ buffer2.vertexArrayDestroyable = false;
+ buffers.push(buffer2);
+ translationAttribute.buffer = buffer2;
+ }
+ instances.attributes.push(translationAttribute);
+ if (hasRotation) {
+ const rotationAttribute = new Attribute3();
+ rotationAttribute.name = "Instance Rotation";
+ rotationAttribute.semantic = InstanceAttributeSemantic_default.ROTATION;
+ rotationAttribute.componentDatatype = ComponentDatatype_default.FLOAT;
+ rotationAttribute.type = AttributeType_default.VEC4;
+ rotationAttribute.count = instancesLength;
+ rotationAttribute.typedArray = rotationTypedArray;
+ instances.attributes.push(rotationAttribute);
+ }
+ if (hasScale) {
+ const scaleAttribute = new Attribute3();
+ scaleAttribute.name = "Instance Scale";
+ scaleAttribute.semantic = InstanceAttributeSemantic_default.SCALE;
+ scaleAttribute.componentDatatype = ComponentDatatype_default.FLOAT;
+ scaleAttribute.type = AttributeType_default.VEC3;
+ scaleAttribute.count = instancesLength;
+ if (hasRotation) {
+ scaleAttribute.typedArray = scaleTypedArray;
+ } else {
+ const buffer2 = Buffer_default.createVertexBuffer({
+ context: frameState.context,
+ typedArray: scaleTypedArray,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ buffer2.vertexArrayDestroyable = false;
+ buffers.push(buffer2);
+ scaleAttribute.buffer = buffer2;
+ }
+ instances.attributes.push(scaleAttribute);
+ }
+ const featureIdAttribute = new Attribute3();
+ featureIdAttribute.name = "Instance Feature ID";
+ featureIdAttribute.setIndex = 0;
+ featureIdAttribute.semantic = InstanceAttributeSemantic_default.FEATURE_ID;
+ featureIdAttribute.componentDatatype = ComponentDatatype_default.FLOAT;
+ featureIdAttribute.type = AttributeType_default.SCALAR;
+ featureIdAttribute.count = instancesLength;
+ const buffer = Buffer_default.createVertexBuffer({
+ context: frameState.context,
+ typedArray: featureIdArray,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ buffer.vertexArrayDestroyable = false;
+ buffers.push(buffer);
+ featureIdAttribute.buffer = buffer;
+ instances.attributes.push(featureIdAttribute);
+ const featureIdInstanceAttribute = new FeatureIdAttribute4();
+ featureIdInstanceAttribute.propertyTableId = 0;
+ featureIdInstanceAttribute.setIndex = 0;
+ featureIdInstanceAttribute.positionalLabel = "instanceFeatureId_0";
+ instances.featureIds.push(featureIdInstanceAttribute);
+ const nodes = components.nodes;
+ const nodesLength = nodes.length;
+ let makeInstancesCopy = false;
+ for (i = 0; i < nodesLength; i++) {
+ const node = nodes[i];
+ if (node.primitives.length > 0) {
+ node.instances = makeInstancesCopy ? createInstancesCopy(instances) : instances;
+ makeInstancesCopy = true;
+ }
+ }
+}
+function createInstancesCopy(instances) {
+ const instancesCopy = new Instances3();
+ instancesCopy.transformInWorldSpace = instances.transformInWorldSpace;
+ const attributes = instances.attributes;
+ const attributesLength = attributes.length;
+ for (let i = 0; i < attributesLength; i++) {
+ const attributeCopy = clone_default(attributes[i], false);
+ instancesCopy.attributes.push(attributeCopy);
+ }
+ instancesCopy.featureIds = instances.featureIds;
+ return instancesCopy;
+}
+function getPositions(featureTable, instancesLength) {
+ if (featureTable.hasProperty("POSITION")) {
+ return featureTable.getPropertyArray(
+ "POSITION",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ } else if (featureTable.hasProperty("POSITION_QUANTIZED")) {
+ const quantizedPositions = featureTable.getPropertyArray(
+ "POSITION_QUANTIZED",
+ ComponentDatatype_default.UNSIGNED_SHORT,
+ 3
+ );
+ const quantizedVolumeOffset = featureTable.getGlobalProperty(
+ "QUANTIZED_VOLUME_OFFSET",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ if (!defined_default(quantizedVolumeOffset)) {
+ throw new RuntimeError_default(
+ "Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions."
+ );
+ }
+ const quantizedVolumeScale = featureTable.getGlobalProperty(
+ "QUANTIZED_VOLUME_SCALE",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ if (!defined_default(quantizedVolumeScale)) {
+ throw new RuntimeError_default(
+ "Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions."
+ );
+ }
+ const decodedPositions = new Float32Array(quantizedPositions.length);
+ for (let i = 0; i < quantizedPositions.length / 3; i++) {
+ for (let j = 0; j < 3; j++) {
+ const index = 3 * i + j;
+ decodedPositions[index] = quantizedPositions[index] / 65535 * quantizedVolumeScale[j] + quantizedVolumeOffset[j];
+ }
+ }
+ return decodedPositions;
+ } else {
+ throw new RuntimeError_default(
+ "Either POSITION or POSITION_QUANTIZED must be defined for each instance."
+ );
+ }
+}
+var propertyScratch2 = new Array(4);
+function processRotation(featureTable, eastNorthUp, i, instanceQuaternion, instancePosition, instanceNormalUp, instanceNormalRight, instanceNormalForward, instanceRotation, instanceTransform) {
+ const normalUp = featureTable.getProperty(
+ "NORMAL_UP",
+ ComponentDatatype_default.FLOAT,
+ 3,
+ i,
+ propertyScratch1
+ );
+ const normalRight = featureTable.getProperty(
+ "NORMAL_RIGHT",
+ ComponentDatatype_default.FLOAT,
+ 3,
+ i,
+ propertyScratch2
+ );
+ let hasCustomOrientation = false;
+ if (defined_default(normalUp)) {
+ if (!defined_default(normalRight)) {
+ throw new RuntimeError_default(
+ "To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined."
+ );
+ }
+ Cartesian3_default.unpack(normalUp, 0, instanceNormalUp);
+ Cartesian3_default.unpack(normalRight, 0, instanceNormalRight);
+ hasCustomOrientation = true;
+ } else {
+ const octNormalUp = featureTable.getProperty(
+ "NORMAL_UP_OCT32P",
+ ComponentDatatype_default.UNSIGNED_SHORT,
+ 2,
+ i,
+ propertyScratch1
+ );
+ const octNormalRight = featureTable.getProperty(
+ "NORMAL_RIGHT_OCT32P",
+ ComponentDatatype_default.UNSIGNED_SHORT,
+ 2,
+ i,
+ propertyScratch2
+ );
+ if (defined_default(octNormalUp)) {
+ if (!defined_default(octNormalRight)) {
+ throw new RuntimeError_default(
+ "To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined."
+ );
+ }
+ AttributeCompression_default.octDecodeInRange(
+ octNormalUp[0],
+ octNormalUp[1],
+ 65535,
+ instanceNormalUp
+ );
+ AttributeCompression_default.octDecodeInRange(
+ octNormalRight[0],
+ octNormalRight[1],
+ 65535,
+ instanceNormalRight
+ );
+ hasCustomOrientation = true;
+ } else if (eastNorthUp) {
+ Transforms_default.eastNorthUpToFixedFrame(
+ instancePosition,
+ Ellipsoid_default.WGS84,
+ instanceTransform
+ );
+ Matrix4_default.getMatrix3(instanceTransform, instanceRotation);
+ } else {
+ Matrix3_default.clone(Matrix3_default.IDENTITY, instanceRotation);
+ }
+ }
+ if (hasCustomOrientation) {
+ Cartesian3_default.cross(
+ instanceNormalRight,
+ instanceNormalUp,
+ instanceNormalForward
+ );
+ Cartesian3_default.normalize(instanceNormalForward, instanceNormalForward);
+ Matrix3_default.setColumn(
+ instanceRotation,
+ 0,
+ instanceNormalRight,
+ instanceRotation
+ );
+ Matrix3_default.setColumn(instanceRotation, 1, instanceNormalUp, instanceRotation);
+ Matrix3_default.setColumn(
+ instanceRotation,
+ 2,
+ instanceNormalForward,
+ instanceRotation
+ );
+ }
+ Quaternion_default.fromRotationMatrix(instanceRotation, instanceQuaternion);
+}
+function processScale(featureTable, i, instanceScale) {
+ instanceScale = Cartesian3_default.fromElements(1, 1, 1, instanceScale);
+ const scale = featureTable.getProperty(
+ "SCALE",
+ ComponentDatatype_default.FLOAT,
+ 1,
+ i
+ );
+ if (defined_default(scale)) {
+ Cartesian3_default.multiplyByScalar(instanceScale, scale, instanceScale);
+ }
+ const nonUniformScale = featureTable.getProperty(
+ "SCALE_NON_UNIFORM",
+ ComponentDatatype_default.FLOAT,
+ 3,
+ i,
+ propertyScratch1
+ );
+ if (defined_default(nonUniformScale)) {
+ instanceScale.x *= nonUniformScale[0];
+ instanceScale.y *= nonUniformScale[1];
+ instanceScale.z *= nonUniformScale[2];
+ }
+}
+function unloadBuffers(loader) {
+ const buffers = loader._buffers;
+ const length3 = buffers.length;
+ for (let i = 0; i < length3; i++) {
+ const buffer = buffers[i];
+ if (!buffer.isDestroyed()) {
+ buffer.destroy();
+ }
+ }
+ buffers.length = 0;
+}
+I3dmLoader.prototype.isUnloaded = function() {
+ return this._state === I3dmLoaderState.UNLOADED;
+};
+I3dmLoader.prototype.unload = function() {
+ if (defined_default(this._gltfLoader)) {
+ this._gltfLoader.unload();
+ }
+ unloadBuffers(this);
+ this._components = void 0;
+ this._arrayBuffer = void 0;
+ this._state = I3dmLoaderState.UNLOADED;
+};
+var I3dmLoader_default = I3dmLoader;
+
+// Source/Scene/ModelAnimationState.js
+var ModelAnimationState = {
+ STOPPED: 0,
+ ANIMATING: 1
+};
+var ModelAnimationState_default = Object.freeze(ModelAnimationState);
+
+// Source/Core/Spline.js
+function Spline() {
+ this.times = void 0;
+ this.points = void 0;
+ DeveloperError_default.throwInstantiationError();
+}
+Spline.getPointType = function(point) {
+ if (typeof point === "number") {
+ return Number;
+ }
+ if (point instanceof Cartesian3_default) {
+ return Cartesian3_default;
+ }
+ if (point instanceof Quaternion_default) {
+ return Quaternion_default;
+ }
+ throw new DeveloperError_default(
+ "point must be a Cartesian3, Quaternion, or Number."
+ );
+};
+Spline.prototype.evaluate = DeveloperError_default.throwInstantiationError;
+Spline.prototype.findTimeInterval = function(time, startIndex) {
+ const times = this.times;
+ const length3 = times.length;
+ Check_default.typeOf.number("time", time);
+ if (time < times[0] || time > times[length3 - 1]) {
+ throw new DeveloperError_default("time is out of range.");
+ }
+ startIndex = defaultValue_default(startIndex, 0);
+ if (time >= times[startIndex]) {
+ if (startIndex + 1 < length3 && time < times[startIndex + 1]) {
+ return startIndex;
+ } else if (startIndex + 2 < length3 && time < times[startIndex + 2]) {
+ return startIndex + 1;
+ }
+ } else if (startIndex - 1 >= 0 && time >= times[startIndex - 1]) {
+ return startIndex - 1;
+ }
+ let i;
+ if (time > times[startIndex]) {
+ for (i = startIndex; i < length3 - 1; ++i) {
+ if (time >= times[i] && time < times[i + 1]) {
+ break;
+ }
+ }
+ } else {
+ for (i = startIndex - 1; i >= 0; --i) {
+ if (time >= times[i] && time < times[i + 1]) {
+ break;
+ }
+ }
+ }
+ if (i === length3 - 1) {
+ i = length3 - 2;
+ }
+ return i;
+};
+Spline.prototype.wrapTime = function(time) {
+ Check_default.typeOf.number("time", time);
+ const times = this.times;
+ const timeEnd = times[times.length - 1];
+ const timeStart = times[0];
+ const timeStretch = timeEnd - timeStart;
+ let divs;
+ if (time < timeStart) {
+ divs = Math.floor((timeStart - time) / timeStretch) + 1;
+ time += divs * timeStretch;
+ }
+ if (time > timeEnd) {
+ divs = Math.floor((time - timeEnd) / timeStretch) + 1;
+ time -= divs * timeStretch;
+ }
+ return time;
+};
+Spline.prototype.clampTime = function(time) {
+ Check_default.typeOf.number("time", time);
+ const times = this.times;
+ return Math_default.clamp(time, times[0], times[times.length - 1]);
+};
+var Spline_default = Spline;
+
+// Source/Core/ConstantSpline.js
+function ConstantSpline(value) {
+ this._value = value;
+ this._valueType = Spline_default.getPointType(value);
+}
+Object.defineProperties(ConstantSpline.prototype, {
+ value: {
+ get: function() {
+ return this._value;
+ }
+ }
+});
+ConstantSpline.prototype.findTimeInterval = function(time) {
+ throw new DeveloperError_default(
+ "findTimeInterval cannot be called on a ConstantSpline."
+ );
+};
+ConstantSpline.prototype.wrapTime = function(time) {
+ Check_default.typeOf.number("time", time);
+ return 0;
+};
+ConstantSpline.prototype.clampTime = function(time) {
+ Check_default.typeOf.number("time", time);
+ return 0;
+};
+ConstantSpline.prototype.evaluate = function(time, result) {
+ Check_default.typeOf.number("time", time);
+ const value = this._value;
+ const ValueType = this._valueType;
+ if (ValueType === Number) {
+ return value;
+ }
+ return ValueType.clone(value, result);
+};
+var ConstantSpline_default = ConstantSpline;
+
+// Source/Core/LinearSpline.js
+function LinearSpline(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const points = options.points;
+ const times = options.times;
+ if (!defined_default(points) || !defined_default(times)) {
+ throw new DeveloperError_default("points and times are required.");
+ }
+ if (points.length < 2) {
+ throw new DeveloperError_default(
+ "points.length must be greater than or equal to 2."
+ );
+ }
+ if (times.length !== points.length) {
+ throw new DeveloperError_default("times.length must be equal to points.length.");
+ }
+ this._times = times;
+ this._points = points;
+ this._pointType = Spline_default.getPointType(points[0]);
+ this._lastTimeIndex = 0;
+}
+Object.defineProperties(LinearSpline.prototype, {
+ times: {
+ get: function() {
+ return this._times;
+ }
+ },
+ points: {
+ get: function() {
+ return this._points;
+ }
+ }
+});
+LinearSpline.prototype.findTimeInterval = Spline_default.prototype.findTimeInterval;
+LinearSpline.prototype.wrapTime = Spline_default.prototype.wrapTime;
+LinearSpline.prototype.clampTime = Spline_default.prototype.clampTime;
+LinearSpline.prototype.evaluate = function(time, result) {
+ const points = this.points;
+ const times = this.times;
+ const i = this._lastTimeIndex = this.findTimeInterval(
+ time,
+ this._lastTimeIndex
+ );
+ const u3 = (time - times[i]) / (times[i + 1] - times[i]);
+ const PointType = this._pointType;
+ if (PointType === Number) {
+ return (1 - u3) * points[i] + u3 * points[i + 1];
+ }
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ return Cartesian3_default.lerp(points[i], points[i + 1], u3, result);
+};
+var LinearSpline_default = LinearSpline;
+
+// Source/Core/TridiagonalSystemSolver.js
+var TridiagonalSystemSolver = {};
+TridiagonalSystemSolver.solve = function(lower, diagonal, upper, right) {
+ if (!defined_default(lower) || !(lower instanceof Array)) {
+ throw new DeveloperError_default("The array lower is required.");
+ }
+ if (!defined_default(diagonal) || !(diagonal instanceof Array)) {
+ throw new DeveloperError_default("The array diagonal is required.");
+ }
+ if (!defined_default(upper) || !(upper instanceof Array)) {
+ throw new DeveloperError_default("The array upper is required.");
+ }
+ if (!defined_default(right) || !(right instanceof Array)) {
+ throw new DeveloperError_default("The array right is required.");
+ }
+ if (diagonal.length !== right.length) {
+ throw new DeveloperError_default("diagonal and right must have the same lengths.");
+ }
+ if (lower.length !== upper.length) {
+ throw new DeveloperError_default("lower and upper must have the same lengths.");
+ } else if (lower.length !== diagonal.length - 1) {
+ throw new DeveloperError_default(
+ "lower and upper must be one less than the length of diagonal."
+ );
+ }
+ const c = new Array(upper.length);
+ const d = new Array(right.length);
+ const x = new Array(right.length);
+ let i;
+ for (i = 0; i < d.length; i++) {
+ d[i] = new Cartesian3_default();
+ x[i] = new Cartesian3_default();
+ }
+ c[0] = upper[0] / diagonal[0];
+ d[0] = Cartesian3_default.multiplyByScalar(right[0], 1 / diagonal[0], d[0]);
+ let scalar;
+ for (i = 1; i < c.length; ++i) {
+ scalar = 1 / (diagonal[i] - c[i - 1] * lower[i - 1]);
+ c[i] = upper[i] * scalar;
+ d[i] = Cartesian3_default.subtract(
+ right[i],
+ Cartesian3_default.multiplyByScalar(d[i - 1], lower[i - 1], d[i]),
+ d[i]
+ );
+ d[i] = Cartesian3_default.multiplyByScalar(d[i], scalar, d[i]);
+ }
+ scalar = 1 / (diagonal[i] - c[i - 1] * lower[i - 1]);
+ d[i] = Cartesian3_default.subtract(
+ right[i],
+ Cartesian3_default.multiplyByScalar(d[i - 1], lower[i - 1], d[i]),
+ d[i]
+ );
+ d[i] = Cartesian3_default.multiplyByScalar(d[i], scalar, d[i]);
+ x[x.length - 1] = d[d.length - 1];
+ for (i = x.length - 2; i >= 0; --i) {
+ x[i] = Cartesian3_default.subtract(
+ d[i],
+ Cartesian3_default.multiplyByScalar(x[i + 1], c[i], x[i]),
+ x[i]
+ );
+ }
+ return x;
+};
+var TridiagonalSystemSolver_default = TridiagonalSystemSolver;
+
+// Source/Core/HermiteSpline.js
+var scratchLower = [];
+var scratchDiagonal = [];
+var scratchUpper = [];
+var scratchRight = [];
+function generateClamped(points, firstTangent, lastTangent) {
+ const l = scratchLower;
+ const u3 = scratchUpper;
+ const d = scratchDiagonal;
+ const r = scratchRight;
+ l.length = u3.length = points.length - 1;
+ d.length = r.length = points.length;
+ let i;
+ l[0] = d[0] = 1;
+ u3[0] = 0;
+ let right = r[0];
+ if (!defined_default(right)) {
+ right = r[0] = new Cartesian3_default();
+ }
+ Cartesian3_default.clone(firstTangent, right);
+ for (i = 1; i < l.length - 1; ++i) {
+ l[i] = u3[i] = 1;
+ d[i] = 4;
+ right = r[i];
+ if (!defined_default(right)) {
+ right = r[i] = new Cartesian3_default();
+ }
+ Cartesian3_default.subtract(points[i + 1], points[i - 1], right);
+ Cartesian3_default.multiplyByScalar(right, 3, right);
+ }
+ l[i] = 0;
+ u3[i] = 1;
+ d[i] = 4;
+ right = r[i];
+ if (!defined_default(right)) {
+ right = r[i] = new Cartesian3_default();
+ }
+ Cartesian3_default.subtract(points[i + 1], points[i - 1], right);
+ Cartesian3_default.multiplyByScalar(right, 3, right);
+ d[i + 1] = 1;
+ right = r[i + 1];
+ if (!defined_default(right)) {
+ right = r[i + 1] = new Cartesian3_default();
+ }
+ Cartesian3_default.clone(lastTangent, right);
+ return TridiagonalSystemSolver_default.solve(l, d, u3, r);
+}
+function generateNatural(points) {
+ const l = scratchLower;
+ const u3 = scratchUpper;
+ const d = scratchDiagonal;
+ const r = scratchRight;
+ l.length = u3.length = points.length - 1;
+ d.length = r.length = points.length;
+ let i;
+ l[0] = u3[0] = 1;
+ d[0] = 2;
+ let right = r[0];
+ if (!defined_default(right)) {
+ right = r[0] = new Cartesian3_default();
+ }
+ Cartesian3_default.subtract(points[1], points[0], right);
+ Cartesian3_default.multiplyByScalar(right, 3, right);
+ for (i = 1; i < l.length; ++i) {
+ l[i] = u3[i] = 1;
+ d[i] = 4;
+ right = r[i];
+ if (!defined_default(right)) {
+ right = r[i] = new Cartesian3_default();
+ }
+ Cartesian3_default.subtract(points[i + 1], points[i - 1], right);
+ Cartesian3_default.multiplyByScalar(right, 3, right);
+ }
+ d[i] = 2;
+ right = r[i];
+ if (!defined_default(right)) {
+ right = r[i] = new Cartesian3_default();
+ }
+ Cartesian3_default.subtract(points[i], points[i - 1], right);
+ Cartesian3_default.multiplyByScalar(right, 3, right);
+ return TridiagonalSystemSolver_default.solve(l, d, u3, r);
+}
+function HermiteSpline(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const points = options.points;
+ const times = options.times;
+ const inTangents = options.inTangents;
+ const outTangents = options.outTangents;
+ if (!defined_default(points) || !defined_default(times) || !defined_default(inTangents) || !defined_default(outTangents)) {
+ throw new DeveloperError_default(
+ "times, points, inTangents, and outTangents are required."
+ );
+ }
+ if (points.length < 2) {
+ throw new DeveloperError_default(
+ "points.length must be greater than or equal to 2."
+ );
+ }
+ if (times.length !== points.length) {
+ throw new DeveloperError_default("times.length must be equal to points.length.");
+ }
+ if (inTangents.length !== outTangents.length || inTangents.length !== points.length - 1) {
+ throw new DeveloperError_default(
+ "inTangents and outTangents must have a length equal to points.length - 1."
+ );
+ }
+ this._times = times;
+ this._points = points;
+ this._pointType = Spline_default.getPointType(points[0]);
+ if (this._pointType !== Spline_default.getPointType(inTangents[0]) || this._pointType !== Spline_default.getPointType(outTangents[0])) {
+ throw new DeveloperError_default(
+ "inTangents and outTangents must be of the same type as points."
+ );
+ }
+ this._inTangents = inTangents;
+ this._outTangents = outTangents;
+ this._lastTimeIndex = 0;
+}
+Object.defineProperties(HermiteSpline.prototype, {
+ times: {
+ get: function() {
+ return this._times;
+ }
+ },
+ points: {
+ get: function() {
+ return this._points;
+ }
+ },
+ inTangents: {
+ get: function() {
+ return this._inTangents;
+ }
+ },
+ outTangents: {
+ get: function() {
+ return this._outTangents;
+ }
+ }
+});
+HermiteSpline.createC1 = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const times = options.times;
+ const points = options.points;
+ const tangents = options.tangents;
+ if (!defined_default(points) || !defined_default(times) || !defined_default(tangents)) {
+ throw new DeveloperError_default("points, times and tangents are required.");
+ }
+ if (points.length < 2) {
+ throw new DeveloperError_default(
+ "points.length must be greater than or equal to 2."
+ );
+ }
+ if (times.length !== points.length || times.length !== tangents.length) {
+ throw new DeveloperError_default(
+ "times, points and tangents must have the same length."
+ );
+ }
+ const outTangents = tangents.slice(0, tangents.length - 1);
+ const inTangents = tangents.slice(1, tangents.length);
+ return new HermiteSpline({
+ times,
+ points,
+ inTangents,
+ outTangents
+ });
+};
+HermiteSpline.createNaturalCubic = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const times = options.times;
+ const points = options.points;
+ if (!defined_default(points) || !defined_default(times)) {
+ throw new DeveloperError_default("points and times are required.");
+ }
+ if (points.length < 2) {
+ throw new DeveloperError_default(
+ "points.length must be greater than or equal to 2."
+ );
+ }
+ if (times.length !== points.length) {
+ throw new DeveloperError_default("times.length must be equal to points.length.");
+ }
+ if (points.length < 3) {
+ return new LinearSpline_default({
+ points,
+ times
+ });
+ }
+ const tangents = generateNatural(points);
+ const outTangents = tangents.slice(0, tangents.length - 1);
+ const inTangents = tangents.slice(1, tangents.length);
+ return new HermiteSpline({
+ times,
+ points,
+ inTangents,
+ outTangents
+ });
+};
+HermiteSpline.createClampedCubic = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const times = options.times;
+ const points = options.points;
+ const firstTangent = options.firstTangent;
+ const lastTangent = options.lastTangent;
+ if (!defined_default(points) || !defined_default(times) || !defined_default(firstTangent) || !defined_default(lastTangent)) {
+ throw new DeveloperError_default(
+ "points, times, firstTangent and lastTangent are required."
+ );
+ }
+ if (points.length < 2) {
+ throw new DeveloperError_default(
+ "points.length must be greater than or equal to 2."
+ );
+ }
+ if (times.length !== points.length) {
+ throw new DeveloperError_default("times.length must be equal to points.length.");
+ }
+ const PointType = Spline_default.getPointType(points[0]);
+ if (PointType !== Spline_default.getPointType(firstTangent) || PointType !== Spline_default.getPointType(lastTangent)) {
+ throw new DeveloperError_default(
+ "firstTangent and lastTangent must be of the same type as points."
+ );
+ }
+ if (points.length < 3) {
+ return new LinearSpline_default({
+ points,
+ times
+ });
+ }
+ const tangents = generateClamped(points, firstTangent, lastTangent);
+ const outTangents = tangents.slice(0, tangents.length - 1);
+ const inTangents = tangents.slice(1, tangents.length);
+ return new HermiteSpline({
+ times,
+ points,
+ inTangents,
+ outTangents
+ });
+};
+HermiteSpline.hermiteCoefficientMatrix = new Matrix4_default(
+ 2,
+ -3,
+ 0,
+ 1,
+ -2,
+ 3,
+ 0,
+ 0,
+ 1,
+ -2,
+ 1,
+ 0,
+ 1,
+ -1,
+ 0,
+ 0
+);
+HermiteSpline.prototype.findTimeInterval = Spline_default.prototype.findTimeInterval;
+var scratchTimeVec = new Cartesian4_default();
+var scratchTemp = new Cartesian3_default();
+HermiteSpline.prototype.wrapTime = Spline_default.prototype.wrapTime;
+HermiteSpline.prototype.clampTime = Spline_default.prototype.clampTime;
+HermiteSpline.prototype.evaluate = function(time, result) {
+ const points = this.points;
+ const times = this.times;
+ const inTangents = this.inTangents;
+ const outTangents = this.outTangents;
+ this._lastTimeIndex = this.findTimeInterval(time, this._lastTimeIndex);
+ const i = this._lastTimeIndex;
+ const timesDelta = times[i + 1] - times[i];
+ const u3 = (time - times[i]) / timesDelta;
+ const timeVec = scratchTimeVec;
+ timeVec.z = u3;
+ timeVec.y = u3 * u3;
+ timeVec.x = timeVec.y * u3;
+ timeVec.w = 1;
+ const coefs = Matrix4_default.multiplyByVector(
+ HermiteSpline.hermiteCoefficientMatrix,
+ timeVec,
+ timeVec
+ );
+ coefs.z *= timesDelta;
+ coefs.w *= timesDelta;
+ const PointType = this._pointType;
+ if (PointType === Number) {
+ return points[i] * coefs.x + points[i + 1] * coefs.y + outTangents[i] * coefs.z + inTangents[i] * coefs.w;
+ }
+ if (!defined_default(result)) {
+ result = new PointType();
+ }
+ result = PointType.multiplyByScalar(points[i], coefs.x, result);
+ PointType.multiplyByScalar(points[i + 1], coefs.y, scratchTemp);
+ PointType.add(result, scratchTemp, result);
+ PointType.multiplyByScalar(outTangents[i], coefs.z, scratchTemp);
+ PointType.add(result, scratchTemp, result);
+ PointType.multiplyByScalar(inTangents[i], coefs.w, scratchTemp);
+ return PointType.add(result, scratchTemp, result);
+};
+var HermiteSpline_default = HermiteSpline;
+
+// Source/Core/SteppedSpline.js
+function SteppedSpline(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const points = options.points;
+ const times = options.times;
+ if (!defined_default(points) || !defined_default(times)) {
+ throw new DeveloperError_default("points and times are required.");
+ }
+ if (points.length < 2) {
+ throw new DeveloperError_default(
+ "points.length must be greater than or equal to 2."
+ );
+ }
+ if (times.length !== points.length) {
+ throw new DeveloperError_default("times.length must be equal to points.length.");
+ }
+ this._times = times;
+ this._points = points;
+ this._pointType = Spline_default.getPointType(points[0]);
+ this._lastTimeIndex = 0;
+}
+Object.defineProperties(SteppedSpline.prototype, {
+ times: {
+ get: function() {
+ return this._times;
+ }
+ },
+ points: {
+ get: function() {
+ return this._points;
+ }
+ }
+});
+SteppedSpline.prototype.findTimeInterval = Spline_default.prototype.findTimeInterval;
+SteppedSpline.prototype.wrapTime = Spline_default.prototype.wrapTime;
+SteppedSpline.prototype.clampTime = Spline_default.prototype.clampTime;
+SteppedSpline.prototype.evaluate = function(time, result) {
+ const points = this.points;
+ this._lastTimeIndex = this.findTimeInterval(time, this._lastTimeIndex);
+ const i = this._lastTimeIndex;
+ const PointType = this._pointType;
+ if (PointType === Number) {
+ return points[i];
+ }
+ if (!defined_default(result)) {
+ result = new PointType();
+ }
+ return PointType.clone(points[i], result);
+};
+var SteppedSpline_default = SteppedSpline;
+
+// Source/Core/QuaternionSpline.js
+function createEvaluateFunction(spline) {
+ const points = spline.points;
+ const times = spline.times;
+ return function(time, result) {
+ if (!defined_default(result)) {
+ result = new Quaternion_default();
+ }
+ const i = spline._lastTimeIndex = spline.findTimeInterval(
+ time,
+ spline._lastTimeIndex
+ );
+ const u3 = (time - times[i]) / (times[i + 1] - times[i]);
+ const q0 = points[i];
+ const q12 = points[i + 1];
+ return Quaternion_default.fastSlerp(q0, q12, u3, result);
+ };
+}
+function QuaternionSpline(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const points = options.points;
+ const times = options.times;
+ if (!defined_default(points) || !defined_default(times)) {
+ throw new DeveloperError_default("points and times are required.");
+ }
+ if (points.length < 2) {
+ throw new DeveloperError_default(
+ "points.length must be greater than or equal to 2."
+ );
+ }
+ if (times.length !== points.length) {
+ throw new DeveloperError_default("times.length must be equal to points.length.");
+ }
+ this._times = times;
+ this._points = points;
+ this._evaluateFunction = createEvaluateFunction(this);
+ this._lastTimeIndex = 0;
+}
+Object.defineProperties(QuaternionSpline.prototype, {
+ times: {
+ get: function() {
+ return this._times;
+ }
+ },
+ points: {
+ get: function() {
+ return this._points;
+ }
+ }
+});
+QuaternionSpline.prototype.findTimeInterval = Spline_default.prototype.findTimeInterval;
+QuaternionSpline.prototype.wrapTime = Spline_default.prototype.wrapTime;
+QuaternionSpline.prototype.clampTime = Spline_default.prototype.clampTime;
+QuaternionSpline.prototype.evaluate = function(time, result) {
+ return this._evaluateFunction(time, result);
+};
+var QuaternionSpline_default = QuaternionSpline;
+
+// Source/Scene/Model/ModelAnimationChannel.js
+var AnimatedPropertyType3 = ModelComponents_default.AnimatedPropertyType;
+function ModelAnimationChannel(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const channel = options.channel;
+ const runtimeAnimation = options.runtimeAnimation;
+ const runtimeNode = options.runtimeNode;
+ Check_default.typeOf.object("options.channel", channel);
+ Check_default.typeOf.object("options.runtimeAnimation", runtimeAnimation);
+ Check_default.typeOf.object("options.runtimeNode", runtimeNode);
+ this._channel = channel;
+ this._runtimeAnimation = runtimeAnimation;
+ this._runtimeNode = runtimeNode;
+ this._splines = [];
+ this._path = void 0;
+ initialize10(this);
+}
+Object.defineProperties(ModelAnimationChannel.prototype, {
+ channel: {
+ get: function() {
+ return this._channel;
+ }
+ },
+ runtimeAnimation: {
+ get: function() {
+ return this._runtimeAnimation;
+ }
+ },
+ runtimeNode: {
+ get: function() {
+ return this._runtimeNode;
+ }
+ },
+ splines: {
+ get: function() {
+ return this._splines;
+ }
+ }
+});
+function createCubicSpline(times, points) {
+ const cubicPoints = [];
+ const inTangents = [];
+ const outTangents = [];
+ const length3 = points.length;
+ for (let i = 0; i < length3; i += 3) {
+ inTangents.push(points[i]);
+ cubicPoints.push(points[i + 1]);
+ outTangents.push(points[i + 2]);
+ }
+ inTangents.splice(0, 1);
+ outTangents.length = outTangents.length - 1;
+ return new HermiteSpline_default({
+ times,
+ points: cubicPoints,
+ inTangents,
+ outTangents
+ });
+}
+function createSpline(times, points, interpolation, path) {
+ if (times.length === 1 && points.length === 1) {
+ return new ConstantSpline_default(points[0]);
+ }
+ switch (interpolation) {
+ case InterpolationType_default.STEP:
+ return new SteppedSpline_default({
+ times,
+ points
+ });
+ case InterpolationType_default.CUBICSPLINE:
+ return createCubicSpline(times, points);
+ case InterpolationType_default.LINEAR:
+ if (path === AnimatedPropertyType3.ROTATION) {
+ return new QuaternionSpline_default({
+ times,
+ points
+ });
+ }
+ return new LinearSpline_default({
+ times,
+ points
+ });
+ }
+}
+function createSplines(times, points, interpolation, path, count) {
+ const splines = [];
+ if (path === AnimatedPropertyType3.WEIGHTS) {
+ const pointsLength = points.length;
+ const outputLength = pointsLength / count;
+ let targetIndex, i;
+ for (targetIndex = 0; targetIndex < count; targetIndex++) {
+ const output = new Array(outputLength);
+ let pointsIndex = targetIndex;
+ if (interpolation === InterpolationType_default.CUBICSPLINE) {
+ for (i = 0; i < outputLength; i += 3) {
+ output[i] = points[pointsIndex];
+ output[i + 1] = points[pointsIndex + count];
+ output[i + 2] = points[pointsIndex + 2 * count];
+ pointsIndex += count * 3;
+ }
+ } else {
+ for (i = 0; i < outputLength; i++) {
+ output[i] = points[pointsIndex];
+ pointsIndex += count;
+ }
+ }
+ splines.push(createSpline(times, output, interpolation, path));
+ }
+ } else {
+ splines.push(createSpline(times, points, interpolation, path));
+ }
+ return splines;
+}
+var scratchVariable;
+function initialize10(runtimeChannel) {
+ const channel = runtimeChannel._channel;
+ const sampler = channel.sampler;
+ const times = sampler.input;
+ const points = sampler.output;
+ const interpolation = sampler.interpolation;
+ const target = channel.target;
+ const path = target.path;
+ const runtimeNode = runtimeChannel._runtimeNode;
+ const count = defined_default(runtimeNode.morphWeights) ? runtimeNode.morphWeights.length : 1;
+ const splines = createSplines(times, points, interpolation, path, count);
+ runtimeChannel._splines = splines;
+ runtimeChannel._path = path;
+ switch (path) {
+ case AnimatedPropertyType3.TRANSLATION:
+ case AnimatedPropertyType3.SCALE:
+ scratchVariable = new Cartesian3_default();
+ break;
+ case AnimatedPropertyType3.ROTATION:
+ scratchVariable = new Quaternion_default();
+ break;
+ case AnimatedPropertyType3.WEIGHTS:
+ break;
+ }
+}
+ModelAnimationChannel.prototype.animate = function(time) {
+ const splines = this._splines;
+ const path = this._path;
+ const model = this._runtimeAnimation.model;
+ const runtimeNode = this._runtimeNode;
+ if (path === AnimatedPropertyType3.WEIGHTS) {
+ const morphWeights = runtimeNode.morphWeights;
+ const length3 = morphWeights.length;
+ for (let i = 0; i < length3; i++) {
+ const spline = splines[i];
+ const localAnimationTime = model.clampAnimations ? spline.clampTime(time) : spline.wrapTime(time);
+ morphWeights[i] = spline.evaluate(localAnimationTime);
+ }
+ } else if (runtimeNode.userAnimated) {
+ return;
+ } else {
+ const spline = splines[0];
+ const localAnimationTime = model.clampAnimations ? spline.clampTime(time) : spline.wrapTime(time);
+ runtimeNode[path] = spline.evaluate(localAnimationTime, scratchVariable);
+ }
+};
+var ModelAnimationChannel_default = ModelAnimationChannel;
+
+// Source/Scene/Model/ModelAnimation.js
+function ModelAnimation(model, animation, options) {
+ this._animation = animation;
+ this._name = animation.name;
+ this._runtimeChannels = void 0;
+ this._startTime = JulianDate_default.clone(options.startTime);
+ this._delay = defaultValue_default(options.delay, 0);
+ this._stopTime = JulianDate_default.clone(options.stopTime);
+ this.removeOnStop = defaultValue_default(options.removeOnStop, false);
+ this._multiplier = defaultValue_default(options.multiplier, 1);
+ this._reverse = defaultValue_default(options.reverse, false);
+ this._loop = defaultValue_default(options.loop, ModelAnimationLoop_default.NONE);
+ this._animationTime = options.animationTime;
+ this._prevAnimationDelta = void 0;
+ this.start = new Event_default();
+ this.update = new Event_default();
+ this.stop = new Event_default();
+ this._state = ModelAnimationState_default.STOPPED;
+ this._computedStartTime = void 0;
+ this._duration = void 0;
+ const that = this;
+ this._raiseStartEvent = function() {
+ that.start.raiseEvent(model, that);
+ };
+ this._updateEventTime = 0;
+ this._raiseUpdateEvent = function() {
+ that.update.raiseEvent(model, that, that._updateEventTime);
+ };
+ this._raiseStopEvent = function() {
+ that.stop.raiseEvent(model, that);
+ };
+ this._model = model;
+ this._localStartTime = void 0;
+ this._localStopTime = void 0;
+ initialize11(this);
+}
+Object.defineProperties(ModelAnimation.prototype, {
+ animation: {
+ get: function() {
+ return this._animation;
+ }
+ },
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ runtimeChannels: {
+ get: function() {
+ return this._runtimeChannels;
+ }
+ },
+ model: {
+ get: function() {
+ return this._model;
+ }
+ },
+ localStartTime: {
+ get: function() {
+ return this._localStartTime;
+ }
+ },
+ localStopTime: {
+ get: function() {
+ return this._localStopTime;
+ }
+ },
+ startTime: {
+ get: function() {
+ return this._startTime;
+ }
+ },
+ delay: {
+ get: function() {
+ return this._delay;
+ }
+ },
+ stopTime: {
+ get: function() {
+ return this._stopTime;
+ }
+ },
+ multiplier: {
+ get: function() {
+ return this._multiplier;
+ }
+ },
+ reverse: {
+ get: function() {
+ return this._reverse;
+ }
+ },
+ loop: {
+ get: function() {
+ return this._loop;
+ }
+ },
+ animationTime: {
+ get: function() {
+ return this._animationTime;
+ }
+ }
+});
+function initialize11(runtimeAnimation) {
+ let localStartTime = Number.MAX_VALUE;
+ let localStopTime = -Number.MAX_VALUE;
+ const sceneGraph = runtimeAnimation._model.sceneGraph;
+ const animation = runtimeAnimation._animation;
+ const channels = animation.channels;
+ const length3 = channels.length;
+ const runtimeChannels = [];
+ for (let i = 0; i < length3; i++) {
+ const channel = channels[i];
+ const target = channel.target;
+ if (!defined_default(target)) {
+ continue;
+ }
+ const nodeIndex = target.node.index;
+ const runtimeNode = sceneGraph._runtimeNodes[nodeIndex];
+ const runtimeChannel = new ModelAnimationChannel_default({
+ channel,
+ runtimeAnimation,
+ runtimeNode
+ });
+ const times = channel.sampler.input;
+ localStartTime = Math.min(localStartTime, times[0]);
+ localStopTime = Math.max(localStopTime, times[times.length - 1]);
+ runtimeChannels.push(runtimeChannel);
+ }
+ runtimeAnimation._runtimeChannels = runtimeChannels;
+ runtimeAnimation._localStartTime = localStartTime;
+ runtimeAnimation._localStopTime = localStopTime;
+}
+ModelAnimation.prototype.animate = function(time) {
+ const runtimeChannels = this._runtimeChannels;
+ const length3 = runtimeChannels.length;
+ for (let i = 0; i < length3; i++) {
+ runtimeChannels[i].animate(time);
+ }
+};
+var ModelAnimation_default = ModelAnimation;
+
+// Source/Scene/Model/ModelAnimationCollection.js
+function ModelAnimationCollection(model) {
+ this.animationAdded = new Event_default();
+ this.animationRemoved = new Event_default();
+ this.animateWhilePaused = false;
+ this._model = model;
+ this._runtimeAnimations = [];
+ this._previousTime = void 0;
+}
+Object.defineProperties(ModelAnimationCollection.prototype, {
+ length: {
+ get: function() {
+ return this._runtimeAnimations.length;
+ }
+ },
+ model: {
+ get: function() {
+ return this._model;
+ }
+ }
+});
+function addAnimation(collection, animation, options) {
+ const model = collection._model;
+ const runtimeAnimation = new ModelAnimation_default(model, animation, options);
+ collection._runtimeAnimations.push(runtimeAnimation);
+ collection.animationAdded.raiseEvent(model, runtimeAnimation);
+ return runtimeAnimation;
+}
+ModelAnimationCollection.prototype.add = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const model = this._model;
+ if (!model.ready) {
+ throw new DeveloperError_default(
+ "Animations are not loaded. Wait for Model.readyPromise to resolve."
+ );
+ }
+ const animations = model.sceneGraph.components.animations;
+ if (!defined_default(options.name) && !defined_default(options.index)) {
+ throw new DeveloperError_default(
+ "Either options.name or options.index must be defined."
+ );
+ }
+ if (defined_default(options.multiplier) && options.multiplier <= 0) {
+ throw new DeveloperError_default("options.multiplier must be greater than zero.");
+ }
+ if (defined_default(options.index) && (options.index >= animations.length || options.index < 0)) {
+ throw new DeveloperError_default("options.index must be a valid animation index.");
+ }
+ let index = options.index;
+ if (defined_default(index)) {
+ return addAnimation(this, animations[index], options);
+ }
+ const length3 = animations.length;
+ for (let i = 0; i < length3; ++i) {
+ if (animations[i].name === options.name) {
+ index = i;
+ break;
+ }
+ }
+ if (!defined_default(index)) {
+ throw new DeveloperError_default("options.name must be a valid animation name.");
+ }
+ return addAnimation(this, animations[index], options);
+};
+ModelAnimationCollection.prototype.addAll = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const model = this._model;
+ if (!model.ready) {
+ throw new DeveloperError_default(
+ "Animations are not loaded. Wait for Model.readyPromise to resolve."
+ );
+ }
+ if (defined_default(options.multiplier) && options.multiplier <= 0) {
+ throw new DeveloperError_default("options.multiplier must be greater than zero.");
+ }
+ const animations = model.sceneGraph.components.animations;
+ const addedAnimations = [];
+ const length3 = animations.length;
+ for (let i = 0; i < length3; ++i) {
+ const animation = addAnimation(this, animations[i], options);
+ addedAnimations.push(animation);
+ }
+ return addedAnimations;
+};
+ModelAnimationCollection.prototype.remove = function(runtimeAnimation) {
+ if (!defined_default(runtimeAnimation)) {
+ return false;
+ }
+ const animations = this._runtimeAnimations;
+ const i = animations.indexOf(runtimeAnimation);
+ if (i !== -1) {
+ animations.splice(i, 1);
+ this.animationRemoved.raiseEvent(this._model, runtimeAnimation);
+ return true;
+ }
+ return false;
+};
+ModelAnimationCollection.prototype.removeAll = function() {
+ const model = this._model;
+ const animations = this._runtimeAnimations;
+ const length3 = animations.length;
+ this._runtimeAnimations.length = 0;
+ for (let i = 0; i < length3; ++i) {
+ this.animationRemoved.raiseEvent(model, animations[i]);
+ }
+};
+ModelAnimationCollection.prototype.contains = function(runtimeAnimation) {
+ if (defined_default(runtimeAnimation)) {
+ return this._runtimeAnimations.indexOf(runtimeAnimation) !== -1;
+ }
+ return false;
+};
+ModelAnimationCollection.prototype.get = function(index) {
+ if (!defined_default(index)) {
+ throw new DeveloperError_default("index is required.");
+ }
+ if (index >= this._runtimeAnimations.length || index < 0) {
+ throw new DeveloperError_default(
+ "index must be valid within the range of the collection"
+ );
+ }
+ return this._runtimeAnimations[index];
+};
+var animationsToRemove = [];
+function createAnimationRemovedFunction(modelAnimationCollection, model, animation) {
+ return function() {
+ modelAnimationCollection.animationRemoved.raiseEvent(model, animation);
+ };
+}
+ModelAnimationCollection.prototype.update = function(frameState) {
+ const runtimeAnimations = this._runtimeAnimations;
+ let length3 = runtimeAnimations.length;
+ if (length3 === 0) {
+ this._previousTime = void 0;
+ return false;
+ }
+ if (!this.animateWhilePaused && JulianDate_default.equals(frameState.time, this._previousTime)) {
+ return false;
+ }
+ this._previousTime = JulianDate_default.clone(frameState.time, this._previousTime);
+ let animationOccurred = false;
+ const sceneTime = frameState.time;
+ const model = this._model;
+ for (let i = 0; i < length3; ++i) {
+ const runtimeAnimation = runtimeAnimations[i];
+ if (!defined_default(runtimeAnimation._computedStartTime)) {
+ runtimeAnimation._computedStartTime = JulianDate_default.addSeconds(
+ defaultValue_default(runtimeAnimation.startTime, sceneTime),
+ runtimeAnimation.delay,
+ new JulianDate_default()
+ );
+ }
+ if (!defined_default(runtimeAnimation._duration)) {
+ runtimeAnimation._duration = runtimeAnimation.localStopTime * (1 / runtimeAnimation.multiplier);
+ }
+ const startTime = runtimeAnimation._computedStartTime;
+ const duration = runtimeAnimation._duration;
+ const stopTime = runtimeAnimation.stopTime;
+ const pastStartTime = JulianDate_default.lessThanOrEquals(startTime, sceneTime);
+ const reachedStopTime = defined_default(stopTime) && JulianDate_default.greaterThan(sceneTime, stopTime);
+ let delta = 0;
+ if (duration !== 0) {
+ const seconds = JulianDate_default.secondsDifference(
+ reachedStopTime ? stopTime : sceneTime,
+ startTime
+ );
+ delta = defined_default(runtimeAnimation._animationTime) ? runtimeAnimation._animationTime(duration, seconds) : seconds / duration;
+ }
+ const repeat = runtimeAnimation.loop === ModelAnimationLoop_default.REPEAT || runtimeAnimation.loop === ModelAnimationLoop_default.MIRRORED_REPEAT;
+ const play = (pastStartTime || repeat && !defined_default(runtimeAnimation.startTime)) && (delta <= 1 || repeat) && !reachedStopTime;
+ if (delta === runtimeAnimation._prevAnimationDelta) {
+ const animationStopped = runtimeAnimation._state === ModelAnimationState_default.STOPPED;
+ if (play !== animationStopped) {
+ continue;
+ }
+ }
+ runtimeAnimation._prevAnimationDelta = delta;
+ if (play || runtimeAnimation._state === ModelAnimationState_default.ANIMATING) {
+ if (play && runtimeAnimation._state === ModelAnimationState_default.STOPPED) {
+ runtimeAnimation._state = ModelAnimationState_default.ANIMATING;
+ if (runtimeAnimation.start.numberOfListeners > 0) {
+ frameState.afterRender.push(runtimeAnimation._raiseStartEvent);
+ }
+ }
+ if (runtimeAnimation.loop === ModelAnimationLoop_default.REPEAT) {
+ delta = delta - Math.floor(delta);
+ } else if (runtimeAnimation.loop === ModelAnimationLoop_default.MIRRORED_REPEAT) {
+ const floor = Math.floor(delta);
+ const fract2 = delta - floor;
+ delta = floor % 2 === 1 ? 1 - fract2 : fract2;
+ }
+ if (runtimeAnimation.reverse) {
+ delta = 1 - delta;
+ }
+ let localAnimationTime = delta * duration * runtimeAnimation.multiplier;
+ localAnimationTime = Math_default.clamp(
+ localAnimationTime,
+ runtimeAnimation.localStartTime,
+ runtimeAnimation.localStopTime
+ );
+ runtimeAnimation.animate(localAnimationTime);
+ if (runtimeAnimation.update.numberOfListeners > 0) {
+ runtimeAnimation._updateEventTime = localAnimationTime;
+ frameState.afterRender.push(runtimeAnimation._raiseUpdateEvent);
+ }
+ animationOccurred = true;
+ if (!play) {
+ runtimeAnimation._state = ModelAnimationState_default.STOPPED;
+ if (runtimeAnimation.stop.numberOfListeners > 0) {
+ frameState.afterRender.push(runtimeAnimation._raiseStopEvent);
+ }
+ if (runtimeAnimation.removeOnStop) {
+ animationsToRemove.push(runtimeAnimation);
+ }
+ }
+ }
+ }
+ length3 = animationsToRemove.length;
+ for (let j = 0; j < length3; ++j) {
+ const animationToRemove = animationsToRemove[j];
+ runtimeAnimations.splice(runtimeAnimations.indexOf(animationToRemove), 1);
+ frameState.afterRender.push(
+ createAnimationRemovedFunction(this, model, animationToRemove)
+ );
+ }
+ animationsToRemove.length = 0;
+ return animationOccurred;
+};
+var ModelAnimationCollection_default = ModelAnimationCollection;
+
+// Source/Scene/Model/ModelFeature.js
+function ModelFeature(options) {
+ this._model = options.model;
+ this._featureTable = options.featureTable;
+ this._featureId = options.featureId;
+ this._color = void 0;
+}
+Object.defineProperties(ModelFeature.prototype, {
+ show: {
+ get: function() {
+ return this._featureTable.getShow(this._featureId);
+ },
+ set: function(value) {
+ this._featureTable.setShow(this._featureId, value);
+ }
+ },
+ color: {
+ get: function() {
+ if (!defined_default(this._color)) {
+ this._color = new Color_default();
+ }
+ return this._featureTable.getColor(this._featureId, this._color);
+ },
+ set: function(value) {
+ this._featureTable.setColor(this._featureId, value);
+ }
+ },
+ primitive: {
+ get: function() {
+ return this._model;
+ }
+ },
+ featureTable: {
+ get: function() {
+ return this._featureTable;
+ }
+ },
+ featureId: {
+ get: function() {
+ return this._featureId;
+ }
+ }
+});
+ModelFeature.prototype.hasProperty = function(name) {
+ return this._featureTable.hasProperty(this._featureId, name);
+};
+ModelFeature.prototype.getProperty = function(name) {
+ return this._featureTable.getProperty(this._featureId, name);
+};
+ModelFeature.prototype.getPropertyInherited = function(name) {
+ if (this._featureTable.hasPropertyBySemantic(this._featureId, name)) {
+ return this._featureTable.getPropertyBySemantic(this._featureId, name);
+ }
+ return this._featureTable.getProperty(this._featureId, name);
+};
+ModelFeature.prototype.getPropertyIds = function(results) {
+ return this._featureTable.getPropertyIds(results);
+};
+ModelFeature.prototype.setProperty = function(name, value) {
+ return this._featureTable.setProperty(this._featureId, name, value);
+};
+var ModelFeature_default = ModelFeature;
+
+// Source/Scene/Model/StyleCommandsNeeded.js
+var StyleCommandsNeeded2 = {
+ ALL_OPAQUE: 0,
+ ALL_TRANSLUCENT: 1,
+ OPAQUE_AND_TRANSLUCENT: 2
+};
+StyleCommandsNeeded2.getStyleCommandsNeeded = function(featuresLength, translucentFeaturesLength) {
+ if (translucentFeaturesLength === 0) {
+ return StyleCommandsNeeded2.ALL_OPAQUE;
+ } else if (translucentFeaturesLength === featuresLength) {
+ return StyleCommandsNeeded2.ALL_TRANSLUCENT;
+ }
+ return StyleCommandsNeeded2.OPAQUE_AND_TRANSLUCENT;
+};
+var StyleCommandsNeeded_default = Object.freeze(StyleCommandsNeeded2);
+
+// Source/Scene/Model/ModelType.js
+var ModelType = {
+ GLTF: "GLTF",
+ TILE_GLTF: "TILE_GLTF",
+ TILE_B3DM: "B3DM",
+ TILE_I3DM: "I3DM",
+ TILE_PNTS: "PNTS",
+ TILE_GEOJSON: "TILE_GEOJSON"
+};
+ModelType.is3DTiles = function(modelType) {
+ Check_default.typeOf.string("modelType", modelType);
+ switch (modelType) {
+ case ModelType.TILE_GLTF:
+ case ModelType.TILE_B3DM:
+ case ModelType.TILE_I3DM:
+ case ModelType.TILE_PNTS:
+ case ModelType.TILE_GEOJSON:
+ return true;
+ case ModelType.GLTF:
+ return false;
+ default:
+ throw new DeveloperError_default("modelType is not a valid value.");
+ }
+};
+var ModelType_default = Object.freeze(ModelType);
+
+// Source/Scene/Model/ModelFeatureTable.js
+function ModelFeatureTable(options) {
+ const model = options.model;
+ const propertyTable = options.propertyTable;
+ Check_default.typeOf.object("propertyTable", propertyTable);
+ Check_default.typeOf.object("model", model);
+ this._propertyTable = propertyTable;
+ this._model = model;
+ this._features = void 0;
+ this._featuresLength = 0;
+ this._batchTexture = void 0;
+ this._styleCommandsNeededDirty = false;
+ this._styleCommandsNeeded = StyleCommandsNeeded_default.ALL_OPAQUE;
+ initialize12(this);
+}
+Object.defineProperties(ModelFeatureTable.prototype, {
+ batchTexture: {
+ get: function() {
+ return this._batchTexture;
+ }
+ },
+ featuresLength: {
+ get: function() {
+ return this._featuresLength;
+ }
+ },
+ batchTextureByteLength: {
+ get: function() {
+ if (defined_default(this._batchTexture)) {
+ return this._batchTexture.byteLength;
+ }
+ return 0;
+ }
+ },
+ styleCommandsNeededDirty: {
+ get: function() {
+ return this._styleCommandsNeededDirty;
+ }
+ }
+});
+function initialize12(modelFeatureTable) {
+ const model = modelFeatureTable._model;
+ const is3DTiles = ModelType_default.is3DTiles(model.type);
+ const featuresLength = modelFeatureTable._propertyTable.count;
+ if (featuresLength === 0) {
+ return;
+ }
+ let i;
+ const features = new Array(featuresLength);
+ if (is3DTiles) {
+ const content = model.content;
+ for (i = 0; i < featuresLength; i++) {
+ features[i] = new Cesium3DTileFeature_default(content, i);
+ }
+ } else {
+ for (i = 0; i < featuresLength; i++) {
+ features[i] = new ModelFeature_default({
+ model,
+ featureId: i,
+ featureTable: modelFeatureTable
+ });
+ }
+ }
+ modelFeatureTable._features = features;
+ modelFeatureTable._featuresLength = featuresLength;
+ modelFeatureTable._batchTexture = new BatchTexture_default({
+ featuresLength,
+ owner: modelFeatureTable,
+ statistics: is3DTiles ? model.content.tileset.statistics : void 0
+ });
+}
+ModelFeatureTable.prototype.update = function(frameState) {
+ this._styleCommandsNeededDirty = false;
+ this._batchTexture.update(void 0, frameState);
+ const currentStyleCommandsNeeded = StyleCommandsNeeded_default.getStyleCommandsNeeded(
+ this._featuresLength,
+ this._batchTexture.translucentFeaturesLength
+ );
+ if (this._styleCommandsNeeded !== currentStyleCommandsNeeded) {
+ this._styleCommandsNeededDirty = true;
+ this._styleCommandsNeeded = currentStyleCommandsNeeded;
+ }
+};
+ModelFeatureTable.prototype.setShow = function(featureId, show) {
+ this._batchTexture.setShow(featureId, show);
+};
+ModelFeatureTable.prototype.setAllShow = function(show) {
+ this._batchTexture.setAllShow(show);
+};
+ModelFeatureTable.prototype.getShow = function(featureId) {
+ return this._batchTexture.getShow(featureId);
+};
+ModelFeatureTable.prototype.setColor = function(featureId, color) {
+ this._batchTexture.setColor(featureId, color);
+};
+ModelFeatureTable.prototype.setAllColor = function(color) {
+ this._batchTexture.setAllColor(color);
+};
+ModelFeatureTable.prototype.getColor = function(featureId, result) {
+ return this._batchTexture.getColor(featureId, result);
+};
+ModelFeatureTable.prototype.getPickColor = function(featureId) {
+ return this._batchTexture.getPickColor(featureId);
+};
+ModelFeatureTable.prototype.getFeature = function(featureId) {
+ return this._features[featureId];
+};
+ModelFeatureTable.prototype.hasProperty = function(featureId, propertyName) {
+ return this._propertyTable.hasProperty(featureId, propertyName);
+};
+ModelFeatureTable.prototype.hasPropertyBySemantic = function(featureId, propertyName) {
+ return this._propertyTable.hasPropertyBySemantic(featureId, propertyName);
+};
+ModelFeatureTable.prototype.getProperty = function(featureId, name) {
+ return this._propertyTable.getProperty(featureId, name);
+};
+ModelFeatureTable.prototype.getPropertyBySemantic = function(featureId, semantic) {
+ return this._propertyTable.getPropertyBySemantic(featureId, semantic);
+};
+ModelFeatureTable.prototype.getPropertyIds = function(results) {
+ return this._propertyTable.getPropertyIds(results);
+};
+ModelFeatureTable.prototype.setProperty = function(featureId, name, value) {
+ return this._propertyTable.setProperty(featureId, name, value);
+};
+ModelFeatureTable.prototype.isClass = function(featureId, className) {
+ return this._propertyTable.isClass(featureId, className);
+};
+ModelFeatureTable.prototype.isExactClass = function(featureId, className) {
+ return this._propertyTable.isExactClass(featureId, className);
+};
+ModelFeatureTable.prototype.getExactClassName = function(featureId) {
+ return this._propertyTable.getExactClassName(featureId);
+};
+var scratchColor6 = new Color_default();
+ModelFeatureTable.prototype.applyStyle = function(style) {
+ if (!defined_default(style)) {
+ this.setAllColor(BatchTexture_default.DEFAULT_COLOR_VALUE);
+ this.setAllShow(BatchTexture_default.DEFAULT_SHOW_VALUE);
+ return;
+ }
+ for (let i = 0; i < this._featuresLength; i++) {
+ const feature2 = this.getFeature(i);
+ const color = defined_default(style.color) ? defaultValue_default(
+ style.color.evaluateColor(feature2, scratchColor6),
+ BatchTexture_default.DEFAULT_COLOR_VALUE
+ ) : BatchTexture_default.DEFAULT_COLOR_VALUE;
+ const show = defined_default(style.show) ? defaultValue_default(
+ style.show.evaluate(feature2),
+ BatchTexture_default.DEFAULT_SHOW_VALUE
+ ) : BatchTexture_default.DEFAULT_SHOW_VALUE;
+ this.setColor(i, color);
+ this.setShow(i, show);
+ }
+};
+ModelFeatureTable.prototype.isDestroyed = function() {
+ return false;
+};
+ModelFeatureTable.prototype.destroy = function(frameState) {
+ this._batchTexture = this._batchTexture && this._batchTexture.destroy();
+ destroyObject_default(this);
+};
+var ModelFeatureTable_default = ModelFeatureTable;
+
+// Source/Shaders/Model/ModelFS.js
+var ModelFS_default = "#if defined(HAS_NORMALS) && !defined(HAS_TANGENTS) && !defined(LIGHTING_UNLIT)\n #ifdef GL_OES_standard_derivatives\n #extension GL_OES_standard_derivatives : enable\n #endif\n#endif\n\nczm_modelMaterial defaultModelMaterial()\n{\n czm_modelMaterial material;\n material.diffuse = vec3(0.0);\n material.specular = vec3(1.0);\n material.roughness = 1.0;\n material.occlusion = 1.0;\n material.normalEC = vec3(0.0, 0.0, 1.0);\n material.emissive = vec3(0.0);\n material.alpha = 1.0;\n return material;\n}\n\nvec4 handleAlpha(vec3 color, float alpha)\n{\n #ifdef ALPHA_MODE_MASK\n if (alpha < u_alphaCutoff) {\n discard;\n }\n #endif\n\n return vec4(color, alpha);\n}\n\nSelectedFeature selectedFeature;\n\nvoid main()\n{\n #ifdef HAS_MODEL_SPLITTER\n modelSplitterStage();\n #endif\n\n czm_modelMaterial material = defaultModelMaterial();\n\n ProcessedAttributes attributes;\n geometryStage(attributes);\n\n FeatureIds featureIds;\n featureIdStage(featureIds, attributes);\n\n Metadata metadata;\n MetadataClass metadataClass;\n MetadataStatistics metadataStatistics;\n metadataStage(metadata, metadataClass, metadataStatistics, attributes);\n\n #ifdef HAS_SELECTED_FEATURE_ID\n selectedFeatureIdStage(selectedFeature, featureIds);\n #endif\n\n #ifndef CUSTOM_SHADER_REPLACE_MATERIAL\n materialStage(material, attributes, selectedFeature);\n #endif\n\n #ifdef HAS_CUSTOM_FRAGMENT_SHADER\n customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);\n #endif\n\n lightingStage(material, attributes);\n\n #ifdef HAS_SELECTED_FEATURE_ID\n cpuStylingStage(material, selectedFeature);\n #endif\n\n #ifdef HAS_MODEL_COLOR\n modelColorStage(material);\n #endif\n\n #ifdef HAS_PRIMITIVE_OUTLINE\n primitiveOutlineStage(material);\n #endif\n\n vec4 color = handleAlpha(material.diffuse, material.alpha);\n\n #ifdef HAS_CLIPPING_PLANES\n modelClippingPlanesStage(color);\n #endif\n\n #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)\n silhouetteStage(color);\n #endif\n\n gl_FragColor = color;\n}\n";
+
+// Source/Shaders/Model/ModelVS.js
+var ModelVS_default = "precision highp float;\n\nczm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {\n czm_modelVertexOutput vsOutput;\n vsOutput.positionMC = positionMC;\n vsOutput.pointSize = 1.0;\n return vsOutput;\n}\n\nvoid main() \n{\n // Initialize the attributes struct with all\n // attributes except quantized ones.\n ProcessedAttributes attributes;\n initializeAttributes(attributes);\n\n // Dequantize the quantized ones and add them to the\n // attributes struct.\n #ifdef USE_DEQUANTIZATION\n dequantizationStage(attributes);\n #endif\n\n #ifdef HAS_MORPH_TARGETS\n morphTargetsStage(attributes);\n #endif\n\n #ifdef HAS_SKINNING\n skinningStage(attributes);\n #endif\n\n #ifdef HAS_PRIMITIVE_OUTLINE\n primitiveOutlineStage();\n #endif\n\n // Compute the bitangent according to the formula in the glTF spec.\n // Normal and tangents can be affected by morphing and skinning, so\n // the bitangent should not be computed until their values are finalized.\n #ifdef HAS_BITANGENTS\n attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);\n #endif\n\n FeatureIds featureIds;\n featureIdStage(featureIds, attributes);\n\n #ifdef HAS_SELECTED_FEATURE_ID\n SelectedFeature feature;\n selectedFeatureIdStage(feature, featureIds);\n // Handle any show properties that come from the style.\n cpuStylingStage(attributes.positionMC, feature);\n #endif\n\n #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)\n // The scene mode 2D pipeline stage and instancing stage add a different\n // model view matrix to accurately project the model to 2D. However, the\n // output positions and normals should be transformed by the 3D matrices\n // to keep the data the same for the fragment shader.\n mat4 modelView = czm_modelView3D;\n mat3 normal = czm_normal3D;\n #else\n // These are used for individual model projection because they will\n // automatically change based on the scene mode.\n mat4 modelView = czm_modelView;\n mat3 normal = czm_normal;\n #endif\n\n // Update the position for this instance in place\n #ifdef HAS_INSTANCING\n\n // The legacy instance stage is used when rendering i3dm models that \n // encode instances transforms in world space, as opposed to glTF models\n // that use EXT_mesh_gpu_instancing, where instance transforms are encoded\n // in object space.\n #ifdef USE_LEGACY_INSTANCING\n mat4 instanceModelView;\n mat3 instanceModelViewInverseTranspose;\n \n legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);\n\n modelView = instanceModelView;\n normal = instanceModelViewInverseTranspose;\n #else\n instancingStage(attributes);\n #endif\n\n #ifdef USE_PICKING\n v_pickColor = a_pickColor;\n #endif\n\n #endif\n\n Metadata metadata;\n MetadataClass metadataClass;\n MetadataStatistics metadataStatistics;\n metadataStage(metadata, metadataClass, metadataStatistics, attributes);\n\n #ifdef HAS_CUSTOM_VERTEX_SHADER\n czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);\n customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);\n #endif\n\n // Compute the final position in each coordinate system needed.\n // This returns the value that will be assigned to gl_Position.\n vec4 positionClip = geometryStage(attributes, modelView, normal); \n\n #ifdef HAS_SILHOUETTE\n silhouetteStage(attributes, positionClip);\n #endif\n\n #ifdef HAS_POINT_CLOUD_SHOW_STYLE\n float show = pointCloudShowStylingStage(attributes, metadata);\n #else\n float show = 1.0;\n #endif\n\n #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING\n show *= pointCloudBackFaceCullingStage();\n #endif\n\n #ifdef HAS_POINT_CLOUD_COLOR_STYLE\n v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);\n #endif\n\n #ifdef PRIMITIVE_TYPE_POINTS\n #ifdef HAS_CUSTOM_VERTEX_SHADER\n gl_PointSize = vsOutput.pointSize;\n #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)\n gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);\n #else\n gl_PointSize = 1.0;\n #endif\n\n gl_PointSize *= show;\n #endif\n\n gl_Position = show * positionClip;\n}\n";
+
+// Source/Scene/Model/ClassificationModelDrawCommand.js
+function ClassificationModelDrawCommand(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const command = options.command;
+ const renderResources = options.primitiveRenderResources;
+ Check_default.typeOf.object("options.command", command);
+ Check_default.typeOf.object("options.primitiveRenderResources", renderResources);
+ const model = renderResources.model;
+ this._command = command;
+ this._model = model;
+ this._runtimePrimitive = renderResources.runtimePrimitive;
+ this._modelMatrix = command.modelMatrix;
+ this._boundingVolume = command.boundingVolume;
+ this._cullFace = command.renderState.cull.face;
+ const type = model.classificationType;
+ this._classificationType = type;
+ this._classifiesTerrain = type !== ClassificationType_default.CESIUM_3D_TILE;
+ this._classifies3DTiles = type !== ClassificationType_default.TERRAIN;
+ this._useDebugWireframe = model._enableDebugWireframe && model.debugWireframe;
+ this._pickId = renderResources.pickId;
+ this._commandListTerrain = [];
+ this._commandList3DTiles = [];
+ this._commandListIgnoreShow = [];
+ this._commandListDebugWireframe = [];
+ this._commandListTerrainPicking = [];
+ this._commandList3DTilesPicking = [];
+ initialize13(this);
+}
+function getStencilDepthRenderState3(stencilFunction) {
+ return {
+ colorMask: {
+ red: false,
+ green: false,
+ blue: false,
+ alpha: false
+ },
+ stencilTest: {
+ enabled: true,
+ frontFunction: stencilFunction,
+ frontOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.DECREMENT_WRAP,
+ zPass: StencilOperation_default.KEEP
+ },
+ backFunction: stencilFunction,
+ backOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.INCREMENT_WRAP,
+ zPass: StencilOperation_default.KEEP
+ },
+ reference: StencilConstants_default.CESIUM_3D_TILE_MASK,
+ mask: StencilConstants_default.CESIUM_3D_TILE_MASK
+ },
+ stencilMask: StencilConstants_default.CLASSIFICATION_MASK,
+ depthTest: {
+ enabled: true,
+ func: DepthFunction_default.LESS_OR_EQUAL
+ },
+ depthMask: false
+ };
+}
+var colorRenderState2 = {
+ stencilTest: {
+ enabled: true,
+ frontFunction: StencilFunction_default.NOT_EQUAL,
+ frontOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ backFunction: StencilFunction_default.NOT_EQUAL,
+ backOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ reference: 0,
+ mask: StencilConstants_default.CLASSIFICATION_MASK
+ },
+ stencilMask: StencilConstants_default.CLASSIFICATION_MASK,
+ depthTest: {
+ enabled: false
+ },
+ depthMask: false,
+ blending: BlendingState_default.PRE_MULTIPLIED_ALPHA_BLEND
+};
+var pickRenderState3 = {
+ stencilTest: {
+ enabled: true,
+ frontFunction: StencilFunction_default.NOT_EQUAL,
+ frontOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ backFunction: StencilFunction_default.NOT_EQUAL,
+ backOperation: {
+ fail: StencilOperation_default.ZERO,
+ zFail: StencilOperation_default.ZERO,
+ zPass: StencilOperation_default.ZERO
+ },
+ reference: 0,
+ mask: StencilConstants_default.CLASSIFICATION_MASK
+ },
+ stencilMask: StencilConstants_default.CLASSIFICATION_MASK,
+ depthTest: {
+ enabled: false
+ },
+ depthMask: false
+};
+var scratchDerivedCommands = [];
+function initialize13(drawCommand) {
+ const command = drawCommand._command;
+ const derivedCommands = scratchDerivedCommands;
+ if (drawCommand._useDebugWireframe) {
+ command.pass = Pass_default.OPAQUE;
+ derivedCommands.length = 0;
+ derivedCommands.push(command);
+ drawCommand._commandListDebugWireframe = createBatchCommands(
+ drawCommand,
+ derivedCommands,
+ drawCommand._commandListDebugWireframe
+ );
+ const commandList = drawCommand._commandListDebugWireframe;
+ const length3 = commandList.length;
+ for (let i = 0; i < length3; i++) {
+ const command2 = commandList[i];
+ command2.count *= 2;
+ command2.offset *= 2;
+ }
+ return;
+ }
+ const model = drawCommand.model;
+ const allowPicking = model.allowPicking;
+ if (drawCommand._classifiesTerrain) {
+ const pass = Pass_default.TERRAIN_CLASSIFICATION;
+ const stencilDepthCommand = deriveStencilDepthCommand(command, pass);
+ const colorCommand = deriveColorCommand(command, pass);
+ derivedCommands.length = 0;
+ derivedCommands.push(stencilDepthCommand, colorCommand);
+ drawCommand._commandListTerrain = createBatchCommands(
+ drawCommand,
+ derivedCommands,
+ drawCommand._commandListTerrain
+ );
+ if (allowPicking) {
+ drawCommand._commandListTerrainPicking = createPickCommands3(
+ drawCommand,
+ derivedCommands,
+ drawCommand._commandListTerrainPicking
+ );
+ }
+ }
+ if (drawCommand._classifies3DTiles) {
+ const pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ const stencilDepthCommand = deriveStencilDepthCommand(command, pass);
+ const colorCommand = deriveColorCommand(command, pass);
+ derivedCommands.length = 0;
+ derivedCommands.push(stencilDepthCommand, colorCommand);
+ drawCommand._commandList3DTiles = createBatchCommands(
+ drawCommand,
+ derivedCommands,
+ drawCommand._commandList3DTiles
+ );
+ if (allowPicking) {
+ drawCommand._commandList3DTilesPicking = createPickCommands3(
+ drawCommand,
+ derivedCommands,
+ drawCommand._commandList3DTilesPicking
+ );
+ }
+ }
+}
+function createBatchCommands(drawCommand, derivedCommands, result) {
+ const runtimePrimitive = drawCommand._runtimePrimitive;
+ const batchLengths = runtimePrimitive.batchLengths;
+ const batchOffsets = runtimePrimitive.batchOffsets;
+ const numBatches = batchLengths.length;
+ const numDerivedCommands = derivedCommands.length;
+ for (let i = 0; i < numBatches; i++) {
+ const batchLength = batchLengths[i];
+ const batchOffset = batchOffsets[i];
+ for (let j = 0; j < numDerivedCommands; j++) {
+ const derivedCommand = derivedCommands[j];
+ const batchCommand = DrawCommand_default.shallowClone(derivedCommand);
+ batchCommand.count = batchLength;
+ batchCommand.offset = batchOffset;
+ result.push(batchCommand);
+ }
+ }
+ return result;
+}
+function deriveStencilDepthCommand(command, pass) {
+ const stencilDepthCommand = DrawCommand_default.shallowClone(command);
+ stencilDepthCommand.cull = false;
+ stencilDepthCommand.pass = pass;
+ const stencilFunction = pass === Pass_default.TERRAIN_CLASSIFICATION ? StencilFunction_default.ALWAYS : StencilFunction_default.EQUAL;
+ const renderState = getStencilDepthRenderState3(stencilFunction);
+ stencilDepthCommand.renderState = RenderState_default.fromCache(renderState);
+ return stencilDepthCommand;
+}
+function deriveColorCommand(command, pass) {
+ const colorCommand = DrawCommand_default.shallowClone(command);
+ colorCommand.cull = false;
+ colorCommand.pass = pass;
+ colorCommand.renderState = RenderState_default.fromCache(colorRenderState2);
+ return colorCommand;
+}
+var scratchPickCommands = [];
+function createPickCommands3(drawCommand, derivedCommands, commandList) {
+ const renderState = RenderState_default.fromCache(pickRenderState3);
+ const stencilDepthCommand = derivedCommands[0];
+ const colorCommand = derivedCommands[1];
+ const pickStencilDepthCommand = DrawCommand_default.shallowClone(stencilDepthCommand);
+ pickStencilDepthCommand.cull = true;
+ pickStencilDepthCommand.pickOnly = true;
+ const pickColorCommand = DrawCommand_default.shallowClone(colorCommand);
+ pickColorCommand.cull = true;
+ pickColorCommand.pickOnly = true;
+ pickColorCommand.renderState = renderState;
+ pickColorCommand.pickId = drawCommand._pickId;
+ const pickCommands = scratchPickCommands;
+ pickCommands.length = 0;
+ pickCommands.push(pickStencilDepthCommand, pickColorCommand);
+ return createBatchCommands(drawCommand, pickCommands, commandList);
+}
+Object.defineProperties(ClassificationModelDrawCommand.prototype, {
+ command: {
+ get: function() {
+ return this._command;
+ }
+ },
+ runtimePrimitive: {
+ get: function() {
+ return this._runtimePrimitive;
+ }
+ },
+ batchLengths: {
+ get: function() {
+ return this._runtimePrimitive.batchLengths;
+ }
+ },
+ batchOffsets: {
+ get: function() {
+ return this._runtimePrimitive.batchOffsets;
+ }
+ },
+ model: {
+ get: function() {
+ return this._model;
+ }
+ },
+ classificationType: {
+ get: function() {
+ return this._classificationType;
+ }
+ },
+ modelMatrix: {
+ get: function() {
+ return this._modelMatrix;
+ },
+ set: function(value) {
+ this._modelMatrix = Matrix4_default.clone(value, this._modelMatrix);
+ const boundingSphere = this._runtimePrimitive.boundingSphere;
+ this._boundingVolume = BoundingSphere_default.transform(
+ boundingSphere,
+ this._modelMatrix,
+ this._boundingVolume
+ );
+ }
+ },
+ boundingVolume: {
+ get: function() {
+ return this._boundingVolume;
+ }
+ },
+ cullFace: {
+ get: function() {
+ return this._cullFace;
+ },
+ set: function(value) {
+ this._cullFace = value;
+ }
+ }
+});
+ClassificationModelDrawCommand.prototype.pushCommands = function(frameState, result) {
+ const passes = frameState.passes;
+ if (passes.render) {
+ if (this._useDebugWireframe) {
+ result.push.apply(result, this._commandListDebugWireframe);
+ return;
+ }
+ if (this._classifiesTerrain) {
+ result.push.apply(result, this._commandListTerrain);
+ }
+ if (this._classifies3DTiles) {
+ result.push.apply(result, this._commandList3DTiles);
+ }
+ const useIgnoreShowCommands = frameState.invertClassification && this._classifies3DTiles;
+ if (useIgnoreShowCommands) {
+ if (this._commandListIgnoreShow.length === 0) {
+ const pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW;
+ const command = deriveStencilDepthCommand(this._command, pass);
+ const derivedCommands = scratchDerivedCommands;
+ derivedCommands.length = 0;
+ derivedCommands.push(command);
+ this._commandListIgnoreShow = createBatchCommands(
+ this,
+ derivedCommands,
+ this._commandListIgnoreShow
+ );
+ }
+ result.push.apply(result, this._commandListIgnoreShow);
+ }
+ }
+ if (passes.pick) {
+ if (this._classifiesTerrain) {
+ result.push.apply(result, this._commandListTerrainPicking);
+ }
+ if (this._classifies3DTiles) {
+ result.push.apply(result, this._commandList3DTilesPicking);
+ }
+ }
+ return result;
+};
+var ClassificationModelDrawCommand_default = ClassificationModelDrawCommand;
+
+// Source/Scene/Model/ModelDrawCommand.js
+function ModelDrawCommand(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const command = options.command;
+ const renderResources = options.primitiveRenderResources;
+ Check_default.typeOf.object("options.command", command);
+ Check_default.typeOf.object("options.primitiveRenderResources", renderResources);
+ const model = renderResources.model;
+ this._model = model;
+ const runtimePrimitive = renderResources.runtimePrimitive;
+ this._runtimePrimitive = runtimePrimitive;
+ const isTranslucent = command.pass === Pass_default.TRANSLUCENT;
+ const isDoubleSided = runtimePrimitive.primitive.material.doubleSided;
+ const usesBackFaceCulling = !isDoubleSided && !isTranslucent;
+ const hasSilhouette = renderResources.hasSilhouette;
+ const needsTranslucentCommand = !isTranslucent && !hasSilhouette;
+ const needsSkipLevelOfDetailCommands = renderResources.hasSkipLevelOfDetail && !isTranslucent;
+ const needsSilhouetteCommands = hasSilhouette;
+ this._command = command;
+ this._modelMatrix = Matrix4_default.clone(command.modelMatrix);
+ this._boundingVolume = BoundingSphere_default.clone(command.boundingVolume);
+ this._modelMatrix2D = new Matrix4_default();
+ this._boundingVolume2D = new BoundingSphere_default();
+ this._modelMatrix2DDirty = false;
+ this._backFaceCulling = command.renderState.cull.enabled;
+ this._cullFace = command.renderState.cull.face;
+ this._shadows = model.shadows;
+ this._debugShowBoundingVolume = command.debugShowBoundingVolume;
+ this._usesBackFaceCulling = usesBackFaceCulling;
+ this._needsTranslucentCommand = needsTranslucentCommand;
+ this._needsSkipLevelOfDetailCommands = needsSkipLevelOfDetailCommands;
+ this._needsSilhouetteCommands = needsSilhouetteCommands;
+ this._originalCommand = void 0;
+ this._translucentCommand = void 0;
+ this._skipLodBackfaceCommand = void 0;
+ this._skipLodStencilCommand = void 0;
+ this._silhouetteModelCommand = void 0;
+ this._silhouetteColorCommand = void 0;
+ this._derivedCommands = [];
+ this._has2DCommands = false;
+ initialize14(this);
+}
+function ModelDerivedCommand(options) {
+ this.command = options.command;
+ this.updateShadows = options.updateShadows;
+ this.updateBackFaceCulling = options.updateBackFaceCulling;
+ this.updateCullFace = options.updateCullFace;
+ this.updateDebugShowBoundingVolume = options.updateDebugShowBoundingVolume;
+ this.is2D = defaultValue_default(options.is2D, false);
+ this.derivedCommand2D = void 0;
+}
+ModelDerivedCommand.clone = function(derivedCommand) {
+ return new ModelDerivedCommand({
+ command: derivedCommand.command,
+ updateShadows: derivedCommand.updateShadows,
+ updateBackFaceCulling: derivedCommand.updateBackFaceCulling,
+ updateCullFace: derivedCommand.updateCullFace,
+ updateDebugShowBoundingVolume: derivedCommand.updateDebugShowBoundingVolume,
+ is2D: derivedCommand.is2D,
+ derivedCommand2D: derivedCommand.derivedCommand2D
+ });
+};
+function initialize14(drawCommand) {
+ const command = drawCommand._command;
+ command.modelMatrix = drawCommand._modelMatrix;
+ command.boundingVolume = drawCommand._boundingVolume;
+ const model = drawCommand._model;
+ const usesBackFaceCulling = drawCommand._usesBackFaceCulling;
+ const derivedCommands = drawCommand._derivedCommands;
+ drawCommand._originalCommand = new ModelDerivedCommand({
+ command,
+ updateShadows: true,
+ updateBackFaceCulling: usesBackFaceCulling,
+ updateCullFace: usesBackFaceCulling,
+ updateDebugShowBoundingVolume: true,
+ is2D: false
+ });
+ derivedCommands.push(drawCommand._originalCommand);
+ if (drawCommand._needsTranslucentCommand) {
+ drawCommand._translucentCommand = new ModelDerivedCommand({
+ command: deriveTranslucentCommand2(command),
+ updateShadows: true,
+ updateBackFaceCulling: false,
+ updateCullFace: false,
+ updateDebugShowBoundingVolume: true
+ });
+ derivedCommands.push(drawCommand._translucentCommand);
+ }
+ if (drawCommand._needsSkipLevelOfDetailCommands) {
+ drawCommand._skipLodBackfaceCommand = new ModelDerivedCommand({
+ command: deriveSkipLodBackfaceCommand(command),
+ updateShadows: false,
+ updateBackFaceCulling: false,
+ updateCullFace: usesBackFaceCulling,
+ updateDebugShowBoundingVolume: false
+ });
+ drawCommand._skipLodStencilCommand = new ModelDerivedCommand({
+ command: deriveSkipLodStencilCommand(command, model),
+ updateShadows: true,
+ updateBackFaceCulling: usesBackFaceCulling,
+ updateCullFace: usesBackFaceCulling,
+ updateDebugShowBoundingVolume: true
+ });
+ derivedCommands.push(drawCommand._skipLodBackfaceCommand);
+ derivedCommands.push(drawCommand._skipLodStencilCommand);
+ }
+ if (drawCommand._needsSilhouetteCommands) {
+ drawCommand._silhouetteModelCommand = new ModelDerivedCommand({
+ command: deriveSilhouetteModelCommand(command, model),
+ updateShadows: true,
+ updateBackFaceCulling: usesBackFaceCulling,
+ updateCullFace: usesBackFaceCulling,
+ updateDebugShowBoundingVolume: true
+ });
+ drawCommand._silhouetteColorCommand = new ModelDerivedCommand({
+ command: deriveSilhouetteColorCommand(command, model),
+ updateShadows: false,
+ updateBackFaceCulling: false,
+ updateCullFace: false,
+ updateDebugShowBoundingVolume: false
+ });
+ derivedCommands.push(drawCommand._silhouetteModelCommand);
+ derivedCommands.push(drawCommand._silhouetteColorCommand);
+ }
+}
+Object.defineProperties(ModelDrawCommand.prototype, {
+ command: {
+ get: function() {
+ return this._command;
+ }
+ },
+ runtimePrimitive: {
+ get: function() {
+ return this._runtimePrimitive;
+ }
+ },
+ model: {
+ get: function() {
+ return this._model;
+ }
+ },
+ primitiveType: {
+ get: function() {
+ return this._command.primitiveType;
+ }
+ },
+ modelMatrix: {
+ get: function() {
+ return this._modelMatrix;
+ },
+ set: function(value) {
+ this._modelMatrix = Matrix4_default.clone(value, this._modelMatrix);
+ this._modelMatrix2DDirty = true;
+ this._boundingVolume = BoundingSphere_default.transform(
+ this.runtimePrimitive.boundingSphere,
+ this._modelMatrix,
+ this._boundingVolume
+ );
+ }
+ },
+ boundingVolume: {
+ get: function() {
+ return this._boundingVolume;
+ }
+ },
+ shadows: {
+ get: function() {
+ return this._shadows;
+ },
+ set: function(value) {
+ this._shadows = value;
+ updateShadows(this);
+ }
+ },
+ backFaceCulling: {
+ get: function() {
+ return this._backFaceCulling;
+ },
+ set: function(value) {
+ if (this._backFaceCulling === value) {
+ return;
+ }
+ this._backFaceCulling = value;
+ updateBackFaceCulling(this);
+ }
+ },
+ cullFace: {
+ get: function() {
+ return this._cullFace;
+ },
+ set: function(value) {
+ if (this._cullFace === value) {
+ return;
+ }
+ this._cullFace = value;
+ updateCullFace(this);
+ }
+ },
+ debugShowBoundingVolume: {
+ get: function() {
+ return this._debugShowBoundingVolume;
+ },
+ set: function(value) {
+ if (this._debugShowBoundingVolume === value) {
+ return;
+ }
+ this._debugShowBoundingVolume = value;
+ updateDebugShowBoundingVolume(this);
+ }
+ }
+});
+function updateModelMatrix2D(drawCommand, frameState) {
+ const modelMatrix = drawCommand._modelMatrix;
+ drawCommand._modelMatrix2D = Matrix4_default.clone(
+ modelMatrix,
+ drawCommand._modelMatrix2D
+ );
+ drawCommand._modelMatrix2D[13] -= Math_default.sign(modelMatrix[13]) * 2 * Math_default.PI * frameState.mapProjection.ellipsoid.maximumRadius;
+ drawCommand._boundingVolume2D = BoundingSphere_default.transform(
+ drawCommand.runtimePrimitive.boundingSphere,
+ drawCommand._modelMatrix2D,
+ drawCommand._boundingVolume2D
+ );
+}
+function updateShadows(drawCommand) {
+ const shadows = drawCommand.shadows;
+ const castShadows = ShadowMode_default.castShadows(shadows);
+ const receiveShadows = ShadowMode_default.receiveShadows(shadows);
+ const derivedCommands = drawCommand._derivedCommands;
+ const length3 = derivedCommands.length;
+ for (let i = 0; i < length3; ++i) {
+ const derivedCommand = derivedCommands[i];
+ if (derivedCommand.updateShadows) {
+ const command = derivedCommand.command;
+ command.castShadows = castShadows;
+ command.receiveShadows = receiveShadows;
+ }
+ }
+}
+function updateBackFaceCulling(drawCommand) {
+ const backFaceCulling = drawCommand.backFaceCulling;
+ const derivedCommands = drawCommand._derivedCommands;
+ const length3 = derivedCommands.length;
+ for (let i = 0; i < length3; ++i) {
+ const derivedCommand = derivedCommands[i];
+ if (derivedCommand.updateBackFaceCulling) {
+ const command = derivedCommand.command;
+ const renderState = clone_default(command.renderState, true);
+ renderState.cull.enabled = backFaceCulling;
+ command.renderState = RenderState_default.fromCache(renderState);
+ }
+ }
+}
+function updateCullFace(drawCommand) {
+ const cullFace = drawCommand.cullFace;
+ const derivedCommands = drawCommand._derivedCommands;
+ const length3 = derivedCommands.length;
+ for (let i = 0; i < length3; ++i) {
+ const derivedCommand = derivedCommands[i];
+ if (derivedCommand.updateCullFace) {
+ const command = derivedCommand.command;
+ const renderState = clone_default(command.renderState, true);
+ renderState.cull.face = cullFace;
+ command.renderState = RenderState_default.fromCache(renderState);
+ }
+ }
+}
+function updateDebugShowBoundingVolume(drawCommand) {
+ const debugShowBoundingVolume2 = drawCommand.debugShowBoundingVolume;
+ const derivedCommands = drawCommand._derivedCommands;
+ const length3 = derivedCommands.length;
+ for (let i = 0; i < length3; ++i) {
+ const derivedCommand = derivedCommands[i];
+ if (derivedCommand.updateDebugShowBoundingVolume) {
+ const command = derivedCommand.command;
+ command.debugShowBoundingVolume = debugShowBoundingVolume2;
+ }
+ }
+}
+ModelDrawCommand.prototype.pushCommands = function(frameState, result) {
+ const use2D = shouldUse2DCommands(this, frameState);
+ if (use2D && !this._has2DCommands) {
+ derive2DCommands(this);
+ this._has2DCommands = true;
+ this._modelMatrix2DDirty = true;
+ }
+ if (this._modelMatrix2DDirty) {
+ updateModelMatrix2D(this, frameState);
+ this._modelMatrix2DDirty = false;
+ }
+ const styleCommandsNeeded = this.model.styleCommandsNeeded;
+ if (this._needsTranslucentCommand && defined_default(styleCommandsNeeded)) {
+ if (styleCommandsNeeded !== StyleCommandsNeeded_default.ALL_OPAQUE) {
+ pushCommand(result, this._translucentCommand, use2D);
+ }
+ if (styleCommandsNeeded === StyleCommandsNeeded_default.ALL_TRANSLUCENT) {
+ return;
+ }
+ }
+ if (this._needsSkipLevelOfDetailCommands) {
+ const content = this._model.content;
+ const tileset = content.tileset;
+ const tile = content.tile;
+ const hasMixedContent = tileset._hasMixedContent;
+ const finalResolution = tile._finalResolution;
+ if (hasMixedContent) {
+ if (!finalResolution) {
+ pushCommand(
+ tileset._backfaceCommands,
+ this._skipLodBackfaceCommand,
+ use2D
+ );
+ }
+ updateSkipLodStencilCommand(this, tile, use2D);
+ pushCommand(result, this._skipLodStencilCommand, use2D);
+ return;
+ }
+ }
+ if (this._needsSilhouetteCommands) {
+ pushCommand(result, this._silhouetteModelCommand, use2D);
+ return;
+ }
+ pushCommand(result, this._originalCommand, use2D);
+ return result;
+};
+ModelDrawCommand.prototype.pushSilhouetteCommands = function(frameState, result) {
+ const use2D = shouldUse2DCommands(this, frameState);
+ pushCommand(result, this._silhouetteColorCommand, use2D);
+ return result;
+};
+function pushCommand(commandList, derivedCommand, use2D) {
+ commandList.push(derivedCommand.command);
+ if (use2D) {
+ commandList.push(derivedCommand.derivedCommand2D.command);
+ }
+}
+function shouldUse2DCommands(drawCommand, frameState) {
+ if (frameState.mode !== SceneMode_default.SCENE2D || drawCommand.model._projectTo2D) {
+ return false;
+ }
+ const model = drawCommand.model;
+ const boundingSphere = model.sceneGraph._boundingSphere2D;
+ const left = boundingSphere.center.y - boundingSphere.radius;
+ const right = boundingSphere.center.y + boundingSphere.radius;
+ const idl2D = frameState.mapProjection.ellipsoid.maximumRadius * Math_default.PI;
+ return left < idl2D && right > idl2D || left < -idl2D && right > -idl2D;
+}
+function derive2DCommand(drawCommand, derivedCommand) {
+ if (!defined_default(derivedCommand)) {
+ return;
+ }
+ const derivedCommand2D = ModelDerivedCommand.clone(derivedCommand);
+ const command2D = DrawCommand_default.shallowClone(derivedCommand.command);
+ command2D.modelMatrix = drawCommand._modelMatrix2D;
+ command2D.boundingVolume = drawCommand._boundingVolume2D;
+ derivedCommand2D.command = command2D;
+ derivedCommand2D.updateShadows = false;
+ derivedCommand2D.is2D = true;
+ derivedCommand.derivedCommand2D = derivedCommand2D;
+ drawCommand._derivedCommands.push(derivedCommand2D);
+ return derivedCommand2D;
+}
+function derive2DCommands(drawCommand) {
+ derive2DCommand(drawCommand, drawCommand._originalCommand);
+ derive2DCommand(drawCommand, drawCommand._translucentCommand);
+ derive2DCommand(drawCommand, drawCommand._skipLodBackfaceCommand);
+ derive2DCommand(drawCommand, drawCommand._skipLodStencilCommand);
+ derive2DCommand(drawCommand, drawCommand._silhouetteModelCommand);
+ derive2DCommand(drawCommand, drawCommand._silhouetteColorCommand);
+}
+function deriveTranslucentCommand2(command) {
+ const derivedCommand = DrawCommand_default.shallowClone(command);
+ derivedCommand.pass = Pass_default.TRANSLUCENT;
+ const rs = clone_default(command.renderState, true);
+ rs.cull.enabled = false;
+ rs.depthMask = false;
+ rs.blending = BlendingState_default.ALPHA_BLEND;
+ derivedCommand.renderState = RenderState_default.fromCache(rs);
+ return derivedCommand;
+}
+function deriveSilhouetteModelCommand(command, model) {
+ const stencilReference = model._silhouetteId % 255;
+ const silhouetteModelCommand = DrawCommand_default.shallowClone(command);
+ const renderState = clone_default(command.renderState, true);
+ renderState.stencilTest = {
+ enabled: true,
+ frontFunction: WebGLConstants_default.ALWAYS,
+ backFunction: WebGLConstants_default.ALWAYS,
+ reference: stencilReference,
+ mask: ~0,
+ frontOperation: {
+ fail: WebGLConstants_default.KEEP,
+ zFail: WebGLConstants_default.KEEP,
+ zPass: WebGLConstants_default.REPLACE
+ },
+ backOperation: {
+ fail: WebGLConstants_default.KEEP,
+ zFail: WebGLConstants_default.KEEP,
+ zPass: WebGLConstants_default.REPLACE
+ }
+ };
+ if (model.isInvisible()) {
+ renderState.colorMask = {
+ red: false,
+ green: false,
+ blue: false,
+ alpha: false
+ };
+ }
+ silhouetteModelCommand.renderState = RenderState_default.fromCache(renderState);
+ return silhouetteModelCommand;
+}
+function deriveSilhouetteColorCommand(command, model) {
+ const stencilReference = model._silhouetteId % 255;
+ const silhouetteColorCommand = DrawCommand_default.shallowClone(command);
+ const renderState = clone_default(command.renderState, true);
+ renderState.cull.enabled = false;
+ const silhouetteTranslucent = command.pass === Pass_default.TRANSLUCENT || model.silhouetteColor.alpha < 1;
+ if (silhouetteTranslucent) {
+ silhouetteColorCommand.pass = Pass_default.TRANSLUCENT;
+ renderState.depthMask = false;
+ renderState.blending = BlendingState_default.ALPHA_BLEND;
+ }
+ renderState.stencilTest = {
+ enabled: true,
+ frontFunction: WebGLConstants_default.NOTEQUAL,
+ backFunction: WebGLConstants_default.NOTEQUAL,
+ reference: stencilReference,
+ mask: ~0,
+ frontOperation: {
+ fail: WebGLConstants_default.KEEP,
+ zFail: WebGLConstants_default.KEEP,
+ zPass: WebGLConstants_default.KEEP
+ },
+ backOperation: {
+ fail: WebGLConstants_default.KEEP,
+ zFail: WebGLConstants_default.KEEP,
+ zPass: WebGLConstants_default.KEEP
+ }
+ };
+ const uniformMap2 = clone_default(command.uniformMap);
+ uniformMap2.model_silhouettePass = function() {
+ return true;
+ };
+ silhouetteColorCommand.renderState = RenderState_default.fromCache(renderState);
+ silhouetteColorCommand.uniformMap = uniformMap2;
+ silhouetteColorCommand.castShadows = false;
+ silhouetteColorCommand.receiveShadows = false;
+ return silhouetteColorCommand;
+}
+function updateSkipLodStencilCommand(drawCommand, tile, use2D) {
+ const stencilDerivedComand = drawCommand._skipLodStencilCommand;
+ const stencilCommand = stencilDerivedComand.command;
+ const selectionDepth = tile._selectionDepth;
+ const lastSelectionDepth = getLastSelectionDepth2(stencilCommand);
+ if (selectionDepth !== lastSelectionDepth) {
+ const skipLodStencilReference = getStencilReference(selectionDepth);
+ const renderState = clone_default(stencilCommand.renderState, true);
+ renderState.stencilTest.reference = skipLodStencilReference;
+ stencilCommand.renderState = RenderState_default.fromCache(renderState);
+ if (use2D) {
+ stencilDerivedComand.derivedCommand2D.renderState = renderState;
+ }
+ }
+}
+function getLastSelectionDepth2(stencilCommand) {
+ const reference = stencilCommand.renderState.stencilTest.reference;
+ return (reference & StencilConstants_default.SKIP_LOD_MASK) >>> StencilConstants_default.SKIP_LOD_BIT_SHIFT;
+}
+function getStencilReference(selectionDepth) {
+ return StencilConstants_default.CESIUM_3D_TILE_MASK | selectionDepth << StencilConstants_default.SKIP_LOD_BIT_SHIFT;
+}
+function deriveSkipLodBackfaceCommand(command) {
+ const backfaceCommand = DrawCommand_default.shallowClone(command);
+ const renderState = clone_default(command.renderState, true);
+ renderState.cull.enabled = true;
+ renderState.cull.face = CullFace_default.FRONT;
+ renderState.colorMask = {
+ red: false,
+ green: false,
+ blue: false,
+ alpha: false
+ };
+ renderState.polygonOffset = {
+ enabled: true,
+ factor: 5,
+ units: 5
+ };
+ const uniformMap2 = clone_default(backfaceCommand.uniformMap);
+ const polygonOffset = new Cartesian2_default(5, 5);
+ uniformMap2.u_polygonOffset = function() {
+ return polygonOffset;
+ };
+ backfaceCommand.renderState = RenderState_default.fromCache(renderState);
+ backfaceCommand.uniformMap = uniformMap2;
+ backfaceCommand.castShadows = false;
+ backfaceCommand.receiveShadows = false;
+ return backfaceCommand;
+}
+function deriveSkipLodStencilCommand(command) {
+ const stencilCommand = DrawCommand_default.shallowClone(command);
+ const renderState = clone_default(command.renderState, true);
+ renderState.stencilTest.enabled = true;
+ renderState.stencilTest.mask = StencilConstants_default.SKIP_LOD_MASK;
+ renderState.stencilTest.reference = StencilConstants_default.CESIUM_3D_TILE_MASK;
+ renderState.stencilTest.frontFunction = StencilFunction_default.GREATER_OR_EQUAL;
+ renderState.stencilTest.frontOperation.zPass = StencilOperation_default.REPLACE;
+ renderState.stencilTest.backFunction = StencilFunction_default.GREATER_OR_EQUAL;
+ renderState.stencilTest.backOperation.zPass = StencilOperation_default.REPLACE;
+ renderState.stencilMask = StencilConstants_default.CESIUM_3D_TILE_MASK | StencilConstants_default.SKIP_LOD_MASK;
+ stencilCommand.renderState = RenderState_default.fromCache(renderState);
+ return stencilCommand;
+}
+var ModelDrawCommand_default = ModelDrawCommand;
+
+// Source/Scene/Model/buildDrawCommand.js
+function buildDrawCommand(primitiveRenderResources, frameState) {
+ const shaderBuilder = primitiveRenderResources.shaderBuilder;
+ shaderBuilder.addVertexLines(ModelVS_default);
+ shaderBuilder.addFragmentLines(ModelFS_default);
+ const indexBuffer = getIndexBuffer(primitiveRenderResources);
+ const vertexArray = new VertexArray_default({
+ context: frameState.context,
+ indexBuffer,
+ attributes: primitiveRenderResources.attributes
+ });
+ const model = primitiveRenderResources.model;
+ model._pipelineResources.push(vertexArray);
+ const shaderProgram = shaderBuilder.buildShaderProgram(frameState.context);
+ model._pipelineResources.push(shaderProgram);
+ const pass = primitiveRenderResources.alphaOptions.pass;
+ const sceneGraph = model.sceneGraph;
+ const modelMatrix = Matrix4_default.multiplyTransformation(
+ sceneGraph.computedModelMatrix,
+ primitiveRenderResources.runtimeNode.computedTransform,
+ new Matrix4_default()
+ );
+ let boundingSphere;
+ if (frameState.mode !== SceneMode_default.SCENE3D && !frameState.scene3DOnly && model._projectTo2D) {
+ const runtimePrimitive = primitiveRenderResources.runtimePrimitive;
+ boundingSphere = runtimePrimitive.boundingSphere2D;
+ } else {
+ boundingSphere = BoundingSphere_default.transform(
+ primitiveRenderResources.boundingSphere,
+ modelMatrix,
+ primitiveRenderResources.boundingSphere
+ );
+ }
+ let renderState = clone_default(
+ RenderState_default.fromCache(primitiveRenderResources.renderStateOptions),
+ true
+ );
+ renderState.cull.face = ModelUtility_default.getCullFace(
+ modelMatrix,
+ primitiveRenderResources.primitiveType
+ );
+ renderState = RenderState_default.fromCache(renderState);
+ const hasClassification = defined_default(model.classificationType);
+ const castShadows = hasClassification ? false : ShadowMode_default.castShadows(model.shadows);
+ const receiveShadows = hasClassification ? false : ShadowMode_default.receiveShadows(model.shadows);
+ const pickId = hasClassification ? void 0 : primitiveRenderResources.pickId;
+ const command = new DrawCommand_default({
+ boundingVolume: boundingSphere,
+ modelMatrix,
+ uniformMap: primitiveRenderResources.uniformMap,
+ renderState,
+ vertexArray,
+ shaderProgram,
+ cull: model.cull,
+ pass,
+ count: primitiveRenderResources.count,
+ owner: model,
+ pickId,
+ instanceCount: primitiveRenderResources.instanceCount,
+ primitiveType: primitiveRenderResources.primitiveType,
+ debugShowBoundingVolume: model.debugShowBoundingVolume,
+ castShadows,
+ receiveShadows
+ });
+ if (hasClassification) {
+ return new ClassificationModelDrawCommand_default({
+ primitiveRenderResources,
+ command
+ });
+ }
+ return new ModelDrawCommand_default({
+ primitiveRenderResources,
+ command
+ });
+}
+function getIndexBuffer(primitiveRenderResources) {
+ const wireframeIndexBuffer = primitiveRenderResources.wireframeIndexBuffer;
+ if (defined_default(wireframeIndexBuffer)) {
+ return wireframeIndexBuffer;
+ }
+ const indices2 = primitiveRenderResources.indices;
+ if (!defined_default(indices2)) {
+ return void 0;
+ }
+ if (!defined_default(indices2.buffer)) {
+ throw new DeveloperError_default("Indices must be provided as a Buffer");
+ }
+ return indices2.buffer;
+}
+var buildDrawCommand_default = buildDrawCommand;
+
+// Source/Scene/Model/TilesetPipelineStage.js
+var TilesetPipelineStage = {
+ name: "TilesetPipelineStage"
+};
+TilesetPipelineStage.process = function(renderResources, model, frameState) {
+ if (model.hasSkipLevelOfDetail(frameState)) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine(
+ "POLYGON_OFFSET",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ const uniformMap2 = {
+ u_polygonOffset: function() {
+ return Cartesian2_default.ZERO;
+ }
+ };
+ renderResources.uniformMap = combine_default(
+ uniformMap2,
+ renderResources.uniformMap
+ );
+ renderResources.hasSkipLevelOfDetail = true;
+ }
+ const renderStateOptions = renderResources.renderStateOptions;
+ renderStateOptions.stencilTest = StencilConstants_default.setCesium3DTileBit();
+ renderStateOptions.stencilMask = StencilConstants_default.CESIUM_3D_TILE_MASK;
+};
+var TilesetPipelineStage_default = TilesetPipelineStage;
+
+// Source/Shaders/Model/ImageBasedLightingStageFS.js
+var ImageBasedLightingStageFS_default = "vec3 proceduralIBL(\n vec3 positionEC,\n vec3 normalEC,\n vec3 lightDirectionEC,\n vec3 lightColorHdr,\n czm_pbrParameters pbrParameters\n) {\n vec3 v = -positionEC;\n vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0));\n vec3 vWC = -normalize(positionWC);\n vec3 l = normalize(lightDirectionEC);\n vec3 n = normalEC;\n vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n)));\n\n float NdotL = clamp(dot(n, l), 0.001, 1.0);\n float NdotV = abs(dot(n, v)) + 0.001;\n\n // Figure out if the reflection vector hits the ellipsoid\n float vertexRadius = length(positionWC);\n float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius);\n float reflectionDotNadir = dot(r, normalize(positionWC));\n // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.\n r.x = -r.x;\n r = -normalize(czm_temeToPseudoFixed * r);\n r.x = -r.x;\n\n vec3 diffuseColor = pbrParameters.diffuseColor;\n float roughness = pbrParameters.roughness;\n vec3 specularColor = pbrParameters.f0;\n\n float inverseRoughness = 1.04 - roughness;\n inverseRoughness *= inverseRoughness;\n vec3 sceneSkyBox = textureCube(czm_environmentMap, r).rgb * inverseRoughness;\n\n float atmosphereHeight = 0.05;\n float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir);\n float blendRegionOffset = roughness * -1.0;\n float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999);\n float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999);\n float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999);\n float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir);\n vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight);\n vec3 nadirColor = belowHorizonColor * 0.5;\n vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5);\n vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75);\n vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight);\n vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); \n float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight; \n float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25));\n vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0);\n float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8);\n vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough);\n specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness);\n specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness);\n\n // Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf\n #ifdef USE_SUN_LUMINANCE \n // Angle between sun and zenith\n float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0);\n float S = acos(LdotZenith);\n // Angle between zenith and current pixel\n float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0);\n // Angle between sun and current pixel\n float gamma = acos(NdotL);\n float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith)));\n float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32));\n float luminance = model_luminanceAtZenith * (numerator / denominator);\n #endif \n\n vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y);\n float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z);\n vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0);\n iblColor *= lightColor;\n\n #ifdef USE_SUN_LUMINANCE \n iblColor *= luminance;\n #endif\n\n return iblColor;\n}\n\n#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)\nvec3 textureIBL(\n vec3 positionEC,\n vec3 normalEC,\n vec3 lightDirectionEC,\n czm_pbrParameters pbrParameters\n) {\n vec3 diffuseColor = pbrParameters.diffuseColor;\n float roughness = pbrParameters.roughness;\n vec3 specularColor = pbrParameters.f0;\n\n vec3 v = -positionEC;\n vec3 n = normalEC;\n vec3 l = normalize(lightDirectionEC);\n vec3 h = normalize(v + l);\n\n float NdotV = abs(dot(n, v)) + 0.001;\n float VdotH = clamp(dot(v, h), 0.0, 1.0);\n\n const mat3 yUpToZUp = mat3(\n -1.0, 0.0, 0.0,\n 0.0, 0.0, -1.0, \n 0.0, 1.0, 0.0\n ); \n vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n))); \n\n #ifdef DIFFUSE_IBL \n #ifdef CUSTOM_SPHERICAL_HARMONICS\n vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); \n #else\n vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); \n #endif \n #else \n vec3 diffuseIrradiance = vec3(0.0); \n #endif \n\n #ifdef SPECULAR_IBL\n vec3 r0 = specularColor.rgb;\n float reflectance = max(max(r0.r, r0.g), r0.b);\n vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));\n vec3 F = fresnelSchlick2(r0, r90, VdotH);\n \n vec2 brdfLut = texture2D(czm_brdfLut, vec2(NdotV, roughness)).rg;\n #ifdef CUSTOM_SPECULAR_IBL \n vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD);\n #else \n vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD);\n #endif \n specularIBL *= F * brdfLut.x + brdfLut.y;\n #else \n vec3 specularIBL = vec3(0.0); \n #endif\n\n return diffuseColor * diffuseIrradiance + specularColor * specularIBL;\n}\n#endif\n\nvec3 imageBasedLightingStage(\n vec3 positionEC,\n vec3 normalEC,\n vec3 lightDirectionEC,\n vec3 lightColorHdr,\n czm_pbrParameters pbrParameters\n) {\n #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)\n // Environment maps were provided, use them for IBL\n return textureIBL(\n positionEC,\n normalEC,\n lightDirectionEC,\n pbrParameters\n );\n #else\n // Use the procedural IBL if there are no environment maps\n return proceduralIBL(\n positionEC,\n normalEC,\n lightDirectionEC,\n lightColorHdr,\n pbrParameters\n );\n #endif\n}";
+
+// Source/Scene/Model/ImageBasedLightingPipelineStage.js
+var ImageBasedLightingPipelineStage = {
+ name: "ImageBasedLightingPipelineStage"
+};
+ImageBasedLightingPipelineStage.process = function(renderResources, model, frameState) {
+ const imageBasedLighting = model.imageBasedLighting;
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine(
+ "USE_IBL_LIGHTING",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "vec2",
+ "model_iblFactor",
+ ShaderDestination_default.FRAGMENT
+ );
+ if (OctahedralProjectedCubeMap_default.isSupported(frameState.context)) {
+ const addMatrix = imageBasedLighting.useSphericalHarmonics || imageBasedLighting.useSpecularEnvironmentMaps || imageBasedLighting.enabled;
+ if (addMatrix) {
+ shaderBuilder.addUniform(
+ "mat3",
+ "model_iblReferenceFrameMatrix",
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ if (defined_default(imageBasedLighting.sphericalHarmonicCoefficients)) {
+ shaderBuilder.addDefine(
+ "DIFFUSE_IBL",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addDefine(
+ "CUSTOM_SPHERICAL_HARMONICS",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "vec3",
+ "model_sphericalHarmonicCoefficients[9]",
+ ShaderDestination_default.FRAGMENT
+ );
+ } else if (imageBasedLighting.useDefaultSphericalHarmonics) {
+ shaderBuilder.addDefine(
+ "DIFFUSE_IBL",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ if (defined_default(imageBasedLighting.specularEnvironmentMapAtlas) && imageBasedLighting.specularEnvironmentMapAtlas.ready) {
+ shaderBuilder.addDefine(
+ "SPECULAR_IBL",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addDefine(
+ "CUSTOM_SPECULAR_IBL",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "sampler2D",
+ "model_specularEnvironmentMaps",
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "vec2",
+ "model_specularEnvironmentMapsSize",
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "float",
+ "model_specularEnvironmentMapsMaximumLOD",
+ ShaderDestination_default.FRAGMENT
+ );
+ } else if (model.useDefaultSpecularMaps) {
+ shaderBuilder.addDefine(
+ "SPECULAR_IBL",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ }
+ if (defined_default(imageBasedLighting.luminanceAtZenith)) {
+ shaderBuilder.addDefine(
+ "USE_SUN_LUMINANCE",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "float",
+ "model_luminanceAtZenith",
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ shaderBuilder.addFragmentLines(ImageBasedLightingStageFS_default);
+ const uniformMap2 = {
+ model_iblFactor: function() {
+ return imageBasedLighting.imageBasedLightingFactor;
+ },
+ model_iblReferenceFrameMatrix: function() {
+ return model._iblReferenceFrameMatrix;
+ },
+ model_luminanceAtZenith: function() {
+ return imageBasedLighting.luminanceAtZenith;
+ },
+ model_sphericalHarmonicCoefficients: function() {
+ return imageBasedLighting.sphericalHarmonicCoefficients;
+ },
+ model_specularEnvironmentMaps: function() {
+ return imageBasedLighting.specularEnvironmentMapAtlas.texture;
+ },
+ model_specularEnvironmentMapsSize: function() {
+ return imageBasedLighting.specularEnvironmentMapAtlas.texture.dimensions;
+ },
+ model_specularEnvironmentMapsMaximumLOD: function() {
+ return imageBasedLighting.specularEnvironmentMapAtlas.maximumMipmapLevel;
+ }
+ };
+ renderResources.uniformMap = combine_default(uniformMap2, renderResources.uniformMap);
+};
+var ImageBasedLightingPipelineStage_default = ImageBasedLightingPipelineStage;
+
+// Source/Scene/Model/ModelArticulationStage.js
+var articulationEpsilon = Math_default.EPSILON16;
+function ModelArticulationStage(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const stage = options.stage;
+ const runtimeArticulation = options.runtimeArticulation;
+ Check_default.typeOf.object("options.stage", stage);
+ Check_default.typeOf.object("options.runtimeArticulation", runtimeArticulation);
+ this._stage = stage;
+ this._runtimeArticulation = runtimeArticulation;
+ this._name = stage.name;
+ this._type = stage.type;
+ this._minimumValue = stage.minimumValue;
+ this._maximumValue = stage.maximumValue;
+ this._currentValue = stage.initialValue;
+}
+Object.defineProperties(ModelArticulationStage.prototype, {
+ stage: {
+ get: function() {
+ return this._stage;
+ }
+ },
+ runtimeArticulation: {
+ get: function() {
+ return this._runtimeArticulation;
+ }
+ },
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ type: {
+ get: function() {
+ return this._type;
+ }
+ },
+ minimumValue: {
+ get: function() {
+ return this._minimumValue;
+ }
+ },
+ maximumValue: {
+ get: function() {
+ return this._maximumValue;
+ }
+ },
+ currentValue: {
+ get: function() {
+ return this._currentValue;
+ },
+ set: function(value) {
+ Check_default.typeOf.number("value", value);
+ value = Math_default.clamp(value, this.minimumValue, this.maximumValue);
+ if (!Math_default.equalsEpsilon(
+ this._currentValue,
+ value,
+ articulationEpsilon
+ )) {
+ this._currentValue = value;
+ this.runtimeArticulation._dirty = true;
+ }
+ }
+ }
+});
+var scratchArticulationCartesian = new Cartesian3_default();
+var scratchArticulationRotation = new Matrix3_default();
+ModelArticulationStage.prototype.applyStageToMatrix = function(result) {
+ Check_default.typeOf.object("result", result);
+ const type = this.type;
+ const value = this.currentValue;
+ const cartesian11 = scratchArticulationCartesian;
+ let rotation;
+ switch (type) {
+ case ArticulationStageType_default.XROTATE:
+ rotation = Matrix3_default.fromRotationX(
+ Math_default.toRadians(value),
+ scratchArticulationRotation
+ );
+ result = Matrix4_default.multiplyByMatrix3(result, rotation, result);
+ break;
+ case ArticulationStageType_default.YROTATE:
+ rotation = Matrix3_default.fromRotationY(
+ Math_default.toRadians(value),
+ scratchArticulationRotation
+ );
+ result = Matrix4_default.multiplyByMatrix3(result, rotation, result);
+ break;
+ case ArticulationStageType_default.ZROTATE:
+ rotation = Matrix3_default.fromRotationZ(
+ Math_default.toRadians(value),
+ scratchArticulationRotation
+ );
+ result = Matrix4_default.multiplyByMatrix3(result, rotation, result);
+ break;
+ case ArticulationStageType_default.XTRANSLATE:
+ cartesian11.x = value;
+ cartesian11.y = 0;
+ cartesian11.z = 0;
+ result = Matrix4_default.multiplyByTranslation(result, cartesian11, result);
+ break;
+ case ArticulationStageType_default.YTRANSLATE:
+ cartesian11.x = 0;
+ cartesian11.y = value;
+ cartesian11.z = 0;
+ result = Matrix4_default.multiplyByTranslation(result, cartesian11, result);
+ break;
+ case ArticulationStageType_default.ZTRANSLATE:
+ cartesian11.x = 0;
+ cartesian11.y = 0;
+ cartesian11.z = value;
+ result = Matrix4_default.multiplyByTranslation(result, cartesian11, result);
+ break;
+ case ArticulationStageType_default.XSCALE:
+ cartesian11.x = value;
+ cartesian11.y = 1;
+ cartesian11.z = 1;
+ result = Matrix4_default.multiplyByScale(result, cartesian11, result);
+ break;
+ case ArticulationStageType_default.YSCALE:
+ cartesian11.x = 1;
+ cartesian11.y = value;
+ cartesian11.z = 1;
+ result = Matrix4_default.multiplyByScale(result, cartesian11, result);
+ break;
+ case ArticulationStageType_default.ZSCALE:
+ cartesian11.x = 1;
+ cartesian11.y = 1;
+ cartesian11.z = value;
+ result = Matrix4_default.multiplyByScale(result, cartesian11, result);
+ break;
+ case ArticulationStageType_default.UNIFORMSCALE:
+ result = Matrix4_default.multiplyByUniformScale(result, value, result);
+ break;
+ default:
+ break;
+ }
+ return result;
+};
+var ModelArticulationStage_default = ModelArticulationStage;
+
+// Source/Scene/Model/ModelArticulation.js
+function ModelArticulation(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const articulation = options.articulation;
+ const sceneGraph = options.sceneGraph;
+ Check_default.typeOf.object("options.articulation", articulation);
+ Check_default.typeOf.object("options.sceneGraph", sceneGraph);
+ this._articulation = articulation;
+ this._sceneGraph = sceneGraph;
+ this._name = articulation.name;
+ this._runtimeStages = [];
+ this._runtimeStagesByName = {};
+ this._runtimeNodes = [];
+ this._dirty = true;
+ initialize15(this);
+}
+Object.defineProperties(ModelArticulation.prototype, {
+ articulation: {
+ get: function() {
+ return this._articulation;
+ }
+ },
+ sceneGraph: {
+ get: function() {
+ return this._sceneGraph;
+ }
+ },
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ runtimeStages: {
+ get: function() {
+ return this._runtimeStages;
+ }
+ },
+ runtimeNodes: {
+ get: function() {
+ return this._runtimeNodes;
+ }
+ }
+});
+function initialize15(runtimeArticulation) {
+ const articulation = runtimeArticulation.articulation;
+ const stages = articulation.stages;
+ const length3 = stages.length;
+ const runtimeStages = runtimeArticulation._runtimeStages;
+ const runtimeStagesByName = runtimeArticulation._runtimeStagesByName;
+ for (let i = 0; i < length3; i++) {
+ const stage = stages[i];
+ const runtimeStage = new ModelArticulationStage_default({
+ stage,
+ runtimeArticulation
+ });
+ runtimeStages.push(runtimeStage);
+ const stageName = stage.name;
+ runtimeStagesByName[stageName] = runtimeStage;
+ }
+}
+ModelArticulation.prototype.setArticulationStage = function(stageName, value) {
+ const stage = this._runtimeStagesByName[stageName];
+ if (defined_default(stage)) {
+ stage.currentValue = value;
+ }
+};
+var scratchArticulationMatrix = new Matrix4_default();
+var scratchNodeMatrix = new Matrix4_default();
+ModelArticulation.prototype.apply = function() {
+ if (!this._dirty) {
+ return;
+ }
+ this._dirty = false;
+ let articulationMatrix = Matrix4_default.clone(
+ Matrix4_default.IDENTITY,
+ scratchArticulationMatrix
+ );
+ let i;
+ const stages = this._runtimeStages;
+ const stagesLength = stages.length;
+ for (i = 0; i < stagesLength; i++) {
+ const stage = stages[i];
+ articulationMatrix = stage.applyStageToMatrix(articulationMatrix);
+ }
+ const nodes = this._runtimeNodes;
+ const nodesLength = nodes.length;
+ for (i = 0; i < nodesLength; i++) {
+ const node = nodes[i];
+ const transform3 = Matrix4_default.multiplyTransformation(
+ node.originalTransform,
+ articulationMatrix,
+ scratchNodeMatrix
+ );
+ node.transform = transform3;
+ }
+};
+var ModelArticulation_default = ModelArticulation;
+
+// Source/Shaders/Model/ModelColorStageFS.js
+var ModelColorStageFS_default = "void modelColorStage(inout czm_modelMaterial material)\n{\n material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);\n float highlight = ceil(model_colorBlend);\n material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);\n material.alpha *= model_color.a;\n}";
+
+// Source/Scene/Model/ModelColorPipelineStage.js
+var ModelColorPipelineStage = {
+ name: "ModelColorPipelineStage",
+ COLOR_UNIFORM_NAME: "model_color",
+ COLOR_BLEND_UNIFORM_NAME: "model_colorBlend"
+};
+ModelColorPipelineStage.process = function(renderResources, model, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine(
+ "HAS_MODEL_COLOR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addFragmentLines(ModelColorStageFS_default);
+ const stageUniforms = {};
+ const color = model.color;
+ if (color.alpha === 0 && !model.hasSilhouette(frameState)) {
+ renderResources.renderStateOptions.colorMask = {
+ red: false,
+ green: false,
+ blue: false,
+ alpha: false
+ };
+ }
+ if (color.alpha < 1) {
+ renderResources.alphaOptions.pass = Pass_default.TRANSLUCENT;
+ }
+ shaderBuilder.addUniform(
+ "vec4",
+ ModelColorPipelineStage.COLOR_UNIFORM_NAME,
+ ShaderDestination_default.FRAGMENT
+ );
+ stageUniforms[ModelColorPipelineStage.COLOR_UNIFORM_NAME] = function() {
+ return model.color;
+ };
+ shaderBuilder.addUniform(
+ "float",
+ ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME,
+ ShaderDestination_default.FRAGMENT
+ );
+ stageUniforms[ModelColorPipelineStage.COLOR_BLEND_UNIFORM_NAME] = function() {
+ return ColorBlendMode_default.getColorBlend(
+ model.colorBlendMode,
+ model.colorBlendAmount
+ );
+ };
+ renderResources.uniformMap = combine_default(
+ stageUniforms,
+ renderResources.uniformMap
+ );
+};
+var ModelColorPipelineStage_default = ModelColorPipelineStage;
+
+// Source/Shaders/Model/ModelClippingPlanesStageFS.js
+var ModelClippingPlanesStageFS_default = "#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE\nvec4 getClippingPlane(\n highp sampler2D packedClippingPlanes,\n int clippingPlaneNumber,\n mat4 transform\n) {\n int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;\n int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);\n float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);\n float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\n float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n float v = (float(pixY) + 0.5) * pixelHeight;\n vec4 plane = texture2D(packedClippingPlanes, vec2(u, v));\n return czm_transformPlane(plane, transform);\n}\n#else\n// Handle uint8 clipping texture instead\nvec4 getClippingPlane(\n highp sampler2D packedClippingPlanes,\n int clippingPlaneNumber,\n mat4 transform\n) {\n int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each\n int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;\n int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);\n float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);\n float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);\n float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel\n float v = (float(pixY) + 0.5) * pixelHeight;\n vec4 oct32 = texture2D(packedClippingPlanes, vec2(u, v)) * 255.0;\n vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n vec4 plane;\n plane.xyz = czm_octDecode(oct, 65535.0);\n plane.w = czm_unpackFloat(texture2D(packedClippingPlanes, vec2(u + pixelWidth, v)));\n return czm_transformPlane(plane, transform);\n}\n#endif\n\nfloat clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {\n vec4 position = czm_windowToEyeCoordinates(fragCoord);\n vec3 clipNormal = vec3(0.0);\n vec3 clipPosition = vec3(0.0);\n float pixelWidth = czm_metersPerPixel(position);\n \n #ifdef UNION_CLIPPING_REGIONS\n float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.\n #else\n float clipAmount = 0.0;\n bool clipped = true;\n #endif\n\n for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {\n vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n clipNormal = clippingPlane.xyz;\n clipPosition = -clippingPlane.w * clipNormal;\n float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n \n #ifdef UNION_CLIPPING_REGIONS\n clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\n if (amount <= 0.0) {\n discard;\n }\n #else\n clipAmount = max(amount, clipAmount);\n clipped = clipped && (amount <= 0.0);\n #endif\n }\n\n #ifndef UNION_CLIPPING_REGIONS\n if (clipped) {\n discard;\n }\n #endif\n \n return clipAmount;\n}\n\nvoid modelClippingPlanesStage(inout vec4 color)\n{\n float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);\n vec4 clippingPlanesEdgeColor = vec4(1.0);\n clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;\n float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;\n \n if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {\n color = clippingPlanesEdgeColor;\n }\n}\n";
+
+// Source/Scene/Model/ModelClippingPlanesPipelineStage.js
+var ModelClippingPlanesPipelineStage = {
+ name: "ModelClippingPlanesPipelineStage"
+};
+var textureResolutionScratch2 = new Cartesian2_default();
+ModelClippingPlanesPipelineStage.process = function(renderResources, model, frameState) {
+ const clippingPlanes = model.clippingPlanes;
+ const context = frameState.context;
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine(
+ "HAS_CLIPPING_PLANES",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addDefine(
+ "CLIPPING_PLANES_LENGTH",
+ clippingPlanes.length,
+ ShaderDestination_default.FRAGMENT
+ );
+ if (clippingPlanes.unionClippingRegions) {
+ shaderBuilder.addDefine(
+ "UNION_CLIPPING_REGIONS",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ if (ClippingPlaneCollection_default.useFloatTexture(context)) {
+ shaderBuilder.addDefine(
+ "USE_CLIPPING_PLANES_FLOAT_TEXTURE",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ const textureResolution = ClippingPlaneCollection_default.getTextureResolution(
+ clippingPlanes,
+ context,
+ textureResolutionScratch2
+ );
+ shaderBuilder.addDefine(
+ "CLIPPING_PLANES_TEXTURE_WIDTH",
+ textureResolution.x,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addDefine(
+ "CLIPPING_PLANES_TEXTURE_HEIGHT",
+ textureResolution.y,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "sampler2D",
+ "model_clippingPlanes",
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "vec4",
+ "model_clippingPlanesEdgeStyle",
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "mat4",
+ "model_clippingPlanesMatrix",
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addFragmentLines(ModelClippingPlanesStageFS_default);
+ const uniformMap2 = {
+ model_clippingPlanes: function() {
+ return clippingPlanes.texture;
+ },
+ model_clippingPlanesEdgeStyle: function() {
+ const style = Color_default.clone(clippingPlanes.edgeColor);
+ style.alpha = clippingPlanes.edgeWidth;
+ return style;
+ },
+ model_clippingPlanesMatrix: function() {
+ return model._clippingPlanesMatrix;
+ }
+ };
+ renderResources.uniformMap = combine_default(uniformMap2, renderResources.uniformMap);
+};
+var ModelClippingPlanesPipelineStage_default = ModelClippingPlanesPipelineStage;
+
+// Source/Scene/Model/ModelNode.js
+function ModelNode(model, runtimeNode) {
+ Check_default.typeOf.object("model", model);
+ Check_default.typeOf.object("runtimeNode", runtimeNode);
+ this._model = model;
+ this._runtimeNode = runtimeNode;
+}
+Object.defineProperties(ModelNode.prototype, {
+ name: {
+ get: function() {
+ return this._runtimeNode._name;
+ }
+ },
+ id: {
+ get: function() {
+ return this._runtimeNode._id;
+ }
+ },
+ show: {
+ get: function() {
+ return this._runtimeNode.show;
+ },
+ set: function(value) {
+ this._runtimeNode.show = value;
+ }
+ },
+ matrix: {
+ get: function() {
+ return this._runtimeNode.transform;
+ },
+ set: function(value) {
+ if (defined_default(value)) {
+ this._runtimeNode.transform = value;
+ this._runtimeNode.userAnimated = true;
+ this._model._userAnimationDirty = true;
+ } else {
+ this._runtimeNode.transform = this.originalMatrix;
+ this._runtimeNode.userAnimated = false;
+ }
+ }
+ },
+ originalMatrix: {
+ get: function() {
+ return this._runtimeNode.originalTransform;
+ }
+ }
+});
+var ModelNode_default = ModelNode;
+
+// Source/Shaders/Model/InstancingStageCommon.js
+var InstancingStageCommon_default = "mat4 getInstancingTransform()\n{\n mat4 instancingTransform;\n\n #ifdef HAS_INSTANCE_MATRICES\n instancingTransform = mat4(\n a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1\n a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2\n a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3\n a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4\n );\n #else\n vec3 translation = vec3(0.0, 0.0, 0.0);\n vec3 scale = vec3(1.0, 1.0, 1.0);\n \n #ifdef HAS_INSTANCE_TRANSLATION\n translation = a_instanceTranslation;\n #endif\n #ifdef HAS_INSTANCE_SCALE\n scale = a_instanceScale;\n #endif\n\n instancingTransform = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n translation.x, translation.y, translation.z, 1.0\n ); \n #endif\n\n return instancingTransform;\n}\n\n#ifdef USE_2D_INSTANCING\nmat4 getInstancingTransform2D()\n{\n mat4 instancingTransform2D;\n\n #ifdef HAS_INSTANCE_MATRICES\n instancingTransform2D = mat4(\n a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1\n a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2\n a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3\n a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4\n );\n #else\n vec3 translation2D = vec3(0.0, 0.0, 0.0);\n vec3 scale = vec3(1.0, 1.0, 1.0);\n \n #ifdef HAS_INSTANCE_TRANSLATION\n translation2D = a_instanceTranslation2D;\n #endif\n #ifdef HAS_INSTANCE_SCALE\n scale = a_instanceScale;\n #endif\n\n instancingTransform2D = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n translation2D.x, translation2D.y, translation2D.z, 1.0\n ); \n #endif\n\n return instancingTransform2D;\n}\n#endif\n";
+
+// Source/Shaders/Model/InstancingStageVS.js
+var InstancingStageVS_default = "void instancingStage(inout ProcessedAttributes attributes) \n{\n vec3 positionMC = attributes.positionMC;\n \n mat4 instancingTransform = getInstancingTransform();\n \n attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;\n\n #ifdef HAS_NORMALS\n vec3 normalMC = attributes.normalMC;\n attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;\n #endif\n\n #ifdef USE_2D_INSTANCING\n mat4 instancingTransform2D = getInstancingTransform2D();\n attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;\n #endif\n}\n";
+
+// Source/Shaders/Model/LegacyInstancingStageVS.js
+var LegacyInstancingStageVS_default = "void legacyInstancingStage(\n inout ProcessedAttributes attributes,\n out mat4 instanceModelView,\n out mat3 instanceModelViewInverseTranspose)\n{\n vec3 positionMC = attributes.positionMC;\n\n mat4 instancingTransform = getInstancingTransform();\n \n mat4 instanceModel = instancingTransform * u_instance_nodeTransform;\n instanceModelView = u_instance_modifiedModelView;\n instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);\n\n attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;\n \n #ifdef USE_2D_INSTANCING\n mat4 instancingTransform2D = getInstancingTransform2D();\n attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;\n #endif\n}\n";
+
+// Source/Scene/Model/InstancingPipelineStage.js
+var modelViewScratch = new Matrix4_default();
+var nodeTransformScratch = new Matrix4_default();
+var modelView2DScratch = new Matrix4_default();
+var InstancingPipelineStage = {
+ name: "InstancingPipelineStage",
+ _getInstanceTransformsAsMatrices: getInstanceTransformsAsMatrices,
+ _transformsToTypedArray: transformsToTypedArray
+};
+InstancingPipelineStage.process = function(renderResources, node, frameState) {
+ const instances = node.instances;
+ const count = instances.attributes[0].count;
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine("HAS_INSTANCING");
+ shaderBuilder.addVertexLines(InstancingStageCommon_default);
+ const model = renderResources.model;
+ const sceneGraph = model.sceneGraph;
+ const runtimeNode = renderResources.runtimeNode;
+ const use2D = frameState.mode !== SceneMode_default.SCENE3D && !frameState.scene3DOnly && model._projectTo2D;
+ const instancingVertexAttributes = [];
+ processTransformAttributes(
+ renderResources,
+ frameState,
+ instances,
+ instancingVertexAttributes,
+ use2D
+ );
+ processFeatureIdAttributes(
+ renderResources,
+ frameState,
+ instances,
+ instancingVertexAttributes
+ );
+ const uniformMap2 = {};
+ if (instances.transformInWorldSpace) {
+ shaderBuilder.addDefine(
+ "USE_LEGACY_INSTANCING",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addUniform(
+ "mat4",
+ "u_instance_modifiedModelView",
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addUniform(
+ "mat4",
+ "u_instance_nodeTransform",
+ ShaderDestination_default.VERTEX
+ );
+ uniformMap2.u_instance_modifiedModelView = function() {
+ let modifiedModelMatrix = Matrix4_default.multiplyTransformation(
+ model.modelMatrix,
+ sceneGraph.components.transform,
+ modelViewScratch
+ );
+ if (use2D) {
+ return Matrix4_default.multiplyTransformation(
+ frameState.context.uniformState.view3D,
+ modifiedModelMatrix,
+ modelViewScratch
+ );
+ }
+ if (frameState.mode !== SceneMode_default.SCENE3D) {
+ modifiedModelMatrix = Transforms_default.basisTo2D(
+ frameState.mapProjection,
+ modifiedModelMatrix,
+ modelViewScratch
+ );
+ }
+ return Matrix4_default.multiplyTransformation(
+ frameState.context.uniformState.view,
+ modifiedModelMatrix,
+ modelViewScratch
+ );
+ };
+ uniformMap2.u_instance_nodeTransform = function() {
+ return Matrix4_default.multiplyTransformation(
+ sceneGraph.axisCorrectionMatrix,
+ runtimeNode.computedTransform,
+ nodeTransformScratch
+ );
+ };
+ shaderBuilder.addVertexLines(LegacyInstancingStageVS_default);
+ } else {
+ shaderBuilder.addVertexLines(InstancingStageVS_default);
+ }
+ if (use2D) {
+ shaderBuilder.addDefine(
+ "USE_2D_INSTANCING",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addUniform("mat4", "u_modelView2D", ShaderDestination_default.VERTEX);
+ const context = frameState.context;
+ const modelMatrix2D = Matrix4_default.fromTranslation(
+ runtimeNode.instancingReferencePoint2D,
+ new Matrix4_default()
+ );
+ uniformMap2.u_modelView2D = function() {
+ return Matrix4_default.multiplyTransformation(
+ context.uniformState.view,
+ modelMatrix2D,
+ modelView2DScratch
+ );
+ };
+ }
+ renderResources.uniformMap = combine_default(uniformMap2, renderResources.uniformMap);
+ renderResources.instanceCount = count;
+ renderResources.attributes.push.apply(
+ renderResources.attributes,
+ instancingVertexAttributes
+ );
+};
+var projectedTransformScratch = new Matrix4_default();
+var projectedPositionScratch = new Cartesian3_default();
+function projectTransformTo2D(transform3, modelMatrix, nodeTransform, frameState, result) {
+ let projectedTransform = Matrix4_default.multiplyTransformation(
+ modelMatrix,
+ transform3,
+ projectedTransformScratch
+ );
+ projectedTransform = Matrix4_default.multiplyTransformation(
+ projectedTransform,
+ nodeTransform,
+ projectedTransformScratch
+ );
+ result = Transforms_default.basisTo2D(
+ frameState.mapProjection,
+ projectedTransform,
+ result
+ );
+ return result;
+}
+function projectPositionTo2D(position, modelMatrix, nodeTransform, frameState, result) {
+ const translationMatrix = Matrix4_default.fromTranslation(
+ position,
+ projectedTransformScratch
+ );
+ let projectedTransform = Matrix4_default.multiplyTransformation(
+ modelMatrix,
+ translationMatrix,
+ projectedTransformScratch
+ );
+ projectedTransform = Matrix4_default.multiplyTransformation(
+ projectedTransform,
+ nodeTransform,
+ projectedTransformScratch
+ );
+ const finalPosition = Matrix4_default.getTranslation(
+ projectedTransform,
+ projectedPositionScratch
+ );
+ result = SceneTransforms_default.computeActualWgs84Position(
+ frameState,
+ finalPosition,
+ result
+ );
+ return result;
+}
+function getModelMatrixAndNodeTransform(renderResources, modelMatrix, nodeComputedTransform) {
+ const model = renderResources.model;
+ const sceneGraph = model.sceneGraph;
+ const instances = renderResources.runtimeNode.node.instances;
+ if (instances.transformInWorldSpace) {
+ modelMatrix = Matrix4_default.multiplyTransformation(
+ model.modelMatrix,
+ sceneGraph.components.transform,
+ modelMatrix
+ );
+ nodeComputedTransform = Matrix4_default.multiplyTransformation(
+ sceneGraph.axisCorrectionMatrix,
+ renderResources.runtimeNode.computedTransform,
+ nodeComputedTransform
+ );
+ } else {
+ modelMatrix = Matrix4_default.clone(sceneGraph.computedModelMatrix, modelMatrix);
+ modelMatrix = Matrix4_default.multiplyTransformation(
+ modelMatrix,
+ renderResources.runtimeNode.computedTransform,
+ modelMatrix
+ );
+ nodeComputedTransform = Matrix4_default.clone(
+ Matrix4_default.IDENTITY,
+ nodeComputedTransform
+ );
+ }
+}
+var modelMatrixScratch = new Matrix4_default();
+var nodeComputedTransformScratch = new Matrix4_default();
+var transformScratch2 = new Matrix4_default();
+var positionScratch5 = new Cartesian3_default();
+function projectTransformsTo2D(transforms, renderResources, frameState, result) {
+ const modelMatrix = modelMatrixScratch;
+ const nodeComputedTransform = nodeComputedTransformScratch;
+ getModelMatrixAndNodeTransform(
+ renderResources,
+ modelMatrix,
+ nodeComputedTransform
+ );
+ const runtimeNode = renderResources.runtimeNode;
+ const referencePoint = runtimeNode.instancingReferencePoint2D;
+ const count = transforms.length;
+ for (let i = 0; i < count; i++) {
+ const transform3 = transforms[i];
+ const projectedTransform = projectTransformTo2D(
+ transform3,
+ modelMatrix,
+ nodeComputedTransform,
+ frameState,
+ transformScratch2
+ );
+ const position = Matrix4_default.getTranslation(
+ projectedTransform,
+ positionScratch5
+ );
+ const finalTranslation = Cartesian3_default.subtract(
+ position,
+ referencePoint,
+ position
+ );
+ result[i] = Matrix4_default.setTranslation(
+ projectedTransform,
+ finalTranslation,
+ result[i]
+ );
+ }
+ return result;
+}
+function projectTranslationsTo2D(translations, renderResources, frameState, result) {
+ const modelMatrix = modelMatrixScratch;
+ const nodeComputedTransform = nodeComputedTransformScratch;
+ getModelMatrixAndNodeTransform(
+ renderResources,
+ modelMatrix,
+ nodeComputedTransform
+ );
+ const runtimeNode = renderResources.runtimeNode;
+ const referencePoint = runtimeNode.instancingReferencePoint2D;
+ const count = translations.length;
+ for (let i = 0; i < count; i++) {
+ const translation3 = translations[i];
+ const projectedPosition2 = projectPositionTo2D(
+ translation3,
+ modelMatrix,
+ nodeComputedTransform,
+ frameState,
+ translation3
+ );
+ result[i] = Cartesian3_default.subtract(
+ projectedPosition2,
+ referencePoint,
+ result[i]
+ );
+ }
+ return result;
+}
+var scratchProjectedMin = new Cartesian3_default();
+var scratchProjectedMax = new Cartesian3_default();
+function computeReferencePoint2D(renderResources, frameState) {
+ const runtimeNode = renderResources.runtimeNode;
+ const modelMatrix = renderResources.model.sceneGraph.computedModelMatrix;
+ const transformedPositionMin = Matrix4_default.multiplyByPoint(
+ modelMatrix,
+ runtimeNode.instancingTranslationMin,
+ scratchProjectedMin
+ );
+ const projectedMin = SceneTransforms_default.computeActualWgs84Position(
+ frameState,
+ transformedPositionMin,
+ transformedPositionMin
+ );
+ const transformedPositionMax = Matrix4_default.multiplyByPoint(
+ modelMatrix,
+ runtimeNode.instancingTranslationMax,
+ scratchProjectedMax
+ );
+ const projectedMax = SceneTransforms_default.computeActualWgs84Position(
+ frameState,
+ transformedPositionMax,
+ transformedPositionMax
+ );
+ runtimeNode.instancingReferencePoint2D = Cartesian3_default.lerp(
+ projectedMin,
+ projectedMax,
+ 0.5,
+ new Cartesian3_default()
+ );
+}
+function transformsToTypedArray(transforms) {
+ const elements = 12;
+ const count = transforms.length;
+ const transformsTypedArray = new Float32Array(count * elements);
+ for (let i = 0; i < count; i++) {
+ const transform3 = transforms[i];
+ const offset2 = elements * i;
+ transformsTypedArray[offset2 + 0] = transform3[0];
+ transformsTypedArray[offset2 + 1] = transform3[4];
+ transformsTypedArray[offset2 + 2] = transform3[8];
+ transformsTypedArray[offset2 + 3] = transform3[12];
+ transformsTypedArray[offset2 + 4] = transform3[1];
+ transformsTypedArray[offset2 + 5] = transform3[5];
+ transformsTypedArray[offset2 + 6] = transform3[9];
+ transformsTypedArray[offset2 + 7] = transform3[13];
+ transformsTypedArray[offset2 + 8] = transform3[2];
+ transformsTypedArray[offset2 + 9] = transform3[6];
+ transformsTypedArray[offset2 + 10] = transform3[10];
+ transformsTypedArray[offset2 + 11] = transform3[14];
+ }
+ return transformsTypedArray;
+}
+function translationsToTypedArray(translations) {
+ const elements = 3;
+ const count = translations.length;
+ const transationsTypedArray = new Float32Array(count * elements);
+ for (let i = 0; i < count; i++) {
+ const translation3 = translations[i];
+ const offset2 = elements * i;
+ transationsTypedArray[offset2 + 0] = translation3[0];
+ transationsTypedArray[offset2 + 1] = translation3[4];
+ transationsTypedArray[offset2 + 2] = translation3[8];
+ }
+ return transationsTypedArray;
+}
+var translationScratch = new Cartesian3_default();
+var rotationScratch = new Quaternion_default();
+var scaleScratch = new Cartesian3_default();
+function getInstanceTransformsAsMatrices(instances, count, renderResources) {
+ const transforms = new Array(count);
+ const translationAttribute = ModelUtility_default.getAttributeBySemantic(
+ instances,
+ InstanceAttributeSemantic_default.TRANSLATION
+ );
+ const rotationAttribute = ModelUtility_default.getAttributeBySemantic(
+ instances,
+ InstanceAttributeSemantic_default.ROTATION
+ );
+ const scaleAttribute = ModelUtility_default.getAttributeBySemantic(
+ instances,
+ InstanceAttributeSemantic_default.SCALE
+ );
+ const instancingTranslationMax = new Cartesian3_default(
+ -Number.MAX_VALUE,
+ -Number.MAX_VALUE,
+ -Number.MAX_VALUE
+ );
+ const instancingTranslationMin = new Cartesian3_default(
+ Number.MAX_VALUE,
+ Number.MAX_VALUE,
+ Number.MAX_VALUE
+ );
+ const hasTranslation = defined_default(translationAttribute);
+ const hasRotation = defined_default(rotationAttribute);
+ const hasScale = defined_default(scaleAttribute);
+ const translationTypedArray = hasTranslation ? translationAttribute.typedArray : new Float32Array(count * 3);
+ let rotationTypedArray = hasRotation ? rotationAttribute.typedArray : new Float32Array(count * 4);
+ if (hasRotation && rotationAttribute.normalized) {
+ rotationTypedArray = AttributeCompression_default.dequantize(
+ rotationTypedArray,
+ rotationAttribute.componentDatatype,
+ rotationAttribute.type,
+ count
+ );
+ }
+ let scaleTypedArray;
+ if (hasScale) {
+ scaleTypedArray = scaleAttribute.typedArray;
+ } else {
+ scaleTypedArray = new Float32Array(count * 3);
+ scaleTypedArray.fill(1);
+ }
+ for (let i = 0; i < count; i++) {
+ const translation3 = new Cartesian3_default(
+ translationTypedArray[i * 3],
+ translationTypedArray[i * 3 + 1],
+ translationTypedArray[i * 3 + 2],
+ translationScratch
+ );
+ Cartesian3_default.maximumByComponent(
+ instancingTranslationMax,
+ translation3,
+ instancingTranslationMax
+ );
+ Cartesian3_default.minimumByComponent(
+ instancingTranslationMin,
+ translation3,
+ instancingTranslationMin
+ );
+ const rotation = new Quaternion_default(
+ rotationTypedArray[i * 4],
+ rotationTypedArray[i * 4 + 1],
+ rotationTypedArray[i * 4 + 2],
+ hasRotation ? rotationTypedArray[i * 4 + 3] : 1,
+ rotationScratch
+ );
+ const scale = new Cartesian3_default(
+ scaleTypedArray[i * 3],
+ scaleTypedArray[i * 3 + 1],
+ scaleTypedArray[i * 3 + 2],
+ scaleScratch
+ );
+ const transform3 = Matrix4_default.fromTranslationQuaternionRotationScale(
+ translation3,
+ rotation,
+ scale,
+ new Matrix4_default()
+ );
+ transforms[i] = transform3;
+ }
+ const runtimeNode = renderResources.runtimeNode;
+ runtimeNode.instancingTranslationMin = instancingTranslationMin;
+ runtimeNode.instancingTranslationMax = instancingTranslationMax;
+ if (hasTranslation) {
+ translationAttribute.typedArray = void 0;
+ }
+ if (hasRotation) {
+ rotationAttribute.typedArray = void 0;
+ }
+ if (hasScale) {
+ scaleAttribute.typedArray = void 0;
+ }
+ return transforms;
+}
+function getInstanceTranslationsAsCartesian3s(translationAttribute, count, renderResources) {
+ const instancingTranslations = new Array(count);
+ const translationTypedArray = translationAttribute.typedArray;
+ const instancingTranslationMin = new Cartesian3_default(
+ Number.MAX_VALUE,
+ Number.MAX_VALUE,
+ Number.MAX_VALUE
+ );
+ const instancingTranslationMax = new Cartesian3_default(
+ -Number.MAX_VALUE,
+ -Number.MAX_VALUE,
+ -Number.MAX_VALUE
+ );
+ for (let i = 0; i < count; i++) {
+ const translation3 = new Cartesian3_default(
+ translationTypedArray[i * 3],
+ translationTypedArray[i * 3 + 1],
+ translationTypedArray[i * 3 + 2]
+ );
+ instancingTranslations[i] = translation3;
+ Cartesian3_default.minimumByComponent(
+ instancingTranslationMin,
+ translation3,
+ instancingTranslationMin
+ );
+ Cartesian3_default.maximumByComponent(
+ instancingTranslationMax,
+ translation3,
+ instancingTranslationMax
+ );
+ }
+ const runtimeNode = renderResources.runtimeNode;
+ runtimeNode.instancingTranslationMin = instancingTranslationMin;
+ runtimeNode.instancingTranslationMax = instancingTranslationMax;
+ translationAttribute.typedArray = void 0;
+ return instancingTranslations;
+}
+function createVertexBuffer2(typedArray, frameState) {
+ const buffer = Buffer_default.createVertexBuffer({
+ context: frameState.context,
+ typedArray,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ buffer.vertexArrayDestroyable = false;
+ return buffer;
+}
+function processTransformAttributes(renderResources, frameState, instances, instancingVertexAttributes, use2D) {
+ const rotationAttribute = ModelUtility_default.getAttributeBySemantic(
+ instances,
+ InstanceAttributeSemantic_default.ROTATION
+ );
+ if (defined_default(rotationAttribute)) {
+ processTransformMatrixAttributes(
+ renderResources,
+ instances,
+ instancingVertexAttributes,
+ frameState,
+ use2D
+ );
+ } else {
+ processTransformVec3Attributes(
+ renderResources,
+ instances,
+ instancingVertexAttributes,
+ frameState,
+ use2D
+ );
+ }
+}
+function processTransformMatrixAttributes(renderResources, instances, instancingVertexAttributes, frameState, use2D) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const count = instances.attributes[0].count;
+ const model = renderResources.model;
+ const runtimeNode = renderResources.runtimeNode;
+ shaderBuilder.addDefine("HAS_INSTANCE_MATRICES");
+ const attributeString = "Transform";
+ let transforms;
+ let buffer = runtimeNode.instancingTransformsBuffer;
+ if (!defined_default(buffer)) {
+ transforms = getInstanceTransformsAsMatrices(
+ instances,
+ count,
+ renderResources
+ );
+ const transformsTypedArray = transformsToTypedArray(transforms);
+ buffer = createVertexBuffer2(transformsTypedArray, frameState);
+ model._modelResources.push(buffer);
+ runtimeNode.instancingTransformsBuffer = buffer;
+ }
+ processMatrixAttributes(
+ renderResources,
+ buffer,
+ instancingVertexAttributes,
+ attributeString
+ );
+ if (!use2D) {
+ return;
+ }
+ const frameStateCV = clone_default(frameState);
+ frameStateCV.mode = SceneMode_default.COLUMBUS_VIEW;
+ computeReferencePoint2D(renderResources, frameStateCV);
+ let buffer2D = runtimeNode.instancingTransformsBuffer2D;
+ if (!defined_default(buffer2D)) {
+ const projectedTransforms = projectTransformsTo2D(
+ transforms,
+ renderResources,
+ frameStateCV,
+ transforms
+ );
+ const projectedTypedArray = transformsToTypedArray(projectedTransforms);
+ buffer2D = createVertexBuffer2(projectedTypedArray, frameState);
+ model._modelResources.push(buffer2D);
+ runtimeNode.instancingTransformsBuffer2D = buffer2D;
+ }
+ const attributeString2D = "Transform2D";
+ processMatrixAttributes(
+ renderResources,
+ buffer2D,
+ instancingVertexAttributes,
+ attributeString2D
+ );
+}
+function processTransformVec3Attributes(renderResources, instances, instancingVertexAttributes, frameState, use2D) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const runtimeNode = renderResources.runtimeNode;
+ const translationAttribute = ModelUtility_default.getAttributeBySemantic(
+ instances,
+ InstanceAttributeSemantic_default.TRANSLATION
+ );
+ const scaleAttribute = ModelUtility_default.getAttributeBySemantic(
+ instances,
+ InstanceAttributeSemantic_default.SCALE
+ );
+ if (defined_default(scaleAttribute)) {
+ shaderBuilder.addDefine("HAS_INSTANCE_SCALE");
+ const attributeString2 = "Scale";
+ processVec3Attribute(
+ renderResources,
+ scaleAttribute.buffer,
+ scaleAttribute.byteOffset,
+ scaleAttribute.byteStride,
+ instancingVertexAttributes,
+ attributeString2
+ );
+ }
+ if (!defined_default(translationAttribute)) {
+ return;
+ }
+ let instancingTranslations;
+ const typedArray = translationAttribute.typedArray;
+ if (defined_default(typedArray)) {
+ instancingTranslations = getInstanceTranslationsAsCartesian3s(
+ translationAttribute,
+ translationAttribute.count,
+ renderResources
+ );
+ } else if (!defined_default(runtimeNode.instancingTranslationMin)) {
+ runtimeNode.instancingTranslationMin = translationAttribute.min;
+ runtimeNode.instancingTranslationMax = translationAttribute.max;
+ }
+ shaderBuilder.addDefine("HAS_INSTANCE_TRANSLATION");
+ const attributeString = "Translation";
+ processVec3Attribute(
+ renderResources,
+ translationAttribute.buffer,
+ translationAttribute.byteOffset,
+ translationAttribute.byteStride,
+ instancingVertexAttributes,
+ attributeString
+ );
+ if (!use2D) {
+ return;
+ }
+ const frameStateCV = clone_default(frameState);
+ frameStateCV.mode = SceneMode_default.COLUMBUS_VIEW;
+ computeReferencePoint2D(renderResources, frameStateCV);
+ let buffer2D = runtimeNode.instancingTranslationBuffer2D;
+ if (!defined_default(buffer2D)) {
+ const projectedTranslations = projectTranslationsTo2D(
+ instancingTranslations,
+ renderResources,
+ frameStateCV,
+ instancingTranslations
+ );
+ const projectedTypedArray = translationsToTypedArray(projectedTranslations);
+ buffer2D = createVertexBuffer2(projectedTypedArray, frameState);
+ renderResources.model._modelResources.push(buffer2D);
+ runtimeNode.instancingTranslationBuffer2D = buffer2D;
+ }
+ const byteOffset = 0;
+ const byteStride = void 0;
+ const attributeString2D = "Translation2D";
+ processVec3Attribute(
+ renderResources,
+ buffer2D,
+ byteOffset,
+ byteStride,
+ instancingVertexAttributes,
+ attributeString2D
+ );
+}
+function processMatrixAttributes(renderResources, buffer, instancingVertexAttributes, attributeString) {
+ const vertexSizeInFloats = 12;
+ const componentByteSize = ComponentDatatype_default.getSizeInBytes(
+ ComponentDatatype_default.FLOAT
+ );
+ const strideInBytes = componentByteSize * vertexSizeInFloats;
+ const matrixAttributes = [
+ {
+ index: renderResources.attributeIndex++,
+ vertexBuffer: buffer,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ normalize: false,
+ offsetInBytes: 0,
+ strideInBytes,
+ instanceDivisor: 1
+ },
+ {
+ index: renderResources.attributeIndex++,
+ vertexBuffer: buffer,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ normalize: false,
+ offsetInBytes: componentByteSize * 4,
+ strideInBytes,
+ instanceDivisor: 1
+ },
+ {
+ index: renderResources.attributeIndex++,
+ vertexBuffer: buffer,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ normalize: false,
+ offsetInBytes: componentByteSize * 8,
+ strideInBytes,
+ instanceDivisor: 1
+ }
+ ];
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addAttribute("vec4", `a_instancing${attributeString}Row0`);
+ shaderBuilder.addAttribute("vec4", `a_instancing${attributeString}Row1`);
+ shaderBuilder.addAttribute("vec4", `a_instancing${attributeString}Row2`);
+ instancingVertexAttributes.push.apply(
+ instancingVertexAttributes,
+ matrixAttributes
+ );
+}
+function processVec3Attribute(renderResources, buffer, byteOffset, byteStride, instancingVertexAttributes, attributeString) {
+ instancingVertexAttributes.push({
+ index: renderResources.attributeIndex++,
+ vertexBuffer: buffer,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ normalize: false,
+ offsetInBytes: byteOffset,
+ strideInBytes: byteStride,
+ instanceDivisor: 1
+ });
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addAttribute("vec3", `a_instance${attributeString}`);
+}
+function processFeatureIdAttributes(renderResources, frameState, instances, instancingVertexAttributes) {
+ const attributes = instances.attributes;
+ const shaderBuilder = renderResources.shaderBuilder;
+ for (let i = 0; i < attributes.length; i++) {
+ const attribute = attributes[i];
+ if (attribute.semantic !== InstanceAttributeSemantic_default.FEATURE_ID) {
+ continue;
+ }
+ if (attribute.setIndex >= renderResources.featureIdVertexAttributeSetIndex) {
+ renderResources.featureIdVertexAttributeSetIndex = attribute.setIndex + 1;
+ }
+ instancingVertexAttributes.push({
+ index: renderResources.attributeIndex++,
+ vertexBuffer: attribute.buffer,
+ componentsPerAttribute: AttributeType_default.getNumberOfComponents(
+ attribute.type
+ ),
+ componentDatatype: attribute.componentDatatype,
+ normalize: false,
+ offsetInBytes: attribute.byteOffset,
+ strideInBytes: attribute.byteStride,
+ instanceDivisor: 1
+ });
+ shaderBuilder.addAttribute(
+ "float",
+ `a_instanceFeatureId_${attribute.setIndex}`
+ );
+ }
+}
+var InstancingPipelineStage_default = InstancingPipelineStage;
+
+// Source/Scene/Model/ModelMatrixUpdateStage.js
+var ModelMatrixUpdateStage = {};
+ModelMatrixUpdateStage.name = "ModelMatrixUpdateStage";
+ModelMatrixUpdateStage.update = function(runtimeNode, sceneGraph, frameState) {
+ const use2D = frameState.mode !== SceneMode_default.SCENE3D;
+ if (use2D && sceneGraph._model._projectTo2D) {
+ return;
+ }
+ if (runtimeNode._transformDirty) {
+ const modelMatrix = use2D ? sceneGraph._computedModelMatrix2D : sceneGraph._computedModelMatrix;
+ updateRuntimeNode(
+ runtimeNode,
+ sceneGraph,
+ modelMatrix,
+ runtimeNode.transformToRoot
+ );
+ runtimeNode._transformDirty = false;
+ }
+};
+function updateRuntimeNode(runtimeNode, sceneGraph, modelMatrix, transformToRoot) {
+ let i;
+ transformToRoot = Matrix4_default.multiplyTransformation(
+ transformToRoot,
+ runtimeNode.transform,
+ new Matrix4_default()
+ );
+ runtimeNode.updateComputedTransform();
+ const primitivesLength = runtimeNode.runtimePrimitives.length;
+ for (i = 0; i < primitivesLength; i++) {
+ const runtimePrimitive = runtimeNode.runtimePrimitives[i];
+ const drawCommand = runtimePrimitive.drawCommand;
+ drawCommand.modelMatrix = Matrix4_default.multiplyTransformation(
+ modelMatrix,
+ transformToRoot,
+ drawCommand.modelMatrix
+ );
+ drawCommand.cullFace = ModelUtility_default.getCullFace(
+ drawCommand.modelMatrix,
+ drawCommand.primitiveType
+ );
+ }
+ const childrenLength = runtimeNode.children.length;
+ for (i = 0; i < childrenLength; i++) {
+ const childRuntimeNode = sceneGraph._runtimeNodes[runtimeNode.children[i]];
+ childRuntimeNode._transformToRoot = Matrix4_default.clone(
+ transformToRoot,
+ childRuntimeNode._transformToRoot
+ );
+ updateRuntimeNode(
+ childRuntimeNode,
+ sceneGraph,
+ modelMatrix,
+ transformToRoot
+ );
+ childRuntimeNode._transformDirty = false;
+ }
+}
+var ModelMatrixUpdateStage_default = ModelMatrixUpdateStage;
+
+// Source/Scene/Model/NodeStatisticsPipelineStage.js
+var NodeStatisticsPipelineStage = {
+ name: "NodeStatisticsPipelineStage",
+ _countInstancingAttributes: countInstancingAttributes,
+ _countGeneratedBuffers: countGeneratedBuffers
+};
+NodeStatisticsPipelineStage.process = function(renderResources, node, frameState) {
+ const statistics2 = renderResources.model.statistics;
+ const instances = node.instances;
+ const runtimeNode = renderResources.runtimeNode;
+ countInstancingAttributes(statistics2, instances);
+ countGeneratedBuffers(statistics2, runtimeNode);
+};
+function countInstancingAttributes(statistics2, instances) {
+ if (!defined_default(instances)) {
+ return;
+ }
+ const attributes = instances.attributes;
+ const length3 = attributes.length;
+ for (let i = 0; i < length3; i++) {
+ const attribute = attributes[i];
+ if (defined_default(attribute.buffer)) {
+ const hasCpuCopy = false;
+ statistics2.addBuffer(attribute.buffer, hasCpuCopy);
+ }
+ }
+}
+function countGeneratedBuffers(statistics2, runtimeNode) {
+ if (defined_default(runtimeNode.instancingTransformsBuffer)) {
+ const hasCpuCopy = false;
+ statistics2.addBuffer(runtimeNode.instancingTransformsBuffer, hasCpuCopy);
+ }
+ if (defined_default(runtimeNode.instancingTransformsBuffer2D)) {
+ const hasCpuCopy = false;
+ statistics2.addBuffer(runtimeNode.instancingTransformsBuffer2D, hasCpuCopy);
+ }
+ if (defined_default(runtimeNode.instancingTranslationBuffer2D)) {
+ const hasCpuCopy = false;
+ statistics2.addBuffer(runtimeNode.instancingTranslationBuffer2D, hasCpuCopy);
+ }
+}
+var NodeStatisticsPipelineStage_default = NodeStatisticsPipelineStage;
+
+// Source/Scene/Model/ModelRuntimeNode.js
+function ModelRuntimeNode(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const node = options.node;
+ const transform3 = options.transform;
+ const transformToRoot = options.transformToRoot;
+ const sceneGraph = options.sceneGraph;
+ const children = options.children;
+ Check_default.typeOf.object("options.node", node);
+ Check_default.typeOf.object("options.transform", transform3);
+ Check_default.typeOf.object("options.transformToRoot", transformToRoot);
+ Check_default.typeOf.object("options.sceneGraph", sceneGraph);
+ Check_default.typeOf.object("options.children", children);
+ this._node = node;
+ this._name = node.name;
+ this._id = node.index;
+ this._sceneGraph = sceneGraph;
+ this._children = children;
+ this._originalTransform = Matrix4_default.clone(transform3, this._originalTransform);
+ this._transform = Matrix4_default.clone(transform3, this._transform);
+ this._transformToRoot = Matrix4_default.clone(transformToRoot, this._transformToRoot);
+ this._computedTransform = new Matrix4_default();
+ this._transformDirty = false;
+ this._transformParameters = void 0;
+ this._morphWeights = [];
+ this._runtimeSkin = void 0;
+ this._computedJointMatrices = [];
+ this.show = true;
+ this.userAnimated = false;
+ this.pipelineStages = [];
+ this.runtimePrimitives = [];
+ this.updateStages = [];
+ this.instancingTranslationMin = void 0;
+ this.instancingTranslationMax = void 0;
+ this.instancingTransformsBuffer = void 0;
+ this.instancingTransformsBuffer2D = void 0;
+ this.instancingTranslationBuffer2D = void 0;
+ this.instancingReferencePoint2D = void 0;
+ initialize16(this);
+}
+Object.defineProperties(ModelRuntimeNode.prototype, {
+ node: {
+ get: function() {
+ return this._node;
+ }
+ },
+ sceneGraph: {
+ get: function() {
+ return this._sceneGraph;
+ }
+ },
+ children: {
+ get: function() {
+ return this._children;
+ }
+ },
+ transform: {
+ get: function() {
+ return this._transform;
+ },
+ set: function(value) {
+ this._transformDirty = true;
+ this._transform = Matrix4_default.clone(value, this._transform);
+ }
+ },
+ transformToRoot: {
+ get: function() {
+ return this._transformToRoot;
+ }
+ },
+ computedTransform: {
+ get: function() {
+ return this._computedTransform;
+ }
+ },
+ originalTransform: {
+ get: function() {
+ return this._originalTransform;
+ }
+ },
+ translation: {
+ get: function() {
+ return defined_default(this._transformParameters) ? this._transformParameters.translation : void 0;
+ },
+ set: function(value) {
+ const transformParameters = this._transformParameters;
+ if (!defined_default(transformParameters)) {
+ throw new DeveloperError_default(
+ "The translation of a node cannot be set if it was defined using a matrix in the model."
+ );
+ }
+ const currentTranslation = transformParameters.translation;
+ if (Cartesian3_default.equals(currentTranslation, value)) {
+ return;
+ }
+ transformParameters.translation = Cartesian3_default.clone(
+ value,
+ transformParameters.translation
+ );
+ updateTransformFromParameters(this, transformParameters);
+ }
+ },
+ rotation: {
+ get: function() {
+ return defined_default(this._transformParameters) ? this._transformParameters.rotation : void 0;
+ },
+ set: function(value) {
+ const transformParameters = this._transformParameters;
+ if (!defined_default(transformParameters)) {
+ throw new DeveloperError_default(
+ "The rotation of a node cannot be set if it was defined using a matrix in the model."
+ );
+ }
+ const currentRotation = transformParameters.rotation;
+ if (Quaternion_default.equals(currentRotation, value)) {
+ return;
+ }
+ transformParameters.rotation = Quaternion_default.clone(
+ value,
+ transformParameters.rotation
+ );
+ updateTransformFromParameters(this, transformParameters);
+ }
+ },
+ scale: {
+ get: function() {
+ return defined_default(this._transformParameters) ? this._transformParameters.scale : void 0;
+ },
+ set: function(value) {
+ const transformParameters = this._transformParameters;
+ if (!defined_default(transformParameters)) {
+ throw new DeveloperError_default(
+ "The scale of a node cannot be set if it was defined using a matrix in the model."
+ );
+ }
+ const currentScale = transformParameters.scale;
+ if (Cartesian3_default.equals(currentScale, value)) {
+ return;
+ }
+ transformParameters.scale = Cartesian3_default.clone(
+ value,
+ transformParameters.scale
+ );
+ updateTransformFromParameters(this, transformParameters);
+ }
+ },
+ morphWeights: {
+ get: function() {
+ return this._morphWeights;
+ },
+ set: function(value) {
+ const valueLength = value.length;
+ if (this._morphWeights.length !== valueLength) {
+ throw new DeveloperError_default(
+ "value must have the same length as the original weights array."
+ );
+ }
+ for (let i = 0; i < valueLength; i++) {
+ this._morphWeights[i] = value[i];
+ }
+ }
+ },
+ runtimeSkin: {
+ get: function() {
+ return this._runtimeSkin;
+ }
+ },
+ computedJointMatrices: {
+ get: function() {
+ return this._computedJointMatrices;
+ }
+ }
+});
+function initialize16(runtimeNode) {
+ const transform3 = runtimeNode.transform;
+ const transformToRoot = runtimeNode.transformToRoot;
+ const computedTransform = runtimeNode._computedTransform;
+ runtimeNode._computedTransform = Matrix4_default.multiply(
+ transformToRoot,
+ transform3,
+ computedTransform
+ );
+ const node = runtimeNode.node;
+ if (!defined_default(node.matrix)) {
+ runtimeNode._transformParameters = new TranslationRotationScale_default(
+ node.translation,
+ node.rotation,
+ node.scale
+ );
+ }
+ if (defined_default(node.morphWeights)) {
+ runtimeNode._morphWeights = node.morphWeights.slice();
+ }
+ const articulationName = node.articulationName;
+ if (defined_default(articulationName)) {
+ const sceneGraph = runtimeNode.sceneGraph;
+ const runtimeArticulations = sceneGraph._runtimeArticulations;
+ const runtimeArticulation = runtimeArticulations[articulationName];
+ if (defined_default(runtimeArticulation)) {
+ runtimeArticulation.runtimeNodes.push(runtimeNode);
+ }
+ }
+}
+function updateTransformFromParameters(runtimeNode, transformParameters) {
+ runtimeNode._transformDirty = true;
+ runtimeNode._transform = Matrix4_default.fromTranslationRotationScale(
+ transformParameters,
+ runtimeNode._transform
+ );
+}
+ModelRuntimeNode.prototype.getChild = function(index) {
+ Check_default.typeOf.number("index", index);
+ if (index < 0 || index >= this.children.length) {
+ throw new DeveloperError_default(
+ "index must be greater than or equal to 0 and less than the number of children."
+ );
+ }
+ return this.sceneGraph._runtimeNodes[this.children[index]];
+};
+ModelRuntimeNode.prototype.configurePipeline = function() {
+ const node = this.node;
+ const pipelineStages = this.pipelineStages;
+ pipelineStages.length = 0;
+ const updateStages = this.updateStages;
+ updateStages.length = 0;
+ if (defined_default(node.instances)) {
+ pipelineStages.push(InstancingPipelineStage_default);
+ }
+ pipelineStages.push(NodeStatisticsPipelineStage_default);
+ updateStages.push(ModelMatrixUpdateStage_default);
+};
+ModelRuntimeNode.prototype.updateComputedTransform = function() {
+ this._computedTransform = Matrix4_default.multiply(
+ this._transformToRoot,
+ this._transform,
+ this._computedTransform
+ );
+};
+ModelRuntimeNode.prototype.updateJointMatrices = function() {
+ const runtimeSkin = this._runtimeSkin;
+ if (!defined_default(runtimeSkin)) {
+ return;
+ }
+ runtimeSkin.updateJointMatrices();
+ const computedJointMatrices = this._computedJointMatrices;
+ const skinJointMatrices = runtimeSkin.jointMatrices;
+ const length3 = skinJointMatrices.length;
+ for (let i = 0; i < length3; i++) {
+ if (!defined_default(computedJointMatrices[i])) {
+ computedJointMatrices[i] = new Matrix4_default();
+ }
+ const nodeWorldTransform = Matrix4_default.multiplyTransformation(
+ this.transformToRoot,
+ this.transform,
+ computedJointMatrices[i]
+ );
+ const inverseNodeWorldTransform = Matrix4_default.inverseTransformation(
+ nodeWorldTransform,
+ computedJointMatrices[i]
+ );
+ computedJointMatrices[i] = Matrix4_default.multiplyTransformation(
+ inverseNodeWorldTransform,
+ skinJointMatrices[i],
+ computedJointMatrices[i]
+ );
+ }
+};
+var ModelRuntimeNode_default = ModelRuntimeNode;
+
+// Source/Scene/Model/AlphaPipelineStage.js
+var AlphaPipelineStage = {
+ name: "AlphaPipelineStage"
+};
+AlphaPipelineStage.process = function(renderResources, primitive, frameState) {
+ const alphaOptions = renderResources.alphaOptions;
+ const model = renderResources.model;
+ alphaOptions.pass = defaultValue_default(alphaOptions.pass, model.opaquePass);
+ const renderStateOptions = renderResources.renderStateOptions;
+ if (alphaOptions.pass === Pass_default.TRANSLUCENT) {
+ renderStateOptions.cull.enabled = false;
+ renderStateOptions.depthMask = false;
+ renderStateOptions.blending = BlendingState_default.ALPHA_BLEND;
+ }
+ const shaderBuilder = renderResources.shaderBuilder;
+ const uniformMap2 = renderResources.uniformMap;
+ if (defined_default(alphaOptions.alphaCutoff)) {
+ shaderBuilder.addDefine(
+ "ALPHA_MODE_MASK",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "float",
+ "u_alphaCutoff",
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2.u_alphaCutoff = function() {
+ return alphaOptions.alphaCutoff;
+ };
+ }
+};
+var AlphaPipelineStage_default = AlphaPipelineStage;
+
+// Source/Scene/Model/BatchTexturePipelineStage.js
+var BatchTexturePipelineStage = {
+ name: "BatchTexturePipelineStage"
+};
+BatchTexturePipelineStage.process = function(renderResources, primitive, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const batchTextureUniforms = {};
+ const model = renderResources.model;
+ const featureTable = model.featureTables[model.featureTableId];
+ const featuresLength = featureTable.featuresLength;
+ shaderBuilder.addUniform("int", "model_featuresLength");
+ batchTextureUniforms.model_featuresLength = function() {
+ return featuresLength;
+ };
+ const batchTexture = featureTable.batchTexture;
+ shaderBuilder.addUniform("sampler2D", "model_batchTexture");
+ batchTextureUniforms.model_batchTexture = function() {
+ return defaultValue_default(batchTexture.batchTexture, batchTexture.defaultTexture);
+ };
+ shaderBuilder.addUniform("vec4", "model_textureStep");
+ batchTextureUniforms.model_textureStep = function() {
+ return batchTexture.textureStep;
+ };
+ if (batchTexture.textureDimensions.y > 1) {
+ shaderBuilder.addDefine("MULTILINE_BATCH_TEXTURE");
+ shaderBuilder.addUniform("vec2", "model_textureDimensions");
+ batchTextureUniforms.model_textureDimensions = function() {
+ return batchTexture.textureDimensions;
+ };
+ }
+ renderResources.uniformMap = combine_default(
+ batchTextureUniforms,
+ renderResources.uniformMap
+ );
+};
+var BatchTexturePipelineStage_default = BatchTexturePipelineStage;
+
+// Source/Scene/Model/ClassificationPipelineStage.js
+var ClassificationPipelineStage = {
+ name: "ClassificationPipelineStage"
+};
+ClassificationPipelineStage.process = function(renderResources, primitive, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine(
+ "HAS_CLASSIFICATION",
+ void 0,
+ ShaderDestination_default.BOTH
+ );
+ const runtimePrimitive = renderResources.runtimePrimitive;
+ if (!defined_default(runtimePrimitive.batchLengths)) {
+ createClassificationBatches(primitive, runtimePrimitive);
+ }
+};
+function createClassificationBatches(primitive, runtimePrimitive) {
+ const positionAttribute = ModelUtility_default.getAttributeBySemantic(
+ primitive,
+ VertexAttributeSemantic_default.POSITION
+ );
+ if (!defined_default(positionAttribute)) {
+ throw new RuntimeError_default(
+ "Primitives must have a position attribute to be used for classification."
+ );
+ }
+ let indicesArray;
+ const indices2 = primitive.indices;
+ const hasIndices = defined_default(indices2);
+ if (hasIndices) {
+ indicesArray = indices2.typedArray;
+ indices2.typedArray = void 0;
+ }
+ const count = hasIndices ? indices2.count : positionAttribute.count;
+ const featureIdAttribute = ModelUtility_default.getAttributeBySemantic(
+ primitive,
+ VertexAttributeSemantic_default.FEATURE_ID,
+ 0
+ );
+ if (!defined_default(featureIdAttribute)) {
+ runtimePrimitive.batchLengths = [count];
+ runtimePrimitive.batchOffsets = [0];
+ return;
+ }
+ const featureIds = featureIdAttribute.typedArray;
+ featureIdAttribute.typedArray = void 0;
+ const batchLengths = [];
+ const batchOffsets = [0];
+ const firstIndex = hasIndices ? indicesArray[0] : 0;
+ let currentBatchId = featureIds[firstIndex];
+ let currentOffset = 0;
+ for (let i = 1; i < count; i++) {
+ const index = hasIndices ? indicesArray[i] : i;
+ const batchId = featureIds[index];
+ if (batchId !== currentBatchId) {
+ const batchLength = i - currentOffset;
+ const newOffset = i;
+ batchLengths.push(batchLength);
+ batchOffsets.push(newOffset);
+ currentOffset = newOffset;
+ currentBatchId = batchId;
+ }
+ }
+ const finalBatchLength = count - currentOffset;
+ batchLengths.push(finalBatchLength);
+ runtimePrimitive.batchLengths = batchLengths;
+ runtimePrimitive.batchOffsets = batchOffsets;
+}
+var ClassificationPipelineStage_default = ClassificationPipelineStage;
+
+// Source/Shaders/Model/CPUStylingStageVS.js
+var CPUStylingStageVS_default = "void filterByPassType(inout vec3 positionMC, vec4 featureColor)\n{\n bool styleTranslucent = (featureColor.a != 1.0);\n // Only render translucent features in the translucent pass (if the style or the original command has translucency).\n if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)\n {\n // If the model has a translucent silhouette, it needs to render during the silhouette color command,\n // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.\n #ifdef HAS_SILHOUETTE\n positionMC *= float(model_silhouettePass);\n #else\n positionMC *= 0.0;\n #endif\n }\n // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.\n else if (czm_pass != czm_passTranslucent && styleTranslucent)\n {\n positionMC *= 0.0;\n }\n}\n\nvoid cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)\n{\n float show = ceil(feature.color.a);\n positionMC *= show;\n\n #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)\n filterByPassType(positionMC, feature.color);\n #endif\n}\n";
+
+// Source/Shaders/Model/CPUStylingStageFS.js
+var CPUStylingStageFS_default = "void filterByPassType(vec4 featureColor)\n{\n bool styleTranslucent = (featureColor.a != 1.0);\n // Only render translucent features in the translucent pass (if the style or the original command has translucency).\n if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)\n { \n // If the model has a translucent silhouette, it needs to render during the silhouette color command,\n // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.\n #ifdef HAS_SILHOUETTE\n if(!model_silhouettePass) {\n discard;\n }\n #else\n discard;\n #endif\n }\n // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.\n else if (czm_pass != czm_passTranslucent && styleTranslucent)\n {\n discard;\n }\n}\n\nvoid cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)\n{\n vec4 featureColor = feature.color;\n if (featureColor.a == 0.0)\n {\n discard;\n }\n\n // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.\n // So, we only apply in in the fragment shader if the feature ID texture is used.\n #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)\n filterByPassType(featureColor);\n #endif\n\n featureColor = czm_gammaCorrect(featureColor);\n\n // Classification models compute the diffuse differently.\n #ifdef HAS_CLASSIFICATION\n material.diffuse = featureColor.rgb * featureColor.a;\n #else\n float highlight = ceil(model_colorBlend);\n material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);\n #endif\n \n material.alpha *= featureColor.a;\n}\n";
+
+// Source/Scene/Model/CPUStylingPipelineStage.js
+var CPUStylingPipelineStage = {
+ name: "CPUStylingPipelineStage"
+};
+CPUStylingPipelineStage.process = function(renderResources, primitive, frameState) {
+ const model = renderResources.model;
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addVertexLines(CPUStylingStageVS_default);
+ shaderBuilder.addFragmentLines(CPUStylingStageFS_default);
+ shaderBuilder.addDefine("USE_CPU_STYLING", void 0, ShaderDestination_default.BOTH);
+ if (!defined_default(model.color)) {
+ shaderBuilder.addUniform(
+ "float",
+ ModelColorPipelineStage_default.COLOR_BLEND_UNIFORM_NAME,
+ ShaderDestination_default.FRAGMENT
+ );
+ renderResources.uniformMap[ModelColorPipelineStage_default.COLOR_BLEND_UNIFORM_NAME] = function() {
+ return ColorBlendMode_default.getColorBlend(
+ model.colorBlendMode,
+ model.colorBlendAmount
+ );
+ };
+ }
+ shaderBuilder.addUniform(
+ "bool",
+ "model_commandTranslucent",
+ ShaderDestination_default.BOTH
+ );
+ renderResources.uniformMap.model_commandTranslucent = function() {
+ return renderResources.alphaOptions.pass === Pass_default.TRANSLUCENT;
+ };
+};
+var CPUStylingPipelineStage_default = CPUStylingPipelineStage;
+
+// Source/Scene/Model/CustomShaderMode.js
+var CustomShaderMode = {
+ MODIFY_MATERIAL: "MODIFY_MATERIAL",
+ REPLACE_MATERIAL: "REPLACE_MATERIAL"
+};
+CustomShaderMode.getDefineName = function(customShaderMode) {
+ return `CUSTOM_SHADER_${customShaderMode}`;
+};
+var CustomShaderMode_default = Object.freeze(CustomShaderMode);
+
+// Source/Shaders/Model/CustomShaderStageVS.js
+var CustomShaderStageVS_default = "void customShaderStage(\n inout czm_modelVertexOutput vsOutput, \n inout ProcessedAttributes attributes, \n FeatureIds featureIds,\n Metadata metadata,\n MetadataClass metadataClass,\n MetadataStatistics metadataStatistics\n) {\n // VertexInput and initializeInputStruct() are dynamically generated in JS, \n // see CustomShaderPipelineStage.js\n VertexInput vsInput;\n initializeInputStruct(vsInput, attributes);\n vsInput.featureIds = featureIds;\n vsInput.metadata = metadata;\n vsInput.metadataClass = metadataClass;\n vsInput.metadataStatistics = metadataStatistics;\n vertexMain(vsInput, vsOutput);\n attributes.positionMC = vsOutput.positionMC;\n}\n";
+
+// Source/Shaders/Model/CustomShaderStageFS.js
+var CustomShaderStageFS_default = "void customShaderStage(\n inout czm_modelMaterial material,\n ProcessedAttributes attributes,\n FeatureIds featureIds,\n Metadata metadata,\n MetadataClass metadataClass,\n MetadataStatistics metadataStatistics\n) {\n // FragmentInput and initializeInputStruct() are dynamically generated in JS, \n // see CustomShaderPipelineStage.js\n FragmentInput fsInput;\n initializeInputStruct(fsInput, attributes);\n fsInput.featureIds = featureIds;\n fsInput.metadata = metadata;\n fsInput.metadataClass = metadataClass;\n fsInput.metadataStatistics = metadataStatistics;\n fragmentMain(fsInput, material);\n}\n";
+
+// Source/Shaders/Model/FeatureIdStageFS.js
+var FeatureIdStageFS_default = "void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {\n initializeFeatureIds(featureIds, attributes);\n initializeFeatureIdAliases(featureIds);\n}\n";
+
+// Source/Shaders/Model/FeatureIdStageVS.js
+var FeatureIdStageVS_default = "void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) \n{\n initializeFeatureIds(featureIds, attributes);\n initializeFeatureIdAliases(featureIds);\n setFeatureIdVaryings();\n}\n";
+
+// Source/Scene/Model/FeatureIdPipelineStage.js
+var FeatureIdPipelineStage = {
+ name: "FeatureIdPipelineStage",
+ STRUCT_ID_FEATURE_IDS_VS: "FeatureIdsVS",
+ STRUCT_ID_FEATURE_IDS_FS: "FeatureIdsFS",
+ STRUCT_NAME_FEATURE_IDS: "FeatureIds",
+ FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS: "initializeFeatureIdsVS",
+ FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS: "initializeFeatureIdsFS",
+ FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS: "initializeFeatureIdAliasesVS",
+ FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS: "initializeFeatureIdAliasesFS",
+ FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS: "void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",
+ FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES: "void initializeFeatureIdAliases(inout FeatureIds featureIds)",
+ FUNCTION_ID_SET_FEATURE_ID_VARYINGS: "setFeatureIdVaryings",
+ FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS: "void setFeatureIdVaryings()"
+};
+FeatureIdPipelineStage.process = function(renderResources, primitive, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ declareStructsAndFunctions(shaderBuilder);
+ const instances = renderResources.runtimeNode.node.instances;
+ if (defined_default(instances)) {
+ processInstanceFeatureIds(renderResources, instances, frameState);
+ }
+ processPrimitiveFeatureIds(renderResources, primitive, frameState);
+ shaderBuilder.addVertexLines(FeatureIdStageVS_default);
+ shaderBuilder.addFragmentLines(FeatureIdStageFS_default);
+};
+function declareStructsAndFunctions(shaderBuilder) {
+ shaderBuilder.addStruct(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,
+ FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addStruct(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,
+ FeatureIdPipelineStage.STRUCT_NAME_FEATURE_IDS,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addFunction(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,
+ FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addFunction(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,
+ FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addFunction(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,
+ FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addFunction(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,
+ FeatureIdPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addFunction(
+ FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,
+ FeatureIdPipelineStage.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,
+ ShaderDestination_default.VERTEX
+ );
+}
+function processInstanceFeatureIds(renderResources, instances, frameState) {
+ const featureIdsArray = instances.featureIds;
+ const count = instances.attributes[0].count;
+ for (let i = 0; i < featureIdsArray.length; i++) {
+ const featureIds = featureIdsArray[i];
+ const variableName = featureIds.positionalLabel;
+ if (featureIds instanceof ModelComponents_default.FeatureIdAttribute) {
+ processInstanceAttribute(renderResources, featureIds, variableName);
+ } else {
+ const instanceDivisor = 1;
+ processImplicitRange(
+ renderResources,
+ featureIds,
+ variableName,
+ count,
+ instanceDivisor,
+ frameState
+ );
+ }
+ const label = featureIds.label;
+ if (defined_default(label)) {
+ addAlias(renderResources, variableName, label, ShaderDestination_default.BOTH);
+ }
+ }
+}
+function processPrimitiveFeatureIds(renderResources, primitive, frameState) {
+ const featureIdsArray = primitive.featureIds;
+ const positionAttribute = ModelUtility_default.getAttributeBySemantic(
+ primitive,
+ VertexAttributeSemantic_default.POSITION
+ );
+ const count = positionAttribute.count;
+ for (let i = 0; i < featureIdsArray.length; i++) {
+ const featureIds = featureIdsArray[i];
+ const variableName = featureIds.positionalLabel;
+ let aliasDestination = ShaderDestination_default.BOTH;
+ if (featureIds instanceof ModelComponents_default.FeatureIdAttribute) {
+ processAttribute(renderResources, featureIds, variableName);
+ } else if (featureIds instanceof ModelComponents_default.FeatureIdImplicitRange) {
+ processImplicitRange(
+ renderResources,
+ featureIds,
+ variableName,
+ count,
+ void 0,
+ frameState
+ );
+ } else {
+ processTexture(renderResources, featureIds, variableName, i, frameState);
+ aliasDestination = ShaderDestination_default.FRAGMENT;
+ }
+ const label = featureIds.label;
+ if (defined_default(label)) {
+ addAlias(renderResources, variableName, label, aliasDestination);
+ }
+ }
+}
+function processInstanceAttribute(renderResources, featureIdAttribute, variableName) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addStructField(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,
+ "int",
+ variableName
+ );
+ shaderBuilder.addStructField(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,
+ "int",
+ variableName
+ );
+ const setIndex = featureIdAttribute.setIndex;
+ const prefix = variableName.replace(/_\d+$/, "_");
+ const attributeName = `a_${prefix}${setIndex}`;
+ const varyingName = `v_${prefix}${setIndex}`;
+ const vertexLine = `featureIds.${variableName} = int(czm_round(${attributeName}));`;
+ const fragmentLine = `featureIds.${variableName} = int(czm_round(${varyingName}));`;
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,
+ [vertexLine]
+ );
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,
+ [fragmentLine]
+ );
+ shaderBuilder.addVarying("float", varyingName);
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,
+ [`${varyingName} = ${attributeName};`]
+ );
+}
+function processAttribute(renderResources, featureIdAttribute, variableName) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addStructField(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,
+ "int",
+ variableName
+ );
+ shaderBuilder.addStructField(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,
+ "int",
+ variableName
+ );
+ const setIndex = featureIdAttribute.setIndex;
+ const prefix = variableName.replace(/_\d+$/, "_");
+ const initializationLines = [
+ `featureIds.${variableName} = int(czm_round(attributes.${prefix}${setIndex}));`
+ ];
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,
+ initializationLines
+ );
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,
+ initializationLines
+ );
+}
+function processImplicitRange(renderResources, implicitFeatureIds, variableName, count, instanceDivisor, frameState) {
+ generateImplicitFeatureIdAttribute(
+ renderResources,
+ implicitFeatureIds,
+ count,
+ instanceDivisor,
+ frameState
+ );
+ const shaderBuilder = renderResources.shaderBuilder;
+ const implicitAttributeName = `a_implicit_${variableName}`;
+ shaderBuilder.addAttribute("float", implicitAttributeName);
+ const implicitVaryingName = `v_implicit_${variableName}`;
+ shaderBuilder.addVarying("float", implicitVaryingName);
+ shaderBuilder.addStructField(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,
+ "int",
+ variableName
+ );
+ shaderBuilder.addStructField(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,
+ "int",
+ variableName
+ );
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,
+ [`${implicitVaryingName} = ${implicitAttributeName};`]
+ );
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,
+ [`featureIds.${variableName} = int(czm_round(${implicitAttributeName}));`]
+ );
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,
+ [`featureIds.${variableName} = int(czm_round(${implicitVaryingName}));`]
+ );
+}
+function processTexture(renderResources, featureIdTexture, variableName, index, frameState) {
+ const uniformName = `u_featureIdTexture_${index}`;
+ const uniformMap2 = renderResources.uniformMap;
+ const textureReader = featureIdTexture.textureReader;
+ uniformMap2[uniformName] = function() {
+ return defaultValue_default(
+ textureReader.texture,
+ frameState.context.defaultTexture
+ );
+ };
+ const channels = textureReader.channels;
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addStructField(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,
+ "int",
+ variableName
+ );
+ shaderBuilder.addUniform(
+ "sampler2D",
+ uniformName,
+ ShaderDestination_default.FRAGMENT
+ );
+ const texCoord = `v_texCoord_${textureReader.texCoord}`;
+ const textureRead = `texture2D(${uniformName}, ${texCoord}).${channels}`;
+ const initializationLine = `featureIds.${variableName} = czm_unpackUint(${textureRead});`;
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,
+ [initializationLine]
+ );
+}
+function addAlias(renderResources, variableName, alias, shaderDestination) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const updateVS = ShaderDestination_default.includesVertexShader(shaderDestination);
+ if (updateVS) {
+ shaderBuilder.addStructField(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_VS,
+ "int",
+ alias
+ );
+ }
+ shaderBuilder.addStructField(
+ FeatureIdPipelineStage.STRUCT_ID_FEATURE_IDS_FS,
+ "int",
+ alias
+ );
+ const initializationLines = [
+ `featureIds.${alias} = featureIds.${variableName};`
+ ];
+ if (updateVS) {
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,
+ initializationLines
+ );
+ }
+ shaderBuilder.addFunctionLines(
+ FeatureIdPipelineStage.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,
+ initializationLines
+ );
+}
+function generateImplicitFeatureIdAttribute(renderResources, implicitFeatureIds, count, instanceDivisor, frameState) {
+ const model = renderResources.model;
+ let vertexBuffer;
+ let value;
+ if (defined_default(implicitFeatureIds.repeat)) {
+ const typedArray = generateImplicitFeatureIdTypedArray(
+ implicitFeatureIds,
+ count
+ );
+ vertexBuffer = Buffer_default.createVertexBuffer({
+ context: frameState.context,
+ typedArray,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ vertexBuffer.vertexArrayDestroyable = false;
+ model._pipelineResources.push(vertexBuffer);
+ const hasCpuCopy = false;
+ model.statistics.addBuffer(vertexBuffer, hasCpuCopy);
+ } else {
+ value = [implicitFeatureIds.offset];
+ }
+ const generatedFeatureIdAttribute = {
+ index: renderResources.attributeIndex++,
+ instanceDivisor,
+ value,
+ vertexBuffer,
+ normalize: false,
+ componentsPerAttribute: 1,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ strideInBytes: ComponentDatatype_default.getSizeInBytes(ComponentDatatype_default.FLOAT),
+ offsetInBytes: 0
+ };
+ renderResources.attributes.push(generatedFeatureIdAttribute);
+}
+function generateImplicitFeatureIdTypedArray(implicitFeatureIds, count) {
+ const offset2 = implicitFeatureIds.offset;
+ const repeat = implicitFeatureIds.repeat;
+ const typedArray = new Float32Array(count);
+ for (let i = 0; i < count; i++) {
+ typedArray[i] = offset2 + Math.floor(i / repeat);
+ }
+ return typedArray;
+}
+var FeatureIdPipelineStage_default = FeatureIdPipelineStage;
+
+// Source/Shaders/Model/MetadataStageFS.js
+var MetadataStageFS_default = "void metadataStage(\n out Metadata metadata,\n out MetadataClass metadataClass,\n out MetadataStatistics metadataStatistics,\n ProcessedAttributes attributes\n )\n{\n initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);\n}\n";
+
+// Source/Shaders/Model/MetadataStageVS.js
+var MetadataStageVS_default = "void metadataStage(\n out Metadata metadata,\n out MetadataClass metadataClass,\n out MetadataStatistics metadataStatistics,\n ProcessedAttributes attributes\n )\n{\n initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);\n setMetadataVaryings();\n}\n";
+
+// Source/Scene/Model/MetadataPipelineStage.js
+var MetadataPipelineStage = {
+ name: "MetadataPipelineStage",
+ STRUCT_ID_METADATA_VS: "MetadataVS",
+ STRUCT_ID_METADATA_FS: "MetadataFS",
+ STRUCT_NAME_METADATA: "Metadata",
+ STRUCT_ID_METADATA_CLASS_VS: "MetadataClassVS",
+ STRUCT_ID_METADATA_CLASS_FS: "MetadataClassFS",
+ STRUCT_NAME_METADATA_CLASS: "MetadataClass",
+ STRUCT_ID_METADATA_STATISTICS_VS: "MetadataStatisticsVS",
+ STRUCT_ID_METADATA_STATISTICS_FS: "MetadataStatisticsFS",
+ STRUCT_NAME_METADATA_STATISTICS: "MetadataStatistics",
+ FUNCTION_ID_INITIALIZE_METADATA_VS: "initializeMetadataVS",
+ FUNCTION_ID_INITIALIZE_METADATA_FS: "initializeMetadataFS",
+ FUNCTION_SIGNATURE_INITIALIZE_METADATA: "void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",
+ FUNCTION_ID_SET_METADATA_VARYINGS: "setMetadataVaryings",
+ FUNCTION_SIGNATURE_SET_METADATA_VARYINGS: "void setMetadataVaryings()",
+ METADATA_CLASS_FIELDS: [
+ { specName: "noData", shaderName: "noData" },
+ { specName: "default", shaderName: "defaultValue" },
+ { specName: "min", shaderName: "minValue" },
+ { specName: "max", shaderName: "maxValue" }
+ ],
+ METADATA_STATISTICS_FIELDS: [
+ { specName: "min", shaderName: "minValue" },
+ { specName: "max", shaderName: "maxValue" },
+ { specName: "mean", shaderName: "mean", type: "float" },
+ { specName: "median", shaderName: "median" },
+ {
+ specName: "standardDeviation",
+ shaderName: "standardDeviation",
+ type: "float"
+ },
+ { specName: "variance", shaderName: "variance", type: "float" },
+ { specName: "sum", shaderName: "sum" }
+ ]
+};
+MetadataPipelineStage.process = function(renderResources, primitive, frameState) {
+ const { shaderBuilder, model } = renderResources;
+ const { structuralMetadata = {}, content } = model;
+ const statistics2 = content?.tileset.metadataExtension?.statistics;
+ const propertyAttributesInfo = getPropertyAttributesInfo(
+ structuralMetadata.propertyAttributes,
+ primitive,
+ statistics2
+ );
+ const propertyTexturesInfo = getPropertyTexturesInfo(
+ structuralMetadata.propertyTextures,
+ statistics2
+ );
+ const allPropertyInfos = propertyAttributesInfo.concat(propertyTexturesInfo);
+ declareMetadataTypeStructs(shaderBuilder, allPropertyInfos);
+ declareStructsAndFunctions2(shaderBuilder);
+ shaderBuilder.addVertexLines(MetadataStageVS_default);
+ shaderBuilder.addFragmentLines(MetadataStageFS_default);
+ for (let i = 0; i < propertyAttributesInfo.length; i++) {
+ const info = propertyAttributesInfo[i];
+ processPropertyAttributeProperty(renderResources, info);
+ }
+ for (let i = 0; i < propertyTexturesInfo.length; i++) {
+ const info = propertyTexturesInfo[i];
+ processPropertyTextureProperty(renderResources, info);
+ }
+};
+function getPropertyAttributesInfo(propertyAttributes, primitive, statistics2) {
+ if (!defined_default(propertyAttributes)) {
+ return [];
+ }
+ return propertyAttributes.flatMap(
+ (propertyAttribute) => getPropertyAttributeInfo(propertyAttribute, primitive, statistics2)
+ );
+}
+function getPropertyAttributeInfo(propertyAttribute, primitive, statistics2) {
+ const {
+ getAttributeByName,
+ getAttributeInfo,
+ sanitizeGlslIdentifier
+ } = ModelUtility_default;
+ const classId = propertyAttribute.class.id;
+ const classStatistics = statistics2?.classes[classId];
+ const propertiesArray = Object.entries(propertyAttribute.properties);
+ const infoArray = new Array(propertiesArray.length);
+ for (let i = 0; i < propertiesArray.length; i++) {
+ const [propertyId, property] = propertiesArray[i];
+ const modelAttribute = getAttributeByName(primitive, property.attribute);
+ const { glslType, variableName } = getAttributeInfo(modelAttribute);
+ infoArray[i] = {
+ metadataVariable: sanitizeGlslIdentifier(propertyId),
+ property,
+ type: property.classProperty.type,
+ glslType,
+ variableName,
+ propertyStatistics: classStatistics?.properties[propertyId],
+ shaderDestination: ShaderDestination_default.BOTH
+ };
+ }
+ return infoArray;
+}
+function getPropertyTexturesInfo(propertyTextures, statistics2) {
+ if (!defined_default(propertyTextures)) {
+ return [];
+ }
+ return propertyTextures.flatMap(
+ (propertyTexture) => getPropertyTextureInfo(propertyTexture, statistics2)
+ );
+}
+function getPropertyTextureInfo(propertyTexture, statistics2) {
+ const { sanitizeGlslIdentifier } = ModelUtility_default;
+ const classId = propertyTexture.class.id;
+ const classStatistics = statistics2?.classes[classId];
+ const propertiesArray = Object.entries(
+ propertyTexture.properties
+ ).filter(([id, property]) => property.isGpuCompatible());
+ const infoArray = new Array(propertiesArray.length);
+ for (let i = 0; i < propertiesArray.length; i++) {
+ const [propertyId, property] = propertiesArray[i];
+ infoArray[i] = {
+ metadataVariable: sanitizeGlslIdentifier(propertyId),
+ property,
+ type: property.classProperty.type,
+ glslType: property.getGlslType(),
+ propertyStatistics: classStatistics?.properties[propertyId],
+ shaderDestination: ShaderDestination_default.FRAGMENT
+ };
+ }
+ return infoArray;
+}
+function declareMetadataTypeStructs(shaderBuilder, propertyInfos) {
+ const classTypes = /* @__PURE__ */ new Set();
+ const statisticsTypes = /* @__PURE__ */ new Set();
+ for (let i = 0; i < propertyInfos.length; i++) {
+ const { type, glslType, propertyStatistics } = propertyInfos[i];
+ classTypes.add(glslType);
+ if (!defined_default(propertyStatistics)) {
+ continue;
+ }
+ if (type !== MetadataType_default.ENUM) {
+ statisticsTypes.add(glslType);
+ }
+ }
+ const classFields = MetadataPipelineStage.METADATA_CLASS_FIELDS;
+ for (const metadataType of classTypes) {
+ const classStructName = `${metadataType}MetadataClass`;
+ declareTypeStruct(classStructName, metadataType, classFields);
+ }
+ const statisticsFields = MetadataPipelineStage.METADATA_STATISTICS_FIELDS;
+ for (const metadataType of statisticsTypes) {
+ const statisticsStructName = `${metadataType}MetadataStatistics`;
+ declareTypeStruct(statisticsStructName, metadataType, statisticsFields);
+ }
+ function declareTypeStruct(structName, type, fields) {
+ shaderBuilder.addStruct(structName, structName, ShaderDestination_default.BOTH);
+ for (let i = 0; i < fields.length; i++) {
+ const { shaderName } = fields[i];
+ const shaderType = fields[i].type === "float" ? convertToFloatComponents(type) : type;
+ shaderBuilder.addStructField(structName, shaderType, shaderName);
+ }
+ }
+}
+var floatConversions = {
+ int: "float",
+ ivec2: "vec2",
+ ivec3: "vec3",
+ ivec4: "vec4"
+};
+function convertToFloatComponents(type) {
+ const converted = floatConversions[type];
+ return defined_default(converted) ? converted : type;
+}
+function declareStructsAndFunctions2(shaderBuilder) {
+ shaderBuilder.addStruct(
+ MetadataPipelineStage.STRUCT_ID_METADATA_VS,
+ MetadataPipelineStage.STRUCT_NAME_METADATA,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addStruct(
+ MetadataPipelineStage.STRUCT_ID_METADATA_FS,
+ MetadataPipelineStage.STRUCT_NAME_METADATA,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addStruct(
+ MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_VS,
+ MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addStruct(
+ MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS,
+ MetadataPipelineStage.STRUCT_NAME_METADATA_CLASS,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addStruct(
+ MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_VS,
+ MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addStruct(
+ MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_FS,
+ MetadataPipelineStage.STRUCT_NAME_METADATA_STATISTICS,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addFunction(
+ MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,
+ MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addFunction(
+ MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,
+ MetadataPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_METADATA,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addFunction(
+ MetadataPipelineStage.FUNCTION_ID_SET_METADATA_VARYINGS,
+ MetadataPipelineStage.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,
+ ShaderDestination_default.VERTEX
+ );
+}
+function processPropertyAttributeProperty(renderResources, propertyInfo) {
+ addPropertyAttributePropertyMetadata(renderResources, propertyInfo);
+ addPropertyMetadataClass(renderResources.shaderBuilder, propertyInfo);
+ addPropertyMetadataStatistics(renderResources.shaderBuilder, propertyInfo);
+}
+function addPropertyAttributePropertyMetadata(renderResources, propertyInfo) {
+ const { shaderBuilder } = renderResources;
+ const { metadataVariable, property, glslType } = propertyInfo;
+ const valueExpression = addValueTransformUniforms({
+ valueExpression: `attributes.${propertyInfo.variableName}`,
+ renderResources,
+ glslType,
+ metadataVariable,
+ shaderDestination: ShaderDestination_default.BOTH,
+ property
+ });
+ shaderBuilder.addStructField(
+ MetadataPipelineStage.STRUCT_ID_METADATA_VS,
+ glslType,
+ metadataVariable
+ );
+ shaderBuilder.addStructField(
+ MetadataPipelineStage.STRUCT_ID_METADATA_FS,
+ glslType,
+ metadataVariable
+ );
+ const initializationLine = `metadata.${metadataVariable} = ${valueExpression};`;
+ shaderBuilder.addFunctionLines(
+ MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,
+ [initializationLine]
+ );
+ shaderBuilder.addFunctionLines(
+ MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,
+ [initializationLine]
+ );
+}
+function processPropertyTextureProperty(renderResources, propertyInfo) {
+ addPropertyTexturePropertyMetadata(renderResources, propertyInfo);
+ addPropertyMetadataClass(renderResources.shaderBuilder, propertyInfo);
+ addPropertyMetadataStatistics(renderResources.shaderBuilder, propertyInfo);
+}
+function addPropertyTexturePropertyMetadata(renderResources, propertyInfo) {
+ const { shaderBuilder, uniformMap: uniformMap2 } = renderResources;
+ const { metadataVariable, glslType, property } = propertyInfo;
+ const { texCoord, channels, index, texture } = property.textureReader;
+ const textureUniformName = `u_propertyTexture_${index}`;
+ if (!uniformMap2.hasOwnProperty(textureUniformName)) {
+ shaderBuilder.addUniform(
+ "sampler2D",
+ textureUniformName,
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2[textureUniformName] = () => texture;
+ }
+ shaderBuilder.addStructField(
+ MetadataPipelineStage.STRUCT_ID_METADATA_FS,
+ glslType,
+ metadataVariable
+ );
+ const texCoordVariable = `attributes.texCoord_${texCoord}`;
+ const valueExpression = `texture2D(${textureUniformName}, ${texCoordVariable}).${channels}`;
+ const unpackedValue = property.unpackInShader(valueExpression);
+ const transformedValue = addValueTransformUniforms({
+ valueExpression: unpackedValue,
+ renderResources,
+ glslType,
+ metadataVariable,
+ shaderDestination: ShaderDestination_default.FRAGMENT,
+ property
+ });
+ const initializationLine = `metadata.${metadataVariable} = ${transformedValue};`;
+ shaderBuilder.addFunctionLines(
+ MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,
+ [initializationLine]
+ );
+}
+function addPropertyMetadataClass(shaderBuilder, propertyInfo) {
+ const { classProperty } = propertyInfo.property;
+ const { metadataVariable, glslType, shaderDestination } = propertyInfo;
+ const assignments = getStructAssignments(
+ MetadataPipelineStage.METADATA_CLASS_FIELDS,
+ classProperty,
+ `metadataClass.${metadataVariable}`,
+ glslType
+ );
+ const metadataType = `${glslType}MetadataClass`;
+ shaderBuilder.addStructField(
+ MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_FS,
+ metadataType,
+ metadataVariable
+ );
+ shaderBuilder.addFunctionLines(
+ MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,
+ assignments
+ );
+ if (!ShaderDestination_default.includesVertexShader(shaderDestination)) {
+ return;
+ }
+ shaderBuilder.addStructField(
+ MetadataPipelineStage.STRUCT_ID_METADATA_CLASS_VS,
+ metadataType,
+ metadataVariable
+ );
+ shaderBuilder.addFunctionLines(
+ MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,
+ assignments
+ );
+}
+function addPropertyMetadataStatistics(shaderBuilder, propertyInfo) {
+ const { propertyStatistics } = propertyInfo;
+ if (!defined_default(propertyStatistics)) {
+ return;
+ }
+ const { metadataVariable, type, glslType } = propertyInfo;
+ if (type === MetadataType_default.ENUM) {
+ return;
+ }
+ const fields = MetadataPipelineStage.METADATA_STATISTICS_FIELDS;
+ const struct = `metadataStatistics.${metadataVariable}`;
+ const assignments = getStructAssignments(
+ fields,
+ propertyStatistics,
+ struct,
+ glslType
+ );
+ const statisticsType = `${glslType}MetadataStatistics`;
+ shaderBuilder.addStructField(
+ MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_FS,
+ statisticsType,
+ metadataVariable
+ );
+ shaderBuilder.addFunctionLines(
+ MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_FS,
+ assignments
+ );
+ if (!ShaderDestination_default.includesVertexShader(propertyInfo.shaderDestination)) {
+ return;
+ }
+ shaderBuilder.addStructField(
+ MetadataPipelineStage.STRUCT_ID_METADATA_STATISTICS_VS,
+ statisticsType,
+ metadataVariable
+ );
+ shaderBuilder.addFunctionLines(
+ MetadataPipelineStage.FUNCTION_ID_INITIALIZE_METADATA_VS,
+ assignments
+ );
+}
+function getStructAssignments(fieldNames, values, struct, type) {
+ return defined_default(values) ? fieldNames.map(constructAssignment).filter(defined_default) : [];
+ function constructAssignment(field) {
+ const value = values[field.specName];
+ if (defined_default(value)) {
+ return `${struct}.${field.shaderName} = ${type}(${value});`;
+ }
+ }
+}
+function addValueTransformUniforms(options) {
+ const { valueExpression, property } = options;
+ if (!property.hasValueTransform) {
+ return valueExpression;
+ }
+ const metadataVariable = options.metadataVariable;
+ const offsetUniformName = `u_${metadataVariable}_offset`;
+ const scaleUniformName = `u_${metadataVariable}_scale`;
+ const { shaderBuilder, uniformMap: uniformMap2 } = options.renderResources;
+ const { glslType, shaderDestination } = options;
+ shaderBuilder.addUniform(glslType, offsetUniformName, shaderDestination);
+ shaderBuilder.addUniform(glslType, scaleUniformName, shaderDestination);
+ const { offset: offset2, scale } = property;
+ uniformMap2[offsetUniformName] = () => offset2;
+ uniformMap2[scaleUniformName] = () => scale;
+ return `czm_valueTransform(${offsetUniformName}, ${scaleUniformName}, ${valueExpression})`;
+}
+var MetadataPipelineStage_default = MetadataPipelineStage;
+
+// Source/Scene/Model/CustomShaderTranslucencyMode.js
+var CustomShaderTranslucencyMode = {
+ INHERIT: 0,
+ OPAQUE: 1,
+ TRANSLUCENT: 2
+};
+var CustomShaderTranslucencyMode_default = Object.freeze(CustomShaderTranslucencyMode);
+
+// Source/Scene/Model/CustomShaderPipelineStage.js
+var CustomShaderPipelineStage = {
+ name: "CustomShaderPipelineStage",
+ STRUCT_ID_ATTRIBUTES_VS: "AttributesVS",
+ STRUCT_ID_ATTRIBUTES_FS: "AttributesFS",
+ STRUCT_NAME_ATTRIBUTES: "Attributes",
+ STRUCT_ID_VERTEX_INPUT: "VertexInput",
+ STRUCT_NAME_VERTEX_INPUT: "VertexInput",
+ STRUCT_ID_FRAGMENT_INPUT: "FragmentInput",
+ STRUCT_NAME_FRAGMENT_INPUT: "FragmentInput",
+ FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS: "initializeInputStructVS",
+ FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS: "void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",
+ FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS: "initializeInputStructFS",
+ FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS: "void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",
+ _oneTimeWarning: oneTimeWarning_default
+};
+CustomShaderPipelineStage.process = function(renderResources, primitive, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const customShader = renderResources.model.customShader;
+ if (defined_default(customShader.lightingModel)) {
+ renderResources.lightingOptions.lightingModel = customShader.lightingModel;
+ }
+ const alphaOptions = renderResources.alphaOptions;
+ if (customShader.translucencyMode === CustomShaderTranslucencyMode_default.TRANSLUCENT) {
+ alphaOptions.pass = Pass_default.TRANSLUCENT;
+ } else if (customShader.translucencyMode === CustomShaderTranslucencyMode_default.OPAQUE) {
+ alphaOptions.pass = void 0;
+ }
+ const generatedCode = generateShaderLines(customShader, primitive);
+ if (!generatedCode.customShaderEnabled) {
+ return;
+ }
+ addLinesToShader(shaderBuilder, customShader, generatedCode);
+ if (generatedCode.shouldComputePositionWC) {
+ shaderBuilder.addDefine(
+ "COMPUTE_POSITION_WC_CUSTOM_SHADER",
+ void 0,
+ ShaderDestination_default.BOTH
+ );
+ }
+ if (defined_default(customShader.vertexShaderText)) {
+ shaderBuilder.addDefine(
+ "HAS_CUSTOM_VERTEX_SHADER",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ }
+ if (defined_default(customShader.fragmentShaderText)) {
+ shaderBuilder.addDefine(
+ "HAS_CUSTOM_FRAGMENT_SHADER",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ const shaderModeDefine = CustomShaderMode_default.getDefineName(customShader.mode);
+ shaderBuilder.addDefine(
+ shaderModeDefine,
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ const uniforms = customShader.uniforms;
+ for (const uniformName in uniforms) {
+ if (uniforms.hasOwnProperty(uniformName)) {
+ const uniform = uniforms[uniformName];
+ shaderBuilder.addUniform(uniform.type, uniformName);
+ }
+ }
+ const varyings = customShader.varyings;
+ for (const varyingName in varyings) {
+ if (varyings.hasOwnProperty(varyingName)) {
+ const varyingType = varyings[varyingName];
+ shaderBuilder.addVarying(varyingType, varyingName);
+ }
+ }
+ renderResources.uniformMap = combine_default(
+ renderResources.uniformMap,
+ customShader.uniformMap
+ );
+};
+function getAttributesByName(attributes) {
+ const names = {};
+ for (let i = 0; i < attributes.length; i++) {
+ const attribute = attributes[i];
+ const attributeInfo = ModelUtility_default.getAttributeInfo(attribute);
+ names[attributeInfo.variableName] = attributeInfo;
+ }
+ return names;
+}
+var attributeTypeLUT = {
+ position: "vec3",
+ normal: "vec3",
+ tangent: "vec3",
+ bitangent: "vec3",
+ texCoord: "vec2",
+ color: "vec4",
+ joints: "ivec4",
+ weights: "vec4"
+};
+var attributeDefaultValueLUT = {
+ position: "vec3(0.0)",
+ normal: "vec3(0.0, 0.0, 1.0)",
+ tangent: "vec3(1.0, 0.0, 0.0)",
+ bitangent: "vec3(0.0, 1.0, 0.0)",
+ texCoord: "vec2(0.0)",
+ color: "vec4(1.0)",
+ joints: "ivec4(0)",
+ weights: "vec4(0.0)"
+};
+function inferAttributeDefaults(attributeName) {
+ let trimmed = attributeName.replace(/_[0-9]+$/, "");
+ trimmed = trimmed.replace(/(MC|EC)$/, "");
+ const glslType = attributeTypeLUT[trimmed];
+ const value = attributeDefaultValueLUT[trimmed];
+ if (!defined_default(glslType)) {
+ return void 0;
+ }
+ return {
+ attributeField: [glslType, attributeName],
+ value
+ };
+}
+function generateVertexShaderLines(customShader, attributesByName, vertexLines) {
+ const categories = partitionAttributes(
+ attributesByName,
+ customShader.usedVariablesVertex.attributeSet,
+ false
+ );
+ const addToShader = categories.addToShader;
+ const needsDefault = categories.missingAttributes;
+ let variableName;
+ let vertexInitialization;
+ const attributeFields = [];
+ const initializationLines = [];
+ for (variableName in addToShader) {
+ if (addToShader.hasOwnProperty(variableName)) {
+ const attributeInfo = addToShader[variableName];
+ const attributeField = [attributeInfo.glslType, variableName];
+ attributeFields.push(attributeField);
+ vertexInitialization = `vsInput.attributes.${variableName} = attributes.${variableName};`;
+ initializationLines.push(vertexInitialization);
+ }
+ }
+ for (let i = 0; i < needsDefault.length; i++) {
+ variableName = needsDefault[i];
+ const attributeDefaults = inferAttributeDefaults(variableName);
+ if (!defined_default(attributeDefaults)) {
+ CustomShaderPipelineStage._oneTimeWarning(
+ "CustomShaderPipelineStage.incompatiblePrimitiveVS",
+ `Primitive is missing attribute ${variableName}, disabling custom vertex shader`
+ );
+ return;
+ }
+ attributeFields.push(attributeDefaults.attributeField);
+ vertexInitialization = `vsInput.attributes.${variableName} = ${attributeDefaults.value};`;
+ initializationLines.push(vertexInitialization);
+ }
+ vertexLines.enabled = true;
+ vertexLines.attributeFields = attributeFields;
+ vertexLines.initializationLines = initializationLines;
+}
+function generatePositionBuiltins(customShader) {
+ const attributeFields = [];
+ const initializationLines = [];
+ const usedVariables = customShader.usedVariablesFragment.attributeSet;
+ if (usedVariables.hasOwnProperty("positionWC")) {
+ attributeFields.push(["vec3", "positionWC"]);
+ initializationLines.push(
+ "fsInput.attributes.positionWC = attributes.positionWC;"
+ );
+ }
+ if (usedVariables.hasOwnProperty("positionEC")) {
+ attributeFields.push(["vec3", "positionEC"]);
+ initializationLines.push(
+ "fsInput.attributes.positionEC = attributes.positionEC;"
+ );
+ }
+ return {
+ attributeFields,
+ initializationLines
+ };
+}
+function generateFragmentShaderLines(customShader, attributesByName, fragmentLines) {
+ const categories = partitionAttributes(
+ attributesByName,
+ customShader.usedVariablesFragment.attributeSet,
+ true
+ );
+ const addToShader = categories.addToShader;
+ const needsDefault = categories.missingAttributes;
+ let variableName;
+ let fragmentInitialization;
+ const attributeFields = [];
+ const initializationLines = [];
+ for (variableName in addToShader) {
+ if (addToShader.hasOwnProperty(variableName)) {
+ const attributeInfo = addToShader[variableName];
+ const attributeField = [attributeInfo.glslType, variableName];
+ attributeFields.push(attributeField);
+ fragmentInitialization = `fsInput.attributes.${variableName} = attributes.${variableName};`;
+ initializationLines.push(fragmentInitialization);
+ }
+ }
+ for (let i = 0; i < needsDefault.length; i++) {
+ variableName = needsDefault[i];
+ const attributeDefaults = inferAttributeDefaults(variableName);
+ if (!defined_default(attributeDefaults)) {
+ CustomShaderPipelineStage._oneTimeWarning(
+ "CustomShaderPipelineStage.incompatiblePrimitiveFS",
+ `Primitive is missing attribute ${variableName}, disabling custom fragment shader.`
+ );
+ return;
+ }
+ attributeFields.push(attributeDefaults.attributeField);
+ fragmentInitialization = `fsInput.attributes.${variableName} = ${attributeDefaults.value};`;
+ initializationLines.push(fragmentInitialization);
+ }
+ const positionBuiltins = generatePositionBuiltins(customShader);
+ fragmentLines.enabled = true;
+ fragmentLines.attributeFields = attributeFields.concat(
+ positionBuiltins.attributeFields
+ );
+ fragmentLines.initializationLines = positionBuiltins.initializationLines.concat(
+ initializationLines
+ );
+}
+var builtinAttributes = {
+ positionWC: true,
+ positionEC: true
+};
+function partitionAttributes(primitiveAttributes, shaderAttributeSet, isFragmentShader) {
+ let renamed;
+ let attributeName;
+ const addToShader = {};
+ for (attributeName in primitiveAttributes) {
+ if (primitiveAttributes.hasOwnProperty(attributeName)) {
+ const attribute = primitiveAttributes[attributeName];
+ renamed = attributeName;
+ if (isFragmentShader && attributeName === "normalMC") {
+ renamed = "normalEC";
+ } else if (isFragmentShader && attributeName === "tangentMC") {
+ renamed = "tangentEC";
+ }
+ if (shaderAttributeSet.hasOwnProperty(renamed)) {
+ addToShader[renamed] = attribute;
+ }
+ }
+ }
+ const missingAttributes = [];
+ for (attributeName in shaderAttributeSet) {
+ if (shaderAttributeSet.hasOwnProperty(attributeName)) {
+ if (builtinAttributes.hasOwnProperty(attributeName)) {
+ continue;
+ }
+ renamed = attributeName;
+ if (isFragmentShader && attributeName === "normalEC") {
+ renamed = "normalMC";
+ } else if (isFragmentShader && attributeName === "tangentEC") {
+ renamed = "tangentMC";
+ }
+ if (!primitiveAttributes.hasOwnProperty(renamed)) {
+ missingAttributes.push(attributeName);
+ }
+ }
+ }
+ return {
+ addToShader,
+ missingAttributes
+ };
+}
+function generateShaderLines(customShader, primitive) {
+ const vertexLines = {
+ enabled: false
+ };
+ const fragmentLines = {
+ enabled: false
+ };
+ const attributesByName = getAttributesByName(primitive.attributes);
+ if (defined_default(customShader.vertexShaderText)) {
+ generateVertexShaderLines(customShader, attributesByName, vertexLines);
+ }
+ if (defined_default(customShader.fragmentShaderText)) {
+ generateFragmentShaderLines(customShader, attributesByName, fragmentLines);
+ }
+ const attributeSetFS = customShader.usedVariablesFragment.attributeSet;
+ const shouldComputePositionWC = attributeSetFS.hasOwnProperty("positionWC") && fragmentLines.enabled;
+ return {
+ vertexLines,
+ fragmentLines,
+ vertexLinesEnabled: vertexLines.enabled,
+ fragmentLinesEnabled: fragmentLines.enabled,
+ customShaderEnabled: vertexLines.enabled || fragmentLines.enabled,
+ shouldComputePositionWC
+ };
+}
+function addVertexLinesToShader(shaderBuilder, vertexLines) {
+ let i;
+ let structId = CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_VS;
+ shaderBuilder.addStruct(
+ structId,
+ CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,
+ ShaderDestination_default.VERTEX
+ );
+ const attributeFields = vertexLines.attributeFields;
+ for (i = 0; i < attributeFields.length; i++) {
+ const field = attributeFields[i];
+ const glslType = field[0];
+ const variableName = field[1];
+ shaderBuilder.addStructField(structId, glslType, variableName);
+ }
+ structId = CustomShaderPipelineStage.STRUCT_ID_VERTEX_INPUT;
+ shaderBuilder.addStruct(
+ structId,
+ CustomShaderPipelineStage.STRUCT_NAME_VERTEX_INPUT,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addStructField(
+ structId,
+ CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,
+ "attributes"
+ );
+ shaderBuilder.addStructField(
+ structId,
+ FeatureIdPipelineStage_default.STRUCT_NAME_FEATURE_IDS,
+ "featureIds"
+ );
+ shaderBuilder.addStructField(
+ structId,
+ MetadataPipelineStage_default.STRUCT_NAME_METADATA,
+ "metadata"
+ );
+ shaderBuilder.addStructField(
+ structId,
+ MetadataPipelineStage_default.STRUCT_NAME_METADATA_CLASS,
+ "metadataClass"
+ );
+ shaderBuilder.addStructField(
+ structId,
+ MetadataPipelineStage_default.STRUCT_NAME_METADATA_STATISTICS,
+ "metadataStatistics"
+ );
+ const functionId = CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;
+ shaderBuilder.addFunction(
+ functionId,
+ CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,
+ ShaderDestination_default.VERTEX
+ );
+ const initializationLines = vertexLines.initializationLines;
+ shaderBuilder.addFunctionLines(functionId, initializationLines);
+}
+function addFragmentLinesToShader(shaderBuilder, fragmentLines) {
+ let i;
+ let structId = CustomShaderPipelineStage.STRUCT_ID_ATTRIBUTES_FS;
+ shaderBuilder.addStruct(
+ structId,
+ CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,
+ ShaderDestination_default.FRAGMENT
+ );
+ let field;
+ let glslType;
+ let variableName;
+ const attributeFields = fragmentLines.attributeFields;
+ for (i = 0; i < attributeFields.length; i++) {
+ field = attributeFields[i];
+ glslType = field[0];
+ variableName = field[1];
+ shaderBuilder.addStructField(structId, glslType, variableName);
+ }
+ structId = CustomShaderPipelineStage.STRUCT_ID_FRAGMENT_INPUT;
+ shaderBuilder.addStruct(
+ structId,
+ CustomShaderPipelineStage.STRUCT_NAME_FRAGMENT_INPUT,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addStructField(
+ structId,
+ CustomShaderPipelineStage.STRUCT_NAME_ATTRIBUTES,
+ "attributes"
+ );
+ shaderBuilder.addStructField(
+ structId,
+ FeatureIdPipelineStage_default.STRUCT_NAME_FEATURE_IDS,
+ "featureIds"
+ );
+ shaderBuilder.addStructField(
+ structId,
+ MetadataPipelineStage_default.STRUCT_NAME_METADATA,
+ "metadata"
+ );
+ shaderBuilder.addStructField(
+ structId,
+ MetadataPipelineStage_default.STRUCT_NAME_METADATA_CLASS,
+ "metadataClass"
+ );
+ shaderBuilder.addStructField(
+ structId,
+ MetadataPipelineStage_default.STRUCT_NAME_METADATA_STATISTICS,
+ "metadataStatistics"
+ );
+ const functionId = CustomShaderPipelineStage.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;
+ shaderBuilder.addFunction(
+ functionId,
+ CustomShaderPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,
+ ShaderDestination_default.FRAGMENT
+ );
+ const initializationLines = fragmentLines.initializationLines;
+ shaderBuilder.addFunctionLines(functionId, initializationLines);
+}
+var scratchShaderLines = [];
+function addLinesToShader(shaderBuilder, customShader, generatedCode) {
+ const vertexLines = generatedCode.vertexLines;
+ const shaderLines = scratchShaderLines;
+ if (vertexLines.enabled) {
+ addVertexLinesToShader(shaderBuilder, vertexLines);
+ shaderLines.length = 0;
+ shaderLines.push(
+ "#line 0",
+ customShader.vertexShaderText,
+ CustomShaderStageVS_default
+ );
+ shaderBuilder.addVertexLines(shaderLines);
+ }
+ const fragmentLines = generatedCode.fragmentLines;
+ if (fragmentLines.enabled) {
+ addFragmentLinesToShader(shaderBuilder, fragmentLines);
+ shaderLines.length = 0;
+ shaderLines.push(
+ "#line 0",
+ customShader.fragmentShaderText,
+ CustomShaderStageFS_default
+ );
+ shaderBuilder.addFragmentLines(shaderLines);
+ }
+}
+var CustomShaderPipelineStage_default = CustomShaderPipelineStage;
+
+// Source/Scene/Model/DequantizationPipelineStage.js
+var DequantizationPipelineStage = {
+ name: "DequantizationPipelineStage",
+ FUNCTION_ID_DEQUANTIZATION_STAGE_VS: "dequantizationStage",
+ FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS: "void dequantizationStage(inout ProcessedAttributes attributes)"
+};
+DequantizationPipelineStage.process = function(renderResources, primitive, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const model = renderResources.model;
+ const hasClassification = defined_default(model.classificationType);
+ shaderBuilder.addDefine(
+ "USE_DEQUANTIZATION",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addFunction(
+ DequantizationPipelineStage.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,
+ DequantizationPipelineStage.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,
+ ShaderDestination_default.VERTEX
+ );
+ const attributes = primitive.attributes;
+ for (let i = 0; i < attributes.length; i++) {
+ const attribute = attributes[i];
+ const quantization = attribute.quantization;
+ if (!defined_default(quantization)) {
+ continue;
+ }
+ const isPositionAttribute = attribute.semantic === VertexAttributeSemantic_default.POSITION;
+ const isTexcoordAttribute = attribute.semantic === VertexAttributeSemantic_default.TEXCOORD;
+ if (hasClassification && !isPositionAttribute && !isTexcoordAttribute) {
+ continue;
+ }
+ const attributeInfo = ModelUtility_default.getAttributeInfo(attribute);
+ updateDequantizationFunction(shaderBuilder, attributeInfo);
+ addDequantizationUniforms(renderResources, attributeInfo);
+ }
+};
+function addDequantizationUniforms(renderResources, attributeInfo) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const uniformMap2 = renderResources.uniformMap;
+ const variableName = attributeInfo.variableName;
+ const quantization = attributeInfo.attribute.quantization;
+ if (quantization.octEncoded) {
+ const normalizationRange = `model_normalizationRange_${variableName}`;
+ shaderBuilder.addUniform(
+ "float",
+ normalizationRange,
+ ShaderDestination_default.VERTEX
+ );
+ uniformMap2[normalizationRange] = function() {
+ return quantization.normalizationRange;
+ };
+ } else {
+ const offset2 = `model_quantizedVolumeOffset_${variableName}`;
+ const stepSize = `model_quantizedVolumeStepSize_${variableName}`;
+ const glslType = attributeInfo.glslType;
+ shaderBuilder.addUniform(glslType, offset2, ShaderDestination_default.VERTEX);
+ shaderBuilder.addUniform(glslType, stepSize, ShaderDestination_default.VERTEX);
+ let quantizedVolumeOffset = quantization.quantizedVolumeOffset;
+ let quantizedVolumeStepSize = quantization.quantizedVolumeStepSize;
+ if (/^color_\d+$/.test(variableName)) {
+ quantizedVolumeOffset = promoteToVec4(quantizedVolumeOffset, 0);
+ quantizedVolumeStepSize = promoteToVec4(quantizedVolumeStepSize, 1);
+ }
+ uniformMap2[offset2] = function() {
+ return quantizedVolumeOffset;
+ };
+ uniformMap2[stepSize] = function() {
+ return quantizedVolumeStepSize;
+ };
+ }
+}
+function promoteToVec4(value, defaultAlpha) {
+ if (value instanceof Cartesian4_default) {
+ return value;
+ }
+ return new Cartesian4_default(value.x, value.y, value.z, defaultAlpha);
+}
+function updateDequantizationFunction(shaderBuilder, attributeInfo) {
+ const variableName = attributeInfo.variableName;
+ const quantization = attributeInfo.attribute.quantization;
+ let line;
+ if (quantization.octEncoded) {
+ line = generateOctDecodeLine(variableName, quantization);
+ } else {
+ line = generateDequantizeLine(variableName);
+ }
+ shaderBuilder.addFunctionLines(
+ DequantizationPipelineStage.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,
+ [line]
+ );
+}
+function generateOctDecodeLine(variableName, quantization) {
+ const structField = `attributes.${variableName}`;
+ const quantizedAttribute = `a_quantized_${variableName}`;
+ const normalizationRange = `model_normalizationRange_${variableName}`;
+ const swizzle = quantization.octEncodedZXY ? ".zxy" : ".xyz";
+ return `${structField} = czm_octDecode(${quantizedAttribute}, ${normalizationRange})${swizzle};`;
+}
+function generateDequantizeLine(variableName) {
+ const structField = `attributes.${variableName}`;
+ const quantizedAttribute = `a_quantized_${variableName}`;
+ const offset2 = `model_quantizedVolumeOffset_${variableName}`;
+ const stepSize = `model_quantizedVolumeStepSize_${variableName}`;
+ return `${structField} = ${offset2} + ${quantizedAttribute} * ${stepSize};`;
+}
+var DequantizationPipelineStage_default = DequantizationPipelineStage;
+
+// Source/Shaders/Model/GeometryStageFS.js
+var GeometryStageFS_default = "void geometryStage(out ProcessedAttributes attributes)\n{\n attributes.positionMC = v_positionMC;\n attributes.positionEC = v_positionEC;\n\n #ifdef COMPUTE_POSITION_WC_CUSTOM_SHADER\n attributes.positionWC = v_positionWC;\n #endif\n\n #ifdef HAS_NORMALS\n // renormalize after interpolation\n attributes.normalEC = normalize(v_normalEC);\n #endif\n\n #ifdef HAS_TANGENTS\n attributes.tangentEC = normalize(v_tangentEC);\n #endif\n\n #ifdef HAS_BITANGENTS\n attributes.bitangentEC = normalize(v_bitangentEC);\n #endif\n\n // Everything else is dynamically generated in GeometryPipelineStage\n setDynamicVaryings(attributes);\n}\n";
+
+// Source/Shaders/Model/GeometryStageVS.js
+var GeometryStageVS_default = "vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) \n{\n vec4 computedPosition;\n\n // Compute positions in different coordinate systems\n vec3 positionMC = attributes.positionMC;\n v_positionMC = positionMC;\n v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;\n\n #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)\n vec3 position2D = attributes.position2D;\n vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;\n computedPosition = czm_projection * vec4(positionEC, 1.0);\n #else\n computedPosition = czm_projection * vec4(v_positionEC, 1.0);\n #endif\n\n // Sometimes the custom shader and/or style needs this\n #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE)\n // Note that this is a 32-bit position which may result in jitter on small\n // scales.\n v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;\n #endif\n\n #ifdef HAS_NORMALS\n v_normalEC = normalize(normal * attributes.normalMC);\n #endif\n\n #ifdef HAS_TANGENTS\n v_tangentEC = normalize(normal * attributes.tangentMC); \n #endif\n\n #ifdef HAS_BITANGENTS\n v_bitangentEC = normalize(normal * attributes.bitangentMC);\n #endif\n\n // All other varyings need to be dynamically generated in\n // GeometryPipelineStage\n setDynamicVaryings(attributes);\n \n return computedPosition;\n}\n";
+
+// Source/Shaders/Model/SelectedFeatureIdStageCommon.js
+var SelectedFeatureIdStageCommon_default = "vec2 computeSt(float featureId)\n{\n float stepX = model_textureStep.x;\n float centerX = model_textureStep.y;\n\n #ifdef MULTILINE_BATCH_TEXTURE\n float stepY = model_textureStep.z;\n float centerY = model_textureStep.w;\n\n float xId = mod(featureId, model_textureDimensions.x); \n float yId = floor(featureId / model_textureDimensions.x);\n \n return vec2(centerX + (xId * stepX), centerY + (yId * stepY));\n #else\n return vec2(centerX + (featureId * stepX), 0.5);\n #endif\n}\n\nvoid selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)\n{ \n int featureId = featureIds.SELECTED_FEATURE_ID;\n\n\n if (featureId < model_featuresLength)\n {\n vec2 featureSt = computeSt(float(featureId));\n\n feature.id = featureId;\n feature.st = featureSt;\n feature.color = texture2D(model_batchTexture, featureSt);\n }\n // Floating point comparisons can be unreliable in GLSL, so we\n // increment the feature ID to make sure it's always greater\n // then the model_featuresLength - a condition we check for in the\n // pick ID, to avoid sampling the pick texture if the feature ID is\n // greater than the number of features.\n else\n {\n feature.id = model_featuresLength + 1;\n feature.st = vec2(0.0);\n feature.color = vec4(1.0);\n }\n\n #ifdef HAS_NULL_FEATURE_ID\n if (featureId == model_nullFeatureId) {\n feature.id = featureId;\n feature.st = vec2(0.0);\n feature.color = vec4(1.0);\n }\n #endif\n}\n";
+
+// Source/Scene/Model/SelectedFeatureIdPipelineStage.js
+var SelectedFeatureIdPipelineStage = {
+ name: "SelectedFeatureIdPipelineStage",
+ STRUCT_ID_SELECTED_FEATURE: "SelectedFeature",
+ STRUCT_NAME_SELECTED_FEATURE: "SelectedFeature",
+ FUNCTION_ID_FEATURE_VARYINGS_VS: "updateFeatureStructVS",
+ FUNCTION_ID_FEATURE_VARYINGS_FS: "updateFeatureStructFS",
+ FUNCTION_SIGNATURE_UPDATE_FEATURE: "void updateFeatureStruct(inout SelectedFeature feature)"
+};
+SelectedFeatureIdPipelineStage.process = function(renderResources, primitive, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ renderResources.hasPropertyTable = true;
+ const model = renderResources.model;
+ const node = renderResources.runtimeNode.node;
+ const selectedFeatureIds = getSelectedFeatureIds(model, node, primitive);
+ const shaderDestination = selectedFeatureIds.shaderDestination;
+ shaderBuilder.addDefine(
+ "HAS_SELECTED_FEATURE_ID",
+ void 0,
+ shaderDestination
+ );
+ shaderBuilder.addDefine(
+ "SELECTED_FEATURE_ID",
+ selectedFeatureIds.variableName,
+ shaderDestination
+ );
+ shaderBuilder.addDefine(
+ selectedFeatureIds.featureIdDefine,
+ void 0,
+ shaderDestination
+ );
+ updateFeatureStruct(shaderBuilder);
+ const nullFeatureId = selectedFeatureIds.featureIds.nullFeatureId;
+ const uniformMap2 = renderResources.uniformMap;
+ if (defined_default(nullFeatureId)) {
+ shaderBuilder.addDefine(
+ "HAS_NULL_FEATURE_ID",
+ void 0,
+ shaderDestination
+ );
+ shaderBuilder.addUniform("int", "model_nullFeatureId", shaderDestination);
+ uniformMap2.model_nullFeatureId = function() {
+ return nullFeatureId;
+ };
+ }
+ if (selectedFeatureIds.shaderDestination === ShaderDestination_default.BOTH) {
+ shaderBuilder.addVertexLines(SelectedFeatureIdStageCommon_default);
+ }
+ shaderBuilder.addFragmentLines(SelectedFeatureIdStageCommon_default);
+};
+function getFeatureIdDefine(featureIds) {
+ if (featureIds instanceof ModelComponents_default.FeatureIdTexture) {
+ return "HAS_SELECTED_FEATURE_ID_TEXTURE";
+ }
+ return "HAS_SELECTED_FEATURE_ID_ATTRIBUTE";
+}
+function getShaderDestination(featureIds) {
+ if (featureIds instanceof ModelComponents_default.FeatureIdTexture) {
+ return ShaderDestination_default.FRAGMENT;
+ }
+ return ShaderDestination_default.BOTH;
+}
+function getSelectedFeatureIds(model, node, primitive) {
+ let variableName;
+ let featureIds;
+ if (defined_default(node.instances)) {
+ featureIds = ModelUtility_default.getFeatureIdsByLabel(
+ node.instances.featureIds,
+ model.instanceFeatureIdLabel
+ );
+ if (defined_default(featureIds)) {
+ variableName = defaultValue_default(featureIds.label, featureIds.positionalLabel);
+ return {
+ featureIds,
+ variableName,
+ shaderDestination: getShaderDestination(featureIds),
+ featureIdDefine: getFeatureIdDefine(featureIds)
+ };
+ }
+ }
+ featureIds = ModelUtility_default.getFeatureIdsByLabel(
+ primitive.featureIds,
+ model.featureIdLabel
+ );
+ variableName = defaultValue_default(featureIds.label, featureIds.positionalLabel);
+ return {
+ featureIds,
+ variableName,
+ shaderDestination: getShaderDestination(featureIds),
+ featureIdDefine: getFeatureIdDefine(featureIds)
+ };
+}
+function updateFeatureStruct(shaderBuilder) {
+ shaderBuilder.addStructField(
+ SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,
+ "int",
+ "id"
+ );
+ shaderBuilder.addStructField(
+ SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,
+ "vec2",
+ "st"
+ );
+ shaderBuilder.addStructField(
+ SelectedFeatureIdPipelineStage.STRUCT_ID_SELECTED_FEATURE,
+ "vec4",
+ "color"
+ );
+}
+var SelectedFeatureIdPipelineStage_default = SelectedFeatureIdPipelineStage;
+
+// Source/Scene/Model/GeometryPipelineStage.js
+var GeometryPipelineStage = {
+ name: "GeometryPipelineStage",
+ STRUCT_ID_PROCESSED_ATTRIBUTES_VS: "ProcessedAttributesVS",
+ STRUCT_ID_PROCESSED_ATTRIBUTES_FS: "ProcessedAttributesFS",
+ STRUCT_NAME_PROCESSED_ATTRIBUTES: "ProcessedAttributes",
+ FUNCTION_ID_INITIALIZE_ATTRIBUTES: "initializeAttributes",
+ FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES: "void initializeAttributes(out ProcessedAttributes attributes)",
+ FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS: "setDynamicVaryingsVS",
+ FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS: "setDynamicVaryingsFS",
+ FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS: "void setDynamicVaryings(inout ProcessedAttributes attributes)"
+};
+GeometryPipelineStage.process = function(renderResources, primitive, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const model = renderResources.model;
+ shaderBuilder.addStruct(
+ GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,
+ "ProcessedAttributes",
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addStruct(
+ GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,
+ "ProcessedAttributes",
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addStruct(
+ SelectedFeatureIdPipelineStage_default.STRUCT_ID_SELECTED_FEATURE,
+ SelectedFeatureIdPipelineStage_default.STRUCT_NAME_SELECTED_FEATURE,
+ ShaderDestination_default.BOTH
+ );
+ shaderBuilder.addFunction(
+ GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES,
+ GeometryPipelineStage.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addVarying("vec3", "v_positionWC");
+ shaderBuilder.addVarying("vec3", "v_positionEC");
+ shaderBuilder.addStructField(
+ GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,
+ "vec3",
+ "positionWC"
+ );
+ shaderBuilder.addStructField(
+ GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,
+ "vec3",
+ "positionEC"
+ );
+ shaderBuilder.addFunction(
+ GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,
+ GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addFunction(
+ GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,
+ GeometryPipelineStage.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,
+ ShaderDestination_default.FRAGMENT
+ );
+ const modelType = model.type;
+ if (modelType === ModelType_default.TILE_PNTS) {
+ shaderBuilder.addDefine(
+ "HAS_SRGB_COLOR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ const use2D = frameState.mode !== SceneMode_default.SCENE3D && !frameState.scene3DOnly && model._projectTo2D;
+ const instanced = defined_default(renderResources.runtimeNode.node.instances);
+ const incrementIndexFor2D = use2D && !instanced;
+ const length3 = primitive.attributes.length;
+ for (let i = 0; i < length3; i++) {
+ const attribute = primitive.attributes[i];
+ const attributeLocationCount = AttributeType_default.getAttributeLocationCount(
+ attribute.type
+ );
+ if (!defined_default(attribute.buffer) && !defined_default(attribute.constant)) {
+ throw new DeveloperError_default(
+ "Attributes must be provided as a Buffer or constant value"
+ );
+ }
+ const isPositionAttribute = attribute.semantic === VertexAttributeSemantic_default.POSITION;
+ let index;
+ if (attributeLocationCount > 1) {
+ index = renderResources.attributeIndex;
+ renderResources.attributeIndex += attributeLocationCount;
+ } else if (isPositionAttribute && !incrementIndexFor2D) {
+ index = 0;
+ } else {
+ index = renderResources.attributeIndex++;
+ }
+ processAttribute2(
+ renderResources,
+ attribute,
+ index,
+ attributeLocationCount,
+ use2D,
+ instanced
+ );
+ }
+ handleBitangents(shaderBuilder, primitive.attributes);
+ if (primitive.primitiveType === PrimitiveType_default.POINTS) {
+ shaderBuilder.addDefine("PRIMITIVE_TYPE_POINTS");
+ }
+ shaderBuilder.addVertexLines(GeometryStageVS_default);
+ shaderBuilder.addFragmentLines(GeometryStageFS_default);
+};
+function processAttribute2(renderResources, attribute, attributeIndex, attributeLocationCount, use2D, instanced) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const attributeInfo = ModelUtility_default.getAttributeInfo(attribute);
+ const modifyFor2D = use2D && !instanced;
+ if (attributeLocationCount > 1) {
+ addMatrixAttributeToRenderResources(
+ renderResources,
+ attribute,
+ attributeIndex,
+ attributeLocationCount
+ );
+ } else {
+ addAttributeToRenderResources(
+ renderResources,
+ attribute,
+ attributeIndex,
+ modifyFor2D
+ );
+ }
+ addAttributeDeclaration(shaderBuilder, attributeInfo, modifyFor2D);
+ addVaryingDeclaration(shaderBuilder, attributeInfo);
+ if (defined_default(attribute.semantic)) {
+ addSemanticDefine(shaderBuilder, attribute);
+ }
+ updateAttributesStruct(shaderBuilder, attributeInfo, use2D);
+ updateInitializeAttributesFunction(shaderBuilder, attributeInfo, modifyFor2D);
+ updateSetDynamicVaryingsFunction(shaderBuilder, attributeInfo);
+}
+function addSemanticDefine(shaderBuilder, attribute) {
+ const semantic = attribute.semantic;
+ const setIndex = attribute.setIndex;
+ switch (semantic) {
+ case VertexAttributeSemantic_default.NORMAL:
+ shaderBuilder.addDefine("HAS_NORMALS");
+ break;
+ case VertexAttributeSemantic_default.TANGENT:
+ shaderBuilder.addDefine("HAS_TANGENTS");
+ break;
+ case VertexAttributeSemantic_default.FEATURE_ID:
+ shaderBuilder.addDefine(`HAS${semantic}_${setIndex}`);
+ break;
+ case VertexAttributeSemantic_default.TEXCOORD:
+ case VertexAttributeSemantic_default.COLOR:
+ shaderBuilder.addDefine(`HAS_${semantic}_${setIndex}`);
+ }
+}
+function addAttributeToRenderResources(renderResources, attribute, attributeIndex, modifyFor2D) {
+ const quantization = attribute.quantization;
+ let type;
+ let componentDatatype;
+ if (defined_default(quantization)) {
+ type = quantization.type;
+ componentDatatype = quantization.componentDatatype;
+ } else {
+ type = attribute.type;
+ componentDatatype = attribute.componentDatatype;
+ }
+ const semantic = attribute.semantic;
+ const setIndex = attribute.setIndex;
+ if (semantic === VertexAttributeSemantic_default.FEATURE_ID && setIndex >= renderResources.featureIdVertexAttributeSetIndex) {
+ renderResources.featureIdVertexAttributeSetIndex = setIndex + 1;
+ }
+ const isPositionAttribute = semantic === VertexAttributeSemantic_default.POSITION;
+ const index = isPositionAttribute ? 0 : attributeIndex;
+ const componentsPerAttribute = AttributeType_default.getNumberOfComponents(type);
+ const vertexAttribute = {
+ index,
+ value: defined_default(attribute.buffer) ? void 0 : attribute.constant,
+ vertexBuffer: attribute.buffer,
+ count: attribute.count,
+ componentsPerAttribute,
+ componentDatatype,
+ offsetInBytes: attribute.byteOffset,
+ strideInBytes: attribute.byteStride,
+ normalize: attribute.normalized
+ };
+ renderResources.attributes.push(vertexAttribute);
+ if (!isPositionAttribute || !modifyFor2D) {
+ return;
+ }
+ const buffer2D = renderResources.runtimePrimitive.positionBuffer2D;
+ const positionAttribute2D = {
+ index: attributeIndex,
+ vertexBuffer: buffer2D,
+ count: attribute.count,
+ componentsPerAttribute,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: 0,
+ strideInBytes: void 0,
+ normalize: attribute.normalized
+ };
+ renderResources.attributes.push(positionAttribute2D);
+}
+function addMatrixAttributeToRenderResources(renderResources, attribute, attributeIndex, columnCount) {
+ const quantization = attribute.quantization;
+ let type;
+ let componentDatatype;
+ if (defined_default(quantization)) {
+ type = quantization.type;
+ componentDatatype = quantization.componentDatatype;
+ } else {
+ type = attribute.type;
+ componentDatatype = attribute.componentDatatype;
+ }
+ const normalized = attribute.normalized;
+ const componentCount = AttributeType_default.getNumberOfComponents(type);
+ const componentsPerColumn = componentCount / columnCount;
+ const componentSizeInBytes = ComponentDatatype_default.getSizeInBytes(
+ componentDatatype
+ );
+ const columnLengthInBytes = componentsPerColumn * componentSizeInBytes;
+ const strideInBytes = attribute.byteStride;
+ for (let i = 0; i < columnCount; i++) {
+ const offsetInBytes = attribute.byteOffset + i * columnLengthInBytes;
+ const columnAttribute = {
+ index: attributeIndex + i,
+ vertexBuffer: attribute.buffer,
+ componentsPerAttribute: componentsPerColumn,
+ componentDatatype,
+ offsetInBytes,
+ strideInBytes,
+ normalize: normalized
+ };
+ renderResources.attributes.push(columnAttribute);
+ }
+}
+function addVaryingDeclaration(shaderBuilder, attributeInfo) {
+ const variableName = attributeInfo.variableName;
+ let varyingName = `v_${variableName}`;
+ let glslType;
+ if (variableName === "normalMC") {
+ varyingName = "v_normalEC";
+ glslType = attributeInfo.glslType;
+ } else if (variableName === "tangentMC") {
+ glslType = "vec3";
+ varyingName = "v_tangentEC";
+ } else {
+ glslType = attributeInfo.glslType;
+ }
+ shaderBuilder.addVarying(glslType, varyingName);
+}
+function addAttributeDeclaration(shaderBuilder, attributeInfo, modifyFor2D) {
+ const semantic = attributeInfo.attribute.semantic;
+ const variableName = attributeInfo.variableName;
+ let attributeName;
+ let glslType;
+ if (attributeInfo.isQuantized) {
+ attributeName = `a_quantized_${variableName}`;
+ glslType = attributeInfo.quantizedGlslType;
+ } else {
+ attributeName = `a_${variableName}`;
+ glslType = attributeInfo.glslType;
+ }
+ const isPosition = semantic === VertexAttributeSemantic_default.POSITION;
+ if (isPosition) {
+ shaderBuilder.setPositionAttribute(glslType, attributeName);
+ } else {
+ shaderBuilder.addAttribute(glslType, attributeName);
+ }
+ if (isPosition && modifyFor2D) {
+ shaderBuilder.addAttribute("vec3", "a_position2D");
+ }
+}
+function updateAttributesStruct(shaderBuilder, attributeInfo, use2D) {
+ const vsStructId = GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS;
+ const fsStructId = GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS;
+ const variableName = attributeInfo.variableName;
+ if (variableName === "tangentMC") {
+ shaderBuilder.addStructField(vsStructId, "vec3", "tangentMC");
+ shaderBuilder.addStructField(vsStructId, "float", "tangentSignMC");
+ shaderBuilder.addStructField(fsStructId, "vec3", "tangentEC");
+ } else if (variableName === "normalMC") {
+ shaderBuilder.addStructField(vsStructId, "vec3", "normalMC");
+ shaderBuilder.addStructField(fsStructId, "vec3", "normalEC");
+ } else {
+ shaderBuilder.addStructField(
+ vsStructId,
+ attributeInfo.glslType,
+ variableName
+ );
+ shaderBuilder.addStructField(
+ fsStructId,
+ attributeInfo.glslType,
+ variableName
+ );
+ }
+ if (variableName === "positionMC" && use2D) {
+ shaderBuilder.addStructField(vsStructId, "vec3", "position2D");
+ }
+}
+function updateInitializeAttributesFunction(shaderBuilder, attributeInfo, use2D) {
+ const functionId = GeometryPipelineStage.FUNCTION_ID_INITIALIZE_ATTRIBUTES;
+ const variableName = attributeInfo.variableName;
+ const use2DPosition = variableName === "positionMC" && use2D;
+ if (use2DPosition) {
+ const line = "attributes.position2D = a_position2D;";
+ shaderBuilder.addFunctionLines(functionId, [line]);
+ }
+ if (attributeInfo.isQuantized) {
+ return;
+ }
+ const lines = [];
+ if (variableName === "tangentMC") {
+ lines.push("attributes.tangentMC = a_tangentMC.xyz;");
+ lines.push("attributes.tangentSignMC = a_tangentMC.w;");
+ } else {
+ lines.push(`attributes.${variableName} = a_${variableName};`);
+ }
+ shaderBuilder.addFunctionLines(functionId, lines);
+}
+function updateSetDynamicVaryingsFunction(shaderBuilder, attributeInfo) {
+ const semantic = attributeInfo.attribute.semantic;
+ const setIndex = attributeInfo.attribute.setIndex;
+ if (defined_default(semantic) && !defined_default(setIndex)) {
+ return;
+ }
+ let functionId = GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS;
+ const variableName = attributeInfo.variableName;
+ let line = `v_${variableName} = attributes.${variableName};`;
+ shaderBuilder.addFunctionLines(functionId, [line]);
+ functionId = GeometryPipelineStage.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS;
+ line = `attributes.${variableName} = v_${variableName};`;
+ shaderBuilder.addFunctionLines(functionId, [line]);
+}
+function handleBitangents(shaderBuilder, attributes) {
+ let hasNormals = false;
+ let hasTangents = false;
+ for (let i = 0; i < attributes.length; i++) {
+ const attribute = attributes[i];
+ if (attribute.semantic === VertexAttributeSemantic_default.NORMAL) {
+ hasNormals = true;
+ } else if (attribute.semantic === VertexAttributeSemantic_default.TANGENT) {
+ hasTangents = true;
+ }
+ }
+ if (!hasNormals || !hasTangents) {
+ return;
+ }
+ shaderBuilder.addDefine("HAS_BITANGENTS");
+ shaderBuilder.addVarying("vec3", "v_bitangentEC");
+ shaderBuilder.addStructField(
+ GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,
+ "vec3",
+ "bitangentMC"
+ );
+ shaderBuilder.addStructField(
+ GeometryPipelineStage.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,
+ "vec3",
+ "bitangentEC"
+ );
+}
+var GeometryPipelineStage_default = GeometryPipelineStage;
+
+// Source/Shaders/Model/LightingStageFS.js
+var LightingStageFS_default = "#ifdef LIGHTING_PBR\nvec3 computePbrLighting(czm_modelMaterial inputMaterial, ProcessedAttributes attributes)\n{\n czm_pbrParameters pbrParameters;\n pbrParameters.diffuseColor = inputMaterial.diffuse;\n pbrParameters.f0 = inputMaterial.specular;\n pbrParameters.roughness = inputMaterial.roughness;\n \n #ifdef USE_CUSTOM_LIGHT_COLOR\n vec3 lightColorHdr = model_lightColorHdr;\n #else\n vec3 lightColorHdr = czm_lightColorHdr;\n #endif\n\n vec3 color = inputMaterial.diffuse;\n #ifdef HAS_NORMALS\n color = czm_pbrLighting(\n attributes.positionEC,\n inputMaterial.normalEC,\n czm_lightDirectionEC,\n lightColorHdr,\n pbrParameters\n );\n\n #ifdef USE_IBL_LIGHTING\n color += imageBasedLightingStage(\n attributes.positionEC,\n inputMaterial.normalEC,\n czm_lightDirectionEC,\n lightColorHdr,\n pbrParameters\n );\n #endif\n #endif\n\n color *= inputMaterial.occlusion;\n color += inputMaterial.emissive;\n\n // In HDR mode, the frame buffer is in linear color space. The\n // post-processing stages (see PostProcessStageCollection) will handle\n // tonemapping. However, if HDR is not enabled, we must tonemap else large\n // values may be clamped to 1.0\n #ifndef HDR \n color = czm_acesTonemapping(color);\n #endif \n\n return color;\n}\n#endif\n\nvoid lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)\n{\n // Even though the lighting will only set the diffuse color,\n // pass all other properties so further stages have access to them.\n vec3 color = vec3(0.0);\n\n #ifdef LIGHTING_PBR\n color = computePbrLighting(material, attributes);\n #else // unlit\n color = material.diffuse;\n #endif\n\n #ifdef HAS_POINT_CLOUD_COLOR_STYLE\n // The colors resulting from point cloud styles are adjusted differently.\n color = czm_gammaCorrect(color);\n #elif !defined(HDR)\n // If HDR is not enabled, the frame buffer stores sRGB colors rather than\n // linear colors so the linear value must be converted.\n color = czm_linearToSrgb(color);\n #endif\n\n material.diffuse = color;\n}\n";
+
+// Source/Scene/Model/LightingModel.js
+var LightingModel = {
+ UNLIT: 0,
+ PBR: 1
+};
+var LightingModel_default = Object.freeze(LightingModel);
+
+// Source/Scene/Model/LightingPipelineStage.js
+var LightingPipelineStage = {
+ name: "LightingPipelineStage"
+};
+LightingPipelineStage.process = function(renderResources, primitive) {
+ const model = renderResources.model;
+ const lightingOptions = renderResources.lightingOptions;
+ const shaderBuilder = renderResources.shaderBuilder;
+ if (defined_default(model.lightColor)) {
+ shaderBuilder.addDefine(
+ "USE_CUSTOM_LIGHT_COLOR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "vec3",
+ "model_lightColorHdr",
+ ShaderDestination_default.FRAGMENT
+ );
+ const uniformMap2 = renderResources.uniformMap;
+ uniformMap2.model_lightColorHdr = function() {
+ return model.lightColor;
+ };
+ }
+ const lightingModel = lightingOptions.lightingModel;
+ if (lightingModel === LightingModel_default.PBR) {
+ shaderBuilder.addDefine(
+ "LIGHTING_PBR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ } else {
+ shaderBuilder.addDefine(
+ "LIGHTING_UNLIT",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ shaderBuilder.addFragmentLines(LightingStageFS_default);
+};
+var LightingPipelineStage_default = LightingPipelineStage;
+
+// Source/Shaders/Model/MaterialStageFS.js
+var MaterialStageFS_default = "// If the style color is white, it implies the feature has not been styled.\nbool isDefaultStyleColor(vec3 color)\n{\n return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));\n}\n\nvec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)\n{\n vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);\n vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;\n return color;\n}\n\nvec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)\n{\n return vec2(textureTransform * vec3(texCoord, 1.0));\n}\n\n#ifdef HAS_NORMALS\nvec3 computeNormal(ProcessedAttributes attributes)\n{\n // Geometry normal. This is already normalized \n vec3 ng = attributes.normalEC;\n\n vec3 normal = ng;\n #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)\n vec2 normalTexCoords = TEXCOORD_NORMAL;\n #ifdef HAS_NORMAL_TEXTURE_TRANSFORM\n normalTexCoords = computeTextureTransform(normalTexCoords, u_normalTextureTransform);\n #endif\n\n // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set\n #ifdef HAS_BITANGENTS\n vec3 t = attributes.tangentEC;\n vec3 b = attributes.bitangentEC;\n mat3 tbn = mat3(t, b, ng);\n vec3 n = texture2D(u_normalTexture, normalTexCoords).rgb;\n normal = normalize(tbn * (2.0 * n - 1.0));\n #elif defined(GL_OES_standard_derivatives)\n // Compute tangents\n vec3 positionEC = attributes.positionEC;\n vec3 pos_dx = dFdx(positionEC);\n vec3 pos_dy = dFdy(positionEC);\n vec3 tex_dx = dFdx(vec3(normalTexCoords,0.0));\n vec3 tex_dy = dFdy(vec3(normalTexCoords,0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n vec3 n = texture2D(u_normalTexture, normalTexCoords).rgb;\n normal = normalize(tbn * (2.0 * n - 1.0));\n #endif\n #endif\n\n #ifdef HAS_DOUBLE_SIDED_MATERIAL\n if (czm_backFacing()) {\n normal = -normal;\n }\n #endif\n\n return normal;\n}\n#endif\n\nvoid materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)\n{\n #ifdef HAS_NORMALS\n material.normalEC = computeNormal(attributes);\n #endif\n\n vec4 baseColorWithAlpha = vec4(1.0);\n // Regardless of whether we use PBR, set a base color\n #ifdef HAS_BASE_COLOR_TEXTURE\n vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;\n\n #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM\n baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);\n #endif\n\n baseColorWithAlpha = czm_srgbToLinear(texture2D(u_baseColorTexture, baseColorTexCoords));\n\n #ifdef HAS_BASE_COLOR_FACTOR\n baseColorWithAlpha *= u_baseColorFactor;\n #endif\n #elif defined(HAS_BASE_COLOR_FACTOR)\n baseColorWithAlpha = u_baseColorFactor;\n #endif\n\n #ifdef HAS_POINT_CLOUD_COLOR_STYLE\n baseColorWithAlpha = v_pointCloudColor;\n #elif defined(HAS_COLOR_0)\n vec4 color = attributes.color_0;\n // .pnts files store colors in the sRGB color space\n #ifdef HAS_SRGB_COLOR\n color = czm_srgbToLinear(color);\n #endif\n baseColorWithAlpha *= color;\n #endif\n\n material.diffuse = baseColorWithAlpha.rgb;\n material.alpha = baseColorWithAlpha.a;\n\n #ifdef USE_CPU_STYLING\n material.diffuse = blend(material.diffuse, feature.color.rgb, model_colorBlend);\n #endif\n\n #ifdef HAS_OCCLUSION_TEXTURE\n vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;\n #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM\n occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);\n #endif\n material.occlusion = texture2D(u_occlusionTexture, occlusionTexCoords).r;\n #endif\n\n #ifdef HAS_EMISSIVE_TEXTURE\n vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;\n #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM\n emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);\n #endif\n\n vec3 emissive = czm_srgbToLinear(texture2D(u_emissiveTexture, emissiveTexCoords).rgb);\n #ifdef HAS_EMISSIVE_FACTOR\n emissive *= u_emissiveFactor;\n #endif\n material.emissive = emissive;\n #elif defined(HAS_EMISSIVE_FACTOR)\n material.emissive = u_emissiveFactor;\n #endif\n\n #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)\n #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE\n vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;\n #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM\n specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);\n #endif\n\n vec4 specularGlossiness = czm_srgbToLinear(texture2D(u_specularGlossinessTexture, specularGlossinessTexCoords));\n vec3 specular = specularGlossiness.rgb;\n float glossiness = specularGlossiness.a;\n #ifdef HAS_SPECULAR_FACTOR\n specular *= u_specularFactor;\n #endif\n\n #ifdef HAS_GLOSSINESS_FACTOR\n glossiness *= u_glossinessFactor;\n #endif\n #else\n #ifdef HAS_SPECULAR_FACTOR\n vec3 specular = clamp(u_specularFactor, vec3(0.0), vec3(1.0));\n #else\n vec3 specular = vec3(1.0);\n #endif\n\n #ifdef HAS_GLOSSINESS_FACTOR\n float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);\n #else\n float glossiness = 1.0;\n #endif\n #endif\n\n #ifdef HAS_DIFFUSE_TEXTURE\n vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;\n #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM\n diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);\n #endif\n\n vec4 diffuse = czm_srgbToLinear(texture2D(u_diffuseTexture, diffuseTexCoords));\n #ifdef HAS_DIFFUSE_FACTOR\n diffuse *= u_diffuseFactor;\n #endif\n #elif defined(HAS_DIFFUSE_FACTOR)\n vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));\n #else\n vec4 diffuse = vec4(1.0);\n #endif\n czm_pbrParameters parameters = czm_pbrSpecularGlossinessMaterial(\n diffuse.rgb,\n specular,\n glossiness\n );\n material.diffuse = parameters.diffuseColor;\n // the specular glossiness extension's alpha overrides anything set\n // by the base material.\n material.alpha = diffuse.a;\n material.specular = parameters.f0;\n material.roughness = parameters.roughness;\n #elif defined(LIGHTING_PBR)\n #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE\n vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;\n #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM\n metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);\n #endif\n\n vec3 metallicRoughness = texture2D(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;\n float metalness = clamp(metallicRoughness.b, 0.0, 1.0);\n float roughness = clamp(metallicRoughness.g, 0.04, 1.0);\n #ifdef HAS_METALLIC_FACTOR\n metalness *= u_metallicFactor;\n #endif\n\n #ifdef HAS_ROUGHNESS_FACTOR\n roughness *= u_roughnessFactor;\n #endif\n #else\n #ifdef HAS_METALLIC_FACTOR\n float metalness = clamp(u_metallicFactor, 0.0, 1.0);\n #else\n float metalness = 1.0;\n #endif\n\n #ifdef HAS_ROUGHNESS_FACTOR\n float roughness = clamp(u_roughnessFactor, 0.04, 1.0);\n #else\n float roughness = 1.0;\n #endif\n #endif\n czm_pbrParameters parameters = czm_pbrMetallicRoughnessMaterial(\n material.diffuse,\n metalness,\n roughness\n );\n material.diffuse = parameters.diffuseColor;\n material.specular = parameters.f0;\n material.roughness = parameters.roughness;\n #endif\n}\n";
+
+// Source/Scene/Model/MaterialPipelineStage.js
+var Material4 = ModelComponents_default.Material;
+var MetallicRoughness3 = ModelComponents_default.MetallicRoughness;
+var SpecularGlossiness3 = ModelComponents_default.SpecularGlossiness;
+var MaterialPipelineStage = {
+ name: "MaterialPipelineStage",
+ _processTexture: processTexture2,
+ _processTextureTransform: processTextureTransform
+};
+MaterialPipelineStage.process = function(renderResources, primitive, frameState) {
+ const material = primitive.material;
+ const model = renderResources.model;
+ const hasClassification = defined_default(model.classificationType);
+ const disableTextures = hasClassification;
+ const uniformMap2 = renderResources.uniformMap;
+ const shaderBuilder = renderResources.shaderBuilder;
+ const defaultTexture = frameState.context.defaultTexture;
+ const defaultNormalTexture = frameState.context.defaultNormalTexture;
+ const defaultEmissiveTexture = frameState.context.defaultEmissiveTexture;
+ processMaterialUniforms(
+ material,
+ uniformMap2,
+ shaderBuilder,
+ defaultTexture,
+ defaultNormalTexture,
+ defaultEmissiveTexture,
+ disableTextures
+ );
+ if (defined_default(material.specularGlossiness)) {
+ processSpecularGlossinessUniforms(
+ material,
+ uniformMap2,
+ shaderBuilder,
+ defaultTexture,
+ disableTextures
+ );
+ } else {
+ processMetallicRoughnessUniforms(
+ material,
+ uniformMap2,
+ shaderBuilder,
+ defaultTexture,
+ disableTextures
+ );
+ }
+ const hasNormals = ModelUtility_default.getAttributeBySemantic(
+ primitive,
+ VertexAttributeSemantic_default.NORMAL
+ );
+ const lightingOptions = renderResources.lightingOptions;
+ if (material.unlit || !hasNormals || hasClassification) {
+ lightingOptions.lightingModel = LightingModel_default.UNLIT;
+ } else {
+ lightingOptions.lightingModel = LightingModel_default.PBR;
+ }
+ const cull = model.backFaceCulling && !material.doubleSided;
+ renderResources.renderStateOptions.cull.enabled = cull;
+ const alphaOptions = renderResources.alphaOptions;
+ if (material.alphaMode === AlphaMode_default.BLEND) {
+ alphaOptions.pass = Pass_default.TRANSLUCENT;
+ } else if (material.alphaMode === AlphaMode_default.MASK) {
+ alphaOptions.alphaCutoff = material.alphaCutoff;
+ }
+ shaderBuilder.addFragmentLines(MaterialStageFS_default);
+ if (material.doubleSided) {
+ shaderBuilder.addDefine(
+ "HAS_DOUBLE_SIDED_MATERIAL",
+ void 0,
+ ShaderDestination_default.BOTH
+ );
+ }
+};
+function processTextureTransform(shaderBuilder, uniformMap2, textureReader, uniformName, defineName) {
+ const transformDefine = `HAS_${defineName}_TEXTURE_TRANSFORM`;
+ shaderBuilder.addDefine(
+ transformDefine,
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ const transformUniformName = `${uniformName}Transform`;
+ shaderBuilder.addUniform(
+ "mat3",
+ transformUniformName,
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2[transformUniformName] = function() {
+ return textureReader.transform;
+ };
+}
+function processTexture2(shaderBuilder, uniformMap2, textureReader, uniformName, defineName, defaultTexture) {
+ shaderBuilder.addUniform(
+ "sampler2D",
+ uniformName,
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2[uniformName] = function() {
+ return defaultValue_default(textureReader.texture, defaultTexture);
+ };
+ const textureDefine = `HAS_${defineName}_TEXTURE`;
+ shaderBuilder.addDefine(textureDefine, void 0, ShaderDestination_default.FRAGMENT);
+ const texCoordIndex = textureReader.texCoord;
+ const texCoordVarying = `v_texCoord_${texCoordIndex}`;
+ const texCoordDefine = `TEXCOORD_${defineName}`;
+ shaderBuilder.addDefine(
+ texCoordDefine,
+ texCoordVarying,
+ ShaderDestination_default.FRAGMENT
+ );
+ const textureTransform = textureReader.transform;
+ if (defined_default(textureTransform) && !Matrix3_default.equals(textureTransform, Matrix3_default.IDENTITY)) {
+ processTextureTransform(
+ shaderBuilder,
+ uniformMap2,
+ textureReader,
+ uniformName,
+ defineName
+ );
+ }
+}
+function processMaterialUniforms(material, uniformMap2, shaderBuilder, defaultTexture, defaultNormalTexture, defaultEmissiveTexture, disableTextures) {
+ const emissiveTexture = material.emissiveTexture;
+ if (defined_default(emissiveTexture) && !disableTextures) {
+ processTexture2(
+ shaderBuilder,
+ uniformMap2,
+ emissiveTexture,
+ "u_emissiveTexture",
+ "EMISSIVE",
+ defaultEmissiveTexture
+ );
+ }
+ const emissiveFactor = material.emissiveFactor;
+ if (defined_default(emissiveFactor) && !Cartesian3_default.equals(emissiveFactor, Material4.DEFAULT_EMISSIVE_FACTOR)) {
+ shaderBuilder.addUniform(
+ "vec3",
+ "u_emissiveFactor",
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2.u_emissiveFactor = function() {
+ return material.emissiveFactor;
+ };
+ shaderBuilder.addDefine(
+ "HAS_EMISSIVE_FACTOR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ const normalTexture = material.normalTexture;
+ if (defined_default(normalTexture) && !disableTextures) {
+ processTexture2(
+ shaderBuilder,
+ uniformMap2,
+ normalTexture,
+ "u_normalTexture",
+ "NORMAL",
+ defaultNormalTexture
+ );
+ }
+ const occlusionTexture = material.occlusionTexture;
+ if (defined_default(occlusionTexture) && !disableTextures) {
+ processTexture2(
+ shaderBuilder,
+ uniformMap2,
+ occlusionTexture,
+ "u_occlusionTexture",
+ "OCCLUSION",
+ defaultTexture
+ );
+ }
+}
+function processSpecularGlossinessUniforms(material, uniformMap2, shaderBuilder, defaultTexture, disableTextures) {
+ const specularGlossiness = material.specularGlossiness;
+ shaderBuilder.addDefine(
+ "USE_SPECULAR_GLOSSINESS",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ const diffuseTexture = specularGlossiness.diffuseTexture;
+ if (defined_default(diffuseTexture) && !disableTextures) {
+ processTexture2(
+ shaderBuilder,
+ uniformMap2,
+ diffuseTexture,
+ "u_diffuseTexture",
+ "DIFFUSE",
+ defaultTexture
+ );
+ }
+ const diffuseFactor = specularGlossiness.diffuseFactor;
+ if (defined_default(diffuseFactor) && !Cartesian4_default.equals(diffuseFactor, SpecularGlossiness3.DEFAULT_DIFFUSE_FACTOR)) {
+ shaderBuilder.addUniform(
+ "vec4",
+ "u_diffuseFactor",
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2.u_diffuseFactor = function() {
+ return specularGlossiness.diffuseFactor;
+ };
+ shaderBuilder.addDefine(
+ "HAS_DIFFUSE_FACTOR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ const specularGlossinessTexture = specularGlossiness.specularGlossinessTexture;
+ if (defined_default(specularGlossinessTexture) && !disableTextures) {
+ processTexture2(
+ shaderBuilder,
+ uniformMap2,
+ specularGlossinessTexture,
+ "u_specularGlossinessTexture",
+ "SPECULAR_GLOSSINESS",
+ defaultTexture
+ );
+ }
+ const specularFactor = specularGlossiness.specularFactor;
+ if (defined_default(specularFactor) && !Cartesian3_default.equals(
+ specularFactor,
+ SpecularGlossiness3.DEFAULT_SPECULAR_FACTOR
+ )) {
+ shaderBuilder.addUniform(
+ "vec3",
+ "u_specularFactor",
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2.u_specularFactor = function() {
+ return specularGlossiness.specularFactor;
+ };
+ shaderBuilder.addDefine(
+ "HAS_SPECULAR_FACTOR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ const glossinessFactor = specularGlossiness.glossinessFactor;
+ if (defined_default(glossinessFactor) && glossinessFactor !== SpecularGlossiness3.DEFAULT_GLOSSINESS_FACTOR) {
+ shaderBuilder.addUniform(
+ "float",
+ "u_glossinessFactor",
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2.u_glossinessFactor = function() {
+ return specularGlossiness.glossinessFactor;
+ };
+ shaderBuilder.addDefine(
+ "HAS_GLOSSINESS_FACTOR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+}
+function processMetallicRoughnessUniforms(material, uniformMap2, shaderBuilder, defaultTexture, disableTextures) {
+ const metallicRoughness = material.metallicRoughness;
+ shaderBuilder.addDefine(
+ "USE_METALLIC_ROUGHNESS",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ const baseColorTexture = metallicRoughness.baseColorTexture;
+ if (defined_default(baseColorTexture) && !disableTextures) {
+ processTexture2(
+ shaderBuilder,
+ uniformMap2,
+ baseColorTexture,
+ "u_baseColorTexture",
+ "BASE_COLOR",
+ defaultTexture
+ );
+ }
+ const baseColorFactor = metallicRoughness.baseColorFactor;
+ if (defined_default(baseColorFactor) && !Cartesian4_default.equals(
+ baseColorFactor,
+ MetallicRoughness3.DEFAULT_BASE_COLOR_FACTOR
+ )) {
+ shaderBuilder.addUniform(
+ "vec4",
+ "u_baseColorFactor",
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2.u_baseColorFactor = function() {
+ return metallicRoughness.baseColorFactor;
+ };
+ shaderBuilder.addDefine(
+ "HAS_BASE_COLOR_FACTOR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ const metallicRoughnessTexture = metallicRoughness.metallicRoughnessTexture;
+ if (defined_default(metallicRoughnessTexture) && !disableTextures) {
+ processTexture2(
+ shaderBuilder,
+ uniformMap2,
+ metallicRoughnessTexture,
+ "u_metallicRoughnessTexture",
+ "METALLIC_ROUGHNESS",
+ defaultTexture
+ );
+ }
+ const metallicFactor = metallicRoughness.metallicFactor;
+ if (defined_default(metallicFactor) && metallicFactor !== MetallicRoughness3.DEFAULT_METALLIC_FACTOR) {
+ shaderBuilder.addUniform(
+ "float",
+ "u_metallicFactor",
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2.u_metallicFactor = function() {
+ return metallicRoughness.metallicFactor;
+ };
+ shaderBuilder.addDefine(
+ "HAS_METALLIC_FACTOR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+ const roughnessFactor = metallicRoughness.roughnessFactor;
+ if (defined_default(roughnessFactor) && roughnessFactor !== MetallicRoughness3.DEFAULT_ROUGHNESS_FACTOR) {
+ shaderBuilder.addUniform(
+ "float",
+ "u_roughnessFactor",
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2.u_roughnessFactor = function() {
+ return metallicRoughness.roughnessFactor;
+ };
+ shaderBuilder.addDefine(
+ "HAS_ROUGHNESS_FACTOR",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ }
+}
+var MaterialPipelineStage_default = MaterialPipelineStage;
+
+// Source/Shaders/Model/MorphTargetsStageVS.js
+var MorphTargetsStageVS_default = "void morphTargetsStage(inout ProcessedAttributes attributes) \n{\n vec3 positionMC = attributes.positionMC;\n attributes.positionMC = getMorphedPosition(positionMC);\n\n #ifdef HAS_NORMALS\n vec3 normalMC = attributes.normalMC;\n attributes.normalMC = getMorphedNormal(normalMC);\n #endif\n\n #ifdef HAS_TANGENTS\n vec3 tangentMC = attributes.tangentMC;\n attributes.tangentMC = getMorphedTangent(tangentMC);\n #endif\n}";
+
+// Source/Scene/Model/MorphTargetsPipelineStage.js
+var MorphTargetsPipelineStage = {
+ name: "MorphTargetsPipelineStage",
+ FUNCTION_ID_GET_MORPHED_POSITION: "getMorphedPosition",
+ FUNCTION_SIGNATURE_GET_MORPHED_POSITION: "vec3 getMorphedPosition(in vec3 position)",
+ FUNCTION_ID_GET_MORPHED_NORMAL: "getMorphedNormal",
+ FUNCTION_SIGNATURE_GET_MORPHED_NORMAL: "vec3 getMorphedNormal(in vec3 normal)",
+ FUNCTION_ID_GET_MORPHED_TANGENT: "getMorphedTangent",
+ FUNCTION_SIGNATURE_GET_MORPHED_TANGENT: "vec3 getMorphedTangent(in vec3 tangent)"
+};
+MorphTargetsPipelineStage.process = function(renderResources, primitive) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine(
+ "HAS_MORPH_TARGETS",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ addGetMorphedAttributeFunctionDeclarations(shaderBuilder);
+ const morphTargetsLength = primitive.morphTargets.length;
+ for (let i = 0; i < morphTargetsLength; i++) {
+ const attributes = primitive.morphTargets[i].attributes;
+ const attributesLength = attributes.length;
+ for (let j = 0; j < attributesLength; j++) {
+ const attribute = attributes[j];
+ const semantic = attribute.semantic;
+ if (semantic !== VertexAttributeSemantic_default.POSITION && semantic !== VertexAttributeSemantic_default.NORMAL && semantic !== VertexAttributeSemantic_default.TANGENT) {
+ continue;
+ }
+ processMorphTargetAttribute(
+ renderResources,
+ attribute,
+ renderResources.attributeIndex,
+ i
+ );
+ renderResources.attributeIndex++;
+ }
+ }
+ addGetMorphedAttributeFunctionReturns(shaderBuilder);
+ const weights2 = renderResources.runtimeNode.morphWeights;
+ const weightsLength = weights2.length;
+ shaderBuilder.addUniform(
+ "float",
+ `u_morphWeights[${weightsLength}]`,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addVertexLines(MorphTargetsStageVS_default);
+ const uniformMap2 = {
+ u_morphWeights: function() {
+ return renderResources.runtimeNode.morphWeights;
+ }
+ };
+ renderResources.uniformMap = combine_default(uniformMap2, renderResources.uniformMap);
+};
+var scratchAttributeInfo = {
+ attributeString: void 0,
+ functionId: void 0
+};
+function processMorphTargetAttribute(renderResources, attribute, attributeIndex, morphTargetIndex) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ addMorphTargetAttributeToRenderResources(
+ renderResources,
+ attribute,
+ attributeIndex
+ );
+ const attributeInfo = getMorphTargetAttributeInfo(
+ attribute,
+ scratchAttributeInfo
+ );
+ addMorphTargetAttributeDeclarationAndFunctionLine(
+ shaderBuilder,
+ attributeInfo,
+ morphTargetIndex
+ );
+}
+function addMorphTargetAttributeToRenderResources(renderResources, attribute, attributeIndex) {
+ const vertexAttribute = {
+ index: attributeIndex,
+ value: defined_default(attribute.buffer) ? void 0 : attribute.constant,
+ vertexBuffer: attribute.buffer,
+ componentsPerAttribute: AttributeType_default.getNumberOfComponents(attribute.type),
+ componentDatatype: attribute.componentDatatype,
+ offsetInBytes: attribute.byteOffset,
+ strideInBytes: attribute.byteStride,
+ normalize: attribute.normalized
+ };
+ renderResources.attributes.push(vertexAttribute);
+}
+function getMorphTargetAttributeInfo(attribute, result) {
+ const semantic = attribute.semantic;
+ switch (semantic) {
+ case VertexAttributeSemantic_default.POSITION:
+ result.attributeString = "Position";
+ result.functionId = MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION;
+ break;
+ case VertexAttributeSemantic_default.NORMAL:
+ result.attributeString = "Normal";
+ result.functionId = MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL;
+ break;
+ case VertexAttributeSemantic_default.TANGENT:
+ result.attributeString = "Tangent";
+ result.functionId = MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT;
+ break;
+ default:
+ break;
+ }
+ return result;
+}
+function addMorphTargetAttributeDeclarationAndFunctionLine(shaderBuilder, attributeInfo, morphTargetIndex) {
+ const attributeString = attributeInfo.attributeString;
+ const attributeName = `a_target${attributeString}_${morphTargetIndex}`;
+ const line = `morphed${attributeString} += u_morphWeights[${morphTargetIndex}] * a_target${attributeString}_${morphTargetIndex};`;
+ shaderBuilder.addAttribute("vec3", attributeName);
+ shaderBuilder.addFunctionLines(attributeInfo.functionId, [line]);
+}
+function addGetMorphedAttributeFunctionDeclarations(shaderBuilder) {
+ shaderBuilder.addFunction(
+ MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION,
+ MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,
+ ShaderDestination_default.VERTEX
+ );
+ const positionLine = "vec3 morphedPosition = position;";
+ shaderBuilder.addFunctionLines(
+ MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION,
+ [positionLine]
+ );
+ shaderBuilder.addFunction(
+ MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL,
+ MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,
+ ShaderDestination_default.VERTEX
+ );
+ const normalLine = "vec3 morphedNormal = normal;";
+ shaderBuilder.addFunctionLines(
+ MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL,
+ [normalLine]
+ );
+ shaderBuilder.addFunction(
+ MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT,
+ MorphTargetsPipelineStage.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,
+ ShaderDestination_default.VERTEX
+ );
+ const tangentLine = "vec3 morphedTangent = tangent;";
+ shaderBuilder.addFunctionLines(
+ MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT,
+ [tangentLine]
+ );
+}
+function addGetMorphedAttributeFunctionReturns(shaderBuilder) {
+ const positionLine = "return morphedPosition;";
+ shaderBuilder.addFunctionLines(
+ MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_POSITION,
+ [positionLine]
+ );
+ const normalLine = "return morphedNormal;";
+ shaderBuilder.addFunctionLines(
+ MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_NORMAL,
+ [normalLine]
+ );
+ const tangentLine = "return morphedTangent;";
+ shaderBuilder.addFunctionLines(
+ MorphTargetsPipelineStage.FUNCTION_ID_GET_MORPHED_TANGENT,
+ [tangentLine]
+ );
+}
+var MorphTargetsPipelineStage_default = MorphTargetsPipelineStage;
+
+// Source/Scene/Model/PickingPipelineStage.js
+var PickingPipelineStage = {
+ name: "PickingPipelineStage"
+};
+PickingPipelineStage.process = function(renderResources, primitive, frameState) {
+ const context = frameState.context;
+ const runtimeNode = renderResources.runtimeNode;
+ const shaderBuilder = renderResources.shaderBuilder;
+ const model = renderResources.model;
+ const instances = runtimeNode.node.instances;
+ if (renderResources.hasPropertyTable) {
+ processPickTexture(renderResources, primitive, instances, context);
+ } else if (defined_default(instances)) {
+ processInstancedPickIds(renderResources, context);
+ } else {
+ const pickObject = buildPickObject(renderResources);
+ const pickId = context.createPickId(pickObject);
+ model._pipelineResources.push(pickId);
+ model._pickIds.push(pickId);
+ shaderBuilder.addUniform(
+ "vec4",
+ "czm_pickColor",
+ ShaderDestination_default.FRAGMENT
+ );
+ const uniformMap2 = renderResources.uniformMap;
+ uniformMap2.czm_pickColor = function() {
+ return pickId.color;
+ };
+ renderResources.pickId = "czm_pickColor";
+ }
+};
+function buildPickObject(renderResources, instanceId) {
+ const model = renderResources.model;
+ if (defined_default(model.pickObject)) {
+ return model.pickObject;
+ }
+ const detailPickObject = {
+ model,
+ node: renderResources.runtimeNode,
+ primitive: renderResources.runtimePrimitive
+ };
+ let pickObject;
+ if (ModelType_default.is3DTiles(model.type)) {
+ const content = model.content;
+ pickObject = {
+ content,
+ primitive: content.tileset,
+ detail: detailPickObject
+ };
+ } else {
+ pickObject = {
+ primitive: model,
+ detail: detailPickObject
+ };
+ }
+ pickObject.id = model.id;
+ if (defined_default(instanceId)) {
+ pickObject.instanceId = instanceId;
+ }
+ return pickObject;
+}
+function processPickTexture(renderResources, primitive, instances) {
+ const model = renderResources.model;
+ let featureTableId;
+ let featureIdAttribute;
+ const featureIdLabel = model.featureIdLabel;
+ const instanceFeatureIdLabel = model.instanceFeatureIdLabel;
+ if (defined_default(model.featureTableId)) {
+ featureTableId = model.featureTableId;
+ } else if (defined_default(instances)) {
+ featureIdAttribute = ModelUtility_default.getFeatureIdsByLabel(
+ instances.featureIds,
+ instanceFeatureIdLabel
+ );
+ featureTableId = featureIdAttribute.propertyTableId;
+ } else {
+ featureIdAttribute = ModelUtility_default.getFeatureIdsByLabel(
+ primitive.featureIds,
+ featureIdLabel
+ );
+ featureTableId = featureIdAttribute.propertyTableId;
+ }
+ const featureTable = model.featureTables[featureTableId];
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addUniform(
+ "sampler2D",
+ "model_pickTexture",
+ ShaderDestination_default.FRAGMENT
+ );
+ const batchTexture = featureTable.batchTexture;
+ renderResources.uniformMap.model_pickTexture = function() {
+ return defaultValue_default(batchTexture.pickTexture, batchTexture.defaultTexture);
+ };
+ renderResources.pickId = "((selectedFeature.id < int(model_featuresLength)) ? texture2D(model_pickTexture, selectedFeature.st) : vec4(0.0))";
+}
+function processInstancedPickIds(renderResources, context) {
+ const instanceCount = renderResources.instanceCount;
+ const pickIds = new Array(instanceCount);
+ const pickIdsTypedArray = new Uint8Array(instanceCount * 4);
+ const model = renderResources.model;
+ const pipelineResources = model._pipelineResources;
+ for (let i = 0; i < instanceCount; i++) {
+ const pickObject = buildPickObject(renderResources, i);
+ const pickId = context.createPickId(pickObject);
+ pipelineResources.push(pickId);
+ pickIds[i] = pickId;
+ const pickColor = pickId.color;
+ pickIdsTypedArray[i * 4 + 0] = Color_default.floatToByte(pickColor.red);
+ pickIdsTypedArray[i * 4 + 1] = Color_default.floatToByte(pickColor.green);
+ pickIdsTypedArray[i * 4 + 2] = Color_default.floatToByte(pickColor.blue);
+ pickIdsTypedArray[i * 4 + 3] = Color_default.floatToByte(pickColor.alpha);
+ }
+ model._pickIds = pickIds;
+ const pickIdsBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: pickIdsTypedArray,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ pickIdsBuffer.vertexArrayDestroyable = false;
+ const hasCpuCopy = false;
+ model.statistics.addBuffer(pickIdsBuffer, hasCpuCopy);
+ pipelineResources.push(pickIdsBuffer);
+ const pickIdsVertexAttribute = {
+ index: renderResources.attributeIndex++,
+ vertexBuffer: pickIdsBuffer,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ normalize: true,
+ offsetInBytes: 0,
+ strideInBytes: 0,
+ instanceDivisor: 1
+ };
+ renderResources.attributes.push(pickIdsVertexAttribute);
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine("USE_PICKING", void 0, ShaderDestination_default.BOTH);
+ shaderBuilder.addAttribute("vec4", "a_pickColor");
+ shaderBuilder.addVarying("vec4", "v_pickColor");
+ renderResources.pickId = "v_pickColor";
+}
+var PickingPipelineStage_default = PickingPipelineStage;
+
+// Source/Scene/Cesium3DTileRefine.js
+var Cesium3DTileRefine = {
+ ADD: 0,
+ REPLACE: 1
+};
+var Cesium3DTileRefine_default = Object.freeze(Cesium3DTileRefine);
+
+// Source/Shaders/Model/PointCloudStylingStageVS.js
+var PointCloudStylingStageVS_default = "float getPointSizeFromAttenuation(vec3 positionEC) {\n // Variables are packed into a single vector to minimize gl.uniformXXX() calls\n float pointSize = model_pointCloudParameters.x;\n float geometricError = model_pointCloudParameters.y;\n float depthMultiplier = model_pointCloudParameters.z;\n\n float depth = -positionEC.z;\n return min((geometricError / depth) * depthMultiplier, pointSize);\n}\n\n#ifdef HAS_POINT_CLOUD_SHOW_STYLE\nfloat pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n float tiles3d_tileset_time = model_pointCloudParameters.w;\n return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));\n}\n#endif\n\n#ifdef HAS_POINT_CLOUD_COLOR_STYLE\nvec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n float tiles3d_tileset_time = model_pointCloudParameters.w;\n return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);\n}\n#endif\n\n#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE\nfloat pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n float tiles3d_tileset_time = model_pointCloudParameters.w;\n return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));\n}\n#elif defined(HAS_POINT_CLOUD_ATTENUATION)\nfloat pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {\n return getPointSizeFromAttenuation(v_positionEC);\n}\n#endif\n\n#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING\nfloat pointCloudBackFaceCullingStage() {\n #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)\n // This needs to be computed in eye coordinates so we can't use attributes.normalMC\n return step(-v_normalEC.z, 0.0);\n #else\n return 1.0;\n #endif\n}\n#endif";
+
+// Source/Scene/Model/PointCloudStylingPipelineStage.js
+var scratchUniform = new Cartesian4_default();
+var PointCloudStylingPipelineStage = {
+ name: "PointCloudStylingPipelineStage"
+};
+PointCloudStylingPipelineStage.process = function(renderResources, primitive, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const model = renderResources.model;
+ const style = model.style;
+ const structuralMetadata = model.structuralMetadata;
+ const propertyAttributes = defined_default(structuralMetadata) ? structuralMetadata.propertyAttributes : void 0;
+ const hasFeatureTable = defined_default(model.featureTableId) && model.featureTables[model.featureTableId].featuresLength > 0;
+ const hasBatchTable = !defined_default(propertyAttributes) && hasFeatureTable;
+ if (defined_default(style) && !hasBatchTable) {
+ const variableSubstitutionMap = getVariableSubstitutionMap(
+ propertyAttributes
+ );
+ const shaderFunctionInfo = getStyleShaderFunctionInfo(
+ style,
+ variableSubstitutionMap
+ );
+ addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo);
+ const propertyNames = getPropertyNames(shaderFunctionInfo);
+ const usesNormalSemantic = propertyNames.indexOf("normalMC") >= 0;
+ const hasNormals = ModelUtility_default.getAttributeBySemantic(
+ primitive,
+ VertexAttributeSemantic_default.NORMAL
+ );
+ if (usesNormalSemantic && !hasNormals) {
+ throw new RuntimeError_default(
+ "Style references the NORMAL semantic but the point cloud does not have normals"
+ );
+ }
+ shaderBuilder.addDefine(
+ "COMPUTE_POSITION_WC_STYLE",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ const styleTranslucent = shaderFunctionInfo.styleTranslucent;
+ if (styleTranslucent) {
+ renderResources.alphaOptions.pass = Pass_default.TRANSLUCENT;
+ }
+ }
+ const pointCloudShading = model.pointCloudShading;
+ if (pointCloudShading.attenuation) {
+ shaderBuilder.addDefine(
+ "HAS_POINT_CLOUD_ATTENUATION",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ }
+ if (pointCloudShading.backFaceCulling) {
+ shaderBuilder.addDefine(
+ "HAS_POINT_CLOUD_BACK_FACE_CULLING",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ }
+ let content;
+ let is3DTiles;
+ let usesAddRefinement;
+ if (ModelType_default.is3DTiles(model.type)) {
+ is3DTiles = true;
+ content = model.content;
+ usesAddRefinement = content.tile.refine === Cesium3DTileRefine_default.ADD;
+ }
+ shaderBuilder.addUniform(
+ "vec4",
+ "model_pointCloudParameters",
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addVertexLines(PointCloudStylingStageVS_default);
+ const uniformMap2 = renderResources.uniformMap;
+ uniformMap2.model_pointCloudParameters = function() {
+ const vec4 = scratchUniform;
+ let defaultPointSize = 1;
+ if (is3DTiles) {
+ defaultPointSize = usesAddRefinement ? 5 : content.tileset.maximumScreenSpaceError;
+ }
+ vec4.x = defaultValue_default(
+ pointCloudShading.maximumAttenuation,
+ defaultPointSize
+ );
+ vec4.x *= frameState.pixelRatio;
+ const geometricError = getGeometricError2(
+ renderResources,
+ primitive,
+ pointCloudShading,
+ content
+ );
+ vec4.y = geometricError * pointCloudShading.geometricErrorScale;
+ const context = frameState.context;
+ const frustum = frameState.camera.frustum;
+ let depthMultiplier;
+ if (frameState.mode === SceneMode_default.SCENE2D || frustum instanceof OrthographicFrustum_default) {
+ depthMultiplier = Number.POSITIVE_INFINITY;
+ } else {
+ depthMultiplier = context.drawingBufferHeight / frameState.camera.frustum.sseDenominator;
+ }
+ vec4.z = depthMultiplier;
+ if (is3DTiles) {
+ vec4.w = content.tileset.timeSinceLoad;
+ }
+ return vec4;
+ };
+};
+var scratchDimensions = new Cartesian3_default();
+function getGeometricError2(renderResources, primitive, pointCloudShading, content) {
+ if (defined_default(content)) {
+ const geometricError = content.tile.geometricError;
+ if (geometricError > 0) {
+ return geometricError;
+ }
+ }
+ if (defined_default(pointCloudShading.baseResolution)) {
+ return pointCloudShading.baseResolution;
+ }
+ const positionAttribute = ModelUtility_default.getAttributeBySemantic(
+ primitive,
+ VertexAttributeSemantic_default.POSITION
+ );
+ const pointsLength = positionAttribute.count;
+ const nodeTransform = renderResources.runtimeNode.transform;
+ let dimensions = Cartesian3_default.subtract(
+ positionAttribute.max,
+ positionAttribute.min,
+ scratchDimensions
+ );
+ dimensions = Matrix4_default.multiplyByPointAsVector(
+ nodeTransform,
+ dimensions,
+ scratchDimensions
+ );
+ const volume = dimensions.x * dimensions.y * dimensions.z;
+ const geometricErrorEstimate = Math_default.cbrt(volume / pointsLength);
+ return geometricErrorEstimate;
+}
+var scratchShaderFunctionInfo = {
+ colorStyleFunction: void 0,
+ showStyleFunction: void 0,
+ pointSizeStyleFunction: void 0,
+ styleTranslucent: false
+};
+var builtinVariableSubstitutionMap = {
+ POSITION: "attributes.positionMC",
+ POSITION_ABSOLUTE: "v_positionWC",
+ COLOR: "attributes.color_0",
+ NORMAL: "attributes.normalMC"
+};
+function getVariableSubstitutionMap(propertyAttributes) {
+ const variableSubstitutionMap = clone_default(builtinVariableSubstitutionMap);
+ if (!defined_default(propertyAttributes)) {
+ return variableSubstitutionMap;
+ }
+ for (let i = 0; i < propertyAttributes.length; i++) {
+ const propertyAttribute = propertyAttributes[i];
+ const properties = propertyAttribute.properties;
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ variableSubstitutionMap[propertyId] = `metadata.${propertyId}`;
+ }
+ }
+ }
+ return variableSubstitutionMap;
+}
+var parameterList = "ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";
+function getStyleShaderFunctionInfo(style, variableSubstitutionMap) {
+ const info = scratchShaderFunctionInfo;
+ const shaderState = {
+ translucent: false
+ };
+ info.colorStyleFunction = style.getColorShaderFunction(
+ `getColorFromStyle(${parameterList})`,
+ variableSubstitutionMap,
+ shaderState
+ );
+ info.showStyleFunction = style.getShowShaderFunction(
+ `getShowFromStyle(${parameterList})`,
+ variableSubstitutionMap,
+ shaderState
+ );
+ info.pointSizeStyleFunction = style.getPointSizeShaderFunction(
+ `getPointSizeFromStyle(${parameterList})`,
+ variableSubstitutionMap,
+ shaderState
+ );
+ info.styleTranslucent = defined_default(info.colorStyleFunction) && shaderState.translucent;
+ return info;
+}
+function addShaderFunctionsAndDefines(shaderBuilder, shaderFunctionInfo) {
+ const colorStyleFunction = shaderFunctionInfo.colorStyleFunction;
+ if (defined_default(colorStyleFunction)) {
+ shaderBuilder.addDefine(
+ "HAS_POINT_CLOUD_COLOR_STYLE",
+ void 0,
+ ShaderDestination_default.BOTH
+ );
+ shaderBuilder.addVertexLines(colorStyleFunction);
+ shaderBuilder.addVarying("vec4", "v_pointCloudColor");
+ }
+ const showStyleFunction = shaderFunctionInfo.showStyleFunction;
+ if (defined_default(showStyleFunction)) {
+ shaderBuilder.addDefine(
+ "HAS_POINT_CLOUD_SHOW_STYLE",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addVertexLines(showStyleFunction);
+ }
+ const pointSizeStyleFunction = shaderFunctionInfo.pointSizeStyleFunction;
+ if (defined_default(pointSizeStyleFunction)) {
+ shaderBuilder.addDefine(
+ "HAS_POINT_CLOUD_POINT_SIZE_STYLE",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addVertexLines(pointSizeStyleFunction);
+ }
+}
+function getBuiltinPropertyNames(source, propertyNames) {
+ const regex = /attributes\.(\w+)/g;
+ let matches = regex.exec(source);
+ while (matches !== null) {
+ const name = matches[1];
+ if (propertyNames.indexOf(name) === -1) {
+ propertyNames.push(name);
+ }
+ matches = regex.exec(source);
+ }
+}
+function getPropertyNames(shaderFunctionInfo) {
+ const colorStyleFunction = shaderFunctionInfo.colorStyleFunction;
+ const showStyleFunction = shaderFunctionInfo.showStyleFunction;
+ const pointSizeStyleFunction = shaderFunctionInfo.pointSizeStyleFunction;
+ const builtinPropertyNames = [];
+ if (defined_default(colorStyleFunction)) {
+ getBuiltinPropertyNames(colorStyleFunction, builtinPropertyNames);
+ }
+ if (defined_default(showStyleFunction)) {
+ getBuiltinPropertyNames(showStyleFunction, builtinPropertyNames);
+ }
+ if (defined_default(pointSizeStyleFunction)) {
+ getBuiltinPropertyNames(pointSizeStyleFunction, builtinPropertyNames);
+ }
+ return builtinPropertyNames;
+}
+var PointCloudStylingPipelineStage_default = PointCloudStylingPipelineStage;
+
+// Source/Shaders/Model/PrimitiveOutlineStageVS.js
+var PrimitiveOutlineStageVS_default = "void primitiveOutlineStage() {\n v_outlineCoordinates = a_outlineCoordinates;\n}\n";
+
+// Source/Shaders/Model/PrimitiveOutlineStageFS.js
+var PrimitiveOutlineStageFS_default = "void primitiveOutlineStage(inout czm_modelMaterial material) {\n if (!model_showOutline) {\n return;\n }\n\n float outlineX = \n texture2D(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;\n float outlineY = \n texture2D(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;\n float outlineZ = \n texture2D(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;\n float outlineness = max(outlineX, max(outlineY, outlineZ));\n\n material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);\n}\n\n";
+
+// Source/Scene/Model/PrimitiveOutlinePipelineStage.js
+var PrimitiveOutlinePipelineStage = {
+ name: "PrimitiveOutlinePipelineStage"
+};
+PrimitiveOutlinePipelineStage.process = function(renderResources, primitive, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ const uniformMap2 = renderResources.uniformMap;
+ shaderBuilder.addDefine(
+ "HAS_PRIMITIVE_OUTLINE",
+ void 0,
+ ShaderDestination_default.BOTH
+ );
+ shaderBuilder.addAttribute("vec3", "a_outlineCoordinates");
+ shaderBuilder.addVarying("vec3", "v_outlineCoordinates");
+ const outlineCoordinates = primitive.outlineCoordinates;
+ const vertexAttribute = {
+ index: renderResources.attributeIndex++,
+ vertexBuffer: outlineCoordinates.buffer,
+ componentsPerAttribute: AttributeType_default.getNumberOfComponents(
+ outlineCoordinates.type
+ ),
+ componentDatatype: outlineCoordinates.componentDatatype,
+ offsetInBytes: outlineCoordinates.byteOffset,
+ strideInBytes: outlineCoordinates.byteStride,
+ normalize: outlineCoordinates.normalized
+ };
+ renderResources.attributes.push(vertexAttribute);
+ shaderBuilder.addUniform(
+ "sampler2D",
+ "model_outlineTexture",
+ ShaderDestination_default.FRAGMENT
+ );
+ const outlineTexture = PrimitiveOutlineGenerator_default.createTexture(
+ frameState.context
+ );
+ uniformMap2.model_outlineTexture = function() {
+ return outlineTexture;
+ };
+ const model = renderResources.model;
+ shaderBuilder.addUniform(
+ "vec4",
+ "model_outlineColor",
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2.model_outlineColor = function() {
+ return model.outlineColor;
+ };
+ shaderBuilder.addUniform(
+ "bool",
+ "model_showOutline",
+ ShaderDestination_default.FRAGMENT
+ );
+ uniformMap2.model_showOutline = function() {
+ return model.showOutline;
+ };
+ shaderBuilder.addVertexLines(PrimitiveOutlineStageVS_default);
+ shaderBuilder.addFragmentLines(PrimitiveOutlineStageFS_default);
+};
+var PrimitiveOutlinePipelineStage_default = PrimitiveOutlinePipelineStage;
+
+// Source/Scene/Model/PrimitiveStatisticsPipelineStage.js
+var PrimitiveStatisticsPipelineStage = {
+ name: "PrimitiveStatisticsPipelineStage",
+ _countGeometry: countGeometry,
+ _count2DPositions: count2DPositions,
+ _countMorphTargetAttributes: countMorphTargetAttributes,
+ _countMaterialTextures: countMaterialTextures,
+ _countFeatureIdTextures: countFeatureIdTextures,
+ _countBinaryMetadata: countBinaryMetadata
+};
+PrimitiveStatisticsPipelineStage.process = function(renderResources, primitive, frameState) {
+ const model = renderResources.model;
+ const statistics2 = model.statistics;
+ countGeometry(statistics2, primitive);
+ count2DPositions(statistics2, renderResources.runtimePrimitive);
+ countMorphTargetAttributes(statistics2, primitive);
+ countMaterialTextures(statistics2, primitive.material);
+ countFeatureIdTextures(statistics2, primitive.featureIds);
+ countBinaryMetadata(statistics2, model);
+};
+function countGeometry(statistics2, primitive) {
+ const indicesCount = defined_default(primitive.indices) ? primitive.indices.count : ModelUtility_default.getAttributeBySemantic(primitive, "POSITION").count;
+ const primitiveType = primitive.primitiveType;
+ if (primitiveType === PrimitiveType_default.POINTS) {
+ statistics2.pointsLength += indicesCount;
+ } else if (PrimitiveType_default.isTriangles(primitiveType)) {
+ statistics2.trianglesLength += countTriangles(primitiveType, indicesCount);
+ }
+ const attributes = primitive.attributes;
+ const length3 = attributes.length;
+ for (let i = 0; i < length3; i++) {
+ const attribute = attributes[i];
+ if (defined_default(attribute.buffer)) {
+ const hasCpuCopy = defined_default(attribute.typedArray);
+ statistics2.addBuffer(attribute.buffer, hasCpuCopy);
+ }
+ }
+ const outlineCoordinates = primitive.outlineCoordinates;
+ if (defined_default(outlineCoordinates) && defined_default(outlineCoordinates.buffer)) {
+ const hasCpuCopy = false;
+ statistics2.addBuffer(outlineCoordinates.buffer, hasCpuCopy);
+ }
+ const indices2 = primitive.indices;
+ if (defined_default(indices2) && defined_default(indices2.buffer)) {
+ const hasCpuCopy = defined_default(indices2.typedArray);
+ statistics2.addBuffer(indices2.buffer, hasCpuCopy);
+ }
+}
+function countTriangles(primitiveType, indicesCount) {
+ switch (primitiveType) {
+ case PrimitiveType_default.TRIANGLES:
+ return indicesCount / 3;
+ case PrimitiveType_default.TRIANGLE_STRIP:
+ case PrimitiveType_default.TRIANGLE_FAN:
+ return Math.max(indicesCount - 2, 0);
+ default:
+ return 0;
+ }
+}
+function count2DPositions(statistics2, runtimePrimitive) {
+ const buffer2D = runtimePrimitive.positionBuffer2D;
+ if (defined_default(buffer2D)) {
+ const hasCpuCopy = true;
+ statistics2.addBuffer(buffer2D, hasCpuCopy);
+ }
+}
+function countMorphTargetAttributes(statistics2, primitive) {
+ const morphTargets = primitive.morphTargets;
+ if (!defined_default(morphTargets)) {
+ return;
+ }
+ const hasCpuCopy = false;
+ const morphTargetsLength = morphTargets.length;
+ for (let i = 0; i < morphTargetsLength; i++) {
+ const attributes = morphTargets[i].attributes;
+ const attributesLength = attributes.length;
+ for (let j = 0; j < attributesLength; j++) {
+ const attribute = attributes[j];
+ if (defined_default(attribute.buffer)) {
+ statistics2.addBuffer(attribute.buffer, hasCpuCopy);
+ }
+ }
+ }
+}
+function countMaterialTextures(statistics2, material) {
+ const textureReaders = getAllTextureReaders(material);
+ const length3 = textureReaders.length;
+ for (let i = 0; i < length3; i++) {
+ const textureReader = textureReaders[i];
+ if (defined_default(textureReader) && defined_default(textureReader.texture)) {
+ statistics2.addTexture(textureReader.texture);
+ }
+ }
+}
+function getAllTextureReaders(material) {
+ const metallicRoughness = material.metallicRoughness;
+ const textureReaders = [
+ material.emissiveTexture,
+ material.normalTexture,
+ material.occlusionTexture,
+ metallicRoughness.baseColorTexture,
+ metallicRoughness.metallicRoughnessTexture
+ ];
+ const specularGlossiness = material.specularGlossiness;
+ if (defined_default(specularGlossiness)) {
+ textureReaders.push(specularGlossiness.diffuseTexture);
+ textureReaders.push(specularGlossiness.specularGlossinessTexture);
+ }
+ return textureReaders;
+}
+function countFeatureIdTextures(statistics2, featureIdSets) {
+ const length3 = featureIdSets.length;
+ for (let i = 0; i < length3; i++) {
+ const featureIds = featureIdSets[i];
+ if (featureIds instanceof ModelComponents_default.FeatureIdTexture) {
+ const textureReader = featureIds.textureReader;
+ if (defined_default(textureReader.texture)) {
+ statistics2.addTexture(textureReader.texture);
+ }
+ }
+ }
+}
+function countBinaryMetadata(statistics2, model) {
+ const structuralMetadata = model.structuralMetadata;
+ if (defined_default(structuralMetadata)) {
+ countPropertyTextures(statistics2, structuralMetadata);
+ statistics2.propertyTablesByteLength += structuralMetadata.propertyTablesByteLength;
+ }
+ const featureTables = model.featureTables;
+ if (!defined_default(featureTables)) {
+ return;
+ }
+ const length3 = featureTables.length;
+ for (let i = 0; i < length3; i++) {
+ const featureTable = featureTables[i];
+ statistics2.addBatchTexture(featureTable.batchTexture);
+ }
+}
+function countPropertyTextures(statistics2, structuralMetadata) {
+ const propertyTextures = structuralMetadata.propertyTextures;
+ if (!defined_default(propertyTextures)) {
+ return;
+ }
+ const texturesLength = propertyTextures.length;
+ for (let i = 0; i < texturesLength; i++) {
+ const propertyTexture = propertyTextures[i];
+ const properties = propertyTexture.properties;
+ for (const propertyId in properties) {
+ if (properties.hasOwnProperty(propertyId)) {
+ const property = properties[propertyId];
+ const textureReader = property.textureReader;
+ if (defined_default(textureReader.texture)) {
+ statistics2.addTexture(textureReader.texture);
+ }
+ }
+ }
+ }
+}
+var PrimitiveStatisticsPipelineStage_default = PrimitiveStatisticsPipelineStage;
+
+// Source/Scene/Model/SceneMode2DPipelineStage.js
+var scratchModelMatrix = new Matrix4_default();
+var scratchModelView2D = new Matrix4_default();
+var SceneMode2DPipelineStage = {
+ name: "SceneMode2DPipelineStage"
+};
+SceneMode2DPipelineStage.process = function(renderResources, primitive, frameState) {
+ const positionAttribute = ModelUtility_default.getAttributeBySemantic(
+ primitive,
+ VertexAttributeSemantic_default.POSITION
+ );
+ const shaderBuilder = renderResources.shaderBuilder;
+ const model = renderResources.model;
+ const modelMatrix = model.sceneGraph.computedModelMatrix;
+ const nodeComputedTransform = renderResources.runtimeNode.computedTransform;
+ const computedModelMatrix = Matrix4_default.multiplyTransformation(
+ modelMatrix,
+ nodeComputedTransform,
+ scratchModelMatrix
+ );
+ const boundingSphere2D = computeBoundingSphere2D(
+ renderResources,
+ computedModelMatrix,
+ frameState
+ );
+ const runtimePrimitive = renderResources.runtimePrimitive;
+ runtimePrimitive.boundingSphere2D = boundingSphere2D;
+ const instances = renderResources.runtimeNode.node.instances;
+ if (defined_default(instances)) {
+ return;
+ }
+ if (defined_default(positionAttribute.typedArray)) {
+ const buffer2D = createPositionBufferFor2D(
+ positionAttribute,
+ computedModelMatrix,
+ boundingSphere2D,
+ frameState
+ );
+ runtimePrimitive.positionBuffer2D = buffer2D;
+ model._modelResources.push(buffer2D);
+ positionAttribute.typedArray = void 0;
+ }
+ shaderBuilder.addDefine(
+ "USE_2D_POSITIONS",
+ void 0,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addUniform("mat4", "u_modelView2D", ShaderDestination_default.VERTEX);
+ const modelMatrix2D = Matrix4_default.fromTranslation(
+ boundingSphere2D.center,
+ new Matrix4_default()
+ );
+ const context = frameState.context;
+ const uniformMap2 = {
+ u_modelView2D: function() {
+ return Matrix4_default.multiplyTransformation(
+ context.uniformState.view,
+ modelMatrix2D,
+ scratchModelView2D
+ );
+ }
+ };
+ renderResources.uniformMap = combine_default(uniformMap2, renderResources.uniformMap);
+};
+var scratchProjectedMin2 = new Cartesian3_default();
+var scratchProjectedMax2 = new Cartesian3_default();
+function computeBoundingSphere2D(renderResources, modelMatrix, frameState) {
+ const transformedPositionMin = Matrix4_default.multiplyByPoint(
+ modelMatrix,
+ renderResources.positionMin,
+ scratchProjectedMin2
+ );
+ const projectedMin = SceneTransforms_default.computeActualWgs84Position(
+ frameState,
+ transformedPositionMin,
+ transformedPositionMin
+ );
+ const transformedPositionMax = Matrix4_default.multiplyByPoint(
+ modelMatrix,
+ renderResources.positionMax,
+ scratchProjectedMax2
+ );
+ const projectedMax = SceneTransforms_default.computeActualWgs84Position(
+ frameState,
+ transformedPositionMax,
+ transformedPositionMax
+ );
+ return BoundingSphere_default.fromCornerPoints(
+ projectedMin,
+ projectedMax,
+ new BoundingSphere_default()
+ );
+}
+var scratchPosition2 = new Cartesian3_default();
+function dequantizePositionsTypedArray(typedArray, quantization) {
+ const length3 = typedArray.length;
+ const dequantizedArray = new Float32Array(length3);
+ const quantizedVolumeOffset = quantization.quantizedVolumeOffset;
+ const quantizedVolumeStepSize = quantization.quantizedVolumeStepSize;
+ for (let i = 0; i < length3; i += 3) {
+ const initialPosition = Cartesian3_default.fromArray(
+ typedArray,
+ i,
+ scratchPosition2
+ );
+ const scaledPosition = Cartesian3_default.multiplyComponents(
+ initialPosition,
+ quantizedVolumeStepSize,
+ initialPosition
+ );
+ const dequantizedPosition = Cartesian3_default.add(
+ scaledPosition,
+ quantizedVolumeOffset,
+ scaledPosition
+ );
+ dequantizedArray[i] = dequantizedPosition.x;
+ dequantizedArray[i + 1] = dequantizedPosition.y;
+ dequantizedArray[i + 2] = dequantizedPosition.z;
+ }
+ return dequantizedArray;
+}
+function createPositionsTypedArrayFor2D(attribute, modelMatrix, referencePoint, frameState) {
+ let result;
+ if (defined_default(attribute.quantization)) {
+ result = dequantizePositionsTypedArray(
+ attribute.typedArray,
+ attribute.quantization
+ );
+ } else {
+ result = attribute.typedArray.slice();
+ }
+ const startIndex = attribute.byteOffset / Float32Array.BYTES_PER_ELEMENT;
+ const length3 = result.length;
+ const stride = defined_default(attribute.byteStride) ? attribute.byteStride / Float32Array.BYTES_PER_ELEMENT : 3;
+ for (let i = startIndex; i < length3; i += stride) {
+ const initialPosition = Cartesian3_default.fromArray(result, i, scratchPosition2);
+ if (isNaN(initialPosition.x) || isNaN(initialPosition.y) || isNaN(initialPosition.z)) {
+ continue;
+ }
+ const transformedPosition = Matrix4_default.multiplyByPoint(
+ modelMatrix,
+ initialPosition,
+ initialPosition
+ );
+ const projectedPosition2 = SceneTransforms_default.computeActualWgs84Position(
+ frameState,
+ transformedPosition,
+ transformedPosition
+ );
+ const relativePosition = Cartesian3_default.subtract(
+ projectedPosition2,
+ referencePoint,
+ projectedPosition2
+ );
+ result[i] = relativePosition.x;
+ result[i + 1] = relativePosition.y;
+ result[i + 2] = relativePosition.z;
+ }
+ return result;
+}
+function createPositionBufferFor2D(positionAttribute, modelMatrix, boundingSphere2D, frameState) {
+ const frameStateCV = clone_default(frameState);
+ frameStateCV.mode = SceneMode_default.COLUMBUS_VIEW;
+ const referencePoint = boundingSphere2D.center;
+ const projectedPositions = createPositionsTypedArrayFor2D(
+ positionAttribute,
+ modelMatrix,
+ referencePoint,
+ frameStateCV
+ );
+ const buffer = Buffer_default.createVertexBuffer({
+ context: frameState.context,
+ typedArray: projectedPositions,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ buffer.vertexArrayDestroyable = false;
+ return buffer;
+}
+var SceneMode2DPipelineStage_default = SceneMode2DPipelineStage;
+
+// Source/Shaders/Model/SkinningStageVS.js
+var SkinningStageVS_default = "void skinningStage(inout ProcessedAttributes attributes) \n{\n mat4 skinningMatrix = getSkinningMatrix();\n mat3 skinningMatrixMat3 = mat3(skinningMatrix);\n\n vec4 positionMC = vec4(attributes.positionMC, 1.0);\n attributes.positionMC = vec3(skinningMatrix * positionMC);\n\n #ifdef HAS_NORMALS\n vec3 normalMC = attributes.normalMC;\n attributes.normalMC = skinningMatrixMat3 * normalMC;\n #endif\n\n #ifdef HAS_TANGENTS\n vec3 tangentMC = attributes.tangentMC;\n attributes.tangentMC = skinningMatrixMat3 * tangentMC;\n #endif\n}";
+
+// Source/Scene/Model/SkinningPipelineStage.js
+var SkinningPipelineStage = {
+ name: "SkinningPipelineStage",
+ FUNCTION_ID_GET_SKINNING_MATRIX: "getSkinningMatrix",
+ FUNCTION_SIGNATURE_GET_SKINNING_MATRIX: "mat4 getSkinningMatrix()"
+};
+SkinningPipelineStage.process = function(renderResources, primitive) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine("HAS_SKINNING", void 0, ShaderDestination_default.VERTEX);
+ addGetSkinningMatrixFunction(shaderBuilder, primitive);
+ const runtimeNode = renderResources.runtimeNode;
+ const jointMatrices = runtimeNode.computedJointMatrices;
+ shaderBuilder.addUniform(
+ "mat4",
+ `u_jointMatrices[${jointMatrices.length}]`,
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addVertexLines(SkinningStageVS_default);
+ const uniformMap2 = {
+ u_jointMatrices: function() {
+ return runtimeNode.computedJointMatrices;
+ }
+ };
+ renderResources.uniformMap = combine_default(uniformMap2, renderResources.uniformMap);
+};
+function getMaximumAttributeSetIndex(primitive) {
+ let setIndex = -1;
+ const attributes = primitive.attributes;
+ const length3 = attributes.length;
+ for (let i = 0; i < length3; i++) {
+ const attribute = attributes[i];
+ const isJointsOrWeights = attribute.semantic === VertexAttributeSemantic_default.JOINTS || attribute.semantic === VertexAttributeSemantic_default.WEIGHTS;
+ if (!isJointsOrWeights) {
+ continue;
+ }
+ setIndex = Math.max(setIndex, attribute.setIndex);
+ }
+ return setIndex;
+}
+function addGetSkinningMatrixFunction(shaderBuilder, primitive) {
+ shaderBuilder.addFunction(
+ SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,
+ SkinningPipelineStage.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,
+ ShaderDestination_default.VERTEX
+ );
+ const initialLine = "mat4 skinnedMatrix = mat4(0);";
+ shaderBuilder.addFunctionLines(
+ SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,
+ [initialLine]
+ );
+ let setIndex;
+ let componentIndex;
+ const componentStrings = ["x", "y", "z", "w"];
+ const maximumSetIndex = getMaximumAttributeSetIndex(primitive);
+ for (setIndex = 0; setIndex <= maximumSetIndex; setIndex++) {
+ for (componentIndex = 0; componentIndex <= 3; componentIndex++) {
+ const component = componentStrings[componentIndex];
+ const line = `skinnedMatrix += a_weights_${setIndex}.${component} * u_jointMatrices[int(a_joints_${setIndex}.${component})];`;
+ shaderBuilder.addFunctionLines(
+ SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,
+ [line]
+ );
+ }
+ }
+ const returnLine = "return skinnedMatrix;";
+ shaderBuilder.addFunctionLines(
+ SkinningPipelineStage.FUNCTION_ID_GET_SKINNING_MATRIX,
+ [returnLine]
+ );
+}
+var SkinningPipelineStage_default = SkinningPipelineStage;
+
+// Source/Core/WireframeIndexGenerator.js
+var WireframeIndexGenerator = {};
+function createWireframeFromTriangles(vertexCount) {
+ const wireframeIndices = IndexDatatype_default.createTypedArray(
+ vertexCount,
+ vertexCount * 2
+ );
+ const length3 = vertexCount;
+ let index = 0;
+ for (let i = 0; i < length3; i += 3) {
+ wireframeIndices[index++] = i;
+ wireframeIndices[index++] = i + 1;
+ wireframeIndices[index++] = i + 1;
+ wireframeIndices[index++] = i + 2;
+ wireframeIndices[index++] = i + 2;
+ wireframeIndices[index++] = i;
+ }
+ return wireframeIndices;
+}
+function createWireframeFromTriangleIndices(vertexCount, originalIndices) {
+ const originalIndicesCount = originalIndices.length;
+ const wireframeIndices = IndexDatatype_default.createTypedArray(
+ vertexCount,
+ originalIndicesCount * 2
+ );
+ let index = 0;
+ for (let i = 0; i < originalIndicesCount; i += 3) {
+ const point0 = originalIndices[i];
+ const point1 = originalIndices[i + 1];
+ const point2 = originalIndices[i + 2];
+ wireframeIndices[index++] = point0;
+ wireframeIndices[index++] = point1;
+ wireframeIndices[index++] = point1;
+ wireframeIndices[index++] = point2;
+ wireframeIndices[index++] = point2;
+ wireframeIndices[index++] = point0;
+ }
+ return wireframeIndices;
+}
+function createWireframeFromTriangleStrip(vertexCount) {
+ const numberOfTriangles = vertexCount - 2;
+ const wireframeIndicesCount = 2 + numberOfTriangles * 4;
+ const wireframeIndices = IndexDatatype_default.createTypedArray(
+ vertexCount,
+ wireframeIndicesCount
+ );
+ let index = 0;
+ wireframeIndices[index++] = 0;
+ wireframeIndices[index++] = 1;
+ for (let i = 0; i < numberOfTriangles; i++) {
+ wireframeIndices[index++] = i + 1;
+ wireframeIndices[index++] = i + 2;
+ wireframeIndices[index++] = i + 2;
+ wireframeIndices[index++] = i;
+ }
+ return wireframeIndices;
+}
+function createWireframeFromTriangleStripIndices(vertexCount, originalIndices) {
+ const originalIndicesCount = originalIndices.length;
+ const numberOfTriangles = originalIndicesCount - 2;
+ const wireframeIndicesCount = 2 + numberOfTriangles * 4;
+ const wireframeIndices = IndexDatatype_default.createTypedArray(
+ vertexCount,
+ wireframeIndicesCount
+ );
+ let index = 0;
+ wireframeIndices[index++] = originalIndices[0];
+ wireframeIndices[index++] = originalIndices[1];
+ for (let i = 0; i < numberOfTriangles; i++) {
+ const point0 = originalIndices[i];
+ const point1 = originalIndices[i + 1];
+ const point2 = originalIndices[i + 2];
+ wireframeIndices[index++] = point1;
+ wireframeIndices[index++] = point2;
+ wireframeIndices[index++] = point2;
+ wireframeIndices[index++] = point0;
+ }
+ return wireframeIndices;
+}
+function createWireframeFromTriangleFan(vertexCount) {
+ const numberOfTriangles = vertexCount - 2;
+ const wireframeIndicesCount = 2 + numberOfTriangles * 4;
+ const wireframeIndices = IndexDatatype_default.createTypedArray(
+ vertexCount,
+ wireframeIndicesCount
+ );
+ let index = 0;
+ wireframeIndices[index++] = 0;
+ wireframeIndices[index++] = 1;
+ for (let i = 0; i < numberOfTriangles; i++) {
+ wireframeIndices[index++] = i + 1;
+ wireframeIndices[index++] = i + 2;
+ wireframeIndices[index++] = i + 2;
+ wireframeIndices[index++] = 0;
+ }
+ return wireframeIndices;
+}
+function createWireframeFromTriangleFanIndices(vertexCount, originalIndices) {
+ const originalIndicesCount = originalIndices.length;
+ const numberOfTriangles = originalIndicesCount - 2;
+ const wireframeIndicesCount = 2 + numberOfTriangles * 4;
+ const wireframeIndices = IndexDatatype_default.createTypedArray(
+ vertexCount,
+ wireframeIndicesCount
+ );
+ let index = 0;
+ const firstPoint = originalIndices[0];
+ wireframeIndices[index++] = firstPoint;
+ wireframeIndices[index++] = originalIndices[1];
+ for (let i = 0; i < numberOfTriangles; i++) {
+ const point1 = originalIndices[i + 1];
+ const point2 = originalIndices[i + 2];
+ wireframeIndices[index++] = point1;
+ wireframeIndices[index++] = point2;
+ wireframeIndices[index++] = point2;
+ wireframeIndices[index++] = firstPoint;
+ }
+ return wireframeIndices;
+}
+WireframeIndexGenerator.createWireframeIndices = function(primitiveType, vertexCount, originalIndices) {
+ const hasOriginalIndices = defined_default(originalIndices);
+ if (primitiveType === PrimitiveType_default.TRIANGLES) {
+ return hasOriginalIndices ? createWireframeFromTriangleIndices(vertexCount, originalIndices) : createWireframeFromTriangles(vertexCount);
+ }
+ if (primitiveType === PrimitiveType_default.TRIANGLE_STRIP) {
+ return hasOriginalIndices ? createWireframeFromTriangleStripIndices(vertexCount, originalIndices) : createWireframeFromTriangleStrip(vertexCount);
+ }
+ if (primitiveType === PrimitiveType_default.TRIANGLE_FAN) {
+ return hasOriginalIndices ? createWireframeFromTriangleFanIndices(vertexCount, originalIndices) : createWireframeFromTriangleFan(vertexCount);
+ }
+ return void 0;
+};
+WireframeIndexGenerator.getWireframeIndicesCount = function(primitiveType, originalCount) {
+ if (primitiveType === PrimitiveType_default.TRIANGLES) {
+ return originalCount * 2;
+ }
+ if (primitiveType === PrimitiveType_default.TRIANGLE_STRIP || primitiveType === PrimitiveType_default.TRIANGLE_FAN) {
+ const numberOfTriangles = originalCount - 2;
+ return 2 + numberOfTriangles * 4;
+ }
+ return originalCount;
+};
+var WireframeIndexGenerator_default = WireframeIndexGenerator;
+
+// Source/Scene/Model/WireframePipelineStage.js
+var WireframePipelineStage = {
+ name: "WireframePipelineStage"
+};
+WireframePipelineStage.process = function(renderResources, primitive, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine(
+ "HAS_WIREFRAME",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ const model = renderResources.model;
+ const wireframeIndexBuffer = createWireframeIndexBuffer(
+ primitive,
+ renderResources.indices,
+ frameState
+ );
+ model._pipelineResources.push(wireframeIndexBuffer);
+ renderResources.wireframeIndexBuffer = wireframeIndexBuffer;
+ const hasCpuCopy = false;
+ model.statistics.addBuffer(wireframeIndexBuffer, hasCpuCopy);
+ const originalPrimitiveType = renderResources.primitiveType;
+ const originalCount = renderResources.count;
+ renderResources.primitiveType = PrimitiveType_default.LINES;
+ renderResources.count = WireframeIndexGenerator_default.getWireframeIndicesCount(
+ originalPrimitiveType,
+ originalCount
+ );
+};
+function createWireframeIndexBuffer(primitive, indices2, frameState) {
+ const positionAttribute = ModelUtility_default.getAttributeBySemantic(
+ primitive,
+ VertexAttributeSemantic_default.POSITION
+ );
+ const vertexCount = positionAttribute.count;
+ const webgl2 = frameState.context.webgl2;
+ let originalIndices;
+ if (defined_default(indices2)) {
+ const indicesBuffer = indices2.buffer;
+ const indicesCount = indices2.count;
+ if (defined_default(indicesBuffer) && webgl2) {
+ const useUint8Array = indicesBuffer.sizeInBytes === indicesCount;
+ originalIndices = useUint8Array ? new Uint8Array(indicesCount) : IndexDatatype_default.createTypedArray(vertexCount, indicesCount);
+ indicesBuffer.getBufferData(originalIndices);
+ } else {
+ originalIndices = indices2.typedArray;
+ }
+ }
+ const primitiveType = primitive.primitiveType;
+ const wireframeIndices = WireframeIndexGenerator_default.createWireframeIndices(
+ primitiveType,
+ vertexCount,
+ originalIndices
+ );
+ const indexDatatype = IndexDatatype_default.fromSizeInBytes(
+ wireframeIndices.BYTES_PER_ELEMENT
+ );
+ return Buffer_default.createIndexBuffer({
+ context: frameState.context,
+ typedArray: wireframeIndices,
+ usage: BufferUsage_default.STATIC_DRAW,
+ indexDatatype
+ });
+}
+var WireframePipelineStage_default = WireframePipelineStage;
+
+// Source/Scene/Model/ModelRuntimePrimitive.js
+function ModelRuntimePrimitive(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const primitive = options.primitive;
+ const node = options.node;
+ const model = options.model;
+ Check_default.typeOf.object("options.primitive", primitive);
+ Check_default.typeOf.object("options.node", node);
+ Check_default.typeOf.object("options.model", model);
+ this.primitive = primitive;
+ this.node = node;
+ this.model = model;
+ this.pipelineStages = [];
+ this.drawCommand = void 0;
+ this.boundingSphere = void 0;
+ this.boundingSphere2D = void 0;
+ this.positionBuffer2D = void 0;
+ this.batchLengths = void 0;
+ this.batchOffsets = void 0;
+ this.updateStages = [];
+}
+ModelRuntimePrimitive.prototype.configurePipeline = function(frameState) {
+ const pipelineStages = this.pipelineStages;
+ pipelineStages.length = 0;
+ const primitive = this.primitive;
+ const node = this.node;
+ const model = this.model;
+ const customShader = model.customShader;
+ const style = model.style;
+ const useWebgl2 = frameState.context.webgl2;
+ const mode2 = frameState.mode;
+ const use2D = mode2 !== SceneMode_default.SCENE3D && !frameState.scene3DOnly && model._projectTo2D;
+ const hasMorphTargets = defined_default(primitive.morphTargets) && primitive.morphTargets.length > 0;
+ const hasSkinning = defined_default(node.skin);
+ const hasCustomShader = defined_default(customShader);
+ const hasCustomFragmentShader = hasCustomShader && defined_default(customShader.fragmentShaderText);
+ const materialsEnabled = !hasCustomFragmentShader || customShader.mode !== CustomShaderMode_default.REPLACE_MATERIAL;
+ const hasQuantization = ModelUtility_default.hasQuantizedAttributes(
+ primitive.attributes
+ );
+ const generateWireframeIndices = model.debugWireframe && PrimitiveType_default.isTriangles(primitive.primitiveType) && (model._enableDebugWireframe || useWebgl2);
+ const pointCloudShading = model.pointCloudShading;
+ const hasAttenuation = defined_default(pointCloudShading) && pointCloudShading.attenuation;
+ const hasPointCloudBackFaceCulling = defined_default(pointCloudShading) && pointCloudShading.backFaceCulling;
+ const hasPointCloudStyle = primitive.primitiveType === PrimitiveType_default.POINTS && (defined_default(style) || hasAttenuation || hasPointCloudBackFaceCulling);
+ const hasOutlines = model._enableShowOutline && defined_default(primitive.outlineCoordinates);
+ const featureIdFlags = inspectFeatureIds(model, node, primitive);
+ const hasClassification = defined_default(model.classificationType);
+ if (use2D) {
+ pipelineStages.push(SceneMode2DPipelineStage_default);
+ }
+ pipelineStages.push(GeometryPipelineStage_default);
+ if (generateWireframeIndices) {
+ pipelineStages.push(WireframePipelineStage_default);
+ }
+ if (hasClassification) {
+ pipelineStages.push(ClassificationPipelineStage_default);
+ }
+ if (hasMorphTargets) {
+ pipelineStages.push(MorphTargetsPipelineStage_default);
+ }
+ if (hasSkinning) {
+ pipelineStages.push(SkinningPipelineStage_default);
+ }
+ if (hasPointCloudStyle) {
+ pipelineStages.push(PointCloudStylingPipelineStage_default);
+ }
+ if (hasQuantization) {
+ pipelineStages.push(DequantizationPipelineStage_default);
+ }
+ if (materialsEnabled) {
+ pipelineStages.push(MaterialPipelineStage_default);
+ }
+ pipelineStages.push(FeatureIdPipelineStage_default);
+ pipelineStages.push(MetadataPipelineStage_default);
+ if (featureIdFlags.hasPropertyTable) {
+ pipelineStages.push(SelectedFeatureIdPipelineStage_default);
+ pipelineStages.push(BatchTexturePipelineStage_default);
+ pipelineStages.push(CPUStylingPipelineStage_default);
+ }
+ if (hasCustomShader) {
+ pipelineStages.push(CustomShaderPipelineStage_default);
+ }
+ pipelineStages.push(LightingPipelineStage_default);
+ if (model.allowPicking) {
+ pipelineStages.push(PickingPipelineStage_default);
+ }
+ if (hasOutlines) {
+ pipelineStages.push(PrimitiveOutlinePipelineStage_default);
+ }
+ pipelineStages.push(AlphaPipelineStage_default);
+ pipelineStages.push(PrimitiveStatisticsPipelineStage_default);
+ return;
+};
+function inspectFeatureIds(model, node, primitive) {
+ let featureIds;
+ if (defined_default(node.instances)) {
+ featureIds = ModelUtility_default.getFeatureIdsByLabel(
+ node.instances.featureIds,
+ model.instanceFeatureIdLabel
+ );
+ if (defined_default(featureIds)) {
+ return {
+ hasFeatureIds: true,
+ hasPropertyTable: defined_default(featureIds.propertyTableId)
+ };
+ }
+ }
+ featureIds = ModelUtility_default.getFeatureIdsByLabel(
+ primitive.featureIds,
+ model.featureIdLabel
+ );
+ if (defined_default(featureIds)) {
+ return {
+ hasFeatureIds: true,
+ hasPropertyTable: defined_default(featureIds.propertyTableId)
+ };
+ }
+ return {
+ hasFeatureIds: false,
+ hasPropertyTable: false
+ };
+}
+var ModelRuntimePrimitive_default = ModelRuntimePrimitive;
+
+// Source/Scene/Model/ModelSkin.js
+function ModelSkin(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.typeOf.object("options.skin", options.skin);
+ Check_default.typeOf.object("options.sceneGraph", options.sceneGraph);
+ this._sceneGraph = options.sceneGraph;
+ const skin = options.skin;
+ this._skin = skin;
+ this._inverseBindMatrices = void 0;
+ this._joints = [];
+ this._jointMatrices = [];
+ initialize17(this);
+}
+Object.defineProperties(ModelSkin.prototype, {
+ skin: {
+ get: function() {
+ return this._skin;
+ }
+ },
+ sceneGraph: {
+ get: function() {
+ return this._sceneGraph;
+ }
+ },
+ inverseBindMatrices: {
+ get: function() {
+ return this._inverseBindMatrices;
+ }
+ },
+ joints: {
+ get: function() {
+ return this._joints;
+ }
+ },
+ jointMatrices: {
+ get: function() {
+ return this._jointMatrices;
+ }
+ }
+});
+function initialize17(runtimeSkin) {
+ const skin = runtimeSkin.skin;
+ const inverseBindMatrices = skin.inverseBindMatrices;
+ runtimeSkin._inverseBindMatrices = inverseBindMatrices;
+ const joints = skin.joints;
+ const length3 = joints.length;
+ const runtimeNodes = runtimeSkin.sceneGraph._runtimeNodes;
+ const runtimeJoints = runtimeSkin.joints;
+ const runtimeJointMatrices = runtimeSkin._jointMatrices;
+ for (let i = 0; i < length3; i++) {
+ const jointIndex = joints[i].index;
+ const runtimeNode = runtimeNodes[jointIndex];
+ runtimeJoints.push(runtimeNode);
+ const inverseBindMatrix = inverseBindMatrices[i];
+ const jointMatrix = computeJointMatrix(
+ runtimeNode,
+ inverseBindMatrix,
+ new Matrix4_default()
+ );
+ runtimeJointMatrices.push(jointMatrix);
+ }
+}
+function computeJointMatrix(joint, inverseBindMatrix, result) {
+ const jointWorldTransform = Matrix4_default.multiplyTransformation(
+ joint.transformToRoot,
+ joint.transform,
+ result
+ );
+ result = Matrix4_default.multiplyTransformation(
+ jointWorldTransform,
+ inverseBindMatrix,
+ result
+ );
+ return result;
+}
+ModelSkin.prototype.updateJointMatrices = function() {
+ const jointMatrices = this._jointMatrices;
+ const length3 = jointMatrices.length;
+ for (let i = 0; i < length3; i++) {
+ const joint = this.joints[i];
+ const inverseBindMatrix = this.inverseBindMatrices[i];
+ jointMatrices[i] = computeJointMatrix(
+ joint,
+ inverseBindMatrix,
+ jointMatrices[i]
+ );
+ }
+};
+var ModelSkin_default = ModelSkin;
+
+// Source/Scene/Model/ModelAlphaOptions.js
+function ModelAlphaOptions() {
+ this.pass = void 0;
+ this.alphaCutoff = void 0;
+}
+var ModelAlphaOptions_default = ModelAlphaOptions;
+
+// Source/Scene/Model/ModelRenderResources.js
+function ModelRenderResources(model) {
+ Check_default.typeOf.object("model", model);
+ this.shaderBuilder = new ShaderBuilder_default();
+ this.model = model;
+ this.uniformMap = {};
+ this.alphaOptions = new ModelAlphaOptions_default();
+ this.renderStateOptions = RenderState_default.getState(
+ RenderState_default.fromCache({
+ depthTest: {
+ enabled: true,
+ func: DepthFunction_default.LESS_OR_EQUAL
+ }
+ })
+ );
+ this.hasSilhouette = false;
+ this.hasSkipLevelOfDetail = false;
+}
+var ModelRenderResources_default = ModelRenderResources;
+
+// Source/Shaders/Model/ModelSilhouetteStageFS.js
+var ModelSilhouetteStageFS_default = "void silhouetteStage(inout vec4 color) {\n if(model_silhouettePass) {\n color = czm_gammaCorrect(model_silhouetteColor);\n }\n}";
+
+// Source/Shaders/Model/ModelSilhouetteStageVS.js
+var ModelSilhouetteStageVS_default = "void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {\n #ifdef HAS_NORMALS\n if(model_silhouettePass) {\n vec3 normal = normalize(czm_normal3D * attributes.normalMC);\n normal.x *= czm_projection[0][0];\n normal.y *= czm_projection[1][1];\n positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;\n }\n #endif\n}\n";
+
+// Source/Scene/Model/ModelSilhouettePipelineStage.js
+var ModelSilhouettePipelineStage = {
+ name: "ModelSilhouettePipelineStage"
+};
+ModelSilhouettePipelineStage.silhouettesLength = 0;
+ModelSilhouettePipelineStage.process = function(renderResources, model, frameState) {
+ if (!defined_default(model._silhouetteId)) {
+ model._silhouetteId = ++ModelSilhouettePipelineStage.silhouettesLength;
+ }
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine("HAS_SILHOUETTE", void 0, ShaderDestination_default.BOTH);
+ shaderBuilder.addVertexLines(ModelSilhouetteStageVS_default);
+ shaderBuilder.addFragmentLines(ModelSilhouetteStageFS_default);
+ shaderBuilder.addUniform(
+ "vec4",
+ "model_silhouetteColor",
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addUniform(
+ "float",
+ "model_silhouetteSize",
+ ShaderDestination_default.VERTEX
+ );
+ shaderBuilder.addUniform(
+ "bool",
+ "model_silhouettePass",
+ ShaderDestination_default.BOTH
+ );
+ const uniformMap2 = {
+ model_silhouetteColor: function() {
+ return model.silhouetteColor;
+ },
+ model_silhouetteSize: function() {
+ return model.silhouetteSize;
+ },
+ model_silhouettePass: function() {
+ return false;
+ }
+ };
+ renderResources.uniformMap = combine_default(uniformMap2, renderResources.uniformMap);
+ renderResources.hasSilhouette = true;
+};
+var ModelSilhouettePipelineStage_default = ModelSilhouettePipelineStage;
+
+// Source/Shaders/Model/ModelSplitterStageFS.js
+var ModelSplitterStageFS_default = "void modelSplitterStage()\n{\n // Don't split when rendering the shadow map, because it is rendered from\n // the perspective of a totally different camera.\n#ifndef SHADOW_MAP\n if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;\n if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;\n#endif\n}\n";
+
+// Source/Scene/Model/ModelSplitterPipelineStage.js
+var ModelSplitterPipelineStage = {
+ name: "ModelSplitterPipelineStage",
+ SPLIT_DIRECTION_UNIFORM_NAME: "model_splitDirection"
+};
+ModelSplitterPipelineStage.process = function(renderResources, model, frameState) {
+ const shaderBuilder = renderResources.shaderBuilder;
+ shaderBuilder.addDefine(
+ "HAS_MODEL_SPLITTER",
+ void 0,
+ ShaderDestination_default.FRAGMENT
+ );
+ shaderBuilder.addFragmentLines(ModelSplitterStageFS_default);
+ const stageUniforms = {};
+ shaderBuilder.addUniform(
+ "float",
+ ModelSplitterPipelineStage.SPLIT_DIRECTION_UNIFORM_NAME,
+ ShaderDestination_default.FRAGMENT
+ );
+ stageUniforms[ModelSplitterPipelineStage.SPLIT_DIRECTION_UNIFORM_NAME] = function() {
+ return model.splitDirection;
+ };
+ renderResources.uniformMap = combine_default(
+ stageUniforms,
+ renderResources.uniformMap
+ );
+};
+var ModelSplitterPipelineStage_default = ModelSplitterPipelineStage;
+
+// Source/Scene/Model/NodeRenderResources.js
+function NodeRenderResources(modelRenderResources, runtimeNode) {
+ Check_default.typeOf.object("modelRenderResources", modelRenderResources);
+ Check_default.typeOf.object("runtimeNode", runtimeNode);
+ this.model = modelRenderResources.model;
+ this.shaderBuilder = modelRenderResources.shaderBuilder.clone();
+ this.uniformMap = clone_default(modelRenderResources.uniformMap);
+ this.alphaOptions = clone_default(modelRenderResources.alphaOptions);
+ this.renderStateOptions = clone_default(
+ modelRenderResources.renderStateOptions,
+ true
+ );
+ this.hasSilhouette = modelRenderResources.hasSilhouette;
+ this.hasSkipLevelOfDetail = modelRenderResources.hasSkipLevelOfDetail;
+ this.runtimeNode = runtimeNode;
+ this.attributes = [];
+ this.attributeIndex = 1;
+ this.featureIdVertexAttributeSetIndex = 0;
+ this.instanceCount = 0;
+}
+var NodeRenderResources_default = NodeRenderResources;
+
+// Source/Scene/Model/ModelLightingOptions.js
+function ModelLightingOptions(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.lightingModel = defaultValue_default(options.lightingModel, LightingModel_default.UNLIT);
+}
+var ModelLightingOptions_default = ModelLightingOptions;
+
+// Source/Scene/Model/PrimitiveRenderResources.js
+function PrimitiveRenderResources(nodeRenderResources, runtimePrimitive) {
+ Check_default.typeOf.object("nodeRenderResources", nodeRenderResources);
+ Check_default.typeOf.object("runtimePrimitive", runtimePrimitive);
+ this.model = nodeRenderResources.model;
+ this.runtimeNode = nodeRenderResources.runtimeNode;
+ this.attributes = nodeRenderResources.attributes.slice();
+ this.attributeIndex = nodeRenderResources.attributeIndex;
+ this.featureIdVertexAttributeSetIndex = nodeRenderResources.featureIdVertexAttributeSetIndex;
+ this.uniformMap = clone_default(nodeRenderResources.uniformMap);
+ this.alphaOptions = clone_default(nodeRenderResources.alphaOptions);
+ this.renderStateOptions = clone_default(nodeRenderResources.renderStateOptions, true);
+ this.hasSilhouette = nodeRenderResources.hasSilhouette;
+ this.hasSkipLevelOfDetail = nodeRenderResources.hasSkipLevelOfDetail;
+ this.shaderBuilder = nodeRenderResources.shaderBuilder.clone();
+ this.instanceCount = nodeRenderResources.instanceCount;
+ this.runtimePrimitive = runtimePrimitive;
+ const primitive = runtimePrimitive.primitive;
+ this.count = defined_default(primitive.indices) ? primitive.indices.count : ModelUtility_default.getAttributeBySemantic(primitive, "POSITION").count;
+ this.hasPropertyTable = false;
+ this.indices = primitive.indices;
+ this.wireframeIndexBuffer = void 0;
+ this.primitiveType = primitive.primitiveType;
+ const positionMinMax = ModelUtility_default.getPositionMinMax(
+ primitive,
+ this.runtimeNode.instancingTranslationMin,
+ this.runtimeNode.instancingTranslationMax
+ );
+ this.positionMin = Cartesian3_default.clone(positionMinMax.min, new Cartesian3_default());
+ this.positionMax = Cartesian3_default.clone(positionMinMax.max, new Cartesian3_default());
+ this.boundingSphere = BoundingSphere_default.fromCornerPoints(
+ this.positionMin,
+ this.positionMax,
+ new BoundingSphere_default()
+ );
+ this.lightingOptions = new ModelLightingOptions_default();
+ this.pickId = void 0;
+}
+var PrimitiveRenderResources_default = PrimitiveRenderResources;
+
+// Source/Scene/Model/ModelSceneGraph.js
+function ModelSceneGraph(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const components = options.modelComponents;
+ Check_default.typeOf.object("options.model", options.model);
+ Check_default.typeOf.object("options.modelComponents", components);
+ this._model = options.model;
+ this._components = components;
+ this._pipelineStages = [];
+ this._updateStages = [];
+ this._runtimeNodes = [];
+ this._rootNodes = [];
+ this._skinnedNodes = [];
+ this._runtimeSkins = [];
+ this.modelPipelineStages = [];
+ this._boundingSphere = void 0;
+ this._boundingSphere2D = void 0;
+ this._computedModelMatrix = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._computedModelMatrix2D = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._axisCorrectionMatrix = ModelUtility_default.getAxisCorrectionMatrix(
+ components.upAxis,
+ components.forwardAxis,
+ new Matrix4_default()
+ );
+ this._runtimeArticulations = {};
+ initialize18(this);
+}
+Object.defineProperties(ModelSceneGraph.prototype, {
+ components: {
+ get: function() {
+ return this._components;
+ }
+ },
+ computedModelMatrix: {
+ get: function() {
+ return this._computedModelMatrix;
+ }
+ },
+ axisCorrectionMatrix: {
+ get: function() {
+ return this._axisCorrectionMatrix;
+ }
+ },
+ boundingSphere: {
+ get: function() {
+ return this._boundingSphere;
+ }
+ }
+});
+function initialize18(sceneGraph) {
+ const components = sceneGraph._components;
+ const scene = components.scene;
+ const model = sceneGraph._model;
+ const modelMatrix = model.modelMatrix;
+ computeModelMatrix(sceneGraph, modelMatrix);
+ const articulations = components.articulations;
+ const articulationsLength = articulations.length;
+ const runtimeArticulations = sceneGraph._runtimeArticulations;
+ for (let i = 0; i < articulationsLength; i++) {
+ const articulation = articulations[i];
+ const runtimeArticulation = new ModelArticulation_default({
+ articulation,
+ sceneGraph
+ });
+ const name = runtimeArticulation.name;
+ runtimeArticulations[name] = runtimeArticulation;
+ }
+ const nodes = components.nodes;
+ const nodesLength = nodes.length;
+ sceneGraph._runtimeNodes = new Array(nodesLength);
+ const rootNodes = scene.nodes;
+ const rootNodesLength = rootNodes.length;
+ const transformToRoot = Matrix4_default.IDENTITY;
+ for (let i = 0; i < rootNodesLength; i++) {
+ const rootNode = scene.nodes[i];
+ const rootNodeIndex = traverseAndCreateSceneGraph(
+ sceneGraph,
+ rootNode,
+ transformToRoot
+ );
+ sceneGraph._rootNodes.push(rootNodeIndex);
+ }
+ const skins = components.skins;
+ const runtimeSkins = sceneGraph._runtimeSkins;
+ const skinsLength = skins.length;
+ for (let i = 0; i < skinsLength; i++) {
+ const skin = skins[i];
+ runtimeSkins.push(
+ new ModelSkin_default({
+ skin,
+ sceneGraph
+ })
+ );
+ }
+ const skinnedNodes = sceneGraph._skinnedNodes;
+ const skinnedNodesLength = skinnedNodes.length;
+ for (let i = 0; i < skinnedNodesLength; i++) {
+ const skinnedNodeIndex = skinnedNodes[i];
+ const skinnedNode = sceneGraph._runtimeNodes[skinnedNodeIndex];
+ const skin = nodes[skinnedNodeIndex].skin;
+ const skinIndex = skin.index;
+ skinnedNode._runtimeSkin = runtimeSkins[skinIndex];
+ skinnedNode.updateJointMatrices();
+ }
+ sceneGraph.applyArticulations();
+}
+function computeModelMatrix(sceneGraph, modelMatrix) {
+ const components = sceneGraph._components;
+ const model = sceneGraph._model;
+ sceneGraph._computedModelMatrix = Matrix4_default.multiplyTransformation(
+ modelMatrix,
+ components.transform,
+ sceneGraph._computedModelMatrix
+ );
+ sceneGraph._computedModelMatrix = Matrix4_default.multiplyTransformation(
+ sceneGraph._computedModelMatrix,
+ sceneGraph._axisCorrectionMatrix,
+ sceneGraph._computedModelMatrix
+ );
+ sceneGraph._computedModelMatrix = Matrix4_default.multiplyByUniformScale(
+ sceneGraph._computedModelMatrix,
+ model.computedScale,
+ sceneGraph._computedModelMatrix
+ );
+}
+var scratchComputedTranslation = new Cartesian3_default();
+function computeModelMatrix2D(sceneGraph, frameState) {
+ const computedModelMatrix = sceneGraph._computedModelMatrix;
+ const translation3 = Matrix4_default.getTranslation(
+ computedModelMatrix,
+ scratchComputedTranslation
+ );
+ if (!Cartesian3_default.equals(translation3, Cartesian3_default.ZERO)) {
+ sceneGraph._computedModelMatrix2D = Transforms_default.basisTo2D(
+ frameState.mapProjection,
+ computedModelMatrix,
+ sceneGraph._computedModelMatrix2D
+ );
+ } else {
+ const center = sceneGraph.boundingSphere.center;
+ const to2D = Transforms_default.wgs84To2DModelMatrix(
+ frameState.mapProjection,
+ center,
+ sceneGraph._computedModelMatrix2D
+ );
+ sceneGraph._computedModelMatrix2D = Matrix4_default.multiply(
+ to2D,
+ computedModelMatrix,
+ sceneGraph._computedModelMatrix2D
+ );
+ }
+ sceneGraph._boundingSphere2D = BoundingSphere_default.transform(
+ sceneGraph._boundingSphere,
+ sceneGraph._computedModelMatrix2D,
+ sceneGraph._boundingSphere2D
+ );
+}
+function traverseAndCreateSceneGraph(sceneGraph, node, transformToRoot) {
+ const childrenIndices = [];
+ const transform3 = ModelUtility_default.getNodeTransform(node);
+ const childrenLength = node.children.length;
+ for (let i = 0; i < childrenLength; i++) {
+ const childNode = node.children[i];
+ const childNodeTransformToRoot = Matrix4_default.multiplyTransformation(
+ transformToRoot,
+ transform3,
+ new Matrix4_default()
+ );
+ const childIndex = traverseAndCreateSceneGraph(
+ sceneGraph,
+ childNode,
+ childNodeTransformToRoot
+ );
+ childrenIndices.push(childIndex);
+ }
+ const runtimeNode = new ModelRuntimeNode_default({
+ node,
+ transform: transform3,
+ transformToRoot,
+ children: childrenIndices,
+ sceneGraph
+ });
+ const primitivesLength = node.primitives.length;
+ for (let i = 0; i < primitivesLength; i++) {
+ runtimeNode.runtimePrimitives.push(
+ new ModelRuntimePrimitive_default({
+ primitive: node.primitives[i],
+ node,
+ model: sceneGraph._model
+ })
+ );
+ }
+ const index = node.index;
+ sceneGraph._runtimeNodes[index] = runtimeNode;
+ if (defined_default(node.skin)) {
+ sceneGraph._skinnedNodes.push(index);
+ }
+ const name = node.name;
+ if (defined_default(name)) {
+ const model = sceneGraph._model;
+ const publicNode = new ModelNode_default(model, runtimeNode);
+ model._nodesByName[name] = publicNode;
+ }
+ return index;
+}
+var scratchModelPositionMin = new Cartesian3_default();
+var scratchModelPositionMax = new Cartesian3_default();
+var scratchPrimitivePositionMin = new Cartesian3_default();
+var scratchPrimitivePositionMax = new Cartesian3_default();
+ModelSceneGraph.prototype.buildDrawCommands = function(frameState) {
+ const model = this._model;
+ const modelRenderResources = new ModelRenderResources_default(model);
+ model.statistics.clear();
+ this.configurePipeline(frameState);
+ const modelPipelineStages = this.modelPipelineStages;
+ let i, j, k;
+ for (i = 0; i < modelPipelineStages.length; i++) {
+ const modelPipelineStage = modelPipelineStages[i];
+ modelPipelineStage.process(modelRenderResources, model, frameState);
+ }
+ const modelPositionMin = Cartesian3_default.fromElements(
+ Number.MAX_VALUE,
+ Number.MAX_VALUE,
+ Number.MAX_VALUE,
+ scratchModelPositionMin
+ );
+ const modelPositionMax = Cartesian3_default.fromElements(
+ -Number.MAX_VALUE,
+ -Number.MAX_VALUE,
+ -Number.MAX_VALUE,
+ scratchModelPositionMax
+ );
+ for (i = 0; i < this._runtimeNodes.length; i++) {
+ const runtimeNode = this._runtimeNodes[i];
+ if (!defined_default(runtimeNode)) {
+ continue;
+ }
+ runtimeNode.configurePipeline();
+ const nodePipelineStages = runtimeNode.pipelineStages;
+ const nodeRenderResources = new NodeRenderResources_default(
+ modelRenderResources,
+ runtimeNode
+ );
+ for (j = 0; j < nodePipelineStages.length; j++) {
+ const nodePipelineStage = nodePipelineStages[j];
+ nodePipelineStage.process(
+ nodeRenderResources,
+ runtimeNode.node,
+ frameState
+ );
+ }
+ const nodeTransform = runtimeNode.computedTransform;
+ for (j = 0; j < runtimeNode.runtimePrimitives.length; j++) {
+ const runtimePrimitive = runtimeNode.runtimePrimitives[j];
+ runtimePrimitive.configurePipeline(frameState);
+ const primitivePipelineStages = runtimePrimitive.pipelineStages;
+ const primitiveRenderResources = new PrimitiveRenderResources_default(
+ nodeRenderResources,
+ runtimePrimitive
+ );
+ for (k = 0; k < primitivePipelineStages.length; k++) {
+ const primitivePipelineStage = primitivePipelineStages[k];
+ primitivePipelineStage.process(
+ primitiveRenderResources,
+ runtimePrimitive.primitive,
+ frameState
+ );
+ }
+ runtimePrimitive.boundingSphere = BoundingSphere_default.clone(
+ primitiveRenderResources.boundingSphere,
+ new BoundingSphere_default()
+ );
+ const primitivePositionMin = Matrix4_default.multiplyByPoint(
+ nodeTransform,
+ primitiveRenderResources.positionMin,
+ scratchPrimitivePositionMin
+ );
+ const primitivePositionMax = Matrix4_default.multiplyByPoint(
+ nodeTransform,
+ primitiveRenderResources.positionMax,
+ scratchPrimitivePositionMax
+ );
+ Cartesian3_default.minimumByComponent(
+ modelPositionMin,
+ primitivePositionMin,
+ modelPositionMin
+ );
+ Cartesian3_default.maximumByComponent(
+ modelPositionMax,
+ primitivePositionMax,
+ modelPositionMax
+ );
+ const drawCommand = buildDrawCommand_default(
+ primitiveRenderResources,
+ frameState
+ );
+ runtimePrimitive.drawCommand = drawCommand;
+ }
+ }
+ this._boundingSphere = BoundingSphere_default.fromCornerPoints(
+ modelPositionMin,
+ modelPositionMax,
+ new BoundingSphere_default()
+ );
+ this._boundingSphere = BoundingSphere_default.transformWithoutScale(
+ this._boundingSphere,
+ this._axisCorrectionMatrix,
+ this._boundingSphere
+ );
+ this._boundingSphere = BoundingSphere_default.transform(
+ this._boundingSphere,
+ this._components.transform,
+ this._boundingSphere
+ );
+ model._boundingSphere = BoundingSphere_default.transform(
+ this._boundingSphere,
+ model.modelMatrix,
+ model._boundingSphere
+ );
+ model._initialRadius = model._boundingSphere.radius;
+ model._boundingSphere.radius *= model._clampedScale;
+};
+ModelSceneGraph.prototype.configurePipeline = function(frameState) {
+ const modelPipelineStages = this.modelPipelineStages;
+ modelPipelineStages.length = 0;
+ const model = this._model;
+ if (defined_default(model.color)) {
+ modelPipelineStages.push(ModelColorPipelineStage_default);
+ }
+ if (defined_default(model.classificationType)) {
+ return;
+ }
+ if (model.imageBasedLighting.enabled) {
+ modelPipelineStages.push(ImageBasedLightingPipelineStage_default);
+ }
+ if (model.isClippingEnabled()) {
+ modelPipelineStages.push(ModelClippingPlanesPipelineStage_default);
+ }
+ if (model.hasSilhouette(frameState)) {
+ modelPipelineStages.push(ModelSilhouettePipelineStage_default);
+ }
+ if (defined_default(model.splitDirection) && model.splitDirection !== SplitDirection_default.NONE) {
+ modelPipelineStages.push(ModelSplitterPipelineStage_default);
+ }
+ if (ModelType_default.is3DTiles(model.type)) {
+ modelPipelineStages.push(TilesetPipelineStage_default);
+ }
+};
+ModelSceneGraph.prototype.update = function(frameState, updateForAnimations) {
+ let i, j, k;
+ for (i = 0; i < this._runtimeNodes.length; i++) {
+ const runtimeNode = this._runtimeNodes[i];
+ if (!defined_default(runtimeNode)) {
+ continue;
+ }
+ for (j = 0; j < runtimeNode.updateStages.length; j++) {
+ const nodeUpdateStage = runtimeNode.updateStages[j];
+ nodeUpdateStage.update(runtimeNode, this, frameState);
+ }
+ const disableAnimations = frameState.mode !== SceneMode_default.SCENE3D && this._model._projectTo2D;
+ if (updateForAnimations && !disableAnimations) {
+ this.updateJointMatrices();
+ }
+ for (j = 0; j < runtimeNode.runtimePrimitives.length; j++) {
+ const runtimePrimitive = runtimeNode.runtimePrimitives[j];
+ for (k = 0; k < runtimePrimitive.updateStages.length; k++) {
+ const stage = runtimePrimitive.updateStages[k];
+ stage.update(runtimePrimitive, this);
+ }
+ }
+ }
+};
+ModelSceneGraph.prototype.updateModelMatrix = function(modelMatrix, frameState) {
+ computeModelMatrix(this, modelMatrix);
+ if (frameState.mode !== SceneMode_default.SCENE3D) {
+ computeModelMatrix2D(this, frameState);
+ }
+ const rootNodes = this._rootNodes;
+ for (let i = 0; i < rootNodes.length; i++) {
+ const node = this._runtimeNodes[rootNodes[i]];
+ node._transformDirty = true;
+ }
+};
+ModelSceneGraph.prototype.updateJointMatrices = function() {
+ const skinnedNodes = this._skinnedNodes;
+ const length3 = skinnedNodes.length;
+ for (let i = 0; i < length3; i++) {
+ const nodeIndex = skinnedNodes[i];
+ const runtimeNode = this._runtimeNodes[nodeIndex];
+ runtimeNode.updateJointMatrices();
+ }
+};
+function traverseSceneGraph(sceneGraph, runtimeNode, visibleNodesOnly, callback, callbackOptions) {
+ if (visibleNodesOnly && !runtimeNode.show) {
+ return;
+ }
+ const childrenLength = runtimeNode.children.length;
+ for (let i = 0; i < childrenLength; i++) {
+ const childRuntimeNode = runtimeNode.getChild(i);
+ traverseSceneGraph(
+ sceneGraph,
+ childRuntimeNode,
+ visibleNodesOnly,
+ callback,
+ callbackOptions
+ );
+ }
+ const runtimePrimitives = runtimeNode.runtimePrimitives;
+ const runtimePrimitivesLength = runtimePrimitives.length;
+ for (let j = 0; j < runtimePrimitivesLength; j++) {
+ const runtimePrimitive = runtimePrimitives[j];
+ callback(runtimePrimitive, callbackOptions);
+ }
+}
+function forEachRuntimePrimitive(sceneGraph, visibleNodesOnly, callback, callbackOptions) {
+ const rootNodes = sceneGraph._rootNodes;
+ const rootNodesLength = rootNodes.length;
+ for (let i = 0; i < rootNodesLength; i++) {
+ const rootNodeIndex = rootNodes[i];
+ const runtimeNode = sceneGraph._runtimeNodes[rootNodeIndex];
+ traverseSceneGraph(
+ sceneGraph,
+ runtimeNode,
+ visibleNodesOnly,
+ callback,
+ callbackOptions
+ );
+ }
+}
+var scratchBackFaceCullingOptions = {
+ backFaceCulling: void 0
+};
+ModelSceneGraph.prototype.updateBackFaceCulling = function(backFaceCulling) {
+ const backFaceCullingOptions = scratchBackFaceCullingOptions;
+ backFaceCullingOptions.backFaceCulling = backFaceCulling;
+ forEachRuntimePrimitive(
+ this,
+ false,
+ updatePrimitiveBackFaceCulling,
+ backFaceCullingOptions
+ );
+};
+function updatePrimitiveBackFaceCulling(runtimePrimitive, options) {
+ const drawCommand = runtimePrimitive.drawCommand;
+ drawCommand.backFaceCulling = options.backFaceCulling;
+}
+var scratchShadowOptions = {
+ shadowMode: void 0
+};
+ModelSceneGraph.prototype.updateShadows = function(shadowMode) {
+ const shadowOptions = scratchShadowOptions;
+ shadowOptions.shadowMode = shadowMode;
+ forEachRuntimePrimitive(this, false, updatePrimitiveShadows, shadowOptions);
+};
+function updatePrimitiveShadows(runtimePrimitive, options) {
+ const drawCommand = runtimePrimitive.drawCommand;
+ drawCommand.shadows = options.shadowMode;
+}
+var scratchShowBoundingVolumeOptions = {
+ debugShowBoundingVolume: void 0
+};
+ModelSceneGraph.prototype.updateShowBoundingVolume = function(debugShowBoundingVolume2) {
+ const showBoundingVolumeOptions = scratchShowBoundingVolumeOptions;
+ showBoundingVolumeOptions.debugShowBoundingVolume = debugShowBoundingVolume2;
+ forEachRuntimePrimitive(
+ this,
+ false,
+ updatePrimitiveShowBoundingVolume,
+ showBoundingVolumeOptions
+ );
+};
+function updatePrimitiveShowBoundingVolume(runtimePrimitive, options) {
+ const drawCommand = runtimePrimitive.drawCommand;
+ drawCommand.debugShowBoundingVolume = options.debugShowBoundingVolume;
+}
+var scratchSilhouetteCommands = [];
+var scratchPushDrawCommandOptions = {
+ frameState: void 0,
+ hasSilhouette: void 0
+};
+ModelSceneGraph.prototype.pushDrawCommands = function(frameState) {
+ const silhouetteCommands = scratchSilhouetteCommands;
+ silhouetteCommands.length = 0;
+ const pushDrawCommandOptions = scratchPushDrawCommandOptions;
+ pushDrawCommandOptions.hasSilhouette = this._model.hasSilhouette(frameState);
+ pushDrawCommandOptions.frameState = frameState;
+ forEachRuntimePrimitive(
+ this,
+ true,
+ pushPrimitiveDrawCommands,
+ pushDrawCommandOptions
+ );
+ frameState.commandList.push.apply(frameState.commandList, silhouetteCommands);
+};
+function pushPrimitiveDrawCommands(runtimePrimitive, options) {
+ const frameState = options.frameState;
+ const hasSilhouette = options.hasSilhouette;
+ const passes = frameState.passes;
+ const silhouetteCommands = scratchSilhouetteCommands;
+ const primitiveDrawCommand = runtimePrimitive.drawCommand;
+ primitiveDrawCommand.pushCommands(frameState, frameState.commandList);
+ if (hasSilhouette && !passes.pick) {
+ primitiveDrawCommand.pushSilhouetteCommands(frameState, silhouetteCommands);
+ }
+}
+ModelSceneGraph.prototype.setArticulationStage = function(articulationStageKey, value) {
+ const names = articulationStageKey.split(" ");
+ if (names.length !== 2) {
+ return;
+ }
+ const articulationName = names[0];
+ const stageName = names[1];
+ const runtimeArticulation = this._runtimeArticulations[articulationName];
+ if (defined_default(runtimeArticulation)) {
+ runtimeArticulation.setArticulationStage(stageName, value);
+ }
+};
+ModelSceneGraph.prototype.applyArticulations = function() {
+ const runtimeArticulations = this._runtimeArticulations;
+ for (const articulationName in runtimeArticulations) {
+ if (runtimeArticulations.hasOwnProperty(articulationName)) {
+ const articulation = runtimeArticulations[articulationName];
+ articulation.apply();
+ }
+ }
+};
+var ModelSceneGraph_default = ModelSceneGraph;
+
+// Source/Scene/Model/ModelStatistics.js
+function ModelStatistics() {
+ this.pointsLength = 0;
+ this.trianglesLength = 0;
+ this.geometryByteLength = 0;
+ this.texturesByteLength = 0;
+ this.propertyTablesByteLength = 0;
+ this._bufferIdSet = {};
+ this._textureIdSet = {};
+ this._batchTextureIdMap = new AssociativeArray_default();
+}
+Object.defineProperties(ModelStatistics.prototype, {
+ batchTexturesByteLength: {
+ get: function() {
+ const length3 = this._batchTextureIdMap.length;
+ const values = this._batchTextureIdMap.values;
+ let memory = 0;
+ for (let i = 0; i < length3; i++) {
+ memory += values[i].byteLength;
+ }
+ return memory;
+ }
+ }
+});
+ModelStatistics.prototype.clear = function() {
+ this.pointsLength = 0;
+ this.trianglesLength = 0;
+ this.geometryByteLength = 0;
+ this.texturesByteLength = 0;
+ this.propertyTablesByteLength = 0;
+ this._bufferIdSet = {};
+ this._textureIdSet = {};
+ this._batchTextureIdMap.removeAll();
+};
+ModelStatistics.prototype.addBuffer = function(buffer, hasCpuCopy) {
+ Check_default.typeOf.object("buffer", buffer);
+ Check_default.typeOf.bool("hasCpuCopy", hasCpuCopy);
+ if (!this._bufferIdSet.hasOwnProperty(buffer._id)) {
+ const copies = hasCpuCopy ? 2 : 1;
+ this.geometryByteLength += buffer.sizeInBytes * copies;
+ }
+ this._bufferIdSet[buffer._id] = true;
+};
+ModelStatistics.prototype.addTexture = function(texture) {
+ Check_default.typeOf.object("texture", texture);
+ if (!this._textureIdSet.hasOwnProperty(texture._id)) {
+ this.texturesByteLength += texture.sizeInBytes;
+ }
+ this._textureIdSet[texture._id] = true;
+};
+ModelStatistics.prototype.addBatchTexture = function(batchTexture) {
+ Check_default.typeOf.object("batchTexture", batchTexture);
+ if (!this._batchTextureIdMap.contains(batchTexture._id)) {
+ this._batchTextureIdMap.set(batchTexture._id, batchTexture);
+ }
+};
+var ModelStatistics_default = ModelStatistics;
+
+// Source/Scene/Model/PntsLoader.js
+var import_mersenne_twister2 = __toESM(require_mersenne_twister(), 1);
+
+// Source/Scene/PntsParser.js
+var PntsParser = {};
+var sizeOfUint326 = Uint32Array.BYTES_PER_ELEMENT;
+PntsParser.parse = function(arrayBuffer, byteOffset) {
+ byteOffset = defaultValue_default(byteOffset, 0);
+ Check_default.defined("arrayBuffer", arrayBuffer);
+ const uint8Array = new Uint8Array(arrayBuffer);
+ const view = new DataView(arrayBuffer);
+ byteOffset += sizeOfUint326;
+ const version2 = view.getUint32(byteOffset, true);
+ if (version2 !== 1) {
+ throw new RuntimeError_default(
+ `Only Point Cloud tile version 1 is supported. Version ${version2} is not.`
+ );
+ }
+ byteOffset += sizeOfUint326;
+ byteOffset += sizeOfUint326;
+ const featureTableJsonByteLength = view.getUint32(byteOffset, true);
+ if (featureTableJsonByteLength === 0) {
+ throw new RuntimeError_default(
+ "Feature table must have a byte length greater than zero"
+ );
+ }
+ byteOffset += sizeOfUint326;
+ const featureTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint326;
+ const batchTableJsonByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint326;
+ const batchTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint326;
+ const featureTableJson = getJsonFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ featureTableJsonByteLength
+ );
+ byteOffset += featureTableJsonByteLength;
+ const featureTableBinary = new Uint8Array(
+ arrayBuffer,
+ byteOffset,
+ featureTableBinaryByteLength
+ );
+ byteOffset += featureTableBinaryByteLength;
+ let batchTableJson;
+ let batchTableBinary;
+ if (batchTableJsonByteLength > 0) {
+ batchTableJson = getJsonFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ batchTableJsonByteLength
+ );
+ byteOffset += batchTableJsonByteLength;
+ if (batchTableBinaryByteLength > 0) {
+ batchTableBinary = new Uint8Array(
+ arrayBuffer,
+ byteOffset,
+ batchTableBinaryByteLength
+ );
+ byteOffset += batchTableBinaryByteLength;
+ }
+ }
+ const featureTable = new Cesium3DTileFeatureTable_default(
+ featureTableJson,
+ featureTableBinary
+ );
+ const pointsLength = featureTable.getGlobalProperty("POINTS_LENGTH");
+ featureTable.featuresLength = pointsLength;
+ if (!defined_default(pointsLength)) {
+ throw new RuntimeError_default(
+ "Feature table global property: POINTS_LENGTH must be defined"
+ );
+ }
+ let rtcCenter = featureTable.getGlobalProperty(
+ "RTC_CENTER",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ if (defined_default(rtcCenter)) {
+ rtcCenter = Cartesian3_default.unpack(rtcCenter);
+ }
+ const parsedContent = parseDracoProperties(featureTable, batchTableJson);
+ parsedContent.rtcCenter = rtcCenter;
+ parsedContent.pointsLength = pointsLength;
+ if (!parsedContent.hasPositions) {
+ const positions = parsePositions(featureTable);
+ parsedContent.positions = positions;
+ parsedContent.hasPositions = parsedContent.hasPositions || defined_default(positions);
+ }
+ if (!parsedContent.hasPositions) {
+ throw new RuntimeError_default(
+ "Either POSITION or POSITION_QUANTIZED must be defined."
+ );
+ }
+ if (!parsedContent.hasNormals) {
+ const normals = parseNormals(featureTable);
+ parsedContent.normals = normals;
+ parsedContent.hasNormals = parsedContent.hasNormals || defined_default(normals);
+ }
+ if (!parsedContent.hasColors) {
+ const colors = parseColors(featureTable);
+ parsedContent.colors = colors;
+ parsedContent.hasColors = parsedContent.hasColors || defined_default(colors);
+ parsedContent.hasConstantColor = defined_default(parsedContent.constantColor);
+ parsedContent.isTranslucent = defined_default(colors) && colors.isTranslucent;
+ }
+ if (!parsedContent.hasBatchIds) {
+ const batchIds = parseBatchIds(featureTable);
+ parsedContent.batchIds = batchIds;
+ parsedContent.hasBatchIds = parsedContent.hasBatchIds || defined_default(batchIds);
+ }
+ if (parsedContent.hasBatchIds) {
+ const batchLength = featureTable.getGlobalProperty("BATCH_LENGTH");
+ if (!defined_default(batchLength)) {
+ throw new RuntimeError_default(
+ "Global property: BATCH_LENGTH must be defined when BATCH_ID is defined."
+ );
+ }
+ parsedContent.batchLength = batchLength;
+ }
+ if (defined_default(batchTableBinary)) {
+ batchTableBinary = new Uint8Array(batchTableBinary);
+ parsedContent.batchTableJson = batchTableJson;
+ parsedContent.batchTableBinary = batchTableBinary;
+ }
+ return parsedContent;
+};
+function parseDracoProperties(featureTable, batchTableJson) {
+ const featureTableJson = featureTable.json;
+ let dracoBuffer;
+ let dracoFeatureTableProperties;
+ let dracoBatchTableProperties;
+ const featureTableDraco = defined_default(featureTableJson.extensions) ? featureTableJson.extensions["3DTILES_draco_point_compression"] : void 0;
+ const batchTableDraco = defined_default(batchTableJson) && defined_default(batchTableJson.extensions) ? batchTableJson.extensions["3DTILES_draco_point_compression"] : void 0;
+ if (defined_default(batchTableDraco)) {
+ dracoBatchTableProperties = batchTableDraco.properties;
+ }
+ let hasPositions;
+ let hasColors;
+ let hasNormals;
+ let hasBatchIds;
+ let isTranslucent;
+ if (defined_default(featureTableDraco)) {
+ dracoFeatureTableProperties = featureTableDraco.properties;
+ const dracoByteOffset = featureTableDraco.byteOffset;
+ const dracoByteLength = featureTableDraco.byteLength;
+ if (!defined_default(dracoFeatureTableProperties) || !defined_default(dracoByteOffset) || !defined_default(dracoByteLength)) {
+ throw new RuntimeError_default(
+ "Draco properties, byteOffset, and byteLength must be defined"
+ );
+ }
+ dracoBuffer = featureTable.buffer.slice(
+ dracoByteOffset,
+ dracoByteOffset + dracoByteLength
+ );
+ hasPositions = defined_default(dracoFeatureTableProperties.POSITION);
+ hasColors = defined_default(dracoFeatureTableProperties.RGB) || defined_default(dracoFeatureTableProperties.RGBA);
+ hasNormals = defined_default(dracoFeatureTableProperties.NORMAL);
+ hasBatchIds = defined_default(dracoFeatureTableProperties.BATCH_ID);
+ isTranslucent = defined_default(dracoFeatureTableProperties.RGBA);
+ }
+ let draco;
+ if (defined_default(dracoBuffer)) {
+ draco = {
+ buffer: dracoBuffer,
+ featureTableProperties: dracoFeatureTableProperties,
+ batchTableProperties: dracoBatchTableProperties,
+ properties: combine_default(
+ dracoFeatureTableProperties,
+ dracoBatchTableProperties
+ ),
+ dequantizeInShader: true
+ };
+ }
+ return {
+ draco,
+ hasPositions,
+ hasColors,
+ isTranslucent,
+ hasNormals,
+ hasBatchIds
+ };
+}
+function parsePositions(featureTable) {
+ const featureTableJson = featureTable.json;
+ let positions;
+ if (defined_default(featureTableJson.POSITION)) {
+ positions = featureTable.getPropertyArray(
+ "POSITION",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ return {
+ name: VertexAttributeSemantic_default.POSITION,
+ semantic: VertexAttributeSemantic_default.POSITION,
+ typedArray: positions,
+ isQuantized: false,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ type: AttributeType_default.VEC3
+ };
+ } else if (defined_default(featureTableJson.POSITION_QUANTIZED)) {
+ positions = featureTable.getPropertyArray(
+ "POSITION_QUANTIZED",
+ ComponentDatatype_default.UNSIGNED_SHORT,
+ 3
+ );
+ const quantizedVolumeScale = featureTable.getGlobalProperty(
+ "QUANTIZED_VOLUME_SCALE",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ if (!defined_default(quantizedVolumeScale)) {
+ throw new RuntimeError_default(
+ "Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions."
+ );
+ }
+ const quantizedRange = (1 << 16) - 1;
+ const quantizedVolumeOffset = featureTable.getGlobalProperty(
+ "QUANTIZED_VOLUME_OFFSET",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ if (!defined_default(quantizedVolumeOffset)) {
+ throw new RuntimeError_default(
+ "Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions."
+ );
+ }
+ return {
+ name: VertexAttributeSemantic_default.POSITION,
+ semantic: VertexAttributeSemantic_default.POSITION,
+ typedArray: positions,
+ isQuantized: true,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ type: AttributeType_default.VEC3,
+ quantizedRange,
+ quantizedVolumeOffset: Cartesian3_default.unpack(quantizedVolumeOffset),
+ quantizedVolumeScale: Cartesian3_default.unpack(quantizedVolumeScale),
+ quantizedComponentDatatype: ComponentDatatype_default.UNSIGNED_SHORT,
+ quantizedType: AttributeType_default.VEC3
+ };
+ }
+}
+function parseColors(featureTable) {
+ const featureTableJson = featureTable.json;
+ let colors;
+ if (defined_default(featureTableJson.RGBA)) {
+ colors = featureTable.getPropertyArray(
+ "RGBA",
+ ComponentDatatype_default.UNSIGNED_BYTE,
+ 4
+ );
+ return {
+ name: VertexAttributeSemantic_default.COLOR,
+ semantic: VertexAttributeSemantic_default.COLOR,
+ setIndex: 0,
+ typedArray: colors,
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ type: AttributeType_default.VEC4,
+ normalized: true,
+ isRGB565: false,
+ isTranslucent: true
+ };
+ } else if (defined_default(featureTableJson.RGB)) {
+ colors = featureTable.getPropertyArray(
+ "RGB",
+ ComponentDatatype_default.UNSIGNED_BYTE,
+ 3
+ );
+ return {
+ name: "COLOR",
+ semantic: VertexAttributeSemantic_default.COLOR,
+ setIndex: 0,
+ typedArray: colors,
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ type: AttributeType_default.VEC3,
+ normalized: true,
+ isRGB565: false,
+ isTranslucent: false
+ };
+ } else if (defined_default(featureTableJson.RGB565)) {
+ colors = featureTable.getPropertyArray(
+ "RGB565",
+ ComponentDatatype_default.UNSIGNED_SHORT,
+ 1
+ );
+ return {
+ name: "COLOR",
+ semantic: VertexAttributeSemantic_default.COLOR,
+ setIndex: 0,
+ typedArray: colors,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ type: AttributeType_default.VEC3,
+ normalized: false,
+ isRGB565: true,
+ isTranslucent: false
+ };
+ } else if (defined_default(featureTableJson.CONSTANT_RGBA)) {
+ const constantRGBA = featureTable.getGlobalProperty(
+ "CONSTANT_RGBA",
+ ComponentDatatype_default.UNSIGNED_BYTE,
+ 4
+ );
+ const alpha = constantRGBA[3];
+ const constantColor = Color_default.fromBytes(
+ constantRGBA[0],
+ constantRGBA[1],
+ constantRGBA[2],
+ alpha
+ );
+ const isTranslucent = alpha < 255;
+ return {
+ name: VertexAttributeSemantic_default.COLOR,
+ semantic: VertexAttributeSemantic_default.COLOR,
+ setIndex: 0,
+ constantColor,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ type: AttributeType_default.VEC4,
+ isQuantized: false,
+ isTranslucent
+ };
+ }
+ return void 0;
+}
+function parseNormals(featureTable) {
+ const featureTableJson = featureTable.json;
+ let normals;
+ if (defined_default(featureTableJson.NORMAL)) {
+ normals = featureTable.getPropertyArray(
+ "NORMAL",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ return {
+ name: VertexAttributeSemantic_default.NORMAL,
+ semantic: VertexAttributeSemantic_default.NORMAL,
+ typedArray: normals,
+ octEncoded: false,
+ octEncodedZXY: false,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ type: AttributeType_default.VEC3
+ };
+ } else if (defined_default(featureTableJson.NORMAL_OCT16P)) {
+ normals = featureTable.getPropertyArray(
+ "NORMAL_OCT16P",
+ ComponentDatatype_default.UNSIGNED_BYTE,
+ 2
+ );
+ const quantizationBits = 8;
+ return {
+ name: VertexAttributeSemantic_default.NORMAL,
+ semantic: VertexAttributeSemantic_default.NORMAL,
+ typedArray: normals,
+ octEncoded: true,
+ octEncodedZXY: false,
+ quantizedRange: (1 << quantizationBits) - 1,
+ quantizedType: AttributeType_default.VEC2,
+ quantizedComponentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ type: AttributeType_default.VEC3
+ };
+ }
+ return void 0;
+}
+function parseBatchIds(featureTable) {
+ const featureTableJson = featureTable.json;
+ if (defined_default(featureTableJson.BATCH_ID)) {
+ const batchIds = featureTable.getPropertyArray(
+ "BATCH_ID",
+ ComponentDatatype_default.UNSIGNED_SHORT,
+ 1
+ );
+ return {
+ name: VertexAttributeSemantic_default.FEATURE_ID,
+ semantic: VertexAttributeSemantic_default.FEATURE_ID,
+ setIndex: 0,
+ typedArray: batchIds,
+ componentDatatype: ComponentDatatype_default.fromTypedArray(batchIds),
+ type: AttributeType_default.SCALAR
+ };
+ }
+ return void 0;
+}
+var PntsParser_default = PntsParser;
+
+// Source/Scene/Model/PntsLoader.js
+var Components3 = ModelComponents_default.Components;
+var Scene3 = ModelComponents_default.Scene;
+var Node5 = ModelComponents_default.Node;
+var Primitive4 = ModelComponents_default.Primitive;
+var Attribute4 = ModelComponents_default.Attribute;
+var Quantization2 = ModelComponents_default.Quantization;
+var FeatureIdAttribute5 = ModelComponents_default.FeatureIdAttribute;
+var Material5 = ModelComponents_default.Material;
+var MetallicRoughness4 = ModelComponents_default.MetallicRoughness;
+function PntsLoader(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const arrayBuffer = options.arrayBuffer;
+ const byteOffset = defaultValue_default(options.byteOffset, 0);
+ Check_default.typeOf.object("options.arrayBuffer", arrayBuffer);
+ this._arrayBuffer = arrayBuffer;
+ this._byteOffset = byteOffset;
+ this._loadAttributesFor2D = defaultValue_default(options.loadAttributesFor2D, false);
+ this._parsedContent = void 0;
+ this._decodePromise = void 0;
+ this._decodedAttributes = void 0;
+ this._promise = void 0;
+ this._process = function(frameState) {
+ };
+ this._state = ResourceLoaderState_default.UNLOADED;
+ this._buffers = [];
+ this._components = void 0;
+ this._transform = Matrix4_default.IDENTITY;
+}
+if (defined_default(Object.create)) {
+ PntsLoader.prototype = Object.create(ResourceLoader_default.prototype);
+ PntsLoader.prototype.constructor = PntsLoader;
+}
+Object.defineProperties(PntsLoader.prototype, {
+ promise: {
+ get: function() {
+ return this._promise;
+ }
+ },
+ cacheKey: {
+ get: function() {
+ return void 0;
+ }
+ },
+ components: {
+ get: function() {
+ return this._components;
+ }
+ },
+ transform: {
+ get: function() {
+ return this._transform;
+ }
+ }
+});
+PntsLoader.prototype.load = function() {
+ this._parsedContent = PntsParser_default.parse(this._arrayBuffer, this._byteOffset);
+ this._state = ResourceLoaderState_default.PROCESSING;
+ const loader = this;
+ this._promise = new Promise(function(resolve2, reject) {
+ loader._process = function(frameState) {
+ if (loader._state === ResourceLoaderState_default.PROCESSING) {
+ if (defined_default(loader._decodePromise)) {
+ return;
+ }
+ const decodePromise = decodeDraco(loader, frameState.context);
+ if (defined_default(decodePromise)) {
+ decodePromise.then(resolve2).catch(reject);
+ }
+ }
+ };
+ });
+};
+PntsLoader.prototype.process = function(frameState) {
+ this._process(frameState);
+};
+function decodeDraco(loader, context) {
+ const parsedContent = loader._parsedContent;
+ const draco = parsedContent.draco;
+ let decodePromise;
+ if (!defined_default(draco)) {
+ decodePromise = Promise.resolve();
+ } else {
+ decodePromise = DracoLoader_default.decodePointCloud(draco, context);
+ }
+ if (!defined_default(decodePromise)) {
+ return;
+ }
+ loader._decodePromise = decodePromise;
+ return decodePromise.then(function(decodeDracoResult) {
+ if (loader.isDestroyed()) {
+ return;
+ }
+ if (defined_default(decodeDracoResult)) {
+ processDracoAttributes(loader, draco, decodeDracoResult);
+ }
+ makeComponents(loader, context);
+ loader._state = ResourceLoaderState_default.READY;
+ return loader;
+ }).catch(function(error) {
+ loader.unload();
+ loader._state = ResourceLoaderState_default.FAILED;
+ const errorMessage = "Failed to load Draco pnts";
+ return Promise.reject(loader.getError(errorMessage, error));
+ });
+}
+function processDracoAttributes(loader, draco, result) {
+ loader._state = ResourceLoaderState_default.READY;
+ const parsedContent = loader._parsedContent;
+ let attribute;
+ if (defined_default(result.POSITION)) {
+ attribute = {
+ name: "POSITION",
+ semantic: VertexAttributeSemantic_default.POSITION,
+ typedArray: result.POSITION.array,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ type: AttributeType_default.VEC3,
+ isQuantized: false
+ };
+ if (defined_default(result.POSITION.data.quantization)) {
+ const quantization = result.POSITION.data.quantization;
+ const range2 = quantization.range;
+ const quantizedVolumeScale = Cartesian3_default.fromElements(range2, range2, range2);
+ const quantizedVolumeOffset = Cartesian3_default.unpack(quantization.minValues);
+ const quantizedRange = (1 << quantization.quantizationBits) - 1;
+ attribute.isQuantized = true;
+ attribute.quantizedRange = quantizedRange;
+ attribute.quantizedVolumeOffset = quantizedVolumeOffset;
+ attribute.quantizedVolumeScale = quantizedVolumeScale;
+ attribute.quantizedComponentDatatype = quantizedRange <= 255 ? ComponentDatatype_default.UNSIGNED_BYTE : ComponentDatatype_default.UNSIGNED_SHORT;
+ attribute.quantizedType = AttributeType_default.VEC3;
+ }
+ parsedContent.positions = attribute;
+ }
+ if (defined_default(result.NORMAL)) {
+ attribute = {
+ name: "NORMAL",
+ semantic: VertexAttributeSemantic_default.NORMAL,
+ typedArray: result.NORMAL.array,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ type: AttributeType_default.VEC3,
+ isQuantized: false,
+ octEncoded: false,
+ octEncodedZXY: false
+ };
+ if (defined_default(result.NORMAL.data.quantization)) {
+ const octEncodedRange = (1 << result.NORMAL.data.quantization.quantizationBits) - 1;
+ attribute.quantizedRange = octEncodedRange;
+ attribute.octEncoded = true;
+ attribute.octEncodedZXY = true;
+ attribute.quantizedComponentDatatype = ComponentDatatype_default.UNSIGNED_BYTE;
+ attribute.quantizedType = AttributeType_default.VEC2;
+ }
+ parsedContent.normals = attribute;
+ }
+ if (defined_default(result.RGBA)) {
+ parsedContent.colors = {
+ name: "COLOR",
+ semantic: VertexAttributeSemantic_default.COLOR,
+ setIndex: 0,
+ typedArray: result.RGBA.array,
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ type: AttributeType_default.VEC4,
+ normalized: true,
+ isTranslucent: true
+ };
+ } else if (defined_default(result.RGB)) {
+ parsedContent.colors = {
+ name: "COLOR",
+ semantic: VertexAttributeSemantic_default.COLOR,
+ setIndex: 0,
+ typedArray: result.RGB.array,
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ type: AttributeType_default.VEC3,
+ normalized: true,
+ isTranslucent: false
+ };
+ }
+ if (defined_default(result.BATCH_ID)) {
+ const batchIds = result.BATCH_ID.array;
+ parsedContent.batchIds = {
+ name: "_FEATURE_ID",
+ semantic: VertexAttributeSemantic_default.FEATURE_ID,
+ setIndex: 0,
+ typedArray: batchIds,
+ componentDatatype: ComponentDatatype_default.fromTypedArray(batchIds),
+ type: AttributeType_default.SCALAR
+ };
+ }
+ let batchTableJson = parsedContent.batchTableJson;
+ const batchTableProperties = draco.batchTableProperties;
+ for (const name in batchTableProperties) {
+ if (batchTableProperties.hasOwnProperty(name)) {
+ const property = result[name];
+ if (!defined_default(batchTableJson)) {
+ batchTableJson = {};
+ }
+ parsedContent.hasDracoBatchTable = true;
+ const data = property.data;
+ batchTableJson[name] = {
+ byteOffset: data.byteOffset,
+ type: transcodeAttributeType(data.componentsPerAttribute),
+ componentType: transcodeComponentType2(data.componentDatatype),
+ typedArray: property.array
+ };
+ }
+ }
+ parsedContent.batchTableJson = batchTableJson;
+}
+function transcodeAttributeType(componentsPerAttribute) {
+ switch (componentsPerAttribute) {
+ case 1:
+ return "SCALAR";
+ case 2:
+ return "VEC2";
+ case 3:
+ return "VEC3";
+ case 4:
+ return "VEC4";
+ default:
+ throw new DeveloperError_default(
+ "componentsPerAttribute must be a number from 1-4"
+ );
+ }
+}
+function transcodeComponentType2(value) {
+ switch (value) {
+ case WebGLConstants_default.BYTE:
+ return "BYTE";
+ case WebGLConstants_default.UNSIGNED_BYTE:
+ return "UNSIGNED_BYTE";
+ case WebGLConstants_default.SHORT:
+ return "SHORT";
+ case WebGLConstants_default.UNSIGNED_SHORT:
+ return "UNSIGNED_SHORT";
+ case WebGLConstants_default.INT:
+ return "INT";
+ case WebGLConstants_default.UNSIGNED_INT:
+ return "UNSIGNED_INT";
+ case WebGLConstants_default.DOUBLE:
+ return "DOUBLE";
+ case WebGLConstants_default.FLOAT:
+ return "FLOAT";
+ default:
+ throw new DeveloperError_default("value is not a valid WebGL constant");
+ }
+}
+function makeAttribute(loader, attributeInfo, context) {
+ let typedArray = attributeInfo.typedArray;
+ let quantization;
+ if (attributeInfo.octEncoded) {
+ quantization = new Quantization2();
+ quantization.octEncoded = attributeInfo.octEncoded;
+ quantization.octEncodedZXY = attributeInfo.octEncodedZXY;
+ quantization.normalizationRange = attributeInfo.quantizedRange;
+ quantization.type = attributeInfo.quantizedType;
+ quantization.componentDatatype = attributeInfo.quantizedComponentDatatype;
+ }
+ if (attributeInfo.isQuantized) {
+ quantization = new Quantization2();
+ const normalizationRange = attributeInfo.quantizedRange;
+ quantization.normalizationRange = normalizationRange;
+ quantization.quantizedVolumeOffset = Cartesian3_default.ZERO;
+ const quantizedVolumeDimensions = attributeInfo.quantizedVolumeScale;
+ quantization.quantizedVolumeDimensions = quantizedVolumeDimensions;
+ quantization.quantizedVolumeStepSize = Cartesian3_default.divideByScalar(
+ quantizedVolumeDimensions,
+ normalizationRange,
+ new Cartesian3_default()
+ );
+ quantization.componentDatatype = attributeInfo.quantizedComponentDatatype;
+ quantization.type = attributeInfo.quantizedType;
+ }
+ const attribute = new Attribute4();
+ attribute.name = attributeInfo.name;
+ attribute.semantic = attributeInfo.semantic;
+ attribute.setIndex = attributeInfo.setIndex;
+ attribute.componentDatatype = attributeInfo.componentDatatype;
+ attribute.type = attributeInfo.type;
+ attribute.normalized = defaultValue_default(attributeInfo.normalized, false);
+ attribute.min = attributeInfo.min;
+ attribute.max = attributeInfo.max;
+ attribute.quantization = quantization;
+ if (attributeInfo.isRGB565) {
+ typedArray = AttributeCompression_default.decodeRGB565(typedArray);
+ }
+ if (defined_default(attributeInfo.constantColor)) {
+ const packedColor = new Array(4);
+ attribute.constant = Color_default.pack(attributeInfo.constantColor, packedColor);
+ } else {
+ const buffer = Buffer_default.createVertexBuffer({
+ typedArray,
+ context,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ buffer.vertexArrayDestroyable = false;
+ loader._buffers.push(buffer);
+ attribute.buffer = buffer;
+ }
+ const loadAttributesFor2D = loader._loadAttributesFor2D;
+ if (attribute.semantic === VertexAttributeSemantic_default.POSITION && loadAttributesFor2D) {
+ attribute.typedArray = typedArray;
+ }
+ return attribute;
+}
+var randomNumberGenerator2;
+var randomValues;
+function getRandomValues(samplesLength) {
+ if (!defined_default(randomValues)) {
+ randomNumberGenerator2 = new import_mersenne_twister2.default(0);
+ randomValues = new Array(samplesLength);
+ for (let i = 0; i < samplesLength; ++i) {
+ randomValues[i] = randomNumberGenerator2.random();
+ }
+ }
+ return randomValues;
+}
+var scratchMin3 = new Cartesian3_default();
+var scratchMax3 = new Cartesian3_default();
+var scratchPosition3 = new Cartesian3_default();
+function computeApproximateExtrema(positions) {
+ const positionsArray = positions.typedArray;
+ const maximumSamplesLength = 20;
+ const pointsLength = positionsArray.length / 3;
+ const samplesLength = Math.min(pointsLength, maximumSamplesLength);
+ const randomValues3 = getRandomValues(maximumSamplesLength);
+ const maxValue = Number.MAX_VALUE;
+ const minValue = -Number.MAX_VALUE;
+ let min3 = Cartesian3_default.fromElements(maxValue, maxValue, maxValue, scratchMin3);
+ let max3 = Cartesian3_default.fromElements(minValue, minValue, minValue, scratchMax3);
+ let i;
+ let index;
+ let position;
+ if (positions.isQuantized) {
+ min3 = Cartesian3_default.ZERO;
+ max3 = positions.quantizedVolumeScale;
+ } else {
+ for (i = 0; i < samplesLength; ++i) {
+ index = Math.floor(randomValues3[i] * pointsLength);
+ position = Cartesian3_default.unpack(positionsArray, index * 3, scratchPosition3);
+ Cartesian3_default.minimumByComponent(min3, position, min3);
+ Cartesian3_default.maximumByComponent(max3, position, max3);
+ }
+ }
+ positions.min = Cartesian3_default.clone(min3);
+ positions.max = Cartesian3_default.clone(max3);
+}
+var defaultColorAttribute = {
+ name: VertexAttributeSemantic_default.COLOR,
+ semantic: VertexAttributeSemantic_default.COLOR,
+ setIndex: 0,
+ constantColor: Color_default.DARKGRAY,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ type: AttributeType_default.VEC4,
+ isQuantized: false,
+ isTranslucent: false
+};
+function makeAttributes(loader, parsedContent, context) {
+ const attributes = [];
+ let attribute;
+ const positions = parsedContent.positions;
+ if (defined_default(positions)) {
+ computeApproximateExtrema(positions);
+ attribute = makeAttribute(loader, positions, context);
+ attribute.count = parsedContent.pointsLength;
+ attributes.push(attribute);
+ }
+ if (defined_default(parsedContent.normals)) {
+ attribute = makeAttribute(loader, parsedContent.normals, context);
+ attributes.push(attribute);
+ }
+ if (defined_default(parsedContent.colors)) {
+ attribute = makeAttribute(loader, parsedContent.colors, context);
+ attributes.push(attribute);
+ } else {
+ attribute = makeAttribute(loader, defaultColorAttribute, context);
+ attributes.push(attribute);
+ }
+ if (defined_default(parsedContent.batchIds)) {
+ attribute = makeAttribute(loader, parsedContent.batchIds, context);
+ attributes.push(attribute);
+ }
+ return attributes;
+}
+function makeStructuralMetadata(parsedContent, customAttributeOutput) {
+ const batchLength = parsedContent.batchLength;
+ const pointsLength = parsedContent.pointsLength;
+ const batchTableBinary = parsedContent.batchTableBinary;
+ const parseAsPropertyAttributes = !defined_default(parsedContent.batchIds);
+ if (defined_default(batchTableBinary) || parsedContent.hasDracoBatchTable) {
+ const count = defaultValue_default(batchLength, pointsLength);
+ return parseBatchTable_default({
+ count,
+ batchTable: parsedContent.batchTableJson,
+ binaryBody: batchTableBinary,
+ parseAsPropertyAttributes,
+ customAttributeOutput
+ });
+ }
+ return new StructuralMetadata_default({
+ schema: {},
+ propertyTables: []
+ });
+}
+function makeComponents(loader, context) {
+ const parsedContent = loader._parsedContent;
+ const metallicRoughness = new MetallicRoughness4();
+ metallicRoughness.metallicFactor = 0;
+ metallicRoughness.roughnessFactor = 0.9;
+ const material = new Material5();
+ material.metallicRoughness = metallicRoughness;
+ const colors = parsedContent.colors;
+ if (defined_default(colors) && colors.isTranslucent) {
+ material.alphaMode = AlphaMode_default.BLEND;
+ }
+ const isUnlit = !defined_default(parsedContent.normals);
+ material.unlit = isUnlit;
+ const primitive = new Primitive4();
+ primitive.attributes = makeAttributes(loader, parsedContent, context);
+ primitive.primitiveType = PrimitiveType_default.POINTS;
+ primitive.material = material;
+ if (defined_default(parsedContent.batchIds)) {
+ const featureIdAttribute = new FeatureIdAttribute5();
+ featureIdAttribute.propertyTableId = 0;
+ featureIdAttribute.setIndex = 0;
+ featureIdAttribute.positionalLabel = "featureId_0";
+ primitive.featureIds.push(featureIdAttribute);
+ }
+ const node = new Node5();
+ node.index = 0;
+ node.primitives = [primitive];
+ const scene = new Scene3();
+ scene.nodes = [node];
+ scene.upAxis = Axis_default.Z;
+ scene.forwardAxis = Axis_default.X;
+ const components = new Components3();
+ components.scene = scene;
+ components.nodes = [node];
+ const customAttributeOutput = [];
+ components.structuralMetadata = makeStructuralMetadata(
+ parsedContent,
+ customAttributeOutput
+ );
+ if (customAttributeOutput.length > 0) {
+ addPropertyAttributesToPrimitive(
+ loader,
+ primitive,
+ customAttributeOutput,
+ context
+ );
+ }
+ if (defined_default(parsedContent.rtcCenter)) {
+ components.transform = Matrix4_default.multiplyByTranslation(
+ components.transform,
+ parsedContent.rtcCenter,
+ components.transform
+ );
+ }
+ const positions = parsedContent.positions;
+ if (defined_default(positions) && positions.isQuantized) {
+ components.transform = Matrix4_default.multiplyByTranslation(
+ components.transform,
+ positions.quantizedVolumeOffset,
+ components.transform
+ );
+ }
+ loader._components = components;
+ loader._parsedContent = void 0;
+ loader._arrayBuffer = void 0;
+}
+function addPropertyAttributesToPrimitive(loader, primitive, customAttributes, context) {
+ const attributes = primitive.attributes;
+ const length3 = customAttributes.length;
+ for (let i = 0; i < length3; i++) {
+ const customAttribute = customAttributes[i];
+ const buffer = Buffer_default.createVertexBuffer({
+ typedArray: customAttribute.typedArray,
+ context,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ buffer.vertexArrayDestroyable = false;
+ loader._buffers.push(buffer);
+ customAttribute.buffer = buffer;
+ customAttribute.typedArray = void 0;
+ attributes.push(customAttribute);
+ }
+ primitive.propertyAttributeIds = [0];
+}
+PntsLoader.prototype.unload = function() {
+ const buffers = this._buffers;
+ for (let i = 0; i < buffers.length; i++) {
+ buffers[i].destroy();
+ }
+ buffers.length = 0;
+ this._components = void 0;
+ this._parsedContent = void 0;
+ this._arrayBuffer = void 0;
+};
+var PntsLoader_default = PntsLoader;
+
+// Source/Scene/Model/Model.js
+function Model(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.typeOf.object("options.loader", options.loader);
+ Check_default.typeOf.object("options.resource", options.resource);
+ this._loader = options.loader;
+ this._resource = options.resource;
+ this.type = defaultValue_default(options.type, ModelType_default.GLTF);
+ this.modelMatrix = Matrix4_default.clone(
+ defaultValue_default(options.modelMatrix, Matrix4_default.IDENTITY)
+ );
+ this._modelMatrix = Matrix4_default.clone(this.modelMatrix);
+ this._scale = defaultValue_default(options.scale, 1);
+ this._minimumPixelSize = defaultValue_default(options.minimumPixelSize, 0);
+ this._maximumScale = options.maximumScale;
+ this._clampedScale = defined_default(this._maximumScale) ? Math.min(this._scale, this._maximumScale) : this._scale;
+ this._computedScale = this._clampedScale;
+ this._updateModelMatrix = false;
+ this.referenceMatrix = void 0;
+ this._iblReferenceFrameMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY);
+ this._resourcesLoaded = false;
+ this._drawCommandsBuilt = false;
+ this._ready = false;
+ this._customShader = options.customShader;
+ this._content = options.content;
+ this._texturesLoaded = false;
+ this._defaultTexture = void 0;
+ this._activeAnimations = new ModelAnimationCollection_default(this);
+ this._clampAnimations = defaultValue_default(options.clampAnimations, true);
+ this._userAnimationDirty = false;
+ this._id = options.id;
+ this._idDirty = false;
+ this._color = Color_default.clone(options.color);
+ this._colorBlendMode = defaultValue_default(
+ options.colorBlendMode,
+ ColorBlendMode_default.HIGHLIGHT
+ );
+ this._colorBlendAmount = defaultValue_default(options.colorBlendAmount, 0.5);
+ const silhouetteColor = defaultValue_default(options.silhouetteColor, Color_default.RED);
+ this._silhouetteColor = Color_default.clone(silhouetteColor);
+ this._silhouetteSize = defaultValue_default(options.silhouetteSize, 0);
+ this._silhouetteDirty = false;
+ this._silhouetteId = void 0;
+ this._cull = defaultValue_default(options.cull, true);
+ this._opaquePass = defaultValue_default(options.opaquePass, Pass_default.OPAQUE);
+ this._allowPicking = defaultValue_default(options.allowPicking, true);
+ this._show = defaultValue_default(options.show, true);
+ this._style = void 0;
+ this._styleDirty = false;
+ this._styleCommandsNeeded = void 0;
+ let featureIdLabel = defaultValue_default(options.featureIdLabel, "featureId_0");
+ if (typeof featureIdLabel === "number") {
+ featureIdLabel = `featureId_${featureIdLabel}`;
+ }
+ this._featureIdLabel = featureIdLabel;
+ let instanceFeatureIdLabel = defaultValue_default(
+ options.instanceFeatureIdLabel,
+ "instanceFeatureId_0"
+ );
+ if (typeof instanceFeatureIdLabel === "number") {
+ instanceFeatureIdLabel = `instanceFeatureId_${instanceFeatureIdLabel}`;
+ }
+ this._instanceFeatureIdLabel = instanceFeatureIdLabel;
+ this._featureTables = [];
+ this._featureTableId = void 0;
+ this._featureTableIdDirty = true;
+ this._pipelineResources = [];
+ this._modelResources = [];
+ this._pickIds = [];
+ this._boundingSphere = new BoundingSphere_default();
+ this._initialRadius = void 0;
+ this._heightReference = defaultValue_default(
+ options.heightReference,
+ HeightReference_default.NONE
+ );
+ this._heightDirty = this._heightReference !== HeightReference_default.NONE;
+ this._removeUpdateHeightCallback = void 0;
+ this._clampedModelMatrix = void 0;
+ const scene = options.scene;
+ if (defined_default(scene) && defined_default(scene.terrainProviderChanged)) {
+ this._terrainProviderChangedCallback = scene.terrainProviderChanged.addEventListener(
+ function() {
+ this._heightDirty = true;
+ },
+ this
+ );
+ }
+ this._scene = scene;
+ this._distanceDisplayCondition = options.distanceDisplayCondition;
+ const pointCloudShading = new PointCloudShading_default(options.pointCloudShading);
+ this._pointCloudShading = pointCloudShading;
+ this._attenuation = pointCloudShading.attenuation;
+ this._pointCloudBackFaceCulling = pointCloudShading.backFaceCulling;
+ const clippingPlanes = options.clippingPlanes;
+ if (defined_default(clippingPlanes) && clippingPlanes.owner === void 0) {
+ ClippingPlaneCollection_default.setOwner(clippingPlanes, this, "_clippingPlanes");
+ } else {
+ this._clippingPlanes = clippingPlanes;
+ }
+ this._clippingPlanesState = 0;
+ this._clippingPlanesMatrix = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._lightColor = Cartesian3_default.clone(options.lightColor);
+ this._imageBasedLighting = defined_default(options.imageBasedLighting) ? options.imageBasedLighting : new ImageBasedLighting_default();
+ this._shouldDestroyImageBasedLighting = !defined_default(options.imageBasedLighting);
+ this._backFaceCulling = defaultValue_default(options.backFaceCulling, true);
+ this._backFaceCullingDirty = false;
+ this._shadows = defaultValue_default(options.shadows, ShadowMode_default.ENABLED);
+ this._shadowsDirty = false;
+ this._debugShowBoundingVolumeDirty = false;
+ this._debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this._enableDebugWireframe = defaultValue_default(
+ options.enableDebugWireframe,
+ false
+ );
+ this._enableShowOutline = defaultValue_default(options.enableShowOutline, true);
+ this._debugWireframe = defaultValue_default(options.debugWireframe, false);
+ if (this._debugWireframe === true && this._enableDebugWireframe === false && this.type === ModelType_default.GLTF) {
+ oneTimeWarning_default(
+ "model-debug-wireframe-ignored",
+ "enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored."
+ );
+ }
+ let credit = options.credit;
+ if (typeof credit === "string") {
+ credit = new Credit_default(credit);
+ }
+ this._credit = credit;
+ this._resourceCredits = [];
+ this._gltfCredits = [];
+ this._showCreditsOnScreen = defaultValue_default(options.showCreditsOnScreen, false);
+ this._showCreditsOnScreenDirty = true;
+ this._splitDirection = defaultValue_default(
+ options.splitDirection,
+ SplitDirection_default.NONE
+ );
+ this._enableShowOutline = defaultValue_default(options.enableShowOutline, true);
+ this.showOutline = defaultValue_default(options.showOutline, true);
+ this.outlineColor = defaultValue_default(options.outlineColor, Color_default.BLACK);
+ this._classificationType = options.classificationType;
+ this._statistics = new ModelStatistics_default();
+ this._sceneMode = void 0;
+ this._projectTo2D = defaultValue_default(options.projectTo2D, false);
+ this._skipLevelOfDetail = false;
+ this._ignoreCommands = defaultValue_default(options.ignoreCommands, false);
+ this._completeLoad = function(model, frameState) {
+ };
+ this._texturesLoadedPromise = void 0;
+ this._readyPromise = initialize19(this);
+ this._sceneGraph = void 0;
+ this._nodesByName = {};
+ this.pickObject = options.pickObject;
+}
+function createModelFeatureTables(model, structuralMetadata) {
+ const featureTables = model._featureTables;
+ const propertyTables = structuralMetadata.propertyTables;
+ const length3 = propertyTables.length;
+ for (let i = 0; i < length3; i++) {
+ const propertyTable = propertyTables[i];
+ const modelFeatureTable = new ModelFeatureTable_default({
+ model,
+ propertyTable
+ });
+ featureTables.push(modelFeatureTable);
+ }
+ return featureTables;
+}
+function selectFeatureTableId(components, model) {
+ const featureIdLabel = model._featureIdLabel;
+ const instanceFeatureIdLabel = model._instanceFeatureIdLabel;
+ let i, j;
+ let featureIdAttribute;
+ let node;
+ for (i = 0; i < components.nodes.length; i++) {
+ node = components.nodes[i];
+ if (defined_default(node.instances)) {
+ featureIdAttribute = ModelUtility_default.getFeatureIdsByLabel(
+ node.instances.featureIds,
+ instanceFeatureIdLabel
+ );
+ if (defined_default(featureIdAttribute) && defined_default(featureIdAttribute.propertyTableId)) {
+ return featureIdAttribute.propertyTableId;
+ }
+ }
+ }
+ for (i = 0; i < components.nodes.length; i++) {
+ node = components.nodes[i];
+ for (j = 0; j < node.primitives.length; j++) {
+ const primitive = node.primitives[j];
+ const featureIds = ModelUtility_default.getFeatureIdsByLabel(
+ primitive.featureIds,
+ featureIdLabel
+ );
+ if (defined_default(featureIds)) {
+ return featureIds.propertyTableId;
+ }
+ }
+ }
+ if (model._featureTables.length === 1) {
+ return 0;
+ }
+}
+function isColorAlphaDirty(currentColor, previousColor) {
+ if (!defined_default(currentColor) && !defined_default(previousColor)) {
+ return false;
+ }
+ if (defined_default(currentColor) !== defined_default(previousColor)) {
+ return true;
+ }
+ const currentAlpha = currentColor.alpha;
+ const previousAlpha = previousColor.alpha;
+ return Math.floor(currentAlpha) !== Math.floor(previousAlpha) || Math.ceil(currentAlpha) !== Math.ceil(previousAlpha);
+}
+function initialize19(model) {
+ const loader = model._loader;
+ const resource = model._resource;
+ loader.load();
+ const loaderPromise = loader.promise.then(function(loader2) {
+ if (!defined_default(loader2)) {
+ return;
+ }
+ const components = loader2.components;
+ if (!defined_default(components)) {
+ if (loader2.isUnloaded()) {
+ return;
+ }
+ throw new RuntimeError_default("Failed to load model.");
+ }
+ const structuralMetadata = components.structuralMetadata;
+ if (defined_default(structuralMetadata) && structuralMetadata.propertyTableCount > 0) {
+ createModelFeatureTables(model, structuralMetadata);
+ }
+ const sceneGraph = new ModelSceneGraph_default({
+ model,
+ modelComponents: components
+ });
+ model._sceneGraph = sceneGraph;
+ model._gltfCredits = sceneGraph.components.asset.credits;
+ const resourceCredits = model._resource.credits;
+ if (defined_default(resourceCredits)) {
+ const length3 = resourceCredits.length;
+ for (let i = 0; i < length3; i++) {
+ model._resourceCredits.push(resourceCredits[i]);
+ }
+ }
+ model._resourcesLoaded = true;
+ });
+ const texturesLoadedPromise = defaultValue_default(
+ loader.texturesLoadedPromise,
+ Promise.resolve()
+ );
+ model._texturesLoadedPromise = texturesLoadedPromise.then(function() {
+ if (!defined_default(model) || model.isDestroyed()) {
+ return;
+ }
+ model._texturesLoaded = true;
+ if (loader._incrementallyLoadTextures) {
+ model.resetDrawCommands();
+ }
+ }).catch(ModelUtility_default.getFailedLoadFunction(model, "model", resource));
+ const promise = new Promise(function(resolve2, reject) {
+ model._completeLoad = function(model2, frameState) {
+ frameState.afterRender.push(function() {
+ model2._ready = true;
+ resolve2(model2);
+ return true;
+ });
+ };
+ });
+ return loaderPromise.then(function() {
+ return promise;
+ }).catch(ModelUtility_default.getFailedLoadFunction(model, "model", resource));
+}
+Object.defineProperties(Model.prototype, {
+ ready: {
+ get: function() {
+ return this._ready;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ },
+ texturesLoadedPromise: {
+ get: function() {
+ return this._texturesLoadedPromise;
+ }
+ },
+ loader: {
+ get: function() {
+ return this._loader;
+ }
+ },
+ statistics: {
+ get: function() {
+ return this._statistics;
+ }
+ },
+ activeAnimations: {
+ get: function() {
+ return this._activeAnimations;
+ }
+ },
+ clampAnimations: {
+ get: function() {
+ return this._clampAnimations;
+ },
+ set: function(value) {
+ this._clampAnimations = value;
+ }
+ },
+ cull: {
+ get: function() {
+ return this._cull;
+ }
+ },
+ opaquePass: {
+ get: function() {
+ return this._opaquePass;
+ }
+ },
+ pointCloudShading: {
+ get: function() {
+ return this._pointCloudShading;
+ },
+ set: function(value) {
+ Check_default.defined("pointCloudShading", value);
+ if (value !== this._pointCloudShading) {
+ this.resetDrawCommands();
+ }
+ this._pointCloudShading = value;
+ }
+ },
+ customShader: {
+ get: function() {
+ return this._customShader;
+ },
+ set: function(value) {
+ if (value !== this._customShader) {
+ this.resetDrawCommands();
+ }
+ this._customShader = value;
+ }
+ },
+ sceneGraph: {
+ get: function() {
+ return this._sceneGraph;
+ }
+ },
+ content: {
+ get: function() {
+ return this._content;
+ }
+ },
+ heightReference: {
+ get: function() {
+ return this._heightReference;
+ },
+ set: function(value) {
+ if (value !== this._heightReference) {
+ this._heightDirty = true;
+ }
+ this._heightReference = value;
+ }
+ },
+ distanceDisplayCondition: {
+ get: function() {
+ return this._distanceDisplayCondition;
+ },
+ set: function(value) {
+ if (defined_default(value) && value.far <= value.near) {
+ throw new DeveloperError_default("far must be greater than near");
+ }
+ this._distanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ value,
+ this._distanceDisplayCondition
+ );
+ }
+ },
+ structuralMetadata: {
+ get: function() {
+ return this._sceneGraph.components.structuralMetadata;
+ }
+ },
+ featureTableId: {
+ get: function() {
+ return this._featureTableId;
+ },
+ set: function(value) {
+ this._featureTableId = value;
+ }
+ },
+ featureTables: {
+ get: function() {
+ return this._featureTables;
+ },
+ set: function(value) {
+ this._featureTables = value;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ },
+ set: function(value) {
+ if (value !== this._id) {
+ this._idDirty = true;
+ }
+ this._id = value;
+ }
+ },
+ allowPicking: {
+ get: function() {
+ return this._allowPicking;
+ }
+ },
+ style: {
+ get: function() {
+ return this._style;
+ },
+ set: function(value) {
+ this._style = value;
+ this._styleDirty = true;
+ }
+ },
+ color: {
+ get: function() {
+ return this._color;
+ },
+ set: function(value) {
+ if (isColorAlphaDirty(value, this._color)) {
+ this.resetDrawCommands();
+ }
+ this._color = Color_default.clone(value, this._color);
+ }
+ },
+ colorBlendMode: {
+ get: function() {
+ return this._colorBlendMode;
+ },
+ set: function(value) {
+ this._colorBlendMode = value;
+ }
+ },
+ colorBlendAmount: {
+ get: function() {
+ return this._colorBlendAmount;
+ },
+ set: function(value) {
+ this._colorBlendAmount = value;
+ }
+ },
+ silhouetteColor: {
+ get: function() {
+ return this._silhouetteColor;
+ },
+ set: function(value) {
+ if (!Color_default.equals(value, this._silhouetteColor)) {
+ const alphaDirty = isColorAlphaDirty(value, this._silhouetteColor);
+ this._silhouetteDirty = this._silhouetteDirty || alphaDirty;
+ }
+ this._silhouetteColor = Color_default.clone(value, this._silhouetteColor);
+ }
+ },
+ silhouetteSize: {
+ get: function() {
+ return this._silhouetteSize;
+ },
+ set: function(value) {
+ if (value !== this._silhouetteSize) {
+ const currentSize = this._silhouetteSize;
+ const sizeDirty = value > 0 && currentSize === 0 || value === 0 && currentSize > 0;
+ this._silhouetteDirty = this._silhouetteDirty || sizeDirty;
+ this._backFaceCullingDirty = this._backFaceCullingDirty || sizeDirty;
+ }
+ this._silhouetteSize = value;
+ }
+ },
+ boundingSphere: {
+ get: function() {
+ if (!this._ready) {
+ throw new DeveloperError_default(
+ "The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true."
+ );
+ }
+ const modelMatrix = defined_default(this._clampedModelMatrix) ? this._clampedModelMatrix : this.modelMatrix;
+ updateBoundingSphere(this, modelMatrix);
+ return this._boundingSphere;
+ }
+ },
+ debugShowBoundingVolume: {
+ get: function() {
+ return this._debugShowBoundingVolume;
+ },
+ set: function(value) {
+ if (this._debugShowBoundingVolume !== value) {
+ this._debugShowBoundingVolumeDirty = true;
+ }
+ this._debugShowBoundingVolume = value;
+ }
+ },
+ debugWireframe: {
+ get: function() {
+ return this._debugWireframe;
+ },
+ set: function(value) {
+ if (this._debugWireframe !== value) {
+ this.resetDrawCommands();
+ }
+ this._debugWireframe = value;
+ if (this._debugWireframe === true && this._enableDebugWireframe === false && this.type === ModelType_default.GLTF) {
+ oneTimeWarning_default(
+ "model-debug-wireframe-ignored",
+ "enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored."
+ );
+ }
+ }
+ },
+ show: {
+ get: function() {
+ return this._show;
+ },
+ set: function(value) {
+ this._show = value;
+ }
+ },
+ featureIdLabel: {
+ get: function() {
+ return this._featureIdLabel;
+ },
+ set: function(value) {
+ if (typeof value === "number") {
+ value = `featureId_${value}`;
+ }
+ Check_default.typeOf.string("value", value);
+ if (value !== this._featureIdLabel) {
+ this._featureTableIdDirty = true;
+ }
+ this._featureIdLabel = value;
+ }
+ },
+ instanceFeatureIdLabel: {
+ get: function() {
+ return this._instanceFeatureIdLabel;
+ },
+ set: function(value) {
+ if (typeof value === "number") {
+ value = `instanceFeatureId_${value}`;
+ }
+ Check_default.typeOf.string("value", value);
+ if (value !== this._instanceFeatureIdLabel) {
+ this._featureTableIdDirty = true;
+ }
+ this._instanceFeatureIdLabel = value;
+ }
+ },
+ clippingPlanes: {
+ get: function() {
+ return this._clippingPlanes;
+ },
+ set: function(value) {
+ if (value !== this._clippingPlanes) {
+ ClippingPlaneCollection_default.setOwner(value, this, "_clippingPlanes");
+ this.resetDrawCommands();
+ }
+ }
+ },
+ lightColor: {
+ get: function() {
+ return this._lightColor;
+ },
+ set: function(value) {
+ if (defined_default(value) !== defined_default(this._lightColor)) {
+ this.resetDrawCommands();
+ }
+ this._lightColor = Cartesian3_default.clone(value, this._lightColor);
+ }
+ },
+ imageBasedLighting: {
+ get: function() {
+ return this._imageBasedLighting;
+ },
+ set: function(value) {
+ Check_default.typeOf.object("imageBasedLighting", this._imageBasedLighting);
+ if (value !== this._imageBasedLighting) {
+ if (this._shouldDestroyImageBasedLighting && !this._imageBasedLighting.isDestroyed()) {
+ this._imageBasedLighting.destroy();
+ }
+ this._imageBasedLighting = value;
+ this._shouldDestroyImageBasedLighting = false;
+ this.resetDrawCommands();
+ }
+ }
+ },
+ backFaceCulling: {
+ get: function() {
+ return this._backFaceCulling;
+ },
+ set: function(value) {
+ if (value !== this._backFaceCulling) {
+ this._backFaceCullingDirty = true;
+ }
+ this._backFaceCulling = value;
+ }
+ },
+ scale: {
+ get: function() {
+ return this._scale;
+ },
+ set: function(value) {
+ if (value !== this._scale) {
+ this._updateModelMatrix = true;
+ }
+ this._scale = value;
+ }
+ },
+ computedScale: {
+ get: function() {
+ return this._computedScale;
+ }
+ },
+ minimumPixelSize: {
+ get: function() {
+ return this._minimumPixelSize;
+ },
+ set: function(value) {
+ if (value !== this._minimumPixelSize) {
+ this._updateModelMatrix = true;
+ }
+ this._minimumPixelSize = value;
+ }
+ },
+ maximumScale: {
+ get: function() {
+ return this._maximumScale;
+ },
+ set: function(value) {
+ if (value !== this._maximumScale) {
+ this._updateModelMatrix = true;
+ }
+ this._maximumScale = value;
+ }
+ },
+ shadows: {
+ get: function() {
+ return this._shadows;
+ },
+ set: function(value) {
+ if (value !== this._shadows) {
+ this._shadowsDirty = true;
+ }
+ this._shadows = value;
+ }
+ },
+ credit: {
+ get: function() {
+ return this._credit;
+ }
+ },
+ showCreditsOnScreen: {
+ get: function() {
+ return this._showCreditsOnScreen;
+ },
+ set: function(value) {
+ if (this._showCreditsOnScreen !== value) {
+ this._showCreditsOnScreenDirty = true;
+ }
+ this._showCreditsOnScreen = value;
+ }
+ },
+ splitDirection: {
+ get: function() {
+ return this._splitDirection;
+ },
+ set: function(value) {
+ if (this._splitDirection !== value) {
+ this.resetDrawCommands();
+ }
+ this._splitDirection = value;
+ }
+ },
+ classificationType: {
+ get: function() {
+ return this._classificationType;
+ }
+ },
+ pickIds: {
+ get: function() {
+ return this._pickIds;
+ }
+ },
+ styleCommandsNeeded: {
+ get: function() {
+ return this._styleCommandsNeeded;
+ }
+ }
+});
+Model.prototype.getNode = function(name) {
+ if (!this._ready) {
+ throw new DeveloperError_default(
+ "The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true."
+ );
+ }
+ Check_default.typeOf.string("name", name);
+ return this._nodesByName[name];
+};
+Model.prototype.setArticulationStage = function(articulationStageKey, value) {
+ Check_default.typeOf.number("value", value);
+ if (!this._ready) {
+ throw new DeveloperError_default(
+ "The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true."
+ );
+ }
+ this._sceneGraph.setArticulationStage(articulationStageKey, value);
+};
+Model.prototype.applyArticulations = function() {
+ if (!this._ready) {
+ throw new DeveloperError_default(
+ "The model is not loaded. Use Model.readyPromise or wait for Model.ready to be true."
+ );
+ }
+ this._sceneGraph.applyArticulations();
+};
+Model.prototype.makeStyleDirty = function() {
+ this._styleDirty = true;
+};
+Model.prototype.resetDrawCommands = function() {
+ this._drawCommandsBuilt = false;
+};
+var scratchIBLReferenceFrameMatrix4 = new Matrix4_default();
+var scratchIBLReferenceFrameMatrix3 = new Matrix3_default();
+var scratchClippingPlanesMatrix = new Matrix4_default();
+Model.prototype.update = function(frameState) {
+ processLoader(this, frameState);
+ updateCustomShader(this, frameState);
+ updateImageBasedLighting(this, frameState);
+ if (!this._resourcesLoaded || frameState.mode === SceneMode_default.MORPHING) {
+ return;
+ }
+ updateFeatureTableId(this);
+ updateStyle(this);
+ updateFeatureTables(this, frameState);
+ updatePointCloudShading(this);
+ updateSilhouette(this, frameState);
+ updateSkipLevelOfDetail(this, frameState);
+ updateClippingPlanes(this, frameState);
+ updateSceneMode(this, frameState);
+ this._defaultTexture = frameState.context.defaultTexture;
+ buildDrawCommands(this, frameState);
+ updateModelMatrix(this, frameState);
+ updateClamping(this);
+ updateBoundingSphereAndScale(this, frameState);
+ updateReferenceMatrices(this, frameState);
+ const model = this;
+ if (!model._ready) {
+ model._completeLoad(model, frameState);
+ return;
+ }
+ updatePickIds(this);
+ updateSceneGraph(this, frameState);
+ updateShowCreditsOnScreen(this);
+ submitDrawCommands(this, frameState);
+};
+function processLoader(model, frameState) {
+ if (!model._resourcesLoaded || !model._texturesLoaded) {
+ model._loader.process(frameState);
+ }
+}
+function updateCustomShader(model, frameState) {
+ if (defined_default(model._customShader)) {
+ model._customShader.update(frameState);
+ }
+}
+function updateImageBasedLighting(model, frameState) {
+ model._imageBasedLighting.update(frameState);
+ if (model._imageBasedLighting.shouldRegenerateShaders) {
+ model.resetDrawCommands();
+ }
+}
+function updateFeatureTableId(model) {
+ if (!model._featureTableIdDirty) {
+ return;
+ }
+ model._featureTableIdDirty = false;
+ const components = model._sceneGraph.components;
+ const structuralMetadata = components.structuralMetadata;
+ if (defined_default(structuralMetadata) && structuralMetadata.propertyTableCount > 0) {
+ model.featureTableId = selectFeatureTableId(components, model);
+ model._styleDirty = true;
+ model.resetDrawCommands();
+ }
+}
+function updateStyle(model) {
+ if (model._styleDirty) {
+ model.applyStyle(model._style);
+ model._styleDirty = false;
+ }
+}
+function updateFeatureTables(model, frameState) {
+ const featureTables = model._featureTables;
+ const length3 = featureTables.length;
+ let styleCommandsNeededDirty = false;
+ for (let i = 0; i < length3; i++) {
+ featureTables[i].update(frameState);
+ if (featureTables[i].styleCommandsNeededDirty) {
+ styleCommandsNeededDirty = true;
+ }
+ }
+ if (styleCommandsNeededDirty) {
+ updateStyleCommandsNeeded(model);
+ }
+}
+function updateStyleCommandsNeeded(model) {
+ const featureTable = model.featureTables[model.featureTableId];
+ model._styleCommandsNeeded = StyleCommandsNeeded_default.getStyleCommandsNeeded(
+ featureTable.featuresLength,
+ featureTable.batchTexture.translucentFeaturesLength
+ );
+}
+function updatePointCloudShading(model) {
+ const pointCloudShading = model.pointCloudShading;
+ if (pointCloudShading.attenuation !== model._attenuation) {
+ model.resetDrawCommands();
+ model._attenuation = pointCloudShading.attenuation;
+ }
+ if (pointCloudShading.backFaceCulling !== model._pointCloudBackFaceCulling) {
+ model.resetDrawCommands();
+ model._pointCloudBackFaceCulling = pointCloudShading.backFaceCulling;
+ }
+}
+function updateSilhouette(model, frameState) {
+ if (model._silhouetteDirty) {
+ if (supportsSilhouettes(frameState)) {
+ model.resetDrawCommands();
+ }
+ model._silhouetteDirty = false;
+ }
+}
+function updateSkipLevelOfDetail(model, frameState) {
+ const skipLevelOfDetail2 = model.hasSkipLevelOfDetail(frameState);
+ if (skipLevelOfDetail2 !== model._skipLevelOfDetail) {
+ model.resetDrawCommands();
+ model._skipLevelOfDetail = skipLevelOfDetail2;
+ }
+}
+function updateClippingPlanes(model, frameState) {
+ let currentClippingPlanesState = 0;
+ if (model.isClippingEnabled()) {
+ if (model._clippingPlanes.owner === model) {
+ model._clippingPlanes.update(frameState);
+ }
+ currentClippingPlanesState = model._clippingPlanes.clippingPlanesState;
+ }
+ if (currentClippingPlanesState !== model._clippingPlanesState) {
+ model.resetDrawCommands();
+ model._clippingPlanesState = currentClippingPlanesState;
+ }
+}
+function updateSceneMode(model, frameState) {
+ if (frameState.mode !== model._sceneMode) {
+ if (model._projectTo2D) {
+ model.resetDrawCommands();
+ } else {
+ model._updateModelMatrix = true;
+ }
+ model._sceneMode = frameState.mode;
+ }
+}
+function buildDrawCommands(model, frameState) {
+ if (!model._drawCommandsBuilt) {
+ model.destroyPipelineResources();
+ model._sceneGraph.buildDrawCommands(frameState);
+ model._drawCommandsBuilt = true;
+ }
+}
+function updateModelMatrix(model, frameState) {
+ if (!Matrix4_default.equals(model.modelMatrix, model._modelMatrix)) {
+ if (frameState.mode !== SceneMode_default.SCENE3D && model._projectTo2D) {
+ throw new DeveloperError_default(
+ "Model.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true."
+ );
+ }
+ model._updateModelMatrix = true;
+ model._modelMatrix = Matrix4_default.clone(model.modelMatrix, model._modelMatrix);
+ }
+}
+var scratchPosition4 = new Cartesian3_default();
+var scratchCartographic3 = new Cartographic_default();
+function updateClamping(model) {
+ if (!model._updateModelMatrix && !model._heightDirty && model._minimumPixelSize === 0) {
+ return;
+ }
+ if (defined_default(model._removeUpdateHeightCallback)) {
+ model._removeUpdateHeightCallback();
+ model._removeUpdateHeightCallback = void 0;
+ }
+ const scene = model._scene;
+ if (!defined_default(scene) || !defined_default(scene.globe) || model.heightReference === HeightReference_default.NONE) {
+ if (model.heightReference !== HeightReference_default.NONE) {
+ throw new DeveloperError_default(
+ "Height reference is not supported without a scene and globe."
+ );
+ }
+ model._clampedModelMatrix = void 0;
+ return;
+ }
+ const globe = scene.globe;
+ const ellipsoid = globe.ellipsoid;
+ const modelMatrix = model.modelMatrix;
+ scratchPosition4.x = modelMatrix[12];
+ scratchPosition4.y = modelMatrix[13];
+ scratchPosition4.z = modelMatrix[14];
+ const cartoPosition = ellipsoid.cartesianToCartographic(scratchPosition4);
+ if (!defined_default(model._clampedModelMatrix)) {
+ model._clampedModelMatrix = Matrix4_default.clone(modelMatrix, new Matrix4_default());
+ }
+ const surface = globe._surface;
+ model._removeUpdateHeightCallback = surface.updateHeight(
+ cartoPosition,
+ getUpdateHeightCallback(model, ellipsoid, cartoPosition)
+ );
+ const height = globe.getHeight(cartoPosition);
+ if (defined_default(height)) {
+ const callback = getUpdateHeightCallback(model, ellipsoid, cartoPosition);
+ Cartographic_default.clone(cartoPosition, scratchCartographic3);
+ scratchCartographic3.height = height;
+ ellipsoid.cartographicToCartesian(scratchCartographic3, scratchPosition4);
+ callback(scratchPosition4);
+ }
+ model._heightDirty = false;
+ model._updateModelMatrix = true;
+}
+function updateBoundingSphereAndScale(model, frameState) {
+ if (!model._updateModelMatrix && model._minimumPixelSize === 0) {
+ return;
+ }
+ const modelMatrix = defined_default(model._clampedModelMatrix) ? model._clampedModelMatrix : model.modelMatrix;
+ updateBoundingSphere(model, modelMatrix);
+ updateComputedScale(model, modelMatrix, frameState);
+}
+function updateBoundingSphere(model, modelMatrix) {
+ model._clampedScale = defined_default(model._maximumScale) ? Math.min(model._scale, model._maximumScale) : model._scale;
+ model._boundingSphere.center = Cartesian3_default.multiplyByScalar(
+ model._sceneGraph.boundingSphere.center,
+ model._clampedScale,
+ model._boundingSphere.center
+ );
+ model._boundingSphere.radius = model._initialRadius * model._clampedScale;
+ model._boundingSphere = BoundingSphere_default.transform(
+ model._boundingSphere,
+ modelMatrix,
+ model._boundingSphere
+ );
+}
+function updateComputedScale(model, modelMatrix, frameState) {
+ let scale = model.scale;
+ if (model.minimumPixelSize !== 0 && !model._projectTo2D) {
+ const context = frameState.context;
+ const maxPixelSize = Math.max(
+ context.drawingBufferWidth,
+ context.drawingBufferHeight
+ );
+ scratchPosition4.x = modelMatrix[12];
+ scratchPosition4.y = modelMatrix[13];
+ scratchPosition4.z = modelMatrix[14];
+ if (model._sceneMode !== SceneMode_default.SCENE3D) {
+ SceneTransforms_default.computeActualWgs84Position(
+ frameState,
+ scratchPosition4,
+ scratchPosition4
+ );
+ }
+ const radius = model._boundingSphere.radius;
+ const metersPerPixel = scaleInPixels(scratchPosition4, radius, frameState);
+ const pixelsPerMeter = 1 / metersPerPixel;
+ const diameterInPixels = Math.min(
+ pixelsPerMeter * (2 * radius),
+ maxPixelSize
+ );
+ if (diameterInPixels < model.minimumPixelSize) {
+ scale = model.minimumPixelSize * metersPerPixel / (2 * model._initialRadius);
+ }
+ }
+ model._computedScale = defined_default(model.maximumScale) ? Math.min(model.maximumScale, scale) : scale;
+}
+function updatePickIds(model) {
+ if (!model._idDirty) {
+ return;
+ }
+ model._idDirty = false;
+ const id = model._id;
+ const pickIds = model._pickIds;
+ const length3 = pickIds.length;
+ for (let i = 0; i < length3; ++i) {
+ pickIds[i].object.id = id;
+ }
+}
+function updateReferenceMatrices(model, frameState) {
+ const modelMatrix = defined_default(model._clampedModelMatrix) ? model._clampedModelMatrix : model.modelMatrix;
+ const referenceMatrix = defaultValue_default(model.referenceMatrix, modelMatrix);
+ const context = frameState.context;
+ const ibl = model._imageBasedLighting;
+ if (ibl.useSphericalHarmonicCoefficients || ibl.useSpecularEnvironmentMaps) {
+ let iblReferenceFrameMatrix3 = scratchIBLReferenceFrameMatrix3;
+ let iblReferenceFrameMatrix4 = scratchIBLReferenceFrameMatrix4;
+ iblReferenceFrameMatrix4 = Matrix4_default.multiply(
+ context.uniformState.view3D,
+ referenceMatrix,
+ iblReferenceFrameMatrix4
+ );
+ iblReferenceFrameMatrix3 = Matrix4_default.getMatrix3(
+ iblReferenceFrameMatrix4,
+ iblReferenceFrameMatrix3
+ );
+ iblReferenceFrameMatrix3 = Matrix3_default.getRotation(
+ iblReferenceFrameMatrix3,
+ iblReferenceFrameMatrix3
+ );
+ model._iblReferenceFrameMatrix = Matrix3_default.transpose(
+ iblReferenceFrameMatrix3,
+ model._iblReferenceFrameMatrix
+ );
+ }
+ if (model.isClippingEnabled()) {
+ let clippingPlanesMatrix = scratchClippingPlanesMatrix;
+ clippingPlanesMatrix = Matrix4_default.multiply(
+ context.uniformState.view3D,
+ referenceMatrix,
+ clippingPlanesMatrix
+ );
+ clippingPlanesMatrix = Matrix4_default.multiply(
+ clippingPlanesMatrix,
+ model._clippingPlanes.modelMatrix,
+ clippingPlanesMatrix
+ );
+ model._clippingPlanesMatrix = Matrix4_default.inverseTranspose(
+ clippingPlanesMatrix,
+ model._clippingPlanesMatrix
+ );
+ }
+}
+function updateSceneGraph(model, frameState) {
+ const sceneGraph = model._sceneGraph;
+ if (model._updateModelMatrix || model._minimumPixelSize !== 0) {
+ const modelMatrix = defined_default(model._clampedModelMatrix) ? model._clampedModelMatrix : model.modelMatrix;
+ sceneGraph.updateModelMatrix(modelMatrix, frameState);
+ model._updateModelMatrix = false;
+ }
+ if (model._backFaceCullingDirty) {
+ sceneGraph.updateBackFaceCulling(model._backFaceCulling);
+ model._backFaceCullingDirty = false;
+ }
+ if (model._shadowsDirty) {
+ sceneGraph.updateShadows(model._shadows);
+ model._shadowsDirty = false;
+ }
+ if (model._debugShowBoundingVolumeDirty) {
+ sceneGraph.updateShowBoundingVolume(model._debugShowBoundingVolume);
+ model._debugShowBoundingVolumeDirty = false;
+ }
+ let updateForAnimations = false;
+ if (!defined_default(model.classificationType)) {
+ updateForAnimations = model._userAnimationDirty || model._activeAnimations.update(frameState);
+ }
+ sceneGraph.update(frameState, updateForAnimations);
+ model._userAnimationDirty = false;
+}
+function updateShowCreditsOnScreen(model) {
+ if (!model._showCreditsOnScreenDirty) {
+ return;
+ }
+ model._showCreditsOnScreenDirty = false;
+ const showOnScreen = model._showCreditsOnScreen;
+ if (defined_default(model._credit)) {
+ model._credit.showOnScreen = showOnScreen;
+ }
+ const resourceCredits = model._resourceCredits;
+ const resourceCreditsLength = resourceCredits.length;
+ for (let i = 0; i < resourceCreditsLength; i++) {
+ resourceCredits[i].showOnScreen = showOnScreen;
+ }
+ const gltfCredits = model._gltfCredits;
+ const gltfCreditsLength = gltfCredits.length;
+ for (let i = 0; i < gltfCreditsLength; i++) {
+ gltfCredits[i].showOnScreen = showOnScreen;
+ }
+}
+function submitDrawCommands(model, frameState) {
+ const displayConditionPassed = passesDistanceDisplayCondition(
+ model,
+ frameState
+ );
+ const invisible = model.isInvisible();
+ const silhouette = model.hasSilhouette(frameState);
+ const showModel = model._show && model._computedScale !== 0 && displayConditionPassed && (!invisible || silhouette);
+ const passes = frameState.passes;
+ const submitCommandsForPass = passes.render || passes.pick && model.allowPicking;
+ if (showModel && !model._ignoreCommands && submitCommandsForPass) {
+ addCreditsToCreditDisplay(model, frameState);
+ model._sceneGraph.pushDrawCommands(frameState);
+ }
+}
+var scratchBoundingSphere4 = new BoundingSphere_default();
+function scaleInPixels(positionWC2, radius, frameState) {
+ scratchBoundingSphere4.center = positionWC2;
+ scratchBoundingSphere4.radius = radius;
+ return frameState.camera.getPixelSize(
+ scratchBoundingSphere4,
+ frameState.context.drawingBufferWidth,
+ frameState.context.drawingBufferHeight
+ );
+}
+function getUpdateHeightCallback(model, ellipsoid, cartoPosition) {
+ return function(clampedPosition) {
+ if (model.heightReference === HeightReference_default.RELATIVE_TO_GROUND) {
+ const clampedCart = ellipsoid.cartesianToCartographic(
+ clampedPosition,
+ scratchCartographic3
+ );
+ clampedCart.height += cartoPosition.height;
+ ellipsoid.cartographicToCartesian(clampedCart, clampedPosition);
+ }
+ const clampedModelMatrix = model._clampedModelMatrix;
+ Matrix4_default.clone(model.modelMatrix, clampedModelMatrix);
+ clampedModelMatrix[12] = clampedPosition.x;
+ clampedModelMatrix[13] = clampedPosition.y;
+ clampedModelMatrix[14] = clampedPosition.z;
+ model._heightDirty = true;
+ };
+}
+var scratchDisplayConditionCartesian = new Cartesian3_default();
+function passesDistanceDisplayCondition(model, frameState) {
+ const condition = model.distanceDisplayCondition;
+ if (!defined_default(condition)) {
+ return true;
+ }
+ const nearSquared = condition.near * condition.near;
+ const farSquared = condition.far * condition.far;
+ let distanceSquared;
+ if (frameState.mode === SceneMode_default.SCENE2D) {
+ const frustum2DWidth = frameState.camera.frustum.right - frameState.camera.frustum.left;
+ const distance2 = frustum2DWidth * 0.5;
+ distanceSquared = distance2 * distance2;
+ } else {
+ const position = Matrix4_default.getTranslation(
+ model.modelMatrix,
+ scratchDisplayConditionCartesian
+ );
+ SceneTransforms_default.computeActualWgs84Position(frameState, position, position);
+ distanceSquared = Cartesian3_default.distanceSquared(
+ position,
+ frameState.camera.positionWC
+ );
+ }
+ return distanceSquared >= nearSquared && distanceSquared <= farSquared;
+}
+function addCreditsToCreditDisplay(model, frameState) {
+ const creditDisplay = frameState.creditDisplay;
+ const credit = model._credit;
+ if (defined_default(credit)) {
+ creditDisplay.addCredit(credit);
+ }
+ const resourceCredits = model._resourceCredits;
+ const resourceCreditsLength = resourceCredits.length;
+ for (let c = 0; c < resourceCreditsLength; c++) {
+ creditDisplay.addCredit(resourceCredits[c]);
+ }
+ const gltfCredits = model._gltfCredits;
+ const gltfCreditsLength = gltfCredits.length;
+ for (let c = 0; c < gltfCreditsLength; c++) {
+ creditDisplay.addCredit(gltfCredits[c]);
+ }
+}
+Model.prototype.isTranslucent = function() {
+ const color = this.color;
+ return defined_default(color) && color.alpha > 0 && color.alpha < 1;
+};
+Model.prototype.isInvisible = function() {
+ const color = this.color;
+ return defined_default(color) && color.alpha === 0;
+};
+function supportsSilhouettes(frameState) {
+ return frameState.context.stencilBuffer;
+}
+Model.prototype.hasSilhouette = function(frameState) {
+ return supportsSilhouettes(frameState) && this._silhouetteSize > 0 && this._silhouetteColor.alpha > 0 && !defined_default(this._classificationType);
+};
+function supportsSkipLevelOfDetail(frameState) {
+ return frameState.context.stencilBuffer;
+}
+Model.prototype.hasSkipLevelOfDetail = function(frameState) {
+ const is3DTiles = ModelType_default.is3DTiles(this.type);
+ if (!is3DTiles) {
+ return false;
+ }
+ const tileset = this._content.tileset;
+ return supportsSkipLevelOfDetail(frameState) && tileset.skipLevelOfDetail;
+};
+Model.prototype.isClippingEnabled = function() {
+ const clippingPlanes = this._clippingPlanes;
+ return defined_default(clippingPlanes) && clippingPlanes.enabled && clippingPlanes.length !== 0;
+};
+Model.prototype.isDestroyed = function() {
+ return false;
+};
+Model.prototype.destroy = function() {
+ const loader = this._loader;
+ if (defined_default(loader)) {
+ loader.destroy();
+ }
+ const featureTables = this._featureTables;
+ if (defined_default(featureTables)) {
+ const length3 = featureTables.length;
+ for (let i = 0; i < length3; i++) {
+ featureTables[i].destroy();
+ }
+ }
+ this.destroyPipelineResources();
+ this.destroyModelResources();
+ if (defined_default(this._removeUpdateHeightCallback)) {
+ this._removeUpdateHeightCallback();
+ this._removeUpdateHeightCallback = void 0;
+ }
+ if (defined_default(this._terrainProviderChangedCallback)) {
+ this._terrainProviderChangedCallback();
+ this._terrainProviderChangedCallback = void 0;
+ }
+ const clippingPlaneCollection = this._clippingPlanes;
+ if (defined_default(clippingPlaneCollection) && !clippingPlaneCollection.isDestroyed() && clippingPlaneCollection.owner === this) {
+ clippingPlaneCollection.destroy();
+ }
+ this._clippingPlanes = void 0;
+ if (this._shouldDestroyImageBasedLighting && !this._imageBasedLighting.isDestroyed()) {
+ this._imageBasedLighting.destroy();
+ }
+ this._imageBasedLighting = void 0;
+ destroyObject_default(this);
+};
+Model.prototype.destroyPipelineResources = function() {
+ const resources = this._pipelineResources;
+ for (let i = 0; i < resources.length; i++) {
+ resources[i].destroy();
+ }
+ this._pipelineResources.length = 0;
+ this._pickIds.length = 0;
+};
+Model.prototype.destroyModelResources = function() {
+ const resources = this._modelResources;
+ for (let i = 0; i < resources.length; i++) {
+ resources[i].destroy();
+ }
+ this._modelResources.length = 0;
+};
+Model.fromGltf = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ if (!defined_default(options.url) && !defined_default(options.gltf)) {
+ throw new DeveloperError_default("options.url is required.");
+ }
+ const gltf = defaultValue_default(options.url, options.gltf);
+ const loaderOptions = {
+ releaseGltfJson: options.releaseGltfJson,
+ asynchronous: options.asynchronous,
+ incrementallyLoadTextures: options.incrementallyLoadTextures,
+ upAxis: options.upAxis,
+ forwardAxis: options.forwardAxis,
+ loadAttributesFor2D: options.projectTo2D,
+ loadIndicesForWireframe: options.enableDebugWireframe,
+ loadPrimitiveOutline: options.enableShowOutline,
+ loadForClassification: defined_default(options.classificationType)
+ };
+ const basePath = defaultValue_default(options.basePath, "");
+ const baseResource2 = Resource_default.createIfNeeded(basePath);
+ if (defined_default(gltf.asset)) {
+ loaderOptions.gltfJson = gltf;
+ loaderOptions.baseResource = baseResource2;
+ loaderOptions.gltfResource = baseResource2;
+ } else if (gltf instanceof Uint8Array) {
+ loaderOptions.typedArray = gltf;
+ loaderOptions.baseResource = baseResource2;
+ loaderOptions.gltfResource = baseResource2;
+ } else {
+ loaderOptions.gltfResource = Resource_default.createIfNeeded(gltf);
+ }
+ const loader = new GltfLoader_default(loaderOptions);
+ const is3DTiles = defined_default(options.content);
+ const type = is3DTiles ? ModelType_default.TILE_GLTF : ModelType_default.GLTF;
+ const modelOptions = makeModelOptions(loader, type, options);
+ modelOptions.resource = loaderOptions.gltfResource;
+ const model = new Model(modelOptions);
+ return model;
+};
+Model.fromB3dm = function(options) {
+ const loaderOptions = {
+ b3dmResource: options.resource,
+ arrayBuffer: options.arrayBuffer,
+ byteOffset: options.byteOffset,
+ releaseGltfJson: options.releaseGltfJson,
+ asynchronous: options.asynchronous,
+ incrementallyLoadTextures: options.incrementallyLoadTextures,
+ upAxis: options.upAxis,
+ forwardAxis: options.forwardAxis,
+ loadAttributesFor2D: options.projectTo2D,
+ loadIndicesForWireframe: options.enableDebugWireframe,
+ loadPrimitiveOutline: options.enableShowOutline,
+ loadForClassification: defined_default(options.classificationType)
+ };
+ const loader = new B3dmLoader_default(loaderOptions);
+ const modelOptions = makeModelOptions(loader, ModelType_default.TILE_B3DM, options);
+ const model = new Model(modelOptions);
+ return model;
+};
+Model.fromPnts = function(options) {
+ const loaderOptions = {
+ arrayBuffer: options.arrayBuffer,
+ byteOffset: options.byteOffset,
+ loadAttributesFor2D: options.projectTo2D
+ };
+ const loader = new PntsLoader_default(loaderOptions);
+ const modelOptions = makeModelOptions(loader, ModelType_default.TILE_PNTS, options);
+ const model = new Model(modelOptions);
+ return model;
+};
+Model.fromI3dm = function(options) {
+ const loaderOptions = {
+ i3dmResource: options.resource,
+ arrayBuffer: options.arrayBuffer,
+ byteOffset: options.byteOffset,
+ releaseGltfJson: options.releaseGltfJson,
+ asynchronous: options.asynchronous,
+ incrementallyLoadTextures: options.incrementallyLoadTextures,
+ upAxis: options.upAxis,
+ forwardAxis: options.forwardAxis,
+ loadAttributesFor2D: options.projectTo2D,
+ loadIndicesForWireframe: options.enableDebugWireframe,
+ loadPrimitiveOutline: options.enableShowOutline
+ };
+ const loader = new I3dmLoader_default(loaderOptions);
+ const modelOptions = makeModelOptions(loader, ModelType_default.TILE_I3DM, options);
+ const model = new Model(modelOptions);
+ return model;
+};
+Model.fromGeoJson = function(options) {
+ const loaderOptions = {
+ geoJson: options.geoJson
+ };
+ const loader = new GeoJsonLoader_default(loaderOptions);
+ const modelOptions = makeModelOptions(
+ loader,
+ ModelType_default.TILE_GEOJSON,
+ options
+ );
+ const model = new Model(modelOptions);
+ return model;
+};
+Model.prototype.applyColorAndShow = function(style) {
+ const previousColor = this._color;
+ const hasColorStyle = defined_default(style) && defined_default(style.color);
+ const hasShowStyle = defined_default(style) && defined_default(style.show);
+ this._color = hasColorStyle ? style.color.evaluateColor(void 0, this._color) : Color_default.clone(Color_default.WHITE, this._color);
+ this._show = hasShowStyle ? style.show.evaluate(void 0) : true;
+ if (isColorAlphaDirty(previousColor, this._color)) {
+ this.resetDrawCommands();
+ }
+};
+Model.prototype.applyStyle = function(style) {
+ const isPnts = this.type === ModelType_default.TILE_PNTS;
+ const hasFeatureTable = defined_default(this.featureTableId) && this.featureTables[this.featureTableId].featuresLength > 0;
+ const propertyAttributes = defined_default(this.structuralMetadata) ? this.structuralMetadata.propertyAttributes : void 0;
+ const hasPropertyAttributes = defined_default(propertyAttributes) && defined_default(propertyAttributes[0]);
+ if (isPnts && (!hasFeatureTable || hasPropertyAttributes)) {
+ this.resetDrawCommands();
+ return;
+ }
+ if (hasFeatureTable) {
+ const featureTable = this.featureTables[this.featureTableId];
+ featureTable.applyStyle(style);
+ updateStyleCommandsNeeded(this, style);
+ } else {
+ this.applyColorAndShow(style);
+ this._styleCommandsNeeded = void 0;
+ }
+};
+function makeModelOptions(loader, modelType, options) {
+ return {
+ loader,
+ type: modelType,
+ resource: options.resource,
+ show: options.show,
+ modelMatrix: options.modelMatrix,
+ scale: options.scale,
+ minimumPixelSize: options.minimumPixelSize,
+ maximumScale: options.maximumScale,
+ id: options.id,
+ allowPicking: options.allowPicking,
+ clampAnimations: options.clampAnimations,
+ shadows: options.shadows,
+ debugShowBoundingVolume: options.debugShowBoundingVolume,
+ enableDebugWireframe: options.enableDebugWireframe,
+ debugWireframe: options.debugWireframe,
+ cull: options.cull,
+ opaquePass: options.opaquePass,
+ customShader: options.customShader,
+ content: options.content,
+ heightReference: options.heightReference,
+ scene: options.scene,
+ distanceDisplayCondition: options.distanceDisplayCondition,
+ color: options.color,
+ colorBlendAmount: options.colorBlendAmount,
+ colorBlendMode: options.colorBlendMode,
+ silhouetteColor: options.silhouetteColor,
+ silhouetteSize: options.silhouetteSize,
+ enableShowOutline: options.enableShowOutline,
+ showOutline: options.showOutline,
+ outlineColor: options.outlineColor,
+ clippingPlanes: options.clippingPlanes,
+ lightColor: options.lightColor,
+ imageBasedLighting: options.imageBasedLighting,
+ backFaceCulling: options.backFaceCulling,
+ credit: options.credit,
+ showCreditsOnScreen: options.showCreditsOnScreen,
+ splitDirection: options.splitDirection,
+ projectTo2D: options.projectTo2D,
+ featureIdLabel: options.featureIdLabel,
+ instanceFeatureIdLabel: options.instanceFeatureIdLabel,
+ pointCloudShading: options.pointCloudShading,
+ classificationType: options.classificationType,
+ pickObject: options.pickObject
+ };
+}
+var Model_default = Model;
+
+// Source/Scene/Model/Model3DTileContent.js
+function Model3DTileContent(tileset, tile, resource) {
+ this._tileset = tileset;
+ this._tile = tile;
+ this._resource = resource;
+ this._model = void 0;
+ this._readyPromise = void 0;
+ this._metadata = void 0;
+ this._group = void 0;
+}
+Object.defineProperties(Model3DTileContent.prototype, {
+ featuresLength: {
+ get: function() {
+ const model = this._model;
+ const featureTables = model.featureTables;
+ const featureTableId = model.featureTableId;
+ if (defined_default(featureTables) && defined_default(featureTables[featureTableId])) {
+ return featureTables[featureTableId].featuresLength;
+ }
+ return 0;
+ }
+ },
+ pointsLength: {
+ get: function() {
+ return this._model.statistics.pointsLength;
+ }
+ },
+ trianglesLength: {
+ get: function() {
+ return this._model.statistics.trianglesLength;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ return this._model.statistics.geometryByteLength;
+ }
+ },
+ texturesByteLength: {
+ get: function() {
+ return this._model.statistics.texturesByteLength;
+ }
+ },
+ batchTableByteLength: {
+ get: function() {
+ const statistics2 = this._model.statistics;
+ return statistics2.propertyTablesByteLength + statistics2.batchTexturesByteLength;
+ }
+ },
+ innerContents: {
+ get: function() {
+ return void 0;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._tileset;
+ }
+ },
+ tile: {
+ get: function() {
+ return this._tile;
+ }
+ },
+ url: {
+ get: function() {
+ return this._resource.getUrlComponent(true);
+ }
+ },
+ batchTable: {
+ get: function() {
+ const model = this._model;
+ const featureTables = model.featureTables;
+ const featureTableId = model.featureTableId;
+ if (defined_default(featureTables) && defined_default(featureTables[featureTableId])) {
+ return featureTables[featureTableId];
+ }
+ return void 0;
+ }
+ },
+ metadata: {
+ get: function() {
+ return this._metadata;
+ },
+ set: function(value) {
+ this._metadata = value;
+ }
+ },
+ group: {
+ get: function() {
+ return this._group;
+ },
+ set: function(value) {
+ this._group = value;
+ }
+ }
+});
+Model3DTileContent.prototype.getFeature = function(featureId) {
+ const model = this._model;
+ const featureTableId = model.featureTableId;
+ if (!defined_default(featureTableId)) {
+ throw new DeveloperError_default(
+ "No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined"
+ );
+ }
+ const featureTable = model.featureTables[featureTableId];
+ if (!defined_default(featureTable)) {
+ throw new DeveloperError_default(
+ "No feature table found for the selected feature ID set"
+ );
+ }
+ const featuresLength = featureTable.featuresLength;
+ if (!defined_default(featureId) || featureId < 0 || featureId >= featuresLength) {
+ throw new DeveloperError_default(
+ `featureId is required and must be between 0 and featuresLength - 1 (${featuresLength - 1}).`
+ );
+ }
+ return featureTable.getFeature(featureId);
+};
+Model3DTileContent.prototype.hasProperty = function(featureId, name) {
+ const model = this._model;
+ const featureTableId = model.featureTableId;
+ if (!defined_default(featureTableId)) {
+ return false;
+ }
+ const featureTable = model.featureTables[featureTableId];
+ return featureTable.hasProperty(featureId, name);
+};
+Model3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
+ color = enabled ? color : Color_default.WHITE;
+ if (this.featuresLength === 0) {
+ this._model.color = color;
+ } else if (defined_default(this.batchTable)) {
+ this.batchTable.setAllColor(color);
+ }
+};
+Model3DTileContent.prototype.applyStyle = function(style) {
+ this._model.style = style;
+};
+Model3DTileContent.prototype.update = function(tileset, frameState) {
+ const model = this._model;
+ const tile = this._tile;
+ model.colorBlendAmount = tileset.colorBlendAmount;
+ model.colorBlendMode = tileset.colorBlendMode;
+ model.modelMatrix = tile.computedTransform;
+ model.customShader = tileset.customShader;
+ model.featureIdLabel = tileset.featureIdLabel;
+ model.instanceFeatureIdLabel = tileset.instanceFeatureIdLabel;
+ model.lightColor = tileset.lightColor;
+ model.imageBasedLighting = tileset.imageBasedLighting;
+ model.backFaceCulling = tileset.backFaceCulling;
+ model.shadows = tileset.shadows;
+ model.showCreditsOnScreen = tileset.showCreditsOnScreen;
+ model.splitDirection = tileset.splitDirection;
+ model.debugWireframe = tileset.debugWireframe;
+ model.showOutline = tileset.showOutline;
+ model.outlineColor = tileset.outlineColor;
+ model.pointCloudShading = tileset.pointCloudShading;
+ const tilesetClippingPlanes = tileset.clippingPlanes;
+ model.referenceMatrix = tileset.clippingPlanesOriginMatrix;
+ if (defined_default(tilesetClippingPlanes) && tile.clippingPlanesDirty) {
+ model._clippingPlanes = tilesetClippingPlanes.enabled && tile._isClipped ? tilesetClippingPlanes : void 0;
+ }
+ if (defined_default(tilesetClippingPlanes) && defined_default(model._clippingPlanes) && model._clippingPlanes !== tilesetClippingPlanes) {
+ model._clippingPlanes = tilesetClippingPlanes;
+ model._clippingPlanesState = 0;
+ }
+ model.update(frameState);
+};
+Model3DTileContent.prototype.isDestroyed = function() {
+ return false;
+};
+Model3DTileContent.prototype.destroy = function() {
+ this._model = this._model && this._model.destroy();
+ return destroyObject_default(this);
+};
+Model3DTileContent.fromGltf = function(tileset, tile, resource, gltf) {
+ const content = new Model3DTileContent(tileset, tile, resource);
+ const additionalOptions = {
+ gltf,
+ basePath: resource
+ };
+ const modelOptions = makeModelOptions2(
+ tileset,
+ tile,
+ content,
+ additionalOptions
+ );
+ const classificationType = tileset.vectorClassificationOnly ? void 0 : tileset.classificationType;
+ modelOptions.classificationType = classificationType;
+ const model = Model_default.fromGltf(modelOptions);
+ content._model = model;
+ content._readyPromise = model.readyPromise.then(function(model2) {
+ model2.activeAnimations.addAll({
+ loop: ModelAnimationLoop_default.REPEAT
+ });
+ return model2;
+ });
+ return content;
+};
+Model3DTileContent.fromB3dm = function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ const content = new Model3DTileContent(tileset, tile, resource);
+ const additionalOptions = {
+ arrayBuffer,
+ byteOffset,
+ resource
+ };
+ const modelOptions = makeModelOptions2(
+ tileset,
+ tile,
+ content,
+ additionalOptions
+ );
+ const classificationType = tileset.vectorClassificationOnly ? void 0 : tileset.classificationType;
+ modelOptions.classificationType = classificationType;
+ const model = Model_default.fromB3dm(modelOptions);
+ content._model = model;
+ content._readyPromise = model.readyPromise.then(function(model2) {
+ model2.activeAnimations.addAll({
+ loop: ModelAnimationLoop_default.REPEAT
+ });
+ return model2;
+ });
+ return content;
+};
+Model3DTileContent.fromI3dm = function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ const content = new Model3DTileContent(tileset, tile, resource);
+ const additionalOptions = {
+ arrayBuffer,
+ byteOffset,
+ resource
+ };
+ const modelOptions = makeModelOptions2(
+ tileset,
+ tile,
+ content,
+ additionalOptions
+ );
+ const model = Model_default.fromI3dm(modelOptions);
+ content._model = model;
+ content._readyPromise = model.readyPromise.then(function(model2) {
+ model2.activeAnimations.addAll({
+ loop: ModelAnimationLoop_default.REPEAT
+ });
+ return model2;
+ });
+ return content;
+};
+Model3DTileContent.fromPnts = function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ const content = new Model3DTileContent(tileset, tile, resource);
+ const additionalOptions = {
+ arrayBuffer,
+ byteOffset,
+ resource
+ };
+ const modelOptions = makeModelOptions2(
+ tileset,
+ tile,
+ content,
+ additionalOptions
+ );
+ const model = Model_default.fromPnts(modelOptions);
+ content._model = model;
+ content._readyPromise = model.readyPromise;
+ return content;
+};
+Model3DTileContent.fromGeoJson = function(tileset, tile, resource, geoJson) {
+ const content = new Model3DTileContent(tileset, tile, resource);
+ const additionalOptions = {
+ geoJson,
+ resource
+ };
+ const modelOptions = makeModelOptions2(
+ tileset,
+ tile,
+ content,
+ additionalOptions
+ );
+ const model = Model_default.fromGeoJson(modelOptions);
+ content._model = model;
+ content._readyPromise = model.readyPromise;
+ return content;
+};
+function makeModelOptions2(tileset, tile, content, additionalOptions) {
+ const mainOptions = {
+ cull: false,
+ releaseGltfJson: true,
+ opaquePass: Pass_default.CESIUM_3D_TILE,
+ modelMatrix: tile.computedTransform,
+ upAxis: tileset._modelUpAxis,
+ forwardAxis: tileset._modelForwardAxis,
+ incrementallyLoadTextures: false,
+ customShader: tileset.customShader,
+ content,
+ colorBlendMode: tileset.colorBlendMode,
+ colorBlendAmount: tileset.colorBlendAmount,
+ lightColor: tileset.lightColor,
+ imageBasedLighting: tileset.imageBasedLighting,
+ featureIdLabel: tileset.featureIdLabel,
+ instanceFeatureIdLabel: tileset.instanceFeatureIdLabel,
+ pointCloudShading: tileset.pointCloudShading,
+ clippingPlanes: tileset.clippingPlanes,
+ backFaceCulling: tileset.backFaceCulling,
+ shadows: tileset.shadows,
+ showCreditsOnScreen: tileset.showCreditsOnScreen,
+ splitDirection: tileset.splitDirection,
+ enableDebugWireframe: tileset._enableDebugWireframe,
+ debugWireframe: tileset.debugWireframe,
+ projectTo2D: tileset._projectTo2D,
+ enableShowOutline: tileset._enableShowOutline,
+ showOutline: tileset.showOutline,
+ outlineColor: tileset.outlineColor
+ };
+ return combine_default(additionalOptions, mainOptions);
+}
+var Model3DTileContent_default = Model3DTileContent;
+
+// Source/Scene/Tileset3DTileContent.js
+function Tileset3DTileContent(tileset, tile, resource, json) {
+ this._tileset = tileset;
+ this._tile = tile;
+ this._resource = resource;
+ this.featurePropertiesDirty = false;
+ this._metadata = void 0;
+ this._group = void 0;
+ this._readyPromise = initialize20(this, json);
+}
+Object.defineProperties(Tileset3DTileContent.prototype, {
+ featuresLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ pointsLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ trianglesLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ texturesByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ batchTableByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ innerContents: {
+ get: function() {
+ return void 0;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._tileset;
+ }
+ },
+ tile: {
+ get: function() {
+ return this._tile;
+ }
+ },
+ url: {
+ get: function() {
+ return this._resource.getUrlComponent(true);
+ }
+ },
+ batchTable: {
+ get: function() {
+ return void 0;
+ }
+ },
+ metadata: {
+ get: function() {
+ return this._metadata;
+ },
+ set: function(value) {
+ this._metadata = value;
+ }
+ },
+ group: {
+ get: function() {
+ return this._group;
+ },
+ set: function(value) {
+ this._group = value;
+ }
+ }
+});
+function initialize20(content, json) {
+ content._tileset.loadTileset(content._resource, json, content._tile);
+ return Promise.resolve(content);
+}
+Tileset3DTileContent.prototype.hasProperty = function(batchId, name) {
+ return false;
+};
+Tileset3DTileContent.prototype.getFeature = function(batchId) {
+ return void 0;
+};
+Tileset3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
+};
+Tileset3DTileContent.prototype.applyStyle = function(style) {
+};
+Tileset3DTileContent.prototype.update = function(tileset, frameState) {
+};
+Tileset3DTileContent.prototype.isDestroyed = function() {
+ return false;
+};
+Tileset3DTileContent.prototype.destroy = function() {
+ return destroyObject_default(this);
+};
+var Tileset3DTileContent_default = Tileset3DTileContent;
+
+// Source/Shaders/BillboardCollectionFS.js
+var BillboardCollectionFS_default = `#ifdef GL_OES_standard_derivatives
+#extension GL_OES_standard_derivatives : enable
+#endif
+
+uniform sampler2D u_atlas;
+
+#ifdef VECTOR_TILE
+uniform vec4 u_highlightColor;
+#endif
+
+varying vec2 v_textureCoordinates;
+varying vec4 v_pickColor;
+varying vec4 v_color;
+
+#ifdef SDF
+varying vec4 v_outlineColor;
+varying float v_outlineWidth;
+#endif
+
+#ifdef FRAGMENT_DEPTH_CHECK
+varying vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates
+varying vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs)
+varying vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
+varying mat2 v_rotationMatrix;
+
+const float SHIFT_LEFT12 = 4096.0;
+const float SHIFT_LEFT1 = 2.0;
+
+const float SHIFT_RIGHT12 = 1.0 / 4096.0;
+const float SHIFT_RIGHT1 = 1.0 / 2.0;
+
+float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)
+{
+ vec2 lookupVector = imageSize * (depthLookupST - adjustedST);
+ lookupVector = v_rotationMatrix * lookupVector;
+ vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal
+
+ vec2 translation = v_originTextureCoordinateAndTranslate.zw;
+
+ if (applyTranslate)
+ {
+ // this is only needed for labels where the horizontal origin is not LEFT
+ // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT
+ translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));
+ }
+
+ vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;
+ float logDepthOrDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, st));
+
+ if (logDepthOrDepth == 0.0)
+ {
+ return 0.0; // not on the globe
+ }
+
+ vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
+ return eyeCoordinate.z / eyeCoordinate.w;
+}
+#endif
+
+
+#ifdef SDF
+
+// Get the distance from the edge of a glyph at a given position sampling an SDF texture.
+float getDistance(vec2 position)
+{
+ return texture2D(u_atlas, position).r;
+}
+
+// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.
+vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
+{
+ float distance = getDistance(position);
+
+ if (outlineWidth > 0.0)
+ {
+ // Don't get the outline edge exceed the SDF_EDGE
+ float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
+ float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
+ vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
+ float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
+ return vec4(sdfColor.rgb, sdfColor.a * alpha);
+ }
+ else
+ {
+ float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
+ return vec4(v_color.rgb, v_color.a * alpha);
+ }
+}
+#endif
+
+void main()
+{
+ vec4 color = texture2D(u_atlas, v_textureCoordinates);
+
+#ifdef SDF
+ float outlineWidth = v_outlineWidth;
+ vec4 outlineColor = v_outlineColor;
+
+ // Get the current distance
+ float distance = getDistance(v_textureCoordinates);
+
+#ifdef GL_OES_standard_derivatives
+ float smoothing = fwidth(distance);
+ // Get an offset that is approximately half the distance to the neighbor pixels
+ // 0.354 is approximately half of 1/sqrt(2)
+ vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));
+
+ // Sample the center point
+ vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
+
+ // Sample the 4 neighbors
+ vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
+ vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
+ vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
+ vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
+
+ // Equally weight the center sample and the 4 neighboring samples
+ color = (center + color1 + color2 + color3 + color4)/5.0;
+#else
+ // Just do a single sample
+ float smoothing = 1.0/32.0;
+ color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
+#endif
+
+ color = czm_gammaCorrect(color);
+#else
+ color = czm_gammaCorrect(color);
+ color *= czm_gammaCorrect(v_color);
+#endif
+
+// Fully transparent parts of the billboard are not pickable.
+#if !defined(OPAQUE) && !defined(TRANSLUCENT)
+ if (color.a < 0.005) // matches 0/255 and 1/255
+ {
+ discard;
+ }
+#else
+// The billboard is rendered twice. The opaque pass discards translucent fragments
+// and the translucent pass discards opaque fragments.
+#ifdef OPAQUE
+ if (color.a < 0.995) // matches < 254/255
+ {
+ discard;
+ }
+#else
+ if (color.a >= 0.995) // matches 254/255 and 255/255
+ {
+ discard;
+ }
+#endif
+#endif
+
+#ifdef VECTOR_TILE
+ color *= u_highlightColor;
+#endif
+ gl_FragColor = color;
+
+#ifdef LOG_DEPTH
+ czm_writeLogDepth();
+#endif
+
+#ifdef FRAGMENT_DEPTH_CHECK
+ float temp = v_compressed.y;
+
+ temp = temp * SHIFT_RIGHT1;
+
+ float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
+ bool enableDepthTest = temp2 != 0.0;
+ bool applyTranslate = floor(temp) != 0.0;
+
+ if (enableDepthTest) {
+ temp = v_compressed.z;
+ temp = temp * SHIFT_RIGHT12;
+
+ vec2 dimensions;
+ dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
+ dimensions.x = floor(temp);
+
+ temp = v_compressed.w;
+ temp = temp * SHIFT_RIGHT12;
+
+ vec2 imageSize;
+ imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;
+ imageSize.x = floor(temp);
+
+ vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;
+ adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);
+
+ float epsilonEyeDepth = v_compressed.x + czm_epsilon1;
+ float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);
+
+ // negative values go into the screen
+ if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
+ {
+ float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner
+ if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
+ {
+ float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner
+ if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
+ {
+ discard;
+ }
+ }
+ }
+ }
+#endif
+
+}
+`;
+
+// Source/Shaders/BillboardCollectionVS.js
+var BillboardCollectionVS_default = `#ifdef INSTANCED
+attribute vec2 direction;
+#endif
+attribute vec4 positionHighAndScale;
+attribute vec4 positionLowAndRotation;
+attribute vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)
+attribute vec4 compressedAttribute1; // aligned axis, translucency by distance, image width
+attribute vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free
+attribute vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range)
+attribute vec4 scaleByDistance; // near, nearScale, far, farScale
+attribute vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale
+attribute vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions
+attribute vec2 sdf; // sdf outline color (rgb) and width (w)
+#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
+attribute vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates
+#endif
+#ifdef VECTOR_TILE
+attribute float a_batchId;
+#endif
+
+varying vec2 v_textureCoordinates;
+#ifdef FRAGMENT_DEPTH_CHECK
+varying vec4 v_textureCoordinateBounds;
+varying vec4 v_originTextureCoordinateAndTranslate;
+varying vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
+varying mat2 v_rotationMatrix;
+#endif
+
+varying vec4 v_pickColor;
+varying vec4 v_color;
+#ifdef SDF
+varying vec4 v_outlineColor;
+varying float v_outlineWidth;
+#endif
+
+const float UPPER_BOUND = 32768.0;
+
+const float SHIFT_LEFT16 = 65536.0;
+const float SHIFT_LEFT12 = 4096.0;
+const float SHIFT_LEFT8 = 256.0;
+const float SHIFT_LEFT7 = 128.0;
+const float SHIFT_LEFT5 = 32.0;
+const float SHIFT_LEFT3 = 8.0;
+const float SHIFT_LEFT2 = 4.0;
+const float SHIFT_LEFT1 = 2.0;
+
+const float SHIFT_RIGHT12 = 1.0 / 4096.0;
+const float SHIFT_RIGHT8 = 1.0 / 256.0;
+const float SHIFT_RIGHT7 = 1.0 / 128.0;
+const float SHIFT_RIGHT5 = 1.0 / 32.0;
+const float SHIFT_RIGHT3 = 1.0 / 8.0;
+const float SHIFT_RIGHT2 = 1.0 / 4.0;
+const float SHIFT_RIGHT1 = 1.0 / 2.0;
+
+vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)
+{
+ // Note the halfSize cannot be computed in JavaScript because it is sent via
+ // compressed vertex attributes that coerce it to an integer.
+ vec2 halfSize = imageSize * scale * 0.5;
+ halfSize *= ((direction * 2.0) - 1.0);
+
+ vec2 originTranslate = origin * abs(halfSize);
+
+#if defined(ROTATION) || defined(ALIGNED_AXIS)
+ if (validAlignedAxis || rotation != 0.0)
+ {
+ float angle = rotation;
+ if (validAlignedAxis)
+ {
+ vec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);
+ angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /
+ (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));
+ }
+
+ float cosTheta = cos(angle);
+ float sinTheta = sin(angle);
+ rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);
+ halfSize = rotationMatrix * halfSize;
+ }
+ else
+ {
+ rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
+ }
+#endif
+
+ mpp = czm_metersPerPixel(positionEC);
+ positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);
+ positionEC.xy += (translate + pixelOffset) * mpp;
+
+ return positionEC;
+}
+
+#ifdef VERTEX_DEPTH_CHECK
+float getGlobeDepth(vec4 positionEC)
+{
+ vec4 posWC = czm_eyeToWindowCoordinates(positionEC);
+
+ float globeDepth = czm_unpackDepth(texture2D(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));
+
+ if (globeDepth == 0.0)
+ {
+ return 0.0; // not on the globe
+ }
+
+ vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
+ return eyeCoordinate.z / eyeCoordinate.w;
+}
+#endif
+void main()
+{
+ // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition
+
+ // unpack attributes
+ vec3 positionHigh = positionHighAndScale.xyz;
+ vec3 positionLow = positionLowAndRotation.xyz;
+ float scale = positionHighAndScale.w;
+
+#if defined(ROTATION) || defined(ALIGNED_AXIS)
+ float rotation = positionLowAndRotation.w;
+#else
+ float rotation = 0.0;
+#endif
+
+ float compressed = compressedAttribute0.x;
+
+ vec2 pixelOffset;
+ pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
+ compressed -= pixelOffset.x * SHIFT_LEFT7;
+ pixelOffset.x -= UPPER_BOUND;
+
+ vec2 origin;
+ origin.x = floor(compressed * SHIFT_RIGHT5);
+ compressed -= origin.x * SHIFT_LEFT5;
+
+ origin.y = floor(compressed * SHIFT_RIGHT3);
+ compressed -= origin.y * SHIFT_LEFT3;
+
+#ifdef FRAGMENT_DEPTH_CHECK
+ vec2 depthOrigin = origin.xy;
+#endif
+ origin -= vec2(1.0);
+
+ float show = floor(compressed * SHIFT_RIGHT2);
+ compressed -= show * SHIFT_LEFT2;
+
+#ifdef INSTANCED
+ vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
+ vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
+ vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
+#else
+ vec2 direction;
+ direction.x = floor(compressed * SHIFT_RIGHT1);
+ direction.y = compressed - direction.x * SHIFT_LEFT1;
+
+ vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);
+#endif
+
+ float temp = compressedAttribute0.y * SHIFT_RIGHT8;
+ pixelOffset.y = -(floor(temp) - UPPER_BOUND);
+
+ vec2 translate;
+ translate.y = (temp - floor(temp)) * SHIFT_LEFT16;
+
+ temp = compressedAttribute0.z * SHIFT_RIGHT8;
+ translate.x = floor(temp) - UPPER_BOUND;
+
+ translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
+ translate.y -= UPPER_BOUND;
+
+ temp = compressedAttribute1.x * SHIFT_RIGHT8;
+ float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
+
+ vec2 imageSize = vec2(floor(temp), temp2);
+
+#ifdef FRAGMENT_DEPTH_CHECK
+ float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
+ float applyTranslate = 0.0;
+ if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false
+ {
+ applyTranslate = 1.0;
+ labelHorizontalOrigin -= 2.0;
+ depthOrigin.x = labelHorizontalOrigin + 1.0;
+ }
+
+ depthOrigin = vec2(1.0) - (depthOrigin * 0.5);
+#endif
+
+#ifdef EYE_DISTANCE_TRANSLUCENCY
+ vec4 translucencyByDistance;
+ translucencyByDistance.x = compressedAttribute1.z;
+ translucencyByDistance.z = compressedAttribute1.w;
+
+ translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
+
+ temp = compressedAttribute1.y * SHIFT_RIGHT8;
+ translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
+#endif
+
+#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
+ temp = compressedAttribute3.w;
+ temp = temp * SHIFT_RIGHT12;
+
+ vec2 dimensions;
+ dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
+ dimensions.x = floor(temp);
+#endif
+
+#ifdef ALIGNED_AXIS
+ vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
+ temp = compressedAttribute2.z * SHIFT_RIGHT5;
+ bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
+#else
+ vec3 alignedAxis = vec3(0.0);
+ bool validAlignedAxis = false;
+#endif
+
+ vec4 pickColor;
+ vec4 color;
+
+ temp = compressedAttribute2.y;
+ temp = temp * SHIFT_RIGHT8;
+ pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
+ temp = floor(temp) * SHIFT_RIGHT8;
+ pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
+ pickColor.r = floor(temp);
+
+ temp = compressedAttribute2.x;
+ temp = temp * SHIFT_RIGHT8;
+ color.b = (temp - floor(temp)) * SHIFT_LEFT8;
+ temp = floor(temp) * SHIFT_RIGHT8;
+ color.g = (temp - floor(temp)) * SHIFT_LEFT8;
+ color.r = floor(temp);
+
+ temp = compressedAttribute2.z * SHIFT_RIGHT8;
+ bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;
+ temp = floor(temp) * SHIFT_RIGHT8;
+
+ pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
+ pickColor /= 255.0;
+
+ color.a = floor(temp);
+ color /= 255.0;
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
+ vec4 positionEC = czm_modelViewRelativeToEye * p;
+
+#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)
+ float eyeDepth = positionEC.z;
+#endif
+
+ positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
+ positionEC.xyz *= show;
+
+ ///////////////////////////////////////////////////////////////////////////
+
+#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
+ float lengthSq;
+ if (czm_sceneMode == czm_sceneMode2D)
+ {
+ // 2D camera distance is a special case
+ // treat all billboards as flattened to the z=0.0 plane
+ lengthSq = czm_eyeHeight2D.y;
+ }
+ else
+ {
+ lengthSq = dot(positionEC.xyz, positionEC.xyz);
+ }
+#endif
+
+#ifdef EYE_DISTANCE_SCALING
+ float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);
+ scale *= distanceScale;
+ translate *= distanceScale;
+ // push vertex behind near plane for clipping
+ if (scale == 0.0)
+ {
+ positionEC.xyz = vec3(0.0);
+ }
+#endif
+
+ float translucency = 1.0;
+#ifdef EYE_DISTANCE_TRANSLUCENCY
+ translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
+ // push vertex behind near plane for clipping
+ if (translucency == 0.0)
+ {
+ positionEC.xyz = vec3(0.0);
+ }
+#endif
+
+#ifdef EYE_DISTANCE_PIXEL_OFFSET
+ float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);
+ pixelOffset *= pixelOffsetScale;
+#endif
+
+#ifdef DISTANCE_DISPLAY_CONDITION
+ float nearSq = compressedAttribute3.x;
+ float farSq = compressedAttribute3.y;
+ if (lengthSq < nearSq || lengthSq > farSq)
+ {
+ positionEC.xyz = vec3(0.0);
+ }
+#endif
+
+ mat2 rotationMatrix;
+ float mpp;
+
+#ifdef DISABLE_DEPTH_DISTANCE
+ float disableDepthTestDistance = compressedAttribute3.z;
+#endif
+
+#ifdef VERTEX_DEPTH_CHECK
+if (lengthSq < disableDepthTestDistance) {
+ float depthsilon = 10.0;
+
+ vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;
+ vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
+ float globeDepth1 = getGlobeDepth(pEC1);
+
+ if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
+ {
+ vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
+ float globeDepth2 = getGlobeDepth(pEC2);
+
+ if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
+ {
+ vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
+ float globeDepth3 = getGlobeDepth(pEC3);
+ if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
+ {
+ positionEC.xyz = vec3(0.0);
+ }
+ }
+ }
+}
+#endif
+
+ positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
+ gl_Position = czm_projection * positionEC;
+ v_textureCoordinates = textureCoordinates;
+
+#ifdef LOG_DEPTH
+ czm_vertexLogDepth();
+#endif
+
+#ifdef DISABLE_DEPTH_DISTANCE
+ if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
+ {
+ disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
+ }
+
+ if (disableDepthTestDistance != 0.0)
+ {
+ // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
+ float zclip = gl_Position.z / gl_Position.w;
+ bool clipped = (zclip < -1.0 || zclip > 1.0);
+ if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
+ {
+ // Position z on the near plane.
+ gl_Position.z = -gl_Position.w;
+#ifdef LOG_DEPTH
+ v_depthFromNearPlusOne = 1.0;
+#endif
+ }
+ }
+#endif
+
+#ifdef FRAGMENT_DEPTH_CHECK
+ if (sizeInMeters) {
+ translate /= mpp;
+ dimensions /= mpp;
+ imageSize /= mpp;
+ }
+
+#if defined(ROTATION) || defined(ALIGNED_AXIS)
+ v_rotationMatrix = rotationMatrix;
+#else
+ v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
+#endif
+
+ float enableDepthCheck = 0.0;
+ if (lengthSq < disableDepthTestDistance)
+ {
+ enableDepthCheck = 1.0;
+ }
+
+ float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));
+ float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));
+
+ float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));
+ float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));
+
+ v_compressed.x = eyeDepth;
+ v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;
+ v_compressed.z = dw * SHIFT_LEFT12 + dh;
+ v_compressed.w = iw * SHIFT_LEFT12 + ih;
+ v_originTextureCoordinateAndTranslate.xy = depthOrigin;
+ v_originTextureCoordinateAndTranslate.zw = translate;
+ v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;
+
+#endif
+
+#ifdef SDF
+ vec4 outlineColor;
+ float outlineWidth;
+
+ temp = sdf.x;
+ temp = temp * SHIFT_RIGHT8;
+ outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
+ temp = floor(temp) * SHIFT_RIGHT8;
+ outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
+ outlineColor.r = floor(temp);
+
+ temp = sdf.y;
+ temp = temp * SHIFT_RIGHT8;
+ float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;
+ temp = floor(temp) * SHIFT_RIGHT8;
+ outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;
+ outlineColor.a = floor(temp);
+ outlineColor /= 255.0;
+
+ v_outlineWidth = outlineWidth / 255.0;
+ v_outlineColor = outlineColor;
+ v_outlineColor.a *= translucency;
+#endif
+
+ v_pickColor = pickColor;
+
+ v_color = color;
+ v_color.a *= translucency;
+
+}
+`;
+
+// Source/Scene/Billboard.js
+function Billboard(options, billboardCollection) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ if (defined_default(options.disableDepthTestDistance) && options.disableDepthTestDistance < 0) {
+ throw new DeveloperError_default(
+ "disableDepthTestDistance must be greater than or equal to 0.0."
+ );
+ }
+ let translucencyByDistance = options.translucencyByDistance;
+ let pixelOffsetScaleByDistance = options.pixelOffsetScaleByDistance;
+ let scaleByDistance = options.scaleByDistance;
+ let distanceDisplayCondition = options.distanceDisplayCondition;
+ if (defined_default(translucencyByDistance)) {
+ if (translucencyByDistance.far <= translucencyByDistance.near) {
+ throw new DeveloperError_default(
+ "translucencyByDistance.far must be greater than translucencyByDistance.near."
+ );
+ }
+ translucencyByDistance = NearFarScalar_default.clone(translucencyByDistance);
+ }
+ if (defined_default(pixelOffsetScaleByDistance)) {
+ if (pixelOffsetScaleByDistance.far <= pixelOffsetScaleByDistance.near) {
+ throw new DeveloperError_default(
+ "pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near."
+ );
+ }
+ pixelOffsetScaleByDistance = NearFarScalar_default.clone(
+ pixelOffsetScaleByDistance
+ );
+ }
+ if (defined_default(scaleByDistance)) {
+ if (scaleByDistance.far <= scaleByDistance.near) {
+ throw new DeveloperError_default(
+ "scaleByDistance.far must be greater than scaleByDistance.near."
+ );
+ }
+ scaleByDistance = NearFarScalar_default.clone(scaleByDistance);
+ }
+ if (defined_default(distanceDisplayCondition)) {
+ if (distanceDisplayCondition.far <= distanceDisplayCondition.near) {
+ throw new DeveloperError_default(
+ "distanceDisplayCondition.far must be greater than distanceDisplayCondition.near."
+ );
+ }
+ distanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ distanceDisplayCondition
+ );
+ }
+ this._show = defaultValue_default(options.show, true);
+ this._position = Cartesian3_default.clone(
+ defaultValue_default(options.position, Cartesian3_default.ZERO)
+ );
+ this._actualPosition = Cartesian3_default.clone(this._position);
+ this._pixelOffset = Cartesian2_default.clone(
+ defaultValue_default(options.pixelOffset, Cartesian2_default.ZERO)
+ );
+ this._translate = new Cartesian2_default(0, 0);
+ this._eyeOffset = Cartesian3_default.clone(
+ defaultValue_default(options.eyeOffset, Cartesian3_default.ZERO)
+ );
+ this._heightReference = defaultValue_default(
+ options.heightReference,
+ HeightReference_default.NONE
+ );
+ this._verticalOrigin = defaultValue_default(
+ options.verticalOrigin,
+ VerticalOrigin_default.CENTER
+ );
+ this._horizontalOrigin = defaultValue_default(
+ options.horizontalOrigin,
+ HorizontalOrigin_default.CENTER
+ );
+ this._scale = defaultValue_default(options.scale, 1);
+ this._color = Color_default.clone(defaultValue_default(options.color, Color_default.WHITE));
+ this._rotation = defaultValue_default(options.rotation, 0);
+ this._alignedAxis = Cartesian3_default.clone(
+ defaultValue_default(options.alignedAxis, Cartesian3_default.ZERO)
+ );
+ this._width = options.width;
+ this._height = options.height;
+ this._scaleByDistance = scaleByDistance;
+ this._translucencyByDistance = translucencyByDistance;
+ this._pixelOffsetScaleByDistance = pixelOffsetScaleByDistance;
+ this._sizeInMeters = defaultValue_default(options.sizeInMeters, false);
+ this._distanceDisplayCondition = distanceDisplayCondition;
+ this._disableDepthTestDistance = options.disableDepthTestDistance;
+ this._id = options.id;
+ this._collection = defaultValue_default(options.collection, billboardCollection);
+ this._pickId = void 0;
+ this._pickPrimitive = defaultValue_default(options._pickPrimitive, this);
+ this._billboardCollection = billboardCollection;
+ this._dirty = false;
+ this._index = -1;
+ this._batchIndex = void 0;
+ this._imageIndex = -1;
+ this._imageIndexPromise = void 0;
+ this._imageId = void 0;
+ this._image = void 0;
+ this._imageSubRegion = void 0;
+ this._imageWidth = void 0;
+ this._imageHeight = void 0;
+ this._labelDimensions = void 0;
+ this._labelHorizontalOrigin = void 0;
+ this._labelTranslate = void 0;
+ const image = options.image;
+ let imageId = options.imageId;
+ if (defined_default(image)) {
+ if (!defined_default(imageId)) {
+ if (typeof image === "string") {
+ imageId = image;
+ } else if (defined_default(image.src)) {
+ imageId = image.src;
+ } else {
+ imageId = createGuid_default();
+ }
+ }
+ this._imageId = imageId;
+ this._image = image;
+ }
+ if (defined_default(options.imageSubRegion)) {
+ this._imageId = imageId;
+ this._imageSubRegion = options.imageSubRegion;
+ }
+ if (defined_default(this._billboardCollection._textureAtlas)) {
+ this._loadImage();
+ }
+ this._actualClampedPosition = void 0;
+ this._removeCallbackFunc = void 0;
+ this._mode = SceneMode_default.SCENE3D;
+ this._clusterShow = true;
+ this._outlineColor = Color_default.clone(
+ defaultValue_default(options.outlineColor, Color_default.BLACK)
+ );
+ this._outlineWidth = defaultValue_default(options.outlineWidth, 0);
+ this._updateClamping();
+}
+var SHOW_INDEX = Billboard.SHOW_INDEX = 0;
+var POSITION_INDEX = Billboard.POSITION_INDEX = 1;
+var PIXEL_OFFSET_INDEX = Billboard.PIXEL_OFFSET_INDEX = 2;
+var EYE_OFFSET_INDEX = Billboard.EYE_OFFSET_INDEX = 3;
+var HORIZONTAL_ORIGIN_INDEX = Billboard.HORIZONTAL_ORIGIN_INDEX = 4;
+var VERTICAL_ORIGIN_INDEX = Billboard.VERTICAL_ORIGIN_INDEX = 5;
+var SCALE_INDEX = Billboard.SCALE_INDEX = 6;
+var IMAGE_INDEX_INDEX = Billboard.IMAGE_INDEX_INDEX = 7;
+var COLOR_INDEX = Billboard.COLOR_INDEX = 8;
+var ROTATION_INDEX = Billboard.ROTATION_INDEX = 9;
+var ALIGNED_AXIS_INDEX = Billboard.ALIGNED_AXIS_INDEX = 10;
+var SCALE_BY_DISTANCE_INDEX = Billboard.SCALE_BY_DISTANCE_INDEX = 11;
+var TRANSLUCENCY_BY_DISTANCE_INDEX = Billboard.TRANSLUCENCY_BY_DISTANCE_INDEX = 12;
+var PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX = Billboard.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX = 13;
+var DISTANCE_DISPLAY_CONDITION = Billboard.DISTANCE_DISPLAY_CONDITION = 14;
+var DISABLE_DEPTH_DISTANCE = Billboard.DISABLE_DEPTH_DISTANCE = 15;
+Billboard.TEXTURE_COORDINATE_BOUNDS = 16;
+var SDF_INDEX = Billboard.SDF_INDEX = 17;
+Billboard.NUMBER_OF_PROPERTIES = 18;
+function makeDirty(billboard, propertyChanged) {
+ const billboardCollection = billboard._billboardCollection;
+ if (defined_default(billboardCollection)) {
+ billboardCollection._updateBillboard(billboard, propertyChanged);
+ billboard._dirty = true;
+ }
+}
+Object.defineProperties(Billboard.prototype, {
+ show: {
+ get: function() {
+ return this._show;
+ },
+ set: function(value) {
+ Check_default.typeOf.bool("value", value);
+ if (this._show !== value) {
+ this._show = value;
+ makeDirty(this, SHOW_INDEX);
+ }
+ }
+ },
+ position: {
+ get: function() {
+ return this._position;
+ },
+ set: function(value) {
+ Check_default.typeOf.object("value", value);
+ const position = this._position;
+ if (!Cartesian3_default.equals(position, value)) {
+ Cartesian3_default.clone(value, position);
+ Cartesian3_default.clone(value, this._actualPosition);
+ this._updateClamping();
+ makeDirty(this, POSITION_INDEX);
+ }
+ }
+ },
+ heightReference: {
+ get: function() {
+ return this._heightReference;
+ },
+ set: function(value) {
+ Check_default.typeOf.number("value", value);
+ const heightReference = this._heightReference;
+ if (value !== heightReference) {
+ this._heightReference = value;
+ this._updateClamping();
+ makeDirty(this, POSITION_INDEX);
+ }
+ }
+ },
+ pixelOffset: {
+ get: function() {
+ return this._pixelOffset;
+ },
+ set: function(value) {
+ Check_default.typeOf.object("value", value);
+ const pixelOffset = this._pixelOffset;
+ if (!Cartesian2_default.equals(pixelOffset, value)) {
+ Cartesian2_default.clone(value, pixelOffset);
+ makeDirty(this, PIXEL_OFFSET_INDEX);
+ }
+ }
+ },
+ scaleByDistance: {
+ get: function() {
+ return this._scaleByDistance;
+ },
+ set: function(value) {
+ if (defined_default(value)) {
+ Check_default.typeOf.object("value", value);
+ if (value.far <= value.near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ }
+ const scaleByDistance = this._scaleByDistance;
+ if (!NearFarScalar_default.equals(scaleByDistance, value)) {
+ this._scaleByDistance = NearFarScalar_default.clone(value, scaleByDistance);
+ makeDirty(this, SCALE_BY_DISTANCE_INDEX);
+ }
+ }
+ },
+ translucencyByDistance: {
+ get: function() {
+ return this._translucencyByDistance;
+ },
+ set: function(value) {
+ if (defined_default(value)) {
+ Check_default.typeOf.object("value", value);
+ if (value.far <= value.near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ }
+ const translucencyByDistance = this._translucencyByDistance;
+ if (!NearFarScalar_default.equals(translucencyByDistance, value)) {
+ this._translucencyByDistance = NearFarScalar_default.clone(
+ value,
+ translucencyByDistance
+ );
+ makeDirty(this, TRANSLUCENCY_BY_DISTANCE_INDEX);
+ }
+ }
+ },
+ pixelOffsetScaleByDistance: {
+ get: function() {
+ return this._pixelOffsetScaleByDistance;
+ },
+ set: function(value) {
+ if (defined_default(value)) {
+ Check_default.typeOf.object("value", value);
+ if (value.far <= value.near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ }
+ const pixelOffsetScaleByDistance = this._pixelOffsetScaleByDistance;
+ if (!NearFarScalar_default.equals(pixelOffsetScaleByDistance, value)) {
+ this._pixelOffsetScaleByDistance = NearFarScalar_default.clone(
+ value,
+ pixelOffsetScaleByDistance
+ );
+ makeDirty(this, PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX);
+ }
+ }
+ },
+ eyeOffset: {
+ get: function() {
+ return this._eyeOffset;
+ },
+ set: function(value) {
+ Check_default.typeOf.object("value", value);
+ const eyeOffset = this._eyeOffset;
+ if (!Cartesian3_default.equals(eyeOffset, value)) {
+ Cartesian3_default.clone(value, eyeOffset);
+ makeDirty(this, EYE_OFFSET_INDEX);
+ }
+ }
+ },
+ horizontalOrigin: {
+ get: function() {
+ return this._horizontalOrigin;
+ },
+ set: function(value) {
+ Check_default.typeOf.number("value", value);
+ if (this._horizontalOrigin !== value) {
+ this._horizontalOrigin = value;
+ makeDirty(this, HORIZONTAL_ORIGIN_INDEX);
+ }
+ }
+ },
+ verticalOrigin: {
+ get: function() {
+ return this._verticalOrigin;
+ },
+ set: function(value) {
+ Check_default.typeOf.number("value", value);
+ if (this._verticalOrigin !== value) {
+ this._verticalOrigin = value;
+ makeDirty(this, VERTICAL_ORIGIN_INDEX);
+ }
+ }
+ },
+ scale: {
+ get: function() {
+ return this._scale;
+ },
+ set: function(value) {
+ Check_default.typeOf.number("value", value);
+ if (this._scale !== value) {
+ this._scale = value;
+ makeDirty(this, SCALE_INDEX);
+ }
+ }
+ },
+ color: {
+ get: function() {
+ return this._color;
+ },
+ set: function(value) {
+ Check_default.typeOf.object("value", value);
+ const color = this._color;
+ if (!Color_default.equals(color, value)) {
+ Color_default.clone(value, color);
+ makeDirty(this, COLOR_INDEX);
+ }
+ }
+ },
+ rotation: {
+ get: function() {
+ return this._rotation;
+ },
+ set: function(value) {
+ Check_default.typeOf.number("value", value);
+ if (this._rotation !== value) {
+ this._rotation = value;
+ makeDirty(this, ROTATION_INDEX);
+ }
+ }
+ },
+ alignedAxis: {
+ get: function() {
+ return this._alignedAxis;
+ },
+ set: function(value) {
+ Check_default.typeOf.object("value", value);
+ const alignedAxis = this._alignedAxis;
+ if (!Cartesian3_default.equals(alignedAxis, value)) {
+ Cartesian3_default.clone(value, alignedAxis);
+ makeDirty(this, ALIGNED_AXIS_INDEX);
+ }
+ }
+ },
+ width: {
+ get: function() {
+ return defaultValue_default(this._width, this._imageWidth);
+ },
+ set: function(value) {
+ if (defined_default(value)) {
+ Check_default.typeOf.number("value", value);
+ }
+ if (this._width !== value) {
+ this._width = value;
+ makeDirty(this, IMAGE_INDEX_INDEX);
+ }
+ }
+ },
+ height: {
+ get: function() {
+ return defaultValue_default(this._height, this._imageHeight);
+ },
+ set: function(value) {
+ if (defined_default(value)) {
+ Check_default.typeOf.number("value", value);
+ }
+ if (this._height !== value) {
+ this._height = value;
+ makeDirty(this, IMAGE_INDEX_INDEX);
+ }
+ }
+ },
+ sizeInMeters: {
+ get: function() {
+ return this._sizeInMeters;
+ },
+ set: function(value) {
+ Check_default.typeOf.bool("value", value);
+ if (this._sizeInMeters !== value) {
+ this._sizeInMeters = value;
+ makeDirty(this, COLOR_INDEX);
+ }
+ }
+ },
+ distanceDisplayCondition: {
+ get: function() {
+ return this._distanceDisplayCondition;
+ },
+ set: function(value) {
+ if (!DistanceDisplayCondition_default.equals(value, this._distanceDisplayCondition)) {
+ if (defined_default(value)) {
+ Check_default.typeOf.object("value", value);
+ if (value.far <= value.near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ }
+ this._distanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ value,
+ this._distanceDisplayCondition
+ );
+ makeDirty(this, DISTANCE_DISPLAY_CONDITION);
+ }
+ }
+ },
+ disableDepthTestDistance: {
+ get: function() {
+ return this._disableDepthTestDistance;
+ },
+ set: function(value) {
+ if (defined_default(value)) {
+ Check_default.typeOf.number("value", value);
+ if (value < 0) {
+ throw new DeveloperError_default(
+ "disableDepthTestDistance must be greater than or equal to 0.0."
+ );
+ }
+ }
+ if (this._disableDepthTestDistance !== value) {
+ this._disableDepthTestDistance = value;
+ makeDirty(this, DISABLE_DEPTH_DISTANCE);
+ }
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ },
+ set: function(value) {
+ this._id = value;
+ if (defined_default(this._pickId)) {
+ this._pickId.object.id = value;
+ }
+ }
+ },
+ pickPrimitive: {
+ get: function() {
+ return this._pickPrimitive;
+ },
+ set: function(value) {
+ this._pickPrimitive = value;
+ if (defined_default(this._pickId)) {
+ this._pickId.object.primitive = value;
+ }
+ }
+ },
+ pickId: {
+ get: function() {
+ return this._pickId;
+ }
+ },
+ image: {
+ get: function() {
+ return this._imageId;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ this._imageIndex = -1;
+ this._imageSubRegion = void 0;
+ this._imageId = void 0;
+ this._image = void 0;
+ this._imageIndexPromise = void 0;
+ makeDirty(this, IMAGE_INDEX_INDEX);
+ } else if (typeof value === "string") {
+ this.setImage(value, value);
+ } else if (value instanceof Resource_default) {
+ this.setImage(value.url, value);
+ } else if (defined_default(value.src)) {
+ this.setImage(value.src, value);
+ } else {
+ this.setImage(createGuid_default(), value);
+ }
+ }
+ },
+ ready: {
+ get: function() {
+ return this._imageIndex !== -1;
+ }
+ },
+ _clampedPosition: {
+ get: function() {
+ return this._actualClampedPosition;
+ },
+ set: function(value) {
+ this._actualClampedPosition = Cartesian3_default.clone(
+ value,
+ this._actualClampedPosition
+ );
+ makeDirty(this, POSITION_INDEX);
+ }
+ },
+ clusterShow: {
+ get: function() {
+ return this._clusterShow;
+ },
+ set: function(value) {
+ if (this._clusterShow !== value) {
+ this._clusterShow = value;
+ makeDirty(this, SHOW_INDEX);
+ }
+ }
+ },
+ outlineColor: {
+ get: function() {
+ return this._outlineColor;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const outlineColor = this._outlineColor;
+ if (!Color_default.equals(outlineColor, value)) {
+ Color_default.clone(value, outlineColor);
+ makeDirty(this, SDF_INDEX);
+ }
+ }
+ },
+ outlineWidth: {
+ get: function() {
+ return this._outlineWidth;
+ },
+ set: function(value) {
+ if (this._outlineWidth !== value) {
+ this._outlineWidth = value;
+ makeDirty(this, SDF_INDEX);
+ }
+ }
+ }
+});
+Billboard.prototype.getPickId = function(context) {
+ if (!defined_default(this._pickId)) {
+ this._pickId = context.createPickId({
+ primitive: this._pickPrimitive,
+ collection: this._collection,
+ id: this._id
+ });
+ }
+ return this._pickId;
+};
+Billboard.prototype._updateClamping = function() {
+ Billboard._updateClamping(this._billboardCollection, this);
+};
+var scratchCartographic4 = new Cartographic_default();
+var scratchPosition5 = new Cartesian3_default();
+Billboard._updateClamping = function(collection, owner) {
+ const scene = collection._scene;
+ if (!defined_default(scene) || !defined_default(scene.globe)) {
+ if (owner._heightReference !== HeightReference_default.NONE) {
+ throw new DeveloperError_default(
+ "Height reference is not supported without a scene and globe."
+ );
+ }
+ return;
+ }
+ const globe = scene.globe;
+ const ellipsoid = globe.ellipsoid;
+ const surface = globe._surface;
+ const mode2 = scene.frameState.mode;
+ const modeChanged = mode2 !== owner._mode;
+ owner._mode = mode2;
+ if ((owner._heightReference === HeightReference_default.NONE || modeChanged) && defined_default(owner._removeCallbackFunc)) {
+ owner._removeCallbackFunc();
+ owner._removeCallbackFunc = void 0;
+ owner._clampedPosition = void 0;
+ }
+ if (owner._heightReference === HeightReference_default.NONE || !defined_default(owner._position)) {
+ return;
+ }
+ const position = ellipsoid.cartesianToCartographic(owner._position);
+ if (!defined_default(position)) {
+ owner._actualClampedPosition = void 0;
+ return;
+ }
+ if (defined_default(owner._removeCallbackFunc)) {
+ owner._removeCallbackFunc();
+ }
+ function updateFunction(clampedPosition) {
+ if (owner._heightReference === HeightReference_default.RELATIVE_TO_GROUND) {
+ if (owner._mode === SceneMode_default.SCENE3D) {
+ const clampedCart = ellipsoid.cartesianToCartographic(
+ clampedPosition,
+ scratchCartographic4
+ );
+ clampedCart.height += position.height;
+ ellipsoid.cartographicToCartesian(clampedCart, clampedPosition);
+ } else {
+ clampedPosition.x += position.height;
+ }
+ }
+ owner._clampedPosition = Cartesian3_default.clone(
+ clampedPosition,
+ owner._clampedPosition
+ );
+ }
+ owner._removeCallbackFunc = surface.updateHeight(position, updateFunction);
+ Cartographic_default.clone(position, scratchCartographic4);
+ const height = globe.getHeight(position);
+ if (defined_default(height)) {
+ scratchCartographic4.height = height;
+ }
+ ellipsoid.cartographicToCartesian(scratchCartographic4, scratchPosition5);
+ updateFunction(scratchPosition5);
+};
+Billboard.prototype._loadImage = function() {
+ const atlas = this._billboardCollection._textureAtlas;
+ const imageId = this._imageId;
+ const image = this._image;
+ const imageSubRegion = this._imageSubRegion;
+ let imageIndexPromise;
+ const that = this;
+ function completeImageLoad(index) {
+ if (that._imageId !== imageId || that._image !== image || !BoundingRectangle_default.equals(that._imageSubRegion, imageSubRegion)) {
+ return;
+ }
+ const textureCoordinates = atlas.textureCoordinates[index];
+ that._imageWidth = atlas.texture.width * textureCoordinates.width;
+ that._imageHeight = atlas.texture.height * textureCoordinates.height;
+ that._imageIndex = index;
+ that._ready = true;
+ that._image = void 0;
+ that._imageIndexPromise = void 0;
+ makeDirty(that, IMAGE_INDEX_INDEX);
+ }
+ if (defined_default(image)) {
+ const index = atlas.getImageIndex(imageId);
+ if (defined_default(index)) {
+ completeImageLoad(index);
+ return;
+ }
+ imageIndexPromise = atlas.addImage(imageId, image);
+ }
+ if (defined_default(imageSubRegion)) {
+ imageIndexPromise = atlas.addSubRegion(imageId, imageSubRegion);
+ }
+ this._imageIndexPromise = imageIndexPromise;
+ if (!defined_default(imageIndexPromise)) {
+ return;
+ }
+ imageIndexPromise.then(completeImageLoad).catch(function(error) {
+ console.error(`Error loading image for billboard: ${error}`);
+ that._imageIndexPromise = void 0;
+ });
+};
+Billboard.prototype.setImage = function(id, image) {
+ if (!defined_default(id)) {
+ throw new DeveloperError_default("id is required.");
+ }
+ if (!defined_default(image)) {
+ throw new DeveloperError_default("image is required.");
+ }
+ if (this._imageId === id) {
+ return;
+ }
+ this._imageIndex = -1;
+ this._imageSubRegion = void 0;
+ this._imageId = id;
+ this._image = image;
+ if (defined_default(this._billboardCollection._textureAtlas)) {
+ this._loadImage();
+ }
+};
+Billboard.prototype.setImageSubRegion = function(id, subRegion) {
+ if (!defined_default(id)) {
+ throw new DeveloperError_default("id is required.");
+ }
+ if (!defined_default(subRegion)) {
+ throw new DeveloperError_default("subRegion is required.");
+ }
+ if (this._imageId === id && BoundingRectangle_default.equals(this._imageSubRegion, subRegion)) {
+ return;
+ }
+ this._imageIndex = -1;
+ this._imageId = id;
+ this._imageSubRegion = BoundingRectangle_default.clone(subRegion);
+ if (defined_default(this._billboardCollection._textureAtlas)) {
+ this._loadImage();
+ }
+};
+Billboard.prototype._setTranslate = function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const translate = this._translate;
+ if (!Cartesian2_default.equals(translate, value)) {
+ Cartesian2_default.clone(value, translate);
+ makeDirty(this, PIXEL_OFFSET_INDEX);
+ }
+};
+Billboard.prototype._getActualPosition = function() {
+ return defined_default(this._clampedPosition) ? this._clampedPosition : this._actualPosition;
+};
+Billboard.prototype._setActualPosition = function(value) {
+ if (!defined_default(this._clampedPosition)) {
+ Cartesian3_default.clone(value, this._actualPosition);
+ }
+ makeDirty(this, POSITION_INDEX);
+};
+var tempCartesian3 = new Cartesian4_default();
+Billboard._computeActualPosition = function(billboard, position, frameState, modelMatrix) {
+ if (defined_default(billboard._clampedPosition)) {
+ if (frameState.mode !== billboard._mode) {
+ billboard._updateClamping();
+ }
+ return billboard._clampedPosition;
+ } else if (frameState.mode === SceneMode_default.SCENE3D) {
+ return position;
+ }
+ Matrix4_default.multiplyByPoint(modelMatrix, position, tempCartesian3);
+ return SceneTransforms_default.computeActualWgs84Position(frameState, tempCartesian3);
+};
+var scratchCartesian35 = new Cartesian3_default();
+Billboard._computeScreenSpacePosition = function(modelMatrix, position, eyeOffset, pixelOffset, scene, result) {
+ const positionWorld = Matrix4_default.multiplyByPoint(
+ modelMatrix,
+ position,
+ scratchCartesian35
+ );
+ const positionWC2 = SceneTransforms_default.wgs84WithEyeOffsetToWindowCoordinates(
+ scene,
+ positionWorld,
+ eyeOffset,
+ result
+ );
+ if (!defined_default(positionWC2)) {
+ return void 0;
+ }
+ Cartesian2_default.add(positionWC2, pixelOffset, positionWC2);
+ return positionWC2;
+};
+var scratchPixelOffset = new Cartesian2_default(0, 0);
+Billboard.prototype.computeScreenSpacePosition = function(scene, result) {
+ const billboardCollection = this._billboardCollection;
+ if (!defined_default(result)) {
+ result = new Cartesian2_default();
+ }
+ if (!defined_default(billboardCollection)) {
+ throw new DeveloperError_default(
+ "Billboard must be in a collection. Was it removed?"
+ );
+ }
+ if (!defined_default(scene)) {
+ throw new DeveloperError_default("scene is required.");
+ }
+ Cartesian2_default.clone(this._pixelOffset, scratchPixelOffset);
+ Cartesian2_default.add(scratchPixelOffset, this._translate, scratchPixelOffset);
+ let modelMatrix = billboardCollection.modelMatrix;
+ let position = this._position;
+ if (defined_default(this._clampedPosition)) {
+ position = this._clampedPosition;
+ if (scene.mode !== SceneMode_default.SCENE3D) {
+ const projection = scene.mapProjection;
+ const ellipsoid = projection.ellipsoid;
+ const cart = projection.unproject(position, scratchCartographic4);
+ position = ellipsoid.cartographicToCartesian(cart, scratchCartesian35);
+ modelMatrix = Matrix4_default.IDENTITY;
+ }
+ }
+ const windowCoordinates = Billboard._computeScreenSpacePosition(
+ modelMatrix,
+ position,
+ this._eyeOffset,
+ scratchPixelOffset,
+ scene,
+ result
+ );
+ return windowCoordinates;
+};
+Billboard.getScreenSpaceBoundingBox = function(billboard, screenSpacePosition, result) {
+ let width = billboard.width;
+ let height = billboard.height;
+ const scale = billboard.scale;
+ width *= scale;
+ height *= scale;
+ let x = screenSpacePosition.x;
+ if (billboard.horizontalOrigin === HorizontalOrigin_default.RIGHT) {
+ x -= width;
+ } else if (billboard.horizontalOrigin === HorizontalOrigin_default.CENTER) {
+ x -= width * 0.5;
+ }
+ let y = screenSpacePosition.y;
+ if (billboard.verticalOrigin === VerticalOrigin_default.BOTTOM || billboard.verticalOrigin === VerticalOrigin_default.BASELINE) {
+ y -= height;
+ } else if (billboard.verticalOrigin === VerticalOrigin_default.CENTER) {
+ y -= height * 0.5;
+ }
+ if (!defined_default(result)) {
+ result = new BoundingRectangle_default();
+ }
+ result.x = x;
+ result.y = y;
+ result.width = width;
+ result.height = height;
+ return result;
+};
+Billboard.prototype.equals = function(other) {
+ return this === other || defined_default(other) && this._id === other._id && Cartesian3_default.equals(this._position, other._position) && this._imageId === other._imageId && this._show === other._show && this._scale === other._scale && this._verticalOrigin === other._verticalOrigin && this._horizontalOrigin === other._horizontalOrigin && this._heightReference === other._heightReference && BoundingRectangle_default.equals(this._imageSubRegion, other._imageSubRegion) && Color_default.equals(this._color, other._color) && Cartesian2_default.equals(this._pixelOffset, other._pixelOffset) && Cartesian2_default.equals(this._translate, other._translate) && Cartesian3_default.equals(this._eyeOffset, other._eyeOffset) && NearFarScalar_default.equals(this._scaleByDistance, other._scaleByDistance) && NearFarScalar_default.equals(
+ this._translucencyByDistance,
+ other._translucencyByDistance
+ ) && NearFarScalar_default.equals(
+ this._pixelOffsetScaleByDistance,
+ other._pixelOffsetScaleByDistance
+ ) && DistanceDisplayCondition_default.equals(
+ this._distanceDisplayCondition,
+ other._distanceDisplayCondition
+ ) && this._disableDepthTestDistance === other._disableDepthTestDistance;
+};
+Billboard.prototype._destroy = function() {
+ if (defined_default(this._customData)) {
+ this._billboardCollection._scene.globe._surface.removeTileCustomData(
+ this._customData
+ );
+ this._customData = void 0;
+ }
+ if (defined_default(this._removeCallbackFunc)) {
+ this._removeCallbackFunc();
+ this._removeCallbackFunc = void 0;
+ }
+ this.image = void 0;
+ this._pickId = this._pickId && this._pickId.destroy();
+ this._billboardCollection = void 0;
+};
+var Billboard_default = Billboard;
+
+// Source/Scene/BlendOption.js
+var BlendOption = {
+ OPAQUE: 0,
+ TRANSLUCENT: 1,
+ OPAQUE_AND_TRANSLUCENT: 2
+};
+var BlendOption_default = Object.freeze(BlendOption);
+
+// Source/Scene/SDFSettings.js
+var SDFSettings = {
+ FONT_SIZE: 48,
+ PADDING: 10,
+ RADIUS: 8,
+ CUTOFF: 0.25
+};
+var SDFSettings_default = Object.freeze(SDFSettings);
+
+// Source/Scene/TextureAtlas.js
+function TextureAtlasNode(bottomLeft, topRight, childNode1, childNode2, imageIndex) {
+ this.bottomLeft = defaultValue_default(bottomLeft, Cartesian2_default.ZERO);
+ this.topRight = defaultValue_default(topRight, Cartesian2_default.ZERO);
+ this.childNode1 = childNode1;
+ this.childNode2 = childNode2;
+ this.imageIndex = imageIndex;
+}
+var defaultInitialSize = new Cartesian2_default(16, 16);
+function TextureAtlas(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const borderWidthInPixels = defaultValue_default(options.borderWidthInPixels, 1);
+ const initialSize = defaultValue_default(options.initialSize, defaultInitialSize);
+ if (!defined_default(options.context)) {
+ throw new DeveloperError_default("context is required.");
+ }
+ if (borderWidthInPixels < 0) {
+ throw new DeveloperError_default(
+ "borderWidthInPixels must be greater than or equal to zero."
+ );
+ }
+ if (initialSize.x < 1 || initialSize.y < 1) {
+ throw new DeveloperError_default("initialSize must be greater than zero.");
+ }
+ this._context = options.context;
+ this._pixelFormat = defaultValue_default(options.pixelFormat, PixelFormat_default.RGBA);
+ this._borderWidthInPixels = borderWidthInPixels;
+ this._textureCoordinates = [];
+ this._guid = createGuid_default();
+ this._idHash = {};
+ this._indexHash = {};
+ this._initialSize = initialSize;
+ this._root = void 0;
+}
+Object.defineProperties(TextureAtlas.prototype, {
+ borderWidthInPixels: {
+ get: function() {
+ return this._borderWidthInPixels;
+ }
+ },
+ textureCoordinates: {
+ get: function() {
+ return this._textureCoordinates;
+ }
+ },
+ texture: {
+ get: function() {
+ if (!defined_default(this._texture)) {
+ this._texture = new Texture_default({
+ context: this._context,
+ width: this._initialSize.x,
+ height: this._initialSize.y,
+ pixelFormat: this._pixelFormat
+ });
+ }
+ return this._texture;
+ }
+ },
+ numberOfImages: {
+ get: function() {
+ return this._textureCoordinates.length;
+ }
+ },
+ guid: {
+ get: function() {
+ return this._guid;
+ }
+ }
+});
+function resizeAtlas(textureAtlas, image) {
+ const context = textureAtlas._context;
+ const numImages = textureAtlas.numberOfImages;
+ const scalingFactor = 2;
+ const borderWidthInPixels = textureAtlas._borderWidthInPixels;
+ if (numImages > 0) {
+ const oldAtlasWidth = textureAtlas._texture.width;
+ const oldAtlasHeight = textureAtlas._texture.height;
+ const atlasWidth = scalingFactor * (oldAtlasWidth + image.width + borderWidthInPixels);
+ const atlasHeight = scalingFactor * (oldAtlasHeight + image.height + borderWidthInPixels);
+ const widthRatio = oldAtlasWidth / atlasWidth;
+ const heightRatio = oldAtlasHeight / atlasHeight;
+ const nodeBottomRight = new TextureAtlasNode(
+ new Cartesian2_default(oldAtlasWidth + borderWidthInPixels, borderWidthInPixels),
+ new Cartesian2_default(atlasWidth, oldAtlasHeight)
+ );
+ const nodeBottomHalf = new TextureAtlasNode(
+ new Cartesian2_default(),
+ new Cartesian2_default(atlasWidth, oldAtlasHeight),
+ textureAtlas._root,
+ nodeBottomRight
+ );
+ const nodeTopHalf = new TextureAtlasNode(
+ new Cartesian2_default(borderWidthInPixels, oldAtlasHeight + borderWidthInPixels),
+ new Cartesian2_default(atlasWidth, atlasHeight)
+ );
+ const nodeMain = new TextureAtlasNode(
+ new Cartesian2_default(),
+ new Cartesian2_default(atlasWidth, atlasHeight),
+ nodeBottomHalf,
+ nodeTopHalf
+ );
+ for (let i = 0; i < textureAtlas._textureCoordinates.length; i++) {
+ const texCoord = textureAtlas._textureCoordinates[i];
+ if (defined_default(texCoord)) {
+ texCoord.x *= widthRatio;
+ texCoord.y *= heightRatio;
+ texCoord.width *= widthRatio;
+ texCoord.height *= heightRatio;
+ }
+ }
+ const newTexture = new Texture_default({
+ context: textureAtlas._context,
+ width: atlasWidth,
+ height: atlasHeight,
+ pixelFormat: textureAtlas._pixelFormat
+ });
+ const framebuffer = new Framebuffer_default({
+ context,
+ colorTextures: [textureAtlas._texture],
+ destroyAttachments: false
+ });
+ framebuffer._bind();
+ newTexture.copyFromFramebuffer(0, 0, 0, 0, atlasWidth, atlasHeight);
+ framebuffer._unBind();
+ framebuffer.destroy();
+ textureAtlas._texture = textureAtlas._texture && textureAtlas._texture.destroy();
+ textureAtlas._texture = newTexture;
+ textureAtlas._root = nodeMain;
+ } else {
+ let initialWidth = scalingFactor * (image.width + 2 * borderWidthInPixels);
+ let initialHeight = scalingFactor * (image.height + 2 * borderWidthInPixels);
+ if (initialWidth < textureAtlas._initialSize.x) {
+ initialWidth = textureAtlas._initialSize.x;
+ }
+ if (initialHeight < textureAtlas._initialSize.y) {
+ initialHeight = textureAtlas._initialSize.y;
+ }
+ textureAtlas._texture = textureAtlas._texture && textureAtlas._texture.destroy();
+ textureAtlas._texture = new Texture_default({
+ context: textureAtlas._context,
+ width: initialWidth,
+ height: initialHeight,
+ pixelFormat: textureAtlas._pixelFormat
+ });
+ textureAtlas._root = new TextureAtlasNode(
+ new Cartesian2_default(borderWidthInPixels, borderWidthInPixels),
+ new Cartesian2_default(initialWidth, initialHeight)
+ );
+ }
+}
+function findNode(textureAtlas, node, image) {
+ if (!defined_default(node)) {
+ return void 0;
+ }
+ if (!defined_default(node.childNode1) && !defined_default(node.childNode2)) {
+ if (defined_default(node.imageIndex)) {
+ return void 0;
+ }
+ const nodeWidth = node.topRight.x - node.bottomLeft.x;
+ const nodeHeight = node.topRight.y - node.bottomLeft.y;
+ const widthDifference = nodeWidth - image.width;
+ const heightDifference = nodeHeight - image.height;
+ if (widthDifference < 0 || heightDifference < 0) {
+ return void 0;
+ }
+ if (widthDifference === 0 && heightDifference === 0) {
+ return node;
+ }
+ if (widthDifference > heightDifference) {
+ node.childNode1 = new TextureAtlasNode(
+ new Cartesian2_default(node.bottomLeft.x, node.bottomLeft.y),
+ new Cartesian2_default(node.bottomLeft.x + image.width, node.topRight.y)
+ );
+ const childNode2BottomLeftX = node.bottomLeft.x + image.width + textureAtlas._borderWidthInPixels;
+ if (childNode2BottomLeftX < node.topRight.x) {
+ node.childNode2 = new TextureAtlasNode(
+ new Cartesian2_default(childNode2BottomLeftX, node.bottomLeft.y),
+ new Cartesian2_default(node.topRight.x, node.topRight.y)
+ );
+ }
+ } else {
+ node.childNode1 = new TextureAtlasNode(
+ new Cartesian2_default(node.bottomLeft.x, node.bottomLeft.y),
+ new Cartesian2_default(node.topRight.x, node.bottomLeft.y + image.height)
+ );
+ const childNode2BottomLeftY = node.bottomLeft.y + image.height + textureAtlas._borderWidthInPixels;
+ if (childNode2BottomLeftY < node.topRight.y) {
+ node.childNode2 = new TextureAtlasNode(
+ new Cartesian2_default(node.bottomLeft.x, childNode2BottomLeftY),
+ new Cartesian2_default(node.topRight.x, node.topRight.y)
+ );
+ }
+ }
+ return findNode(textureAtlas, node.childNode1, image);
+ }
+ return findNode(textureAtlas, node.childNode1, image) || findNode(textureAtlas, node.childNode2, image);
+}
+function addImage(textureAtlas, image, index) {
+ const node = findNode(textureAtlas, textureAtlas._root, image);
+ if (defined_default(node)) {
+ node.imageIndex = index;
+ const atlasWidth = textureAtlas._texture.width;
+ const atlasHeight = textureAtlas._texture.height;
+ const nodeWidth = node.topRight.x - node.bottomLeft.x;
+ const nodeHeight = node.topRight.y - node.bottomLeft.y;
+ const x = node.bottomLeft.x / atlasWidth;
+ const y = node.bottomLeft.y / atlasHeight;
+ const w = nodeWidth / atlasWidth;
+ const h = nodeHeight / atlasHeight;
+ textureAtlas._textureCoordinates[index] = new BoundingRectangle_default(x, y, w, h);
+ textureAtlas._texture.copyFrom({
+ source: image,
+ xOffset: node.bottomLeft.x,
+ yOffset: node.bottomLeft.y
+ });
+ } else {
+ resizeAtlas(textureAtlas, image);
+ addImage(textureAtlas, image, index);
+ }
+ textureAtlas._guid = createGuid_default();
+}
+function getIndex(atlas, image) {
+ if (!defined_default(atlas) || atlas.isDestroyed()) {
+ return -1;
+ }
+ const index = atlas.numberOfImages;
+ addImage(atlas, image, index);
+ return index;
+}
+TextureAtlas.prototype.getImageIndex = function(id) {
+ if (!defined_default(id)) {
+ throw new DeveloperError_default("id is required.");
+ }
+ return this._indexHash[id];
+};
+TextureAtlas.prototype.addImageSync = function(id, image) {
+ if (!defined_default(id)) {
+ throw new DeveloperError_default("id is required.");
+ }
+ if (!defined_default(image)) {
+ throw new DeveloperError_default("image is required.");
+ }
+ let index = this._indexHash[id];
+ if (defined_default(index)) {
+ return index;
+ }
+ index = getIndex(this, image);
+ this._idHash[id] = Promise.resolve(index);
+ this._indexHash[id] = index;
+ return index;
+};
+TextureAtlas.prototype.addImage = function(id, image) {
+ if (!defined_default(id)) {
+ throw new DeveloperError_default("id is required.");
+ }
+ if (!defined_default(image)) {
+ throw new DeveloperError_default("image is required.");
+ }
+ let indexPromise = this._idHash[id];
+ if (defined_default(indexPromise)) {
+ return indexPromise;
+ }
+ if (typeof image === "function") {
+ image = image(id);
+ if (!defined_default(image)) {
+ throw new DeveloperError_default("image is required.");
+ }
+ } else if (typeof image === "string" || image instanceof Resource_default) {
+ const resource = Resource_default.createIfNeeded(image);
+ image = resource.fetchImage();
+ }
+ const that = this;
+ indexPromise = Promise.resolve(image).then(function(image2) {
+ const index = getIndex(that, image2);
+ that._indexHash[id] = index;
+ return index;
+ });
+ this._idHash[id] = indexPromise;
+ return indexPromise;
+};
+TextureAtlas.prototype.addSubRegion = function(id, subRegion) {
+ if (!defined_default(id)) {
+ throw new DeveloperError_default("id is required.");
+ }
+ if (!defined_default(subRegion)) {
+ throw new DeveloperError_default("subRegion is required.");
+ }
+ const indexPromise = this._idHash[id];
+ if (!defined_default(indexPromise)) {
+ throw new RuntimeError_default(`image with id "${id}" not found in the atlas.`);
+ }
+ const that = this;
+ return Promise.resolve(indexPromise).then(function(index) {
+ if (index === -1) {
+ return -1;
+ }
+ const atlasWidth = that._texture.width;
+ const atlasHeight = that._texture.height;
+ const numImages = that.numberOfImages;
+ const baseRegion = that._textureCoordinates[index];
+ const x = baseRegion.x + subRegion.x / atlasWidth;
+ const y = baseRegion.y + subRegion.y / atlasHeight;
+ const w = subRegion.width / atlasWidth;
+ const h = subRegion.height / atlasHeight;
+ that._textureCoordinates.push(new BoundingRectangle_default(x, y, w, h));
+ that._guid = createGuid_default();
+ return numImages;
+ });
+};
+TextureAtlas.prototype.isDestroyed = function() {
+ return false;
+};
+TextureAtlas.prototype.destroy = function() {
+ this._texture = this._texture && this._texture.destroy();
+ return destroyObject_default(this);
+};
+var TextureAtlas_default = TextureAtlas;
+
+// Source/Scene/BillboardCollection.js
+var SHOW_INDEX2 = Billboard_default.SHOW_INDEX;
+var POSITION_INDEX2 = Billboard_default.POSITION_INDEX;
+var PIXEL_OFFSET_INDEX2 = Billboard_default.PIXEL_OFFSET_INDEX;
+var EYE_OFFSET_INDEX2 = Billboard_default.EYE_OFFSET_INDEX;
+var HORIZONTAL_ORIGIN_INDEX2 = Billboard_default.HORIZONTAL_ORIGIN_INDEX;
+var VERTICAL_ORIGIN_INDEX2 = Billboard_default.VERTICAL_ORIGIN_INDEX;
+var SCALE_INDEX2 = Billboard_default.SCALE_INDEX;
+var IMAGE_INDEX_INDEX2 = Billboard_default.IMAGE_INDEX_INDEX;
+var COLOR_INDEX2 = Billboard_default.COLOR_INDEX;
+var ROTATION_INDEX2 = Billboard_default.ROTATION_INDEX;
+var ALIGNED_AXIS_INDEX2 = Billboard_default.ALIGNED_AXIS_INDEX;
+var SCALE_BY_DISTANCE_INDEX2 = Billboard_default.SCALE_BY_DISTANCE_INDEX;
+var TRANSLUCENCY_BY_DISTANCE_INDEX2 = Billboard_default.TRANSLUCENCY_BY_DISTANCE_INDEX;
+var PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX2 = Billboard_default.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX;
+var DISTANCE_DISPLAY_CONDITION_INDEX = Billboard_default.DISTANCE_DISPLAY_CONDITION;
+var DISABLE_DEPTH_DISTANCE2 = Billboard_default.DISABLE_DEPTH_DISTANCE;
+var TEXTURE_COORDINATE_BOUNDS = Billboard_default.TEXTURE_COORDINATE_BOUNDS;
+var SDF_INDEX2 = Billboard_default.SDF_INDEX;
+var NUMBER_OF_PROPERTIES = Billboard_default.NUMBER_OF_PROPERTIES;
+var attributeLocations;
+var attributeLocationsBatched = {
+ positionHighAndScale: 0,
+ positionLowAndRotation: 1,
+ compressedAttribute0: 2,
+ compressedAttribute1: 3,
+ compressedAttribute2: 4,
+ eyeOffset: 5,
+ scaleByDistance: 6,
+ pixelOffsetScaleByDistance: 7,
+ compressedAttribute3: 8,
+ textureCoordinateBoundsOrLabelTranslate: 9,
+ a_batchId: 10,
+ sdf: 11
+};
+var attributeLocationsInstanced = {
+ direction: 0,
+ positionHighAndScale: 1,
+ positionLowAndRotation: 2,
+ compressedAttribute0: 3,
+ compressedAttribute1: 4,
+ compressedAttribute2: 5,
+ eyeOffset: 6,
+ scaleByDistance: 7,
+ pixelOffsetScaleByDistance: 8,
+ compressedAttribute3: 9,
+ textureCoordinateBoundsOrLabelTranslate: 10,
+ a_batchId: 11,
+ sdf: 12
+};
+function BillboardCollection(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._scene = options.scene;
+ this._batchTable = options.batchTable;
+ this._textureAtlas = void 0;
+ this._textureAtlasGUID = void 0;
+ this._destroyTextureAtlas = true;
+ this._sp = void 0;
+ this._spTranslucent = void 0;
+ this._rsOpaque = void 0;
+ this._rsTranslucent = void 0;
+ this._vaf = void 0;
+ this._billboards = [];
+ this._billboardsToUpdate = [];
+ this._billboardsToUpdateIndex = 0;
+ this._billboardsRemoved = false;
+ this._createVertexArray = false;
+ this._shaderRotation = false;
+ this._compiledShaderRotation = false;
+ this._shaderAlignedAxis = false;
+ this._compiledShaderAlignedAxis = false;
+ this._shaderScaleByDistance = false;
+ this._compiledShaderScaleByDistance = false;
+ this._shaderTranslucencyByDistance = false;
+ this._compiledShaderTranslucencyByDistance = false;
+ this._shaderPixelOffsetScaleByDistance = false;
+ this._compiledShaderPixelOffsetScaleByDistance = false;
+ this._shaderDistanceDisplayCondition = false;
+ this._compiledShaderDistanceDisplayCondition = false;
+ this._shaderDisableDepthDistance = false;
+ this._compiledShaderDisableDepthDistance = false;
+ this._shaderClampToGround = false;
+ this._compiledShaderClampToGround = false;
+ this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES);
+ this._maxSize = 0;
+ this._maxEyeOffset = 0;
+ this._maxScale = 1;
+ this._maxPixelOffset = 0;
+ this._allHorizontalCenter = true;
+ this._allVerticalCenter = true;
+ this._allSizedInMeters = true;
+ this._baseVolume = new BoundingSphere_default();
+ this._baseVolumeWC = new BoundingSphere_default();
+ this._baseVolume2D = new BoundingSphere_default();
+ this._boundingVolume = new BoundingSphere_default();
+ this._boundingVolumeDirty = false;
+ this._colorCommands = [];
+ this.show = defaultValue_default(options.show, true);
+ this.modelMatrix = Matrix4_default.clone(
+ defaultValue_default(options.modelMatrix, Matrix4_default.IDENTITY)
+ );
+ this._modelMatrix = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this.debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this.debugShowTextureAtlas = defaultValue_default(
+ options.debugShowTextureAtlas,
+ false
+ );
+ this.blendOption = defaultValue_default(
+ options.blendOption,
+ BlendOption_default.OPAQUE_AND_TRANSLUCENT
+ );
+ this._blendOption = void 0;
+ this._mode = SceneMode_default.SCENE3D;
+ this._buffersUsage = [
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW
+ ];
+ this._highlightColor = Color_default.clone(Color_default.WHITE);
+ const that = this;
+ this._uniforms = {
+ u_atlas: function() {
+ return that._textureAtlas.texture;
+ },
+ u_highlightColor: function() {
+ return that._highlightColor;
+ }
+ };
+ const scene = this._scene;
+ if (defined_default(scene) && defined_default(scene.terrainProviderChanged)) {
+ this._removeCallbackFunc = scene.terrainProviderChanged.addEventListener(
+ function() {
+ const billboards = this._billboards;
+ const length3 = billboards.length;
+ for (let i = 0; i < length3; ++i) {
+ if (defined_default(billboards[i])) {
+ billboards[i]._updateClamping();
+ }
+ }
+ },
+ this
+ );
+ }
+}
+Object.defineProperties(BillboardCollection.prototype, {
+ length: {
+ get: function() {
+ removeBillboards(this);
+ return this._billboards.length;
+ }
+ },
+ textureAtlas: {
+ get: function() {
+ return this._textureAtlas;
+ },
+ set: function(value) {
+ if (this._textureAtlas !== value) {
+ this._textureAtlas = this._destroyTextureAtlas && this._textureAtlas && this._textureAtlas.destroy();
+ this._textureAtlas = value;
+ this._createVertexArray = true;
+ }
+ }
+ },
+ destroyTextureAtlas: {
+ get: function() {
+ return this._destroyTextureAtlas;
+ },
+ set: function(value) {
+ this._destroyTextureAtlas = value;
+ }
+ }
+});
+function destroyBillboards(billboards) {
+ const length3 = billboards.length;
+ for (let i = 0; i < length3; ++i) {
+ if (billboards[i]) {
+ billboards[i]._destroy();
+ }
+ }
+}
+BillboardCollection.prototype.add = function(options) {
+ const billboard = new Billboard_default(options, this);
+ billboard._index = this._billboards.length;
+ this._billboards.push(billboard);
+ this._createVertexArray = true;
+ return billboard;
+};
+BillboardCollection.prototype.remove = function(billboard) {
+ if (this.contains(billboard)) {
+ this._billboards[billboard._index] = void 0;
+ this._billboardsRemoved = true;
+ this._createVertexArray = true;
+ billboard._destroy();
+ return true;
+ }
+ return false;
+};
+BillboardCollection.prototype.removeAll = function() {
+ destroyBillboards(this._billboards);
+ this._billboards = [];
+ this._billboardsToUpdate = [];
+ this._billboardsToUpdateIndex = 0;
+ this._billboardsRemoved = false;
+ this._createVertexArray = true;
+};
+function removeBillboards(billboardCollection) {
+ if (billboardCollection._billboardsRemoved) {
+ billboardCollection._billboardsRemoved = false;
+ const newBillboards = [];
+ const billboards = billboardCollection._billboards;
+ const length3 = billboards.length;
+ for (let i = 0, j = 0; i < length3; ++i) {
+ const billboard = billboards[i];
+ if (defined_default(billboard)) {
+ billboard._index = j++;
+ newBillboards.push(billboard);
+ }
+ }
+ billboardCollection._billboards = newBillboards;
+ }
+}
+BillboardCollection.prototype._updateBillboard = function(billboard, propertyChanged) {
+ if (!billboard._dirty) {
+ this._billboardsToUpdate[this._billboardsToUpdateIndex++] = billboard;
+ }
+ ++this._propertiesChanged[propertyChanged];
+};
+BillboardCollection.prototype.contains = function(billboard) {
+ return defined_default(billboard) && billboard._billboardCollection === this;
+};
+BillboardCollection.prototype.get = function(index) {
+ Check_default.typeOf.number("index", index);
+ removeBillboards(this);
+ return this._billboards[index];
+};
+var getIndexBuffer2;
+function getIndexBufferBatched(context) {
+ const sixteenK = 16 * 1024;
+ let indexBuffer = context.cache.billboardCollection_indexBufferBatched;
+ if (defined_default(indexBuffer)) {
+ return indexBuffer;
+ }
+ const length3 = sixteenK * 6 - 6;
+ const indices2 = new Uint16Array(length3);
+ for (let i = 0, j = 0; i < length3; i += 6, j += 4) {
+ indices2[i] = j;
+ indices2[i + 1] = j + 1;
+ indices2[i + 2] = j + 2;
+ indices2[i + 3] = j + 0;
+ indices2[i + 4] = j + 2;
+ indices2[i + 5] = j + 3;
+ }
+ indexBuffer = Buffer_default.createIndexBuffer({
+ context,
+ typedArray: indices2,
+ usage: BufferUsage_default.STATIC_DRAW,
+ indexDatatype: IndexDatatype_default.UNSIGNED_SHORT
+ });
+ indexBuffer.vertexArrayDestroyable = false;
+ context.cache.billboardCollection_indexBufferBatched = indexBuffer;
+ return indexBuffer;
+}
+function getIndexBufferInstanced(context) {
+ let indexBuffer = context.cache.billboardCollection_indexBufferInstanced;
+ if (defined_default(indexBuffer)) {
+ return indexBuffer;
+ }
+ indexBuffer = Buffer_default.createIndexBuffer({
+ context,
+ typedArray: new Uint16Array([0, 1, 2, 0, 2, 3]),
+ usage: BufferUsage_default.STATIC_DRAW,
+ indexDatatype: IndexDatatype_default.UNSIGNED_SHORT
+ });
+ indexBuffer.vertexArrayDestroyable = false;
+ context.cache.billboardCollection_indexBufferInstanced = indexBuffer;
+ return indexBuffer;
+}
+function getVertexBufferInstanced(context) {
+ let vertexBuffer = context.cache.billboardCollection_vertexBufferInstanced;
+ if (defined_default(vertexBuffer)) {
+ return vertexBuffer;
+ }
+ vertexBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ vertexBuffer.vertexArrayDestroyable = false;
+ context.cache.billboardCollection_vertexBufferInstanced = vertexBuffer;
+ return vertexBuffer;
+}
+BillboardCollection.prototype.computeNewBuffersUsage = function() {
+ const buffersUsage = this._buffersUsage;
+ let usageChanged = false;
+ const properties = this._propertiesChanged;
+ for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {
+ const newUsage = properties[k] === 0 ? BufferUsage_default.STATIC_DRAW : BufferUsage_default.STREAM_DRAW;
+ usageChanged = usageChanged || buffersUsage[k] !== newUsage;
+ buffersUsage[k] = newUsage;
+ }
+ return usageChanged;
+};
+function createVAF(context, numberOfBillboards, buffersUsage, instanced, batchTable, sdf) {
+ const attributes = [
+ {
+ index: attributeLocations.positionHighAndScale,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[POSITION_INDEX2]
+ },
+ {
+ index: attributeLocations.positionLowAndRotation,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[POSITION_INDEX2]
+ },
+ {
+ index: attributeLocations.compressedAttribute0,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[PIXEL_OFFSET_INDEX2]
+ },
+ {
+ index: attributeLocations.compressedAttribute1,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[TRANSLUCENCY_BY_DISTANCE_INDEX2]
+ },
+ {
+ index: attributeLocations.compressedAttribute2,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[COLOR_INDEX2]
+ },
+ {
+ index: attributeLocations.eyeOffset,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[EYE_OFFSET_INDEX2]
+ },
+ {
+ index: attributeLocations.scaleByDistance,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[SCALE_BY_DISTANCE_INDEX2]
+ },
+ {
+ index: attributeLocations.pixelOffsetScaleByDistance,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX2]
+ },
+ {
+ index: attributeLocations.compressedAttribute3,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[DISTANCE_DISPLAY_CONDITION_INDEX]
+ },
+ {
+ index: attributeLocations.textureCoordinateBoundsOrLabelTranslate,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[TEXTURE_COORDINATE_BOUNDS]
+ }
+ ];
+ if (instanced) {
+ attributes.push({
+ index: attributeLocations.direction,
+ componentsPerAttribute: 2,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ vertexBuffer: getVertexBufferInstanced(context)
+ });
+ }
+ if (defined_default(batchTable)) {
+ attributes.push({
+ index: attributeLocations.a_batchId,
+ componentsPerAttribute: 1,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ bufferUsage: BufferUsage_default.STATIC_DRAW
+ });
+ }
+ if (sdf) {
+ attributes.push({
+ index: attributeLocations.sdf,
+ componentsPerAttribute: 2,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[SDF_INDEX2]
+ });
+ }
+ const sizeInVertices = instanced ? numberOfBillboards : 4 * numberOfBillboards;
+ return new VertexArrayFacade_default(context, attributes, sizeInVertices, instanced);
+}
+var writePositionScratch = new EncodedCartesian3_default();
+function writePositionScaleAndRotation(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ let i;
+ const positionHighWriter = vafWriters[attributeLocations.positionHighAndScale];
+ const positionLowWriter = vafWriters[attributeLocations.positionLowAndRotation];
+ const position = billboard._getActualPosition();
+ if (billboardCollection._mode === SceneMode_default.SCENE3D) {
+ BoundingSphere_default.expand(
+ billboardCollection._baseVolume,
+ position,
+ billboardCollection._baseVolume
+ );
+ billboardCollection._boundingVolumeDirty = true;
+ }
+ EncodedCartesian3_default.fromCartesian(position, writePositionScratch);
+ const scale = billboard.scale;
+ const rotation = billboard.rotation;
+ if (rotation !== 0) {
+ billboardCollection._shaderRotation = true;
+ }
+ billboardCollection._maxScale = Math.max(
+ billboardCollection._maxScale,
+ scale
+ );
+ const high = writePositionScratch.high;
+ const low = writePositionScratch.low;
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ positionHighWriter(i, high.x, high.y, high.z, scale);
+ positionLowWriter(i, low.x, low.y, low.z, rotation);
+ } else {
+ i = billboard._index * 4;
+ positionHighWriter(i + 0, high.x, high.y, high.z, scale);
+ positionHighWriter(i + 1, high.x, high.y, high.z, scale);
+ positionHighWriter(i + 2, high.x, high.y, high.z, scale);
+ positionHighWriter(i + 3, high.x, high.y, high.z, scale);
+ positionLowWriter(i + 0, low.x, low.y, low.z, rotation);
+ positionLowWriter(i + 1, low.x, low.y, low.z, rotation);
+ positionLowWriter(i + 2, low.x, low.y, low.z, rotation);
+ positionLowWriter(i + 3, low.x, low.y, low.z, rotation);
+ }
+}
+var scratchCartesian24 = new Cartesian2_default();
+var UPPER_BOUND = 32768;
+var LEFT_SHIFT16 = 65536;
+var LEFT_SHIFT12 = 4096;
+var LEFT_SHIFT8 = 256;
+var LEFT_SHIFT7 = 128;
+var LEFT_SHIFT5 = 32;
+var LEFT_SHIFT3 = 8;
+var LEFT_SHIFT2 = 4;
+var RIGHT_SHIFT8 = 1 / 256;
+var LOWER_LEFT = 0;
+var LOWER_RIGHT = 2;
+var UPPER_RIGHT = 3;
+var UPPER_LEFT = 1;
+function writeCompressedAttrib0(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ let i;
+ const writer = vafWriters[attributeLocations.compressedAttribute0];
+ const pixelOffset = billboard.pixelOffset;
+ const pixelOffsetX = pixelOffset.x;
+ const pixelOffsetY = pixelOffset.y;
+ const translate = billboard._translate;
+ const translateX = translate.x;
+ const translateY = translate.y;
+ billboardCollection._maxPixelOffset = Math.max(
+ billboardCollection._maxPixelOffset,
+ Math.abs(pixelOffsetX + translateX),
+ Math.abs(-pixelOffsetY + translateY)
+ );
+ const horizontalOrigin = billboard.horizontalOrigin;
+ let verticalOrigin = billboard._verticalOrigin;
+ let show = billboard.show && billboard.clusterShow;
+ if (billboard.color.alpha === 0) {
+ show = false;
+ }
+ if (verticalOrigin === VerticalOrigin_default.BASELINE) {
+ verticalOrigin = VerticalOrigin_default.BOTTOM;
+ }
+ billboardCollection._allHorizontalCenter = billboardCollection._allHorizontalCenter && horizontalOrigin === HorizontalOrigin_default.CENTER;
+ billboardCollection._allVerticalCenter = billboardCollection._allVerticalCenter && verticalOrigin === VerticalOrigin_default.CENTER;
+ let bottomLeftX = 0;
+ let bottomLeftY = 0;
+ let width = 0;
+ let height = 0;
+ const index = billboard._imageIndex;
+ if (index !== -1) {
+ const imageRectangle = textureAtlasCoordinates[index];
+ if (!defined_default(imageRectangle)) {
+ throw new DeveloperError_default(`Invalid billboard image index: ${index}`);
+ }
+ bottomLeftX = imageRectangle.x;
+ bottomLeftY = imageRectangle.y;
+ width = imageRectangle.width;
+ height = imageRectangle.height;
+ }
+ const topRightX = bottomLeftX + width;
+ const topRightY = bottomLeftY + height;
+ let compressed0 = Math.floor(
+ Math_default.clamp(pixelOffsetX, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND
+ ) * LEFT_SHIFT7;
+ compressed0 += (horizontalOrigin + 1) * LEFT_SHIFT5;
+ compressed0 += (verticalOrigin + 1) * LEFT_SHIFT3;
+ compressed0 += (show ? 1 : 0) * LEFT_SHIFT2;
+ let compressed1 = Math.floor(
+ Math_default.clamp(pixelOffsetY, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND
+ ) * LEFT_SHIFT8;
+ let compressed2 = Math.floor(
+ Math_default.clamp(translateX, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND
+ ) * LEFT_SHIFT8;
+ const tempTanslateY = (Math_default.clamp(translateY, -UPPER_BOUND, UPPER_BOUND) + UPPER_BOUND) * RIGHT_SHIFT8;
+ const upperTranslateY = Math.floor(tempTanslateY);
+ const lowerTranslateY = Math.floor(
+ (tempTanslateY - upperTranslateY) * LEFT_SHIFT8
+ );
+ compressed1 += upperTranslateY;
+ compressed2 += lowerTranslateY;
+ scratchCartesian24.x = bottomLeftX;
+ scratchCartesian24.y = bottomLeftY;
+ const compressedTexCoordsLL = AttributeCompression_default.compressTextureCoordinates(
+ scratchCartesian24
+ );
+ scratchCartesian24.x = topRightX;
+ const compressedTexCoordsLR = AttributeCompression_default.compressTextureCoordinates(
+ scratchCartesian24
+ );
+ scratchCartesian24.y = topRightY;
+ const compressedTexCoordsUR = AttributeCompression_default.compressTextureCoordinates(
+ scratchCartesian24
+ );
+ scratchCartesian24.x = bottomLeftX;
+ const compressedTexCoordsUL = AttributeCompression_default.compressTextureCoordinates(
+ scratchCartesian24
+ );
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ writer(i, compressed0, compressed1, compressed2, compressedTexCoordsLL);
+ } else {
+ i = billboard._index * 4;
+ writer(
+ i + 0,
+ compressed0 + LOWER_LEFT,
+ compressed1,
+ compressed2,
+ compressedTexCoordsLL
+ );
+ writer(
+ i + 1,
+ compressed0 + LOWER_RIGHT,
+ compressed1,
+ compressed2,
+ compressedTexCoordsLR
+ );
+ writer(
+ i + 2,
+ compressed0 + UPPER_RIGHT,
+ compressed1,
+ compressed2,
+ compressedTexCoordsUR
+ );
+ writer(
+ i + 3,
+ compressed0 + UPPER_LEFT,
+ compressed1,
+ compressed2,
+ compressedTexCoordsUL
+ );
+ }
+}
+function writeCompressedAttrib1(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ let i;
+ const writer = vafWriters[attributeLocations.compressedAttribute1];
+ const alignedAxis = billboard.alignedAxis;
+ if (!Cartesian3_default.equals(alignedAxis, Cartesian3_default.ZERO)) {
+ billboardCollection._shaderAlignedAxis = true;
+ }
+ let near = 0;
+ let nearValue = 1;
+ let far = 1;
+ let farValue = 1;
+ const translucency = billboard.translucencyByDistance;
+ if (defined_default(translucency)) {
+ near = translucency.near;
+ nearValue = translucency.nearValue;
+ far = translucency.far;
+ farValue = translucency.farValue;
+ if (nearValue !== 1 || farValue !== 1) {
+ billboardCollection._shaderTranslucencyByDistance = true;
+ }
+ }
+ let width = 0;
+ const index = billboard._imageIndex;
+ if (index !== -1) {
+ const imageRectangle = textureAtlasCoordinates[index];
+ if (!defined_default(imageRectangle)) {
+ throw new DeveloperError_default(`Invalid billboard image index: ${index}`);
+ }
+ width = imageRectangle.width;
+ }
+ const textureWidth = billboardCollection._textureAtlas.texture.width;
+ const imageWidth = Math.round(
+ defaultValue_default(billboard.width, textureWidth * width)
+ );
+ billboardCollection._maxSize = Math.max(
+ billboardCollection._maxSize,
+ imageWidth
+ );
+ let compressed0 = Math_default.clamp(imageWidth, 0, LEFT_SHIFT16);
+ let compressed1 = 0;
+ if (Math.abs(Cartesian3_default.magnitudeSquared(alignedAxis) - 1) < Math_default.EPSILON6) {
+ compressed1 = AttributeCompression_default.octEncodeFloat(alignedAxis);
+ }
+ nearValue = Math_default.clamp(nearValue, 0, 1);
+ nearValue = nearValue === 1 ? 255 : nearValue * 255 | 0;
+ compressed0 = compressed0 * LEFT_SHIFT8 + nearValue;
+ farValue = Math_default.clamp(farValue, 0, 1);
+ farValue = farValue === 1 ? 255 : farValue * 255 | 0;
+ compressed1 = compressed1 * LEFT_SHIFT8 + farValue;
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ writer(i, compressed0, compressed1, near, far);
+ } else {
+ i = billboard._index * 4;
+ writer(i + 0, compressed0, compressed1, near, far);
+ writer(i + 1, compressed0, compressed1, near, far);
+ writer(i + 2, compressed0, compressed1, near, far);
+ writer(i + 3, compressed0, compressed1, near, far);
+ }
+}
+function writeCompressedAttrib2(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ let i;
+ const writer = vafWriters[attributeLocations.compressedAttribute2];
+ const color = billboard.color;
+ const pickColor = !defined_default(billboardCollection._batchTable) ? billboard.getPickId(frameState.context).color : Color_default.WHITE;
+ const sizeInMeters = billboard.sizeInMeters ? 1 : 0;
+ const validAlignedAxis = Math.abs(Cartesian3_default.magnitudeSquared(billboard.alignedAxis) - 1) < Math_default.EPSILON6 ? 1 : 0;
+ billboardCollection._allSizedInMeters = billboardCollection._allSizedInMeters && sizeInMeters === 1;
+ let height = 0;
+ const index = billboard._imageIndex;
+ if (index !== -1) {
+ const imageRectangle = textureAtlasCoordinates[index];
+ if (!defined_default(imageRectangle)) {
+ throw new DeveloperError_default(`Invalid billboard image index: ${index}`);
+ }
+ height = imageRectangle.height;
+ }
+ const dimensions = billboardCollection._textureAtlas.texture.dimensions;
+ const imageHeight = Math.round(
+ defaultValue_default(billboard.height, dimensions.y * height)
+ );
+ billboardCollection._maxSize = Math.max(
+ billboardCollection._maxSize,
+ imageHeight
+ );
+ let labelHorizontalOrigin = defaultValue_default(
+ billboard._labelHorizontalOrigin,
+ -2
+ );
+ labelHorizontalOrigin += 2;
+ const compressed3 = imageHeight * LEFT_SHIFT2 + labelHorizontalOrigin;
+ let red = Color_default.floatToByte(color.red);
+ let green = Color_default.floatToByte(color.green);
+ let blue = Color_default.floatToByte(color.blue);
+ const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;
+ red = Color_default.floatToByte(pickColor.red);
+ green = Color_default.floatToByte(pickColor.green);
+ blue = Color_default.floatToByte(pickColor.blue);
+ const compressed1 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;
+ let compressed2 = Color_default.floatToByte(color.alpha) * LEFT_SHIFT16 + Color_default.floatToByte(pickColor.alpha) * LEFT_SHIFT8;
+ compressed2 += sizeInMeters * 2 + validAlignedAxis;
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ writer(i, compressed0, compressed1, compressed2, compressed3);
+ } else {
+ i = billboard._index * 4;
+ writer(i + 0, compressed0, compressed1, compressed2, compressed3);
+ writer(i + 1, compressed0, compressed1, compressed2, compressed3);
+ writer(i + 2, compressed0, compressed1, compressed2, compressed3);
+ writer(i + 3, compressed0, compressed1, compressed2, compressed3);
+ }
+}
+function writeEyeOffset(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ let i;
+ const writer = vafWriters[attributeLocations.eyeOffset];
+ const eyeOffset = billboard.eyeOffset;
+ let eyeOffsetZ = eyeOffset.z;
+ if (billboard._heightReference !== HeightReference_default.NONE) {
+ eyeOffsetZ *= 1.005;
+ }
+ billboardCollection._maxEyeOffset = Math.max(
+ billboardCollection._maxEyeOffset,
+ Math.abs(eyeOffset.x),
+ Math.abs(eyeOffset.y),
+ Math.abs(eyeOffsetZ)
+ );
+ if (billboardCollection._instanced) {
+ let width = 0;
+ let height = 0;
+ const index = billboard._imageIndex;
+ if (index !== -1) {
+ const imageRectangle = textureAtlasCoordinates[index];
+ if (!defined_default(imageRectangle)) {
+ throw new DeveloperError_default(`Invalid billboard image index: ${index}`);
+ }
+ width = imageRectangle.width;
+ height = imageRectangle.height;
+ }
+ scratchCartesian24.x = width;
+ scratchCartesian24.y = height;
+ const compressedTexCoordsRange = AttributeCompression_default.compressTextureCoordinates(
+ scratchCartesian24
+ );
+ i = billboard._index;
+ writer(i, eyeOffset.x, eyeOffset.y, eyeOffsetZ, compressedTexCoordsRange);
+ } else {
+ i = billboard._index * 4;
+ writer(i + 0, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0);
+ writer(i + 1, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0);
+ writer(i + 2, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0);
+ writer(i + 3, eyeOffset.x, eyeOffset.y, eyeOffsetZ, 0);
+ }
+}
+function writeScaleByDistance(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ let i;
+ const writer = vafWriters[attributeLocations.scaleByDistance];
+ let near = 0;
+ let nearValue = 1;
+ let far = 1;
+ let farValue = 1;
+ const scale = billboard.scaleByDistance;
+ if (defined_default(scale)) {
+ near = scale.near;
+ nearValue = scale.nearValue;
+ far = scale.far;
+ farValue = scale.farValue;
+ if (nearValue !== 1 || farValue !== 1) {
+ billboardCollection._shaderScaleByDistance = true;
+ }
+ }
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ writer(i, near, nearValue, far, farValue);
+ } else {
+ i = billboard._index * 4;
+ writer(i + 0, near, nearValue, far, farValue);
+ writer(i + 1, near, nearValue, far, farValue);
+ writer(i + 2, near, nearValue, far, farValue);
+ writer(i + 3, near, nearValue, far, farValue);
+ }
+}
+function writePixelOffsetScaleByDistance(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ let i;
+ const writer = vafWriters[attributeLocations.pixelOffsetScaleByDistance];
+ let near = 0;
+ let nearValue = 1;
+ let far = 1;
+ let farValue = 1;
+ const pixelOffsetScale = billboard.pixelOffsetScaleByDistance;
+ if (defined_default(pixelOffsetScale)) {
+ near = pixelOffsetScale.near;
+ nearValue = pixelOffsetScale.nearValue;
+ far = pixelOffsetScale.far;
+ farValue = pixelOffsetScale.farValue;
+ if (nearValue !== 1 || farValue !== 1) {
+ billboardCollection._shaderPixelOffsetScaleByDistance = true;
+ }
+ }
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ writer(i, near, nearValue, far, farValue);
+ } else {
+ i = billboard._index * 4;
+ writer(i + 0, near, nearValue, far, farValue);
+ writer(i + 1, near, nearValue, far, farValue);
+ writer(i + 2, near, nearValue, far, farValue);
+ writer(i + 3, near, nearValue, far, farValue);
+ }
+}
+function writeCompressedAttribute3(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ let i;
+ const writer = vafWriters[attributeLocations.compressedAttribute3];
+ let near = 0;
+ let far = Number.MAX_VALUE;
+ const distanceDisplayCondition = billboard.distanceDisplayCondition;
+ if (defined_default(distanceDisplayCondition)) {
+ near = distanceDisplayCondition.near;
+ far = distanceDisplayCondition.far;
+ near *= near;
+ far *= far;
+ billboardCollection._shaderDistanceDisplayCondition = true;
+ }
+ let disableDepthTestDistance = billboard.disableDepthTestDistance;
+ const clampToGround = billboard.heightReference === HeightReference_default.CLAMP_TO_GROUND && frameState.context.depthTexture;
+ if (!defined_default(disableDepthTestDistance)) {
+ disableDepthTestDistance = clampToGround ? 5e3 : 0;
+ }
+ disableDepthTestDistance *= disableDepthTestDistance;
+ if (clampToGround || disableDepthTestDistance > 0) {
+ billboardCollection._shaderDisableDepthDistance = true;
+ if (disableDepthTestDistance === Number.POSITIVE_INFINITY) {
+ disableDepthTestDistance = -1;
+ }
+ }
+ let imageHeight;
+ let imageWidth;
+ if (!defined_default(billboard._labelDimensions)) {
+ let height = 0;
+ let width = 0;
+ const index = billboard._imageIndex;
+ if (index !== -1) {
+ const imageRectangle = textureAtlasCoordinates[index];
+ if (!defined_default(imageRectangle)) {
+ throw new DeveloperError_default(`Invalid billboard image index: ${index}`);
+ }
+ height = imageRectangle.height;
+ width = imageRectangle.width;
+ }
+ imageHeight = Math.round(
+ defaultValue_default(
+ billboard.height,
+ billboardCollection._textureAtlas.texture.dimensions.y * height
+ )
+ );
+ const textureWidth = billboardCollection._textureAtlas.texture.width;
+ imageWidth = Math.round(
+ defaultValue_default(billboard.width, textureWidth * width)
+ );
+ } else {
+ imageWidth = billboard._labelDimensions.x;
+ imageHeight = billboard._labelDimensions.y;
+ }
+ const w = Math.floor(Math_default.clamp(imageWidth, 0, LEFT_SHIFT12));
+ const h = Math.floor(Math_default.clamp(imageHeight, 0, LEFT_SHIFT12));
+ const dimensions = w * LEFT_SHIFT12 + h;
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ writer(i, near, far, disableDepthTestDistance, dimensions);
+ } else {
+ i = billboard._index * 4;
+ writer(i + 0, near, far, disableDepthTestDistance, dimensions);
+ writer(i + 1, near, far, disableDepthTestDistance, dimensions);
+ writer(i + 2, near, far, disableDepthTestDistance, dimensions);
+ writer(i + 3, near, far, disableDepthTestDistance, dimensions);
+ }
+}
+function writeTextureCoordinateBoundsOrLabelTranslate(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ if (billboard.heightReference === HeightReference_default.CLAMP_TO_GROUND) {
+ const scene = billboardCollection._scene;
+ const context = frameState.context;
+ const globeTranslucent = frameState.globeTranslucencyState.translucent;
+ const depthTestAgainstTerrain = defined_default(scene.globe) && scene.globe.depthTestAgainstTerrain;
+ billboardCollection._shaderClampToGround = context.depthTexture && !globeTranslucent && depthTestAgainstTerrain;
+ }
+ let i;
+ const writer = vafWriters[attributeLocations.textureCoordinateBoundsOrLabelTranslate];
+ if (ContextLimits_default.maximumVertexTextureImageUnits > 0) {
+ let translateX = 0;
+ let translateY = 0;
+ if (defined_default(billboard._labelTranslate)) {
+ translateX = billboard._labelTranslate.x;
+ translateY = billboard._labelTranslate.y;
+ }
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ writer(i, translateX, translateY, 0, 0);
+ } else {
+ i = billboard._index * 4;
+ writer(i + 0, translateX, translateY, 0, 0);
+ writer(i + 1, translateX, translateY, 0, 0);
+ writer(i + 2, translateX, translateY, 0, 0);
+ writer(i + 3, translateX, translateY, 0, 0);
+ }
+ return;
+ }
+ let minX = 0;
+ let minY = 0;
+ let width = 0;
+ let height = 0;
+ const index = billboard._imageIndex;
+ if (index !== -1) {
+ const imageRectangle = textureAtlasCoordinates[index];
+ if (!defined_default(imageRectangle)) {
+ throw new DeveloperError_default(`Invalid billboard image index: ${index}`);
+ }
+ minX = imageRectangle.x;
+ minY = imageRectangle.y;
+ width = imageRectangle.width;
+ height = imageRectangle.height;
+ }
+ const maxX = minX + width;
+ const maxY = minY + height;
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ writer(i, minX, minY, maxX, maxY);
+ } else {
+ i = billboard._index * 4;
+ writer(i + 0, minX, minY, maxX, maxY);
+ writer(i + 1, minX, minY, maxX, maxY);
+ writer(i + 2, minX, minY, maxX, maxY);
+ writer(i + 3, minX, minY, maxX, maxY);
+ }
+}
+function writeBatchId(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ if (!defined_default(billboardCollection._batchTable)) {
+ return;
+ }
+ const writer = vafWriters[attributeLocations.a_batchId];
+ const id = billboard._batchIndex;
+ let i;
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ writer(i, id);
+ } else {
+ i = billboard._index * 4;
+ writer(i + 0, id);
+ writer(i + 1, id);
+ writer(i + 2, id);
+ writer(i + 3, id);
+ }
+}
+function writeSDF(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ if (!billboardCollection._sdf) {
+ return;
+ }
+ let i;
+ const writer = vafWriters[attributeLocations.sdf];
+ const outlineColor = billboard.outlineColor;
+ const outlineWidth = billboard.outlineWidth;
+ const red = Color_default.floatToByte(outlineColor.red);
+ const green = Color_default.floatToByte(outlineColor.green);
+ const blue = Color_default.floatToByte(outlineColor.blue);
+ const compressed0 = red * LEFT_SHIFT16 + green * LEFT_SHIFT8 + blue;
+ const outlineDistance = outlineWidth / SDFSettings_default.RADIUS;
+ const compressed1 = Color_default.floatToByte(outlineColor.alpha) * LEFT_SHIFT16 + Color_default.floatToByte(outlineDistance) * LEFT_SHIFT8;
+ if (billboardCollection._instanced) {
+ i = billboard._index;
+ writer(i, compressed0, compressed1);
+ } else {
+ i = billboard._index * 4;
+ writer(i + 0, compressed0 + LOWER_LEFT, compressed1);
+ writer(i + 1, compressed0 + LOWER_RIGHT, compressed1);
+ writer(i + 2, compressed0 + UPPER_RIGHT, compressed1);
+ writer(i + 3, compressed0 + UPPER_LEFT, compressed1);
+ }
+}
+function writeBillboard(billboardCollection, frameState, textureAtlasCoordinates, vafWriters, billboard) {
+ writePositionScaleAndRotation(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ writeCompressedAttrib0(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ writeCompressedAttrib1(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ writeCompressedAttrib2(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ writeEyeOffset(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ writeScaleByDistance(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ writePixelOffsetScaleByDistance(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ writeCompressedAttribute3(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ writeTextureCoordinateBoundsOrLabelTranslate(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ writeBatchId(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ writeSDF(
+ billboardCollection,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+}
+function recomputeActualPositions(billboardCollection, billboards, length3, frameState, modelMatrix, recomputeBoundingVolume) {
+ let boundingVolume;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ boundingVolume = billboardCollection._baseVolume;
+ billboardCollection._boundingVolumeDirty = true;
+ } else {
+ boundingVolume = billboardCollection._baseVolume2D;
+ }
+ const positions = [];
+ for (let i = 0; i < length3; ++i) {
+ const billboard = billboards[i];
+ const position = billboard.position;
+ const actualPosition = Billboard_default._computeActualPosition(
+ billboard,
+ position,
+ frameState,
+ modelMatrix
+ );
+ if (defined_default(actualPosition)) {
+ billboard._setActualPosition(actualPosition);
+ if (recomputeBoundingVolume) {
+ positions.push(actualPosition);
+ } else {
+ BoundingSphere_default.expand(boundingVolume, actualPosition, boundingVolume);
+ }
+ }
+ }
+ if (recomputeBoundingVolume) {
+ BoundingSphere_default.fromPoints(positions, boundingVolume);
+ }
+}
+function updateMode(billboardCollection, frameState) {
+ const mode2 = frameState.mode;
+ const billboards = billboardCollection._billboards;
+ const billboardsToUpdate = billboardCollection._billboardsToUpdate;
+ const modelMatrix = billboardCollection._modelMatrix;
+ if (billboardCollection._createVertexArray || billboardCollection._mode !== mode2 || mode2 !== SceneMode_default.SCENE3D && !Matrix4_default.equals(modelMatrix, billboardCollection.modelMatrix)) {
+ billboardCollection._mode = mode2;
+ Matrix4_default.clone(billboardCollection.modelMatrix, modelMatrix);
+ billboardCollection._createVertexArray = true;
+ if (mode2 === SceneMode_default.SCENE3D || mode2 === SceneMode_default.SCENE2D || mode2 === SceneMode_default.COLUMBUS_VIEW) {
+ recomputeActualPositions(
+ billboardCollection,
+ billboards,
+ billboards.length,
+ frameState,
+ modelMatrix,
+ true
+ );
+ }
+ } else if (mode2 === SceneMode_default.MORPHING) {
+ recomputeActualPositions(
+ billboardCollection,
+ billboards,
+ billboards.length,
+ frameState,
+ modelMatrix,
+ true
+ );
+ } else if (mode2 === SceneMode_default.SCENE2D || mode2 === SceneMode_default.COLUMBUS_VIEW) {
+ recomputeActualPositions(
+ billboardCollection,
+ billboardsToUpdate,
+ billboardCollection._billboardsToUpdateIndex,
+ frameState,
+ modelMatrix,
+ false
+ );
+ }
+}
+function updateBoundingVolume(collection, frameState, boundingVolume) {
+ let pixelScale = 1;
+ if (!collection._allSizedInMeters || collection._maxPixelOffset !== 0) {
+ pixelScale = frameState.camera.getPixelSize(
+ boundingVolume,
+ frameState.context.drawingBufferWidth,
+ frameState.context.drawingBufferHeight
+ );
+ }
+ let size = pixelScale * collection._maxScale * collection._maxSize * 2;
+ if (collection._allHorizontalCenter && collection._allVerticalCenter) {
+ size *= 0.5;
+ }
+ const offset2 = pixelScale * collection._maxPixelOffset + collection._maxEyeOffset;
+ boundingVolume.radius += size + offset2;
+}
+function createDebugCommand(billboardCollection, context) {
+ const fs = "uniform sampler2D billboard_texture; \nvarying vec2 v_textureCoordinates; \nvoid main() \n{ \n gl_FragColor = texture2D(billboard_texture, v_textureCoordinates); \n} \n";
+ const drawCommand = context.createViewportQuadCommand(fs, {
+ uniformMap: {
+ billboard_texture: function() {
+ return billboardCollection._textureAtlas.texture;
+ }
+ }
+ });
+ drawCommand.pass = Pass_default.OVERLAY;
+ return drawCommand;
+}
+var scratchWriterArray = [];
+BillboardCollection.prototype.update = function(frameState) {
+ removeBillboards(this);
+ if (!this.show) {
+ return;
+ }
+ let billboards = this._billboards;
+ let billboardsLength = billboards.length;
+ const context = frameState.context;
+ this._instanced = context.instancedArrays;
+ attributeLocations = this._instanced ? attributeLocationsInstanced : attributeLocationsBatched;
+ getIndexBuffer2 = this._instanced ? getIndexBufferInstanced : getIndexBufferBatched;
+ let textureAtlas = this._textureAtlas;
+ if (!defined_default(textureAtlas)) {
+ textureAtlas = this._textureAtlas = new TextureAtlas_default({
+ context
+ });
+ for (let ii = 0; ii < billboardsLength; ++ii) {
+ billboards[ii]._loadImage();
+ }
+ }
+ const textureAtlasCoordinates = textureAtlas.textureCoordinates;
+ if (textureAtlasCoordinates.length === 0) {
+ return;
+ }
+ updateMode(this, frameState);
+ billboards = this._billboards;
+ billboardsLength = billboards.length;
+ const billboardsToUpdate = this._billboardsToUpdate;
+ const billboardsToUpdateLength = this._billboardsToUpdateIndex;
+ const properties = this._propertiesChanged;
+ const textureAtlasGUID = textureAtlas.guid;
+ const createVertexArray7 = this._createVertexArray || this._textureAtlasGUID !== textureAtlasGUID;
+ this._textureAtlasGUID = textureAtlasGUID;
+ let vafWriters;
+ const pass = frameState.passes;
+ const picking = pass.pick;
+ if (createVertexArray7 || !picking && this.computeNewBuffersUsage()) {
+ this._createVertexArray = false;
+ for (let k = 0; k < NUMBER_OF_PROPERTIES; ++k) {
+ properties[k] = 0;
+ }
+ this._vaf = this._vaf && this._vaf.destroy();
+ if (billboardsLength > 0) {
+ this._vaf = createVAF(
+ context,
+ billboardsLength,
+ this._buffersUsage,
+ this._instanced,
+ this._batchTable,
+ this._sdf
+ );
+ vafWriters = this._vaf.writers;
+ for (let i = 0; i < billboardsLength; ++i) {
+ const billboard = this._billboards[i];
+ billboard._dirty = false;
+ writeBillboard(
+ this,
+ frameState,
+ textureAtlasCoordinates,
+ vafWriters,
+ billboard
+ );
+ }
+ this._vaf.commit(getIndexBuffer2(context));
+ }
+ this._billboardsToUpdateIndex = 0;
+ } else if (billboardsToUpdateLength > 0) {
+ const writers = scratchWriterArray;
+ writers.length = 0;
+ if (properties[POSITION_INDEX2] || properties[ROTATION_INDEX2] || properties[SCALE_INDEX2]) {
+ writers.push(writePositionScaleAndRotation);
+ }
+ if (properties[IMAGE_INDEX_INDEX2] || properties[PIXEL_OFFSET_INDEX2] || properties[HORIZONTAL_ORIGIN_INDEX2] || properties[VERTICAL_ORIGIN_INDEX2] || properties[SHOW_INDEX2]) {
+ writers.push(writeCompressedAttrib0);
+ if (this._instanced) {
+ writers.push(writeEyeOffset);
+ }
+ }
+ if (properties[IMAGE_INDEX_INDEX2] || properties[ALIGNED_AXIS_INDEX2] || properties[TRANSLUCENCY_BY_DISTANCE_INDEX2]) {
+ writers.push(writeCompressedAttrib1);
+ writers.push(writeCompressedAttrib2);
+ }
+ if (properties[IMAGE_INDEX_INDEX2] || properties[COLOR_INDEX2]) {
+ writers.push(writeCompressedAttrib2);
+ }
+ if (properties[EYE_OFFSET_INDEX2]) {
+ writers.push(writeEyeOffset);
+ }
+ if (properties[SCALE_BY_DISTANCE_INDEX2]) {
+ writers.push(writeScaleByDistance);
+ }
+ if (properties[PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX2]) {
+ writers.push(writePixelOffsetScaleByDistance);
+ }
+ if (properties[DISTANCE_DISPLAY_CONDITION_INDEX] || properties[DISABLE_DEPTH_DISTANCE2] || properties[IMAGE_INDEX_INDEX2] || properties[POSITION_INDEX2]) {
+ writers.push(writeCompressedAttribute3);
+ }
+ if (properties[IMAGE_INDEX_INDEX2] || properties[POSITION_INDEX2]) {
+ writers.push(writeTextureCoordinateBoundsOrLabelTranslate);
+ }
+ if (properties[SDF_INDEX2]) {
+ writers.push(writeSDF);
+ }
+ const numWriters = writers.length;
+ vafWriters = this._vaf.writers;
+ if (billboardsToUpdateLength / billboardsLength > 0.1) {
+ for (let m = 0; m < billboardsToUpdateLength; ++m) {
+ const b = billboardsToUpdate[m];
+ b._dirty = false;
+ for (let n = 0; n < numWriters; ++n) {
+ writers[n](this, frameState, textureAtlasCoordinates, vafWriters, b);
+ }
+ }
+ this._vaf.commit(getIndexBuffer2(context));
+ } else {
+ for (let h = 0; h < billboardsToUpdateLength; ++h) {
+ const bb = billboardsToUpdate[h];
+ bb._dirty = false;
+ for (let o = 0; o < numWriters; ++o) {
+ writers[o](this, frameState, textureAtlasCoordinates, vafWriters, bb);
+ }
+ if (this._instanced) {
+ this._vaf.subCommit(bb._index, 1);
+ } else {
+ this._vaf.subCommit(bb._index * 4, 4);
+ }
+ }
+ this._vaf.endSubCommits();
+ }
+ this._billboardsToUpdateIndex = 0;
+ }
+ if (billboardsToUpdateLength > billboardsLength * 1.5) {
+ billboardsToUpdate.length = billboardsLength;
+ }
+ if (!defined_default(this._vaf) || !defined_default(this._vaf.va)) {
+ return;
+ }
+ if (this._boundingVolumeDirty) {
+ this._boundingVolumeDirty = false;
+ BoundingSphere_default.transform(
+ this._baseVolume,
+ this.modelMatrix,
+ this._baseVolumeWC
+ );
+ }
+ let boundingVolume;
+ let modelMatrix = Matrix4_default.IDENTITY;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ modelMatrix = this.modelMatrix;
+ boundingVolume = BoundingSphere_default.clone(
+ this._baseVolumeWC,
+ this._boundingVolume
+ );
+ } else {
+ boundingVolume = BoundingSphere_default.clone(
+ this._baseVolume2D,
+ this._boundingVolume
+ );
+ }
+ updateBoundingVolume(this, frameState, boundingVolume);
+ const blendOptionChanged = this._blendOption !== this.blendOption;
+ this._blendOption = this.blendOption;
+ if (blendOptionChanged) {
+ if (this._blendOption === BlendOption_default.OPAQUE || this._blendOption === BlendOption_default.OPAQUE_AND_TRANSLUCENT) {
+ this._rsOpaque = RenderState_default.fromCache({
+ depthTest: {
+ enabled: true,
+ func: WebGLConstants_default.LESS
+ },
+ depthMask: true
+ });
+ } else {
+ this._rsOpaque = void 0;
+ }
+ const useTranslucentDepthMask = this._blendOption === BlendOption_default.TRANSLUCENT;
+ if (this._blendOption === BlendOption_default.TRANSLUCENT || this._blendOption === BlendOption_default.OPAQUE_AND_TRANSLUCENT) {
+ this._rsTranslucent = RenderState_default.fromCache({
+ depthTest: {
+ enabled: true,
+ func: useTranslucentDepthMask ? WebGLConstants_default.LEQUAL : WebGLConstants_default.LESS
+ },
+ depthMask: useTranslucentDepthMask,
+ blending: BlendingState_default.ALPHA_BLEND
+ });
+ } else {
+ this._rsTranslucent = void 0;
+ }
+ }
+ this._shaderDisableDepthDistance = this._shaderDisableDepthDistance || frameState.minimumDisableDepthTestDistance !== 0;
+ let vsSource;
+ let fsSource;
+ let vs;
+ let fs;
+ let vertDefines;
+ const supportVSTextureReads = ContextLimits_default.maximumVertexTextureImageUnits > 0;
+ if (blendOptionChanged || this._shaderRotation !== this._compiledShaderRotation || this._shaderAlignedAxis !== this._compiledShaderAlignedAxis || this._shaderScaleByDistance !== this._compiledShaderScaleByDistance || this._shaderTranslucencyByDistance !== this._compiledShaderTranslucencyByDistance || this._shaderPixelOffsetScaleByDistance !== this._compiledShaderPixelOffsetScaleByDistance || this._shaderDistanceDisplayCondition !== this._compiledShaderDistanceDisplayCondition || this._shaderDisableDepthDistance !== this._compiledShaderDisableDepthDistance || this._shaderClampToGround !== this._compiledShaderClampToGround || this._sdf !== this._compiledSDF) {
+ vsSource = BillboardCollectionVS_default;
+ fsSource = BillboardCollectionFS_default;
+ vertDefines = [];
+ if (defined_default(this._batchTable)) {
+ vertDefines.push("VECTOR_TILE");
+ vsSource = this._batchTable.getVertexShaderCallback(
+ false,
+ "a_batchId",
+ void 0
+ )(vsSource);
+ fsSource = this._batchTable.getFragmentShaderCallback(
+ false,
+ void 0
+ )(fsSource);
+ }
+ vs = new ShaderSource_default({
+ defines: vertDefines,
+ sources: [vsSource]
+ });
+ if (this._instanced) {
+ vs.defines.push("INSTANCED");
+ }
+ if (this._shaderRotation) {
+ vs.defines.push("ROTATION");
+ }
+ if (this._shaderAlignedAxis) {
+ vs.defines.push("ALIGNED_AXIS");
+ }
+ if (this._shaderScaleByDistance) {
+ vs.defines.push("EYE_DISTANCE_SCALING");
+ }
+ if (this._shaderTranslucencyByDistance) {
+ vs.defines.push("EYE_DISTANCE_TRANSLUCENCY");
+ }
+ if (this._shaderPixelOffsetScaleByDistance) {
+ vs.defines.push("EYE_DISTANCE_PIXEL_OFFSET");
+ }
+ if (this._shaderDistanceDisplayCondition) {
+ vs.defines.push("DISTANCE_DISPLAY_CONDITION");
+ }
+ if (this._shaderDisableDepthDistance) {
+ vs.defines.push("DISABLE_DEPTH_DISTANCE");
+ }
+ if (this._shaderClampToGround) {
+ if (supportVSTextureReads) {
+ vs.defines.push("VERTEX_DEPTH_CHECK");
+ } else {
+ vs.defines.push("FRAGMENT_DEPTH_CHECK");
+ }
+ }
+ const sdfEdge = 1 - SDFSettings_default.CUTOFF;
+ if (this._sdf) {
+ vs.defines.push("SDF");
+ }
+ const vectorFragDefine = defined_default(this._batchTable) ? "VECTOR_TILE" : "";
+ if (this._blendOption === BlendOption_default.OPAQUE_AND_TRANSLUCENT) {
+ fs = new ShaderSource_default({
+ defines: ["OPAQUE", vectorFragDefine],
+ sources: [fsSource]
+ });
+ if (this._shaderClampToGround) {
+ if (supportVSTextureReads) {
+ fs.defines.push("VERTEX_DEPTH_CHECK");
+ } else {
+ fs.defines.push("FRAGMENT_DEPTH_CHECK");
+ }
+ }
+ if (this._sdf) {
+ fs.defines.push("SDF");
+ fs.defines.push(`SDF_EDGE ${sdfEdge}`);
+ }
+ this._sp = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: this._sp,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations
+ });
+ fs = new ShaderSource_default({
+ defines: ["TRANSLUCENT", vectorFragDefine],
+ sources: [fsSource]
+ });
+ if (this._shaderClampToGround) {
+ if (supportVSTextureReads) {
+ fs.defines.push("VERTEX_DEPTH_CHECK");
+ } else {
+ fs.defines.push("FRAGMENT_DEPTH_CHECK");
+ }
+ }
+ if (this._sdf) {
+ fs.defines.push("SDF");
+ fs.defines.push(`SDF_EDGE ${sdfEdge}`);
+ }
+ this._spTranslucent = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: this._spTranslucent,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations
+ });
+ }
+ if (this._blendOption === BlendOption_default.OPAQUE) {
+ fs = new ShaderSource_default({
+ defines: [vectorFragDefine],
+ sources: [fsSource]
+ });
+ if (this._shaderClampToGround) {
+ if (supportVSTextureReads) {
+ fs.defines.push("VERTEX_DEPTH_CHECK");
+ } else {
+ fs.defines.push("FRAGMENT_DEPTH_CHECK");
+ }
+ }
+ if (this._sdf) {
+ fs.defines.push("SDF");
+ fs.defines.push(`SDF_EDGE ${sdfEdge}`);
+ }
+ this._sp = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: this._sp,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations
+ });
+ }
+ if (this._blendOption === BlendOption_default.TRANSLUCENT) {
+ fs = new ShaderSource_default({
+ defines: [vectorFragDefine],
+ sources: [fsSource]
+ });
+ if (this._shaderClampToGround) {
+ if (supportVSTextureReads) {
+ fs.defines.push("VERTEX_DEPTH_CHECK");
+ } else {
+ fs.defines.push("FRAGMENT_DEPTH_CHECK");
+ }
+ }
+ if (this._sdf) {
+ fs.defines.push("SDF");
+ fs.defines.push(`SDF_EDGE ${sdfEdge}`);
+ }
+ this._spTranslucent = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: this._spTranslucent,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations
+ });
+ }
+ this._compiledShaderRotation = this._shaderRotation;
+ this._compiledShaderAlignedAxis = this._shaderAlignedAxis;
+ this._compiledShaderScaleByDistance = this._shaderScaleByDistance;
+ this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance;
+ this._compiledShaderPixelOffsetScaleByDistance = this._shaderPixelOffsetScaleByDistance;
+ this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition;
+ this._compiledShaderDisableDepthDistance = this._shaderDisableDepthDistance;
+ this._compiledShaderClampToGround = this._shaderClampToGround;
+ this._compiledSDF = this._sdf;
+ }
+ const commandList = frameState.commandList;
+ if (pass.render || pass.pick) {
+ const colorList = this._colorCommands;
+ const opaque = this._blendOption === BlendOption_default.OPAQUE;
+ const opaqueAndTranslucent = this._blendOption === BlendOption_default.OPAQUE_AND_TRANSLUCENT;
+ const va = this._vaf.va;
+ const vaLength = va.length;
+ let uniforms = this._uniforms;
+ let pickId;
+ if (defined_default(this._batchTable)) {
+ uniforms = this._batchTable.getUniformMapCallback()(uniforms);
+ pickId = this._batchTable.getPickId();
+ } else {
+ pickId = "v_pickColor";
+ }
+ colorList.length = vaLength;
+ const totalLength = opaqueAndTranslucent ? vaLength * 2 : vaLength;
+ for (let j = 0; j < totalLength; ++j) {
+ let command = colorList[j];
+ if (!defined_default(command)) {
+ command = colorList[j] = new DrawCommand_default();
+ }
+ const opaqueCommand = opaque || opaqueAndTranslucent && j % 2 === 0;
+ command.pass = opaqueCommand || !opaqueAndTranslucent ? Pass_default.OPAQUE : Pass_default.TRANSLUCENT;
+ command.owner = this;
+ const index = opaqueAndTranslucent ? Math.floor(j / 2) : j;
+ command.boundingVolume = boundingVolume;
+ command.modelMatrix = modelMatrix;
+ command.count = va[index].indicesCount;
+ command.shaderProgram = opaqueCommand ? this._sp : this._spTranslucent;
+ command.uniformMap = uniforms;
+ command.vertexArray = va[index].va;
+ command.renderState = opaqueCommand ? this._rsOpaque : this._rsTranslucent;
+ command.debugShowBoundingVolume = this.debugShowBoundingVolume;
+ command.pickId = pickId;
+ if (this._instanced) {
+ command.count = 6;
+ command.instanceCount = billboardsLength;
+ }
+ commandList.push(command);
+ }
+ if (this.debugShowTextureAtlas) {
+ if (!defined_default(this.debugCommand)) {
+ this.debugCommand = createDebugCommand(this, frameState.context);
+ }
+ commandList.push(this.debugCommand);
+ }
+ }
+};
+BillboardCollection.prototype.isDestroyed = function() {
+ return false;
+};
+BillboardCollection.prototype.destroy = function() {
+ if (defined_default(this._removeCallbackFunc)) {
+ this._removeCallbackFunc();
+ this._removeCallbackFunc = void 0;
+ }
+ this._textureAtlas = this._destroyTextureAtlas && this._textureAtlas && this._textureAtlas.destroy();
+ this._sp = this._sp && this._sp.destroy();
+ this._spTranslucent = this._spTranslucent && this._spTranslucent.destroy();
+ this._vaf = this._vaf && this._vaf.destroy();
+ destroyBillboards(this._billboards);
+ return destroyObject_default(this);
+};
+var BillboardCollection_default = BillboardCollection;
+
+// Source/Scene/createBillboardPointCallback.js
+function createBillboardPointCallback(centerAlpha, cssColor, cssOutlineColor, cssOutlineWidth, pixelSize) {
+ return function() {
+ const canvas = document.createElement("canvas");
+ const length3 = pixelSize + 2 * cssOutlineWidth;
+ canvas.height = canvas.width = length3;
+ const context2D = canvas.getContext("2d");
+ context2D.clearRect(0, 0, length3, length3);
+ if (cssOutlineWidth !== 0) {
+ context2D.beginPath();
+ context2D.arc(length3 / 2, length3 / 2, length3 / 2, 0, 2 * Math.PI, true);
+ context2D.closePath();
+ context2D.fillStyle = cssOutlineColor;
+ context2D.fill();
+ if (centerAlpha < 1) {
+ context2D.save();
+ context2D.globalCompositeOperation = "destination-out";
+ context2D.beginPath();
+ context2D.arc(
+ length3 / 2,
+ length3 / 2,
+ pixelSize / 2,
+ 0,
+ 2 * Math.PI,
+ true
+ );
+ context2D.closePath();
+ context2D.fillStyle = "black";
+ context2D.fill();
+ context2D.restore();
+ }
+ }
+ context2D.beginPath();
+ context2D.arc(length3 / 2, length3 / 2, pixelSize / 2, 0, 2 * Math.PI, true);
+ context2D.closePath();
+ context2D.fillStyle = cssColor;
+ context2D.fill();
+ return canvas;
+ };
+}
+var createBillboardPointCallback_default = createBillboardPointCallback;
+
+// Source/Scene/Cesium3DTilePointFeature.js
+function Cesium3DTilePointFeature(content, batchId, billboard, label, polyline) {
+ this._content = content;
+ this._billboard = billboard;
+ this._label = label;
+ this._polyline = polyline;
+ this._batchId = batchId;
+ this._billboardImage = void 0;
+ this._billboardColor = void 0;
+ this._billboardOutlineColor = void 0;
+ this._billboardOutlineWidth = void 0;
+ this._billboardSize = void 0;
+ this._pointSize = void 0;
+ this._color = void 0;
+ this._pointSize = void 0;
+ this._pointOutlineColor = void 0;
+ this._pointOutlineWidth = void 0;
+ this._heightOffset = void 0;
+ this._pickIds = new Array(3);
+ setBillboardImage(this);
+}
+var scratchCartographic5 = new Cartographic_default();
+Object.defineProperties(Cesium3DTilePointFeature.prototype, {
+ show: {
+ get: function() {
+ return this._label.show;
+ },
+ set: function(value) {
+ this._label.show = value;
+ this._billboard.show = value;
+ this._polyline.show = value;
+ }
+ },
+ color: {
+ get: function() {
+ return this._color;
+ },
+ set: function(value) {
+ this._color = Color_default.clone(value, this._color);
+ setBillboardImage(this);
+ }
+ },
+ pointSize: {
+ get: function() {
+ return this._pointSize;
+ },
+ set: function(value) {
+ this._pointSize = value;
+ setBillboardImage(this);
+ }
+ },
+ pointOutlineColor: {
+ get: function() {
+ return this._pointOutlineColor;
+ },
+ set: function(value) {
+ this._pointOutlineColor = Color_default.clone(value, this._pointOutlineColor);
+ setBillboardImage(this);
+ }
+ },
+ pointOutlineWidth: {
+ get: function() {
+ return this._pointOutlineWidth;
+ },
+ set: function(value) {
+ this._pointOutlineWidth = value;
+ setBillboardImage(this);
+ }
+ },
+ labelColor: {
+ get: function() {
+ return this._label.fillColor;
+ },
+ set: function(value) {
+ this._label.fillColor = value;
+ this._polyline.show = this._label.show && value.alpha > 0;
+ }
+ },
+ labelOutlineColor: {
+ get: function() {
+ return this._label.outlineColor;
+ },
+ set: function(value) {
+ this._label.outlineColor = value;
+ }
+ },
+ labelOutlineWidth: {
+ get: function() {
+ return this._label.outlineWidth;
+ },
+ set: function(value) {
+ this._label.outlineWidth = value;
+ }
+ },
+ font: {
+ get: function() {
+ return this._label.font;
+ },
+ set: function(value) {
+ this._label.font = value;
+ }
+ },
+ labelStyle: {
+ get: function() {
+ return this._label.style;
+ },
+ set: function(value) {
+ this._label.style = value;
+ }
+ },
+ labelText: {
+ get: function() {
+ return this._label.text;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ value = "";
+ }
+ this._label.text = value;
+ }
+ },
+ backgroundColor: {
+ get: function() {
+ return this._label.backgroundColor;
+ },
+ set: function(value) {
+ this._label.backgroundColor = value;
+ }
+ },
+ backgroundPadding: {
+ get: function() {
+ return this._label.backgroundPadding;
+ },
+ set: function(value) {
+ this._label.backgroundPadding = value;
+ }
+ },
+ backgroundEnabled: {
+ get: function() {
+ return this._label.showBackground;
+ },
+ set: function(value) {
+ this._label.showBackground = value;
+ }
+ },
+ scaleByDistance: {
+ get: function() {
+ return this._label.scaleByDistance;
+ },
+ set: function(value) {
+ this._label.scaleByDistance = value;
+ this._billboard.scaleByDistance = value;
+ }
+ },
+ translucencyByDistance: {
+ get: function() {
+ return this._label.translucencyByDistance;
+ },
+ set: function(value) {
+ this._label.translucencyByDistance = value;
+ this._billboard.translucencyByDistance = value;
+ }
+ },
+ distanceDisplayCondition: {
+ get: function() {
+ return this._label.distanceDisplayCondition;
+ },
+ set: function(value) {
+ this._label.distanceDisplayCondition = value;
+ this._polyline.distanceDisplayCondition = value;
+ this._billboard.distanceDisplayCondition = value;
+ }
+ },
+ heightOffset: {
+ get: function() {
+ return this._heightOffset;
+ },
+ set: function(value) {
+ const offset2 = defaultValue_default(this._heightOffset, 0);
+ const ellipsoid = this._content.tileset.ellipsoid;
+ const cart = ellipsoid.cartesianToCartographic(
+ this._billboard.position,
+ scratchCartographic5
+ );
+ cart.height = cart.height - offset2 + value;
+ const newPosition = ellipsoid.cartographicToCartesian(cart);
+ this._billboard.position = newPosition;
+ this._label.position = this._billboard.position;
+ this._polyline.positions = [this._polyline.positions[0], newPosition];
+ this._heightOffset = value;
+ }
+ },
+ anchorLineEnabled: {
+ get: function() {
+ return this._polyline.show;
+ },
+ set: function(value) {
+ this._polyline.show = value;
+ }
+ },
+ anchorLineColor: {
+ get: function() {
+ return this._polyline.material.uniforms.color;
+ },
+ set: function(value) {
+ this._polyline.material.uniforms.color = Color_default.clone(
+ value,
+ this._polyline.material.uniforms.color
+ );
+ }
+ },
+ image: {
+ get: function() {
+ return this._billboardImage;
+ },
+ set: function(value) {
+ const imageChanged = this._billboardImage !== value;
+ this._billboardImage = value;
+ if (imageChanged) {
+ setBillboardImage(this);
+ }
+ }
+ },
+ disableDepthTestDistance: {
+ get: function() {
+ return this._label.disableDepthTestDistance;
+ },
+ set: function(value) {
+ this._label.disableDepthTestDistance = value;
+ this._billboard.disableDepthTestDistance = value;
+ }
+ },
+ horizontalOrigin: {
+ get: function() {
+ return this._billboard.horizontalOrigin;
+ },
+ set: function(value) {
+ this._billboard.horizontalOrigin = value;
+ }
+ },
+ verticalOrigin: {
+ get: function() {
+ return this._billboard.verticalOrigin;
+ },
+ set: function(value) {
+ this._billboard.verticalOrigin = value;
+ }
+ },
+ labelHorizontalOrigin: {
+ get: function() {
+ return this._label.horizontalOrigin;
+ },
+ set: function(value) {
+ this._label.horizontalOrigin = value;
+ }
+ },
+ labelVerticalOrigin: {
+ get: function() {
+ return this._label.verticalOrigin;
+ },
+ set: function(value) {
+ this._label.verticalOrigin = value;
+ }
+ },
+ content: {
+ get: function() {
+ return this._content;
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._content.tileset;
+ }
+ },
+ primitive: {
+ get: function() {
+ return this._content.tileset;
+ }
+ },
+ pickIds: {
+ get: function() {
+ const ids = this._pickIds;
+ ids[0] = this._billboard.pickId;
+ ids[1] = this._label.pickId;
+ ids[2] = this._polyline.pickId;
+ return ids;
+ }
+ }
+});
+Cesium3DTilePointFeature.defaultColor = Color_default.WHITE;
+Cesium3DTilePointFeature.defaultPointOutlineColor = Color_default.BLACK;
+Cesium3DTilePointFeature.defaultPointOutlineWidth = 0;
+Cesium3DTilePointFeature.defaultPointSize = 8;
+function setBillboardImage(feature2) {
+ const b = feature2._billboard;
+ if (defined_default(feature2._billboardImage) && feature2._billboardImage !== b.image) {
+ b.image = feature2._billboardImage;
+ return;
+ }
+ if (defined_default(feature2._billboardImage)) {
+ return;
+ }
+ const newColor = defaultValue_default(
+ feature2._color,
+ Cesium3DTilePointFeature.defaultColor
+ );
+ const newOutlineColor = defaultValue_default(
+ feature2._pointOutlineColor,
+ Cesium3DTilePointFeature.defaultPointOutlineColor
+ );
+ const newOutlineWidth = defaultValue_default(
+ feature2._pointOutlineWidth,
+ Cesium3DTilePointFeature.defaultPointOutlineWidth
+ );
+ const newPointSize = defaultValue_default(
+ feature2._pointSize,
+ Cesium3DTilePointFeature.defaultPointSize
+ );
+ const currentColor = feature2._billboardColor;
+ const currentOutlineColor = feature2._billboardOutlineColor;
+ const currentOutlineWidth = feature2._billboardOutlineWidth;
+ const currentPointSize = feature2._billboardSize;
+ if (Color_default.equals(newColor, currentColor) && Color_default.equals(newOutlineColor, currentOutlineColor) && newOutlineWidth === currentOutlineWidth && newPointSize === currentPointSize) {
+ return;
+ }
+ feature2._billboardColor = Color_default.clone(newColor, feature2._billboardColor);
+ feature2._billboardOutlineColor = Color_default.clone(
+ newOutlineColor,
+ feature2._billboardOutlineColor
+ );
+ feature2._billboardOutlineWidth = newOutlineWidth;
+ feature2._billboardSize = newPointSize;
+ const centerAlpha = newColor.alpha;
+ const cssColor = newColor.toCssColorString();
+ const cssOutlineColor = newOutlineColor.toCssColorString();
+ const textureId = JSON.stringify([
+ cssColor,
+ newPointSize,
+ cssOutlineColor,
+ newOutlineWidth
+ ]);
+ b.setImage(
+ textureId,
+ createBillboardPointCallback_default(
+ centerAlpha,
+ cssColor,
+ cssOutlineColor,
+ newOutlineWidth,
+ newPointSize
+ )
+ );
+}
+Cesium3DTilePointFeature.prototype.hasProperty = function(name) {
+ return this._content.batchTable.hasProperty(this._batchId, name);
+};
+Cesium3DTilePointFeature.prototype.getPropertyIds = function(results) {
+ return this._content.batchTable.getPropertyIds(this._batchId, results);
+};
+Cesium3DTilePointFeature.prototype.getProperty = function(name) {
+ return this._content.batchTable.getProperty(this._batchId, name);
+};
+Cesium3DTilePointFeature.prototype.getPropertyInherited = function(name) {
+ return Cesium3DTileFeature_default.getPropertyInherited(
+ this._content,
+ this._batchId,
+ name
+ );
+};
+Cesium3DTilePointFeature.prototype.setProperty = function(name, value) {
+ this._content.batchTable.setProperty(this._batchId, name, value);
+ this._content.featurePropertiesDirty = true;
+};
+Cesium3DTilePointFeature.prototype.isExactClass = function(className) {
+ return this._content.batchTable.isExactClass(this._batchId, className);
+};
+Cesium3DTilePointFeature.prototype.isClass = function(className) {
+ return this._content.batchTable.isClass(this._batchId, className);
+};
+Cesium3DTilePointFeature.prototype.getExactClassName = function() {
+ return this._content.batchTable.getExactClassName(this._batchId);
+};
+var Cesium3DTilePointFeature_default = Cesium3DTilePointFeature;
+
+// Source/Core/writeTextToCanvas.js
+function measureText(context2D, textString, font, stroke, fill) {
+ const metrics = context2D.measureText(textString);
+ const isSpace = !/\S/.test(textString);
+ if (!isSpace) {
+ const fontSize = document.defaultView.getComputedStyle(context2D.canvas).getPropertyValue("font-size").replace("px", "");
+ const canvas = document.createElement("canvas");
+ const padding = 100;
+ const width = metrics.width + padding | 0;
+ const height = 3 * fontSize;
+ const baseline = height / 2;
+ canvas.width = width;
+ canvas.height = height;
+ const ctx = canvas.getContext("2d");
+ ctx.font = font;
+ ctx.fillStyle = "white";
+ ctx.fillRect(0, 0, canvas.width + 1, canvas.height + 1);
+ if (stroke) {
+ ctx.strokeStyle = "black";
+ ctx.lineWidth = context2D.lineWidth;
+ ctx.strokeText(textString, padding / 2, baseline);
+ }
+ if (fill) {
+ ctx.fillStyle = "black";
+ ctx.fillText(textString, padding / 2, baseline);
+ }
+ const pixelData = ctx.getImageData(0, 0, width, height).data;
+ const length3 = pixelData.length;
+ const width4 = width * 4;
+ let i, j;
+ let ascent, descent;
+ for (i = 0; i < length3; ++i) {
+ if (pixelData[i] !== 255) {
+ ascent = i / width4 | 0;
+ break;
+ }
+ }
+ for (i = length3 - 1; i >= 0; --i) {
+ if (pixelData[i] !== 255) {
+ descent = i / width4 | 0;
+ break;
+ }
+ }
+ let minx = -1;
+ for (i = 0; i < width && minx === -1; ++i) {
+ for (j = 0; j < height; ++j) {
+ const pixelIndex = i * 4 + j * width4;
+ if (pixelData[pixelIndex] !== 255 || pixelData[pixelIndex + 1] !== 255 || pixelData[pixelIndex + 2] !== 255 || pixelData[pixelIndex + 3] !== 255) {
+ minx = i;
+ break;
+ }
+ }
+ }
+ return {
+ width: metrics.width,
+ height: descent - ascent,
+ ascent: baseline - ascent,
+ descent: descent - baseline,
+ minx: minx - padding / 2
+ };
+ }
+ return {
+ width: metrics.width,
+ height: 0,
+ ascent: 0,
+ descent: 0,
+ minx: 0
+ };
+}
+var imageSmoothingEnabledName;
+function writeTextToCanvas(text, options) {
+ if (!defined_default(text)) {
+ throw new DeveloperError_default("text is required.");
+ }
+ if (text === "") {
+ return void 0;
+ }
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const font = defaultValue_default(options.font, "10px sans-serif");
+ const stroke = defaultValue_default(options.stroke, false);
+ const fill = defaultValue_default(options.fill, true);
+ const strokeWidth = defaultValue_default(options.strokeWidth, 1);
+ const backgroundColor = defaultValue_default(
+ options.backgroundColor,
+ Color_default.TRANSPARENT
+ );
+ const padding = defaultValue_default(options.padding, 0);
+ const doublePadding = padding * 2;
+ const canvas = document.createElement("canvas");
+ canvas.width = 1;
+ canvas.height = 1;
+ canvas.style.font = font;
+ const context2D = canvas.getContext("2d");
+ if (!defined_default(imageSmoothingEnabledName)) {
+ if (defined_default(context2D.imageSmoothingEnabled)) {
+ imageSmoothingEnabledName = "imageSmoothingEnabled";
+ } else if (defined_default(context2D.mozImageSmoothingEnabled)) {
+ imageSmoothingEnabledName = "mozImageSmoothingEnabled";
+ } else if (defined_default(context2D.webkitImageSmoothingEnabled)) {
+ imageSmoothingEnabledName = "webkitImageSmoothingEnabled";
+ } else if (defined_default(context2D.msImageSmoothingEnabled)) {
+ imageSmoothingEnabledName = "msImageSmoothingEnabled";
+ }
+ }
+ context2D.font = font;
+ context2D.lineJoin = "round";
+ context2D.lineWidth = strokeWidth;
+ context2D[imageSmoothingEnabledName] = false;
+ canvas.style.visibility = "hidden";
+ document.body.appendChild(canvas);
+ const dimensions = measureText(context2D, text, font, stroke, fill);
+ canvas.dimensions = dimensions;
+ document.body.removeChild(canvas);
+ canvas.style.visibility = "";
+ const x = -dimensions.minx;
+ const width = Math.ceil(dimensions.width) + x + doublePadding;
+ const height = dimensions.height + doublePadding;
+ const baseline = height - dimensions.ascent + padding;
+ const y = height - baseline + doublePadding;
+ canvas.width = width;
+ canvas.height = height;
+ context2D.font = font;
+ context2D.lineJoin = "round";
+ context2D.lineWidth = strokeWidth;
+ context2D[imageSmoothingEnabledName] = false;
+ if (backgroundColor !== Color_default.TRANSPARENT) {
+ context2D.fillStyle = backgroundColor.toCssColorString();
+ context2D.fillRect(0, 0, canvas.width, canvas.height);
+ }
+ if (stroke) {
+ const strokeColor = defaultValue_default(options.strokeColor, Color_default.BLACK);
+ context2D.strokeStyle = strokeColor.toCssColorString();
+ context2D.strokeText(text, x + padding, y);
+ }
+ if (fill) {
+ const fillColor = defaultValue_default(options.fillColor, Color_default.WHITE);
+ context2D.fillStyle = fillColor.toCssColorString();
+ context2D.fillText(text, x + padding, y);
+ }
+ return canvas;
+}
+var writeTextToCanvas_default = writeTextToCanvas;
+
+// Source/Scene/LabelCollection.js
+var import_bitmap_sdf = __toESM(require_bitmap_sdf(), 1);
+
+// Source/Scene/LabelStyle.js
+var LabelStyle = {
+ FILL: 0,
+ OUTLINE: 1,
+ FILL_AND_OUTLINE: 2
+};
+var LabelStyle_default = Object.freeze(LabelStyle);
+
+// Source/Scene/Label.js
+var fontInfoCache = {};
+var fontInfoCacheLength = 0;
+var fontInfoCacheMaxSize = 256;
+var defaultBackgroundColor = new Color_default(0.165, 0.165, 0.165, 0.8);
+var defaultBackgroundPadding = new Cartesian2_default(7, 5);
+var textTypes = Object.freeze({
+ LTR: 0,
+ RTL: 1,
+ WEAK: 2,
+ BRACKETS: 3
+});
+function rebindAllGlyphs(label) {
+ if (!label._rebindAllGlyphs && !label._repositionAllGlyphs) {
+ label._labelCollection._labelsToUpdate.push(label);
+ }
+ label._rebindAllGlyphs = true;
+}
+function repositionAllGlyphs(label) {
+ if (!label._rebindAllGlyphs && !label._repositionAllGlyphs) {
+ label._labelCollection._labelsToUpdate.push(label);
+ }
+ label._repositionAllGlyphs = true;
+}
+function getCSSValue(element, property) {
+ return document.defaultView.getComputedStyle(element, null).getPropertyValue(property);
+}
+function parseFont(label) {
+ let fontInfo = fontInfoCache[label._font];
+ if (!defined_default(fontInfo)) {
+ const div = document.createElement("div");
+ div.style.position = "absolute";
+ div.style.opacity = 0;
+ div.style.font = label._font;
+ document.body.appendChild(div);
+ let lineHeight = parseFloat(getCSSValue(div, "line-height"));
+ if (isNaN(lineHeight)) {
+ lineHeight = void 0;
+ }
+ fontInfo = {
+ family: getCSSValue(div, "font-family"),
+ size: getCSSValue(div, "font-size").replace("px", ""),
+ style: getCSSValue(div, "font-style"),
+ weight: getCSSValue(div, "font-weight"),
+ lineHeight
+ };
+ document.body.removeChild(div);
+ if (fontInfoCacheLength < fontInfoCacheMaxSize) {
+ fontInfoCache[label._font] = fontInfo;
+ fontInfoCacheLength++;
+ }
+ }
+ label._fontFamily = fontInfo.family;
+ label._fontSize = fontInfo.size;
+ label._fontStyle = fontInfo.style;
+ label._fontWeight = fontInfo.weight;
+ label._lineHeight = fontInfo.lineHeight;
+}
+function Label(options, labelCollection) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ if (defined_default(options.disableDepthTestDistance) && options.disableDepthTestDistance < 0) {
+ throw new DeveloperError_default(
+ "disableDepthTestDistance must be greater than 0.0."
+ );
+ }
+ let translucencyByDistance = options.translucencyByDistance;
+ let pixelOffsetScaleByDistance = options.pixelOffsetScaleByDistance;
+ let scaleByDistance = options.scaleByDistance;
+ let distanceDisplayCondition = options.distanceDisplayCondition;
+ if (defined_default(translucencyByDistance)) {
+ if (translucencyByDistance.far <= translucencyByDistance.near) {
+ throw new DeveloperError_default(
+ "translucencyByDistance.far must be greater than translucencyByDistance.near."
+ );
+ }
+ translucencyByDistance = NearFarScalar_default.clone(translucencyByDistance);
+ }
+ if (defined_default(pixelOffsetScaleByDistance)) {
+ if (pixelOffsetScaleByDistance.far <= pixelOffsetScaleByDistance.near) {
+ throw new DeveloperError_default(
+ "pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near."
+ );
+ }
+ pixelOffsetScaleByDistance = NearFarScalar_default.clone(
+ pixelOffsetScaleByDistance
+ );
+ }
+ if (defined_default(scaleByDistance)) {
+ if (scaleByDistance.far <= scaleByDistance.near) {
+ throw new DeveloperError_default(
+ "scaleByDistance.far must be greater than scaleByDistance.near."
+ );
+ }
+ scaleByDistance = NearFarScalar_default.clone(scaleByDistance);
+ }
+ if (defined_default(distanceDisplayCondition)) {
+ if (distanceDisplayCondition.far <= distanceDisplayCondition.near) {
+ throw new DeveloperError_default(
+ "distanceDisplayCondition.far must be greater than distanceDisplayCondition.near."
+ );
+ }
+ distanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ distanceDisplayCondition
+ );
+ }
+ this._renderedText = void 0;
+ this._text = void 0;
+ this._show = defaultValue_default(options.show, true);
+ this._font = defaultValue_default(options.font, "30px sans-serif");
+ this._fillColor = Color_default.clone(defaultValue_default(options.fillColor, Color_default.WHITE));
+ this._outlineColor = Color_default.clone(
+ defaultValue_default(options.outlineColor, Color_default.BLACK)
+ );
+ this._outlineWidth = defaultValue_default(options.outlineWidth, 1);
+ this._showBackground = defaultValue_default(options.showBackground, false);
+ this._backgroundColor = Color_default.clone(
+ defaultValue_default(options.backgroundColor, defaultBackgroundColor)
+ );
+ this._backgroundPadding = Cartesian2_default.clone(
+ defaultValue_default(options.backgroundPadding, defaultBackgroundPadding)
+ );
+ this._style = defaultValue_default(options.style, LabelStyle_default.FILL);
+ this._verticalOrigin = defaultValue_default(
+ options.verticalOrigin,
+ VerticalOrigin_default.BASELINE
+ );
+ this._horizontalOrigin = defaultValue_default(
+ options.horizontalOrigin,
+ HorizontalOrigin_default.LEFT
+ );
+ this._pixelOffset = Cartesian2_default.clone(
+ defaultValue_default(options.pixelOffset, Cartesian2_default.ZERO)
+ );
+ this._eyeOffset = Cartesian3_default.clone(
+ defaultValue_default(options.eyeOffset, Cartesian3_default.ZERO)
+ );
+ this._position = Cartesian3_default.clone(
+ defaultValue_default(options.position, Cartesian3_default.ZERO)
+ );
+ this._scale = defaultValue_default(options.scale, 1);
+ this._id = options.id;
+ this._translucencyByDistance = translucencyByDistance;
+ this._pixelOffsetScaleByDistance = pixelOffsetScaleByDistance;
+ this._scaleByDistance = scaleByDistance;
+ this._heightReference = defaultValue_default(
+ options.heightReference,
+ HeightReference_default.NONE
+ );
+ this._distanceDisplayCondition = distanceDisplayCondition;
+ this._disableDepthTestDistance = options.disableDepthTestDistance;
+ this._labelCollection = labelCollection;
+ this._glyphs = [];
+ this._backgroundBillboard = void 0;
+ this._batchIndex = void 0;
+ this._rebindAllGlyphs = true;
+ this._repositionAllGlyphs = true;
+ this._actualClampedPosition = void 0;
+ this._removeCallbackFunc = void 0;
+ this._mode = void 0;
+ this._clusterShow = true;
+ this.text = defaultValue_default(options.text, "");
+ this._relativeSize = 1;
+ parseFont(this);
+ this._updateClamping();
+}
+Object.defineProperties(Label.prototype, {
+ show: {
+ get: function() {
+ return this._show;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._show !== value) {
+ this._show = value;
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const billboard = glyphs[i].billboard;
+ if (defined_default(billboard)) {
+ billboard.show = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.show = value;
+ }
+ }
+ }
+ },
+ position: {
+ get: function() {
+ return this._position;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const position = this._position;
+ if (!Cartesian3_default.equals(position, value)) {
+ Cartesian3_default.clone(value, position);
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const billboard = glyphs[i].billboard;
+ if (defined_default(billboard)) {
+ billboard.position = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.position = value;
+ }
+ this._updateClamping();
+ }
+ }
+ },
+ heightReference: {
+ get: function() {
+ return this._heightReference;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (value !== this._heightReference) {
+ this._heightReference = value;
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const billboard = glyphs[i].billboard;
+ if (defined_default(billboard)) {
+ billboard.heightReference = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.heightReference = value;
+ }
+ repositionAllGlyphs(this);
+ this._updateClamping();
+ }
+ }
+ },
+ text: {
+ get: function() {
+ return this._text;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._text !== value) {
+ this._text = value;
+ const renderedValue = value.replace(/\u00ad/g, "");
+ this._renderedText = Label.enableRightToLeftDetection ? reverseRtl(renderedValue) : renderedValue;
+ rebindAllGlyphs(this);
+ }
+ }
+ },
+ font: {
+ get: function() {
+ return this._font;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._font !== value) {
+ this._font = value;
+ rebindAllGlyphs(this);
+ parseFont(this);
+ }
+ }
+ },
+ fillColor: {
+ get: function() {
+ return this._fillColor;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const fillColor = this._fillColor;
+ if (!Color_default.equals(fillColor, value)) {
+ Color_default.clone(value, fillColor);
+ rebindAllGlyphs(this);
+ }
+ }
+ },
+ outlineColor: {
+ get: function() {
+ return this._outlineColor;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const outlineColor = this._outlineColor;
+ if (!Color_default.equals(outlineColor, value)) {
+ Color_default.clone(value, outlineColor);
+ rebindAllGlyphs(this);
+ }
+ }
+ },
+ outlineWidth: {
+ get: function() {
+ return this._outlineWidth;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._outlineWidth !== value) {
+ this._outlineWidth = value;
+ rebindAllGlyphs(this);
+ }
+ }
+ },
+ showBackground: {
+ get: function() {
+ return this._showBackground;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._showBackground !== value) {
+ this._showBackground = value;
+ rebindAllGlyphs(this);
+ }
+ }
+ },
+ backgroundColor: {
+ get: function() {
+ return this._backgroundColor;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const backgroundColor = this._backgroundColor;
+ if (!Color_default.equals(backgroundColor, value)) {
+ Color_default.clone(value, backgroundColor);
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.color = backgroundColor;
+ }
+ }
+ }
+ },
+ backgroundPadding: {
+ get: function() {
+ return this._backgroundPadding;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const backgroundPadding = this._backgroundPadding;
+ if (!Cartesian2_default.equals(backgroundPadding, value)) {
+ Cartesian2_default.clone(value, backgroundPadding);
+ repositionAllGlyphs(this);
+ }
+ }
+ },
+ style: {
+ get: function() {
+ return this._style;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._style !== value) {
+ this._style = value;
+ rebindAllGlyphs(this);
+ }
+ }
+ },
+ pixelOffset: {
+ get: function() {
+ return this._pixelOffset;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const pixelOffset = this._pixelOffset;
+ if (!Cartesian2_default.equals(pixelOffset, value)) {
+ Cartesian2_default.clone(value, pixelOffset);
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.pixelOffset = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.pixelOffset = value;
+ }
+ }
+ }
+ },
+ translucencyByDistance: {
+ get: function() {
+ return this._translucencyByDistance;
+ },
+ set: function(value) {
+ if (defined_default(value) && value.far <= value.near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ const translucencyByDistance = this._translucencyByDistance;
+ if (!NearFarScalar_default.equals(translucencyByDistance, value)) {
+ this._translucencyByDistance = NearFarScalar_default.clone(
+ value,
+ translucencyByDistance
+ );
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.translucencyByDistance = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.translucencyByDistance = value;
+ }
+ }
+ }
+ },
+ pixelOffsetScaleByDistance: {
+ get: function() {
+ return this._pixelOffsetScaleByDistance;
+ },
+ set: function(value) {
+ if (defined_default(value) && value.far <= value.near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ const pixelOffsetScaleByDistance = this._pixelOffsetScaleByDistance;
+ if (!NearFarScalar_default.equals(pixelOffsetScaleByDistance, value)) {
+ this._pixelOffsetScaleByDistance = NearFarScalar_default.clone(
+ value,
+ pixelOffsetScaleByDistance
+ );
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.pixelOffsetScaleByDistance = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.pixelOffsetScaleByDistance = value;
+ }
+ }
+ }
+ },
+ scaleByDistance: {
+ get: function() {
+ return this._scaleByDistance;
+ },
+ set: function(value) {
+ if (defined_default(value) && value.far <= value.near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ const scaleByDistance = this._scaleByDistance;
+ if (!NearFarScalar_default.equals(scaleByDistance, value)) {
+ this._scaleByDistance = NearFarScalar_default.clone(value, scaleByDistance);
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.scaleByDistance = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.scaleByDistance = value;
+ }
+ }
+ }
+ },
+ eyeOffset: {
+ get: function() {
+ return this._eyeOffset;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const eyeOffset = this._eyeOffset;
+ if (!Cartesian3_default.equals(eyeOffset, value)) {
+ Cartesian3_default.clone(value, eyeOffset);
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.eyeOffset = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.eyeOffset = value;
+ }
+ }
+ }
+ },
+ horizontalOrigin: {
+ get: function() {
+ return this._horizontalOrigin;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._horizontalOrigin !== value) {
+ this._horizontalOrigin = value;
+ repositionAllGlyphs(this);
+ }
+ }
+ },
+ verticalOrigin: {
+ get: function() {
+ return this._verticalOrigin;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._verticalOrigin !== value) {
+ this._verticalOrigin = value;
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.verticalOrigin = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.verticalOrigin = value;
+ }
+ repositionAllGlyphs(this);
+ }
+ }
+ },
+ scale: {
+ get: function() {
+ return this._scale;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._scale !== value) {
+ this._scale = value;
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.scale = value * this._relativeSize;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.scale = value * this._relativeSize;
+ }
+ repositionAllGlyphs(this);
+ }
+ }
+ },
+ totalScale: {
+ get: function() {
+ return this._scale * this._relativeSize;
+ }
+ },
+ distanceDisplayCondition: {
+ get: function() {
+ return this._distanceDisplayCondition;
+ },
+ set: function(value) {
+ if (defined_default(value) && value.far <= value.near) {
+ throw new DeveloperError_default("far must be greater than near");
+ }
+ if (!DistanceDisplayCondition_default.equals(value, this._distanceDisplayCondition)) {
+ this._distanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ value,
+ this._distanceDisplayCondition
+ );
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.distanceDisplayCondition = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.distanceDisplayCondition = value;
+ }
+ }
+ }
+ },
+ disableDepthTestDistance: {
+ get: function() {
+ return this._disableDepthTestDistance;
+ },
+ set: function(value) {
+ if (this._disableDepthTestDistance !== value) {
+ if (defined_default(value) && value < 0) {
+ throw new DeveloperError_default(
+ "disableDepthTestDistance must be greater than 0.0."
+ );
+ }
+ this._disableDepthTestDistance = value;
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.disableDepthTestDistance = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.disableDepthTestDistance = value;
+ }
+ }
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ },
+ set: function(value) {
+ if (this._id !== value) {
+ this._id = value;
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.id = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.id = value;
+ }
+ }
+ }
+ },
+ pickId: {
+ get: function() {
+ if (this._glyphs.length === 0 || !defined_default(this._glyphs[0].billboard)) {
+ return void 0;
+ }
+ return this._glyphs[0].billboard.pickId;
+ }
+ },
+ _clampedPosition: {
+ get: function() {
+ return this._actualClampedPosition;
+ },
+ set: function(value) {
+ this._actualClampedPosition = Cartesian3_default.clone(
+ value,
+ this._actualClampedPosition
+ );
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard._clampedPosition = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard._clampedPosition = value;
+ }
+ }
+ },
+ clusterShow: {
+ get: function() {
+ return this._clusterShow;
+ },
+ set: function(value) {
+ if (this._clusterShow !== value) {
+ this._clusterShow = value;
+ const glyphs = this._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; i++) {
+ const glyph = glyphs[i];
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard.clusterShow = value;
+ }
+ }
+ const backgroundBillboard = this._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboard.clusterShow = value;
+ }
+ }
+ }
+ }
+});
+Label.prototype._updateClamping = function() {
+ Billboard_default._updateClamping(this._labelCollection, this);
+};
+Label.prototype.computeScreenSpacePosition = function(scene, result) {
+ if (!defined_default(scene)) {
+ throw new DeveloperError_default("scene is required.");
+ }
+ if (!defined_default(result)) {
+ result = new Cartesian2_default();
+ }
+ const labelCollection = this._labelCollection;
+ const modelMatrix = labelCollection.modelMatrix;
+ const actualPosition = defined_default(this._actualClampedPosition) ? this._actualClampedPosition : this._position;
+ const windowCoordinates = Billboard_default._computeScreenSpacePosition(
+ modelMatrix,
+ actualPosition,
+ this._eyeOffset,
+ this._pixelOffset,
+ scene,
+ result
+ );
+ return windowCoordinates;
+};
+Label.getScreenSpaceBoundingBox = function(label, screenSpacePosition, result) {
+ let x = 0;
+ let y = 0;
+ let width = 0;
+ let height = 0;
+ const scale = label.totalScale;
+ const backgroundBillboard = label._backgroundBillboard;
+ if (defined_default(backgroundBillboard)) {
+ x = screenSpacePosition.x + backgroundBillboard._translate.x;
+ y = screenSpacePosition.y - backgroundBillboard._translate.y;
+ width = backgroundBillboard.width * scale;
+ height = backgroundBillboard.height * scale;
+ if (label.verticalOrigin === VerticalOrigin_default.BOTTOM || label.verticalOrigin === VerticalOrigin_default.BASELINE) {
+ y -= height;
+ } else if (label.verticalOrigin === VerticalOrigin_default.CENTER) {
+ y -= height * 0.5;
+ }
+ } else {
+ x = Number.POSITIVE_INFINITY;
+ y = Number.POSITIVE_INFINITY;
+ let maxX = 0;
+ let maxY = 0;
+ const glyphs = label._glyphs;
+ const length3 = glyphs.length;
+ for (let i = 0; i < length3; ++i) {
+ const glyph = glyphs[i];
+ const billboard = glyph.billboard;
+ if (!defined_default(billboard)) {
+ continue;
+ }
+ const glyphX = screenSpacePosition.x + billboard._translate.x;
+ let glyphY = screenSpacePosition.y - billboard._translate.y;
+ const glyphWidth = glyph.dimensions.width * scale;
+ const glyphHeight = glyph.dimensions.height * scale;
+ if (label.verticalOrigin === VerticalOrigin_default.BOTTOM || label.verticalOrigin === VerticalOrigin_default.BASELINE) {
+ glyphY -= glyphHeight;
+ } else if (label.verticalOrigin === VerticalOrigin_default.CENTER) {
+ glyphY -= glyphHeight * 0.5;
+ }
+ if (label._verticalOrigin === VerticalOrigin_default.TOP) {
+ glyphY += SDFSettings_default.PADDING * scale;
+ } else if (label._verticalOrigin === VerticalOrigin_default.BOTTOM || label._verticalOrigin === VerticalOrigin_default.BASELINE) {
+ glyphY -= SDFSettings_default.PADDING * scale;
+ }
+ x = Math.min(x, glyphX);
+ y = Math.min(y, glyphY);
+ maxX = Math.max(maxX, glyphX + glyphWidth);
+ maxY = Math.max(maxY, glyphY + glyphHeight);
+ }
+ width = maxX - x;
+ height = maxY - y;
+ }
+ if (!defined_default(result)) {
+ result = new BoundingRectangle_default();
+ }
+ result.x = x;
+ result.y = y;
+ result.width = width;
+ result.height = height;
+ return result;
+};
+Label.prototype.equals = function(other) {
+ return this === other || defined_default(other) && this._show === other._show && this._scale === other._scale && this._outlineWidth === other._outlineWidth && this._showBackground === other._showBackground && this._style === other._style && this._verticalOrigin === other._verticalOrigin && this._horizontalOrigin === other._horizontalOrigin && this._heightReference === other._heightReference && this._renderedText === other._renderedText && this._font === other._font && Cartesian3_default.equals(this._position, other._position) && Color_default.equals(this._fillColor, other._fillColor) && Color_default.equals(this._outlineColor, other._outlineColor) && Color_default.equals(this._backgroundColor, other._backgroundColor) && Cartesian2_default.equals(this._backgroundPadding, other._backgroundPadding) && Cartesian2_default.equals(this._pixelOffset, other._pixelOffset) && Cartesian3_default.equals(this._eyeOffset, other._eyeOffset) && NearFarScalar_default.equals(
+ this._translucencyByDistance,
+ other._translucencyByDistance
+ ) && NearFarScalar_default.equals(
+ this._pixelOffsetScaleByDistance,
+ other._pixelOffsetScaleByDistance
+ ) && NearFarScalar_default.equals(this._scaleByDistance, other._scaleByDistance) && DistanceDisplayCondition_default.equals(
+ this._distanceDisplayCondition,
+ other._distanceDisplayCondition
+ ) && this._disableDepthTestDistance === other._disableDepthTestDistance && this._id === other._id;
+};
+Label.prototype.isDestroyed = function() {
+ return false;
+};
+Label.enableRightToLeftDetection = false;
+function convertTextToTypes(text, rtlChars2) {
+ const ltrChars = /[a-zA-Z0-9]/;
+ const bracketsChars = /[()[\]{}<>]/;
+ const parsedText = [];
+ let word = "";
+ let lastType = textTypes.LTR;
+ let currentType = "";
+ const textLength = text.length;
+ for (let textIndex = 0; textIndex < textLength; ++textIndex) {
+ const character = text.charAt(textIndex);
+ if (rtlChars2.test(character)) {
+ currentType = textTypes.RTL;
+ } else if (ltrChars.test(character)) {
+ currentType = textTypes.LTR;
+ } else if (bracketsChars.test(character)) {
+ currentType = textTypes.BRACKETS;
+ } else {
+ currentType = textTypes.WEAK;
+ }
+ if (textIndex === 0) {
+ lastType = currentType;
+ }
+ if (lastType === currentType && currentType !== textTypes.BRACKETS) {
+ word += character;
+ } else {
+ if (word !== "") {
+ parsedText.push({ Type: lastType, Word: word });
+ }
+ lastType = currentType;
+ word = character;
+ }
+ }
+ parsedText.push({ Type: currentType, Word: word });
+ return parsedText;
+}
+function reverseWord(word) {
+ return word.split("").reverse().join("");
+}
+function spliceWord(result, pointer, word) {
+ return result.slice(0, pointer) + word + result.slice(pointer);
+}
+function reverseBrackets(bracket) {
+ switch (bracket) {
+ case "(":
+ return ")";
+ case ")":
+ return "(";
+ case "[":
+ return "]";
+ case "]":
+ return "[";
+ case "{":
+ return "}";
+ case "}":
+ return "{";
+ case "<":
+ return ">";
+ case ">":
+ return "<";
+ }
+}
+var hebrew = "\u05D0-\u05EA";
+var arabic = "\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF";
+var rtlChars = new RegExp(`[${hebrew}${arabic}]`);
+function reverseRtl(value) {
+ const texts = value.split("\n");
+ let result = "";
+ for (let i = 0; i < texts.length; i++) {
+ const text = texts[i];
+ const rtlDir = rtlChars.test(text.charAt(0));
+ const parsedText = convertTextToTypes(text, rtlChars);
+ let splicePointer = 0;
+ let line = "";
+ for (let wordIndex = 0; wordIndex < parsedText.length; ++wordIndex) {
+ const subText = parsedText[wordIndex];
+ const reverse = subText.Type === textTypes.BRACKETS ? reverseBrackets(subText.Word) : reverseWord(subText.Word);
+ if (rtlDir) {
+ if (subText.Type === textTypes.RTL) {
+ line = reverse + line;
+ splicePointer = 0;
+ } else if (subText.Type === textTypes.LTR) {
+ line = spliceWord(line, splicePointer, subText.Word);
+ splicePointer += subText.Word.length;
+ } else if (subText.Type === textTypes.WEAK || subText.Type === textTypes.BRACKETS) {
+ if (subText.Type === textTypes.WEAK && parsedText[wordIndex - 1].Type === textTypes.BRACKETS) {
+ line = reverse + line;
+ } else if (parsedText[wordIndex - 1].Type === textTypes.RTL) {
+ line = reverse + line;
+ splicePointer = 0;
+ } else if (parsedText.length > wordIndex + 1) {
+ if (parsedText[wordIndex + 1].Type === textTypes.RTL) {
+ line = reverse + line;
+ splicePointer = 0;
+ } else {
+ line = spliceWord(line, splicePointer, subText.Word);
+ splicePointer += subText.Word.length;
+ }
+ } else {
+ line = spliceWord(line, 0, reverse);
+ }
+ }
+ } else if (subText.Type === textTypes.RTL) {
+ line = spliceWord(line, splicePointer, reverse);
+ } else if (subText.Type === textTypes.LTR) {
+ line += subText.Word;
+ splicePointer = line.length;
+ } else if (subText.Type === textTypes.WEAK || subText.Type === textTypes.BRACKETS) {
+ if (wordIndex > 0) {
+ if (parsedText[wordIndex - 1].Type === textTypes.RTL) {
+ if (parsedText.length > wordIndex + 1) {
+ if (parsedText[wordIndex + 1].Type === textTypes.RTL) {
+ line = spliceWord(line, splicePointer, reverse);
+ } else {
+ line += subText.Word;
+ splicePointer = line.length;
+ }
+ } else {
+ line += subText.Word;
+ }
+ } else {
+ line += subText.Word;
+ splicePointer = line.length;
+ }
+ } else {
+ line += subText.Word;
+ splicePointer = line.length;
+ }
+ }
+ }
+ result += line;
+ if (i < texts.length - 1) {
+ result += "\n";
+ }
+ }
+ return result;
+}
+var Label_default = Label;
+
+// Source/Scene/LabelCollection.js
+var import_grapheme_splitter = __toESM(require_grapheme_splitter(), 1);
+function Glyph() {
+ this.textureInfo = void 0;
+ this.dimensions = void 0;
+ this.billboard = void 0;
+}
+function GlyphTextureInfo(labelCollection, index, dimensions) {
+ this.labelCollection = labelCollection;
+ this.index = index;
+ this.dimensions = dimensions;
+}
+var defaultLineSpacingPercent = 1.2;
+var whitePixelCanvasId = "ID_WHITE_PIXEL";
+var whitePixelSize = new Cartesian2_default(4, 4);
+var whitePixelBoundingRegion = new BoundingRectangle_default(1, 1, 1, 1);
+function addWhitePixelCanvas(textureAtlas) {
+ const canvas = document.createElement("canvas");
+ canvas.width = whitePixelSize.x;
+ canvas.height = whitePixelSize.y;
+ const context2D = canvas.getContext("2d");
+ context2D.fillStyle = "#fff";
+ context2D.fillRect(0, 0, canvas.width, canvas.height);
+ textureAtlas.addImage(whitePixelCanvasId, canvas);
+}
+var writeTextToCanvasParameters = {};
+function createGlyphCanvas(character, font, fillColor, outlineColor, outlineWidth, style, verticalOrigin) {
+ writeTextToCanvasParameters.font = font;
+ writeTextToCanvasParameters.fillColor = fillColor;
+ writeTextToCanvasParameters.strokeColor = outlineColor;
+ writeTextToCanvasParameters.strokeWidth = outlineWidth;
+ writeTextToCanvasParameters.padding = SDFSettings_default.PADDING;
+ if (verticalOrigin === VerticalOrigin_default.CENTER) {
+ writeTextToCanvasParameters.textBaseline = "middle";
+ } else if (verticalOrigin === VerticalOrigin_default.TOP) {
+ writeTextToCanvasParameters.textBaseline = "top";
+ } else {
+ writeTextToCanvasParameters.textBaseline = "bottom";
+ }
+ writeTextToCanvasParameters.fill = style === LabelStyle_default.FILL || style === LabelStyle_default.FILL_AND_OUTLINE;
+ writeTextToCanvasParameters.stroke = style === LabelStyle_default.OUTLINE || style === LabelStyle_default.FILL_AND_OUTLINE;
+ writeTextToCanvasParameters.backgroundColor = Color_default.BLACK;
+ return writeTextToCanvas_default(character, writeTextToCanvasParameters);
+}
+function unbindGlyph(labelCollection, glyph) {
+ glyph.textureInfo = void 0;
+ glyph.dimensions = void 0;
+ const billboard = glyph.billboard;
+ if (defined_default(billboard)) {
+ billboard.show = false;
+ billboard.image = void 0;
+ if (defined_default(billboard._removeCallbackFunc)) {
+ billboard._removeCallbackFunc();
+ billboard._removeCallbackFunc = void 0;
+ }
+ labelCollection._spareBillboards.push(billboard);
+ glyph.billboard = void 0;
+ }
+}
+function addGlyphToTextureAtlas(textureAtlas, id, canvas, glyphTextureInfo) {
+ glyphTextureInfo.index = textureAtlas.addImageSync(id, canvas);
+}
+var splitter = new import_grapheme_splitter.default();
+function rebindAllGlyphs2(labelCollection, label) {
+ const text = label._renderedText;
+ const graphemes = splitter.splitGraphemes(text);
+ const textLength = graphemes.length;
+ const glyphs = label._glyphs;
+ const glyphsLength = glyphs.length;
+ let glyph;
+ let glyphIndex;
+ let textIndex;
+ label._relativeSize = label._fontSize / SDFSettings_default.FONT_SIZE;
+ if (textLength < glyphsLength) {
+ for (glyphIndex = textLength; glyphIndex < glyphsLength; ++glyphIndex) {
+ unbindGlyph(labelCollection, glyphs[glyphIndex]);
+ }
+ }
+ glyphs.length = textLength;
+ const showBackground = label._showBackground && text.split("\n").join("").length > 0;
+ let backgroundBillboard = label._backgroundBillboard;
+ const backgroundBillboardCollection = labelCollection._backgroundBillboardCollection;
+ if (!showBackground) {
+ if (defined_default(backgroundBillboard)) {
+ backgroundBillboardCollection.remove(backgroundBillboard);
+ label._backgroundBillboard = backgroundBillboard = void 0;
+ }
+ } else {
+ if (!defined_default(backgroundBillboard)) {
+ backgroundBillboard = backgroundBillboardCollection.add({
+ collection: labelCollection,
+ image: whitePixelCanvasId,
+ imageSubRegion: whitePixelBoundingRegion
+ });
+ label._backgroundBillboard = backgroundBillboard;
+ }
+ backgroundBillboard.color = label._backgroundColor;
+ backgroundBillboard.show = label._show;
+ backgroundBillboard.position = label._position;
+ backgroundBillboard.eyeOffset = label._eyeOffset;
+ backgroundBillboard.pixelOffset = label._pixelOffset;
+ backgroundBillboard.horizontalOrigin = HorizontalOrigin_default.LEFT;
+ backgroundBillboard.verticalOrigin = label._verticalOrigin;
+ backgroundBillboard.heightReference = label._heightReference;
+ backgroundBillboard.scale = label.totalScale;
+ backgroundBillboard.pickPrimitive = label;
+ backgroundBillboard.id = label._id;
+ backgroundBillboard.translucencyByDistance = label._translucencyByDistance;
+ backgroundBillboard.pixelOffsetScaleByDistance = label._pixelOffsetScaleByDistance;
+ backgroundBillboard.scaleByDistance = label._scaleByDistance;
+ backgroundBillboard.distanceDisplayCondition = label._distanceDisplayCondition;
+ backgroundBillboard.disableDepthTestDistance = label._disableDepthTestDistance;
+ }
+ const glyphTextureCache = labelCollection._glyphTextureCache;
+ for (textIndex = 0; textIndex < textLength; ++textIndex) {
+ const character = graphemes[textIndex];
+ const verticalOrigin = label._verticalOrigin;
+ const id = JSON.stringify([
+ character,
+ label._fontFamily,
+ label._fontStyle,
+ label._fontWeight,
+ +verticalOrigin
+ ]);
+ let glyphTextureInfo = glyphTextureCache[id];
+ if (!defined_default(glyphTextureInfo)) {
+ const glyphFont = `${label._fontStyle} ${label._fontWeight} ${SDFSettings_default.FONT_SIZE}px ${label._fontFamily}`;
+ const canvas = createGlyphCanvas(
+ character,
+ glyphFont,
+ Color_default.WHITE,
+ Color_default.WHITE,
+ 0,
+ LabelStyle_default.FILL,
+ verticalOrigin
+ );
+ glyphTextureInfo = new GlyphTextureInfo(
+ labelCollection,
+ -1,
+ canvas.dimensions
+ );
+ glyphTextureCache[id] = glyphTextureInfo;
+ if (canvas.width > 0 && canvas.height > 0) {
+ const sdfValues = (0, import_bitmap_sdf.default)(canvas, {
+ cutoff: SDFSettings_default.CUTOFF,
+ radius: SDFSettings_default.RADIUS
+ });
+ const ctx = canvas.getContext("2d");
+ const canvasWidth = canvas.width;
+ const canvasHeight = canvas.height;
+ const imgData = ctx.getImageData(0, 0, canvasWidth, canvasHeight);
+ for (let i = 0; i < canvasWidth; i++) {
+ for (let j = 0; j < canvasHeight; j++) {
+ const baseIndex = j * canvasWidth + i;
+ const alpha = sdfValues[baseIndex] * 255;
+ const imageIndex = baseIndex * 4;
+ imgData.data[imageIndex + 0] = alpha;
+ imgData.data[imageIndex + 1] = alpha;
+ imgData.data[imageIndex + 2] = alpha;
+ imgData.data[imageIndex + 3] = alpha;
+ }
+ }
+ ctx.putImageData(imgData, 0, 0);
+ if (character !== " ") {
+ addGlyphToTextureAtlas(
+ labelCollection._textureAtlas,
+ id,
+ canvas,
+ glyphTextureInfo
+ );
+ }
+ }
+ }
+ glyph = glyphs[textIndex];
+ if (defined_default(glyph)) {
+ if (glyphTextureInfo.index === -1) {
+ unbindGlyph(labelCollection, glyph);
+ } else if (defined_default(glyph.textureInfo)) {
+ glyph.textureInfo = void 0;
+ }
+ } else {
+ glyph = new Glyph();
+ glyphs[textIndex] = glyph;
+ }
+ glyph.textureInfo = glyphTextureInfo;
+ glyph.dimensions = glyphTextureInfo.dimensions;
+ if (glyphTextureInfo.index !== -1) {
+ let billboard = glyph.billboard;
+ const spareBillboards = labelCollection._spareBillboards;
+ if (!defined_default(billboard)) {
+ if (spareBillboards.length > 0) {
+ billboard = spareBillboards.pop();
+ } else {
+ billboard = labelCollection._billboardCollection.add({
+ collection: labelCollection
+ });
+ billboard._labelDimensions = new Cartesian2_default();
+ billboard._labelTranslate = new Cartesian2_default();
+ }
+ glyph.billboard = billboard;
+ }
+ billboard.show = label._show;
+ billboard.position = label._position;
+ billboard.eyeOffset = label._eyeOffset;
+ billboard.pixelOffset = label._pixelOffset;
+ billboard.horizontalOrigin = HorizontalOrigin_default.LEFT;
+ billboard.verticalOrigin = label._verticalOrigin;
+ billboard.heightReference = label._heightReference;
+ billboard.scale = label.totalScale;
+ billboard.pickPrimitive = label;
+ billboard.id = label._id;
+ billboard.image = id;
+ billboard.translucencyByDistance = label._translucencyByDistance;
+ billboard.pixelOffsetScaleByDistance = label._pixelOffsetScaleByDistance;
+ billboard.scaleByDistance = label._scaleByDistance;
+ billboard.distanceDisplayCondition = label._distanceDisplayCondition;
+ billboard.disableDepthTestDistance = label._disableDepthTestDistance;
+ billboard._batchIndex = label._batchIndex;
+ billboard.outlineColor = label.outlineColor;
+ if (label.style === LabelStyle_default.FILL_AND_OUTLINE) {
+ billboard.color = label._fillColor;
+ billboard.outlineWidth = label.outlineWidth;
+ } else if (label.style === LabelStyle_default.FILL) {
+ billboard.color = label._fillColor;
+ billboard.outlineWidth = 0;
+ } else if (label.style === LabelStyle_default.OUTLINE) {
+ billboard.color = Color_default.TRANSPARENT;
+ billboard.outlineWidth = label.outlineWidth;
+ }
+ }
+ }
+ label._repositionAllGlyphs = true;
+}
+function calculateWidthOffset(lineWidth, horizontalOrigin, backgroundPadding) {
+ if (horizontalOrigin === HorizontalOrigin_default.CENTER) {
+ return -lineWidth / 2;
+ } else if (horizontalOrigin === HorizontalOrigin_default.RIGHT) {
+ return -(lineWidth + backgroundPadding.x);
+ }
+ return backgroundPadding.x;
+}
+var glyphPixelOffset = new Cartesian2_default();
+var scratchBackgroundPadding = new Cartesian2_default();
+function repositionAllGlyphs2(label) {
+ const glyphs = label._glyphs;
+ const text = label._renderedText;
+ let glyph;
+ let dimensions;
+ let lastLineWidth = 0;
+ let maxLineWidth = 0;
+ const lineWidths = [];
+ let maxGlyphDescent = Number.NEGATIVE_INFINITY;
+ let maxGlyphY = 0;
+ let numberOfLines = 1;
+ let glyphIndex;
+ const glyphLength = glyphs.length;
+ const backgroundBillboard = label._backgroundBillboard;
+ const backgroundPadding = Cartesian2_default.clone(
+ defined_default(backgroundBillboard) ? label._backgroundPadding : Cartesian2_default.ZERO,
+ scratchBackgroundPadding
+ );
+ backgroundPadding.x /= label._relativeSize;
+ backgroundPadding.y /= label._relativeSize;
+ for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) {
+ if (text.charAt(glyphIndex) === "\n") {
+ lineWidths.push(lastLineWidth);
+ ++numberOfLines;
+ lastLineWidth = 0;
+ } else {
+ glyph = glyphs[glyphIndex];
+ dimensions = glyph.dimensions;
+ maxGlyphY = Math.max(maxGlyphY, dimensions.height - dimensions.descent);
+ maxGlyphDescent = Math.max(maxGlyphDescent, dimensions.descent);
+ lastLineWidth += dimensions.width - dimensions.minx;
+ if (glyphIndex < glyphLength - 1) {
+ lastLineWidth += glyphs[glyphIndex + 1].dimensions.minx;
+ }
+ maxLineWidth = Math.max(maxLineWidth, lastLineWidth);
+ }
+ }
+ lineWidths.push(lastLineWidth);
+ const maxLineHeight = maxGlyphY + maxGlyphDescent;
+ const scale = label.totalScale;
+ const horizontalOrigin = label._horizontalOrigin;
+ const verticalOrigin = label._verticalOrigin;
+ let lineIndex = 0;
+ let lineWidth = lineWidths[lineIndex];
+ let widthOffset = calculateWidthOffset(
+ lineWidth,
+ horizontalOrigin,
+ backgroundPadding
+ );
+ const lineSpacing = (defined_default(label._lineHeight) ? label._lineHeight : defaultLineSpacingPercent * label._fontSize) / label._relativeSize;
+ const otherLinesHeight = lineSpacing * (numberOfLines - 1);
+ let totalLineWidth = maxLineWidth;
+ let totalLineHeight = maxLineHeight + otherLinesHeight;
+ if (defined_default(backgroundBillboard)) {
+ totalLineWidth += backgroundPadding.x * 2;
+ totalLineHeight += backgroundPadding.y * 2;
+ backgroundBillboard._labelHorizontalOrigin = horizontalOrigin;
+ }
+ glyphPixelOffset.x = widthOffset * scale;
+ glyphPixelOffset.y = 0;
+ let firstCharOfLine = true;
+ let lineOffsetY = 0;
+ for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) {
+ if (text.charAt(glyphIndex) === "\n") {
+ ++lineIndex;
+ lineOffsetY += lineSpacing;
+ lineWidth = lineWidths[lineIndex];
+ widthOffset = calculateWidthOffset(
+ lineWidth,
+ horizontalOrigin,
+ backgroundPadding
+ );
+ glyphPixelOffset.x = widthOffset * scale;
+ firstCharOfLine = true;
+ } else {
+ glyph = glyphs[glyphIndex];
+ dimensions = glyph.dimensions;
+ if (verticalOrigin === VerticalOrigin_default.TOP) {
+ glyphPixelOffset.y = dimensions.height - maxGlyphY - backgroundPadding.y;
+ glyphPixelOffset.y += SDFSettings_default.PADDING;
+ } else if (verticalOrigin === VerticalOrigin_default.CENTER) {
+ glyphPixelOffset.y = (otherLinesHeight + dimensions.height - maxGlyphY) / 2;
+ } else if (verticalOrigin === VerticalOrigin_default.BASELINE) {
+ glyphPixelOffset.y = otherLinesHeight;
+ glyphPixelOffset.y -= SDFSettings_default.PADDING;
+ } else {
+ glyphPixelOffset.y = otherLinesHeight + maxGlyphDescent + backgroundPadding.y;
+ glyphPixelOffset.y -= SDFSettings_default.PADDING;
+ }
+ glyphPixelOffset.y = (glyphPixelOffset.y - dimensions.descent - lineOffsetY) * scale;
+ if (firstCharOfLine) {
+ glyphPixelOffset.x -= SDFSettings_default.PADDING * scale;
+ firstCharOfLine = false;
+ }
+ if (defined_default(glyph.billboard)) {
+ glyph.billboard._setTranslate(glyphPixelOffset);
+ glyph.billboard._labelDimensions.x = totalLineWidth;
+ glyph.billboard._labelDimensions.y = totalLineHeight;
+ glyph.billboard._labelHorizontalOrigin = horizontalOrigin;
+ }
+ if (glyphIndex < glyphLength - 1) {
+ const nextGlyph = glyphs[glyphIndex + 1];
+ glyphPixelOffset.x += (dimensions.width - dimensions.minx + nextGlyph.dimensions.minx) * scale;
+ }
+ }
+ }
+ if (defined_default(backgroundBillboard) && text.split("\n").join("").length > 0) {
+ if (horizontalOrigin === HorizontalOrigin_default.CENTER) {
+ widthOffset = -maxLineWidth / 2 - backgroundPadding.x;
+ } else if (horizontalOrigin === HorizontalOrigin_default.RIGHT) {
+ widthOffset = -(maxLineWidth + backgroundPadding.x * 2);
+ } else {
+ widthOffset = 0;
+ }
+ glyphPixelOffset.x = widthOffset * scale;
+ if (verticalOrigin === VerticalOrigin_default.TOP) {
+ glyphPixelOffset.y = maxLineHeight - maxGlyphY - maxGlyphDescent;
+ } else if (verticalOrigin === VerticalOrigin_default.CENTER) {
+ glyphPixelOffset.y = (maxLineHeight - maxGlyphY) / 2 - maxGlyphDescent;
+ } else if (verticalOrigin === VerticalOrigin_default.BASELINE) {
+ glyphPixelOffset.y = -backgroundPadding.y - maxGlyphDescent;
+ } else {
+ glyphPixelOffset.y = 0;
+ }
+ glyphPixelOffset.y = glyphPixelOffset.y * scale;
+ backgroundBillboard.width = totalLineWidth;
+ backgroundBillboard.height = totalLineHeight;
+ backgroundBillboard._setTranslate(glyphPixelOffset);
+ backgroundBillboard._labelTranslate = Cartesian2_default.clone(
+ glyphPixelOffset,
+ backgroundBillboard._labelTranslate
+ );
+ }
+ if (label.heightReference === HeightReference_default.CLAMP_TO_GROUND) {
+ for (glyphIndex = 0; glyphIndex < glyphLength; ++glyphIndex) {
+ glyph = glyphs[glyphIndex];
+ const billboard = glyph.billboard;
+ if (defined_default(billboard)) {
+ billboard._labelTranslate = Cartesian2_default.clone(
+ glyphPixelOffset,
+ billboard._labelTranslate
+ );
+ }
+ }
+ }
+}
+function destroyLabel(labelCollection, label) {
+ const glyphs = label._glyphs;
+ for (let i = 0, len = glyphs.length; i < len; ++i) {
+ unbindGlyph(labelCollection, glyphs[i]);
+ }
+ if (defined_default(label._backgroundBillboard)) {
+ labelCollection._backgroundBillboardCollection.remove(
+ label._backgroundBillboard
+ );
+ label._backgroundBillboard = void 0;
+ }
+ label._labelCollection = void 0;
+ if (defined_default(label._removeCallbackFunc)) {
+ label._removeCallbackFunc();
+ }
+ destroyObject_default(label);
+}
+function LabelCollection(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._scene = options.scene;
+ this._batchTable = options.batchTable;
+ this._textureAtlas = void 0;
+ this._backgroundTextureAtlas = void 0;
+ this._backgroundBillboardCollection = new BillboardCollection_default({
+ scene: this._scene
+ });
+ this._backgroundBillboardCollection.destroyTextureAtlas = false;
+ this._billboardCollection = new BillboardCollection_default({
+ scene: this._scene,
+ batchTable: this._batchTable
+ });
+ this._billboardCollection.destroyTextureAtlas = false;
+ this._billboardCollection._sdf = true;
+ this._spareBillboards = [];
+ this._glyphTextureCache = {};
+ this._labels = [];
+ this._labelsToUpdate = [];
+ this._totalGlyphCount = 0;
+ this._highlightColor = Color_default.clone(Color_default.WHITE);
+ this.show = defaultValue_default(options.show, true);
+ this.modelMatrix = Matrix4_default.clone(
+ defaultValue_default(options.modelMatrix, Matrix4_default.IDENTITY)
+ );
+ this.debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this.blendOption = defaultValue_default(
+ options.blendOption,
+ BlendOption_default.OPAQUE_AND_TRANSLUCENT
+ );
+}
+Object.defineProperties(LabelCollection.prototype, {
+ length: {
+ get: function() {
+ return this._labels.length;
+ }
+ }
+});
+LabelCollection.prototype.add = function(options) {
+ const label = new Label_default(options, this);
+ this._labels.push(label);
+ this._labelsToUpdate.push(label);
+ return label;
+};
+LabelCollection.prototype.remove = function(label) {
+ if (defined_default(label) && label._labelCollection === this) {
+ const index = this._labels.indexOf(label);
+ if (index !== -1) {
+ this._labels.splice(index, 1);
+ destroyLabel(this, label);
+ return true;
+ }
+ }
+ return false;
+};
+LabelCollection.prototype.removeAll = function() {
+ const labels = this._labels;
+ for (let i = 0, len = labels.length; i < len; ++i) {
+ destroyLabel(this, labels[i]);
+ }
+ labels.length = 0;
+};
+LabelCollection.prototype.contains = function(label) {
+ return defined_default(label) && label._labelCollection === this;
+};
+LabelCollection.prototype.get = function(index) {
+ if (!defined_default(index)) {
+ throw new DeveloperError_default("index is required.");
+ }
+ return this._labels[index];
+};
+LabelCollection.prototype.update = function(frameState) {
+ if (!this.show) {
+ return;
+ }
+ const billboardCollection = this._billboardCollection;
+ const backgroundBillboardCollection = this._backgroundBillboardCollection;
+ billboardCollection.modelMatrix = this.modelMatrix;
+ billboardCollection.debugShowBoundingVolume = this.debugShowBoundingVolume;
+ backgroundBillboardCollection.modelMatrix = this.modelMatrix;
+ backgroundBillboardCollection.debugShowBoundingVolume = this.debugShowBoundingVolume;
+ const context = frameState.context;
+ if (!defined_default(this._textureAtlas)) {
+ this._textureAtlas = new TextureAtlas_default({
+ context
+ });
+ billboardCollection.textureAtlas = this._textureAtlas;
+ }
+ if (!defined_default(this._backgroundTextureAtlas)) {
+ this._backgroundTextureAtlas = new TextureAtlas_default({
+ context,
+ initialSize: whitePixelSize
+ });
+ backgroundBillboardCollection.textureAtlas = this._backgroundTextureAtlas;
+ addWhitePixelCanvas(this._backgroundTextureAtlas);
+ }
+ const len = this._labelsToUpdate.length;
+ for (let i = 0; i < len; ++i) {
+ const label = this._labelsToUpdate[i];
+ if (label.isDestroyed()) {
+ continue;
+ }
+ const preUpdateGlyphCount = label._glyphs.length;
+ if (label._rebindAllGlyphs) {
+ rebindAllGlyphs2(this, label);
+ label._rebindAllGlyphs = false;
+ }
+ if (label._repositionAllGlyphs) {
+ repositionAllGlyphs2(label);
+ label._repositionAllGlyphs = false;
+ }
+ const glyphCountDifference = label._glyphs.length - preUpdateGlyphCount;
+ this._totalGlyphCount += glyphCountDifference;
+ }
+ const blendOption = backgroundBillboardCollection.length > 0 ? BlendOption_default.TRANSLUCENT : this.blendOption;
+ billboardCollection.blendOption = blendOption;
+ backgroundBillboardCollection.blendOption = blendOption;
+ billboardCollection._highlightColor = this._highlightColor;
+ backgroundBillboardCollection._highlightColor = this._highlightColor;
+ this._labelsToUpdate.length = 0;
+ backgroundBillboardCollection.update(frameState);
+ billboardCollection.update(frameState);
+};
+LabelCollection.prototype.isDestroyed = function() {
+ return false;
+};
+LabelCollection.prototype.destroy = function() {
+ this.removeAll();
+ this._billboardCollection = this._billboardCollection.destroy();
+ this._textureAtlas = this._textureAtlas && this._textureAtlas.destroy();
+ this._backgroundBillboardCollection = this._backgroundBillboardCollection.destroy();
+ this._backgroundTextureAtlas = this._backgroundTextureAtlas && this._backgroundTextureAtlas.destroy();
+ return destroyObject_default(this);
+};
+var LabelCollection_default = LabelCollection;
+
+// Source/Shaders/PolylineVS.js
+var PolylineVS_default = "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandAndBatchIndex;\n\nvarying vec2 v_st;\nvarying float v_width;\nvarying vec4 v_pickColor;\nvarying float v_polylineAngle;\n\nvoid main()\n{\n float texCoord = texCoordExpandAndBatchIndex.x;\n float expandDir = texCoordExpandAndBatchIndex.y;\n bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;\n float batchTableIndex = texCoordExpandAndBatchIndex.w;\n\n vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);\n float width = widthAndShow.x + 0.5;\n float show = widthAndShow.y;\n\n if (width < 1.0)\n {\n show = 0.0;\n }\n\n vec4 pickColor = batchTable_getPickColor(batchTableIndex);\n\n vec4 p, prev, next;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\n prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\n next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\n prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\n next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\n czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\n czm_morphTime);\n prev = czm_columbusViewMorph(\n czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\n czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\n czm_morphTime);\n next = czm_columbusViewMorph(\n czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\n czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\n czm_morphTime);\n }\n\n #ifdef DISTANCE_DISPLAY_CONDITION\n vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);\n vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);\n vec3 centerLow = centerLowAndRadius.xyz;\n float radius = centerLowAndRadius.w;\n vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);\n\n float lengthSq;\n if (czm_sceneMode == czm_sceneMode2D)\n {\n lengthSq = czm_eyeHeight2D.y;\n }\n else\n {\n vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);\n lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);\n }\n\n float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\n float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\n if (lengthSq < nearSq || lengthSq > farSq)\n {\n show = 0.0;\n }\n #endif\n\n float polylineAngle;\n vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);\n gl_Position = czm_viewportOrthographic * positionWC * show;\n\n v_st.s = texCoord;\n v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);\n\n v_width = width;\n v_pickColor = pickColor;\n v_polylineAngle = polylineAngle;\n}\n";
+
+// Source/Core/PolylinePipeline.js
+var PolylinePipeline = {};
+PolylinePipeline.numberOfPoints = function(p0, p1, minDistance) {
+ const distance2 = Cartesian3_default.distance(p0, p1);
+ return Math.ceil(distance2 / minDistance);
+};
+PolylinePipeline.numberOfPointsRhumbLine = function(p0, p1, granularity) {
+ const radiansDistanceSquared = Math.pow(p0.longitude - p1.longitude, 2) + Math.pow(p0.latitude - p1.latitude, 2);
+ return Math.max(
+ 1,
+ Math.ceil(Math.sqrt(radiansDistanceSquared / (granularity * granularity)))
+ );
+};
+var cartoScratch2 = new Cartographic_default();
+PolylinePipeline.extractHeights = function(positions, ellipsoid) {
+ const length3 = positions.length;
+ const heights = new Array(length3);
+ for (let i = 0; i < length3; i++) {
+ const p = positions[i];
+ heights[i] = ellipsoid.cartesianToCartographic(p, cartoScratch2).height;
+ }
+ return heights;
+};
+var wrapLongitudeInversMatrix = new Matrix4_default();
+var wrapLongitudeOrigin = new Cartesian3_default();
+var wrapLongitudeXZNormal = new Cartesian3_default();
+var wrapLongitudeXZPlane = new Plane_default(Cartesian3_default.UNIT_X, 0);
+var wrapLongitudeYZNormal = new Cartesian3_default();
+var wrapLongitudeYZPlane = new Plane_default(Cartesian3_default.UNIT_X, 0);
+var wrapLongitudeIntersection = new Cartesian3_default();
+var wrapLongitudeOffset = new Cartesian3_default();
+var subdivideHeightsScratchArray = [];
+function subdivideHeights(numPoints, h0, h1) {
+ const heights = subdivideHeightsScratchArray;
+ heights.length = numPoints;
+ let i;
+ if (h0 === h1) {
+ for (i = 0; i < numPoints; i++) {
+ heights[i] = h0;
+ }
+ return heights;
+ }
+ const dHeight = h1 - h0;
+ const heightPerVertex = dHeight / numPoints;
+ for (i = 0; i < numPoints; i++) {
+ const h = h0 + i * heightPerVertex;
+ heights[i] = h;
+ }
+ return heights;
+}
+var carto1 = new Cartographic_default();
+var carto2 = new Cartographic_default();
+var cartesian = new Cartesian3_default();
+var scaleFirst = new Cartesian3_default();
+var scaleLast = new Cartesian3_default();
+var ellipsoidGeodesic = new EllipsoidGeodesic_default();
+var ellipsoidRhumb = new EllipsoidRhumbLine_default();
+function generateCartesianArc(p0, p1, minDistance, ellipsoid, h0, h1, array, offset2) {
+ const first = ellipsoid.scaleToGeodeticSurface(p0, scaleFirst);
+ const last = ellipsoid.scaleToGeodeticSurface(p1, scaleLast);
+ const numPoints = PolylinePipeline.numberOfPoints(p0, p1, minDistance);
+ const start = ellipsoid.cartesianToCartographic(first, carto1);
+ const end = ellipsoid.cartesianToCartographic(last, carto2);
+ const heights = subdivideHeights(numPoints, h0, h1);
+ ellipsoidGeodesic.setEndPoints(start, end);
+ const surfaceDistanceBetweenPoints = ellipsoidGeodesic.surfaceDistance / numPoints;
+ let index = offset2;
+ start.height = h0;
+ let cart = ellipsoid.cartographicToCartesian(start, cartesian);
+ Cartesian3_default.pack(cart, array, index);
+ index += 3;
+ for (let i = 1; i < numPoints; i++) {
+ const carto = ellipsoidGeodesic.interpolateUsingSurfaceDistance(
+ i * surfaceDistanceBetweenPoints,
+ carto2
+ );
+ carto.height = heights[i];
+ cart = ellipsoid.cartographicToCartesian(carto, cartesian);
+ Cartesian3_default.pack(cart, array, index);
+ index += 3;
+ }
+ return index;
+}
+function generateCartesianRhumbArc(p0, p1, granularity, ellipsoid, h0, h1, array, offset2) {
+ const start = ellipsoid.cartesianToCartographic(p0, carto1);
+ const end = ellipsoid.cartesianToCartographic(p1, carto2);
+ const numPoints = PolylinePipeline.numberOfPointsRhumbLine(
+ start,
+ end,
+ granularity
+ );
+ start.height = 0;
+ end.height = 0;
+ const heights = subdivideHeights(numPoints, h0, h1);
+ if (!ellipsoidRhumb.ellipsoid.equals(ellipsoid)) {
+ ellipsoidRhumb = new EllipsoidRhumbLine_default(void 0, void 0, ellipsoid);
+ }
+ ellipsoidRhumb.setEndPoints(start, end);
+ const surfaceDistanceBetweenPoints = ellipsoidRhumb.surfaceDistance / numPoints;
+ let index = offset2;
+ start.height = h0;
+ let cart = ellipsoid.cartographicToCartesian(start, cartesian);
+ Cartesian3_default.pack(cart, array, index);
+ index += 3;
+ for (let i = 1; i < numPoints; i++) {
+ const carto = ellipsoidRhumb.interpolateUsingSurfaceDistance(
+ i * surfaceDistanceBetweenPoints,
+ carto2
+ );
+ carto.height = heights[i];
+ cart = ellipsoid.cartographicToCartesian(carto, cartesian);
+ Cartesian3_default.pack(cart, array, index);
+ index += 3;
+ }
+ return index;
+}
+PolylinePipeline.wrapLongitude = function(positions, modelMatrix) {
+ const cartesians = [];
+ const segments = [];
+ if (defined_default(positions) && positions.length > 0) {
+ modelMatrix = defaultValue_default(modelMatrix, Matrix4_default.IDENTITY);
+ const inverseModelMatrix = Matrix4_default.inverseTransformation(
+ modelMatrix,
+ wrapLongitudeInversMatrix
+ );
+ const origin = Matrix4_default.multiplyByPoint(
+ inverseModelMatrix,
+ Cartesian3_default.ZERO,
+ wrapLongitudeOrigin
+ );
+ const xzNormal = Cartesian3_default.normalize(
+ Matrix4_default.multiplyByPointAsVector(
+ inverseModelMatrix,
+ Cartesian3_default.UNIT_Y,
+ wrapLongitudeXZNormal
+ ),
+ wrapLongitudeXZNormal
+ );
+ const xzPlane2 = Plane_default.fromPointNormal(
+ origin,
+ xzNormal,
+ wrapLongitudeXZPlane
+ );
+ const yzNormal = Cartesian3_default.normalize(
+ Matrix4_default.multiplyByPointAsVector(
+ inverseModelMatrix,
+ Cartesian3_default.UNIT_X,
+ wrapLongitudeYZNormal
+ ),
+ wrapLongitudeYZNormal
+ );
+ const yzPlane = Plane_default.fromPointNormal(
+ origin,
+ yzNormal,
+ wrapLongitudeYZPlane
+ );
+ let count = 1;
+ cartesians.push(Cartesian3_default.clone(positions[0]));
+ let prev = cartesians[0];
+ const length3 = positions.length;
+ for (let i = 1; i < length3; ++i) {
+ const cur = positions[i];
+ if (Plane_default.getPointDistance(yzPlane, prev) < 0 || Plane_default.getPointDistance(yzPlane, cur) < 0) {
+ const intersection = IntersectionTests_default.lineSegmentPlane(
+ prev,
+ cur,
+ xzPlane2,
+ wrapLongitudeIntersection
+ );
+ if (defined_default(intersection)) {
+ const offset2 = Cartesian3_default.multiplyByScalar(
+ xzNormal,
+ 5e-9,
+ wrapLongitudeOffset
+ );
+ if (Plane_default.getPointDistance(xzPlane2, prev) < 0) {
+ Cartesian3_default.negate(offset2, offset2);
+ }
+ cartesians.push(
+ Cartesian3_default.add(intersection, offset2, new Cartesian3_default())
+ );
+ segments.push(count + 1);
+ Cartesian3_default.negate(offset2, offset2);
+ cartesians.push(
+ Cartesian3_default.add(intersection, offset2, new Cartesian3_default())
+ );
+ count = 1;
+ }
+ }
+ cartesians.push(Cartesian3_default.clone(positions[i]));
+ count++;
+ prev = cur;
+ }
+ segments.push(count);
+ }
+ return {
+ positions: cartesians,
+ lengths: segments
+ };
+};
+PolylinePipeline.generateArc = function(options) {
+ if (!defined_default(options)) {
+ options = {};
+ }
+ const positions = options.positions;
+ if (!defined_default(positions)) {
+ throw new DeveloperError_default("options.positions is required.");
+ }
+ const length3 = positions.length;
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ let height = defaultValue_default(options.height, 0);
+ const hasHeightArray = Array.isArray(height);
+ if (length3 < 1) {
+ return [];
+ } else if (length3 === 1) {
+ const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);
+ height = hasHeightArray ? height[0] : height;
+ if (height !== 0) {
+ const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);
+ Cartesian3_default.multiplyByScalar(n, height, n);
+ Cartesian3_default.add(p, n, p);
+ }
+ return [p.x, p.y, p.z];
+ }
+ let minDistance = options.minDistance;
+ if (!defined_default(minDistance)) {
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ minDistance = Math_default.chordLength(granularity, ellipsoid.maximumRadius);
+ }
+ let numPoints = 0;
+ let i;
+ for (i = 0; i < length3 - 1; i++) {
+ numPoints += PolylinePipeline.numberOfPoints(
+ positions[i],
+ positions[i + 1],
+ minDistance
+ );
+ }
+ const arrayLength = (numPoints + 1) * 3;
+ const newPositions = new Array(arrayLength);
+ let offset2 = 0;
+ for (i = 0; i < length3 - 1; i++) {
+ const p0 = positions[i];
+ const p1 = positions[i + 1];
+ const h0 = hasHeightArray ? height[i] : height;
+ const h1 = hasHeightArray ? height[i + 1] : height;
+ offset2 = generateCartesianArc(
+ p0,
+ p1,
+ minDistance,
+ ellipsoid,
+ h0,
+ h1,
+ newPositions,
+ offset2
+ );
+ }
+ subdivideHeightsScratchArray.length = 0;
+ const lastPoint = positions[length3 - 1];
+ const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);
+ carto.height = hasHeightArray ? height[length3 - 1] : height;
+ const cart = ellipsoid.cartographicToCartesian(carto, cartesian);
+ Cartesian3_default.pack(cart, newPositions, arrayLength - 3);
+ return newPositions;
+};
+var scratchCartographic0 = new Cartographic_default();
+var scratchCartographic1 = new Cartographic_default();
+PolylinePipeline.generateRhumbArc = function(options) {
+ if (!defined_default(options)) {
+ options = {};
+ }
+ const positions = options.positions;
+ if (!defined_default(positions)) {
+ throw new DeveloperError_default("options.positions is required.");
+ }
+ const length3 = positions.length;
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ let height = defaultValue_default(options.height, 0);
+ const hasHeightArray = Array.isArray(height);
+ if (length3 < 1) {
+ return [];
+ } else if (length3 === 1) {
+ const p = ellipsoid.scaleToGeodeticSurface(positions[0], scaleFirst);
+ height = hasHeightArray ? height[0] : height;
+ if (height !== 0) {
+ const n = ellipsoid.geodeticSurfaceNormal(p, cartesian);
+ Cartesian3_default.multiplyByScalar(n, height, n);
+ Cartesian3_default.add(p, n, p);
+ }
+ return [p.x, p.y, p.z];
+ }
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ let numPoints = 0;
+ let i;
+ let c0 = ellipsoid.cartesianToCartographic(
+ positions[0],
+ scratchCartographic0
+ );
+ let c14;
+ for (i = 0; i < length3 - 1; i++) {
+ c14 = ellipsoid.cartesianToCartographic(
+ positions[i + 1],
+ scratchCartographic1
+ );
+ numPoints += PolylinePipeline.numberOfPointsRhumbLine(c0, c14, granularity);
+ c0 = Cartographic_default.clone(c14, scratchCartographic0);
+ }
+ const arrayLength = (numPoints + 1) * 3;
+ const newPositions = new Array(arrayLength);
+ let offset2 = 0;
+ for (i = 0; i < length3 - 1; i++) {
+ const p0 = positions[i];
+ const p1 = positions[i + 1];
+ const h0 = hasHeightArray ? height[i] : height;
+ const h1 = hasHeightArray ? height[i + 1] : height;
+ offset2 = generateCartesianRhumbArc(
+ p0,
+ p1,
+ granularity,
+ ellipsoid,
+ h0,
+ h1,
+ newPositions,
+ offset2
+ );
+ }
+ subdivideHeightsScratchArray.length = 0;
+ const lastPoint = positions[length3 - 1];
+ const carto = ellipsoid.cartesianToCartographic(lastPoint, carto1);
+ carto.height = hasHeightArray ? height[length3 - 1] : height;
+ const cart = ellipsoid.cartographicToCartesian(carto, cartesian);
+ Cartesian3_default.pack(cart, newPositions, arrayLength - 3);
+ return newPositions;
+};
+PolylinePipeline.generateCartesianArc = function(options) {
+ const numberArray = PolylinePipeline.generateArc(options);
+ const size = numberArray.length / 3;
+ const newPositions = new Array(size);
+ for (let i = 0; i < size; i++) {
+ newPositions[i] = Cartesian3_default.unpack(numberArray, i * 3);
+ }
+ return newPositions;
+};
+PolylinePipeline.generateCartesianRhumbArc = function(options) {
+ const numberArray = PolylinePipeline.generateRhumbArc(options);
+ const size = numberArray.length / 3;
+ const newPositions = new Array(size);
+ for (let i = 0; i < size; i++) {
+ newPositions[i] = Cartesian3_default.unpack(numberArray, i * 3);
+ }
+ return newPositions;
+};
+var PolylinePipeline_default = PolylinePipeline;
+
+// Source/Scene/Polyline.js
+function Polyline(options, polylineCollection) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._show = defaultValue_default(options.show, true);
+ this._width = defaultValue_default(options.width, 1);
+ this._loop = defaultValue_default(options.loop, false);
+ this._distanceDisplayCondition = options.distanceDisplayCondition;
+ this._material = options.material;
+ if (!defined_default(this._material)) {
+ this._material = Material_default.fromType(Material_default.ColorType, {
+ color: new Color_default(1, 1, 1, 1)
+ });
+ }
+ let positions = options.positions;
+ if (!defined_default(positions)) {
+ positions = [];
+ }
+ this._positions = positions;
+ this._actualPositions = arrayRemoveDuplicates_default(
+ positions,
+ Cartesian3_default.equalsEpsilon
+ );
+ if (this._loop && this._actualPositions.length > 2) {
+ if (this._actualPositions === this._positions) {
+ this._actualPositions = positions.slice();
+ }
+ this._actualPositions.push(Cartesian3_default.clone(this._actualPositions[0]));
+ }
+ this._length = this._actualPositions.length;
+ this._id = options.id;
+ let modelMatrix;
+ if (defined_default(polylineCollection)) {
+ modelMatrix = Matrix4_default.clone(polylineCollection.modelMatrix);
+ }
+ this._modelMatrix = modelMatrix;
+ this._segments = PolylinePipeline_default.wrapLongitude(
+ this._actualPositions,
+ modelMatrix
+ );
+ this._actualLength = void 0;
+ this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES2);
+ this._polylineCollection = polylineCollection;
+ this._dirty = false;
+ this._pickId = void 0;
+ this._boundingVolume = BoundingSphere_default.fromPoints(this._actualPositions);
+ this._boundingVolumeWC = BoundingSphere_default.transform(
+ this._boundingVolume,
+ this._modelMatrix
+ );
+ this._boundingVolume2D = new BoundingSphere_default();
+}
+var POSITION_INDEX3 = Polyline.POSITION_INDEX = 0;
+var SHOW_INDEX3 = Polyline.SHOW_INDEX = 1;
+var WIDTH_INDEX = Polyline.WIDTH_INDEX = 2;
+var MATERIAL_INDEX = Polyline.MATERIAL_INDEX = 3;
+var POSITION_SIZE_INDEX = Polyline.POSITION_SIZE_INDEX = 4;
+var DISTANCE_DISPLAY_CONDITION2 = Polyline.DISTANCE_DISPLAY_CONDITION = 5;
+var NUMBER_OF_PROPERTIES2 = Polyline.NUMBER_OF_PROPERTIES = 6;
+function makeDirty2(polyline, propertyChanged) {
+ ++polyline._propertiesChanged[propertyChanged];
+ const polylineCollection = polyline._polylineCollection;
+ if (defined_default(polylineCollection)) {
+ polylineCollection._updatePolyline(polyline, propertyChanged);
+ polyline._dirty = true;
+ }
+}
+Object.defineProperties(Polyline.prototype, {
+ show: {
+ get: function() {
+ return this._show;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (value !== this._show) {
+ this._show = value;
+ makeDirty2(this, SHOW_INDEX3);
+ }
+ }
+ },
+ positions: {
+ get: function() {
+ return this._positions;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ let positions = arrayRemoveDuplicates_default(value, Cartesian3_default.equalsEpsilon);
+ if (this._loop && positions.length > 2) {
+ if (positions === value) {
+ positions = value.slice();
+ }
+ positions.push(Cartesian3_default.clone(positions[0]));
+ }
+ if (this._actualPositions.length !== positions.length || this._actualPositions.length !== this._length) {
+ makeDirty2(this, POSITION_SIZE_INDEX);
+ }
+ this._positions = value;
+ this._actualPositions = positions;
+ this._length = positions.length;
+ this._boundingVolume = BoundingSphere_default.fromPoints(
+ this._actualPositions,
+ this._boundingVolume
+ );
+ this._boundingVolumeWC = BoundingSphere_default.transform(
+ this._boundingVolume,
+ this._modelMatrix,
+ this._boundingVolumeWC
+ );
+ makeDirty2(this, POSITION_INDEX3);
+ this.update();
+ }
+ },
+ material: {
+ get: function() {
+ return this._material;
+ },
+ set: function(material) {
+ if (!defined_default(material)) {
+ throw new DeveloperError_default("material is required.");
+ }
+ if (this._material !== material) {
+ this._material = material;
+ makeDirty2(this, MATERIAL_INDEX);
+ }
+ }
+ },
+ width: {
+ get: function() {
+ return this._width;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const width = this._width;
+ if (value !== width) {
+ this._width = value;
+ makeDirty2(this, WIDTH_INDEX);
+ }
+ }
+ },
+ loop: {
+ get: function() {
+ return this._loop;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (value !== this._loop) {
+ let positions = this._actualPositions;
+ if (value) {
+ if (positions.length > 2 && !Cartesian3_default.equals(positions[0], positions[positions.length - 1])) {
+ if (positions.length === this._positions.length) {
+ this._actualPositions = positions = this._positions.slice();
+ }
+ positions.push(Cartesian3_default.clone(positions[0]));
+ }
+ } else if (positions.length > 2 && Cartesian3_default.equals(positions[0], positions[positions.length - 1])) {
+ if (positions.length - 1 === this._positions.length) {
+ this._actualPositions = this._positions;
+ } else {
+ positions.pop();
+ }
+ }
+ this._loop = value;
+ makeDirty2(this, POSITION_SIZE_INDEX);
+ }
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ },
+ set: function(value) {
+ this._id = value;
+ if (defined_default(this._pickId)) {
+ this._pickId.object.id = value;
+ }
+ }
+ },
+ pickId: {
+ get: function() {
+ return this._pickId;
+ }
+ },
+ isDestroyed: {
+ get: function() {
+ return !defined_default(this._polylineCollection);
+ }
+ },
+ distanceDisplayCondition: {
+ get: function() {
+ return this._distanceDisplayCondition;
+ },
+ set: function(value) {
+ if (defined_default(value) && value.far <= value.near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ if (!DistanceDisplayCondition_default.equals(value, this._distanceDisplayCondition)) {
+ this._distanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ value,
+ this._distanceDisplayCondition
+ );
+ makeDirty2(this, DISTANCE_DISPLAY_CONDITION2);
+ }
+ }
+ }
+});
+Polyline.prototype.update = function() {
+ let modelMatrix = Matrix4_default.IDENTITY;
+ if (defined_default(this._polylineCollection)) {
+ modelMatrix = this._polylineCollection.modelMatrix;
+ }
+ const segmentPositionsLength = this._segments.positions.length;
+ const segmentLengths = this._segments.lengths;
+ const positionsChanged = this._propertiesChanged[POSITION_INDEX3] > 0 || this._propertiesChanged[POSITION_SIZE_INDEX] > 0;
+ if (!Matrix4_default.equals(modelMatrix, this._modelMatrix) || positionsChanged) {
+ this._segments = PolylinePipeline_default.wrapLongitude(
+ this._actualPositions,
+ modelMatrix
+ );
+ this._boundingVolumeWC = BoundingSphere_default.transform(
+ this._boundingVolume,
+ modelMatrix,
+ this._boundingVolumeWC
+ );
+ }
+ this._modelMatrix = Matrix4_default.clone(modelMatrix, this._modelMatrix);
+ if (this._segments.positions.length !== segmentPositionsLength) {
+ makeDirty2(this, POSITION_SIZE_INDEX);
+ } else {
+ const length3 = segmentLengths.length;
+ for (let i = 0; i < length3; ++i) {
+ if (segmentLengths[i] !== this._segments.lengths[i]) {
+ makeDirty2(this, POSITION_SIZE_INDEX);
+ break;
+ }
+ }
+ }
+};
+Polyline.prototype.getPickId = function(context) {
+ if (!defined_default(this._pickId)) {
+ this._pickId = context.createPickId({
+ primitive: this,
+ collection: this._polylineCollection,
+ id: this._id
+ });
+ }
+ return this._pickId;
+};
+Polyline.prototype._clean = function() {
+ this._dirty = false;
+ const properties = this._propertiesChanged;
+ for (let k = 0; k < NUMBER_OF_PROPERTIES2 - 1; ++k) {
+ properties[k] = 0;
+ }
+};
+Polyline.prototype._destroy = function() {
+ this._pickId = this._pickId && this._pickId.destroy();
+ this._material = this._material && this._material.destroy();
+ this._polylineCollection = void 0;
+};
+var Polyline_default = Polyline;
+
+// Source/Scene/PolylineCollection.js
+var SHOW_INDEX4 = Polyline_default.SHOW_INDEX;
+var WIDTH_INDEX2 = Polyline_default.WIDTH_INDEX;
+var POSITION_INDEX4 = Polyline_default.POSITION_INDEX;
+var MATERIAL_INDEX2 = Polyline_default.MATERIAL_INDEX;
+var POSITION_SIZE_INDEX2 = Polyline_default.POSITION_SIZE_INDEX;
+var DISTANCE_DISPLAY_CONDITION3 = Polyline_default.DISTANCE_DISPLAY_CONDITION;
+var NUMBER_OF_PROPERTIES3 = Polyline_default.NUMBER_OF_PROPERTIES;
+var attributeLocations2 = {
+ texCoordExpandAndBatchIndex: 0,
+ position3DHigh: 1,
+ position3DLow: 2,
+ position2DHigh: 3,
+ position2DLow: 4,
+ prevPosition3DHigh: 5,
+ prevPosition3DLow: 6,
+ prevPosition2DHigh: 7,
+ prevPosition2DLow: 8,
+ nextPosition3DHigh: 9,
+ nextPosition3DLow: 10,
+ nextPosition2DHigh: 11,
+ nextPosition2DLow: 12
+};
+function PolylineCollection(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this.show = defaultValue_default(options.show, true);
+ this.modelMatrix = Matrix4_default.clone(
+ defaultValue_default(options.modelMatrix, Matrix4_default.IDENTITY)
+ );
+ this._modelMatrix = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this.debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this._opaqueRS = void 0;
+ this._translucentRS = void 0;
+ this._colorCommands = [];
+ this._polylinesUpdated = false;
+ this._polylinesRemoved = false;
+ this._createVertexArray = false;
+ this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES3);
+ this._polylines = [];
+ this._polylineBuckets = {};
+ this._positionBufferUsage = {
+ bufferUsage: BufferUsage_default.STATIC_DRAW,
+ frameCount: 0
+ };
+ this._mode = void 0;
+ this._polylinesToUpdate = [];
+ this._vertexArrays = [];
+ this._positionBuffer = void 0;
+ this._texCoordExpandAndBatchIndexBuffer = void 0;
+ this._batchTable = void 0;
+ this._createBatchTable = false;
+ this._useHighlightColor = false;
+ this._highlightColor = Color_default.clone(Color_default.WHITE);
+ const that = this;
+ this._uniformMap = {
+ u_highlightColor: function() {
+ return that._highlightColor;
+ }
+ };
+}
+Object.defineProperties(PolylineCollection.prototype, {
+ length: {
+ get: function() {
+ removePolylines(this);
+ return this._polylines.length;
+ }
+ }
+});
+PolylineCollection.prototype.add = function(options) {
+ const p = new Polyline_default(options, this);
+ p._index = this._polylines.length;
+ this._polylines.push(p);
+ this._createVertexArray = true;
+ this._createBatchTable = true;
+ return p;
+};
+PolylineCollection.prototype.remove = function(polyline) {
+ if (this.contains(polyline)) {
+ this._polylinesRemoved = true;
+ this._createVertexArray = true;
+ this._createBatchTable = true;
+ if (defined_default(polyline._bucket)) {
+ const bucket = polyline._bucket;
+ bucket.shaderProgram = bucket.shaderProgram && bucket.shaderProgram.destroy();
+ }
+ polyline._destroy();
+ return true;
+ }
+ return false;
+};
+PolylineCollection.prototype.removeAll = function() {
+ releaseShaders(this);
+ destroyPolylines(this);
+ this._polylineBuckets = {};
+ this._polylinesRemoved = false;
+ this._polylines.length = 0;
+ this._polylinesToUpdate.length = 0;
+ this._createVertexArray = true;
+};
+PolylineCollection.prototype.contains = function(polyline) {
+ return defined_default(polyline) && polyline._polylineCollection === this;
+};
+PolylineCollection.prototype.get = function(index) {
+ if (!defined_default(index)) {
+ throw new DeveloperError_default("index is required.");
+ }
+ removePolylines(this);
+ return this._polylines[index];
+};
+function createBatchTable2(collection, context) {
+ if (defined_default(collection._batchTable)) {
+ collection._batchTable.destroy();
+ }
+ const attributes = [
+ {
+ functionName: "batchTable_getWidthAndShow",
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 2
+ },
+ {
+ functionName: "batchTable_getPickColor",
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 4,
+ normalize: true
+ },
+ {
+ functionName: "batchTable_getCenterHigh",
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ },
+ {
+ functionName: "batchTable_getCenterLowAndRadius",
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4
+ },
+ {
+ functionName: "batchTable_getDistanceDisplayCondition",
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2
+ }
+ ];
+ collection._batchTable = new BatchTable_default(
+ context,
+ attributes,
+ collection._polylines.length
+ );
+}
+var scratchUpdatePolylineEncodedCartesian = new EncodedCartesian3_default();
+var scratchUpdatePolylineCartesian4 = new Cartesian4_default();
+var scratchNearFarCartesian2 = new Cartesian2_default();
+PolylineCollection.prototype.update = function(frameState) {
+ removePolylines(this);
+ if (this._polylines.length === 0 || !this.show) {
+ return;
+ }
+ updateMode2(this, frameState);
+ const context = frameState.context;
+ const projection = frameState.mapProjection;
+ let polyline;
+ let properties = this._propertiesChanged;
+ if (this._createBatchTable) {
+ if (ContextLimits_default.maximumVertexTextureImageUnits === 0) {
+ throw new RuntimeError_default(
+ "Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero."
+ );
+ }
+ createBatchTable2(this, context);
+ this._createBatchTable = false;
+ }
+ if (this._createVertexArray || computeNewBuffersUsage(this)) {
+ createVertexArrays(this, context, projection);
+ } else if (this._polylinesUpdated) {
+ const polylinesToUpdate = this._polylinesToUpdate;
+ if (this._mode !== SceneMode_default.SCENE3D) {
+ const updateLength = polylinesToUpdate.length;
+ for (let i = 0; i < updateLength; ++i) {
+ polyline = polylinesToUpdate[i];
+ polyline.update();
+ }
+ }
+ if (properties[POSITION_SIZE_INDEX2] || properties[MATERIAL_INDEX2]) {
+ createVertexArrays(this, context, projection);
+ } else {
+ const length3 = polylinesToUpdate.length;
+ const polylineBuckets = this._polylineBuckets;
+ for (let ii = 0; ii < length3; ++ii) {
+ polyline = polylinesToUpdate[ii];
+ properties = polyline._propertiesChanged;
+ const bucket = polyline._bucket;
+ let index = 0;
+ for (const x in polylineBuckets) {
+ if (polylineBuckets.hasOwnProperty(x)) {
+ if (polylineBuckets[x] === bucket) {
+ if (properties[POSITION_INDEX4]) {
+ bucket.writeUpdate(
+ index,
+ polyline,
+ this._positionBuffer,
+ projection
+ );
+ }
+ break;
+ }
+ index += polylineBuckets[x].lengthOfPositions;
+ }
+ }
+ if (properties[SHOW_INDEX4] || properties[WIDTH_INDEX2]) {
+ this._batchTable.setBatchedAttribute(
+ polyline._index,
+ 0,
+ new Cartesian2_default(polyline._width, polyline._show)
+ );
+ }
+ if (this._batchTable.attributes.length > 2) {
+ if (properties[POSITION_INDEX4] || properties[POSITION_SIZE_INDEX2]) {
+ const boundingSphere = frameState.mode === SceneMode_default.SCENE2D ? polyline._boundingVolume2D : polyline._boundingVolumeWC;
+ const encodedCenter = EncodedCartesian3_default.fromCartesian(
+ boundingSphere.center,
+ scratchUpdatePolylineEncodedCartesian
+ );
+ const low = Cartesian4_default.fromElements(
+ encodedCenter.low.x,
+ encodedCenter.low.y,
+ encodedCenter.low.z,
+ boundingSphere.radius,
+ scratchUpdatePolylineCartesian4
+ );
+ this._batchTable.setBatchedAttribute(
+ polyline._index,
+ 2,
+ encodedCenter.high
+ );
+ this._batchTable.setBatchedAttribute(polyline._index, 3, low);
+ }
+ if (properties[DISTANCE_DISPLAY_CONDITION3]) {
+ const nearFarCartesian = scratchNearFarCartesian2;
+ nearFarCartesian.x = 0;
+ nearFarCartesian.y = Number.MAX_VALUE;
+ const distanceDisplayCondition = polyline.distanceDisplayCondition;
+ if (defined_default(distanceDisplayCondition)) {
+ nearFarCartesian.x = distanceDisplayCondition.near;
+ nearFarCartesian.y = distanceDisplayCondition.far;
+ }
+ this._batchTable.setBatchedAttribute(
+ polyline._index,
+ 4,
+ nearFarCartesian
+ );
+ }
+ }
+ polyline._clean();
+ }
+ }
+ polylinesToUpdate.length = 0;
+ this._polylinesUpdated = false;
+ }
+ properties = this._propertiesChanged;
+ for (let k = 0; k < NUMBER_OF_PROPERTIES3; ++k) {
+ properties[k] = 0;
+ }
+ let modelMatrix = Matrix4_default.IDENTITY;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ modelMatrix = this.modelMatrix;
+ }
+ const pass = frameState.passes;
+ const useDepthTest = frameState.morphTime !== 0;
+ if (!defined_default(this._opaqueRS) || this._opaqueRS.depthTest.enabled !== useDepthTest) {
+ this._opaqueRS = RenderState_default.fromCache({
+ depthMask: useDepthTest,
+ depthTest: {
+ enabled: useDepthTest
+ }
+ });
+ }
+ if (!defined_default(this._translucentRS) || this._translucentRS.depthTest.enabled !== useDepthTest) {
+ this._translucentRS = RenderState_default.fromCache({
+ blending: BlendingState_default.ALPHA_BLEND,
+ depthMask: !useDepthTest,
+ depthTest: {
+ enabled: useDepthTest
+ }
+ });
+ }
+ this._batchTable.update(frameState);
+ if (pass.render || pass.pick) {
+ const colorList = this._colorCommands;
+ createCommandLists(this, frameState, colorList, modelMatrix);
+ }
+};
+var boundingSphereScratch = new BoundingSphere_default();
+var boundingSphereScratch2 = new BoundingSphere_default();
+function createCommandLists(polylineCollection, frameState, commands, modelMatrix) {
+ const context = frameState.context;
+ const commandList = frameState.commandList;
+ const commandsLength = commands.length;
+ let commandIndex = 0;
+ let cloneBoundingSphere = true;
+ const vertexArrays = polylineCollection._vertexArrays;
+ const debugShowBoundingVolume2 = polylineCollection.debugShowBoundingVolume;
+ const batchTable = polylineCollection._batchTable;
+ const uniformCallback = batchTable.getUniformMapCallback();
+ const length3 = vertexArrays.length;
+ for (let m = 0; m < length3; ++m) {
+ const va = vertexArrays[m];
+ const buckets = va.buckets;
+ const bucketLength = buckets.length;
+ for (let n = 0; n < bucketLength; ++n) {
+ const bucketLocator = buckets[n];
+ let offset2 = bucketLocator.offset;
+ const sp = bucketLocator.bucket.shaderProgram;
+ const polylines = bucketLocator.bucket.polylines;
+ const polylineLength = polylines.length;
+ let currentId2;
+ let currentMaterial;
+ let count = 0;
+ let command;
+ let uniformMap2;
+ for (let s = 0; s < polylineLength; ++s) {
+ const polyline = polylines[s];
+ const mId = createMaterialId(polyline._material);
+ if (mId !== currentId2) {
+ if (defined_default(currentId2) && count > 0) {
+ const translucent = currentMaterial.isTranslucent();
+ if (commandIndex >= commandsLength) {
+ command = new DrawCommand_default({
+ owner: polylineCollection
+ });
+ commands.push(command);
+ } else {
+ command = commands[commandIndex];
+ }
+ ++commandIndex;
+ uniformMap2 = combine_default(
+ uniformCallback(currentMaterial._uniforms),
+ polylineCollection._uniformMap
+ );
+ command.boundingVolume = BoundingSphere_default.clone(
+ boundingSphereScratch,
+ command.boundingVolume
+ );
+ command.modelMatrix = modelMatrix;
+ command.shaderProgram = sp;
+ command.vertexArray = va.va;
+ command.renderState = translucent ? polylineCollection._translucentRS : polylineCollection._opaqueRS;
+ command.pass = translucent ? Pass_default.TRANSLUCENT : Pass_default.OPAQUE;
+ command.debugShowBoundingVolume = debugShowBoundingVolume2;
+ command.pickId = "v_pickColor";
+ command.uniformMap = uniformMap2;
+ command.count = count;
+ command.offset = offset2;
+ offset2 += count;
+ count = 0;
+ cloneBoundingSphere = true;
+ commandList.push(command);
+ }
+ currentMaterial = polyline._material;
+ currentMaterial.update(context);
+ currentId2 = mId;
+ }
+ const locators = polyline._locatorBuckets;
+ const locatorLength = locators.length;
+ for (let t = 0; t < locatorLength; ++t) {
+ const locator = locators[t];
+ if (locator.locator === bucketLocator) {
+ count += locator.count;
+ }
+ }
+ let boundingVolume;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ boundingVolume = polyline._boundingVolumeWC;
+ } else if (frameState.mode === SceneMode_default.COLUMBUS_VIEW) {
+ boundingVolume = polyline._boundingVolume2D;
+ } else if (frameState.mode === SceneMode_default.SCENE2D) {
+ if (defined_default(polyline._boundingVolume2D)) {
+ boundingVolume = BoundingSphere_default.clone(
+ polyline._boundingVolume2D,
+ boundingSphereScratch2
+ );
+ boundingVolume.center.x = 0;
+ }
+ } else if (defined_default(polyline._boundingVolumeWC) && defined_default(polyline._boundingVolume2D)) {
+ boundingVolume = BoundingSphere_default.union(
+ polyline._boundingVolumeWC,
+ polyline._boundingVolume2D,
+ boundingSphereScratch2
+ );
+ }
+ if (cloneBoundingSphere) {
+ cloneBoundingSphere = false;
+ BoundingSphere_default.clone(boundingVolume, boundingSphereScratch);
+ } else {
+ BoundingSphere_default.union(
+ boundingVolume,
+ boundingSphereScratch,
+ boundingSphereScratch
+ );
+ }
+ }
+ if (defined_default(currentId2) && count > 0) {
+ if (commandIndex >= commandsLength) {
+ command = new DrawCommand_default({
+ owner: polylineCollection
+ });
+ commands.push(command);
+ } else {
+ command = commands[commandIndex];
+ }
+ ++commandIndex;
+ uniformMap2 = combine_default(
+ uniformCallback(currentMaterial._uniforms),
+ polylineCollection._uniformMap
+ );
+ command.boundingVolume = BoundingSphere_default.clone(
+ boundingSphereScratch,
+ command.boundingVolume
+ );
+ command.modelMatrix = modelMatrix;
+ command.shaderProgram = sp;
+ command.vertexArray = va.va;
+ command.renderState = currentMaterial.isTranslucent() ? polylineCollection._translucentRS : polylineCollection._opaqueRS;
+ command.pass = currentMaterial.isTranslucent() ? Pass_default.TRANSLUCENT : Pass_default.OPAQUE;
+ command.debugShowBoundingVolume = debugShowBoundingVolume2;
+ command.pickId = "v_pickColor";
+ command.uniformMap = uniformMap2;
+ command.count = count;
+ command.offset = offset2;
+ cloneBoundingSphere = true;
+ commandList.push(command);
+ }
+ currentId2 = void 0;
+ }
+ }
+ commands.length = commandIndex;
+}
+PolylineCollection.prototype.isDestroyed = function() {
+ return false;
+};
+PolylineCollection.prototype.destroy = function() {
+ destroyVertexArrays(this);
+ releaseShaders(this);
+ destroyPolylines(this);
+ this._batchTable = this._batchTable && this._batchTable.destroy();
+ return destroyObject_default(this);
+};
+function computeNewBuffersUsage(collection) {
+ let usageChanged = false;
+ const properties = collection._propertiesChanged;
+ const bufferUsage = collection._positionBufferUsage;
+ if (properties[POSITION_INDEX4]) {
+ if (bufferUsage.bufferUsage !== BufferUsage_default.STREAM_DRAW) {
+ usageChanged = true;
+ bufferUsage.bufferUsage = BufferUsage_default.STREAM_DRAW;
+ bufferUsage.frameCount = 100;
+ } else {
+ bufferUsage.frameCount = 100;
+ }
+ } else if (bufferUsage.bufferUsage !== BufferUsage_default.STATIC_DRAW) {
+ if (bufferUsage.frameCount === 0) {
+ usageChanged = true;
+ bufferUsage.bufferUsage = BufferUsage_default.STATIC_DRAW;
+ } else {
+ bufferUsage.frameCount--;
+ }
+ }
+ return usageChanged;
+}
+var emptyVertexBuffer = [0, 0, 0];
+function createVertexArrays(collection, context, projection) {
+ collection._createVertexArray = false;
+ releaseShaders(collection);
+ destroyVertexArrays(collection);
+ sortPolylinesIntoBuckets(collection);
+ const totalIndices = [[]];
+ let indices2 = totalIndices[0];
+ const batchTable = collection._batchTable;
+ const useHighlightColor = collection._useHighlightColor;
+ const vertexBufferOffset = [0];
+ let offset2 = 0;
+ const vertexArrayBuckets = [[]];
+ let totalLength = 0;
+ const polylineBuckets = collection._polylineBuckets;
+ let x;
+ let bucket;
+ for (x in polylineBuckets) {
+ if (polylineBuckets.hasOwnProperty(x)) {
+ bucket = polylineBuckets[x];
+ bucket.updateShader(context, batchTable, useHighlightColor);
+ totalLength += bucket.lengthOfPositions;
+ }
+ }
+ if (totalLength > 0) {
+ const mode2 = collection._mode;
+ const positionArray = new Float32Array(6 * totalLength * 3);
+ const texCoordExpandAndBatchIndexArray = new Float32Array(totalLength * 4);
+ let position3DArray;
+ let positionIndex = 0;
+ let colorIndex = 0;
+ let texCoordExpandAndBatchIndexIndex = 0;
+ for (x in polylineBuckets) {
+ if (polylineBuckets.hasOwnProperty(x)) {
+ bucket = polylineBuckets[x];
+ bucket.write(
+ positionArray,
+ texCoordExpandAndBatchIndexArray,
+ positionIndex,
+ colorIndex,
+ texCoordExpandAndBatchIndexIndex,
+ batchTable,
+ context,
+ projection
+ );
+ if (mode2 === SceneMode_default.MORPHING) {
+ if (!defined_default(position3DArray)) {
+ position3DArray = new Float32Array(6 * totalLength * 3);
+ }
+ bucket.writeForMorph(position3DArray, positionIndex);
+ }
+ const bucketLength = bucket.lengthOfPositions;
+ positionIndex += 6 * bucketLength * 3;
+ colorIndex += bucketLength * 4;
+ texCoordExpandAndBatchIndexIndex += bucketLength * 4;
+ offset2 = bucket.updateIndices(
+ totalIndices,
+ vertexBufferOffset,
+ vertexArrayBuckets,
+ offset2
+ );
+ }
+ }
+ const positionBufferUsage = collection._positionBufferUsage.bufferUsage;
+ const texCoordExpandAndBatchIndexBufferUsage = BufferUsage_default.STATIC_DRAW;
+ collection._positionBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: positionArray,
+ usage: positionBufferUsage
+ });
+ let position3DBuffer;
+ if (defined_default(position3DArray)) {
+ position3DBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: position3DArray,
+ usage: positionBufferUsage
+ });
+ }
+ collection._texCoordExpandAndBatchIndexBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: texCoordExpandAndBatchIndexArray,
+ usage: texCoordExpandAndBatchIndexBufferUsage
+ });
+ const positionSizeInBytes = 3 * Float32Array.BYTES_PER_ELEMENT;
+ const texCoordExpandAndBatchIndexSizeInBytes = 4 * Float32Array.BYTES_PER_ELEMENT;
+ let vbo = 0;
+ const numberOfIndicesArrays = totalIndices.length;
+ for (let k = 0; k < numberOfIndicesArrays; ++k) {
+ indices2 = totalIndices[k];
+ if (indices2.length > 0) {
+ const indicesArray = new Uint16Array(indices2);
+ const indexBuffer = Buffer_default.createIndexBuffer({
+ context,
+ typedArray: indicesArray,
+ usage: BufferUsage_default.STATIC_DRAW,
+ indexDatatype: IndexDatatype_default.UNSIGNED_SHORT
+ });
+ vbo += vertexBufferOffset[k];
+ const positionHighOffset = 6 * (k * (positionSizeInBytes * Math_default.SIXTY_FOUR_KILOBYTES) - vbo * positionSizeInBytes);
+ const positionLowOffset = positionSizeInBytes + positionHighOffset;
+ const prevPositionHighOffset = positionSizeInBytes + positionLowOffset;
+ const prevPositionLowOffset = positionSizeInBytes + prevPositionHighOffset;
+ const nextPositionHighOffset = positionSizeInBytes + prevPositionLowOffset;
+ const nextPositionLowOffset = positionSizeInBytes + nextPositionHighOffset;
+ const vertexTexCoordExpandAndBatchIndexBufferOffset = k * (texCoordExpandAndBatchIndexSizeInBytes * Math_default.SIXTY_FOUR_KILOBYTES) - vbo * texCoordExpandAndBatchIndexSizeInBytes;
+ const attributes = [
+ {
+ index: attributeLocations2.position3DHigh,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: positionHighOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.position3DLow,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: positionLowOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.position2DHigh,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: positionHighOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.position2DLow,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: positionLowOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.prevPosition3DHigh,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: prevPositionHighOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.prevPosition3DLow,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: prevPositionLowOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.prevPosition2DHigh,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: prevPositionHighOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.prevPosition2DLow,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: prevPositionLowOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.nextPosition3DHigh,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: nextPositionHighOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.nextPosition3DLow,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: nextPositionLowOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.nextPosition2DHigh,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: nextPositionHighOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.nextPosition2DLow,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ offsetInBytes: nextPositionLowOffset,
+ strideInBytes: 6 * positionSizeInBytes
+ },
+ {
+ index: attributeLocations2.texCoordExpandAndBatchIndex,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ vertexBuffer: collection._texCoordExpandAndBatchIndexBuffer,
+ offsetInBytes: vertexTexCoordExpandAndBatchIndexBufferOffset
+ }
+ ];
+ let bufferProperty3D;
+ let buffer3D;
+ let buffer2D;
+ let bufferProperty2D;
+ if (mode2 === SceneMode_default.SCENE3D) {
+ buffer3D = collection._positionBuffer;
+ bufferProperty3D = "vertexBuffer";
+ buffer2D = emptyVertexBuffer;
+ bufferProperty2D = "value";
+ } else if (mode2 === SceneMode_default.SCENE2D || mode2 === SceneMode_default.COLUMBUS_VIEW) {
+ buffer3D = emptyVertexBuffer;
+ bufferProperty3D = "value";
+ buffer2D = collection._positionBuffer;
+ bufferProperty2D = "vertexBuffer";
+ } else {
+ buffer3D = position3DBuffer;
+ bufferProperty3D = "vertexBuffer";
+ buffer2D = collection._positionBuffer;
+ bufferProperty2D = "vertexBuffer";
+ }
+ attributes[0][bufferProperty3D] = buffer3D;
+ attributes[1][bufferProperty3D] = buffer3D;
+ attributes[2][bufferProperty2D] = buffer2D;
+ attributes[3][bufferProperty2D] = buffer2D;
+ attributes[4][bufferProperty3D] = buffer3D;
+ attributes[5][bufferProperty3D] = buffer3D;
+ attributes[6][bufferProperty2D] = buffer2D;
+ attributes[7][bufferProperty2D] = buffer2D;
+ attributes[8][bufferProperty3D] = buffer3D;
+ attributes[9][bufferProperty3D] = buffer3D;
+ attributes[10][bufferProperty2D] = buffer2D;
+ attributes[11][bufferProperty2D] = buffer2D;
+ const va = new VertexArray_default({
+ context,
+ attributes,
+ indexBuffer
+ });
+ collection._vertexArrays.push({
+ va,
+ buckets: vertexArrayBuckets[k]
+ });
+ }
+ }
+ }
+}
+function replacer(key, value) {
+ if (value instanceof Texture_default) {
+ return value.id;
+ }
+ return value;
+}
+var scratchUniformArray2 = [];
+function createMaterialId(material) {
+ const uniforms = Material_default._uniformList[material.type];
+ const length3 = uniforms.length;
+ scratchUniformArray2.length = 2 * length3;
+ let index = 0;
+ for (let i = 0; i < length3; ++i) {
+ const uniform = uniforms[i];
+ scratchUniformArray2[index] = uniform;
+ scratchUniformArray2[index + 1] = material._uniforms[uniform]();
+ index += 2;
+ }
+ return `${material.type}:${JSON.stringify(scratchUniformArray2, replacer)}`;
+}
+function sortPolylinesIntoBuckets(collection) {
+ const mode2 = collection._mode;
+ const modelMatrix = collection._modelMatrix;
+ const polylineBuckets = collection._polylineBuckets = {};
+ const polylines = collection._polylines;
+ const length3 = polylines.length;
+ for (let i = 0; i < length3; ++i) {
+ const p = polylines[i];
+ if (p._actualPositions.length > 1) {
+ p.update();
+ const material = p.material;
+ let value = polylineBuckets[material.type];
+ if (!defined_default(value)) {
+ value = polylineBuckets[material.type] = new PolylineBucket(
+ material,
+ mode2,
+ modelMatrix
+ );
+ }
+ value.addPolyline(p);
+ }
+ }
+}
+function updateMode2(collection, frameState) {
+ const mode2 = frameState.mode;
+ if (collection._mode !== mode2 || !Matrix4_default.equals(collection._modelMatrix, collection.modelMatrix)) {
+ collection._mode = mode2;
+ collection._modelMatrix = Matrix4_default.clone(collection.modelMatrix);
+ collection._createVertexArray = true;
+ }
+}
+function removePolylines(collection) {
+ if (collection._polylinesRemoved) {
+ collection._polylinesRemoved = false;
+ const definedPolylines = [];
+ const definedPolylinesToUpdate = [];
+ let polyIndex = 0;
+ let polyline;
+ const length3 = collection._polylines.length;
+ for (let i = 0; i < length3; ++i) {
+ polyline = collection._polylines[i];
+ if (!polyline.isDestroyed) {
+ polyline._index = polyIndex++;
+ definedPolylinesToUpdate.push(polyline);
+ definedPolylines.push(polyline);
+ }
+ }
+ collection._polylines = definedPolylines;
+ collection._polylinesToUpdate = definedPolylinesToUpdate;
+ }
+}
+function releaseShaders(collection) {
+ const polylines = collection._polylines;
+ const length3 = polylines.length;
+ for (let i = 0; i < length3; ++i) {
+ if (!polylines[i].isDestroyed) {
+ const bucket = polylines[i]._bucket;
+ if (defined_default(bucket)) {
+ bucket.shaderProgram = bucket.shaderProgram && bucket.shaderProgram.destroy();
+ }
+ }
+ }
+}
+function destroyVertexArrays(collection) {
+ const length3 = collection._vertexArrays.length;
+ for (let t = 0; t < length3; ++t) {
+ collection._vertexArrays[t].va.destroy();
+ }
+ collection._vertexArrays.length = 0;
+}
+PolylineCollection.prototype._updatePolyline = function(polyline, propertyChanged) {
+ this._polylinesUpdated = true;
+ if (!polyline._dirty) {
+ this._polylinesToUpdate.push(polyline);
+ }
+ ++this._propertiesChanged[propertyChanged];
+};
+function destroyPolylines(collection) {
+ const polylines = collection._polylines;
+ const length3 = polylines.length;
+ for (let i = 0; i < length3; ++i) {
+ if (!polylines[i].isDestroyed) {
+ polylines[i]._destroy();
+ }
+ }
+}
+function VertexArrayBucketLocator(count, offset2, bucket) {
+ this.count = count;
+ this.offset = offset2;
+ this.bucket = bucket;
+}
+function PolylineBucket(material, mode2, modelMatrix) {
+ this.polylines = [];
+ this.lengthOfPositions = 0;
+ this.material = material;
+ this.shaderProgram = void 0;
+ this.mode = mode2;
+ this.modelMatrix = modelMatrix;
+}
+PolylineBucket.prototype.addPolyline = function(p) {
+ const polylines = this.polylines;
+ polylines.push(p);
+ p._actualLength = this.getPolylinePositionsLength(p);
+ this.lengthOfPositions += p._actualLength;
+ p._bucket = this;
+};
+PolylineBucket.prototype.updateShader = function(context, batchTable, useHighlightColor) {
+ if (defined_default(this.shaderProgram)) {
+ return;
+ }
+ const defines = ["DISTANCE_DISPLAY_CONDITION"];
+ if (useHighlightColor) {
+ defines.push("VECTOR_TILE");
+ }
+ if (this.material.shaderSource.search(/varying\s+float\s+v_polylineAngle;/g) !== -1) {
+ defines.push("POLYLINE_DASH");
+ }
+ if (!FeatureDetection_default.isInternetExplorer()) {
+ defines.push("CLIP_POLYLINE");
+ }
+ const fs = new ShaderSource_default({
+ defines,
+ sources: [
+ "varying vec4 v_pickColor;\n",
+ this.material.shaderSource,
+ PolylineFS_default
+ ]
+ });
+ const vsSource = batchTable.getVertexShaderCallback()(PolylineVS_default);
+ const vs = new ShaderSource_default({
+ defines,
+ sources: [PolylineCommon_default, vsSource]
+ });
+ this.shaderProgram = ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations2
+ });
+};
+function intersectsIDL(polyline) {
+ return Cartesian3_default.dot(Cartesian3_default.UNIT_X, polyline._boundingVolume.center) < 0 || polyline._boundingVolume.intersectPlane(Plane_default.ORIGIN_ZX_PLANE) === Intersect_default.INTERSECTING;
+}
+PolylineBucket.prototype.getPolylinePositionsLength = function(polyline) {
+ let length3;
+ if (this.mode === SceneMode_default.SCENE3D || !intersectsIDL(polyline)) {
+ length3 = polyline._actualPositions.length;
+ return length3 * 4 - 4;
+ }
+ let count = 0;
+ const segmentLengths = polyline._segments.lengths;
+ length3 = segmentLengths.length;
+ for (let i = 0; i < length3; ++i) {
+ count += segmentLengths[i] * 4 - 4;
+ }
+ return count;
+};
+var scratchWritePosition = new Cartesian3_default();
+var scratchWritePrevPosition = new Cartesian3_default();
+var scratchWriteNextPosition = new Cartesian3_default();
+var scratchWriteVector = new Cartesian3_default();
+var scratchPickColorCartesian = new Cartesian4_default();
+var scratchWidthShowCartesian = new Cartesian2_default();
+PolylineBucket.prototype.write = function(positionArray, texCoordExpandAndBatchIndexArray, positionIndex, colorIndex, texCoordExpandAndBatchIndexIndex, batchTable, context, projection) {
+ const mode2 = this.mode;
+ const maxLon = projection.ellipsoid.maximumRadius * Math_default.PI;
+ const polylines = this.polylines;
+ const length3 = polylines.length;
+ for (let i = 0; i < length3; ++i) {
+ const polyline = polylines[i];
+ const width = polyline.width;
+ const show = polyline.show && width > 0;
+ const polylineBatchIndex = polyline._index;
+ const segments = this.getSegments(polyline, projection);
+ const positions = segments.positions;
+ const lengths = segments.lengths;
+ const positionsLength = positions.length;
+ const pickColor = polyline.getPickId(context).color;
+ let segmentIndex = 0;
+ let count = 0;
+ let position;
+ for (let j = 0; j < positionsLength; ++j) {
+ if (j === 0) {
+ if (polyline._loop) {
+ position = positions[positionsLength - 2];
+ } else {
+ position = scratchWriteVector;
+ Cartesian3_default.subtract(positions[0], positions[1], position);
+ Cartesian3_default.add(positions[0], position, position);
+ }
+ } else {
+ position = positions[j - 1];
+ }
+ Cartesian3_default.clone(position, scratchWritePrevPosition);
+ Cartesian3_default.clone(positions[j], scratchWritePosition);
+ if (j === positionsLength - 1) {
+ if (polyline._loop) {
+ position = positions[1];
+ } else {
+ position = scratchWriteVector;
+ Cartesian3_default.subtract(
+ positions[positionsLength - 1],
+ positions[positionsLength - 2],
+ position
+ );
+ Cartesian3_default.add(positions[positionsLength - 1], position, position);
+ }
+ } else {
+ position = positions[j + 1];
+ }
+ Cartesian3_default.clone(position, scratchWriteNextPosition);
+ const segmentLength = lengths[segmentIndex];
+ if (j === count + segmentLength) {
+ count += segmentLength;
+ ++segmentIndex;
+ }
+ const segmentStart = j - count === 0;
+ const segmentEnd = j === count + lengths[segmentIndex] - 1;
+ if (mode2 === SceneMode_default.SCENE2D) {
+ scratchWritePrevPosition.z = 0;
+ scratchWritePosition.z = 0;
+ scratchWriteNextPosition.z = 0;
+ }
+ if (mode2 === SceneMode_default.SCENE2D || mode2 === SceneMode_default.MORPHING) {
+ if ((segmentStart || segmentEnd) && maxLon - Math.abs(scratchWritePosition.x) < 1) {
+ if (scratchWritePosition.x < 0 && scratchWritePrevPosition.x > 0 || scratchWritePosition.x > 0 && scratchWritePrevPosition.x < 0) {
+ Cartesian3_default.clone(scratchWritePosition, scratchWritePrevPosition);
+ }
+ if (scratchWritePosition.x < 0 && scratchWriteNextPosition.x > 0 || scratchWritePosition.x > 0 && scratchWriteNextPosition.x < 0) {
+ Cartesian3_default.clone(scratchWritePosition, scratchWriteNextPosition);
+ }
+ }
+ }
+ const startK = segmentStart ? 2 : 0;
+ const endK = segmentEnd ? 2 : 4;
+ for (let k = startK; k < endK; ++k) {
+ EncodedCartesian3_default.writeElements(
+ scratchWritePosition,
+ positionArray,
+ positionIndex
+ );
+ EncodedCartesian3_default.writeElements(
+ scratchWritePrevPosition,
+ positionArray,
+ positionIndex + 6
+ );
+ EncodedCartesian3_default.writeElements(
+ scratchWriteNextPosition,
+ positionArray,
+ positionIndex + 12
+ );
+ const direction2 = k - 2 < 0 ? -1 : 1;
+ texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex] = j / (positionsLength - 1);
+ texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex + 1] = 2 * (k % 2) - 1;
+ texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex + 2] = direction2;
+ texCoordExpandAndBatchIndexArray[texCoordExpandAndBatchIndexIndex + 3] = polylineBatchIndex;
+ positionIndex += 6 * 3;
+ texCoordExpandAndBatchIndexIndex += 4;
+ }
+ }
+ const colorCartesian = scratchPickColorCartesian;
+ colorCartesian.x = Color_default.floatToByte(pickColor.red);
+ colorCartesian.y = Color_default.floatToByte(pickColor.green);
+ colorCartesian.z = Color_default.floatToByte(pickColor.blue);
+ colorCartesian.w = Color_default.floatToByte(pickColor.alpha);
+ const widthShowCartesian = scratchWidthShowCartesian;
+ widthShowCartesian.x = width;
+ widthShowCartesian.y = show ? 1 : 0;
+ const boundingSphere = mode2 === SceneMode_default.SCENE2D ? polyline._boundingVolume2D : polyline._boundingVolumeWC;
+ const encodedCenter = EncodedCartesian3_default.fromCartesian(
+ boundingSphere.center,
+ scratchUpdatePolylineEncodedCartesian
+ );
+ const high = encodedCenter.high;
+ const low = Cartesian4_default.fromElements(
+ encodedCenter.low.x,
+ encodedCenter.low.y,
+ encodedCenter.low.z,
+ boundingSphere.radius,
+ scratchUpdatePolylineCartesian4
+ );
+ const nearFarCartesian = scratchNearFarCartesian2;
+ nearFarCartesian.x = 0;
+ nearFarCartesian.y = Number.MAX_VALUE;
+ const distanceDisplayCondition = polyline.distanceDisplayCondition;
+ if (defined_default(distanceDisplayCondition)) {
+ nearFarCartesian.x = distanceDisplayCondition.near;
+ nearFarCartesian.y = distanceDisplayCondition.far;
+ }
+ batchTable.setBatchedAttribute(polylineBatchIndex, 0, widthShowCartesian);
+ batchTable.setBatchedAttribute(polylineBatchIndex, 1, colorCartesian);
+ if (batchTable.attributes.length > 2) {
+ batchTable.setBatchedAttribute(polylineBatchIndex, 2, high);
+ batchTable.setBatchedAttribute(polylineBatchIndex, 3, low);
+ batchTable.setBatchedAttribute(polylineBatchIndex, 4, nearFarCartesian);
+ }
+ }
+};
+var morphPositionScratch = new Cartesian3_default();
+var morphPrevPositionScratch = new Cartesian3_default();
+var morphNextPositionScratch = new Cartesian3_default();
+var morphVectorScratch = new Cartesian3_default();
+PolylineBucket.prototype.writeForMorph = function(positionArray, positionIndex) {
+ const modelMatrix = this.modelMatrix;
+ const polylines = this.polylines;
+ const length3 = polylines.length;
+ for (let i = 0; i < length3; ++i) {
+ const polyline = polylines[i];
+ const positions = polyline._segments.positions;
+ const lengths = polyline._segments.lengths;
+ const positionsLength = positions.length;
+ let segmentIndex = 0;
+ let count = 0;
+ for (let j = 0; j < positionsLength; ++j) {
+ let prevPosition;
+ if (j === 0) {
+ if (polyline._loop) {
+ prevPosition = positions[positionsLength - 2];
+ } else {
+ prevPosition = morphVectorScratch;
+ Cartesian3_default.subtract(positions[0], positions[1], prevPosition);
+ Cartesian3_default.add(positions[0], prevPosition, prevPosition);
+ }
+ } else {
+ prevPosition = positions[j - 1];
+ }
+ prevPosition = Matrix4_default.multiplyByPoint(
+ modelMatrix,
+ prevPosition,
+ morphPrevPositionScratch
+ );
+ const position = Matrix4_default.multiplyByPoint(
+ modelMatrix,
+ positions[j],
+ morphPositionScratch
+ );
+ let nextPosition;
+ if (j === positionsLength - 1) {
+ if (polyline._loop) {
+ nextPosition = positions[1];
+ } else {
+ nextPosition = morphVectorScratch;
+ Cartesian3_default.subtract(
+ positions[positionsLength - 1],
+ positions[positionsLength - 2],
+ nextPosition
+ );
+ Cartesian3_default.add(
+ positions[positionsLength - 1],
+ nextPosition,
+ nextPosition
+ );
+ }
+ } else {
+ nextPosition = positions[j + 1];
+ }
+ nextPosition = Matrix4_default.multiplyByPoint(
+ modelMatrix,
+ nextPosition,
+ morphNextPositionScratch
+ );
+ const segmentLength = lengths[segmentIndex];
+ if (j === count + segmentLength) {
+ count += segmentLength;
+ ++segmentIndex;
+ }
+ const segmentStart = j - count === 0;
+ const segmentEnd = j === count + lengths[segmentIndex] - 1;
+ const startK = segmentStart ? 2 : 0;
+ const endK = segmentEnd ? 2 : 4;
+ for (let k = startK; k < endK; ++k) {
+ EncodedCartesian3_default.writeElements(position, positionArray, positionIndex);
+ EncodedCartesian3_default.writeElements(
+ prevPosition,
+ positionArray,
+ positionIndex + 6
+ );
+ EncodedCartesian3_default.writeElements(
+ nextPosition,
+ positionArray,
+ positionIndex + 12
+ );
+ positionIndex += 6 * 3;
+ }
+ }
+ }
+};
+var scratchSegmentLengths = new Array(1);
+PolylineBucket.prototype.updateIndices = function(totalIndices, vertexBufferOffset, vertexArrayBuckets, offset2) {
+ let vaCount = vertexArrayBuckets.length - 1;
+ let bucketLocator = new VertexArrayBucketLocator(0, offset2, this);
+ vertexArrayBuckets[vaCount].push(bucketLocator);
+ let count = 0;
+ let indices2 = totalIndices[totalIndices.length - 1];
+ let indicesCount = 0;
+ if (indices2.length > 0) {
+ indicesCount = indices2[indices2.length - 1] + 1;
+ }
+ const polylines = this.polylines;
+ const length3 = polylines.length;
+ for (let i = 0; i < length3; ++i) {
+ const polyline = polylines[i];
+ polyline._locatorBuckets = [];
+ let segments;
+ if (this.mode === SceneMode_default.SCENE3D) {
+ segments = scratchSegmentLengths;
+ const positionsLength = polyline._actualPositions.length;
+ if (positionsLength > 0) {
+ segments[0] = positionsLength;
+ } else {
+ continue;
+ }
+ } else {
+ segments = polyline._segments.lengths;
+ }
+ const numberOfSegments = segments.length;
+ if (numberOfSegments > 0) {
+ let segmentIndexCount = 0;
+ for (let j = 0; j < numberOfSegments; ++j) {
+ const segmentLength = segments[j] - 1;
+ for (let k = 0; k < segmentLength; ++k) {
+ if (indicesCount + 4 > Math_default.SIXTY_FOUR_KILOBYTES) {
+ polyline._locatorBuckets.push({
+ locator: bucketLocator,
+ count: segmentIndexCount
+ });
+ segmentIndexCount = 0;
+ vertexBufferOffset.push(4);
+ indices2 = [];
+ totalIndices.push(indices2);
+ indicesCount = 0;
+ bucketLocator.count = count;
+ count = 0;
+ offset2 = 0;
+ bucketLocator = new VertexArrayBucketLocator(0, 0, this);
+ vertexArrayBuckets[++vaCount] = [bucketLocator];
+ }
+ indices2.push(indicesCount, indicesCount + 2, indicesCount + 1);
+ indices2.push(indicesCount + 1, indicesCount + 2, indicesCount + 3);
+ segmentIndexCount += 6;
+ count += 6;
+ offset2 += 6;
+ indicesCount += 4;
+ }
+ }
+ polyline._locatorBuckets.push({
+ locator: bucketLocator,
+ count: segmentIndexCount
+ });
+ if (indicesCount + 4 > Math_default.SIXTY_FOUR_KILOBYTES) {
+ vertexBufferOffset.push(0);
+ indices2 = [];
+ totalIndices.push(indices2);
+ indicesCount = 0;
+ bucketLocator.count = count;
+ offset2 = 0;
+ count = 0;
+ bucketLocator = new VertexArrayBucketLocator(0, 0, this);
+ vertexArrayBuckets[++vaCount] = [bucketLocator];
+ }
+ }
+ polyline._clean();
+ }
+ bucketLocator.count = count;
+ return offset2;
+};
+PolylineBucket.prototype.getPolylineStartIndex = function(polyline) {
+ const polylines = this.polylines;
+ let positionIndex = 0;
+ const length3 = polylines.length;
+ for (let i = 0; i < length3; ++i) {
+ const p = polylines[i];
+ if (p === polyline) {
+ break;
+ }
+ positionIndex += p._actualLength;
+ }
+ return positionIndex;
+};
+var scratchSegments = {
+ positions: void 0,
+ lengths: void 0
+};
+var scratchLengths = new Array(1);
+var pscratch = new Cartesian3_default();
+var scratchCartographic6 = new Cartographic_default();
+PolylineBucket.prototype.getSegments = function(polyline, projection) {
+ let positions = polyline._actualPositions;
+ if (this.mode === SceneMode_default.SCENE3D) {
+ scratchLengths[0] = positions.length;
+ scratchSegments.positions = positions;
+ scratchSegments.lengths = scratchLengths;
+ return scratchSegments;
+ }
+ if (intersectsIDL(polyline)) {
+ positions = polyline._segments.positions;
+ }
+ const ellipsoid = projection.ellipsoid;
+ const newPositions = [];
+ const modelMatrix = this.modelMatrix;
+ const length3 = positions.length;
+ let position;
+ let p = pscratch;
+ for (let n = 0; n < length3; ++n) {
+ position = positions[n];
+ p = Matrix4_default.multiplyByPoint(modelMatrix, position, p);
+ newPositions.push(
+ projection.project(
+ ellipsoid.cartesianToCartographic(p, scratchCartographic6)
+ )
+ );
+ }
+ if (newPositions.length > 0) {
+ polyline._boundingVolume2D = BoundingSphere_default.fromPoints(
+ newPositions,
+ polyline._boundingVolume2D
+ );
+ const center2D = polyline._boundingVolume2D.center;
+ polyline._boundingVolume2D.center = new Cartesian3_default(
+ center2D.z,
+ center2D.x,
+ center2D.y
+ );
+ }
+ scratchSegments.positions = newPositions;
+ scratchSegments.lengths = polyline._segments.lengths;
+ return scratchSegments;
+};
+var scratchPositionsArray;
+PolylineBucket.prototype.writeUpdate = function(index, polyline, positionBuffer, projection) {
+ const mode2 = this.mode;
+ const maxLon = projection.ellipsoid.maximumRadius * Math_default.PI;
+ let positionsLength = polyline._actualLength;
+ if (positionsLength) {
+ index += this.getPolylineStartIndex(polyline);
+ let positionArray = scratchPositionsArray;
+ const positionsArrayLength = 6 * positionsLength * 3;
+ if (!defined_default(positionArray) || positionArray.length < positionsArrayLength) {
+ positionArray = scratchPositionsArray = new Float32Array(
+ positionsArrayLength
+ );
+ } else if (positionArray.length > positionsArrayLength) {
+ positionArray = new Float32Array(
+ positionArray.buffer,
+ 0,
+ positionsArrayLength
+ );
+ }
+ const segments = this.getSegments(polyline, projection);
+ const positions = segments.positions;
+ const lengths = segments.lengths;
+ let positionIndex = 0;
+ let segmentIndex = 0;
+ let count = 0;
+ let position;
+ positionsLength = positions.length;
+ for (let i = 0; i < positionsLength; ++i) {
+ if (i === 0) {
+ if (polyline._loop) {
+ position = positions[positionsLength - 2];
+ } else {
+ position = scratchWriteVector;
+ Cartesian3_default.subtract(positions[0], positions[1], position);
+ Cartesian3_default.add(positions[0], position, position);
+ }
+ } else {
+ position = positions[i - 1];
+ }
+ Cartesian3_default.clone(position, scratchWritePrevPosition);
+ Cartesian3_default.clone(positions[i], scratchWritePosition);
+ if (i === positionsLength - 1) {
+ if (polyline._loop) {
+ position = positions[1];
+ } else {
+ position = scratchWriteVector;
+ Cartesian3_default.subtract(
+ positions[positionsLength - 1],
+ positions[positionsLength - 2],
+ position
+ );
+ Cartesian3_default.add(positions[positionsLength - 1], position, position);
+ }
+ } else {
+ position = positions[i + 1];
+ }
+ Cartesian3_default.clone(position, scratchWriteNextPosition);
+ const segmentLength = lengths[segmentIndex];
+ if (i === count + segmentLength) {
+ count += segmentLength;
+ ++segmentIndex;
+ }
+ const segmentStart = i - count === 0;
+ const segmentEnd = i === count + lengths[segmentIndex] - 1;
+ if (mode2 === SceneMode_default.SCENE2D) {
+ scratchWritePrevPosition.z = 0;
+ scratchWritePosition.z = 0;
+ scratchWriteNextPosition.z = 0;
+ }
+ if (mode2 === SceneMode_default.SCENE2D || mode2 === SceneMode_default.MORPHING) {
+ if ((segmentStart || segmentEnd) && maxLon - Math.abs(scratchWritePosition.x) < 1) {
+ if (scratchWritePosition.x < 0 && scratchWritePrevPosition.x > 0 || scratchWritePosition.x > 0 && scratchWritePrevPosition.x < 0) {
+ Cartesian3_default.clone(scratchWritePosition, scratchWritePrevPosition);
+ }
+ if (scratchWritePosition.x < 0 && scratchWriteNextPosition.x > 0 || scratchWritePosition.x > 0 && scratchWriteNextPosition.x < 0) {
+ Cartesian3_default.clone(scratchWritePosition, scratchWriteNextPosition);
+ }
+ }
+ }
+ const startJ = segmentStart ? 2 : 0;
+ const endJ = segmentEnd ? 2 : 4;
+ for (let j = startJ; j < endJ; ++j) {
+ EncodedCartesian3_default.writeElements(
+ scratchWritePosition,
+ positionArray,
+ positionIndex
+ );
+ EncodedCartesian3_default.writeElements(
+ scratchWritePrevPosition,
+ positionArray,
+ positionIndex + 6
+ );
+ EncodedCartesian3_default.writeElements(
+ scratchWriteNextPosition,
+ positionArray,
+ positionIndex + 12
+ );
+ positionIndex += 6 * 3;
+ }
+ }
+ positionBuffer.copyFromArrayView(
+ positionArray,
+ 6 * 3 * Float32Array.BYTES_PER_ELEMENT * index
+ );
+ }
+};
+var PolylineCollection_default = PolylineCollection;
+
+// Source/Scene/Vector3DTilePoints.js
+function Vector3DTilePoints(options) {
+ this._positions = options.positions;
+ this._batchTable = options.batchTable;
+ this._batchIds = options.batchIds;
+ this._rectangle = options.rectangle;
+ this._minHeight = options.minimumHeight;
+ this._maxHeight = options.maximumHeight;
+ this._billboardCollection = new BillboardCollection_default({
+ batchTable: options.batchTable
+ });
+ this._labelCollection = new LabelCollection_default({
+ batchTable: options.batchTable
+ });
+ this._polylineCollection = new PolylineCollection_default();
+ this._polylineCollection._useHighlightColor = true;
+ this._verticesPromise = void 0;
+ this._packedBuffer = void 0;
+ this._ready = false;
+ this._update = function(points, frameState) {
+ };
+ this._readyPromise = initialize21(this);
+}
+Object.defineProperties(Vector3DTilePoints.prototype, {
+ pointsLength: {
+ get: function() {
+ return this._billboardCollection.length;
+ }
+ },
+ texturesByteLength: {
+ get: function() {
+ const billboardSize = this._billboardCollection.textureAtlas.texture.sizeInBytes;
+ const labelSize = this._labelCollection._textureAtlas.texture.sizeInBytes;
+ return billboardSize + labelSize;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ }
+});
+function packBuffer2(points, ellipsoid) {
+ const rectangle = points._rectangle;
+ const minimumHeight = points._minHeight;
+ const maximumHeight = points._maxHeight;
+ const packedLength = 2 + Rectangle_default.packedLength + Ellipsoid_default.packedLength;
+ const packedBuffer = new Float64Array(packedLength);
+ let offset2 = 0;
+ packedBuffer[offset2++] = minimumHeight;
+ packedBuffer[offset2++] = maximumHeight;
+ Rectangle_default.pack(rectangle, packedBuffer, offset2);
+ offset2 += Rectangle_default.packedLength;
+ Ellipsoid_default.pack(ellipsoid, packedBuffer, offset2);
+ return packedBuffer;
+}
+var createVerticesTaskProcessor2 = new TaskProcessor_default(
+ "createVectorTilePoints",
+ 5
+);
+var scratchPosition6 = new Cartesian3_default();
+function createPoints(points, ellipsoid) {
+ let positions;
+ if (!defined_default(points._verticesPromise)) {
+ positions = points._positions;
+ let packedBuffer = points._packedBuffer;
+ if (!defined_default(packedBuffer)) {
+ positions = points._positions = positions.slice();
+ points._batchIds = points._batchIds.slice();
+ packedBuffer = points._packedBuffer = packBuffer2(points, ellipsoid);
+ }
+ const transferrableObjects = [positions.buffer, packedBuffer.buffer];
+ const parameters = {
+ positions: positions.buffer,
+ packedBuffer: packedBuffer.buffer
+ };
+ const verticesPromise = points._verticesPromise = createVerticesTaskProcessor2.scheduleTask(
+ parameters,
+ transferrableObjects
+ );
+ if (!defined_default(verticesPromise)) {
+ return;
+ }
+ return verticesPromise.then(function(result) {
+ points._positions = new Float64Array(result.positions);
+ const billboardCollection = points._billboardCollection;
+ const labelCollection = points._labelCollection;
+ const polylineCollection = points._polylineCollection;
+ positions = points._positions;
+ const batchIds = points._batchIds;
+ const numberOfPoints = positions.length / 3;
+ for (let i = 0; i < numberOfPoints; ++i) {
+ const id = batchIds[i];
+ const position = Cartesian3_default.unpack(positions, i * 3, scratchPosition6);
+ const b = billboardCollection.add();
+ b.position = position;
+ b._batchIndex = id;
+ const l = labelCollection.add();
+ l.text = " ";
+ l.position = position;
+ l._batchIndex = id;
+ const p = polylineCollection.add();
+ p.positions = [Cartesian3_default.clone(position), Cartesian3_default.clone(position)];
+ }
+ points._positions = void 0;
+ points._packedBuffer = void 0;
+ points._ready = true;
+ });
+ }
+}
+Vector3DTilePoints.prototype.createFeatures = function(content, features) {
+ const billboardCollection = this._billboardCollection;
+ const labelCollection = this._labelCollection;
+ const polylineCollection = this._polylineCollection;
+ const batchIds = this._batchIds;
+ const length3 = batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ const billboard = billboardCollection.get(i);
+ const label = labelCollection.get(i);
+ const polyline = polylineCollection.get(i);
+ features[batchId] = new Cesium3DTilePointFeature_default(
+ content,
+ batchId,
+ billboard,
+ label,
+ polyline
+ );
+ }
+};
+Vector3DTilePoints.prototype.applyDebugSettings = function(enabled, color) {
+ if (enabled) {
+ Color_default.clone(color, this._billboardCollection._highlightColor);
+ Color_default.clone(color, this._labelCollection._highlightColor);
+ Color_default.clone(color, this._polylineCollection._highlightColor);
+ } else {
+ Color_default.clone(Color_default.WHITE, this._billboardCollection._highlightColor);
+ Color_default.clone(Color_default.WHITE, this._labelCollection._highlightColor);
+ Color_default.clone(Color_default.WHITE, this._polylineCollection._highlightColor);
+ }
+};
+function clearStyle2(polygons, features) {
+ const batchIds = polygons._batchIds;
+ const length3 = batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ const feature2 = features[batchId];
+ feature2.show = true;
+ feature2.pointSize = Cesium3DTilePointFeature_default.defaultPointSize;
+ feature2.color = Cesium3DTilePointFeature_default.defaultColor;
+ feature2.pointOutlineColor = Cesium3DTilePointFeature_default.defaultPointOutlineColor;
+ feature2.pointOutlineWidth = Cesium3DTilePointFeature_default.defaultPointOutlineWidth;
+ feature2.labelColor = Color_default.WHITE;
+ feature2.labelOutlineColor = Color_default.WHITE;
+ feature2.labelOutlineWidth = 1;
+ feature2.font = "30px sans-serif";
+ feature2.labelStyle = LabelStyle_default.FILL;
+ feature2.labelText = void 0;
+ feature2.backgroundColor = new Color_default(0.165, 0.165, 0.165, 0.8);
+ feature2.backgroundPadding = new Cartesian2_default(7, 5);
+ feature2.backgroundEnabled = false;
+ feature2.scaleByDistance = void 0;
+ feature2.translucencyByDistance = void 0;
+ feature2.distanceDisplayCondition = void 0;
+ feature2.heightOffset = 0;
+ feature2.anchorLineEnabled = false;
+ feature2.anchorLineColor = Color_default.WHITE;
+ feature2.image = void 0;
+ feature2.disableDepthTestDistance = 0;
+ feature2.horizontalOrigin = HorizontalOrigin_default.CENTER;
+ feature2.verticalOrigin = VerticalOrigin_default.CENTER;
+ feature2.labelHorizontalOrigin = HorizontalOrigin_default.RIGHT;
+ feature2.labelVerticalOrigin = VerticalOrigin_default.BASELINE;
+ }
+}
+var scratchColor7 = new Color_default();
+var scratchColor22 = new Color_default();
+var scratchColor32 = new Color_default();
+var scratchColor42 = new Color_default();
+var scratchColor52 = new Color_default();
+var scratchColor62 = new Color_default();
+var scratchScaleByDistance = new NearFarScalar_default();
+var scratchTranslucencyByDistance = new NearFarScalar_default();
+var scratchDistanceDisplayCondition = new DistanceDisplayCondition_default();
+Vector3DTilePoints.prototype.applyStyle = function(style, features) {
+ if (!defined_default(style)) {
+ clearStyle2(this, features);
+ return;
+ }
+ const batchIds = this._batchIds;
+ const length3 = batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ const feature2 = features[batchId];
+ if (defined_default(style.show)) {
+ feature2.show = style.show.evaluate(feature2);
+ }
+ if (defined_default(style.pointSize)) {
+ feature2.pointSize = style.pointSize.evaluate(feature2);
+ }
+ if (defined_default(style.color)) {
+ feature2.color = style.color.evaluateColor(feature2, scratchColor7);
+ }
+ if (defined_default(style.pointOutlineColor)) {
+ feature2.pointOutlineColor = style.pointOutlineColor.evaluateColor(
+ feature2,
+ scratchColor22
+ );
+ }
+ if (defined_default(style.pointOutlineWidth)) {
+ feature2.pointOutlineWidth = style.pointOutlineWidth.evaluate(feature2);
+ }
+ if (defined_default(style.labelColor)) {
+ feature2.labelColor = style.labelColor.evaluateColor(
+ feature2,
+ scratchColor32
+ );
+ }
+ if (defined_default(style.labelOutlineColor)) {
+ feature2.labelOutlineColor = style.labelOutlineColor.evaluateColor(
+ feature2,
+ scratchColor42
+ );
+ }
+ if (defined_default(style.labelOutlineWidth)) {
+ feature2.labelOutlineWidth = style.labelOutlineWidth.evaluate(feature2);
+ }
+ if (defined_default(style.font)) {
+ feature2.font = style.font.evaluate(feature2);
+ }
+ if (defined_default(style.labelStyle)) {
+ feature2.labelStyle = style.labelStyle.evaluate(feature2);
+ }
+ if (defined_default(style.labelText)) {
+ feature2.labelText = style.labelText.evaluate(feature2);
+ } else {
+ feature2.labelText = void 0;
+ }
+ if (defined_default(style.backgroundColor)) {
+ feature2.backgroundColor = style.backgroundColor.evaluateColor(
+ feature2,
+ scratchColor52
+ );
+ }
+ if (defined_default(style.backgroundPadding)) {
+ feature2.backgroundPadding = style.backgroundPadding.evaluate(feature2);
+ }
+ if (defined_default(style.backgroundEnabled)) {
+ feature2.backgroundEnabled = style.backgroundEnabled.evaluate(feature2);
+ }
+ if (defined_default(style.scaleByDistance)) {
+ const scaleByDistanceCart4 = style.scaleByDistance.evaluate(feature2);
+ scratchScaleByDistance.near = scaleByDistanceCart4.x;
+ scratchScaleByDistance.nearValue = scaleByDistanceCart4.y;
+ scratchScaleByDistance.far = scaleByDistanceCart4.z;
+ scratchScaleByDistance.farValue = scaleByDistanceCart4.w;
+ feature2.scaleByDistance = scratchScaleByDistance;
+ } else {
+ feature2.scaleByDistance = void 0;
+ }
+ if (defined_default(style.translucencyByDistance)) {
+ const translucencyByDistanceCart4 = style.translucencyByDistance.evaluate(
+ feature2
+ );
+ scratchTranslucencyByDistance.near = translucencyByDistanceCart4.x;
+ scratchTranslucencyByDistance.nearValue = translucencyByDistanceCart4.y;
+ scratchTranslucencyByDistance.far = translucencyByDistanceCart4.z;
+ scratchTranslucencyByDistance.farValue = translucencyByDistanceCart4.w;
+ feature2.translucencyByDistance = scratchTranslucencyByDistance;
+ } else {
+ feature2.translucencyByDistance = void 0;
+ }
+ if (defined_default(style.distanceDisplayCondition)) {
+ const distanceDisplayConditionCart2 = style.distanceDisplayCondition.evaluate(
+ feature2
+ );
+ scratchDistanceDisplayCondition.near = distanceDisplayConditionCart2.x;
+ scratchDistanceDisplayCondition.far = distanceDisplayConditionCart2.y;
+ feature2.distanceDisplayCondition = scratchDistanceDisplayCondition;
+ } else {
+ feature2.distanceDisplayCondition = void 0;
+ }
+ if (defined_default(style.heightOffset)) {
+ feature2.heightOffset = style.heightOffset.evaluate(feature2);
+ }
+ if (defined_default(style.anchorLineEnabled)) {
+ feature2.anchorLineEnabled = style.anchorLineEnabled.evaluate(feature2);
+ }
+ if (defined_default(style.anchorLineColor)) {
+ feature2.anchorLineColor = style.anchorLineColor.evaluateColor(
+ feature2,
+ scratchColor62
+ );
+ }
+ if (defined_default(style.image)) {
+ feature2.image = style.image.evaluate(feature2);
+ } else {
+ feature2.image = void 0;
+ }
+ if (defined_default(style.disableDepthTestDistance)) {
+ feature2.disableDepthTestDistance = style.disableDepthTestDistance.evaluate(
+ feature2
+ );
+ }
+ if (defined_default(style.horizontalOrigin)) {
+ feature2.horizontalOrigin = style.horizontalOrigin.evaluate(feature2);
+ }
+ if (defined_default(style.verticalOrigin)) {
+ feature2.verticalOrigin = style.verticalOrigin.evaluate(feature2);
+ }
+ if (defined_default(style.labelHorizontalOrigin)) {
+ feature2.labelHorizontalOrigin = style.labelHorizontalOrigin.evaluate(
+ feature2
+ );
+ }
+ if (defined_default(style.labelVerticalOrigin)) {
+ feature2.labelVerticalOrigin = style.labelVerticalOrigin.evaluate(feature2);
+ }
+ }
+};
+function initialize21(points) {
+ return new Promise(function(resolve2, reject) {
+ points._update = function(points2, frameState) {
+ const promise = createPoints(points2, frameState.mapProjection.ellipsoid);
+ if (points2._ready) {
+ points2._polylineCollection.update(frameState);
+ points2._billboardCollection.update(frameState);
+ points2._labelCollection.update(frameState);
+ }
+ if (!defined_default(promise)) {
+ return;
+ }
+ promise.then(function() {
+ resolve2();
+ }).catch(function(e) {
+ reject(e);
+ });
+ };
+ });
+}
+Vector3DTilePoints.prototype.update = function(frameState) {
+ this._update(this, frameState);
+};
+Vector3DTilePoints.prototype.isDestroyed = function() {
+ return false;
+};
+Vector3DTilePoints.prototype.destroy = function() {
+ this._billboardCollection = this._billboardCollection && this._billboardCollection.destroy();
+ this._labelCollection = this._labelCollection && this._labelCollection.destroy();
+ this._polylineCollection = this._polylineCollection && this._polylineCollection.destroy();
+ return destroyObject_default(this);
+};
+var Vector3DTilePoints_default = Vector3DTilePoints;
+
+// Source/Scene/Vector3DTilePolygons.js
+function Vector3DTilePolygons(options) {
+ this._batchTable = options.batchTable;
+ this._batchIds = options.batchIds;
+ this._positions = options.positions;
+ this._counts = options.counts;
+ this._indices = options.indices;
+ this._indexCounts = options.indexCounts;
+ this._indexOffsets = void 0;
+ this._batchTableColors = void 0;
+ this._packedBuffer = void 0;
+ this._batchedPositions = void 0;
+ this._transferrableBatchIds = void 0;
+ this._vertexBatchIds = void 0;
+ this._ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ this._minimumHeight = options.minimumHeight;
+ this._maximumHeight = options.maximumHeight;
+ this._polygonMinimumHeights = options.polygonMinimumHeights;
+ this._polygonMaximumHeights = options.polygonMaximumHeights;
+ this._center = defaultValue_default(options.center, Cartesian3_default.ZERO);
+ this._rectangle = options.rectangle;
+ this._center = void 0;
+ this._boundingVolume = options.boundingVolume;
+ this._boundingVolumes = void 0;
+ this._batchedIndices = void 0;
+ this._ready = false;
+ this._update = function(polygons, frameState) {
+ };
+ this._readyPromise = initialize22(this);
+ this._verticesPromise = void 0;
+ this._primitive = void 0;
+ this.debugWireframe = false;
+ this.forceRebatch = false;
+ this.classificationType = ClassificationType_default.BOTH;
+}
+Object.defineProperties(Vector3DTilePolygons.prototype, {
+ trianglesLength: {
+ get: function() {
+ if (defined_default(this._primitive)) {
+ return this._primitive.trianglesLength;
+ }
+ return 0;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ if (defined_default(this._primitive)) {
+ return this._primitive.geometryByteLength;
+ }
+ return 0;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ }
+});
+function packBuffer3(polygons) {
+ const packedBuffer = new Float64Array(
+ 3 + Cartesian3_default.packedLength + Ellipsoid_default.packedLength + Rectangle_default.packedLength
+ );
+ let offset2 = 0;
+ packedBuffer[offset2++] = polygons._indices.BYTES_PER_ELEMENT;
+ packedBuffer[offset2++] = polygons._minimumHeight;
+ packedBuffer[offset2++] = polygons._maximumHeight;
+ Cartesian3_default.pack(polygons._center, packedBuffer, offset2);
+ offset2 += Cartesian3_default.packedLength;
+ Ellipsoid_default.pack(polygons._ellipsoid, packedBuffer, offset2);
+ offset2 += Ellipsoid_default.packedLength;
+ Rectangle_default.pack(polygons._rectangle, packedBuffer, offset2);
+ return packedBuffer;
+}
+function unpackBuffer2(polygons, packedBuffer) {
+ let offset2 = 1;
+ const numBVS = packedBuffer[offset2++];
+ const bvs = polygons._boundingVolumes = new Array(numBVS);
+ for (let i = 0; i < numBVS; ++i) {
+ bvs[i] = OrientedBoundingBox_default.unpack(packedBuffer, offset2);
+ offset2 += OrientedBoundingBox_default.packedLength;
+ }
+ const numBatchedIndices = packedBuffer[offset2++];
+ const bis = polygons._batchedIndices = new Array(numBatchedIndices);
+ for (let j = 0; j < numBatchedIndices; ++j) {
+ const color = Color_default.unpack(packedBuffer, offset2);
+ offset2 += Color_default.packedLength;
+ const indexOffset = packedBuffer[offset2++];
+ const count = packedBuffer[offset2++];
+ const length3 = packedBuffer[offset2++];
+ const batchIds = new Array(length3);
+ for (let k = 0; k < length3; ++k) {
+ batchIds[k] = packedBuffer[offset2++];
+ }
+ bis[j] = new Vector3DTileBatch_default({
+ color,
+ offset: indexOffset,
+ count,
+ batchIds
+ });
+ }
+}
+var createVerticesTaskProcessor3 = new TaskProcessor_default(
+ "createVectorTilePolygons",
+ 5
+);
+var scratchColor8 = new Color_default();
+function createPrimitive2(polygons) {
+ if (defined_default(polygons._primitive)) {
+ return;
+ }
+ if (!defined_default(polygons._verticesPromise)) {
+ let positions = polygons._positions;
+ let counts = polygons._counts;
+ let indexCounts = polygons._indexCounts;
+ let indices2 = polygons._indices;
+ let batchIds = polygons._transferrableBatchIds;
+ let batchTableColors = polygons._batchTableColors;
+ let packedBuffer = polygons._packedBuffer;
+ if (!defined_default(batchTableColors)) {
+ positions = polygons._positions = polygons._positions.slice();
+ counts = polygons._counts = polygons._counts.slice();
+ indexCounts = polygons._indexCounts = polygons._indexCounts.slice();
+ indices2 = polygons._indices = polygons._indices.slice();
+ polygons._center = polygons._ellipsoid.cartographicToCartesian(
+ Rectangle_default.center(polygons._rectangle)
+ );
+ batchIds = polygons._transferrableBatchIds = new Uint32Array(
+ polygons._batchIds
+ );
+ batchTableColors = polygons._batchTableColors = new Uint32Array(
+ batchIds.length
+ );
+ const batchTable = polygons._batchTable;
+ const length3 = batchTableColors.length;
+ for (let i = 0; i < length3; ++i) {
+ const color = batchTable.getColor(i, scratchColor8);
+ batchTableColors[i] = color.toRgba();
+ }
+ packedBuffer = polygons._packedBuffer = packBuffer3(polygons);
+ }
+ const transferrableObjects = [
+ positions.buffer,
+ counts.buffer,
+ indexCounts.buffer,
+ indices2.buffer,
+ batchIds.buffer,
+ batchTableColors.buffer,
+ packedBuffer.buffer
+ ];
+ const parameters = {
+ packedBuffer: packedBuffer.buffer,
+ positions: positions.buffer,
+ counts: counts.buffer,
+ indexCounts: indexCounts.buffer,
+ indices: indices2.buffer,
+ batchIds: batchIds.buffer,
+ batchTableColors: batchTableColors.buffer
+ };
+ let minimumHeights = polygons._polygonMinimumHeights;
+ let maximumHeights = polygons._polygonMaximumHeights;
+ if (defined_default(minimumHeights) && defined_default(maximumHeights)) {
+ minimumHeights = minimumHeights.slice();
+ maximumHeights = maximumHeights.slice();
+ transferrableObjects.push(minimumHeights.buffer, maximumHeights.buffer);
+ parameters.minimumHeights = minimumHeights;
+ parameters.maximumHeights = maximumHeights;
+ }
+ const verticesPromise = polygons._verticesPromise = createVerticesTaskProcessor3.scheduleTask(
+ parameters,
+ transferrableObjects
+ );
+ if (!defined_default(verticesPromise)) {
+ return;
+ }
+ return verticesPromise.then(function(result) {
+ polygons._positions = void 0;
+ polygons._counts = void 0;
+ polygons._polygonMinimumHeights = void 0;
+ polygons._polygonMaximumHeights = void 0;
+ const packedBuffer2 = new Float64Array(result.packedBuffer);
+ const indexDatatype = packedBuffer2[0];
+ unpackBuffer2(polygons, packedBuffer2);
+ polygons._indices = IndexDatatype_default.getSizeInBytes(indexDatatype) === 2 ? new Uint16Array(result.indices) : new Uint32Array(result.indices);
+ polygons._indexOffsets = new Uint32Array(result.indexOffsets);
+ polygons._indexCounts = new Uint32Array(result.indexCounts);
+ polygons._batchedPositions = new Float32Array(result.positions);
+ polygons._vertexBatchIds = new Uint16Array(result.batchIds);
+ polygons._ready = true;
+ });
+ }
+}
+function finishPrimitive2(polygons) {
+ if (polygons._ready && !defined_default(polygons._primitive)) {
+ polygons._primitive = new Vector3DTilePrimitive_default({
+ batchTable: polygons._batchTable,
+ positions: polygons._batchedPositions,
+ batchIds: polygons._batchIds,
+ vertexBatchIds: polygons._vertexBatchIds,
+ indices: polygons._indices,
+ indexOffsets: polygons._indexOffsets,
+ indexCounts: polygons._indexCounts,
+ batchedIndices: polygons._batchedIndices,
+ boundingVolume: polygons._boundingVolume,
+ boundingVolumes: polygons._boundingVolumes,
+ center: polygons._center
+ });
+ polygons._batchTable = void 0;
+ polygons._batchIds = void 0;
+ polygons._positions = void 0;
+ polygons._counts = void 0;
+ polygons._indices = void 0;
+ polygons._indexCounts = void 0;
+ polygons._indexOffsets = void 0;
+ polygons._batchTableColors = void 0;
+ polygons._packedBuffer = void 0;
+ polygons._batchedPositions = void 0;
+ polygons._transferrableBatchIds = void 0;
+ polygons._vertexBatchIds = void 0;
+ polygons._ellipsoid = void 0;
+ polygons._minimumHeight = void 0;
+ polygons._maximumHeight = void 0;
+ polygons._polygonMinimumHeights = void 0;
+ polygons._polygonMaximumHeights = void 0;
+ polygons._center = void 0;
+ polygons._rectangle = void 0;
+ polygons._boundingVolume = void 0;
+ polygons._boundingVolumes = void 0;
+ polygons._batchedIndices = void 0;
+ polygons._verticesPromise = void 0;
+ }
+}
+Vector3DTilePolygons.prototype.createFeatures = function(content, features) {
+ this._primitive.createFeatures(content, features);
+};
+Vector3DTilePolygons.prototype.applyDebugSettings = function(enabled, color) {
+ this._primitive.applyDebugSettings(enabled, color);
+};
+Vector3DTilePolygons.prototype.applyStyle = function(style, features) {
+ this._primitive.applyStyle(style, features);
+};
+Vector3DTilePolygons.prototype.updateCommands = function(batchId, color) {
+ this._primitive.updateCommands(batchId, color);
+};
+function initialize22(polygons) {
+ return new Promise(function(resolve2, reject) {
+ polygons._update = function(polygons2, frameState) {
+ const promise = createPrimitive2(polygons2);
+ if (polygons2._ready) {
+ polygons2._primitive.debugWireframe = polygons2.debugWireframe;
+ polygons2._primitive.forceRebatch = polygons2.forceRebatch;
+ polygons2._primitive.classificationType = polygons2.classificationType;
+ polygons2._primitive.update(frameState);
+ }
+ if (!defined_default(promise)) {
+ return;
+ }
+ promise.then(function() {
+ finishPrimitive2(polygons2);
+ resolve2(polygons2);
+ }).catch(function(e) {
+ reject(e);
+ });
+ };
+ });
+}
+Vector3DTilePolygons.prototype.update = function(frameState) {
+ this._update(this, frameState);
+};
+Vector3DTilePolygons.prototype.isDestroyed = function() {
+ return false;
+};
+Vector3DTilePolygons.prototype.destroy = function() {
+ this._primitive = this._primitive && this._primitive.destroy();
+ return destroyObject_default(this);
+};
+var Vector3DTilePolygons_default = Vector3DTilePolygons;
+
+// Source/Shaders/Vector3DTilePolylinesVS.js
+var Vector3DTilePolylinesVS_default = "attribute vec4 currentPosition;\nattribute vec4 previousPosition;\nattribute vec4 nextPosition;\nattribute vec2 expandAndWidth;\nattribute float a_batchId;\n\nuniform mat4 u_modifiedModelView;\n\nvoid main()\n{\n float expandDir = expandAndWidth.x;\n float width = abs(expandAndWidth.y) + 0.5;\n bool usePrev = expandAndWidth.y < 0.0;\n\n vec4 p = u_modifiedModelView * currentPosition;\n vec4 prev = u_modifiedModelView * previousPosition;\n vec4 next = u_modifiedModelView * nextPosition;\n\n float angle;\n vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);\n gl_Position = czm_viewportOrthographic * positionWC;\n}\n";
+
+// Source/Scene/Vector3DTilePolylines.js
+function Vector3DTilePolylines(options) {
+ this._positions = options.positions;
+ this._widths = options.widths;
+ this._counts = options.counts;
+ this._batchIds = options.batchIds;
+ this._ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ this._minimumHeight = options.minimumHeight;
+ this._maximumHeight = options.maximumHeight;
+ this._center = options.center;
+ this._rectangle = options.rectangle;
+ this._boundingVolume = options.boundingVolume;
+ this._batchTable = options.batchTable;
+ this._va = void 0;
+ this._sp = void 0;
+ this._rs = void 0;
+ this._uniformMap = void 0;
+ this._command = void 0;
+ this._transferrableBatchIds = void 0;
+ this._packedBuffer = void 0;
+ this._keepDecodedPositions = options.keepDecodedPositions;
+ this._decodedPositions = void 0;
+ this._decodedPositionOffsets = void 0;
+ this._currentPositions = void 0;
+ this._previousPositions = void 0;
+ this._nextPositions = void 0;
+ this._expandAndWidth = void 0;
+ this._vertexBatchIds = void 0;
+ this._indices = void 0;
+ this._constantColor = Color_default.clone(Color_default.WHITE);
+ this._highlightColor = this._constantColor;
+ this._trianglesLength = 0;
+ this._geometryByteLength = 0;
+ this._ready = false;
+ this._update = function(polylines, frameState) {
+ };
+ this._readyPromise = initialize23(this);
+ this._verticesPromise = void 0;
+}
+Object.defineProperties(Vector3DTilePolylines.prototype, {
+ trianglesLength: {
+ get: function() {
+ return this._trianglesLength;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ return this._geometryByteLength;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ }
+});
+function packBuffer4(polylines) {
+ const rectangle = polylines._rectangle;
+ const minimumHeight = polylines._minimumHeight;
+ const maximumHeight = polylines._maximumHeight;
+ const ellipsoid = polylines._ellipsoid;
+ const center = polylines._center;
+ const packedLength = 2 + Rectangle_default.packedLength + Ellipsoid_default.packedLength + Cartesian3_default.packedLength;
+ const packedBuffer = new Float64Array(packedLength);
+ let offset2 = 0;
+ packedBuffer[offset2++] = minimumHeight;
+ packedBuffer[offset2++] = maximumHeight;
+ Rectangle_default.pack(rectangle, packedBuffer, offset2);
+ offset2 += Rectangle_default.packedLength;
+ Ellipsoid_default.pack(ellipsoid, packedBuffer, offset2);
+ offset2 += Ellipsoid_default.packedLength;
+ Cartesian3_default.pack(center, packedBuffer, offset2);
+ return packedBuffer;
+}
+var createVerticesTaskProcessor4 = new TaskProcessor_default(
+ "createVectorTilePolylines",
+ 5
+);
+var attributeLocations3 = {
+ previousPosition: 0,
+ currentPosition: 1,
+ nextPosition: 2,
+ expandAndWidth: 3,
+ a_batchId: 4
+};
+function createVertexArray4(polylines, context) {
+ if (defined_default(polylines._va)) {
+ return;
+ }
+ if (!defined_default(polylines._verticesPromise)) {
+ let positions = polylines._positions;
+ let widths = polylines._widths;
+ let counts = polylines._counts;
+ let batchIds = polylines._transferrableBatchIds;
+ let packedBuffer = polylines._packedBuffer;
+ if (!defined_default(packedBuffer)) {
+ positions = polylines._positions = positions.slice();
+ widths = polylines._widths = widths.slice();
+ counts = polylines._counts = counts.slice();
+ batchIds = polylines._transferrableBatchIds = polylines._batchIds.slice();
+ packedBuffer = polylines._packedBuffer = packBuffer4(polylines);
+ }
+ const transferrableObjects = [
+ positions.buffer,
+ widths.buffer,
+ counts.buffer,
+ batchIds.buffer,
+ packedBuffer.buffer
+ ];
+ const parameters = {
+ positions: positions.buffer,
+ widths: widths.buffer,
+ counts: counts.buffer,
+ batchIds: batchIds.buffer,
+ packedBuffer: packedBuffer.buffer,
+ keepDecodedPositions: polylines._keepDecodedPositions
+ };
+ const verticesPromise = polylines._verticesPromise = createVerticesTaskProcessor4.scheduleTask(
+ parameters,
+ transferrableObjects
+ );
+ if (!defined_default(verticesPromise)) {
+ return;
+ }
+ return verticesPromise.then(function(result) {
+ if (polylines._keepDecodedPositions) {
+ polylines._decodedPositions = new Float64Array(result.decodedPositions);
+ polylines._decodedPositionOffsets = new Uint32Array(
+ result.decodedPositionOffsets
+ );
+ }
+ polylines._currentPositions = new Float32Array(result.currentPositions);
+ polylines._previousPositions = new Float32Array(result.previousPositions);
+ polylines._nextPositions = new Float32Array(result.nextPositions);
+ polylines._expandAndWidth = new Float32Array(result.expandAndWidth);
+ polylines._vertexBatchIds = new Uint16Array(result.batchIds);
+ const indexDatatype = result.indexDatatype;
+ polylines._indices = indexDatatype === IndexDatatype_default.UNSIGNED_SHORT ? new Uint16Array(result.indices) : new Uint32Array(result.indices);
+ polylines._ready = true;
+ });
+ }
+}
+function finishVertexArray(polylines, context) {
+ if (polylines._ready && !defined_default(polylines._va)) {
+ const curPositions = polylines._currentPositions;
+ const prevPositions = polylines._previousPositions;
+ const nextPositions = polylines._nextPositions;
+ const expandAndWidth = polylines._expandAndWidth;
+ const vertexBatchIds = polylines._vertexBatchIds;
+ const indices2 = polylines._indices;
+ let byteLength = prevPositions.byteLength + curPositions.byteLength + nextPositions.byteLength;
+ byteLength += expandAndWidth.byteLength + vertexBatchIds.byteLength + indices2.byteLength;
+ polylines._trianglesLength = indices2.length / 3;
+ polylines._geometryByteLength = byteLength;
+ const prevPositionBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: prevPositions,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const curPositionBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: curPositions,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const nextPositionBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: nextPositions,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const expandAndWidthBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: expandAndWidth,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const idBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: vertexBatchIds,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const indexBuffer = Buffer_default.createIndexBuffer({
+ context,
+ typedArray: indices2,
+ usage: BufferUsage_default.STATIC_DRAW,
+ indexDatatype: indices2.BYTES_PER_ELEMENT === 2 ? IndexDatatype_default.UNSIGNED_SHORT : IndexDatatype_default.UNSIGNED_INT
+ });
+ const vertexAttributes = [
+ {
+ index: attributeLocations3.previousPosition,
+ vertexBuffer: prevPositionBuffer,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ },
+ {
+ index: attributeLocations3.currentPosition,
+ vertexBuffer: curPositionBuffer,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ },
+ {
+ index: attributeLocations3.nextPosition,
+ vertexBuffer: nextPositionBuffer,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ },
+ {
+ index: attributeLocations3.expandAndWidth,
+ vertexBuffer: expandAndWidthBuffer,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2
+ },
+ {
+ index: attributeLocations3.a_batchId,
+ vertexBuffer: idBuffer,
+ componentDatatype: ComponentDatatype_default.UNSIGNED_SHORT,
+ componentsPerAttribute: 1
+ }
+ ];
+ polylines._va = new VertexArray_default({
+ context,
+ attributes: vertexAttributes,
+ indexBuffer
+ });
+ polylines._positions = void 0;
+ polylines._widths = void 0;
+ polylines._counts = void 0;
+ polylines._ellipsoid = void 0;
+ polylines._minimumHeight = void 0;
+ polylines._maximumHeight = void 0;
+ polylines._rectangle = void 0;
+ polylines._transferrableBatchIds = void 0;
+ polylines._packedBuffer = void 0;
+ polylines._currentPositions = void 0;
+ polylines._previousPositions = void 0;
+ polylines._nextPositions = void 0;
+ polylines._expandAndWidth = void 0;
+ polylines._vertexBatchIds = void 0;
+ polylines._indices = void 0;
+ }
+}
+var modifiedModelViewScratch3 = new Matrix4_default();
+var rtcScratch3 = new Cartesian3_default();
+function createUniformMap2(primitive, context) {
+ if (defined_default(primitive._uniformMap)) {
+ return;
+ }
+ primitive._uniformMap = {
+ u_modifiedModelView: function() {
+ const viewMatrix = context.uniformState.view;
+ Matrix4_default.clone(viewMatrix, modifiedModelViewScratch3);
+ Matrix4_default.multiplyByPoint(
+ modifiedModelViewScratch3,
+ primitive._center,
+ rtcScratch3
+ );
+ Matrix4_default.setTranslation(
+ modifiedModelViewScratch3,
+ rtcScratch3,
+ modifiedModelViewScratch3
+ );
+ return modifiedModelViewScratch3;
+ },
+ u_highlightColor: function() {
+ return primitive._highlightColor;
+ }
+ };
+}
+function createRenderStates4(primitive) {
+ if (defined_default(primitive._rs)) {
+ return;
+ }
+ const polygonOffset = {
+ enabled: true,
+ factor: -5,
+ units: -5
+ };
+ primitive._rs = RenderState_default.fromCache({
+ blending: BlendingState_default.ALPHA_BLEND,
+ depthMask: false,
+ depthTest: {
+ enabled: true
+ },
+ polygonOffset
+ });
+}
+var PolylineFS = "uniform vec4 u_highlightColor; \nvoid main()\n{\n gl_FragColor = u_highlightColor;\n}\n";
+function createShaders2(primitive, context) {
+ if (defined_default(primitive._sp)) {
+ return;
+ }
+ const batchTable = primitive._batchTable;
+ const vsSource = batchTable.getVertexShaderCallback(
+ false,
+ "a_batchId",
+ void 0
+ )(Vector3DTilePolylinesVS_default);
+ const fsSource = batchTable.getFragmentShaderCallback(
+ false,
+ void 0,
+ false
+ )(PolylineFS);
+ const vs = new ShaderSource_default({
+ defines: [
+ "VECTOR_TILE",
+ !FeatureDetection_default.isInternetExplorer() ? "CLIP_POLYLINE" : ""
+ ],
+ sources: [PolylineCommon_default, vsSource]
+ });
+ const fs = new ShaderSource_default({
+ defines: ["VECTOR_TILE"],
+ sources: [fsSource]
+ });
+ primitive._sp = ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations3
+ });
+}
+function queueCommands2(primitive, frameState) {
+ if (!defined_default(primitive._command)) {
+ const uniformMap2 = primitive._batchTable.getUniformMapCallback()(
+ primitive._uniformMap
+ );
+ primitive._command = new DrawCommand_default({
+ owner: primitive,
+ vertexArray: primitive._va,
+ renderState: primitive._rs,
+ shaderProgram: primitive._sp,
+ uniformMap: uniformMap2,
+ boundingVolume: primitive._boundingVolume,
+ pass: Pass_default.TRANSLUCENT,
+ pickId: primitive._batchTable.getPickId()
+ });
+ }
+ frameState.commandList.push(primitive._command);
+}
+Vector3DTilePolylines.getPolylinePositions = function(polylines, batchId) {
+ const batchIds = polylines._batchIds;
+ const positions = polylines._decodedPositions;
+ const offsets = polylines._decodedPositionOffsets;
+ if (!defined_default(batchIds) || !defined_default(positions)) {
+ return void 0;
+ }
+ let i;
+ let j;
+ const polylinesLength = batchIds.length;
+ let positionsLength = 0;
+ let resultCounter = 0;
+ for (i = 0; i < polylinesLength; ++i) {
+ if (batchIds[i] === batchId) {
+ positionsLength += offsets[i + 1] - offsets[i];
+ }
+ }
+ if (positionsLength === 0) {
+ return void 0;
+ }
+ const results = new Float64Array(positionsLength * 3);
+ for (i = 0; i < polylinesLength; ++i) {
+ if (batchIds[i] === batchId) {
+ const offset2 = offsets[i];
+ const count = offsets[i + 1] - offset2;
+ for (j = 0; j < count; ++j) {
+ const decodedOffset = (offset2 + j) * 3;
+ results[resultCounter++] = positions[decodedOffset];
+ results[resultCounter++] = positions[decodedOffset + 1];
+ results[resultCounter++] = positions[decodedOffset + 2];
+ }
+ }
+ }
+ return results;
+};
+Vector3DTilePolylines.prototype.getPositions = function(batchId) {
+ return Vector3DTilePolylines.getPolylinePositions(this, batchId);
+};
+Vector3DTilePolylines.prototype.createFeatures = function(content, features) {
+ const batchIds = this._batchIds;
+ const length3 = batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ features[batchId] = new Cesium3DTileFeature_default(content, batchId);
+ }
+};
+Vector3DTilePolylines.prototype.applyDebugSettings = function(enabled, color) {
+ this._highlightColor = enabled ? color : this._constantColor;
+};
+function clearStyle3(polygons, features) {
+ const batchIds = polygons._batchIds;
+ const length3 = batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ const feature2 = features[batchId];
+ feature2.show = true;
+ feature2.color = Color_default.WHITE;
+ }
+}
+var scratchColor9 = new Color_default();
+var DEFAULT_COLOR_VALUE3 = Color_default.WHITE;
+var DEFAULT_SHOW_VALUE3 = true;
+Vector3DTilePolylines.prototype.applyStyle = function(style, features) {
+ if (!defined_default(style)) {
+ clearStyle3(this, features);
+ return;
+ }
+ const batchIds = this._batchIds;
+ const length3 = batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ const feature2 = features[batchId];
+ feature2.color = defined_default(style.color) ? style.color.evaluateColor(feature2, scratchColor9) : DEFAULT_COLOR_VALUE3;
+ feature2.show = defined_default(style.show) ? style.show.evaluate(feature2) : DEFAULT_SHOW_VALUE3;
+ }
+};
+function initialize23(polylines) {
+ return new Promise(function(resolve2, reject) {
+ polylines._update = function(polylines2, frameState) {
+ const context = frameState.context;
+ const promise = createVertexArray4(polylines2, context);
+ createUniformMap2(polylines2, context);
+ createShaders2(polylines2, context);
+ createRenderStates4(polylines2);
+ if (polylines2._ready) {
+ const passes = frameState.passes;
+ if (passes.render || passes.pick) {
+ queueCommands2(polylines2, frameState);
+ }
+ }
+ if (!defined_default(promise)) {
+ return;
+ }
+ promise.then(function() {
+ finishVertexArray(polylines2, context);
+ resolve2();
+ }).catch(function(e) {
+ reject(e);
+ });
+ };
+ });
+}
+Vector3DTilePolylines.prototype.update = function(frameState) {
+ this._update(this, frameState);
+};
+Vector3DTilePolylines.prototype.isDestroyed = function() {
+ return false;
+};
+Vector3DTilePolylines.prototype.destroy = function() {
+ this._va = this._va && this._va.destroy();
+ this._sp = this._sp && this._sp.destroy();
+ return destroyObject_default(this);
+};
+var Vector3DTilePolylines_default = Vector3DTilePolylines;
+
+// Source/Shaders/Vector3DTileClampedPolylinesVS.js
+var Vector3DTileClampedPolylinesVS_default = 'attribute vec3 startEllipsoidNormal;\nattribute vec3 endEllipsoidNormal;\nattribute vec4 startPositionAndHeight;\nattribute vec4 endPositionAndHeight;\nattribute vec4 startFaceNormalAndVertexCorner;\nattribute vec4 endFaceNormalAndHalfWidth;\nattribute float a_batchId;\n\nuniform mat4 u_modifiedModelView;\nuniform vec2 u_minimumMaximumVectorHeights;\n\nvarying vec4 v_startPlaneEC;\nvarying vec4 v_endPlaneEC;\nvarying vec4 v_rightPlaneEC;\nvarying float v_halfWidth;\nvarying vec3 v_volumeUpEC;\n\nvoid main()\n{\n // vertex corner IDs\n // 3-----------7\n // /| left /|\n // / | 1 / |\n // 2-----------6 5 end\n // | / | /\n // start |/ right |/\n // 0-----------4\n //\n float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end\n float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top\n\n vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;\n vec3 right = normalize(cross(forward, startEllipsoidNormal));\n\n vec4 position = vec4(startPositionAndHeight.xyz, 1.0);\n position.xyz += forward * isEnd;\n\n v_volumeUpEC = czm_normal * normalize(cross(right, forward));\n\n // Push for volume height\n float offset;\n vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);\n\n // offset height to create volume\n offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);\n offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;\n position.xyz += offset * ellipsoidNormal;\n\n // move from RTC to EC\n position = u_modifiedModelView * position;\n right = czm_normal * right;\n\n // Push for width in a direction that is in the start or end plane and in a plane with right\n // N = normalEC ("right-facing" direction for push)\n // R = right\n // p = angle between N and R\n // w = distance to push along R if R == N\n // d = distance to push along N\n //\n // N R\n // { p| } * cos(p) = dot(N, R) = w / d\n // d | |w * d = w / dot(N, R)\n // { | }\n // o---------- polyline segment ---->\n //\n vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);\n scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));\n vec3 miterPushNormal = czm_normal * normalize(scratchNormal);\n\n offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC\n offset = offset / dot(miterPushNormal, right);\n position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));\n\n gl_Position = czm_depthClamp(czm_projection * position);\n\n position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);\n vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;\n v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));\n v_rightPlaneEC = vec4(right, -dot(right, position.xyz));\n\n position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);\n vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;\n v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));\n v_halfWidth = endFaceNormalAndHalfWidth.w;\n}\n';
+
+// Source/Shaders/Vector3DTileClampedPolylinesFS.js
+var Vector3DTileClampedPolylinesFS_default = "#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n\nvarying vec4 v_startPlaneEC;\nvarying vec4 v_endPlaneEC;\nvarying vec4 v_rightPlaneEC;\nvarying float v_halfWidth;\nvarying vec3 v_volumeUpEC;\n\nuniform vec4 u_highlightColor;\nvoid main()\n{\n float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture2D(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));\n\n // Discard for sky\n if (logDepthOrDepth == 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n gl_FragColor = vec4(0.0, 0.0, 1.0, 0.5);\n return;\n#else // DEBUG_SHOW_VOLUME\n discard;\n#endif // DEBUG_SHOW_VOLUME\n }\n\n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);\n eyeCoordinate /= eyeCoordinate.w;\n\n float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);\n\n // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction\n halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));\n\n // Check distance of the eye coordinate against the right-facing plane\n float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);\n\n // Check eye coordinate against the mitering planes\n float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);\n float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);\n\n if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {\n#ifdef DEBUG_SHOW_VOLUME\n gl_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);\n return;\n#else // DEBUG_SHOW_VOLUME\n discard;\n#endif // DEBUG_SHOW_VOLUME\n }\n gl_FragColor = u_highlightColor;\n\n czm_writeDepthClamp();\n}\n";
+
+// Source/Scene/Vector3DTileClampedPolylines.js
+function Vector3DTileClampedPolylines(options) {
+ this._positions = options.positions;
+ this._widths = options.widths;
+ this._counts = options.counts;
+ this._batchIds = options.batchIds;
+ this._ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ this._minimumHeight = options.minimumHeight;
+ this._maximumHeight = options.maximumHeight;
+ this._center = options.center;
+ this._rectangle = options.rectangle;
+ this._batchTable = options.batchTable;
+ this._va = void 0;
+ this._sp = void 0;
+ this._rs = void 0;
+ this._uniformMap = void 0;
+ this._command = void 0;
+ this._transferrableBatchIds = void 0;
+ this._packedBuffer = void 0;
+ this._minimumMaximumVectorHeights = new Cartesian2_default(
+ ApproximateTerrainHeights_default._defaultMinTerrainHeight,
+ ApproximateTerrainHeights_default._defaultMaxTerrainHeight
+ );
+ this._boundingVolume = OrientedBoundingBox_default.fromRectangle(
+ options.rectangle,
+ ApproximateTerrainHeights_default._defaultMinTerrainHeight,
+ ApproximateTerrainHeights_default._defaultMaxTerrainHeight,
+ this._ellipsoid
+ );
+ this._classificationType = options.classificationType;
+ this._keepDecodedPositions = options.keepDecodedPositions;
+ this._decodedPositions = void 0;
+ this._decodedPositionOffsets = void 0;
+ this._startEllipsoidNormals = void 0;
+ this._endEllipsoidNormals = void 0;
+ this._startPositionAndHeights = void 0;
+ this._startFaceNormalAndVertexCornerIds = void 0;
+ this._endPositionAndHeights = void 0;
+ this._endFaceNormalAndHalfWidths = void 0;
+ this._vertexBatchIds = void 0;
+ this._indices = void 0;
+ this._constantColor = Color_default.clone(Color_default.WHITE);
+ this._highlightColor = this._constantColor;
+ this._trianglesLength = 0;
+ this._geometryByteLength = 0;
+ this._ready = false;
+ this._update = function(polylines, frameState) {
+ };
+ this._readyPromise = initialize24(this);
+ this._verticesPromise = void 0;
+}
+Object.defineProperties(Vector3DTileClampedPolylines.prototype, {
+ trianglesLength: {
+ get: function() {
+ return this._trianglesLength;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ return this._geometryByteLength;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ }
+});
+function updateMinimumMaximumHeights(polylines, rectangle, ellipsoid) {
+ const result = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ rectangle,
+ ellipsoid
+ );
+ const min3 = result.minimumTerrainHeight;
+ const max3 = result.maximumTerrainHeight;
+ const minimumMaximumVectorHeights = polylines._minimumMaximumVectorHeights;
+ minimumMaximumVectorHeights.x = min3;
+ minimumMaximumVectorHeights.y = max3;
+ const obb = polylines._boundingVolume;
+ const rect = polylines._rectangle;
+ OrientedBoundingBox_default.fromRectangle(rect, min3, max3, ellipsoid, obb);
+}
+function packBuffer5(polylines) {
+ const rectangle = polylines._rectangle;
+ const minimumHeight = polylines._minimumHeight;
+ const maximumHeight = polylines._maximumHeight;
+ const ellipsoid = polylines._ellipsoid;
+ const center = polylines._center;
+ const packedLength = 2 + Rectangle_default.packedLength + Ellipsoid_default.packedLength + Cartesian3_default.packedLength;
+ const packedBuffer = new Float64Array(packedLength);
+ let offset2 = 0;
+ packedBuffer[offset2++] = minimumHeight;
+ packedBuffer[offset2++] = maximumHeight;
+ Rectangle_default.pack(rectangle, packedBuffer, offset2);
+ offset2 += Rectangle_default.packedLength;
+ Ellipsoid_default.pack(ellipsoid, packedBuffer, offset2);
+ offset2 += Ellipsoid_default.packedLength;
+ Cartesian3_default.pack(center, packedBuffer, offset2);
+ return packedBuffer;
+}
+var createVerticesTaskProcessor5 = new TaskProcessor_default(
+ "createVectorTileClampedPolylines"
+);
+var attributeLocations4 = {
+ startEllipsoidNormal: 0,
+ endEllipsoidNormal: 1,
+ startPositionAndHeight: 2,
+ endPositionAndHeight: 3,
+ startFaceNormalAndVertexCorner: 4,
+ endFaceNormalAndHalfWidth: 5,
+ a_batchId: 6
+};
+function createVertexArray5(polylines, context) {
+ if (defined_default(polylines._va)) {
+ return;
+ }
+ if (!defined_default(polylines._verticesPromise)) {
+ let positions = polylines._positions;
+ let widths = polylines._widths;
+ let counts = polylines._counts;
+ let batchIds = polylines._transferrableBatchIds;
+ let packedBuffer = polylines._packedBuffer;
+ if (!defined_default(packedBuffer)) {
+ positions = polylines._positions = positions.slice();
+ widths = polylines._widths = widths.slice();
+ counts = polylines._counts = counts.slice();
+ batchIds = polylines._transferrableBatchIds = polylines._batchIds.slice();
+ packedBuffer = polylines._packedBuffer = packBuffer5(polylines);
+ }
+ const transferrableObjects = [
+ positions.buffer,
+ widths.buffer,
+ counts.buffer,
+ batchIds.buffer,
+ packedBuffer.buffer
+ ];
+ const parameters = {
+ positions: positions.buffer,
+ widths: widths.buffer,
+ counts: counts.buffer,
+ batchIds: batchIds.buffer,
+ packedBuffer: packedBuffer.buffer,
+ keepDecodedPositions: polylines._keepDecodedPositions
+ };
+ const verticesPromise = polylines._verticesPromise = createVerticesTaskProcessor5.scheduleTask(
+ parameters,
+ transferrableObjects
+ );
+ if (!defined_default(verticesPromise)) {
+ return;
+ }
+ return verticesPromise.then(function(result) {
+ if (polylines._keepDecodedPositions) {
+ polylines._decodedPositions = new Float64Array(result.decodedPositions);
+ polylines._decodedPositionOffsets = new Uint32Array(
+ result.decodedPositionOffsets
+ );
+ }
+ polylines._startEllipsoidNormals = new Float32Array(
+ result.startEllipsoidNormals
+ );
+ polylines._endEllipsoidNormals = new Float32Array(
+ result.endEllipsoidNormals
+ );
+ polylines._startPositionAndHeights = new Float32Array(
+ result.startPositionAndHeights
+ );
+ polylines._startFaceNormalAndVertexCornerIds = new Float32Array(
+ result.startFaceNormalAndVertexCornerIds
+ );
+ polylines._endPositionAndHeights = new Float32Array(
+ result.endPositionAndHeights
+ );
+ polylines._endFaceNormalAndHalfWidths = new Float32Array(
+ result.endFaceNormalAndHalfWidths
+ );
+ polylines._vertexBatchIds = new Uint16Array(result.vertexBatchIds);
+ const indexDatatype = result.indexDatatype;
+ polylines._indices = indexDatatype === IndexDatatype_default.UNSIGNED_SHORT ? new Uint16Array(result.indices) : new Uint32Array(result.indices);
+ polylines._ready = true;
+ });
+ }
+}
+function finishVertexArray2(polylines, context) {
+ if (polylines._ready && !defined_default(polylines._va)) {
+ const startEllipsoidNormals = polylines._startEllipsoidNormals;
+ const endEllipsoidNormals = polylines._endEllipsoidNormals;
+ const startPositionAndHeights = polylines._startPositionAndHeights;
+ const endPositionAndHeights = polylines._endPositionAndHeights;
+ const startFaceNormalAndVertexCornerIds = polylines._startFaceNormalAndVertexCornerIds;
+ const endFaceNormalAndHalfWidths = polylines._endFaceNormalAndHalfWidths;
+ const batchIdAttribute = polylines._vertexBatchIds;
+ const indices2 = polylines._indices;
+ let byteLength = startEllipsoidNormals.byteLength + endEllipsoidNormals.byteLength;
+ byteLength += startPositionAndHeights.byteLength + endPositionAndHeights.byteLength;
+ byteLength += startFaceNormalAndVertexCornerIds.byteLength + endFaceNormalAndHalfWidths.byteLength;
+ byteLength += batchIdAttribute.byteLength + indices2.byteLength;
+ polylines._trianglesLength = indices2.length / 3;
+ polylines._geometryByteLength = byteLength;
+ const startEllipsoidNormalsBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: startEllipsoidNormals,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const endEllipsoidNormalsBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: endEllipsoidNormals,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const startPositionAndHeightsBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: startPositionAndHeights,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const endPositionAndHeightsBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: endPositionAndHeights,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const startFaceNormalAndVertexCornerIdsBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: startFaceNormalAndVertexCornerIds,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const endFaceNormalAndHalfWidthsBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: endFaceNormalAndHalfWidths,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const batchIdAttributeBuffer = Buffer_default.createVertexBuffer({
+ context,
+ typedArray: batchIdAttribute,
+ usage: BufferUsage_default.STATIC_DRAW
+ });
+ const indexBuffer = Buffer_default.createIndexBuffer({
+ context,
+ typedArray: indices2,
+ usage: BufferUsage_default.STATIC_DRAW,
+ indexDatatype: indices2.BYTES_PER_ELEMENT === 2 ? IndexDatatype_default.UNSIGNED_SHORT : IndexDatatype_default.UNSIGNED_INT
+ });
+ const vertexAttributes = [
+ {
+ index: attributeLocations4.startEllipsoidNormal,
+ vertexBuffer: startEllipsoidNormalsBuffer,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ },
+ {
+ index: attributeLocations4.endEllipsoidNormal,
+ vertexBuffer: endEllipsoidNormalsBuffer,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3
+ },
+ {
+ index: attributeLocations4.startPositionAndHeight,
+ vertexBuffer: startPositionAndHeightsBuffer,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4
+ },
+ {
+ index: attributeLocations4.endPositionAndHeight,
+ vertexBuffer: endPositionAndHeightsBuffer,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4
+ },
+ {
+ index: attributeLocations4.startFaceNormalAndVertexCorner,
+ vertexBuffer: startFaceNormalAndVertexCornerIdsBuffer,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4
+ },
+ {
+ index: attributeLocations4.endFaceNormalAndHalfWidth,
+ vertexBuffer: endFaceNormalAndHalfWidthsBuffer,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 4
+ },
+ {
+ index: attributeLocations4.a_batchId,
+ vertexBuffer: batchIdAttributeBuffer,
+ componentDatatype: ComponentDatatype_default.UNSIGNED_SHORT,
+ componentsPerAttribute: 1
+ }
+ ];
+ polylines._va = new VertexArray_default({
+ context,
+ attributes: vertexAttributes,
+ indexBuffer
+ });
+ polylines._positions = void 0;
+ polylines._widths = void 0;
+ polylines._counts = void 0;
+ polylines._ellipsoid = void 0;
+ polylines._minimumHeight = void 0;
+ polylines._maximumHeight = void 0;
+ polylines._rectangle = void 0;
+ polylines._transferrableBatchIds = void 0;
+ polylines._packedBuffer = void 0;
+ polylines._startEllipsoidNormals = void 0;
+ polylines._endEllipsoidNormals = void 0;
+ polylines._startPositionAndHeights = void 0;
+ polylines._startFaceNormalAndVertexCornerIds = void 0;
+ polylines._endPositionAndHeights = void 0;
+ polylines._endFaceNormalAndHalfWidths = void 0;
+ polylines._vertexBatchIds = void 0;
+ polylines._indices = void 0;
+ }
+}
+var modifiedModelViewScratch4 = new Matrix4_default();
+var rtcScratch4 = new Cartesian3_default();
+function createUniformMap3(primitive, context) {
+ if (defined_default(primitive._uniformMap)) {
+ return;
+ }
+ primitive._uniformMap = {
+ u_modifiedModelView: function() {
+ const viewMatrix = context.uniformState.view;
+ Matrix4_default.clone(viewMatrix, modifiedModelViewScratch4);
+ Matrix4_default.multiplyByPoint(
+ modifiedModelViewScratch4,
+ primitive._center,
+ rtcScratch4
+ );
+ Matrix4_default.setTranslation(
+ modifiedModelViewScratch4,
+ rtcScratch4,
+ modifiedModelViewScratch4
+ );
+ return modifiedModelViewScratch4;
+ },
+ u_highlightColor: function() {
+ return primitive._highlightColor;
+ },
+ u_minimumMaximumVectorHeights: function() {
+ return primitive._minimumMaximumVectorHeights;
+ }
+ };
+}
+function getRenderState2(mask3DTiles) {
+ return RenderState_default.fromCache({
+ cull: {
+ enabled: true,
+ face: CullFace_default.FRONT
+ },
+ blending: BlendingState_default.PRE_MULTIPLIED_ALPHA_BLEND,
+ depthMask: false,
+ stencilTest: {
+ enabled: mask3DTiles,
+ frontFunction: StencilFunction_default.EQUAL,
+ frontOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.KEEP,
+ zPass: StencilOperation_default.KEEP
+ },
+ backFunction: StencilFunction_default.EQUAL,
+ backOperation: {
+ fail: StencilOperation_default.KEEP,
+ zFail: StencilOperation_default.KEEP,
+ zPass: StencilOperation_default.KEEP
+ },
+ reference: StencilConstants_default.CESIUM_3D_TILE_MASK,
+ mask: StencilConstants_default.CESIUM_3D_TILE_MASK
+ }
+ });
+}
+function createRenderStates5(primitive) {
+ if (defined_default(primitive._rs)) {
+ return;
+ }
+ primitive._rs = getRenderState2(false);
+ primitive._rs3DTiles = getRenderState2(true);
+}
+function createShaders3(primitive, context) {
+ if (defined_default(primitive._sp)) {
+ return;
+ }
+ const batchTable = primitive._batchTable;
+ const vsSource = batchTable.getVertexShaderCallback(
+ false,
+ "a_batchId",
+ void 0
+ )(Vector3DTileClampedPolylinesVS_default);
+ const fsSource = batchTable.getFragmentShaderCallback(
+ false,
+ void 0,
+ true
+ )(Vector3DTileClampedPolylinesFS_default);
+ const vs = new ShaderSource_default({
+ defines: [
+ "VECTOR_TILE",
+ !FeatureDetection_default.isInternetExplorer() ? "CLIP_POLYLINE" : ""
+ ],
+ sources: [PolylineCommon_default, vsSource]
+ });
+ const fs = new ShaderSource_default({
+ defines: ["VECTOR_TILE"],
+ sources: [fsSource]
+ });
+ primitive._sp = ShaderProgram_default.fromCache({
+ context,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations4
+ });
+}
+function queueCommands3(primitive, frameState) {
+ let command = primitive._command;
+ if (!defined_default(primitive._command)) {
+ const uniformMap2 = primitive._batchTable.getUniformMapCallback()(
+ primitive._uniformMap
+ );
+ command = primitive._command = new DrawCommand_default({
+ owner: primitive,
+ vertexArray: primitive._va,
+ renderState: primitive._rs,
+ shaderProgram: primitive._sp,
+ uniformMap: uniformMap2,
+ boundingVolume: primitive._boundingVolume,
+ pass: Pass_default.TERRAIN_CLASSIFICATION,
+ pickId: primitive._batchTable.getPickId()
+ });
+ const derivedTilesetCommand = DrawCommand_default.shallowClone(
+ command,
+ command.derivedCommands.tileset
+ );
+ derivedTilesetCommand.renderState = primitive._rs3DTiles;
+ derivedTilesetCommand.pass = Pass_default.CESIUM_3D_TILE_CLASSIFICATION;
+ command.derivedCommands.tileset = derivedTilesetCommand;
+ }
+ const classificationType = primitive._classificationType;
+ if (classificationType === ClassificationType_default.TERRAIN || classificationType === ClassificationType_default.BOTH) {
+ frameState.commandList.push(command);
+ }
+ if (classificationType === ClassificationType_default.CESIUM_3D_TILE || classificationType === ClassificationType_default.BOTH) {
+ frameState.commandList.push(command.derivedCommands.tileset);
+ }
+}
+Vector3DTileClampedPolylines.prototype.getPositions = function(batchId) {
+ return Vector3DTilePolylines_default.getPolylinePositions(this, batchId);
+};
+Vector3DTileClampedPolylines.prototype.createFeatures = function(content, features) {
+ const batchIds = this._batchIds;
+ const length3 = batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ features[batchId] = new Cesium3DTileFeature_default(content, batchId);
+ }
+};
+Vector3DTileClampedPolylines.prototype.applyDebugSettings = function(enabled, color) {
+ this._highlightColor = enabled ? color : this._constantColor;
+};
+function clearStyle4(polygons, features) {
+ const batchIds = polygons._batchIds;
+ const length3 = batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ const feature2 = features[batchId];
+ feature2.show = true;
+ feature2.color = Color_default.WHITE;
+ }
+}
+var scratchColor10 = new Color_default();
+var DEFAULT_COLOR_VALUE4 = Color_default.WHITE;
+var DEFAULT_SHOW_VALUE4 = true;
+Vector3DTileClampedPolylines.prototype.applyStyle = function(style, features) {
+ if (!defined_default(style)) {
+ clearStyle4(this, features);
+ return;
+ }
+ const batchIds = this._batchIds;
+ const length3 = batchIds.length;
+ for (let i = 0; i < length3; ++i) {
+ const batchId = batchIds[i];
+ const feature2 = features[batchId];
+ feature2.color = defined_default(style.color) ? style.color.evaluateColor(feature2, scratchColor10) : DEFAULT_COLOR_VALUE4;
+ feature2.show = defined_default(style.show) ? style.show.evaluate(feature2) : DEFAULT_SHOW_VALUE4;
+ }
+};
+function initialize24(polylines) {
+ return ApproximateTerrainHeights_default.initialize().then(function() {
+ updateMinimumMaximumHeights(
+ polylines,
+ polylines._rectangle,
+ polylines._ellipsoid
+ );
+ return new Promise(function(resolve2, reject) {
+ polylines._update = function(polylines2, frameState) {
+ const context = frameState.context;
+ const promise = createVertexArray5(polylines2, context);
+ createUniformMap3(polylines2, context);
+ createShaders3(polylines2, context);
+ createRenderStates5(polylines2);
+ if (polylines2._ready) {
+ const passes = frameState.passes;
+ if (passes.render || passes.pick) {
+ queueCommands3(polylines2, frameState);
+ }
+ }
+ if (!defined_default(promise)) {
+ return;
+ }
+ promise.then(function() {
+ finishVertexArray2(polylines2, context);
+ resolve2(polylines2);
+ }).catch(function(e) {
+ reject(e);
+ });
+ };
+ });
+ });
+}
+Vector3DTileClampedPolylines.prototype.update = function(frameState) {
+ this._update(this, frameState);
+};
+Vector3DTileClampedPolylines.prototype.isDestroyed = function() {
+ return false;
+};
+Vector3DTileClampedPolylines.prototype.destroy = function() {
+ this._va = this._va && this._va.destroy();
+ this._sp = this._sp && this._sp.destroy();
+ return destroyObject_default(this);
+};
+var Vector3DTileClampedPolylines_default = Vector3DTileClampedPolylines;
+
+// Source/Core/decodeVectorPolylinePositions.js
+var maxShort = 32767;
+var scratchBVCartographic2 = new Cartographic_default();
+var scratchEncodedPosition = new Cartesian3_default();
+function decodeVectorPolylinePositions(positions, rectangle, minimumHeight, maximumHeight, ellipsoid) {
+ const positionsLength = positions.length / 3;
+ const uBuffer = positions.subarray(0, positionsLength);
+ const vBuffer = positions.subarray(positionsLength, 2 * positionsLength);
+ const heightBuffer = positions.subarray(
+ 2 * positionsLength,
+ 3 * positionsLength
+ );
+ AttributeCompression_default.zigZagDeltaDecode(uBuffer, vBuffer, heightBuffer);
+ const decoded = new Float64Array(positions.length);
+ for (let i = 0; i < positionsLength; ++i) {
+ const u3 = uBuffer[i];
+ const v7 = vBuffer[i];
+ const h = heightBuffer[i];
+ const lon = Math_default.lerp(rectangle.west, rectangle.east, u3 / maxShort);
+ const lat = Math_default.lerp(rectangle.south, rectangle.north, v7 / maxShort);
+ const alt = Math_default.lerp(minimumHeight, maximumHeight, h / maxShort);
+ const cartographic2 = Cartographic_default.fromRadians(
+ lon,
+ lat,
+ alt,
+ scratchBVCartographic2
+ );
+ const decodedPosition = ellipsoid.cartographicToCartesian(
+ cartographic2,
+ scratchEncodedPosition
+ );
+ Cartesian3_default.pack(decodedPosition, decoded, i * 3);
+ }
+ return decoded;
+}
+var decodeVectorPolylinePositions_default = decodeVectorPolylinePositions;
+
+// Source/Scene/Vector3DTileContent.js
+function Vector3DTileContent(tileset, tile, resource, arrayBuffer, byteOffset) {
+ this._tileset = tileset;
+ this._tile = tile;
+ this._resource = resource;
+ this._polygons = void 0;
+ this._polylines = void 0;
+ this._points = void 0;
+ this._metadata = void 0;
+ this._batchTable = void 0;
+ this._features = void 0;
+ this.featurePropertiesDirty = false;
+ this._group = void 0;
+ initialize25(this, arrayBuffer, byteOffset);
+}
+Object.defineProperties(Vector3DTileContent.prototype, {
+ featuresLength: {
+ get: function() {
+ return defined_default(this._batchTable) ? this._batchTable.featuresLength : 0;
+ }
+ },
+ pointsLength: {
+ get: function() {
+ if (defined_default(this._points)) {
+ return this._points.pointsLength;
+ }
+ return 0;
+ }
+ },
+ trianglesLength: {
+ get: function() {
+ let trianglesLength = 0;
+ if (defined_default(this._polygons)) {
+ trianglesLength += this._polygons.trianglesLength;
+ }
+ if (defined_default(this._polylines)) {
+ trianglesLength += this._polylines.trianglesLength;
+ }
+ return trianglesLength;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ let geometryByteLength = 0;
+ if (defined_default(this._polygons)) {
+ geometryByteLength += this._polygons.geometryByteLength;
+ }
+ if (defined_default(this._polylines)) {
+ geometryByteLength += this._polylines.geometryByteLength;
+ }
+ return geometryByteLength;
+ }
+ },
+ texturesByteLength: {
+ get: function() {
+ if (defined_default(this._points)) {
+ return this._points.texturesByteLength;
+ }
+ return 0;
+ }
+ },
+ batchTableByteLength: {
+ get: function() {
+ return defined_default(this._batchTable) ? this._batchTable.batchTableByteLength : 0;
+ }
+ },
+ innerContents: {
+ get: function() {
+ return void 0;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ const pointsPromise = defined_default(this._points) ? this._points.readyPromise : void 0;
+ const polygonPromise = defined_default(this._polygons) ? this._polygons.readyPromise : void 0;
+ const polylinePromise = defined_default(this._polylines) ? this._polylines.readyPromise : void 0;
+ const that = this;
+ return Promise.all([pointsPromise, polygonPromise, polylinePromise]).then(
+ function() {
+ return that;
+ }
+ );
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._tileset;
+ }
+ },
+ tile: {
+ get: function() {
+ return this._tile;
+ }
+ },
+ url: {
+ get: function() {
+ return this._resource.getUrlComponent(true);
+ }
+ },
+ metadata: {
+ get: function() {
+ return this._metadata;
+ },
+ set: function(value) {
+ this._metadata = value;
+ }
+ },
+ batchTable: {
+ get: function() {
+ return this._batchTable;
+ }
+ },
+ group: {
+ get: function() {
+ return this._group;
+ },
+ set: function(value) {
+ this._group = value;
+ }
+ }
+});
+function createColorChangedCallback2(content) {
+ return function(batchId, color) {
+ if (defined_default(content._polygons)) {
+ content._polygons.updateCommands(batchId, color);
+ }
+ };
+}
+function getBatchIds2(featureTableJson, featureTableBinary) {
+ let polygonBatchIds;
+ let polylineBatchIds;
+ let pointBatchIds;
+ let i;
+ const numberOfPolygons = defaultValue_default(featureTableJson.POLYGONS_LENGTH, 0);
+ const numberOfPolylines = defaultValue_default(featureTableJson.POLYLINES_LENGTH, 0);
+ const numberOfPoints = defaultValue_default(featureTableJson.POINTS_LENGTH, 0);
+ if (numberOfPolygons > 0 && defined_default(featureTableJson.POLYGON_BATCH_IDS)) {
+ const polygonBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.POLYGON_BATCH_IDS.byteOffset;
+ polygonBatchIds = new Uint16Array(
+ featureTableBinary.buffer,
+ polygonBatchIdsByteOffset,
+ numberOfPolygons
+ );
+ }
+ if (numberOfPolylines > 0 && defined_default(featureTableJson.POLYLINE_BATCH_IDS)) {
+ const polylineBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.POLYLINE_BATCH_IDS.byteOffset;
+ polylineBatchIds = new Uint16Array(
+ featureTableBinary.buffer,
+ polylineBatchIdsByteOffset,
+ numberOfPolylines
+ );
+ }
+ if (numberOfPoints > 0 && defined_default(featureTableJson.POINT_BATCH_IDS)) {
+ const pointBatchIdsByteOffset = featureTableBinary.byteOffset + featureTableJson.POINT_BATCH_IDS.byteOffset;
+ pointBatchIds = new Uint16Array(
+ featureTableBinary.buffer,
+ pointBatchIdsByteOffset,
+ numberOfPoints
+ );
+ }
+ const atLeastOneDefined = defined_default(polygonBatchIds) || defined_default(polylineBatchIds) || defined_default(pointBatchIds);
+ const atLeastOneUndefined = numberOfPolygons > 0 && !defined_default(polygonBatchIds) || numberOfPolylines > 0 && !defined_default(polylineBatchIds) || numberOfPoints > 0 && !defined_default(pointBatchIds);
+ if (atLeastOneDefined && atLeastOneUndefined) {
+ throw new RuntimeError_default(
+ "If one group of batch ids is defined, then all batch ids must be defined."
+ );
+ }
+ const allUndefinedBatchIds = !defined_default(polygonBatchIds) && !defined_default(polylineBatchIds) && !defined_default(pointBatchIds);
+ if (allUndefinedBatchIds) {
+ let id = 0;
+ if (!defined_default(polygonBatchIds) && numberOfPolygons > 0) {
+ polygonBatchIds = new Uint16Array(numberOfPolygons);
+ for (i = 0; i < numberOfPolygons; ++i) {
+ polygonBatchIds[i] = id++;
+ }
+ }
+ if (!defined_default(polylineBatchIds) && numberOfPolylines > 0) {
+ polylineBatchIds = new Uint16Array(numberOfPolylines);
+ for (i = 0; i < numberOfPolylines; ++i) {
+ polylineBatchIds[i] = id++;
+ }
+ }
+ if (!defined_default(pointBatchIds) && numberOfPoints > 0) {
+ pointBatchIds = new Uint16Array(numberOfPoints);
+ for (i = 0; i < numberOfPoints; ++i) {
+ pointBatchIds[i] = id++;
+ }
+ }
+ }
+ return {
+ polygons: polygonBatchIds,
+ polylines: polylineBatchIds,
+ points: pointBatchIds
+ };
+}
+var sizeOfUint327 = Uint32Array.BYTES_PER_ELEMENT;
+function createFloatingPolylines(options) {
+ return new Vector3DTilePolylines_default(options);
+}
+function createClampedPolylines(options) {
+ return new Vector3DTileClampedPolylines_default(options);
+}
+function initialize25(content, arrayBuffer, byteOffset) {
+ byteOffset = defaultValue_default(byteOffset, 0);
+ const uint8Array = new Uint8Array(arrayBuffer);
+ const view = new DataView(arrayBuffer);
+ byteOffset += sizeOfUint327;
+ const version2 = view.getUint32(byteOffset, true);
+ if (version2 !== 1) {
+ throw new RuntimeError_default(
+ `Only Vector tile version 1 is supported. Version ${version2} is not.`
+ );
+ }
+ byteOffset += sizeOfUint327;
+ const byteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint327;
+ if (byteLength === 0) {
+ return Promise.resolve(content);
+ }
+ const featureTableJSONByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint327;
+ if (featureTableJSONByteLength === 0) {
+ throw new RuntimeError_default(
+ "Feature table must have a byte length greater than zero"
+ );
+ }
+ const featureTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint327;
+ const batchTableJSONByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint327;
+ const batchTableBinaryByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint327;
+ const indicesByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint327;
+ const positionByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint327;
+ const polylinePositionByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint327;
+ const pointsPositionByteLength = view.getUint32(byteOffset, true);
+ byteOffset += sizeOfUint327;
+ const featureTableJson = getJsonFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ featureTableJSONByteLength
+ );
+ byteOffset += featureTableJSONByteLength;
+ const featureTableBinary = new Uint8Array(
+ arrayBuffer,
+ byteOffset,
+ featureTableBinaryByteLength
+ );
+ byteOffset += featureTableBinaryByteLength;
+ let batchTableJson;
+ let batchTableBinary;
+ if (batchTableJSONByteLength > 0) {
+ batchTableJson = getJsonFromTypedArray_default(
+ uint8Array,
+ byteOffset,
+ batchTableJSONByteLength
+ );
+ byteOffset += batchTableJSONByteLength;
+ if (batchTableBinaryByteLength > 0) {
+ batchTableBinary = new Uint8Array(
+ arrayBuffer,
+ byteOffset,
+ batchTableBinaryByteLength
+ );
+ batchTableBinary = new Uint8Array(batchTableBinary);
+ byteOffset += batchTableBinaryByteLength;
+ }
+ }
+ const numberOfPolygons = defaultValue_default(featureTableJson.POLYGONS_LENGTH, 0);
+ const numberOfPolylines = defaultValue_default(featureTableJson.POLYLINES_LENGTH, 0);
+ const numberOfPoints = defaultValue_default(featureTableJson.POINTS_LENGTH, 0);
+ const totalPrimitives = numberOfPolygons + numberOfPolylines + numberOfPoints;
+ const batchTable = new Cesium3DTileBatchTable_default(
+ content,
+ totalPrimitives,
+ batchTableJson,
+ batchTableBinary,
+ createColorChangedCallback2(content)
+ );
+ content._batchTable = batchTable;
+ if (totalPrimitives === 0) {
+ return;
+ }
+ const featureTable = new Cesium3DTileFeatureTable_default(
+ featureTableJson,
+ featureTableBinary
+ );
+ const region = featureTable.getGlobalProperty("REGION");
+ if (!defined_default(region)) {
+ throw new RuntimeError_default(
+ "Feature table global property: REGION must be defined"
+ );
+ }
+ const rectangle = Rectangle_default.unpack(region);
+ const minHeight = region[4];
+ const maxHeight = region[5];
+ const modelMatrix = content._tile.computedTransform;
+ let center = featureTable.getGlobalProperty(
+ "RTC_CENTER",
+ ComponentDatatype_default.FLOAT,
+ 3
+ );
+ if (defined_default(center)) {
+ center = Cartesian3_default.unpack(center);
+ Matrix4_default.multiplyByPoint(modelMatrix, center, center);
+ } else {
+ center = Rectangle_default.center(rectangle);
+ center.height = Math_default.lerp(minHeight, maxHeight, 0.5);
+ center = Ellipsoid_default.WGS84.cartographicToCartesian(center);
+ }
+ const batchIds = getBatchIds2(featureTableJson, featureTableBinary);
+ byteOffset += (4 - byteOffset % 4) % 4;
+ if (numberOfPolygons > 0) {
+ featureTable.featuresLength = numberOfPolygons;
+ const polygonCounts = defaultValue_default(
+ featureTable.getPropertyArray(
+ "POLYGON_COUNTS",
+ ComponentDatatype_default.UNSIGNED_INT,
+ 1
+ ),
+ featureTable.getPropertyArray(
+ "POLYGON_COUNT",
+ ComponentDatatype_default.UNSIGNED_INT,
+ 1
+ )
+ );
+ if (!defined_default(polygonCounts)) {
+ throw new RuntimeError_default(
+ "Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0"
+ );
+ }
+ const polygonIndexCounts = defaultValue_default(
+ featureTable.getPropertyArray(
+ "POLYGON_INDEX_COUNTS",
+ ComponentDatatype_default.UNSIGNED_INT,
+ 1
+ ),
+ featureTable.getPropertyArray(
+ "POLYGON_INDEX_COUNT",
+ ComponentDatatype_default.UNSIGNED_INT,
+ 1
+ )
+ );
+ if (!defined_default(polygonIndexCounts)) {
+ throw new RuntimeError_default(
+ "Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0"
+ );
+ }
+ const numPolygonPositions = polygonCounts.reduce(function(total, count) {
+ return total + count * 2;
+ }, 0);
+ const numPolygonIndices = polygonIndexCounts.reduce(
+ function(total, count) {
+ return total + count;
+ },
+ 0
+ );
+ const indices2 = new Uint32Array(arrayBuffer, byteOffset, numPolygonIndices);
+ byteOffset += indicesByteLength;
+ const polygonPositions = new Uint16Array(
+ arrayBuffer,
+ byteOffset,
+ numPolygonPositions
+ );
+ byteOffset += positionByteLength;
+ let polygonMinimumHeights;
+ let polygonMaximumHeights;
+ if (defined_default(featureTableJson.POLYGON_MINIMUM_HEIGHTS) && defined_default(featureTableJson.POLYGON_MAXIMUM_HEIGHTS)) {
+ polygonMinimumHeights = featureTable.getPropertyArray(
+ "POLYGON_MINIMUM_HEIGHTS",
+ ComponentDatatype_default.FLOAT,
+ 1
+ );
+ polygonMaximumHeights = featureTable.getPropertyArray(
+ "POLYGON_MAXIMUM_HEIGHTS",
+ ComponentDatatype_default.FLOAT,
+ 1
+ );
+ }
+ content._polygons = new Vector3DTilePolygons_default({
+ positions: polygonPositions,
+ counts: polygonCounts,
+ indexCounts: polygonIndexCounts,
+ indices: indices2,
+ minimumHeight: minHeight,
+ maximumHeight: maxHeight,
+ polygonMinimumHeights,
+ polygonMaximumHeights,
+ center,
+ rectangle,
+ boundingVolume: content.tile.boundingVolume.boundingVolume,
+ batchTable,
+ batchIds: batchIds.polygons,
+ modelMatrix
+ });
+ }
+ if (numberOfPolylines > 0) {
+ featureTable.featuresLength = numberOfPolylines;
+ const polylineCounts = defaultValue_default(
+ featureTable.getPropertyArray(
+ "POLYLINE_COUNTS",
+ ComponentDatatype_default.UNSIGNED_INT,
+ 1
+ ),
+ featureTable.getPropertyArray(
+ "POLYLINE_COUNT",
+ ComponentDatatype_default.UNSIGNED_INT,
+ 1
+ )
+ );
+ if (!defined_default(polylineCounts)) {
+ throw new RuntimeError_default(
+ "Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0"
+ );
+ }
+ let widths = featureTable.getPropertyArray(
+ "POLYLINE_WIDTHS",
+ ComponentDatatype_default.UNSIGNED_SHORT,
+ 1
+ );
+ if (!defined_default(widths)) {
+ widths = new Uint16Array(numberOfPolylines);
+ for (let i = 0; i < numberOfPolylines; ++i) {
+ widths[i] = 2;
+ }
+ }
+ const numPolylinePositions = polylineCounts.reduce(function(total, count) {
+ return total + count * 3;
+ }, 0);
+ const polylinePositions = new Uint16Array(
+ arrayBuffer,
+ byteOffset,
+ numPolylinePositions
+ );
+ byteOffset += polylinePositionByteLength;
+ const tileset = content._tileset;
+ const examineVectorLinesFunction = tileset.examineVectorLinesFunction;
+ if (defined_default(examineVectorLinesFunction)) {
+ const decodedPositions = decodeVectorPolylinePositions_default(
+ new Uint16Array(polylinePositions),
+ rectangle,
+ minHeight,
+ maxHeight,
+ Ellipsoid_default.WGS84
+ );
+ examineVectorLines(
+ decodedPositions,
+ polylineCounts,
+ batchIds.polylines,
+ batchTable,
+ content.url,
+ examineVectorLinesFunction
+ );
+ }
+ let createPolylines = createFloatingPolylines;
+ if (defined_default(tileset.classificationType)) {
+ createPolylines = createClampedPolylines;
+ }
+ content._polylines = createPolylines({
+ positions: polylinePositions,
+ widths,
+ counts: polylineCounts,
+ batchIds: batchIds.polylines,
+ minimumHeight: minHeight,
+ maximumHeight: maxHeight,
+ center,
+ rectangle,
+ boundingVolume: content.tile.boundingVolume.boundingVolume,
+ batchTable,
+ classificationType: tileset.classificationType,
+ keepDecodedPositions: tileset.vectorKeepDecodedPositions
+ });
+ }
+ if (numberOfPoints > 0) {
+ const pointPositions = new Uint16Array(
+ arrayBuffer,
+ byteOffset,
+ numberOfPoints * 3
+ );
+ byteOffset += pointsPositionByteLength;
+ content._points = new Vector3DTilePoints_default({
+ positions: pointPositions,
+ batchIds: batchIds.points,
+ minimumHeight: minHeight,
+ maximumHeight: maxHeight,
+ rectangle,
+ batchTable
+ });
+ }
+ return Promise.resolve(content);
+}
+function createFeatures2(content) {
+ const featuresLength = content.featuresLength;
+ if (!defined_default(content._features) && featuresLength > 0) {
+ const features = new Array(featuresLength);
+ if (defined_default(content._polygons)) {
+ content._polygons.createFeatures(content, features);
+ }
+ if (defined_default(content._polylines)) {
+ content._polylines.createFeatures(content, features);
+ }
+ if (defined_default(content._points)) {
+ content._points.createFeatures(content, features);
+ }
+ content._features = features;
+ }
+}
+Vector3DTileContent.prototype.hasProperty = function(batchId, name) {
+ return this._batchTable.hasProperty(batchId, name);
+};
+Vector3DTileContent.prototype.getFeature = function(batchId) {
+ const featuresLength = this.featuresLength;
+ if (!defined_default(batchId) || batchId < 0 || batchId >= featuresLength) {
+ throw new DeveloperError_default(
+ `batchId is required and between zero and featuresLength - 1 (${featuresLength - 1}).`
+ );
+ }
+ if (!defined_default(this._features)) {
+ createFeatures2(this);
+ }
+ return this._features[batchId];
+};
+Vector3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
+ if (defined_default(this._polygons)) {
+ this._polygons.applyDebugSettings(enabled, color);
+ }
+ if (defined_default(this._polylines)) {
+ this._polylines.applyDebugSettings(enabled, color);
+ }
+ if (defined_default(this._points)) {
+ this._points.applyDebugSettings(enabled, color);
+ }
+};
+Vector3DTileContent.prototype.applyStyle = function(style) {
+ if (!defined_default(this._features)) {
+ createFeatures2(this);
+ }
+ if (defined_default(this._polygons)) {
+ this._polygons.applyStyle(style, this._features);
+ }
+ if (defined_default(this._polylines)) {
+ this._polylines.applyStyle(style, this._features);
+ }
+ if (defined_default(this._points)) {
+ this._points.applyStyle(style, this._features);
+ }
+};
+Vector3DTileContent.prototype.update = function(tileset, frameState) {
+ let ready = true;
+ if (defined_default(this._polygons)) {
+ this._polygons.classificationType = this._tileset.classificationType;
+ this._polygons.debugWireframe = this._tileset.debugWireframe;
+ this._polygons.update(frameState);
+ ready = ready && this._polygons._ready;
+ }
+ if (defined_default(this._polylines)) {
+ this._polylines.update(frameState);
+ ready = ready && this._polylines._ready;
+ }
+ if (defined_default(this._points)) {
+ this._points.update(frameState);
+ ready = ready && this._points._ready;
+ }
+ if (defined_default(this._batchTable) && ready) {
+ if (!defined_default(this._features)) {
+ createFeatures2(this);
+ }
+ this._batchTable.update(tileset, frameState);
+ }
+};
+Vector3DTileContent.prototype.getPolylinePositions = function(batchId) {
+ const polylines = this._polylines;
+ if (!defined_default(polylines)) {
+ return void 0;
+ }
+ return polylines.getPositions(batchId);
+};
+Vector3DTileContent.prototype.isDestroyed = function() {
+ return false;
+};
+Vector3DTileContent.prototype.destroy = function() {
+ this._polygons = this._polygons && this._polygons.destroy();
+ this._polylines = this._polylines && this._polylines.destroy();
+ this._points = this._points && this._points.destroy();
+ this._batchTable = this._batchTable && this._batchTable.destroy();
+ return destroyObject_default(this);
+};
+function examineVectorLines(positions, counts, batchIds, batchTable, url2, callback) {
+ const countsLength = counts.length;
+ let polylineStart = 0;
+ for (let i = 0; i < countsLength; i++) {
+ const count = counts[i] * 3;
+ const linePositions = positions.slice(polylineStart, polylineStart + count);
+ polylineStart += count;
+ callback(linePositions, batchIds[i], url2, batchTable);
+ }
+}
+var Vector3DTileContent_default = Vector3DTileContent;
+
+// Source/Scene/Cesium3DTileContentFactory.js
+var Cesium3DTileContentFactory = {
+ b3dm: function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ return Model3DTileContent_default.fromB3dm(
+ tileset,
+ tile,
+ resource,
+ arrayBuffer,
+ byteOffset
+ );
+ },
+ pnts: function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ return Model3DTileContent_default.fromPnts(
+ tileset,
+ tile,
+ resource,
+ arrayBuffer,
+ byteOffset
+ );
+ },
+ i3dm: function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ return Model3DTileContent_default.fromI3dm(
+ tileset,
+ tile,
+ resource,
+ arrayBuffer,
+ byteOffset
+ );
+ },
+ cmpt: function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ return new Composite3DTileContent_default(
+ tileset,
+ tile,
+ resource,
+ arrayBuffer,
+ byteOffset,
+ Cesium3DTileContentFactory
+ );
+ },
+ externalTileset: function(tileset, tile, resource, json) {
+ return new Tileset3DTileContent_default(tileset, tile, resource, json);
+ },
+ geom: function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ return new Geometry3DTileContent_default(
+ tileset,
+ tile,
+ resource,
+ arrayBuffer,
+ byteOffset
+ );
+ },
+ vctr: function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ return new Vector3DTileContent_default(
+ tileset,
+ tile,
+ resource,
+ arrayBuffer,
+ byteOffset
+ );
+ },
+ subt: function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ return new Implicit3DTileContent_default(
+ tileset,
+ tile,
+ resource,
+ void 0,
+ arrayBuffer,
+ byteOffset
+ );
+ },
+ subtreeJson: function(tileset, tile, resource, json) {
+ return new Implicit3DTileContent_default(tileset, tile, resource, json);
+ },
+ glb: function(tileset, tile, resource, arrayBuffer, byteOffset) {
+ const arrayBufferByteLength = arrayBuffer.byteLength;
+ if (arrayBufferByteLength < 12) {
+ throw new RuntimeError_default("Invalid glb content");
+ }
+ const dataView = new DataView(arrayBuffer, byteOffset);
+ const byteLength = dataView.getUint32(8, true);
+ const glb = new Uint8Array(arrayBuffer, byteOffset, byteLength);
+ return Model3DTileContent_default.fromGltf(tileset, tile, resource, glb);
+ },
+ gltf: function(tileset, tile, resource, json) {
+ return Model3DTileContent_default.fromGltf(tileset, tile, resource, json);
+ },
+ geoJson: function(tileset, tile, resource, json) {
+ return Model3DTileContent_default.fromGeoJson(tileset, tile, resource, json);
+ }
+};
+var Cesium3DTileContentFactory_default = Cesium3DTileContentFactory;
+
+// Source/Scene/Cesium3DTileContentState.js
+var Cesium3DTileContentState = {
+ UNLOADED: 0,
+ LOADING: 1,
+ PROCESSING: 2,
+ READY: 3,
+ EXPIRED: 4,
+ FAILED: 5
+};
+var Cesium3DTileContentState_default = Object.freeze(Cesium3DTileContentState);
+
+// Source/Scene/Cesium3DTileContentType.js
+var Cesium3DTileContentType = {
+ BATCHED_3D_MODEL: "b3dm",
+ INSTANCED_3D_MODEL: "i3dm",
+ COMPOSITE: "cmpt",
+ POINT_CLOUD: "pnts",
+ VECTOR: "vctr",
+ GEOMETRY: "geom",
+ GLTF: "gltf",
+ GLTF_BINARY: "glb",
+ IMPLICIT_SUBTREE: "subt",
+ IMPLICIT_SUBTREE_JSON: "subtreeJson",
+ EXTERNAL_TILESET: "externalTileset",
+ MULTIPLE_CONTENT: "multipleContent",
+ GEOJSON: "geoJson"
+};
+Cesium3DTileContentType.isBinaryFormat = function(contentType) {
+ switch (contentType) {
+ case Cesium3DTileContentType.BATCHED_3D_MODEL:
+ case Cesium3DTileContentType.INSTANCED_3D_MODEL:
+ case Cesium3DTileContentType.COMPOSITE:
+ case Cesium3DTileContentType.POINT_CLOUD:
+ case Cesium3DTileContentType.VECTOR:
+ case Cesium3DTileContentType.GEOMETRY:
+ case Cesium3DTileContentType.IMPLICIT_SUBTREE:
+ case Cesium3DTileContentType.GLTF_BINARY:
+ return true;
+ default:
+ return false;
+ }
+};
+var Cesium3DTileContentType_default = Object.freeze(Cesium3DTileContentType);
+
+// Source/Scene/Cesium3DTileOptimizationHint.js
+var Cesium3DTileOptimizationHint = {
+ NOT_COMPUTED: -1,
+ USE_OPTIMIZATION: 1,
+ SKIP_OPTIMIZATION: 0
+};
+var Cesium3DTileOptimizationHint_default = Object.freeze(Cesium3DTileOptimizationHint);
+
+// Source/Scene/Cesium3DTilesetMostDetailedTraversal.js
+function Cesium3DTilesetMostDetailedTraversal() {
+}
+var traversal = {
+ stack: new ManagedArray_default(),
+ stackMaximumLength: 0
+};
+Cesium3DTilesetMostDetailedTraversal.selectTiles = function(tileset, frameState) {
+ tileset._selectedTiles.length = 0;
+ tileset._requestedTiles.length = 0;
+ tileset._hasMixedContent = false;
+ let ready = true;
+ const root = tileset.root;
+ root.updateVisibility(frameState);
+ if (!isVisible(root)) {
+ return ready;
+ }
+ const stack = traversal.stack;
+ stack.push(tileset.root);
+ while (stack.length > 0) {
+ traversal.stackMaximumLength = Math.max(
+ traversal.stackMaximumLength,
+ stack.length
+ );
+ const tile = stack.pop();
+ const add2 = tile.refine === Cesium3DTileRefine_default.ADD;
+ const replace = tile.refine === Cesium3DTileRefine_default.REPLACE;
+ const traverse = canTraverse(tileset, tile);
+ if (traverse) {
+ updateAndPushChildren(tileset, tile, stack, frameState);
+ }
+ if (add2 || replace && !traverse) {
+ loadTile(tileset, tile);
+ touchTile(tileset, tile, frameState);
+ selectDesiredTile(tileset, tile, frameState);
+ if (!hasEmptyContent(tile) && !tile.contentAvailable) {
+ ready = false;
+ }
+ }
+ visitTile(tileset);
+ }
+ traversal.stack.trim(traversal.stackMaximumLength);
+ return ready;
+};
+function isVisible(tile) {
+ return tile._visible && tile._inRequestVolume;
+}
+function hasEmptyContent(tile) {
+ return tile.hasEmptyContent || tile.hasTilesetContent || tile.hasImplicitContent;
+}
+function hasUnloadedContent(tile) {
+ return !hasEmptyContent(tile) && tile.contentUnloaded;
+}
+function canTraverse(tileset, tile) {
+ if (tile.children.length === 0) {
+ return false;
+ }
+ if (tile.hasTilesetContent || tile.hasImplicitContent) {
+ return !tile.contentExpired;
+ }
+ if (tile.hasEmptyContent) {
+ return true;
+ }
+ return true;
+}
+function updateAndPushChildren(tileset, tile, stack, frameState) {
+ const children = tile.children;
+ const length3 = children.length;
+ for (let i = 0; i < length3; ++i) {
+ const child = children[i];
+ child.updateVisibility(frameState);
+ if (isVisible(child)) {
+ stack.push(child);
+ }
+ }
+}
+function loadTile(tileset, tile) {
+ if (hasUnloadedContent(tile) || tile.contentExpired) {
+ tile._priority = 0;
+ tileset._requestedTiles.push(tile);
+ }
+}
+function touchTile(tileset, tile, frameState) {
+ if (tile._touchedFrame === frameState.frameNumber) {
+ return;
+ }
+ tileset._cache.touch(tile);
+ tile._touchedFrame = frameState.frameNumber;
+}
+function visitTile(tileset) {
+ ++tileset.statistics.visited;
+}
+function selectDesiredTile(tileset, tile, frameState) {
+ if (tile.contentAvailable && tile.contentVisibility(frameState) !== Intersect_default.OUTSIDE) {
+ tileset._selectedTiles.push(tile);
+ }
+}
+var Cesium3DTilesetMostDetailedTraversal_default = Cesium3DTilesetMostDetailedTraversal;
+
+// Source/Scene/Cesium3DTilesetTraversal.js
+function Cesium3DTilesetTraversal() {
+}
+function isVisible2(tile) {
+ return tile._visible && tile._inRequestVolume;
+}
+var traversal2 = {
+ stack: new ManagedArray_default(),
+ stackMaximumLength: 0
+};
+var emptyTraversal = {
+ stack: new ManagedArray_default(),
+ stackMaximumLength: 0
+};
+var descendantTraversal = {
+ stack: new ManagedArray_default(),
+ stackMaximumLength: 0
+};
+var selectionTraversal = {
+ stack: new ManagedArray_default(),
+ stackMaximumLength: 0,
+ ancestorStack: new ManagedArray_default(),
+ ancestorStackMaximumLength: 0
+};
+var descendantSelectionDepth = 2;
+Cesium3DTilesetTraversal.selectTiles = function(tileset, frameState) {
+ tileset._requestedTiles.length = 0;
+ if (tileset.debugFreezeFrame) {
+ return;
+ }
+ tileset._selectedTiles.length = 0;
+ tileset._selectedTilesToStyle.length = 0;
+ tileset._emptyTiles.length = 0;
+ tileset._hasMixedContent = false;
+ const root = tileset.root;
+ updateTile(tileset, root, frameState);
+ if (!isVisible2(root)) {
+ return;
+ }
+ if (root.getScreenSpaceError(frameState, true) <= tileset._maximumScreenSpaceError) {
+ return;
+ }
+ if (!skipLevelOfDetail(tileset)) {
+ executeBaseTraversal(tileset, root, frameState);
+ } else if (tileset.immediatelyLoadDesiredLevelOfDetail) {
+ executeSkipTraversal(tileset, root, frameState);
+ } else {
+ executeBaseAndSkipTraversal(tileset, root, frameState);
+ }
+ traversal2.stack.trim(traversal2.stackMaximumLength);
+ emptyTraversal.stack.trim(emptyTraversal.stackMaximumLength);
+ descendantTraversal.stack.trim(descendantTraversal.stackMaximumLength);
+ selectionTraversal.stack.trim(selectionTraversal.stackMaximumLength);
+ selectionTraversal.ancestorStack.trim(
+ selectionTraversal.ancestorStackMaximumLength
+ );
+ const requestedTiles = tileset._requestedTiles;
+ const length3 = requestedTiles.length;
+ for (let i = 0; i < length3; ++i) {
+ requestedTiles[i].updatePriority();
+ }
+};
+function executeBaseTraversal(tileset, root, frameState) {
+ const baseScreenSpaceError = tileset._maximumScreenSpaceError;
+ const maximumScreenSpaceError = tileset._maximumScreenSpaceError;
+ executeTraversal(
+ tileset,
+ root,
+ baseScreenSpaceError,
+ maximumScreenSpaceError,
+ frameState
+ );
+}
+function executeSkipTraversal(tileset, root, frameState) {
+ const baseScreenSpaceError = Number.MAX_VALUE;
+ const maximumScreenSpaceError = tileset._maximumScreenSpaceError;
+ executeTraversal(
+ tileset,
+ root,
+ baseScreenSpaceError,
+ maximumScreenSpaceError,
+ frameState
+ );
+ traverseAndSelect(tileset, root, frameState);
+}
+function executeBaseAndSkipTraversal(tileset, root, frameState) {
+ const baseScreenSpaceError = Math.max(
+ tileset.baseScreenSpaceError,
+ tileset.maximumScreenSpaceError
+ );
+ const maximumScreenSpaceError = tileset.maximumScreenSpaceError;
+ executeTraversal(
+ tileset,
+ root,
+ baseScreenSpaceError,
+ maximumScreenSpaceError,
+ frameState
+ );
+ traverseAndSelect(tileset, root, frameState);
+}
+function skipLevelOfDetail(tileset) {
+ return tileset._skipLevelOfDetail;
+}
+function addEmptyTile(tileset, tile) {
+ tileset._emptyTiles.push(tile);
+}
+function selectTile(tileset, tile, frameState) {
+ if (tile.contentVisibility(frameState) !== Intersect_default.OUTSIDE) {
+ const tileContent = tile.content;
+ if (tileContent.featurePropertiesDirty) {
+ tileContent.featurePropertiesDirty = false;
+ tile.lastStyleTime = 0;
+ tileset._selectedTilesToStyle.push(tile);
+ } else if (tile._selectedFrame < frameState.frameNumber - 1) {
+ tileset._selectedTilesToStyle.push(tile);
+ }
+ tile._selectedFrame = frameState.frameNumber;
+ tileset._selectedTiles.push(tile);
+ }
+}
+function selectDescendants(tileset, root, frameState) {
+ const stack = descendantTraversal.stack;
+ stack.push(root);
+ while (stack.length > 0) {
+ descendantTraversal.stackMaximumLength = Math.max(
+ descendantTraversal.stackMaximumLength,
+ stack.length
+ );
+ const tile = stack.pop();
+ const children = tile.children;
+ const childrenLength = children.length;
+ for (let i = 0; i < childrenLength; ++i) {
+ const child = children[i];
+ if (isVisible2(child)) {
+ if (child.contentAvailable) {
+ updateTile(tileset, child, frameState);
+ touchTile2(tileset, child, frameState);
+ selectTile(tileset, child, frameState);
+ } else if (child._depth - root._depth < descendantSelectionDepth) {
+ stack.push(child);
+ }
+ }
+ }
+ }
+}
+function selectDesiredTile2(tileset, tile, frameState) {
+ if (!skipLevelOfDetail(tileset)) {
+ if (tile.contentAvailable) {
+ selectTile(tileset, tile, frameState);
+ }
+ return;
+ }
+ const loadedTile = tile.contentAvailable ? tile : tile._ancestorWithContentAvailable;
+ if (defined_default(loadedTile)) {
+ loadedTile._shouldSelect = true;
+ } else {
+ selectDescendants(tileset, tile, frameState);
+ }
+}
+function visitTile2(tileset, tile, frameState) {
+ ++tileset._statistics.visited;
+ tile._visitedFrame = frameState.frameNumber;
+}
+function touchTile2(tileset, tile, frameState) {
+ if (tile._touchedFrame === frameState.frameNumber) {
+ return;
+ }
+ tileset._cache.touch(tile);
+ tile._touchedFrame = frameState.frameNumber;
+}
+function updateMinimumMaximumPriority(tileset, tile) {
+ tileset._maximumPriority.distance = Math.max(
+ tile._priorityHolder._distanceToCamera,
+ tileset._maximumPriority.distance
+ );
+ tileset._minimumPriority.distance = Math.min(
+ tile._priorityHolder._distanceToCamera,
+ tileset._minimumPriority.distance
+ );
+ tileset._maximumPriority.depth = Math.max(
+ tile._depth,
+ tileset._maximumPriority.depth
+ );
+ tileset._minimumPriority.depth = Math.min(
+ tile._depth,
+ tileset._minimumPriority.depth
+ );
+ tileset._maximumPriority.foveatedFactor = Math.max(
+ tile._priorityHolder._foveatedFactor,
+ tileset._maximumPriority.foveatedFactor
+ );
+ tileset._minimumPriority.foveatedFactor = Math.min(
+ tile._priorityHolder._foveatedFactor,
+ tileset._minimumPriority.foveatedFactor
+ );
+ tileset._maximumPriority.reverseScreenSpaceError = Math.max(
+ tile._priorityReverseScreenSpaceError,
+ tileset._maximumPriority.reverseScreenSpaceError
+ );
+ tileset._minimumPriority.reverseScreenSpaceError = Math.min(
+ tile._priorityReverseScreenSpaceError,
+ tileset._minimumPriority.reverseScreenSpaceError
+ );
+}
+function isOnScreenLongEnough(tileset, tile, frameState) {
+ if (!tileset._cullRequestsWhileMoving) {
+ return true;
+ }
+ const sphere = tile.boundingSphere;
+ const diameter = Math.max(sphere.radius * 2, 1);
+ const camera = frameState.camera;
+ const deltaMagnitude = camera.positionWCDeltaMagnitude !== 0 ? camera.positionWCDeltaMagnitude : camera.positionWCDeltaMagnitudeLastFrame;
+ const movementRatio = tileset.cullRequestsWhileMovingMultiplier * deltaMagnitude / diameter;
+ return movementRatio < 1;
+}
+function loadTile2(tileset, tile, frameState) {
+ if (tile._requestedFrame === frameState.frameNumber || !hasUnloadedContent2(tile) && !tile.contentExpired) {
+ return;
+ }
+ if (!isOnScreenLongEnough(tileset, tile, frameState)) {
+ return;
+ }
+ const cameraHasNotStoppedMovingLongEnough = frameState.camera.timeSinceMoved < tileset.foveatedTimeDelay;
+ if (tile.priorityDeferred && cameraHasNotStoppedMovingLongEnough) {
+ return;
+ }
+ tile._requestedFrame = frameState.frameNumber;
+ tileset._requestedTiles.push(tile);
+}
+function updateVisibility(tileset, tile, frameState) {
+ if (tile._updatedVisibilityFrame === tileset._updatedVisibilityFrame) {
+ return;
+ }
+ tile.updateVisibility(frameState);
+ tile._updatedVisibilityFrame = tileset._updatedVisibilityFrame;
+}
+function anyChildrenVisible(tileset, tile, frameState) {
+ let anyVisible = false;
+ const children = tile.children;
+ const length3 = children.length;
+ for (let i = 0; i < length3; ++i) {
+ const child = children[i];
+ updateVisibility(tileset, child, frameState);
+ anyVisible = anyVisible || isVisible2(child);
+ }
+ return anyVisible;
+}
+function meetsScreenSpaceErrorEarly(tileset, tile, frameState) {
+ const parent = tile.parent;
+ if (!defined_default(parent) || parent.hasTilesetContent || parent.hasImplicitContent || parent.refine !== Cesium3DTileRefine_default.ADD) {
+ return false;
+ }
+ return tile.getScreenSpaceError(frameState, true) <= tileset._maximumScreenSpaceError;
+}
+function updateTileVisibility(tileset, tile, frameState) {
+ updateVisibility(tileset, tile, frameState);
+ if (!isVisible2(tile)) {
+ return;
+ }
+ const hasChildren = tile.children.length > 0;
+ if ((tile.hasTilesetContent || tile.hasImplicitContent) && hasChildren) {
+ const child = tile.children[0];
+ updateTileVisibility(tileset, child, frameState);
+ tile._visible = child._visible;
+ return;
+ }
+ if (meetsScreenSpaceErrorEarly(tileset, tile, frameState)) {
+ tile._visible = false;
+ return;
+ }
+ const replace = tile.refine === Cesium3DTileRefine_default.REPLACE;
+ const useOptimization = tile._optimChildrenWithinParent === Cesium3DTileOptimizationHint_default.USE_OPTIMIZATION;
+ if (replace && useOptimization && hasChildren) {
+ if (!anyChildrenVisible(tileset, tile, frameState)) {
+ ++tileset._statistics.numberOfTilesCulledWithChildrenUnion;
+ tile._visible = false;
+ return;
+ }
+ }
+}
+function updateTile(tileset, tile, frameState) {
+ updateTileVisibility(tileset, tile, frameState);
+ tile.updateExpiration();
+ tile._wasMinPriorityChild = false;
+ tile._priorityHolder = tile;
+ updateMinimumMaximumPriority(tileset, tile);
+ tile._shouldSelect = false;
+ tile._finalResolution = true;
+}
+function updateTileAncestorContentLinks(tile, frameState) {
+ tile._ancestorWithContent = void 0;
+ tile._ancestorWithContentAvailable = void 0;
+ const parent = tile.parent;
+ if (defined_default(parent)) {
+ const hasContent = !hasUnloadedContent2(parent) || parent._requestedFrame === frameState.frameNumber;
+ tile._ancestorWithContent = hasContent ? parent : parent._ancestorWithContent;
+ tile._ancestorWithContentAvailable = parent.contentAvailable ? parent : parent._ancestorWithContentAvailable;
+ }
+}
+function hasEmptyContent2(tile) {
+ return tile.hasEmptyContent || tile.hasTilesetContent || tile.hasImplicitContent;
+}
+function hasUnloadedContent2(tile) {
+ return !hasEmptyContent2(tile) && tile.contentUnloaded;
+}
+function reachedSkippingThreshold(tileset, tile) {
+ const ancestor = tile._ancestorWithContent;
+ return !tileset.immediatelyLoadDesiredLevelOfDetail && (tile._priorityProgressiveResolutionScreenSpaceErrorLeaf || defined_default(ancestor) && tile._screenSpaceError < ancestor._screenSpaceError / tileset.skipScreenSpaceErrorFactor && tile._depth > ancestor._depth + tileset.skipLevels);
+}
+function sortChildrenByDistanceToCamera(a3, b) {
+ if (b._distanceToCamera === 0 && a3._distanceToCamera === 0) {
+ return b._centerZDepth - a3._centerZDepth;
+ }
+ return b._distanceToCamera - a3._distanceToCamera;
+}
+function updateAndPushChildren2(tileset, tile, stack, frameState) {
+ let i;
+ const replace = tile.refine === Cesium3DTileRefine_default.REPLACE;
+ const children = tile.children;
+ const length3 = children.length;
+ for (i = 0; i < length3; ++i) {
+ updateTile(tileset, children[i], frameState);
+ }
+ children.sort(sortChildrenByDistanceToCamera);
+ const checkRefines = !skipLevelOfDetail(tileset) && replace && !hasEmptyContent2(tile);
+ let refines = true;
+ let anyChildrenVisible2 = false;
+ let minIndex = -1;
+ let minimumPriority = Number.MAX_VALUE;
+ let child;
+ for (i = 0; i < length3; ++i) {
+ child = children[i];
+ if (isVisible2(child)) {
+ stack.push(child);
+ if (child._foveatedFactor < minimumPriority) {
+ minIndex = i;
+ minimumPriority = child._foveatedFactor;
+ }
+ anyChildrenVisible2 = true;
+ } else if (checkRefines || tileset.loadSiblings) {
+ if (child._foveatedFactor < minimumPriority) {
+ minIndex = i;
+ minimumPriority = child._foveatedFactor;
+ }
+ loadTile2(tileset, child, frameState);
+ touchTile2(tileset, child, frameState);
+ }
+ if (checkRefines) {
+ let childRefines;
+ if (!child._inRequestVolume) {
+ childRefines = false;
+ } else if (hasEmptyContent2(child)) {
+ childRefines = executeEmptyTraversal(tileset, child, frameState);
+ } else {
+ childRefines = child.contentAvailable;
+ }
+ refines = refines && childRefines;
+ }
+ }
+ if (!anyChildrenVisible2) {
+ refines = false;
+ }
+ if (minIndex !== -1 && !skipLevelOfDetail(tileset) && replace) {
+ const minPriorityChild = children[minIndex];
+ minPriorityChild._wasMinPriorityChild = true;
+ const priorityHolder = (tile._wasMinPriorityChild || tile === tileset.root) && minimumPriority <= tile._priorityHolder._foveatedFactor ? tile._priorityHolder : tile;
+ priorityHolder._foveatedFactor = Math.min(
+ minPriorityChild._foveatedFactor,
+ priorityHolder._foveatedFactor
+ );
+ priorityHolder._distanceToCamera = Math.min(
+ minPriorityChild._distanceToCamera,
+ priorityHolder._distanceToCamera
+ );
+ for (i = 0; i < length3; ++i) {
+ child = children[i];
+ child._priorityHolder = priorityHolder;
+ }
+ }
+ return refines;
+}
+function inBaseTraversal(tileset, tile, baseScreenSpaceError) {
+ if (!skipLevelOfDetail(tileset)) {
+ return true;
+ }
+ if (tileset.immediatelyLoadDesiredLevelOfDetail) {
+ return false;
+ }
+ if (!defined_default(tile._ancestorWithContent)) {
+ return true;
+ }
+ if (tile._screenSpaceError === 0) {
+ return tile.parent._screenSpaceError > baseScreenSpaceError;
+ }
+ return tile._screenSpaceError > baseScreenSpaceError;
+}
+function canTraverse2(tileset, tile) {
+ if (tile.children.length === 0) {
+ return false;
+ }
+ if (tile.hasTilesetContent || tile.hasImplicitContent) {
+ return !tile.contentExpired;
+ }
+ return tile._screenSpaceError > tileset._maximumScreenSpaceError;
+}
+function executeTraversal(tileset, root, baseScreenSpaceError, maximumScreenSpaceError, frameState) {
+ const stack = traversal2.stack;
+ stack.push(root);
+ while (stack.length > 0) {
+ traversal2.stackMaximumLength = Math.max(
+ traversal2.stackMaximumLength,
+ stack.length
+ );
+ const tile = stack.pop();
+ updateTileAncestorContentLinks(tile, frameState);
+ const baseTraversal = inBaseTraversal(tileset, tile, baseScreenSpaceError);
+ const add2 = tile.refine === Cesium3DTileRefine_default.ADD;
+ const replace = tile.refine === Cesium3DTileRefine_default.REPLACE;
+ const parent = tile.parent;
+ const parentRefines = !defined_default(parent) || parent._refines;
+ let refines = false;
+ if (canTraverse2(tileset, tile)) {
+ refines = updateAndPushChildren2(tileset, tile, stack, frameState) && parentRefines;
+ }
+ const stoppedRefining = !refines && parentRefines;
+ if (hasEmptyContent2(tile)) {
+ addEmptyTile(tileset, tile, frameState);
+ loadTile2(tileset, tile, frameState);
+ if (stoppedRefining) {
+ selectDesiredTile2(tileset, tile, frameState);
+ }
+ } else if (add2) {
+ selectDesiredTile2(tileset, tile, frameState);
+ loadTile2(tileset, tile, frameState);
+ } else if (replace) {
+ if (baseTraversal) {
+ loadTile2(tileset, tile, frameState);
+ if (stoppedRefining) {
+ selectDesiredTile2(tileset, tile, frameState);
+ }
+ } else if (stoppedRefining) {
+ selectDesiredTile2(tileset, tile, frameState);
+ loadTile2(tileset, tile, frameState);
+ } else if (reachedSkippingThreshold(tileset, tile)) {
+ loadTile2(tileset, tile, frameState);
+ }
+ }
+ visitTile2(tileset, tile, frameState);
+ touchTile2(tileset, tile, frameState);
+ tile._refines = refines;
+ }
+}
+function executeEmptyTraversal(tileset, root, frameState) {
+ let allDescendantsLoaded = true;
+ const stack = emptyTraversal.stack;
+ stack.push(root);
+ while (stack.length > 0) {
+ emptyTraversal.stackMaximumLength = Math.max(
+ emptyTraversal.stackMaximumLength,
+ stack.length
+ );
+ const tile = stack.pop();
+ const children = tile.children;
+ const childrenLength = children.length;
+ const emptyContent = hasEmptyContent2(tile);
+ const traverse = emptyContent && canTraverse2(tileset, tile);
+ const emptyLeaf = emptyContent && tile.children.length === 0;
+ if (!traverse && !tile.contentAvailable && !emptyLeaf) {
+ allDescendantsLoaded = false;
+ }
+ updateTile(tileset, tile, frameState);
+ if (!isVisible2(tile)) {
+ loadTile2(tileset, tile, frameState);
+ touchTile2(tileset, tile, frameState);
+ }
+ if (traverse) {
+ for (let i = 0; i < childrenLength; ++i) {
+ const child = children[i];
+ stack.push(child);
+ }
+ }
+ }
+ return allDescendantsLoaded;
+}
+function traverseAndSelect(tileset, root, frameState) {
+ const stack = selectionTraversal.stack;
+ const ancestorStack = selectionTraversal.ancestorStack;
+ let lastAncestor;
+ stack.push(root);
+ while (stack.length > 0 || ancestorStack.length > 0) {
+ selectionTraversal.stackMaximumLength = Math.max(
+ selectionTraversal.stackMaximumLength,
+ stack.length
+ );
+ selectionTraversal.ancestorStackMaximumLength = Math.max(
+ selectionTraversal.ancestorStackMaximumLength,
+ ancestorStack.length
+ );
+ if (ancestorStack.length > 0) {
+ const waitingTile = ancestorStack.peek();
+ if (waitingTile._stackLength === stack.length) {
+ ancestorStack.pop();
+ if (waitingTile !== lastAncestor) {
+ waitingTile._finalResolution = false;
+ }
+ selectTile(tileset, waitingTile, frameState);
+ continue;
+ }
+ }
+ const tile = stack.pop();
+ if (!defined_default(tile)) {
+ continue;
+ }
+ const add2 = tile.refine === Cesium3DTileRefine_default.ADD;
+ const shouldSelect = tile._shouldSelect;
+ const children = tile.children;
+ const childrenLength = children.length;
+ const traverse = canTraverse2(tileset, tile);
+ if (shouldSelect) {
+ if (add2) {
+ selectTile(tileset, tile, frameState);
+ } else {
+ tile._selectionDepth = ancestorStack.length;
+ if (tile._selectionDepth > 0) {
+ tileset._hasMixedContent = true;
+ }
+ lastAncestor = tile;
+ if (!traverse) {
+ selectTile(tileset, tile, frameState);
+ continue;
+ }
+ ancestorStack.push(tile);
+ tile._stackLength = stack.length;
+ }
+ }
+ if (traverse) {
+ for (let i = 0; i < childrenLength; ++i) {
+ const child = children[i];
+ if (isVisible2(child)) {
+ stack.push(child);
+ }
+ }
+ }
+ }
+}
+var Cesium3DTilesetTraversal_default = Cesium3DTilesetTraversal;
+
+// Source/Scene/Cesium3DTilePass.js
+var Cesium3DTilePass = {
+ RENDER: 0,
+ PICK: 1,
+ SHADOW: 2,
+ PRELOAD: 3,
+ PRELOAD_FLIGHT: 4,
+ REQUEST_RENDER_MODE_DEFER_CHECK: 5,
+ MOST_DETAILED_PRELOAD: 6,
+ MOST_DETAILED_PICK: 7,
+ NUMBER_OF_PASSES: 8
+};
+var passOptions = new Array(Cesium3DTilePass.NUMBER_OF_PASSES);
+passOptions[Cesium3DTilePass.RENDER] = Object.freeze({
+ traversal: Cesium3DTilesetTraversal_default,
+ isRender: true,
+ requestTiles: true,
+ ignoreCommands: false
+});
+passOptions[Cesium3DTilePass.PICK] = Object.freeze({
+ traversal: Cesium3DTilesetTraversal_default,
+ isRender: false,
+ requestTiles: false,
+ ignoreCommands: false
+});
+passOptions[Cesium3DTilePass.SHADOW] = Object.freeze({
+ traversal: Cesium3DTilesetTraversal_default,
+ isRender: false,
+ requestTiles: true,
+ ignoreCommands: false
+});
+passOptions[Cesium3DTilePass.PRELOAD] = Object.freeze({
+ traversal: Cesium3DTilesetTraversal_default,
+ isRender: false,
+ requestTiles: true,
+ ignoreCommands: true
+});
+passOptions[Cesium3DTilePass.PRELOAD_FLIGHT] = Object.freeze({
+ traversal: Cesium3DTilesetTraversal_default,
+ isRender: false,
+ requestTiles: true,
+ ignoreCommands: true
+});
+passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK] = Object.freeze({
+ traversal: Cesium3DTilesetTraversal_default,
+ isRender: false,
+ requestTiles: true,
+ ignoreCommands: true
+});
+passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD] = Object.freeze({
+ traversal: Cesium3DTilesetMostDetailedTraversal_default,
+ isRender: false,
+ requestTiles: true,
+ ignoreCommands: true
+});
+passOptions[Cesium3DTilePass.MOST_DETAILED_PICK] = Object.freeze({
+ traversal: Cesium3DTilesetMostDetailedTraversal_default,
+ isRender: false,
+ requestTiles: false,
+ ignoreCommands: false
+});
+Cesium3DTilePass.getPassOptions = function(pass) {
+ return passOptions[pass];
+};
+var Cesium3DTilePass_default = Object.freeze(Cesium3DTilePass);
+
+// Source/Scene/Empty3DTileContent.js
+function Empty3DTileContent(tileset, tile) {
+ this._tileset = tileset;
+ this._tile = tile;
+ this.featurePropertiesDirty = false;
+}
+Object.defineProperties(Empty3DTileContent.prototype, {
+ featuresLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ pointsLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ trianglesLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ texturesByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ batchTableByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ innerContents: {
+ get: function() {
+ return void 0;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return void 0;
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._tileset;
+ }
+ },
+ tile: {
+ get: function() {
+ return this._tile;
+ }
+ },
+ url: {
+ get: function() {
+ return void 0;
+ }
+ },
+ metadata: {
+ get: function() {
+ return void 0;
+ },
+ set: function(value) {
+ throw new DeveloperError_default(
+ "Empty3DTileContent cannot have content metadata"
+ );
+ }
+ },
+ batchTable: {
+ get: function() {
+ return void 0;
+ }
+ },
+ group: {
+ get: function() {
+ return void 0;
+ },
+ set: function(value) {
+ throw new DeveloperError_default("Empty3DTileContent cannot have group metadata");
+ }
+ }
+});
+Empty3DTileContent.prototype.hasProperty = function(batchId, name) {
+ return false;
+};
+Empty3DTileContent.prototype.getFeature = function(batchId) {
+ return void 0;
+};
+Empty3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
+};
+Empty3DTileContent.prototype.applyStyle = function(style) {
+};
+Empty3DTileContent.prototype.update = function(tileset, frameState) {
+};
+Empty3DTileContent.prototype.isDestroyed = function() {
+ return false;
+};
+Empty3DTileContent.prototype.destroy = function() {
+ return destroyObject_default(this);
+};
+var Empty3DTileContent_default = Empty3DTileContent;
+
+// Source/Scene/ContentMetadata.js
+function ContentMetadata(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const content = options.content;
+ const metadataClass = options.class;
+ Check_default.typeOf.object("options.content", content);
+ Check_default.typeOf.object("options.class", metadataClass);
+ this._class = metadataClass;
+ this._properties = content.properties;
+ this._extensions = content.extensions;
+ this._extras = content.extras;
+}
+Object.defineProperties(ContentMetadata.prototype, {
+ class: {
+ get: function() {
+ return this._class;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+ContentMetadata.prototype.hasProperty = function(propertyId) {
+ return MetadataEntity_default.hasProperty(propertyId, this._properties, this._class);
+};
+ContentMetadata.prototype.hasPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.hasPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+ContentMetadata.prototype.getPropertyIds = function(results) {
+ return MetadataEntity_default.getPropertyIds(this._properties, this._class, results);
+};
+ContentMetadata.prototype.getProperty = function(propertyId) {
+ return MetadataEntity_default.getProperty(propertyId, this._properties, this._class);
+};
+ContentMetadata.prototype.setProperty = function(propertyId, value) {
+ return MetadataEntity_default.setProperty(
+ propertyId,
+ value,
+ this._properties,
+ this._class
+ );
+};
+ContentMetadata.prototype.getPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.getPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+ContentMetadata.prototype.setPropertyBySemantic = function(semantic, value) {
+ return MetadataEntity_default.setPropertyBySemantic(
+ semantic,
+ value,
+ this._properties,
+ this._class
+ );
+};
+var ContentMetadata_default = ContentMetadata;
+
+// Source/Scene/findContentMetadata.js
+function findContentMetadata(tileset, contentHeader) {
+ const metadataJson = hasExtension_default(contentHeader, "3DTILES_metadata") ? contentHeader.extensions["3DTILES_metadata"] : contentHeader.metadata;
+ if (!defined_default(metadataJson)) {
+ return void 0;
+ }
+ if (!defined_default(tileset.schema)) {
+ findContentMetadata._oneTimeWarning(
+ "findContentMetadata-missing-root-schema",
+ "Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json."
+ );
+ return void 0;
+ }
+ const classes = defaultValue_default(
+ tileset.schema.classes,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ if (defined_default(metadataJson.class)) {
+ const contentClass = classes[metadataJson.class];
+ return new ContentMetadata_default({
+ content: metadataJson,
+ class: contentClass
+ });
+ }
+ return void 0;
+}
+findContentMetadata._oneTimeWarning = oneTimeWarning_default;
+var findContentMetadata_default = findContentMetadata;
+
+// Source/Scene/findGroupMetadata.js
+function findGroupMetadata(tileset, contentHeader) {
+ const metadataExtension = tileset.metadataExtension;
+ if (!defined_default(metadataExtension)) {
+ return void 0;
+ }
+ const groups = metadataExtension.groups;
+ const group = hasExtension_default(contentHeader, "3DTILES_metadata") ? contentHeader.extensions["3DTILES_metadata"].group : contentHeader.group;
+ if (typeof group === "number") {
+ return groups[group];
+ }
+ const index = metadataExtension.groupIds.findIndex(function(id) {
+ return id === group;
+ });
+ return index >= 0 ? groups[index] : void 0;
+}
+var findGroupMetadata_default = findGroupMetadata;
+
+// Source/Scene/TileMetadata.js
+function TileMetadata(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const tile = options.tile;
+ const metadataClass = options.class;
+ Check_default.typeOf.object("options.tile", tile);
+ Check_default.typeOf.object("options.class", metadataClass);
+ this._class = metadataClass;
+ this._properties = tile.properties;
+ this._extensions = tile.extensions;
+ this._extras = tile.extras;
+}
+Object.defineProperties(TileMetadata.prototype, {
+ class: {
+ get: function() {
+ return this._class;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+TileMetadata.prototype.hasProperty = function(propertyId) {
+ return MetadataEntity_default.hasProperty(propertyId, this._properties, this._class);
+};
+TileMetadata.prototype.hasPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.hasPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+TileMetadata.prototype.getPropertyIds = function(results) {
+ return MetadataEntity_default.getPropertyIds(this._properties, this._class, results);
+};
+TileMetadata.prototype.getProperty = function(propertyId) {
+ return MetadataEntity_default.getProperty(propertyId, this._properties, this._class);
+};
+TileMetadata.prototype.setProperty = function(propertyId, value) {
+ return MetadataEntity_default.setProperty(
+ propertyId,
+ value,
+ this._properties,
+ this._class
+ );
+};
+TileMetadata.prototype.getPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.getPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+TileMetadata.prototype.setPropertyBySemantic = function(semantic, value) {
+ return MetadataEntity_default.setPropertyBySemantic(
+ semantic,
+ value,
+ this._properties,
+ this._class
+ );
+};
+var TileMetadata_default = TileMetadata;
+
+// Source/Scene/findTileMetadata.js
+function findTileMetadata(tileset, tileHeader) {
+ const metadataJson = hasExtension_default(tileHeader, "3DTILES_metadata") ? tileHeader.extensions["3DTILES_metadata"] : tileHeader.metadata;
+ if (!defined_default(metadataJson)) {
+ return void 0;
+ }
+ if (!defined_default(tileset.schema)) {
+ findTileMetadata._oneTimeWarning(
+ "findTileMetadata-missing-root-schema",
+ "Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json."
+ );
+ return void 0;
+ }
+ const classes = defaultValue_default(
+ tileset.schema.classes,
+ defaultValue_default.EMPTY_OBJECT
+ );
+ if (defined_default(metadataJson.class)) {
+ const tileClass = classes[metadataJson.class];
+ return new TileMetadata_default({
+ tile: metadataJson,
+ class: tileClass
+ });
+ }
+ return void 0;
+}
+findTileMetadata._oneTimeWarning = oneTimeWarning_default;
+var findTileMetadata_default = findTileMetadata;
+
+// Source/Scene/preprocess3DTileContent.js
+function preprocess3DTileContent(arrayBuffer) {
+ const uint8Array = new Uint8Array(arrayBuffer);
+ let contentType = getMagic_default(uint8Array);
+ if (contentType === "glTF") {
+ contentType = "glb";
+ }
+ if (Cesium3DTileContentType_default.isBinaryFormat(contentType)) {
+ return {
+ contentType,
+ binaryPayload: uint8Array
+ };
+ }
+ const json = getJsonContent(uint8Array);
+ if (defined_default(json.root)) {
+ return {
+ contentType: Cesium3DTileContentType_default.EXTERNAL_TILESET,
+ jsonPayload: json
+ };
+ }
+ if (defined_default(json.asset)) {
+ return {
+ contentType: Cesium3DTileContentType_default.GLTF,
+ jsonPayload: json
+ };
+ }
+ if (defined_default(json.tileAvailability)) {
+ return {
+ contentType: Cesium3DTileContentType_default.IMPLICIT_SUBTREE_JSON,
+ jsonPayload: json
+ };
+ }
+ if (defined_default(json.type)) {
+ return {
+ contentType: Cesium3DTileContentType_default.GEOJSON,
+ jsonPayload: json
+ };
+ }
+ throw new RuntimeError_default("Invalid tile content.");
+}
+function getJsonContent(uint8Array) {
+ let json;
+ try {
+ json = getJsonFromTypedArray_default(uint8Array);
+ } catch (error) {
+ throw new RuntimeError_default("Invalid tile content.");
+ }
+ return json;
+}
+var preprocess3DTileContent_default = preprocess3DTileContent;
+
+// Source/Scene/Multiple3DTileContent.js
+function Multiple3DTileContent(tileset, tile, tilesetResource, contentsJson) {
+ this._tileset = tileset;
+ this._tile = tile;
+ this._tilesetResource = tilesetResource;
+ this._contents = [];
+ this._contentsCreated = false;
+ const contentHeaders = defined_default(contentsJson.contents) ? contentsJson.contents : contentsJson.content;
+ this._innerContentHeaders = contentHeaders;
+ this._requestsInFlight = 0;
+ this._cancelCount = 0;
+ const contentCount = this._innerContentHeaders.length;
+ this._arrayFetchPromises = new Array(contentCount);
+ this._requests = new Array(contentCount);
+ this._innerContentResources = new Array(contentCount);
+ this._serverKeys = new Array(contentCount);
+ for (let i = 0; i < contentCount; i++) {
+ const contentResource = tilesetResource.getDerivedResource({
+ url: contentHeaders[i].uri
+ });
+ const serverKey = RequestScheduler_default.getServerKey(
+ contentResource.getUrlComponent()
+ );
+ this._innerContentResources[i] = contentResource;
+ this._serverKeys[i] = serverKey;
+ }
+ this._contentsFetchedPromise = void 0;
+}
+Object.defineProperties(Multiple3DTileContent.prototype, {
+ featurePropertiesDirty: {
+ get: function() {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ if (contents[i].featurePropertiesDirty) {
+ return true;
+ }
+ }
+ return false;
+ },
+ set: function(value) {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].featurePropertiesDirty = value;
+ }
+ }
+ },
+ featuresLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ pointsLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ trianglesLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ geometryByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ texturesByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ batchTableByteLength: {
+ get: function() {
+ return 0;
+ }
+ },
+ innerContents: {
+ get: function() {
+ return this._contents;
+ }
+ },
+ readyPromise: {
+ get: function() {
+ if (!this._contentsCreated) {
+ return void 0;
+ }
+ const readyPromises = this._contents.map(function(content) {
+ return content.readyPromise;
+ });
+ const that = this;
+ return Promise.all(readyPromises).then(function() {
+ return that;
+ });
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._tileset;
+ }
+ },
+ tile: {
+ get: function() {
+ return this._tile;
+ }
+ },
+ url: {
+ get: function() {
+ return void 0;
+ }
+ },
+ metadata: {
+ get: function() {
+ return void 0;
+ },
+ set: function() {
+ throw new DeveloperError_default("Multiple3DTileContent cannot have metadata");
+ }
+ },
+ batchTable: {
+ get: function() {
+ return void 0;
+ }
+ },
+ group: {
+ get: function() {
+ return void 0;
+ },
+ set: function() {
+ throw new DeveloperError_default(
+ "Multiple3DTileContent cannot have group metadata"
+ );
+ }
+ },
+ innerContentUrls: {
+ get: function() {
+ return this._innerContentHeaders.map(function(contentHeader) {
+ return contentHeader.uri;
+ });
+ }
+ },
+ contentsFetchedPromise: {
+ get: function() {
+ return this._contentsFetchedPromise;
+ }
+ }
+});
+function updatePendingRequests(multipleContents, deltaRequestCount) {
+ multipleContents._requestsInFlight += deltaRequestCount;
+ multipleContents.tileset.statistics.numberOfPendingRequests += deltaRequestCount;
+}
+function cancelPendingRequests(multipleContents, originalContentState) {
+ multipleContents._cancelCount++;
+ multipleContents._tile._contentState = originalContentState;
+ const statistics2 = multipleContents.tileset.statistics;
+ statistics2.numberOfPendingRequests -= multipleContents._requestsInFlight;
+ statistics2.numberOfAttemptedRequests += multipleContents._requestsInFlight;
+ multipleContents._requestsInFlight = 0;
+ const contentCount = multipleContents._innerContentHeaders.length;
+ multipleContents._arrayFetchPromises = new Array(contentCount);
+}
+Multiple3DTileContent.prototype.requestInnerContents = function() {
+ if (!canScheduleAllRequests(this._serverKeys)) {
+ return this._serverKeys.length;
+ }
+ const contentHeaders = this._innerContentHeaders;
+ updatePendingRequests(this, contentHeaders.length);
+ for (let i = 0; i < contentHeaders.length; i++) {
+ this._arrayFetchPromises[i] = requestInnerContent(
+ this,
+ i,
+ this._cancelCount,
+ this._tile._contentState
+ );
+ }
+ this._contentsFetchedPromise = createInnerContents(this);
+ return 0;
+};
+function canScheduleAllRequests(serverKeys) {
+ const requestCountsByServer = {};
+ for (let i = 0; i < serverKeys.length; i++) {
+ const serverKey = serverKeys[i];
+ if (defined_default(requestCountsByServer[serverKey])) {
+ requestCountsByServer[serverKey]++;
+ } else {
+ requestCountsByServer[serverKey] = 1;
+ }
+ }
+ for (const key in requestCountsByServer) {
+ if (requestCountsByServer.hasOwnProperty(key) && !RequestScheduler_default.serverHasOpenSlots(key, requestCountsByServer[key])) {
+ return false;
+ }
+ }
+ return RequestScheduler_default.heapHasOpenSlots(serverKeys.length);
+}
+function requestInnerContent(multipleContents, index, originalCancelCount, originalContentState) {
+ const contentResource = multipleContents._innerContentResources[index].clone();
+ const tile = multipleContents.tile;
+ const priorityFunction = function() {
+ return tile._priority;
+ };
+ const serverKey = multipleContents._serverKeys[index];
+ const request = new Request_default({
+ throttle: true,
+ throttleByServer: true,
+ type: RequestType_default.TILES3D,
+ priorityFunction,
+ serverKey
+ });
+ contentResource.request = request;
+ multipleContents._requests[index] = request;
+ const promise = contentResource.fetchArrayBuffer();
+ if (!defined_default(promise)) {
+ return Promise.resolve(void 0);
+ }
+ return promise.then(function(arrayBuffer) {
+ if (originalCancelCount < multipleContents._cancelCount) {
+ return void 0;
+ }
+ updatePendingRequests(multipleContents, -1);
+ return arrayBuffer;
+ }).catch(function(error) {
+ if (originalCancelCount < multipleContents._cancelCount) {
+ return void 0;
+ }
+ if (contentResource.request.state === RequestState_default.CANCELLED) {
+ cancelPendingRequests(multipleContents, originalContentState);
+ return void 0;
+ }
+ updatePendingRequests(multipleContents, -1);
+ handleInnerContentFailed(multipleContents, index, error);
+ });
+}
+function createInnerContents(multipleContents) {
+ const originalCancelCount = multipleContents._cancelCount;
+ return Promise.all(multipleContents._arrayFetchPromises).then(function(arrayBuffers) {
+ if (originalCancelCount < multipleContents._cancelCount) {
+ return void 0;
+ }
+ const contents = arrayBuffers.map(function(arrayBuffer, i) {
+ if (!defined_default(arrayBuffer)) {
+ return void 0;
+ }
+ return createInnerContent(multipleContents, arrayBuffer, i);
+ });
+ multipleContents._contentsCreated = true;
+ multipleContents._contents = contents.filter(defined_default);
+ });
+}
+function createInnerContent(multipleContents, arrayBuffer, index) {
+ const preprocessed = preprocess3DTileContent_default(arrayBuffer);
+ if (preprocessed.contentType === Cesium3DTileContentType_default.EXTERNAL_TILESET) {
+ const error = new RuntimeError_default(
+ "External tilesets are disallowed inside multiple contents"
+ );
+ return handleInnerContentFailed(multipleContents, index, error);
+ }
+ multipleContents._disableSkipLevelOfDetail = multipleContents._disableSkipLevelOfDetail || preprocessed.contentType === Cesium3DTileContentType_default.GEOMETRY || preprocessed.contentType === Cesium3DTileContentType_default.VECTOR;
+ const tileset = multipleContents._tileset;
+ const resource = multipleContents._innerContentResources[index];
+ const tile = multipleContents._tile;
+ let content;
+ const contentFactory = Cesium3DTileContentFactory_default[preprocessed.contentType];
+ if (defined_default(preprocessed.binaryPayload)) {
+ content = contentFactory(
+ tileset,
+ tile,
+ resource,
+ preprocessed.binaryPayload.buffer,
+ 0
+ );
+ } else {
+ content = contentFactory(tileset, tile, resource, preprocessed.jsonPayload);
+ }
+ const contentHeader = multipleContents._innerContentHeaders[index];
+ if (tile.hasImplicitContentMetadata) {
+ const subtree = tile.implicitSubtree;
+ const coordinates = tile.implicitCoordinates;
+ content.metadata = subtree.getContentMetadataView(coordinates, index);
+ } else if (!tile.hasImplicitContent) {
+ content.metadata = findContentMetadata_default(tileset, contentHeader);
+ }
+ const groupMetadata = findGroupMetadata_default(tileset, contentHeader);
+ if (defined_default(groupMetadata)) {
+ content.group = new Cesium3DContentGroup_default({
+ metadata: groupMetadata
+ });
+ }
+ return content;
+}
+function handleInnerContentFailed(multipleContents, index, error) {
+ const tileset = multipleContents._tileset;
+ const url2 = multipleContents._innerContentResources[index].url;
+ const message = defined_default(error.message) ? error.message : error.toString();
+ if (tileset.tileFailed.numberOfListeners > 0) {
+ tileset.tileFailed.raiseEvent({
+ url: url2,
+ message
+ });
+ } else {
+ console.log(`A content failed to load: ${url2}`);
+ console.log(`Error: ${message}`);
+ }
+}
+Multiple3DTileContent.prototype.cancelRequests = function() {
+ for (let i = 0; i < this._requests.length; i++) {
+ const request = this._requests[i];
+ if (defined_default(request)) {
+ request.cancel();
+ }
+ }
+};
+Multiple3DTileContent.prototype.hasProperty = function(batchId, name) {
+ return false;
+};
+Multiple3DTileContent.prototype.getFeature = function(batchId) {
+ return void 0;
+};
+Multiple3DTileContent.prototype.applyDebugSettings = function(enabled, color) {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].applyDebugSettings(enabled, color);
+ }
+};
+Multiple3DTileContent.prototype.applyStyle = function(style) {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].applyStyle(style);
+ }
+};
+Multiple3DTileContent.prototype.update = function(tileset, frameState) {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].update(tileset, frameState);
+ }
+};
+Multiple3DTileContent.prototype.isDestroyed = function() {
+ return false;
+};
+Multiple3DTileContent.prototype.destroy = function() {
+ const contents = this._contents;
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ contents[i].destroy();
+ }
+ return destroyObject_default(this);
+};
+var Multiple3DTileContent_default = Multiple3DTileContent;
+
+// Source/Core/PolygonPipeline.js
+var import_earcut = __toESM(require_earcut(), 1);
+var scaleToGeodeticHeightN = new Cartesian3_default();
+var scaleToGeodeticHeightP = new Cartesian3_default();
+var PolygonPipeline = {};
+PolygonPipeline.computeArea2D = function(positions) {
+ Check_default.defined("positions", positions);
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "positions.length",
+ positions.length,
+ 3
+ );
+ const length3 = positions.length;
+ let area = 0;
+ for (let i0 = length3 - 1, i1 = 0; i1 < length3; i0 = i1++) {
+ const v02 = positions[i0];
+ const v13 = positions[i1];
+ area += v02.x * v13.y - v13.x * v02.y;
+ }
+ return area * 0.5;
+};
+PolygonPipeline.computeWindingOrder2D = function(positions) {
+ const area = PolygonPipeline.computeArea2D(positions);
+ return area > 0 ? WindingOrder_default.COUNTER_CLOCKWISE : WindingOrder_default.CLOCKWISE;
+};
+PolygonPipeline.triangulate = function(positions, holes) {
+ Check_default.defined("positions", positions);
+ const flattenedPositions = Cartesian2_default.packArray(positions);
+ return (0, import_earcut.default)(flattenedPositions, holes, 2);
+};
+var subdivisionV0Scratch = new Cartesian3_default();
+var subdivisionV1Scratch = new Cartesian3_default();
+var subdivisionV2Scratch = new Cartesian3_default();
+var subdivisionS0Scratch = new Cartesian3_default();
+var subdivisionS1Scratch = new Cartesian3_default();
+var subdivisionS2Scratch = new Cartesian3_default();
+var subdivisionMidScratch = new Cartesian3_default();
+var subdivisionT0Scratch = new Cartesian2_default();
+var subdivisionT1Scratch = new Cartesian2_default();
+var subdivisionT2Scratch = new Cartesian2_default();
+var subdivisionTexcoordMidScratch = new Cartesian2_default();
+PolygonPipeline.computeSubdivision = function(ellipsoid, positions, indices2, texcoords, granularity) {
+ granularity = defaultValue_default(granularity, Math_default.RADIANS_PER_DEGREE);
+ const hasTexcoords = defined_default(texcoords);
+ Check_default.typeOf.object("ellipsoid", ellipsoid);
+ Check_default.defined("positions", positions);
+ Check_default.defined("indices", indices2);
+ Check_default.typeOf.number.greaterThanOrEquals("indices.length", indices2.length, 3);
+ Check_default.typeOf.number.equals("indices.length % 3", "0", indices2.length % 3, 0);
+ Check_default.typeOf.number.greaterThan("granularity", granularity, 0);
+ const triangles = indices2.slice(0);
+ let i;
+ const length3 = positions.length;
+ const subdividedPositions = new Array(length3 * 3);
+ const subdividedTexcoords = new Array(length3 * 2);
+ let q = 0;
+ let p = 0;
+ for (i = 0; i < length3; i++) {
+ const item = positions[i];
+ subdividedPositions[q++] = item.x;
+ subdividedPositions[q++] = item.y;
+ subdividedPositions[q++] = item.z;
+ if (hasTexcoords) {
+ const texcoordItem = texcoords[i];
+ subdividedTexcoords[p++] = texcoordItem.x;
+ subdividedTexcoords[p++] = texcoordItem.y;
+ }
+ }
+ const subdividedIndices = [];
+ const edges = {};
+ const radius = ellipsoid.maximumRadius;
+ const minDistance = Math_default.chordLength(granularity, radius);
+ const minDistanceSqrd = minDistance * minDistance;
+ while (triangles.length > 0) {
+ const i2 = triangles.pop();
+ const i1 = triangles.pop();
+ const i0 = triangles.pop();
+ const v02 = Cartesian3_default.fromArray(
+ subdividedPositions,
+ i0 * 3,
+ subdivisionV0Scratch
+ );
+ const v13 = Cartesian3_default.fromArray(
+ subdividedPositions,
+ i1 * 3,
+ subdivisionV1Scratch
+ );
+ const v23 = Cartesian3_default.fromArray(
+ subdividedPositions,
+ i2 * 3,
+ subdivisionV2Scratch
+ );
+ let t0, t1, t2;
+ if (hasTexcoords) {
+ t0 = Cartesian2_default.fromArray(
+ subdividedTexcoords,
+ i0 * 2,
+ subdivisionT0Scratch
+ );
+ t1 = Cartesian2_default.fromArray(
+ subdividedTexcoords,
+ i1 * 2,
+ subdivisionT1Scratch
+ );
+ t2 = Cartesian2_default.fromArray(
+ subdividedTexcoords,
+ i2 * 2,
+ subdivisionT2Scratch
+ );
+ }
+ const s0 = Cartesian3_default.multiplyByScalar(
+ Cartesian3_default.normalize(v02, subdivisionS0Scratch),
+ radius,
+ subdivisionS0Scratch
+ );
+ const s1 = Cartesian3_default.multiplyByScalar(
+ Cartesian3_default.normalize(v13, subdivisionS1Scratch),
+ radius,
+ subdivisionS1Scratch
+ );
+ const s2 = Cartesian3_default.multiplyByScalar(
+ Cartesian3_default.normalize(v23, subdivisionS2Scratch),
+ radius,
+ subdivisionS2Scratch
+ );
+ const g0 = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(s0, s1, subdivisionMidScratch)
+ );
+ const g1 = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(s1, s2, subdivisionMidScratch)
+ );
+ const g2 = Cartesian3_default.magnitudeSquared(
+ Cartesian3_default.subtract(s2, s0, subdivisionMidScratch)
+ );
+ const max3 = Math.max(g0, g1, g2);
+ let edge;
+ let mid;
+ let midTexcoord;
+ if (max3 > minDistanceSqrd) {
+ if (g0 === max3) {
+ edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;
+ i = edges[edge];
+ if (!defined_default(i)) {
+ mid = Cartesian3_default.add(v02, v13, subdivisionMidScratch);
+ Cartesian3_default.multiplyByScalar(mid, 0.5, mid);
+ subdividedPositions.push(mid.x, mid.y, mid.z);
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+ if (hasTexcoords) {
+ midTexcoord = Cartesian2_default.add(t0, t1, subdivisionTexcoordMidScratch);
+ Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+ triangles.push(i0, i, i2);
+ triangles.push(i, i1, i2);
+ } else if (g1 === max3) {
+ edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;
+ i = edges[edge];
+ if (!defined_default(i)) {
+ mid = Cartesian3_default.add(v13, v23, subdivisionMidScratch);
+ Cartesian3_default.multiplyByScalar(mid, 0.5, mid);
+ subdividedPositions.push(mid.x, mid.y, mid.z);
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+ if (hasTexcoords) {
+ midTexcoord = Cartesian2_default.add(t1, t2, subdivisionTexcoordMidScratch);
+ Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+ triangles.push(i1, i, i0);
+ triangles.push(i, i2, i0);
+ } else if (g2 === max3) {
+ edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;
+ i = edges[edge];
+ if (!defined_default(i)) {
+ mid = Cartesian3_default.add(v23, v02, subdivisionMidScratch);
+ Cartesian3_default.multiplyByScalar(mid, 0.5, mid);
+ subdividedPositions.push(mid.x, mid.y, mid.z);
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+ if (hasTexcoords) {
+ midTexcoord = Cartesian2_default.add(t2, t0, subdivisionTexcoordMidScratch);
+ Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+ triangles.push(i2, i, i1);
+ triangles.push(i, i0, i1);
+ }
+ } else {
+ subdividedIndices.push(i0);
+ subdividedIndices.push(i1);
+ subdividedIndices.push(i2);
+ }
+ }
+ const geometryOptions = {
+ attributes: {
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: subdividedPositions
+ })
+ },
+ indices: subdividedIndices,
+ primitiveType: PrimitiveType_default.TRIANGLES
+ };
+ if (hasTexcoords) {
+ geometryOptions.attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: subdividedTexcoords
+ });
+ }
+ return new Geometry_default(geometryOptions);
+};
+var subdivisionC0Scratch = new Cartographic_default();
+var subdivisionC1Scratch = new Cartographic_default();
+var subdivisionC2Scratch = new Cartographic_default();
+var subdivisionCartographicScratch = new Cartographic_default();
+PolygonPipeline.computeRhumbLineSubdivision = function(ellipsoid, positions, indices2, texcoords, granularity) {
+ granularity = defaultValue_default(granularity, Math_default.RADIANS_PER_DEGREE);
+ const hasTexcoords = defined_default(texcoords);
+ Check_default.typeOf.object("ellipsoid", ellipsoid);
+ Check_default.defined("positions", positions);
+ Check_default.defined("indices", indices2);
+ Check_default.typeOf.number.greaterThanOrEquals("indices.length", indices2.length, 3);
+ Check_default.typeOf.number.equals("indices.length % 3", "0", indices2.length % 3, 0);
+ Check_default.typeOf.number.greaterThan("granularity", granularity, 0);
+ const triangles = indices2.slice(0);
+ let i;
+ const length3 = positions.length;
+ const subdividedPositions = new Array(length3 * 3);
+ const subdividedTexcoords = new Array(length3 * 2);
+ let q = 0;
+ let p = 0;
+ for (i = 0; i < length3; i++) {
+ const item = positions[i];
+ subdividedPositions[q++] = item.x;
+ subdividedPositions[q++] = item.y;
+ subdividedPositions[q++] = item.z;
+ if (hasTexcoords) {
+ const texcoordItem = texcoords[i];
+ subdividedTexcoords[p++] = texcoordItem.x;
+ subdividedTexcoords[p++] = texcoordItem.y;
+ }
+ }
+ const subdividedIndices = [];
+ const edges = {};
+ const radius = ellipsoid.maximumRadius;
+ const minDistance = Math_default.chordLength(granularity, radius);
+ const rhumb0 = new EllipsoidRhumbLine_default(void 0, void 0, ellipsoid);
+ const rhumb1 = new EllipsoidRhumbLine_default(void 0, void 0, ellipsoid);
+ const rhumb2 = new EllipsoidRhumbLine_default(void 0, void 0, ellipsoid);
+ while (triangles.length > 0) {
+ const i2 = triangles.pop();
+ const i1 = triangles.pop();
+ const i0 = triangles.pop();
+ const v02 = Cartesian3_default.fromArray(
+ subdividedPositions,
+ i0 * 3,
+ subdivisionV0Scratch
+ );
+ const v13 = Cartesian3_default.fromArray(
+ subdividedPositions,
+ i1 * 3,
+ subdivisionV1Scratch
+ );
+ const v23 = Cartesian3_default.fromArray(
+ subdividedPositions,
+ i2 * 3,
+ subdivisionV2Scratch
+ );
+ let t0, t1, t2;
+ if (hasTexcoords) {
+ t0 = Cartesian2_default.fromArray(
+ subdividedTexcoords,
+ i0 * 2,
+ subdivisionT0Scratch
+ );
+ t1 = Cartesian2_default.fromArray(
+ subdividedTexcoords,
+ i1 * 2,
+ subdivisionT1Scratch
+ );
+ t2 = Cartesian2_default.fromArray(
+ subdividedTexcoords,
+ i2 * 2,
+ subdivisionT2Scratch
+ );
+ }
+ const c0 = ellipsoid.cartesianToCartographic(v02, subdivisionC0Scratch);
+ const c14 = ellipsoid.cartesianToCartographic(v13, subdivisionC1Scratch);
+ const c22 = ellipsoid.cartesianToCartographic(v23, subdivisionC2Scratch);
+ rhumb0.setEndPoints(c0, c14);
+ const g0 = rhumb0.surfaceDistance;
+ rhumb1.setEndPoints(c14, c22);
+ const g1 = rhumb1.surfaceDistance;
+ rhumb2.setEndPoints(c22, c0);
+ const g2 = rhumb2.surfaceDistance;
+ const max3 = Math.max(g0, g1, g2);
+ let edge;
+ let mid;
+ let midHeight;
+ let midCartesian3;
+ let midTexcoord;
+ if (max3 > minDistance) {
+ if (g0 === max3) {
+ edge = `${Math.min(i0, i1)} ${Math.max(i0, i1)}`;
+ i = edges[edge];
+ if (!defined_default(i)) {
+ mid = rhumb0.interpolateUsingFraction(
+ 0.5,
+ subdivisionCartographicScratch
+ );
+ midHeight = (c0.height + c14.height) * 0.5;
+ midCartesian3 = Cartesian3_default.fromRadians(
+ mid.longitude,
+ mid.latitude,
+ midHeight,
+ ellipsoid,
+ subdivisionMidScratch
+ );
+ subdividedPositions.push(
+ midCartesian3.x,
+ midCartesian3.y,
+ midCartesian3.z
+ );
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+ if (hasTexcoords) {
+ midTexcoord = Cartesian2_default.add(t0, t1, subdivisionTexcoordMidScratch);
+ Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+ triangles.push(i0, i, i2);
+ triangles.push(i, i1, i2);
+ } else if (g1 === max3) {
+ edge = `${Math.min(i1, i2)} ${Math.max(i1, i2)}`;
+ i = edges[edge];
+ if (!defined_default(i)) {
+ mid = rhumb1.interpolateUsingFraction(
+ 0.5,
+ subdivisionCartographicScratch
+ );
+ midHeight = (c14.height + c22.height) * 0.5;
+ midCartesian3 = Cartesian3_default.fromRadians(
+ mid.longitude,
+ mid.latitude,
+ midHeight,
+ ellipsoid,
+ subdivisionMidScratch
+ );
+ subdividedPositions.push(
+ midCartesian3.x,
+ midCartesian3.y,
+ midCartesian3.z
+ );
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+ if (hasTexcoords) {
+ midTexcoord = Cartesian2_default.add(t1, t2, subdivisionTexcoordMidScratch);
+ Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+ triangles.push(i1, i, i0);
+ triangles.push(i, i2, i0);
+ } else if (g2 === max3) {
+ edge = `${Math.min(i2, i0)} ${Math.max(i2, i0)}`;
+ i = edges[edge];
+ if (!defined_default(i)) {
+ mid = rhumb2.interpolateUsingFraction(
+ 0.5,
+ subdivisionCartographicScratch
+ );
+ midHeight = (c22.height + c0.height) * 0.5;
+ midCartesian3 = Cartesian3_default.fromRadians(
+ mid.longitude,
+ mid.latitude,
+ midHeight,
+ ellipsoid,
+ subdivisionMidScratch
+ );
+ subdividedPositions.push(
+ midCartesian3.x,
+ midCartesian3.y,
+ midCartesian3.z
+ );
+ i = subdividedPositions.length / 3 - 1;
+ edges[edge] = i;
+ if (hasTexcoords) {
+ midTexcoord = Cartesian2_default.add(t2, t0, subdivisionTexcoordMidScratch);
+ Cartesian2_default.multiplyByScalar(midTexcoord, 0.5, midTexcoord);
+ subdividedTexcoords.push(midTexcoord.x, midTexcoord.y);
+ }
+ }
+ triangles.push(i2, i, i1);
+ triangles.push(i, i0, i1);
+ }
+ } else {
+ subdividedIndices.push(i0);
+ subdividedIndices.push(i1);
+ subdividedIndices.push(i2);
+ }
+ }
+ const geometryOptions = {
+ attributes: {
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: subdividedPositions
+ })
+ },
+ indices: subdividedIndices,
+ primitiveType: PrimitiveType_default.TRIANGLES
+ };
+ if (hasTexcoords) {
+ geometryOptions.attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: subdividedTexcoords
+ });
+ }
+ return new Geometry_default(geometryOptions);
+};
+PolygonPipeline.scaleToGeodeticHeight = function(positions, height, ellipsoid, scaleToSurface4) {
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ let n = scaleToGeodeticHeightN;
+ let p = scaleToGeodeticHeightP;
+ height = defaultValue_default(height, 0);
+ scaleToSurface4 = defaultValue_default(scaleToSurface4, true);
+ if (defined_default(positions)) {
+ const length3 = positions.length;
+ for (let i = 0; i < length3; i += 3) {
+ Cartesian3_default.fromArray(positions, i, p);
+ if (scaleToSurface4) {
+ p = ellipsoid.scaleToGeodeticSurface(p, p);
+ }
+ if (height !== 0) {
+ n = ellipsoid.geodeticSurfaceNormal(p, n);
+ Cartesian3_default.multiplyByScalar(n, height, n);
+ Cartesian3_default.add(p, n, p);
+ }
+ positions[i] = p.x;
+ positions[i + 1] = p.y;
+ positions[i + 2] = p.z;
+ }
+ }
+ return positions;
+};
+var PolygonPipeline_default = PolygonPipeline;
+
+// Source/Core/RectangleGeometryLibrary.js
+var cos = Math.cos;
+var sin = Math.sin;
+var sqrt = Math.sqrt;
+var RectangleGeometryLibrary = {};
+RectangleGeometryLibrary.computePosition = function(computedOptions, ellipsoid, computeST, row, col, position, st) {
+ const radiiSquared = ellipsoid.radiiSquared;
+ const nwCorner = computedOptions.nwCorner;
+ const rectangle = computedOptions.boundingRectangle;
+ let stLatitude = nwCorner.latitude - computedOptions.granYCos * row + col * computedOptions.granXSin;
+ const cosLatitude = cos(stLatitude);
+ const nZ = sin(stLatitude);
+ const kZ = radiiSquared.z * nZ;
+ let stLongitude = nwCorner.longitude + row * computedOptions.granYSin + col * computedOptions.granXCos;
+ const nX = cosLatitude * cos(stLongitude);
+ const nY = cosLatitude * sin(stLongitude);
+ const kX = radiiSquared.x * nX;
+ const kY = radiiSquared.y * nY;
+ const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);
+ position.x = kX / gamma;
+ position.y = kY / gamma;
+ position.z = kZ / gamma;
+ if (computeST) {
+ const stNwCorner = computedOptions.stNwCorner;
+ if (defined_default(stNwCorner)) {
+ stLatitude = stNwCorner.latitude - computedOptions.stGranYCos * row + col * computedOptions.stGranXSin;
+ stLongitude = stNwCorner.longitude + row * computedOptions.stGranYSin + col * computedOptions.stGranXCos;
+ st.x = (stLongitude - computedOptions.stWest) * computedOptions.lonScalar;
+ st.y = (stLatitude - computedOptions.stSouth) * computedOptions.latScalar;
+ } else {
+ st.x = (stLongitude - rectangle.west) * computedOptions.lonScalar;
+ st.y = (stLatitude - rectangle.south) * computedOptions.latScalar;
+ }
+ }
+};
+var rotationMatrixScratch = new Matrix2_default();
+var nwCartesian = new Cartesian3_default();
+var centerScratch = new Cartographic_default();
+var centerCartesian = new Cartesian3_default();
+var proj = new GeographicProjection_default();
+function getRotationOptions(nwCorner, rotation, granularityX, granularityY, center, width, height) {
+ const cosRotation = Math.cos(rotation);
+ const granYCos = granularityY * cosRotation;
+ const granXCos = granularityX * cosRotation;
+ const sinRotation = Math.sin(rotation);
+ const granYSin = granularityY * sinRotation;
+ const granXSin = granularityX * sinRotation;
+ nwCartesian = proj.project(nwCorner, nwCartesian);
+ nwCartesian = Cartesian3_default.subtract(nwCartesian, centerCartesian, nwCartesian);
+ const rotationMatrix = Matrix2_default.fromRotation(rotation, rotationMatrixScratch);
+ nwCartesian = Matrix2_default.multiplyByVector(
+ rotationMatrix,
+ nwCartesian,
+ nwCartesian
+ );
+ nwCartesian = Cartesian3_default.add(nwCartesian, centerCartesian, nwCartesian);
+ nwCorner = proj.unproject(nwCartesian, nwCorner);
+ width -= 1;
+ height -= 1;
+ const latitude = nwCorner.latitude;
+ const latitude0 = latitude + width * granXSin;
+ const latitude1 = latitude - granYCos * height;
+ const latitude2 = latitude - granYCos * height + width * granXSin;
+ const north = Math.max(latitude, latitude0, latitude1, latitude2);
+ const south = Math.min(latitude, latitude0, latitude1, latitude2);
+ const longitude = nwCorner.longitude;
+ const longitude0 = longitude + width * granXCos;
+ const longitude1 = longitude + height * granYSin;
+ const longitude2 = longitude + height * granYSin + width * granXCos;
+ const east = Math.max(longitude, longitude0, longitude1, longitude2);
+ const west = Math.min(longitude, longitude0, longitude1, longitude2);
+ return {
+ north,
+ south,
+ east,
+ west,
+ granYCos,
+ granYSin,
+ granXCos,
+ granXSin,
+ nwCorner
+ };
+}
+RectangleGeometryLibrary.computeOptions = function(rectangle, granularity, rotation, stRotation, boundingRectangleScratch2, nwCornerResult, stNwCornerResult) {
+ let east = rectangle.east;
+ let west = rectangle.west;
+ let north = rectangle.north;
+ let south = rectangle.south;
+ let northCap = false;
+ let southCap = false;
+ if (north === Math_default.PI_OVER_TWO) {
+ northCap = true;
+ }
+ if (south === -Math_default.PI_OVER_TWO) {
+ southCap = true;
+ }
+ let dx;
+ const dy = north - south;
+ if (west > east) {
+ dx = Math_default.TWO_PI - west + east;
+ } else {
+ dx = east - west;
+ }
+ const width = Math.ceil(dx / granularity) + 1;
+ const height = Math.ceil(dy / granularity) + 1;
+ const granularityX = dx / (width - 1);
+ const granularityY = dy / (height - 1);
+ const nwCorner = Rectangle_default.northwest(rectangle, nwCornerResult);
+ const center = Rectangle_default.center(rectangle, centerScratch);
+ if (rotation !== 0 || stRotation !== 0) {
+ if (center.longitude < nwCorner.longitude) {
+ center.longitude += Math_default.TWO_PI;
+ }
+ centerCartesian = proj.project(center, centerCartesian);
+ }
+ const granYCos = granularityY;
+ const granXCos = granularityX;
+ const granYSin = 0;
+ const granXSin = 0;
+ const boundingRectangle = Rectangle_default.clone(
+ rectangle,
+ boundingRectangleScratch2
+ );
+ const computedOptions = {
+ granYCos,
+ granYSin,
+ granXCos,
+ granXSin,
+ nwCorner,
+ boundingRectangle,
+ width,
+ height,
+ northCap,
+ southCap
+ };
+ if (rotation !== 0) {
+ const rotationOptions = getRotationOptions(
+ nwCorner,
+ rotation,
+ granularityX,
+ granularityY,
+ center,
+ width,
+ height
+ );
+ north = rotationOptions.north;
+ south = rotationOptions.south;
+ east = rotationOptions.east;
+ west = rotationOptions.west;
+ if (north < -Math_default.PI_OVER_TWO || north > Math_default.PI_OVER_TWO || south < -Math_default.PI_OVER_TWO || south > Math_default.PI_OVER_TWO) {
+ throw new DeveloperError_default(
+ "Rotated rectangle is invalid. It crosses over either the north or south pole."
+ );
+ }
+ computedOptions.granYCos = rotationOptions.granYCos;
+ computedOptions.granYSin = rotationOptions.granYSin;
+ computedOptions.granXCos = rotationOptions.granXCos;
+ computedOptions.granXSin = rotationOptions.granXSin;
+ boundingRectangle.north = north;
+ boundingRectangle.south = south;
+ boundingRectangle.east = east;
+ boundingRectangle.west = west;
+ }
+ if (stRotation !== 0) {
+ rotation = rotation - stRotation;
+ const stNwCorner = Rectangle_default.northwest(boundingRectangle, stNwCornerResult);
+ const stRotationOptions = getRotationOptions(
+ stNwCorner,
+ rotation,
+ granularityX,
+ granularityY,
+ center,
+ width,
+ height
+ );
+ computedOptions.stGranYCos = stRotationOptions.granYCos;
+ computedOptions.stGranXCos = stRotationOptions.granXCos;
+ computedOptions.stGranYSin = stRotationOptions.granYSin;
+ computedOptions.stGranXSin = stRotationOptions.granXSin;
+ computedOptions.stNwCorner = stNwCorner;
+ computedOptions.stWest = stRotationOptions.west;
+ computedOptions.stSouth = stRotationOptions.south;
+ }
+ return computedOptions;
+};
+var RectangleGeometryLibrary_default = RectangleGeometryLibrary;
+
+// Source/Core/RectangleOutlineGeometry.js
+var bottomBoundingSphere = new BoundingSphere_default();
+var topBoundingSphere = new BoundingSphere_default();
+var positionScratch6 = new Cartesian3_default();
+var rectangleScratch = new Rectangle_default();
+function constructRectangle(geometry, computedOptions) {
+ const ellipsoid = geometry._ellipsoid;
+ const height = computedOptions.height;
+ const width = computedOptions.width;
+ const northCap = computedOptions.northCap;
+ const southCap = computedOptions.southCap;
+ let rowHeight = height;
+ let widthMultiplier = 2;
+ let size = 0;
+ let corners = 4;
+ if (northCap) {
+ widthMultiplier -= 1;
+ rowHeight -= 1;
+ size += 1;
+ corners -= 2;
+ }
+ if (southCap) {
+ widthMultiplier -= 1;
+ rowHeight -= 1;
+ size += 1;
+ corners -= 2;
+ }
+ size += widthMultiplier * width + 2 * rowHeight - corners;
+ const positions = new Float64Array(size * 3);
+ let posIndex = 0;
+ let row = 0;
+ let col;
+ const position = positionScratch6;
+ if (northCap) {
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ row,
+ 0,
+ position
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ } else {
+ for (col = 0; col < width; col++) {
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ row,
+ col,
+ position
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ }
+ }
+ col = width - 1;
+ for (row = 1; row < height; row++) {
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ row,
+ col,
+ position
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ }
+ row = height - 1;
+ if (!southCap) {
+ for (col = width - 2; col >= 0; col--) {
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ row,
+ col,
+ position
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ }
+ }
+ col = 0;
+ for (row = height - 2; row > 0; row--) {
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ row,
+ col,
+ position
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ }
+ const indicesSize = positions.length / 3 * 2;
+ const indices2 = IndexDatatype_default.createTypedArray(
+ positions.length / 3,
+ indicesSize
+ );
+ let index = 0;
+ for (let i = 0; i < positions.length / 3 - 1; i++) {
+ indices2[index++] = i;
+ indices2[index++] = i + 1;
+ }
+ indices2[index++] = positions.length / 3 - 1;
+ indices2[index++] = 0;
+ const geo = new Geometry_default({
+ attributes: new GeometryAttributes_default(),
+ primitiveType: PrimitiveType_default.LINES
+ });
+ geo.attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ geo.indices = indices2;
+ return geo;
+}
+function constructExtrudedRectangle(rectangleGeometry, computedOptions) {
+ const surfaceHeight = rectangleGeometry._surfaceHeight;
+ const extrudedHeight = rectangleGeometry._extrudedHeight;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const minHeight = extrudedHeight;
+ const maxHeight = surfaceHeight;
+ const geo = constructRectangle(rectangleGeometry, computedOptions);
+ const height = computedOptions.height;
+ const width = computedOptions.width;
+ const topPositions = PolygonPipeline_default.scaleToGeodeticHeight(
+ geo.attributes.position.values,
+ maxHeight,
+ ellipsoid,
+ false
+ );
+ let length3 = topPositions.length;
+ const positions = new Float64Array(length3 * 2);
+ positions.set(topPositions);
+ const bottomPositions = PolygonPipeline_default.scaleToGeodeticHeight(
+ geo.attributes.position.values,
+ minHeight,
+ ellipsoid
+ );
+ positions.set(bottomPositions, length3);
+ geo.attributes.position.values = positions;
+ const northCap = computedOptions.northCap;
+ const southCap = computedOptions.southCap;
+ let corners = 4;
+ if (northCap) {
+ corners -= 1;
+ }
+ if (southCap) {
+ corners -= 1;
+ }
+ const indicesSize = (positions.length / 3 + corners) * 2;
+ const indices2 = IndexDatatype_default.createTypedArray(
+ positions.length / 3,
+ indicesSize
+ );
+ length3 = positions.length / 6;
+ let index = 0;
+ for (let i = 0; i < length3 - 1; i++) {
+ indices2[index++] = i;
+ indices2[index++] = i + 1;
+ indices2[index++] = i + length3;
+ indices2[index++] = i + length3 + 1;
+ }
+ indices2[index++] = length3 - 1;
+ indices2[index++] = 0;
+ indices2[index++] = length3 + length3 - 1;
+ indices2[index++] = length3;
+ indices2[index++] = 0;
+ indices2[index++] = length3;
+ let bottomCorner;
+ if (northCap) {
+ bottomCorner = height - 1;
+ } else {
+ const topRightCorner = width - 1;
+ indices2[index++] = topRightCorner;
+ indices2[index++] = topRightCorner + length3;
+ bottomCorner = width + height - 2;
+ }
+ indices2[index++] = bottomCorner;
+ indices2[index++] = bottomCorner + length3;
+ if (!southCap) {
+ const bottomLeftCorner = width + bottomCorner - 1;
+ indices2[index++] = bottomLeftCorner;
+ indices2[index] = bottomLeftCorner + length3;
+ }
+ geo.indices = indices2;
+ return geo;
+}
+function RectangleOutlineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const rectangle = options.rectangle;
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ const rotation = defaultValue_default(options.rotation, 0);
+ if (!defined_default(rectangle)) {
+ throw new DeveloperError_default("rectangle is required.");
+ }
+ Rectangle_default.validate(rectangle);
+ if (rectangle.north < rectangle.south) {
+ throw new DeveloperError_default(
+ "options.rectangle.north must be greater than options.rectangle.south"
+ );
+ }
+ const height = defaultValue_default(options.height, 0);
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
+ this._rectangle = Rectangle_default.clone(rectangle);
+ this._granularity = granularity;
+ this._ellipsoid = ellipsoid;
+ this._surfaceHeight = Math.max(height, extrudedHeight);
+ this._rotation = rotation;
+ this._extrudedHeight = Math.min(height, extrudedHeight);
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createRectangleOutlineGeometry";
+}
+RectangleOutlineGeometry.packedLength = Rectangle_default.packedLength + Ellipsoid_default.packedLength + 5;
+RectangleOutlineGeometry.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ Rectangle_default.pack(value._rectangle, array, startingIndex);
+ startingIndex += Rectangle_default.packedLength;
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._surfaceHeight;
+ array[startingIndex++] = value._rotation;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchRectangle2 = new Rectangle_default();
+var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchOptions3 = {
+ rectangle: scratchRectangle2,
+ ellipsoid: scratchEllipsoid,
+ granularity: void 0,
+ height: void 0,
+ rotation: void 0,
+ extrudedHeight: void 0,
+ offsetAttribute: void 0
+};
+RectangleOutlineGeometry.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const rectangle = Rectangle_default.unpack(array, startingIndex, scratchRectangle2);
+ startingIndex += Rectangle_default.packedLength;
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
+ startingIndex += Ellipsoid_default.packedLength;
+ const granularity = array[startingIndex++];
+ const height = array[startingIndex++];
+ const rotation = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions3.granularity = granularity;
+ scratchOptions3.height = height;
+ scratchOptions3.rotation = rotation;
+ scratchOptions3.extrudedHeight = extrudedHeight;
+ scratchOptions3.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new RectangleOutlineGeometry(scratchOptions3);
+ }
+ result._rectangle = Rectangle_default.clone(rectangle, result._rectangle);
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._surfaceHeight = height;
+ result._rotation = rotation;
+ result._extrudedHeight = extrudedHeight;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+var nwScratch = new Cartographic_default();
+RectangleOutlineGeometry.createGeometry = function(rectangleGeometry) {
+ const rectangle = rectangleGeometry._rectangle;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const computedOptions = RectangleGeometryLibrary_default.computeOptions(
+ rectangle,
+ rectangleGeometry._granularity,
+ rectangleGeometry._rotation,
+ 0,
+ rectangleScratch,
+ nwScratch
+ );
+ let geometry;
+ let boundingSphere;
+ if (Math_default.equalsEpsilon(
+ rectangle.north,
+ rectangle.south,
+ Math_default.EPSILON10
+ ) || Math_default.equalsEpsilon(
+ rectangle.east,
+ rectangle.west,
+ Math_default.EPSILON10
+ )) {
+ return void 0;
+ }
+ const surfaceHeight = rectangleGeometry._surfaceHeight;
+ const extrudedHeight = rectangleGeometry._extrudedHeight;
+ const extrude = !Math_default.equalsEpsilon(
+ surfaceHeight,
+ extrudedHeight,
+ 0,
+ Math_default.EPSILON2
+ );
+ let offsetValue;
+ if (extrude) {
+ geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);
+ if (defined_default(rectangleGeometry._offsetAttribute)) {
+ const size = geometry.attributes.position.values.length / 3;
+ let offsetAttribute = new Uint8Array(size);
+ if (rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else {
+ offsetValue = rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute
+ });
+ }
+ const topBS = BoundingSphere_default.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ surfaceHeight,
+ topBoundingSphere
+ );
+ const bottomBS = BoundingSphere_default.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ extrudedHeight,
+ bottomBoundingSphere
+ );
+ boundingSphere = BoundingSphere_default.union(topBS, bottomBS);
+ } else {
+ geometry = constructRectangle(rectangleGeometry, computedOptions);
+ geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
+ geometry.attributes.position.values,
+ surfaceHeight,
+ ellipsoid,
+ false
+ );
+ if (defined_default(rectangleGeometry._offsetAttribute)) {
+ const length3 = geometry.attributes.position.values.length;
+ offsetValue = rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ boundingSphere = BoundingSphere_default.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ surfaceHeight
+ );
+ }
+ return new Geometry_default({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: PrimitiveType_default.LINES,
+ boundingSphere,
+ offsetAttribute: rectangleGeometry._offsetAttribute
+ });
+};
+var RectangleOutlineGeometry_default = RectangleOutlineGeometry;
+
+// Source/Scene/TileBoundingRegion.js
+function TileBoundingRegion(options) {
+ Check_default.typeOf.object("options", options);
+ Check_default.typeOf.object("options.rectangle", options.rectangle);
+ this.rectangle = Rectangle_default.clone(options.rectangle);
+ this.minimumHeight = defaultValue_default(options.minimumHeight, 0);
+ this.maximumHeight = defaultValue_default(options.maximumHeight, 0);
+ this.southwestCornerCartesian = new Cartesian3_default();
+ this.northeastCornerCartesian = new Cartesian3_default();
+ this.westNormal = new Cartesian3_default();
+ this.southNormal = new Cartesian3_default();
+ this.eastNormal = new Cartesian3_default();
+ this.northNormal = new Cartesian3_default();
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ computeBox(this, options.rectangle, ellipsoid);
+ this._orientedBoundingBox = void 0;
+ this._boundingSphere = void 0;
+ if (defaultValue_default(options.computeBoundingVolumes, true)) {
+ this.computeBoundingVolumes(ellipsoid);
+ }
+}
+Object.defineProperties(TileBoundingRegion.prototype, {
+ boundingVolume: {
+ get: function() {
+ return this._orientedBoundingBox;
+ }
+ },
+ boundingSphere: {
+ get: function() {
+ return this._boundingSphere;
+ }
+ }
+});
+TileBoundingRegion.prototype.computeBoundingVolumes = function(ellipsoid) {
+ this._orientedBoundingBox = OrientedBoundingBox_default.fromRectangle(
+ this.rectangle,
+ this.minimumHeight,
+ this.maximumHeight,
+ ellipsoid
+ );
+ this._boundingSphere = BoundingSphere_default.fromOrientedBoundingBox(
+ this._orientedBoundingBox
+ );
+};
+var cartesian3Scratch = new Cartesian3_default();
+var cartesian3Scratch22 = new Cartesian3_default();
+var cartesian3Scratch32 = new Cartesian3_default();
+var westNormalScratch = new Cartesian3_default();
+var eastWestNormalScratch = new Cartesian3_default();
+var westernMidpointScratch = new Cartesian3_default();
+var easternMidpointScratch = new Cartesian3_default();
+var cartographicScratch2 = new Cartographic_default();
+var planeScratch = new Plane_default(Cartesian3_default.UNIT_X, 0);
+var rayScratch = new Ray_default();
+function computeBox(tileBB, rectangle, ellipsoid) {
+ ellipsoid.cartographicToCartesian(
+ Rectangle_default.southwest(rectangle),
+ tileBB.southwestCornerCartesian
+ );
+ ellipsoid.cartographicToCartesian(
+ Rectangle_default.northeast(rectangle),
+ tileBB.northeastCornerCartesian
+ );
+ cartographicScratch2.longitude = rectangle.west;
+ cartographicScratch2.latitude = (rectangle.south + rectangle.north) * 0.5;
+ cartographicScratch2.height = 0;
+ const westernMidpointCartesian = ellipsoid.cartographicToCartesian(
+ cartographicScratch2,
+ westernMidpointScratch
+ );
+ const westNormal = Cartesian3_default.cross(
+ westernMidpointCartesian,
+ Cartesian3_default.UNIT_Z,
+ westNormalScratch
+ );
+ Cartesian3_default.normalize(westNormal, tileBB.westNormal);
+ cartographicScratch2.longitude = rectangle.east;
+ const easternMidpointCartesian = ellipsoid.cartographicToCartesian(
+ cartographicScratch2,
+ easternMidpointScratch
+ );
+ const eastNormal = Cartesian3_default.cross(
+ Cartesian3_default.UNIT_Z,
+ easternMidpointCartesian,
+ cartesian3Scratch
+ );
+ Cartesian3_default.normalize(eastNormal, tileBB.eastNormal);
+ let westVector = Cartesian3_default.subtract(
+ westernMidpointCartesian,
+ easternMidpointCartesian,
+ cartesian3Scratch
+ );
+ if (Cartesian3_default.magnitude(westVector) === 0) {
+ westVector = Cartesian3_default.clone(westNormal, westVector);
+ }
+ const eastWestNormal = Cartesian3_default.normalize(
+ westVector,
+ eastWestNormalScratch
+ );
+ const south = rectangle.south;
+ let southSurfaceNormal;
+ if (south > 0) {
+ cartographicScratch2.longitude = (rectangle.west + rectangle.east) * 0.5;
+ cartographicScratch2.latitude = south;
+ const southCenterCartesian = ellipsoid.cartographicToCartesian(
+ cartographicScratch2,
+ rayScratch.origin
+ );
+ Cartesian3_default.clone(eastWestNormal, rayScratch.direction);
+ const westPlane = Plane_default.fromPointNormal(
+ tileBB.southwestCornerCartesian,
+ tileBB.westNormal,
+ planeScratch
+ );
+ IntersectionTests_default.rayPlane(
+ rayScratch,
+ westPlane,
+ tileBB.southwestCornerCartesian
+ );
+ southSurfaceNormal = ellipsoid.geodeticSurfaceNormal(
+ southCenterCartesian,
+ cartesian3Scratch22
+ );
+ } else {
+ southSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(
+ Rectangle_default.southeast(rectangle),
+ cartesian3Scratch22
+ );
+ }
+ const southNormal = Cartesian3_default.cross(
+ southSurfaceNormal,
+ westVector,
+ cartesian3Scratch32
+ );
+ Cartesian3_default.normalize(southNormal, tileBB.southNormal);
+ const north = rectangle.north;
+ let northSurfaceNormal;
+ if (north < 0) {
+ cartographicScratch2.longitude = (rectangle.west + rectangle.east) * 0.5;
+ cartographicScratch2.latitude = north;
+ const northCenterCartesian = ellipsoid.cartographicToCartesian(
+ cartographicScratch2,
+ rayScratch.origin
+ );
+ Cartesian3_default.negate(eastWestNormal, rayScratch.direction);
+ const eastPlane = Plane_default.fromPointNormal(
+ tileBB.northeastCornerCartesian,
+ tileBB.eastNormal,
+ planeScratch
+ );
+ IntersectionTests_default.rayPlane(
+ rayScratch,
+ eastPlane,
+ tileBB.northeastCornerCartesian
+ );
+ northSurfaceNormal = ellipsoid.geodeticSurfaceNormal(
+ northCenterCartesian,
+ cartesian3Scratch22
+ );
+ } else {
+ northSurfaceNormal = ellipsoid.geodeticSurfaceNormalCartographic(
+ Rectangle_default.northwest(rectangle),
+ cartesian3Scratch22
+ );
+ }
+ const northNormal = Cartesian3_default.cross(
+ westVector,
+ northSurfaceNormal,
+ cartesian3Scratch32
+ );
+ Cartesian3_default.normalize(northNormal, tileBB.northNormal);
+}
+var southwestCornerScratch = new Cartesian3_default();
+var northeastCornerScratch = new Cartesian3_default();
+var negativeUnitY = new Cartesian3_default(0, -1, 0);
+var negativeUnitZ = new Cartesian3_default(0, 0, -1);
+var vectorScratch = new Cartesian3_default();
+function distanceToCameraRegion(tileBB, frameState) {
+ const camera = frameState.camera;
+ const cameraCartesianPosition = camera.positionWC;
+ const cameraCartographicPosition = camera.positionCartographic;
+ let result = 0;
+ if (!Rectangle_default.contains(tileBB.rectangle, cameraCartographicPosition)) {
+ let southwestCornerCartesian = tileBB.southwestCornerCartesian;
+ let northeastCornerCartesian = tileBB.northeastCornerCartesian;
+ let westNormal = tileBB.westNormal;
+ let southNormal = tileBB.southNormal;
+ let eastNormal = tileBB.eastNormal;
+ let northNormal = tileBB.northNormal;
+ if (frameState.mode !== SceneMode_default.SCENE3D) {
+ southwestCornerCartesian = frameState.mapProjection.project(
+ Rectangle_default.southwest(tileBB.rectangle),
+ southwestCornerScratch
+ );
+ southwestCornerCartesian.z = southwestCornerCartesian.y;
+ southwestCornerCartesian.y = southwestCornerCartesian.x;
+ southwestCornerCartesian.x = 0;
+ northeastCornerCartesian = frameState.mapProjection.project(
+ Rectangle_default.northeast(tileBB.rectangle),
+ northeastCornerScratch
+ );
+ northeastCornerCartesian.z = northeastCornerCartesian.y;
+ northeastCornerCartesian.y = northeastCornerCartesian.x;
+ northeastCornerCartesian.x = 0;
+ westNormal = negativeUnitY;
+ eastNormal = Cartesian3_default.UNIT_Y;
+ southNormal = negativeUnitZ;
+ northNormal = Cartesian3_default.UNIT_Z;
+ }
+ const vectorFromSouthwestCorner = Cartesian3_default.subtract(
+ cameraCartesianPosition,
+ southwestCornerCartesian,
+ vectorScratch
+ );
+ const distanceToWestPlane = Cartesian3_default.dot(
+ vectorFromSouthwestCorner,
+ westNormal
+ );
+ const distanceToSouthPlane = Cartesian3_default.dot(
+ vectorFromSouthwestCorner,
+ southNormal
+ );
+ const vectorFromNortheastCorner = Cartesian3_default.subtract(
+ cameraCartesianPosition,
+ northeastCornerCartesian,
+ vectorScratch
+ );
+ const distanceToEastPlane = Cartesian3_default.dot(
+ vectorFromNortheastCorner,
+ eastNormal
+ );
+ const distanceToNorthPlane = Cartesian3_default.dot(
+ vectorFromNortheastCorner,
+ northNormal
+ );
+ if (distanceToWestPlane > 0) {
+ result += distanceToWestPlane * distanceToWestPlane;
+ } else if (distanceToEastPlane > 0) {
+ result += distanceToEastPlane * distanceToEastPlane;
+ }
+ if (distanceToSouthPlane > 0) {
+ result += distanceToSouthPlane * distanceToSouthPlane;
+ } else if (distanceToNorthPlane > 0) {
+ result += distanceToNorthPlane * distanceToNorthPlane;
+ }
+ }
+ let cameraHeight;
+ let minimumHeight;
+ let maximumHeight;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ cameraHeight = cameraCartographicPosition.height;
+ minimumHeight = tileBB.minimumHeight;
+ maximumHeight = tileBB.maximumHeight;
+ } else {
+ cameraHeight = cameraCartesianPosition.x;
+ minimumHeight = 0;
+ maximumHeight = 0;
+ }
+ if (cameraHeight > maximumHeight) {
+ const distanceAboveTop = cameraHeight - maximumHeight;
+ result += distanceAboveTop * distanceAboveTop;
+ } else if (cameraHeight < minimumHeight) {
+ const distanceBelowBottom = minimumHeight - cameraHeight;
+ result += distanceBelowBottom * distanceBelowBottom;
+ }
+ return Math.sqrt(result);
+}
+TileBoundingRegion.prototype.distanceToCamera = function(frameState) {
+ Check_default.defined("frameState", frameState);
+ const regionResult = distanceToCameraRegion(this, frameState);
+ if (frameState.mode === SceneMode_default.SCENE3D && defined_default(this._orientedBoundingBox)) {
+ const obbResult = Math.sqrt(
+ this._orientedBoundingBox.distanceSquaredTo(frameState.camera.positionWC)
+ );
+ return Math.max(regionResult, obbResult);
+ }
+ return regionResult;
+};
+TileBoundingRegion.prototype.intersectPlane = function(plane) {
+ Check_default.defined("plane", plane);
+ return this._orientedBoundingBox.intersectPlane(plane);
+};
+TileBoundingRegion.prototype.createDebugVolume = function(color) {
+ Check_default.defined("color", color);
+ const modelMatrix = new Matrix4_default.clone(Matrix4_default.IDENTITY);
+ const geometry = new RectangleOutlineGeometry_default({
+ rectangle: this.rectangle,
+ height: this.minimumHeight,
+ extrudedHeight: this.maximumHeight
+ });
+ const instance = new GeometryInstance_default({
+ geometry,
+ id: "outline",
+ modelMatrix,
+ attributes: {
+ color: ColorGeometryInstanceAttribute_default.fromColor(color)
+ }
+ });
+ return new Primitive_default({
+ geometryInstances: instance,
+ appearance: new PerInstanceColorAppearance_default({
+ translucent: false,
+ flat: true
+ }),
+ asynchronous: false
+ });
+};
+var TileBoundingRegion_default = TileBoundingRegion;
+
+// Source/Core/CoplanarPolygonGeometryLibrary.js
+var CoplanarPolygonGeometryLibrary = {};
+var scratchIntersectionPoint = new Cartesian3_default();
+var scratchXAxis2 = new Cartesian3_default();
+var scratchYAxis2 = new Cartesian3_default();
+var scratchZAxis2 = new Cartesian3_default();
+var obbScratch = new OrientedBoundingBox_default();
+CoplanarPolygonGeometryLibrary.validOutline = function(positions) {
+ Check_default.defined("positions", positions);
+ const orientedBoundingBox = OrientedBoundingBox_default.fromPoints(
+ positions,
+ obbScratch
+ );
+ const halfAxes = orientedBoundingBox.halfAxes;
+ const xAxis = Matrix3_default.getColumn(halfAxes, 0, scratchXAxis2);
+ const yAxis = Matrix3_default.getColumn(halfAxes, 1, scratchYAxis2);
+ const zAxis = Matrix3_default.getColumn(halfAxes, 2, scratchZAxis2);
+ const xMag = Cartesian3_default.magnitude(xAxis);
+ const yMag = Cartesian3_default.magnitude(yAxis);
+ const zMag = Cartesian3_default.magnitude(zAxis);
+ return !(xMag === 0 && (yMag === 0 || zMag === 0) || yMag === 0 && zMag === 0);
+};
+CoplanarPolygonGeometryLibrary.computeProjectTo2DArguments = function(positions, centerResult, planeAxis1Result, planeAxis2Result) {
+ Check_default.defined("positions", positions);
+ Check_default.defined("centerResult", centerResult);
+ Check_default.defined("planeAxis1Result", planeAxis1Result);
+ Check_default.defined("planeAxis2Result", planeAxis2Result);
+ const orientedBoundingBox = OrientedBoundingBox_default.fromPoints(
+ positions,
+ obbScratch
+ );
+ const halfAxes = orientedBoundingBox.halfAxes;
+ const xAxis = Matrix3_default.getColumn(halfAxes, 0, scratchXAxis2);
+ const yAxis = Matrix3_default.getColumn(halfAxes, 1, scratchYAxis2);
+ const zAxis = Matrix3_default.getColumn(halfAxes, 2, scratchZAxis2);
+ const xMag = Cartesian3_default.magnitude(xAxis);
+ const yMag = Cartesian3_default.magnitude(yAxis);
+ const zMag = Cartesian3_default.magnitude(zAxis);
+ const min3 = Math.min(xMag, yMag, zMag);
+ if (xMag === 0 && (yMag === 0 || zMag === 0) || yMag === 0 && zMag === 0) {
+ return false;
+ }
+ let planeAxis1;
+ let planeAxis2;
+ if (min3 === yMag || min3 === zMag) {
+ planeAxis1 = xAxis;
+ }
+ if (min3 === xMag) {
+ planeAxis1 = yAxis;
+ } else if (min3 === zMag) {
+ planeAxis2 = yAxis;
+ }
+ if (min3 === xMag || min3 === yMag) {
+ planeAxis2 = zAxis;
+ }
+ Cartesian3_default.normalize(planeAxis1, planeAxis1Result);
+ Cartesian3_default.normalize(planeAxis2, planeAxis2Result);
+ Cartesian3_default.clone(orientedBoundingBox.center, centerResult);
+ return true;
+};
+function projectTo2D(position, center, axis1, axis2, result) {
+ const v7 = Cartesian3_default.subtract(position, center, scratchIntersectionPoint);
+ const x = Cartesian3_default.dot(axis1, v7);
+ const y = Cartesian3_default.dot(axis2, v7);
+ return Cartesian2_default.fromElements(x, y, result);
+}
+CoplanarPolygonGeometryLibrary.createProjectPointsTo2DFunction = function(center, axis1, axis2) {
+ return function(positions) {
+ const positionResults = new Array(positions.length);
+ for (let i = 0; i < positions.length; i++) {
+ positionResults[i] = projectTo2D(positions[i], center, axis1, axis2);
+ }
+ return positionResults;
+ };
+};
+CoplanarPolygonGeometryLibrary.createProjectPointTo2DFunction = function(center, axis1, axis2) {
+ return function(position, result) {
+ return projectTo2D(position, center, axis1, axis2, result);
+ };
+};
+var CoplanarPolygonGeometryLibrary_default = CoplanarPolygonGeometryLibrary;
+
+// Source/Core/Queue.js
+function Queue() {
+ this._array = [];
+ this._offset = 0;
+ this._length = 0;
+}
+Object.defineProperties(Queue.prototype, {
+ length: {
+ get: function() {
+ return this._length;
+ }
+ }
+});
+Queue.prototype.enqueue = function(item) {
+ this._array.push(item);
+ this._length++;
+};
+Queue.prototype.dequeue = function() {
+ if (this._length === 0) {
+ return void 0;
+ }
+ const array = this._array;
+ let offset2 = this._offset;
+ const item = array[offset2];
+ array[offset2] = void 0;
+ offset2++;
+ if (offset2 > 10 && offset2 * 2 > array.length) {
+ this._array = array.slice(offset2);
+ offset2 = 0;
+ }
+ this._offset = offset2;
+ this._length--;
+ return item;
+};
+Queue.prototype.peek = function() {
+ if (this._length === 0) {
+ return void 0;
+ }
+ return this._array[this._offset];
+};
+Queue.prototype.contains = function(item) {
+ return this._array.indexOf(item) !== -1;
+};
+Queue.prototype.clear = function() {
+ this._array.length = this._offset = this._length = 0;
+};
+Queue.prototype.sort = function(compareFunction) {
+ if (this._offset > 0) {
+ this._array = this._array.slice(this._offset);
+ this._offset = 0;
+ }
+ this._array.sort(compareFunction);
+};
+var Queue_default = Queue;
+
+// Source/Core/PolygonGeometryLibrary.js
+var PolygonGeometryLibrary = {};
+PolygonGeometryLibrary.computeHierarchyPackedLength = function(polygonHierarchy, CartesianX) {
+ let numComponents = 0;
+ const stack = [polygonHierarchy];
+ while (stack.length > 0) {
+ const hierarchy = stack.pop();
+ if (!defined_default(hierarchy)) {
+ continue;
+ }
+ numComponents += 2;
+ const positions = hierarchy.positions;
+ const holes = hierarchy.holes;
+ if (defined_default(positions) && positions.length > 0) {
+ numComponents += positions.length * CartesianX.packedLength;
+ }
+ if (defined_default(holes)) {
+ const length3 = holes.length;
+ for (let i = 0; i < length3; ++i) {
+ stack.push(holes[i]);
+ }
+ }
+ }
+ return numComponents;
+};
+PolygonGeometryLibrary.packPolygonHierarchy = function(polygonHierarchy, array, startingIndex, CartesianX) {
+ const stack = [polygonHierarchy];
+ while (stack.length > 0) {
+ const hierarchy = stack.pop();
+ if (!defined_default(hierarchy)) {
+ continue;
+ }
+ const positions = hierarchy.positions;
+ const holes = hierarchy.holes;
+ array[startingIndex++] = defined_default(positions) ? positions.length : 0;
+ array[startingIndex++] = defined_default(holes) ? holes.length : 0;
+ if (defined_default(positions)) {
+ const positionsLength = positions.length;
+ for (let i = 0; i < positionsLength; ++i, startingIndex += CartesianX.packedLength) {
+ CartesianX.pack(positions[i], array, startingIndex);
+ }
+ }
+ if (defined_default(holes)) {
+ const holesLength = holes.length;
+ for (let j = 0; j < holesLength; ++j) {
+ stack.push(holes[j]);
+ }
+ }
+ }
+ return startingIndex;
+};
+PolygonGeometryLibrary.unpackPolygonHierarchy = function(array, startingIndex, CartesianX) {
+ const positionsLength = array[startingIndex++];
+ const holesLength = array[startingIndex++];
+ const positions = new Array(positionsLength);
+ const holes = holesLength > 0 ? new Array(holesLength) : void 0;
+ for (let i = 0; i < positionsLength; ++i, startingIndex += CartesianX.packedLength) {
+ positions[i] = CartesianX.unpack(array, startingIndex);
+ }
+ for (let j = 0; j < holesLength; ++j) {
+ holes[j] = PolygonGeometryLibrary.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ CartesianX
+ );
+ startingIndex = holes[j].startingIndex;
+ delete holes[j].startingIndex;
+ }
+ return {
+ positions,
+ holes,
+ startingIndex
+ };
+};
+var distance2DScratch = new Cartesian2_default();
+function getPointAtDistance2D(p0, p1, distance2, length3) {
+ Cartesian2_default.subtract(p1, p0, distance2DScratch);
+ Cartesian2_default.multiplyByScalar(
+ distance2DScratch,
+ distance2 / length3,
+ distance2DScratch
+ );
+ Cartesian2_default.add(p0, distance2DScratch, distance2DScratch);
+ return [distance2DScratch.x, distance2DScratch.y];
+}
+var distanceScratch4 = new Cartesian3_default();
+function getPointAtDistance(p0, p1, distance2, length3) {
+ Cartesian3_default.subtract(p1, p0, distanceScratch4);
+ Cartesian3_default.multiplyByScalar(
+ distanceScratch4,
+ distance2 / length3,
+ distanceScratch4
+ );
+ Cartesian3_default.add(p0, distanceScratch4, distanceScratch4);
+ return [distanceScratch4.x, distanceScratch4.y, distanceScratch4.z];
+}
+PolygonGeometryLibrary.subdivideLineCount = function(p0, p1, minDistance) {
+ const distance2 = Cartesian3_default.distance(p0, p1);
+ const n = distance2 / minDistance;
+ const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
+ return Math.pow(2, countDivide);
+};
+var scratchCartographic02 = new Cartographic_default();
+var scratchCartographic12 = new Cartographic_default();
+var scratchCartographic22 = new Cartographic_default();
+var scratchCartesian0 = new Cartesian3_default();
+var scratchRhumbLine = new EllipsoidRhumbLine_default();
+PolygonGeometryLibrary.subdivideRhumbLineCount = function(ellipsoid, p0, p1, minDistance) {
+ const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic02);
+ const c14 = ellipsoid.cartesianToCartographic(p1, scratchCartographic12);
+ const rhumb = new EllipsoidRhumbLine_default(c0, c14, ellipsoid);
+ const n = rhumb.surfaceDistance / minDistance;
+ const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
+ return Math.pow(2, countDivide);
+};
+PolygonGeometryLibrary.subdivideTexcoordLine = function(t0, t1, p0, p1, minDistance, result) {
+ const subdivisions = PolygonGeometryLibrary.subdivideLineCount(
+ p0,
+ p1,
+ minDistance
+ );
+ const length2D = Cartesian2_default.distance(t0, t1);
+ const distanceBetweenCoords = length2D / subdivisions;
+ const texcoords = result;
+ texcoords.length = subdivisions * 2;
+ let index = 0;
+ for (let i = 0; i < subdivisions; i++) {
+ const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);
+ texcoords[index++] = t[0];
+ texcoords[index++] = t[1];
+ }
+ return texcoords;
+};
+PolygonGeometryLibrary.subdivideLine = function(p0, p1, minDistance, result) {
+ const numVertices = PolygonGeometryLibrary.subdivideLineCount(
+ p0,
+ p1,
+ minDistance
+ );
+ const length3 = Cartesian3_default.distance(p0, p1);
+ const distanceBetweenVertices = length3 / numVertices;
+ if (!defined_default(result)) {
+ result = [];
+ }
+ const positions = result;
+ positions.length = numVertices * 3;
+ let index = 0;
+ for (let i = 0; i < numVertices; i++) {
+ const p = getPointAtDistance(p0, p1, i * distanceBetweenVertices, length3);
+ positions[index++] = p[0];
+ positions[index++] = p[1];
+ positions[index++] = p[2];
+ }
+ return positions;
+};
+PolygonGeometryLibrary.subdivideTexcoordRhumbLine = function(t0, t1, ellipsoid, p0, p1, minDistance, result) {
+ const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic02);
+ const c14 = ellipsoid.cartesianToCartographic(p1, scratchCartographic12);
+ scratchRhumbLine.setEndPoints(c0, c14);
+ const n = scratchRhumbLine.surfaceDistance / minDistance;
+ const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
+ const subdivisions = Math.pow(2, countDivide);
+ const length2D = Cartesian2_default.distance(t0, t1);
+ const distanceBetweenCoords = length2D / subdivisions;
+ const texcoords = result;
+ texcoords.length = subdivisions * 2;
+ let index = 0;
+ for (let i = 0; i < subdivisions; i++) {
+ const t = getPointAtDistance2D(t0, t1, i * distanceBetweenCoords, length2D);
+ texcoords[index++] = t[0];
+ texcoords[index++] = t[1];
+ }
+ return texcoords;
+};
+PolygonGeometryLibrary.subdivideRhumbLine = function(ellipsoid, p0, p1, minDistance, result) {
+ const c0 = ellipsoid.cartesianToCartographic(p0, scratchCartographic02);
+ const c14 = ellipsoid.cartesianToCartographic(p1, scratchCartographic12);
+ const rhumb = new EllipsoidRhumbLine_default(c0, c14, ellipsoid);
+ const n = rhumb.surfaceDistance / minDistance;
+ const countDivide = Math.max(0, Math.ceil(Math_default.log2(n)));
+ const numVertices = Math.pow(2, countDivide);
+ const distanceBetweenVertices = rhumb.surfaceDistance / numVertices;
+ if (!defined_default(result)) {
+ result = [];
+ }
+ const positions = result;
+ positions.length = numVertices * 3;
+ let index = 0;
+ for (let i = 0; i < numVertices; i++) {
+ const c = rhumb.interpolateUsingSurfaceDistance(
+ i * distanceBetweenVertices,
+ scratchCartographic22
+ );
+ const p = ellipsoid.cartographicToCartesian(c, scratchCartesian0);
+ positions[index++] = p.x;
+ positions[index++] = p.y;
+ positions[index++] = p.z;
+ }
+ return positions;
+};
+var scaleToGeodeticHeightN1 = new Cartesian3_default();
+var scaleToGeodeticHeightN2 = new Cartesian3_default();
+var scaleToGeodeticHeightP1 = new Cartesian3_default();
+var scaleToGeodeticHeightP2 = new Cartesian3_default();
+PolygonGeometryLibrary.scaleToGeodeticHeightExtruded = function(geometry, maxHeight, minHeight, ellipsoid, perPositionHeight) {
+ ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ const n1 = scaleToGeodeticHeightN1;
+ let n2 = scaleToGeodeticHeightN2;
+ const p = scaleToGeodeticHeightP1;
+ let p2 = scaleToGeodeticHeightP2;
+ if (defined_default(geometry) && defined_default(geometry.attributes) && defined_default(geometry.attributes.position)) {
+ const positions = geometry.attributes.position.values;
+ const length3 = positions.length / 2;
+ for (let i = 0; i < length3; i += 3) {
+ Cartesian3_default.fromArray(positions, i, p);
+ ellipsoid.geodeticSurfaceNormal(p, n1);
+ p2 = ellipsoid.scaleToGeodeticSurface(p, p2);
+ n2 = Cartesian3_default.multiplyByScalar(n1, minHeight, n2);
+ n2 = Cartesian3_default.add(p2, n2, n2);
+ positions[i + length3] = n2.x;
+ positions[i + 1 + length3] = n2.y;
+ positions[i + 2 + length3] = n2.z;
+ if (perPositionHeight) {
+ p2 = Cartesian3_default.clone(p, p2);
+ }
+ n2 = Cartesian3_default.multiplyByScalar(n1, maxHeight, n2);
+ n2 = Cartesian3_default.add(p2, n2, n2);
+ positions[i] = n2.x;
+ positions[i + 1] = n2.y;
+ positions[i + 2] = n2.z;
+ }
+ }
+ return geometry;
+};
+PolygonGeometryLibrary.polygonOutlinesFromHierarchy = function(polygonHierarchy, scaleToEllipsoidSurface, ellipsoid) {
+ const polygons = [];
+ const queue = new Queue_default();
+ queue.enqueue(polygonHierarchy);
+ let i;
+ let j;
+ let length3;
+ while (queue.length !== 0) {
+ const outerNode = queue.dequeue();
+ let outerRing = outerNode.positions;
+ if (scaleToEllipsoidSurface) {
+ length3 = outerRing.length;
+ for (i = 0; i < length3; i++) {
+ ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
+ }
+ }
+ outerRing = arrayRemoveDuplicates_default(
+ outerRing,
+ Cartesian3_default.equalsEpsilon,
+ true
+ );
+ if (outerRing.length < 3) {
+ continue;
+ }
+ const numChildren = outerNode.holes ? outerNode.holes.length : 0;
+ for (i = 0; i < numChildren; i++) {
+ const hole = outerNode.holes[i];
+ let holePositions = hole.positions;
+ if (scaleToEllipsoidSurface) {
+ length3 = holePositions.length;
+ for (j = 0; j < length3; ++j) {
+ ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
+ }
+ }
+ holePositions = arrayRemoveDuplicates_default(
+ holePositions,
+ Cartesian3_default.equalsEpsilon,
+ true
+ );
+ if (holePositions.length < 3) {
+ continue;
+ }
+ polygons.push(holePositions);
+ let numGrandchildren = 0;
+ if (defined_default(hole.holes)) {
+ numGrandchildren = hole.holes.length;
+ }
+ for (j = 0; j < numGrandchildren; j++) {
+ queue.enqueue(hole.holes[j]);
+ }
+ }
+ polygons.push(outerRing);
+ }
+ return polygons;
+};
+PolygonGeometryLibrary.polygonsFromHierarchy = function(polygonHierarchy, keepDuplicates, projectPointsTo2D, scaleToEllipsoidSurface, ellipsoid) {
+ const hierarchy = [];
+ const polygons = [];
+ const queue = new Queue_default();
+ queue.enqueue(polygonHierarchy);
+ while (queue.length !== 0) {
+ const outerNode = queue.dequeue();
+ let outerRing = outerNode.positions;
+ const holes = outerNode.holes;
+ let i;
+ let length3;
+ if (scaleToEllipsoidSurface) {
+ length3 = outerRing.length;
+ for (i = 0; i < length3; i++) {
+ ellipsoid.scaleToGeodeticSurface(outerRing[i], outerRing[i]);
+ }
+ }
+ if (!keepDuplicates) {
+ outerRing = arrayRemoveDuplicates_default(
+ outerRing,
+ Cartesian3_default.equalsEpsilon,
+ true
+ );
+ }
+ if (outerRing.length < 3) {
+ continue;
+ }
+ let positions2D = projectPointsTo2D(outerRing);
+ if (!defined_default(positions2D)) {
+ continue;
+ }
+ const holeIndices = [];
+ let originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(
+ positions2D
+ );
+ if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
+ positions2D.reverse();
+ outerRing = outerRing.slice().reverse();
+ }
+ let positions = outerRing.slice();
+ const numChildren = defined_default(holes) ? holes.length : 0;
+ const polygonHoles = [];
+ let j;
+ for (i = 0; i < numChildren; i++) {
+ const hole = holes[i];
+ let holePositions = hole.positions;
+ if (scaleToEllipsoidSurface) {
+ length3 = holePositions.length;
+ for (j = 0; j < length3; ++j) {
+ ellipsoid.scaleToGeodeticSurface(holePositions[j], holePositions[j]);
+ }
+ }
+ if (!keepDuplicates) {
+ holePositions = arrayRemoveDuplicates_default(
+ holePositions,
+ Cartesian3_default.equalsEpsilon,
+ true
+ );
+ }
+ if (holePositions.length < 3) {
+ continue;
+ }
+ const holePositions2D = projectPointsTo2D(holePositions);
+ if (!defined_default(holePositions2D)) {
+ continue;
+ }
+ originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(
+ holePositions2D
+ );
+ if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
+ holePositions2D.reverse();
+ holePositions = holePositions.slice().reverse();
+ }
+ polygonHoles.push(holePositions);
+ holeIndices.push(positions.length);
+ positions = positions.concat(holePositions);
+ positions2D = positions2D.concat(holePositions2D);
+ let numGrandchildren = 0;
+ if (defined_default(hole.holes)) {
+ numGrandchildren = hole.holes.length;
+ }
+ for (j = 0; j < numGrandchildren; j++) {
+ queue.enqueue(hole.holes[j]);
+ }
+ }
+ hierarchy.push({
+ outerRing,
+ holes: polygonHoles
+ });
+ polygons.push({
+ positions,
+ positions2D,
+ holes: holeIndices
+ });
+ }
+ return {
+ hierarchy,
+ polygons
+ };
+};
+var computeBoundingRectangleCartesian2 = new Cartesian2_default();
+var computeBoundingRectangleCartesian3 = new Cartesian3_default();
+var computeBoundingRectangleQuaternion = new Quaternion_default();
+var computeBoundingRectangleMatrix3 = new Matrix3_default();
+PolygonGeometryLibrary.computeBoundingRectangle = function(planeNormal, projectPointTo2D, positions, angle, result) {
+ const rotation = Quaternion_default.fromAxisAngle(
+ planeNormal,
+ angle,
+ computeBoundingRectangleQuaternion
+ );
+ const textureMatrix = Matrix3_default.fromQuaternion(
+ rotation,
+ computeBoundingRectangleMatrix3
+ );
+ let minX = Number.POSITIVE_INFINITY;
+ let maxX = Number.NEGATIVE_INFINITY;
+ let minY = Number.POSITIVE_INFINITY;
+ let maxY = Number.NEGATIVE_INFINITY;
+ const length3 = positions.length;
+ for (let i = 0; i < length3; ++i) {
+ const p = Cartesian3_default.clone(
+ positions[i],
+ computeBoundingRectangleCartesian3
+ );
+ Matrix3_default.multiplyByVector(textureMatrix, p, p);
+ const st = projectPointTo2D(p, computeBoundingRectangleCartesian2);
+ if (defined_default(st)) {
+ minX = Math.min(minX, st.x);
+ maxX = Math.max(maxX, st.x);
+ minY = Math.min(minY, st.y);
+ maxY = Math.max(maxY, st.y);
+ }
+ }
+ result.x = minX;
+ result.y = minY;
+ result.width = maxX - minX;
+ result.height = maxY - minY;
+ return result;
+};
+PolygonGeometryLibrary.createGeometryFromPositions = function(ellipsoid, polygon, textureCoordinates, granularity, perPositionHeight, vertexFormat, arcType) {
+ let indices2 = PolygonPipeline_default.triangulate(polygon.positions2D, polygon.holes);
+ if (indices2.length < 3) {
+ indices2 = [0, 1, 2];
+ }
+ const positions = polygon.positions;
+ const hasTexcoords = defined_default(textureCoordinates);
+ const texcoords = hasTexcoords ? textureCoordinates.positions : void 0;
+ if (perPositionHeight) {
+ const length3 = positions.length;
+ const flattenedPositions = new Array(length3 * 3);
+ let index = 0;
+ for (let i = 0; i < length3; i++) {
+ const p = positions[i];
+ flattenedPositions[index++] = p.x;
+ flattenedPositions[index++] = p.y;
+ flattenedPositions[index++] = p.z;
+ }
+ const geometryOptions = {
+ attributes: {
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: flattenedPositions
+ })
+ },
+ indices: indices2,
+ primitiveType: PrimitiveType_default.TRIANGLES
+ };
+ if (hasTexcoords) {
+ geometryOptions.attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: Cartesian2_default.packArray(texcoords)
+ });
+ }
+ const geometry = new Geometry_default(geometryOptions);
+ if (vertexFormat.normal) {
+ return GeometryPipeline_default.computeNormal(geometry);
+ }
+ return geometry;
+ }
+ if (arcType === ArcType_default.GEODESIC) {
+ return PolygonPipeline_default.computeSubdivision(
+ ellipsoid,
+ positions,
+ indices2,
+ texcoords,
+ granularity
+ );
+ } else if (arcType === ArcType_default.RHUMB) {
+ return PolygonPipeline_default.computeRhumbLineSubdivision(
+ ellipsoid,
+ positions,
+ indices2,
+ texcoords,
+ granularity
+ );
+ }
+};
+var computeWallTexcoordsSubdivided = [];
+var computeWallIndicesSubdivided = [];
+var p1Scratch2 = new Cartesian3_default();
+var p2Scratch2 = new Cartesian3_default();
+PolygonGeometryLibrary.computeWallGeometry = function(positions, textureCoordinates, ellipsoid, granularity, perPositionHeight, arcType) {
+ let edgePositions;
+ let topEdgeLength;
+ let i;
+ let p1;
+ let p2;
+ let t1;
+ let t2;
+ let edgeTexcoords;
+ let topEdgeTexcoordLength;
+ let length3 = positions.length;
+ let index = 0;
+ let textureIndex = 0;
+ const hasTexcoords = defined_default(textureCoordinates);
+ const texcoords = hasTexcoords ? textureCoordinates.positions : void 0;
+ if (!perPositionHeight) {
+ const minDistance = Math_default.chordLength(
+ granularity,
+ ellipsoid.maximumRadius
+ );
+ let numVertices = 0;
+ if (arcType === ArcType_default.GEODESIC) {
+ for (i = 0; i < length3; i++) {
+ numVertices += PolygonGeometryLibrary.subdivideLineCount(
+ positions[i],
+ positions[(i + 1) % length3],
+ minDistance
+ );
+ }
+ } else if (arcType === ArcType_default.RHUMB) {
+ for (i = 0; i < length3; i++) {
+ numVertices += PolygonGeometryLibrary.subdivideRhumbLineCount(
+ ellipsoid,
+ positions[i],
+ positions[(i + 1) % length3],
+ minDistance
+ );
+ }
+ }
+ topEdgeLength = (numVertices + length3) * 3;
+ edgePositions = new Array(topEdgeLength * 2);
+ if (hasTexcoords) {
+ topEdgeTexcoordLength = (numVertices + length3) * 2;
+ edgeTexcoords = new Array(topEdgeTexcoordLength * 2);
+ }
+ for (i = 0; i < length3; i++) {
+ p1 = positions[i];
+ p2 = positions[(i + 1) % length3];
+ let tempPositions;
+ let tempTexcoords;
+ if (hasTexcoords) {
+ t1 = texcoords[i];
+ t2 = texcoords[(i + 1) % length3];
+ }
+ if (arcType === ArcType_default.GEODESIC) {
+ tempPositions = PolygonGeometryLibrary.subdivideLine(
+ p1,
+ p2,
+ minDistance,
+ computeWallIndicesSubdivided
+ );
+ if (hasTexcoords) {
+ tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordLine(
+ t1,
+ t2,
+ p1,
+ p2,
+ minDistance,
+ computeWallTexcoordsSubdivided
+ );
+ }
+ } else if (arcType === ArcType_default.RHUMB) {
+ tempPositions = PolygonGeometryLibrary.subdivideRhumbLine(
+ ellipsoid,
+ p1,
+ p2,
+ minDistance,
+ computeWallIndicesSubdivided
+ );
+ if (hasTexcoords) {
+ tempTexcoords = PolygonGeometryLibrary.subdivideTexcoordRhumbLine(
+ t1,
+ t2,
+ ellipsoid,
+ p1,
+ p2,
+ minDistance,
+ computeWallTexcoordsSubdivided
+ );
+ }
+ }
+ const tempPositionsLength = tempPositions.length;
+ for (let j = 0; j < tempPositionsLength; ++j, ++index) {
+ edgePositions[index] = tempPositions[j];
+ edgePositions[index + topEdgeLength] = tempPositions[j];
+ }
+ edgePositions[index] = p2.x;
+ edgePositions[index + topEdgeLength] = p2.x;
+ ++index;
+ edgePositions[index] = p2.y;
+ edgePositions[index + topEdgeLength] = p2.y;
+ ++index;
+ edgePositions[index] = p2.z;
+ edgePositions[index + topEdgeLength] = p2.z;
+ ++index;
+ if (hasTexcoords) {
+ const tempTexcoordsLength = tempTexcoords.length;
+ for (let k = 0; k < tempTexcoordsLength; ++k, ++textureIndex) {
+ edgeTexcoords[textureIndex] = tempTexcoords[k];
+ edgeTexcoords[textureIndex + topEdgeTexcoordLength] = tempTexcoords[k];
+ }
+ edgeTexcoords[textureIndex] = t2.x;
+ edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;
+ ++textureIndex;
+ edgeTexcoords[textureIndex] = t2.y;
+ edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;
+ ++textureIndex;
+ }
+ }
+ } else {
+ topEdgeLength = length3 * 3 * 2;
+ edgePositions = new Array(topEdgeLength * 2);
+ if (hasTexcoords) {
+ topEdgeTexcoordLength = length3 * 2 * 2;
+ edgeTexcoords = new Array(topEdgeTexcoordLength * 2);
+ }
+ for (i = 0; i < length3; i++) {
+ p1 = positions[i];
+ p2 = positions[(i + 1) % length3];
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p1.x;
+ ++index;
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p1.y;
+ ++index;
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p1.z;
+ ++index;
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p2.x;
+ ++index;
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p2.y;
+ ++index;
+ edgePositions[index] = edgePositions[index + topEdgeLength] = p2.z;
+ ++index;
+ if (hasTexcoords) {
+ t1 = texcoords[i];
+ t2 = texcoords[(i + 1) % length3];
+ edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t1.x;
+ ++textureIndex;
+ edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t1.y;
+ ++textureIndex;
+ edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.x;
+ ++textureIndex;
+ edgeTexcoords[textureIndex] = edgeTexcoords[textureIndex + topEdgeTexcoordLength] = t2.y;
+ ++textureIndex;
+ }
+ }
+ }
+ length3 = edgePositions.length;
+ const indices2 = IndexDatatype_default.createTypedArray(
+ length3 / 3,
+ length3 - positions.length * 6
+ );
+ let edgeIndex = 0;
+ length3 /= 6;
+ for (i = 0; i < length3; i++) {
+ const UL = i;
+ const UR = UL + 1;
+ const LL = UL + length3;
+ const LR = LL + 1;
+ p1 = Cartesian3_default.fromArray(edgePositions, UL * 3, p1Scratch2);
+ p2 = Cartesian3_default.fromArray(edgePositions, UR * 3, p2Scratch2);
+ if (Cartesian3_default.equalsEpsilon(
+ p1,
+ p2,
+ Math_default.EPSILON10,
+ Math_default.EPSILON10
+ )) {
+ continue;
+ }
+ indices2[edgeIndex++] = UL;
+ indices2[edgeIndex++] = LL;
+ indices2[edgeIndex++] = UR;
+ indices2[edgeIndex++] = UR;
+ indices2[edgeIndex++] = LL;
+ indices2[edgeIndex++] = LR;
+ }
+ const geometryOptions = {
+ attributes: new GeometryAttributes_default({
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: edgePositions
+ })
+ }),
+ indices: indices2,
+ primitiveType: PrimitiveType_default.TRIANGLES
+ };
+ if (hasTexcoords) {
+ geometryOptions.attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: edgeTexcoords
+ });
+ }
+ const geometry = new Geometry_default(geometryOptions);
+ return geometry;
+};
+var PolygonGeometryLibrary_default = PolygonGeometryLibrary;
+
+// Source/Core/CoplanarPolygonOutlineGeometry.js
+function createGeometryFromPositions(positions) {
+ const length3 = positions.length;
+ const flatPositions2 = new Float64Array(length3 * 3);
+ const indices2 = IndexDatatype_default.createTypedArray(length3, length3 * 2);
+ let positionIndex = 0;
+ let index = 0;
+ for (let i = 0; i < length3; i++) {
+ const position = positions[i];
+ flatPositions2[positionIndex++] = position.x;
+ flatPositions2[positionIndex++] = position.y;
+ flatPositions2[positionIndex++] = position.z;
+ indices2[index++] = i;
+ indices2[index++] = (i + 1) % length3;
+ }
+ const attributes = new GeometryAttributes_default({
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: flatPositions2
+ })
+ });
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.LINES
+ });
+}
+function CoplanarPolygonOutlineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const polygonHierarchy = options.polygonHierarchy;
+ Check_default.defined("options.polygonHierarchy", polygonHierarchy);
+ this._polygonHierarchy = polygonHierarchy;
+ this._workerName = "createCoplanarPolygonOutlineGeometry";
+ this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
+ polygonHierarchy,
+ Cartesian3_default
+ ) + 1;
+}
+CoplanarPolygonOutlineGeometry.fromPositions = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.positions", options.positions);
+ const newOptions2 = {
+ polygonHierarchy: {
+ positions: options.positions
+ }
+ };
+ return new CoplanarPolygonOutlineGeometry(newOptions2);
+};
+CoplanarPolygonOutlineGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
+ value._polygonHierarchy,
+ array,
+ startingIndex,
+ Cartesian3_default
+ );
+ array[startingIndex] = value.packedLength;
+ return array;
+};
+var scratchOptions4 = {
+ polygonHierarchy: {}
+};
+CoplanarPolygonOutlineGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Cartesian3_default
+ );
+ startingIndex = polygonHierarchy.startingIndex;
+ delete polygonHierarchy.startingIndex;
+ const packedLength = array[startingIndex];
+ if (!defined_default(result)) {
+ result = new CoplanarPolygonOutlineGeometry(scratchOptions4);
+ }
+ result._polygonHierarchy = polygonHierarchy;
+ result.packedLength = packedLength;
+ return result;
+};
+CoplanarPolygonOutlineGeometry.createGeometry = function(polygonGeometry) {
+ const polygonHierarchy = polygonGeometry._polygonHierarchy;
+ let outerPositions = polygonHierarchy.positions;
+ outerPositions = arrayRemoveDuplicates_default(
+ outerPositions,
+ Cartesian3_default.equalsEpsilon,
+ true
+ );
+ if (outerPositions.length < 3) {
+ return;
+ }
+ const isValid = CoplanarPolygonGeometryLibrary_default.validOutline(outerPositions);
+ if (!isValid) {
+ return void 0;
+ }
+ const polygons = PolygonGeometryLibrary_default.polygonOutlinesFromHierarchy(
+ polygonHierarchy,
+ false
+ );
+ if (polygons.length === 0) {
+ return void 0;
+ }
+ const geometries = [];
+ for (let i = 0; i < polygons.length; i++) {
+ const geometryInstance = new GeometryInstance_default({
+ geometry: createGeometryFromPositions(polygons[i])
+ });
+ geometries.push(geometryInstance);
+ }
+ const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
+ const boundingSphere = BoundingSphere_default.fromPoints(polygonHierarchy.positions);
+ return new Geometry_default({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere
+ });
+};
+var CoplanarPolygonOutlineGeometry_default = CoplanarPolygonOutlineGeometry;
+
+// Source/Scene/TileBoundingS2Cell.js
+var centerCartographicScratch = new Cartographic_default();
+function TileBoundingS2Cell(options) {
+ Check_default.typeOf.object("options", options);
+ Check_default.typeOf.string("options.token", options.token);
+ const s2Cell = S2Cell_default.fromToken(options.token);
+ const minimumHeight = defaultValue_default(options.minimumHeight, 0);
+ const maximumHeight = defaultValue_default(options.maximumHeight, 0);
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ this.s2Cell = s2Cell;
+ this.minimumHeight = minimumHeight;
+ this.maximumHeight = maximumHeight;
+ this.ellipsoid = ellipsoid;
+ const boundingPlanes = computeBoundingPlanes(
+ s2Cell,
+ minimumHeight,
+ maximumHeight,
+ ellipsoid
+ );
+ this._boundingPlanes = boundingPlanes;
+ const vertices = computeVertices(boundingPlanes);
+ this._vertices = vertices;
+ this._edgeNormals = new Array(6);
+ this._edgeNormals[0] = computeEdgeNormals(
+ boundingPlanes[0],
+ vertices.slice(0, 4)
+ );
+ let i;
+ for (i = 0; i < 4; i++) {
+ this._edgeNormals[0][i] = Cartesian3_default.negate(
+ this._edgeNormals[0][i],
+ this._edgeNormals[0][i]
+ );
+ }
+ this._edgeNormals[1] = computeEdgeNormals(
+ boundingPlanes[1],
+ vertices.slice(4, 8)
+ );
+ for (i = 0; i < 4; i++) {
+ this._edgeNormals[2 + i] = computeEdgeNormals(boundingPlanes[2 + i], [
+ vertices[i % 4],
+ vertices[(i + 1) % 4],
+ vertices[4 + (i + 1) % 4],
+ vertices[4 + i]
+ ]);
+ }
+ this._planeVertices = [
+ this._vertices.slice(0, 4),
+ this._vertices.slice(4, 8)
+ ];
+ for (i = 0; i < 4; i++) {
+ this._planeVertices.push([
+ this._vertices[i % 4],
+ this._vertices[(i + 1) % 4],
+ this._vertices[4 + (i + 1) % 4],
+ this._vertices[4 + i]
+ ]);
+ }
+ const center = s2Cell.getCenter();
+ centerCartographicScratch = ellipsoid.cartesianToCartographic(
+ center,
+ centerCartographicScratch
+ );
+ centerCartographicScratch.height = (maximumHeight + minimumHeight) / 2;
+ this.center = ellipsoid.cartographicToCartesian(
+ centerCartographicScratch,
+ center
+ );
+ this._boundingSphere = BoundingSphere_default.fromPoints(vertices);
+}
+var centerGeodeticNormalScratch = new Cartesian3_default();
+var topCartographicScratch = new Cartographic_default();
+var topScratch = new Cartesian3_default();
+var vertexCartographicScratch = new Cartographic_default();
+var vertexScratch = new Cartesian3_default();
+var vertexGeodeticNormalScratch = new Cartesian3_default();
+var sideNormalScratch = new Cartesian3_default();
+var sideScratch = new Cartesian3_default();
+function computeBoundingPlanes(s2Cell, minimumHeight, maximumHeight, ellipsoid) {
+ const planes = new Array(6);
+ const centerPoint = s2Cell.getCenter();
+ const centerSurfaceNormal = ellipsoid.geodeticSurfaceNormal(
+ centerPoint,
+ centerGeodeticNormalScratch
+ );
+ const topCartographic = ellipsoid.cartesianToCartographic(
+ centerPoint,
+ topCartographicScratch
+ );
+ topCartographic.height = maximumHeight;
+ const top = ellipsoid.cartographicToCartesian(topCartographic, topScratch);
+ const topPlane = Plane_default.fromPointNormal(top, centerSurfaceNormal);
+ planes[0] = topPlane;
+ let maxDistance = 0;
+ let i;
+ const vertices = [];
+ let vertex, vertexCartographic;
+ for (i = 0; i < 4; i++) {
+ vertex = s2Cell.getVertex(i);
+ vertices[i] = vertex;
+ vertexCartographic = ellipsoid.cartesianToCartographic(
+ vertex,
+ vertexCartographicScratch
+ );
+ vertexCartographic.height = minimumHeight;
+ const distance2 = Plane_default.getPointDistance(
+ topPlane,
+ ellipsoid.cartographicToCartesian(vertexCartographic, vertexScratch)
+ );
+ if (distance2 < maxDistance) {
+ maxDistance = distance2;
+ }
+ }
+ const bottomPlane = Plane_default.clone(topPlane);
+ bottomPlane.normal = Cartesian3_default.negate(
+ bottomPlane.normal,
+ bottomPlane.normal
+ );
+ bottomPlane.distance = bottomPlane.distance * -1 + maxDistance;
+ planes[1] = bottomPlane;
+ for (i = 0; i < 4; i++) {
+ vertex = vertices[i];
+ const adjacentVertex = vertices[(i + 1) % 4];
+ const geodeticNormal = ellipsoid.geodeticSurfaceNormal(
+ vertex,
+ vertexGeodeticNormalScratch
+ );
+ const side = Cartesian3_default.subtract(adjacentVertex, vertex, sideScratch);
+ let sideNormal = Cartesian3_default.cross(side, geodeticNormal, sideNormalScratch);
+ sideNormal = Cartesian3_default.normalize(sideNormal, sideNormal);
+ planes[2 + i] = Plane_default.fromPointNormal(vertex, sideNormal);
+ }
+ return planes;
+}
+var n0Scratch = new Cartesian3_default();
+var n1Scratch = new Cartesian3_default();
+var n2Scratch = new Cartesian3_default();
+var x0Scratch = new Cartesian3_default();
+var x1Scratch = new Cartesian3_default();
+var x2Scratch = new Cartesian3_default();
+var t0Scratch = new Cartesian3_default();
+var t1Scratch = new Cartesian3_default();
+var t2Scratch = new Cartesian3_default();
+var f0Scratch = new Cartesian3_default();
+var f1Scratch = new Cartesian3_default();
+var f2Scratch = new Cartesian3_default();
+var sScratch2 = new Cartesian3_default();
+var matrixScratch = new Matrix3_default();
+function computeIntersection(p0, p1, p2) {
+ n0Scratch = p0.normal;
+ n1Scratch = p1.normal;
+ n2Scratch = p2.normal;
+ x0Scratch = Cartesian3_default.multiplyByScalar(p0.normal, -p0.distance, x0Scratch);
+ x1Scratch = Cartesian3_default.multiplyByScalar(p1.normal, -p1.distance, x1Scratch);
+ x2Scratch = Cartesian3_default.multiplyByScalar(p2.normal, -p2.distance, x2Scratch);
+ f0Scratch = Cartesian3_default.multiplyByScalar(
+ Cartesian3_default.cross(n1Scratch, n2Scratch, t0Scratch),
+ Cartesian3_default.dot(x0Scratch, n0Scratch),
+ f0Scratch
+ );
+ f1Scratch = Cartesian3_default.multiplyByScalar(
+ Cartesian3_default.cross(n2Scratch, n0Scratch, t1Scratch),
+ Cartesian3_default.dot(x1Scratch, n1Scratch),
+ f1Scratch
+ );
+ f2Scratch = Cartesian3_default.multiplyByScalar(
+ Cartesian3_default.cross(n0Scratch, n1Scratch, t2Scratch),
+ Cartesian3_default.dot(x2Scratch, n2Scratch),
+ f2Scratch
+ );
+ matrixScratch[0] = n0Scratch.x;
+ matrixScratch[1] = n1Scratch.x;
+ matrixScratch[2] = n2Scratch.x;
+ matrixScratch[3] = n0Scratch.y;
+ matrixScratch[4] = n1Scratch.y;
+ matrixScratch[5] = n2Scratch.y;
+ matrixScratch[6] = n0Scratch.z;
+ matrixScratch[7] = n1Scratch.z;
+ matrixScratch[8] = n2Scratch.z;
+ const determinant = Matrix3_default.determinant(matrixScratch);
+ sScratch2 = Cartesian3_default.add(f0Scratch, f1Scratch, sScratch2);
+ sScratch2 = Cartesian3_default.add(sScratch2, f2Scratch, sScratch2);
+ return new Cartesian3_default(
+ sScratch2.x / determinant,
+ sScratch2.y / determinant,
+ sScratch2.z / determinant
+ );
+}
+function computeVertices(boundingPlanes) {
+ const vertices = new Array(8);
+ for (let i = 0; i < 4; i++) {
+ vertices[i] = computeIntersection(
+ boundingPlanes[0],
+ boundingPlanes[2 + (i + 3) % 4],
+ boundingPlanes[2 + i % 4]
+ );
+ vertices[i + 4] = computeIntersection(
+ boundingPlanes[1],
+ boundingPlanes[2 + (i + 3) % 4],
+ boundingPlanes[2 + i % 4]
+ );
+ }
+ return vertices;
+}
+var edgeScratch = new Cartesian3_default();
+var edgeNormalScratch = new Cartesian3_default();
+function computeEdgeNormals(plane, vertices) {
+ const edgeNormals = [];
+ for (let i = 0; i < 4; i++) {
+ edgeScratch = Cartesian3_default.subtract(
+ vertices[(i + 1) % 4],
+ vertices[i],
+ edgeScratch
+ );
+ edgeNormalScratch = Cartesian3_default.cross(
+ plane.normal,
+ edgeScratch,
+ edgeNormalScratch
+ );
+ edgeNormalScratch = Cartesian3_default.normalize(
+ edgeNormalScratch,
+ edgeNormalScratch
+ );
+ edgeNormals[i] = Cartesian3_default.clone(edgeNormalScratch);
+ }
+ return edgeNormals;
+}
+Object.defineProperties(TileBoundingS2Cell.prototype, {
+ boundingVolume: {
+ get: function() {
+ return this;
+ }
+ },
+ boundingSphere: {
+ get: function() {
+ return this._boundingSphere;
+ }
+ }
+});
+var facePointScratch = new Cartesian3_default();
+TileBoundingS2Cell.prototype.distanceToCamera = function(frameState) {
+ Check_default.defined("frameState", frameState);
+ const point = frameState.camera.positionWC;
+ const selectedPlaneIndices = [];
+ const vertices = [];
+ let edgeNormals;
+ if (Plane_default.getPointDistance(this._boundingPlanes[0], point) > 0) {
+ selectedPlaneIndices.push(0);
+ vertices.push(this._planeVertices[0]);
+ edgeNormals = this._edgeNormals[0];
+ } else if (Plane_default.getPointDistance(this._boundingPlanes[1], point) > 0) {
+ selectedPlaneIndices.push(1);
+ vertices.push(this._planeVertices[1]);
+ edgeNormals = this._edgeNormals[1];
+ }
+ let i;
+ let sidePlaneIndex;
+ for (i = 0; i < 4; i++) {
+ sidePlaneIndex = 2 + i;
+ if (Plane_default.getPointDistance(this._boundingPlanes[sidePlaneIndex], point) > 0) {
+ selectedPlaneIndices.push(sidePlaneIndex);
+ vertices.push(this._planeVertices[sidePlaneIndex]);
+ edgeNormals = this._edgeNormals[sidePlaneIndex];
+ }
+ }
+ if (selectedPlaneIndices.length === 0) {
+ return 0;
+ }
+ let facePoint;
+ let selectedPlane;
+ if (selectedPlaneIndices.length === 1) {
+ selectedPlane = this._boundingPlanes[selectedPlaneIndices[0]];
+ facePoint = closestPointPolygon(
+ Plane_default.projectPointOntoPlane(selectedPlane, point, facePointScratch),
+ vertices[0],
+ selectedPlane,
+ edgeNormals
+ );
+ return Cartesian3_default.distance(facePoint, point);
+ } else if (selectedPlaneIndices.length === 2) {
+ if (selectedPlaneIndices[0] === 0) {
+ const edge = [
+ this._vertices[4 * selectedPlaneIndices[0] + (selectedPlaneIndices[1] - 2)],
+ this._vertices[4 * selectedPlaneIndices[0] + (selectedPlaneIndices[1] - 2 + 1) % 4]
+ ];
+ facePoint = closestPointLineSegment(point, edge[0], edge[1]);
+ return Cartesian3_default.distance(facePoint, point);
+ }
+ let minimumDistance = Number.MAX_VALUE;
+ let distance2;
+ for (i = 0; i < 2; i++) {
+ selectedPlane = this._boundingPlanes[selectedPlaneIndices[i]];
+ facePoint = closestPointPolygon(
+ Plane_default.projectPointOntoPlane(selectedPlane, point, facePointScratch),
+ vertices[i],
+ selectedPlane,
+ this._edgeNormals[selectedPlaneIndices[i]]
+ );
+ distance2 = Cartesian3_default.distanceSquared(facePoint, point);
+ if (distance2 < minimumDistance) {
+ minimumDistance = distance2;
+ }
+ }
+ return Math.sqrt(minimumDistance);
+ } else if (selectedPlaneIndices.length > 3) {
+ facePoint = closestPointPolygon(
+ Plane_default.projectPointOntoPlane(
+ this._boundingPlanes[1],
+ point,
+ facePointScratch
+ ),
+ this._planeVertices[1],
+ this._boundingPlanes[1],
+ this._edgeNormals[1]
+ );
+ return Cartesian3_default.distance(facePoint, point);
+ }
+ const skip = selectedPlaneIndices[1] === 2 && selectedPlaneIndices[2] === 5 ? 0 : 1;
+ if (selectedPlaneIndices[0] === 0) {
+ return Cartesian3_default.distance(
+ point,
+ this._vertices[(selectedPlaneIndices[1] - 2 + skip) % 4]
+ );
+ }
+ return Cartesian3_default.distance(
+ point,
+ this._vertices[4 + (selectedPlaneIndices[1] - 2 + skip) % 4]
+ );
+};
+var dScratch2 = new Cartesian3_default();
+var pL0Scratch = new Cartesian3_default();
+function closestPointLineSegment(p, l0, l1) {
+ const d = Cartesian3_default.subtract(l1, l0, dScratch2);
+ const pL0 = Cartesian3_default.subtract(p, l0, pL0Scratch);
+ let t = Cartesian3_default.dot(d, pL0);
+ if (t <= 0) {
+ return l0;
+ }
+ const dMag = Cartesian3_default.dot(d, d);
+ if (t >= dMag) {
+ return l1;
+ }
+ t = t / dMag;
+ return new Cartesian3_default(
+ (1 - t) * l0.x + t * l1.x,
+ (1 - t) * l0.y + t * l1.y,
+ (1 - t) * l0.z + t * l1.z
+ );
+}
+var edgePlaneScratch = new Plane_default(Cartesian3_default.UNIT_X, 0);
+function closestPointPolygon(p, vertices, plane, edgeNormals) {
+ let minDistance = Number.MAX_VALUE;
+ let distance2;
+ let closestPoint;
+ let closestPointOnEdge;
+ for (let i = 0; i < vertices.length; i++) {
+ const edgePlane = Plane_default.fromPointNormal(
+ vertices[i],
+ edgeNormals[i],
+ edgePlaneScratch
+ );
+ const edgePlaneDistance = Plane_default.getPointDistance(edgePlane, p);
+ if (edgePlaneDistance < 0) {
+ continue;
+ }
+ closestPointOnEdge = closestPointLineSegment(
+ p,
+ vertices[i],
+ vertices[(i + 1) % 4]
+ );
+ distance2 = Cartesian3_default.distance(p, closestPointOnEdge);
+ if (distance2 < minDistance) {
+ minDistance = distance2;
+ closestPoint = closestPointOnEdge;
+ }
+ }
+ if (!defined_default(closestPoint)) {
+ return p;
+ }
+ return closestPoint;
+}
+TileBoundingS2Cell.prototype.intersectPlane = function(plane) {
+ Check_default.defined("plane", plane);
+ let plusCount = 0;
+ let negCount = 0;
+ for (let i = 0; i < this._vertices.length; i++) {
+ const distanceToPlane = Cartesian3_default.dot(plane.normal, this._vertices[i]) + plane.distance;
+ if (distanceToPlane < 0) {
+ negCount++;
+ } else {
+ plusCount++;
+ }
+ }
+ if (plusCount === this._vertices.length) {
+ return Intersect_default.INSIDE;
+ } else if (negCount === this._vertices.length) {
+ return Intersect_default.OUTSIDE;
+ }
+ return Intersect_default.INTERSECTING;
+};
+TileBoundingS2Cell.prototype.createDebugVolume = function(color) {
+ Check_default.defined("color", color);
+ const modelMatrix = new Matrix4_default.clone(Matrix4_default.IDENTITY);
+ const topPlanePolygon = new CoplanarPolygonOutlineGeometry_default({
+ polygonHierarchy: {
+ positions: this._planeVertices[0]
+ }
+ });
+ const topPlaneGeometry = CoplanarPolygonOutlineGeometry_default.createGeometry(
+ topPlanePolygon
+ );
+ const topPlaneInstance = new GeometryInstance_default({
+ geometry: topPlaneGeometry,
+ id: "outline",
+ modelMatrix,
+ attributes: {
+ color: ColorGeometryInstanceAttribute_default.fromColor(color)
+ }
+ });
+ const bottomPlanePolygon = new CoplanarPolygonOutlineGeometry_default({
+ polygonHierarchy: {
+ positions: this._planeVertices[1]
+ }
+ });
+ const bottomPlaneGeometry = CoplanarPolygonOutlineGeometry_default.createGeometry(
+ bottomPlanePolygon
+ );
+ const bottomPlaneInstance = new GeometryInstance_default({
+ geometry: bottomPlaneGeometry,
+ id: "outline",
+ modelMatrix,
+ attributes: {
+ color: ColorGeometryInstanceAttribute_default.fromColor(color)
+ }
+ });
+ const sideInstances = [];
+ for (let i = 0; i < 4; i++) {
+ const sidePlanePolygon = new CoplanarPolygonOutlineGeometry_default({
+ polygonHierarchy: {
+ positions: this._planeVertices[2 + i]
+ }
+ });
+ const sidePlaneGeometry = CoplanarPolygonOutlineGeometry_default.createGeometry(
+ sidePlanePolygon
+ );
+ sideInstances[i] = new GeometryInstance_default({
+ geometry: sidePlaneGeometry,
+ id: "outline",
+ modelMatrix,
+ attributes: {
+ color: ColorGeometryInstanceAttribute_default.fromColor(color)
+ }
+ });
+ }
+ return new Primitive_default({
+ geometryInstances: [
+ sideInstances[0],
+ sideInstances[1],
+ sideInstances[2],
+ sideInstances[3],
+ bottomPlaneInstance,
+ topPlaneInstance
+ ],
+ appearance: new PerInstanceColorAppearance_default({
+ translucent: false,
+ flat: true
+ }),
+ asynchronous: false
+ });
+};
+var TileBoundingS2Cell_default = TileBoundingS2Cell;
+
+// Source/Core/EllipsoidOutlineGeometry.js
+var defaultRadii = new Cartesian3_default(1, 1, 1);
+var cos2 = Math.cos;
+var sin2 = Math.sin;
+function EllipsoidOutlineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const radii = defaultValue_default(options.radii, defaultRadii);
+ const innerRadii = defaultValue_default(options.innerRadii, radii);
+ const minimumClock = defaultValue_default(options.minimumClock, 0);
+ const maximumClock = defaultValue_default(options.maximumClock, Math_default.TWO_PI);
+ const minimumCone = defaultValue_default(options.minimumCone, 0);
+ const maximumCone = defaultValue_default(options.maximumCone, Math_default.PI);
+ const stackPartitions = Math.round(defaultValue_default(options.stackPartitions, 10));
+ const slicePartitions = Math.round(defaultValue_default(options.slicePartitions, 8));
+ const subdivisions = Math.round(defaultValue_default(options.subdivisions, 128));
+ if (stackPartitions < 1) {
+ throw new DeveloperError_default("options.stackPartitions cannot be less than 1");
+ }
+ if (slicePartitions < 0) {
+ throw new DeveloperError_default("options.slicePartitions cannot be less than 0");
+ }
+ if (subdivisions < 0) {
+ throw new DeveloperError_default(
+ "options.subdivisions must be greater than or equal to zero."
+ );
+ }
+ if (defined_default(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ throw new DeveloperError_default(
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
+ );
+ }
+ this._radii = Cartesian3_default.clone(radii);
+ this._innerRadii = Cartesian3_default.clone(innerRadii);
+ this._minimumClock = minimumClock;
+ this._maximumClock = maximumClock;
+ this._minimumCone = minimumCone;
+ this._maximumCone = maximumCone;
+ this._stackPartitions = stackPartitions;
+ this._slicePartitions = slicePartitions;
+ this._subdivisions = subdivisions;
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createEllipsoidOutlineGeometry";
+}
+EllipsoidOutlineGeometry.packedLength = 2 * Cartesian3_default.packedLength + 8;
+EllipsoidOutlineGeometry.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ Cartesian3_default.pack(value._radii, array, startingIndex);
+ startingIndex += Cartesian3_default.packedLength;
+ Cartesian3_default.pack(value._innerRadii, array, startingIndex);
+ startingIndex += Cartesian3_default.packedLength;
+ array[startingIndex++] = value._minimumClock;
+ array[startingIndex++] = value._maximumClock;
+ array[startingIndex++] = value._minimumCone;
+ array[startingIndex++] = value._maximumCone;
+ array[startingIndex++] = value._stackPartitions;
+ array[startingIndex++] = value._slicePartitions;
+ array[startingIndex++] = value._subdivisions;
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchRadii = new Cartesian3_default();
+var scratchInnerRadii = new Cartesian3_default();
+var scratchOptions5 = {
+ radii: scratchRadii,
+ innerRadii: scratchInnerRadii,
+ minimumClock: void 0,
+ maximumClock: void 0,
+ minimumCone: void 0,
+ maximumCone: void 0,
+ stackPartitions: void 0,
+ slicePartitions: void 0,
+ subdivisions: void 0,
+ offsetAttribute: void 0
+};
+EllipsoidOutlineGeometry.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const radii = Cartesian3_default.unpack(array, startingIndex, scratchRadii);
+ startingIndex += Cartesian3_default.packedLength;
+ const innerRadii = Cartesian3_default.unpack(array, startingIndex, scratchInnerRadii);
+ startingIndex += Cartesian3_default.packedLength;
+ const minimumClock = array[startingIndex++];
+ const maximumClock = array[startingIndex++];
+ const minimumCone = array[startingIndex++];
+ const maximumCone = array[startingIndex++];
+ const stackPartitions = array[startingIndex++];
+ const slicePartitions = array[startingIndex++];
+ const subdivisions = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions5.minimumClock = minimumClock;
+ scratchOptions5.maximumClock = maximumClock;
+ scratchOptions5.minimumCone = minimumCone;
+ scratchOptions5.maximumCone = maximumCone;
+ scratchOptions5.stackPartitions = stackPartitions;
+ scratchOptions5.slicePartitions = slicePartitions;
+ scratchOptions5.subdivisions = subdivisions;
+ scratchOptions5.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new EllipsoidOutlineGeometry(scratchOptions5);
+ }
+ result._radii = Cartesian3_default.clone(radii, result._radii);
+ result._innerRadii = Cartesian3_default.clone(innerRadii, result._innerRadii);
+ result._minimumClock = minimumClock;
+ result._maximumClock = maximumClock;
+ result._minimumCone = minimumCone;
+ result._maximumCone = maximumCone;
+ result._stackPartitions = stackPartitions;
+ result._slicePartitions = slicePartitions;
+ result._subdivisions = subdivisions;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+EllipsoidOutlineGeometry.createGeometry = function(ellipsoidGeometry) {
+ const radii = ellipsoidGeometry._radii;
+ if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {
+ return;
+ }
+ const innerRadii = ellipsoidGeometry._innerRadii;
+ if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {
+ return;
+ }
+ const minimumClock = ellipsoidGeometry._minimumClock;
+ const maximumClock = ellipsoidGeometry._maximumClock;
+ const minimumCone = ellipsoidGeometry._minimumCone;
+ const maximumCone = ellipsoidGeometry._maximumCone;
+ const subdivisions = ellipsoidGeometry._subdivisions;
+ const ellipsoid = Ellipsoid_default.fromCartesian3(radii);
+ let slicePartitions = ellipsoidGeometry._slicePartitions + 1;
+ let stackPartitions = ellipsoidGeometry._stackPartitions + 1;
+ slicePartitions = Math.round(
+ slicePartitions * Math.abs(maximumClock - minimumClock) / Math_default.TWO_PI
+ );
+ stackPartitions = Math.round(
+ stackPartitions * Math.abs(maximumCone - minimumCone) / Math_default.PI
+ );
+ if (slicePartitions < 2) {
+ slicePartitions = 2;
+ }
+ if (stackPartitions < 2) {
+ stackPartitions = 2;
+ }
+ let extraIndices = 0;
+ let vertexMultiplier = 1;
+ const hasInnerSurface = innerRadii.x !== radii.x || innerRadii.y !== radii.y || innerRadii.z !== radii.z;
+ let isTopOpen = false;
+ let isBotOpen = false;
+ if (hasInnerSurface) {
+ vertexMultiplier = 2;
+ if (minimumCone > 0) {
+ isTopOpen = true;
+ extraIndices += slicePartitions;
+ }
+ if (maximumCone < Math.PI) {
+ isBotOpen = true;
+ extraIndices += slicePartitions;
+ }
+ }
+ const vertexCount = subdivisions * vertexMultiplier * (stackPartitions + slicePartitions);
+ const positions = new Float64Array(vertexCount * 3);
+ const numIndices = 2 * (vertexCount + extraIndices - (slicePartitions + stackPartitions) * vertexMultiplier);
+ const indices2 = IndexDatatype_default.createTypedArray(vertexCount, numIndices);
+ let i;
+ let j;
+ let theta;
+ let phi;
+ let index = 0;
+ const sinPhi = new Array(stackPartitions);
+ const cosPhi = new Array(stackPartitions);
+ for (i = 0; i < stackPartitions; i++) {
+ phi = minimumCone + i * (maximumCone - minimumCone) / (stackPartitions - 1);
+ sinPhi[i] = sin2(phi);
+ cosPhi[i] = cos2(phi);
+ }
+ const sinTheta = new Array(subdivisions);
+ const cosTheta = new Array(subdivisions);
+ for (i = 0; i < subdivisions; i++) {
+ theta = minimumClock + i * (maximumClock - minimumClock) / (subdivisions - 1);
+ sinTheta[i] = sin2(theta);
+ cosTheta[i] = cos2(theta);
+ }
+ for (i = 0; i < stackPartitions; i++) {
+ for (j = 0; j < subdivisions; j++) {
+ positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = radii.z * cosPhi[i];
+ }
+ }
+ if (hasInnerSurface) {
+ for (i = 0; i < stackPartitions; i++) {
+ for (j = 0; j < subdivisions; j++) {
+ positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = innerRadii.z * cosPhi[i];
+ }
+ }
+ }
+ sinPhi.length = subdivisions;
+ cosPhi.length = subdivisions;
+ for (i = 0; i < subdivisions; i++) {
+ phi = minimumCone + i * (maximumCone - minimumCone) / (subdivisions - 1);
+ sinPhi[i] = sin2(phi);
+ cosPhi[i] = cos2(phi);
+ }
+ sinTheta.length = slicePartitions;
+ cosTheta.length = slicePartitions;
+ for (i = 0; i < slicePartitions; i++) {
+ theta = minimumClock + i * (maximumClock - minimumClock) / (slicePartitions - 1);
+ sinTheta[i] = sin2(theta);
+ cosTheta[i] = cos2(theta);
+ }
+ for (i = 0; i < subdivisions; i++) {
+ for (j = 0; j < slicePartitions; j++) {
+ positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = radii.z * cosPhi[i];
+ }
+ }
+ if (hasInnerSurface) {
+ for (i = 0; i < subdivisions; i++) {
+ for (j = 0; j < slicePartitions; j++) {
+ positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = innerRadii.z * cosPhi[i];
+ }
+ }
+ }
+ index = 0;
+ for (i = 0; i < stackPartitions * vertexMultiplier; i++) {
+ const topOffset = i * subdivisions;
+ for (j = 0; j < subdivisions - 1; j++) {
+ indices2[index++] = topOffset + j;
+ indices2[index++] = topOffset + j + 1;
+ }
+ }
+ let offset2 = stackPartitions * subdivisions * vertexMultiplier;
+ for (i = 0; i < slicePartitions; i++) {
+ for (j = 0; j < subdivisions - 1; j++) {
+ indices2[index++] = offset2 + i + j * slicePartitions;
+ indices2[index++] = offset2 + i + (j + 1) * slicePartitions;
+ }
+ }
+ if (hasInnerSurface) {
+ offset2 = stackPartitions * subdivisions * vertexMultiplier + slicePartitions * subdivisions;
+ for (i = 0; i < slicePartitions; i++) {
+ for (j = 0; j < subdivisions - 1; j++) {
+ indices2[index++] = offset2 + i + j * slicePartitions;
+ indices2[index++] = offset2 + i + (j + 1) * slicePartitions;
+ }
+ }
+ }
+ if (hasInnerSurface) {
+ let outerOffset = stackPartitions * subdivisions * vertexMultiplier;
+ let innerOffset = outerOffset + subdivisions * slicePartitions;
+ if (isTopOpen) {
+ for (i = 0; i < slicePartitions; i++) {
+ indices2[index++] = outerOffset + i;
+ indices2[index++] = innerOffset + i;
+ }
+ }
+ if (isBotOpen) {
+ outerOffset += subdivisions * slicePartitions - slicePartitions;
+ innerOffset += subdivisions * slicePartitions - slicePartitions;
+ for (i = 0; i < slicePartitions; i++) {
+ indices2[index++] = outerOffset + i;
+ indices2[index++] = innerOffset + i;
+ }
+ }
+ }
+ const attributes = new GeometryAttributes_default({
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ })
+ });
+ if (defined_default(ellipsoidGeometry._offsetAttribute)) {
+ const length3 = positions.length;
+ const offsetValue = ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.LINES,
+ boundingSphere: BoundingSphere_default.fromEllipsoid(ellipsoid),
+ offsetAttribute: ellipsoidGeometry._offsetAttribute
+ });
+};
+var EllipsoidOutlineGeometry_default = EllipsoidOutlineGeometry;
+
+// Source/Core/SphereOutlineGeometry.js
+function SphereOutlineGeometry(options) {
+ const radius = defaultValue_default(options.radius, 1);
+ const radii = new Cartesian3_default(radius, radius, radius);
+ const ellipsoidOptions = {
+ radii,
+ stackPartitions: options.stackPartitions,
+ slicePartitions: options.slicePartitions,
+ subdivisions: options.subdivisions
+ };
+ this._ellipsoidGeometry = new EllipsoidOutlineGeometry_default(ellipsoidOptions);
+ this._workerName = "createSphereOutlineGeometry";
+}
+SphereOutlineGeometry.packedLength = EllipsoidOutlineGeometry_default.packedLength;
+SphereOutlineGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ return EllipsoidOutlineGeometry_default.pack(
+ value._ellipsoidGeometry,
+ array,
+ startingIndex
+ );
+};
+var scratchEllipsoidGeometry = new EllipsoidOutlineGeometry_default();
+var scratchOptions6 = {
+ radius: void 0,
+ radii: new Cartesian3_default(),
+ stackPartitions: void 0,
+ slicePartitions: void 0,
+ subdivisions: void 0
+};
+SphereOutlineGeometry.unpack = function(array, startingIndex, result) {
+ const ellipsoidGeometry = EllipsoidOutlineGeometry_default.unpack(
+ array,
+ startingIndex,
+ scratchEllipsoidGeometry
+ );
+ scratchOptions6.stackPartitions = ellipsoidGeometry._stackPartitions;
+ scratchOptions6.slicePartitions = ellipsoidGeometry._slicePartitions;
+ scratchOptions6.subdivisions = ellipsoidGeometry._subdivisions;
+ if (!defined_default(result)) {
+ scratchOptions6.radius = ellipsoidGeometry._radii.x;
+ return new SphereOutlineGeometry(scratchOptions6);
+ }
+ Cartesian3_default.clone(ellipsoidGeometry._radii, scratchOptions6.radii);
+ result._ellipsoidGeometry = new EllipsoidOutlineGeometry_default(scratchOptions6);
+ return result;
+};
+SphereOutlineGeometry.createGeometry = function(sphereGeometry) {
+ return EllipsoidOutlineGeometry_default.createGeometry(
+ sphereGeometry._ellipsoidGeometry
+ );
+};
+var SphereOutlineGeometry_default = SphereOutlineGeometry;
+
+// Source/Scene/TileBoundingSphere.js
+function TileBoundingSphere(center, radius) {
+ if (radius === 0) {
+ radius = Math_default.EPSILON7;
+ }
+ this._boundingSphere = new BoundingSphere_default(center, radius);
+}
+Object.defineProperties(TileBoundingSphere.prototype, {
+ center: {
+ get: function() {
+ return this._boundingSphere.center;
+ }
+ },
+ radius: {
+ get: function() {
+ return this._boundingSphere.radius;
+ }
+ },
+ boundingVolume: {
+ get: function() {
+ return this._boundingSphere;
+ }
+ },
+ boundingSphere: {
+ get: function() {
+ return this._boundingSphere;
+ }
+ }
+});
+TileBoundingSphere.prototype.distanceToCamera = function(frameState) {
+ Check_default.defined("frameState", frameState);
+ const boundingSphere = this._boundingSphere;
+ return Math.max(
+ 0,
+ Cartesian3_default.distance(boundingSphere.center, frameState.camera.positionWC) - boundingSphere.radius
+ );
+};
+TileBoundingSphere.prototype.intersectPlane = function(plane) {
+ Check_default.defined("plane", plane);
+ return BoundingSphere_default.intersectPlane(this._boundingSphere, plane);
+};
+TileBoundingSphere.prototype.update = function(center, radius) {
+ Cartesian3_default.clone(center, this._boundingSphere.center);
+ this._boundingSphere.radius = radius;
+};
+TileBoundingSphere.prototype.createDebugVolume = function(color) {
+ Check_default.defined("color", color);
+ const geometry = new SphereOutlineGeometry_default({
+ radius: this.radius
+ });
+ const modelMatrix = Matrix4_default.fromTranslation(
+ this.center,
+ new Matrix4_default.clone(Matrix4_default.IDENTITY)
+ );
+ const instance = new GeometryInstance_default({
+ geometry,
+ id: "outline",
+ modelMatrix,
+ attributes: {
+ color: ColorGeometryInstanceAttribute_default.fromColor(color)
+ }
+ });
+ return new Primitive_default({
+ geometryInstances: instance,
+ appearance: new PerInstanceColorAppearance_default({
+ translucent: false,
+ flat: true
+ }),
+ asynchronous: false
+ });
+};
+var TileBoundingSphere_default = TileBoundingSphere;
+
+// Source/Scene/TileOrientedBoundingBox.js
+var scratchU = new Cartesian3_default();
+var scratchV = new Cartesian3_default();
+var scratchW2 = new Cartesian3_default();
+var scratchCartesian8 = new Cartesian3_default();
+function computeMissingVector(a3, b, result) {
+ result = Cartesian3_default.cross(a3, b, result);
+ const magnitude = Cartesian3_default.magnitude(result);
+ return Cartesian3_default.multiplyByScalar(
+ result,
+ Math_default.EPSILON7 / magnitude,
+ result
+ );
+}
+function findOrthogonalVector(a3, result) {
+ const temp = Cartesian3_default.normalize(a3, scratchCartesian8);
+ const b = Cartesian3_default.equalsEpsilon(
+ temp,
+ Cartesian3_default.UNIT_X,
+ Math_default.EPSILON6
+ ) ? Cartesian3_default.UNIT_Y : Cartesian3_default.UNIT_X;
+ return computeMissingVector(a3, b, result);
+}
+function checkHalfAxes(halfAxes) {
+ let u3 = Matrix3_default.getColumn(halfAxes, 0, scratchU);
+ let v7 = Matrix3_default.getColumn(halfAxes, 1, scratchV);
+ let w = Matrix3_default.getColumn(halfAxes, 2, scratchW2);
+ const uZero = Cartesian3_default.equals(u3, Cartesian3_default.ZERO);
+ const vZero = Cartesian3_default.equals(v7, Cartesian3_default.ZERO);
+ const wZero = Cartesian3_default.equals(w, Cartesian3_default.ZERO);
+ if (!uZero && !vZero && !wZero) {
+ return halfAxes;
+ }
+ if (uZero && vZero && wZero) {
+ halfAxes[0] = Math_default.EPSILON7;
+ halfAxes[4] = Math_default.EPSILON7;
+ halfAxes[8] = Math_default.EPSILON7;
+ return halfAxes;
+ }
+ if (uZero && !vZero && !wZero) {
+ u3 = computeMissingVector(v7, w, u3);
+ } else if (!uZero && vZero && !wZero) {
+ v7 = computeMissingVector(u3, w, v7);
+ } else if (!uZero && !vZero && wZero) {
+ w = computeMissingVector(v7, u3, w);
+ } else if (!uZero) {
+ v7 = findOrthogonalVector(u3, v7);
+ w = computeMissingVector(v7, u3, w);
+ } else if (!vZero) {
+ u3 = findOrthogonalVector(v7, u3);
+ w = computeMissingVector(v7, u3, w);
+ } else if (!wZero) {
+ u3 = findOrthogonalVector(w, u3);
+ v7 = computeMissingVector(w, u3, v7);
+ }
+ Matrix3_default.setColumn(halfAxes, 0, u3, halfAxes);
+ Matrix3_default.setColumn(halfAxes, 1, v7, halfAxes);
+ Matrix3_default.setColumn(halfAxes, 2, w, halfAxes);
+ return halfAxes;
+}
+function TileOrientedBoundingBox(center, halfAxes) {
+ halfAxes = checkHalfAxes(halfAxes);
+ this._orientedBoundingBox = new OrientedBoundingBox_default(center, halfAxes);
+ this._boundingSphere = BoundingSphere_default.fromOrientedBoundingBox(
+ this._orientedBoundingBox
+ );
+}
+Object.defineProperties(TileOrientedBoundingBox.prototype, {
+ boundingVolume: {
+ get: function() {
+ return this._orientedBoundingBox;
+ }
+ },
+ boundingSphere: {
+ get: function() {
+ return this._boundingSphere;
+ }
+ }
+});
+TileOrientedBoundingBox.prototype.distanceToCamera = function(frameState) {
+ Check_default.defined("frameState", frameState);
+ return Math.sqrt(
+ this._orientedBoundingBox.distanceSquaredTo(frameState.camera.positionWC)
+ );
+};
+TileOrientedBoundingBox.prototype.intersectPlane = function(plane) {
+ Check_default.defined("plane", plane);
+ return this._orientedBoundingBox.intersectPlane(plane);
+};
+TileOrientedBoundingBox.prototype.update = function(center, halfAxes) {
+ Cartesian3_default.clone(center, this._orientedBoundingBox.center);
+ halfAxes = checkHalfAxes(halfAxes);
+ Matrix3_default.clone(halfAxes, this._orientedBoundingBox.halfAxes);
+ BoundingSphere_default.fromOrientedBoundingBox(
+ this._orientedBoundingBox,
+ this._boundingSphere
+ );
+};
+TileOrientedBoundingBox.prototype.createDebugVolume = function(color) {
+ Check_default.defined("color", color);
+ const geometry = new BoxOutlineGeometry_default({
+ minimum: new Cartesian3_default(-1, -1, -1),
+ maximum: new Cartesian3_default(1, 1, 1)
+ });
+ const modelMatrix = Matrix4_default.fromRotationTranslation(
+ this.boundingVolume.halfAxes,
+ this.boundingVolume.center
+ );
+ const instance = new GeometryInstance_default({
+ geometry,
+ id: "outline",
+ modelMatrix,
+ attributes: {
+ color: ColorGeometryInstanceAttribute_default.fromColor(color)
+ }
+ });
+ return new Primitive_default({
+ geometryInstances: instance,
+ appearance: new PerInstanceColorAppearance_default({
+ translucent: false,
+ flat: true
+ }),
+ asynchronous: false
+ });
+};
+var TileOrientedBoundingBox_default = TileOrientedBoundingBox;
+
+// Source/Scene/Cesium3DTile.js
+function Cesium3DTile(tileset, baseResource2, header, parent) {
+ this._tileset = tileset;
+ this._header = header;
+ const hasContentsArray = defined_default(header.contents);
+ const hasMultipleContents = hasContentsArray && header.contents.length > 1 || hasExtension_default(header, "3DTILES_multiple_contents");
+ const contentHeader = hasContentsArray && !hasMultipleContents ? header.contents[0] : header.content;
+ this._contentHeader = contentHeader;
+ this.transform = defined_default(header.transform) ? Matrix4_default.unpack(header.transform) : Matrix4_default.clone(Matrix4_default.IDENTITY);
+ const parentTransform = defined_default(parent) ? parent.computedTransform : tileset.modelMatrix;
+ const computedTransform = Matrix4_default.multiply(
+ parentTransform,
+ this.transform,
+ new Matrix4_default()
+ );
+ const parentInitialTransform = defined_default(parent) ? parent._initialTransform : Matrix4_default.IDENTITY;
+ this._initialTransform = Matrix4_default.multiply(
+ parentInitialTransform,
+ this.transform,
+ new Matrix4_default()
+ );
+ this.computedTransform = computedTransform;
+ this._boundingVolume = this.createBoundingVolume(
+ header.boundingVolume,
+ computedTransform
+ );
+ this._boundingVolume2D = void 0;
+ let contentBoundingVolume;
+ if (defined_default(contentHeader) && defined_default(contentHeader.boundingVolume)) {
+ contentBoundingVolume = this.createBoundingVolume(
+ contentHeader.boundingVolume,
+ computedTransform
+ );
+ }
+ this._contentBoundingVolume = contentBoundingVolume;
+ this._contentBoundingVolume2D = void 0;
+ let viewerRequestVolume;
+ if (defined_default(header.viewerRequestVolume)) {
+ viewerRequestVolume = this.createBoundingVolume(
+ header.viewerRequestVolume,
+ computedTransform
+ );
+ }
+ this._viewerRequestVolume = viewerRequestVolume;
+ this.geometricError = header.geometricError;
+ this._geometricError = header.geometricError;
+ if (!defined_default(this._geometricError)) {
+ this._geometricError = defined_default(parent) ? parent.geometricError : tileset._geometricError;
+ Cesium3DTile._deprecationWarning(
+ "geometricErrorUndefined",
+ "Required property geometricError is undefined for this tile. Using parent's geometric error instead."
+ );
+ }
+ this.updateGeometricErrorScale();
+ let refine;
+ if (defined_default(header.refine)) {
+ if (header.refine === "replace" || header.refine === "add") {
+ Cesium3DTile._deprecationWarning(
+ "lowercase-refine",
+ `This tile uses a lowercase refine "${header.refine}". Instead use "${header.refine.toUpperCase()}".`
+ );
+ }
+ refine = header.refine.toUpperCase() === "REPLACE" ? Cesium3DTileRefine_default.REPLACE : Cesium3DTileRefine_default.ADD;
+ } else if (defined_default(parent)) {
+ refine = parent.refine;
+ } else {
+ refine = Cesium3DTileRefine_default.REPLACE;
+ }
+ this.refine = refine;
+ this.children = [];
+ this.parent = parent;
+ let content;
+ let hasEmptyContent3 = false;
+ let contentState;
+ let contentResource;
+ let serverKey;
+ baseResource2 = Resource_default.createIfNeeded(baseResource2);
+ if (hasMultipleContents) {
+ contentState = Cesium3DTileContentState_default.UNLOADED;
+ contentResource = baseResource2.clone();
+ } else if (defined_default(contentHeader)) {
+ let contentHeaderUri = contentHeader.uri;
+ if (defined_default(contentHeader.url)) {
+ Cesium3DTile._deprecationWarning(
+ "contentUrl",
+ 'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'
+ );
+ contentHeaderUri = contentHeader.url;
+ }
+ if (contentHeaderUri === "") {
+ Cesium3DTile._deprecationWarning(
+ "contentUriEmpty",
+ "content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"
+ );
+ content = new Empty3DTileContent_default(tileset, this);
+ hasEmptyContent3 = true;
+ contentState = Cesium3DTileContentState_default.READY;
+ } else {
+ contentState = Cesium3DTileContentState_default.UNLOADED;
+ contentResource = baseResource2.getDerivedResource({
+ url: contentHeaderUri
+ });
+ serverKey = RequestScheduler_default.getServerKey(
+ contentResource.getUrlComponent()
+ );
+ }
+ } else {
+ content = new Empty3DTileContent_default(tileset, this);
+ hasEmptyContent3 = true;
+ contentState = Cesium3DTileContentState_default.READY;
+ }
+ this._content = content;
+ this._contentResource = contentResource;
+ this._contentState = contentState;
+ this._contentReadyToProcessPromise = void 0;
+ this._contentReadyPromise = void 0;
+ this._expiredContent = void 0;
+ this._serverKey = serverKey;
+ this.hasEmptyContent = hasEmptyContent3;
+ this.hasTilesetContent = false;
+ this.hasImplicitContent = false;
+ this.hasImplicitContentMetadata = false;
+ this.hasMultipleContents = hasMultipleContents;
+ this.metadata = findTileMetadata_default(tileset, header);
+ this.cacheNode = void 0;
+ const expire = header.expire;
+ let expireDuration;
+ let expireDate;
+ if (defined_default(expire)) {
+ expireDuration = expire.duration;
+ if (defined_default(expire.date)) {
+ expireDate = JulianDate_default.fromIso8601(expire.date);
+ }
+ }
+ this.expireDuration = expireDuration;
+ this.expireDate = expireDate;
+ this.lastStyleTime = 0;
+ this._optimChildrenWithinParent = Cesium3DTileOptimizationHint_default.NOT_COMPUTED;
+ this.clippingPlanesDirty = false;
+ this.priorityDeferred = false;
+ this.implicitTileset = void 0;
+ this.implicitCoordinates = void 0;
+ this.implicitSubtree = void 0;
+ this._distanceToCamera = 0;
+ this._centerZDepth = 0;
+ this._screenSpaceError = 0;
+ this._screenSpaceErrorProgressiveResolution = 0;
+ this._visibilityPlaneMask = 0;
+ this._visible = false;
+ this._inRequestVolume = false;
+ this._finalResolution = true;
+ this._depth = 0;
+ this._stackLength = 0;
+ this._selectionDepth = 0;
+ this._updatedVisibilityFrame = 0;
+ this._touchedFrame = 0;
+ this._visitedFrame = 0;
+ this._selectedFrame = 0;
+ this._requestedFrame = 0;
+ this._ancestorWithContent = void 0;
+ this._ancestorWithContentAvailable = void 0;
+ this._refines = false;
+ this._shouldSelect = false;
+ this._isClipped = true;
+ this._clippingPlanesState = 0;
+ this._debugBoundingVolume = void 0;
+ this._debugContentBoundingVolume = void 0;
+ this._debugViewerRequestVolume = void 0;
+ this._debugColor = Color_default.fromRandom({ alpha: 1 });
+ this._debugColorizeTiles = false;
+ this._priority = 0;
+ this._priorityHolder = this;
+ this._priorityProgressiveResolution = false;
+ this._priorityProgressiveResolutionScreenSpaceErrorLeaf = false;
+ this._priorityReverseScreenSpaceError = 0;
+ this._foveatedFactor = 0;
+ this._wasMinPriorityChild = false;
+ this._loadTimestamp = new JulianDate_default();
+ this._commandsLength = 0;
+ this._color = void 0;
+ this._colorDirty = false;
+ this._request = void 0;
+}
+Cesium3DTile._deprecationWarning = deprecationWarning_default;
+Object.defineProperties(Cesium3DTile.prototype, {
+ tileset: {
+ get: function() {
+ return this._tileset;
+ }
+ },
+ content: {
+ get: function() {
+ return this._content;
+ }
+ },
+ boundingVolume: {
+ get: function() {
+ return this._boundingVolume;
+ }
+ },
+ contentBoundingVolume: {
+ get: function() {
+ return defaultValue_default(this._contentBoundingVolume, this._boundingVolume);
+ }
+ },
+ boundingSphere: {
+ get: function() {
+ return this._boundingVolume.boundingSphere;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._header.extras;
+ }
+ },
+ color: {
+ get: function() {
+ if (!defined_default(this._color)) {
+ this._color = new Color_default();
+ }
+ return Color_default.clone(this._color);
+ },
+ set: function(value) {
+ this._color = Color_default.clone(value, this._color);
+ this._colorDirty = true;
+ }
+ },
+ contentAvailable: {
+ get: function() {
+ return this.contentReady && !this.hasEmptyContent && !this.hasTilesetContent && !this.hasImplicitContent || defined_default(this._expiredContent) && !this.contentFailed;
+ }
+ },
+ contentReady: {
+ get: function() {
+ return this._contentState === Cesium3DTileContentState_default.READY;
+ }
+ },
+ contentUnloaded: {
+ get: function() {
+ return this._contentState === Cesium3DTileContentState_default.UNLOADED;
+ }
+ },
+ contentExpired: {
+ get: function() {
+ return this._contentState === Cesium3DTileContentState_default.EXPIRED;
+ }
+ },
+ contentFailed: {
+ get: function() {
+ return this._contentState === Cesium3DTileContentState_default.FAILED;
+ }
+ },
+ contentReadyToProcessPromise: {
+ get: function() {
+ return this._contentReadyToProcessPromise;
+ }
+ },
+ contentReadyPromise: {
+ get: function() {
+ return this._contentReadyPromise;
+ }
+ },
+ commandsLength: {
+ get: function() {
+ return this._commandsLength;
+ }
+ }
+});
+var scratchCartesian9 = new Cartesian3_default();
+function isPriorityDeferred(tile, frameState) {
+ const tileset = tile._tileset;
+ const camera = frameState.camera;
+ const boundingSphere = tile.boundingSphere;
+ const radius = boundingSphere.radius;
+ const scaledCameraDirection = Cartesian3_default.multiplyByScalar(
+ camera.directionWC,
+ tile._centerZDepth,
+ scratchCartesian9
+ );
+ const closestPointOnLine = Cartesian3_default.add(
+ camera.positionWC,
+ scaledCameraDirection,
+ scratchCartesian9
+ );
+ const toLine = Cartesian3_default.subtract(
+ closestPointOnLine,
+ boundingSphere.center,
+ scratchCartesian9
+ );
+ const distanceToCenterLine = Cartesian3_default.magnitude(toLine);
+ const notTouchingSphere = distanceToCenterLine > radius;
+ if (notTouchingSphere) {
+ const toLineNormalized = Cartesian3_default.normalize(toLine, scratchCartesian9);
+ const scaledToLine = Cartesian3_default.multiplyByScalar(
+ toLineNormalized,
+ radius,
+ scratchCartesian9
+ );
+ const closestOnSphere = Cartesian3_default.add(
+ boundingSphere.center,
+ scaledToLine,
+ scratchCartesian9
+ );
+ const toClosestOnSphere = Cartesian3_default.subtract(
+ closestOnSphere,
+ camera.positionWC,
+ scratchCartesian9
+ );
+ const toClosestOnSphereNormalize = Cartesian3_default.normalize(
+ toClosestOnSphere,
+ scratchCartesian9
+ );
+ tile._foveatedFactor = 1 - Math.abs(Cartesian3_default.dot(camera.directionWC, toClosestOnSphereNormalize));
+ } else {
+ tile._foveatedFactor = 0;
+ }
+ const replace = tile.refine === Cesium3DTileRefine_default.REPLACE;
+ const skipLevelOfDetail2 = tileset._skipLevelOfDetail;
+ if (replace && !skipLevelOfDetail2 || !tileset.foveatedScreenSpaceError || tileset.foveatedConeSize === 1 || tile._priorityProgressiveResolution && replace && skipLevelOfDetail2 || tileset._pass === Cesium3DTilePass_default.PRELOAD_FLIGHT || tileset._pass === Cesium3DTilePass_default.PRELOAD) {
+ return false;
+ }
+ const maximumFovatedFactor = 1 - Math.cos(camera.frustum.fov * 0.5);
+ const foveatedConeFactor = tileset.foveatedConeSize * maximumFovatedFactor;
+ if (tile._foveatedFactor <= foveatedConeFactor) {
+ return false;
+ }
+ const range2 = maximumFovatedFactor - foveatedConeFactor;
+ const normalizedFoveatedFactor = Math_default.clamp(
+ (tile._foveatedFactor - foveatedConeFactor) / range2,
+ 0,
+ 1
+ );
+ const sseRelaxation = tileset.foveatedInterpolationCallback(
+ tileset.foveatedMinimumScreenSpaceErrorRelaxation,
+ tileset.maximumScreenSpaceError,
+ normalizedFoveatedFactor
+ );
+ const sse = tile._screenSpaceError === 0 && defined_default(tile.parent) ? tile.parent._screenSpaceError * 0.5 : tile._screenSpaceError;
+ return tileset.maximumScreenSpaceError - sseRelaxation <= sse;
+}
+var scratchJulianDate = new JulianDate_default();
+Cesium3DTile.prototype.getScreenSpaceError = function(frameState, useParentGeometricError, progressiveResolutionHeightFraction) {
+ const tileset = this._tileset;
+ const heightFraction = defaultValue_default(progressiveResolutionHeightFraction, 1);
+ const parentGeometricError = defined_default(this.parent) ? this.parent.geometricError : tileset._geometricError;
+ const geometricError = useParentGeometricError ? parentGeometricError : this.geometricError;
+ if (geometricError === 0) {
+ return 0;
+ }
+ const camera = frameState.camera;
+ let frustum = camera.frustum;
+ const context = frameState.context;
+ const width = context.drawingBufferWidth;
+ const height = context.drawingBufferHeight * heightFraction;
+ let error;
+ if (frameState.mode === SceneMode_default.SCENE2D || frustum instanceof OrthographicFrustum_default) {
+ if (defined_default(frustum._offCenterFrustum)) {
+ frustum = frustum._offCenterFrustum;
+ }
+ const pixelSize = Math.max(frustum.top - frustum.bottom, frustum.right - frustum.left) / Math.max(width, height);
+ error = geometricError / pixelSize;
+ } else {
+ const distance2 = Math.max(this._distanceToCamera, Math_default.EPSILON7);
+ const sseDenominator = camera.frustum.sseDenominator;
+ error = geometricError * height / (distance2 * sseDenominator);
+ if (tileset.dynamicScreenSpaceError) {
+ const density = tileset._dynamicScreenSpaceErrorComputedDensity;
+ const factor2 = tileset.dynamicScreenSpaceErrorFactor;
+ const dynamicError = Math_default.fog(distance2, density) * factor2;
+ error -= dynamicError;
+ }
+ }
+ error /= frameState.pixelRatio;
+ return error;
+};
+function isPriorityProgressiveResolution(tileset, tile) {
+ if (tileset.progressiveResolutionHeightFraction <= 0 || tileset.progressiveResolutionHeightFraction > 0.5) {
+ return false;
+ }
+ let isProgressiveResolutionTile = tile._screenSpaceErrorProgressiveResolution > tileset._maximumScreenSpaceError;
+ tile._priorityProgressiveResolutionScreenSpaceErrorLeaf = false;
+ const parent = tile.parent;
+ const maximumScreenSpaceError = tileset._maximumScreenSpaceError;
+ const tilePasses = tile._screenSpaceErrorProgressiveResolution <= maximumScreenSpaceError;
+ const parentFails = defined_default(parent) && parent._screenSpaceErrorProgressiveResolution > maximumScreenSpaceError;
+ if (tilePasses && parentFails) {
+ tile._priorityProgressiveResolutionScreenSpaceErrorLeaf = true;
+ isProgressiveResolutionTile = true;
+ }
+ return isProgressiveResolutionTile;
+}
+function getPriorityReverseScreenSpaceError(tileset, tile) {
+ const parent = tile.parent;
+ const useParentScreenSpaceError = defined_default(parent) && (!tileset._skipLevelOfDetail || tile._screenSpaceError === 0 || parent.hasTilesetContent || parent.hasImplicitContent);
+ const screenSpaceError2 = useParentScreenSpaceError ? parent._screenSpaceError : tile._screenSpaceError;
+ return tileset.root._screenSpaceError - screenSpaceError2;
+}
+Cesium3DTile.prototype.updateVisibility = function(frameState) {
+ const parent = this.parent;
+ const tileset = this._tileset;
+ const parentTransform = defined_default(parent) ? parent.computedTransform : tileset.modelMatrix;
+ const parentVisibilityPlaneMask = defined_default(parent) ? parent._visibilityPlaneMask : CullingVolume_default.MASK_INDETERMINATE;
+ this.updateTransform(parentTransform);
+ this._distanceToCamera = this.distanceToTile(frameState);
+ this._centerZDepth = this.distanceToTileCenter(frameState);
+ this._screenSpaceError = this.getScreenSpaceError(frameState, false);
+ this._screenSpaceErrorProgressiveResolution = this.getScreenSpaceError(
+ frameState,
+ false,
+ tileset.progressiveResolutionHeightFraction
+ );
+ this._visibilityPlaneMask = this.visibility(
+ frameState,
+ parentVisibilityPlaneMask
+ );
+ this._visible = this._visibilityPlaneMask !== CullingVolume_default.MASK_OUTSIDE;
+ this._inRequestVolume = this.insideViewerRequestVolume(frameState);
+ this._priorityReverseScreenSpaceError = getPriorityReverseScreenSpaceError(
+ tileset,
+ this
+ );
+ this._priorityProgressiveResolution = isPriorityProgressiveResolution(
+ tileset,
+ this
+ );
+ this.priorityDeferred = isPriorityDeferred(this, frameState);
+};
+Cesium3DTile.prototype.updateExpiration = function() {
+ if (defined_default(this.expireDate) && this.contentReady && !this.hasEmptyContent && !this.hasMultipleContents) {
+ const now2 = JulianDate_default.now(scratchJulianDate);
+ if (JulianDate_default.lessThan(this.expireDate, now2)) {
+ this._contentState = Cesium3DTileContentState_default.EXPIRED;
+ this._expiredContent = this._content;
+ }
+ }
+};
+function updateExpireDate(tile) {
+ if (defined_default(tile.expireDuration)) {
+ const expireDurationDate = JulianDate_default.now(scratchJulianDate);
+ JulianDate_default.addSeconds(
+ expireDurationDate,
+ tile.expireDuration,
+ expireDurationDate
+ );
+ if (defined_default(tile.expireDate)) {
+ if (JulianDate_default.lessThan(tile.expireDate, expireDurationDate)) {
+ JulianDate_default.clone(expireDurationDate, tile.expireDate);
+ }
+ } else {
+ tile.expireDate = JulianDate_default.clone(expireDurationDate);
+ }
+ }
+}
+function createPriorityFunction(tile) {
+ return function() {
+ return tile._priority;
+ };
+}
+Cesium3DTile.prototype.requestContent = function() {
+ if (this.hasEmptyContent) {
+ return 0;
+ }
+ if (this.hasMultipleContents) {
+ return requestMultipleContents(this);
+ }
+ return requestSingleContent(this);
+};
+function requestMultipleContents(tile) {
+ let multipleContents = tile._content;
+ const tileset = tile._tileset;
+ if (!defined_default(multipleContents)) {
+ const contentsJson = hasExtension_default(tile._header, "3DTILES_multiple_contents") ? tile._header.extensions["3DTILES_multiple_contents"] : tile._header;
+ multipleContents = new Multiple3DTileContent_default(
+ tileset,
+ tile,
+ tile._contentResource.clone(),
+ contentsJson
+ );
+ tile._content = multipleContents;
+ }
+ const backloggedRequestCount = multipleContents.requestInnerContents();
+ if (backloggedRequestCount > 0) {
+ return backloggedRequestCount;
+ }
+ tile._contentState = Cesium3DTileContentState_default.LOADING;
+ const contentReadyToProcessPromise = multipleContents.contentsFetchedPromise.then(
+ function() {
+ if (tile._contentState !== Cesium3DTileContentState_default.LOADING || !defined_default(multipleContents.readyPromise)) {
+ return;
+ }
+ if (tile.isDestroyed()) {
+ multipleContentFailed(
+ tile,
+ tileset,
+ "Tile was unloaded while content was loading"
+ );
+ return;
+ }
+ tile._contentState = Cesium3DTileContentState_default.PROCESSING;
+ return multipleContents;
+ }
+ );
+ tile._contentReadyToProcessPromise = contentReadyToProcessPromise;
+ tile._contentReadyPromise = contentReadyToProcessPromise.then(function(content) {
+ if (!defined_default(content)) {
+ return;
+ }
+ return multipleContents.readyPromise;
+ }).then(function(content) {
+ if (!defined_default(content)) {
+ return;
+ }
+ if (tile.isDestroyed()) {
+ multipleContentFailed(
+ tile,
+ tileset,
+ "Tile was unloaded while content was processing"
+ );
+ return;
+ }
+ tile._selectedFrame = 0;
+ tile.lastStyleTime = 0;
+ JulianDate_default.now(tile._loadTimestamp);
+ tile._contentState = Cesium3DTileContentState_default.READY;
+ return content;
+ }).catch(function(error) {
+ multipleContentFailed(tile, tileset, error);
+ });
+ return 0;
+}
+function multipleContentFailed(tile, tileset, error) {
+ if (tile._contentState === Cesium3DTileContentState_default.PROCESSING) {
+ --tileset.statistics.numberOfTilesProcessing;
+ }
+ tile._contentState = Cesium3DTileContentState_default.FAILED;
+}
+function requestSingleContent(tile) {
+ const resource = tile._contentResource.clone();
+ const expired = tile.contentExpired;
+ if (expired) {
+ resource.setQueryParameters({
+ expired: tile.expireDate.toString()
+ });
+ }
+ const request = new Request_default({
+ throttle: true,
+ throttleByServer: true,
+ type: RequestType_default.TILES3D,
+ priorityFunction: createPriorityFunction(tile),
+ serverKey: tile._serverKey
+ });
+ tile._request = request;
+ resource.request = request;
+ const promise = resource.fetchArrayBuffer();
+ if (!defined_default(promise)) {
+ return 1;
+ }
+ const previousState = tile._contentState;
+ const tileset = tile._tileset;
+ tile._contentState = Cesium3DTileContentState_default.LOADING;
+ ++tileset.statistics.numberOfPendingRequests;
+ const contentReadyToProcessPromise = promise.then(function(arrayBuffer) {
+ if (tile.isDestroyed()) {
+ singleContentFailed(tile, tileset);
+ return;
+ }
+ const content = makeContent(tile, arrayBuffer);
+ if (expired) {
+ tile.expireDate = void 0;
+ }
+ tile._content = content;
+ tile._contentState = Cesium3DTileContentState_default.PROCESSING;
+ return content;
+ });
+ tile._contentReadyToProcessPromise = contentReadyToProcessPromise;
+ tile._contentReadyPromise = contentReadyToProcessPromise.then(function(content) {
+ if (!defined_default(content)) {
+ return;
+ }
+ --tileset.statistics.numberOfPendingRequests;
+ return content.readyPromise;
+ }).then(function(content) {
+ if (!defined_default(content)) {
+ return;
+ }
+ if (tile.isDestroyed()) {
+ singleContentFailed(tile, tileset);
+ return;
+ }
+ updateExpireDate(tile);
+ tile._selectedFrame = 0;
+ tile.lastStyleTime = 0;
+ JulianDate_default.now(tile._loadTimestamp);
+ tile._contentState = Cesium3DTileContentState_default.READY;
+ return content;
+ }).catch(function(error) {
+ if (request.state === RequestState_default.CANCELLED) {
+ tile._contentState = previousState;
+ --tileset.statistics.numberOfPendingRequests;
+ ++tileset.statistics.numberOfAttemptedRequests;
+ return Promise.reject("Cancelled");
+ }
+ singleContentFailed(tile, tileset);
+ return Promise.reject(error);
+ });
+ return 0;
+}
+function singleContentFailed(tile, tileset) {
+ if (tile._contentState === Cesium3DTileContentState_default.PROCESSING) {
+ --tileset.statistics.numberOfTilesProcessing;
+ } else {
+ --tileset.statistics.numberOfPendingRequests;
+ }
+ tile._contentState = Cesium3DTileContentState_default.FAILED;
+}
+function makeContent(tile, arrayBuffer) {
+ const preprocessed = preprocess3DTileContent_default(arrayBuffer);
+ const tileset = tile._tileset;
+ tileset._disableSkipLevelOfDetail = tileset._disableSkipLevelOfDetail || preprocessed.contentType === Cesium3DTileContentType_default.GEOMETRY || preprocessed.contentType === Cesium3DTileContentType_default.VECTOR;
+ if (preprocessed.contentType === Cesium3DTileContentType_default.IMPLICIT_SUBTREE || preprocessed.contentType === Cesium3DTileContentType_default.IMPLICIT_SUBTREE_JSON) {
+ tile.hasImplicitContent = true;
+ }
+ if (preprocessed.contentType === Cesium3DTileContentType_default.EXTERNAL_TILESET) {
+ tile.hasTilesetContent = true;
+ }
+ let content;
+ const contentFactory = Cesium3DTileContentFactory_default[preprocessed.contentType];
+ if (defined_default(preprocessed.binaryPayload)) {
+ content = contentFactory(
+ tileset,
+ tile,
+ tile._contentResource,
+ preprocessed.binaryPayload.buffer,
+ 0
+ );
+ } else {
+ content = contentFactory(
+ tileset,
+ tile,
+ tile._contentResource,
+ preprocessed.jsonPayload
+ );
+ }
+ const contentHeader = tile._contentHeader;
+ if (tile.hasImplicitContentMetadata) {
+ const subtree = tile.implicitSubtree;
+ const coordinates = tile.implicitCoordinates;
+ content.metadata = subtree.getContentMetadataView(coordinates, 0);
+ } else if (!tile.hasImplicitContent) {
+ content.metadata = findContentMetadata_default(tileset, contentHeader);
+ }
+ const groupMetadata = findGroupMetadata_default(tileset, contentHeader);
+ if (defined_default(groupMetadata)) {
+ content.group = new Cesium3DContentGroup_default({
+ metadata: groupMetadata
+ });
+ }
+ return content;
+}
+Cesium3DTile.prototype.cancelRequests = function() {
+ if (this.hasMultipleContents) {
+ this._content.cancelRequests();
+ } else {
+ this._request.cancel();
+ }
+};
+Cesium3DTile.prototype.unloadContent = function() {
+ if (this.hasEmptyContent || this.hasTilesetContent || this.hasImplicitContent) {
+ return;
+ }
+ this._content = this._content && this._content.destroy();
+ this._contentState = Cesium3DTileContentState_default.UNLOADED;
+ this._contentReadyToProcessPromise = void 0;
+ this._contentReadyPromise = void 0;
+ this.lastStyleTime = 0;
+ this.clippingPlanesDirty = this._clippingPlanesState === 0;
+ this._clippingPlanesState = 0;
+ this._debugColorizeTiles = false;
+ this._debugBoundingVolume = this._debugBoundingVolume && this._debugBoundingVolume.destroy();
+ this._debugContentBoundingVolume = this._debugContentBoundingVolume && this._debugContentBoundingVolume.destroy();
+ this._debugViewerRequestVolume = this._debugViewerRequestVolume && this._debugViewerRequestVolume.destroy();
+};
+var scratchProjectedBoundingSphere = new BoundingSphere_default();
+function getBoundingVolume(tile, frameState) {
+ if (frameState.mode !== SceneMode_default.SCENE3D && !defined_default(tile._boundingVolume2D)) {
+ const boundingSphere = tile._boundingVolume.boundingSphere;
+ const sphere = BoundingSphere_default.projectTo2D(
+ boundingSphere,
+ frameState.mapProjection,
+ scratchProjectedBoundingSphere
+ );
+ tile._boundingVolume2D = new TileBoundingSphere_default(
+ sphere.center,
+ sphere.radius
+ );
+ }
+ return frameState.mode !== SceneMode_default.SCENE3D ? tile._boundingVolume2D : tile._boundingVolume;
+}
+function getContentBoundingVolume2(tile, frameState) {
+ if (frameState.mode !== SceneMode_default.SCENE3D && !defined_default(tile._contentBoundingVolume2D)) {
+ const boundingSphere = tile._contentBoundingVolume.boundingSphere;
+ const sphere = BoundingSphere_default.projectTo2D(
+ boundingSphere,
+ frameState.mapProjection,
+ scratchProjectedBoundingSphere
+ );
+ tile._contentBoundingVolume2D = new TileBoundingSphere_default(
+ sphere.center,
+ sphere.radius
+ );
+ }
+ return frameState.mode !== SceneMode_default.SCENE3D ? tile._contentBoundingVolume2D : tile._contentBoundingVolume;
+}
+Cesium3DTile.prototype.visibility = function(frameState, parentVisibilityPlaneMask) {
+ const cullingVolume = frameState.cullingVolume;
+ const boundingVolume = getBoundingVolume(this, frameState);
+ const tileset = this._tileset;
+ const clippingPlanes = tileset.clippingPlanes;
+ if (defined_default(clippingPlanes) && clippingPlanes.enabled) {
+ const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(
+ boundingVolume,
+ tileset.clippingPlanesOriginMatrix
+ );
+ this._isClipped = intersection !== Intersect_default.INSIDE;
+ if (intersection === Intersect_default.OUTSIDE) {
+ return CullingVolume_default.MASK_OUTSIDE;
+ }
+ }
+ return cullingVolume.computeVisibilityWithPlaneMask(
+ boundingVolume,
+ parentVisibilityPlaneMask
+ );
+};
+Cesium3DTile.prototype.contentVisibility = function(frameState) {
+ if (!defined_default(this._contentBoundingVolume)) {
+ return Intersect_default.INSIDE;
+ }
+ if (this._visibilityPlaneMask === CullingVolume_default.MASK_INSIDE) {
+ return Intersect_default.INSIDE;
+ }
+ const cullingVolume = frameState.cullingVolume;
+ const boundingVolume = getContentBoundingVolume2(this, frameState);
+ const tileset = this._tileset;
+ const clippingPlanes = tileset.clippingPlanes;
+ if (defined_default(clippingPlanes) && clippingPlanes.enabled) {
+ const intersection = clippingPlanes.computeIntersectionWithBoundingVolume(
+ boundingVolume,
+ tileset.clippingPlanesOriginMatrix
+ );
+ this._isClipped = intersection !== Intersect_default.INSIDE;
+ if (intersection === Intersect_default.OUTSIDE) {
+ return Intersect_default.OUTSIDE;
+ }
+ }
+ return cullingVolume.computeVisibility(boundingVolume);
+};
+Cesium3DTile.prototype.distanceToTile = function(frameState) {
+ const boundingVolume = getBoundingVolume(this, frameState);
+ return boundingVolume.distanceToCamera(frameState);
+};
+var scratchToTileCenter = new Cartesian3_default();
+Cesium3DTile.prototype.distanceToTileCenter = function(frameState) {
+ const tileBoundingVolume = getBoundingVolume(this, frameState);
+ const boundingVolume = tileBoundingVolume.boundingVolume;
+ const toCenter = Cartesian3_default.subtract(
+ boundingVolume.center,
+ frameState.camera.positionWC,
+ scratchToTileCenter
+ );
+ return Cartesian3_default.dot(frameState.camera.directionWC, toCenter);
+};
+Cesium3DTile.prototype.insideViewerRequestVolume = function(frameState) {
+ const viewerRequestVolume = this._viewerRequestVolume;
+ return !defined_default(viewerRequestVolume) || viewerRequestVolume.distanceToCamera(frameState) === 0;
+};
+var scratchMatrix2 = new Matrix3_default();
+var scratchScale3 = new Cartesian3_default();
+var scratchHalfAxes2 = new Matrix3_default();
+var scratchCenter4 = new Cartesian3_default();
+var scratchRectangle3 = new Rectangle_default();
+var scratchOrientedBoundingBox = new OrientedBoundingBox_default();
+var scratchTransform = new Matrix4_default();
+function createBox(box, transform3, result) {
+ let center = Cartesian3_default.fromElements(box[0], box[1], box[2], scratchCenter4);
+ let halfAxes = Matrix3_default.fromArray(box, 3, scratchHalfAxes2);
+ center = Matrix4_default.multiplyByPoint(transform3, center, center);
+ const rotationScale = Matrix4_default.getMatrix3(transform3, scratchMatrix2);
+ halfAxes = Matrix3_default.multiply(rotationScale, halfAxes, halfAxes);
+ if (defined_default(result)) {
+ result.update(center, halfAxes);
+ return result;
+ }
+ return new TileOrientedBoundingBox_default(center, halfAxes);
+}
+function createBoxFromTransformedRegion(region, transform3, initialTransform, result) {
+ const rectangle = Rectangle_default.unpack(region, 0, scratchRectangle3);
+ const minimumHeight = region[4];
+ const maximumHeight = region[5];
+ const orientedBoundingBox = OrientedBoundingBox_default.fromRectangle(
+ rectangle,
+ minimumHeight,
+ maximumHeight,
+ Ellipsoid_default.WGS84,
+ scratchOrientedBoundingBox
+ );
+ let center = orientedBoundingBox.center;
+ let halfAxes = orientedBoundingBox.halfAxes;
+ transform3 = Matrix4_default.multiplyTransformation(
+ transform3,
+ Matrix4_default.inverseTransformation(initialTransform, scratchTransform),
+ scratchTransform
+ );
+ center = Matrix4_default.multiplyByPoint(transform3, center, center);
+ const rotationScale = Matrix4_default.getMatrix3(transform3, scratchMatrix2);
+ halfAxes = Matrix3_default.multiply(rotationScale, halfAxes, halfAxes);
+ if (defined_default(result) && result instanceof TileOrientedBoundingBox_default) {
+ result.update(center, halfAxes);
+ return result;
+ }
+ return new TileOrientedBoundingBox_default(center, halfAxes);
+}
+function createRegion(region, transform3, initialTransform, result) {
+ if (!Matrix4_default.equalsEpsilon(transform3, initialTransform, Math_default.EPSILON8)) {
+ return createBoxFromTransformedRegion(
+ region,
+ transform3,
+ initialTransform,
+ result
+ );
+ }
+ if (defined_default(result)) {
+ return result;
+ }
+ const rectangleRegion = Rectangle_default.unpack(region, 0, scratchRectangle3);
+ return new TileBoundingRegion_default({
+ rectangle: rectangleRegion,
+ minimumHeight: region[4],
+ maximumHeight: region[5]
+ });
+}
+function createSphere(sphere, transform3, result) {
+ let center = Cartesian3_default.fromElements(
+ sphere[0],
+ sphere[1],
+ sphere[2],
+ scratchCenter4
+ );
+ let radius = sphere[3];
+ center = Matrix4_default.multiplyByPoint(transform3, center, center);
+ const scale = Matrix4_default.getScale(transform3, scratchScale3);
+ const uniformScale = Cartesian3_default.maximumComponent(scale);
+ radius *= uniformScale;
+ if (defined_default(result)) {
+ result.update(center, radius);
+ return result;
+ }
+ return new TileBoundingSphere_default(center, radius);
+}
+Cesium3DTile.prototype.createBoundingVolume = function(boundingVolumeHeader, transform3, result) {
+ if (!defined_default(boundingVolumeHeader)) {
+ throw new RuntimeError_default("boundingVolume must be defined");
+ }
+ if (hasExtension_default(boundingVolumeHeader, "3DTILES_bounding_volume_S2")) {
+ return new TileBoundingS2Cell_default(
+ boundingVolumeHeader.extensions["3DTILES_bounding_volume_S2"]
+ );
+ }
+ if (defined_default(boundingVolumeHeader.box)) {
+ return createBox(boundingVolumeHeader.box, transform3, result);
+ }
+ if (defined_default(boundingVolumeHeader.region)) {
+ return createRegion(
+ boundingVolumeHeader.region,
+ transform3,
+ this._initialTransform,
+ result
+ );
+ }
+ if (defined_default(boundingVolumeHeader.sphere)) {
+ return createSphere(boundingVolumeHeader.sphere, transform3, result);
+ }
+ throw new RuntimeError_default(
+ "boundingVolume must contain a sphere, region, or box"
+ );
+};
+Cesium3DTile.prototype.updateTransform = function(parentTransform) {
+ parentTransform = defaultValue_default(parentTransform, Matrix4_default.IDENTITY);
+ const computedTransform = Matrix4_default.multiply(
+ parentTransform,
+ this.transform,
+ scratchTransform
+ );
+ const transformChanged = !Matrix4_default.equals(
+ computedTransform,
+ this.computedTransform
+ );
+ if (!transformChanged) {
+ return;
+ }
+ Matrix4_default.clone(computedTransform, this.computedTransform);
+ const header = this._header;
+ const contentHeader = this._contentHeader;
+ this._boundingVolume = this.createBoundingVolume(
+ header.boundingVolume,
+ this.computedTransform,
+ this._boundingVolume
+ );
+ if (defined_default(this._contentBoundingVolume)) {
+ this._contentBoundingVolume = this.createBoundingVolume(
+ contentHeader.boundingVolume,
+ this.computedTransform,
+ this._contentBoundingVolume
+ );
+ }
+ if (defined_default(this._viewerRequestVolume)) {
+ this._viewerRequestVolume = this.createBoundingVolume(
+ header.viewerRequestVolume,
+ this.computedTransform,
+ this._viewerRequestVolume
+ );
+ }
+ this.updateGeometricErrorScale();
+ this._debugBoundingVolume = this._debugBoundingVolume && this._debugBoundingVolume.destroy();
+ this._debugContentBoundingVolume = this._debugContentBoundingVolume && this._debugContentBoundingVolume.destroy();
+ this._debugViewerRequestVolume = this._debugViewerRequestVolume && this._debugViewerRequestVolume.destroy();
+};
+Cesium3DTile.prototype.updateGeometricErrorScale = function() {
+ const scale = Matrix4_default.getScale(this.computedTransform, scratchScale3);
+ const uniformScale = Cartesian3_default.maximumComponent(scale);
+ this.geometricError = this._geometricError * uniformScale;
+};
+function applyDebugSettings(tile, tileset, frameState, passOptions2) {
+ if (!passOptions2.isRender) {
+ return;
+ }
+ const hasContentBoundingVolume = defined_default(tile._contentHeader) && defined_default(tile._contentHeader.boundingVolume);
+ const empty = tile.hasEmptyContent || tile.hasTilesetContent || tile.hasImplicitContent;
+ const showVolume = tileset.debugShowBoundingVolume || tileset.debugShowContentBoundingVolume && !hasContentBoundingVolume;
+ if (showVolume) {
+ let color;
+ if (!tile._finalResolution) {
+ color = Color_default.YELLOW;
+ } else if (empty) {
+ color = Color_default.DARKGRAY;
+ } else {
+ color = Color_default.WHITE;
+ }
+ if (!defined_default(tile._debugBoundingVolume)) {
+ tile._debugBoundingVolume = tile._boundingVolume.createDebugVolume(color);
+ }
+ tile._debugBoundingVolume.update(frameState);
+ const attributes = tile._debugBoundingVolume.getGeometryInstanceAttributes(
+ "outline"
+ );
+ attributes.color = ColorGeometryInstanceAttribute_default.toValue(
+ color,
+ attributes.color
+ );
+ } else if (!showVolume && defined_default(tile._debugBoundingVolume)) {
+ tile._debugBoundingVolume = tile._debugBoundingVolume.destroy();
+ }
+ if (tileset.debugShowContentBoundingVolume && hasContentBoundingVolume) {
+ if (!defined_default(tile._debugContentBoundingVolume)) {
+ tile._debugContentBoundingVolume = tile._contentBoundingVolume.createDebugVolume(
+ Color_default.BLUE
+ );
+ }
+ tile._debugContentBoundingVolume.update(frameState);
+ } else if (!tileset.debugShowContentBoundingVolume && defined_default(tile._debugContentBoundingVolume)) {
+ tile._debugContentBoundingVolume = tile._debugContentBoundingVolume.destroy();
+ }
+ if (tileset.debugShowViewerRequestVolume && defined_default(tile._viewerRequestVolume)) {
+ if (!defined_default(tile._debugViewerRequestVolume)) {
+ tile._debugViewerRequestVolume = tile._viewerRequestVolume.createDebugVolume(
+ Color_default.YELLOW
+ );
+ }
+ tile._debugViewerRequestVolume.update(frameState);
+ } else if (!tileset.debugShowViewerRequestVolume && defined_default(tile._debugViewerRequestVolume)) {
+ tile._debugViewerRequestVolume = tile._debugViewerRequestVolume.destroy();
+ }
+ const debugColorizeTilesOn = tileset.debugColorizeTiles && !tile._debugColorizeTiles || defined_default(tileset._heatmap.tilePropertyName);
+ const debugColorizeTilesOff = !tileset.debugColorizeTiles && tile._debugColorizeTiles;
+ if (debugColorizeTilesOn) {
+ tileset._heatmap.colorize(tile, frameState);
+ tile._debugColorizeTiles = true;
+ tile.color = tile._debugColor;
+ } else if (debugColorizeTilesOff) {
+ tile._debugColorizeTiles = false;
+ tile.color = Color_default.WHITE;
+ }
+ if (tile._colorDirty) {
+ tile._colorDirty = false;
+ tile._content.applyDebugSettings(true, tile._color);
+ }
+ if (debugColorizeTilesOff) {
+ tileset.makeStyleDirty();
+ }
+}
+function updateContent(tile, tileset, frameState) {
+ const content = tile._content;
+ const expiredContent = tile._expiredContent;
+ if (!tile.hasMultipleContents && defined_default(expiredContent)) {
+ if (!tile.contentReady) {
+ expiredContent.update(tileset, frameState);
+ return;
+ }
+ tile._expiredContent.destroy();
+ tile._expiredContent = void 0;
+ }
+ content.update(tileset, frameState);
+}
+function updateClippingPlanes2(tile, tileset) {
+ const clippingPlanes = tileset.clippingPlanes;
+ let currentClippingPlanesState = 0;
+ if (defined_default(clippingPlanes) && tile._isClipped && clippingPlanes.enabled) {
+ currentClippingPlanesState = clippingPlanes.clippingPlanesState;
+ }
+ if (currentClippingPlanesState !== tile._clippingPlanesState) {
+ tile._clippingPlanesState = currentClippingPlanesState;
+ tile.clippingPlanesDirty = true;
+ }
+}
+Cesium3DTile.prototype.update = function(tileset, frameState, passOptions2) {
+ const commandStart = frameState.commandList.length;
+ updateClippingPlanes2(this, tileset);
+ applyDebugSettings(this, tileset, frameState, passOptions2);
+ updateContent(this, tileset, frameState);
+ const commandEnd = frameState.commandList.length;
+ const commandsLength = commandEnd - commandStart;
+ this._commandsLength = commandsLength;
+ for (let i = 0; i < commandsLength; ++i) {
+ const command = frameState.commandList[commandStart + i];
+ const translucent = command.pass === Pass_default.TRANSLUCENT;
+ command.depthForTranslucentClassification = translucent;
+ }
+ this.clippingPlanesDirty = false;
+};
+var scratchCommandList = [];
+Cesium3DTile.prototype.process = function(tileset, frameState) {
+ const savedCommandList = frameState.commandList;
+ frameState.commandList = scratchCommandList;
+ this._content.update(tileset, frameState);
+ scratchCommandList.length = 0;
+ frameState.commandList = savedCommandList;
+};
+function isolateDigits(normalizedValue, numberOfDigits, leftShift) {
+ const scaled = normalizedValue * Math.pow(10, numberOfDigits);
+ const integer = parseInt(scaled);
+ return integer * Math.pow(10, leftShift);
+}
+function priorityNormalizeAndClamp(value, minimum, maximum) {
+ return Math.max(
+ Math_default.normalize(value, minimum, maximum) - Math_default.EPSILON7,
+ 0
+ );
+}
+Cesium3DTile.prototype.updatePriority = function() {
+ const tileset = this.tileset;
+ const preferLeaves = tileset.preferLeaves;
+ const minimumPriority = tileset._minimumPriority;
+ const maximumPriority = tileset._maximumPriority;
+ const digitsForANumber = 4;
+ const digitsForABoolean = 1;
+ const preferredSortingLeftShift = 0;
+ const preferredSortingDigitsCount = digitsForANumber;
+ const foveatedLeftShift = preferredSortingLeftShift + preferredSortingDigitsCount;
+ const foveatedDigitsCount = digitsForANumber;
+ const preloadProgressiveResolutionLeftShift = foveatedLeftShift + foveatedDigitsCount;
+ const preloadProgressiveResolutionDigitsCount = digitsForABoolean;
+ const preloadProgressiveResolutionScale = Math.pow(
+ 10,
+ preloadProgressiveResolutionLeftShift
+ );
+ const foveatedDeferLeftShift = preloadProgressiveResolutionLeftShift + preloadProgressiveResolutionDigitsCount;
+ const foveatedDeferDigitsCount = digitsForABoolean;
+ const foveatedDeferScale = Math.pow(10, foveatedDeferLeftShift);
+ const preloadFlightLeftShift = foveatedDeferLeftShift + foveatedDeferDigitsCount;
+ const preloadFlightScale = Math.pow(10, preloadFlightLeftShift);
+ let depthDigits = priorityNormalizeAndClamp(
+ this._depth,
+ minimumPriority.depth,
+ maximumPriority.depth
+ );
+ depthDigits = preferLeaves ? 1 - depthDigits : depthDigits;
+ const useDistance = !tileset._skipLevelOfDetail && this.refine === Cesium3DTileRefine_default.REPLACE;
+ const normalizedPreferredSorting = useDistance ? priorityNormalizeAndClamp(
+ this._priorityHolder._distanceToCamera,
+ minimumPriority.distance,
+ maximumPriority.distance
+ ) : priorityNormalizeAndClamp(
+ this._priorityReverseScreenSpaceError,
+ minimumPriority.reverseScreenSpaceError,
+ maximumPriority.reverseScreenSpaceError
+ );
+ const preferredSortingDigits = isolateDigits(
+ normalizedPreferredSorting,
+ preferredSortingDigitsCount,
+ preferredSortingLeftShift
+ );
+ const preloadProgressiveResolutionDigits = this._priorityProgressiveResolution ? 0 : preloadProgressiveResolutionScale;
+ const normalizedFoveatedFactor = priorityNormalizeAndClamp(
+ this._priorityHolder._foveatedFactor,
+ minimumPriority.foveatedFactor,
+ maximumPriority.foveatedFactor
+ );
+ const foveatedDigits = isolateDigits(
+ normalizedFoveatedFactor,
+ foveatedDigitsCount,
+ foveatedLeftShift
+ );
+ const foveatedDeferDigits = this.priorityDeferred ? foveatedDeferScale : 0;
+ const preloadFlightDigits = tileset._pass === Cesium3DTilePass_default.PRELOAD_FLIGHT ? 0 : preloadFlightScale;
+ this._priority = depthDigits + preferredSortingDigits + preloadProgressiveResolutionDigits + foveatedDigits + foveatedDeferDigits + preloadFlightDigits;
+};
+Cesium3DTile.prototype.isDestroyed = function() {
+ return false;
+};
+Cesium3DTile.prototype.destroy = function() {
+ this._content = this._content && this._content.destroy();
+ this._expiredContent = this._expiredContent && !this._expiredContent.isDestroyed() && this._expiredContent.destroy();
+ this._debugBoundingVolume = this._debugBoundingVolume && this._debugBoundingVolume.destroy();
+ this._debugContentBoundingVolume = this._debugContentBoundingVolume && this._debugContentBoundingVolume.destroy();
+ this._debugViewerRequestVolume = this._debugViewerRequestVolume && this._debugViewerRequestVolume.destroy();
+ return destroyObject_default(this);
+};
+var Cesium3DTile_default = Cesium3DTile;
+
+// Source/Scene/GroupMetadata.js
+function GroupMetadata(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const id = options.id;
+ const group = options.group;
+ const metadataClass = options.class;
+ Check_default.typeOf.object("options.group", group);
+ Check_default.typeOf.object("options.class", metadataClass);
+ const properties = defined_default(group.properties) ? group.properties : {};
+ this._class = metadataClass;
+ this._properties = properties;
+ this._id = id;
+ this._extras = group.extras;
+ this._extensions = group.extensions;
+}
+Object.defineProperties(GroupMetadata.prototype, {
+ class: {
+ get: function() {
+ return this._class;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+GroupMetadata.prototype.hasProperty = function(propertyId) {
+ return MetadataEntity_default.hasProperty(propertyId, this._properties, this._class);
+};
+GroupMetadata.prototype.hasPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.hasPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+GroupMetadata.prototype.getPropertyIds = function(results) {
+ return MetadataEntity_default.getPropertyIds(this._properties, this._class, results);
+};
+GroupMetadata.prototype.getProperty = function(propertyId) {
+ return MetadataEntity_default.getProperty(propertyId, this._properties, this._class);
+};
+GroupMetadata.prototype.setProperty = function(propertyId, value) {
+ return MetadataEntity_default.setProperty(
+ propertyId,
+ value,
+ this._properties,
+ this._class
+ );
+};
+GroupMetadata.prototype.getPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.getPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+GroupMetadata.prototype.setPropertyBySemantic = function(semantic, value) {
+ return MetadataEntity_default.setPropertyBySemantic(
+ semantic,
+ value,
+ this._properties,
+ this._class
+ );
+};
+var GroupMetadata_default = GroupMetadata;
+
+// Source/Scene/TilesetMetadata.js
+function TilesetMetadata(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const tileset = options.tileset;
+ const metadataClass = options.class;
+ Check_default.typeOf.object("options.tileset", tileset);
+ Check_default.typeOf.object("options.class", metadataClass);
+ const properties = defined_default(tileset.properties) ? tileset.properties : {};
+ this._class = metadataClass;
+ this._properties = properties;
+ this._extras = tileset.extras;
+ this._extensions = tileset.extensions;
+}
+Object.defineProperties(TilesetMetadata.prototype, {
+ class: {
+ get: function() {
+ return this._class;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+TilesetMetadata.prototype.hasProperty = function(propertyId) {
+ return MetadataEntity_default.hasProperty(propertyId, this._properties, this._class);
+};
+TilesetMetadata.prototype.hasPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.hasPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+TilesetMetadata.prototype.getPropertyIds = function(results) {
+ return MetadataEntity_default.getPropertyIds(this._properties, this._class, results);
+};
+TilesetMetadata.prototype.getProperty = function(propertyId) {
+ return MetadataEntity_default.getProperty(propertyId, this._properties, this._class);
+};
+TilesetMetadata.prototype.setProperty = function(propertyId, value) {
+ return MetadataEntity_default.setProperty(
+ propertyId,
+ value,
+ this._properties,
+ this._class
+ );
+};
+TilesetMetadata.prototype.getPropertyBySemantic = function(semantic) {
+ return MetadataEntity_default.getPropertyBySemantic(
+ semantic,
+ this._properties,
+ this._class
+ );
+};
+TilesetMetadata.prototype.setPropertyBySemantic = function(semantic, value) {
+ return MetadataEntity_default.setPropertyBySemantic(
+ semantic,
+ value,
+ this._properties,
+ this._class
+ );
+};
+var TilesetMetadata_default = TilesetMetadata;
+
+// Source/Scene/Cesium3DTilesetMetadata.js
+function Cesium3DTilesetMetadata(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const metadataJson = options.metadataJson;
+ const schema = options.schema;
+ Check_default.typeOf.object("options.metadataJson", metadataJson);
+ Check_default.typeOf.object("options.schema", schema);
+ const metadata = defaultValue_default(metadataJson.metadata, metadataJson.tileset);
+ let tileset;
+ if (defined_default(metadata)) {
+ tileset = new TilesetMetadata_default({
+ tileset: metadata,
+ class: schema.classes[metadata.class]
+ });
+ }
+ let groupIds = [];
+ const groups = [];
+ const groupsJson = metadataJson.groups;
+ if (Array.isArray(groupsJson)) {
+ const length3 = groupsJson.length;
+ for (let i = 0; i < length3; i++) {
+ const group = groupsJson[i];
+ groups.push(
+ new GroupMetadata_default({
+ group,
+ class: schema.classes[group.class]
+ })
+ );
+ }
+ } else if (defined_default(groupsJson)) {
+ groupIds = Object.keys(groupsJson).sort();
+ const length3 = groupIds.length;
+ for (let i = 0; i < length3; i++) {
+ const groupId = groupIds[i];
+ if (groupsJson.hasOwnProperty(groupId)) {
+ const group = groupsJson[groupId];
+ groups.push(
+ new GroupMetadata_default({
+ id: groupId,
+ group: groupsJson[groupId],
+ class: schema.classes[group.class]
+ })
+ );
+ }
+ }
+ }
+ this._schema = schema;
+ this._groups = groups;
+ this._groupIds = groupIds;
+ this._tileset = tileset;
+ this._statistics = metadataJson.statistics;
+ this._extras = metadataJson.extras;
+ this._extensions = metadataJson.extensions;
+}
+Object.defineProperties(Cesium3DTilesetMetadata.prototype, {
+ schema: {
+ get: function() {
+ return this._schema;
+ }
+ },
+ groups: {
+ get: function() {
+ return this._groups;
+ }
+ },
+ groupIds: {
+ get: function() {
+ return this._groupIds;
+ }
+ },
+ tileset: {
+ get: function() {
+ return this._tileset;
+ }
+ },
+ statistics: {
+ get: function() {
+ return this._statistics;
+ }
+ },
+ extras: {
+ get: function() {
+ return this._extras;
+ }
+ },
+ extensions: {
+ get: function() {
+ return this._extensions;
+ }
+ }
+});
+var Cesium3DTilesetMetadata_default = Cesium3DTilesetMetadata;
+
+// Source/Scene/Cesium3DTileOptimizations.js
+var Cesium3DTileOptimizations = {};
+var scratchAxis = new Cartesian3_default();
+Cesium3DTileOptimizations.checkChildrenWithinParent = function(tile) {
+ Check_default.typeOf.object("tile", tile);
+ const children = tile.children;
+ const length3 = children.length;
+ const boundingVolume = tile.boundingVolume;
+ if (boundingVolume instanceof TileOrientedBoundingBox_default || boundingVolume instanceof TileBoundingRegion_default) {
+ const orientedBoundingBox = boundingVolume._orientedBoundingBox;
+ tile._optimChildrenWithinParent = Cesium3DTileOptimizationHint_default.USE_OPTIMIZATION;
+ for (let i = 0; i < length3; ++i) {
+ const child = children[i];
+ const childBoundingVolume = child.boundingVolume;
+ if (!(childBoundingVolume instanceof TileOrientedBoundingBox_default || childBoundingVolume instanceof TileBoundingRegion_default)) {
+ tile._optimChildrenWithinParent = Cesium3DTileOptimizationHint_default.SKIP_OPTIMIZATION;
+ break;
+ }
+ const childOrientedBoundingBox = childBoundingVolume._orientedBoundingBox;
+ const axis = Cartesian3_default.subtract(
+ childOrientedBoundingBox.center,
+ orientedBoundingBox.center,
+ scratchAxis
+ );
+ const axisLength = Cartesian3_default.magnitude(axis);
+ Cartesian3_default.divideByScalar(axis, axisLength, axis);
+ const proj1 = Math.abs(orientedBoundingBox.halfAxes[0] * axis.x) + Math.abs(orientedBoundingBox.halfAxes[1] * axis.y) + Math.abs(orientedBoundingBox.halfAxes[2] * axis.z) + Math.abs(orientedBoundingBox.halfAxes[3] * axis.x) + Math.abs(orientedBoundingBox.halfAxes[4] * axis.y) + Math.abs(orientedBoundingBox.halfAxes[5] * axis.z) + Math.abs(orientedBoundingBox.halfAxes[6] * axis.x) + Math.abs(orientedBoundingBox.halfAxes[7] * axis.y) + Math.abs(orientedBoundingBox.halfAxes[8] * axis.z);
+ const proj2 = Math.abs(childOrientedBoundingBox.halfAxes[0] * axis.x) + Math.abs(childOrientedBoundingBox.halfAxes[1] * axis.y) + Math.abs(childOrientedBoundingBox.halfAxes[2] * axis.z) + Math.abs(childOrientedBoundingBox.halfAxes[3] * axis.x) + Math.abs(childOrientedBoundingBox.halfAxes[4] * axis.y) + Math.abs(childOrientedBoundingBox.halfAxes[5] * axis.z) + Math.abs(childOrientedBoundingBox.halfAxes[6] * axis.x) + Math.abs(childOrientedBoundingBox.halfAxes[7] * axis.y) + Math.abs(childOrientedBoundingBox.halfAxes[8] * axis.z);
+ if (proj1 <= proj2 + axisLength) {
+ tile._optimChildrenWithinParent = Cesium3DTileOptimizationHint_default.SKIP_OPTIMIZATION;
+ break;
+ }
+ }
+ }
+ return tile._optimChildrenWithinParent === Cesium3DTileOptimizationHint_default.USE_OPTIMIZATION;
+};
+var Cesium3DTileOptimizations_default = Cesium3DTileOptimizations;
+
+// Source/Core/DoublyLinkedList.js
+function DoublyLinkedList() {
+ this.head = void 0;
+ this.tail = void 0;
+ this._length = 0;
+}
+Object.defineProperties(DoublyLinkedList.prototype, {
+ length: {
+ get: function() {
+ return this._length;
+ }
+ }
+});
+function DoublyLinkedListNode(item, previous, next) {
+ this.item = item;
+ this.previous = previous;
+ this.next = next;
+}
+DoublyLinkedList.prototype.add = function(item) {
+ const node = new DoublyLinkedListNode(item, this.tail, void 0);
+ if (defined_default(this.tail)) {
+ this.tail.next = node;
+ this.tail = node;
+ } else {
+ this.head = node;
+ this.tail = node;
+ }
+ ++this._length;
+ return node;
+};
+function remove(list, node) {
+ if (defined_default(node.previous) && defined_default(node.next)) {
+ node.previous.next = node.next;
+ node.next.previous = node.previous;
+ } else if (defined_default(node.previous)) {
+ node.previous.next = void 0;
+ list.tail = node.previous;
+ } else if (defined_default(node.next)) {
+ node.next.previous = void 0;
+ list.head = node.next;
+ } else {
+ list.head = void 0;
+ list.tail = void 0;
+ }
+ node.next = void 0;
+ node.previous = void 0;
+}
+DoublyLinkedList.prototype.remove = function(node) {
+ if (!defined_default(node)) {
+ return;
+ }
+ remove(this, node);
+ --this._length;
+};
+DoublyLinkedList.prototype.splice = function(node, nextNode) {
+ if (node === nextNode) {
+ return;
+ }
+ remove(this, nextNode);
+ const oldNodeNext = node.next;
+ node.next = nextNode;
+ if (this.tail === node) {
+ this.tail = nextNode;
+ } else {
+ oldNodeNext.previous = nextNode;
+ }
+ nextNode.next = oldNodeNext;
+ nextNode.previous = node;
+};
+var DoublyLinkedList_default = DoublyLinkedList;
+
+// Source/Scene/Cesium3DTilesetCache.js
+function Cesium3DTilesetCache() {
+ this._list = new DoublyLinkedList_default();
+ this._sentinel = this._list.add();
+ this._trimTiles = false;
+}
+Cesium3DTilesetCache.prototype.reset = function() {
+ this._list.splice(this._list.tail, this._sentinel);
+};
+Cesium3DTilesetCache.prototype.touch = function(tile) {
+ const node = tile.cacheNode;
+ if (defined_default(node)) {
+ this._list.splice(this._sentinel, node);
+ }
+};
+Cesium3DTilesetCache.prototype.add = function(tile) {
+ if (!defined_default(tile.cacheNode)) {
+ tile.cacheNode = this._list.add(tile);
+ }
+};
+Cesium3DTilesetCache.prototype.unloadTile = function(tileset, tile, unloadCallback) {
+ const node = tile.cacheNode;
+ if (!defined_default(node)) {
+ return;
+ }
+ this._list.remove(node);
+ tile.cacheNode = void 0;
+ unloadCallback(tileset, tile);
+};
+Cesium3DTilesetCache.prototype.unloadTiles = function(tileset, unloadCallback) {
+ const trimTiles = this._trimTiles;
+ this._trimTiles = false;
+ const list = this._list;
+ const maximumMemoryUsageInBytes = tileset.maximumMemoryUsage * 1024 * 1024;
+ const sentinel = this._sentinel;
+ let node = list.head;
+ while (node !== sentinel && (tileset.totalMemoryUsageInBytes > maximumMemoryUsageInBytes || trimTiles)) {
+ const tile = node.item;
+ node = node.next;
+ this.unloadTile(tileset, tile, unloadCallback);
+ }
+};
+Cesium3DTilesetCache.prototype.trim = function() {
+ this._trimTiles = true;
+};
+var Cesium3DTilesetCache_default = Cesium3DTilesetCache;
+
+// Source/Scene/Cesium3DTilesetHeatmap.js
+function Cesium3DTilesetHeatmap(tilePropertyName) {
+ this.tilePropertyName = tilePropertyName;
+ this._minimum = Number.MAX_VALUE;
+ this._maximum = -Number.MAX_VALUE;
+ this._previousMinimum = Number.MAX_VALUE;
+ this._previousMaximum = -Number.MAX_VALUE;
+ this._referenceMinimum = {};
+ this._referenceMaximum = {};
+}
+function getHeatmapValue(tileValue, tilePropertyName) {
+ let value;
+ if (tilePropertyName === "_loadTimestamp") {
+ value = JulianDate_default.toDate(tileValue).getTime();
+ } else {
+ value = tileValue;
+ }
+ return value;
+}
+Cesium3DTilesetHeatmap.prototype.setReferenceMinimumMaximum = function(minimum, maximum, tilePropertyName) {
+ this._referenceMinimum[tilePropertyName] = getHeatmapValue(
+ minimum,
+ tilePropertyName
+ );
+ this._referenceMaximum[tilePropertyName] = getHeatmapValue(
+ maximum,
+ tilePropertyName
+ );
+};
+function getHeatmapValueAndUpdateMinimumMaximum(heatmap, tile) {
+ const tilePropertyName = heatmap.tilePropertyName;
+ if (defined_default(tilePropertyName)) {
+ const heatmapValue = getHeatmapValue(
+ tile[tilePropertyName],
+ tilePropertyName
+ );
+ if (!defined_default(heatmapValue)) {
+ heatmap.tilePropertyName = void 0;
+ return heatmapValue;
+ }
+ heatmap._maximum = Math.max(heatmapValue, heatmap._maximum);
+ heatmap._minimum = Math.min(heatmapValue, heatmap._minimum);
+ return heatmapValue;
+ }
+}
+var heatmapColors = [
+ new Color_default(0.1, 0.1, 0.1, 1),
+ new Color_default(0.153, 0.278, 0.878, 1),
+ new Color_default(0.827, 0.231, 0.49, 1),
+ new Color_default(0.827, 0.188, 0.22, 1),
+ new Color_default(1, 0.592, 0.259, 1),
+ new Color_default(1, 0.843, 0, 1)
+];
+Cesium3DTilesetHeatmap.prototype.colorize = function(tile, frameState) {
+ const tilePropertyName = this.tilePropertyName;
+ if (!defined_default(tilePropertyName) || !tile.contentAvailable || tile._selectedFrame !== frameState.frameNumber) {
+ return;
+ }
+ const heatmapValue = getHeatmapValueAndUpdateMinimumMaximum(this, tile);
+ const minimum = this._previousMinimum;
+ const maximum = this._previousMaximum;
+ if (minimum === Number.MAX_VALUE || maximum === -Number.MAX_VALUE) {
+ return;
+ }
+ const shiftedMax = maximum - minimum + Math_default.EPSILON7;
+ const shiftedValue = Math_default.clamp(
+ heatmapValue - minimum,
+ 0,
+ shiftedMax
+ );
+ const zeroToOne = shiftedValue / shiftedMax;
+ const lastIndex = heatmapColors.length - 1;
+ const colorPosition = zeroToOne * lastIndex;
+ const colorPositionFloor = Math.floor(colorPosition);
+ const colorPositionCeil = Math.ceil(colorPosition);
+ const t = colorPosition - colorPositionFloor;
+ const colorZero = heatmapColors[colorPositionFloor];
+ const colorOne = heatmapColors[colorPositionCeil];
+ const finalColor = Color_default.clone(Color_default.WHITE);
+ finalColor.red = Math_default.lerp(colorZero.red, colorOne.red, t);
+ finalColor.green = Math_default.lerp(colorZero.green, colorOne.green, t);
+ finalColor.blue = Math_default.lerp(colorZero.blue, colorOne.blue, t);
+ tile._debugColor = finalColor;
+};
+Cesium3DTilesetHeatmap.prototype.resetMinimumMaximum = function() {
+ const tilePropertyName = this.tilePropertyName;
+ if (defined_default(tilePropertyName)) {
+ const referenceMinimum = this._referenceMinimum[tilePropertyName];
+ const referenceMaximum = this._referenceMaximum[tilePropertyName];
+ const useReference = defined_default(referenceMinimum) && defined_default(referenceMaximum);
+ this._previousMinimum = useReference ? referenceMinimum : this._minimum;
+ this._previousMaximum = useReference ? referenceMaximum : this._maximum;
+ this._minimum = Number.MAX_VALUE;
+ this._maximum = -Number.MAX_VALUE;
+ }
+};
+var Cesium3DTilesetHeatmap_default = Cesium3DTilesetHeatmap;
+
+// Source/Scene/Cesium3DTilesetStatistics.js
+function Cesium3DTilesetStatistics() {
+ this.selected = 0;
+ this.visited = 0;
+ this.numberOfCommands = 0;
+ this.numberOfAttemptedRequests = 0;
+ this.numberOfPendingRequests = 0;
+ this.numberOfTilesProcessing = 0;
+ this.numberOfTilesWithContentReady = 0;
+ this.numberOfTilesTotal = 0;
+ this.numberOfLoadedTilesTotal = 0;
+ this.numberOfFeaturesSelected = 0;
+ this.numberOfFeaturesLoaded = 0;
+ this.numberOfPointsSelected = 0;
+ this.numberOfPointsLoaded = 0;
+ this.numberOfTrianglesSelected = 0;
+ this.numberOfTilesStyled = 0;
+ this.numberOfFeaturesStyled = 0;
+ this.numberOfTilesCulledWithChildrenUnion = 0;
+ this.geometryByteLength = 0;
+ this.texturesByteLength = 0;
+ this.batchTableByteLength = 0;
+}
+Cesium3DTilesetStatistics.prototype.clear = function() {
+ this.selected = 0;
+ this.visited = 0;
+ this.numberOfCommands = 0;
+ this.numberOfAttemptedRequests = 0;
+ this.numberOfFeaturesSelected = 0;
+ this.numberOfPointsSelected = 0;
+ this.numberOfTrianglesSelected = 0;
+ this.numberOfTilesStyled = 0;
+ this.numberOfFeaturesStyled = 0;
+ this.numberOfTilesCulledWithChildrenUnion = 0;
+};
+function updatePointAndFeatureCounts(statistics2, content, decrement, load5) {
+ const contents = content.innerContents;
+ const pointsLength = content.pointsLength;
+ const trianglesLength = content.trianglesLength;
+ const featuresLength = content.featuresLength;
+ const geometryByteLength = content.geometryByteLength;
+ const texturesByteLength = content.texturesByteLength;
+ const batchTableByteLength = content.batchTableByteLength;
+ if (load5) {
+ statistics2.numberOfFeaturesLoaded += decrement ? -featuresLength : featuresLength;
+ statistics2.numberOfPointsLoaded += decrement ? -pointsLength : pointsLength;
+ statistics2.geometryByteLength += decrement ? -geometryByteLength : geometryByteLength;
+ statistics2.texturesByteLength += decrement ? -texturesByteLength : texturesByteLength;
+ statistics2.batchTableByteLength += decrement ? -batchTableByteLength : batchTableByteLength;
+ } else {
+ statistics2.numberOfFeaturesSelected += decrement ? -featuresLength : featuresLength;
+ statistics2.numberOfPointsSelected += decrement ? -pointsLength : pointsLength;
+ statistics2.numberOfTrianglesSelected += decrement ? -trianglesLength : trianglesLength;
+ }
+ if (defined_default(contents)) {
+ const length3 = contents.length;
+ for (let i = 0; i < length3; ++i) {
+ updatePointAndFeatureCounts(statistics2, contents[i], decrement, load5);
+ }
+ }
+}
+Cesium3DTilesetStatistics.prototype.incrementSelectionCounts = function(content) {
+ updatePointAndFeatureCounts(this, content, false, false);
+};
+Cesium3DTilesetStatistics.prototype.incrementLoadCounts = function(content) {
+ updatePointAndFeatureCounts(this, content, false, true);
+};
+Cesium3DTilesetStatistics.prototype.decrementLoadCounts = function(content) {
+ updatePointAndFeatureCounts(this, content, true, true);
+};
+Cesium3DTilesetStatistics.clone = function(statistics2, result) {
+ result.selected = statistics2.selected;
+ result.visited = statistics2.visited;
+ result.numberOfCommands = statistics2.numberOfCommands;
+ result.selected = statistics2.selected;
+ result.numberOfAttemptedRequests = statistics2.numberOfAttemptedRequests;
+ result.numberOfPendingRequests = statistics2.numberOfPendingRequests;
+ result.numberOfTilesProcessing = statistics2.numberOfTilesProcessing;
+ result.numberOfTilesWithContentReady = statistics2.numberOfTilesWithContentReady;
+ result.numberOfTilesTotal = statistics2.numberOfTilesTotal;
+ result.numberOfFeaturesSelected = statistics2.numberOfFeaturesSelected;
+ result.numberOfFeaturesLoaded = statistics2.numberOfFeaturesLoaded;
+ result.numberOfPointsSelected = statistics2.numberOfPointsSelected;
+ result.numberOfPointsLoaded = statistics2.numberOfPointsLoaded;
+ result.numberOfTrianglesSelected = statistics2.numberOfTrianglesSelected;
+ result.numberOfTilesStyled = statistics2.numberOfTilesStyled;
+ result.numberOfFeaturesStyled = statistics2.numberOfFeaturesStyled;
+ result.numberOfTilesCulledWithChildrenUnion = statistics2.numberOfTilesCulledWithChildrenUnion;
+ result.geometryByteLength = statistics2.geometryByteLength;
+ result.texturesByteLength = statistics2.texturesByteLength;
+ result.batchTableByteLength = statistics2.batchTableByteLength;
+};
+var Cesium3DTilesetStatistics_default = Cesium3DTilesetStatistics;
+
+// Source/Scene/Cesium3DTileStyleEngine.js
+function Cesium3DTileStyleEngine() {
+ this._style = void 0;
+ this._styleDirty = false;
+ this._lastStyleTime = 0;
+}
+Object.defineProperties(Cesium3DTileStyleEngine.prototype, {
+ style: {
+ get: function() {
+ return this._style;
+ },
+ set: function(value) {
+ if (value === this._style) {
+ return;
+ }
+ this._style = value;
+ this._styleDirty = true;
+ }
+ }
+});
+Cesium3DTileStyleEngine.prototype.makeDirty = function() {
+ this._styleDirty = true;
+};
+Cesium3DTileStyleEngine.prototype.resetDirty = function() {
+ this._styleDirty = false;
+};
+Cesium3DTileStyleEngine.prototype.applyStyle = function(tileset) {
+ if (!tileset.ready) {
+ return;
+ }
+ if (defined_default(this._style) && !this._style._ready) {
+ return;
+ }
+ const styleDirty = this._styleDirty;
+ if (styleDirty) {
+ ++this._lastStyleTime;
+ }
+ const lastStyleTime = this._lastStyleTime;
+ const statistics2 = tileset._statistics;
+ const tiles = styleDirty ? tileset._selectedTiles : tileset._selectedTilesToStyle;
+ const length3 = tiles.length;
+ for (let i = 0; i < length3; ++i) {
+ const tile = tiles[i];
+ if (tile.lastStyleTime !== lastStyleTime) {
+ const content = tile.content;
+ tile.lastStyleTime = lastStyleTime;
+ content.applyStyle(this._style);
+ statistics2.numberOfFeaturesStyled += content.featuresLength;
+ ++statistics2.numberOfTilesStyled;
+ }
+ }
+};
+var Cesium3DTileStyleEngine_default = Cesium3DTileStyleEngine;
+
+// Source/Scene/ImplicitTileset.js
+function ImplicitTileset(baseResource2, tileJson, metadataSchema) {
+ const implicitTiling = hasExtension_default(tileJson, "3DTILES_implicit_tiling") ? tileJson.extensions["3DTILES_implicit_tiling"] : tileJson.implicitTiling;
+ Check_default.typeOf.object("implicitTiling", implicitTiling);
+ this.baseResource = baseResource2;
+ this.geometricError = tileJson.geometricError;
+ this.metadataSchema = metadataSchema;
+ const boundingVolume = tileJson.boundingVolume;
+ if (!defined_default(boundingVolume.box) && !defined_default(boundingVolume.region) && !hasExtension_default(boundingVolume, "3DTILES_bounding_volume_S2")) {
+ throw new RuntimeError_default(
+ "Only box, region and 3DTILES_bounding_volume_S2 are supported for implicit tiling"
+ );
+ }
+ this.boundingVolume = boundingVolume;
+ this.refine = tileJson.refine;
+ this.subtreeUriTemplate = new Resource_default({ url: implicitTiling.subtrees.uri });
+ this.contentUriTemplates = [];
+ this.contentHeaders = [];
+ const contentHeaders = gatherContentHeaders(tileJson);
+ for (let i = 0; i < contentHeaders.length; i++) {
+ const contentHeader = contentHeaders[i];
+ this.contentHeaders.push(clone_default(contentHeader, true));
+ const contentResource = new Resource_default({ url: contentHeader.uri });
+ this.contentUriTemplates.push(contentResource);
+ }
+ this.contentCount = this.contentHeaders.length;
+ this.tileHeader = makeTileHeaderTemplate(tileJson);
+ this.subdivisionScheme = ImplicitSubdivisionScheme_default[implicitTiling.subdivisionScheme];
+ this.branchingFactor = ImplicitSubdivisionScheme_default.getBranchingFactor(
+ this.subdivisionScheme
+ );
+ this.subtreeLevels = implicitTiling.subtreeLevels;
+ if (defined_default(implicitTiling.availableLevels)) {
+ this.availableLevels = implicitTiling.availableLevels;
+ } else {
+ this.availableLevels = implicitTiling.maximumLevel + 1;
+ }
+}
+function gatherContentHeaders(tileJson) {
+ if (hasExtension_default(tileJson, "3DTILES_multiple_contents")) {
+ const extension = tileJson.extensions["3DTILES_multiple_contents"];
+ return defined_default(extension.contents) ? extension.contents : extension.content;
+ }
+ if (defined_default(tileJson.contents)) {
+ return tileJson.contents;
+ }
+ if (defined_default(tileJson.content)) {
+ return [tileJson.content];
+ }
+ return [];
+}
+function makeTileHeaderTemplate(tileJson) {
+ const template = clone_default(tileJson, true);
+ if (defined_default(template.extensions)) {
+ delete template.extensions["3DTILES_implicit_tiling"];
+ delete template.extensions["3DTILES_multiple_contents"];
+ if (Object.keys(template.extensions).length === 0) {
+ delete template.extensions;
+ }
+ }
+ delete template.implicitTiling;
+ delete template.contents;
+ delete template.content;
+ return template;
+}
+var ImplicitTileset_default = ImplicitTileset;
+
+// Source/Core/MortonOrder.js
+var MortonOrder = {};
+function insertOneSpacing(v7) {
+ v7 = (v7 ^ v7 << 8) & 16711935;
+ v7 = (v7 ^ v7 << 4) & 252645135;
+ v7 = (v7 ^ v7 << 2) & 858993459;
+ v7 = (v7 ^ v7 << 1) & 1431655765;
+ return v7;
+}
+function insertTwoSpacing(v7) {
+ v7 = (v7 ^ v7 << 16) & 50331903;
+ v7 = (v7 ^ v7 << 8) & 50393103;
+ v7 = (v7 ^ v7 << 4) & 51130563;
+ v7 = (v7 ^ v7 << 2) & 153391689;
+ return v7;
+}
+function removeOneSpacing(v7) {
+ v7 &= 1431655765;
+ v7 = (v7 ^ v7 >> 1) & 858993459;
+ v7 = (v7 ^ v7 >> 2) & 252645135;
+ v7 = (v7 ^ v7 >> 4) & 16711935;
+ v7 = (v7 ^ v7 >> 8) & 65535;
+ return v7;
+}
+function removeTwoSpacing(v7) {
+ v7 &= 153391689;
+ v7 = (v7 ^ v7 >> 2) & 51130563;
+ v7 = (v7 ^ v7 >> 4) & 50393103;
+ v7 = (v7 ^ v7 >> 8) & 4278190335;
+ v7 = (v7 ^ v7 >> 16) & 1023;
+ return v7;
+}
+MortonOrder.encode2D = function(x, y) {
+ Check_default.typeOf.number("x", x);
+ Check_default.typeOf.number("y", y);
+ if (x < 0 || x > 65535 || y < 0 || y > 65535) {
+ throw new DeveloperError_default("inputs must be 16-bit unsigned integers");
+ }
+ return (insertOneSpacing(x) | insertOneSpacing(y) << 1) >>> 0;
+};
+MortonOrder.decode2D = function(mortonIndex, result) {
+ Check_default.typeOf.number("mortonIndex", mortonIndex);
+ if (mortonIndex < 0 || mortonIndex > 4294967295) {
+ throw new DeveloperError_default("input must be a 32-bit unsigned integer");
+ }
+ if (!defined_default(result)) {
+ result = new Array(2);
+ }
+ result[0] = removeOneSpacing(mortonIndex);
+ result[1] = removeOneSpacing(mortonIndex >> 1);
+ return result;
+};
+MortonOrder.encode3D = function(x, y, z) {
+ Check_default.typeOf.number("x", x);
+ Check_default.typeOf.number("y", y);
+ Check_default.typeOf.number("z", z);
+ if (x < 0 || x > 1023 || y < 0 || y > 1023 || z < 0 || z > 1023) {
+ throw new DeveloperError_default("inputs must be 10-bit unsigned integers");
+ }
+ return insertTwoSpacing(x) | insertTwoSpacing(y) << 1 | insertTwoSpacing(z) << 2;
+};
+MortonOrder.decode3D = function(mortonIndex, result) {
+ Check_default.typeOf.number("mortonIndex", mortonIndex);
+ if (mortonIndex < 0 || mortonIndex > 1073741823) {
+ throw new DeveloperError_default("input must be a 30-bit unsigned integer");
+ }
+ if (!defined_default(result)) {
+ result = new Array(3);
+ }
+ result[0] = removeTwoSpacing(mortonIndex);
+ result[1] = removeTwoSpacing(mortonIndex >> 1);
+ result[2] = removeTwoSpacing(mortonIndex >> 2);
+ return result;
+};
+var MortonOrder_default = MortonOrder;
+
+// Source/Scene/ImplicitTileCoordinates.js
+function ImplicitTileCoordinates(options) {
+ Check_default.typeOf.string("options.subdivisionScheme", options.subdivisionScheme);
+ Check_default.typeOf.number("options.subtreeLevels", options.subtreeLevels);
+ Check_default.typeOf.number("options.level", options.level);
+ Check_default.typeOf.number("options.x", options.x);
+ Check_default.typeOf.number("options.y", options.y);
+ if (options.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ Check_default.typeOf.number("options.z", options.z);
+ }
+ if (options.level < 0) {
+ throw new DeveloperError_default("level must be non-negative");
+ }
+ if (options.x < 0) {
+ throw new DeveloperError_default("x must be non-negative");
+ }
+ if (options.y < 0) {
+ throw new DeveloperError_default("y must be non-negative");
+ }
+ if (options.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ if (options.z < 0) {
+ throw new DeveloperError_default("z must be non-negative");
+ }
+ }
+ const dimensionAtLevel = 1 << options.level;
+ if (options.x >= dimensionAtLevel) {
+ throw new DeveloperError_default("x is out of range");
+ }
+ if (options.y >= dimensionAtLevel) {
+ throw new DeveloperError_default("y is out of range");
+ }
+ if (options.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ if (options.z >= dimensionAtLevel) {
+ throw new DeveloperError_default("z is out of range");
+ }
+ }
+ this.subdivisionScheme = options.subdivisionScheme;
+ this.subtreeLevels = options.subtreeLevels;
+ this.level = options.level;
+ this.x = options.x;
+ this.y = options.y;
+ this.z = void 0;
+ if (options.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ this.z = options.z;
+ }
+}
+Object.defineProperties(ImplicitTileCoordinates.prototype, {
+ childIndex: {
+ get: function() {
+ let childIndex = 0;
+ childIndex |= this.x & 1;
+ childIndex |= (this.y & 1) << 1;
+ if (this.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ childIndex |= (this.z & 1) << 2;
+ }
+ return childIndex;
+ }
+ },
+ mortonIndex: {
+ get: function() {
+ if (this.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ return MortonOrder_default.encode3D(this.x, this.y, this.z);
+ }
+ return MortonOrder_default.encode2D(this.x, this.y);
+ }
+ },
+ tileIndex: {
+ get: function() {
+ const levelOffset = this.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE ? ((1 << 3 * this.level) - 1) / 7 : ((1 << 2 * this.level) - 1) / 3;
+ const mortonIndex = this.mortonIndex;
+ return levelOffset + mortonIndex;
+ }
+ }
+});
+function checkMatchingSubtreeShape(a3, b) {
+ if (a3.subdivisionScheme !== b.subdivisionScheme) {
+ throw new DeveloperError_default("coordinates must have same subdivisionScheme");
+ }
+ if (a3.subtreeLevels !== b.subtreeLevels) {
+ throw new DeveloperError_default("coordinates must have same subtreeLevels");
+ }
+}
+ImplicitTileCoordinates.prototype.getDescendantCoordinates = function(offsetCoordinates) {
+ Check_default.typeOf.object("offsetCoordinates", offsetCoordinates);
+ checkMatchingSubtreeShape(this, offsetCoordinates);
+ const descendantLevel = this.level + offsetCoordinates.level;
+ const descendantX = (this.x << offsetCoordinates.level) + offsetCoordinates.x;
+ const descendantY = (this.y << offsetCoordinates.level) + offsetCoordinates.y;
+ if (this.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ const descendantZ = (this.z << offsetCoordinates.level) + offsetCoordinates.z;
+ return new ImplicitTileCoordinates({
+ subdivisionScheme: this.subdivisionScheme,
+ subtreeLevels: this.subtreeLevels,
+ level: descendantLevel,
+ x: descendantX,
+ y: descendantY,
+ z: descendantZ
+ });
+ }
+ return new ImplicitTileCoordinates({
+ subdivisionScheme: this.subdivisionScheme,
+ subtreeLevels: this.subtreeLevels,
+ level: descendantLevel,
+ x: descendantX,
+ y: descendantY
+ });
+};
+ImplicitTileCoordinates.prototype.getAncestorCoordinates = function(offsetLevels) {
+ Check_default.typeOf.number("offsetLevels", offsetLevels);
+ if (offsetLevels < 0) {
+ throw new DeveloperError_default("offsetLevels must be non-negative");
+ }
+ if (offsetLevels > this.level) {
+ throw new DeveloperError_default("ancestor cannot be above the tileset root");
+ }
+ const divisor = 1 << offsetLevels;
+ const ancestorLevel = this.level - offsetLevels;
+ const ancestorX = Math.floor(this.x / divisor);
+ const ancestorY = Math.floor(this.y / divisor);
+ if (this.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ const ancestorZ = Math.floor(this.z / divisor);
+ return new ImplicitTileCoordinates({
+ subdivisionScheme: this.subdivisionScheme,
+ subtreeLevels: this.subtreeLevels,
+ level: ancestorLevel,
+ x: ancestorX,
+ y: ancestorY,
+ z: ancestorZ
+ });
+ }
+ return new ImplicitTileCoordinates({
+ subdivisionScheme: this.subdivisionScheme,
+ subtreeLevels: this.subtreeLevels,
+ level: ancestorLevel,
+ x: ancestorX,
+ y: ancestorY
+ });
+};
+ImplicitTileCoordinates.prototype.getOffsetCoordinates = function(descendantCoordinates) {
+ Check_default.typeOf.object("descendantCoordinates", descendantCoordinates);
+ if (!this.isEqual(descendantCoordinates) && !this.isAncestor(descendantCoordinates)) {
+ throw new DeveloperError_default("this is not an ancestor of descendant");
+ }
+ checkMatchingSubtreeShape(this, descendantCoordinates);
+ const offsetLevel = descendantCoordinates.level - this.level;
+ const dimensionAtOffsetLevel = 1 << offsetLevel;
+ const offsetX = descendantCoordinates.x % dimensionAtOffsetLevel;
+ const offsetY = descendantCoordinates.y % dimensionAtOffsetLevel;
+ if (this.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ const offsetZ = descendantCoordinates.z % dimensionAtOffsetLevel;
+ return new ImplicitTileCoordinates({
+ subdivisionScheme: this.subdivisionScheme,
+ subtreeLevels: this.subtreeLevels,
+ level: offsetLevel,
+ x: offsetX,
+ y: offsetY,
+ z: offsetZ
+ });
+ }
+ return new ImplicitTileCoordinates({
+ subdivisionScheme: this.subdivisionScheme,
+ subtreeLevels: this.subtreeLevels,
+ level: offsetLevel,
+ x: offsetX,
+ y: offsetY
+ });
+};
+ImplicitTileCoordinates.prototype.getChildCoordinates = function(childIndex) {
+ Check_default.typeOf.number("childIndex", childIndex);
+ const branchingFactor = ImplicitSubdivisionScheme_default.getBranchingFactor(
+ this.subdivisionScheme
+ );
+ if (childIndex < 0 || branchingFactor <= childIndex) {
+ throw new DeveloperError_default(
+ `childIndex must be at least 0 and less than ${branchingFactor}`
+ );
+ }
+ const level = this.level + 1;
+ const x = 2 * this.x + childIndex % 2;
+ const y = 2 * this.y + Math.floor(childIndex / 2) % 2;
+ if (this.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ const z = 2 * this.z + Math.floor(childIndex / 4) % 2;
+ return new ImplicitTileCoordinates({
+ subdivisionScheme: this.subdivisionScheme,
+ subtreeLevels: this.subtreeLevels,
+ level,
+ x,
+ y,
+ z
+ });
+ }
+ return new ImplicitTileCoordinates({
+ subdivisionScheme: this.subdivisionScheme,
+ subtreeLevels: this.subtreeLevels,
+ level,
+ x,
+ y
+ });
+};
+ImplicitTileCoordinates.prototype.getSubtreeCoordinates = function() {
+ return this.getAncestorCoordinates(this.level % this.subtreeLevels);
+};
+ImplicitTileCoordinates.prototype.getParentSubtreeCoordinates = function() {
+ return this.getAncestorCoordinates(
+ this.level % this.subtreeLevels + this.subtreeLevels
+ );
+};
+ImplicitTileCoordinates.prototype.isAncestor = function(descendantCoordinates) {
+ Check_default.typeOf.object("descendantCoordinates", descendantCoordinates);
+ checkMatchingSubtreeShape(this, descendantCoordinates);
+ const levelDifference = descendantCoordinates.level - this.level;
+ if (levelDifference <= 0) {
+ return false;
+ }
+ const ancestorX = descendantCoordinates.x >> levelDifference;
+ const ancestorY = descendantCoordinates.y >> levelDifference;
+ const isAncestorX = this.x === ancestorX;
+ const isAncestorY = this.y === ancestorY;
+ if (this.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ const ancestorZ = descendantCoordinates.z >> levelDifference;
+ const isAncestorZ = this.z === ancestorZ;
+ return isAncestorX && isAncestorY && isAncestorZ;
+ }
+ return isAncestorX && isAncestorY;
+};
+ImplicitTileCoordinates.prototype.isEqual = function(otherCoordinates) {
+ Check_default.typeOf.object("otherCoordinates", otherCoordinates);
+ return this.subdivisionScheme === otherCoordinates.subdivisionScheme && this.subtreeLevels === otherCoordinates.subtreeLevels && this.level === otherCoordinates.level && this.x === otherCoordinates.x && this.y === otherCoordinates.y && (this.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE ? this.z === otherCoordinates.z : true);
+};
+ImplicitTileCoordinates.prototype.isImplicitTilesetRoot = function() {
+ return this.level === 0;
+};
+ImplicitTileCoordinates.prototype.isSubtreeRoot = function() {
+ return this.level % this.subtreeLevels === 0;
+};
+ImplicitTileCoordinates.prototype.isBottomOfSubtree = function() {
+ return this.level % this.subtreeLevels === this.subtreeLevels - 1;
+};
+ImplicitTileCoordinates.prototype.getTemplateValues = function() {
+ const values = {
+ level: this.level,
+ x: this.x,
+ y: this.y
+ };
+ if (this.subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ values.z = this.z;
+ }
+ return values;
+};
+var scratchCoordinatesArray = [0, 0, 0];
+ImplicitTileCoordinates.fromMortonIndex = function(subdivisionScheme, subtreeLevels, level, mortonIndex) {
+ let coordinatesArray;
+ if (subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ coordinatesArray = MortonOrder_default.decode3D(
+ mortonIndex,
+ scratchCoordinatesArray
+ );
+ return new ImplicitTileCoordinates({
+ subdivisionScheme,
+ subtreeLevels,
+ level,
+ x: coordinatesArray[0],
+ y: coordinatesArray[1],
+ z: coordinatesArray[2]
+ });
+ }
+ coordinatesArray = MortonOrder_default.decode2D(mortonIndex, scratchCoordinatesArray);
+ return new ImplicitTileCoordinates({
+ subdivisionScheme,
+ subtreeLevels,
+ level,
+ x: coordinatesArray[0],
+ y: coordinatesArray[1]
+ });
+};
+ImplicitTileCoordinates.fromTileIndex = function(subdivisionScheme, subtreeLevels, tileIndex) {
+ let level;
+ let levelOffset;
+ let mortonIndex;
+ if (subdivisionScheme === ImplicitSubdivisionScheme_default.OCTREE) {
+ level = Math.floor(Math_default.log2(7 * tileIndex + 1) / 3);
+ levelOffset = ((1 << 3 * level) - 1) / 7;
+ mortonIndex = tileIndex - levelOffset;
+ } else {
+ level = Math.floor(Math_default.log2(3 * tileIndex + 1) / 2);
+ levelOffset = ((1 << 2 * level) - 1) / 3;
+ mortonIndex = tileIndex - levelOffset;
+ }
+ return ImplicitTileCoordinates.fromMortonIndex(
+ subdivisionScheme,
+ subtreeLevels,
+ level,
+ mortonIndex
+ );
+};
+var ImplicitTileCoordinates_default = ImplicitTileCoordinates;
+
+// Source/Scene/Cesium3DTileset.js
+function Cesium3DTileset(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.url", options.url);
+ this._url = void 0;
+ this._basePath = void 0;
+ this._root = void 0;
+ this._resource = void 0;
+ this._asset = void 0;
+ this._properties = void 0;
+ this._geometricError = void 0;
+ this._extensionsUsed = void 0;
+ this._extensions = void 0;
+ this._modelUpAxis = void 0;
+ this._modelForwardAxis = void 0;
+ this._cache = new Cesium3DTilesetCache_default();
+ this._processingQueue = [];
+ this._selectedTiles = [];
+ this._emptyTiles = [];
+ this._requestedTiles = [];
+ this._selectedTilesToStyle = [];
+ this._loadTimestamp = void 0;
+ this._timeSinceLoad = 0;
+ this._updatedVisibilityFrame = 0;
+ this._updatedModelMatrixFrame = 0;
+ this._modelMatrixChanged = false;
+ this._previousModelMatrix = void 0;
+ this._extras = void 0;
+ this._credits = void 0;
+ this._showCreditsOnScreen = defaultValue_default(options.showCreditsOnScreen, false);
+ this._cullWithChildrenBounds = defaultValue_default(
+ options.cullWithChildrenBounds,
+ true
+ );
+ this._allTilesAdditive = true;
+ this._hasMixedContent = false;
+ this._stencilClearCommand = void 0;
+ this._backfaceCommands = new ManagedArray_default();
+ this._maximumScreenSpaceError = defaultValue_default(
+ options.maximumScreenSpaceError,
+ 16
+ );
+ this._maximumMemoryUsage = defaultValue_default(options.maximumMemoryUsage, 512);
+ this._styleEngine = new Cesium3DTileStyleEngine_default();
+ this._styleApplied = false;
+ this._modelMatrix = defined_default(options.modelMatrix) ? Matrix4_default.clone(options.modelMatrix) : Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this._statistics = new Cesium3DTilesetStatistics_default();
+ this._statisticsLast = new Cesium3DTilesetStatistics_default();
+ this._statisticsPerPass = new Array(Cesium3DTilePass_default.NUMBER_OF_PASSES);
+ for (let i = 0; i < Cesium3DTilePass_default.NUMBER_OF_PASSES; ++i) {
+ this._statisticsPerPass[i] = new Cesium3DTilesetStatistics_default();
+ }
+ this._requestedTilesInFlight = [];
+ this._maximumPriority = {
+ foveatedFactor: -Number.MAX_VALUE,
+ depth: -Number.MAX_VALUE,
+ distance: -Number.MAX_VALUE,
+ reverseScreenSpaceError: -Number.MAX_VALUE
+ };
+ this._minimumPriority = {
+ foveatedFactor: Number.MAX_VALUE,
+ depth: Number.MAX_VALUE,
+ distance: Number.MAX_VALUE,
+ reverseScreenSpaceError: Number.MAX_VALUE
+ };
+ this._heatmap = new Cesium3DTilesetHeatmap_default(
+ options.debugHeatmapTilePropertyName
+ );
+ this.cullRequestsWhileMoving = defaultValue_default(
+ options.cullRequestsWhileMoving,
+ true
+ );
+ this._cullRequestsWhileMoving = false;
+ this.cullRequestsWhileMovingMultiplier = defaultValue_default(
+ options.cullRequestsWhileMovingMultiplier,
+ 60
+ );
+ this.progressiveResolutionHeightFraction = Math_default.clamp(
+ defaultValue_default(options.progressiveResolutionHeightFraction, 0.3),
+ 0,
+ 0.5
+ );
+ this.preferLeaves = defaultValue_default(options.preferLeaves, false);
+ this._tilesLoaded = false;
+ this._initialTilesLoaded = false;
+ this._tileDebugLabels = void 0;
+ this._classificationType = options.classificationType;
+ this._ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ this._initialClippingPlanesOriginMatrix = Matrix4_default.IDENTITY;
+ this._clippingPlanesOriginMatrix = void 0;
+ this._clippingPlanesOriginMatrixDirty = true;
+ this._vectorClassificationOnly = defaultValue_default(
+ options.vectorClassificationOnly,
+ false
+ );
+ this._vectorKeepDecodedPositions = defaultValue_default(
+ options.vectorKeepDecodedPositions,
+ false
+ );
+ this.preloadWhenHidden = defaultValue_default(options.preloadWhenHidden, false);
+ this.preloadFlightDestinations = defaultValue_default(
+ options.preloadFlightDestinations,
+ true
+ );
+ this._pass = void 0;
+ this.dynamicScreenSpaceError = defaultValue_default(
+ options.dynamicScreenSpaceError,
+ false
+ );
+ this.foveatedScreenSpaceError = defaultValue_default(
+ options.foveatedScreenSpaceError,
+ true
+ );
+ this._foveatedConeSize = defaultValue_default(options.foveatedConeSize, 0.1);
+ this._foveatedMinimumScreenSpaceErrorRelaxation = defaultValue_default(
+ options.foveatedMinimumScreenSpaceErrorRelaxation,
+ 0
+ );
+ this.foveatedInterpolationCallback = defaultValue_default(
+ options.foveatedInterpolationCallback,
+ Math_default.lerp
+ );
+ this.foveatedTimeDelay = defaultValue_default(options.foveatedTimeDelay, 0.2);
+ this.dynamicScreenSpaceErrorDensity = 278e-5;
+ this.dynamicScreenSpaceErrorFactor = 4;
+ this.dynamicScreenSpaceErrorHeightFalloff = 0.25;
+ this._dynamicScreenSpaceErrorComputedDensity = 0;
+ this.shadows = defaultValue_default(options.shadows, ShadowMode_default.ENABLED);
+ this.show = defaultValue_default(options.show, true);
+ this.colorBlendMode = Cesium3DTileColorBlendMode_default.HIGHLIGHT;
+ this.colorBlendAmount = 0.5;
+ this._pointCloudShading = new PointCloudShading_default(options.pointCloudShading);
+ this._pointCloudEyeDomeLighting = new PointCloudEyeDomeLighting_default2();
+ this.loadProgress = new Event_default();
+ this.allTilesLoaded = new Event_default();
+ this.initialTilesLoaded = new Event_default();
+ this.tileLoad = new Event_default();
+ this.tileUnload = new Event_default();
+ this.tileFailed = new Event_default();
+ this.tileVisible = new Event_default();
+ this.skipLevelOfDetail = defaultValue_default(options.skipLevelOfDetail, false);
+ this._skipLevelOfDetail = this.skipLevelOfDetail;
+ this._disableSkipLevelOfDetail = false;
+ this.baseScreenSpaceError = defaultValue_default(options.baseScreenSpaceError, 1024);
+ this.skipScreenSpaceErrorFactor = defaultValue_default(
+ options.skipScreenSpaceErrorFactor,
+ 16
+ );
+ this.skipLevels = defaultValue_default(options.skipLevels, 1);
+ this.immediatelyLoadDesiredLevelOfDetail = defaultValue_default(
+ options.immediatelyLoadDesiredLevelOfDetail,
+ false
+ );
+ this.loadSiblings = defaultValue_default(options.loadSiblings, false);
+ this._clippingPlanes = void 0;
+ this.clippingPlanes = options.clippingPlanes;
+ if (defined_default(options.imageBasedLighting)) {
+ this._imageBasedLighting = options.imageBasedLighting;
+ this._shouldDestroyImageBasedLighting = false;
+ } else {
+ this._imageBasedLighting = new ImageBasedLighting_default();
+ this._shouldDestroyImageBasedLighting = true;
+ }
+ this.lightColor = options.lightColor;
+ this.backFaceCulling = defaultValue_default(options.backFaceCulling, true);
+ this._enableShowOutline = defaultValue_default(options.enableShowOutline, true);
+ this.showOutline = defaultValue_default(options.showOutline, true);
+ this.outlineColor = defaultValue_default(options.outlineColor, Color_default.BLACK);
+ this.splitDirection = defaultValue_default(
+ options.splitDirection,
+ SplitDirection_default.NONE
+ );
+ this._projectTo2D = defaultValue_default(options.projectTo2D, false);
+ this.debugFreezeFrame = defaultValue_default(options.debugFreezeFrame, false);
+ this.debugColorizeTiles = defaultValue_default(options.debugColorizeTiles, false);
+ this._enableDebugWireframe = defaultValue_default(
+ options.enableDebugWireframe,
+ false
+ );
+ this.debugWireframe = defaultValue_default(options.debugWireframe, false);
+ if (this.debugWireframe === true && this._enableDebugWireframe === false) {
+ oneTimeWarning_default(
+ "tileset-debug-wireframe-ignored",
+ "enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."
+ );
+ }
+ this.debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this.debugShowContentBoundingVolume = defaultValue_default(
+ options.debugShowContentBoundingVolume,
+ false
+ );
+ this.debugShowViewerRequestVolume = defaultValue_default(
+ options.debugShowViewerRequestVolume,
+ false
+ );
+ this._tileDebugLabels = void 0;
+ this.debugPickedTileLabelOnly = false;
+ this.debugPickedTile = void 0;
+ this.debugPickPosition = void 0;
+ this.debugShowGeometricError = defaultValue_default(
+ options.debugShowGeometricError,
+ false
+ );
+ this.debugShowRenderingStatistics = defaultValue_default(
+ options.debugShowRenderingStatistics,
+ false
+ );
+ this.debugShowMemoryUsage = defaultValue_default(options.debugShowMemoryUsage, false);
+ this.debugShowUrl = defaultValue_default(options.debugShowUrl, false);
+ this.examineVectorLinesFunction = void 0;
+ this._metadataExtension = void 0;
+ this._customShader = options.customShader;
+ let featureIdLabel = defaultValue_default(options.featureIdLabel, "featureId_0");
+ if (typeof featureIdLabel === "number") {
+ featureIdLabel = `featureId_${featureIdLabel}`;
+ }
+ this._featureIdLabel = featureIdLabel;
+ let instanceFeatureIdLabel = defaultValue_default(
+ options.instanceFeatureIdLabel,
+ "instanceFeatureId_0"
+ );
+ if (typeof instanceFeatureIdLabel === "number") {
+ instanceFeatureIdLabel = `instanceFeatureId_${instanceFeatureIdLabel}`;
+ }
+ this._instanceFeatureIdLabel = instanceFeatureIdLabel;
+ this._schemaLoader = void 0;
+ const that = this;
+ let resource;
+ this._readyPromise = Promise.resolve(options.url).then(function(url2) {
+ let basePath;
+ resource = Resource_default.createIfNeeded(url2);
+ that._resource = resource;
+ that._credits = resource.credits;
+ if (resource.extension === "json") {
+ basePath = resource.getBaseUri(true);
+ } else if (resource.isDataUri) {
+ basePath = "";
+ }
+ that._url = resource.url;
+ that._basePath = basePath;
+ return Cesium3DTileset.loadJson(resource);
+ }).then(function(tilesetJson) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ return processMetadataExtension(that, tilesetJson);
+ }).then(function(tilesetJson) {
+ if (that.isDestroyed()) {
+ return;
+ }
+ that._root = that.loadTileset(resource, tilesetJson);
+ const gltfUpAxis = defined_default(tilesetJson.asset.gltfUpAxis) ? Axis_default.fromName(tilesetJson.asset.gltfUpAxis) : Axis_default.Y;
+ const modelUpAxis = defaultValue_default(options.modelUpAxis, gltfUpAxis);
+ const modelForwardAxis = defaultValue_default(options.modelForwardAxis, Axis_default.X);
+ const asset = tilesetJson.asset;
+ that._asset = asset;
+ that._properties = tilesetJson.properties;
+ that._geometricError = tilesetJson.geometricError;
+ that._extensionsUsed = tilesetJson.extensionsUsed;
+ that._extensions = tilesetJson.extensions;
+ that._modelUpAxis = modelUpAxis;
+ that._modelForwardAxis = modelForwardAxis;
+ that._extras = tilesetJson.extras;
+ const extras = asset.extras;
+ if (defined_default(extras) && defined_default(extras.cesium) && defined_default(extras.cesium.credits)) {
+ const extraCredits = extras.cesium.credits;
+ let credits = that._credits;
+ if (!defined_default(credits)) {
+ credits = [];
+ that._credits = credits;
+ }
+ for (let i = 0; i < extraCredits.length; ++i) {
+ const credit = extraCredits[i];
+ credits.push(new Credit_default(credit.html, that._showCreditsOnScreen));
+ }
+ }
+ const boundingVolume = that._root.createBoundingVolume(
+ tilesetJson.root.boundingVolume,
+ Matrix4_default.IDENTITY
+ );
+ const clippingPlanesOrigin = boundingVolume.boundingSphere.center;
+ const originCartographic = that._ellipsoid.cartesianToCartographic(
+ clippingPlanesOrigin
+ );
+ if (defined_default(originCartographic) && originCartographic.height > ApproximateTerrainHeights_default._defaultMinTerrainHeight) {
+ that._initialClippingPlanesOriginMatrix = Transforms_default.eastNorthUpToFixedFrame(
+ clippingPlanesOrigin
+ );
+ }
+ that._clippingPlanesOriginMatrix = Matrix4_default.clone(
+ that._initialClippingPlanesOriginMatrix
+ );
+ return that;
+ });
+}
+Object.defineProperties(Cesium3DTileset.prototype, {
+ isCesium3DTileset: {
+ get: function() {
+ return true;
+ }
+ },
+ asset: {
+ get: function() {
+ if (!this.ready) {
+ throw new DeveloperError_default(
+ "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
+ );
+ }
+ return this._asset;
+ }
+ },
+ extensions: {
+ get: function() {
+ if (!this.ready) {
+ throw new DeveloperError_default(
+ "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
+ );
+ }
+ return this._extensions;
+ }
+ },
+ clippingPlanes: {
+ get: function() {
+ return this._clippingPlanes;
+ },
+ set: function(value) {
+ ClippingPlaneCollection_default.setOwner(value, this, "_clippingPlanes");
+ }
+ },
+ properties: {
+ get: function() {
+ if (!this.ready) {
+ throw new DeveloperError_default(
+ "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
+ );
+ }
+ return this._properties;
+ }
+ },
+ ready: {
+ get: function() {
+ return defined_default(this._root);
+ }
+ },
+ readyPromise: {
+ get: function() {
+ return this._readyPromise;
+ }
+ },
+ tilesLoaded: {
+ get: function() {
+ return this._tilesLoaded;
+ }
+ },
+ resource: {
+ get: function() {
+ return this._resource;
+ }
+ },
+ basePath: {
+ get: function() {
+ deprecationWarning_default(
+ "Cesium3DTileset.basePath",
+ "Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."
+ );
+ return this._basePath;
+ }
+ },
+ style: {
+ get: function() {
+ return this._styleEngine.style;
+ },
+ set: function(value) {
+ this._styleEngine.style = value;
+ }
+ },
+ customShader: {
+ get: function() {
+ return this._customShader;
+ },
+ set: function(value) {
+ this._customShader = value;
+ }
+ },
+ metadataExtension: {
+ get: function() {
+ return this._metadataExtension;
+ }
+ },
+ metadata: {
+ get: function() {
+ if (defined_default(this._metadataExtension)) {
+ return this._metadataExtension.tileset;
+ }
+ return void 0;
+ }
+ },
+ schema: {
+ get: function() {
+ if (defined_default(this._metadataExtension)) {
+ return this._metadataExtension.schema;
+ }
+ return void 0;
+ }
+ },
+ maximumScreenSpaceError: {
+ get: function() {
+ return this._maximumScreenSpaceError;
+ },
+ set: function(value) {
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "maximumScreenSpaceError",
+ value,
+ 0
+ );
+ this._maximumScreenSpaceError = value;
+ }
+ },
+ maximumMemoryUsage: {
+ get: function() {
+ return this._maximumMemoryUsage;
+ },
+ set: function(value) {
+ Check_default.typeOf.number.greaterThanOrEquals("value", value, 0);
+ this._maximumMemoryUsage = value;
+ }
+ },
+ pointCloudShading: {
+ get: function() {
+ return this._pointCloudShading;
+ },
+ set: function(value) {
+ Check_default.defined("pointCloudShading", value);
+ this._pointCloudShading = value;
+ }
+ },
+ root: {
+ get: function() {
+ if (!this.ready) {
+ throw new DeveloperError_default(
+ "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
+ );
+ }
+ return this._root;
+ }
+ },
+ boundingSphere: {
+ get: function() {
+ if (!this.ready) {
+ throw new DeveloperError_default(
+ "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
+ );
+ }
+ this._root.updateTransform(this._modelMatrix);
+ return this._root.boundingSphere;
+ }
+ },
+ modelMatrix: {
+ get: function() {
+ return this._modelMatrix;
+ },
+ set: function(value) {
+ this._modelMatrix = Matrix4_default.clone(value, this._modelMatrix);
+ }
+ },
+ timeSinceLoad: {
+ get: function() {
+ return this._timeSinceLoad;
+ }
+ },
+ totalMemoryUsageInBytes: {
+ get: function() {
+ const statistics2 = this._statistics;
+ return statistics2.texturesByteLength + statistics2.geometryByteLength + statistics2.batchTableByteLength;
+ }
+ },
+ clippingPlanesOriginMatrix: {
+ get: function() {
+ if (!defined_default(this._clippingPlanesOriginMatrix)) {
+ return Matrix4_default.IDENTITY;
+ }
+ if (this._clippingPlanesOriginMatrixDirty) {
+ Matrix4_default.multiply(
+ this.root.computedTransform,
+ this._initialClippingPlanesOriginMatrix,
+ this._clippingPlanesOriginMatrix
+ );
+ this._clippingPlanesOriginMatrixDirty = false;
+ }
+ return this._clippingPlanesOriginMatrix;
+ }
+ },
+ styleEngine: {
+ get: function() {
+ return this._styleEngine;
+ }
+ },
+ statistics: {
+ get: function() {
+ return this._statistics;
+ }
+ },
+ classificationType: {
+ get: function() {
+ return this._classificationType;
+ }
+ },
+ ellipsoid: {
+ get: function() {
+ return this._ellipsoid;
+ }
+ },
+ foveatedConeSize: {
+ get: function() {
+ return this._foveatedConeSize;
+ },
+ set: function(value) {
+ Check_default.typeOf.number.greaterThanOrEquals("foveatedConeSize", value, 0);
+ Check_default.typeOf.number.lessThanOrEquals("foveatedConeSize", value, 1);
+ this._foveatedConeSize = value;
+ }
+ },
+ foveatedMinimumScreenSpaceErrorRelaxation: {
+ get: function() {
+ return this._foveatedMinimumScreenSpaceErrorRelaxation;
+ },
+ set: function(value) {
+ Check_default.typeOf.number.greaterThanOrEquals(
+ "foveatedMinimumScreenSpaceErrorRelaxation",
+ value,
+ 0
+ );
+ Check_default.typeOf.number.lessThanOrEquals(
+ "foveatedMinimumScreenSpaceErrorRelaxation",
+ value,
+ this.maximumScreenSpaceError
+ );
+ this._foveatedMinimumScreenSpaceErrorRelaxation = value;
+ }
+ },
+ extras: {
+ get: function() {
+ if (!this.ready) {
+ throw new DeveloperError_default(
+ "The tileset is not loaded. Use Cesium3DTileset.readyPromise or wait for Cesium3DTileset.ready to be true."
+ );
+ }
+ return this._extras;
+ }
+ },
+ imageBasedLighting: {
+ get: function() {
+ return this._imageBasedLighting;
+ },
+ set: function(value) {
+ Check_default.typeOf.object("imageBasedLighting", this._imageBasedLighting);
+ if (value !== this._imageBasedLighting) {
+ if (this._shouldDestroyImageBasedLighting && !this._imageBasedLighting.isDestroyed()) {
+ this._imageBasedLighting.destroy();
+ }
+ this._imageBasedLighting = value;
+ this._shouldDestroyImageBasedLighting = false;
+ }
+ }
+ },
+ vectorClassificationOnly: {
+ get: function() {
+ return this._vectorClassificationOnly;
+ }
+ },
+ vectorKeepDecodedPositions: {
+ get: function() {
+ return this._vectorKeepDecodedPositions;
+ }
+ },
+ showCreditsOnScreen: {
+ get: function() {
+ return this._showCreditsOnScreen;
+ },
+ set: function(value) {
+ this._showCreditsOnScreen = value;
+ }
+ },
+ featureIdLabel: {
+ get: function() {
+ return this._featureIdLabel;
+ },
+ set: function(value) {
+ if (typeof value === "number") {
+ value = `featureId_${value}`;
+ }
+ Check_default.typeOf.string("value", value);
+ this._featureIdLabel = value;
+ }
+ },
+ instanceFeatureIdLabel: {
+ get: function() {
+ return this._instanceFeatureIdLabel;
+ },
+ set: function(value) {
+ if (typeof value === "number") {
+ value = `instanceFeatureId_${value}`;
+ }
+ Check_default.typeOf.string("value", value);
+ this._instanceFeatureIdLabel = value;
+ }
+ }
+});
+Cesium3DTileset.loadJson = function(tilesetUrl) {
+ const resource = Resource_default.createIfNeeded(tilesetUrl);
+ return resource.fetchJson();
+};
+Cesium3DTileset.prototype.makeStyleDirty = function() {
+ this._styleEngine.makeDirty();
+};
+Cesium3DTileset.prototype.loadTileset = function(resource, tilesetJson, parentTile) {
+ const asset = tilesetJson.asset;
+ if (!defined_default(asset)) {
+ throw new RuntimeError_default("Tileset must have an asset property.");
+ }
+ if (asset.version !== "0.0" && asset.version !== "1.0" && asset.version !== "1.1") {
+ throw new RuntimeError_default(
+ "The tileset must be 3D Tiles version 0.0, 1.0, or 1.1"
+ );
+ }
+ if (defined_default(tilesetJson.extensionsRequired)) {
+ Cesium3DTileset.checkSupportedExtensions(tilesetJson.extensionsRequired);
+ }
+ const statistics2 = this._statistics;
+ const tilesetVersion = asset.tilesetVersion;
+ if (defined_default(tilesetVersion)) {
+ this._basePath += `?v=${tilesetVersion}`;
+ resource = resource.clone();
+ resource.setQueryParameters({ v: tilesetVersion });
+ }
+ const rootTile = makeTile2(this, resource, tilesetJson.root, parentTile);
+ if (defined_default(parentTile)) {
+ parentTile.children.push(rootTile);
+ rootTile._depth = parentTile._depth + 1;
+ }
+ const stack = [];
+ stack.push(rootTile);
+ while (stack.length > 0) {
+ const tile = stack.pop();
+ ++statistics2.numberOfTilesTotal;
+ this._allTilesAdditive = this._allTilesAdditive && tile.refine === Cesium3DTileRefine_default.ADD;
+ const children = tile._header.children;
+ if (defined_default(children)) {
+ const length3 = children.length;
+ for (let i = 0; i < length3; ++i) {
+ const childHeader = children[i];
+ const childTile = makeTile2(this, resource, childHeader, tile);
+ tile.children.push(childTile);
+ childTile._depth = tile._depth + 1;
+ stack.push(childTile);
+ }
+ }
+ if (this._cullWithChildrenBounds) {
+ Cesium3DTileOptimizations_default.checkChildrenWithinParent(tile);
+ }
+ }
+ return rootTile;
+};
+function makeTile2(tileset, baseResource2, tileHeader, parentTile) {
+ const hasImplicitTiling = defined_default(tileHeader.implicitTiling) || hasExtension_default(tileHeader, "3DTILES_implicit_tiling");
+ if (hasImplicitTiling) {
+ const metadataSchema = tileset.schema;
+ const implicitTileset = new ImplicitTileset_default(
+ baseResource2,
+ tileHeader,
+ metadataSchema
+ );
+ const rootCoordinates = new ImplicitTileCoordinates_default({
+ subdivisionScheme: implicitTileset.subdivisionScheme,
+ subtreeLevels: implicitTileset.subtreeLevels,
+ level: 0,
+ x: 0,
+ y: 0,
+ z: 0
+ });
+ const contentUri = implicitTileset.subtreeUriTemplate.getDerivedResource({
+ templateValues: rootCoordinates.getTemplateValues()
+ }).url;
+ const deepCopy = true;
+ const tileJson = clone_default(tileHeader, deepCopy);
+ tileJson.contents = [
+ {
+ uri: contentUri
+ }
+ ];
+ delete tileJson.content;
+ delete tileJson.extensions;
+ const tile = new Cesium3DTile_default(tileset, baseResource2, tileJson, parentTile);
+ tile.implicitTileset = implicitTileset;
+ tile.implicitCoordinates = rootCoordinates;
+ return tile;
+ }
+ return new Cesium3DTile_default(tileset, baseResource2, tileHeader, parentTile);
+}
+function processMetadataExtension(tileset, tilesetJson) {
+ const metadataJson = hasExtension_default(tilesetJson, "3DTILES_metadata") ? tilesetJson.extensions["3DTILES_metadata"] : tilesetJson;
+ let schemaLoader;
+ if (defined_default(metadataJson.schemaUri)) {
+ const resource = tileset._resource.getDerivedResource({
+ url: metadataJson.schemaUri
+ });
+ schemaLoader = ResourceCache_default.loadSchema({
+ resource
+ });
+ } else if (defined_default(metadataJson.schema)) {
+ schemaLoader = ResourceCache_default.loadSchema({
+ schema: metadataJson.schema
+ });
+ } else {
+ return Promise.resolve(tilesetJson);
+ }
+ tileset._schemaLoader = schemaLoader;
+ return schemaLoader.promise.then(function(schemaLoader2) {
+ tileset._metadataExtension = new Cesium3DTilesetMetadata_default({
+ schema: schemaLoader2.schema,
+ metadataJson
+ });
+ return tilesetJson;
+ });
+}
+var scratchPositionNormal = new Cartesian3_default();
+var scratchCartographic7 = new Cartographic_default();
+var scratchMatrix4 = new Matrix4_default();
+var scratchCenter5 = new Cartesian3_default();
+var scratchPosition7 = new Cartesian3_default();
+var scratchDirection = new Cartesian3_default();
+function updateDynamicScreenSpaceError(tileset, frameState) {
+ let up;
+ let direction2;
+ let height;
+ let minimumHeight;
+ let maximumHeight;
+ const camera = frameState.camera;
+ const root = tileset._root;
+ const tileBoundingVolume = root.contentBoundingVolume;
+ if (tileBoundingVolume instanceof TileBoundingRegion_default) {
+ up = Cartesian3_default.normalize(camera.positionWC, scratchPositionNormal);
+ direction2 = camera.directionWC;
+ height = camera.positionCartographic.height;
+ minimumHeight = tileBoundingVolume.minimumHeight;
+ maximumHeight = tileBoundingVolume.maximumHeight;
+ } else {
+ const transformLocal = Matrix4_default.inverseTransformation(
+ root.computedTransform,
+ scratchMatrix4
+ );
+ const ellipsoid = frameState.mapProjection.ellipsoid;
+ const boundingVolume = tileBoundingVolume.boundingVolume;
+ const centerLocal = Matrix4_default.multiplyByPoint(
+ transformLocal,
+ boundingVolume.center,
+ scratchCenter5
+ );
+ if (Cartesian3_default.magnitude(centerLocal) > ellipsoid.minimumRadius) {
+ const centerCartographic = Cartographic_default.fromCartesian(
+ centerLocal,
+ ellipsoid,
+ scratchCartographic7
+ );
+ up = Cartesian3_default.normalize(camera.positionWC, scratchPositionNormal);
+ direction2 = camera.directionWC;
+ height = camera.positionCartographic.height;
+ minimumHeight = 0;
+ maximumHeight = centerCartographic.height * 2;
+ } else {
+ const positionLocal = Matrix4_default.multiplyByPoint(
+ transformLocal,
+ camera.positionWC,
+ scratchPosition7
+ );
+ up = Cartesian3_default.UNIT_Z;
+ direction2 = Matrix4_default.multiplyByPointAsVector(
+ transformLocal,
+ camera.directionWC,
+ scratchDirection
+ );
+ direction2 = Cartesian3_default.normalize(direction2, direction2);
+ height = positionLocal.z;
+ if (tileBoundingVolume instanceof TileOrientedBoundingBox_default) {
+ const boxHeight = root._header.boundingVolume.box[11];
+ minimumHeight = centerLocal.z - boxHeight;
+ maximumHeight = centerLocal.z + boxHeight;
+ } else if (tileBoundingVolume instanceof TileBoundingSphere_default) {
+ const radius = boundingVolume.radius;
+ minimumHeight = centerLocal.z - radius;
+ maximumHeight = centerLocal.z + radius;
+ }
+ }
+ }
+ const heightFalloff = tileset.dynamicScreenSpaceErrorHeightFalloff;
+ const heightClose = minimumHeight + (maximumHeight - minimumHeight) * heightFalloff;
+ const heightFar = maximumHeight;
+ const t = Math_default.clamp(
+ (height - heightClose) / (heightFar - heightClose),
+ 0,
+ 1
+ );
+ const dot2 = Math.abs(Cartesian3_default.dot(direction2, up));
+ let horizonFactor = 1 - dot2;
+ horizonFactor = horizonFactor * (1 - t);
+ let density = tileset.dynamicScreenSpaceErrorDensity;
+ density *= horizonFactor;
+ tileset._dynamicScreenSpaceErrorComputedDensity = density;
+}
+function requestContent(tileset, tile) {
+ if (tile.hasEmptyContent) {
+ return;
+ }
+ const statistics2 = tileset._statistics;
+ const expired = tile.contentExpired;
+ const attemptedRequests = tile.requestContent();
+ if (attemptedRequests > 0) {
+ statistics2.numberOfAttemptedRequests += attemptedRequests;
+ return;
+ }
+ if (expired) {
+ if (tile.hasTilesetContent || tile.hasImplicitContent) {
+ destroySubtree(tileset, tile);
+ } else {
+ statistics2.decrementLoadCounts(tile.content);
+ --statistics2.numberOfTilesWithContentReady;
+ }
+ }
+ tileset._requestedTilesInFlight.push(tile);
+ tile.contentReadyToProcessPromise.then(addToProcessingQueue(tileset, tile)).catch(function(e) {
+ });
+ tile.contentReadyPromise.then(handleTileSuccess(tileset, tile)).catch(handleTileFailure(tileset, tile));
+}
+function sortRequestByPriority(a3, b) {
+ return a3._priority - b._priority;
+}
+Cesium3DTileset.prototype.postPassesUpdate = function(frameState) {
+ if (!this.ready) {
+ return;
+ }
+ cancelOutOfViewRequests(this, frameState);
+ raiseLoadProgressEvent(this, frameState);
+ this._cache.unloadTiles(this, unloadTile);
+ if (this._styleApplied) {
+ this._styleEngine.resetDirty();
+ }
+ this._styleApplied = false;
+};
+Cesium3DTileset.prototype.prePassesUpdate = function(frameState) {
+ if (!this.ready) {
+ return;
+ }
+ processTiles(this, frameState);
+ const clippingPlanes = this._clippingPlanes;
+ this._clippingPlanesOriginMatrixDirty = true;
+ if (defined_default(clippingPlanes) && clippingPlanes.enabled) {
+ clippingPlanes.update(frameState);
+ }
+ if (!defined_default(this._loadTimestamp)) {
+ this._loadTimestamp = JulianDate_default.clone(frameState.time);
+ }
+ this._timeSinceLoad = Math.max(
+ JulianDate_default.secondsDifference(frameState.time, this._loadTimestamp) * 1e3,
+ 0
+ );
+ this._skipLevelOfDetail = this.skipLevelOfDetail && !defined_default(this._classificationType) && !this._disableSkipLevelOfDetail && !this._allTilesAdditive;
+ if (this.dynamicScreenSpaceError) {
+ updateDynamicScreenSpaceError(this, frameState);
+ }
+ if (frameState.newFrame) {
+ this._cache.reset();
+ }
+};
+function cancelOutOfViewRequests(tileset, frameState) {
+ const requestedTilesInFlight = tileset._requestedTilesInFlight;
+ let removeCount = 0;
+ const length3 = requestedTilesInFlight.length;
+ for (let i = 0; i < length3; ++i) {
+ const tile = requestedTilesInFlight[i];
+ const outOfView = frameState.frameNumber - tile._touchedFrame >= 1;
+ if (tile._contentState !== Cesium3DTileContentState_default.LOADING) {
+ ++removeCount;
+ continue;
+ } else if (outOfView) {
+ tile.cancelRequests();
+ ++removeCount;
+ continue;
+ }
+ if (removeCount > 0) {
+ requestedTilesInFlight[i - removeCount] = tile;
+ }
+ }
+ requestedTilesInFlight.length -= removeCount;
+}
+function requestTiles(tileset, isAsync) {
+ const requestedTiles = tileset._requestedTiles;
+ const length3 = requestedTiles.length;
+ requestedTiles.sort(sortRequestByPriority);
+ for (let i = 0; i < length3; ++i) {
+ requestContent(tileset, requestedTiles[i]);
+ }
+}
+function addToProcessingQueue(tileset, tile) {
+ return function() {
+ tileset._processingQueue.push(tile);
+ ++tileset._statistics.numberOfTilesProcessing;
+ };
+}
+function handleTileFailure(tileset, tile) {
+ return function(error) {
+ if (tile._contentState !== Cesium3DTileContentState_default.FAILED) {
+ return;
+ }
+ const url2 = tile._contentResource.url;
+ const message = defined_default(error.message) ? error.message : error.toString();
+ if (tileset.tileFailed.numberOfListeners > 0) {
+ tileset.tileFailed.raiseEvent({
+ url: url2,
+ message
+ });
+ } else {
+ console.log(`A 3D tile failed to load: ${url2}`);
+ console.log(`Error: ${message}`);
+ }
+ };
+}
+function handleTileSuccess(tileset, tile) {
+ return function(content) {
+ --tileset._statistics.numberOfTilesProcessing;
+ if (!defined_default(content)) {
+ return;
+ }
+ if (!tile.hasTilesetContent && !tile.hasImplicitContent) {
+ tileset._statistics.incrementLoadCounts(tile.content);
+ ++tileset._statistics.numberOfTilesWithContentReady;
+ ++tileset._statistics.numberOfLoadedTilesTotal;
+ tileset._cache.add(tile);
+ }
+ tileset.tileLoad.raiseEvent(tile);
+ };
+}
+function filterProcessingQueue(tileset) {
+ const tiles = tileset._processingQueue;
+ const length3 = tiles.length;
+ let removeCount = 0;
+ for (let i = 0; i < length3; ++i) {
+ const tile = tiles[i];
+ if (tile._contentState !== Cesium3DTileContentState_default.PROCESSING) {
+ ++removeCount;
+ continue;
+ }
+ if (removeCount > 0) {
+ tiles[i - removeCount] = tile;
+ }
+ }
+ tiles.length -= removeCount;
+}
+function processTiles(tileset, frameState) {
+ filterProcessingQueue(tileset);
+ const tiles = tileset._processingQueue;
+ const length3 = tiles.length;
+ for (let i = 0; i < length3; ++i) {
+ tiles[i].process(tileset, frameState);
+ }
+}
+var scratchCartesian10 = new Cartesian3_default();
+var stringOptions = {
+ maximumFractionDigits: 3
+};
+function formatMemoryString(memorySizeInBytes) {
+ const memoryInMegabytes = memorySizeInBytes / 1048576;
+ if (memoryInMegabytes < 1) {
+ return memoryInMegabytes.toLocaleString(void 0, stringOptions);
+ }
+ return Math.round(memoryInMegabytes).toLocaleString();
+}
+function computeTileLabelPosition(tile) {
+ const boundingVolume = tile.boundingVolume.boundingVolume;
+ const halfAxes = boundingVolume.halfAxes;
+ const radius = boundingVolume.radius;
+ let position = Cartesian3_default.clone(boundingVolume.center, scratchCartesian10);
+ if (defined_default(halfAxes)) {
+ position.x += 0.75 * (halfAxes[0] + halfAxes[3] + halfAxes[6]);
+ position.y += 0.75 * (halfAxes[1] + halfAxes[4] + halfAxes[7]);
+ position.z += 0.75 * (halfAxes[2] + halfAxes[5] + halfAxes[8]);
+ } else if (defined_default(radius)) {
+ let normal2 = Cartesian3_default.normalize(boundingVolume.center, scratchCartesian10);
+ normal2 = Cartesian3_default.multiplyByScalar(
+ normal2,
+ 0.75 * radius,
+ scratchCartesian10
+ );
+ position = Cartesian3_default.add(normal2, boundingVolume.center, scratchCartesian10);
+ }
+ return position;
+}
+function addTileDebugLabel(tile, tileset, position) {
+ let labelString = "";
+ let attributes = 0;
+ if (tileset.debugShowGeometricError) {
+ labelString += `
+Geometric error: ${tile.geometricError}`;
+ attributes++;
+ }
+ if (tileset.debugShowRenderingStatistics) {
+ labelString += `
+Commands: ${tile.commandsLength}`;
+ attributes++;
+ const numberOfPoints = tile.content.pointsLength;
+ if (numberOfPoints > 0) {
+ labelString += `
+Points: ${tile.content.pointsLength}`;
+ attributes++;
+ }
+ const numberOfTriangles = tile.content.trianglesLength;
+ if (numberOfTriangles > 0) {
+ labelString += `
+Triangles: ${tile.content.trianglesLength}`;
+ attributes++;
+ }
+ labelString += `
+Features: ${tile.content.featuresLength}`;
+ attributes++;
+ }
+ if (tileset.debugShowMemoryUsage) {
+ labelString += `
+Texture Memory: ${formatMemoryString(
+ tile.content.texturesByteLength
+ )}`;
+ labelString += `
+Geometry Memory: ${formatMemoryString(
+ tile.content.geometryByteLength
+ )}`;
+ attributes += 2;
+ }
+ if (tileset.debugShowUrl) {
+ if (tile.hasMultipleContents) {
+ labelString += "\nUrls:";
+ const urls = tile.content.innerContentUrls;
+ for (let i = 0; i < urls.length; i++) {
+ labelString += `
+- ${urls[i]}`;
+ }
+ attributes += urls.length;
+ } else {
+ labelString += `
+Url: ${tile._contentHeader.uri}`;
+ attributes++;
+ }
+ }
+ const newLabel = {
+ text: labelString.substring(1),
+ position,
+ font: `${19 - attributes}px sans-serif`,
+ showBackground: true,
+ disableDepthTestDistance: Number.POSITIVE_INFINITY
+ };
+ return tileset._tileDebugLabels.add(newLabel);
+}
+function updateTileDebugLabels(tileset, frameState) {
+ let i;
+ let tile;
+ const selectedTiles = tileset._selectedTiles;
+ const selectedLength = selectedTiles.length;
+ const emptyTiles = tileset._emptyTiles;
+ const emptyLength = emptyTiles.length;
+ tileset._tileDebugLabels.removeAll();
+ if (tileset.debugPickedTileLabelOnly) {
+ if (defined_default(tileset.debugPickedTile)) {
+ const position = defined_default(tileset.debugPickPosition) ? tileset.debugPickPosition : computeTileLabelPosition(tileset.debugPickedTile);
+ const label = addTileDebugLabel(
+ tileset.debugPickedTile,
+ tileset,
+ position
+ );
+ label.pixelOffset = new Cartesian2_default(15, -15);
+ }
+ } else {
+ for (i = 0; i < selectedLength; ++i) {
+ tile = selectedTiles[i];
+ addTileDebugLabel(tile, tileset, computeTileLabelPosition(tile));
+ }
+ for (i = 0; i < emptyLength; ++i) {
+ tile = emptyTiles[i];
+ if (tile.hasTilesetContent || tile.hasImplicitContent) {
+ addTileDebugLabel(tile, tileset, computeTileLabelPosition(tile));
+ }
+ }
+ }
+ tileset._tileDebugLabels.update(frameState);
+}
+function updateTiles(tileset, frameState, passOptions2) {
+ tileset._styleEngine.applyStyle(tileset);
+ tileset._styleApplied = true;
+ const isRender = passOptions2.isRender;
+ const statistics2 = tileset._statistics;
+ const commandList = frameState.commandList;
+ const numberOfInitialCommands = commandList.length;
+ const selectedTiles = tileset._selectedTiles;
+ const selectedLength = selectedTiles.length;
+ const emptyTiles = tileset._emptyTiles;
+ const emptyLength = emptyTiles.length;
+ const tileVisible = tileset.tileVisible;
+ let i;
+ let tile;
+ const bivariateVisibilityTest = tileset._skipLevelOfDetail && tileset._hasMixedContent && frameState.context.stencilBuffer && selectedLength > 0;
+ tileset._backfaceCommands.length = 0;
+ if (bivariateVisibilityTest) {
+ if (!defined_default(tileset._stencilClearCommand)) {
+ tileset._stencilClearCommand = new ClearCommand_default({
+ stencil: 0,
+ pass: Pass_default.CESIUM_3D_TILE,
+ renderState: RenderState_default.fromCache({
+ stencilMask: StencilConstants_default.SKIP_LOD_MASK
+ })
+ });
+ }
+ commandList.push(tileset._stencilClearCommand);
+ }
+ const lengthBeforeUpdate = commandList.length;
+ for (i = 0; i < selectedLength; ++i) {
+ tile = selectedTiles[i];
+ if (isRender) {
+ tileVisible.raiseEvent(tile);
+ }
+ tile.update(tileset, frameState, passOptions2);
+ statistics2.incrementSelectionCounts(tile.content);
+ ++statistics2.selected;
+ }
+ for (i = 0; i < emptyLength; ++i) {
+ tile = emptyTiles[i];
+ tile.update(tileset, frameState, passOptions2);
+ }
+ let addedCommandsLength = commandList.length - lengthBeforeUpdate;
+ tileset._backfaceCommands.trim();
+ if (bivariateVisibilityTest) {
+ const backfaceCommands = tileset._backfaceCommands.values;
+ const backfaceCommandsLength = backfaceCommands.length;
+ commandList.length += backfaceCommandsLength;
+ for (i = addedCommandsLength - 1; i >= 0; --i) {
+ commandList[lengthBeforeUpdate + backfaceCommandsLength + i] = commandList[lengthBeforeUpdate + i];
+ }
+ for (i = 0; i < backfaceCommandsLength; ++i) {
+ commandList[lengthBeforeUpdate + i] = backfaceCommands[i];
+ }
+ }
+ addedCommandsLength = commandList.length - numberOfInitialCommands;
+ statistics2.numberOfCommands = addedCommandsLength;
+ if (isRender && tileset.pointCloudShading.attenuation && tileset.pointCloudShading.eyeDomeLighting && addedCommandsLength > 0) {
+ tileset._pointCloudEyeDomeLighting.update(
+ frameState,
+ numberOfInitialCommands,
+ tileset.pointCloudShading,
+ tileset.boundingSphere
+ );
+ }
+ if (isRender) {
+ if (tileset.debugShowGeometricError || tileset.debugShowRenderingStatistics || tileset.debugShowMemoryUsage || tileset.debugShowUrl) {
+ if (!defined_default(tileset._tileDebugLabels)) {
+ tileset._tileDebugLabels = new LabelCollection_default();
+ }
+ updateTileDebugLabels(tileset, frameState);
+ } else {
+ tileset._tileDebugLabels = tileset._tileDebugLabels && tileset._tileDebugLabels.destroy();
+ }
+ }
+}
+var scratchStack2 = [];
+function destroySubtree(tileset, tile) {
+ const root = tile;
+ const stack = scratchStack2;
+ stack.push(tile);
+ while (stack.length > 0) {
+ tile = stack.pop();
+ const children = tile.children;
+ const length3 = children.length;
+ for (let i = 0; i < length3; ++i) {
+ stack.push(children[i]);
+ }
+ if (tile !== root) {
+ destroyTile(tileset, tile);
+ --tileset._statistics.numberOfTilesTotal;
+ }
+ }
+ root.children = [];
+}
+function unloadTile(tileset, tile) {
+ tileset.tileUnload.raiseEvent(tile);
+ tileset._statistics.decrementLoadCounts(tile.content);
+ --tileset._statistics.numberOfTilesWithContentReady;
+ tile.unloadContent();
+}
+function destroyTile(tileset, tile) {
+ tileset._cache.unloadTile(tileset, tile, unloadTile);
+ tile.destroy();
+}
+Cesium3DTileset.prototype.trimLoadedTiles = function() {
+ this._cache.trim();
+};
+function raiseLoadProgressEvent(tileset, frameState) {
+ const statistics2 = tileset._statistics;
+ const statisticsLast = tileset._statisticsLast;
+ const numberOfPendingRequests = statistics2.numberOfPendingRequests;
+ const numberOfTilesProcessing = statistics2.numberOfTilesProcessing;
+ const lastNumberOfPendingRequest = statisticsLast.numberOfPendingRequests;
+ const lastNumberOfTilesProcessing = statisticsLast.numberOfTilesProcessing;
+ Cesium3DTilesetStatistics_default.clone(statistics2, statisticsLast);
+ const progressChanged = numberOfPendingRequests !== lastNumberOfPendingRequest || numberOfTilesProcessing !== lastNumberOfTilesProcessing;
+ if (progressChanged) {
+ frameState.afterRender.push(function() {
+ tileset.loadProgress.raiseEvent(
+ numberOfPendingRequests,
+ numberOfTilesProcessing
+ );
+ return true;
+ });
+ }
+ tileset._tilesLoaded = statistics2.numberOfPendingRequests === 0 && statistics2.numberOfTilesProcessing === 0 && statistics2.numberOfAttemptedRequests === 0;
+ if (progressChanged && tileset._tilesLoaded) {
+ frameState.afterRender.push(function() {
+ tileset.allTilesLoaded.raiseEvent();
+ return true;
+ });
+ if (!tileset._initialTilesLoaded) {
+ tileset._initialTilesLoaded = true;
+ frameState.afterRender.push(function() {
+ tileset.initialTilesLoaded.raiseEvent();
+ return true;
+ });
+ }
+ }
+}
+function resetMinimumMaximum(tileset) {
+ tileset._heatmap.resetMinimumMaximum();
+ tileset._minimumPriority.depth = Number.MAX_VALUE;
+ tileset._maximumPriority.depth = -Number.MAX_VALUE;
+ tileset._minimumPriority.foveatedFactor = Number.MAX_VALUE;
+ tileset._maximumPriority.foveatedFactor = -Number.MAX_VALUE;
+ tileset._minimumPriority.distance = Number.MAX_VALUE;
+ tileset._maximumPriority.distance = -Number.MAX_VALUE;
+ tileset._minimumPriority.reverseScreenSpaceError = Number.MAX_VALUE;
+ tileset._maximumPriority.reverseScreenSpaceError = -Number.MAX_VALUE;
+}
+function detectModelMatrixChanged(tileset, frameState) {
+ if (frameState.frameNumber !== tileset._updatedModelMatrixFrame || !defined_default(tileset._previousModelMatrix)) {
+ tileset._updatedModelMatrixFrame = frameState.frameNumber;
+ tileset._modelMatrixChanged = !Matrix4_default.equals(
+ tileset.modelMatrix,
+ tileset._previousModelMatrix
+ );
+ if (tileset._modelMatrixChanged) {
+ tileset._previousModelMatrix = Matrix4_default.clone(
+ tileset.modelMatrix,
+ tileset._previousModelMatrix
+ );
+ }
+ }
+}
+function update3(tileset, frameState, passStatistics, passOptions2) {
+ if (frameState.mode === SceneMode_default.MORPHING) {
+ return false;
+ }
+ if (!tileset.ready) {
+ return false;
+ }
+ const statistics2 = tileset._statistics;
+ statistics2.clear();
+ const isRender = passOptions2.isRender;
+ ++tileset._updatedVisibilityFrame;
+ resetMinimumMaximum(tileset);
+ detectModelMatrixChanged(tileset, frameState);
+ tileset._cullRequestsWhileMoving = tileset.cullRequestsWhileMoving && !tileset._modelMatrixChanged;
+ const ready = passOptions2.traversal.selectTiles(tileset, frameState);
+ if (passOptions2.requestTiles) {
+ requestTiles(tileset);
+ }
+ updateTiles(tileset, frameState, passOptions2);
+ Cesium3DTilesetStatistics_default.clone(statistics2, passStatistics);
+ if (isRender) {
+ const credits = tileset._credits;
+ if (defined_default(credits) && statistics2.selected !== 0) {
+ const length3 = credits.length;
+ for (let i = 0; i < length3; ++i) {
+ const credit = credits[i];
+ credit.showOnScreen = tileset._showCreditsOnScreen;
+ frameState.creditDisplay.addCredit(credit);
+ }
+ }
+ }
+ return ready;
+}
+Cesium3DTileset.prototype.update = function(frameState) {
+ this.updateForPass(frameState, frameState.tilesetPassState);
+};
+Cesium3DTileset.prototype.updateForPass = function(frameState, tilesetPassState) {
+ Check_default.typeOf.object("frameState", frameState);
+ Check_default.typeOf.object("tilesetPassState", tilesetPassState);
+ const pass = tilesetPassState.pass;
+ if (pass === Cesium3DTilePass_default.PRELOAD && (!this.preloadWhenHidden || this.show) || pass === Cesium3DTilePass_default.PRELOAD_FLIGHT && (!this.preloadFlightDestinations || !this.show && !this.preloadWhenHidden) || pass === Cesium3DTilePass_default.REQUEST_RENDER_MODE_DEFER_CHECK && (!this._cullRequestsWhileMoving && this.foveatedTimeDelay <= 0 || !this.show)) {
+ return;
+ }
+ const originalCommandList = frameState.commandList;
+ const originalCamera = frameState.camera;
+ const originalCullingVolume = frameState.cullingVolume;
+ tilesetPassState.ready = false;
+ const passOptions2 = Cesium3DTilePass_default.getPassOptions(pass);
+ const ignoreCommands = passOptions2.ignoreCommands;
+ const commandList = defaultValue_default(
+ tilesetPassState.commandList,
+ originalCommandList
+ );
+ const commandStart = commandList.length;
+ frameState.commandList = commandList;
+ frameState.camera = defaultValue_default(tilesetPassState.camera, originalCamera);
+ frameState.cullingVolume = defaultValue_default(
+ tilesetPassState.cullingVolume,
+ originalCullingVolume
+ );
+ const passStatistics = this._statisticsPerPass[pass];
+ if (this.show || ignoreCommands) {
+ this._pass = pass;
+ tilesetPassState.ready = update3(
+ this,
+ frameState,
+ passStatistics,
+ passOptions2
+ );
+ }
+ if (ignoreCommands) {
+ commandList.length = commandStart;
+ }
+ frameState.commandList = originalCommandList;
+ frameState.camera = originalCamera;
+ frameState.cullingVolume = originalCullingVolume;
+};
+Cesium3DTileset.prototype.hasExtension = function(extensionName) {
+ if (!defined_default(this._extensionsUsed)) {
+ return false;
+ }
+ return this._extensionsUsed.indexOf(extensionName) > -1;
+};
+Cesium3DTileset.prototype.isDestroyed = function() {
+ return false;
+};
+Cesium3DTileset.prototype.destroy = function() {
+ this._tileDebugLabels = this._tileDebugLabels && this._tileDebugLabels.destroy();
+ this._clippingPlanes = this._clippingPlanes && this._clippingPlanes.destroy();
+ if (defined_default(this._schemaLoader)) {
+ ResourceCache_default.unload(this._schemaLoader);
+ }
+ if (defined_default(this._root)) {
+ const stack = scratchStack2;
+ stack.push(this._root);
+ while (stack.length > 0) {
+ const tile = stack.pop();
+ tile.destroy();
+ const children = tile.children;
+ const length3 = children.length;
+ for (let i = 0; i < length3; ++i) {
+ stack.push(children[i]);
+ }
+ }
+ }
+ this._root = void 0;
+ if (this._shouldDestroyImageBasedLighting && !this._imageBasedLighting.isDestroyed()) {
+ this._imageBasedLighting.destroy();
+ }
+ this._imageBasedLighting = void 0;
+ return destroyObject_default(this);
+};
+Cesium3DTileset.supportedExtensions = {
+ "3DTILES_metadata": true,
+ "3DTILES_implicit_tiling": true,
+ "3DTILES_content_gltf": true,
+ "3DTILES_multiple_contents": true,
+ "3DTILES_bounding_volume_S2": true,
+ "3DTILES_batch_table_hierarchy": true,
+ "3DTILES_draco_point_compression": true,
+ MAXAR_content_geojson: true
+};
+Cesium3DTileset.checkSupportedExtensions = function(extensionsRequired) {
+ for (let i = 0; i < extensionsRequired.length; i++) {
+ if (!Cesium3DTileset.supportedExtensions[extensionsRequired[i]]) {
+ throw new RuntimeError_default(
+ `Unsupported 3D Tiles Extension: ${extensionsRequired[i]}`
+ );
+ }
+ }
+};
+var Cesium3DTileset_default = Cesium3DTileset;
+
+// Source/DataSources/Cesium3DTilesetVisualizer.js
+var modelMatrixScratch2 = new Matrix4_default();
+function Cesium3DTilesetVisualizer(scene, entityCollection) {
+ if (!defined_default(scene)) {
+ throw new DeveloperError_default("scene is required.");
+ }
+ if (!defined_default(entityCollection)) {
+ throw new DeveloperError_default("entityCollection is required.");
+ }
+ entityCollection.collectionChanged.addEventListener(
+ Cesium3DTilesetVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ this._scene = scene;
+ this._primitives = scene.primitives;
+ this._entityCollection = entityCollection;
+ this._tilesetHash = {};
+ this._entitiesToVisualize = new AssociativeArray_default();
+ this._onCollectionChanged(entityCollection, entityCollection.values, [], []);
+}
+Cesium3DTilesetVisualizer.prototype.update = function(time) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ const entities = this._entitiesToVisualize.values;
+ const tilesetHash = this._tilesetHash;
+ const primitives = this._primitives;
+ for (let i = 0, len = entities.length; i < len; i++) {
+ const entity = entities[i];
+ const tilesetGraphics = entity._tileset;
+ let resource;
+ let tilesetData = tilesetHash[entity.id];
+ const show = entity.isShowing && entity.isAvailable(time) && Property_default.getValueOrDefault(tilesetGraphics._show, time, true);
+ let modelMatrix;
+ if (show) {
+ modelMatrix = entity.computeModelMatrix(time, modelMatrixScratch2);
+ resource = Resource_default.createIfNeeded(
+ Property_default.getValueOrUndefined(tilesetGraphics._uri, time)
+ );
+ }
+ if (!show) {
+ if (defined_default(tilesetData)) {
+ tilesetData.tilesetPrimitive.show = false;
+ }
+ continue;
+ }
+ let tileset = defined_default(tilesetData) ? tilesetData.tilesetPrimitive : void 0;
+ if (!defined_default(tileset) || resource.url !== tilesetData.url) {
+ if (defined_default(tileset)) {
+ primitives.removeAndDestroy(tileset);
+ delete tilesetHash[entity.id];
+ }
+ tileset = new Cesium3DTileset_default({
+ url: resource
+ });
+ tileset.id = entity;
+ primitives.add(tileset);
+ tilesetData = {
+ tilesetPrimitive: tileset,
+ url: resource.url,
+ loadFail: false
+ };
+ tilesetHash[entity.id] = tilesetData;
+ checkLoad(tileset, entity, tilesetHash);
+ }
+ tileset.show = true;
+ if (defined_default(modelMatrix)) {
+ tileset.modelMatrix = modelMatrix;
+ }
+ tileset.maximumScreenSpaceError = Property_default.getValueOrDefault(
+ tilesetGraphics.maximumScreenSpaceError,
+ time,
+ tileset.maximumScreenSpaceError
+ );
+ }
+ return true;
+};
+Cesium3DTilesetVisualizer.prototype.isDestroyed = function() {
+ return false;
+};
+Cesium3DTilesetVisualizer.prototype.destroy = function() {
+ this._entityCollection.collectionChanged.removeEventListener(
+ Cesium3DTilesetVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ const entities = this._entitiesToVisualize.values;
+ const tilesetHash = this._tilesetHash;
+ const primitives = this._primitives;
+ for (let i = entities.length - 1; i > -1; i--) {
+ removeTileset(this, entities[i], tilesetHash, primitives);
+ }
+ return destroyObject_default(this);
+};
+Cesium3DTilesetVisualizer.prototype.getBoundingSphere = function(entity, result) {
+ if (!defined_default(entity)) {
+ throw new DeveloperError_default("entity is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const tilesetData = this._tilesetHash[entity.id];
+ if (!defined_default(tilesetData) || tilesetData.loadFail) {
+ return BoundingSphereState_default.FAILED;
+ }
+ const primitive = tilesetData.tilesetPrimitive;
+ if (!defined_default(primitive) || !primitive.show) {
+ return BoundingSphereState_default.FAILED;
+ }
+ if (!primitive.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ BoundingSphere_default.clone(primitive.boundingSphere, result);
+ return BoundingSphereState_default.DONE;
+};
+Cesium3DTilesetVisualizer.prototype._onCollectionChanged = function(entityCollection, added, removed, changed) {
+ let i;
+ let entity;
+ const entities = this._entitiesToVisualize;
+ const tilesetHash = this._tilesetHash;
+ const primitives = this._primitives;
+ for (i = added.length - 1; i > -1; i--) {
+ entity = added[i];
+ if (defined_default(entity._tileset)) {
+ entities.set(entity.id, entity);
+ }
+ }
+ for (i = changed.length - 1; i > -1; i--) {
+ entity = changed[i];
+ if (defined_default(entity._tileset)) {
+ entities.set(entity.id, entity);
+ } else {
+ removeTileset(this, entity, tilesetHash, primitives);
+ entities.remove(entity.id);
+ }
+ }
+ for (i = removed.length - 1; i > -1; i--) {
+ entity = removed[i];
+ removeTileset(this, entity, tilesetHash, primitives);
+ entities.remove(entity.id);
+ }
+};
+function removeTileset(visualizer, entity, tilesetHash, primitives) {
+ const tilesetData = tilesetHash[entity.id];
+ if (defined_default(tilesetData)) {
+ primitives.removeAndDestroy(tilesetData.tilesetPrimitive);
+ delete tilesetHash[entity.id];
+ }
+}
+function checkLoad(primitive, entity, tilesetHash) {
+ primitive.readyPromise.catch(function(error) {
+ console.error(error);
+ tilesetHash[entity.id].loadFail = true;
+ });
+}
+var Cesium3DTilesetVisualizer_default = Cesium3DTilesetVisualizer;
+
+// Source/DataSources/CheckerboardMaterialProperty.js
+var defaultEvenColor = Color_default.WHITE;
+var defaultOddColor = Color_default.BLACK;
+var defaultRepeat2 = new Cartesian2_default(2, 2);
+function CheckerboardMaterialProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._definitionChanged = new Event_default();
+ this._evenColor = void 0;
+ this._evenColorSubscription = void 0;
+ this._oddColor = void 0;
+ this._oddColorSubscription = void 0;
+ this._repeat = void 0;
+ this._repeatSubscription = void 0;
+ this.evenColor = options.evenColor;
+ this.oddColor = options.oddColor;
+ this.repeat = options.repeat;
+}
+Object.defineProperties(CheckerboardMaterialProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._evenColor) && Property_default.isConstant(this._oddColor) && Property_default.isConstant(this._repeat);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ evenColor: createPropertyDescriptor_default("evenColor"),
+ oddColor: createPropertyDescriptor_default("oddColor"),
+ repeat: createPropertyDescriptor_default("repeat")
+});
+CheckerboardMaterialProperty.prototype.getType = function(time) {
+ return "Checkerboard";
+};
+CheckerboardMaterialProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(result)) {
+ result = {};
+ }
+ result.lightColor = Property_default.getValueOrClonedDefault(
+ this._evenColor,
+ time,
+ defaultEvenColor,
+ result.lightColor
+ );
+ result.darkColor = Property_default.getValueOrClonedDefault(
+ this._oddColor,
+ time,
+ defaultOddColor,
+ result.darkColor
+ );
+ result.repeat = Property_default.getValueOrDefault(this._repeat, time, defaultRepeat2);
+ return result;
+};
+CheckerboardMaterialProperty.prototype.equals = function(other) {
+ return this === other || other instanceof CheckerboardMaterialProperty && Property_default.equals(this._evenColor, other._evenColor) && Property_default.equals(this._oddColor, other._oddColor) && Property_default.equals(this._repeat, other._repeat);
+};
+var CheckerboardMaterialProperty_default = CheckerboardMaterialProperty;
+
+// Source/DataSources/EntityCollection.js
+var entityOptionsScratch = {
+ id: void 0
+};
+function fireChangedEvent(collection) {
+ if (collection._firing) {
+ collection._refire = true;
+ return;
+ }
+ if (collection._suspendCount === 0) {
+ const added = collection._addedEntities;
+ const removed = collection._removedEntities;
+ const changed = collection._changedEntities;
+ if (changed.length !== 0 || added.length !== 0 || removed.length !== 0) {
+ collection._firing = true;
+ do {
+ collection._refire = false;
+ const addedArray = added.values.slice(0);
+ const removedArray = removed.values.slice(0);
+ const changedArray = changed.values.slice(0);
+ added.removeAll();
+ removed.removeAll();
+ changed.removeAll();
+ collection._collectionChanged.raiseEvent(
+ collection,
+ addedArray,
+ removedArray,
+ changedArray
+ );
+ } while (collection._refire);
+ collection._firing = false;
+ }
+ }
+}
+function EntityCollection(owner) {
+ this._owner = owner;
+ this._entities = new AssociativeArray_default();
+ this._addedEntities = new AssociativeArray_default();
+ this._removedEntities = new AssociativeArray_default();
+ this._changedEntities = new AssociativeArray_default();
+ this._suspendCount = 0;
+ this._collectionChanged = new Event_default();
+ this._id = createGuid_default();
+ this._show = true;
+ this._firing = false;
+ this._refire = false;
+}
+EntityCollection.prototype.suspendEvents = function() {
+ this._suspendCount++;
+};
+EntityCollection.prototype.resumeEvents = function() {
+ if (this._suspendCount === 0) {
+ throw new DeveloperError_default(
+ "resumeEvents can not be called before suspendEvents."
+ );
+ }
+ this._suspendCount--;
+ fireChangedEvent(this);
+};
+Object.defineProperties(EntityCollection.prototype, {
+ collectionChanged: {
+ get: function() {
+ return this._collectionChanged;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ values: {
+ get: function() {
+ return this._entities.values;
+ }
+ },
+ show: {
+ get: function() {
+ return this._show;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (value === this._show) {
+ return;
+ }
+ this.suspendEvents();
+ let i;
+ const oldShows = [];
+ const entities = this._entities.values;
+ const entitiesLength = entities.length;
+ for (i = 0; i < entitiesLength; i++) {
+ oldShows.push(entities[i].isShowing);
+ }
+ this._show = value;
+ for (i = 0; i < entitiesLength; i++) {
+ const oldShow = oldShows[i];
+ const entity = entities[i];
+ if (oldShow !== entity.isShowing) {
+ entity.definitionChanged.raiseEvent(
+ entity,
+ "isShowing",
+ entity.isShowing,
+ oldShow
+ );
+ }
+ }
+ this.resumeEvents();
+ }
+ },
+ owner: {
+ get: function() {
+ return this._owner;
+ }
+ }
+});
+EntityCollection.prototype.computeAvailability = function() {
+ let startTime = Iso8601_default.MAXIMUM_VALUE;
+ let stopTime = Iso8601_default.MINIMUM_VALUE;
+ const entities = this._entities.values;
+ for (let i = 0, len = entities.length; i < len; i++) {
+ const entity = entities[i];
+ const availability = entity.availability;
+ if (defined_default(availability)) {
+ const start = availability.start;
+ const stop2 = availability.stop;
+ if (JulianDate_default.lessThan(start, startTime) && !start.equals(Iso8601_default.MINIMUM_VALUE)) {
+ startTime = start;
+ }
+ if (JulianDate_default.greaterThan(stop2, stopTime) && !stop2.equals(Iso8601_default.MAXIMUM_VALUE)) {
+ stopTime = stop2;
+ }
+ }
+ }
+ if (Iso8601_default.MAXIMUM_VALUE.equals(startTime)) {
+ startTime = Iso8601_default.MINIMUM_VALUE;
+ }
+ if (Iso8601_default.MINIMUM_VALUE.equals(stopTime)) {
+ stopTime = Iso8601_default.MAXIMUM_VALUE;
+ }
+ return new TimeInterval_default({
+ start: startTime,
+ stop: stopTime
+ });
+};
+EntityCollection.prototype.add = function(entity) {
+ if (!defined_default(entity)) {
+ throw new DeveloperError_default("entity is required.");
+ }
+ if (!(entity instanceof Entity_default)) {
+ entity = new Entity_default(entity);
+ }
+ const id = entity.id;
+ const entities = this._entities;
+ if (entities.contains(id)) {
+ throw new RuntimeError_default(
+ `An entity with id ${id} already exists in this collection.`
+ );
+ }
+ entity.entityCollection = this;
+ entities.set(id, entity);
+ if (!this._removedEntities.remove(id)) {
+ this._addedEntities.set(id, entity);
+ }
+ entity.definitionChanged.addEventListener(
+ EntityCollection.prototype._onEntityDefinitionChanged,
+ this
+ );
+ fireChangedEvent(this);
+ return entity;
+};
+EntityCollection.prototype.remove = function(entity) {
+ if (!defined_default(entity)) {
+ return false;
+ }
+ return this.removeById(entity.id);
+};
+EntityCollection.prototype.contains = function(entity) {
+ if (!defined_default(entity)) {
+ throw new DeveloperError_default("entity is required");
+ }
+ return this._entities.get(entity.id) === entity;
+};
+EntityCollection.prototype.removeById = function(id) {
+ if (!defined_default(id)) {
+ return false;
+ }
+ const entities = this._entities;
+ const entity = entities.get(id);
+ if (!this._entities.remove(id)) {
+ return false;
+ }
+ if (!this._addedEntities.remove(id)) {
+ this._removedEntities.set(id, entity);
+ this._changedEntities.remove(id);
+ }
+ this._entities.remove(id);
+ entity.definitionChanged.removeEventListener(
+ EntityCollection.prototype._onEntityDefinitionChanged,
+ this
+ );
+ fireChangedEvent(this);
+ return true;
+};
+EntityCollection.prototype.removeAll = function() {
+ const entities = this._entities;
+ const entitiesLength = entities.length;
+ const array = entities.values;
+ const addedEntities = this._addedEntities;
+ const removed = this._removedEntities;
+ for (let i = 0; i < entitiesLength; i++) {
+ const existingItem = array[i];
+ const existingItemId = existingItem.id;
+ const addedItem = addedEntities.get(existingItemId);
+ if (!defined_default(addedItem)) {
+ existingItem.definitionChanged.removeEventListener(
+ EntityCollection.prototype._onEntityDefinitionChanged,
+ this
+ );
+ removed.set(existingItemId, existingItem);
+ }
+ }
+ entities.removeAll();
+ addedEntities.removeAll();
+ this._changedEntities.removeAll();
+ fireChangedEvent(this);
+};
+EntityCollection.prototype.getById = function(id) {
+ if (!defined_default(id)) {
+ throw new DeveloperError_default("id is required.");
+ }
+ return this._entities.get(id);
+};
+EntityCollection.prototype.getOrCreateEntity = function(id) {
+ if (!defined_default(id)) {
+ throw new DeveloperError_default("id is required.");
+ }
+ let entity = this._entities.get(id);
+ if (!defined_default(entity)) {
+ entityOptionsScratch.id = id;
+ entity = new Entity_default(entityOptionsScratch);
+ this.add(entity);
+ }
+ return entity;
+};
+EntityCollection.prototype._onEntityDefinitionChanged = function(entity) {
+ const id = entity.id;
+ if (!this._addedEntities.contains(id)) {
+ this._changedEntities.set(id, entity);
+ }
+ fireChangedEvent(this);
+};
+var EntityCollection_default = EntityCollection;
+
+// Source/DataSources/CompositeEntityCollection.js
+var entityOptionsScratch2 = {
+ id: void 0
+};
+var entityIdScratch = new Array(2);
+function clean(entity) {
+ const propertyNames = entity.propertyNames;
+ const propertyNamesLength = propertyNames.length;
+ for (let i = 0; i < propertyNamesLength; i++) {
+ entity[propertyNames[i]] = void 0;
+ }
+ entity._name = void 0;
+ entity._availability = void 0;
+}
+function subscribeToEntity(that, eventHash, collectionId, entity) {
+ entityIdScratch[0] = collectionId;
+ entityIdScratch[1] = entity.id;
+ eventHash[JSON.stringify(entityIdScratch)] = entity.definitionChanged.addEventListener(
+ CompositeEntityCollection.prototype._onDefinitionChanged,
+ that
+ );
+}
+function unsubscribeFromEntity(that, eventHash, collectionId, entity) {
+ entityIdScratch[0] = collectionId;
+ entityIdScratch[1] = entity.id;
+ const id = JSON.stringify(entityIdScratch);
+ eventHash[id]();
+ eventHash[id] = void 0;
+}
+function recomposite(that) {
+ that._shouldRecomposite = true;
+ if (that._suspendCount !== 0) {
+ return;
+ }
+ const collections = that._collections;
+ const collectionsLength = collections.length;
+ const collectionsCopy = that._collectionsCopy;
+ const collectionsCopyLength = collectionsCopy.length;
+ let i;
+ let entity;
+ let entities;
+ let iEntities;
+ let collection;
+ const composite = that._composite;
+ const newEntities = new EntityCollection_default(that);
+ const eventHash = that._eventHash;
+ let collectionId;
+ for (i = 0; i < collectionsCopyLength; i++) {
+ collection = collectionsCopy[i];
+ collection.collectionChanged.removeEventListener(
+ CompositeEntityCollection.prototype._onCollectionChanged,
+ that
+ );
+ entities = collection.values;
+ collectionId = collection.id;
+ for (iEntities = entities.length - 1; iEntities > -1; iEntities--) {
+ entity = entities[iEntities];
+ unsubscribeFromEntity(that, eventHash, collectionId, entity);
+ }
+ }
+ for (i = collectionsLength - 1; i >= 0; i--) {
+ collection = collections[i];
+ collection.collectionChanged.addEventListener(
+ CompositeEntityCollection.prototype._onCollectionChanged,
+ that
+ );
+ entities = collection.values;
+ collectionId = collection.id;
+ for (iEntities = entities.length - 1; iEntities > -1; iEntities--) {
+ entity = entities[iEntities];
+ subscribeToEntity(that, eventHash, collectionId, entity);
+ let compositeEntity = newEntities.getById(entity.id);
+ if (!defined_default(compositeEntity)) {
+ compositeEntity = composite.getById(entity.id);
+ if (!defined_default(compositeEntity)) {
+ entityOptionsScratch2.id = entity.id;
+ compositeEntity = new Entity_default(entityOptionsScratch2);
+ } else {
+ clean(compositeEntity);
+ }
+ newEntities.add(compositeEntity);
+ }
+ compositeEntity.merge(entity);
+ }
+ }
+ that._collectionsCopy = collections.slice(0);
+ composite.suspendEvents();
+ composite.removeAll();
+ const newEntitiesArray = newEntities.values;
+ for (i = 0; i < newEntitiesArray.length; i++) {
+ composite.add(newEntitiesArray[i]);
+ }
+ composite.resumeEvents();
+}
+function CompositeEntityCollection(collections, owner) {
+ this._owner = owner;
+ this._composite = new EntityCollection_default(this);
+ this._suspendCount = 0;
+ this._collections = defined_default(collections) ? collections.slice() : [];
+ this._collectionsCopy = [];
+ this._id = createGuid_default();
+ this._eventHash = {};
+ recomposite(this);
+ this._shouldRecomposite = false;
+}
+Object.defineProperties(CompositeEntityCollection.prototype, {
+ collectionChanged: {
+ get: function() {
+ return this._composite._collectionChanged;
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ values: {
+ get: function() {
+ return this._composite.values;
+ }
+ },
+ owner: {
+ get: function() {
+ return this._owner;
+ }
+ }
+});
+CompositeEntityCollection.prototype.addCollection = function(collection, index) {
+ const hasIndex = defined_default(index);
+ if (!defined_default(collection)) {
+ throw new DeveloperError_default("collection is required.");
+ }
+ if (hasIndex) {
+ if (index < 0) {
+ throw new DeveloperError_default("index must be greater than or equal to zero.");
+ } else if (index > this._collections.length) {
+ throw new DeveloperError_default(
+ "index must be less than or equal to the number of collections."
+ );
+ }
+ }
+ if (!hasIndex) {
+ index = this._collections.length;
+ this._collections.push(collection);
+ } else {
+ this._collections.splice(index, 0, collection);
+ }
+ recomposite(this);
+};
+CompositeEntityCollection.prototype.removeCollection = function(collection) {
+ const index = this._collections.indexOf(collection);
+ if (index !== -1) {
+ this._collections.splice(index, 1);
+ recomposite(this);
+ return true;
+ }
+ return false;
+};
+CompositeEntityCollection.prototype.removeAllCollections = function() {
+ this._collections.length = 0;
+ recomposite(this);
+};
+CompositeEntityCollection.prototype.containsCollection = function(collection) {
+ return this._collections.indexOf(collection) !== -1;
+};
+CompositeEntityCollection.prototype.contains = function(entity) {
+ return this._composite.contains(entity);
+};
+CompositeEntityCollection.prototype.indexOfCollection = function(collection) {
+ return this._collections.indexOf(collection);
+};
+CompositeEntityCollection.prototype.getCollection = function(index) {
+ if (!defined_default(index)) {
+ throw new DeveloperError_default("index is required.", "index");
+ }
+ return this._collections[index];
+};
+CompositeEntityCollection.prototype.getCollectionsLength = function() {
+ return this._collections.length;
+};
+function getCollectionIndex(collections, collection) {
+ if (!defined_default(collection)) {
+ throw new DeveloperError_default("collection is required.");
+ }
+ const index = collections.indexOf(collection);
+ if (index === -1) {
+ throw new DeveloperError_default("collection is not in this composite.");
+ }
+ return index;
+}
+function swapCollections(composite, i, j) {
+ const arr = composite._collections;
+ i = Math_default.clamp(i, 0, arr.length - 1);
+ j = Math_default.clamp(j, 0, arr.length - 1);
+ if (i === j) {
+ return;
+ }
+ const temp = arr[i];
+ arr[i] = arr[j];
+ arr[j] = temp;
+ recomposite(composite);
+}
+CompositeEntityCollection.prototype.raiseCollection = function(collection) {
+ const index = getCollectionIndex(this._collections, collection);
+ swapCollections(this, index, index + 1);
+};
+CompositeEntityCollection.prototype.lowerCollection = function(collection) {
+ const index = getCollectionIndex(this._collections, collection);
+ swapCollections(this, index, index - 1);
+};
+CompositeEntityCollection.prototype.raiseCollectionToTop = function(collection) {
+ const index = getCollectionIndex(this._collections, collection);
+ if (index === this._collections.length - 1) {
+ return;
+ }
+ this._collections.splice(index, 1);
+ this._collections.push(collection);
+ recomposite(this);
+};
+CompositeEntityCollection.prototype.lowerCollectionToBottom = function(collection) {
+ const index = getCollectionIndex(this._collections, collection);
+ if (index === 0) {
+ return;
+ }
+ this._collections.splice(index, 1);
+ this._collections.splice(0, 0, collection);
+ recomposite(this);
+};
+CompositeEntityCollection.prototype.suspendEvents = function() {
+ this._suspendCount++;
+ this._composite.suspendEvents();
+};
+CompositeEntityCollection.prototype.resumeEvents = function() {
+ if (this._suspendCount === 0) {
+ throw new DeveloperError_default(
+ "resumeEvents can not be called before suspendEvents."
+ );
+ }
+ this._suspendCount--;
+ if (this._shouldRecomposite && this._suspendCount === 0) {
+ recomposite(this);
+ this._shouldRecomposite = false;
+ }
+ this._composite.resumeEvents();
+};
+CompositeEntityCollection.prototype.computeAvailability = function() {
+ return this._composite.computeAvailability();
+};
+CompositeEntityCollection.prototype.getById = function(id) {
+ return this._composite.getById(id);
+};
+CompositeEntityCollection.prototype._onCollectionChanged = function(collection, added, removed) {
+ const collections = this._collectionsCopy;
+ const collectionsLength = collections.length;
+ const composite = this._composite;
+ composite.suspendEvents();
+ let i;
+ let q;
+ let entity;
+ let compositeEntity;
+ const removedLength = removed.length;
+ const eventHash = this._eventHash;
+ const collectionId = collection.id;
+ for (i = 0; i < removedLength; i++) {
+ const removedEntity = removed[i];
+ unsubscribeFromEntity(this, eventHash, collectionId, removedEntity);
+ const removedId = removedEntity.id;
+ for (q = collectionsLength - 1; q >= 0; q--) {
+ entity = collections[q].getById(removedId);
+ if (defined_default(entity)) {
+ if (!defined_default(compositeEntity)) {
+ compositeEntity = composite.getById(removedId);
+ clean(compositeEntity);
+ }
+ compositeEntity.merge(entity);
+ }
+ }
+ if (!defined_default(compositeEntity)) {
+ composite.removeById(removedId);
+ }
+ compositeEntity = void 0;
+ }
+ const addedLength = added.length;
+ for (i = 0; i < addedLength; i++) {
+ const addedEntity = added[i];
+ subscribeToEntity(this, eventHash, collectionId, addedEntity);
+ const addedId = addedEntity.id;
+ for (q = collectionsLength - 1; q >= 0; q--) {
+ entity = collections[q].getById(addedId);
+ if (defined_default(entity)) {
+ if (!defined_default(compositeEntity)) {
+ compositeEntity = composite.getById(addedId);
+ if (!defined_default(compositeEntity)) {
+ entityOptionsScratch2.id = addedId;
+ compositeEntity = new Entity_default(entityOptionsScratch2);
+ composite.add(compositeEntity);
+ } else {
+ clean(compositeEntity);
+ }
+ }
+ compositeEntity.merge(entity);
+ }
+ }
+ compositeEntity = void 0;
+ }
+ composite.resumeEvents();
+};
+CompositeEntityCollection.prototype._onDefinitionChanged = function(entity, propertyName, newValue, oldValue2) {
+ const collections = this._collections;
+ const composite = this._composite;
+ const collectionsLength = collections.length;
+ const id = entity.id;
+ const compositeEntity = composite.getById(id);
+ let compositeProperty = compositeEntity[propertyName];
+ const newProperty = !defined_default(compositeProperty);
+ let firstTime = true;
+ for (let q = collectionsLength - 1; q >= 0; q--) {
+ const innerEntity = collections[q].getById(entity.id);
+ if (defined_default(innerEntity)) {
+ const property = innerEntity[propertyName];
+ if (defined_default(property)) {
+ if (firstTime) {
+ firstTime = false;
+ if (defined_default(property.merge) && defined_default(property.clone)) {
+ compositeProperty = property.clone(compositeProperty);
+ } else {
+ compositeProperty = property;
+ break;
+ }
+ }
+ compositeProperty.merge(property);
+ }
+ }
+ }
+ if (newProperty && compositeEntity.propertyNames.indexOf(propertyName) === -1) {
+ compositeEntity.addProperty(propertyName);
+ }
+ compositeEntity[propertyName] = compositeProperty;
+};
+var CompositeEntityCollection_default = CompositeEntityCollection;
+
+// Source/Core/EventHelper.js
+function EventHelper() {
+ this._removalFunctions = [];
+}
+EventHelper.prototype.add = function(event, listener, scope) {
+ if (!defined_default(event)) {
+ throw new DeveloperError_default("event is required");
+ }
+ const removalFunction = event.addEventListener(listener, scope);
+ this._removalFunctions.push(removalFunction);
+ const that = this;
+ return function() {
+ removalFunction();
+ const removalFunctions = that._removalFunctions;
+ removalFunctions.splice(removalFunctions.indexOf(removalFunction), 1);
+ };
+};
+EventHelper.prototype.removeAll = function() {
+ const removalFunctions = this._removalFunctions;
+ for (let i = 0, len = removalFunctions.length; i < len; ++i) {
+ removalFunctions[i]();
+ }
+ removalFunctions.length = 0;
+};
+var EventHelper_default = EventHelper;
+
+// Source/Core/TimeIntervalCollection.js
+function compareIntervalStartTimes(left, right) {
+ return JulianDate_default.compare(left.start, right.start);
+}
+function TimeIntervalCollection(intervals) {
+ this._intervals = [];
+ this._changedEvent = new Event_default();
+ if (defined_default(intervals)) {
+ const length3 = intervals.length;
+ for (let i = 0; i < length3; i++) {
+ this.addInterval(intervals[i]);
+ }
+ }
+}
+Object.defineProperties(TimeIntervalCollection.prototype, {
+ changedEvent: {
+ get: function() {
+ return this._changedEvent;
+ }
+ },
+ start: {
+ get: function() {
+ const intervals = this._intervals;
+ return intervals.length === 0 ? void 0 : intervals[0].start;
+ }
+ },
+ isStartIncluded: {
+ get: function() {
+ const intervals = this._intervals;
+ return intervals.length === 0 ? false : intervals[0].isStartIncluded;
+ }
+ },
+ stop: {
+ get: function() {
+ const intervals = this._intervals;
+ const length3 = intervals.length;
+ return length3 === 0 ? void 0 : intervals[length3 - 1].stop;
+ }
+ },
+ isStopIncluded: {
+ get: function() {
+ const intervals = this._intervals;
+ const length3 = intervals.length;
+ return length3 === 0 ? false : intervals[length3 - 1].isStopIncluded;
+ }
+ },
+ length: {
+ get: function() {
+ return this._intervals.length;
+ }
+ },
+ isEmpty: {
+ get: function() {
+ return this._intervals.length === 0;
+ }
+ }
+});
+TimeIntervalCollection.prototype.equals = function(right, dataComparer) {
+ if (this === right) {
+ return true;
+ }
+ if (!(right instanceof TimeIntervalCollection)) {
+ return false;
+ }
+ const intervals = this._intervals;
+ const rightIntervals = right._intervals;
+ const length3 = intervals.length;
+ if (length3 !== rightIntervals.length) {
+ return false;
+ }
+ for (let i = 0; i < length3; i++) {
+ if (!TimeInterval_default.equals(intervals[i], rightIntervals[i], dataComparer)) {
+ return false;
+ }
+ }
+ return true;
+};
+TimeIntervalCollection.prototype.get = function(index) {
+ if (!defined_default(index)) {
+ throw new DeveloperError_default("index is required.");
+ }
+ return this._intervals[index];
+};
+TimeIntervalCollection.prototype.removeAll = function() {
+ if (this._intervals.length > 0) {
+ this._intervals.length = 0;
+ this._changedEvent.raiseEvent(this);
+ }
+};
+TimeIntervalCollection.prototype.findIntervalContainingDate = function(date) {
+ const index = this.indexOf(date);
+ return index >= 0 ? this._intervals[index] : void 0;
+};
+TimeIntervalCollection.prototype.findDataForIntervalContainingDate = function(date) {
+ const index = this.indexOf(date);
+ return index >= 0 ? this._intervals[index].data : void 0;
+};
+TimeIntervalCollection.prototype.contains = function(julianDate) {
+ return this.indexOf(julianDate) >= 0;
+};
+var indexOfScratch = new TimeInterval_default();
+TimeIntervalCollection.prototype.indexOf = function(date) {
+ if (!defined_default(date)) {
+ throw new DeveloperError_default("date is required");
+ }
+ const intervals = this._intervals;
+ indexOfScratch.start = date;
+ indexOfScratch.stop = date;
+ let index = binarySearch_default(
+ intervals,
+ indexOfScratch,
+ compareIntervalStartTimes
+ );
+ if (index >= 0) {
+ if (intervals[index].isStartIncluded) {
+ return index;
+ }
+ if (index > 0 && intervals[index - 1].stop.equals(date) && intervals[index - 1].isStopIncluded) {
+ return index - 1;
+ }
+ return ~index;
+ }
+ index = ~index;
+ if (index > 0 && index - 1 < intervals.length && TimeInterval_default.contains(intervals[index - 1], date)) {
+ return index - 1;
+ }
+ return ~index;
+};
+TimeIntervalCollection.prototype.findInterval = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const start = options.start;
+ const stop2 = options.stop;
+ const isStartIncluded = options.isStartIncluded;
+ const isStopIncluded = options.isStopIncluded;
+ const intervals = this._intervals;
+ for (let i = 0, len = intervals.length; i < len; i++) {
+ const interval = intervals[i];
+ if ((!defined_default(start) || interval.start.equals(start)) && (!defined_default(stop2) || interval.stop.equals(stop2)) && (!defined_default(isStartIncluded) || interval.isStartIncluded === isStartIncluded) && (!defined_default(isStopIncluded) || interval.isStopIncluded === isStopIncluded)) {
+ return intervals[i];
+ }
+ }
+ return void 0;
+};
+TimeIntervalCollection.prototype.addInterval = function(interval, dataComparer) {
+ if (!defined_default(interval)) {
+ throw new DeveloperError_default("interval is required");
+ }
+ if (interval.isEmpty) {
+ return;
+ }
+ const intervals = this._intervals;
+ if (intervals.length === 0 || JulianDate_default.greaterThan(interval.start, intervals[intervals.length - 1].stop)) {
+ intervals.push(interval);
+ this._changedEvent.raiseEvent(this);
+ return;
+ }
+ let index = binarySearch_default(intervals, interval, compareIntervalStartTimes);
+ if (index < 0) {
+ index = ~index;
+ } else {
+ if (index > 0 && interval.isStartIncluded && intervals[index - 1].isStartIncluded && intervals[index - 1].start.equals(interval.start)) {
+ --index;
+ } else if (index < intervals.length && !interval.isStartIncluded && intervals[index].isStartIncluded && intervals[index].start.equals(interval.start)) {
+ ++index;
+ }
+ }
+ let comparison;
+ if (index > 0) {
+ comparison = JulianDate_default.compare(intervals[index - 1].stop, interval.start);
+ if (comparison > 0 || comparison === 0 && (intervals[index - 1].isStopIncluded || interval.isStartIncluded)) {
+ if (defined_default(dataComparer) ? dataComparer(intervals[index - 1].data, interval.data) : intervals[index - 1].data === interval.data) {
+ if (JulianDate_default.greaterThan(interval.stop, intervals[index - 1].stop)) {
+ interval = new TimeInterval_default({
+ start: intervals[index - 1].start,
+ stop: interval.stop,
+ isStartIncluded: intervals[index - 1].isStartIncluded,
+ isStopIncluded: interval.isStopIncluded,
+ data: interval.data
+ });
+ } else {
+ interval = new TimeInterval_default({
+ start: intervals[index - 1].start,
+ stop: intervals[index - 1].stop,
+ isStartIncluded: intervals[index - 1].isStartIncluded,
+ isStopIncluded: intervals[index - 1].isStopIncluded || interval.stop.equals(intervals[index - 1].stop) && interval.isStopIncluded,
+ data: interval.data
+ });
+ }
+ intervals.splice(index - 1, 1);
+ --index;
+ } else {
+ comparison = JulianDate_default.compare(
+ intervals[index - 1].stop,
+ interval.stop
+ );
+ if (comparison > 0 || comparison === 0 && intervals[index - 1].isStopIncluded && !interval.isStopIncluded) {
+ intervals.splice(
+ index,
+ 0,
+ new TimeInterval_default({
+ start: interval.stop,
+ stop: intervals[index - 1].stop,
+ isStartIncluded: !interval.isStopIncluded,
+ isStopIncluded: intervals[index - 1].isStopIncluded,
+ data: intervals[index - 1].data
+ })
+ );
+ }
+ intervals[index - 1] = new TimeInterval_default({
+ start: intervals[index - 1].start,
+ stop: interval.start,
+ isStartIncluded: intervals[index - 1].isStartIncluded,
+ isStopIncluded: !interval.isStartIncluded,
+ data: intervals[index - 1].data
+ });
+ }
+ }
+ }
+ while (index < intervals.length) {
+ comparison = JulianDate_default.compare(interval.stop, intervals[index].start);
+ if (comparison > 0 || comparison === 0 && (interval.isStopIncluded || intervals[index].isStartIncluded)) {
+ if (defined_default(dataComparer) ? dataComparer(intervals[index].data, interval.data) : intervals[index].data === interval.data) {
+ interval = new TimeInterval_default({
+ start: interval.start,
+ stop: JulianDate_default.greaterThan(intervals[index].stop, interval.stop) ? intervals[index].stop : interval.stop,
+ isStartIncluded: interval.isStartIncluded,
+ isStopIncluded: JulianDate_default.greaterThan(
+ intervals[index].stop,
+ interval.stop
+ ) ? intervals[index].isStopIncluded : interval.isStopIncluded,
+ data: interval.data
+ });
+ intervals.splice(index, 1);
+ } else {
+ intervals[index] = new TimeInterval_default({
+ start: interval.stop,
+ stop: intervals[index].stop,
+ isStartIncluded: !interval.isStopIncluded,
+ isStopIncluded: intervals[index].isStopIncluded,
+ data: intervals[index].data
+ });
+ if (intervals[index].isEmpty) {
+ intervals.splice(index, 1);
+ } else {
+ break;
+ }
+ }
+ } else {
+ break;
+ }
+ }
+ intervals.splice(index, 0, interval);
+ this._changedEvent.raiseEvent(this);
+};
+TimeIntervalCollection.prototype.removeInterval = function(interval) {
+ if (!defined_default(interval)) {
+ throw new DeveloperError_default("interval is required");
+ }
+ if (interval.isEmpty) {
+ return false;
+ }
+ const intervals = this._intervals;
+ let index = binarySearch_default(intervals, interval, compareIntervalStartTimes);
+ if (index < 0) {
+ index = ~index;
+ }
+ let result = false;
+ if (index > 0 && (JulianDate_default.greaterThan(intervals[index - 1].stop, interval.start) || intervals[index - 1].stop.equals(interval.start) && intervals[index - 1].isStopIncluded && interval.isStartIncluded)) {
+ result = true;
+ if (JulianDate_default.greaterThan(intervals[index - 1].stop, interval.stop) || intervals[index - 1].isStopIncluded && !interval.isStopIncluded && intervals[index - 1].stop.equals(interval.stop)) {
+ intervals.splice(
+ index,
+ 0,
+ new TimeInterval_default({
+ start: interval.stop,
+ stop: intervals[index - 1].stop,
+ isStartIncluded: !interval.isStopIncluded,
+ isStopIncluded: intervals[index - 1].isStopIncluded,
+ data: intervals[index - 1].data
+ })
+ );
+ }
+ intervals[index - 1] = new TimeInterval_default({
+ start: intervals[index - 1].start,
+ stop: interval.start,
+ isStartIncluded: intervals[index - 1].isStartIncluded,
+ isStopIncluded: !interval.isStartIncluded,
+ data: intervals[index - 1].data
+ });
+ }
+ if (index < intervals.length && !interval.isStartIncluded && intervals[index].isStartIncluded && interval.start.equals(intervals[index].start)) {
+ result = true;
+ intervals.splice(
+ index,
+ 0,
+ new TimeInterval_default({
+ start: intervals[index].start,
+ stop: intervals[index].start,
+ isStartIncluded: true,
+ isStopIncluded: true,
+ data: intervals[index].data
+ })
+ );
+ ++index;
+ }
+ while (index < intervals.length && JulianDate_default.greaterThan(interval.stop, intervals[index].stop)) {
+ result = true;
+ intervals.splice(index, 1);
+ }
+ if (index < intervals.length && interval.stop.equals(intervals[index].stop)) {
+ result = true;
+ if (!interval.isStopIncluded && intervals[index].isStopIncluded) {
+ if (index + 1 < intervals.length && intervals[index + 1].start.equals(interval.stop) && intervals[index].data === intervals[index + 1].data) {
+ intervals.splice(index, 1);
+ intervals[index] = new TimeInterval_default({
+ start: intervals[index].start,
+ stop: intervals[index].stop,
+ isStartIncluded: true,
+ isStopIncluded: intervals[index].isStopIncluded,
+ data: intervals[index].data
+ });
+ } else {
+ intervals[index] = new TimeInterval_default({
+ start: interval.stop,
+ stop: interval.stop,
+ isStartIncluded: true,
+ isStopIncluded: true,
+ data: intervals[index].data
+ });
+ }
+ } else {
+ intervals.splice(index, 1);
+ }
+ }
+ if (index < intervals.length && (JulianDate_default.greaterThan(interval.stop, intervals[index].start) || interval.stop.equals(intervals[index].start) && interval.isStopIncluded && intervals[index].isStartIncluded)) {
+ result = true;
+ intervals[index] = new TimeInterval_default({
+ start: interval.stop,
+ stop: intervals[index].stop,
+ isStartIncluded: !interval.isStopIncluded,
+ isStopIncluded: intervals[index].isStopIncluded,
+ data: intervals[index].data
+ });
+ }
+ if (result) {
+ this._changedEvent.raiseEvent(this);
+ }
+ return result;
+};
+TimeIntervalCollection.prototype.intersect = function(other, dataComparer, mergeCallback) {
+ if (!defined_default(other)) {
+ throw new DeveloperError_default("other is required.");
+ }
+ const result = new TimeIntervalCollection();
+ let left = 0;
+ let right = 0;
+ const intervals = this._intervals;
+ const otherIntervals = other._intervals;
+ while (left < intervals.length && right < otherIntervals.length) {
+ const leftInterval = intervals[left];
+ const rightInterval = otherIntervals[right];
+ if (JulianDate_default.lessThan(leftInterval.stop, rightInterval.start)) {
+ ++left;
+ } else if (JulianDate_default.lessThan(rightInterval.stop, leftInterval.start)) {
+ ++right;
+ } else {
+ if (defined_default(mergeCallback) || defined_default(dataComparer) && dataComparer(leftInterval.data, rightInterval.data) || !defined_default(dataComparer) && rightInterval.data === leftInterval.data) {
+ const intersection = TimeInterval_default.intersect(
+ leftInterval,
+ rightInterval,
+ new TimeInterval_default(),
+ mergeCallback
+ );
+ if (!intersection.isEmpty) {
+ result.addInterval(intersection, dataComparer);
+ }
+ }
+ if (JulianDate_default.lessThan(leftInterval.stop, rightInterval.stop) || leftInterval.stop.equals(rightInterval.stop) && !leftInterval.isStopIncluded && rightInterval.isStopIncluded) {
+ ++left;
+ } else {
+ ++right;
+ }
+ }
+ }
+ return result;
+};
+TimeIntervalCollection.fromJulianDateArray = function(options, result) {
+ if (!defined_default(options)) {
+ throw new DeveloperError_default("options is required.");
+ }
+ if (!defined_default(options.julianDates)) {
+ throw new DeveloperError_default("options.iso8601Array is required.");
+ }
+ if (!defined_default(result)) {
+ result = new TimeIntervalCollection();
+ }
+ const julianDates = options.julianDates;
+ const length3 = julianDates.length;
+ const dataCallback = options.dataCallback;
+ const isStartIncluded = defaultValue_default(options.isStartIncluded, true);
+ const isStopIncluded = defaultValue_default(options.isStopIncluded, true);
+ const leadingInterval = defaultValue_default(options.leadingInterval, false);
+ const trailingInterval = defaultValue_default(options.trailingInterval, false);
+ let interval;
+ let startIndex = 0;
+ if (leadingInterval) {
+ ++startIndex;
+ interval = new TimeInterval_default({
+ start: Iso8601_default.MINIMUM_VALUE,
+ stop: julianDates[0],
+ isStartIncluded: true,
+ isStopIncluded: !isStartIncluded
+ });
+ interval.data = defined_default(dataCallback) ? dataCallback(interval, result.length) : result.length;
+ result.addInterval(interval);
+ }
+ for (let i = 0; i < length3 - 1; ++i) {
+ let startDate = julianDates[i];
+ const endDate = julianDates[i + 1];
+ interval = new TimeInterval_default({
+ start: startDate,
+ stop: endDate,
+ isStartIncluded: result.length === startIndex ? isStartIncluded : true,
+ isStopIncluded: i === length3 - 2 ? isStopIncluded : false
+ });
+ interval.data = defined_default(dataCallback) ? dataCallback(interval, result.length) : result.length;
+ result.addInterval(interval);
+ startDate = endDate;
+ }
+ if (trailingInterval) {
+ interval = new TimeInterval_default({
+ start: julianDates[length3 - 1],
+ stop: Iso8601_default.MAXIMUM_VALUE,
+ isStartIncluded: !isStopIncluded,
+ isStopIncluded: true
+ });
+ interval.data = defined_default(dataCallback) ? dataCallback(interval, result.length) : result.length;
+ result.addInterval(interval);
+ }
+ return result;
+};
+var scratchGregorianDate = new GregorianDate_default();
+var monthLengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
+function addToDate(julianDate, duration, result) {
+ if (!defined_default(result)) {
+ result = new JulianDate_default();
+ }
+ JulianDate_default.toGregorianDate(julianDate, scratchGregorianDate);
+ let millisecond = scratchGregorianDate.millisecond + duration.millisecond;
+ let second = scratchGregorianDate.second + duration.second;
+ let minute = scratchGregorianDate.minute + duration.minute;
+ let hour = scratchGregorianDate.hour + duration.hour;
+ let day = scratchGregorianDate.day + duration.day;
+ let month = scratchGregorianDate.month + duration.month;
+ let year = scratchGregorianDate.year + duration.year;
+ if (millisecond >= 1e3) {
+ second += Math.floor(millisecond / 1e3);
+ millisecond = millisecond % 1e3;
+ }
+ if (second >= 60) {
+ minute += Math.floor(second / 60);
+ second = second % 60;
+ }
+ if (minute >= 60) {
+ hour += Math.floor(minute / 60);
+ minute = minute % 60;
+ }
+ if (hour >= 24) {
+ day += Math.floor(hour / 24);
+ hour = hour % 24;
+ }
+ monthLengths[2] = isLeapYear_default(year) ? 29 : 28;
+ while (day > monthLengths[month] || month >= 13) {
+ if (day > monthLengths[month]) {
+ day -= monthLengths[month];
+ ++month;
+ }
+ if (month >= 13) {
+ --month;
+ year += Math.floor(month / 12);
+ month = month % 12;
+ ++month;
+ }
+ monthLengths[2] = isLeapYear_default(year) ? 29 : 28;
+ }
+ scratchGregorianDate.millisecond = millisecond;
+ scratchGregorianDate.second = second;
+ scratchGregorianDate.minute = minute;
+ scratchGregorianDate.hour = hour;
+ scratchGregorianDate.day = day;
+ scratchGregorianDate.month = month;
+ scratchGregorianDate.year = year;
+ return JulianDate_default.fromGregorianDate(scratchGregorianDate, result);
+}
+var scratchJulianDate2 = new JulianDate_default();
+var durationRegex = /P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;
+function parseDuration(iso8601, result) {
+ if (!defined_default(iso8601) || iso8601.length === 0) {
+ return false;
+ }
+ result.year = 0;
+ result.month = 0;
+ result.day = 0;
+ result.hour = 0;
+ result.minute = 0;
+ result.second = 0;
+ result.millisecond = 0;
+ if (iso8601[0] === "P") {
+ const matches = iso8601.match(durationRegex);
+ if (!defined_default(matches)) {
+ return false;
+ }
+ if (defined_default(matches[1])) {
+ result.year = Number(matches[1].replace(",", "."));
+ }
+ if (defined_default(matches[2])) {
+ result.month = Number(matches[2].replace(",", "."));
+ }
+ if (defined_default(matches[3])) {
+ result.day = Number(matches[3].replace(",", ".")) * 7;
+ }
+ if (defined_default(matches[4])) {
+ result.day += Number(matches[4].replace(",", "."));
+ }
+ if (defined_default(matches[5])) {
+ result.hour = Number(matches[5].replace(",", "."));
+ }
+ if (defined_default(matches[6])) {
+ result.minute = Number(matches[6].replace(",", "."));
+ }
+ if (defined_default(matches[7])) {
+ const seconds = Number(matches[7].replace(",", "."));
+ result.second = Math.floor(seconds);
+ result.millisecond = seconds % 1 * 1e3;
+ }
+ } else {
+ if (iso8601[iso8601.length - 1] !== "Z") {
+ iso8601 += "Z";
+ }
+ JulianDate_default.toGregorianDate(
+ JulianDate_default.fromIso8601(iso8601, scratchJulianDate2),
+ result
+ );
+ }
+ return result.year || result.month || result.day || result.hour || result.minute || result.second || result.millisecond;
+}
+var scratchDuration = new GregorianDate_default();
+TimeIntervalCollection.fromIso8601 = function(options, result) {
+ if (!defined_default(options)) {
+ throw new DeveloperError_default("options is required.");
+ }
+ if (!defined_default(options.iso8601)) {
+ throw new DeveloperError_default("options.iso8601 is required.");
+ }
+ const dates = options.iso8601.split("/");
+ const start = JulianDate_default.fromIso8601(dates[0]);
+ const stop2 = JulianDate_default.fromIso8601(dates[1]);
+ const julianDates = [];
+ if (!parseDuration(dates[2], scratchDuration)) {
+ julianDates.push(start, stop2);
+ } else {
+ let date = JulianDate_default.clone(start);
+ julianDates.push(date);
+ while (JulianDate_default.compare(date, stop2) < 0) {
+ date = addToDate(date, scratchDuration);
+ const afterStop = JulianDate_default.compare(stop2, date) <= 0;
+ if (afterStop) {
+ JulianDate_default.clone(stop2, date);
+ }
+ julianDates.push(date);
+ }
+ }
+ return TimeIntervalCollection.fromJulianDateArray(
+ {
+ julianDates,
+ isStartIncluded: options.isStartIncluded,
+ isStopIncluded: options.isStopIncluded,
+ leadingInterval: options.leadingInterval,
+ trailingInterval: options.trailingInterval,
+ dataCallback: options.dataCallback
+ },
+ result
+ );
+};
+TimeIntervalCollection.fromIso8601DateArray = function(options, result) {
+ if (!defined_default(options)) {
+ throw new DeveloperError_default("options is required.");
+ }
+ if (!defined_default(options.iso8601Dates)) {
+ throw new DeveloperError_default("options.iso8601Dates is required.");
+ }
+ return TimeIntervalCollection.fromJulianDateArray(
+ {
+ julianDates: options.iso8601Dates.map(function(date) {
+ return JulianDate_default.fromIso8601(date);
+ }),
+ isStartIncluded: options.isStartIncluded,
+ isStopIncluded: options.isStopIncluded,
+ leadingInterval: options.leadingInterval,
+ trailingInterval: options.trailingInterval,
+ dataCallback: options.dataCallback
+ },
+ result
+ );
+};
+TimeIntervalCollection.fromIso8601DurationArray = function(options, result) {
+ if (!defined_default(options)) {
+ throw new DeveloperError_default("options is required.");
+ }
+ if (!defined_default(options.epoch)) {
+ throw new DeveloperError_default("options.epoch is required.");
+ }
+ if (!defined_default(options.iso8601Durations)) {
+ throw new DeveloperError_default("options.iso8601Durations is required.");
+ }
+ const epoch2 = options.epoch;
+ const iso8601Durations = options.iso8601Durations;
+ const relativeToPrevious = defaultValue_default(options.relativeToPrevious, false);
+ const julianDates = [];
+ let date, previousDate;
+ const length3 = iso8601Durations.length;
+ for (let i = 0; i < length3; ++i) {
+ if (parseDuration(iso8601Durations[i], scratchDuration) || i === 0) {
+ if (relativeToPrevious && defined_default(previousDate)) {
+ date = addToDate(previousDate, scratchDuration);
+ } else {
+ date = addToDate(epoch2, scratchDuration);
+ }
+ julianDates.push(date);
+ previousDate = date;
+ }
+ }
+ return TimeIntervalCollection.fromJulianDateArray(
+ {
+ julianDates,
+ isStartIncluded: options.isStartIncluded,
+ isStopIncluded: options.isStopIncluded,
+ leadingInterval: options.leadingInterval,
+ trailingInterval: options.trailingInterval,
+ dataCallback: options.dataCallback
+ },
+ result
+ );
+};
+var TimeIntervalCollection_default = TimeIntervalCollection;
+
+// Source/DataSources/CompositeProperty.js
+function subscribeAll(property, eventHelper, definitionChanged, intervals) {
+ function callback() {
+ definitionChanged.raiseEvent(property);
+ }
+ const items = [];
+ eventHelper.removeAll();
+ const length3 = intervals.length;
+ for (let i = 0; i < length3; i++) {
+ const interval = intervals.get(i);
+ if (defined_default(interval.data) && items.indexOf(interval.data) === -1) {
+ eventHelper.add(interval.data.definitionChanged, callback);
+ }
+ }
+}
+function CompositeProperty() {
+ this._eventHelper = new EventHelper_default();
+ this._definitionChanged = new Event_default();
+ this._intervals = new TimeIntervalCollection_default();
+ this._intervals.changedEvent.addEventListener(
+ CompositeProperty.prototype._intervalsChanged,
+ this
+ );
+}
+Object.defineProperties(CompositeProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return this._intervals.isEmpty;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ intervals: {
+ get: function() {
+ return this._intervals;
+ }
+ }
+});
+CompositeProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required");
+ }
+ const innerProperty = this._intervals.findDataForIntervalContainingDate(time);
+ if (defined_default(innerProperty)) {
+ return innerProperty.getValue(time, result);
+ }
+ return void 0;
+};
+CompositeProperty.prototype.equals = function(other) {
+ return this === other || other instanceof CompositeProperty && this._intervals.equals(other._intervals, Property_default.equals);
+};
+CompositeProperty.prototype._intervalsChanged = function() {
+ subscribeAll(
+ this,
+ this._eventHelper,
+ this._definitionChanged,
+ this._intervals
+ );
+ this._definitionChanged.raiseEvent(this);
+};
+var CompositeProperty_default = CompositeProperty;
+
+// Source/DataSources/CompositeMaterialProperty.js
+function CompositeMaterialProperty() {
+ this._definitionChanged = new Event_default();
+ this._composite = new CompositeProperty_default();
+ this._composite.definitionChanged.addEventListener(
+ CompositeMaterialProperty.prototype._raiseDefinitionChanged,
+ this
+ );
+}
+Object.defineProperties(CompositeMaterialProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return this._composite.isConstant;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ intervals: {
+ get: function() {
+ return this._composite._intervals;
+ }
+ }
+});
+CompositeMaterialProperty.prototype.getType = function(time) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required");
+ }
+ const innerProperty = this._composite._intervals.findDataForIntervalContainingDate(
+ time
+ );
+ if (defined_default(innerProperty)) {
+ return innerProperty.getType(time);
+ }
+ return void 0;
+};
+CompositeMaterialProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required");
+ }
+ const innerProperty = this._composite._intervals.findDataForIntervalContainingDate(
+ time
+ );
+ if (defined_default(innerProperty)) {
+ return innerProperty.getValue(time, result);
+ }
+ return void 0;
+};
+CompositeMaterialProperty.prototype.equals = function(other) {
+ return this === other || other instanceof CompositeMaterialProperty && this._composite.equals(other._composite, Property_default.equals);
+};
+CompositeMaterialProperty.prototype._raiseDefinitionChanged = function() {
+ this._definitionChanged.raiseEvent(this);
+};
+var CompositeMaterialProperty_default = CompositeMaterialProperty;
+
+// Source/DataSources/CompositePositionProperty.js
+function CompositePositionProperty(referenceFrame) {
+ this._referenceFrame = defaultValue_default(referenceFrame, ReferenceFrame_default.FIXED);
+ this._definitionChanged = new Event_default();
+ this._composite = new CompositeProperty_default();
+ this._composite.definitionChanged.addEventListener(
+ CompositePositionProperty.prototype._raiseDefinitionChanged,
+ this
+ );
+}
+Object.defineProperties(CompositePositionProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return this._composite.isConstant;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ intervals: {
+ get: function() {
+ return this._composite.intervals;
+ }
+ },
+ referenceFrame: {
+ get: function() {
+ return this._referenceFrame;
+ },
+ set: function(value) {
+ this._referenceFrame = value;
+ }
+ }
+});
+CompositePositionProperty.prototype.getValue = function(time, result) {
+ return this.getValueInReferenceFrame(time, ReferenceFrame_default.FIXED, result);
+};
+CompositePositionProperty.prototype.getValueInReferenceFrame = function(time, referenceFrame, result) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ if (!defined_default(referenceFrame)) {
+ throw new DeveloperError_default("referenceFrame is required.");
+ }
+ const innerProperty = this._composite._intervals.findDataForIntervalContainingDate(
+ time
+ );
+ if (defined_default(innerProperty)) {
+ return innerProperty.getValueInReferenceFrame(time, referenceFrame, result);
+ }
+ return void 0;
+};
+CompositePositionProperty.prototype.equals = function(other) {
+ return this === other || other instanceof CompositePositionProperty && this._referenceFrame === other._referenceFrame && this._composite.equals(other._composite, Property_default.equals);
+};
+CompositePositionProperty.prototype._raiseDefinitionChanged = function() {
+ this._definitionChanged.raiseEvent(this);
+};
+var CompositePositionProperty_default = CompositePositionProperty;
+
+// Source/Core/CornerType.js
+var CornerType = {
+ ROUNDED: 0,
+ MITERED: 1,
+ BEVELED: 2
+};
+var CornerType_default = Object.freeze(CornerType);
+
+// Source/Core/PolylineVolumeGeometryLibrary.js
+var scratch2Array = [new Cartesian3_default(), new Cartesian3_default()];
+var scratchCartesian13 = new Cartesian3_default();
+var scratchCartesian25 = new Cartesian3_default();
+var scratchCartesian36 = new Cartesian3_default();
+var scratchCartesian43 = new Cartesian3_default();
+var scratchCartesian52 = new Cartesian3_default();
+var scratchCartesian62 = new Cartesian3_default();
+var scratchCartesian72 = new Cartesian3_default();
+var scratchCartesian82 = new Cartesian3_default();
+var scratchCartesian92 = new Cartesian3_default();
+var scratch1 = new Cartesian3_default();
+var scratch2 = new Cartesian3_default();
+var PolylineVolumeGeometryLibrary = {};
+var cartographic = new Cartographic_default();
+function scaleToSurface(positions, ellipsoid) {
+ const heights = new Array(positions.length);
+ for (let i = 0; i < positions.length; i++) {
+ const pos = positions[i];
+ cartographic = ellipsoid.cartesianToCartographic(pos, cartographic);
+ heights[i] = cartographic.height;
+ positions[i] = ellipsoid.scaleToGeodeticSurface(pos, pos);
+ }
+ return heights;
+}
+function subdivideHeights2(points, h0, h1, granularity) {
+ const p0 = points[0];
+ const p1 = points[1];
+ const angleBetween = Cartesian3_default.angleBetween(p0, p1);
+ const numPoints = Math.ceil(angleBetween / granularity);
+ const heights = new Array(numPoints);
+ let i;
+ if (h0 === h1) {
+ for (i = 0; i < numPoints; i++) {
+ heights[i] = h0;
+ }
+ heights.push(h1);
+ return heights;
+ }
+ const dHeight = h1 - h0;
+ const heightPerVertex = dHeight / numPoints;
+ for (i = 1; i < numPoints; i++) {
+ const h = h0 + i * heightPerVertex;
+ heights[i] = h;
+ }
+ heights[0] = h0;
+ heights.push(h1);
+ return heights;
+}
+var nextScratch = new Cartesian3_default();
+var prevScratch = new Cartesian3_default();
+function computeRotationAngle(start, end, position, ellipsoid) {
+ const tangentPlane = new EllipsoidTangentPlane_default(position, ellipsoid);
+ const next = tangentPlane.projectPointOntoPlane(
+ Cartesian3_default.add(position, start, nextScratch),
+ nextScratch
+ );
+ const prev = tangentPlane.projectPointOntoPlane(
+ Cartesian3_default.add(position, end, prevScratch),
+ prevScratch
+ );
+ const angle = Cartesian2_default.angleBetween(next, prev);
+ return prev.x * next.y - prev.y * next.x >= 0 ? -angle : angle;
+}
+var negativeX = new Cartesian3_default(-1, 0, 0);
+var transform = new Matrix4_default();
+var translation2 = new Matrix4_default();
+var rotationZ = new Matrix3_default();
+var scaleMatrix = Matrix3_default.IDENTITY.clone();
+var westScratch = new Cartesian3_default();
+var finalPosScratch = new Cartesian4_default();
+var heightCartesian = new Cartesian3_default();
+function addPosition(center, left, shape, finalPositions, ellipsoid, height, xScalar, repeat) {
+ let west = westScratch;
+ let finalPosition = finalPosScratch;
+ transform = Transforms_default.eastNorthUpToFixedFrame(center, ellipsoid, transform);
+ west = Matrix4_default.multiplyByPointAsVector(transform, negativeX, west);
+ west = Cartesian3_default.normalize(west, west);
+ const angle = computeRotationAngle(west, left, center, ellipsoid);
+ rotationZ = Matrix3_default.fromRotationZ(angle, rotationZ);
+ heightCartesian.z = height;
+ transform = Matrix4_default.multiplyTransformation(
+ transform,
+ Matrix4_default.fromRotationTranslation(rotationZ, heightCartesian, translation2),
+ transform
+ );
+ const scale = scaleMatrix;
+ scale[0] = xScalar;
+ for (let j = 0; j < repeat; j++) {
+ for (let i = 0; i < shape.length; i += 3) {
+ finalPosition = Cartesian3_default.fromArray(shape, i, finalPosition);
+ finalPosition = Matrix3_default.multiplyByVector(
+ scale,
+ finalPosition,
+ finalPosition
+ );
+ finalPosition = Matrix4_default.multiplyByPoint(
+ transform,
+ finalPosition,
+ finalPosition
+ );
+ finalPositions.push(finalPosition.x, finalPosition.y, finalPosition.z);
+ }
+ }
+ return finalPositions;
+}
+var centerScratch2 = new Cartesian3_default();
+function addPositions(centers, left, shape, finalPositions, ellipsoid, heights, xScalar) {
+ for (let i = 0; i < centers.length; i += 3) {
+ const center = Cartesian3_default.fromArray(centers, i, centerScratch2);
+ finalPositions = addPosition(
+ center,
+ left,
+ shape,
+ finalPositions,
+ ellipsoid,
+ heights[i / 3],
+ xScalar,
+ 1
+ );
+ }
+ return finalPositions;
+}
+function convertShapeTo3DDuplicate(shape2D, boundingRectangle) {
+ const length3 = shape2D.length;
+ const shape = new Array(length3 * 6);
+ let index = 0;
+ const xOffset = boundingRectangle.x + boundingRectangle.width / 2;
+ const yOffset = boundingRectangle.y + boundingRectangle.height / 2;
+ let point = shape2D[0];
+ shape[index++] = point.x - xOffset;
+ shape[index++] = 0;
+ shape[index++] = point.y - yOffset;
+ for (let i = 1; i < length3; i++) {
+ point = shape2D[i];
+ const x = point.x - xOffset;
+ const z = point.y - yOffset;
+ shape[index++] = x;
+ shape[index++] = 0;
+ shape[index++] = z;
+ shape[index++] = x;
+ shape[index++] = 0;
+ shape[index++] = z;
+ }
+ point = shape2D[0];
+ shape[index++] = point.x - xOffset;
+ shape[index++] = 0;
+ shape[index++] = point.y - yOffset;
+ return shape;
+}
+function convertShapeTo3D(shape2D, boundingRectangle) {
+ const length3 = shape2D.length;
+ const shape = new Array(length3 * 3);
+ let index = 0;
+ const xOffset = boundingRectangle.x + boundingRectangle.width / 2;
+ const yOffset = boundingRectangle.y + boundingRectangle.height / 2;
+ for (let i = 0; i < length3; i++) {
+ shape[index++] = shape2D[i].x - xOffset;
+ shape[index++] = 0;
+ shape[index++] = shape2D[i].y - yOffset;
+ }
+ return shape;
+}
+var quaterion = new Quaternion_default();
+var startPointScratch = new Cartesian3_default();
+var rotMatrix = new Matrix3_default();
+function computeRoundCorner(pivot, startPoint, endPoint, cornerType, leftIsOutside, ellipsoid, finalPositions, shape, height, duplicatePoints) {
+ const angle = Cartesian3_default.angleBetween(
+ Cartesian3_default.subtract(startPoint, pivot, scratch1),
+ Cartesian3_default.subtract(endPoint, pivot, scratch2)
+ );
+ const granularity = cornerType === CornerType_default.BEVELED ? 0 : Math.ceil(angle / Math_default.toRadians(5));
+ let m;
+ if (leftIsOutside) {
+ m = Matrix3_default.fromQuaternion(
+ Quaternion_default.fromAxisAngle(
+ Cartesian3_default.negate(pivot, scratch1),
+ angle / (granularity + 1),
+ quaterion
+ ),
+ rotMatrix
+ );
+ } else {
+ m = Matrix3_default.fromQuaternion(
+ Quaternion_default.fromAxisAngle(pivot, angle / (granularity + 1), quaterion),
+ rotMatrix
+ );
+ }
+ let left;
+ let surfacePoint;
+ startPoint = Cartesian3_default.clone(startPoint, startPointScratch);
+ if (granularity > 0) {
+ const repeat = duplicatePoints ? 2 : 1;
+ for (let i = 0; i < granularity; i++) {
+ startPoint = Matrix3_default.multiplyByVector(m, startPoint, startPoint);
+ left = Cartesian3_default.subtract(startPoint, pivot, scratch1);
+ left = Cartesian3_default.normalize(left, left);
+ if (!leftIsOutside) {
+ left = Cartesian3_default.negate(left, left);
+ }
+ surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);
+ finalPositions = addPosition(
+ surfacePoint,
+ left,
+ shape,
+ finalPositions,
+ ellipsoid,
+ height,
+ 1,
+ repeat
+ );
+ }
+ } else {
+ left = Cartesian3_default.subtract(startPoint, pivot, scratch1);
+ left = Cartesian3_default.normalize(left, left);
+ if (!leftIsOutside) {
+ left = Cartesian3_default.negate(left, left);
+ }
+ surfacePoint = ellipsoid.scaleToGeodeticSurface(startPoint, scratch2);
+ finalPositions = addPosition(
+ surfacePoint,
+ left,
+ shape,
+ finalPositions,
+ ellipsoid,
+ height,
+ 1,
+ 1
+ );
+ endPoint = Cartesian3_default.clone(endPoint, startPointScratch);
+ left = Cartesian3_default.subtract(endPoint, pivot, scratch1);
+ left = Cartesian3_default.normalize(left, left);
+ if (!leftIsOutside) {
+ left = Cartesian3_default.negate(left, left);
+ }
+ surfacePoint = ellipsoid.scaleToGeodeticSurface(endPoint, scratch2);
+ finalPositions = addPosition(
+ surfacePoint,
+ left,
+ shape,
+ finalPositions,
+ ellipsoid,
+ height,
+ 1,
+ 1
+ );
+ }
+ return finalPositions;
+}
+PolylineVolumeGeometryLibrary.removeDuplicatesFromShape = function(shapePositions) {
+ const length3 = shapePositions.length;
+ const cleanedPositions = [];
+ for (let i0 = length3 - 1, i1 = 0; i1 < length3; i0 = i1++) {
+ const v02 = shapePositions[i0];
+ const v13 = shapePositions[i1];
+ if (!Cartesian2_default.equals(v02, v13)) {
+ cleanedPositions.push(v13);
+ }
+ }
+ return cleanedPositions;
+};
+PolylineVolumeGeometryLibrary.angleIsGreaterThanPi = function(forward, backward, position, ellipsoid) {
+ const tangentPlane = new EllipsoidTangentPlane_default(position, ellipsoid);
+ const next = tangentPlane.projectPointOntoPlane(
+ Cartesian3_default.add(position, forward, nextScratch),
+ nextScratch
+ );
+ const prev = tangentPlane.projectPointOntoPlane(
+ Cartesian3_default.add(position, backward, prevScratch),
+ prevScratch
+ );
+ return prev.x * next.y - prev.y * next.x >= 0;
+};
+var scratchForwardProjection = new Cartesian3_default();
+var scratchBackwardProjection = new Cartesian3_default();
+PolylineVolumeGeometryLibrary.computePositions = function(positions, shape2D, boundingRectangle, geometry, duplicatePoints) {
+ const ellipsoid = geometry._ellipsoid;
+ const heights = scaleToSurface(positions, ellipsoid);
+ const granularity = geometry._granularity;
+ const cornerType = geometry._cornerType;
+ const shapeForSides = duplicatePoints ? convertShapeTo3DDuplicate(shape2D, boundingRectangle) : convertShapeTo3D(shape2D, boundingRectangle);
+ const shapeForEnds = duplicatePoints ? convertShapeTo3D(shape2D, boundingRectangle) : void 0;
+ const heightOffset = boundingRectangle.height / 2;
+ const width = boundingRectangle.width / 2;
+ let length3 = positions.length;
+ let finalPositions = [];
+ let ends = duplicatePoints ? [] : void 0;
+ let forward = scratchCartesian13;
+ let backward = scratchCartesian25;
+ let cornerDirection = scratchCartesian36;
+ let surfaceNormal = scratchCartesian43;
+ let pivot = scratchCartesian52;
+ let start = scratchCartesian62;
+ let end = scratchCartesian72;
+ let left = scratchCartesian82;
+ let previousPosition = scratchCartesian92;
+ let position = positions[0];
+ let nextPosition = positions[1];
+ surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);
+ forward = Cartesian3_default.subtract(nextPosition, position, forward);
+ forward = Cartesian3_default.normalize(forward, forward);
+ left = Cartesian3_default.cross(surfaceNormal, forward, left);
+ left = Cartesian3_default.normalize(left, left);
+ let h0 = heights[0];
+ let h1 = heights[1];
+ if (duplicatePoints) {
+ ends = addPosition(
+ position,
+ left,
+ shapeForEnds,
+ ends,
+ ellipsoid,
+ h0 + heightOffset,
+ 1,
+ 1
+ );
+ }
+ previousPosition = Cartesian3_default.clone(position, previousPosition);
+ position = nextPosition;
+ backward = Cartesian3_default.negate(forward, backward);
+ let subdividedHeights;
+ let subdividedPositions;
+ for (let i = 1; i < length3 - 1; i++) {
+ const repeat = duplicatePoints ? 2 : 1;
+ nextPosition = positions[i + 1];
+ if (position.equals(nextPosition)) {
+ oneTimeWarning_default(
+ "Positions are too close and are considered equivalent with rounding error."
+ );
+ continue;
+ }
+ forward = Cartesian3_default.subtract(nextPosition, position, forward);
+ forward = Cartesian3_default.normalize(forward, forward);
+ cornerDirection = Cartesian3_default.add(forward, backward, cornerDirection);
+ cornerDirection = Cartesian3_default.normalize(cornerDirection, cornerDirection);
+ surfaceNormal = ellipsoid.geodeticSurfaceNormal(position, surfaceNormal);
+ const forwardProjection = Cartesian3_default.multiplyByScalar(
+ surfaceNormal,
+ Cartesian3_default.dot(forward, surfaceNormal),
+ scratchForwardProjection
+ );
+ Cartesian3_default.subtract(forward, forwardProjection, forwardProjection);
+ Cartesian3_default.normalize(forwardProjection, forwardProjection);
+ const backwardProjection = Cartesian3_default.multiplyByScalar(
+ surfaceNormal,
+ Cartesian3_default.dot(backward, surfaceNormal),
+ scratchBackwardProjection
+ );
+ Cartesian3_default.subtract(backward, backwardProjection, backwardProjection);
+ Cartesian3_default.normalize(backwardProjection, backwardProjection);
+ const doCorner = !Math_default.equalsEpsilon(
+ Math.abs(Cartesian3_default.dot(forwardProjection, backwardProjection)),
+ 1,
+ Math_default.EPSILON7
+ );
+ if (doCorner) {
+ cornerDirection = Cartesian3_default.cross(
+ cornerDirection,
+ surfaceNormal,
+ cornerDirection
+ );
+ cornerDirection = Cartesian3_default.cross(
+ surfaceNormal,
+ cornerDirection,
+ cornerDirection
+ );
+ cornerDirection = Cartesian3_default.normalize(cornerDirection, cornerDirection);
+ const scalar = 1 / Math.max(
+ 0.25,
+ Cartesian3_default.magnitude(
+ Cartesian3_default.cross(cornerDirection, backward, scratch1)
+ )
+ );
+ const leftIsOutside = PolylineVolumeGeometryLibrary.angleIsGreaterThanPi(
+ forward,
+ backward,
+ position,
+ ellipsoid
+ );
+ if (leftIsOutside) {
+ pivot = Cartesian3_default.add(
+ position,
+ Cartesian3_default.multiplyByScalar(
+ cornerDirection,
+ scalar * width,
+ cornerDirection
+ ),
+ pivot
+ );
+ start = Cartesian3_default.add(
+ pivot,
+ Cartesian3_default.multiplyByScalar(left, width, start),
+ start
+ );
+ scratch2Array[0] = Cartesian3_default.clone(previousPosition, scratch2Array[0]);
+ scratch2Array[1] = Cartesian3_default.clone(start, scratch2Array[1]);
+ subdividedHeights = subdivideHeights2(
+ scratch2Array,
+ h0 + heightOffset,
+ h1 + heightOffset,
+ granularity
+ );
+ subdividedPositions = PolylinePipeline_default.generateArc({
+ positions: scratch2Array,
+ granularity,
+ ellipsoid
+ });
+ finalPositions = addPositions(
+ subdividedPositions,
+ left,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ subdividedHeights,
+ 1
+ );
+ left = Cartesian3_default.cross(surfaceNormal, forward, left);
+ left = Cartesian3_default.normalize(left, left);
+ end = Cartesian3_default.add(
+ pivot,
+ Cartesian3_default.multiplyByScalar(left, width, end),
+ end
+ );
+ if (cornerType === CornerType_default.ROUNDED || cornerType === CornerType_default.BEVELED) {
+ computeRoundCorner(
+ pivot,
+ start,
+ end,
+ cornerType,
+ leftIsOutside,
+ ellipsoid,
+ finalPositions,
+ shapeForSides,
+ h1 + heightOffset,
+ duplicatePoints
+ );
+ } else {
+ cornerDirection = Cartesian3_default.negate(cornerDirection, cornerDirection);
+ finalPositions = addPosition(
+ position,
+ cornerDirection,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ h1 + heightOffset,
+ scalar,
+ repeat
+ );
+ }
+ previousPosition = Cartesian3_default.clone(end, previousPosition);
+ } else {
+ pivot = Cartesian3_default.add(
+ position,
+ Cartesian3_default.multiplyByScalar(
+ cornerDirection,
+ scalar * width,
+ cornerDirection
+ ),
+ pivot
+ );
+ start = Cartesian3_default.add(
+ pivot,
+ Cartesian3_default.multiplyByScalar(left, -width, start),
+ start
+ );
+ scratch2Array[0] = Cartesian3_default.clone(previousPosition, scratch2Array[0]);
+ scratch2Array[1] = Cartesian3_default.clone(start, scratch2Array[1]);
+ subdividedHeights = subdivideHeights2(
+ scratch2Array,
+ h0 + heightOffset,
+ h1 + heightOffset,
+ granularity
+ );
+ subdividedPositions = PolylinePipeline_default.generateArc({
+ positions: scratch2Array,
+ granularity,
+ ellipsoid
+ });
+ finalPositions = addPositions(
+ subdividedPositions,
+ left,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ subdividedHeights,
+ 1
+ );
+ left = Cartesian3_default.cross(surfaceNormal, forward, left);
+ left = Cartesian3_default.normalize(left, left);
+ end = Cartesian3_default.add(
+ pivot,
+ Cartesian3_default.multiplyByScalar(left, -width, end),
+ end
+ );
+ if (cornerType === CornerType_default.ROUNDED || cornerType === CornerType_default.BEVELED) {
+ computeRoundCorner(
+ pivot,
+ start,
+ end,
+ cornerType,
+ leftIsOutside,
+ ellipsoid,
+ finalPositions,
+ shapeForSides,
+ h1 + heightOffset,
+ duplicatePoints
+ );
+ } else {
+ finalPositions = addPosition(
+ position,
+ cornerDirection,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ h1 + heightOffset,
+ scalar,
+ repeat
+ );
+ }
+ previousPosition = Cartesian3_default.clone(end, previousPosition);
+ }
+ backward = Cartesian3_default.negate(forward, backward);
+ } else {
+ finalPositions = addPosition(
+ previousPosition,
+ left,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ h0 + heightOffset,
+ 1,
+ 1
+ );
+ previousPosition = position;
+ }
+ h0 = h1;
+ h1 = heights[i + 1];
+ position = nextPosition;
+ }
+ scratch2Array[0] = Cartesian3_default.clone(previousPosition, scratch2Array[0]);
+ scratch2Array[1] = Cartesian3_default.clone(position, scratch2Array[1]);
+ subdividedHeights = subdivideHeights2(
+ scratch2Array,
+ h0 + heightOffset,
+ h1 + heightOffset,
+ granularity
+ );
+ subdividedPositions = PolylinePipeline_default.generateArc({
+ positions: scratch2Array,
+ granularity,
+ ellipsoid
+ });
+ finalPositions = addPositions(
+ subdividedPositions,
+ left,
+ shapeForSides,
+ finalPositions,
+ ellipsoid,
+ subdividedHeights,
+ 1
+ );
+ if (duplicatePoints) {
+ ends = addPosition(
+ position,
+ left,
+ shapeForEnds,
+ ends,
+ ellipsoid,
+ h1 + heightOffset,
+ 1,
+ 1
+ );
+ }
+ length3 = finalPositions.length;
+ const posLength = duplicatePoints ? length3 + ends.length : length3;
+ const combinedPositions = new Float64Array(posLength);
+ combinedPositions.set(finalPositions);
+ if (duplicatePoints) {
+ combinedPositions.set(ends, length3);
+ }
+ return combinedPositions;
+};
+var PolylineVolumeGeometryLibrary_default = PolylineVolumeGeometryLibrary;
+
+// Source/Core/CorridorGeometryLibrary.js
+var CorridorGeometryLibrary = {};
+var scratch12 = new Cartesian3_default();
+var scratch22 = new Cartesian3_default();
+var scratch3 = new Cartesian3_default();
+var scratch4 = new Cartesian3_default();
+var scaleArray2 = [new Cartesian3_default(), new Cartesian3_default()];
+var cartesian1 = new Cartesian3_default();
+var cartesian2 = new Cartesian3_default();
+var cartesian3 = new Cartesian3_default();
+var cartesian4 = new Cartesian3_default();
+var cartesian5 = new Cartesian3_default();
+var cartesian6 = new Cartesian3_default();
+var cartesian7 = new Cartesian3_default();
+var cartesian8 = new Cartesian3_default();
+var cartesian9 = new Cartesian3_default();
+var cartesian10 = new Cartesian3_default();
+var quaterion2 = new Quaternion_default();
+var rotMatrix2 = new Matrix3_default();
+function computeRoundCorner2(cornerPoint, startPoint, endPoint, cornerType, leftIsOutside) {
+ const angle = Cartesian3_default.angleBetween(
+ Cartesian3_default.subtract(startPoint, cornerPoint, scratch12),
+ Cartesian3_default.subtract(endPoint, cornerPoint, scratch22)
+ );
+ const granularity = cornerType === CornerType_default.BEVELED ? 1 : Math.ceil(angle / Math_default.toRadians(5)) + 1;
+ const size = granularity * 3;
+ const array = new Array(size);
+ array[size - 3] = endPoint.x;
+ array[size - 2] = endPoint.y;
+ array[size - 1] = endPoint.z;
+ let m;
+ if (leftIsOutside) {
+ m = Matrix3_default.fromQuaternion(
+ Quaternion_default.fromAxisAngle(
+ Cartesian3_default.negate(cornerPoint, scratch12),
+ angle / granularity,
+ quaterion2
+ ),
+ rotMatrix2
+ );
+ } else {
+ m = Matrix3_default.fromQuaternion(
+ Quaternion_default.fromAxisAngle(cornerPoint, angle / granularity, quaterion2),
+ rotMatrix2
+ );
+ }
+ let index = 0;
+ startPoint = Cartesian3_default.clone(startPoint, scratch12);
+ for (let i = 0; i < granularity; i++) {
+ startPoint = Matrix3_default.multiplyByVector(m, startPoint, startPoint);
+ array[index++] = startPoint.x;
+ array[index++] = startPoint.y;
+ array[index++] = startPoint.z;
+ }
+ return array;
+}
+function addEndCaps(calculatedPositions) {
+ let cornerPoint = cartesian1;
+ let startPoint = cartesian2;
+ let endPoint = cartesian3;
+ let leftEdge = calculatedPositions[1];
+ startPoint = Cartesian3_default.fromArray(
+ calculatedPositions[1],
+ leftEdge.length - 3,
+ startPoint
+ );
+ endPoint = Cartesian3_default.fromArray(calculatedPositions[0], 0, endPoint);
+ cornerPoint = Cartesian3_default.midpoint(startPoint, endPoint, cornerPoint);
+ const firstEndCap = computeRoundCorner2(
+ cornerPoint,
+ startPoint,
+ endPoint,
+ CornerType_default.ROUNDED,
+ false
+ );
+ const length3 = calculatedPositions.length - 1;
+ const rightEdge = calculatedPositions[length3 - 1];
+ leftEdge = calculatedPositions[length3];
+ startPoint = Cartesian3_default.fromArray(
+ rightEdge,
+ rightEdge.length - 3,
+ startPoint
+ );
+ endPoint = Cartesian3_default.fromArray(leftEdge, 0, endPoint);
+ cornerPoint = Cartesian3_default.midpoint(startPoint, endPoint, cornerPoint);
+ const lastEndCap = computeRoundCorner2(
+ cornerPoint,
+ startPoint,
+ endPoint,
+ CornerType_default.ROUNDED,
+ false
+ );
+ return [firstEndCap, lastEndCap];
+}
+function computeMiteredCorner(position, leftCornerDirection, lastPoint, leftIsOutside) {
+ let cornerPoint = scratch12;
+ if (leftIsOutside) {
+ cornerPoint = Cartesian3_default.add(position, leftCornerDirection, cornerPoint);
+ } else {
+ leftCornerDirection = Cartesian3_default.negate(
+ leftCornerDirection,
+ leftCornerDirection
+ );
+ cornerPoint = Cartesian3_default.add(position, leftCornerDirection, cornerPoint);
+ }
+ return [
+ cornerPoint.x,
+ cornerPoint.y,
+ cornerPoint.z,
+ lastPoint.x,
+ lastPoint.y,
+ lastPoint.z
+ ];
+}
+function addShiftedPositions(positions, left, scalar, calculatedPositions) {
+ const rightPositions = new Array(positions.length);
+ const leftPositions = new Array(positions.length);
+ const scaledLeft = Cartesian3_default.multiplyByScalar(left, scalar, scratch12);
+ const scaledRight = Cartesian3_default.negate(scaledLeft, scratch22);
+ let rightIndex = 0;
+ let leftIndex = positions.length - 1;
+ for (let i = 0; i < positions.length; i += 3) {
+ const pos = Cartesian3_default.fromArray(positions, i, scratch3);
+ const rightPos = Cartesian3_default.add(pos, scaledRight, scratch4);
+ rightPositions[rightIndex++] = rightPos.x;
+ rightPositions[rightIndex++] = rightPos.y;
+ rightPositions[rightIndex++] = rightPos.z;
+ const leftPos = Cartesian3_default.add(pos, scaledLeft, scratch4);
+ leftPositions[leftIndex--] = leftPos.z;
+ leftPositions[leftIndex--] = leftPos.y;
+ leftPositions[leftIndex--] = leftPos.x;
+ }
+ calculatedPositions.push(rightPositions, leftPositions);
+ return calculatedPositions;
+}
+CorridorGeometryLibrary.addAttribute = function(attribute, value, front, back) {
+ const x = value.x;
+ const y = value.y;
+ const z = value.z;
+ if (defined_default(front)) {
+ attribute[front] = x;
+ attribute[front + 1] = y;
+ attribute[front + 2] = z;
+ }
+ if (defined_default(back)) {
+ attribute[back] = z;
+ attribute[back - 1] = y;
+ attribute[back - 2] = x;
+ }
+};
+var scratchForwardProjection2 = new Cartesian3_default();
+var scratchBackwardProjection2 = new Cartesian3_default();
+CorridorGeometryLibrary.computePositions = function(params) {
+ const granularity = params.granularity;
+ const positions = params.positions;
+ const ellipsoid = params.ellipsoid;
+ const width = params.width / 2;
+ const cornerType = params.cornerType;
+ const saveAttributes = params.saveAttributes;
+ let normal2 = cartesian1;
+ let forward = cartesian2;
+ let backward = cartesian3;
+ let left = cartesian4;
+ let cornerDirection = cartesian5;
+ let startPoint = cartesian6;
+ let previousPos = cartesian7;
+ let rightPos = cartesian8;
+ let leftPos = cartesian9;
+ let center = cartesian10;
+ let calculatedPositions = [];
+ const calculatedLefts = saveAttributes ? [] : void 0;
+ const calculatedNormals = saveAttributes ? [] : void 0;
+ let position = positions[0];
+ let nextPosition = positions[1];
+ forward = Cartesian3_default.normalize(
+ Cartesian3_default.subtract(nextPosition, position, forward),
+ forward
+ );
+ normal2 = ellipsoid.geodeticSurfaceNormal(position, normal2);
+ left = Cartesian3_default.normalize(Cartesian3_default.cross(normal2, forward, left), left);
+ if (saveAttributes) {
+ calculatedLefts.push(left.x, left.y, left.z);
+ calculatedNormals.push(normal2.x, normal2.y, normal2.z);
+ }
+ previousPos = Cartesian3_default.clone(position, previousPos);
+ position = nextPosition;
+ backward = Cartesian3_default.negate(forward, backward);
+ let subdividedPositions;
+ const corners = [];
+ let i;
+ const length3 = positions.length;
+ for (i = 1; i < length3 - 1; i++) {
+ normal2 = ellipsoid.geodeticSurfaceNormal(position, normal2);
+ nextPosition = positions[i + 1];
+ forward = Cartesian3_default.normalize(
+ Cartesian3_default.subtract(nextPosition, position, forward),
+ forward
+ );
+ cornerDirection = Cartesian3_default.normalize(
+ Cartesian3_default.add(forward, backward, cornerDirection),
+ cornerDirection
+ );
+ const forwardProjection = Cartesian3_default.multiplyByScalar(
+ normal2,
+ Cartesian3_default.dot(forward, normal2),
+ scratchForwardProjection2
+ );
+ Cartesian3_default.subtract(forward, forwardProjection, forwardProjection);
+ Cartesian3_default.normalize(forwardProjection, forwardProjection);
+ const backwardProjection = Cartesian3_default.multiplyByScalar(
+ normal2,
+ Cartesian3_default.dot(backward, normal2),
+ scratchBackwardProjection2
+ );
+ Cartesian3_default.subtract(backward, backwardProjection, backwardProjection);
+ Cartesian3_default.normalize(backwardProjection, backwardProjection);
+ const doCorner = !Math_default.equalsEpsilon(
+ Math.abs(Cartesian3_default.dot(forwardProjection, backwardProjection)),
+ 1,
+ Math_default.EPSILON7
+ );
+ if (doCorner) {
+ cornerDirection = Cartesian3_default.cross(
+ cornerDirection,
+ normal2,
+ cornerDirection
+ );
+ cornerDirection = Cartesian3_default.cross(
+ normal2,
+ cornerDirection,
+ cornerDirection
+ );
+ cornerDirection = Cartesian3_default.normalize(cornerDirection, cornerDirection);
+ const scalar = width / Math.max(
+ 0.25,
+ Cartesian3_default.magnitude(
+ Cartesian3_default.cross(cornerDirection, backward, scratch12)
+ )
+ );
+ const leftIsOutside = PolylineVolumeGeometryLibrary_default.angleIsGreaterThanPi(
+ forward,
+ backward,
+ position,
+ ellipsoid
+ );
+ cornerDirection = Cartesian3_default.multiplyByScalar(
+ cornerDirection,
+ scalar,
+ cornerDirection
+ );
+ if (leftIsOutside) {
+ rightPos = Cartesian3_default.add(position, cornerDirection, rightPos);
+ center = Cartesian3_default.add(
+ rightPos,
+ Cartesian3_default.multiplyByScalar(left, width, center),
+ center
+ );
+ leftPos = Cartesian3_default.add(
+ rightPos,
+ Cartesian3_default.multiplyByScalar(left, width * 2, leftPos),
+ leftPos
+ );
+ scaleArray2[0] = Cartesian3_default.clone(previousPos, scaleArray2[0]);
+ scaleArray2[1] = Cartesian3_default.clone(center, scaleArray2[1]);
+ subdividedPositions = PolylinePipeline_default.generateArc({
+ positions: scaleArray2,
+ granularity,
+ ellipsoid
+ });
+ calculatedPositions = addShiftedPositions(
+ subdividedPositions,
+ left,
+ width,
+ calculatedPositions
+ );
+ if (saveAttributes) {
+ calculatedLefts.push(left.x, left.y, left.z);
+ calculatedNormals.push(normal2.x, normal2.y, normal2.z);
+ }
+ startPoint = Cartesian3_default.clone(leftPos, startPoint);
+ left = Cartesian3_default.normalize(
+ Cartesian3_default.cross(normal2, forward, left),
+ left
+ );
+ leftPos = Cartesian3_default.add(
+ rightPos,
+ Cartesian3_default.multiplyByScalar(left, width * 2, leftPos),
+ leftPos
+ );
+ previousPos = Cartesian3_default.add(
+ rightPos,
+ Cartesian3_default.multiplyByScalar(left, width, previousPos),
+ previousPos
+ );
+ if (cornerType === CornerType_default.ROUNDED || cornerType === CornerType_default.BEVELED) {
+ corners.push({
+ leftPositions: computeRoundCorner2(
+ rightPos,
+ startPoint,
+ leftPos,
+ cornerType,
+ leftIsOutside
+ )
+ });
+ } else {
+ corners.push({
+ leftPositions: computeMiteredCorner(
+ position,
+ Cartesian3_default.negate(cornerDirection, cornerDirection),
+ leftPos,
+ leftIsOutside
+ )
+ });
+ }
+ } else {
+ leftPos = Cartesian3_default.add(position, cornerDirection, leftPos);
+ center = Cartesian3_default.add(
+ leftPos,
+ Cartesian3_default.negate(
+ Cartesian3_default.multiplyByScalar(left, width, center),
+ center
+ ),
+ center
+ );
+ rightPos = Cartesian3_default.add(
+ leftPos,
+ Cartesian3_default.negate(
+ Cartesian3_default.multiplyByScalar(left, width * 2, rightPos),
+ rightPos
+ ),
+ rightPos
+ );
+ scaleArray2[0] = Cartesian3_default.clone(previousPos, scaleArray2[0]);
+ scaleArray2[1] = Cartesian3_default.clone(center, scaleArray2[1]);
+ subdividedPositions = PolylinePipeline_default.generateArc({
+ positions: scaleArray2,
+ granularity,
+ ellipsoid
+ });
+ calculatedPositions = addShiftedPositions(
+ subdividedPositions,
+ left,
+ width,
+ calculatedPositions
+ );
+ if (saveAttributes) {
+ calculatedLefts.push(left.x, left.y, left.z);
+ calculatedNormals.push(normal2.x, normal2.y, normal2.z);
+ }
+ startPoint = Cartesian3_default.clone(rightPos, startPoint);
+ left = Cartesian3_default.normalize(
+ Cartesian3_default.cross(normal2, forward, left),
+ left
+ );
+ rightPos = Cartesian3_default.add(
+ leftPos,
+ Cartesian3_default.negate(
+ Cartesian3_default.multiplyByScalar(left, width * 2, rightPos),
+ rightPos
+ ),
+ rightPos
+ );
+ previousPos = Cartesian3_default.add(
+ leftPos,
+ Cartesian3_default.negate(
+ Cartesian3_default.multiplyByScalar(left, width, previousPos),
+ previousPos
+ ),
+ previousPos
+ );
+ if (cornerType === CornerType_default.ROUNDED || cornerType === CornerType_default.BEVELED) {
+ corners.push({
+ rightPositions: computeRoundCorner2(
+ leftPos,
+ startPoint,
+ rightPos,
+ cornerType,
+ leftIsOutside
+ )
+ });
+ } else {
+ corners.push({
+ rightPositions: computeMiteredCorner(
+ position,
+ cornerDirection,
+ rightPos,
+ leftIsOutside
+ )
+ });
+ }
+ }
+ backward = Cartesian3_default.negate(forward, backward);
+ }
+ position = nextPosition;
+ }
+ normal2 = ellipsoid.geodeticSurfaceNormal(position, normal2);
+ scaleArray2[0] = Cartesian3_default.clone(previousPos, scaleArray2[0]);
+ scaleArray2[1] = Cartesian3_default.clone(position, scaleArray2[1]);
+ subdividedPositions = PolylinePipeline_default.generateArc({
+ positions: scaleArray2,
+ granularity,
+ ellipsoid
+ });
+ calculatedPositions = addShiftedPositions(
+ subdividedPositions,
+ left,
+ width,
+ calculatedPositions
+ );
+ if (saveAttributes) {
+ calculatedLefts.push(left.x, left.y, left.z);
+ calculatedNormals.push(normal2.x, normal2.y, normal2.z);
+ }
+ let endPositions;
+ if (cornerType === CornerType_default.ROUNDED) {
+ endPositions = addEndCaps(calculatedPositions);
+ }
+ return {
+ positions: calculatedPositions,
+ corners,
+ lefts: calculatedLefts,
+ normals: calculatedNormals,
+ endPositions
+ };
+};
+var CorridorGeometryLibrary_default = CorridorGeometryLibrary;
+
+// Source/Core/CorridorGeometry.js
+var cartesian12 = new Cartesian3_default();
+var cartesian22 = new Cartesian3_default();
+var cartesian32 = new Cartesian3_default();
+var cartesian42 = new Cartesian3_default();
+var cartesian52 = new Cartesian3_default();
+var cartesian62 = new Cartesian3_default();
+var scratch13 = new Cartesian3_default();
+var scratch23 = new Cartesian3_default();
+function scaleToSurface2(positions, ellipsoid) {
+ for (let i = 0; i < positions.length; i++) {
+ positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
+ }
+ return positions;
+}
+function addNormals(attr, normal2, left, front, back, vertexFormat) {
+ const normals = attr.normals;
+ const tangents = attr.tangents;
+ const bitangents = attr.bitangents;
+ const forward = Cartesian3_default.normalize(
+ Cartesian3_default.cross(left, normal2, scratch13),
+ scratch13
+ );
+ if (vertexFormat.normal) {
+ CorridorGeometryLibrary_default.addAttribute(normals, normal2, front, back);
+ }
+ if (vertexFormat.tangent) {
+ CorridorGeometryLibrary_default.addAttribute(tangents, forward, front, back);
+ }
+ if (vertexFormat.bitangent) {
+ CorridorGeometryLibrary_default.addAttribute(bitangents, left, front, back);
+ }
+}
+function combine2(computedPositions, vertexFormat, ellipsoid) {
+ const positions = computedPositions.positions;
+ const corners = computedPositions.corners;
+ const endPositions = computedPositions.endPositions;
+ const computedLefts = computedPositions.lefts;
+ const computedNormals = computedPositions.normals;
+ const attributes = new GeometryAttributes_default();
+ let corner;
+ let leftCount = 0;
+ let rightCount = 0;
+ let i;
+ let indicesLength = 0;
+ let length3;
+ for (i = 0; i < positions.length; i += 2) {
+ length3 = positions[i].length - 3;
+ leftCount += length3;
+ indicesLength += length3 * 2;
+ rightCount += positions[i + 1].length - 3;
+ }
+ leftCount += 3;
+ rightCount += 3;
+ for (i = 0; i < corners.length; i++) {
+ corner = corners[i];
+ const leftSide = corners[i].leftPositions;
+ if (defined_default(leftSide)) {
+ length3 = leftSide.length;
+ leftCount += length3;
+ indicesLength += length3;
+ } else {
+ length3 = corners[i].rightPositions.length;
+ rightCount += length3;
+ indicesLength += length3;
+ }
+ }
+ const addEndPositions = defined_default(endPositions);
+ let endPositionLength;
+ if (addEndPositions) {
+ endPositionLength = endPositions[0].length - 3;
+ leftCount += endPositionLength;
+ rightCount += endPositionLength;
+ endPositionLength /= 3;
+ indicesLength += endPositionLength * 6;
+ }
+ const size = leftCount + rightCount;
+ const finalPositions = new Float64Array(size);
+ const normals = vertexFormat.normal ? new Float32Array(size) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(size) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(size) : void 0;
+ const attr = {
+ normals,
+ tangents,
+ bitangents
+ };
+ let front = 0;
+ let back = size - 1;
+ let UL, LL, UR, LR;
+ let normal2 = cartesian12;
+ let left = cartesian22;
+ let rightPos, leftPos;
+ const halfLength = endPositionLength / 2;
+ const indices2 = IndexDatatype_default.createTypedArray(size / 3, indicesLength);
+ let index = 0;
+ if (addEndPositions) {
+ leftPos = cartesian32;
+ rightPos = cartesian42;
+ const firstEndPositions = endPositions[0];
+ normal2 = Cartesian3_default.fromArray(computedNormals, 0, normal2);
+ left = Cartesian3_default.fromArray(computedLefts, 0, left);
+ for (i = 0; i < halfLength; i++) {
+ leftPos = Cartesian3_default.fromArray(
+ firstEndPositions,
+ (halfLength - 1 - i) * 3,
+ leftPos
+ );
+ rightPos = Cartesian3_default.fromArray(
+ firstEndPositions,
+ (halfLength + i) * 3,
+ rightPos
+ );
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
+ CorridorGeometryLibrary_default.addAttribute(
+ finalPositions,
+ leftPos,
+ void 0,
+ back
+ );
+ addNormals(attr, normal2, left, front, back, vertexFormat);
+ LL = front / 3;
+ LR = LL + 1;
+ UL = (back - 2) / 3;
+ UR = UL - 1;
+ indices2[index++] = UL;
+ indices2[index++] = LL;
+ indices2[index++] = UR;
+ indices2[index++] = UR;
+ indices2[index++] = LL;
+ indices2[index++] = LR;
+ front += 3;
+ back -= 3;
+ }
+ }
+ let posIndex = 0;
+ let compIndex = 0;
+ let rightEdge = positions[posIndex++];
+ let leftEdge = positions[posIndex++];
+ finalPositions.set(rightEdge, front);
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
+ left = Cartesian3_default.fromArray(computedLefts, compIndex, left);
+ let rightNormal;
+ let leftNormal;
+ length3 = leftEdge.length - 3;
+ for (i = 0; i < length3; i += 3) {
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
+ Cartesian3_default.fromArray(rightEdge, i, scratch13),
+ scratch13
+ );
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
+ Cartesian3_default.fromArray(leftEdge, length3 - i, scratch23),
+ scratch23
+ );
+ normal2 = Cartesian3_default.normalize(
+ Cartesian3_default.add(rightNormal, leftNormal, normal2),
+ normal2
+ );
+ addNormals(attr, normal2, left, front, back, vertexFormat);
+ LL = front / 3;
+ LR = LL + 1;
+ UL = (back - 2) / 3;
+ UR = UL - 1;
+ indices2[index++] = UL;
+ indices2[index++] = LL;
+ indices2[index++] = UR;
+ indices2[index++] = UR;
+ indices2[index++] = LL;
+ indices2[index++] = LR;
+ front += 3;
+ back -= 3;
+ }
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
+ Cartesian3_default.fromArray(rightEdge, length3, scratch13),
+ scratch13
+ );
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
+ Cartesian3_default.fromArray(leftEdge, length3, scratch23),
+ scratch23
+ );
+ normal2 = Cartesian3_default.normalize(
+ Cartesian3_default.add(rightNormal, leftNormal, normal2),
+ normal2
+ );
+ compIndex += 3;
+ for (i = 0; i < corners.length; i++) {
+ let j;
+ corner = corners[i];
+ const l = corner.leftPositions;
+ const r = corner.rightPositions;
+ let pivot;
+ let start;
+ let outsidePoint = cartesian62;
+ let previousPoint = cartesian32;
+ let nextPoint = cartesian42;
+ normal2 = Cartesian3_default.fromArray(computedNormals, compIndex, normal2);
+ if (defined_default(l)) {
+ addNormals(attr, normal2, left, void 0, back, vertexFormat);
+ back -= 3;
+ pivot = LR;
+ start = UR;
+ for (j = 0; j < l.length / 3; j++) {
+ outsidePoint = Cartesian3_default.fromArray(l, j * 3, outsidePoint);
+ indices2[index++] = pivot;
+ indices2[index++] = start - j - 1;
+ indices2[index++] = start - j;
+ CorridorGeometryLibrary_default.addAttribute(
+ finalPositions,
+ outsidePoint,
+ void 0,
+ back
+ );
+ previousPoint = Cartesian3_default.fromArray(
+ finalPositions,
+ (start - j - 1) * 3,
+ previousPoint
+ );
+ nextPoint = Cartesian3_default.fromArray(finalPositions, pivot * 3, nextPoint);
+ left = Cartesian3_default.normalize(
+ Cartesian3_default.subtract(previousPoint, nextPoint, left),
+ left
+ );
+ addNormals(attr, normal2, left, void 0, back, vertexFormat);
+ back -= 3;
+ }
+ outsidePoint = Cartesian3_default.fromArray(
+ finalPositions,
+ pivot * 3,
+ outsidePoint
+ );
+ previousPoint = Cartesian3_default.subtract(
+ Cartesian3_default.fromArray(finalPositions, start * 3, previousPoint),
+ outsidePoint,
+ previousPoint
+ );
+ nextPoint = Cartesian3_default.subtract(
+ Cartesian3_default.fromArray(finalPositions, (start - j) * 3, nextPoint),
+ outsidePoint,
+ nextPoint
+ );
+ left = Cartesian3_default.normalize(
+ Cartesian3_default.add(previousPoint, nextPoint, left),
+ left
+ );
+ addNormals(attr, normal2, left, front, void 0, vertexFormat);
+ front += 3;
+ } else {
+ addNormals(attr, normal2, left, front, void 0, vertexFormat);
+ front += 3;
+ pivot = UR;
+ start = LR;
+ for (j = 0; j < r.length / 3; j++) {
+ outsidePoint = Cartesian3_default.fromArray(r, j * 3, outsidePoint);
+ indices2[index++] = pivot;
+ indices2[index++] = start + j;
+ indices2[index++] = start + j + 1;
+ CorridorGeometryLibrary_default.addAttribute(
+ finalPositions,
+ outsidePoint,
+ front
+ );
+ previousPoint = Cartesian3_default.fromArray(
+ finalPositions,
+ pivot * 3,
+ previousPoint
+ );
+ nextPoint = Cartesian3_default.fromArray(
+ finalPositions,
+ (start + j) * 3,
+ nextPoint
+ );
+ left = Cartesian3_default.normalize(
+ Cartesian3_default.subtract(previousPoint, nextPoint, left),
+ left
+ );
+ addNormals(attr, normal2, left, front, void 0, vertexFormat);
+ front += 3;
+ }
+ outsidePoint = Cartesian3_default.fromArray(
+ finalPositions,
+ pivot * 3,
+ outsidePoint
+ );
+ previousPoint = Cartesian3_default.subtract(
+ Cartesian3_default.fromArray(finalPositions, (start + j) * 3, previousPoint),
+ outsidePoint,
+ previousPoint
+ );
+ nextPoint = Cartesian3_default.subtract(
+ Cartesian3_default.fromArray(finalPositions, start * 3, nextPoint),
+ outsidePoint,
+ nextPoint
+ );
+ left = Cartesian3_default.normalize(
+ Cartesian3_default.negate(Cartesian3_default.add(nextPoint, previousPoint, left), left),
+ left
+ );
+ addNormals(attr, normal2, left, void 0, back, vertexFormat);
+ back -= 3;
+ }
+ rightEdge = positions[posIndex++];
+ leftEdge = positions[posIndex++];
+ rightEdge.splice(0, 3);
+ leftEdge.splice(leftEdge.length - 3, 3);
+ finalPositions.set(rightEdge, front);
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
+ length3 = leftEdge.length - 3;
+ compIndex += 3;
+ left = Cartesian3_default.fromArray(computedLefts, compIndex, left);
+ for (j = 0; j < leftEdge.length; j += 3) {
+ rightNormal = ellipsoid.geodeticSurfaceNormal(
+ Cartesian3_default.fromArray(rightEdge, j, scratch13),
+ scratch13
+ );
+ leftNormal = ellipsoid.geodeticSurfaceNormal(
+ Cartesian3_default.fromArray(leftEdge, length3 - j, scratch23),
+ scratch23
+ );
+ normal2 = Cartesian3_default.normalize(
+ Cartesian3_default.add(rightNormal, leftNormal, normal2),
+ normal2
+ );
+ addNormals(attr, normal2, left, front, back, vertexFormat);
+ LR = front / 3;
+ LL = LR - 1;
+ UR = (back - 2) / 3;
+ UL = UR + 1;
+ indices2[index++] = UL;
+ indices2[index++] = LL;
+ indices2[index++] = UR;
+ indices2[index++] = UR;
+ indices2[index++] = LL;
+ indices2[index++] = LR;
+ front += 3;
+ back -= 3;
+ }
+ front -= 3;
+ back += 3;
+ }
+ normal2 = Cartesian3_default.fromArray(
+ computedNormals,
+ computedNormals.length - 3,
+ normal2
+ );
+ addNormals(attr, normal2, left, front, back, vertexFormat);
+ if (addEndPositions) {
+ front += 3;
+ back -= 3;
+ leftPos = cartesian32;
+ rightPos = cartesian42;
+ const lastEndPositions = endPositions[1];
+ for (i = 0; i < halfLength; i++) {
+ leftPos = Cartesian3_default.fromArray(
+ lastEndPositions,
+ (endPositionLength - i - 1) * 3,
+ leftPos
+ );
+ rightPos = Cartesian3_default.fromArray(lastEndPositions, i * 3, rightPos);
+ CorridorGeometryLibrary_default.addAttribute(
+ finalPositions,
+ leftPos,
+ void 0,
+ back
+ );
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
+ addNormals(attr, normal2, left, front, back, vertexFormat);
+ LR = front / 3;
+ LL = LR - 1;
+ UR = (back - 2) / 3;
+ UL = UR + 1;
+ indices2[index++] = UL;
+ indices2[index++] = LL;
+ indices2[index++] = UR;
+ indices2[index++] = UR;
+ indices2[index++] = LL;
+ indices2[index++] = LR;
+ front += 3;
+ back -= 3;
+ }
+ }
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: finalPositions
+ });
+ if (vertexFormat.st) {
+ const st = new Float32Array(size / 3 * 2);
+ let rightSt;
+ let leftSt;
+ let stIndex = 0;
+ if (addEndPositions) {
+ leftCount /= 3;
+ rightCount /= 3;
+ const theta = Math.PI / (endPositionLength + 1);
+ leftSt = 1 / (leftCount - endPositionLength + 1);
+ rightSt = 1 / (rightCount - endPositionLength + 1);
+ let a3;
+ const halfEndPos = endPositionLength / 2;
+ for (i = halfEndPos + 1; i < endPositionLength + 1; i++) {
+ a3 = Math_default.PI_OVER_TWO + theta * i;
+ st[stIndex++] = rightSt * (1 + Math.cos(a3));
+ st[stIndex++] = 0.5 * (1 + Math.sin(a3));
+ }
+ for (i = 1; i < rightCount - endPositionLength + 1; i++) {
+ st[stIndex++] = i * rightSt;
+ st[stIndex++] = 0;
+ }
+ for (i = endPositionLength; i > halfEndPos; i--) {
+ a3 = Math_default.PI_OVER_TWO - i * theta;
+ st[stIndex++] = 1 - rightSt * (1 + Math.cos(a3));
+ st[stIndex++] = 0.5 * (1 + Math.sin(a3));
+ }
+ for (i = halfEndPos; i > 0; i--) {
+ a3 = Math_default.PI_OVER_TWO - theta * i;
+ st[stIndex++] = 1 - leftSt * (1 + Math.cos(a3));
+ st[stIndex++] = 0.5 * (1 + Math.sin(a3));
+ }
+ for (i = leftCount - endPositionLength; i > 0; i--) {
+ st[stIndex++] = i * leftSt;
+ st[stIndex++] = 1;
+ }
+ for (i = 1; i < halfEndPos + 1; i++) {
+ a3 = Math_default.PI_OVER_TWO + theta * i;
+ st[stIndex++] = leftSt * (1 + Math.cos(a3));
+ st[stIndex++] = 0.5 * (1 + Math.sin(a3));
+ }
+ } else {
+ leftCount /= 3;
+ rightCount /= 3;
+ leftSt = 1 / (leftCount - 1);
+ rightSt = 1 / (rightCount - 1);
+ for (i = 0; i < rightCount; i++) {
+ st[stIndex++] = i * rightSt;
+ st[stIndex++] = 0;
+ }
+ for (i = leftCount; i > 0; i--) {
+ st[stIndex++] = (i - 1) * leftSt;
+ st[stIndex++] = 1;
+ }
+ }
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: st
+ });
+ }
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: attr.normals
+ });
+ }
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: attr.tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: attr.bitangents
+ });
+ }
+ return {
+ attributes,
+ indices: indices2
+ };
+}
+function extrudedAttributes(attributes, vertexFormat) {
+ if (!vertexFormat.normal && !vertexFormat.tangent && !vertexFormat.bitangent && !vertexFormat.st) {
+ return attributes;
+ }
+ const positions = attributes.position.values;
+ let topNormals;
+ let topBitangents;
+ if (vertexFormat.normal || vertexFormat.bitangent) {
+ topNormals = attributes.normal.values;
+ topBitangents = attributes.bitangent.values;
+ }
+ const size = attributes.position.values.length / 18;
+ const threeSize = size * 3;
+ const twoSize = size * 2;
+ const sixSize = threeSize * 2;
+ let i;
+ if (vertexFormat.normal || vertexFormat.bitangent || vertexFormat.tangent) {
+ const normals = vertexFormat.normal ? new Float32Array(threeSize * 6) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(threeSize * 6) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(threeSize * 6) : void 0;
+ let topPosition = cartesian12;
+ let bottomPosition = cartesian22;
+ let previousPosition = cartesian32;
+ let normal2 = cartesian42;
+ let tangent = cartesian52;
+ let bitangent = cartesian62;
+ let attrIndex = sixSize;
+ for (i = 0; i < threeSize; i += 3) {
+ const attrIndexOffset = attrIndex + sixSize;
+ topPosition = Cartesian3_default.fromArray(positions, i, topPosition);
+ bottomPosition = Cartesian3_default.fromArray(
+ positions,
+ i + threeSize,
+ bottomPosition
+ );
+ previousPosition = Cartesian3_default.fromArray(
+ positions,
+ (i + 3) % threeSize,
+ previousPosition
+ );
+ bottomPosition = Cartesian3_default.subtract(
+ bottomPosition,
+ topPosition,
+ bottomPosition
+ );
+ previousPosition = Cartesian3_default.subtract(
+ previousPosition,
+ topPosition,
+ previousPosition
+ );
+ normal2 = Cartesian3_default.normalize(
+ Cartesian3_default.cross(bottomPosition, previousPosition, normal2),
+ normal2
+ );
+ if (vertexFormat.normal) {
+ CorridorGeometryLibrary_default.addAttribute(normals, normal2, attrIndexOffset);
+ CorridorGeometryLibrary_default.addAttribute(
+ normals,
+ normal2,
+ attrIndexOffset + 3
+ );
+ CorridorGeometryLibrary_default.addAttribute(normals, normal2, attrIndex);
+ CorridorGeometryLibrary_default.addAttribute(normals, normal2, attrIndex + 3);
+ }
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ bitangent = Cartesian3_default.fromArray(topNormals, i, bitangent);
+ if (vertexFormat.bitangent) {
+ CorridorGeometryLibrary_default.addAttribute(
+ bitangents,
+ bitangent,
+ attrIndexOffset
+ );
+ CorridorGeometryLibrary_default.addAttribute(
+ bitangents,
+ bitangent,
+ attrIndexOffset + 3
+ );
+ CorridorGeometryLibrary_default.addAttribute(
+ bitangents,
+ bitangent,
+ attrIndex
+ );
+ CorridorGeometryLibrary_default.addAttribute(
+ bitangents,
+ bitangent,
+ attrIndex + 3
+ );
+ }
+ if (vertexFormat.tangent) {
+ tangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(bitangent, normal2, tangent),
+ tangent
+ );
+ CorridorGeometryLibrary_default.addAttribute(
+ tangents,
+ tangent,
+ attrIndexOffset
+ );
+ CorridorGeometryLibrary_default.addAttribute(
+ tangents,
+ tangent,
+ attrIndexOffset + 3
+ );
+ CorridorGeometryLibrary_default.addAttribute(tangents, tangent, attrIndex);
+ CorridorGeometryLibrary_default.addAttribute(
+ tangents,
+ tangent,
+ attrIndex + 3
+ );
+ }
+ }
+ attrIndex += 6;
+ }
+ if (vertexFormat.normal) {
+ normals.set(topNormals);
+ for (i = 0; i < threeSize; i += 3) {
+ normals[i + threeSize] = -topNormals[i];
+ normals[i + threeSize + 1] = -topNormals[i + 1];
+ normals[i + threeSize + 2] = -topNormals[i + 2];
+ }
+ attributes.normal.values = normals;
+ } else {
+ attributes.normal = void 0;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents.set(topBitangents);
+ bitangents.set(topBitangents, threeSize);
+ attributes.bitangent.values = bitangents;
+ } else {
+ attributes.bitangent = void 0;
+ }
+ if (vertexFormat.tangent) {
+ const topTangents = attributes.tangent.values;
+ tangents.set(topTangents);
+ tangents.set(topTangents, threeSize);
+ attributes.tangent.values = tangents;
+ }
+ }
+ if (vertexFormat.st) {
+ const topSt = attributes.st.values;
+ const st = new Float32Array(twoSize * 6);
+ st.set(topSt);
+ st.set(topSt, twoSize);
+ let index = twoSize * 2;
+ for (let j = 0; j < 2; j++) {
+ st[index++] = topSt[0];
+ st[index++] = topSt[1];
+ for (i = 2; i < twoSize; i += 2) {
+ const s = topSt[i];
+ const t = topSt[i + 1];
+ st[index++] = s;
+ st[index++] = t;
+ st[index++] = s;
+ st[index++] = t;
+ }
+ st[index++] = topSt[0];
+ st[index++] = topSt[1];
+ }
+ attributes.st.values = st;
+ }
+ return attributes;
+}
+function addWallPositions(positions, index, wallPositions) {
+ wallPositions[index++] = positions[0];
+ wallPositions[index++] = positions[1];
+ wallPositions[index++] = positions[2];
+ for (let i = 3; i < positions.length; i += 3) {
+ const x = positions[i];
+ const y = positions[i + 1];
+ const z = positions[i + 2];
+ wallPositions[index++] = x;
+ wallPositions[index++] = y;
+ wallPositions[index++] = z;
+ wallPositions[index++] = x;
+ wallPositions[index++] = y;
+ wallPositions[index++] = z;
+ }
+ wallPositions[index++] = positions[0];
+ wallPositions[index++] = positions[1];
+ wallPositions[index++] = positions[2];
+ return wallPositions;
+}
+function computePositionsExtruded(params, vertexFormat) {
+ const topVertexFormat = new VertexFormat_default({
+ position: vertexFormat.position,
+ normal: vertexFormat.normal || vertexFormat.bitangent || params.shadowVolume,
+ tangent: vertexFormat.tangent,
+ bitangent: vertexFormat.normal || vertexFormat.bitangent,
+ st: vertexFormat.st
+ });
+ const ellipsoid = params.ellipsoid;
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
+ const attr = combine2(computedPositions, topVertexFormat, ellipsoid);
+ const height = params.height;
+ const extrudedHeight = params.extrudedHeight;
+ let attributes = attr.attributes;
+ const indices2 = attr.indices;
+ let positions = attributes.position.values;
+ let length3 = positions.length;
+ const newPositions = new Float64Array(length3 * 6);
+ let extrudedPositions = new Float64Array(length3);
+ extrudedPositions.set(positions);
+ let wallPositions = new Float64Array(length3 * 4);
+ positions = PolygonPipeline_default.scaleToGeodeticHeight(
+ positions,
+ height,
+ ellipsoid
+ );
+ wallPositions = addWallPositions(positions, 0, wallPositions);
+ extrudedPositions = PolygonPipeline_default.scaleToGeodeticHeight(
+ extrudedPositions,
+ extrudedHeight,
+ ellipsoid
+ );
+ wallPositions = addWallPositions(
+ extrudedPositions,
+ length3 * 2,
+ wallPositions
+ );
+ newPositions.set(positions);
+ newPositions.set(extrudedPositions, length3);
+ newPositions.set(wallPositions, length3 * 2);
+ attributes.position.values = newPositions;
+ attributes = extrudedAttributes(attributes, vertexFormat);
+ let i;
+ const size = length3 / 3;
+ if (params.shadowVolume) {
+ const topNormals = attributes.normal.values;
+ length3 = topNormals.length;
+ let extrudeNormals = new Float32Array(length3 * 6);
+ for (i = 0; i < length3; i++) {
+ topNormals[i] = -topNormals[i];
+ }
+ extrudeNormals.set(topNormals, length3);
+ extrudeNormals = addWallPositions(topNormals, length3 * 4, extrudeNormals);
+ attributes.extrudeDirection = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: extrudeNormals
+ });
+ if (!vertexFormat.normal) {
+ attributes.normal = void 0;
+ }
+ }
+ if (defined_default(params.offsetAttribute)) {
+ let applyOffset = new Uint8Array(size * 6);
+ if (params.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ applyOffset = applyOffset.fill(1, 0, size).fill(1, size * 2, size * 4);
+ } else {
+ const applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ applyOffset = applyOffset.fill(applyOffsetValue);
+ }
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ const iLength = indices2.length;
+ const twoSize = size + size;
+ const newIndices = IndexDatatype_default.createTypedArray(
+ newPositions.length / 3,
+ iLength * 2 + twoSize * 3
+ );
+ newIndices.set(indices2);
+ let index = iLength;
+ for (i = 0; i < iLength; i += 3) {
+ const v02 = indices2[i];
+ const v13 = indices2[i + 1];
+ const v23 = indices2[i + 2];
+ newIndices[index++] = v23 + size;
+ newIndices[index++] = v13 + size;
+ newIndices[index++] = v02 + size;
+ }
+ let UL, LL, UR, LR;
+ for (i = 0; i < twoSize; i += 2) {
+ UL = i + twoSize;
+ LL = UL + twoSize;
+ UR = UL + 1;
+ LR = LL + 1;
+ newIndices[index++] = UL;
+ newIndices[index++] = LL;
+ newIndices[index++] = UR;
+ newIndices[index++] = UR;
+ newIndices[index++] = LL;
+ newIndices[index++] = LR;
+ }
+ return {
+ attributes,
+ indices: newIndices
+ };
+}
+var scratchCartesian14 = new Cartesian3_default();
+var scratchCartesian26 = new Cartesian3_default();
+var scratchCartographic8 = new Cartographic_default();
+function computeOffsetPoints(position1, position2, ellipsoid, halfWidth, min3, max3) {
+ const direction2 = Cartesian3_default.subtract(
+ position2,
+ position1,
+ scratchCartesian14
+ );
+ Cartesian3_default.normalize(direction2, direction2);
+ const normal2 = ellipsoid.geodeticSurfaceNormal(position1, scratchCartesian26);
+ const offsetDirection = Cartesian3_default.cross(
+ direction2,
+ normal2,
+ scratchCartesian14
+ );
+ Cartesian3_default.multiplyByScalar(offsetDirection, halfWidth, offsetDirection);
+ let minLat = min3.latitude;
+ let minLon = min3.longitude;
+ let maxLat = max3.latitude;
+ let maxLon = max3.longitude;
+ Cartesian3_default.add(position1, offsetDirection, scratchCartesian26);
+ ellipsoid.cartesianToCartographic(scratchCartesian26, scratchCartographic8);
+ let lat = scratchCartographic8.latitude;
+ let lon = scratchCartographic8.longitude;
+ minLat = Math.min(minLat, lat);
+ minLon = Math.min(minLon, lon);
+ maxLat = Math.max(maxLat, lat);
+ maxLon = Math.max(maxLon, lon);
+ Cartesian3_default.subtract(position1, offsetDirection, scratchCartesian26);
+ ellipsoid.cartesianToCartographic(scratchCartesian26, scratchCartographic8);
+ lat = scratchCartographic8.latitude;
+ lon = scratchCartographic8.longitude;
+ minLat = Math.min(minLat, lat);
+ minLon = Math.min(minLon, lon);
+ maxLat = Math.max(maxLat, lat);
+ maxLon = Math.max(maxLon, lon);
+ min3.latitude = minLat;
+ min3.longitude = minLon;
+ max3.latitude = maxLat;
+ max3.longitude = maxLon;
+}
+var scratchCartesianOffset = new Cartesian3_default();
+var scratchCartesianEnds = new Cartesian3_default();
+var scratchCartographicMin = new Cartographic_default();
+var scratchCartographicMax = new Cartographic_default();
+function computeRectangle(positions, ellipsoid, width, cornerType, result) {
+ positions = scaleToSurface2(positions, ellipsoid);
+ const cleanPositions = arrayRemoveDuplicates_default(
+ positions,
+ Cartesian3_default.equalsEpsilon
+ );
+ const length3 = cleanPositions.length;
+ if (length3 < 2 || width <= 0) {
+ return new Rectangle_default();
+ }
+ const halfWidth = width * 0.5;
+ scratchCartographicMin.latitude = Number.POSITIVE_INFINITY;
+ scratchCartographicMin.longitude = Number.POSITIVE_INFINITY;
+ scratchCartographicMax.latitude = Number.NEGATIVE_INFINITY;
+ scratchCartographicMax.longitude = Number.NEGATIVE_INFINITY;
+ let lat, lon;
+ if (cornerType === CornerType_default.ROUNDED) {
+ const first = cleanPositions[0];
+ Cartesian3_default.subtract(first, cleanPositions[1], scratchCartesianOffset);
+ Cartesian3_default.normalize(scratchCartesianOffset, scratchCartesianOffset);
+ Cartesian3_default.multiplyByScalar(
+ scratchCartesianOffset,
+ halfWidth,
+ scratchCartesianOffset
+ );
+ Cartesian3_default.add(first, scratchCartesianOffset, scratchCartesianEnds);
+ ellipsoid.cartesianToCartographic(
+ scratchCartesianEnds,
+ scratchCartographic8
+ );
+ lat = scratchCartographic8.latitude;
+ lon = scratchCartographic8.longitude;
+ scratchCartographicMin.latitude = Math.min(
+ scratchCartographicMin.latitude,
+ lat
+ );
+ scratchCartographicMin.longitude = Math.min(
+ scratchCartographicMin.longitude,
+ lon
+ );
+ scratchCartographicMax.latitude = Math.max(
+ scratchCartographicMax.latitude,
+ lat
+ );
+ scratchCartographicMax.longitude = Math.max(
+ scratchCartographicMax.longitude,
+ lon
+ );
+ }
+ for (let i = 0; i < length3 - 1; ++i) {
+ computeOffsetPoints(
+ cleanPositions[i],
+ cleanPositions[i + 1],
+ ellipsoid,
+ halfWidth,
+ scratchCartographicMin,
+ scratchCartographicMax
+ );
+ }
+ const last = cleanPositions[length3 - 1];
+ Cartesian3_default.subtract(last, cleanPositions[length3 - 2], scratchCartesianOffset);
+ Cartesian3_default.normalize(scratchCartesianOffset, scratchCartesianOffset);
+ Cartesian3_default.multiplyByScalar(
+ scratchCartesianOffset,
+ halfWidth,
+ scratchCartesianOffset
+ );
+ Cartesian3_default.add(last, scratchCartesianOffset, scratchCartesianEnds);
+ computeOffsetPoints(
+ last,
+ scratchCartesianEnds,
+ ellipsoid,
+ halfWidth,
+ scratchCartographicMin,
+ scratchCartographicMax
+ );
+ if (cornerType === CornerType_default.ROUNDED) {
+ ellipsoid.cartesianToCartographic(
+ scratchCartesianEnds,
+ scratchCartographic8
+ );
+ lat = scratchCartographic8.latitude;
+ lon = scratchCartographic8.longitude;
+ scratchCartographicMin.latitude = Math.min(
+ scratchCartographicMin.latitude,
+ lat
+ );
+ scratchCartographicMin.longitude = Math.min(
+ scratchCartographicMin.longitude,
+ lon
+ );
+ scratchCartographicMax.latitude = Math.max(
+ scratchCartographicMax.latitude,
+ lat
+ );
+ scratchCartographicMax.longitude = Math.max(
+ scratchCartographicMax.longitude,
+ lon
+ );
+ }
+ const rectangle = defined_default(result) ? result : new Rectangle_default();
+ rectangle.north = scratchCartographicMax.latitude;
+ rectangle.south = scratchCartographicMin.latitude;
+ rectangle.east = scratchCartographicMax.longitude;
+ rectangle.west = scratchCartographicMin.longitude;
+ return rectangle;
+}
+function CorridorGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const positions = options.positions;
+ const width = options.width;
+ Check_default.defined("options.positions", positions);
+ Check_default.defined("options.width", width);
+ const height = defaultValue_default(options.height, 0);
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
+ this._positions = positions;
+ this._ellipsoid = Ellipsoid_default.clone(
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
+ );
+ this._vertexFormat = VertexFormat_default.clone(
+ defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
+ );
+ this._width = width;
+ this._height = Math.max(height, extrudedHeight);
+ this._extrudedHeight = Math.min(height, extrudedHeight);
+ this._cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
+ this._granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ this._shadowVolume = defaultValue_default(options.shadowVolume, false);
+ this._workerName = "createCorridorGeometry";
+ this._offsetAttribute = options.offsetAttribute;
+ this._rectangle = void 0;
+ this.packedLength = 1 + positions.length * Cartesian3_default.packedLength + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 7;
+}
+CorridorGeometry.pack = function(value, array, startingIndex) {
+ Check_default.defined("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const positions = value._positions;
+ const length3 = positions.length;
+ array[startingIndex++] = length3;
+ for (let i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ Cartesian3_default.pack(positions[i], array, startingIndex);
+ }
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat_default.packedLength;
+ array[startingIndex++] = value._width;
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._cornerType;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._shadowVolume ? 1 : 0;
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchEllipsoid2 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchVertexFormat2 = new VertexFormat_default();
+var scratchOptions7 = {
+ positions: void 0,
+ ellipsoid: scratchEllipsoid2,
+ vertexFormat: scratchVertexFormat2,
+ width: void 0,
+ height: void 0,
+ extrudedHeight: void 0,
+ cornerType: void 0,
+ granularity: void 0,
+ shadowVolume: void 0,
+ offsetAttribute: void 0
+};
+CorridorGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const length3 = array[startingIndex++];
+ const positions = new Array(length3);
+ for (let i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
+ }
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid2);
+ startingIndex += Ellipsoid_default.packedLength;
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat2
+ );
+ startingIndex += VertexFormat_default.packedLength;
+ const width = array[startingIndex++];
+ const height = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const cornerType = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const shadowVolume = array[startingIndex++] === 1;
+ const offsetAttribute = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions7.positions = positions;
+ scratchOptions7.width = width;
+ scratchOptions7.height = height;
+ scratchOptions7.extrudedHeight = extrudedHeight;
+ scratchOptions7.cornerType = cornerType;
+ scratchOptions7.granularity = granularity;
+ scratchOptions7.shadowVolume = shadowVolume;
+ scratchOptions7.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new CorridorGeometry(scratchOptions7);
+ }
+ result._positions = positions;
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._width = width;
+ result._height = height;
+ result._extrudedHeight = extrudedHeight;
+ result._cornerType = cornerType;
+ result._granularity = granularity;
+ result._shadowVolume = shadowVolume;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+CorridorGeometry.computeRectangle = function(options, result) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const positions = options.positions;
+ const width = options.width;
+ Check_default.defined("options.positions", positions);
+ Check_default.defined("options.width", width);
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ const cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
+ return computeRectangle(positions, ellipsoid, width, cornerType, result);
+};
+CorridorGeometry.createGeometry = function(corridorGeometry) {
+ let positions = corridorGeometry._positions;
+ const width = corridorGeometry._width;
+ const ellipsoid = corridorGeometry._ellipsoid;
+ positions = scaleToSurface2(positions, ellipsoid);
+ const cleanPositions = arrayRemoveDuplicates_default(
+ positions,
+ Cartesian3_default.equalsEpsilon
+ );
+ if (cleanPositions.length < 2 || width <= 0) {
+ return;
+ }
+ const height = corridorGeometry._height;
+ const extrudedHeight = corridorGeometry._extrudedHeight;
+ const extrude = !Math_default.equalsEpsilon(
+ height,
+ extrudedHeight,
+ 0,
+ Math_default.EPSILON2
+ );
+ const vertexFormat = corridorGeometry._vertexFormat;
+ const params = {
+ ellipsoid,
+ positions: cleanPositions,
+ width,
+ cornerType: corridorGeometry._cornerType,
+ granularity: corridorGeometry._granularity,
+ saveAttributes: true
+ };
+ let attr;
+ if (extrude) {
+ params.height = height;
+ params.extrudedHeight = extrudedHeight;
+ params.shadowVolume = corridorGeometry._shadowVolume;
+ params.offsetAttribute = corridorGeometry._offsetAttribute;
+ attr = computePositionsExtruded(params, vertexFormat);
+ } else {
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
+ attr = combine2(computedPositions, vertexFormat, ellipsoid);
+ attr.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
+ attr.attributes.position.values,
+ height,
+ ellipsoid
+ );
+ if (defined_default(corridorGeometry._offsetAttribute)) {
+ const applyOffsetValue = corridorGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const length3 = attr.attributes.position.values.length;
+ const applyOffset = new Uint8Array(length3 / 3).fill(applyOffsetValue);
+ attr.attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ }
+ const attributes = attr.attributes;
+ const boundingSphere = BoundingSphere_default.fromVertices(
+ attributes.position.values,
+ void 0,
+ 3
+ );
+ if (!vertexFormat.position) {
+ attr.attributes.position.values = void 0;
+ }
+ return new Geometry_default({
+ attributes,
+ indices: attr.indices,
+ primitiveType: PrimitiveType_default.TRIANGLES,
+ boundingSphere,
+ offsetAttribute: corridorGeometry._offsetAttribute
+ });
+};
+CorridorGeometry.createShadowVolume = function(corridorGeometry, minHeightFunc, maxHeightFunc) {
+ const granularity = corridorGeometry._granularity;
+ const ellipsoid = corridorGeometry._ellipsoid;
+ const minHeight = minHeightFunc(granularity, ellipsoid);
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
+ return new CorridorGeometry({
+ positions: corridorGeometry._positions,
+ width: corridorGeometry._width,
+ cornerType: corridorGeometry._cornerType,
+ ellipsoid,
+ granularity,
+ extrudedHeight: minHeight,
+ height: maxHeight,
+ vertexFormat: VertexFormat_default.POSITION_ONLY,
+ shadowVolume: true
+ });
+};
+Object.defineProperties(CorridorGeometry.prototype, {
+ rectangle: {
+ get: function() {
+ if (!defined_default(this._rectangle)) {
+ this._rectangle = computeRectangle(
+ this._positions,
+ this._ellipsoid,
+ this._width,
+ this._cornerType
+ );
+ }
+ return this._rectangle;
+ }
+ },
+ textureCoordinateRotationPoints: {
+ get: function() {
+ return [0, 0, 0, 1, 1, 0];
+ }
+ }
+});
+var CorridorGeometry_default = CorridorGeometry;
+
+// Source/Core/CorridorOutlineGeometry.js
+var cartesian13 = new Cartesian3_default();
+var cartesian23 = new Cartesian3_default();
+var cartesian33 = new Cartesian3_default();
+function scaleToSurface3(positions, ellipsoid) {
+ for (let i = 0; i < positions.length; i++) {
+ positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
+ }
+ return positions;
+}
+function combine3(computedPositions, cornerType) {
+ const wallIndices = [];
+ const positions = computedPositions.positions;
+ const corners = computedPositions.corners;
+ const endPositions = computedPositions.endPositions;
+ const attributes = new GeometryAttributes_default();
+ let corner;
+ let leftCount = 0;
+ let rightCount = 0;
+ let i;
+ let indicesLength = 0;
+ let length3;
+ for (i = 0; i < positions.length; i += 2) {
+ length3 = positions[i].length - 3;
+ leftCount += length3;
+ indicesLength += length3 / 3 * 4;
+ rightCount += positions[i + 1].length - 3;
+ }
+ leftCount += 3;
+ rightCount += 3;
+ for (i = 0; i < corners.length; i++) {
+ corner = corners[i];
+ const leftSide = corners[i].leftPositions;
+ if (defined_default(leftSide)) {
+ length3 = leftSide.length;
+ leftCount += length3;
+ indicesLength += length3 / 3 * 2;
+ } else {
+ length3 = corners[i].rightPositions.length;
+ rightCount += length3;
+ indicesLength += length3 / 3 * 2;
+ }
+ }
+ const addEndPositions = defined_default(endPositions);
+ let endPositionLength;
+ if (addEndPositions) {
+ endPositionLength = endPositions[0].length - 3;
+ leftCount += endPositionLength;
+ rightCount += endPositionLength;
+ endPositionLength /= 3;
+ indicesLength += endPositionLength * 4;
+ }
+ const size = leftCount + rightCount;
+ const finalPositions = new Float64Array(size);
+ let front = 0;
+ let back = size - 1;
+ let UL, LL, UR, LR;
+ let rightPos, leftPos;
+ const halfLength = endPositionLength / 2;
+ const indices2 = IndexDatatype_default.createTypedArray(size / 3, indicesLength + 4);
+ let index = 0;
+ indices2[index++] = front / 3;
+ indices2[index++] = (back - 2) / 3;
+ if (addEndPositions) {
+ wallIndices.push(front / 3);
+ leftPos = cartesian13;
+ rightPos = cartesian23;
+ const firstEndPositions = endPositions[0];
+ for (i = 0; i < halfLength; i++) {
+ leftPos = Cartesian3_default.fromArray(
+ firstEndPositions,
+ (halfLength - 1 - i) * 3,
+ leftPos
+ );
+ rightPos = Cartesian3_default.fromArray(
+ firstEndPositions,
+ (halfLength + i) * 3,
+ rightPos
+ );
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
+ CorridorGeometryLibrary_default.addAttribute(
+ finalPositions,
+ leftPos,
+ void 0,
+ back
+ );
+ LL = front / 3;
+ LR = LL + 1;
+ UL = (back - 2) / 3;
+ UR = UL - 1;
+ indices2[index++] = UL;
+ indices2[index++] = UR;
+ indices2[index++] = LL;
+ indices2[index++] = LR;
+ front += 3;
+ back -= 3;
+ }
+ }
+ let posIndex = 0;
+ let rightEdge = positions[posIndex++];
+ let leftEdge = positions[posIndex++];
+ finalPositions.set(rightEdge, front);
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
+ length3 = leftEdge.length - 3;
+ wallIndices.push(front / 3, (back - 2) / 3);
+ for (i = 0; i < length3; i += 3) {
+ LL = front / 3;
+ LR = LL + 1;
+ UL = (back - 2) / 3;
+ UR = UL - 1;
+ indices2[index++] = UL;
+ indices2[index++] = UR;
+ indices2[index++] = LL;
+ indices2[index++] = LR;
+ front += 3;
+ back -= 3;
+ }
+ for (i = 0; i < corners.length; i++) {
+ let j;
+ corner = corners[i];
+ const l = corner.leftPositions;
+ const r = corner.rightPositions;
+ let start;
+ let outsidePoint = cartesian33;
+ if (defined_default(l)) {
+ back -= 3;
+ start = UR;
+ wallIndices.push(LR);
+ for (j = 0; j < l.length / 3; j++) {
+ outsidePoint = Cartesian3_default.fromArray(l, j * 3, outsidePoint);
+ indices2[index++] = start - j - 1;
+ indices2[index++] = start - j;
+ CorridorGeometryLibrary_default.addAttribute(
+ finalPositions,
+ outsidePoint,
+ void 0,
+ back
+ );
+ back -= 3;
+ }
+ wallIndices.push(start - Math.floor(l.length / 6));
+ if (cornerType === CornerType_default.BEVELED) {
+ wallIndices.push((back - 2) / 3 + 1);
+ }
+ front += 3;
+ } else {
+ front += 3;
+ start = LR;
+ wallIndices.push(UR);
+ for (j = 0; j < r.length / 3; j++) {
+ outsidePoint = Cartesian3_default.fromArray(r, j * 3, outsidePoint);
+ indices2[index++] = start + j;
+ indices2[index++] = start + j + 1;
+ CorridorGeometryLibrary_default.addAttribute(
+ finalPositions,
+ outsidePoint,
+ front
+ );
+ front += 3;
+ }
+ wallIndices.push(start + Math.floor(r.length / 6));
+ if (cornerType === CornerType_default.BEVELED) {
+ wallIndices.push(front / 3 - 1);
+ }
+ back -= 3;
+ }
+ rightEdge = positions[posIndex++];
+ leftEdge = positions[posIndex++];
+ rightEdge.splice(0, 3);
+ leftEdge.splice(leftEdge.length - 3, 3);
+ finalPositions.set(rightEdge, front);
+ finalPositions.set(leftEdge, back - leftEdge.length + 1);
+ length3 = leftEdge.length - 3;
+ for (j = 0; j < leftEdge.length; j += 3) {
+ LR = front / 3;
+ LL = LR - 1;
+ UR = (back - 2) / 3;
+ UL = UR + 1;
+ indices2[index++] = UL;
+ indices2[index++] = UR;
+ indices2[index++] = LL;
+ indices2[index++] = LR;
+ front += 3;
+ back -= 3;
+ }
+ front -= 3;
+ back += 3;
+ wallIndices.push(front / 3, (back - 2) / 3);
+ }
+ if (addEndPositions) {
+ front += 3;
+ back -= 3;
+ leftPos = cartesian13;
+ rightPos = cartesian23;
+ const lastEndPositions = endPositions[1];
+ for (i = 0; i < halfLength; i++) {
+ leftPos = Cartesian3_default.fromArray(
+ lastEndPositions,
+ (endPositionLength - i - 1) * 3,
+ leftPos
+ );
+ rightPos = Cartesian3_default.fromArray(lastEndPositions, i * 3, rightPos);
+ CorridorGeometryLibrary_default.addAttribute(
+ finalPositions,
+ leftPos,
+ void 0,
+ back
+ );
+ CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
+ LR = front / 3;
+ LL = LR - 1;
+ UR = (back - 2) / 3;
+ UL = UR + 1;
+ indices2[index++] = UL;
+ indices2[index++] = UR;
+ indices2[index++] = LL;
+ indices2[index++] = LR;
+ front += 3;
+ back -= 3;
+ }
+ wallIndices.push(front / 3);
+ } else {
+ wallIndices.push(front / 3, (back - 2) / 3);
+ }
+ indices2[index++] = front / 3;
+ indices2[index++] = (back - 2) / 3;
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: finalPositions
+ });
+ return {
+ attributes,
+ indices: indices2,
+ wallIndices
+ };
+}
+function computePositionsExtruded2(params) {
+ const ellipsoid = params.ellipsoid;
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
+ const attr = combine3(computedPositions, params.cornerType);
+ const wallIndices = attr.wallIndices;
+ const height = params.height;
+ const extrudedHeight = params.extrudedHeight;
+ const attributes = attr.attributes;
+ const indices2 = attr.indices;
+ let positions = attributes.position.values;
+ let length3 = positions.length;
+ let extrudedPositions = new Float64Array(length3);
+ extrudedPositions.set(positions);
+ const newPositions = new Float64Array(length3 * 2);
+ positions = PolygonPipeline_default.scaleToGeodeticHeight(
+ positions,
+ height,
+ ellipsoid
+ );
+ extrudedPositions = PolygonPipeline_default.scaleToGeodeticHeight(
+ extrudedPositions,
+ extrudedHeight,
+ ellipsoid
+ );
+ newPositions.set(positions);
+ newPositions.set(extrudedPositions, length3);
+ attributes.position.values = newPositions;
+ length3 /= 3;
+ if (defined_default(params.offsetAttribute)) {
+ let applyOffset = new Uint8Array(length3 * 2);
+ if (params.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ applyOffset = applyOffset.fill(1, 0, length3);
+ } else {
+ const applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ applyOffset = applyOffset.fill(applyOffsetValue);
+ }
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ let i;
+ const iLength = indices2.length;
+ const newIndices = IndexDatatype_default.createTypedArray(
+ newPositions.length / 3,
+ (iLength + wallIndices.length) * 2
+ );
+ newIndices.set(indices2);
+ let index = iLength;
+ for (i = 0; i < iLength; i += 2) {
+ const v02 = indices2[i];
+ const v13 = indices2[i + 1];
+ newIndices[index++] = v02 + length3;
+ newIndices[index++] = v13 + length3;
+ }
+ let UL, LL;
+ for (i = 0; i < wallIndices.length; i++) {
+ UL = wallIndices[i];
+ LL = UL + length3;
+ newIndices[index++] = UL;
+ newIndices[index++] = LL;
+ }
+ return {
+ attributes,
+ indices: newIndices
+ };
+}
+function CorridorOutlineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const positions = options.positions;
+ const width = options.width;
+ Check_default.typeOf.object("options.positions", positions);
+ Check_default.typeOf.number("options.width", width);
+ const height = defaultValue_default(options.height, 0);
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
+ this._positions = positions;
+ this._ellipsoid = Ellipsoid_default.clone(
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
+ );
+ this._width = width;
+ this._height = Math.max(height, extrudedHeight);
+ this._extrudedHeight = Math.min(height, extrudedHeight);
+ this._cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
+ this._granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createCorridorOutlineGeometry";
+ this.packedLength = 1 + positions.length * Cartesian3_default.packedLength + Ellipsoid_default.packedLength + 6;
+}
+CorridorOutlineGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.typeOf.object("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const positions = value._positions;
+ const length3 = positions.length;
+ array[startingIndex++] = length3;
+ for (let i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ Cartesian3_default.pack(positions[i], array, startingIndex);
+ }
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ array[startingIndex++] = value._width;
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._cornerType;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchEllipsoid3 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchOptions8 = {
+ positions: void 0,
+ ellipsoid: scratchEllipsoid3,
+ width: void 0,
+ height: void 0,
+ extrudedHeight: void 0,
+ cornerType: void 0,
+ granularity: void 0,
+ offsetAttribute: void 0
+};
+CorridorOutlineGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.typeOf.object("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const length3 = array[startingIndex++];
+ const positions = new Array(length3);
+ for (let i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
+ }
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid3);
+ startingIndex += Ellipsoid_default.packedLength;
+ const width = array[startingIndex++];
+ const height = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const cornerType = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions8.positions = positions;
+ scratchOptions8.width = width;
+ scratchOptions8.height = height;
+ scratchOptions8.extrudedHeight = extrudedHeight;
+ scratchOptions8.cornerType = cornerType;
+ scratchOptions8.granularity = granularity;
+ scratchOptions8.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new CorridorOutlineGeometry(scratchOptions8);
+ }
+ result._positions = positions;
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._width = width;
+ result._height = height;
+ result._extrudedHeight = extrudedHeight;
+ result._cornerType = cornerType;
+ result._granularity = granularity;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+CorridorOutlineGeometry.createGeometry = function(corridorOutlineGeometry) {
+ let positions = corridorOutlineGeometry._positions;
+ const width = corridorOutlineGeometry._width;
+ const ellipsoid = corridorOutlineGeometry._ellipsoid;
+ positions = scaleToSurface3(positions, ellipsoid);
+ const cleanPositions = arrayRemoveDuplicates_default(
+ positions,
+ Cartesian3_default.equalsEpsilon
+ );
+ if (cleanPositions.length < 2 || width <= 0) {
+ return;
+ }
+ const height = corridorOutlineGeometry._height;
+ const extrudedHeight = corridorOutlineGeometry._extrudedHeight;
+ const extrude = !Math_default.equalsEpsilon(
+ height,
+ extrudedHeight,
+ 0,
+ Math_default.EPSILON2
+ );
+ const params = {
+ ellipsoid,
+ positions: cleanPositions,
+ width,
+ cornerType: corridorOutlineGeometry._cornerType,
+ granularity: corridorOutlineGeometry._granularity,
+ saveAttributes: false
+ };
+ let attr;
+ if (extrude) {
+ params.height = height;
+ params.extrudedHeight = extrudedHeight;
+ params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;
+ attr = computePositionsExtruded2(params);
+ } else {
+ const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
+ attr = combine3(computedPositions, params.cornerType);
+ attr.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
+ attr.attributes.position.values,
+ height,
+ ellipsoid
+ );
+ if (defined_default(corridorOutlineGeometry._offsetAttribute)) {
+ const length3 = attr.attributes.position.values.length;
+ const offsetValue = corridorOutlineGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ attr.attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ }
+ const attributes = attr.attributes;
+ const boundingSphere = BoundingSphere_default.fromVertices(
+ attributes.position.values,
+ void 0,
+ 3
+ );
+ return new Geometry_default({
+ attributes,
+ indices: attr.indices,
+ primitiveType: PrimitiveType_default.LINES,
+ boundingSphere,
+ offsetAttribute: corridorOutlineGeometry._offsetAttribute
+ });
+};
+var CorridorOutlineGeometry_default = CorridorOutlineGeometry;
+
+// Source/DataSources/GroundGeometryUpdater.js
+var defaultZIndex = new ConstantProperty_default(0);
+function GroundGeometryUpdater(options) {
+ GeometryUpdater_default.call(this, options);
+ this._zIndex = 0;
+ this._terrainOffsetProperty = void 0;
+}
+if (defined_default(Object.create)) {
+ GroundGeometryUpdater.prototype = Object.create(GeometryUpdater_default.prototype);
+ GroundGeometryUpdater.prototype.constructor = GroundGeometryUpdater;
+}
+Object.defineProperties(GroundGeometryUpdater.prototype, {
+ zIndex: {
+ get: function() {
+ return this._zIndex;
+ }
+ },
+ terrainOffsetProperty: {
+ get: function() {
+ return this._terrainOffsetProperty;
+ }
+ }
+});
+GroundGeometryUpdater.prototype._isOnTerrain = function(entity, geometry) {
+ return this._fillEnabled && !defined_default(geometry.height) && !defined_default(geometry.extrudedHeight) && GroundPrimitive_default.isSupported(this._scene);
+};
+GroundGeometryUpdater.prototype._getIsClosed = function(options) {
+ const height = options.height;
+ const extrudedHeight = options.extrudedHeight;
+ return height === 0 || defined_default(extrudedHeight) && extrudedHeight !== height;
+};
+GroundGeometryUpdater.prototype._computeCenter = DeveloperError_default.throwInstantiationError;
+GroundGeometryUpdater.prototype._onEntityPropertyChanged = function(entity, propertyName, newValue, oldValue2) {
+ GeometryUpdater_default.prototype._onEntityPropertyChanged.call(
+ this,
+ entity,
+ propertyName,
+ newValue,
+ oldValue2
+ );
+ if (this._observedPropertyNames.indexOf(propertyName) === -1) {
+ return;
+ }
+ const geometry = this._entity[this._geometryPropertyName];
+ if (!defined_default(geometry)) {
+ return;
+ }
+ if (defined_default(geometry.zIndex) && (defined_default(geometry.height) || defined_default(geometry.extrudedHeight))) {
+ oneTimeWarning_default(oneTimeWarning_default.geometryZIndex);
+ }
+ this._zIndex = defaultValue_default(geometry.zIndex, defaultZIndex);
+ if (defined_default(this._terrainOffsetProperty)) {
+ this._terrainOffsetProperty.destroy();
+ this._terrainOffsetProperty = void 0;
+ }
+ const heightReferenceProperty = geometry.heightReference;
+ const extrudedHeightReferenceProperty = geometry.extrudedHeightReference;
+ if (defined_default(heightReferenceProperty) || defined_default(extrudedHeightReferenceProperty)) {
+ const centerPosition = new CallbackProperty_default(
+ this._computeCenter.bind(this),
+ !this._dynamic
+ );
+ this._terrainOffsetProperty = new TerrainOffsetProperty_default(
+ this._scene,
+ centerPosition,
+ heightReferenceProperty,
+ extrudedHeightReferenceProperty
+ );
+ }
+};
+GroundGeometryUpdater.prototype.destroy = function() {
+ if (defined_default(this._terrainOffsetProperty)) {
+ this._terrainOffsetProperty.destroy();
+ this._terrainOffsetProperty = void 0;
+ }
+ GeometryUpdater_default.prototype.destroy.call(this);
+};
+GroundGeometryUpdater.getGeometryHeight = function(height, heightReference) {
+ Check_default.defined("heightReference", heightReference);
+ if (!defined_default(height)) {
+ if (heightReference !== HeightReference_default.NONE) {
+ oneTimeWarning_default(oneTimeWarning_default.geometryHeightReference);
+ }
+ return;
+ }
+ if (heightReference !== HeightReference_default.CLAMP_TO_GROUND) {
+ return height;
+ }
+ return 0;
+};
+GroundGeometryUpdater.getGeometryExtrudedHeight = function(extrudedHeight, extrudedHeightReference) {
+ Check_default.defined("extrudedHeightReference", extrudedHeightReference);
+ if (!defined_default(extrudedHeight)) {
+ if (extrudedHeightReference !== HeightReference_default.NONE) {
+ oneTimeWarning_default(oneTimeWarning_default.geometryExtrudedHeightReference);
+ }
+ return;
+ }
+ if (extrudedHeightReference !== HeightReference_default.CLAMP_TO_GROUND) {
+ return extrudedHeight;
+ }
+ return GroundGeometryUpdater.CLAMP_TO_GROUND;
+};
+GroundGeometryUpdater.CLAMP_TO_GROUND = "clamp";
+GroundGeometryUpdater.computeGeometryOffsetAttribute = function(height, heightReference, extrudedHeight, extrudedHeightReference) {
+ if (!defined_default(height) || !defined_default(heightReference)) {
+ heightReference = HeightReference_default.NONE;
+ }
+ if (!defined_default(extrudedHeight) || !defined_default(extrudedHeightReference)) {
+ extrudedHeightReference = HeightReference_default.NONE;
+ }
+ let n = 0;
+ if (heightReference !== HeightReference_default.NONE) {
+ n++;
+ }
+ if (extrudedHeightReference === HeightReference_default.RELATIVE_TO_GROUND) {
+ n++;
+ }
+ if (n === 2) {
+ return GeometryOffsetAttribute_default.ALL;
+ }
+ if (n === 1) {
+ return GeometryOffsetAttribute_default.TOP;
+ }
+ return void 0;
+};
+var GroundGeometryUpdater_default = GroundGeometryUpdater;
+
+// Source/DataSources/CorridorGeometryUpdater.js
+var scratchColor11 = new Color_default();
+var defaultOffset2 = Cartesian3_default.ZERO;
+var offsetScratch5 = new Cartesian3_default();
+var scratchRectangle4 = new Rectangle_default();
+function CorridorGeometryOptions(entity) {
+ this.id = entity;
+ this.vertexFormat = void 0;
+ this.positions = void 0;
+ this.width = void 0;
+ this.cornerType = void 0;
+ this.height = void 0;
+ this.extrudedHeight = void 0;
+ this.granularity = void 0;
+ this.offsetAttribute = void 0;
+}
+function CorridorGeometryUpdater(entity, scene) {
+ GroundGeometryUpdater_default.call(this, {
+ entity,
+ scene,
+ geometryOptions: new CorridorGeometryOptions(entity),
+ geometryPropertyName: "corridor",
+ observedPropertyNames: ["availability", "corridor"]
+ });
+ this._onEntityPropertyChanged(entity, "corridor", entity.corridor, void 0);
+}
+if (defined_default(Object.create)) {
+ CorridorGeometryUpdater.prototype = Object.create(
+ GroundGeometryUpdater_default.prototype
+ );
+ CorridorGeometryUpdater.prototype.constructor = CorridorGeometryUpdater;
+}
+CorridorGeometryUpdater.prototype.createFillGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._fillEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent a filled geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time)
+ ),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ this._distanceDisplayConditionProperty.getValue(time)
+ ),
+ offset: void 0,
+ color: void 0
+ };
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ let currentColor;
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor11);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ attributes.color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ }
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset2,
+ offsetScratch5
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new CorridorGeometry_default(this._options),
+ attributes
+ });
+};
+CorridorGeometryUpdater.prototype.createOutlineGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._outlineEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent an outlined geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const outlineColor = Property_default.getValueOrDefault(
+ this._outlineColorProperty,
+ time,
+ Color_default.BLACK,
+ scratchColor11
+ );
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)
+ ),
+ color: ColorGeometryInstanceAttribute_default.fromColor(outlineColor),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ this._distanceDisplayConditionProperty.getValue(time)
+ ),
+ offset: void 0
+ };
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset2,
+ offsetScratch5
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new CorridorOutlineGeometry_default(this._options),
+ attributes
+ });
+};
+CorridorGeometryUpdater.prototype._computeCenter = function(time, result) {
+ const positions = Property_default.getValueOrUndefined(
+ this._entity.corridor.positions,
+ time
+ );
+ if (!defined_default(positions) || positions.length === 0) {
+ return;
+ }
+ return Cartesian3_default.clone(
+ positions[Math.floor(positions.length / 2)],
+ result
+ );
+};
+CorridorGeometryUpdater.prototype._isHidden = function(entity, corridor) {
+ return !defined_default(corridor.positions) || !defined_default(corridor.width) || GeometryUpdater_default.prototype._isHidden.call(this, entity, corridor);
+};
+CorridorGeometryUpdater.prototype._isDynamic = function(entity, corridor) {
+ return !corridor.positions.isConstant || !Property_default.isConstant(corridor.height) || !Property_default.isConstant(corridor.extrudedHeight) || !Property_default.isConstant(corridor.granularity) || !Property_default.isConstant(corridor.width) || !Property_default.isConstant(corridor.outlineWidth) || !Property_default.isConstant(corridor.cornerType) || !Property_default.isConstant(corridor.zIndex) || this._onTerrain && !Property_default.isConstant(this._materialProperty) && !(this._materialProperty instanceof ColorMaterialProperty_default);
+};
+CorridorGeometryUpdater.prototype._setStaticOptions = function(entity, corridor) {
+ let heightValue = Property_default.getValueOrUndefined(
+ corridor.height,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ const heightReferenceValue = Property_default.getValueOrDefault(
+ corridor.heightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ let extrudedHeightValue = Property_default.getValueOrUndefined(
+ corridor.extrudedHeight,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ const extrudedHeightReferenceValue = Property_default.getValueOrDefault(
+ corridor.extrudedHeightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ if (defined_default(extrudedHeightValue) && !defined_default(heightValue)) {
+ heightValue = 0;
+ }
+ const options = this._options;
+ options.vertexFormat = this._materialProperty instanceof ColorMaterialProperty_default ? PerInstanceColorAppearance_default.VERTEX_FORMAT : MaterialAppearance_default.MaterialSupport.TEXTURED.vertexFormat;
+ options.positions = corridor.positions.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.positions
+ );
+ options.width = corridor.width.getValue(Iso8601_default.MINIMUM_VALUE);
+ options.granularity = Property_default.getValueOrUndefined(
+ corridor.granularity,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.cornerType = Property_default.getValueOrUndefined(
+ corridor.cornerType,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.offsetAttribute = GroundGeometryUpdater_default.computeGeometryOffsetAttribute(
+ heightValue,
+ heightReferenceValue,
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ options.height = GroundGeometryUpdater_default.getGeometryHeight(
+ heightValue,
+ heightReferenceValue
+ );
+ extrudedHeightValue = GroundGeometryUpdater_default.getGeometryExtrudedHeight(
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ if (extrudedHeightValue === GroundGeometryUpdater_default.CLAMP_TO_GROUND) {
+ extrudedHeightValue = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ CorridorGeometry_default.computeRectangle(options, scratchRectangle4)
+ ).minimumTerrainHeight;
+ }
+ options.extrudedHeight = extrudedHeightValue;
+};
+CorridorGeometryUpdater.DynamicGeometryUpdater = DynamicCorridorGeometryUpdater;
+function DynamicCorridorGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
+ DynamicGeometryUpdater_default.call(
+ this,
+ geometryUpdater,
+ primitives,
+ groundPrimitives
+ );
+}
+if (defined_default(Object.create)) {
+ DynamicCorridorGeometryUpdater.prototype = Object.create(
+ DynamicGeometryUpdater_default.prototype
+ );
+ DynamicCorridorGeometryUpdater.prototype.constructor = DynamicCorridorGeometryUpdater;
+}
+DynamicCorridorGeometryUpdater.prototype._isHidden = function(entity, corridor, time) {
+ const options = this._options;
+ return !defined_default(options.positions) || !defined_default(options.width) || DynamicGeometryUpdater_default.prototype._isHidden.call(
+ this,
+ entity,
+ corridor,
+ time
+ );
+};
+DynamicCorridorGeometryUpdater.prototype._setOptions = function(entity, corridor, time) {
+ const options = this._options;
+ let heightValue = Property_default.getValueOrUndefined(corridor.height, time);
+ const heightReferenceValue = Property_default.getValueOrDefault(
+ corridor.heightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ let extrudedHeightValue = Property_default.getValueOrUndefined(
+ corridor.extrudedHeight,
+ time
+ );
+ const extrudedHeightReferenceValue = Property_default.getValueOrDefault(
+ corridor.extrudedHeightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ if (defined_default(extrudedHeightValue) && !defined_default(heightValue)) {
+ heightValue = 0;
+ }
+ options.positions = Property_default.getValueOrUndefined(corridor.positions, time);
+ options.width = Property_default.getValueOrUndefined(corridor.width, time);
+ options.granularity = Property_default.getValueOrUndefined(
+ corridor.granularity,
+ time
+ );
+ options.cornerType = Property_default.getValueOrUndefined(corridor.cornerType, time);
+ options.offsetAttribute = GroundGeometryUpdater_default.computeGeometryOffsetAttribute(
+ heightValue,
+ heightReferenceValue,
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ options.height = GroundGeometryUpdater_default.getGeometryHeight(
+ heightValue,
+ heightReferenceValue
+ );
+ extrudedHeightValue = GroundGeometryUpdater_default.getGeometryExtrudedHeight(
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ if (extrudedHeightValue === GroundGeometryUpdater_default.CLAMP_TO_GROUND) {
+ extrudedHeightValue = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ CorridorGeometry_default.computeRectangle(options, scratchRectangle4)
+ ).minimumTerrainHeight;
+ }
+ options.extrudedHeight = extrudedHeightValue;
+};
+var CorridorGeometryUpdater_default = CorridorGeometryUpdater;
+
+// Source/DataSources/DataSource.js
+function DataSource() {
+ DeveloperError_default.throwInstantiationError();
+}
+Object.defineProperties(DataSource.prototype, {
+ name: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ clock: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ entities: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ isLoading: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ changedEvent: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ errorEvent: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ loadingEvent: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ show: {
+ get: DeveloperError_default.throwInstantiationError
+ },
+ clustering: {
+ get: DeveloperError_default.throwInstantiationError
+ }
+});
+DataSource.prototype.update = function(time) {
+ DeveloperError_default.throwInstantiationError();
+};
+DataSource.setLoading = function(dataSource, isLoading) {
+ if (dataSource._isLoading !== isLoading) {
+ if (isLoading) {
+ dataSource._entityCollection.suspendEvents();
+ } else {
+ dataSource._entityCollection.resumeEvents();
+ }
+ dataSource._isLoading = isLoading;
+ dataSource._loading.raiseEvent(dataSource, isLoading);
+ }
+};
+var DataSource_default = DataSource;
+
+// Source/Core/EllipsoidalOccluder.js
+function EllipsoidalOccluder(ellipsoid, cameraPosition) {
+ Check_default.typeOf.object("ellipsoid", ellipsoid);
+ this._ellipsoid = ellipsoid;
+ this._cameraPosition = new Cartesian3_default();
+ this._cameraPositionInScaledSpace = new Cartesian3_default();
+ this._distanceToLimbInScaledSpaceSquared = 0;
+ if (defined_default(cameraPosition)) {
+ this.cameraPosition = cameraPosition;
+ }
+}
+Object.defineProperties(EllipsoidalOccluder.prototype, {
+ ellipsoid: {
+ get: function() {
+ return this._ellipsoid;
+ }
+ },
+ cameraPosition: {
+ get: function() {
+ return this._cameraPosition;
+ },
+ set: function(cameraPosition) {
+ const ellipsoid = this._ellipsoid;
+ const cv = ellipsoid.transformPositionToScaledSpace(
+ cameraPosition,
+ this._cameraPositionInScaledSpace
+ );
+ const vhMagnitudeSquared = Cartesian3_default.magnitudeSquared(cv) - 1;
+ Cartesian3_default.clone(cameraPosition, this._cameraPosition);
+ this._cameraPositionInScaledSpace = cv;
+ this._distanceToLimbInScaledSpaceSquared = vhMagnitudeSquared;
+ }
+ }
+});
+var scratchCartesian11 = new Cartesian3_default();
+EllipsoidalOccluder.prototype.isPointVisible = function(occludee) {
+ const ellipsoid = this._ellipsoid;
+ const occludeeScaledSpacePosition = ellipsoid.transformPositionToScaledSpace(
+ occludee,
+ scratchCartesian11
+ );
+ return isScaledSpacePointVisible(
+ occludeeScaledSpacePosition,
+ this._cameraPositionInScaledSpace,
+ this._distanceToLimbInScaledSpaceSquared
+ );
+};
+EllipsoidalOccluder.prototype.isScaledSpacePointVisible = function(occludeeScaledSpacePosition) {
+ return isScaledSpacePointVisible(
+ occludeeScaledSpacePosition,
+ this._cameraPositionInScaledSpace,
+ this._distanceToLimbInScaledSpaceSquared
+ );
+};
+var scratchCameraPositionInScaledSpaceShrunk = new Cartesian3_default();
+EllipsoidalOccluder.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid = function(occludeeScaledSpacePosition, minimumHeight) {
+ const ellipsoid = this._ellipsoid;
+ let vhMagnitudeSquared;
+ let cv;
+ if (defined_default(minimumHeight) && minimumHeight < 0 && ellipsoid.minimumRadius > -minimumHeight) {
+ cv = scratchCameraPositionInScaledSpaceShrunk;
+ cv.x = this._cameraPosition.x / (ellipsoid.radii.x + minimumHeight);
+ cv.y = this._cameraPosition.y / (ellipsoid.radii.y + minimumHeight);
+ cv.z = this._cameraPosition.z / (ellipsoid.radii.z + minimumHeight);
+ vhMagnitudeSquared = cv.x * cv.x + cv.y * cv.y + cv.z * cv.z - 1;
+ } else {
+ cv = this._cameraPositionInScaledSpace;
+ vhMagnitudeSquared = this._distanceToLimbInScaledSpaceSquared;
+ }
+ return isScaledSpacePointVisible(
+ occludeeScaledSpacePosition,
+ cv,
+ vhMagnitudeSquared
+ );
+};
+EllipsoidalOccluder.prototype.computeHorizonCullingPoint = function(directionToPoint, positions, result) {
+ return computeHorizonCullingPointFromPositions(
+ this._ellipsoid,
+ directionToPoint,
+ positions,
+ result
+ );
+};
+var scratchEllipsoidShrunk = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+EllipsoidalOccluder.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid = function(directionToPoint, positions, minimumHeight, result) {
+ const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid(
+ this._ellipsoid,
+ minimumHeight,
+ scratchEllipsoidShrunk
+ );
+ return computeHorizonCullingPointFromPositions(
+ possiblyShrunkEllipsoid,
+ directionToPoint,
+ positions,
+ result
+ );
+};
+EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVertices = function(directionToPoint, vertices, stride, center, result) {
+ return computeHorizonCullingPointFromVertices(
+ this._ellipsoid,
+ directionToPoint,
+ vertices,
+ stride,
+ center,
+ result
+ );
+};
+EllipsoidalOccluder.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid = function(directionToPoint, vertices, stride, center, minimumHeight, result) {
+ const possiblyShrunkEllipsoid = getPossiblyShrunkEllipsoid(
+ this._ellipsoid,
+ minimumHeight,
+ scratchEllipsoidShrunk
+ );
+ return computeHorizonCullingPointFromVertices(
+ possiblyShrunkEllipsoid,
+ directionToPoint,
+ vertices,
+ stride,
+ center,
+ result
+ );
+};
+var subsampleScratch = [];
+EllipsoidalOccluder.prototype.computeHorizonCullingPointFromRectangle = function(rectangle, ellipsoid, result) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ const positions = Rectangle_default.subsample(
+ rectangle,
+ ellipsoid,
+ 0,
+ subsampleScratch
+ );
+ const bs = BoundingSphere_default.fromPoints(positions);
+ if (Cartesian3_default.magnitude(bs.center) < 0.1 * ellipsoid.minimumRadius) {
+ return void 0;
+ }
+ return this.computeHorizonCullingPoint(bs.center, positions, result);
+};
+var scratchEllipsoidShrunkRadii = new Cartesian3_default();
+function getPossiblyShrunkEllipsoid(ellipsoid, minimumHeight, result) {
+ if (defined_default(minimumHeight) && minimumHeight < 0 && ellipsoid.minimumRadius > -minimumHeight) {
+ const ellipsoidShrunkRadii = Cartesian3_default.fromElements(
+ ellipsoid.radii.x + minimumHeight,
+ ellipsoid.radii.y + minimumHeight,
+ ellipsoid.radii.z + minimumHeight,
+ scratchEllipsoidShrunkRadii
+ );
+ ellipsoid = Ellipsoid_default.fromCartesian3(ellipsoidShrunkRadii, result);
+ }
+ return ellipsoid;
+}
+function computeHorizonCullingPointFromPositions(ellipsoid, directionToPoint, positions, result) {
+ Check_default.typeOf.object("directionToPoint", directionToPoint);
+ Check_default.defined("positions", positions);
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(
+ ellipsoid,
+ directionToPoint
+ );
+ let resultMagnitude = 0;
+ for (let i = 0, len = positions.length; i < len; ++i) {
+ const position = positions[i];
+ const candidateMagnitude = computeMagnitude(
+ ellipsoid,
+ position,
+ scaledSpaceDirectionToPoint
+ );
+ if (candidateMagnitude < 0) {
+ return void 0;
+ }
+ resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);
+ }
+ return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);
+}
+var positionScratch7 = new Cartesian3_default();
+function computeHorizonCullingPointFromVertices(ellipsoid, directionToPoint, vertices, stride, center, result) {
+ Check_default.typeOf.object("directionToPoint", directionToPoint);
+ Check_default.defined("vertices", vertices);
+ Check_default.typeOf.number("stride", stride);
+ if (!defined_default(result)) {
+ result = new Cartesian3_default();
+ }
+ stride = defaultValue_default(stride, 3);
+ center = defaultValue_default(center, Cartesian3_default.ZERO);
+ const scaledSpaceDirectionToPoint = computeScaledSpaceDirectionToPoint(
+ ellipsoid,
+ directionToPoint
+ );
+ let resultMagnitude = 0;
+ for (let i = 0, len = vertices.length; i < len; i += stride) {
+ positionScratch7.x = vertices[i] + center.x;
+ positionScratch7.y = vertices[i + 1] + center.y;
+ positionScratch7.z = vertices[i + 2] + center.z;
+ const candidateMagnitude = computeMagnitude(
+ ellipsoid,
+ positionScratch7,
+ scaledSpaceDirectionToPoint
+ );
+ if (candidateMagnitude < 0) {
+ return void 0;
+ }
+ resultMagnitude = Math.max(resultMagnitude, candidateMagnitude);
+ }
+ return magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result);
+}
+function isScaledSpacePointVisible(occludeeScaledSpacePosition, cameraPositionInScaledSpace, distanceToLimbInScaledSpaceSquared) {
+ const cv = cameraPositionInScaledSpace;
+ const vhMagnitudeSquared = distanceToLimbInScaledSpaceSquared;
+ const vt = Cartesian3_default.subtract(
+ occludeeScaledSpacePosition,
+ cv,
+ scratchCartesian11
+ );
+ const vtDotVc = -Cartesian3_default.dot(vt, cv);
+ const isOccluded = vhMagnitudeSquared < 0 ? vtDotVc > 0 : vtDotVc > vhMagnitudeSquared && vtDotVc * vtDotVc / Cartesian3_default.magnitudeSquared(vt) > vhMagnitudeSquared;
+ return !isOccluded;
+}
+var scaledSpaceScratch = new Cartesian3_default();
+var directionScratch = new Cartesian3_default();
+function computeMagnitude(ellipsoid, position, scaledSpaceDirectionToPoint) {
+ const scaledSpacePosition = ellipsoid.transformPositionToScaledSpace(
+ position,
+ scaledSpaceScratch
+ );
+ let magnitudeSquared = Cartesian3_default.magnitudeSquared(scaledSpacePosition);
+ let magnitude = Math.sqrt(magnitudeSquared);
+ const direction2 = Cartesian3_default.divideByScalar(
+ scaledSpacePosition,
+ magnitude,
+ directionScratch
+ );
+ magnitudeSquared = Math.max(1, magnitudeSquared);
+ magnitude = Math.max(1, magnitude);
+ const cosAlpha = Cartesian3_default.dot(direction2, scaledSpaceDirectionToPoint);
+ const sinAlpha = Cartesian3_default.magnitude(
+ Cartesian3_default.cross(direction2, scaledSpaceDirectionToPoint, direction2)
+ );
+ const cosBeta = 1 / magnitude;
+ const sinBeta = Math.sqrt(magnitudeSquared - 1) * cosBeta;
+ return 1 / (cosAlpha * cosBeta - sinAlpha * sinBeta);
+}
+function magnitudeToPoint(scaledSpaceDirectionToPoint, resultMagnitude, result) {
+ if (resultMagnitude <= 0 || resultMagnitude === 1 / 0 || resultMagnitude !== resultMagnitude) {
+ return void 0;
+ }
+ return Cartesian3_default.multiplyByScalar(
+ scaledSpaceDirectionToPoint,
+ resultMagnitude,
+ result
+ );
+}
+var directionToPointScratch = new Cartesian3_default();
+function computeScaledSpaceDirectionToPoint(ellipsoid, directionToPoint) {
+ if (Cartesian3_default.equals(directionToPoint, Cartesian3_default.ZERO)) {
+ return directionToPoint;
+ }
+ ellipsoid.transformPositionToScaledSpace(
+ directionToPoint,
+ directionToPointScratch
+ );
+ return Cartesian3_default.normalize(directionToPointScratch, directionToPointScratch);
+}
+var EllipsoidalOccluder_default = EllipsoidalOccluder;
+
+// Source/Scene/PointPrimitive.js
+function PointPrimitive(options, pointPrimitiveCollection) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ if (defined_default(options.disableDepthTestDistance) && options.disableDepthTestDistance < 0) {
+ throw new DeveloperError_default(
+ "disableDepthTestDistance must be greater than or equal to 0.0."
+ );
+ }
+ let translucencyByDistance = options.translucencyByDistance;
+ let scaleByDistance = options.scaleByDistance;
+ let distanceDisplayCondition = options.distanceDisplayCondition;
+ if (defined_default(translucencyByDistance)) {
+ if (translucencyByDistance.far <= translucencyByDistance.near) {
+ throw new DeveloperError_default(
+ "translucencyByDistance.far must be greater than translucencyByDistance.near."
+ );
+ }
+ translucencyByDistance = NearFarScalar_default.clone(translucencyByDistance);
+ }
+ if (defined_default(scaleByDistance)) {
+ if (scaleByDistance.far <= scaleByDistance.near) {
+ throw new DeveloperError_default(
+ "scaleByDistance.far must be greater than scaleByDistance.near."
+ );
+ }
+ scaleByDistance = NearFarScalar_default.clone(scaleByDistance);
+ }
+ if (defined_default(distanceDisplayCondition)) {
+ if (distanceDisplayCondition.far <= distanceDisplayCondition.near) {
+ throw new DeveloperError_default(
+ "distanceDisplayCondition.far must be greater than distanceDisplayCondition.near."
+ );
+ }
+ distanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ distanceDisplayCondition
+ );
+ }
+ this._show = defaultValue_default(options.show, true);
+ this._position = Cartesian3_default.clone(
+ defaultValue_default(options.position, Cartesian3_default.ZERO)
+ );
+ this._actualPosition = Cartesian3_default.clone(this._position);
+ this._color = Color_default.clone(defaultValue_default(options.color, Color_default.WHITE));
+ this._outlineColor = Color_default.clone(
+ defaultValue_default(options.outlineColor, Color_default.TRANSPARENT)
+ );
+ this._outlineWidth = defaultValue_default(options.outlineWidth, 0);
+ this._pixelSize = defaultValue_default(options.pixelSize, 10);
+ this._scaleByDistance = scaleByDistance;
+ this._translucencyByDistance = translucencyByDistance;
+ this._distanceDisplayCondition = distanceDisplayCondition;
+ this._disableDepthTestDistance = defaultValue_default(
+ options.disableDepthTestDistance,
+ 0
+ );
+ this._id = options.id;
+ this._collection = defaultValue_default(options.collection, pointPrimitiveCollection);
+ this._clusterShow = true;
+ this._pickId = void 0;
+ this._pointPrimitiveCollection = pointPrimitiveCollection;
+ this._dirty = false;
+ this._index = -1;
+}
+var SHOW_INDEX5 = PointPrimitive.SHOW_INDEX = 0;
+var POSITION_INDEX5 = PointPrimitive.POSITION_INDEX = 1;
+var COLOR_INDEX3 = PointPrimitive.COLOR_INDEX = 2;
+var OUTLINE_COLOR_INDEX = PointPrimitive.OUTLINE_COLOR_INDEX = 3;
+var OUTLINE_WIDTH_INDEX = PointPrimitive.OUTLINE_WIDTH_INDEX = 4;
+var PIXEL_SIZE_INDEX = PointPrimitive.PIXEL_SIZE_INDEX = 5;
+var SCALE_BY_DISTANCE_INDEX3 = PointPrimitive.SCALE_BY_DISTANCE_INDEX = 6;
+var TRANSLUCENCY_BY_DISTANCE_INDEX3 = PointPrimitive.TRANSLUCENCY_BY_DISTANCE_INDEX = 7;
+var DISTANCE_DISPLAY_CONDITION_INDEX2 = PointPrimitive.DISTANCE_DISPLAY_CONDITION_INDEX = 8;
+var DISABLE_DEPTH_DISTANCE_INDEX = PointPrimitive.DISABLE_DEPTH_DISTANCE_INDEX = 9;
+PointPrimitive.NUMBER_OF_PROPERTIES = 10;
+function makeDirty3(pointPrimitive, propertyChanged) {
+ const pointPrimitiveCollection = pointPrimitive._pointPrimitiveCollection;
+ if (defined_default(pointPrimitiveCollection)) {
+ pointPrimitiveCollection._updatePointPrimitive(
+ pointPrimitive,
+ propertyChanged
+ );
+ pointPrimitive._dirty = true;
+ }
+}
+Object.defineProperties(PointPrimitive.prototype, {
+ show: {
+ get: function() {
+ return this._show;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._show !== value) {
+ this._show = value;
+ makeDirty3(this, SHOW_INDEX5);
+ }
+ }
+ },
+ position: {
+ get: function() {
+ return this._position;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const position = this._position;
+ if (!Cartesian3_default.equals(position, value)) {
+ Cartesian3_default.clone(value, position);
+ Cartesian3_default.clone(value, this._actualPosition);
+ makeDirty3(this, POSITION_INDEX5);
+ }
+ }
+ },
+ scaleByDistance: {
+ get: function() {
+ return this._scaleByDistance;
+ },
+ set: function(value) {
+ if (defined_default(value) && value.far <= value.near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ const scaleByDistance = this._scaleByDistance;
+ if (!NearFarScalar_default.equals(scaleByDistance, value)) {
+ this._scaleByDistance = NearFarScalar_default.clone(value, scaleByDistance);
+ makeDirty3(this, SCALE_BY_DISTANCE_INDEX3);
+ }
+ }
+ },
+ translucencyByDistance: {
+ get: function() {
+ return this._translucencyByDistance;
+ },
+ set: function(value) {
+ if (defined_default(value) && value.far <= value.near) {
+ throw new DeveloperError_default(
+ "far distance must be greater than near distance."
+ );
+ }
+ const translucencyByDistance = this._translucencyByDistance;
+ if (!NearFarScalar_default.equals(translucencyByDistance, value)) {
+ this._translucencyByDistance = NearFarScalar_default.clone(
+ value,
+ translucencyByDistance
+ );
+ makeDirty3(this, TRANSLUCENCY_BY_DISTANCE_INDEX3);
+ }
+ }
+ },
+ pixelSize: {
+ get: function() {
+ return this._pixelSize;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._pixelSize !== value) {
+ this._pixelSize = value;
+ makeDirty3(this, PIXEL_SIZE_INDEX);
+ }
+ }
+ },
+ color: {
+ get: function() {
+ return this._color;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const color = this._color;
+ if (!Color_default.equals(color, value)) {
+ Color_default.clone(value, color);
+ makeDirty3(this, COLOR_INDEX3);
+ }
+ }
+ },
+ outlineColor: {
+ get: function() {
+ return this._outlineColor;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ const outlineColor = this._outlineColor;
+ if (!Color_default.equals(outlineColor, value)) {
+ Color_default.clone(value, outlineColor);
+ makeDirty3(this, OUTLINE_COLOR_INDEX);
+ }
+ }
+ },
+ outlineWidth: {
+ get: function() {
+ return this._outlineWidth;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required.");
+ }
+ if (this._outlineWidth !== value) {
+ this._outlineWidth = value;
+ makeDirty3(this, OUTLINE_WIDTH_INDEX);
+ }
+ }
+ },
+ distanceDisplayCondition: {
+ get: function() {
+ return this._distanceDisplayCondition;
+ },
+ set: function(value) {
+ if (defined_default(value) && value.far <= value.near) {
+ throw new DeveloperError_default("far must be greater than near");
+ }
+ if (!DistanceDisplayCondition_default.equals(this._distanceDisplayCondition, value)) {
+ this._distanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ value,
+ this._distanceDisplayCondition
+ );
+ makeDirty3(this, DISTANCE_DISPLAY_CONDITION_INDEX2);
+ }
+ }
+ },
+ disableDepthTestDistance: {
+ get: function() {
+ return this._disableDepthTestDistance;
+ },
+ set: function(value) {
+ if (this._disableDepthTestDistance !== value) {
+ if (!defined_default(value) || value < 0) {
+ throw new DeveloperError_default(
+ "disableDepthTestDistance must be greater than or equal to 0.0."
+ );
+ }
+ this._disableDepthTestDistance = value;
+ makeDirty3(this, DISABLE_DEPTH_DISTANCE_INDEX);
+ }
+ }
+ },
+ id: {
+ get: function() {
+ return this._id;
+ },
+ set: function(value) {
+ this._id = value;
+ if (defined_default(this._pickId)) {
+ this._pickId.object.id = value;
+ }
+ }
+ },
+ pickId: {
+ get: function() {
+ return this._pickId;
+ }
+ },
+ clusterShow: {
+ get: function() {
+ return this._clusterShow;
+ },
+ set: function(value) {
+ if (this._clusterShow !== value) {
+ this._clusterShow = value;
+ makeDirty3(this, SHOW_INDEX5);
+ }
+ }
+ }
+});
+PointPrimitive.prototype.getPickId = function(context) {
+ if (!defined_default(this._pickId)) {
+ this._pickId = context.createPickId({
+ primitive: this,
+ collection: this._collection,
+ id: this._id
+ });
+ }
+ return this._pickId;
+};
+PointPrimitive.prototype._getActualPosition = function() {
+ return this._actualPosition;
+};
+PointPrimitive.prototype._setActualPosition = function(value) {
+ Cartesian3_default.clone(value, this._actualPosition);
+ makeDirty3(this, POSITION_INDEX5);
+};
+var tempCartesian32 = new Cartesian4_default();
+PointPrimitive._computeActualPosition = function(position, frameState, modelMatrix) {
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ return position;
+ }
+ Matrix4_default.multiplyByPoint(modelMatrix, position, tempCartesian32);
+ return SceneTransforms_default.computeActualWgs84Position(frameState, tempCartesian32);
+};
+var scratchCartesian44 = new Cartesian4_default();
+PointPrimitive._computeScreenSpacePosition = function(modelMatrix, position, scene, result) {
+ const positionWorld = Matrix4_default.multiplyByVector(
+ modelMatrix,
+ Cartesian4_default.fromElements(
+ position.x,
+ position.y,
+ position.z,
+ 1,
+ scratchCartesian44
+ ),
+ scratchCartesian44
+ );
+ const positionWC2 = SceneTransforms_default.wgs84ToWindowCoordinates(
+ scene,
+ positionWorld,
+ result
+ );
+ return positionWC2;
+};
+PointPrimitive.prototype.computeScreenSpacePosition = function(scene, result) {
+ const pointPrimitiveCollection = this._pointPrimitiveCollection;
+ if (!defined_default(result)) {
+ result = new Cartesian2_default();
+ }
+ if (!defined_default(pointPrimitiveCollection)) {
+ throw new DeveloperError_default("PointPrimitive must be in a collection.");
+ }
+ if (!defined_default(scene)) {
+ throw new DeveloperError_default("scene is required.");
+ }
+ const modelMatrix = pointPrimitiveCollection.modelMatrix;
+ const windowCoordinates = PointPrimitive._computeScreenSpacePosition(
+ modelMatrix,
+ this._actualPosition,
+ scene,
+ result
+ );
+ if (!defined_default(windowCoordinates)) {
+ return void 0;
+ }
+ windowCoordinates.y = scene.canvas.clientHeight - windowCoordinates.y;
+ return windowCoordinates;
+};
+PointPrimitive.getScreenSpaceBoundingBox = function(point, screenSpacePosition, result) {
+ const size = point.pixelSize;
+ const halfSize = size * 0.5;
+ const x = screenSpacePosition.x - halfSize;
+ const y = screenSpacePosition.y - halfSize;
+ const width = size;
+ const height = size;
+ if (!defined_default(result)) {
+ result = new BoundingRectangle_default();
+ }
+ result.x = x;
+ result.y = y;
+ result.width = width;
+ result.height = height;
+ return result;
+};
+PointPrimitive.prototype.equals = function(other) {
+ return this === other || defined_default(other) && this._id === other._id && Cartesian3_default.equals(this._position, other._position) && Color_default.equals(this._color, other._color) && this._pixelSize === other._pixelSize && this._outlineWidth === other._outlineWidth && this._show === other._show && Color_default.equals(this._outlineColor, other._outlineColor) && NearFarScalar_default.equals(this._scaleByDistance, other._scaleByDistance) && NearFarScalar_default.equals(
+ this._translucencyByDistance,
+ other._translucencyByDistance
+ ) && DistanceDisplayCondition_default.equals(
+ this._distanceDisplayCondition,
+ other._distanceDisplayCondition
+ ) && this._disableDepthTestDistance === other._disableDepthTestDistance;
+};
+PointPrimitive.prototype._destroy = function() {
+ this._pickId = this._pickId && this._pickId.destroy();
+ this._pointPrimitiveCollection = void 0;
+};
+var PointPrimitive_default = PointPrimitive;
+
+// Source/Shaders/PointPrimitiveCollectionFS.js
+var PointPrimitiveCollectionFS_default = "varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\nvarying vec4 v_pickColor;\n\nvoid main()\n{\n // The distance in UV space from this fragment to the center of the point, at most 0.5.\n float distanceToCenter = length(gl_PointCoord - vec2(0.5));\n // The max distance stops one pixel shy of the edge to leave space for anti-aliasing.\n float maxDistance = max(0.0, 0.5 - v_pixelDistance);\n float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\n float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\n\n vec4 color = mix(v_outlineColor, v_color, innerAlpha);\n color.a *= wholeAlpha;\n\n// Fully transparent parts of the billboard are not pickable.\n#if !defined(OPAQUE) && !defined(TRANSLUCENT)\n if (color.a < 0.005) // matches 0/255 and 1/255\n {\n discard;\n }\n#else\n// The billboard is rendered twice. The opaque pass discards translucent fragments\n// and the translucent pass discards opaque fragments.\n#ifdef OPAQUE\n if (color.a < 0.995) // matches < 254/255\n {\n discard;\n }\n#else\n if (color.a >= 0.995) // matches 254/255 and 255/255\n {\n discard;\n }\n#endif\n#endif\n\n gl_FragColor = czm_gammaCorrect(color);\n czm_writeLogDepth();\n}\n";
+
+// Source/Shaders/PointPrimitiveCollectionVS.js
+var PointPrimitiveCollectionVS_default = `uniform float u_maxTotalPointSize;
+
+attribute vec4 positionHighAndSize;
+attribute vec4 positionLowAndOutline;
+attribute vec4 compressedAttribute0; // color, outlineColor, pick color
+attribute vec4 compressedAttribute1; // show, translucency by distance, some free space
+attribute vec4 scaleByDistance; // near, nearScale, far, farScale
+attribute vec3 distanceDisplayConditionAndDisableDepth; // near, far, disableDepthTestDistance
+
+varying vec4 v_color;
+varying vec4 v_outlineColor;
+varying float v_innerPercent;
+varying float v_pixelDistance;
+varying vec4 v_pickColor;
+
+const float SHIFT_LEFT8 = 256.0;
+const float SHIFT_RIGHT8 = 1.0 / 256.0;
+
+void main()
+{
+ // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition
+
+ // unpack attributes
+ vec3 positionHigh = positionHighAndSize.xyz;
+ vec3 positionLow = positionLowAndOutline.xyz;
+ float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
+ float totalSize = positionHighAndSize.w + outlineWidthBothSides;
+ float outlinePercent = outlineWidthBothSides / totalSize;
+ // Scale in response to browser-zoom.
+ totalSize *= czm_pixelRatio;
+ // Add padding for anti-aliasing on both sides.
+ totalSize += 3.0;
+
+ float temp = compressedAttribute1.x * SHIFT_RIGHT8;
+ float show = floor(temp);
+
+#ifdef EYE_DISTANCE_TRANSLUCENCY
+ vec4 translucencyByDistance;
+ translucencyByDistance.x = compressedAttribute1.z;
+ translucencyByDistance.z = compressedAttribute1.w;
+
+ translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
+
+ temp = compressedAttribute1.y * SHIFT_RIGHT8;
+ translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
+#endif
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ vec4 color;
+ vec4 outlineColor;
+ vec4 pickColor;
+
+ // compressedAttribute0.z => pickColor.rgb
+
+ temp = compressedAttribute0.z * SHIFT_RIGHT8;
+ pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
+ temp = floor(temp) * SHIFT_RIGHT8;
+ pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
+ pickColor.r = floor(temp);
+
+ // compressedAttribute0.x => color.rgb
+
+ temp = compressedAttribute0.x * SHIFT_RIGHT8;
+ color.b = (temp - floor(temp)) * SHIFT_LEFT8;
+ temp = floor(temp) * SHIFT_RIGHT8;
+ color.g = (temp - floor(temp)) * SHIFT_LEFT8;
+ color.r = floor(temp);
+
+ // compressedAttribute0.y => outlineColor.rgb
+
+ temp = compressedAttribute0.y * SHIFT_RIGHT8;
+ outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
+ temp = floor(temp) * SHIFT_RIGHT8;
+ outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
+ outlineColor.r = floor(temp);
+
+ // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a
+
+ temp = compressedAttribute0.w * SHIFT_RIGHT8;
+ pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
+ pickColor = pickColor / 255.0;
+
+ temp = floor(temp) * SHIFT_RIGHT8;
+ outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
+ outlineColor /= 255.0;
+ color.a = floor(temp);
+ color /= 255.0;
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
+ vec4 positionEC = czm_modelViewRelativeToEye * p;
+
+ ///////////////////////////////////////////////////////////////////////////
+
+#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
+ float lengthSq;
+ if (czm_sceneMode == czm_sceneMode2D)
+ {
+ // 2D camera distance is a special case
+ // treat all billboards as flattened to the z=0.0 plane
+ lengthSq = czm_eyeHeight2D.y;
+ }
+ else
+ {
+ lengthSq = dot(positionEC.xyz, positionEC.xyz);
+ }
+#endif
+
+#ifdef EYE_DISTANCE_SCALING
+ totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
+#endif
+ // Clamp to max point size.
+ totalSize = min(totalSize, u_maxTotalPointSize);
+ // If size is too small, push vertex behind near plane for clipping.
+ // Note that context.minimumAliasedPointSize "will be at most 1.0".
+ if (totalSize < 1.0)
+ {
+ positionEC.xyz = vec3(0.0);
+ totalSize = 1.0;
+ }
+
+ float translucency = 1.0;
+#ifdef EYE_DISTANCE_TRANSLUCENCY
+ translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
+ // push vertex behind near plane for clipping
+ if (translucency < 0.004)
+ {
+ positionEC.xyz = vec3(0.0);
+ }
+#endif
+
+#ifdef DISTANCE_DISPLAY_CONDITION
+ float nearSq = distanceDisplayConditionAndDisableDepth.x;
+ float farSq = distanceDisplayConditionAndDisableDepth.y;
+ if (lengthSq < nearSq || lengthSq > farSq) {
+ // push vertex behind camera to force it to be clipped
+ positionEC.xyz = vec3(0.0, 0.0, 1.0);
+ }
+#endif
+
+ gl_Position = czm_projection * positionEC;
+ czm_vertexLogDepth();
+
+#ifdef DISABLE_DEPTH_DISTANCE
+ float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;
+ if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
+ {
+ disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
+ }
+
+ if (disableDepthTestDistance != 0.0)
+ {
+ // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
+ float zclip = gl_Position.z / gl_Position.w;
+ bool clipped = (zclip < -1.0 || zclip > 1.0);
+ if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
+ {
+ // Position z on the near plane.
+ gl_Position.z = -gl_Position.w;
+#ifdef LOG_DEPTH
+ czm_vertexLogDepth(vec4(czm_currentFrustum.x));
+#endif
+ }
+ }
+#endif
+
+ v_color = color;
+ v_color.a *= translucency * show;
+ v_outlineColor = outlineColor;
+ v_outlineColor.a *= translucency * show;
+
+ v_innerPercent = 1.0 - outlinePercent;
+ v_pixelDistance = 2.0 / totalSize;
+ gl_PointSize = totalSize * show;
+ gl_Position *= show;
+
+ v_pickColor = pickColor;
+}
+`;
+
+// Source/Scene/PointPrimitiveCollection.js
+var SHOW_INDEX6 = PointPrimitive_default.SHOW_INDEX;
+var POSITION_INDEX6 = PointPrimitive_default.POSITION_INDEX;
+var COLOR_INDEX4 = PointPrimitive_default.COLOR_INDEX;
+var OUTLINE_COLOR_INDEX2 = PointPrimitive_default.OUTLINE_COLOR_INDEX;
+var OUTLINE_WIDTH_INDEX2 = PointPrimitive_default.OUTLINE_WIDTH_INDEX;
+var PIXEL_SIZE_INDEX2 = PointPrimitive_default.PIXEL_SIZE_INDEX;
+var SCALE_BY_DISTANCE_INDEX4 = PointPrimitive_default.SCALE_BY_DISTANCE_INDEX;
+var TRANSLUCENCY_BY_DISTANCE_INDEX4 = PointPrimitive_default.TRANSLUCENCY_BY_DISTANCE_INDEX;
+var DISTANCE_DISPLAY_CONDITION_INDEX3 = PointPrimitive_default.DISTANCE_DISPLAY_CONDITION_INDEX;
+var DISABLE_DEPTH_DISTANCE_INDEX2 = PointPrimitive_default.DISABLE_DEPTH_DISTANCE_INDEX;
+var NUMBER_OF_PROPERTIES4 = PointPrimitive_default.NUMBER_OF_PROPERTIES;
+var attributeLocations5 = {
+ positionHighAndSize: 0,
+ positionLowAndOutline: 1,
+ compressedAttribute0: 2,
+ compressedAttribute1: 3,
+ scaleByDistance: 4,
+ distanceDisplayConditionAndDisableDepth: 5
+};
+function PointPrimitiveCollection(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._sp = void 0;
+ this._spTranslucent = void 0;
+ this._rsOpaque = void 0;
+ this._rsTranslucent = void 0;
+ this._vaf = void 0;
+ this._pointPrimitives = [];
+ this._pointPrimitivesToUpdate = [];
+ this._pointPrimitivesToUpdateIndex = 0;
+ this._pointPrimitivesRemoved = false;
+ this._createVertexArray = false;
+ this._shaderScaleByDistance = false;
+ this._compiledShaderScaleByDistance = false;
+ this._shaderTranslucencyByDistance = false;
+ this._compiledShaderTranslucencyByDistance = false;
+ this._shaderDistanceDisplayCondition = false;
+ this._compiledShaderDistanceDisplayCondition = false;
+ this._shaderDisableDepthDistance = false;
+ this._compiledShaderDisableDepthDistance = false;
+ this._propertiesChanged = new Uint32Array(NUMBER_OF_PROPERTIES4);
+ this._maxPixelSize = 1;
+ this._baseVolume = new BoundingSphere_default();
+ this._baseVolumeWC = new BoundingSphere_default();
+ this._baseVolume2D = new BoundingSphere_default();
+ this._boundingVolume = new BoundingSphere_default();
+ this._boundingVolumeDirty = false;
+ this._colorCommands = [];
+ this.show = defaultValue_default(options.show, true);
+ this.modelMatrix = Matrix4_default.clone(
+ defaultValue_default(options.modelMatrix, Matrix4_default.IDENTITY)
+ );
+ this._modelMatrix = Matrix4_default.clone(Matrix4_default.IDENTITY);
+ this.debugShowBoundingVolume = defaultValue_default(
+ options.debugShowBoundingVolume,
+ false
+ );
+ this.blendOption = defaultValue_default(
+ options.blendOption,
+ BlendOption_default.OPAQUE_AND_TRANSLUCENT
+ );
+ this._blendOption = void 0;
+ this._mode = SceneMode_default.SCENE3D;
+ this._maxTotalPointSize = 1;
+ this._buffersUsage = [
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW,
+ BufferUsage_default.STATIC_DRAW
+ ];
+ const that = this;
+ this._uniforms = {
+ u_maxTotalPointSize: function() {
+ return that._maxTotalPointSize;
+ }
+ };
+}
+Object.defineProperties(PointPrimitiveCollection.prototype, {
+ length: {
+ get: function() {
+ removePointPrimitives(this);
+ return this._pointPrimitives.length;
+ }
+ }
+});
+function destroyPointPrimitives(pointPrimitives) {
+ const length3 = pointPrimitives.length;
+ for (let i = 0; i < length3; ++i) {
+ if (pointPrimitives[i]) {
+ pointPrimitives[i]._destroy();
+ }
+ }
+}
+PointPrimitiveCollection.prototype.add = function(options) {
+ const p = new PointPrimitive_default(options, this);
+ p._index = this._pointPrimitives.length;
+ this._pointPrimitives.push(p);
+ this._createVertexArray = true;
+ return p;
+};
+PointPrimitiveCollection.prototype.remove = function(pointPrimitive) {
+ if (this.contains(pointPrimitive)) {
+ this._pointPrimitives[pointPrimitive._index] = null;
+ this._pointPrimitivesRemoved = true;
+ this._createVertexArray = true;
+ pointPrimitive._destroy();
+ return true;
+ }
+ return false;
+};
+PointPrimitiveCollection.prototype.removeAll = function() {
+ destroyPointPrimitives(this._pointPrimitives);
+ this._pointPrimitives = [];
+ this._pointPrimitivesToUpdate = [];
+ this._pointPrimitivesToUpdateIndex = 0;
+ this._pointPrimitivesRemoved = false;
+ this._createVertexArray = true;
+};
+function removePointPrimitives(pointPrimitiveCollection) {
+ if (pointPrimitiveCollection._pointPrimitivesRemoved) {
+ pointPrimitiveCollection._pointPrimitivesRemoved = false;
+ const newPointPrimitives = [];
+ const pointPrimitives = pointPrimitiveCollection._pointPrimitives;
+ const length3 = pointPrimitives.length;
+ for (let i = 0, j = 0; i < length3; ++i) {
+ const pointPrimitive = pointPrimitives[i];
+ if (pointPrimitive) {
+ pointPrimitive._index = j++;
+ newPointPrimitives.push(pointPrimitive);
+ }
+ }
+ pointPrimitiveCollection._pointPrimitives = newPointPrimitives;
+ }
+}
+PointPrimitiveCollection.prototype._updatePointPrimitive = function(pointPrimitive, propertyChanged) {
+ if (!pointPrimitive._dirty) {
+ this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++] = pointPrimitive;
+ }
+ ++this._propertiesChanged[propertyChanged];
+};
+PointPrimitiveCollection.prototype.contains = function(pointPrimitive) {
+ return defined_default(pointPrimitive) && pointPrimitive._pointPrimitiveCollection === this;
+};
+PointPrimitiveCollection.prototype.get = function(index) {
+ if (!defined_default(index)) {
+ throw new DeveloperError_default("index is required.");
+ }
+ removePointPrimitives(this);
+ return this._pointPrimitives[index];
+};
+PointPrimitiveCollection.prototype.computeNewBuffersUsage = function() {
+ const buffersUsage = this._buffersUsage;
+ let usageChanged = false;
+ const properties = this._propertiesChanged;
+ for (let k = 0; k < NUMBER_OF_PROPERTIES4; ++k) {
+ const newUsage = properties[k] === 0 ? BufferUsage_default.STATIC_DRAW : BufferUsage_default.STREAM_DRAW;
+ usageChanged = usageChanged || buffersUsage[k] !== newUsage;
+ buffersUsage[k] = newUsage;
+ }
+ return usageChanged;
+};
+function createVAF2(context, numberOfPointPrimitives, buffersUsage) {
+ return new VertexArrayFacade_default(
+ context,
+ [
+ {
+ index: attributeLocations5.positionHighAndSize,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[POSITION_INDEX6]
+ },
+ {
+ index: attributeLocations5.positionLowAndShow,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[POSITION_INDEX6]
+ },
+ {
+ index: attributeLocations5.compressedAttribute0,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[COLOR_INDEX4]
+ },
+ {
+ index: attributeLocations5.compressedAttribute1,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[TRANSLUCENCY_BY_DISTANCE_INDEX4]
+ },
+ {
+ index: attributeLocations5.scaleByDistance,
+ componentsPerAttribute: 4,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[SCALE_BY_DISTANCE_INDEX4]
+ },
+ {
+ index: attributeLocations5.distanceDisplayConditionAndDisableDepth,
+ componentsPerAttribute: 3,
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ usage: buffersUsage[DISTANCE_DISPLAY_CONDITION_INDEX3]
+ }
+ ],
+ numberOfPointPrimitives
+ );
+}
+var writePositionScratch2 = new EncodedCartesian3_default();
+function writePositionSizeAndOutline(pointPrimitiveCollection, context, vafWriters, pointPrimitive) {
+ const i = pointPrimitive._index;
+ const position = pointPrimitive._getActualPosition();
+ if (pointPrimitiveCollection._mode === SceneMode_default.SCENE3D) {
+ BoundingSphere_default.expand(
+ pointPrimitiveCollection._baseVolume,
+ position,
+ pointPrimitiveCollection._baseVolume
+ );
+ pointPrimitiveCollection._boundingVolumeDirty = true;
+ }
+ EncodedCartesian3_default.fromCartesian(position, writePositionScratch2);
+ const pixelSize = pointPrimitive.pixelSize;
+ const outlineWidth = pointPrimitive.outlineWidth;
+ pointPrimitiveCollection._maxPixelSize = Math.max(
+ pointPrimitiveCollection._maxPixelSize,
+ pixelSize + outlineWidth
+ );
+ const positionHighWriter = vafWriters[attributeLocations5.positionHighAndSize];
+ const high = writePositionScratch2.high;
+ positionHighWriter(i, high.x, high.y, high.z, pixelSize);
+ const positionLowWriter = vafWriters[attributeLocations5.positionLowAndOutline];
+ const low = writePositionScratch2.low;
+ positionLowWriter(i, low.x, low.y, low.z, outlineWidth);
+}
+var LEFT_SHIFT162 = 65536;
+var LEFT_SHIFT82 = 256;
+function writeCompressedAttrib02(pointPrimitiveCollection, context, vafWriters, pointPrimitive) {
+ const i = pointPrimitive._index;
+ const color = pointPrimitive.color;
+ const pickColor = pointPrimitive.getPickId(context).color;
+ const outlineColor = pointPrimitive.outlineColor;
+ let red = Color_default.floatToByte(color.red);
+ let green = Color_default.floatToByte(color.green);
+ let blue = Color_default.floatToByte(color.blue);
+ const compressed0 = red * LEFT_SHIFT162 + green * LEFT_SHIFT82 + blue;
+ red = Color_default.floatToByte(outlineColor.red);
+ green = Color_default.floatToByte(outlineColor.green);
+ blue = Color_default.floatToByte(outlineColor.blue);
+ const compressed1 = red * LEFT_SHIFT162 + green * LEFT_SHIFT82 + blue;
+ red = Color_default.floatToByte(pickColor.red);
+ green = Color_default.floatToByte(pickColor.green);
+ blue = Color_default.floatToByte(pickColor.blue);
+ const compressed2 = red * LEFT_SHIFT162 + green * LEFT_SHIFT82 + blue;
+ const compressed3 = Color_default.floatToByte(color.alpha) * LEFT_SHIFT162 + Color_default.floatToByte(outlineColor.alpha) * LEFT_SHIFT82 + Color_default.floatToByte(pickColor.alpha);
+ const writer = vafWriters[attributeLocations5.compressedAttribute0];
+ writer(i, compressed0, compressed1, compressed2, compressed3);
+}
+function writeCompressedAttrib12(pointPrimitiveCollection, context, vafWriters, pointPrimitive) {
+ const i = pointPrimitive._index;
+ let near = 0;
+ let nearValue = 1;
+ let far = 1;
+ let farValue = 1;
+ const translucency = pointPrimitive.translucencyByDistance;
+ if (defined_default(translucency)) {
+ near = translucency.near;
+ nearValue = translucency.nearValue;
+ far = translucency.far;
+ farValue = translucency.farValue;
+ if (nearValue !== 1 || farValue !== 1) {
+ pointPrimitiveCollection._shaderTranslucencyByDistance = true;
+ }
+ }
+ let show = pointPrimitive.show && pointPrimitive.clusterShow;
+ if (pointPrimitive.color.alpha === 0 && pointPrimitive.outlineColor.alpha === 0) {
+ show = false;
+ }
+ nearValue = Math_default.clamp(nearValue, 0, 1);
+ nearValue = nearValue === 1 ? 255 : nearValue * 255 | 0;
+ const compressed0 = (show ? 1 : 0) * LEFT_SHIFT82 + nearValue;
+ farValue = Math_default.clamp(farValue, 0, 1);
+ farValue = farValue === 1 ? 255 : farValue * 255 | 0;
+ const compressed1 = farValue;
+ const writer = vafWriters[attributeLocations5.compressedAttribute1];
+ writer(i, compressed0, compressed1, near, far);
+}
+function writeScaleByDistance2(pointPrimitiveCollection, context, vafWriters, pointPrimitive) {
+ const i = pointPrimitive._index;
+ const writer = vafWriters[attributeLocations5.scaleByDistance];
+ let near = 0;
+ let nearValue = 1;
+ let far = 1;
+ let farValue = 1;
+ const scale = pointPrimitive.scaleByDistance;
+ if (defined_default(scale)) {
+ near = scale.near;
+ nearValue = scale.nearValue;
+ far = scale.far;
+ farValue = scale.farValue;
+ if (nearValue !== 1 || farValue !== 1) {
+ pointPrimitiveCollection._shaderScaleByDistance = true;
+ }
+ }
+ writer(i, near, nearValue, far, farValue);
+}
+function writeDistanceDisplayConditionAndDepthDisable(pointPrimitiveCollection, context, vafWriters, pointPrimitive) {
+ const i = pointPrimitive._index;
+ const writer = vafWriters[attributeLocations5.distanceDisplayConditionAndDisableDepth];
+ let near = 0;
+ let far = Number.MAX_VALUE;
+ const distanceDisplayCondition = pointPrimitive.distanceDisplayCondition;
+ if (defined_default(distanceDisplayCondition)) {
+ near = distanceDisplayCondition.near;
+ far = distanceDisplayCondition.far;
+ near *= near;
+ far *= far;
+ pointPrimitiveCollection._shaderDistanceDisplayCondition = true;
+ }
+ let disableDepthTestDistance = pointPrimitive.disableDepthTestDistance;
+ disableDepthTestDistance *= disableDepthTestDistance;
+ if (disableDepthTestDistance > 0) {
+ pointPrimitiveCollection._shaderDisableDepthDistance = true;
+ if (disableDepthTestDistance === Number.POSITIVE_INFINITY) {
+ disableDepthTestDistance = -1;
+ }
+ }
+ writer(i, near, far, disableDepthTestDistance);
+}
+function writePointPrimitive(pointPrimitiveCollection, context, vafWriters, pointPrimitive) {
+ writePositionSizeAndOutline(
+ pointPrimitiveCollection,
+ context,
+ vafWriters,
+ pointPrimitive
+ );
+ writeCompressedAttrib02(
+ pointPrimitiveCollection,
+ context,
+ vafWriters,
+ pointPrimitive
+ );
+ writeCompressedAttrib12(
+ pointPrimitiveCollection,
+ context,
+ vafWriters,
+ pointPrimitive
+ );
+ writeScaleByDistance2(
+ pointPrimitiveCollection,
+ context,
+ vafWriters,
+ pointPrimitive
+ );
+ writeDistanceDisplayConditionAndDepthDisable(
+ pointPrimitiveCollection,
+ context,
+ vafWriters,
+ pointPrimitive
+ );
+}
+function recomputeActualPositions2(pointPrimitiveCollection, pointPrimitives, length3, frameState, modelMatrix, recomputeBoundingVolume) {
+ let boundingVolume;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ boundingVolume = pointPrimitiveCollection._baseVolume;
+ pointPrimitiveCollection._boundingVolumeDirty = true;
+ } else {
+ boundingVolume = pointPrimitiveCollection._baseVolume2D;
+ }
+ const positions = [];
+ for (let i = 0; i < length3; ++i) {
+ const pointPrimitive = pointPrimitives[i];
+ const position = pointPrimitive.position;
+ const actualPosition = PointPrimitive_default._computeActualPosition(
+ position,
+ frameState,
+ modelMatrix
+ );
+ if (defined_default(actualPosition)) {
+ pointPrimitive._setActualPosition(actualPosition);
+ if (recomputeBoundingVolume) {
+ positions.push(actualPosition);
+ } else {
+ BoundingSphere_default.expand(boundingVolume, actualPosition, boundingVolume);
+ }
+ }
+ }
+ if (recomputeBoundingVolume) {
+ BoundingSphere_default.fromPoints(positions, boundingVolume);
+ }
+}
+function updateMode3(pointPrimitiveCollection, frameState) {
+ const mode2 = frameState.mode;
+ const pointPrimitives = pointPrimitiveCollection._pointPrimitives;
+ const pointPrimitivesToUpdate = pointPrimitiveCollection._pointPrimitivesToUpdate;
+ const modelMatrix = pointPrimitiveCollection._modelMatrix;
+ if (pointPrimitiveCollection._createVertexArray || pointPrimitiveCollection._mode !== mode2 || mode2 !== SceneMode_default.SCENE3D && !Matrix4_default.equals(modelMatrix, pointPrimitiveCollection.modelMatrix)) {
+ pointPrimitiveCollection._mode = mode2;
+ Matrix4_default.clone(pointPrimitiveCollection.modelMatrix, modelMatrix);
+ pointPrimitiveCollection._createVertexArray = true;
+ if (mode2 === SceneMode_default.SCENE3D || mode2 === SceneMode_default.SCENE2D || mode2 === SceneMode_default.COLUMBUS_VIEW) {
+ recomputeActualPositions2(
+ pointPrimitiveCollection,
+ pointPrimitives,
+ pointPrimitives.length,
+ frameState,
+ modelMatrix,
+ true
+ );
+ }
+ } else if (mode2 === SceneMode_default.MORPHING) {
+ recomputeActualPositions2(
+ pointPrimitiveCollection,
+ pointPrimitives,
+ pointPrimitives.length,
+ frameState,
+ modelMatrix,
+ true
+ );
+ } else if (mode2 === SceneMode_default.SCENE2D || mode2 === SceneMode_default.COLUMBUS_VIEW) {
+ recomputeActualPositions2(
+ pointPrimitiveCollection,
+ pointPrimitivesToUpdate,
+ pointPrimitiveCollection._pointPrimitivesToUpdateIndex,
+ frameState,
+ modelMatrix,
+ false
+ );
+ }
+}
+function updateBoundingVolume2(collection, frameState, boundingVolume) {
+ const pixelSize = frameState.camera.getPixelSize(
+ boundingVolume,
+ frameState.context.drawingBufferWidth,
+ frameState.context.drawingBufferHeight
+ );
+ const size = pixelSize * collection._maxPixelSize;
+ boundingVolume.radius += size;
+}
+var scratchWriterArray2 = [];
+PointPrimitiveCollection.prototype.update = function(frameState) {
+ removePointPrimitives(this);
+ if (!this.show) {
+ return;
+ }
+ this._maxTotalPointSize = ContextLimits_default.maximumAliasedPointSize;
+ updateMode3(this, frameState);
+ const pointPrimitives = this._pointPrimitives;
+ const pointPrimitivesLength = pointPrimitives.length;
+ const pointPrimitivesToUpdate = this._pointPrimitivesToUpdate;
+ const pointPrimitivesToUpdateLength = this._pointPrimitivesToUpdateIndex;
+ const properties = this._propertiesChanged;
+ const createVertexArray7 = this._createVertexArray;
+ let vafWriters;
+ const context = frameState.context;
+ const pass = frameState.passes;
+ const picking = pass.pick;
+ if (createVertexArray7 || !picking && this.computeNewBuffersUsage()) {
+ this._createVertexArray = false;
+ for (let k = 0; k < NUMBER_OF_PROPERTIES4; ++k) {
+ properties[k] = 0;
+ }
+ this._vaf = this._vaf && this._vaf.destroy();
+ if (pointPrimitivesLength > 0) {
+ this._vaf = createVAF2(context, pointPrimitivesLength, this._buffersUsage);
+ vafWriters = this._vaf.writers;
+ for (let i = 0; i < pointPrimitivesLength; ++i) {
+ const pointPrimitive = this._pointPrimitives[i];
+ pointPrimitive._dirty = false;
+ writePointPrimitive(this, context, vafWriters, pointPrimitive);
+ }
+ this._vaf.commit();
+ }
+ this._pointPrimitivesToUpdateIndex = 0;
+ } else if (pointPrimitivesToUpdateLength > 0) {
+ const writers = scratchWriterArray2;
+ writers.length = 0;
+ if (properties[POSITION_INDEX6] || properties[OUTLINE_WIDTH_INDEX2] || properties[PIXEL_SIZE_INDEX2]) {
+ writers.push(writePositionSizeAndOutline);
+ }
+ if (properties[COLOR_INDEX4] || properties[OUTLINE_COLOR_INDEX2]) {
+ writers.push(writeCompressedAttrib02);
+ }
+ if (properties[SHOW_INDEX6] || properties[TRANSLUCENCY_BY_DISTANCE_INDEX4]) {
+ writers.push(writeCompressedAttrib12);
+ }
+ if (properties[SCALE_BY_DISTANCE_INDEX4]) {
+ writers.push(writeScaleByDistance2);
+ }
+ if (properties[DISTANCE_DISPLAY_CONDITION_INDEX3] || properties[DISABLE_DEPTH_DISTANCE_INDEX2]) {
+ writers.push(writeDistanceDisplayConditionAndDepthDisable);
+ }
+ const numWriters = writers.length;
+ vafWriters = this._vaf.writers;
+ if (pointPrimitivesToUpdateLength / pointPrimitivesLength > 0.1) {
+ for (let m = 0; m < pointPrimitivesToUpdateLength; ++m) {
+ const b = pointPrimitivesToUpdate[m];
+ b._dirty = false;
+ for (let n = 0; n < numWriters; ++n) {
+ writers[n](this, context, vafWriters, b);
+ }
+ }
+ this._vaf.commit();
+ } else {
+ for (let h = 0; h < pointPrimitivesToUpdateLength; ++h) {
+ const bb = pointPrimitivesToUpdate[h];
+ bb._dirty = false;
+ for (let o = 0; o < numWriters; ++o) {
+ writers[o](this, context, vafWriters, bb);
+ }
+ this._vaf.subCommit(bb._index, 1);
+ }
+ this._vaf.endSubCommits();
+ }
+ this._pointPrimitivesToUpdateIndex = 0;
+ }
+ if (pointPrimitivesToUpdateLength > pointPrimitivesLength * 1.5) {
+ pointPrimitivesToUpdate.length = pointPrimitivesLength;
+ }
+ if (!defined_default(this._vaf) || !defined_default(this._vaf.va)) {
+ return;
+ }
+ if (this._boundingVolumeDirty) {
+ this._boundingVolumeDirty = false;
+ BoundingSphere_default.transform(
+ this._baseVolume,
+ this.modelMatrix,
+ this._baseVolumeWC
+ );
+ }
+ let boundingVolume;
+ let modelMatrix = Matrix4_default.IDENTITY;
+ if (frameState.mode === SceneMode_default.SCENE3D) {
+ modelMatrix = this.modelMatrix;
+ boundingVolume = BoundingSphere_default.clone(
+ this._baseVolumeWC,
+ this._boundingVolume
+ );
+ } else {
+ boundingVolume = BoundingSphere_default.clone(
+ this._baseVolume2D,
+ this._boundingVolume
+ );
+ }
+ updateBoundingVolume2(this, frameState, boundingVolume);
+ const blendOptionChanged = this._blendOption !== this.blendOption;
+ this._blendOption = this.blendOption;
+ if (blendOptionChanged) {
+ if (this._blendOption === BlendOption_default.OPAQUE || this._blendOption === BlendOption_default.OPAQUE_AND_TRANSLUCENT) {
+ this._rsOpaque = RenderState_default.fromCache({
+ depthTest: {
+ enabled: true,
+ func: WebGLConstants_default.LEQUAL
+ },
+ depthMask: true
+ });
+ } else {
+ this._rsOpaque = void 0;
+ }
+ if (this._blendOption === BlendOption_default.TRANSLUCENT || this._blendOption === BlendOption_default.OPAQUE_AND_TRANSLUCENT) {
+ this._rsTranslucent = RenderState_default.fromCache({
+ depthTest: {
+ enabled: true,
+ func: WebGLConstants_default.LEQUAL
+ },
+ depthMask: false,
+ blending: BlendingState_default.ALPHA_BLEND
+ });
+ } else {
+ this._rsTranslucent = void 0;
+ }
+ }
+ this._shaderDisableDepthDistance = this._shaderDisableDepthDistance || frameState.minimumDisableDepthTestDistance !== 0;
+ let vs;
+ let fs;
+ if (blendOptionChanged || this._shaderScaleByDistance && !this._compiledShaderScaleByDistance || this._shaderTranslucencyByDistance && !this._compiledShaderTranslucencyByDistance || this._shaderDistanceDisplayCondition && !this._compiledShaderDistanceDisplayCondition || this._shaderDisableDepthDistance !== this._compiledShaderDisableDepthDistance) {
+ vs = new ShaderSource_default({
+ sources: [PointPrimitiveCollectionVS_default]
+ });
+ if (this._shaderScaleByDistance) {
+ vs.defines.push("EYE_DISTANCE_SCALING");
+ }
+ if (this._shaderTranslucencyByDistance) {
+ vs.defines.push("EYE_DISTANCE_TRANSLUCENCY");
+ }
+ if (this._shaderDistanceDisplayCondition) {
+ vs.defines.push("DISTANCE_DISPLAY_CONDITION");
+ }
+ if (this._shaderDisableDepthDistance) {
+ vs.defines.push("DISABLE_DEPTH_DISTANCE");
+ }
+ if (this._blendOption === BlendOption_default.OPAQUE_AND_TRANSLUCENT) {
+ fs = new ShaderSource_default({
+ defines: ["OPAQUE"],
+ sources: [PointPrimitiveCollectionFS_default]
+ });
+ this._sp = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: this._sp,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations5
+ });
+ fs = new ShaderSource_default({
+ defines: ["TRANSLUCENT"],
+ sources: [PointPrimitiveCollectionFS_default]
+ });
+ this._spTranslucent = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: this._spTranslucent,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations5
+ });
+ }
+ if (this._blendOption === BlendOption_default.OPAQUE) {
+ fs = new ShaderSource_default({
+ sources: [PointPrimitiveCollectionFS_default]
+ });
+ this._sp = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: this._sp,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations5
+ });
+ }
+ if (this._blendOption === BlendOption_default.TRANSLUCENT) {
+ fs = new ShaderSource_default({
+ sources: [PointPrimitiveCollectionFS_default]
+ });
+ this._spTranslucent = ShaderProgram_default.replaceCache({
+ context,
+ shaderProgram: this._spTranslucent,
+ vertexShaderSource: vs,
+ fragmentShaderSource: fs,
+ attributeLocations: attributeLocations5
+ });
+ }
+ this._compiledShaderScaleByDistance = this._shaderScaleByDistance;
+ this._compiledShaderTranslucencyByDistance = this._shaderTranslucencyByDistance;
+ this._compiledShaderDistanceDisplayCondition = this._shaderDistanceDisplayCondition;
+ this._compiledShaderDisableDepthDistance = this._shaderDisableDepthDistance;
+ }
+ let va;
+ let vaLength;
+ let command;
+ let j;
+ const commandList = frameState.commandList;
+ if (pass.render || picking) {
+ const colorList = this._colorCommands;
+ const opaque = this._blendOption === BlendOption_default.OPAQUE;
+ const opaqueAndTranslucent = this._blendOption === BlendOption_default.OPAQUE_AND_TRANSLUCENT;
+ va = this._vaf.va;
+ vaLength = va.length;
+ colorList.length = vaLength;
+ const totalLength = opaqueAndTranslucent ? vaLength * 2 : vaLength;
+ for (j = 0; j < totalLength; ++j) {
+ const opaqueCommand = opaque || opaqueAndTranslucent && j % 2 === 0;
+ command = colorList[j];
+ if (!defined_default(command)) {
+ command = colorList[j] = new DrawCommand_default();
+ }
+ command.primitiveType = PrimitiveType_default.POINTS;
+ command.pass = opaqueCommand || !opaqueAndTranslucent ? Pass_default.OPAQUE : Pass_default.TRANSLUCENT;
+ command.owner = this;
+ const index = opaqueAndTranslucent ? Math.floor(j / 2) : j;
+ command.boundingVolume = boundingVolume;
+ command.modelMatrix = modelMatrix;
+ command.shaderProgram = opaqueCommand ? this._sp : this._spTranslucent;
+ command.uniformMap = this._uniforms;
+ command.vertexArray = va[index].va;
+ command.renderState = opaqueCommand ? this._rsOpaque : this._rsTranslucent;
+ command.debugShowBoundingVolume = this.debugShowBoundingVolume;
+ command.pickId = "v_pickColor";
+ commandList.push(command);
+ }
+ }
+};
+PointPrimitiveCollection.prototype.isDestroyed = function() {
+ return false;
+};
+PointPrimitiveCollection.prototype.destroy = function() {
+ this._sp = this._sp && this._sp.destroy();
+ this._spTranslucent = this._spTranslucent && this._spTranslucent.destroy();
+ this._spPick = this._spPick && this._spPick.destroy();
+ this._vaf = this._vaf && this._vaf.destroy();
+ destroyPointPrimitives(this._pointPrimitives);
+ return destroyObject_default(this);
+};
+var PointPrimitiveCollection_default = PointPrimitiveCollection;
+
+// node_modules/kdbush/src/sort.js
+function sortKD(ids, coords, nodeSize, left, right, depth) {
+ if (right - left <= nodeSize)
+ return;
+ const m = left + right >> 1;
+ select(ids, coords, m, left, right, depth % 2);
+ sortKD(ids, coords, nodeSize, left, m - 1, depth + 1);
+ sortKD(ids, coords, nodeSize, m + 1, right, depth + 1);
+}
+function select(ids, coords, k, left, right, inc) {
+ while (right > left) {
+ if (right - left > 600) {
+ const n = right - left + 1;
+ const m = k - left + 1;
+ const z = Math.log(n);
+ const s = 0.5 * Math.exp(2 * z / 3);
+ const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);
+ const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));
+ const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));
+ select(ids, coords, k, newLeft, newRight, inc);
+ }
+ const t = coords[2 * k + inc];
+ let i = left;
+ let j = right;
+ swapItem(ids, coords, left, k);
+ if (coords[2 * right + inc] > t)
+ swapItem(ids, coords, left, right);
+ while (i < j) {
+ swapItem(ids, coords, i, j);
+ i++;
+ j--;
+ while (coords[2 * i + inc] < t)
+ i++;
+ while (coords[2 * j + inc] > t)
+ j--;
+ }
+ if (coords[2 * left + inc] === t)
+ swapItem(ids, coords, left, j);
+ else {
+ j++;
+ swapItem(ids, coords, j, right);
+ }
+ if (j <= k)
+ left = j + 1;
+ if (k <= j)
+ right = j - 1;
+ }
+}
+function swapItem(ids, coords, i, j) {
+ swap2(ids, i, j);
+ swap2(coords, 2 * i, 2 * j);
+ swap2(coords, 2 * i + 1, 2 * j + 1);
+}
+function swap2(arr, i, j) {
+ const tmp2 = arr[i];
+ arr[i] = arr[j];
+ arr[j] = tmp2;
+}
+
+// node_modules/kdbush/src/range.js
+function range(ids, coords, minX, minY, maxX, maxY, nodeSize) {
+ const stack = [0, ids.length - 1, 0];
+ const result = [];
+ let x, y;
+ while (stack.length) {
+ const axis = stack.pop();
+ const right = stack.pop();
+ const left = stack.pop();
+ if (right - left <= nodeSize) {
+ for (let i = left; i <= right; i++) {
+ x = coords[2 * i];
+ y = coords[2 * i + 1];
+ if (x >= minX && x <= maxX && y >= minY && y <= maxY)
+ result.push(ids[i]);
+ }
+ continue;
+ }
+ const m = Math.floor((left + right) / 2);
+ x = coords[2 * m];
+ y = coords[2 * m + 1];
+ if (x >= minX && x <= maxX && y >= minY && y <= maxY)
+ result.push(ids[m]);
+ const nextAxis = (axis + 1) % 2;
+ if (axis === 0 ? minX <= x : minY <= y) {
+ stack.push(left);
+ stack.push(m - 1);
+ stack.push(nextAxis);
+ }
+ if (axis === 0 ? maxX >= x : maxY >= y) {
+ stack.push(m + 1);
+ stack.push(right);
+ stack.push(nextAxis);
+ }
+ }
+ return result;
+}
+
+// node_modules/kdbush/src/within.js
+function within(ids, coords, qx, qy, r, nodeSize) {
+ const stack = [0, ids.length - 1, 0];
+ const result = [];
+ const r2 = r * r;
+ while (stack.length) {
+ const axis = stack.pop();
+ const right = stack.pop();
+ const left = stack.pop();
+ if (right - left <= nodeSize) {
+ for (let i = left; i <= right; i++) {
+ if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2)
+ result.push(ids[i]);
+ }
+ continue;
+ }
+ const m = Math.floor((left + right) / 2);
+ const x = coords[2 * m];
+ const y = coords[2 * m + 1];
+ if (sqDist(x, y, qx, qy) <= r2)
+ result.push(ids[m]);
+ const nextAxis = (axis + 1) % 2;
+ if (axis === 0 ? qx - r <= x : qy - r <= y) {
+ stack.push(left);
+ stack.push(m - 1);
+ stack.push(nextAxis);
+ }
+ if (axis === 0 ? qx + r >= x : qy + r >= y) {
+ stack.push(m + 1);
+ stack.push(right);
+ stack.push(nextAxis);
+ }
+ }
+ return result;
+}
+function sqDist(ax, ay, bx, by) {
+ const dx = ax - bx;
+ const dy = ay - by;
+ return dx * dx + dy * dy;
+}
+
+// node_modules/kdbush/src/index.js
+var defaultGetX = (p) => p[0];
+var defaultGetY = (p) => p[1];
+var KDBush = class {
+ constructor(points, getX2 = defaultGetX, getY2 = defaultGetY, nodeSize = 64, ArrayType = Float64Array) {
+ this.nodeSize = nodeSize;
+ this.points = points;
+ const IndexArrayType = points.length < 65536 ? Uint16Array : Uint32Array;
+ const ids = this.ids = new IndexArrayType(points.length);
+ const coords = this.coords = new ArrayType(points.length * 2);
+ for (let i = 0; i < points.length; i++) {
+ ids[i] = i;
+ coords[2 * i] = getX2(points[i]);
+ coords[2 * i + 1] = getY2(points[i]);
+ }
+ sortKD(ids, coords, nodeSize, 0, ids.length - 1, 0);
+ }
+ range(minX, minY, maxX, maxY) {
+ return range(this.ids, this.coords, minX, minY, maxX, maxY, this.nodeSize);
+ }
+ within(x, y, r) {
+ return within(this.ids, this.coords, x, y, r, this.nodeSize);
+ }
+};
+
+// Source/DataSources/EntityCluster.js
+function EntityCluster(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._enabled = defaultValue_default(options.enabled, false);
+ this._pixelRange = defaultValue_default(options.pixelRange, 80);
+ this._minimumClusterSize = defaultValue_default(options.minimumClusterSize, 2);
+ this._clusterBillboards = defaultValue_default(options.clusterBillboards, true);
+ this._clusterLabels = defaultValue_default(options.clusterLabels, true);
+ this._clusterPoints = defaultValue_default(options.clusterPoints, true);
+ this._labelCollection = void 0;
+ this._billboardCollection = void 0;
+ this._pointCollection = void 0;
+ this._clusterBillboardCollection = void 0;
+ this._clusterLabelCollection = void 0;
+ this._clusterPointCollection = void 0;
+ this._collectionIndicesByEntity = {};
+ this._unusedLabelIndices = [];
+ this._unusedBillboardIndices = [];
+ this._unusedPointIndices = [];
+ this._previousClusters = [];
+ this._previousHeight = void 0;
+ this._enabledDirty = false;
+ this._clusterDirty = false;
+ this._cluster = void 0;
+ this._removeEventListener = void 0;
+ this._clusterEvent = new Event_default();
+ this.show = defaultValue_default(options.show, true);
+}
+function getX(point) {
+ return point.coord.x;
+}
+function getY(point) {
+ return point.coord.y;
+}
+function expandBoundingBox(bbox, pixelRange) {
+ bbox.x -= pixelRange;
+ bbox.y -= pixelRange;
+ bbox.width += pixelRange * 2;
+ bbox.height += pixelRange * 2;
+}
+var labelBoundingBoxScratch = new BoundingRectangle_default();
+function getBoundingBox(item, coord, pixelRange, entityCluster, result) {
+ if (defined_default(item._labelCollection) && entityCluster._clusterLabels) {
+ result = Label_default.getScreenSpaceBoundingBox(item, coord, result);
+ } else if (defined_default(item._billboardCollection) && entityCluster._clusterBillboards) {
+ result = Billboard_default.getScreenSpaceBoundingBox(item, coord, result);
+ } else if (defined_default(item._pointPrimitiveCollection) && entityCluster._clusterPoints) {
+ result = PointPrimitive_default.getScreenSpaceBoundingBox(item, coord, result);
+ }
+ expandBoundingBox(result, pixelRange);
+ if (entityCluster._clusterLabels && !defined_default(item._labelCollection) && defined_default(item.id) && hasLabelIndex(entityCluster, item.id.id) && defined_default(item.id._label)) {
+ const labelIndex = entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;
+ const label = entityCluster._labelCollection.get(labelIndex);
+ const labelBBox = Label_default.getScreenSpaceBoundingBox(
+ label,
+ coord,
+ labelBoundingBoxScratch
+ );
+ expandBoundingBox(labelBBox, pixelRange);
+ result = BoundingRectangle_default.union(result, labelBBox, result);
+ }
+ return result;
+}
+function addNonClusteredItem(item, entityCluster) {
+ item.clusterShow = true;
+ if (!defined_default(item._labelCollection) && defined_default(item.id) && hasLabelIndex(entityCluster, item.id.id) && defined_default(item.id._label)) {
+ const labelIndex = entityCluster._collectionIndicesByEntity[item.id.id].labelIndex;
+ const label = entityCluster._labelCollection.get(labelIndex);
+ label.clusterShow = true;
+ }
+}
+function addCluster(position, numPoints, ids, entityCluster) {
+ const cluster = {
+ billboard: entityCluster._clusterBillboardCollection.add(),
+ label: entityCluster._clusterLabelCollection.add(),
+ point: entityCluster._clusterPointCollection.add()
+ };
+ cluster.billboard.show = false;
+ cluster.point.show = false;
+ cluster.label.show = true;
+ cluster.label.text = numPoints.toLocaleString();
+ cluster.label.id = ids;
+ cluster.billboard.position = cluster.label.position = cluster.point.position = position;
+ entityCluster._clusterEvent.raiseEvent(ids, cluster);
+}
+function hasLabelIndex(entityCluster, entityId) {
+ return defined_default(entityCluster) && defined_default(entityCluster._collectionIndicesByEntity[entityId]) && defined_default(entityCluster._collectionIndicesByEntity[entityId].labelIndex);
+}
+function getScreenSpacePositions(collection, points, scene, occluder, entityCluster) {
+ if (!defined_default(collection)) {
+ return;
+ }
+ const length3 = collection.length;
+ for (let i = 0; i < length3; ++i) {
+ const item = collection.get(i);
+ item.clusterShow = false;
+ if (!item.show || entityCluster._scene.mode === SceneMode_default.SCENE3D && !occluder.isPointVisible(item.position)) {
+ continue;
+ }
+ const canClusterLabels = entityCluster._clusterLabels && defined_default(item._labelCollection);
+ const canClusterBillboards = entityCluster._clusterBillboards && defined_default(item.id._billboard);
+ const canClusterPoints = entityCluster._clusterPoints && defined_default(item.id._point);
+ if (canClusterLabels && (canClusterPoints || canClusterBillboards)) {
+ continue;
+ }
+ const coord = item.computeScreenSpacePosition(scene);
+ if (!defined_default(coord)) {
+ continue;
+ }
+ points.push({
+ index: i,
+ collection,
+ clustered: false,
+ coord
+ });
+ }
+}
+var pointBoundinRectangleScratch = new BoundingRectangle_default();
+var totalBoundingRectangleScratch = new BoundingRectangle_default();
+var neighborBoundingRectangleScratch = new BoundingRectangle_default();
+function createDeclutterCallback(entityCluster) {
+ return function(amount) {
+ if (defined_default(amount) && amount < 0.05 || !entityCluster.enabled) {
+ return;
+ }
+ const scene = entityCluster._scene;
+ const labelCollection = entityCluster._labelCollection;
+ const billboardCollection = entityCluster._billboardCollection;
+ const pointCollection = entityCluster._pointCollection;
+ if (!defined_default(labelCollection) && !defined_default(billboardCollection) && !defined_default(pointCollection) || !entityCluster._clusterBillboards && !entityCluster._clusterLabels && !entityCluster._clusterPoints) {
+ return;
+ }
+ let clusteredLabelCollection = entityCluster._clusterLabelCollection;
+ let clusteredBillboardCollection = entityCluster._clusterBillboardCollection;
+ let clusteredPointCollection = entityCluster._clusterPointCollection;
+ if (defined_default(clusteredLabelCollection)) {
+ clusteredLabelCollection.removeAll();
+ } else {
+ clusteredLabelCollection = entityCluster._clusterLabelCollection = new LabelCollection_default(
+ {
+ scene
+ }
+ );
+ }
+ if (defined_default(clusteredBillboardCollection)) {
+ clusteredBillboardCollection.removeAll();
+ } else {
+ clusteredBillboardCollection = entityCluster._clusterBillboardCollection = new BillboardCollection_default(
+ {
+ scene
+ }
+ );
+ }
+ if (defined_default(clusteredPointCollection)) {
+ clusteredPointCollection.removeAll();
+ } else {
+ clusteredPointCollection = entityCluster._clusterPointCollection = new PointPrimitiveCollection_default();
+ }
+ const pixelRange = entityCluster._pixelRange;
+ const minimumClusterSize = entityCluster._minimumClusterSize;
+ const clusters = entityCluster._previousClusters;
+ const newClusters = [];
+ const previousHeight = entityCluster._previousHeight;
+ const currentHeight = scene.camera.positionCartographic.height;
+ const ellipsoid = scene.mapProjection.ellipsoid;
+ const cameraPosition = scene.camera.positionWC;
+ const occluder = new EllipsoidalOccluder_default(ellipsoid, cameraPosition);
+ const points = [];
+ if (entityCluster._clusterLabels) {
+ getScreenSpacePositions(
+ labelCollection,
+ points,
+ scene,
+ occluder,
+ entityCluster
+ );
+ }
+ if (entityCluster._clusterBillboards) {
+ getScreenSpacePositions(
+ billboardCollection,
+ points,
+ scene,
+ occluder,
+ entityCluster
+ );
+ }
+ if (entityCluster._clusterPoints) {
+ getScreenSpacePositions(
+ pointCollection,
+ points,
+ scene,
+ occluder,
+ entityCluster
+ );
+ }
+ let i;
+ let j;
+ let length3;
+ let bbox;
+ let neighbors;
+ let neighborLength;
+ let neighborIndex;
+ let neighborPoint;
+ let ids;
+ let numPoints;
+ let collection;
+ let collectionIndex;
+ const index = new KDBush(points, getX, getY, 64, Int32Array);
+ if (currentHeight < previousHeight) {
+ length3 = clusters.length;
+ for (i = 0; i < length3; ++i) {
+ const cluster = clusters[i];
+ if (!occluder.isPointVisible(cluster.position)) {
+ continue;
+ }
+ const coord = Billboard_default._computeScreenSpacePosition(
+ Matrix4_default.IDENTITY,
+ cluster.position,
+ Cartesian3_default.ZERO,
+ Cartesian2_default.ZERO,
+ scene
+ );
+ if (!defined_default(coord)) {
+ continue;
+ }
+ const factor2 = 1 - currentHeight / previousHeight;
+ let width = cluster.width = cluster.width * factor2;
+ let height = cluster.height = cluster.height * factor2;
+ width = Math.max(width, cluster.minimumWidth);
+ height = Math.max(height, cluster.minimumHeight);
+ const minX = coord.x - width * 0.5;
+ const minY = coord.y - height * 0.5;
+ const maxX = coord.x + width;
+ const maxY = coord.y + height;
+ neighbors = index.range(minX, minY, maxX, maxY);
+ neighborLength = neighbors.length;
+ numPoints = 0;
+ ids = [];
+ for (j = 0; j < neighborLength; ++j) {
+ neighborIndex = neighbors[j];
+ neighborPoint = points[neighborIndex];
+ if (!neighborPoint.clustered) {
+ ++numPoints;
+ collection = neighborPoint.collection;
+ collectionIndex = neighborPoint.index;
+ ids.push(collection.get(collectionIndex).id);
+ }
+ }
+ if (numPoints >= minimumClusterSize) {
+ addCluster(cluster.position, numPoints, ids, entityCluster);
+ newClusters.push(cluster);
+ for (j = 0; j < neighborLength; ++j) {
+ points[neighbors[j]].clustered = true;
+ }
+ }
+ }
+ }
+ length3 = points.length;
+ for (i = 0; i < length3; ++i) {
+ const point = points[i];
+ if (point.clustered) {
+ continue;
+ }
+ point.clustered = true;
+ collection = point.collection;
+ collectionIndex = point.index;
+ const item = collection.get(collectionIndex);
+ bbox = getBoundingBox(
+ item,
+ point.coord,
+ pixelRange,
+ entityCluster,
+ pointBoundinRectangleScratch
+ );
+ const totalBBox = BoundingRectangle_default.clone(
+ bbox,
+ totalBoundingRectangleScratch
+ );
+ neighbors = index.range(
+ bbox.x,
+ bbox.y,
+ bbox.x + bbox.width,
+ bbox.y + bbox.height
+ );
+ neighborLength = neighbors.length;
+ const clusterPosition = Cartesian3_default.clone(item.position);
+ numPoints = 1;
+ ids = [item.id];
+ for (j = 0; j < neighborLength; ++j) {
+ neighborIndex = neighbors[j];
+ neighborPoint = points[neighborIndex];
+ if (!neighborPoint.clustered) {
+ const neighborItem = neighborPoint.collection.get(
+ neighborPoint.index
+ );
+ const neighborBBox = getBoundingBox(
+ neighborItem,
+ neighborPoint.coord,
+ pixelRange,
+ entityCluster,
+ neighborBoundingRectangleScratch
+ );
+ Cartesian3_default.add(
+ neighborItem.position,
+ clusterPosition,
+ clusterPosition
+ );
+ BoundingRectangle_default.union(totalBBox, neighborBBox, totalBBox);
+ ++numPoints;
+ ids.push(neighborItem.id);
+ }
+ }
+ if (numPoints >= minimumClusterSize) {
+ const position = Cartesian3_default.multiplyByScalar(
+ clusterPosition,
+ 1 / numPoints,
+ clusterPosition
+ );
+ addCluster(position, numPoints, ids, entityCluster);
+ newClusters.push({
+ position,
+ width: totalBBox.width,
+ height: totalBBox.height,
+ minimumWidth: bbox.width,
+ minimumHeight: bbox.height
+ });
+ for (j = 0; j < neighborLength; ++j) {
+ points[neighbors[j]].clustered = true;
+ }
+ } else {
+ addNonClusteredItem(item, entityCluster);
+ }
+ }
+ if (clusteredLabelCollection.length === 0) {
+ clusteredLabelCollection.destroy();
+ entityCluster._clusterLabelCollection = void 0;
+ }
+ if (clusteredBillboardCollection.length === 0) {
+ clusteredBillboardCollection.destroy();
+ entityCluster._clusterBillboardCollection = void 0;
+ }
+ if (clusteredPointCollection.length === 0) {
+ clusteredPointCollection.destroy();
+ entityCluster._clusterPointCollection = void 0;
+ }
+ entityCluster._previousClusters = newClusters;
+ entityCluster._previousHeight = currentHeight;
+ };
+}
+EntityCluster.prototype._initialize = function(scene) {
+ this._scene = scene;
+ const cluster = createDeclutterCallback(this);
+ this._cluster = cluster;
+ this._removeEventListener = scene.camera.changed.addEventListener(cluster);
+};
+Object.defineProperties(EntityCluster.prototype, {
+ enabled: {
+ get: function() {
+ return this._enabled;
+ },
+ set: function(value) {
+ this._enabledDirty = value !== this._enabled;
+ this._enabled = value;
+ }
+ },
+ pixelRange: {
+ get: function() {
+ return this._pixelRange;
+ },
+ set: function(value) {
+ this._clusterDirty = this._clusterDirty || value !== this._pixelRange;
+ this._pixelRange = value;
+ }
+ },
+ minimumClusterSize: {
+ get: function() {
+ return this._minimumClusterSize;
+ },
+ set: function(value) {
+ this._clusterDirty = this._clusterDirty || value !== this._minimumClusterSize;
+ this._minimumClusterSize = value;
+ }
+ },
+ clusterEvent: {
+ get: function() {
+ return this._clusterEvent;
+ }
+ },
+ clusterBillboards: {
+ get: function() {
+ return this._clusterBillboards;
+ },
+ set: function(value) {
+ this._clusterDirty = this._clusterDirty || value !== this._clusterBillboards;
+ this._clusterBillboards = value;
+ }
+ },
+ clusterLabels: {
+ get: function() {
+ return this._clusterLabels;
+ },
+ set: function(value) {
+ this._clusterDirty = this._clusterDirty || value !== this._clusterLabels;
+ this._clusterLabels = value;
+ }
+ },
+ clusterPoints: {
+ get: function() {
+ return this._clusterPoints;
+ },
+ set: function(value) {
+ this._clusterDirty = this._clusterDirty || value !== this._clusterPoints;
+ this._clusterPoints = value;
+ }
+ }
+});
+function createGetEntity(collectionProperty, CollectionConstructor, unusedIndicesProperty, entityIndexProperty) {
+ return function(entity) {
+ let collection = this[collectionProperty];
+ if (!defined_default(this._collectionIndicesByEntity)) {
+ this._collectionIndicesByEntity = {};
+ }
+ let entityIndices = this._collectionIndicesByEntity[entity.id];
+ if (!defined_default(entityIndices)) {
+ entityIndices = this._collectionIndicesByEntity[entity.id] = {
+ billboardIndex: void 0,
+ labelIndex: void 0,
+ pointIndex: void 0
+ };
+ }
+ if (defined_default(collection) && defined_default(entityIndices[entityIndexProperty])) {
+ return collection.get(entityIndices[entityIndexProperty]);
+ }
+ if (!defined_default(collection)) {
+ collection = this[collectionProperty] = new CollectionConstructor({
+ scene: this._scene
+ });
+ }
+ let index;
+ let entityItem;
+ const unusedIndices = this[unusedIndicesProperty];
+ if (unusedIndices.length > 0) {
+ index = unusedIndices.pop();
+ entityItem = collection.get(index);
+ } else {
+ entityItem = collection.add();
+ index = collection.length - 1;
+ }
+ entityIndices[entityIndexProperty] = index;
+ const that = this;
+ Promise.resolve().then(function() {
+ that._clusterDirty = true;
+ });
+ return entityItem;
+ };
+}
+function removeEntityIndicesIfUnused(entityCluster, entityId) {
+ const indices2 = entityCluster._collectionIndicesByEntity[entityId];
+ if (!defined_default(indices2.billboardIndex) && !defined_default(indices2.labelIndex) && !defined_default(indices2.pointIndex)) {
+ delete entityCluster._collectionIndicesByEntity[entityId];
+ }
+}
+EntityCluster.prototype.getLabel = createGetEntity(
+ "_labelCollection",
+ LabelCollection_default,
+ "_unusedLabelIndices",
+ "labelIndex"
+);
+EntityCluster.prototype.removeLabel = function(entity) {
+ const entityIndices = this._collectionIndicesByEntity && this._collectionIndicesByEntity[entity.id];
+ if (!defined_default(this._labelCollection) || !defined_default(entityIndices) || !defined_default(entityIndices.labelIndex)) {
+ return;
+ }
+ const index = entityIndices.labelIndex;
+ entityIndices.labelIndex = void 0;
+ removeEntityIndicesIfUnused(this, entity.id);
+ const label = this._labelCollection.get(index);
+ label.show = false;
+ label.text = "";
+ label.id = void 0;
+ this._unusedLabelIndices.push(index);
+ this._clusterDirty = true;
+};
+EntityCluster.prototype.getBillboard = createGetEntity(
+ "_billboardCollection",
+ BillboardCollection_default,
+ "_unusedBillboardIndices",
+ "billboardIndex"
+);
+EntityCluster.prototype.removeBillboard = function(entity) {
+ const entityIndices = this._collectionIndicesByEntity && this._collectionIndicesByEntity[entity.id];
+ if (!defined_default(this._billboardCollection) || !defined_default(entityIndices) || !defined_default(entityIndices.billboardIndex)) {
+ return;
+ }
+ const index = entityIndices.billboardIndex;
+ entityIndices.billboardIndex = void 0;
+ removeEntityIndicesIfUnused(this, entity.id);
+ const billboard = this._billboardCollection.get(index);
+ billboard.id = void 0;
+ billboard.show = false;
+ billboard.image = void 0;
+ this._unusedBillboardIndices.push(index);
+ this._clusterDirty = true;
+};
+EntityCluster.prototype.getPoint = createGetEntity(
+ "_pointCollection",
+ PointPrimitiveCollection_default,
+ "_unusedPointIndices",
+ "pointIndex"
+);
+EntityCluster.prototype.removePoint = function(entity) {
+ const entityIndices = this._collectionIndicesByEntity && this._collectionIndicesByEntity[entity.id];
+ if (!defined_default(this._pointCollection) || !defined_default(entityIndices) || !defined_default(entityIndices.pointIndex)) {
+ return;
+ }
+ const index = entityIndices.pointIndex;
+ entityIndices.pointIndex = void 0;
+ removeEntityIndicesIfUnused(this, entity.id);
+ const point = this._pointCollection.get(index);
+ point.show = false;
+ point.id = void 0;
+ this._unusedPointIndices.push(index);
+ this._clusterDirty = true;
+};
+function disableCollectionClustering(collection) {
+ if (!defined_default(collection)) {
+ return;
+ }
+ const length3 = collection.length;
+ for (let i = 0; i < length3; ++i) {
+ collection.get(i).clusterShow = true;
+ }
+}
+function updateEnable(entityCluster) {
+ if (entityCluster.enabled) {
+ return;
+ }
+ if (defined_default(entityCluster._clusterLabelCollection)) {
+ entityCluster._clusterLabelCollection.destroy();
+ }
+ if (defined_default(entityCluster._clusterBillboardCollection)) {
+ entityCluster._clusterBillboardCollection.destroy();
+ }
+ if (defined_default(entityCluster._clusterPointCollection)) {
+ entityCluster._clusterPointCollection.destroy();
+ }
+ entityCluster._clusterLabelCollection = void 0;
+ entityCluster._clusterBillboardCollection = void 0;
+ entityCluster._clusterPointCollection = void 0;
+ disableCollectionClustering(entityCluster._labelCollection);
+ disableCollectionClustering(entityCluster._billboardCollection);
+ disableCollectionClustering(entityCluster._pointCollection);
+}
+EntityCluster.prototype.update = function(frameState) {
+ if (!this.show) {
+ return;
+ }
+ let commandList;
+ if (defined_default(this._labelCollection) && this._labelCollection.length > 0 && this._labelCollection.get(0)._glyphs.length === 0) {
+ commandList = frameState.commandList;
+ frameState.commandList = [];
+ this._labelCollection.update(frameState);
+ frameState.commandList = commandList;
+ }
+ if (defined_default(this._billboardCollection) && this._billboardCollection.length > 0 && !defined_default(this._billboardCollection.get(0).width)) {
+ commandList = frameState.commandList;
+ frameState.commandList = [];
+ this._billboardCollection.update(frameState);
+ frameState.commandList = commandList;
+ }
+ if (this._enabledDirty) {
+ this._enabledDirty = false;
+ updateEnable(this);
+ this._clusterDirty = true;
+ }
+ if (this._clusterDirty) {
+ this._clusterDirty = false;
+ this._cluster();
+ }
+ if (defined_default(this._clusterLabelCollection)) {
+ this._clusterLabelCollection.update(frameState);
+ }
+ if (defined_default(this._clusterBillboardCollection)) {
+ this._clusterBillboardCollection.update(frameState);
+ }
+ if (defined_default(this._clusterPointCollection)) {
+ this._clusterPointCollection.update(frameState);
+ }
+ if (defined_default(this._labelCollection)) {
+ this._labelCollection.update(frameState);
+ }
+ if (defined_default(this._billboardCollection)) {
+ this._billboardCollection.update(frameState);
+ }
+ if (defined_default(this._pointCollection)) {
+ this._pointCollection.update(frameState);
+ }
+};
+EntityCluster.prototype.destroy = function() {
+ this._labelCollection = this._labelCollection && this._labelCollection.destroy();
+ this._billboardCollection = this._billboardCollection && this._billboardCollection.destroy();
+ this._pointCollection = this._pointCollection && this._pointCollection.destroy();
+ this._clusterLabelCollection = this._clusterLabelCollection && this._clusterLabelCollection.destroy();
+ this._clusterBillboardCollection = this._clusterBillboardCollection && this._clusterBillboardCollection.destroy();
+ this._clusterPointCollection = this._clusterPointCollection && this._clusterPointCollection.destroy();
+ if (defined_default(this._removeEventListener)) {
+ this._removeEventListener();
+ this._removeEventListener = void 0;
+ }
+ this._labelCollection = void 0;
+ this._billboardCollection = void 0;
+ this._pointCollection = void 0;
+ this._clusterBillboardCollection = void 0;
+ this._clusterLabelCollection = void 0;
+ this._clusterPointCollection = void 0;
+ this._collectionIndicesByEntity = void 0;
+ this._unusedLabelIndices = [];
+ this._unusedBillboardIndices = [];
+ this._unusedPointIndices = [];
+ this._previousClusters = [];
+ this._previousHeight = void 0;
+ this._enabledDirty = false;
+ this._pixelRangeDirty = false;
+ this._minimumClusterSizeDirty = false;
+ return void 0;
+};
+var EntityCluster_default = EntityCluster;
+
+// Source/DataSources/CustomDataSource.js
+function CustomDataSource(name) {
+ this._name = name;
+ this._clock = void 0;
+ this._changed = new Event_default();
+ this._error = new Event_default();
+ this._isLoading = false;
+ this._loading = new Event_default();
+ this._entityCollection = new EntityCollection_default(this);
+ this._entityCluster = new EntityCluster_default();
+}
+Object.defineProperties(CustomDataSource.prototype, {
+ name: {
+ get: function() {
+ return this._name;
+ },
+ set: function(value) {
+ if (this._name !== value) {
+ this._name = value;
+ this._changed.raiseEvent(this);
+ }
+ }
+ },
+ clock: {
+ get: function() {
+ return this._clock;
+ },
+ set: function(value) {
+ if (this._clock !== value) {
+ this._clock = value;
+ this._changed.raiseEvent(this);
+ }
+ }
+ },
+ entities: {
+ get: function() {
+ return this._entityCollection;
+ }
+ },
+ isLoading: {
+ get: function() {
+ return this._isLoading;
+ },
+ set: function(value) {
+ DataSource_default.setLoading(this, value);
+ }
+ },
+ changedEvent: {
+ get: function() {
+ return this._changed;
+ }
+ },
+ errorEvent: {
+ get: function() {
+ return this._error;
+ }
+ },
+ loadingEvent: {
+ get: function() {
+ return this._loading;
+ }
+ },
+ show: {
+ get: function() {
+ return this._entityCollection.show;
+ },
+ set: function(value) {
+ this._entityCollection.show = value;
+ }
+ },
+ clustering: {
+ get: function() {
+ return this._entityCluster;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value must be defined.");
+ }
+ this._entityCluster = value;
+ }
+ }
+});
+CustomDataSource.prototype.update = function(time) {
+ return true;
+};
+var CustomDataSource_default = CustomDataSource;
+
+// Source/Core/CylinderGeometryLibrary.js
+var CylinderGeometryLibrary = {};
+CylinderGeometryLibrary.computePositions = function(length3, topRadius, bottomRadius, slices, fill) {
+ const topZ = length3 * 0.5;
+ const bottomZ = -topZ;
+ const twoSlice = slices + slices;
+ const size = fill ? 2 * twoSlice : twoSlice;
+ const positions = new Float64Array(size * 3);
+ let i;
+ let index = 0;
+ let tbIndex = 0;
+ const bottomOffset = fill ? twoSlice * 3 : 0;
+ const topOffset = fill ? (twoSlice + slices) * 3 : slices * 3;
+ for (i = 0; i < slices; i++) {
+ const angle = i / slices * Math_default.TWO_PI;
+ const x = Math.cos(angle);
+ const y = Math.sin(angle);
+ const bottomX = x * bottomRadius;
+ const bottomY = y * bottomRadius;
+ const topX = x * topRadius;
+ const topY = y * topRadius;
+ positions[tbIndex + bottomOffset] = bottomX;
+ positions[tbIndex + bottomOffset + 1] = bottomY;
+ positions[tbIndex + bottomOffset + 2] = bottomZ;
+ positions[tbIndex + topOffset] = topX;
+ positions[tbIndex + topOffset + 1] = topY;
+ positions[tbIndex + topOffset + 2] = topZ;
+ tbIndex += 3;
+ if (fill) {
+ positions[index++] = bottomX;
+ positions[index++] = bottomY;
+ positions[index++] = bottomZ;
+ positions[index++] = topX;
+ positions[index++] = topY;
+ positions[index++] = topZ;
+ }
+ }
+ return positions;
+};
+var CylinderGeometryLibrary_default = CylinderGeometryLibrary;
+
+// Source/Core/CylinderGeometry.js
+var radiusScratch = new Cartesian2_default();
+var normalScratch3 = new Cartesian3_default();
+var bitangentScratch = new Cartesian3_default();
+var tangentScratch = new Cartesian3_default();
+var positionScratch8 = new Cartesian3_default();
+function CylinderGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const length3 = options.length;
+ const topRadius = options.topRadius;
+ const bottomRadius = options.bottomRadius;
+ const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
+ const slices = defaultValue_default(options.slices, 128);
+ if (!defined_default(length3)) {
+ throw new DeveloperError_default("options.length must be defined.");
+ }
+ if (!defined_default(topRadius)) {
+ throw new DeveloperError_default("options.topRadius must be defined.");
+ }
+ if (!defined_default(bottomRadius)) {
+ throw new DeveloperError_default("options.bottomRadius must be defined.");
+ }
+ if (slices < 3) {
+ throw new DeveloperError_default(
+ "options.slices must be greater than or equal to 3."
+ );
+ }
+ if (defined_default(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ throw new DeveloperError_default(
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
+ );
+ }
+ this._length = length3;
+ this._topRadius = topRadius;
+ this._bottomRadius = bottomRadius;
+ this._vertexFormat = VertexFormat_default.clone(vertexFormat);
+ this._slices = slices;
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createCylinderGeometry";
+}
+CylinderGeometry.packedLength = VertexFormat_default.packedLength + 5;
+CylinderGeometry.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat_default.packedLength;
+ array[startingIndex++] = value._length;
+ array[startingIndex++] = value._topRadius;
+ array[startingIndex++] = value._bottomRadius;
+ array[startingIndex++] = value._slices;
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchVertexFormat3 = new VertexFormat_default();
+var scratchOptions9 = {
+ vertexFormat: scratchVertexFormat3,
+ length: void 0,
+ topRadius: void 0,
+ bottomRadius: void 0,
+ slices: void 0,
+ offsetAttribute: void 0
+};
+CylinderGeometry.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat3
+ );
+ startingIndex += VertexFormat_default.packedLength;
+ const length3 = array[startingIndex++];
+ const topRadius = array[startingIndex++];
+ const bottomRadius = array[startingIndex++];
+ const slices = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions9.length = length3;
+ scratchOptions9.topRadius = topRadius;
+ scratchOptions9.bottomRadius = bottomRadius;
+ scratchOptions9.slices = slices;
+ scratchOptions9.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new CylinderGeometry(scratchOptions9);
+ }
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._length = length3;
+ result._topRadius = topRadius;
+ result._bottomRadius = bottomRadius;
+ result._slices = slices;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+CylinderGeometry.createGeometry = function(cylinderGeometry) {
+ let length3 = cylinderGeometry._length;
+ const topRadius = cylinderGeometry._topRadius;
+ const bottomRadius = cylinderGeometry._bottomRadius;
+ const vertexFormat = cylinderGeometry._vertexFormat;
+ const slices = cylinderGeometry._slices;
+ if (length3 <= 0 || topRadius < 0 || bottomRadius < 0 || topRadius === 0 && bottomRadius === 0) {
+ return;
+ }
+ const twoSlices = slices + slices;
+ const threeSlices = slices + twoSlices;
+ const numVertices = twoSlices + twoSlices;
+ const positions = CylinderGeometryLibrary_default.computePositions(
+ length3,
+ topRadius,
+ bottomRadius,
+ slices,
+ true
+ );
+ const st = vertexFormat.st ? new Float32Array(numVertices * 2) : void 0;
+ const normals = vertexFormat.normal ? new Float32Array(numVertices * 3) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(numVertices * 3) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(numVertices * 3) : void 0;
+ let i;
+ const computeNormal = vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent;
+ if (computeNormal) {
+ const computeTangent = vertexFormat.tangent || vertexFormat.bitangent;
+ let normalIndex = 0;
+ let tangentIndex = 0;
+ let bitangentIndex = 0;
+ const theta = Math.atan2(bottomRadius - topRadius, length3);
+ const normal2 = normalScratch3;
+ normal2.z = Math.sin(theta);
+ const normalScale2 = Math.cos(theta);
+ let tangent = tangentScratch;
+ let bitangent = bitangentScratch;
+ for (i = 0; i < slices; i++) {
+ const angle = i / slices * Math_default.TWO_PI;
+ const x = normalScale2 * Math.cos(angle);
+ const y = normalScale2 * Math.sin(angle);
+ if (computeNormal) {
+ normal2.x = x;
+ normal2.y = y;
+ if (computeTangent) {
+ tangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal2, tangent),
+ tangent
+ );
+ }
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = normal2.x;
+ normals[normalIndex++] = normal2.y;
+ normals[normalIndex++] = normal2.z;
+ normals[normalIndex++] = normal2.x;
+ normals[normalIndex++] = normal2.y;
+ normals[normalIndex++] = normal2.z;
+ }
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ }
+ if (vertexFormat.bitangent) {
+ bitangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(normal2, tangent, bitangent),
+ bitangent
+ );
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ }
+ }
+ }
+ for (i = 0; i < slices; i++) {
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = 0;
+ normals[normalIndex++] = 0;
+ normals[normalIndex++] = -1;
+ }
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = 1;
+ tangents[tangentIndex++] = 0;
+ tangents[tangentIndex++] = 0;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents[bitangentIndex++] = 0;
+ bitangents[bitangentIndex++] = -1;
+ bitangents[bitangentIndex++] = 0;
+ }
+ }
+ for (i = 0; i < slices; i++) {
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = 0;
+ normals[normalIndex++] = 0;
+ normals[normalIndex++] = 1;
+ }
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = 1;
+ tangents[tangentIndex++] = 0;
+ tangents[tangentIndex++] = 0;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents[bitangentIndex++] = 0;
+ bitangents[bitangentIndex++] = 1;
+ bitangents[bitangentIndex++] = 0;
+ }
+ }
+ }
+ const numIndices = 12 * slices - 12;
+ const indices2 = IndexDatatype_default.createTypedArray(numVertices, numIndices);
+ let index = 0;
+ let j = 0;
+ for (i = 0; i < slices - 1; i++) {
+ indices2[index++] = j;
+ indices2[index++] = j + 2;
+ indices2[index++] = j + 3;
+ indices2[index++] = j;
+ indices2[index++] = j + 3;
+ indices2[index++] = j + 1;
+ j += 2;
+ }
+ indices2[index++] = twoSlices - 2;
+ indices2[index++] = 0;
+ indices2[index++] = 1;
+ indices2[index++] = twoSlices - 2;
+ indices2[index++] = 1;
+ indices2[index++] = twoSlices - 1;
+ for (i = 1; i < slices - 1; i++) {
+ indices2[index++] = twoSlices + i + 1;
+ indices2[index++] = twoSlices + i;
+ indices2[index++] = twoSlices;
+ }
+ for (i = 1; i < slices - 1; i++) {
+ indices2[index++] = threeSlices;
+ indices2[index++] = threeSlices + i;
+ indices2[index++] = threeSlices + i + 1;
+ }
+ let textureCoordIndex = 0;
+ if (vertexFormat.st) {
+ const rad = Math.max(topRadius, bottomRadius);
+ for (i = 0; i < numVertices; i++) {
+ const position = Cartesian3_default.fromArray(positions, i * 3, positionScratch8);
+ st[textureCoordIndex++] = (position.x + rad) / (2 * rad);
+ st[textureCoordIndex++] = (position.y + rad) / (2 * rad);
+ }
+ }
+ const attributes = new GeometryAttributes_default();
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ }
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals
+ });
+ }
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents
+ });
+ }
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: st
+ });
+ }
+ radiusScratch.x = length3 * 0.5;
+ radiusScratch.y = Math.max(bottomRadius, topRadius);
+ const boundingSphere = new BoundingSphere_default(
+ Cartesian3_default.ZERO,
+ Cartesian2_default.magnitude(radiusScratch)
+ );
+ if (defined_default(cylinderGeometry._offsetAttribute)) {
+ length3 = positions.length;
+ const offsetValue = cylinderGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.TRIANGLES,
+ boundingSphere,
+ offsetAttribute: cylinderGeometry._offsetAttribute
+ });
+};
+var unitCylinderGeometry;
+CylinderGeometry.getUnitCylinder = function() {
+ if (!defined_default(unitCylinderGeometry)) {
+ unitCylinderGeometry = CylinderGeometry.createGeometry(
+ new CylinderGeometry({
+ topRadius: 1,
+ bottomRadius: 1,
+ length: 1,
+ vertexFormat: VertexFormat_default.POSITION_ONLY
+ })
+ );
+ }
+ return unitCylinderGeometry;
+};
+var CylinderGeometry_default = CylinderGeometry;
+
+// Source/Core/CylinderOutlineGeometry.js
+var radiusScratch2 = new Cartesian2_default();
+function CylinderOutlineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const length3 = options.length;
+ const topRadius = options.topRadius;
+ const bottomRadius = options.bottomRadius;
+ const slices = defaultValue_default(options.slices, 128);
+ const numberOfVerticalLines = Math.max(
+ defaultValue_default(options.numberOfVerticalLines, 16),
+ 0
+ );
+ Check_default.typeOf.number("options.positions", length3);
+ Check_default.typeOf.number("options.topRadius", topRadius);
+ Check_default.typeOf.number("options.bottomRadius", bottomRadius);
+ Check_default.typeOf.number.greaterThanOrEquals("options.slices", slices, 3);
+ if (defined_default(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ throw new DeveloperError_default(
+ "GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
+ );
+ }
+ this._length = length3;
+ this._topRadius = topRadius;
+ this._bottomRadius = bottomRadius;
+ this._slices = slices;
+ this._numberOfVerticalLines = numberOfVerticalLines;
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createCylinderOutlineGeometry";
+}
+CylinderOutlineGeometry.packedLength = 6;
+CylinderOutlineGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex++] = value._length;
+ array[startingIndex++] = value._topRadius;
+ array[startingIndex++] = value._bottomRadius;
+ array[startingIndex++] = value._slices;
+ array[startingIndex++] = value._numberOfVerticalLines;
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchOptions10 = {
+ length: void 0,
+ topRadius: void 0,
+ bottomRadius: void 0,
+ slices: void 0,
+ numberOfVerticalLines: void 0,
+ offsetAttribute: void 0
+};
+CylinderOutlineGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const length3 = array[startingIndex++];
+ const topRadius = array[startingIndex++];
+ const bottomRadius = array[startingIndex++];
+ const slices = array[startingIndex++];
+ const numberOfVerticalLines = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions10.length = length3;
+ scratchOptions10.topRadius = topRadius;
+ scratchOptions10.bottomRadius = bottomRadius;
+ scratchOptions10.slices = slices;
+ scratchOptions10.numberOfVerticalLines = numberOfVerticalLines;
+ scratchOptions10.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new CylinderOutlineGeometry(scratchOptions10);
+ }
+ result._length = length3;
+ result._topRadius = topRadius;
+ result._bottomRadius = bottomRadius;
+ result._slices = slices;
+ result._numberOfVerticalLines = numberOfVerticalLines;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+CylinderOutlineGeometry.createGeometry = function(cylinderGeometry) {
+ let length3 = cylinderGeometry._length;
+ const topRadius = cylinderGeometry._topRadius;
+ const bottomRadius = cylinderGeometry._bottomRadius;
+ const slices = cylinderGeometry._slices;
+ const numberOfVerticalLines = cylinderGeometry._numberOfVerticalLines;
+ if (length3 <= 0 || topRadius < 0 || bottomRadius < 0 || topRadius === 0 && bottomRadius === 0) {
+ return;
+ }
+ const numVertices = slices * 2;
+ const positions = CylinderGeometryLibrary_default.computePositions(
+ length3,
+ topRadius,
+ bottomRadius,
+ slices,
+ false
+ );
+ let numIndices = slices * 2;
+ let numSide;
+ if (numberOfVerticalLines > 0) {
+ const numSideLines = Math.min(numberOfVerticalLines, slices);
+ numSide = Math.round(slices / numSideLines);
+ numIndices += numSideLines;
+ }
+ const indices2 = IndexDatatype_default.createTypedArray(numVertices, numIndices * 2);
+ let index = 0;
+ let i;
+ for (i = 0; i < slices - 1; i++) {
+ indices2[index++] = i;
+ indices2[index++] = i + 1;
+ indices2[index++] = i + slices;
+ indices2[index++] = i + 1 + slices;
+ }
+ indices2[index++] = slices - 1;
+ indices2[index++] = 0;
+ indices2[index++] = slices + slices - 1;
+ indices2[index++] = slices;
+ if (numberOfVerticalLines > 0) {
+ for (i = 0; i < slices; i += numSide) {
+ indices2[index++] = i;
+ indices2[index++] = i + slices;
+ }
+ }
+ const attributes = new GeometryAttributes_default();
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ radiusScratch2.x = length3 * 0.5;
+ radiusScratch2.y = Math.max(bottomRadius, topRadius);
+ const boundingSphere = new BoundingSphere_default(
+ Cartesian3_default.ZERO,
+ Cartesian2_default.magnitude(radiusScratch2)
+ );
+ if (defined_default(cylinderGeometry._offsetAttribute)) {
+ length3 = positions.length;
+ const offsetValue = cylinderGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.LINES,
+ boundingSphere,
+ offsetAttribute: cylinderGeometry._offsetAttribute
+ });
+};
+var CylinderOutlineGeometry_default = CylinderOutlineGeometry;
+
+// Source/DataSources/CylinderGeometryUpdater.js
+var defaultOffset3 = Cartesian3_default.ZERO;
+var offsetScratch6 = new Cartesian3_default();
+var positionScratch9 = new Cartesian3_default();
+var scratchColor12 = new Color_default();
+function CylinderGeometryOptions(entity) {
+ this.id = entity;
+ this.vertexFormat = void 0;
+ this.length = void 0;
+ this.topRadius = void 0;
+ this.bottomRadius = void 0;
+ this.slices = void 0;
+ this.numberOfVerticalLines = void 0;
+ this.offsetAttribute = void 0;
+}
+function CylinderGeometryUpdater(entity, scene) {
+ GeometryUpdater_default.call(this, {
+ entity,
+ scene,
+ geometryOptions: new CylinderGeometryOptions(entity),
+ geometryPropertyName: "cylinder",
+ observedPropertyNames: [
+ "availability",
+ "position",
+ "orientation",
+ "cylinder"
+ ]
+ });
+ this._onEntityPropertyChanged(entity, "cylinder", entity.cylinder, void 0);
+}
+if (defined_default(Object.create)) {
+ CylinderGeometryUpdater.prototype = Object.create(GeometryUpdater_default.prototype);
+ CylinderGeometryUpdater.prototype.constructor = CylinderGeometryUpdater;
+}
+Object.defineProperties(CylinderGeometryUpdater.prototype, {
+ terrainOffsetProperty: {
+ get: function() {
+ return this._terrainOffsetProperty;
+ }
+ }
+});
+CylinderGeometryUpdater.prototype.createFillGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._fillEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent a filled geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const show = new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time)
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ );
+ const attributes = {
+ show,
+ distanceDisplayCondition: distanceDisplayConditionAttribute,
+ color: void 0,
+ offset: void 0
+ };
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ let currentColor;
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor12);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ attributes.color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ }
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset3,
+ offsetScratch6
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new CylinderGeometry_default(this._options),
+ modelMatrix: entity.computeModelMatrixForHeightReference(
+ time,
+ entity.cylinder.heightReference,
+ this._options.length * 0.5,
+ this._scene.mapProjection.ellipsoid
+ ),
+ attributes
+ });
+};
+CylinderGeometryUpdater.prototype.createOutlineGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._outlineEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent an outlined geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const outlineColor = Property_default.getValueOrDefault(
+ this._outlineColorProperty,
+ time,
+ Color_default.BLACK,
+ scratchColor12
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)
+ ),
+ color: ColorGeometryInstanceAttribute_default.fromColor(outlineColor),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ ),
+ offset: void 0
+ };
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset3,
+ offsetScratch6
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new CylinderOutlineGeometry_default(this._options),
+ modelMatrix: entity.computeModelMatrixForHeightReference(
+ time,
+ entity.cylinder.heightReference,
+ this._options.length * 0.5,
+ this._scene.mapProjection.ellipsoid
+ ),
+ attributes
+ });
+};
+CylinderGeometryUpdater.prototype._computeCenter = function(time, result) {
+ return Property_default.getValueOrUndefined(this._entity.position, time, result);
+};
+CylinderGeometryUpdater.prototype._isHidden = function(entity, cylinder) {
+ return !defined_default(entity.position) || !defined_default(cylinder.length) || !defined_default(cylinder.topRadius) || !defined_default(cylinder.bottomRadius) || GeometryUpdater_default.prototype._isHidden.call(this, entity, cylinder);
+};
+CylinderGeometryUpdater.prototype._isDynamic = function(entity, cylinder) {
+ return !entity.position.isConstant || !Property_default.isConstant(entity.orientation) || !cylinder.length.isConstant || !cylinder.topRadius.isConstant || !cylinder.bottomRadius.isConstant || !Property_default.isConstant(cylinder.slices) || !Property_default.isConstant(cylinder.outlineWidth) || !Property_default.isConstant(cylinder.numberOfVerticalLines);
+};
+CylinderGeometryUpdater.prototype._setStaticOptions = function(entity, cylinder) {
+ const heightReference = Property_default.getValueOrDefault(
+ cylinder.heightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ const options = this._options;
+ options.vertexFormat = this._materialProperty instanceof ColorMaterialProperty_default ? PerInstanceColorAppearance_default.VERTEX_FORMAT : MaterialAppearance_default.MaterialSupport.TEXTURED.vertexFormat;
+ options.length = cylinder.length.getValue(Iso8601_default.MINIMUM_VALUE);
+ options.topRadius = cylinder.topRadius.getValue(Iso8601_default.MINIMUM_VALUE);
+ options.bottomRadius = cylinder.bottomRadius.getValue(Iso8601_default.MINIMUM_VALUE);
+ options.slices = Property_default.getValueOrUndefined(
+ cylinder.slices,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.numberOfVerticalLines = Property_default.getValueOrUndefined(
+ cylinder.numberOfVerticalLines,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.offsetAttribute = heightReference !== HeightReference_default.NONE ? GeometryOffsetAttribute_default.ALL : void 0;
+};
+CylinderGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged_default;
+CylinderGeometryUpdater.DynamicGeometryUpdater = DynamicCylinderGeometryUpdater;
+function DynamicCylinderGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
+ DynamicGeometryUpdater_default.call(
+ this,
+ geometryUpdater,
+ primitives,
+ groundPrimitives
+ );
+}
+if (defined_default(Object.create)) {
+ DynamicCylinderGeometryUpdater.prototype = Object.create(
+ DynamicGeometryUpdater_default.prototype
+ );
+ DynamicCylinderGeometryUpdater.prototype.constructor = DynamicCylinderGeometryUpdater;
+}
+DynamicCylinderGeometryUpdater.prototype._isHidden = function(entity, cylinder, time) {
+ const options = this._options;
+ const position = Property_default.getValueOrUndefined(
+ entity.position,
+ time,
+ positionScratch9
+ );
+ return !defined_default(position) || !defined_default(options.length) || !defined_default(options.topRadius) || !defined_default(options.bottomRadius) || DynamicGeometryUpdater_default.prototype._isHidden.call(
+ this,
+ entity,
+ cylinder,
+ time
+ );
+};
+DynamicCylinderGeometryUpdater.prototype._setOptions = function(entity, cylinder, time) {
+ const heightReference = Property_default.getValueOrDefault(
+ cylinder.heightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ const options = this._options;
+ options.length = Property_default.getValueOrUndefined(cylinder.length, time);
+ options.topRadius = Property_default.getValueOrUndefined(cylinder.topRadius, time);
+ options.bottomRadius = Property_default.getValueOrUndefined(
+ cylinder.bottomRadius,
+ time
+ );
+ options.slices = Property_default.getValueOrUndefined(cylinder.slices, time);
+ options.numberOfVerticalLines = Property_default.getValueOrUndefined(
+ cylinder.numberOfVerticalLines,
+ time
+ );
+ options.offsetAttribute = heightReference !== HeightReference_default.NONE ? GeometryOffsetAttribute_default.ALL : void 0;
+};
+var CylinderGeometryUpdater_default = CylinderGeometryUpdater;
+
+// Source/Core/ClockRange.js
+var ClockRange = {
+ UNBOUNDED: 0,
+ CLAMPED: 1,
+ LOOP_STOP: 2
+};
+var ClockRange_default = Object.freeze(ClockRange);
+
+// Source/Core/ClockStep.js
+var ClockStep = {
+ TICK_DEPENDENT: 0,
+ SYSTEM_CLOCK_MULTIPLIER: 1,
+ SYSTEM_CLOCK: 2
+};
+var ClockStep_default = Object.freeze(ClockStep);
+
+// Source/Core/ExtrapolationType.js
+var ExtrapolationType = {
+ NONE: 0,
+ HOLD: 1,
+ EXTRAPOLATE: 2
+};
+var ExtrapolationType_default = Object.freeze(ExtrapolationType);
+
+// Source/Core/getFilenameFromUri.js
+var import_urijs8 = __toESM(require_URI(), 1);
+function getFilenameFromUri(uri) {
+ if (!defined_default(uri)) {
+ throw new DeveloperError_default("uri is required.");
+ }
+ const uriObject = new import_urijs8.default(uri);
+ uriObject.normalize();
+ let path = uriObject.path();
+ const index = path.lastIndexOf("/");
+ if (index !== -1) {
+ path = path.substr(index + 1);
+ }
+ return path;
+}
+var getFilenameFromUri_default = getFilenameFromUri;
+
+// Source/Core/HermitePolynomialApproximation.js
+var factorial = Math_default.factorial;
+function calculateCoefficientTerm(x, zIndices, xTable, derivOrder, termOrder, reservedIndices) {
+ let result = 0;
+ let reserved;
+ let i;
+ let j;
+ if (derivOrder > 0) {
+ for (i = 0; i < termOrder; i++) {
+ reserved = false;
+ for (j = 0; j < reservedIndices.length && !reserved; j++) {
+ if (i === reservedIndices[j]) {
+ reserved = true;
+ }
+ }
+ if (!reserved) {
+ reservedIndices.push(i);
+ result += calculateCoefficientTerm(
+ x,
+ zIndices,
+ xTable,
+ derivOrder - 1,
+ termOrder,
+ reservedIndices
+ );
+ reservedIndices.splice(reservedIndices.length - 1, 1);
+ }
+ }
+ return result;
+ }
+ result = 1;
+ for (i = 0; i < termOrder; i++) {
+ reserved = false;
+ for (j = 0; j < reservedIndices.length && !reserved; j++) {
+ if (i === reservedIndices[j]) {
+ reserved = true;
+ }
+ }
+ if (!reserved) {
+ result *= x - xTable[zIndices[i]];
+ }
+ }
+ return result;
+}
+var HermitePolynomialApproximation = {
+ type: "Hermite"
+};
+HermitePolynomialApproximation.getRequiredDataPoints = function(degree, inputOrder) {
+ inputOrder = defaultValue_default(inputOrder, 0);
+ if (!defined_default(degree)) {
+ throw new DeveloperError_default("degree is required.");
+ }
+ if (degree < 0) {
+ throw new DeveloperError_default("degree must be 0 or greater.");
+ }
+ if (inputOrder < 0) {
+ throw new DeveloperError_default("inputOrder must be 0 or greater.");
+ }
+ return Math.max(Math.floor((degree + 1) / (inputOrder + 1)), 2);
+};
+HermitePolynomialApproximation.interpolateOrderZero = function(x, xTable, yTable, yStride, result) {
+ if (!defined_default(result)) {
+ result = new Array(yStride);
+ }
+ let i;
+ let j;
+ let d;
+ let s;
+ let len;
+ let index;
+ const length3 = xTable.length;
+ const coefficients = new Array(yStride);
+ for (i = 0; i < yStride; i++) {
+ result[i] = 0;
+ const l = new Array(length3);
+ coefficients[i] = l;
+ for (j = 0; j < length3; j++) {
+ l[j] = [];
+ }
+ }
+ const zIndicesLength = length3, zIndices = new Array(zIndicesLength);
+ for (i = 0; i < zIndicesLength; i++) {
+ zIndices[i] = i;
+ }
+ let highestNonZeroCoef = length3 - 1;
+ for (s = 0; s < yStride; s++) {
+ for (j = 0; j < zIndicesLength; j++) {
+ index = zIndices[j] * yStride + s;
+ coefficients[s][0].push(yTable[index]);
+ }
+ for (i = 1; i < zIndicesLength; i++) {
+ let nonZeroCoefficients = false;
+ for (j = 0; j < zIndicesLength - i; j++) {
+ const zj = xTable[zIndices[j]];
+ const zn = xTable[zIndices[j + i]];
+ let numerator;
+ if (zn - zj <= 0) {
+ index = zIndices[j] * yStride + yStride * i + s;
+ numerator = yTable[index];
+ coefficients[s][i].push(numerator / factorial(i));
+ } else {
+ numerator = coefficients[s][i - 1][j + 1] - coefficients[s][i - 1][j];
+ coefficients[s][i].push(numerator / (zn - zj));
+ }
+ nonZeroCoefficients = nonZeroCoefficients || numerator !== 0;
+ }
+ if (!nonZeroCoefficients) {
+ highestNonZeroCoef = i - 1;
+ }
+ }
+ }
+ for (d = 0, len = 0; d <= len; d++) {
+ for (i = d; i <= highestNonZeroCoef; i++) {
+ const tempTerm = calculateCoefficientTerm(x, zIndices, xTable, d, i, []);
+ for (s = 0; s < yStride; s++) {
+ const coeff = coefficients[s][i][0];
+ result[s + d * yStride] += coeff * tempTerm;
+ }
+ }
+ }
+ return result;
+};
+var arrayScratch = [];
+HermitePolynomialApproximation.interpolate = function(x, xTable, yTable, yStride, inputOrder, outputOrder, result) {
+ const resultLength = yStride * (outputOrder + 1);
+ if (!defined_default(result)) {
+ result = new Array(resultLength);
+ }
+ for (let r = 0; r < resultLength; r++) {
+ result[r] = 0;
+ }
+ const length3 = xTable.length;
+ const zIndices = new Array(length3 * (inputOrder + 1));
+ let i;
+ for (i = 0; i < length3; i++) {
+ for (let j = 0; j < inputOrder + 1; j++) {
+ zIndices[i * (inputOrder + 1) + j] = i;
+ }
+ }
+ const zIndiceslength = zIndices.length;
+ const coefficients = arrayScratch;
+ const highestNonZeroCoef = fillCoefficientList(
+ coefficients,
+ zIndices,
+ xTable,
+ yTable,
+ yStride,
+ inputOrder
+ );
+ const reservedIndices = [];
+ const tmp2 = zIndiceslength * (zIndiceslength + 1) / 2;
+ const loopStop = Math.min(highestNonZeroCoef, outputOrder);
+ for (let d = 0; d <= loopStop; d++) {
+ for (i = d; i <= highestNonZeroCoef; i++) {
+ reservedIndices.length = 0;
+ const tempTerm = calculateCoefficientTerm(
+ x,
+ zIndices,
+ xTable,
+ d,
+ i,
+ reservedIndices
+ );
+ const dimTwo = Math.floor(i * (1 - i) / 2) + zIndiceslength * i;
+ for (let s = 0; s < yStride; s++) {
+ const dimOne = Math.floor(s * tmp2);
+ const coef = coefficients[dimOne + dimTwo];
+ result[s + d * yStride] += coef * tempTerm;
+ }
+ }
+ }
+ return result;
+};
+function fillCoefficientList(coefficients, zIndices, xTable, yTable, yStride, inputOrder) {
+ let j;
+ let index;
+ let highestNonZero = -1;
+ const zIndiceslength = zIndices.length;
+ const tmp2 = zIndiceslength * (zIndiceslength + 1) / 2;
+ for (let s = 0; s < yStride; s++) {
+ const dimOne = Math.floor(s * tmp2);
+ for (j = 0; j < zIndiceslength; j++) {
+ index = zIndices[j] * yStride * (inputOrder + 1) + s;
+ coefficients[dimOne + j] = yTable[index];
+ }
+ for (let i = 1; i < zIndiceslength; i++) {
+ let coefIndex = 0;
+ const dimTwo = Math.floor(i * (1 - i) / 2) + zIndiceslength * i;
+ let nonZeroCoefficients = false;
+ for (j = 0; j < zIndiceslength - i; j++) {
+ const zj = xTable[zIndices[j]];
+ const zn = xTable[zIndices[j + i]];
+ let numerator;
+ let coefficient;
+ if (zn - zj <= 0) {
+ index = zIndices[j] * yStride * (inputOrder + 1) + yStride * i + s;
+ numerator = yTable[index];
+ coefficient = numerator / Math_default.factorial(i);
+ coefficients[dimOne + dimTwo + coefIndex] = coefficient;
+ coefIndex++;
+ } else {
+ const dimTwoMinusOne = Math.floor((i - 1) * (2 - i) / 2) + zIndiceslength * (i - 1);
+ numerator = coefficients[dimOne + dimTwoMinusOne + j + 1] - coefficients[dimOne + dimTwoMinusOne + j];
+ coefficient = numerator / (zn - zj);
+ coefficients[dimOne + dimTwo + coefIndex] = coefficient;
+ coefIndex++;
+ }
+ nonZeroCoefficients = nonZeroCoefficients || numerator !== 0;
+ }
+ if (nonZeroCoefficients) {
+ highestNonZero = Math.max(highestNonZero, i);
+ }
+ }
+ }
+ return highestNonZero;
+}
+var HermitePolynomialApproximation_default = HermitePolynomialApproximation;
+
+// Source/Core/LagrangePolynomialApproximation.js
+var LagrangePolynomialApproximation = {
+ type: "Lagrange"
+};
+LagrangePolynomialApproximation.getRequiredDataPoints = function(degree) {
+ return Math.max(degree + 1, 2);
+};
+LagrangePolynomialApproximation.interpolateOrderZero = function(x, xTable, yTable, yStride, result) {
+ if (!defined_default(result)) {
+ result = new Array(yStride);
+ }
+ let i;
+ let j;
+ const length3 = xTable.length;
+ for (i = 0; i < yStride; i++) {
+ result[i] = 0;
+ }
+ for (i = 0; i < length3; i++) {
+ let coefficient = 1;
+ for (j = 0; j < length3; j++) {
+ if (j !== i) {
+ const diffX = xTable[i] - xTable[j];
+ coefficient *= (x - xTable[j]) / diffX;
+ }
+ }
+ for (j = 0; j < yStride; j++) {
+ result[j] += coefficient * yTable[i * yStride + j];
+ }
+ }
+ return result;
+};
+var LagrangePolynomialApproximation_default = LagrangePolynomialApproximation;
+
+// Source/Core/LinearApproximation.js
+var LinearApproximation = {
+ type: "Linear"
+};
+LinearApproximation.getRequiredDataPoints = function(degree) {
+ return 2;
+};
+LinearApproximation.interpolateOrderZero = function(x, xTable, yTable, yStride, result) {
+ if (xTable.length !== 2) {
+ throw new DeveloperError_default(
+ "The xTable provided to the linear interpolator must have exactly two elements."
+ );
+ } else if (yStride <= 0) {
+ throw new DeveloperError_default(
+ "There must be at least 1 dependent variable for each independent variable."
+ );
+ }
+ if (!defined_default(result)) {
+ result = new Array(yStride);
+ }
+ let i;
+ let y0;
+ let y1;
+ const x0 = xTable[0];
+ const x1 = xTable[1];
+ if (x0 === x1) {
+ throw new DeveloperError_default(
+ "Divide by zero error: xTable[0] and xTable[1] are equal"
+ );
+ }
+ for (i = 0; i < yStride; i++) {
+ y0 = yTable[i];
+ y1 = yTable[i + yStride];
+ result[i] = ((y1 - y0) * x + x1 * y0 - x0 * y1) / (x1 - x0);
+ }
+ return result;
+};
+var LinearApproximation_default = LinearApproximation;
+
+// Source/Core/Spherical.js
+function Spherical(clock, cone, magnitude) {
+ this.clock = defaultValue_default(clock, 0);
+ this.cone = defaultValue_default(cone, 0);
+ this.magnitude = defaultValue_default(magnitude, 1);
+}
+Spherical.fromCartesian3 = function(cartesian34, result) {
+ Check_default.typeOf.object("cartesian3", cartesian34);
+ const x = cartesian34.x;
+ const y = cartesian34.y;
+ const z = cartesian34.z;
+ const radialSquared = x * x + y * y;
+ if (!defined_default(result)) {
+ result = new Spherical();
+ }
+ result.clock = Math.atan2(y, x);
+ result.cone = Math.atan2(Math.sqrt(radialSquared), z);
+ result.magnitude = Math.sqrt(radialSquared + z * z);
+ return result;
+};
+Spherical.clone = function(spherical, result) {
+ if (!defined_default(spherical)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ return new Spherical(spherical.clock, spherical.cone, spherical.magnitude);
+ }
+ result.clock = spherical.clock;
+ result.cone = spherical.cone;
+ result.magnitude = spherical.magnitude;
+ return result;
+};
+Spherical.normalize = function(spherical, result) {
+ Check_default.typeOf.object("spherical", spherical);
+ if (!defined_default(result)) {
+ return new Spherical(spherical.clock, spherical.cone, 1);
+ }
+ result.clock = spherical.clock;
+ result.cone = spherical.cone;
+ result.magnitude = 1;
+ return result;
+};
+Spherical.equals = function(left, right) {
+ return left === right || defined_default(left) && defined_default(right) && left.clock === right.clock && left.cone === right.cone && left.magnitude === right.magnitude;
+};
+Spherical.equalsEpsilon = function(left, right, epsilon) {
+ epsilon = defaultValue_default(epsilon, 0);
+ return left === right || defined_default(left) && defined_default(right) && Math.abs(left.clock - right.clock) <= epsilon && Math.abs(left.cone - right.cone) <= epsilon && Math.abs(left.magnitude - right.magnitude) <= epsilon;
+};
+Spherical.prototype.equals = function(other) {
+ return Spherical.equals(this, other);
+};
+Spherical.prototype.clone = function(result) {
+ return Spherical.clone(this, result);
+};
+Spherical.prototype.equalsEpsilon = function(other, epsilon) {
+ return Spherical.equalsEpsilon(this, other, epsilon);
+};
+Spherical.prototype.toString = function() {
+ return `(${this.clock}, ${this.cone}, ${this.magnitude})`;
+};
+var Spherical_default = Spherical;
+
+// Source/DataSources/CzmlDataSource.js
+var import_urijs9 = __toESM(require_URI(), 1);
+
+// Source/Core/getTimestamp.js
+var getTimestamp;
+if (typeof performance !== "undefined" && typeof performance.now === "function" && isFinite(performance.now())) {
+ getTimestamp = function() {
+ return performance.now();
+ };
+} else {
+ getTimestamp = function() {
+ return Date.now();
+ };
+}
+var getTimestamp_default = getTimestamp;
+
+// Source/Core/Clock.js
+function Clock(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ let currentTime = options.currentTime;
+ let startTime = options.startTime;
+ let stopTime = options.stopTime;
+ if (!defined_default(currentTime)) {
+ if (defined_default(startTime)) {
+ currentTime = JulianDate_default.clone(startTime);
+ } else if (defined_default(stopTime)) {
+ currentTime = JulianDate_default.addDays(stopTime, -1, new JulianDate_default());
+ } else {
+ currentTime = JulianDate_default.now();
+ }
+ } else {
+ currentTime = JulianDate_default.clone(currentTime);
+ }
+ if (!defined_default(startTime)) {
+ startTime = JulianDate_default.clone(currentTime);
+ } else {
+ startTime = JulianDate_default.clone(startTime);
+ }
+ if (!defined_default(stopTime)) {
+ stopTime = JulianDate_default.addDays(startTime, 1, new JulianDate_default());
+ } else {
+ stopTime = JulianDate_default.clone(stopTime);
+ }
+ if (JulianDate_default.greaterThan(startTime, stopTime)) {
+ throw new DeveloperError_default("startTime must come before stopTime.");
+ }
+ this.startTime = startTime;
+ this.stopTime = stopTime;
+ this.clockRange = defaultValue_default(options.clockRange, ClockRange_default.UNBOUNDED);
+ this.canAnimate = defaultValue_default(options.canAnimate, true);
+ this.onTick = new Event_default();
+ this.onStop = new Event_default();
+ this._currentTime = void 0;
+ this._multiplier = void 0;
+ this._clockStep = void 0;
+ this._shouldAnimate = void 0;
+ this._lastSystemTime = getTimestamp_default();
+ this.currentTime = currentTime;
+ this.multiplier = defaultValue_default(options.multiplier, 1);
+ this.shouldAnimate = defaultValue_default(options.shouldAnimate, false);
+ this.clockStep = defaultValue_default(
+ options.clockStep,
+ ClockStep_default.SYSTEM_CLOCK_MULTIPLIER
+ );
+}
+Object.defineProperties(Clock.prototype, {
+ currentTime: {
+ get: function() {
+ return this._currentTime;
+ },
+ set: function(value) {
+ if (JulianDate_default.equals(this._currentTime, value)) {
+ return;
+ }
+ if (this._clockStep === ClockStep_default.SYSTEM_CLOCK) {
+ this._clockStep = ClockStep_default.SYSTEM_CLOCK_MULTIPLIER;
+ }
+ this._currentTime = value;
+ }
+ },
+ multiplier: {
+ get: function() {
+ return this._multiplier;
+ },
+ set: function(value) {
+ if (this._multiplier === value) {
+ return;
+ }
+ if (this._clockStep === ClockStep_default.SYSTEM_CLOCK) {
+ this._clockStep = ClockStep_default.SYSTEM_CLOCK_MULTIPLIER;
+ }
+ this._multiplier = value;
+ }
+ },
+ clockStep: {
+ get: function() {
+ return this._clockStep;
+ },
+ set: function(value) {
+ if (value === ClockStep_default.SYSTEM_CLOCK) {
+ this._multiplier = 1;
+ this._shouldAnimate = true;
+ this._currentTime = JulianDate_default.now();
+ }
+ this._clockStep = value;
+ }
+ },
+ shouldAnimate: {
+ get: function() {
+ return this._shouldAnimate;
+ },
+ set: function(value) {
+ if (this._shouldAnimate === value) {
+ return;
+ }
+ if (this._clockStep === ClockStep_default.SYSTEM_CLOCK) {
+ this._clockStep = ClockStep_default.SYSTEM_CLOCK_MULTIPLIER;
+ }
+ this._shouldAnimate = value;
+ }
+ }
+});
+Clock.prototype.tick = function() {
+ const currentSystemTime = getTimestamp_default();
+ let currentTime = JulianDate_default.clone(this._currentTime);
+ if (this.canAnimate && this._shouldAnimate) {
+ const clockStep = this._clockStep;
+ if (clockStep === ClockStep_default.SYSTEM_CLOCK) {
+ currentTime = JulianDate_default.now(currentTime);
+ } else {
+ const multiplier = this._multiplier;
+ if (clockStep === ClockStep_default.TICK_DEPENDENT) {
+ currentTime = JulianDate_default.addSeconds(
+ currentTime,
+ multiplier,
+ currentTime
+ );
+ } else {
+ const milliseconds = currentSystemTime - this._lastSystemTime;
+ currentTime = JulianDate_default.addSeconds(
+ currentTime,
+ multiplier * (milliseconds / 1e3),
+ currentTime
+ );
+ }
+ const clockRange = this.clockRange;
+ const startTime = this.startTime;
+ const stopTime = this.stopTime;
+ if (clockRange === ClockRange_default.CLAMPED) {
+ if (JulianDate_default.lessThan(currentTime, startTime)) {
+ currentTime = JulianDate_default.clone(startTime, currentTime);
+ } else if (JulianDate_default.greaterThan(currentTime, stopTime)) {
+ currentTime = JulianDate_default.clone(stopTime, currentTime);
+ this.onStop.raiseEvent(this);
+ }
+ } else if (clockRange === ClockRange_default.LOOP_STOP) {
+ if (JulianDate_default.lessThan(currentTime, startTime)) {
+ currentTime = JulianDate_default.clone(startTime, currentTime);
+ }
+ while (JulianDate_default.greaterThan(currentTime, stopTime)) {
+ currentTime = JulianDate_default.addSeconds(
+ startTime,
+ JulianDate_default.secondsDifference(currentTime, stopTime),
+ currentTime
+ );
+ this.onStop.raiseEvent(this);
+ }
+ }
+ }
+ }
+ this._currentTime = currentTime;
+ this._lastSystemTime = currentSystemTime;
+ this.onTick.raiseEvent(this);
+ return currentTime;
+};
+var Clock_default = Clock;
+
+// Source/DataSources/DataSourceClock.js
+function DataSourceClock() {
+ this._definitionChanged = new Event_default();
+ this._startTime = void 0;
+ this._stopTime = void 0;
+ this._currentTime = void 0;
+ this._clockRange = void 0;
+ this._clockStep = void 0;
+ this._multiplier = void 0;
+}
+Object.defineProperties(DataSourceClock.prototype, {
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ startTime: createRawPropertyDescriptor_default("startTime"),
+ stopTime: createRawPropertyDescriptor_default("stopTime"),
+ currentTime: createRawPropertyDescriptor_default("currentTime"),
+ clockRange: createRawPropertyDescriptor_default("clockRange"),
+ clockStep: createRawPropertyDescriptor_default("clockStep"),
+ multiplier: createRawPropertyDescriptor_default("multiplier")
+});
+DataSourceClock.prototype.clone = function(result) {
+ if (!defined_default(result)) {
+ result = new DataSourceClock();
+ }
+ result.startTime = this.startTime;
+ result.stopTime = this.stopTime;
+ result.currentTime = this.currentTime;
+ result.clockRange = this.clockRange;
+ result.clockStep = this.clockStep;
+ result.multiplier = this.multiplier;
+ return result;
+};
+DataSourceClock.prototype.equals = function(other) {
+ return this === other || defined_default(other) && JulianDate_default.equals(this.startTime, other.startTime) && JulianDate_default.equals(this.stopTime, other.stopTime) && JulianDate_default.equals(this.currentTime, other.currentTime) && this.clockRange === other.clockRange && this.clockStep === other.clockStep && this.multiplier === other.multiplier;
+};
+DataSourceClock.prototype.merge = function(source) {
+ if (!defined_default(source)) {
+ throw new DeveloperError_default("source is required.");
+ }
+ this.startTime = defaultValue_default(this.startTime, source.startTime);
+ this.stopTime = defaultValue_default(this.stopTime, source.stopTime);
+ this.currentTime = defaultValue_default(this.currentTime, source.currentTime);
+ this.clockRange = defaultValue_default(this.clockRange, source.clockRange);
+ this.clockStep = defaultValue_default(this.clockStep, source.clockStep);
+ this.multiplier = defaultValue_default(this.multiplier, source.multiplier);
+};
+DataSourceClock.prototype.getValue = function(result) {
+ if (!defined_default(result)) {
+ result = new Clock_default();
+ }
+ result.startTime = defaultValue_default(this.startTime, result.startTime);
+ result.stopTime = defaultValue_default(this.stopTime, result.stopTime);
+ result.currentTime = defaultValue_default(this.currentTime, result.currentTime);
+ result.clockRange = defaultValue_default(this.clockRange, result.clockRange);
+ result.multiplier = defaultValue_default(this.multiplier, result.multiplier);
+ result.clockStep = defaultValue_default(this.clockStep, result.clockStep);
+ return result;
+};
+var DataSourceClock_default = DataSourceClock;
+
+// Source/DataSources/GridMaterialProperty.js
+var defaultColor3 = Color_default.WHITE;
+var defaultCellAlpha = 0.1;
+var defaultLineCount = new Cartesian2_default(8, 8);
+var defaultLineOffset = new Cartesian2_default(0, 0);
+var defaultLineThickness = new Cartesian2_default(1, 1);
+function GridMaterialProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._definitionChanged = new Event_default();
+ this._color = void 0;
+ this._colorSubscription = void 0;
+ this._cellAlpha = void 0;
+ this._cellAlphaSubscription = void 0;
+ this._lineCount = void 0;
+ this._lineCountSubscription = void 0;
+ this._lineThickness = void 0;
+ this._lineThicknessSubscription = void 0;
+ this._lineOffset = void 0;
+ this._lineOffsetSubscription = void 0;
+ this.color = options.color;
+ this.cellAlpha = options.cellAlpha;
+ this.lineCount = options.lineCount;
+ this.lineThickness = options.lineThickness;
+ this.lineOffset = options.lineOffset;
+}
+Object.defineProperties(GridMaterialProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._color) && Property_default.isConstant(this._cellAlpha) && Property_default.isConstant(this._lineCount) && Property_default.isConstant(this._lineThickness) && Property_default.isConstant(this._lineOffset);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ color: createPropertyDescriptor_default("color"),
+ cellAlpha: createPropertyDescriptor_default("cellAlpha"),
+ lineCount: createPropertyDescriptor_default("lineCount"),
+ lineThickness: createPropertyDescriptor_default("lineThickness"),
+ lineOffset: createPropertyDescriptor_default("lineOffset")
+});
+GridMaterialProperty.prototype.getType = function(time) {
+ return "Grid";
+};
+GridMaterialProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(result)) {
+ result = {};
+ }
+ result.color = Property_default.getValueOrClonedDefault(
+ this._color,
+ time,
+ defaultColor3,
+ result.color
+ );
+ result.cellAlpha = Property_default.getValueOrDefault(
+ this._cellAlpha,
+ time,
+ defaultCellAlpha
+ );
+ result.lineCount = Property_default.getValueOrClonedDefault(
+ this._lineCount,
+ time,
+ defaultLineCount,
+ result.lineCount
+ );
+ result.lineThickness = Property_default.getValueOrClonedDefault(
+ this._lineThickness,
+ time,
+ defaultLineThickness,
+ result.lineThickness
+ );
+ result.lineOffset = Property_default.getValueOrClonedDefault(
+ this._lineOffset,
+ time,
+ defaultLineOffset,
+ result.lineOffset
+ );
+ return result;
+};
+GridMaterialProperty.prototype.equals = function(other) {
+ return this === other || other instanceof GridMaterialProperty && Property_default.equals(this._color, other._color) && Property_default.equals(this._cellAlpha, other._cellAlpha) && Property_default.equals(this._lineCount, other._lineCount) && Property_default.equals(this._lineThickness, other._lineThickness) && Property_default.equals(this._lineOffset, other._lineOffset);
+};
+var GridMaterialProperty_default = GridMaterialProperty;
+
+// Source/DataSources/PolylineArrowMaterialProperty.js
+function PolylineArrowMaterialProperty(color) {
+ this._definitionChanged = new Event_default();
+ this._color = void 0;
+ this._colorSubscription = void 0;
+ this.color = color;
+}
+Object.defineProperties(PolylineArrowMaterialProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._color);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ color: createPropertyDescriptor_default("color")
+});
+PolylineArrowMaterialProperty.prototype.getType = function(time) {
+ return "PolylineArrow";
+};
+PolylineArrowMaterialProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(result)) {
+ result = {};
+ }
+ result.color = Property_default.getValueOrClonedDefault(
+ this._color,
+ time,
+ Color_default.WHITE,
+ result.color
+ );
+ return result;
+};
+PolylineArrowMaterialProperty.prototype.equals = function(other) {
+ return this === other || other instanceof PolylineArrowMaterialProperty && Property_default.equals(this._color, other._color);
+};
+var PolylineArrowMaterialProperty_default = PolylineArrowMaterialProperty;
+
+// Source/DataSources/PolylineDashMaterialProperty.js
+var defaultColor4 = Color_default.WHITE;
+var defaultGapColor = Color_default.TRANSPARENT;
+var defaultDashLength = 16;
+var defaultDashPattern = 255;
+function PolylineDashMaterialProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._definitionChanged = new Event_default();
+ this._color = void 0;
+ this._colorSubscription = void 0;
+ this._gapColor = void 0;
+ this._gapColorSubscription = void 0;
+ this._dashLength = void 0;
+ this._dashLengthSubscription = void 0;
+ this._dashPattern = void 0;
+ this._dashPatternSubscription = void 0;
+ this.color = options.color;
+ this.gapColor = options.gapColor;
+ this.dashLength = options.dashLength;
+ this.dashPattern = options.dashPattern;
+}
+Object.defineProperties(PolylineDashMaterialProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._color) && Property_default.isConstant(this._gapColor) && Property_default.isConstant(this._dashLength) && Property_default.isConstant(this._dashPattern);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ color: createPropertyDescriptor_default("color"),
+ gapColor: createPropertyDescriptor_default("gapColor"),
+ dashLength: createPropertyDescriptor_default("dashLength"),
+ dashPattern: createPropertyDescriptor_default("dashPattern")
+});
+PolylineDashMaterialProperty.prototype.getType = function(time) {
+ return "PolylineDash";
+};
+PolylineDashMaterialProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(result)) {
+ result = {};
+ }
+ result.color = Property_default.getValueOrClonedDefault(
+ this._color,
+ time,
+ defaultColor4,
+ result.color
+ );
+ result.gapColor = Property_default.getValueOrClonedDefault(
+ this._gapColor,
+ time,
+ defaultGapColor,
+ result.gapColor
+ );
+ result.dashLength = Property_default.getValueOrDefault(
+ this._dashLength,
+ time,
+ defaultDashLength,
+ result.dashLength
+ );
+ result.dashPattern = Property_default.getValueOrDefault(
+ this._dashPattern,
+ time,
+ defaultDashPattern,
+ result.dashPattern
+ );
+ return result;
+};
+PolylineDashMaterialProperty.prototype.equals = function(other) {
+ return this === other || other instanceof PolylineDashMaterialProperty && Property_default.equals(this._color, other._color) && Property_default.equals(this._gapColor, other._gapColor) && Property_default.equals(this._dashLength, other._dashLength) && Property_default.equals(this._dashPattern, other._dashPattern);
+};
+var PolylineDashMaterialProperty_default = PolylineDashMaterialProperty;
+
+// Source/DataSources/PolylineGlowMaterialProperty.js
+var defaultColor5 = Color_default.WHITE;
+var defaultGlowPower = 0.25;
+var defaultTaperPower = 1;
+function PolylineGlowMaterialProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._definitionChanged = new Event_default();
+ this._color = void 0;
+ this._colorSubscription = void 0;
+ this._glowPower = void 0;
+ this._glowPowerSubscription = void 0;
+ this._taperPower = void 0;
+ this._taperPowerSubscription = void 0;
+ this.color = options.color;
+ this.glowPower = options.glowPower;
+ this.taperPower = options.taperPower;
+}
+Object.defineProperties(PolylineGlowMaterialProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._color) && Property_default.isConstant(this._glow);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ color: createPropertyDescriptor_default("color"),
+ glowPower: createPropertyDescriptor_default("glowPower"),
+ taperPower: createPropertyDescriptor_default("taperPower")
+});
+PolylineGlowMaterialProperty.prototype.getType = function(time) {
+ return "PolylineGlow";
+};
+PolylineGlowMaterialProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(result)) {
+ result = {};
+ }
+ result.color = Property_default.getValueOrClonedDefault(
+ this._color,
+ time,
+ defaultColor5,
+ result.color
+ );
+ result.glowPower = Property_default.getValueOrDefault(
+ this._glowPower,
+ time,
+ defaultGlowPower,
+ result.glowPower
+ );
+ result.taperPower = Property_default.getValueOrDefault(
+ this._taperPower,
+ time,
+ defaultTaperPower,
+ result.taperPower
+ );
+ return result;
+};
+PolylineGlowMaterialProperty.prototype.equals = function(other) {
+ return this === other || other instanceof PolylineGlowMaterialProperty && Property_default.equals(this._color, other._color) && Property_default.equals(this._glowPower, other._glowPower) && Property_default.equals(this._taperPower, other._taperPower);
+};
+var PolylineGlowMaterialProperty_default = PolylineGlowMaterialProperty;
+
+// Source/DataSources/PolylineOutlineMaterialProperty.js
+var defaultColor6 = Color_default.WHITE;
+var defaultOutlineColor2 = Color_default.BLACK;
+var defaultOutlineWidth = 1;
+function PolylineOutlineMaterialProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._definitionChanged = new Event_default();
+ this._color = void 0;
+ this._colorSubscription = void 0;
+ this._outlineColor = void 0;
+ this._outlineColorSubscription = void 0;
+ this._outlineWidth = void 0;
+ this._outlineWidthSubscription = void 0;
+ this.color = options.color;
+ this.outlineColor = options.outlineColor;
+ this.outlineWidth = options.outlineWidth;
+}
+Object.defineProperties(PolylineOutlineMaterialProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._color) && Property_default.isConstant(this._outlineColor) && Property_default.isConstant(this._outlineWidth);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ color: createPropertyDescriptor_default("color"),
+ outlineColor: createPropertyDescriptor_default("outlineColor"),
+ outlineWidth: createPropertyDescriptor_default("outlineWidth")
+});
+PolylineOutlineMaterialProperty.prototype.getType = function(time) {
+ return "PolylineOutline";
+};
+PolylineOutlineMaterialProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(result)) {
+ result = {};
+ }
+ result.color = Property_default.getValueOrClonedDefault(
+ this._color,
+ time,
+ defaultColor6,
+ result.color
+ );
+ result.outlineColor = Property_default.getValueOrClonedDefault(
+ this._outlineColor,
+ time,
+ defaultOutlineColor2,
+ result.outlineColor
+ );
+ result.outlineWidth = Property_default.getValueOrDefault(
+ this._outlineWidth,
+ time,
+ defaultOutlineWidth
+ );
+ return result;
+};
+PolylineOutlineMaterialProperty.prototype.equals = function(other) {
+ return this === other || other instanceof PolylineOutlineMaterialProperty && Property_default.equals(this._color, other._color) && Property_default.equals(this._outlineColor, other._outlineColor) && Property_default.equals(this._outlineWidth, other._outlineWidth);
+};
+var PolylineOutlineMaterialProperty_default = PolylineOutlineMaterialProperty;
+
+// Source/DataSources/PositionPropertyArray.js
+function PositionPropertyArray(value, referenceFrame) {
+ this._value = void 0;
+ this._definitionChanged = new Event_default();
+ this._eventHelper = new EventHelper_default();
+ this._referenceFrame = defaultValue_default(referenceFrame, ReferenceFrame_default.FIXED);
+ this.setValue(value);
+}
+Object.defineProperties(PositionPropertyArray.prototype, {
+ isConstant: {
+ get: function() {
+ const value = this._value;
+ if (!defined_default(value)) {
+ return true;
+ }
+ const length3 = value.length;
+ for (let i = 0; i < length3; i++) {
+ if (!Property_default.isConstant(value[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ referenceFrame: {
+ get: function() {
+ return this._referenceFrame;
+ }
+ }
+});
+PositionPropertyArray.prototype.getValue = function(time, result) {
+ return this.getValueInReferenceFrame(time, ReferenceFrame_default.FIXED, result);
+};
+PositionPropertyArray.prototype.getValueInReferenceFrame = function(time, referenceFrame, result) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ if (!defined_default(referenceFrame)) {
+ throw new DeveloperError_default("referenceFrame is required.");
+ }
+ const value = this._value;
+ if (!defined_default(value)) {
+ return void 0;
+ }
+ const length3 = value.length;
+ if (!defined_default(result)) {
+ result = new Array(length3);
+ }
+ let i = 0;
+ let x = 0;
+ while (i < length3) {
+ const property = value[i];
+ const itemValue = property.getValueInReferenceFrame(
+ time,
+ referenceFrame,
+ result[i]
+ );
+ if (defined_default(itemValue)) {
+ result[x] = itemValue;
+ x++;
+ }
+ i++;
+ }
+ result.length = x;
+ return result;
+};
+PositionPropertyArray.prototype.setValue = function(value) {
+ const eventHelper = this._eventHelper;
+ eventHelper.removeAll();
+ if (defined_default(value)) {
+ this._value = value.slice();
+ const length3 = value.length;
+ for (let i = 0; i < length3; i++) {
+ const property = value[i];
+ if (defined_default(property)) {
+ eventHelper.add(
+ property.definitionChanged,
+ PositionPropertyArray.prototype._raiseDefinitionChanged,
+ this
+ );
+ }
+ }
+ } else {
+ this._value = void 0;
+ }
+ this._definitionChanged.raiseEvent(this);
+};
+PositionPropertyArray.prototype.equals = function(other) {
+ return this === other || other instanceof PositionPropertyArray && this._referenceFrame === other._referenceFrame && Property_default.arrayEquals(this._value, other._value);
+};
+PositionPropertyArray.prototype._raiseDefinitionChanged = function() {
+ this._definitionChanged.raiseEvent(this);
+};
+var PositionPropertyArray_default = PositionPropertyArray;
+
+// Source/DataSources/PropertyArray.js
+function PropertyArray(value) {
+ this._value = void 0;
+ this._definitionChanged = new Event_default();
+ this._eventHelper = new EventHelper_default();
+ this.setValue(value);
+}
+Object.defineProperties(PropertyArray.prototype, {
+ isConstant: {
+ get: function() {
+ const value = this._value;
+ if (!defined_default(value)) {
+ return true;
+ }
+ const length3 = value.length;
+ for (let i = 0; i < length3; i++) {
+ if (!Property_default.isConstant(value[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ }
+});
+PropertyArray.prototype.getValue = function(time, result) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ const value = this._value;
+ if (!defined_default(value)) {
+ return void 0;
+ }
+ const length3 = value.length;
+ if (!defined_default(result)) {
+ result = new Array(length3);
+ }
+ let i = 0;
+ let x = 0;
+ while (i < length3) {
+ const property = this._value[i];
+ const itemValue = property.getValue(time, result[i]);
+ if (defined_default(itemValue)) {
+ result[x] = itemValue;
+ x++;
+ }
+ i++;
+ }
+ result.length = x;
+ return result;
+};
+PropertyArray.prototype.setValue = function(value) {
+ const eventHelper = this._eventHelper;
+ eventHelper.removeAll();
+ if (defined_default(value)) {
+ this._value = value.slice();
+ const length3 = value.length;
+ for (let i = 0; i < length3; i++) {
+ const property = value[i];
+ if (defined_default(property)) {
+ eventHelper.add(
+ property.definitionChanged,
+ PropertyArray.prototype._raiseDefinitionChanged,
+ this
+ );
+ }
+ }
+ } else {
+ this._value = void 0;
+ }
+ this._definitionChanged.raiseEvent(this);
+};
+PropertyArray.prototype.equals = function(other) {
+ return this === other || other instanceof PropertyArray && Property_default.arrayEquals(this._value, other._value);
+};
+PropertyArray.prototype._raiseDefinitionChanged = function() {
+ this._definitionChanged.raiseEvent(this);
+};
+var PropertyArray_default = PropertyArray;
+
+// Source/DataSources/ReferenceProperty.js
+function resolve(that) {
+ let targetProperty = that._targetProperty;
+ if (!defined_default(targetProperty)) {
+ let targetEntity = that._targetEntity;
+ if (!defined_default(targetEntity)) {
+ targetEntity = that._targetCollection.getById(that._targetId);
+ if (!defined_default(targetEntity)) {
+ that._targetEntity = that._targetProperty = void 0;
+ return;
+ }
+ targetEntity.definitionChanged.addEventListener(
+ ReferenceProperty.prototype._onTargetEntityDefinitionChanged,
+ that
+ );
+ that._targetEntity = targetEntity;
+ }
+ const targetPropertyNames = that._targetPropertyNames;
+ targetProperty = that._targetEntity;
+ for (let i = 0, len = targetPropertyNames.length; i < len && defined_default(targetProperty); ++i) {
+ targetProperty = targetProperty[targetPropertyNames[i]];
+ }
+ that._targetProperty = targetProperty;
+ }
+ return targetProperty;
+}
+function ReferenceProperty(targetCollection, targetId, targetPropertyNames) {
+ if (!defined_default(targetCollection)) {
+ throw new DeveloperError_default("targetCollection is required.");
+ }
+ if (!defined_default(targetId) || targetId === "") {
+ throw new DeveloperError_default("targetId is required.");
+ }
+ if (!defined_default(targetPropertyNames) || targetPropertyNames.length === 0) {
+ throw new DeveloperError_default("targetPropertyNames is required.");
+ }
+ for (let i = 0; i < targetPropertyNames.length; i++) {
+ const item = targetPropertyNames[i];
+ if (!defined_default(item) || item === "") {
+ throw new DeveloperError_default("reference contains invalid properties.");
+ }
+ }
+ this._targetCollection = targetCollection;
+ this._targetId = targetId;
+ this._targetPropertyNames = targetPropertyNames;
+ this._targetProperty = void 0;
+ this._targetEntity = void 0;
+ this._definitionChanged = new Event_default();
+ targetCollection.collectionChanged.addEventListener(
+ ReferenceProperty.prototype._onCollectionChanged,
+ this
+ );
+}
+Object.defineProperties(ReferenceProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(resolve(this));
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ referenceFrame: {
+ get: function() {
+ const target = resolve(this);
+ return defined_default(target) ? target.referenceFrame : void 0;
+ }
+ },
+ targetId: {
+ get: function() {
+ return this._targetId;
+ }
+ },
+ targetCollection: {
+ get: function() {
+ return this._targetCollection;
+ }
+ },
+ targetPropertyNames: {
+ get: function() {
+ return this._targetPropertyNames;
+ }
+ },
+ resolvedProperty: {
+ get: function() {
+ return resolve(this);
+ }
+ }
+});
+ReferenceProperty.fromString = function(targetCollection, referenceString) {
+ if (!defined_default(targetCollection)) {
+ throw new DeveloperError_default("targetCollection is required.");
+ }
+ if (!defined_default(referenceString)) {
+ throw new DeveloperError_default("referenceString is required.");
+ }
+ let identifier;
+ const values = [];
+ let inIdentifier = true;
+ let isEscaped = false;
+ let token = "";
+ for (let i = 0; i < referenceString.length; ++i) {
+ const c = referenceString.charAt(i);
+ if (isEscaped) {
+ token += c;
+ isEscaped = false;
+ } else if (c === "\\") {
+ isEscaped = true;
+ } else if (inIdentifier && c === "#") {
+ identifier = token;
+ inIdentifier = false;
+ token = "";
+ } else if (!inIdentifier && c === ".") {
+ values.push(token);
+ token = "";
+ } else {
+ token += c;
+ }
+ }
+ values.push(token);
+ return new ReferenceProperty(targetCollection, identifier, values);
+};
+ReferenceProperty.prototype.getValue = function(time, result) {
+ const target = resolve(this);
+ return defined_default(target) ? target.getValue(time, result) : void 0;
+};
+ReferenceProperty.prototype.getValueInReferenceFrame = function(time, referenceFrame, result) {
+ const target = resolve(this);
+ return defined_default(target) ? target.getValueInReferenceFrame(time, referenceFrame, result) : void 0;
+};
+ReferenceProperty.prototype.getType = function(time) {
+ const target = resolve(this);
+ return defined_default(target) ? target.getType(time) : void 0;
+};
+ReferenceProperty.prototype.equals = function(other) {
+ if (this === other) {
+ return true;
+ }
+ const names = this._targetPropertyNames;
+ const otherNames = other._targetPropertyNames;
+ if (this._targetCollection !== other._targetCollection || this._targetId !== other._targetId || names.length !== otherNames.length) {
+ return false;
+ }
+ const length3 = this._targetPropertyNames.length;
+ for (let i = 0; i < length3; i++) {
+ if (names[i] !== otherNames[i]) {
+ return false;
+ }
+ }
+ return true;
+};
+ReferenceProperty.prototype._onTargetEntityDefinitionChanged = function(targetEntity, name, value, oldValue2) {
+ if (defined_default(this._targetProperty) && this._targetPropertyNames[0] === name) {
+ this._targetProperty = void 0;
+ this._definitionChanged.raiseEvent(this);
+ }
+};
+ReferenceProperty.prototype._onCollectionChanged = function(collection, added, removed) {
+ let targetEntity = this._targetEntity;
+ if (defined_default(targetEntity) && removed.indexOf(targetEntity) !== -1) {
+ targetEntity.definitionChanged.removeEventListener(
+ ReferenceProperty.prototype._onTargetEntityDefinitionChanged,
+ this
+ );
+ this._targetEntity = this._targetProperty = void 0;
+ } else if (!defined_default(targetEntity)) {
+ targetEntity = resolve(this);
+ if (defined_default(targetEntity)) {
+ this._definitionChanged.raiseEvent(this);
+ }
+ }
+};
+var ReferenceProperty_default = ReferenceProperty;
+
+// Source/DataSources/Rotation.js
+var Rotation = {
+ packedLength: 1,
+ pack: function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex] = value;
+ return array;
+ },
+ unpack: function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ return array[startingIndex];
+ },
+ convertPackedArrayForInterpolation: function(packedArray, startingIndex, lastIndex, result) {
+ if (!defined_default(packedArray)) {
+ throw new DeveloperError_default("packedArray is required");
+ }
+ if (!defined_default(result)) {
+ result = [];
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ lastIndex = defaultValue_default(lastIndex, packedArray.length);
+ let previousValue;
+ for (let i = 0, len = lastIndex - startingIndex + 1; i < len; i++) {
+ const value = packedArray[startingIndex + i];
+ if (i === 0 || Math.abs(previousValue - value) < Math.PI) {
+ result[i] = value;
+ } else {
+ result[i] = value - Math_default.TWO_PI;
+ }
+ previousValue = value;
+ }
+ },
+ unpackInterpolationResult: function(array, sourceArray, firstIndex, lastIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ if (!defined_default(sourceArray)) {
+ throw new DeveloperError_default("sourceArray is required");
+ }
+ result = array[0];
+ if (result < 0) {
+ return result + Math_default.TWO_PI;
+ }
+ return result;
+ }
+};
+var Rotation_default = Rotation;
+
+// Source/DataSources/SampledProperty.js
+var PackableNumber = {
+ packedLength: 1,
+ pack: function(value, array, startingIndex) {
+ startingIndex = defaultValue_default(startingIndex, 0);
+ array[startingIndex] = value;
+ },
+ unpack: function(array, startingIndex, result) {
+ startingIndex = defaultValue_default(startingIndex, 0);
+ return array[startingIndex];
+ }
+};
+function arrayInsert(array, startIndex, items) {
+ let i;
+ const arrayLength = array.length;
+ const itemsLength = items.length;
+ const newLength = arrayLength + itemsLength;
+ array.length = newLength;
+ if (arrayLength !== startIndex) {
+ let q = arrayLength - 1;
+ for (i = newLength - 1; i >= startIndex; i--) {
+ array[i] = array[q--];
+ }
+ }
+ for (i = 0; i < itemsLength; i++) {
+ array[startIndex++] = items[i];
+ }
+}
+function convertDate(date, epoch2) {
+ if (date instanceof JulianDate_default) {
+ return date;
+ }
+ if (typeof date === "string") {
+ return JulianDate_default.fromIso8601(date);
+ }
+ return JulianDate_default.addSeconds(epoch2, date, new JulianDate_default());
+}
+var timesSpliceArgs = [];
+var valuesSpliceArgs = [];
+function mergeNewSamples(epoch2, times, values, newData, packedLength) {
+ let newDataIndex = 0;
+ let i;
+ let prevItem;
+ let timesInsertionPoint;
+ let valuesInsertionPoint;
+ let currentTime;
+ let nextTime;
+ while (newDataIndex < newData.length) {
+ currentTime = convertDate(newData[newDataIndex], epoch2);
+ timesInsertionPoint = binarySearch_default(times, currentTime, JulianDate_default.compare);
+ let timesSpliceArgsCount = 0;
+ let valuesSpliceArgsCount = 0;
+ if (timesInsertionPoint < 0) {
+ timesInsertionPoint = ~timesInsertionPoint;
+ valuesInsertionPoint = timesInsertionPoint * packedLength;
+ prevItem = void 0;
+ nextTime = times[timesInsertionPoint];
+ while (newDataIndex < newData.length) {
+ currentTime = convertDate(newData[newDataIndex], epoch2);
+ if (defined_default(prevItem) && JulianDate_default.compare(prevItem, currentTime) >= 0 || defined_default(nextTime) && JulianDate_default.compare(currentTime, nextTime) >= 0) {
+ break;
+ }
+ timesSpliceArgs[timesSpliceArgsCount++] = currentTime;
+ newDataIndex = newDataIndex + 1;
+ for (i = 0; i < packedLength; i++) {
+ valuesSpliceArgs[valuesSpliceArgsCount++] = newData[newDataIndex];
+ newDataIndex = newDataIndex + 1;
+ }
+ prevItem = currentTime;
+ }
+ if (timesSpliceArgsCount > 0) {
+ valuesSpliceArgs.length = valuesSpliceArgsCount;
+ arrayInsert(values, valuesInsertionPoint, valuesSpliceArgs);
+ timesSpliceArgs.length = timesSpliceArgsCount;
+ arrayInsert(times, timesInsertionPoint, timesSpliceArgs);
+ }
+ } else {
+ for (i = 0; i < packedLength; i++) {
+ newDataIndex++;
+ values[timesInsertionPoint * packedLength + i] = newData[newDataIndex];
+ }
+ newDataIndex++;
+ }
+ }
+}
+function SampledProperty(type, derivativeTypes) {
+ Check_default.defined("type", type);
+ let innerType = type;
+ if (innerType === Number) {
+ innerType = PackableNumber;
+ }
+ let packedLength = innerType.packedLength;
+ let packedInterpolationLength = defaultValue_default(
+ innerType.packedInterpolationLength,
+ packedLength
+ );
+ let inputOrder = 0;
+ let innerDerivativeTypes;
+ if (defined_default(derivativeTypes)) {
+ const length3 = derivativeTypes.length;
+ innerDerivativeTypes = new Array(length3);
+ for (let i = 0; i < length3; i++) {
+ let derivativeType = derivativeTypes[i];
+ if (derivativeType === Number) {
+ derivativeType = PackableNumber;
+ }
+ const derivativePackedLength = derivativeType.packedLength;
+ packedLength += derivativePackedLength;
+ packedInterpolationLength += defaultValue_default(
+ derivativeType.packedInterpolationLength,
+ derivativePackedLength
+ );
+ innerDerivativeTypes[i] = derivativeType;
+ }
+ inputOrder = length3;
+ }
+ this._type = type;
+ this._innerType = innerType;
+ this._interpolationDegree = 1;
+ this._interpolationAlgorithm = LinearApproximation_default;
+ this._numberOfPoints = 0;
+ this._times = [];
+ this._values = [];
+ this._xTable = [];
+ this._yTable = [];
+ this._packedLength = packedLength;
+ this._packedInterpolationLength = packedInterpolationLength;
+ this._updateTableLength = true;
+ this._interpolationResult = new Array(packedInterpolationLength);
+ this._definitionChanged = new Event_default();
+ this._derivativeTypes = derivativeTypes;
+ this._innerDerivativeTypes = innerDerivativeTypes;
+ this._inputOrder = inputOrder;
+ this._forwardExtrapolationType = ExtrapolationType_default.NONE;
+ this._forwardExtrapolationDuration = 0;
+ this._backwardExtrapolationType = ExtrapolationType_default.NONE;
+ this._backwardExtrapolationDuration = 0;
+}
+Object.defineProperties(SampledProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return this._values.length === 0;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ type: {
+ get: function() {
+ return this._type;
+ }
+ },
+ derivativeTypes: {
+ get: function() {
+ return this._derivativeTypes;
+ }
+ },
+ interpolationDegree: {
+ get: function() {
+ return this._interpolationDegree;
+ }
+ },
+ interpolationAlgorithm: {
+ get: function() {
+ return this._interpolationAlgorithm;
+ }
+ },
+ forwardExtrapolationType: {
+ get: function() {
+ return this._forwardExtrapolationType;
+ },
+ set: function(value) {
+ if (this._forwardExtrapolationType !== value) {
+ this._forwardExtrapolationType = value;
+ this._definitionChanged.raiseEvent(this);
+ }
+ }
+ },
+ forwardExtrapolationDuration: {
+ get: function() {
+ return this._forwardExtrapolationDuration;
+ },
+ set: function(value) {
+ if (this._forwardExtrapolationDuration !== value) {
+ this._forwardExtrapolationDuration = value;
+ this._definitionChanged.raiseEvent(this);
+ }
+ }
+ },
+ backwardExtrapolationType: {
+ get: function() {
+ return this._backwardExtrapolationType;
+ },
+ set: function(value) {
+ if (this._backwardExtrapolationType !== value) {
+ this._backwardExtrapolationType = value;
+ this._definitionChanged.raiseEvent(this);
+ }
+ }
+ },
+ backwardExtrapolationDuration: {
+ get: function() {
+ return this._backwardExtrapolationDuration;
+ },
+ set: function(value) {
+ if (this._backwardExtrapolationDuration !== value) {
+ this._backwardExtrapolationDuration = value;
+ this._definitionChanged.raiseEvent(this);
+ }
+ }
+ }
+});
+SampledProperty.prototype.getValue = function(time, result) {
+ Check_default.defined("time", time);
+ const times = this._times;
+ const timesLength = times.length;
+ if (timesLength === 0) {
+ return void 0;
+ }
+ let timeout;
+ const innerType = this._innerType;
+ const values = this._values;
+ let index = binarySearch_default(times, time, JulianDate_default.compare);
+ if (index < 0) {
+ index = ~index;
+ if (index === 0) {
+ const startTime = times[index];
+ timeout = this._backwardExtrapolationDuration;
+ if (this._backwardExtrapolationType === ExtrapolationType_default.NONE || timeout !== 0 && JulianDate_default.secondsDifference(startTime, time) > timeout) {
+ return void 0;
+ }
+ if (this._backwardExtrapolationType === ExtrapolationType_default.HOLD) {
+ return innerType.unpack(values, 0, result);
+ }
+ }
+ if (index >= timesLength) {
+ index = timesLength - 1;
+ const endTime = times[index];
+ timeout = this._forwardExtrapolationDuration;
+ if (this._forwardExtrapolationType === ExtrapolationType_default.NONE || timeout !== 0 && JulianDate_default.secondsDifference(time, endTime) > timeout) {
+ return void 0;
+ }
+ if (this._forwardExtrapolationType === ExtrapolationType_default.HOLD) {
+ index = timesLength - 1;
+ return innerType.unpack(values, index * innerType.packedLength, result);
+ }
+ }
+ const xTable = this._xTable;
+ const yTable = this._yTable;
+ const interpolationAlgorithm = this._interpolationAlgorithm;
+ const packedInterpolationLength = this._packedInterpolationLength;
+ const inputOrder = this._inputOrder;
+ if (this._updateTableLength) {
+ this._updateTableLength = false;
+ const numberOfPoints = Math.min(
+ interpolationAlgorithm.getRequiredDataPoints(
+ this._interpolationDegree,
+ inputOrder
+ ),
+ timesLength
+ );
+ if (numberOfPoints !== this._numberOfPoints) {
+ this._numberOfPoints = numberOfPoints;
+ xTable.length = numberOfPoints;
+ yTable.length = numberOfPoints * packedInterpolationLength;
+ }
+ }
+ const degree = this._numberOfPoints - 1;
+ if (degree < 1) {
+ return void 0;
+ }
+ let firstIndex = 0;
+ let lastIndex = timesLength - 1;
+ const pointsInCollection = lastIndex - firstIndex + 1;
+ if (pointsInCollection >= degree + 1) {
+ let computedFirstIndex = index - (degree / 2 | 0) - 1;
+ if (computedFirstIndex < firstIndex) {
+ computedFirstIndex = firstIndex;
+ }
+ let computedLastIndex = computedFirstIndex + degree;
+ if (computedLastIndex > lastIndex) {
+ computedLastIndex = lastIndex;
+ computedFirstIndex = computedLastIndex - degree;
+ if (computedFirstIndex < firstIndex) {
+ computedFirstIndex = firstIndex;
+ }
+ }
+ firstIndex = computedFirstIndex;
+ lastIndex = computedLastIndex;
+ }
+ const length3 = lastIndex - firstIndex + 1;
+ for (let i = 0; i < length3; ++i) {
+ xTable[i] = JulianDate_default.secondsDifference(
+ times[firstIndex + i],
+ times[lastIndex]
+ );
+ }
+ if (!defined_default(innerType.convertPackedArrayForInterpolation)) {
+ let destinationIndex = 0;
+ const packedLength = this._packedLength;
+ let sourceIndex = firstIndex * packedLength;
+ const stop2 = (lastIndex + 1) * packedLength;
+ while (sourceIndex < stop2) {
+ yTable[destinationIndex] = values[sourceIndex];
+ sourceIndex++;
+ destinationIndex++;
+ }
+ } else {
+ innerType.convertPackedArrayForInterpolation(
+ values,
+ firstIndex,
+ lastIndex,
+ yTable
+ );
+ }
+ const x = JulianDate_default.secondsDifference(time, times[lastIndex]);
+ let interpolationResult;
+ if (inputOrder === 0 || !defined_default(interpolationAlgorithm.interpolate)) {
+ interpolationResult = interpolationAlgorithm.interpolateOrderZero(
+ x,
+ xTable,
+ yTable,
+ packedInterpolationLength,
+ this._interpolationResult
+ );
+ } else {
+ const yStride = Math.floor(packedInterpolationLength / (inputOrder + 1));
+ interpolationResult = interpolationAlgorithm.interpolate(
+ x,
+ xTable,
+ yTable,
+ yStride,
+ inputOrder,
+ inputOrder,
+ this._interpolationResult
+ );
+ }
+ if (!defined_default(innerType.unpackInterpolationResult)) {
+ return innerType.unpack(interpolationResult, 0, result);
+ }
+ return innerType.unpackInterpolationResult(
+ interpolationResult,
+ values,
+ firstIndex,
+ lastIndex,
+ result
+ );
+ }
+ return innerType.unpack(values, index * this._packedLength, result);
+};
+SampledProperty.prototype.setInterpolationOptions = function(options) {
+ if (!defined_default(options)) {
+ return;
+ }
+ let valuesChanged = false;
+ const interpolationAlgorithm = options.interpolationAlgorithm;
+ const interpolationDegree = options.interpolationDegree;
+ if (defined_default(interpolationAlgorithm) && this._interpolationAlgorithm !== interpolationAlgorithm) {
+ this._interpolationAlgorithm = interpolationAlgorithm;
+ valuesChanged = true;
+ }
+ if (defined_default(interpolationDegree) && this._interpolationDegree !== interpolationDegree) {
+ this._interpolationDegree = interpolationDegree;
+ valuesChanged = true;
+ }
+ if (valuesChanged) {
+ this._updateTableLength = true;
+ this._definitionChanged.raiseEvent(this);
+ }
+};
+SampledProperty.prototype.addSample = function(time, value, derivatives) {
+ const innerDerivativeTypes = this._innerDerivativeTypes;
+ const hasDerivatives = defined_default(innerDerivativeTypes);
+ Check_default.defined("time", time);
+ Check_default.defined("value", value);
+ if (hasDerivatives) {
+ Check_default.defined("derivatives", derivatives);
+ }
+ const innerType = this._innerType;
+ const data = [];
+ data.push(time);
+ innerType.pack(value, data, data.length);
+ if (hasDerivatives) {
+ const derivativesLength = innerDerivativeTypes.length;
+ for (let x = 0; x < derivativesLength; x++) {
+ innerDerivativeTypes[x].pack(derivatives[x], data, data.length);
+ }
+ }
+ mergeNewSamples(
+ void 0,
+ this._times,
+ this._values,
+ data,
+ this._packedLength
+ );
+ this._updateTableLength = true;
+ this._definitionChanged.raiseEvent(this);
+};
+SampledProperty.prototype.addSamples = function(times, values, derivativeValues) {
+ const innerDerivativeTypes = this._innerDerivativeTypes;
+ const hasDerivatives = defined_default(innerDerivativeTypes);
+ Check_default.defined("times", times);
+ Check_default.defined("values", values);
+ if (times.length !== values.length) {
+ throw new DeveloperError_default("times and values must be the same length.");
+ }
+ if (hasDerivatives && (!defined_default(derivativeValues) || derivativeValues.length !== times.length)) {
+ throw new DeveloperError_default(
+ "times and derivativeValues must be the same length."
+ );
+ }
+ const innerType = this._innerType;
+ const length3 = times.length;
+ const data = [];
+ for (let i = 0; i < length3; i++) {
+ data.push(times[i]);
+ innerType.pack(values[i], data, data.length);
+ if (hasDerivatives) {
+ const derivatives = derivativeValues[i];
+ const derivativesLength = innerDerivativeTypes.length;
+ for (let x = 0; x < derivativesLength; x++) {
+ innerDerivativeTypes[x].pack(derivatives[x], data, data.length);
+ }
+ }
+ }
+ mergeNewSamples(
+ void 0,
+ this._times,
+ this._values,
+ data,
+ this._packedLength
+ );
+ this._updateTableLength = true;
+ this._definitionChanged.raiseEvent(this);
+};
+SampledProperty.prototype.addSamplesPackedArray = function(packedSamples, epoch2) {
+ Check_default.defined("packedSamples", packedSamples);
+ mergeNewSamples(
+ epoch2,
+ this._times,
+ this._values,
+ packedSamples,
+ this._packedLength
+ );
+ this._updateTableLength = true;
+ this._definitionChanged.raiseEvent(this);
+};
+SampledProperty.prototype.removeSample = function(time) {
+ Check_default.defined("time", time);
+ const index = binarySearch_default(this._times, time, JulianDate_default.compare);
+ if (index < 0) {
+ return false;
+ }
+ removeSamples(this, index, 1);
+ return true;
+};
+function removeSamples(property, startIndex, numberToRemove) {
+ const packedLength = property._packedLength;
+ property._times.splice(startIndex, numberToRemove);
+ property._values.splice(
+ startIndex * packedLength,
+ numberToRemove * packedLength
+ );
+ property._updateTableLength = true;
+ property._definitionChanged.raiseEvent(property);
+}
+SampledProperty.prototype.removeSamples = function(timeInterval) {
+ Check_default.defined("timeInterval", timeInterval);
+ const times = this._times;
+ let startIndex = binarySearch_default(times, timeInterval.start, JulianDate_default.compare);
+ if (startIndex < 0) {
+ startIndex = ~startIndex;
+ } else if (!timeInterval.isStartIncluded) {
+ ++startIndex;
+ }
+ let stopIndex = binarySearch_default(times, timeInterval.stop, JulianDate_default.compare);
+ if (stopIndex < 0) {
+ stopIndex = ~stopIndex;
+ } else if (timeInterval.isStopIncluded) {
+ ++stopIndex;
+ }
+ removeSamples(this, startIndex, stopIndex - startIndex);
+};
+SampledProperty.prototype.equals = function(other) {
+ if (this === other) {
+ return true;
+ }
+ if (!defined_default(other)) {
+ return false;
+ }
+ if (this._type !== other._type || this._interpolationDegree !== other._interpolationDegree || this._interpolationAlgorithm !== other._interpolationAlgorithm) {
+ return false;
+ }
+ const derivativeTypes = this._derivativeTypes;
+ const hasDerivatives = defined_default(derivativeTypes);
+ const otherDerivativeTypes = other._derivativeTypes;
+ const otherHasDerivatives = defined_default(otherDerivativeTypes);
+ if (hasDerivatives !== otherHasDerivatives) {
+ return false;
+ }
+ let i;
+ let length3;
+ if (hasDerivatives) {
+ length3 = derivativeTypes.length;
+ if (length3 !== otherDerivativeTypes.length) {
+ return false;
+ }
+ for (i = 0; i < length3; i++) {
+ if (derivativeTypes[i] !== otherDerivativeTypes[i]) {
+ return false;
+ }
+ }
+ }
+ const times = this._times;
+ const otherTimes = other._times;
+ length3 = times.length;
+ if (length3 !== otherTimes.length) {
+ return false;
+ }
+ for (i = 0; i < length3; i++) {
+ if (!JulianDate_default.equals(times[i], otherTimes[i])) {
+ return false;
+ }
+ }
+ const values = this._values;
+ const otherValues = other._values;
+ length3 = values.length;
+ for (i = 0; i < length3; i++) {
+ if (values[i] !== otherValues[i]) {
+ return false;
+ }
+ }
+ return true;
+};
+SampledProperty._mergeNewSamples = mergeNewSamples;
+var SampledProperty_default = SampledProperty;
+
+// Source/DataSources/SampledPositionProperty.js
+function SampledPositionProperty(referenceFrame, numberOfDerivatives) {
+ numberOfDerivatives = defaultValue_default(numberOfDerivatives, 0);
+ let derivativeTypes;
+ if (numberOfDerivatives > 0) {
+ derivativeTypes = new Array(numberOfDerivatives);
+ for (let i = 0; i < numberOfDerivatives; i++) {
+ derivativeTypes[i] = Cartesian3_default;
+ }
+ }
+ this._numberOfDerivatives = numberOfDerivatives;
+ this._property = new SampledProperty_default(Cartesian3_default, derivativeTypes);
+ this._definitionChanged = new Event_default();
+ this._referenceFrame = defaultValue_default(referenceFrame, ReferenceFrame_default.FIXED);
+ this._property._definitionChanged.addEventListener(function() {
+ this._definitionChanged.raiseEvent(this);
+ }, this);
+}
+Object.defineProperties(SampledPositionProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return this._property.isConstant;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ referenceFrame: {
+ get: function() {
+ return this._referenceFrame;
+ }
+ },
+ interpolationDegree: {
+ get: function() {
+ return this._property.interpolationDegree;
+ }
+ },
+ interpolationAlgorithm: {
+ get: function() {
+ return this._property.interpolationAlgorithm;
+ }
+ },
+ numberOfDerivatives: {
+ get: function() {
+ return this._numberOfDerivatives;
+ }
+ },
+ forwardExtrapolationType: {
+ get: function() {
+ return this._property.forwardExtrapolationType;
+ },
+ set: function(value) {
+ this._property.forwardExtrapolationType = value;
+ }
+ },
+ forwardExtrapolationDuration: {
+ get: function() {
+ return this._property.forwardExtrapolationDuration;
+ },
+ set: function(value) {
+ this._property.forwardExtrapolationDuration = value;
+ }
+ },
+ backwardExtrapolationType: {
+ get: function() {
+ return this._property.backwardExtrapolationType;
+ },
+ set: function(value) {
+ this._property.backwardExtrapolationType = value;
+ }
+ },
+ backwardExtrapolationDuration: {
+ get: function() {
+ return this._property.backwardExtrapolationDuration;
+ },
+ set: function(value) {
+ this._property.backwardExtrapolationDuration = value;
+ }
+ }
+});
+SampledPositionProperty.prototype.getValue = function(time, result) {
+ return this.getValueInReferenceFrame(time, ReferenceFrame_default.FIXED, result);
+};
+SampledPositionProperty.prototype.getValueInReferenceFrame = function(time, referenceFrame, result) {
+ Check_default.defined("time", time);
+ Check_default.defined("referenceFrame", referenceFrame);
+ result = this._property.getValue(time, result);
+ if (defined_default(result)) {
+ return PositionProperty_default.convertToReferenceFrame(
+ time,
+ result,
+ this._referenceFrame,
+ referenceFrame,
+ result
+ );
+ }
+ return void 0;
+};
+SampledPositionProperty.prototype.setInterpolationOptions = function(options) {
+ this._property.setInterpolationOptions(options);
+};
+SampledPositionProperty.prototype.addSample = function(time, position, derivatives) {
+ const numberOfDerivatives = this._numberOfDerivatives;
+ if (numberOfDerivatives > 0 && (!defined_default(derivatives) || derivatives.length !== numberOfDerivatives)) {
+ throw new DeveloperError_default(
+ "derivatives length must be equal to the number of derivatives."
+ );
+ }
+ this._property.addSample(time, position, derivatives);
+};
+SampledPositionProperty.prototype.addSamples = function(times, positions, derivatives) {
+ this._property.addSamples(times, positions, derivatives);
+};
+SampledPositionProperty.prototype.addSamplesPackedArray = function(packedSamples, epoch2) {
+ this._property.addSamplesPackedArray(packedSamples, epoch2);
+};
+SampledPositionProperty.prototype.removeSample = function(time) {
+ return this._property.removeSample(time);
+};
+SampledPositionProperty.prototype.removeSamples = function(timeInterval) {
+ this._property.removeSamples(timeInterval);
+};
+SampledPositionProperty.prototype.equals = function(other) {
+ return this === other || other instanceof SampledPositionProperty && Property_default.equals(this._property, other._property) && this._referenceFrame === other._referenceFrame;
+};
+var SampledPositionProperty_default = SampledPositionProperty;
+
+// Source/DataSources/StripeOrientation.js
+var StripeOrientation = {
+ HORIZONTAL: 0,
+ VERTICAL: 1
+};
+var StripeOrientation_default = Object.freeze(StripeOrientation);
+
+// Source/DataSources/StripeMaterialProperty.js
+var defaultOrientation = StripeOrientation_default.HORIZONTAL;
+var defaultEvenColor2 = Color_default.WHITE;
+var defaultOddColor2 = Color_default.BLACK;
+var defaultOffset4 = 0;
+var defaultRepeat3 = 1;
+function StripeMaterialProperty(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._definitionChanged = new Event_default();
+ this._orientation = void 0;
+ this._orientationSubscription = void 0;
+ this._evenColor = void 0;
+ this._evenColorSubscription = void 0;
+ this._oddColor = void 0;
+ this._oddColorSubscription = void 0;
+ this._offset = void 0;
+ this._offsetSubscription = void 0;
+ this._repeat = void 0;
+ this._repeatSubscription = void 0;
+ this.orientation = options.orientation;
+ this.evenColor = options.evenColor;
+ this.oddColor = options.oddColor;
+ this.offset = options.offset;
+ this.repeat = options.repeat;
+}
+Object.defineProperties(StripeMaterialProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._orientation) && Property_default.isConstant(this._evenColor) && Property_default.isConstant(this._oddColor) && Property_default.isConstant(this._offset) && Property_default.isConstant(this._repeat);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ orientation: createPropertyDescriptor_default("orientation"),
+ evenColor: createPropertyDescriptor_default("evenColor"),
+ oddColor: createPropertyDescriptor_default("oddColor"),
+ offset: createPropertyDescriptor_default("offset"),
+ repeat: createPropertyDescriptor_default("repeat")
+});
+StripeMaterialProperty.prototype.getType = function(time) {
+ return "Stripe";
+};
+StripeMaterialProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(result)) {
+ result = {};
+ }
+ result.horizontal = Property_default.getValueOrDefault(this._orientation, time, defaultOrientation) === StripeOrientation_default.HORIZONTAL;
+ result.evenColor = Property_default.getValueOrClonedDefault(
+ this._evenColor,
+ time,
+ defaultEvenColor2,
+ result.evenColor
+ );
+ result.oddColor = Property_default.getValueOrClonedDefault(
+ this._oddColor,
+ time,
+ defaultOddColor2,
+ result.oddColor
+ );
+ result.offset = Property_default.getValueOrDefault(this._offset, time, defaultOffset4);
+ result.repeat = Property_default.getValueOrDefault(this._repeat, time, defaultRepeat3);
+ return result;
+};
+StripeMaterialProperty.prototype.equals = function(other) {
+ return this === other || other instanceof StripeMaterialProperty && Property_default.equals(this._orientation, other._orientation) && Property_default.equals(this._evenColor, other._evenColor) && Property_default.equals(this._oddColor, other._oddColor) && Property_default.equals(this._offset, other._offset) && Property_default.equals(this._repeat, other._repeat);
+};
+var StripeMaterialProperty_default = StripeMaterialProperty;
+
+// Source/DataSources/TimeIntervalCollectionPositionProperty.js
+function TimeIntervalCollectionPositionProperty(referenceFrame) {
+ this._definitionChanged = new Event_default();
+ this._intervals = new TimeIntervalCollection_default();
+ this._intervals.changedEvent.addEventListener(
+ TimeIntervalCollectionPositionProperty.prototype._intervalsChanged,
+ this
+ );
+ this._referenceFrame = defaultValue_default(referenceFrame, ReferenceFrame_default.FIXED);
+}
+Object.defineProperties(TimeIntervalCollectionPositionProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return this._intervals.isEmpty;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ intervals: {
+ get: function() {
+ return this._intervals;
+ }
+ },
+ referenceFrame: {
+ get: function() {
+ return this._referenceFrame;
+ }
+ }
+});
+TimeIntervalCollectionPositionProperty.prototype.getValue = function(time, result) {
+ return this.getValueInReferenceFrame(time, ReferenceFrame_default.FIXED, result);
+};
+TimeIntervalCollectionPositionProperty.prototype.getValueInReferenceFrame = function(time, referenceFrame, result) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ if (!defined_default(referenceFrame)) {
+ throw new DeveloperError_default("referenceFrame is required.");
+ }
+ const position = this._intervals.findDataForIntervalContainingDate(time);
+ if (defined_default(position)) {
+ return PositionProperty_default.convertToReferenceFrame(
+ time,
+ position,
+ this._referenceFrame,
+ referenceFrame,
+ result
+ );
+ }
+ return void 0;
+};
+TimeIntervalCollectionPositionProperty.prototype.equals = function(other) {
+ return this === other || other instanceof TimeIntervalCollectionPositionProperty && this._intervals.equals(other._intervals, Property_default.equals) && this._referenceFrame === other._referenceFrame;
+};
+TimeIntervalCollectionPositionProperty.prototype._intervalsChanged = function() {
+ this._definitionChanged.raiseEvent(this);
+};
+var TimeIntervalCollectionPositionProperty_default = TimeIntervalCollectionPositionProperty;
+
+// Source/DataSources/TimeIntervalCollectionProperty.js
+function TimeIntervalCollectionProperty() {
+ this._definitionChanged = new Event_default();
+ this._intervals = new TimeIntervalCollection_default();
+ this._intervals.changedEvent.addEventListener(
+ TimeIntervalCollectionProperty.prototype._intervalsChanged,
+ this
+ );
+}
+Object.defineProperties(TimeIntervalCollectionProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return this._intervals.isEmpty;
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ intervals: {
+ get: function() {
+ return this._intervals;
+ }
+ }
+});
+TimeIntervalCollectionProperty.prototype.getValue = function(time, result) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required");
+ }
+ const value = this._intervals.findDataForIntervalContainingDate(time);
+ if (defined_default(value) && typeof value.clone === "function") {
+ return value.clone(result);
+ }
+ return value;
+};
+TimeIntervalCollectionProperty.prototype.equals = function(other) {
+ return this === other || other instanceof TimeIntervalCollectionProperty && this._intervals.equals(other._intervals, Property_default.equals);
+};
+TimeIntervalCollectionProperty.prototype._intervalsChanged = function() {
+ this._definitionChanged.raiseEvent(this);
+};
+var TimeIntervalCollectionProperty_default = TimeIntervalCollectionProperty;
+
+// Source/DataSources/VelocityVectorProperty.js
+function VelocityVectorProperty(position, normalize2) {
+ this._position = void 0;
+ this._subscription = void 0;
+ this._definitionChanged = new Event_default();
+ this._normalize = defaultValue_default(normalize2, true);
+ this.position = position;
+}
+Object.defineProperties(VelocityVectorProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._position);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ position: {
+ get: function() {
+ return this._position;
+ },
+ set: function(value) {
+ const oldValue2 = this._position;
+ if (oldValue2 !== value) {
+ if (defined_default(oldValue2)) {
+ this._subscription();
+ }
+ this._position = value;
+ if (defined_default(value)) {
+ this._subscription = value._definitionChanged.addEventListener(
+ function() {
+ this._definitionChanged.raiseEvent(this);
+ },
+ this
+ );
+ }
+ this._definitionChanged.raiseEvent(this);
+ }
+ }
+ },
+ normalize: {
+ get: function() {
+ return this._normalize;
+ },
+ set: function(value) {
+ if (this._normalize === value) {
+ return;
+ }
+ this._normalize = value;
+ this._definitionChanged.raiseEvent(this);
+ }
+ }
+});
+var position1Scratch = new Cartesian3_default();
+var position2Scratch = new Cartesian3_default();
+var timeScratch = new JulianDate_default();
+var step = 1 / 60;
+VelocityVectorProperty.prototype.getValue = function(time, result) {
+ return this._getValue(time, result);
+};
+VelocityVectorProperty.prototype._getValue = function(time, velocityResult, positionResult) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required");
+ }
+ if (!defined_default(velocityResult)) {
+ velocityResult = new Cartesian3_default();
+ }
+ const property = this._position;
+ if (Property_default.isConstant(property)) {
+ return this._normalize ? void 0 : Cartesian3_default.clone(Cartesian3_default.ZERO, velocityResult);
+ }
+ let position1 = property.getValue(time, position1Scratch);
+ let position2 = property.getValue(
+ JulianDate_default.addSeconds(time, step, timeScratch),
+ position2Scratch
+ );
+ if (!defined_default(position1)) {
+ return void 0;
+ }
+ if (!defined_default(position2)) {
+ position2 = position1;
+ position1 = property.getValue(
+ JulianDate_default.addSeconds(time, -step, timeScratch),
+ position2Scratch
+ );
+ if (!defined_default(position1)) {
+ return void 0;
+ }
+ }
+ if (Cartesian3_default.equals(position1, position2)) {
+ return this._normalize ? void 0 : Cartesian3_default.clone(Cartesian3_default.ZERO, velocityResult);
+ }
+ if (defined_default(positionResult)) {
+ position1.clone(positionResult);
+ }
+ const velocity = Cartesian3_default.subtract(position2, position1, velocityResult);
+ if (this._normalize) {
+ return Cartesian3_default.normalize(velocity, velocityResult);
+ }
+ return Cartesian3_default.divideByScalar(velocity, step, velocityResult);
+};
+VelocityVectorProperty.prototype.equals = function(other) {
+ return this === other || other instanceof VelocityVectorProperty && Property_default.equals(this._position, other._position);
+};
+var VelocityVectorProperty_default = VelocityVectorProperty;
+
+// Source/DataSources/VelocityOrientationProperty.js
+function VelocityOrientationProperty(position, ellipsoid) {
+ this._velocityVectorProperty = new VelocityVectorProperty_default(position, true);
+ this._subscription = void 0;
+ this._ellipsoid = void 0;
+ this._definitionChanged = new Event_default();
+ this.ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ const that = this;
+ this._velocityVectorProperty.definitionChanged.addEventListener(function() {
+ that._definitionChanged.raiseEvent(that);
+ });
+}
+Object.defineProperties(VelocityOrientationProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._velocityVectorProperty);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ position: {
+ get: function() {
+ return this._velocityVectorProperty.position;
+ },
+ set: function(value) {
+ this._velocityVectorProperty.position = value;
+ }
+ },
+ ellipsoid: {
+ get: function() {
+ return this._ellipsoid;
+ },
+ set: function(value) {
+ const oldValue2 = this._ellipsoid;
+ if (oldValue2 !== value) {
+ this._ellipsoid = value;
+ this._definitionChanged.raiseEvent(this);
+ }
+ }
+ }
+});
+var positionScratch10 = new Cartesian3_default();
+var velocityScratch = new Cartesian3_default();
+var rotationScratch2 = new Matrix3_default();
+VelocityOrientationProperty.prototype.getValue = function(time, result) {
+ const velocity = this._velocityVectorProperty._getValue(
+ time,
+ velocityScratch,
+ positionScratch10
+ );
+ if (!defined_default(velocity)) {
+ return void 0;
+ }
+ Transforms_default.rotationMatrixFromPositionVelocity(
+ positionScratch10,
+ velocity,
+ this._ellipsoid,
+ rotationScratch2
+ );
+ return Quaternion_default.fromRotationMatrix(rotationScratch2, result);
+};
+VelocityOrientationProperty.prototype.equals = function(other) {
+ return this === other || other instanceof VelocityOrientationProperty && Property_default.equals(
+ this._velocityVectorProperty,
+ other._velocityVectorProperty
+ ) && (this._ellipsoid === other._ellipsoid || this._ellipsoid.equals(other._ellipsoid));
+};
+var VelocityOrientationProperty_default = VelocityOrientationProperty;
+
+// Source/DataSources/CzmlDataSource.js
+function UnitCartesian3() {
+}
+UnitCartesian3.packedLength = Cartesian3_default.packedLength;
+UnitCartesian3.unpack = Cartesian3_default.unpack;
+UnitCartesian3.pack = Cartesian3_default.pack;
+var currentId;
+function createReferenceProperty(entityCollection, referenceString) {
+ if (referenceString[0] === "#") {
+ referenceString = currentId + referenceString;
+ }
+ return ReferenceProperty_default.fromString(entityCollection, referenceString);
+}
+function createSpecializedProperty(type, entityCollection, packetData) {
+ if (defined_default(packetData.reference)) {
+ return createReferenceProperty(entityCollection, packetData.reference);
+ }
+ if (defined_default(packetData.velocityReference)) {
+ const referenceProperty = createReferenceProperty(
+ entityCollection,
+ packetData.velocityReference
+ );
+ switch (type) {
+ case Cartesian3_default:
+ case UnitCartesian3:
+ return new VelocityVectorProperty_default(
+ referenceProperty,
+ type === UnitCartesian3
+ );
+ case Quaternion_default:
+ return new VelocityOrientationProperty_default(referenceProperty);
+ }
+ }
+ throw new RuntimeError_default(`${JSON.stringify(packetData)} is not valid CZML.`);
+}
+function createAdapterProperty(property, adapterFunction) {
+ return new CallbackProperty_default(function(time, result) {
+ return adapterFunction(property.getValue(time, result));
+ }, property.isConstant);
+}
+var scratchCartesian15 = new Cartesian3_default();
+var scratchSpherical = new Spherical_default();
+var scratchCartographic9 = new Cartographic_default();
+var scratchTimeInterval = new TimeInterval_default();
+var scratchQuaternion = new Quaternion_default();
+function unwrapColorInterval(czmlInterval) {
+ let rgbaf = czmlInterval.rgbaf;
+ if (defined_default(rgbaf)) {
+ return rgbaf;
+ }
+ const rgba = czmlInterval.rgba;
+ if (!defined_default(rgba)) {
+ return void 0;
+ }
+ const length3 = rgba.length;
+ if (length3 === Color_default.packedLength) {
+ return [
+ Color_default.byteToFloat(rgba[0]),
+ Color_default.byteToFloat(rgba[1]),
+ Color_default.byteToFloat(rgba[2]),
+ Color_default.byteToFloat(rgba[3])
+ ];
+ }
+ rgbaf = new Array(length3);
+ for (let i = 0; i < length3; i += 5) {
+ rgbaf[i] = rgba[i];
+ rgbaf[i + 1] = Color_default.byteToFloat(rgba[i + 1]);
+ rgbaf[i + 2] = Color_default.byteToFloat(rgba[i + 2]);
+ rgbaf[i + 3] = Color_default.byteToFloat(rgba[i + 3]);
+ rgbaf[i + 4] = Color_default.byteToFloat(rgba[i + 4]);
+ }
+ return rgbaf;
+}
+function unwrapUriInterval(czmlInterval, sourceUri) {
+ const uri = defaultValue_default(czmlInterval.uri, czmlInterval);
+ if (defined_default(sourceUri)) {
+ return sourceUri.getDerivedResource({
+ url: uri
+ });
+ }
+ return Resource_default.createIfNeeded(uri);
+}
+function unwrapRectangleInterval(czmlInterval) {
+ let wsen = czmlInterval.wsen;
+ if (defined_default(wsen)) {
+ return wsen;
+ }
+ const wsenDegrees = czmlInterval.wsenDegrees;
+ if (!defined_default(wsenDegrees)) {
+ return void 0;
+ }
+ const length3 = wsenDegrees.length;
+ if (length3 === Rectangle_default.packedLength) {
+ return [
+ Math_default.toRadians(wsenDegrees[0]),
+ Math_default.toRadians(wsenDegrees[1]),
+ Math_default.toRadians(wsenDegrees[2]),
+ Math_default.toRadians(wsenDegrees[3])
+ ];
+ }
+ wsen = new Array(length3);
+ for (let i = 0; i < length3; i += 5) {
+ wsen[i] = wsenDegrees[i];
+ wsen[i + 1] = Math_default.toRadians(wsenDegrees[i + 1]);
+ wsen[i + 2] = Math_default.toRadians(wsenDegrees[i + 2]);
+ wsen[i + 3] = Math_default.toRadians(wsenDegrees[i + 3]);
+ wsen[i + 4] = Math_default.toRadians(wsenDegrees[i + 4]);
+ }
+ return wsen;
+}
+function convertUnitSphericalToCartesian(unitSpherical) {
+ const length3 = unitSpherical.length;
+ scratchSpherical.magnitude = 1;
+ if (length3 === 2) {
+ scratchSpherical.clock = unitSpherical[0];
+ scratchSpherical.cone = unitSpherical[1];
+ Cartesian3_default.fromSpherical(scratchSpherical, scratchCartesian15);
+ return [scratchCartesian15.x, scratchCartesian15.y, scratchCartesian15.z];
+ }
+ const result = new Array(length3 / 3 * 4);
+ for (let i = 0, j = 0; i < length3; i += 3, j += 4) {
+ result[j] = unitSpherical[i];
+ scratchSpherical.clock = unitSpherical[i + 1];
+ scratchSpherical.cone = unitSpherical[i + 2];
+ Cartesian3_default.fromSpherical(scratchSpherical, scratchCartesian15);
+ result[j + 1] = scratchCartesian15.x;
+ result[j + 2] = scratchCartesian15.y;
+ result[j + 3] = scratchCartesian15.z;
+ }
+ return result;
+}
+function convertSphericalToCartesian(spherical) {
+ const length3 = spherical.length;
+ if (length3 === 3) {
+ scratchSpherical.clock = spherical[0];
+ scratchSpherical.cone = spherical[1];
+ scratchSpherical.magnitude = spherical[2];
+ Cartesian3_default.fromSpherical(scratchSpherical, scratchCartesian15);
+ return [scratchCartesian15.x, scratchCartesian15.y, scratchCartesian15.z];
+ }
+ const result = new Array(length3);
+ for (let i = 0; i < length3; i += 4) {
+ result[i] = spherical[i];
+ scratchSpherical.clock = spherical[i + 1];
+ scratchSpherical.cone = spherical[i + 2];
+ scratchSpherical.magnitude = spherical[i + 3];
+ Cartesian3_default.fromSpherical(scratchSpherical, scratchCartesian15);
+ result[i + 1] = scratchCartesian15.x;
+ result[i + 2] = scratchCartesian15.y;
+ result[i + 3] = scratchCartesian15.z;
+ }
+ return result;
+}
+function convertCartographicRadiansToCartesian(cartographicRadians) {
+ const length3 = cartographicRadians.length;
+ if (length3 === 3) {
+ scratchCartographic9.longitude = cartographicRadians[0];
+ scratchCartographic9.latitude = cartographicRadians[1];
+ scratchCartographic9.height = cartographicRadians[2];
+ Ellipsoid_default.WGS84.cartographicToCartesian(
+ scratchCartographic9,
+ scratchCartesian15
+ );
+ return [scratchCartesian15.x, scratchCartesian15.y, scratchCartesian15.z];
+ }
+ const result = new Array(length3);
+ for (let i = 0; i < length3; i += 4) {
+ result[i] = cartographicRadians[i];
+ scratchCartographic9.longitude = cartographicRadians[i + 1];
+ scratchCartographic9.latitude = cartographicRadians[i + 2];
+ scratchCartographic9.height = cartographicRadians[i + 3];
+ Ellipsoid_default.WGS84.cartographicToCartesian(
+ scratchCartographic9,
+ scratchCartesian15
+ );
+ result[i + 1] = scratchCartesian15.x;
+ result[i + 2] = scratchCartesian15.y;
+ result[i + 3] = scratchCartesian15.z;
+ }
+ return result;
+}
+function convertCartographicDegreesToCartesian(cartographicDegrees) {
+ const length3 = cartographicDegrees.length;
+ if (length3 === 3) {
+ scratchCartographic9.longitude = Math_default.toRadians(
+ cartographicDegrees[0]
+ );
+ scratchCartographic9.latitude = Math_default.toRadians(cartographicDegrees[1]);
+ scratchCartographic9.height = cartographicDegrees[2];
+ Ellipsoid_default.WGS84.cartographicToCartesian(
+ scratchCartographic9,
+ scratchCartesian15
+ );
+ return [scratchCartesian15.x, scratchCartesian15.y, scratchCartesian15.z];
+ }
+ const result = new Array(length3);
+ for (let i = 0; i < length3; i += 4) {
+ result[i] = cartographicDegrees[i];
+ scratchCartographic9.longitude = Math_default.toRadians(
+ cartographicDegrees[i + 1]
+ );
+ scratchCartographic9.latitude = Math_default.toRadians(
+ cartographicDegrees[i + 2]
+ );
+ scratchCartographic9.height = cartographicDegrees[i + 3];
+ Ellipsoid_default.WGS84.cartographicToCartesian(
+ scratchCartographic9,
+ scratchCartesian15
+ );
+ result[i + 1] = scratchCartesian15.x;
+ result[i + 2] = scratchCartesian15.y;
+ result[i + 3] = scratchCartesian15.z;
+ }
+ return result;
+}
+function unwrapCartesianInterval(czmlInterval) {
+ const cartesian11 = czmlInterval.cartesian;
+ if (defined_default(cartesian11)) {
+ return cartesian11;
+ }
+ const cartesianVelocity = czmlInterval.cartesianVelocity;
+ if (defined_default(cartesianVelocity)) {
+ return cartesianVelocity;
+ }
+ const unitCartesian = czmlInterval.unitCartesian;
+ if (defined_default(unitCartesian)) {
+ return unitCartesian;
+ }
+ const unitSpherical = czmlInterval.unitSpherical;
+ if (defined_default(unitSpherical)) {
+ return convertUnitSphericalToCartesian(unitSpherical);
+ }
+ const spherical = czmlInterval.spherical;
+ if (defined_default(spherical)) {
+ return convertSphericalToCartesian(spherical);
+ }
+ const cartographicRadians = czmlInterval.cartographicRadians;
+ if (defined_default(cartographicRadians)) {
+ return convertCartographicRadiansToCartesian(cartographicRadians);
+ }
+ const cartographicDegrees = czmlInterval.cartographicDegrees;
+ if (defined_default(cartographicDegrees)) {
+ return convertCartographicDegreesToCartesian(cartographicDegrees);
+ }
+ throw new RuntimeError_default(
+ `${JSON.stringify(czmlInterval)} is not a valid CZML interval.`
+ );
+}
+function normalizePackedCartesianArray(array, startingIndex) {
+ Cartesian3_default.unpack(array, startingIndex, scratchCartesian15);
+ Cartesian3_default.normalize(scratchCartesian15, scratchCartesian15);
+ Cartesian3_default.pack(scratchCartesian15, array, startingIndex);
+}
+function unwrapUnitCartesianInterval(czmlInterval) {
+ const cartesian11 = unwrapCartesianInterval(czmlInterval);
+ if (cartesian11.length === 3) {
+ normalizePackedCartesianArray(cartesian11, 0);
+ return cartesian11;
+ }
+ for (let i = 1; i < cartesian11.length; i += 4) {
+ normalizePackedCartesianArray(cartesian11, i);
+ }
+ return cartesian11;
+}
+function normalizePackedQuaternionArray(array, startingIndex) {
+ Quaternion_default.unpack(array, startingIndex, scratchQuaternion);
+ Quaternion_default.normalize(scratchQuaternion, scratchQuaternion);
+ Quaternion_default.pack(scratchQuaternion, array, startingIndex);
+}
+function unwrapQuaternionInterval(czmlInterval) {
+ const unitQuaternion = czmlInterval.unitQuaternion;
+ if (defined_default(unitQuaternion)) {
+ if (unitQuaternion.length === 4) {
+ normalizePackedQuaternionArray(unitQuaternion, 0);
+ return unitQuaternion;
+ }
+ for (let i = 1; i < unitQuaternion.length; i += 5) {
+ normalizePackedQuaternionArray(unitQuaternion, i);
+ }
+ }
+ return unitQuaternion;
+}
+function getPropertyType(czmlInterval) {
+ if (typeof czmlInterval === "boolean") {
+ return Boolean;
+ } else if (typeof czmlInterval === "number") {
+ return Number;
+ } else if (typeof czmlInterval === "string") {
+ return String;
+ } else if (czmlInterval.hasOwnProperty("array")) {
+ return Array;
+ } else if (czmlInterval.hasOwnProperty("boolean")) {
+ return Boolean;
+ } else if (czmlInterval.hasOwnProperty("boundingRectangle")) {
+ return BoundingRectangle_default;
+ } else if (czmlInterval.hasOwnProperty("cartesian2")) {
+ return Cartesian2_default;
+ } else if (czmlInterval.hasOwnProperty("cartesian") || czmlInterval.hasOwnProperty("spherical") || czmlInterval.hasOwnProperty("cartographicRadians") || czmlInterval.hasOwnProperty("cartographicDegrees")) {
+ return Cartesian3_default;
+ } else if (czmlInterval.hasOwnProperty("unitCartesian") || czmlInterval.hasOwnProperty("unitSpherical")) {
+ return UnitCartesian3;
+ } else if (czmlInterval.hasOwnProperty("rgba") || czmlInterval.hasOwnProperty("rgbaf")) {
+ return Color_default;
+ } else if (czmlInterval.hasOwnProperty("arcType")) {
+ return ArcType_default;
+ } else if (czmlInterval.hasOwnProperty("classificationType")) {
+ return ClassificationType_default;
+ } else if (czmlInterval.hasOwnProperty("colorBlendMode")) {
+ return ColorBlendMode_default;
+ } else if (czmlInterval.hasOwnProperty("cornerType")) {
+ return CornerType_default;
+ } else if (czmlInterval.hasOwnProperty("heightReference")) {
+ return HeightReference_default;
+ } else if (czmlInterval.hasOwnProperty("horizontalOrigin")) {
+ return HorizontalOrigin_default;
+ } else if (czmlInterval.hasOwnProperty("date")) {
+ return JulianDate_default;
+ } else if (czmlInterval.hasOwnProperty("labelStyle")) {
+ return LabelStyle_default;
+ } else if (czmlInterval.hasOwnProperty("number")) {
+ return Number;
+ } else if (czmlInterval.hasOwnProperty("nearFarScalar")) {
+ return NearFarScalar_default;
+ } else if (czmlInterval.hasOwnProperty("distanceDisplayCondition")) {
+ return DistanceDisplayCondition_default;
+ } else if (czmlInterval.hasOwnProperty("object") || czmlInterval.hasOwnProperty("value")) {
+ return Object;
+ } else if (czmlInterval.hasOwnProperty("unitQuaternion")) {
+ return Quaternion_default;
+ } else if (czmlInterval.hasOwnProperty("shadowMode")) {
+ return ShadowMode_default;
+ } else if (czmlInterval.hasOwnProperty("string")) {
+ return String;
+ } else if (czmlInterval.hasOwnProperty("stripeOrientation")) {
+ return StripeOrientation_default;
+ } else if (czmlInterval.hasOwnProperty("wsen") || czmlInterval.hasOwnProperty("wsenDegrees")) {
+ return Rectangle_default;
+ } else if (czmlInterval.hasOwnProperty("uri")) {
+ return import_urijs9.default;
+ } else if (czmlInterval.hasOwnProperty("verticalOrigin")) {
+ return VerticalOrigin_default;
+ }
+ return Object;
+}
+function unwrapInterval(type, czmlInterval, sourceUri) {
+ switch (type) {
+ case ArcType_default:
+ return ArcType_default[defaultValue_default(czmlInterval.arcType, czmlInterval)];
+ case Array:
+ return czmlInterval.array;
+ case Boolean:
+ return defaultValue_default(czmlInterval["boolean"], czmlInterval);
+ case BoundingRectangle_default:
+ return czmlInterval.boundingRectangle;
+ case Cartesian2_default:
+ return czmlInterval.cartesian2;
+ case Cartesian3_default:
+ return unwrapCartesianInterval(czmlInterval);
+ case UnitCartesian3:
+ return unwrapUnitCartesianInterval(czmlInterval);
+ case Color_default:
+ return unwrapColorInterval(czmlInterval);
+ case ClassificationType_default:
+ return ClassificationType_default[defaultValue_default(czmlInterval.classificationType, czmlInterval)];
+ case ColorBlendMode_default:
+ return ColorBlendMode_default[defaultValue_default(czmlInterval.colorBlendMode, czmlInterval)];
+ case CornerType_default:
+ return CornerType_default[defaultValue_default(czmlInterval.cornerType, czmlInterval)];
+ case HeightReference_default:
+ return HeightReference_default[defaultValue_default(czmlInterval.heightReference, czmlInterval)];
+ case HorizontalOrigin_default:
+ return HorizontalOrigin_default[defaultValue_default(czmlInterval.horizontalOrigin, czmlInterval)];
+ case Image:
+ return unwrapUriInterval(czmlInterval, sourceUri);
+ case JulianDate_default:
+ return JulianDate_default.fromIso8601(
+ defaultValue_default(czmlInterval.date, czmlInterval)
+ );
+ case LabelStyle_default:
+ return LabelStyle_default[defaultValue_default(czmlInterval.labelStyle, czmlInterval)];
+ case Number:
+ return defaultValue_default(czmlInterval.number, czmlInterval);
+ case NearFarScalar_default:
+ return czmlInterval.nearFarScalar;
+ case DistanceDisplayCondition_default:
+ return czmlInterval.distanceDisplayCondition;
+ case Object:
+ return defaultValue_default(
+ defaultValue_default(czmlInterval.object, czmlInterval.value),
+ czmlInterval
+ );
+ case Quaternion_default:
+ return unwrapQuaternionInterval(czmlInterval);
+ case Rotation_default:
+ return defaultValue_default(czmlInterval.number, czmlInterval);
+ case ShadowMode_default:
+ return ShadowMode_default[defaultValue_default(
+ defaultValue_default(czmlInterval.shadowMode, czmlInterval.shadows),
+ czmlInterval
+ )];
+ case String:
+ return defaultValue_default(czmlInterval.string, czmlInterval);
+ case StripeOrientation_default:
+ return StripeOrientation_default[defaultValue_default(czmlInterval.stripeOrientation, czmlInterval)];
+ case Rectangle_default:
+ return unwrapRectangleInterval(czmlInterval);
+ case import_urijs9.default:
+ return unwrapUriInterval(czmlInterval, sourceUri);
+ case VerticalOrigin_default:
+ return VerticalOrigin_default[defaultValue_default(czmlInterval.verticalOrigin, czmlInterval)];
+ default:
+ throw new RuntimeError_default(type);
+ }
+}
+var interpolators = {
+ HERMITE: HermitePolynomialApproximation_default,
+ LAGRANGE: LagrangePolynomialApproximation_default,
+ LINEAR: LinearApproximation_default
+};
+function updateInterpolationSettings(packetData, property) {
+ const interpolationAlgorithm = packetData.interpolationAlgorithm;
+ const interpolationDegree = packetData.interpolationDegree;
+ if (defined_default(interpolationAlgorithm) || defined_default(interpolationDegree)) {
+ property.setInterpolationOptions({
+ interpolationAlgorithm: interpolators[interpolationAlgorithm],
+ interpolationDegree
+ });
+ }
+ const forwardExtrapolationType = packetData.forwardExtrapolationType;
+ if (defined_default(forwardExtrapolationType)) {
+ property.forwardExtrapolationType = ExtrapolationType_default[forwardExtrapolationType];
+ }
+ const forwardExtrapolationDuration = packetData.forwardExtrapolationDuration;
+ if (defined_default(forwardExtrapolationDuration)) {
+ property.forwardExtrapolationDuration = forwardExtrapolationDuration;
+ }
+ const backwardExtrapolationType = packetData.backwardExtrapolationType;
+ if (defined_default(backwardExtrapolationType)) {
+ property.backwardExtrapolationType = ExtrapolationType_default[backwardExtrapolationType];
+ }
+ const backwardExtrapolationDuration = packetData.backwardExtrapolationDuration;
+ if (defined_default(backwardExtrapolationDuration)) {
+ property.backwardExtrapolationDuration = backwardExtrapolationDuration;
+ }
+}
+var iso8601Scratch = {
+ iso8601: void 0
+};
+function intervalFromString(intervalString) {
+ if (!defined_default(intervalString)) {
+ return void 0;
+ }
+ iso8601Scratch.iso8601 = intervalString;
+ return TimeInterval_default.fromIso8601(iso8601Scratch);
+}
+function wrapPropertyInInfiniteInterval(property) {
+ const interval = Iso8601_default.MAXIMUM_INTERVAL.clone();
+ interval.data = property;
+ return interval;
+}
+function convertPropertyToComposite(property) {
+ const composite = new CompositeProperty_default();
+ composite.intervals.addInterval(wrapPropertyInInfiniteInterval(property));
+ return composite;
+}
+function convertPositionPropertyToComposite(property) {
+ const composite = new CompositePositionProperty_default(property.referenceFrame);
+ composite.intervals.addInterval(wrapPropertyInInfiniteInterval(property));
+ return composite;
+}
+function processProperty(type, object2, propertyName, packetData, constrainedInterval, sourceUri, entityCollection) {
+ let combinedInterval = intervalFromString(packetData.interval);
+ if (defined_default(constrainedInterval)) {
+ if (defined_default(combinedInterval)) {
+ combinedInterval = TimeInterval_default.intersect(
+ combinedInterval,
+ constrainedInterval,
+ scratchTimeInterval
+ );
+ } else {
+ combinedInterval = constrainedInterval;
+ }
+ }
+ let packedLength;
+ let unwrappedInterval;
+ let unwrappedIntervalLength;
+ const isValue = !defined_default(packetData.reference) && !defined_default(packetData.velocityReference);
+ const hasInterval = defined_default(combinedInterval) && !combinedInterval.equals(Iso8601_default.MAXIMUM_INTERVAL);
+ if (packetData.delete === true) {
+ if (!hasInterval) {
+ object2[propertyName] = void 0;
+ return;
+ }
+ return removePropertyData(object2[propertyName], combinedInterval);
+ }
+ let isSampled = false;
+ if (isValue) {
+ unwrappedInterval = unwrapInterval(type, packetData, sourceUri);
+ if (!defined_default(unwrappedInterval)) {
+ return;
+ }
+ packedLength = defaultValue_default(type.packedLength, 1);
+ unwrappedIntervalLength = defaultValue_default(unwrappedInterval.length, 1);
+ isSampled = !defined_default(packetData.array) && typeof unwrappedInterval !== "string" && unwrappedIntervalLength > packedLength && type !== Object;
+ }
+ const needsUnpacking = typeof type.unpack === "function" && type !== Rotation_default;
+ if (!isSampled && !hasInterval) {
+ if (isValue) {
+ object2[propertyName] = new ConstantProperty_default(
+ needsUnpacking ? type.unpack(unwrappedInterval, 0) : unwrappedInterval
+ );
+ } else {
+ object2[propertyName] = createSpecializedProperty(
+ type,
+ entityCollection,
+ packetData
+ );
+ }
+ return;
+ }
+ let property = object2[propertyName];
+ let epoch2;
+ const packetEpoch = packetData.epoch;
+ if (defined_default(packetEpoch)) {
+ epoch2 = JulianDate_default.fromIso8601(packetEpoch);
+ }
+ if (isSampled && !hasInterval) {
+ if (!(property instanceof SampledProperty_default)) {
+ object2[propertyName] = property = new SampledProperty_default(type);
+ }
+ property.addSamplesPackedArray(unwrappedInterval, epoch2);
+ updateInterpolationSettings(packetData, property);
+ return;
+ }
+ let interval;
+ if (!isSampled && hasInterval) {
+ combinedInterval = combinedInterval.clone();
+ if (isValue) {
+ combinedInterval.data = needsUnpacking ? type.unpack(unwrappedInterval, 0) : unwrappedInterval;
+ } else {
+ combinedInterval.data = createSpecializedProperty(
+ type,
+ entityCollection,
+ packetData
+ );
+ }
+ if (!defined_default(property)) {
+ object2[propertyName] = property = isValue ? new TimeIntervalCollectionProperty_default() : new CompositeProperty_default();
+ }
+ if (isValue && property instanceof TimeIntervalCollectionProperty_default) {
+ property.intervals.addInterval(combinedInterval);
+ } else if (property instanceof CompositeProperty_default) {
+ if (isValue) {
+ combinedInterval.data = new ConstantProperty_default(combinedInterval.data);
+ }
+ property.intervals.addInterval(combinedInterval);
+ } else {
+ object2[propertyName] = property = convertPropertyToComposite(property);
+ if (isValue) {
+ combinedInterval.data = new ConstantProperty_default(combinedInterval.data);
+ }
+ property.intervals.addInterval(combinedInterval);
+ }
+ return;
+ }
+ if (!defined_default(property)) {
+ object2[propertyName] = property = new CompositeProperty_default();
+ }
+ if (!(property instanceof CompositeProperty_default)) {
+ object2[propertyName] = property = convertPropertyToComposite(property);
+ }
+ const intervals = property.intervals;
+ interval = intervals.findInterval(combinedInterval);
+ if (!defined_default(interval) || !(interval.data instanceof SampledProperty_default)) {
+ interval = combinedInterval.clone();
+ interval.data = new SampledProperty_default(type);
+ intervals.addInterval(interval);
+ }
+ interval.data.addSamplesPackedArray(unwrappedInterval, epoch2);
+ updateInterpolationSettings(packetData, interval.data);
+}
+function removePropertyData(property, interval) {
+ if (property instanceof SampledProperty_default) {
+ property.removeSamples(interval);
+ return;
+ } else if (property instanceof TimeIntervalCollectionProperty_default) {
+ property.intervals.removeInterval(interval);
+ return;
+ } else if (property instanceof CompositeProperty_default) {
+ const intervals = property.intervals;
+ for (let i = 0; i < intervals.length; ++i) {
+ const intersection = TimeInterval_default.intersect(
+ intervals.get(i),
+ interval,
+ scratchTimeInterval
+ );
+ if (!intersection.isEmpty) {
+ removePropertyData(intersection.data, interval);
+ }
+ }
+ intervals.removeInterval(interval);
+ return;
+ }
+}
+function processPacketData(type, object2, propertyName, packetData, interval, sourceUri, entityCollection) {
+ if (!defined_default(packetData)) {
+ return;
+ }
+ if (Array.isArray(packetData)) {
+ for (let i = 0, len = packetData.length; i < len; ++i) {
+ processProperty(
+ type,
+ object2,
+ propertyName,
+ packetData[i],
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ }
+ } else {
+ processProperty(
+ type,
+ object2,
+ propertyName,
+ packetData,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ }
+}
+function processPositionProperty(object2, propertyName, packetData, constrainedInterval, sourceUri, entityCollection) {
+ let combinedInterval = intervalFromString(packetData.interval);
+ if (defined_default(constrainedInterval)) {
+ if (defined_default(combinedInterval)) {
+ combinedInterval = TimeInterval_default.intersect(
+ combinedInterval,
+ constrainedInterval,
+ scratchTimeInterval
+ );
+ } else {
+ combinedInterval = constrainedInterval;
+ }
+ }
+ const numberOfDerivatives = defined_default(packetData.cartesianVelocity) ? 1 : 0;
+ const packedLength = Cartesian3_default.packedLength * (numberOfDerivatives + 1);
+ let unwrappedInterval;
+ let unwrappedIntervalLength;
+ const isValue = !defined_default(packetData.reference);
+ const hasInterval = defined_default(combinedInterval) && !combinedInterval.equals(Iso8601_default.MAXIMUM_INTERVAL);
+ if (packetData.delete === true) {
+ if (!hasInterval) {
+ object2[propertyName] = void 0;
+ return;
+ }
+ return removePositionPropertyData(object2[propertyName], combinedInterval);
+ }
+ let referenceFrame;
+ let isSampled = false;
+ if (isValue) {
+ if (defined_default(packetData.referenceFrame)) {
+ referenceFrame = ReferenceFrame_default[packetData.referenceFrame];
+ }
+ referenceFrame = defaultValue_default(referenceFrame, ReferenceFrame_default.FIXED);
+ unwrappedInterval = unwrapCartesianInterval(packetData);
+ unwrappedIntervalLength = defaultValue_default(unwrappedInterval.length, 1);
+ isSampled = unwrappedIntervalLength > packedLength;
+ }
+ if (!isSampled && !hasInterval) {
+ if (isValue) {
+ object2[propertyName] = new ConstantPositionProperty_default(
+ Cartesian3_default.unpack(unwrappedInterval),
+ referenceFrame
+ );
+ } else {
+ object2[propertyName] = createReferenceProperty(
+ entityCollection,
+ packetData.reference
+ );
+ }
+ return;
+ }
+ let property = object2[propertyName];
+ let epoch2;
+ const packetEpoch = packetData.epoch;
+ if (defined_default(packetEpoch)) {
+ epoch2 = JulianDate_default.fromIso8601(packetEpoch);
+ }
+ if (isSampled && !hasInterval) {
+ if (!(property instanceof SampledPositionProperty_default) || defined_default(referenceFrame) && property.referenceFrame !== referenceFrame) {
+ object2[propertyName] = property = new SampledPositionProperty_default(
+ referenceFrame,
+ numberOfDerivatives
+ );
+ }
+ property.addSamplesPackedArray(unwrappedInterval, epoch2);
+ updateInterpolationSettings(packetData, property);
+ return;
+ }
+ let interval;
+ if (!isSampled && hasInterval) {
+ combinedInterval = combinedInterval.clone();
+ if (isValue) {
+ combinedInterval.data = Cartesian3_default.unpack(unwrappedInterval);
+ } else {
+ combinedInterval.data = createReferenceProperty(
+ entityCollection,
+ packetData.reference
+ );
+ }
+ if (!defined_default(property)) {
+ if (isValue) {
+ property = new TimeIntervalCollectionPositionProperty_default(referenceFrame);
+ } else {
+ property = new CompositePositionProperty_default(referenceFrame);
+ }
+ object2[propertyName] = property;
+ }
+ if (isValue && property instanceof TimeIntervalCollectionPositionProperty_default && defined_default(referenceFrame) && property.referenceFrame === referenceFrame) {
+ property.intervals.addInterval(combinedInterval);
+ } else if (property instanceof CompositePositionProperty_default) {
+ if (isValue) {
+ combinedInterval.data = new ConstantPositionProperty_default(
+ combinedInterval.data,
+ referenceFrame
+ );
+ }
+ property.intervals.addInterval(combinedInterval);
+ } else {
+ object2[propertyName] = property = convertPositionPropertyToComposite(
+ property
+ );
+ if (isValue) {
+ combinedInterval.data = new ConstantPositionProperty_default(
+ combinedInterval.data,
+ referenceFrame
+ );
+ }
+ property.intervals.addInterval(combinedInterval);
+ }
+ return;
+ }
+ if (!defined_default(property)) {
+ object2[propertyName] = property = new CompositePositionProperty_default(
+ referenceFrame
+ );
+ } else if (!(property instanceof CompositePositionProperty_default)) {
+ object2[propertyName] = property = convertPositionPropertyToComposite(
+ property
+ );
+ }
+ const intervals = property.intervals;
+ interval = intervals.findInterval(combinedInterval);
+ if (!defined_default(interval) || !(interval.data instanceof SampledPositionProperty_default) || defined_default(referenceFrame) && interval.data.referenceFrame !== referenceFrame) {
+ interval = combinedInterval.clone();
+ interval.data = new SampledPositionProperty_default(
+ referenceFrame,
+ numberOfDerivatives
+ );
+ intervals.addInterval(interval);
+ }
+ interval.data.addSamplesPackedArray(unwrappedInterval, epoch2);
+ updateInterpolationSettings(packetData, interval.data);
+}
+function removePositionPropertyData(property, interval) {
+ if (property instanceof SampledPositionProperty_default) {
+ property.removeSamples(interval);
+ return;
+ } else if (property instanceof TimeIntervalCollectionPositionProperty_default) {
+ property.intervals.removeInterval(interval);
+ return;
+ } else if (property instanceof CompositePositionProperty_default) {
+ const intervals = property.intervals;
+ for (let i = 0; i < intervals.length; ++i) {
+ const intersection = TimeInterval_default.intersect(
+ intervals.get(i),
+ interval,
+ scratchTimeInterval
+ );
+ if (!intersection.isEmpty) {
+ removePositionPropertyData(intersection.data, interval);
+ }
+ }
+ intervals.removeInterval(interval);
+ return;
+ }
+}
+function processPositionPacketData(object2, propertyName, packetData, interval, sourceUri, entityCollection) {
+ if (!defined_default(packetData)) {
+ return;
+ }
+ if (Array.isArray(packetData)) {
+ for (let i = 0, len = packetData.length; i < len; ++i) {
+ processPositionProperty(
+ object2,
+ propertyName,
+ packetData[i],
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ }
+ } else {
+ processPositionProperty(
+ object2,
+ propertyName,
+ packetData,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ }
+}
+function processShapePacketData(object2, propertyName, packetData, entityCollection) {
+ if (defined_default(packetData.references)) {
+ processReferencesArrayPacketData(
+ object2,
+ propertyName,
+ packetData.references,
+ packetData.interval,
+ entityCollection,
+ PropertyArray_default,
+ CompositeProperty_default
+ );
+ } else {
+ if (defined_default(packetData.cartesian2)) {
+ packetData.array = Cartesian2_default.unpackArray(packetData.cartesian2);
+ } else if (defined_default(packetData.cartesian)) {
+ packetData.array = Cartesian2_default.unpackArray(packetData.cartesian);
+ }
+ if (defined_default(packetData.array)) {
+ processPacketData(
+ Array,
+ object2,
+ propertyName,
+ packetData,
+ void 0,
+ void 0,
+ entityCollection
+ );
+ }
+ }
+}
+function processMaterialProperty(object2, propertyName, packetData, constrainedInterval, sourceUri, entityCollection) {
+ let combinedInterval = intervalFromString(packetData.interval);
+ if (defined_default(constrainedInterval)) {
+ if (defined_default(combinedInterval)) {
+ combinedInterval = TimeInterval_default.intersect(
+ combinedInterval,
+ constrainedInterval,
+ scratchTimeInterval
+ );
+ } else {
+ combinedInterval = constrainedInterval;
+ }
+ }
+ let property = object2[propertyName];
+ let existingMaterial;
+ let existingInterval;
+ if (defined_default(combinedInterval)) {
+ if (!(property instanceof CompositeMaterialProperty_default)) {
+ property = new CompositeMaterialProperty_default();
+ object2[propertyName] = property;
+ }
+ const thisIntervals = property.intervals;
+ existingInterval = thisIntervals.findInterval({
+ start: combinedInterval.start,
+ stop: combinedInterval.stop
+ });
+ if (defined_default(existingInterval)) {
+ existingMaterial = existingInterval.data;
+ } else {
+ existingInterval = combinedInterval.clone();
+ thisIntervals.addInterval(existingInterval);
+ }
+ } else {
+ existingMaterial = property;
+ }
+ let materialData;
+ if (defined_default(packetData.solidColor)) {
+ if (!(existingMaterial instanceof ColorMaterialProperty_default)) {
+ existingMaterial = new ColorMaterialProperty_default();
+ }
+ materialData = packetData.solidColor;
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "color",
+ materialData.color,
+ void 0,
+ void 0,
+ entityCollection
+ );
+ } else if (defined_default(packetData.grid)) {
+ if (!(existingMaterial instanceof GridMaterialProperty_default)) {
+ existingMaterial = new GridMaterialProperty_default();
+ }
+ materialData = packetData.grid;
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "color",
+ materialData.color,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ existingMaterial,
+ "cellAlpha",
+ materialData.cellAlpha,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian2_default,
+ existingMaterial,
+ "lineCount",
+ materialData.lineCount,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian2_default,
+ existingMaterial,
+ "lineThickness",
+ materialData.lineThickness,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian2_default,
+ existingMaterial,
+ "lineOffset",
+ materialData.lineOffset,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ } else if (defined_default(packetData.image)) {
+ if (!(existingMaterial instanceof ImageMaterialProperty_default)) {
+ existingMaterial = new ImageMaterialProperty_default();
+ }
+ materialData = packetData.image;
+ processPacketData(
+ Image,
+ existingMaterial,
+ "image",
+ materialData.image,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian2_default,
+ existingMaterial,
+ "repeat",
+ materialData.repeat,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "color",
+ materialData.color,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ existingMaterial,
+ "transparent",
+ materialData.transparent,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ } else if (defined_default(packetData.stripe)) {
+ if (!(existingMaterial instanceof StripeMaterialProperty_default)) {
+ existingMaterial = new StripeMaterialProperty_default();
+ }
+ materialData = packetData.stripe;
+ processPacketData(
+ StripeOrientation_default,
+ existingMaterial,
+ "orientation",
+ materialData.orientation,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "evenColor",
+ materialData.evenColor,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "oddColor",
+ materialData.oddColor,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ existingMaterial,
+ "offset",
+ materialData.offset,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ existingMaterial,
+ "repeat",
+ materialData.repeat,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ } else if (defined_default(packetData.polylineOutline)) {
+ if (!(existingMaterial instanceof PolylineOutlineMaterialProperty_default)) {
+ existingMaterial = new PolylineOutlineMaterialProperty_default();
+ }
+ materialData = packetData.polylineOutline;
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "color",
+ materialData.color,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "outlineColor",
+ materialData.outlineColor,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ existingMaterial,
+ "outlineWidth",
+ materialData.outlineWidth,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ } else if (defined_default(packetData.polylineGlow)) {
+ if (!(existingMaterial instanceof PolylineGlowMaterialProperty_default)) {
+ existingMaterial = new PolylineGlowMaterialProperty_default();
+ }
+ materialData = packetData.polylineGlow;
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "color",
+ materialData.color,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ existingMaterial,
+ "glowPower",
+ materialData.glowPower,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ existingMaterial,
+ "taperPower",
+ materialData.taperPower,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ } else if (defined_default(packetData.polylineArrow)) {
+ if (!(existingMaterial instanceof PolylineArrowMaterialProperty_default)) {
+ existingMaterial = new PolylineArrowMaterialProperty_default();
+ }
+ materialData = packetData.polylineArrow;
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "color",
+ materialData.color,
+ void 0,
+ void 0,
+ entityCollection
+ );
+ } else if (defined_default(packetData.polylineDash)) {
+ if (!(existingMaterial instanceof PolylineDashMaterialProperty_default)) {
+ existingMaterial = new PolylineDashMaterialProperty_default();
+ }
+ materialData = packetData.polylineDash;
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "color",
+ materialData.color,
+ void 0,
+ void 0,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "gapColor",
+ materialData.gapColor,
+ void 0,
+ void 0,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ existingMaterial,
+ "dashLength",
+ materialData.dashLength,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ existingMaterial,
+ "dashPattern",
+ materialData.dashPattern,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ } else if (defined_default(packetData.checkerboard)) {
+ if (!(existingMaterial instanceof CheckerboardMaterialProperty_default)) {
+ existingMaterial = new CheckerboardMaterialProperty_default();
+ }
+ materialData = packetData.checkerboard;
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "evenColor",
+ materialData.evenColor,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ existingMaterial,
+ "oddColor",
+ materialData.oddColor,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian2_default,
+ existingMaterial,
+ "repeat",
+ materialData.repeat,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ }
+ if (defined_default(existingInterval)) {
+ existingInterval.data = existingMaterial;
+ } else {
+ object2[propertyName] = existingMaterial;
+ }
+}
+function processMaterialPacketData(object2, propertyName, packetData, interval, sourceUri, entityCollection) {
+ if (!defined_default(packetData)) {
+ return;
+ }
+ if (Array.isArray(packetData)) {
+ for (let i = 0, len = packetData.length; i < len; ++i) {
+ processMaterialProperty(
+ object2,
+ propertyName,
+ packetData[i],
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ }
+ } else {
+ processMaterialProperty(
+ object2,
+ propertyName,
+ packetData,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ }
+}
+function processName(entity, packet, entityCollection, sourceUri) {
+ const nameData = packet.name;
+ if (defined_default(nameData)) {
+ entity.name = packet.name;
+ }
+}
+function processDescription(entity, packet, entityCollection, sourceUri) {
+ const descriptionData = packet.description;
+ if (defined_default(descriptionData)) {
+ processPacketData(
+ String,
+ entity,
+ "description",
+ descriptionData,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ }
+}
+function processPosition(entity, packet, entityCollection, sourceUri) {
+ const positionData = packet.position;
+ if (defined_default(positionData)) {
+ processPositionPacketData(
+ entity,
+ "position",
+ positionData,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ }
+}
+function processViewFrom(entity, packet, entityCollection, sourceUri) {
+ const viewFromData = packet.viewFrom;
+ if (defined_default(viewFromData)) {
+ processPacketData(
+ Cartesian3_default,
+ entity,
+ "viewFrom",
+ viewFromData,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ }
+}
+function processOrientation(entity, packet, entityCollection, sourceUri) {
+ const orientationData = packet.orientation;
+ if (defined_default(orientationData)) {
+ processPacketData(
+ Quaternion_default,
+ entity,
+ "orientation",
+ orientationData,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ }
+}
+function processProperties(entity, packet, entityCollection, sourceUri) {
+ const propertiesData = packet.properties;
+ if (defined_default(propertiesData)) {
+ if (!defined_default(entity.properties)) {
+ entity.properties = new PropertyBag_default();
+ }
+ for (const key in propertiesData) {
+ if (propertiesData.hasOwnProperty(key)) {
+ if (!entity.properties.hasProperty(key)) {
+ entity.properties.addProperty(key);
+ }
+ const propertyData = propertiesData[key];
+ if (Array.isArray(propertyData)) {
+ for (let i = 0, len = propertyData.length; i < len; ++i) {
+ processProperty(
+ getPropertyType(propertyData[i]),
+ entity.properties,
+ key,
+ propertyData[i],
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ }
+ } else {
+ processProperty(
+ getPropertyType(propertyData),
+ entity.properties,
+ key,
+ propertyData,
+ void 0,
+ sourceUri,
+ entityCollection
+ );
+ }
+ }
+ }
+ }
+}
+function processReferencesArrayPacketData(object2, propertyName, references, interval, entityCollection, PropertyArrayType, CompositePropertyArrayType) {
+ const properties = references.map(function(reference) {
+ return createReferenceProperty(entityCollection, reference);
+ });
+ if (defined_default(interval)) {
+ interval = intervalFromString(interval);
+ let property = object2[propertyName];
+ if (!(property instanceof CompositePropertyArrayType)) {
+ const composite = new CompositePropertyArrayType();
+ composite.intervals.addInterval(wrapPropertyInInfiniteInterval(property));
+ object2[propertyName] = property = composite;
+ }
+ interval.data = new PropertyArrayType(properties);
+ property.intervals.addInterval(interval);
+ } else {
+ object2[propertyName] = new PropertyArrayType(properties);
+ }
+}
+function processArrayPacketData(object2, propertyName, packetData, entityCollection) {
+ const references = packetData.references;
+ if (defined_default(references)) {
+ processReferencesArrayPacketData(
+ object2,
+ propertyName,
+ references,
+ packetData.interval,
+ entityCollection,
+ PropertyArray_default,
+ CompositeProperty_default
+ );
+ } else {
+ processPacketData(
+ Array,
+ object2,
+ propertyName,
+ packetData,
+ void 0,
+ void 0,
+ entityCollection
+ );
+ }
+}
+function processArray(object2, propertyName, packetData, entityCollection) {
+ if (!defined_default(packetData)) {
+ return;
+ }
+ if (Array.isArray(packetData)) {
+ for (let i = 0, length3 = packetData.length; i < length3; ++i) {
+ processArrayPacketData(
+ object2,
+ propertyName,
+ packetData[i],
+ entityCollection
+ );
+ }
+ } else {
+ processArrayPacketData(object2, propertyName, packetData, entityCollection);
+ }
+}
+function processPositionArrayPacketData(object2, propertyName, packetData, entityCollection) {
+ const references = packetData.references;
+ if (defined_default(references)) {
+ processReferencesArrayPacketData(
+ object2,
+ propertyName,
+ references,
+ packetData.interval,
+ entityCollection,
+ PositionPropertyArray_default,
+ CompositePositionProperty_default
+ );
+ } else {
+ if (defined_default(packetData.cartesian)) {
+ packetData.array = Cartesian3_default.unpackArray(packetData.cartesian);
+ } else if (defined_default(packetData.cartographicRadians)) {
+ packetData.array = Cartesian3_default.fromRadiansArrayHeights(
+ packetData.cartographicRadians
+ );
+ } else if (defined_default(packetData.cartographicDegrees)) {
+ packetData.array = Cartesian3_default.fromDegreesArrayHeights(
+ packetData.cartographicDegrees
+ );
+ }
+ if (defined_default(packetData.array)) {
+ processPacketData(
+ Array,
+ object2,
+ propertyName,
+ packetData,
+ void 0,
+ void 0,
+ entityCollection
+ );
+ }
+ }
+}
+function processPositionArray(object2, propertyName, packetData, entityCollection) {
+ if (!defined_default(packetData)) {
+ return;
+ }
+ if (Array.isArray(packetData)) {
+ for (let i = 0, length3 = packetData.length; i < length3; ++i) {
+ processPositionArrayPacketData(
+ object2,
+ propertyName,
+ packetData[i],
+ entityCollection
+ );
+ }
+ } else {
+ processPositionArrayPacketData(
+ object2,
+ propertyName,
+ packetData,
+ entityCollection
+ );
+ }
+}
+function unpackCartesianArray(array) {
+ return Cartesian3_default.unpackArray(array);
+}
+function unpackCartographicRadiansArray(array) {
+ return Cartesian3_default.fromRadiansArrayHeights(array);
+}
+function unpackCartographicDegreesArray(array) {
+ return Cartesian3_default.fromDegreesArrayHeights(array);
+}
+function processPositionArrayOfArraysPacketData(object2, propertyName, packetData, entityCollection) {
+ const references = packetData.references;
+ if (defined_default(references)) {
+ const properties = references.map(function(referenceArray) {
+ const tempObj = {};
+ processReferencesArrayPacketData(
+ tempObj,
+ "positions",
+ referenceArray,
+ packetData.interval,
+ entityCollection,
+ PositionPropertyArray_default,
+ CompositePositionProperty_default
+ );
+ return tempObj.positions;
+ });
+ object2[propertyName] = new PositionPropertyArray_default(properties);
+ } else {
+ if (defined_default(packetData.cartesian)) {
+ packetData.array = packetData.cartesian.map(unpackCartesianArray);
+ } else if (defined_default(packetData.cartographicRadians)) {
+ packetData.array = packetData.cartographicRadians.map(
+ unpackCartographicRadiansArray
+ );
+ } else if (defined_default(packetData.cartographicDegrees)) {
+ packetData.array = packetData.cartographicDegrees.map(
+ unpackCartographicDegreesArray
+ );
+ }
+ if (defined_default(packetData.array)) {
+ processPacketData(
+ Array,
+ object2,
+ propertyName,
+ packetData,
+ void 0,
+ void 0,
+ entityCollection
+ );
+ }
+ }
+}
+function processPositionArrayOfArrays(object2, propertyName, packetData, entityCollection) {
+ if (!defined_default(packetData)) {
+ return;
+ }
+ if (Array.isArray(packetData)) {
+ for (let i = 0, length3 = packetData.length; i < length3; ++i) {
+ processPositionArrayOfArraysPacketData(
+ object2,
+ propertyName,
+ packetData[i],
+ entityCollection
+ );
+ }
+ } else {
+ processPositionArrayOfArraysPacketData(
+ object2,
+ propertyName,
+ packetData,
+ entityCollection
+ );
+ }
+}
+function processShape(object2, propertyName, packetData, entityCollection) {
+ if (!defined_default(packetData)) {
+ return;
+ }
+ if (Array.isArray(packetData)) {
+ for (let i = 0, length3 = packetData.length; i < length3; i++) {
+ processShapePacketData(
+ object2,
+ propertyName,
+ packetData[i],
+ entityCollection
+ );
+ }
+ } else {
+ processShapePacketData(object2, propertyName, packetData, entityCollection);
+ }
+}
+function processAvailability(entity, packet, entityCollection, sourceUri) {
+ const packetData = packet.availability;
+ if (!defined_default(packetData)) {
+ return;
+ }
+ let intervals;
+ if (Array.isArray(packetData)) {
+ for (let i = 0, len = packetData.length; i < len; ++i) {
+ if (!defined_default(intervals)) {
+ intervals = new TimeIntervalCollection_default();
+ }
+ intervals.addInterval(intervalFromString(packetData[i]));
+ }
+ } else {
+ intervals = new TimeIntervalCollection_default();
+ intervals.addInterval(intervalFromString(packetData));
+ }
+ entity.availability = intervals;
+}
+function processAlignedAxis(billboard, packetData, interval, sourceUri, entityCollection) {
+ if (!defined_default(packetData)) {
+ return;
+ }
+ processPacketData(
+ UnitCartesian3,
+ billboard,
+ "alignedAxis",
+ packetData,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processBillboard(entity, packet, entityCollection, sourceUri) {
+ const billboardData = packet.billboard;
+ if (!defined_default(billboardData)) {
+ return;
+ }
+ const interval = intervalFromString(billboardData.interval);
+ let billboard = entity.billboard;
+ if (!defined_default(billboard)) {
+ entity.billboard = billboard = new BillboardGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ billboard,
+ "show",
+ billboardData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Image,
+ billboard,
+ "image",
+ billboardData.image,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ billboard,
+ "scale",
+ billboardData.scale,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian2_default,
+ billboard,
+ "pixelOffset",
+ billboardData.pixelOffset,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian3_default,
+ billboard,
+ "eyeOffset",
+ billboardData.eyeOffset,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HorizontalOrigin_default,
+ billboard,
+ "horizontalOrigin",
+ billboardData.horizontalOrigin,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ VerticalOrigin_default,
+ billboard,
+ "verticalOrigin",
+ billboardData.verticalOrigin,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ billboard,
+ "heightReference",
+ billboardData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ billboard,
+ "color",
+ billboardData.color,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Rotation_default,
+ billboard,
+ "rotation",
+ billboardData.rotation,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processAlignedAxis(
+ billboard,
+ billboardData.alignedAxis,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ billboard,
+ "sizeInMeters",
+ billboardData.sizeInMeters,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ billboard,
+ "width",
+ billboardData.width,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ billboard,
+ "height",
+ billboardData.height,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ NearFarScalar_default,
+ billboard,
+ "scaleByDistance",
+ billboardData.scaleByDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ NearFarScalar_default,
+ billboard,
+ "translucencyByDistance",
+ billboardData.translucencyByDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ NearFarScalar_default,
+ billboard,
+ "pixelOffsetScaleByDistance",
+ billboardData.pixelOffsetScaleByDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ BoundingRectangle_default,
+ billboard,
+ "imageSubRegion",
+ billboardData.imageSubRegion,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ billboard,
+ "distanceDisplayCondition",
+ billboardData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ billboard,
+ "disableDepthTestDistance",
+ billboardData.disableDepthTestDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processBox(entity, packet, entityCollection, sourceUri) {
+ const boxData = packet.box;
+ if (!defined_default(boxData)) {
+ return;
+ }
+ const interval = intervalFromString(boxData.interval);
+ let box = entity.box;
+ if (!defined_default(box)) {
+ entity.box = box = new BoxGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ box,
+ "show",
+ boxData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian3_default,
+ box,
+ "dimensions",
+ boxData.dimensions,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ box,
+ "heightReference",
+ boxData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ box,
+ "fill",
+ boxData.fill,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ box,
+ "material",
+ boxData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ box,
+ "outline",
+ boxData.outline,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ box,
+ "outlineColor",
+ boxData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ box,
+ "outlineWidth",
+ boxData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ box,
+ "shadows",
+ boxData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ box,
+ "distanceDisplayCondition",
+ boxData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processCorridor(entity, packet, entityCollection, sourceUri) {
+ const corridorData = packet.corridor;
+ if (!defined_default(corridorData)) {
+ return;
+ }
+ const interval = intervalFromString(corridorData.interval);
+ let corridor = entity.corridor;
+ if (!defined_default(corridor)) {
+ entity.corridor = corridor = new CorridorGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ corridor,
+ "show",
+ corridorData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPositionArray(
+ corridor,
+ "positions",
+ corridorData.positions,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ corridor,
+ "width",
+ corridorData.width,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ corridor,
+ "height",
+ corridorData.height,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ corridor,
+ "heightReference",
+ corridorData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ corridor,
+ "extrudedHeight",
+ corridorData.extrudedHeight,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ corridor,
+ "extrudedHeightReference",
+ corridorData.extrudedHeightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ CornerType_default,
+ corridor,
+ "cornerType",
+ corridorData.cornerType,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ corridor,
+ "granularity",
+ corridorData.granularity,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ corridor,
+ "fill",
+ corridorData.fill,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ corridor,
+ "material",
+ corridorData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ corridor,
+ "outline",
+ corridorData.outline,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ corridor,
+ "outlineColor",
+ corridorData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ corridor,
+ "outlineWidth",
+ corridorData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ corridor,
+ "shadows",
+ corridorData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ corridor,
+ "distanceDisplayCondition",
+ corridorData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ClassificationType_default,
+ corridor,
+ "classificationType",
+ corridorData.classificationType,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ corridor,
+ "zIndex",
+ corridorData.zIndex,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processCylinder(entity, packet, entityCollection, sourceUri) {
+ const cylinderData = packet.cylinder;
+ if (!defined_default(cylinderData)) {
+ return;
+ }
+ const interval = intervalFromString(cylinderData.interval);
+ let cylinder = entity.cylinder;
+ if (!defined_default(cylinder)) {
+ entity.cylinder = cylinder = new CylinderGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ cylinder,
+ "show",
+ cylinderData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ cylinder,
+ "length",
+ cylinderData.length,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ cylinder,
+ "topRadius",
+ cylinderData.topRadius,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ cylinder,
+ "bottomRadius",
+ cylinderData.bottomRadius,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ cylinder,
+ "heightReference",
+ cylinderData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ cylinder,
+ "fill",
+ cylinderData.fill,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ cylinder,
+ "material",
+ cylinderData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ cylinder,
+ "outline",
+ cylinderData.outline,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ cylinder,
+ "outlineColor",
+ cylinderData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ cylinder,
+ "outlineWidth",
+ cylinderData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ cylinder,
+ "numberOfVerticalLines",
+ cylinderData.numberOfVerticalLines,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ cylinder,
+ "slices",
+ cylinderData.slices,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ cylinder,
+ "shadows",
+ cylinderData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ cylinder,
+ "distanceDisplayCondition",
+ cylinderData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processDocument(packet, dataSource) {
+ const version2 = packet.version;
+ if (defined_default(version2)) {
+ if (typeof version2 === "string") {
+ const tokens = version2.split(".");
+ if (tokens.length === 2) {
+ if (tokens[0] !== "1") {
+ throw new RuntimeError_default("Cesium only supports CZML version 1.");
+ }
+ dataSource._version = version2;
+ }
+ }
+ }
+ if (!defined_default(dataSource._version)) {
+ throw new RuntimeError_default(
+ "CZML version information invalid. It is expected to be a property on the document object in the . version format."
+ );
+ }
+ const documentPacket = dataSource._documentPacket;
+ if (defined_default(packet.name)) {
+ documentPacket.name = packet.name;
+ }
+ const clockPacket = packet.clock;
+ if (defined_default(clockPacket)) {
+ const clock = documentPacket.clock;
+ if (!defined_default(clock)) {
+ documentPacket.clock = {
+ interval: clockPacket.interval,
+ currentTime: clockPacket.currentTime,
+ range: clockPacket.range,
+ step: clockPacket.step,
+ multiplier: clockPacket.multiplier
+ };
+ } else {
+ clock.interval = defaultValue_default(clockPacket.interval, clock.interval);
+ clock.currentTime = defaultValue_default(
+ clockPacket.currentTime,
+ clock.currentTime
+ );
+ clock.range = defaultValue_default(clockPacket.range, clock.range);
+ clock.step = defaultValue_default(clockPacket.step, clock.step);
+ clock.multiplier = defaultValue_default(clockPacket.multiplier, clock.multiplier);
+ }
+ }
+}
+function processEllipse(entity, packet, entityCollection, sourceUri) {
+ const ellipseData = packet.ellipse;
+ if (!defined_default(ellipseData)) {
+ return;
+ }
+ const interval = intervalFromString(ellipseData.interval);
+ let ellipse = entity.ellipse;
+ if (!defined_default(ellipse)) {
+ entity.ellipse = ellipse = new EllipseGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ ellipse,
+ "show",
+ ellipseData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipse,
+ "semiMajorAxis",
+ ellipseData.semiMajorAxis,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipse,
+ "semiMinorAxis",
+ ellipseData.semiMinorAxis,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipse,
+ "height",
+ ellipseData.height,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ ellipse,
+ "heightReference",
+ ellipseData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipse,
+ "extrudedHeight",
+ ellipseData.extrudedHeight,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ ellipse,
+ "extrudedHeightReference",
+ ellipseData.extrudedHeightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Rotation_default,
+ ellipse,
+ "rotation",
+ ellipseData.rotation,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Rotation_default,
+ ellipse,
+ "stRotation",
+ ellipseData.stRotation,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipse,
+ "granularity",
+ ellipseData.granularity,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ ellipse,
+ "fill",
+ ellipseData.fill,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ ellipse,
+ "material",
+ ellipseData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ ellipse,
+ "outline",
+ ellipseData.outline,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ ellipse,
+ "outlineColor",
+ ellipseData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipse,
+ "outlineWidth",
+ ellipseData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipse,
+ "numberOfVerticalLines",
+ ellipseData.numberOfVerticalLines,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ ellipse,
+ "shadows",
+ ellipseData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ ellipse,
+ "distanceDisplayCondition",
+ ellipseData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ClassificationType_default,
+ ellipse,
+ "classificationType",
+ ellipseData.classificationType,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipse,
+ "zIndex",
+ ellipseData.zIndex,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processEllipsoid(entity, packet, entityCollection, sourceUri) {
+ const ellipsoidData = packet.ellipsoid;
+ if (!defined_default(ellipsoidData)) {
+ return;
+ }
+ const interval = intervalFromString(ellipsoidData.interval);
+ let ellipsoid = entity.ellipsoid;
+ if (!defined_default(ellipsoid)) {
+ entity.ellipsoid = ellipsoid = new EllipsoidGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ ellipsoid,
+ "show",
+ ellipsoidData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian3_default,
+ ellipsoid,
+ "radii",
+ ellipsoidData.radii,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian3_default,
+ ellipsoid,
+ "innerRadii",
+ ellipsoidData.innerRadii,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipsoid,
+ "minimumClock",
+ ellipsoidData.minimumClock,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipsoid,
+ "maximumClock",
+ ellipsoidData.maximumClock,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipsoid,
+ "minimumCone",
+ ellipsoidData.minimumCone,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipsoid,
+ "maximumCone",
+ ellipsoidData.maximumCone,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ ellipsoid,
+ "heightReference",
+ ellipsoidData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ ellipsoid,
+ "fill",
+ ellipsoidData.fill,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ ellipsoid,
+ "material",
+ ellipsoidData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ ellipsoid,
+ "outline",
+ ellipsoidData.outline,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ ellipsoid,
+ "outlineColor",
+ ellipsoidData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipsoid,
+ "outlineWidth",
+ ellipsoidData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipsoid,
+ "stackPartitions",
+ ellipsoidData.stackPartitions,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipsoid,
+ "slicePartitions",
+ ellipsoidData.slicePartitions,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ ellipsoid,
+ "subdivisions",
+ ellipsoidData.subdivisions,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ ellipsoid,
+ "shadows",
+ ellipsoidData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ ellipsoid,
+ "distanceDisplayCondition",
+ ellipsoidData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processLabel(entity, packet, entityCollection, sourceUri) {
+ const labelData = packet.label;
+ if (!defined_default(labelData)) {
+ return;
+ }
+ const interval = intervalFromString(labelData.interval);
+ let label = entity.label;
+ if (!defined_default(label)) {
+ entity.label = label = new LabelGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ label,
+ "show",
+ labelData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ String,
+ label,
+ "text",
+ labelData.text,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ String,
+ label,
+ "font",
+ labelData.font,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ LabelStyle_default,
+ label,
+ "style",
+ labelData.style,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ label,
+ "scale",
+ labelData.scale,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ label,
+ "showBackground",
+ labelData.showBackground,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ label,
+ "backgroundColor",
+ labelData.backgroundColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian2_default,
+ label,
+ "backgroundPadding",
+ labelData.backgroundPadding,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian2_default,
+ label,
+ "pixelOffset",
+ labelData.pixelOffset,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian3_default,
+ label,
+ "eyeOffset",
+ labelData.eyeOffset,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HorizontalOrigin_default,
+ label,
+ "horizontalOrigin",
+ labelData.horizontalOrigin,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ VerticalOrigin_default,
+ label,
+ "verticalOrigin",
+ labelData.verticalOrigin,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ label,
+ "heightReference",
+ labelData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ label,
+ "fillColor",
+ labelData.fillColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ label,
+ "outlineColor",
+ labelData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ label,
+ "outlineWidth",
+ labelData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ NearFarScalar_default,
+ label,
+ "translucencyByDistance",
+ labelData.translucencyByDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ NearFarScalar_default,
+ label,
+ "pixelOffsetScaleByDistance",
+ labelData.pixelOffsetScaleByDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ NearFarScalar_default,
+ label,
+ "scaleByDistance",
+ labelData.scaleByDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ label,
+ "distanceDisplayCondition",
+ labelData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ label,
+ "disableDepthTestDistance",
+ labelData.disableDepthTestDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processModel(entity, packet, entityCollection, sourceUri) {
+ const modelData = packet.model;
+ if (!defined_default(modelData)) {
+ return;
+ }
+ const interval = intervalFromString(modelData.interval);
+ let model = entity.model;
+ if (!defined_default(model)) {
+ entity.model = model = new ModelGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ model,
+ "show",
+ modelData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ import_urijs9.default,
+ model,
+ "uri",
+ modelData.gltf,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ model,
+ "scale",
+ modelData.scale,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ model,
+ "minimumPixelSize",
+ modelData.minimumPixelSize,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ model,
+ "maximumScale",
+ modelData.maximumScale,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ model,
+ "incrementallyLoadTextures",
+ modelData.incrementallyLoadTextures,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ model,
+ "runAnimations",
+ modelData.runAnimations,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ model,
+ "clampAnimations",
+ modelData.clampAnimations,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ model,
+ "shadows",
+ modelData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ model,
+ "heightReference",
+ modelData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ model,
+ "silhouetteColor",
+ modelData.silhouetteColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ model,
+ "silhouetteSize",
+ modelData.silhouetteSize,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ model,
+ "color",
+ modelData.color,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ColorBlendMode_default,
+ model,
+ "colorBlendMode",
+ modelData.colorBlendMode,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ model,
+ "colorBlendAmount",
+ modelData.colorBlendAmount,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ model,
+ "distanceDisplayCondition",
+ modelData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ let i, len;
+ const nodeTransformationsData = modelData.nodeTransformations;
+ if (defined_default(nodeTransformationsData)) {
+ if (Array.isArray(nodeTransformationsData)) {
+ for (i = 0, len = nodeTransformationsData.length; i < len; ++i) {
+ processNodeTransformations(
+ model,
+ nodeTransformationsData[i],
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ }
+ } else {
+ processNodeTransformations(
+ model,
+ nodeTransformationsData,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ }
+ }
+ const articulationsData = modelData.articulations;
+ if (defined_default(articulationsData)) {
+ if (Array.isArray(articulationsData)) {
+ for (i = 0, len = articulationsData.length; i < len; ++i) {
+ processArticulations(
+ model,
+ articulationsData[i],
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ }
+ } else {
+ processArticulations(
+ model,
+ articulationsData,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ }
+ }
+}
+function processNodeTransformations(model, nodeTransformationsData, constrainedInterval, sourceUri, entityCollection) {
+ let combinedInterval = intervalFromString(nodeTransformationsData.interval);
+ if (defined_default(constrainedInterval)) {
+ if (defined_default(combinedInterval)) {
+ combinedInterval = TimeInterval_default.intersect(
+ combinedInterval,
+ constrainedInterval,
+ scratchTimeInterval
+ );
+ } else {
+ combinedInterval = constrainedInterval;
+ }
+ }
+ let nodeTransformations = model.nodeTransformations;
+ const nodeNames = Object.keys(nodeTransformationsData);
+ for (let i = 0, len = nodeNames.length; i < len; ++i) {
+ const nodeName = nodeNames[i];
+ if (nodeName === "interval") {
+ continue;
+ }
+ const nodeTransformationData = nodeTransformationsData[nodeName];
+ if (!defined_default(nodeTransformationData)) {
+ continue;
+ }
+ if (!defined_default(nodeTransformations)) {
+ model.nodeTransformations = nodeTransformations = new PropertyBag_default();
+ }
+ if (!nodeTransformations.hasProperty(nodeName)) {
+ nodeTransformations.addProperty(nodeName);
+ }
+ let nodeTransformation = nodeTransformations[nodeName];
+ if (!defined_default(nodeTransformation)) {
+ nodeTransformations[nodeName] = nodeTransformation = new NodeTransformationProperty_default();
+ }
+ processPacketData(
+ Cartesian3_default,
+ nodeTransformation,
+ "translation",
+ nodeTransformationData.translation,
+ combinedInterval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Quaternion_default,
+ nodeTransformation,
+ "rotation",
+ nodeTransformationData.rotation,
+ combinedInterval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Cartesian3_default,
+ nodeTransformation,
+ "scale",
+ nodeTransformationData.scale,
+ combinedInterval,
+ sourceUri,
+ entityCollection
+ );
+ }
+}
+function processArticulations(model, articulationsData, constrainedInterval, sourceUri, entityCollection) {
+ let combinedInterval = intervalFromString(articulationsData.interval);
+ if (defined_default(constrainedInterval)) {
+ if (defined_default(combinedInterval)) {
+ combinedInterval = TimeInterval_default.intersect(
+ combinedInterval,
+ constrainedInterval,
+ scratchTimeInterval
+ );
+ } else {
+ combinedInterval = constrainedInterval;
+ }
+ }
+ let articulations = model.articulations;
+ const keys = Object.keys(articulationsData);
+ for (let i = 0, len = keys.length; i < len; ++i) {
+ const key = keys[i];
+ if (key === "interval") {
+ continue;
+ }
+ const articulationStageData = articulationsData[key];
+ if (!defined_default(articulationStageData)) {
+ continue;
+ }
+ if (!defined_default(articulations)) {
+ model.articulations = articulations = new PropertyBag_default();
+ }
+ if (!articulations.hasProperty(key)) {
+ articulations.addProperty(key);
+ }
+ processPacketData(
+ Number,
+ articulations,
+ key,
+ articulationStageData,
+ combinedInterval,
+ sourceUri,
+ entityCollection
+ );
+ }
+}
+function processPath(entity, packet, entityCollection, sourceUri) {
+ const pathData = packet.path;
+ if (!defined_default(pathData)) {
+ return;
+ }
+ const interval = intervalFromString(pathData.interval);
+ let path = entity.path;
+ if (!defined_default(path)) {
+ entity.path = path = new PathGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ path,
+ "show",
+ pathData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ path,
+ "leadTime",
+ pathData.leadTime,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ path,
+ "trailTime",
+ pathData.trailTime,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ path,
+ "width",
+ pathData.width,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ path,
+ "resolution",
+ pathData.resolution,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ path,
+ "material",
+ pathData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ path,
+ "distanceDisplayCondition",
+ pathData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processPoint(entity, packet, entityCollection, sourceUri) {
+ const pointData = packet.point;
+ if (!defined_default(pointData)) {
+ return;
+ }
+ const interval = intervalFromString(pointData.interval);
+ let point = entity.point;
+ if (!defined_default(point)) {
+ entity.point = point = new PointGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ point,
+ "show",
+ pointData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ point,
+ "pixelSize",
+ pointData.pixelSize,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ point,
+ "heightReference",
+ pointData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ point,
+ "color",
+ pointData.color,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ point,
+ "outlineColor",
+ pointData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ point,
+ "outlineWidth",
+ pointData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ NearFarScalar_default,
+ point,
+ "scaleByDistance",
+ pointData.scaleByDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ NearFarScalar_default,
+ point,
+ "translucencyByDistance",
+ pointData.translucencyByDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ point,
+ "distanceDisplayCondition",
+ pointData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ point,
+ "disableDepthTestDistance",
+ pointData.disableDepthTestDistance,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function PolygonHierarchyProperty(polygon) {
+ this.polygon = polygon;
+ this._definitionChanged = new Event_default();
+}
+Object.defineProperties(PolygonHierarchyProperty.prototype, {
+ isConstant: {
+ get: function() {
+ const positions = this.polygon._positions;
+ const holes = this.polygon._holes;
+ return (!defined_default(positions) || positions.isConstant) && (!defined_default(holes) || holes.isConstant);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ }
+});
+PolygonHierarchyProperty.prototype.getValue = function(time, result) {
+ let positions;
+ if (defined_default(this.polygon._positions)) {
+ positions = this.polygon._positions.getValue(time);
+ }
+ let holes;
+ if (defined_default(this.polygon._holes)) {
+ holes = this.polygon._holes.getValue(time);
+ if (defined_default(holes)) {
+ holes = holes.map(function(holePositions) {
+ return new PolygonHierarchy_default(holePositions);
+ });
+ }
+ }
+ if (!defined_default(result)) {
+ return new PolygonHierarchy_default(positions, holes);
+ }
+ result.positions = positions;
+ result.holes = holes;
+ return result;
+};
+PolygonHierarchyProperty.prototype.equals = function(other) {
+ return this === other || other instanceof PolygonHierarchyProperty && Property_default.equals(this.polygon._positions, other.polygon._positions) && Property_default.equals(this.polygon._holes, other.polygon._holes);
+};
+function processPolygon(entity, packet, entityCollection, sourceUri) {
+ const polygonData = packet.polygon;
+ if (!defined_default(polygonData)) {
+ return;
+ }
+ const interval = intervalFromString(polygonData.interval);
+ let polygon = entity.polygon;
+ if (!defined_default(polygon)) {
+ entity.polygon = polygon = new PolygonGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ polygon,
+ "show",
+ polygonData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPositionArray(
+ polygon,
+ "_positions",
+ polygonData.positions,
+ entityCollection
+ );
+ processPositionArrayOfArrays(
+ polygon,
+ "_holes",
+ polygonData.holes,
+ entityCollection
+ );
+ if (defined_default(polygon._positions) || defined_default(polygon._holes)) {
+ polygon.hierarchy = new PolygonHierarchyProperty(polygon);
+ }
+ processPacketData(
+ Number,
+ polygon,
+ "height",
+ polygonData.height,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ polygon,
+ "heightReference",
+ polygonData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ polygon,
+ "extrudedHeight",
+ polygonData.extrudedHeight,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ polygon,
+ "extrudedHeightReference",
+ polygonData.extrudedHeightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Rotation_default,
+ polygon,
+ "stRotation",
+ polygonData.stRotation,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ polygon,
+ "granularity",
+ polygonData.granularity,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ polygon,
+ "fill",
+ polygonData.fill,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ polygon,
+ "material",
+ polygonData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ polygon,
+ "outline",
+ polygonData.outline,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ polygon,
+ "outlineColor",
+ polygonData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ polygon,
+ "outlineWidth",
+ polygonData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ polygon,
+ "perPositionHeight",
+ polygonData.perPositionHeight,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ polygon,
+ "closeTop",
+ polygonData.closeTop,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ polygon,
+ "closeBottom",
+ polygonData.closeBottom,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ArcType_default,
+ polygon,
+ "arcType",
+ polygonData.arcType,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ polygon,
+ "shadows",
+ polygonData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ polygon,
+ "distanceDisplayCondition",
+ polygonData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ClassificationType_default,
+ polygon,
+ "classificationType",
+ polygonData.classificationType,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ polygon,
+ "zIndex",
+ polygonData.zIndex,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function adaptFollowSurfaceToArcType(followSurface) {
+ return followSurface ? ArcType_default.GEODESIC : ArcType_default.NONE;
+}
+function processPolyline(entity, packet, entityCollection, sourceUri) {
+ const polylineData = packet.polyline;
+ if (!defined_default(polylineData)) {
+ return;
+ }
+ const interval = intervalFromString(polylineData.interval);
+ let polyline = entity.polyline;
+ if (!defined_default(polyline)) {
+ entity.polyline = polyline = new PolylineGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ polyline,
+ "show",
+ polylineData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPositionArray(
+ polyline,
+ "positions",
+ polylineData.positions,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ polyline,
+ "width",
+ polylineData.width,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ polyline,
+ "granularity",
+ polylineData.granularity,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ polyline,
+ "material",
+ polylineData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ polyline,
+ "depthFailMaterial",
+ polylineData.depthFailMaterial,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ArcType_default,
+ polyline,
+ "arcType",
+ polylineData.arcType,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ polyline,
+ "clampToGround",
+ polylineData.clampToGround,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ polyline,
+ "shadows",
+ polylineData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ polyline,
+ "distanceDisplayCondition",
+ polylineData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ClassificationType_default,
+ polyline,
+ "classificationType",
+ polylineData.classificationType,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ polyline,
+ "zIndex",
+ polylineData.zIndex,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ if (defined_default(polylineData.followSurface) && !defined_default(polylineData.arcType)) {
+ const tempObj = {};
+ processPacketData(
+ Boolean,
+ tempObj,
+ "followSurface",
+ polylineData.followSurface,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ polyline.arcType = createAdapterProperty(
+ tempObj.followSurface,
+ adaptFollowSurfaceToArcType
+ );
+ }
+}
+function processPolylineVolume(entity, packet, entityCollection, sourceUri) {
+ const polylineVolumeData = packet.polylineVolume;
+ if (!defined_default(polylineVolumeData)) {
+ return;
+ }
+ const interval = intervalFromString(polylineVolumeData.interval);
+ let polylineVolume = entity.polylineVolume;
+ if (!defined_default(polylineVolume)) {
+ entity.polylineVolume = polylineVolume = new PolylineVolumeGraphics_default();
+ }
+ processPositionArray(
+ polylineVolume,
+ "positions",
+ polylineVolumeData.positions,
+ entityCollection
+ );
+ processShape(
+ polylineVolume,
+ "shape",
+ polylineVolumeData.shape,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ polylineVolume,
+ "show",
+ polylineVolumeData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ CornerType_default,
+ polylineVolume,
+ "cornerType",
+ polylineVolumeData.cornerType,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ polylineVolume,
+ "fill",
+ polylineVolumeData.fill,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ polylineVolume,
+ "material",
+ polylineVolumeData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ polylineVolume,
+ "outline",
+ polylineVolumeData.outline,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ polylineVolume,
+ "outlineColor",
+ polylineVolumeData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ polylineVolume,
+ "outlineWidth",
+ polylineVolumeData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ polylineVolume,
+ "granularity",
+ polylineVolumeData.granularity,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ polylineVolume,
+ "shadows",
+ polylineVolumeData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ polylineVolume,
+ "distanceDisplayCondition",
+ polylineVolumeData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processRectangle(entity, packet, entityCollection, sourceUri) {
+ const rectangleData = packet.rectangle;
+ if (!defined_default(rectangleData)) {
+ return;
+ }
+ const interval = intervalFromString(rectangleData.interval);
+ let rectangle = entity.rectangle;
+ if (!defined_default(rectangle)) {
+ entity.rectangle = rectangle = new RectangleGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ rectangle,
+ "show",
+ rectangleData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Rectangle_default,
+ rectangle,
+ "coordinates",
+ rectangleData.coordinates,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ rectangle,
+ "height",
+ rectangleData.height,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ rectangle,
+ "heightReference",
+ rectangleData.heightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ rectangle,
+ "extrudedHeight",
+ rectangleData.extrudedHeight,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ HeightReference_default,
+ rectangle,
+ "extrudedHeightReference",
+ rectangleData.extrudedHeightReference,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Rotation_default,
+ rectangle,
+ "rotation",
+ rectangleData.rotation,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Rotation_default,
+ rectangle,
+ "stRotation",
+ rectangleData.stRotation,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ rectangle,
+ "granularity",
+ rectangleData.granularity,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ rectangle,
+ "fill",
+ rectangleData.fill,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ rectangle,
+ "material",
+ rectangleData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ rectangle,
+ "outline",
+ rectangleData.outline,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ rectangle,
+ "outlineColor",
+ rectangleData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ rectangle,
+ "outlineWidth",
+ rectangleData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ rectangle,
+ "shadows",
+ rectangleData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ rectangle,
+ "distanceDisplayCondition",
+ rectangleData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ClassificationType_default,
+ rectangle,
+ "classificationType",
+ rectangleData.classificationType,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ rectangle,
+ "zIndex",
+ rectangleData.zIndex,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processTileset(entity, packet, entityCollection, sourceUri) {
+ const tilesetData = packet.tileset;
+ if (!defined_default(tilesetData)) {
+ return;
+ }
+ const interval = intervalFromString(tilesetData.interval);
+ let tileset = entity.tileset;
+ if (!defined_default(tileset)) {
+ entity.tileset = tileset = new Cesium3DTilesetGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ tileset,
+ "show",
+ tilesetData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ import_urijs9.default,
+ tileset,
+ "uri",
+ tilesetData.uri,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ tileset,
+ "maximumScreenSpaceError",
+ tilesetData.maximumScreenSpaceError,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processWall(entity, packet, entityCollection, sourceUri) {
+ const wallData = packet.wall;
+ if (!defined_default(wallData)) {
+ return;
+ }
+ const interval = intervalFromString(wallData.interval);
+ let wall = entity.wall;
+ if (!defined_default(wall)) {
+ entity.wall = wall = new WallGraphics_default();
+ }
+ processPacketData(
+ Boolean,
+ wall,
+ "show",
+ wallData.show,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPositionArray(wall, "positions", wallData.positions, entityCollection);
+ processArray(
+ wall,
+ "minimumHeights",
+ wallData.minimumHeights,
+ entityCollection
+ );
+ processArray(
+ wall,
+ "maximumHeights",
+ wallData.maximumHeights,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ wall,
+ "granularity",
+ wallData.granularity,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ wall,
+ "fill",
+ wallData.fill,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processMaterialPacketData(
+ wall,
+ "material",
+ wallData.material,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Boolean,
+ wall,
+ "outline",
+ wallData.outline,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Color_default,
+ wall,
+ "outlineColor",
+ wallData.outlineColor,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ Number,
+ wall,
+ "outlineWidth",
+ wallData.outlineWidth,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ ShadowMode_default,
+ wall,
+ "shadows",
+ wallData.shadows,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+ processPacketData(
+ DistanceDisplayCondition_default,
+ wall,
+ "distanceDisplayCondition",
+ wallData.distanceDisplayCondition,
+ interval,
+ sourceUri,
+ entityCollection
+ );
+}
+function processCzmlPacket(packet, entityCollection, updaterFunctions, sourceUri, dataSource) {
+ let objectId = packet.id;
+ if (!defined_default(objectId)) {
+ objectId = createGuid_default();
+ }
+ currentId = objectId;
+ if (!defined_default(dataSource._version) && objectId !== "document") {
+ throw new RuntimeError_default(
+ "The first CZML packet is required to be the document object."
+ );
+ }
+ if (packet["delete"] === true) {
+ entityCollection.removeById(objectId);
+ } else if (objectId === "document") {
+ processDocument(packet, dataSource);
+ } else {
+ const entity = entityCollection.getOrCreateEntity(objectId);
+ const parentId = packet.parent;
+ if (defined_default(parentId)) {
+ entity.parent = entityCollection.getOrCreateEntity(parentId);
+ }
+ for (let i = updaterFunctions.length - 1; i > -1; i--) {
+ updaterFunctions[i](entity, packet, entityCollection, sourceUri);
+ }
+ }
+ currentId = void 0;
+}
+function updateClock(dataSource) {
+ let clock;
+ const clockPacket = dataSource._documentPacket.clock;
+ if (!defined_default(clockPacket)) {
+ if (!defined_default(dataSource._clock)) {
+ const availability = dataSource._entityCollection.computeAvailability();
+ if (!availability.start.equals(Iso8601_default.MINIMUM_VALUE)) {
+ const startTime = availability.start;
+ const stopTime = availability.stop;
+ const totalSeconds = JulianDate_default.secondsDifference(stopTime, startTime);
+ const multiplier = Math.round(totalSeconds / 120);
+ clock = new DataSourceClock_default();
+ clock.startTime = JulianDate_default.clone(startTime);
+ clock.stopTime = JulianDate_default.clone(stopTime);
+ clock.clockRange = ClockRange_default.LOOP_STOP;
+ clock.multiplier = multiplier;
+ clock.currentTime = JulianDate_default.clone(startTime);
+ clock.clockStep = ClockStep_default.SYSTEM_CLOCK_MULTIPLIER;
+ dataSource._clock = clock;
+ return true;
+ }
+ }
+ return false;
+ }
+ if (defined_default(dataSource._clock)) {
+ clock = dataSource._clock.clone();
+ } else {
+ clock = new DataSourceClock_default();
+ clock.startTime = Iso8601_default.MINIMUM_VALUE.clone();
+ clock.stopTime = Iso8601_default.MAXIMUM_VALUE.clone();
+ clock.currentTime = Iso8601_default.MINIMUM_VALUE.clone();
+ clock.clockRange = ClockRange_default.LOOP_STOP;
+ clock.clockStep = ClockStep_default.SYSTEM_CLOCK_MULTIPLIER;
+ clock.multiplier = 1;
+ }
+ const interval = intervalFromString(clockPacket.interval);
+ if (defined_default(interval)) {
+ clock.startTime = interval.start;
+ clock.stopTime = interval.stop;
+ }
+ if (defined_default(clockPacket.currentTime)) {
+ clock.currentTime = JulianDate_default.fromIso8601(clockPacket.currentTime);
+ }
+ if (defined_default(clockPacket.range)) {
+ clock.clockRange = defaultValue_default(
+ ClockRange_default[clockPacket.range],
+ ClockRange_default.LOOP_STOP
+ );
+ }
+ if (defined_default(clockPacket.step)) {
+ clock.clockStep = defaultValue_default(
+ ClockStep_default[clockPacket.step],
+ ClockStep_default.SYSTEM_CLOCK_MULTIPLIER
+ );
+ }
+ if (defined_default(clockPacket.multiplier)) {
+ clock.multiplier = clockPacket.multiplier;
+ }
+ if (!clock.equals(dataSource._clock)) {
+ dataSource._clock = clock.clone(dataSource._clock);
+ return true;
+ }
+ return false;
+}
+function load(dataSource, czml, options, clear2) {
+ if (!defined_default(czml)) {
+ throw new DeveloperError_default("czml is required.");
+ }
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ let promise = czml;
+ let sourceUri = options.sourceUri;
+ let credit = options.credit;
+ if (typeof credit === "string") {
+ credit = new Credit_default(credit);
+ }
+ dataSource._credit = credit;
+ if (typeof czml === "string" || czml instanceof Resource_default) {
+ czml = Resource_default.createIfNeeded(czml);
+ promise = czml.fetchJson();
+ sourceUri = defaultValue_default(sourceUri, czml.clone());
+ const resourceCredits = dataSource._resourceCredits;
+ const credits = czml.credits;
+ if (defined_default(credits)) {
+ const length3 = credits.length;
+ for (let i = 0; i < length3; i++) {
+ resourceCredits.push(credits[i]);
+ }
+ }
+ }
+ sourceUri = Resource_default.createIfNeeded(sourceUri);
+ DataSource_default.setLoading(dataSource, true);
+ return Promise.resolve(promise).then(function(czml2) {
+ return loadCzml(dataSource, czml2, sourceUri, clear2);
+ }).catch(function(error) {
+ DataSource_default.setLoading(dataSource, false);
+ dataSource._error.raiseEvent(dataSource, error);
+ console.log(error);
+ return Promise.reject(error);
+ });
+}
+function loadCzml(dataSource, czml, sourceUri, clear2) {
+ DataSource_default.setLoading(dataSource, true);
+ const entityCollection = dataSource._entityCollection;
+ if (clear2) {
+ dataSource._version = void 0;
+ dataSource._documentPacket = new DocumentPacket();
+ entityCollection.removeAll();
+ }
+ CzmlDataSource._processCzml(
+ czml,
+ entityCollection,
+ sourceUri,
+ void 0,
+ dataSource
+ );
+ let raiseChangedEvent = updateClock(dataSource);
+ const documentPacket = dataSource._documentPacket;
+ if (defined_default(documentPacket.name) && dataSource._name !== documentPacket.name) {
+ dataSource._name = documentPacket.name;
+ raiseChangedEvent = true;
+ } else if (!defined_default(dataSource._name) && defined_default(sourceUri)) {
+ dataSource._name = getFilenameFromUri_default(sourceUri.getUrlComponent());
+ raiseChangedEvent = true;
+ }
+ DataSource_default.setLoading(dataSource, false);
+ if (raiseChangedEvent) {
+ dataSource._changed.raiseEvent(dataSource);
+ }
+ return dataSource;
+}
+function DocumentPacket() {
+ this.name = void 0;
+ this.clock = void 0;
+}
+function CzmlDataSource(name) {
+ this._name = name;
+ this._changed = new Event_default();
+ this._error = new Event_default();
+ this._isLoading = false;
+ this._loading = new Event_default();
+ this._clock = void 0;
+ this._documentPacket = new DocumentPacket();
+ this._version = void 0;
+ this._entityCollection = new EntityCollection_default(this);
+ this._entityCluster = new EntityCluster_default();
+ this._credit = void 0;
+ this._resourceCredits = [];
+}
+CzmlDataSource.load = function(czml, options) {
+ return new CzmlDataSource().load(czml, options);
+};
+Object.defineProperties(CzmlDataSource.prototype, {
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ clock: {
+ get: function() {
+ return this._clock;
+ }
+ },
+ entities: {
+ get: function() {
+ return this._entityCollection;
+ }
+ },
+ isLoading: {
+ get: function() {
+ return this._isLoading;
+ }
+ },
+ changedEvent: {
+ get: function() {
+ return this._changed;
+ }
+ },
+ errorEvent: {
+ get: function() {
+ return this._error;
+ }
+ },
+ loadingEvent: {
+ get: function() {
+ return this._loading;
+ }
+ },
+ show: {
+ get: function() {
+ return this._entityCollection.show;
+ },
+ set: function(value) {
+ this._entityCollection.show = value;
+ }
+ },
+ clustering: {
+ get: function() {
+ return this._entityCluster;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value must be defined.");
+ }
+ this._entityCluster = value;
+ }
+ },
+ credit: {
+ get: function() {
+ return this._credit;
+ }
+ }
+});
+CzmlDataSource.updaters = [
+ processBillboard,
+ processBox,
+ processCorridor,
+ processCylinder,
+ processEllipse,
+ processEllipsoid,
+ processLabel,
+ processModel,
+ processName,
+ processDescription,
+ processPath,
+ processPoint,
+ processPolygon,
+ processPolyline,
+ processPolylineVolume,
+ processProperties,
+ processRectangle,
+ processPosition,
+ processTileset,
+ processViewFrom,
+ processWall,
+ processOrientation,
+ processAvailability
+];
+CzmlDataSource.prototype.process = function(czml, options) {
+ return load(this, czml, options, false);
+};
+CzmlDataSource.prototype.load = function(czml, options) {
+ return load(this, czml, options, true);
+};
+CzmlDataSource.prototype.update = function(time) {
+ return true;
+};
+CzmlDataSource.processPacketData = processPacketData;
+CzmlDataSource.processPositionPacketData = processPositionPacketData;
+CzmlDataSource.processMaterialPacketData = processMaterialPacketData;
+CzmlDataSource._processCzml = function(czml, entityCollection, sourceUri, updaterFunctions, dataSource) {
+ updaterFunctions = defaultValue_default(updaterFunctions, CzmlDataSource.updaters);
+ if (Array.isArray(czml)) {
+ for (let i = 0, len = czml.length; i < len; ++i) {
+ processCzmlPacket(
+ czml[i],
+ entityCollection,
+ updaterFunctions,
+ sourceUri,
+ dataSource
+ );
+ }
+ } else {
+ processCzmlPacket(
+ czml,
+ entityCollection,
+ updaterFunctions,
+ sourceUri,
+ dataSource
+ );
+ }
+};
+var CzmlDataSource_default = CzmlDataSource;
+
+// Source/DataSources/DataSourceCollection.js
+function DataSourceCollection() {
+ this._dataSources = [];
+ this._dataSourceAdded = new Event_default();
+ this._dataSourceRemoved = new Event_default();
+ this._dataSourceMoved = new Event_default();
+}
+Object.defineProperties(DataSourceCollection.prototype, {
+ length: {
+ get: function() {
+ return this._dataSources.length;
+ }
+ },
+ dataSourceAdded: {
+ get: function() {
+ return this._dataSourceAdded;
+ }
+ },
+ dataSourceRemoved: {
+ get: function() {
+ return this._dataSourceRemoved;
+ }
+ },
+ dataSourceMoved: {
+ get: function() {
+ return this._dataSourceMoved;
+ }
+ }
+});
+DataSourceCollection.prototype.add = function(dataSource) {
+ if (!defined_default(dataSource)) {
+ throw new DeveloperError_default("dataSource is required.");
+ }
+ const that = this;
+ const dataSources = this._dataSources;
+ return Promise.resolve(dataSource).then(function(value) {
+ if (dataSources === that._dataSources) {
+ that._dataSources.push(value);
+ that._dataSourceAdded.raiseEvent(that, value);
+ }
+ return value;
+ });
+};
+DataSourceCollection.prototype.remove = function(dataSource, destroy) {
+ destroy = defaultValue_default(destroy, false);
+ const index = this._dataSources.indexOf(dataSource);
+ if (index !== -1) {
+ this._dataSources.splice(index, 1);
+ this._dataSourceRemoved.raiseEvent(this, dataSource);
+ if (destroy && typeof dataSource.destroy === "function") {
+ dataSource.destroy();
+ }
+ return true;
+ }
+ return false;
+};
+DataSourceCollection.prototype.removeAll = function(destroy) {
+ destroy = defaultValue_default(destroy, false);
+ const dataSources = this._dataSources;
+ for (let i = 0, len = dataSources.length; i < len; ++i) {
+ const dataSource = dataSources[i];
+ this._dataSourceRemoved.raiseEvent(this, dataSource);
+ if (destroy && typeof dataSource.destroy === "function") {
+ dataSource.destroy();
+ }
+ }
+ this._dataSources = [];
+};
+DataSourceCollection.prototype.contains = function(dataSource) {
+ return this.indexOf(dataSource) !== -1;
+};
+DataSourceCollection.prototype.indexOf = function(dataSource) {
+ return this._dataSources.indexOf(dataSource);
+};
+DataSourceCollection.prototype.get = function(index) {
+ if (!defined_default(index)) {
+ throw new DeveloperError_default("index is required.");
+ }
+ return this._dataSources[index];
+};
+DataSourceCollection.prototype.getByName = function(name) {
+ if (!defined_default(name)) {
+ throw new DeveloperError_default("name is required.");
+ }
+ return this._dataSources.filter(function(dataSource) {
+ return dataSource.name === name;
+ });
+};
+function getIndex2(dataSources, dataSource) {
+ if (!defined_default(dataSource)) {
+ throw new DeveloperError_default("dataSource is required.");
+ }
+ const index = dataSources.indexOf(dataSource);
+ if (index === -1) {
+ throw new DeveloperError_default("dataSource is not in this collection.");
+ }
+ return index;
+}
+function swapDataSources(collection, i, j) {
+ const arr = collection._dataSources;
+ const length3 = arr.length - 1;
+ i = Math_default.clamp(i, 0, length3);
+ j = Math_default.clamp(j, 0, length3);
+ if (i === j) {
+ return;
+ }
+ const temp = arr[i];
+ arr[i] = arr[j];
+ arr[j] = temp;
+ collection.dataSourceMoved.raiseEvent(temp, j, i);
+}
+DataSourceCollection.prototype.raise = function(dataSource) {
+ const index = getIndex2(this._dataSources, dataSource);
+ swapDataSources(this, index, index + 1);
+};
+DataSourceCollection.prototype.lower = function(dataSource) {
+ const index = getIndex2(this._dataSources, dataSource);
+ swapDataSources(this, index, index - 1);
+};
+DataSourceCollection.prototype.raiseToTop = function(dataSource) {
+ const index = getIndex2(this._dataSources, dataSource);
+ if (index === this._dataSources.length - 1) {
+ return;
+ }
+ this._dataSources.splice(index, 1);
+ this._dataSources.push(dataSource);
+ this.dataSourceMoved.raiseEvent(
+ dataSource,
+ this._dataSources.length - 1,
+ index
+ );
+};
+DataSourceCollection.prototype.lowerToBottom = function(dataSource) {
+ const index = getIndex2(this._dataSources, dataSource);
+ if (index === 0) {
+ return;
+ }
+ this._dataSources.splice(index, 1);
+ this._dataSources.splice(0, 0, dataSource);
+ this.dataSourceMoved.raiseEvent(dataSource, 0, index);
+};
+DataSourceCollection.prototype.isDestroyed = function() {
+ return false;
+};
+DataSourceCollection.prototype.destroy = function() {
+ this.removeAll(true);
+ return destroyObject_default(this);
+};
+var DataSourceCollection_default = DataSourceCollection;
+
+// Source/Scene/PrimitiveCollection.js
+function PrimitiveCollection(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ this._primitives = [];
+ this._guid = createGuid_default();
+ this._zIndex = void 0;
+ this.show = defaultValue_default(options.show, true);
+ this.destroyPrimitives = defaultValue_default(options.destroyPrimitives, true);
+}
+Object.defineProperties(PrimitiveCollection.prototype, {
+ length: {
+ get: function() {
+ return this._primitives.length;
+ }
+ }
+});
+PrimitiveCollection.prototype.add = function(primitive, index) {
+ const hasIndex = defined_default(index);
+ if (!defined_default(primitive)) {
+ throw new DeveloperError_default("primitive is required.");
+ }
+ if (hasIndex) {
+ if (index < 0) {
+ throw new DeveloperError_default("index must be greater than or equal to zero.");
+ } else if (index > this._primitives.length) {
+ throw new DeveloperError_default(
+ "index must be less than or equal to the number of primitives."
+ );
+ }
+ }
+ const external = primitive._external = primitive._external || {};
+ const composites = external._composites = external._composites || {};
+ composites[this._guid] = {
+ collection: this
+ };
+ if (!hasIndex) {
+ this._primitives.push(primitive);
+ } else {
+ this._primitives.splice(index, 0, primitive);
+ }
+ return primitive;
+};
+PrimitiveCollection.prototype.remove = function(primitive) {
+ if (this.contains(primitive)) {
+ const index = this._primitives.indexOf(primitive);
+ if (index !== -1) {
+ this._primitives.splice(index, 1);
+ delete primitive._external._composites[this._guid];
+ if (this.destroyPrimitives) {
+ primitive.destroy();
+ }
+ return true;
+ }
+ }
+ return false;
+};
+PrimitiveCollection.prototype.removeAndDestroy = function(primitive) {
+ const removed = this.remove(primitive);
+ if (removed && !this.destroyPrimitives) {
+ primitive.destroy();
+ }
+ return removed;
+};
+PrimitiveCollection.prototype.removeAll = function() {
+ const primitives = this._primitives;
+ const length3 = primitives.length;
+ for (let i = 0; i < length3; ++i) {
+ delete primitives[i]._external._composites[this._guid];
+ if (this.destroyPrimitives) {
+ primitives[i].destroy();
+ }
+ }
+ this._primitives = [];
+};
+PrimitiveCollection.prototype.contains = function(primitive) {
+ return !!(defined_default(primitive) && primitive._external && primitive._external._composites && primitive._external._composites[this._guid]);
+};
+function getPrimitiveIndex(compositePrimitive, primitive) {
+ if (!compositePrimitive.contains(primitive)) {
+ throw new DeveloperError_default("primitive is not in this collection.");
+ }
+ return compositePrimitive._primitives.indexOf(primitive);
+}
+PrimitiveCollection.prototype.raise = function(primitive) {
+ if (defined_default(primitive)) {
+ const index = getPrimitiveIndex(this, primitive);
+ const primitives = this._primitives;
+ if (index !== primitives.length - 1) {
+ const p = primitives[index];
+ primitives[index] = primitives[index + 1];
+ primitives[index + 1] = p;
+ }
+ }
+};
+PrimitiveCollection.prototype.raiseToTop = function(primitive) {
+ if (defined_default(primitive)) {
+ const index = getPrimitiveIndex(this, primitive);
+ const primitives = this._primitives;
+ if (index !== primitives.length - 1) {
+ primitives.splice(index, 1);
+ primitives.push(primitive);
+ }
+ }
+};
+PrimitiveCollection.prototype.lower = function(primitive) {
+ if (defined_default(primitive)) {
+ const index = getPrimitiveIndex(this, primitive);
+ const primitives = this._primitives;
+ if (index !== 0) {
+ const p = primitives[index];
+ primitives[index] = primitives[index - 1];
+ primitives[index - 1] = p;
+ }
+ }
+};
+PrimitiveCollection.prototype.lowerToBottom = function(primitive) {
+ if (defined_default(primitive)) {
+ const index = getPrimitiveIndex(this, primitive);
+ const primitives = this._primitives;
+ if (index !== 0) {
+ primitives.splice(index, 1);
+ primitives.unshift(primitive);
+ }
+ }
+};
+PrimitiveCollection.prototype.get = function(index) {
+ if (!defined_default(index)) {
+ throw new DeveloperError_default("index is required.");
+ }
+ return this._primitives[index];
+};
+PrimitiveCollection.prototype.update = function(frameState) {
+ if (!this.show) {
+ return;
+ }
+ const primitives = this._primitives;
+ for (let i = 0; i < primitives.length; ++i) {
+ primitives[i].update(frameState);
+ }
+};
+PrimitiveCollection.prototype.prePassesUpdate = function(frameState) {
+ const primitives = this._primitives;
+ for (let i = 0; i < primitives.length; ++i) {
+ const primitive = primitives[i];
+ if (defined_default(primitive.prePassesUpdate)) {
+ primitive.prePassesUpdate(frameState);
+ }
+ }
+};
+PrimitiveCollection.prototype.updateForPass = function(frameState, passState) {
+ const primitives = this._primitives;
+ for (let i = 0; i < primitives.length; ++i) {
+ const primitive = primitives[i];
+ if (defined_default(primitive.updateForPass)) {
+ primitive.updateForPass(frameState, passState);
+ }
+ }
+};
+PrimitiveCollection.prototype.postPassesUpdate = function(frameState) {
+ const primitives = this._primitives;
+ for (let i = 0; i < primitives.length; ++i) {
+ const primitive = primitives[i];
+ if (defined_default(primitive.postPassesUpdate)) {
+ primitive.postPassesUpdate(frameState);
+ }
+ }
+};
+PrimitiveCollection.prototype.isDestroyed = function() {
+ return false;
+};
+PrimitiveCollection.prototype.destroy = function() {
+ this.removeAll();
+ return destroyObject_default(this);
+};
+var PrimitiveCollection_default = PrimitiveCollection;
+
+// Source/Scene/OrderedGroundPrimitiveCollection.js
+function OrderedGroundPrimitiveCollection() {
+ this._length = 0;
+ this._collections = {};
+ this._collectionsArray = [];
+ this.show = true;
+}
+Object.defineProperties(OrderedGroundPrimitiveCollection.prototype, {
+ length: {
+ get: function() {
+ return this._length;
+ }
+ }
+});
+OrderedGroundPrimitiveCollection.prototype.add = function(primitive, zIndex) {
+ Check_default.defined("primitive", primitive);
+ if (defined_default(zIndex)) {
+ Check_default.typeOf.number("zIndex", zIndex);
+ }
+ zIndex = defaultValue_default(zIndex, 0);
+ let collection = this._collections[zIndex];
+ if (!defined_default(collection)) {
+ collection = new PrimitiveCollection_default({ destroyPrimitives: false });
+ collection._zIndex = zIndex;
+ this._collections[zIndex] = collection;
+ const array = this._collectionsArray;
+ let i = 0;
+ while (i < array.length && array[i]._zIndex < zIndex) {
+ i++;
+ }
+ array.splice(i, 0, collection);
+ }
+ collection.add(primitive);
+ this._length++;
+ primitive._zIndex = zIndex;
+ return primitive;
+};
+OrderedGroundPrimitiveCollection.prototype.set = function(primitive, zIndex) {
+ Check_default.defined("primitive", primitive);
+ Check_default.typeOf.number("zIndex", zIndex);
+ if (zIndex === primitive._zIndex) {
+ return primitive;
+ }
+ this.remove(primitive, true);
+ this.add(primitive, zIndex);
+ return primitive;
+};
+OrderedGroundPrimitiveCollection.prototype.remove = function(primitive, doNotDestroy) {
+ if (this.contains(primitive)) {
+ const index = primitive._zIndex;
+ const collection = this._collections[index];
+ let result;
+ if (doNotDestroy) {
+ result = collection.remove(primitive);
+ } else {
+ result = collection.removeAndDestroy(primitive);
+ }
+ if (result) {
+ this._length--;
+ }
+ if (collection.length === 0) {
+ this._collectionsArray.splice(
+ this._collectionsArray.indexOf(collection),
+ 1
+ );
+ this._collections[index] = void 0;
+ collection.destroy();
+ }
+ return result;
+ }
+ return false;
+};
+OrderedGroundPrimitiveCollection.prototype.removeAll = function() {
+ const collections = this._collectionsArray;
+ for (let i = 0; i < collections.length; i++) {
+ const collection = collections[i];
+ collection.destroyPrimitives = true;
+ collection.destroy();
+ }
+ this._collections = {};
+ this._collectionsArray = [];
+ this._length = 0;
+};
+OrderedGroundPrimitiveCollection.prototype.contains = function(primitive) {
+ if (!defined_default(primitive)) {
+ return false;
+ }
+ const collection = this._collections[primitive._zIndex];
+ return defined_default(collection) && collection.contains(primitive);
+};
+OrderedGroundPrimitiveCollection.prototype.update = function(frameState) {
+ if (!this.show) {
+ return;
+ }
+ const collections = this._collectionsArray;
+ for (let i = 0; i < collections.length; i++) {
+ collections[i].update(frameState);
+ }
+};
+OrderedGroundPrimitiveCollection.prototype.isDestroyed = function() {
+ return false;
+};
+OrderedGroundPrimitiveCollection.prototype.destroy = function() {
+ this.removeAll();
+ return destroyObject_default(this);
+};
+var OrderedGroundPrimitiveCollection_default = OrderedGroundPrimitiveCollection;
+
+// Source/DataSources/DynamicGeometryBatch.js
+function DynamicGeometryBatch(primitives, orderedGroundPrimitives) {
+ this._primitives = primitives;
+ this._orderedGroundPrimitives = orderedGroundPrimitives;
+ this._dynamicUpdaters = new AssociativeArray_default();
+}
+DynamicGeometryBatch.prototype.add = function(time, updater) {
+ this._dynamicUpdaters.set(
+ updater.id,
+ updater.createDynamicUpdater(
+ this._primitives,
+ this._orderedGroundPrimitives
+ )
+ );
+};
+DynamicGeometryBatch.prototype.remove = function(updater) {
+ const id = updater.id;
+ const dynamicUpdater = this._dynamicUpdaters.get(id);
+ if (defined_default(dynamicUpdater)) {
+ this._dynamicUpdaters.remove(id);
+ dynamicUpdater.destroy();
+ }
+};
+DynamicGeometryBatch.prototype.update = function(time) {
+ const geometries = this._dynamicUpdaters.values;
+ for (let i = 0, len = geometries.length; i < len; i++) {
+ geometries[i].update(time);
+ }
+ return true;
+};
+DynamicGeometryBatch.prototype.removeAllPrimitives = function() {
+ const geometries = this._dynamicUpdaters.values;
+ for (let i = 0, len = geometries.length; i < len; i++) {
+ geometries[i].destroy();
+ }
+ this._dynamicUpdaters.removeAll();
+};
+DynamicGeometryBatch.prototype.getBoundingSphere = function(updater, result) {
+ updater = this._dynamicUpdaters.get(updater.id);
+ if (defined_default(updater) && defined_default(updater.getBoundingSphere)) {
+ return updater.getBoundingSphere(result);
+ }
+ return BoundingSphereState_default.FAILED;
+};
+var DynamicGeometryBatch_default = DynamicGeometryBatch;
+
+// Source/Core/EllipseGeometryLibrary.js
+var EllipseGeometryLibrary = {};
+var rotAxis = new Cartesian3_default();
+var tempVec = new Cartesian3_default();
+var unitQuat = new Quaternion_default();
+var rotMtx = new Matrix3_default();
+function pointOnEllipsoid(theta, rotation, northVec, eastVec, aSqr, ab, bSqr, mag, unitPos, result) {
+ const azimuth = theta + rotation;
+ Cartesian3_default.multiplyByScalar(eastVec, Math.cos(azimuth), rotAxis);
+ Cartesian3_default.multiplyByScalar(northVec, Math.sin(azimuth), tempVec);
+ Cartesian3_default.add(rotAxis, tempVec, rotAxis);
+ let cosThetaSquared = Math.cos(theta);
+ cosThetaSquared = cosThetaSquared * cosThetaSquared;
+ let sinThetaSquared = Math.sin(theta);
+ sinThetaSquared = sinThetaSquared * sinThetaSquared;
+ const radius = ab / Math.sqrt(bSqr * cosThetaSquared + aSqr * sinThetaSquared);
+ const angle = radius / mag;
+ Quaternion_default.fromAxisAngle(rotAxis, angle, unitQuat);
+ Matrix3_default.fromQuaternion(unitQuat, rotMtx);
+ Matrix3_default.multiplyByVector(rotMtx, unitPos, result);
+ Cartesian3_default.normalize(result, result);
+ Cartesian3_default.multiplyByScalar(result, mag, result);
+ return result;
+}
+var scratchCartesian16 = new Cartesian3_default();
+var scratchCartesian27 = new Cartesian3_default();
+var scratchCartesian37 = new Cartesian3_default();
+var scratchNormal2 = new Cartesian3_default();
+EllipseGeometryLibrary.raisePositionsToHeight = function(positions, options, extrude) {
+ const ellipsoid = options.ellipsoid;
+ const height = options.height;
+ const extrudedHeight = options.extrudedHeight;
+ const size = extrude ? positions.length / 3 * 2 : positions.length / 3;
+ const finalPositions = new Float64Array(size * 3);
+ const length3 = positions.length;
+ const bottomOffset = extrude ? length3 : 0;
+ for (let i = 0; i < length3; i += 3) {
+ const i1 = i + 1;
+ const i2 = i + 2;
+ const position = Cartesian3_default.fromArray(positions, i, scratchCartesian16);
+ ellipsoid.scaleToGeodeticSurface(position, position);
+ const extrudedPosition = Cartesian3_default.clone(position, scratchCartesian27);
+ const normal2 = ellipsoid.geodeticSurfaceNormal(position, scratchNormal2);
+ const scaledNormal = Cartesian3_default.multiplyByScalar(
+ normal2,
+ height,
+ scratchCartesian37
+ );
+ Cartesian3_default.add(position, scaledNormal, position);
+ if (extrude) {
+ Cartesian3_default.multiplyByScalar(normal2, extrudedHeight, scaledNormal);
+ Cartesian3_default.add(extrudedPosition, scaledNormal, extrudedPosition);
+ finalPositions[i + bottomOffset] = extrudedPosition.x;
+ finalPositions[i1 + bottomOffset] = extrudedPosition.y;
+ finalPositions[i2 + bottomOffset] = extrudedPosition.z;
+ }
+ finalPositions[i] = position.x;
+ finalPositions[i1] = position.y;
+ finalPositions[i2] = position.z;
+ }
+ return finalPositions;
+};
+var unitPosScratch = new Cartesian3_default();
+var eastVecScratch = new Cartesian3_default();
+var northVecScratch = new Cartesian3_default();
+EllipseGeometryLibrary.computeEllipsePositions = function(options, addFillPositions, addEdgePositions) {
+ const semiMinorAxis = options.semiMinorAxis;
+ const semiMajorAxis = options.semiMajorAxis;
+ const rotation = options.rotation;
+ const center = options.center;
+ const granularity = options.granularity * 8;
+ const aSqr = semiMinorAxis * semiMinorAxis;
+ const bSqr = semiMajorAxis * semiMajorAxis;
+ const ab = semiMajorAxis * semiMinorAxis;
+ const mag = Cartesian3_default.magnitude(center);
+ const unitPos = Cartesian3_default.normalize(center, unitPosScratch);
+ let eastVec = Cartesian3_default.cross(Cartesian3_default.UNIT_Z, center, eastVecScratch);
+ eastVec = Cartesian3_default.normalize(eastVec, eastVec);
+ const northVec = Cartesian3_default.cross(unitPos, eastVec, northVecScratch);
+ let numPts = 1 + Math.ceil(Math_default.PI_OVER_TWO / granularity);
+ const deltaTheta = Math_default.PI_OVER_TWO / (numPts - 1);
+ let theta = Math_default.PI_OVER_TWO - numPts * deltaTheta;
+ if (theta < 0) {
+ numPts -= Math.ceil(Math.abs(theta) / deltaTheta);
+ }
+ const size = 2 * (numPts * (numPts + 2));
+ const positions = addFillPositions ? new Array(size * 3) : void 0;
+ let positionIndex = 0;
+ let position = scratchCartesian16;
+ let reflectedPosition = scratchCartesian27;
+ const outerPositionsLength = numPts * 4 * 3;
+ let outerRightIndex = outerPositionsLength - 1;
+ let outerLeftIndex = 0;
+ const outerPositions = addEdgePositions ? new Array(outerPositionsLength) : void 0;
+ let i;
+ let j;
+ let numInterior;
+ let t;
+ let interiorPosition;
+ theta = Math_default.PI_OVER_TWO;
+ position = pointOnEllipsoid(
+ theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ position
+ );
+ if (addFillPositions) {
+ positions[positionIndex++] = position.x;
+ positions[positionIndex++] = position.y;
+ positions[positionIndex++] = position.z;
+ }
+ if (addEdgePositions) {
+ outerPositions[outerRightIndex--] = position.z;
+ outerPositions[outerRightIndex--] = position.y;
+ outerPositions[outerRightIndex--] = position.x;
+ }
+ theta = Math_default.PI_OVER_TWO - deltaTheta;
+ for (i = 1; i < numPts + 1; ++i) {
+ position = pointOnEllipsoid(
+ theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ position
+ );
+ reflectedPosition = pointOnEllipsoid(
+ Math.PI - theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ reflectedPosition
+ );
+ if (addFillPositions) {
+ positions[positionIndex++] = position.x;
+ positions[positionIndex++] = position.y;
+ positions[positionIndex++] = position.z;
+ numInterior = 2 * i + 2;
+ for (j = 1; j < numInterior - 1; ++j) {
+ t = j / (numInterior - 1);
+ interiorPosition = Cartesian3_default.lerp(
+ position,
+ reflectedPosition,
+ t,
+ scratchCartesian37
+ );
+ positions[positionIndex++] = interiorPosition.x;
+ positions[positionIndex++] = interiorPosition.y;
+ positions[positionIndex++] = interiorPosition.z;
+ }
+ positions[positionIndex++] = reflectedPosition.x;
+ positions[positionIndex++] = reflectedPosition.y;
+ positions[positionIndex++] = reflectedPosition.z;
+ }
+ if (addEdgePositions) {
+ outerPositions[outerRightIndex--] = position.z;
+ outerPositions[outerRightIndex--] = position.y;
+ outerPositions[outerRightIndex--] = position.x;
+ outerPositions[outerLeftIndex++] = reflectedPosition.x;
+ outerPositions[outerLeftIndex++] = reflectedPosition.y;
+ outerPositions[outerLeftIndex++] = reflectedPosition.z;
+ }
+ theta = Math_default.PI_OVER_TWO - (i + 1) * deltaTheta;
+ }
+ for (i = numPts; i > 1; --i) {
+ theta = Math_default.PI_OVER_TWO - (i - 1) * deltaTheta;
+ position = pointOnEllipsoid(
+ -theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ position
+ );
+ reflectedPosition = pointOnEllipsoid(
+ theta + Math.PI,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ reflectedPosition
+ );
+ if (addFillPositions) {
+ positions[positionIndex++] = position.x;
+ positions[positionIndex++] = position.y;
+ positions[positionIndex++] = position.z;
+ numInterior = 2 * (i - 1) + 2;
+ for (j = 1; j < numInterior - 1; ++j) {
+ t = j / (numInterior - 1);
+ interiorPosition = Cartesian3_default.lerp(
+ position,
+ reflectedPosition,
+ t,
+ scratchCartesian37
+ );
+ positions[positionIndex++] = interiorPosition.x;
+ positions[positionIndex++] = interiorPosition.y;
+ positions[positionIndex++] = interiorPosition.z;
+ }
+ positions[positionIndex++] = reflectedPosition.x;
+ positions[positionIndex++] = reflectedPosition.y;
+ positions[positionIndex++] = reflectedPosition.z;
+ }
+ if (addEdgePositions) {
+ outerPositions[outerRightIndex--] = position.z;
+ outerPositions[outerRightIndex--] = position.y;
+ outerPositions[outerRightIndex--] = position.x;
+ outerPositions[outerLeftIndex++] = reflectedPosition.x;
+ outerPositions[outerLeftIndex++] = reflectedPosition.y;
+ outerPositions[outerLeftIndex++] = reflectedPosition.z;
+ }
+ }
+ theta = Math_default.PI_OVER_TWO;
+ position = pointOnEllipsoid(
+ -theta,
+ rotation,
+ northVec,
+ eastVec,
+ aSqr,
+ ab,
+ bSqr,
+ mag,
+ unitPos,
+ position
+ );
+ const r = {};
+ if (addFillPositions) {
+ positions[positionIndex++] = position.x;
+ positions[positionIndex++] = position.y;
+ positions[positionIndex++] = position.z;
+ r.positions = positions;
+ r.numPts = numPts;
+ }
+ if (addEdgePositions) {
+ outerPositions[outerRightIndex--] = position.z;
+ outerPositions[outerRightIndex--] = position.y;
+ outerPositions[outerRightIndex--] = position.x;
+ r.outerPositions = outerPositions;
+ }
+ return r;
+};
+var EllipseGeometryLibrary_default = EllipseGeometryLibrary;
+
+// Source/Core/EllipseGeometry.js
+var scratchCartesian17 = new Cartesian3_default();
+var scratchCartesian28 = new Cartesian3_default();
+var scratchCartesian38 = new Cartesian3_default();
+var scratchCartesian45 = new Cartesian3_default();
+var texCoordScratch = new Cartesian2_default();
+var textureMatrixScratch = new Matrix3_default();
+var tangentMatrixScratch = new Matrix3_default();
+var quaternionScratch2 = new Quaternion_default();
+var scratchNormal3 = new Cartesian3_default();
+var scratchTangent = new Cartesian3_default();
+var scratchBitangent = new Cartesian3_default();
+var scratchCartographic10 = new Cartographic_default();
+var projectedCenterScratch = new Cartesian3_default();
+var scratchMinTexCoord = new Cartesian2_default();
+var scratchMaxTexCoord = new Cartesian2_default();
+function computeTopBottomAttributes(positions, options, extrude) {
+ const vertexFormat = options.vertexFormat;
+ const center = options.center;
+ const semiMajorAxis = options.semiMajorAxis;
+ const semiMinorAxis = options.semiMinorAxis;
+ const ellipsoid = options.ellipsoid;
+ const stRotation = options.stRotation;
+ const size = extrude ? positions.length / 3 * 2 : positions.length / 3;
+ const shadowVolume = options.shadowVolume;
+ const textureCoordinates = vertexFormat.st ? new Float32Array(size * 2) : void 0;
+ const normals = vertexFormat.normal ? new Float32Array(size * 3) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(size * 3) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(size * 3) : void 0;
+ const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : void 0;
+ let textureCoordIndex = 0;
+ let normal2 = scratchNormal3;
+ let tangent = scratchTangent;
+ let bitangent = scratchBitangent;
+ const projection = new GeographicProjection_default(ellipsoid);
+ const projectedCenter = projection.project(
+ ellipsoid.cartesianToCartographic(center, scratchCartographic10),
+ projectedCenterScratch
+ );
+ const geodeticNormal = ellipsoid.scaleToGeodeticSurface(
+ center,
+ scratchCartesian17
+ );
+ ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);
+ let textureMatrix = textureMatrixScratch;
+ let tangentMatrix = tangentMatrixScratch;
+ if (stRotation !== 0) {
+ let rotation = Quaternion_default.fromAxisAngle(
+ geodeticNormal,
+ stRotation,
+ quaternionScratch2
+ );
+ textureMatrix = Matrix3_default.fromQuaternion(rotation, textureMatrix);
+ rotation = Quaternion_default.fromAxisAngle(
+ geodeticNormal,
+ -stRotation,
+ quaternionScratch2
+ );
+ tangentMatrix = Matrix3_default.fromQuaternion(rotation, tangentMatrix);
+ } else {
+ textureMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY, textureMatrix);
+ tangentMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY, tangentMatrix);
+ }
+ const minTexCoord = Cartesian2_default.fromElements(
+ Number.POSITIVE_INFINITY,
+ Number.POSITIVE_INFINITY,
+ scratchMinTexCoord
+ );
+ const maxTexCoord = Cartesian2_default.fromElements(
+ Number.NEGATIVE_INFINITY,
+ Number.NEGATIVE_INFINITY,
+ scratchMaxTexCoord
+ );
+ let length3 = positions.length;
+ const bottomOffset = extrude ? length3 : 0;
+ const stOffset = bottomOffset / 3 * 2;
+ for (let i = 0; i < length3; i += 3) {
+ const i1 = i + 1;
+ const i2 = i + 2;
+ const position = Cartesian3_default.fromArray(positions, i, scratchCartesian17);
+ if (vertexFormat.st) {
+ const rotatedPoint = Matrix3_default.multiplyByVector(
+ textureMatrix,
+ position,
+ scratchCartesian28
+ );
+ const projectedPoint = projection.project(
+ ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic10),
+ scratchCartesian38
+ );
+ Cartesian3_default.subtract(projectedPoint, projectedCenter, projectedPoint);
+ texCoordScratch.x = (projectedPoint.x + semiMajorAxis) / (2 * semiMajorAxis);
+ texCoordScratch.y = (projectedPoint.y + semiMinorAxis) / (2 * semiMinorAxis);
+ minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);
+ minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);
+ maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);
+ maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);
+ if (extrude) {
+ textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;
+ textureCoordinates[textureCoordIndex + 1 + stOffset] = texCoordScratch.y;
+ }
+ textureCoordinates[textureCoordIndex++] = texCoordScratch.x;
+ textureCoordinates[textureCoordIndex++] = texCoordScratch.y;
+ }
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) {
+ normal2 = ellipsoid.geodeticSurfaceNormal(position, normal2);
+ if (shadowVolume) {
+ extrudeNormals[i + bottomOffset] = -normal2.x;
+ extrudeNormals[i1 + bottomOffset] = -normal2.y;
+ extrudeNormals[i2 + bottomOffset] = -normal2.z;
+ }
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ tangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal2, tangent),
+ tangent
+ );
+ Matrix3_default.multiplyByVector(tangentMatrix, tangent, tangent);
+ }
+ if (vertexFormat.normal) {
+ normals[i] = normal2.x;
+ normals[i1] = normal2.y;
+ normals[i2] = normal2.z;
+ if (extrude) {
+ normals[i + bottomOffset] = -normal2.x;
+ normals[i1 + bottomOffset] = -normal2.y;
+ normals[i2 + bottomOffset] = -normal2.z;
+ }
+ }
+ if (vertexFormat.tangent) {
+ tangents[i] = tangent.x;
+ tangents[i1] = tangent.y;
+ tangents[i2] = tangent.z;
+ if (extrude) {
+ tangents[i + bottomOffset] = -tangent.x;
+ tangents[i1 + bottomOffset] = -tangent.y;
+ tangents[i2 + bottomOffset] = -tangent.z;
+ }
+ }
+ if (vertexFormat.bitangent) {
+ bitangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(normal2, tangent, bitangent),
+ bitangent
+ );
+ bitangents[i] = bitangent.x;
+ bitangents[i1] = bitangent.y;
+ bitangents[i2] = bitangent.z;
+ if (extrude) {
+ bitangents[i + bottomOffset] = bitangent.x;
+ bitangents[i1 + bottomOffset] = bitangent.y;
+ bitangents[i2 + bottomOffset] = bitangent.z;
+ }
+ }
+ }
+ }
+ }
+ if (vertexFormat.st) {
+ length3 = textureCoordinates.length;
+ for (let k = 0; k < length3; k += 2) {
+ textureCoordinates[k] = (textureCoordinates[k] - minTexCoord.x) / (maxTexCoord.x - minTexCoord.x);
+ textureCoordinates[k + 1] = (textureCoordinates[k + 1] - minTexCoord.y) / (maxTexCoord.y - minTexCoord.y);
+ }
+ }
+ const attributes = new GeometryAttributes_default();
+ if (vertexFormat.position) {
+ const finalPositions = EllipseGeometryLibrary_default.raisePositionsToHeight(
+ positions,
+ options,
+ extrude
+ );
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: finalPositions
+ });
+ }
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates
+ });
+ }
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals
+ });
+ }
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents
+ });
+ }
+ if (shadowVolume) {
+ attributes.extrudeDirection = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: extrudeNormals
+ });
+ }
+ if (extrude && defined_default(options.offsetAttribute)) {
+ let offsetAttribute = new Uint8Array(size);
+ if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else {
+ const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute
+ });
+ }
+ return attributes;
+}
+function topIndices(numPts) {
+ const indices2 = new Array(12 * (numPts * (numPts + 1)) - 6);
+ let indicesIndex = 0;
+ let prevIndex;
+ let numInterior;
+ let positionIndex;
+ let i;
+ let j;
+ prevIndex = 0;
+ positionIndex = 1;
+ for (i = 0; i < 3; i++) {
+ indices2[indicesIndex++] = positionIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex;
+ }
+ for (i = 2; i < numPts + 1; ++i) {
+ positionIndex = i * (i + 1) - 1;
+ prevIndex = (i - 1) * i - 1;
+ indices2[indicesIndex++] = positionIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex;
+ numInterior = 2 * i;
+ for (j = 0; j < numInterior - 1; ++j) {
+ indices2[indicesIndex++] = positionIndex;
+ indices2[indicesIndex++] = prevIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex;
+ }
+ indices2[indicesIndex++] = positionIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex;
+ }
+ numInterior = numPts * 2;
+ ++positionIndex;
+ ++prevIndex;
+ for (i = 0; i < numInterior - 1; ++i) {
+ indices2[indicesIndex++] = positionIndex;
+ indices2[indicesIndex++] = prevIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex;
+ }
+ indices2[indicesIndex++] = positionIndex;
+ indices2[indicesIndex++] = prevIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex++;
+ indices2[indicesIndex++] = prevIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ ++prevIndex;
+ for (i = numPts - 1; i > 1; --i) {
+ indices2[indicesIndex++] = prevIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex;
+ numInterior = 2 * i;
+ for (j = 0; j < numInterior - 1; ++j) {
+ indices2[indicesIndex++] = positionIndex;
+ indices2[indicesIndex++] = prevIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex;
+ }
+ indices2[indicesIndex++] = prevIndex++;
+ indices2[indicesIndex++] = prevIndex++;
+ indices2[indicesIndex++] = positionIndex++;
+ }
+ for (i = 0; i < 3; i++) {
+ indices2[indicesIndex++] = prevIndex++;
+ indices2[indicesIndex++] = prevIndex;
+ indices2[indicesIndex++] = positionIndex;
+ }
+ return indices2;
+}
+var boundingSphereCenter = new Cartesian3_default();
+function computeEllipse(options) {
+ const center = options.center;
+ boundingSphereCenter = Cartesian3_default.multiplyByScalar(
+ options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter),
+ options.height,
+ boundingSphereCenter
+ );
+ boundingSphereCenter = Cartesian3_default.add(
+ center,
+ boundingSphereCenter,
+ boundingSphereCenter
+ );
+ const boundingSphere = new BoundingSphere_default(
+ boundingSphereCenter,
+ options.semiMajorAxis
+ );
+ const cep = EllipseGeometryLibrary_default.computeEllipsePositions(
+ options,
+ true,
+ false
+ );
+ const positions = cep.positions;
+ const numPts = cep.numPts;
+ const attributes = computeTopBottomAttributes(positions, options, false);
+ let indices2 = topIndices(numPts);
+ indices2 = IndexDatatype_default.createTypedArray(positions.length / 3, indices2);
+ return {
+ boundingSphere,
+ attributes,
+ indices: indices2
+ };
+}
+function computeWallAttributes(positions, options) {
+ const vertexFormat = options.vertexFormat;
+ const center = options.center;
+ const semiMajorAxis = options.semiMajorAxis;
+ const semiMinorAxis = options.semiMinorAxis;
+ const ellipsoid = options.ellipsoid;
+ const height = options.height;
+ const extrudedHeight = options.extrudedHeight;
+ const stRotation = options.stRotation;
+ const size = positions.length / 3 * 2;
+ const finalPositions = new Float64Array(size * 3);
+ const textureCoordinates = vertexFormat.st ? new Float32Array(size * 2) : void 0;
+ const normals = vertexFormat.normal ? new Float32Array(size * 3) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(size * 3) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(size * 3) : void 0;
+ const shadowVolume = options.shadowVolume;
+ const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : void 0;
+ let textureCoordIndex = 0;
+ let normal2 = scratchNormal3;
+ let tangent = scratchTangent;
+ let bitangent = scratchBitangent;
+ const projection = new GeographicProjection_default(ellipsoid);
+ const projectedCenter = projection.project(
+ ellipsoid.cartesianToCartographic(center, scratchCartographic10),
+ projectedCenterScratch
+ );
+ const geodeticNormal = ellipsoid.scaleToGeodeticSurface(
+ center,
+ scratchCartesian17
+ );
+ ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);
+ const rotation = Quaternion_default.fromAxisAngle(
+ geodeticNormal,
+ stRotation,
+ quaternionScratch2
+ );
+ const textureMatrix = Matrix3_default.fromQuaternion(rotation, textureMatrixScratch);
+ const minTexCoord = Cartesian2_default.fromElements(
+ Number.POSITIVE_INFINITY,
+ Number.POSITIVE_INFINITY,
+ scratchMinTexCoord
+ );
+ const maxTexCoord = Cartesian2_default.fromElements(
+ Number.NEGATIVE_INFINITY,
+ Number.NEGATIVE_INFINITY,
+ scratchMaxTexCoord
+ );
+ let length3 = positions.length;
+ const stOffset = length3 / 3 * 2;
+ for (let i = 0; i < length3; i += 3) {
+ const i1 = i + 1;
+ const i2 = i + 2;
+ let position = Cartesian3_default.fromArray(positions, i, scratchCartesian17);
+ let extrudedPosition;
+ if (vertexFormat.st) {
+ const rotatedPoint = Matrix3_default.multiplyByVector(
+ textureMatrix,
+ position,
+ scratchCartesian28
+ );
+ const projectedPoint = projection.project(
+ ellipsoid.cartesianToCartographic(rotatedPoint, scratchCartographic10),
+ scratchCartesian38
+ );
+ Cartesian3_default.subtract(projectedPoint, projectedCenter, projectedPoint);
+ texCoordScratch.x = (projectedPoint.x + semiMajorAxis) / (2 * semiMajorAxis);
+ texCoordScratch.y = (projectedPoint.y + semiMinorAxis) / (2 * semiMinorAxis);
+ minTexCoord.x = Math.min(texCoordScratch.x, minTexCoord.x);
+ minTexCoord.y = Math.min(texCoordScratch.y, minTexCoord.y);
+ maxTexCoord.x = Math.max(texCoordScratch.x, maxTexCoord.x);
+ maxTexCoord.y = Math.max(texCoordScratch.y, maxTexCoord.y);
+ textureCoordinates[textureCoordIndex + stOffset] = texCoordScratch.x;
+ textureCoordinates[textureCoordIndex + 1 + stOffset] = texCoordScratch.y;
+ textureCoordinates[textureCoordIndex++] = texCoordScratch.x;
+ textureCoordinates[textureCoordIndex++] = texCoordScratch.y;
+ }
+ position = ellipsoid.scaleToGeodeticSurface(position, position);
+ extrudedPosition = Cartesian3_default.clone(position, scratchCartesian28);
+ normal2 = ellipsoid.geodeticSurfaceNormal(position, normal2);
+ if (shadowVolume) {
+ extrudeNormals[i + length3] = -normal2.x;
+ extrudeNormals[i1 + length3] = -normal2.y;
+ extrudeNormals[i2 + length3] = -normal2.z;
+ }
+ let scaledNormal = Cartesian3_default.multiplyByScalar(
+ normal2,
+ height,
+ scratchCartesian45
+ );
+ position = Cartesian3_default.add(position, scaledNormal, position);
+ scaledNormal = Cartesian3_default.multiplyByScalar(
+ normal2,
+ extrudedHeight,
+ scaledNormal
+ );
+ extrudedPosition = Cartesian3_default.add(
+ extrudedPosition,
+ scaledNormal,
+ extrudedPosition
+ );
+ if (vertexFormat.position) {
+ finalPositions[i + length3] = extrudedPosition.x;
+ finalPositions[i1 + length3] = extrudedPosition.y;
+ finalPositions[i2 + length3] = extrudedPosition.z;
+ finalPositions[i] = position.x;
+ finalPositions[i1] = position.y;
+ finalPositions[i2] = position.z;
+ }
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
+ bitangent = Cartesian3_default.clone(normal2, bitangent);
+ const next = Cartesian3_default.fromArray(
+ positions,
+ (i + 3) % length3,
+ scratchCartesian45
+ );
+ Cartesian3_default.subtract(next, position, next);
+ const bottom = Cartesian3_default.subtract(
+ extrudedPosition,
+ position,
+ scratchCartesian38
+ );
+ normal2 = Cartesian3_default.normalize(
+ Cartesian3_default.cross(bottom, next, normal2),
+ normal2
+ );
+ if (vertexFormat.normal) {
+ normals[i] = normal2.x;
+ normals[i1] = normal2.y;
+ normals[i2] = normal2.z;
+ normals[i + length3] = normal2.x;
+ normals[i1 + length3] = normal2.y;
+ normals[i2 + length3] = normal2.z;
+ }
+ if (vertexFormat.tangent) {
+ tangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(bitangent, normal2, tangent),
+ tangent
+ );
+ tangents[i] = tangent.x;
+ tangents[i1] = tangent.y;
+ tangents[i2] = tangent.z;
+ tangents[i + length3] = tangent.x;
+ tangents[i + 1 + length3] = tangent.y;
+ tangents[i + 2 + length3] = tangent.z;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents[i] = bitangent.x;
+ bitangents[i1] = bitangent.y;
+ bitangents[i2] = bitangent.z;
+ bitangents[i + length3] = bitangent.x;
+ bitangents[i1 + length3] = bitangent.y;
+ bitangents[i2 + length3] = bitangent.z;
+ }
+ }
+ }
+ if (vertexFormat.st) {
+ length3 = textureCoordinates.length;
+ for (let k = 0; k < length3; k += 2) {
+ textureCoordinates[k] = (textureCoordinates[k] - minTexCoord.x) / (maxTexCoord.x - minTexCoord.x);
+ textureCoordinates[k + 1] = (textureCoordinates[k + 1] - minTexCoord.y) / (maxTexCoord.y - minTexCoord.y);
+ }
+ }
+ const attributes = new GeometryAttributes_default();
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: finalPositions
+ });
+ }
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates
+ });
+ }
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals
+ });
+ }
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents
+ });
+ }
+ if (shadowVolume) {
+ attributes.extrudeDirection = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: extrudeNormals
+ });
+ }
+ if (defined_default(options.offsetAttribute)) {
+ let offsetAttribute = new Uint8Array(size);
+ if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else {
+ const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute
+ });
+ }
+ return attributes;
+}
+function computeWallIndices(positions) {
+ const length3 = positions.length / 3;
+ const indices2 = IndexDatatype_default.createTypedArray(length3, length3 * 6);
+ let index = 0;
+ for (let i = 0; i < length3; i++) {
+ const UL = i;
+ const LL = i + length3;
+ const UR = (UL + 1) % length3;
+ const LR = UR + length3;
+ indices2[index++] = UL;
+ indices2[index++] = LL;
+ indices2[index++] = UR;
+ indices2[index++] = UR;
+ indices2[index++] = LL;
+ indices2[index++] = LR;
+ }
+ return indices2;
+}
+var topBoundingSphere2 = new BoundingSphere_default();
+var bottomBoundingSphere2 = new BoundingSphere_default();
+function computeExtrudedEllipse(options) {
+ const center = options.center;
+ const ellipsoid = options.ellipsoid;
+ const semiMajorAxis = options.semiMajorAxis;
+ let scaledNormal = Cartesian3_default.multiplyByScalar(
+ ellipsoid.geodeticSurfaceNormal(center, scratchCartesian17),
+ options.height,
+ scratchCartesian17
+ );
+ topBoundingSphere2.center = Cartesian3_default.add(
+ center,
+ scaledNormal,
+ topBoundingSphere2.center
+ );
+ topBoundingSphere2.radius = semiMajorAxis;
+ scaledNormal = Cartesian3_default.multiplyByScalar(
+ ellipsoid.geodeticSurfaceNormal(center, scaledNormal),
+ options.extrudedHeight,
+ scaledNormal
+ );
+ bottomBoundingSphere2.center = Cartesian3_default.add(
+ center,
+ scaledNormal,
+ bottomBoundingSphere2.center
+ );
+ bottomBoundingSphere2.radius = semiMajorAxis;
+ const cep = EllipseGeometryLibrary_default.computeEllipsePositions(
+ options,
+ true,
+ true
+ );
+ const positions = cep.positions;
+ const numPts = cep.numPts;
+ const outerPositions = cep.outerPositions;
+ const boundingSphere = BoundingSphere_default.union(
+ topBoundingSphere2,
+ bottomBoundingSphere2
+ );
+ const topBottomAttributes = computeTopBottomAttributes(
+ positions,
+ options,
+ true
+ );
+ let indices2 = topIndices(numPts);
+ const length3 = indices2.length;
+ indices2.length = length3 * 2;
+ const posLength = positions.length / 3;
+ for (let i = 0; i < length3; i += 3) {
+ indices2[i + length3] = indices2[i + 2] + posLength;
+ indices2[i + 1 + length3] = indices2[i + 1] + posLength;
+ indices2[i + 2 + length3] = indices2[i] + posLength;
+ }
+ const topBottomIndices = IndexDatatype_default.createTypedArray(
+ posLength * 2 / 3,
+ indices2
+ );
+ const topBottomGeo = new Geometry_default({
+ attributes: topBottomAttributes,
+ indices: topBottomIndices,
+ primitiveType: PrimitiveType_default.TRIANGLES
+ });
+ const wallAttributes = computeWallAttributes(outerPositions, options);
+ indices2 = computeWallIndices(outerPositions);
+ const wallIndices = IndexDatatype_default.createTypedArray(
+ outerPositions.length * 2 / 3,
+ indices2
+ );
+ const wallGeo = new Geometry_default({
+ attributes: wallAttributes,
+ indices: wallIndices,
+ primitiveType: PrimitiveType_default.TRIANGLES
+ });
+ const geo = GeometryPipeline_default.combineInstances([
+ new GeometryInstance_default({
+ geometry: topBottomGeo
+ }),
+ new GeometryInstance_default({
+ geometry: wallGeo
+ })
+ ]);
+ return {
+ boundingSphere,
+ attributes: geo[0].attributes,
+ indices: geo[0].indices
+ };
+}
+function computeRectangle2(center, semiMajorAxis, semiMinorAxis, rotation, granularity, ellipsoid, result) {
+ const cep = EllipseGeometryLibrary_default.computeEllipsePositions(
+ {
+ center,
+ semiMajorAxis,
+ semiMinorAxis,
+ rotation,
+ granularity
+ },
+ false,
+ true
+ );
+ const positionsFlat = cep.outerPositions;
+ const positionsCount = positionsFlat.length / 3;
+ const positions = new Array(positionsCount);
+ for (let i = 0; i < positionsCount; ++i) {
+ positions[i] = Cartesian3_default.fromArray(positionsFlat, i * 3);
+ }
+ const rectangle = Rectangle_default.fromCartesianArray(positions, ellipsoid, result);
+ if (rectangle.width > Math_default.PI) {
+ rectangle.north = rectangle.north > 0 ? Math_default.PI_OVER_TWO - Math_default.EPSILON7 : rectangle.north;
+ rectangle.south = rectangle.south < 0 ? Math_default.EPSILON7 - Math_default.PI_OVER_TWO : rectangle.south;
+ rectangle.east = Math_default.PI;
+ rectangle.west = -Math_default.PI;
+ }
+ return rectangle;
+}
+function EllipseGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const center = options.center;
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ const semiMajorAxis = options.semiMajorAxis;
+ const semiMinorAxis = options.semiMinorAxis;
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
+ Check_default.defined("options.center", center);
+ Check_default.typeOf.number("options.semiMajorAxis", semiMajorAxis);
+ Check_default.typeOf.number("options.semiMinorAxis", semiMinorAxis);
+ if (semiMajorAxis < semiMinorAxis) {
+ throw new DeveloperError_default(
+ "semiMajorAxis must be greater than or equal to the semiMinorAxis."
+ );
+ }
+ if (granularity <= 0) {
+ throw new DeveloperError_default("granularity must be greater than zero.");
+ }
+ const height = defaultValue_default(options.height, 0);
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
+ this._center = Cartesian3_default.clone(center);
+ this._semiMajorAxis = semiMajorAxis;
+ this._semiMinorAxis = semiMinorAxis;
+ this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
+ this._rotation = defaultValue_default(options.rotation, 0);
+ this._stRotation = defaultValue_default(options.stRotation, 0);
+ this._height = Math.max(extrudedHeight, height);
+ this._granularity = granularity;
+ this._vertexFormat = VertexFormat_default.clone(vertexFormat);
+ this._extrudedHeight = Math.min(extrudedHeight, height);
+ this._shadowVolume = defaultValue_default(options.shadowVolume, false);
+ this._workerName = "createEllipseGeometry";
+ this._offsetAttribute = options.offsetAttribute;
+ this._rectangle = void 0;
+ this._textureCoordinateRotationPoints = void 0;
+}
+EllipseGeometry.packedLength = Cartesian3_default.packedLength + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 9;
+EllipseGeometry.pack = function(value, array, startingIndex) {
+ Check_default.defined("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ Cartesian3_default.pack(value._center, array, startingIndex);
+ startingIndex += Cartesian3_default.packedLength;
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat_default.packedLength;
+ array[startingIndex++] = value._semiMajorAxis;
+ array[startingIndex++] = value._semiMinorAxis;
+ array[startingIndex++] = value._rotation;
+ array[startingIndex++] = value._stRotation;
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._shadowVolume ? 1 : 0;
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchCenter6 = new Cartesian3_default();
+var scratchEllipsoid4 = new Ellipsoid_default();
+var scratchVertexFormat4 = new VertexFormat_default();
+var scratchOptions11 = {
+ center: scratchCenter6,
+ ellipsoid: scratchEllipsoid4,
+ vertexFormat: scratchVertexFormat4,
+ semiMajorAxis: void 0,
+ semiMinorAxis: void 0,
+ rotation: void 0,
+ stRotation: void 0,
+ height: void 0,
+ granularity: void 0,
+ extrudedHeight: void 0,
+ shadowVolume: void 0,
+ offsetAttribute: void 0
+};
+EllipseGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const center = Cartesian3_default.unpack(array, startingIndex, scratchCenter6);
+ startingIndex += Cartesian3_default.packedLength;
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid4);
+ startingIndex += Ellipsoid_default.packedLength;
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat4
+ );
+ startingIndex += VertexFormat_default.packedLength;
+ const semiMajorAxis = array[startingIndex++];
+ const semiMinorAxis = array[startingIndex++];
+ const rotation = array[startingIndex++];
+ const stRotation = array[startingIndex++];
+ const height = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const shadowVolume = array[startingIndex++] === 1;
+ const offsetAttribute = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions11.height = height;
+ scratchOptions11.extrudedHeight = extrudedHeight;
+ scratchOptions11.granularity = granularity;
+ scratchOptions11.stRotation = stRotation;
+ scratchOptions11.rotation = rotation;
+ scratchOptions11.semiMajorAxis = semiMajorAxis;
+ scratchOptions11.semiMinorAxis = semiMinorAxis;
+ scratchOptions11.shadowVolume = shadowVolume;
+ scratchOptions11.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new EllipseGeometry(scratchOptions11);
+ }
+ result._center = Cartesian3_default.clone(center, result._center);
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._semiMajorAxis = semiMajorAxis;
+ result._semiMinorAxis = semiMinorAxis;
+ result._rotation = rotation;
+ result._stRotation = stRotation;
+ result._height = height;
+ result._granularity = granularity;
+ result._extrudedHeight = extrudedHeight;
+ result._shadowVolume = shadowVolume;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+EllipseGeometry.computeRectangle = function(options, result) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const center = options.center;
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ const semiMajorAxis = options.semiMajorAxis;
+ const semiMinorAxis = options.semiMinorAxis;
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ const rotation = defaultValue_default(options.rotation, 0);
+ Check_default.defined("options.center", center);
+ Check_default.typeOf.number("options.semiMajorAxis", semiMajorAxis);
+ Check_default.typeOf.number("options.semiMinorAxis", semiMinorAxis);
+ if (semiMajorAxis < semiMinorAxis) {
+ throw new DeveloperError_default(
+ "semiMajorAxis must be greater than or equal to the semiMinorAxis."
+ );
+ }
+ if (granularity <= 0) {
+ throw new DeveloperError_default("granularity must be greater than zero.");
+ }
+ return computeRectangle2(
+ center,
+ semiMajorAxis,
+ semiMinorAxis,
+ rotation,
+ granularity,
+ ellipsoid,
+ result
+ );
+};
+EllipseGeometry.createGeometry = function(ellipseGeometry) {
+ if (ellipseGeometry._semiMajorAxis <= 0 || ellipseGeometry._semiMinorAxis <= 0) {
+ return;
+ }
+ const height = ellipseGeometry._height;
+ const extrudedHeight = ellipseGeometry._extrudedHeight;
+ const extrude = !Math_default.equalsEpsilon(
+ height,
+ extrudedHeight,
+ 0,
+ Math_default.EPSILON2
+ );
+ ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(
+ ellipseGeometry._center,
+ ellipseGeometry._center
+ );
+ const options = {
+ center: ellipseGeometry._center,
+ semiMajorAxis: ellipseGeometry._semiMajorAxis,
+ semiMinorAxis: ellipseGeometry._semiMinorAxis,
+ ellipsoid: ellipseGeometry._ellipsoid,
+ rotation: ellipseGeometry._rotation,
+ height,
+ granularity: ellipseGeometry._granularity,
+ vertexFormat: ellipseGeometry._vertexFormat,
+ stRotation: ellipseGeometry._stRotation
+ };
+ let geometry;
+ if (extrude) {
+ options.extrudedHeight = extrudedHeight;
+ options.shadowVolume = ellipseGeometry._shadowVolume;
+ options.offsetAttribute = ellipseGeometry._offsetAttribute;
+ geometry = computeExtrudedEllipse(options);
+ } else {
+ geometry = computeEllipse(options);
+ if (defined_default(ellipseGeometry._offsetAttribute)) {
+ const length3 = geometry.attributes.position.values.length;
+ const offsetValue = ellipseGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ }
+ return new Geometry_default({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: PrimitiveType_default.TRIANGLES,
+ boundingSphere: geometry.boundingSphere,
+ offsetAttribute: ellipseGeometry._offsetAttribute
+ });
+};
+EllipseGeometry.createShadowVolume = function(ellipseGeometry, minHeightFunc, maxHeightFunc) {
+ const granularity = ellipseGeometry._granularity;
+ const ellipsoid = ellipseGeometry._ellipsoid;
+ const minHeight = minHeightFunc(granularity, ellipsoid);
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
+ return new EllipseGeometry({
+ center: ellipseGeometry._center,
+ semiMajorAxis: ellipseGeometry._semiMajorAxis,
+ semiMinorAxis: ellipseGeometry._semiMinorAxis,
+ ellipsoid,
+ rotation: ellipseGeometry._rotation,
+ stRotation: ellipseGeometry._stRotation,
+ granularity,
+ extrudedHeight: minHeight,
+ height: maxHeight,
+ vertexFormat: VertexFormat_default.POSITION_ONLY,
+ shadowVolume: true
+ });
+};
+function textureCoordinateRotationPoints(ellipseGeometry) {
+ const stRotation = -ellipseGeometry._stRotation;
+ if (stRotation === 0) {
+ return [0, 0, 0, 1, 1, 0];
+ }
+ const cep = EllipseGeometryLibrary_default.computeEllipsePositions(
+ {
+ center: ellipseGeometry._center,
+ semiMajorAxis: ellipseGeometry._semiMajorAxis,
+ semiMinorAxis: ellipseGeometry._semiMinorAxis,
+ rotation: ellipseGeometry._rotation,
+ granularity: ellipseGeometry._granularity
+ },
+ false,
+ true
+ );
+ const positionsFlat = cep.outerPositions;
+ const positionsCount = positionsFlat.length / 3;
+ const positions = new Array(positionsCount);
+ for (let i = 0; i < positionsCount; ++i) {
+ positions[i] = Cartesian3_default.fromArray(positionsFlat, i * 3);
+ }
+ const ellipsoid = ellipseGeometry._ellipsoid;
+ const boundingRectangle = ellipseGeometry.rectangle;
+ return Geometry_default._textureCoordinateRotationPoints(
+ positions,
+ stRotation,
+ ellipsoid,
+ boundingRectangle
+ );
+}
+Object.defineProperties(EllipseGeometry.prototype, {
+ rectangle: {
+ get: function() {
+ if (!defined_default(this._rectangle)) {
+ this._rectangle = computeRectangle2(
+ this._center,
+ this._semiMajorAxis,
+ this._semiMinorAxis,
+ this._rotation,
+ this._granularity,
+ this._ellipsoid
+ );
+ }
+ return this._rectangle;
+ }
+ },
+ textureCoordinateRotationPoints: {
+ get: function() {
+ if (!defined_default(this._textureCoordinateRotationPoints)) {
+ this._textureCoordinateRotationPoints = textureCoordinateRotationPoints(
+ this
+ );
+ }
+ return this._textureCoordinateRotationPoints;
+ }
+ }
+});
+var EllipseGeometry_default = EllipseGeometry;
+
+// Source/Core/EllipseOutlineGeometry.js
+var scratchCartesian18 = new Cartesian3_default();
+var boundingSphereCenter2 = new Cartesian3_default();
+function computeEllipse2(options) {
+ const center = options.center;
+ boundingSphereCenter2 = Cartesian3_default.multiplyByScalar(
+ options.ellipsoid.geodeticSurfaceNormal(center, boundingSphereCenter2),
+ options.height,
+ boundingSphereCenter2
+ );
+ boundingSphereCenter2 = Cartesian3_default.add(
+ center,
+ boundingSphereCenter2,
+ boundingSphereCenter2
+ );
+ const boundingSphere = new BoundingSphere_default(
+ boundingSphereCenter2,
+ options.semiMajorAxis
+ );
+ const positions = EllipseGeometryLibrary_default.computeEllipsePositions(
+ options,
+ false,
+ true
+ ).outerPositions;
+ const attributes = new GeometryAttributes_default({
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: EllipseGeometryLibrary_default.raisePositionsToHeight(
+ positions,
+ options,
+ false
+ )
+ })
+ });
+ const length3 = positions.length / 3;
+ const indices2 = IndexDatatype_default.createTypedArray(length3, length3 * 2);
+ let index = 0;
+ for (let i = 0; i < length3; ++i) {
+ indices2[index++] = i;
+ indices2[index++] = (i + 1) % length3;
+ }
+ return {
+ boundingSphere,
+ attributes,
+ indices: indices2
+ };
+}
+var topBoundingSphere3 = new BoundingSphere_default();
+var bottomBoundingSphere3 = new BoundingSphere_default();
+function computeExtrudedEllipse2(options) {
+ const center = options.center;
+ const ellipsoid = options.ellipsoid;
+ const semiMajorAxis = options.semiMajorAxis;
+ let scaledNormal = Cartesian3_default.multiplyByScalar(
+ ellipsoid.geodeticSurfaceNormal(center, scratchCartesian18),
+ options.height,
+ scratchCartesian18
+ );
+ topBoundingSphere3.center = Cartesian3_default.add(
+ center,
+ scaledNormal,
+ topBoundingSphere3.center
+ );
+ topBoundingSphere3.radius = semiMajorAxis;
+ scaledNormal = Cartesian3_default.multiplyByScalar(
+ ellipsoid.geodeticSurfaceNormal(center, scaledNormal),
+ options.extrudedHeight,
+ scaledNormal
+ );
+ bottomBoundingSphere3.center = Cartesian3_default.add(
+ center,
+ scaledNormal,
+ bottomBoundingSphere3.center
+ );
+ bottomBoundingSphere3.radius = semiMajorAxis;
+ let positions = EllipseGeometryLibrary_default.computeEllipsePositions(
+ options,
+ false,
+ true
+ ).outerPositions;
+ const attributes = new GeometryAttributes_default({
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: EllipseGeometryLibrary_default.raisePositionsToHeight(
+ positions,
+ options,
+ true
+ )
+ })
+ });
+ positions = attributes.position.values;
+ const boundingSphere = BoundingSphere_default.union(
+ topBoundingSphere3,
+ bottomBoundingSphere3
+ );
+ let length3 = positions.length / 3;
+ if (defined_default(options.offsetAttribute)) {
+ let applyOffset = new Uint8Array(length3);
+ if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ applyOffset = applyOffset.fill(1, 0, length3 / 2);
+ } else {
+ const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ applyOffset = applyOffset.fill(offsetValue);
+ }
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ let numberOfVerticalLines = defaultValue_default(options.numberOfVerticalLines, 16);
+ numberOfVerticalLines = Math_default.clamp(
+ numberOfVerticalLines,
+ 0,
+ length3 / 2
+ );
+ const indices2 = IndexDatatype_default.createTypedArray(
+ length3,
+ length3 * 2 + numberOfVerticalLines * 2
+ );
+ length3 /= 2;
+ let index = 0;
+ let i;
+ for (i = 0; i < length3; ++i) {
+ indices2[index++] = i;
+ indices2[index++] = (i + 1) % length3;
+ indices2[index++] = i + length3;
+ indices2[index++] = (i + 1) % length3 + length3;
+ }
+ let numSide;
+ if (numberOfVerticalLines > 0) {
+ const numSideLines = Math.min(numberOfVerticalLines, length3);
+ numSide = Math.round(length3 / numSideLines);
+ const maxI = Math.min(numSide * numberOfVerticalLines, length3);
+ for (i = 0; i < maxI; i += numSide) {
+ indices2[index++] = i;
+ indices2[index++] = i + length3;
+ }
+ }
+ return {
+ boundingSphere,
+ attributes,
+ indices: indices2
+ };
+}
+function EllipseOutlineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const center = options.center;
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ const semiMajorAxis = options.semiMajorAxis;
+ const semiMinorAxis = options.semiMinorAxis;
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ if (!defined_default(center)) {
+ throw new DeveloperError_default("center is required.");
+ }
+ if (!defined_default(semiMajorAxis)) {
+ throw new DeveloperError_default("semiMajorAxis is required.");
+ }
+ if (!defined_default(semiMinorAxis)) {
+ throw new DeveloperError_default("semiMinorAxis is required.");
+ }
+ if (semiMajorAxis < semiMinorAxis) {
+ throw new DeveloperError_default(
+ "semiMajorAxis must be greater than or equal to the semiMinorAxis."
+ );
+ }
+ if (granularity <= 0) {
+ throw new DeveloperError_default("granularity must be greater than zero.");
+ }
+ const height = defaultValue_default(options.height, 0);
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
+ this._center = Cartesian3_default.clone(center);
+ this._semiMajorAxis = semiMajorAxis;
+ this._semiMinorAxis = semiMinorAxis;
+ this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
+ this._rotation = defaultValue_default(options.rotation, 0);
+ this._height = Math.max(extrudedHeight, height);
+ this._granularity = granularity;
+ this._extrudedHeight = Math.min(extrudedHeight, height);
+ this._numberOfVerticalLines = Math.max(
+ defaultValue_default(options.numberOfVerticalLines, 16),
+ 0
+ );
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createEllipseOutlineGeometry";
+}
+EllipseOutlineGeometry.packedLength = Cartesian3_default.packedLength + Ellipsoid_default.packedLength + 8;
+EllipseOutlineGeometry.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ Cartesian3_default.pack(value._center, array, startingIndex);
+ startingIndex += Cartesian3_default.packedLength;
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ array[startingIndex++] = value._semiMajorAxis;
+ array[startingIndex++] = value._semiMinorAxis;
+ array[startingIndex++] = value._rotation;
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._numberOfVerticalLines;
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchCenter7 = new Cartesian3_default();
+var scratchEllipsoid5 = new Ellipsoid_default();
+var scratchOptions12 = {
+ center: scratchCenter7,
+ ellipsoid: scratchEllipsoid5,
+ semiMajorAxis: void 0,
+ semiMinorAxis: void 0,
+ rotation: void 0,
+ height: void 0,
+ granularity: void 0,
+ extrudedHeight: void 0,
+ numberOfVerticalLines: void 0,
+ offsetAttribute: void 0
+};
+EllipseOutlineGeometry.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const center = Cartesian3_default.unpack(array, startingIndex, scratchCenter7);
+ startingIndex += Cartesian3_default.packedLength;
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid5);
+ startingIndex += Ellipsoid_default.packedLength;
+ const semiMajorAxis = array[startingIndex++];
+ const semiMinorAxis = array[startingIndex++];
+ const rotation = array[startingIndex++];
+ const height = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const numberOfVerticalLines = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions12.height = height;
+ scratchOptions12.extrudedHeight = extrudedHeight;
+ scratchOptions12.granularity = granularity;
+ scratchOptions12.rotation = rotation;
+ scratchOptions12.semiMajorAxis = semiMajorAxis;
+ scratchOptions12.semiMinorAxis = semiMinorAxis;
+ scratchOptions12.numberOfVerticalLines = numberOfVerticalLines;
+ scratchOptions12.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new EllipseOutlineGeometry(scratchOptions12);
+ }
+ result._center = Cartesian3_default.clone(center, result._center);
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._semiMajorAxis = semiMajorAxis;
+ result._semiMinorAxis = semiMinorAxis;
+ result._rotation = rotation;
+ result._height = height;
+ result._granularity = granularity;
+ result._extrudedHeight = extrudedHeight;
+ result._numberOfVerticalLines = numberOfVerticalLines;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+EllipseOutlineGeometry.createGeometry = function(ellipseGeometry) {
+ if (ellipseGeometry._semiMajorAxis <= 0 || ellipseGeometry._semiMinorAxis <= 0) {
+ return;
+ }
+ const height = ellipseGeometry._height;
+ const extrudedHeight = ellipseGeometry._extrudedHeight;
+ const extrude = !Math_default.equalsEpsilon(
+ height,
+ extrudedHeight,
+ 0,
+ Math_default.EPSILON2
+ );
+ ellipseGeometry._center = ellipseGeometry._ellipsoid.scaleToGeodeticSurface(
+ ellipseGeometry._center,
+ ellipseGeometry._center
+ );
+ const options = {
+ center: ellipseGeometry._center,
+ semiMajorAxis: ellipseGeometry._semiMajorAxis,
+ semiMinorAxis: ellipseGeometry._semiMinorAxis,
+ ellipsoid: ellipseGeometry._ellipsoid,
+ rotation: ellipseGeometry._rotation,
+ height,
+ granularity: ellipseGeometry._granularity,
+ numberOfVerticalLines: ellipseGeometry._numberOfVerticalLines
+ };
+ let geometry;
+ if (extrude) {
+ options.extrudedHeight = extrudedHeight;
+ options.offsetAttribute = ellipseGeometry._offsetAttribute;
+ geometry = computeExtrudedEllipse2(options);
+ } else {
+ geometry = computeEllipse2(options);
+ if (defined_default(ellipseGeometry._offsetAttribute)) {
+ const length3 = geometry.attributes.position.values.length;
+ const offsetValue = ellipseGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ }
+ return new Geometry_default({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: PrimitiveType_default.LINES,
+ boundingSphere: geometry.boundingSphere,
+ offsetAttribute: ellipseGeometry._offsetAttribute
+ });
+};
+var EllipseOutlineGeometry_default = EllipseOutlineGeometry;
+
+// Source/DataSources/EllipseGeometryUpdater.js
+var scratchColor13 = new Color_default();
+var defaultOffset5 = Cartesian3_default.ZERO;
+var offsetScratch7 = new Cartesian3_default();
+var scratchRectangle5 = new Rectangle_default();
+function EllipseGeometryOptions(entity) {
+ this.id = entity;
+ this.vertexFormat = void 0;
+ this.center = void 0;
+ this.semiMajorAxis = void 0;
+ this.semiMinorAxis = void 0;
+ this.rotation = void 0;
+ this.height = void 0;
+ this.extrudedHeight = void 0;
+ this.granularity = void 0;
+ this.stRotation = void 0;
+ this.numberOfVerticalLines = void 0;
+ this.offsetAttribute = void 0;
+}
+function EllipseGeometryUpdater(entity, scene) {
+ GroundGeometryUpdater_default.call(this, {
+ entity,
+ scene,
+ geometryOptions: new EllipseGeometryOptions(entity),
+ geometryPropertyName: "ellipse",
+ observedPropertyNames: ["availability", "position", "ellipse"]
+ });
+ this._onEntityPropertyChanged(entity, "ellipse", entity.ellipse, void 0);
+}
+if (defined_default(Object.create)) {
+ EllipseGeometryUpdater.prototype = Object.create(
+ GroundGeometryUpdater_default.prototype
+ );
+ EllipseGeometryUpdater.prototype.constructor = EllipseGeometryUpdater;
+}
+EllipseGeometryUpdater.prototype.createFillGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._fillEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent a filled geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time)
+ ),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ this._distanceDisplayConditionProperty.getValue(time)
+ ),
+ offset: void 0,
+ color: void 0
+ };
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ let currentColor;
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor13);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ attributes.color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ }
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset5,
+ offsetScratch7
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new EllipseGeometry_default(this._options),
+ attributes
+ });
+};
+EllipseGeometryUpdater.prototype.createOutlineGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._outlineEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent an outlined geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const outlineColor = Property_default.getValueOrDefault(
+ this._outlineColorProperty,
+ time,
+ Color_default.BLACK,
+ scratchColor13
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)
+ ),
+ color: ColorGeometryInstanceAttribute_default.fromColor(outlineColor),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ ),
+ offset: void 0
+ };
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset5,
+ offsetScratch7
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new EllipseOutlineGeometry_default(this._options),
+ attributes
+ });
+};
+EllipseGeometryUpdater.prototype._computeCenter = function(time, result) {
+ return Property_default.getValueOrUndefined(this._entity.position, time, result);
+};
+EllipseGeometryUpdater.prototype._isHidden = function(entity, ellipse) {
+ const position = entity.position;
+ return !defined_default(position) || !defined_default(ellipse.semiMajorAxis) || !defined_default(ellipse.semiMinorAxis) || GeometryUpdater_default.prototype._isHidden.call(this, entity, ellipse);
+};
+EllipseGeometryUpdater.prototype._isDynamic = function(entity, ellipse) {
+ return !entity.position.isConstant || !ellipse.semiMajorAxis.isConstant || !ellipse.semiMinorAxis.isConstant || !Property_default.isConstant(ellipse.rotation) || !Property_default.isConstant(ellipse.height) || !Property_default.isConstant(ellipse.extrudedHeight) || !Property_default.isConstant(ellipse.granularity) || !Property_default.isConstant(ellipse.stRotation) || !Property_default.isConstant(ellipse.outlineWidth) || !Property_default.isConstant(ellipse.numberOfVerticalLines) || !Property_default.isConstant(ellipse.zIndex) || this._onTerrain && !Property_default.isConstant(this._materialProperty) && !(this._materialProperty instanceof ColorMaterialProperty_default);
+};
+EllipseGeometryUpdater.prototype._setStaticOptions = function(entity, ellipse) {
+ let heightValue = Property_default.getValueOrUndefined(
+ ellipse.height,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ const heightReferenceValue = Property_default.getValueOrDefault(
+ ellipse.heightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ let extrudedHeightValue = Property_default.getValueOrUndefined(
+ ellipse.extrudedHeight,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ const extrudedHeightReferenceValue = Property_default.getValueOrDefault(
+ ellipse.extrudedHeightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ if (defined_default(extrudedHeightValue) && !defined_default(heightValue)) {
+ heightValue = 0;
+ }
+ const options = this._options;
+ options.vertexFormat = this._materialProperty instanceof ColorMaterialProperty_default ? PerInstanceColorAppearance_default.VERTEX_FORMAT : MaterialAppearance_default.MaterialSupport.TEXTURED.vertexFormat;
+ options.center = entity.position.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.center
+ );
+ options.semiMajorAxis = ellipse.semiMajorAxis.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.semiMajorAxis
+ );
+ options.semiMinorAxis = ellipse.semiMinorAxis.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.semiMinorAxis
+ );
+ options.rotation = Property_default.getValueOrUndefined(
+ ellipse.rotation,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.granularity = Property_default.getValueOrUndefined(
+ ellipse.granularity,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.stRotation = Property_default.getValueOrUndefined(
+ ellipse.stRotation,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.numberOfVerticalLines = Property_default.getValueOrUndefined(
+ ellipse.numberOfVerticalLines,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.offsetAttribute = GroundGeometryUpdater_default.computeGeometryOffsetAttribute(
+ heightValue,
+ heightReferenceValue,
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ options.height = GroundGeometryUpdater_default.getGeometryHeight(
+ heightValue,
+ heightReferenceValue
+ );
+ extrudedHeightValue = GroundGeometryUpdater_default.getGeometryExtrudedHeight(
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ if (extrudedHeightValue === GroundGeometryUpdater_default.CLAMP_TO_GROUND) {
+ extrudedHeightValue = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ EllipseGeometry_default.computeRectangle(options, scratchRectangle5)
+ ).minimumTerrainHeight;
+ }
+ options.extrudedHeight = extrudedHeightValue;
+};
+EllipseGeometryUpdater.DynamicGeometryUpdater = DynamicEllipseGeometryUpdater;
+function DynamicEllipseGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
+ DynamicGeometryUpdater_default.call(
+ this,
+ geometryUpdater,
+ primitives,
+ groundPrimitives
+ );
+}
+if (defined_default(Object.create)) {
+ DynamicEllipseGeometryUpdater.prototype = Object.create(
+ DynamicGeometryUpdater_default.prototype
+ );
+ DynamicEllipseGeometryUpdater.prototype.constructor = DynamicEllipseGeometryUpdater;
+}
+DynamicEllipseGeometryUpdater.prototype._isHidden = function(entity, ellipse, time) {
+ const options = this._options;
+ return !defined_default(options.center) || !defined_default(options.semiMajorAxis) || !defined_default(options.semiMinorAxis) || DynamicGeometryUpdater_default.prototype._isHidden.call(this, entity, ellipse, time);
+};
+DynamicEllipseGeometryUpdater.prototype._setOptions = function(entity, ellipse, time) {
+ const options = this._options;
+ let heightValue = Property_default.getValueOrUndefined(ellipse.height, time);
+ const heightReferenceValue = Property_default.getValueOrDefault(
+ ellipse.heightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ let extrudedHeightValue = Property_default.getValueOrUndefined(
+ ellipse.extrudedHeight,
+ time
+ );
+ const extrudedHeightReferenceValue = Property_default.getValueOrDefault(
+ ellipse.extrudedHeightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ if (defined_default(extrudedHeightValue) && !defined_default(heightValue)) {
+ heightValue = 0;
+ }
+ options.center = Property_default.getValueOrUndefined(
+ entity.position,
+ time,
+ options.center
+ );
+ options.semiMajorAxis = Property_default.getValueOrUndefined(
+ ellipse.semiMajorAxis,
+ time
+ );
+ options.semiMinorAxis = Property_default.getValueOrUndefined(
+ ellipse.semiMinorAxis,
+ time
+ );
+ options.rotation = Property_default.getValueOrUndefined(ellipse.rotation, time);
+ options.granularity = Property_default.getValueOrUndefined(ellipse.granularity, time);
+ options.stRotation = Property_default.getValueOrUndefined(ellipse.stRotation, time);
+ options.numberOfVerticalLines = Property_default.getValueOrUndefined(
+ ellipse.numberOfVerticalLines,
+ time
+ );
+ options.offsetAttribute = GroundGeometryUpdater_default.computeGeometryOffsetAttribute(
+ heightValue,
+ heightReferenceValue,
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ options.height = GroundGeometryUpdater_default.getGeometryHeight(
+ heightValue,
+ heightReferenceValue
+ );
+ extrudedHeightValue = GroundGeometryUpdater_default.getGeometryExtrudedHeight(
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ if (extrudedHeightValue === GroundGeometryUpdater_default.CLAMP_TO_GROUND) {
+ extrudedHeightValue = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ EllipseGeometry_default.computeRectangle(options, scratchRectangle5)
+ ).minimumTerrainHeight;
+ }
+ options.extrudedHeight = extrudedHeightValue;
+};
+var EllipseGeometryUpdater_default = EllipseGeometryUpdater;
+
+// Source/Core/EllipsoidGeometry.js
+var scratchPosition8 = new Cartesian3_default();
+var scratchNormal4 = new Cartesian3_default();
+var scratchTangent2 = new Cartesian3_default();
+var scratchBitangent2 = new Cartesian3_default();
+var scratchNormalST = new Cartesian3_default();
+var defaultRadii2 = new Cartesian3_default(1, 1, 1);
+var cos3 = Math.cos;
+var sin3 = Math.sin;
+function EllipsoidGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const radii = defaultValue_default(options.radii, defaultRadii2);
+ const innerRadii = defaultValue_default(options.innerRadii, radii);
+ const minimumClock = defaultValue_default(options.minimumClock, 0);
+ const maximumClock = defaultValue_default(options.maximumClock, Math_default.TWO_PI);
+ const minimumCone = defaultValue_default(options.minimumCone, 0);
+ const maximumCone = defaultValue_default(options.maximumCone, Math_default.PI);
+ const stackPartitions = Math.round(defaultValue_default(options.stackPartitions, 64));
+ const slicePartitions = Math.round(defaultValue_default(options.slicePartitions, 64));
+ const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
+ if (slicePartitions < 3) {
+ throw new DeveloperError_default(
+ "options.slicePartitions cannot be less than three."
+ );
+ }
+ if (stackPartitions < 3) {
+ throw new DeveloperError_default(
+ "options.stackPartitions cannot be less than three."
+ );
+ }
+ this._radii = Cartesian3_default.clone(radii);
+ this._innerRadii = Cartesian3_default.clone(innerRadii);
+ this._minimumClock = minimumClock;
+ this._maximumClock = maximumClock;
+ this._minimumCone = minimumCone;
+ this._maximumCone = maximumCone;
+ this._stackPartitions = stackPartitions;
+ this._slicePartitions = slicePartitions;
+ this._vertexFormat = VertexFormat_default.clone(vertexFormat);
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createEllipsoidGeometry";
+}
+EllipsoidGeometry.packedLength = 2 * Cartesian3_default.packedLength + VertexFormat_default.packedLength + 7;
+EllipsoidGeometry.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ Cartesian3_default.pack(value._radii, array, startingIndex);
+ startingIndex += Cartesian3_default.packedLength;
+ Cartesian3_default.pack(value._innerRadii, array, startingIndex);
+ startingIndex += Cartesian3_default.packedLength;
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat_default.packedLength;
+ array[startingIndex++] = value._minimumClock;
+ array[startingIndex++] = value._maximumClock;
+ array[startingIndex++] = value._minimumCone;
+ array[startingIndex++] = value._maximumCone;
+ array[startingIndex++] = value._stackPartitions;
+ array[startingIndex++] = value._slicePartitions;
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchRadii2 = new Cartesian3_default();
+var scratchInnerRadii2 = new Cartesian3_default();
+var scratchVertexFormat5 = new VertexFormat_default();
+var scratchOptions13 = {
+ radii: scratchRadii2,
+ innerRadii: scratchInnerRadii2,
+ vertexFormat: scratchVertexFormat5,
+ minimumClock: void 0,
+ maximumClock: void 0,
+ minimumCone: void 0,
+ maximumCone: void 0,
+ stackPartitions: void 0,
+ slicePartitions: void 0,
+ offsetAttribute: void 0
+};
+EllipsoidGeometry.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const radii = Cartesian3_default.unpack(array, startingIndex, scratchRadii2);
+ startingIndex += Cartesian3_default.packedLength;
+ const innerRadii = Cartesian3_default.unpack(array, startingIndex, scratchInnerRadii2);
+ startingIndex += Cartesian3_default.packedLength;
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat5
+ );
+ startingIndex += VertexFormat_default.packedLength;
+ const minimumClock = array[startingIndex++];
+ const maximumClock = array[startingIndex++];
+ const minimumCone = array[startingIndex++];
+ const maximumCone = array[startingIndex++];
+ const stackPartitions = array[startingIndex++];
+ const slicePartitions = array[startingIndex++];
+ const offsetAttribute = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions13.minimumClock = minimumClock;
+ scratchOptions13.maximumClock = maximumClock;
+ scratchOptions13.minimumCone = minimumCone;
+ scratchOptions13.maximumCone = maximumCone;
+ scratchOptions13.stackPartitions = stackPartitions;
+ scratchOptions13.slicePartitions = slicePartitions;
+ scratchOptions13.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new EllipsoidGeometry(scratchOptions13);
+ }
+ result._radii = Cartesian3_default.clone(radii, result._radii);
+ result._innerRadii = Cartesian3_default.clone(innerRadii, result._innerRadii);
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._minimumClock = minimumClock;
+ result._maximumClock = maximumClock;
+ result._minimumCone = minimumCone;
+ result._maximumCone = maximumCone;
+ result._stackPartitions = stackPartitions;
+ result._slicePartitions = slicePartitions;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+EllipsoidGeometry.createGeometry = function(ellipsoidGeometry) {
+ const radii = ellipsoidGeometry._radii;
+ if (radii.x <= 0 || radii.y <= 0 || radii.z <= 0) {
+ return;
+ }
+ const innerRadii = ellipsoidGeometry._innerRadii;
+ if (innerRadii.x <= 0 || innerRadii.y <= 0 || innerRadii.z <= 0) {
+ return;
+ }
+ const minimumClock = ellipsoidGeometry._minimumClock;
+ const maximumClock = ellipsoidGeometry._maximumClock;
+ const minimumCone = ellipsoidGeometry._minimumCone;
+ const maximumCone = ellipsoidGeometry._maximumCone;
+ const vertexFormat = ellipsoidGeometry._vertexFormat;
+ let slicePartitions = ellipsoidGeometry._slicePartitions + 1;
+ let stackPartitions = ellipsoidGeometry._stackPartitions + 1;
+ slicePartitions = Math.round(
+ slicePartitions * Math.abs(maximumClock - minimumClock) / Math_default.TWO_PI
+ );
+ stackPartitions = Math.round(
+ stackPartitions * Math.abs(maximumCone - minimumCone) / Math_default.PI
+ );
+ if (slicePartitions < 2) {
+ slicePartitions = 2;
+ }
+ if (stackPartitions < 2) {
+ stackPartitions = 2;
+ }
+ let i;
+ let j;
+ let index = 0;
+ const phis = [minimumCone];
+ const thetas = [minimumClock];
+ for (i = 0; i < stackPartitions; i++) {
+ phis.push(
+ minimumCone + i * (maximumCone - minimumCone) / (stackPartitions - 1)
+ );
+ }
+ phis.push(maximumCone);
+ for (j = 0; j < slicePartitions; j++) {
+ thetas.push(
+ minimumClock + j * (maximumClock - minimumClock) / (slicePartitions - 1)
+ );
+ }
+ thetas.push(maximumClock);
+ const numPhis = phis.length;
+ const numThetas = thetas.length;
+ let extraIndices = 0;
+ let vertexMultiplier = 1;
+ const hasInnerSurface = innerRadii.x !== radii.x || innerRadii.y !== radii.y || innerRadii.z !== radii.z;
+ let isTopOpen = false;
+ let isBotOpen = false;
+ let isClockOpen = false;
+ if (hasInnerSurface) {
+ vertexMultiplier = 2;
+ if (minimumCone > 0) {
+ isTopOpen = true;
+ extraIndices += slicePartitions - 1;
+ }
+ if (maximumCone < Math.PI) {
+ isBotOpen = true;
+ extraIndices += slicePartitions - 1;
+ }
+ if ((maximumClock - minimumClock) % Math_default.TWO_PI) {
+ isClockOpen = true;
+ extraIndices += (stackPartitions - 1) * 2 + 1;
+ } else {
+ extraIndices += 1;
+ }
+ }
+ const vertexCount = numThetas * numPhis * vertexMultiplier;
+ const positions = new Float64Array(vertexCount * 3);
+ const isInner = new Array(vertexCount).fill(false);
+ const negateNormal = new Array(vertexCount).fill(false);
+ const indexCount = slicePartitions * stackPartitions * vertexMultiplier;
+ const numIndices = 6 * (indexCount + extraIndices + 1 - (slicePartitions + stackPartitions) * vertexMultiplier);
+ const indices2 = IndexDatatype_default.createTypedArray(indexCount, numIndices);
+ const normals = vertexFormat.normal ? new Float32Array(vertexCount * 3) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(vertexCount * 3) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(vertexCount * 3) : void 0;
+ const st = vertexFormat.st ? new Float32Array(vertexCount * 2) : void 0;
+ const sinPhi = new Array(numPhis);
+ const cosPhi = new Array(numPhis);
+ for (i = 0; i < numPhis; i++) {
+ sinPhi[i] = sin3(phis[i]);
+ cosPhi[i] = cos3(phis[i]);
+ }
+ const sinTheta = new Array(numThetas);
+ const cosTheta = new Array(numThetas);
+ for (j = 0; j < numThetas; j++) {
+ cosTheta[j] = cos3(thetas[j]);
+ sinTheta[j] = sin3(thetas[j]);
+ }
+ for (i = 0; i < numPhis; i++) {
+ for (j = 0; j < numThetas; j++) {
+ positions[index++] = radii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = radii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = radii.z * cosPhi[i];
+ }
+ }
+ let vertexIndex = vertexCount / 2;
+ if (hasInnerSurface) {
+ for (i = 0; i < numPhis; i++) {
+ for (j = 0; j < numThetas; j++) {
+ positions[index++] = innerRadii.x * sinPhi[i] * cosTheta[j];
+ positions[index++] = innerRadii.y * sinPhi[i] * sinTheta[j];
+ positions[index++] = innerRadii.z * cosPhi[i];
+ isInner[vertexIndex] = true;
+ if (i > 0 && i !== numPhis - 1 && j !== 0 && j !== numThetas - 1) {
+ negateNormal[vertexIndex] = true;
+ }
+ vertexIndex++;
+ }
+ }
+ }
+ index = 0;
+ let topOffset;
+ let bottomOffset;
+ for (i = 1; i < numPhis - 2; i++) {
+ topOffset = i * numThetas;
+ bottomOffset = (i + 1) * numThetas;
+ for (j = 1; j < numThetas - 2; j++) {
+ indices2[index++] = bottomOffset + j;
+ indices2[index++] = bottomOffset + j + 1;
+ indices2[index++] = topOffset + j + 1;
+ indices2[index++] = bottomOffset + j;
+ indices2[index++] = topOffset + j + 1;
+ indices2[index++] = topOffset + j;
+ }
+ }
+ if (hasInnerSurface) {
+ const offset2 = numPhis * numThetas;
+ for (i = 1; i < numPhis - 2; i++) {
+ topOffset = offset2 + i * numThetas;
+ bottomOffset = offset2 + (i + 1) * numThetas;
+ for (j = 1; j < numThetas - 2; j++) {
+ indices2[index++] = bottomOffset + j;
+ indices2[index++] = topOffset + j;
+ indices2[index++] = topOffset + j + 1;
+ indices2[index++] = bottomOffset + j;
+ indices2[index++] = topOffset + j + 1;
+ indices2[index++] = bottomOffset + j + 1;
+ }
+ }
+ }
+ let outerOffset;
+ let innerOffset;
+ if (hasInnerSurface) {
+ if (isTopOpen) {
+ innerOffset = numPhis * numThetas;
+ for (i = 1; i < numThetas - 2; i++) {
+ indices2[index++] = i;
+ indices2[index++] = i + 1;
+ indices2[index++] = innerOffset + i + 1;
+ indices2[index++] = i;
+ indices2[index++] = innerOffset + i + 1;
+ indices2[index++] = innerOffset + i;
+ }
+ }
+ if (isBotOpen) {
+ outerOffset = numPhis * numThetas - numThetas;
+ innerOffset = numPhis * numThetas * vertexMultiplier - numThetas;
+ for (i = 1; i < numThetas - 2; i++) {
+ indices2[index++] = outerOffset + i + 1;
+ indices2[index++] = outerOffset + i;
+ indices2[index++] = innerOffset + i;
+ indices2[index++] = outerOffset + i + 1;
+ indices2[index++] = innerOffset + i;
+ indices2[index++] = innerOffset + i + 1;
+ }
+ }
+ }
+ if (isClockOpen) {
+ for (i = 1; i < numPhis - 2; i++) {
+ innerOffset = numThetas * numPhis + numThetas * i;
+ outerOffset = numThetas * i;
+ indices2[index++] = innerOffset;
+ indices2[index++] = outerOffset + numThetas;
+ indices2[index++] = outerOffset;
+ indices2[index++] = innerOffset;
+ indices2[index++] = innerOffset + numThetas;
+ indices2[index++] = outerOffset + numThetas;
+ }
+ for (i = 1; i < numPhis - 2; i++) {
+ innerOffset = numThetas * numPhis + numThetas * (i + 1) - 1;
+ outerOffset = numThetas * (i + 1) - 1;
+ indices2[index++] = outerOffset + numThetas;
+ indices2[index++] = innerOffset;
+ indices2[index++] = outerOffset;
+ indices2[index++] = outerOffset + numThetas;
+ indices2[index++] = innerOffset + numThetas;
+ indices2[index++] = innerOffset;
+ }
+ }
+ const attributes = new GeometryAttributes_default();
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ }
+ let stIndex = 0;
+ let normalIndex = 0;
+ let tangentIndex = 0;
+ let bitangentIndex = 0;
+ const vertexCountHalf = vertexCount / 2;
+ let ellipsoid;
+ const ellipsoidOuter = Ellipsoid_default.fromCartesian3(radii);
+ const ellipsoidInner = Ellipsoid_default.fromCartesian3(innerRadii);
+ if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
+ for (i = 0; i < vertexCount; i++) {
+ ellipsoid = isInner[i] ? ellipsoidInner : ellipsoidOuter;
+ const position = Cartesian3_default.fromArray(positions, i * 3, scratchPosition8);
+ const normal2 = ellipsoid.geodeticSurfaceNormal(position, scratchNormal4);
+ if (negateNormal[i]) {
+ Cartesian3_default.negate(normal2, normal2);
+ }
+ if (vertexFormat.st) {
+ const normalST = Cartesian2_default.negate(normal2, scratchNormalST);
+ st[stIndex++] = Math.atan2(normalST.y, normalST.x) / Math_default.TWO_PI + 0.5;
+ st[stIndex++] = Math.asin(normal2.z) / Math.PI + 0.5;
+ }
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = normal2.x;
+ normals[normalIndex++] = normal2.y;
+ normals[normalIndex++] = normal2.z;
+ }
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ const tangent = scratchTangent2;
+ let tangetOffset = 0;
+ let unit;
+ if (isInner[i]) {
+ tangetOffset = vertexCountHalf;
+ }
+ if (!isTopOpen && i >= tangetOffset && i < tangetOffset + numThetas * 2) {
+ unit = Cartesian3_default.UNIT_X;
+ } else {
+ unit = Cartesian3_default.UNIT_Z;
+ }
+ Cartesian3_default.cross(unit, normal2, tangent);
+ Cartesian3_default.normalize(tangent, tangent);
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ }
+ if (vertexFormat.bitangent) {
+ const bitangent = Cartesian3_default.cross(normal2, tangent, scratchBitangent2);
+ Cartesian3_default.normalize(bitangent, bitangent);
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ }
+ }
+ }
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: st
+ });
+ }
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals
+ });
+ }
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents
+ });
+ }
+ }
+ if (defined_default(ellipsoidGeometry._offsetAttribute)) {
+ const length3 = positions.length;
+ const offsetValue = ellipsoidGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.TRIANGLES,
+ boundingSphere: BoundingSphere_default.fromEllipsoid(ellipsoidOuter),
+ offsetAttribute: ellipsoidGeometry._offsetAttribute
+ });
+};
+var unitEllipsoidGeometry;
+EllipsoidGeometry.getUnitEllipsoid = function() {
+ if (!defined_default(unitEllipsoidGeometry)) {
+ unitEllipsoidGeometry = EllipsoidGeometry.createGeometry(
+ new EllipsoidGeometry({
+ radii: new Cartesian3_default(1, 1, 1),
+ vertexFormat: VertexFormat_default.POSITION_ONLY
+ })
+ );
+ }
+ return unitEllipsoidGeometry;
+};
+var EllipsoidGeometry_default = EllipsoidGeometry;
+
+// Source/DataSources/EllipsoidGeometryUpdater.js
+var defaultMaterial2 = new ColorMaterialProperty_default(Color_default.WHITE);
+var defaultOffset6 = Cartesian3_default.ZERO;
+var offsetScratch8 = new Cartesian3_default();
+var radiiScratch = new Cartesian3_default();
+var innerRadiiScratch = new Cartesian3_default();
+var scratchColor14 = new Color_default();
+var unitSphere = new Cartesian3_default(1, 1, 1);
+function EllipsoidGeometryOptions(entity) {
+ this.id = entity;
+ this.vertexFormat = void 0;
+ this.radii = void 0;
+ this.innerRadii = void 0;
+ this.minimumClock = void 0;
+ this.maximumClock = void 0;
+ this.minimumCone = void 0;
+ this.maximumCone = void 0;
+ this.stackPartitions = void 0;
+ this.slicePartitions = void 0;
+ this.subdivisions = void 0;
+ this.offsetAttribute = void 0;
+}
+function EllipsoidGeometryUpdater(entity, scene) {
+ GeometryUpdater_default.call(this, {
+ entity,
+ scene,
+ geometryOptions: new EllipsoidGeometryOptions(entity),
+ geometryPropertyName: "ellipsoid",
+ observedPropertyNames: [
+ "availability",
+ "position",
+ "orientation",
+ "ellipsoid"
+ ]
+ });
+ this._onEntityPropertyChanged(
+ entity,
+ "ellipsoid",
+ entity.ellipsoid,
+ void 0
+ );
+}
+if (defined_default(Object.create)) {
+ EllipsoidGeometryUpdater.prototype = Object.create(GeometryUpdater_default.prototype);
+ EllipsoidGeometryUpdater.prototype.constructor = EllipsoidGeometryUpdater;
+}
+Object.defineProperties(EllipsoidGeometryUpdater.prototype, {
+ terrainOffsetProperty: {
+ get: function() {
+ return this._terrainOffsetProperty;
+ }
+ }
+});
+EllipsoidGeometryUpdater.prototype.createFillGeometryInstance = function(time, skipModelMatrix, modelMatrixResult) {
+ Check_default.defined("time", time);
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ let color;
+ const show = new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time)
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ );
+ const attributes = {
+ show,
+ distanceDisplayCondition: distanceDisplayConditionAttribute,
+ color: void 0,
+ offset: void 0
+ };
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ let currentColor;
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor14);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ attributes.color = color;
+ }
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset6,
+ offsetScratch8
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new EllipsoidGeometry_default(this._options),
+ modelMatrix: skipModelMatrix ? void 0 : entity.computeModelMatrixForHeightReference(
+ time,
+ entity.ellipsoid.heightReference,
+ this._options.radii.z * 0.5,
+ this._scene.mapProjection.ellipsoid,
+ modelMatrixResult
+ ),
+ attributes
+ });
+};
+EllipsoidGeometryUpdater.prototype.createOutlineGeometryInstance = function(time, skipModelMatrix, modelMatrixResult) {
+ Check_default.defined("time", time);
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const outlineColor = Property_default.getValueOrDefault(
+ this._outlineColorProperty,
+ time,
+ Color_default.BLACK,
+ scratchColor14
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)
+ ),
+ color: ColorGeometryInstanceAttribute_default.fromColor(outlineColor),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ ),
+ offset: void 0
+ };
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset6,
+ offsetScratch8
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new EllipsoidOutlineGeometry_default(this._options),
+ modelMatrix: skipModelMatrix ? void 0 : entity.computeModelMatrixForHeightReference(
+ time,
+ entity.ellipsoid.heightReference,
+ this._options.radii.z * 0.5,
+ this._scene.mapProjection.ellipsoid,
+ modelMatrixResult
+ ),
+ attributes
+ });
+};
+EllipsoidGeometryUpdater.prototype._computeCenter = function(time, result) {
+ return Property_default.getValueOrUndefined(this._entity.position, time, result);
+};
+EllipsoidGeometryUpdater.prototype._isHidden = function(entity, ellipsoid) {
+ return !defined_default(entity.position) || !defined_default(ellipsoid.radii) || GeometryUpdater_default.prototype._isHidden.call(this, entity, ellipsoid);
+};
+EllipsoidGeometryUpdater.prototype._isDynamic = function(entity, ellipsoid) {
+ return !entity.position.isConstant || !Property_default.isConstant(entity.orientation) || !ellipsoid.radii.isConstant || !Property_default.isConstant(ellipsoid.innerRadii) || !Property_default.isConstant(ellipsoid.stackPartitions) || !Property_default.isConstant(ellipsoid.slicePartitions) || !Property_default.isConstant(ellipsoid.outlineWidth) || !Property_default.isConstant(ellipsoid.minimumClock) || !Property_default.isConstant(ellipsoid.maximumClock) || !Property_default.isConstant(ellipsoid.minimumCone) || !Property_default.isConstant(ellipsoid.maximumCone) || !Property_default.isConstant(ellipsoid.subdivisions);
+};
+EllipsoidGeometryUpdater.prototype._setStaticOptions = function(entity, ellipsoid) {
+ const heightReference = Property_default.getValueOrDefault(
+ ellipsoid.heightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ const options = this._options;
+ options.vertexFormat = this._materialProperty instanceof ColorMaterialProperty_default ? PerInstanceColorAppearance_default.VERTEX_FORMAT : MaterialAppearance_default.MaterialSupport.TEXTURED.vertexFormat;
+ options.radii = ellipsoid.radii.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.radii
+ );
+ options.innerRadii = Property_default.getValueOrUndefined(
+ ellipsoid.innerRadii,
+ options.radii
+ );
+ options.minimumClock = Property_default.getValueOrUndefined(
+ ellipsoid.minimumClock,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.maximumClock = Property_default.getValueOrUndefined(
+ ellipsoid.maximumClock,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.minimumCone = Property_default.getValueOrUndefined(
+ ellipsoid.minimumCone,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.maximumCone = Property_default.getValueOrUndefined(
+ ellipsoid.maximumCone,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.stackPartitions = Property_default.getValueOrUndefined(
+ ellipsoid.stackPartitions,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.slicePartitions = Property_default.getValueOrUndefined(
+ ellipsoid.slicePartitions,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.subdivisions = Property_default.getValueOrUndefined(
+ ellipsoid.subdivisions,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.offsetAttribute = heightReference !== HeightReference_default.NONE ? GeometryOffsetAttribute_default.ALL : void 0;
+};
+EllipsoidGeometryUpdater.prototype._onEntityPropertyChanged = heightReferenceOnEntityPropertyChanged_default;
+EllipsoidGeometryUpdater.DynamicGeometryUpdater = DynamicEllipsoidGeometryUpdater;
+function DynamicEllipsoidGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
+ DynamicGeometryUpdater_default.call(
+ this,
+ geometryUpdater,
+ primitives,
+ groundPrimitives
+ );
+ this._scene = geometryUpdater._scene;
+ this._modelMatrix = new Matrix4_default();
+ this._attributes = void 0;
+ this._outlineAttributes = void 0;
+ this._lastSceneMode = void 0;
+ this._lastShow = void 0;
+ this._lastOutlineShow = void 0;
+ this._lastOutlineWidth = void 0;
+ this._lastOutlineColor = void 0;
+ this._lastOffset = new Cartesian3_default();
+ this._material = {};
+}
+if (defined_default(Object.create)) {
+ DynamicEllipsoidGeometryUpdater.prototype = Object.create(
+ DynamicGeometryUpdater_default.prototype
+ );
+ DynamicEllipsoidGeometryUpdater.prototype.constructor = DynamicEllipsoidGeometryUpdater;
+}
+DynamicEllipsoidGeometryUpdater.prototype.update = function(time) {
+ Check_default.defined("time", time);
+ const entity = this._entity;
+ const ellipsoid = entity.ellipsoid;
+ if (!entity.isShowing || !entity.isAvailable(time) || !Property_default.getValueOrDefault(ellipsoid.show, time, true)) {
+ if (defined_default(this._primitive)) {
+ this._primitive.show = false;
+ }
+ if (defined_default(this._outlinePrimitive)) {
+ this._outlinePrimitive.show = false;
+ }
+ return;
+ }
+ const radii = Property_default.getValueOrUndefined(
+ ellipsoid.radii,
+ time,
+ radiiScratch
+ );
+ let modelMatrix = defined_default(radii) ? entity.computeModelMatrixForHeightReference(
+ time,
+ ellipsoid.heightReference,
+ radii.z * 0.5,
+ this._scene.mapProjection.ellipsoid,
+ this._modelMatrix
+ ) : void 0;
+ if (!defined_default(modelMatrix) || !defined_default(radii)) {
+ if (defined_default(this._primitive)) {
+ this._primitive.show = false;
+ }
+ if (defined_default(this._outlinePrimitive)) {
+ this._outlinePrimitive.show = false;
+ }
+ return;
+ }
+ const showFill = Property_default.getValueOrDefault(ellipsoid.fill, time, true);
+ const showOutline = Property_default.getValueOrDefault(
+ ellipsoid.outline,
+ time,
+ false
+ );
+ const outlineColor = Property_default.getValueOrClonedDefault(
+ ellipsoid.outlineColor,
+ time,
+ Color_default.BLACK,
+ scratchColor14
+ );
+ const material = MaterialProperty_default.getValue(
+ time,
+ defaultValue_default(ellipsoid.material, defaultMaterial2),
+ this._material
+ );
+ const innerRadii = Property_default.getValueOrUndefined(
+ ellipsoid.innerRadii,
+ time,
+ innerRadiiScratch
+ );
+ const minimumClock = Property_default.getValueOrUndefined(
+ ellipsoid.minimumClock,
+ time
+ );
+ const maximumClock = Property_default.getValueOrUndefined(
+ ellipsoid.maximumClock,
+ time
+ );
+ const minimumCone = Property_default.getValueOrUndefined(ellipsoid.minimumCone, time);
+ const maximumCone = Property_default.getValueOrUndefined(ellipsoid.maximumCone, time);
+ const stackPartitions = Property_default.getValueOrUndefined(
+ ellipsoid.stackPartitions,
+ time
+ );
+ const slicePartitions = Property_default.getValueOrUndefined(
+ ellipsoid.slicePartitions,
+ time
+ );
+ const subdivisions = Property_default.getValueOrUndefined(
+ ellipsoid.subdivisions,
+ time
+ );
+ const outlineWidth = Property_default.getValueOrDefault(
+ ellipsoid.outlineWidth,
+ time,
+ 1
+ );
+ const heightReference = Property_default.getValueOrDefault(
+ ellipsoid.heightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ const offsetAttribute = heightReference !== HeightReference_default.NONE ? GeometryOffsetAttribute_default.ALL : void 0;
+ const sceneMode = this._scene.mode;
+ const in3D = sceneMode === SceneMode_default.SCENE3D && heightReference === HeightReference_default.NONE;
+ const options = this._options;
+ const shadows = this._geometryUpdater.shadowsProperty.getValue(time);
+ const distanceDisplayConditionProperty = this._geometryUpdater.distanceDisplayConditionProperty;
+ const distanceDisplayCondition = distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const offset2 = Property_default.getValueOrDefault(
+ this._geometryUpdater.terrainOffsetProperty,
+ time,
+ defaultOffset6,
+ offsetScratch8
+ );
+ const rebuildPrimitives = !in3D || this._lastSceneMode !== sceneMode || !defined_default(this._primitive) || options.stackPartitions !== stackPartitions || options.slicePartitions !== slicePartitions || defined_default(innerRadii) && !Cartesian3_default.equals(options.innerRadii !== innerRadii) || options.minimumClock !== minimumClock || options.maximumClock !== maximumClock || options.minimumCone !== minimumCone || options.maximumCone !== maximumCone || options.subdivisions !== subdivisions || this._lastOutlineWidth !== outlineWidth || options.offsetAttribute !== offsetAttribute;
+ if (rebuildPrimitives) {
+ const primitives = this._primitives;
+ primitives.removeAndDestroy(this._primitive);
+ primitives.removeAndDestroy(this._outlinePrimitive);
+ this._primitive = void 0;
+ this._outlinePrimitive = void 0;
+ this._lastSceneMode = sceneMode;
+ this._lastOutlineWidth = outlineWidth;
+ options.stackPartitions = stackPartitions;
+ options.slicePartitions = slicePartitions;
+ options.subdivisions = subdivisions;
+ options.offsetAttribute = offsetAttribute;
+ options.radii = Cartesian3_default.clone(in3D ? unitSphere : radii, options.radii);
+ if (defined_default(innerRadii)) {
+ if (in3D) {
+ const mag = Cartesian3_default.magnitude(radii);
+ options.innerRadii = Cartesian3_default.fromElements(
+ innerRadii.x / mag,
+ innerRadii.y / mag,
+ innerRadii.z / mag,
+ options.innerRadii
+ );
+ } else {
+ options.innerRadii = Cartesian3_default.clone(innerRadii, options.innerRadii);
+ }
+ } else {
+ options.innerRadii = void 0;
+ }
+ options.minimumClock = minimumClock;
+ options.maximumClock = maximumClock;
+ options.minimumCone = minimumCone;
+ options.maximumCone = maximumCone;
+ const appearance = new MaterialAppearance_default({
+ material,
+ translucent: material.isTranslucent(),
+ closed: true
+ });
+ options.vertexFormat = appearance.vertexFormat;
+ const fillInstance = this._geometryUpdater.createFillGeometryInstance(
+ time,
+ in3D,
+ this._modelMatrix
+ );
+ this._primitive = primitives.add(
+ new Primitive_default({
+ geometryInstances: fillInstance,
+ appearance,
+ asynchronous: false,
+ shadows
+ })
+ );
+ const outlineInstance = this._geometryUpdater.createOutlineGeometryInstance(
+ time,
+ in3D,
+ this._modelMatrix
+ );
+ this._outlinePrimitive = primitives.add(
+ new Primitive_default({
+ geometryInstances: outlineInstance,
+ appearance: new PerInstanceColorAppearance_default({
+ flat: true,
+ translucent: outlineInstance.attributes.color.value[3] !== 255,
+ renderState: {
+ lineWidth: this._geometryUpdater._scene.clampLineWidth(
+ outlineWidth
+ )
+ }
+ }),
+ asynchronous: false,
+ shadows
+ })
+ );
+ this._lastShow = showFill;
+ this._lastOutlineShow = showOutline;
+ this._lastOutlineColor = Color_default.clone(outlineColor, this._lastOutlineColor);
+ this._lastDistanceDisplayCondition = distanceDisplayCondition;
+ this._lastOffset = Cartesian3_default.clone(offset2, this._lastOffset);
+ } else if (this._primitive.ready) {
+ const primitive = this._primitive;
+ const outlinePrimitive = this._outlinePrimitive;
+ primitive.show = true;
+ outlinePrimitive.show = true;
+ primitive.appearance.material = material;
+ let attributes = this._attributes;
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(entity);
+ this._attributes = attributes;
+ }
+ if (showFill !== this._lastShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ showFill,
+ attributes.show
+ );
+ this._lastShow = showFill;
+ }
+ let outlineAttributes = this._outlineAttributes;
+ if (!defined_default(outlineAttributes)) {
+ outlineAttributes = outlinePrimitive.getGeometryInstanceAttributes(
+ entity
+ );
+ this._outlineAttributes = outlineAttributes;
+ }
+ if (showOutline !== this._lastOutlineShow) {
+ outlineAttributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ showOutline,
+ outlineAttributes.show
+ );
+ this._lastOutlineShow = showOutline;
+ }
+ if (!Color_default.equals(outlineColor, this._lastOutlineColor)) {
+ outlineAttributes.color = ColorGeometryInstanceAttribute_default.toValue(
+ outlineColor,
+ outlineAttributes.color
+ );
+ Color_default.clone(outlineColor, this._lastOutlineColor);
+ }
+ if (!DistanceDisplayCondition_default.equals(
+ distanceDisplayCondition,
+ this._lastDistanceDisplayCondition
+ )) {
+ attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute_default.toValue(
+ distanceDisplayCondition,
+ attributes.distanceDisplayCondition
+ );
+ outlineAttributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute_default.toValue(
+ distanceDisplayCondition,
+ outlineAttributes.distanceDisplayCondition
+ );
+ DistanceDisplayCondition_default.clone(
+ distanceDisplayCondition,
+ this._lastDistanceDisplayCondition
+ );
+ }
+ if (!Cartesian3_default.equals(offset2, this._lastOffset)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.toValue(
+ offset2,
+ attributes.offset
+ );
+ outlineAttributes.offset = OffsetGeometryInstanceAttribute_default.toValue(
+ offset2,
+ attributes.offset
+ );
+ Cartesian3_default.clone(offset2, this._lastOffset);
+ }
+ }
+ if (in3D) {
+ radii.x = Math.max(radii.x, 1e-3);
+ radii.y = Math.max(radii.y, 1e-3);
+ radii.z = Math.max(radii.z, 1e-3);
+ modelMatrix = Matrix4_default.multiplyByScale(modelMatrix, radii, modelMatrix);
+ this._primitive.modelMatrix = modelMatrix;
+ this._outlinePrimitive.modelMatrix = modelMatrix;
+ }
+};
+var EllipsoidGeometryUpdater_default = EllipsoidGeometryUpdater;
+
+// Source/Core/PlaneGeometry.js
+function PlaneGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
+ this._vertexFormat = vertexFormat;
+ this._workerName = "createPlaneGeometry";
+}
+PlaneGeometry.packedLength = VertexFormat_default.packedLength;
+PlaneGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ return array;
+};
+var scratchVertexFormat6 = new VertexFormat_default();
+var scratchOptions14 = {
+ vertexFormat: scratchVertexFormat6
+};
+PlaneGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat6
+ );
+ if (!defined_default(result)) {
+ return new PlaneGeometry(scratchOptions14);
+ }
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ return result;
+};
+var min = new Cartesian3_default(-0.5, -0.5, 0);
+var max = new Cartesian3_default(0.5, 0.5, 0);
+PlaneGeometry.createGeometry = function(planeGeometry) {
+ const vertexFormat = planeGeometry._vertexFormat;
+ const attributes = new GeometryAttributes_default();
+ let indices2;
+ let positions;
+ if (vertexFormat.position) {
+ positions = new Float64Array(4 * 3);
+ positions[0] = min.x;
+ positions[1] = min.y;
+ positions[2] = 0;
+ positions[3] = max.x;
+ positions[4] = min.y;
+ positions[5] = 0;
+ positions[6] = max.x;
+ positions[7] = max.y;
+ positions[8] = 0;
+ positions[9] = min.x;
+ positions[10] = max.y;
+ positions[11] = 0;
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ if (vertexFormat.normal) {
+ const normals = new Float32Array(4 * 3);
+ normals[0] = 0;
+ normals[1] = 0;
+ normals[2] = 1;
+ normals[3] = 0;
+ normals[4] = 0;
+ normals[5] = 1;
+ normals[6] = 0;
+ normals[7] = 0;
+ normals[8] = 1;
+ normals[9] = 0;
+ normals[10] = 0;
+ normals[11] = 1;
+ attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals
+ });
+ }
+ if (vertexFormat.st) {
+ const texCoords = new Float32Array(4 * 2);
+ texCoords[0] = 0;
+ texCoords[1] = 0;
+ texCoords[2] = 1;
+ texCoords[3] = 0;
+ texCoords[4] = 1;
+ texCoords[5] = 1;
+ texCoords[6] = 0;
+ texCoords[7] = 1;
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: texCoords
+ });
+ }
+ if (vertexFormat.tangent) {
+ const tangents = new Float32Array(4 * 3);
+ tangents[0] = 1;
+ tangents[1] = 0;
+ tangents[2] = 0;
+ tangents[3] = 1;
+ tangents[4] = 0;
+ tangents[5] = 0;
+ tangents[6] = 1;
+ tangents[7] = 0;
+ tangents[8] = 0;
+ tangents[9] = 1;
+ tangents[10] = 0;
+ tangents[11] = 0;
+ attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ const bitangents = new Float32Array(4 * 3);
+ bitangents[0] = 0;
+ bitangents[1] = 1;
+ bitangents[2] = 0;
+ bitangents[3] = 0;
+ bitangents[4] = 1;
+ bitangents[5] = 0;
+ bitangents[6] = 0;
+ bitangents[7] = 1;
+ bitangents[8] = 0;
+ bitangents[9] = 0;
+ bitangents[10] = 1;
+ bitangents[11] = 0;
+ attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents
+ });
+ }
+ indices2 = new Uint16Array(2 * 3);
+ indices2[0] = 0;
+ indices2[1] = 1;
+ indices2[2] = 2;
+ indices2[3] = 0;
+ indices2[4] = 2;
+ indices2[5] = 3;
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.TRIANGLES,
+ boundingSphere: new BoundingSphere_default(Cartesian3_default.ZERO, Math.sqrt(2))
+ });
+};
+var PlaneGeometry_default = PlaneGeometry;
+
+// Source/Core/PlaneOutlineGeometry.js
+function PlaneOutlineGeometry() {
+ this._workerName = "createPlaneOutlineGeometry";
+}
+PlaneOutlineGeometry.packedLength = 0;
+PlaneOutlineGeometry.pack = function(value, array) {
+ Check_default.defined("value", value);
+ Check_default.defined("array", array);
+ return array;
+};
+PlaneOutlineGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ if (!defined_default(result)) {
+ return new PlaneOutlineGeometry();
+ }
+ return result;
+};
+var min2 = new Cartesian3_default(-0.5, -0.5, 0);
+var max2 = new Cartesian3_default(0.5, 0.5, 0);
+PlaneOutlineGeometry.createGeometry = function() {
+ const attributes = new GeometryAttributes_default();
+ const indices2 = new Uint16Array(4 * 2);
+ const positions = new Float64Array(4 * 3);
+ positions[0] = min2.x;
+ positions[1] = min2.y;
+ positions[2] = min2.z;
+ positions[3] = max2.x;
+ positions[4] = min2.y;
+ positions[5] = min2.z;
+ positions[6] = max2.x;
+ positions[7] = max2.y;
+ positions[8] = min2.z;
+ positions[9] = min2.x;
+ positions[10] = max2.y;
+ positions[11] = min2.z;
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ indices2[0] = 0;
+ indices2[1] = 1;
+ indices2[2] = 1;
+ indices2[3] = 2;
+ indices2[4] = 2;
+ indices2[5] = 3;
+ indices2[6] = 3;
+ indices2[7] = 0;
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.LINES,
+ boundingSphere: new BoundingSphere_default(Cartesian3_default.ZERO, Math.sqrt(2))
+ });
+};
+var PlaneOutlineGeometry_default = PlaneOutlineGeometry;
+
+// Source/DataSources/PlaneGeometryUpdater.js
+var positionScratch11 = new Cartesian3_default();
+var scratchColor15 = new Color_default();
+function PlaneGeometryOptions(entity) {
+ this.id = entity;
+ this.vertexFormat = void 0;
+ this.plane = void 0;
+ this.dimensions = void 0;
+}
+function PlaneGeometryUpdater(entity, scene) {
+ GeometryUpdater_default.call(this, {
+ entity,
+ scene,
+ geometryOptions: new PlaneGeometryOptions(entity),
+ geometryPropertyName: "plane",
+ observedPropertyNames: ["availability", "position", "orientation", "plane"]
+ });
+ this._onEntityPropertyChanged(entity, "plane", entity.plane, void 0);
+}
+if (defined_default(Object.create)) {
+ PlaneGeometryUpdater.prototype = Object.create(GeometryUpdater_default.prototype);
+ PlaneGeometryUpdater.prototype.constructor = PlaneGeometryUpdater;
+}
+PlaneGeometryUpdater.prototype.createFillGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._fillEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent a filled geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ let attributes;
+ let color;
+ const show = new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time)
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ );
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ let currentColor;
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor15);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ attributes = {
+ show,
+ distanceDisplayCondition: distanceDisplayConditionAttribute,
+ color
+ };
+ } else {
+ attributes = {
+ show,
+ distanceDisplayCondition: distanceDisplayConditionAttribute
+ };
+ }
+ const planeGraphics = entity.plane;
+ const options = this._options;
+ let modelMatrix = entity.computeModelMatrix(time);
+ const plane = Property_default.getValueOrDefault(
+ planeGraphics.plane,
+ time,
+ options.plane
+ );
+ const dimensions = Property_default.getValueOrUndefined(
+ planeGraphics.dimensions,
+ time,
+ options.dimensions
+ );
+ options.plane = plane;
+ options.dimensions = dimensions;
+ modelMatrix = createPrimitiveMatrix(
+ plane,
+ dimensions,
+ modelMatrix,
+ modelMatrix
+ );
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new PlaneGeometry_default(this._options),
+ modelMatrix,
+ attributes
+ });
+};
+PlaneGeometryUpdater.prototype.createOutlineGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._outlineEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent an outlined geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const outlineColor = Property_default.getValueOrDefault(
+ this._outlineColorProperty,
+ time,
+ Color_default.BLACK,
+ scratchColor15
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const planeGraphics = entity.plane;
+ const options = this._options;
+ let modelMatrix = entity.computeModelMatrix(time);
+ const plane = Property_default.getValueOrDefault(
+ planeGraphics.plane,
+ time,
+ options.plane
+ );
+ const dimensions = Property_default.getValueOrUndefined(
+ planeGraphics.dimensions,
+ time,
+ options.dimensions
+ );
+ options.plane = plane;
+ options.dimensions = dimensions;
+ modelMatrix = createPrimitiveMatrix(
+ plane,
+ dimensions,
+ modelMatrix,
+ modelMatrix
+ );
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new PlaneOutlineGeometry_default(),
+ modelMatrix,
+ attributes: {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)
+ ),
+ color: ColorGeometryInstanceAttribute_default.fromColor(outlineColor),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ )
+ }
+ });
+};
+PlaneGeometryUpdater.prototype._isHidden = function(entity, plane) {
+ return !defined_default(plane.plane) || !defined_default(plane.dimensions) || !defined_default(entity.position) || GeometryUpdater_default.prototype._isHidden.call(this, entity, plane);
+};
+PlaneGeometryUpdater.prototype._getIsClosed = function(options) {
+ return false;
+};
+PlaneGeometryUpdater.prototype._isDynamic = function(entity, plane) {
+ return !entity.position.isConstant || !Property_default.isConstant(entity.orientation) || !plane.plane.isConstant || !plane.dimensions.isConstant || !Property_default.isConstant(plane.outlineWidth);
+};
+PlaneGeometryUpdater.prototype._setStaticOptions = function(entity, plane) {
+ const isColorMaterial = this._materialProperty instanceof ColorMaterialProperty_default;
+ const options = this._options;
+ options.vertexFormat = isColorMaterial ? PerInstanceColorAppearance_default.VERTEX_FORMAT : MaterialAppearance_default.MaterialSupport.TEXTURED.vertexFormat;
+ options.plane = plane.plane.getValue(Iso8601_default.MINIMUM_VALUE, options.plane);
+ options.dimensions = plane.dimensions.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.dimensions
+ );
+};
+PlaneGeometryUpdater.DynamicGeometryUpdater = DynamicPlaneGeometryUpdater;
+function DynamicPlaneGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
+ DynamicGeometryUpdater_default.call(
+ this,
+ geometryUpdater,
+ primitives,
+ groundPrimitives
+ );
+}
+if (defined_default(Object.create)) {
+ DynamicPlaneGeometryUpdater.prototype = Object.create(
+ DynamicGeometryUpdater_default.prototype
+ );
+ DynamicPlaneGeometryUpdater.prototype.constructor = DynamicPlaneGeometryUpdater;
+}
+DynamicPlaneGeometryUpdater.prototype._isHidden = function(entity, plane, time) {
+ const options = this._options;
+ const position = Property_default.getValueOrUndefined(
+ entity.position,
+ time,
+ positionScratch11
+ );
+ return !defined_default(position) || !defined_default(options.plane) || !defined_default(options.dimensions) || DynamicGeometryUpdater_default.prototype._isHidden.call(this, entity, plane, time);
+};
+DynamicPlaneGeometryUpdater.prototype._setOptions = function(entity, plane, time) {
+ const options = this._options;
+ options.plane = Property_default.getValueOrDefault(plane.plane, time, options.plane);
+ options.dimensions = Property_default.getValueOrUndefined(
+ plane.dimensions,
+ time,
+ options.dimensions
+ );
+};
+var scratchAxis2 = new Cartesian3_default();
+var scratchUp = new Cartesian3_default();
+var scratchTranslation = new Cartesian3_default();
+var scratchScale4 = new Cartesian3_default();
+var scratchRotation2 = new Matrix3_default();
+var scratchRotationScale2 = new Matrix3_default();
+var scratchLocalTransform = new Matrix4_default();
+function createPrimitiveMatrix(plane, dimensions, transform3, result) {
+ const normal2 = plane.normal;
+ const distance2 = plane.distance;
+ const translation3 = Cartesian3_default.multiplyByScalar(
+ normal2,
+ -distance2,
+ scratchTranslation
+ );
+ let up = Cartesian3_default.clone(Cartesian3_default.UNIT_Z, scratchUp);
+ if (Math_default.equalsEpsilon(
+ Math.abs(Cartesian3_default.dot(up, normal2)),
+ 1,
+ Math_default.EPSILON8
+ )) {
+ up = Cartesian3_default.clone(Cartesian3_default.UNIT_Y, up);
+ }
+ const left = Cartesian3_default.cross(up, normal2, scratchAxis2);
+ up = Cartesian3_default.cross(normal2, left, up);
+ Cartesian3_default.normalize(left, left);
+ Cartesian3_default.normalize(up, up);
+ const rotationMatrix = scratchRotation2;
+ Matrix3_default.setColumn(rotationMatrix, 0, left, rotationMatrix);
+ Matrix3_default.setColumn(rotationMatrix, 1, up, rotationMatrix);
+ Matrix3_default.setColumn(rotationMatrix, 2, normal2, rotationMatrix);
+ const scale = Cartesian3_default.fromElements(
+ dimensions.x,
+ dimensions.y,
+ 1,
+ scratchScale4
+ );
+ const rotationScaleMatrix = Matrix3_default.multiplyByScale(
+ rotationMatrix,
+ scale,
+ scratchRotationScale2
+ );
+ const localTransform = Matrix4_default.fromRotationTranslation(
+ rotationScaleMatrix,
+ translation3,
+ scratchLocalTransform
+ );
+ return Matrix4_default.multiplyTransformation(transform3, localTransform, result);
+}
+PlaneGeometryUpdater.createPrimitiveMatrix = createPrimitiveMatrix;
+var PlaneGeometryUpdater_default = PlaneGeometryUpdater;
+
+// Source/Core/CoplanarPolygonGeometry.js
+var scratchPosition9 = new Cartesian3_default();
+var scratchBR = new BoundingRectangle_default();
+var stScratch = new Cartesian2_default();
+var textureCoordinatesOrigin = new Cartesian2_default();
+var scratchNormal5 = new Cartesian3_default();
+var scratchTangent3 = new Cartesian3_default();
+var scratchBitangent3 = new Cartesian3_default();
+var centerScratch3 = new Cartesian3_default();
+var axis1Scratch = new Cartesian3_default();
+var axis2Scratch = new Cartesian3_default();
+var quaternionScratch3 = new Quaternion_default();
+var textureMatrixScratch2 = new Matrix3_default();
+var tangentRotationScratch = new Matrix3_default();
+var surfaceNormalScratch = new Cartesian3_default();
+function createGeometryFromPolygon(polygon, vertexFormat, boundingRectangle, stRotation, hardcodedTextureCoordinates, projectPointTo2D, normal2, tangent, bitangent) {
+ const positions = polygon.positions;
+ let indices2 = PolygonPipeline_default.triangulate(polygon.positions2D, polygon.holes);
+ if (indices2.length < 3) {
+ indices2 = [0, 1, 2];
+ }
+ const newIndices = IndexDatatype_default.createTypedArray(
+ positions.length,
+ indices2.length
+ );
+ newIndices.set(indices2);
+ let textureMatrix = textureMatrixScratch2;
+ if (stRotation !== 0) {
+ let rotation = Quaternion_default.fromAxisAngle(
+ normal2,
+ stRotation,
+ quaternionScratch3
+ );
+ textureMatrix = Matrix3_default.fromQuaternion(rotation, textureMatrix);
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ rotation = Quaternion_default.fromAxisAngle(
+ normal2,
+ -stRotation,
+ quaternionScratch3
+ );
+ const tangentRotation = Matrix3_default.fromQuaternion(
+ rotation,
+ tangentRotationScratch
+ );
+ tangent = Cartesian3_default.normalize(
+ Matrix3_default.multiplyByVector(tangentRotation, tangent, tangent),
+ tangent
+ );
+ if (vertexFormat.bitangent) {
+ bitangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(normal2, tangent, bitangent),
+ bitangent
+ );
+ }
+ }
+ } else {
+ textureMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY, textureMatrix);
+ }
+ const stOrigin = textureCoordinatesOrigin;
+ if (vertexFormat.st) {
+ stOrigin.x = boundingRectangle.x;
+ stOrigin.y = boundingRectangle.y;
+ }
+ const length3 = positions.length;
+ const size = length3 * 3;
+ const flatPositions2 = new Float64Array(size);
+ const normals = vertexFormat.normal ? new Float32Array(size) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(size) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(size) : void 0;
+ const textureCoordinates = vertexFormat.st ? new Float32Array(length3 * 2) : void 0;
+ let positionIndex = 0;
+ let normalIndex = 0;
+ let bitangentIndex = 0;
+ let tangentIndex = 0;
+ let stIndex = 0;
+ for (let i = 0; i < length3; i++) {
+ const position = positions[i];
+ flatPositions2[positionIndex++] = position.x;
+ flatPositions2[positionIndex++] = position.y;
+ flatPositions2[positionIndex++] = position.z;
+ if (vertexFormat.st) {
+ if (defined_default(hardcodedTextureCoordinates) && hardcodedTextureCoordinates.positions.length === length3) {
+ textureCoordinates[stIndex++] = hardcodedTextureCoordinates.positions[i].x;
+ textureCoordinates[stIndex++] = hardcodedTextureCoordinates.positions[i].y;
+ } else {
+ const p = Matrix3_default.multiplyByVector(
+ textureMatrix,
+ position,
+ scratchPosition9
+ );
+ const st = projectPointTo2D(p, stScratch);
+ Cartesian2_default.subtract(st, stOrigin, st);
+ const stx = Math_default.clamp(st.x / boundingRectangle.width, 0, 1);
+ const sty = Math_default.clamp(st.y / boundingRectangle.height, 0, 1);
+ textureCoordinates[stIndex++] = stx;
+ textureCoordinates[stIndex++] = sty;
+ }
+ }
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = normal2.x;
+ normals[normalIndex++] = normal2.y;
+ normals[normalIndex++] = normal2.z;
+ }
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ }
+ }
+ const attributes = new GeometryAttributes_default();
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: flatPositions2
+ });
+ }
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals
+ });
+ }
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents
+ });
+ }
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates
+ });
+ }
+ return new Geometry_default({
+ attributes,
+ indices: newIndices,
+ primitiveType: PrimitiveType_default.TRIANGLES
+ });
+}
+function CoplanarPolygonGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const polygonHierarchy = options.polygonHierarchy;
+ const textureCoordinates = options.textureCoordinates;
+ Check_default.defined("options.polygonHierarchy", polygonHierarchy);
+ const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
+ this._vertexFormat = VertexFormat_default.clone(vertexFormat);
+ this._polygonHierarchy = polygonHierarchy;
+ this._stRotation = defaultValue_default(options.stRotation, 0);
+ this._ellipsoid = Ellipsoid_default.clone(
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
+ );
+ this._workerName = "createCoplanarPolygonGeometry";
+ this._textureCoordinates = textureCoordinates;
+ this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
+ polygonHierarchy,
+ Cartesian3_default
+ ) + VertexFormat_default.packedLength + Ellipsoid_default.packedLength + (defined_default(textureCoordinates) ? PolygonGeometryLibrary_default.computeHierarchyPackedLength(
+ textureCoordinates,
+ Cartesian2_default
+ ) : 1) + 2;
+}
+CoplanarPolygonGeometry.fromPositions = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.positions", options.positions);
+ const newOptions2 = {
+ polygonHierarchy: {
+ positions: options.positions
+ },
+ vertexFormat: options.vertexFormat,
+ stRotation: options.stRotation,
+ ellipsoid: options.ellipsoid,
+ textureCoordinates: options.textureCoordinates
+ };
+ return new CoplanarPolygonGeometry(newOptions2);
+};
+CoplanarPolygonGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
+ value._polygonHierarchy,
+ array,
+ startingIndex,
+ Cartesian3_default
+ );
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat_default.packedLength;
+ array[startingIndex++] = value._stRotation;
+ if (defined_default(value._textureCoordinates)) {
+ startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
+ value._textureCoordinates,
+ array,
+ startingIndex,
+ Cartesian2_default
+ );
+ } else {
+ array[startingIndex++] = -1;
+ }
+ array[startingIndex++] = value.packedLength;
+ return array;
+};
+var scratchEllipsoid6 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchVertexFormat7 = new VertexFormat_default();
+var scratchOptions15 = {
+ polygonHierarchy: {}
+};
+CoplanarPolygonGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Cartesian3_default
+ );
+ startingIndex = polygonHierarchy.startingIndex;
+ delete polygonHierarchy.startingIndex;
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid6);
+ startingIndex += Ellipsoid_default.packedLength;
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat7
+ );
+ startingIndex += VertexFormat_default.packedLength;
+ const stRotation = array[startingIndex++];
+ const textureCoordinates = array[startingIndex] === -1 ? void 0 : PolygonGeometryLibrary_default.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Cartesian2_default
+ );
+ if (defined_default(textureCoordinates)) {
+ startingIndex = textureCoordinates.startingIndex;
+ delete textureCoordinates.startingIndex;
+ } else {
+ startingIndex++;
+ }
+ const packedLength = array[startingIndex++];
+ if (!defined_default(result)) {
+ result = new CoplanarPolygonGeometry(scratchOptions15);
+ }
+ result._polygonHierarchy = polygonHierarchy;
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._stRotation = stRotation;
+ result._textureCoordinates = textureCoordinates;
+ result.packedLength = packedLength;
+ return result;
+};
+CoplanarPolygonGeometry.createGeometry = function(polygonGeometry) {
+ const vertexFormat = polygonGeometry._vertexFormat;
+ const polygonHierarchy = polygonGeometry._polygonHierarchy;
+ const stRotation = polygonGeometry._stRotation;
+ const textureCoordinates = polygonGeometry._textureCoordinates;
+ const hasTextureCoordinates = defined_default(textureCoordinates);
+ let outerPositions = polygonHierarchy.positions;
+ outerPositions = arrayRemoveDuplicates_default(
+ outerPositions,
+ Cartesian3_default.equalsEpsilon,
+ true
+ );
+ if (outerPositions.length < 3) {
+ return;
+ }
+ let normal2 = scratchNormal5;
+ let tangent = scratchTangent3;
+ let bitangent = scratchBitangent3;
+ let axis1 = axis1Scratch;
+ const axis2 = axis2Scratch;
+ const validGeometry = CoplanarPolygonGeometryLibrary_default.computeProjectTo2DArguments(
+ outerPositions,
+ centerScratch3,
+ axis1,
+ axis2
+ );
+ if (!validGeometry) {
+ return void 0;
+ }
+ normal2 = Cartesian3_default.cross(axis1, axis2, normal2);
+ normal2 = Cartesian3_default.normalize(normal2, normal2);
+ if (!Cartesian3_default.equalsEpsilon(
+ centerScratch3,
+ Cartesian3_default.ZERO,
+ Math_default.EPSILON6
+ )) {
+ const surfaceNormal = polygonGeometry._ellipsoid.geodeticSurfaceNormal(
+ centerScratch3,
+ surfaceNormalScratch
+ );
+ if (Cartesian3_default.dot(normal2, surfaceNormal) < 0) {
+ normal2 = Cartesian3_default.negate(normal2, normal2);
+ axis1 = Cartesian3_default.negate(axis1, axis1);
+ }
+ }
+ const projectPoints = CoplanarPolygonGeometryLibrary_default.createProjectPointsTo2DFunction(
+ centerScratch3,
+ axis1,
+ axis2
+ );
+ const projectPoint = CoplanarPolygonGeometryLibrary_default.createProjectPointTo2DFunction(
+ centerScratch3,
+ axis1,
+ axis2
+ );
+ if (vertexFormat.tangent) {
+ tangent = Cartesian3_default.clone(axis1, tangent);
+ }
+ if (vertexFormat.bitangent) {
+ bitangent = Cartesian3_default.clone(axis2, bitangent);
+ }
+ const results = PolygonGeometryLibrary_default.polygonsFromHierarchy(
+ polygonHierarchy,
+ hasTextureCoordinates,
+ projectPoints,
+ false
+ );
+ const hierarchy = results.hierarchy;
+ const polygons = results.polygons;
+ const dummyFunction = function(identity) {
+ return identity;
+ };
+ const textureCoordinatePolygons = hasTextureCoordinates ? PolygonGeometryLibrary_default.polygonsFromHierarchy(
+ textureCoordinates,
+ true,
+ dummyFunction,
+ false
+ ).polygons : void 0;
+ if (hierarchy.length === 0) {
+ return;
+ }
+ outerPositions = hierarchy[0].outerRing;
+ const boundingSphere = BoundingSphere_default.fromPoints(outerPositions);
+ const boundingRectangle = PolygonGeometryLibrary_default.computeBoundingRectangle(
+ normal2,
+ projectPoint,
+ outerPositions,
+ stRotation,
+ scratchBR
+ );
+ const geometries = [];
+ for (let i = 0; i < polygons.length; i++) {
+ const geometryInstance = new GeometryInstance_default({
+ geometry: createGeometryFromPolygon(
+ polygons[i],
+ vertexFormat,
+ boundingRectangle,
+ stRotation,
+ hasTextureCoordinates ? textureCoordinatePolygons[i] : void 0,
+ projectPoint,
+ normal2,
+ tangent,
+ bitangent
+ )
+ });
+ geometries.push(geometryInstance);
+ }
+ const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
+ geometry.attributes.position.values = new Float64Array(
+ geometry.attributes.position.values
+ );
+ geometry.indices = IndexDatatype_default.createTypedArray(
+ geometry.attributes.position.values.length / 3,
+ geometry.indices
+ );
+ const attributes = geometry.attributes;
+ if (!vertexFormat.position) {
+ delete attributes.position;
+ }
+ return new Geometry_default({
+ attributes,
+ indices: geometry.indices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere
+ });
+};
+var CoplanarPolygonGeometry_default = CoplanarPolygonGeometry;
+
+// Source/Core/PolygonGeometry.js
+var scratchCarto1 = new Cartographic_default();
+var scratchCarto2 = new Cartographic_default();
+function adjustPosHeightsForNormal(position, p1, p2, ellipsoid) {
+ const carto12 = ellipsoid.cartesianToCartographic(position, scratchCarto1);
+ const height = carto12.height;
+ const p1Carto = ellipsoid.cartesianToCartographic(p1, scratchCarto2);
+ p1Carto.height = height;
+ ellipsoid.cartographicToCartesian(p1Carto, p1);
+ const p2Carto = ellipsoid.cartesianToCartographic(p2, scratchCarto2);
+ p2Carto.height = height - 100;
+ ellipsoid.cartographicToCartesian(p2Carto, p2);
+}
+var scratchBoundingRectangle = new BoundingRectangle_default();
+var scratchPosition10 = new Cartesian3_default();
+var scratchNormal6 = new Cartesian3_default();
+var scratchTangent4 = new Cartesian3_default();
+var scratchBitangent4 = new Cartesian3_default();
+var p1Scratch3 = new Cartesian3_default();
+var p2Scratch3 = new Cartesian3_default();
+var scratchPerPosNormal = new Cartesian3_default();
+var scratchPerPosTangent = new Cartesian3_default();
+var scratchPerPosBitangent = new Cartesian3_default();
+var appendTextureCoordinatesOrigin = new Cartesian2_default();
+var appendTextureCoordinatesCartesian2 = new Cartesian2_default();
+var appendTextureCoordinatesCartesian3 = new Cartesian3_default();
+var appendTextureCoordinatesQuaternion = new Quaternion_default();
+var appendTextureCoordinatesMatrix3 = new Matrix3_default();
+var tangentMatrixScratch2 = new Matrix3_default();
+function computeAttributes(options) {
+ const vertexFormat = options.vertexFormat;
+ const geometry = options.geometry;
+ const shadowVolume = options.shadowVolume;
+ const flatPositions2 = geometry.attributes.position.values;
+ const flatTexcoords = defined_default(geometry.attributes.st) ? geometry.attributes.st.values : void 0;
+ let length3 = flatPositions2.length;
+ const wall = options.wall;
+ const top = options.top || wall;
+ const bottom = options.bottom || wall;
+ if (vertexFormat.st || vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) {
+ const boundingRectangle = options.boundingRectangle;
+ const tangentPlane = options.tangentPlane;
+ const ellipsoid = options.ellipsoid;
+ const stRotation = options.stRotation;
+ const perPositionHeight = options.perPositionHeight;
+ const origin = appendTextureCoordinatesOrigin;
+ origin.x = boundingRectangle.x;
+ origin.y = boundingRectangle.y;
+ const textureCoordinates = vertexFormat.st ? new Float32Array(2 * (length3 / 3)) : void 0;
+ let normals;
+ if (vertexFormat.normal) {
+ if (perPositionHeight && top && !wall) {
+ normals = geometry.attributes.normal.values;
+ } else {
+ normals = new Float32Array(length3);
+ }
+ }
+ const tangents = vertexFormat.tangent ? new Float32Array(length3) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(length3) : void 0;
+ const extrudeNormals = shadowVolume ? new Float32Array(length3) : void 0;
+ let textureCoordIndex = 0;
+ let attrIndex = 0;
+ let normal2 = scratchNormal6;
+ let tangent = scratchTangent4;
+ let bitangent = scratchBitangent4;
+ let recomputeNormal = true;
+ let textureMatrix = appendTextureCoordinatesMatrix3;
+ let tangentRotationMatrix = tangentMatrixScratch2;
+ if (stRotation !== 0) {
+ let rotation = Quaternion_default.fromAxisAngle(
+ tangentPlane._plane.normal,
+ stRotation,
+ appendTextureCoordinatesQuaternion
+ );
+ textureMatrix = Matrix3_default.fromQuaternion(rotation, textureMatrix);
+ rotation = Quaternion_default.fromAxisAngle(
+ tangentPlane._plane.normal,
+ -stRotation,
+ appendTextureCoordinatesQuaternion
+ );
+ tangentRotationMatrix = Matrix3_default.fromQuaternion(
+ rotation,
+ tangentRotationMatrix
+ );
+ } else {
+ textureMatrix = Matrix3_default.clone(Matrix3_default.IDENTITY, textureMatrix);
+ tangentRotationMatrix = Matrix3_default.clone(
+ Matrix3_default.IDENTITY,
+ tangentRotationMatrix
+ );
+ }
+ let bottomOffset = 0;
+ let bottomOffset2 = 0;
+ if (top && bottom) {
+ bottomOffset = length3 / 2;
+ bottomOffset2 = length3 / 3;
+ length3 /= 2;
+ }
+ for (let i = 0; i < length3; i += 3) {
+ const position = Cartesian3_default.fromArray(
+ flatPositions2,
+ i,
+ appendTextureCoordinatesCartesian3
+ );
+ if (vertexFormat.st) {
+ if (!defined_default(flatTexcoords)) {
+ let p = Matrix3_default.multiplyByVector(
+ textureMatrix,
+ position,
+ scratchPosition10
+ );
+ p = ellipsoid.scaleToGeodeticSurface(p, p);
+ const st = tangentPlane.projectPointOntoPlane(
+ p,
+ appendTextureCoordinatesCartesian2
+ );
+ Cartesian2_default.subtract(st, origin, st);
+ const stx = Math_default.clamp(st.x / boundingRectangle.width, 0, 1);
+ const sty = Math_default.clamp(st.y / boundingRectangle.height, 0, 1);
+ if (bottom) {
+ textureCoordinates[textureCoordIndex + bottomOffset2] = stx;
+ textureCoordinates[textureCoordIndex + 1 + bottomOffset2] = sty;
+ }
+ if (top) {
+ textureCoordinates[textureCoordIndex] = stx;
+ textureCoordinates[textureCoordIndex + 1] = sty;
+ }
+ textureCoordIndex += 2;
+ }
+ }
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent || shadowVolume) {
+ const attrIndex1 = attrIndex + 1;
+ const attrIndex2 = attrIndex + 2;
+ if (wall) {
+ if (i + 3 < length3) {
+ const p1 = Cartesian3_default.fromArray(flatPositions2, i + 3, p1Scratch3);
+ if (recomputeNormal) {
+ const p2 = Cartesian3_default.fromArray(
+ flatPositions2,
+ i + length3,
+ p2Scratch3
+ );
+ if (perPositionHeight) {
+ adjustPosHeightsForNormal(position, p1, p2, ellipsoid);
+ }
+ Cartesian3_default.subtract(p1, position, p1);
+ Cartesian3_default.subtract(p2, position, p2);
+ normal2 = Cartesian3_default.normalize(
+ Cartesian3_default.cross(p2, p1, normal2),
+ normal2
+ );
+ recomputeNormal = false;
+ }
+ if (Cartesian3_default.equalsEpsilon(p1, position, Math_default.EPSILON10)) {
+ recomputeNormal = true;
+ }
+ }
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ bitangent = ellipsoid.geodeticSurfaceNormal(position, bitangent);
+ if (vertexFormat.tangent) {
+ tangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(bitangent, normal2, tangent),
+ tangent
+ );
+ }
+ }
+ } else {
+ normal2 = ellipsoid.geodeticSurfaceNormal(position, normal2);
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ if (perPositionHeight) {
+ scratchPerPosNormal = Cartesian3_default.fromArray(
+ normals,
+ attrIndex,
+ scratchPerPosNormal
+ );
+ scratchPerPosTangent = Cartesian3_default.cross(
+ Cartesian3_default.UNIT_Z,
+ scratchPerPosNormal,
+ scratchPerPosTangent
+ );
+ scratchPerPosTangent = Cartesian3_default.normalize(
+ Matrix3_default.multiplyByVector(
+ tangentRotationMatrix,
+ scratchPerPosTangent,
+ scratchPerPosTangent
+ ),
+ scratchPerPosTangent
+ );
+ if (vertexFormat.bitangent) {
+ scratchPerPosBitangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(
+ scratchPerPosNormal,
+ scratchPerPosTangent,
+ scratchPerPosBitangent
+ ),
+ scratchPerPosBitangent
+ );
+ }
+ }
+ tangent = Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal2, tangent);
+ tangent = Cartesian3_default.normalize(
+ Matrix3_default.multiplyByVector(tangentRotationMatrix, tangent, tangent),
+ tangent
+ );
+ if (vertexFormat.bitangent) {
+ bitangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(normal2, tangent, bitangent),
+ bitangent
+ );
+ }
+ }
+ }
+ if (vertexFormat.normal) {
+ if (options.wall) {
+ normals[attrIndex + bottomOffset] = normal2.x;
+ normals[attrIndex1 + bottomOffset] = normal2.y;
+ normals[attrIndex2 + bottomOffset] = normal2.z;
+ } else if (bottom) {
+ normals[attrIndex + bottomOffset] = -normal2.x;
+ normals[attrIndex1 + bottomOffset] = -normal2.y;
+ normals[attrIndex2 + bottomOffset] = -normal2.z;
+ }
+ if (top && !perPositionHeight || wall) {
+ normals[attrIndex] = normal2.x;
+ normals[attrIndex1] = normal2.y;
+ normals[attrIndex2] = normal2.z;
+ }
+ }
+ if (shadowVolume) {
+ if (wall) {
+ normal2 = ellipsoid.geodeticSurfaceNormal(position, normal2);
+ }
+ extrudeNormals[attrIndex + bottomOffset] = -normal2.x;
+ extrudeNormals[attrIndex1 + bottomOffset] = -normal2.y;
+ extrudeNormals[attrIndex2 + bottomOffset] = -normal2.z;
+ }
+ if (vertexFormat.tangent) {
+ if (options.wall) {
+ tangents[attrIndex + bottomOffset] = tangent.x;
+ tangents[attrIndex1 + bottomOffset] = tangent.y;
+ tangents[attrIndex2 + bottomOffset] = tangent.z;
+ } else if (bottom) {
+ tangents[attrIndex + bottomOffset] = -tangent.x;
+ tangents[attrIndex1 + bottomOffset] = -tangent.y;
+ tangents[attrIndex2 + bottomOffset] = -tangent.z;
+ }
+ if (top) {
+ if (perPositionHeight) {
+ tangents[attrIndex] = scratchPerPosTangent.x;
+ tangents[attrIndex1] = scratchPerPosTangent.y;
+ tangents[attrIndex2] = scratchPerPosTangent.z;
+ } else {
+ tangents[attrIndex] = tangent.x;
+ tangents[attrIndex1] = tangent.y;
+ tangents[attrIndex2] = tangent.z;
+ }
+ }
+ }
+ if (vertexFormat.bitangent) {
+ if (bottom) {
+ bitangents[attrIndex + bottomOffset] = bitangent.x;
+ bitangents[attrIndex1 + bottomOffset] = bitangent.y;
+ bitangents[attrIndex2 + bottomOffset] = bitangent.z;
+ }
+ if (top) {
+ if (perPositionHeight) {
+ bitangents[attrIndex] = scratchPerPosBitangent.x;
+ bitangents[attrIndex1] = scratchPerPosBitangent.y;
+ bitangents[attrIndex2] = scratchPerPosBitangent.z;
+ } else {
+ bitangents[attrIndex] = bitangent.x;
+ bitangents[attrIndex1] = bitangent.y;
+ bitangents[attrIndex2] = bitangent.z;
+ }
+ }
+ }
+ attrIndex += 3;
+ }
+ }
+ if (vertexFormat.st && !defined_default(flatTexcoords)) {
+ geometry.attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates
+ });
+ }
+ if (vertexFormat.normal) {
+ geometry.attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals
+ });
+ }
+ if (vertexFormat.tangent) {
+ geometry.attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ geometry.attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents
+ });
+ }
+ if (shadowVolume) {
+ geometry.attributes.extrudeDirection = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: extrudeNormals
+ });
+ }
+ }
+ if (options.extrude && defined_default(options.offsetAttribute)) {
+ const size = flatPositions2.length / 3;
+ let offsetAttribute = new Uint8Array(size);
+ if (options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ if (top && bottom || wall) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else if (top) {
+ offsetAttribute = offsetAttribute.fill(1);
+ }
+ } else {
+ const offsetValue = options.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute
+ });
+ }
+ return geometry;
+}
+var startCartographicScratch2 = new Cartographic_default();
+var endCartographicScratch2 = new Cartographic_default();
+var idlCross = {
+ westOverIDL: 0,
+ eastOverIDL: 0
+};
+var ellipsoidGeodesic2 = new EllipsoidGeodesic_default();
+function computeRectangle3(positions, ellipsoid, arcType, granularity, result) {
+ result = defaultValue_default(result, new Rectangle_default());
+ if (!defined_default(positions) || positions.length < 3) {
+ result.west = 0;
+ result.north = 0;
+ result.south = 0;
+ result.east = 0;
+ return result;
+ }
+ if (arcType === ArcType_default.RHUMB) {
+ return Rectangle_default.fromCartesianArray(positions, ellipsoid, result);
+ }
+ if (!ellipsoidGeodesic2.ellipsoid.equals(ellipsoid)) {
+ ellipsoidGeodesic2 = new EllipsoidGeodesic_default(void 0, void 0, ellipsoid);
+ }
+ result.west = Number.POSITIVE_INFINITY;
+ result.east = Number.NEGATIVE_INFINITY;
+ result.south = Number.POSITIVE_INFINITY;
+ result.north = Number.NEGATIVE_INFINITY;
+ idlCross.westOverIDL = Number.POSITIVE_INFINITY;
+ idlCross.eastOverIDL = Number.NEGATIVE_INFINITY;
+ const inverseChordLength = 1 / Math_default.chordLength(granularity, ellipsoid.maximumRadius);
+ const positionsLength = positions.length;
+ let endCartographic = ellipsoid.cartesianToCartographic(
+ positions[0],
+ endCartographicScratch2
+ );
+ let startCartographic = startCartographicScratch2;
+ let swap4;
+ for (let i = 1; i < positionsLength; i++) {
+ swap4 = startCartographic;
+ startCartographic = endCartographic;
+ endCartographic = ellipsoid.cartesianToCartographic(positions[i], swap4);
+ ellipsoidGeodesic2.setEndPoints(startCartographic, endCartographic);
+ interpolateAndGrowRectangle(
+ ellipsoidGeodesic2,
+ inverseChordLength,
+ result,
+ idlCross
+ );
+ }
+ swap4 = startCartographic;
+ startCartographic = endCartographic;
+ endCartographic = ellipsoid.cartesianToCartographic(positions[0], swap4);
+ ellipsoidGeodesic2.setEndPoints(startCartographic, endCartographic);
+ interpolateAndGrowRectangle(
+ ellipsoidGeodesic2,
+ inverseChordLength,
+ result,
+ idlCross
+ );
+ if (result.east - result.west > idlCross.eastOverIDL - idlCross.westOverIDL) {
+ result.west = idlCross.westOverIDL;
+ result.east = idlCross.eastOverIDL;
+ if (result.east > Math_default.PI) {
+ result.east = result.east - Math_default.TWO_PI;
+ }
+ if (result.west > Math_default.PI) {
+ result.west = result.west - Math_default.TWO_PI;
+ }
+ }
+ return result;
+}
+var interpolatedCartographicScratch2 = new Cartographic_default();
+function interpolateAndGrowRectangle(ellipsoidGeodesic3, inverseChordLength, result, idlCross2) {
+ const segmentLength = ellipsoidGeodesic3.surfaceDistance;
+ const numPoints = Math.ceil(segmentLength * inverseChordLength);
+ const subsegmentDistance = numPoints > 0 ? segmentLength / (numPoints - 1) : Number.POSITIVE_INFINITY;
+ let interpolationDistance = 0;
+ for (let i = 0; i < numPoints; i++) {
+ const interpolatedCartographic = ellipsoidGeodesic3.interpolateUsingSurfaceDistance(
+ interpolationDistance,
+ interpolatedCartographicScratch2
+ );
+ interpolationDistance += subsegmentDistance;
+ const longitude = interpolatedCartographic.longitude;
+ const latitude = interpolatedCartographic.latitude;
+ result.west = Math.min(result.west, longitude);
+ result.east = Math.max(result.east, longitude);
+ result.south = Math.min(result.south, latitude);
+ result.north = Math.max(result.north, latitude);
+ const lonAdjusted = longitude >= 0 ? longitude : longitude + Math_default.TWO_PI;
+ idlCross2.westOverIDL = Math.min(idlCross2.westOverIDL, lonAdjusted);
+ idlCross2.eastOverIDL = Math.max(idlCross2.eastOverIDL, lonAdjusted);
+ }
+}
+var createGeometryFromPositionsExtrudedPositions = [];
+function createGeometryFromPositionsExtruded(ellipsoid, polygon, textureCoordinates, granularity, hierarchy, perPositionHeight, closeTop, closeBottom, vertexFormat, arcType) {
+ const geos = {
+ walls: []
+ };
+ let i;
+ if (closeTop || closeBottom) {
+ const topGeo = PolygonGeometryLibrary_default.createGeometryFromPositions(
+ ellipsoid,
+ polygon,
+ textureCoordinates,
+ granularity,
+ perPositionHeight,
+ vertexFormat,
+ arcType
+ );
+ const edgePoints = topGeo.attributes.position.values;
+ const indices2 = topGeo.indices;
+ let numPositions;
+ let newIndices;
+ if (closeTop && closeBottom) {
+ const topBottomPositions = edgePoints.concat(edgePoints);
+ numPositions = topBottomPositions.length / 3;
+ newIndices = IndexDatatype_default.createTypedArray(
+ numPositions,
+ indices2.length * 2
+ );
+ newIndices.set(indices2);
+ const ilength = indices2.length;
+ const length3 = numPositions / 2;
+ for (i = 0; i < ilength; i += 3) {
+ const i0 = newIndices[i] + length3;
+ const i1 = newIndices[i + 1] + length3;
+ const i2 = newIndices[i + 2] + length3;
+ newIndices[i + ilength] = i2;
+ newIndices[i + 1 + ilength] = i1;
+ newIndices[i + 2 + ilength] = i0;
+ }
+ topGeo.attributes.position.values = topBottomPositions;
+ if (perPositionHeight && vertexFormat.normal) {
+ const normals = topGeo.attributes.normal.values;
+ topGeo.attributes.normal.values = new Float32Array(
+ topBottomPositions.length
+ );
+ topGeo.attributes.normal.values.set(normals);
+ }
+ if (vertexFormat.st && defined_default(textureCoordinates)) {
+ const texcoords = topGeo.attributes.st.values;
+ topGeo.attributes.st.values = new Float32Array(numPositions * 2);
+ topGeo.attributes.st.values = texcoords.concat(texcoords);
+ }
+ topGeo.indices = newIndices;
+ } else if (closeBottom) {
+ numPositions = edgePoints.length / 3;
+ newIndices = IndexDatatype_default.createTypedArray(numPositions, indices2.length);
+ for (i = 0; i < indices2.length; i += 3) {
+ newIndices[i] = indices2[i + 2];
+ newIndices[i + 1] = indices2[i + 1];
+ newIndices[i + 2] = indices2[i];
+ }
+ topGeo.indices = newIndices;
+ }
+ geos.topAndBottom = new GeometryInstance_default({
+ geometry: topGeo
+ });
+ }
+ let outerRing = hierarchy.outerRing;
+ let tangentPlane = EllipsoidTangentPlane_default.fromPoints(outerRing, ellipsoid);
+ let positions2D = tangentPlane.projectPointsOntoPlane(
+ outerRing,
+ createGeometryFromPositionsExtrudedPositions
+ );
+ let windingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
+ if (windingOrder === WindingOrder_default.CLOCKWISE) {
+ outerRing = outerRing.slice().reverse();
+ }
+ let wallGeo = PolygonGeometryLibrary_default.computeWallGeometry(
+ outerRing,
+ textureCoordinates,
+ ellipsoid,
+ granularity,
+ perPositionHeight,
+ arcType
+ );
+ geos.walls.push(
+ new GeometryInstance_default({
+ geometry: wallGeo
+ })
+ );
+ const holes = hierarchy.holes;
+ for (i = 0; i < holes.length; i++) {
+ let hole = holes[i];
+ tangentPlane = EllipsoidTangentPlane_default.fromPoints(hole, ellipsoid);
+ positions2D = tangentPlane.projectPointsOntoPlane(
+ hole,
+ createGeometryFromPositionsExtrudedPositions
+ );
+ windingOrder = PolygonPipeline_default.computeWindingOrder2D(positions2D);
+ if (windingOrder === WindingOrder_default.COUNTER_CLOCKWISE) {
+ hole = hole.slice().reverse();
+ }
+ wallGeo = PolygonGeometryLibrary_default.computeWallGeometry(
+ hole,
+ textureCoordinates,
+ ellipsoid,
+ granularity,
+ perPositionHeight,
+ arcType
+ );
+ geos.walls.push(
+ new GeometryInstance_default({
+ geometry: wallGeo
+ })
+ );
+ }
+ return geos;
+}
+function PolygonGeometry(options) {
+ Check_default.typeOf.object("options", options);
+ Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
+ if (defined_default(options.perPositionHeight) && options.perPositionHeight && defined_default(options.height)) {
+ throw new DeveloperError_default(
+ "Cannot use both options.perPositionHeight and options.height"
+ );
+ }
+ if (defined_default(options.arcType) && options.arcType !== ArcType_default.GEODESIC && options.arcType !== ArcType_default.RHUMB) {
+ throw new DeveloperError_default(
+ "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
+ );
+ }
+ const polygonHierarchy = options.polygonHierarchy;
+ const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ const stRotation = defaultValue_default(options.stRotation, 0);
+ const textureCoordinates = options.textureCoordinates;
+ const perPositionHeight = defaultValue_default(options.perPositionHeight, false);
+ const perPositionHeightExtrude = perPositionHeight && defined_default(options.extrudedHeight);
+ let height = defaultValue_default(options.height, 0);
+ let extrudedHeight = defaultValue_default(options.extrudedHeight, height);
+ if (!perPositionHeightExtrude) {
+ const h = Math.max(height, extrudedHeight);
+ extrudedHeight = Math.min(height, extrudedHeight);
+ height = h;
+ }
+ this._vertexFormat = VertexFormat_default.clone(vertexFormat);
+ this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
+ this._granularity = granularity;
+ this._stRotation = stRotation;
+ this._height = height;
+ this._extrudedHeight = extrudedHeight;
+ this._closeTop = defaultValue_default(options.closeTop, true);
+ this._closeBottom = defaultValue_default(options.closeBottom, true);
+ this._polygonHierarchy = polygonHierarchy;
+ this._perPositionHeight = perPositionHeight;
+ this._perPositionHeightExtrude = perPositionHeightExtrude;
+ this._shadowVolume = defaultValue_default(options.shadowVolume, false);
+ this._workerName = "createPolygonGeometry";
+ this._offsetAttribute = options.offsetAttribute;
+ this._arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
+ this._rectangle = void 0;
+ this._textureCoordinateRotationPoints = void 0;
+ this._textureCoordinates = textureCoordinates;
+ this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
+ polygonHierarchy,
+ Cartesian3_default
+ ) + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + (textureCoordinates ? PolygonGeometryLibrary_default.computeHierarchyPackedLength(
+ textureCoordinates,
+ Cartesian2_default
+ ) : 1) + 12;
+}
+PolygonGeometry.fromPositions = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.positions", options.positions);
+ const newOptions2 = {
+ polygonHierarchy: {
+ positions: options.positions
+ },
+ height: options.height,
+ extrudedHeight: options.extrudedHeight,
+ vertexFormat: options.vertexFormat,
+ stRotation: options.stRotation,
+ ellipsoid: options.ellipsoid,
+ granularity: options.granularity,
+ perPositionHeight: options.perPositionHeight,
+ closeTop: options.closeTop,
+ closeBottom: options.closeBottom,
+ offsetAttribute: options.offsetAttribute,
+ arcType: options.arcType,
+ textureCoordinates: options.textureCoordinates
+ };
+ return new PolygonGeometry(newOptions2);
+};
+PolygonGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
+ value._polygonHierarchy,
+ array,
+ startingIndex,
+ Cartesian3_default
+ );
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat_default.packedLength;
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._stRotation;
+ array[startingIndex++] = value._perPositionHeightExtrude ? 1 : 0;
+ array[startingIndex++] = value._perPositionHeight ? 1 : 0;
+ array[startingIndex++] = value._closeTop ? 1 : 0;
+ array[startingIndex++] = value._closeBottom ? 1 : 0;
+ array[startingIndex++] = value._shadowVolume ? 1 : 0;
+ array[startingIndex++] = defaultValue_default(value._offsetAttribute, -1);
+ array[startingIndex++] = value._arcType;
+ if (defined_default(value._textureCoordinates)) {
+ startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
+ value._textureCoordinates,
+ array,
+ startingIndex,
+ Cartesian2_default
+ );
+ } else {
+ array[startingIndex++] = -1;
+ }
+ array[startingIndex++] = value.packedLength;
+ return array;
+};
+var scratchEllipsoid7 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchVertexFormat8 = new VertexFormat_default();
+var dummyOptions = {
+ polygonHierarchy: {}
+};
+PolygonGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Cartesian3_default
+ );
+ startingIndex = polygonHierarchy.startingIndex;
+ delete polygonHierarchy.startingIndex;
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid7);
+ startingIndex += Ellipsoid_default.packedLength;
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat8
+ );
+ startingIndex += VertexFormat_default.packedLength;
+ const height = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const stRotation = array[startingIndex++];
+ const perPositionHeightExtrude = array[startingIndex++] === 1;
+ const perPositionHeight = array[startingIndex++] === 1;
+ const closeTop = array[startingIndex++] === 1;
+ const closeBottom = array[startingIndex++] === 1;
+ const shadowVolume = array[startingIndex++] === 1;
+ const offsetAttribute = array[startingIndex++];
+ const arcType = array[startingIndex++];
+ const textureCoordinates = array[startingIndex] === -1 ? void 0 : PolygonGeometryLibrary_default.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Cartesian2_default
+ );
+ if (defined_default(textureCoordinates)) {
+ startingIndex = textureCoordinates.startingIndex;
+ delete textureCoordinates.startingIndex;
+ } else {
+ startingIndex++;
+ }
+ const packedLength = array[startingIndex++];
+ if (!defined_default(result)) {
+ result = new PolygonGeometry(dummyOptions);
+ }
+ result._polygonHierarchy = polygonHierarchy;
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._height = height;
+ result._extrudedHeight = extrudedHeight;
+ result._granularity = granularity;
+ result._stRotation = stRotation;
+ result._perPositionHeightExtrude = perPositionHeightExtrude;
+ result._perPositionHeight = perPositionHeight;
+ result._closeTop = closeTop;
+ result._closeBottom = closeBottom;
+ result._shadowVolume = shadowVolume;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ result._arcType = arcType;
+ result._textureCoordinates = textureCoordinates;
+ result.packedLength = packedLength;
+ return result;
+};
+PolygonGeometry.computeRectangle = function(options, result) {
+ Check_default.typeOf.object("options", options);
+ Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ const arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
+ if (arcType !== ArcType_default.GEODESIC && arcType !== ArcType_default.RHUMB) {
+ throw new DeveloperError_default(
+ "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
+ );
+ }
+ const polygonHierarchy = options.polygonHierarchy;
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ return computeRectangle3(
+ polygonHierarchy.positions,
+ ellipsoid,
+ arcType,
+ granularity,
+ result
+ );
+};
+PolygonGeometry.createGeometry = function(polygonGeometry) {
+ const vertexFormat = polygonGeometry._vertexFormat;
+ const ellipsoid = polygonGeometry._ellipsoid;
+ const granularity = polygonGeometry._granularity;
+ const stRotation = polygonGeometry._stRotation;
+ const polygonHierarchy = polygonGeometry._polygonHierarchy;
+ const perPositionHeight = polygonGeometry._perPositionHeight;
+ const closeTop = polygonGeometry._closeTop;
+ const closeBottom = polygonGeometry._closeBottom;
+ const arcType = polygonGeometry._arcType;
+ const textureCoordinates = polygonGeometry._textureCoordinates;
+ const hasTextureCoordinates = defined_default(textureCoordinates);
+ let outerPositions = polygonHierarchy.positions;
+ if (outerPositions.length < 3) {
+ return;
+ }
+ const tangentPlane = EllipsoidTangentPlane_default.fromPoints(
+ outerPositions,
+ ellipsoid
+ );
+ const results = PolygonGeometryLibrary_default.polygonsFromHierarchy(
+ polygonHierarchy,
+ hasTextureCoordinates,
+ tangentPlane.projectPointsOntoPlane.bind(tangentPlane),
+ !perPositionHeight,
+ ellipsoid
+ );
+ const hierarchy = results.hierarchy;
+ const polygons = results.polygons;
+ const dummyFunction = function(identity) {
+ return identity;
+ };
+ const textureCoordinatePolygons = hasTextureCoordinates ? PolygonGeometryLibrary_default.polygonsFromHierarchy(
+ textureCoordinates,
+ true,
+ dummyFunction,
+ false
+ ).polygons : void 0;
+ if (hierarchy.length === 0) {
+ return;
+ }
+ outerPositions = hierarchy[0].outerRing;
+ const boundingRectangle = PolygonGeometryLibrary_default.computeBoundingRectangle(
+ tangentPlane.plane.normal,
+ tangentPlane.projectPointOntoPlane.bind(tangentPlane),
+ outerPositions,
+ stRotation,
+ scratchBoundingRectangle
+ );
+ const geometries = [];
+ const height = polygonGeometry._height;
+ const extrudedHeight = polygonGeometry._extrudedHeight;
+ const extrude = polygonGeometry._perPositionHeightExtrude || !Math_default.equalsEpsilon(height, extrudedHeight, 0, Math_default.EPSILON2);
+ const options = {
+ perPositionHeight,
+ vertexFormat,
+ geometry: void 0,
+ tangentPlane,
+ boundingRectangle,
+ ellipsoid,
+ stRotation,
+ textureCoordinates: void 0,
+ bottom: false,
+ top: true,
+ wall: false,
+ extrude: false,
+ arcType
+ };
+ let i;
+ if (extrude) {
+ options.extrude = true;
+ options.top = closeTop;
+ options.bottom = closeBottom;
+ options.shadowVolume = polygonGeometry._shadowVolume;
+ options.offsetAttribute = polygonGeometry._offsetAttribute;
+ for (i = 0; i < polygons.length; i++) {
+ const splitGeometry = createGeometryFromPositionsExtruded(
+ ellipsoid,
+ polygons[i],
+ hasTextureCoordinates ? textureCoordinatePolygons[i] : void 0,
+ granularity,
+ hierarchy[i],
+ perPositionHeight,
+ closeTop,
+ closeBottom,
+ vertexFormat,
+ arcType
+ );
+ let topAndBottom;
+ if (closeTop && closeBottom) {
+ topAndBottom = splitGeometry.topAndBottom;
+ options.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
+ topAndBottom.geometry,
+ height,
+ extrudedHeight,
+ ellipsoid,
+ perPositionHeight
+ );
+ } else if (closeTop) {
+ topAndBottom = splitGeometry.topAndBottom;
+ topAndBottom.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
+ topAndBottom.geometry.attributes.position.values,
+ height,
+ ellipsoid,
+ !perPositionHeight
+ );
+ options.geometry = topAndBottom.geometry;
+ } else if (closeBottom) {
+ topAndBottom = splitGeometry.topAndBottom;
+ topAndBottom.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
+ topAndBottom.geometry.attributes.position.values,
+ extrudedHeight,
+ ellipsoid,
+ true
+ );
+ options.geometry = topAndBottom.geometry;
+ }
+ if (closeTop || closeBottom) {
+ options.wall = false;
+ topAndBottom.geometry = computeAttributes(options);
+ geometries.push(topAndBottom);
+ }
+ const walls = splitGeometry.walls;
+ options.wall = true;
+ for (let k = 0; k < walls.length; k++) {
+ const wall = walls[k];
+ options.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
+ wall.geometry,
+ height,
+ extrudedHeight,
+ ellipsoid,
+ perPositionHeight
+ );
+ wall.geometry = computeAttributes(options);
+ geometries.push(wall);
+ }
+ }
+ } else {
+ for (i = 0; i < polygons.length; i++) {
+ const geometryInstance = new GeometryInstance_default({
+ geometry: PolygonGeometryLibrary_default.createGeometryFromPositions(
+ ellipsoid,
+ polygons[i],
+ hasTextureCoordinates ? textureCoordinatePolygons[i] : void 0,
+ granularity,
+ perPositionHeight,
+ vertexFormat,
+ arcType
+ )
+ });
+ geometryInstance.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
+ geometryInstance.geometry.attributes.position.values,
+ height,
+ ellipsoid,
+ !perPositionHeight
+ );
+ options.geometry = geometryInstance.geometry;
+ geometryInstance.geometry = computeAttributes(options);
+ if (defined_default(polygonGeometry._offsetAttribute)) {
+ const length3 = geometryInstance.geometry.attributes.position.values.length;
+ const offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default(
+ {
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ }
+ );
+ }
+ geometries.push(geometryInstance);
+ }
+ }
+ const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
+ geometry.attributes.position.values = new Float64Array(
+ geometry.attributes.position.values
+ );
+ geometry.indices = IndexDatatype_default.createTypedArray(
+ geometry.attributes.position.values.length / 3,
+ geometry.indices
+ );
+ const attributes = geometry.attributes;
+ const boundingSphere = BoundingSphere_default.fromVertices(
+ attributes.position.values
+ );
+ if (!vertexFormat.position) {
+ delete attributes.position;
+ }
+ return new Geometry_default({
+ attributes,
+ indices: geometry.indices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere,
+ offsetAttribute: polygonGeometry._offsetAttribute
+ });
+};
+PolygonGeometry.createShadowVolume = function(polygonGeometry, minHeightFunc, maxHeightFunc) {
+ const granularity = polygonGeometry._granularity;
+ const ellipsoid = polygonGeometry._ellipsoid;
+ const minHeight = minHeightFunc(granularity, ellipsoid);
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
+ return new PolygonGeometry({
+ polygonHierarchy: polygonGeometry._polygonHierarchy,
+ ellipsoid,
+ stRotation: polygonGeometry._stRotation,
+ granularity,
+ perPositionHeight: false,
+ extrudedHeight: minHeight,
+ height: maxHeight,
+ vertexFormat: VertexFormat_default.POSITION_ONLY,
+ shadowVolume: true,
+ arcType: polygonGeometry._arcType
+ });
+};
+function textureCoordinateRotationPoints2(polygonGeometry) {
+ const stRotation = -polygonGeometry._stRotation;
+ if (stRotation === 0) {
+ return [0, 0, 0, 1, 1, 0];
+ }
+ const ellipsoid = polygonGeometry._ellipsoid;
+ const positions = polygonGeometry._polygonHierarchy.positions;
+ const boundingRectangle = polygonGeometry.rectangle;
+ return Geometry_default._textureCoordinateRotationPoints(
+ positions,
+ stRotation,
+ ellipsoid,
+ boundingRectangle
+ );
+}
+Object.defineProperties(PolygonGeometry.prototype, {
+ rectangle: {
+ get: function() {
+ if (!defined_default(this._rectangle)) {
+ const positions = this._polygonHierarchy.positions;
+ this._rectangle = computeRectangle3(
+ positions,
+ this._ellipsoid,
+ this._arcType,
+ this._granularity
+ );
+ }
+ return this._rectangle;
+ }
+ },
+ textureCoordinateRotationPoints: {
+ get: function() {
+ if (!defined_default(this._textureCoordinateRotationPoints)) {
+ this._textureCoordinateRotationPoints = textureCoordinateRotationPoints2(
+ this
+ );
+ }
+ return this._textureCoordinateRotationPoints;
+ }
+ }
+});
+var PolygonGeometry_default = PolygonGeometry;
+
+// Source/Core/PolygonOutlineGeometry.js
+var createGeometryFromPositionsPositions = [];
+var createGeometryFromPositionsSubdivided = [];
+function createGeometryFromPositions2(ellipsoid, positions, minDistance, perPositionHeight, arcType) {
+ const tangentPlane = EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
+ const positions2D = tangentPlane.projectPointsOntoPlane(
+ positions,
+ createGeometryFromPositionsPositions
+ );
+ const originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(
+ positions2D
+ );
+ if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
+ positions2D.reverse();
+ positions = positions.slice().reverse();
+ }
+ let subdividedPositions;
+ let i;
+ let length3 = positions.length;
+ let index = 0;
+ if (!perPositionHeight) {
+ let numVertices = 0;
+ if (arcType === ArcType_default.GEODESIC) {
+ for (i = 0; i < length3; i++) {
+ numVertices += PolygonGeometryLibrary_default.subdivideLineCount(
+ positions[i],
+ positions[(i + 1) % length3],
+ minDistance
+ );
+ }
+ } else if (arcType === ArcType_default.RHUMB) {
+ for (i = 0; i < length3; i++) {
+ numVertices += PolygonGeometryLibrary_default.subdivideRhumbLineCount(
+ ellipsoid,
+ positions[i],
+ positions[(i + 1) % length3],
+ minDistance
+ );
+ }
+ }
+ subdividedPositions = new Float64Array(numVertices * 3);
+ for (i = 0; i < length3; i++) {
+ let tempPositions;
+ if (arcType === ArcType_default.GEODESIC) {
+ tempPositions = PolygonGeometryLibrary_default.subdivideLine(
+ positions[i],
+ positions[(i + 1) % length3],
+ minDistance,
+ createGeometryFromPositionsSubdivided
+ );
+ } else if (arcType === ArcType_default.RHUMB) {
+ tempPositions = PolygonGeometryLibrary_default.subdivideRhumbLine(
+ ellipsoid,
+ positions[i],
+ positions[(i + 1) % length3],
+ minDistance,
+ createGeometryFromPositionsSubdivided
+ );
+ }
+ const tempPositionsLength = tempPositions.length;
+ for (let j = 0; j < tempPositionsLength; ++j) {
+ subdividedPositions[index++] = tempPositions[j];
+ }
+ }
+ } else {
+ subdividedPositions = new Float64Array(length3 * 2 * 3);
+ for (i = 0; i < length3; i++) {
+ const p0 = positions[i];
+ const p1 = positions[(i + 1) % length3];
+ subdividedPositions[index++] = p0.x;
+ subdividedPositions[index++] = p0.y;
+ subdividedPositions[index++] = p0.z;
+ subdividedPositions[index++] = p1.x;
+ subdividedPositions[index++] = p1.y;
+ subdividedPositions[index++] = p1.z;
+ }
+ }
+ length3 = subdividedPositions.length / 3;
+ const indicesSize = length3 * 2;
+ const indices2 = IndexDatatype_default.createTypedArray(length3, indicesSize);
+ index = 0;
+ for (i = 0; i < length3 - 1; i++) {
+ indices2[index++] = i;
+ indices2[index++] = i + 1;
+ }
+ indices2[index++] = length3 - 1;
+ indices2[index++] = 0;
+ return new GeometryInstance_default({
+ geometry: new Geometry_default({
+ attributes: new GeometryAttributes_default({
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: subdividedPositions
+ })
+ }),
+ indices: indices2,
+ primitiveType: PrimitiveType_default.LINES
+ })
+ });
+}
+function createGeometryFromPositionsExtruded2(ellipsoid, positions, minDistance, perPositionHeight, arcType) {
+ const tangentPlane = EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
+ const positions2D = tangentPlane.projectPointsOntoPlane(
+ positions,
+ createGeometryFromPositionsPositions
+ );
+ const originalWindingOrder = PolygonPipeline_default.computeWindingOrder2D(
+ positions2D
+ );
+ if (originalWindingOrder === WindingOrder_default.CLOCKWISE) {
+ positions2D.reverse();
+ positions = positions.slice().reverse();
+ }
+ let subdividedPositions;
+ let i;
+ let length3 = positions.length;
+ const corners = new Array(length3);
+ let index = 0;
+ if (!perPositionHeight) {
+ let numVertices = 0;
+ if (arcType === ArcType_default.GEODESIC) {
+ for (i = 0; i < length3; i++) {
+ numVertices += PolygonGeometryLibrary_default.subdivideLineCount(
+ positions[i],
+ positions[(i + 1) % length3],
+ minDistance
+ );
+ }
+ } else if (arcType === ArcType_default.RHUMB) {
+ for (i = 0; i < length3; i++) {
+ numVertices += PolygonGeometryLibrary_default.subdivideRhumbLineCount(
+ ellipsoid,
+ positions[i],
+ positions[(i + 1) % length3],
+ minDistance
+ );
+ }
+ }
+ subdividedPositions = new Float64Array(numVertices * 3 * 2);
+ for (i = 0; i < length3; ++i) {
+ corners[i] = index / 3;
+ let tempPositions;
+ if (arcType === ArcType_default.GEODESIC) {
+ tempPositions = PolygonGeometryLibrary_default.subdivideLine(
+ positions[i],
+ positions[(i + 1) % length3],
+ minDistance,
+ createGeometryFromPositionsSubdivided
+ );
+ } else if (arcType === ArcType_default.RHUMB) {
+ tempPositions = PolygonGeometryLibrary_default.subdivideRhumbLine(
+ ellipsoid,
+ positions[i],
+ positions[(i + 1) % length3],
+ minDistance,
+ createGeometryFromPositionsSubdivided
+ );
+ }
+ const tempPositionsLength = tempPositions.length;
+ for (let j = 0; j < tempPositionsLength; ++j) {
+ subdividedPositions[index++] = tempPositions[j];
+ }
+ }
+ } else {
+ subdividedPositions = new Float64Array(length3 * 2 * 3 * 2);
+ for (i = 0; i < length3; ++i) {
+ corners[i] = index / 3;
+ const p0 = positions[i];
+ const p1 = positions[(i + 1) % length3];
+ subdividedPositions[index++] = p0.x;
+ subdividedPositions[index++] = p0.y;
+ subdividedPositions[index++] = p0.z;
+ subdividedPositions[index++] = p1.x;
+ subdividedPositions[index++] = p1.y;
+ subdividedPositions[index++] = p1.z;
+ }
+ }
+ length3 = subdividedPositions.length / (3 * 2);
+ const cornersLength = corners.length;
+ const indicesSize = (length3 * 2 + cornersLength) * 2;
+ const indices2 = IndexDatatype_default.createTypedArray(
+ length3 + cornersLength,
+ indicesSize
+ );
+ index = 0;
+ for (i = 0; i < length3; ++i) {
+ indices2[index++] = i;
+ indices2[index++] = (i + 1) % length3;
+ indices2[index++] = i + length3;
+ indices2[index++] = (i + 1) % length3 + length3;
+ }
+ for (i = 0; i < cornersLength; i++) {
+ const corner = corners[i];
+ indices2[index++] = corner;
+ indices2[index++] = corner + length3;
+ }
+ return new GeometryInstance_default({
+ geometry: new Geometry_default({
+ attributes: new GeometryAttributes_default({
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: subdividedPositions
+ })
+ }),
+ indices: indices2,
+ primitiveType: PrimitiveType_default.LINES
+ })
+ });
+}
+function PolygonOutlineGeometry(options) {
+ Check_default.typeOf.object("options", options);
+ Check_default.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
+ if (options.perPositionHeight && defined_default(options.height)) {
+ throw new DeveloperError_default(
+ "Cannot use both options.perPositionHeight and options.height"
+ );
+ }
+ if (defined_default(options.arcType) && options.arcType !== ArcType_default.GEODESIC && options.arcType !== ArcType_default.RHUMB) {
+ throw new DeveloperError_default(
+ "Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
+ );
+ }
+ const polygonHierarchy = options.polygonHierarchy;
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ const perPositionHeight = defaultValue_default(options.perPositionHeight, false);
+ const perPositionHeightExtrude = perPositionHeight && defined_default(options.extrudedHeight);
+ const arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
+ let height = defaultValue_default(options.height, 0);
+ let extrudedHeight = defaultValue_default(options.extrudedHeight, height);
+ if (!perPositionHeightExtrude) {
+ const h = Math.max(height, extrudedHeight);
+ extrudedHeight = Math.min(height, extrudedHeight);
+ height = h;
+ }
+ this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
+ this._granularity = granularity;
+ this._height = height;
+ this._extrudedHeight = extrudedHeight;
+ this._arcType = arcType;
+ this._polygonHierarchy = polygonHierarchy;
+ this._perPositionHeight = perPositionHeight;
+ this._perPositionHeightExtrude = perPositionHeightExtrude;
+ this._offsetAttribute = options.offsetAttribute;
+ this._workerName = "createPolygonOutlineGeometry";
+ this.packedLength = PolygonGeometryLibrary_default.computeHierarchyPackedLength(
+ polygonHierarchy,
+ Cartesian3_default
+ ) + Ellipsoid_default.packedLength + 8;
+}
+PolygonOutlineGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ startingIndex = PolygonGeometryLibrary_default.packPolygonHierarchy(
+ value._polygonHierarchy,
+ array,
+ startingIndex,
+ Cartesian3_default
+ );
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ array[startingIndex++] = value._height;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._perPositionHeightExtrude ? 1 : 0;
+ array[startingIndex++] = value._perPositionHeight ? 1 : 0;
+ array[startingIndex++] = value._arcType;
+ array[startingIndex++] = defaultValue_default(value._offsetAttribute, -1);
+ array[startingIndex] = value.packedLength;
+ return array;
+};
+var scratchEllipsoid8 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var dummyOptions2 = {
+ polygonHierarchy: {}
+};
+PolygonOutlineGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const polygonHierarchy = PolygonGeometryLibrary_default.unpackPolygonHierarchy(
+ array,
+ startingIndex,
+ Cartesian3_default
+ );
+ startingIndex = polygonHierarchy.startingIndex;
+ delete polygonHierarchy.startingIndex;
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid8);
+ startingIndex += Ellipsoid_default.packedLength;
+ const height = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const granularity = array[startingIndex++];
+ const perPositionHeightExtrude = array[startingIndex++] === 1;
+ const perPositionHeight = array[startingIndex++] === 1;
+ const arcType = array[startingIndex++];
+ const offsetAttribute = array[startingIndex++];
+ const packedLength = array[startingIndex];
+ if (!defined_default(result)) {
+ result = new PolygonOutlineGeometry(dummyOptions2);
+ }
+ result._polygonHierarchy = polygonHierarchy;
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._height = height;
+ result._extrudedHeight = extrudedHeight;
+ result._granularity = granularity;
+ result._perPositionHeight = perPositionHeight;
+ result._perPositionHeightExtrude = perPositionHeightExtrude;
+ result._arcType = arcType;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ result.packedLength = packedLength;
+ return result;
+};
+PolygonOutlineGeometry.fromPositions = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ Check_default.defined("options.positions", options.positions);
+ const newOptions2 = {
+ polygonHierarchy: {
+ positions: options.positions
+ },
+ height: options.height,
+ extrudedHeight: options.extrudedHeight,
+ ellipsoid: options.ellipsoid,
+ granularity: options.granularity,
+ perPositionHeight: options.perPositionHeight,
+ arcType: options.arcType,
+ offsetAttribute: options.offsetAttribute
+ };
+ return new PolygonOutlineGeometry(newOptions2);
+};
+PolygonOutlineGeometry.createGeometry = function(polygonGeometry) {
+ const ellipsoid = polygonGeometry._ellipsoid;
+ const granularity = polygonGeometry._granularity;
+ const polygonHierarchy = polygonGeometry._polygonHierarchy;
+ const perPositionHeight = polygonGeometry._perPositionHeight;
+ const arcType = polygonGeometry._arcType;
+ const polygons = PolygonGeometryLibrary_default.polygonOutlinesFromHierarchy(
+ polygonHierarchy,
+ !perPositionHeight,
+ ellipsoid
+ );
+ if (polygons.length === 0) {
+ return void 0;
+ }
+ let geometryInstance;
+ const geometries = [];
+ const minDistance = Math_default.chordLength(
+ granularity,
+ ellipsoid.maximumRadius
+ );
+ const height = polygonGeometry._height;
+ const extrudedHeight = polygonGeometry._extrudedHeight;
+ const extrude = polygonGeometry._perPositionHeightExtrude || !Math_default.equalsEpsilon(height, extrudedHeight, 0, Math_default.EPSILON2);
+ let offsetValue;
+ let i;
+ if (extrude) {
+ for (i = 0; i < polygons.length; i++) {
+ geometryInstance = createGeometryFromPositionsExtruded2(
+ ellipsoid,
+ polygons[i],
+ minDistance,
+ perPositionHeight,
+ arcType
+ );
+ geometryInstance.geometry = PolygonGeometryLibrary_default.scaleToGeodeticHeightExtruded(
+ geometryInstance.geometry,
+ height,
+ extrudedHeight,
+ ellipsoid,
+ perPositionHeight
+ );
+ if (defined_default(polygonGeometry._offsetAttribute)) {
+ const size = geometryInstance.geometry.attributes.position.values.length / 3;
+ let offsetAttribute = new Uint8Array(size);
+ if (polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.TOP) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else {
+ offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+ geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default(
+ {
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute
+ }
+ );
+ }
+ geometries.push(geometryInstance);
+ }
+ } else {
+ for (i = 0; i < polygons.length; i++) {
+ geometryInstance = createGeometryFromPositions2(
+ ellipsoid,
+ polygons[i],
+ minDistance,
+ perPositionHeight,
+ arcType
+ );
+ geometryInstance.geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
+ geometryInstance.geometry.attributes.position.values,
+ height,
+ ellipsoid,
+ !perPositionHeight
+ );
+ if (defined_default(polygonGeometry._offsetAttribute)) {
+ const length3 = geometryInstance.geometry.attributes.position.values.length;
+ offsetValue = polygonGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ geometryInstance.geometry.attributes.applyOffset = new GeometryAttribute_default(
+ {
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ }
+ );
+ }
+ geometries.push(geometryInstance);
+ }
+ }
+ const geometry = GeometryPipeline_default.combineInstances(geometries)[0];
+ const boundingSphere = BoundingSphere_default.fromVertices(
+ geometry.attributes.position.values
+ );
+ return new Geometry_default({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere,
+ offsetAttribute: polygonGeometry._offsetAttribute
+ });
+};
+var PolygonOutlineGeometry_default = PolygonOutlineGeometry;
+
+// Source/DataSources/PolygonGeometryUpdater.js
+var heightAndPerPositionHeightWarning = "Entity polygons cannot have both height and perPositionHeight. height will be ignored";
+var heightReferenceAndPerPositionHeightWarning = "heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored";
+var scratchColor16 = new Color_default();
+var defaultOffset7 = Cartesian3_default.ZERO;
+var offsetScratch9 = new Cartesian3_default();
+var scratchRectangle6 = new Rectangle_default();
+var scratch2DPositions = [];
+var cart2Scratch = new Cartesian2_default();
+function PolygonGeometryOptions(entity) {
+ this.id = entity;
+ this.vertexFormat = void 0;
+ this.polygonHierarchy = void 0;
+ this.perPositionHeight = void 0;
+ this.closeTop = void 0;
+ this.closeBottom = void 0;
+ this.height = void 0;
+ this.extrudedHeight = void 0;
+ this.granularity = void 0;
+ this.stRotation = void 0;
+ this.offsetAttribute = void 0;
+ this.arcType = void 0;
+ this.textureCoordinates = void 0;
+}
+function PolygonGeometryUpdater(entity, scene) {
+ GroundGeometryUpdater_default.call(this, {
+ entity,
+ scene,
+ geometryOptions: new PolygonGeometryOptions(entity),
+ geometryPropertyName: "polygon",
+ observedPropertyNames: ["availability", "polygon"]
+ });
+ this._onEntityPropertyChanged(entity, "polygon", entity.polygon, void 0);
+}
+if (defined_default(Object.create)) {
+ PolygonGeometryUpdater.prototype = Object.create(
+ GroundGeometryUpdater_default.prototype
+ );
+ PolygonGeometryUpdater.prototype.constructor = PolygonGeometryUpdater;
+}
+PolygonGeometryUpdater.prototype.createFillGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._fillEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent a filled geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const options = this._options;
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time)
+ ),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ this._distanceDisplayConditionProperty.getValue(time)
+ ),
+ offset: void 0,
+ color: void 0
+ };
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ let currentColor;
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor16);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ attributes.color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ }
+ if (defined_default(options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset7,
+ offsetScratch9
+ )
+ );
+ }
+ let geometry;
+ if (options.perPositionHeight && !defined_default(options.extrudedHeight)) {
+ geometry = new CoplanarPolygonGeometry_default(options);
+ } else {
+ geometry = new PolygonGeometry_default(options);
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry,
+ attributes
+ });
+};
+PolygonGeometryUpdater.prototype.createOutlineGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._outlineEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent an outlined geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const options = this._options;
+ const outlineColor = Property_default.getValueOrDefault(
+ this._outlineColorProperty,
+ time,
+ Color_default.BLACK,
+ scratchColor16
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)
+ ),
+ color: ColorGeometryInstanceAttribute_default.fromColor(outlineColor),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ ),
+ offset: void 0
+ };
+ if (defined_default(options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset7,
+ offsetScratch9
+ )
+ );
+ }
+ let geometry;
+ if (options.perPositionHeight && !defined_default(options.extrudedHeight)) {
+ geometry = new CoplanarPolygonOutlineGeometry_default(options);
+ } else {
+ geometry = new PolygonOutlineGeometry_default(options);
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry,
+ attributes
+ });
+};
+PolygonGeometryUpdater.prototype._computeCenter = function(time, result) {
+ const hierarchy = Property_default.getValueOrUndefined(
+ this._entity.polygon.hierarchy,
+ time
+ );
+ if (!defined_default(hierarchy)) {
+ return;
+ }
+ const positions = hierarchy.positions;
+ if (positions.length === 0) {
+ return;
+ }
+ const ellipsoid = this._scene.mapProjection.ellipsoid;
+ const tangentPlane = EllipsoidTangentPlane_default.fromPoints(positions, ellipsoid);
+ const positions2D = tangentPlane.projectPointsOntoPlane(
+ positions,
+ scratch2DPositions
+ );
+ const length3 = positions2D.length;
+ let area = 0;
+ let j = length3 - 1;
+ let centroid2D = new Cartesian2_default();
+ for (let i = 0; i < length3; j = i++) {
+ const p1 = positions2D[i];
+ const p2 = positions2D[j];
+ const f = p1.x * p2.y - p2.x * p1.y;
+ let sum = Cartesian2_default.add(p1, p2, cart2Scratch);
+ sum = Cartesian2_default.multiplyByScalar(sum, f, sum);
+ centroid2D = Cartesian2_default.add(centroid2D, sum, centroid2D);
+ area += f;
+ }
+ const a3 = 1 / (area * 3);
+ centroid2D = Cartesian2_default.multiplyByScalar(centroid2D, a3, centroid2D);
+ return tangentPlane.projectPointOntoEllipsoid(centroid2D, result);
+};
+PolygonGeometryUpdater.prototype._isHidden = function(entity, polygon) {
+ return !defined_default(polygon.hierarchy) || GeometryUpdater_default.prototype._isHidden.call(this, entity, polygon);
+};
+PolygonGeometryUpdater.prototype._isOnTerrain = function(entity, polygon) {
+ const onTerrain = GroundGeometryUpdater_default.prototype._isOnTerrain.call(
+ this,
+ entity,
+ polygon
+ );
+ const perPositionHeightProperty = polygon.perPositionHeight;
+ const perPositionHeightEnabled = defined_default(perPositionHeightProperty) && (perPositionHeightProperty.isConstant ? perPositionHeightProperty.getValue(Iso8601_default.MINIMUM_VALUE) : true);
+ return onTerrain && !perPositionHeightEnabled;
+};
+PolygonGeometryUpdater.prototype._isDynamic = function(entity, polygon) {
+ return !polygon.hierarchy.isConstant || !Property_default.isConstant(polygon.height) || !Property_default.isConstant(polygon.extrudedHeight) || !Property_default.isConstant(polygon.granularity) || !Property_default.isConstant(polygon.stRotation) || !Property_default.isConstant(polygon.textureCoordinates) || !Property_default.isConstant(polygon.outlineWidth) || !Property_default.isConstant(polygon.perPositionHeight) || !Property_default.isConstant(polygon.closeTop) || !Property_default.isConstant(polygon.closeBottom) || !Property_default.isConstant(polygon.zIndex) || !Property_default.isConstant(polygon.arcType) || this._onTerrain && !Property_default.isConstant(this._materialProperty) && !(this._materialProperty instanceof ColorMaterialProperty_default);
+};
+PolygonGeometryUpdater.prototype._setStaticOptions = function(entity, polygon) {
+ const isColorMaterial = this._materialProperty instanceof ColorMaterialProperty_default;
+ const options = this._options;
+ options.vertexFormat = isColorMaterial ? PerInstanceColorAppearance_default.VERTEX_FORMAT : MaterialAppearance_default.MaterialSupport.TEXTURED.vertexFormat;
+ const hierarchyValue = polygon.hierarchy.getValue(Iso8601_default.MINIMUM_VALUE);
+ let heightValue = Property_default.getValueOrUndefined(
+ polygon.height,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ const heightReferenceValue = Property_default.getValueOrDefault(
+ polygon.heightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ let extrudedHeightValue = Property_default.getValueOrUndefined(
+ polygon.extrudedHeight,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ const extrudedHeightReferenceValue = Property_default.getValueOrDefault(
+ polygon.extrudedHeightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ const perPositionHeightValue = Property_default.getValueOrDefault(
+ polygon.perPositionHeight,
+ Iso8601_default.MINIMUM_VALUE,
+ false
+ );
+ heightValue = GroundGeometryUpdater_default.getGeometryHeight(
+ heightValue,
+ heightReferenceValue
+ );
+ let offsetAttribute;
+ if (perPositionHeightValue) {
+ if (defined_default(heightValue)) {
+ heightValue = void 0;
+ oneTimeWarning_default(heightAndPerPositionHeightWarning);
+ }
+ if (heightReferenceValue !== HeightReference_default.NONE && perPositionHeightValue) {
+ heightValue = void 0;
+ oneTimeWarning_default(heightReferenceAndPerPositionHeightWarning);
+ }
+ } else {
+ if (defined_default(extrudedHeightValue) && !defined_default(heightValue)) {
+ heightValue = 0;
+ }
+ offsetAttribute = GroundGeometryUpdater_default.computeGeometryOffsetAttribute(
+ heightValue,
+ heightReferenceValue,
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ }
+ options.polygonHierarchy = hierarchyValue;
+ options.granularity = Property_default.getValueOrUndefined(
+ polygon.granularity,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.stRotation = Property_default.getValueOrUndefined(
+ polygon.stRotation,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.perPositionHeight = perPositionHeightValue;
+ options.closeTop = Property_default.getValueOrDefault(
+ polygon.closeTop,
+ Iso8601_default.MINIMUM_VALUE,
+ true
+ );
+ options.closeBottom = Property_default.getValueOrDefault(
+ polygon.closeBottom,
+ Iso8601_default.MINIMUM_VALUE,
+ true
+ );
+ options.offsetAttribute = offsetAttribute;
+ options.height = heightValue;
+ options.arcType = Property_default.getValueOrDefault(
+ polygon.arcType,
+ Iso8601_default.MINIMUM_VALUE,
+ ArcType_default.GEODESIC
+ );
+ options.textureCoordinates = Property_default.getValueOrUndefined(
+ polygon.textureCoordinates,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ extrudedHeightValue = GroundGeometryUpdater_default.getGeometryExtrudedHeight(
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ if (extrudedHeightValue === GroundGeometryUpdater_default.CLAMP_TO_GROUND) {
+ extrudedHeightValue = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ PolygonGeometry_default.computeRectangle(options, scratchRectangle6)
+ ).minimumTerrainHeight;
+ }
+ options.extrudedHeight = extrudedHeightValue;
+};
+PolygonGeometryUpdater.prototype._getIsClosed = function(options) {
+ const height = options.height;
+ const extrudedHeight = options.extrudedHeight;
+ const isExtruded = defined_default(extrudedHeight) && extrudedHeight !== height;
+ return !options.perPositionHeight && (!isExtruded && height === 0 || isExtruded && options.closeTop && options.closeBottom);
+};
+PolygonGeometryUpdater.DynamicGeometryUpdater = DyanmicPolygonGeometryUpdater;
+function DyanmicPolygonGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
+ DynamicGeometryUpdater_default.call(
+ this,
+ geometryUpdater,
+ primitives,
+ groundPrimitives
+ );
+}
+if (defined_default(Object.create)) {
+ DyanmicPolygonGeometryUpdater.prototype = Object.create(
+ DynamicGeometryUpdater_default.prototype
+ );
+ DyanmicPolygonGeometryUpdater.prototype.constructor = DyanmicPolygonGeometryUpdater;
+}
+DyanmicPolygonGeometryUpdater.prototype._isHidden = function(entity, polygon, time) {
+ return !defined_default(this._options.polygonHierarchy) || DynamicGeometryUpdater_default.prototype._isHidden.call(this, entity, polygon, time);
+};
+DyanmicPolygonGeometryUpdater.prototype._setOptions = function(entity, polygon, time) {
+ const options = this._options;
+ options.polygonHierarchy = Property_default.getValueOrUndefined(
+ polygon.hierarchy,
+ time
+ );
+ let heightValue = Property_default.getValueOrUndefined(polygon.height, time);
+ const heightReferenceValue = Property_default.getValueOrDefault(
+ polygon.heightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ const extrudedHeightReferenceValue = Property_default.getValueOrDefault(
+ polygon.extrudedHeightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ let extrudedHeightValue = Property_default.getValueOrUndefined(
+ polygon.extrudedHeight,
+ time
+ );
+ const perPositionHeightValue = Property_default.getValueOrUndefined(
+ polygon.perPositionHeight,
+ time
+ );
+ heightValue = GroundGeometryUpdater_default.getGeometryHeight(
+ heightValue,
+ extrudedHeightReferenceValue
+ );
+ let offsetAttribute;
+ if (perPositionHeightValue) {
+ if (defined_default(heightValue)) {
+ heightValue = void 0;
+ oneTimeWarning_default(heightAndPerPositionHeightWarning);
+ }
+ if (heightReferenceValue !== HeightReference_default.NONE && perPositionHeightValue) {
+ heightValue = void 0;
+ oneTimeWarning_default(heightReferenceAndPerPositionHeightWarning);
+ }
+ } else {
+ if (defined_default(extrudedHeightValue) && !defined_default(heightValue)) {
+ heightValue = 0;
+ }
+ offsetAttribute = GroundGeometryUpdater_default.computeGeometryOffsetAttribute(
+ heightValue,
+ heightReferenceValue,
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ }
+ options.granularity = Property_default.getValueOrUndefined(polygon.granularity, time);
+ options.stRotation = Property_default.getValueOrUndefined(polygon.stRotation, time);
+ options.textureCoordinates = Property_default.getValueOrUndefined(
+ polygon.textureCoordinates,
+ time
+ );
+ options.perPositionHeight = Property_default.getValueOrUndefined(
+ polygon.perPositionHeight,
+ time
+ );
+ options.closeTop = Property_default.getValueOrDefault(polygon.closeTop, time, true);
+ options.closeBottom = Property_default.getValueOrDefault(
+ polygon.closeBottom,
+ time,
+ true
+ );
+ options.offsetAttribute = offsetAttribute;
+ options.height = heightValue;
+ options.arcType = Property_default.getValueOrDefault(
+ polygon.arcType,
+ time,
+ ArcType_default.GEODESIC
+ );
+ extrudedHeightValue = GroundGeometryUpdater_default.getGeometryExtrudedHeight(
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ if (extrudedHeightValue === GroundGeometryUpdater_default.CLAMP_TO_GROUND) {
+ extrudedHeightValue = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ PolygonGeometry_default.computeRectangle(options, scratchRectangle6)
+ ).minimumTerrainHeight;
+ }
+ options.extrudedHeight = extrudedHeightValue;
+};
+var PolygonGeometryUpdater_default = PolygonGeometryUpdater;
+
+// Source/Core/PolylineVolumeGeometry.js
+function computeAttributes2(combinedPositions, shape, boundingRectangle, vertexFormat) {
+ const attributes = new GeometryAttributes_default();
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: combinedPositions
+ });
+ }
+ const shapeLength = shape.length;
+ const vertexCount = combinedPositions.length / 3;
+ const length3 = (vertexCount - shapeLength * 2) / (shapeLength * 2);
+ const firstEndIndices = PolygonPipeline_default.triangulate(shape);
+ const indicesCount = (length3 - 1) * shapeLength * 6 + firstEndIndices.length * 2;
+ const indices2 = IndexDatatype_default.createTypedArray(vertexCount, indicesCount);
+ let i, j;
+ let ll, ul, ur, lr;
+ const offset2 = shapeLength * 2;
+ let index = 0;
+ for (i = 0; i < length3 - 1; i++) {
+ for (j = 0; j < shapeLength - 1; j++) {
+ ll = j * 2 + i * shapeLength * 2;
+ lr = ll + offset2;
+ ul = ll + 1;
+ ur = ul + offset2;
+ indices2[index++] = ul;
+ indices2[index++] = ll;
+ indices2[index++] = ur;
+ indices2[index++] = ur;
+ indices2[index++] = ll;
+ indices2[index++] = lr;
+ }
+ ll = shapeLength * 2 - 2 + i * shapeLength * 2;
+ ul = ll + 1;
+ ur = ul + offset2;
+ lr = ll + offset2;
+ indices2[index++] = ul;
+ indices2[index++] = ll;
+ indices2[index++] = ur;
+ indices2[index++] = ur;
+ indices2[index++] = ll;
+ indices2[index++] = lr;
+ }
+ if (vertexFormat.st || vertexFormat.tangent || vertexFormat.bitangent) {
+ const st = new Float32Array(vertexCount * 2);
+ const lengthSt = 1 / (length3 - 1);
+ const heightSt = 1 / boundingRectangle.height;
+ const heightOffset = boundingRectangle.height / 2;
+ let s, t;
+ let stindex = 0;
+ for (i = 0; i < length3; i++) {
+ s = i * lengthSt;
+ t = heightSt * (shape[0].y + heightOffset);
+ st[stindex++] = s;
+ st[stindex++] = t;
+ for (j = 1; j < shapeLength; j++) {
+ t = heightSt * (shape[j].y + heightOffset);
+ st[stindex++] = s;
+ st[stindex++] = t;
+ st[stindex++] = s;
+ st[stindex++] = t;
+ }
+ t = heightSt * (shape[0].y + heightOffset);
+ st[stindex++] = s;
+ st[stindex++] = t;
+ }
+ for (j = 0; j < shapeLength; j++) {
+ s = 0;
+ t = heightSt * (shape[j].y + heightOffset);
+ st[stindex++] = s;
+ st[stindex++] = t;
+ }
+ for (j = 0; j < shapeLength; j++) {
+ s = (length3 - 1) * lengthSt;
+ t = heightSt * (shape[j].y + heightOffset);
+ st[stindex++] = s;
+ st[stindex++] = t;
+ }
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: new Float32Array(st)
+ });
+ }
+ const endOffset = vertexCount - shapeLength * 2;
+ for (i = 0; i < firstEndIndices.length; i += 3) {
+ const v02 = firstEndIndices[i] + endOffset;
+ const v13 = firstEndIndices[i + 1] + endOffset;
+ const v23 = firstEndIndices[i + 2] + endOffset;
+ indices2[index++] = v02;
+ indices2[index++] = v13;
+ indices2[index++] = v23;
+ indices2[index++] = v23 + shapeLength;
+ indices2[index++] = v13 + shapeLength;
+ indices2[index++] = v02 + shapeLength;
+ }
+ let geometry = new Geometry_default({
+ attributes,
+ indices: indices2,
+ boundingSphere: BoundingSphere_default.fromVertices(combinedPositions),
+ primitiveType: PrimitiveType_default.TRIANGLES
+ });
+ if (vertexFormat.normal) {
+ geometry = GeometryPipeline_default.computeNormal(geometry);
+ }
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ try {
+ geometry = GeometryPipeline_default.computeTangentAndBitangent(geometry);
+ } catch (e) {
+ oneTimeWarning_default(
+ "polyline-volume-tangent-bitangent",
+ "Unable to compute tangents and bitangents for polyline volume geometry"
+ );
+ }
+ if (!vertexFormat.tangent) {
+ geometry.attributes.tangent = void 0;
+ }
+ if (!vertexFormat.bitangent) {
+ geometry.attributes.bitangent = void 0;
+ }
+ if (!vertexFormat.st) {
+ geometry.attributes.st = void 0;
+ }
+ }
+ return geometry;
+}
+function PolylineVolumeGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const positions = options.polylinePositions;
+ const shape = options.shapePositions;
+ if (!defined_default(positions)) {
+ throw new DeveloperError_default("options.polylinePositions is required.");
+ }
+ if (!defined_default(shape)) {
+ throw new DeveloperError_default("options.shapePositions is required.");
+ }
+ this._positions = positions;
+ this._shape = shape;
+ this._ellipsoid = Ellipsoid_default.clone(
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
+ );
+ this._cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
+ this._vertexFormat = VertexFormat_default.clone(
+ defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
+ );
+ this._granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ this._workerName = "createPolylineVolumeGeometry";
+ let numComponents = 1 + positions.length * Cartesian3_default.packedLength;
+ numComponents += 1 + shape.length * Cartesian2_default.packedLength;
+ this.packedLength = numComponents + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 2;
+}
+PolylineVolumeGeometry.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ let i;
+ const positions = value._positions;
+ let length3 = positions.length;
+ array[startingIndex++] = length3;
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ Cartesian3_default.pack(positions[i], array, startingIndex);
+ }
+ const shape = value._shape;
+ length3 = shape.length;
+ array[startingIndex++] = length3;
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian2_default.packedLength) {
+ Cartesian2_default.pack(shape[i], array, startingIndex);
+ }
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat_default.packedLength;
+ array[startingIndex++] = value._cornerType;
+ array[startingIndex] = value._granularity;
+ return array;
+};
+var scratchEllipsoid9 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchVertexFormat9 = new VertexFormat_default();
+var scratchOptions16 = {
+ polylinePositions: void 0,
+ shapePositions: void 0,
+ ellipsoid: scratchEllipsoid9,
+ vertexFormat: scratchVertexFormat9,
+ cornerType: void 0,
+ granularity: void 0
+};
+PolylineVolumeGeometry.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ let i;
+ let length3 = array[startingIndex++];
+ const positions = new Array(length3);
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
+ }
+ length3 = array[startingIndex++];
+ const shape = new Array(length3);
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian2_default.packedLength) {
+ shape[i] = Cartesian2_default.unpack(array, startingIndex);
+ }
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid9);
+ startingIndex += Ellipsoid_default.packedLength;
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat9
+ );
+ startingIndex += VertexFormat_default.packedLength;
+ const cornerType = array[startingIndex++];
+ const granularity = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions16.polylinePositions = positions;
+ scratchOptions16.shapePositions = shape;
+ scratchOptions16.cornerType = cornerType;
+ scratchOptions16.granularity = granularity;
+ return new PolylineVolumeGeometry(scratchOptions16);
+ }
+ result._positions = positions;
+ result._shape = shape;
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._cornerType = cornerType;
+ result._granularity = granularity;
+ return result;
+};
+var brScratch = new BoundingRectangle_default();
+PolylineVolumeGeometry.createGeometry = function(polylineVolumeGeometry) {
+ const positions = polylineVolumeGeometry._positions;
+ const cleanPositions = arrayRemoveDuplicates_default(
+ positions,
+ Cartesian3_default.equalsEpsilon
+ );
+ let shape2D = polylineVolumeGeometry._shape;
+ shape2D = PolylineVolumeGeometryLibrary_default.removeDuplicatesFromShape(shape2D);
+ if (cleanPositions.length < 2 || shape2D.length < 3) {
+ return void 0;
+ }
+ if (PolygonPipeline_default.computeWindingOrder2D(shape2D) === WindingOrder_default.CLOCKWISE) {
+ shape2D.reverse();
+ }
+ const boundingRectangle = BoundingRectangle_default.fromPoints(shape2D, brScratch);
+ const computedPositions = PolylineVolumeGeometryLibrary_default.computePositions(
+ cleanPositions,
+ shape2D,
+ boundingRectangle,
+ polylineVolumeGeometry,
+ true
+ );
+ return computeAttributes2(
+ computedPositions,
+ shape2D,
+ boundingRectangle,
+ polylineVolumeGeometry._vertexFormat
+ );
+};
+var PolylineVolumeGeometry_default = PolylineVolumeGeometry;
+
+// Source/Core/PolylineVolumeOutlineGeometry.js
+function computeAttributes3(positions, shape) {
+ const attributes = new GeometryAttributes_default();
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ const shapeLength = shape.length;
+ const vertexCount = attributes.position.values.length / 3;
+ const positionLength = positions.length / 3;
+ const shapeCount = positionLength / shapeLength;
+ const indices2 = IndexDatatype_default.createTypedArray(
+ vertexCount,
+ 2 * shapeLength * (shapeCount + 1)
+ );
+ let i, j;
+ let index = 0;
+ i = 0;
+ let offset2 = i * shapeLength;
+ for (j = 0; j < shapeLength - 1; j++) {
+ indices2[index++] = j + offset2;
+ indices2[index++] = j + offset2 + 1;
+ }
+ indices2[index++] = shapeLength - 1 + offset2;
+ indices2[index++] = offset2;
+ i = shapeCount - 1;
+ offset2 = i * shapeLength;
+ for (j = 0; j < shapeLength - 1; j++) {
+ indices2[index++] = j + offset2;
+ indices2[index++] = j + offset2 + 1;
+ }
+ indices2[index++] = shapeLength - 1 + offset2;
+ indices2[index++] = offset2;
+ for (i = 0; i < shapeCount - 1; i++) {
+ const firstOffset = shapeLength * i;
+ const secondOffset = firstOffset + shapeLength;
+ for (j = 0; j < shapeLength; j++) {
+ indices2[index++] = j + firstOffset;
+ indices2[index++] = j + secondOffset;
+ }
+ }
+ const geometry = new Geometry_default({
+ attributes,
+ indices: IndexDatatype_default.createTypedArray(vertexCount, indices2),
+ boundingSphere: BoundingSphere_default.fromVertices(positions),
+ primitiveType: PrimitiveType_default.LINES
+ });
+ return geometry;
+}
+function PolylineVolumeOutlineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const positions = options.polylinePositions;
+ const shape = options.shapePositions;
+ if (!defined_default(positions)) {
+ throw new DeveloperError_default("options.polylinePositions is required.");
+ }
+ if (!defined_default(shape)) {
+ throw new DeveloperError_default("options.shapePositions is required.");
+ }
+ this._positions = positions;
+ this._shape = shape;
+ this._ellipsoid = Ellipsoid_default.clone(
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
+ );
+ this._cornerType = defaultValue_default(options.cornerType, CornerType_default.ROUNDED);
+ this._granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ this._workerName = "createPolylineVolumeOutlineGeometry";
+ let numComponents = 1 + positions.length * Cartesian3_default.packedLength;
+ numComponents += 1 + shape.length * Cartesian2_default.packedLength;
+ this.packedLength = numComponents + Ellipsoid_default.packedLength + 2;
+}
+PolylineVolumeOutlineGeometry.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ let i;
+ const positions = value._positions;
+ let length3 = positions.length;
+ array[startingIndex++] = length3;
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ Cartesian3_default.pack(positions[i], array, startingIndex);
+ }
+ const shape = value._shape;
+ length3 = shape.length;
+ array[startingIndex++] = length3;
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian2_default.packedLength) {
+ Cartesian2_default.pack(shape[i], array, startingIndex);
+ }
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ array[startingIndex++] = value._cornerType;
+ array[startingIndex] = value._granularity;
+ return array;
+};
+var scratchEllipsoid10 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchOptions17 = {
+ polylinePositions: void 0,
+ shapePositions: void 0,
+ ellipsoid: scratchEllipsoid10,
+ height: void 0,
+ cornerType: void 0,
+ granularity: void 0
+};
+PolylineVolumeOutlineGeometry.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ let i;
+ let length3 = array[startingIndex++];
+ const positions = new Array(length3);
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
+ }
+ length3 = array[startingIndex++];
+ const shape = new Array(length3);
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian2_default.packedLength) {
+ shape[i] = Cartesian2_default.unpack(array, startingIndex);
+ }
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid10);
+ startingIndex += Ellipsoid_default.packedLength;
+ const cornerType = array[startingIndex++];
+ const granularity = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions17.polylinePositions = positions;
+ scratchOptions17.shapePositions = shape;
+ scratchOptions17.cornerType = cornerType;
+ scratchOptions17.granularity = granularity;
+ return new PolylineVolumeOutlineGeometry(scratchOptions17);
+ }
+ result._positions = positions;
+ result._shape = shape;
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._cornerType = cornerType;
+ result._granularity = granularity;
+ return result;
+};
+var brScratch2 = new BoundingRectangle_default();
+PolylineVolumeOutlineGeometry.createGeometry = function(polylineVolumeOutlineGeometry) {
+ const positions = polylineVolumeOutlineGeometry._positions;
+ const cleanPositions = arrayRemoveDuplicates_default(
+ positions,
+ Cartesian3_default.equalsEpsilon
+ );
+ let shape2D = polylineVolumeOutlineGeometry._shape;
+ shape2D = PolylineVolumeGeometryLibrary_default.removeDuplicatesFromShape(shape2D);
+ if (cleanPositions.length < 2 || shape2D.length < 3) {
+ return void 0;
+ }
+ if (PolygonPipeline_default.computeWindingOrder2D(shape2D) === WindingOrder_default.CLOCKWISE) {
+ shape2D.reverse();
+ }
+ const boundingRectangle = BoundingRectangle_default.fromPoints(shape2D, brScratch2);
+ const computedPositions = PolylineVolumeGeometryLibrary_default.computePositions(
+ cleanPositions,
+ shape2D,
+ boundingRectangle,
+ polylineVolumeOutlineGeometry,
+ false
+ );
+ return computeAttributes3(computedPositions, shape2D);
+};
+var PolylineVolumeOutlineGeometry_default = PolylineVolumeOutlineGeometry;
+
+// Source/DataSources/PolylineVolumeGeometryUpdater.js
+var scratchColor17 = new Color_default();
+function PolylineVolumeGeometryOptions(entity) {
+ this.id = entity;
+ this.vertexFormat = void 0;
+ this.polylinePositions = void 0;
+ this.shapePositions = void 0;
+ this.cornerType = void 0;
+ this.granularity = void 0;
+}
+function PolylineVolumeGeometryUpdater(entity, scene) {
+ GeometryUpdater_default.call(this, {
+ entity,
+ scene,
+ geometryOptions: new PolylineVolumeGeometryOptions(entity),
+ geometryPropertyName: "polylineVolume",
+ observedPropertyNames: ["availability", "polylineVolume"]
+ });
+ this._onEntityPropertyChanged(
+ entity,
+ "polylineVolume",
+ entity.polylineVolume,
+ void 0
+ );
+}
+if (defined_default(Object.create)) {
+ PolylineVolumeGeometryUpdater.prototype = Object.create(
+ GeometryUpdater_default.prototype
+ );
+ PolylineVolumeGeometryUpdater.prototype.constructor = PolylineVolumeGeometryUpdater;
+}
+PolylineVolumeGeometryUpdater.prototype.createFillGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._fillEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent a filled geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ let attributes;
+ let color;
+ const show = new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time)
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ );
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ let currentColor;
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor17);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ attributes = {
+ show,
+ distanceDisplayCondition: distanceDisplayConditionAttribute,
+ color
+ };
+ } else {
+ attributes = {
+ show,
+ distanceDisplayCondition: distanceDisplayConditionAttribute
+ };
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new PolylineVolumeGeometry_default(this._options),
+ attributes
+ });
+};
+PolylineVolumeGeometryUpdater.prototype.createOutlineGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._outlineEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent an outlined geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const outlineColor = Property_default.getValueOrDefault(
+ this._outlineColorProperty,
+ time,
+ Color_default.BLACK,
+ scratchColor17
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new PolylineVolumeOutlineGeometry_default(this._options),
+ attributes: {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)
+ ),
+ color: ColorGeometryInstanceAttribute_default.fromColor(outlineColor),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ )
+ }
+ });
+};
+PolylineVolumeGeometryUpdater.prototype._isHidden = function(entity, polylineVolume) {
+ return !defined_default(polylineVolume.positions) || !defined_default(polylineVolume.shape) || GeometryUpdater_default.prototype._isHidden.call(this, entity, polylineVolume);
+};
+PolylineVolumeGeometryUpdater.prototype._isDynamic = function(entity, polylineVolume) {
+ return !polylineVolume.positions.isConstant || !polylineVolume.shape.isConstant || !Property_default.isConstant(polylineVolume.granularity) || !Property_default.isConstant(polylineVolume.outlineWidth) || !Property_default.isConstant(polylineVolume.cornerType);
+};
+PolylineVolumeGeometryUpdater.prototype._setStaticOptions = function(entity, polylineVolume) {
+ const granularity = polylineVolume.granularity;
+ const cornerType = polylineVolume.cornerType;
+ const options = this._options;
+ const isColorMaterial = this._materialProperty instanceof ColorMaterialProperty_default;
+ options.vertexFormat = isColorMaterial ? PerInstanceColorAppearance_default.VERTEX_FORMAT : MaterialAppearance_default.MaterialSupport.TEXTURED.vertexFormat;
+ options.polylinePositions = polylineVolume.positions.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.polylinePositions
+ );
+ options.shapePositions = polylineVolume.shape.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.shape
+ );
+ options.granularity = defined_default(granularity) ? granularity.getValue(Iso8601_default.MINIMUM_VALUE) : void 0;
+ options.cornerType = defined_default(cornerType) ? cornerType.getValue(Iso8601_default.MINIMUM_VALUE) : void 0;
+};
+PolylineVolumeGeometryUpdater.DynamicGeometryUpdater = DynamicPolylineVolumeGeometryUpdater;
+function DynamicPolylineVolumeGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
+ DynamicGeometryUpdater_default.call(
+ this,
+ geometryUpdater,
+ primitives,
+ groundPrimitives
+ );
+}
+if (defined_default(Object.create)) {
+ DynamicPolylineVolumeGeometryUpdater.prototype = Object.create(
+ DynamicGeometryUpdater_default.prototype
+ );
+ DynamicPolylineVolumeGeometryUpdater.prototype.constructor = DynamicPolylineVolumeGeometryUpdater;
+}
+DynamicPolylineVolumeGeometryUpdater.prototype._isHidden = function(entity, polylineVolume, time) {
+ const options = this._options;
+ return !defined_default(options.polylinePositions) || !defined_default(options.shapePositions) || DynamicGeometryUpdater_default.prototype._isHidden.call(
+ this,
+ entity,
+ polylineVolume,
+ time
+ );
+};
+DynamicPolylineVolumeGeometryUpdater.prototype._setOptions = function(entity, polylineVolume, time) {
+ const options = this._options;
+ options.polylinePositions = Property_default.getValueOrUndefined(
+ polylineVolume.positions,
+ time,
+ options.polylinePositions
+ );
+ options.shapePositions = Property_default.getValueOrUndefined(
+ polylineVolume.shape,
+ time
+ );
+ options.granularity = Property_default.getValueOrUndefined(
+ polylineVolume.granularity,
+ time
+ );
+ options.cornerType = Property_default.getValueOrUndefined(
+ polylineVolume.cornerType,
+ time
+ );
+};
+var PolylineVolumeGeometryUpdater_default = PolylineVolumeGeometryUpdater;
+
+// Source/Core/RectangleGeometry.js
+var positionScratch12 = new Cartesian3_default();
+var normalScratch4 = new Cartesian3_default();
+var tangentScratch2 = new Cartesian3_default();
+var bitangentScratch2 = new Cartesian3_default();
+var rectangleScratch2 = new Rectangle_default();
+var stScratch2 = new Cartesian2_default();
+var bottomBoundingSphere4 = new BoundingSphere_default();
+var topBoundingSphere4 = new BoundingSphere_default();
+function createAttributes(vertexFormat, attributes) {
+ const geo = new Geometry_default({
+ attributes: new GeometryAttributes_default(),
+ primitiveType: PrimitiveType_default.TRIANGLES
+ });
+ geo.attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: attributes.positions
+ });
+ if (vertexFormat.normal) {
+ geo.attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: attributes.normals
+ });
+ }
+ if (vertexFormat.tangent) {
+ geo.attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: attributes.tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ geo.attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: attributes.bitangents
+ });
+ }
+ return geo;
+}
+function calculateAttributes(positions, vertexFormat, ellipsoid, tangentRotationMatrix) {
+ const length3 = positions.length;
+ const normals = vertexFormat.normal ? new Float32Array(length3) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(length3) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(length3) : void 0;
+ let attrIndex = 0;
+ const bitangent = bitangentScratch2;
+ const tangent = tangentScratch2;
+ let normal2 = normalScratch4;
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
+ for (let i = 0; i < length3; i += 3) {
+ const p = Cartesian3_default.fromArray(positions, i, positionScratch12);
+ const attrIndex1 = attrIndex + 1;
+ const attrIndex2 = attrIndex + 2;
+ normal2 = ellipsoid.geodeticSurfaceNormal(p, normal2);
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal2, tangent);
+ Matrix3_default.multiplyByVector(tangentRotationMatrix, tangent, tangent);
+ Cartesian3_default.normalize(tangent, tangent);
+ if (vertexFormat.bitangent) {
+ Cartesian3_default.normalize(
+ Cartesian3_default.cross(normal2, tangent, bitangent),
+ bitangent
+ );
+ }
+ }
+ if (vertexFormat.normal) {
+ normals[attrIndex] = normal2.x;
+ normals[attrIndex1] = normal2.y;
+ normals[attrIndex2] = normal2.z;
+ }
+ if (vertexFormat.tangent) {
+ tangents[attrIndex] = tangent.x;
+ tangents[attrIndex1] = tangent.y;
+ tangents[attrIndex2] = tangent.z;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents[attrIndex] = bitangent.x;
+ bitangents[attrIndex1] = bitangent.y;
+ bitangents[attrIndex2] = bitangent.z;
+ }
+ attrIndex += 3;
+ }
+ }
+ return createAttributes(vertexFormat, {
+ positions,
+ normals,
+ tangents,
+ bitangents
+ });
+}
+var v1Scratch = new Cartesian3_default();
+var v2Scratch = new Cartesian3_default();
+function calculateAttributesWall(positions, vertexFormat, ellipsoid) {
+ const length3 = positions.length;
+ const normals = vertexFormat.normal ? new Float32Array(length3) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(length3) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(length3) : void 0;
+ let normalIndex = 0;
+ let tangentIndex = 0;
+ let bitangentIndex = 0;
+ let recomputeNormal = true;
+ let bitangent = bitangentScratch2;
+ let tangent = tangentScratch2;
+ let normal2 = normalScratch4;
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
+ for (let i = 0; i < length3; i += 6) {
+ const p = Cartesian3_default.fromArray(positions, i, positionScratch12);
+ const p1 = Cartesian3_default.fromArray(positions, (i + 6) % length3, v1Scratch);
+ if (recomputeNormal) {
+ const p2 = Cartesian3_default.fromArray(positions, (i + 3) % length3, v2Scratch);
+ Cartesian3_default.subtract(p1, p, p1);
+ Cartesian3_default.subtract(p2, p, p2);
+ normal2 = Cartesian3_default.normalize(Cartesian3_default.cross(p2, p1, normal2), normal2);
+ recomputeNormal = false;
+ }
+ if (Cartesian3_default.equalsEpsilon(p1, p, Math_default.EPSILON10)) {
+ recomputeNormal = true;
+ }
+ if (vertexFormat.tangent || vertexFormat.bitangent) {
+ bitangent = ellipsoid.geodeticSurfaceNormal(p, bitangent);
+ if (vertexFormat.tangent) {
+ tangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(bitangent, normal2, tangent),
+ tangent
+ );
+ }
+ }
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = normal2.x;
+ normals[normalIndex++] = normal2.y;
+ normals[normalIndex++] = normal2.z;
+ normals[normalIndex++] = normal2.x;
+ normals[normalIndex++] = normal2.y;
+ normals[normalIndex++] = normal2.z;
+ }
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ }
+ }
+ }
+ return createAttributes(vertexFormat, {
+ positions,
+ normals,
+ tangents,
+ bitangents
+ });
+}
+function constructRectangle2(rectangleGeometry, computedOptions) {
+ const vertexFormat = rectangleGeometry._vertexFormat;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const height = computedOptions.height;
+ const width = computedOptions.width;
+ const northCap = computedOptions.northCap;
+ const southCap = computedOptions.southCap;
+ let rowStart = 0;
+ let rowEnd = height;
+ let rowHeight = height;
+ let size = 0;
+ if (northCap) {
+ rowStart = 1;
+ rowHeight -= 1;
+ size += 1;
+ }
+ if (southCap) {
+ rowEnd -= 1;
+ rowHeight -= 1;
+ size += 1;
+ }
+ size += width * rowHeight;
+ const positions = vertexFormat.position ? new Float64Array(size * 3) : void 0;
+ const textureCoordinates = vertexFormat.st ? new Float32Array(size * 2) : void 0;
+ let posIndex = 0;
+ let stIndex = 0;
+ const position = positionScratch12;
+ const st = stScratch2;
+ let minX = Number.MAX_VALUE;
+ let minY = Number.MAX_VALUE;
+ let maxX = -Number.MAX_VALUE;
+ let maxY = -Number.MAX_VALUE;
+ for (let row = rowStart; row < rowEnd; ++row) {
+ for (let col = 0; col < width; ++col) {
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ vertexFormat.st,
+ row,
+ col,
+ position,
+ st
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ if (vertexFormat.st) {
+ textureCoordinates[stIndex++] = st.x;
+ textureCoordinates[stIndex++] = st.y;
+ minX = Math.min(minX, st.x);
+ minY = Math.min(minY, st.y);
+ maxX = Math.max(maxX, st.x);
+ maxY = Math.max(maxY, st.y);
+ }
+ }
+ }
+ if (northCap) {
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ vertexFormat.st,
+ 0,
+ 0,
+ position,
+ st
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex++] = position.z;
+ if (vertexFormat.st) {
+ textureCoordinates[stIndex++] = st.x;
+ textureCoordinates[stIndex++] = st.y;
+ minX = st.x;
+ minY = st.y;
+ maxX = st.x;
+ maxY = st.y;
+ }
+ }
+ if (southCap) {
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ vertexFormat.st,
+ height - 1,
+ 0,
+ position,
+ st
+ );
+ positions[posIndex++] = position.x;
+ positions[posIndex++] = position.y;
+ positions[posIndex] = position.z;
+ if (vertexFormat.st) {
+ textureCoordinates[stIndex++] = st.x;
+ textureCoordinates[stIndex] = st.y;
+ minX = Math.min(minX, st.x);
+ minY = Math.min(minY, st.y);
+ maxX = Math.max(maxX, st.x);
+ maxY = Math.max(maxY, st.y);
+ }
+ }
+ if (vertexFormat.st && (minX < 0 || minY < 0 || maxX > 1 || maxY > 1)) {
+ for (let k = 0; k < textureCoordinates.length; k += 2) {
+ textureCoordinates[k] = (textureCoordinates[k] - minX) / (maxX - minX);
+ textureCoordinates[k + 1] = (textureCoordinates[k + 1] - minY) / (maxY - minY);
+ }
+ }
+ const geo = calculateAttributes(
+ positions,
+ vertexFormat,
+ ellipsoid,
+ computedOptions.tangentRotationMatrix
+ );
+ let indicesSize = 6 * (width - 1) * (rowHeight - 1);
+ if (northCap) {
+ indicesSize += 3 * (width - 1);
+ }
+ if (southCap) {
+ indicesSize += 3 * (width - 1);
+ }
+ const indices2 = IndexDatatype_default.createTypedArray(size, indicesSize);
+ let index = 0;
+ let indicesIndex = 0;
+ let i;
+ for (i = 0; i < rowHeight - 1; ++i) {
+ for (let j = 0; j < width - 1; ++j) {
+ const upperLeft = index;
+ const lowerLeft = upperLeft + width;
+ const lowerRight = lowerLeft + 1;
+ const upperRight = upperLeft + 1;
+ indices2[indicesIndex++] = upperLeft;
+ indices2[indicesIndex++] = lowerLeft;
+ indices2[indicesIndex++] = upperRight;
+ indices2[indicesIndex++] = upperRight;
+ indices2[indicesIndex++] = lowerLeft;
+ indices2[indicesIndex++] = lowerRight;
+ ++index;
+ }
+ ++index;
+ }
+ if (northCap || southCap) {
+ let northIndex = size - 1;
+ const southIndex = size - 1;
+ if (northCap && southCap) {
+ northIndex = size - 2;
+ }
+ let p1;
+ let p2;
+ index = 0;
+ if (northCap) {
+ for (i = 0; i < width - 1; i++) {
+ p1 = index;
+ p2 = p1 + 1;
+ indices2[indicesIndex++] = northIndex;
+ indices2[indicesIndex++] = p1;
+ indices2[indicesIndex++] = p2;
+ ++index;
+ }
+ }
+ if (southCap) {
+ index = (rowHeight - 1) * width;
+ for (i = 0; i < width - 1; i++) {
+ p1 = index;
+ p2 = p1 + 1;
+ indices2[indicesIndex++] = p1;
+ indices2[indicesIndex++] = southIndex;
+ indices2[indicesIndex++] = p2;
+ ++index;
+ }
+ }
+ }
+ geo.indices = indices2;
+ if (vertexFormat.st) {
+ geo.attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates
+ });
+ }
+ return geo;
+}
+function addWallPositions2(wallPositions, posIndex, i, topPositions, bottomPositions) {
+ wallPositions[posIndex++] = topPositions[i];
+ wallPositions[posIndex++] = topPositions[i + 1];
+ wallPositions[posIndex++] = topPositions[i + 2];
+ wallPositions[posIndex++] = bottomPositions[i];
+ wallPositions[posIndex++] = bottomPositions[i + 1];
+ wallPositions[posIndex] = bottomPositions[i + 2];
+ return wallPositions;
+}
+function addWallTextureCoordinates(wallTextures, stIndex, i, st) {
+ wallTextures[stIndex++] = st[i];
+ wallTextures[stIndex++] = st[i + 1];
+ wallTextures[stIndex++] = st[i];
+ wallTextures[stIndex] = st[i + 1];
+ return wallTextures;
+}
+var scratchVertexFormat10 = new VertexFormat_default();
+function constructExtrudedRectangle2(rectangleGeometry, computedOptions) {
+ const shadowVolume = rectangleGeometry._shadowVolume;
+ const offsetAttributeValue = rectangleGeometry._offsetAttribute;
+ const vertexFormat = rectangleGeometry._vertexFormat;
+ const minHeight = rectangleGeometry._extrudedHeight;
+ const maxHeight = rectangleGeometry._surfaceHeight;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const height = computedOptions.height;
+ const width = computedOptions.width;
+ let i;
+ if (shadowVolume) {
+ const newVertexFormat = VertexFormat_default.clone(
+ vertexFormat,
+ scratchVertexFormat10
+ );
+ newVertexFormat.normal = true;
+ rectangleGeometry._vertexFormat = newVertexFormat;
+ }
+ const topBottomGeo = constructRectangle2(rectangleGeometry, computedOptions);
+ if (shadowVolume) {
+ rectangleGeometry._vertexFormat = vertexFormat;
+ }
+ let topPositions = PolygonPipeline_default.scaleToGeodeticHeight(
+ topBottomGeo.attributes.position.values,
+ maxHeight,
+ ellipsoid,
+ false
+ );
+ topPositions = new Float64Array(topPositions);
+ let length3 = topPositions.length;
+ const newLength = length3 * 2;
+ const positions = new Float64Array(newLength);
+ positions.set(topPositions);
+ const bottomPositions = PolygonPipeline_default.scaleToGeodeticHeight(
+ topBottomGeo.attributes.position.values,
+ minHeight,
+ ellipsoid
+ );
+ positions.set(bottomPositions, length3);
+ topBottomGeo.attributes.position.values = positions;
+ const normals = vertexFormat.normal ? new Float32Array(newLength) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(newLength) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(newLength) : void 0;
+ const textures = vertexFormat.st ? new Float32Array(newLength / 3 * 2) : void 0;
+ let topSt;
+ let topNormals;
+ if (vertexFormat.normal) {
+ topNormals = topBottomGeo.attributes.normal.values;
+ normals.set(topNormals);
+ for (i = 0; i < length3; i++) {
+ topNormals[i] = -topNormals[i];
+ }
+ normals.set(topNormals, length3);
+ topBottomGeo.attributes.normal.values = normals;
+ }
+ if (shadowVolume) {
+ topNormals = topBottomGeo.attributes.normal.values;
+ if (!vertexFormat.normal) {
+ topBottomGeo.attributes.normal = void 0;
+ }
+ const extrudeNormals = new Float32Array(newLength);
+ for (i = 0; i < length3; i++) {
+ topNormals[i] = -topNormals[i];
+ }
+ extrudeNormals.set(topNormals, length3);
+ topBottomGeo.attributes.extrudeDirection = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: extrudeNormals
+ });
+ }
+ let offsetValue;
+ const hasOffsets = defined_default(offsetAttributeValue);
+ if (hasOffsets) {
+ const size = length3 / 3 * 2;
+ let offsetAttribute = new Uint8Array(size);
+ if (offsetAttributeValue === GeometryOffsetAttribute_default.TOP) {
+ offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
+ } else {
+ offsetValue = offsetAttributeValue === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ offsetAttribute = offsetAttribute.fill(offsetValue);
+ }
+ topBottomGeo.attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: offsetAttribute
+ });
+ }
+ if (vertexFormat.tangent) {
+ const topTangents = topBottomGeo.attributes.tangent.values;
+ tangents.set(topTangents);
+ for (i = 0; i < length3; i++) {
+ topTangents[i] = -topTangents[i];
+ }
+ tangents.set(topTangents, length3);
+ topBottomGeo.attributes.tangent.values = tangents;
+ }
+ if (vertexFormat.bitangent) {
+ const topBitangents = topBottomGeo.attributes.bitangent.values;
+ bitangents.set(topBitangents);
+ bitangents.set(topBitangents, length3);
+ topBottomGeo.attributes.bitangent.values = bitangents;
+ }
+ if (vertexFormat.st) {
+ topSt = topBottomGeo.attributes.st.values;
+ textures.set(topSt);
+ textures.set(topSt, length3 / 3 * 2);
+ topBottomGeo.attributes.st.values = textures;
+ }
+ const indices2 = topBottomGeo.indices;
+ const indicesLength = indices2.length;
+ const posLength = length3 / 3;
+ const newIndices = IndexDatatype_default.createTypedArray(
+ newLength / 3,
+ indicesLength * 2
+ );
+ newIndices.set(indices2);
+ for (i = 0; i < indicesLength; i += 3) {
+ newIndices[i + indicesLength] = indices2[i + 2] + posLength;
+ newIndices[i + 1 + indicesLength] = indices2[i + 1] + posLength;
+ newIndices[i + 2 + indicesLength] = indices2[i] + posLength;
+ }
+ topBottomGeo.indices = newIndices;
+ const northCap = computedOptions.northCap;
+ const southCap = computedOptions.southCap;
+ let rowHeight = height;
+ let widthMultiplier = 2;
+ let perimeterPositions = 0;
+ let corners = 4;
+ let dupliateCorners = 4;
+ if (northCap) {
+ widthMultiplier -= 1;
+ rowHeight -= 1;
+ perimeterPositions += 1;
+ corners -= 2;
+ dupliateCorners -= 1;
+ }
+ if (southCap) {
+ widthMultiplier -= 1;
+ rowHeight -= 1;
+ perimeterPositions += 1;
+ corners -= 2;
+ dupliateCorners -= 1;
+ }
+ perimeterPositions += widthMultiplier * width + 2 * rowHeight - corners;
+ const wallCount = (perimeterPositions + dupliateCorners) * 2;
+ let wallPositions = new Float64Array(wallCount * 3);
+ const wallExtrudeNormals = shadowVolume ? new Float32Array(wallCount * 3) : void 0;
+ let wallOffsetAttribute = hasOffsets ? new Uint8Array(wallCount) : void 0;
+ let wallTextures = vertexFormat.st ? new Float32Array(wallCount * 2) : void 0;
+ const computeTopOffsets = offsetAttributeValue === GeometryOffsetAttribute_default.TOP;
+ if (hasOffsets && !computeTopOffsets) {
+ offsetValue = offsetAttributeValue === GeometryOffsetAttribute_default.ALL ? 1 : 0;
+ wallOffsetAttribute = wallOffsetAttribute.fill(offsetValue);
+ }
+ let posIndex = 0;
+ let stIndex = 0;
+ let extrudeNormalIndex = 0;
+ let wallOffsetIndex = 0;
+ const area = width * rowHeight;
+ let threeI;
+ for (i = 0; i < area; i += width) {
+ threeI = i * 3;
+ wallPositions = addWallPositions2(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ i * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+ if (!southCap) {
+ for (i = area - width; i < area; i++) {
+ threeI = i * 3;
+ wallPositions = addWallPositions2(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ i * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+ } else {
+ const southIndex = northCap ? area + 1 : area;
+ threeI = southIndex * 3;
+ for (i = 0; i < 2; i++) {
+ wallPositions = addWallPositions2(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ southIndex * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+ }
+ for (i = area - 1; i > 0; i -= width) {
+ threeI = i * 3;
+ wallPositions = addWallPositions2(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ i * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+ if (!northCap) {
+ for (i = width - 1; i >= 0; i--) {
+ threeI = i * 3;
+ wallPositions = addWallPositions2(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ i * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+ } else {
+ const northIndex = area;
+ threeI = northIndex * 3;
+ for (i = 0; i < 2; i++) {
+ wallPositions = addWallPositions2(
+ wallPositions,
+ posIndex,
+ threeI,
+ topPositions,
+ bottomPositions
+ );
+ posIndex += 6;
+ if (vertexFormat.st) {
+ wallTextures = addWallTextureCoordinates(
+ wallTextures,
+ stIndex,
+ northIndex * 2,
+ topSt
+ );
+ stIndex += 4;
+ }
+ if (shadowVolume) {
+ extrudeNormalIndex += 3;
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 1];
+ wallExtrudeNormals[extrudeNormalIndex++] = topNormals[threeI + 2];
+ }
+ if (computeTopOffsets) {
+ wallOffsetAttribute[wallOffsetIndex++] = 1;
+ wallOffsetIndex += 1;
+ }
+ }
+ }
+ let geo = calculateAttributesWall(wallPositions, vertexFormat, ellipsoid);
+ if (vertexFormat.st) {
+ geo.attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: wallTextures
+ });
+ }
+ if (shadowVolume) {
+ geo.attributes.extrudeDirection = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: wallExtrudeNormals
+ });
+ }
+ if (hasOffsets) {
+ geo.attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: wallOffsetAttribute
+ });
+ }
+ const wallIndices = IndexDatatype_default.createTypedArray(
+ wallCount,
+ perimeterPositions * 6
+ );
+ let upperLeft;
+ let lowerLeft;
+ let lowerRight;
+ let upperRight;
+ length3 = wallPositions.length / 3;
+ let index = 0;
+ for (i = 0; i < length3 - 1; i += 2) {
+ upperLeft = i;
+ upperRight = (upperLeft + 2) % length3;
+ const p1 = Cartesian3_default.fromArray(wallPositions, upperLeft * 3, v1Scratch);
+ const p2 = Cartesian3_default.fromArray(wallPositions, upperRight * 3, v2Scratch);
+ if (Cartesian3_default.equalsEpsilon(p1, p2, Math_default.EPSILON10)) {
+ continue;
+ }
+ lowerLeft = (upperLeft + 1) % length3;
+ lowerRight = (lowerLeft + 2) % length3;
+ wallIndices[index++] = upperLeft;
+ wallIndices[index++] = lowerLeft;
+ wallIndices[index++] = upperRight;
+ wallIndices[index++] = upperRight;
+ wallIndices[index++] = lowerLeft;
+ wallIndices[index++] = lowerRight;
+ }
+ geo.indices = wallIndices;
+ geo = GeometryPipeline_default.combineInstances([
+ new GeometryInstance_default({
+ geometry: topBottomGeo
+ }),
+ new GeometryInstance_default({
+ geometry: geo
+ })
+ ]);
+ return geo[0];
+}
+var scratchRectanglePoints = [
+ new Cartesian3_default(),
+ new Cartesian3_default(),
+ new Cartesian3_default(),
+ new Cartesian3_default()
+];
+var nwScratch2 = new Cartographic_default();
+var stNwScratch = new Cartographic_default();
+function computeRectangle4(rectangle, granularity, rotation, ellipsoid, result) {
+ if (rotation === 0) {
+ return Rectangle_default.clone(rectangle, result);
+ }
+ const computedOptions = RectangleGeometryLibrary_default.computeOptions(
+ rectangle,
+ granularity,
+ rotation,
+ 0,
+ rectangleScratch2,
+ nwScratch2
+ );
+ const height = computedOptions.height;
+ const width = computedOptions.width;
+ const positions = scratchRectanglePoints;
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ 0,
+ 0,
+ positions[0]
+ );
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ 0,
+ width - 1,
+ positions[1]
+ );
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ height - 1,
+ 0,
+ positions[2]
+ );
+ RectangleGeometryLibrary_default.computePosition(
+ computedOptions,
+ ellipsoid,
+ false,
+ height - 1,
+ width - 1,
+ positions[3]
+ );
+ return Rectangle_default.fromCartesianArray(positions, ellipsoid, result);
+}
+function RectangleGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const rectangle = options.rectangle;
+ Check_default.typeOf.object("rectangle", rectangle);
+ Rectangle_default.validate(rectangle);
+ if (rectangle.north < rectangle.south) {
+ throw new DeveloperError_default(
+ "options.rectangle.north must be greater than or equal to options.rectangle.south"
+ );
+ }
+ const height = defaultValue_default(options.height, 0);
+ const extrudedHeight = defaultValue_default(options.extrudedHeight, height);
+ this._rectangle = Rectangle_default.clone(rectangle);
+ this._granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ this._ellipsoid = Ellipsoid_default.clone(
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
+ );
+ this._surfaceHeight = Math.max(height, extrudedHeight);
+ this._rotation = defaultValue_default(options.rotation, 0);
+ this._stRotation = defaultValue_default(options.stRotation, 0);
+ this._vertexFormat = VertexFormat_default.clone(
+ defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
+ );
+ this._extrudedHeight = Math.min(height, extrudedHeight);
+ this._shadowVolume = defaultValue_default(options.shadowVolume, false);
+ this._workerName = "createRectangleGeometry";
+ this._offsetAttribute = options.offsetAttribute;
+ this._rotatedRectangle = void 0;
+ this._textureCoordinateRotationPoints = void 0;
+}
+RectangleGeometry.packedLength = Rectangle_default.packedLength + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 7;
+RectangleGeometry.pack = function(value, array, startingIndex) {
+ Check_default.typeOf.object("value", value);
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ Rectangle_default.pack(value._rectangle, array, startingIndex);
+ startingIndex += Rectangle_default.packedLength;
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat_default.packedLength;
+ array[startingIndex++] = value._granularity;
+ array[startingIndex++] = value._surfaceHeight;
+ array[startingIndex++] = value._rotation;
+ array[startingIndex++] = value._stRotation;
+ array[startingIndex++] = value._extrudedHeight;
+ array[startingIndex++] = value._shadowVolume ? 1 : 0;
+ array[startingIndex] = defaultValue_default(value._offsetAttribute, -1);
+ return array;
+};
+var scratchRectangle7 = new Rectangle_default();
+var scratchEllipsoid11 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchOptions18 = {
+ rectangle: scratchRectangle7,
+ ellipsoid: scratchEllipsoid11,
+ vertexFormat: scratchVertexFormat10,
+ granularity: void 0,
+ height: void 0,
+ rotation: void 0,
+ stRotation: void 0,
+ extrudedHeight: void 0,
+ shadowVolume: void 0,
+ offsetAttribute: void 0
+};
+RectangleGeometry.unpack = function(array, startingIndex, result) {
+ Check_default.defined("array", array);
+ startingIndex = defaultValue_default(startingIndex, 0);
+ const rectangle = Rectangle_default.unpack(array, startingIndex, scratchRectangle7);
+ startingIndex += Rectangle_default.packedLength;
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid11);
+ startingIndex += Ellipsoid_default.packedLength;
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat10
+ );
+ startingIndex += VertexFormat_default.packedLength;
+ const granularity = array[startingIndex++];
+ const surfaceHeight = array[startingIndex++];
+ const rotation = array[startingIndex++];
+ const stRotation = array[startingIndex++];
+ const extrudedHeight = array[startingIndex++];
+ const shadowVolume = array[startingIndex++] === 1;
+ const offsetAttribute = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions18.granularity = granularity;
+ scratchOptions18.height = surfaceHeight;
+ scratchOptions18.rotation = rotation;
+ scratchOptions18.stRotation = stRotation;
+ scratchOptions18.extrudedHeight = extrudedHeight;
+ scratchOptions18.shadowVolume = shadowVolume;
+ scratchOptions18.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return new RectangleGeometry(scratchOptions18);
+ }
+ result._rectangle = Rectangle_default.clone(rectangle, result._rectangle);
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._granularity = granularity;
+ result._surfaceHeight = surfaceHeight;
+ result._rotation = rotation;
+ result._stRotation = stRotation;
+ result._extrudedHeight = extrudedHeight;
+ result._shadowVolume = shadowVolume;
+ result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
+ return result;
+};
+RectangleGeometry.computeRectangle = function(options, result) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const rectangle = options.rectangle;
+ Check_default.typeOf.object("rectangle", rectangle);
+ Rectangle_default.validate(rectangle);
+ if (rectangle.north < rectangle.south) {
+ throw new DeveloperError_default(
+ "options.rectangle.north must be greater than or equal to options.rectangle.south"
+ );
+ }
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ const rotation = defaultValue_default(options.rotation, 0);
+ return computeRectangle4(rectangle, granularity, rotation, ellipsoid, result);
+};
+var tangentRotationMatrixScratch = new Matrix3_default();
+var quaternionScratch4 = new Quaternion_default();
+var centerScratch4 = new Cartographic_default();
+RectangleGeometry.createGeometry = function(rectangleGeometry) {
+ if (Math_default.equalsEpsilon(
+ rectangleGeometry._rectangle.north,
+ rectangleGeometry._rectangle.south,
+ Math_default.EPSILON10
+ ) || Math_default.equalsEpsilon(
+ rectangleGeometry._rectangle.east,
+ rectangleGeometry._rectangle.west,
+ Math_default.EPSILON10
+ )) {
+ return void 0;
+ }
+ let rectangle = rectangleGeometry._rectangle;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const rotation = rectangleGeometry._rotation;
+ const stRotation = rectangleGeometry._stRotation;
+ const vertexFormat = rectangleGeometry._vertexFormat;
+ const computedOptions = RectangleGeometryLibrary_default.computeOptions(
+ rectangle,
+ rectangleGeometry._granularity,
+ rotation,
+ stRotation,
+ rectangleScratch2,
+ nwScratch2,
+ stNwScratch
+ );
+ const tangentRotationMatrix = tangentRotationMatrixScratch;
+ if (stRotation !== 0 || rotation !== 0) {
+ const center = Rectangle_default.center(rectangle, centerScratch4);
+ const axis = ellipsoid.geodeticSurfaceNormalCartographic(center, v1Scratch);
+ Quaternion_default.fromAxisAngle(axis, -stRotation, quaternionScratch4);
+ Matrix3_default.fromQuaternion(quaternionScratch4, tangentRotationMatrix);
+ } else {
+ Matrix3_default.clone(Matrix3_default.IDENTITY, tangentRotationMatrix);
+ }
+ const surfaceHeight = rectangleGeometry._surfaceHeight;
+ const extrudedHeight = rectangleGeometry._extrudedHeight;
+ const extrude = !Math_default.equalsEpsilon(
+ surfaceHeight,
+ extrudedHeight,
+ 0,
+ Math_default.EPSILON2
+ );
+ computedOptions.lonScalar = 1 / rectangleGeometry._rectangle.width;
+ computedOptions.latScalar = 1 / rectangleGeometry._rectangle.height;
+ computedOptions.tangentRotationMatrix = tangentRotationMatrix;
+ let geometry;
+ let boundingSphere;
+ rectangle = rectangleGeometry._rectangle;
+ if (extrude) {
+ geometry = constructExtrudedRectangle2(rectangleGeometry, computedOptions);
+ const topBS = BoundingSphere_default.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ surfaceHeight,
+ topBoundingSphere4
+ );
+ const bottomBS = BoundingSphere_default.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ extrudedHeight,
+ bottomBoundingSphere4
+ );
+ boundingSphere = BoundingSphere_default.union(topBS, bottomBS);
+ } else {
+ geometry = constructRectangle2(rectangleGeometry, computedOptions);
+ geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
+ geometry.attributes.position.values,
+ surfaceHeight,
+ ellipsoid,
+ false
+ );
+ if (defined_default(rectangleGeometry._offsetAttribute)) {
+ const length3 = geometry.attributes.position.values.length;
+ const offsetValue = rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
+ const applyOffset = new Uint8Array(length3 / 3).fill(offsetValue);
+ geometry.attributes.applyOffset = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 1,
+ values: applyOffset
+ });
+ }
+ boundingSphere = BoundingSphere_default.fromRectangle3D(
+ rectangle,
+ ellipsoid,
+ surfaceHeight
+ );
+ }
+ if (!vertexFormat.position) {
+ delete geometry.attributes.position;
+ }
+ return new Geometry_default({
+ attributes: geometry.attributes,
+ indices: geometry.indices,
+ primitiveType: geometry.primitiveType,
+ boundingSphere,
+ offsetAttribute: rectangleGeometry._offsetAttribute
+ });
+};
+RectangleGeometry.createShadowVolume = function(rectangleGeometry, minHeightFunc, maxHeightFunc) {
+ const granularity = rectangleGeometry._granularity;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const minHeight = minHeightFunc(granularity, ellipsoid);
+ const maxHeight = maxHeightFunc(granularity, ellipsoid);
+ return new RectangleGeometry({
+ rectangle: rectangleGeometry._rectangle,
+ rotation: rectangleGeometry._rotation,
+ ellipsoid,
+ stRotation: rectangleGeometry._stRotation,
+ granularity,
+ extrudedHeight: maxHeight,
+ height: minHeight,
+ vertexFormat: VertexFormat_default.POSITION_ONLY,
+ shadowVolume: true
+ });
+};
+var unrotatedTextureRectangleScratch = new Rectangle_default();
+var points2DScratch3 = [new Cartesian2_default(), new Cartesian2_default(), new Cartesian2_default()];
+var rotation2DScratch2 = new Matrix2_default();
+var rectangleCenterScratch3 = new Cartographic_default();
+function textureCoordinateRotationPoints3(rectangleGeometry) {
+ if (rectangleGeometry._stRotation === 0) {
+ return [0, 0, 0, 1, 1, 0];
+ }
+ const rectangle = Rectangle_default.clone(
+ rectangleGeometry._rectangle,
+ unrotatedTextureRectangleScratch
+ );
+ const granularity = rectangleGeometry._granularity;
+ const ellipsoid = rectangleGeometry._ellipsoid;
+ const rotation = rectangleGeometry._rotation - rectangleGeometry._stRotation;
+ const unrotatedTextureRectangle = computeRectangle4(
+ rectangle,
+ granularity,
+ rotation,
+ ellipsoid,
+ unrotatedTextureRectangleScratch
+ );
+ const points2D = points2DScratch3;
+ points2D[0].x = unrotatedTextureRectangle.west;
+ points2D[0].y = unrotatedTextureRectangle.south;
+ points2D[1].x = unrotatedTextureRectangle.west;
+ points2D[1].y = unrotatedTextureRectangle.north;
+ points2D[2].x = unrotatedTextureRectangle.east;
+ points2D[2].y = unrotatedTextureRectangle.south;
+ const boundingRectangle = rectangleGeometry.rectangle;
+ const toDesiredInComputed = Matrix2_default.fromRotation(
+ rectangleGeometry._stRotation,
+ rotation2DScratch2
+ );
+ const boundingRectangleCenter = Rectangle_default.center(
+ boundingRectangle,
+ rectangleCenterScratch3
+ );
+ for (let i = 0; i < 3; ++i) {
+ const point2D = points2D[i];
+ point2D.x -= boundingRectangleCenter.longitude;
+ point2D.y -= boundingRectangleCenter.latitude;
+ Matrix2_default.multiplyByVector(toDesiredInComputed, point2D, point2D);
+ point2D.x += boundingRectangleCenter.longitude;
+ point2D.y += boundingRectangleCenter.latitude;
+ point2D.x = (point2D.x - boundingRectangle.west) / boundingRectangle.width;
+ point2D.y = (point2D.y - boundingRectangle.south) / boundingRectangle.height;
+ }
+ const minXYCorner = points2D[0];
+ const maxYCorner = points2D[1];
+ const maxXCorner = points2D[2];
+ const result = new Array(6);
+ Cartesian2_default.pack(minXYCorner, result);
+ Cartesian2_default.pack(maxYCorner, result, 2);
+ Cartesian2_default.pack(maxXCorner, result, 4);
+ return result;
+}
+Object.defineProperties(RectangleGeometry.prototype, {
+ rectangle: {
+ get: function() {
+ if (!defined_default(this._rotatedRectangle)) {
+ this._rotatedRectangle = computeRectangle4(
+ this._rectangle,
+ this._granularity,
+ this._rotation,
+ this._ellipsoid
+ );
+ }
+ return this._rotatedRectangle;
+ }
+ },
+ textureCoordinateRotationPoints: {
+ get: function() {
+ if (!defined_default(this._textureCoordinateRotationPoints)) {
+ this._textureCoordinateRotationPoints = textureCoordinateRotationPoints3(
+ this
+ );
+ }
+ return this._textureCoordinateRotationPoints;
+ }
+ }
+});
+var RectangleGeometry_default = RectangleGeometry;
+
+// Source/DataSources/RectangleGeometryUpdater.js
+var scratchColor18 = new Color_default();
+var defaultOffset8 = Cartesian3_default.ZERO;
+var offsetScratch10 = new Cartesian3_default();
+var scratchRectangle8 = new Rectangle_default();
+var scratchCenterRect = new Rectangle_default();
+var scratchCarto3 = new Cartographic_default();
+function RectangleGeometryOptions(entity) {
+ this.id = entity;
+ this.vertexFormat = void 0;
+ this.rectangle = void 0;
+ this.height = void 0;
+ this.extrudedHeight = void 0;
+ this.granularity = void 0;
+ this.stRotation = void 0;
+ this.rotation = void 0;
+ this.offsetAttribute = void 0;
+}
+function RectangleGeometryUpdater(entity, scene) {
+ GroundGeometryUpdater_default.call(this, {
+ entity,
+ scene,
+ geometryOptions: new RectangleGeometryOptions(entity),
+ geometryPropertyName: "rectangle",
+ observedPropertyNames: ["availability", "rectangle"]
+ });
+ this._onEntityPropertyChanged(
+ entity,
+ "rectangle",
+ entity.rectangle,
+ void 0
+ );
+}
+if (defined_default(Object.create)) {
+ RectangleGeometryUpdater.prototype = Object.create(
+ GroundGeometryUpdater_default.prototype
+ );
+ RectangleGeometryUpdater.prototype.constructor = RectangleGeometryUpdater;
+}
+RectangleGeometryUpdater.prototype.createFillGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._fillEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent a filled geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time)
+ ),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ this._distanceDisplayConditionProperty.getValue(time)
+ ),
+ offset: void 0,
+ color: void 0
+ };
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ let currentColor;
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor18);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ attributes.color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ }
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset8,
+ offsetScratch10
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new RectangleGeometry_default(this._options),
+ attributes
+ });
+};
+RectangleGeometryUpdater.prototype.createOutlineGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._outlineEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent an outlined geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const outlineColor = Property_default.getValueOrDefault(
+ this._outlineColorProperty,
+ time,
+ Color_default.BLACK,
+ scratchColor18
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const attributes = {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)
+ ),
+ color: ColorGeometryInstanceAttribute_default.fromColor(outlineColor),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ ),
+ offset: void 0
+ };
+ if (defined_default(this._options.offsetAttribute)) {
+ attributes.offset = OffsetGeometryInstanceAttribute_default.fromCartesian3(
+ Property_default.getValueOrDefault(
+ this._terrainOffsetProperty,
+ time,
+ defaultOffset8,
+ offsetScratch10
+ )
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new RectangleOutlineGeometry_default(this._options),
+ attributes
+ });
+};
+RectangleGeometryUpdater.prototype._computeCenter = function(time, result) {
+ const rect = Property_default.getValueOrUndefined(
+ this._entity.rectangle.coordinates,
+ time,
+ scratchCenterRect
+ );
+ if (!defined_default(rect)) {
+ return;
+ }
+ const center = Rectangle_default.center(rect, scratchCarto3);
+ return Cartographic_default.toCartesian(center, Ellipsoid_default.WGS84, result);
+};
+RectangleGeometryUpdater.prototype._isHidden = function(entity, rectangle) {
+ return !defined_default(rectangle.coordinates) || GeometryUpdater_default.prototype._isHidden.call(this, entity, rectangle);
+};
+RectangleGeometryUpdater.prototype._isDynamic = function(entity, rectangle) {
+ return !rectangle.coordinates.isConstant || !Property_default.isConstant(rectangle.height) || !Property_default.isConstant(rectangle.extrudedHeight) || !Property_default.isConstant(rectangle.granularity) || !Property_default.isConstant(rectangle.stRotation) || !Property_default.isConstant(rectangle.rotation) || !Property_default.isConstant(rectangle.outlineWidth) || !Property_default.isConstant(rectangle.zIndex) || this._onTerrain && !Property_default.isConstant(this._materialProperty) && !(this._materialProperty instanceof ColorMaterialProperty_default);
+};
+RectangleGeometryUpdater.prototype._setStaticOptions = function(entity, rectangle) {
+ const isColorMaterial = this._materialProperty instanceof ColorMaterialProperty_default;
+ let heightValue = Property_default.getValueOrUndefined(
+ rectangle.height,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ const heightReferenceValue = Property_default.getValueOrDefault(
+ rectangle.heightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ let extrudedHeightValue = Property_default.getValueOrUndefined(
+ rectangle.extrudedHeight,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ const extrudedHeightReferenceValue = Property_default.getValueOrDefault(
+ rectangle.extrudedHeightReference,
+ Iso8601_default.MINIMUM_VALUE,
+ HeightReference_default.NONE
+ );
+ if (defined_default(extrudedHeightValue) && !defined_default(heightValue)) {
+ heightValue = 0;
+ }
+ const options = this._options;
+ options.vertexFormat = isColorMaterial ? PerInstanceColorAppearance_default.VERTEX_FORMAT : MaterialAppearance_default.MaterialSupport.TEXTURED.vertexFormat;
+ options.rectangle = rectangle.coordinates.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.rectangle
+ );
+ options.granularity = Property_default.getValueOrUndefined(
+ rectangle.granularity,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.stRotation = Property_default.getValueOrUndefined(
+ rectangle.stRotation,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.rotation = Property_default.getValueOrUndefined(
+ rectangle.rotation,
+ Iso8601_default.MINIMUM_VALUE
+ );
+ options.offsetAttribute = GroundGeometryUpdater_default.computeGeometryOffsetAttribute(
+ heightValue,
+ heightReferenceValue,
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ options.height = GroundGeometryUpdater_default.getGeometryHeight(
+ heightValue,
+ heightReferenceValue
+ );
+ extrudedHeightValue = GroundGeometryUpdater_default.getGeometryExtrudedHeight(
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ if (extrudedHeightValue === GroundGeometryUpdater_default.CLAMP_TO_GROUND) {
+ extrudedHeightValue = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ RectangleGeometry_default.computeRectangle(options, scratchRectangle8)
+ ).minimumTerrainHeight;
+ }
+ options.extrudedHeight = extrudedHeightValue;
+};
+RectangleGeometryUpdater.DynamicGeometryUpdater = DynamicRectangleGeometryUpdater;
+function DynamicRectangleGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
+ DynamicGeometryUpdater_default.call(
+ this,
+ geometryUpdater,
+ primitives,
+ groundPrimitives
+ );
+}
+if (defined_default(Object.create)) {
+ DynamicRectangleGeometryUpdater.prototype = Object.create(
+ DynamicGeometryUpdater_default.prototype
+ );
+ DynamicRectangleGeometryUpdater.prototype.constructor = DynamicRectangleGeometryUpdater;
+}
+DynamicRectangleGeometryUpdater.prototype._isHidden = function(entity, rectangle, time) {
+ return !defined_default(this._options.rectangle) || DynamicGeometryUpdater_default.prototype._isHidden.call(
+ this,
+ entity,
+ rectangle,
+ time
+ );
+};
+DynamicRectangleGeometryUpdater.prototype._setOptions = function(entity, rectangle, time) {
+ const options = this._options;
+ let heightValue = Property_default.getValueOrUndefined(rectangle.height, time);
+ const heightReferenceValue = Property_default.getValueOrDefault(
+ rectangle.heightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ let extrudedHeightValue = Property_default.getValueOrUndefined(
+ rectangle.extrudedHeight,
+ time
+ );
+ const extrudedHeightReferenceValue = Property_default.getValueOrDefault(
+ rectangle.extrudedHeightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ if (defined_default(extrudedHeightValue) && !defined_default(heightValue)) {
+ heightValue = 0;
+ }
+ options.rectangle = Property_default.getValueOrUndefined(
+ rectangle.coordinates,
+ time,
+ options.rectangle
+ );
+ options.granularity = Property_default.getValueOrUndefined(
+ rectangle.granularity,
+ time
+ );
+ options.stRotation = Property_default.getValueOrUndefined(rectangle.stRotation, time);
+ options.rotation = Property_default.getValueOrUndefined(rectangle.rotation, time);
+ options.offsetAttribute = GroundGeometryUpdater_default.computeGeometryOffsetAttribute(
+ heightValue,
+ heightReferenceValue,
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ options.height = GroundGeometryUpdater_default.getGeometryHeight(
+ heightValue,
+ heightReferenceValue
+ );
+ extrudedHeightValue = GroundGeometryUpdater_default.getGeometryExtrudedHeight(
+ extrudedHeightValue,
+ extrudedHeightReferenceValue
+ );
+ if (extrudedHeightValue === GroundGeometryUpdater_default.CLAMP_TO_GROUND) {
+ extrudedHeightValue = ApproximateTerrainHeights_default.getMinimumMaximumHeights(
+ RectangleGeometry_default.computeRectangle(options, scratchRectangle8)
+ ).minimumTerrainHeight;
+ }
+ options.extrudedHeight = extrudedHeightValue;
+};
+var RectangleGeometryUpdater_default = RectangleGeometryUpdater;
+
+// Source/DataSources/StaticGeometryColorBatch.js
+var colorScratch2 = new Color_default();
+var distanceDisplayConditionScratch2 = new DistanceDisplayCondition_default();
+var defaultDistanceDisplayCondition2 = new DistanceDisplayCondition_default();
+var defaultOffset9 = Cartesian3_default.ZERO;
+var offsetScratch11 = new Cartesian3_default();
+function Batch(primitives, translucent, appearanceType, depthFailAppearanceType, depthFailMaterialProperty, closed, shadows) {
+ this.translucent = translucent;
+ this.appearanceType = appearanceType;
+ this.depthFailAppearanceType = depthFailAppearanceType;
+ this.depthFailMaterialProperty = depthFailMaterialProperty;
+ this.depthFailMaterial = void 0;
+ this.closed = closed;
+ this.shadows = shadows;
+ this.primitives = primitives;
+ this.createPrimitive = false;
+ this.waitingOnCreate = false;
+ this.primitive = void 0;
+ this.oldPrimitive = void 0;
+ this.geometry = new AssociativeArray_default();
+ this.updaters = new AssociativeArray_default();
+ this.updatersWithAttributes = new AssociativeArray_default();
+ this.attributes = new AssociativeArray_default();
+ this.subscriptions = new AssociativeArray_default();
+ this.showsUpdated = new AssociativeArray_default();
+ this.itemsToRemove = [];
+ this.invalidated = false;
+ let removeMaterialSubscription;
+ if (defined_default(depthFailMaterialProperty)) {
+ removeMaterialSubscription = depthFailMaterialProperty.definitionChanged.addEventListener(
+ Batch.prototype.onMaterialChanged,
+ this
+ );
+ }
+ this.removeMaterialSubscription = removeMaterialSubscription;
+}
+Batch.prototype.onMaterialChanged = function() {
+ this.invalidated = true;
+};
+Batch.prototype.isMaterial = function(updater) {
+ const material = this.depthFailMaterialProperty;
+ const updaterMaterial = updater.depthFailMaterialProperty;
+ if (updaterMaterial === material) {
+ return true;
+ }
+ if (defined_default(material)) {
+ return material.equals(updaterMaterial);
+ }
+ return false;
+};
+Batch.prototype.add = function(updater, instance) {
+ const id = updater.id;
+ this.createPrimitive = true;
+ this.geometry.set(id, instance);
+ this.updaters.set(id, updater);
+ if (!updater.hasConstantFill || !updater.fillMaterialProperty.isConstant || !Property_default.isConstant(updater.distanceDisplayConditionProperty) || !Property_default.isConstant(updater.terrainOffsetProperty)) {
+ this.updatersWithAttributes.set(id, updater);
+ } else {
+ const that = this;
+ this.subscriptions.set(
+ id,
+ updater.entity.definitionChanged.addEventListener(function(entity, propertyName, newValue, oldValue2) {
+ if (propertyName === "isShowing") {
+ that.showsUpdated.set(updater.id, updater);
+ }
+ })
+ );
+ }
+};
+Batch.prototype.remove = function(updater) {
+ const id = updater.id;
+ this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;
+ if (this.updaters.remove(id)) {
+ this.updatersWithAttributes.remove(id);
+ const unsubscribe2 = this.subscriptions.get(id);
+ if (defined_default(unsubscribe2)) {
+ unsubscribe2();
+ this.subscriptions.remove(id);
+ this.showsUpdated.remove(id);
+ }
+ return true;
+ }
+ return false;
+};
+Batch.prototype.update = function(time) {
+ let isUpdated = true;
+ let removedCount = 0;
+ let primitive = this.primitive;
+ const primitives = this.primitives;
+ let i;
+ if (this.createPrimitive) {
+ const geometries = this.geometry.values;
+ const geometriesLength = geometries.length;
+ if (geometriesLength > 0) {
+ if (defined_default(primitive)) {
+ if (!defined_default(this.oldPrimitive)) {
+ this.oldPrimitive = primitive;
+ } else {
+ primitives.remove(primitive);
+ }
+ }
+ let depthFailAppearance;
+ if (defined_default(this.depthFailAppearanceType)) {
+ if (defined_default(this.depthFailMaterialProperty)) {
+ this.depthFailMaterial = MaterialProperty_default.getValue(
+ time,
+ this.depthFailMaterialProperty,
+ this.depthFailMaterial
+ );
+ }
+ depthFailAppearance = new this.depthFailAppearanceType({
+ material: this.depthFailMaterial,
+ translucent: this.translucent,
+ closed: this.closed
+ });
+ }
+ primitive = new Primitive_default({
+ show: false,
+ asynchronous: true,
+ geometryInstances: geometries.slice(),
+ appearance: new this.appearanceType({
+ translucent: this.translucent,
+ closed: this.closed
+ }),
+ depthFailAppearance,
+ shadows: this.shadows
+ });
+ primitives.add(primitive);
+ isUpdated = false;
+ } else {
+ if (defined_default(primitive)) {
+ primitives.remove(primitive);
+ primitive = void 0;
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ primitives.remove(oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ }
+ this.attributes.removeAll();
+ this.primitive = primitive;
+ this.createPrimitive = false;
+ this.waitingOnCreate = true;
+ } else if (defined_default(primitive) && primitive.ready) {
+ primitive.show = true;
+ if (defined_default(this.oldPrimitive)) {
+ primitives.remove(this.oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ if (defined_default(this.depthFailAppearanceType) && !(this.depthFailMaterialProperty instanceof ColorMaterialProperty_default)) {
+ this.depthFailMaterial = MaterialProperty_default.getValue(
+ time,
+ this.depthFailMaterialProperty,
+ this.depthFailMaterial
+ );
+ this.primitive.depthFailAppearance.material = this.depthFailMaterial;
+ }
+ const updatersWithAttributes = this.updatersWithAttributes.values;
+ const length3 = updatersWithAttributes.length;
+ const waitingOnCreate = this.waitingOnCreate;
+ for (i = 0; i < length3; i++) {
+ const updater = updatersWithAttributes[i];
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ if (!updater.fillMaterialProperty.isConstant || waitingOnCreate) {
+ const colorProperty = updater.fillMaterialProperty.color;
+ const resultColor = Property_default.getValueOrDefault(
+ colorProperty,
+ time,
+ Color_default.WHITE,
+ colorScratch2
+ );
+ if (!Color_default.equals(attributes._lastColor, resultColor)) {
+ attributes._lastColor = Color_default.clone(
+ resultColor,
+ attributes._lastColor
+ );
+ attributes.color = ColorGeometryInstanceAttribute_default.toValue(
+ resultColor,
+ attributes.color
+ );
+ if (this.translucent && attributes.color[3] === 255 || !this.translucent && attributes.color[3] !== 255) {
+ this.itemsToRemove[removedCount++] = updater;
+ }
+ }
+ }
+ if (defined_default(this.depthFailAppearanceType) && updater.depthFailMaterialProperty instanceof ColorMaterialProperty_default && (!updater.depthFailMaterialProperty.isConstant || waitingOnCreate)) {
+ const depthFailColorProperty = updater.depthFailMaterialProperty.color;
+ const depthColor = Property_default.getValueOrDefault(
+ depthFailColorProperty,
+ time,
+ Color_default.WHITE,
+ colorScratch2
+ );
+ if (!Color_default.equals(attributes._lastDepthFailColor, depthColor)) {
+ attributes._lastDepthFailColor = Color_default.clone(
+ depthColor,
+ attributes._lastDepthFailColor
+ );
+ attributes.depthFailColor = ColorGeometryInstanceAttribute_default.toValue(
+ depthColor,
+ attributes.depthFailColor
+ );
+ }
+ }
+ const show = updater.entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ }
+ const distanceDisplayConditionProperty = updater.distanceDisplayConditionProperty;
+ if (!Property_default.isConstant(distanceDisplayConditionProperty)) {
+ const distanceDisplayCondition = Property_default.getValueOrDefault(
+ distanceDisplayConditionProperty,
+ time,
+ defaultDistanceDisplayCondition2,
+ distanceDisplayConditionScratch2
+ );
+ if (!DistanceDisplayCondition_default.equals(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ )) {
+ attributes._lastDistanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ );
+ attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute_default.toValue(
+ distanceDisplayCondition,
+ attributes.distanceDisplayCondition
+ );
+ }
+ }
+ const offsetProperty = updater.terrainOffsetProperty;
+ if (!Property_default.isConstant(offsetProperty)) {
+ const offset2 = Property_default.getValueOrDefault(
+ offsetProperty,
+ time,
+ defaultOffset9,
+ offsetScratch11
+ );
+ if (!Cartesian3_default.equals(offset2, attributes._lastOffset)) {
+ attributes._lastOffset = Cartesian3_default.clone(
+ offset2,
+ attributes._lastOffset
+ );
+ attributes.offset = OffsetGeometryInstanceAttribute_default.toValue(
+ offset2,
+ attributes.offset
+ );
+ }
+ }
+ }
+ this.updateShows(primitive);
+ this.waitingOnCreate = false;
+ } else if (defined_default(primitive) && !primitive.ready) {
+ isUpdated = false;
+ }
+ this.itemsToRemove.length = removedCount;
+ return isUpdated;
+};
+Batch.prototype.updateShows = function(primitive) {
+ const showsUpdated = this.showsUpdated.values;
+ const length3 = showsUpdated.length;
+ for (let i = 0; i < length3; i++) {
+ const updater = showsUpdated[i];
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ const show = updater.entity.isShowing;
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ instance.attributes.show.value[0] = attributes.show[0];
+ }
+ }
+ this.showsUpdated.removeAll();
+};
+Batch.prototype.contains = function(updater) {
+ return this.updaters.contains(updater.id);
+};
+Batch.prototype.getBoundingSphere = function(updater, result) {
+ const primitive = this.primitive;
+ if (!primitive.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ const attributes = primitive.getGeometryInstanceAttributes(updater.entity);
+ if (!defined_default(attributes) || !defined_default(attributes.boundingSphere) || defined_default(attributes.show) && attributes.show[0] === 0) {
+ return BoundingSphereState_default.FAILED;
+ }
+ attributes.boundingSphere.clone(result);
+ return BoundingSphereState_default.DONE;
+};
+Batch.prototype.destroy = function() {
+ const primitive = this.primitive;
+ const primitives = this.primitives;
+ if (defined_default(primitive)) {
+ primitives.remove(primitive);
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ primitives.remove(oldPrimitive);
+ }
+ if (defined_default(this.removeMaterialSubscription)) {
+ this.removeMaterialSubscription();
+ }
+};
+function StaticGeometryColorBatch(primitives, appearanceType, depthFailAppearanceType, closed, shadows) {
+ this._solidItems = [];
+ this._translucentItems = [];
+ this._primitives = primitives;
+ this._appearanceType = appearanceType;
+ this._depthFailAppearanceType = depthFailAppearanceType;
+ this._closed = closed;
+ this._shadows = shadows;
+}
+StaticGeometryColorBatch.prototype.add = function(time, updater) {
+ let items;
+ let translucent;
+ const instance = updater.createFillGeometryInstance(time);
+ if (instance.attributes.color.value[3] === 255) {
+ items = this._solidItems;
+ translucent = false;
+ } else {
+ items = this._translucentItems;
+ translucent = true;
+ }
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ const item = items[i];
+ if (item.isMaterial(updater)) {
+ item.add(updater, instance);
+ return;
+ }
+ }
+ const batch = new Batch(
+ this._primitives,
+ translucent,
+ this._appearanceType,
+ this._depthFailAppearanceType,
+ updater.depthFailMaterialProperty,
+ this._closed,
+ this._shadows
+ );
+ batch.add(updater, instance);
+ items.push(batch);
+};
+function removeItem(items, updater) {
+ const length3 = items.length;
+ for (let i = length3 - 1; i >= 0; i--) {
+ const item = items[i];
+ if (item.remove(updater)) {
+ if (item.updaters.length === 0) {
+ items.splice(i, 1);
+ item.destroy();
+ }
+ return true;
+ }
+ }
+ return false;
+}
+StaticGeometryColorBatch.prototype.remove = function(updater) {
+ if (!removeItem(this._solidItems, updater)) {
+ removeItem(this._translucentItems, updater);
+ }
+};
+function moveItems(batch, items, time) {
+ let itemsMoved = false;
+ const length3 = items.length;
+ for (let i = 0; i < length3; ++i) {
+ const item = items[i];
+ const itemsToRemove = item.itemsToRemove;
+ const itemsToMoveLength = itemsToRemove.length;
+ if (itemsToMoveLength > 0) {
+ for (i = 0; i < itemsToMoveLength; i++) {
+ const updater = itemsToRemove[i];
+ item.remove(updater);
+ batch.add(time, updater);
+ itemsMoved = true;
+ }
+ }
+ }
+ return itemsMoved;
+}
+function updateItems(batch, items, time, isUpdated) {
+ let length3 = items.length;
+ let i;
+ for (i = length3 - 1; i >= 0; i--) {
+ const item = items[i];
+ if (item.invalidated) {
+ items.splice(i, 1);
+ const updaters = item.updaters.values;
+ const updatersLength = updaters.length;
+ for (let h = 0; h < updatersLength; h++) {
+ batch.add(time, updaters[h]);
+ }
+ item.destroy();
+ }
+ }
+ length3 = items.length;
+ for (i = 0; i < length3; ++i) {
+ isUpdated = items[i].update(time) && isUpdated;
+ }
+ return isUpdated;
+}
+StaticGeometryColorBatch.prototype.update = function(time) {
+ let isUpdated = updateItems(this, this._solidItems, time, true);
+ isUpdated = updateItems(this, this._translucentItems, time, isUpdated) && isUpdated;
+ const solidsMoved = moveItems(this, this._solidItems, time);
+ const translucentsMoved = moveItems(this, this._translucentItems, time);
+ if (solidsMoved || translucentsMoved) {
+ isUpdated = updateItems(this, this._solidItems, time, isUpdated) && isUpdated;
+ isUpdated = updateItems(this, this._translucentItems, time, isUpdated) && isUpdated;
+ }
+ return isUpdated;
+};
+function getBoundingSphere(items, updater, result) {
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ const item = items[i];
+ if (item.contains(updater)) {
+ return item.getBoundingSphere(updater, result);
+ }
+ }
+ return BoundingSphereState_default.FAILED;
+}
+StaticGeometryColorBatch.prototype.getBoundingSphere = function(updater, result) {
+ const boundingSphere = getBoundingSphere(this._solidItems, updater, result);
+ if (boundingSphere === BoundingSphereState_default.FAILED) {
+ return getBoundingSphere(this._translucentItems, updater, result);
+ }
+ return boundingSphere;
+};
+function removeAllPrimitives(items) {
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ items[i].destroy();
+ }
+ items.length = 0;
+}
+StaticGeometryColorBatch.prototype.removeAllPrimitives = function() {
+ removeAllPrimitives(this._solidItems);
+ removeAllPrimitives(this._translucentItems);
+};
+var StaticGeometryColorBatch_default = StaticGeometryColorBatch;
+
+// Source/DataSources/StaticGeometryPerMaterialBatch.js
+var distanceDisplayConditionScratch3 = new DistanceDisplayCondition_default();
+var defaultDistanceDisplayCondition3 = new DistanceDisplayCondition_default();
+var defaultOffset10 = Cartesian3_default.ZERO;
+var offsetScratch12 = new Cartesian3_default();
+function Batch2(primitives, appearanceType, materialProperty, depthFailAppearanceType, depthFailMaterialProperty, closed, shadows) {
+ this.primitives = primitives;
+ this.appearanceType = appearanceType;
+ this.materialProperty = materialProperty;
+ this.depthFailAppearanceType = depthFailAppearanceType;
+ this.depthFailMaterialProperty = depthFailMaterialProperty;
+ this.closed = closed;
+ this.shadows = shadows;
+ this.updaters = new AssociativeArray_default();
+ this.createPrimitive = true;
+ this.primitive = void 0;
+ this.oldPrimitive = void 0;
+ this.geometry = new AssociativeArray_default();
+ this.material = void 0;
+ this.depthFailMaterial = void 0;
+ this.updatersWithAttributes = new AssociativeArray_default();
+ this.attributes = new AssociativeArray_default();
+ this.invalidated = false;
+ this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener(
+ Batch2.prototype.onMaterialChanged,
+ this
+ );
+ this.subscriptions = new AssociativeArray_default();
+ this.showsUpdated = new AssociativeArray_default();
+}
+Batch2.prototype.onMaterialChanged = function() {
+ this.invalidated = true;
+};
+Batch2.prototype.isMaterial = function(updater) {
+ const material = this.materialProperty;
+ const updaterMaterial = updater.fillMaterialProperty;
+ const depthFailMaterial = this.depthFailMaterialProperty;
+ const updaterDepthFailMaterial = updater.depthFailMaterialProperty;
+ if (updaterMaterial === material && updaterDepthFailMaterial === depthFailMaterial) {
+ return true;
+ }
+ let equals = defined_default(material) && material.equals(updaterMaterial);
+ equals = (!defined_default(depthFailMaterial) && !defined_default(updaterDepthFailMaterial) || defined_default(depthFailMaterial) && depthFailMaterial.equals(updaterDepthFailMaterial)) && equals;
+ return equals;
+};
+Batch2.prototype.add = function(time, updater) {
+ const id = updater.id;
+ this.updaters.set(id, updater);
+ this.geometry.set(id, updater.createFillGeometryInstance(time));
+ if (!updater.hasConstantFill || !updater.fillMaterialProperty.isConstant || !Property_default.isConstant(updater.distanceDisplayConditionProperty) || !Property_default.isConstant(updater.terrainOffsetProperty)) {
+ this.updatersWithAttributes.set(id, updater);
+ } else {
+ const that = this;
+ this.subscriptions.set(
+ id,
+ updater.entity.definitionChanged.addEventListener(function(entity, propertyName, newValue, oldValue2) {
+ if (propertyName === "isShowing") {
+ that.showsUpdated.set(updater.id, updater);
+ }
+ })
+ );
+ }
+ this.createPrimitive = true;
+};
+Batch2.prototype.remove = function(updater) {
+ const id = updater.id;
+ this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;
+ if (this.updaters.remove(id)) {
+ this.updatersWithAttributes.remove(id);
+ const unsubscribe2 = this.subscriptions.get(id);
+ if (defined_default(unsubscribe2)) {
+ unsubscribe2();
+ this.subscriptions.remove(id);
+ this.showsUpdated.remove(id);
+ }
+ return true;
+ }
+ return false;
+};
+var colorScratch3 = new Color_default();
+Batch2.prototype.update = function(time) {
+ let isUpdated = true;
+ let primitive = this.primitive;
+ const primitives = this.primitives;
+ const geometries = this.geometry.values;
+ let i;
+ if (this.createPrimitive) {
+ const geometriesLength = geometries.length;
+ if (geometriesLength > 0) {
+ if (defined_default(primitive)) {
+ if (!defined_default(this.oldPrimitive)) {
+ this.oldPrimitive = primitive;
+ } else {
+ primitives.remove(primitive);
+ }
+ }
+ this.material = MaterialProperty_default.getValue(
+ time,
+ this.materialProperty,
+ this.material
+ );
+ let depthFailAppearance;
+ if (defined_default(this.depthFailMaterialProperty)) {
+ this.depthFailMaterial = MaterialProperty_default.getValue(
+ time,
+ this.depthFailMaterialProperty,
+ this.depthFailMaterial
+ );
+ depthFailAppearance = new this.depthFailAppearanceType({
+ material: this.depthFailMaterial,
+ translucent: this.depthFailMaterial.isTranslucent(),
+ closed: this.closed
+ });
+ }
+ primitive = new Primitive_default({
+ show: false,
+ asynchronous: true,
+ geometryInstances: geometries.slice(),
+ appearance: new this.appearanceType({
+ material: this.material,
+ translucent: this.material.isTranslucent(),
+ closed: this.closed
+ }),
+ depthFailAppearance,
+ shadows: this.shadows
+ });
+ primitives.add(primitive);
+ isUpdated = false;
+ } else {
+ if (defined_default(primitive)) {
+ primitives.remove(primitive);
+ primitive = void 0;
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ primitives.remove(oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ }
+ this.attributes.removeAll();
+ this.primitive = primitive;
+ this.createPrimitive = false;
+ } else if (defined_default(primitive) && primitive.ready) {
+ primitive.show = true;
+ if (defined_default(this.oldPrimitive)) {
+ primitives.remove(this.oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ this.material = MaterialProperty_default.getValue(
+ time,
+ this.materialProperty,
+ this.material
+ );
+ this.primitive.appearance.material = this.material;
+ if (defined_default(this.depthFailAppearanceType) && !(this.depthFailMaterialProperty instanceof ColorMaterialProperty_default)) {
+ this.depthFailMaterial = MaterialProperty_default.getValue(
+ time,
+ this.depthFailMaterialProperty,
+ this.depthFailMaterial
+ );
+ this.primitive.depthFailAppearance.material = this.depthFailMaterial;
+ }
+ const updatersWithAttributes = this.updatersWithAttributes.values;
+ const length3 = updatersWithAttributes.length;
+ for (i = 0; i < length3; i++) {
+ const updater = updatersWithAttributes[i];
+ const entity = updater.entity;
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ if (defined_default(this.depthFailAppearanceType) && this.depthFailMaterialProperty instanceof ColorMaterialProperty_default && !updater.depthFailMaterialProperty.isConstant) {
+ const depthFailColorProperty = updater.depthFailMaterialProperty.color;
+ const depthFailColor = Property_default.getValueOrDefault(
+ depthFailColorProperty,
+ time,
+ Color_default.WHITE,
+ colorScratch3
+ );
+ if (!Color_default.equals(attributes._lastDepthFailColor, depthFailColor)) {
+ attributes._lastDepthFailColor = Color_default.clone(
+ depthFailColor,
+ attributes._lastDepthFailColor
+ );
+ attributes.depthFailColor = ColorGeometryInstanceAttribute_default.toValue(
+ depthFailColor,
+ attributes.depthFailColor
+ );
+ }
+ }
+ const show = entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ }
+ const distanceDisplayConditionProperty = updater.distanceDisplayConditionProperty;
+ if (!Property_default.isConstant(distanceDisplayConditionProperty)) {
+ const distanceDisplayCondition = Property_default.getValueOrDefault(
+ distanceDisplayConditionProperty,
+ time,
+ defaultDistanceDisplayCondition3,
+ distanceDisplayConditionScratch3
+ );
+ if (!DistanceDisplayCondition_default.equals(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ )) {
+ attributes._lastDistanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ );
+ attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute_default.toValue(
+ distanceDisplayCondition,
+ attributes.distanceDisplayCondition
+ );
+ }
+ }
+ const offsetProperty = updater.terrainOffsetProperty;
+ if (!Property_default.isConstant(offsetProperty)) {
+ const offset2 = Property_default.getValueOrDefault(
+ offsetProperty,
+ time,
+ defaultOffset10,
+ offsetScratch12
+ );
+ if (!Cartesian3_default.equals(offset2, attributes._lastOffset)) {
+ attributes._lastOffset = Cartesian3_default.clone(
+ offset2,
+ attributes._lastOffset
+ );
+ attributes.offset = OffsetGeometryInstanceAttribute_default.toValue(
+ offset2,
+ attributes.offset
+ );
+ }
+ }
+ }
+ this.updateShows(primitive);
+ } else if (defined_default(primitive) && !primitive.ready) {
+ isUpdated = false;
+ }
+ return isUpdated;
+};
+Batch2.prototype.updateShows = function(primitive) {
+ const showsUpdated = this.showsUpdated.values;
+ const length3 = showsUpdated.length;
+ for (let i = 0; i < length3; i++) {
+ const updater = showsUpdated[i];
+ const entity = updater.entity;
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ const show = entity.isShowing;
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ instance.attributes.show.value[0] = attributes.show[0];
+ }
+ }
+ this.showsUpdated.removeAll();
+};
+Batch2.prototype.contains = function(updater) {
+ return this.updaters.contains(updater.id);
+};
+Batch2.prototype.getBoundingSphere = function(updater, result) {
+ const primitive = this.primitive;
+ if (!primitive.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ const attributes = primitive.getGeometryInstanceAttributes(updater.entity);
+ if (!defined_default(attributes) || !defined_default(attributes.boundingSphere) || defined_default(attributes.show) && attributes.show[0] === 0) {
+ return BoundingSphereState_default.FAILED;
+ }
+ attributes.boundingSphere.clone(result);
+ return BoundingSphereState_default.DONE;
+};
+Batch2.prototype.destroy = function() {
+ const primitive = this.primitive;
+ const primitives = this.primitives;
+ if (defined_default(primitive)) {
+ primitives.remove(primitive);
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ primitives.remove(oldPrimitive);
+ }
+ this.removeMaterialSubscription();
+};
+function StaticGeometryPerMaterialBatch(primitives, appearanceType, depthFailAppearanceType, closed, shadows) {
+ this._items = [];
+ this._primitives = primitives;
+ this._appearanceType = appearanceType;
+ this._depthFailAppearanceType = depthFailAppearanceType;
+ this._closed = closed;
+ this._shadows = shadows;
+}
+StaticGeometryPerMaterialBatch.prototype.add = function(time, updater) {
+ const items = this._items;
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ const item = items[i];
+ if (item.isMaterial(updater)) {
+ item.add(time, updater);
+ return;
+ }
+ }
+ const batch = new Batch2(
+ this._primitives,
+ this._appearanceType,
+ updater.fillMaterialProperty,
+ this._depthFailAppearanceType,
+ updater.depthFailMaterialProperty,
+ this._closed,
+ this._shadows
+ );
+ batch.add(time, updater);
+ items.push(batch);
+};
+StaticGeometryPerMaterialBatch.prototype.remove = function(updater) {
+ const items = this._items;
+ const length3 = items.length;
+ for (let i = length3 - 1; i >= 0; i--) {
+ const item = items[i];
+ if (item.remove(updater)) {
+ if (item.updaters.length === 0) {
+ items.splice(i, 1);
+ item.destroy();
+ }
+ break;
+ }
+ }
+};
+StaticGeometryPerMaterialBatch.prototype.update = function(time) {
+ let i;
+ const items = this._items;
+ const length3 = items.length;
+ for (i = length3 - 1; i >= 0; i--) {
+ const item = items[i];
+ if (item.invalidated) {
+ items.splice(i, 1);
+ const updaters = item.updaters.values;
+ const updatersLength = updaters.length;
+ for (let h = 0; h < updatersLength; h++) {
+ this.add(time, updaters[h]);
+ }
+ item.destroy();
+ }
+ }
+ let isUpdated = true;
+ for (i = 0; i < items.length; i++) {
+ isUpdated = items[i].update(time) && isUpdated;
+ }
+ return isUpdated;
+};
+StaticGeometryPerMaterialBatch.prototype.getBoundingSphere = function(updater, result) {
+ const items = this._items;
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ const item = items[i];
+ if (item.contains(updater)) {
+ return item.getBoundingSphere(updater, result);
+ }
+ }
+ return BoundingSphereState_default.FAILED;
+};
+StaticGeometryPerMaterialBatch.prototype.removeAllPrimitives = function() {
+ const items = this._items;
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ items[i].destroy();
+ }
+ this._items.length = 0;
+};
+var StaticGeometryPerMaterialBatch_default = StaticGeometryPerMaterialBatch;
+
+// Source/Core/RectangleCollisionChecker.js
+var import_rbush = __toESM(require_rbush_min(), 1);
+function RectangleCollisionChecker() {
+ this._tree = new import_rbush.default();
+}
+function RectangleWithId() {
+ this.minX = 0;
+ this.minY = 0;
+ this.maxX = 0;
+ this.maxY = 0;
+ this.id = "";
+}
+RectangleWithId.fromRectangleAndId = function(id, rectangle, result) {
+ result.minX = rectangle.west;
+ result.minY = rectangle.south;
+ result.maxX = rectangle.east;
+ result.maxY = rectangle.north;
+ result.id = id;
+ return result;
+};
+RectangleCollisionChecker.prototype.insert = function(id, rectangle) {
+ Check_default.typeOf.string("id", id);
+ Check_default.typeOf.object("rectangle", rectangle);
+ const withId = RectangleWithId.fromRectangleAndId(
+ id,
+ rectangle,
+ new RectangleWithId()
+ );
+ this._tree.insert(withId);
+};
+function idCompare(a3, b) {
+ return a3.id === b.id;
+}
+var removalScratch = new RectangleWithId();
+RectangleCollisionChecker.prototype.remove = function(id, rectangle) {
+ Check_default.typeOf.string("id", id);
+ Check_default.typeOf.object("rectangle", rectangle);
+ const withId = RectangleWithId.fromRectangleAndId(
+ id,
+ rectangle,
+ removalScratch
+ );
+ this._tree.remove(withId, idCompare);
+};
+var collisionScratch = new RectangleWithId();
+RectangleCollisionChecker.prototype.collides = function(rectangle) {
+ Check_default.typeOf.object("rectangle", rectangle);
+ const withId = RectangleWithId.fromRectangleAndId(
+ "",
+ rectangle,
+ collisionScratch
+ );
+ return this._tree.collides(withId);
+};
+var RectangleCollisionChecker_default = RectangleCollisionChecker;
+
+// Source/DataSources/StaticGroundGeometryColorBatch.js
+var colorScratch4 = new Color_default();
+var distanceDisplayConditionScratch4 = new DistanceDisplayCondition_default();
+var defaultDistanceDisplayCondition4 = new DistanceDisplayCondition_default();
+function Batch3(primitives, classificationType, color, zIndex) {
+ this.primitives = primitives;
+ this.zIndex = zIndex;
+ this.classificationType = classificationType;
+ this.color = color;
+ this.createPrimitive = false;
+ this.waitingOnCreate = false;
+ this.primitive = void 0;
+ this.oldPrimitive = void 0;
+ this.geometry = new AssociativeArray_default();
+ this.updaters = new AssociativeArray_default();
+ this.updatersWithAttributes = new AssociativeArray_default();
+ this.attributes = new AssociativeArray_default();
+ this.subscriptions = new AssociativeArray_default();
+ this.showsUpdated = new AssociativeArray_default();
+ this.itemsToRemove = [];
+ this.isDirty = false;
+ this.rectangleCollisionCheck = new RectangleCollisionChecker_default();
+}
+Batch3.prototype.overlapping = function(rectangle) {
+ return this.rectangleCollisionCheck.collides(rectangle);
+};
+Batch3.prototype.add = function(updater, instance) {
+ const id = updater.id;
+ this.createPrimitive = true;
+ this.geometry.set(id, instance);
+ this.updaters.set(id, updater);
+ this.rectangleCollisionCheck.insert(id, instance.geometry.rectangle);
+ if (!updater.hasConstantFill || !updater.fillMaterialProperty.isConstant || !Property_default.isConstant(updater.distanceDisplayConditionProperty)) {
+ this.updatersWithAttributes.set(id, updater);
+ } else {
+ const that = this;
+ this.subscriptions.set(
+ id,
+ updater.entity.definitionChanged.addEventListener(function(entity, propertyName, newValue, oldValue2) {
+ if (propertyName === "isShowing") {
+ that.showsUpdated.set(updater.id, updater);
+ }
+ })
+ );
+ }
+};
+Batch3.prototype.remove = function(updater) {
+ const id = updater.id;
+ const geometryInstance = this.geometry.get(id);
+ this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;
+ if (this.updaters.remove(id)) {
+ this.rectangleCollisionCheck.remove(
+ id,
+ geometryInstance.geometry.rectangle
+ );
+ this.updatersWithAttributes.remove(id);
+ const unsubscribe2 = this.subscriptions.get(id);
+ if (defined_default(unsubscribe2)) {
+ unsubscribe2();
+ this.subscriptions.remove(id);
+ this.showsUpdated.remove(id);
+ }
+ return true;
+ }
+ return false;
+};
+Batch3.prototype.update = function(time) {
+ let isUpdated = true;
+ const removedCount = 0;
+ let primitive = this.primitive;
+ const primitives = this.primitives;
+ let i;
+ if (this.createPrimitive) {
+ const geometries = this.geometry.values;
+ const geometriesLength = geometries.length;
+ if (geometriesLength > 0) {
+ if (defined_default(primitive)) {
+ if (!defined_default(this.oldPrimitive)) {
+ this.oldPrimitive = primitive;
+ } else {
+ primitives.remove(primitive);
+ }
+ }
+ primitive = new GroundPrimitive_default({
+ show: false,
+ asynchronous: true,
+ geometryInstances: geometries.slice(),
+ classificationType: this.classificationType
+ });
+ primitives.add(primitive, this.zIndex);
+ isUpdated = false;
+ } else {
+ if (defined_default(primitive)) {
+ primitives.remove(primitive);
+ primitive = void 0;
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ primitives.remove(oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ }
+ this.attributes.removeAll();
+ this.primitive = primitive;
+ this.createPrimitive = false;
+ this.waitingOnCreate = true;
+ } else if (defined_default(primitive) && primitive.ready) {
+ primitive.show = true;
+ if (defined_default(this.oldPrimitive)) {
+ primitives.remove(this.oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ const updatersWithAttributes = this.updatersWithAttributes.values;
+ const length3 = updatersWithAttributes.length;
+ const waitingOnCreate = this.waitingOnCreate;
+ for (i = 0; i < length3; i++) {
+ const updater = updatersWithAttributes[i];
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ if (!updater.fillMaterialProperty.isConstant || waitingOnCreate) {
+ const colorProperty = updater.fillMaterialProperty.color;
+ const fillColor = Property_default.getValueOrDefault(
+ colorProperty,
+ time,
+ Color_default.WHITE,
+ colorScratch4
+ );
+ if (!Color_default.equals(attributes._lastColor, fillColor)) {
+ attributes._lastColor = Color_default.clone(fillColor, attributes._lastColor);
+ attributes.color = ColorGeometryInstanceAttribute_default.toValue(
+ fillColor,
+ attributes.color
+ );
+ }
+ }
+ const show = updater.entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ }
+ const distanceDisplayConditionProperty = updater.distanceDisplayConditionProperty;
+ if (!Property_default.isConstant(distanceDisplayConditionProperty)) {
+ const distanceDisplayCondition = Property_default.getValueOrDefault(
+ distanceDisplayConditionProperty,
+ time,
+ defaultDistanceDisplayCondition4,
+ distanceDisplayConditionScratch4
+ );
+ if (!DistanceDisplayCondition_default.equals(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ )) {
+ attributes._lastDistanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ );
+ attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute_default.toValue(
+ distanceDisplayCondition,
+ attributes.distanceDisplayCondition
+ );
+ }
+ }
+ }
+ this.updateShows(primitive);
+ this.waitingOnCreate = false;
+ } else if (defined_default(primitive) && !primitive.ready) {
+ isUpdated = false;
+ }
+ this.itemsToRemove.length = removedCount;
+ return isUpdated;
+};
+Batch3.prototype.updateShows = function(primitive) {
+ const showsUpdated = this.showsUpdated.values;
+ const length3 = showsUpdated.length;
+ for (let i = 0; i < length3; i++) {
+ const updater = showsUpdated[i];
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ const show = updater.entity.isShowing;
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ instance.attributes.show.value[0] = attributes.show[0];
+ }
+ }
+ this.showsUpdated.removeAll();
+};
+Batch3.prototype.contains = function(updater) {
+ return this.updaters.contains(updater.id);
+};
+Batch3.prototype.getBoundingSphere = function(updater, result) {
+ const primitive = this.primitive;
+ if (!primitive.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ const bs = primitive.getBoundingSphere(updater.entity);
+ if (!defined_default(bs)) {
+ return BoundingSphereState_default.FAILED;
+ }
+ bs.clone(result);
+ return BoundingSphereState_default.DONE;
+};
+Batch3.prototype.removeAllPrimitives = function() {
+ const primitives = this.primitives;
+ const primitive = this.primitive;
+ if (defined_default(primitive)) {
+ primitives.remove(primitive);
+ this.primitive = void 0;
+ this.geometry.removeAll();
+ this.updaters.removeAll();
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ primitives.remove(oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+};
+function StaticGroundGeometryColorBatch(primitives, classificationType) {
+ this._batches = [];
+ this._primitives = primitives;
+ this._classificationType = classificationType;
+}
+StaticGroundGeometryColorBatch.prototype.add = function(time, updater) {
+ const instance = updater.createFillGeometryInstance(time);
+ const batches = this._batches;
+ const zIndex = Property_default.getValueOrDefault(updater.zIndex, 0);
+ let batch;
+ const length3 = batches.length;
+ for (let i = 0; i < length3; ++i) {
+ const item = batches[i];
+ if (item.zIndex === zIndex && !item.overlapping(instance.geometry.rectangle)) {
+ batch = item;
+ break;
+ }
+ }
+ if (!defined_default(batch)) {
+ batch = new Batch3(
+ this._primitives,
+ this._classificationType,
+ instance.attributes.color.value,
+ zIndex
+ );
+ batches.push(batch);
+ }
+ batch.add(updater, instance);
+ return batch;
+};
+StaticGroundGeometryColorBatch.prototype.remove = function(updater) {
+ const batches = this._batches;
+ const count = batches.length;
+ for (let i = 0; i < count; ++i) {
+ if (batches[i].remove(updater)) {
+ return;
+ }
+ }
+};
+StaticGroundGeometryColorBatch.prototype.update = function(time) {
+ let i;
+ let updater;
+ let isUpdated = true;
+ const batches = this._batches;
+ const batchCount = batches.length;
+ for (i = 0; i < batchCount; ++i) {
+ isUpdated = batches[i].update(time) && isUpdated;
+ }
+ for (i = 0; i < batchCount; ++i) {
+ const oldBatch = batches[i];
+ const itemsToRemove = oldBatch.itemsToRemove;
+ const itemsToMoveLength = itemsToRemove.length;
+ for (let j = 0; j < itemsToMoveLength; j++) {
+ updater = itemsToRemove[j];
+ oldBatch.remove(updater);
+ const newBatch = this.add(time, updater);
+ oldBatch.isDirty = true;
+ newBatch.isDirty = true;
+ }
+ }
+ for (i = batchCount - 1; i >= 0; --i) {
+ const batch = batches[i];
+ if (batch.isDirty) {
+ isUpdated = batches[i].update(time) && isUpdated;
+ batch.isDirty = false;
+ }
+ if (batch.geometry.length === 0) {
+ batches.splice(i, 1);
+ }
+ }
+ return isUpdated;
+};
+StaticGroundGeometryColorBatch.prototype.getBoundingSphere = function(updater, result) {
+ const batches = this._batches;
+ const batchCount = batches.length;
+ for (let i = 0; i < batchCount; ++i) {
+ const batch = batches[i];
+ if (batch.contains(updater)) {
+ return batch.getBoundingSphere(updater, result);
+ }
+ }
+ return BoundingSphereState_default.FAILED;
+};
+StaticGroundGeometryColorBatch.prototype.removeAllPrimitives = function() {
+ const batches = this._batches;
+ const batchCount = batches.length;
+ for (let i = 0; i < batchCount; ++i) {
+ batches[i].removeAllPrimitives();
+ }
+};
+var StaticGroundGeometryColorBatch_default = StaticGroundGeometryColorBatch;
+
+// Source/DataSources/StaticGroundGeometryPerMaterialBatch.js
+var distanceDisplayConditionScratch5 = new DistanceDisplayCondition_default();
+var defaultDistanceDisplayCondition5 = new DistanceDisplayCondition_default();
+function Batch4(primitives, classificationType, appearanceType, materialProperty, usingSphericalTextureCoordinates, zIndex) {
+ this.primitives = primitives;
+ this.classificationType = classificationType;
+ this.appearanceType = appearanceType;
+ this.materialProperty = materialProperty;
+ this.updaters = new AssociativeArray_default();
+ this.createPrimitive = true;
+ this.primitive = void 0;
+ this.oldPrimitive = void 0;
+ this.geometry = new AssociativeArray_default();
+ this.material = void 0;
+ this.updatersWithAttributes = new AssociativeArray_default();
+ this.attributes = new AssociativeArray_default();
+ this.invalidated = false;
+ this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener(
+ Batch4.prototype.onMaterialChanged,
+ this
+ );
+ this.subscriptions = new AssociativeArray_default();
+ this.showsUpdated = new AssociativeArray_default();
+ this.usingSphericalTextureCoordinates = usingSphericalTextureCoordinates;
+ this.zIndex = zIndex;
+ this.rectangleCollisionCheck = new RectangleCollisionChecker_default();
+}
+Batch4.prototype.onMaterialChanged = function() {
+ this.invalidated = true;
+};
+Batch4.prototype.overlapping = function(rectangle) {
+ return this.rectangleCollisionCheck.collides(rectangle);
+};
+Batch4.prototype.isMaterial = function(updater) {
+ const material = this.materialProperty;
+ const updaterMaterial = updater.fillMaterialProperty;
+ if (updaterMaterial === material || updaterMaterial instanceof ColorMaterialProperty_default && material instanceof ColorMaterialProperty_default) {
+ return true;
+ }
+ return defined_default(material) && material.equals(updaterMaterial);
+};
+Batch4.prototype.add = function(time, updater, geometryInstance) {
+ const id = updater.id;
+ this.updaters.set(id, updater);
+ this.geometry.set(id, geometryInstance);
+ this.rectangleCollisionCheck.insert(id, geometryInstance.geometry.rectangle);
+ if (!updater.hasConstantFill || !updater.fillMaterialProperty.isConstant || !Property_default.isConstant(updater.distanceDisplayConditionProperty)) {
+ this.updatersWithAttributes.set(id, updater);
+ } else {
+ const that = this;
+ this.subscriptions.set(
+ id,
+ updater.entity.definitionChanged.addEventListener(function(entity, propertyName, newValue, oldValue2) {
+ if (propertyName === "isShowing") {
+ that.showsUpdated.set(updater.id, updater);
+ }
+ })
+ );
+ }
+ this.createPrimitive = true;
+};
+Batch4.prototype.remove = function(updater) {
+ const id = updater.id;
+ const geometryInstance = this.geometry.get(id);
+ this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;
+ if (this.updaters.remove(id)) {
+ this.rectangleCollisionCheck.remove(
+ id,
+ geometryInstance.geometry.rectangle
+ );
+ this.updatersWithAttributes.remove(id);
+ const unsubscribe2 = this.subscriptions.get(id);
+ if (defined_default(unsubscribe2)) {
+ unsubscribe2();
+ this.subscriptions.remove(id);
+ }
+ return true;
+ }
+ return false;
+};
+Batch4.prototype.update = function(time) {
+ let isUpdated = true;
+ let primitive = this.primitive;
+ const primitives = this.primitives;
+ const geometries = this.geometry.values;
+ let i;
+ if (this.createPrimitive) {
+ const geometriesLength = geometries.length;
+ if (geometriesLength > 0) {
+ if (defined_default(primitive)) {
+ if (!defined_default(this.oldPrimitive)) {
+ this.oldPrimitive = primitive;
+ } else {
+ primitives.remove(primitive);
+ }
+ }
+ this.material = MaterialProperty_default.getValue(
+ time,
+ this.materialProperty,
+ this.material
+ );
+ primitive = new GroundPrimitive_default({
+ show: false,
+ asynchronous: true,
+ geometryInstances: geometries.slice(),
+ appearance: new this.appearanceType({
+ material: this.material
+ }),
+ classificationType: this.classificationType
+ });
+ primitives.add(primitive, this.zIndex);
+ isUpdated = false;
+ } else {
+ if (defined_default(primitive)) {
+ primitives.remove(primitive);
+ primitive = void 0;
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ primitives.remove(oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ }
+ this.attributes.removeAll();
+ this.primitive = primitive;
+ this.createPrimitive = false;
+ } else if (defined_default(primitive) && primitive.ready) {
+ primitive.show = true;
+ if (defined_default(this.oldPrimitive)) {
+ primitives.remove(this.oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ this.material = MaterialProperty_default.getValue(
+ time,
+ this.materialProperty,
+ this.material
+ );
+ this.primitive.appearance.material = this.material;
+ const updatersWithAttributes = this.updatersWithAttributes.values;
+ const length3 = updatersWithAttributes.length;
+ for (i = 0; i < length3; i++) {
+ const updater = updatersWithAttributes[i];
+ const entity = updater.entity;
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ const show = entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ }
+ const distanceDisplayConditionProperty = updater.distanceDisplayConditionProperty;
+ if (!Property_default.isConstant(distanceDisplayConditionProperty)) {
+ const distanceDisplayCondition = Property_default.getValueOrDefault(
+ distanceDisplayConditionProperty,
+ time,
+ defaultDistanceDisplayCondition5,
+ distanceDisplayConditionScratch5
+ );
+ if (!DistanceDisplayCondition_default.equals(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ )) {
+ attributes._lastDistanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ );
+ attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute_default.toValue(
+ distanceDisplayCondition,
+ attributes.distanceDisplayCondition
+ );
+ }
+ }
+ }
+ this.updateShows(primitive);
+ } else if (defined_default(primitive) && !primitive.ready) {
+ isUpdated = false;
+ }
+ return isUpdated;
+};
+Batch4.prototype.updateShows = function(primitive) {
+ const showsUpdated = this.showsUpdated.values;
+ const length3 = showsUpdated.length;
+ for (let i = 0; i < length3; i++) {
+ const updater = showsUpdated[i];
+ const entity = updater.entity;
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ const show = entity.isShowing;
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ instance.attributes.show.value[0] = attributes.show[0];
+ }
+ }
+ this.showsUpdated.removeAll();
+};
+Batch4.prototype.contains = function(updater) {
+ return this.updaters.contains(updater.id);
+};
+Batch4.prototype.getBoundingSphere = function(updater, result) {
+ const primitive = this.primitive;
+ if (!primitive.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ const attributes = primitive.getGeometryInstanceAttributes(updater.entity);
+ if (!defined_default(attributes) || !defined_default(attributes.boundingSphere) || defined_default(attributes.show) && attributes.show[0] === 0) {
+ return BoundingSphereState_default.FAILED;
+ }
+ attributes.boundingSphere.clone(result);
+ return BoundingSphereState_default.DONE;
+};
+Batch4.prototype.destroy = function() {
+ const primitive = this.primitive;
+ const primitives = this.primitives;
+ if (defined_default(primitive)) {
+ primitives.remove(primitive);
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ primitives.remove(oldPrimitive);
+ }
+ this.removeMaterialSubscription();
+};
+function StaticGroundGeometryPerMaterialBatch(primitives, classificationType, appearanceType) {
+ this._items = [];
+ this._primitives = primitives;
+ this._classificationType = classificationType;
+ this._appearanceType = appearanceType;
+}
+StaticGroundGeometryPerMaterialBatch.prototype.add = function(time, updater) {
+ const items = this._items;
+ const length3 = items.length;
+ const geometryInstance = updater.createFillGeometryInstance(time);
+ const usingSphericalTextureCoordinates = ShadowVolumeAppearance_default.shouldUseSphericalCoordinates(
+ geometryInstance.geometry.rectangle
+ );
+ const zIndex = Property_default.getValueOrDefault(updater.zIndex, 0);
+ for (let i = 0; i < length3; ++i) {
+ const item = items[i];
+ if (item.isMaterial(updater) && item.usingSphericalTextureCoordinates === usingSphericalTextureCoordinates && item.zIndex === zIndex && !item.overlapping(geometryInstance.geometry.rectangle)) {
+ item.add(time, updater, geometryInstance);
+ return;
+ }
+ }
+ const batch = new Batch4(
+ this._primitives,
+ this._classificationType,
+ this._appearanceType,
+ updater.fillMaterialProperty,
+ usingSphericalTextureCoordinates,
+ zIndex
+ );
+ batch.add(time, updater, geometryInstance);
+ items.push(batch);
+};
+StaticGroundGeometryPerMaterialBatch.prototype.remove = function(updater) {
+ const items = this._items;
+ const length3 = items.length;
+ for (let i = length3 - 1; i >= 0; i--) {
+ const item = items[i];
+ if (item.remove(updater)) {
+ if (item.updaters.length === 0) {
+ items.splice(i, 1);
+ item.destroy();
+ }
+ break;
+ }
+ }
+};
+StaticGroundGeometryPerMaterialBatch.prototype.update = function(time) {
+ let i;
+ const items = this._items;
+ const length3 = items.length;
+ for (i = length3 - 1; i >= 0; i--) {
+ const item = items[i];
+ if (item.invalidated) {
+ items.splice(i, 1);
+ const updaters = item.updaters.values;
+ const updatersLength = updaters.length;
+ for (let h = 0; h < updatersLength; h++) {
+ this.add(time, updaters[h]);
+ }
+ item.destroy();
+ }
+ }
+ let isUpdated = true;
+ for (i = 0; i < items.length; i++) {
+ isUpdated = items[i].update(time) && isUpdated;
+ }
+ return isUpdated;
+};
+StaticGroundGeometryPerMaterialBatch.prototype.getBoundingSphere = function(updater, result) {
+ const items = this._items;
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ const item = items[i];
+ if (item.contains(updater)) {
+ return item.getBoundingSphere(updater, result);
+ }
+ }
+ return BoundingSphereState_default.FAILED;
+};
+StaticGroundGeometryPerMaterialBatch.prototype.removeAllPrimitives = function() {
+ const items = this._items;
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ items[i].destroy();
+ }
+ this._items.length = 0;
+};
+var StaticGroundGeometryPerMaterialBatch_default = StaticGroundGeometryPerMaterialBatch;
+
+// Source/DataSources/StaticOutlineGeometryBatch.js
+var colorScratch5 = new Color_default();
+var distanceDisplayConditionScratch6 = new DistanceDisplayCondition_default();
+var defaultDistanceDisplayCondition6 = new DistanceDisplayCondition_default();
+var defaultOffset11 = Cartesian3_default.ZERO;
+var offsetScratch13 = new Cartesian3_default();
+function Batch5(primitives, translucent, width, shadows) {
+ this.translucent = translucent;
+ this.width = width;
+ this.shadows = shadows;
+ this.primitives = primitives;
+ this.createPrimitive = false;
+ this.waitingOnCreate = false;
+ this.primitive = void 0;
+ this.oldPrimitive = void 0;
+ this.geometry = new AssociativeArray_default();
+ this.updaters = new AssociativeArray_default();
+ this.updatersWithAttributes = new AssociativeArray_default();
+ this.attributes = new AssociativeArray_default();
+ this.itemsToRemove = [];
+ this.subscriptions = new AssociativeArray_default();
+ this.showsUpdated = new AssociativeArray_default();
+}
+Batch5.prototype.add = function(updater, instance) {
+ const id = updater.id;
+ this.createPrimitive = true;
+ this.geometry.set(id, instance);
+ this.updaters.set(id, updater);
+ if (!updater.hasConstantOutline || !updater.outlineColorProperty.isConstant || !Property_default.isConstant(updater.distanceDisplayConditionProperty) || !Property_default.isConstant(updater.terrainOffsetProperty)) {
+ this.updatersWithAttributes.set(id, updater);
+ } else {
+ const that = this;
+ this.subscriptions.set(
+ id,
+ updater.entity.definitionChanged.addEventListener(function(entity, propertyName, newValue, oldValue2) {
+ if (propertyName === "isShowing") {
+ that.showsUpdated.set(updater.id, updater);
+ }
+ })
+ );
+ }
+};
+Batch5.prototype.remove = function(updater) {
+ const id = updater.id;
+ this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;
+ if (this.updaters.remove(id)) {
+ this.updatersWithAttributes.remove(id);
+ const unsubscribe2 = this.subscriptions.get(id);
+ if (defined_default(unsubscribe2)) {
+ unsubscribe2();
+ this.subscriptions.remove(id);
+ this.showsUpdated.remove(id);
+ }
+ return true;
+ }
+ return false;
+};
+Batch5.prototype.update = function(time) {
+ let isUpdated = true;
+ let removedCount = 0;
+ let primitive = this.primitive;
+ const primitives = this.primitives;
+ let i;
+ if (this.createPrimitive) {
+ const geometries = this.geometry.values;
+ const geometriesLength = geometries.length;
+ if (geometriesLength > 0) {
+ if (defined_default(primitive)) {
+ if (!defined_default(this.oldPrimitive)) {
+ this.oldPrimitive = primitive;
+ } else {
+ primitives.remove(primitive);
+ }
+ }
+ primitive = new Primitive_default({
+ show: false,
+ asynchronous: true,
+ geometryInstances: geometries.slice(),
+ appearance: new PerInstanceColorAppearance_default({
+ flat: true,
+ translucent: this.translucent,
+ renderState: {
+ lineWidth: this.width
+ }
+ }),
+ shadows: this.shadows
+ });
+ primitives.add(primitive);
+ isUpdated = false;
+ } else {
+ if (defined_default(primitive)) {
+ primitives.remove(primitive);
+ primitive = void 0;
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ primitives.remove(oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ }
+ this.attributes.removeAll();
+ this.primitive = primitive;
+ this.createPrimitive = false;
+ this.waitingOnCreate = true;
+ } else if (defined_default(primitive) && primitive.ready) {
+ primitive.show = true;
+ if (defined_default(this.oldPrimitive)) {
+ primitives.remove(this.oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ const updatersWithAttributes = this.updatersWithAttributes.values;
+ const length3 = updatersWithAttributes.length;
+ const waitingOnCreate = this.waitingOnCreate;
+ for (i = 0; i < length3; i++) {
+ const updater = updatersWithAttributes[i];
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ if (!updater.outlineColorProperty.isConstant || waitingOnCreate) {
+ const outlineColorProperty = updater.outlineColorProperty;
+ const outlineColor = Property_default.getValueOrDefault(
+ outlineColorProperty,
+ time,
+ Color_default.WHITE,
+ colorScratch5
+ );
+ if (!Color_default.equals(attributes._lastColor, outlineColor)) {
+ attributes._lastColor = Color_default.clone(
+ outlineColor,
+ attributes._lastColor
+ );
+ attributes.color = ColorGeometryInstanceAttribute_default.toValue(
+ outlineColor,
+ attributes.color
+ );
+ if (this.translucent && attributes.color[3] === 255 || !this.translucent && attributes.color[3] !== 255) {
+ this.itemsToRemove[removedCount++] = updater;
+ }
+ }
+ }
+ const show = updater.entity.isShowing && (updater.hasConstantOutline || updater.isOutlineVisible(time));
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ }
+ const distanceDisplayConditionProperty = updater.distanceDisplayConditionProperty;
+ if (!Property_default.isConstant(distanceDisplayConditionProperty)) {
+ const distanceDisplayCondition = Property_default.getValueOrDefault(
+ distanceDisplayConditionProperty,
+ time,
+ defaultDistanceDisplayCondition6,
+ distanceDisplayConditionScratch6
+ );
+ if (!DistanceDisplayCondition_default.equals(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ )) {
+ attributes._lastDistanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ );
+ attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute_default.toValue(
+ distanceDisplayCondition,
+ attributes.distanceDisplayCondition
+ );
+ }
+ }
+ const offsetProperty = updater.terrainOffsetProperty;
+ if (!Property_default.isConstant(offsetProperty)) {
+ const offset2 = Property_default.getValueOrDefault(
+ offsetProperty,
+ time,
+ defaultOffset11,
+ offsetScratch13
+ );
+ if (!Cartesian3_default.equals(offset2, attributes._lastOffset)) {
+ attributes._lastOffset = Cartesian3_default.clone(
+ offset2,
+ attributes._lastOffset
+ );
+ attributes.offset = OffsetGeometryInstanceAttribute_default.toValue(
+ offset2,
+ attributes.offset
+ );
+ }
+ }
+ }
+ this.updateShows(primitive);
+ this.waitingOnCreate = false;
+ } else if (defined_default(primitive) && !primitive.ready) {
+ isUpdated = false;
+ }
+ this.itemsToRemove.length = removedCount;
+ return isUpdated;
+};
+Batch5.prototype.updateShows = function(primitive) {
+ const showsUpdated = this.showsUpdated.values;
+ const length3 = showsUpdated.length;
+ for (let i = 0; i < length3; i++) {
+ const updater = showsUpdated[i];
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ const show = updater.entity.isShowing;
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ instance.attributes.show.value[0] = attributes.show[0];
+ }
+ }
+ this.showsUpdated.removeAll();
+};
+Batch5.prototype.contains = function(updater) {
+ return this.updaters.contains(updater.id);
+};
+Batch5.prototype.getBoundingSphere = function(updater, result) {
+ const primitive = this.primitive;
+ if (!primitive.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ const attributes = primitive.getGeometryInstanceAttributes(updater.entity);
+ if (!defined_default(attributes) || !defined_default(attributes.boundingSphere) || defined_default(attributes.show) && attributes.show[0] === 0) {
+ return BoundingSphereState_default.FAILED;
+ }
+ attributes.boundingSphere.clone(result);
+ return BoundingSphereState_default.DONE;
+};
+Batch5.prototype.removeAllPrimitives = function() {
+ const primitives = this.primitives;
+ const primitive = this.primitive;
+ if (defined_default(primitive)) {
+ primitives.remove(primitive);
+ this.primitive = void 0;
+ this.geometry.removeAll();
+ this.updaters.removeAll();
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ primitives.remove(oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+};
+function StaticOutlineGeometryBatch(primitives, scene, shadows) {
+ this._primitives = primitives;
+ this._scene = scene;
+ this._shadows = shadows;
+ this._solidBatches = new AssociativeArray_default();
+ this._translucentBatches = new AssociativeArray_default();
+}
+StaticOutlineGeometryBatch.prototype.add = function(time, updater) {
+ const instance = updater.createOutlineGeometryInstance(time);
+ const width = this._scene.clampLineWidth(updater.outlineWidth);
+ let batches;
+ let batch;
+ if (instance.attributes.color.value[3] === 255) {
+ batches = this._solidBatches;
+ batch = batches.get(width);
+ if (!defined_default(batch)) {
+ batch = new Batch5(this._primitives, false, width, this._shadows);
+ batches.set(width, batch);
+ }
+ batch.add(updater, instance);
+ } else {
+ batches = this._translucentBatches;
+ batch = batches.get(width);
+ if (!defined_default(batch)) {
+ batch = new Batch5(this._primitives, true, width, this._shadows);
+ batches.set(width, batch);
+ }
+ batch.add(updater, instance);
+ }
+};
+StaticOutlineGeometryBatch.prototype.remove = function(updater) {
+ let i;
+ const solidBatches = this._solidBatches.values;
+ const solidBatchesLength = solidBatches.length;
+ for (i = 0; i < solidBatchesLength; i++) {
+ if (solidBatches[i].remove(updater)) {
+ return;
+ }
+ }
+ const translucentBatches = this._translucentBatches.values;
+ const translucentBatchesLength = translucentBatches.length;
+ for (i = 0; i < translucentBatchesLength; i++) {
+ if (translucentBatches[i].remove(updater)) {
+ return;
+ }
+ }
+};
+StaticOutlineGeometryBatch.prototype.update = function(time) {
+ let i;
+ let x;
+ let updater;
+ let batch;
+ const solidBatches = this._solidBatches.values;
+ const solidBatchesLength = solidBatches.length;
+ const translucentBatches = this._translucentBatches.values;
+ const translucentBatchesLength = translucentBatches.length;
+ let itemsToRemove;
+ let isUpdated = true;
+ let needUpdate = false;
+ do {
+ needUpdate = false;
+ for (x = 0; x < solidBatchesLength; x++) {
+ batch = solidBatches[x];
+ isUpdated = batch.update(time);
+ itemsToRemove = batch.itemsToRemove;
+ const solidsToMoveLength = itemsToRemove.length;
+ if (solidsToMoveLength > 0) {
+ needUpdate = true;
+ for (i = 0; i < solidsToMoveLength; i++) {
+ updater = itemsToRemove[i];
+ batch.remove(updater);
+ this.add(time, updater);
+ }
+ }
+ }
+ for (x = 0; x < translucentBatchesLength; x++) {
+ batch = translucentBatches[x];
+ isUpdated = batch.update(time);
+ itemsToRemove = batch.itemsToRemove;
+ const translucentToMoveLength = itemsToRemove.length;
+ if (translucentToMoveLength > 0) {
+ needUpdate = true;
+ for (i = 0; i < translucentToMoveLength; i++) {
+ updater = itemsToRemove[i];
+ batch.remove(updater);
+ this.add(time, updater);
+ }
+ }
+ }
+ } while (needUpdate);
+ return isUpdated;
+};
+StaticOutlineGeometryBatch.prototype.getBoundingSphere = function(updater, result) {
+ let i;
+ const solidBatches = this._solidBatches.values;
+ const solidBatchesLength = solidBatches.length;
+ for (i = 0; i < solidBatchesLength; i++) {
+ const solidBatch = solidBatches[i];
+ if (solidBatch.contains(updater)) {
+ return solidBatch.getBoundingSphere(updater, result);
+ }
+ }
+ const translucentBatches = this._translucentBatches.values;
+ const translucentBatchesLength = translucentBatches.length;
+ for (i = 0; i < translucentBatchesLength; i++) {
+ const translucentBatch = translucentBatches[i];
+ if (translucentBatch.contains(updater)) {
+ return translucentBatch.getBoundingSphere(updater, result);
+ }
+ }
+ return BoundingSphereState_default.FAILED;
+};
+StaticOutlineGeometryBatch.prototype.removeAllPrimitives = function() {
+ let i;
+ const solidBatches = this._solidBatches.values;
+ const solidBatchesLength = solidBatches.length;
+ for (i = 0; i < solidBatchesLength; i++) {
+ solidBatches[i].removeAllPrimitives();
+ }
+ const translucentBatches = this._translucentBatches.values;
+ const translucentBatchesLength = translucentBatches.length;
+ for (i = 0; i < translucentBatchesLength; i++) {
+ translucentBatches[i].removeAllPrimitives();
+ }
+};
+var StaticOutlineGeometryBatch_default = StaticOutlineGeometryBatch;
+
+// Source/Core/WallGeometryLibrary.js
+var WallGeometryLibrary = {};
+function latLonEquals(c0, c14) {
+ return Math_default.equalsEpsilon(c0.latitude, c14.latitude, Math_default.EPSILON10) && Math_default.equalsEpsilon(c0.longitude, c14.longitude, Math_default.EPSILON10);
+}
+var scratchCartographic13 = new Cartographic_default();
+var scratchCartographic23 = new Cartographic_default();
+function removeDuplicates(ellipsoid, positions, topHeights, bottomHeights) {
+ positions = arrayRemoveDuplicates_default(positions, Cartesian3_default.equalsEpsilon);
+ const length3 = positions.length;
+ if (length3 < 2) {
+ return;
+ }
+ const hasBottomHeights = defined_default(bottomHeights);
+ const hasTopHeights = defined_default(topHeights);
+ const cleanedPositions = new Array(length3);
+ const cleanedTopHeights = new Array(length3);
+ const cleanedBottomHeights = new Array(length3);
+ const v02 = positions[0];
+ cleanedPositions[0] = v02;
+ const c0 = ellipsoid.cartesianToCartographic(v02, scratchCartographic13);
+ if (hasTopHeights) {
+ c0.height = topHeights[0];
+ }
+ cleanedTopHeights[0] = c0.height;
+ if (hasBottomHeights) {
+ cleanedBottomHeights[0] = bottomHeights[0];
+ } else {
+ cleanedBottomHeights[0] = 0;
+ }
+ const startTopHeight = cleanedTopHeights[0];
+ const startBottomHeight = cleanedBottomHeights[0];
+ let hasAllSameHeights = startTopHeight === startBottomHeight;
+ let index = 1;
+ for (let i = 1; i < length3; ++i) {
+ const v13 = positions[i];
+ const c14 = ellipsoid.cartesianToCartographic(v13, scratchCartographic23);
+ if (hasTopHeights) {
+ c14.height = topHeights[i];
+ }
+ hasAllSameHeights = hasAllSameHeights && c14.height === 0;
+ if (!latLonEquals(c0, c14)) {
+ cleanedPositions[index] = v13;
+ cleanedTopHeights[index] = c14.height;
+ if (hasBottomHeights) {
+ cleanedBottomHeights[index] = bottomHeights[i];
+ } else {
+ cleanedBottomHeights[index] = 0;
+ }
+ hasAllSameHeights = hasAllSameHeights && cleanedTopHeights[index] === cleanedBottomHeights[index];
+ Cartographic_default.clone(c14, c0);
+ ++index;
+ } else if (c0.height < c14.height) {
+ cleanedTopHeights[index - 1] = c14.height;
+ }
+ }
+ if (hasAllSameHeights || index < 2) {
+ return;
+ }
+ cleanedPositions.length = index;
+ cleanedTopHeights.length = index;
+ cleanedBottomHeights.length = index;
+ return {
+ positions: cleanedPositions,
+ topHeights: cleanedTopHeights,
+ bottomHeights: cleanedBottomHeights
+ };
+}
+var positionsArrayScratch = new Array(2);
+var heightsArrayScratch = new Array(2);
+var generateArcOptionsScratch = {
+ positions: void 0,
+ height: void 0,
+ granularity: void 0,
+ ellipsoid: void 0
+};
+WallGeometryLibrary.computePositions = function(ellipsoid, wallPositions, maximumHeights, minimumHeights, granularity, duplicateCorners) {
+ const o = removeDuplicates(
+ ellipsoid,
+ wallPositions,
+ maximumHeights,
+ minimumHeights
+ );
+ if (!defined_default(o)) {
+ return;
+ }
+ wallPositions = o.positions;
+ maximumHeights = o.topHeights;
+ minimumHeights = o.bottomHeights;
+ const length3 = wallPositions.length;
+ const numCorners = length3 - 2;
+ let topPositions;
+ let bottomPositions;
+ const minDistance = Math_default.chordLength(
+ granularity,
+ ellipsoid.maximumRadius
+ );
+ const generateArcOptions = generateArcOptionsScratch;
+ generateArcOptions.minDistance = minDistance;
+ generateArcOptions.ellipsoid = ellipsoid;
+ if (duplicateCorners) {
+ let count = 0;
+ let i;
+ for (i = 0; i < length3 - 1; i++) {
+ count += PolylinePipeline_default.numberOfPoints(
+ wallPositions[i],
+ wallPositions[i + 1],
+ minDistance
+ ) + 1;
+ }
+ topPositions = new Float64Array(count * 3);
+ bottomPositions = new Float64Array(count * 3);
+ const generateArcPositions = positionsArrayScratch;
+ const generateArcHeights = heightsArrayScratch;
+ generateArcOptions.positions = generateArcPositions;
+ generateArcOptions.height = generateArcHeights;
+ let offset2 = 0;
+ for (i = 0; i < length3 - 1; i++) {
+ generateArcPositions[0] = wallPositions[i];
+ generateArcPositions[1] = wallPositions[i + 1];
+ generateArcHeights[0] = maximumHeights[i];
+ generateArcHeights[1] = maximumHeights[i + 1];
+ const pos = PolylinePipeline_default.generateArc(generateArcOptions);
+ topPositions.set(pos, offset2);
+ generateArcHeights[0] = minimumHeights[i];
+ generateArcHeights[1] = minimumHeights[i + 1];
+ bottomPositions.set(
+ PolylinePipeline_default.generateArc(generateArcOptions),
+ offset2
+ );
+ offset2 += pos.length;
+ }
+ } else {
+ generateArcOptions.positions = wallPositions;
+ generateArcOptions.height = maximumHeights;
+ topPositions = new Float64Array(
+ PolylinePipeline_default.generateArc(generateArcOptions)
+ );
+ generateArcOptions.height = minimumHeights;
+ bottomPositions = new Float64Array(
+ PolylinePipeline_default.generateArc(generateArcOptions)
+ );
+ }
+ return {
+ bottomPositions,
+ topPositions,
+ numCorners
+ };
+};
+var WallGeometryLibrary_default = WallGeometryLibrary;
+
+// Source/Core/WallGeometry.js
+var scratchCartesian3Position1 = new Cartesian3_default();
+var scratchCartesian3Position2 = new Cartesian3_default();
+var scratchCartesian3Position4 = new Cartesian3_default();
+var scratchCartesian3Position5 = new Cartesian3_default();
+var scratchBitangent5 = new Cartesian3_default();
+var scratchTangent5 = new Cartesian3_default();
+var scratchNormal7 = new Cartesian3_default();
+function WallGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const wallPositions = options.positions;
+ const maximumHeights = options.maximumHeights;
+ const minimumHeights = options.minimumHeights;
+ if (!defined_default(wallPositions)) {
+ throw new DeveloperError_default("options.positions is required.");
+ }
+ if (defined_default(maximumHeights) && maximumHeights.length !== wallPositions.length) {
+ throw new DeveloperError_default(
+ "options.positions and options.maximumHeights must have the same length."
+ );
+ }
+ if (defined_default(minimumHeights) && minimumHeights.length !== wallPositions.length) {
+ throw new DeveloperError_default(
+ "options.positions and options.minimumHeights must have the same length."
+ );
+ }
+ const vertexFormat = defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT);
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ this._positions = wallPositions;
+ this._minimumHeights = minimumHeights;
+ this._maximumHeights = maximumHeights;
+ this._vertexFormat = VertexFormat_default.clone(vertexFormat);
+ this._granularity = granularity;
+ this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
+ this._workerName = "createWallGeometry";
+ let numComponents = 1 + wallPositions.length * Cartesian3_default.packedLength + 2;
+ if (defined_default(minimumHeights)) {
+ numComponents += minimumHeights.length;
+ }
+ if (defined_default(maximumHeights)) {
+ numComponents += maximumHeights.length;
+ }
+ this.packedLength = numComponents + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 1;
+}
+WallGeometry.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ let i;
+ const positions = value._positions;
+ let length3 = positions.length;
+ array[startingIndex++] = length3;
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ Cartesian3_default.pack(positions[i], array, startingIndex);
+ }
+ const minimumHeights = value._minimumHeights;
+ length3 = defined_default(minimumHeights) ? minimumHeights.length : 0;
+ array[startingIndex++] = length3;
+ if (defined_default(minimumHeights)) {
+ for (i = 0; i < length3; ++i) {
+ array[startingIndex++] = minimumHeights[i];
+ }
+ }
+ const maximumHeights = value._maximumHeights;
+ length3 = defined_default(maximumHeights) ? maximumHeights.length : 0;
+ array[startingIndex++] = length3;
+ if (defined_default(maximumHeights)) {
+ for (i = 0; i < length3; ++i) {
+ array[startingIndex++] = maximumHeights[i];
+ }
+ }
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat_default.packedLength;
+ array[startingIndex] = value._granularity;
+ return array;
+};
+var scratchEllipsoid12 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchVertexFormat11 = new VertexFormat_default();
+var scratchOptions19 = {
+ positions: void 0,
+ minimumHeights: void 0,
+ maximumHeights: void 0,
+ ellipsoid: scratchEllipsoid12,
+ vertexFormat: scratchVertexFormat11,
+ granularity: void 0
+};
+WallGeometry.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ let i;
+ let length3 = array[startingIndex++];
+ const positions = new Array(length3);
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
+ }
+ length3 = array[startingIndex++];
+ let minimumHeights;
+ if (length3 > 0) {
+ minimumHeights = new Array(length3);
+ for (i = 0; i < length3; ++i) {
+ minimumHeights[i] = array[startingIndex++];
+ }
+ }
+ length3 = array[startingIndex++];
+ let maximumHeights;
+ if (length3 > 0) {
+ maximumHeights = new Array(length3);
+ for (i = 0; i < length3; ++i) {
+ maximumHeights[i] = array[startingIndex++];
+ }
+ }
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid12);
+ startingIndex += Ellipsoid_default.packedLength;
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat11
+ );
+ startingIndex += VertexFormat_default.packedLength;
+ const granularity = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions19.positions = positions;
+ scratchOptions19.minimumHeights = minimumHeights;
+ scratchOptions19.maximumHeights = maximumHeights;
+ scratchOptions19.granularity = granularity;
+ return new WallGeometry(scratchOptions19);
+ }
+ result._positions = positions;
+ result._minimumHeights = minimumHeights;
+ result._maximumHeights = maximumHeights;
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._granularity = granularity;
+ return result;
+};
+WallGeometry.fromConstantHeights = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const positions = options.positions;
+ if (!defined_default(positions)) {
+ throw new DeveloperError_default("options.positions is required.");
+ }
+ let minHeights;
+ let maxHeights;
+ const min3 = options.minimumHeight;
+ const max3 = options.maximumHeight;
+ const doMin = defined_default(min3);
+ const doMax = defined_default(max3);
+ if (doMin || doMax) {
+ const length3 = positions.length;
+ minHeights = doMin ? new Array(length3) : void 0;
+ maxHeights = doMax ? new Array(length3) : void 0;
+ for (let i = 0; i < length3; ++i) {
+ if (doMin) {
+ minHeights[i] = min3;
+ }
+ if (doMax) {
+ maxHeights[i] = max3;
+ }
+ }
+ }
+ const newOptions2 = {
+ positions,
+ maximumHeights: maxHeights,
+ minimumHeights: minHeights,
+ ellipsoid: options.ellipsoid,
+ vertexFormat: options.vertexFormat
+ };
+ return new WallGeometry(newOptions2);
+};
+WallGeometry.createGeometry = function(wallGeometry) {
+ const wallPositions = wallGeometry._positions;
+ const minimumHeights = wallGeometry._minimumHeights;
+ const maximumHeights = wallGeometry._maximumHeights;
+ const vertexFormat = wallGeometry._vertexFormat;
+ const granularity = wallGeometry._granularity;
+ const ellipsoid = wallGeometry._ellipsoid;
+ const pos = WallGeometryLibrary_default.computePositions(
+ ellipsoid,
+ wallPositions,
+ maximumHeights,
+ minimumHeights,
+ granularity,
+ true
+ );
+ if (!defined_default(pos)) {
+ return;
+ }
+ const bottomPositions = pos.bottomPositions;
+ const topPositions = pos.topPositions;
+ const numCorners = pos.numCorners;
+ let length3 = topPositions.length;
+ let size = length3 * 2;
+ const positions = vertexFormat.position ? new Float64Array(size) : void 0;
+ const normals = vertexFormat.normal ? new Float32Array(size) : void 0;
+ const tangents = vertexFormat.tangent ? new Float32Array(size) : void 0;
+ const bitangents = vertexFormat.bitangent ? new Float32Array(size) : void 0;
+ const textureCoordinates = vertexFormat.st ? new Float32Array(size / 3 * 2) : void 0;
+ let positionIndex = 0;
+ let normalIndex = 0;
+ let bitangentIndex = 0;
+ let tangentIndex = 0;
+ let stIndex = 0;
+ let normal2 = scratchNormal7;
+ let tangent = scratchTangent5;
+ let bitangent = scratchBitangent5;
+ let recomputeNormal = true;
+ length3 /= 3;
+ let i;
+ let s = 0;
+ const ds = 1 / (length3 - numCorners - 1);
+ for (i = 0; i < length3; ++i) {
+ const i3 = i * 3;
+ const topPosition = Cartesian3_default.fromArray(
+ topPositions,
+ i3,
+ scratchCartesian3Position1
+ );
+ const bottomPosition = Cartesian3_default.fromArray(
+ bottomPositions,
+ i3,
+ scratchCartesian3Position2
+ );
+ if (vertexFormat.position) {
+ positions[positionIndex++] = bottomPosition.x;
+ positions[positionIndex++] = bottomPosition.y;
+ positions[positionIndex++] = bottomPosition.z;
+ positions[positionIndex++] = topPosition.x;
+ positions[positionIndex++] = topPosition.y;
+ positions[positionIndex++] = topPosition.z;
+ }
+ if (vertexFormat.st) {
+ textureCoordinates[stIndex++] = s;
+ textureCoordinates[stIndex++] = 0;
+ textureCoordinates[stIndex++] = s;
+ textureCoordinates[stIndex++] = 1;
+ }
+ if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
+ let nextTop = Cartesian3_default.clone(
+ Cartesian3_default.ZERO,
+ scratchCartesian3Position5
+ );
+ const groundPosition = Cartesian3_default.subtract(
+ topPosition,
+ ellipsoid.geodeticSurfaceNormal(
+ topPosition,
+ scratchCartesian3Position2
+ ),
+ scratchCartesian3Position2
+ );
+ if (i + 1 < length3) {
+ nextTop = Cartesian3_default.fromArray(
+ topPositions,
+ i3 + 3,
+ scratchCartesian3Position5
+ );
+ }
+ if (recomputeNormal) {
+ const scalednextPosition = Cartesian3_default.subtract(
+ nextTop,
+ topPosition,
+ scratchCartesian3Position4
+ );
+ const scaledGroundPosition = Cartesian3_default.subtract(
+ groundPosition,
+ topPosition,
+ scratchCartesian3Position1
+ );
+ normal2 = Cartesian3_default.normalize(
+ Cartesian3_default.cross(scaledGroundPosition, scalednextPosition, normal2),
+ normal2
+ );
+ recomputeNormal = false;
+ }
+ if (Cartesian3_default.equalsEpsilon(topPosition, nextTop, Math_default.EPSILON10)) {
+ recomputeNormal = true;
+ } else {
+ s += ds;
+ if (vertexFormat.tangent) {
+ tangent = Cartesian3_default.normalize(
+ Cartesian3_default.subtract(nextTop, topPosition, tangent),
+ tangent
+ );
+ }
+ if (vertexFormat.bitangent) {
+ bitangent = Cartesian3_default.normalize(
+ Cartesian3_default.cross(normal2, tangent, bitangent),
+ bitangent
+ );
+ }
+ }
+ if (vertexFormat.normal) {
+ normals[normalIndex++] = normal2.x;
+ normals[normalIndex++] = normal2.y;
+ normals[normalIndex++] = normal2.z;
+ normals[normalIndex++] = normal2.x;
+ normals[normalIndex++] = normal2.y;
+ normals[normalIndex++] = normal2.z;
+ }
+ if (vertexFormat.tangent) {
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ tangents[tangentIndex++] = tangent.x;
+ tangents[tangentIndex++] = tangent.y;
+ tangents[tangentIndex++] = tangent.z;
+ }
+ if (vertexFormat.bitangent) {
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ bitangents[bitangentIndex++] = bitangent.x;
+ bitangents[bitangentIndex++] = bitangent.y;
+ bitangents[bitangentIndex++] = bitangent.z;
+ }
+ }
+ }
+ const attributes = new GeometryAttributes_default();
+ if (vertexFormat.position) {
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ });
+ }
+ if (vertexFormat.normal) {
+ attributes.normal = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: normals
+ });
+ }
+ if (vertexFormat.tangent) {
+ attributes.tangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: tangents
+ });
+ }
+ if (vertexFormat.bitangent) {
+ attributes.bitangent = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 3,
+ values: bitangents
+ });
+ }
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: textureCoordinates
+ });
+ }
+ const numVertices = size / 3;
+ size -= 6 * (numCorners + 1);
+ const indices2 = IndexDatatype_default.createTypedArray(numVertices, size);
+ let edgeIndex = 0;
+ for (i = 0; i < numVertices - 2; i += 2) {
+ const LL = i;
+ const LR = i + 2;
+ const pl = Cartesian3_default.fromArray(
+ positions,
+ LL * 3,
+ scratchCartesian3Position1
+ );
+ const pr = Cartesian3_default.fromArray(
+ positions,
+ LR * 3,
+ scratchCartesian3Position2
+ );
+ if (Cartesian3_default.equalsEpsilon(pl, pr, Math_default.EPSILON10)) {
+ continue;
+ }
+ const UL = i + 1;
+ const UR = i + 3;
+ indices2[edgeIndex++] = UL;
+ indices2[edgeIndex++] = LL;
+ indices2[edgeIndex++] = UR;
+ indices2[edgeIndex++] = UR;
+ indices2[edgeIndex++] = LL;
+ indices2[edgeIndex++] = LR;
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.TRIANGLES,
+ boundingSphere: new BoundingSphere_default.fromVertices(positions)
+ });
+};
+var WallGeometry_default = WallGeometry;
+
+// Source/Core/WallOutlineGeometry.js
+var scratchCartesian3Position12 = new Cartesian3_default();
+var scratchCartesian3Position22 = new Cartesian3_default();
+function WallOutlineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const wallPositions = options.positions;
+ const maximumHeights = options.maximumHeights;
+ const minimumHeights = options.minimumHeights;
+ if (!defined_default(wallPositions)) {
+ throw new DeveloperError_default("options.positions is required.");
+ }
+ if (defined_default(maximumHeights) && maximumHeights.length !== wallPositions.length) {
+ throw new DeveloperError_default(
+ "options.positions and options.maximumHeights must have the same length."
+ );
+ }
+ if (defined_default(minimumHeights) && minimumHeights.length !== wallPositions.length) {
+ throw new DeveloperError_default(
+ "options.positions and options.minimumHeights must have the same length."
+ );
+ }
+ const granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ this._positions = wallPositions;
+ this._minimumHeights = minimumHeights;
+ this._maximumHeights = maximumHeights;
+ this._granularity = granularity;
+ this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
+ this._workerName = "createWallOutlineGeometry";
+ let numComponents = 1 + wallPositions.length * Cartesian3_default.packedLength + 2;
+ if (defined_default(minimumHeights)) {
+ numComponents += minimumHeights.length;
+ }
+ if (defined_default(maximumHeights)) {
+ numComponents += maximumHeights.length;
+ }
+ this.packedLength = numComponents + Ellipsoid_default.packedLength + 1;
+}
+WallOutlineGeometry.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ let i;
+ const positions = value._positions;
+ let length3 = positions.length;
+ array[startingIndex++] = length3;
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ Cartesian3_default.pack(positions[i], array, startingIndex);
+ }
+ const minimumHeights = value._minimumHeights;
+ length3 = defined_default(minimumHeights) ? minimumHeights.length : 0;
+ array[startingIndex++] = length3;
+ if (defined_default(minimumHeights)) {
+ for (i = 0; i < length3; ++i) {
+ array[startingIndex++] = minimumHeights[i];
+ }
+ }
+ const maximumHeights = value._maximumHeights;
+ length3 = defined_default(maximumHeights) ? maximumHeights.length : 0;
+ array[startingIndex++] = length3;
+ if (defined_default(maximumHeights)) {
+ for (i = 0; i < length3; ++i) {
+ array[startingIndex++] = maximumHeights[i];
+ }
+ }
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ array[startingIndex] = value._granularity;
+ return array;
+};
+var scratchEllipsoid13 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchOptions20 = {
+ positions: void 0,
+ minimumHeights: void 0,
+ maximumHeights: void 0,
+ ellipsoid: scratchEllipsoid13,
+ granularity: void 0
+};
+WallOutlineGeometry.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ let i;
+ let length3 = array[startingIndex++];
+ const positions = new Array(length3);
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
+ }
+ length3 = array[startingIndex++];
+ let minimumHeights;
+ if (length3 > 0) {
+ minimumHeights = new Array(length3);
+ for (i = 0; i < length3; ++i) {
+ minimumHeights[i] = array[startingIndex++];
+ }
+ }
+ length3 = array[startingIndex++];
+ let maximumHeights;
+ if (length3 > 0) {
+ maximumHeights = new Array(length3);
+ for (i = 0; i < length3; ++i) {
+ maximumHeights[i] = array[startingIndex++];
+ }
+ }
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid13);
+ startingIndex += Ellipsoid_default.packedLength;
+ const granularity = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions20.positions = positions;
+ scratchOptions20.minimumHeights = minimumHeights;
+ scratchOptions20.maximumHeights = maximumHeights;
+ scratchOptions20.granularity = granularity;
+ return new WallOutlineGeometry(scratchOptions20);
+ }
+ result._positions = positions;
+ result._minimumHeights = minimumHeights;
+ result._maximumHeights = maximumHeights;
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._granularity = granularity;
+ return result;
+};
+WallOutlineGeometry.fromConstantHeights = function(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const positions = options.positions;
+ if (!defined_default(positions)) {
+ throw new DeveloperError_default("options.positions is required.");
+ }
+ let minHeights;
+ let maxHeights;
+ const min3 = options.minimumHeight;
+ const max3 = options.maximumHeight;
+ const doMin = defined_default(min3);
+ const doMax = defined_default(max3);
+ if (doMin || doMax) {
+ const length3 = positions.length;
+ minHeights = doMin ? new Array(length3) : void 0;
+ maxHeights = doMax ? new Array(length3) : void 0;
+ for (let i = 0; i < length3; ++i) {
+ if (doMin) {
+ minHeights[i] = min3;
+ }
+ if (doMax) {
+ maxHeights[i] = max3;
+ }
+ }
+ }
+ const newOptions2 = {
+ positions,
+ maximumHeights: maxHeights,
+ minimumHeights: minHeights,
+ ellipsoid: options.ellipsoid
+ };
+ return new WallOutlineGeometry(newOptions2);
+};
+WallOutlineGeometry.createGeometry = function(wallGeometry) {
+ const wallPositions = wallGeometry._positions;
+ const minimumHeights = wallGeometry._minimumHeights;
+ const maximumHeights = wallGeometry._maximumHeights;
+ const granularity = wallGeometry._granularity;
+ const ellipsoid = wallGeometry._ellipsoid;
+ const pos = WallGeometryLibrary_default.computePositions(
+ ellipsoid,
+ wallPositions,
+ maximumHeights,
+ minimumHeights,
+ granularity,
+ false
+ );
+ if (!defined_default(pos)) {
+ return;
+ }
+ const bottomPositions = pos.bottomPositions;
+ const topPositions = pos.topPositions;
+ let length3 = topPositions.length;
+ let size = length3 * 2;
+ const positions = new Float64Array(size);
+ let positionIndex = 0;
+ length3 /= 3;
+ let i;
+ for (i = 0; i < length3; ++i) {
+ const i3 = i * 3;
+ const topPosition = Cartesian3_default.fromArray(
+ topPositions,
+ i3,
+ scratchCartesian3Position12
+ );
+ const bottomPosition = Cartesian3_default.fromArray(
+ bottomPositions,
+ i3,
+ scratchCartesian3Position22
+ );
+ positions[positionIndex++] = bottomPosition.x;
+ positions[positionIndex++] = bottomPosition.y;
+ positions[positionIndex++] = bottomPosition.z;
+ positions[positionIndex++] = topPosition.x;
+ positions[positionIndex++] = topPosition.y;
+ positions[positionIndex++] = topPosition.z;
+ }
+ const attributes = new GeometryAttributes_default({
+ position: new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: positions
+ })
+ });
+ const numVertices = size / 3;
+ size = 2 * numVertices - 4 + numVertices;
+ const indices2 = IndexDatatype_default.createTypedArray(numVertices, size);
+ let edgeIndex = 0;
+ for (i = 0; i < numVertices - 2; i += 2) {
+ const LL = i;
+ const LR = i + 2;
+ const pl = Cartesian3_default.fromArray(
+ positions,
+ LL * 3,
+ scratchCartesian3Position12
+ );
+ const pr = Cartesian3_default.fromArray(
+ positions,
+ LR * 3,
+ scratchCartesian3Position22
+ );
+ if (Cartesian3_default.equalsEpsilon(pl, pr, Math_default.EPSILON10)) {
+ continue;
+ }
+ const UL = i + 1;
+ const UR = i + 3;
+ indices2[edgeIndex++] = UL;
+ indices2[edgeIndex++] = LL;
+ indices2[edgeIndex++] = UL;
+ indices2[edgeIndex++] = UR;
+ indices2[edgeIndex++] = LL;
+ indices2[edgeIndex++] = LR;
+ }
+ indices2[edgeIndex++] = numVertices - 2;
+ indices2[edgeIndex++] = numVertices - 1;
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.LINES,
+ boundingSphere: new BoundingSphere_default.fromVertices(positions)
+ });
+};
+var WallOutlineGeometry_default = WallOutlineGeometry;
+
+// Source/DataSources/WallGeometryUpdater.js
+var scratchColor19 = new Color_default();
+function WallGeometryOptions(entity) {
+ this.id = entity;
+ this.vertexFormat = void 0;
+ this.positions = void 0;
+ this.minimumHeights = void 0;
+ this.maximumHeights = void 0;
+ this.granularity = void 0;
+}
+function WallGeometryUpdater(entity, scene) {
+ GeometryUpdater_default.call(this, {
+ entity,
+ scene,
+ geometryOptions: new WallGeometryOptions(entity),
+ geometryPropertyName: "wall",
+ observedPropertyNames: ["availability", "wall"]
+ });
+ this._onEntityPropertyChanged(entity, "wall", entity.wall, void 0);
+}
+if (defined_default(Object.create)) {
+ WallGeometryUpdater.prototype = Object.create(GeometryUpdater_default.prototype);
+ WallGeometryUpdater.prototype.constructor = WallGeometryUpdater;
+}
+WallGeometryUpdater.prototype.createFillGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._fillEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent a filled geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ let attributes;
+ let color;
+ const show = new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._fillProperty.getValue(time)
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ );
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ let currentColor;
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor19);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ attributes = {
+ show,
+ distanceDisplayCondition: distanceDisplayConditionAttribute,
+ color
+ };
+ } else {
+ attributes = {
+ show,
+ distanceDisplayCondition: distanceDisplayConditionAttribute
+ };
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new WallGeometry_default(this._options),
+ attributes
+ });
+};
+WallGeometryUpdater.prototype.createOutlineGeometryInstance = function(time) {
+ Check_default.defined("time", time);
+ if (!this._outlineEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent an outlined geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const outlineColor = Property_default.getValueOrDefault(
+ this._outlineColorProperty,
+ time,
+ Color_default.BLACK,
+ scratchColor19
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new WallOutlineGeometry_default(this._options),
+ attributes: {
+ show: new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time) && this._showOutlineProperty.getValue(time)
+ ),
+ color: ColorGeometryInstanceAttribute_default.fromColor(outlineColor),
+ distanceDisplayCondition: DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ )
+ }
+ });
+};
+WallGeometryUpdater.prototype._isHidden = function(entity, wall) {
+ return !defined_default(wall.positions) || GeometryUpdater_default.prototype._isHidden.call(this, entity, wall);
+};
+WallGeometryUpdater.prototype._getIsClosed = function(options) {
+ return false;
+};
+WallGeometryUpdater.prototype._isDynamic = function(entity, wall) {
+ return !wall.positions.isConstant || !Property_default.isConstant(wall.minimumHeights) || !Property_default.isConstant(wall.maximumHeights) || !Property_default.isConstant(wall.outlineWidth) || !Property_default.isConstant(wall.granularity);
+};
+WallGeometryUpdater.prototype._setStaticOptions = function(entity, wall) {
+ const minimumHeights = wall.minimumHeights;
+ const maximumHeights = wall.maximumHeights;
+ const granularity = wall.granularity;
+ const isColorMaterial = this._materialProperty instanceof ColorMaterialProperty_default;
+ const options = this._options;
+ options.vertexFormat = isColorMaterial ? PerInstanceColorAppearance_default.VERTEX_FORMAT : MaterialAppearance_default.MaterialSupport.TEXTURED.vertexFormat;
+ options.positions = wall.positions.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ options.positions
+ );
+ options.minimumHeights = defined_default(minimumHeights) ? minimumHeights.getValue(Iso8601_default.MINIMUM_VALUE, options.minimumHeights) : void 0;
+ options.maximumHeights = defined_default(maximumHeights) ? maximumHeights.getValue(Iso8601_default.MINIMUM_VALUE, options.maximumHeights) : void 0;
+ options.granularity = defined_default(granularity) ? granularity.getValue(Iso8601_default.MINIMUM_VALUE) : void 0;
+};
+WallGeometryUpdater.DynamicGeometryUpdater = DynamicWallGeometryUpdater;
+function DynamicWallGeometryUpdater(geometryUpdater, primitives, groundPrimitives) {
+ DynamicGeometryUpdater_default.call(
+ this,
+ geometryUpdater,
+ primitives,
+ groundPrimitives
+ );
+}
+if (defined_default(Object.create)) {
+ DynamicWallGeometryUpdater.prototype = Object.create(
+ DynamicGeometryUpdater_default.prototype
+ );
+ DynamicWallGeometryUpdater.prototype.constructor = DynamicWallGeometryUpdater;
+}
+DynamicWallGeometryUpdater.prototype._isHidden = function(entity, wall, time) {
+ return !defined_default(this._options.positions) || DynamicGeometryUpdater_default.prototype._isHidden.call(this, entity, wall, time);
+};
+DynamicWallGeometryUpdater.prototype._setOptions = function(entity, wall, time) {
+ const options = this._options;
+ options.positions = Property_default.getValueOrUndefined(
+ wall.positions,
+ time,
+ options.positions
+ );
+ options.minimumHeights = Property_default.getValueOrUndefined(
+ wall.minimumHeights,
+ time,
+ options.minimumHeights
+ );
+ options.maximumHeights = Property_default.getValueOrUndefined(
+ wall.maximumHeights,
+ time,
+ options.maximumHeights
+ );
+ options.granularity = Property_default.getValueOrUndefined(wall.granularity, time);
+};
+var WallGeometryUpdater_default = WallGeometryUpdater;
+
+// Source/DataSources/GeometryVisualizer.js
+var emptyArray = [];
+var geometryUpdaters = [
+ BoxGeometryUpdater_default,
+ CylinderGeometryUpdater_default,
+ CorridorGeometryUpdater_default,
+ EllipseGeometryUpdater_default,
+ EllipsoidGeometryUpdater_default,
+ PlaneGeometryUpdater_default,
+ PolygonGeometryUpdater_default,
+ PolylineVolumeGeometryUpdater_default,
+ RectangleGeometryUpdater_default,
+ WallGeometryUpdater_default
+];
+function GeometryUpdaterSet(entity, scene) {
+ this.entity = entity;
+ this.scene = scene;
+ const updaters = new Array(geometryUpdaters.length);
+ const geometryChanged = new Event_default();
+ function raiseEvent(geometry) {
+ geometryChanged.raiseEvent(geometry);
+ }
+ const eventHelper = new EventHelper_default();
+ for (let i = 0; i < updaters.length; i++) {
+ const updater = new geometryUpdaters[i](entity, scene);
+ eventHelper.add(updater.geometryChanged, raiseEvent);
+ updaters[i] = updater;
+ }
+ this.updaters = updaters;
+ this.geometryChanged = geometryChanged;
+ this.eventHelper = eventHelper;
+ this._removeEntitySubscription = entity.definitionChanged.addEventListener(
+ GeometryUpdaterSet.prototype._onEntityPropertyChanged,
+ this
+ );
+}
+GeometryUpdaterSet.prototype._onEntityPropertyChanged = function(entity, propertyName, newValue, oldValue2) {
+ const updaters = this.updaters;
+ for (let i = 0; i < updaters.length; i++) {
+ updaters[i]._onEntityPropertyChanged(
+ entity,
+ propertyName,
+ newValue,
+ oldValue2
+ );
+ }
+};
+GeometryUpdaterSet.prototype.forEach = function(callback) {
+ const updaters = this.updaters;
+ for (let i = 0; i < updaters.length; i++) {
+ callback(updaters[i]);
+ }
+};
+GeometryUpdaterSet.prototype.destroy = function() {
+ this.eventHelper.removeAll();
+ const updaters = this.updaters;
+ for (let i = 0; i < updaters.length; i++) {
+ updaters[i].destroy();
+ }
+ this._removeEntitySubscription();
+ destroyObject_default(this);
+};
+function GeometryVisualizer(scene, entityCollection, primitives, groundPrimitives) {
+ Check_default.defined("scene", scene);
+ Check_default.defined("entityCollection", entityCollection);
+ primitives = defaultValue_default(primitives, scene.primitives);
+ groundPrimitives = defaultValue_default(groundPrimitives, scene.groundPrimitives);
+ this._scene = scene;
+ this._primitives = primitives;
+ this._groundPrimitives = groundPrimitives;
+ this._entityCollection = void 0;
+ this._addedObjects = new AssociativeArray_default();
+ this._removedObjects = new AssociativeArray_default();
+ this._changedObjects = new AssociativeArray_default();
+ const numberOfShadowModes = ShadowMode_default.NUMBER_OF_SHADOW_MODES;
+ this._outlineBatches = new Array(numberOfShadowModes * 2);
+ this._closedColorBatches = new Array(numberOfShadowModes * 2);
+ this._closedMaterialBatches = new Array(numberOfShadowModes * 2);
+ this._openColorBatches = new Array(numberOfShadowModes * 2);
+ this._openMaterialBatches = new Array(numberOfShadowModes * 2);
+ const supportsMaterialsforEntitiesOnTerrain = Entity_default.supportsMaterialsforEntitiesOnTerrain(
+ scene
+ );
+ this._supportsMaterialsforEntitiesOnTerrain = supportsMaterialsforEntitiesOnTerrain;
+ let i;
+ for (i = 0; i < numberOfShadowModes; ++i) {
+ this._outlineBatches[i] = new StaticOutlineGeometryBatch_default(
+ primitives,
+ scene,
+ i,
+ false
+ );
+ this._outlineBatches[numberOfShadowModes + i] = new StaticOutlineGeometryBatch_default(primitives, scene, i, true);
+ this._closedColorBatches[i] = new StaticGeometryColorBatch_default(
+ primitives,
+ PerInstanceColorAppearance_default,
+ void 0,
+ true,
+ i,
+ true
+ );
+ this._closedColorBatches[numberOfShadowModes + i] = new StaticGeometryColorBatch_default(
+ primitives,
+ PerInstanceColorAppearance_default,
+ void 0,
+ true,
+ i,
+ false
+ );
+ this._closedMaterialBatches[i] = new StaticGeometryPerMaterialBatch_default(
+ primitives,
+ MaterialAppearance_default,
+ void 0,
+ true,
+ i,
+ true
+ );
+ this._closedMaterialBatches[numberOfShadowModes + i] = new StaticGeometryPerMaterialBatch_default(
+ primitives,
+ MaterialAppearance_default,
+ void 0,
+ true,
+ i,
+ false
+ );
+ this._openColorBatches[i] = new StaticGeometryColorBatch_default(
+ primitives,
+ PerInstanceColorAppearance_default,
+ void 0,
+ false,
+ i,
+ true
+ );
+ this._openColorBatches[numberOfShadowModes + i] = new StaticGeometryColorBatch_default(
+ primitives,
+ PerInstanceColorAppearance_default,
+ void 0,
+ false,
+ i,
+ false
+ );
+ this._openMaterialBatches[i] = new StaticGeometryPerMaterialBatch_default(
+ primitives,
+ MaterialAppearance_default,
+ void 0,
+ false,
+ i,
+ true
+ );
+ this._openMaterialBatches[numberOfShadowModes + i] = new StaticGeometryPerMaterialBatch_default(
+ primitives,
+ MaterialAppearance_default,
+ void 0,
+ false,
+ i,
+ false
+ );
+ }
+ const numberOfClassificationTypes = ClassificationType_default.NUMBER_OF_CLASSIFICATION_TYPES;
+ const groundColorBatches = new Array(numberOfClassificationTypes);
+ const groundMaterialBatches = [];
+ if (supportsMaterialsforEntitiesOnTerrain) {
+ for (i = 0; i < numberOfClassificationTypes; ++i) {
+ groundMaterialBatches.push(
+ new StaticGroundGeometryPerMaterialBatch_default(
+ groundPrimitives,
+ i,
+ MaterialAppearance_default
+ )
+ );
+ groundColorBatches[i] = new StaticGroundGeometryColorBatch_default(
+ groundPrimitives,
+ i
+ );
+ }
+ } else {
+ for (i = 0; i < numberOfClassificationTypes; ++i) {
+ groundColorBatches[i] = new StaticGroundGeometryColorBatch_default(
+ groundPrimitives,
+ i
+ );
+ }
+ }
+ this._groundColorBatches = groundColorBatches;
+ this._groundMaterialBatches = groundMaterialBatches;
+ this._dynamicBatch = new DynamicGeometryBatch_default(primitives, groundPrimitives);
+ this._batches = this._outlineBatches.concat(
+ this._closedColorBatches,
+ this._closedMaterialBatches,
+ this._openColorBatches,
+ this._openMaterialBatches,
+ this._groundColorBatches,
+ this._groundMaterialBatches,
+ this._dynamicBatch
+ );
+ this._subscriptions = new AssociativeArray_default();
+ this._updaterSets = new AssociativeArray_default();
+ this._entityCollection = entityCollection;
+ entityCollection.collectionChanged.addEventListener(
+ GeometryVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ this._onCollectionChanged(
+ entityCollection,
+ entityCollection.values,
+ emptyArray
+ );
+}
+GeometryVisualizer.prototype.update = function(time) {
+ Check_default.defined("time", time);
+ const addedObjects = this._addedObjects;
+ const added = addedObjects.values;
+ const removedObjects = this._removedObjects;
+ const removed = removedObjects.values;
+ const changedObjects = this._changedObjects;
+ const changed = changedObjects.values;
+ let i;
+ let entity;
+ let id;
+ let updaterSet;
+ const that = this;
+ for (i = changed.length - 1; i > -1; i--) {
+ entity = changed[i];
+ id = entity.id;
+ updaterSet = this._updaterSets.get(id);
+ if (updaterSet.entity === entity) {
+ updaterSet.forEach(function(updater) {
+ that._removeUpdater(updater);
+ that._insertUpdaterIntoBatch(time, updater);
+ });
+ } else {
+ removed.push(entity);
+ added.push(entity);
+ }
+ }
+ for (i = removed.length - 1; i > -1; i--) {
+ entity = removed[i];
+ id = entity.id;
+ updaterSet = this._updaterSets.get(id);
+ updaterSet.forEach(this._removeUpdater.bind(this));
+ updaterSet.destroy();
+ this._updaterSets.remove(id);
+ this._subscriptions.get(id)();
+ this._subscriptions.remove(id);
+ }
+ for (i = added.length - 1; i > -1; i--) {
+ entity = added[i];
+ id = entity.id;
+ updaterSet = new GeometryUpdaterSet(entity, this._scene);
+ this._updaterSets.set(id, updaterSet);
+ updaterSet.forEach(function(updater) {
+ that._insertUpdaterIntoBatch(time, updater);
+ });
+ this._subscriptions.set(
+ id,
+ updaterSet.geometryChanged.addEventListener(
+ GeometryVisualizer._onGeometryChanged,
+ this
+ )
+ );
+ }
+ addedObjects.removeAll();
+ removedObjects.removeAll();
+ changedObjects.removeAll();
+ let isUpdated = true;
+ const batches = this._batches;
+ const length3 = batches.length;
+ for (i = 0; i < length3; i++) {
+ isUpdated = batches[i].update(time) && isUpdated;
+ }
+ return isUpdated;
+};
+var getBoundingSphereArrayScratch = [];
+var getBoundingSphereBoundingSphereScratch = new BoundingSphere_default();
+GeometryVisualizer.prototype.getBoundingSphere = function(entity, result) {
+ Check_default.defined("entity", entity);
+ Check_default.defined("result", result);
+ const boundingSpheres = getBoundingSphereArrayScratch;
+ const tmp2 = getBoundingSphereBoundingSphereScratch;
+ let count = 0;
+ let state = BoundingSphereState_default.DONE;
+ const batches = this._batches;
+ const batchesLength = batches.length;
+ const id = entity.id;
+ const updaters = this._updaterSets.get(id).updaters;
+ for (let j = 0; j < updaters.length; j++) {
+ const updater = updaters[j];
+ for (let i = 0; i < batchesLength; i++) {
+ state = batches[i].getBoundingSphere(updater, tmp2);
+ if (state === BoundingSphereState_default.PENDING) {
+ return BoundingSphereState_default.PENDING;
+ } else if (state === BoundingSphereState_default.DONE) {
+ boundingSpheres[count] = BoundingSphere_default.clone(
+ tmp2,
+ boundingSpheres[count]
+ );
+ count++;
+ }
+ }
+ }
+ if (count === 0) {
+ return BoundingSphereState_default.FAILED;
+ }
+ boundingSpheres.length = count;
+ BoundingSphere_default.fromBoundingSpheres(boundingSpheres, result);
+ return BoundingSphereState_default.DONE;
+};
+GeometryVisualizer.prototype.isDestroyed = function() {
+ return false;
+};
+GeometryVisualizer.prototype.destroy = function() {
+ this._entityCollection.collectionChanged.removeEventListener(
+ GeometryVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ this._addedObjects.removeAll();
+ this._removedObjects.removeAll();
+ let i;
+ const batches = this._batches;
+ let length3 = batches.length;
+ for (i = 0; i < length3; i++) {
+ batches[i].removeAllPrimitives();
+ }
+ const subscriptions = this._subscriptions.values;
+ length3 = subscriptions.length;
+ for (i = 0; i < length3; i++) {
+ subscriptions[i]();
+ }
+ this._subscriptions.removeAll();
+ const updaterSets = this._updaterSets.values;
+ length3 = updaterSets.length;
+ for (i = 0; i < length3; i++) {
+ updaterSets[i].destroy();
+ }
+ this._updaterSets.removeAll();
+ return destroyObject_default(this);
+};
+GeometryVisualizer.prototype._removeUpdater = function(updater) {
+ const batches = this._batches;
+ const length3 = batches.length;
+ for (let i = 0; i < length3; i++) {
+ batches[i].remove(updater);
+ }
+};
+GeometryVisualizer.prototype._insertUpdaterIntoBatch = function(time, updater) {
+ if (updater.isDynamic) {
+ this._dynamicBatch.add(time, updater);
+ return;
+ }
+ let shadows;
+ if (updater.outlineEnabled || updater.fillEnabled) {
+ shadows = updater.shadowsProperty.getValue(time);
+ }
+ const numberOfShadowModes = ShadowMode_default.NUMBER_OF_SHADOW_MODES;
+ if (updater.outlineEnabled) {
+ if (defined_default(updater.terrainOffsetProperty)) {
+ this._outlineBatches[numberOfShadowModes + shadows].add(time, updater);
+ } else {
+ this._outlineBatches[shadows].add(time, updater);
+ }
+ }
+ if (updater.fillEnabled) {
+ if (updater.onTerrain) {
+ const classificationType = updater.classificationTypeProperty.getValue(
+ time
+ );
+ if (updater.fillMaterialProperty instanceof ColorMaterialProperty_default) {
+ this._groundColorBatches[classificationType].add(time, updater);
+ } else {
+ this._groundMaterialBatches[classificationType].add(time, updater);
+ }
+ } else if (updater.isClosed) {
+ if (updater.fillMaterialProperty instanceof ColorMaterialProperty_default) {
+ if (defined_default(updater.terrainOffsetProperty)) {
+ this._closedColorBatches[numberOfShadowModes + shadows].add(
+ time,
+ updater
+ );
+ } else {
+ this._closedColorBatches[shadows].add(time, updater);
+ }
+ } else if (defined_default(updater.terrainOffsetProperty)) {
+ this._closedMaterialBatches[numberOfShadowModes + shadows].add(
+ time,
+ updater
+ );
+ } else {
+ this._closedMaterialBatches[shadows].add(time, updater);
+ }
+ } else if (updater.fillMaterialProperty instanceof ColorMaterialProperty_default) {
+ if (defined_default(updater.terrainOffsetProperty)) {
+ this._openColorBatches[numberOfShadowModes + shadows].add(
+ time,
+ updater
+ );
+ } else {
+ this._openColorBatches[shadows].add(time, updater);
+ }
+ } else if (defined_default(updater.terrainOffsetProperty)) {
+ this._openMaterialBatches[numberOfShadowModes + shadows].add(
+ time,
+ updater
+ );
+ } else {
+ this._openMaterialBatches[shadows].add(time, updater);
+ }
+ }
+};
+GeometryVisualizer._onGeometryChanged = function(updater) {
+ const removedObjects = this._removedObjects;
+ const changedObjects = this._changedObjects;
+ const entity = updater.entity;
+ const id = entity.id;
+ if (!defined_default(removedObjects.get(id)) && !defined_default(changedObjects.get(id))) {
+ changedObjects.set(id, entity);
+ }
+};
+GeometryVisualizer.prototype._onCollectionChanged = function(entityCollection, added, removed) {
+ const addedObjects = this._addedObjects;
+ const removedObjects = this._removedObjects;
+ const changedObjects = this._changedObjects;
+ let i;
+ let id;
+ let entity;
+ for (i = removed.length - 1; i > -1; i--) {
+ entity = removed[i];
+ id = entity.id;
+ if (!addedObjects.remove(id)) {
+ removedObjects.set(id, entity);
+ changedObjects.remove(id);
+ }
+ }
+ for (i = added.length - 1; i > -1; i--) {
+ entity = added[i];
+ id = entity.id;
+ if (removedObjects.remove(id)) {
+ changedObjects.set(id, entity);
+ } else {
+ addedObjects.set(id, entity);
+ }
+ }
+};
+var GeometryVisualizer_default = GeometryVisualizer;
+
+// Source/DataSources/LabelVisualizer.js
+var defaultScale4 = 1;
+var defaultFont = "30px sans-serif";
+var defaultStyle = LabelStyle_default.FILL;
+var defaultFillColor = Color_default.WHITE;
+var defaultOutlineColor3 = Color_default.BLACK;
+var defaultOutlineWidth2 = 1;
+var defaultShowBackground = false;
+var defaultBackgroundColor2 = new Color_default(0.165, 0.165, 0.165, 0.8);
+var defaultBackgroundPadding2 = new Cartesian2_default(7, 5);
+var defaultPixelOffset2 = Cartesian2_default.ZERO;
+var defaultEyeOffset2 = Cartesian3_default.ZERO;
+var defaultHeightReference2 = HeightReference_default.NONE;
+var defaultHorizontalOrigin2 = HorizontalOrigin_default.CENTER;
+var defaultVerticalOrigin2 = VerticalOrigin_default.CENTER;
+var positionScratch13 = new Cartesian3_default();
+var fillColorScratch = new Color_default();
+var outlineColorScratch = new Color_default();
+var backgroundColorScratch = new Color_default();
+var backgroundPaddingScratch = new Cartesian2_default();
+var eyeOffsetScratch2 = new Cartesian3_default();
+var pixelOffsetScratch2 = new Cartesian2_default();
+var translucencyByDistanceScratch2 = new NearFarScalar_default();
+var pixelOffsetScaleByDistanceScratch2 = new NearFarScalar_default();
+var scaleByDistanceScratch2 = new NearFarScalar_default();
+var distanceDisplayConditionScratch7 = new DistanceDisplayCondition_default();
+function EntityData2(entity) {
+ this.entity = entity;
+ this.label = void 0;
+ this.index = void 0;
+}
+function LabelVisualizer(entityCluster, entityCollection) {
+ if (!defined_default(entityCluster)) {
+ throw new DeveloperError_default("entityCluster is required.");
+ }
+ if (!defined_default(entityCollection)) {
+ throw new DeveloperError_default("entityCollection is required.");
+ }
+ entityCollection.collectionChanged.addEventListener(
+ LabelVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ this._cluster = entityCluster;
+ this._entityCollection = entityCollection;
+ this._items = new AssociativeArray_default();
+ this._onCollectionChanged(entityCollection, entityCollection.values, [], []);
+}
+LabelVisualizer.prototype.update = function(time) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ const items = this._items.values;
+ const cluster = this._cluster;
+ for (let i = 0, len = items.length; i < len; i++) {
+ const item = items[i];
+ const entity = item.entity;
+ const labelGraphics = entity._label;
+ let text;
+ let label = item.label;
+ let show = entity.isShowing && entity.isAvailable(time) && Property_default.getValueOrDefault(labelGraphics._show, time, true);
+ let position;
+ if (show) {
+ position = Property_default.getValueOrUndefined(
+ entity._position,
+ time,
+ positionScratch13
+ );
+ text = Property_default.getValueOrUndefined(labelGraphics._text, time);
+ show = defined_default(position) && defined_default(text);
+ }
+ if (!show) {
+ returnPrimitive2(item, entity, cluster);
+ continue;
+ }
+ if (!Property_default.isConstant(entity._position)) {
+ cluster._clusterDirty = true;
+ }
+ let updateClamping2 = false;
+ const heightReference = Property_default.getValueOrDefault(
+ labelGraphics._heightReference,
+ time,
+ defaultHeightReference2
+ );
+ if (!defined_default(label)) {
+ label = cluster.getLabel(entity);
+ label.id = entity;
+ item.label = label;
+ updateClamping2 = Cartesian3_default.equals(label.position, position) && label.heightReference === heightReference;
+ }
+ label.show = true;
+ label.position = position;
+ label.text = text;
+ label.scale = Property_default.getValueOrDefault(
+ labelGraphics._scale,
+ time,
+ defaultScale4
+ );
+ label.font = Property_default.getValueOrDefault(
+ labelGraphics._font,
+ time,
+ defaultFont
+ );
+ label.style = Property_default.getValueOrDefault(
+ labelGraphics._style,
+ time,
+ defaultStyle
+ );
+ label.fillColor = Property_default.getValueOrDefault(
+ labelGraphics._fillColor,
+ time,
+ defaultFillColor,
+ fillColorScratch
+ );
+ label.outlineColor = Property_default.getValueOrDefault(
+ labelGraphics._outlineColor,
+ time,
+ defaultOutlineColor3,
+ outlineColorScratch
+ );
+ label.outlineWidth = Property_default.getValueOrDefault(
+ labelGraphics._outlineWidth,
+ time,
+ defaultOutlineWidth2
+ );
+ label.showBackground = Property_default.getValueOrDefault(
+ labelGraphics._showBackground,
+ time,
+ defaultShowBackground
+ );
+ label.backgroundColor = Property_default.getValueOrDefault(
+ labelGraphics._backgroundColor,
+ time,
+ defaultBackgroundColor2,
+ backgroundColorScratch
+ );
+ label.backgroundPadding = Property_default.getValueOrDefault(
+ labelGraphics._backgroundPadding,
+ time,
+ defaultBackgroundPadding2,
+ backgroundPaddingScratch
+ );
+ label.pixelOffset = Property_default.getValueOrDefault(
+ labelGraphics._pixelOffset,
+ time,
+ defaultPixelOffset2,
+ pixelOffsetScratch2
+ );
+ label.eyeOffset = Property_default.getValueOrDefault(
+ labelGraphics._eyeOffset,
+ time,
+ defaultEyeOffset2,
+ eyeOffsetScratch2
+ );
+ label.heightReference = heightReference;
+ label.horizontalOrigin = Property_default.getValueOrDefault(
+ labelGraphics._horizontalOrigin,
+ time,
+ defaultHorizontalOrigin2
+ );
+ label.verticalOrigin = Property_default.getValueOrDefault(
+ labelGraphics._verticalOrigin,
+ time,
+ defaultVerticalOrigin2
+ );
+ label.translucencyByDistance = Property_default.getValueOrUndefined(
+ labelGraphics._translucencyByDistance,
+ time,
+ translucencyByDistanceScratch2
+ );
+ label.pixelOffsetScaleByDistance = Property_default.getValueOrUndefined(
+ labelGraphics._pixelOffsetScaleByDistance,
+ time,
+ pixelOffsetScaleByDistanceScratch2
+ );
+ label.scaleByDistance = Property_default.getValueOrUndefined(
+ labelGraphics._scaleByDistance,
+ time,
+ scaleByDistanceScratch2
+ );
+ label.distanceDisplayCondition = Property_default.getValueOrUndefined(
+ labelGraphics._distanceDisplayCondition,
+ time,
+ distanceDisplayConditionScratch7
+ );
+ label.disableDepthTestDistance = Property_default.getValueOrUndefined(
+ labelGraphics._disableDepthTestDistance,
+ time
+ );
+ if (updateClamping2) {
+ label._updateClamping();
+ }
+ }
+ return true;
+};
+LabelVisualizer.prototype.getBoundingSphere = function(entity, result) {
+ if (!defined_default(entity)) {
+ throw new DeveloperError_default("entity is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const item = this._items.get(entity.id);
+ if (!defined_default(item) || !defined_default(item.label)) {
+ return BoundingSphereState_default.FAILED;
+ }
+ const label = item.label;
+ result.center = Cartesian3_default.clone(
+ defaultValue_default(label._clampedPosition, label.position),
+ result.center
+ );
+ result.radius = 0;
+ return BoundingSphereState_default.DONE;
+};
+LabelVisualizer.prototype.isDestroyed = function() {
+ return false;
+};
+LabelVisualizer.prototype.destroy = function() {
+ this._entityCollection.collectionChanged.removeEventListener(
+ LabelVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ const entities = this._entityCollection.values;
+ for (let i = 0; i < entities.length; i++) {
+ this._cluster.removeLabel(entities[i]);
+ }
+ return destroyObject_default(this);
+};
+LabelVisualizer.prototype._onCollectionChanged = function(entityCollection, added, removed, changed) {
+ let i;
+ let entity;
+ const items = this._items;
+ const cluster = this._cluster;
+ for (i = added.length - 1; i > -1; i--) {
+ entity = added[i];
+ if (defined_default(entity._label) && defined_default(entity._position)) {
+ items.set(entity.id, new EntityData2(entity));
+ }
+ }
+ for (i = changed.length - 1; i > -1; i--) {
+ entity = changed[i];
+ if (defined_default(entity._label) && defined_default(entity._position)) {
+ if (!items.contains(entity.id)) {
+ items.set(entity.id, new EntityData2(entity));
+ }
+ } else {
+ returnPrimitive2(items.get(entity.id), entity, cluster);
+ items.remove(entity.id);
+ }
+ }
+ for (i = removed.length - 1; i > -1; i--) {
+ entity = removed[i];
+ returnPrimitive2(items.get(entity.id), entity, cluster);
+ items.remove(entity.id);
+ }
+};
+function returnPrimitive2(item, entity, cluster) {
+ if (defined_default(item)) {
+ item.label = void 0;
+ cluster.removeLabel(entity);
+ }
+}
+var LabelVisualizer_default = LabelVisualizer;
+
+// Source/Core/sampleTerrain.js
+function sampleTerrain(terrainProvider, level, positions) {
+ Check_default.typeOf.object("terrainProvider", terrainProvider);
+ Check_default.typeOf.number("level", level);
+ Check_default.defined("positions", positions);
+ return terrainProvider.readyPromise.then(function() {
+ return doSampling(terrainProvider, level, positions);
+ });
+}
+function attemptConsumeNextQueueItem(tileRequests, results) {
+ const tileRequest = tileRequests[0];
+ const requestPromise = tileRequest.terrainProvider.requestTileGeometry(
+ tileRequest.x,
+ tileRequest.y,
+ tileRequest.level
+ );
+ if (!requestPromise) {
+ return false;
+ }
+ const promise = requestPromise.then(createInterpolateFunction(tileRequest)).catch(createMarkFailedFunction(tileRequest));
+ tileRequests.shift();
+ results.push(promise);
+ return true;
+}
+function delay(ms) {
+ return new Promise(function(res) {
+ setTimeout(res, ms);
+ });
+}
+function drainTileRequestQueue(tileRequests, results) {
+ if (!tileRequests.length) {
+ return Promise.resolve();
+ }
+ const success = attemptConsumeNextQueueItem(tileRequests, results);
+ if (success) {
+ return drainTileRequestQueue(tileRequests, results);
+ }
+ return delay(100).then(() => {
+ return drainTileRequestQueue(tileRequests, results);
+ });
+}
+function doSampling(terrainProvider, level, positions) {
+ const tilingScheme2 = terrainProvider.tilingScheme;
+ let i;
+ const tileRequests = [];
+ const tileRequestSet = {};
+ for (i = 0; i < positions.length; ++i) {
+ const xy = tilingScheme2.positionToTileXY(positions[i], level);
+ const key = xy.toString();
+ if (!tileRequestSet.hasOwnProperty(key)) {
+ const value = {
+ x: xy.x,
+ y: xy.y,
+ level,
+ tilingScheme: tilingScheme2,
+ terrainProvider,
+ positions: []
+ };
+ tileRequestSet[key] = value;
+ tileRequests.push(value);
+ }
+ tileRequestSet[key].positions.push(positions[i]);
+ }
+ const tilePromises = [];
+ return drainTileRequestQueue(tileRequests, tilePromises).then(function() {
+ return Promise.all(tilePromises).then(function() {
+ return positions;
+ });
+ });
+}
+function interpolateAndAssignHeight(position, terrainData, rectangle) {
+ const height = terrainData.interpolateHeight(
+ rectangle,
+ position.longitude,
+ position.latitude
+ );
+ if (height === void 0) {
+ return false;
+ }
+ position.height = height;
+ return true;
+}
+function createInterpolateFunction(tileRequest) {
+ const tilePositions = tileRequest.positions;
+ const rectangle = tileRequest.tilingScheme.tileXYToRectangle(
+ tileRequest.x,
+ tileRequest.y,
+ tileRequest.level
+ );
+ return function(terrainData) {
+ let isMeshRequired = false;
+ for (let i = 0; i < tilePositions.length; ++i) {
+ const position = tilePositions[i];
+ const isHeightAssigned = interpolateAndAssignHeight(
+ position,
+ terrainData,
+ rectangle
+ );
+ if (!isHeightAssigned) {
+ isMeshRequired = true;
+ break;
+ }
+ }
+ if (!isMeshRequired) {
+ return Promise.resolve();
+ }
+ return terrainData.createMesh({
+ tilingScheme: tileRequest.tilingScheme,
+ x: tileRequest.x,
+ y: tileRequest.y,
+ level: tileRequest.level,
+ throttle: false
+ }).then(function() {
+ for (let i = 0; i < tilePositions.length; ++i) {
+ const position = tilePositions[i];
+ interpolateAndAssignHeight(position, terrainData, rectangle);
+ }
+ });
+ };
+}
+function createMarkFailedFunction(tileRequest) {
+ const tilePositions = tileRequest.positions;
+ return function() {
+ for (let i = 0; i < tilePositions.length; ++i) {
+ const position = tilePositions[i];
+ position.height = void 0;
+ }
+ };
+}
+var sampleTerrain_default = sampleTerrain;
+
+// Source/Core/sampleTerrainMostDetailed.js
+var scratchCartesian29 = new Cartesian2_default();
+function sampleTerrainMostDetailed(terrainProvider, positions) {
+ if (!defined_default(terrainProvider)) {
+ throw new DeveloperError_default("terrainProvider is required.");
+ }
+ if (!defined_default(positions)) {
+ throw new DeveloperError_default("positions is required.");
+ }
+ return terrainProvider.readyPromise.then(function() {
+ const byLevel = [];
+ const maxLevels = [];
+ const availability = terrainProvider.availability;
+ if (!defined_default(availability)) {
+ throw new DeveloperError_default(
+ "sampleTerrainMostDetailed requires a terrain provider that has tile availability."
+ );
+ }
+ const promises = [];
+ for (let i = 0; i < positions.length; ++i) {
+ const position = positions[i];
+ const maxLevel = availability.computeMaximumLevelAtPosition(position);
+ maxLevels[i] = maxLevel;
+ if (maxLevel === 0) {
+ terrainProvider.tilingScheme.positionToTileXY(
+ position,
+ 1,
+ scratchCartesian29
+ );
+ const promise = terrainProvider.loadTileDataAvailability(
+ scratchCartesian29.x,
+ scratchCartesian29.y,
+ 1
+ );
+ if (defined_default(promise)) {
+ promises.push(promise);
+ }
+ }
+ let atLevel = byLevel[maxLevel];
+ if (!defined_default(atLevel)) {
+ byLevel[maxLevel] = atLevel = [];
+ }
+ atLevel.push(position);
+ }
+ return Promise.all(promises).then(function() {
+ return Promise.all(
+ byLevel.map(function(positionsAtLevel, index) {
+ if (defined_default(positionsAtLevel)) {
+ return sampleTerrain_default(terrainProvider, index, positionsAtLevel);
+ }
+ })
+ );
+ }).then(function() {
+ const changedPositions = [];
+ for (let i = 0; i < positions.length; ++i) {
+ const position = positions[i];
+ const maxLevel = availability.computeMaximumLevelAtPosition(position);
+ if (maxLevel !== maxLevels[i]) {
+ changedPositions.push(position);
+ }
+ }
+ if (changedPositions.length > 0) {
+ return sampleTerrainMostDetailed(terrainProvider, changedPositions);
+ }
+ }).then(function() {
+ return positions;
+ });
+ });
+}
+var sampleTerrainMostDetailed_default = sampleTerrainMostDetailed;
+
+// Source/DataSources/ModelVisualizer.js
+var defaultScale5 = 1;
+var defaultMinimumPixelSize = 0;
+var defaultIncrementallyLoadTextures = true;
+var defaultClampAnimations = true;
+var defaultShadows2 = ShadowMode_default.ENABLED;
+var defaultHeightReference3 = HeightReference_default.NONE;
+var defaultSilhouetteColor = Color_default.RED;
+var defaultSilhouetteSize = 0;
+var defaultColor7 = Color_default.WHITE;
+var defaultColorBlendMode = ColorBlendMode_default.HIGHLIGHT;
+var defaultColorBlendAmount = 0.5;
+var defaultImageBasedLightingFactor = new Cartesian2_default(1, 1);
+var modelMatrixScratch3 = new Matrix4_default();
+var nodeMatrixScratch = new Matrix4_default();
+var scratchColor20 = new Color_default();
+function ModelVisualizer(scene, entityCollection) {
+ Check_default.typeOf.object("scene", scene);
+ Check_default.typeOf.object("entityCollection", entityCollection);
+ entityCollection.collectionChanged.addEventListener(
+ ModelVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ this._scene = scene;
+ this._primitives = scene.primitives;
+ this._entityCollection = entityCollection;
+ this._modelHash = {};
+ this._entitiesToVisualize = new AssociativeArray_default();
+ this._onCollectionChanged(entityCollection, entityCollection.values, [], []);
+}
+ModelVisualizer.prototype.update = function(time) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ const entities = this._entitiesToVisualize.values;
+ const modelHash = this._modelHash;
+ const primitives = this._primitives;
+ for (let i = 0, len = entities.length; i < len; i++) {
+ const entity = entities[i];
+ const modelGraphics = entity._model;
+ let resource;
+ let modelData = modelHash[entity.id];
+ let show = entity.isShowing && entity.isAvailable(time) && Property_default.getValueOrDefault(modelGraphics._show, time, true);
+ let modelMatrix;
+ if (show) {
+ modelMatrix = entity.computeModelMatrix(time, modelMatrixScratch3);
+ resource = Resource_default.createIfNeeded(
+ Property_default.getValueOrUndefined(modelGraphics._uri, time)
+ );
+ show = defined_default(modelMatrix) && defined_default(resource);
+ }
+ if (!show) {
+ if (defined_default(modelData)) {
+ modelData.modelPrimitive.show = false;
+ }
+ continue;
+ }
+ let model = defined_default(modelData) ? modelData.modelPrimitive : void 0;
+ if (!defined_default(model) || resource.url !== modelData.url) {
+ if (defined_default(model)) {
+ primitives.removeAndDestroy(model);
+ delete modelHash[entity.id];
+ }
+ model = Model_default.fromGltf({
+ url: resource,
+ incrementallyLoadTextures: Property_default.getValueOrDefault(
+ modelGraphics._incrementallyLoadTextures,
+ time,
+ defaultIncrementallyLoadTextures
+ ),
+ scene: this._scene
+ });
+ model.id = entity;
+ primitives.add(model);
+ modelData = {
+ modelPrimitive: model,
+ url: resource.url,
+ animationsRunning: false,
+ nodeTransformationsScratch: {},
+ articulationsScratch: {},
+ loadFail: false,
+ awaitingSampleTerrain: false,
+ clampedBoundingSphere: void 0,
+ sampleTerrainFailed: false
+ };
+ modelHash[entity.id] = modelData;
+ checkModelLoad(model, entity, modelHash);
+ }
+ model.show = true;
+ model.scale = Property_default.getValueOrDefault(
+ modelGraphics._scale,
+ time,
+ defaultScale5
+ );
+ model.minimumPixelSize = Property_default.getValueOrDefault(
+ modelGraphics._minimumPixelSize,
+ time,
+ defaultMinimumPixelSize
+ );
+ model.maximumScale = Property_default.getValueOrUndefined(
+ modelGraphics._maximumScale,
+ time
+ );
+ model.modelMatrix = Matrix4_default.clone(modelMatrix, model.modelMatrix);
+ model.shadows = Property_default.getValueOrDefault(
+ modelGraphics._shadows,
+ time,
+ defaultShadows2
+ );
+ model.heightReference = Property_default.getValueOrDefault(
+ modelGraphics._heightReference,
+ time,
+ defaultHeightReference3
+ );
+ model.distanceDisplayCondition = Property_default.getValueOrUndefined(
+ modelGraphics._distanceDisplayCondition,
+ time
+ );
+ model.silhouetteColor = Property_default.getValueOrDefault(
+ modelGraphics._silhouetteColor,
+ time,
+ defaultSilhouetteColor,
+ scratchColor20
+ );
+ model.silhouetteSize = Property_default.getValueOrDefault(
+ modelGraphics._silhouetteSize,
+ time,
+ defaultSilhouetteSize
+ );
+ model.color = Property_default.getValueOrDefault(
+ modelGraphics._color,
+ time,
+ defaultColor7,
+ scratchColor20
+ );
+ model.colorBlendMode = Property_default.getValueOrDefault(
+ modelGraphics._colorBlendMode,
+ time,
+ defaultColorBlendMode
+ );
+ model.colorBlendAmount = Property_default.getValueOrDefault(
+ modelGraphics._colorBlendAmount,
+ time,
+ defaultColorBlendAmount
+ );
+ model.clippingPlanes = Property_default.getValueOrUndefined(
+ modelGraphics._clippingPlanes,
+ time
+ );
+ model.clampAnimations = Property_default.getValueOrDefault(
+ modelGraphics._clampAnimations,
+ time,
+ defaultClampAnimations
+ );
+ model.imageBasedLighting.imageBasedLightingFactor = Property_default.getValueOrDefault(
+ modelGraphics._imageBasedLightingFactor,
+ time,
+ defaultImageBasedLightingFactor
+ );
+ model.lightColor = Property_default.getValueOrUndefined(
+ modelGraphics._lightColor,
+ time
+ );
+ model.customShader = Property_default.getValueOrUndefined(
+ modelGraphics._customShader,
+ time
+ );
+ if (model.ready) {
+ const runAnimations = Property_default.getValueOrDefault(
+ modelGraphics._runAnimations,
+ time,
+ true
+ );
+ if (modelData.animationsRunning !== runAnimations) {
+ if (runAnimations) {
+ model.activeAnimations.addAll({
+ loop: ModelAnimationLoop_default.REPEAT
+ });
+ } else {
+ model.activeAnimations.removeAll();
+ }
+ modelData.animationsRunning = runAnimations;
+ }
+ const nodeTransformations = Property_default.getValueOrUndefined(
+ modelGraphics._nodeTransformations,
+ time,
+ modelData.nodeTransformationsScratch
+ );
+ if (defined_default(nodeTransformations)) {
+ const nodeNames = Object.keys(nodeTransformations);
+ for (let nodeIndex = 0, nodeLength = nodeNames.length; nodeIndex < nodeLength; ++nodeIndex) {
+ const nodeName = nodeNames[nodeIndex];
+ const nodeTransformation = nodeTransformations[nodeName];
+ if (!defined_default(nodeTransformation)) {
+ continue;
+ }
+ const modelNode = model.getNode(nodeName);
+ if (!defined_default(modelNode)) {
+ continue;
+ }
+ const transformationMatrix = Matrix4_default.fromTranslationRotationScale(
+ nodeTransformation,
+ nodeMatrixScratch
+ );
+ modelNode.matrix = Matrix4_default.multiply(
+ modelNode.originalMatrix,
+ transformationMatrix,
+ transformationMatrix
+ );
+ }
+ }
+ let anyArticulationUpdated = false;
+ const articulations = Property_default.getValueOrUndefined(
+ modelGraphics._articulations,
+ time,
+ modelData.articulationsScratch
+ );
+ if (defined_default(articulations)) {
+ const articulationStageKeys = Object.keys(articulations);
+ for (let s = 0, numKeys = articulationStageKeys.length; s < numKeys; ++s) {
+ const key = articulationStageKeys[s];
+ const articulationStageValue = articulations[key];
+ if (!defined_default(articulationStageValue)) {
+ continue;
+ }
+ anyArticulationUpdated = true;
+ model.setArticulationStage(key, articulationStageValue);
+ }
+ }
+ if (anyArticulationUpdated) {
+ model.applyArticulations();
+ }
+ }
+ }
+ return true;
+};
+ModelVisualizer.prototype.isDestroyed = function() {
+ return false;
+};
+ModelVisualizer.prototype.destroy = function() {
+ this._entityCollection.collectionChanged.removeEventListener(
+ ModelVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ const entities = this._entitiesToVisualize.values;
+ const modelHash = this._modelHash;
+ const primitives = this._primitives;
+ for (let i = entities.length - 1; i > -1; i--) {
+ removeModel(this, entities[i], modelHash, primitives);
+ }
+ return destroyObject_default(this);
+};
+ModelVisualizer._sampleTerrainMostDetailed = sampleTerrainMostDetailed_default;
+var scratchPosition11 = new Cartesian3_default();
+var scratchCartographic11 = new Cartographic_default();
+ModelVisualizer.prototype.getBoundingSphere = function(entity, result) {
+ if (!defined_default(entity)) {
+ throw new DeveloperError_default("entity is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const modelData = this._modelHash[entity.id];
+ if (!defined_default(modelData) || modelData.loadFail) {
+ return BoundingSphereState_default.FAILED;
+ }
+ const model = modelData.modelPrimitive;
+ if (!defined_default(model) || !model.show) {
+ return BoundingSphereState_default.FAILED;
+ }
+ if (!model.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ const scene = this._scene;
+ const globe = scene.globe;
+ const ellipsoid = globe.ellipsoid;
+ const terrainProvider = globe.terrainProvider;
+ const hasHeightReference = model.heightReference !== HeightReference_default.NONE;
+ if (hasHeightReference) {
+ if (!terrainProvider.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ const modelMatrix = model.modelMatrix;
+ scratchPosition11.x = modelMatrix[12];
+ scratchPosition11.y = modelMatrix[13];
+ scratchPosition11.z = modelMatrix[14];
+ const cartoPosition = ellipsoid.cartesianToCartographic(scratchPosition11);
+ if (!defined_default(terrainProvider.availability)) {
+ if (model.heightReference === HeightReference_default.CLAMP_TO_GROUND) {
+ cartoPosition.height = 0;
+ }
+ const scratchPosition17 = ellipsoid.cartographicToCartesian(cartoPosition);
+ BoundingSphere_default.clone(model.boundingSphere, result);
+ result.center = scratchPosition17;
+ return BoundingSphereState_default.DONE;
+ }
+ let clampedBoundingSphere = this._modelHash[entity.id].clampedBoundingSphere;
+ const sampleTerrainFailed = this._modelHash[entity.id].sampleTerrainFailed;
+ if (sampleTerrainFailed) {
+ this._modelHash[entity.id].sampleTerrainFailed = false;
+ return BoundingSphereState_default.FAILED;
+ }
+ if (!defined_default(clampedBoundingSphere)) {
+ clampedBoundingSphere = new BoundingSphere_default();
+ const awaitingSampleTerrain = this._modelHash[entity.id].awaitingSampleTerrain;
+ if (!awaitingSampleTerrain) {
+ Cartographic_default.clone(cartoPosition, scratchCartographic11);
+ this._modelHash[entity.id].awaitingSampleTerrain = true;
+ ModelVisualizer._sampleTerrainMostDetailed(terrainProvider, [
+ scratchCartographic11
+ ]).then((result2) => {
+ this._modelHash[entity.id].awaitingSampleTerrain = false;
+ const updatedCartographic = result2[0];
+ if (model.heightReference === HeightReference_default.RELATIVE_TO_GROUND) {
+ updatedCartographic.height += cartoPosition.height;
+ }
+ ellipsoid.cartographicToCartesian(
+ updatedCartographic,
+ scratchPosition11
+ );
+ BoundingSphere_default.clone(model.boundingSphere, clampedBoundingSphere);
+ clampedBoundingSphere.center = scratchPosition11;
+ this._modelHash[entity.id].clampedBoundingSphere = BoundingSphere_default.clone(
+ clampedBoundingSphere
+ );
+ }).catch((e) => {
+ this._modelHash[entity.id].sampleTerrainFailed = true;
+ this._modelHash[entity.id].awaitingSampleTerrain = false;
+ });
+ }
+ return BoundingSphereState_default.PENDING;
+ }
+ BoundingSphere_default.clone(clampedBoundingSphere, result);
+ this._modelHash[entity.id].clampedBoundingSphere = void 0;
+ return BoundingSphereState_default.DONE;
+ }
+ BoundingSphere_default.clone(model.boundingSphere, result);
+ return BoundingSphereState_default.DONE;
+};
+ModelVisualizer.prototype._onCollectionChanged = function(entityCollection, added, removed, changed) {
+ let i;
+ let entity;
+ const entities = this._entitiesToVisualize;
+ const modelHash = this._modelHash;
+ const primitives = this._primitives;
+ for (i = added.length - 1; i > -1; i--) {
+ entity = added[i];
+ if (defined_default(entity._model) && defined_default(entity._position)) {
+ entities.set(entity.id, entity);
+ }
+ }
+ for (i = changed.length - 1; i > -1; i--) {
+ entity = changed[i];
+ if (defined_default(entity._model) && defined_default(entity._position)) {
+ clearNodeTransformationsArticulationsScratch(entity, modelHash);
+ entities.set(entity.id, entity);
+ } else {
+ removeModel(this, entity, modelHash, primitives);
+ entities.remove(entity.id);
+ }
+ }
+ for (i = removed.length - 1; i > -1; i--) {
+ entity = removed[i];
+ removeModel(this, entity, modelHash, primitives);
+ entities.remove(entity.id);
+ }
+};
+function removeModel(visualizer, entity, modelHash, primitives) {
+ const modelData = modelHash[entity.id];
+ if (defined_default(modelData)) {
+ primitives.removeAndDestroy(modelData.modelPrimitive);
+ delete modelHash[entity.id];
+ }
+}
+function clearNodeTransformationsArticulationsScratch(entity, modelHash) {
+ const modelData = modelHash[entity.id];
+ if (defined_default(modelData)) {
+ modelData.nodeTransformationsScratch = {};
+ modelData.articulationsScratch = {};
+ }
+}
+function checkModelLoad(model, entity, modelHash) {
+ model.readyPromise.catch(function(error) {
+ console.error(error);
+ modelHash[entity.id].loadFail = true;
+ });
+}
+var ModelVisualizer_default = ModelVisualizer;
+
+// Source/DataSources/ScaledPositionProperty.js
+function ScaledPositionProperty(value) {
+ this._definitionChanged = new Event_default();
+ this._value = void 0;
+ this._removeSubscription = void 0;
+ this.setValue(value);
+}
+Object.defineProperties(ScaledPositionProperty.prototype, {
+ isConstant: {
+ get: function() {
+ return Property_default.isConstant(this._value);
+ }
+ },
+ definitionChanged: {
+ get: function() {
+ return this._definitionChanged;
+ }
+ },
+ referenceFrame: {
+ get: function() {
+ return defined_default(this._value) ? this._value.referenceFrame : ReferenceFrame_default.FIXED;
+ }
+ }
+});
+ScaledPositionProperty.prototype.getValue = function(time, result) {
+ return this.getValueInReferenceFrame(time, ReferenceFrame_default.FIXED, result);
+};
+ScaledPositionProperty.prototype.setValue = function(value) {
+ if (this._value !== value) {
+ this._value = value;
+ if (defined_default(this._removeSubscription)) {
+ this._removeSubscription();
+ this._removeSubscription = void 0;
+ }
+ if (defined_default(value)) {
+ this._removeSubscription = value.definitionChanged.addEventListener(
+ this._raiseDefinitionChanged,
+ this
+ );
+ }
+ this._definitionChanged.raiseEvent(this);
+ }
+};
+ScaledPositionProperty.prototype.getValueInReferenceFrame = function(time, referenceFrame, result) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ if (!defined_default(referenceFrame)) {
+ throw new DeveloperError_default("referenceFrame is required.");
+ }
+ if (!defined_default(this._value)) {
+ return void 0;
+ }
+ result = this._value.getValueInReferenceFrame(time, referenceFrame, result);
+ return defined_default(result) ? Ellipsoid_default.WGS84.scaleToGeodeticSurface(result, result) : void 0;
+};
+ScaledPositionProperty.prototype.equals = function(other) {
+ return this === other || other instanceof ScaledPositionProperty && this._value === other._value;
+};
+ScaledPositionProperty.prototype._raiseDefinitionChanged = function() {
+ this._definitionChanged.raiseEvent(this);
+};
+var ScaledPositionProperty_default = ScaledPositionProperty;
+
+// Source/DataSources/PathVisualizer.js
+var defaultResolution = 60;
+var defaultWidth = 1;
+var scratchTimeInterval2 = new TimeInterval_default();
+var subSampleCompositePropertyScratch = new TimeInterval_default();
+var subSampleIntervalPropertyScratch = new TimeInterval_default();
+function EntityData3(entity) {
+ this.entity = entity;
+ this.polyline = void 0;
+ this.index = void 0;
+ this.updater = void 0;
+}
+function subSampleSampledProperty(property, start, stop2, times, updateTime, referenceFrame, maximumStep, startingIndex, result) {
+ let r = startingIndex;
+ let tmp2;
+ tmp2 = property.getValueInReferenceFrame(start, referenceFrame, result[r]);
+ if (defined_default(tmp2)) {
+ result[r++] = tmp2;
+ }
+ let steppedOnNow = !defined_default(updateTime) || JulianDate_default.lessThanOrEquals(updateTime, start) || JulianDate_default.greaterThanOrEquals(updateTime, stop2);
+ let t = 0;
+ const len = times.length;
+ let current = times[t];
+ const loopStop = stop2;
+ let sampling = false;
+ let sampleStepsToTake;
+ let sampleStepsTaken;
+ let sampleStepSize;
+ while (t < len) {
+ if (!steppedOnNow && JulianDate_default.greaterThanOrEquals(current, updateTime)) {
+ tmp2 = property.getValueInReferenceFrame(
+ updateTime,
+ referenceFrame,
+ result[r]
+ );
+ if (defined_default(tmp2)) {
+ result[r++] = tmp2;
+ }
+ steppedOnNow = true;
+ }
+ if (JulianDate_default.greaterThan(current, start) && JulianDate_default.lessThan(current, loopStop) && !current.equals(updateTime)) {
+ tmp2 = property.getValueInReferenceFrame(
+ current,
+ referenceFrame,
+ result[r]
+ );
+ if (defined_default(tmp2)) {
+ result[r++] = tmp2;
+ }
+ }
+ if (t < len - 1) {
+ if (maximumStep > 0 && !sampling) {
+ const next = times[t + 1];
+ const secondsUntilNext = JulianDate_default.secondsDifference(next, current);
+ sampling = secondsUntilNext > maximumStep;
+ if (sampling) {
+ sampleStepsToTake = Math.ceil(secondsUntilNext / maximumStep);
+ sampleStepsTaken = 0;
+ sampleStepSize = secondsUntilNext / Math.max(sampleStepsToTake, 2);
+ sampleStepsToTake = Math.max(sampleStepsToTake - 1, 1);
+ }
+ }
+ if (sampling && sampleStepsTaken < sampleStepsToTake) {
+ current = JulianDate_default.addSeconds(
+ current,
+ sampleStepSize,
+ new JulianDate_default()
+ );
+ sampleStepsTaken++;
+ continue;
+ }
+ }
+ sampling = false;
+ t++;
+ current = times[t];
+ }
+ tmp2 = property.getValueInReferenceFrame(stop2, referenceFrame, result[r]);
+ if (defined_default(tmp2)) {
+ result[r++] = tmp2;
+ }
+ return r;
+}
+function subSampleGenericProperty(property, start, stop2, updateTime, referenceFrame, maximumStep, startingIndex, result) {
+ let tmp2;
+ let i = 0;
+ let index = startingIndex;
+ let time = start;
+ const stepSize = Math.max(maximumStep, 60);
+ let steppedOnNow = !defined_default(updateTime) || JulianDate_default.lessThanOrEquals(updateTime, start) || JulianDate_default.greaterThanOrEquals(updateTime, stop2);
+ while (JulianDate_default.lessThan(time, stop2)) {
+ if (!steppedOnNow && JulianDate_default.greaterThanOrEquals(time, updateTime)) {
+ steppedOnNow = true;
+ tmp2 = property.getValueInReferenceFrame(
+ updateTime,
+ referenceFrame,
+ result[index]
+ );
+ if (defined_default(tmp2)) {
+ result[index] = tmp2;
+ index++;
+ }
+ }
+ tmp2 = property.getValueInReferenceFrame(
+ time,
+ referenceFrame,
+ result[index]
+ );
+ if (defined_default(tmp2)) {
+ result[index] = tmp2;
+ index++;
+ }
+ i++;
+ time = JulianDate_default.addSeconds(start, stepSize * i, new JulianDate_default());
+ }
+ tmp2 = property.getValueInReferenceFrame(stop2, referenceFrame, result[index]);
+ if (defined_default(tmp2)) {
+ result[index] = tmp2;
+ index++;
+ }
+ return index;
+}
+function subSampleIntervalProperty(property, start, stop2, updateTime, referenceFrame, maximumStep, startingIndex, result) {
+ subSampleIntervalPropertyScratch.start = start;
+ subSampleIntervalPropertyScratch.stop = stop2;
+ let index = startingIndex;
+ const intervals = property.intervals;
+ for (let i = 0; i < intervals.length; i++) {
+ const interval = intervals.get(i);
+ if (!TimeInterval_default.intersect(
+ interval,
+ subSampleIntervalPropertyScratch,
+ scratchTimeInterval2
+ ).isEmpty) {
+ let time = interval.start;
+ if (!interval.isStartIncluded) {
+ if (interval.isStopIncluded) {
+ time = interval.stop;
+ } else {
+ time = JulianDate_default.addSeconds(
+ interval.start,
+ JulianDate_default.secondsDifference(interval.stop, interval.start) / 2,
+ new JulianDate_default()
+ );
+ }
+ }
+ const tmp2 = property.getValueInReferenceFrame(
+ time,
+ referenceFrame,
+ result[index]
+ );
+ if (defined_default(tmp2)) {
+ result[index] = tmp2;
+ index++;
+ }
+ }
+ }
+ return index;
+}
+function subSampleConstantProperty(property, start, stop2, updateTime, referenceFrame, maximumStep, startingIndex, result) {
+ const tmp2 = property.getValueInReferenceFrame(
+ start,
+ referenceFrame,
+ result[startingIndex]
+ );
+ if (defined_default(tmp2)) {
+ result[startingIndex++] = tmp2;
+ }
+ return startingIndex;
+}
+function subSampleCompositeProperty(property, start, stop2, updateTime, referenceFrame, maximumStep, startingIndex, result) {
+ subSampleCompositePropertyScratch.start = start;
+ subSampleCompositePropertyScratch.stop = stop2;
+ let index = startingIndex;
+ const intervals = property.intervals;
+ for (let i = 0; i < intervals.length; i++) {
+ const interval = intervals.get(i);
+ if (!TimeInterval_default.intersect(
+ interval,
+ subSampleCompositePropertyScratch,
+ scratchTimeInterval2
+ ).isEmpty) {
+ const intervalStart = interval.start;
+ const intervalStop = interval.stop;
+ let sampleStart = start;
+ if (JulianDate_default.greaterThan(intervalStart, sampleStart)) {
+ sampleStart = intervalStart;
+ }
+ let sampleStop = stop2;
+ if (JulianDate_default.lessThan(intervalStop, sampleStop)) {
+ sampleStop = intervalStop;
+ }
+ index = reallySubSample(
+ interval.data,
+ sampleStart,
+ sampleStop,
+ updateTime,
+ referenceFrame,
+ maximumStep,
+ index,
+ result
+ );
+ }
+ }
+ return index;
+}
+function reallySubSample(property, start, stop2, updateTime, referenceFrame, maximumStep, index, result) {
+ while (property instanceof ReferenceProperty_default) {
+ property = property.resolvedProperty;
+ }
+ if (property instanceof SampledPositionProperty_default) {
+ const times = property._property._times;
+ index = subSampleSampledProperty(
+ property,
+ start,
+ stop2,
+ times,
+ updateTime,
+ referenceFrame,
+ maximumStep,
+ index,
+ result
+ );
+ } else if (property instanceof CompositePositionProperty_default) {
+ index = subSampleCompositeProperty(
+ property,
+ start,
+ stop2,
+ updateTime,
+ referenceFrame,
+ maximumStep,
+ index,
+ result
+ );
+ } else if (property instanceof TimeIntervalCollectionPositionProperty_default) {
+ index = subSampleIntervalProperty(
+ property,
+ start,
+ stop2,
+ updateTime,
+ referenceFrame,
+ maximumStep,
+ index,
+ result
+ );
+ } else if (property instanceof ConstantPositionProperty_default || property instanceof ScaledPositionProperty_default && Property_default.isConstant(property)) {
+ index = subSampleConstantProperty(
+ property,
+ start,
+ stop2,
+ updateTime,
+ referenceFrame,
+ maximumStep,
+ index,
+ result
+ );
+ } else {
+ index = subSampleGenericProperty(
+ property,
+ start,
+ stop2,
+ updateTime,
+ referenceFrame,
+ maximumStep,
+ index,
+ result
+ );
+ }
+ return index;
+}
+function subSample(property, start, stop2, updateTime, referenceFrame, maximumStep, result) {
+ if (!defined_default(result)) {
+ result = [];
+ }
+ const length3 = reallySubSample(
+ property,
+ start,
+ stop2,
+ updateTime,
+ referenceFrame,
+ maximumStep,
+ 0,
+ result
+ );
+ result.length = length3;
+ return result;
+}
+var toFixedScratch = new Matrix3_default();
+function PolylineUpdater(scene, referenceFrame) {
+ this._unusedIndexes = [];
+ this._polylineCollection = new PolylineCollection_default();
+ this._scene = scene;
+ this._referenceFrame = referenceFrame;
+ scene.primitives.add(this._polylineCollection);
+}
+PolylineUpdater.prototype.update = function(time) {
+ if (this._referenceFrame === ReferenceFrame_default.INERTIAL) {
+ let toFixed = Transforms_default.computeIcrfToFixedMatrix(time, toFixedScratch);
+ if (!defined_default(toFixed)) {
+ toFixed = Transforms_default.computeTemeToPseudoFixedMatrix(time, toFixedScratch);
+ }
+ Matrix4_default.fromRotationTranslation(
+ toFixed,
+ Cartesian3_default.ZERO,
+ this._polylineCollection.modelMatrix
+ );
+ }
+};
+PolylineUpdater.prototype.updateObject = function(time, item) {
+ const entity = item.entity;
+ const pathGraphics = entity._path;
+ const positionProperty = entity._position;
+ let sampleStart;
+ let sampleStop;
+ const showProperty = pathGraphics._show;
+ let polyline = item.polyline;
+ let show = entity.isShowing && entity.isAvailable(time) && (!defined_default(showProperty) || showProperty.getValue(time));
+ if (show) {
+ const leadTime = Property_default.getValueOrUndefined(pathGraphics._leadTime, time);
+ const trailTime = Property_default.getValueOrUndefined(
+ pathGraphics._trailTime,
+ time
+ );
+ const availability = entity._availability;
+ const hasAvailability = defined_default(availability);
+ const hasLeadTime = defined_default(leadTime);
+ const hasTrailTime = defined_default(trailTime);
+ show = hasAvailability || hasLeadTime && hasTrailTime;
+ if (show) {
+ if (hasTrailTime) {
+ sampleStart = JulianDate_default.addSeconds(time, -trailTime, new JulianDate_default());
+ }
+ if (hasLeadTime) {
+ sampleStop = JulianDate_default.addSeconds(time, leadTime, new JulianDate_default());
+ }
+ if (hasAvailability) {
+ const start = availability.start;
+ const stop2 = availability.stop;
+ if (!hasTrailTime || JulianDate_default.greaterThan(start, sampleStart)) {
+ sampleStart = start;
+ }
+ if (!hasLeadTime || JulianDate_default.lessThan(stop2, sampleStop)) {
+ sampleStop = stop2;
+ }
+ }
+ show = JulianDate_default.lessThan(sampleStart, sampleStop);
+ }
+ }
+ if (!show) {
+ if (defined_default(polyline)) {
+ this._unusedIndexes.push(item.index);
+ item.polyline = void 0;
+ polyline.show = false;
+ item.index = void 0;
+ }
+ return;
+ }
+ if (!defined_default(polyline)) {
+ const unusedIndexes = this._unusedIndexes;
+ const length3 = unusedIndexes.length;
+ if (length3 > 0) {
+ const index = unusedIndexes.pop();
+ polyline = this._polylineCollection.get(index);
+ item.index = index;
+ } else {
+ item.index = this._polylineCollection.length;
+ polyline = this._polylineCollection.add();
+ }
+ polyline.id = entity;
+ item.polyline = polyline;
+ }
+ const resolution = Property_default.getValueOrDefault(
+ pathGraphics._resolution,
+ time,
+ defaultResolution
+ );
+ polyline.show = true;
+ polyline.positions = subSample(
+ positionProperty,
+ sampleStart,
+ sampleStop,
+ time,
+ this._referenceFrame,
+ resolution,
+ polyline.positions.slice()
+ );
+ polyline.material = MaterialProperty_default.getValue(
+ time,
+ pathGraphics._material,
+ polyline.material
+ );
+ polyline.width = Property_default.getValueOrDefault(
+ pathGraphics._width,
+ time,
+ defaultWidth
+ );
+ polyline.distanceDisplayCondition = Property_default.getValueOrUndefined(
+ pathGraphics._distanceDisplayCondition,
+ time,
+ polyline.distanceDisplayCondition
+ );
+};
+PolylineUpdater.prototype.removeObject = function(item) {
+ const polyline = item.polyline;
+ if (defined_default(polyline)) {
+ this._unusedIndexes.push(item.index);
+ item.polyline = void 0;
+ polyline.show = false;
+ polyline.id = void 0;
+ item.index = void 0;
+ }
+};
+PolylineUpdater.prototype.destroy = function() {
+ this._scene.primitives.remove(this._polylineCollection);
+ return destroyObject_default(this);
+};
+function PathVisualizer(scene, entityCollection) {
+ if (!defined_default(scene)) {
+ throw new DeveloperError_default("scene is required.");
+ }
+ if (!defined_default(entityCollection)) {
+ throw new DeveloperError_default("entityCollection is required.");
+ }
+ entityCollection.collectionChanged.addEventListener(
+ PathVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ this._scene = scene;
+ this._updaters = {};
+ this._entityCollection = entityCollection;
+ this._items = new AssociativeArray_default();
+ this._onCollectionChanged(entityCollection, entityCollection.values, [], []);
+}
+PathVisualizer.prototype.update = function(time) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ const updaters = this._updaters;
+ for (const key in updaters) {
+ if (updaters.hasOwnProperty(key)) {
+ updaters[key].update(time);
+ }
+ }
+ const items = this._items.values;
+ if (items.length === 0 && defined_default(this._updaters) && Object.keys(this._updaters).length > 0) {
+ for (const u3 in updaters) {
+ if (updaters.hasOwnProperty(u3)) {
+ updaters[u3].destroy();
+ }
+ }
+ this._updaters = {};
+ }
+ for (let i = 0, len = items.length; i < len; i++) {
+ const item = items[i];
+ const entity = item.entity;
+ const positionProperty = entity._position;
+ const lastUpdater = item.updater;
+ let frameToVisualize = ReferenceFrame_default.FIXED;
+ if (this._scene.mode === SceneMode_default.SCENE3D) {
+ frameToVisualize = positionProperty.referenceFrame;
+ }
+ let currentUpdater = this._updaters[frameToVisualize];
+ if (lastUpdater === currentUpdater && defined_default(currentUpdater)) {
+ currentUpdater.updateObject(time, item);
+ continue;
+ }
+ if (defined_default(lastUpdater)) {
+ lastUpdater.removeObject(item);
+ }
+ if (!defined_default(currentUpdater)) {
+ currentUpdater = new PolylineUpdater(this._scene, frameToVisualize);
+ currentUpdater.update(time);
+ this._updaters[frameToVisualize] = currentUpdater;
+ }
+ item.updater = currentUpdater;
+ if (defined_default(currentUpdater)) {
+ currentUpdater.updateObject(time, item);
+ }
+ }
+ return true;
+};
+PathVisualizer.prototype.isDestroyed = function() {
+ return false;
+};
+PathVisualizer.prototype.destroy = function() {
+ this._entityCollection.collectionChanged.removeEventListener(
+ PathVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ const updaters = this._updaters;
+ for (const key in updaters) {
+ if (updaters.hasOwnProperty(key)) {
+ updaters[key].destroy();
+ }
+ }
+ return destroyObject_default(this);
+};
+PathVisualizer.prototype._onCollectionChanged = function(entityCollection, added, removed, changed) {
+ let i;
+ let entity;
+ let item;
+ const items = this._items;
+ for (i = added.length - 1; i > -1; i--) {
+ entity = added[i];
+ if (defined_default(entity._path) && defined_default(entity._position)) {
+ items.set(entity.id, new EntityData3(entity));
+ }
+ }
+ for (i = changed.length - 1; i > -1; i--) {
+ entity = changed[i];
+ if (defined_default(entity._path) && defined_default(entity._position)) {
+ if (!items.contains(entity.id)) {
+ items.set(entity.id, new EntityData3(entity));
+ }
+ } else {
+ item = items.get(entity.id);
+ if (defined_default(item)) {
+ if (defined_default(item.updater)) {
+ item.updater.removeObject(item);
+ }
+ items.remove(entity.id);
+ }
+ }
+ }
+ for (i = removed.length - 1; i > -1; i--) {
+ entity = removed[i];
+ item = items.get(entity.id);
+ if (defined_default(item)) {
+ if (defined_default(item.updater)) {
+ item.updater.removeObject(item);
+ }
+ items.remove(entity.id);
+ }
+ }
+};
+PathVisualizer._subSample = subSample;
+var PathVisualizer_default = PathVisualizer;
+
+// Source/DataSources/PointVisualizer.js
+var defaultColor8 = Color_default.WHITE;
+var defaultOutlineColor4 = Color_default.BLACK;
+var defaultOutlineWidth3 = 0;
+var defaultPixelSize = 1;
+var defaultDisableDepthTestDistance = 0;
+var colorScratch6 = new Color_default();
+var positionScratch14 = new Cartesian3_default();
+var outlineColorScratch2 = new Color_default();
+var scaleByDistanceScratch3 = new NearFarScalar_default();
+var translucencyByDistanceScratch3 = new NearFarScalar_default();
+var distanceDisplayConditionScratch8 = new DistanceDisplayCondition_default();
+function EntityData4(entity) {
+ this.entity = entity;
+ this.pointPrimitive = void 0;
+ this.billboard = void 0;
+ this.color = void 0;
+ this.outlineColor = void 0;
+ this.pixelSize = void 0;
+ this.outlineWidth = void 0;
+}
+function PointVisualizer(entityCluster, entityCollection) {
+ if (!defined_default(entityCluster)) {
+ throw new DeveloperError_default("entityCluster is required.");
+ }
+ if (!defined_default(entityCollection)) {
+ throw new DeveloperError_default("entityCollection is required.");
+ }
+ entityCollection.collectionChanged.addEventListener(
+ PointVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ this._cluster = entityCluster;
+ this._entityCollection = entityCollection;
+ this._items = new AssociativeArray_default();
+ this._onCollectionChanged(entityCollection, entityCollection.values, [], []);
+}
+PointVisualizer.prototype.update = function(time) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ const items = this._items.values;
+ const cluster = this._cluster;
+ for (let i = 0, len = items.length; i < len; i++) {
+ const item = items[i];
+ const entity = item.entity;
+ const pointGraphics = entity._point;
+ let pointPrimitive = item.pointPrimitive;
+ let billboard = item.billboard;
+ const heightReference = Property_default.getValueOrDefault(
+ pointGraphics._heightReference,
+ time,
+ HeightReference_default.NONE
+ );
+ let show = entity.isShowing && entity.isAvailable(time) && Property_default.getValueOrDefault(pointGraphics._show, time, true);
+ let position;
+ if (show) {
+ position = Property_default.getValueOrUndefined(
+ entity._position,
+ time,
+ positionScratch14
+ );
+ show = defined_default(position);
+ }
+ if (!show) {
+ returnPrimitive3(item, entity, cluster);
+ continue;
+ }
+ if (!Property_default.isConstant(entity._position)) {
+ cluster._clusterDirty = true;
+ }
+ let needsRedraw = false;
+ let updateClamping2 = false;
+ if (heightReference !== HeightReference_default.NONE && !defined_default(billboard)) {
+ if (defined_default(pointPrimitive)) {
+ returnPrimitive3(item, entity, cluster);
+ pointPrimitive = void 0;
+ }
+ billboard = cluster.getBillboard(entity);
+ billboard.id = entity;
+ billboard.image = void 0;
+ item.billboard = billboard;
+ needsRedraw = true;
+ updateClamping2 = Cartesian3_default.equals(billboard.position, position) && billboard.heightReference === heightReference;
+ } else if (heightReference === HeightReference_default.NONE && !defined_default(pointPrimitive)) {
+ if (defined_default(billboard)) {
+ returnPrimitive3(item, entity, cluster);
+ billboard = void 0;
+ }
+ pointPrimitive = cluster.getPoint(entity);
+ pointPrimitive.id = entity;
+ item.pointPrimitive = pointPrimitive;
+ }
+ if (defined_default(pointPrimitive)) {
+ pointPrimitive.show = true;
+ pointPrimitive.position = position;
+ pointPrimitive.scaleByDistance = Property_default.getValueOrUndefined(
+ pointGraphics._scaleByDistance,
+ time,
+ scaleByDistanceScratch3
+ );
+ pointPrimitive.translucencyByDistance = Property_default.getValueOrUndefined(
+ pointGraphics._translucencyByDistance,
+ time,
+ translucencyByDistanceScratch3
+ );
+ pointPrimitive.color = Property_default.getValueOrDefault(
+ pointGraphics._color,
+ time,
+ defaultColor8,
+ colorScratch6
+ );
+ pointPrimitive.outlineColor = Property_default.getValueOrDefault(
+ pointGraphics._outlineColor,
+ time,
+ defaultOutlineColor4,
+ outlineColorScratch2
+ );
+ pointPrimitive.outlineWidth = Property_default.getValueOrDefault(
+ pointGraphics._outlineWidth,
+ time,
+ defaultOutlineWidth3
+ );
+ pointPrimitive.pixelSize = Property_default.getValueOrDefault(
+ pointGraphics._pixelSize,
+ time,
+ defaultPixelSize
+ );
+ pointPrimitive.distanceDisplayCondition = Property_default.getValueOrUndefined(
+ pointGraphics._distanceDisplayCondition,
+ time,
+ distanceDisplayConditionScratch8
+ );
+ pointPrimitive.disableDepthTestDistance = Property_default.getValueOrDefault(
+ pointGraphics._disableDepthTestDistance,
+ time,
+ defaultDisableDepthTestDistance
+ );
+ } else if (defined_default(billboard)) {
+ billboard.show = true;
+ billboard.position = position;
+ billboard.scaleByDistance = Property_default.getValueOrUndefined(
+ pointGraphics._scaleByDistance,
+ time,
+ scaleByDistanceScratch3
+ );
+ billboard.translucencyByDistance = Property_default.getValueOrUndefined(
+ pointGraphics._translucencyByDistance,
+ time,
+ translucencyByDistanceScratch3
+ );
+ billboard.distanceDisplayCondition = Property_default.getValueOrUndefined(
+ pointGraphics._distanceDisplayCondition,
+ time,
+ distanceDisplayConditionScratch8
+ );
+ billboard.disableDepthTestDistance = Property_default.getValueOrDefault(
+ pointGraphics._disableDepthTestDistance,
+ time,
+ defaultDisableDepthTestDistance
+ );
+ billboard.heightReference = heightReference;
+ const newColor = Property_default.getValueOrDefault(
+ pointGraphics._color,
+ time,
+ defaultColor8,
+ colorScratch6
+ );
+ const newOutlineColor = Property_default.getValueOrDefault(
+ pointGraphics._outlineColor,
+ time,
+ defaultOutlineColor4,
+ outlineColorScratch2
+ );
+ const newOutlineWidth = Math.round(
+ Property_default.getValueOrDefault(
+ pointGraphics._outlineWidth,
+ time,
+ defaultOutlineWidth3
+ )
+ );
+ let newPixelSize = Math.max(
+ 1,
+ Math.round(
+ Property_default.getValueOrDefault(
+ pointGraphics._pixelSize,
+ time,
+ defaultPixelSize
+ )
+ )
+ );
+ if (newOutlineWidth > 0) {
+ billboard.scale = 1;
+ needsRedraw = needsRedraw || newOutlineWidth !== item.outlineWidth || newPixelSize !== item.pixelSize || !Color_default.equals(newColor, item.color) || !Color_default.equals(newOutlineColor, item.outlineColor);
+ } else {
+ billboard.scale = newPixelSize / 50;
+ newPixelSize = 50;
+ needsRedraw = needsRedraw || newOutlineWidth !== item.outlineWidth || !Color_default.equals(newColor, item.color) || !Color_default.equals(newOutlineColor, item.outlineColor);
+ }
+ if (needsRedraw) {
+ item.color = Color_default.clone(newColor, item.color);
+ item.outlineColor = Color_default.clone(newOutlineColor, item.outlineColor);
+ item.pixelSize = newPixelSize;
+ item.outlineWidth = newOutlineWidth;
+ const centerAlpha = newColor.alpha;
+ const cssColor = newColor.toCssColorString();
+ const cssOutlineColor = newOutlineColor.toCssColorString();
+ const textureId = JSON.stringify([
+ cssColor,
+ newPixelSize,
+ cssOutlineColor,
+ newOutlineWidth
+ ]);
+ billboard.setImage(
+ textureId,
+ createBillboardPointCallback_default(
+ centerAlpha,
+ cssColor,
+ cssOutlineColor,
+ newOutlineWidth,
+ newPixelSize
+ )
+ );
+ }
+ if (updateClamping2) {
+ billboard._updateClamping();
+ }
+ }
+ }
+ return true;
+};
+PointVisualizer.prototype.getBoundingSphere = function(entity, result) {
+ if (!defined_default(entity)) {
+ throw new DeveloperError_default("entity is required.");
+ }
+ if (!defined_default(result)) {
+ throw new DeveloperError_default("result is required.");
+ }
+ const item = this._items.get(entity.id);
+ if (!defined_default(item) || !(defined_default(item.pointPrimitive) || defined_default(item.billboard))) {
+ return BoundingSphereState_default.FAILED;
+ }
+ if (defined_default(item.pointPrimitive)) {
+ result.center = Cartesian3_default.clone(
+ item.pointPrimitive.position,
+ result.center
+ );
+ } else {
+ const billboard = item.billboard;
+ if (!defined_default(billboard._clampedPosition)) {
+ return BoundingSphereState_default.PENDING;
+ }
+ result.center = Cartesian3_default.clone(billboard._clampedPosition, result.center);
+ }
+ result.radius = 0;
+ return BoundingSphereState_default.DONE;
+};
+PointVisualizer.prototype.isDestroyed = function() {
+ return false;
+};
+PointVisualizer.prototype.destroy = function() {
+ this._entityCollection.collectionChanged.removeEventListener(
+ PointVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ const entities = this._entityCollection.values;
+ for (let i = 0; i < entities.length; i++) {
+ this._cluster.removePoint(entities[i]);
+ }
+ return destroyObject_default(this);
+};
+PointVisualizer.prototype._onCollectionChanged = function(entityCollection, added, removed, changed) {
+ let i;
+ let entity;
+ const items = this._items;
+ const cluster = this._cluster;
+ for (i = added.length - 1; i > -1; i--) {
+ entity = added[i];
+ if (defined_default(entity._point) && defined_default(entity._position)) {
+ items.set(entity.id, new EntityData4(entity));
+ }
+ }
+ for (i = changed.length - 1; i > -1; i--) {
+ entity = changed[i];
+ if (defined_default(entity._point) && defined_default(entity._position)) {
+ if (!items.contains(entity.id)) {
+ items.set(entity.id, new EntityData4(entity));
+ }
+ } else {
+ returnPrimitive3(items.get(entity.id), entity, cluster);
+ items.remove(entity.id);
+ }
+ }
+ for (i = removed.length - 1; i > -1; i--) {
+ entity = removed[i];
+ returnPrimitive3(items.get(entity.id), entity, cluster);
+ items.remove(entity.id);
+ }
+};
+function returnPrimitive3(item, entity, cluster) {
+ if (defined_default(item)) {
+ const pointPrimitive = item.pointPrimitive;
+ if (defined_default(pointPrimitive)) {
+ item.pointPrimitive = void 0;
+ cluster.removePoint(entity);
+ return;
+ }
+ const billboard = item.billboard;
+ if (defined_default(billboard)) {
+ item.billboard = void 0;
+ cluster.removeBillboard(entity);
+ }
+ }
+}
+var PointVisualizer_default = PointVisualizer;
+
+// Source/Core/PolylineGeometry.js
+var scratchInterpolateColorsArray = [];
+function interpolateColors(p0, p1, color0, color1, numPoints) {
+ const colors = scratchInterpolateColorsArray;
+ colors.length = numPoints;
+ let i;
+ const r0 = color0.red;
+ const g0 = color0.green;
+ const b0 = color0.blue;
+ const a0 = color0.alpha;
+ const r1 = color1.red;
+ const g1 = color1.green;
+ const b1 = color1.blue;
+ const a1 = color1.alpha;
+ if (Color_default.equals(color0, color1)) {
+ for (i = 0; i < numPoints; i++) {
+ colors[i] = Color_default.clone(color0);
+ }
+ return colors;
+ }
+ const redPerVertex = (r1 - r0) / numPoints;
+ const greenPerVertex = (g1 - g0) / numPoints;
+ const bluePerVertex = (b1 - b0) / numPoints;
+ const alphaPerVertex = (a1 - a0) / numPoints;
+ for (i = 0; i < numPoints; i++) {
+ colors[i] = new Color_default(
+ r0 + i * redPerVertex,
+ g0 + i * greenPerVertex,
+ b0 + i * bluePerVertex,
+ a0 + i * alphaPerVertex
+ );
+ }
+ return colors;
+}
+function PolylineGeometry(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const positions = options.positions;
+ const colors = options.colors;
+ const width = defaultValue_default(options.width, 1);
+ const colorsPerVertex = defaultValue_default(options.colorsPerVertex, false);
+ if (!defined_default(positions) || positions.length < 2) {
+ throw new DeveloperError_default("At least two positions are required.");
+ }
+ if (typeof width !== "number") {
+ throw new DeveloperError_default("width must be a number");
+ }
+ if (defined_default(colors) && (colorsPerVertex && colors.length < positions.length || !colorsPerVertex && colors.length < positions.length - 1)) {
+ throw new DeveloperError_default("colors has an invalid length.");
+ }
+ this._positions = positions;
+ this._colors = colors;
+ this._width = width;
+ this._colorsPerVertex = colorsPerVertex;
+ this._vertexFormat = VertexFormat_default.clone(
+ defaultValue_default(options.vertexFormat, VertexFormat_default.DEFAULT)
+ );
+ this._arcType = defaultValue_default(options.arcType, ArcType_default.GEODESIC);
+ this._granularity = defaultValue_default(
+ options.granularity,
+ Math_default.RADIANS_PER_DEGREE
+ );
+ this._ellipsoid = Ellipsoid_default.clone(
+ defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84)
+ );
+ this._workerName = "createPolylineGeometry";
+ let numComponents = 1 + positions.length * Cartesian3_default.packedLength;
+ numComponents += defined_default(colors) ? 1 + colors.length * Color_default.packedLength : 1;
+ this.packedLength = numComponents + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 4;
+}
+PolylineGeometry.pack = function(value, array, startingIndex) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value is required");
+ }
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ let i;
+ const positions = value._positions;
+ let length3 = positions.length;
+ array[startingIndex++] = length3;
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ Cartesian3_default.pack(positions[i], array, startingIndex);
+ }
+ const colors = value._colors;
+ length3 = defined_default(colors) ? colors.length : 0;
+ array[startingIndex++] = length3;
+ for (i = 0; i < length3; ++i, startingIndex += Color_default.packedLength) {
+ Color_default.pack(colors[i], array, startingIndex);
+ }
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
+ startingIndex += Ellipsoid_default.packedLength;
+ VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
+ startingIndex += VertexFormat_default.packedLength;
+ array[startingIndex++] = value._width;
+ array[startingIndex++] = value._colorsPerVertex ? 1 : 0;
+ array[startingIndex++] = value._arcType;
+ array[startingIndex] = value._granularity;
+ return array;
+};
+var scratchEllipsoid14 = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
+var scratchVertexFormat12 = new VertexFormat_default();
+var scratchOptions21 = {
+ positions: void 0,
+ colors: void 0,
+ ellipsoid: scratchEllipsoid14,
+ vertexFormat: scratchVertexFormat12,
+ width: void 0,
+ colorsPerVertex: void 0,
+ arcType: void 0,
+ granularity: void 0
+};
+PolylineGeometry.unpack = function(array, startingIndex, result) {
+ if (!defined_default(array)) {
+ throw new DeveloperError_default("array is required");
+ }
+ startingIndex = defaultValue_default(startingIndex, 0);
+ let i;
+ let length3 = array[startingIndex++];
+ const positions = new Array(length3);
+ for (i = 0; i < length3; ++i, startingIndex += Cartesian3_default.packedLength) {
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
+ }
+ length3 = array[startingIndex++];
+ const colors = length3 > 0 ? new Array(length3) : void 0;
+ for (i = 0; i < length3; ++i, startingIndex += Color_default.packedLength) {
+ colors[i] = Color_default.unpack(array, startingIndex);
+ }
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid14);
+ startingIndex += Ellipsoid_default.packedLength;
+ const vertexFormat = VertexFormat_default.unpack(
+ array,
+ startingIndex,
+ scratchVertexFormat12
+ );
+ startingIndex += VertexFormat_default.packedLength;
+ const width = array[startingIndex++];
+ const colorsPerVertex = array[startingIndex++] === 1;
+ const arcType = array[startingIndex++];
+ const granularity = array[startingIndex];
+ if (!defined_default(result)) {
+ scratchOptions21.positions = positions;
+ scratchOptions21.colors = colors;
+ scratchOptions21.width = width;
+ scratchOptions21.colorsPerVertex = colorsPerVertex;
+ scratchOptions21.arcType = arcType;
+ scratchOptions21.granularity = granularity;
+ return new PolylineGeometry(scratchOptions21);
+ }
+ result._positions = positions;
+ result._colors = colors;
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
+ result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
+ result._width = width;
+ result._colorsPerVertex = colorsPerVertex;
+ result._arcType = arcType;
+ result._granularity = granularity;
+ return result;
+};
+var scratchCartesian39 = new Cartesian3_default();
+var scratchPosition12 = new Cartesian3_default();
+var scratchPrevPosition = new Cartesian3_default();
+var scratchNextPosition = new Cartesian3_default();
+PolylineGeometry.createGeometry = function(polylineGeometry) {
+ const width = polylineGeometry._width;
+ const vertexFormat = polylineGeometry._vertexFormat;
+ let colors = polylineGeometry._colors;
+ const colorsPerVertex = polylineGeometry._colorsPerVertex;
+ const arcType = polylineGeometry._arcType;
+ const granularity = polylineGeometry._granularity;
+ const ellipsoid = polylineGeometry._ellipsoid;
+ let i;
+ let j;
+ let k;
+ const removedIndices = [];
+ let positions = arrayRemoveDuplicates_default(
+ polylineGeometry._positions,
+ Cartesian3_default.equalsEpsilon,
+ false,
+ removedIndices
+ );
+ if (defined_default(colors) && removedIndices.length > 0) {
+ let removedArrayIndex = 0;
+ let nextRemovedIndex = removedIndices[0];
+ colors = colors.filter(function(color, index2) {
+ let remove5 = false;
+ if (colorsPerVertex) {
+ remove5 = index2 === nextRemovedIndex || index2 === 0 && nextRemovedIndex === 1;
+ } else {
+ remove5 = index2 + 1 === nextRemovedIndex;
+ }
+ if (remove5) {
+ removedArrayIndex++;
+ nextRemovedIndex = removedIndices[removedArrayIndex];
+ return false;
+ }
+ return true;
+ });
+ }
+ let positionsLength = positions.length;
+ if (positionsLength < 2 || width <= 0) {
+ return void 0;
+ }
+ if (arcType === ArcType_default.GEODESIC || arcType === ArcType_default.RHUMB) {
+ let subdivisionSize;
+ let numberOfPointsFunction;
+ if (arcType === ArcType_default.GEODESIC) {
+ subdivisionSize = Math_default.chordLength(
+ granularity,
+ ellipsoid.maximumRadius
+ );
+ numberOfPointsFunction = PolylinePipeline_default.numberOfPoints;
+ } else {
+ subdivisionSize = granularity;
+ numberOfPointsFunction = PolylinePipeline_default.numberOfPointsRhumbLine;
+ }
+ const heights = PolylinePipeline_default.extractHeights(positions, ellipsoid);
+ if (defined_default(colors)) {
+ let colorLength = 1;
+ for (i = 0; i < positionsLength - 1; ++i) {
+ colorLength += numberOfPointsFunction(
+ positions[i],
+ positions[i + 1],
+ subdivisionSize
+ );
+ }
+ const newColors = new Array(colorLength);
+ let newColorIndex = 0;
+ for (i = 0; i < positionsLength - 1; ++i) {
+ const p0 = positions[i];
+ const p1 = positions[i + 1];
+ const c0 = colors[i];
+ const numColors = numberOfPointsFunction(p0, p1, subdivisionSize);
+ if (colorsPerVertex && i < colorLength) {
+ const c14 = colors[i + 1];
+ const interpolatedColors = interpolateColors(
+ p0,
+ p1,
+ c0,
+ c14,
+ numColors
+ );
+ const interpolatedColorsLength = interpolatedColors.length;
+ for (j = 0; j < interpolatedColorsLength; ++j) {
+ newColors[newColorIndex++] = interpolatedColors[j];
+ }
+ } else {
+ for (j = 0; j < numColors; ++j) {
+ newColors[newColorIndex++] = Color_default.clone(c0);
+ }
+ }
+ }
+ newColors[newColorIndex] = Color_default.clone(colors[colors.length - 1]);
+ colors = newColors;
+ scratchInterpolateColorsArray.length = 0;
+ }
+ if (arcType === ArcType_default.GEODESIC) {
+ positions = PolylinePipeline_default.generateCartesianArc({
+ positions,
+ minDistance: subdivisionSize,
+ ellipsoid,
+ height: heights
+ });
+ } else {
+ positions = PolylinePipeline_default.generateCartesianRhumbArc({
+ positions,
+ granularity: subdivisionSize,
+ ellipsoid,
+ height: heights
+ });
+ }
+ }
+ positionsLength = positions.length;
+ const size = positionsLength * 4 - 4;
+ const finalPositions = new Float64Array(size * 3);
+ const prevPositions = new Float64Array(size * 3);
+ const nextPositions = new Float64Array(size * 3);
+ const expandAndWidth = new Float32Array(size * 2);
+ const st = vertexFormat.st ? new Float32Array(size * 2) : void 0;
+ const finalColors = defined_default(colors) ? new Uint8Array(size * 4) : void 0;
+ let positionIndex = 0;
+ let expandAndWidthIndex = 0;
+ let stIndex = 0;
+ let colorIndex = 0;
+ let position;
+ for (j = 0; j < positionsLength; ++j) {
+ if (j === 0) {
+ position = scratchCartesian39;
+ Cartesian3_default.subtract(positions[0], positions[1], position);
+ Cartesian3_default.add(positions[0], position, position);
+ } else {
+ position = positions[j - 1];
+ }
+ Cartesian3_default.clone(position, scratchPrevPosition);
+ Cartesian3_default.clone(positions[j], scratchPosition12);
+ if (j === positionsLength - 1) {
+ position = scratchCartesian39;
+ Cartesian3_default.subtract(
+ positions[positionsLength - 1],
+ positions[positionsLength - 2],
+ position
+ );
+ Cartesian3_default.add(positions[positionsLength - 1], position, position);
+ } else {
+ position = positions[j + 1];
+ }
+ Cartesian3_default.clone(position, scratchNextPosition);
+ let color0, color1;
+ if (defined_default(finalColors)) {
+ if (j !== 0 && !colorsPerVertex) {
+ color0 = colors[j - 1];
+ } else {
+ color0 = colors[j];
+ }
+ if (j !== positionsLength - 1) {
+ color1 = colors[j];
+ }
+ }
+ const startK = j === 0 ? 2 : 0;
+ const endK = j === positionsLength - 1 ? 2 : 4;
+ for (k = startK; k < endK; ++k) {
+ Cartesian3_default.pack(scratchPosition12, finalPositions, positionIndex);
+ Cartesian3_default.pack(scratchPrevPosition, prevPositions, positionIndex);
+ Cartesian3_default.pack(scratchNextPosition, nextPositions, positionIndex);
+ positionIndex += 3;
+ const direction2 = k - 2 < 0 ? -1 : 1;
+ expandAndWidth[expandAndWidthIndex++] = 2 * (k % 2) - 1;
+ expandAndWidth[expandAndWidthIndex++] = direction2 * width;
+ if (vertexFormat.st) {
+ st[stIndex++] = j / (positionsLength - 1);
+ st[stIndex++] = Math.max(expandAndWidth[expandAndWidthIndex - 2], 0);
+ }
+ if (defined_default(finalColors)) {
+ const color = k < 2 ? color0 : color1;
+ finalColors[colorIndex++] = Color_default.floatToByte(color.red);
+ finalColors[colorIndex++] = Color_default.floatToByte(color.green);
+ finalColors[colorIndex++] = Color_default.floatToByte(color.blue);
+ finalColors[colorIndex++] = Color_default.floatToByte(color.alpha);
+ }
+ }
+ }
+ const attributes = new GeometryAttributes_default();
+ attributes.position = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: finalPositions
+ });
+ attributes.prevPosition = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: prevPositions
+ });
+ attributes.nextPosition = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.DOUBLE,
+ componentsPerAttribute: 3,
+ values: nextPositions
+ });
+ attributes.expandAndWidth = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: expandAndWidth
+ });
+ if (vertexFormat.st) {
+ attributes.st = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.FLOAT,
+ componentsPerAttribute: 2,
+ values: st
+ });
+ }
+ if (defined_default(finalColors)) {
+ attributes.color = new GeometryAttribute_default({
+ componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
+ componentsPerAttribute: 4,
+ values: finalColors,
+ normalize: true
+ });
+ }
+ const indices2 = IndexDatatype_default.createTypedArray(size, positionsLength * 6 - 6);
+ let index = 0;
+ let indicesIndex = 0;
+ const length3 = positionsLength - 1;
+ for (j = 0; j < length3; ++j) {
+ indices2[indicesIndex++] = index;
+ indices2[indicesIndex++] = index + 2;
+ indices2[indicesIndex++] = index + 1;
+ indices2[indicesIndex++] = index + 1;
+ indices2[indicesIndex++] = index + 2;
+ indices2[indicesIndex++] = index + 3;
+ index += 4;
+ }
+ return new Geometry_default({
+ attributes,
+ indices: indices2,
+ primitiveType: PrimitiveType_default.TRIANGLES,
+ boundingSphere: BoundingSphere_default.fromPoints(positions),
+ geometryType: GeometryType_default.POLYLINES
+ });
+};
+var PolylineGeometry_default = PolylineGeometry;
+
+// Source/DataSources/PolylineGeometryUpdater.js
+var defaultZIndex2 = new ConstantProperty_default(0);
+var polylineCollections = {};
+var scratchColor21 = new Color_default();
+var defaultMaterial3 = new ColorMaterialProperty_default(Color_default.WHITE);
+var defaultShow2 = new ConstantProperty_default(true);
+var defaultShadows3 = new ConstantProperty_default(ShadowMode_default.DISABLED);
+var defaultDistanceDisplayCondition7 = new ConstantProperty_default(
+ new DistanceDisplayCondition_default()
+);
+var defaultClassificationType2 = new ConstantProperty_default(ClassificationType_default.BOTH);
+function GeometryOptions() {
+ this.vertexFormat = void 0;
+ this.positions = void 0;
+ this.width = void 0;
+ this.arcType = void 0;
+ this.granularity = void 0;
+}
+function GroundGeometryOptions() {
+ this.positions = void 0;
+ this.width = void 0;
+ this.arcType = void 0;
+ this.granularity = void 0;
+}
+function PolylineGeometryUpdater(entity, scene) {
+ if (!defined_default(entity)) {
+ throw new DeveloperError_default("entity is required");
+ }
+ if (!defined_default(scene)) {
+ throw new DeveloperError_default("scene is required");
+ }
+ this._entity = entity;
+ this._scene = scene;
+ this._entitySubscription = entity.definitionChanged.addEventListener(
+ PolylineGeometryUpdater.prototype._onEntityPropertyChanged,
+ this
+ );
+ this._fillEnabled = false;
+ this._dynamic = false;
+ this._geometryChanged = new Event_default();
+ this._showProperty = void 0;
+ this._materialProperty = void 0;
+ this._shadowsProperty = void 0;
+ this._distanceDisplayConditionProperty = void 0;
+ this._classificationTypeProperty = void 0;
+ this._depthFailMaterialProperty = void 0;
+ this._geometryOptions = new GeometryOptions();
+ this._groundGeometryOptions = new GroundGeometryOptions();
+ this._id = `polyline-${entity.id}`;
+ this._clampToGround = false;
+ this._supportsPolylinesOnTerrain = Entity_default.supportsPolylinesOnTerrain(scene);
+ this._zIndex = 0;
+ this._onEntityPropertyChanged(entity, "polyline", entity.polyline, void 0);
+}
+Object.defineProperties(PolylineGeometryUpdater.prototype, {
+ id: {
+ get: function() {
+ return this._id;
+ }
+ },
+ entity: {
+ get: function() {
+ return this._entity;
+ }
+ },
+ fillEnabled: {
+ get: function() {
+ return this._fillEnabled;
+ }
+ },
+ hasConstantFill: {
+ get: function() {
+ return !this._fillEnabled || !defined_default(this._entity.availability) && Property_default.isConstant(this._showProperty);
+ }
+ },
+ fillMaterialProperty: {
+ get: function() {
+ return this._materialProperty;
+ }
+ },
+ depthFailMaterialProperty: {
+ get: function() {
+ return this._depthFailMaterialProperty;
+ }
+ },
+ outlineEnabled: {
+ value: false
+ },
+ hasConstantOutline: {
+ value: true
+ },
+ outlineColorProperty: {
+ value: void 0
+ },
+ shadowsProperty: {
+ get: function() {
+ return this._shadowsProperty;
+ }
+ },
+ distanceDisplayConditionProperty: {
+ get: function() {
+ return this._distanceDisplayConditionProperty;
+ }
+ },
+ classificationTypeProperty: {
+ get: function() {
+ return this._classificationTypeProperty;
+ }
+ },
+ isDynamic: {
+ get: function() {
+ return this._dynamic;
+ }
+ },
+ isClosed: {
+ value: false
+ },
+ geometryChanged: {
+ get: function() {
+ return this._geometryChanged;
+ }
+ },
+ arcType: {
+ get: function() {
+ return this._arcType;
+ }
+ },
+ clampToGround: {
+ get: function() {
+ return this._clampToGround && this._supportsPolylinesOnTerrain;
+ }
+ },
+ zIndex: {
+ get: function() {
+ return this._zIndex;
+ }
+ }
+});
+PolylineGeometryUpdater.prototype.isOutlineVisible = function(time) {
+ return false;
+};
+PolylineGeometryUpdater.prototype.isFilled = function(time) {
+ const entity = this._entity;
+ const visible = this._fillEnabled && entity.isAvailable(time) && this._showProperty.getValue(time);
+ return defaultValue_default(visible, false);
+};
+PolylineGeometryUpdater.prototype.createFillGeometryInstance = function(time) {
+ if (!defined_default(time)) {
+ throw new DeveloperError_default("time is required.");
+ }
+ if (!this._fillEnabled) {
+ throw new DeveloperError_default(
+ "This instance does not represent a filled geometry."
+ );
+ }
+ const entity = this._entity;
+ const isAvailable = entity.isAvailable(time);
+ const show = new ShowGeometryInstanceAttribute_default(
+ isAvailable && entity.isShowing && this._showProperty.getValue(time)
+ );
+ const distanceDisplayCondition = this._distanceDisplayConditionProperty.getValue(
+ time
+ );
+ const distanceDisplayConditionAttribute = DistanceDisplayConditionGeometryInstanceAttribute_default.fromDistanceDisplayCondition(
+ distanceDisplayCondition
+ );
+ const attributes = {
+ show,
+ distanceDisplayCondition: distanceDisplayConditionAttribute
+ };
+ let currentColor;
+ if (this._materialProperty instanceof ColorMaterialProperty_default) {
+ if (defined_default(this._materialProperty.color) && (this._materialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._materialProperty.color.getValue(time, scratchColor21);
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ attributes.color = ColorGeometryInstanceAttribute_default.fromColor(currentColor);
+ }
+ if (this.clampToGround) {
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new GroundPolylineGeometry_default(this._groundGeometryOptions),
+ attributes
+ });
+ }
+ if (defined_default(this._depthFailMaterialProperty) && this._depthFailMaterialProperty instanceof ColorMaterialProperty_default) {
+ if (defined_default(this._depthFailMaterialProperty.color) && (this._depthFailMaterialProperty.color.isConstant || isAvailable)) {
+ currentColor = this._depthFailMaterialProperty.color.getValue(
+ time,
+ scratchColor21
+ );
+ }
+ if (!defined_default(currentColor)) {
+ currentColor = Color_default.WHITE;
+ }
+ attributes.depthFailColor = ColorGeometryInstanceAttribute_default.fromColor(
+ currentColor
+ );
+ }
+ return new GeometryInstance_default({
+ id: entity,
+ geometry: new PolylineGeometry_default(this._geometryOptions),
+ attributes
+ });
+};
+PolylineGeometryUpdater.prototype.createOutlineGeometryInstance = function(time) {
+ throw new DeveloperError_default(
+ "This instance does not represent an outlined geometry."
+ );
+};
+PolylineGeometryUpdater.prototype.isDestroyed = function() {
+ return false;
+};
+PolylineGeometryUpdater.prototype.destroy = function() {
+ this._entitySubscription();
+ destroyObject_default(this);
+};
+PolylineGeometryUpdater.prototype._onEntityPropertyChanged = function(entity, propertyName, newValue, oldValue2) {
+ if (!(propertyName === "availability" || propertyName === "polyline")) {
+ return;
+ }
+ const polyline = this._entity.polyline;
+ if (!defined_default(polyline)) {
+ if (this._fillEnabled) {
+ this._fillEnabled = false;
+ this._geometryChanged.raiseEvent(this);
+ }
+ return;
+ }
+ const positionsProperty = polyline.positions;
+ const show = polyline.show;
+ if (defined_default(show) && show.isConstant && !show.getValue(Iso8601_default.MINIMUM_VALUE) || !defined_default(positionsProperty)) {
+ if (this._fillEnabled) {
+ this._fillEnabled = false;
+ this._geometryChanged.raiseEvent(this);
+ }
+ return;
+ }
+ const zIndex = polyline.zIndex;
+ const material = defaultValue_default(polyline.material, defaultMaterial3);
+ const isColorMaterial = material instanceof ColorMaterialProperty_default;
+ this._materialProperty = material;
+ this._depthFailMaterialProperty = polyline.depthFailMaterial;
+ this._showProperty = defaultValue_default(show, defaultShow2);
+ this._shadowsProperty = defaultValue_default(polyline.shadows, defaultShadows3);
+ this._distanceDisplayConditionProperty = defaultValue_default(
+ polyline.distanceDisplayCondition,
+ defaultDistanceDisplayCondition7
+ );
+ this._classificationTypeProperty = defaultValue_default(
+ polyline.classificationType,
+ defaultClassificationType2
+ );
+ this._fillEnabled = true;
+ this._zIndex = defaultValue_default(zIndex, defaultZIndex2);
+ const width = polyline.width;
+ const arcType = polyline.arcType;
+ const clampToGround = polyline.clampToGround;
+ const granularity = polyline.granularity;
+ if (!positionsProperty.isConstant || !Property_default.isConstant(width) || !Property_default.isConstant(arcType) || !Property_default.isConstant(granularity) || !Property_default.isConstant(clampToGround) || !Property_default.isConstant(zIndex)) {
+ if (!this._dynamic) {
+ this._dynamic = true;
+ this._geometryChanged.raiseEvent(this);
+ }
+ } else {
+ const geometryOptions = this._geometryOptions;
+ const positions = positionsProperty.getValue(
+ Iso8601_default.MINIMUM_VALUE,
+ geometryOptions.positions
+ );
+ if (!defined_default(positions) || positions.length < 2) {
+ if (this._fillEnabled) {
+ this._fillEnabled = false;
+ this._geometryChanged.raiseEvent(this);
+ }
+ return;
+ }
+ let vertexFormat;
+ if (isColorMaterial && (!defined_default(this._depthFailMaterialProperty) || this._depthFailMaterialProperty instanceof ColorMaterialProperty_default)) {
+ vertexFormat = PolylineColorAppearance_default.VERTEX_FORMAT;
+ } else {
+ vertexFormat = PolylineMaterialAppearance_default.VERTEX_FORMAT;
+ }
+ geometryOptions.vertexFormat = vertexFormat;
+ geometryOptions.positions = positions;
+ geometryOptions.width = defined_default(width) ? width.getValue(Iso8601_default.MINIMUM_VALUE) : void 0;
+ geometryOptions.arcType = defined_default(arcType) ? arcType.getValue(Iso8601_default.MINIMUM_VALUE) : void 0;
+ geometryOptions.granularity = defined_default(granularity) ? granularity.getValue(Iso8601_default.MINIMUM_VALUE) : void 0;
+ const groundGeometryOptions = this._groundGeometryOptions;
+ groundGeometryOptions.positions = positions;
+ groundGeometryOptions.width = geometryOptions.width;
+ groundGeometryOptions.arcType = geometryOptions.arcType;
+ groundGeometryOptions.granularity = geometryOptions.granularity;
+ this._clampToGround = defined_default(clampToGround) ? clampToGround.getValue(Iso8601_default.MINIMUM_VALUE) : false;
+ if (!this._clampToGround && defined_default(zIndex)) {
+ oneTimeWarning_default(
+ "Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."
+ );
+ }
+ this._dynamic = false;
+ this._geometryChanged.raiseEvent(this);
+ }
+};
+PolylineGeometryUpdater.prototype.createDynamicUpdater = function(primitives, groundPrimitives) {
+ Check_default.defined("primitives", primitives);
+ Check_default.defined("groundPrimitives", groundPrimitives);
+ if (!this._dynamic) {
+ throw new DeveloperError_default(
+ "This instance does not represent dynamic geometry."
+ );
+ }
+ return new DynamicGeometryUpdater2(primitives, groundPrimitives, this);
+};
+var generateCartesianArcOptions = {
+ positions: void 0,
+ granularity: void 0,
+ height: void 0,
+ ellipsoid: void 0
+};
+function DynamicGeometryUpdater2(primitives, groundPrimitives, geometryUpdater) {
+ this._line = void 0;
+ this._primitives = primitives;
+ this._groundPrimitives = groundPrimitives;
+ this._groundPolylinePrimitive = void 0;
+ this._material = void 0;
+ this._geometryUpdater = geometryUpdater;
+ this._positions = [];
+}
+function getLine(dynamicGeometryUpdater) {
+ if (defined_default(dynamicGeometryUpdater._line)) {
+ return dynamicGeometryUpdater._line;
+ }
+ const sceneId = dynamicGeometryUpdater._geometryUpdater._scene.id;
+ let polylineCollection = polylineCollections[sceneId];
+ const primitives = dynamicGeometryUpdater._primitives;
+ if (!defined_default(polylineCollection) || polylineCollection.isDestroyed()) {
+ polylineCollection = new PolylineCollection_default();
+ polylineCollections[sceneId] = polylineCollection;
+ primitives.add(polylineCollection);
+ } else if (!primitives.contains(polylineCollection)) {
+ primitives.add(polylineCollection);
+ }
+ const line = polylineCollection.add();
+ line.id = dynamicGeometryUpdater._geometryUpdater._entity;
+ dynamicGeometryUpdater._line = line;
+ return line;
+}
+DynamicGeometryUpdater2.prototype.update = function(time) {
+ const geometryUpdater = this._geometryUpdater;
+ const entity = geometryUpdater._entity;
+ const polyline = entity.polyline;
+ const positionsProperty = polyline.positions;
+ let positions = Property_default.getValueOrUndefined(
+ positionsProperty,
+ time,
+ this._positions
+ );
+ geometryUpdater._clampToGround = Property_default.getValueOrDefault(
+ polyline._clampToGround,
+ time,
+ false
+ );
+ geometryUpdater._groundGeometryOptions.positions = positions;
+ geometryUpdater._groundGeometryOptions.width = Property_default.getValueOrDefault(
+ polyline._width,
+ time,
+ 1
+ );
+ geometryUpdater._groundGeometryOptions.arcType = Property_default.getValueOrDefault(
+ polyline._arcType,
+ time,
+ ArcType_default.GEODESIC
+ );
+ geometryUpdater._groundGeometryOptions.granularity = Property_default.getValueOrDefault(
+ polyline._granularity,
+ time,
+ 9999
+ );
+ const groundPrimitives = this._groundPrimitives;
+ if (defined_default(this._groundPolylinePrimitive)) {
+ groundPrimitives.remove(this._groundPolylinePrimitive);
+ this._groundPolylinePrimitive = void 0;
+ }
+ if (geometryUpdater.clampToGround) {
+ if (!entity.isShowing || !entity.isAvailable(time) || !Property_default.getValueOrDefault(polyline._show, time, true)) {
+ return;
+ }
+ if (!defined_default(positions) || positions.length < 2) {
+ return;
+ }
+ const fillMaterialProperty = geometryUpdater.fillMaterialProperty;
+ let appearance;
+ if (fillMaterialProperty instanceof ColorMaterialProperty_default) {
+ appearance = new PolylineColorAppearance_default();
+ } else {
+ const material = MaterialProperty_default.getValue(
+ time,
+ fillMaterialProperty,
+ this._material
+ );
+ appearance = new PolylineMaterialAppearance_default({
+ material,
+ translucent: material.isTranslucent()
+ });
+ this._material = material;
+ }
+ this._groundPolylinePrimitive = groundPrimitives.add(
+ new GroundPolylinePrimitive_default({
+ geometryInstances: geometryUpdater.createFillGeometryInstance(time),
+ appearance,
+ classificationType: geometryUpdater.classificationTypeProperty.getValue(
+ time
+ ),
+ asynchronous: false
+ }),
+ Property_default.getValueOrUndefined(geometryUpdater.zIndex, time)
+ );
+ if (defined_default(this._line)) {
+ this._line.show = false;
+ }
+ return;
+ }
+ const line = getLine(this);
+ if (!entity.isShowing || !entity.isAvailable(time) || !Property_default.getValueOrDefault(polyline._show, time, true)) {
+ line.show = false;
+ return;
+ }
+ if (!defined_default(positions) || positions.length < 2) {
+ line.show = false;
+ return;
+ }
+ let arcType = ArcType_default.GEODESIC;
+ arcType = Property_default.getValueOrDefault(polyline._arcType, time, arcType);
+ const globe = geometryUpdater._scene.globe;
+ if (arcType !== ArcType_default.NONE && defined_default(globe)) {
+ generateCartesianArcOptions.ellipsoid = globe.ellipsoid;
+ generateCartesianArcOptions.positions = positions;
+ generateCartesianArcOptions.granularity = Property_default.getValueOrUndefined(
+ polyline._granularity,
+ time
+ );
+ generateCartesianArcOptions.height = PolylinePipeline_default.extractHeights(
+ positions,
+ globe.ellipsoid
+ );
+ if (arcType === ArcType_default.GEODESIC) {
+ positions = PolylinePipeline_default.generateCartesianArc(
+ generateCartesianArcOptions
+ );
+ } else {
+ positions = PolylinePipeline_default.generateCartesianRhumbArc(
+ generateCartesianArcOptions
+ );
+ }
+ }
+ line.show = true;
+ line.positions = positions.slice();
+ line.material = MaterialProperty_default.getValue(
+ time,
+ geometryUpdater.fillMaterialProperty,
+ line.material
+ );
+ line.width = Property_default.getValueOrDefault(polyline._width, time, 1);
+ line.distanceDisplayCondition = Property_default.getValueOrUndefined(
+ polyline._distanceDisplayCondition,
+ time,
+ line.distanceDisplayCondition
+ );
+};
+DynamicGeometryUpdater2.prototype.getBoundingSphere = function(result) {
+ Check_default.defined("result", result);
+ if (!this._geometryUpdater.clampToGround) {
+ const line = getLine(this);
+ if (line.show && line.positions.length > 0) {
+ BoundingSphere_default.fromPoints(line.positions, result);
+ return BoundingSphereState_default.DONE;
+ }
+ } else {
+ const groundPolylinePrimitive = this._groundPolylinePrimitive;
+ if (defined_default(groundPolylinePrimitive) && groundPolylinePrimitive.show && groundPolylinePrimitive.ready) {
+ const attributes = groundPolylinePrimitive.getGeometryInstanceAttributes(
+ this._geometryUpdater._entity
+ );
+ if (defined_default(attributes) && defined_default(attributes.boundingSphere)) {
+ BoundingSphere_default.clone(attributes.boundingSphere, result);
+ return BoundingSphereState_default.DONE;
+ }
+ }
+ if (defined_default(groundPolylinePrimitive) && !groundPolylinePrimitive.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ return BoundingSphereState_default.DONE;
+ }
+ return BoundingSphereState_default.FAILED;
+};
+DynamicGeometryUpdater2.prototype.isDestroyed = function() {
+ return false;
+};
+DynamicGeometryUpdater2.prototype.destroy = function() {
+ const geometryUpdater = this._geometryUpdater;
+ const sceneId = geometryUpdater._scene.id;
+ const polylineCollection = polylineCollections[sceneId];
+ if (defined_default(polylineCollection)) {
+ polylineCollection.remove(this._line);
+ if (polylineCollection.length === 0) {
+ this._primitives.removeAndDestroy(polylineCollection);
+ delete polylineCollections[sceneId];
+ }
+ }
+ if (defined_default(this._groundPolylinePrimitive)) {
+ this._groundPrimitives.remove(this._groundPolylinePrimitive);
+ }
+ destroyObject_default(this);
+};
+var PolylineGeometryUpdater_default = PolylineGeometryUpdater;
+
+// Source/DataSources/StaticGroundPolylinePerMaterialBatch.js
+var scratchColor23 = new Color_default();
+var distanceDisplayConditionScratch9 = new DistanceDisplayCondition_default();
+var defaultDistanceDisplayCondition8 = new DistanceDisplayCondition_default();
+function Batch6(orderedGroundPrimitives, classificationType, materialProperty, zIndex, asynchronous) {
+ let appearanceType;
+ if (materialProperty instanceof ColorMaterialProperty_default) {
+ appearanceType = PolylineColorAppearance_default;
+ } else {
+ appearanceType = PolylineMaterialAppearance_default;
+ }
+ this.orderedGroundPrimitives = orderedGroundPrimitives;
+ this.classificationType = classificationType;
+ this.appearanceType = appearanceType;
+ this.materialProperty = materialProperty;
+ this.updaters = new AssociativeArray_default();
+ this.createPrimitive = true;
+ this.primitive = void 0;
+ this.oldPrimitive = void 0;
+ this.geometry = new AssociativeArray_default();
+ this.material = void 0;
+ this.updatersWithAttributes = new AssociativeArray_default();
+ this.attributes = new AssociativeArray_default();
+ this.invalidated = false;
+ this.removeMaterialSubscription = materialProperty.definitionChanged.addEventListener(
+ Batch6.prototype.onMaterialChanged,
+ this
+ );
+ this.subscriptions = new AssociativeArray_default();
+ this.showsUpdated = new AssociativeArray_default();
+ this.zIndex = zIndex;
+ this._asynchronous = asynchronous;
+}
+Batch6.prototype.onMaterialChanged = function() {
+ this.invalidated = true;
+};
+Batch6.prototype.isMaterial = function(updater) {
+ const material = this.materialProperty;
+ const updaterMaterial = updater.fillMaterialProperty;
+ if (updaterMaterial === material || updaterMaterial instanceof ColorMaterialProperty_default && material instanceof ColorMaterialProperty_default) {
+ return true;
+ }
+ return defined_default(material) && material.equals(updaterMaterial);
+};
+Batch6.prototype.add = function(time, updater, geometryInstance) {
+ const id = updater.id;
+ this.updaters.set(id, updater);
+ this.geometry.set(id, geometryInstance);
+ if (!updater.hasConstantFill || !updater.fillMaterialProperty.isConstant || !Property_default.isConstant(updater.distanceDisplayConditionProperty)) {
+ this.updatersWithAttributes.set(id, updater);
+ } else {
+ const that = this;
+ this.subscriptions.set(
+ id,
+ updater.entity.definitionChanged.addEventListener(function(entity, propertyName, newValue, oldValue2) {
+ if (propertyName === "isShowing") {
+ that.showsUpdated.set(updater.id, updater);
+ }
+ })
+ );
+ }
+ this.createPrimitive = true;
+};
+Batch6.prototype.remove = function(updater) {
+ const id = updater.id;
+ this.createPrimitive = this.geometry.remove(id) || this.createPrimitive;
+ if (this.updaters.remove(id)) {
+ this.updatersWithAttributes.remove(id);
+ const unsubscribe2 = this.subscriptions.get(id);
+ if (defined_default(unsubscribe2)) {
+ unsubscribe2();
+ this.subscriptions.remove(id);
+ }
+ return true;
+ }
+ return false;
+};
+Batch6.prototype.update = function(time) {
+ let isUpdated = true;
+ let primitive = this.primitive;
+ const orderedGroundPrimitives = this.orderedGroundPrimitives;
+ const geometries = this.geometry.values;
+ let i;
+ if (this.createPrimitive) {
+ const geometriesLength = geometries.length;
+ if (geometriesLength > 0) {
+ if (defined_default(primitive)) {
+ if (!defined_default(this.oldPrimitive)) {
+ this.oldPrimitive = primitive;
+ } else {
+ orderedGroundPrimitives.remove(primitive);
+ }
+ }
+ primitive = new GroundPolylinePrimitive_default({
+ show: false,
+ asynchronous: this._asynchronous,
+ geometryInstances: geometries.slice(),
+ appearance: new this.appearanceType(),
+ classificationType: this.classificationType
+ });
+ if (this.appearanceType === PolylineMaterialAppearance_default) {
+ this.material = MaterialProperty_default.getValue(
+ time,
+ this.materialProperty,
+ this.material
+ );
+ primitive.appearance.material = this.material;
+ }
+ orderedGroundPrimitives.add(primitive, this.zIndex);
+ isUpdated = false;
+ } else {
+ if (defined_default(primitive)) {
+ orderedGroundPrimitives.remove(primitive);
+ primitive = void 0;
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ orderedGroundPrimitives.remove(oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ }
+ this.attributes.removeAll();
+ this.primitive = primitive;
+ this.createPrimitive = false;
+ } else if (defined_default(primitive) && primitive.ready) {
+ primitive.show = true;
+ if (defined_default(this.oldPrimitive)) {
+ orderedGroundPrimitives.remove(this.oldPrimitive);
+ this.oldPrimitive = void 0;
+ }
+ if (this.appearanceType === PolylineMaterialAppearance_default) {
+ this.material = MaterialProperty_default.getValue(
+ time,
+ this.materialProperty,
+ this.material
+ );
+ this.primitive.appearance.material = this.material;
+ }
+ const updatersWithAttributes = this.updatersWithAttributes.values;
+ const length3 = updatersWithAttributes.length;
+ for (i = 0; i < length3; i++) {
+ const updater = updatersWithAttributes[i];
+ const entity = updater.entity;
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ if (!updater.fillMaterialProperty.isConstant) {
+ const colorProperty = updater.fillMaterialProperty.color;
+ const resultColor = Property_default.getValueOrDefault(
+ colorProperty,
+ time,
+ Color_default.WHITE,
+ scratchColor23
+ );
+ if (!Color_default.equals(attributes._lastColor, resultColor)) {
+ attributes._lastColor = Color_default.clone(
+ resultColor,
+ attributes._lastColor
+ );
+ attributes.color = ColorGeometryInstanceAttribute_default.toValue(
+ resultColor,
+ attributes.color
+ );
+ }
+ }
+ const show = entity.isShowing && (updater.hasConstantFill || updater.isFilled(time));
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ }
+ const distanceDisplayConditionProperty = updater.distanceDisplayConditionProperty;
+ if (!Property_default.isConstant(distanceDisplayConditionProperty)) {
+ const distanceDisplayCondition = Property_default.getValueOrDefault(
+ distanceDisplayConditionProperty,
+ time,
+ defaultDistanceDisplayCondition8,
+ distanceDisplayConditionScratch9
+ );
+ if (!DistanceDisplayCondition_default.equals(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ )) {
+ attributes._lastDistanceDisplayCondition = DistanceDisplayCondition_default.clone(
+ distanceDisplayCondition,
+ attributes._lastDistanceDisplayCondition
+ );
+ attributes.distanceDisplayCondition = DistanceDisplayConditionGeometryInstanceAttribute_default.toValue(
+ distanceDisplayCondition,
+ attributes.distanceDisplayCondition
+ );
+ }
+ }
+ }
+ this.updateShows(primitive);
+ } else if (defined_default(primitive) && !primitive.ready) {
+ isUpdated = false;
+ }
+ return isUpdated;
+};
+Batch6.prototype.updateShows = function(primitive) {
+ const showsUpdated = this.showsUpdated.values;
+ const length3 = showsUpdated.length;
+ for (let i = 0; i < length3; i++) {
+ const updater = showsUpdated[i];
+ const entity = updater.entity;
+ const instance = this.geometry.get(updater.id);
+ let attributes = this.attributes.get(instance.id.id);
+ if (!defined_default(attributes)) {
+ attributes = primitive.getGeometryInstanceAttributes(instance.id);
+ this.attributes.set(instance.id.id, attributes);
+ }
+ const show = entity.isShowing;
+ const currentShow = attributes.show[0] === 1;
+ if (show !== currentShow) {
+ attributes.show = ShowGeometryInstanceAttribute_default.toValue(
+ show,
+ attributes.show
+ );
+ instance.attributes.show.value[0] = attributes.show[0];
+ }
+ }
+ this.showsUpdated.removeAll();
+};
+Batch6.prototype.contains = function(updater) {
+ return this.updaters.contains(updater.id);
+};
+Batch6.prototype.getBoundingSphere = function(updater, result) {
+ const primitive = this.primitive;
+ if (!primitive.ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ const attributes = primitive.getGeometryInstanceAttributes(updater.entity);
+ if (!defined_default(attributes) || !defined_default(attributes.boundingSphere) || defined_default(attributes.show) && attributes.show[0] === 0) {
+ return BoundingSphereState_default.FAILED;
+ }
+ attributes.boundingSphere.clone(result);
+ return BoundingSphereState_default.DONE;
+};
+Batch6.prototype.destroy = function() {
+ const primitive = this.primitive;
+ const orderedGroundPrimitives = this.orderedGroundPrimitives;
+ if (defined_default(primitive)) {
+ orderedGroundPrimitives.remove(primitive);
+ }
+ const oldPrimitive = this.oldPrimitive;
+ if (defined_default(oldPrimitive)) {
+ orderedGroundPrimitives.remove(oldPrimitive);
+ }
+ this.removeMaterialSubscription();
+};
+function StaticGroundPolylinePerMaterialBatch(orderedGroundPrimitives, classificationType, asynchronous) {
+ this._items = [];
+ this._orderedGroundPrimitives = orderedGroundPrimitives;
+ this._classificationType = classificationType;
+ this._asynchronous = defaultValue_default(asynchronous, true);
+}
+StaticGroundPolylinePerMaterialBatch.prototype.add = function(time, updater) {
+ const items = this._items;
+ const length3 = items.length;
+ const geometryInstance = updater.createFillGeometryInstance(time);
+ const zIndex = Property_default.getValueOrDefault(updater.zIndex, 0);
+ for (let i = 0; i < length3; ++i) {
+ const item = items[i];
+ if (item.isMaterial(updater) && item.zIndex === zIndex) {
+ item.add(time, updater, geometryInstance);
+ return;
+ }
+ }
+ const batch = new Batch6(
+ this._orderedGroundPrimitives,
+ this._classificationType,
+ updater.fillMaterialProperty,
+ zIndex,
+ this._asynchronous
+ );
+ batch.add(time, updater, geometryInstance);
+ items.push(batch);
+};
+StaticGroundPolylinePerMaterialBatch.prototype.remove = function(updater) {
+ const items = this._items;
+ const length3 = items.length;
+ for (let i = length3 - 1; i >= 0; i--) {
+ const item = items[i];
+ if (item.remove(updater)) {
+ if (item.updaters.length === 0) {
+ items.splice(i, 1);
+ item.destroy();
+ }
+ break;
+ }
+ }
+};
+StaticGroundPolylinePerMaterialBatch.prototype.update = function(time) {
+ let i;
+ const items = this._items;
+ const length3 = items.length;
+ for (i = length3 - 1; i >= 0; i--) {
+ const item = items[i];
+ if (item.invalidated) {
+ items.splice(i, 1);
+ const updaters = item.updaters.values;
+ const updatersLength = updaters.length;
+ for (let h = 0; h < updatersLength; h++) {
+ this.add(time, updaters[h]);
+ }
+ item.destroy();
+ }
+ }
+ let isUpdated = true;
+ for (i = 0; i < items.length; i++) {
+ isUpdated = items[i].update(time) && isUpdated;
+ }
+ return isUpdated;
+};
+StaticGroundPolylinePerMaterialBatch.prototype.getBoundingSphere = function(updater, result) {
+ const items = this._items;
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ const item = items[i];
+ if (item.contains(updater)) {
+ return item.getBoundingSphere(updater, result);
+ }
+ }
+ return BoundingSphereState_default.FAILED;
+};
+StaticGroundPolylinePerMaterialBatch.prototype.removeAllPrimitives = function() {
+ const items = this._items;
+ const length3 = items.length;
+ for (let i = 0; i < length3; i++) {
+ items[i].destroy();
+ }
+ this._items.length = 0;
+};
+var StaticGroundPolylinePerMaterialBatch_default = StaticGroundPolylinePerMaterialBatch;
+
+// Source/DataSources/PolylineVisualizer.js
+var emptyArray2 = [];
+function removeUpdater(that, updater) {
+ const batches = that._batches;
+ const length3 = batches.length;
+ for (let i = 0; i < length3; i++) {
+ batches[i].remove(updater);
+ }
+}
+function insertUpdaterIntoBatch(that, time, updater) {
+ if (updater.isDynamic) {
+ that._dynamicBatch.add(time, updater);
+ return;
+ }
+ if (updater.clampToGround && updater.fillEnabled) {
+ const classificationType = updater.classificationTypeProperty.getValue(
+ time
+ );
+ that._groundBatches[classificationType].add(time, updater);
+ return;
+ }
+ let shadows;
+ if (updater.fillEnabled) {
+ shadows = updater.shadowsProperty.getValue(time);
+ }
+ let multiplier = 0;
+ if (defined_default(updater.depthFailMaterialProperty)) {
+ multiplier = updater.depthFailMaterialProperty instanceof ColorMaterialProperty_default ? 1 : 2;
+ }
+ let index;
+ if (defined_default(shadows)) {
+ index = shadows + multiplier * ShadowMode_default.NUMBER_OF_SHADOW_MODES;
+ }
+ if (updater.fillEnabled) {
+ if (updater.fillMaterialProperty instanceof ColorMaterialProperty_default) {
+ that._colorBatches[index].add(time, updater);
+ } else {
+ that._materialBatches[index].add(time, updater);
+ }
+ }
+}
+function PolylineVisualizer(scene, entityCollection, primitives, groundPrimitives) {
+ Check_default.defined("scene", scene);
+ Check_default.defined("entityCollection", entityCollection);
+ groundPrimitives = defaultValue_default(groundPrimitives, scene.groundPrimitives);
+ primitives = defaultValue_default(primitives, scene.primitives);
+ this._scene = scene;
+ this._primitives = primitives;
+ this._entityCollection = void 0;
+ this._addedObjects = new AssociativeArray_default();
+ this._removedObjects = new AssociativeArray_default();
+ this._changedObjects = new AssociativeArray_default();
+ let i;
+ const numberOfShadowModes = ShadowMode_default.NUMBER_OF_SHADOW_MODES;
+ this._colorBatches = new Array(numberOfShadowModes * 3);
+ this._materialBatches = new Array(numberOfShadowModes * 3);
+ for (i = 0; i < numberOfShadowModes; ++i) {
+ this._colorBatches[i] = new StaticGeometryColorBatch_default(
+ primitives,
+ PolylineColorAppearance_default,
+ void 0,
+ false,
+ i
+ );
+ this._materialBatches[i] = new StaticGeometryPerMaterialBatch_default(
+ primitives,
+ PolylineMaterialAppearance_default,
+ void 0,
+ false,
+ i
+ );
+ this._colorBatches[i + numberOfShadowModes] = new StaticGeometryColorBatch_default(
+ primitives,
+ PolylineColorAppearance_default,
+ PolylineColorAppearance_default,
+ false,
+ i
+ );
+ this._materialBatches[i + numberOfShadowModes] = new StaticGeometryPerMaterialBatch_default(
+ primitives,
+ PolylineMaterialAppearance_default,
+ PolylineColorAppearance_default,
+ false,
+ i
+ );
+ this._colorBatches[i + numberOfShadowModes * 2] = new StaticGeometryColorBatch_default(
+ primitives,
+ PolylineColorAppearance_default,
+ PolylineMaterialAppearance_default,
+ false,
+ i
+ );
+ this._materialBatches[i + numberOfShadowModes * 2] = new StaticGeometryPerMaterialBatch_default(
+ primitives,
+ PolylineMaterialAppearance_default,
+ PolylineMaterialAppearance_default,
+ false,
+ i
+ );
+ }
+ this._dynamicBatch = new DynamicGeometryBatch_default(primitives, groundPrimitives);
+ const numberOfClassificationTypes = ClassificationType_default.NUMBER_OF_CLASSIFICATION_TYPES;
+ this._groundBatches = new Array(numberOfClassificationTypes);
+ for (i = 0; i < numberOfClassificationTypes; ++i) {
+ this._groundBatches[i] = new StaticGroundPolylinePerMaterialBatch_default(
+ groundPrimitives,
+ i
+ );
+ }
+ this._batches = this._colorBatches.concat(
+ this._materialBatches,
+ this._dynamicBatch,
+ this._groundBatches
+ );
+ this._subscriptions = new AssociativeArray_default();
+ this._updaters = new AssociativeArray_default();
+ this._entityCollection = entityCollection;
+ entityCollection.collectionChanged.addEventListener(
+ PolylineVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ this._onCollectionChanged(
+ entityCollection,
+ entityCollection.values,
+ emptyArray2
+ );
+}
+PolylineVisualizer.prototype.update = function(time) {
+ Check_default.defined("time", time);
+ const addedObjects = this._addedObjects;
+ const added = addedObjects.values;
+ const removedObjects = this._removedObjects;
+ const removed = removedObjects.values;
+ const changedObjects = this._changedObjects;
+ const changed = changedObjects.values;
+ let i;
+ let entity;
+ let id;
+ let updater;
+ for (i = changed.length - 1; i > -1; i--) {
+ entity = changed[i];
+ id = entity.id;
+ updater = this._updaters.get(id);
+ if (updater.entity === entity) {
+ removeUpdater(this, updater);
+ insertUpdaterIntoBatch(this, time, updater);
+ } else {
+ removed.push(entity);
+ added.push(entity);
+ }
+ }
+ for (i = removed.length - 1; i > -1; i--) {
+ entity = removed[i];
+ id = entity.id;
+ updater = this._updaters.get(id);
+ removeUpdater(this, updater);
+ updater.destroy();
+ this._updaters.remove(id);
+ this._subscriptions.get(id)();
+ this._subscriptions.remove(id);
+ }
+ for (i = added.length - 1; i > -1; i--) {
+ entity = added[i];
+ id = entity.id;
+ updater = new PolylineGeometryUpdater_default(entity, this._scene);
+ this._updaters.set(id, updater);
+ insertUpdaterIntoBatch(this, time, updater);
+ this._subscriptions.set(
+ id,
+ updater.geometryChanged.addEventListener(
+ PolylineVisualizer._onGeometryChanged,
+ this
+ )
+ );
+ }
+ addedObjects.removeAll();
+ removedObjects.removeAll();
+ changedObjects.removeAll();
+ let isUpdated = true;
+ const batches = this._batches;
+ const length3 = batches.length;
+ for (i = 0; i < length3; i++) {
+ isUpdated = batches[i].update(time) && isUpdated;
+ }
+ return isUpdated;
+};
+var getBoundingSphereArrayScratch2 = [];
+var getBoundingSphereBoundingSphereScratch2 = new BoundingSphere_default();
+PolylineVisualizer.prototype.getBoundingSphere = function(entity, result) {
+ Check_default.defined("entity", entity);
+ Check_default.defined("result", result);
+ const boundingSpheres = getBoundingSphereArrayScratch2;
+ const tmp2 = getBoundingSphereBoundingSphereScratch2;
+ let count = 0;
+ let state = BoundingSphereState_default.DONE;
+ const batches = this._batches;
+ const batchesLength = batches.length;
+ const updater = this._updaters.get(entity.id);
+ for (let i = 0; i < batchesLength; i++) {
+ state = batches[i].getBoundingSphere(updater, tmp2);
+ if (state === BoundingSphereState_default.PENDING) {
+ return BoundingSphereState_default.PENDING;
+ } else if (state === BoundingSphereState_default.DONE) {
+ boundingSpheres[count] = BoundingSphere_default.clone(
+ tmp2,
+ boundingSpheres[count]
+ );
+ count++;
+ }
+ }
+ if (count === 0) {
+ return BoundingSphereState_default.FAILED;
+ }
+ boundingSpheres.length = count;
+ BoundingSphere_default.fromBoundingSpheres(boundingSpheres, result);
+ return BoundingSphereState_default.DONE;
+};
+PolylineVisualizer.prototype.isDestroyed = function() {
+ return false;
+};
+PolylineVisualizer.prototype.destroy = function() {
+ this._entityCollection.collectionChanged.removeEventListener(
+ PolylineVisualizer.prototype._onCollectionChanged,
+ this
+ );
+ this._addedObjects.removeAll();
+ this._removedObjects.removeAll();
+ let i;
+ const batches = this._batches;
+ let length3 = batches.length;
+ for (i = 0; i < length3; i++) {
+ batches[i].removeAllPrimitives();
+ }
+ const subscriptions = this._subscriptions.values;
+ length3 = subscriptions.length;
+ for (i = 0; i < length3; i++) {
+ subscriptions[i]();
+ }
+ this._subscriptions.removeAll();
+ return destroyObject_default(this);
+};
+PolylineVisualizer._onGeometryChanged = function(updater) {
+ const removedObjects = this._removedObjects;
+ const changedObjects = this._changedObjects;
+ const entity = updater.entity;
+ const id = entity.id;
+ if (!defined_default(removedObjects.get(id)) && !defined_default(changedObjects.get(id))) {
+ changedObjects.set(id, entity);
+ }
+};
+PolylineVisualizer.prototype._onCollectionChanged = function(entityCollection, added, removed) {
+ const addedObjects = this._addedObjects;
+ const removedObjects = this._removedObjects;
+ const changedObjects = this._changedObjects;
+ let i;
+ let id;
+ let entity;
+ for (i = removed.length - 1; i > -1; i--) {
+ entity = removed[i];
+ id = entity.id;
+ if (!addedObjects.remove(id)) {
+ removedObjects.set(id, entity);
+ changedObjects.remove(id);
+ }
+ }
+ for (i = added.length - 1; i > -1; i--) {
+ entity = added[i];
+ id = entity.id;
+ if (removedObjects.remove(id)) {
+ changedObjects.set(id, entity);
+ } else {
+ addedObjects.set(id, entity);
+ }
+ }
+};
+var PolylineVisualizer_default = PolylineVisualizer;
+
+// Source/DataSources/DataSourceDisplay.js
+function DataSourceDisplay(options) {
+ Check_default.typeOf.object("options", options);
+ Check_default.typeOf.object("options.scene", options.scene);
+ Check_default.typeOf.object(
+ "options.dataSourceCollection",
+ options.dataSourceCollection
+ );
+ GroundPrimitive_default.initializeTerrainHeights();
+ GroundPolylinePrimitive_default.initializeTerrainHeights();
+ const scene = options.scene;
+ const dataSourceCollection = options.dataSourceCollection;
+ this._eventHelper = new EventHelper_default();
+ this._eventHelper.add(
+ dataSourceCollection.dataSourceAdded,
+ this._onDataSourceAdded,
+ this
+ );
+ this._eventHelper.add(
+ dataSourceCollection.dataSourceRemoved,
+ this._onDataSourceRemoved,
+ this
+ );
+ this._eventHelper.add(
+ dataSourceCollection.dataSourceMoved,
+ this._onDataSourceMoved,
+ this
+ );
+ this._eventHelper.add(scene.postRender, this._postRender, this);
+ this._dataSourceCollection = dataSourceCollection;
+ this._scene = scene;
+ this._visualizersCallback = defaultValue_default(
+ options.visualizersCallback,
+ DataSourceDisplay.defaultVisualizersCallback
+ );
+ let primitivesAdded = false;
+ const primitives = new PrimitiveCollection_default();
+ const groundPrimitives = new PrimitiveCollection_default();
+ if (dataSourceCollection.length > 0) {
+ scene.primitives.add(primitives);
+ scene.groundPrimitives.add(groundPrimitives);
+ primitivesAdded = true;
+ }
+ this._primitives = primitives;
+ this._groundPrimitives = groundPrimitives;
+ for (let i = 0, len = dataSourceCollection.length; i < len; i++) {
+ this._onDataSourceAdded(dataSourceCollection, dataSourceCollection.get(i));
+ }
+ const defaultDataSource = new CustomDataSource_default();
+ this._onDataSourceAdded(void 0, defaultDataSource);
+ this._defaultDataSource = defaultDataSource;
+ let removeDefaultDataSourceListener;
+ let removeDataSourceCollectionListener;
+ if (!primitivesAdded) {
+ const that = this;
+ const addPrimitives = function() {
+ scene.primitives.add(primitives);
+ scene.groundPrimitives.add(groundPrimitives);
+ removeDefaultDataSourceListener();
+ removeDataSourceCollectionListener();
+ that._removeDefaultDataSourceListener = void 0;
+ that._removeDataSourceCollectionListener = void 0;
+ };
+ removeDefaultDataSourceListener = defaultDataSource.entities.collectionChanged.addEventListener(
+ addPrimitives
+ );
+ removeDataSourceCollectionListener = dataSourceCollection.dataSourceAdded.addEventListener(
+ addPrimitives
+ );
+ }
+ this._removeDefaultDataSourceListener = removeDefaultDataSourceListener;
+ this._removeDataSourceCollectionListener = removeDataSourceCollectionListener;
+ this._ready = false;
+}
+DataSourceDisplay.defaultVisualizersCallback = function(scene, entityCluster, dataSource) {
+ const entities = dataSource.entities;
+ return [
+ new BillboardVisualizer_default(entityCluster, entities),
+ new GeometryVisualizer_default(
+ scene,
+ entities,
+ dataSource._primitives,
+ dataSource._groundPrimitives
+ ),
+ new LabelVisualizer_default(entityCluster, entities),
+ new ModelVisualizer_default(scene, entities),
+ new Cesium3DTilesetVisualizer_default(scene, entities),
+ new PointVisualizer_default(entityCluster, entities),
+ new PathVisualizer_default(scene, entities),
+ new PolylineVisualizer_default(
+ scene,
+ entities,
+ dataSource._primitives,
+ dataSource._groundPrimitives
+ )
+ ];
+};
+Object.defineProperties(DataSourceDisplay.prototype, {
+ scene: {
+ get: function() {
+ return this._scene;
+ }
+ },
+ dataSources: {
+ get: function() {
+ return this._dataSourceCollection;
+ }
+ },
+ defaultDataSource: {
+ get: function() {
+ return this._defaultDataSource;
+ }
+ },
+ ready: {
+ get: function() {
+ return this._ready;
+ }
+ }
+});
+DataSourceDisplay.prototype.isDestroyed = function() {
+ return false;
+};
+DataSourceDisplay.prototype.destroy = function() {
+ this._eventHelper.removeAll();
+ const dataSourceCollection = this._dataSourceCollection;
+ for (let i = 0, length3 = dataSourceCollection.length; i < length3; ++i) {
+ this._onDataSourceRemoved(
+ this._dataSourceCollection,
+ dataSourceCollection.get(i)
+ );
+ }
+ this._onDataSourceRemoved(void 0, this._defaultDataSource);
+ if (defined_default(this._removeDefaultDataSourceListener)) {
+ this._removeDefaultDataSourceListener();
+ this._removeDataSourceCollectionListener();
+ } else {
+ this._scene.primitives.remove(this._primitives);
+ this._scene.groundPrimitives.remove(this._groundPrimitives);
+ }
+ return destroyObject_default(this);
+};
+DataSourceDisplay.prototype.update = function(time) {
+ Check_default.defined("time", time);
+ if (!ApproximateTerrainHeights_default.initialized) {
+ this._ready = false;
+ return false;
+ }
+ let result = true;
+ let i;
+ let x;
+ let visualizers;
+ let vLength;
+ const dataSources = this._dataSourceCollection;
+ const length3 = dataSources.length;
+ for (i = 0; i < length3; i++) {
+ const dataSource = dataSources.get(i);
+ if (defined_default(dataSource.update)) {
+ result = dataSource.update(time) && result;
+ }
+ visualizers = dataSource._visualizers;
+ vLength = visualizers.length;
+ for (x = 0; x < vLength; x++) {
+ result = visualizers[x].update(time) && result;
+ }
+ }
+ visualizers = this._defaultDataSource._visualizers;
+ vLength = visualizers.length;
+ for (x = 0; x < vLength; x++) {
+ result = visualizers[x].update(time) && result;
+ }
+ this._ready = result;
+ return result;
+};
+DataSourceDisplay.prototype._postRender = function() {
+ const frameState = this._scene.frameState;
+ const dataSources = this._dataSourceCollection;
+ const length3 = dataSources.length;
+ for (let i = 0; i < length3; i++) {
+ const dataSource = dataSources.get(i);
+ const credit = dataSource.credit;
+ if (defined_default(credit)) {
+ frameState.creditDisplay.addCredit(credit);
+ }
+ const credits = dataSource._resourceCredits;
+ if (defined_default(credits)) {
+ const creditCount = credits.length;
+ for (let c = 0; c < creditCount; c++) {
+ frameState.creditDisplay.addCredit(credits[c]);
+ }
+ }
+ }
+};
+var getBoundingSphereArrayScratch3 = [];
+var getBoundingSphereBoundingSphereScratch3 = new BoundingSphere_default();
+DataSourceDisplay.prototype.getBoundingSphere = function(entity, allowPartial, result) {
+ Check_default.defined("entity", entity);
+ Check_default.typeOf.bool("allowPartial", allowPartial);
+ Check_default.defined("result", result);
+ if (!this._ready) {
+ return BoundingSphereState_default.PENDING;
+ }
+ let i;
+ let length3;
+ let dataSource = this._defaultDataSource;
+ if (!dataSource.entities.contains(entity)) {
+ dataSource = void 0;
+ const dataSources = this._dataSourceCollection;
+ length3 = dataSources.length;
+ for (i = 0; i < length3; i++) {
+ const d = dataSources.get(i);
+ if (d.entities.contains(entity)) {
+ dataSource = d;
+ break;
+ }
+ }
+ }
+ if (!defined_default(dataSource)) {
+ return BoundingSphereState_default.FAILED;
+ }
+ const boundingSpheres = getBoundingSphereArrayScratch3;
+ const tmp2 = getBoundingSphereBoundingSphereScratch3;
+ let count = 0;
+ let state = BoundingSphereState_default.DONE;
+ const visualizers = dataSource._visualizers;
+ const visualizersLength = visualizers.length;
+ for (i = 0; i < visualizersLength; i++) {
+ const visualizer = visualizers[i];
+ if (defined_default(visualizer.getBoundingSphere)) {
+ state = visualizers[i].getBoundingSphere(entity, tmp2);
+ if (!allowPartial && state === BoundingSphereState_default.PENDING) {
+ return BoundingSphereState_default.PENDING;
+ } else if (state === BoundingSphereState_default.DONE) {
+ boundingSpheres[count] = BoundingSphere_default.clone(
+ tmp2,
+ boundingSpheres[count]
+ );
+ count++;
+ }
+ }
+ }
+ if (count === 0) {
+ return BoundingSphereState_default.FAILED;
+ }
+ boundingSpheres.length = count;
+ BoundingSphere_default.fromBoundingSpheres(boundingSpheres, result);
+ return BoundingSphereState_default.DONE;
+};
+DataSourceDisplay.prototype._onDataSourceAdded = function(dataSourceCollection, dataSource) {
+ const scene = this._scene;
+ const displayPrimitives = this._primitives;
+ const displayGroundPrimitives = this._groundPrimitives;
+ const primitives = displayPrimitives.add(new PrimitiveCollection_default());
+ const groundPrimitives = displayGroundPrimitives.add(
+ new OrderedGroundPrimitiveCollection_default()
+ );
+ dataSource._primitives = primitives;
+ dataSource._groundPrimitives = groundPrimitives;
+ const entityCluster = dataSource.clustering;
+ entityCluster._initialize(scene);
+ primitives.add(entityCluster);
+ dataSource._visualizers = this._visualizersCallback(
+ scene,
+ entityCluster,
+ dataSource
+ );
+};
+DataSourceDisplay.prototype._onDataSourceRemoved = function(dataSourceCollection, dataSource) {
+ const displayPrimitives = this._primitives;
+ const displayGroundPrimitives = this._groundPrimitives;
+ const primitives = dataSource._primitives;
+ const groundPrimitives = dataSource._groundPrimitives;
+ const entityCluster = dataSource.clustering;
+ primitives.remove(entityCluster);
+ const visualizers = dataSource._visualizers;
+ const length3 = visualizers.length;
+ for (let i = 0; i < length3; i++) {
+ visualizers[i].destroy();
+ }
+ displayPrimitives.remove(primitives);
+ displayGroundPrimitives.remove(groundPrimitives);
+ dataSource._visualizers = void 0;
+};
+DataSourceDisplay.prototype._onDataSourceMoved = function(dataSource, newIndex, oldIndex) {
+ const displayPrimitives = this._primitives;
+ const displayGroundPrimitives = this._groundPrimitives;
+ const primitives = dataSource._primitives;
+ const groundPrimitives = dataSource._groundPrimitives;
+ if (newIndex === oldIndex + 1) {
+ displayPrimitives.raise(primitives);
+ displayGroundPrimitives.raise(groundPrimitives);
+ } else if (newIndex === oldIndex - 1) {
+ displayPrimitives.lower(primitives);
+ displayGroundPrimitives.lower(groundPrimitives);
+ } else if (newIndex === 0) {
+ displayPrimitives.lowerToBottom(primitives);
+ displayGroundPrimitives.lowerToBottom(groundPrimitives);
+ displayPrimitives.raise(primitives);
+ displayGroundPrimitives.raise(groundPrimitives);
+ } else {
+ displayPrimitives.raiseToTop(primitives);
+ displayGroundPrimitives.raiseToTop(groundPrimitives);
+ }
+};
+var DataSourceDisplay_default = DataSourceDisplay;
+
+// Source/Core/HeadingPitchRange.js
+function HeadingPitchRange(heading, pitch, range2) {
+ this.heading = defaultValue_default(heading, 0);
+ this.pitch = defaultValue_default(pitch, 0);
+ this.range = defaultValue_default(range2, 0);
+}
+HeadingPitchRange.clone = function(hpr, result) {
+ if (!defined_default(hpr)) {
+ return void 0;
+ }
+ if (!defined_default(result)) {
+ result = new HeadingPitchRange();
+ }
+ result.heading = hpr.heading;
+ result.pitch = hpr.pitch;
+ result.range = hpr.range;
+ return result;
+};
+var HeadingPitchRange_default = HeadingPitchRange;
+
+// Source/DataSources/EntityView.js
+var updateTransformMatrix3Scratch1 = new Matrix3_default();
+var updateTransformMatrix3Scratch2 = new Matrix3_default();
+var updateTransformMatrix3Scratch3 = new Matrix3_default();
+var updateTransformMatrix4Scratch = new Matrix4_default();
+var updateTransformCartesian3Scratch1 = new Cartesian3_default();
+var updateTransformCartesian3Scratch2 = new Cartesian3_default();
+var updateTransformCartesian3Scratch3 = new Cartesian3_default();
+var updateTransformCartesian3Scratch4 = new Cartesian3_default();
+var updateTransformCartesian3Scratch5 = new Cartesian3_default();
+var updateTransformCartesian3Scratch6 = new Cartesian3_default();
+var deltaTime = new JulianDate_default();
+var northUpAxisFactor = 1.25;
+function updateTransform(that, camera, updateLookAt, saveCamera, positionProperty, time, ellipsoid) {
+ const mode2 = that.scene.mode;
+ let cartesian11 = positionProperty.getValue(time, that._lastCartesian);
+ if (defined_default(cartesian11)) {
+ let hasBasis = false;
+ let invertVelocity = false;
+ let xBasis;
+ let yBasis;
+ let zBasis;
+ if (mode2 === SceneMode_default.SCENE3D) {
+ JulianDate_default.addSeconds(time, 1e-3, deltaTime);
+ let deltaCartesian = positionProperty.getValue(
+ deltaTime,
+ updateTransformCartesian3Scratch1
+ );
+ if (!defined_default(deltaCartesian)) {
+ JulianDate_default.addSeconds(time, -1e-3, deltaTime);
+ deltaCartesian = positionProperty.getValue(
+ deltaTime,
+ updateTransformCartesian3Scratch1
+ );
+ invertVelocity = true;
+ }
+ if (defined_default(deltaCartesian)) {
+ let toInertial = Transforms_default.computeFixedToIcrfMatrix(
+ time,
+ updateTransformMatrix3Scratch1
+ );
+ let toInertialDelta = Transforms_default.computeFixedToIcrfMatrix(
+ deltaTime,
+ updateTransformMatrix3Scratch2
+ );
+ let toFixed;
+ if (!defined_default(toInertial) || !defined_default(toInertialDelta)) {
+ toFixed = Transforms_default.computeTemeToPseudoFixedMatrix(
+ time,
+ updateTransformMatrix3Scratch3
+ );
+ toInertial = Matrix3_default.transpose(
+ toFixed,
+ updateTransformMatrix3Scratch1
+ );
+ toInertialDelta = Transforms_default.computeTemeToPseudoFixedMatrix(
+ deltaTime,
+ updateTransformMatrix3Scratch2
+ );
+ Matrix3_default.transpose(toInertialDelta, toInertialDelta);
+ } else {
+ toFixed = Matrix3_default.transpose(
+ toInertial,
+ updateTransformMatrix3Scratch3
+ );
+ }
+ const inertialCartesian = Matrix3_default.multiplyByVector(
+ toInertial,
+ cartesian11,
+ updateTransformCartesian3Scratch5
+ );
+ const inertialDeltaCartesian = Matrix3_default.multiplyByVector(
+ toInertialDelta,
+ deltaCartesian,
+ updateTransformCartesian3Scratch6
+ );
+ Cartesian3_default.subtract(
+ inertialCartesian,
+ inertialDeltaCartesian,
+ updateTransformCartesian3Scratch4
+ );
+ const inertialVelocity = Cartesian3_default.magnitude(updateTransformCartesian3Scratch4) * 1e3;
+ const mu = Math_default.GRAVITATIONALPARAMETER;
+ const semiMajorAxis = -mu / (inertialVelocity * inertialVelocity - 2 * mu / Cartesian3_default.magnitude(inertialCartesian));
+ if (semiMajorAxis < 0 || semiMajorAxis > northUpAxisFactor * ellipsoid.maximumRadius) {
+ xBasis = updateTransformCartesian3Scratch2;
+ Cartesian3_default.normalize(cartesian11, xBasis);
+ Cartesian3_default.negate(xBasis, xBasis);
+ zBasis = Cartesian3_default.clone(
+ Cartesian3_default.UNIT_Z,
+ updateTransformCartesian3Scratch3
+ );
+ yBasis = Cartesian3_default.cross(
+ zBasis,
+ xBasis,
+ updateTransformCartesian3Scratch1
+ );
+ if (Cartesian3_default.magnitude(yBasis) > Math_default.EPSILON7) {
+ Cartesian3_default.normalize(xBasis, xBasis);
+ Cartesian3_default.normalize(yBasis, yBasis);
+ zBasis = Cartesian3_default.cross(
+ xBasis,
+ yBasis,
+ updateTransformCartesian3Scratch3
+ );
+ Cartesian3_default.normalize(zBasis, zBasis);
+ hasBasis = true;
+ }
+ } else if (!Cartesian3_default.equalsEpsilon(
+ cartesian11,
+ deltaCartesian,
+ Math_default.EPSILON7
+ )) {
+ zBasis = updateTransformCartesian3Scratch2;
+ Cartesian3_default.normalize(inertialCartesian, zBasis);
+ Cartesian3_default.normalize(inertialDeltaCartesian, inertialDeltaCartesian);
+ yBasis = Cartesian3_default.cross(
+ zBasis,
+ inertialDeltaCartesian,
+ updateTransformCartesian3Scratch3
+ );
+ if (invertVelocity) {
+ yBasis = Cartesian3_default.multiplyByScalar(yBasis, -1, yBasis);
+ }
+ if (!Cartesian3_default.equalsEpsilon(
+ yBasis,
+ Cartesian3_default.ZERO,
+ Math_default.EPSILON7
+ )) {
+ xBasis = Cartesian3_default.cross(
+ yBasis,
+ zBasis,
+ updateTransformCartesian3Scratch1
+ );
+ Matrix3_default.multiplyByVector(toFixed, xBasis, xBasis);
+ Matrix3_default.multiplyByVector(toFixed, yBasis, yBasis);
+ Matrix3_default.multiplyByVector(toFixed, zBasis, zBasis);
+ Cartesian3_default.normalize(xBasis, xBasis);
+ Cartesian3_default.normalize(yBasis, yBasis);
+ Cartesian3_default.normalize(zBasis, zBasis);
+ hasBasis = true;
+ }
+ }
+ }
+ }
+ if (defined_default(that.boundingSphere)) {
+ cartesian11 = that.boundingSphere.center;
+ }
+ let position;
+ let direction2;
+ let up;
+ if (saveCamera) {
+ position = Cartesian3_default.clone(
+ camera.position,
+ updateTransformCartesian3Scratch4
+ );
+ direction2 = Cartesian3_default.clone(
+ camera.direction,
+ updateTransformCartesian3Scratch5
+ );
+ up = Cartesian3_default.clone(camera.up, updateTransformCartesian3Scratch6);
+ }
+ const transform3 = updateTransformMatrix4Scratch;
+ if (hasBasis) {
+ transform3[0] = xBasis.x;
+ transform3[1] = xBasis.y;
+ transform3[2] = xBasis.z;
+ transform3[3] = 0;
+ transform3[4] = yBasis.x;
+ transform3[5] = yBasis.y;
+ transform3[6] = yBasis.z;
+ transform3[7] = 0;
+ transform3[8] = zBasis.x;
+ transform3[9] = zBasis.y;
+ transform3[10] = zBasis.z;
+ transform3[11] = 0;
+ transform3[12] = cartesian11.x;
+ transform3[13] = cartesian11.y;
+ transform3[14] = cartesian11.z;
+ transform3[15] = 0;
+ } else {
+ Transforms_default.eastNorthUpToFixedFrame(cartesian11, ellipsoid, transform3);
+ }
+ camera._setTransform(transform3);
+ if (saveCamera) {
+ Cartesian3_default.clone(position, camera.position);
+ Cartesian3_default.clone(direction2, camera.direction);
+ Cartesian3_default.clone(up, camera.up);
+ Cartesian3_default.cross(direction2, up, camera.right);
+ }
+ }
+ if (updateLookAt) {
+ const offset2 = mode2 === SceneMode_default.SCENE2D || Cartesian3_default.equals(that._offset3D, Cartesian3_default.ZERO) ? void 0 : that._offset3D;
+ camera.lookAtTransform(camera.transform, offset2);
+ }
+}
+function EntityView(entity, scene, ellipsoid) {
+ Check_default.defined("entity", entity);
+ Check_default.defined("scene", scene);
+ this.entity = entity;
+ this.scene = scene;
+ this.ellipsoid = defaultValue_default(ellipsoid, Ellipsoid_default.WGS84);
+ this.boundingSphere = void 0;
+ this._lastEntity = void 0;
+ this._mode = void 0;
+ this._lastCartesian = new Cartesian3_default();
+ this._defaultOffset3D = void 0;
+ this._offset3D = new Cartesian3_default();
+}
+Object.defineProperties(EntityView, {
+ defaultOffset3D: {
+ get: function() {
+ return this._defaultOffset3D;
+ },
+ set: function(vector) {
+ this._defaultOffset3D = Cartesian3_default.clone(vector, new Cartesian3_default());
+ }
+ }
+});
+EntityView.defaultOffset3D = new Cartesian3_default(-14e3, 3500, 3500);
+var scratchHeadingPitchRange = new HeadingPitchRange_default();
+var scratchCartesian19 = new Cartesian3_default();
+EntityView.prototype.update = function(time, boundingSphere) {
+ Check_default.defined("time", time);
+ const scene = this.scene;
+ const ellipsoid = this.ellipsoid;
+ const sceneMode = scene.mode;
+ if (sceneMode === SceneMode_default.MORPHING) {
+ return;
+ }
+ const entity = this.entity;
+ const positionProperty = entity.position;
+ if (!defined_default(positionProperty)) {
+ return;
+ }
+ const objectChanged = entity !== this._lastEntity;
+ const sceneModeChanged = sceneMode !== this._mode;
+ const camera = scene.camera;
+ let updateLookAt = objectChanged || sceneModeChanged;
+ let saveCamera = true;
+ if (objectChanged) {
+ const viewFromProperty = entity.viewFrom;
+ const hasViewFrom = defined_default(viewFromProperty);
+ if (!hasViewFrom && defined_default(boundingSphere)) {
+ scratchHeadingPitchRange.pitch = -Math_default.PI_OVER_FOUR;
+ scratchHeadingPitchRange.range = 0;
+ const position = positionProperty.getValue(time, scratchCartesian19);
+ if (defined_default(position)) {
+ const factor2 = 2 - 1 / Math.max(
+ 1,
+ Cartesian3_default.magnitude(position) / ellipsoid.maximumRadius
+ );
+ scratchHeadingPitchRange.pitch *= factor2;
+ }
+ camera.viewBoundingSphere(boundingSphere, scratchHeadingPitchRange);
+ this.boundingSphere = boundingSphere;
+ updateLookAt = false;
+ saveCamera = false;
+ } else if (!hasViewFrom || !defined_default(viewFromProperty.getValue(time, this._offset3D))) {
+ Cartesian3_default.clone(EntityView._defaultOffset3D, this._offset3D);
+ }
+ } else if (!sceneModeChanged && this._mode !== SceneMode_default.SCENE2D) {
+ Cartesian3_default.clone(camera.position, this._offset3D);
+ }
+ this._lastEntity = entity;
+ this._mode = sceneMode;
+ updateTransform(
+ this,
+ camera,
+ updateLookAt,
+ saveCamera,
+ positionProperty,
+ time,
+ ellipsoid
+ );
+};
+var EntityView_default = EntityView;
+
+// node_modules/@zip.js/zip.js/lib/core/codecs/deflate.js
+var MAX_BITS = 15;
+var D_CODES = 30;
+var BL_CODES = 19;
+var LENGTH_CODES = 29;
+var LITERALS = 256;
+var L_CODES = LITERALS + 1 + LENGTH_CODES;
+var HEAP_SIZE = 2 * L_CODES + 1;
+var END_BLOCK = 256;
+var MAX_BL_BITS = 7;
+var REP_3_6 = 16;
+var REPZ_3_10 = 17;
+var REPZ_11_138 = 18;
+var Buf_size = 8 * 2;
+var Z_DEFAULT_COMPRESSION = -1;
+var Z_FILTERED = 1;
+var Z_HUFFMAN_ONLY = 2;
+var Z_DEFAULT_STRATEGY = 0;
+var Z_NO_FLUSH = 0;
+var Z_PARTIAL_FLUSH = 1;
+var Z_FULL_FLUSH = 3;
+var Z_FINISH = 4;
+var Z_OK = 0;
+var Z_STREAM_END = 1;
+var Z_NEED_DICT = 2;
+var Z_STREAM_ERROR = -2;
+var Z_DATA_ERROR = -3;
+var Z_BUF_ERROR = -5;
+function extractArray(array) {
+ return flatArray(array.map(([length3, value]) => new Array(length3).fill(value, 0, length3)));
+}
+function flatArray(array) {
+ return array.reduce((a3, b) => a3.concat(Array.isArray(b) ? flatArray(b) : b), []);
+}
+var _dist_code = [0, 1, 2, 3].concat(...extractArray([
+ [2, 4],
+ [2, 5],
+ [4, 6],
+ [4, 7],
+ [8, 8],
+ [8, 9],
+ [16, 10],
+ [16, 11],
+ [32, 12],
+ [32, 13],
+ [64, 14],
+ [64, 15],
+ [2, 0],
+ [1, 16],
+ [1, 17],
+ [2, 18],
+ [2, 19],
+ [4, 20],
+ [4, 21],
+ [8, 22],
+ [8, 23],
+ [16, 24],
+ [16, 25],
+ [32, 26],
+ [32, 27],
+ [64, 28],
+ [64, 29]
+]));
+function Tree() {
+ const that = this;
+ function gen_bitlen(s) {
+ const tree = that.dyn_tree;
+ const stree = that.stat_desc.static_tree;
+ const extra = that.stat_desc.extra_bits;
+ const base = that.stat_desc.extra_base;
+ const max_length = that.stat_desc.max_length;
+ let h;
+ let n, m;
+ let bits;
+ let xbits;
+ let f;
+ let overflow = 0;
+ for (bits = 0; bits <= MAX_BITS; bits++)
+ s.bl_count[bits] = 0;
+ tree[s.heap[s.heap_max] * 2 + 1] = 0;
+ for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
+ n = s.heap[h];
+ bits = tree[tree[n * 2 + 1] * 2 + 1] + 1;
+ if (bits > max_length) {
+ bits = max_length;
+ overflow++;
+ }
+ tree[n * 2 + 1] = bits;
+ if (n > that.max_code)
+ continue;
+ s.bl_count[bits]++;
+ xbits = 0;
+ if (n >= base)
+ xbits = extra[n - base];
+ f = tree[n * 2];
+ s.opt_len += f * (bits + xbits);
+ if (stree)
+ s.static_len += f * (stree[n * 2 + 1] + xbits);
+ }
+ if (overflow === 0)
+ return;
+ do {
+ bits = max_length - 1;
+ while (s.bl_count[bits] === 0)
+ bits--;
+ s.bl_count[bits]--;
+ s.bl_count[bits + 1] += 2;
+ s.bl_count[max_length]--;
+ overflow -= 2;
+ } while (overflow > 0);
+ for (bits = max_length; bits !== 0; bits--) {
+ n = s.bl_count[bits];
+ while (n !== 0) {
+ m = s.heap[--h];
+ if (m > that.max_code)
+ continue;
+ if (tree[m * 2 + 1] != bits) {
+ s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2];
+ tree[m * 2 + 1] = bits;
+ }
+ n--;
+ }
+ }
+ }
+ function bi_reverse(code, len) {
+ let res = 0;
+ do {
+ res |= code & 1;
+ code >>>= 1;
+ res <<= 1;
+ } while (--len > 0);
+ return res >>> 1;
+ }
+ function gen_codes(tree, max_code, bl_count) {
+ const next_code = [];
+ let code = 0;
+ let bits;
+ let n;
+ let len;
+ for (bits = 1; bits <= MAX_BITS; bits++) {
+ next_code[bits] = code = code + bl_count[bits - 1] << 1;
+ }
+ for (n = 0; n <= max_code; n++) {
+ len = tree[n * 2 + 1];
+ if (len === 0)
+ continue;
+ tree[n * 2] = bi_reverse(next_code[len]++, len);
+ }
+ }
+ that.build_tree = function(s) {
+ const tree = that.dyn_tree;
+ const stree = that.stat_desc.static_tree;
+ const elems = that.stat_desc.elems;
+ let n, m;
+ let max_code = -1;
+ let node;
+ s.heap_len = 0;
+ s.heap_max = HEAP_SIZE;
+ for (n = 0; n < elems; n++) {
+ if (tree[n * 2] !== 0) {
+ s.heap[++s.heap_len] = max_code = n;
+ s.depth[n] = 0;
+ } else {
+ tree[n * 2 + 1] = 0;
+ }
+ }
+ while (s.heap_len < 2) {
+ node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0;
+ tree[node * 2] = 1;
+ s.depth[node] = 0;
+ s.opt_len--;
+ if (stree)
+ s.static_len -= stree[node * 2 + 1];
+ }
+ that.max_code = max_code;
+ for (n = Math.floor(s.heap_len / 2); n >= 1; n--)
+ s.pqdownheap(tree, n);
+ node = elems;
+ do {
+ n = s.heap[1];
+ s.heap[1] = s.heap[s.heap_len--];
+ s.pqdownheap(tree, 1);
+ m = s.heap[1];
+ s.heap[--s.heap_max] = n;
+ s.heap[--s.heap_max] = m;
+ tree[node * 2] = tree[n * 2] + tree[m * 2];
+ s.depth[node] = Math.max(s.depth[n], s.depth[m]) + 1;
+ tree[n * 2 + 1] = tree[m * 2 + 1] = node;
+ s.heap[1] = node++;
+ s.pqdownheap(tree, 1);
+ } while (s.heap_len >= 2);
+ s.heap[--s.heap_max] = s.heap[1];
+ gen_bitlen(s);
+ gen_codes(tree, that.max_code, s.bl_count);
+ };
+}
+Tree._length_code = [0, 1, 2, 3, 4, 5, 6, 7].concat(...extractArray([
+ [2, 8],
+ [2, 9],
+ [2, 10],
+ [2, 11],
+ [4, 12],
+ [4, 13],
+ [4, 14],
+ [4, 15],
+ [8, 16],
+ [8, 17],
+ [8, 18],
+ [8, 19],
+ [16, 20],
+ [16, 21],
+ [16, 22],
+ [16, 23],
+ [32, 24],
+ [32, 25],
+ [32, 26],
+ [31, 27],
+ [1, 28]
+]));
+Tree.base_length = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0];
+Tree.base_dist = [
+ 0,
+ 1,
+ 2,
+ 3,
+ 4,
+ 6,
+ 8,
+ 12,
+ 16,
+ 24,
+ 32,
+ 48,
+ 64,
+ 96,
+ 128,
+ 192,
+ 256,
+ 384,
+ 512,
+ 768,
+ 1024,
+ 1536,
+ 2048,
+ 3072,
+ 4096,
+ 6144,
+ 8192,
+ 12288,
+ 16384,
+ 24576
+];
+Tree.d_code = function(dist) {
+ return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
+};
+Tree.extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0];
+Tree.extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13];
+Tree.extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7];
+Tree.bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
+function StaticTree(static_tree, extra_bits, extra_base, elems, max_length) {
+ const that = this;
+ that.static_tree = static_tree;
+ that.extra_bits = extra_bits;
+ that.extra_base = extra_base;
+ that.elems = elems;
+ that.max_length = max_length;
+}
+var static_ltree2_first_part = [
+ 12,
+ 140,
+ 76,
+ 204,
+ 44,
+ 172,
+ 108,
+ 236,
+ 28,
+ 156,
+ 92,
+ 220,
+ 60,
+ 188,
+ 124,
+ 252,
+ 2,
+ 130,
+ 66,
+ 194,
+ 34,
+ 162,
+ 98,
+ 226,
+ 18,
+ 146,
+ 82,
+ 210,
+ 50,
+ 178,
+ 114,
+ 242,
+ 10,
+ 138,
+ 74,
+ 202,
+ 42,
+ 170,
+ 106,
+ 234,
+ 26,
+ 154,
+ 90,
+ 218,
+ 58,
+ 186,
+ 122,
+ 250,
+ 6,
+ 134,
+ 70,
+ 198,
+ 38,
+ 166,
+ 102,
+ 230,
+ 22,
+ 150,
+ 86,
+ 214,
+ 54,
+ 182,
+ 118,
+ 246,
+ 14,
+ 142,
+ 78,
+ 206,
+ 46,
+ 174,
+ 110,
+ 238,
+ 30,
+ 158,
+ 94,
+ 222,
+ 62,
+ 190,
+ 126,
+ 254,
+ 1,
+ 129,
+ 65,
+ 193,
+ 33,
+ 161,
+ 97,
+ 225,
+ 17,
+ 145,
+ 81,
+ 209,
+ 49,
+ 177,
+ 113,
+ 241,
+ 9,
+ 137,
+ 73,
+ 201,
+ 41,
+ 169,
+ 105,
+ 233,
+ 25,
+ 153,
+ 89,
+ 217,
+ 57,
+ 185,
+ 121,
+ 249,
+ 5,
+ 133,
+ 69,
+ 197,
+ 37,
+ 165,
+ 101,
+ 229,
+ 21,
+ 149,
+ 85,
+ 213,
+ 53,
+ 181,
+ 117,
+ 245,
+ 13,
+ 141,
+ 77,
+ 205,
+ 45,
+ 173,
+ 109,
+ 237,
+ 29,
+ 157,
+ 93,
+ 221,
+ 61,
+ 189,
+ 125,
+ 253,
+ 19,
+ 275,
+ 147,
+ 403,
+ 83,
+ 339,
+ 211,
+ 467,
+ 51,
+ 307,
+ 179,
+ 435,
+ 115,
+ 371,
+ 243,
+ 499,
+ 11,
+ 267,
+ 139,
+ 395,
+ 75,
+ 331,
+ 203,
+ 459,
+ 43,
+ 299,
+ 171,
+ 427,
+ 107,
+ 363,
+ 235,
+ 491,
+ 27,
+ 283,
+ 155,
+ 411,
+ 91,
+ 347,
+ 219,
+ 475,
+ 59,
+ 315,
+ 187,
+ 443,
+ 123,
+ 379,
+ 251,
+ 507,
+ 7,
+ 263,
+ 135,
+ 391,
+ 71,
+ 327,
+ 199,
+ 455,
+ 39,
+ 295,
+ 167,
+ 423,
+ 103,
+ 359,
+ 231,
+ 487,
+ 23,
+ 279,
+ 151,
+ 407,
+ 87,
+ 343,
+ 215,
+ 471,
+ 55,
+ 311,
+ 183,
+ 439,
+ 119,
+ 375,
+ 247,
+ 503,
+ 15,
+ 271,
+ 143,
+ 399,
+ 79,
+ 335,
+ 207,
+ 463,
+ 47,
+ 303,
+ 175,
+ 431,
+ 111,
+ 367,
+ 239,
+ 495,
+ 31,
+ 287,
+ 159,
+ 415,
+ 95,
+ 351,
+ 223,
+ 479,
+ 63,
+ 319,
+ 191,
+ 447,
+ 127,
+ 383,
+ 255,
+ 511,
+ 0,
+ 64,
+ 32,
+ 96,
+ 16,
+ 80,
+ 48,
+ 112,
+ 8,
+ 72,
+ 40,
+ 104,
+ 24,
+ 88,
+ 56,
+ 120,
+ 4,
+ 68,
+ 36,
+ 100,
+ 20,
+ 84,
+ 52,
+ 116,
+ 3,
+ 131,
+ 67,
+ 195,
+ 35,
+ 163,
+ 99,
+ 227
+];
+var static_ltree2_second_part = extractArray([[144, 8], [112, 9], [24, 7], [8, 8]]);
+StaticTree.static_ltree = flatArray(static_ltree2_first_part.map((value, index) => [value, static_ltree2_second_part[index]]));
+var static_dtree_first_part = [0, 16, 8, 24, 4, 20, 12, 28, 2, 18, 10, 26, 6, 22, 14, 30, 1, 17, 9, 25, 5, 21, 13, 29, 3, 19, 11, 27, 7, 23];
+var static_dtree_second_part = extractArray([[30, 5]]);
+StaticTree.static_dtree = flatArray(static_dtree_first_part.map((value, index) => [value, static_dtree_second_part[index]]));
+StaticTree.static_l_desc = new StaticTree(StaticTree.static_ltree, Tree.extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
+StaticTree.static_d_desc = new StaticTree(StaticTree.static_dtree, Tree.extra_dbits, 0, D_CODES, MAX_BITS);
+StaticTree.static_bl_desc = new StaticTree(null, Tree.extra_blbits, 0, BL_CODES, MAX_BL_BITS);
+var MAX_MEM_LEVEL = 9;
+var DEF_MEM_LEVEL = 8;
+function Config(good_length, max_lazy, nice_length, max_chain, func) {
+ const that = this;
+ that.good_length = good_length;
+ that.max_lazy = max_lazy;
+ that.nice_length = nice_length;
+ that.max_chain = max_chain;
+ that.func = func;
+}
+var STORED = 0;
+var FAST = 1;
+var SLOW = 2;
+var config_table = [
+ new Config(0, 0, 0, 0, STORED),
+ new Config(4, 4, 8, 4, FAST),
+ new Config(4, 5, 16, 8, FAST),
+ new Config(4, 6, 32, 32, FAST),
+ new Config(4, 4, 16, 16, SLOW),
+ new Config(8, 16, 32, 32, SLOW),
+ new Config(8, 16, 128, 128, SLOW),
+ new Config(8, 32, 128, 256, SLOW),
+ new Config(32, 128, 258, 1024, SLOW),
+ new Config(32, 258, 258, 4096, SLOW)
+];
+var z_errmsg = [
+ "need dictionary",
+ "stream end",
+ "",
+ "",
+ "stream error",
+ "data error",
+ "",
+ "buffer error",
+ "",
+ ""
+];
+var NeedMore = 0;
+var BlockDone = 1;
+var FinishStarted = 2;
+var FinishDone = 3;
+var PRESET_DICT = 32;
+var INIT_STATE = 42;
+var BUSY_STATE = 113;
+var FINISH_STATE = 666;
+var Z_DEFLATED = 8;
+var STORED_BLOCK = 0;
+var STATIC_TREES = 1;
+var DYN_TREES = 2;
+var MIN_MATCH = 3;
+var MAX_MATCH = 258;
+var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1;
+function smaller(tree, n, m, depth) {
+ const tn2 = tree[n * 2];
+ const tm2 = tree[m * 2];
+ return tn2 < tm2 || tn2 == tm2 && depth[n] <= depth[m];
+}
+function Deflate() {
+ const that = this;
+ let strm;
+ let status;
+ let pending_buf_size;
+ let last_flush;
+ let w_size;
+ let w_bits;
+ let w_mask;
+ let win;
+ let window_size;
+ let prev;
+ let head;
+ let ins_h;
+ let hash_size;
+ let hash_bits;
+ let hash_mask;
+ let hash_shift;
+ let block_start;
+ let match_length;
+ let prev_match;
+ let match_available;
+ let strstart;
+ let match_start;
+ let lookahead;
+ let prev_length;
+ let max_chain_length;
+ let max_lazy_match;
+ let level;
+ let strategy;
+ let good_match;
+ let nice_match;
+ let dyn_ltree;
+ let dyn_dtree;
+ let bl_tree;
+ const l_desc = new Tree();
+ const d_desc = new Tree();
+ const bl_desc = new Tree();
+ that.depth = [];
+ let lit_bufsize;
+ let last_lit;
+ let matches;
+ let last_eob_len;
+ let bi_buf;
+ let bi_valid;
+ that.bl_count = [];
+ that.heap = [];
+ dyn_ltree = [];
+ dyn_dtree = [];
+ bl_tree = [];
+ function lm_init() {
+ window_size = 2 * w_size;
+ head[hash_size - 1] = 0;
+ for (let i = 0; i < hash_size - 1; i++) {
+ head[i] = 0;
+ }
+ max_lazy_match = config_table[level].max_lazy;
+ good_match = config_table[level].good_length;
+ nice_match = config_table[level].nice_length;
+ max_chain_length = config_table[level].max_chain;
+ strstart = 0;
+ block_start = 0;
+ lookahead = 0;
+ match_length = prev_length = MIN_MATCH - 1;
+ match_available = 0;
+ ins_h = 0;
+ }
+ function init_block() {
+ let i;
+ for (i = 0; i < L_CODES; i++)
+ dyn_ltree[i * 2] = 0;
+ for (i = 0; i < D_CODES; i++)
+ dyn_dtree[i * 2] = 0;
+ for (i = 0; i < BL_CODES; i++)
+ bl_tree[i * 2] = 0;
+ dyn_ltree[END_BLOCK * 2] = 1;
+ that.opt_len = that.static_len = 0;
+ last_lit = matches = 0;
+ }
+ function tr_init() {
+ l_desc.dyn_tree = dyn_ltree;
+ l_desc.stat_desc = StaticTree.static_l_desc;
+ d_desc.dyn_tree = dyn_dtree;
+ d_desc.stat_desc = StaticTree.static_d_desc;
+ bl_desc.dyn_tree = bl_tree;
+ bl_desc.stat_desc = StaticTree.static_bl_desc;
+ bi_buf = 0;
+ bi_valid = 0;
+ last_eob_len = 8;
+ init_block();
+ }
+ that.pqdownheap = function(tree, k) {
+ const heap = that.heap;
+ const v7 = heap[k];
+ let j = k << 1;
+ while (j <= that.heap_len) {
+ if (j < that.heap_len && smaller(tree, heap[j + 1], heap[j], that.depth)) {
+ j++;
+ }
+ if (smaller(tree, v7, heap[j], that.depth))
+ break;
+ heap[k] = heap[j];
+ k = j;
+ j <<= 1;
+ }
+ heap[k] = v7;
+ };
+ function scan_tree(tree, max_code) {
+ let prevlen = -1;
+ let curlen;
+ let nextlen = tree[0 * 2 + 1];
+ let count = 0;
+ let max_count = 7;
+ let min_count = 4;
+ if (nextlen === 0) {
+ max_count = 138;
+ min_count = 3;
+ }
+ tree[(max_code + 1) * 2 + 1] = 65535;
+ for (let n = 0; n <= max_code; n++) {
+ curlen = nextlen;
+ nextlen = tree[(n + 1) * 2 + 1];
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ bl_tree[curlen * 2] += count;
+ } else if (curlen !== 0) {
+ if (curlen != prevlen)
+ bl_tree[curlen * 2]++;
+ bl_tree[REP_3_6 * 2]++;
+ } else if (count <= 10) {
+ bl_tree[REPZ_3_10 * 2]++;
+ } else {
+ bl_tree[REPZ_11_138 * 2]++;
+ }
+ count = 0;
+ prevlen = curlen;
+ if (nextlen === 0) {
+ max_count = 138;
+ min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6;
+ min_count = 3;
+ } else {
+ max_count = 7;
+ min_count = 4;
+ }
+ }
+ }
+ function build_bl_tree() {
+ let max_blindex;
+ scan_tree(dyn_ltree, l_desc.max_code);
+ scan_tree(dyn_dtree, d_desc.max_code);
+ bl_desc.build_tree(that);
+ for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
+ if (bl_tree[Tree.bl_order[max_blindex] * 2 + 1] !== 0)
+ break;
+ }
+ that.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
+ return max_blindex;
+ }
+ function put_byte(p) {
+ that.pending_buf[that.pending++] = p;
+ }
+ function put_short(w) {
+ put_byte(w & 255);
+ put_byte(w >>> 8 & 255);
+ }
+ function putShortMSB(b) {
+ put_byte(b >> 8 & 255);
+ put_byte(b & 255 & 255);
+ }
+ function send_bits(value, length3) {
+ let val;
+ const len = length3;
+ if (bi_valid > Buf_size - len) {
+ val = value;
+ bi_buf |= val << bi_valid & 65535;
+ put_short(bi_buf);
+ bi_buf = val >>> Buf_size - bi_valid;
+ bi_valid += len - Buf_size;
+ } else {
+ bi_buf |= value << bi_valid & 65535;
+ bi_valid += len;
+ }
+ }
+ function send_code(c, tree) {
+ const c22 = c * 2;
+ send_bits(tree[c22] & 65535, tree[c22 + 1] & 65535);
+ }
+ function send_tree(tree, max_code) {
+ let n;
+ let prevlen = -1;
+ let curlen;
+ let nextlen = tree[0 * 2 + 1];
+ let count = 0;
+ let max_count = 7;
+ let min_count = 4;
+ if (nextlen === 0) {
+ max_count = 138;
+ min_count = 3;
+ }
+ for (n = 0; n <= max_code; n++) {
+ curlen = nextlen;
+ nextlen = tree[(n + 1) * 2 + 1];
+ if (++count < max_count && curlen == nextlen) {
+ continue;
+ } else if (count < min_count) {
+ do {
+ send_code(curlen, bl_tree);
+ } while (--count !== 0);
+ } else if (curlen !== 0) {
+ if (curlen != prevlen) {
+ send_code(curlen, bl_tree);
+ count--;
+ }
+ send_code(REP_3_6, bl_tree);
+ send_bits(count - 3, 2);
+ } else if (count <= 10) {
+ send_code(REPZ_3_10, bl_tree);
+ send_bits(count - 3, 3);
+ } else {
+ send_code(REPZ_11_138, bl_tree);
+ send_bits(count - 11, 7);
+ }
+ count = 0;
+ prevlen = curlen;
+ if (nextlen === 0) {
+ max_count = 138;
+ min_count = 3;
+ } else if (curlen == nextlen) {
+ max_count = 6;
+ min_count = 3;
+ } else {
+ max_count = 7;
+ min_count = 4;
+ }
+ }
+ }
+ function send_all_trees(lcodes, dcodes, blcodes) {
+ let rank;
+ send_bits(lcodes - 257, 5);
+ send_bits(dcodes - 1, 5);
+ send_bits(blcodes - 4, 4);
+ for (rank = 0; rank < blcodes; rank++) {
+ send_bits(bl_tree[Tree.bl_order[rank] * 2 + 1], 3);
+ }
+ send_tree(dyn_ltree, lcodes - 1);
+ send_tree(dyn_dtree, dcodes - 1);
+ }
+ function bi_flush() {
+ if (bi_valid == 16) {
+ put_short(bi_buf);
+ bi_buf = 0;
+ bi_valid = 0;
+ } else if (bi_valid >= 8) {
+ put_byte(bi_buf & 255);
+ bi_buf >>>= 8;
+ bi_valid -= 8;
+ }
+ }
+ function _tr_align() {
+ send_bits(STATIC_TREES << 1, 3);
+ send_code(END_BLOCK, StaticTree.static_ltree);
+ bi_flush();
+ if (1 + last_eob_len + 10 - bi_valid < 9) {
+ send_bits(STATIC_TREES << 1, 3);
+ send_code(END_BLOCK, StaticTree.static_ltree);
+ bi_flush();
+ }
+ last_eob_len = 7;
+ }
+ function _tr_tally(dist, lc) {
+ let out_length, in_length, dcode;
+ that.dist_buf[last_lit] = dist;
+ that.lc_buf[last_lit] = lc & 255;
+ last_lit++;
+ if (dist === 0) {
+ dyn_ltree[lc * 2]++;
+ } else {
+ matches++;
+ dist--;
+ dyn_ltree[(Tree._length_code[lc] + LITERALS + 1) * 2]++;
+ dyn_dtree[Tree.d_code(dist) * 2]++;
+ }
+ if ((last_lit & 8191) === 0 && level > 2) {
+ out_length = last_lit * 8;
+ in_length = strstart - block_start;
+ for (dcode = 0; dcode < D_CODES; dcode++) {
+ out_length += dyn_dtree[dcode * 2] * (5 + Tree.extra_dbits[dcode]);
+ }
+ out_length >>>= 3;
+ if (matches < Math.floor(last_lit / 2) && out_length < Math.floor(in_length / 2))
+ return true;
+ }
+ return last_lit == lit_bufsize - 1;
+ }
+ function compress_block(ltree, dtree) {
+ let dist;
+ let lc;
+ let lx = 0;
+ let code;
+ let extra;
+ if (last_lit !== 0) {
+ do {
+ dist = that.dist_buf[lx];
+ lc = that.lc_buf[lx];
+ lx++;
+ if (dist === 0) {
+ send_code(lc, ltree);
+ } else {
+ code = Tree._length_code[lc];
+ send_code(code + LITERALS + 1, ltree);
+ extra = Tree.extra_lbits[code];
+ if (extra !== 0) {
+ lc -= Tree.base_length[code];
+ send_bits(lc, extra);
+ }
+ dist--;
+ code = Tree.d_code(dist);
+ send_code(code, dtree);
+ extra = Tree.extra_dbits[code];
+ if (extra !== 0) {
+ dist -= Tree.base_dist[code];
+ send_bits(dist, extra);
+ }
+ }
+ } while (lx < last_lit);
+ }
+ send_code(END_BLOCK, ltree);
+ last_eob_len = ltree[END_BLOCK * 2 + 1];
+ }
+ function bi_windup() {
+ if (bi_valid > 8) {
+ put_short(bi_buf);
+ } else if (bi_valid > 0) {
+ put_byte(bi_buf & 255);
+ }
+ bi_buf = 0;
+ bi_valid = 0;
+ }
+ function copy_block(buf, len, header) {
+ bi_windup();
+ last_eob_len = 8;
+ if (header) {
+ put_short(len);
+ put_short(~len);
+ }
+ that.pending_buf.set(win.subarray(buf, buf + len), that.pending);
+ that.pending += len;
+ }
+ function _tr_stored_block(buf, stored_len, eof) {
+ send_bits((STORED_BLOCK << 1) + (eof ? 1 : 0), 3);
+ copy_block(buf, stored_len, true);
+ }
+ function _tr_flush_block(buf, stored_len, eof) {
+ let opt_lenb, static_lenb;
+ let max_blindex = 0;
+ if (level > 0) {
+ l_desc.build_tree(that);
+ d_desc.build_tree(that);
+ max_blindex = build_bl_tree();
+ opt_lenb = that.opt_len + 3 + 7 >>> 3;
+ static_lenb = that.static_len + 3 + 7 >>> 3;
+ if (static_lenb <= opt_lenb)
+ opt_lenb = static_lenb;
+ } else {
+ opt_lenb = static_lenb = stored_len + 5;
+ }
+ if (stored_len + 4 <= opt_lenb && buf != -1) {
+ _tr_stored_block(buf, stored_len, eof);
+ } else if (static_lenb == opt_lenb) {
+ send_bits((STATIC_TREES << 1) + (eof ? 1 : 0), 3);
+ compress_block(StaticTree.static_ltree, StaticTree.static_dtree);
+ } else {
+ send_bits((DYN_TREES << 1) + (eof ? 1 : 0), 3);
+ send_all_trees(l_desc.max_code + 1, d_desc.max_code + 1, max_blindex + 1);
+ compress_block(dyn_ltree, dyn_dtree);
+ }
+ init_block();
+ if (eof) {
+ bi_windup();
+ }
+ }
+ function flush_block_only(eof) {
+ _tr_flush_block(block_start >= 0 ? block_start : -1, strstart - block_start, eof);
+ block_start = strstart;
+ strm.flush_pending();
+ }
+ function fill_window() {
+ let n, m;
+ let p;
+ let more;
+ do {
+ more = window_size - lookahead - strstart;
+ if (more === 0 && strstart === 0 && lookahead === 0) {
+ more = w_size;
+ } else if (more == -1) {
+ more--;
+ } else if (strstart >= w_size + w_size - MIN_LOOKAHEAD) {
+ win.set(win.subarray(w_size, w_size + w_size), 0);
+ match_start -= w_size;
+ strstart -= w_size;
+ block_start -= w_size;
+ n = hash_size;
+ p = n;
+ do {
+ m = head[--p] & 65535;
+ head[p] = m >= w_size ? m - w_size : 0;
+ } while (--n !== 0);
+ n = w_size;
+ p = n;
+ do {
+ m = prev[--p] & 65535;
+ prev[p] = m >= w_size ? m - w_size : 0;
+ } while (--n !== 0);
+ more += w_size;
+ }
+ if (strm.avail_in === 0)
+ return;
+ n = strm.read_buf(win, strstart + lookahead, more);
+ lookahead += n;
+ if (lookahead >= MIN_MATCH) {
+ ins_h = win[strstart] & 255;
+ ins_h = (ins_h << hash_shift ^ win[strstart + 1] & 255) & hash_mask;
+ }
+ } while (lookahead < MIN_LOOKAHEAD && strm.avail_in !== 0);
+ }
+ function deflate_stored(flush) {
+ let max_block_size = 65535;
+ let max_start;
+ if (max_block_size > pending_buf_size - 5) {
+ max_block_size = pending_buf_size - 5;
+ }
+ while (true) {
+ if (lookahead <= 1) {
+ fill_window();
+ if (lookahead === 0 && flush == Z_NO_FLUSH)
+ return NeedMore;
+ if (lookahead === 0)
+ break;
+ }
+ strstart += lookahead;
+ lookahead = 0;
+ max_start = block_start + max_block_size;
+ if (strstart === 0 || strstart >= max_start) {
+ lookahead = strstart - max_start;
+ strstart = max_start;
+ flush_block_only(false);
+ if (strm.avail_out === 0)
+ return NeedMore;
+ }
+ if (strstart - block_start >= w_size - MIN_LOOKAHEAD) {
+ flush_block_only(false);
+ if (strm.avail_out === 0)
+ return NeedMore;
+ }
+ }
+ flush_block_only(flush == Z_FINISH);
+ if (strm.avail_out === 0)
+ return flush == Z_FINISH ? FinishStarted : NeedMore;
+ return flush == Z_FINISH ? FinishDone : BlockDone;
+ }
+ function longest_match(cur_match) {
+ let chain_length = max_chain_length;
+ let scan = strstart;
+ let match;
+ let len;
+ let best_len = prev_length;
+ const limit = strstart > w_size - MIN_LOOKAHEAD ? strstart - (w_size - MIN_LOOKAHEAD) : 0;
+ let _nice_match = nice_match;
+ const wmask = w_mask;
+ const strend = strstart + MAX_MATCH;
+ let scan_end1 = win[scan + best_len - 1];
+ let scan_end = win[scan + best_len];
+ if (prev_length >= good_match) {
+ chain_length >>= 2;
+ }
+ if (_nice_match > lookahead)
+ _nice_match = lookahead;
+ do {
+ match = cur_match;
+ if (win[match + best_len] != scan_end || win[match + best_len - 1] != scan_end1 || win[match] != win[scan] || win[++match] != win[scan + 1])
+ continue;
+ scan += 2;
+ match++;
+ do {
+ } while (win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match] && scan < strend);
+ len = MAX_MATCH - (strend - scan);
+ scan = strend - MAX_MATCH;
+ if (len > best_len) {
+ match_start = cur_match;
+ best_len = len;
+ if (len >= _nice_match)
+ break;
+ scan_end1 = win[scan + best_len - 1];
+ scan_end = win[scan + best_len];
+ }
+ } while ((cur_match = prev[cur_match & wmask] & 65535) > limit && --chain_length !== 0);
+ if (best_len <= lookahead)
+ return best_len;
+ return lookahead;
+ }
+ function deflate_fast(flush) {
+ let hash_head = 0;
+ let bflush;
+ while (true) {
+ if (lookahead < MIN_LOOKAHEAD) {
+ fill_window();
+ if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+ return NeedMore;
+ }
+ if (lookahead === 0)
+ break;
+ }
+ if (lookahead >= MIN_MATCH) {
+ ins_h = (ins_h << hash_shift ^ win[strstart + (MIN_MATCH - 1)] & 255) & hash_mask;
+ hash_head = head[ins_h] & 65535;
+ prev[strstart & w_mask] = head[ins_h];
+ head[ins_h] = strstart;
+ }
+ if (hash_head !== 0 && (strstart - hash_head & 65535) <= w_size - MIN_LOOKAHEAD) {
+ if (strategy != Z_HUFFMAN_ONLY) {
+ match_length = longest_match(hash_head);
+ }
+ }
+ if (match_length >= MIN_MATCH) {
+ bflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);
+ lookahead -= match_length;
+ if (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {
+ match_length--;
+ do {
+ strstart++;
+ ins_h = (ins_h << hash_shift ^ win[strstart + (MIN_MATCH - 1)] & 255) & hash_mask;
+ hash_head = head[ins_h] & 65535;
+ prev[strstart & w_mask] = head[ins_h];
+ head[ins_h] = strstart;
+ } while (--match_length !== 0);
+ strstart++;
+ } else {
+ strstart += match_length;
+ match_length = 0;
+ ins_h = win[strstart] & 255;
+ ins_h = (ins_h << hash_shift ^ win[strstart + 1] & 255) & hash_mask;
+ }
+ } else {
+ bflush = _tr_tally(0, win[strstart] & 255);
+ lookahead--;
+ strstart++;
+ }
+ if (bflush) {
+ flush_block_only(false);
+ if (strm.avail_out === 0)
+ return NeedMore;
+ }
+ }
+ flush_block_only(flush == Z_FINISH);
+ if (strm.avail_out === 0) {
+ if (flush == Z_FINISH)
+ return FinishStarted;
+ else
+ return NeedMore;
+ }
+ return flush == Z_FINISH ? FinishDone : BlockDone;
+ }
+ function deflate_slow(flush) {
+ let hash_head = 0;
+ let bflush;
+ let max_insert;
+ while (true) {
+ if (lookahead < MIN_LOOKAHEAD) {
+ fill_window();
+ if (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {
+ return NeedMore;
+ }
+ if (lookahead === 0)
+ break;
+ }
+ if (lookahead >= MIN_MATCH) {
+ ins_h = (ins_h << hash_shift ^ win[strstart + (MIN_MATCH - 1)] & 255) & hash_mask;
+ hash_head = head[ins_h] & 65535;
+ prev[strstart & w_mask] = head[ins_h];
+ head[ins_h] = strstart;
+ }
+ prev_length = match_length;
+ prev_match = match_start;
+ match_length = MIN_MATCH - 1;
+ if (hash_head !== 0 && prev_length < max_lazy_match && (strstart - hash_head & 65535) <= w_size - MIN_LOOKAHEAD) {
+ if (strategy != Z_HUFFMAN_ONLY) {
+ match_length = longest_match(hash_head);
+ }
+ if (match_length <= 5 && (strategy == Z_FILTERED || match_length == MIN_MATCH && strstart - match_start > 4096)) {
+ match_length = MIN_MATCH - 1;
+ }
+ }
+ if (prev_length >= MIN_MATCH && match_length <= prev_length) {
+ max_insert = strstart + lookahead - MIN_MATCH;
+ bflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);
+ lookahead -= prev_length - 1;
+ prev_length -= 2;
+ do {
+ if (++strstart <= max_insert) {
+ ins_h = (ins_h << hash_shift ^ win[strstart + (MIN_MATCH - 1)] & 255) & hash_mask;
+ hash_head = head[ins_h] & 65535;
+ prev[strstart & w_mask] = head[ins_h];
+ head[ins_h] = strstart;
+ }
+ } while (--prev_length !== 0);
+ match_available = 0;
+ match_length = MIN_MATCH - 1;
+ strstart++;
+ if (bflush) {
+ flush_block_only(false);
+ if (strm.avail_out === 0)
+ return NeedMore;
+ }
+ } else if (match_available !== 0) {
+ bflush = _tr_tally(0, win[strstart - 1] & 255);
+ if (bflush) {
+ flush_block_only(false);
+ }
+ strstart++;
+ lookahead--;
+ if (strm.avail_out === 0)
+ return NeedMore;
+ } else {
+ match_available = 1;
+ strstart++;
+ lookahead--;
+ }
+ }
+ if (match_available !== 0) {
+ bflush = _tr_tally(0, win[strstart - 1] & 255);
+ match_available = 0;
+ }
+ flush_block_only(flush == Z_FINISH);
+ if (strm.avail_out === 0) {
+ if (flush == Z_FINISH)
+ return FinishStarted;
+ else
+ return NeedMore;
+ }
+ return flush == Z_FINISH ? FinishDone : BlockDone;
+ }
+ function deflateReset(strm2) {
+ strm2.total_in = strm2.total_out = 0;
+ strm2.msg = null;
+ that.pending = 0;
+ that.pending_out = 0;
+ status = BUSY_STATE;
+ last_flush = Z_NO_FLUSH;
+ tr_init();
+ lm_init();
+ return Z_OK;
+ }
+ that.deflateInit = function(strm2, _level, bits, _method, memLevel, _strategy) {
+ if (!_method)
+ _method = Z_DEFLATED;
+ if (!memLevel)
+ memLevel = DEF_MEM_LEVEL;
+ if (!_strategy)
+ _strategy = Z_DEFAULT_STRATEGY;
+ strm2.msg = null;
+ if (_level == Z_DEFAULT_COMPRESSION)
+ _level = 6;
+ if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || _method != Z_DEFLATED || bits < 9 || bits > 15 || _level < 0 || _level > 9 || _strategy < 0 || _strategy > Z_HUFFMAN_ONLY) {
+ return Z_STREAM_ERROR;
+ }
+ strm2.dstate = that;
+ w_bits = bits;
+ w_size = 1 << w_bits;
+ w_mask = w_size - 1;
+ hash_bits = memLevel + 7;
+ hash_size = 1 << hash_bits;
+ hash_mask = hash_size - 1;
+ hash_shift = Math.floor((hash_bits + MIN_MATCH - 1) / MIN_MATCH);
+ win = new Uint8Array(w_size * 2);
+ prev = [];
+ head = [];
+ lit_bufsize = 1 << memLevel + 6;
+ that.pending_buf = new Uint8Array(lit_bufsize * 4);
+ pending_buf_size = lit_bufsize * 4;
+ that.dist_buf = new Uint16Array(lit_bufsize);
+ that.lc_buf = new Uint8Array(lit_bufsize);
+ level = _level;
+ strategy = _strategy;
+ return deflateReset(strm2);
+ };
+ that.deflateEnd = function() {
+ if (status != INIT_STATE && status != BUSY_STATE && status != FINISH_STATE) {
+ return Z_STREAM_ERROR;
+ }
+ that.lc_buf = null;
+ that.dist_buf = null;
+ that.pending_buf = null;
+ head = null;
+ prev = null;
+ win = null;
+ that.dstate = null;
+ return status == BUSY_STATE ? Z_DATA_ERROR : Z_OK;
+ };
+ that.deflateParams = function(strm2, _level, _strategy) {
+ let err = Z_OK;
+ if (_level == Z_DEFAULT_COMPRESSION) {
+ _level = 6;
+ }
+ if (_level < 0 || _level > 9 || _strategy < 0 || _strategy > Z_HUFFMAN_ONLY) {
+ return Z_STREAM_ERROR;
+ }
+ if (config_table[level].func != config_table[_level].func && strm2.total_in !== 0) {
+ err = strm2.deflate(Z_PARTIAL_FLUSH);
+ }
+ if (level != _level) {
+ level = _level;
+ max_lazy_match = config_table[level].max_lazy;
+ good_match = config_table[level].good_length;
+ nice_match = config_table[level].nice_length;
+ max_chain_length = config_table[level].max_chain;
+ }
+ strategy = _strategy;
+ return err;
+ };
+ that.deflateSetDictionary = function(_strm, dictionary, dictLength) {
+ let length3 = dictLength;
+ let n, index = 0;
+ if (!dictionary || status != INIT_STATE)
+ return Z_STREAM_ERROR;
+ if (length3 < MIN_MATCH)
+ return Z_OK;
+ if (length3 > w_size - MIN_LOOKAHEAD) {
+ length3 = w_size - MIN_LOOKAHEAD;
+ index = dictLength - length3;
+ }
+ win.set(dictionary.subarray(index, index + length3), 0);
+ strstart = length3;
+ block_start = length3;
+ ins_h = win[0] & 255;
+ ins_h = (ins_h << hash_shift ^ win[1] & 255) & hash_mask;
+ for (n = 0; n <= length3 - MIN_MATCH; n++) {
+ ins_h = (ins_h << hash_shift ^ win[n + (MIN_MATCH - 1)] & 255) & hash_mask;
+ prev[n & w_mask] = head[ins_h];
+ head[ins_h] = n;
+ }
+ return Z_OK;
+ };
+ that.deflate = function(_strm, flush) {
+ let i, header, level_flags, old_flush, bstate;
+ if (flush > Z_FINISH || flush < 0) {
+ return Z_STREAM_ERROR;
+ }
+ if (!_strm.next_out || !_strm.next_in && _strm.avail_in !== 0 || status == FINISH_STATE && flush != Z_FINISH) {
+ _strm.msg = z_errmsg[Z_NEED_DICT - Z_STREAM_ERROR];
+ return Z_STREAM_ERROR;
+ }
+ if (_strm.avail_out === 0) {
+ _strm.msg = z_errmsg[Z_NEED_DICT - Z_BUF_ERROR];
+ return Z_BUF_ERROR;
+ }
+ strm = _strm;
+ old_flush = last_flush;
+ last_flush = flush;
+ if (status == INIT_STATE) {
+ header = Z_DEFLATED + (w_bits - 8 << 4) << 8;
+ level_flags = (level - 1 & 255) >> 1;
+ if (level_flags > 3)
+ level_flags = 3;
+ header |= level_flags << 6;
+ if (strstart !== 0)
+ header |= PRESET_DICT;
+ header += 31 - header % 31;
+ status = BUSY_STATE;
+ putShortMSB(header);
+ }
+ if (that.pending !== 0) {
+ strm.flush_pending();
+ if (strm.avail_out === 0) {
+ last_flush = -1;
+ return Z_OK;
+ }
+ } else if (strm.avail_in === 0 && flush <= old_flush && flush != Z_FINISH) {
+ strm.msg = z_errmsg[Z_NEED_DICT - Z_BUF_ERROR];
+ return Z_BUF_ERROR;
+ }
+ if (status == FINISH_STATE && strm.avail_in !== 0) {
+ _strm.msg = z_errmsg[Z_NEED_DICT - Z_BUF_ERROR];
+ return Z_BUF_ERROR;
+ }
+ if (strm.avail_in !== 0 || lookahead !== 0 || flush != Z_NO_FLUSH && status != FINISH_STATE) {
+ bstate = -1;
+ switch (config_table[level].func) {
+ case STORED:
+ bstate = deflate_stored(flush);
+ break;
+ case FAST:
+ bstate = deflate_fast(flush);
+ break;
+ case SLOW:
+ bstate = deflate_slow(flush);
+ break;
+ default:
+ }
+ if (bstate == FinishStarted || bstate == FinishDone) {
+ status = FINISH_STATE;
+ }
+ if (bstate == NeedMore || bstate == FinishStarted) {
+ if (strm.avail_out === 0) {
+ last_flush = -1;
+ }
+ return Z_OK;
+ }
+ if (bstate == BlockDone) {
+ if (flush == Z_PARTIAL_FLUSH) {
+ _tr_align();
+ } else {
+ _tr_stored_block(0, 0, false);
+ if (flush == Z_FULL_FLUSH) {
+ for (i = 0; i < hash_size; i++)
+ head[i] = 0;
+ }
+ }
+ strm.flush_pending();
+ if (strm.avail_out === 0) {
+ last_flush = -1;
+ return Z_OK;
+ }
+ }
+ }
+ if (flush != Z_FINISH)
+ return Z_OK;
+ return Z_STREAM_END;
+ };
+}
+function ZStream() {
+ const that = this;
+ that.next_in_index = 0;
+ that.next_out_index = 0;
+ that.avail_in = 0;
+ that.total_in = 0;
+ that.avail_out = 0;
+ that.total_out = 0;
+}
+ZStream.prototype = {
+ deflateInit: function(level, bits) {
+ const that = this;
+ that.dstate = new Deflate();
+ if (!bits)
+ bits = MAX_BITS;
+ return that.dstate.deflateInit(that, level, bits);
+ },
+ deflate: function(flush) {
+ const that = this;
+ if (!that.dstate) {
+ return Z_STREAM_ERROR;
+ }
+ return that.dstate.deflate(that, flush);
+ },
+ deflateEnd: function() {
+ const that = this;
+ if (!that.dstate)
+ return Z_STREAM_ERROR;
+ const ret = that.dstate.deflateEnd();
+ that.dstate = null;
+ return ret;
+ },
+ deflateParams: function(level, strategy) {
+ const that = this;
+ if (!that.dstate)
+ return Z_STREAM_ERROR;
+ return that.dstate.deflateParams(that, level, strategy);
+ },
+ deflateSetDictionary: function(dictionary, dictLength) {
+ const that = this;
+ if (!that.dstate)
+ return Z_STREAM_ERROR;
+ return that.dstate.deflateSetDictionary(that, dictionary, dictLength);
+ },
+ read_buf: function(buf, start, size) {
+ const that = this;
+ let len = that.avail_in;
+ if (len > size)
+ len = size;
+ if (len === 0)
+ return 0;
+ that.avail_in -= len;
+ buf.set(that.next_in.subarray(that.next_in_index, that.next_in_index + len), start);
+ that.next_in_index += len;
+ that.total_in += len;
+ return len;
+ },
+ flush_pending: function() {
+ const that = this;
+ let len = that.dstate.pending;
+ if (len > that.avail_out)
+ len = that.avail_out;
+ if (len === 0)
+ return;
+ that.next_out.set(that.dstate.pending_buf.subarray(that.dstate.pending_out, that.dstate.pending_out + len), that.next_out_index);
+ that.next_out_index += len;
+ that.dstate.pending_out += len;
+ that.total_out += len;
+ that.avail_out -= len;
+ that.dstate.pending -= len;
+ if (that.dstate.pending === 0) {
+ that.dstate.pending_out = 0;
+ }
+ }
+};
+function ZipDeflate(options) {
+ const that = this;
+ const z = new ZStream();
+ const bufsize = getMaximumCompressedSize(options && options.chunkSize ? options.chunkSize : 64 * 1024);
+ const flush = Z_NO_FLUSH;
+ const buf = new Uint8Array(bufsize);
+ let level = options ? options.level : Z_DEFAULT_COMPRESSION;
+ if (typeof level == "undefined")
+ level = Z_DEFAULT_COMPRESSION;
+ z.deflateInit(level);
+ z.next_out = buf;
+ that.append = function(data, onprogress) {
+ let err, array, lastIndex = 0, bufferIndex = 0, bufferSize = 0;
+ const buffers = [];
+ if (!data.length)
+ return;
+ z.next_in_index = 0;
+ z.next_in = data;
+ z.avail_in = data.length;
+ do {
+ z.next_out_index = 0;
+ z.avail_out = bufsize;
+ err = z.deflate(flush);
+ if (err != Z_OK)
+ throw new Error("deflating: " + z.msg);
+ if (z.next_out_index)
+ if (z.next_out_index == bufsize)
+ buffers.push(new Uint8Array(buf));
+ else
+ buffers.push(buf.slice(0, z.next_out_index));
+ bufferSize += z.next_out_index;
+ if (onprogress && z.next_in_index > 0 && z.next_in_index != lastIndex) {
+ onprogress(z.next_in_index);
+ lastIndex = z.next_in_index;
+ }
+ } while (z.avail_in > 0 || z.avail_out === 0);
+ if (buffers.length > 1) {
+ array = new Uint8Array(bufferSize);
+ buffers.forEach(function(chunk) {
+ array.set(chunk, bufferIndex);
+ bufferIndex += chunk.length;
+ });
+ } else {
+ array = buffers[0] || new Uint8Array(0);
+ }
+ return array;
+ };
+ that.flush = function() {
+ let err, array, bufferIndex = 0, bufferSize = 0;
+ const buffers = [];
+ do {
+ z.next_out_index = 0;
+ z.avail_out = bufsize;
+ err = z.deflate(Z_FINISH);
+ if (err != Z_STREAM_END && err != Z_OK)
+ throw new Error("deflating: " + z.msg);
+ if (bufsize - z.avail_out > 0)
+ buffers.push(buf.slice(0, z.next_out_index));
+ bufferSize += z.next_out_index;
+ } while (z.avail_in > 0 || z.avail_out === 0);
+ z.deflateEnd();
+ array = new Uint8Array(bufferSize);
+ buffers.forEach(function(chunk) {
+ array.set(chunk, bufferIndex);
+ bufferIndex += chunk.length;
+ });
+ return array;
+ };
+}
+function getMaximumCompressedSize(uncompressedSize) {
+ return uncompressedSize + 5 * (Math.floor(uncompressedSize / 16383) + 1);
+}
+var deflate_default = ZipDeflate;
+
+// node_modules/@zip.js/zip.js/lib/core/codecs/inflate.js
+var MAX_BITS2 = 15;
+var Z_OK2 = 0;
+var Z_STREAM_END2 = 1;
+var Z_NEED_DICT2 = 2;
+var Z_STREAM_ERROR2 = -2;
+var Z_DATA_ERROR2 = -3;
+var Z_MEM_ERROR = -4;
+var Z_BUF_ERROR2 = -5;
+var inflate_mask = [
+ 0,
+ 1,
+ 3,
+ 7,
+ 15,
+ 31,
+ 63,
+ 127,
+ 255,
+ 511,
+ 1023,
+ 2047,
+ 4095,
+ 8191,
+ 16383,
+ 32767,
+ 65535
+];
+var MANY = 1440;
+var Z_NO_FLUSH2 = 0;
+var Z_FINISH2 = 4;
+var fixed_bl = 9;
+var fixed_bd = 5;
+var fixed_tl = [
+ 96,
+ 7,
+ 256,
+ 0,
+ 8,
+ 80,
+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,
+ 33,
+ 49,
+ 65,
+ 97,
+ 129,
+ 193,
+ 257,
+ 385,
+ 513,
+ 769,
+ 1025,
+ 1537,
+ 2049,
+ 3073,
+ 4097,
+ 6145,
+ 8193,
+ 12289,
+ 16385,
+ 24577
+];
+var cpdext = [
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 1,
+ 2,
+ 2,
+ 3,
+ 3,
+ 4,
+ 4,
+ 5,
+ 5,
+ 6,
+ 6,
+ 7,
+ 7,
+ 8,
+ 8,
+ 9,
+ 9,
+ 10,
+ 10,
+ 11,
+ 11,
+ 12,
+ 12,
+ 13,
+ 13
+];
+var BMAX = 15;
+function InfTree() {
+ const that = this;
+ let hn;
+ let v7;
+ let c;
+ let r;
+ let u3;
+ let x;
+ function huft_build(b, bindex, n, s, d, e, t, m, hp, hn2, v8) {
+ let a3;
+ let f;
+ let g;
+ let h;
+ let i;
+ let j;
+ let k;
+ let l;
+ let mask;
+ let p;
+ let q;
+ let w;
+ let xp;
+ let y;
+ let z;
+ p = 0;
+ i = n;
+ do {
+ c[b[bindex + p]]++;
+ p++;
+ i--;
+ } while (i !== 0);
+ if (c[0] == n) {
+ t[0] = -1;
+ m[0] = 0;
+ return Z_OK2;
+ }
+ l = m[0];
+ for (j = 1; j <= BMAX; j++)
+ if (c[j] !== 0)
+ break;
+ k = j;
+ if (l < j) {
+ l = j;
+ }
+ for (i = BMAX; i !== 0; i--) {
+ if (c[i] !== 0)
+ break;
+ }
+ g = i;
+ if (l > i) {
+ l = i;
+ }
+ m[0] = l;
+ for (y = 1 << j; j < i; j++, y <<= 1) {
+ if ((y -= c[j]) < 0) {
+ return Z_DATA_ERROR2;
+ }
+ }
+ if ((y -= c[i]) < 0) {
+ return Z_DATA_ERROR2;
+ }
+ c[i] += y;
+ x[1] = j = 0;
+ p = 1;
+ xp = 2;
+ while (--i !== 0) {
+ x[xp] = j += c[p];
+ xp++;
+ p++;
+ }
+ i = 0;
+ p = 0;
+ do {
+ if ((j = b[bindex + p]) !== 0) {
+ v8[x[j]++] = i;
+ }
+ p++;
+ } while (++i < n);
+ n = x[g];
+ x[0] = i = 0;
+ p = 0;
+ h = -1;
+ w = -l;
+ u3[0] = 0;
+ q = 0;
+ z = 0;
+ for (; k <= g; k++) {
+ a3 = c[k];
+ while (a3-- !== 0) {
+ while (k > w + l) {
+ h++;
+ w += l;
+ z = g - w;
+ z = z > l ? l : z;
+ if ((f = 1 << (j = k - w)) > a3 + 1) {
+ f -= a3 + 1;
+ xp = k;
+ if (j < z) {
+ while (++j < z) {
+ if ((f <<= 1) <= c[++xp])
+ break;
+ f -= c[xp];
+ }
+ }
+ }
+ z = 1 << j;
+ if (hn2[0] + z > MANY) {
+ return Z_DATA_ERROR2;
+ }
+ u3[h] = q = hn2[0];
+ hn2[0] += z;
+ if (h !== 0) {
+ x[h] = i;
+ r[0] = j;
+ r[1] = l;
+ j = i >>> w - l;
+ r[2] = q - u3[h - 1] - j;
+ hp.set(r, (u3[h - 1] + j) * 3);
+ } else {
+ t[0] = q;
+ }
+ }
+ r[1] = k - w;
+ if (p >= n) {
+ r[0] = 128 + 64;
+ } else if (v8[p] < s) {
+ r[0] = v8[p] < 256 ? 0 : 32 + 64;
+ r[2] = v8[p++];
+ } else {
+ r[0] = e[v8[p] - s] + 16 + 64;
+ r[2] = d[v8[p++] - s];
+ }
+ f = 1 << k - w;
+ for (j = i >>> w; j < z; j += f) {
+ hp.set(r, (q + j) * 3);
+ }
+ for (j = 1 << k - 1; (i & j) !== 0; j >>>= 1) {
+ i ^= j;
+ }
+ i ^= j;
+ mask = (1 << w) - 1;
+ while ((i & mask) != x[h]) {
+ h--;
+ w -= l;
+ mask = (1 << w) - 1;
+ }
+ }
+ }
+ return y !== 0 && g != 1 ? Z_BUF_ERROR2 : Z_OK2;
+ }
+ function initWorkArea(vsize) {
+ let i;
+ if (!hn) {
+ hn = [];
+ v7 = [];
+ c = new Int32Array(BMAX + 1);
+ r = [];
+ u3 = new Int32Array(BMAX);
+ x = new Int32Array(BMAX + 1);
+ }
+ if (v7.length < vsize) {
+ v7 = [];
+ }
+ for (i = 0; i < vsize; i++) {
+ v7[i] = 0;
+ }
+ for (i = 0; i < BMAX + 1; i++) {
+ c[i] = 0;
+ }
+ for (i = 0; i < 3; i++) {
+ r[i] = 0;
+ }
+ u3.set(c.subarray(0, BMAX), 0);
+ x.set(c.subarray(0, BMAX + 1), 0);
+ }
+ that.inflate_trees_bits = function(c14, bb, tb, hp, z) {
+ let result;
+ initWorkArea(19);
+ hn[0] = 0;
+ result = huft_build(c14, 0, 19, 19, null, null, tb, bb, hp, hn, v7);
+ if (result == Z_DATA_ERROR2) {
+ z.msg = "oversubscribed dynamic bit lengths tree";
+ } else if (result == Z_BUF_ERROR2 || bb[0] === 0) {
+ z.msg = "incomplete dynamic bit lengths tree";
+ result = Z_DATA_ERROR2;
+ }
+ return result;
+ };
+ that.inflate_trees_dynamic = function(nl, nd, c14, bl, bd, tl, td, hp, z) {
+ let result;
+ initWorkArea(288);
+ hn[0] = 0;
+ result = huft_build(c14, 0, nl, 257, cplens, cplext, tl, bl, hp, hn, v7);
+ if (result != Z_OK2 || bl[0] === 0) {
+ if (result == Z_DATA_ERROR2) {
+ z.msg = "oversubscribed literal/length tree";
+ } else if (result != Z_MEM_ERROR) {
+ z.msg = "incomplete literal/length tree";
+ result = Z_DATA_ERROR2;
+ }
+ return result;
+ }
+ initWorkArea(288);
+ result = huft_build(c14, nl, nd, 0, cpdist, cpdext, td, bd, hp, hn, v7);
+ if (result != Z_OK2 || bd[0] === 0 && nl > 257) {
+ if (result == Z_DATA_ERROR2) {
+ z.msg = "oversubscribed distance tree";
+ } else if (result == Z_BUF_ERROR2) {
+ z.msg = "incomplete distance tree";
+ result = Z_DATA_ERROR2;
+ } else if (result != Z_MEM_ERROR) {
+ z.msg = "empty distance tree with lengths";
+ result = Z_DATA_ERROR2;
+ }
+ return result;
+ }
+ return Z_OK2;
+ };
+}
+InfTree.inflate_trees_fixed = function(bl, bd, tl, td) {
+ bl[0] = fixed_bl;
+ bd[0] = fixed_bd;
+ tl[0] = fixed_tl;
+ td[0] = fixed_td;
+ return Z_OK2;
+};
+var START = 0;
+var LEN = 1;
+var LENEXT = 2;
+var DIST = 3;
+var DISTEXT = 4;
+var COPY = 5;
+var LIT = 6;
+var WASH = 7;
+var END = 8;
+var BADCODE = 9;
+function InfCodes() {
+ const that = this;
+ let mode2;
+ let len = 0;
+ let tree;
+ let tree_index = 0;
+ let need = 0;
+ let lit = 0;
+ let get2 = 0;
+ let dist = 0;
+ let lbits = 0;
+ let dbits = 0;
+ let ltree;
+ let ltree_index = 0;
+ let dtree;
+ let dtree_index = 0;
+ function inflate_fast(bl, bd, tl, tl_index, td, td_index, s, z) {
+ let t;
+ let tp;
+ let tp_index;
+ let e;
+ let b;
+ let k;
+ let p;
+ let n;
+ let q;
+ let m;
+ let ml;
+ let md;
+ let c;
+ let d;
+ let r;
+ let tp_index_t_3;
+ p = z.next_in_index;
+ n = z.avail_in;
+ b = s.bitb;
+ k = s.bitk;
+ q = s.write;
+ m = q < s.read ? s.read - q - 1 : s.end - q;
+ ml = inflate_mask[bl];
+ md = inflate_mask[bd];
+ do {
+ while (k < 20) {
+ n--;
+ b |= (z.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ t = b & ml;
+ tp = tl;
+ tp_index = tl_index;
+ tp_index_t_3 = (tp_index + t) * 3;
+ if ((e = tp[tp_index_t_3]) === 0) {
+ b >>= tp[tp_index_t_3 + 1];
+ k -= tp[tp_index_t_3 + 1];
+ s.win[q++] = tp[tp_index_t_3 + 2];
+ m--;
+ continue;
+ }
+ do {
+ b >>= tp[tp_index_t_3 + 1];
+ k -= tp[tp_index_t_3 + 1];
+ if ((e & 16) !== 0) {
+ e &= 15;
+ c = tp[tp_index_t_3 + 2] + (b & inflate_mask[e]);
+ b >>= e;
+ k -= e;
+ while (k < 15) {
+ n--;
+ b |= (z.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ t = b & md;
+ tp = td;
+ tp_index = td_index;
+ tp_index_t_3 = (tp_index + t) * 3;
+ e = tp[tp_index_t_3];
+ do {
+ b >>= tp[tp_index_t_3 + 1];
+ k -= tp[tp_index_t_3 + 1];
+ if ((e & 16) !== 0) {
+ e &= 15;
+ while (k < e) {
+ n--;
+ b |= (z.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ d = tp[tp_index_t_3 + 2] + (b & inflate_mask[e]);
+ b >>= e;
+ k -= e;
+ m -= c;
+ if (q >= d) {
+ r = q - d;
+ if (q - r > 0 && 2 > q - r) {
+ s.win[q++] = s.win[r++];
+ s.win[q++] = s.win[r++];
+ c -= 2;
+ } else {
+ s.win.set(s.win.subarray(r, r + 2), q);
+ q += 2;
+ r += 2;
+ c -= 2;
+ }
+ } else {
+ r = q - d;
+ do {
+ r += s.end;
+ } while (r < 0);
+ e = s.end - r;
+ if (c > e) {
+ c -= e;
+ if (q - r > 0 && e > q - r) {
+ do {
+ s.win[q++] = s.win[r++];
+ } while (--e !== 0);
+ } else {
+ s.win.set(s.win.subarray(r, r + e), q);
+ q += e;
+ r += e;
+ e = 0;
+ }
+ r = 0;
+ }
+ }
+ if (q - r > 0 && c > q - r) {
+ do {
+ s.win[q++] = s.win[r++];
+ } while (--c !== 0);
+ } else {
+ s.win.set(s.win.subarray(r, r + c), q);
+ q += c;
+ r += c;
+ c = 0;
+ }
+ break;
+ } else if ((e & 64) === 0) {
+ t += tp[tp_index_t_3 + 2];
+ t += b & inflate_mask[e];
+ tp_index_t_3 = (tp_index + t) * 3;
+ e = tp[tp_index_t_3];
+ } else {
+ z.msg = "invalid distance code";
+ c = z.avail_in - n;
+ c = k >> 3 < c ? k >> 3 : c;
+ n += c;
+ p -= c;
+ k -= c << 3;
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return Z_DATA_ERROR2;
+ }
+ } while (true);
+ break;
+ }
+ if ((e & 64) === 0) {
+ t += tp[tp_index_t_3 + 2];
+ t += b & inflate_mask[e];
+ tp_index_t_3 = (tp_index + t) * 3;
+ if ((e = tp[tp_index_t_3]) === 0) {
+ b >>= tp[tp_index_t_3 + 1];
+ k -= tp[tp_index_t_3 + 1];
+ s.win[q++] = tp[tp_index_t_3 + 2];
+ m--;
+ break;
+ }
+ } else if ((e & 32) !== 0) {
+ c = z.avail_in - n;
+ c = k >> 3 < c ? k >> 3 : c;
+ n += c;
+ p -= c;
+ k -= c << 3;
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return Z_STREAM_END2;
+ } else {
+ z.msg = "invalid literal/length code";
+ c = z.avail_in - n;
+ c = k >> 3 < c ? k >> 3 : c;
+ n += c;
+ p -= c;
+ k -= c << 3;
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return Z_DATA_ERROR2;
+ }
+ } while (true);
+ } while (m >= 258 && n >= 10);
+ c = z.avail_in - n;
+ c = k >> 3 < c ? k >> 3 : c;
+ n += c;
+ p -= c;
+ k -= c << 3;
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return Z_OK2;
+ }
+ that.init = function(bl, bd, tl, tl_index, td, td_index) {
+ mode2 = START;
+ lbits = bl;
+ dbits = bd;
+ ltree = tl;
+ ltree_index = tl_index;
+ dtree = td;
+ dtree_index = td_index;
+ tree = null;
+ };
+ that.proc = function(s, z, r) {
+ let j;
+ let tindex;
+ let e;
+ let b = 0;
+ let k = 0;
+ let p = 0;
+ let n;
+ let q;
+ let m;
+ let f;
+ p = z.next_in_index;
+ n = z.avail_in;
+ b = s.bitb;
+ k = s.bitk;
+ q = s.write;
+ m = q < s.read ? s.read - q - 1 : s.end - q;
+ while (true) {
+ switch (mode2) {
+ case START:
+ if (m >= 258 && n >= 10) {
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ r = inflate_fast(lbits, dbits, ltree, ltree_index, dtree, dtree_index, s, z);
+ p = z.next_in_index;
+ n = z.avail_in;
+ b = s.bitb;
+ k = s.bitk;
+ q = s.write;
+ m = q < s.read ? s.read - q - 1 : s.end - q;
+ if (r != Z_OK2) {
+ mode2 = r == Z_STREAM_END2 ? WASH : BADCODE;
+ break;
+ }
+ }
+ need = lbits;
+ tree = ltree;
+ tree_index = ltree_index;
+ mode2 = LEN;
+ case LEN:
+ j = need;
+ while (k < j) {
+ if (n !== 0)
+ r = Z_OK2;
+ else {
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ }
+ n--;
+ b |= (z.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ tindex = (tree_index + (b & inflate_mask[j])) * 3;
+ b >>>= tree[tindex + 1];
+ k -= tree[tindex + 1];
+ e = tree[tindex];
+ if (e === 0) {
+ lit = tree[tindex + 2];
+ mode2 = LIT;
+ break;
+ }
+ if ((e & 16) !== 0) {
+ get2 = e & 15;
+ len = tree[tindex + 2];
+ mode2 = LENEXT;
+ break;
+ }
+ if ((e & 64) === 0) {
+ need = e;
+ tree_index = tindex / 3 + tree[tindex + 2];
+ break;
+ }
+ if ((e & 32) !== 0) {
+ mode2 = WASH;
+ break;
+ }
+ mode2 = BADCODE;
+ z.msg = "invalid literal/length code";
+ r = Z_DATA_ERROR2;
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ case LENEXT:
+ j = get2;
+ while (k < j) {
+ if (n !== 0)
+ r = Z_OK2;
+ else {
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ }
+ n--;
+ b |= (z.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ len += b & inflate_mask[j];
+ b >>= j;
+ k -= j;
+ need = dbits;
+ tree = dtree;
+ tree_index = dtree_index;
+ mode2 = DIST;
+ case DIST:
+ j = need;
+ while (k < j) {
+ if (n !== 0)
+ r = Z_OK2;
+ else {
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ }
+ n--;
+ b |= (z.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ tindex = (tree_index + (b & inflate_mask[j])) * 3;
+ b >>= tree[tindex + 1];
+ k -= tree[tindex + 1];
+ e = tree[tindex];
+ if ((e & 16) !== 0) {
+ get2 = e & 15;
+ dist = tree[tindex + 2];
+ mode2 = DISTEXT;
+ break;
+ }
+ if ((e & 64) === 0) {
+ need = e;
+ tree_index = tindex / 3 + tree[tindex + 2];
+ break;
+ }
+ mode2 = BADCODE;
+ z.msg = "invalid distance code";
+ r = Z_DATA_ERROR2;
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ case DISTEXT:
+ j = get2;
+ while (k < j) {
+ if (n !== 0)
+ r = Z_OK2;
+ else {
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ }
+ n--;
+ b |= (z.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ dist += b & inflate_mask[j];
+ b >>= j;
+ k -= j;
+ mode2 = COPY;
+ case COPY:
+ f = q - dist;
+ while (f < 0) {
+ f += s.end;
+ }
+ while (len !== 0) {
+ if (m === 0) {
+ if (q == s.end && s.read !== 0) {
+ q = 0;
+ m = q < s.read ? s.read - q - 1 : s.end - q;
+ }
+ if (m === 0) {
+ s.write = q;
+ r = s.inflate_flush(z, r);
+ q = s.write;
+ m = q < s.read ? s.read - q - 1 : s.end - q;
+ if (q == s.end && s.read !== 0) {
+ q = 0;
+ m = q < s.read ? s.read - q - 1 : s.end - q;
+ }
+ if (m === 0) {
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ }
+ }
+ }
+ s.win[q++] = s.win[f++];
+ m--;
+ if (f == s.end)
+ f = 0;
+ len--;
+ }
+ mode2 = START;
+ break;
+ case LIT:
+ if (m === 0) {
+ if (q == s.end && s.read !== 0) {
+ q = 0;
+ m = q < s.read ? s.read - q - 1 : s.end - q;
+ }
+ if (m === 0) {
+ s.write = q;
+ r = s.inflate_flush(z, r);
+ q = s.write;
+ m = q < s.read ? s.read - q - 1 : s.end - q;
+ if (q == s.end && s.read !== 0) {
+ q = 0;
+ m = q < s.read ? s.read - q - 1 : s.end - q;
+ }
+ if (m === 0) {
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ }
+ }
+ }
+ r = Z_OK2;
+ s.win[q++] = lit;
+ m--;
+ mode2 = START;
+ break;
+ case WASH:
+ if (k > 7) {
+ k -= 8;
+ n++;
+ p--;
+ }
+ s.write = q;
+ r = s.inflate_flush(z, r);
+ q = s.write;
+ m = q < s.read ? s.read - q - 1 : s.end - q;
+ if (s.read != s.write) {
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ }
+ mode2 = END;
+ case END:
+ r = Z_STREAM_END2;
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ case BADCODE:
+ r = Z_DATA_ERROR2;
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ default:
+ r = Z_STREAM_ERROR2;
+ s.bitb = b;
+ s.bitk = k;
+ z.avail_in = n;
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ s.write = q;
+ return s.inflate_flush(z, r);
+ }
+ }
+ };
+ that.free = function() {
+ };
+}
+var border = [
+ 16,
+ 17,
+ 18,
+ 0,
+ 8,
+ 7,
+ 9,
+ 6,
+ 10,
+ 5,
+ 11,
+ 4,
+ 12,
+ 3,
+ 13,
+ 2,
+ 14,
+ 1,
+ 15
+];
+var TYPE = 0;
+var LENS = 1;
+var STORED2 = 2;
+var TABLE = 3;
+var BTREE = 4;
+var DTREE = 5;
+var CODES = 6;
+var DRY = 7;
+var DONELOCKS = 8;
+var BADBLOCKS = 9;
+function InfBlocks(z, w) {
+ const that = this;
+ let mode2 = TYPE;
+ let left = 0;
+ let table2 = 0;
+ let index = 0;
+ let blens;
+ const bb = [0];
+ const tb = [0];
+ const codes = new InfCodes();
+ let last = 0;
+ let hufts = new Int32Array(MANY * 3);
+ const check = 0;
+ const inftree = new InfTree();
+ that.bitk = 0;
+ that.bitb = 0;
+ that.win = new Uint8Array(w);
+ that.end = w;
+ that.read = 0;
+ that.write = 0;
+ that.reset = function(z2, c) {
+ if (c)
+ c[0] = check;
+ if (mode2 == CODES) {
+ codes.free(z2);
+ }
+ mode2 = TYPE;
+ that.bitk = 0;
+ that.bitb = 0;
+ that.read = that.write = 0;
+ };
+ that.reset(z, null);
+ that.inflate_flush = function(z2, r) {
+ let n;
+ let p;
+ let q;
+ p = z2.next_out_index;
+ q = that.read;
+ n = (q <= that.write ? that.write : that.end) - q;
+ if (n > z2.avail_out)
+ n = z2.avail_out;
+ if (n !== 0 && r == Z_BUF_ERROR2)
+ r = Z_OK2;
+ z2.avail_out -= n;
+ z2.total_out += n;
+ z2.next_out.set(that.win.subarray(q, q + n), p);
+ p += n;
+ q += n;
+ if (q == that.end) {
+ q = 0;
+ if (that.write == that.end)
+ that.write = 0;
+ n = that.write - q;
+ if (n > z2.avail_out)
+ n = z2.avail_out;
+ if (n !== 0 && r == Z_BUF_ERROR2)
+ r = Z_OK2;
+ z2.avail_out -= n;
+ z2.total_out += n;
+ z2.next_out.set(that.win.subarray(q, q + n), p);
+ p += n;
+ q += n;
+ }
+ z2.next_out_index = p;
+ that.read = q;
+ return r;
+ };
+ that.proc = function(z2, r) {
+ let t;
+ let b;
+ let k;
+ let p;
+ let n;
+ let q;
+ let m;
+ let i;
+ p = z2.next_in_index;
+ n = z2.avail_in;
+ b = that.bitb;
+ k = that.bitk;
+ q = that.write;
+ m = q < that.read ? that.read - q - 1 : that.end - q;
+ while (true) {
+ let bl, bd, tl, td, bl_, bd_, tl_, td_;
+ switch (mode2) {
+ case TYPE:
+ while (k < 3) {
+ if (n !== 0) {
+ r = Z_OK2;
+ } else {
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ n--;
+ b |= (z2.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ t = b & 7;
+ last = t & 1;
+ switch (t >>> 1) {
+ case 0:
+ b >>>= 3;
+ k -= 3;
+ t = k & 7;
+ b >>>= t;
+ k -= t;
+ mode2 = LENS;
+ break;
+ case 1:
+ bl = [];
+ bd = [];
+ tl = [[]];
+ td = [[]];
+ InfTree.inflate_trees_fixed(bl, bd, tl, td);
+ codes.init(bl[0], bd[0], tl[0], 0, td[0], 0);
+ b >>>= 3;
+ k -= 3;
+ mode2 = CODES;
+ break;
+ case 2:
+ b >>>= 3;
+ k -= 3;
+ mode2 = TABLE;
+ break;
+ case 3:
+ b >>>= 3;
+ k -= 3;
+ mode2 = BADBLOCKS;
+ z2.msg = "invalid block type";
+ r = Z_DATA_ERROR2;
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ break;
+ case LENS:
+ while (k < 32) {
+ if (n !== 0) {
+ r = Z_OK2;
+ } else {
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ n--;
+ b |= (z2.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ if ((~b >>> 16 & 65535) != (b & 65535)) {
+ mode2 = BADBLOCKS;
+ z2.msg = "invalid stored block lengths";
+ r = Z_DATA_ERROR2;
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ left = b & 65535;
+ b = k = 0;
+ mode2 = left !== 0 ? STORED2 : last !== 0 ? DRY : TYPE;
+ break;
+ case STORED2:
+ if (n === 0) {
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ if (m === 0) {
+ if (q == that.end && that.read !== 0) {
+ q = 0;
+ m = q < that.read ? that.read - q - 1 : that.end - q;
+ }
+ if (m === 0) {
+ that.write = q;
+ r = that.inflate_flush(z2, r);
+ q = that.write;
+ m = q < that.read ? that.read - q - 1 : that.end - q;
+ if (q == that.end && that.read !== 0) {
+ q = 0;
+ m = q < that.read ? that.read - q - 1 : that.end - q;
+ }
+ if (m === 0) {
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ }
+ }
+ r = Z_OK2;
+ t = left;
+ if (t > n)
+ t = n;
+ if (t > m)
+ t = m;
+ that.win.set(z2.read_buf(p, t), q);
+ p += t;
+ n -= t;
+ q += t;
+ m -= t;
+ if ((left -= t) !== 0)
+ break;
+ mode2 = last !== 0 ? DRY : TYPE;
+ break;
+ case TABLE:
+ while (k < 14) {
+ if (n !== 0) {
+ r = Z_OK2;
+ } else {
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ n--;
+ b |= (z2.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ table2 = t = b & 16383;
+ if ((t & 31) > 29 || (t >> 5 & 31) > 29) {
+ mode2 = BADBLOCKS;
+ z2.msg = "too many length or distance symbols";
+ r = Z_DATA_ERROR2;
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ t = 258 + (t & 31) + (t >> 5 & 31);
+ if (!blens || blens.length < t) {
+ blens = [];
+ } else {
+ for (i = 0; i < t; i++) {
+ blens[i] = 0;
+ }
+ }
+ b >>>= 14;
+ k -= 14;
+ index = 0;
+ mode2 = BTREE;
+ case BTREE:
+ while (index < 4 + (table2 >>> 10)) {
+ while (k < 3) {
+ if (n !== 0) {
+ r = Z_OK2;
+ } else {
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ n--;
+ b |= (z2.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ blens[border[index++]] = b & 7;
+ b >>>= 3;
+ k -= 3;
+ }
+ while (index < 19) {
+ blens[border[index++]] = 0;
+ }
+ bb[0] = 7;
+ t = inftree.inflate_trees_bits(blens, bb, tb, hufts, z2);
+ if (t != Z_OK2) {
+ r = t;
+ if (r == Z_DATA_ERROR2) {
+ blens = null;
+ mode2 = BADBLOCKS;
+ }
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ index = 0;
+ mode2 = DTREE;
+ case DTREE:
+ while (true) {
+ t = table2;
+ if (index >= 258 + (t & 31) + (t >> 5 & 31)) {
+ break;
+ }
+ let j, c;
+ t = bb[0];
+ while (k < t) {
+ if (n !== 0) {
+ r = Z_OK2;
+ } else {
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ n--;
+ b |= (z2.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ t = hufts[(tb[0] + (b & inflate_mask[t])) * 3 + 1];
+ c = hufts[(tb[0] + (b & inflate_mask[t])) * 3 + 2];
+ if (c < 16) {
+ b >>>= t;
+ k -= t;
+ blens[index++] = c;
+ } else {
+ i = c == 18 ? 7 : c - 14;
+ j = c == 18 ? 11 : 3;
+ while (k < t + i) {
+ if (n !== 0) {
+ r = Z_OK2;
+ } else {
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ n--;
+ b |= (z2.read_byte(p++) & 255) << k;
+ k += 8;
+ }
+ b >>>= t;
+ k -= t;
+ j += b & inflate_mask[i];
+ b >>>= i;
+ k -= i;
+ i = index;
+ t = table2;
+ if (i + j > 258 + (t & 31) + (t >> 5 & 31) || c == 16 && i < 1) {
+ blens = null;
+ mode2 = BADBLOCKS;
+ z2.msg = "invalid bit length repeat";
+ r = Z_DATA_ERROR2;
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ c = c == 16 ? blens[i - 1] : 0;
+ do {
+ blens[i++] = c;
+ } while (--j !== 0);
+ index = i;
+ }
+ }
+ tb[0] = -1;
+ bl_ = [];
+ bd_ = [];
+ tl_ = [];
+ td_ = [];
+ bl_[0] = 9;
+ bd_[0] = 6;
+ t = table2;
+ t = inftree.inflate_trees_dynamic(257 + (t & 31), 1 + (t >> 5 & 31), blens, bl_, bd_, tl_, td_, hufts, z2);
+ if (t != Z_OK2) {
+ if (t == Z_DATA_ERROR2) {
+ blens = null;
+ mode2 = BADBLOCKS;
+ }
+ r = t;
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ codes.init(bl_[0], bd_[0], hufts, tl_[0], hufts, td_[0]);
+ mode2 = CODES;
+ case CODES:
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ if ((r = codes.proc(that, z2, r)) != Z_STREAM_END2) {
+ return that.inflate_flush(z2, r);
+ }
+ r = Z_OK2;
+ codes.free(z2);
+ p = z2.next_in_index;
+ n = z2.avail_in;
+ b = that.bitb;
+ k = that.bitk;
+ q = that.write;
+ m = q < that.read ? that.read - q - 1 : that.end - q;
+ if (last === 0) {
+ mode2 = TYPE;
+ break;
+ }
+ mode2 = DRY;
+ case DRY:
+ that.write = q;
+ r = that.inflate_flush(z2, r);
+ q = that.write;
+ m = q < that.read ? that.read - q - 1 : that.end - q;
+ if (that.read != that.write) {
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ mode2 = DONELOCKS;
+ case DONELOCKS:
+ r = Z_STREAM_END2;
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ case BADBLOCKS:
+ r = Z_DATA_ERROR2;
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ default:
+ r = Z_STREAM_ERROR2;
+ that.bitb = b;
+ that.bitk = k;
+ z2.avail_in = n;
+ z2.total_in += p - z2.next_in_index;
+ z2.next_in_index = p;
+ that.write = q;
+ return that.inflate_flush(z2, r);
+ }
+ }
+ };
+ that.free = function(z2) {
+ that.reset(z2, null);
+ that.win = null;
+ hufts = null;
+ };
+ that.set_dictionary = function(d, start, n) {
+ that.win.set(d.subarray(start, start + n), 0);
+ that.read = that.write = n;
+ };
+ that.sync_point = function() {
+ return mode2 == LENS ? 1 : 0;
+ };
+}
+var PRESET_DICT2 = 32;
+var Z_DEFLATED2 = 8;
+var METHOD = 0;
+var FLAG = 1;
+var DICT4 = 2;
+var DICT3 = 3;
+var DICT2 = 4;
+var DICT1 = 5;
+var DICT0 = 6;
+var BLOCKS = 7;
+var DONE = 12;
+var BAD = 13;
+var mark = [0, 0, 255, 255];
+function Inflate() {
+ const that = this;
+ that.mode = 0;
+ that.method = 0;
+ that.was = [0];
+ that.need = 0;
+ that.marker = 0;
+ that.wbits = 0;
+ function inflateReset(z) {
+ if (!z || !z.istate)
+ return Z_STREAM_ERROR2;
+ z.total_in = z.total_out = 0;
+ z.msg = null;
+ z.istate.mode = BLOCKS;
+ z.istate.blocks.reset(z, null);
+ return Z_OK2;
+ }
+ that.inflateEnd = function(z) {
+ if (that.blocks)
+ that.blocks.free(z);
+ that.blocks = null;
+ return Z_OK2;
+ };
+ that.inflateInit = function(z, w) {
+ z.msg = null;
+ that.blocks = null;
+ if (w < 8 || w > 15) {
+ that.inflateEnd(z);
+ return Z_STREAM_ERROR2;
+ }
+ that.wbits = w;
+ z.istate.blocks = new InfBlocks(z, 1 << w);
+ inflateReset(z);
+ return Z_OK2;
+ };
+ that.inflate = function(z, f) {
+ let r;
+ let b;
+ if (!z || !z.istate || !z.next_in)
+ return Z_STREAM_ERROR2;
+ const istate = z.istate;
+ f = f == Z_FINISH2 ? Z_BUF_ERROR2 : Z_OK2;
+ r = Z_BUF_ERROR2;
+ while (true) {
+ switch (istate.mode) {
+ case METHOD:
+ if (z.avail_in === 0)
+ return r;
+ r = f;
+ z.avail_in--;
+ z.total_in++;
+ if (((istate.method = z.read_byte(z.next_in_index++)) & 15) != Z_DEFLATED2) {
+ istate.mode = BAD;
+ z.msg = "unknown compression method";
+ istate.marker = 5;
+ break;
+ }
+ if ((istate.method >> 4) + 8 > istate.wbits) {
+ istate.mode = BAD;
+ z.msg = "invalid win size";
+ istate.marker = 5;
+ break;
+ }
+ istate.mode = FLAG;
+ case FLAG:
+ if (z.avail_in === 0)
+ return r;
+ r = f;
+ z.avail_in--;
+ z.total_in++;
+ b = z.read_byte(z.next_in_index++) & 255;
+ if (((istate.method << 8) + b) % 31 !== 0) {
+ istate.mode = BAD;
+ z.msg = "incorrect header check";
+ istate.marker = 5;
+ break;
+ }
+ if ((b & PRESET_DICT2) === 0) {
+ istate.mode = BLOCKS;
+ break;
+ }
+ istate.mode = DICT4;
+ case DICT4:
+ if (z.avail_in === 0)
+ return r;
+ r = f;
+ z.avail_in--;
+ z.total_in++;
+ istate.need = (z.read_byte(z.next_in_index++) & 255) << 24 & 4278190080;
+ istate.mode = DICT3;
+ case DICT3:
+ if (z.avail_in === 0)
+ return r;
+ r = f;
+ z.avail_in--;
+ z.total_in++;
+ istate.need += (z.read_byte(z.next_in_index++) & 255) << 16 & 16711680;
+ istate.mode = DICT2;
+ case DICT2:
+ if (z.avail_in === 0)
+ return r;
+ r = f;
+ z.avail_in--;
+ z.total_in++;
+ istate.need += (z.read_byte(z.next_in_index++) & 255) << 8 & 65280;
+ istate.mode = DICT1;
+ case DICT1:
+ if (z.avail_in === 0)
+ return r;
+ r = f;
+ z.avail_in--;
+ z.total_in++;
+ istate.need += z.read_byte(z.next_in_index++) & 255;
+ istate.mode = DICT0;
+ return Z_NEED_DICT2;
+ case DICT0:
+ istate.mode = BAD;
+ z.msg = "need dictionary";
+ istate.marker = 0;
+ return Z_STREAM_ERROR2;
+ case BLOCKS:
+ r = istate.blocks.proc(z, r);
+ if (r == Z_DATA_ERROR2) {
+ istate.mode = BAD;
+ istate.marker = 0;
+ break;
+ }
+ if (r == Z_OK2) {
+ r = f;
+ }
+ if (r != Z_STREAM_END2) {
+ return r;
+ }
+ r = f;
+ istate.blocks.reset(z, istate.was);
+ istate.mode = DONE;
+ case DONE:
+ z.avail_in = 0;
+ return Z_STREAM_END2;
+ case BAD:
+ return Z_DATA_ERROR2;
+ default:
+ return Z_STREAM_ERROR2;
+ }
+ }
+ };
+ that.inflateSetDictionary = function(z, dictionary, dictLength) {
+ let index = 0, length3 = dictLength;
+ if (!z || !z.istate || z.istate.mode != DICT0)
+ return Z_STREAM_ERROR2;
+ const istate = z.istate;
+ if (length3 >= 1 << istate.wbits) {
+ length3 = (1 << istate.wbits) - 1;
+ index = dictLength - length3;
+ }
+ istate.blocks.set_dictionary(dictionary, index, length3);
+ istate.mode = BLOCKS;
+ return Z_OK2;
+ };
+ that.inflateSync = function(z) {
+ let n;
+ let p;
+ let m;
+ let r, w;
+ if (!z || !z.istate)
+ return Z_STREAM_ERROR2;
+ const istate = z.istate;
+ if (istate.mode != BAD) {
+ istate.mode = BAD;
+ istate.marker = 0;
+ }
+ if ((n = z.avail_in) === 0)
+ return Z_BUF_ERROR2;
+ p = z.next_in_index;
+ m = istate.marker;
+ while (n !== 0 && m < 4) {
+ if (z.read_byte(p) == mark[m]) {
+ m++;
+ } else if (z.read_byte(p) !== 0) {
+ m = 0;
+ } else {
+ m = 4 - m;
+ }
+ p++;
+ n--;
+ }
+ z.total_in += p - z.next_in_index;
+ z.next_in_index = p;
+ z.avail_in = n;
+ istate.marker = m;
+ if (m != 4) {
+ return Z_DATA_ERROR2;
+ }
+ r = z.total_in;
+ w = z.total_out;
+ inflateReset(z);
+ z.total_in = r;
+ z.total_out = w;
+ istate.mode = BLOCKS;
+ return Z_OK2;
+ };
+ that.inflateSyncPoint = function(z) {
+ if (!z || !z.istate || !z.istate.blocks)
+ return Z_STREAM_ERROR2;
+ return z.istate.blocks.sync_point();
+ };
+}
+function ZStream2() {
+}
+ZStream2.prototype = {
+ inflateInit: function(bits) {
+ const that = this;
+ that.istate = new Inflate();
+ if (!bits)
+ bits = MAX_BITS2;
+ return that.istate.inflateInit(that, bits);
+ },
+ inflate: function(f) {
+ const that = this;
+ if (!that.istate)
+ return Z_STREAM_ERROR2;
+ return that.istate.inflate(that, f);
+ },
+ inflateEnd: function() {
+ const that = this;
+ if (!that.istate)
+ return Z_STREAM_ERROR2;
+ const ret = that.istate.inflateEnd(that);
+ that.istate = null;
+ return ret;
+ },
+ inflateSync: function() {
+ const that = this;
+ if (!that.istate)
+ return Z_STREAM_ERROR2;
+ return that.istate.inflateSync(that);
+ },
+ inflateSetDictionary: function(dictionary, dictLength) {
+ const that = this;
+ if (!that.istate)
+ return Z_STREAM_ERROR2;
+ return that.istate.inflateSetDictionary(that, dictionary, dictLength);
+ },
+ read_byte: function(start) {
+ const that = this;
+ return that.next_in[start];
+ },
+ read_buf: function(start, size) {
+ const that = this;
+ return that.next_in.subarray(start, start + size);
+ }
+};
+function ZipInflate(options) {
+ const that = this;
+ const z = new ZStream2();
+ const bufsize = options && options.chunkSize ? Math.floor(options.chunkSize * 2) : 128 * 1024;
+ const flush = Z_NO_FLUSH2;
+ const buf = new Uint8Array(bufsize);
+ let nomoreinput = false;
+ z.inflateInit();
+ z.next_out = buf;
+ that.append = function(data, onprogress) {
+ const buffers = [];
+ let err, array, lastIndex = 0, bufferIndex = 0, bufferSize = 0;
+ if (data.length === 0)
+ return;
+ z.next_in_index = 0;
+ z.next_in = data;
+ z.avail_in = data.length;
+ do {
+ z.next_out_index = 0;
+ z.avail_out = bufsize;
+ if (z.avail_in === 0 && !nomoreinput) {
+ z.next_in_index = 0;
+ nomoreinput = true;
+ }
+ err = z.inflate(flush);
+ if (nomoreinput && err === Z_BUF_ERROR2) {
+ if (z.avail_in !== 0)
+ throw new Error("inflating: bad input");
+ } else if (err !== Z_OK2 && err !== Z_STREAM_END2)
+ throw new Error("inflating: " + z.msg);
+ if ((nomoreinput || err === Z_STREAM_END2) && z.avail_in === data.length)
+ throw new Error("inflating: bad input");
+ if (z.next_out_index)
+ if (z.next_out_index === bufsize)
+ buffers.push(new Uint8Array(buf));
+ else
+ buffers.push(buf.slice(0, z.next_out_index));
+ bufferSize += z.next_out_index;
+ if (onprogress && z.next_in_index > 0 && z.next_in_index != lastIndex) {
+ onprogress(z.next_in_index);
+ lastIndex = z.next_in_index;
+ }
+ } while (z.avail_in > 0 || z.avail_out === 0);
+ if (buffers.length > 1) {
+ array = new Uint8Array(bufferSize);
+ buffers.forEach(function(chunk) {
+ array.set(chunk, bufferIndex);
+ bufferIndex += chunk.length;
+ });
+ } else {
+ array = buffers[0] || new Uint8Array(0);
+ }
+ return array;
+ };
+ that.flush = function() {
+ z.inflateEnd();
+ };
+}
+var inflate_default = ZipInflate;
+
+// node_modules/@zip.js/zip.js/lib/core/configuration.js
+var DEFAULT_CONFIGURATION = {
+ chunkSize: 512 * 1024,
+ maxWorkers: typeof navigator != "undefined" && navigator.hardwareConcurrency || 2,
+ terminateWorkerTimeout: 5e3,
+ useWebWorkers: true,
+ workerScripts: void 0
+};
+var config = Object.assign({}, DEFAULT_CONFIGURATION);
+function getConfiguration() {
+ return config;
+}
+function configure(configuration) {
+ if (configuration.baseURL !== void 0) {
+ config.baseURL = configuration.baseURL;
+ }
+ if (configuration.chunkSize !== void 0) {
+ config.chunkSize = configuration.chunkSize;
+ }
+ if (configuration.maxWorkers !== void 0) {
+ config.maxWorkers = configuration.maxWorkers;
+ }
+ if (configuration.terminateWorkerTimeout !== void 0) {
+ config.terminateWorkerTimeout = configuration.terminateWorkerTimeout;
+ }
+ if (configuration.useWebWorkers !== void 0) {
+ config.useWebWorkers = configuration.useWebWorkers;
+ }
+ if (configuration.Deflate !== void 0) {
+ config.Deflate = configuration.Deflate;
+ }
+ if (configuration.Inflate !== void 0) {
+ config.Inflate = configuration.Inflate;
+ }
+ if (configuration.workerScripts !== void 0) {
+ if (configuration.workerScripts.deflate) {
+ if (!Array.isArray(configuration.workerScripts.deflate)) {
+ throw new Error("workerScripts.deflate must be an array");
+ }
+ if (!config.workerScripts) {
+ config.workerScripts = {};
+ }
+ config.workerScripts.deflate = configuration.workerScripts.deflate;
+ }
+ if (configuration.workerScripts.inflate) {
+ if (!Array.isArray(configuration.workerScripts.inflate)) {
+ throw new Error("workerScripts.inflate must be an array");
+ }
+ if (!config.workerScripts) {
+ config.workerScripts = {};
+ }
+ config.workerScripts.inflate = configuration.workerScripts.inflate;
+ }
+ }
+}
+
+// node_modules/@zip.js/zip.js/lib/core/codecs/crc32.js
+var table = [];
+for (let i = 0; i < 256; i++) {
+ let t = i;
+ for (let j = 0; j < 8; j++) {
+ if (t & 1) {
+ t = t >>> 1 ^ 3988292384;
+ } else {
+ t = t >>> 1;
+ }
+ }
+ table[i] = t;
+}
+var Crc32 = class {
+ constructor(crc) {
+ this.crc = crc || -1;
+ }
+ append(data) {
+ let crc = this.crc | 0;
+ for (let offset2 = 0, length3 = data.length | 0; offset2 < length3; offset2++) {
+ crc = crc >>> 8 ^ table[(crc ^ data[offset2]) & 255];
+ }
+ this.crc = crc;
+ }
+ get() {
+ return ~this.crc;
+ }
+};
+var crc32_default = Crc32;
+
+// node_modules/@zip.js/zip.js/lib/core/util/encode-text.js
+var encode_text_default = encodeText;
+function encodeText(value) {
+ if (typeof TextEncoder == "undefined") {
+ value = unescape(encodeURIComponent(value));
+ const result = new Uint8Array(value.length);
+ for (let i = 0; i < result.length; i++) {
+ result[i] = value.charCodeAt(i);
+ }
+ return result;
+ } else {
+ return new TextEncoder().encode(value);
+ }
+}
+
+// node_modules/@zip.js/zip.js/lib/core/codecs/sjcl.js
+var bitArray = {
+ concat(a1, a22) {
+ if (a1.length === 0 || a22.length === 0) {
+ return a1.concat(a22);
+ }
+ const last = a1[a1.length - 1], shift = bitArray.getPartial(last);
+ if (shift === 32) {
+ return a1.concat(a22);
+ } else {
+ return bitArray._shiftRight(a22, shift, last | 0, a1.slice(0, a1.length - 1));
+ }
+ },
+ bitLength(a3) {
+ const l = a3.length;
+ if (l === 0) {
+ return 0;
+ }
+ const x = a3[l - 1];
+ return (l - 1) * 32 + bitArray.getPartial(x);
+ },
+ clamp(a3, len) {
+ if (a3.length * 32 < len) {
+ return a3;
+ }
+ a3 = a3.slice(0, Math.ceil(len / 32));
+ const l = a3.length;
+ len = len & 31;
+ if (l > 0 && len) {
+ a3[l - 1] = bitArray.partial(len, a3[l - 1] & 2147483648 >> len - 1, 1);
+ }
+ return a3;
+ },
+ partial(len, x, _end) {
+ if (len === 32) {
+ return x;
+ }
+ return (_end ? x | 0 : x << 32 - len) + len * 1099511627776;
+ },
+ getPartial(x) {
+ return Math.round(x / 1099511627776) || 32;
+ },
+ _shiftRight(a3, shift, carry, out) {
+ if (out === void 0) {
+ out = [];
+ }
+ for (; shift >= 32; shift -= 32) {
+ out.push(carry);
+ carry = 0;
+ }
+ if (shift === 0) {
+ return out.concat(a3);
+ }
+ for (let i = 0; i < a3.length; i++) {
+ out.push(carry | a3[i] >>> shift);
+ carry = a3[i] << 32 - shift;
+ }
+ const last2 = a3.length ? a3[a3.length - 1] : 0;
+ const shift2 = bitArray.getPartial(last2);
+ out.push(bitArray.partial(shift + shift2 & 31, shift + shift2 > 32 ? carry : out.pop(), 1));
+ return out;
+ }
+};
+var codec = {
+ bytes: {
+ fromBits(arr) {
+ const bl = bitArray.bitLength(arr);
+ const byteLength = bl / 8;
+ const out = new Uint8Array(byteLength);
+ let tmp2;
+ for (let i = 0; i < byteLength; i++) {
+ if ((i & 3) === 0) {
+ tmp2 = arr[i / 4];
+ }
+ out[i] = tmp2 >>> 24;
+ tmp2 <<= 8;
+ }
+ return out;
+ },
+ toBits(bytes) {
+ const out = [];
+ let i;
+ let tmp2 = 0;
+ for (i = 0; i < bytes.length; i++) {
+ tmp2 = tmp2 << 8 | bytes[i];
+ if ((i & 3) === 3) {
+ out.push(tmp2);
+ tmp2 = 0;
+ }
+ }
+ if (i & 3) {
+ out.push(bitArray.partial(8 * (i & 3), tmp2));
+ }
+ return out;
+ }
+ }
+};
+var hash = {};
+hash.sha1 = function(hash2) {
+ if (hash2) {
+ this._h = hash2._h.slice(0);
+ this._buffer = hash2._buffer.slice(0);
+ this._length = hash2._length;
+ } else {
+ this.reset();
+ }
+};
+hash.sha1.prototype = {
+ blockSize: 512,
+ reset: function() {
+ const sha1 = this;
+ sha1._h = this._init.slice(0);
+ sha1._buffer = [];
+ sha1._length = 0;
+ return sha1;
+ },
+ update: function(data) {
+ const sha1 = this;
+ if (typeof data === "string") {
+ data = codec.utf8String.toBits(data);
+ }
+ const b = sha1._buffer = bitArray.concat(sha1._buffer, data);
+ const ol = sha1._length;
+ const nl = sha1._length = ol + bitArray.bitLength(data);
+ if (nl > 9007199254740991) {
+ throw new Error("Cannot hash more than 2^53 - 1 bits");
+ }
+ const c = new Uint32Array(b);
+ let j = 0;
+ for (let i = sha1.blockSize + ol - (sha1.blockSize + ol & sha1.blockSize - 1); i <= nl; i += sha1.blockSize) {
+ sha1._block(c.subarray(16 * j, 16 * (j + 1)));
+ j += 1;
+ }
+ b.splice(0, 16 * j);
+ return sha1;
+ },
+ finalize: function() {
+ const sha1 = this;
+ let b = sha1._buffer;
+ const h = sha1._h;
+ b = bitArray.concat(b, [bitArray.partial(1, 1)]);
+ for (let i = b.length + 2; i & 15; i++) {
+ b.push(0);
+ }
+ b.push(Math.floor(sha1._length / 4294967296));
+ b.push(sha1._length | 0);
+ while (b.length) {
+ sha1._block(b.splice(0, 16));
+ }
+ sha1.reset();
+ return h;
+ },
+ _init: [1732584193, 4023233417, 2562383102, 271733878, 3285377520],
+ _key: [1518500249, 1859775393, 2400959708, 3395469782],
+ _f: function(t, b, c, d) {
+ if (t <= 19) {
+ return b & c | ~b & d;
+ } else if (t <= 39) {
+ return b ^ c ^ d;
+ } else if (t <= 59) {
+ return b & c | b & d | c & d;
+ } else if (t <= 79) {
+ return b ^ c ^ d;
+ }
+ },
+ _S: function(n, x) {
+ return x << n | x >>> 32 - n;
+ },
+ _block: function(words) {
+ const sha1 = this;
+ const h = sha1._h;
+ const w = Array(80);
+ for (let j = 0; j < 16; j++) {
+ w[j] = words[j];
+ }
+ let a3 = h[0];
+ let b = h[1];
+ let c = h[2];
+ let d = h[3];
+ let e = h[4];
+ for (let t = 0; t <= 79; t++) {
+ if (t >= 16) {
+ w[t] = sha1._S(1, w[t - 3] ^ w[t - 8] ^ w[t - 14] ^ w[t - 16]);
+ }
+ const tmp2 = sha1._S(5, a3) + sha1._f(t, b, c, d) + e + w[t] + sha1._key[Math.floor(t / 20)] | 0;
+ e = d;
+ d = c;
+ c = sha1._S(30, b);
+ b = a3;
+ a3 = tmp2;
+ }
+ h[0] = h[0] + a3 | 0;
+ h[1] = h[1] + b | 0;
+ h[2] = h[2] + c | 0;
+ h[3] = h[3] + d | 0;
+ h[4] = h[4] + e | 0;
+ }
+};
+var cipher = {};
+cipher.aes = class {
+ constructor(key) {
+ const aes = this;
+ aes._tables = [[[], [], [], [], []], [[], [], [], [], []]];
+ if (!aes._tables[0][0][0]) {
+ aes._precompute();
+ }
+ const sbox = aes._tables[0][4];
+ const decTable = aes._tables[1];
+ const keyLen = key.length;
+ let i, encKey, decKey, rcon = 1;
+ if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {
+ throw new Error("invalid aes key size");
+ }
+ aes._key = [encKey = key.slice(0), decKey = []];
+ for (i = keyLen; i < 4 * keyLen + 28; i++) {
+ let tmp2 = encKey[i - 1];
+ if (i % keyLen === 0 || keyLen === 8 && i % keyLen === 4) {
+ tmp2 = sbox[tmp2 >>> 24] << 24 ^ sbox[tmp2 >> 16 & 255] << 16 ^ sbox[tmp2 >> 8 & 255] << 8 ^ sbox[tmp2 & 255];
+ if (i % keyLen === 0) {
+ tmp2 = tmp2 << 8 ^ tmp2 >>> 24 ^ rcon << 24;
+ rcon = rcon << 1 ^ (rcon >> 7) * 283;
+ }
+ }
+ encKey[i] = encKey[i - keyLen] ^ tmp2;
+ }
+ for (let j = 0; i; j++, i--) {
+ const tmp2 = encKey[j & 3 ? i : i - 4];
+ if (i <= 4 || j < 4) {
+ decKey[j] = tmp2;
+ } else {
+ decKey[j] = decTable[0][sbox[tmp2 >>> 24]] ^ decTable[1][sbox[tmp2 >> 16 & 255]] ^ decTable[2][sbox[tmp2 >> 8 & 255]] ^ decTable[3][sbox[tmp2 & 255]];
+ }
+ }
+ }
+ encrypt(data) {
+ return this._crypt(data, 0);
+ }
+ decrypt(data) {
+ return this._crypt(data, 1);
+ }
+ _precompute() {
+ const encTable = this._tables[0];
+ const decTable = this._tables[1];
+ const sbox = encTable[4];
+ const sboxInv = decTable[4];
+ const d = [];
+ const th = [];
+ let xInv, x2, x4, x8;
+ for (let i = 0; i < 256; i++) {
+ th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;
+ }
+ for (let x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {
+ let s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;
+ s = s >> 8 ^ s & 255 ^ 99;
+ sbox[x] = s;
+ sboxInv[s] = x;
+ x8 = d[x4 = d[x2 = d[x]]];
+ let tDec = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
+ let tEnc = d[s] * 257 ^ s * 16843008;
+ for (let i = 0; i < 4; i++) {
+ encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;
+ decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;
+ }
+ }
+ for (let i = 0; i < 5; i++) {
+ encTable[i] = encTable[i].slice(0);
+ decTable[i] = decTable[i].slice(0);
+ }
+ }
+ _crypt(input, dir) {
+ if (input.length !== 4) {
+ throw new Error("invalid aes block size");
+ }
+ const key = this._key[dir];
+ const nInnerRounds = key.length / 4 - 2;
+ const out = [0, 0, 0, 0];
+ const table2 = this._tables[dir];
+ const t0 = table2[0];
+ const t1 = table2[1];
+ const t2 = table2[2];
+ const t3 = table2[3];
+ const sbox = table2[4];
+ let a3 = input[0] ^ key[0];
+ let b = input[dir ? 3 : 1] ^ key[1];
+ let c = input[2] ^ key[2];
+ let d = input[dir ? 1 : 3] ^ key[3];
+ let kIndex = 4;
+ let a22, b2, c22;
+ for (let i = 0; i < nInnerRounds; i++) {
+ a22 = t0[a3 >>> 24] ^ t1[b >> 16 & 255] ^ t2[c >> 8 & 255] ^ t3[d & 255] ^ key[kIndex];
+ b2 = t0[b >>> 24] ^ t1[c >> 16 & 255] ^ t2[d >> 8 & 255] ^ t3[a3 & 255] ^ key[kIndex + 1];
+ c22 = t0[c >>> 24] ^ t1[d >> 16 & 255] ^ t2[a3 >> 8 & 255] ^ t3[b & 255] ^ key[kIndex + 2];
+ d = t0[d >>> 24] ^ t1[a3 >> 16 & 255] ^ t2[b >> 8 & 255] ^ t3[c & 255] ^ key[kIndex + 3];
+ kIndex += 4;
+ a3 = a22;
+ b = b2;
+ c = c22;
+ }
+ for (let i = 0; i < 4; i++) {
+ out[dir ? 3 & -i : i] = sbox[a3 >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d & 255] ^ key[kIndex++];
+ a22 = a3;
+ a3 = b;
+ b = c;
+ c = d;
+ d = a22;
+ }
+ return out;
+ }
+};
+var random = {
+ getRandomValues(typedArray) {
+ const words = new Uint32Array(typedArray.buffer);
+ const r = (m_w) => {
+ let m_z = 987654321;
+ const mask = 4294967295;
+ return function() {
+ m_z = 36969 * (m_z & 65535) + (m_z >> 16) & mask;
+ m_w = 18e3 * (m_w & 65535) + (m_w >> 16) & mask;
+ const result = ((m_z << 16) + m_w & mask) / 4294967296 + 0.5;
+ return result * (Math.random() > 0.5 ? 1 : -1);
+ };
+ };
+ for (let i = 0, rcache; i < typedArray.length; i += 4) {
+ const _r = r((rcache || Math.random()) * 4294967296);
+ rcache = _r() * 987654071;
+ words[i / 4] = _r() * 4294967296 | 0;
+ }
+ return typedArray;
+ }
+};
+var mode = {};
+mode.ctrGladman = class {
+ constructor(prf, iv) {
+ this._prf = prf;
+ this._initIv = iv;
+ this._iv = iv;
+ }
+ reset() {
+ this._iv = this._initIv;
+ }
+ update(data) {
+ return this.calculate(this._prf, data, this._iv);
+ }
+ incWord(word) {
+ if ((word >> 24 & 255) === 255) {
+ let b1 = word >> 16 & 255;
+ let b2 = word >> 8 & 255;
+ let b3 = word & 255;
+ if (b1 === 255) {
+ b1 = 0;
+ if (b2 === 255) {
+ b2 = 0;
+ if (b3 === 255) {
+ b3 = 0;
+ } else {
+ ++b3;
+ }
+ } else {
+ ++b2;
+ }
+ } else {
+ ++b1;
+ }
+ word = 0;
+ word += b1 << 16;
+ word += b2 << 8;
+ word += b3;
+ } else {
+ word += 1 << 24;
+ }
+ return word;
+ }
+ incCounter(counter) {
+ if ((counter[0] = this.incWord(counter[0])) === 0) {
+ counter[1] = this.incWord(counter[1]);
+ }
+ }
+ calculate(prf, data, iv) {
+ let l;
+ if (!(l = data.length)) {
+ return [];
+ }
+ const bl = bitArray.bitLength(data);
+ for (let i = 0; i < l; i += 4) {
+ this.incCounter(iv);
+ const e = prf.encrypt(iv);
+ data[i] ^= e[0];
+ data[i + 1] ^= e[1];
+ data[i + 2] ^= e[2];
+ data[i + 3] ^= e[3];
+ }
+ return bitArray.clamp(data, bl);
+ }
+};
+var misc = {
+ importKey(password) {
+ return new misc.hmacSha1(codec.bytes.toBits(password));
+ },
+ pbkdf2(prf, salt, count, length3) {
+ count = count || 1e4;
+ if (length3 < 0 || count < 0) {
+ throw new Error("invalid params to pbkdf2");
+ }
+ const byteLength = (length3 >> 5) + 1 << 2;
+ let u3, ui, i, j, k;
+ const arrayBuffer = new ArrayBuffer(byteLength);
+ const out = new DataView(arrayBuffer);
+ let outLength = 0;
+ const b = bitArray;
+ salt = codec.bytes.toBits(salt);
+ for (k = 1; outLength < (byteLength || 1); k++) {
+ u3 = ui = prf.encrypt(b.concat(salt, [k]));
+ for (i = 1; i < count; i++) {
+ ui = prf.encrypt(ui);
+ for (j = 0; j < ui.length; j++) {
+ u3[j] ^= ui[j];
+ }
+ }
+ for (i = 0; outLength < (byteLength || 1) && i < u3.length; i++) {
+ out.setInt32(outLength, u3[i]);
+ outLength += 4;
+ }
+ }
+ return arrayBuffer.slice(0, length3 / 8);
+ }
+};
+misc.hmacSha1 = class {
+ constructor(key) {
+ const hmac = this;
+ const Hash = hmac._hash = hash.sha1;
+ const exKey = [[], []];
+ const bs = Hash.prototype.blockSize / 32;
+ hmac._baseHash = [new Hash(), new Hash()];
+ if (key.length > bs) {
+ key = Hash.hash(key);
+ }
+ for (let i = 0; i < bs; i++) {
+ exKey[0][i] = key[i] ^ 909522486;
+ exKey[1][i] = key[i] ^ 1549556828;
+ }
+ hmac._baseHash[0].update(exKey[0]);
+ hmac._baseHash[1].update(exKey[1]);
+ hmac._resultHash = new Hash(hmac._baseHash[0]);
+ }
+ reset() {
+ const hmac = this;
+ hmac._resultHash = new hmac._hash(hmac._baseHash[0]);
+ hmac._updated = false;
+ }
+ update(data) {
+ const hmac = this;
+ hmac._updated = true;
+ hmac._resultHash.update(data);
+ }
+ digest() {
+ const hmac = this;
+ const w = hmac._resultHash.finalize();
+ const result = new hmac._hash(hmac._baseHash[1]).update(w).finalize();
+ hmac.reset();
+ return result;
+ }
+ encrypt(data) {
+ if (!this._updated) {
+ this.update(data);
+ return this.digest(data);
+ } else {
+ throw new Error("encrypt on already updated hmac called!");
+ }
+ }
+};
+
+// node_modules/@zip.js/zip.js/lib/core/codecs/aes-crypto.js
+var ERR_INVALID_PASSWORD = "Invalid pasword";
+var BLOCK_LENGTH = 16;
+var RAW_FORMAT = "raw";
+var PBKDF2_ALGORITHM = { name: "PBKDF2" };
+var HASH_ALGORITHM = { name: "HMAC" };
+var HASH_FUNCTION = "SHA-1";
+var BASE_KEY_ALGORITHM = Object.assign({ hash: HASH_ALGORITHM }, PBKDF2_ALGORITHM);
+var DERIVED_BITS_ALGORITHM = Object.assign({ iterations: 1e3, hash: { name: HASH_FUNCTION } }, PBKDF2_ALGORITHM);
+var DERIVED_BITS_USAGE = ["deriveBits"];
+var SALT_LENGTH = [8, 12, 16];
+var KEY_LENGTH = [16, 24, 32];
+var SIGNATURE_LENGTH = 10;
+var COUNTER_DEFAULT_VALUE = [0, 0, 0, 0];
+var CRYPTO_API_SUPPORTED = typeof crypto != "undefined";
+var SUBTLE_API_SUPPORTED = CRYPTO_API_SUPPORTED && typeof crypto.subtle != "undefined";
+var codecBytes = codec.bytes;
+var Aes = cipher.aes;
+var CtrGladman = mode.ctrGladman;
+var HmacSha1 = misc.hmacSha1;
+var AESDecrypt = class {
+ constructor(password, signed, strength) {
+ Object.assign(this, {
+ password,
+ signed,
+ strength: strength - 1,
+ pendingInput: new Uint8Array(0)
+ });
+ }
+ async append(input) {
+ const aesCrypto = this;
+ if (aesCrypto.password) {
+ const preamble = subarray(input, 0, SALT_LENGTH[aesCrypto.strength] + 2);
+ await createDecryptionKeys(aesCrypto, preamble, aesCrypto.password);
+ aesCrypto.password = null;
+ aesCrypto.aesCtrGladman = new CtrGladman(new Aes(aesCrypto.keys.key), Array.from(COUNTER_DEFAULT_VALUE));
+ aesCrypto.hmac = new HmacSha1(aesCrypto.keys.authentication);
+ input = subarray(input, SALT_LENGTH[aesCrypto.strength] + 2);
+ }
+ const output = new Uint8Array(input.length - SIGNATURE_LENGTH - (input.length - SIGNATURE_LENGTH) % BLOCK_LENGTH);
+ return append(aesCrypto, input, output, 0, SIGNATURE_LENGTH, true);
+ }
+ flush() {
+ const aesCrypto = this;
+ const pendingInput = aesCrypto.pendingInput;
+ const chunkToDecrypt = subarray(pendingInput, 0, pendingInput.length - SIGNATURE_LENGTH);
+ const originalSignature = subarray(pendingInput, pendingInput.length - SIGNATURE_LENGTH);
+ let decryptedChunkArray = new Uint8Array(0);
+ if (chunkToDecrypt.length) {
+ const encryptedChunk = codecBytes.toBits(chunkToDecrypt);
+ aesCrypto.hmac.update(encryptedChunk);
+ const decryptedChunk = aesCrypto.aesCtrGladman.update(encryptedChunk);
+ decryptedChunkArray = codecBytes.fromBits(decryptedChunk);
+ }
+ let valid = true;
+ if (aesCrypto.signed) {
+ const signature = subarray(codecBytes.fromBits(aesCrypto.hmac.digest()), 0, SIGNATURE_LENGTH);
+ for (let indexSignature = 0; indexSignature < SIGNATURE_LENGTH; indexSignature++) {
+ if (signature[indexSignature] != originalSignature[indexSignature]) {
+ valid = false;
+ }
+ }
+ }
+ return {
+ valid,
+ data: decryptedChunkArray
+ };
+ }
+};
+var AESEncrypt = class {
+ constructor(password, strength) {
+ Object.assign(this, {
+ password,
+ strength: strength - 1,
+ pendingInput: new Uint8Array(0)
+ });
+ }
+ async append(input) {
+ const aesCrypto = this;
+ let preamble = new Uint8Array(0);
+ if (aesCrypto.password) {
+ preamble = await createEncryptionKeys(aesCrypto, aesCrypto.password);
+ aesCrypto.password = null;
+ aesCrypto.aesCtrGladman = new CtrGladman(new Aes(aesCrypto.keys.key), Array.from(COUNTER_DEFAULT_VALUE));
+ aesCrypto.hmac = new HmacSha1(aesCrypto.keys.authentication);
+ }
+ const output = new Uint8Array(preamble.length + input.length - input.length % BLOCK_LENGTH);
+ output.set(preamble, 0);
+ return append(aesCrypto, input, output, preamble.length, 0);
+ }
+ flush() {
+ const aesCrypto = this;
+ let encryptedChunkArray = new Uint8Array(0);
+ if (aesCrypto.pendingInput.length) {
+ const encryptedChunk = aesCrypto.aesCtrGladman.update(codecBytes.toBits(aesCrypto.pendingInput));
+ aesCrypto.hmac.update(encryptedChunk);
+ encryptedChunkArray = codecBytes.fromBits(encryptedChunk);
+ }
+ const signature = subarray(codecBytes.fromBits(aesCrypto.hmac.digest()), 0, SIGNATURE_LENGTH);
+ return {
+ data: concat(encryptedChunkArray, signature),
+ signature
+ };
+ }
+};
+function append(aesCrypto, input, output, paddingStart, paddingEnd, verifySignature) {
+ const inputLength = input.length - paddingEnd;
+ if (aesCrypto.pendingInput.length) {
+ input = concat(aesCrypto.pendingInput, input);
+ output = expand(output, inputLength - inputLength % BLOCK_LENGTH);
+ }
+ let offset2;
+ for (offset2 = 0; offset2 <= inputLength - BLOCK_LENGTH; offset2 += BLOCK_LENGTH) {
+ const inputChunk = codecBytes.toBits(subarray(input, offset2, offset2 + BLOCK_LENGTH));
+ if (verifySignature) {
+ aesCrypto.hmac.update(inputChunk);
+ }
+ const outputChunk = aesCrypto.aesCtrGladman.update(inputChunk);
+ if (!verifySignature) {
+ aesCrypto.hmac.update(outputChunk);
+ }
+ output.set(codecBytes.fromBits(outputChunk), offset2 + paddingStart);
+ }
+ aesCrypto.pendingInput = subarray(input, offset2);
+ return output;
+}
+async function createDecryptionKeys(decrypt2, preambleArray, password) {
+ await createKeys(decrypt2, password, subarray(preambleArray, 0, SALT_LENGTH[decrypt2.strength]));
+ const passwordVerification = subarray(preambleArray, SALT_LENGTH[decrypt2.strength]);
+ const passwordVerificationKey = decrypt2.keys.passwordVerification;
+ if (passwordVerificationKey[0] != passwordVerification[0] || passwordVerificationKey[1] != passwordVerification[1]) {
+ throw new Error(ERR_INVALID_PASSWORD);
+ }
+}
+async function createEncryptionKeys(encrypt2, password) {
+ const salt = getRandomValues2(new Uint8Array(SALT_LENGTH[encrypt2.strength]));
+ await createKeys(encrypt2, password, salt);
+ return concat(salt, encrypt2.keys.passwordVerification);
+}
+async function createKeys(target, password, salt) {
+ const encodedPassword = encode_text_default(password);
+ const basekey = await importKey(RAW_FORMAT, encodedPassword, BASE_KEY_ALGORITHM, false, DERIVED_BITS_USAGE);
+ const derivedBits = await deriveBits(Object.assign({ salt }, DERIVED_BITS_ALGORITHM), basekey, 8 * (KEY_LENGTH[target.strength] * 2 + 2));
+ const compositeKey = new Uint8Array(derivedBits);
+ target.keys = {
+ key: codecBytes.toBits(subarray(compositeKey, 0, KEY_LENGTH[target.strength])),
+ authentication: codecBytes.toBits(subarray(compositeKey, KEY_LENGTH[target.strength], KEY_LENGTH[target.strength] * 2)),
+ passwordVerification: subarray(compositeKey, KEY_LENGTH[target.strength] * 2)
+ };
+}
+function getRandomValues2(array) {
+ if (CRYPTO_API_SUPPORTED && typeof crypto.getRandomValues == "function") {
+ return crypto.getRandomValues(array);
+ } else {
+ return random.getRandomValues(array);
+ }
+}
+function importKey(format, password, algorithm, extractable, keyUsages) {
+ if (CRYPTO_API_SUPPORTED && SUBTLE_API_SUPPORTED && typeof crypto.subtle.importKey == "function") {
+ return crypto.subtle.importKey(format, password, algorithm, extractable, keyUsages);
+ } else {
+ return misc.importKey(password);
+ }
+}
+async function deriveBits(algorithm, baseKey, length3) {
+ if (CRYPTO_API_SUPPORTED && SUBTLE_API_SUPPORTED && typeof crypto.subtle.deriveBits == "function") {
+ return await crypto.subtle.deriveBits(algorithm, baseKey, length3);
+ } else {
+ return misc.pbkdf2(baseKey, algorithm.salt, DERIVED_BITS_ALGORITHM.iterations, length3);
+ }
+}
+function concat(leftArray, rightArray) {
+ let array = leftArray;
+ if (leftArray.length + rightArray.length) {
+ array = new Uint8Array(leftArray.length + rightArray.length);
+ array.set(leftArray, 0);
+ array.set(rightArray, leftArray.length);
+ }
+ return array;
+}
+function expand(inputArray, length3) {
+ if (length3 && length3 > inputArray.length) {
+ const array = inputArray;
+ inputArray = new Uint8Array(length3);
+ inputArray.set(array, 0);
+ }
+ return inputArray;
+}
+function subarray(array, begin, end) {
+ return array.subarray(begin, end);
+}
+
+// node_modules/@zip.js/zip.js/lib/core/codecs/zip-crypto.js
+var HEADER_LENGTH = 12;
+var ZipCryptoDecrypt = class {
+ constructor(password, passwordVerification) {
+ const zipCrypto = this;
+ Object.assign(zipCrypto, {
+ password,
+ passwordVerification
+ });
+ createKeys2(zipCrypto, password);
+ }
+ append(input) {
+ const zipCrypto = this;
+ if (zipCrypto.password) {
+ const decryptedHeader = decrypt(zipCrypto, input.subarray(0, HEADER_LENGTH));
+ zipCrypto.password = null;
+ if (decryptedHeader[HEADER_LENGTH - 1] != zipCrypto.passwordVerification) {
+ throw new Error(ERR_INVALID_PASSWORD);
+ }
+ input = input.subarray(HEADER_LENGTH);
+ }
+ return decrypt(zipCrypto, input);
+ }
+ flush() {
+ return {
+ valid: true,
+ data: new Uint8Array(0)
+ };
+ }
+};
+var ZipCryptoEncrypt = class {
+ constructor(password, passwordVerification) {
+ const zipCrypto = this;
+ Object.assign(zipCrypto, {
+ password,
+ passwordVerification
+ });
+ createKeys2(zipCrypto, password);
+ }
+ append(input) {
+ const zipCrypto = this;
+ let output;
+ let offset2;
+ if (zipCrypto.password) {
+ zipCrypto.password = null;
+ const header = crypto.getRandomValues(new Uint8Array(HEADER_LENGTH));
+ header[HEADER_LENGTH - 1] = zipCrypto.passwordVerification;
+ output = new Uint8Array(input.length + header.length);
+ output.set(encrypt(zipCrypto, header), 0);
+ offset2 = HEADER_LENGTH;
+ } else {
+ output = new Uint8Array(input.length);
+ offset2 = 0;
+ }
+ output.set(encrypt(zipCrypto, input), offset2);
+ return output;
+ }
+ flush() {
+ return {
+ data: new Uint8Array(0)
+ };
+ }
+};
+function decrypt(target, input) {
+ const output = new Uint8Array(input.length);
+ for (let index = 0; index < input.length; index++) {
+ output[index] = getByte(target) ^ input[index];
+ updateKeys(target, output[index]);
+ }
+ return output;
+}
+function encrypt(target, input) {
+ const output = new Uint8Array(input.length);
+ for (let index = 0; index < input.length; index++) {
+ output[index] = getByte(target) ^ input[index];
+ updateKeys(target, input[index]);
+ }
+ return output;
+}
+function createKeys2(target, password) {
+ target.keys = [305419896, 591751049, 878082192];
+ target.crcKey0 = new crc32_default(target.keys[0]);
+ target.crcKey2 = new crc32_default(target.keys[2]);
+ for (let index = 0; index < password.length; index++) {
+ updateKeys(target, password.charCodeAt(index));
+ }
+}
+function updateKeys(target, byte) {
+ target.crcKey0.append([byte]);
+ target.keys[0] = ~target.crcKey0.get();
+ target.keys[1] = getInt32(target.keys[1] + getInt8(target.keys[0]));
+ target.keys[1] = getInt32(Math.imul(target.keys[1], 134775813) + 1);
+ target.crcKey2.append([target.keys[1] >>> 24]);
+ target.keys[2] = ~target.crcKey2.get();
+}
+function getByte(target) {
+ const temp = target.keys[2] | 2;
+ return getInt8(Math.imul(temp, temp ^ 1) >>> 8);
+}
+function getInt8(number) {
+ return number & 255;
+}
+function getInt32(number) {
+ return number & 4294967295;
+}
+
+// node_modules/@zip.js/zip.js/lib/core/codecs/codec.js
+var CODEC_DEFLATE = "deflate";
+var CODEC_INFLATE = "inflate";
+var ERR_INVALID_SIGNATURE = "Invalid signature";
+var Inflate2 = class {
+ constructor(codecConstructor, {
+ signature,
+ password,
+ signed,
+ compressed,
+ zipCrypto,
+ passwordVerification,
+ encryptionStrength
+ }, { chunkSize }) {
+ const encrypted = Boolean(password);
+ Object.assign(this, {
+ signature,
+ encrypted,
+ signed,
+ compressed,
+ inflate: compressed && new codecConstructor({ chunkSize }),
+ crc32: signed && new crc32_default(),
+ zipCrypto,
+ decrypt: encrypted && zipCrypto ? new ZipCryptoDecrypt(password, passwordVerification) : new AESDecrypt(password, signed, encryptionStrength)
+ });
+ }
+ async append(data) {
+ const codec2 = this;
+ if (codec2.encrypted && data.length) {
+ data = await codec2.decrypt.append(data);
+ }
+ if (codec2.compressed && data.length) {
+ data = await codec2.inflate.append(data);
+ }
+ if ((!codec2.encrypted || codec2.zipCrypto) && codec2.signed && data.length) {
+ codec2.crc32.append(data);
+ }
+ return data;
+ }
+ async flush() {
+ const codec2 = this;
+ let signature;
+ let data = new Uint8Array(0);
+ if (codec2.encrypted) {
+ const result = codec2.decrypt.flush();
+ if (!result.valid) {
+ throw new Error(ERR_INVALID_SIGNATURE);
+ }
+ data = result.data;
+ }
+ if ((!codec2.encrypted || codec2.zipCrypto) && codec2.signed) {
+ const dataViewSignature = new DataView(new Uint8Array(4).buffer);
+ signature = codec2.crc32.get();
+ dataViewSignature.setUint32(0, signature);
+ if (codec2.signature != dataViewSignature.getUint32(0, false)) {
+ throw new Error(ERR_INVALID_SIGNATURE);
+ }
+ }
+ if (codec2.compressed) {
+ data = await codec2.inflate.append(data) || new Uint8Array(0);
+ await codec2.inflate.flush();
+ }
+ return { data, signature };
+ }
+};
+var Deflate2 = class {
+ constructor(codecConstructor, {
+ encrypted,
+ signed,
+ compressed,
+ level,
+ zipCrypto,
+ password,
+ passwordVerification,
+ encryptionStrength
+ }, { chunkSize }) {
+ Object.assign(this, {
+ encrypted,
+ signed,
+ compressed,
+ deflate: compressed && new codecConstructor({ level: level || 5, chunkSize }),
+ crc32: signed && new crc32_default(),
+ zipCrypto,
+ encrypt: encrypted && zipCrypto ? new ZipCryptoEncrypt(password, passwordVerification) : new AESEncrypt(password, encryptionStrength)
+ });
+ }
+ async append(inputData) {
+ const codec2 = this;
+ let data = inputData;
+ if (codec2.compressed && inputData.length) {
+ data = await codec2.deflate.append(inputData);
+ }
+ if (codec2.encrypted && data.length) {
+ data = await codec2.encrypt.append(data);
+ }
+ if ((!codec2.encrypted || codec2.zipCrypto) && codec2.signed && inputData.length) {
+ codec2.crc32.append(inputData);
+ }
+ return data;
+ }
+ async flush() {
+ const codec2 = this;
+ let signature;
+ let data = new Uint8Array(0);
+ if (codec2.compressed) {
+ data = await codec2.deflate.flush() || new Uint8Array(0);
+ }
+ if (codec2.encrypted) {
+ data = await codec2.encrypt.append(data);
+ const result = codec2.encrypt.flush();
+ signature = result.signature;
+ const newData = new Uint8Array(data.length + result.data.length);
+ newData.set(data, 0);
+ newData.set(result.data, data.length);
+ data = newData;
+ }
+ if ((!codec2.encrypted || codec2.zipCrypto) && codec2.signed) {
+ signature = codec2.crc32.get();
+ }
+ return { data, signature };
+ }
+};
+function createCodec(codecConstructor, options, config2) {
+ if (options.codecType.startsWith(CODEC_DEFLATE)) {
+ return new Deflate2(codecConstructor, options, config2);
+ } else if (options.codecType.startsWith(CODEC_INFLATE)) {
+ return new Inflate2(codecConstructor, options, config2);
+ }
+}
+
+// node_modules/@zip.js/zip.js/lib/core/codecs/codec-pool-worker.js
+var MESSAGE_INIT = "init";
+var MESSAGE_APPEND = "append";
+var MESSAGE_FLUSH = "flush";
+var MESSAGE_EVENT_TYPE = "message";
+var classicWorkersSupported = true;
+var codec_pool_worker_default = (workerData, codecConstructor, options, config2, onTaskFinished, webWorker, scripts) => {
+ Object.assign(workerData, {
+ busy: true,
+ codecConstructor,
+ options: Object.assign({}, options),
+ scripts,
+ terminate() {
+ if (workerData.worker && !workerData.busy) {
+ workerData.worker.terminate();
+ workerData.interface = null;
+ }
+ },
+ onTaskFinished() {
+ workerData.busy = false;
+ onTaskFinished(workerData);
+ }
+ });
+ return webWorker ? createWebWorkerInterface(workerData, config2) : createWorkerInterface(workerData, config2);
+};
+function createWorkerInterface(workerData, config2) {
+ const interfaceCodec = createCodec(workerData.codecConstructor, workerData.options, config2);
+ return {
+ async append(data) {
+ try {
+ return await interfaceCodec.append(data);
+ } catch (error) {
+ workerData.onTaskFinished();
+ throw error;
+ }
+ },
+ async flush() {
+ try {
+ return await interfaceCodec.flush();
+ } finally {
+ workerData.onTaskFinished();
+ }
+ },
+ abort() {
+ workerData.onTaskFinished();
+ }
+ };
+}
+function createWebWorkerInterface(workerData, config2) {
+ let messageTask;
+ const workerOptions = { type: "module" };
+ if (!workerData.interface) {
+ if (!classicWorkersSupported) {
+ workerData.worker = getWorker(workerOptions, config2.baseURL);
+ } else {
+ try {
+ workerData.worker = getWorker({}, config2.baseURL);
+ } catch (_error) {
+ classicWorkersSupported = false;
+ workerData.worker = getWorker(workerOptions, config2.baseURL);
+ }
+ }
+ workerData.worker.addEventListener(MESSAGE_EVENT_TYPE, onMessage, false);
+ workerData.interface = {
+ append(data) {
+ return initAndSendMessage({ type: MESSAGE_APPEND, data });
+ },
+ flush() {
+ return initAndSendMessage({ type: MESSAGE_FLUSH });
+ },
+ abort() {
+ workerData.onTaskFinished();
+ }
+ };
+ }
+ return workerData.interface;
+ function getWorker(options, baseURL) {
+ let url2, scriptUrl;
+ url2 = workerData.scripts[0];
+ if (typeof url2 == "function") {
+ url2 = url2();
+ }
+ try {
+ scriptUrl = new URL(url2, baseURL);
+ } catch (_error) {
+ scriptUrl = url2;
+ }
+ return new Worker(scriptUrl, options);
+ }
+ async function initAndSendMessage(message) {
+ if (!messageTask) {
+ const options = workerData.options;
+ const scripts = workerData.scripts.slice(1);
+ await sendMessage({ scripts, type: MESSAGE_INIT, options, config: { chunkSize: config2.chunkSize } });
+ }
+ return sendMessage(message);
+ }
+ function sendMessage(message) {
+ const worker = workerData.worker;
+ const result = new Promise((resolve2, reject) => messageTask = { resolve: resolve2, reject });
+ try {
+ if (message.data) {
+ try {
+ message.data = message.data.buffer;
+ worker.postMessage(message, [message.data]);
+ } catch (_error) {
+ worker.postMessage(message);
+ }
+ } else {
+ worker.postMessage(message);
+ }
+ } catch (error) {
+ messageTask.reject(error);
+ messageTask = null;
+ workerData.onTaskFinished();
+ }
+ return result;
+ }
+ function onMessage(event) {
+ const message = event.data;
+ if (messageTask) {
+ const reponseError = message.error;
+ const type = message.type;
+ if (reponseError) {
+ const error = new Error(reponseError.message);
+ error.stack = reponseError.stack;
+ messageTask.reject(error);
+ messageTask = null;
+ workerData.onTaskFinished();
+ } else if (type == MESSAGE_INIT || type == MESSAGE_FLUSH || type == MESSAGE_APPEND) {
+ const data = message.data;
+ if (type == MESSAGE_FLUSH) {
+ messageTask.resolve({ data: new Uint8Array(data), signature: message.signature });
+ messageTask = null;
+ workerData.onTaskFinished();
+ } else {
+ messageTask.resolve(data && new Uint8Array(data));
+ }
+ }
+ }
+ }
+}
+
+// node_modules/@zip.js/zip.js/lib/core/codecs/codec-pool.js
+var pool = [];
+var pendingRequests = [];
+function createCodec2(codecConstructor, options, config2) {
+ const streamCopy = !options.compressed && !options.signed && !options.encrypted;
+ const webWorker = !streamCopy && (options.useWebWorkers || options.useWebWorkers === void 0 && config2.useWebWorkers);
+ const scripts = webWorker && config2.workerScripts ? config2.workerScripts[options.codecType] : [];
+ if (pool.length < config2.maxWorkers) {
+ const workerData = {};
+ pool.push(workerData);
+ return codec_pool_worker_default(workerData, codecConstructor, options, config2, onTaskFinished, webWorker, scripts);
+ } else {
+ const workerData = pool.find((workerData2) => !workerData2.busy);
+ if (workerData) {
+ clearTerminateTimeout(workerData);
+ return codec_pool_worker_default(workerData, codecConstructor, options, config2, onTaskFinished, webWorker, scripts);
+ } else {
+ return new Promise((resolve2) => pendingRequests.push({ resolve: resolve2, codecConstructor, options, webWorker, scripts }));
+ }
+ }
+ function onTaskFinished(workerData) {
+ if (pendingRequests.length) {
+ const [{ resolve: resolve2, codecConstructor: codecConstructor2, options: options2, webWorker: webWorker2, scripts: scripts2 }] = pendingRequests.splice(0, 1);
+ resolve2(codec_pool_worker_default(workerData, codecConstructor2, options2, config2, onTaskFinished, webWorker2, scripts2));
+ } else if (workerData.worker) {
+ clearTerminateTimeout(workerData);
+ if (Number.isFinite(config2.terminateWorkerTimeout) && config2.terminateWorkerTimeout >= 0) {
+ workerData.terminateTimeout = setTimeout(() => {
+ pool = pool.filter((data) => data != workerData);
+ workerData.terminate();
+ }, config2.terminateWorkerTimeout);
+ }
+ } else {
+ pool = pool.filter((data) => data != workerData);
+ }
+ }
+}
+function clearTerminateTimeout(workerData) {
+ if (workerData.terminateTimeout) {
+ clearTimeout(workerData.terminateTimeout);
+ workerData.terminateTimeout = null;
+ }
+}
+
+// node_modules/@zip.js/zip.js/lib/core/engine.js
+var MINIMUM_CHUNK_SIZE = 64;
+var ERR_ABORT = "Abort error";
+async function processData(codec2, reader, writer, offset2, inputLengthGetter, config2, options) {
+ const chunkSize = Math.max(config2.chunkSize, MINIMUM_CHUNK_SIZE);
+ return processChunk();
+ async function processChunk(chunkOffset = 0, outputLength = 0) {
+ const signal = options.signal;
+ const inputLength = inputLengthGetter();
+ if (chunkOffset < inputLength) {
+ testAborted(signal, codec2);
+ const inputData = await reader.readUint8Array(chunkOffset + offset2, Math.min(chunkSize, inputLength - chunkOffset));
+ const chunkLength = inputData.length;
+ testAborted(signal, codec2);
+ const data = await codec2.append(inputData);
+ testAborted(signal, codec2);
+ outputLength += await writeData(writer, data);
+ if (options.onprogress) {
+ try {
+ options.onprogress(chunkOffset + chunkLength, inputLength);
+ } catch (error) {
+ }
+ }
+ return processChunk(chunkOffset + chunkSize, outputLength);
+ } else {
+ const result = await codec2.flush();
+ outputLength += await writeData(writer, result.data);
+ return { signature: result.signature, length: outputLength };
+ }
+ }
+}
+function testAborted(signal, codec2) {
+ if (signal && signal.aborted) {
+ codec2.abort();
+ throw new Error(ERR_ABORT);
+ }
+}
+async function writeData(writer, data) {
+ if (data.length) {
+ await writer.writeUint8Array(data);
+ }
+ return data.length;
+}
+
+// node_modules/@zip.js/zip.js/lib/core/io.js
+var CONTENT_TYPE_TEXT_PLAIN = "text/plain";
+var Stream = class {
+ constructor() {
+ this.size = 0;
+ }
+ init() {
+ this.initialized = true;
+ }
+};
+var Reader = class extends Stream {
+};
+var Writer = class extends Stream {
+ writeUint8Array(array) {
+ this.size += array.length;
+ }
+};
+var TextReader = class extends Reader {
+ constructor(text) {
+ super();
+ this.blobReader = new BlobReader(new Blob([text], { type: CONTENT_TYPE_TEXT_PLAIN }));
+ }
+ init() {
+ super.init();
+ this.blobReader.init();
+ this.size = this.blobReader.size;
+ }
+ readUint8Array(offset2, length3) {
+ return this.blobReader.readUint8Array(offset2, length3);
+ }
+};
+var TextWriter = class extends Writer {
+ constructor(encoding) {
+ super();
+ this.encoding = encoding;
+ this.blob = new Blob([], { type: CONTENT_TYPE_TEXT_PLAIN });
+ }
+ writeUint8Array(array) {
+ super.writeUint8Array(array);
+ this.blob = new Blob([this.blob, array.buffer], { type: CONTENT_TYPE_TEXT_PLAIN });
+ }
+ getData() {
+ if (this.blob.text) {
+ return this.blob.text();
+ } else {
+ const reader = new FileReader();
+ return new Promise((resolve2, reject) => {
+ reader.onload = (event) => resolve2(event.target.result);
+ reader.onerror = () => reject(reader.error);
+ reader.readAsText(this.blob, this.encoding);
+ });
+ }
+ }
+};
+var Data64URIWriter = class extends Writer {
+ constructor(contentType) {
+ super();
+ this.data = "data:" + (contentType || "") + ";base64,";
+ this.pending = [];
+ }
+ writeUint8Array(array) {
+ super.writeUint8Array(array);
+ let indexArray = 0;
+ let dataString = this.pending;
+ const delta = this.pending.length;
+ this.pending = "";
+ for (indexArray = 0; indexArray < Math.floor((delta + array.length) / 3) * 3 - delta; indexArray++) {
+ dataString += String.fromCharCode(array[indexArray]);
+ }
+ for (; indexArray < array.length; indexArray++) {
+ this.pending += String.fromCharCode(array[indexArray]);
+ }
+ if (dataString.length > 2) {
+ this.data += btoa(dataString);
+ } else {
+ this.pending = dataString;
+ }
+ }
+ getData() {
+ return this.data + btoa(this.pending);
+ }
+};
+var BlobReader = class extends Reader {
+ constructor(blob) {
+ super();
+ this.blob = blob;
+ this.size = blob.size;
+ }
+ async readUint8Array(offset2, length3) {
+ if (this.blob.arrayBuffer) {
+ return new Uint8Array(await this.blob.slice(offset2, offset2 + length3).arrayBuffer());
+ } else {
+ const reader = new FileReader();
+ return new Promise((resolve2, reject) => {
+ reader.onload = (event) => resolve2(new Uint8Array(event.target.result));
+ reader.onerror = () => reject(reader.error);
+ reader.readAsArrayBuffer(this.blob.slice(offset2, offset2 + length3));
+ });
+ }
+ }
+};
+var BlobWriter = class extends Writer {
+ constructor(contentType) {
+ super();
+ this.contentType = contentType;
+ this.arrayBuffersMaxlength = 8;
+ initArrayBuffers(this);
+ }
+ writeUint8Array(array) {
+ super.writeUint8Array(array);
+ if (this.arrayBuffers.length == this.arrayBuffersMaxlength) {
+ flushArrayBuffers(this);
+ }
+ this.arrayBuffers.push(array.buffer);
+ }
+ getData() {
+ if (!this.blob) {
+ if (this.arrayBuffers.length) {
+ flushArrayBuffers(this);
+ }
+ this.blob = this.pendingBlob;
+ initArrayBuffers(this);
+ }
+ return this.blob;
+ }
+};
+function initArrayBuffers(blobWriter) {
+ blobWriter.pendingBlob = new Blob([], { type: blobWriter.contentType });
+ blobWriter.arrayBuffers = [];
+}
+function flushArrayBuffers(blobWriter) {
+ blobWriter.pendingBlob = new Blob([blobWriter.pendingBlob, ...blobWriter.arrayBuffers], { type: blobWriter.contentType });
+ blobWriter.arrayBuffers = [];
+}
+
+// node_modules/@zip.js/zip.js/lib/core/constants.js
+var MAX_32_BITS = 4294967295;
+var MAX_16_BITS = 65535;
+var COMPRESSION_METHOD_DEFLATE = 8;
+var COMPRESSION_METHOD_STORE = 0;
+var COMPRESSION_METHOD_AES = 99;
+var LOCAL_FILE_HEADER_SIGNATURE = 67324752;
+var DATA_DESCRIPTOR_RECORD_SIGNATURE = 134695760;
+var CENTRAL_FILE_HEADER_SIGNATURE = 33639248;
+var END_OF_CENTRAL_DIR_SIGNATURE = 101010256;
+var ZIP64_END_OF_CENTRAL_DIR_SIGNATURE = 101075792;
+var ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE = 117853008;
+var END_OF_CENTRAL_DIR_LENGTH = 22;
+var ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH = 20;
+var ZIP64_END_OF_CENTRAL_DIR_LENGTH = 56;
+var ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH = END_OF_CENTRAL_DIR_LENGTH + ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH + ZIP64_END_OF_CENTRAL_DIR_LENGTH;
+var ZIP64_TOTAL_NUMBER_OF_DISKS = 1;
+var EXTRAFIELD_TYPE_ZIP64 = 1;
+var EXTRAFIELD_TYPE_AES = 39169;
+var EXTRAFIELD_TYPE_NTFS = 10;
+var EXTRAFIELD_TYPE_NTFS_TAG1 = 1;
+var EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP = 21589;
+var EXTRAFIELD_TYPE_UNICODE_PATH = 28789;
+var EXTRAFIELD_TYPE_UNICODE_COMMENT = 25461;
+var BITFLAG_ENCRYPTED = 1;
+var BITFLAG_LEVEL = 6;
+var BITFLAG_DATA_DESCRIPTOR = 8;
+var BITFLAG_LANG_ENCODING_FLAG = 2048;
+var FILE_ATTR_MSDOS_DIR_MASK = 16;
+var VERSION_DEFLATE = 20;
+var VERSION_ZIP64 = 45;
+var VERSION_AES = 51;
+var DIRECTORY_SIGNATURE = "/";
+var MAX_DATE = new Date(2107, 11, 31);
+var MIN_DATE = new Date(1980, 0, 1);
+
+// node_modules/@zip.js/zip.js/lib/core/util/cp437-decode.js
+var CP437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split("");
+var cp437_decode_default = (stringValue) => {
+ let result = "";
+ for (let indexCharacter = 0; indexCharacter < stringValue.length; indexCharacter++) {
+ result += CP437[stringValue[indexCharacter]];
+ }
+ return result;
+};
+
+// node_modules/@zip.js/zip.js/lib/core/util/decode-text.js
+var decode_text_default = decodeText;
+function decodeText(value, encoding) {
+ if (encoding && encoding.trim().toLowerCase() == "cp437") {
+ return cp437_decode_default(value);
+ } else if (typeof TextDecoder == "undefined") {
+ const fileReader = new FileReader();
+ return new Promise((resolve2, reject) => {
+ fileReader.onload = (event) => resolve2(event.target.result);
+ fileReader.onerror = () => reject(fileReader.error);
+ fileReader.readAsText(new Blob([value]));
+ });
+ } else {
+ return new TextDecoder(encoding).decode(value);
+ }
+}
+
+// node_modules/@zip.js/zip.js/lib/core/zip-entry.js
+var PROPERTY_NAMES = [
+ "filename",
+ "rawFilename",
+ "directory",
+ "encrypted",
+ "compressedSize",
+ "uncompressedSize",
+ "lastModDate",
+ "rawLastModDate",
+ "comment",
+ "rawComment",
+ "signature",
+ "extraField",
+ "rawExtraField",
+ "bitFlag",
+ "extraFieldZip64",
+ "extraFieldUnicodePath",
+ "extraFieldUnicodeComment",
+ "extraFieldAES",
+ "filenameUTF8",
+ "commentUTF8",
+ "offset",
+ "zip64",
+ "compressionMethod",
+ "extraFieldNTFS",
+ "lastAccessDate",
+ "creationDate",
+ "extraFieldExtendedTimestamp",
+ "version",
+ "versionMadeBy",
+ "msDosCompatible",
+ "internalFileAttribute",
+ "externalFileAttribute"
+];
+var Entry = class {
+ constructor(data) {
+ PROPERTY_NAMES.forEach((name) => this[name] = data[name]);
+ }
+};
+
+// node_modules/@zip.js/zip.js/lib/core/zip-reader.js
+var ERR_BAD_FORMAT = "File format is not recognized";
+var ERR_EOCDR_NOT_FOUND = "End of central directory not found";
+var ERR_EOCDR_ZIP64_NOT_FOUND = "End of Zip64 central directory not found";
+var ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND = "End of Zip64 central directory locator not found";
+var ERR_CENTRAL_DIRECTORY_NOT_FOUND = "Central directory header not found";
+var ERR_LOCAL_FILE_HEADER_NOT_FOUND = "Local file header not found";
+var ERR_EXTRAFIELD_ZIP64_NOT_FOUND = "Zip64 extra field not found";
+var ERR_ENCRYPTED = "File contains encrypted entry";
+var ERR_UNSUPPORTED_ENCRYPTION = "Encryption method not supported";
+var ERR_UNSUPPORTED_COMPRESSION = "Compression method not supported";
+var CHARSET_UTF8 = "utf-8";
+var CHARSET_CP437 = "cp437";
+var ZIP64_PROPERTIES = ["uncompressedSize", "compressedSize", "offset"];
+var ZipReader = class {
+ constructor(reader, options = {}) {
+ Object.assign(this, {
+ reader,
+ options,
+ config: getConfiguration()
+ });
+ }
+ async *getEntriesGenerator(options = {}) {
+ const zipReader = this;
+ const reader = zipReader.reader;
+ if (!reader.initialized) {
+ await reader.init();
+ }
+ if (reader.size < END_OF_CENTRAL_DIR_LENGTH) {
+ throw new Error(ERR_BAD_FORMAT);
+ }
+ const endOfDirectoryInfo = await seekSignature(reader, END_OF_CENTRAL_DIR_SIGNATURE, reader.size, END_OF_CENTRAL_DIR_LENGTH, MAX_16_BITS * 16);
+ if (!endOfDirectoryInfo) {
+ throw new Error(ERR_EOCDR_NOT_FOUND);
+ }
+ const endOfDirectoryView = getDataView(endOfDirectoryInfo);
+ let directoryDataLength = getUint32(endOfDirectoryView, 12);
+ let directoryDataOffset = getUint32(endOfDirectoryView, 16);
+ let filesLength = getUint16(endOfDirectoryView, 8);
+ let prependedDataLength = 0;
+ if (directoryDataOffset == MAX_32_BITS || directoryDataLength == MAX_32_BITS || filesLength == MAX_16_BITS) {
+ const endOfDirectoryLocatorArray = await readUint8Array(reader, endOfDirectoryInfo.offset - ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH);
+ const endOfDirectoryLocatorView = getDataView(endOfDirectoryLocatorArray);
+ if (getUint32(endOfDirectoryLocatorView, 0) != ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE) {
+ throw new Error(ERR_EOCDR_ZIP64_NOT_FOUND);
+ }
+ directoryDataOffset = getBigUint64(endOfDirectoryLocatorView, 8);
+ let endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);
+ let endOfDirectoryView2 = getDataView(endOfDirectoryArray);
+ const expectedDirectoryDataOffset = endOfDirectoryInfo.offset - ZIP64_END_OF_CENTRAL_DIR_LOCATOR_LENGTH - ZIP64_END_OF_CENTRAL_DIR_LENGTH;
+ if (getUint32(endOfDirectoryView2, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE && directoryDataOffset != expectedDirectoryDataOffset) {
+ const originalDirectoryDataOffset = directoryDataOffset;
+ directoryDataOffset = expectedDirectoryDataOffset;
+ prependedDataLength = directoryDataOffset - originalDirectoryDataOffset;
+ endOfDirectoryArray = await readUint8Array(reader, directoryDataOffset, ZIP64_END_OF_CENTRAL_DIR_LENGTH);
+ endOfDirectoryView2 = getDataView(endOfDirectoryArray);
+ }
+ if (getUint32(endOfDirectoryView2, 0) != ZIP64_END_OF_CENTRAL_DIR_SIGNATURE) {
+ throw new Error(ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND);
+ }
+ filesLength = getBigUint64(endOfDirectoryView2, 32);
+ directoryDataLength = getBigUint64(endOfDirectoryView2, 40);
+ directoryDataOffset -= directoryDataLength;
+ }
+ if (directoryDataOffset < 0 || directoryDataOffset >= reader.size) {
+ throw new Error(ERR_BAD_FORMAT);
+ }
+ let offset2 = 0;
+ let directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);
+ let directoryView = getDataView(directoryArray);
+ if (directoryDataLength) {
+ const expectedDirectoryDataOffset = endOfDirectoryInfo.offset - directoryDataLength;
+ if (getUint32(directoryView, offset2) != CENTRAL_FILE_HEADER_SIGNATURE && directoryDataOffset != expectedDirectoryDataOffset) {
+ const originalDirectoryDataOffset = directoryDataOffset;
+ directoryDataOffset = expectedDirectoryDataOffset;
+ prependedDataLength = directoryDataOffset - originalDirectoryDataOffset;
+ directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);
+ directoryView = getDataView(directoryArray);
+ }
+ }
+ if (directoryDataOffset < 0 || directoryDataOffset >= reader.size) {
+ throw new Error(ERR_BAD_FORMAT);
+ }
+ for (let indexFile = 0; indexFile < filesLength; indexFile++) {
+ const fileEntry = new ZipEntry(reader, zipReader.config, zipReader.options);
+ if (getUint32(directoryView, offset2) != CENTRAL_FILE_HEADER_SIGNATURE) {
+ throw new Error(ERR_CENTRAL_DIRECTORY_NOT_FOUND);
+ }
+ readCommonHeader(fileEntry, directoryView, offset2 + 6);
+ const languageEncodingFlag = Boolean(fileEntry.bitFlag.languageEncodingFlag);
+ const filenameOffset = offset2 + 46;
+ const extraFieldOffset = filenameOffset + fileEntry.filenameLength;
+ const commentOffset = extraFieldOffset + fileEntry.extraFieldLength;
+ const versionMadeBy = getUint16(directoryView, offset2 + 4);
+ const msDosCompatible = (versionMadeBy & 0) == 0;
+ Object.assign(fileEntry, {
+ versionMadeBy,
+ msDosCompatible,
+ compressedSize: 0,
+ uncompressedSize: 0,
+ commentLength: getUint16(directoryView, offset2 + 32),
+ directory: msDosCompatible && (getUint8(directoryView, offset2 + 38) & FILE_ATTR_MSDOS_DIR_MASK) == FILE_ATTR_MSDOS_DIR_MASK,
+ offset: getUint32(directoryView, offset2 + 42) + prependedDataLength,
+ internalFileAttribute: getUint32(directoryView, offset2 + 34),
+ externalFileAttribute: getUint32(directoryView, offset2 + 38),
+ rawFilename: directoryArray.subarray(filenameOffset, extraFieldOffset),
+ filenameUTF8: languageEncodingFlag,
+ commentUTF8: languageEncodingFlag,
+ rawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset)
+ });
+ const endOffset = commentOffset + fileEntry.commentLength;
+ fileEntry.rawComment = directoryArray.subarray(commentOffset, endOffset);
+ const filenameEncoding = getOptionValue(zipReader, options, "filenameEncoding");
+ const commentEncoding = getOptionValue(zipReader, options, "commentEncoding");
+ const [filename, comment] = await Promise.all([
+ decode_text_default(fileEntry.rawFilename, fileEntry.filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437),
+ decode_text_default(fileEntry.rawComment, fileEntry.commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437)
+ ]);
+ fileEntry.filename = filename;
+ fileEntry.comment = comment;
+ if (!fileEntry.directory && fileEntry.filename.endsWith(DIRECTORY_SIGNATURE)) {
+ fileEntry.directory = true;
+ }
+ await readCommonFooter(fileEntry, fileEntry, directoryView, offset2 + 6);
+ const entry = new Entry(fileEntry);
+ entry.getData = (writer, options2) => fileEntry.getData(writer, entry, options2);
+ offset2 = endOffset;
+ if (options.onprogress) {
+ try {
+ options.onprogress(indexFile + 1, filesLength, new Entry(fileEntry));
+ } catch (_error) {
+ }
+ }
+ yield entry;
+ }
+ return true;
+ }
+ async getEntries(options = {}) {
+ const entries = [];
+ const iter = this.getEntriesGenerator(options);
+ let curr = iter.next();
+ while (!(await curr).done) {
+ entries.push((await curr).value);
+ curr = iter.next();
+ }
+ return entries;
+ }
+ async close() {
+ }
+};
+var ZipEntry = class {
+ constructor(reader, config2, options) {
+ Object.assign(this, {
+ reader,
+ config: config2,
+ options
+ });
+ }
+ async getData(writer, fileEntry, options = {}) {
+ const zipEntry = this;
+ const {
+ reader,
+ offset: offset2,
+ extraFieldAES,
+ compressionMethod,
+ config: config2,
+ bitFlag,
+ signature,
+ rawLastModDate,
+ compressedSize
+ } = zipEntry;
+ const localDirectory = zipEntry.localDirectory = {};
+ if (!reader.initialized) {
+ await reader.init();
+ }
+ let dataArray = await readUint8Array(reader, offset2, 30);
+ const dataView = getDataView(dataArray);
+ let password = getOptionValue(zipEntry, options, "password");
+ password = password && password.length && password;
+ if (extraFieldAES) {
+ if (extraFieldAES.originalCompressionMethod != COMPRESSION_METHOD_AES) {
+ throw new Error(ERR_UNSUPPORTED_COMPRESSION);
+ }
+ }
+ if (compressionMethod != COMPRESSION_METHOD_STORE && compressionMethod != COMPRESSION_METHOD_DEFLATE) {
+ throw new Error(ERR_UNSUPPORTED_COMPRESSION);
+ }
+ if (getUint32(dataView, 0) != LOCAL_FILE_HEADER_SIGNATURE) {
+ throw new Error(ERR_LOCAL_FILE_HEADER_NOT_FOUND);
+ }
+ readCommonHeader(localDirectory, dataView, 4);
+ dataArray = await readUint8Array(reader, offset2, 30 + localDirectory.filenameLength + localDirectory.extraFieldLength);
+ localDirectory.rawExtraField = dataArray.subarray(30 + localDirectory.filenameLength);
+ await readCommonFooter(zipEntry, localDirectory, dataView, 4);
+ fileEntry.lastAccessDate = localDirectory.lastAccessDate;
+ fileEntry.creationDate = localDirectory.creationDate;
+ const encrypted = zipEntry.encrypted && localDirectory.encrypted;
+ const zipCrypto = encrypted && !extraFieldAES;
+ if (encrypted) {
+ if (!zipCrypto && extraFieldAES.strength === void 0) {
+ throw new Error(ERR_UNSUPPORTED_ENCRYPTION);
+ } else if (!password) {
+ throw new Error(ERR_ENCRYPTED);
+ }
+ }
+ const codec2 = await createCodec2(config2.Inflate, {
+ codecType: CODEC_INFLATE,
+ password,
+ zipCrypto,
+ encryptionStrength: extraFieldAES && extraFieldAES.strength,
+ signed: getOptionValue(zipEntry, options, "checkSignature"),
+ passwordVerification: zipCrypto && (bitFlag.dataDescriptor ? rawLastModDate >>> 8 & 255 : signature >>> 24 & 255),
+ signature,
+ compressed: compressionMethod != 0,
+ encrypted,
+ useWebWorkers: getOptionValue(zipEntry, options, "useWebWorkers")
+ }, config2);
+ if (!writer.initialized) {
+ await writer.init();
+ }
+ const signal = getOptionValue(zipEntry, options, "signal");
+ const dataOffset = offset2 + 30 + localDirectory.filenameLength + localDirectory.extraFieldLength;
+ await processData(codec2, reader, writer, dataOffset, () => compressedSize, config2, { onprogress: options.onprogress, signal });
+ return writer.getData();
+ }
+};
+function readCommonHeader(directory, dataView, offset2) {
+ const rawBitFlag = directory.rawBitFlag = getUint16(dataView, offset2 + 2);
+ const encrypted = (rawBitFlag & BITFLAG_ENCRYPTED) == BITFLAG_ENCRYPTED;
+ const rawLastModDate = getUint32(dataView, offset2 + 6);
+ Object.assign(directory, {
+ encrypted,
+ version: getUint16(dataView, offset2),
+ bitFlag: {
+ level: (rawBitFlag & BITFLAG_LEVEL) >> 1,
+ dataDescriptor: (rawBitFlag & BITFLAG_DATA_DESCRIPTOR) == BITFLAG_DATA_DESCRIPTOR,
+ languageEncodingFlag: (rawBitFlag & BITFLAG_LANG_ENCODING_FLAG) == BITFLAG_LANG_ENCODING_FLAG
+ },
+ rawLastModDate,
+ lastModDate: getDate(rawLastModDate),
+ filenameLength: getUint16(dataView, offset2 + 22),
+ extraFieldLength: getUint16(dataView, offset2 + 24)
+ });
+}
+async function readCommonFooter(fileEntry, directory, dataView, offset2) {
+ const rawExtraField = directory.rawExtraField;
+ const extraField = directory.extraField = /* @__PURE__ */ new Map();
+ const rawExtraFieldView = getDataView(new Uint8Array(rawExtraField));
+ let offsetExtraField = 0;
+ try {
+ while (offsetExtraField < rawExtraField.length) {
+ const type = getUint16(rawExtraFieldView, offsetExtraField);
+ const size = getUint16(rawExtraFieldView, offsetExtraField + 2);
+ extraField.set(type, {
+ type,
+ data: rawExtraField.slice(offsetExtraField + 4, offsetExtraField + 4 + size)
+ });
+ offsetExtraField += 4 + size;
+ }
+ } catch (_error) {
+ }
+ const compressionMethod = getUint16(dataView, offset2 + 4);
+ directory.signature = getUint32(dataView, offset2 + 10);
+ directory.uncompressedSize = getUint32(dataView, offset2 + 18);
+ directory.compressedSize = getUint32(dataView, offset2 + 14);
+ const extraFieldZip64 = extraField.get(EXTRAFIELD_TYPE_ZIP64);
+ if (extraFieldZip64) {
+ readExtraFieldZip64(extraFieldZip64, directory);
+ directory.extraFieldZip64 = extraFieldZip64;
+ }
+ const extraFieldUnicodePath = extraField.get(EXTRAFIELD_TYPE_UNICODE_PATH);
+ if (extraFieldUnicodePath) {
+ await readExtraFieldUnicode(extraFieldUnicodePath, "filename", "rawFilename", directory, fileEntry);
+ directory.extraFieldUnicodePath = extraFieldUnicodePath;
+ }
+ const extraFieldUnicodeComment = extraField.get(EXTRAFIELD_TYPE_UNICODE_COMMENT);
+ if (extraFieldUnicodeComment) {
+ await readExtraFieldUnicode(extraFieldUnicodeComment, "comment", "rawComment", directory, fileEntry);
+ directory.extraFieldUnicodeComment = extraFieldUnicodeComment;
+ }
+ const extraFieldAES = extraField.get(EXTRAFIELD_TYPE_AES);
+ if (extraFieldAES) {
+ readExtraFieldAES(extraFieldAES, directory, compressionMethod);
+ directory.extraFieldAES = extraFieldAES;
+ } else {
+ directory.compressionMethod = compressionMethod;
+ }
+ const extraFieldNTFS = extraField.get(EXTRAFIELD_TYPE_NTFS);
+ if (extraFieldNTFS) {
+ readExtraFieldNTFS(extraFieldNTFS, directory);
+ directory.extraFieldNTFS = extraFieldNTFS;
+ }
+ const extraFieldExtendedTimestamp = extraField.get(EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);
+ if (extraFieldExtendedTimestamp) {
+ readExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory);
+ directory.extraFieldExtendedTimestamp = extraFieldExtendedTimestamp;
+ }
+}
+function readExtraFieldZip64(extraFieldZip64, directory) {
+ directory.zip64 = true;
+ const extraFieldView = getDataView(extraFieldZip64.data);
+ extraFieldZip64.values = [];
+ for (let indexValue = 0; indexValue < Math.floor(extraFieldZip64.data.length / 8); indexValue++) {
+ extraFieldZip64.values.push(getBigUint64(extraFieldView, 0 + indexValue * 8));
+ }
+ const missingProperties = ZIP64_PROPERTIES.filter((propertyName) => directory[propertyName] == MAX_32_BITS);
+ for (let indexMissingProperty = 0; indexMissingProperty < missingProperties.length; indexMissingProperty++) {
+ extraFieldZip64[missingProperties[indexMissingProperty]] = extraFieldZip64.values[indexMissingProperty];
+ }
+ ZIP64_PROPERTIES.forEach((propertyName) => {
+ if (directory[propertyName] == MAX_32_BITS) {
+ if (extraFieldZip64[propertyName] !== void 0) {
+ directory[propertyName] = extraFieldZip64[propertyName];
+ } else {
+ throw new Error(ERR_EXTRAFIELD_ZIP64_NOT_FOUND);
+ }
+ }
+ });
+}
+async function readExtraFieldUnicode(extraFieldUnicode, propertyName, rawPropertyName, directory, fileEntry) {
+ const extraFieldView = getDataView(extraFieldUnicode.data);
+ extraFieldUnicode.version = getUint8(extraFieldView, 0);
+ extraFieldUnicode.signature = getUint32(extraFieldView, 1);
+ const crc32 = new crc32_default();
+ crc32.append(fileEntry[rawPropertyName]);
+ const dataViewSignature = getDataView(new Uint8Array(4));
+ dataViewSignature.setUint32(0, crc32.get(), true);
+ extraFieldUnicode[propertyName] = await decode_text_default(extraFieldUnicode.data.subarray(5));
+ extraFieldUnicode.valid = !fileEntry.bitFlag.languageEncodingFlag && extraFieldUnicode.signature == getUint32(dataViewSignature, 0);
+ if (extraFieldUnicode.valid) {
+ directory[propertyName] = extraFieldUnicode[propertyName];
+ directory[propertyName + "UTF8"] = true;
+ }
+}
+function readExtraFieldAES(extraFieldAES, directory, compressionMethod) {
+ const extraFieldView = getDataView(extraFieldAES.data);
+ extraFieldAES.vendorVersion = getUint8(extraFieldView, 0);
+ extraFieldAES.vendorId = getUint8(extraFieldView, 2);
+ const strength = getUint8(extraFieldView, 4);
+ extraFieldAES.strength = strength;
+ extraFieldAES.originalCompressionMethod = compressionMethod;
+ directory.compressionMethod = extraFieldAES.compressionMethod = getUint16(extraFieldView, 5);
+}
+function readExtraFieldNTFS(extraFieldNTFS, directory) {
+ const extraFieldView = getDataView(extraFieldNTFS.data);
+ let offsetExtraField = 4;
+ let tag1Data;
+ try {
+ while (offsetExtraField < extraFieldNTFS.data.length && !tag1Data) {
+ const tagValue = getUint16(extraFieldView, offsetExtraField);
+ const attributeSize = getUint16(extraFieldView, offsetExtraField + 2);
+ if (tagValue == EXTRAFIELD_TYPE_NTFS_TAG1) {
+ tag1Data = extraFieldNTFS.data.slice(offsetExtraField + 4, offsetExtraField + 4 + attributeSize);
+ }
+ offsetExtraField += 4 + attributeSize;
+ }
+ } catch (_error) {
+ }
+ try {
+ if (tag1Data && tag1Data.length == 24) {
+ const tag1View = getDataView(tag1Data);
+ const rawLastModDate = tag1View.getBigUint64(0, true);
+ const rawLastAccessDate = tag1View.getBigUint64(8, true);
+ const rawCreationDate = tag1View.getBigUint64(16, true);
+ Object.assign(extraFieldNTFS, {
+ rawLastModDate,
+ rawLastAccessDate,
+ rawCreationDate
+ });
+ const lastModDate = getDateNTFS(rawLastModDate);
+ const lastAccessDate = getDateNTFS(rawLastAccessDate);
+ const creationDate = getDateNTFS(rawCreationDate);
+ const extraFieldData = { lastModDate, lastAccessDate, creationDate };
+ Object.assign(extraFieldNTFS, extraFieldData);
+ Object.assign(directory, extraFieldData);
+ }
+ } catch (_error) {
+ }
+}
+function readExtraFieldExtendedTimestamp(extraFieldExtendedTimestamp, directory) {
+ const extraFieldView = getDataView(extraFieldExtendedTimestamp.data);
+ const flags = getUint8(extraFieldView, 0);
+ const timeProperties = [];
+ const timeRawProperties = [];
+ if ((flags & 1) == 1) {
+ timeProperties.push("lastModDate");
+ timeRawProperties.push("rawLastModDate");
+ }
+ if ((flags & 2) == 2) {
+ timeProperties.push("lastAccessDate");
+ timeRawProperties.push("rawLastAccessDate");
+ }
+ if ((flags & 4) == 4) {
+ timeProperties.push("creationDate");
+ timeRawProperties.push("rawCreationDate");
+ }
+ let offset2 = 1;
+ timeProperties.forEach((propertyName, indexProperty) => {
+ if (extraFieldExtendedTimestamp.data.length >= offset2 + 4) {
+ const time = getUint32(extraFieldView, offset2);
+ directory[propertyName] = extraFieldExtendedTimestamp[propertyName] = new Date(time * 1e3);
+ const rawPropertyName = timeRawProperties[indexProperty];
+ extraFieldExtendedTimestamp[rawPropertyName] = time;
+ }
+ offset2 += 4;
+ });
+}
+async function seekSignature(reader, signature, startOffset, minimumBytes, maximumLength) {
+ const signatureArray = new Uint8Array(4);
+ const signatureView = getDataView(signatureArray);
+ setUint32(signatureView, 0, signature);
+ const maximumBytes = minimumBytes + maximumLength;
+ return await seek(minimumBytes) || await seek(Math.min(maximumBytes, startOffset));
+ async function seek(length3) {
+ const offset2 = startOffset - length3;
+ const bytes = await readUint8Array(reader, offset2, length3);
+ for (let indexByte = bytes.length - minimumBytes; indexByte >= 0; indexByte--) {
+ if (bytes[indexByte] == signatureArray[0] && bytes[indexByte + 1] == signatureArray[1] && bytes[indexByte + 2] == signatureArray[2] && bytes[indexByte + 3] == signatureArray[3]) {
+ return {
+ offset: offset2 + indexByte,
+ buffer: bytes.slice(indexByte, indexByte + minimumBytes).buffer
+ };
+ }
+ }
+ }
+}
+function getOptionValue(zipReader, options, name) {
+ return options[name] === void 0 ? zipReader.options[name] : options[name];
+}
+function getDate(timeRaw) {
+ const date = (timeRaw & 4294901760) >> 16, time = timeRaw & 65535;
+ try {
+ return new Date(1980 + ((date & 65024) >> 9), ((date & 480) >> 5) - 1, date & 31, (time & 63488) >> 11, (time & 2016) >> 5, (time & 31) * 2, 0);
+ } catch (_error) {
+ }
+}
+function getDateNTFS(timeRaw) {
+ return new Date(Number(timeRaw / BigInt(1e4) - BigInt(116444736e5)));
+}
+function getUint8(view, offset2) {
+ return view.getUint8(offset2);
+}
+function getUint16(view, offset2) {
+ return view.getUint16(offset2, true);
+}
+function getUint32(view, offset2) {
+ return view.getUint32(offset2, true);
+}
+function getBigUint64(view, offset2) {
+ return Number(view.getBigUint64(offset2, true));
+}
+function setUint32(view, offset2, value) {
+ view.setUint32(offset2, value, true);
+}
+function getDataView(array) {
+ return new DataView(array.buffer);
+}
+function readUint8Array(reader, offset2, size) {
+ return reader.readUint8Array(offset2, size);
+}
+
+// node_modules/@zip.js/zip.js/lib/core/zip-writer.js
+var ERR_DUPLICATED_NAME = "File already exists";
+var ERR_INVALID_COMMENT = "Zip file comment exceeds 64KB";
+var ERR_INVALID_ENTRY_COMMENT = "File entry comment exceeds 64KB";
+var ERR_INVALID_ENTRY_NAME = "File entry name exceeds 64KB";
+var ERR_INVALID_VERSION = "Version exceeds 65535";
+var ERR_INVALID_ENCRYPTION_STRENGTH = "The strength must equal 1, 2, or 3";
+var ERR_INVALID_EXTRAFIELD_TYPE = "Extra field type exceeds 65535";
+var ERR_INVALID_EXTRAFIELD_DATA = "Extra field data exceeds 64KB";
+var ERR_UNSUPPORTED_FORMAT = "Zip64 is not supported";
+var EXTRAFIELD_DATA_AES = new Uint8Array([7, 0, 2, 0, 65, 69, 3, 0, 0]);
+var EXTRAFIELD_LENGTH_ZIP64 = 24;
+var workers = 0;
+var ZipWriter = class {
+ constructor(writer, options = {}) {
+ Object.assign(this, {
+ writer,
+ options,
+ config: getConfiguration(),
+ files: /* @__PURE__ */ new Map(),
+ offset: writer.size,
+ pendingCompressedSize: 0,
+ pendingEntries: [],
+ pendingAddFileCalls: /* @__PURE__ */ new Set()
+ });
+ }
+ async add(name = "", reader, options = {}) {
+ const zipWriter = this;
+ if (workers < zipWriter.config.maxWorkers) {
+ workers++;
+ let promiseAddFile;
+ try {
+ promiseAddFile = addFile(zipWriter, name, reader, options);
+ this.pendingAddFileCalls.add(promiseAddFile);
+ return await promiseAddFile;
+ } finally {
+ this.pendingAddFileCalls.delete(promiseAddFile);
+ workers--;
+ const pendingEntry = zipWriter.pendingEntries.shift();
+ if (pendingEntry) {
+ zipWriter.add(pendingEntry.name, pendingEntry.reader, pendingEntry.options).then(pendingEntry.resolve).catch(pendingEntry.reject);
+ }
+ }
+ } else {
+ return new Promise((resolve2, reject) => zipWriter.pendingEntries.push({ name, reader, options, resolve: resolve2, reject }));
+ }
+ }
+ async close(comment = new Uint8Array(0), options = {}) {
+ while (this.pendingAddFileCalls.size) {
+ await Promise.all(Array.from(this.pendingAddFileCalls));
+ }
+ await closeFile(this, comment, options);
+ return this.writer.getData();
+ }
+};
+async function addFile(zipWriter, name, reader, options) {
+ name = name.trim();
+ if (options.directory && !name.endsWith(DIRECTORY_SIGNATURE)) {
+ name += DIRECTORY_SIGNATURE;
+ } else {
+ options.directory = name.endsWith(DIRECTORY_SIGNATURE);
+ }
+ if (zipWriter.files.has(name)) {
+ throw new Error(ERR_DUPLICATED_NAME);
+ }
+ const rawFilename = encode_text_default(name);
+ if (rawFilename.length > MAX_16_BITS) {
+ throw new Error(ERR_INVALID_ENTRY_NAME);
+ }
+ const comment = options.comment || "";
+ const rawComment = encode_text_default(comment);
+ if (rawComment.length > MAX_16_BITS) {
+ throw new Error(ERR_INVALID_ENTRY_COMMENT);
+ }
+ const version2 = zipWriter.options.version || options.version || 0;
+ if (version2 > MAX_16_BITS) {
+ throw new Error(ERR_INVALID_VERSION);
+ }
+ const versionMadeBy = zipWriter.options.versionMadeBy || options.versionMadeBy || 20;
+ if (versionMadeBy > MAX_16_BITS) {
+ throw new Error(ERR_INVALID_VERSION);
+ }
+ const lastModDate = getOptionValue2(zipWriter, options, "lastModDate") || new Date();
+ const lastAccessDate = getOptionValue2(zipWriter, options, "lastAccessDate");
+ const creationDate = getOptionValue2(zipWriter, options, "creationDate");
+ const password = getOptionValue2(zipWriter, options, "password");
+ const encryptionStrength = getOptionValue2(zipWriter, options, "encryptionStrength") || 3;
+ const zipCrypto = getOptionValue2(zipWriter, options, "zipCrypto");
+ if (password !== void 0 && encryptionStrength !== void 0 && (encryptionStrength < 1 || encryptionStrength > 3)) {
+ throw new Error(ERR_INVALID_ENCRYPTION_STRENGTH);
+ }
+ let rawExtraField = new Uint8Array(0);
+ const extraField = options.extraField;
+ if (extraField) {
+ let extraFieldSize = 0;
+ let offset2 = 0;
+ extraField.forEach((data) => extraFieldSize += 4 + data.length);
+ rawExtraField = new Uint8Array(extraFieldSize);
+ extraField.forEach((data, type) => {
+ if (type > MAX_16_BITS) {
+ throw new Error(ERR_INVALID_EXTRAFIELD_TYPE);
+ }
+ if (data.length > MAX_16_BITS) {
+ throw new Error(ERR_INVALID_EXTRAFIELD_DATA);
+ }
+ arraySet(rawExtraField, new Uint16Array([type]), offset2);
+ arraySet(rawExtraField, new Uint16Array([data.length]), offset2 + 2);
+ arraySet(rawExtraField, data, offset2 + 4);
+ offset2 += 4 + data.length;
+ });
+ }
+ let extendedTimestamp = getOptionValue2(zipWriter, options, "extendedTimestamp");
+ if (extendedTimestamp === void 0) {
+ extendedTimestamp = true;
+ }
+ let maximumCompressedSize = 0;
+ let keepOrder = getOptionValue2(zipWriter, options, "keepOrder");
+ if (keepOrder === void 0) {
+ keepOrder = true;
+ }
+ let uncompressedSize = 0;
+ let msDosCompatible = getOptionValue2(zipWriter, options, "msDosCompatible");
+ if (msDosCompatible === void 0) {
+ msDosCompatible = true;
+ }
+ const internalFileAttribute = getOptionValue2(zipWriter, options, "internalFileAttribute") || 0;
+ const externalFileAttribute = getOptionValue2(zipWriter, options, "externalFileAttribute") || 0;
+ if (reader) {
+ if (!reader.initialized) {
+ await reader.init();
+ }
+ uncompressedSize = reader.size;
+ maximumCompressedSize = getMaximumCompressedSize2(uncompressedSize);
+ }
+ let zip64 = options.zip64 || zipWriter.options.zip64 || false;
+ if (zipWriter.offset + zipWriter.pendingCompressedSize >= MAX_32_BITS || uncompressedSize >= MAX_32_BITS || maximumCompressedSize >= MAX_32_BITS) {
+ if (options.zip64 === false || zipWriter.options.zip64 === false || !keepOrder) {
+ throw new Error(ERR_UNSUPPORTED_FORMAT);
+ } else {
+ zip64 = true;
+ }
+ }
+ zipWriter.pendingCompressedSize += maximumCompressedSize;
+ await Promise.resolve();
+ const level = getOptionValue2(zipWriter, options, "level");
+ const useWebWorkers = getOptionValue2(zipWriter, options, "useWebWorkers");
+ const bufferedWrite = getOptionValue2(zipWriter, options, "bufferedWrite");
+ let dataDescriptor = getOptionValue2(zipWriter, options, "dataDescriptor");
+ let dataDescriptorSignature = getOptionValue2(zipWriter, options, "dataDescriptorSignature");
+ const signal = getOptionValue2(zipWriter, options, "signal");
+ if (dataDescriptor === void 0) {
+ dataDescriptor = true;
+ }
+ if (dataDescriptor && dataDescriptorSignature === void 0) {
+ dataDescriptorSignature = false;
+ }
+ const fileEntry = await getFileEntry(zipWriter, name, reader, Object.assign({}, options, {
+ rawFilename,
+ rawComment,
+ version: version2,
+ versionMadeBy,
+ lastModDate,
+ lastAccessDate,
+ creationDate,
+ rawExtraField,
+ zip64,
+ password,
+ level,
+ useWebWorkers,
+ encryptionStrength,
+ extendedTimestamp,
+ zipCrypto,
+ bufferedWrite,
+ keepOrder,
+ dataDescriptor,
+ dataDescriptorSignature,
+ signal,
+ msDosCompatible,
+ internalFileAttribute,
+ externalFileAttribute
+ }));
+ if (maximumCompressedSize) {
+ zipWriter.pendingCompressedSize -= maximumCompressedSize;
+ }
+ Object.assign(fileEntry, { name, comment, extraField });
+ return new Entry(fileEntry);
+}
+async function getFileEntry(zipWriter, name, reader, options) {
+ const files = zipWriter.files;
+ const writer = zipWriter.writer;
+ const previousFileEntry = Array.from(files.values()).pop();
+ let fileEntry = {};
+ let bufferedWrite;
+ let resolveLockUnbufferedWrite;
+ let resolveLockCurrentFileEntry;
+ files.set(name, fileEntry);
+ try {
+ let lockPreviousFileEntry;
+ let fileWriter;
+ let lockCurrentFileEntry;
+ if (options.keepOrder) {
+ lockPreviousFileEntry = previousFileEntry && previousFileEntry.lock;
+ }
+ fileEntry.lock = lockCurrentFileEntry = new Promise((resolve2) => resolveLockCurrentFileEntry = resolve2);
+ if (options.bufferedWrite || zipWriter.lockWrite || !options.dataDescriptor) {
+ fileWriter = new BlobWriter();
+ fileWriter.init();
+ bufferedWrite = true;
+ } else {
+ zipWriter.lockWrite = new Promise((resolve2) => resolveLockUnbufferedWrite = resolve2);
+ if (!writer.initialized) {
+ await writer.init();
+ }
+ fileWriter = writer;
+ }
+ fileEntry = await createFileEntry(reader, fileWriter, zipWriter.config, options);
+ fileEntry.lock = lockCurrentFileEntry;
+ files.set(name, fileEntry);
+ fileEntry.filename = name;
+ if (bufferedWrite) {
+ let indexWrittenData = 0;
+ const blob = fileWriter.getData();
+ await Promise.all([zipWriter.lockWrite, lockPreviousFileEntry]);
+ let pendingFileEntry;
+ do {
+ pendingFileEntry = Array.from(files.values()).find((fileEntry2) => fileEntry2.writingBufferedData);
+ if (pendingFileEntry) {
+ await pendingFileEntry.lock;
+ }
+ } while (pendingFileEntry && pendingFileEntry.lock);
+ fileEntry.writingBufferedData = true;
+ if (!options.dataDescriptor) {
+ const headerLength = 26;
+ const arrayBuffer = await sliceAsArrayBuffer(blob, 0, headerLength);
+ const arrayBufferView = new DataView(arrayBuffer);
+ if (!fileEntry.encrypted || options.zipCrypto) {
+ setUint322(arrayBufferView, 14, fileEntry.signature);
+ }
+ if (fileEntry.zip64) {
+ setUint322(arrayBufferView, 18, MAX_32_BITS);
+ setUint322(arrayBufferView, 22, MAX_32_BITS);
+ } else {
+ setUint322(arrayBufferView, 18, fileEntry.compressedSize);
+ setUint322(arrayBufferView, 22, fileEntry.uncompressedSize);
+ }
+ await writer.writeUint8Array(new Uint8Array(arrayBuffer));
+ indexWrittenData = headerLength;
+ }
+ await writeBlob(writer, blob, indexWrittenData);
+ delete fileEntry.writingBufferedData;
+ }
+ fileEntry.offset = zipWriter.offset;
+ if (fileEntry.zip64) {
+ const rawExtraFieldZip64View = getDataView2(fileEntry.rawExtraFieldZip64);
+ setBigUint64(rawExtraFieldZip64View, 20, BigInt(fileEntry.offset));
+ } else if (fileEntry.offset >= MAX_32_BITS) {
+ throw new Error(ERR_UNSUPPORTED_FORMAT);
+ }
+ zipWriter.offset += fileEntry.length;
+ return fileEntry;
+ } catch (error) {
+ if (bufferedWrite && fileEntry.writingBufferedData || !bufferedWrite && fileEntry.dataWritten) {
+ error.corruptedEntry = zipWriter.hasCorruptedEntries = true;
+ if (fileEntry.uncompressedSize) {
+ zipWriter.offset += fileEntry.uncompressedSize;
+ }
+ }
+ files.delete(name);
+ throw error;
+ } finally {
+ resolveLockCurrentFileEntry();
+ if (resolveLockUnbufferedWrite) {
+ resolveLockUnbufferedWrite();
+ }
+ }
+}
+async function createFileEntry(reader, writer, config2, options) {
+ const {
+ rawFilename,
+ lastAccessDate,
+ creationDate,
+ password,
+ level,
+ zip64,
+ zipCrypto,
+ dataDescriptor,
+ dataDescriptorSignature,
+ directory,
+ version: version2,
+ versionMadeBy,
+ rawComment,
+ rawExtraField,
+ useWebWorkers,
+ onprogress,
+ signal,
+ encryptionStrength,
+ extendedTimestamp,
+ msDosCompatible,
+ internalFileAttribute,
+ externalFileAttribute
+ } = options;
+ const encrypted = Boolean(password && password.length);
+ const compressed = level !== 0 && !directory;
+ let rawExtraFieldAES;
+ if (encrypted && !zipCrypto) {
+ rawExtraFieldAES = new Uint8Array(EXTRAFIELD_DATA_AES.length + 2);
+ const extraFieldAESView = getDataView2(rawExtraFieldAES);
+ setUint16(extraFieldAESView, 0, EXTRAFIELD_TYPE_AES);
+ arraySet(rawExtraFieldAES, EXTRAFIELD_DATA_AES, 2);
+ setUint8(extraFieldAESView, 8, encryptionStrength);
+ } else {
+ rawExtraFieldAES = new Uint8Array(0);
+ }
+ let rawExtraFieldNTFS;
+ let rawExtraFieldExtendedTimestamp;
+ if (extendedTimestamp) {
+ rawExtraFieldExtendedTimestamp = new Uint8Array(9 + (lastAccessDate ? 4 : 0) + (creationDate ? 4 : 0));
+ const extraFieldExtendedTimestampView = getDataView2(rawExtraFieldExtendedTimestamp);
+ setUint16(extraFieldExtendedTimestampView, 0, EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);
+ setUint16(extraFieldExtendedTimestampView, 2, rawExtraFieldExtendedTimestamp.length - 4);
+ const extraFieldExtendedTimestampFlag = 1 + (lastAccessDate ? 2 : 0) + (creationDate ? 4 : 0);
+ setUint8(extraFieldExtendedTimestampView, 4, extraFieldExtendedTimestampFlag);
+ setUint322(extraFieldExtendedTimestampView, 5, Math.floor(options.lastModDate.getTime() / 1e3));
+ if (lastAccessDate) {
+ setUint322(extraFieldExtendedTimestampView, 9, Math.floor(lastAccessDate.getTime() / 1e3));
+ }
+ if (creationDate) {
+ setUint322(extraFieldExtendedTimestampView, 13, Math.floor(creationDate.getTime() / 1e3));
+ }
+ try {
+ rawExtraFieldNTFS = new Uint8Array(36);
+ const extraFieldNTFSView = getDataView2(rawExtraFieldNTFS);
+ const lastModTimeNTFS = getTimeNTFS(options.lastModDate);
+ setUint16(extraFieldNTFSView, 0, EXTRAFIELD_TYPE_NTFS);
+ setUint16(extraFieldNTFSView, 2, 32);
+ setUint16(extraFieldNTFSView, 8, EXTRAFIELD_TYPE_NTFS_TAG1);
+ setUint16(extraFieldNTFSView, 10, 24);
+ setBigUint64(extraFieldNTFSView, 12, lastModTimeNTFS);
+ setBigUint64(extraFieldNTFSView, 20, getTimeNTFS(lastAccessDate) || lastModTimeNTFS);
+ setBigUint64(extraFieldNTFSView, 28, getTimeNTFS(creationDate) || lastModTimeNTFS);
+ } catch (_error) {
+ rawExtraFieldNTFS = new Uint8Array(0);
+ }
+ } else {
+ rawExtraFieldNTFS = rawExtraFieldExtendedTimestamp = new Uint8Array(0);
+ }
+ const fileEntry = {
+ version: version2 || VERSION_DEFLATE,
+ versionMadeBy,
+ zip64,
+ directory: Boolean(directory),
+ filenameUTF8: true,
+ rawFilename,
+ commentUTF8: true,
+ rawComment,
+ rawExtraFieldZip64: zip64 ? new Uint8Array(EXTRAFIELD_LENGTH_ZIP64 + 4) : new Uint8Array(0),
+ rawExtraFieldExtendedTimestamp,
+ rawExtraFieldNTFS,
+ rawExtraFieldAES,
+ rawExtraField,
+ extendedTimestamp,
+ msDosCompatible,
+ internalFileAttribute,
+ externalFileAttribute
+ };
+ let uncompressedSize = fileEntry.uncompressedSize = 0;
+ let bitFlag = BITFLAG_LANG_ENCODING_FLAG;
+ if (dataDescriptor) {
+ bitFlag = bitFlag | BITFLAG_DATA_DESCRIPTOR;
+ }
+ let compressionMethod = COMPRESSION_METHOD_STORE;
+ if (compressed) {
+ compressionMethod = COMPRESSION_METHOD_DEFLATE;
+ }
+ if (zip64) {
+ fileEntry.version = fileEntry.version > VERSION_ZIP64 ? fileEntry.version : VERSION_ZIP64;
+ }
+ if (encrypted) {
+ bitFlag = bitFlag | BITFLAG_ENCRYPTED;
+ if (!zipCrypto) {
+ fileEntry.version = fileEntry.version > VERSION_AES ? fileEntry.version : VERSION_AES;
+ compressionMethod = COMPRESSION_METHOD_AES;
+ if (compressed) {
+ fileEntry.rawExtraFieldAES[9] = COMPRESSION_METHOD_DEFLATE;
+ }
+ }
+ }
+ fileEntry.compressionMethod = compressionMethod;
+ const headerArray = fileEntry.headerArray = new Uint8Array(26);
+ const headerView = getDataView2(headerArray);
+ setUint16(headerView, 0, fileEntry.version);
+ setUint16(headerView, 2, bitFlag);
+ setUint16(headerView, 4, compressionMethod);
+ const dateArray = new Uint32Array(1);
+ const dateView = getDataView2(dateArray);
+ let lastModDate;
+ if (options.lastModDate < MIN_DATE) {
+ lastModDate = MIN_DATE;
+ } else if (options.lastModDate > MAX_DATE) {
+ lastModDate = MAX_DATE;
+ } else {
+ lastModDate = options.lastModDate;
+ }
+ setUint16(dateView, 0, (lastModDate.getHours() << 6 | lastModDate.getMinutes()) << 5 | lastModDate.getSeconds() / 2);
+ setUint16(dateView, 2, (lastModDate.getFullYear() - 1980 << 4 | lastModDate.getMonth() + 1) << 5 | lastModDate.getDate());
+ const rawLastModDate = dateArray[0];
+ setUint322(headerView, 6, rawLastModDate);
+ setUint16(headerView, 22, rawFilename.length);
+ const extraFieldLength = rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length + fileEntry.rawExtraField.length;
+ setUint16(headerView, 24, extraFieldLength);
+ const localHeaderArray = new Uint8Array(30 + rawFilename.length + extraFieldLength);
+ const localHeaderView = getDataView2(localHeaderArray);
+ setUint322(localHeaderView, 0, LOCAL_FILE_HEADER_SIGNATURE);
+ arraySet(localHeaderArray, headerArray, 4);
+ arraySet(localHeaderArray, rawFilename, 30);
+ arraySet(localHeaderArray, rawExtraFieldAES, 30 + rawFilename.length);
+ arraySet(localHeaderArray, rawExtraFieldExtendedTimestamp, 30 + rawFilename.length + rawExtraFieldAES.length);
+ arraySet(localHeaderArray, rawExtraFieldNTFS, 30 + rawFilename.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length);
+ arraySet(localHeaderArray, fileEntry.rawExtraField, 30 + rawFilename.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length);
+ let result;
+ let compressedSize = 0;
+ if (reader) {
+ const codec2 = await createCodec2(config2.Deflate, {
+ codecType: CODEC_DEFLATE,
+ level,
+ password,
+ encryptionStrength,
+ zipCrypto: encrypted && zipCrypto,
+ passwordVerification: encrypted && zipCrypto && rawLastModDate >> 8 & 255,
+ signed: true,
+ compressed,
+ encrypted,
+ useWebWorkers
+ }, config2);
+ await writer.writeUint8Array(localHeaderArray);
+ fileEntry.dataWritten = true;
+ result = await processData(codec2, reader, writer, 0, () => reader.size, config2, { onprogress, signal });
+ uncompressedSize = fileEntry.uncompressedSize = reader.size;
+ compressedSize = result.length;
+ } else {
+ await writer.writeUint8Array(localHeaderArray);
+ fileEntry.dataWritten = true;
+ }
+ let dataDescriptorArray = new Uint8Array(0);
+ let dataDescriptorView, dataDescriptorOffset = 0;
+ if (dataDescriptor) {
+ dataDescriptorArray = new Uint8Array(zip64 ? dataDescriptorSignature ? 24 : 20 : dataDescriptorSignature ? 16 : 12);
+ dataDescriptorView = getDataView2(dataDescriptorArray);
+ if (dataDescriptorSignature) {
+ dataDescriptorOffset = 4;
+ setUint322(dataDescriptorView, 0, DATA_DESCRIPTOR_RECORD_SIGNATURE);
+ }
+ }
+ if (reader) {
+ const signature = result.signature;
+ if ((!encrypted || zipCrypto) && signature !== void 0) {
+ setUint322(headerView, 10, signature);
+ fileEntry.signature = signature;
+ if (dataDescriptor) {
+ setUint322(dataDescriptorView, dataDescriptorOffset, signature);
+ }
+ }
+ if (zip64) {
+ const rawExtraFieldZip64View = getDataView2(fileEntry.rawExtraFieldZip64);
+ setUint16(rawExtraFieldZip64View, 0, EXTRAFIELD_TYPE_ZIP64);
+ setUint16(rawExtraFieldZip64View, 2, EXTRAFIELD_LENGTH_ZIP64);
+ setUint322(headerView, 14, MAX_32_BITS);
+ setBigUint64(rawExtraFieldZip64View, 12, BigInt(compressedSize));
+ setUint322(headerView, 18, MAX_32_BITS);
+ setBigUint64(rawExtraFieldZip64View, 4, BigInt(uncompressedSize));
+ if (dataDescriptor) {
+ setBigUint64(dataDescriptorView, dataDescriptorOffset + 4, BigInt(compressedSize));
+ setBigUint64(dataDescriptorView, dataDescriptorOffset + 12, BigInt(uncompressedSize));
+ }
+ } else {
+ setUint322(headerView, 14, compressedSize);
+ setUint322(headerView, 18, uncompressedSize);
+ if (dataDescriptor) {
+ setUint322(dataDescriptorView, dataDescriptorOffset + 4, compressedSize);
+ setUint322(dataDescriptorView, dataDescriptorOffset + 8, uncompressedSize);
+ }
+ }
+ }
+ if (dataDescriptor) {
+ await writer.writeUint8Array(dataDescriptorArray);
+ }
+ const length3 = localHeaderArray.length + compressedSize + dataDescriptorArray.length;
+ Object.assign(fileEntry, { compressedSize, lastModDate, rawLastModDate, creationDate, lastAccessDate, encrypted, length: length3 });
+ return fileEntry;
+}
+async function closeFile(zipWriter, comment, options) {
+ const writer = zipWriter.writer;
+ const files = zipWriter.files;
+ let offset2 = 0;
+ let directoryDataLength = 0;
+ let directoryOffset = zipWriter.offset;
+ let filesLength = files.size;
+ for (const [, fileEntry] of files) {
+ directoryDataLength += 46 + fileEntry.rawFilename.length + fileEntry.rawComment.length + fileEntry.rawExtraFieldZip64.length + fileEntry.rawExtraFieldAES.length + fileEntry.rawExtraFieldExtendedTimestamp.length + fileEntry.rawExtraFieldNTFS.length + fileEntry.rawExtraField.length;
+ }
+ let zip64 = options.zip64 || zipWriter.options.zip64 || false;
+ if (directoryOffset >= MAX_32_BITS || directoryDataLength >= MAX_32_BITS || filesLength >= MAX_16_BITS) {
+ if (options.zip64 === false || zipWriter.options.zip64 === false) {
+ throw new Error(ERR_UNSUPPORTED_FORMAT);
+ } else {
+ zip64 = true;
+ }
+ }
+ const directoryArray = new Uint8Array(directoryDataLength + (zip64 ? ZIP64_END_OF_CENTRAL_DIR_TOTAL_LENGTH : END_OF_CENTRAL_DIR_LENGTH));
+ const directoryView = getDataView2(directoryArray);
+ if (comment && comment.length) {
+ if (comment.length <= MAX_16_BITS) {
+ setUint16(directoryView, offset2 + 20, comment.length);
+ } else {
+ throw new Error(ERR_INVALID_COMMENT);
+ }
+ }
+ for (const [indexFileEntry, fileEntry] of Array.from(files.values()).entries()) {
+ const {
+ rawFilename,
+ rawExtraFieldZip64,
+ rawExtraFieldAES,
+ rawExtraField,
+ rawComment,
+ versionMadeBy,
+ headerArray,
+ directory,
+ zip64: zip642,
+ msDosCompatible,
+ internalFileAttribute,
+ externalFileAttribute
+ } = fileEntry;
+ let rawExtraFieldExtendedTimestamp;
+ let rawExtraFieldNTFS;
+ if (fileEntry.extendedTimestamp) {
+ rawExtraFieldNTFS = fileEntry.rawExtraFieldNTFS;
+ rawExtraFieldExtendedTimestamp = new Uint8Array(9);
+ const extraFieldExtendedTimestampView = getDataView2(rawExtraFieldExtendedTimestamp);
+ setUint16(extraFieldExtendedTimestampView, 0, EXTRAFIELD_TYPE_EXTENDED_TIMESTAMP);
+ setUint16(extraFieldExtendedTimestampView, 2, rawExtraFieldExtendedTimestamp.length - 4);
+ setUint8(extraFieldExtendedTimestampView, 4, 1);
+ setUint322(extraFieldExtendedTimestampView, 5, Math.floor(fileEntry.lastModDate.getTime() / 1e3));
+ } else {
+ rawExtraFieldNTFS = rawExtraFieldExtendedTimestamp = new Uint8Array(0);
+ }
+ const extraFieldLength = rawExtraFieldZip64.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length + rawExtraField.length;
+ setUint322(directoryView, offset2, CENTRAL_FILE_HEADER_SIGNATURE);
+ setUint16(directoryView, offset2 + 4, versionMadeBy);
+ arraySet(directoryArray, headerArray, offset2 + 6);
+ setUint16(directoryView, offset2 + 30, extraFieldLength);
+ setUint16(directoryView, offset2 + 32, rawComment.length);
+ setUint322(directoryView, offset2 + 34, internalFileAttribute);
+ if (externalFileAttribute) {
+ setUint322(directoryView, offset2 + 38, externalFileAttribute);
+ } else if (directory && msDosCompatible) {
+ setUint8(directoryView, offset2 + 38, FILE_ATTR_MSDOS_DIR_MASK);
+ }
+ if (zip642) {
+ setUint322(directoryView, offset2 + 42, MAX_32_BITS);
+ } else {
+ setUint322(directoryView, offset2 + 42, fileEntry.offset);
+ }
+ arraySet(directoryArray, rawFilename, offset2 + 46);
+ arraySet(directoryArray, rawExtraFieldZip64, offset2 + 46 + rawFilename.length);
+ arraySet(directoryArray, rawExtraFieldAES, offset2 + 46 + rawFilename.length + rawExtraFieldZip64.length);
+ arraySet(directoryArray, rawExtraFieldExtendedTimestamp, offset2 + 46 + rawFilename.length + rawExtraFieldZip64.length + rawExtraFieldAES.length);
+ arraySet(directoryArray, rawExtraFieldNTFS, offset2 + 46 + rawFilename.length + rawExtraFieldZip64.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length);
+ arraySet(directoryArray, rawExtraField, offset2 + 46 + rawFilename.length + rawExtraFieldZip64.length + rawExtraFieldAES.length + rawExtraFieldExtendedTimestamp.length + rawExtraFieldNTFS.length);
+ arraySet(directoryArray, rawComment, offset2 + 46 + rawFilename.length + extraFieldLength);
+ offset2 += 46 + rawFilename.length + extraFieldLength + rawComment.length;
+ if (options.onprogress) {
+ try {
+ options.onprogress(indexFileEntry + 1, files.size, new Entry(fileEntry));
+ } catch (_error) {
+ }
+ }
+ }
+ if (zip64) {
+ setUint322(directoryView, offset2, ZIP64_END_OF_CENTRAL_DIR_SIGNATURE);
+ setBigUint64(directoryView, offset2 + 4, BigInt(44));
+ setUint16(directoryView, offset2 + 12, 45);
+ setUint16(directoryView, offset2 + 14, 45);
+ setBigUint64(directoryView, offset2 + 24, BigInt(filesLength));
+ setBigUint64(directoryView, offset2 + 32, BigInt(filesLength));
+ setBigUint64(directoryView, offset2 + 40, BigInt(directoryDataLength));
+ setBigUint64(directoryView, offset2 + 48, BigInt(directoryOffset));
+ setUint322(directoryView, offset2 + 56, ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIGNATURE);
+ setBigUint64(directoryView, offset2 + 64, BigInt(directoryOffset) + BigInt(directoryDataLength));
+ setUint322(directoryView, offset2 + 72, ZIP64_TOTAL_NUMBER_OF_DISKS);
+ filesLength = MAX_16_BITS;
+ directoryOffset = MAX_32_BITS;
+ directoryDataLength = MAX_32_BITS;
+ offset2 += 76;
+ }
+ setUint322(directoryView, offset2, END_OF_CENTRAL_DIR_SIGNATURE);
+ setUint16(directoryView, offset2 + 8, filesLength);
+ setUint16(directoryView, offset2 + 10, filesLength);
+ setUint322(directoryView, offset2 + 12, directoryDataLength);
+ setUint322(directoryView, offset2 + 16, directoryOffset);
+ await writer.writeUint8Array(directoryArray);
+ if (comment && comment.length) {
+ await writer.writeUint8Array(comment);
+ }
+}
+function sliceAsArrayBuffer(blob, start, end) {
+ if (blob.arrayBuffer) {
+ if (start || end) {
+ return blob.slice(start, end).arrayBuffer();
+ } else {
+ return blob.arrayBuffer();
+ }
+ } else {
+ const fileReader = new FileReader();
+ return new Promise((resolve2, reject) => {
+ fileReader.onload = (event) => resolve2(event.target.result);
+ fileReader.onerror = () => reject(fileReader.error);
+ fileReader.readAsArrayBuffer(start || end ? blob.slice(start, end) : blob);
+ });
+ }
+}
+async function writeBlob(writer, blob, start = 0) {
+ const blockSize = 512 * 1024 * 1024;
+ await writeSlice();
+ async function writeSlice() {
+ if (start < blob.size) {
+ const arrayBuffer = await sliceAsArrayBuffer(blob, start, start + blockSize);
+ await writer.writeUint8Array(new Uint8Array(arrayBuffer));
+ start += blockSize;
+ await writeSlice();
+ }
+ }
+}
+function getTimeNTFS(date) {
+ if (date) {
+ return (BigInt(date.getTime()) + BigInt(116444736e5)) * BigInt(1e4);
+ }
+}
+function getOptionValue2(zipWriter, options, name) {
+ return options[name] === void 0 ? zipWriter.options[name] : options[name];
+}
+function getMaximumCompressedSize2(uncompressedSize) {
+ return uncompressedSize + 5 * (Math.floor(uncompressedSize / 16383) + 1);
+}
+function setUint8(view, offset2, value) {
+ view.setUint8(offset2, value);
+}
+function setUint16(view, offset2, value) {
+ view.setUint16(offset2, value, true);
+}
+function setUint322(view, offset2, value) {
+ view.setUint32(offset2, value, true);
+}
+function setBigUint64(view, offset2, value) {
+ view.setBigUint64(offset2, value, true);
+}
+function arraySet(array, typedArray, offset2) {
+ array.set(typedArray, offset2);
+}
+function getDataView2(array) {
+ return new DataView(array.buffer);
+}
+
+// node_modules/@zip.js/zip.js/lib/zip-no-worker.js
+configure({ Deflate: deflate_default, Inflate: inflate_default });
+
+// Source/DataSources/exportKml.js
+var BILLBOARD_SIZE = 32;
+var kmlNamespace = "http://www.opengis.net/kml/2.2";
+var gxNamespace = "http://www.google.com/kml/ext/2.2";
+var xmlnsNamespace = "http://www.w3.org/2000/xmlns/";
+function ExternalFileHandler(modelCallback) {
+ this._files = {};
+ this._promises = [];
+ this._count = 0;
+ this._modelCallback = modelCallback;
+}
+var imageTypeRegex = /^data:image\/([^,;]+)/;
+ExternalFileHandler.prototype.texture = function(texture) {
+ const that = this;
+ let filename;
+ if (typeof texture === "string" || texture instanceof Resource_default) {
+ texture = Resource_default.createIfNeeded(texture);
+ if (!texture.isDataUri) {
+ return texture.url;
+ }
+ const regexResult = texture.url.match(imageTypeRegex);
+ filename = `texture_${++this._count}`;
+ if (defined_default(regexResult)) {
+ filename += `.${regexResult[1]}`;
+ }
+ const promise = texture.fetchBlob().then(function(blob) {
+ that._files[filename] = blob;
+ });
+ this._promises.push(promise);
+ return filename;
+ }
+ if (texture instanceof HTMLCanvasElement) {
+ filename = `texture_${++this._count}.png`;
+ const promise = new Promise((resolve2) => {
+ texture.toBlob(function(blob) {
+ that._files[filename] = blob;
+ resolve2();
+ });
+ });
+ this._promises.push(promise);
+ return filename;
+ }
+ return "";
+};
+function getModelBlobHander(that, filename) {
+ return function(blob) {
+ that._files[filename] = blob;
+ };
+}
+ExternalFileHandler.prototype.model = function(model, time) {
+ const modelCallback = this._modelCallback;
+ if (!defined_default(modelCallback)) {
+ throw new RuntimeError_default(
+ "Encountered a model entity while exporting to KML, but no model callback was supplied."
+ );
+ }
+ const externalFiles = {};
+ const url2 = modelCallback(model, time, externalFiles);
+ for (const filename in externalFiles) {
+ if (externalFiles.hasOwnProperty(filename)) {
+ const promise = Promise.resolve(externalFiles[filename]);
+ this._promises.push(promise);
+ promise.then(getModelBlobHander(this, filename));
+ }
+ }
+ return url2;
+};
+Object.defineProperties(ExternalFileHandler.prototype, {
+ promise: {
+ get: function() {
+ return Promise.all(this._promises);
+ }
+ },
+ files: {
+ get: function() {
+ return this._files;
+ }
+ }
+});
+function ValueGetter(time) {
+ this._time = time;
+}
+ValueGetter.prototype.get = function(property, defaultVal, result) {
+ let value;
+ if (defined_default(property)) {
+ value = defined_default(property.getValue) ? property.getValue(this._time, result) : property;
+ }
+ return defaultValue_default(value, defaultVal);
+};
+ValueGetter.prototype.getColor = function(property, defaultVal) {
+ const result = this.get(property, defaultVal);
+ if (defined_default(result)) {
+ return colorToString(result);
+ }
+};
+ValueGetter.prototype.getMaterialType = function(property) {
+ if (!defined_default(property)) {
+ return;
+ }
+ return property.getType(this._time);
+};
+function StyleCache() {
+ this._ids = {};
+ this._styles = {};
+ this._count = 0;
+}
+StyleCache.prototype.get = function(element) {
+ const ids = this._ids;
+ const key = element.innerHTML;
+ if (defined_default(ids[key])) {
+ return ids[key];
+ }
+ let styleId = `style-${++this._count}`;
+ element.setAttribute("id", styleId);
+ styleId = `#${styleId}`;
+ ids[key] = styleId;
+ this._styles[key] = element;
+ return styleId;
+};
+StyleCache.prototype.save = function(parentElement) {
+ const styles = this._styles;
+ const firstElement = parentElement.childNodes[0];
+ for (const key in styles) {
+ if (styles.hasOwnProperty(key)) {
+ parentElement.insertBefore(styles[key], firstElement);
+ }
+ }
+};
+function IdManager() {
+ this._ids = {};
+}
+IdManager.prototype.get = function(id) {
+ if (!defined_default(id)) {
+ return this.get(createGuid_default());
+ }
+ const ids = this._ids;
+ if (!defined_default(ids[id])) {
+ ids[id] = 0;
+ return id;
+ }
+ return `${id.toString()}-${++ids[id]}`;
+};
+function exportKml(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const entities = options.entities;
+ const kmz = defaultValue_default(options.kmz, false);
+ if (!defined_default(entities)) {
+ throw new DeveloperError_default("entities is required.");
+ }
+ const state = exportKml._createState(options);
+ const rootEntities = entities.values.filter(function(entity) {
+ return !defined_default(entity.parent);
+ });
+ const kmlDoc = state.kmlDoc;
+ const kmlElement = kmlDoc.documentElement;
+ kmlElement.setAttributeNS(xmlnsNamespace, "xmlns:gx", gxNamespace);
+ const kmlDocumentElement = kmlDoc.createElement("Document");
+ kmlElement.appendChild(kmlDocumentElement);
+ recurseEntities(state, kmlDocumentElement, rootEntities);
+ state.styleCache.save(kmlDocumentElement);
+ const externalFileHandler = state.externalFileHandler;
+ return externalFileHandler.promise.then(function() {
+ const serializer = new XMLSerializer();
+ const kmlString = serializer.serializeToString(state.kmlDoc);
+ if (kmz) {
+ return createKmz(kmlString, externalFileHandler.files);
+ }
+ return {
+ kml: kmlString,
+ externalFiles: externalFileHandler.files
+ };
+ });
+}
+function createKmz(kmlString, externalFiles) {
+ const zWorkerUrl = buildModuleUrl_default("ThirdParty/Workers/z-worker-pako.js");
+ configure({
+ workerScripts: {
+ deflate: [zWorkerUrl, "./pako_deflate.min.js"],
+ inflate: [zWorkerUrl, "./pako_inflate.min.js"]
+ }
+ });
+ const blobWriter = new BlobWriter();
+ const writer = new ZipWriter(blobWriter);
+ return writer.add("doc.kml", new TextReader(kmlString)).then(function() {
+ const keys = Object.keys(externalFiles);
+ return addExternalFilesToZip(writer, keys, externalFiles, 0);
+ }).then(function() {
+ return writer.close();
+ }).then(function(blob) {
+ return {
+ kmz: blob
+ };
+ });
+}
+function addExternalFilesToZip(writer, keys, externalFiles, index) {
+ if (keys.length === index) {
+ return;
+ }
+ const filename = keys[index];
+ return writer.add(filename, new BlobReader(externalFiles[filename])).then(function() {
+ return addExternalFilesToZip(writer, keys, externalFiles, index + 1);
+ });
+}
+exportKml._createState = function(options) {
+ const entities = options.entities;
+ const styleCache = new StyleCache();
+ const entityAvailability = entities.computeAvailability();
+ const time = defined_default(options.time) ? options.time : entityAvailability.start;
+ let defaultAvailability = defaultValue_default(
+ options.defaultAvailability,
+ entityAvailability
+ );
+ const sampleDuration = defaultValue_default(options.sampleDuration, 60);
+ if (defaultAvailability.start === Iso8601_default.MINIMUM_VALUE) {
+ if (defaultAvailability.stop === Iso8601_default.MAXIMUM_VALUE) {
+ defaultAvailability = new TimeInterval_default();
+ } else {
+ JulianDate_default.addSeconds(
+ defaultAvailability.stop,
+ -10 * sampleDuration,
+ defaultAvailability.start
+ );
+ }
+ } else if (defaultAvailability.stop === Iso8601_default.MAXIMUM_VALUE) {
+ JulianDate_default.addSeconds(
+ defaultAvailability.start,
+ 10 * sampleDuration,
+ defaultAvailability.stop
+ );
+ }
+ const externalFileHandler = new ExternalFileHandler(options.modelCallback);
+ const kmlDoc = document.implementation.createDocument(kmlNamespace, "kml");
+ return {
+ kmlDoc,
+ ellipsoid: defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84),
+ idManager: new IdManager(),
+ styleCache,
+ externalFileHandler,
+ time,
+ valueGetter: new ValueGetter(time),
+ sampleDuration,
+ defaultAvailability: new TimeIntervalCollection_default([defaultAvailability])
+ };
+};
+function recurseEntities(state, parentNode, entities) {
+ const kmlDoc = state.kmlDoc;
+ const styleCache = state.styleCache;
+ const valueGetter = state.valueGetter;
+ const idManager = state.idManager;
+ const count = entities.length;
+ let overlays;
+ let geometries;
+ let styles;
+ for (let i = 0; i < count; ++i) {
+ const entity = entities[i];
+ overlays = [];
+ geometries = [];
+ styles = [];
+ createPoint(state, entity, geometries, styles);
+ createLineString(state, entity.polyline, geometries, styles);
+ createPolygon(state, entity.rectangle, geometries, styles, overlays);
+ createPolygon(state, entity.polygon, geometries, styles, overlays);
+ createModel(state, entity, entity.model, geometries, styles);
+ let timeSpan;
+ const availability = entity.availability;
+ if (defined_default(availability)) {
+ timeSpan = kmlDoc.createElement("TimeSpan");
+ if (!JulianDate_default.equals(availability.start, Iso8601_default.MINIMUM_VALUE)) {
+ timeSpan.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "begin",
+ JulianDate_default.toIso8601(availability.start)
+ )
+ );
+ }
+ if (!JulianDate_default.equals(availability.stop, Iso8601_default.MAXIMUM_VALUE)) {
+ timeSpan.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "end",
+ JulianDate_default.toIso8601(availability.stop)
+ )
+ );
+ }
+ }
+ for (let overlayIndex = 0; overlayIndex < overlays.length; ++overlayIndex) {
+ const overlay = overlays[overlayIndex];
+ overlay.setAttribute("id", idManager.get(entity.id));
+ overlay.appendChild(
+ createBasicElementWithText(kmlDoc, "name", entity.name)
+ );
+ overlay.appendChild(
+ createBasicElementWithText(kmlDoc, "visibility", entity.show)
+ );
+ overlay.appendChild(
+ createBasicElementWithText(kmlDoc, "description", entity.description)
+ );
+ if (defined_default(timeSpan)) {
+ overlay.appendChild(timeSpan);
+ }
+ parentNode.appendChild(overlay);
+ }
+ const geometryCount = geometries.length;
+ if (geometryCount > 0) {
+ const placemark = kmlDoc.createElement("Placemark");
+ placemark.setAttribute("id", idManager.get(entity.id));
+ let name = entity.name;
+ const labelGraphics = entity.label;
+ if (defined_default(labelGraphics)) {
+ const labelStyle = kmlDoc.createElement("LabelStyle");
+ const text = valueGetter.get(labelGraphics.text);
+ name = defined_default(text) && text.length > 0 ? text : name;
+ const color = valueGetter.getColor(labelGraphics.fillColor);
+ if (defined_default(color)) {
+ labelStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "color", color)
+ );
+ labelStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "colorMode", "normal")
+ );
+ }
+ const scale = valueGetter.get(labelGraphics.scale);
+ if (defined_default(scale)) {
+ labelStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "scale", scale)
+ );
+ }
+ styles.push(labelStyle);
+ }
+ placemark.appendChild(createBasicElementWithText(kmlDoc, "name", name));
+ placemark.appendChild(
+ createBasicElementWithText(kmlDoc, "visibility", entity.show)
+ );
+ placemark.appendChild(
+ createBasicElementWithText(kmlDoc, "description", entity.description)
+ );
+ if (defined_default(timeSpan)) {
+ placemark.appendChild(timeSpan);
+ }
+ parentNode.appendChild(placemark);
+ const styleCount = styles.length;
+ if (styleCount > 0) {
+ const style = kmlDoc.createElement("Style");
+ for (let styleIndex = 0; styleIndex < styleCount; ++styleIndex) {
+ style.appendChild(styles[styleIndex]);
+ }
+ placemark.appendChild(
+ createBasicElementWithText(kmlDoc, "styleUrl", styleCache.get(style))
+ );
+ }
+ if (geometries.length === 1) {
+ placemark.appendChild(geometries[0]);
+ } else if (geometries.length > 1) {
+ const multigeometry = kmlDoc.createElement("MultiGeometry");
+ for (let geometryIndex = 0; geometryIndex < geometryCount; ++geometryIndex) {
+ multigeometry.appendChild(geometries[geometryIndex]);
+ }
+ placemark.appendChild(multigeometry);
+ }
+ }
+ const children = entity._children;
+ if (children.length > 0) {
+ const folderNode = kmlDoc.createElement("Folder");
+ folderNode.setAttribute("id", idManager.get(entity.id));
+ folderNode.appendChild(
+ createBasicElementWithText(kmlDoc, "name", entity.name)
+ );
+ folderNode.appendChild(
+ createBasicElementWithText(kmlDoc, "visibility", entity.show)
+ );
+ folderNode.appendChild(
+ createBasicElementWithText(kmlDoc, "description", entity.description)
+ );
+ parentNode.appendChild(folderNode);
+ recurseEntities(state, folderNode, children);
+ }
+ }
+}
+var scratchCartesian310 = new Cartesian3_default();
+var scratchCartographic14 = new Cartographic_default();
+var scratchJulianDate3 = new JulianDate_default();
+function createPoint(state, entity, geometries, styles) {
+ const kmlDoc = state.kmlDoc;
+ const ellipsoid = state.ellipsoid;
+ const valueGetter = state.valueGetter;
+ const pointGraphics = defaultValue_default(entity.billboard, entity.point);
+ if (!defined_default(pointGraphics) && !defined_default(entity.path)) {
+ return;
+ }
+ const entityPositionProperty = entity.position;
+ if (!entityPositionProperty.isConstant) {
+ createTracks(state, entity, pointGraphics, geometries, styles);
+ return;
+ }
+ valueGetter.get(entityPositionProperty, void 0, scratchCartesian310);
+ const coordinates = createBasicElementWithText(
+ kmlDoc,
+ "coordinates",
+ getCoordinates(scratchCartesian310, ellipsoid)
+ );
+ const pointGeometry = kmlDoc.createElement("Point");
+ const altitudeMode = kmlDoc.createElement("altitudeMode");
+ altitudeMode.appendChild(
+ getAltitudeMode(state, pointGraphics.heightReference)
+ );
+ pointGeometry.appendChild(altitudeMode);
+ pointGeometry.appendChild(coordinates);
+ geometries.push(pointGeometry);
+ const iconStyle = pointGraphics instanceof BillboardGraphics_default ? createIconStyleFromBillboard(state, pointGraphics) : createIconStyleFromPoint(state, pointGraphics);
+ styles.push(iconStyle);
+}
+function createTracks(state, entity, pointGraphics, geometries, styles) {
+ const kmlDoc = state.kmlDoc;
+ const ellipsoid = state.ellipsoid;
+ const valueGetter = state.valueGetter;
+ let intervals;
+ const entityPositionProperty = entity.position;
+ let useEntityPositionProperty = true;
+ if (entityPositionProperty instanceof CompositePositionProperty_default) {
+ intervals = entityPositionProperty.intervals;
+ useEntityPositionProperty = false;
+ } else {
+ intervals = defaultValue_default(entity.availability, state.defaultAvailability);
+ }
+ const isModel = pointGraphics instanceof ModelGraphics_default;
+ let i, j, times;
+ const tracks = [];
+ for (i = 0; i < intervals.length; ++i) {
+ const interval = intervals.get(i);
+ let positionProperty = useEntityPositionProperty ? entityPositionProperty : interval.data;
+ const trackAltitudeMode = kmlDoc.createElement("altitudeMode");
+ if (positionProperty instanceof ScaledPositionProperty_default) {
+ positionProperty = positionProperty._value;
+ trackAltitudeMode.appendChild(
+ getAltitudeMode(state, HeightReference_default.CLAMP_TO_GROUND)
+ );
+ } else if (defined_default(pointGraphics)) {
+ trackAltitudeMode.appendChild(
+ getAltitudeMode(state, pointGraphics.heightReference)
+ );
+ } else {
+ trackAltitudeMode.appendChild(
+ getAltitudeMode(state, HeightReference_default.NONE)
+ );
+ }
+ const positionTimes = [];
+ const positionValues = [];
+ if (positionProperty.isConstant) {
+ valueGetter.get(positionProperty, void 0, scratchCartesian310);
+ const constCoordinates = createBasicElementWithText(
+ kmlDoc,
+ "coordinates",
+ getCoordinates(scratchCartesian310, ellipsoid)
+ );
+ positionTimes.push(JulianDate_default.toIso8601(interval.start));
+ positionValues.push(constCoordinates);
+ positionTimes.push(JulianDate_default.toIso8601(interval.stop));
+ positionValues.push(constCoordinates);
+ } else if (positionProperty instanceof SampledPositionProperty_default) {
+ times = positionProperty._property._times;
+ for (j = 0; j < times.length; ++j) {
+ positionTimes.push(JulianDate_default.toIso8601(times[j]));
+ positionProperty.getValueInReferenceFrame(
+ times[j],
+ ReferenceFrame_default.FIXED,
+ scratchCartesian310
+ );
+ positionValues.push(getCoordinates(scratchCartesian310, ellipsoid));
+ }
+ } else if (positionProperty instanceof SampledProperty_default) {
+ times = positionProperty._times;
+ const values = positionProperty._values;
+ for (j = 0; j < times.length; ++j) {
+ positionTimes.push(JulianDate_default.toIso8601(times[j]));
+ Cartesian3_default.fromArray(values, j * 3, scratchCartesian310);
+ positionValues.push(getCoordinates(scratchCartesian310, ellipsoid));
+ }
+ } else {
+ const duration = state.sampleDuration;
+ interval.start.clone(scratchJulianDate3);
+ if (!interval.isStartIncluded) {
+ JulianDate_default.addSeconds(scratchJulianDate3, duration, scratchJulianDate3);
+ }
+ const stopDate = interval.stop;
+ while (JulianDate_default.lessThan(scratchJulianDate3, stopDate)) {
+ positionProperty.getValue(scratchJulianDate3, scratchCartesian310);
+ positionTimes.push(JulianDate_default.toIso8601(scratchJulianDate3));
+ positionValues.push(getCoordinates(scratchCartesian310, ellipsoid));
+ JulianDate_default.addSeconds(scratchJulianDate3, duration, scratchJulianDate3);
+ }
+ if (interval.isStopIncluded && JulianDate_default.equals(scratchJulianDate3, stopDate)) {
+ positionProperty.getValue(scratchJulianDate3, scratchCartesian310);
+ positionTimes.push(JulianDate_default.toIso8601(scratchJulianDate3));
+ positionValues.push(getCoordinates(scratchCartesian310, ellipsoid));
+ }
+ }
+ const trackGeometry = kmlDoc.createElementNS(gxNamespace, "Track");
+ trackGeometry.appendChild(trackAltitudeMode);
+ for (let k = 0; k < positionTimes.length; ++k) {
+ const when = createBasicElementWithText(kmlDoc, "when", positionTimes[k]);
+ const coord = createBasicElementWithText(
+ kmlDoc,
+ "coord",
+ positionValues[k],
+ gxNamespace
+ );
+ trackGeometry.appendChild(when);
+ trackGeometry.appendChild(coord);
+ }
+ if (isModel) {
+ trackGeometry.appendChild(createModelGeometry(state, pointGraphics));
+ }
+ tracks.push(trackGeometry);
+ }
+ if (tracks.length === 1) {
+ geometries.push(tracks[0]);
+ } else if (tracks.length > 1) {
+ const multiTrackGeometry = kmlDoc.createElementNS(
+ gxNamespace,
+ "MultiTrack"
+ );
+ for (i = 0; i < tracks.length; ++i) {
+ multiTrackGeometry.appendChild(tracks[i]);
+ }
+ geometries.push(multiTrackGeometry);
+ }
+ if (defined_default(pointGraphics) && !isModel) {
+ const iconStyle = pointGraphics instanceof BillboardGraphics_default ? createIconStyleFromBillboard(state, pointGraphics) : createIconStyleFromPoint(state, pointGraphics);
+ styles.push(iconStyle);
+ }
+ const path = entity.path;
+ if (defined_default(path)) {
+ const width = valueGetter.get(path.width);
+ const material = path.material;
+ if (defined_default(material) || defined_default(width)) {
+ const lineStyle = kmlDoc.createElement("LineStyle");
+ if (defined_default(width)) {
+ lineStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "width", width)
+ );
+ }
+ processMaterial(state, material, lineStyle);
+ styles.push(lineStyle);
+ }
+ }
+}
+function createIconStyleFromPoint(state, pointGraphics) {
+ const kmlDoc = state.kmlDoc;
+ const valueGetter = state.valueGetter;
+ const iconStyle = kmlDoc.createElement("IconStyle");
+ const color = valueGetter.getColor(pointGraphics.color);
+ if (defined_default(color)) {
+ iconStyle.appendChild(createBasicElementWithText(kmlDoc, "color", color));
+ iconStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "colorMode", "normal")
+ );
+ }
+ const pixelSize = valueGetter.get(pointGraphics.pixelSize);
+ if (defined_default(pixelSize)) {
+ iconStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "scale", pixelSize / BILLBOARD_SIZE)
+ );
+ }
+ return iconStyle;
+}
+function createIconStyleFromBillboard(state, billboardGraphics) {
+ const kmlDoc = state.kmlDoc;
+ const valueGetter = state.valueGetter;
+ const externalFileHandler = state.externalFileHandler;
+ const iconStyle = kmlDoc.createElement("IconStyle");
+ let image = valueGetter.get(billboardGraphics.image);
+ if (defined_default(image)) {
+ image = externalFileHandler.texture(image);
+ const icon = kmlDoc.createElement("Icon");
+ icon.appendChild(createBasicElementWithText(kmlDoc, "href", image));
+ const imageSubRegion = valueGetter.get(billboardGraphics.imageSubRegion);
+ if (defined_default(imageSubRegion)) {
+ icon.appendChild(
+ createBasicElementWithText(kmlDoc, "x", imageSubRegion.x, gxNamespace)
+ );
+ icon.appendChild(
+ createBasicElementWithText(kmlDoc, "y", imageSubRegion.y, gxNamespace)
+ );
+ icon.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "w",
+ imageSubRegion.width,
+ gxNamespace
+ )
+ );
+ icon.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "h",
+ imageSubRegion.height,
+ gxNamespace
+ )
+ );
+ }
+ iconStyle.appendChild(icon);
+ }
+ const color = valueGetter.getColor(billboardGraphics.color);
+ if (defined_default(color)) {
+ iconStyle.appendChild(createBasicElementWithText(kmlDoc, "color", color));
+ iconStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "colorMode", "normal")
+ );
+ }
+ let scale = valueGetter.get(billboardGraphics.scale);
+ if (defined_default(scale)) {
+ iconStyle.appendChild(createBasicElementWithText(kmlDoc, "scale", scale));
+ }
+ const pixelOffset = valueGetter.get(billboardGraphics.pixelOffset);
+ if (defined_default(pixelOffset)) {
+ scale = defaultValue_default(scale, 1);
+ Cartesian2_default.divideByScalar(pixelOffset, scale, pixelOffset);
+ const width = valueGetter.get(billboardGraphics.width, BILLBOARD_SIZE);
+ const height = valueGetter.get(billboardGraphics.height, BILLBOARD_SIZE);
+ const horizontalOrigin = valueGetter.get(
+ billboardGraphics.horizontalOrigin,
+ HorizontalOrigin_default.CENTER
+ );
+ if (horizontalOrigin === HorizontalOrigin_default.CENTER) {
+ pixelOffset.x -= width * 0.5;
+ } else if (horizontalOrigin === HorizontalOrigin_default.RIGHT) {
+ pixelOffset.x -= width;
+ }
+ const verticalOrigin = valueGetter.get(
+ billboardGraphics.verticalOrigin,
+ VerticalOrigin_default.CENTER
+ );
+ if (verticalOrigin === VerticalOrigin_default.TOP) {
+ pixelOffset.y += height;
+ } else if (verticalOrigin === VerticalOrigin_default.CENTER) {
+ pixelOffset.y += height * 0.5;
+ }
+ const hotSpot = kmlDoc.createElement("hotSpot");
+ hotSpot.setAttribute("x", -pixelOffset.x);
+ hotSpot.setAttribute("y", pixelOffset.y);
+ hotSpot.setAttribute("xunits", "pixels");
+ hotSpot.setAttribute("yunits", "pixels");
+ iconStyle.appendChild(hotSpot);
+ }
+ let rotation = valueGetter.get(billboardGraphics.rotation);
+ const alignedAxis = valueGetter.get(billboardGraphics.alignedAxis);
+ if (defined_default(rotation) && Cartesian3_default.equals(Cartesian3_default.UNIT_Z, alignedAxis)) {
+ rotation = Math_default.toDegrees(-rotation);
+ if (rotation === 0) {
+ rotation = 360;
+ }
+ iconStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "heading", rotation)
+ );
+ }
+ return iconStyle;
+}
+function createLineString(state, polylineGraphics, geometries, styles) {
+ const kmlDoc = state.kmlDoc;
+ const ellipsoid = state.ellipsoid;
+ const valueGetter = state.valueGetter;
+ if (!defined_default(polylineGraphics)) {
+ return;
+ }
+ const lineStringGeometry = kmlDoc.createElement("LineString");
+ const altitudeMode = kmlDoc.createElement("altitudeMode");
+ const clampToGround = valueGetter.get(polylineGraphics.clampToGround, false);
+ let altitudeModeText;
+ if (clampToGround) {
+ lineStringGeometry.appendChild(
+ createBasicElementWithText(kmlDoc, "tessellate", true)
+ );
+ altitudeModeText = kmlDoc.createTextNode("clampToGround");
+ } else {
+ altitudeModeText = kmlDoc.createTextNode("absolute");
+ }
+ altitudeMode.appendChild(altitudeModeText);
+ lineStringGeometry.appendChild(altitudeMode);
+ const positionsProperty = polylineGraphics.positions;
+ const cartesians = valueGetter.get(positionsProperty);
+ const coordinates = createBasicElementWithText(
+ kmlDoc,
+ "coordinates",
+ getCoordinates(cartesians, ellipsoid)
+ );
+ lineStringGeometry.appendChild(coordinates);
+ const zIndex = valueGetter.get(polylineGraphics.zIndex);
+ if (clampToGround && defined_default(zIndex)) {
+ lineStringGeometry.appendChild(
+ createBasicElementWithText(kmlDoc, "drawOrder", zIndex, gxNamespace)
+ );
+ }
+ geometries.push(lineStringGeometry);
+ const lineStyle = kmlDoc.createElement("LineStyle");
+ const width = valueGetter.get(polylineGraphics.width);
+ if (defined_default(width)) {
+ lineStyle.appendChild(createBasicElementWithText(kmlDoc, "width", width));
+ }
+ processMaterial(state, polylineGraphics.material, lineStyle);
+ styles.push(lineStyle);
+}
+function getRectangleBoundaries(state, rectangleGraphics, extrudedHeight) {
+ const kmlDoc = state.kmlDoc;
+ const valueGetter = state.valueGetter;
+ let height = valueGetter.get(rectangleGraphics.height, 0);
+ if (extrudedHeight > 0) {
+ height = extrudedHeight;
+ }
+ const coordinatesProperty = rectangleGraphics.coordinates;
+ const rectangle = valueGetter.get(coordinatesProperty);
+ const coordinateStrings = [];
+ const cornerFunction = [
+ Rectangle_default.northeast,
+ Rectangle_default.southeast,
+ Rectangle_default.southwest,
+ Rectangle_default.northwest
+ ];
+ for (let i = 0; i < 4; ++i) {
+ cornerFunction[i](rectangle, scratchCartographic14);
+ coordinateStrings.push(
+ `${Math_default.toDegrees(
+ scratchCartographic14.longitude
+ )},${Math_default.toDegrees(scratchCartographic14.latitude)},${height}`
+ );
+ }
+ const coordinates = createBasicElementWithText(
+ kmlDoc,
+ "coordinates",
+ coordinateStrings.join(" ")
+ );
+ const outerBoundaryIs = kmlDoc.createElement("outerBoundaryIs");
+ const linearRing = kmlDoc.createElement("LinearRing");
+ linearRing.appendChild(coordinates);
+ outerBoundaryIs.appendChild(linearRing);
+ return [outerBoundaryIs];
+}
+function getLinearRing(state, positions, height, perPositionHeight) {
+ const kmlDoc = state.kmlDoc;
+ const ellipsoid = state.ellipsoid;
+ const coordinateStrings = [];
+ const positionCount = positions.length;
+ for (let i = 0; i < positionCount; ++i) {
+ Cartographic_default.fromCartesian(positions[i], ellipsoid, scratchCartographic14);
+ coordinateStrings.push(
+ `${Math_default.toDegrees(
+ scratchCartographic14.longitude
+ )},${Math_default.toDegrees(scratchCartographic14.latitude)},${perPositionHeight ? scratchCartographic14.height : height}`
+ );
+ }
+ const coordinates = createBasicElementWithText(
+ kmlDoc,
+ "coordinates",
+ coordinateStrings.join(" ")
+ );
+ const linearRing = kmlDoc.createElement("LinearRing");
+ linearRing.appendChild(coordinates);
+ return linearRing;
+}
+function getPolygonBoundaries(state, polygonGraphics, extrudedHeight) {
+ const kmlDoc = state.kmlDoc;
+ const valueGetter = state.valueGetter;
+ let height = valueGetter.get(polygonGraphics.height, 0);
+ const perPositionHeight = valueGetter.get(
+ polygonGraphics.perPositionHeight,
+ false
+ );
+ if (!perPositionHeight && extrudedHeight > 0) {
+ height = extrudedHeight;
+ }
+ const boundaries = [];
+ const hierarchyProperty = polygonGraphics.hierarchy;
+ const hierarchy = valueGetter.get(hierarchyProperty);
+ const positions = Array.isArray(hierarchy) ? hierarchy : hierarchy.positions;
+ const outerBoundaryIs = kmlDoc.createElement("outerBoundaryIs");
+ outerBoundaryIs.appendChild(
+ getLinearRing(state, positions, height, perPositionHeight)
+ );
+ boundaries.push(outerBoundaryIs);
+ const holes = hierarchy.holes;
+ if (defined_default(holes)) {
+ const holeCount = holes.length;
+ for (let i = 0; i < holeCount; ++i) {
+ const innerBoundaryIs = kmlDoc.createElement("innerBoundaryIs");
+ innerBoundaryIs.appendChild(
+ getLinearRing(state, holes[i].positions, height, perPositionHeight)
+ );
+ boundaries.push(innerBoundaryIs);
+ }
+ }
+ return boundaries;
+}
+function createPolygon(state, geometry, geometries, styles, overlays) {
+ const kmlDoc = state.kmlDoc;
+ const valueGetter = state.valueGetter;
+ if (!defined_default(geometry)) {
+ return;
+ }
+ const isRectangle = geometry instanceof RectangleGraphics_default;
+ if (isRectangle && valueGetter.getMaterialType(geometry.material) === "Image") {
+ createGroundOverlay(state, geometry, overlays);
+ return;
+ }
+ const polygonGeometry = kmlDoc.createElement("Polygon");
+ const extrudedHeight = valueGetter.get(geometry.extrudedHeight, 0);
+ if (extrudedHeight > 0) {
+ polygonGeometry.appendChild(
+ createBasicElementWithText(kmlDoc, "extrude", true)
+ );
+ }
+ const boundaries = isRectangle ? getRectangleBoundaries(state, geometry, extrudedHeight) : getPolygonBoundaries(state, geometry, extrudedHeight);
+ const boundaryCount = boundaries.length;
+ for (let i = 0; i < boundaryCount; ++i) {
+ polygonGeometry.appendChild(boundaries[i]);
+ }
+ const altitudeMode = kmlDoc.createElement("altitudeMode");
+ altitudeMode.appendChild(getAltitudeMode(state, geometry.heightReference));
+ polygonGeometry.appendChild(altitudeMode);
+ geometries.push(polygonGeometry);
+ const polyStyle = kmlDoc.createElement("PolyStyle");
+ const fill = valueGetter.get(geometry.fill, false);
+ if (fill) {
+ polyStyle.appendChild(createBasicElementWithText(kmlDoc, "fill", fill));
+ }
+ processMaterial(state, geometry.material, polyStyle);
+ const outline = valueGetter.get(geometry.outline, false);
+ if (outline) {
+ polyStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "outline", outline)
+ );
+ const lineStyle = kmlDoc.createElement("LineStyle");
+ const outlineWidth = valueGetter.get(geometry.outlineWidth, 1);
+ lineStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "width", outlineWidth)
+ );
+ const outlineColor = valueGetter.getColor(
+ geometry.outlineColor,
+ Color_default.BLACK
+ );
+ lineStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "color", outlineColor)
+ );
+ lineStyle.appendChild(
+ createBasicElementWithText(kmlDoc, "colorMode", "normal")
+ );
+ styles.push(lineStyle);
+ }
+ styles.push(polyStyle);
+}
+function createGroundOverlay(state, rectangleGraphics, overlays) {
+ const kmlDoc = state.kmlDoc;
+ const valueGetter = state.valueGetter;
+ const externalFileHandler = state.externalFileHandler;
+ const groundOverlay = kmlDoc.createElement("GroundOverlay");
+ const altitudeMode = kmlDoc.createElement("altitudeMode");
+ altitudeMode.appendChild(
+ getAltitudeMode(state, rectangleGraphics.heightReference)
+ );
+ groundOverlay.appendChild(altitudeMode);
+ const height = valueGetter.get(rectangleGraphics.height);
+ if (defined_default(height)) {
+ groundOverlay.appendChild(
+ createBasicElementWithText(kmlDoc, "altitude", height)
+ );
+ }
+ const rectangle = valueGetter.get(rectangleGraphics.coordinates);
+ const latLonBox = kmlDoc.createElement("LatLonBox");
+ latLonBox.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "north",
+ Math_default.toDegrees(rectangle.north)
+ )
+ );
+ latLonBox.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "south",
+ Math_default.toDegrees(rectangle.south)
+ )
+ );
+ latLonBox.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "east",
+ Math_default.toDegrees(rectangle.east)
+ )
+ );
+ latLonBox.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "west",
+ Math_default.toDegrees(rectangle.west)
+ )
+ );
+ groundOverlay.appendChild(latLonBox);
+ const material = valueGetter.get(rectangleGraphics.material);
+ const href = externalFileHandler.texture(material.image);
+ const icon = kmlDoc.createElement("Icon");
+ icon.appendChild(createBasicElementWithText(kmlDoc, "href", href));
+ groundOverlay.appendChild(icon);
+ const color = material.color;
+ if (defined_default(color)) {
+ groundOverlay.appendChild(
+ createBasicElementWithText(kmlDoc, "color", colorToString(material.color))
+ );
+ }
+ overlays.push(groundOverlay);
+}
+function createModelGeometry(state, modelGraphics) {
+ const kmlDoc = state.kmlDoc;
+ const valueGetter = state.valueGetter;
+ const externalFileHandler = state.externalFileHandler;
+ const modelGeometry = kmlDoc.createElement("Model");
+ const scale = valueGetter.get(modelGraphics.scale);
+ if (defined_default(scale)) {
+ const scaleElement = kmlDoc.createElement("scale");
+ scaleElement.appendChild(createBasicElementWithText(kmlDoc, "x", scale));
+ scaleElement.appendChild(createBasicElementWithText(kmlDoc, "y", scale));
+ scaleElement.appendChild(createBasicElementWithText(kmlDoc, "z", scale));
+ modelGeometry.appendChild(scaleElement);
+ }
+ const link = kmlDoc.createElement("Link");
+ const uri = externalFileHandler.model(modelGraphics, state.time);
+ link.appendChild(createBasicElementWithText(kmlDoc, "href", uri));
+ modelGeometry.appendChild(link);
+ return modelGeometry;
+}
+function createModel(state, entity, modelGraphics, geometries, styles) {
+ const kmlDoc = state.kmlDoc;
+ const ellipsoid = state.ellipsoid;
+ const valueGetter = state.valueGetter;
+ if (!defined_default(modelGraphics)) {
+ return;
+ }
+ const entityPositionProperty = entity.position;
+ if (!entityPositionProperty.isConstant) {
+ createTracks(state, entity, modelGraphics, geometries, styles);
+ return;
+ }
+ const modelGeometry = createModelGeometry(state, modelGraphics);
+ const altitudeMode = kmlDoc.createElement("altitudeMode");
+ altitudeMode.appendChild(
+ getAltitudeMode(state, modelGraphics.heightReference)
+ );
+ modelGeometry.appendChild(altitudeMode);
+ valueGetter.get(entityPositionProperty, void 0, scratchCartesian310);
+ Cartographic_default.fromCartesian(scratchCartesian310, ellipsoid, scratchCartographic14);
+ const location2 = kmlDoc.createElement("Location");
+ location2.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "longitude",
+ Math_default.toDegrees(scratchCartographic14.longitude)
+ )
+ );
+ location2.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "latitude",
+ Math_default.toDegrees(scratchCartographic14.latitude)
+ )
+ );
+ location2.appendChild(
+ createBasicElementWithText(kmlDoc, "altitude", scratchCartographic14.height)
+ );
+ modelGeometry.appendChild(location2);
+ geometries.push(modelGeometry);
+}
+function processMaterial(state, materialProperty, style) {
+ const kmlDoc = state.kmlDoc;
+ const valueGetter = state.valueGetter;
+ if (!defined_default(materialProperty)) {
+ return;
+ }
+ const material = valueGetter.get(materialProperty);
+ if (!defined_default(material)) {
+ return;
+ }
+ let color;
+ const type = valueGetter.getMaterialType(materialProperty);
+ let outlineColor;
+ let outlineWidth;
+ switch (type) {
+ case "Image":
+ color = colorToString(Color_default.WHITE);
+ break;
+ case "Color":
+ case "Grid":
+ case "PolylineGlow":
+ case "PolylineArrow":
+ case "PolylineDash":
+ color = colorToString(material.color);
+ break;
+ case "PolylineOutline":
+ color = colorToString(material.color);
+ outlineColor = colorToString(material.outlineColor);
+ outlineWidth = material.outlineWidth;
+ style.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "outerColor",
+ outlineColor,
+ gxNamespace
+ )
+ );
+ style.appendChild(
+ createBasicElementWithText(
+ kmlDoc,
+ "outerWidth",
+ outlineWidth,
+ gxNamespace
+ )
+ );
+ break;
+ case "Stripe":
+ color = colorToString(material.oddColor);
+ break;
+ }
+ if (defined_default(color)) {
+ style.appendChild(createBasicElementWithText(kmlDoc, "color", color));
+ style.appendChild(
+ createBasicElementWithText(kmlDoc, "colorMode", "normal")
+ );
+ }
+}
+function getAltitudeMode(state, heightReferenceProperty) {
+ const kmlDoc = state.kmlDoc;
+ const valueGetter = state.valueGetter;
+ const heightReference = valueGetter.get(
+ heightReferenceProperty,
+ HeightReference_default.NONE
+ );
+ let altitudeModeText;
+ switch (heightReference) {
+ case HeightReference_default.NONE:
+ altitudeModeText = kmlDoc.createTextNode("absolute");
+ break;
+ case HeightReference_default.CLAMP_TO_GROUND:
+ altitudeModeText = kmlDoc.createTextNode("clampToGround");
+ break;
+ case HeightReference_default.RELATIVE_TO_GROUND:
+ altitudeModeText = kmlDoc.createTextNode("relativeToGround");
+ break;
+ }
+ return altitudeModeText;
+}
+function getCoordinates(coordinates, ellipsoid) {
+ if (!Array.isArray(coordinates)) {
+ coordinates = [coordinates];
+ }
+ const count = coordinates.length;
+ const coordinateStrings = [];
+ for (let i = 0; i < count; ++i) {
+ Cartographic_default.fromCartesian(coordinates[i], ellipsoid, scratchCartographic14);
+ coordinateStrings.push(
+ `${Math_default.toDegrees(
+ scratchCartographic14.longitude
+ )},${Math_default.toDegrees(scratchCartographic14.latitude)},${scratchCartographic14.height}`
+ );
+ }
+ return coordinateStrings.join(" ");
+}
+function createBasicElementWithText(kmlDoc, elementName, elementValue, namespace) {
+ elementValue = defaultValue_default(elementValue, "");
+ if (typeof elementValue === "boolean") {
+ elementValue = elementValue ? "1" : "0";
+ }
+ const element = defined_default(namespace) ? kmlDoc.createElementNS(namespace, elementName) : kmlDoc.createElement(elementName);
+ const text = elementValue === "string" && elementValue.indexOf("<") !== -1 ? kmlDoc.createCDATASection(elementValue) : kmlDoc.createTextNode(elementValue);
+ element.appendChild(text);
+ return element;
+}
+function colorToString(color) {
+ let result = "";
+ const bytes = color.toBytes();
+ for (let i = 3; i >= 0; --i) {
+ result += bytes[i] < 16 ? `0${bytes[i].toString(16)}` : bytes[i].toString(16);
+ }
+ return result;
+}
+var exportKml_default = exportKml;
+
+// Source/Core/PinBuilder.js
+function PinBuilder() {
+ this._cache = {};
+}
+PinBuilder.prototype.fromColor = function(color, size) {
+ if (!defined_default(color)) {
+ throw new DeveloperError_default("color is required");
+ }
+ if (!defined_default(size)) {
+ throw new DeveloperError_default("size is required");
+ }
+ return createPin(void 0, void 0, color, size, this._cache);
+};
+PinBuilder.prototype.fromUrl = function(url2, color, size) {
+ if (!defined_default(url2)) {
+ throw new DeveloperError_default("url is required");
+ }
+ if (!defined_default(color)) {
+ throw new DeveloperError_default("color is required");
+ }
+ if (!defined_default(size)) {
+ throw new DeveloperError_default("size is required");
+ }
+ return createPin(url2, void 0, color, size, this._cache);
+};
+PinBuilder.prototype.fromMakiIconId = function(id, color, size) {
+ if (!defined_default(id)) {
+ throw new DeveloperError_default("id is required");
+ }
+ if (!defined_default(color)) {
+ throw new DeveloperError_default("color is required");
+ }
+ if (!defined_default(size)) {
+ throw new DeveloperError_default("size is required");
+ }
+ return createPin(
+ buildModuleUrl_default(`Assets/Textures/maki/${encodeURIComponent(id)}.png`),
+ void 0,
+ color,
+ size,
+ this._cache
+ );
+};
+PinBuilder.prototype.fromText = function(text, color, size) {
+ if (!defined_default(text)) {
+ throw new DeveloperError_default("text is required");
+ }
+ if (!defined_default(color)) {
+ throw new DeveloperError_default("color is required");
+ }
+ if (!defined_default(size)) {
+ throw new DeveloperError_default("size is required");
+ }
+ return createPin(void 0, text, color, size, this._cache);
+};
+var colorScratch7 = new Color_default();
+function drawPin(context2D, color, size) {
+ context2D.save();
+ context2D.scale(size / 24, size / 24);
+ context2D.fillStyle = color.toCssColorString();
+ context2D.strokeStyle = color.brighten(0.6, colorScratch7).toCssColorString();
+ context2D.lineWidth = 0.846;
+ context2D.beginPath();
+ context2D.moveTo(6.72, 0.422);
+ context2D.lineTo(17.28, 0.422);
+ context2D.bezierCurveTo(18.553, 0.422, 19.577, 1.758, 19.577, 3.415);
+ context2D.lineTo(19.577, 10.973);
+ context2D.bezierCurveTo(19.577, 12.63, 18.553, 13.966, 17.282, 13.966);
+ context2D.lineTo(14.386, 14.008);
+ context2D.lineTo(11.826, 23.578);
+ context2D.lineTo(9.614, 14.008);
+ context2D.lineTo(6.719, 13.965);
+ context2D.bezierCurveTo(5.446, 13.983, 4.422, 12.629, 4.422, 10.972);
+ context2D.lineTo(4.422, 3.416);
+ context2D.bezierCurveTo(4.423, 1.76, 5.447, 0.423, 6.718, 0.423);
+ context2D.closePath();
+ context2D.fill();
+ context2D.stroke();
+ context2D.restore();
+}
+function drawIcon(context2D, image, size) {
+ const imageSize = size / 2.5;
+ let sizeX = imageSize;
+ let sizeY = imageSize;
+ if (image.width > image.height) {
+ sizeY = imageSize * (image.height / image.width);
+ } else if (image.width < image.height) {
+ sizeX = imageSize * (image.width / image.height);
+ }
+ const x = Math.round((size - sizeX) / 2);
+ const y = Math.round(7 / 24 * size - sizeY / 2);
+ context2D.globalCompositeOperation = "destination-out";
+ context2D.drawImage(image, x - 1, y, sizeX, sizeY);
+ context2D.drawImage(image, x, y - 1, sizeX, sizeY);
+ context2D.drawImage(image, x + 1, y, sizeX, sizeY);
+ context2D.drawImage(image, x, y + 1, sizeX, sizeY);
+ context2D.globalCompositeOperation = "destination-over";
+ context2D.fillStyle = Color_default.BLACK.toCssColorString();
+ context2D.fillRect(x - 1, y - 1, sizeX + 2, sizeY + 2);
+ context2D.globalCompositeOperation = "destination-out";
+ context2D.drawImage(image, x, y, sizeX, sizeY);
+ context2D.globalCompositeOperation = "destination-over";
+ context2D.fillStyle = Color_default.WHITE.toCssColorString();
+ context2D.fillRect(x - 1, y - 2, sizeX + 2, sizeY + 2);
+}
+var stringifyScratch = new Array(4);
+function createPin(url2, label, color, size, cache) {
+ stringifyScratch[0] = url2;
+ stringifyScratch[1] = label;
+ stringifyScratch[2] = color;
+ stringifyScratch[3] = size;
+ const id = JSON.stringify(stringifyScratch);
+ const item = cache[id];
+ if (defined_default(item)) {
+ return item;
+ }
+ const canvas = document.createElement("canvas");
+ canvas.width = size;
+ canvas.height = size;
+ const context2D = canvas.getContext("2d");
+ drawPin(context2D, color, size);
+ if (defined_default(url2)) {
+ const resource = Resource_default.createIfNeeded(url2);
+ const promise = resource.fetchImage().then(function(image) {
+ drawIcon(context2D, image, size);
+ cache[id] = canvas;
+ return canvas;
+ });
+ cache[id] = promise;
+ return promise;
+ } else if (defined_default(label)) {
+ const image = writeTextToCanvas_default(label, {
+ font: `bold ${size}px sans-serif`
+ });
+ drawIcon(context2D, image, size);
+ }
+ cache[id] = canvas;
+ return canvas;
+}
+var PinBuilder_default = PinBuilder;
+
+// node_modules/topojson-client/src/identity.js
+function identity_default(x) {
+ return x;
+}
+
+// node_modules/topojson-client/src/transform.js
+function transform_default(transform3) {
+ if (transform3 == null)
+ return identity_default;
+ var x0, y0, kx = transform3.scale[0], ky = transform3.scale[1], dx = transform3.translate[0], dy = transform3.translate[1];
+ return function(input, i) {
+ if (!i)
+ x0 = y0 = 0;
+ var j = 2, n = input.length, output = new Array(n);
+ output[0] = (x0 += input[0]) * kx + dx;
+ output[1] = (y0 += input[1]) * ky + dy;
+ while (j < n)
+ output[j] = input[j], ++j;
+ return output;
+ };
+}
+
+// node_modules/topojson-client/src/reverse.js
+function reverse_default(array, n) {
+ var t, j = array.length, i = j - n;
+ while (i < --j)
+ t = array[i], array[i++] = array[j], array[j] = t;
+}
+
+// node_modules/topojson-client/src/feature.js
+function feature_default(topology, o) {
+ if (typeof o === "string")
+ o = topology.objects[o];
+ return o.type === "GeometryCollection" ? { type: "FeatureCollection", features: o.geometries.map(function(o2) {
+ return feature(topology, o2);
+ }) } : feature(topology, o);
+}
+function feature(topology, o) {
+ var id = o.id, bbox = o.bbox, properties = o.properties == null ? {} : o.properties, geometry = object(topology, o);
+ return id == null && bbox == null ? { type: "Feature", properties, geometry } : bbox == null ? { type: "Feature", id, properties, geometry } : { type: "Feature", id, bbox, properties, geometry };
+}
+function object(topology, o) {
+ var transformPoint2 = transform_default(topology.transform), arcs = topology.arcs;
+ function arc(i, points) {
+ if (points.length)
+ points.pop();
+ for (var a3 = arcs[i < 0 ? ~i : i], k = 0, n = a3.length; k < n; ++k) {
+ points.push(transformPoint2(a3[k], k));
+ }
+ if (i < 0)
+ reverse_default(points, n);
+ }
+ function point(p) {
+ return transformPoint2(p);
+ }
+ function line(arcs2) {
+ var points = [];
+ for (var i = 0, n = arcs2.length; i < n; ++i)
+ arc(arcs2[i], points);
+ if (points.length < 2)
+ points.push(points[0]);
+ return points;
+ }
+ function ring(arcs2) {
+ var points = line(arcs2);
+ while (points.length < 4)
+ points.push(points[0]);
+ return points;
+ }
+ function polygon(arcs2) {
+ return arcs2.map(ring);
+ }
+ function geometry(o2) {
+ var type = o2.type, coordinates;
+ switch (type) {
+ case "GeometryCollection":
+ return { type, geometries: o2.geometries.map(geometry) };
+ case "Point":
+ coordinates = point(o2.coordinates);
+ break;
+ case "MultiPoint":
+ coordinates = o2.coordinates.map(point);
+ break;
+ case "LineString":
+ coordinates = line(o2.arcs);
+ break;
+ case "MultiLineString":
+ coordinates = o2.arcs.map(line);
+ break;
+ case "Polygon":
+ coordinates = polygon(o2.arcs);
+ break;
+ case "MultiPolygon":
+ coordinates = o2.arcs.map(polygon);
+ break;
+ default:
+ return null;
+ }
+ return { type, coordinates };
+ }
+ return geometry(o);
+}
+
+// Source/DataSources/GeoJsonDataSource.js
+function defaultCrsFunction(coordinates) {
+ return Cartesian3_default.fromDegrees(coordinates[0], coordinates[1], coordinates[2]);
+}
+var crsNames = {
+ "urn:ogc:def:crs:OGC:1.3:CRS84": defaultCrsFunction,
+ "EPSG:4326": defaultCrsFunction,
+ "urn:ogc:def:crs:EPSG::4326": defaultCrsFunction
+};
+var crsLinkHrefs = {};
+var crsLinkTypes = {};
+var defaultMarkerSize = 48;
+var defaultMarkerSymbol;
+var defaultMarkerColor = Color_default.ROYALBLUE;
+var defaultStroke = Color_default.YELLOW;
+var defaultStrokeWidth = 2;
+var defaultFill2 = Color_default.fromBytes(255, 255, 0, 100);
+var defaultClampToGround = false;
+var sizes = {
+ small: 24,
+ medium: 48,
+ large: 64
+};
+var simpleStyleIdentifiers = [
+ "title",
+ "description",
+ "marker-size",
+ "marker-symbol",
+ "marker-color",
+ "stroke",
+ "stroke-opacity",
+ "stroke-width",
+ "fill",
+ "fill-opacity"
+];
+function defaultDescribe(properties, nameProperty) {
+ let html = "";
+ for (const key in properties) {
+ if (properties.hasOwnProperty(key)) {
+ if (key === nameProperty || simpleStyleIdentifiers.indexOf(key) !== -1) {
+ continue;
+ }
+ const value = properties[key];
+ if (defined_default(value)) {
+ if (typeof value === "object") {
+ html += `${key} ${defaultDescribe(value)} `;
+ } else {
+ html += `${key} ${value} `;
+ }
+ }
+ }
+ }
+ if (html.length > 0) {
+ html = `${html}
`;
+ }
+ return html;
+}
+function createDescriptionCallback(describe, properties, nameProperty) {
+ let description;
+ return function(time, result) {
+ if (!defined_default(description)) {
+ description = describe(properties, nameProperty);
+ }
+ return description;
+ };
+}
+function defaultDescribeProperty(properties, nameProperty) {
+ return new CallbackProperty_default(
+ createDescriptionCallback(defaultDescribe, properties, nameProperty),
+ true
+ );
+}
+function createObject(geoJson, entityCollection, describe) {
+ let id = geoJson.id;
+ if (!defined_default(id) || geoJson.type !== "Feature") {
+ id = createGuid_default();
+ } else {
+ let i = 2;
+ let finalId = id;
+ while (defined_default(entityCollection.getById(finalId))) {
+ finalId = `${id}_${i}`;
+ i++;
+ }
+ id = finalId;
+ }
+ const entity = entityCollection.getOrCreateEntity(id);
+ const properties = geoJson.properties;
+ if (defined_default(properties)) {
+ entity.properties = properties;
+ let nameProperty;
+ const name = properties.title;
+ if (defined_default(name)) {
+ entity.name = name;
+ nameProperty = "title";
+ } else {
+ let namePropertyPrecedence = Number.MAX_VALUE;
+ for (const key in properties) {
+ if (properties.hasOwnProperty(key) && properties[key]) {
+ const lowerKey = key.toLowerCase();
+ if (namePropertyPrecedence > 1 && lowerKey === "title") {
+ namePropertyPrecedence = 1;
+ nameProperty = key;
+ break;
+ } else if (namePropertyPrecedence > 2 && lowerKey === "name") {
+ namePropertyPrecedence = 2;
+ nameProperty = key;
+ } else if (namePropertyPrecedence > 3 && /title/i.test(key)) {
+ namePropertyPrecedence = 3;
+ nameProperty = key;
+ } else if (namePropertyPrecedence > 4 && /name/i.test(key)) {
+ namePropertyPrecedence = 4;
+ nameProperty = key;
+ }
+ }
+ }
+ if (defined_default(nameProperty)) {
+ entity.name = properties[nameProperty];
+ }
+ }
+ const description = properties.description;
+ if (description !== null) {
+ entity.description = !defined_default(description) ? describe(properties, nameProperty) : new ConstantProperty_default(description);
+ }
+ }
+ return entity;
+}
+function coordinatesArrayToCartesianArray(coordinates, crsFunction) {
+ const positions = new Array(coordinates.length);
+ for (let i = 0; i < coordinates.length; i++) {
+ positions[i] = crsFunction(coordinates[i]);
+ }
+ return positions;
+}
+var geoJsonObjectTypes2 = {
+ Feature: processFeature,
+ FeatureCollection: processFeatureCollection,
+ GeometryCollection: processGeometryCollection,
+ LineString: processLineString,
+ MultiLineString: processMultiLineString,
+ MultiPoint: processMultiPoint,
+ MultiPolygon: processMultiPolygon,
+ Point: processPoint2,
+ Polygon: processPolygon2,
+ Topology: processTopology
+};
+var geometryTypes2 = {
+ GeometryCollection: processGeometryCollection,
+ LineString: processLineString,
+ MultiLineString: processMultiLineString,
+ MultiPoint: processMultiPoint,
+ MultiPolygon: processMultiPolygon,
+ Point: processPoint2,
+ Polygon: processPolygon2,
+ Topology: processTopology
+};
+function processFeature(dataSource, feature2, notUsed, crsFunction, options) {
+ if (feature2.geometry === null) {
+ createObject(feature2, dataSource._entityCollection, options.describe);
+ return;
+ }
+ if (!defined_default(feature2.geometry)) {
+ throw new RuntimeError_default("feature.geometry is required.");
+ }
+ const geometryType = feature2.geometry.type;
+ const geometryHandler = geometryTypes2[geometryType];
+ if (!defined_default(geometryHandler)) {
+ throw new RuntimeError_default(`Unknown geometry type: ${geometryType}`);
+ }
+ geometryHandler(dataSource, feature2, feature2.geometry, crsFunction, options);
+}
+function processFeatureCollection(dataSource, featureCollection, notUsed, crsFunction, options) {
+ const features = featureCollection.features;
+ for (let i = 0, len = features.length; i < len; i++) {
+ processFeature(dataSource, features[i], void 0, crsFunction, options);
+ }
+}
+function processGeometryCollection(dataSource, geoJson, geometryCollection, crsFunction, options) {
+ const geometries = geometryCollection.geometries;
+ for (let i = 0, len = geometries.length; i < len; i++) {
+ const geometry = geometries[i];
+ const geometryType = geometry.type;
+ const geometryHandler = geometryTypes2[geometryType];
+ if (!defined_default(geometryHandler)) {
+ throw new RuntimeError_default(`Unknown geometry type: ${geometryType}`);
+ }
+ geometryHandler(dataSource, geoJson, geometry, crsFunction, options);
+ }
+}
+function createPoint2(dataSource, geoJson, crsFunction, coordinates, options) {
+ let symbol = options.markerSymbol;
+ let color = options.markerColor;
+ let size = options.markerSize;
+ const properties = geoJson.properties;
+ if (defined_default(properties)) {
+ const cssColor = properties["marker-color"];
+ if (defined_default(cssColor)) {
+ color = Color_default.fromCssColorString(cssColor);
+ }
+ size = defaultValue_default(sizes[properties["marker-size"]], size);
+ const markerSymbol = properties["marker-symbol"];
+ if (defined_default(markerSymbol)) {
+ symbol = markerSymbol;
+ }
+ }
+ let canvasOrPromise;
+ if (defined_default(symbol)) {
+ if (symbol.length === 1) {
+ canvasOrPromise = dataSource._pinBuilder.fromText(
+ symbol.toUpperCase(),
+ color,
+ size
+ );
+ } else {
+ canvasOrPromise = dataSource._pinBuilder.fromMakiIconId(
+ symbol,
+ color,
+ size
+ );
+ }
+ } else {
+ canvasOrPromise = dataSource._pinBuilder.fromColor(color, size);
+ }
+ const billboard = new BillboardGraphics_default();
+ billboard.verticalOrigin = new ConstantProperty_default(VerticalOrigin_default.BOTTOM);
+ if (coordinates.length === 2 && options.clampToGround) {
+ billboard.heightReference = HeightReference_default.CLAMP_TO_GROUND;
+ }
+ const entity = createObject(
+ geoJson,
+ dataSource._entityCollection,
+ options.describe
+ );
+ entity.billboard = billboard;
+ entity.position = new ConstantPositionProperty_default(crsFunction(coordinates));
+ const promise = Promise.resolve(canvasOrPromise).then(function(image) {
+ billboard.image = new ConstantProperty_default(image);
+ }).catch(function() {
+ billboard.image = new ConstantProperty_default(
+ dataSource._pinBuilder.fromColor(color, size)
+ );
+ });
+ dataSource._promises.push(promise);
+}
+function processPoint2(dataSource, geoJson, geometry, crsFunction, options) {
+ createPoint2(dataSource, geoJson, crsFunction, geometry.coordinates, options);
+}
+function processMultiPoint(dataSource, geoJson, geometry, crsFunction, options) {
+ const coordinates = geometry.coordinates;
+ for (let i = 0; i < coordinates.length; i++) {
+ createPoint2(dataSource, geoJson, crsFunction, coordinates[i], options);
+ }
+}
+function createLineString2(dataSource, geoJson, crsFunction, coordinates, options) {
+ let material = options.strokeMaterialProperty;
+ let widthProperty = options.strokeWidthProperty;
+ const properties = geoJson.properties;
+ if (defined_default(properties)) {
+ const width = properties["stroke-width"];
+ if (defined_default(width)) {
+ widthProperty = new ConstantProperty_default(width);
+ }
+ let color;
+ const stroke = properties.stroke;
+ if (defined_default(stroke)) {
+ color = Color_default.fromCssColorString(stroke);
+ }
+ const opacity = properties["stroke-opacity"];
+ if (defined_default(opacity) && opacity !== 1) {
+ if (!defined_default(color)) {
+ color = material.color.getValue().clone();
+ }
+ color.alpha = opacity;
+ }
+ if (defined_default(color)) {
+ material = new ColorMaterialProperty_default(color);
+ }
+ }
+ const entity = createObject(
+ geoJson,
+ dataSource._entityCollection,
+ options.describe
+ );
+ const polylineGraphics = new PolylineGraphics_default();
+ entity.polyline = polylineGraphics;
+ polylineGraphics.clampToGround = options.clampToGround;
+ polylineGraphics.material = material;
+ polylineGraphics.width = widthProperty;
+ polylineGraphics.positions = new ConstantProperty_default(
+ coordinatesArrayToCartesianArray(coordinates, crsFunction)
+ );
+ polylineGraphics.arcType = ArcType_default.RHUMB;
+}
+function processLineString(dataSource, geoJson, geometry, crsFunction, options) {
+ createLineString2(
+ dataSource,
+ geoJson,
+ crsFunction,
+ geometry.coordinates,
+ options
+ );
+}
+function processMultiLineString(dataSource, geoJson, geometry, crsFunction, options) {
+ const lineStrings = geometry.coordinates;
+ for (let i = 0; i < lineStrings.length; i++) {
+ createLineString2(dataSource, geoJson, crsFunction, lineStrings[i], options);
+ }
+}
+function createPolygon2(dataSource, geoJson, crsFunction, coordinates, options) {
+ if (coordinates.length === 0 || coordinates[0].length === 0) {
+ return;
+ }
+ let outlineColorProperty = options.strokeMaterialProperty.color;
+ let material = options.fillMaterialProperty;
+ let widthProperty = options.strokeWidthProperty;
+ const properties = geoJson.properties;
+ if (defined_default(properties)) {
+ const width = properties["stroke-width"];
+ if (defined_default(width)) {
+ widthProperty = new ConstantProperty_default(width);
+ }
+ let color;
+ const stroke = properties.stroke;
+ if (defined_default(stroke)) {
+ color = Color_default.fromCssColorString(stroke);
+ }
+ let opacity = properties["stroke-opacity"];
+ if (defined_default(opacity) && opacity !== 1) {
+ if (!defined_default(color)) {
+ color = outlineColorProperty.getValue().clone();
+ }
+ color.alpha = opacity;
+ }
+ if (defined_default(color)) {
+ outlineColorProperty = new ConstantProperty_default(color);
+ }
+ let fillColor;
+ const fill = properties.fill;
+ const materialColor = material.color.getValue();
+ if (defined_default(fill)) {
+ fillColor = Color_default.fromCssColorString(fill);
+ fillColor.alpha = materialColor.alpha;
+ }
+ opacity = properties["fill-opacity"];
+ if (defined_default(opacity) && opacity !== materialColor.alpha) {
+ if (!defined_default(fillColor)) {
+ fillColor = materialColor.clone();
+ }
+ fillColor.alpha = opacity;
+ }
+ if (defined_default(fillColor)) {
+ material = new ColorMaterialProperty_default(fillColor);
+ }
+ }
+ const polygon = new PolygonGraphics_default();
+ polygon.outline = new ConstantProperty_default(true);
+ polygon.outlineColor = outlineColorProperty;
+ polygon.outlineWidth = widthProperty;
+ polygon.material = material;
+ polygon.arcType = ArcType_default.RHUMB;
+ const holes = [];
+ for (let i = 1, len = coordinates.length; i < len; i++) {
+ holes.push(
+ new PolygonHierarchy_default(
+ coordinatesArrayToCartesianArray(coordinates[i], crsFunction)
+ )
+ );
+ }
+ const positions = coordinates[0];
+ polygon.hierarchy = new ConstantProperty_default(
+ new PolygonHierarchy_default(
+ coordinatesArrayToCartesianArray(positions, crsFunction),
+ holes
+ )
+ );
+ if (positions[0].length > 2) {
+ polygon.perPositionHeight = new ConstantProperty_default(true);
+ } else if (!options.clampToGround) {
+ polygon.height = 0;
+ }
+ const entity = createObject(
+ geoJson,
+ dataSource._entityCollection,
+ options.describe
+ );
+ entity.polygon = polygon;
+}
+function processPolygon2(dataSource, geoJson, geometry, crsFunction, options) {
+ createPolygon2(
+ dataSource,
+ geoJson,
+ crsFunction,
+ geometry.coordinates,
+ options
+ );
+}
+function processMultiPolygon(dataSource, geoJson, geometry, crsFunction, options) {
+ const polygons = geometry.coordinates;
+ for (let i = 0; i < polygons.length; i++) {
+ createPolygon2(dataSource, geoJson, crsFunction, polygons[i], options);
+ }
+}
+function processTopology(dataSource, geoJson, geometry, crsFunction, options) {
+ for (const property in geometry.objects) {
+ if (geometry.objects.hasOwnProperty(property)) {
+ const feature2 = feature_default(geometry, geometry.objects[property]);
+ const typeHandler = geoJsonObjectTypes2[feature2.type];
+ typeHandler(dataSource, feature2, feature2, crsFunction, options);
+ }
+ }
+}
+function GeoJsonDataSource(name) {
+ this._name = name;
+ this._changed = new Event_default();
+ this._error = new Event_default();
+ this._isLoading = false;
+ this._loading = new Event_default();
+ this._entityCollection = new EntityCollection_default(this);
+ this._promises = [];
+ this._pinBuilder = new PinBuilder_default();
+ this._entityCluster = new EntityCluster_default();
+ this._credit = void 0;
+ this._resourceCredits = [];
+}
+GeoJsonDataSource.load = function(data, options) {
+ return new GeoJsonDataSource().load(data, options);
+};
+Object.defineProperties(GeoJsonDataSource, {
+ markerSize: {
+ get: function() {
+ return defaultMarkerSize;
+ },
+ set: function(value) {
+ defaultMarkerSize = value;
+ }
+ },
+ markerSymbol: {
+ get: function() {
+ return defaultMarkerSymbol;
+ },
+ set: function(value) {
+ defaultMarkerSymbol = value;
+ }
+ },
+ markerColor: {
+ get: function() {
+ return defaultMarkerColor;
+ },
+ set: function(value) {
+ defaultMarkerColor = value;
+ }
+ },
+ stroke: {
+ get: function() {
+ return defaultStroke;
+ },
+ set: function(value) {
+ defaultStroke = value;
+ }
+ },
+ strokeWidth: {
+ get: function() {
+ return defaultStrokeWidth;
+ },
+ set: function(value) {
+ defaultStrokeWidth = value;
+ }
+ },
+ fill: {
+ get: function() {
+ return defaultFill2;
+ },
+ set: function(value) {
+ defaultFill2 = value;
+ }
+ },
+ clampToGround: {
+ get: function() {
+ return defaultClampToGround;
+ },
+ set: function(value) {
+ defaultClampToGround = value;
+ }
+ },
+ crsNames: {
+ get: function() {
+ return crsNames;
+ }
+ },
+ crsLinkHrefs: {
+ get: function() {
+ return crsLinkHrefs;
+ }
+ },
+ crsLinkTypes: {
+ get: function() {
+ return crsLinkTypes;
+ }
+ }
+});
+Object.defineProperties(GeoJsonDataSource.prototype, {
+ name: {
+ get: function() {
+ return this._name;
+ },
+ set: function(value) {
+ if (this._name !== value) {
+ this._name = value;
+ this._changed.raiseEvent(this);
+ }
+ }
+ },
+ clock: {
+ value: void 0,
+ writable: false
+ },
+ entities: {
+ get: function() {
+ return this._entityCollection;
+ }
+ },
+ isLoading: {
+ get: function() {
+ return this._isLoading;
+ }
+ },
+ changedEvent: {
+ get: function() {
+ return this._changed;
+ }
+ },
+ errorEvent: {
+ get: function() {
+ return this._error;
+ }
+ },
+ loadingEvent: {
+ get: function() {
+ return this._loading;
+ }
+ },
+ show: {
+ get: function() {
+ return this._entityCollection.show;
+ },
+ set: function(value) {
+ this._entityCollection.show = value;
+ }
+ },
+ clustering: {
+ get: function() {
+ return this._entityCluster;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value must be defined.");
+ }
+ this._entityCluster = value;
+ }
+ },
+ credit: {
+ get: function() {
+ return this._credit;
+ }
+ }
+});
+GeoJsonDataSource.prototype.load = function(data, options) {
+ return preload(this, data, options, true);
+};
+GeoJsonDataSource.prototype.process = function(data, options) {
+ return preload(this, data, options, false);
+};
+function preload(that, data, options, clear2) {
+ if (!defined_default(data)) {
+ throw new DeveloperError_default("data is required.");
+ }
+ DataSource_default.setLoading(that, true);
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ let credit = options.credit;
+ if (typeof credit === "string") {
+ credit = new Credit_default(credit);
+ }
+ that._credit = credit;
+ let promise = data;
+ let sourceUri = options.sourceUri;
+ if (typeof data === "string" || data instanceof Resource_default) {
+ data = Resource_default.createIfNeeded(data);
+ promise = data.fetchJson();
+ sourceUri = defaultValue_default(sourceUri, data.getUrlComponent());
+ const resourceCredits = that._resourceCredits;
+ const credits = data.credits;
+ if (defined_default(credits)) {
+ const length3 = credits.length;
+ for (let i = 0; i < length3; i++) {
+ resourceCredits.push(credits[i]);
+ }
+ }
+ }
+ options = {
+ describe: defaultValue_default(options.describe, defaultDescribeProperty),
+ markerSize: defaultValue_default(options.markerSize, defaultMarkerSize),
+ markerSymbol: defaultValue_default(options.markerSymbol, defaultMarkerSymbol),
+ markerColor: defaultValue_default(options.markerColor, defaultMarkerColor),
+ strokeWidthProperty: new ConstantProperty_default(
+ defaultValue_default(options.strokeWidth, defaultStrokeWidth)
+ ),
+ strokeMaterialProperty: new ColorMaterialProperty_default(
+ defaultValue_default(options.stroke, defaultStroke)
+ ),
+ fillMaterialProperty: new ColorMaterialProperty_default(
+ defaultValue_default(options.fill, defaultFill2)
+ ),
+ clampToGround: defaultValue_default(options.clampToGround, defaultClampToGround)
+ };
+ return Promise.resolve(promise).then(function(geoJson) {
+ return load2(that, geoJson, options, sourceUri, clear2);
+ }).catch(function(error) {
+ DataSource_default.setLoading(that, false);
+ that._error.raiseEvent(that, error);
+ throw error;
+ });
+}
+GeoJsonDataSource.prototype.update = function(time) {
+ return true;
+};
+function load2(that, geoJson, options, sourceUri, clear2) {
+ let name;
+ if (defined_default(sourceUri)) {
+ name = getFilenameFromUri_default(sourceUri);
+ }
+ if (defined_default(name) && that._name !== name) {
+ that._name = name;
+ that._changed.raiseEvent(that);
+ }
+ const typeHandler = geoJsonObjectTypes2[geoJson.type];
+ if (!defined_default(typeHandler)) {
+ throw new RuntimeError_default(`Unsupported GeoJSON object type: ${geoJson.type}`);
+ }
+ const crs = geoJson.crs;
+ let crsFunction = crs !== null ? defaultCrsFunction : null;
+ if (defined_default(crs)) {
+ if (!defined_default(crs.properties)) {
+ throw new RuntimeError_default("crs.properties is undefined.");
+ }
+ const properties = crs.properties;
+ if (crs.type === "name") {
+ crsFunction = crsNames[properties.name];
+ if (!defined_default(crsFunction)) {
+ throw new RuntimeError_default(`Unknown crs name: ${properties.name}`);
+ }
+ } else if (crs.type === "link") {
+ let handler = crsLinkHrefs[properties.href];
+ if (!defined_default(handler)) {
+ handler = crsLinkTypes[properties.type];
+ }
+ if (!defined_default(handler)) {
+ throw new RuntimeError_default(
+ `Unable to resolve crs link: ${JSON.stringify(properties)}`
+ );
+ }
+ crsFunction = handler(properties);
+ } else if (crs.type === "EPSG") {
+ crsFunction = crsNames[`EPSG:${properties.code}`];
+ if (!defined_default(crsFunction)) {
+ throw new RuntimeError_default(`Unknown crs EPSG code: ${properties.code}`);
+ }
+ } else {
+ throw new RuntimeError_default(`Unknown crs type: ${crs.type}`);
+ }
+ }
+ return Promise.resolve(crsFunction).then(function(crsFunction2) {
+ if (clear2) {
+ that._entityCollection.removeAll();
+ }
+ if (crsFunction2 !== null) {
+ typeHandler(that, geoJson, geoJson, crsFunction2, options);
+ }
+ return Promise.all(that._promises).then(function() {
+ that._promises.length = 0;
+ DataSource_default.setLoading(that, false);
+ return that;
+ });
+ });
+}
+var GeoJsonDataSource_default = GeoJsonDataSource;
+
+// node_modules/autolinker/dist/es2015/version.js
+var version = "3.16.2";
+
+// node_modules/autolinker/dist/es2015/utils.js
+function defaults(dest, src) {
+ for (var prop in src) {
+ if (src.hasOwnProperty(prop) && dest[prop] === void 0) {
+ dest[prop] = src[prop];
+ }
+ }
+ return dest;
+}
+function ellipsis(str, truncateLen, ellipsisChars) {
+ var ellipsisLength;
+ if (str.length > truncateLen) {
+ if (ellipsisChars == null) {
+ ellipsisChars = "…";
+ ellipsisLength = 3;
+ } else {
+ ellipsisLength = ellipsisChars.length;
+ }
+ str = str.substring(0, truncateLen - ellipsisLength) + ellipsisChars;
+ }
+ return str;
+}
+function indexOf2(arr, element) {
+ if (Array.prototype.indexOf) {
+ return arr.indexOf(element);
+ } else {
+ for (var i = 0, len = arr.length; i < len; i++) {
+ if (arr[i] === element)
+ return i;
+ }
+ return -1;
+ }
+}
+function remove2(arr, fn) {
+ for (var i = arr.length - 1; i >= 0; i--) {
+ if (fn(arr[i]) === true) {
+ arr.splice(i, 1);
+ }
+ }
+}
+function splitAndCapture(str, splitRegex) {
+ if (!splitRegex.global)
+ throw new Error("`splitRegex` must have the 'g' flag set");
+ var result = [], lastIdx = 0, match;
+ while (match = splitRegex.exec(str)) {
+ result.push(str.substring(lastIdx, match.index));
+ result.push(match[0]);
+ lastIdx = match.index + match[0].length;
+ }
+ result.push(str.substring(lastIdx));
+ return result;
+}
+function throwUnhandledCaseError(theValue) {
+ throw new Error("Unhandled case for value: '".concat(theValue, "'"));
+}
+
+// node_modules/autolinker/dist/es2015/html-tag.js
+var HtmlTag = function() {
+ function HtmlTag2(cfg) {
+ if (cfg === void 0) {
+ cfg = {};
+ }
+ this.tagName = "";
+ this.attrs = {};
+ this.innerHTML = "";
+ this.whitespaceRegex = /\s+/;
+ this.tagName = cfg.tagName || "";
+ this.attrs = cfg.attrs || {};
+ this.innerHTML = cfg.innerHtml || cfg.innerHTML || "";
+ }
+ HtmlTag2.prototype.setTagName = function(tagName) {
+ this.tagName = tagName;
+ return this;
+ };
+ HtmlTag2.prototype.getTagName = function() {
+ return this.tagName || "";
+ };
+ HtmlTag2.prototype.setAttr = function(attrName, attrValue) {
+ var tagAttrs = this.getAttrs();
+ tagAttrs[attrName] = attrValue;
+ return this;
+ };
+ HtmlTag2.prototype.getAttr = function(attrName) {
+ return this.getAttrs()[attrName];
+ };
+ HtmlTag2.prototype.setAttrs = function(attrs) {
+ Object.assign(this.getAttrs(), attrs);
+ return this;
+ };
+ HtmlTag2.prototype.getAttrs = function() {
+ return this.attrs || (this.attrs = {});
+ };
+ HtmlTag2.prototype.setClass = function(cssClass) {
+ return this.setAttr("class", cssClass);
+ };
+ HtmlTag2.prototype.addClass = function(cssClass) {
+ var classAttr = this.getClass(), whitespaceRegex = this.whitespaceRegex, classes = !classAttr ? [] : classAttr.split(whitespaceRegex), newClasses = cssClass.split(whitespaceRegex), newClass;
+ while (newClass = newClasses.shift()) {
+ if (indexOf2(classes, newClass) === -1) {
+ classes.push(newClass);
+ }
+ }
+ this.getAttrs()["class"] = classes.join(" ");
+ return this;
+ };
+ HtmlTag2.prototype.removeClass = function(cssClass) {
+ var classAttr = this.getClass(), whitespaceRegex = this.whitespaceRegex, classes = !classAttr ? [] : classAttr.split(whitespaceRegex), removeClasses = cssClass.split(whitespaceRegex), removeClass;
+ while (classes.length && (removeClass = removeClasses.shift())) {
+ var idx = indexOf2(classes, removeClass);
+ if (idx !== -1) {
+ classes.splice(idx, 1);
+ }
+ }
+ this.getAttrs()["class"] = classes.join(" ");
+ return this;
+ };
+ HtmlTag2.prototype.getClass = function() {
+ return this.getAttrs()["class"] || "";
+ };
+ HtmlTag2.prototype.hasClass = function(cssClass) {
+ return (" " + this.getClass() + " ").indexOf(" " + cssClass + " ") !== -1;
+ };
+ HtmlTag2.prototype.setInnerHTML = function(html) {
+ this.innerHTML = html;
+ return this;
+ };
+ HtmlTag2.prototype.setInnerHtml = function(html) {
+ return this.setInnerHTML(html);
+ };
+ HtmlTag2.prototype.getInnerHTML = function() {
+ return this.innerHTML || "";
+ };
+ HtmlTag2.prototype.getInnerHtml = function() {
+ return this.getInnerHTML();
+ };
+ HtmlTag2.prototype.toAnchorString = function() {
+ var tagName = this.getTagName(), attrsStr = this.buildAttrsStr();
+ attrsStr = attrsStr ? " " + attrsStr : "";
+ return ["<", tagName, attrsStr, ">", this.getInnerHtml(), "", tagName, ">"].join("");
+ };
+ HtmlTag2.prototype.buildAttrsStr = function() {
+ if (!this.attrs)
+ return "";
+ var attrs = this.getAttrs(), attrsArr = [];
+ for (var prop in attrs) {
+ if (attrs.hasOwnProperty(prop)) {
+ attrsArr.push(prop + '="' + attrs[prop] + '"');
+ }
+ }
+ return attrsArr.join(" ");
+ };
+ return HtmlTag2;
+}();
+
+// node_modules/autolinker/dist/es2015/truncate/truncate-smart.js
+function truncateSmart(url2, truncateLen, ellipsisChars) {
+ var ellipsisLengthBeforeParsing;
+ var ellipsisLength;
+ if (ellipsisChars == null) {
+ ellipsisChars = "…";
+ ellipsisLength = 3;
+ ellipsisLengthBeforeParsing = 8;
+ } else {
+ ellipsisLength = ellipsisChars.length;
+ ellipsisLengthBeforeParsing = ellipsisChars.length;
+ }
+ var parse_url = function(url3) {
+ var urlObj2 = {};
+ var urlSub = url3;
+ var match = urlSub.match(/^([a-z]+):\/\//i);
+ if (match) {
+ urlObj2.scheme = match[1];
+ urlSub = urlSub.substr(match[0].length);
+ }
+ match = urlSub.match(/^(.*?)(?=(\?|#|\/|$))/i);
+ if (match) {
+ urlObj2.host = match[1];
+ urlSub = urlSub.substr(match[0].length);
+ }
+ match = urlSub.match(/^\/(.*?)(?=(\?|#|$))/i);
+ if (match) {
+ urlObj2.path = match[1];
+ urlSub = urlSub.substr(match[0].length);
+ }
+ match = urlSub.match(/^\?(.*?)(?=(#|$))/i);
+ if (match) {
+ urlObj2.query = match[1];
+ urlSub = urlSub.substr(match[0].length);
+ }
+ match = urlSub.match(/^#(.*?)$/i);
+ if (match) {
+ urlObj2.fragment = match[1];
+ }
+ return urlObj2;
+ };
+ var buildUrl = function(urlObj2) {
+ var url3 = "";
+ if (urlObj2.scheme && urlObj2.host) {
+ url3 += urlObj2.scheme + "://";
+ }
+ if (urlObj2.host) {
+ url3 += urlObj2.host;
+ }
+ if (urlObj2.path) {
+ url3 += "/" + urlObj2.path;
+ }
+ if (urlObj2.query) {
+ url3 += "?" + urlObj2.query;
+ }
+ if (urlObj2.fragment) {
+ url3 += "#" + urlObj2.fragment;
+ }
+ return url3;
+ };
+ var buildSegment = function(segment, remainingAvailableLength3) {
+ var remainingAvailableLengthHalf = remainingAvailableLength3 / 2, startOffset = Math.ceil(remainingAvailableLengthHalf), endOffset = -1 * Math.floor(remainingAvailableLengthHalf), end2 = "";
+ if (endOffset < 0) {
+ end2 = segment.substr(endOffset);
+ }
+ return segment.substr(0, startOffset) + ellipsisChars + end2;
+ };
+ if (url2.length <= truncateLen) {
+ return url2;
+ }
+ var availableLength = truncateLen - ellipsisLength;
+ var urlObj = parse_url(url2);
+ if (urlObj.query) {
+ var matchQuery = urlObj.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);
+ if (matchQuery) {
+ urlObj.query = urlObj.query.substr(0, matchQuery[1].length);
+ url2 = buildUrl(urlObj);
+ }
+ }
+ if (url2.length <= truncateLen) {
+ return url2;
+ }
+ if (urlObj.host) {
+ urlObj.host = urlObj.host.replace(/^www\./, "");
+ url2 = buildUrl(urlObj);
+ }
+ if (url2.length <= truncateLen) {
+ return url2;
+ }
+ var str = "";
+ if (urlObj.host) {
+ str += urlObj.host;
+ }
+ if (str.length >= availableLength) {
+ if (urlObj.host.length == truncateLen) {
+ return (urlObj.host.substr(0, truncateLen - ellipsisLength) + ellipsisChars).substr(0, availableLength + ellipsisLengthBeforeParsing);
+ }
+ return buildSegment(str, availableLength).substr(0, availableLength + ellipsisLengthBeforeParsing);
+ }
+ var pathAndQuery = "";
+ if (urlObj.path) {
+ pathAndQuery += "/" + urlObj.path;
+ }
+ if (urlObj.query) {
+ pathAndQuery += "?" + urlObj.query;
+ }
+ if (pathAndQuery) {
+ if ((str + pathAndQuery).length >= availableLength) {
+ if ((str + pathAndQuery).length == truncateLen) {
+ return (str + pathAndQuery).substr(0, truncateLen);
+ }
+ var remainingAvailableLength = availableLength - str.length;
+ return (str + buildSegment(pathAndQuery, remainingAvailableLength)).substr(0, availableLength + ellipsisLengthBeforeParsing);
+ } else {
+ str += pathAndQuery;
+ }
+ }
+ if (urlObj.fragment) {
+ var fragment = "#" + urlObj.fragment;
+ if ((str + fragment).length >= availableLength) {
+ if ((str + fragment).length == truncateLen) {
+ return (str + fragment).substr(0, truncateLen);
+ }
+ var remainingAvailableLength2 = availableLength - str.length;
+ return (str + buildSegment(fragment, remainingAvailableLength2)).substr(0, availableLength + ellipsisLengthBeforeParsing);
+ } else {
+ str += fragment;
+ }
+ }
+ if (urlObj.scheme && urlObj.host) {
+ var scheme = urlObj.scheme + "://";
+ if ((str + scheme).length < availableLength) {
+ return (scheme + str).substr(0, truncateLen);
+ }
+ }
+ if (str.length <= truncateLen) {
+ return str;
+ }
+ var end = "";
+ if (availableLength > 0) {
+ end = str.substr(-1 * Math.floor(availableLength / 2));
+ }
+ return (str.substr(0, Math.ceil(availableLength / 2)) + ellipsisChars + end).substr(0, availableLength + ellipsisLengthBeforeParsing);
+}
+
+// node_modules/autolinker/dist/es2015/truncate/truncate-middle.js
+function truncateMiddle(url2, truncateLen, ellipsisChars) {
+ if (url2.length <= truncateLen) {
+ return url2;
+ }
+ var ellipsisLengthBeforeParsing;
+ var ellipsisLength;
+ if (ellipsisChars == null) {
+ ellipsisChars = "…";
+ ellipsisLengthBeforeParsing = 8;
+ ellipsisLength = 3;
+ } else {
+ ellipsisLengthBeforeParsing = ellipsisChars.length;
+ ellipsisLength = ellipsisChars.length;
+ }
+ var availableLength = truncateLen - ellipsisLength;
+ var end = "";
+ if (availableLength > 0) {
+ end = url2.substr(-1 * Math.floor(availableLength / 2));
+ }
+ return (url2.substr(0, Math.ceil(availableLength / 2)) + ellipsisChars + end).substr(0, availableLength + ellipsisLengthBeforeParsing);
+}
+
+// node_modules/autolinker/dist/es2015/truncate/truncate-end.js
+function truncateEnd(anchorText, truncateLen, ellipsisChars) {
+ return ellipsis(anchorText, truncateLen, ellipsisChars);
+}
+
+// node_modules/autolinker/dist/es2015/anchor-tag-builder.js
+var AnchorTagBuilder = function() {
+ function AnchorTagBuilder2(cfg) {
+ if (cfg === void 0) {
+ cfg = {};
+ }
+ this.newWindow = false;
+ this.truncate = {};
+ this.className = "";
+ this.newWindow = cfg.newWindow || false;
+ this.truncate = cfg.truncate || {};
+ this.className = cfg.className || "";
+ }
+ AnchorTagBuilder2.prototype.build = function(match) {
+ return new HtmlTag({
+ tagName: "a",
+ attrs: this.createAttrs(match),
+ innerHtml: this.processAnchorText(match.getAnchorText())
+ });
+ };
+ AnchorTagBuilder2.prototype.createAttrs = function(match) {
+ var attrs = {
+ href: match.getAnchorHref()
+ };
+ var cssClass = this.createCssClass(match);
+ if (cssClass) {
+ attrs["class"] = cssClass;
+ }
+ if (this.newWindow) {
+ attrs["target"] = "_blank";
+ attrs["rel"] = "noopener noreferrer";
+ }
+ if (this.truncate) {
+ if (this.truncate.length && this.truncate.length < match.getAnchorText().length) {
+ attrs["title"] = match.getAnchorHref();
+ }
+ }
+ return attrs;
+ };
+ AnchorTagBuilder2.prototype.createCssClass = function(match) {
+ var className = this.className;
+ if (!className) {
+ return "";
+ } else {
+ var returnClasses = [className], cssClassSuffixes = match.getCssClassSuffixes();
+ for (var i = 0, len = cssClassSuffixes.length; i < len; i++) {
+ returnClasses.push(className + "-" + cssClassSuffixes[i]);
+ }
+ return returnClasses.join(" ");
+ }
+ };
+ AnchorTagBuilder2.prototype.processAnchorText = function(anchorText) {
+ anchorText = this.doTruncate(anchorText);
+ return anchorText;
+ };
+ AnchorTagBuilder2.prototype.doTruncate = function(anchorText) {
+ var truncate = this.truncate;
+ if (!truncate || !truncate.length)
+ return anchorText;
+ var truncateLength = truncate.length, truncateLocation = truncate.location;
+ if (truncateLocation === "smart") {
+ return truncateSmart(anchorText, truncateLength);
+ } else if (truncateLocation === "middle") {
+ return truncateMiddle(anchorText, truncateLength);
+ } else {
+ return truncateEnd(anchorText, truncateLength);
+ }
+ };
+ return AnchorTagBuilder2;
+}();
+
+// node_modules/autolinker/dist/es2015/match/match.js
+var Match = function() {
+ function Match2(cfg) {
+ this.__jsduckDummyDocProp = null;
+ this.matchedText = "";
+ this.offset = 0;
+ this.tagBuilder = cfg.tagBuilder;
+ this.matchedText = cfg.matchedText;
+ this.offset = cfg.offset;
+ }
+ Match2.prototype.getMatchedText = function() {
+ return this.matchedText;
+ };
+ Match2.prototype.setOffset = function(offset2) {
+ this.offset = offset2;
+ };
+ Match2.prototype.getOffset = function() {
+ return this.offset;
+ };
+ Match2.prototype.getCssClassSuffixes = function() {
+ return [this.getType()];
+ };
+ Match2.prototype.buildTag = function() {
+ return this.tagBuilder.build(this);
+ };
+ return Match2;
+}();
+
+// node_modules/tslib/modules/index.js
+var import_tslib = __toESM(require_tslib(), 1);
+var {
+ __extends,
+ __assign,
+ __rest,
+ __decorate,
+ __param,
+ __esDecorate,
+ __runInitializers,
+ __propKey,
+ __setFunctionName,
+ __metadata,
+ __awaiter,
+ __generator,
+ __exportStar,
+ __createBinding,
+ __values,
+ __read,
+ __spread,
+ __spreadArrays,
+ __spreadArray,
+ __await,
+ __asyncGenerator,
+ __asyncDelegator,
+ __asyncValues,
+ __makeTemplateObject,
+ __importStar,
+ __importDefault,
+ __classPrivateFieldGet,
+ __classPrivateFieldSet,
+ __classPrivateFieldIn
+} = import_tslib.default;
+
+// node_modules/autolinker/dist/es2015/match/email-match.js
+var EmailMatch = function(_super) {
+ __extends(EmailMatch2, _super);
+ function EmailMatch2(cfg) {
+ var _this = _super.call(this, cfg) || this;
+ _this.email = "";
+ _this.email = cfg.email;
+ return _this;
+ }
+ EmailMatch2.prototype.getType = function() {
+ return "email";
+ };
+ EmailMatch2.prototype.getEmail = function() {
+ return this.email;
+ };
+ EmailMatch2.prototype.getAnchorHref = function() {
+ return "mailto:" + this.email;
+ };
+ EmailMatch2.prototype.getAnchorText = function() {
+ return this.email;
+ };
+ return EmailMatch2;
+}(Match);
+
+// node_modules/autolinker/dist/es2015/match/hashtag-match.js
+var HashtagMatch = function(_super) {
+ __extends(HashtagMatch2, _super);
+ function HashtagMatch2(cfg) {
+ var _this = _super.call(this, cfg) || this;
+ _this.serviceName = "";
+ _this.hashtag = "";
+ _this.serviceName = cfg.serviceName;
+ _this.hashtag = cfg.hashtag;
+ return _this;
+ }
+ HashtagMatch2.prototype.getType = function() {
+ return "hashtag";
+ };
+ HashtagMatch2.prototype.getServiceName = function() {
+ return this.serviceName;
+ };
+ HashtagMatch2.prototype.getHashtag = function() {
+ return this.hashtag;
+ };
+ HashtagMatch2.prototype.getAnchorHref = function() {
+ var serviceName = this.serviceName, hashtag = this.hashtag;
+ switch (serviceName) {
+ case "twitter":
+ return "https://twitter.com/hashtag/" + hashtag;
+ case "facebook":
+ return "https://www.facebook.com/hashtag/" + hashtag;
+ case "instagram":
+ return "https://instagram.com/explore/tags/" + hashtag;
+ case "tiktok":
+ return "https://www.tiktok.com/tag/" + hashtag;
+ default:
+ throw new Error("Unknown service name to point hashtag to: " + serviceName);
+ }
+ };
+ HashtagMatch2.prototype.getAnchorText = function() {
+ return "#" + this.hashtag;
+ };
+ return HashtagMatch2;
+}(Match);
+
+// node_modules/autolinker/dist/es2015/match/mention-match.js
+var MentionMatch = function(_super) {
+ __extends(MentionMatch2, _super);
+ function MentionMatch2(cfg) {
+ var _this = _super.call(this, cfg) || this;
+ _this.serviceName = "twitter";
+ _this.mention = "";
+ _this.mention = cfg.mention;
+ _this.serviceName = cfg.serviceName;
+ return _this;
+ }
+ MentionMatch2.prototype.getType = function() {
+ return "mention";
+ };
+ MentionMatch2.prototype.getMention = function() {
+ return this.mention;
+ };
+ MentionMatch2.prototype.getServiceName = function() {
+ return this.serviceName;
+ };
+ MentionMatch2.prototype.getAnchorHref = function() {
+ switch (this.serviceName) {
+ case "twitter":
+ return "https://twitter.com/" + this.mention;
+ case "instagram":
+ return "https://instagram.com/" + this.mention;
+ case "soundcloud":
+ return "https://soundcloud.com/" + this.mention;
+ case "tiktok":
+ return "https://www.tiktok.com/@" + this.mention;
+ default:
+ throw new Error("Unknown service name to point mention to: " + this.serviceName);
+ }
+ };
+ MentionMatch2.prototype.getAnchorText = function() {
+ return "@" + this.mention;
+ };
+ MentionMatch2.prototype.getCssClassSuffixes = function() {
+ var cssClassSuffixes = _super.prototype.getCssClassSuffixes.call(this), serviceName = this.getServiceName();
+ if (serviceName) {
+ cssClassSuffixes.push(serviceName);
+ }
+ return cssClassSuffixes;
+ };
+ return MentionMatch2;
+}(Match);
+
+// node_modules/autolinker/dist/es2015/match/phone-match.js
+var PhoneMatch = function(_super) {
+ __extends(PhoneMatch2, _super);
+ function PhoneMatch2(cfg) {
+ var _this = _super.call(this, cfg) || this;
+ _this.number = "";
+ _this.plusSign = false;
+ _this.number = cfg.number;
+ _this.plusSign = cfg.plusSign;
+ return _this;
+ }
+ PhoneMatch2.prototype.getType = function() {
+ return "phone";
+ };
+ PhoneMatch2.prototype.getPhoneNumber = function() {
+ return this.number;
+ };
+ PhoneMatch2.prototype.getNumber = function() {
+ return this.getPhoneNumber();
+ };
+ PhoneMatch2.prototype.getAnchorHref = function() {
+ return "tel:" + (this.plusSign ? "+" : "") + this.number;
+ };
+ PhoneMatch2.prototype.getAnchorText = function() {
+ return this.matchedText;
+ };
+ return PhoneMatch2;
+}(Match);
+
+// node_modules/autolinker/dist/es2015/match/url-match.js
+var UrlMatch = function(_super) {
+ __extends(UrlMatch2, _super);
+ function UrlMatch2(cfg) {
+ var _this = _super.call(this, cfg) || this;
+ _this.url = "";
+ _this.urlMatchType = "scheme";
+ _this.protocolUrlMatch = false;
+ _this.protocolRelativeMatch = false;
+ _this.stripPrefix = {
+ scheme: true,
+ www: true
+ };
+ _this.stripTrailingSlash = true;
+ _this.decodePercentEncoding = true;
+ _this.schemePrefixRegex = /^(https?:\/\/)?/i;
+ _this.wwwPrefixRegex = /^(https?:\/\/)?(www\.)?/i;
+ _this.protocolRelativeRegex = /^\/\//;
+ _this.protocolPrepended = false;
+ _this.urlMatchType = cfg.urlMatchType;
+ _this.url = cfg.url;
+ _this.protocolUrlMatch = cfg.protocolUrlMatch;
+ _this.protocolRelativeMatch = cfg.protocolRelativeMatch;
+ _this.stripPrefix = cfg.stripPrefix;
+ _this.stripTrailingSlash = cfg.stripTrailingSlash;
+ _this.decodePercentEncoding = cfg.decodePercentEncoding;
+ return _this;
+ }
+ UrlMatch2.prototype.getType = function() {
+ return "url";
+ };
+ UrlMatch2.prototype.getUrlMatchType = function() {
+ return this.urlMatchType;
+ };
+ UrlMatch2.prototype.getUrl = function() {
+ var url2 = this.url;
+ if (!this.protocolRelativeMatch && !this.protocolUrlMatch && !this.protocolPrepended) {
+ url2 = this.url = "http://" + url2;
+ this.protocolPrepended = true;
+ }
+ return url2;
+ };
+ UrlMatch2.prototype.getAnchorHref = function() {
+ var url2 = this.getUrl();
+ return url2.replace(/&/g, "&");
+ };
+ UrlMatch2.prototype.getAnchorText = function() {
+ var anchorText = this.getMatchedText();
+ if (this.protocolRelativeMatch) {
+ anchorText = this.stripProtocolRelativePrefix(anchorText);
+ }
+ if (this.stripPrefix.scheme) {
+ anchorText = this.stripSchemePrefix(anchorText);
+ }
+ if (this.stripPrefix.www) {
+ anchorText = this.stripWwwPrefix(anchorText);
+ }
+ if (this.stripTrailingSlash) {
+ anchorText = this.removeTrailingSlash(anchorText);
+ }
+ if (this.decodePercentEncoding) {
+ anchorText = this.removePercentEncoding(anchorText);
+ }
+ return anchorText;
+ };
+ UrlMatch2.prototype.stripSchemePrefix = function(url2) {
+ return url2.replace(this.schemePrefixRegex, "");
+ };
+ UrlMatch2.prototype.stripWwwPrefix = function(url2) {
+ return url2.replace(this.wwwPrefixRegex, "$1");
+ };
+ UrlMatch2.prototype.stripProtocolRelativePrefix = function(text) {
+ return text.replace(this.protocolRelativeRegex, "");
+ };
+ UrlMatch2.prototype.removeTrailingSlash = function(anchorText) {
+ if (anchorText.charAt(anchorText.length - 1) === "/") {
+ anchorText = anchorText.slice(0, -1);
+ }
+ return anchorText;
+ };
+ UrlMatch2.prototype.removePercentEncoding = function(anchorText) {
+ var preProcessedEntityAnchorText = anchorText.replace(/%22/gi, """).replace(/%26/gi, "&").replace(/%27/gi, "'").replace(/%3C/gi, "<").replace(/%3E/gi, ">");
+ try {
+ return decodeURIComponent(preProcessedEntityAnchorText);
+ } catch (e) {
+ return preProcessedEntityAnchorText;
+ }
+ };
+ return UrlMatch2;
+}(Match);
+
+// node_modules/autolinker/dist/es2015/matcher/matcher.js
+var Matcher = function() {
+ function Matcher2(cfg) {
+ this.__jsduckDummyDocProp = null;
+ this.tagBuilder = cfg.tagBuilder;
+ }
+ return Matcher2;
+}();
+
+// node_modules/autolinker/dist/es2015/regex-lib.js
+var letterRe = /[A-Za-z]/;
+var digitRe = /[\d]/;
+var nonDigitRe = /[\D]/;
+var whitespaceRe = /\s/;
+var quoteRe = /['"]/;
+var controlCharsRe = /[\x00-\x1F\x7F]/;
+var alphaCharsStr = /A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source;
+var emojiStr = /\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source;
+var marksStr = /\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source;
+var alphaCharsAndMarksStr = alphaCharsStr + emojiStr + marksStr;
+var decimalNumbersStr = /0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source;
+var alphaNumericCharsStr = alphaCharsAndMarksStr + decimalNumbersStr;
+var alphaNumericAndMarksCharsStr = alphaCharsAndMarksStr + decimalNumbersStr;
+var alphaNumericAndMarksCharRe = new RegExp("[".concat(alphaNumericAndMarksCharsStr, "]"));
+var ipStr = "(?:[" + decimalNumbersStr + "]{1,3}\\.){3}[" + decimalNumbersStr + "]{1,3}";
+var domainLabelStr = "[" + alphaNumericAndMarksCharsStr + "](?:[" + alphaNumericAndMarksCharsStr + "\\-_]{0,61}[" + alphaNumericAndMarksCharsStr + "])?";
+var getDomainLabelStr = function(group) {
+ return "(?=(" + domainLabelStr + "))\\" + group;
+};
+var getDomainNameStr = function(group) {
+ return "(?:" + getDomainLabelStr(group) + "(?:\\." + getDomainLabelStr(group + 1) + "){0,126}|" + ipStr + ")";
+};
+var domainNameRegex = new RegExp("[" + alphaNumericAndMarksCharsStr + ".\\-]*[" + alphaNumericAndMarksCharsStr + "\\-]");
+var domainNameCharRegex = alphaNumericAndMarksCharRe;
+
+// node_modules/autolinker/dist/es2015/matcher/tld-regex.js
+var tldRegex = /(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/;
+
+// node_modules/autolinker/dist/es2015/matcher/email-matcher.js
+var localPartCharRegex = new RegExp("[".concat(alphaNumericAndMarksCharsStr, "!#$%&'*+/=?^_`{|}~-]"));
+var strictTldRegex = new RegExp("^".concat(tldRegex.source, "$"));
+var EmailMatcher = function(_super) {
+ __extends(EmailMatcher2, _super);
+ function EmailMatcher2() {
+ var _this = _super !== null && _super.apply(this, arguments) || this;
+ _this.localPartCharRegex = localPartCharRegex;
+ _this.strictTldRegex = strictTldRegex;
+ return _this;
+ }
+ EmailMatcher2.prototype.parseMatches = function(text) {
+ var tagBuilder = this.tagBuilder, localPartCharRegex2 = this.localPartCharRegex, strictTldRegex2 = this.strictTldRegex, matches = [], len = text.length, noCurrentEmailMatch = new CurrentEmailMatch();
+ var mailtoTransitions = {
+ m: "a",
+ a: "i",
+ i: "l",
+ l: "t",
+ t: "o",
+ o: ":"
+ };
+ var charIdx = 0, state = 0, currentEmailMatch = noCurrentEmailMatch;
+ while (charIdx < len) {
+ var char = text.charAt(charIdx);
+ switch (state) {
+ case 0:
+ stateNonEmailAddress(char);
+ break;
+ case 1:
+ stateMailTo(text.charAt(charIdx - 1), char);
+ break;
+ case 2:
+ stateLocalPart(char);
+ break;
+ case 3:
+ stateLocalPartDot(char);
+ break;
+ case 4:
+ stateAtSign(char);
+ break;
+ case 5:
+ stateDomainChar(char);
+ break;
+ case 6:
+ stateDomainHyphen(char);
+ break;
+ case 7:
+ stateDomainDot(char);
+ break;
+ default:
+ throwUnhandledCaseError(state);
+ }
+ charIdx++;
+ }
+ captureMatchIfValidAndReset();
+ return matches;
+ function stateNonEmailAddress(char2) {
+ if (char2 === "m") {
+ beginEmailMatch(1);
+ } else if (localPartCharRegex2.test(char2)) {
+ beginEmailMatch();
+ } else {
+ }
+ }
+ function stateMailTo(prevChar, char2) {
+ if (prevChar === ":") {
+ if (localPartCharRegex2.test(char2)) {
+ state = 2;
+ currentEmailMatch = new CurrentEmailMatch(__assign(__assign({}, currentEmailMatch), { hasMailtoPrefix: true }));
+ } else {
+ resetToNonEmailMatchState();
+ }
+ } else if (mailtoTransitions[prevChar] === char2) {
+ } else if (localPartCharRegex2.test(char2)) {
+ state = 2;
+ } else if (char2 === ".") {
+ state = 3;
+ } else if (char2 === "@") {
+ state = 4;
+ } else {
+ resetToNonEmailMatchState();
+ }
+ }
+ function stateLocalPart(char2) {
+ if (char2 === ".") {
+ state = 3;
+ } else if (char2 === "@") {
+ state = 4;
+ } else if (localPartCharRegex2.test(char2)) {
+ } else {
+ resetToNonEmailMatchState();
+ }
+ }
+ function stateLocalPartDot(char2) {
+ if (char2 === ".") {
+ resetToNonEmailMatchState();
+ } else if (char2 === "@") {
+ resetToNonEmailMatchState();
+ } else if (localPartCharRegex2.test(char2)) {
+ state = 2;
+ } else {
+ resetToNonEmailMatchState();
+ }
+ }
+ function stateAtSign(char2) {
+ if (domainNameCharRegex.test(char2)) {
+ state = 5;
+ } else {
+ resetToNonEmailMatchState();
+ }
+ }
+ function stateDomainChar(char2) {
+ if (char2 === ".") {
+ state = 7;
+ } else if (char2 === "-") {
+ state = 6;
+ } else if (domainNameCharRegex.test(char2)) {
+ } else {
+ captureMatchIfValidAndReset();
+ }
+ }
+ function stateDomainHyphen(char2) {
+ if (char2 === "-" || char2 === ".") {
+ captureMatchIfValidAndReset();
+ } else if (domainNameCharRegex.test(char2)) {
+ state = 5;
+ } else {
+ captureMatchIfValidAndReset();
+ }
+ }
+ function stateDomainDot(char2) {
+ if (char2 === "." || char2 === "-") {
+ captureMatchIfValidAndReset();
+ } else if (domainNameCharRegex.test(char2)) {
+ state = 5;
+ currentEmailMatch = new CurrentEmailMatch(__assign(__assign({}, currentEmailMatch), { hasDomainDot: true }));
+ } else {
+ captureMatchIfValidAndReset();
+ }
+ }
+ function beginEmailMatch(newState) {
+ if (newState === void 0) {
+ newState = 2;
+ }
+ state = newState;
+ currentEmailMatch = new CurrentEmailMatch({ idx: charIdx });
+ }
+ function resetToNonEmailMatchState() {
+ state = 0;
+ currentEmailMatch = noCurrentEmailMatch;
+ }
+ function captureMatchIfValidAndReset() {
+ if (currentEmailMatch.hasDomainDot) {
+ var matchedText = text.slice(currentEmailMatch.idx, charIdx);
+ if (/[-.]$/.test(matchedText)) {
+ matchedText = matchedText.slice(0, -1);
+ }
+ var emailAddress = currentEmailMatch.hasMailtoPrefix ? matchedText.slice("mailto:".length) : matchedText;
+ if (doesEmailHaveValidTld(emailAddress)) {
+ matches.push(new EmailMatch({
+ tagBuilder,
+ matchedText,
+ offset: currentEmailMatch.idx,
+ email: emailAddress
+ }));
+ }
+ }
+ resetToNonEmailMatchState();
+ function doesEmailHaveValidTld(emailAddress2) {
+ var emailAddressTld = emailAddress2.split(".").pop() || "";
+ var emailAddressNormalized = emailAddressTld.toLowerCase();
+ var isValidTld = strictTldRegex2.test(emailAddressNormalized);
+ return isValidTld;
+ }
+ }
+ };
+ return EmailMatcher2;
+}(Matcher);
+var CurrentEmailMatch = function() {
+ function CurrentEmailMatch2(cfg) {
+ if (cfg === void 0) {
+ cfg = {};
+ }
+ this.idx = cfg.idx !== void 0 ? cfg.idx : -1;
+ this.hasMailtoPrefix = !!cfg.hasMailtoPrefix;
+ this.hasDomainDot = !!cfg.hasDomainDot;
+ }
+ return CurrentEmailMatch2;
+}();
+
+// node_modules/autolinker/dist/es2015/matcher/url-match-validator.js
+var UrlMatchValidator = function() {
+ function UrlMatchValidator2() {
+ }
+ UrlMatchValidator2.isValid = function(urlMatch, protocolUrlMatch) {
+ if (protocolUrlMatch && !this.isValidUriScheme(protocolUrlMatch) || this.urlMatchDoesNotHaveProtocolOrDot(urlMatch, protocolUrlMatch) || this.urlMatchDoesNotHaveAtLeastOneWordChar(urlMatch, protocolUrlMatch) && !this.isValidIpAddress(urlMatch) || this.containsMultipleDots(urlMatch)) {
+ return false;
+ }
+ return true;
+ };
+ UrlMatchValidator2.isValidIpAddress = function(uriSchemeMatch) {
+ var newRegex = new RegExp(this.hasFullProtocolRegex.source + this.ipRegex.source);
+ var uriScheme = uriSchemeMatch.match(newRegex);
+ return uriScheme !== null;
+ };
+ UrlMatchValidator2.containsMultipleDots = function(urlMatch) {
+ var stringBeforeSlash = urlMatch;
+ if (this.hasFullProtocolRegex.test(urlMatch)) {
+ stringBeforeSlash = urlMatch.split("://")[1];
+ }
+ return stringBeforeSlash.split("/")[0].indexOf("..") > -1;
+ };
+ UrlMatchValidator2.isValidUriScheme = function(uriSchemeMatch) {
+ var uriSchemeMatchArr = uriSchemeMatch.match(this.uriSchemeRegex), uriScheme = uriSchemeMatchArr && uriSchemeMatchArr[0].toLowerCase();
+ return uriScheme !== "javascript:" && uriScheme !== "vbscript:";
+ };
+ UrlMatchValidator2.urlMatchDoesNotHaveProtocolOrDot = function(urlMatch, protocolUrlMatch) {
+ return !!urlMatch && (!protocolUrlMatch || !this.hasFullProtocolRegex.test(protocolUrlMatch)) && urlMatch.indexOf(".") === -1;
+ };
+ UrlMatchValidator2.urlMatchDoesNotHaveAtLeastOneWordChar = function(urlMatch, protocolUrlMatch) {
+ if (urlMatch && protocolUrlMatch) {
+ return !this.hasFullProtocolRegex.test(protocolUrlMatch) && !this.hasWordCharAfterProtocolRegex.test(urlMatch);
+ } else {
+ return false;
+ }
+ };
+ UrlMatchValidator2.hasFullProtocolRegex = /^[A-Za-z][-.+A-Za-z0-9]*:\/\//;
+ UrlMatchValidator2.uriSchemeRegex = /^[A-Za-z][-.+A-Za-z0-9]*:/;
+ UrlMatchValidator2.hasWordCharAfterProtocolRegex = new RegExp(":[^\\s]*?[" + alphaCharsStr + "]");
+ UrlMatchValidator2.ipRegex = /[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/;
+ return UrlMatchValidator2;
+}();
+
+// node_modules/autolinker/dist/es2015/matcher/url-matcher.js
+var matcherRegex = function() {
+ var schemeRegex = /(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/, wwwRegex = /(?:www\.)/, urlSuffixRegex = new RegExp("[/?#](?:[" + alphaNumericAndMarksCharsStr + "\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^\u2713]*[" + alphaNumericAndMarksCharsStr + "\\-+&@#/%=~_()|'$*\\[\\]{}\u2713])?");
+ return new RegExp([
+ "(?:",
+ "(",
+ schemeRegex.source,
+ getDomainNameStr(2),
+ ")",
+ "|",
+ "(",
+ "(//)?",
+ wwwRegex.source,
+ getDomainNameStr(6),
+ ")",
+ "|",
+ "(",
+ "(//)?",
+ getDomainNameStr(10) + "\\.",
+ tldRegex.source,
+ "(?![-" + alphaNumericCharsStr + "])",
+ ")",
+ ")",
+ "(?::[0-9]+)?",
+ "(?:" + urlSuffixRegex.source + ")?"
+ ].join(""), "gi");
+}();
+var wordCharRegExp = new RegExp("[" + alphaNumericAndMarksCharsStr + "]");
+var UrlMatcher = function(_super) {
+ __extends(UrlMatcher2, _super);
+ function UrlMatcher2(cfg) {
+ var _this = _super.call(this, cfg) || this;
+ _this.stripPrefix = {
+ scheme: true,
+ www: true
+ };
+ _this.stripTrailingSlash = true;
+ _this.decodePercentEncoding = true;
+ _this.matcherRegex = matcherRegex;
+ _this.wordCharRegExp = wordCharRegExp;
+ _this.stripPrefix = cfg.stripPrefix;
+ _this.stripTrailingSlash = cfg.stripTrailingSlash;
+ _this.decodePercentEncoding = cfg.decodePercentEncoding;
+ return _this;
+ }
+ UrlMatcher2.prototype.parseMatches = function(text) {
+ var matcherRegex2 = this.matcherRegex, stripPrefix = this.stripPrefix, stripTrailingSlash = this.stripTrailingSlash, decodePercentEncoding = this.decodePercentEncoding, tagBuilder = this.tagBuilder, matches = [], match;
+ var _loop_1 = function() {
+ var matchStr = match[0], schemeUrlMatch = match[1], wwwUrlMatch = match[4], wwwProtocolRelativeMatch = match[5], tldProtocolRelativeMatch = match[9], offset2 = match.index, protocolRelativeMatch = wwwProtocolRelativeMatch || tldProtocolRelativeMatch, prevChar = text.charAt(offset2 - 1);
+ if (!UrlMatchValidator.isValid(matchStr, schemeUrlMatch)) {
+ return "continue";
+ }
+ if (offset2 > 0 && prevChar === "@") {
+ return "continue";
+ }
+ if (offset2 > 0 && protocolRelativeMatch && this_1.wordCharRegExp.test(prevChar)) {
+ return "continue";
+ }
+ if (/\?$/.test(matchStr)) {
+ matchStr = matchStr.substr(0, matchStr.length - 1);
+ }
+ if (this_1.matchHasUnbalancedClosingParen(matchStr)) {
+ matchStr = matchStr.substr(0, matchStr.length - 1);
+ } else {
+ var pos = this_1.matchHasInvalidCharAfterTld(matchStr, schemeUrlMatch);
+ if (pos > -1) {
+ matchStr = matchStr.substr(0, pos);
+ }
+ }
+ var foundCommonScheme = ["http://", "https://"].find(function(commonScheme) {
+ return !!schemeUrlMatch && schemeUrlMatch.indexOf(commonScheme) !== -1;
+ });
+ if (foundCommonScheme) {
+ var indexOfSchemeStart = matchStr.indexOf(foundCommonScheme);
+ matchStr = matchStr.substr(indexOfSchemeStart);
+ schemeUrlMatch = schemeUrlMatch.substr(indexOfSchemeStart);
+ offset2 = offset2 + indexOfSchemeStart;
+ }
+ var urlMatchType = schemeUrlMatch ? "scheme" : wwwUrlMatch ? "www" : "tld", protocolUrlMatch = !!schemeUrlMatch;
+ matches.push(new UrlMatch({
+ tagBuilder,
+ matchedText: matchStr,
+ offset: offset2,
+ urlMatchType,
+ url: matchStr,
+ protocolUrlMatch,
+ protocolRelativeMatch: !!protocolRelativeMatch,
+ stripPrefix,
+ stripTrailingSlash,
+ decodePercentEncoding
+ }));
+ };
+ var this_1 = this;
+ while ((match = matcherRegex2.exec(text)) !== null) {
+ _loop_1();
+ }
+ return matches;
+ };
+ UrlMatcher2.prototype.matchHasUnbalancedClosingParen = function(matchStr) {
+ var endChar = matchStr.charAt(matchStr.length - 1);
+ var startChar;
+ if (endChar === ")") {
+ startChar = "(";
+ } else if (endChar === "]") {
+ startChar = "[";
+ } else if (endChar === "}") {
+ startChar = "{";
+ } else {
+ return false;
+ }
+ var numOpenBraces = 0;
+ for (var i = 0, len = matchStr.length - 1; i < len; i++) {
+ var char = matchStr.charAt(i);
+ if (char === startChar) {
+ numOpenBraces++;
+ } else if (char === endChar) {
+ numOpenBraces = Math.max(numOpenBraces - 1, 0);
+ }
+ }
+ if (numOpenBraces === 0) {
+ return true;
+ }
+ return false;
+ };
+ UrlMatcher2.prototype.matchHasInvalidCharAfterTld = function(urlMatch, schemeUrlMatch) {
+ if (!urlMatch) {
+ return -1;
+ }
+ var offset2 = 0;
+ if (schemeUrlMatch) {
+ offset2 = urlMatch.indexOf(":");
+ urlMatch = urlMatch.slice(offset2);
+ }
+ var re = new RegExp("^((.?//)?[-." + alphaNumericAndMarksCharsStr + "]*[-" + alphaNumericAndMarksCharsStr + "]\\.[-" + alphaNumericAndMarksCharsStr + "]+)");
+ var res = re.exec(urlMatch);
+ if (res === null) {
+ return -1;
+ }
+ offset2 += res[1].length;
+ urlMatch = urlMatch.slice(res[1].length);
+ if (/^[^-.A-Za-z0-9:\/?#]/.test(urlMatch)) {
+ return offset2;
+ }
+ return -1;
+ };
+ return UrlMatcher2;
+}(Matcher);
+
+// node_modules/autolinker/dist/es2015/matcher/hashtag-matcher.js
+var hashtagTextCharRe = new RegExp("[_".concat(alphaNumericAndMarksCharsStr, "]"));
+var HashtagMatcher = function(_super) {
+ __extends(HashtagMatcher2, _super);
+ function HashtagMatcher2(cfg) {
+ var _this = _super.call(this, cfg) || this;
+ _this.serviceName = "twitter";
+ _this.serviceName = cfg.serviceName;
+ return _this;
+ }
+ HashtagMatcher2.prototype.parseMatches = function(text) {
+ var tagBuilder = this.tagBuilder;
+ var serviceName = this.serviceName;
+ var matches = [];
+ var len = text.length;
+ var charIdx = 0, hashCharIdx = -1, state = 0;
+ while (charIdx < len) {
+ var char = text.charAt(charIdx);
+ switch (state) {
+ case 0:
+ stateNone(char);
+ break;
+ case 1:
+ stateNonHashtagWordChar(char);
+ break;
+ case 2:
+ stateHashtagHashChar(char);
+ break;
+ case 3:
+ stateHashtagTextChar(char);
+ break;
+ default:
+ throwUnhandledCaseError(state);
+ }
+ charIdx++;
+ }
+ captureMatchIfValid();
+ return matches;
+ function stateNone(char2) {
+ if (char2 === "#") {
+ state = 2;
+ hashCharIdx = charIdx;
+ } else if (alphaNumericAndMarksCharRe.test(char2)) {
+ state = 1;
+ } else {
+ }
+ }
+ function stateNonHashtagWordChar(char2) {
+ if (alphaNumericAndMarksCharRe.test(char2)) {
+ } else {
+ state = 0;
+ }
+ }
+ function stateHashtagHashChar(char2) {
+ if (hashtagTextCharRe.test(char2)) {
+ state = 3;
+ } else if (alphaNumericAndMarksCharRe.test(char2)) {
+ state = 1;
+ } else {
+ state = 0;
+ }
+ }
+ function stateHashtagTextChar(char2) {
+ if (hashtagTextCharRe.test(char2)) {
+ } else {
+ captureMatchIfValid();
+ hashCharIdx = -1;
+ if (alphaNumericAndMarksCharRe.test(char2)) {
+ state = 1;
+ } else {
+ state = 0;
+ }
+ }
+ }
+ function captureMatchIfValid() {
+ if (hashCharIdx > -1 && charIdx - hashCharIdx <= 140) {
+ var matchedText = text.slice(hashCharIdx, charIdx);
+ var match = new HashtagMatch({
+ tagBuilder,
+ matchedText,
+ offset: hashCharIdx,
+ serviceName,
+ hashtag: matchedText.slice(1)
+ });
+ matches.push(match);
+ }
+ }
+ };
+ return HashtagMatcher2;
+}(Matcher);
+var hashtagServices = ["twitter", "facebook", "instagram", "tiktok"];
+
+// node_modules/autolinker/dist/es2015/matcher/phone-matcher.js
+var mostPhoneNumbers = /(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/;
+var japanesePhoneRe = /(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/;
+var phoneMatcherRegex = new RegExp("".concat(mostPhoneNumbers.source, "|").concat(japanesePhoneRe.source), "g");
+var PhoneMatcher = function(_super) {
+ __extends(PhoneMatcher2, _super);
+ function PhoneMatcher2() {
+ var _this = _super !== null && _super.apply(this, arguments) || this;
+ _this.matcherRegex = phoneMatcherRegex;
+ return _this;
+ }
+ PhoneMatcher2.prototype.parseMatches = function(text) {
+ var matcherRegex2 = this.matcherRegex, tagBuilder = this.tagBuilder, matches = [], match;
+ while ((match = matcherRegex2.exec(text)) !== null) {
+ var matchedText = match[0], cleanNumber = matchedText.replace(/[^0-9,;#]/g, ""), plusSign = !!(match[1] || match[2]), before = match.index == 0 ? "" : text.substr(match.index - 1, 1), after = text.substr(match.index + matchedText.length, 1), contextClear = !before.match(/\d/) && !after.match(/\d/);
+ if (this.testMatch(match[3]) && this.testMatch(matchedText) && contextClear) {
+ matches.push(new PhoneMatch({
+ tagBuilder,
+ matchedText,
+ offset: match.index,
+ number: cleanNumber,
+ plusSign
+ }));
+ }
+ }
+ return matches;
+ };
+ PhoneMatcher2.prototype.testMatch = function(text) {
+ return nonDigitRe.test(text);
+ };
+ return PhoneMatcher2;
+}(Matcher);
+
+// node_modules/autolinker/dist/es2015/matcher/mention-matcher.js
+var twitterRegex = new RegExp("@[_".concat(alphaNumericAndMarksCharsStr, "]{1,50}(?![_").concat(alphaNumericAndMarksCharsStr, "])"), "g");
+var instagramRegex = new RegExp("@[_.".concat(alphaNumericAndMarksCharsStr, "]{1,30}(?![_").concat(alphaNumericAndMarksCharsStr, "])"), "g");
+var soundcloudRegex = new RegExp("@[-_.".concat(alphaNumericAndMarksCharsStr, "]{1,50}(?![-_").concat(alphaNumericAndMarksCharsStr, "])"), "g");
+var tiktokRegex = new RegExp("@[_.".concat(alphaNumericAndMarksCharsStr, "]{1,23}[_").concat(alphaNumericAndMarksCharsStr, "](?![_").concat(alphaNumericAndMarksCharsStr, "])"), "g");
+var nonWordCharRegex = new RegExp("[^" + alphaNumericAndMarksCharsStr + "]");
+var MentionMatcher = function(_super) {
+ __extends(MentionMatcher2, _super);
+ function MentionMatcher2(cfg) {
+ var _this = _super.call(this, cfg) || this;
+ _this.serviceName = "twitter";
+ _this.matcherRegexes = {
+ twitter: twitterRegex,
+ instagram: instagramRegex,
+ soundcloud: soundcloudRegex,
+ tiktok: tiktokRegex
+ };
+ _this.nonWordCharRegex = nonWordCharRegex;
+ _this.serviceName = cfg.serviceName;
+ return _this;
+ }
+ MentionMatcher2.prototype.parseMatches = function(text) {
+ var serviceName = this.serviceName, matcherRegex2 = this.matcherRegexes[this.serviceName], nonWordCharRegex2 = this.nonWordCharRegex, tagBuilder = this.tagBuilder, matches = [], match;
+ if (!matcherRegex2) {
+ return matches;
+ }
+ while ((match = matcherRegex2.exec(text)) !== null) {
+ var offset2 = match.index, prevChar = text.charAt(offset2 - 1);
+ if (offset2 === 0 || nonWordCharRegex2.test(prevChar)) {
+ var matchedText = match[0].replace(/\.+$/g, ""), mention = matchedText.slice(1);
+ matches.push(new MentionMatch({
+ tagBuilder,
+ matchedText,
+ offset: offset2,
+ serviceName,
+ mention
+ }));
+ }
+ }
+ return matches;
+ };
+ return MentionMatcher2;
+}(Matcher);
+
+// node_modules/autolinker/dist/es2015/htmlParser/parse-html.js
+function parseHtml(html, _a) {
+ var onOpenTag = _a.onOpenTag, onCloseTag = _a.onCloseTag, onText = _a.onText, onComment = _a.onComment, onDoctype = _a.onDoctype;
+ var noCurrentTag = new CurrentTag();
+ var charIdx = 0, len = html.length, state = 0, currentDataIdx = 0, currentTag = noCurrentTag;
+ while (charIdx < len) {
+ var char = html.charAt(charIdx);
+ switch (state) {
+ case 0:
+ stateData(char);
+ break;
+ case 1:
+ stateTagOpen(char);
+ break;
+ case 2:
+ stateEndTagOpen(char);
+ break;
+ case 3:
+ stateTagName(char);
+ break;
+ case 4:
+ stateBeforeAttributeName(char);
+ break;
+ case 5:
+ stateAttributeName(char);
+ break;
+ case 6:
+ stateAfterAttributeName(char);
+ break;
+ case 7:
+ stateBeforeAttributeValue(char);
+ break;
+ case 8:
+ stateAttributeValueDoubleQuoted(char);
+ break;
+ case 9:
+ stateAttributeValueSingleQuoted(char);
+ break;
+ case 10:
+ stateAttributeValueUnquoted(char);
+ break;
+ case 11:
+ stateAfterAttributeValueQuoted(char);
+ break;
+ case 12:
+ stateSelfClosingStartTag(char);
+ break;
+ case 13:
+ stateMarkupDeclarationOpen(char);
+ break;
+ case 14:
+ stateCommentStart(char);
+ break;
+ case 15:
+ stateCommentStartDash(char);
+ break;
+ case 16:
+ stateComment(char);
+ break;
+ case 17:
+ stateCommentEndDash(char);
+ break;
+ case 18:
+ stateCommentEnd(char);
+ break;
+ case 19:
+ stateCommentEndBang(char);
+ break;
+ case 20:
+ stateDoctype(char);
+ break;
+ default:
+ throwUnhandledCaseError(state);
+ }
+ charIdx++;
+ }
+ if (currentDataIdx < charIdx) {
+ emitText();
+ }
+ function stateData(char2) {
+ if (char2 === "<") {
+ startNewTag();
+ }
+ }
+ function stateTagOpen(char2) {
+ if (char2 === "!") {
+ state = 13;
+ } else if (char2 === "/") {
+ state = 2;
+ currentTag = new CurrentTag(__assign(__assign({}, currentTag), { isClosing: true }));
+ } else if (char2 === "<") {
+ startNewTag();
+ } else if (letterRe.test(char2)) {
+ state = 3;
+ currentTag = new CurrentTag(__assign(__assign({}, currentTag), { isOpening: true }));
+ } else {
+ state = 0;
+ currentTag = noCurrentTag;
+ }
+ }
+ function stateTagName(char2) {
+ if (whitespaceRe.test(char2)) {
+ currentTag = new CurrentTag(__assign(__assign({}, currentTag), { name: captureTagName() }));
+ state = 4;
+ } else if (char2 === "<") {
+ startNewTag();
+ } else if (char2 === "/") {
+ currentTag = new CurrentTag(__assign(__assign({}, currentTag), { name: captureTagName() }));
+ state = 12;
+ } else if (char2 === ">") {
+ currentTag = new CurrentTag(__assign(__assign({}, currentTag), { name: captureTagName() }));
+ emitTagAndPreviousTextNode();
+ } else if (!letterRe.test(char2) && !digitRe.test(char2) && char2 !== ":") {
+ resetToDataState();
+ } else {
+ }
+ }
+ function stateEndTagOpen(char2) {
+ if (char2 === ">") {
+ resetToDataState();
+ } else if (letterRe.test(char2)) {
+ state = 3;
+ } else {
+ resetToDataState();
+ }
+ }
+ function stateBeforeAttributeName(char2) {
+ if (whitespaceRe.test(char2)) {
+ } else if (char2 === "/") {
+ state = 12;
+ } else if (char2 === ">") {
+ emitTagAndPreviousTextNode();
+ } else if (char2 === "<") {
+ startNewTag();
+ } else if (char2 === "=" || quoteRe.test(char2) || controlCharsRe.test(char2)) {
+ resetToDataState();
+ } else {
+ state = 5;
+ }
+ }
+ function stateAttributeName(char2) {
+ if (whitespaceRe.test(char2)) {
+ state = 6;
+ } else if (char2 === "/") {
+ state = 12;
+ } else if (char2 === "=") {
+ state = 7;
+ } else if (char2 === ">") {
+ emitTagAndPreviousTextNode();
+ } else if (char2 === "<") {
+ startNewTag();
+ } else if (quoteRe.test(char2)) {
+ resetToDataState();
+ } else {
+ }
+ }
+ function stateAfterAttributeName(char2) {
+ if (whitespaceRe.test(char2)) {
+ } else if (char2 === "/") {
+ state = 12;
+ } else if (char2 === "=") {
+ state = 7;
+ } else if (char2 === ">") {
+ emitTagAndPreviousTextNode();
+ } else if (char2 === "<") {
+ startNewTag();
+ } else if (quoteRe.test(char2)) {
+ resetToDataState();
+ } else {
+ state = 5;
+ }
+ }
+ function stateBeforeAttributeValue(char2) {
+ if (whitespaceRe.test(char2)) {
+ } else if (char2 === '"') {
+ state = 8;
+ } else if (char2 === "'") {
+ state = 9;
+ } else if (/[>=`]/.test(char2)) {
+ resetToDataState();
+ } else if (char2 === "<") {
+ startNewTag();
+ } else {
+ state = 10;
+ }
+ }
+ function stateAttributeValueDoubleQuoted(char2) {
+ if (char2 === '"') {
+ state = 11;
+ } else {
+ }
+ }
+ function stateAttributeValueSingleQuoted(char2) {
+ if (char2 === "'") {
+ state = 11;
+ } else {
+ }
+ }
+ function stateAttributeValueUnquoted(char2) {
+ if (whitespaceRe.test(char2)) {
+ state = 4;
+ } else if (char2 === ">") {
+ emitTagAndPreviousTextNode();
+ } else if (char2 === "<") {
+ startNewTag();
+ } else {
+ }
+ }
+ function stateAfterAttributeValueQuoted(char2) {
+ if (whitespaceRe.test(char2)) {
+ state = 4;
+ } else if (char2 === "/") {
+ state = 12;
+ } else if (char2 === ">") {
+ emitTagAndPreviousTextNode();
+ } else if (char2 === "<") {
+ startNewTag();
+ } else {
+ state = 4;
+ reconsumeCurrentCharacter();
+ }
+ }
+ function stateSelfClosingStartTag(char2) {
+ if (char2 === ">") {
+ currentTag = new CurrentTag(__assign(__assign({}, currentTag), { isClosing: true }));
+ emitTagAndPreviousTextNode();
+ } else {
+ state = 4;
+ }
+ }
+ function stateMarkupDeclarationOpen(char2) {
+ if (html.substr(charIdx, 2) === "--") {
+ charIdx += 2;
+ currentTag = new CurrentTag(__assign(__assign({}, currentTag), { type: "comment" }));
+ state = 14;
+ } else if (html.substr(charIdx, 7).toUpperCase() === "DOCTYPE") {
+ charIdx += 7;
+ currentTag = new CurrentTag(__assign(__assign({}, currentTag), { type: "doctype" }));
+ state = 20;
+ } else {
+ resetToDataState();
+ }
+ }
+ function stateCommentStart(char2) {
+ if (char2 === "-") {
+ state = 15;
+ } else if (char2 === ">") {
+ resetToDataState();
+ } else {
+ state = 16;
+ }
+ }
+ function stateCommentStartDash(char2) {
+ if (char2 === "-") {
+ state = 18;
+ } else if (char2 === ">") {
+ resetToDataState();
+ } else {
+ state = 16;
+ }
+ }
+ function stateComment(char2) {
+ if (char2 === "-") {
+ state = 17;
+ } else {
+ }
+ }
+ function stateCommentEndDash(char2) {
+ if (char2 === "-") {
+ state = 18;
+ } else {
+ state = 16;
+ }
+ }
+ function stateCommentEnd(char2) {
+ if (char2 === ">") {
+ emitTagAndPreviousTextNode();
+ } else if (char2 === "!") {
+ state = 19;
+ } else if (char2 === "-") {
+ } else {
+ state = 16;
+ }
+ }
+ function stateCommentEndBang(char2) {
+ if (char2 === "-") {
+ state = 17;
+ } else if (char2 === ">") {
+ emitTagAndPreviousTextNode();
+ } else {
+ state = 16;
+ }
+ }
+ function stateDoctype(char2) {
+ if (char2 === ">") {
+ emitTagAndPreviousTextNode();
+ } else if (char2 === "<") {
+ startNewTag();
+ } else {
+ }
+ }
+ function resetToDataState() {
+ state = 0;
+ currentTag = noCurrentTag;
+ }
+ function startNewTag() {
+ state = 1;
+ currentTag = new CurrentTag({ idx: charIdx });
+ }
+ function emitTagAndPreviousTextNode() {
+ var textBeforeTag = html.slice(currentDataIdx, currentTag.idx);
+ if (textBeforeTag) {
+ onText(textBeforeTag, currentDataIdx);
+ }
+ if (currentTag.type === "comment") {
+ onComment(currentTag.idx);
+ } else if (currentTag.type === "doctype") {
+ onDoctype(currentTag.idx);
+ } else {
+ if (currentTag.isOpening) {
+ onOpenTag(currentTag.name, currentTag.idx);
+ }
+ if (currentTag.isClosing) {
+ onCloseTag(currentTag.name, currentTag.idx);
+ }
+ }
+ resetToDataState();
+ currentDataIdx = charIdx + 1;
+ }
+ function emitText() {
+ var text = html.slice(currentDataIdx, charIdx);
+ onText(text, currentDataIdx);
+ currentDataIdx = charIdx + 1;
+ }
+ function captureTagName() {
+ var startIdx = currentTag.idx + (currentTag.isClosing ? 2 : 1);
+ return html.slice(startIdx, charIdx).toLowerCase();
+ }
+ function reconsumeCurrentCharacter() {
+ charIdx--;
+ }
+}
+var CurrentTag = function() {
+ function CurrentTag2(cfg) {
+ if (cfg === void 0) {
+ cfg = {};
+ }
+ this.idx = cfg.idx !== void 0 ? cfg.idx : -1;
+ this.type = cfg.type || "tag";
+ this.name = cfg.name || "";
+ this.isOpening = !!cfg.isOpening;
+ this.isClosing = !!cfg.isClosing;
+ }
+ return CurrentTag2;
+}();
+
+// node_modules/autolinker/dist/es2015/autolinker.js
+var Autolinker = function() {
+ function Autolinker2(cfg) {
+ if (cfg === void 0) {
+ cfg = {};
+ }
+ this.version = Autolinker2.version;
+ this.urls = {};
+ this.email = true;
+ this.phone = true;
+ this.hashtag = false;
+ this.mention = false;
+ this.newWindow = true;
+ this.stripPrefix = {
+ scheme: true,
+ www: true
+ };
+ this.stripTrailingSlash = true;
+ this.decodePercentEncoding = true;
+ this.truncate = {
+ length: 0,
+ location: "end"
+ };
+ this.className = "";
+ this.replaceFn = null;
+ this.context = void 0;
+ this.sanitizeHtml = false;
+ this.matchers = null;
+ this.tagBuilder = null;
+ this.urls = this.normalizeUrlsCfg(cfg.urls);
+ this.email = typeof cfg.email === "boolean" ? cfg.email : this.email;
+ this.phone = typeof cfg.phone === "boolean" ? cfg.phone : this.phone;
+ this.hashtag = cfg.hashtag || this.hashtag;
+ this.mention = cfg.mention || this.mention;
+ this.newWindow = typeof cfg.newWindow === "boolean" ? cfg.newWindow : this.newWindow;
+ this.stripPrefix = this.normalizeStripPrefixCfg(cfg.stripPrefix);
+ this.stripTrailingSlash = typeof cfg.stripTrailingSlash === "boolean" ? cfg.stripTrailingSlash : this.stripTrailingSlash;
+ this.decodePercentEncoding = typeof cfg.decodePercentEncoding === "boolean" ? cfg.decodePercentEncoding : this.decodePercentEncoding;
+ this.sanitizeHtml = cfg.sanitizeHtml || false;
+ var mention = this.mention;
+ if (mention !== false && ["twitter", "instagram", "soundcloud", "tiktok"].indexOf(mention) === -1) {
+ throw new Error("invalid `mention` cfg '".concat(mention, "' - see docs"));
+ }
+ var hashtag = this.hashtag;
+ if (hashtag !== false && hashtagServices.indexOf(hashtag) === -1) {
+ throw new Error("invalid `hashtag` cfg '".concat(hashtag, "' - see docs"));
+ }
+ this.truncate = this.normalizeTruncateCfg(cfg.truncate);
+ this.className = cfg.className || this.className;
+ this.replaceFn = cfg.replaceFn || this.replaceFn;
+ this.context = cfg.context || this;
+ }
+ Autolinker2.link = function(textOrHtml, options) {
+ var autolinker3 = new Autolinker2(options);
+ return autolinker3.link(textOrHtml);
+ };
+ Autolinker2.parse = function(textOrHtml, options) {
+ var autolinker3 = new Autolinker2(options);
+ return autolinker3.parse(textOrHtml);
+ };
+ Autolinker2.prototype.normalizeUrlsCfg = function(urls) {
+ if (urls == null)
+ urls = true;
+ if (typeof urls === "boolean") {
+ return { schemeMatches: urls, wwwMatches: urls, tldMatches: urls };
+ } else {
+ return {
+ schemeMatches: typeof urls.schemeMatches === "boolean" ? urls.schemeMatches : true,
+ wwwMatches: typeof urls.wwwMatches === "boolean" ? urls.wwwMatches : true,
+ tldMatches: typeof urls.tldMatches === "boolean" ? urls.tldMatches : true
+ };
+ }
+ };
+ Autolinker2.prototype.normalizeStripPrefixCfg = function(stripPrefix) {
+ if (stripPrefix == null)
+ stripPrefix = true;
+ if (typeof stripPrefix === "boolean") {
+ return { scheme: stripPrefix, www: stripPrefix };
+ } else {
+ return {
+ scheme: typeof stripPrefix.scheme === "boolean" ? stripPrefix.scheme : true,
+ www: typeof stripPrefix.www === "boolean" ? stripPrefix.www : true
+ };
+ }
+ };
+ Autolinker2.prototype.normalizeTruncateCfg = function(truncate) {
+ if (typeof truncate === "number") {
+ return { length: truncate, location: "end" };
+ } else {
+ return defaults(truncate || {}, {
+ length: Number.POSITIVE_INFINITY,
+ location: "end"
+ });
+ }
+ };
+ Autolinker2.prototype.parse = function(textOrHtml) {
+ var _this = this;
+ var skipTagNames = ["a", "style", "script"], skipTagsStackCount = 0, matches = [];
+ parseHtml(textOrHtml, {
+ onOpenTag: function(tagName) {
+ if (skipTagNames.indexOf(tagName) >= 0) {
+ skipTagsStackCount++;
+ }
+ },
+ onText: function(text, offset2) {
+ if (skipTagsStackCount === 0) {
+ var htmlCharacterEntitiesRegex = /( | |<|<|>|>|"|"|')/gi;
+ var textSplit = splitAndCapture(text, htmlCharacterEntitiesRegex);
+ var currentOffset_1 = offset2;
+ textSplit.forEach(function(splitText, i) {
+ if (i % 2 === 0) {
+ var textNodeMatches = _this.parseText(splitText, currentOffset_1);
+ matches.push.apply(matches, textNodeMatches);
+ }
+ currentOffset_1 += splitText.length;
+ });
+ }
+ },
+ onCloseTag: function(tagName) {
+ if (skipTagNames.indexOf(tagName) >= 0) {
+ skipTagsStackCount = Math.max(skipTagsStackCount - 1, 0);
+ }
+ },
+ onComment: function(offset2) {
+ },
+ onDoctype: function(offset2) {
+ }
+ });
+ matches = this.compactMatches(matches);
+ matches = this.removeUnwantedMatches(matches);
+ return matches;
+ };
+ Autolinker2.prototype.compactMatches = function(matches) {
+ matches.sort(function(a3, b) {
+ return a3.getOffset() - b.getOffset();
+ });
+ var i = 0;
+ while (i < matches.length - 1) {
+ var match = matches[i], offset2 = match.getOffset(), matchedTextLength = match.getMatchedText().length, endIdx = offset2 + matchedTextLength;
+ if (i + 1 < matches.length) {
+ if (matches[i + 1].getOffset() === offset2) {
+ var removeIdx = matches[i + 1].getMatchedText().length > matchedTextLength ? i : i + 1;
+ matches.splice(removeIdx, 1);
+ continue;
+ }
+ if (matches[i + 1].getOffset() < endIdx) {
+ matches.splice(i + 1, 1);
+ continue;
+ }
+ }
+ i++;
+ }
+ return matches;
+ };
+ Autolinker2.prototype.removeUnwantedMatches = function(matches) {
+ if (!this.hashtag)
+ remove2(matches, function(match) {
+ return match.getType() === "hashtag";
+ });
+ if (!this.email)
+ remove2(matches, function(match) {
+ return match.getType() === "email";
+ });
+ if (!this.phone)
+ remove2(matches, function(match) {
+ return match.getType() === "phone";
+ });
+ if (!this.mention)
+ remove2(matches, function(match) {
+ return match.getType() === "mention";
+ });
+ if (!this.urls.schemeMatches) {
+ remove2(matches, function(m) {
+ return m.getType() === "url" && m.getUrlMatchType() === "scheme";
+ });
+ }
+ if (!this.urls.wwwMatches) {
+ remove2(matches, function(m) {
+ return m.getType() === "url" && m.getUrlMatchType() === "www";
+ });
+ }
+ if (!this.urls.tldMatches) {
+ remove2(matches, function(m) {
+ return m.getType() === "url" && m.getUrlMatchType() === "tld";
+ });
+ }
+ return matches;
+ };
+ Autolinker2.prototype.parseText = function(text, offset2) {
+ if (offset2 === void 0) {
+ offset2 = 0;
+ }
+ offset2 = offset2 || 0;
+ var matchers = this.getMatchers(), matches = [];
+ for (var i = 0, numMatchers = matchers.length; i < numMatchers; i++) {
+ var textMatches = matchers[i].parseMatches(text);
+ for (var j = 0, numTextMatches = textMatches.length; j < numTextMatches; j++) {
+ textMatches[j].setOffset(offset2 + textMatches[j].getOffset());
+ }
+ matches.push.apply(matches, textMatches);
+ }
+ return matches;
+ };
+ Autolinker2.prototype.link = function(textOrHtml) {
+ if (!textOrHtml) {
+ return "";
+ }
+ if (this.sanitizeHtml) {
+ textOrHtml = textOrHtml.replace(//g, ">");
+ }
+ var matches = this.parse(textOrHtml), newHtml = [], lastIndex = 0;
+ for (var i = 0, len = matches.length; i < len; i++) {
+ var match = matches[i];
+ newHtml.push(textOrHtml.substring(lastIndex, match.getOffset()));
+ newHtml.push(this.createMatchReturnVal(match));
+ lastIndex = match.getOffset() + match.getMatchedText().length;
+ }
+ newHtml.push(textOrHtml.substring(lastIndex));
+ return newHtml.join("");
+ };
+ Autolinker2.prototype.createMatchReturnVal = function(match) {
+ var replaceFnResult;
+ if (this.replaceFn) {
+ replaceFnResult = this.replaceFn.call(this.context, match);
+ }
+ if (typeof replaceFnResult === "string") {
+ return replaceFnResult;
+ } else if (replaceFnResult === false) {
+ return match.getMatchedText();
+ } else if (replaceFnResult instanceof HtmlTag) {
+ return replaceFnResult.toAnchorString();
+ } else {
+ var anchorTag = match.buildTag();
+ return anchorTag.toAnchorString();
+ }
+ };
+ Autolinker2.prototype.getMatchers = function() {
+ if (!this.matchers) {
+ var tagBuilder = this.getTagBuilder();
+ var matchers = [
+ new HashtagMatcher({
+ tagBuilder,
+ serviceName: this.hashtag
+ }),
+ new EmailMatcher({ tagBuilder }),
+ new PhoneMatcher({ tagBuilder }),
+ new MentionMatcher({
+ tagBuilder,
+ serviceName: this.mention
+ }),
+ new UrlMatcher({
+ tagBuilder,
+ stripPrefix: this.stripPrefix,
+ stripTrailingSlash: this.stripTrailingSlash,
+ decodePercentEncoding: this.decodePercentEncoding
+ })
+ ];
+ return this.matchers = matchers;
+ } else {
+ return this.matchers;
+ }
+ };
+ Autolinker2.prototype.getTagBuilder = function() {
+ var tagBuilder = this.tagBuilder;
+ if (!tagBuilder) {
+ tagBuilder = this.tagBuilder = new AnchorTagBuilder({
+ newWindow: this.newWindow,
+ truncate: this.truncate,
+ className: this.className
+ });
+ }
+ return tagBuilder;
+ };
+ Autolinker2.version = version;
+ Autolinker2.AnchorTagBuilder = AnchorTagBuilder;
+ Autolinker2.HtmlTag = HtmlTag;
+ Autolinker2.matcher = {
+ Email: EmailMatcher,
+ Hashtag: HashtagMatcher,
+ Matcher,
+ Mention: MentionMatcher,
+ Phone: PhoneMatcher,
+ Url: UrlMatcher
+ };
+ Autolinker2.match = {
+ Email: EmailMatch,
+ Hashtag: HashtagMatch,
+ Match,
+ Mention: MentionMatch,
+ Phone: PhoneMatch,
+ Url: UrlMatch
+ };
+ return Autolinker2;
+}();
+var autolinker_default = Autolinker;
+
+// node_modules/autolinker/dist/es2015/index.js
+var es2015_default = autolinker_default;
+
+// Source/DataSources/GpxDataSource.js
+var parser;
+if (typeof DOMParser !== "undefined") {
+ parser = new DOMParser();
+}
+var autolinker = new es2015_default({
+ stripPrefix: false,
+ email: false,
+ replaceFn: function(linker, match) {
+ if (!match.protocolUrlMatch) {
+ return false;
+ }
+ }
+});
+var BILLBOARD_SIZE2 = 32;
+var BILLBOARD_NEAR_DISTANCE = 2414016;
+var BILLBOARD_NEAR_RATIO = 1;
+var BILLBOARD_FAR_DISTANCE = 16093e3;
+var BILLBOARD_FAR_RATIO = 0.1;
+var gpxNamespaces = [null, void 0, "http://www.topografix.com/GPX/1/1"];
+var namespaces = {
+ gpx: gpxNamespaces
+};
+function readBlobAsText(blob) {
+ return new Promise((resolve2, reject) => {
+ const reader = new FileReader();
+ reader.addEventListener("load", function() {
+ resolve2(reader.result);
+ });
+ reader.addEventListener("error", function() {
+ reject(reader.error);
+ });
+ reader.readAsText(blob);
+ });
+}
+function getOrCreateEntity(node, entityCollection) {
+ let id = queryStringAttribute(node, "id");
+ id = defined_default(id) ? id : createGuid_default();
+ const entity = entityCollection.getOrCreateEntity(id);
+ return entity;
+}
+function readCoordinateFromNode(node) {
+ const longitude = queryNumericAttribute(node, "lon");
+ const latitude = queryNumericAttribute(node, "lat");
+ const elevation = queryNumericValue(node, "ele", namespaces.gpx);
+ return Cartesian3_default.fromDegrees(longitude, latitude, elevation);
+}
+function queryNumericAttribute(node, attributeName) {
+ if (!defined_default(node)) {
+ return void 0;
+ }
+ const value = node.getAttribute(attributeName);
+ if (value !== null) {
+ const result = parseFloat(value);
+ return !isNaN(result) ? result : void 0;
+ }
+ return void 0;
+}
+function queryStringAttribute(node, attributeName) {
+ if (!defined_default(node)) {
+ return void 0;
+ }
+ const value = node.getAttribute(attributeName);
+ return value !== null ? value : void 0;
+}
+function queryFirstNode(node, tagName, namespace) {
+ if (!defined_default(node)) {
+ return void 0;
+ }
+ const childNodes = node.childNodes;
+ const length3 = childNodes.length;
+ for (let q = 0; q < length3; q++) {
+ const child = childNodes[q];
+ if (child.localName === tagName && namespace.indexOf(child.namespaceURI) !== -1) {
+ return child;
+ }
+ }
+ return void 0;
+}
+function queryNodes(node, tagName, namespace) {
+ if (!defined_default(node)) {
+ return void 0;
+ }
+ const result = [];
+ const childNodes = node.getElementsByTagName(tagName);
+ const length3 = childNodes.length;
+ for (let q = 0; q < length3; q++) {
+ const child = childNodes[q];
+ if (child.localName === tagName && namespace.indexOf(child.namespaceURI) !== -1) {
+ result.push(child);
+ }
+ }
+ return result;
+}
+function queryNumericValue(node, tagName, namespace) {
+ const resultNode = queryFirstNode(node, tagName, namespace);
+ if (defined_default(resultNode)) {
+ const result = parseFloat(resultNode.textContent);
+ return !isNaN(result) ? result : void 0;
+ }
+ return void 0;
+}
+function queryStringValue(node, tagName, namespace) {
+ const result = queryFirstNode(node, tagName, namespace);
+ if (defined_default(result)) {
+ return result.textContent.trim();
+ }
+ return void 0;
+}
+function createDefaultBillboard(image) {
+ const billboard = new BillboardGraphics_default();
+ billboard.width = BILLBOARD_SIZE2;
+ billboard.height = BILLBOARD_SIZE2;
+ billboard.scaleByDistance = new NearFarScalar_default(
+ BILLBOARD_NEAR_DISTANCE,
+ BILLBOARD_NEAR_RATIO,
+ BILLBOARD_FAR_DISTANCE,
+ BILLBOARD_FAR_RATIO
+ );
+ billboard.pixelOffsetScaleByDistance = new NearFarScalar_default(
+ BILLBOARD_NEAR_DISTANCE,
+ BILLBOARD_NEAR_RATIO,
+ BILLBOARD_FAR_DISTANCE,
+ BILLBOARD_FAR_RATIO
+ );
+ billboard.verticalOrigin = new ConstantProperty_default(VerticalOrigin_default.BOTTOM);
+ billboard.image = image;
+ return billboard;
+}
+function createDefaultLabel() {
+ const label = new LabelGraphics_default();
+ label.translucencyByDistance = new NearFarScalar_default(3e6, 1, 5e6, 0);
+ label.pixelOffset = new Cartesian2_default(17, 0);
+ label.horizontalOrigin = HorizontalOrigin_default.LEFT;
+ label.font = "16px sans-serif";
+ label.style = LabelStyle_default.FILL_AND_OUTLINE;
+ return label;
+}
+function createDefaultPolyline(color) {
+ const polyline = new PolylineGraphics_default();
+ polyline.width = 4;
+ polyline.material = new PolylineOutlineMaterialProperty_default();
+ polyline.material.color = defined_default(color) ? color : Color_default.RED;
+ polyline.material.outlineWidth = 2;
+ polyline.material.outlineColor = Color_default.BLACK;
+ return polyline;
+}
+var descriptiveInfoTypes = {
+ time: {
+ text: "Time",
+ tag: "time"
+ },
+ comment: {
+ text: "Comment",
+ tag: "cmt"
+ },
+ description: {
+ text: "Description",
+ tag: "desc"
+ },
+ source: {
+ text: "Source",
+ tag: "src"
+ },
+ number: {
+ text: "GPS track/route number",
+ tag: "number"
+ },
+ type: {
+ text: "Type",
+ tag: "type"
+ }
+};
+var scratchDiv;
+if (typeof document !== "undefined") {
+ scratchDiv = document.createElement("div");
+}
+function processDescription2(node, entity) {
+ let i;
+ let text = "";
+ const infoTypeNames = Object.keys(descriptiveInfoTypes);
+ const length3 = infoTypeNames.length;
+ for (i = 0; i < length3; i++) {
+ const infoTypeName = infoTypeNames[i];
+ const infoType = descriptiveInfoTypes[infoTypeName];
+ infoType.value = defaultValue_default(
+ queryStringValue(node, infoType.tag, namespaces.gpx),
+ ""
+ );
+ if (defined_default(infoType.value) && infoType.value !== "") {
+ text = `${text}${infoType.text}: ${infoType.value}
`;
+ }
+ }
+ if (!defined_default(text) || text === "") {
+ return;
+ }
+ text = autolinker.link(text);
+ scratchDiv.innerHTML = text;
+ const links = scratchDiv.querySelectorAll("a");
+ for (i = 0; i < links.length; i++) {
+ links[i].setAttribute("target", "_blank");
+ }
+ const background = Color_default.WHITE;
+ const foreground = Color_default.BLACK;
+ let tmp2 = '';
+ tmp2 += `${scratchDiv.innerHTML}`;
+ scratchDiv.innerHTML = "";
+ return tmp2;
+}
+function processWpt(dataSource, geometryNode, entityCollection, options) {
+ const position = readCoordinateFromNode(geometryNode);
+ const entity = getOrCreateEntity(geometryNode, entityCollection);
+ entity.position = position;
+ const image = defined_default(options.waypointImage) ? options.waypointImage : dataSource._pinBuilder.fromMakiIconId(
+ "marker",
+ Color_default.RED,
+ BILLBOARD_SIZE2
+ );
+ entity.billboard = createDefaultBillboard(image);
+ const name = queryStringValue(geometryNode, "name", namespaces.gpx);
+ entity.name = name;
+ entity.label = createDefaultLabel();
+ entity.label.text = name;
+ entity.description = processDescription2(geometryNode, entity);
+ if (options.clampToGround) {
+ entity.billboard.heightReference = HeightReference_default.CLAMP_TO_GROUND;
+ entity.label.heightReference = HeightReference_default.CLAMP_TO_GROUND;
+ }
+}
+function processRte(dataSource, geometryNode, entityCollection, options) {
+ const entity = getOrCreateEntity(geometryNode, entityCollection);
+ entity.description = processDescription2(geometryNode, entity);
+ const routePoints = queryNodes(geometryNode, "rtept", namespaces.gpx);
+ const coordinateTuples = new Array(routePoints.length);
+ for (let i = 0; i < routePoints.length; i++) {
+ processWpt(dataSource, routePoints[i], entityCollection, options);
+ coordinateTuples[i] = readCoordinateFromNode(routePoints[i]);
+ }
+ entity.polyline = createDefaultPolyline(options.routeColor);
+ if (options.clampToGround) {
+ entity.polyline.clampToGround = true;
+ }
+ entity.polyline.positions = coordinateTuples;
+}
+function processTrk(dataSource, geometryNode, entityCollection, options) {
+ const entity = getOrCreateEntity(geometryNode, entityCollection);
+ entity.description = processDescription2(geometryNode, entity);
+ const trackSegs = queryNodes(geometryNode, "trkseg", namespaces.gpx);
+ let positions = [];
+ let times = [];
+ let trackSegInfo;
+ let isTimeDynamic = true;
+ const property = new SampledPositionProperty_default();
+ for (let i = 0; i < trackSegs.length; i++) {
+ trackSegInfo = processTrkSeg(trackSegs[i]);
+ positions = positions.concat(trackSegInfo.positions);
+ if (trackSegInfo.times.length > 0) {
+ times = times.concat(trackSegInfo.times);
+ property.addSamples(times, positions);
+ isTimeDynamic = isTimeDynamic && true;
+ } else {
+ isTimeDynamic = false;
+ }
+ }
+ if (isTimeDynamic) {
+ const image = defined_default(options.waypointImage) ? options.waypointImage : dataSource._pinBuilder.fromMakiIconId(
+ "marker",
+ Color_default.RED,
+ BILLBOARD_SIZE2
+ );
+ entity.billboard = createDefaultBillboard(image);
+ entity.position = property;
+ if (options.clampToGround) {
+ entity.billboard.heightReference = HeightReference_default.CLAMP_TO_GROUND;
+ }
+ entity.availability = new TimeIntervalCollection_default();
+ entity.availability.addInterval(
+ new TimeInterval_default({
+ start: times[0],
+ stop: times[times.length - 1]
+ })
+ );
+ }
+ entity.polyline = createDefaultPolyline(options.trackColor);
+ entity.polyline.positions = positions;
+ if (options.clampToGround) {
+ entity.polyline.clampToGround = true;
+ }
+}
+function processTrkSeg(node) {
+ const result = {
+ positions: [],
+ times: []
+ };
+ const trackPoints = queryNodes(node, "trkpt", namespaces.gpx);
+ let time;
+ for (let i = 0; i < trackPoints.length; i++) {
+ const position = readCoordinateFromNode(trackPoints[i]);
+ result.positions.push(position);
+ time = queryStringValue(trackPoints[i], "time", namespaces.gpx);
+ if (defined_default(time)) {
+ result.times.push(JulianDate_default.fromIso8601(time));
+ }
+ }
+ return result;
+}
+function processMetadata(node) {
+ const metadataNode = queryFirstNode(node, "metadata", namespaces.gpx);
+ if (defined_default(metadataNode)) {
+ const metadata = {
+ name: queryStringValue(metadataNode, "name", namespaces.gpx),
+ desc: queryStringValue(metadataNode, "desc", namespaces.gpx),
+ author: getPerson(metadataNode),
+ copyright: getCopyright(metadataNode),
+ link: getLink(metadataNode),
+ time: queryStringValue(metadataNode, "time", namespaces.gpx),
+ keywords: queryStringValue(metadataNode, "keywords", namespaces.gpx),
+ bounds: getBounds(metadataNode)
+ };
+ if (defined_default(metadata.name) || defined_default(metadata.desc) || defined_default(metadata.author) || defined_default(metadata.copyright) || defined_default(metadata.link) || defined_default(metadata.time) || defined_default(metadata.keywords) || defined_default(metadata.bounds)) {
+ return metadata;
+ }
+ }
+ return void 0;
+}
+function getPerson(node) {
+ const personNode = queryFirstNode(node, "author", namespaces.gpx);
+ if (defined_default(personNode)) {
+ const person = {
+ name: queryStringValue(personNode, "name", namespaces.gpx),
+ email: getEmail(personNode),
+ link: getLink(personNode)
+ };
+ if (defined_default(person.name) || defined_default(person.email) || defined_default(person.link)) {
+ return person;
+ }
+ }
+ return void 0;
+}
+function getEmail(node) {
+ const emailNode = queryFirstNode(node, "email", namespaces.gpx);
+ if (defined_default(emailNode)) {
+ const id = queryStringValue(emailNode, "id", namespaces.gpx);
+ const domain = queryStringValue(emailNode, "domain", namespaces.gpx);
+ return `${id}@${domain}`;
+ }
+ return void 0;
+}
+function getLink(node) {
+ const linkNode = queryFirstNode(node, "link", namespaces.gpx);
+ if (defined_default(linkNode)) {
+ const link = {
+ href: queryStringAttribute(linkNode, "href"),
+ text: queryStringValue(linkNode, "text", namespaces.gpx),
+ mimeType: queryStringValue(linkNode, "type", namespaces.gpx)
+ };
+ if (defined_default(link.href) || defined_default(link.text) || defined_default(link.mimeType)) {
+ return link;
+ }
+ }
+ return void 0;
+}
+function getCopyright(node) {
+ const copyrightNode = queryFirstNode(node, "copyright", namespaces.gpx);
+ if (defined_default(copyrightNode)) {
+ const copyright = {
+ author: queryStringAttribute(copyrightNode, "author"),
+ year: queryStringValue(copyrightNode, "year", namespaces.gpx),
+ license: queryStringValue(copyrightNode, "license", namespaces.gpx)
+ };
+ if (defined_default(copyright.author) || defined_default(copyright.year) || defined_default(copyright.license)) {
+ return copyright;
+ }
+ }
+ return void 0;
+}
+function getBounds(node) {
+ const boundsNode = queryFirstNode(node, "bounds", namespaces.gpx);
+ if (defined_default(boundsNode)) {
+ const bounds = {
+ minLat: queryNumericValue(boundsNode, "minlat", namespaces.gpx),
+ maxLat: queryNumericValue(boundsNode, "maxlat", namespaces.gpx),
+ minLon: queryNumericValue(boundsNode, "minlon", namespaces.gpx),
+ maxLon: queryNumericValue(boundsNode, "maxlon", namespaces.gpx)
+ };
+ if (defined_default(bounds.minLat) || defined_default(bounds.maxLat) || defined_default(bounds.minLon) || defined_default(bounds.maxLon)) {
+ return bounds;
+ }
+ }
+ return void 0;
+}
+var complexTypes = {
+ wpt: processWpt,
+ rte: processRte,
+ trk: processTrk
+};
+function processGpx(dataSource, node, entityCollection, options) {
+ const complexTypeNames = Object.keys(complexTypes);
+ const complexTypeNamesLength = complexTypeNames.length;
+ for (let i = 0; i < complexTypeNamesLength; i++) {
+ const typeName = complexTypeNames[i];
+ const processComplexTypeNode = complexTypes[typeName];
+ const childNodes = node.childNodes;
+ const length3 = childNodes.length;
+ for (let q = 0; q < length3; q++) {
+ const child = childNodes[q];
+ if (child.localName === typeName && namespaces.gpx.indexOf(child.namespaceURI) !== -1) {
+ processComplexTypeNode(dataSource, child, entityCollection, options);
+ }
+ }
+ }
+}
+function loadGpx(dataSource, gpx, options) {
+ const entityCollection = dataSource._entityCollection;
+ entityCollection.removeAll();
+ const element = gpx.documentElement;
+ const version2 = queryStringAttribute(element, "version");
+ const creator = queryStringAttribute(element, "creator");
+ let name;
+ const metadata = processMetadata(element);
+ if (defined_default(metadata)) {
+ name = metadata.name;
+ }
+ if (element.localName === "gpx") {
+ processGpx(dataSource, element, entityCollection, options);
+ } else {
+ console.log(`GPX - Unsupported node: ${element.localName}`);
+ }
+ let clock;
+ const availability = entityCollection.computeAvailability();
+ let start = availability.start;
+ let stop2 = availability.stop;
+ const isMinStart = JulianDate_default.equals(start, Iso8601_default.MINIMUM_VALUE);
+ const isMaxStop = JulianDate_default.equals(stop2, Iso8601_default.MAXIMUM_VALUE);
+ if (!isMinStart || !isMaxStop) {
+ let date;
+ if (isMinStart) {
+ date = new Date();
+ date.setHours(0, 0, 0, 0);
+ start = JulianDate_default.fromDate(date);
+ }
+ if (isMaxStop) {
+ date = new Date();
+ date.setHours(24, 0, 0, 0);
+ stop2 = JulianDate_default.fromDate(date);
+ }
+ clock = new DataSourceClock_default();
+ clock.startTime = start;
+ clock.stopTime = stop2;
+ clock.currentTime = JulianDate_default.clone(start);
+ clock.clockRange = ClockRange_default.LOOP_STOP;
+ clock.clockStep = ClockStep_default.SYSTEM_CLOCK_MULTIPLIER;
+ clock.multiplier = Math.round(
+ Math.min(
+ Math.max(JulianDate_default.secondsDifference(stop2, start) / 60, 1),
+ 31556900
+ )
+ );
+ }
+ let changed = false;
+ if (dataSource._name !== name) {
+ dataSource._name = name;
+ changed = true;
+ }
+ if (dataSource._creator !== creator) {
+ dataSource._creator = creator;
+ changed = true;
+ }
+ if (metadataChanged(dataSource._metadata, metadata)) {
+ dataSource._metadata = metadata;
+ changed = true;
+ }
+ if (dataSource._version !== version2) {
+ dataSource._version = version2;
+ changed = true;
+ }
+ if (clock !== dataSource._clock) {
+ changed = true;
+ dataSource._clock = clock;
+ }
+ if (changed) {
+ dataSource._changed.raiseEvent(dataSource);
+ }
+ DataSource_default.setLoading(dataSource, false);
+ return dataSource;
+}
+function metadataChanged(old, current) {
+ if (!defined_default(old) && !defined_default(current)) {
+ return false;
+ } else if (defined_default(old) && defined_default(current)) {
+ if (old.name !== current.name || old.dec !== current.desc || old.src !== current.src || old.author !== current.author || old.copyright !== current.copyright || old.link !== current.link || old.time !== current.time || old.bounds !== current.bounds) {
+ return true;
+ }
+ return false;
+ }
+ return true;
+}
+function load3(dataSource, entityCollection, data, options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ let promise = data;
+ if (typeof data === "string" || data instanceof Resource_default) {
+ data = Resource_default.createIfNeeded(data);
+ promise = data.fetchBlob();
+ const resourceCredits = dataSource._resourceCredits;
+ const credits = data.credits;
+ if (defined_default(credits)) {
+ const length3 = credits.length;
+ for (let i = 0; i < length3; i++) {
+ resourceCredits.push(credits[i]);
+ }
+ }
+ }
+ return Promise.resolve(promise).then(function(dataToLoad) {
+ if (dataToLoad instanceof Blob) {
+ return readBlobAsText(dataToLoad).then(function(text) {
+ let gpx;
+ let error;
+ try {
+ gpx = parser.parseFromString(text, "application/xml");
+ } catch (e) {
+ error = e.toString();
+ }
+ if (defined_default(error) || gpx.body || gpx.documentElement.tagName === "parsererror") {
+ let msg = defined_default(error) ? error : gpx.documentElement.firstChild.nodeValue;
+ if (!msg) {
+ msg = gpx.body.innerText;
+ }
+ throw new RuntimeError_default(msg);
+ }
+ return loadGpx(dataSource, gpx, options);
+ });
+ }
+ return loadGpx(dataSource, dataToLoad, options);
+ }).catch(function(error) {
+ dataSource._error.raiseEvent(dataSource, error);
+ console.log(error);
+ return Promise.reject(error);
+ });
+}
+function GpxDataSource() {
+ this._changed = new Event_default();
+ this._error = new Event_default();
+ this._loading = new Event_default();
+ this._clock = void 0;
+ this._entityCollection = new EntityCollection_default();
+ this._entityCluster = new EntityCluster_default();
+ this._name = void 0;
+ this._version = void 0;
+ this._creator = void 0;
+ this._metadata = void 0;
+ this._isLoading = false;
+ this._pinBuilder = new PinBuilder_default();
+}
+GpxDataSource.load = function(data, options) {
+ return new GpxDataSource().load(data, options);
+};
+Object.defineProperties(GpxDataSource.prototype, {
+ name: {
+ get: function() {
+ return this._name;
+ }
+ },
+ version: {
+ get: function() {
+ return this._version;
+ }
+ },
+ creator: {
+ get: function() {
+ return this._creator;
+ }
+ },
+ metadata: {
+ get: function() {
+ return this._metadata;
+ }
+ },
+ clock: {
+ get: function() {
+ return this._clock;
+ }
+ },
+ entities: {
+ get: function() {
+ return this._entityCollection;
+ }
+ },
+ isLoading: {
+ get: function() {
+ return this._isLoading;
+ }
+ },
+ changedEvent: {
+ get: function() {
+ return this._changed;
+ }
+ },
+ errorEvent: {
+ get: function() {
+ return this._error;
+ }
+ },
+ loadingEvent: {
+ get: function() {
+ return this._loading;
+ }
+ },
+ show: {
+ get: function() {
+ return this._entityCollection.show;
+ },
+ set: function(value) {
+ this._entityCollection.show = value;
+ }
+ },
+ clustering: {
+ get: function() {
+ return this._entityCluster;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value must be defined.");
+ }
+ this._entityCluster = value;
+ }
+ }
+});
+GpxDataSource.prototype.update = function(time) {
+ return true;
+};
+GpxDataSource.prototype.load = function(data, options) {
+ if (!defined_default(data)) {
+ throw new DeveloperError_default("data is required.");
+ }
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ DataSource_default.setLoading(this, true);
+ const oldName = this._name;
+ const that = this;
+ return load3(this, this._entityCollection, data, options).then(function() {
+ let clock;
+ const availability = that._entityCollection.computeAvailability();
+ let start = availability.start;
+ let stop2 = availability.stop;
+ const isMinStart = JulianDate_default.equals(start, Iso8601_default.MINIMUM_VALUE);
+ const isMaxStop = JulianDate_default.equals(stop2, Iso8601_default.MAXIMUM_VALUE);
+ if (!isMinStart || !isMaxStop) {
+ let date;
+ if (isMinStart) {
+ date = new Date();
+ date.setHours(0, 0, 0, 0);
+ start = JulianDate_default.fromDate(date);
+ }
+ if (isMaxStop) {
+ date = new Date();
+ date.setHours(24, 0, 0, 0);
+ stop2 = JulianDate_default.fromDate(date);
+ }
+ clock = new DataSourceClock_default();
+ clock.startTime = start;
+ clock.stopTime = stop2;
+ clock.currentTime = JulianDate_default.clone(start);
+ clock.clockRange = ClockRange_default.LOOP_STOP;
+ clock.clockStep = ClockStep_default.SYSTEM_CLOCK_MULTIPLIER;
+ clock.multiplier = Math.round(
+ Math.min(
+ Math.max(JulianDate_default.secondsDifference(stop2, start) / 60, 1),
+ 31556900
+ )
+ );
+ }
+ let changed = false;
+ if (clock !== that._clock) {
+ that._clock = clock;
+ changed = true;
+ }
+ if (oldName !== that._name) {
+ changed = true;
+ }
+ if (changed) {
+ that._changed.raiseEvent(that);
+ }
+ DataSource_default.setLoading(that, false);
+ return that;
+ }).catch(function(error) {
+ DataSource_default.setLoading(that, false);
+ that._error.raiseEvent(that, error);
+ console.log(error);
+ return Promise.reject(error);
+ });
+};
+var GpxDataSource_default = GpxDataSource;
+
+// Source/DataSources/KmlCamera.js
+function KmlCamera(position, headingPitchRoll) {
+ this.position = position;
+ this.headingPitchRoll = headingPitchRoll;
+}
+var KmlCamera_default = KmlCamera;
+
+// Source/DataSources/KmlDataSource.js
+var import_urijs10 = __toESM(require_URI(), 1);
+
+// Source/Widgets/getElement.js
+function getElement(element) {
+ if (typeof element === "string") {
+ const foundElement = document.getElementById(element);
+ if (foundElement === null) {
+ throw new DeveloperError_default(
+ `Element with id "${element}" does not exist in the document.`
+ );
+ }
+ element = foundElement;
+ }
+ return element;
+}
+var getElement_default = getElement;
+
+// Source/DataSources/KmlLookAt.js
+function KmlLookAt(position, headingPitchRange) {
+ this.position = position;
+ this.headingPitchRange = headingPitchRange;
+}
+var KmlLookAt_default = KmlLookAt;
+
+// Source/DataSources/KmlTour.js
+function KmlTour(name, id) {
+ this.id = id;
+ this.name = name;
+ this.playlistIndex = 0;
+ this.playlist = [];
+ this.tourStart = new Event_default();
+ this.tourEnd = new Event_default();
+ this.entryStart = new Event_default();
+ this.entryEnd = new Event_default();
+ this._activeEntries = [];
+}
+KmlTour.prototype.addPlaylistEntry = function(entry) {
+ this.playlist.push(entry);
+};
+KmlTour.prototype.play = function(widget, cameraOptions) {
+ if (defined_default(widget.cesiumWidget)) {
+ deprecationWarning_default(
+ "viewer",
+ "The viewer parameter has been deprecated in Cesium 1.99. It will be removed in 1.100. Instead of a Viewer, pass a CesiumWidget instead."
+ );
+ }
+ this.tourStart.raiseEvent();
+ const tour = this;
+ playEntry.call(this, widget, cameraOptions, function(terminated) {
+ tour.playlistIndex = 0;
+ if (!terminated) {
+ cancelAllEntries(tour._activeEntries);
+ }
+ tour.tourEnd.raiseEvent(terminated);
+ });
+};
+KmlTour.prototype.stop = function() {
+ cancelAllEntries(this._activeEntries);
+};
+function cancelAllEntries(activeEntries) {
+ for (let entry = activeEntries.pop(); entry !== void 0; entry = activeEntries.pop()) {
+ entry.stop();
+ }
+}
+function playEntry(widget, cameraOptions, allDone) {
+ const entry = this.playlist[this.playlistIndex];
+ if (entry) {
+ const _playNext = playNext.bind(this, widget, cameraOptions, allDone);
+ this._activeEntries.push(entry);
+ this.entryStart.raiseEvent(entry);
+ if (entry.blocking) {
+ entry.play(_playNext, widget.scene.camera, cameraOptions);
+ } else {
+ const tour = this;
+ entry.play(function() {
+ tour.entryEnd.raiseEvent(entry);
+ const indx = tour._activeEntries.indexOf(entry);
+ if (indx >= 0) {
+ tour._activeEntries.splice(indx, 1);
+ }
+ });
+ _playNext(widget, cameraOptions, allDone);
+ }
+ } else if (defined_default(allDone)) {
+ allDone(false);
+ }
+}
+function playNext(widget, cameraOptions, allDone, terminated) {
+ const entry = this.playlist[this.playlistIndex];
+ this.entryEnd.raiseEvent(entry, terminated);
+ if (terminated) {
+ allDone(terminated);
+ } else {
+ const indx = this._activeEntries.indexOf(entry);
+ if (indx >= 0) {
+ this._activeEntries.splice(indx, 1);
+ }
+ this.playlistIndex++;
+ playEntry.call(this, widget, cameraOptions, allDone);
+ }
+}
+var KmlTour_default = KmlTour;
+
+// node_modules/@tweenjs/tween.js/dist/tween.esm.js
+var Easing = {
+ Linear: {
+ None: function(amount) {
+ return amount;
+ }
+ },
+ Quadratic: {
+ In: function(amount) {
+ return amount * amount;
+ },
+ Out: function(amount) {
+ return amount * (2 - amount);
+ },
+ InOut: function(amount) {
+ if ((amount *= 2) < 1) {
+ return 0.5 * amount * amount;
+ }
+ return -0.5 * (--amount * (amount - 2) - 1);
+ }
+ },
+ Cubic: {
+ In: function(amount) {
+ return amount * amount * amount;
+ },
+ Out: function(amount) {
+ return --amount * amount * amount + 1;
+ },
+ InOut: function(amount) {
+ if ((amount *= 2) < 1) {
+ return 0.5 * amount * amount * amount;
+ }
+ return 0.5 * ((amount -= 2) * amount * amount + 2);
+ }
+ },
+ Quartic: {
+ In: function(amount) {
+ return amount * amount * amount * amount;
+ },
+ Out: function(amount) {
+ return 1 - --amount * amount * amount * amount;
+ },
+ InOut: function(amount) {
+ if ((amount *= 2) < 1) {
+ return 0.5 * amount * amount * amount * amount;
+ }
+ return -0.5 * ((amount -= 2) * amount * amount * amount - 2);
+ }
+ },
+ Quintic: {
+ In: function(amount) {
+ return amount * amount * amount * amount * amount;
+ },
+ Out: function(amount) {
+ return --amount * amount * amount * amount * amount + 1;
+ },
+ InOut: function(amount) {
+ if ((amount *= 2) < 1) {
+ return 0.5 * amount * amount * amount * amount * amount;
+ }
+ return 0.5 * ((amount -= 2) * amount * amount * amount * amount + 2);
+ }
+ },
+ Sinusoidal: {
+ In: function(amount) {
+ return 1 - Math.cos(amount * Math.PI / 2);
+ },
+ Out: function(amount) {
+ return Math.sin(amount * Math.PI / 2);
+ },
+ InOut: function(amount) {
+ return 0.5 * (1 - Math.cos(Math.PI * amount));
+ }
+ },
+ Exponential: {
+ In: function(amount) {
+ return amount === 0 ? 0 : Math.pow(1024, amount - 1);
+ },
+ Out: function(amount) {
+ return amount === 1 ? 1 : 1 - Math.pow(2, -10 * amount);
+ },
+ InOut: function(amount) {
+ if (amount === 0) {
+ return 0;
+ }
+ if (amount === 1) {
+ return 1;
+ }
+ if ((amount *= 2) < 1) {
+ return 0.5 * Math.pow(1024, amount - 1);
+ }
+ return 0.5 * (-Math.pow(2, -10 * (amount - 1)) + 2);
+ }
+ },
+ Circular: {
+ In: function(amount) {
+ return 1 - Math.sqrt(1 - amount * amount);
+ },
+ Out: function(amount) {
+ return Math.sqrt(1 - --amount * amount);
+ },
+ InOut: function(amount) {
+ if ((amount *= 2) < 1) {
+ return -0.5 * (Math.sqrt(1 - amount * amount) - 1);
+ }
+ return 0.5 * (Math.sqrt(1 - (amount -= 2) * amount) + 1);
+ }
+ },
+ Elastic: {
+ In: function(amount) {
+ if (amount === 0) {
+ return 0;
+ }
+ if (amount === 1) {
+ return 1;
+ }
+ return -Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);
+ },
+ Out: function(amount) {
+ if (amount === 0) {
+ return 0;
+ }
+ if (amount === 1) {
+ return 1;
+ }
+ return Math.pow(2, -10 * amount) * Math.sin((amount - 0.1) * 5 * Math.PI) + 1;
+ },
+ InOut: function(amount) {
+ if (amount === 0) {
+ return 0;
+ }
+ if (amount === 1) {
+ return 1;
+ }
+ amount *= 2;
+ if (amount < 1) {
+ return -0.5 * Math.pow(2, 10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI);
+ }
+ return 0.5 * Math.pow(2, -10 * (amount - 1)) * Math.sin((amount - 1.1) * 5 * Math.PI) + 1;
+ }
+ },
+ Back: {
+ In: function(amount) {
+ var s = 1.70158;
+ return amount * amount * ((s + 1) * amount - s);
+ },
+ Out: function(amount) {
+ var s = 1.70158;
+ return --amount * amount * ((s + 1) * amount + s) + 1;
+ },
+ InOut: function(amount) {
+ var s = 1.70158 * 1.525;
+ if ((amount *= 2) < 1) {
+ return 0.5 * (amount * amount * ((s + 1) * amount - s));
+ }
+ return 0.5 * ((amount -= 2) * amount * ((s + 1) * amount + s) + 2);
+ }
+ },
+ Bounce: {
+ In: function(amount) {
+ return 1 - Easing.Bounce.Out(1 - amount);
+ },
+ Out: function(amount) {
+ if (amount < 1 / 2.75) {
+ return 7.5625 * amount * amount;
+ } else if (amount < 2 / 2.75) {
+ return 7.5625 * (amount -= 1.5 / 2.75) * amount + 0.75;
+ } else if (amount < 2.5 / 2.75) {
+ return 7.5625 * (amount -= 2.25 / 2.75) * amount + 0.9375;
+ } else {
+ return 7.5625 * (amount -= 2.625 / 2.75) * amount + 0.984375;
+ }
+ },
+ InOut: function(amount) {
+ if (amount < 0.5) {
+ return Easing.Bounce.In(amount * 2) * 0.5;
+ }
+ return Easing.Bounce.Out(amount * 2 - 1) * 0.5 + 0.5;
+ }
+ }
+};
+var now;
+if (typeof self === "undefined" && typeof process !== "undefined" && process.hrtime) {
+ now = function() {
+ var time = process.hrtime();
+ return time[0] * 1e3 + time[1] / 1e6;
+ };
+} else if (typeof self !== "undefined" && self.performance !== void 0 && self.performance.now !== void 0) {
+ now = self.performance.now.bind(self.performance);
+} else if (Date.now !== void 0) {
+ now = Date.now;
+} else {
+ now = function() {
+ return new Date().getTime();
+ };
+}
+var now$1 = now;
+var Group = function() {
+ function Group2() {
+ this._tweens = {};
+ this._tweensAddedDuringUpdate = {};
+ }
+ Group2.prototype.getAll = function() {
+ var _this = this;
+ return Object.keys(this._tweens).map(function(tweenId) {
+ return _this._tweens[tweenId];
+ });
+ };
+ Group2.prototype.removeAll = function() {
+ this._tweens = {};
+ };
+ Group2.prototype.add = function(tween) {
+ this._tweens[tween.getId()] = tween;
+ this._tweensAddedDuringUpdate[tween.getId()] = tween;
+ };
+ Group2.prototype.remove = function(tween) {
+ delete this._tweens[tween.getId()];
+ delete this._tweensAddedDuringUpdate[tween.getId()];
+ };
+ Group2.prototype.update = function(time, preserve) {
+ if (time === void 0) {
+ time = now$1();
+ }
+ if (preserve === void 0) {
+ preserve = false;
+ }
+ var tweenIds = Object.keys(this._tweens);
+ if (tweenIds.length === 0) {
+ return false;
+ }
+ while (tweenIds.length > 0) {
+ this._tweensAddedDuringUpdate = {};
+ for (var i = 0; i < tweenIds.length; i++) {
+ var tween = this._tweens[tweenIds[i]];
+ var autoStart = !preserve;
+ if (tween && tween.update(time, autoStart) === false && !preserve) {
+ delete this._tweens[tweenIds[i]];
+ }
+ }
+ tweenIds = Object.keys(this._tweensAddedDuringUpdate);
+ }
+ return true;
+ };
+ return Group2;
+}();
+var Interpolation = {
+ Linear: function(v7, k) {
+ var m = v7.length - 1;
+ var f = m * k;
+ var i = Math.floor(f);
+ var fn = Interpolation.Utils.Linear;
+ if (k < 0) {
+ return fn(v7[0], v7[1], f);
+ }
+ if (k > 1) {
+ return fn(v7[m], v7[m - 1], m - f);
+ }
+ return fn(v7[i], v7[i + 1 > m ? m : i + 1], f - i);
+ },
+ Bezier: function(v7, k) {
+ var b = 0;
+ var n = v7.length - 1;
+ var pw = Math.pow;
+ var bn = Interpolation.Utils.Bernstein;
+ for (var i = 0; i <= n; i++) {
+ b += pw(1 - k, n - i) * pw(k, i) * v7[i] * bn(n, i);
+ }
+ return b;
+ },
+ CatmullRom: function(v7, k) {
+ var m = v7.length - 1;
+ var f = m * k;
+ var i = Math.floor(f);
+ var fn = Interpolation.Utils.CatmullRom;
+ if (v7[0] === v7[m]) {
+ if (k < 0) {
+ i = Math.floor(f = m * (1 + k));
+ }
+ return fn(v7[(i - 1 + m) % m], v7[i], v7[(i + 1) % m], v7[(i + 2) % m], f - i);
+ } else {
+ if (k < 0) {
+ return v7[0] - (fn(v7[0], v7[0], v7[1], v7[1], -f) - v7[0]);
+ }
+ if (k > 1) {
+ return v7[m] - (fn(v7[m], v7[m], v7[m - 1], v7[m - 1], f - m) - v7[m]);
+ }
+ return fn(v7[i ? i - 1 : 0], v7[i], v7[m < i + 1 ? m : i + 1], v7[m < i + 2 ? m : i + 2], f - i);
+ }
+ },
+ Utils: {
+ Linear: function(p0, p1, t) {
+ return (p1 - p0) * t + p0;
+ },
+ Bernstein: function(n, i) {
+ var fc = Interpolation.Utils.Factorial;
+ return fc(n) / fc(i) / fc(n - i);
+ },
+ Factorial: function() {
+ var a3 = [1];
+ return function(n) {
+ var s = 1;
+ if (a3[n]) {
+ return a3[n];
+ }
+ for (var i = n; i > 1; i--) {
+ s *= i;
+ }
+ a3[n] = s;
+ return s;
+ };
+ }(),
+ CatmullRom: function(p0, p1, p2, p3, t) {
+ var v02 = (p2 - p0) * 0.5;
+ var v13 = (p3 - p1) * 0.5;
+ var t2 = t * t;
+ var t3 = t * t2;
+ return (2 * p1 - 2 * p2 + v02 + v13) * t3 + (-3 * p1 + 3 * p2 - 2 * v02 - v13) * t2 + v02 * t + p1;
+ }
+ }
+};
+var Sequence = function() {
+ function Sequence2() {
+ }
+ Sequence2.nextId = function() {
+ return Sequence2._nextId++;
+ };
+ Sequence2._nextId = 0;
+ return Sequence2;
+}();
+var mainGroup = new Group();
+var Tween = function() {
+ function Tween3(_object, _group) {
+ if (_group === void 0) {
+ _group = mainGroup;
+ }
+ this._object = _object;
+ this._group = _group;
+ this._isPaused = false;
+ this._pauseStart = 0;
+ this._valuesStart = {};
+ this._valuesEnd = {};
+ this._valuesStartRepeat = {};
+ this._duration = 1e3;
+ this._initialRepeat = 0;
+ this._repeat = 0;
+ this._yoyo = false;
+ this._isPlaying = false;
+ this._reversed = false;
+ this._delayTime = 0;
+ this._startTime = 0;
+ this._easingFunction = Easing.Linear.None;
+ this._interpolationFunction = Interpolation.Linear;
+ this._chainedTweens = [];
+ this._onStartCallbackFired = false;
+ this._id = Sequence.nextId();
+ this._isChainStopped = false;
+ this._goToEnd = false;
+ }
+ Tween3.prototype.getId = function() {
+ return this._id;
+ };
+ Tween3.prototype.isPlaying = function() {
+ return this._isPlaying;
+ };
+ Tween3.prototype.isPaused = function() {
+ return this._isPaused;
+ };
+ Tween3.prototype.to = function(properties, duration) {
+ this._valuesEnd = Object.create(properties);
+ if (duration !== void 0) {
+ this._duration = duration;
+ }
+ return this;
+ };
+ Tween3.prototype.duration = function(d) {
+ this._duration = d;
+ return this;
+ };
+ Tween3.prototype.start = function(time) {
+ if (this._isPlaying) {
+ return this;
+ }
+ this._group && this._group.add(this);
+ this._repeat = this._initialRepeat;
+ if (this._reversed) {
+ this._reversed = false;
+ for (var property in this._valuesStartRepeat) {
+ this._swapEndStartRepeatValues(property);
+ this._valuesStart[property] = this._valuesStartRepeat[property];
+ }
+ }
+ this._isPlaying = true;
+ this._isPaused = false;
+ this._onStartCallbackFired = false;
+ this._isChainStopped = false;
+ this._startTime = time !== void 0 ? typeof time === "string" ? now$1() + parseFloat(time) : time : now$1();
+ this._startTime += this._delayTime;
+ this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat);
+ return this;
+ };
+ Tween3.prototype._setupProperties = function(_object, _valuesStart, _valuesEnd, _valuesStartRepeat) {
+ for (var property in _valuesEnd) {
+ var startValue = _object[property];
+ var startValueIsArray = Array.isArray(startValue);
+ var propType = startValueIsArray ? "array" : typeof startValue;
+ var isInterpolationList = !startValueIsArray && Array.isArray(_valuesEnd[property]);
+ if (propType === "undefined" || propType === "function") {
+ continue;
+ }
+ if (isInterpolationList) {
+ var endValues = _valuesEnd[property];
+ if (endValues.length === 0) {
+ continue;
+ }
+ endValues = endValues.map(this._handleRelativeValue.bind(this, startValue));
+ _valuesEnd[property] = [startValue].concat(endValues);
+ }
+ if ((propType === "object" || startValueIsArray) && startValue && !isInterpolationList) {
+ _valuesStart[property] = startValueIsArray ? [] : {};
+ for (var prop in startValue) {
+ _valuesStart[property][prop] = startValue[prop];
+ }
+ _valuesStartRepeat[property] = startValueIsArray ? [] : {};
+ this._setupProperties(startValue, _valuesStart[property], _valuesEnd[property], _valuesStartRepeat[property]);
+ } else {
+ if (typeof _valuesStart[property] === "undefined") {
+ _valuesStart[property] = startValue;
+ }
+ if (!startValueIsArray) {
+ _valuesStart[property] *= 1;
+ }
+ if (isInterpolationList) {
+ _valuesStartRepeat[property] = _valuesEnd[property].slice().reverse();
+ } else {
+ _valuesStartRepeat[property] = _valuesStart[property] || 0;
+ }
+ }
+ }
+ };
+ Tween3.prototype.stop = function() {
+ if (!this._isChainStopped) {
+ this._isChainStopped = true;
+ this.stopChainedTweens();
+ }
+ if (!this._isPlaying) {
+ return this;
+ }
+ this._group && this._group.remove(this);
+ this._isPlaying = false;
+ this._isPaused = false;
+ if (this._onStopCallback) {
+ this._onStopCallback(this._object);
+ }
+ return this;
+ };
+ Tween3.prototype.end = function() {
+ this._goToEnd = true;
+ this.update(Infinity);
+ return this;
+ };
+ Tween3.prototype.pause = function(time) {
+ if (time === void 0) {
+ time = now$1();
+ }
+ if (this._isPaused || !this._isPlaying) {
+ return this;
+ }
+ this._isPaused = true;
+ this._pauseStart = time;
+ this._group && this._group.remove(this);
+ return this;
+ };
+ Tween3.prototype.resume = function(time) {
+ if (time === void 0) {
+ time = now$1();
+ }
+ if (!this._isPaused || !this._isPlaying) {
+ return this;
+ }
+ this._isPaused = false;
+ this._startTime += time - this._pauseStart;
+ this._pauseStart = 0;
+ this._group && this._group.add(this);
+ return this;
+ };
+ Tween3.prototype.stopChainedTweens = function() {
+ for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
+ this._chainedTweens[i].stop();
+ }
+ return this;
+ };
+ Tween3.prototype.group = function(group) {
+ this._group = group;
+ return this;
+ };
+ Tween3.prototype.delay = function(amount) {
+ this._delayTime = amount;
+ return this;
+ };
+ Tween3.prototype.repeat = function(times) {
+ this._initialRepeat = times;
+ this._repeat = times;
+ return this;
+ };
+ Tween3.prototype.repeatDelay = function(amount) {
+ this._repeatDelayTime = amount;
+ return this;
+ };
+ Tween3.prototype.yoyo = function(yoyo) {
+ this._yoyo = yoyo;
+ return this;
+ };
+ Tween3.prototype.easing = function(easingFunction) {
+ this._easingFunction = easingFunction;
+ return this;
+ };
+ Tween3.prototype.interpolation = function(interpolationFunction) {
+ this._interpolationFunction = interpolationFunction;
+ return this;
+ };
+ Tween3.prototype.chain = function() {
+ var tweens = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ tweens[_i] = arguments[_i];
+ }
+ this._chainedTweens = tweens;
+ return this;
+ };
+ Tween3.prototype.onStart = function(callback) {
+ this._onStartCallback = callback;
+ return this;
+ };
+ Tween3.prototype.onUpdate = function(callback) {
+ this._onUpdateCallback = callback;
+ return this;
+ };
+ Tween3.prototype.onRepeat = function(callback) {
+ this._onRepeatCallback = callback;
+ return this;
+ };
+ Tween3.prototype.onComplete = function(callback) {
+ this._onCompleteCallback = callback;
+ return this;
+ };
+ Tween3.prototype.onStop = function(callback) {
+ this._onStopCallback = callback;
+ return this;
+ };
+ Tween3.prototype.update = function(time, autoStart) {
+ if (time === void 0) {
+ time = now$1();
+ }
+ if (autoStart === void 0) {
+ autoStart = true;
+ }
+ if (this._isPaused)
+ return true;
+ var property;
+ var elapsed;
+ var endTime = this._startTime + this._duration;
+ if (!this._goToEnd && !this._isPlaying) {
+ if (time > endTime)
+ return false;
+ if (autoStart)
+ this.start(time);
+ }
+ this._goToEnd = false;
+ if (time < this._startTime) {
+ return true;
+ }
+ if (this._onStartCallbackFired === false) {
+ if (this._onStartCallback) {
+ this._onStartCallback(this._object);
+ }
+ this._onStartCallbackFired = true;
+ }
+ elapsed = (time - this._startTime) / this._duration;
+ elapsed = this._duration === 0 || elapsed > 1 ? 1 : elapsed;
+ var value = this._easingFunction(elapsed);
+ this._updateProperties(this._object, this._valuesStart, this._valuesEnd, value);
+ if (this._onUpdateCallback) {
+ this._onUpdateCallback(this._object, elapsed);
+ }
+ if (elapsed === 1) {
+ if (this._repeat > 0) {
+ if (isFinite(this._repeat)) {
+ this._repeat--;
+ }
+ for (property in this._valuesStartRepeat) {
+ if (!this._yoyo && typeof this._valuesEnd[property] === "string") {
+ this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(this._valuesEnd[property]);
+ }
+ if (this._yoyo) {
+ this._swapEndStartRepeatValues(property);
+ }
+ this._valuesStart[property] = this._valuesStartRepeat[property];
+ }
+ if (this._yoyo) {
+ this._reversed = !this._reversed;
+ }
+ if (this._repeatDelayTime !== void 0) {
+ this._startTime = time + this._repeatDelayTime;
+ } else {
+ this._startTime = time + this._delayTime;
+ }
+ if (this._onRepeatCallback) {
+ this._onRepeatCallback(this._object);
+ }
+ return true;
+ } else {
+ if (this._onCompleteCallback) {
+ this._onCompleteCallback(this._object);
+ }
+ for (var i = 0, numChainedTweens = this._chainedTweens.length; i < numChainedTweens; i++) {
+ this._chainedTweens[i].start(this._startTime + this._duration);
+ }
+ this._isPlaying = false;
+ return false;
+ }
+ }
+ return true;
+ };
+ Tween3.prototype._updateProperties = function(_object, _valuesStart, _valuesEnd, value) {
+ for (var property in _valuesEnd) {
+ if (_valuesStart[property] === void 0) {
+ continue;
+ }
+ var start = _valuesStart[property] || 0;
+ var end = _valuesEnd[property];
+ var startIsArray = Array.isArray(_object[property]);
+ var endIsArray = Array.isArray(end);
+ var isInterpolationList = !startIsArray && endIsArray;
+ if (isInterpolationList) {
+ _object[property] = this._interpolationFunction(end, value);
+ } else if (typeof end === "object" && end) {
+ this._updateProperties(_object[property], start, end, value);
+ } else {
+ end = this._handleRelativeValue(start, end);
+ if (typeof end === "number") {
+ _object[property] = start + (end - start) * value;
+ }
+ }
+ }
+ };
+ Tween3.prototype._handleRelativeValue = function(start, end) {
+ if (typeof end !== "string") {
+ return end;
+ }
+ if (end.charAt(0) === "+" || end.charAt(0) === "-") {
+ return start + parseFloat(end);
+ } else {
+ return parseFloat(end);
+ }
+ };
+ Tween3.prototype._swapEndStartRepeatValues = function(property) {
+ var tmp2 = this._valuesStartRepeat[property];
+ var endValue = this._valuesEnd[property];
+ if (typeof endValue === "string") {
+ this._valuesStartRepeat[property] = this._valuesStartRepeat[property] + parseFloat(endValue);
+ } else {
+ this._valuesStartRepeat[property] = this._valuesEnd[property];
+ }
+ this._valuesEnd[property] = tmp2;
+ };
+ return Tween3;
+}();
+var nextId = Sequence.nextId;
+var TWEEN = mainGroup;
+var getAll = TWEEN.getAll.bind(TWEEN);
+var removeAll = TWEEN.removeAll.bind(TWEEN);
+var add = TWEEN.add.bind(TWEEN);
+var remove3 = TWEEN.remove.bind(TWEEN);
+var update4 = TWEEN.update.bind(TWEEN);
+
+// Source/Core/EasingFunction.js
+var EasingFunction = {
+ LINEAR_NONE: Easing.Linear.None,
+ QUADRATIC_IN: Easing.Quadratic.In,
+ QUADRATIC_OUT: Easing.Quadratic.Out,
+ QUADRATIC_IN_OUT: Easing.Quadratic.InOut,
+ CUBIC_IN: Easing.Cubic.In,
+ CUBIC_OUT: Easing.Cubic.Out,
+ CUBIC_IN_OUT: Easing.Cubic.InOut,
+ QUARTIC_IN: Easing.Quartic.In,
+ QUARTIC_OUT: Easing.Quartic.Out,
+ QUARTIC_IN_OUT: Easing.Quartic.InOut,
+ QUINTIC_IN: Easing.Quintic.In,
+ QUINTIC_OUT: Easing.Quintic.Out,
+ QUINTIC_IN_OUT: Easing.Quintic.InOut,
+ SINUSOIDAL_IN: Easing.Sinusoidal.In,
+ SINUSOIDAL_OUT: Easing.Sinusoidal.Out,
+ SINUSOIDAL_IN_OUT: Easing.Sinusoidal.InOut,
+ EXPONENTIAL_IN: Easing.Exponential.In,
+ EXPONENTIAL_OUT: Easing.Exponential.Out,
+ EXPONENTIAL_IN_OUT: Easing.Exponential.InOut,
+ CIRCULAR_IN: Easing.Circular.In,
+ CIRCULAR_OUT: Easing.Circular.Out,
+ CIRCULAR_IN_OUT: Easing.Circular.InOut,
+ ELASTIC_IN: Easing.Elastic.In,
+ ELASTIC_OUT: Easing.Elastic.Out,
+ ELASTIC_IN_OUT: Easing.Elastic.InOut,
+ BACK_IN: Easing.Back.In,
+ BACK_OUT: Easing.Back.Out,
+ BACK_IN_OUT: Easing.Back.InOut,
+ BOUNCE_IN: Easing.Bounce.In,
+ BOUNCE_OUT: Easing.Bounce.Out,
+ BOUNCE_IN_OUT: Easing.Bounce.InOut
+};
+var EasingFunction_default = Object.freeze(EasingFunction);
+
+// Source/DataSources/KmlTourFlyTo.js
+function KmlTourFlyTo(duration, flyToMode, view) {
+ this.type = "KmlTourFlyTo";
+ this.blocking = true;
+ this.activeCamera = null;
+ this.activeCallback = null;
+ this.duration = duration;
+ this.view = view;
+ this.flyToMode = flyToMode;
+}
+KmlTourFlyTo.prototype.play = function(done, camera, cameraOptions) {
+ this.activeCamera = camera;
+ if (defined_default(done) && done !== null) {
+ const self2 = this;
+ this.activeCallback = function(terminated) {
+ delete self2.activeCallback;
+ delete self2.activeCamera;
+ done(defined_default(terminated) ? false : terminated);
+ };
+ }
+ const options = this.getCameraOptions(cameraOptions);
+ if (this.view.headingPitchRoll) {
+ camera.flyTo(options);
+ } else if (this.view.headingPitchRange) {
+ const target = new BoundingSphere_default(this.view.position);
+ camera.flyToBoundingSphere(target, options);
+ }
+};
+KmlTourFlyTo.prototype.stop = function() {
+ if (defined_default(this.activeCamera)) {
+ this.activeCamera.cancelFlight();
+ }
+ if (defined_default(this.activeCallback)) {
+ this.activeCallback(true);
+ }
+};
+KmlTourFlyTo.prototype.getCameraOptions = function(cameraOptions) {
+ let options = {
+ duration: this.duration
+ };
+ if (defined_default(this.activeCallback)) {
+ options.complete = this.activeCallback;
+ }
+ if (this.flyToMode === "smooth") {
+ options.easingFunction = EasingFunction_default.LINEAR_NONE;
+ }
+ if (this.view.headingPitchRoll) {
+ options.destination = this.view.position;
+ options.orientation = this.view.headingPitchRoll;
+ } else if (this.view.headingPitchRange) {
+ options.offset = this.view.headingPitchRange;
+ }
+ if (defined_default(cameraOptions)) {
+ options = combine_default(options, cameraOptions);
+ }
+ return options;
+};
+var KmlTourFlyTo_default = KmlTourFlyTo;
+
+// Source/DataSources/KmlTourWait.js
+function KmlTourWait(duration) {
+ this.type = "KmlTourWait";
+ this.blocking = true;
+ this.duration = duration;
+ this.timeout = null;
+}
+KmlTourWait.prototype.play = function(done) {
+ const self2 = this;
+ this.activeCallback = done;
+ this.timeout = setTimeout(function() {
+ delete self2.activeCallback;
+ done(false);
+ }, this.duration * 1e3);
+};
+KmlTourWait.prototype.stop = function() {
+ clearTimeout(this.timeout);
+ if (defined_default(this.activeCallback)) {
+ this.activeCallback(true);
+ }
+};
+var KmlTourWait_default = KmlTourWait;
+
+// Source/DataSources/KmlDataSource.js
+var MimeTypes = {
+ avi: "video/x-msvideo",
+ bmp: "image/bmp",
+ bz2: "application/x-bzip2",
+ chm: "application/vnd.ms-htmlhelp",
+ css: "text/css",
+ csv: "text/csv",
+ doc: "application/msword",
+ dvi: "application/x-dvi",
+ eps: "application/postscript",
+ flv: "video/x-flv",
+ gif: "image/gif",
+ gz: "application/x-gzip",
+ htm: "text/html",
+ html: "text/html",
+ ico: "image/vnd.microsoft.icon",
+ jnlp: "application/x-java-jnlp-file",
+ jpeg: "image/jpeg",
+ jpg: "image/jpeg",
+ m3u: "audio/x-mpegurl",
+ m4v: "video/mp4",
+ mathml: "application/mathml+xml",
+ mid: "audio/midi",
+ midi: "audio/midi",
+ mov: "video/quicktime",
+ mp3: "audio/mpeg",
+ mp4: "video/mp4",
+ mp4v: "video/mp4",
+ mpeg: "video/mpeg",
+ mpg: "video/mpeg",
+ odp: "application/vnd.oasis.opendocument.presentation",
+ ods: "application/vnd.oasis.opendocument.spreadsheet",
+ odt: "application/vnd.oasis.opendocument.text",
+ ogg: "application/ogg",
+ pdf: "application/pdf",
+ png: "image/png",
+ pps: "application/vnd.ms-powerpoint",
+ ppt: "application/vnd.ms-powerpoint",
+ ps: "application/postscript",
+ qt: "video/quicktime",
+ rdf: "application/rdf+xml",
+ rss: "application/rss+xml",
+ rtf: "application/rtf",
+ svg: "image/svg+xml",
+ swf: "application/x-shockwave-flash",
+ text: "text/plain",
+ tif: "image/tiff",
+ tiff: "image/tiff",
+ txt: "text/plain",
+ wav: "audio/x-wav",
+ wma: "audio/x-ms-wma",
+ wmv: "video/x-ms-wmv",
+ xml: "application/xml",
+ zip: "application/zip",
+ detectFromFilename: function(filename) {
+ let ext = filename.toLowerCase();
+ ext = getExtensionFromUri_default(ext);
+ return MimeTypes[ext];
+ }
+};
+var parser2;
+if (typeof DOMParser !== "undefined") {
+ parser2 = new DOMParser();
+}
+var autolinker2 = new es2015_default({
+ stripPrefix: false,
+ email: false,
+ replaceFn: function(match) {
+ if (!match.protocolUrlMatch) {
+ return false;
+ }
+ }
+});
+var BILLBOARD_SIZE3 = 32;
+var BILLBOARD_NEAR_DISTANCE2 = 2414016;
+var BILLBOARD_NEAR_RATIO2 = 1;
+var BILLBOARD_FAR_DISTANCE2 = 16093e3;
+var BILLBOARD_FAR_RATIO2 = 0.1;
+var kmlNamespaces = [
+ null,
+ void 0,
+ "http://www.opengis.net/kml/2.2",
+ "http://earth.google.com/kml/2.2",
+ "http://earth.google.com/kml/2.1",
+ "http://earth.google.com/kml/2.0"
+];
+var gxNamespaces = ["http://www.google.com/kml/ext/2.2"];
+var atomNamespaces = ["http://www.w3.org/2005/Atom"];
+var namespaces2 = {
+ kml: kmlNamespaces,
+ gx: gxNamespaces,
+ atom: atomNamespaces,
+ kmlgx: kmlNamespaces.concat(gxNamespaces)
+};
+var featureTypes = {
+ Document: processDocument2,
+ Folder: processFolder,
+ Placemark: processPlacemark,
+ NetworkLink: processNetworkLink,
+ GroundOverlay: processGroundOverlay,
+ PhotoOverlay: processUnsupportedFeature,
+ ScreenOverlay: processScreenOverlay,
+ Tour: processTour
+};
+function DeferredLoading(dataSource) {
+ this._dataSource = dataSource;
+ this._deferred = defer_default();
+ this._stack = [];
+ this._promises = [];
+ this._timeoutSet = false;
+ this._used = false;
+ this._started = 0;
+ this._timeThreshold = 1e3;
+}
+Object.defineProperties(DeferredLoading.prototype, {
+ dataSource: {
+ get: function() {
+ return this._dataSource;
+ }
+ }
+});
+DeferredLoading.prototype.addNodes = function(nodes, processingData) {
+ this._stack.push({
+ nodes,
+ index: 0,
+ processingData
+ });
+ this._used = true;
+};
+DeferredLoading.prototype.addPromise = function(promise) {
+ this._promises.push(promise);
+};
+DeferredLoading.prototype.wait = function() {
+ const deferred = this._deferred;
+ if (!this._used) {
+ deferred.resolve();
+ }
+ return Promise.all([deferred.promise, Promise.all(this._promises)]);
+};
+DeferredLoading.prototype.process = function() {
+ const isFirstCall = this._stack.length === 1;
+ if (isFirstCall) {
+ this._started = KmlDataSource._getTimestamp();
+ }
+ return this._process(isFirstCall);
+};
+DeferredLoading.prototype._giveUpTime = function() {
+ if (this._timeoutSet) {
+ return;
+ }
+ this._timeoutSet = true;
+ this._timeThreshold = 50;
+ const that = this;
+ setTimeout(function() {
+ that._timeoutSet = false;
+ that._started = KmlDataSource._getTimestamp();
+ that._process(true);
+ }, 0);
+};
+DeferredLoading.prototype._nextNode = function() {
+ const stack = this._stack;
+ const top = stack[stack.length - 1];
+ const index = top.index;
+ const nodes = top.nodes;
+ if (index === nodes.length) {
+ return;
+ }
+ ++top.index;
+ return nodes[index];
+};
+DeferredLoading.prototype._pop = function() {
+ const stack = this._stack;
+ stack.pop();
+ if (stack.length === 0) {
+ this._deferred.resolve();
+ return false;
+ }
+ return true;
+};
+DeferredLoading.prototype._process = function(isFirstCall) {
+ const dataSource = this.dataSource;
+ const processingData = this._stack[this._stack.length - 1].processingData;
+ let child = this._nextNode();
+ while (defined_default(child)) {
+ const featureProcessor = featureTypes[child.localName];
+ if (defined_default(featureProcessor) && (namespaces2.kml.indexOf(child.namespaceURI) !== -1 || namespaces2.gx.indexOf(child.namespaceURI) !== -1)) {
+ featureProcessor(dataSource, child, processingData, this);
+ if (this._timeoutSet || KmlDataSource._getTimestamp() > this._started + this._timeThreshold) {
+ this._giveUpTime();
+ return;
+ }
+ }
+ child = this._nextNode();
+ }
+ if (this._pop() && isFirstCall) {
+ this._process(true);
+ }
+};
+function isZipFile(blob) {
+ const magicBlob = blob.slice(0, Math.min(4, blob.size));
+ const deferred = defer_default();
+ const reader = new FileReader();
+ reader.addEventListener("load", function() {
+ deferred.resolve(
+ new DataView(reader.result).getUint32(0, false) === 1347093252
+ );
+ });
+ reader.addEventListener("error", function() {
+ deferred.reject(reader.error);
+ });
+ reader.readAsArrayBuffer(magicBlob);
+ return deferred.promise;
+}
+function readBlobAsText2(blob) {
+ const deferred = defer_default();
+ const reader = new FileReader();
+ reader.addEventListener("load", function() {
+ deferred.resolve(reader.result);
+ });
+ reader.addEventListener("error", function() {
+ deferred.reject(reader.error);
+ });
+ reader.readAsText(blob);
+ return deferred.promise;
+}
+function insertNamespaces(text) {
+ const namespaceMap = {
+ xsi: "http://www.w3.org/2001/XMLSchema-instance"
+ };
+ let firstPart, lastPart, reg, declaration;
+ for (const key in namespaceMap) {
+ if (namespaceMap.hasOwnProperty(key)) {
+ reg = RegExp(`[< ]${key}:`);
+ declaration = `xmlns:${key}=`;
+ if (reg.test(text) && text.indexOf(declaration) === -1) {
+ if (!defined_default(firstPart)) {
+ firstPart = text.substr(0, text.indexOf("", index);
+ let namespace, startIndex, endIndex;
+ while (index !== -1 && index < endDeclaration) {
+ namespace = text.slice(index, text.indexOf('"', index));
+ startIndex = index;
+ index = text.indexOf(namespace, index + 1);
+ if (index !== -1) {
+ endIndex = text.indexOf('"', text.indexOf('"', index) + 1);
+ text = text.slice(0, index - 1) + text.slice(endIndex + 1, text.length);
+ index = text.indexOf("xmlns:", startIndex - 1);
+ } else {
+ index = text.indexOf("xmlns:", startIndex + 1);
+ }
+ }
+ return text;
+}
+function loadXmlFromZip(entry, uriResolver) {
+ return Promise.resolve(entry.getData(new TextWriter())).then(function(text) {
+ text = insertNamespaces(text);
+ text = removeDuplicateNamespaces(text);
+ uriResolver.kml = parser2.parseFromString(text, "application/xml");
+ });
+}
+function loadDataUriFromZip(entry, uriResolver) {
+ const mimeType = defaultValue_default(
+ MimeTypes.detectFromFilename(entry.filename),
+ "application/octet-stream"
+ );
+ return Promise.resolve(entry.getData(new Data64URIWriter(mimeType))).then(
+ function(dataUri) {
+ uriResolver[entry.filename] = dataUri;
+ }
+ );
+}
+function embedDataUris(div, elementType, attributeName, uriResolver) {
+ const keys = uriResolver.keys;
+ const baseUri = new import_urijs10.default(".");
+ const elements = div.querySelectorAll(elementType);
+ for (let i = 0; i < elements.length; i++) {
+ const element = elements[i];
+ const value = element.getAttribute(attributeName);
+ if (defined_default(value)) {
+ const relativeUri = new import_urijs10.default(value);
+ const uri = relativeUri.absoluteTo(baseUri).toString();
+ const index = keys.indexOf(uri);
+ if (index !== -1) {
+ const key = keys[index];
+ element.setAttribute(attributeName, uriResolver[key]);
+ if (elementType === "a" && element.getAttribute("download") === null) {
+ element.setAttribute("download", key);
+ }
+ }
+ }
+ }
+}
+function applyBasePath(div, elementType, attributeName, sourceResource) {
+ const elements = div.querySelectorAll(elementType);
+ for (let i = 0; i < elements.length; i++) {
+ const element = elements[i];
+ const value = element.getAttribute(attributeName);
+ const resource = resolveHref(value, sourceResource);
+ if (defined_default(resource)) {
+ element.setAttribute(attributeName, resource.url);
+ }
+ }
+}
+function createEntity(node, entityCollection, context) {
+ let id = queryStringAttribute2(node, "id");
+ id = defined_default(id) && id.length !== 0 ? id : createGuid_default();
+ if (defined_default(context)) {
+ id = context + id;
+ }
+ let entity = entityCollection.getById(id);
+ if (defined_default(entity)) {
+ id = createGuid_default();
+ if (defined_default(context)) {
+ id = context + id;
+ }
+ }
+ entity = entityCollection.add(new Entity_default({ id }));
+ if (!defined_default(entity.kml)) {
+ entity.addProperty("kml");
+ entity.kml = new KmlFeatureData();
+ }
+ return entity;
+}
+function isExtrudable(altitudeMode, gxAltitudeMode) {
+ return altitudeMode === "absolute" || altitudeMode === "relativeToGround" || gxAltitudeMode === "relativeToSeaFloor";
+}
+function readCoordinate(value, ellipsoid) {
+ if (!defined_default(value)) {
+ return Cartesian3_default.fromDegrees(0, 0, 0, ellipsoid);
+ }
+ const digits = value.match(/[^\s,\n]+/g);
+ if (!defined_default(digits)) {
+ return Cartesian3_default.fromDegrees(0, 0, 0, ellipsoid);
+ }
+ let longitude = parseFloat(digits[0]);
+ let latitude = parseFloat(digits[1]);
+ let height = parseFloat(digits[2]);
+ longitude = isNaN(longitude) ? 0 : longitude;
+ latitude = isNaN(latitude) ? 0 : latitude;
+ height = isNaN(height) ? 0 : height;
+ return Cartesian3_default.fromDegrees(longitude, latitude, height, ellipsoid);
+}
+function readCoordinates(element, ellipsoid) {
+ if (!defined_default(element)) {
+ return void 0;
+ }
+ const tuples = element.textContent.match(/[^\s\n]+/g);
+ if (!defined_default(tuples)) {
+ return void 0;
+ }
+ const length3 = tuples.length;
+ const result = new Array(length3);
+ let resultIndex = 0;
+ for (let i = 0; i < length3; i++) {
+ result[resultIndex++] = readCoordinate(tuples[i], ellipsoid);
+ }
+ return result;
+}
+function queryNumericAttribute2(node, attributeName) {
+ if (!defined_default(node)) {
+ return void 0;
+ }
+ const value = node.getAttribute(attributeName);
+ if (value !== null) {
+ const result = parseFloat(value);
+ return !isNaN(result) ? result : void 0;
+ }
+ return void 0;
+}
+function queryStringAttribute2(node, attributeName) {
+ if (!defined_default(node)) {
+ return void 0;
+ }
+ const value = node.getAttribute(attributeName);
+ return value !== null ? value : void 0;
+}
+function queryFirstNode2(node, tagName, namespace) {
+ if (!defined_default(node)) {
+ return void 0;
+ }
+ const childNodes = node.childNodes;
+ const length3 = childNodes.length;
+ for (let q = 0; q < length3; q++) {
+ const child = childNodes[q];
+ if (child.localName === tagName && namespace.indexOf(child.namespaceURI) !== -1) {
+ return child;
+ }
+ }
+ return void 0;
+}
+function queryNodes2(node, tagName, namespace) {
+ if (!defined_default(node)) {
+ return void 0;
+ }
+ const result = [];
+ const childNodes = node.getElementsByTagNameNS("*", tagName);
+ const length3 = childNodes.length;
+ for (let q = 0; q < length3; q++) {
+ const child = childNodes[q];
+ if (child.localName === tagName && namespace.indexOf(child.namespaceURI) !== -1) {
+ result.push(child);
+ }
+ }
+ return result;
+}
+function queryChildNodes(node, tagName, namespace) {
+ if (!defined_default(node)) {
+ return [];
+ }
+ const result = [];
+ const childNodes = node.childNodes;
+ const length3 = childNodes.length;
+ for (let q = 0; q < length3; q++) {
+ const child = childNodes[q];
+ if (child.localName === tagName && namespace.indexOf(child.namespaceURI) !== -1) {
+ result.push(child);
+ }
+ }
+ return result;
+}
+function queryNumericValue2(node, tagName, namespace) {
+ const resultNode = queryFirstNode2(node, tagName, namespace);
+ if (defined_default(resultNode)) {
+ const result = parseFloat(resultNode.textContent);
+ return !isNaN(result) ? result : void 0;
+ }
+ return void 0;
+}
+function queryStringValue2(node, tagName, namespace) {
+ const result = queryFirstNode2(node, tagName, namespace);
+ if (defined_default(result)) {
+ return result.textContent.trim();
+ }
+ return void 0;
+}
+function queryBooleanValue(node, tagName, namespace) {
+ const result = queryFirstNode2(node, tagName, namespace);
+ if (defined_default(result)) {
+ const value = result.textContent.trim();
+ return value === "1" || /^true$/i.test(value);
+ }
+ return void 0;
+}
+function resolveHref(href, sourceResource, uriResolver) {
+ if (!defined_default(href)) {
+ return void 0;
+ }
+ let resource;
+ if (defined_default(uriResolver)) {
+ href = href.replace(/\\/g, "/");
+ let blob = uriResolver[href];
+ if (defined_default(blob)) {
+ resource = new Resource_default({
+ url: blob
+ });
+ } else {
+ const baseUri = new import_urijs10.default(sourceResource.getUrlComponent());
+ const uri = new import_urijs10.default(href);
+ blob = uriResolver[uri.absoluteTo(baseUri)];
+ if (defined_default(blob)) {
+ resource = new Resource_default({
+ url: blob
+ });
+ }
+ }
+ }
+ if (!defined_default(resource)) {
+ resource = sourceResource.getDerivedResource({
+ url: href
+ });
+ }
+ return resource;
+}
+var colorOptions = {
+ maximumRed: void 0,
+ red: void 0,
+ maximumGreen: void 0,
+ green: void 0,
+ maximumBlue: void 0,
+ blue: void 0
+};
+function parseColorString(value, isRandom) {
+ if (!defined_default(value) || /^\s*$/gm.test(value)) {
+ return void 0;
+ }
+ if (value[0] === "#") {
+ value = value.substring(1);
+ }
+ const alpha = parseInt(value.substring(0, 2), 16) / 255;
+ const blue = parseInt(value.substring(2, 4), 16) / 255;
+ const green = parseInt(value.substring(4, 6), 16) / 255;
+ const red = parseInt(value.substring(6, 8), 16) / 255;
+ if (!isRandom) {
+ return new Color_default(red, green, blue, alpha);
+ }
+ if (red > 0) {
+ colorOptions.maximumRed = red;
+ colorOptions.red = void 0;
+ } else {
+ colorOptions.maximumRed = void 0;
+ colorOptions.red = 0;
+ }
+ if (green > 0) {
+ colorOptions.maximumGreen = green;
+ colorOptions.green = void 0;
+ } else {
+ colorOptions.maximumGreen = void 0;
+ colorOptions.green = 0;
+ }
+ if (blue > 0) {
+ colorOptions.maximumBlue = blue;
+ colorOptions.blue = void 0;
+ } else {
+ colorOptions.maximumBlue = void 0;
+ colorOptions.blue = 0;
+ }
+ colorOptions.alpha = alpha;
+ return Color_default.fromRandom(colorOptions);
+}
+function queryColorValue(node, tagName, namespace) {
+ const value = queryStringValue2(node, tagName, namespace);
+ if (!defined_default(value)) {
+ return void 0;
+ }
+ return parseColorString(
+ value,
+ queryStringValue2(node, "colorMode", namespace) === "random"
+ );
+}
+function processTimeStamp(featureNode) {
+ const node = queryFirstNode2(featureNode, "TimeStamp", namespaces2.kmlgx);
+ const whenString = queryStringValue2(node, "when", namespaces2.kmlgx);
+ if (!defined_default(node) || !defined_default(whenString) || whenString.length === 0) {
+ return void 0;
+ }
+ const when = JulianDate_default.fromIso8601(whenString);
+ const result = new TimeIntervalCollection_default();
+ result.addInterval(
+ new TimeInterval_default({
+ start: when,
+ stop: Iso8601_default.MAXIMUM_VALUE
+ })
+ );
+ return result;
+}
+function processTimeSpan(featureNode) {
+ const node = queryFirstNode2(featureNode, "TimeSpan", namespaces2.kmlgx);
+ if (!defined_default(node)) {
+ return void 0;
+ }
+ let result;
+ const beginNode = queryFirstNode2(node, "begin", namespaces2.kmlgx);
+ let beginDate = defined_default(beginNode) ? JulianDate_default.fromIso8601(beginNode.textContent) : void 0;
+ const endNode = queryFirstNode2(node, "end", namespaces2.kmlgx);
+ let endDate = defined_default(endNode) ? JulianDate_default.fromIso8601(endNode.textContent) : void 0;
+ if (defined_default(beginDate) && defined_default(endDate)) {
+ if (JulianDate_default.lessThan(endDate, beginDate)) {
+ const tmp2 = beginDate;
+ beginDate = endDate;
+ endDate = tmp2;
+ }
+ result = new TimeIntervalCollection_default();
+ result.addInterval(
+ new TimeInterval_default({
+ start: beginDate,
+ stop: endDate
+ })
+ );
+ } else if (defined_default(beginDate)) {
+ result = new TimeIntervalCollection_default();
+ result.addInterval(
+ new TimeInterval_default({
+ start: beginDate,
+ stop: Iso8601_default.MAXIMUM_VALUE
+ })
+ );
+ } else if (defined_default(endDate)) {
+ result = new TimeIntervalCollection_default();
+ result.addInterval(
+ new TimeInterval_default({
+ start: Iso8601_default.MINIMUM_VALUE,
+ stop: endDate
+ })
+ );
+ }
+ return result;
+}
+function createDefaultBillboard2() {
+ const billboard = new BillboardGraphics_default();
+ billboard.width = BILLBOARD_SIZE3;
+ billboard.height = BILLBOARD_SIZE3;
+ billboard.scaleByDistance = new NearFarScalar_default(
+ BILLBOARD_NEAR_DISTANCE2,
+ BILLBOARD_NEAR_RATIO2,
+ BILLBOARD_FAR_DISTANCE2,
+ BILLBOARD_FAR_RATIO2
+ );
+ billboard.pixelOffsetScaleByDistance = new NearFarScalar_default(
+ BILLBOARD_NEAR_DISTANCE2,
+ BILLBOARD_NEAR_RATIO2,
+ BILLBOARD_FAR_DISTANCE2,
+ BILLBOARD_FAR_RATIO2
+ );
+ return billboard;
+}
+function createDefaultPolygon() {
+ const polygon = new PolygonGraphics_default();
+ polygon.outline = true;
+ polygon.outlineColor = Color_default.WHITE;
+ return polygon;
+}
+function createDefaultLabel2() {
+ const label = new LabelGraphics_default();
+ label.translucencyByDistance = new NearFarScalar_default(3e6, 1, 5e6, 0);
+ label.pixelOffset = new Cartesian2_default(17, 0);
+ label.horizontalOrigin = HorizontalOrigin_default.LEFT;
+ label.font = "16px sans-serif";
+ label.style = LabelStyle_default.FILL_AND_OUTLINE;
+ return label;
+}
+function getIconHref(iconNode, dataSource, sourceResource, uriResolver, canRefresh) {
+ let href = queryStringValue2(iconNode, "href", namespaces2.kml);
+ if (!defined_default(href) || href.length === 0) {
+ return void 0;
+ }
+ if (href.indexOf("root://icons/palette-") === 0) {
+ const palette = href.charAt(21);
+ let x = defaultValue_default(queryNumericValue2(iconNode, "x", namespaces2.gx), 0);
+ let y = defaultValue_default(queryNumericValue2(iconNode, "y", namespaces2.gx), 0);
+ x = Math.min(x / 32, 7);
+ y = 7 - Math.min(y / 32, 7);
+ const iconNum = 8 * y + x;
+ href = `https://maps.google.com/mapfiles/kml/pal${palette}/icon${iconNum}.png`;
+ }
+ const hrefResource = resolveHref(href, sourceResource, uriResolver);
+ if (canRefresh) {
+ const refreshMode = queryStringValue2(
+ iconNode,
+ "refreshMode",
+ namespaces2.kml
+ );
+ const viewRefreshMode = queryStringValue2(
+ iconNode,
+ "viewRefreshMode",
+ namespaces2.kml
+ );
+ if (refreshMode === "onInterval" || refreshMode === "onExpire") {
+ oneTimeWarning_default(
+ `kml-refreshMode-${refreshMode}`,
+ `KML - Unsupported Icon refreshMode: ${refreshMode}`
+ );
+ } else if (viewRefreshMode === "onStop" || viewRefreshMode === "onRegion") {
+ oneTimeWarning_default(
+ `kml-refreshMode-${viewRefreshMode}`,
+ `KML - Unsupported Icon viewRefreshMode: ${viewRefreshMode}`
+ );
+ }
+ const viewBoundScale = defaultValue_default(
+ queryStringValue2(iconNode, "viewBoundScale", namespaces2.kml),
+ 1
+ );
+ const defaultViewFormat = viewRefreshMode === "onStop" ? "BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]" : "";
+ const viewFormat = defaultValue_default(
+ queryStringValue2(iconNode, "viewFormat", namespaces2.kml),
+ defaultViewFormat
+ );
+ const httpQuery = queryStringValue2(iconNode, "httpQuery", namespaces2.kml);
+ if (defined_default(viewFormat)) {
+ hrefResource.setQueryParameters(queryToObject_default(cleanupString(viewFormat)));
+ }
+ if (defined_default(httpQuery)) {
+ hrefResource.setQueryParameters(queryToObject_default(cleanupString(httpQuery)));
+ }
+ const ellipsoid = dataSource._ellipsoid;
+ processNetworkLinkQueryString(
+ hrefResource,
+ dataSource.camera,
+ dataSource.canvas,
+ viewBoundScale,
+ dataSource._lastCameraView.bbox,
+ ellipsoid
+ );
+ return hrefResource;
+ }
+ return hrefResource;
+}
+function processBillboardIcon(dataSource, node, targetEntity, sourceResource, uriResolver) {
+ let scale = queryNumericValue2(node, "scale", namespaces2.kml);
+ const heading = queryNumericValue2(node, "heading", namespaces2.kml);
+ const color = queryColorValue(node, "color", namespaces2.kml);
+ const iconNode = queryFirstNode2(node, "Icon", namespaces2.kml);
+ let icon = getIconHref(
+ iconNode,
+ dataSource,
+ sourceResource,
+ uriResolver,
+ false
+ );
+ if (defined_default(iconNode) && !defined_default(icon)) {
+ icon = false;
+ }
+ const x = queryNumericValue2(iconNode, "x", namespaces2.gx);
+ const y = queryNumericValue2(iconNode, "y", namespaces2.gx);
+ const w = queryNumericValue2(iconNode, "w", namespaces2.gx);
+ const h = queryNumericValue2(iconNode, "h", namespaces2.gx);
+ const hotSpotNode = queryFirstNode2(node, "hotSpot", namespaces2.kml);
+ const hotSpotX = queryNumericAttribute2(hotSpotNode, "x");
+ const hotSpotY = queryNumericAttribute2(hotSpotNode, "y");
+ const hotSpotXUnit = queryStringAttribute2(hotSpotNode, "xunits");
+ const hotSpotYUnit = queryStringAttribute2(hotSpotNode, "yunits");
+ let billboard = targetEntity.billboard;
+ if (!defined_default(billboard)) {
+ billboard = createDefaultBillboard2();
+ targetEntity.billboard = billboard;
+ }
+ billboard.image = icon;
+ billboard.scale = scale;
+ billboard.color = color;
+ if (defined_default(x) || defined_default(y) || defined_default(w) || defined_default(h)) {
+ billboard.imageSubRegion = new BoundingRectangle_default(x, y, w, h);
+ }
+ if (defined_default(heading) && heading !== 0) {
+ billboard.rotation = Math_default.toRadians(-heading);
+ billboard.alignedAxis = Cartesian3_default.UNIT_Z;
+ }
+ scale = defaultValue_default(scale, 1);
+ let xOffset;
+ let yOffset;
+ if (defined_default(hotSpotX)) {
+ if (hotSpotXUnit === "pixels") {
+ xOffset = -hotSpotX * scale;
+ } else if (hotSpotXUnit === "insetPixels") {
+ xOffset = (hotSpotX - BILLBOARD_SIZE3) * scale;
+ } else if (hotSpotXUnit === "fraction") {
+ xOffset = -hotSpotX * BILLBOARD_SIZE3 * scale;
+ }
+ xOffset += BILLBOARD_SIZE3 * 0.5 * scale;
+ }
+ if (defined_default(hotSpotY)) {
+ if (hotSpotYUnit === "pixels") {
+ yOffset = hotSpotY * scale;
+ } else if (hotSpotYUnit === "insetPixels") {
+ yOffset = (-hotSpotY + BILLBOARD_SIZE3) * scale;
+ } else if (hotSpotYUnit === "fraction") {
+ yOffset = hotSpotY * BILLBOARD_SIZE3 * scale;
+ }
+ yOffset -= BILLBOARD_SIZE3 * 0.5 * scale;
+ }
+ if (defined_default(xOffset) || defined_default(yOffset)) {
+ billboard.pixelOffset = new Cartesian2_default(xOffset, yOffset);
+ }
+}
+function applyStyle(dataSource, styleNode, targetEntity, sourceResource, uriResolver) {
+ for (let i = 0, len = styleNode.childNodes.length; i < len; i++) {
+ const node = styleNode.childNodes.item(i);
+ if (node.localName === "IconStyle") {
+ processBillboardIcon(
+ dataSource,
+ node,
+ targetEntity,
+ sourceResource,
+ uriResolver
+ );
+ } else if (node.localName === "LabelStyle") {
+ let label = targetEntity.label;
+ if (!defined_default(label)) {
+ label = createDefaultLabel2();
+ targetEntity.label = label;
+ }
+ label.scale = defaultValue_default(
+ queryNumericValue2(node, "scale", namespaces2.kml),
+ label.scale
+ );
+ label.fillColor = defaultValue_default(
+ queryColorValue(node, "color", namespaces2.kml),
+ label.fillColor
+ );
+ label.text = targetEntity.name;
+ } else if (node.localName === "LineStyle") {
+ let polyline = targetEntity.polyline;
+ if (!defined_default(polyline)) {
+ polyline = new PolylineGraphics_default();
+ targetEntity.polyline = polyline;
+ }
+ polyline.width = queryNumericValue2(node, "width", namespaces2.kml);
+ polyline.material = queryColorValue(node, "color", namespaces2.kml);
+ if (defined_default(queryColorValue(node, "outerColor", namespaces2.gx))) {
+ oneTimeWarning_default(
+ "kml-gx:outerColor",
+ "KML - gx:outerColor is not supported in a LineStyle"
+ );
+ }
+ if (defined_default(queryNumericValue2(node, "outerWidth", namespaces2.gx))) {
+ oneTimeWarning_default(
+ "kml-gx:outerWidth",
+ "KML - gx:outerWidth is not supported in a LineStyle"
+ );
+ }
+ if (defined_default(queryNumericValue2(node, "physicalWidth", namespaces2.gx))) {
+ oneTimeWarning_default(
+ "kml-gx:physicalWidth",
+ "KML - gx:physicalWidth is not supported in a LineStyle"
+ );
+ }
+ if (defined_default(queryBooleanValue(node, "labelVisibility", namespaces2.gx))) {
+ oneTimeWarning_default(
+ "kml-gx:labelVisibility",
+ "KML - gx:labelVisibility is not supported in a LineStyle"
+ );
+ }
+ } else if (node.localName === "PolyStyle") {
+ let polygon = targetEntity.polygon;
+ if (!defined_default(polygon)) {
+ polygon = createDefaultPolygon();
+ targetEntity.polygon = polygon;
+ }
+ polygon.material = defaultValue_default(
+ queryColorValue(node, "color", namespaces2.kml),
+ polygon.material
+ );
+ polygon.fill = defaultValue_default(
+ queryBooleanValue(node, "fill", namespaces2.kml),
+ polygon.fill
+ );
+ polygon.outline = defaultValue_default(
+ queryBooleanValue(node, "outline", namespaces2.kml),
+ polygon.outline
+ );
+ } else if (node.localName === "BalloonStyle") {
+ const bgColor = defaultValue_default(
+ parseColorString(queryStringValue2(node, "bgColor", namespaces2.kml)),
+ Color_default.WHITE
+ );
+ const textColor2 = defaultValue_default(
+ parseColorString(queryStringValue2(node, "textColor", namespaces2.kml)),
+ Color_default.BLACK
+ );
+ const text = queryStringValue2(node, "text", namespaces2.kml);
+ targetEntity.addProperty("balloonStyle");
+ targetEntity.balloonStyle = {
+ bgColor,
+ textColor: textColor2,
+ text
+ };
+ } else if (node.localName === "ListStyle") {
+ const listItemType = queryStringValue2(
+ node,
+ "listItemType",
+ namespaces2.kml
+ );
+ if (listItemType === "radioFolder" || listItemType === "checkOffOnly") {
+ oneTimeWarning_default(
+ `kml-listStyle-${listItemType}`,
+ `KML - Unsupported ListStyle with listItemType: ${listItemType}`
+ );
+ }
+ }
+ }
+}
+function computeFinalStyle(dataSource, placeMark, styleCollection, sourceResource, uriResolver) {
+ const result = new Entity_default();
+ let styleEntity;
+ let styleIndex = -1;
+ const childNodes = placeMark.childNodes;
+ const length3 = childNodes.length;
+ for (let q = 0; q < length3; q++) {
+ const child = childNodes[q];
+ if (child.localName === "Style" || child.localName === "StyleMap") {
+ styleIndex = q;
+ }
+ }
+ if (styleIndex !== -1) {
+ const inlineStyleNode = childNodes[styleIndex];
+ if (inlineStyleNode.localName === "Style") {
+ applyStyle(
+ dataSource,
+ inlineStyleNode,
+ result,
+ sourceResource,
+ uriResolver
+ );
+ } else {
+ const pairs = queryChildNodes(inlineStyleNode, "Pair", namespaces2.kml);
+ for (let p = 0; p < pairs.length; p++) {
+ const pair = pairs[p];
+ const key = queryStringValue2(pair, "key", namespaces2.kml);
+ if (key === "normal") {
+ const styleUrl = queryStringValue2(pair, "styleUrl", namespaces2.kml);
+ if (defined_default(styleUrl)) {
+ styleEntity = styleCollection.getById(styleUrl);
+ if (!defined_default(styleEntity)) {
+ styleEntity = styleCollection.getById(`#${styleUrl}`);
+ }
+ if (defined_default(styleEntity)) {
+ result.merge(styleEntity);
+ }
+ } else {
+ const node = queryFirstNode2(pair, "Style", namespaces2.kml);
+ applyStyle(dataSource, node, result, sourceResource, uriResolver);
+ }
+ } else {
+ oneTimeWarning_default(
+ `kml-styleMap-${key}`,
+ `KML - Unsupported StyleMap key: ${key}`
+ );
+ }
+ }
+ }
+ }
+ const externalStyle = queryStringValue2(placeMark, "styleUrl", namespaces2.kml);
+ if (defined_default(externalStyle)) {
+ let id = externalStyle;
+ if (externalStyle[0] !== "#" && externalStyle.indexOf("#") !== -1) {
+ const tokens = externalStyle.split("#");
+ const uri = tokens[0];
+ const resource = sourceResource.getDerivedResource({
+ url: uri
+ });
+ id = `${resource.getUrlComponent()}#${tokens[1]}`;
+ }
+ styleEntity = styleCollection.getById(id);
+ if (!defined_default(styleEntity)) {
+ styleEntity = styleCollection.getById(`#${id}`);
+ }
+ if (defined_default(styleEntity)) {
+ result.merge(styleEntity);
+ }
+ }
+ return result;
+}
+function processExternalStyles(dataSource, resource, styleCollection) {
+ return resource.fetchXML().then(function(styleKml) {
+ return processStyles(dataSource, styleKml, styleCollection, resource, true);
+ });
+}
+function processStyles(dataSource, kml, styleCollection, sourceResource, isExternal, uriResolver) {
+ let i;
+ let id;
+ let styleEntity;
+ let node;
+ const styleNodes = queryNodes2(kml, "Style", namespaces2.kml);
+ if (defined_default(styleNodes)) {
+ const styleNodesLength = styleNodes.length;
+ for (i = 0; i < styleNodesLength; i++) {
+ node = styleNodes[i];
+ id = queryStringAttribute2(node, "id");
+ if (defined_default(id)) {
+ id = `#${id}`;
+ if (isExternal && defined_default(sourceResource)) {
+ id = sourceResource.getUrlComponent() + id;
+ }
+ if (!defined_default(styleCollection.getById(id))) {
+ styleEntity = new Entity_default({
+ id
+ });
+ styleCollection.add(styleEntity);
+ applyStyle(
+ dataSource,
+ node,
+ styleEntity,
+ sourceResource,
+ uriResolver
+ );
+ }
+ }
+ }
+ }
+ const styleMaps = queryNodes2(kml, "StyleMap", namespaces2.kml);
+ if (defined_default(styleMaps)) {
+ const styleMapsLength = styleMaps.length;
+ for (i = 0; i < styleMapsLength; i++) {
+ const styleMap = styleMaps[i];
+ id = queryStringAttribute2(styleMap, "id");
+ if (defined_default(id)) {
+ const pairs = queryChildNodes(styleMap, "Pair", namespaces2.kml);
+ for (let p = 0; p < pairs.length; p++) {
+ const pair = pairs[p];
+ const key = queryStringValue2(pair, "key", namespaces2.kml);
+ if (key === "normal") {
+ id = `#${id}`;
+ if (isExternal && defined_default(sourceResource)) {
+ id = sourceResource.getUrlComponent() + id;
+ }
+ if (!defined_default(styleCollection.getById(id))) {
+ styleEntity = styleCollection.getOrCreateEntity(id);
+ let styleUrl = queryStringValue2(pair, "styleUrl", namespaces2.kml);
+ if (defined_default(styleUrl)) {
+ if (styleUrl[0] !== "#") {
+ styleUrl = `#${styleUrl}`;
+ }
+ if (isExternal && defined_default(sourceResource)) {
+ styleUrl = sourceResource.getUrlComponent() + styleUrl;
+ }
+ const base = styleCollection.getById(styleUrl);
+ if (defined_default(base)) {
+ styleEntity.merge(base);
+ }
+ } else {
+ node = queryFirstNode2(pair, "Style", namespaces2.kml);
+ applyStyle(
+ dataSource,
+ node,
+ styleEntity,
+ sourceResource,
+ uriResolver
+ );
+ }
+ }
+ } else {
+ oneTimeWarning_default(
+ `kml-styleMap-${key}`,
+ `KML - Unsupported StyleMap key: ${key}`
+ );
+ }
+ }
+ }
+ }
+ }
+ const promises = [];
+ const styleUrlNodes = kml.getElementsByTagName("styleUrl");
+ const styleUrlNodesLength = styleUrlNodes.length;
+ for (i = 0; i < styleUrlNodesLength; i++) {
+ const styleReference = styleUrlNodes[i].textContent;
+ if (styleReference[0] !== "#") {
+ const tokens = styleReference.split("#");
+ if (tokens.length === 2) {
+ const uri = tokens[0];
+ const resource = sourceResource.getDerivedResource({
+ url: uri
+ });
+ promises.push(
+ processExternalStyles(dataSource, resource, styleCollection)
+ );
+ }
+ }
+ }
+ return promises;
+}
+function createDropLine(entityCollection, entity, styleEntity) {
+ const entityPosition = new ReferenceProperty_default(entityCollection, entity.id, [
+ "position"
+ ]);
+ const surfacePosition = new ScaledPositionProperty_default(entity.position);
+ entity.polyline = defined_default(styleEntity.polyline) ? styleEntity.polyline.clone() : new PolylineGraphics_default();
+ entity.polyline.positions = new PositionPropertyArray_default([
+ entityPosition,
+ surfacePosition
+ ]);
+}
+function heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode) {
+ if (!defined_default(altitudeMode) && !defined_default(gxAltitudeMode) || altitudeMode === "clampToGround") {
+ return HeightReference_default.CLAMP_TO_GROUND;
+ }
+ if (altitudeMode === "relativeToGround") {
+ return HeightReference_default.RELATIVE_TO_GROUND;
+ }
+ if (altitudeMode === "absolute") {
+ return HeightReference_default.NONE;
+ }
+ if (gxAltitudeMode === "clampToSeaFloor") {
+ oneTimeWarning_default(
+ "kml-gx:altitudeMode-clampToSeaFloor",
+ "KML - :clampToSeaFloor is currently not supported, using :clampToGround."
+ );
+ return HeightReference_default.CLAMP_TO_GROUND;
+ }
+ if (gxAltitudeMode === "relativeToSeaFloor") {
+ oneTimeWarning_default(
+ "kml-gx:altitudeMode-relativeToSeaFloor",
+ "KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."
+ );
+ return HeightReference_default.RELATIVE_TO_GROUND;
+ }
+ if (defined_default(altitudeMode)) {
+ oneTimeWarning_default(
+ "kml-altitudeMode-unknown",
+ `KML - Unknown :${altitudeMode}, using :CLAMP_TO_GROUND.`
+ );
+ } else {
+ oneTimeWarning_default(
+ "kml-gx:altitudeMode-unknown",
+ `KML - Unknown :${gxAltitudeMode}, using :CLAMP_TO_GROUND.`
+ );
+ }
+ return HeightReference_default.CLAMP_TO_GROUND;
+}
+function createPositionPropertyFromAltitudeMode(property, altitudeMode, gxAltitudeMode) {
+ if (gxAltitudeMode === "relativeToSeaFloor" || altitudeMode === "absolute" || altitudeMode === "relativeToGround") {
+ return property;
+ }
+ if (defined_default(altitudeMode) && altitudeMode !== "clampToGround" || defined_default(gxAltitudeMode) && gxAltitudeMode !== "clampToSeaFloor") {
+ oneTimeWarning_default(
+ "kml-altitudeMode-unknown",
+ `KML - Unknown altitudeMode: ${defaultValue_default(
+ altitudeMode,
+ gxAltitudeMode
+ )}`
+ );
+ }
+ return new ScaledPositionProperty_default(property);
+}
+function createPositionPropertyArrayFromAltitudeMode(properties, altitudeMode, gxAltitudeMode, ellipsoid) {
+ if (!defined_default(properties)) {
+ return void 0;
+ }
+ if (gxAltitudeMode === "relativeToSeaFloor" || altitudeMode === "absolute" || altitudeMode === "relativeToGround") {
+ return properties;
+ }
+ if (defined_default(altitudeMode) && altitudeMode !== "clampToGround" || defined_default(gxAltitudeMode) && gxAltitudeMode !== "clampToSeaFloor") {
+ oneTimeWarning_default(
+ "kml-altitudeMode-unknown",
+ `KML - Unknown altitudeMode: ${defaultValue_default(
+ altitudeMode,
+ gxAltitudeMode
+ )}`
+ );
+ }
+ const propertiesLength = properties.length;
+ for (let i = 0; i < propertiesLength; i++) {
+ const property = properties[i];
+ ellipsoid.scaleToGeodeticSurface(property, property);
+ }
+ return properties;
+}
+function processPositionGraphics(dataSource, entity, styleEntity, heightReference) {
+ let label = entity.label;
+ if (!defined_default(label)) {
+ label = defined_default(styleEntity.label) ? styleEntity.label.clone() : createDefaultLabel2();
+ entity.label = label;
+ }
+ label.text = entity.name;
+ let billboard = entity.billboard;
+ if (!defined_default(billboard)) {
+ billboard = defined_default(styleEntity.billboard) ? styleEntity.billboard.clone() : createDefaultBillboard2();
+ entity.billboard = billboard;
+ }
+ if (!defined_default(billboard.image)) {
+ billboard.image = dataSource._pinBuilder.fromColor(Color_default.YELLOW, 64);
+ } else if (!billboard.image.getValue()) {
+ billboard.image = void 0;
+ }
+ let scale = 1;
+ if (defined_default(billboard.scale)) {
+ scale = billboard.scale.getValue();
+ if (scale !== 0) {
+ label.pixelOffset = new Cartesian2_default(scale * 16 + 1, 0);
+ } else {
+ label.pixelOffset = void 0;
+ label.horizontalOrigin = void 0;
+ }
+ }
+ if (defined_default(heightReference) && dataSource._clampToGround) {
+ billboard.heightReference = heightReference;
+ label.heightReference = heightReference;
+ }
+}
+function processPathGraphics(entity, styleEntity) {
+ let path = entity.path;
+ if (!defined_default(path)) {
+ path = new PathGraphics_default();
+ path.leadTime = 0;
+ entity.path = path;
+ }
+ const polyline = styleEntity.polyline;
+ if (defined_default(polyline)) {
+ path.material = polyline.material;
+ path.width = polyline.width;
+ }
+}
+function processPoint3(dataSource, entityCollection, geometryNode, entity, styleEntity) {
+ const coordinatesString = queryStringValue2(
+ geometryNode,
+ "coordinates",
+ namespaces2.kml
+ );
+ const altitudeMode = queryStringValue2(
+ geometryNode,
+ "altitudeMode",
+ namespaces2.kml
+ );
+ const gxAltitudeMode = queryStringValue2(
+ geometryNode,
+ "altitudeMode",
+ namespaces2.gx
+ );
+ const extrude = queryBooleanValue(geometryNode, "extrude", namespaces2.kml);
+ const ellipsoid = dataSource._ellipsoid;
+ const position = readCoordinate(coordinatesString, ellipsoid);
+ entity.position = position;
+ processPositionGraphics(
+ dataSource,
+ entity,
+ styleEntity,
+ heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode)
+ );
+ if (extrude && isExtrudable(altitudeMode, gxAltitudeMode)) {
+ createDropLine(entityCollection, entity, styleEntity);
+ }
+ return true;
+}
+function processLineStringOrLinearRing(dataSource, entityCollection, geometryNode, entity, styleEntity) {
+ const coordinatesNode = queryFirstNode2(
+ geometryNode,
+ "coordinates",
+ namespaces2.kml
+ );
+ const altitudeMode = queryStringValue2(
+ geometryNode,
+ "altitudeMode",
+ namespaces2.kml
+ );
+ const gxAltitudeMode = queryStringValue2(
+ geometryNode,
+ "altitudeMode",
+ namespaces2.gx
+ );
+ const extrude = queryBooleanValue(geometryNode, "extrude", namespaces2.kml);
+ const tessellate = queryBooleanValue(
+ geometryNode,
+ "tessellate",
+ namespaces2.kml
+ );
+ const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);
+ const zIndex = queryNumericValue2(geometryNode, "drawOrder", namespaces2.gx);
+ const ellipsoid = dataSource._ellipsoid;
+ const coordinates = readCoordinates(coordinatesNode, ellipsoid);
+ let polyline = styleEntity.polyline;
+ if (canExtrude && extrude) {
+ const wall = new WallGraphics_default();
+ entity.wall = wall;
+ wall.positions = coordinates;
+ const polygon = styleEntity.polygon;
+ if (defined_default(polygon)) {
+ wall.fill = polygon.fill;
+ wall.material = polygon.material;
+ }
+ wall.outline = true;
+ if (defined_default(polyline)) {
+ wall.outlineColor = defined_default(polyline.material) ? polyline.material.color : Color_default.WHITE;
+ wall.outlineWidth = polyline.width;
+ } else if (defined_default(polygon)) {
+ wall.outlineColor = defined_default(polygon.material) ? polygon.material.color : Color_default.WHITE;
+ }
+ } else if (dataSource._clampToGround && !canExtrude && tessellate) {
+ const polylineGraphics = new PolylineGraphics_default();
+ polylineGraphics.clampToGround = true;
+ entity.polyline = polylineGraphics;
+ polylineGraphics.positions = coordinates;
+ if (defined_default(polyline)) {
+ polylineGraphics.material = defined_default(polyline.material) ? polyline.material.color.getValue(Iso8601_default.MINIMUM_VALUE) : Color_default.WHITE;
+ polylineGraphics.width = defaultValue_default(polyline.width, 1);
+ } else {
+ polylineGraphics.material = Color_default.WHITE;
+ polylineGraphics.width = 1;
+ }
+ polylineGraphics.zIndex = zIndex;
+ } else {
+ if (defined_default(zIndex)) {
+ oneTimeWarning_default(
+ "kml-gx:drawOrder",
+ "KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"
+ );
+ }
+ if (dataSource._clampToGround && !tessellate) {
+ oneTimeWarning_default(
+ "kml-line-tesselate",
+ "Ignoring clampToGround for KML lines without the tessellate flag."
+ );
+ }
+ polyline = defined_default(polyline) ? polyline.clone() : new PolylineGraphics_default();
+ entity.polyline = polyline;
+ polyline.positions = createPositionPropertyArrayFromAltitudeMode(
+ coordinates,
+ altitudeMode,
+ gxAltitudeMode,
+ ellipsoid
+ );
+ if (!tessellate || canExtrude) {
+ polyline.arcType = ArcType_default.NONE;
+ }
+ }
+ return true;
+}
+function processPolygon3(dataSource, entityCollection, geometryNode, entity, styleEntity) {
+ const outerBoundaryIsNode = queryFirstNode2(
+ geometryNode,
+ "outerBoundaryIs",
+ namespaces2.kml
+ );
+ let linearRingNode = queryFirstNode2(
+ outerBoundaryIsNode,
+ "LinearRing",
+ namespaces2.kml
+ );
+ let coordinatesNode = queryFirstNode2(
+ linearRingNode,
+ "coordinates",
+ namespaces2.kml
+ );
+ const ellipsoid = dataSource._ellipsoid;
+ let coordinates = readCoordinates(coordinatesNode, ellipsoid);
+ const extrude = queryBooleanValue(geometryNode, "extrude", namespaces2.kml);
+ const altitudeMode = queryStringValue2(
+ geometryNode,
+ "altitudeMode",
+ namespaces2.kml
+ );
+ const gxAltitudeMode = queryStringValue2(
+ geometryNode,
+ "altitudeMode",
+ namespaces2.gx
+ );
+ const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);
+ const polygon = defined_default(styleEntity.polygon) ? styleEntity.polygon.clone() : createDefaultPolygon();
+ const polyline = styleEntity.polyline;
+ if (defined_default(polyline)) {
+ polygon.outlineColor = defined_default(polyline.material) ? polyline.material.color : Color_default.WHITE;
+ polygon.outlineWidth = polyline.width;
+ }
+ entity.polygon = polygon;
+ if (canExtrude) {
+ polygon.perPositionHeight = true;
+ polygon.extrudedHeight = extrude ? 0 : void 0;
+ } else if (!dataSource._clampToGround) {
+ polygon.height = 0;
+ }
+ if (defined_default(coordinates)) {
+ const hierarchy = new PolygonHierarchy_default(coordinates);
+ const innerBoundaryIsNodes = queryChildNodes(
+ geometryNode,
+ "innerBoundaryIs",
+ namespaces2.kml
+ );
+ for (let j = 0; j < innerBoundaryIsNodes.length; j++) {
+ linearRingNode = queryChildNodes(
+ innerBoundaryIsNodes[j],
+ "LinearRing",
+ namespaces2.kml
+ );
+ for (let k = 0; k < linearRingNode.length; k++) {
+ coordinatesNode = queryFirstNode2(
+ linearRingNode[k],
+ "coordinates",
+ namespaces2.kml
+ );
+ coordinates = readCoordinates(coordinatesNode, ellipsoid);
+ if (defined_default(coordinates)) {
+ hierarchy.holes.push(new PolygonHierarchy_default(coordinates));
+ }
+ }
+ }
+ polygon.hierarchy = hierarchy;
+ }
+ return true;
+}
+function processTrack(dataSource, entityCollection, geometryNode, entity, styleEntity) {
+ const altitudeMode = queryStringValue2(
+ geometryNode,
+ "altitudeMode",
+ namespaces2.kml
+ );
+ const gxAltitudeMode = queryStringValue2(
+ geometryNode,
+ "altitudeMode",
+ namespaces2.gx
+ );
+ const coordNodes = queryChildNodes(geometryNode, "coord", namespaces2.gx);
+ const angleNodes = queryChildNodes(geometryNode, "angles", namespaces2.gx);
+ const timeNodes = queryChildNodes(geometryNode, "when", namespaces2.kml);
+ const extrude = queryBooleanValue(geometryNode, "extrude", namespaces2.kml);
+ const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);
+ const ellipsoid = dataSource._ellipsoid;
+ if (angleNodes.length > 0) {
+ oneTimeWarning_default(
+ "kml-gx:angles",
+ "KML - gx:angles are not supported in gx:Tracks"
+ );
+ }
+ const length3 = Math.min(coordNodes.length, timeNodes.length);
+ const coordinates = [];
+ const times = [];
+ for (let i = 0; i < length3; i++) {
+ const position = readCoordinate(coordNodes[i].textContent, ellipsoid);
+ coordinates.push(position);
+ times.push(JulianDate_default.fromIso8601(timeNodes[i].textContent));
+ }
+ const property = new SampledPositionProperty_default();
+ property.addSamples(times, coordinates);
+ entity.position = property;
+ processPositionGraphics(
+ dataSource,
+ entity,
+ styleEntity,
+ heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode)
+ );
+ processPathGraphics(entity, styleEntity);
+ entity.availability = new TimeIntervalCollection_default();
+ if (timeNodes.length > 0) {
+ entity.availability.addInterval(
+ new TimeInterval_default({
+ start: times[0],
+ stop: times[times.length - 1]
+ })
+ );
+ }
+ if (canExtrude && extrude) {
+ createDropLine(entityCollection, entity, styleEntity);
+ }
+ return true;
+}
+function addToMultiTrack(times, positions, composite, availability, dropShowProperty, extrude, altitudeMode, gxAltitudeMode, includeEndPoints) {
+ const start = times[0];
+ const stop2 = times[times.length - 1];
+ const data = new SampledPositionProperty_default();
+ data.addSamples(times, positions);
+ composite.intervals.addInterval(
+ new TimeInterval_default({
+ start,
+ stop: stop2,
+ isStartIncluded: includeEndPoints,
+ isStopIncluded: includeEndPoints,
+ data: createPositionPropertyFromAltitudeMode(
+ data,
+ altitudeMode,
+ gxAltitudeMode
+ )
+ })
+ );
+ availability.addInterval(
+ new TimeInterval_default({
+ start,
+ stop: stop2,
+ isStartIncluded: includeEndPoints,
+ isStopIncluded: includeEndPoints
+ })
+ );
+ dropShowProperty.intervals.addInterval(
+ new TimeInterval_default({
+ start,
+ stop: stop2,
+ isStartIncluded: includeEndPoints,
+ isStopIncluded: includeEndPoints,
+ data: extrude
+ })
+ );
+}
+function processMultiTrack(dataSource, entityCollection, geometryNode, entity, styleEntity) {
+ const interpolate2 = queryBooleanValue(
+ geometryNode,
+ "interpolate",
+ namespaces2.gx
+ );
+ const trackNodes = queryChildNodes(geometryNode, "Track", namespaces2.gx);
+ let times;
+ let lastStop;
+ let lastStopPosition;
+ let needDropLine = false;
+ const dropShowProperty = new TimeIntervalCollectionProperty_default();
+ const availability = new TimeIntervalCollection_default();
+ const composite = new CompositePositionProperty_default();
+ const ellipsoid = dataSource._ellipsoid;
+ for (let i = 0, len = trackNodes.length; i < len; i++) {
+ const trackNode = trackNodes[i];
+ const timeNodes = queryChildNodes(trackNode, "when", namespaces2.kml);
+ const coordNodes = queryChildNodes(trackNode, "coord", namespaces2.gx);
+ const altitudeMode = queryStringValue2(
+ trackNode,
+ "altitudeMode",
+ namespaces2.kml
+ );
+ const gxAltitudeMode = queryStringValue2(
+ trackNode,
+ "altitudeMode",
+ namespaces2.gx
+ );
+ const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);
+ const extrude = queryBooleanValue(trackNode, "extrude", namespaces2.kml);
+ const length3 = Math.min(coordNodes.length, timeNodes.length);
+ const positions = [];
+ times = [];
+ for (let x = 0; x < length3; x++) {
+ const position = readCoordinate(coordNodes[x].textContent, ellipsoid);
+ positions.push(position);
+ times.push(JulianDate_default.fromIso8601(timeNodes[x].textContent));
+ }
+ if (interpolate2) {
+ if (defined_default(lastStop)) {
+ addToMultiTrack(
+ [lastStop, times[0]],
+ [lastStopPosition, positions[0]],
+ composite,
+ availability,
+ dropShowProperty,
+ false,
+ "absolute",
+ void 0,
+ false
+ );
+ }
+ lastStop = times[length3 - 1];
+ lastStopPosition = positions[positions.length - 1];
+ }
+ addToMultiTrack(
+ times,
+ positions,
+ composite,
+ availability,
+ dropShowProperty,
+ canExtrude && extrude,
+ altitudeMode,
+ gxAltitudeMode,
+ true
+ );
+ needDropLine = needDropLine || canExtrude && extrude;
+ }
+ entity.availability = availability;
+ entity.position = composite;
+ processPositionGraphics(dataSource, entity, styleEntity);
+ processPathGraphics(entity, styleEntity);
+ if (needDropLine) {
+ createDropLine(entityCollection, entity, styleEntity);
+ entity.polyline.show = dropShowProperty;
+ }
+ return true;
+}
+var geometryTypes3 = {
+ Point: processPoint3,
+ LineString: processLineStringOrLinearRing,
+ LinearRing: processLineStringOrLinearRing,
+ Polygon: processPolygon3,
+ Track: processTrack,
+ MultiTrack: processMultiTrack,
+ MultiGeometry: processMultiGeometry,
+ Model: processUnsupportedGeometry
+};
+function processMultiGeometry(dataSource, entityCollection, geometryNode, entity, styleEntity, context) {
+ const childNodes = geometryNode.childNodes;
+ let hasGeometry = false;
+ for (let i = 0, len = childNodes.length; i < len; i++) {
+ const childNode = childNodes.item(i);
+ const geometryProcessor = geometryTypes3[childNode.localName];
+ if (defined_default(geometryProcessor)) {
+ const childEntity = createEntity(childNode, entityCollection, context);
+ childEntity.parent = entity;
+ childEntity.name = entity.name;
+ childEntity.availability = entity.availability;
+ childEntity.description = entity.description;
+ childEntity.kml = entity.kml;
+ if (geometryProcessor(
+ dataSource,
+ entityCollection,
+ childNode,
+ childEntity,
+ styleEntity
+ )) {
+ hasGeometry = true;
+ }
+ }
+ }
+ return hasGeometry;
+}
+function processUnsupportedGeometry(dataSource, entityCollection, geometryNode, entity, styleEntity) {
+ oneTimeWarning_default(
+ "kml-unsupportedGeometry",
+ `KML - Unsupported geometry: ${geometryNode.localName}`
+ );
+ return false;
+}
+function processExtendedData(node, entity) {
+ const extendedDataNode = queryFirstNode2(node, "ExtendedData", namespaces2.kml);
+ if (!defined_default(extendedDataNode)) {
+ return void 0;
+ }
+ if (defined_default(queryFirstNode2(extendedDataNode, "SchemaData", namespaces2.kml))) {
+ oneTimeWarning_default("kml-schemaData", "KML - SchemaData is unsupported");
+ }
+ if (defined_default(queryStringAttribute2(extendedDataNode, "xmlns:prefix"))) {
+ oneTimeWarning_default(
+ "kml-extendedData",
+ "KML - ExtendedData with xmlns:prefix is unsupported"
+ );
+ }
+ const result = {};
+ const dataNodes = queryChildNodes(extendedDataNode, "Data", namespaces2.kml);
+ if (defined_default(dataNodes)) {
+ const length3 = dataNodes.length;
+ for (let i = 0; i < length3; i++) {
+ const dataNode = dataNodes[i];
+ const name = queryStringAttribute2(dataNode, "name");
+ if (defined_default(name)) {
+ result[name] = {
+ displayName: queryStringValue2(
+ dataNode,
+ "displayName",
+ namespaces2.kml
+ ),
+ value: queryStringValue2(dataNode, "value", namespaces2.kml)
+ };
+ }
+ }
+ }
+ entity.kml.extendedData = result;
+}
+var scratchDiv2;
+if (typeof document !== "undefined") {
+ scratchDiv2 = document.createElement("div");
+}
+function processDescription3(node, entity, styleEntity, uriResolver, sourceResource) {
+ let i;
+ let key;
+ let keys;
+ const kmlData = entity.kml;
+ const extendedData = kmlData.extendedData;
+ const description = queryStringValue2(node, "description", namespaces2.kml);
+ const balloonStyle = defaultValue_default(
+ entity.balloonStyle,
+ styleEntity.balloonStyle
+ );
+ let background = Color_default.WHITE;
+ let foreground = Color_default.BLACK;
+ let text = description;
+ if (defined_default(balloonStyle)) {
+ background = defaultValue_default(balloonStyle.bgColor, Color_default.WHITE);
+ foreground = defaultValue_default(balloonStyle.textColor, Color_default.BLACK);
+ text = defaultValue_default(balloonStyle.text, description);
+ }
+ let value;
+ if (defined_default(text)) {
+ text = text.replace("$[name]", defaultValue_default(entity.name, ""));
+ text = text.replace("$[description]", defaultValue_default(description, ""));
+ text = text.replace("$[address]", defaultValue_default(kmlData.address, ""));
+ text = text.replace("$[Snippet]", defaultValue_default(kmlData.snippet, ""));
+ text = text.replace("$[id]", entity.id);
+ text = text.replace("$[geDirections]", "");
+ if (defined_default(extendedData)) {
+ const matches = text.match(/\$\[.+?\]/g);
+ if (matches !== null) {
+ for (i = 0; i < matches.length; i++) {
+ const token = matches[i];
+ let propertyName = token.substr(2, token.length - 3);
+ const isDisplayName = /\/displayName$/.test(propertyName);
+ propertyName = propertyName.replace(/\/displayName$/, "");
+ value = extendedData[propertyName];
+ if (defined_default(value)) {
+ value = isDisplayName ? value.displayName : value.value;
+ }
+ if (defined_default(value)) {
+ text = text.replace(token, defaultValue_default(value, ""));
+ }
+ }
+ }
+ }
+ } else if (defined_default(extendedData)) {
+ keys = Object.keys(extendedData);
+ if (keys.length > 0) {
+ text = '';
+ for (i = 0; i < keys.length; i++) {
+ key = keys[i];
+ value = extendedData[key];
+ text += `${defaultValue_default(
+ value.displayName,
+ key
+ )} ${defaultValue_default(value.value, "")} `;
+ }
+ text += "
";
+ }
+ }
+ if (!defined_default(text)) {
+ return;
+ }
+ text = autolinker2.link(text);
+ scratchDiv2.innerHTML = text;
+ const links = scratchDiv2.querySelectorAll("a");
+ for (i = 0; i < links.length; i++) {
+ links[i].setAttribute("target", "_blank");
+ }
+ if (defined_default(uriResolver) && uriResolver.keys.length > 1) {
+ embedDataUris(scratchDiv2, "a", "href", uriResolver);
+ embedDataUris(scratchDiv2, "link", "href", uriResolver);
+ embedDataUris(scratchDiv2, "area", "href", uriResolver);
+ embedDataUris(scratchDiv2, "img", "src", uriResolver);
+ embedDataUris(scratchDiv2, "iframe", "src", uriResolver);
+ embedDataUris(scratchDiv2, "video", "src", uriResolver);
+ embedDataUris(scratchDiv2, "audio", "src", uriResolver);
+ embedDataUris(scratchDiv2, "source", "src", uriResolver);
+ embedDataUris(scratchDiv2, "track", "src", uriResolver);
+ embedDataUris(scratchDiv2, "input", "src", uriResolver);
+ embedDataUris(scratchDiv2, "embed", "src", uriResolver);
+ embedDataUris(scratchDiv2, "script", "src", uriResolver);
+ embedDataUris(scratchDiv2, "video", "poster", uriResolver);
+ }
+ applyBasePath(scratchDiv2, "a", "href", sourceResource);
+ applyBasePath(scratchDiv2, "link", "href", sourceResource);
+ applyBasePath(scratchDiv2, "area", "href", sourceResource);
+ applyBasePath(scratchDiv2, "img", "src", sourceResource);
+ applyBasePath(scratchDiv2, "iframe", "src", sourceResource);
+ applyBasePath(scratchDiv2, "video", "src", sourceResource);
+ applyBasePath(scratchDiv2, "audio", "src", sourceResource);
+ applyBasePath(scratchDiv2, "source", "src", sourceResource);
+ applyBasePath(scratchDiv2, "track", "src", sourceResource);
+ applyBasePath(scratchDiv2, "input", "src", sourceResource);
+ applyBasePath(scratchDiv2, "embed", "src", sourceResource);
+ applyBasePath(scratchDiv2, "script", "src", sourceResource);
+ applyBasePath(scratchDiv2, "video", "poster", sourceResource);
+ let tmp2 = '';
+ tmp2 += `${scratchDiv2.innerHTML}`;
+ scratchDiv2.innerHTML = "";
+ entity.description = tmp2;
+}
+function processFeature2(dataSource, featureNode, processingData) {
+ const entityCollection = processingData.entityCollection;
+ const parent = processingData.parentEntity;
+ const sourceResource = processingData.sourceResource;
+ const uriResolver = processingData.uriResolver;
+ const entity = createEntity(
+ featureNode,
+ entityCollection,
+ processingData.context
+ );
+ const kmlData = entity.kml;
+ const styleEntity = computeFinalStyle(
+ dataSource,
+ featureNode,
+ processingData.styleCollection,
+ sourceResource,
+ uriResolver
+ );
+ const name = queryStringValue2(featureNode, "name", namespaces2.kml);
+ entity.name = name;
+ entity.parent = parent;
+ let availability = processTimeSpan(featureNode);
+ if (!defined_default(availability)) {
+ availability = processTimeStamp(featureNode);
+ }
+ entity.availability = availability;
+ mergeAvailabilityWithParent(entity);
+ function ancestryIsVisible(parentEntity) {
+ if (!parentEntity) {
+ return true;
+ }
+ return parentEntity.show && ancestryIsVisible(parentEntity.parent);
+ }
+ const visibility = queryBooleanValue(
+ featureNode,
+ "visibility",
+ namespaces2.kml
+ );
+ entity.show = ancestryIsVisible(parent) && defaultValue_default(visibility, true);
+ const authorNode = queryFirstNode2(featureNode, "author", namespaces2.atom);
+ const author = kmlData.author;
+ author.name = queryStringValue2(authorNode, "name", namespaces2.atom);
+ author.uri = queryStringValue2(authorNode, "uri", namespaces2.atom);
+ author.email = queryStringValue2(authorNode, "email", namespaces2.atom);
+ const linkNode = queryFirstNode2(featureNode, "link", namespaces2.atom);
+ const link = kmlData.link;
+ link.href = queryStringAttribute2(linkNode, "href");
+ link.hreflang = queryStringAttribute2(linkNode, "hreflang");
+ link.rel = queryStringAttribute2(linkNode, "rel");
+ link.type = queryStringAttribute2(linkNode, "type");
+ link.title = queryStringAttribute2(linkNode, "title");
+ link.length = queryStringAttribute2(linkNode, "length");
+ kmlData.address = queryStringValue2(featureNode, "address", namespaces2.kml);
+ kmlData.phoneNumber = queryStringValue2(
+ featureNode,
+ "phoneNumber",
+ namespaces2.kml
+ );
+ kmlData.snippet = queryStringValue2(featureNode, "Snippet", namespaces2.kml);
+ processExtendedData(featureNode, entity);
+ processDescription3(
+ featureNode,
+ entity,
+ styleEntity,
+ uriResolver,
+ sourceResource
+ );
+ const ellipsoid = dataSource._ellipsoid;
+ processLookAt(featureNode, entity, ellipsoid);
+ processCamera(featureNode, entity, ellipsoid);
+ if (defined_default(queryFirstNode2(featureNode, "Region", namespaces2.kml))) {
+ oneTimeWarning_default("kml-region", "KML - Placemark Regions are unsupported");
+ }
+ return {
+ entity,
+ styleEntity
+ };
+}
+function processDocument2(dataSource, node, processingData, deferredLoading) {
+ deferredLoading.addNodes(node.childNodes, processingData);
+ deferredLoading.process();
+}
+function processFolder(dataSource, node, processingData, deferredLoading) {
+ const r = processFeature2(dataSource, node, processingData);
+ const newProcessingData = clone_default(processingData);
+ newProcessingData.parentEntity = r.entity;
+ processDocument2(dataSource, node, newProcessingData, deferredLoading);
+}
+function processPlacemark(dataSource, placemark, processingData, deferredLoading) {
+ const r = processFeature2(dataSource, placemark, processingData);
+ const entity = r.entity;
+ const styleEntity = r.styleEntity;
+ let hasGeometry = false;
+ const childNodes = placemark.childNodes;
+ for (let i = 0, len = childNodes.length; i < len && !hasGeometry; i++) {
+ const childNode = childNodes.item(i);
+ const geometryProcessor = geometryTypes3[childNode.localName];
+ if (defined_default(geometryProcessor)) {
+ geometryProcessor(
+ dataSource,
+ processingData.entityCollection,
+ childNode,
+ entity,
+ styleEntity,
+ entity.id
+ );
+ hasGeometry = true;
+ }
+ }
+ if (!hasGeometry) {
+ entity.merge(styleEntity);
+ processPositionGraphics(dataSource, entity, styleEntity);
+ }
+}
+var playlistNodeProcessors = {
+ FlyTo: processTourFlyTo,
+ Wait: processTourWait,
+ SoundCue: processTourUnsupportedNode,
+ AnimatedUpdate: processTourUnsupportedNode,
+ TourControl: processTourUnsupportedNode
+};
+function processTour(dataSource, node, processingData, deferredLoading) {
+ const name = queryStringValue2(node, "name", namespaces2.kml);
+ const id = queryStringAttribute2(node, "id");
+ const tour = new KmlTour_default(name, id);
+ const playlistNode = queryFirstNode2(node, "Playlist", namespaces2.gx);
+ if (playlistNode) {
+ const ellipsoid = dataSource._ellipsoid;
+ const childNodes = playlistNode.childNodes;
+ for (let i = 0; i < childNodes.length; i++) {
+ const entryNode = childNodes[i];
+ if (entryNode.localName) {
+ const playlistNodeProcessor = playlistNodeProcessors[entryNode.localName];
+ if (playlistNodeProcessor) {
+ playlistNodeProcessor(tour, entryNode, ellipsoid);
+ } else {
+ console.log(
+ `Unknown KML Tour playlist entry type ${entryNode.localName}`
+ );
+ }
+ }
+ }
+ }
+ dataSource._kmlTours.push(tour);
+}
+function processTourUnsupportedNode(tour, entryNode) {
+ oneTimeWarning_default(`KML Tour unsupported node ${entryNode.localName}`);
+}
+function processTourWait(tour, entryNode) {
+ const duration = queryNumericValue2(entryNode, "duration", namespaces2.gx);
+ tour.addPlaylistEntry(new KmlTourWait_default(duration));
+}
+function processTourFlyTo(tour, entryNode, ellipsoid) {
+ const duration = queryNumericValue2(entryNode, "duration", namespaces2.gx);
+ const flyToMode = queryStringValue2(entryNode, "flyToMode", namespaces2.gx);
+ const t = { kml: {} };
+ processLookAt(entryNode, t, ellipsoid);
+ processCamera(entryNode, t, ellipsoid);
+ const view = t.kml.lookAt || t.kml.camera;
+ const flyto = new KmlTourFlyTo_default(duration, flyToMode, view);
+ tour.addPlaylistEntry(flyto);
+}
+function processCamera(featureNode, entity, ellipsoid) {
+ const camera = queryFirstNode2(featureNode, "Camera", namespaces2.kml);
+ if (defined_default(camera)) {
+ const lon = defaultValue_default(
+ queryNumericValue2(camera, "longitude", namespaces2.kml),
+ 0
+ );
+ const lat = defaultValue_default(
+ queryNumericValue2(camera, "latitude", namespaces2.kml),
+ 0
+ );
+ const altitude = defaultValue_default(
+ queryNumericValue2(camera, "altitude", namespaces2.kml),
+ 0
+ );
+ const heading = defaultValue_default(
+ queryNumericValue2(camera, "heading", namespaces2.kml),
+ 0
+ );
+ const tilt = defaultValue_default(
+ queryNumericValue2(camera, "tilt", namespaces2.kml),
+ 0
+ );
+ const roll = defaultValue_default(
+ queryNumericValue2(camera, "roll", namespaces2.kml),
+ 0
+ );
+ const position = Cartesian3_default.fromDegrees(lon, lat, altitude, ellipsoid);
+ const hpr = HeadingPitchRoll_default.fromDegrees(heading, tilt - 90, roll);
+ entity.kml.camera = new KmlCamera_default(position, hpr);
+ }
+}
+function processLookAt(featureNode, entity, ellipsoid) {
+ const lookAt = queryFirstNode2(featureNode, "LookAt", namespaces2.kml);
+ if (defined_default(lookAt)) {
+ const lon = defaultValue_default(
+ queryNumericValue2(lookAt, "longitude", namespaces2.kml),
+ 0
+ );
+ const lat = defaultValue_default(
+ queryNumericValue2(lookAt, "latitude", namespaces2.kml),
+ 0
+ );
+ const altitude = defaultValue_default(
+ queryNumericValue2(lookAt, "altitude", namespaces2.kml),
+ 0
+ );
+ let heading = queryNumericValue2(lookAt, "heading", namespaces2.kml);
+ let tilt = queryNumericValue2(lookAt, "tilt", namespaces2.kml);
+ const range2 = defaultValue_default(
+ queryNumericValue2(lookAt, "range", namespaces2.kml),
+ 0
+ );
+ tilt = Math_default.toRadians(defaultValue_default(tilt, 0));
+ heading = Math_default.toRadians(defaultValue_default(heading, 0));
+ const hpr = new HeadingPitchRange_default(
+ heading,
+ tilt - Math_default.PI_OVER_TWO,
+ range2
+ );
+ const viewPoint = Cartesian3_default.fromDegrees(lon, lat, altitude, ellipsoid);
+ entity.kml.lookAt = new KmlLookAt_default(viewPoint, hpr);
+ }
+}
+function processScreenOverlay(dataSource, screenOverlayNode, processingData, deferredLoading) {
+ const screenOverlay = processingData.screenOverlayContainer;
+ if (!defined_default(screenOverlay)) {
+ return void 0;
+ }
+ const sourceResource = processingData.sourceResource;
+ const uriResolver = processingData.uriResolver;
+ const iconNode = queryFirstNode2(screenOverlayNode, "Icon", namespaces2.kml);
+ const icon = getIconHref(
+ iconNode,
+ dataSource,
+ sourceResource,
+ uriResolver,
+ false
+ );
+ if (!defined_default(icon)) {
+ return void 0;
+ }
+ const img = document.createElement("img");
+ dataSource._screenOverlays.push(img);
+ img.src = icon.url;
+ img.onload = function() {
+ const styles = ["position: absolute"];
+ const screenXY = queryFirstNode2(
+ screenOverlayNode,
+ "screenXY",
+ namespaces2.kml
+ );
+ const overlayXY = queryFirstNode2(
+ screenOverlayNode,
+ "overlayXY",
+ namespaces2.kml
+ );
+ const size = queryFirstNode2(screenOverlayNode, "size", namespaces2.kml);
+ let x, y;
+ let xUnit, yUnit;
+ let xStyle, yStyle;
+ if (defined_default(size)) {
+ x = queryNumericAttribute2(size, "x");
+ y = queryNumericAttribute2(size, "y");
+ xUnit = queryStringAttribute2(size, "xunits");
+ yUnit = queryStringAttribute2(size, "yunits");
+ if (defined_default(x) && x !== -1 && x !== 0) {
+ if (xUnit === "fraction") {
+ xStyle = `width: ${Math.floor(x * 100)}%`;
+ } else if (xUnit === "pixels") {
+ xStyle = `width: ${x}px`;
+ }
+ styles.push(xStyle);
+ }
+ if (defined_default(y) && y !== -1 && y !== 0) {
+ if (yUnit === "fraction") {
+ yStyle = `height: ${Math.floor(y * 100)}%`;
+ } else if (yUnit === "pixels") {
+ yStyle = `height: ${y}px`;
+ }
+ styles.push(yStyle);
+ }
+ }
+ img.style = styles.join(";");
+ let xOrigin = 0;
+ let yOrigin = img.height;
+ if (defined_default(overlayXY)) {
+ x = queryNumericAttribute2(overlayXY, "x");
+ y = queryNumericAttribute2(overlayXY, "y");
+ xUnit = queryStringAttribute2(overlayXY, "xunits");
+ yUnit = queryStringAttribute2(overlayXY, "yunits");
+ if (defined_default(x)) {
+ if (xUnit === "fraction") {
+ xOrigin = x * img.width;
+ } else if (xUnit === "pixels") {
+ xOrigin = x;
+ } else if (xUnit === "insetPixels") {
+ xOrigin = x;
+ }
+ }
+ if (defined_default(y)) {
+ if (yUnit === "fraction") {
+ yOrigin = y * img.height;
+ } else if (yUnit === "pixels") {
+ yOrigin = y;
+ } else if (yUnit === "insetPixels") {
+ yOrigin = y;
+ }
+ }
+ }
+ if (defined_default(screenXY)) {
+ x = queryNumericAttribute2(screenXY, "x");
+ y = queryNumericAttribute2(screenXY, "y");
+ xUnit = queryStringAttribute2(screenXY, "xunits");
+ yUnit = queryStringAttribute2(screenXY, "yunits");
+ if (defined_default(x)) {
+ if (xUnit === "fraction") {
+ xStyle = `${"left: calc("}${Math.floor(
+ x * 100
+ )}% - ${xOrigin}px)`;
+ } else if (xUnit === "pixels") {
+ xStyle = `left: ${x - xOrigin}px`;
+ } else if (xUnit === "insetPixels") {
+ xStyle = `right: ${x - xOrigin}px`;
+ }
+ styles.push(xStyle);
+ }
+ if (defined_default(y)) {
+ if (yUnit === "fraction") {
+ yStyle = `${"bottom: calc("}${Math.floor(
+ y * 100
+ )}% - ${yOrigin}px)`;
+ } else if (yUnit === "pixels") {
+ yStyle = `bottom: ${y - yOrigin}px`;
+ } else if (yUnit === "insetPixels") {
+ yStyle = `top: ${y - yOrigin}px`;
+ }
+ styles.push(yStyle);
+ }
+ }
+ img.style = styles.join(";");
+ };
+ screenOverlay.appendChild(img);
+}
+function processGroundOverlay(dataSource, groundOverlay, processingData, deferredLoading) {
+ const r = processFeature2(dataSource, groundOverlay, processingData);
+ const entity = r.entity;
+ let geometry;
+ let isLatLonQuad = false;
+ const ellipsoid = dataSource._ellipsoid;
+ const positions = readCoordinates(
+ queryFirstNode2(groundOverlay, "LatLonQuad", namespaces2.gx),
+ ellipsoid
+ );
+ const zIndex = queryNumericValue2(groundOverlay, "drawOrder", namespaces2.kml);
+ if (defined_default(positions)) {
+ geometry = createDefaultPolygon();
+ geometry.hierarchy = new PolygonHierarchy_default(positions);
+ geometry.zIndex = zIndex;
+ entity.polygon = geometry;
+ isLatLonQuad = true;
+ } else {
+ geometry = new RectangleGraphics_default();
+ geometry.zIndex = zIndex;
+ entity.rectangle = geometry;
+ const latLonBox = queryFirstNode2(
+ groundOverlay,
+ "LatLonBox",
+ namespaces2.kml
+ );
+ if (defined_default(latLonBox)) {
+ let west = queryNumericValue2(latLonBox, "west", namespaces2.kml);
+ let south = queryNumericValue2(latLonBox, "south", namespaces2.kml);
+ let east = queryNumericValue2(latLonBox, "east", namespaces2.kml);
+ let north = queryNumericValue2(latLonBox, "north", namespaces2.kml);
+ if (defined_default(west)) {
+ west = Math_default.negativePiToPi(Math_default.toRadians(west));
+ }
+ if (defined_default(south)) {
+ south = Math_default.clampToLatitudeRange(Math_default.toRadians(south));
+ }
+ if (defined_default(east)) {
+ east = Math_default.negativePiToPi(Math_default.toRadians(east));
+ }
+ if (defined_default(north)) {
+ north = Math_default.clampToLatitudeRange(Math_default.toRadians(north));
+ }
+ geometry.coordinates = new Rectangle_default(west, south, east, north);
+ const rotation = queryNumericValue2(latLonBox, "rotation", namespaces2.kml);
+ if (defined_default(rotation)) {
+ const rotationRadians = Math_default.toRadians(rotation);
+ geometry.rotation = rotationRadians;
+ geometry.stRotation = rotationRadians;
+ }
+ }
+ }
+ const iconNode = queryFirstNode2(groundOverlay, "Icon", namespaces2.kml);
+ const href = getIconHref(
+ iconNode,
+ dataSource,
+ processingData.sourceResource,
+ processingData.uriResolver,
+ true
+ );
+ if (defined_default(href)) {
+ if (isLatLonQuad) {
+ oneTimeWarning_default(
+ "kml-gx:LatLonQuad",
+ "KML - gx:LatLonQuad Icon does not support texture projection."
+ );
+ }
+ const x = queryNumericValue2(iconNode, "x", namespaces2.gx);
+ const y = queryNumericValue2(iconNode, "y", namespaces2.gx);
+ const w = queryNumericValue2(iconNode, "w", namespaces2.gx);
+ const h = queryNumericValue2(iconNode, "h", namespaces2.gx);
+ if (defined_default(x) || defined_default(y) || defined_default(w) || defined_default(h)) {
+ oneTimeWarning_default(
+ "kml-groundOverlay-xywh",
+ "KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"
+ );
+ }
+ geometry.material = href;
+ geometry.material.color = queryColorValue(
+ groundOverlay,
+ "color",
+ namespaces2.kml
+ );
+ geometry.material.transparent = true;
+ } else {
+ geometry.material = queryColorValue(groundOverlay, "color", namespaces2.kml);
+ }
+ let altitudeMode = queryStringValue2(
+ groundOverlay,
+ "altitudeMode",
+ namespaces2.kml
+ );
+ if (defined_default(altitudeMode)) {
+ if (altitudeMode === "absolute") {
+ geometry.height = queryNumericValue2(
+ groundOverlay,
+ "altitude",
+ namespaces2.kml
+ );
+ geometry.zIndex = void 0;
+ } else if (altitudeMode !== "clampToGround") {
+ oneTimeWarning_default(
+ "kml-altitudeMode-unknown",
+ `KML - Unknown altitudeMode: ${altitudeMode}`
+ );
+ }
+ } else {
+ altitudeMode = queryStringValue2(
+ groundOverlay,
+ "altitudeMode",
+ namespaces2.gx
+ );
+ if (altitudeMode === "relativeToSeaFloor") {
+ oneTimeWarning_default(
+ "kml-altitudeMode-relativeToSeaFloor",
+ "KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."
+ );
+ geometry.height = queryNumericValue2(
+ groundOverlay,
+ "altitude",
+ namespaces2.kml
+ );
+ geometry.zIndex = void 0;
+ } else if (altitudeMode === "clampToSeaFloor") {
+ oneTimeWarning_default(
+ "kml-altitudeMode-clampToSeaFloor",
+ "KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."
+ );
+ } else if (defined_default(altitudeMode)) {
+ oneTimeWarning_default(
+ "kml-altitudeMode-unknown",
+ `KML - Unknown altitudeMode: ${altitudeMode}`
+ );
+ }
+ }
+}
+function processUnsupportedFeature(dataSource, node, processingData, deferredLoading) {
+ dataSource._unsupportedNode.raiseEvent(
+ dataSource,
+ processingData.parentEntity,
+ node,
+ processingData.entityCollection,
+ processingData.styleCollection,
+ processingData.sourceResource,
+ processingData.uriResolver
+ );
+ oneTimeWarning_default(
+ `kml-unsupportedFeature-${node.nodeName}`,
+ `KML - Unsupported feature: ${node.nodeName}`
+ );
+}
+var RefreshMode = {
+ INTERVAL: 0,
+ EXPIRE: 1,
+ STOP: 2
+};
+function cleanupString(s) {
+ if (!defined_default(s) || s.length === 0) {
+ return "";
+ }
+ const sFirst = s[0];
+ if (sFirst === "&" || sFirst === "?") {
+ s = s.substring(1);
+ }
+ return s;
+}
+var zeroRectangle = new Rectangle_default();
+var scratchCartographic15 = new Cartographic_default();
+var scratchCartesian210 = new Cartesian2_default();
+var scratchCartesian311 = new Cartesian3_default();
+function processNetworkLinkQueryString(resource, camera, canvas, viewBoundScale, bbox, ellipsoid) {
+ function fixLatitude(value) {
+ if (value < -Math_default.PI_OVER_TWO) {
+ return -Math_default.PI_OVER_TWO;
+ } else if (value > Math_default.PI_OVER_TWO) {
+ return Math_default.PI_OVER_TWO;
+ }
+ return value;
+ }
+ function fixLongitude(value) {
+ if (value > Math_default.PI) {
+ return value - Math_default.TWO_PI;
+ } else if (value < -Math_default.PI) {
+ return value + Math_default.TWO_PI;
+ }
+ return value;
+ }
+ let queryString = objectToQuery_default(resource.queryParameters);
+ queryString = queryString.replace(/%5B/g, "[").replace(/%5D/g, "]");
+ if (defined_default(camera) && camera._mode !== SceneMode_default.MORPHING) {
+ let centerCartesian2;
+ let centerCartographic;
+ bbox = defaultValue_default(bbox, zeroRectangle);
+ if (defined_default(canvas)) {
+ scratchCartesian210.x = canvas.clientWidth * 0.5;
+ scratchCartesian210.y = canvas.clientHeight * 0.5;
+ centerCartesian2 = camera.pickEllipsoid(
+ scratchCartesian210,
+ ellipsoid,
+ scratchCartesian311
+ );
+ }
+ if (defined_default(centerCartesian2)) {
+ centerCartographic = ellipsoid.cartesianToCartographic(
+ centerCartesian2,
+ scratchCartographic15
+ );
+ } else {
+ centerCartographic = Rectangle_default.center(bbox, scratchCartographic15);
+ centerCartesian2 = ellipsoid.cartographicToCartesian(centerCartographic);
+ }
+ if (defined_default(viewBoundScale) && !Math_default.equalsEpsilon(viewBoundScale, 1, Math_default.EPSILON9)) {
+ const newHalfWidth = bbox.width * viewBoundScale * 0.5;
+ const newHalfHeight = bbox.height * viewBoundScale * 0.5;
+ bbox = new Rectangle_default(
+ fixLongitude(centerCartographic.longitude - newHalfWidth),
+ fixLatitude(centerCartographic.latitude - newHalfHeight),
+ fixLongitude(centerCartographic.longitude + newHalfWidth),
+ fixLatitude(centerCartographic.latitude + newHalfHeight)
+ );
+ }
+ queryString = queryString.replace(
+ "[bboxWest]",
+ Math_default.toDegrees(bbox.west).toString()
+ );
+ queryString = queryString.replace(
+ "[bboxSouth]",
+ Math_default.toDegrees(bbox.south).toString()
+ );
+ queryString = queryString.replace(
+ "[bboxEast]",
+ Math_default.toDegrees(bbox.east).toString()
+ );
+ queryString = queryString.replace(
+ "[bboxNorth]",
+ Math_default.toDegrees(bbox.north).toString()
+ );
+ const lon = Math_default.toDegrees(centerCartographic.longitude).toString();
+ const lat = Math_default.toDegrees(centerCartographic.latitude).toString();
+ queryString = queryString.replace("[lookatLon]", lon);
+ queryString = queryString.replace("[lookatLat]", lat);
+ queryString = queryString.replace(
+ "[lookatTilt]",
+ Math_default.toDegrees(camera.pitch).toString()
+ );
+ queryString = queryString.replace(
+ "[lookatHeading]",
+ Math_default.toDegrees(camera.heading).toString()
+ );
+ queryString = queryString.replace(
+ "[lookatRange]",
+ Cartesian3_default.distance(camera.positionWC, centerCartesian2)
+ );
+ queryString = queryString.replace("[lookatTerrainLon]", lon);
+ queryString = queryString.replace("[lookatTerrainLat]", lat);
+ queryString = queryString.replace(
+ "[lookatTerrainAlt]",
+ centerCartographic.height.toString()
+ );
+ ellipsoid.cartesianToCartographic(camera.positionWC, scratchCartographic15);
+ queryString = queryString.replace(
+ "[cameraLon]",
+ Math_default.toDegrees(scratchCartographic15.longitude).toString()
+ );
+ queryString = queryString.replace(
+ "[cameraLat]",
+ Math_default.toDegrees(scratchCartographic15.latitude).toString()
+ );
+ queryString = queryString.replace(
+ "[cameraAlt]",
+ Math_default.toDegrees(scratchCartographic15.height).toString()
+ );
+ const frustum = camera.frustum;
+ const aspectRatio = frustum.aspectRatio;
+ let horizFov = "";
+ let vertFov = "";
+ if (defined_default(aspectRatio)) {
+ const fov = Math_default.toDegrees(frustum.fov);
+ if (aspectRatio > 1) {
+ horizFov = fov;
+ vertFov = fov / aspectRatio;
+ } else {
+ vertFov = fov;
+ horizFov = fov * aspectRatio;
+ }
+ }
+ queryString = queryString.replace("[horizFov]", horizFov.toString());
+ queryString = queryString.replace("[vertFov]", vertFov.toString());
+ } else {
+ queryString = queryString.replace("[bboxWest]", "-180");
+ queryString = queryString.replace("[bboxSouth]", "-90");
+ queryString = queryString.replace("[bboxEast]", "180");
+ queryString = queryString.replace("[bboxNorth]", "90");
+ queryString = queryString.replace("[lookatLon]", "");
+ queryString = queryString.replace("[lookatLat]", "");
+ queryString = queryString.replace("[lookatRange]", "");
+ queryString = queryString.replace("[lookatTilt]", "");
+ queryString = queryString.replace("[lookatHeading]", "");
+ queryString = queryString.replace("[lookatTerrainLon]", "");
+ queryString = queryString.replace("[lookatTerrainLat]", "");
+ queryString = queryString.replace("[lookatTerrainAlt]", "");
+ queryString = queryString.replace("[cameraLon]", "");
+ queryString = queryString.replace("[cameraLat]", "");
+ queryString = queryString.replace("[cameraAlt]", "");
+ queryString = queryString.replace("[horizFov]", "");
+ queryString = queryString.replace("[vertFov]", "");
+ }
+ if (defined_default(canvas)) {
+ queryString = queryString.replace("[horizPixels]", canvas.clientWidth);
+ queryString = queryString.replace("[vertPixels]", canvas.clientHeight);
+ } else {
+ queryString = queryString.replace("[horizPixels]", "");
+ queryString = queryString.replace("[vertPixels]", "");
+ }
+ queryString = queryString.replace("[terrainEnabled]", "1");
+ queryString = queryString.replace("[clientVersion]", "1");
+ queryString = queryString.replace("[kmlVersion]", "2.2");
+ queryString = queryString.replace("[clientName]", "Cesium");
+ queryString = queryString.replace("[language]", "English");
+ resource.setQueryParameters(queryToObject_default(queryString));
+}
+function processNetworkLink(dataSource, node, processingData, deferredLoading) {
+ const r = processFeature2(dataSource, node, processingData);
+ const networkEntity = r.entity;
+ const sourceResource = processingData.sourceResource;
+ const uriResolver = processingData.uriResolver;
+ let link = queryFirstNode2(node, "Link", namespaces2.kml);
+ if (!defined_default(link)) {
+ link = queryFirstNode2(node, "Url", namespaces2.kml);
+ }
+ if (defined_default(link)) {
+ let href = queryStringValue2(link, "href", namespaces2.kml);
+ let viewRefreshMode;
+ let viewBoundScale;
+ if (defined_default(href)) {
+ let newSourceUri = href;
+ href = resolveHref(href, sourceResource, processingData.uriResolver);
+ if (/^data:/.test(href.getUrlComponent())) {
+ if (!/\.kmz/i.test(sourceResource.getUrlComponent())) {
+ newSourceUri = sourceResource.getDerivedResource({
+ url: newSourceUri
+ });
+ }
+ } else {
+ newSourceUri = href.clone();
+ viewRefreshMode = queryStringValue2(
+ link,
+ "viewRefreshMode",
+ namespaces2.kml
+ );
+ if (viewRefreshMode === "onRegion") {
+ oneTimeWarning_default(
+ "kml-refrehMode-onRegion",
+ "KML - Unsupported viewRefreshMode: onRegion"
+ );
+ return;
+ }
+ viewBoundScale = defaultValue_default(
+ queryStringValue2(link, "viewBoundScale", namespaces2.kml),
+ 1
+ );
+ const defaultViewFormat = viewRefreshMode === "onStop" ? "BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]" : "";
+ const viewFormat = defaultValue_default(
+ queryStringValue2(link, "viewFormat", namespaces2.kml),
+ defaultViewFormat
+ );
+ const httpQuery = queryStringValue2(link, "httpQuery", namespaces2.kml);
+ if (defined_default(viewFormat)) {
+ href.setQueryParameters(queryToObject_default(cleanupString(viewFormat)));
+ }
+ if (defined_default(httpQuery)) {
+ href.setQueryParameters(queryToObject_default(cleanupString(httpQuery)));
+ }
+ const ellipsoid = dataSource._ellipsoid;
+ processNetworkLinkQueryString(
+ href,
+ dataSource.camera,
+ dataSource.canvas,
+ viewBoundScale,
+ dataSource._lastCameraView.bbox,
+ ellipsoid
+ );
+ }
+ const options = {
+ sourceUri: newSourceUri,
+ uriResolver,
+ context: networkEntity.id,
+ screenOverlayContainer: processingData.screenOverlayContainer
+ };
+ const networkLinkCollection = new EntityCollection_default();
+ const promise = load4(dataSource, networkLinkCollection, href, options).then(function(rootElement) {
+ const entities = dataSource._entityCollection;
+ const newEntities = networkLinkCollection.values;
+ entities.suspendEvents();
+ for (let i = 0; i < newEntities.length; i++) {
+ const newEntity = newEntities[i];
+ if (!defined_default(newEntity.parent)) {
+ newEntity.parent = networkEntity;
+ mergeAvailabilityWithParent(newEntity);
+ }
+ entities.add(newEntity);
+ }
+ entities.resumeEvents();
+ const refreshMode = queryStringValue2(
+ link,
+ "refreshMode",
+ namespaces2.kml
+ );
+ let refreshInterval = defaultValue_default(
+ queryNumericValue2(link, "refreshInterval", namespaces2.kml),
+ 0
+ );
+ if (refreshMode === "onInterval" && refreshInterval > 0 || refreshMode === "onExpire" || viewRefreshMode === "onStop") {
+ const networkLinkControl = queryFirstNode2(
+ rootElement,
+ "NetworkLinkControl",
+ namespaces2.kml
+ );
+ const hasNetworkLinkControl = defined_default(networkLinkControl);
+ const now2 = JulianDate_default.now();
+ const networkLinkInfo = {
+ id: createGuid_default(),
+ href,
+ cookie: {},
+ lastUpdated: now2,
+ updating: false,
+ entity: networkEntity,
+ viewBoundScale,
+ needsUpdate: false,
+ cameraUpdateTime: now2
+ };
+ let minRefreshPeriod = 0;
+ if (hasNetworkLinkControl) {
+ networkLinkInfo.cookie = queryToObject_default(
+ defaultValue_default(
+ queryStringValue2(
+ networkLinkControl,
+ "cookie",
+ namespaces2.kml
+ ),
+ ""
+ )
+ );
+ minRefreshPeriod = defaultValue_default(
+ queryNumericValue2(
+ networkLinkControl,
+ "minRefreshPeriod",
+ namespaces2.kml
+ ),
+ 0
+ );
+ }
+ if (refreshMode === "onInterval") {
+ if (hasNetworkLinkControl) {
+ refreshInterval = Math.max(minRefreshPeriod, refreshInterval);
+ }
+ networkLinkInfo.refreshMode = RefreshMode.INTERVAL;
+ networkLinkInfo.time = refreshInterval;
+ } else if (refreshMode === "onExpire") {
+ let expires;
+ if (hasNetworkLinkControl) {
+ expires = queryStringValue2(
+ networkLinkControl,
+ "expires",
+ namespaces2.kml
+ );
+ }
+ if (defined_default(expires)) {
+ try {
+ const date = JulianDate_default.fromIso8601(expires);
+ const diff = JulianDate_default.secondsDifference(date, now2);
+ if (diff > 0 && diff < minRefreshPeriod) {
+ JulianDate_default.addSeconds(now2, minRefreshPeriod, date);
+ }
+ networkLinkInfo.refreshMode = RefreshMode.EXPIRE;
+ networkLinkInfo.time = date;
+ } catch (e) {
+ oneTimeWarning_default(
+ "kml-refreshMode-onInterval-onExpire",
+ "KML - NetworkLinkControl expires is not a valid date"
+ );
+ }
+ } else {
+ oneTimeWarning_default(
+ "kml-refreshMode-onExpire",
+ "KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"
+ );
+ }
+ } else if (defined_default(dataSource.camera)) {
+ networkLinkInfo.refreshMode = RefreshMode.STOP;
+ networkLinkInfo.time = defaultValue_default(
+ queryNumericValue2(link, "viewRefreshTime", namespaces2.kml),
+ 0
+ );
+ } else {
+ oneTimeWarning_default(
+ "kml-refrehMode-onStop-noCamera",
+ "A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined."
+ );
+ }
+ if (defined_default(networkLinkInfo.refreshMode)) {
+ dataSource._networkLinks.set(networkLinkInfo.id, networkLinkInfo);
+ }
+ }
+ }).catch(function(error) {
+ oneTimeWarning_default(`An error occured during loading ${href.url}`);
+ dataSource._error.raiseEvent(dataSource, error);
+ });
+ deferredLoading.addPromise(promise);
+ }
+ }
+}
+function processFeatureNode(dataSource, node, processingData, deferredLoading) {
+ const featureProcessor = featureTypes[node.localName];
+ if (defined_default(featureProcessor)) {
+ return featureProcessor(dataSource, node, processingData, deferredLoading);
+ }
+ return processUnsupportedFeature(
+ dataSource,
+ node,
+ processingData,
+ deferredLoading
+ );
+}
+function loadKml(dataSource, entityCollection, kml, sourceResource, uriResolver, screenOverlayContainer, context) {
+ entityCollection.removeAll();
+ const documentElement = kml.documentElement;
+ const document2 = documentElement.localName === "Document" ? documentElement : queryFirstNode2(documentElement, "Document", namespaces2.kml);
+ let name = queryStringValue2(document2, "name", namespaces2.kml);
+ if (!defined_default(name)) {
+ name = getFilenameFromUri_default(sourceResource.getUrlComponent());
+ }
+ if (!defined_default(dataSource._name)) {
+ dataSource._name = name;
+ }
+ const deferredLoading = new KmlDataSource._DeferredLoading(dataSource);
+ const styleCollection = new EntityCollection_default(dataSource);
+ return Promise.all(
+ processStyles(
+ dataSource,
+ kml,
+ styleCollection,
+ sourceResource,
+ false,
+ uriResolver
+ )
+ ).then(function() {
+ let element = kml.documentElement;
+ if (element.localName === "kml") {
+ const childNodes = element.childNodes;
+ for (let i = 0; i < childNodes.length; i++) {
+ const tmp2 = childNodes[i];
+ if (defined_default(featureTypes[tmp2.localName])) {
+ element = tmp2;
+ break;
+ }
+ }
+ }
+ const processingData = {
+ parentEntity: void 0,
+ entityCollection,
+ styleCollection,
+ sourceResource,
+ uriResolver,
+ context,
+ screenOverlayContainer
+ };
+ entityCollection.suspendEvents();
+ processFeatureNode(dataSource, element, processingData, deferredLoading);
+ entityCollection.resumeEvents();
+ return deferredLoading.wait().then(function() {
+ return kml.documentElement;
+ });
+ });
+}
+function loadKmz(dataSource, entityCollection, blob, sourceResource, screenOverlayContainer) {
+ const zWorkerUrl = buildModuleUrl_default("ThirdParty/Workers/z-worker-pako.js");
+ configure({
+ workerScripts: {
+ deflate: [zWorkerUrl, "./pako_deflate.min.js"],
+ inflate: [zWorkerUrl, "./pako_inflate.min.js"]
+ }
+ });
+ const reader = new ZipReader(new BlobReader(blob));
+ return Promise.resolve(reader.getEntries()).then(function(entries) {
+ const promises = [];
+ const uriResolver = {};
+ let docEntry;
+ for (let i = 0; i < entries.length; i++) {
+ const entry = entries[i];
+ if (!entry.directory) {
+ if (/\.kml$/i.test(entry.filename)) {
+ if (!defined_default(docEntry) || !/\//i.test(entry.filename)) {
+ if (defined_default(docEntry)) {
+ promises.push(loadDataUriFromZip(docEntry, uriResolver));
+ }
+ docEntry = entry;
+ } else {
+ promises.push(loadDataUriFromZip(entry, uriResolver));
+ }
+ } else {
+ promises.push(loadDataUriFromZip(entry, uriResolver));
+ }
+ }
+ }
+ if (defined_default(docEntry)) {
+ promises.push(loadXmlFromZip(docEntry, uriResolver));
+ }
+ return Promise.all(promises).then(function() {
+ reader.close();
+ if (!defined_default(uriResolver.kml)) {
+ throw new RuntimeError_default("KMZ file does not contain a KML document.");
+ }
+ uriResolver.keys = Object.keys(uriResolver);
+ return loadKml(
+ dataSource,
+ entityCollection,
+ uriResolver.kml,
+ sourceResource,
+ uriResolver,
+ screenOverlayContainer
+ );
+ });
+ });
+}
+function load4(dataSource, entityCollection, data, options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ let sourceUri = options.sourceUri;
+ const uriResolver = options.uriResolver;
+ const context = options.context;
+ let screenOverlayContainer = options.screenOverlayContainer;
+ let promise = data;
+ if (typeof data === "string" || data instanceof Resource_default) {
+ data = Resource_default.createIfNeeded(data);
+ promise = data.fetchBlob();
+ sourceUri = defaultValue_default(sourceUri, data.clone());
+ const resourceCredits = dataSource._resourceCredits;
+ const credits = data.credits;
+ if (defined_default(credits)) {
+ const length3 = credits.length;
+ for (let i = 0; i < length3; i++) {
+ resourceCredits.push(credits[i]);
+ }
+ }
+ } else {
+ sourceUri = defaultValue_default(sourceUri, Resource_default.DEFAULT.clone());
+ }
+ sourceUri = Resource_default.createIfNeeded(sourceUri);
+ if (defined_default(screenOverlayContainer)) {
+ screenOverlayContainer = getElement_default(screenOverlayContainer);
+ }
+ return Promise.resolve(promise).then(function(dataToLoad) {
+ if (dataToLoad instanceof Blob) {
+ return isZipFile(dataToLoad).then(function(isZip) {
+ if (isZip) {
+ return loadKmz(
+ dataSource,
+ entityCollection,
+ dataToLoad,
+ sourceUri,
+ screenOverlayContainer
+ );
+ }
+ return readBlobAsText2(dataToLoad).then(function(text) {
+ text = insertNamespaces(text);
+ text = removeDuplicateNamespaces(text);
+ let kml;
+ let error;
+ try {
+ kml = parser2.parseFromString(text, "application/xml");
+ } catch (e) {
+ error = e.toString();
+ }
+ if (defined_default(error) || kml.body || kml.documentElement.tagName === "parsererror") {
+ let msg = defined_default(error) ? error : kml.documentElement.firstChild.nodeValue;
+ if (!msg) {
+ msg = kml.body.innerText;
+ }
+ throw new RuntimeError_default(msg);
+ }
+ return loadKml(
+ dataSource,
+ entityCollection,
+ kml,
+ sourceUri,
+ uriResolver,
+ screenOverlayContainer,
+ context
+ );
+ });
+ });
+ }
+ return loadKml(
+ dataSource,
+ entityCollection,
+ dataToLoad,
+ sourceUri,
+ uriResolver,
+ screenOverlayContainer,
+ context
+ );
+ }).catch(function(error) {
+ dataSource._error.raiseEvent(dataSource, error);
+ console.log(error);
+ return Promise.reject(error);
+ });
+}
+function KmlDataSource(options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const camera = options.camera;
+ const canvas = options.canvas;
+ this._changed = new Event_default();
+ this._error = new Event_default();
+ this._loading = new Event_default();
+ this._refresh = new Event_default();
+ this._unsupportedNode = new Event_default();
+ this._clock = void 0;
+ this._entityCollection = new EntityCollection_default(this);
+ this._name = void 0;
+ this._isLoading = false;
+ this._pinBuilder = new PinBuilder_default();
+ this._networkLinks = new AssociativeArray_default();
+ this._entityCluster = new EntityCluster_default();
+ this.canvas = canvas;
+ this.camera = camera;
+ this._lastCameraView = {
+ position: defined_default(camera) ? Cartesian3_default.clone(camera.positionWC) : void 0,
+ direction: defined_default(camera) ? Cartesian3_default.clone(camera.directionWC) : void 0,
+ up: defined_default(camera) ? Cartesian3_default.clone(camera.upWC) : void 0,
+ bbox: defined_default(camera) ? camera.computeViewRectangle() : Rectangle_default.clone(Rectangle_default.MAX_VALUE)
+ };
+ this._ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
+ let credit = options.credit;
+ if (typeof credit === "string") {
+ credit = new Credit_default(credit);
+ }
+ this._credit = credit;
+ this._resourceCredits = [];
+ this._kmlTours = [];
+ this._screenOverlays = [];
+}
+KmlDataSource.load = function(data, options) {
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ const dataSource = new KmlDataSource(options);
+ return dataSource.load(data, options);
+};
+Object.defineProperties(KmlDataSource.prototype, {
+ name: {
+ get: function() {
+ return this._name;
+ },
+ set: function(value) {
+ if (this._name !== value) {
+ this._name = value;
+ this._changed.raiseEvent(this);
+ }
+ }
+ },
+ clock: {
+ get: function() {
+ return this._clock;
+ }
+ },
+ entities: {
+ get: function() {
+ return this._entityCollection;
+ }
+ },
+ isLoading: {
+ get: function() {
+ return this._isLoading;
+ }
+ },
+ changedEvent: {
+ get: function() {
+ return this._changed;
+ }
+ },
+ errorEvent: {
+ get: function() {
+ return this._error;
+ }
+ },
+ loadingEvent: {
+ get: function() {
+ return this._loading;
+ }
+ },
+ refreshEvent: {
+ get: function() {
+ return this._refresh;
+ }
+ },
+ unsupportedNodeEvent: {
+ get: function() {
+ return this._unsupportedNode;
+ }
+ },
+ show: {
+ get: function() {
+ return this._entityCollection.show;
+ },
+ set: function(value) {
+ this._entityCollection.show = value;
+ }
+ },
+ clustering: {
+ get: function() {
+ return this._entityCluster;
+ },
+ set: function(value) {
+ if (!defined_default(value)) {
+ throw new DeveloperError_default("value must be defined.");
+ }
+ this._entityCluster = value;
+ }
+ },
+ credit: {
+ get: function() {
+ return this._credit;
+ }
+ },
+ kmlTours: {
+ get: function() {
+ return this._kmlTours;
+ }
+ }
+});
+KmlDataSource.prototype.load = function(data, options) {
+ if (!defined_default(data)) {
+ throw new DeveloperError_default("data is required.");
+ }
+ options = defaultValue_default(options, defaultValue_default.EMPTY_OBJECT);
+ DataSource_default.setLoading(this, true);
+ const oldName = this._name;
+ this._name = void 0;
+ this._clampToGround = defaultValue_default(options.clampToGround, false);
+ const that = this;
+ return load4(this, this._entityCollection, data, options).then(function() {
+ let clock;
+ const availability = that._entityCollection.computeAvailability();
+ let start = availability.start;
+ let stop2 = availability.stop;
+ const isMinStart = JulianDate_default.equals(start, Iso8601_default.MINIMUM_VALUE);
+ const isMaxStop = JulianDate_default.equals(stop2, Iso8601_default.MAXIMUM_VALUE);
+ if (!isMinStart || !isMaxStop) {
+ let date;
+ if (isMinStart) {
+ date = new Date();
+ date.setHours(0, 0, 0, 0);
+ start = JulianDate_default.fromDate(date);
+ }
+ if (isMaxStop) {
+ date = new Date();
+ date.setHours(24, 0, 0, 0);
+ stop2 = JulianDate_default.fromDate(date);
+ }
+ clock = new DataSourceClock_default();
+ clock.startTime = start;
+ clock.stopTime = stop2;
+ clock.currentTime = JulianDate_default.clone(start);
+ clock.clockRange = ClockRange_default.LOOP_STOP;
+ clock.clockStep = ClockStep_default.SYSTEM_CLOCK_MULTIPLIER;
+ clock.multiplier = Math.round(
+ Math.min(
+ Math.max(JulianDate_default.secondsDifference(stop2, start) / 60, 1),
+ 31556900
+ )
+ );
+ }
+ let changed = false;
+ if (clock !== that._clock) {
+ that._clock = clock;
+ changed = true;
+ }
+ if (oldName !== that._name) {
+ changed = true;
+ }
+ if (changed) {
+ that._changed.raiseEvent(that);
+ }
+ DataSource_default.setLoading(that, false);
+ return that;
+ }).catch(function(error) {
+ DataSource_default.setLoading(that, false);
+ that._error.raiseEvent(that, error);
+ console.log(error);
+ return Promise.reject(error);
+ });
+};
+KmlDataSource.prototype.destroy = function() {
+ while (this._screenOverlays.length > 0) {
+ const elem = this._screenOverlays.pop();
+ elem.remove();
+ }
+};
+function mergeAvailabilityWithParent(child) {
+ const parent = child.parent;
+ if (defined_default(parent)) {
+ const parentAvailability = parent.availability;
+ if (defined_default(parentAvailability)) {
+ const childAvailability = child.availability;
+ if (defined_default(childAvailability)) {
+ childAvailability.intersect(parentAvailability);
+ } else {
+ child.availability = parentAvailability;
+ }
+ }
+ }
+}
+function getNetworkLinkUpdateCallback(dataSource, networkLink, newEntityCollection, networkLinks, processedHref) {
+ return function(rootElement) {
+ if (!networkLinks.contains(networkLink.id)) {
+ return;
+ }
+ let remove5 = false;
+ const networkLinkControl = queryFirstNode2(
+ rootElement,
+ "NetworkLinkControl",
+ namespaces2.kml
+ );
+ const hasNetworkLinkControl = defined_default(networkLinkControl);
+ let minRefreshPeriod = 0;
+ if (hasNetworkLinkControl) {
+ if (defined_default(queryFirstNode2(networkLinkControl, "Update", namespaces2.kml))) {
+ oneTimeWarning_default(
+ "kml-networkLinkControl-update",
+ "KML - NetworkLinkControl updates aren't supported."
+ );
+ networkLink.updating = false;
+ networkLinks.remove(networkLink.id);
+ return;
+ }
+ networkLink.cookie = queryToObject_default(
+ defaultValue_default(
+ queryStringValue2(networkLinkControl, "cookie", namespaces2.kml),
+ ""
+ )
+ );
+ minRefreshPeriod = defaultValue_default(
+ queryNumericValue2(
+ networkLinkControl,
+ "minRefreshPeriod",
+ namespaces2.kml
+ ),
+ 0
+ );
+ }
+ const now2 = JulianDate_default.now();
+ const refreshMode = networkLink.refreshMode;
+ if (refreshMode === RefreshMode.INTERVAL) {
+ if (defined_default(networkLinkControl)) {
+ networkLink.time = Math.max(minRefreshPeriod, networkLink.time);
+ }
+ } else if (refreshMode === RefreshMode.EXPIRE) {
+ let expires;
+ if (defined_default(networkLinkControl)) {
+ expires = queryStringValue2(
+ networkLinkControl,
+ "expires",
+ namespaces2.kml
+ );
+ }
+ if (defined_default(expires)) {
+ try {
+ const date = JulianDate_default.fromIso8601(expires);
+ const diff = JulianDate_default.secondsDifference(date, now2);
+ if (diff > 0 && diff < minRefreshPeriod) {
+ JulianDate_default.addSeconds(now2, minRefreshPeriod, date);
+ }
+ networkLink.time = date;
+ } catch (e) {
+ oneTimeWarning_default(
+ "kml-networkLinkControl-expires",
+ "KML - NetworkLinkControl expires is not a valid date"
+ );
+ remove5 = true;
+ }
+ } else {
+ oneTimeWarning_default(
+ "kml-refreshMode-onExpire",
+ "KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"
+ );
+ remove5 = true;
+ }
+ }
+ const networkLinkEntity = networkLink.entity;
+ const entityCollection = dataSource._entityCollection;
+ const newEntities = newEntityCollection.values;
+ function removeChildren(entity) {
+ entityCollection.remove(entity);
+ const children = entity._children;
+ const count = children.length;
+ for (let i2 = 0; i2 < count; ++i2) {
+ removeChildren(children[i2]);
+ }
+ }
+ entityCollection.suspendEvents();
+ const entitiesCopy = entityCollection.values.slice();
+ let i;
+ for (i = 0; i < entitiesCopy.length; ++i) {
+ const entityToRemove = entitiesCopy[i];
+ if (entityToRemove.parent === networkLinkEntity) {
+ entityToRemove.parent = void 0;
+ removeChildren(entityToRemove);
+ }
+ }
+ entityCollection.resumeEvents();
+ entityCollection.suspendEvents();
+ for (i = 0; i < newEntities.length; i++) {
+ const newEntity = newEntities[i];
+ if (!defined_default(newEntity.parent)) {
+ newEntity.parent = networkLinkEntity;
+ mergeAvailabilityWithParent(newEntity);
+ }
+ entityCollection.add(newEntity);
+ }
+ entityCollection.resumeEvents();
+ if (remove5) {
+ networkLinks.remove(networkLink.id);
+ } else {
+ networkLink.lastUpdated = now2;
+ }
+ const availability = entityCollection.computeAvailability();
+ const start = availability.start;
+ const stop2 = availability.stop;
+ const isMinStart = JulianDate_default.equals(start, Iso8601_default.MINIMUM_VALUE);
+ const isMaxStop = JulianDate_default.equals(stop2, Iso8601_default.MAXIMUM_VALUE);
+ if (!isMinStart || !isMaxStop) {
+ const clock = dataSource._clock;
+ if (clock.startTime !== start || clock.stopTime !== stop2) {
+ clock.startTime = start;
+ clock.stopTime = stop2;
+ dataSource._changed.raiseEvent(dataSource);
+ }
+ }
+ networkLink.updating = false;
+ networkLink.needsUpdate = false;
+ dataSource._refresh.raiseEvent(
+ dataSource,
+ processedHref.getUrlComponent(true)
+ );
+ };
+}
+var entitiesToIgnore = new AssociativeArray_default();
+KmlDataSource.prototype.update = function(time) {
+ const networkLinks = this._networkLinks;
+ if (networkLinks.length === 0) {
+ return true;
+ }
+ const now2 = JulianDate_default.now();
+ const that = this;
+ entitiesToIgnore.removeAll();
+ function recurseIgnoreEntities(entity) {
+ const children = entity._children;
+ const count = children.length;
+ for (let i = 0; i < count; ++i) {
+ const child = children[i];
+ entitiesToIgnore.set(child.id, child);
+ recurseIgnoreEntities(child);
+ }
+ }
+ let cameraViewUpdate = false;
+ const lastCameraView = this._lastCameraView;
+ const camera = this.camera;
+ if (defined_default(camera) && !(camera.positionWC.equalsEpsilon(
+ lastCameraView.position,
+ Math_default.EPSILON7
+ ) && camera.directionWC.equalsEpsilon(
+ lastCameraView.direction,
+ Math_default.EPSILON7
+ ) && camera.upWC.equalsEpsilon(lastCameraView.up, Math_default.EPSILON7))) {
+ lastCameraView.position = Cartesian3_default.clone(camera.positionWC);
+ lastCameraView.direction = Cartesian3_default.clone(camera.directionWC);
+ lastCameraView.up = Cartesian3_default.clone(camera.upWC);
+ lastCameraView.bbox = camera.computeViewRectangle();
+ cameraViewUpdate = true;
+ }
+ const newNetworkLinks = new AssociativeArray_default();
+ let changed = false;
+ networkLinks.values.forEach(function(networkLink) {
+ const entity = networkLink.entity;
+ if (entitiesToIgnore.contains(entity.id)) {
+ return;
+ }
+ if (!networkLink.updating) {
+ let doUpdate = false;
+ if (networkLink.refreshMode === RefreshMode.INTERVAL) {
+ if (JulianDate_default.secondsDifference(now2, networkLink.lastUpdated) > networkLink.time) {
+ doUpdate = true;
+ }
+ } else if (networkLink.refreshMode === RefreshMode.EXPIRE) {
+ if (JulianDate_default.greaterThan(now2, networkLink.time)) {
+ doUpdate = true;
+ }
+ } else if (networkLink.refreshMode === RefreshMode.STOP) {
+ if (cameraViewUpdate) {
+ networkLink.needsUpdate = true;
+ networkLink.cameraUpdateTime = now2;
+ }
+ if (networkLink.needsUpdate && JulianDate_default.secondsDifference(now2, networkLink.cameraUpdateTime) >= networkLink.time) {
+ doUpdate = true;
+ }
+ }
+ if (doUpdate) {
+ recurseIgnoreEntities(entity);
+ networkLink.updating = true;
+ const newEntityCollection = new EntityCollection_default();
+ const href = networkLink.href.clone();
+ href.setQueryParameters(networkLink.cookie);
+ const ellipsoid = defaultValue_default(that._ellipsoid, Ellipsoid_default.WGS84);
+ processNetworkLinkQueryString(
+ href,
+ that.camera,
+ that.canvas,
+ networkLink.viewBoundScale,
+ lastCameraView.bbox,
+ ellipsoid
+ );
+ load4(that, newEntityCollection, href, {
+ context: entity.id
+ }).then(
+ getNetworkLinkUpdateCallback(
+ that,
+ networkLink,
+ newEntityCollection,
+ newNetworkLinks,
+ href
+ )
+ ).catch(function(error) {
+ const msg = `NetworkLink ${networkLink.href} refresh failed: ${error}`;
+ console.log(msg);
+ that._error.raiseEvent(that, msg);
+ });
+ changed = true;
+ }
+ }
+ newNetworkLinks.set(networkLink.id, networkLink);
+ });
+ if (changed) {
+ this._networkLinks = newNetworkLinks;
+ this._changed.raiseEvent(this);
+ }
+ return true;
+};
+function KmlFeatureData() {
+ this.author = {
+ name: void 0,
+ uri: void 0,
+ email: void 0
+ };
+ this.link = {
+ href: void 0,
+ hreflang: void 0,
+ rel: void 0,
+ type: void 0,
+ title: void 0,
+ length: void 0
+ };
+ this.address = void 0;
+ this.phoneNumber = void 0;
+ this.snippet = void 0;
+ this.extendedData = void 0;
+}
+KmlDataSource._DeferredLoading = DeferredLoading;
+KmlDataSource._getTimestamp = getTimestamp_default;
+var KmlDataSource_default = KmlDataSource;
+
+// Source/DataSources/Visualizer.js
+function Visualizer() {
+ DeveloperError_default.throwInstantiationError();
+}
+Visualizer.prototype.update = DeveloperError_default.throwInstantiationError;
+Visualizer.prototype.getBoundingSphere = DeveloperError_default.throwInstantiationError;
+Visualizer.prototype.isDestroyed = DeveloperError_default.throwInstantiationError;
+Visualizer.prototype.destroy = DeveloperError_default.throwInstantiationError;
+var Visualizer_default = Visualizer;
+
+// Source/ThirdParty/knockout-3.5.1.js
+var oldValue;
+if (typeof ko !== "undefined") {
+ oldValue = ko;
+}
+(function() {
+ /*!
+ * Knockout JavaScript library v3.5.1
+ * (c) The Knockout.js team - http://knockoutjs.com/
+ * License: MIT (http://www.opensource.org/licenses/mit-license.php)
+ */
+ (function() {
+ (function(n) {
+ var A = this || (0, eval)("this"), w = A.document, R = A.navigator, v7 = A.jQuery, H = A.JSON;
+ v7 || "undefined" === typeof jQuery || (v7 = jQuery);
+ (function(n2) {
+ n2(A.ko = {});
+ })(function(S, T) {
+ function K(a4, c) {
+ return null === a4 || typeof a4 in W ? a4 === c : false;
+ }
+ function X(b, c) {
+ var d;
+ return function() {
+ d || (d = a3.a.setTimeout(function() {
+ d = n;
+ b();
+ }, c));
+ };
+ }
+ function Y(b, c) {
+ var d;
+ return function() {
+ clearTimeout(d);
+ d = a3.a.setTimeout(b, c);
+ };
+ }
+ function Z(a4, c) {
+ c && "change" !== c ? "beforeChange" === c ? this.pc(a4) : this.gb(a4, c) : this.qc(a4);
+ }
+ function aa(a4, c) {
+ null !== c && c.s && c.s();
+ }
+ function ba(a4, c) {
+ var d = this.qd, e = d[r];
+ e.ra || (this.Qb && this.mb[c] ? (d.uc(c, a4, this.mb[c]), this.mb[c] = null, --this.Qb) : e.I[c] || d.uc(c, a4, e.J ? { da: a4 } : d.$c(a4)), a4.Ja && a4.gd());
+ }
+ var a3 = "undefined" !== typeof S ? S : {};
+ a3.b = function(b, c) {
+ for (var d = b.split("."), e = a3, f = 0; f < d.length - 1; f++)
+ e = e[d[f]];
+ e[d[d.length - 1]] = c;
+ };
+ a3.L = function(a4, c, d) {
+ a4[c] = d;
+ };
+ a3.version = "3.5.1";
+ a3.b(
+ "version",
+ a3.version
+ );
+ a3.options = { deferUpdates: false, useOnlyNativeEvents: false, foreachHidesDestroyed: false };
+ a3.a = function() {
+ function b(a4, b2) {
+ for (var c14 in a4)
+ f.call(a4, c14) && b2(c14, a4[c14]);
+ }
+ function c(a4, b2) {
+ if (b2)
+ for (var c14 in b2)
+ f.call(b2, c14) && (a4[c14] = b2[c14]);
+ return a4;
+ }
+ function d(a4, b2) {
+ a4.__proto__ = b2;
+ return a4;
+ }
+ function e(b2, c14, d2, e2) {
+ var l2 = b2[c14].match(q) || [];
+ a3.a.D(d2.match(q), function(b3) {
+ a3.a.Na(l2, b3, e2);
+ });
+ b2[c14] = l2.join(" ");
+ }
+ var f = Object.prototype.hasOwnProperty, g = { __proto__: [] } instanceof Array, h = "function" === typeof Symbol, m = {}, k = {};
+ m[R && /Firefox\/2/i.test(R.userAgent) ? "KeyboardEvent" : "UIEvents"] = ["keyup", "keydown", "keypress"];
+ m.MouseEvents = "click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");
+ b(m, function(a4, b2) {
+ if (b2.length)
+ for (var c14 = 0, d2 = b2.length; c14 < d2; c14++)
+ k[b2[c14]] = a4;
+ });
+ var l = { propertychange: true }, p = w && function() {
+ for (var a4 = 3, b2 = w.createElement("div"), c14 = b2.getElementsByTagName("i"); b2.innerHTML = "", c14[0]; )
+ ;
+ return 4 < a4 ? a4 : n;
+ }(), q = /\S+/g, t;
+ return {
+ Jc: ["authenticity_token", /^__RequestVerificationToken(_.*)?$/],
+ D: function(a4, b2, c14) {
+ for (var d2 = 0, e2 = a4.length; d2 < e2; d2++)
+ b2.call(c14, a4[d2], d2, a4);
+ },
+ A: "function" == typeof Array.prototype.indexOf ? function(a4, b2) {
+ return Array.prototype.indexOf.call(a4, b2);
+ } : function(a4, b2) {
+ for (var c14 = 0, d2 = a4.length; c14 < d2; c14++)
+ if (a4[c14] === b2)
+ return c14;
+ return -1;
+ },
+ Lb: function(a4, b2, c14) {
+ for (var d2 = 0, e2 = a4.length; d2 < e2; d2++)
+ if (b2.call(c14, a4[d2], d2, a4))
+ return a4[d2];
+ return n;
+ },
+ Pa: function(b2, c14) {
+ var d2 = a3.a.A(b2, c14);
+ 0 < d2 ? b2.splice(d2, 1) : 0 === d2 && b2.shift();
+ },
+ wc: function(b2) {
+ var c14 = [];
+ b2 && a3.a.D(b2, function(b3) {
+ 0 > a3.a.A(c14, b3) && c14.push(b3);
+ });
+ return c14;
+ },
+ Mb: function(a4, b2, c14) {
+ var d2 = [];
+ if (a4)
+ for (var e2 = 0, l2 = a4.length; e2 < l2; e2++)
+ d2.push(b2.call(c14, a4[e2], e2));
+ return d2;
+ },
+ jb: function(a4, b2, c14) {
+ var d2 = [];
+ if (a4)
+ for (var e2 = 0, l2 = a4.length; e2 < l2; e2++)
+ b2.call(c14, a4[e2], e2) && d2.push(a4[e2]);
+ return d2;
+ },
+ Nb: function(a4, b2) {
+ if (b2 instanceof Array)
+ a4.push.apply(a4, b2);
+ else
+ for (var c14 = 0, d2 = b2.length; c14 < d2; c14++)
+ a4.push(b2[c14]);
+ return a4;
+ },
+ Na: function(b2, c14, d2) {
+ var e2 = a3.a.A(a3.a.bc(b2), c14);
+ 0 > e2 ? d2 && b2.push(c14) : d2 || b2.splice(e2, 1);
+ },
+ Ba: g,
+ extend: c,
+ setPrototypeOf: d,
+ Ab: g ? d : c,
+ P: b,
+ Ga: function(a4, b2, c14) {
+ if (!a4)
+ return a4;
+ var d2 = {}, e2;
+ for (e2 in a4)
+ f.call(a4, e2) && (d2[e2] = b2.call(c14, a4[e2], e2, a4));
+ return d2;
+ },
+ Tb: function(b2) {
+ for (; b2.firstChild; )
+ a3.removeNode(b2.firstChild);
+ },
+ Yb: function(b2) {
+ b2 = a3.a.la(b2);
+ for (var c14 = (b2[0] && b2[0].ownerDocument || w).createElement("div"), d2 = 0, e2 = b2.length; d2 < e2; d2++)
+ c14.appendChild(a3.oa(b2[d2]));
+ return c14;
+ },
+ Ca: function(b2, c14) {
+ for (var d2 = 0, e2 = b2.length, l2 = []; d2 < e2; d2++) {
+ var k2 = b2[d2].cloneNode(true);
+ l2.push(c14 ? a3.oa(k2) : k2);
+ }
+ return l2;
+ },
+ va: function(b2, c14) {
+ a3.a.Tb(b2);
+ if (c14)
+ for (var d2 = 0, e2 = c14.length; d2 < e2; d2++)
+ b2.appendChild(c14[d2]);
+ },
+ Xc: function(b2, c14) {
+ var d2 = b2.nodeType ? [b2] : b2;
+ if (0 < d2.length) {
+ for (var e2 = d2[0], l2 = e2.parentNode, k2 = 0, f2 = c14.length; k2 < f2; k2++)
+ l2.insertBefore(c14[k2], e2);
+ k2 = 0;
+ for (f2 = d2.length; k2 < f2; k2++)
+ a3.removeNode(d2[k2]);
+ }
+ },
+ Ua: function(a4, b2) {
+ if (a4.length) {
+ for (b2 = 8 === b2.nodeType && b2.parentNode || b2; a4.length && a4[0].parentNode !== b2; )
+ a4.splice(0, 1);
+ for (; 1 < a4.length && a4[a4.length - 1].parentNode !== b2; )
+ a4.length--;
+ if (1 < a4.length) {
+ var c14 = a4[0], d2 = a4[a4.length - 1];
+ for (a4.length = 0; c14 !== d2; )
+ a4.push(c14), c14 = c14.nextSibling;
+ a4.push(d2);
+ }
+ }
+ return a4;
+ },
+ Zc: function(a4, b2) {
+ 7 > p ? a4.setAttribute("selected", b2) : a4.selected = b2;
+ },
+ Db: function(a4) {
+ return null === a4 || a4 === n ? "" : a4.trim ? a4.trim() : a4.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, "");
+ },
+ Ud: function(a4, b2) {
+ a4 = a4 || "";
+ return b2.length > a4.length ? false : a4.substring(0, b2.length) === b2;
+ },
+ vd: function(a4, b2) {
+ if (a4 === b2)
+ return true;
+ if (11 === a4.nodeType)
+ return false;
+ if (b2.contains)
+ return b2.contains(1 !== a4.nodeType ? a4.parentNode : a4);
+ if (b2.compareDocumentPosition)
+ return 16 == (b2.compareDocumentPosition(a4) & 16);
+ for (; a4 && a4 != b2; )
+ a4 = a4.parentNode;
+ return !!a4;
+ },
+ Sb: function(b2) {
+ return a3.a.vd(b2, b2.ownerDocument.documentElement);
+ },
+ kd: function(b2) {
+ return !!a3.a.Lb(b2, a3.a.Sb);
+ },
+ R: function(a4) {
+ return a4 && a4.tagName && a4.tagName.toLowerCase();
+ },
+ Ac: function(b2) {
+ return a3.onError ? function() {
+ try {
+ return b2.apply(this, arguments);
+ } catch (c14) {
+ throw a3.onError && a3.onError(c14), c14;
+ }
+ } : b2;
+ },
+ setTimeout: function(b2, c14) {
+ return setTimeout(a3.a.Ac(b2), c14);
+ },
+ Gc: function(b2) {
+ setTimeout(function() {
+ a3.onError && a3.onError(b2);
+ throw b2;
+ }, 0);
+ },
+ B: function(b2, c14, d2) {
+ var e2 = a3.a.Ac(d2);
+ d2 = l[c14];
+ if (a3.options.useOnlyNativeEvents || d2 || !v7)
+ if (d2 || "function" != typeof b2.addEventListener)
+ if ("undefined" != typeof b2.attachEvent) {
+ var k2 = function(a4) {
+ e2.call(b2, a4);
+ }, f2 = "on" + c14;
+ b2.attachEvent(
+ f2,
+ k2
+ );
+ a3.a.K.za(b2, function() {
+ b2.detachEvent(f2, k2);
+ });
+ } else
+ throw Error("Browser doesn't support addEventListener or attachEvent");
+ else
+ b2.addEventListener(c14, e2, false);
+ else
+ t || (t = "function" == typeof v7(b2).on ? "on" : "bind"), v7(b2)[t](c14, e2);
+ },
+ Fb: function(b2, c14) {
+ if (!b2 || !b2.nodeType)
+ throw Error("element must be a DOM node when calling triggerEvent");
+ var d2;
+ "input" === a3.a.R(b2) && b2.type && "click" == c14.toLowerCase() ? (d2 = b2.type, d2 = "checkbox" == d2 || "radio" == d2) : d2 = false;
+ if (a3.options.useOnlyNativeEvents || !v7 || d2)
+ if ("function" == typeof w.createEvent)
+ if ("function" == typeof b2.dispatchEvent)
+ d2 = w.createEvent(k[c14] || "HTMLEvents"), d2.initEvent(c14, true, true, A, 0, 0, 0, 0, 0, false, false, false, false, 0, b2), b2.dispatchEvent(d2);
+ else
+ throw Error("The supplied element doesn't support dispatchEvent");
+ else if (d2 && b2.click)
+ b2.click();
+ else if ("undefined" != typeof b2.fireEvent)
+ b2.fireEvent("on" + c14);
+ else
+ throw Error("Browser doesn't support triggering events");
+ else
+ v7(b2).trigger(c14);
+ },
+ f: function(b2) {
+ return a3.O(b2) ? b2() : b2;
+ },
+ bc: function(b2) {
+ return a3.O(b2) ? b2.v() : b2;
+ },
+ Eb: function(b2, c14, d2) {
+ var l2;
+ c14 && ("object" === typeof b2.classList ? (l2 = b2.classList[d2 ? "add" : "remove"], a3.a.D(c14.match(q), function(a4) {
+ l2.call(b2.classList, a4);
+ })) : "string" === typeof b2.className.baseVal ? e(b2.className, "baseVal", c14, d2) : e(b2, "className", c14, d2));
+ },
+ Bb: function(b2, c14) {
+ var d2 = a3.a.f(c14);
+ if (null === d2 || d2 === n)
+ d2 = "";
+ var e2 = a3.h.firstChild(b2);
+ !e2 || 3 != e2.nodeType || a3.h.nextSibling(e2) ? a3.h.va(b2, [b2.ownerDocument.createTextNode(d2)]) : e2.data = d2;
+ a3.a.Ad(b2);
+ },
+ Yc: function(a4, b2) {
+ a4.name = b2;
+ if (7 >= p)
+ try {
+ var c14 = a4.name.replace(/[&<>'"]/g, function(a5) {
+ return "" + a5.charCodeAt(0) + ";";
+ });
+ a4.mergeAttributes(w.createElement(""), false);
+ } catch (d2) {
+ }
+ },
+ Ad: function(a4) {
+ 9 <= p && (a4 = 1 == a4.nodeType ? a4 : a4.parentNode, a4.style && (a4.style.zoom = a4.style.zoom));
+ },
+ wd: function(a4) {
+ if (p) {
+ var b2 = a4.style.width;
+ a4.style.width = 0;
+ a4.style.width = b2;
+ }
+ },
+ Pd: function(b2, c14) {
+ b2 = a3.a.f(b2);
+ c14 = a3.a.f(c14);
+ for (var d2 = [], e2 = b2; e2 <= c14; e2++)
+ d2.push(e2);
+ return d2;
+ },
+ la: function(a4) {
+ for (var b2 = [], c14 = 0, d2 = a4.length; c14 < d2; c14++)
+ b2.push(a4[c14]);
+ return b2;
+ },
+ Da: function(a4) {
+ return h ? Symbol(a4) : a4;
+ },
+ Zd: 6 === p,
+ $d: 7 === p,
+ W: p,
+ Lc: function(b2, c14) {
+ for (var d2 = a3.a.la(b2.getElementsByTagName("input")).concat(a3.a.la(b2.getElementsByTagName("textarea"))), e2 = "string" == typeof c14 ? function(a4) {
+ return a4.name === c14;
+ } : function(a4) {
+ return c14.test(a4.name);
+ }, l2 = [], k2 = d2.length - 1; 0 <= k2; k2--)
+ e2(d2[k2]) && l2.push(d2[k2]);
+ return l2;
+ },
+ Nd: function(b2) {
+ return "string" == typeof b2 && (b2 = a3.a.Db(b2)) ? H && H.parse ? H.parse(b2) : new Function("return " + b2)() : null;
+ },
+ hc: function(b2, c14, d2) {
+ if (!H || !H.stringify)
+ throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
+ return H.stringify(a3.a.f(b2), c14, d2);
+ },
+ Od: function(c14, d2, e2) {
+ e2 = e2 || {};
+ var l2 = e2.params || {}, k2 = e2.includeFields || this.Jc, f2 = c14;
+ if ("object" == typeof c14 && "form" === a3.a.R(c14))
+ for (var f2 = c14.action, h2 = k2.length - 1; 0 <= h2; h2--)
+ for (var g2 = a3.a.Lc(c14, k2[h2]), m2 = g2.length - 1; 0 <= m2; m2--)
+ l2[g2[m2].name] = g2[m2].value;
+ d2 = a3.a.f(d2);
+ var p2 = w.createElement("form");
+ p2.style.display = "none";
+ p2.action = f2;
+ p2.method = "post";
+ for (var q3 in d2)
+ c14 = w.createElement("input"), c14.type = "hidden", c14.name = q3, c14.value = a3.a.hc(a3.a.f(d2[q3])), p2.appendChild(c14);
+ b(l2, function(a4, b2) {
+ var c15 = w.createElement("input");
+ c15.type = "hidden";
+ c15.name = a4;
+ c15.value = b2;
+ p2.appendChild(c15);
+ });
+ w.body.appendChild(p2);
+ e2.submitter ? e2.submitter(p2) : p2.submit();
+ setTimeout(function() {
+ p2.parentNode.removeChild(p2);
+ }, 0);
+ }
+ };
+ }();
+ a3.b("utils", a3.a);
+ a3.b("utils.arrayForEach", a3.a.D);
+ a3.b("utils.arrayFirst", a3.a.Lb);
+ a3.b("utils.arrayFilter", a3.a.jb);
+ a3.b("utils.arrayGetDistinctValues", a3.a.wc);
+ a3.b("utils.arrayIndexOf", a3.a.A);
+ a3.b("utils.arrayMap", a3.a.Mb);
+ a3.b("utils.arrayPushAll", a3.a.Nb);
+ a3.b("utils.arrayRemoveItem", a3.a.Pa);
+ a3.b("utils.cloneNodes", a3.a.Ca);
+ a3.b(
+ "utils.createSymbolOrString",
+ a3.a.Da
+ );
+ a3.b("utils.extend", a3.a.extend);
+ a3.b("utils.fieldsIncludedWithJsonPost", a3.a.Jc);
+ a3.b("utils.getFormFields", a3.a.Lc);
+ a3.b("utils.objectMap", a3.a.Ga);
+ a3.b("utils.peekObservable", a3.a.bc);
+ a3.b("utils.postJson", a3.a.Od);
+ a3.b("utils.parseJson", a3.a.Nd);
+ a3.b("utils.registerEventHandler", a3.a.B);
+ a3.b("utils.stringifyJson", a3.a.hc);
+ a3.b("utils.range", a3.a.Pd);
+ a3.b("utils.toggleDomNodeCssClass", a3.a.Eb);
+ a3.b("utils.triggerEvent", a3.a.Fb);
+ a3.b("utils.unwrapObservable", a3.a.f);
+ a3.b("utils.objectForEach", a3.a.P);
+ a3.b(
+ "utils.addOrRemoveItem",
+ a3.a.Na
+ );
+ a3.b("utils.setTextContent", a3.a.Bb);
+ a3.b("unwrap", a3.a.f);
+ Function.prototype.bind || (Function.prototype.bind = function(a4) {
+ var c = this;
+ if (1 === arguments.length)
+ return function() {
+ return c.apply(a4, arguments);
+ };
+ var d = Array.prototype.slice.call(arguments, 1);
+ return function() {
+ var e = d.slice(0);
+ e.push.apply(e, arguments);
+ return c.apply(a4, e);
+ };
+ });
+ a3.a.g = new function() {
+ var b = 0, c = "__ko__" + new Date().getTime(), d = {}, e, f;
+ a3.a.W ? (e = function(a4, e2) {
+ var f2 = a4[c];
+ if (!f2 || "null" === f2 || !d[f2]) {
+ if (!e2)
+ return n;
+ f2 = a4[c] = "ko" + b++;
+ d[f2] = {};
+ }
+ return d[f2];
+ }, f = function(a4) {
+ var b2 = a4[c];
+ return b2 ? (delete d[b2], a4[c] = null, true) : false;
+ }) : (e = function(a4, b2) {
+ var d2 = a4[c];
+ !d2 && b2 && (d2 = a4[c] = {});
+ return d2;
+ }, f = function(a4) {
+ return a4[c] ? (delete a4[c], true) : false;
+ });
+ return { get: function(a4, b2) {
+ var c14 = e(a4, false);
+ return c14 && c14[b2];
+ }, set: function(a4, b2, c14) {
+ (a4 = e(a4, c14 !== n)) && (a4[b2] = c14);
+ }, Ub: function(a4, b2, c14) {
+ a4 = e(a4, true);
+ return a4[b2] || (a4[b2] = c14);
+ }, clear: f, Z: function() {
+ return b++ + c;
+ } };
+ }();
+ a3.b("utils.domData", a3.a.g);
+ a3.b("utils.domData.clear", a3.a.g.clear);
+ a3.a.K = new function() {
+ function b(b2, c14) {
+ var d2 = a3.a.g.get(b2, e);
+ d2 === n && c14 && (d2 = [], a3.a.g.set(b2, e, d2));
+ return d2;
+ }
+ function c(c14) {
+ var e2 = b(c14, false);
+ if (e2)
+ for (var e2 = e2.slice(0), k = 0; k < e2.length; k++)
+ e2[k](c14);
+ a3.a.g.clear(c14);
+ a3.a.K.cleanExternalData(c14);
+ g[c14.nodeType] && d(c14.childNodes, true);
+ }
+ function d(b2, d2) {
+ for (var e2 = [], l, f2 = 0; f2 < b2.length; f2++)
+ if (!d2 || 8 === b2[f2].nodeType) {
+ if (c(e2[e2.length] = l = b2[f2]), b2[f2] !== l)
+ for (; f2-- && -1 == a3.a.A(e2, b2[f2]); )
+ ;
+ }
+ }
+ var e = a3.a.g.Z(), f = { 1: true, 8: true, 9: true }, g = { 1: true, 9: true };
+ return { za: function(a4, c14) {
+ if ("function" != typeof c14)
+ throw Error("Callback must be a function");
+ b(a4, true).push(c14);
+ }, yb: function(c14, d2) {
+ var f2 = b(c14, false);
+ f2 && (a3.a.Pa(f2, d2), 0 == f2.length && a3.a.g.set(c14, e, n));
+ }, oa: function(b2) {
+ a3.u.G(function() {
+ f[b2.nodeType] && (c(b2), g[b2.nodeType] && d(b2.getElementsByTagName("*")));
+ });
+ return b2;
+ }, removeNode: function(b2) {
+ a3.oa(b2);
+ b2.parentNode && b2.parentNode.removeChild(b2);
+ }, cleanExternalData: function(a4) {
+ v7 && "function" == typeof v7.cleanData && v7.cleanData([a4]);
+ } };
+ }();
+ a3.oa = a3.a.K.oa;
+ a3.removeNode = a3.a.K.removeNode;
+ a3.b("cleanNode", a3.oa);
+ a3.b("removeNode", a3.removeNode);
+ a3.b("utils.domNodeDisposal", a3.a.K);
+ a3.b(
+ "utils.domNodeDisposal.addDisposeCallback",
+ a3.a.K.za
+ );
+ a3.b("utils.domNodeDisposal.removeDisposeCallback", a3.a.K.yb);
+ (function() {
+ var b = [0, "", ""], c = [1, "", "
"], d = [3, "", "
"], e = [1, ""], f = { thead: c, tbody: c, tfoot: c, tr: [2, "", "
"], td: d, th: d, option: e, optgroup: e }, g = 8 >= a3.a.W;
+ a3.a.ua = function(c14, d2) {
+ var e2;
+ if (v7)
+ if (v7.parseHTML)
+ e2 = v7.parseHTML(c14, d2) || [];
+ else {
+ if ((e2 = v7.clean([c14], d2)) && e2[0]) {
+ for (var l = e2[0]; l.parentNode && 11 !== l.parentNode.nodeType; )
+ l = l.parentNode;
+ l.parentNode && l.parentNode.removeChild(l);
+ }
+ }
+ else {
+ (e2 = d2) || (e2 = w);
+ var l = e2.parentWindow || e2.defaultView || A, p = a3.a.Db(c14).toLowerCase(), q = e2.createElement("div"), t;
+ t = (p = p.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/)) && f[p[1]] || b;
+ p = t[0];
+ t = "ignored" + t[1] + c14 + t[2] + "";
+ "function" == typeof l.innerShiv ? q.appendChild(l.innerShiv(t)) : (g && e2.body.appendChild(q), q.innerHTML = t, g && q.parentNode.removeChild(q));
+ for (; p--; )
+ q = q.lastChild;
+ e2 = a3.a.la(q.lastChild.childNodes);
+ }
+ return e2;
+ };
+ a3.a.Md = function(b2, c14) {
+ var d2 = a3.a.ua(
+ b2,
+ c14
+ );
+ return d2.length && d2[0].parentElement || a3.a.Yb(d2);
+ };
+ a3.a.fc = function(b2, c14) {
+ a3.a.Tb(b2);
+ c14 = a3.a.f(c14);
+ if (null !== c14 && c14 !== n)
+ if ("string" != typeof c14 && (c14 = c14.toString()), v7)
+ v7(b2).html(c14);
+ else
+ for (var d2 = a3.a.ua(c14, b2.ownerDocument), e2 = 0; e2 < d2.length; e2++)
+ b2.appendChild(d2[e2]);
+ };
+ })();
+ a3.b("utils.parseHtmlFragment", a3.a.ua);
+ a3.b("utils.setHtml", a3.a.fc);
+ a3.aa = function() {
+ function b(c14, e) {
+ if (c14) {
+ if (8 == c14.nodeType) {
+ var f = a3.aa.Uc(c14.nodeValue);
+ null != f && e.push({ ud: c14, Kd: f });
+ } else if (1 == c14.nodeType)
+ for (var f = 0, g = c14.childNodes, h = g.length; f < h; f++)
+ b(
+ g[f],
+ e
+ );
+ }
+ }
+ var c = {};
+ return { Xb: function(a4) {
+ if ("function" != typeof a4)
+ throw Error("You can only pass a function to ko.memoization.memoize()");
+ var b2 = (4294967296 * (1 + Math.random()) | 0).toString(16).substring(1) + (4294967296 * (1 + Math.random()) | 0).toString(16).substring(1);
+ c[b2] = a4;
+ return "";
+ }, bd: function(a4, b2) {
+ var f = c[a4];
+ if (f === n)
+ throw Error("Couldn't find any memo with ID " + a4 + ". Perhaps it's already been unmemoized.");
+ try {
+ return f.apply(null, b2 || []), true;
+ } finally {
+ delete c[a4];
+ }
+ }, cd: function(c14, e) {
+ var f = [];
+ b(c14, f);
+ for (var g = 0, h = f.length; g < h; g++) {
+ var m = f[g].ud, k = [m];
+ e && a3.a.Nb(k, e);
+ a3.aa.bd(f[g].Kd, k);
+ m.nodeValue = "";
+ m.parentNode && m.parentNode.removeChild(m);
+ }
+ }, Uc: function(a4) {
+ return (a4 = a4.match(/^\[ko_memo\:(.*?)\]$/)) ? a4[1] : null;
+ } };
+ }();
+ a3.b("memoization", a3.aa);
+ a3.b("memoization.memoize", a3.aa.Xb);
+ a3.b("memoization.unmemoize", a3.aa.bd);
+ a3.b("memoization.parseMemoText", a3.aa.Uc);
+ a3.b("memoization.unmemoizeDomNodeAndDescendants", a3.aa.cd);
+ a3.na = function() {
+ function b() {
+ if (f) {
+ for (var b2 = f, c14 = 0, d2; h < f; )
+ if (d2 = e[h++]) {
+ if (h > b2) {
+ if (5e3 <= ++c14) {
+ h = f;
+ a3.a.Gc(Error("'Too much recursion' after processing " + c14 + " task groups."));
+ break;
+ }
+ b2 = f;
+ }
+ try {
+ d2();
+ } catch (p) {
+ a3.a.Gc(p);
+ }
+ }
+ }
+ }
+ function c() {
+ b();
+ h = f = e.length = 0;
+ }
+ var d, e = [], f = 0, g = 1, h = 0;
+ A.MutationObserver ? d = function(a4) {
+ var b2 = w.createElement("div");
+ new MutationObserver(a4).observe(b2, { attributes: true });
+ return function() {
+ b2.classList.toggle("foo");
+ };
+ }(c) : d = w && "onreadystatechange" in w.createElement("script") ? function(a4) {
+ var b2 = w.createElement("script");
+ b2.onreadystatechange = function() {
+ b2.onreadystatechange = null;
+ w.documentElement.removeChild(b2);
+ b2 = null;
+ a4();
+ };
+ w.documentElement.appendChild(b2);
+ } : function(a4) {
+ setTimeout(a4, 0);
+ };
+ return { scheduler: d, zb: function(b2) {
+ f || a3.na.scheduler(c);
+ e[f++] = b2;
+ return g++;
+ }, cancel: function(a4) {
+ a4 = a4 - (g - f);
+ a4 >= h && a4 < f && (e[a4] = null);
+ }, resetForTesting: function() {
+ var a4 = f - h;
+ h = f = e.length = 0;
+ return a4;
+ }, Sd: b };
+ }();
+ a3.b("tasks", a3.na);
+ a3.b("tasks.schedule", a3.na.zb);
+ a3.b("tasks.runEarly", a3.na.Sd);
+ a3.Ta = { throttle: function(b, c) {
+ b.throttleEvaluation = c;
+ var d = null;
+ return a3.$({ read: b, write: function(e) {
+ clearTimeout(d);
+ d = a3.a.setTimeout(
+ function() {
+ b(e);
+ },
+ c
+ );
+ } });
+ }, rateLimit: function(a4, c) {
+ var d, e, f;
+ "number" == typeof c ? d = c : (d = c.timeout, e = c.method);
+ a4.Hb = false;
+ f = "function" == typeof e ? e : "notifyWhenChangesStop" == e ? Y : X;
+ a4.ub(function(a5) {
+ return f(a5, d, c);
+ });
+ }, deferred: function(b, c) {
+ if (true !== c)
+ throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");
+ b.Hb || (b.Hb = true, b.ub(function(c14) {
+ var e, f = false;
+ return function() {
+ if (!f) {
+ a3.na.cancel(e);
+ e = a3.na.zb(c14);
+ try {
+ f = true, b.notifySubscribers(n, "dirty");
+ } finally {
+ f = false;
+ }
+ }
+ };
+ }));
+ }, notify: function(a4, c) {
+ a4.equalityComparer = "always" == c ? null : K;
+ } };
+ var W = { undefined: 1, "boolean": 1, number: 1, string: 1 };
+ a3.b("extenders", a3.Ta);
+ a3.ic = function(b, c, d) {
+ this.da = b;
+ this.lc = c;
+ this.mc = d;
+ this.Ib = false;
+ this.fb = this.Jb = null;
+ a3.L(this, "dispose", this.s);
+ a3.L(this, "disposeWhenNodeIsRemoved", this.l);
+ };
+ a3.ic.prototype.s = function() {
+ this.Ib || (this.fb && a3.a.K.yb(this.Jb, this.fb), this.Ib = true, this.mc(), this.da = this.lc = this.mc = this.Jb = this.fb = null);
+ };
+ a3.ic.prototype.l = function(b) {
+ this.Jb = b;
+ a3.a.K.za(b, this.fb = this.s.bind(this));
+ };
+ a3.T = function() {
+ a3.a.Ab(this, D);
+ D.qb(this);
+ };
+ var D = {
+ qb: function(a4) {
+ a4.U = { change: [] };
+ a4.sc = 1;
+ },
+ subscribe: function(b, c, d) {
+ var e = this;
+ d = d || "change";
+ var f = new a3.ic(e, c ? b.bind(c) : b, function() {
+ a3.a.Pa(e.U[d], f);
+ e.hb && e.hb(d);
+ });
+ e.Qa && e.Qa(d);
+ e.U[d] || (e.U[d] = []);
+ e.U[d].push(f);
+ return f;
+ },
+ notifySubscribers: function(b, c) {
+ c = c || "change";
+ "change" === c && this.Gb();
+ if (this.Wa(c)) {
+ var d = "change" === c && this.ed || this.U[c].slice(0);
+ try {
+ a3.u.xc();
+ for (var e = 0, f; f = d[e]; ++e)
+ f.Ib || f.lc(b);
+ } finally {
+ a3.u.end();
+ }
+ }
+ },
+ ob: function() {
+ return this.sc;
+ },
+ Dd: function(a4) {
+ return this.ob() !== a4;
+ },
+ Gb: function() {
+ ++this.sc;
+ },
+ ub: function(b) {
+ var c = this, d = a3.O(c), e, f, g, h, m;
+ c.gb || (c.gb = c.notifySubscribers, c.notifySubscribers = Z);
+ var k = b(function() {
+ c.Ja = false;
+ d && h === c && (h = c.nc ? c.nc() : c());
+ var a4 = f || m && c.sb(g, h);
+ m = f = e = false;
+ a4 && c.gb(g = h);
+ });
+ c.qc = function(a4, b2) {
+ b2 && c.Ja || (m = !b2);
+ c.ed = c.U.change.slice(0);
+ c.Ja = e = true;
+ h = a4;
+ k();
+ };
+ c.pc = function(a4) {
+ e || (g = a4, c.gb(a4, "beforeChange"));
+ };
+ c.rc = function() {
+ m = true;
+ };
+ c.gd = function() {
+ c.sb(g, c.v(true)) && (f = true);
+ };
+ },
+ Wa: function(a4) {
+ return this.U[a4] && this.U[a4].length;
+ },
+ Bd: function(b) {
+ if (b)
+ return this.U[b] && this.U[b].length || 0;
+ var c = 0;
+ a3.a.P(this.U, function(a4, b2) {
+ "dirty" !== a4 && (c += b2.length);
+ });
+ return c;
+ },
+ sb: function(a4, c) {
+ return !this.equalityComparer || !this.equalityComparer(a4, c);
+ },
+ toString: function() {
+ return "[object Object]";
+ },
+ extend: function(b) {
+ var c = this;
+ b && a3.a.P(b, function(b2, e) {
+ var f = a3.Ta[b2];
+ "function" == typeof f && (c = f(c, e) || c);
+ });
+ return c;
+ }
+ };
+ a3.L(D, "init", D.qb);
+ a3.L(D, "subscribe", D.subscribe);
+ a3.L(D, "extend", D.extend);
+ a3.L(D, "getSubscriptionsCount", D.Bd);
+ a3.a.Ba && a3.a.setPrototypeOf(
+ D,
+ Function.prototype
+ );
+ a3.T.fn = D;
+ a3.Qc = function(a4) {
+ return null != a4 && "function" == typeof a4.subscribe && "function" == typeof a4.notifySubscribers;
+ };
+ a3.b("subscribable", a3.T);
+ a3.b("isSubscribable", a3.Qc);
+ a3.S = a3.u = function() {
+ function b(a4) {
+ d.push(e);
+ e = a4;
+ }
+ function c() {
+ e = d.pop();
+ }
+ var d = [], e, f = 0;
+ return {
+ xc: b,
+ end: c,
+ cc: function(b2) {
+ if (e) {
+ if (!a3.Qc(b2))
+ throw Error("Only subscribable things can act as dependencies");
+ e.od.call(e.pd, b2, b2.fd || (b2.fd = ++f));
+ }
+ },
+ G: function(a4, d2, e2) {
+ try {
+ return b(), a4.apply(d2, e2 || []);
+ } finally {
+ c();
+ }
+ },
+ qa: function() {
+ if (e)
+ return e.o.qa();
+ },
+ Va: function() {
+ if (e)
+ return e.o.Va();
+ },
+ Ya: function() {
+ if (e)
+ return e.Ya;
+ },
+ o: function() {
+ if (e)
+ return e.o;
+ }
+ };
+ }();
+ a3.b("computedContext", a3.S);
+ a3.b("computedContext.getDependenciesCount", a3.S.qa);
+ a3.b("computedContext.getDependencies", a3.S.Va);
+ a3.b("computedContext.isInitial", a3.S.Ya);
+ a3.b("computedContext.registerDependency", a3.S.cc);
+ a3.b("ignoreDependencies", a3.Yd = a3.u.G);
+ var I = a3.a.Da("_latestValue");
+ a3.ta = function(b) {
+ function c() {
+ if (0 < arguments.length)
+ return c.sb(c[I], arguments[0]) && (c.ya(), c[I] = arguments[0], c.xa()), this;
+ a3.u.cc(c);
+ return c[I];
+ }
+ c[I] = b;
+ a3.a.Ba || a3.a.extend(c, a3.T.fn);
+ a3.T.fn.qb(c);
+ a3.a.Ab(c, F);
+ a3.options.deferUpdates && a3.Ta.deferred(c, true);
+ return c;
+ };
+ var F = { equalityComparer: K, v: function() {
+ return this[I];
+ }, xa: function() {
+ this.notifySubscribers(this[I], "spectate");
+ this.notifySubscribers(this[I]);
+ }, ya: function() {
+ this.notifySubscribers(this[I], "beforeChange");
+ } };
+ a3.a.Ba && a3.a.setPrototypeOf(F, a3.T.fn);
+ var G = a3.ta.Ma = "__ko_proto__";
+ F[G] = a3.ta;
+ a3.O = function(b) {
+ if ((b = "function" == typeof b && b[G]) && b !== F[G] && b !== a3.o.fn[G])
+ throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");
+ return !!b;
+ };
+ a3.Za = function(b) {
+ return "function" == typeof b && (b[G] === F[G] || b[G] === a3.o.fn[G] && b.Nc);
+ };
+ a3.b("observable", a3.ta);
+ a3.b("isObservable", a3.O);
+ a3.b("isWriteableObservable", a3.Za);
+ a3.b("isWritableObservable", a3.Za);
+ a3.b("observable.fn", F);
+ a3.L(F, "peek", F.v);
+ a3.L(F, "valueHasMutated", F.xa);
+ a3.L(F, "valueWillMutate", F.ya);
+ a3.Ha = function(b) {
+ b = b || [];
+ if ("object" != typeof b || !("length" in b))
+ throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");
+ b = a3.ta(b);
+ a3.a.Ab(
+ b,
+ a3.Ha.fn
+ );
+ return b.extend({ trackArrayChanges: true });
+ };
+ a3.Ha.fn = { remove: function(b) {
+ for (var c = this.v(), d = [], e = "function" != typeof b || a3.O(b) ? function(a4) {
+ return a4 === b;
+ } : b, f = 0; f < c.length; f++) {
+ var g = c[f];
+ if (e(g)) {
+ 0 === d.length && this.ya();
+ if (c[f] !== g)
+ throw Error("Array modified during remove; cannot remove item");
+ d.push(g);
+ c.splice(f, 1);
+ f--;
+ }
+ }
+ d.length && this.xa();
+ return d;
+ }, removeAll: function(b) {
+ if (b === n) {
+ var c = this.v(), d = c.slice(0);
+ this.ya();
+ c.splice(0, c.length);
+ this.xa();
+ return d;
+ }
+ return b ? this.remove(function(c14) {
+ return 0 <= a3.a.A(b, c14);
+ }) : [];
+ }, destroy: function(b) {
+ var c = this.v(), d = "function" != typeof b || a3.O(b) ? function(a4) {
+ return a4 === b;
+ } : b;
+ this.ya();
+ for (var e = c.length - 1; 0 <= e; e--) {
+ var f = c[e];
+ d(f) && (f._destroy = true);
+ }
+ this.xa();
+ }, destroyAll: function(b) {
+ return b === n ? this.destroy(function() {
+ return true;
+ }) : b ? this.destroy(function(c) {
+ return 0 <= a3.a.A(b, c);
+ }) : [];
+ }, indexOf: function(b) {
+ var c = this();
+ return a3.a.A(c, b);
+ }, replace: function(a4, c) {
+ var d = this.indexOf(a4);
+ 0 <= d && (this.ya(), this.v()[d] = c, this.xa());
+ }, sorted: function(a4) {
+ var c = this().slice(0);
+ return a4 ? c.sort(a4) : c.sort();
+ }, reversed: function() {
+ return this().slice(0).reverse();
+ } };
+ a3.a.Ba && a3.a.setPrototypeOf(a3.Ha.fn, a3.ta.fn);
+ a3.a.D("pop push reverse shift sort splice unshift".split(" "), function(b) {
+ a3.Ha.fn[b] = function() {
+ var a4 = this.v();
+ this.ya();
+ this.zc(a4, b, arguments);
+ var d = a4[b].apply(a4, arguments);
+ this.xa();
+ return d === a4 ? this : d;
+ };
+ });
+ a3.a.D(["slice"], function(b) {
+ a3.Ha.fn[b] = function() {
+ var a4 = this();
+ return a4[b].apply(a4, arguments);
+ };
+ });
+ a3.Pc = function(b) {
+ return a3.O(b) && "function" == typeof b.remove && "function" == typeof b.push;
+ };
+ a3.b("observableArray", a3.Ha);
+ a3.b("isObservableArray", a3.Pc);
+ a3.Ta.trackArrayChanges = function(b, c) {
+ function d() {
+ function c14() {
+ if (m) {
+ var d2 = [].concat(b.v() || []), e2;
+ if (b.Wa("arrayChange")) {
+ if (!f || 1 < m)
+ f = a3.a.Pb(k, d2, b.Ob);
+ e2 = f;
+ }
+ k = d2;
+ f = null;
+ m = 0;
+ e2 && e2.length && b.notifySubscribers(e2, "arrayChange");
+ }
+ }
+ e ? c14() : (e = true, h = b.subscribe(function() {
+ ++m;
+ }, null, "spectate"), k = [].concat(b.v() || []), f = null, g = b.subscribe(c14));
+ }
+ b.Ob = {};
+ c && "object" == typeof c && a3.a.extend(b.Ob, c);
+ b.Ob.sparse = true;
+ if (!b.zc) {
+ var e = false, f = null, g, h, m = 0, k, l = b.Qa, p = b.hb;
+ b.Qa = function(a4) {
+ l && l.call(b, a4);
+ "arrayChange" === a4 && d();
+ };
+ b.hb = function(a4) {
+ p && p.call(b, a4);
+ "arrayChange" !== a4 || b.Wa("arrayChange") || (g && g.s(), h && h.s(), h = g = null, e = false, k = n);
+ };
+ b.zc = function(b2, c14, d2) {
+ function l2(a4, b3, c15) {
+ return k2[k2.length] = { status: a4, value: b3, index: c15 };
+ }
+ if (e && !m) {
+ var k2 = [], p2 = b2.length, g2 = d2.length, h2 = 0;
+ switch (c14) {
+ case "push":
+ h2 = p2;
+ case "unshift":
+ for (c14 = 0; c14 < g2; c14++)
+ l2("added", d2[c14], h2 + c14);
+ break;
+ case "pop":
+ h2 = p2 - 1;
+ case "shift":
+ p2 && l2("deleted", b2[h2], h2);
+ break;
+ case "splice":
+ c14 = Math.min(Math.max(0, 0 > d2[0] ? p2 + d2[0] : d2[0]), p2);
+ for (var p2 = 1 === g2 ? p2 : Math.min(c14 + (d2[1] || 0), p2), g2 = c14 + g2 - 2, h2 = Math.max(p2, g2), U = [], L = [], n2 = 2; c14 < h2; ++c14, ++n2)
+ c14 < p2 && L.push(l2("deleted", b2[c14], c14)), c14 < g2 && U.push(l2("added", d2[n2], c14));
+ a3.a.Kc(L, U);
+ break;
+ default:
+ return;
+ }
+ f = k2;
+ }
+ };
+ }
+ };
+ var r = a3.a.Da("_state");
+ a3.o = a3.$ = function(b, c, d) {
+ function e() {
+ if (0 < arguments.length) {
+ if ("function" === typeof f)
+ f.apply(g.nb, arguments);
+ else
+ throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");
+ return this;
+ }
+ g.ra || a3.u.cc(e);
+ (g.ka || g.J && e.Xa()) && e.ha();
+ return g.X;
+ }
+ "object" === typeof b ? d = b : (d = d || {}, b && (d.read = b));
+ if ("function" != typeof d.read)
+ throw Error("Pass a function that returns the value of the ko.computed");
+ var f = d.write, g = { X: n, sa: true, ka: true, rb: false, jc: false, ra: false, wb: false, J: false, Wc: d.read, nb: c || d.owner, l: d.disposeWhenNodeIsRemoved || d.l || null, Sa: d.disposeWhen || d.Sa, Rb: null, I: {}, V: 0, Ic: null };
+ e[r] = g;
+ e.Nc = "function" === typeof f;
+ a3.a.Ba || a3.a.extend(e, a3.T.fn);
+ a3.T.fn.qb(e);
+ a3.a.Ab(e, C);
+ d.pure ? (g.wb = true, g.J = true, a3.a.extend(e, da)) : d.deferEvaluation && a3.a.extend(e, ea);
+ a3.options.deferUpdates && a3.Ta.deferred(e, true);
+ g.l && (g.jc = true, g.l.nodeType || (g.l = null));
+ g.J || d.deferEvaluation || e.ha();
+ g.l && e.ja() && a3.a.K.za(g.l, g.Rb = function() {
+ e.s();
+ });
+ return e;
+ };
+ var C = {
+ equalityComparer: K,
+ qa: function() {
+ return this[r].V;
+ },
+ Va: function() {
+ var b = [];
+ a3.a.P(this[r].I, function(a4, d) {
+ b[d.Ka] = d.da;
+ });
+ return b;
+ },
+ Vb: function(b) {
+ if (!this[r].V)
+ return false;
+ var c = this.Va();
+ return -1 !== a3.a.A(c, b) ? true : !!a3.a.Lb(c, function(a4) {
+ return a4.Vb && a4.Vb(b);
+ });
+ },
+ uc: function(a4, c, d) {
+ if (this[r].wb && c === this)
+ throw Error("A 'pure' computed must not be called recursively");
+ this[r].I[a4] = d;
+ d.Ka = this[r].V++;
+ d.La = c.ob();
+ },
+ Xa: function() {
+ var a4, c, d = this[r].I;
+ for (a4 in d)
+ if (Object.prototype.hasOwnProperty.call(d, a4) && (c = d[a4], this.Ia && c.da.Ja || c.da.Dd(c.La)))
+ return true;
+ },
+ Jd: function() {
+ this.Ia && !this[r].rb && this.Ia(false);
+ },
+ ja: function() {
+ var a4 = this[r];
+ return a4.ka || 0 < a4.V;
+ },
+ Rd: function() {
+ this.Ja ? this[r].ka && (this[r].sa = true) : this.Hc();
+ },
+ $c: function(a4) {
+ if (a4.Hb) {
+ var c = a4.subscribe(this.Jd, this, "dirty"), d = a4.subscribe(
+ this.Rd,
+ this
+ );
+ return { da: a4, s: function() {
+ c.s();
+ d.s();
+ } };
+ }
+ return a4.subscribe(this.Hc, this);
+ },
+ Hc: function() {
+ var b = this, c = b.throttleEvaluation;
+ c && 0 <= c ? (clearTimeout(this[r].Ic), this[r].Ic = a3.a.setTimeout(function() {
+ b.ha(true);
+ }, c)) : b.Ia ? b.Ia(true) : b.ha(true);
+ },
+ ha: function(b) {
+ var c = this[r], d = c.Sa, e = false;
+ if (!c.rb && !c.ra) {
+ if (c.l && !a3.a.Sb(c.l) || d && d()) {
+ if (!c.jc) {
+ this.s();
+ return;
+ }
+ } else
+ c.jc = false;
+ c.rb = true;
+ try {
+ e = this.zd(b);
+ } finally {
+ c.rb = false;
+ }
+ return e;
+ }
+ },
+ zd: function(b) {
+ var c = this[r], d = false, e = c.wb ? n : !c.V, d = { qd: this, mb: c.I, Qb: c.V };
+ a3.u.xc({
+ pd: d,
+ od: ba,
+ o: this,
+ Ya: e
+ });
+ c.I = {};
+ c.V = 0;
+ var f = this.yd(c, d);
+ c.V ? d = this.sb(c.X, f) : (this.s(), d = true);
+ d && (c.J ? this.Gb() : this.notifySubscribers(c.X, "beforeChange"), c.X = f, this.notifySubscribers(c.X, "spectate"), !c.J && b && this.notifySubscribers(c.X), this.rc && this.rc());
+ e && this.notifySubscribers(c.X, "awake");
+ return d;
+ },
+ yd: function(b, c) {
+ try {
+ var d = b.Wc;
+ return b.nb ? d.call(b.nb) : d();
+ } finally {
+ a3.u.end(), c.Qb && !b.J && a3.a.P(c.mb, aa), b.sa = b.ka = false;
+ }
+ },
+ v: function(a4) {
+ var c = this[r];
+ (c.ka && (a4 || !c.V) || c.J && this.Xa()) && this.ha();
+ return c.X;
+ },
+ ub: function(b) {
+ a3.T.fn.ub.call(this, b);
+ this.nc = function() {
+ this[r].J || (this[r].sa ? this.ha() : this[r].ka = false);
+ return this[r].X;
+ };
+ this.Ia = function(a4) {
+ this.pc(this[r].X);
+ this[r].ka = true;
+ a4 && (this[r].sa = true);
+ this.qc(this, !a4);
+ };
+ },
+ s: function() {
+ var b = this[r];
+ !b.J && b.I && a3.a.P(b.I, function(a4, b2) {
+ b2.s && b2.s();
+ });
+ b.l && b.Rb && a3.a.K.yb(b.l, b.Rb);
+ b.I = n;
+ b.V = 0;
+ b.ra = true;
+ b.sa = false;
+ b.ka = false;
+ b.J = false;
+ b.l = n;
+ b.Sa = n;
+ b.Wc = n;
+ this.Nc || (b.nb = n);
+ }
+ }, da = { Qa: function(b) {
+ var c = this, d = c[r];
+ if (!d.ra && d.J && "change" == b) {
+ d.J = false;
+ if (d.sa || c.Xa())
+ d.I = null, d.V = 0, c.ha() && c.Gb();
+ else {
+ var e = [];
+ a3.a.P(d.I, function(a4, b2) {
+ e[b2.Ka] = a4;
+ });
+ a3.a.D(e, function(a4, b2) {
+ var e2 = d.I[a4], m = c.$c(e2.da);
+ m.Ka = b2;
+ m.La = e2.La;
+ d.I[a4] = m;
+ });
+ c.Xa() && c.ha() && c.Gb();
+ }
+ d.ra || c.notifySubscribers(d.X, "awake");
+ }
+ }, hb: function(b) {
+ var c = this[r];
+ c.ra || "change" != b || this.Wa("change") || (a3.a.P(c.I, function(a4, b2) {
+ b2.s && (c.I[a4] = { da: b2.da, Ka: b2.Ka, La: b2.La }, b2.s());
+ }), c.J = true, this.notifySubscribers(n, "asleep"));
+ }, ob: function() {
+ var b = this[r];
+ b.J && (b.sa || this.Xa()) && this.ha();
+ return a3.T.fn.ob.call(this);
+ } }, ea = { Qa: function(a4) {
+ "change" != a4 && "beforeChange" != a4 || this.v();
+ } };
+ a3.a.Ba && a3.a.setPrototypeOf(C, a3.T.fn);
+ var N = a3.ta.Ma;
+ C[N] = a3.o;
+ a3.Oc = function(a4) {
+ return "function" == typeof a4 && a4[N] === C[N];
+ };
+ a3.Fd = function(b) {
+ return a3.Oc(b) && b[r] && b[r].wb;
+ };
+ a3.b("computed", a3.o);
+ a3.b("dependentObservable", a3.o);
+ a3.b("isComputed", a3.Oc);
+ a3.b("isPureComputed", a3.Fd);
+ a3.b("computed.fn", C);
+ a3.L(C, "peek", C.v);
+ a3.L(C, "dispose", C.s);
+ a3.L(C, "isActive", C.ja);
+ a3.L(C, "getDependenciesCount", C.qa);
+ a3.L(C, "getDependencies", C.Va);
+ a3.xb = function(b, c) {
+ if ("function" === typeof b)
+ return a3.o(
+ b,
+ c,
+ { pure: true }
+ );
+ b = a3.a.extend({}, b);
+ b.pure = true;
+ return a3.o(b, c);
+ };
+ a3.b("pureComputed", a3.xb);
+ (function() {
+ function b(a4, f, g) {
+ g = g || new d();
+ a4 = f(a4);
+ if ("object" != typeof a4 || null === a4 || a4 === n || a4 instanceof RegExp || a4 instanceof Date || a4 instanceof String || a4 instanceof Number || a4 instanceof Boolean)
+ return a4;
+ var h = a4 instanceof Array ? [] : {};
+ g.save(a4, h);
+ c(a4, function(c14) {
+ var d2 = f(a4[c14]);
+ switch (typeof d2) {
+ case "boolean":
+ case "number":
+ case "string":
+ case "function":
+ h[c14] = d2;
+ break;
+ case "object":
+ case "undefined":
+ var l = g.get(d2);
+ h[c14] = l !== n ? l : b(d2, f, g);
+ }
+ });
+ return h;
+ }
+ function c(a4, b2) {
+ if (a4 instanceof Array) {
+ for (var c14 = 0; c14 < a4.length; c14++)
+ b2(c14);
+ "function" == typeof a4.toJSON && b2("toJSON");
+ } else
+ for (c14 in a4)
+ b2(c14);
+ }
+ function d() {
+ this.keys = [];
+ this.values = [];
+ }
+ a3.ad = function(c14) {
+ if (0 == arguments.length)
+ throw Error("When calling ko.toJS, pass the object you want to convert.");
+ return b(c14, function(b2) {
+ for (var c15 = 0; a3.O(b2) && 10 > c15; c15++)
+ b2 = b2();
+ return b2;
+ });
+ };
+ a3.toJSON = function(b2, c14, d2) {
+ b2 = a3.ad(b2);
+ return a3.a.hc(b2, c14, d2);
+ };
+ d.prototype = { constructor: d, save: function(b2, c14) {
+ var d2 = a3.a.A(
+ this.keys,
+ b2
+ );
+ 0 <= d2 ? this.values[d2] = c14 : (this.keys.push(b2), this.values.push(c14));
+ }, get: function(b2) {
+ b2 = a3.a.A(this.keys, b2);
+ return 0 <= b2 ? this.values[b2] : n;
+ } };
+ })();
+ a3.b("toJS", a3.ad);
+ a3.b("toJSON", a3.toJSON);
+ a3.Wd = function(b, c, d) {
+ function e(c14) {
+ var e2 = a3.xb(b, d).extend({ ma: "always" }), h = e2.subscribe(function(a4) {
+ a4 && (h.s(), c14(a4));
+ });
+ e2.notifySubscribers(e2.v());
+ return h;
+ }
+ return "function" !== typeof Promise || c ? e(c.bind(d)) : new Promise(e);
+ };
+ a3.b("when", a3.Wd);
+ (function() {
+ a3.w = { M: function(b) {
+ switch (a3.a.R(b)) {
+ case "option":
+ return true === b.__ko__hasDomDataOptionValue__ ? a3.a.g.get(b, a3.c.options.$b) : 7 >= a3.a.W ? b.getAttributeNode("value") && b.getAttributeNode("value").specified ? b.value : b.text : b.value;
+ case "select":
+ return 0 <= b.selectedIndex ? a3.w.M(b.options[b.selectedIndex]) : n;
+ default:
+ return b.value;
+ }
+ }, cb: function(b, c, d) {
+ switch (a3.a.R(b)) {
+ case "option":
+ "string" === typeof c ? (a3.a.g.set(b, a3.c.options.$b, n), "__ko__hasDomDataOptionValue__" in b && delete b.__ko__hasDomDataOptionValue__, b.value = c) : (a3.a.g.set(b, a3.c.options.$b, c), b.__ko__hasDomDataOptionValue__ = true, b.value = "number" === typeof c ? c : "");
+ break;
+ case "select":
+ if ("" === c || null === c)
+ c = n;
+ for (var e = -1, f = 0, g = b.options.length, h; f < g; ++f)
+ if (h = a3.w.M(b.options[f]), h == c || "" === h && c === n) {
+ e = f;
+ break;
+ }
+ if (d || 0 <= e || c === n && 1 < b.size)
+ b.selectedIndex = e, 6 === a3.a.W && a3.a.setTimeout(function() {
+ b.selectedIndex = e;
+ }, 0);
+ break;
+ default:
+ if (null === c || c === n)
+ c = "";
+ b.value = c;
+ }
+ } };
+ })();
+ a3.b("selectExtensions", a3.w);
+ a3.b("selectExtensions.readValue", a3.w.M);
+ a3.b("selectExtensions.writeValue", a3.w.cb);
+ a3.m = function() {
+ function b(b2) {
+ b2 = a3.a.Db(b2);
+ 123 === b2.charCodeAt(0) && (b2 = b2.slice(
+ 1,
+ -1
+ ));
+ b2 += "\n,";
+ var c14 = [], d2 = b2.match(e), p, q = [], h2 = 0;
+ if (1 < d2.length) {
+ for (var x = 0, B; B = d2[x]; ++x) {
+ var u3 = B.charCodeAt(0);
+ if (44 === u3) {
+ if (0 >= h2) {
+ c14.push(p && q.length ? { key: p, value: q.join("") } : { unknown: p || q.join("") });
+ p = h2 = 0;
+ q = [];
+ continue;
+ }
+ } else if (58 === u3) {
+ if (!h2 && !p && 1 === q.length) {
+ p = q.pop();
+ continue;
+ }
+ } else if (47 === u3 && 1 < B.length && (47 === B.charCodeAt(1) || 42 === B.charCodeAt(1)))
+ continue;
+ else
+ 47 === u3 && x && 1 < B.length ? (u3 = d2[x - 1].match(f)) && !g[u3[0]] && (b2 = b2.substr(b2.indexOf(B) + 1), d2 = b2.match(e), x = -1, B = "/") : 40 === u3 || 123 === u3 || 91 === u3 ? ++h2 : 41 === u3 || 125 === u3 || 93 === u3 ? --h2 : p || q.length || 34 !== u3 && 39 !== u3 || (B = B.slice(1, -1));
+ q.push(B);
+ }
+ if (0 < h2)
+ throw Error("Unbalanced parentheses, braces, or brackets");
+ }
+ return c14;
+ }
+ var c = ["true", "false", "null", "undefined"], d = /^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i, e = RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]", "g"), f = /[\])"'A-Za-z0-9_$]+$/, g = { "in": 1, "return": 1, "typeof": 1 }, h = {};
+ return { Ra: [], wa: h, ac: b, vb: function(e2, f2) {
+ function l(b2, e3) {
+ var f3;
+ if (!x) {
+ var k = a3.getBindingHandler(b2);
+ if (k && k.preprocess && !(e3 = k.preprocess(e3, b2, l)))
+ return;
+ if (k = h[b2])
+ f3 = e3, 0 <= a3.a.A(c, f3) ? f3 = false : (k = f3.match(d), f3 = null === k ? false : k[1] ? "Object(" + k[1] + ")" + k[2] : f3), k = f3;
+ k && q.push("'" + ("string" == typeof h[b2] ? h[b2] : b2) + "':function(_z){" + f3 + "=_z}");
+ }
+ g2 && (e3 = "function(){return " + e3 + " }");
+ p.push("'" + b2 + "':" + e3);
+ }
+ f2 = f2 || {};
+ var p = [], q = [], g2 = f2.valueAccessors, x = f2.bindingParams, B = "string" === typeof e2 ? b(e2) : e2;
+ a3.a.D(B, function(a4) {
+ l(
+ a4.key || a4.unknown,
+ a4.value
+ );
+ });
+ q.length && l("_ko_property_writers", "{" + q.join(",") + " }");
+ return p.join(",");
+ }, Id: function(a4, b2) {
+ for (var c14 = 0; c14 < a4.length; c14++)
+ if (a4[c14].key == b2)
+ return true;
+ return false;
+ }, eb: function(b2, c14, d2, e2, f2) {
+ if (b2 && a3.O(b2))
+ !a3.Za(b2) || f2 && b2.v() === e2 || b2(e2);
+ else if ((b2 = c14.get("_ko_property_writers")) && b2[d2])
+ b2[d2](e2);
+ } };
+ }();
+ a3.b("expressionRewriting", a3.m);
+ a3.b("expressionRewriting.bindingRewriteValidators", a3.m.Ra);
+ a3.b("expressionRewriting.parseObjectLiteral", a3.m.ac);
+ a3.b("expressionRewriting.preProcessBindings", a3.m.vb);
+ a3.b(
+ "expressionRewriting._twoWayBindings",
+ a3.m.wa
+ );
+ a3.b("jsonExpressionRewriting", a3.m);
+ a3.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson", a3.m.vb);
+ (function() {
+ function b(a4) {
+ return 8 == a4.nodeType && g.test(f ? a4.text : a4.nodeValue);
+ }
+ function c(a4) {
+ return 8 == a4.nodeType && h.test(f ? a4.text : a4.nodeValue);
+ }
+ function d(d2, e2) {
+ for (var f2 = d2, h2 = 1, g2 = []; f2 = f2.nextSibling; ) {
+ if (c(f2) && (a3.a.g.set(f2, k, true), h2--, 0 === h2))
+ return g2;
+ g2.push(f2);
+ b(f2) && h2++;
+ }
+ if (!e2)
+ throw Error("Cannot find closing comment tag to match: " + d2.nodeValue);
+ return null;
+ }
+ function e(a4, b2) {
+ var c14 = d(a4, b2);
+ return c14 ? 0 < c14.length ? c14[c14.length - 1].nextSibling : a4.nextSibling : null;
+ }
+ var f = w && "" === w.createComment("test").text, g = f ? /^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/ : /^\s*ko(?:\s+([\s\S]+))?\s*$/, h = f ? /^\x3c!--\s*\/ko\s*--\x3e$/ : /^\s*\/ko\s*$/, m = { ul: true, ol: true }, k = "__ko_matchedEndComment__";
+ a3.h = { ea: {}, childNodes: function(a4) {
+ return b(a4) ? d(a4) : a4.childNodes;
+ }, Ea: function(c14) {
+ if (b(c14)) {
+ c14 = a3.h.childNodes(c14);
+ for (var d2 = 0, e2 = c14.length; d2 < e2; d2++)
+ a3.removeNode(c14[d2]);
+ } else
+ a3.a.Tb(c14);
+ }, va: function(c14, d2) {
+ if (b(c14)) {
+ a3.h.Ea(c14);
+ for (var e2 = c14.nextSibling, f2 = 0, k2 = d2.length; f2 < k2; f2++)
+ e2.parentNode.insertBefore(d2[f2], e2);
+ } else
+ a3.a.va(c14, d2);
+ }, Vc: function(a4, c14) {
+ var d2;
+ b(a4) ? (d2 = a4.nextSibling, a4 = a4.parentNode) : d2 = a4.firstChild;
+ d2 ? c14 !== d2 && a4.insertBefore(c14, d2) : a4.appendChild(c14);
+ }, Wb: function(c14, d2, e2) {
+ e2 ? (e2 = e2.nextSibling, b(c14) && (c14 = c14.parentNode), e2 ? d2 !== e2 && c14.insertBefore(d2, e2) : c14.appendChild(d2)) : a3.h.Vc(c14, d2);
+ }, firstChild: function(a4) {
+ if (b(a4))
+ return !a4.nextSibling || c(a4.nextSibling) ? null : a4.nextSibling;
+ if (a4.firstChild && c(a4.firstChild))
+ throw Error("Found invalid end comment, as the first child of " + a4);
+ return a4.firstChild;
+ }, nextSibling: function(d2) {
+ b(d2) && (d2 = e(d2));
+ if (d2.nextSibling && c(d2.nextSibling)) {
+ var f2 = d2.nextSibling;
+ if (c(f2) && !a3.a.g.get(f2, k))
+ throw Error("Found end comment without a matching opening comment, as child of " + d2);
+ return null;
+ }
+ return d2.nextSibling;
+ }, Cd: b, Vd: function(a4) {
+ return (a4 = (f ? a4.text : a4.nodeValue).match(g)) ? a4[1] : null;
+ }, Sc: function(d2) {
+ if (m[a3.a.R(d2)]) {
+ var f2 = d2.firstChild;
+ if (f2) {
+ do
+ if (1 === f2.nodeType) {
+ var k2;
+ k2 = f2.firstChild;
+ var h2 = null;
+ if (k2) {
+ do
+ if (h2)
+ h2.push(k2);
+ else if (b(k2)) {
+ var g2 = e(k2, true);
+ g2 ? k2 = g2 : h2 = [k2];
+ } else
+ c(k2) && (h2 = [k2]);
+ while (k2 = k2.nextSibling);
+ }
+ if (k2 = h2)
+ for (h2 = f2.nextSibling, g2 = 0; g2 < k2.length; g2++)
+ h2 ? d2.insertBefore(k2[g2], h2) : d2.appendChild(k2[g2]);
+ }
+ while (f2 = f2.nextSibling);
+ }
+ }
+ } };
+ })();
+ a3.b("virtualElements", a3.h);
+ a3.b("virtualElements.allowedBindings", a3.h.ea);
+ a3.b("virtualElements.emptyNode", a3.h.Ea);
+ a3.b("virtualElements.insertAfter", a3.h.Wb);
+ a3.b("virtualElements.prepend", a3.h.Vc);
+ a3.b("virtualElements.setDomNodeChildren", a3.h.va);
+ (function() {
+ a3.ga = function() {
+ this.nd = {};
+ };
+ a3.a.extend(a3.ga.prototype, {
+ nodeHasBindings: function(b) {
+ switch (b.nodeType) {
+ case 1:
+ return null != b.getAttribute("data-bind") || a3.j.getComponentNameForNode(b);
+ case 8:
+ return a3.h.Cd(b);
+ default:
+ return false;
+ }
+ },
+ getBindings: function(b, c) {
+ var d = this.getBindingsString(b, c), d = d ? this.parseBindingsString(d, c, b) : null;
+ return a3.j.tc(d, b, c, false);
+ },
+ getBindingAccessors: function(b, c) {
+ var d = this.getBindingsString(b, c), d = d ? this.parseBindingsString(d, c, b, { valueAccessors: true }) : null;
+ return a3.j.tc(d, b, c, true);
+ },
+ getBindingsString: function(b) {
+ switch (b.nodeType) {
+ case 1:
+ return b.getAttribute("data-bind");
+ case 8:
+ return a3.h.Vd(b);
+ default:
+ return null;
+ }
+ },
+ parseBindingsString: function(b, c, d, e) {
+ try {
+ var f = this.nd, g = b + (e && e.valueAccessors || ""), h;
+ if (!(h = f[g])) {
+ var m, k = "with($context){with($data||{}){return{" + a3.m.vb(b, e) + "}}}";
+ m = new Function("$context", "$element", k);
+ h = f[g] = m;
+ }
+ return h(c, d);
+ } catch (l) {
+ throw l.message = "Unable to parse bindings.\nBindings value: " + b + "\nMessage: " + l.message, l;
+ }
+ }
+ });
+ a3.ga.instance = new a3.ga();
+ })();
+ a3.b("bindingProvider", a3.ga);
+ (function() {
+ function b(b2) {
+ var c14 = (b2 = a3.a.g.get(b2, z)) && b2.N;
+ c14 && (b2.N = null, c14.Tc());
+ }
+ function c(c14, d2, e2) {
+ this.node = c14;
+ this.yc = d2;
+ this.kb = [];
+ this.H = false;
+ d2.N || a3.a.K.za(c14, b);
+ e2 && e2.N && (e2.N.kb.push(c14), this.Kb = e2);
+ }
+ function d(a4) {
+ return function() {
+ return a4;
+ };
+ }
+ function e(a4) {
+ return a4();
+ }
+ function f(b2) {
+ return a3.a.Ga(a3.u.G(b2), function(a4, c14) {
+ return function() {
+ return b2()[c14];
+ };
+ });
+ }
+ function g(b2, c14, e2) {
+ return "function" === typeof b2 ? f(b2.bind(null, c14, e2)) : a3.a.Ga(b2, d);
+ }
+ function h(a4, b2) {
+ return f(this.getBindings.bind(this, a4, b2));
+ }
+ function m(b2, c14) {
+ var d2 = a3.h.firstChild(c14);
+ if (d2) {
+ var e2, f2 = a3.ga.instance, l2 = f2.preprocessNode;
+ if (l2) {
+ for (; e2 = d2; )
+ d2 = a3.h.nextSibling(e2), l2.call(f2, e2);
+ d2 = a3.h.firstChild(c14);
+ }
+ for (; e2 = d2; )
+ d2 = a3.h.nextSibling(e2), k(b2, e2);
+ }
+ a3.i.ma(c14, a3.i.H);
+ }
+ function k(b2, c14) {
+ var d2 = b2, e2 = 1 === c14.nodeType;
+ e2 && a3.h.Sc(c14);
+ if (e2 || a3.ga.instance.nodeHasBindings(c14))
+ d2 = p(c14, null, b2).bindingContextForDescendants;
+ d2 && !u3[a3.a.R(c14)] && m(d2, c14);
+ }
+ function l(b2) {
+ var c14 = [], d2 = {}, e2 = [];
+ a3.a.P(b2, function ca(f2) {
+ if (!d2[f2]) {
+ var k2 = a3.getBindingHandler(f2);
+ k2 && (k2.after && (e2.push(f2), a3.a.D(k2.after, function(c15) {
+ if (b2[c15]) {
+ if (-1 !== a3.a.A(e2, c15))
+ throw Error("Cannot combine the following bindings, because they have a cyclic dependency: " + e2.join(", "));
+ ca(c15);
+ }
+ }), e2.length--), c14.push({ key: f2, Mc: k2 }));
+ d2[f2] = true;
+ }
+ });
+ return c14;
+ }
+ function p(b2, c14, d2) {
+ var f2 = a3.a.g.Ub(b2, z, {}), k2 = f2.hd;
+ if (!c14) {
+ if (k2)
+ throw Error("You cannot apply bindings multiple times to the same element.");
+ f2.hd = true;
+ }
+ k2 || (f2.context = d2);
+ f2.Zb || (f2.Zb = {});
+ var g2;
+ if (c14 && "function" !== typeof c14)
+ g2 = c14;
+ else {
+ var p2 = a3.ga.instance, q3 = p2.getBindingAccessors || h, m2 = a3.$(function() {
+ if (g2 = c14 ? c14(d2, b2) : q3.call(p2, b2, d2)) {
+ if (d2[t])
+ d2[t]();
+ if (d2[B])
+ d2[B]();
+ }
+ return g2;
+ }, null, { l: b2 });
+ g2 && m2.ja() || (m2 = null);
+ }
+ var x2 = d2, u4;
+ if (g2) {
+ var J2 = function() {
+ return a3.a.Ga(m2 ? m2() : g2, e);
+ }, r2 = m2 ? function(a4) {
+ return function() {
+ return e(m2()[a4]);
+ };
+ } : function(a4) {
+ return g2[a4];
+ };
+ J2.get = function(a4) {
+ return g2[a4] && e(r2(a4));
+ };
+ J2.has = function(a4) {
+ return a4 in g2;
+ };
+ a3.i.H in g2 && a3.i.subscribe(b2, a3.i.H, function() {
+ var c15 = (0, g2[a3.i.H])();
+ if (c15) {
+ var d3 = a3.h.childNodes(b2);
+ d3.length && c15(d3, a3.Ec(d3[0]));
+ }
+ });
+ a3.i.pa in g2 && (x2 = a3.i.Cb(b2, d2), a3.i.subscribe(b2, a3.i.pa, function() {
+ var c15 = (0, g2[a3.i.pa])();
+ c15 && a3.h.firstChild(b2) && c15(b2);
+ }));
+ f2 = l(g2);
+ a3.a.D(f2, function(c15) {
+ var d3 = c15.Mc.init, e2 = c15.Mc.update, f3 = c15.key;
+ if (8 === b2.nodeType && !a3.h.ea[f3])
+ throw Error("The binding '" + f3 + "' cannot be used with virtual elements");
+ try {
+ "function" == typeof d3 && a3.u.G(function() {
+ var a4 = d3(b2, r2(f3), J2, x2.$data, x2);
+ if (a4 && a4.controlsDescendantBindings) {
+ if (u4 !== n)
+ throw Error("Multiple bindings (" + u4 + " and " + f3 + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
+ u4 = f3;
+ }
+ }), "function" == typeof e2 && a3.$(function() {
+ e2(b2, r2(f3), J2, x2.$data, x2);
+ }, null, { l: b2 });
+ } catch (k3) {
+ throw k3.message = 'Unable to process binding "' + f3 + ": " + g2[f3] + '"\nMessage: ' + k3.message, k3;
+ }
+ });
+ }
+ f2 = u4 === n;
+ return { shouldBindDescendants: f2, bindingContextForDescendants: f2 && x2 };
+ }
+ function q(b2, c14) {
+ return b2 && b2 instanceof a3.fa ? b2 : new a3.fa(b2, n, n, c14);
+ }
+ var t = a3.a.Da("_subscribable"), x = a3.a.Da("_ancestorBindingInfo"), B = a3.a.Da("_dataDependency");
+ a3.c = {};
+ var u3 = { script: true, textarea: true, template: true };
+ a3.getBindingHandler = function(b2) {
+ return a3.c[b2];
+ };
+ var J = {};
+ a3.fa = function(b2, c14, d2, e2, f2) {
+ function k2() {
+ var b3 = p2 ? h2() : h2, f3 = a3.a.f(b3);
+ c14 ? (a3.a.extend(l2, c14), x in c14 && (l2[x] = c14[x])) : (l2.$parents = [], l2.$root = f3, l2.ko = a3);
+ l2[t] = q3;
+ g2 ? f3 = l2.$data : (l2.$rawData = b3, l2.$data = f3);
+ d2 && (l2[d2] = f3);
+ e2 && e2(l2, c14, f3);
+ if (c14 && c14[t] && !a3.S.o().Vb(c14[t]))
+ c14[t]();
+ m2 && (l2[B] = m2);
+ return l2.$data;
+ }
+ var l2 = this, g2 = b2 === J, h2 = g2 ? n : b2, p2 = "function" == typeof h2 && !a3.O(h2), q3, m2 = f2 && f2.dataDependency;
+ f2 && f2.exportDependencies ? k2() : (q3 = a3.xb(k2), q3.v(), q3.ja() ? q3.equalityComparer = null : l2[t] = n);
+ };
+ a3.fa.prototype.createChildContext = function(b2, c14, d2, e2) {
+ !e2 && c14 && "object" == typeof c14 && (e2 = c14, c14 = e2.as, d2 = e2.extend);
+ if (c14 && e2 && e2.noChildContext) {
+ var f2 = "function" == typeof b2 && !a3.O(b2);
+ return new a3.fa(J, this, null, function(a4) {
+ d2 && d2(a4);
+ a4[c14] = f2 ? b2() : b2;
+ }, e2);
+ }
+ return new a3.fa(
+ b2,
+ this,
+ c14,
+ function(a4, b3) {
+ a4.$parentContext = b3;
+ a4.$parent = b3.$data;
+ a4.$parents = (b3.$parents || []).slice(0);
+ a4.$parents.unshift(a4.$parent);
+ d2 && d2(a4);
+ },
+ e2
+ );
+ };
+ a3.fa.prototype.extend = function(b2, c14) {
+ return new a3.fa(J, this, null, function(c15) {
+ a3.a.extend(c15, "function" == typeof b2 ? b2(c15) : b2);
+ }, c14);
+ };
+ var z = a3.a.g.Z();
+ c.prototype.Tc = function() {
+ this.Kb && this.Kb.N && this.Kb.N.sd(this.node);
+ };
+ c.prototype.sd = function(b2) {
+ a3.a.Pa(this.kb, b2);
+ !this.kb.length && this.H && this.Cc();
+ };
+ c.prototype.Cc = function() {
+ this.H = true;
+ this.yc.N && !this.kb.length && (this.yc.N = null, a3.a.K.yb(this.node, b), a3.i.ma(this.node, a3.i.pa), this.Tc());
+ };
+ a3.i = { H: "childrenComplete", pa: "descendantsComplete", subscribe: function(b2, c14, d2, e2, f2) {
+ var k2 = a3.a.g.Ub(b2, z, {});
+ k2.Fa || (k2.Fa = new a3.T());
+ f2 && f2.notifyImmediately && k2.Zb[c14] && a3.u.G(d2, e2, [b2]);
+ return k2.Fa.subscribe(d2, e2, c14);
+ }, ma: function(b2, c14) {
+ var d2 = a3.a.g.get(b2, z);
+ if (d2 && (d2.Zb[c14] = true, d2.Fa && d2.Fa.notifySubscribers(b2, c14), c14 == a3.i.H)) {
+ if (d2.N)
+ d2.N.Cc();
+ else if (d2.N === n && d2.Fa && d2.Fa.Wa(a3.i.pa))
+ throw Error("descendantsComplete event not supported for bindings on this node");
+ }
+ }, Cb: function(b2, d2) {
+ var e2 = a3.a.g.Ub(b2, z, {});
+ e2.N || (e2.N = new c(b2, e2, d2[x]));
+ return d2[x] == e2 ? d2 : d2.extend(function(a4) {
+ a4[x] = e2;
+ });
+ } };
+ a3.Td = function(b2) {
+ return (b2 = a3.a.g.get(b2, z)) && b2.context;
+ };
+ a3.ib = function(b2, c14, d2) {
+ 1 === b2.nodeType && a3.h.Sc(b2);
+ return p(b2, c14, q(d2));
+ };
+ a3.ld = function(b2, c14, d2) {
+ d2 = q(d2);
+ return a3.ib(b2, g(c14, d2, b2), d2);
+ };
+ a3.Oa = function(a4, b2) {
+ 1 !== b2.nodeType && 8 !== b2.nodeType || m(q(a4), b2);
+ };
+ a3.vc = function(a4, b2, c14) {
+ !v7 && A.jQuery && (v7 = A.jQuery);
+ if (2 > arguments.length) {
+ if (b2 = w.body, !b2)
+ throw Error("ko.applyBindings: could not find document.body; has the document been loaded?");
+ } else if (!b2 || 1 !== b2.nodeType && 8 !== b2.nodeType)
+ throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");
+ k(q(a4, c14), b2);
+ };
+ a3.Dc = function(b2) {
+ return !b2 || 1 !== b2.nodeType && 8 !== b2.nodeType ? n : a3.Td(b2);
+ };
+ a3.Ec = function(b2) {
+ return (b2 = a3.Dc(b2)) ? b2.$data : n;
+ };
+ a3.b("bindingHandlers", a3.c);
+ a3.b("bindingEvent", a3.i);
+ a3.b("bindingEvent.subscribe", a3.i.subscribe);
+ a3.b("bindingEvent.startPossiblyAsyncContentBinding", a3.i.Cb);
+ a3.b("applyBindings", a3.vc);
+ a3.b("applyBindingsToDescendants", a3.Oa);
+ a3.b("applyBindingAccessorsToNode", a3.ib);
+ a3.b("applyBindingsToNode", a3.ld);
+ a3.b("contextFor", a3.Dc);
+ a3.b("dataFor", a3.Ec);
+ })();
+ (function(b) {
+ function c(c14, e2) {
+ var k = Object.prototype.hasOwnProperty.call(f, c14) ? f[c14] : b, l;
+ k ? k.subscribe(e2) : (k = f[c14] = new a3.T(), k.subscribe(e2), d(c14, function(b2, d2) {
+ var e3 = !(!d2 || !d2.synchronous);
+ g[c14] = { definition: b2, Gd: e3 };
+ delete f[c14];
+ l || e3 ? k.notifySubscribers(b2) : a3.na.zb(function() {
+ k.notifySubscribers(b2);
+ });
+ }), l = true);
+ }
+ function d(a4, b2) {
+ e("getConfig", [a4], function(c14) {
+ c14 ? e("loadComponent", [a4, c14], function(a5) {
+ b2(
+ a5,
+ c14
+ );
+ }) : b2(null, null);
+ });
+ }
+ function e(c14, d2, f2, l) {
+ l || (l = a3.j.loaders.slice(0));
+ var g2 = l.shift();
+ if (g2) {
+ var q = g2[c14];
+ if (q) {
+ var t = false;
+ if (q.apply(g2, d2.concat(function(a4) {
+ t ? f2(null) : null !== a4 ? f2(a4) : e(c14, d2, f2, l);
+ })) !== b && (t = true, !g2.suppressLoaderExceptions))
+ throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.");
+ } else
+ e(c14, d2, f2, l);
+ } else
+ f2(null);
+ }
+ var f = {}, g = {};
+ a3.j = { get: function(d2, e2) {
+ var f2 = Object.prototype.hasOwnProperty.call(g, d2) ? g[d2] : b;
+ f2 ? f2.Gd ? a3.u.G(function() {
+ e2(f2.definition);
+ }) : a3.na.zb(function() {
+ e2(f2.definition);
+ }) : c(d2, e2);
+ }, Bc: function(a4) {
+ delete g[a4];
+ }, oc: e };
+ a3.j.loaders = [];
+ a3.b("components", a3.j);
+ a3.b("components.get", a3.j.get);
+ a3.b("components.clearCachedDefinition", a3.j.Bc);
+ })();
+ (function() {
+ function b(b2, c14, d2, e2) {
+ function g2() {
+ 0 === --B && e2(h2);
+ }
+ var h2 = {}, B = 2, u3 = d2.template;
+ d2 = d2.viewModel;
+ u3 ? f(c14, u3, function(c15) {
+ a3.j.oc("loadTemplate", [b2, c15], function(a4) {
+ h2.template = a4;
+ g2();
+ });
+ }) : g2();
+ d2 ? f(c14, d2, function(c15) {
+ a3.j.oc("loadViewModel", [b2, c15], function(a4) {
+ h2[m] = a4;
+ g2();
+ });
+ }) : g2();
+ }
+ function c(a4, b2, d2) {
+ if ("function" === typeof b2)
+ d2(function(a5) {
+ return new b2(a5);
+ });
+ else if ("function" === typeof b2[m])
+ d2(b2[m]);
+ else if ("instance" in b2) {
+ var e2 = b2.instance;
+ d2(function() {
+ return e2;
+ });
+ } else
+ "viewModel" in b2 ? c(a4, b2.viewModel, d2) : a4("Unknown viewModel value: " + b2);
+ }
+ function d(b2) {
+ switch (a3.a.R(b2)) {
+ case "script":
+ return a3.a.ua(b2.text);
+ case "textarea":
+ return a3.a.ua(b2.value);
+ case "template":
+ if (e(b2.content))
+ return a3.a.Ca(b2.content.childNodes);
+ }
+ return a3.a.Ca(b2.childNodes);
+ }
+ function e(a4) {
+ return A.DocumentFragment ? a4 instanceof DocumentFragment : a4 && 11 === a4.nodeType;
+ }
+ function f(a4, b2, c14) {
+ "string" === typeof b2.require ? T || A.require ? (T || A.require)([b2.require], function(a5) {
+ a5 && "object" === typeof a5 && a5.Xd && a5["default"] && (a5 = a5["default"]);
+ c14(a5);
+ }) : a4("Uses require, but no AMD loader is present") : c14(b2);
+ }
+ function g(a4) {
+ return function(b2) {
+ throw Error("Component '" + a4 + "': " + b2);
+ };
+ }
+ var h = {};
+ a3.j.register = function(b2, c14) {
+ if (!c14)
+ throw Error("Invalid configuration for " + b2);
+ if (a3.j.tb(b2))
+ throw Error("Component " + b2 + " is already registered");
+ h[b2] = c14;
+ };
+ a3.j.tb = function(a4) {
+ return Object.prototype.hasOwnProperty.call(h, a4);
+ };
+ a3.j.unregister = function(b2) {
+ delete h[b2];
+ a3.j.Bc(b2);
+ };
+ a3.j.Fc = { getConfig: function(b2, c14) {
+ c14(a3.j.tb(b2) ? h[b2] : null);
+ }, loadComponent: function(a4, c14, d2) {
+ var e2 = g(a4);
+ f(e2, c14, function(c15) {
+ b(a4, e2, c15, d2);
+ });
+ }, loadTemplate: function(b2, c14, f2) {
+ b2 = g(b2);
+ if ("string" === typeof c14)
+ f2(a3.a.ua(c14));
+ else if (c14 instanceof Array)
+ f2(c14);
+ else if (e(c14))
+ f2(a3.a.la(c14.childNodes));
+ else if (c14.element)
+ if (c14 = c14.element, A.HTMLElement ? c14 instanceof HTMLElement : c14 && c14.tagName && 1 === c14.nodeType)
+ f2(d(c14));
+ else if ("string" === typeof c14) {
+ var h2 = w.getElementById(c14);
+ h2 ? f2(d(h2)) : b2("Cannot find element with ID " + c14);
+ } else
+ b2("Unknown element type: " + c14);
+ else
+ b2("Unknown template value: " + c14);
+ }, loadViewModel: function(a4, b2, d2) {
+ c(g(a4), b2, d2);
+ } };
+ var m = "createViewModel";
+ a3.b("components.register", a3.j.register);
+ a3.b("components.isRegistered", a3.j.tb);
+ a3.b("components.unregister", a3.j.unregister);
+ a3.b("components.defaultLoader", a3.j.Fc);
+ a3.j.loaders.push(a3.j.Fc);
+ a3.j.dd = h;
+ })();
+ (function() {
+ function b(b2, e) {
+ var f = b2.getAttribute("params");
+ if (f) {
+ var f = c.parseBindingsString(f, e, b2, { valueAccessors: true, bindingParams: true }), f = a3.a.Ga(f, function(c14) {
+ return a3.o(c14, null, { l: b2 });
+ }), g = a3.a.Ga(
+ f,
+ function(c14) {
+ var e2 = c14.v();
+ return c14.ja() ? a3.o({ read: function() {
+ return a3.a.f(c14());
+ }, write: a3.Za(e2) && function(a4) {
+ c14()(a4);
+ }, l: b2 }) : e2;
+ }
+ );
+ Object.prototype.hasOwnProperty.call(g, "$raw") || (g.$raw = f);
+ return g;
+ }
+ return { $raw: {} };
+ }
+ a3.j.getComponentNameForNode = function(b2) {
+ var c14 = a3.a.R(b2);
+ if (a3.j.tb(c14) && (-1 != c14.indexOf("-") || "[object HTMLUnknownElement]" == "" + b2 || 8 >= a3.a.W && b2.tagName === c14))
+ return c14;
+ };
+ a3.j.tc = function(c14, e, f, g) {
+ if (1 === e.nodeType) {
+ var h = a3.j.getComponentNameForNode(e);
+ if (h) {
+ c14 = c14 || {};
+ if (c14.component)
+ throw Error('Cannot use the "component" binding on a custom element matching a component');
+ var m = { name: h, params: b(e, f) };
+ c14.component = g ? function() {
+ return m;
+ } : m;
+ }
+ }
+ return c14;
+ };
+ var c = new a3.ga();
+ 9 > a3.a.W && (a3.j.register = function(a4) {
+ return function(b2) {
+ return a4.apply(this, arguments);
+ };
+ }(a3.j.register), w.createDocumentFragment = function(b2) {
+ return function() {
+ var c14 = b2(), f = a3.j.dd, g;
+ for (g in f)
+ ;
+ return c14;
+ };
+ }(w.createDocumentFragment));
+ })();
+ (function() {
+ function b(b2, c14, d2) {
+ c14 = c14.template;
+ if (!c14)
+ throw Error("Component '" + b2 + "' has no template");
+ b2 = a3.a.Ca(c14);
+ a3.h.va(d2, b2);
+ }
+ function c(a4, b2, c14) {
+ var d2 = a4.createViewModel;
+ return d2 ? d2.call(
+ a4,
+ b2,
+ c14
+ ) : b2;
+ }
+ var d = 0;
+ a3.c.component = { init: function(e, f, g, h, m) {
+ function k() {
+ var a4 = l && l.dispose;
+ "function" === typeof a4 && a4.call(l);
+ q && q.s();
+ p = l = q = null;
+ }
+ var l, p, q, t = a3.a.la(a3.h.childNodes(e));
+ a3.h.Ea(e);
+ a3.a.K.za(e, k);
+ a3.o(function() {
+ var g2 = a3.a.f(f()), h2, u3;
+ "string" === typeof g2 ? h2 = g2 : (h2 = a3.a.f(g2.name), u3 = a3.a.f(g2.params));
+ if (!h2)
+ throw Error("No component name specified");
+ var n2 = a3.i.Cb(e, m), z = p = ++d;
+ a3.j.get(h2, function(d2) {
+ if (p === z) {
+ k();
+ if (!d2)
+ throw Error("Unknown component '" + h2 + "'");
+ b(h2, d2, e);
+ var f2 = c(d2, u3, { element: e, templateNodes: t });
+ d2 = n2.createChildContext(f2, { extend: function(a4) {
+ a4.$component = f2;
+ a4.$componentTemplateNodes = t;
+ } });
+ f2 && f2.koDescendantsComplete && (q = a3.i.subscribe(e, a3.i.pa, f2.koDescendantsComplete, f2));
+ l = f2;
+ a3.Oa(d2, e);
+ }
+ });
+ }, null, { l: e });
+ return { controlsDescendantBindings: true };
+ } };
+ a3.h.ea.component = true;
+ })();
+ var V = { "class": "className", "for": "htmlFor" };
+ a3.c.attr = { update: function(b, c) {
+ var d = a3.a.f(c()) || {};
+ a3.a.P(d, function(c14, d2) {
+ d2 = a3.a.f(d2);
+ var g = c14.indexOf(":"), g = "lookupNamespaceURI" in b && 0 < g && b.lookupNamespaceURI(c14.substr(0, g)), h = false === d2 || null === d2 || d2 === n;
+ h ? g ? b.removeAttributeNS(g, c14) : b.removeAttribute(c14) : d2 = d2.toString();
+ 8 >= a3.a.W && c14 in V ? (c14 = V[c14], h ? b.removeAttribute(c14) : b[c14] = d2) : h || (g ? b.setAttributeNS(g, c14, d2) : b.setAttribute(c14, d2));
+ "name" === c14 && a3.a.Yc(b, h ? "" : d2);
+ });
+ } };
+ (function() {
+ a3.c.checked = { after: ["value", "attr"], init: function(b, c, d) {
+ function e() {
+ var e2 = b.checked, f2 = g();
+ if (!a3.S.Ya() && (e2 || !m && !a3.S.qa())) {
+ var k2 = a3.u.G(c);
+ if (l) {
+ var q3 = p ? k2.v() : k2, z = t;
+ t = f2;
+ z !== f2 ? e2 && (a3.a.Na(q3, f2, true), a3.a.Na(q3, z, false)) : a3.a.Na(q3, f2, e2);
+ p && a3.Za(k2) && k2(q3);
+ } else
+ h && (f2 === n ? f2 = e2 : e2 || (f2 = n)), a3.m.eb(
+ k2,
+ d,
+ "checked",
+ f2,
+ true
+ );
+ }
+ }
+ function f() {
+ var d2 = a3.a.f(c()), e2 = g();
+ l ? (b.checked = 0 <= a3.a.A(d2, e2), t = e2) : b.checked = h && e2 === n ? !!d2 : g() === d2;
+ }
+ var g = a3.xb(function() {
+ if (d.has("checkedValue"))
+ return a3.a.f(d.get("checkedValue"));
+ if (q)
+ return d.has("value") ? a3.a.f(d.get("value")) : b.value;
+ }), h = "checkbox" == b.type, m = "radio" == b.type;
+ if (h || m) {
+ var k = c(), l = h && a3.a.f(k) instanceof Array, p = !(l && k.push && k.splice), q = m || l, t = l ? g() : n;
+ m && !b.name && a3.c.uniqueName.init(b, function() {
+ return true;
+ });
+ a3.o(e, null, { l: b });
+ a3.a.B(b, "click", e);
+ a3.o(f, null, { l: b });
+ k = n;
+ }
+ } };
+ a3.m.wa.checked = true;
+ a3.c.checkedValue = { update: function(b, c) {
+ b.value = a3.a.f(c());
+ } };
+ })();
+ a3.c["class"] = { update: function(b, c) {
+ var d = a3.a.Db(a3.a.f(c()));
+ a3.a.Eb(b, b.__ko__cssValue, false);
+ b.__ko__cssValue = d;
+ a3.a.Eb(b, d, true);
+ } };
+ a3.c.css = { update: function(b, c) {
+ var d = a3.a.f(c());
+ null !== d && "object" == typeof d ? a3.a.P(d, function(c14, d2) {
+ d2 = a3.a.f(d2);
+ a3.a.Eb(b, c14, d2);
+ }) : a3.c["class"].update(b, c);
+ } };
+ a3.c.enable = { update: function(b, c) {
+ var d = a3.a.f(c());
+ d && b.disabled ? b.removeAttribute("disabled") : d || b.disabled || (b.disabled = true);
+ } };
+ a3.c.disable = { update: function(b, c) {
+ a3.c.enable.update(b, function() {
+ return !a3.a.f(c());
+ });
+ } };
+ a3.c.event = { init: function(b, c, d, e, f) {
+ var g = c() || {};
+ a3.a.P(g, function(g2) {
+ "string" == typeof g2 && a3.a.B(b, g2, function(b2) {
+ var k, l = c()[g2];
+ if (l) {
+ try {
+ var p = a3.a.la(arguments);
+ e = f.$data;
+ p.unshift(e);
+ k = l.apply(e, p);
+ } finally {
+ true !== k && (b2.preventDefault ? b2.preventDefault() : b2.returnValue = false);
+ }
+ false === d.get(g2 + "Bubble") && (b2.cancelBubble = true, b2.stopPropagation && b2.stopPropagation());
+ }
+ });
+ });
+ } };
+ a3.c.foreach = { Rc: function(b) {
+ return function() {
+ var c = b(), d = a3.a.bc(c);
+ if (!d || "number" == typeof d.length)
+ return { foreach: c, templateEngine: a3.ba.Ma };
+ a3.a.f(c);
+ return { foreach: d.data, as: d.as, noChildContext: d.noChildContext, includeDestroyed: d.includeDestroyed, afterAdd: d.afterAdd, beforeRemove: d.beforeRemove, afterRender: d.afterRender, beforeMove: d.beforeMove, afterMove: d.afterMove, templateEngine: a3.ba.Ma };
+ };
+ }, init: function(b, c) {
+ return a3.c.template.init(b, a3.c.foreach.Rc(c));
+ }, update: function(b, c, d, e, f) {
+ return a3.c.template.update(b, a3.c.foreach.Rc(c), d, e, f);
+ } };
+ a3.m.Ra.foreach = false;
+ a3.h.ea.foreach = true;
+ a3.c.hasfocus = { init: function(b, c, d) {
+ function e(e2) {
+ b.__ko_hasfocusUpdating = true;
+ var f2 = b.ownerDocument;
+ if ("activeElement" in f2) {
+ var g2;
+ try {
+ g2 = f2.activeElement;
+ } catch (l) {
+ g2 = f2.body;
+ }
+ e2 = g2 === b;
+ }
+ f2 = c();
+ a3.m.eb(f2, d, "hasfocus", e2, true);
+ b.__ko_hasfocusLastValue = e2;
+ b.__ko_hasfocusUpdating = false;
+ }
+ var f = e.bind(null, true), g = e.bind(null, false);
+ a3.a.B(b, "focus", f);
+ a3.a.B(b, "focusin", f);
+ a3.a.B(b, "blur", g);
+ a3.a.B(b, "focusout", g);
+ b.__ko_hasfocusLastValue = false;
+ }, update: function(b, c) {
+ var d = !!a3.a.f(c());
+ b.__ko_hasfocusUpdating || b.__ko_hasfocusLastValue === d || (d ? b.focus() : b.blur(), !d && b.__ko_hasfocusLastValue && b.ownerDocument.body.focus(), a3.u.G(a3.a.Fb, null, [b, d ? "focusin" : "focusout"]));
+ } };
+ a3.m.wa.hasfocus = true;
+ a3.c.hasFocus = a3.c.hasfocus;
+ a3.m.wa.hasFocus = "hasfocus";
+ a3.c.html = { init: function() {
+ return { controlsDescendantBindings: true };
+ }, update: function(b, c) {
+ a3.a.fc(b, c());
+ } };
+ (function() {
+ function b(b2, d, e) {
+ a3.c[b2] = { init: function(b3, c, h, m, k) {
+ var l, p, q = {}, t, x, n2;
+ if (d) {
+ m = h.get("as");
+ var u3 = h.get("noChildContext");
+ n2 = !(m && u3);
+ q = { as: m, noChildContext: u3, exportDependencies: n2 };
+ }
+ x = (t = "render" == h.get("completeOn")) || h.has(a3.i.pa);
+ a3.o(function() {
+ var h2 = a3.a.f(c()), m2 = !e !== !h2, u4 = !p, r2;
+ if (n2 || m2 !== l) {
+ x && (k = a3.i.Cb(b3, k));
+ if (m2) {
+ if (!d || n2)
+ q.dataDependency = a3.S.o();
+ r2 = d ? k.createChildContext("function" == typeof h2 ? h2 : c, q) : a3.S.qa() ? k.extend(null, q) : k;
+ }
+ u4 && a3.S.qa() && (p = a3.a.Ca(a3.h.childNodes(b3), true));
+ m2 ? (u4 || a3.h.va(b3, a3.a.Ca(p)), a3.Oa(r2, b3)) : (a3.h.Ea(b3), t || a3.i.ma(b3, a3.i.H));
+ l = m2;
+ }
+ }, null, { l: b3 });
+ return { controlsDescendantBindings: true };
+ } };
+ a3.m.Ra[b2] = false;
+ a3.h.ea[b2] = true;
+ }
+ b("if");
+ b("ifnot", false, true);
+ b("with", true);
+ })();
+ a3.c.let = { init: function(b, c, d, e, f) {
+ c = f.extend(c);
+ a3.Oa(c, b);
+ return { controlsDescendantBindings: true };
+ } };
+ a3.h.ea.let = true;
+ var Q = {};
+ a3.c.options = { init: function(b) {
+ if ("select" !== a3.a.R(b))
+ throw Error("options binding applies only to SELECT elements");
+ for (; 0 < b.length; )
+ b.remove(0);
+ return { controlsDescendantBindings: true };
+ }, update: function(b, c, d) {
+ function e() {
+ return a3.a.jb(b.options, function(a4) {
+ return a4.selected;
+ });
+ }
+ function f(a4, b2, c14) {
+ var d2 = typeof b2;
+ return "function" == d2 ? b2(a4) : "string" == d2 ? a4[b2] : c14;
+ }
+ function g(c14, d2) {
+ if (x && l)
+ a3.i.ma(b, a3.i.H);
+ else if (t.length) {
+ var e2 = 0 <= a3.a.A(t, a3.w.M(d2[0]));
+ a3.a.Zc(d2[0], e2);
+ x && !e2 && a3.u.G(a3.a.Fb, null, [b, "change"]);
+ }
+ }
+ var h = b.multiple, m = 0 != b.length && h ? b.scrollTop : null, k = a3.a.f(c()), l = d.get("valueAllowUnset") && d.has("value"), p = d.get("optionsIncludeDestroyed");
+ c = {};
+ var q, t = [];
+ l || (h ? t = a3.a.Mb(e(), a3.w.M) : 0 <= b.selectedIndex && t.push(a3.w.M(b.options[b.selectedIndex])));
+ k && ("undefined" == typeof k.length && (k = [k]), q = a3.a.jb(k, function(b2) {
+ return p || b2 === n || null === b2 || !a3.a.f(b2._destroy);
+ }), d.has("optionsCaption") && (k = a3.a.f(d.get("optionsCaption")), null !== k && k !== n && q.unshift(Q)));
+ var x = false;
+ c.beforeRemove = function(a4) {
+ b.removeChild(a4);
+ };
+ k = g;
+ d.has("optionsAfterRender") && "function" == typeof d.get("optionsAfterRender") && (k = function(b2, c14) {
+ g(0, c14);
+ a3.u.G(d.get("optionsAfterRender"), null, [c14[0], b2 !== Q ? b2 : n]);
+ });
+ a3.a.ec(b, q, function(c14, e2, g2) {
+ g2.length && (t = !l && g2[0].selected ? [a3.w.M(g2[0])] : [], x = true);
+ e2 = b.ownerDocument.createElement("option");
+ c14 === Q ? (a3.a.Bb(e2, d.get("optionsCaption")), a3.w.cb(e2, n)) : (g2 = f(c14, d.get("optionsValue"), c14), a3.w.cb(e2, a3.a.f(g2)), c14 = f(c14, d.get("optionsText"), g2), a3.a.Bb(e2, c14));
+ return [e2];
+ }, c, k);
+ if (!l) {
+ var B;
+ h ? B = t.length && e().length < t.length : B = t.length && 0 <= b.selectedIndex ? a3.w.M(b.options[b.selectedIndex]) !== t[0] : t.length || 0 <= b.selectedIndex;
+ B && a3.u.G(a3.a.Fb, null, [b, "change"]);
+ }
+ (l || a3.S.Ya()) && a3.i.ma(b, a3.i.H);
+ a3.a.wd(b);
+ m && 20 < Math.abs(m - b.scrollTop) && (b.scrollTop = m);
+ } };
+ a3.c.options.$b = a3.a.g.Z();
+ a3.c.selectedOptions = { init: function(b, c, d) {
+ function e() {
+ var e2 = c(), f2 = [];
+ a3.a.D(b.getElementsByTagName("option"), function(b2) {
+ b2.selected && f2.push(a3.w.M(b2));
+ });
+ a3.m.eb(
+ e2,
+ d,
+ "selectedOptions",
+ f2
+ );
+ }
+ function f() {
+ var d2 = a3.a.f(c()), e2 = b.scrollTop;
+ d2 && "number" == typeof d2.length && a3.a.D(b.getElementsByTagName("option"), function(b2) {
+ var c14 = 0 <= a3.a.A(d2, a3.w.M(b2));
+ b2.selected != c14 && a3.a.Zc(b2, c14);
+ });
+ b.scrollTop = e2;
+ }
+ if ("select" != a3.a.R(b))
+ throw Error("selectedOptions binding applies only to SELECT elements");
+ var g;
+ a3.i.subscribe(b, a3.i.H, function() {
+ g ? e() : (a3.a.B(b, "change", e), g = a3.o(f, null, { l: b }));
+ }, null, { notifyImmediately: true });
+ }, update: function() {
+ } };
+ a3.m.wa.selectedOptions = true;
+ a3.c.style = { update: function(b, c) {
+ var d = a3.a.f(c() || {});
+ a3.a.P(d, function(c14, d2) {
+ d2 = a3.a.f(d2);
+ if (null === d2 || d2 === n || false === d2)
+ d2 = "";
+ if (v7)
+ v7(b).css(c14, d2);
+ else if (/^--/.test(c14))
+ b.style.setProperty(c14, d2);
+ else {
+ c14 = c14.replace(/-(\w)/g, function(a4, b2) {
+ return b2.toUpperCase();
+ });
+ var g = b.style[c14];
+ b.style[c14] = d2;
+ d2 === g || b.style[c14] != g || isNaN(d2) || (b.style[c14] = d2 + "px");
+ }
+ });
+ } };
+ a3.c.submit = { init: function(b, c, d, e, f) {
+ if ("function" != typeof c())
+ throw Error("The value for a submit binding must be a function");
+ a3.a.B(b, "submit", function(a4) {
+ var d2, e2 = c();
+ try {
+ d2 = e2.call(f.$data, b);
+ } finally {
+ true !== d2 && (a4.preventDefault ? a4.preventDefault() : a4.returnValue = false);
+ }
+ });
+ } };
+ a3.c.text = { init: function() {
+ return { controlsDescendantBindings: true };
+ }, update: function(b, c) {
+ a3.a.Bb(b, c());
+ } };
+ a3.h.ea.text = true;
+ (function() {
+ if (A && A.navigator) {
+ var b = function(a4) {
+ if (a4)
+ return parseFloat(a4[1]);
+ }, c = A.navigator.userAgent, d, e, f, g, h;
+ (d = A.opera && A.opera.version && parseInt(A.opera.version())) || (h = b(c.match(/Edge\/([^ ]+)$/))) || b(c.match(/Chrome\/([^ ]+)/)) || (e = b(c.match(/Version\/([^ ]+) Safari/))) || (f = b(c.match(/Firefox\/([^ ]+)/))) || (g = a3.a.W || b(c.match(/MSIE ([^ ]+)/))) || (g = b(c.match(/rv:([^ )]+)/)));
+ }
+ if (8 <= g && 10 > g)
+ var m = a3.a.g.Z(), k = a3.a.g.Z(), l = function(b2) {
+ var c14 = this.activeElement;
+ (c14 = c14 && a3.a.g.get(c14, k)) && c14(b2);
+ }, p = function(b2, c14) {
+ var d2 = b2.ownerDocument;
+ a3.a.g.get(d2, m) || (a3.a.g.set(d2, m, true), a3.a.B(d2, "selectionchange", l));
+ a3.a.g.set(b2, k, c14);
+ };
+ a3.c.textInput = { init: function(b2, c14, k2) {
+ function l2(c15, d2) {
+ a3.a.B(b2, c15, d2);
+ }
+ function m2() {
+ var d2 = a3.a.f(c14());
+ if (null === d2 || d2 === n)
+ d2 = "";
+ L !== n && d2 === L ? a3.a.setTimeout(m2, 4) : b2.value !== d2 && (y = true, b2.value = d2, y = false, v8 = b2.value);
+ }
+ function r2() {
+ w2 || (L = b2.value, w2 = a3.a.setTimeout(
+ z,
+ 4
+ ));
+ }
+ function z() {
+ clearTimeout(w2);
+ L = w2 = n;
+ var d2 = b2.value;
+ v8 !== d2 && (v8 = d2, a3.m.eb(c14(), k2, "textInput", d2));
+ }
+ var v8 = b2.value, w2, L, A2 = 9 == a3.a.W ? r2 : z, y = false;
+ g && l2("keypress", z);
+ 11 > g && l2("propertychange", function(a4) {
+ y || "value" !== a4.propertyName || A2(a4);
+ });
+ 8 == g && (l2("keyup", z), l2("keydown", z));
+ p && (p(b2, A2), l2("dragend", r2));
+ (!g || 9 <= g) && l2("input", A2);
+ 5 > e && "textarea" === a3.a.R(b2) ? (l2("keydown", r2), l2("paste", r2), l2("cut", r2)) : 11 > d ? l2("keydown", r2) : 4 > f ? (l2("DOMAutoComplete", z), l2("dragdrop", z), l2("drop", z)) : h && "number" === b2.type && l2("keydown", r2);
+ l2(
+ "change",
+ z
+ );
+ l2("blur", z);
+ a3.o(m2, null, { l: b2 });
+ } };
+ a3.m.wa.textInput = true;
+ a3.c.textinput = { preprocess: function(a4, b2, c14) {
+ c14("textInput", a4);
+ } };
+ })();
+ a3.c.uniqueName = { init: function(b, c) {
+ if (c()) {
+ var d = "ko_unique_" + ++a3.c.uniqueName.rd;
+ a3.a.Yc(b, d);
+ }
+ } };
+ a3.c.uniqueName.rd = 0;
+ a3.c.using = { init: function(b, c, d, e, f) {
+ var g;
+ d.has("as") && (g = { as: d.get("as"), noChildContext: d.get("noChildContext") });
+ c = f.createChildContext(c, g);
+ a3.Oa(c, b);
+ return { controlsDescendantBindings: true };
+ } };
+ a3.h.ea.using = true;
+ a3.c.value = { init: function(b, c, d) {
+ var e = a3.a.R(b), f = "input" == e;
+ if (!f || "checkbox" != b.type && "radio" != b.type) {
+ var g = [], h = d.get("valueUpdate"), m = false, k = null;
+ h && ("string" == typeof h ? g = [h] : g = a3.a.wc(h), a3.a.Pa(g, "change"));
+ var l = function() {
+ k = null;
+ m = false;
+ var e2 = c(), f2 = a3.w.M(b);
+ a3.m.eb(e2, d, "value", f2);
+ };
+ !a3.a.W || !f || "text" != b.type || "off" == b.autocomplete || b.form && "off" == b.form.autocomplete || -1 != a3.a.A(g, "propertychange") || (a3.a.B(b, "propertychange", function() {
+ m = true;
+ }), a3.a.B(b, "focus", function() {
+ m = false;
+ }), a3.a.B(b, "blur", function() {
+ m && l();
+ }));
+ a3.a.D(g, function(c14) {
+ var d2 = l;
+ a3.a.Ud(c14, "after") && (d2 = function() {
+ k = a3.w.M(b);
+ a3.a.setTimeout(l, 0);
+ }, c14 = c14.substring(5));
+ a3.a.B(b, c14, d2);
+ });
+ var p;
+ p = f && "file" == b.type ? function() {
+ var d2 = a3.a.f(c());
+ null === d2 || d2 === n || "" === d2 ? b.value = "" : a3.u.G(l);
+ } : function() {
+ var f2 = a3.a.f(c()), g2 = a3.w.M(b);
+ if (null !== k && f2 === k)
+ a3.a.setTimeout(p, 0);
+ else if (f2 !== g2 || g2 === n)
+ "select" === e ? (g2 = d.get("valueAllowUnset"), a3.w.cb(b, f2, g2), g2 || f2 === a3.w.M(b) || a3.u.G(l)) : a3.w.cb(b, f2);
+ };
+ if ("select" === e) {
+ var q;
+ a3.i.subscribe(
+ b,
+ a3.i.H,
+ function() {
+ q ? d.get("valueAllowUnset") ? p() : l() : (a3.a.B(b, "change", l), q = a3.o(p, null, { l: b }));
+ },
+ null,
+ { notifyImmediately: true }
+ );
+ } else
+ a3.a.B(b, "change", l), a3.o(p, null, { l: b });
+ } else
+ a3.ib(b, { checkedValue: c });
+ }, update: function() {
+ } };
+ a3.m.wa.value = true;
+ a3.c.visible = { update: function(b, c) {
+ var d = a3.a.f(c()), e = "none" != b.style.display;
+ d && !e ? b.style.display = "" : !d && e && (b.style.display = "none");
+ } };
+ a3.c.hidden = { update: function(b, c) {
+ a3.c.visible.update(b, function() {
+ return !a3.a.f(c());
+ });
+ } };
+ (function(b) {
+ a3.c[b] = { init: function(c, d, e, f, g) {
+ return a3.c.event.init.call(this, c, function() {
+ var a4 = {};
+ a4[b] = d();
+ return a4;
+ }, e, f, g);
+ } };
+ })("click");
+ a3.ca = function() {
+ };
+ a3.ca.prototype.renderTemplateSource = function() {
+ throw Error("Override renderTemplateSource");
+ };
+ a3.ca.prototype.createJavaScriptEvaluatorBlock = function() {
+ throw Error("Override createJavaScriptEvaluatorBlock");
+ };
+ a3.ca.prototype.makeTemplateSource = function(b, c) {
+ if ("string" == typeof b) {
+ c = c || w;
+ var d = c.getElementById(b);
+ if (!d)
+ throw Error("Cannot find template with ID " + b);
+ return new a3.C.F(d);
+ }
+ if (1 == b.nodeType || 8 == b.nodeType)
+ return new a3.C.ia(b);
+ throw Error("Unknown template type: " + b);
+ };
+ a3.ca.prototype.renderTemplate = function(a4, c, d, e) {
+ a4 = this.makeTemplateSource(a4, e);
+ return this.renderTemplateSource(a4, c, d, e);
+ };
+ a3.ca.prototype.isTemplateRewritten = function(a4, c) {
+ return false === this.allowTemplateRewriting ? true : this.makeTemplateSource(a4, c).data("isRewritten");
+ };
+ a3.ca.prototype.rewriteTemplate = function(a4, c, d) {
+ a4 = this.makeTemplateSource(a4, d);
+ c = c(a4.text());
+ a4.text(c);
+ a4.data("isRewritten", true);
+ };
+ a3.b("templateEngine", a3.ca);
+ a3.kc = function() {
+ function b(b2, c14, d2, h) {
+ b2 = a3.m.ac(b2);
+ for (var m = a3.m.Ra, k = 0; k < b2.length; k++) {
+ var l = b2[k].key;
+ if (Object.prototype.hasOwnProperty.call(
+ m,
+ l
+ )) {
+ var p = m[l];
+ if ("function" === typeof p) {
+ if (l = p(b2[k].value))
+ throw Error(l);
+ } else if (!p)
+ throw Error("This template engine does not support the '" + l + "' binding within its templates");
+ }
+ }
+ d2 = "ko.__tr_ambtns(function($context,$element){return(function(){return{ " + a3.m.vb(b2, { valueAccessors: true }) + " } })()},'" + d2.toLowerCase() + "')";
+ return h.createJavaScriptEvaluatorBlock(d2) + c14;
+ }
+ var c = /(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi, d = /\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;
+ return { xd: function(b2, c14, d2) {
+ c14.isTemplateRewritten(b2, d2) || c14.rewriteTemplate(b2, function(b3) {
+ return a3.kc.Ld(b3, c14);
+ }, d2);
+ }, Ld: function(a4, f) {
+ return a4.replace(c, function(a5, c14, d2, e, l) {
+ return b(l, c14, d2, f);
+ }).replace(d, function(a5, c14) {
+ return b(c14, "", "#comment", f);
+ });
+ }, md: function(b2, c14) {
+ return a3.aa.Xb(function(d2, h) {
+ var m = d2.nextSibling;
+ m && m.nodeName.toLowerCase() === c14 && a3.ib(m, b2, h);
+ });
+ } };
+ }();
+ a3.b("__tr_ambtns", a3.kc.md);
+ (function() {
+ a3.C = {};
+ a3.C.F = function(b2) {
+ if (this.F = b2) {
+ var c14 = a3.a.R(b2);
+ this.ab = "script" === c14 ? 1 : "textarea" === c14 ? 2 : "template" == c14 && b2.content && 11 === b2.content.nodeType ? 3 : 4;
+ }
+ };
+ a3.C.F.prototype.text = function() {
+ var b2 = 1 === this.ab ? "text" : 2 === this.ab ? "value" : "innerHTML";
+ if (0 == arguments.length)
+ return this.F[b2];
+ var c14 = arguments[0];
+ "innerHTML" === b2 ? a3.a.fc(this.F, c14) : this.F[b2] = c14;
+ };
+ var b = a3.a.g.Z() + "_";
+ a3.C.F.prototype.data = function(c14) {
+ if (1 === arguments.length)
+ return a3.a.g.get(this.F, b + c14);
+ a3.a.g.set(this.F, b + c14, arguments[1]);
+ };
+ var c = a3.a.g.Z();
+ a3.C.F.prototype.nodes = function() {
+ var b2 = this.F;
+ if (0 == arguments.length) {
+ var e = a3.a.g.get(b2, c) || {}, f = e.lb || (3 === this.ab ? b2.content : 4 === this.ab ? b2 : n);
+ if (!f || e.jd) {
+ var g = this.text();
+ g && g !== e.bb && (f = a3.a.Md(g, b2.ownerDocument), a3.a.g.set(b2, c, { lb: f, bb: g, jd: true }));
+ }
+ return f;
+ }
+ e = arguments[0];
+ this.ab !== n && this.text("");
+ a3.a.g.set(b2, c, { lb: e });
+ };
+ a3.C.ia = function(a4) {
+ this.F = a4;
+ };
+ a3.C.ia.prototype = new a3.C.F();
+ a3.C.ia.prototype.constructor = a3.C.ia;
+ a3.C.ia.prototype.text = function() {
+ if (0 == arguments.length) {
+ var b2 = a3.a.g.get(this.F, c) || {};
+ b2.bb === n && b2.lb && (b2.bb = b2.lb.innerHTML);
+ return b2.bb;
+ }
+ a3.a.g.set(
+ this.F,
+ c,
+ { bb: arguments[0] }
+ );
+ };
+ a3.b("templateSources", a3.C);
+ a3.b("templateSources.domElement", a3.C.F);
+ a3.b("templateSources.anonymousTemplate", a3.C.ia);
+ })();
+ (function() {
+ function b(b2, c14, d2) {
+ var e2;
+ for (c14 = a3.h.nextSibling(c14); b2 && (e2 = b2) !== c14; )
+ b2 = a3.h.nextSibling(e2), d2(e2, b2);
+ }
+ function c(c14, d2) {
+ if (c14.length) {
+ var e2 = c14[0], f2 = c14[c14.length - 1], g2 = e2.parentNode, h2 = a3.ga.instance, m2 = h2.preprocessNode;
+ if (m2) {
+ b(e2, f2, function(a4, b2) {
+ var c15 = a4.previousSibling, d3 = m2.call(h2, a4);
+ d3 && (a4 === e2 && (e2 = d3[0] || b2), a4 === f2 && (f2 = d3[d3.length - 1] || c15));
+ });
+ c14.length = 0;
+ if (!e2)
+ return;
+ e2 === f2 ? c14.push(e2) : (c14.push(e2, f2), a3.a.Ua(c14, g2));
+ }
+ b(e2, f2, function(b2) {
+ 1 !== b2.nodeType && 8 !== b2.nodeType || a3.vc(d2, b2);
+ });
+ b(e2, f2, function(b2) {
+ 1 !== b2.nodeType && 8 !== b2.nodeType || a3.aa.cd(b2, [d2]);
+ });
+ a3.a.Ua(c14, g2);
+ }
+ }
+ function d(a4) {
+ return a4.nodeType ? a4 : 0 < a4.length ? a4[0] : null;
+ }
+ function e(b2, e2, f2, h2, m2) {
+ m2 = m2 || {};
+ var n2 = (b2 && d(b2) || f2 || {}).ownerDocument, B = m2.templateEngine || g;
+ a3.kc.xd(f2, B, n2);
+ f2 = B.renderTemplate(f2, h2, m2, n2);
+ if ("number" != typeof f2.length || 0 < f2.length && "number" != typeof f2[0].nodeType)
+ throw Error("Template engine must return an array of DOM nodes");
+ n2 = false;
+ switch (e2) {
+ case "replaceChildren":
+ a3.h.va(
+ b2,
+ f2
+ );
+ n2 = true;
+ break;
+ case "replaceNode":
+ a3.a.Xc(b2, f2);
+ n2 = true;
+ break;
+ case "ignoreTargetNode":
+ break;
+ default:
+ throw Error("Unknown renderMode: " + e2);
+ }
+ n2 && (c(f2, h2), m2.afterRender && a3.u.G(m2.afterRender, null, [f2, h2[m2.as || "$data"]]), "replaceChildren" == e2 && a3.i.ma(b2, a3.i.H));
+ return f2;
+ }
+ function f(b2, c14, d2) {
+ return a3.O(b2) ? b2() : "function" === typeof b2 ? b2(c14, d2) : b2;
+ }
+ var g;
+ a3.gc = function(b2) {
+ if (b2 != n && !(b2 instanceof a3.ca))
+ throw Error("templateEngine must inherit from ko.templateEngine");
+ g = b2;
+ };
+ a3.dc = function(b2, c14, h2, m2, t) {
+ h2 = h2 || {};
+ if ((h2.templateEngine || g) == n)
+ throw Error("Set a template engine before calling renderTemplate");
+ t = t || "replaceChildren";
+ if (m2) {
+ var x = d(m2);
+ return a3.$(function() {
+ var g2 = c14 && c14 instanceof a3.fa ? c14 : new a3.fa(c14, null, null, null, { exportDependencies: true }), n2 = f(b2, g2.$data, g2), g2 = e(m2, t, n2, g2, h2);
+ "replaceNode" == t && (m2 = g2, x = d(m2));
+ }, null, { Sa: function() {
+ return !x || !a3.a.Sb(x);
+ }, l: x && "replaceNode" == t ? x.parentNode : x });
+ }
+ return a3.aa.Xb(function(d2) {
+ a3.dc(b2, c14, h2, d2, "replaceNode");
+ });
+ };
+ a3.Qd = function(b2, d2, g2, h2, m2) {
+ function x(b3, c14) {
+ a3.u.G(a3.a.ec, null, [h2, b3, u3, g2, r2, c14]);
+ a3.i.ma(h2, a3.i.H);
+ }
+ function r2(a4, b3) {
+ c(b3, v8);
+ g2.afterRender && g2.afterRender(b3, a4);
+ v8 = null;
+ }
+ function u3(a4, c14) {
+ v8 = m2.createChildContext(a4, { as: z, noChildContext: g2.noChildContext, extend: function(a5) {
+ a5.$index = c14;
+ z && (a5[z + "Index"] = c14);
+ } });
+ var d3 = f(b2, a4, v8);
+ return e(h2, "ignoreTargetNode", d3, v8, g2);
+ }
+ var v8, z = g2.as, w2 = false === g2.includeDestroyed || a3.options.foreachHidesDestroyed && !g2.includeDestroyed;
+ if (w2 || g2.beforeRemove || !a3.Pc(d2))
+ return a3.$(function() {
+ var b3 = a3.a.f(d2) || [];
+ "undefined" == typeof b3.length && (b3 = [b3]);
+ w2 && (b3 = a3.a.jb(b3, function(b4) {
+ return b4 === n || null === b4 || !a3.a.f(b4._destroy);
+ }));
+ x(b3);
+ }, null, { l: h2 });
+ x(d2.v());
+ var A2 = d2.subscribe(function(a4) {
+ x(d2(), a4);
+ }, null, "arrayChange");
+ A2.l(h2);
+ return A2;
+ };
+ var h = a3.a.g.Z(), m = a3.a.g.Z();
+ a3.c.template = { init: function(b2, c14) {
+ var d2 = a3.a.f(c14());
+ if ("string" == typeof d2 || "name" in d2)
+ a3.h.Ea(b2);
+ else if ("nodes" in d2) {
+ d2 = d2.nodes || [];
+ if (a3.O(d2))
+ throw Error('The "nodes" option must be a plain, non-observable array.');
+ var e2 = d2[0] && d2[0].parentNode;
+ e2 && a3.a.g.get(e2, m) || (e2 = a3.a.Yb(d2), a3.a.g.set(e2, m, true));
+ new a3.C.ia(b2).nodes(e2);
+ } else if (d2 = a3.h.childNodes(b2), 0 < d2.length)
+ e2 = a3.a.Yb(d2), new a3.C.ia(b2).nodes(e2);
+ else
+ throw Error("Anonymous template defined, but no template content was provided");
+ return { controlsDescendantBindings: true };
+ }, update: function(b2, c14, d2, e2, f2) {
+ var g2 = c14();
+ c14 = a3.a.f(g2);
+ d2 = true;
+ e2 = null;
+ "string" == typeof c14 ? c14 = {} : (g2 = "name" in c14 ? c14.name : b2, "if" in c14 && (d2 = a3.a.f(c14["if"])), d2 && "ifnot" in c14 && (d2 = !a3.a.f(c14.ifnot)), d2 && !g2 && (d2 = false));
+ "foreach" in c14 ? e2 = a3.Qd(g2, d2 && c14.foreach || [], c14, b2, f2) : d2 ? (d2 = f2, "data" in c14 && (d2 = f2.createChildContext(c14.data, { as: c14.as, noChildContext: c14.noChildContext, exportDependencies: true })), e2 = a3.dc(g2, d2, c14, b2)) : a3.h.Ea(b2);
+ f2 = e2;
+ (c14 = a3.a.g.get(b2, h)) && "function" == typeof c14.s && c14.s();
+ a3.a.g.set(b2, h, !f2 || f2.ja && !f2.ja() ? n : f2);
+ } };
+ a3.m.Ra.template = function(b2) {
+ b2 = a3.m.ac(b2);
+ return 1 == b2.length && b2[0].unknown || a3.m.Id(b2, "name") ? null : "This template engine does not support anonymous templates nested within its templates";
+ };
+ a3.h.ea.template = true;
+ })();
+ a3.b("setTemplateEngine", a3.gc);
+ a3.b("renderTemplate", a3.dc);
+ a3.a.Kc = function(a4, c, d) {
+ if (a4.length && c.length) {
+ var e, f, g, h, m;
+ for (e = f = 0; (!d || e < d) && (h = a4[f]); ++f) {
+ for (g = 0; m = c[g]; ++g)
+ if (h.value === m.value) {
+ h.moved = m.index;
+ m.moved = h.index;
+ c.splice(g, 1);
+ e = g = 0;
+ break;
+ }
+ e += g;
+ }
+ }
+ };
+ a3.a.Pb = function() {
+ function b(b2, d, e, f, g) {
+ var h = Math.min, m = Math.max, k = [], l, p = b2.length, q, n2 = d.length, r2 = n2 - p || 1, v8 = p + n2 + 1, u3, w2, z;
+ for (l = 0; l <= p; l++)
+ for (w2 = u3, k.push(u3 = []), z = h(n2, l + r2), q = m(0, l - 1); q <= z; q++)
+ u3[q] = q ? l ? b2[l - 1] === d[q - 1] ? w2[q - 1] : h(w2[q] || v8, u3[q - 1] || v8) + 1 : q + 1 : l + 1;
+ h = [];
+ m = [];
+ r2 = [];
+ l = p;
+ for (q = n2; l || q; )
+ n2 = k[l][q] - 1, q && n2 === k[l][q - 1] ? m.push(h[h.length] = { status: e, value: d[--q], index: q }) : l && n2 === k[l - 1][q] ? r2.push(h[h.length] = { status: f, value: b2[--l], index: l }) : (--q, --l, g.sparse || h.push({ status: "retained", value: d[q] }));
+ a3.a.Kc(r2, m, !g.dontLimitMoves && 10 * p);
+ return h.reverse();
+ }
+ return function(a4, d, e) {
+ e = "boolean" === typeof e ? { dontLimitMoves: e } : e || {};
+ a4 = a4 || [];
+ d = d || [];
+ return a4.length < d.length ? b(a4, d, "added", "deleted", e) : b(d, a4, "deleted", "added", e);
+ };
+ }();
+ a3.b("utils.compareArrays", a3.a.Pb);
+ (function() {
+ function b(b2, c14, d2, h, m) {
+ var k = [], l = a3.$(function() {
+ var l2 = c14(d2, m, a3.a.Ua(k, b2)) || [];
+ 0 < k.length && (a3.a.Xc(k, l2), h && a3.u.G(h, null, [d2, l2, m]));
+ k.length = 0;
+ a3.a.Nb(k, l2);
+ }, null, { l: b2, Sa: function() {
+ return !a3.a.kd(k);
+ } });
+ return { Y: k, $: l.ja() ? l : n };
+ }
+ var c = a3.a.g.Z(), d = a3.a.g.Z();
+ a3.a.ec = function(e, f, g, h, m, k) {
+ function l(b2) {
+ y = { Aa: b2, pb: a3.ta(w2++) };
+ v8.push(y);
+ r2 || F2.push(y);
+ }
+ function p(b2) {
+ y = t[b2];
+ w2 !== y.pb.v() && D2.push(y);
+ y.pb(w2++);
+ a3.a.Ua(y.Y, e);
+ v8.push(y);
+ }
+ function q(b2, c14) {
+ if (b2)
+ for (var d2 = 0, e2 = c14.length; d2 < e2; d2++)
+ a3.a.D(c14[d2].Y, function(a4) {
+ b2(a4, d2, c14[d2].Aa);
+ });
+ }
+ f = f || [];
+ "undefined" == typeof f.length && (f = [f]);
+ h = h || {};
+ var t = a3.a.g.get(e, c), r2 = !t, v8 = [], u3 = 0, w2 = 0, z = [], A2 = [], C2 = [], D2 = [], F2 = [], y, I2 = 0;
+ if (r2)
+ a3.a.D(f, l);
+ else {
+ if (!k || t && t._countWaitingForRemove) {
+ var E = a3.a.Mb(t, function(a4) {
+ return a4.Aa;
+ });
+ k = a3.a.Pb(E, f, { dontLimitMoves: h.dontLimitMoves, sparse: true });
+ }
+ for (var E = 0, G2, H2, K2; G2 = k[E]; E++)
+ switch (H2 = G2.moved, K2 = G2.index, G2.status) {
+ case "deleted":
+ for (; u3 < K2; )
+ p(u3++);
+ H2 === n && (y = t[u3], y.$ && (y.$.s(), y.$ = n), a3.a.Ua(y.Y, e).length && (h.beforeRemove && (v8.push(y), I2++, y.Aa === d ? y = null : C2.push(y)), y && z.push.apply(z, y.Y)));
+ u3++;
+ break;
+ case "added":
+ for (; w2 < K2; )
+ p(u3++);
+ H2 !== n ? (A2.push(v8.length), p(H2)) : l(G2.value);
+ }
+ for (; w2 < f.length; )
+ p(u3++);
+ v8._countWaitingForRemove = I2;
+ }
+ a3.a.g.set(e, c, v8);
+ q(h.beforeMove, D2);
+ a3.a.D(
+ z,
+ h.beforeRemove ? a3.oa : a3.removeNode
+ );
+ var M, O, P;
+ try {
+ P = e.ownerDocument.activeElement;
+ } catch (N2) {
+ }
+ if (A2.length)
+ for (; (E = A2.shift()) != n; ) {
+ y = v8[E];
+ for (M = n; E; )
+ if ((O = v8[--E].Y) && O.length) {
+ M = O[O.length - 1];
+ break;
+ }
+ for (f = 0; u3 = y.Y[f]; M = u3, f++)
+ a3.h.Wb(e, u3, M);
+ }
+ for (E = 0; y = v8[E]; E++) {
+ y.Y || a3.a.extend(y, b(e, g, y.Aa, m, y.pb));
+ for (f = 0; u3 = y.Y[f]; M = u3, f++)
+ a3.h.Wb(e, u3, M);
+ !y.Ed && m && (m(y.Aa, y.Y, y.pb), y.Ed = true, M = y.Y[y.Y.length - 1]);
+ }
+ P && e.ownerDocument.activeElement != P && P.focus();
+ q(h.beforeRemove, C2);
+ for (E = 0; E < C2.length; ++E)
+ C2[E].Aa = d;
+ q(h.afterMove, D2);
+ q(h.afterAdd, F2);
+ };
+ })();
+ a3.b("utils.setDomNodeChildrenFromArrayMapping", a3.a.ec);
+ a3.ba = function() {
+ this.allowTemplateRewriting = false;
+ };
+ a3.ba.prototype = new a3.ca();
+ a3.ba.prototype.constructor = a3.ba;
+ a3.ba.prototype.renderTemplateSource = function(b, c, d, e) {
+ if (c = (9 > a3.a.W ? 0 : b.nodes) ? b.nodes() : null)
+ return a3.a.la(c.cloneNode(true).childNodes);
+ b = b.text();
+ return a3.a.ua(b, e);
+ };
+ a3.ba.Ma = new a3.ba();
+ a3.gc(a3.ba.Ma);
+ a3.b("nativeTemplateEngine", a3.ba);
+ (function() {
+ a3.$a = function() {
+ var a4 = this.Hd = function() {
+ if (!v7 || !v7.tmpl)
+ return 0;
+ try {
+ if (0 <= v7.tmpl.tag.tmpl.open.toString().indexOf("__"))
+ return 2;
+ } catch (a5) {
+ }
+ return 1;
+ }();
+ this.renderTemplateSource = function(b2, e, f, g) {
+ g = g || w;
+ f = f || {};
+ if (2 > a4)
+ throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");
+ var h = b2.data("precompiled");
+ h || (h = b2.text() || "", h = v7.template(null, "{{ko_with $item.koBindingContext}}" + h + "{{/ko_with}}"), b2.data("precompiled", h));
+ b2 = [e.$data];
+ e = v7.extend({ koBindingContext: e }, f.templateOptions);
+ e = v7.tmpl(h, b2, e);
+ e.appendTo(g.createElement("div"));
+ v7.fragments = {};
+ return e;
+ };
+ this.createJavaScriptEvaluatorBlock = function(a5) {
+ return "{{ko_code ((function() { return " + a5 + " })()) }}";
+ };
+ this.addTemplate = function(a5, b2) {
+ w.write("
+
+
+
+